Built motion from commit 0b90e591.|2.5.33
authorAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 26 Nov 2021 13:33:34 +0000 (14:33 +0100)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 26 Nov 2021 13:33:34 +0000 (14:33 +0100)
1166 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/cmContactHasItem/cmContactHasItem.attributes.js
server/api/cmContactHasItem/cmContactHasItem.controller.js
server/api/cmContactHasItem/cmContactHasItem.model.js
server/api/cmContactHasItem/cmContactHasItem.rpc.js
server/api/cmContactHasItem/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/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
server/api/cmHopperAdditionalPhone/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/contactItemType/contactItemType.attributes.js
server/api/contactItemType/contactItemType.controller.js
server/api/contactItemType/contactItemType.model.js
server/api/contactItemType/contactItemType.rpc.js
server/api/contactItemType/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/realtime/realtime.model.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/teamVoiceQueue/index.js
server/api/teamVoiceQueue/teamVoiceQueue.attributes.js
server/api/teamVoiceQueue/teamVoiceQueue.model.js
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userNotification/index.js
server/api/userNotification/userNotification.attributes.js
server/api/userNotification/userNotification.controller.js
server/api/userNotification/userNotification.events.js
server/api/userNotification/userNotification.model.js
server/api/userNotification/userNotification.rpc.js
server/api/userNotification/userNotification.socket.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/userWhatsappQueue/index.js
server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
server/api/userWhatsappQueue/userWhatsappQueue.model.js
server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/api/webbar/index.js
server/api/webbar/webbar.controller.js
server/api/whatsappAccount/index.js
server/api/whatsappAccount/whatsappAccount.attributes.js
server/api/whatsappAccount/whatsappAccount.controller.js
server/api/whatsappAccount/whatsappAccount.events.js
server/api/whatsappAccount/whatsappAccount.model.js
server/api/whatsappAccount/whatsappAccount.rpc.js
server/api/whatsappAccount/whatsappAccount.socket.js
server/api/whatsappApplication/index.js
server/api/whatsappApplication/whatsappApplication.attributes.js
server/api/whatsappApplication/whatsappApplication.controller.js
server/api/whatsappApplication/whatsappApplication.model.js
server/api/whatsappApplication/whatsappApplication.rpc.js
server/api/whatsappInteraction/index.js
server/api/whatsappInteraction/whatsappInteraction.attributes.js
server/api/whatsappInteraction/whatsappInteraction.controller.js
server/api/whatsappInteraction/whatsappInteraction.events.js
server/api/whatsappInteraction/whatsappInteraction.model.js
server/api/whatsappInteraction/whatsappInteraction.rpc.js
server/api/whatsappInteraction/whatsappInteraction.socket.js
server/api/whatsappMessage/index.js
server/api/whatsappMessage/whatsappMessage.attributes.js
server/api/whatsappMessage/whatsappMessage.controller.js
server/api/whatsappMessage/whatsappMessage.events.js
server/api/whatsappMessage/whatsappMessage.model.js
server/api/whatsappMessage/whatsappMessage.rpc.js
server/api/whatsappMessage/whatsappMessage.socket.js
server/api/whatsappQueue/index.js
server/api/whatsappQueue/whatsappQueue.attributes.js
server/api/whatsappQueue/whatsappQueue.controller.js
server/api/whatsappQueue/whatsappQueue.events.js
server/api/whatsappQueue/whatsappQueue.model.js
server/api/whatsappQueue/whatsappQueue.rpc.js
server/api/whatsappQueue/whatsappQueue.socket.js
server/api/whatsappQueueReport/index.js
server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
server/api/whatsappQueueReport/whatsappQueueReport.controller.js
server/api/whatsappQueueReport/whatsappQueueReport.model.js
server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
server/api/whatsappTransferReport/index.js
server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
server/api/whatsappTransferReport/whatsappTransferReport.controller.js
server/api/whatsappTransferReport/whatsappTransferReport.model.js
server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/import/cm/csvUpdates.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/additionalPhone.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/cmHopperAdditionalPhone.js
server/services/ami/rpc/cmHopperBlack.js
server/services/ami/rpc/cmHopperFinal.js
server/services/ami/rpc/cmHopperHistory.js
server/services/ami/rpc/faxAccount.js
server/services/ami/rpc/faxMessage.js
server/services/ami/rpc/integrations/desk.js
server/services/ami/rpc/integrations/dynamics365.js
server/services/ami/rpc/integrations/freshdesk.js
server/services/ami/rpc/integrations/freshsales.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/servicenow.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/setting.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/dynamics365.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/freshsales.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.js
server/services/ami/trigger/integration/servicenow.js
server/services/ami/trigger/integration/sugarcrm.js
server/services/ami/trigger/integration/util.js
server/services/ami/trigger/integration/vtiger.js
server/services/ami/trigger/integration/zendesk.js
server/services/ami/trigger/integration/zoho.js
server/services/ami/trigger/script/index.js
server/services/ami/trigger/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/rpc/setting.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/model/whatsappQueue.js
server/services/routing/realtime/index.js
server/services/routing/rpc/chatInteraction.js
server/services/routing/rpc/chatMessage.js
server/services/routing/rpc/chatQueue.js
server/services/routing/rpc/chatQueueReport.js
server/services/routing/rpc/faxInteraction.js
server/services/routing/rpc/faxMessage.js
server/services/routing/rpc/faxQueue.js
server/services/routing/rpc/faxQueueReport.js
server/services/routing/rpc/interval.js
server/services/routing/rpc/mailInteraction.js
server/services/routing/rpc/mailMessage.js
server/services/routing/rpc/mailQueue.js
server/services/routing/rpc/mailQueueReport.js
server/services/routing/rpc/openchannelInteraction.js
server/services/routing/rpc/openchannelMessage.js
server/services/routing/rpc/openchannelQueue.js
server/services/routing/rpc/openchannelQueueReport.js
server/services/routing/rpc/smsInteraction.js
server/services/routing/rpc/smsMessage.js
server/services/routing/rpc/smsQueue.js
server/services/routing/rpc/smsQueueReport.js
server/services/routing/rpc/user.js
server/services/routing/rpc/whatsappInteraction.js
server/services/routing/rpc/whatsappMessage.js
server/services/routing/rpc/whatsappQueue.js
server/services/routing/rpc/whatsappQueueReport.js
server/services/routing/server/applications/agent.js
server/services/routing/server/applications/amazonlex.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/dialogflowV2.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js

index 93e590e..065097a 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-11-26T13:09:50.435Z",
+    "time": "2021-11-26T13:23:55.785Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 9370102..4c74801 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-11-26T13:09:50.435Z",
+    "time": "2021-11-26T13:23:55.785Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 8caf58a..05e90b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59fb=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports','VIRTUAL','getDataValue','STRING','motionbar','jscripty','urlForward'];(function(_0x2c8972,_0x1aff63){var _0x5d1e22=function(_0x56428c){while(--_0x56428c){_0x2c8972['push'](_0x2c8972['shift']());}};_0x5d1e22(++_0x1aff63);}(_0x59fb,0x18f));var _0xb59f=function(_0x533852,_0x5e1347){_0x533852=_0x533852-0x0;var _0x3b39f2=_0x59fb[_0x533852];return _0x3b39f2;};'use strict';var Sequelize=require('sequelize');module[_0xb59f('0x0')]={'name':{'type':Sequelize[_0xb59f('0x1')],'get':function(_0x5676dd){return this[_0xb59f('0x2')]('action');}},'action':{'type':Sequelize[_0xb59f('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0xb59f('0x4'),_0xb59f('0x5'),_0xb59f('0x6'),_0xb59f('0x7'),_0xb59f('0x8'),_0xb59f('0x9')]],'msg':_0xb59f('0xa')}},'comment':_0xb59f('0xa')},'data1':{'type':Sequelize[_0xb59f('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xb59f('0x3')](0x1000),'comment':_0xb59f('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xb59f('0xc')},'data4':{'type':Sequelize[_0xb59f('0x3')](0x1000)},'data5':{'type':Sequelize[_0xb59f('0x3')](0x1000)},'data6':{'type':Sequelize[_0xb59f('0x3')]},'data7':{'type':Sequelize[_0xb59f('0xd')]}};
\ No newline at end of file
+var _0x8349=['exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x245728,_0x1e8ca4){var _0x1be470=function(_0x580fce){while(--_0x580fce){_0x245728['push'](_0x245728['shift']());}};_0x1be470(++_0x1e8ca4);}(_0x8349,0x142));var _0x9834=function(_0x4da28f,_0x164324){_0x4da28f=_0x4da28f-0x0;var _0xe49192=_0x8349[_0x4da28f];return _0xe49192;};'use strict';var Sequelize=require(_0x9834('0x0'));module[_0x9834('0x1')]={'name':{'type':Sequelize[_0x9834('0x2')],'get':function(_0x35b192){return this[_0x9834('0x3')](_0x9834('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x9834('0x5'),_0x9834('0x6'),_0x9834('0x7'),_0x9834('0x8'),_0x9834('0x9'),_0x9834('0xa'),_0x9834('0xb'),_0x9834('0xc')]],'msg':_0x9834('0xd')}},'comment':_0x9834('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x9834('0xe')},'data2':{'type':Sequelize[_0x9834('0xf')](0x1000),'comment':_0x9834('0x10')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x9834('0x11')},'data4':{'type':Sequelize[_0x9834('0xf')](0x1000)},'data5':{'type':Sequelize[_0x9834('0xf')](0x1000)},'data6':{'type':Sequelize[_0x9834('0xf')]},'data7':{'type':Sequelize[_0x9834('0x12')]}};
\ No newline at end of file
index 299e641..814cd17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x040c=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','status','error','stack','name','send','body','Action','params','find','catch','eml-format','fast-json-patch','moment'];(function(_0x41d683,_0x1408db){var _0x3700e3=function(_0xcf06dd){while(--_0xcf06dd){_0x41d683['push'](_0x41d683['shift']());}};_0x3700e3(++_0x1408db);}(_0x040c,0x165));var _0xc040=function(_0x5d637b,_0x385481){_0x5d637b=_0x5d637b-0x0;var _0x166a40=_0x040c[_0x5d637b];return _0x166a40;};'use strict';var emlformat=require(_0xc040('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc040('0x1'));var rp=require('request-promise');var moment=require(_0xc040('0x2'));var BPromise=require(_0xc040('0x3'));var Mustache=require(_0xc040('0x4'));var util=require(_0xc040('0x5'));var path=require(_0xc040('0x6'));var sox=require(_0xc040('0x7'));var csv=require(_0xc040('0x8'));var ejs=require(_0xc040('0x9'));var fs=require('fs');var fs_extra=require(_0xc040('0xa'));var _=require(_0xc040('0xb'));var squel=require('squel');var crypto=require(_0xc040('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc040('0xd'));var Papa=require(_0xc040('0xe'));var Redis=require('ioredis');var authService=require(_0xc040('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc040('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc040('0x11'));var utils=require(_0xc040('0x12'));var config=require(_0xc040('0x13'));var licenseUtil=require(_0xc040('0x14'));var db=require(_0xc040('0x15'))['db'];function respondWithStatusCode(_0x14503a,_0x45aefc){_0x45aefc=_0x45aefc||0xcc;return function(_0x2c1765){if(_0x2c1765){return _0x14503a[_0xc040('0x16')](_0x45aefc);}return _0x14503a['status'](_0x45aefc)[_0xc040('0x17')]();};}function respondWithResult(_0x11abb7,_0x43ec81){_0x43ec81=_0x43ec81||0xc8;return function(_0x5b1e31){if(_0x5b1e31){return _0x11abb7['status'](_0x43ec81)[_0xc040('0x18')](_0x5b1e31);}};}function respondWithFilteredResult(_0x691eee,_0x25d8f5){return function(_0x12c0aa){if(_0x12c0aa){var _0x24db0e=typeof _0x25d8f5[_0xc040('0x19')]===_0xc040('0x1a')&&typeof _0x25d8f5[_0xc040('0x1b')]===_0xc040('0x1a');var _0x2cc712=_0x12c0aa[_0xc040('0x1c')];var _0x2e7d25=_0x24db0e?0x0:_0x25d8f5['offset'];var _0x2cc45e=_0x24db0e?_0x12c0aa[_0xc040('0x1c')]:_0x25d8f5[_0xc040('0x19')]+_0x25d8f5[_0xc040('0x1b')];var _0x379c3b;if(_0x2cc45e>=_0x2cc712){_0x2cc45e=_0x2cc712;_0x379c3b=0xc8;}else{_0x379c3b=0xce;}_0x691eee['status'](_0x379c3b);return _0x691eee['set'](_0xc040('0x1d'),_0x2e7d25+'-'+_0x2cc45e+'/'+_0x2cc712)['json'](_0x12c0aa);}return null;};}function patchUpdates(_0x2c4eb9){return function(_0x200d24){try{jsonpatch['apply'](_0x200d24,_0x2c4eb9,!![]);}catch(_0x3ac54a){return BPromise[_0xc040('0x1e')](_0x3ac54a);}return _0x200d24[_0xc040('0x1f')]();};}function saveUpdates(_0x5a0927,_0x2de135){return function(_0x4e3fd7){if(_0x4e3fd7){return _0x4e3fd7[_0xc040('0x20')](_0x5a0927)[_0xc040('0x21')](function(_0x248e66){return _0x248e66;});}return null;};}function removeEntity(_0x3310e7,_0x57597c){return function(_0x22b303){if(_0x22b303){return _0x22b303[_0xc040('0x22')]()['then'](function(){_0x3310e7[_0xc040('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e7fd,_0x445e2e){return function(_0x50be56){if(!_0x50be56){_0x55e7fd[_0xc040('0x16')](0x194);}return _0x50be56;};}function handleError(_0x3d7a0c,_0x35a09a){_0x35a09a=_0x35a09a||0x1f4;return function(_0x537fd5){logger[_0xc040('0x24')](_0x537fd5[_0xc040('0x25')]);if(_0x537fd5[_0xc040('0x26')]){delete _0x537fd5[_0xc040('0x26')];}_0x3d7a0c[_0xc040('0x23')](_0x35a09a)[_0xc040('0x27')](_0x537fd5);};}exports[_0xc040('0x20')]=function(_0x31ca70,_0x536a14){if(_0x31ca70['body']['id']){delete _0x31ca70[_0xc040('0x28')]['id'];}return db[_0xc040('0x29')]['find']({'where':{'id':_0x31ca70[_0xc040('0x2a')]['id']}})[_0xc040('0x21')](handleEntityNotFound(_0x536a14,null))['then'](saveUpdates(_0x31ca70[_0xc040('0x28')],null))['then'](respondWithResult(_0x536a14,null))['catch'](handleError(_0x536a14,null));};exports[_0xc040('0x22')]=function(_0x4ba70f,_0x2eae04){return db[_0xc040('0x29')][_0xc040('0x2b')]({'where':{'id':_0x4ba70f[_0xc040('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2eae04,null))[_0xc040('0x21')](removeEntity(_0x2eae04,null))[_0xc040('0x2c')](handleError(_0x2eae04,null));};
\ No newline at end of file
+var _0x58a8=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','update','Action','find','params','catch','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x58a8,0x1e7));var _0x858a=function(_0x211dba,_0x487d76){_0x211dba=_0x211dba-0x0;var _0x217af2=_0x58a8[_0x211dba];return _0x217af2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x858a('0x0'));var zipdir=require(_0x858a('0x1'));var jsonpatch=require(_0x858a('0x2'));var rp=require(_0x858a('0x3'));var moment=require(_0x858a('0x4'));var BPromise=require(_0x858a('0x5'));var Mustache=require(_0x858a('0x6'));var util=require(_0x858a('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x858a('0x8'));var fs=require('fs');var fs_extra=require(_0x858a('0x9'));var _=require(_0x858a('0xa'));var squel=require(_0x858a('0xb'));var crypto=require(_0x858a('0xc'));var jsforce=require(_0x858a('0xd'));var deskjs=require(_0x858a('0xe'));var toCsv=require(_0x858a('0xf'));var querystring=require('querystring');var Papa=require(_0x858a('0x10'));var Redis=require(_0x858a('0x11'));var authService=require(_0x858a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x858a('0x13'));var hardwareService=require(_0x858a('0x14'));var logger=require(_0x858a('0x15'))(_0x858a('0x16'));var utils=require('../../config/utils');var config=require(_0x858a('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58399f,_0x4766c8){_0x4766c8=_0x4766c8||0xcc;return function(_0x358d21){if(_0x358d21){return _0x58399f['sendStatus'](_0x4766c8);}return _0x58399f[_0x858a('0x18')](_0x4766c8)[_0x858a('0x19')]();};}function respondWithResult(_0x28e222,_0x366d25){_0x366d25=_0x366d25||0xc8;return function(_0x13ff8c){if(_0x13ff8c){return _0x28e222[_0x858a('0x18')](_0x366d25)[_0x858a('0x1a')](_0x13ff8c);}};}function respondWithFilteredResult(_0x160c3c,_0x464cb7){return function(_0xb45d60){if(_0xb45d60){var _0x19f2df=typeof _0x464cb7[_0x858a('0x1b')]===_0x858a('0x1c')&&typeof _0x464cb7[_0x858a('0x1d')]===_0x858a('0x1c');var _0x47c416=_0xb45d60[_0x858a('0x1e')];var _0xda2f5d=_0x19f2df?0x0:_0x464cb7[_0x858a('0x1b')];var _0x18b6c7=_0x19f2df?_0xb45d60[_0x858a('0x1e')]:_0x464cb7[_0x858a('0x1b')]+_0x464cb7['limit'];var _0x213927;if(_0x18b6c7>=_0x47c416){_0x18b6c7=_0x47c416;_0x213927=0xc8;}else{_0x213927=0xce;}_0x160c3c[_0x858a('0x18')](_0x213927);return _0x160c3c[_0x858a('0x1f')](_0x858a('0x20'),_0xda2f5d+'-'+_0x18b6c7+'/'+_0x47c416)[_0x858a('0x1a')](_0xb45d60);}return null;};}function patchUpdates(_0x3a35e9){return function(_0x41e911){try{jsonpatch[_0x858a('0x21')](_0x41e911,_0x3a35e9,!![]);}catch(_0x98ebf6){return BPromise[_0x858a('0x22')](_0x98ebf6);}return _0x41e911['save']();};}function saveUpdates(_0x2b79f7,_0x14ef4a){return function(_0x4201cb){if(_0x4201cb){return _0x4201cb['update'](_0x2b79f7)[_0x858a('0x23')](function(_0x5f3011){return _0x5f3011;});}return null;};}function removeEntity(_0x97cbe8,_0x3824d3){return function(_0x45de68){if(_0x45de68){return _0x45de68['destroy']()[_0x858a('0x23')](function(){_0x97cbe8['status'](0xcc)[_0x858a('0x19')]();});}};}function handleEntityNotFound(_0x37882e,_0x11a7a1){return function(_0x3173e5){if(!_0x3173e5){_0x37882e['sendStatus'](0x194);}return _0x3173e5;};}function handleError(_0x44f500,_0x2596ea){_0x2596ea=_0x2596ea||0x1f4;return function(_0x21e1cf){logger[_0x858a('0x24')](_0x21e1cf[_0x858a('0x25')]);if(_0x21e1cf[_0x858a('0x26')]){delete _0x21e1cf[_0x858a('0x26')];}_0x44f500[_0x858a('0x18')](_0x2596ea)['send'](_0x21e1cf);};}exports[_0x858a('0x27')]=function(_0x33b459,_0x2f66d9){if(_0x33b459['body']['id']){delete _0x33b459['body']['id'];}return db[_0x858a('0x28')][_0x858a('0x29')]({'where':{'id':_0x33b459[_0x858a('0x2a')]['id']}})[_0x858a('0x23')](handleEntityNotFound(_0x2f66d9,null))['then'](saveUpdates(_0x33b459['body'],null))[_0x858a('0x23')](respondWithResult(_0x2f66d9,null))[_0x858a('0x2b')](handleError(_0x2f66d9,null));};exports[_0x858a('0x2c')]=function(_0x57a61f,_0x48880a){return db[_0x858a('0x28')]['find']({'where':{'id':_0x57a61f['params']['id']}})[_0x858a('0x23')](handleEntityNotFound(_0x48880a,null))[_0x858a('0x23')](removeEntity(_0x48880a,null))[_0x858a('0x2b')](handleError(_0x48880a,null));};
\ No newline at end of file
index bcae080..820c142 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5baf=['moment','bluebird','request-promise','path','rimraf','./action.attributes','exports','define','Action','lodash','api'];(function(_0x352fb0,_0xe7cf47){var _0x233f3a=function(_0x25b191){while(--_0x25b191){_0x352fb0['push'](_0x352fb0['shift']());}};_0x233f3a(++_0xe7cf47);}(_0x5baf,0xae));var _0xf5ba=function(_0x213eca,_0x5509aa){_0x213eca=_0x213eca-0x0;var _0x5cb142=_0x5baf[_0x213eca];return _0x5cb142;};'use strict';var _=require(_0xf5ba('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf5ba('0x1'));var moment=require(_0xf5ba('0x2'));var BPromise=require(_0xf5ba('0x3'));var rp=require(_0xf5ba('0x4'));var fs=require('fs');var path=require(_0xf5ba('0x5'));var rimraf=require(_0xf5ba('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5ba('0x7'));module[_0xf5ba('0x8')]=function(_0x41327d,_0x5ef84e){return _0x41327d[_0xf5ba('0x9')](_0xf5ba('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x342e=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0x342e,0xa8));var _0xe342=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x342e[_0x3f2a90];return _0xb46279;};'use strict';var _=require(_0xe342('0x0'));var util=require(_0xe342('0x1'));var logger=require(_0xe342('0x2'))(_0xe342('0x3'));var moment=require(_0xe342('0x4'));var BPromise=require(_0xe342('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe342('0x6'));var rimraf=require(_0xe342('0x7'));var config=require(_0xe342('0x8'));var attributes=require(_0xe342('0x9'));module[_0xe342('0xa')]=function(_0xe4cc3a,_0x5b8cd4){return _0xe4cc3a['define'](_0xe342('0xb'),attributes,{'tableName':_0xe342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cc3735f..c4870d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1bcdd6,_0x1c4768){_0x1bcdd6=_0x1bcdd6-0x0;var _0x1fad52=_0x1cb9[_0x1bcdd6];return _0x1fad52;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x403568,_0x3eb985){var _0x557ed4=function(_0x259521){while(--_0x259521){_0x403568['push'](_0x403568['shift']());}};_0x557ed4(++_0x3eb985);}(_0x5fc3,0xa8));var _0x35fc=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0x5fc3[_0x466bc5];return _0x138952;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
index e6b0e8a..7810636 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5a1=['./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb5a1,0x18d));var _0x1b5a=function(_0x1709e7,_0x2ced21){_0x1709e7=_0x1709e7-0x0;var _0x402819=_0xb5a1[_0x1709e7];return _0x402819;};'use strict';var multer=require(_0x1b5a('0x0'));var util=require(_0x1b5a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1b5a('0x2'));var router=express[_0x1b5a('0x3')]();var fs_extra=require(_0x1b5a('0x4'));var auth=require(_0x1b5a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1b5a('0x6'));router['put'](_0x1b5a('0x7'),auth[_0x1b5a('0x8')](),controller[_0x1b5a('0x9')]);router[_0x1b5a('0xa')](_0x1b5a('0x7'),auth[_0x1b5a('0x8')](),controller[_0x1b5a('0xb')]);module[_0x1b5a('0xc')]=router;
\ No newline at end of file
+var _0xcd65=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','exports','util','path','connect-timeout','express'];(function(_0x32eef2,_0x5cf5e2){var _0x114321=function(_0x27c38a){while(--_0x27c38a){_0x32eef2['push'](_0x32eef2['shift']());}};_0x114321(++_0x5cf5e2);}(_0xcd65,0x128));var _0x5cd6=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0xcd65[_0x323419];return _0x4c0be7;};'use strict';var multer=require('multer');var util=require(_0x5cd6('0x0'));var path=require(_0x5cd6('0x1'));var timeout=require(_0x5cd6('0x2'));var express=require(_0x5cd6('0x3'));var router=express['Router']();var fs_extra=require(_0x5cd6('0x4'));var auth=require(_0x5cd6('0x5'));var interaction=require(_0x5cd6('0x6'));var config=require(_0x5cd6('0x7'));var controller=require(_0x5cd6('0x8'));router[_0x5cd6('0x9')]('/:id',auth[_0x5cd6('0xa')](),controller[_0x5cd6('0xb')]);router[_0x5cd6('0xc')](_0x5cd6('0xd'),auth[_0x5cd6('0xa')](),controller['destroy']);module[_0x5cd6('0xe')]=router;
\ No newline at end of file
index e457d83..7f161c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5a=['exports','STRING','TEXT','sequelize'];(function(_0x126d93,_0x1221fa){var _0x55787c=function(_0x1cbf35){while(--_0x1cbf35){_0x126d93['push'](_0x126d93['shift']());}};_0x55787c(++_0x1221fa);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3337ec,_0x10876d){_0x3337ec=_0x3337ec-0x0;var _0x425df3=_0x9c5a[_0x3337ec];return _0x425df3;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa9c5('0x2')]},'parent':{'type':Sequelize[_0xa9c5('0x2')]},'table':{'type':Sequelize[_0xa9c5('0x2')]},'conditions':{'type':Sequelize[_0xa9c5('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2eb2=['TEXT','exports','STRING'];(function(_0x3058b8,_0x5e12e1){var _0x282a80=function(_0x49bf6c){while(--_0x49bf6c){_0x3058b8['push'](_0x3058b8['shift']());}};_0x282a80(++_0x5e12e1);}(_0x2eb2,0x19f));var _0x22eb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2eb2[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 7ada531..17931b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88a4=['squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','params','intersection','fields','create','body','role','user','find','userProfileId','UserProfileResource','CustomReports','join','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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','table','MetricId','function','format','replace','groupBy','orderBy','DESC','alias','joins','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','metric','parse','foreignTable','output','web','fullPath','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','../../files/reports','savename','countTable','COUNT(*)','runReport','eml-format','rimraf','moment','bluebird','util','path','sox','fs-extra','lodash'];(function(_0x14f95b,_0x1cb133){var _0x4c16c3=function(_0xf57f99){while(--_0xf57f99){_0x14f95b['push'](_0x14f95b['shift']());}};_0x4c16c3(++_0x1cb133);}(_0x88a4,0x12f));var _0x488a=function(_0x2702eb,_0x3325f0){_0x2702eb=_0x2702eb-0x0;var _0x440bd6=_0x88a4[_0x2702eb];return _0x440bd6;};'use strict';var emlformat=require(_0x488a('0x0'));var rimraf=require(_0x488a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x488a('0x2'));var BPromise=require(_0x488a('0x3'));var Mustache=require('mustache');var util=require(_0x488a('0x4'));var path=require(_0x488a('0x5'));var sox=require(_0x488a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x488a('0x7'));var _=require(_0x488a('0x8'));var squel=require(_0x488a('0x9'));var crypto=require(_0x488a('0xa'));var jsforce=require(_0x488a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x488a('0xc'));var querystring=require('querystring');var Papa=require(_0x488a('0xd'));var Redis=require(_0x488a('0xe'));var authService=require(_0x488a('0xf'));var qs=require(_0x488a('0x10'));var as=require(_0x488a('0x11'));var hardwareService=require(_0x488a('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x488a('0x13'));var db=require(_0x488a('0x14'))['db'];var dbH=require(_0x488a('0x14'))[_0x488a('0x15')];function respondWithStatusCode(_0x13c42f,_0x3d674a){_0x3d674a=_0x3d674a||0xcc;return function(_0x540c72){if(_0x540c72){return _0x13c42f[_0x488a('0x16')](_0x3d674a);}return _0x13c42f[_0x488a('0x17')](_0x3d674a)['end']();};}function respondWithResult(_0x428bc7,_0x1a279c){_0x1a279c=_0x1a279c||0xc8;return function(_0x1e1e66){if(_0x1e1e66){return _0x428bc7[_0x488a('0x17')](_0x1a279c)[_0x488a('0x18')](_0x1e1e66);}};}function respondWithFilteredResult(_0x479614,_0x3619dc){return function(_0x74fadc){if(_0x74fadc){var _0xabcc6e=typeof _0x3619dc[_0x488a('0x19')]===_0x488a('0x1a')&&typeof _0x3619dc[_0x488a('0x1b')]===_0x488a('0x1a');var _0x521bbe=_0x74fadc[_0x488a('0x1c')];var _0x4db506=_0xabcc6e?0x0:_0x3619dc[_0x488a('0x19')];var _0x151a30=_0xabcc6e?_0x74fadc[_0x488a('0x1c')]:_0x3619dc[_0x488a('0x19')]+_0x3619dc[_0x488a('0x1b')];var _0x182d06;if(_0x151a30>=_0x521bbe){_0x151a30=_0x521bbe;_0x182d06=0xc8;}else{_0x182d06=0xce;}_0x479614[_0x488a('0x17')](_0x182d06);return _0x479614['set'](_0x488a('0x1d'),_0x4db506+'-'+_0x151a30+'/'+_0x521bbe)[_0x488a('0x18')](_0x74fadc);}return null;};}function patchUpdates(_0xb4ae1b){return function(_0x5b6642){try{jsonpatch[_0x488a('0x1e')](_0x5b6642,_0xb4ae1b,!![]);}catch(_0x536b62){return BPromise[_0x488a('0x1f')](_0x536b62);}return _0x5b6642[_0x488a('0x20')]();};}function saveUpdates(_0x7b9d0a,_0x481e1b){return function(_0x4a3ee7){if(_0x4a3ee7){return _0x4a3ee7[_0x488a('0x21')](_0x7b9d0a)[_0x488a('0x22')](function(_0x3b05e3){return _0x3b05e3;});}return null;};}function removeEntity(_0x307f04,_0x4bda77){return function(_0x2fa227){if(_0x2fa227){return _0x2fa227['destroy']()[_0x488a('0x22')](function(){var _0x28bfe7=_0x2fa227['get']({'plain':!![]});var _0x52d456='CustomReports';return db['UserProfileResource'][_0x488a('0x23')]({'where':{'type':_0x52d456,'resourceId':_0x28bfe7['id']}})['then'](function(){return _0x2fa227;});})['then'](function(){_0x307f04[_0x488a('0x17')](0xcc)[_0x488a('0x24')]();});}};}function handleEntityNotFound(_0x60164e,_0x236fb7){return function(_0x13a9dc){if(!_0x13a9dc){_0x60164e[_0x488a('0x16')](0x194);}return _0x13a9dc;};}function handleError(_0x48f3b6,_0x291ea3){_0x291ea3=_0x291ea3||0x1f4;return function(_0x2a6f25){logger[_0x488a('0x25')](_0x2a6f25[_0x488a('0x26')]);if(_0x2a6f25[_0x488a('0x27')]){delete _0x2a6f25['name'];}_0x48f3b6[_0x488a('0x17')](_0x291ea3)[_0x488a('0x28')](_0x2a6f25);};}exports[_0x488a('0x29')]=function(_0x281d26,_0x35881f){var _0x27d3da={},_0x2dae50={},_0x38ea5a={'count':0x0,'rows':[]};var _0xdf67bb=_[_0x488a('0x2a')](db['AnalyticCustomReport'][_0x488a('0x2b')],function(_0x39e9ba){return{'name':_0x39e9ba[_0x488a('0x2c')],'type':_0x39e9ba[_0x488a('0x2d')]['key']};});_0x2dae50[_0x488a('0x2e')]=_[_0x488a('0x2a')](_0xdf67bb,_0x488a('0x27'));_0x2dae50[_0x488a('0x2f')]=_[_0x488a('0x30')](_0x281d26[_0x488a('0x2f')]);_0x2dae50[_0x488a('0x31')]=_['intersection'](_0x2dae50['model'],_0x2dae50[_0x488a('0x2f')]);_0x27d3da[_0x488a('0x32')]=_['intersection'](_0x2dae50[_0x488a('0x2e')],qs['fields'](_0x281d26[_0x488a('0x2f')]['fields']));_0x27d3da[_0x488a('0x32')]=_0x27d3da[_0x488a('0x32')][_0x488a('0x33')]?_0x27d3da[_0x488a('0x32')]:_0x2dae50[_0x488a('0x2e')];if(!_0x281d26[_0x488a('0x2f')][_0x488a('0x34')](_0x488a('0x35'))){_0x27d3da['limit']=qs[_0x488a('0x1b')](_0x281d26[_0x488a('0x2f')][_0x488a('0x1b')]);_0x27d3da[_0x488a('0x19')]=qs[_0x488a('0x19')](_0x281d26[_0x488a('0x2f')][_0x488a('0x19')]);}_0x27d3da[_0x488a('0x36')]=qs['sort'](_0x281d26[_0x488a('0x2f')][_0x488a('0x37')]);_0x27d3da['where']=qs['filters'](_[_0x488a('0x38')](_0x281d26[_0x488a('0x2f')],_0x2dae50[_0x488a('0x31')]),_0xdf67bb);if(_0x281d26[_0x488a('0x2f')][_0x488a('0x39')]){_0x27d3da[_0x488a('0x3a')]=_['merge'](_0x27d3da['where'],{'$or':_[_0x488a('0x2a')](_0xdf67bb,function(_0x9f5f3c){if(_0x9f5f3c['type']!==_0x488a('0x3b')){var _0x55712b={};_0x55712b[_0x9f5f3c['name']]={'$like':'%'+_0x281d26[_0x488a('0x2f')]['filter']+'%'};return _0x55712b;}})});}_0x27d3da=_[_0x488a('0x3c')]({},_0x27d3da,_0x281d26[_0x488a('0x3d')]);var _0x4e4f21={'where':_0x27d3da[_0x488a('0x3a')]};return db[_0x488a('0x3e')][_0x488a('0x1c')](_0x4e4f21)[_0x488a('0x22')](function(_0x3a008d){_0x38ea5a[_0x488a('0x1c')]=_0x3a008d;if(_0x281d26[_0x488a('0x2f')][_0x488a('0x3f')]){_0x27d3da[_0x488a('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x488a('0x41')](_0x27d3da);})[_0x488a('0x22')](function(_0xe376b6){_0x38ea5a[_0x488a('0x42')]=_0xe376b6;return _0x38ea5a;})['then'](respondWithFilteredResult(_0x35881f,_0x27d3da))[_0x488a('0x43')](handleError(_0x35881f,null));};exports['show']=function(_0x1f77f3,_0x4c1ad7){var _0x463a2c={'raw':![],'where':{'id':_0x1f77f3[_0x488a('0x44')]['id']}},_0x543425={};_0x543425[_0x488a('0x2e')]=_[_0x488a('0x30')](db['AnalyticCustomReport'][_0x488a('0x2b')]);_0x543425[_0x488a('0x2f')]=_[_0x488a('0x30')](_0x1f77f3['query']);_0x543425[_0x488a('0x31')]=_[_0x488a('0x45')](_0x543425[_0x488a('0x2e')],_0x543425['query']);_0x463a2c[_0x488a('0x32')]=_[_0x488a('0x45')](_0x543425[_0x488a('0x2e')],qs[_0x488a('0x46')](_0x1f77f3['query'][_0x488a('0x46')]));_0x463a2c[_0x488a('0x32')]=_0x463a2c[_0x488a('0x32')]['length']?_0x463a2c['attributes']:_0x543425['model'];if(_0x1f77f3['query'][_0x488a('0x3f')]){_0x463a2c[_0x488a('0x40')]=[{'all':!![]}];}_0x463a2c=_['merge']({},_0x463a2c,_0x1f77f3[_0x488a('0x3d')]);return db[_0x488a('0x3e')]['find'](_0x463a2c)[_0x488a('0x22')](handleEntityNotFound(_0x4c1ad7,null))['then'](respondWithResult(_0x4c1ad7,null))[_0x488a('0x43')](handleError(_0x4c1ad7,null));};exports[_0x488a('0x47')]=function(_0x3bf7fb,_0x23a9c5){return db[_0x488a('0x3e')][_0x488a('0x47')](_0x3bf7fb[_0x488a('0x48')],{})[_0x488a('0x22')](function(_0x13210e){var _0x29e39a=_0x3bf7fb['user']['get']({'plain':!![]});if(!_0x29e39a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29e39a[_0x488a('0x49')]===_0x488a('0x4a')){var _0x49b057=_0x13210e['get']({'plain':!![]});var _0x3bf94a='Reports';return db['UserProfileSection'][_0x488a('0x4b')]({'where':{'name':_0x3bf94a,'userProfileId':_0x29e39a[_0x488a('0x4c')]},'raw':!![]})[_0x488a('0x22')](function(_0x331c8c){if(_0x331c8c&&_0x331c8c['autoAssociation']===0x0){return db[_0x488a('0x4d')][_0x488a('0x47')]({'name':_0x49b057[_0x488a('0x27')],'resourceId':_0x49b057['id'],'type':_0x488a('0x4e'),'sectionId':_0x331c8c['id']},{})[_0x488a('0x22')](function(){return _0x13210e;});}else{return _0x13210e;}})[_0x488a('0x43')](function(_0x4b9ee3){logger[_0x488a('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b9ee3);throw _0x4b9ee3;});}return _0x13210e;})[_0x488a('0x22')](respondWithResult(_0x23a9c5,0xc9))[_0x488a('0x43')](handleError(_0x23a9c5,null));};exports['update']=function(_0x10f3f9,_0x3676da){if(_0x10f3f9[_0x488a('0x48')]['id']){delete _0x10f3f9[_0x488a('0x48')]['id'];}return db[_0x488a('0x3e')][_0x488a('0x4b')]({'where':{'id':_0x10f3f9['params']['id']}})[_0x488a('0x22')](handleEntityNotFound(_0x3676da,null))[_0x488a('0x22')](saveUpdates(_0x10f3f9['body'],null))[_0x488a('0x22')](respondWithResult(_0x3676da,null))[_0x488a('0x43')](handleError(_0x3676da,null));};exports[_0x488a('0x23')]=function(_0x2640ea,_0x427125){return db[_0x488a('0x3e')][_0x488a('0x4b')]({'where':{'id':_0x2640ea[_0x488a('0x44')]['id']}})[_0x488a('0x22')](handleEntityNotFound(_0x427125,null))['then'](removeEntity(_0x427125,null))[_0x488a('0x43')](handleError(_0x427125,null));};exports['preview']=function(_0x1ff304,_0x48d2bd){var _0x2b83ca=0xa;var _0x221b29=[_0x488a('0x4f'),_0x488a('0x50'),_0x488a('0x51'),_0x488a('0x52')];var _0x2d2483={'SUM':_0x488a('0x53'),'COUNT':_0x488a('0x54'),'COUNT DISTINCT':_0x488a('0x55'),'MAX':_0x488a('0x56'),'MIN':_0x488a('0x57'),'AVG':_0x488a('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x488a('0x59'),'GROUP_CONCAT DESC':_0x488a('0x5a')};var _0x82c45b={'SEC_TO_TIME':_0x488a('0x5b'),'DATE':_0x488a('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x488a('0x5d'),'UNIX_TIMESTAMP':_0x488a('0x5e')};var _0x535126=function(_0x3bf0a1){return!_[_0x488a('0x5f')]([_0x488a('0x60'),_0x488a('0x61'),_0x488a('0x62'),_0x488a('0x63')],_0x3bf0a1);};var _0x1e2965=function(_0x596f0b){if(!_0x596f0b||!_0x596f0b[_0x488a('0x64')]['length']){return'';}for(var _0x5298df='(',_0x4b3a0d=0x0;_0x4b3a0d<_0x596f0b['rules'][_0x488a('0x33')];_0x4b3a0d+=0x1){_0x4b3a0d>0x0&&(_0x5298df+='\x20'+_0x596f0b['operator']+'\x20');_0x5298df+=_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x65')]?_0x1e2965(_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x65')]):_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x66')]+'\x20'+_0x596f0b[_0x488a('0x64')][_0x4b3a0d]['condition']+(_0x535126(_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x67')])?'\x20'+_0x596f0b[_0x488a('0x64')][_0x4b3a0d][_0x488a('0x68')]:'');}return _0x5298df+')';};var _0x2c396a={'where':{'id':_0x1ff304[_0x488a('0x44')]['id']}},_0x4a3748,_0x1c92d0,_0x1319b2,_0x196d99,_0x161a9d;_0x2c396a=_['merge']({},_0x2c396a,_0x1ff304['options']);return db['AnalyticCustomReport'][_0x488a('0x4b')](_0x2c396a)[_0x488a('0x22')](function(_0x2481c6){if(_0x2481c6){_0x4a3748=_0x2481c6;return _0x2481c6[_0x488a('0x69')]();}return null;})['then'](function(_0x38efe3){if(_0x38efe3){if(!_0x38efe3[_0x488a('0x33')]){throw new db[(_0x488a('0x6a'))][(_0x488a('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1c92d0=_0x38efe3;return db[_0x488a('0x6c')][_0x488a('0x41')]({'raw':!![]});}return null;})[_0x488a('0x22')](function(_0x5b3be8){if(_0x5b3be8){_0x1319b2=_['keyBy'](_0x5b3be8,'id');var _0x1c0118;var _0x34393c=squel[_0x488a('0x6d')]();_0x34393c['from'](_0x4a3748[_0x488a('0x6e')]);for(var _0x2c2143=0x0;_0x2c2143<_0x1c92d0['length'];_0x2c2143+=0x1){_0x1c0118=_0x1c92d0[_0x2c2143]['MetricId']?_0x1319b2[_0x1c92d0[_0x2c2143][_0x488a('0x6f')]]['metric']:_0x1c92d0[_0x2c2143][_0x488a('0x66')];_0x1c0118=_0x1c92d0[_0x2c2143][_0x488a('0x70')]?_['replace'](_0x2d2483[_0x1c92d0[_0x2c2143][_0x488a('0x70')]],'%s',_0x1c0118):_0x1c0118;_0x1c0118=_0x1c92d0[_0x2c2143][_0x488a('0x71')]?_[_0x488a('0x72')](_0x82c45b[_0x1c92d0[_0x2c2143][_0x488a('0x71')]],'%s',_0x1c0118):_0x1c0118;if(_0x1c92d0[_0x2c2143][_0x488a('0x73')]){_0x34393c[_0x488a('0x65')](_0x1c0118);}_0x1c92d0[_0x2c2143][_0x488a('0x74')]&&_0x34393c[_0x488a('0x36')](_0x1c0118,_0x1c92d0[_0x2c2143][_0x488a('0x74')]===_0x488a('0x75')?![]:!![]);_0x34393c[_0x488a('0x66')](_0x1c0118,_0x1c92d0[_0x2c2143][_0x488a('0x76')]||_0x1c0118);}if(_0x4a3748[_0x488a('0x77')]){_0x4a3748['joins']=JSON['parse'](_0x4a3748['joins']);for(var _0x3408d4=0x0;_0x3408d4<_0x4a3748[_0x488a('0x77')][_0x488a('0x33')];_0x3408d4+=0x1){if(_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x2d')]&&_[_0x488a('0x5f')](_0x221b29,_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x2d')])&&_0x4a3748[_0x488a('0x77')][_0x3408d4]['parentKey']&&_0x4a3748['joins'][_0x3408d4]['foreignTable']&&_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x78')]){_0x34393c[_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x2d')]](_0x4a3748['joins'][_0x3408d4]['foreignTable'],null,util[_0x488a('0x71')](_0x488a('0x79'),_0x4a3748[_0x488a('0x6e')],_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x7a')],_0x4a3748['joins'][_0x3408d4]['foreignTable'],_0x4a3748[_0x488a('0x77')][_0x3408d4][_0x488a('0x78')]));}}}if(_0x4a3748[_0x488a('0x7b')]){_0x4a3748[_0x488a('0x7b')]=JSON['parse'](_0x4a3748['conditions']);_0x34393c['where'](_0x1e2965(_0x4a3748[_0x488a('0x7b')][_0x488a('0x65')]));}_0x161a9d=_0x34393c[_0x488a('0x7c')]();_0x34393c[_0x488a('0x1b')](_0x2b83ca);_0x34393c['offset'](0x0);logger[_0x488a('0x7d')](_0x488a('0x7e'),_0x34393c[_0x488a('0x7f')]());return dbH['sequelize']['query'](_0x34393c[_0x488a('0x7f')](),{'type':dbH[_0x488a('0x80')][_0x488a('0x81')][_0x488a('0x82')]});}})['then'](respondWithResult(_0x48d2bd,null))['catch'](handleError(_0x48d2bd,null));};function runReport(_0x1d7ca4,_0x13f5cd,_0x24f3ab){var _0x477604=_0x13f5cd[_0x488a('0x27')];var _0x1cc229=0xa;var _0x1b5513=['join',_0x488a('0x50'),_0x488a('0x51'),_0x488a('0x52')];var _0x1cf5ff={'SUM':_0x488a('0x53'),'COUNT':_0x488a('0x54'),'COUNT DISTINCT':_0x488a('0x55'),'MAX':_0x488a('0x56'),'MIN':_0x488a('0x57'),'AVG':_0x488a('0x58'),'GROUP_CONCAT':_0x488a('0x83'),'GROUP_CONCAT ASC':_0x488a('0x59'),'GROUP_CONCAT DESC':_0x488a('0x5a')};var _0x27588c={'SEC_TO_TIME':_0x488a('0x5b'),'DATE':'DATE(%s)','HOUR':_0x488a('0x84'),'ROUND':_0x488a('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x51a201=function(_0xaac9f0){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x488a('0x62'),'IS\x20NOT\x20EMPTY'],_0xaac9f0);};var _0x5d2d5a=function(_0x163f27){if(!_0x163f27||!_0x163f27['rules']['length']){return'';}for(var _0xab38f4='(',_0x3885cd=0x0;_0x3885cd<_0x163f27[_0x488a('0x64')][_0x488a('0x33')];_0x3885cd+=0x1){_0x3885cd>0x0&&(_0xab38f4+='\x20'+_0x163f27[_0x488a('0x85')]+'\x20');_0xab38f4+=_0x163f27[_0x488a('0x64')][_0x3885cd][_0x488a('0x65')]?_0x5d2d5a(_0x163f27['rules'][_0x3885cd][_0x488a('0x65')]):_0x163f27['rules'][_0x3885cd]['field']+'\x20'+_0x163f27[_0x488a('0x64')][_0x3885cd]['condition']+(_0x51a201(_0x163f27[_0x488a('0x64')][_0x3885cd]['condition'])?'\x20'+_0x163f27[_0x488a('0x64')][_0x3885cd][_0x488a('0x68')]:'');}return _0xab38f4+')';};var _0x265557={'where':{'id':_0x1d7ca4['id']}},_0x4611ba,_0x466688,_0x22cac1,_0x57f7fd,_0x43faf0;_0x265557=_[_0x488a('0x3c')]({},_0x265557,_0x24f3ab);return db['AnalyticCustomReport'][_0x488a('0x4b')](_0x265557)[_0x488a('0x22')](function(_0x563a59){if(_0x563a59){_0x4611ba=_0x563a59;return _0x563a59['getFields']();}return null;})[_0x488a('0x22')](function(_0x33f449){if(_0x33f449){if(!_0x33f449['length']){throw new db[(_0x488a('0x6a'))][(_0x488a('0x6b'))](_0x488a('0x86'),0x193);}_0x466688=_0x33f449;return db[_0x488a('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x2e7834){if(_0x2e7834){_0x22cac1=_[_0x488a('0x87')](_0x2e7834,'id');var _0x42eb66;var _0x41acad=squel[_0x488a('0x6d')]();_0x41acad[_0x488a('0x88')](_0x4611ba['table']);for(var _0x5255ea=0x0;_0x5255ea<_0x466688[_0x488a('0x33')];_0x5255ea+=0x1){_0x42eb66=_0x466688[_0x5255ea][_0x488a('0x6f')]?_0x22cac1[_0x466688[_0x5255ea][_0x488a('0x6f')]][_0x488a('0x89')]:_0x466688[_0x5255ea][_0x488a('0x66')];_0x42eb66=_0x466688[_0x5255ea]['function']?_[_0x488a('0x72')](_0x1cf5ff[_0x466688[_0x5255ea][_0x488a('0x70')]],'%s',_0x42eb66):_0x42eb66;_0x42eb66=_0x466688[_0x5255ea][_0x488a('0x71')]?_[_0x488a('0x72')](_0x27588c[_0x466688[_0x5255ea][_0x488a('0x71')]],'%s',_0x42eb66):_0x42eb66;if(_0x466688[_0x5255ea][_0x488a('0x73')]){_0x41acad[_0x488a('0x65')](_0x42eb66);}_0x466688[_0x5255ea][_0x488a('0x74')]&&_0x41acad['order'](_0x42eb66,_0x466688[_0x5255ea]['orderBy']==='DESC'?![]:!![]);_0x41acad[_0x488a('0x66')](_0x42eb66,_0x466688[_0x5255ea]['alias']||_0x42eb66);}if(_0x4611ba[_0x488a('0x77')]){_0x4611ba[_0x488a('0x77')]=JSON[_0x488a('0x8a')](_0x4611ba[_0x488a('0x77')]);for(var _0x2bf7df=0x0;_0x2bf7df<_0x4611ba[_0x488a('0x77')]['length'];_0x2bf7df+=0x1){if(_0x4611ba[_0x488a('0x77')][_0x2bf7df]['type']&&_[_0x488a('0x5f')](_0x1b5513,_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x2d')])&&_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x7a')]&&_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x8b')]&&_0x4611ba[_0x488a('0x77')][_0x2bf7df]['foreignKey']){_0x41acad[_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x2d')]](_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x8b')],null,util[_0x488a('0x71')](_0x488a('0x79'),_0x4611ba[_0x488a('0x6e')],_0x4611ba['joins'][_0x2bf7df]['parentKey'],_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x8b')],_0x4611ba[_0x488a('0x77')][_0x2bf7df][_0x488a('0x78')]));}}}if(_0x4611ba[_0x488a('0x7b')]){_0x4611ba[_0x488a('0x7b')]=JSON[_0x488a('0x8a')](_0x4611ba[_0x488a('0x7b')]);_0x41acad[_0x488a('0x3a')](_0x5d2d5a(_0x4611ba['conditions'][_0x488a('0x65')]));}_0x43faf0=_0x41acad[_0x488a('0x7c')]();_0x41acad['limit'](_0x1cc229);_0x41acad[_0x488a('0x19')](0x0);return;}})[_0x488a('0x22')](function(){if(_0x13f5cd[_0x488a('0x8c')]===_0x488a('0x8d')){return null;}var _0x536312=_['merge'](_0x13f5cd,{'name':_0x13f5cd[_0x488a('0x8e')]||_0x13f5cd[_0x488a('0x27')]||_0x4611ba[_0x488a('0x27')],'basename':_0x477604,'savename':util[_0x488a('0x71')]('%s-%s.%s',_0x13f5cd[_0x488a('0x27')]||_0x4611ba[_0x488a('0x27')],require('randomstring')['generate'](0x4),_0x13f5cd['output']||_0x488a('0x8f')),'reportId':_0x4611ba['id'],'reportType':'custom'});return db[_0x488a('0x90')]['create'](_0x536312,{'raw':!![]});})['then'](function(_0x167222){if(_0x4611ba['table']===_0x488a('0x91')){_0x43faf0[_0x488a('0x3a')](_0x4611ba[_0x488a('0x6e')]+_0x488a('0x92'),_0x13f5cd[_0x488a('0x93')],_0x13f5cd[_0x488a('0x94')]);}else{_0x43faf0[_0x488a('0x3a')](_0x4611ba[_0x488a('0x6e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x13f5cd[_0x488a('0x93')],_0x13f5cd[_0x488a('0x94')]);}if(_0x167222){logger[_0x488a('0x95')](_0x488a('0x96'),_0x43faf0[_0x488a('0x7f')]());require('child_process')['fork'](path[_0x488a('0x4f')](__dirname,'../../components/export/',_0x167222['output']),[_0x167222['id'],_0x43faf0[_0x488a('0x7f')](),path[_0x488a('0x4f')](__dirname,_0x488a('0x97'),_0x167222[_0x488a('0x98')]),_0x477604]);return _0x167222;}else{var _0x299ca3=squel[_0x488a('0x6d')]();_0x299ca3['from']('('+_0x43faf0[_0x488a('0x7f')]()+')',_0x488a('0x99'));_0x299ca3['field'](_0x488a('0x9a'),_0x488a('0x1c'));_0x43faf0[_0x488a('0x1b')](_0x13f5cd[_0x488a('0x1b')]||_0x1cc229);_0x43faf0[_0x488a('0x19')](_0x13f5cd[_0x488a('0x19')]||0x0);return dbH[_0x488a('0x80')]['query'](_0x299ca3['toString'](),{'type':dbH[_0x488a('0x80')]['QueryTypes'][_0x488a('0x82')]})[_0x488a('0x22')](function(_0x2b0b83){if(!_0x2b0b83[_0x488a('0x33')]){_0x57f7fd=0x0;}else{_0x57f7fd=_0x2b0b83[0x0][_0x488a('0x1c')]||0x0;}return dbH[_0x488a('0x80')][_0x488a('0x2f')](_0x43faf0[_0x488a('0x7f')](),{'type':dbH['sequelize'][_0x488a('0x81')]['SELECT']});})[_0x488a('0x22')](function(_0x3d73ee){return{'rows':_0x3d73ee||[],'count':_0x57f7fd};});}});}exports['run']=function(_0x528b59,_0x27ee14){return runReport(_0x528b59[_0x488a('0x44')],_0x528b59[_0x488a('0x2f')],_0x528b59[_0x488a('0x3d')])['then'](respondWithResult(_0x27ee14,null))['catch'](handleError(_0x27ee14,null));};exports[_0x488a('0x9b')]=runReport;exports['query']=function(_0x592ae1,_0x772bc1){var _0x1e08cb=0xa;var _0x11388f=[_0x488a('0x4f'),_0x488a('0x50'),'right_join','cross_join'];var _0x58b7b5={'SUM':_0x488a('0x53'),'COUNT':_0x488a('0x54'),'COUNT DISTINCT':_0x488a('0x55'),'MAX':_0x488a('0x56'),'MIN':_0x488a('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x488a('0x59'),'GROUP_CONCAT DESC':_0x488a('0x5a')};var _0x546966={'SEC_TO_TIME':_0x488a('0x5b'),'DATE':_0x488a('0x5c'),'HOUR':_0x488a('0x84'),'ROUND':_0x488a('0x5d'),'UNIX_TIMESTAMP':_0x488a('0x5e')};var _0x5d6264=function(_0x3c9a6d){return!_['includes']([_0x488a('0x60'),_0x488a('0x61'),_0x488a('0x62'),_0x488a('0x63')],_0x3c9a6d);};var _0x15f834=function(_0xf88d72){if(!_0xf88d72||!_0xf88d72[_0x488a('0x64')][_0x488a('0x33')]){return'';}for(var _0xce5a3c='(',_0x508ec4=0x0;_0x508ec4<_0xf88d72[_0x488a('0x64')]['length'];_0x508ec4+=0x1){_0x508ec4>0x0&&(_0xce5a3c+='\x20'+_0xf88d72['operator']+'\x20');_0xce5a3c+=_0xf88d72['rules'][_0x508ec4]['group']?_0x15f834(_0xf88d72[_0x488a('0x64')][_0x508ec4][_0x488a('0x65')]):_0xf88d72[_0x488a('0x64')][_0x508ec4][_0x488a('0x66')]+'\x20'+_0xf88d72[_0x488a('0x64')][_0x508ec4][_0x488a('0x67')]+(_0x5d6264(_0xf88d72[_0x488a('0x64')][_0x508ec4]['condition'])?'\x20'+_0xf88d72['rules'][_0x508ec4]['value']:'');}return _0xce5a3c+')';};var _0x48a896={'where':{'id':_0x592ae1['params']['id']}},_0x5d9bf4,_0x374b07,_0x400e9a,_0x1b0e2c,_0x4c9dc8;_0x48a896=_[_0x488a('0x3c')]({},_0x48a896,_0x592ae1[_0x488a('0x3d')]);return db[_0x488a('0x3e')][_0x488a('0x4b')](_0x48a896)[_0x488a('0x22')](function(_0x2ec357){if(_0x2ec357){_0x5d9bf4=_0x2ec357;return _0x2ec357[_0x488a('0x69')]();}return null;})[_0x488a('0x22')](function(_0x28dd34){if(_0x28dd34){if(!_0x28dd34[_0x488a('0x33')]){throw new db[(_0x488a('0x6a'))][(_0x488a('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x374b07=_0x28dd34;return db[_0x488a('0x6c')][_0x488a('0x41')]({'raw':!![]});}return null;})[_0x488a('0x22')](function(_0x115f6f){if(_0x115f6f){_0x400e9a=_[_0x488a('0x87')](_0x115f6f,'id');var _0x246a27;var _0x309e88=squel[_0x488a('0x6d')]();_0x309e88[_0x488a('0x88')](_0x5d9bf4[_0x488a('0x6e')]);for(var _0x1453c0=0x0;_0x1453c0<_0x374b07[_0x488a('0x33')];_0x1453c0+=0x1){_0x246a27=_0x374b07[_0x1453c0]['MetricId']?_0x400e9a[_0x374b07[_0x1453c0][_0x488a('0x6f')]]['metric']:_0x374b07[_0x1453c0]['field'];_0x246a27=_0x374b07[_0x1453c0][_0x488a('0x70')]?_[_0x488a('0x72')](_0x58b7b5[_0x374b07[_0x1453c0][_0x488a('0x70')]],'%s',_0x246a27):_0x246a27;_0x246a27=_0x374b07[_0x1453c0][_0x488a('0x71')]?_[_0x488a('0x72')](_0x546966[_0x374b07[_0x1453c0][_0x488a('0x71')]],'%s',_0x246a27):_0x246a27;if(_0x374b07[_0x1453c0][_0x488a('0x73')]){_0x309e88[_0x488a('0x65')](_0x246a27);}_0x374b07[_0x1453c0][_0x488a('0x74')]&&_0x309e88[_0x488a('0x36')](_0x246a27,_0x374b07[_0x1453c0][_0x488a('0x74')]==='DESC'?![]:!![]);_0x309e88[_0x488a('0x66')](_0x246a27,_0x374b07[_0x1453c0][_0x488a('0x76')]||_0x246a27);}if(_0x5d9bf4[_0x488a('0x77')]){_0x5d9bf4[_0x488a('0x77')]=JSON[_0x488a('0x8a')](_0x5d9bf4[_0x488a('0x77')]);for(var _0x31a6ae=0x0;_0x31a6ae<_0x5d9bf4[_0x488a('0x77')][_0x488a('0x33')];_0x31a6ae+=0x1){if(_0x5d9bf4[_0x488a('0x77')][_0x31a6ae][_0x488a('0x2d')]&&_[_0x488a('0x5f')](_0x11388f,_0x5d9bf4['joins'][_0x31a6ae][_0x488a('0x2d')])&&_0x5d9bf4[_0x488a('0x77')][_0x31a6ae][_0x488a('0x7a')]&&_0x5d9bf4[_0x488a('0x77')][_0x31a6ae][_0x488a('0x8b')]&&_0x5d9bf4[_0x488a('0x77')][_0x31a6ae][_0x488a('0x78')]){_0x309e88[_0x5d9bf4['joins'][_0x31a6ae][_0x488a('0x2d')]](_0x5d9bf4['joins'][_0x31a6ae][_0x488a('0x8b')],null,util[_0x488a('0x71')](_0x488a('0x79'),_0x5d9bf4['table'],_0x5d9bf4[_0x488a('0x77')][_0x31a6ae]['parentKey'],_0x5d9bf4['joins'][_0x31a6ae]['foreignTable'],_0x5d9bf4['joins'][_0x31a6ae]['foreignKey']));}}}if(_0x5d9bf4[_0x488a('0x7b')]){_0x5d9bf4['conditions']=JSON[_0x488a('0x8a')](_0x5d9bf4[_0x488a('0x7b')]);_0x309e88[_0x488a('0x3a')](_0x15f834(_0x5d9bf4[_0x488a('0x7b')][_0x488a('0x65')]));}_0x4c9dc8=_0x309e88[_0x488a('0x7c')]();_0x309e88[_0x488a('0x1b')](_0x1e08cb);_0x309e88['offset'](0x0);logger[_0x488a('0x7d')](_0x488a('0x7e'),_0x309e88[_0x488a('0x7f')]());return dbH[_0x488a('0x80')]['query'](_0x309e88[_0x488a('0x7f')](),{'type':dbH[_0x488a('0x80')][_0x488a('0x81')][_0x488a('0x82')]});}})['then'](function(){return{'sql':_0x4c9dc8['toString']()};})[_0x488a('0x22')](respondWithResult(_0x772bc1,null))[_0x488a('0x43')](handleError(_0x772bc1,null));};
\ No newline at end of file
+var _0x9ed0=['getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','IS\x20NULL','operator','Sequelize','groupBy','web','%s-%s.%s','output','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','COUNT(*)','count','run','runReport','IS\x20NOT\x20EMPTY','keyBy','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','then','get','CustomReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value'];(function(_0x119b4b,_0x322a87){var _0x2ca4d5=function(_0x45a93e){while(--_0x45a93e){_0x119b4b['push'](_0x119b4b['shift']());}};_0x2ca4d5(++_0x322a87);}(_0x9ed0,0xe1));var _0x09ed=function(_0x1e6aa7,_0x3282c6){_0x1e6aa7=_0x1e6aa7-0x0;var _0x5f20c3=_0x9ed0[_0x1e6aa7];return _0x5f20c3;};'use strict';var emlformat=require(_0x09ed('0x0'));var rimraf=require(_0x09ed('0x1'));var zipdir=require(_0x09ed('0x2'));var jsonpatch=require(_0x09ed('0x3'));var rp=require(_0x09ed('0x4'));var moment=require(_0x09ed('0x5'));var BPromise=require(_0x09ed('0x6'));var Mustache=require(_0x09ed('0x7'));var util=require('util');var path=require(_0x09ed('0x8'));var sox=require(_0x09ed('0x9'));var csv=require(_0x09ed('0xa'));var ejs=require(_0x09ed('0xb'));var fs=require('fs');var fs_extra=require(_0x09ed('0xc'));var _=require(_0x09ed('0xd'));var squel=require(_0x09ed('0xe'));var crypto=require(_0x09ed('0xf'));var jsforce=require(_0x09ed('0x10'));var deskjs=require(_0x09ed('0x11'));var toCsv=require(_0x09ed('0xa'));var querystring=require('querystring');var Papa=require(_0x09ed('0x12'));var Redis=require(_0x09ed('0x13'));var authService=require(_0x09ed('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x09ed('0x15'));var hardwareService=require(_0x09ed('0x16'));var logger=require(_0x09ed('0x17'))(_0x09ed('0x18'));var utils=require('../../config/utils');var config=require(_0x09ed('0x19'));var licenseUtil=require(_0x09ed('0x1a'));var db=require(_0x09ed('0x1b'))['db'];var dbH=require(_0x09ed('0x1b'))[_0x09ed('0x1c')];function respondWithStatusCode(_0x255179,_0x443466){_0x443466=_0x443466||0xcc;return function(_0x4c0cb7){if(_0x4c0cb7){return _0x255179['sendStatus'](_0x443466);}return _0x255179['status'](_0x443466)[_0x09ed('0x1d')]();};}function respondWithResult(_0x320d4b,_0x50c796){_0x50c796=_0x50c796||0xc8;return function(_0x4b41d5){if(_0x4b41d5){return _0x320d4b[_0x09ed('0x1e')](_0x50c796)[_0x09ed('0x1f')](_0x4b41d5);}};}function respondWithFilteredResult(_0x5a2786,_0x5de4da){return function(_0x43d212){if(_0x43d212){var _0x4df999=typeof _0x5de4da[_0x09ed('0x20')]===_0x09ed('0x21')&&typeof _0x5de4da[_0x09ed('0x22')]===_0x09ed('0x21');var _0x262daa=_0x43d212['count'];var _0x257007=_0x4df999?0x0:_0x5de4da['offset'];var _0x2effe0=_0x4df999?_0x43d212['count']:_0x5de4da[_0x09ed('0x20')]+_0x5de4da[_0x09ed('0x22')];var _0x1eec0e;if(_0x2effe0>=_0x262daa){_0x2effe0=_0x262daa;_0x1eec0e=0xc8;}else{_0x1eec0e=0xce;}_0x5a2786['status'](_0x1eec0e);return _0x5a2786[_0x09ed('0x23')](_0x09ed('0x24'),_0x257007+'-'+_0x2effe0+'/'+_0x262daa)[_0x09ed('0x1f')](_0x43d212);}return null;};}function patchUpdates(_0x27e440){return function(_0x477c4c){try{jsonpatch['apply'](_0x477c4c,_0x27e440,!![]);}catch(_0x21d632){return BPromise[_0x09ed('0x25')](_0x21d632);}return _0x477c4c[_0x09ed('0x26')]();};}function saveUpdates(_0x201963,_0x1db8d0){return function(_0x2a1b72){if(_0x2a1b72){return _0x2a1b72['update'](_0x201963)['then'](function(_0x24a05e){return _0x24a05e;});}return null;};}function removeEntity(_0xe9859d,_0x5248bc){return function(_0x8634c3){if(_0x8634c3){return _0x8634c3['destroy']()[_0x09ed('0x27')](function(){var _0x2f10e1=_0x8634c3[_0x09ed('0x28')]({'plain':!![]});var _0x3a4ed3=_0x09ed('0x29');return db[_0x09ed('0x2a')][_0x09ed('0x2b')]({'where':{'type':_0x3a4ed3,'resourceId':_0x2f10e1['id']}})[_0x09ed('0x27')](function(){return _0x8634c3;});})[_0x09ed('0x27')](function(){_0xe9859d[_0x09ed('0x1e')](0xcc)[_0x09ed('0x1d')]();});}};}function handleEntityNotFound(_0x4171df,_0x3bb7ad){return function(_0x24d820){if(!_0x24d820){_0x4171df[_0x09ed('0x2c')](0x194);}return _0x24d820;};}function handleError(_0x485931,_0x2aab77){_0x2aab77=_0x2aab77||0x1f4;return function(_0xfaa0e2){logger[_0x09ed('0x2d')](_0xfaa0e2[_0x09ed('0x2e')]);if(_0xfaa0e2['name']){delete _0xfaa0e2[_0x09ed('0x2f')];}_0x485931[_0x09ed('0x1e')](_0x2aab77)[_0x09ed('0x30')](_0xfaa0e2);};}exports[_0x09ed('0x31')]=function(_0x42bbc9,_0x3c3ae0){var _0x2e6750={},_0x3c73ea={},_0x1ec9b9={'count':0x0,'rows':[]};var _0x31081f=_[_0x09ed('0x32')](db[_0x09ed('0x33')][_0x09ed('0x34')],function(_0x3072f9){return{'name':_0x3072f9['fieldName'],'type':_0x3072f9['type'][_0x09ed('0x35')]};});_0x3c73ea[_0x09ed('0x36')]=_[_0x09ed('0x32')](_0x31081f,'name');_0x3c73ea['query']=_[_0x09ed('0x37')](_0x42bbc9[_0x09ed('0x38')]);_0x3c73ea[_0x09ed('0x39')]=_[_0x09ed('0x3a')](_0x3c73ea['model'],_0x3c73ea[_0x09ed('0x38')]);_0x2e6750[_0x09ed('0x3b')]=_[_0x09ed('0x3a')](_0x3c73ea[_0x09ed('0x36')],qs[_0x09ed('0x3c')](_0x42bbc9['query']['fields']));_0x2e6750[_0x09ed('0x3b')]=_0x2e6750[_0x09ed('0x3b')][_0x09ed('0x3d')]?_0x2e6750[_0x09ed('0x3b')]:_0x3c73ea[_0x09ed('0x36')];if(!_0x42bbc9[_0x09ed('0x38')]['hasOwnProperty']('nolimit')){_0x2e6750[_0x09ed('0x22')]=qs[_0x09ed('0x22')](_0x42bbc9['query'][_0x09ed('0x22')]);_0x2e6750[_0x09ed('0x20')]=qs[_0x09ed('0x20')](_0x42bbc9['query'][_0x09ed('0x20')]);}_0x2e6750[_0x09ed('0x3e')]=qs['sort'](_0x42bbc9[_0x09ed('0x38')][_0x09ed('0x3f')]);_0x2e6750[_0x09ed('0x40')]=qs[_0x09ed('0x39')](_[_0x09ed('0x41')](_0x42bbc9['query'],_0x3c73ea[_0x09ed('0x39')]),_0x31081f);if(_0x42bbc9[_0x09ed('0x38')][_0x09ed('0x42')]){_0x2e6750['where']=_[_0x09ed('0x43')](_0x2e6750['where'],{'$or':_[_0x09ed('0x32')](_0x31081f,function(_0x412c0b){if(_0x412c0b[_0x09ed('0x44')]!==_0x09ed('0x45')){var _0x2472bc={};_0x2472bc[_0x412c0b[_0x09ed('0x2f')]]={'$like':'%'+_0x42bbc9[_0x09ed('0x38')][_0x09ed('0x42')]+'%'};return _0x2472bc;}})});}_0x2e6750=_[_0x09ed('0x43')]({},_0x2e6750,_0x42bbc9[_0x09ed('0x46')]);var _0x44e1a7={'where':_0x2e6750[_0x09ed('0x40')]};return db[_0x09ed('0x33')]['count'](_0x44e1a7)[_0x09ed('0x27')](function(_0x3e2800){_0x1ec9b9['count']=_0x3e2800;if(_0x42bbc9['query'][_0x09ed('0x47')]){_0x2e6750['include']=[{'all':!![]}];}return db[_0x09ed('0x33')]['findAll'](_0x2e6750);})[_0x09ed('0x27')](function(_0x202261){_0x1ec9b9[_0x09ed('0x48')]=_0x202261;return _0x1ec9b9;})[_0x09ed('0x27')](respondWithFilteredResult(_0x3c3ae0,_0x2e6750))[_0x09ed('0x49')](handleError(_0x3c3ae0,null));};exports[_0x09ed('0x4a')]=function(_0x3ac483,_0xaf0e60){var _0x57f9dd={'raw':![],'where':{'id':_0x3ac483[_0x09ed('0x4b')]['id']}},_0xcf1fb1={};_0xcf1fb1['model']=_[_0x09ed('0x37')](db[_0x09ed('0x33')][_0x09ed('0x34')]);_0xcf1fb1[_0x09ed('0x38')]=_[_0x09ed('0x37')](_0x3ac483[_0x09ed('0x38')]);_0xcf1fb1[_0x09ed('0x39')]=_[_0x09ed('0x3a')](_0xcf1fb1[_0x09ed('0x36')],_0xcf1fb1[_0x09ed('0x38')]);_0x57f9dd['attributes']=_['intersection'](_0xcf1fb1[_0x09ed('0x36')],qs[_0x09ed('0x3c')](_0x3ac483[_0x09ed('0x38')]['fields']));_0x57f9dd[_0x09ed('0x3b')]=_0x57f9dd[_0x09ed('0x3b')][_0x09ed('0x3d')]?_0x57f9dd[_0x09ed('0x3b')]:_0xcf1fb1[_0x09ed('0x36')];if(_0x3ac483[_0x09ed('0x38')][_0x09ed('0x47')]){_0x57f9dd[_0x09ed('0x4c')]=[{'all':!![]}];}_0x57f9dd=_[_0x09ed('0x43')]({},_0x57f9dd,_0x3ac483[_0x09ed('0x46')]);return db['AnalyticCustomReport'][_0x09ed('0x4d')](_0x57f9dd)[_0x09ed('0x27')](handleEntityNotFound(_0xaf0e60,null))[_0x09ed('0x27')](respondWithResult(_0xaf0e60,null))[_0x09ed('0x49')](handleError(_0xaf0e60,null));};exports[_0x09ed('0x4e')]=function(_0x247a91,_0x18fc2f){return db['AnalyticCustomReport'][_0x09ed('0x4e')](_0x247a91[_0x09ed('0x4f')],{})['then'](function(_0x3f158a){var _0x544438=_0x247a91[_0x09ed('0x50')][_0x09ed('0x28')]({'plain':!![]});if(!_0x544438)throw new Error(_0x09ed('0x51'));if(_0x544438[_0x09ed('0x52')]===_0x09ed('0x50')){var _0x3b223e=_0x3f158a[_0x09ed('0x28')]({'plain':!![]});var _0xb59573=_0x09ed('0x53');return db['UserProfileSection'][_0x09ed('0x4d')]({'where':{'name':_0xb59573,'userProfileId':_0x544438['userProfileId']},'raw':!![]})[_0x09ed('0x27')](function(_0x2e5b0d){if(_0x2e5b0d&&_0x2e5b0d[_0x09ed('0x54')]===0x0){return db['UserProfileResource'][_0x09ed('0x4e')]({'name':_0x3b223e[_0x09ed('0x2f')],'resourceId':_0x3b223e['id'],'type':'CustomReports','sectionId':_0x2e5b0d['id']},{})[_0x09ed('0x27')](function(){return _0x3f158a;});}else{return _0x3f158a;}})[_0x09ed('0x49')](function(_0x3f9b71){logger[_0x09ed('0x2d')](_0x09ed('0x55'),_0x3f9b71);throw _0x3f9b71;});}return _0x3f158a;})['then'](respondWithResult(_0x18fc2f,0xc9))[_0x09ed('0x49')](handleError(_0x18fc2f,null));};exports[_0x09ed('0x56')]=function(_0x173f4f,_0x370d7c){if(_0x173f4f[_0x09ed('0x4f')]['id']){delete _0x173f4f[_0x09ed('0x4f')]['id'];}return db[_0x09ed('0x33')][_0x09ed('0x4d')]({'where':{'id':_0x173f4f[_0x09ed('0x4b')]['id']}})[_0x09ed('0x27')](handleEntityNotFound(_0x370d7c,null))[_0x09ed('0x27')](saveUpdates(_0x173f4f[_0x09ed('0x4f')],null))[_0x09ed('0x27')](respondWithResult(_0x370d7c,null))[_0x09ed('0x49')](handleError(_0x370d7c,null));};exports[_0x09ed('0x2b')]=function(_0x4d351b,_0x11aa22){return db[_0x09ed('0x33')][_0x09ed('0x4d')]({'where':{'id':_0x4d351b['params']['id']}})[_0x09ed('0x27')](handleEntityNotFound(_0x11aa22,null))[_0x09ed('0x27')](removeEntity(_0x11aa22,null))['catch'](handleError(_0x11aa22,null));};exports[_0x09ed('0x57')]=function(_0x518218,_0x1f0bc7){var _0x2ca01a=0xa;var _0x2b4ea9=[_0x09ed('0x58'),'left_join',_0x09ed('0x59'),_0x09ed('0x5a')];var _0x285cd9={'SUM':_0x09ed('0x5b'),'COUNT':_0x09ed('0x5c'),'COUNT DISTINCT':_0x09ed('0x5d'),'MAX':_0x09ed('0x5e'),'MIN':_0x09ed('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x09ed('0x60'),'GROUP_CONCAT ASC':_0x09ed('0x61'),'GROUP_CONCAT DESC':_0x09ed('0x62')};var _0x397963={'SEC_TO_TIME':_0x09ed('0x63'),'DATE':_0x09ed('0x64'),'HOUR':_0x09ed('0x65'),'ROUND':_0x09ed('0x66'),'UNIX_TIMESTAMP':_0x09ed('0x67')};var _0x4882aa=function(_0x3967fa){return!_['includes'](['IS\x20NULL',_0x09ed('0x68'),_0x09ed('0x69'),'IS\x20NOT\x20EMPTY'],_0x3967fa);};var _0x544e02=function(_0x3b66a5){if(!_0x3b66a5||!_0x3b66a5[_0x09ed('0x6a')][_0x09ed('0x3d')]){return'';}for(var _0x2627b7='(',_0x26c03d=0x0;_0x26c03d<_0x3b66a5[_0x09ed('0x6a')]['length'];_0x26c03d+=0x1){_0x26c03d>0x0&&(_0x2627b7+='\x20'+_0x3b66a5['operator']+'\x20');_0x2627b7+=_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6b')]?_0x544e02(_0x3b66a5[_0x09ed('0x6a')][_0x26c03d]['group']):_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6c')]+'\x20'+_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6d')]+(_0x4882aa(_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6d')])?'\x20'+_0x3b66a5[_0x09ed('0x6a')][_0x26c03d][_0x09ed('0x6e')]:'');}return _0x2627b7+')';};var _0x57671f={'where':{'id':_0x518218[_0x09ed('0x4b')]['id']}},_0x4bcb9b,_0x4e3d7a,_0x267ba2,_0x5b0dd5,_0x300d1a;_0x57671f=_[_0x09ed('0x43')]({},_0x57671f,_0x518218[_0x09ed('0x46')]);return db[_0x09ed('0x33')][_0x09ed('0x4d')](_0x57671f)[_0x09ed('0x27')](function(_0x498d43){if(_0x498d43){_0x4bcb9b=_0x498d43;return _0x498d43[_0x09ed('0x6f')]();}return null;})[_0x09ed('0x27')](function(_0x4dca1e){if(_0x4dca1e){if(!_0x4dca1e[_0x09ed('0x3d')]){throw new db['Sequelize'][(_0x09ed('0x70'))](_0x09ed('0x71'),0x193);}_0x4e3d7a=_0x4dca1e;return db[_0x09ed('0x72')][_0x09ed('0x73')]({'raw':!![]});}return null;})[_0x09ed('0x27')](function(_0x492d89){if(_0x492d89){_0x267ba2=_['keyBy'](_0x492d89,'id');var _0x34548a;var _0x47af34=squel[_0x09ed('0x74')]();_0x47af34[_0x09ed('0x75')](_0x4bcb9b[_0x09ed('0x76')]);for(var _0x2267b7=0x0;_0x2267b7<_0x4e3d7a['length'];_0x2267b7+=0x1){_0x34548a=_0x4e3d7a[_0x2267b7][_0x09ed('0x77')]?_0x267ba2[_0x4e3d7a[_0x2267b7][_0x09ed('0x77')]][_0x09ed('0x78')]:_0x4e3d7a[_0x2267b7][_0x09ed('0x6c')];_0x34548a=_0x4e3d7a[_0x2267b7][_0x09ed('0x79')]?_[_0x09ed('0x7a')](_0x285cd9[_0x4e3d7a[_0x2267b7]['function']],'%s',_0x34548a):_0x34548a;_0x34548a=_0x4e3d7a[_0x2267b7][_0x09ed('0x7b')]?_['replace'](_0x397963[_0x4e3d7a[_0x2267b7][_0x09ed('0x7b')]],'%s',_0x34548a):_0x34548a;if(_0x4e3d7a[_0x2267b7]['groupBy']){_0x47af34[_0x09ed('0x6b')](_0x34548a);}_0x4e3d7a[_0x2267b7][_0x09ed('0x7c')]&&_0x47af34[_0x09ed('0x3e')](_0x34548a,_0x4e3d7a[_0x2267b7][_0x09ed('0x7c')]===_0x09ed('0x7d')?![]:!![]);_0x47af34[_0x09ed('0x6c')](_0x34548a,_0x4e3d7a[_0x2267b7][_0x09ed('0x7e')]||_0x34548a);}if(_0x4bcb9b[_0x09ed('0x7f')]){_0x4bcb9b[_0x09ed('0x7f')]=JSON[_0x09ed('0x80')](_0x4bcb9b[_0x09ed('0x7f')]);for(var _0x1d2779=0x0;_0x1d2779<_0x4bcb9b[_0x09ed('0x7f')]['length'];_0x1d2779+=0x1){if(_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x44')]&&_[_0x09ed('0x81')](_0x2b4ea9,_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x44')])&&_0x4bcb9b['joins'][_0x1d2779][_0x09ed('0x82')]&&_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x83')]&&_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779]['foreignKey']){_0x47af34[_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x44')]](_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x83')],null,util['format'](_0x09ed('0x84'),_0x4bcb9b[_0x09ed('0x76')],_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779]['parentKey'],_0x4bcb9b['joins'][_0x1d2779][_0x09ed('0x83')],_0x4bcb9b[_0x09ed('0x7f')][_0x1d2779][_0x09ed('0x85')]));}}}if(_0x4bcb9b[_0x09ed('0x86')]){_0x4bcb9b[_0x09ed('0x86')]=JSON[_0x09ed('0x80')](_0x4bcb9b[_0x09ed('0x86')]);_0x47af34[_0x09ed('0x40')](_0x544e02(_0x4bcb9b['conditions'][_0x09ed('0x6b')]));}_0x300d1a=_0x47af34[_0x09ed('0x87')]();_0x47af34[_0x09ed('0x22')](_0x2ca01a);_0x47af34['offset'](0x0);logger['debug']('Limited\x20Query:',_0x47af34[_0x09ed('0x88')]());return dbH[_0x09ed('0x89')]['query'](_0x47af34[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')][_0x09ed('0x8b')]});}})[_0x09ed('0x27')](respondWithResult(_0x1f0bc7,null))[_0x09ed('0x49')](handleError(_0x1f0bc7,null));};function runReport(_0x59c345,_0x175f0f,_0x469f5b){var _0x58594a=_0x175f0f[_0x09ed('0x2f')];var _0x259dee=0xa;var _0x26e4ac=[_0x09ed('0x58'),_0x09ed('0x8c'),_0x09ed('0x59'),_0x09ed('0x5a')];var _0x4f3458={'SUM':_0x09ed('0x5b'),'COUNT':_0x09ed('0x5c'),'COUNT DISTINCT':_0x09ed('0x5d'),'MAX':_0x09ed('0x5e'),'MIN':'MIN(%s)','AVG':_0x09ed('0x8d'),'GROUP_CONCAT':_0x09ed('0x60'),'GROUP_CONCAT ASC':_0x09ed('0x61'),'GROUP_CONCAT DESC':_0x09ed('0x62')};var _0x27e831={'SEC_TO_TIME':_0x09ed('0x63'),'DATE':_0x09ed('0x64'),'HOUR':_0x09ed('0x65'),'ROUND':_0x09ed('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a1657=function(_0x27683a){return!_[_0x09ed('0x81')]([_0x09ed('0x8e'),_0x09ed('0x68'),_0x09ed('0x69'),'IS\x20NOT\x20EMPTY'],_0x27683a);};var _0x42508a=function(_0xe1bb43){if(!_0xe1bb43||!_0xe1bb43[_0x09ed('0x6a')][_0x09ed('0x3d')]){return'';}for(var _0x12b98f='(',_0x283992=0x0;_0x283992<_0xe1bb43['rules'][_0x09ed('0x3d')];_0x283992+=0x1){_0x283992>0x0&&(_0x12b98f+='\x20'+_0xe1bb43[_0x09ed('0x8f')]+'\x20');_0x12b98f+=_0xe1bb43[_0x09ed('0x6a')][_0x283992][_0x09ed('0x6b')]?_0x42508a(_0xe1bb43[_0x09ed('0x6a')][_0x283992][_0x09ed('0x6b')]):_0xe1bb43[_0x09ed('0x6a')][_0x283992]['field']+'\x20'+_0xe1bb43['rules'][_0x283992][_0x09ed('0x6d')]+(_0x5a1657(_0xe1bb43[_0x09ed('0x6a')][_0x283992][_0x09ed('0x6d')])?'\x20'+_0xe1bb43[_0x09ed('0x6a')][_0x283992]['value']:'');}return _0x12b98f+')';};var _0x387b96={'where':{'id':_0x59c345['id']}},_0x271b83,_0x2bf4ec,_0x4619c5,_0x43f365,_0x421ca2;_0x387b96=_['merge']({},_0x387b96,_0x469f5b);return db[_0x09ed('0x33')][_0x09ed('0x4d')](_0x387b96)[_0x09ed('0x27')](function(_0x3a3af9){if(_0x3a3af9){_0x271b83=_0x3a3af9;return _0x3a3af9['getFields']();}return null;})[_0x09ed('0x27')](function(_0x34deed){if(_0x34deed){if(!_0x34deed[_0x09ed('0x3d')]){throw new db[(_0x09ed('0x90'))][(_0x09ed('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bf4ec=_0x34deed;return db[_0x09ed('0x72')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x66faa2){if(_0x66faa2){_0x4619c5=_['keyBy'](_0x66faa2,'id');var _0x1cddd9;var _0x282f0a=squel['select']();_0x282f0a[_0x09ed('0x75')](_0x271b83[_0x09ed('0x76')]);for(var _0x4fd105=0x0;_0x4fd105<_0x2bf4ec[_0x09ed('0x3d')];_0x4fd105+=0x1){_0x1cddd9=_0x2bf4ec[_0x4fd105][_0x09ed('0x77')]?_0x4619c5[_0x2bf4ec[_0x4fd105]['MetricId']][_0x09ed('0x78')]:_0x2bf4ec[_0x4fd105][_0x09ed('0x6c')];_0x1cddd9=_0x2bf4ec[_0x4fd105]['function']?_[_0x09ed('0x7a')](_0x4f3458[_0x2bf4ec[_0x4fd105][_0x09ed('0x79')]],'%s',_0x1cddd9):_0x1cddd9;_0x1cddd9=_0x2bf4ec[_0x4fd105][_0x09ed('0x7b')]?_[_0x09ed('0x7a')](_0x27e831[_0x2bf4ec[_0x4fd105][_0x09ed('0x7b')]],'%s',_0x1cddd9):_0x1cddd9;if(_0x2bf4ec[_0x4fd105][_0x09ed('0x91')]){_0x282f0a[_0x09ed('0x6b')](_0x1cddd9);}_0x2bf4ec[_0x4fd105]['orderBy']&&_0x282f0a[_0x09ed('0x3e')](_0x1cddd9,_0x2bf4ec[_0x4fd105][_0x09ed('0x7c')]===_0x09ed('0x7d')?![]:!![]);_0x282f0a['field'](_0x1cddd9,_0x2bf4ec[_0x4fd105][_0x09ed('0x7e')]||_0x1cddd9);}if(_0x271b83['joins']){_0x271b83[_0x09ed('0x7f')]=JSON['parse'](_0x271b83[_0x09ed('0x7f')]);for(var _0x192c80=0x0;_0x192c80<_0x271b83[_0x09ed('0x7f')][_0x09ed('0x3d')];_0x192c80+=0x1){if(_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x44')]&&_['includes'](_0x26e4ac,_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x44')])&&_0x271b83[_0x09ed('0x7f')][_0x192c80]['parentKey']&&_0x271b83[_0x09ed('0x7f')][_0x192c80]['foreignTable']&&_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x85')]){_0x282f0a[_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x44')]](_0x271b83[_0x09ed('0x7f')][_0x192c80][_0x09ed('0x83')],null,util[_0x09ed('0x7b')](_0x09ed('0x84'),_0x271b83[_0x09ed('0x76')],_0x271b83['joins'][_0x192c80][_0x09ed('0x82')],_0x271b83['joins'][_0x192c80][_0x09ed('0x83')],_0x271b83['joins'][_0x192c80][_0x09ed('0x85')]));}}}if(_0x271b83[_0x09ed('0x86')]){_0x271b83[_0x09ed('0x86')]=JSON[_0x09ed('0x80')](_0x271b83[_0x09ed('0x86')]);_0x282f0a[_0x09ed('0x40')](_0x42508a(_0x271b83['conditions'][_0x09ed('0x6b')]));}_0x421ca2=_0x282f0a[_0x09ed('0x87')]();_0x282f0a[_0x09ed('0x22')](_0x259dee);_0x282f0a[_0x09ed('0x20')](0x0);return;}})[_0x09ed('0x27')](function(){if(_0x175f0f['output']===_0x09ed('0x92')){return null;}var _0x252d4b=_['merge'](_0x175f0f,{'name':_0x175f0f['fullPath']||_0x175f0f[_0x09ed('0x2f')]||_0x271b83[_0x09ed('0x2f')],'basename':_0x58594a,'savename':util[_0x09ed('0x7b')](_0x09ed('0x93'),_0x175f0f[_0x09ed('0x2f')]||_0x271b83[_0x09ed('0x2f')],require('randomstring')['generate'](0x4),_0x175f0f[_0x09ed('0x94')]||'csv'),'reportId':_0x271b83['id'],'reportType':_0x09ed('0x95')});return db[_0x09ed('0x96')]['create'](_0x252d4b,{'raw':!![]});})[_0x09ed('0x27')](function(_0x7207){if(_0x271b83[_0x09ed('0x76')]==='cdr'){_0x421ca2['where'](_0x271b83[_0x09ed('0x76')]+_0x09ed('0x97'),_0x175f0f[_0x09ed('0x98')],_0x175f0f[_0x09ed('0x99')]);}else{_0x421ca2[_0x09ed('0x40')](_0x271b83[_0x09ed('0x76')]+_0x09ed('0x9a'),_0x175f0f[_0x09ed('0x98')],_0x175f0f[_0x09ed('0x99')]);}if(_0x7207){logger[_0x09ed('0x9b')](_0x09ed('0x9c'),_0x421ca2[_0x09ed('0x88')]());require(_0x09ed('0x9d'))['fork'](path[_0x09ed('0x58')](__dirname,_0x09ed('0x9e'),_0x7207[_0x09ed('0x94')]),[_0x7207['id'],_0x421ca2['toString'](),path['join'](__dirname,_0x09ed('0x9f'),_0x7207[_0x09ed('0xa0')]),_0x58594a]);return _0x7207;}else{var _0x3df215=squel[_0x09ed('0x74')]();_0x3df215[_0x09ed('0x75')]('('+_0x421ca2[_0x09ed('0x88')]()+')','countTable');_0x3df215[_0x09ed('0x6c')](_0x09ed('0xa1'),_0x09ed('0xa2'));_0x421ca2[_0x09ed('0x22')](_0x175f0f['limit']||_0x259dee);_0x421ca2[_0x09ed('0x20')](_0x175f0f['offset']||0x0);return dbH['sequelize'][_0x09ed('0x38')](_0x3df215[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')]['SELECT']})['then'](function(_0x48a1af){if(!_0x48a1af[_0x09ed('0x3d')]){_0x43f365=0x0;}else{_0x43f365=_0x48a1af[0x0][_0x09ed('0xa2')]||0x0;}return dbH[_0x09ed('0x89')][_0x09ed('0x38')](_0x421ca2[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')][_0x09ed('0x8b')]});})[_0x09ed('0x27')](function(_0x41e851){return{'rows':_0x41e851||[],'count':_0x43f365};});}});}exports[_0x09ed('0xa3')]=function(_0x2569ae,_0x4a827){return runReport(_0x2569ae[_0x09ed('0x4b')],_0x2569ae[_0x09ed('0x38')],_0x2569ae[_0x09ed('0x46')])[_0x09ed('0x27')](respondWithResult(_0x4a827,null))['catch'](handleError(_0x4a827,null));};exports[_0x09ed('0xa4')]=runReport;exports[_0x09ed('0x38')]=function(_0x459905,_0x5d80b7){var _0x46f2c9=0xa;var _0x569c79=[_0x09ed('0x58'),_0x09ed('0x8c'),_0x09ed('0x59'),_0x09ed('0x5a')];var _0x214a1f={'SUM':_0x09ed('0x5b'),'COUNT':_0x09ed('0x5c'),'COUNT DISTINCT':_0x09ed('0x5d'),'MAX':_0x09ed('0x5e'),'MIN':_0x09ed('0x5f'),'AVG':_0x09ed('0x8d'),'GROUP_CONCAT':_0x09ed('0x60'),'GROUP_CONCAT ASC':_0x09ed('0x61'),'GROUP_CONCAT DESC':_0x09ed('0x62')};var _0x120e88={'SEC_TO_TIME':_0x09ed('0x63'),'DATE':_0x09ed('0x64'),'HOUR':'HOUR(%s)','ROUND':_0x09ed('0x66'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x21bdd2=function(_0x1e9e7f){return!_[_0x09ed('0x81')]([_0x09ed('0x8e'),_0x09ed('0x68'),'IS\x20EMPTY',_0x09ed('0xa5')],_0x1e9e7f);};var _0x161f36=function(_0x26986d){if(!_0x26986d||!_0x26986d['rules'][_0x09ed('0x3d')]){return'';}for(var _0x390a98='(',_0x5416ad=0x0;_0x5416ad<_0x26986d[_0x09ed('0x6a')]['length'];_0x5416ad+=0x1){_0x5416ad>0x0&&(_0x390a98+='\x20'+_0x26986d[_0x09ed('0x8f')]+'\x20');_0x390a98+=_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6b')]?_0x161f36(_0x26986d['rules'][_0x5416ad][_0x09ed('0x6b')]):_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6c')]+'\x20'+_0x26986d[_0x09ed('0x6a')][_0x5416ad]['condition']+(_0x21bdd2(_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6d')])?'\x20'+_0x26986d[_0x09ed('0x6a')][_0x5416ad][_0x09ed('0x6e')]:'');}return _0x390a98+')';};var _0x22da97={'where':{'id':_0x459905[_0x09ed('0x4b')]['id']}},_0x8360b2,_0x1f566e,_0x495839,_0x3b3e8b,_0x4f4e85;_0x22da97=_[_0x09ed('0x43')]({},_0x22da97,_0x459905[_0x09ed('0x46')]);return db['AnalyticCustomReport'][_0x09ed('0x4d')](_0x22da97)['then'](function(_0x546af0){if(_0x546af0){_0x8360b2=_0x546af0;return _0x546af0[_0x09ed('0x6f')]();}return null;})[_0x09ed('0x27')](function(_0x3b7ad2){if(_0x3b7ad2){if(!_0x3b7ad2[_0x09ed('0x3d')]){throw new db[(_0x09ed('0x90'))]['ValidationErrorItem'](_0x09ed('0x71'),0x193);}_0x1f566e=_0x3b7ad2;return db['AnalyticMetric'][_0x09ed('0x73')]({'raw':!![]});}return null;})[_0x09ed('0x27')](function(_0xff1d4){if(_0xff1d4){_0x495839=_[_0x09ed('0xa6')](_0xff1d4,'id');var _0x2991a1;var _0x543312=squel[_0x09ed('0x74')]();_0x543312['from'](_0x8360b2[_0x09ed('0x76')]);for(var _0x5ad66e=0x0;_0x5ad66e<_0x1f566e['length'];_0x5ad66e+=0x1){_0x2991a1=_0x1f566e[_0x5ad66e][_0x09ed('0x77')]?_0x495839[_0x1f566e[_0x5ad66e][_0x09ed('0x77')]][_0x09ed('0x78')]:_0x1f566e[_0x5ad66e][_0x09ed('0x6c')];_0x2991a1=_0x1f566e[_0x5ad66e][_0x09ed('0x79')]?_[_0x09ed('0x7a')](_0x214a1f[_0x1f566e[_0x5ad66e]['function']],'%s',_0x2991a1):_0x2991a1;_0x2991a1=_0x1f566e[_0x5ad66e][_0x09ed('0x7b')]?_[_0x09ed('0x7a')](_0x120e88[_0x1f566e[_0x5ad66e][_0x09ed('0x7b')]],'%s',_0x2991a1):_0x2991a1;if(_0x1f566e[_0x5ad66e][_0x09ed('0x91')]){_0x543312[_0x09ed('0x6b')](_0x2991a1);}_0x1f566e[_0x5ad66e][_0x09ed('0x7c')]&&_0x543312[_0x09ed('0x3e')](_0x2991a1,_0x1f566e[_0x5ad66e]['orderBy']===_0x09ed('0x7d')?![]:!![]);_0x543312['field'](_0x2991a1,_0x1f566e[_0x5ad66e][_0x09ed('0x7e')]||_0x2991a1);}if(_0x8360b2['joins']){_0x8360b2['joins']=JSON[_0x09ed('0x80')](_0x8360b2[_0x09ed('0x7f')]);for(var _0x345e82=0x0;_0x345e82<_0x8360b2['joins'][_0x09ed('0x3d')];_0x345e82+=0x1){if(_0x8360b2[_0x09ed('0x7f')][_0x345e82]['type']&&_[_0x09ed('0x81')](_0x569c79,_0x8360b2[_0x09ed('0x7f')][_0x345e82][_0x09ed('0x44')])&&_0x8360b2['joins'][_0x345e82][_0x09ed('0x82')]&&_0x8360b2['joins'][_0x345e82][_0x09ed('0x83')]&&_0x8360b2[_0x09ed('0x7f')][_0x345e82][_0x09ed('0x85')]){_0x543312[_0x8360b2[_0x09ed('0x7f')][_0x345e82]['type']](_0x8360b2['joins'][_0x345e82]['foreignTable'],null,util[_0x09ed('0x7b')](_0x09ed('0x84'),_0x8360b2[_0x09ed('0x76')],_0x8360b2[_0x09ed('0x7f')][_0x345e82]['parentKey'],_0x8360b2[_0x09ed('0x7f')][_0x345e82]['foreignTable'],_0x8360b2[_0x09ed('0x7f')][_0x345e82][_0x09ed('0x85')]));}}}if(_0x8360b2[_0x09ed('0x86')]){_0x8360b2['conditions']=JSON['parse'](_0x8360b2['conditions']);_0x543312['where'](_0x161f36(_0x8360b2['conditions'][_0x09ed('0x6b')]));}_0x4f4e85=_0x543312[_0x09ed('0x87')]();_0x543312[_0x09ed('0x22')](_0x46f2c9);_0x543312[_0x09ed('0x20')](0x0);logger['debug'](_0x09ed('0xa7'),_0x543312[_0x09ed('0x88')]());return dbH['sequelize'][_0x09ed('0x38')](_0x543312[_0x09ed('0x88')](),{'type':dbH[_0x09ed('0x89')][_0x09ed('0x8a')]['SELECT']});}})[_0x09ed('0x27')](function(){return{'sql':_0x4f4e85[_0x09ed('0x88')]()};})[_0x09ed('0x27')](respondWithResult(_0x5d80b7,null))[_0x09ed('0x49')](handleError(_0x5d80b7,null));};
\ No newline at end of file
index 4df9740..37fb60e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aab=['rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','bluebird','path'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0x6aab,0x1df));var _0xb6aa=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x6aab[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xb6aa('0x0'));var util=require(_0xb6aa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb6aa('0x2'));var BPromise=require(_0xb6aa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6aa('0x4'));var rimraf=require(_0xb6aa('0x5'));var config=require('../../config/environment');var attributes=require(_0xb6aa('0x6'));module[_0xb6aa('0x7')]=function(_0x4cae8e,_0x311ceb){return _0x4cae8e[_0xb6aa('0x8')](_0xb6aa('0x9'),attributes,{'tableName':_0xb6aa('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6faf=['exports','define','analytics_custom_reports','lodash','api','moment','request-promise','path','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6faf,0x1f2));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf6fa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf6fa('0x1'));var moment=require(_0xf6fa('0x2'));var BPromise=require('bluebird');var rp=require(_0xf6fa('0x3'));var fs=require('fs');var path=require(_0xf6fa('0x4'));var rimraf=require('rimraf');var config=require(_0xf6fa('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0xf6fa('0x6')]=function(_0x5bb903,_0x556dbd){return _0x5bb903[_0xf6fa('0x7')]('AnalyticCustomReport',attributes,{'tableName':_0xf6fa('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 20ed4a7..af60264 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb624=['util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash'];(function(_0x5bff9e,_0x39ea3a){var _0x7f42ef=function(_0x58a923){while(--_0x58a923){_0x5bff9e['push'](_0x5bff9e['shift']());}};_0x7f42ef(++_0x39ea3a);}(_0xb624,0xdb));var _0x4b62=function(_0x3d9e94,_0x48136c){_0x3d9e94=_0x3d9e94-0x0;var _0x45f76e=_0xb624[_0x3d9e94];return _0x45f76e;};'use strict';var _=require(_0x4b62('0x0'));var util=require(_0x4b62('0x1'));var moment=require(_0x4b62('0x2'));var BPromise=require(_0x4b62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b62('0x4'))['db'];var utils=require(_0x4b62('0x5'));var logger=require('../../config/logger')(_0x4b62('0x6'));var config=require(_0x4b62('0x7'));var jayson=require(_0x4b62('0x8'));var client=jayson[_0x4b62('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x683a8e,_0x2e059e,_0x12731f){return new BPromise(function(_0x4ba4a3,_0x2f85fa){return client[_0x4b62('0xa')](_0x683a8e,_0x12731f)[_0x4b62('0xb')](function(_0x4602da){logger[_0x4b62('0xc')](_0x4b62('0xd'),_0x2e059e,_0x4b62('0xe'));logger[_0x4b62('0xf')](_0x4b62('0x10'),_0x2e059e,_0x4b62('0xe'),JSON[_0x4b62('0x11')](_0x4602da));if(_0x4602da['error']){if(_0x4602da['error'][_0x4b62('0x12')]===0x1f4){logger['error'](_0x4b62('0xd'),_0x2e059e,_0x4602da[_0x4b62('0x13')]['message']);return _0x2f85fa(_0x4602da['error'][_0x4b62('0x14')]);}logger[_0x4b62('0x13')](_0x4b62('0xd'),_0x2e059e,_0x4602da[_0x4b62('0x13')][_0x4b62('0x14')]);return _0x4ba4a3(_0x4602da[_0x4b62('0x13')]['message']);}else{logger[_0x4b62('0xc')](_0x4b62('0xd'),_0x2e059e,_0x4b62('0xe'));_0x4ba4a3(_0x4602da[_0x4b62('0x15')][_0x4b62('0x14')]);}})['catch'](function(_0x25003e){logger[_0x4b62('0x13')](_0x4b62('0xd'),_0x2e059e,_0x25003e);_0x2f85fa(_0x25003e);});});}
\ No newline at end of file
+var _0xc75b=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x10fc0e,_0x3b68d1){var _0x1f47b6=function(_0x20f622){while(--_0x20f622){_0x10fc0e['push'](_0x10fc0e['shift']());}};_0x1f47b6(++_0x3b68d1);}(_0xc75b,0xdf));var _0xbc75=function(_0x23d39d,_0x68a19f){_0x23d39d=_0x23d39d-0x0;var _0x4e0cdf=_0xc75b[_0x23d39d];return _0x4e0cdf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbc75('0x0'));var BPromise=require(_0xbc75('0x1'));var rs=require(_0xbc75('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc75('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc75('0x4'))(_0xbc75('0x5'));var config=require('../../config/environment');var jayson=require(_0xbc75('0x6'));var client=jayson[_0xbc75('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a9873,_0x1fe8c4,_0x56372f){return new BPromise(function(_0x297327,_0x34f05b){return client[_0xbc75('0x8')](_0x1a9873,_0x56372f)[_0xbc75('0x9')](function(_0x3b3cdf){logger[_0xbc75('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1fe8c4,_0xbc75('0xb'));logger[_0xbc75('0xc')](_0xbc75('0xd'),_0x1fe8c4,_0xbc75('0xb'),JSON['stringify'](_0x3b3cdf));if(_0x3b3cdf[_0xbc75('0xe')]){if(_0x3b3cdf['error']['code']===0x1f4){logger[_0xbc75('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1fe8c4,_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);return _0x34f05b(_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);}logger[_0xbc75('0xe')](_0xbc75('0x10'),_0x1fe8c4,_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);return _0x297327(_0x3b3cdf[_0xbc75('0xe')][_0xbc75('0xf')]);}else{logger[_0xbc75('0xa')](_0xbc75('0x10'),_0x1fe8c4,'request\x20sent');_0x297327(_0x3b3cdf[_0xbc75('0x11')][_0xbc75('0xf')]);}})[_0xbc75('0x12')](function(_0x47edd4){logger['error'](_0xbc75('0x10'),_0x1fe8c4,_0x47edd4);_0x34f05b(_0x47edd4);});});}
\ No newline at end of file
index af3435c..ad89b7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b90=['isAuthenticated','get','/:id','show','/:id/preview','/:id/run','/:id/query','query','create','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0b90,0x1e6));var _0x00b9=function(_0x9ac6f2,_0x43d9e9){_0x9ac6f2=_0x9ac6f2-0x0;var _0x5bc954=_0x0b90[_0x9ac6f2];return _0x5bc954;};'use strict';var multer=require(_0x00b9('0x0'));var util=require(_0x00b9('0x1'));var path=require(_0x00b9('0x2'));var timeout=require(_0x00b9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x00b9('0x4'));var auth=require(_0x00b9('0x5'));var interaction=require(_0x00b9('0x6'));var config=require(_0x00b9('0x7'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x00b9('0x8')](),controller['index']);router[_0x00b9('0x9')](_0x00b9('0xa'),auth['isAuthenticated'](),controller[_0x00b9('0xb')]);router[_0x00b9('0x9')](_0x00b9('0xc'),auth[_0x00b9('0x8')](),controller['preview']);router['get'](_0x00b9('0xd'),auth[_0x00b9('0x8')](),controller['run']);router[_0x00b9('0x9')](_0x00b9('0xe'),auth[_0x00b9('0x8')](),controller[_0x00b9('0xf')]);router['post']('/',auth[_0x00b9('0x8')](),controller[_0x00b9('0x10')]);router['put']('/:id',auth[_0x00b9('0x8')](),controller[_0x00b9('0x11')]);router[_0x00b9('0x12')](_0x00b9('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd143=['create','put','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd143,0x138));var _0x3d14=function(_0x2fb049,_0x2a4364){_0x2fb049=_0x2fb049-0x0;var _0x22af82=_0xd143[_0x2fb049];return _0x22af82;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3d14('0x0'));var express=require('express');var router=express[_0x3d14('0x1')]();var fs_extra=require(_0x3d14('0x2'));var auth=require(_0x3d14('0x3'));var interaction=require(_0x3d14('0x4'));var config=require(_0x3d14('0x5'));var controller=require(_0x3d14('0x6'));router[_0x3d14('0x7')]('/',auth[_0x3d14('0x8')](),controller[_0x3d14('0x9')]);router[_0x3d14('0x7')](_0x3d14('0xa'),auth['isAuthenticated'](),controller[_0x3d14('0xb')]);router[_0x3d14('0x7')](_0x3d14('0xc'),auth[_0x3d14('0x8')](),controller[_0x3d14('0xd')]);router['get'](_0x3d14('0xe'),auth[_0x3d14('0x8')](),controller[_0x3d14('0xf')]);router['get'](_0x3d14('0x10'),auth['isAuthenticated'](),controller[_0x3d14('0x11')]);router['post']('/',auth[_0x3d14('0x8')](),controller[_0x3d14('0x12')]);router[_0x3d14('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3d14('0x14')]('/:id',auth[_0x3d14('0x8')](),controller[_0x3d14('0x15')]);module['exports']=router;
\ No newline at end of file
index 392395c..3f38b6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['sequelize','STRING','TEXT'];(function(_0x2df968,_0x2392ee){var _0x5d9cb1=function(_0x33c591){while(--_0x33c591){_0x2df968['push'](_0x2df968['shift']());}};_0x5d9cb1(++_0x2392ee);}(_0x7217,0x19e));var _0x7721=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x7217[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x284540,_0x207799){_0x284540=_0x284540-0x0;var _0xaabefd=_0x1cb9[_0x284540];return _0xaabefd;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}};
\ No newline at end of file
index 7a5ca7e..8e4c93e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x52a857,_0xc99fa1){var _0x4e2aae=function(_0x5410d9){while(--_0x5410d9){_0x52a857['push'](_0x52a857['shift']());}};_0x4e2aae(++_0xc99fa1);}(_0x4819,0xcd));var _0x9481=function(_0x2cf077,_0x5aa683){_0x2cf077=_0x2cf077-0x0;var _0x430718=_0x4819[_0x2cf077];return _0x430718;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
+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(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x2ef3,0xba));var _0x32ef=function(_0x8670b9,_0x168af2){_0x8670b9=_0x8670b9-0x0;var _0x564460=_0x2ef3[_0x8670b9];return _0x564460;};'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
index 80b9ca8..0a3b37d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6052=['./analyticDefaultReport.attributes','define','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6052,0x1e7));var _0x2605=function(_0x329984,_0x5c235e){_0x329984=_0x329984-0x0;var _0x4be6cf=_0x6052[_0x329984];return _0x4be6cf;};'use strict';var _=require('lodash');var util=require(_0x2605('0x0'));var logger=require(_0x2605('0x1'))(_0x2605('0x2'));var moment=require(_0x2605('0x3'));var BPromise=require(_0x2605('0x4'));var rp=require(_0x2605('0x5'));var fs=require('fs');var path=require(_0x2605('0x6'));var rimraf=require(_0x2605('0x7'));var config=require('../../config/environment');var attributes=require(_0x2605('0x8'));module['exports']=function(_0x3ce05d,_0x5e7dcd){return _0x3ce05d[_0x2605('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0x2605('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fe9=['util','../../config/logger','api','request-promise','rimraf','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x25c38f,_0x1538b4){var _0x2de94e=function(_0x3b836d){while(--_0x3b836d){_0x25c38f['push'](_0x25c38f['shift']());}};_0x2de94e(++_0x1538b4);}(_0x9fe9,0x1c1));var _0x99fe=function(_0x3baa05,_0x207228){_0x3baa05=_0x3baa05-0x0;var _0x3b2b8d=_0x9fe9[_0x3baa05];return _0x3b2b8d;};'use strict';var _=require(_0x99fe('0x0'));var util=require(_0x99fe('0x1'));var logger=require(_0x99fe('0x2'))(_0x99fe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x99fe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99fe('0x5'));var config=require('../../config/environment');var attributes=require(_0x99fe('0x6'));module['exports']=function(_0x25f9ed,_0xd96fb9){return _0x25f9ed[_0x99fe('0x7')](_0x99fe('0x8'),attributes,{'tableName':_0x99fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 554065e..f34db5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1651=['stringify','error','message','request\x20sent','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1651,0x6e));var _0x1165=function(_0xe6d7a0,_0x1aaa78){_0xe6d7a0=_0xe6d7a0-0x0;var _0x5efef2=_0x1651[_0xe6d7a0];return _0x5efef2;};'use strict';var _=require(_0x1165('0x0'));var util=require(_0x1165('0x1'));var moment=require(_0x1165('0x2'));var BPromise=require('bluebird');var rs=require(_0x1165('0x3'));var fs=require('fs');var Redis=require(_0x1165('0x4'));var db=require(_0x1165('0x5'))['db'];var utils=require(_0x1165('0x6'));var logger=require(_0x1165('0x7'))(_0x1165('0x8'));var config=require('../../config/environment');var jayson=require(_0x1165('0x9'));var client=jayson['client'][_0x1165('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33b7f3,_0xa6bf88,_0x385c1f){return new BPromise(function(_0x52013f,_0x282e20){return client[_0x1165('0xb')](_0x33b7f3,_0x385c1f)[_0x1165('0xc')](function(_0xef780a){logger[_0x1165('0xd')](_0x1165('0xe'),_0xa6bf88,'request\x20sent');logger[_0x1165('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0xa6bf88,'request\x20sent',JSON[_0x1165('0x10')](_0xef780a));if(_0xef780a[_0x1165('0x11')]){if(_0xef780a[_0x1165('0x11')]['code']===0x1f4){logger[_0x1165('0x11')](_0x1165('0xe'),_0xa6bf88,_0xef780a[_0x1165('0x11')]['message']);return _0x282e20(_0xef780a[_0x1165('0x11')][_0x1165('0x12')]);}logger['error'](_0x1165('0xe'),_0xa6bf88,_0xef780a['error'][_0x1165('0x12')]);return _0x52013f(_0xef780a['error']['message']);}else{logger[_0x1165('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xa6bf88,_0x1165('0x13'));_0x52013f(_0xef780a['result']['message']);}})[_0x1165('0x14')](function(_0x49d790){logger[_0x1165('0x11')](_0x1165('0xe'),_0xa6bf88,_0x49d790);_0x282e20(_0x49d790);});});}
\ No newline at end of file
+var _0x86e0=['rpc','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2f5b04,_0x56202c){var _0x2b587c=function(_0x18479c){while(--_0x18479c){_0x2f5b04['push'](_0x2f5b04['shift']());}};_0x2b587c(++_0x56202c);}(_0x86e0,0x1f3));var _0x086e=function(_0x189cef,_0x515130){_0x189cef=_0x189cef-0x0;var _0x332a74=_0x86e0[_0x189cef];return _0x332a74;};'use strict';var _=require(_0x086e('0x0'));var util=require('util');var moment=require(_0x086e('0x1'));var BPromise=require('bluebird');var rs=require(_0x086e('0x2'));var fs=require('fs');var Redis=require(_0x086e('0x3'));var db=require(_0x086e('0x4'))['db'];var utils=require(_0x086e('0x5'));var logger=require(_0x086e('0x6'))(_0x086e('0x7'));var config=require('../../config/environment');var jayson=require(_0x086e('0x8'));var client=jayson['client'][_0x086e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x576c1f,_0x3aa423,_0x2f32cf){return new BPromise(function(_0x454d2d,_0x30b38c){return client[_0x086e('0xa')](_0x576c1f,_0x2f32cf)[_0x086e('0xb')](function(_0xefffdb){logger[_0x086e('0xc')](_0x086e('0xd'),_0x3aa423,_0x086e('0xe'));logger[_0x086e('0xf')](_0x086e('0x10'),_0x3aa423,_0x086e('0xe'),JSON[_0x086e('0x11')](_0xefffdb));if(_0xefffdb[_0x086e('0x12')]){if(_0xefffdb['error'][_0x086e('0x13')]===0x1f4){logger[_0x086e('0x12')](_0x086e('0xd'),_0x3aa423,_0xefffdb[_0x086e('0x12')][_0x086e('0x14')]);return _0x30b38c(_0xefffdb[_0x086e('0x12')][_0x086e('0x14')]);}logger['error'](_0x086e('0xd'),_0x3aa423,_0xefffdb[_0x086e('0x12')][_0x086e('0x14')]);return _0x454d2d(_0xefffdb[_0x086e('0x12')]['message']);}else{logger[_0x086e('0xc')](_0x086e('0xd'),_0x3aa423,_0x086e('0xe'));_0x454d2d(_0xefffdb[_0x086e('0x15')][_0x086e('0x14')]);}})[_0x086e('0x16')](function(_0x241758){logger[_0x086e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3aa423,_0x241758);_0x30b38c(_0x241758);});});}
\ No newline at end of file
index 8dde066..e3c7318 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb5d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/preview','/:id/run','run','/:id/query','query','post','create','update','delete','multer','util'];(function(_0x58208b,_0x2a944e){var _0x5960b0=function(_0x37a623){while(--_0x37a623){_0x58208b['push'](_0x58208b['shift']());}};_0x5960b0(++_0x2a944e);}(_0xeb5d,0x174));var _0xdeb5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xeb5d[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xdeb5('0x0'));var util=require(_0xdeb5('0x1'));var path=require(_0xdeb5('0x2'));var timeout=require(_0xdeb5('0x3'));var express=require(_0xdeb5('0x4'));var router=express['Router']();var fs_extra=require(_0xdeb5('0x5'));var auth=require(_0xdeb5('0x6'));var interaction=require(_0xdeb5('0x7'));var config=require(_0xdeb5('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0xdeb5('0x9')]('/',auth['isAuthenticated'](),controller[_0xdeb5('0xa')]);router[_0xdeb5('0x9')](_0xdeb5('0xb'),auth[_0xdeb5('0xc')](),controller['show']);router['get'](_0xdeb5('0xd'),auth[_0xdeb5('0xc')](),controller['preview']);router[_0xdeb5('0x9')](_0xdeb5('0xe'),auth[_0xdeb5('0xc')](),controller[_0xdeb5('0xf')]);router[_0xdeb5('0x9')](_0xdeb5('0x10'),auth[_0xdeb5('0xc')](),controller[_0xdeb5('0x11')]);router[_0xdeb5('0x12')]('/',auth['isAuthenticated'](),controller[_0xdeb5('0x13')]);router['put'](_0xdeb5('0xb'),auth['isAuthenticated'](),controller[_0xdeb5('0x14')]);router[_0xdeb5('0x15')]('/:id',auth[_0xdeb5('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc6a2=['get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query','post','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xc6a2,0x69));var _0x2c6a=function(_0x4c7ce9,_0x3428df){_0x4c7ce9=_0x4c7ce9-0x0;var _0x37eee2=_0xc6a2[_0x4c7ce9];return _0x37eee2;};'use strict';var multer=require(_0x2c6a('0x0'));var util=require(_0x2c6a('0x1'));var path=require('path');var timeout=require(_0x2c6a('0x2'));var express=require(_0x2c6a('0x3'));var router=express[_0x2c6a('0x4')]();var fs_extra=require(_0x2c6a('0x5'));var auth=require(_0x2c6a('0x6'));var interaction=require(_0x2c6a('0x7'));var config=require(_0x2c6a('0x8'));var controller=require(_0x2c6a('0x9'));router[_0x2c6a('0xa')]('/',auth[_0x2c6a('0xb')](),controller[_0x2c6a('0xc')]);router[_0x2c6a('0xa')](_0x2c6a('0xd'),auth[_0x2c6a('0xb')](),controller['show']);router[_0x2c6a('0xa')](_0x2c6a('0xe'),auth[_0x2c6a('0xb')](),controller[_0x2c6a('0xf')]);router[_0x2c6a('0xa')](_0x2c6a('0x10'),auth[_0x2c6a('0xb')](),controller[_0x2c6a('0x11')]);router['get']('/:id/query',auth[_0x2c6a('0xb')](),controller[_0x2c6a('0x12')]);router[_0x2c6a('0x13')]('/',auth[_0x2c6a('0xb')](),controller['create']);router['put'](_0x2c6a('0xd'),auth[_0x2c6a('0xb')](),controller[_0x2c6a('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2c6a('0x15')]);module[_0x2c6a('0x16')]=router;
\ No newline at end of file
index a721159..0211e30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfba7=['sequelize','moment','exports','STRING','ENUM','xlsx','csv','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x13388e,_0x484c73){var _0x16cdbb=function(_0x39ab16){while(--_0x39ab16){_0x13388e['push'](_0x13388e['shift']());}};_0x16cdbb(++_0x484c73);}(_0xfba7,0x108));var _0x7fba=function(_0x2439d5,_0x51d2f6){_0x2439d5=_0x2439d5-0x0;var _0x56d082=_0xfba7[_0x2439d5];return _0x56d082;};'use strict';var Sequelize=require(_0x7fba('0x0'));var moment=require(_0x7fba('0x1'));module[_0x7fba('0x2')]={'name':{'type':Sequelize[_0x7fba('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x7fba('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x7fba('0x4')]('csv','pdf',_0x7fba('0x5')),'allowNull':![],'defaultValue':_0x7fba('0x6')},'savename':{'type':Sequelize[_0x7fba('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x7fba('0x7')]},'status':{'type':Sequelize[_0x7fba('0x3')],'defaultValue':_0x7fba('0x8')},'type':{'type':Sequelize[_0x7fba('0x4')](_0x7fba('0x9'),_0x7fba('0xa')),'allowNull':![],'defaultValue':_0x7fba('0x9')},'reportId':{'type':Sequelize[_0x7fba('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x7fba('0x3')]}};
\ No newline at end of file
+var _0x1b4d=['moment','exports','STRING','csv','pdf','DATE','Loading','ENUM','scheduled','manual','UNSIGNED'];(function(_0x2841d8,_0x32296e){var _0x4e2df3=function(_0x31003e){while(--_0x31003e){_0x2841d8['push'](_0x2841d8['shift']());}};_0x4e2df3(++_0x32296e);}(_0x1b4d,0x1ef));var _0xd1b4=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x1b4d[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd1b4('0x0'));module[_0xd1b4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xd1b4('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xd1b4('0x3'),_0xd1b4('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd1b4('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd1b4('0x5')]},'endDate':{'type':Sequelize[_0xd1b4('0x5')]},'status':{'type':Sequelize[_0xd1b4('0x2')],'defaultValue':_0xd1b4('0x6')},'type':{'type':Sequelize[_0xd1b4('0x7')]('manual',_0xd1b4('0x8')),'allowNull':![],'defaultValue':_0xd1b4('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xd1b4('0xa')]},'reportType':{'type':Sequelize[_0xd1b4('0x2')]}};
\ No newline at end of file
index 3fc143f..2ce4d5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f11=['update','body','download','basename','savename','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','output','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','key','model','keys','query','filters','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','AnalyticExtractedReport','rows','catch','show','params','intersection','fields','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x4f11,0x1d7));var _0x14f1=function(_0x16d673,_0x115d95){_0x16d673=_0x16d673-0x0;var _0x1b3984=_0x4f11[_0x16d673];return _0x1b3984;};'use strict';var emlformat=require(_0x14f1('0x0'));var rimraf=require(_0x14f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14f1('0x2'));var rp=require(_0x14f1('0x3'));var moment=require('moment');var BPromise=require(_0x14f1('0x4'));var Mustache=require(_0x14f1('0x5'));var util=require(_0x14f1('0x6'));var path=require(_0x14f1('0x7'));var sox=require(_0x14f1('0x8'));var csv=require(_0x14f1('0x9'));var ejs=require(_0x14f1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14f1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x14f1('0xc'));var deskjs=require(_0x14f1('0xd'));var toCsv=require(_0x14f1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x14f1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14f1('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x14f1('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x388fef,_0x115613){_0x115613=_0x115613||0xcc;return function(_0x295fb3){if(_0x295fb3){return _0x388fef[_0x14f1('0x11')](_0x115613);}return _0x388fef[_0x14f1('0x12')](_0x115613)[_0x14f1('0x13')]();};}function respondWithResult(_0x47a5cb,_0x3aea06){_0x3aea06=_0x3aea06||0xc8;return function(_0x32b362){if(_0x32b362){return _0x47a5cb['status'](_0x3aea06)[_0x14f1('0x14')](_0x32b362);}};}function respondWithFilteredResult(_0x35a099,_0x2d7a30){return function(_0x59791f){if(_0x59791f){var _0x11cc8d=typeof _0x2d7a30[_0x14f1('0x15')]==='undefined'&&typeof _0x2d7a30[_0x14f1('0x16')]==='undefined';var _0x2d6d32=_0x59791f['count'];var _0x99f828=_0x11cc8d?0x0:_0x2d7a30['offset'];var _0x519b5c=_0x11cc8d?_0x59791f[_0x14f1('0x17')]:_0x2d7a30[_0x14f1('0x15')]+_0x2d7a30[_0x14f1('0x16')];var _0x30ccf6;if(_0x519b5c>=_0x2d6d32){_0x519b5c=_0x2d6d32;_0x30ccf6=0xc8;}else{_0x30ccf6=0xce;}_0x35a099[_0x14f1('0x12')](_0x30ccf6);return _0x35a099[_0x14f1('0x18')](_0x14f1('0x19'),_0x99f828+'-'+_0x519b5c+'/'+_0x2d6d32)[_0x14f1('0x14')](_0x59791f);}return null;};}function patchUpdates(_0x586728){return function(_0x540379){try{jsonpatch[_0x14f1('0x1a')](_0x540379,_0x586728,!![]);}catch(_0x14d82a){return BPromise[_0x14f1('0x1b')](_0x14d82a);}return _0x540379[_0x14f1('0x1c')]();};}function saveUpdates(_0x555bca,_0x19dc34){return function(_0xf436e0){if(_0xf436e0){return _0xf436e0['update'](_0x555bca)[_0x14f1('0x1d')](function(_0xe45771){return _0xe45771;});}return null;};}function removeEntity(_0x3691f6,_0x35cae2){return function(_0x3b4b37){if(_0x3b4b37){return _0x3b4b37[_0x14f1('0x1e')]()[_0x14f1('0x1d')](function(){var _0x5a5c06=_0x3b4b37[_0x14f1('0x1f')]({'plain':!![]});var _0x45cbdf=_0x14f1('0x20');return db[_0x14f1('0x21')][_0x14f1('0x1e')]({'where':{'type':_0x45cbdf,'resourceId':_0x5a5c06['id']}})[_0x14f1('0x1d')](function(){return _0x3b4b37;});})[_0x14f1('0x1d')](function(){_0x3691f6[_0x14f1('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0e3b,_0x205b36){return function(_0x39083c){if(!_0x39083c){_0x5d0e3b[_0x14f1('0x11')](0x194);}return _0x39083c;};}function handleError(_0x410987,_0x56f0fe){_0x56f0fe=_0x56f0fe||0x1f4;return function(_0x473fbe){logger[_0x14f1('0x22')](_0x473fbe[_0x14f1('0x23')]);if(_0x473fbe['name']){delete _0x473fbe[_0x14f1('0x24')];}_0x410987[_0x14f1('0x12')](_0x56f0fe)['send'](_0x473fbe);};}exports[_0x14f1('0x25')]=function(_0x4612b6,_0x58d69f){var _0x22a2d7={},_0x3f0ad8={},_0x1995b7={'count':0x0,'rows':[]};var _0x363c0d=_['map'](db['AnalyticExtractedReport'][_0x14f1('0x26')],function(_0x3ee402){return{'name':_0x3ee402[_0x14f1('0x27')],'type':_0x3ee402['type'][_0x14f1('0x28')]};});_0x3f0ad8[_0x14f1('0x29')]=_['map'](_0x363c0d,_0x14f1('0x24'));_0x3f0ad8['query']=_[_0x14f1('0x2a')](_0x4612b6[_0x14f1('0x2b')]);_0x3f0ad8[_0x14f1('0x2c')]=_['intersection'](_0x3f0ad8[_0x14f1('0x29')],_0x3f0ad8[_0x14f1('0x2b')]);_0x22a2d7[_0x14f1('0x2d')]=_['intersection'](_0x3f0ad8[_0x14f1('0x29')],qs['fields'](_0x4612b6[_0x14f1('0x2b')]['fields']));_0x22a2d7[_0x14f1('0x2d')]=_0x22a2d7[_0x14f1('0x2d')]['length']?_0x22a2d7[_0x14f1('0x2d')]:_0x3f0ad8[_0x14f1('0x29')];if(!_0x4612b6[_0x14f1('0x2b')][_0x14f1('0x2e')](_0x14f1('0x2f'))){_0x22a2d7[_0x14f1('0x16')]=qs['limit'](_0x4612b6[_0x14f1('0x2b')]['limit']);_0x22a2d7[_0x14f1('0x15')]=qs['offset'](_0x4612b6['query'][_0x14f1('0x15')]);}_0x22a2d7[_0x14f1('0x30')]=qs[_0x14f1('0x31')](_0x4612b6['query'][_0x14f1('0x31')]);_0x22a2d7[_0x14f1('0x32')]=qs[_0x14f1('0x2c')](_[_0x14f1('0x33')](_0x4612b6['query'],_0x3f0ad8[_0x14f1('0x2c')]),_0x363c0d);if(_0x4612b6[_0x14f1('0x2b')][_0x14f1('0x34')]){_0x22a2d7[_0x14f1('0x32')]=_['merge'](_0x22a2d7[_0x14f1('0x32')],{'$or':_['map'](_0x363c0d,function(_0x21086b){if(_0x21086b[_0x14f1('0x35')]!==_0x14f1('0x36')){var _0x3a4df3={};_0x3a4df3[_0x21086b['name']]={'$like':'%'+_0x4612b6[_0x14f1('0x2b')][_0x14f1('0x34')]+'%'};return _0x3a4df3;}})});}_0x22a2d7=_['merge']({},_0x22a2d7,_0x4612b6[_0x14f1('0x37')]);var _0x3258f6={'where':_0x22a2d7[_0x14f1('0x32')]};return db['AnalyticExtractedReport'][_0x14f1('0x17')](_0x3258f6)[_0x14f1('0x1d')](function(_0x251019){_0x1995b7[_0x14f1('0x17')]=_0x251019;if(_0x4612b6[_0x14f1('0x2b')][_0x14f1('0x38')]){_0x22a2d7[_0x14f1('0x39')]=[{'all':!![]}];}return db[_0x14f1('0x3a')]['findAll'](_0x22a2d7);})[_0x14f1('0x1d')](function(_0x3242a7){_0x1995b7[_0x14f1('0x3b')]=_0x3242a7;return _0x1995b7;})['then'](respondWithFilteredResult(_0x58d69f,_0x22a2d7))[_0x14f1('0x3c')](handleError(_0x58d69f,null));};exports[_0x14f1('0x3d')]=function(_0x2e8768,_0x31ebbd){var _0x4eaf7b={'raw':!![],'where':{'id':_0x2e8768[_0x14f1('0x3e')]['id']}},_0x5571e7={};_0x5571e7[_0x14f1('0x29')]=_[_0x14f1('0x2a')](db['AnalyticExtractedReport'][_0x14f1('0x26')]);_0x5571e7[_0x14f1('0x2b')]=_[_0x14f1('0x2a')](_0x2e8768['query']);_0x5571e7[_0x14f1('0x2c')]=_[_0x14f1('0x3f')](_0x5571e7[_0x14f1('0x29')],_0x5571e7[_0x14f1('0x2b')]);_0x4eaf7b[_0x14f1('0x2d')]=_['intersection'](_0x5571e7[_0x14f1('0x29')],qs[_0x14f1('0x40')](_0x2e8768[_0x14f1('0x2b')]['fields']));_0x4eaf7b['attributes']=_0x4eaf7b[_0x14f1('0x2d')]['length']?_0x4eaf7b[_0x14f1('0x2d')]:_0x5571e7['model'];if(_0x2e8768['query'][_0x14f1('0x38')]){_0x4eaf7b[_0x14f1('0x39')]=[{'all':!![]}];}_0x4eaf7b=_[_0x14f1('0x41')]({},_0x4eaf7b,_0x2e8768[_0x14f1('0x37')]);return db[_0x14f1('0x3a')][_0x14f1('0x42')](_0x4eaf7b)[_0x14f1('0x1d')](handleEntityNotFound(_0x31ebbd,null))[_0x14f1('0x1d')](respondWithResult(_0x31ebbd,null))[_0x14f1('0x3c')](handleError(_0x31ebbd,null));};exports[_0x14f1('0x43')]=function(_0x2c4fec,_0x16ec2e){return db[_0x14f1('0x3a')][_0x14f1('0x43')](_0x2c4fec['body'],{})[_0x14f1('0x1d')](function(_0x3e04f8){var _0x2e1fe7=_0x2c4fec[_0x14f1('0x44')][_0x14f1('0x1f')]({'plain':!![]});if(!_0x2e1fe7)throw new Error(_0x14f1('0x45'));if(_0x2e1fe7[_0x14f1('0x46')]===_0x14f1('0x44')){var _0x5ed798=_0x3e04f8[_0x14f1('0x1f')]({'plain':!![]});var _0x41858e='ExtractedReports';return db[_0x14f1('0x47')][_0x14f1('0x42')]({'where':{'name':_0x41858e,'userProfileId':_0x2e1fe7[_0x14f1('0x48')]},'raw':!![]})['then'](function(_0x382752){if(_0x382752&&_0x382752[_0x14f1('0x49')]===0x0){return db[_0x14f1('0x21')][_0x14f1('0x43')]({'name':_0x5ed798[_0x14f1('0x24')],'resourceId':_0x5ed798['id'],'type':_0x382752['name'],'sectionId':_0x382752['id']},{})['then'](function(){return _0x3e04f8;});}else{return _0x3e04f8;}})[_0x14f1('0x3c')](function(_0x4df40c){logger[_0x14f1('0x22')](_0x14f1('0x4a'),_0x4df40c);throw _0x4df40c;});}return _0x3e04f8;})[_0x14f1('0x1d')](respondWithResult(_0x16ec2e,0xc9))[_0x14f1('0x3c')](handleError(_0x16ec2e,null));};exports[_0x14f1('0x4b')]=function(_0x24e8a7,_0x522d53){if(_0x24e8a7[_0x14f1('0x4c')]['id']){delete _0x24e8a7[_0x14f1('0x4c')]['id'];}return db[_0x14f1('0x3a')][_0x14f1('0x42')]({'where':{'id':_0x24e8a7[_0x14f1('0x3e')]['id']}})[_0x14f1('0x1d')](handleEntityNotFound(_0x522d53,null))[_0x14f1('0x1d')](saveUpdates(_0x24e8a7[_0x14f1('0x4c')],null))[_0x14f1('0x1d')](respondWithResult(_0x522d53,null))[_0x14f1('0x3c')](handleError(_0x522d53,null));};exports[_0x14f1('0x1e')]=function(_0x4ddf25,_0x1186dc){return db[_0x14f1('0x3a')][_0x14f1('0x42')]({'where':{'id':_0x4ddf25[_0x14f1('0x3e')]['id']}})[_0x14f1('0x1d')](handleEntityNotFound(_0x1186dc,null))[_0x14f1('0x1d')](removeEntity(_0x1186dc,null))[_0x14f1('0x3c')](handleError(_0x1186dc,null));};exports[_0x14f1('0x4d')]=function(_0x516b4e,_0x1f7807,_0x3fc09c){return db['AnalyticExtractedReport'][_0x14f1('0x42')]({'where':{'id':_0x516b4e[_0x14f1('0x3e')]['id']},'attributes':[_0x14f1('0x24'),_0x14f1('0x4e'),_0x14f1('0x4f'),'output'],'raw':!![]})[_0x14f1('0x1d')](handleEntityNotFound(_0x1f7807,null))[_0x14f1('0x1d')](function(_0x4f9cd1){if(_0x4f9cd1){if(!fs[_0x14f1('0x50')](path[_0x14f1('0x51')](config['root'],_0x14f1('0x52'),_0x4f9cd1['savename']))){throw new db['Sequelize'][(_0x14f1('0x53'))](_0x14f1('0x54'));}if(_0x516b4e[_0x14f1('0x2b')][_0x14f1('0x55')]){return _0x1f7807[_0x14f1('0x11')](0xc8);}return _0x1f7807[_0x14f1('0x4d')](path[_0x14f1('0x51')](config[_0x14f1('0x56')],_0x14f1('0x52'),_0x4f9cd1['savename']),util[_0x14f1('0x57')](_0x14f1('0x58'),_0x4f9cd1[_0x14f1('0x4e')]||_0x4f9cd1['name'],_0x4f9cd1[_0x14f1('0x59')][_0x14f1('0x5a')]()));}})['catch'](handleError(_0x1f7807,null));};
\ No newline at end of file
+var _0x016a=['keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','length','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','output','existsSync','join','root','server/files/reports','Sequelize','exists','download','savename','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','reject','update','then','get','ExtractedReports','UserProfileResource','error','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query'];(function(_0x2f599f,_0x111228){var _0x42efc6=function(_0x573b99){while(--_0x573b99){_0x2f599f['push'](_0x2f599f['shift']());}};_0x42efc6(++_0x111228);}(_0x016a,0xee));var _0xa016=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x016a[_0x373dee];return _0x46798f;};'use strict';var emlformat=require(_0xa016('0x0'));var rimraf=require(_0xa016('0x1'));var zipdir=require(_0xa016('0x2'));var jsonpatch=require(_0xa016('0x3'));var rp=require(_0xa016('0x4'));var moment=require(_0xa016('0x5'));var BPromise=require(_0xa016('0x6'));var Mustache=require(_0xa016('0x7'));var util=require(_0xa016('0x8'));var path=require(_0xa016('0x9'));var sox=require(_0xa016('0xa'));var csv=require(_0xa016('0xb'));var ejs=require(_0xa016('0xc'));var fs=require('fs');var fs_extra=require(_0xa016('0xd'));var _=require(_0xa016('0xe'));var squel=require(_0xa016('0xf'));var crypto=require(_0xa016('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xa016('0x11'));var toCsv=require(_0xa016('0xb'));var querystring=require(_0xa016('0x12'));var Papa=require(_0xa016('0x13'));var Redis=require(_0xa016('0x14'));var authService=require(_0xa016('0x15'));var qs=require(_0xa016('0x16'));var as=require(_0xa016('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa016('0x18'))(_0xa016('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa016('0x1a'));var db=require(_0xa016('0x1b'))['db'];function respondWithStatusCode(_0x53512f,_0x1ce96c){_0x1ce96c=_0x1ce96c||0xcc;return function(_0x56836d){if(_0x56836d){return _0x53512f[_0xa016('0x1c')](_0x1ce96c);}return _0x53512f[_0xa016('0x1d')](_0x1ce96c)[_0xa016('0x1e')]();};}function respondWithResult(_0x232cd4,_0x3567b4){_0x3567b4=_0x3567b4||0xc8;return function(_0x5b0d11){if(_0x5b0d11){return _0x232cd4['status'](_0x3567b4)[_0xa016('0x1f')](_0x5b0d11);}};}function respondWithFilteredResult(_0x18361e,_0x5ceb21){return function(_0x4c6187){if(_0x4c6187){var _0x450f4d=typeof _0x5ceb21['offset']===_0xa016('0x20')&&typeof _0x5ceb21[_0xa016('0x21')]===_0xa016('0x20');var _0x40a7d2=_0x4c6187['count'];var _0x303b9a=_0x450f4d?0x0:_0x5ceb21[_0xa016('0x22')];var _0x3c8bd7=_0x450f4d?_0x4c6187['count']:_0x5ceb21[_0xa016('0x22')]+_0x5ceb21[_0xa016('0x21')];var _0x2ad233;if(_0x3c8bd7>=_0x40a7d2){_0x3c8bd7=_0x40a7d2;_0x2ad233=0xc8;}else{_0x2ad233=0xce;}_0x18361e[_0xa016('0x1d')](_0x2ad233);return _0x18361e[_0xa016('0x23')](_0xa016('0x24'),_0x303b9a+'-'+_0x3c8bd7+'/'+_0x40a7d2)[_0xa016('0x1f')](_0x4c6187);}return null;};}function patchUpdates(_0x1c1286){return function(_0x577a85){try{jsonpatch['apply'](_0x577a85,_0x1c1286,!![]);}catch(_0x5381ef){return BPromise[_0xa016('0x25')](_0x5381ef);}return _0x577a85['save']();};}function saveUpdates(_0x5a1093,_0x427652){return function(_0x3002bb){if(_0x3002bb){return _0x3002bb[_0xa016('0x26')](_0x5a1093)[_0xa016('0x27')](function(_0x1d610b){return _0x1d610b;});}return null;};}function removeEntity(_0x2da0d8,_0xcebaea){return function(_0x2a2971){if(_0x2a2971){return _0x2a2971['destroy']()['then'](function(){var _0xf1309=_0x2a2971[_0xa016('0x28')]({'plain':!![]});var _0x444bdf=_0xa016('0x29');return db[_0xa016('0x2a')]['destroy']({'where':{'type':_0x444bdf,'resourceId':_0xf1309['id']}})[_0xa016('0x27')](function(){return _0x2a2971;});})[_0xa016('0x27')](function(){_0x2da0d8[_0xa016('0x1d')](0xcc)[_0xa016('0x1e')]();});}};}function handleEntityNotFound(_0x15d297,_0x2da888){return function(_0x185732){if(!_0x185732){_0x15d297[_0xa016('0x1c')](0x194);}return _0x185732;};}function handleError(_0xe9bd65,_0x3e2db7){_0x3e2db7=_0x3e2db7||0x1f4;return function(_0x6597a8){logger[_0xa016('0x2b')](_0x6597a8['stack']);if(_0x6597a8[_0xa016('0x2c')]){delete _0x6597a8[_0xa016('0x2c')];}_0xe9bd65[_0xa016('0x1d')](_0x3e2db7)[_0xa016('0x2d')](_0x6597a8);};}exports['index']=function(_0x406da2,_0x7794fe){var _0x2e5b94={},_0xfcf6ad={},_0x16000a={'count':0x0,'rows':[]};var _0x498483=_[_0xa016('0x2e')](db[_0xa016('0x2f')][_0xa016('0x30')],function(_0x2c9e24){return{'name':_0x2c9e24[_0xa016('0x31')],'type':_0x2c9e24[_0xa016('0x32')][_0xa016('0x33')]};});_0xfcf6ad['model']=_[_0xa016('0x2e')](_0x498483,_0xa016('0x2c'));_0xfcf6ad[_0xa016('0x34')]=_[_0xa016('0x35')](_0x406da2[_0xa016('0x34')]);_0xfcf6ad['filters']=_['intersection'](_0xfcf6ad[_0xa016('0x36')],_0xfcf6ad[_0xa016('0x34')]);_0x2e5b94[_0xa016('0x37')]=_[_0xa016('0x38')](_0xfcf6ad['model'],qs[_0xa016('0x39')](_0x406da2['query'][_0xa016('0x39')]));_0x2e5b94[_0xa016('0x37')]=_0x2e5b94[_0xa016('0x37')]['length']?_0x2e5b94[_0xa016('0x37')]:_0xfcf6ad[_0xa016('0x36')];if(!_0x406da2[_0xa016('0x34')][_0xa016('0x3a')](_0xa016('0x3b'))){_0x2e5b94[_0xa016('0x21')]=qs[_0xa016('0x21')](_0x406da2[_0xa016('0x34')][_0xa016('0x21')]);_0x2e5b94['offset']=qs[_0xa016('0x22')](_0x406da2[_0xa016('0x34')][_0xa016('0x22')]);}_0x2e5b94['order']=qs['sort'](_0x406da2[_0xa016('0x34')]['sort']);_0x2e5b94[_0xa016('0x3c')]=qs[_0xa016('0x3d')](_[_0xa016('0x3e')](_0x406da2[_0xa016('0x34')],_0xfcf6ad[_0xa016('0x3d')]),_0x498483);if(_0x406da2[_0xa016('0x34')][_0xa016('0x3f')]){_0x2e5b94[_0xa016('0x3c')]=_[_0xa016('0x40')](_0x2e5b94['where'],{'$or':_[_0xa016('0x2e')](_0x498483,function(_0x2981d3){if(_0x2981d3[_0xa016('0x32')]!==_0xa016('0x41')){var _0x4d4ceb={};_0x4d4ceb[_0x2981d3['name']]={'$like':'%'+_0x406da2[_0xa016('0x34')]['filter']+'%'};return _0x4d4ceb;}})});}_0x2e5b94=_[_0xa016('0x40')]({},_0x2e5b94,_0x406da2[_0xa016('0x42')]);var _0x28f6dd={'where':_0x2e5b94[_0xa016('0x3c')]};return db[_0xa016('0x2f')]['count'](_0x28f6dd)['then'](function(_0x16cf10){_0x16000a[_0xa016('0x43')]=_0x16cf10;if(_0x406da2[_0xa016('0x34')][_0xa016('0x44')]){_0x2e5b94['include']=[{'all':!![]}];}return db[_0xa016('0x2f')]['findAll'](_0x2e5b94);})[_0xa016('0x27')](function(_0x11d64c){_0x16000a[_0xa016('0x45')]=_0x11d64c;return _0x16000a;})[_0xa016('0x27')](respondWithFilteredResult(_0x7794fe,_0x2e5b94))['catch'](handleError(_0x7794fe,null));};exports[_0xa016('0x46')]=function(_0x1d6fff,_0x5c3420){var _0x387277={'raw':!![],'where':{'id':_0x1d6fff[_0xa016('0x47')]['id']}},_0x256d68={};_0x256d68['model']=_['keys'](db[_0xa016('0x2f')][_0xa016('0x30')]);_0x256d68['query']=_[_0xa016('0x35')](_0x1d6fff['query']);_0x256d68['filters']=_[_0xa016('0x38')](_0x256d68['model'],_0x256d68[_0xa016('0x34')]);_0x387277[_0xa016('0x37')]=_[_0xa016('0x38')](_0x256d68[_0xa016('0x36')],qs[_0xa016('0x39')](_0x1d6fff[_0xa016('0x34')][_0xa016('0x39')]));_0x387277[_0xa016('0x37')]=_0x387277['attributes'][_0xa016('0x48')]?_0x387277[_0xa016('0x37')]:_0x256d68[_0xa016('0x36')];if(_0x1d6fff[_0xa016('0x34')][_0xa016('0x44')]){_0x387277[_0xa016('0x49')]=[{'all':!![]}];}_0x387277=_[_0xa016('0x40')]({},_0x387277,_0x1d6fff['options']);return db['AnalyticExtractedReport'][_0xa016('0x4a')](_0x387277)['then'](handleEntityNotFound(_0x5c3420,null))[_0xa016('0x27')](respondWithResult(_0x5c3420,null))[_0xa016('0x4b')](handleError(_0x5c3420,null));};exports[_0xa016('0x4c')]=function(_0x25e9fe,_0x18874d){return db[_0xa016('0x2f')]['create'](_0x25e9fe['body'],{})['then'](function(_0xfca099){var _0x157c30=_0x25e9fe[_0xa016('0x4d')]['get']({'plain':!![]});if(!_0x157c30)throw new Error(_0xa016('0x4e'));if(_0x157c30[_0xa016('0x4f')]===_0xa016('0x4d')){var _0x41b612=_0xfca099[_0xa016('0x28')]({'plain':!![]});var _0x247072=_0xa016('0x29');return db[_0xa016('0x50')][_0xa016('0x4a')]({'where':{'name':_0x247072,'userProfileId':_0x157c30[_0xa016('0x51')]},'raw':!![]})[_0xa016('0x27')](function(_0x5b12ba){if(_0x5b12ba&&_0x5b12ba[_0xa016('0x52')]===0x0){return db[_0xa016('0x2a')]['create']({'name':_0x41b612[_0xa016('0x2c')],'resourceId':_0x41b612['id'],'type':_0x5b12ba[_0xa016('0x2c')],'sectionId':_0x5b12ba['id']},{})['then'](function(){return _0xfca099;});}else{return _0xfca099;}})[_0xa016('0x4b')](function(_0x3fd966){logger[_0xa016('0x2b')](_0xa016('0x53'),_0x3fd966);throw _0x3fd966;});}return _0xfca099;})[_0xa016('0x27')](respondWithResult(_0x18874d,0xc9))[_0xa016('0x4b')](handleError(_0x18874d,null));};exports[_0xa016('0x26')]=function(_0xaf174f,_0x16ab90){if(_0xaf174f[_0xa016('0x54')]['id']){delete _0xaf174f[_0xa016('0x54')]['id'];}return db[_0xa016('0x2f')][_0xa016('0x4a')]({'where':{'id':_0xaf174f['params']['id']}})[_0xa016('0x27')](handleEntityNotFound(_0x16ab90,null))[_0xa016('0x27')](saveUpdates(_0xaf174f[_0xa016('0x54')],null))[_0xa016('0x27')](respondWithResult(_0x16ab90,null))[_0xa016('0x4b')](handleError(_0x16ab90,null));};exports['destroy']=function(_0xb0215a,_0x5bf83e){return db[_0xa016('0x2f')][_0xa016('0x4a')]({'where':{'id':_0xb0215a[_0xa016('0x47')]['id']}})[_0xa016('0x27')](handleEntityNotFound(_0x5bf83e,null))[_0xa016('0x27')](removeEntity(_0x5bf83e,null))[_0xa016('0x4b')](handleError(_0x5bf83e,null));};exports['download']=function(_0x15ffdf,_0x7826f8,_0x375a68){return db[_0xa016('0x2f')][_0xa016('0x4a')]({'where':{'id':_0x15ffdf[_0xa016('0x47')]['id']},'attributes':[_0xa016('0x2c'),_0xa016('0x55'),'savename',_0xa016('0x56')],'raw':!![]})[_0xa016('0x27')](handleEntityNotFound(_0x7826f8,null))[_0xa016('0x27')](function(_0x12ccf1){if(_0x12ccf1){if(!fs[_0xa016('0x57')](path[_0xa016('0x58')](config[_0xa016('0x59')],_0xa016('0x5a'),_0x12ccf1['savename']))){throw new db[(_0xa016('0x5b'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x15ffdf['query'][_0xa016('0x5c')]){return _0x7826f8[_0xa016('0x1c')](0xc8);}return _0x7826f8[_0xa016('0x5d')](path['join'](config[_0xa016('0x59')],_0xa016('0x5a'),_0x12ccf1[_0xa016('0x5e')]),util[_0xa016('0x5f')]('%s.%s',_0x12ccf1['basename']||_0x12ccf1['name'],_0x12ccf1[_0xa016('0x56')][_0xa016('0x60')]()));}})[_0xa016('0x4b')](handleError(_0x7826f8,null));};
\ No newline at end of file
index 748731d..db045b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5be0=['path','rimraf','../../config/environment','define','AnalyticExtractedReport','lodash','util','api','moment','bluebird','request-promise'];(function(_0x34d823,_0x2d20b0){var _0x1eb90c=function(_0x43eda6){while(--_0x43eda6){_0x34d823['push'](_0x34d823['shift']());}};_0x1eb90c(++_0x2d20b0);}(_0x5be0,0x15a));var _0x05be=function(_0x2917c2,_0x5732d9){_0x2917c2=_0x2917c2-0x0;var _0x2e7448=_0x5be0[_0x2917c2];return _0x2e7448;};'use strict';var _=require(_0x05be('0x0'));var util=require(_0x05be('0x1'));var logger=require('../../config/logger')(_0x05be('0x2'));var moment=require(_0x05be('0x3'));var BPromise=require(_0x05be('0x4'));var rp=require(_0x05be('0x5'));var fs=require('fs');var path=require(_0x05be('0x6'));var rimraf=require(_0x05be('0x7'));var config=require(_0x05be('0x8'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x589fb1,_0x2d3763){return _0x589fb1[_0x05be('0x9')](_0x05be('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa121=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','define','AnalyticExtractedReport'];(function(_0x2621e7,_0x3323f0){var _0x216828=function(_0x581cb3){while(--_0x581cb3){_0x2621e7['push'](_0x2621e7['shift']());}};_0x216828(++_0x3323f0);}(_0xa121,0xc9));var _0x1a12=function(_0x53f940,_0x1e4088){_0x53f940=_0x53f940-0x0;var _0x365769=_0xa121[_0x53f940];return _0x365769;};'use strict';var _=require(_0x1a12('0x0'));var util=require(_0x1a12('0x1'));var logger=require(_0x1a12('0x2'))('api');var moment=require(_0x1a12('0x3'));var BPromise=require(_0x1a12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a12('0x5'));var rimraf=require(_0x1a12('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x5cc6f4,_0x2b6777){return _0x5cc6f4[_0x1a12('0x7')](_0x1a12('0x8'),attributes,{'tableName':_0x1a12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6d05ecc..83c70c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a0c=['http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2273c9,_0x5262f6){var _0x80c2c4=function(_0x42308c){while(--_0x42308c){_0x2273c9['push'](_0x2273c9['shift']());}};_0x80c2c4(++_0x5262f6);}(_0x9a0c,0x8b));var _0xc9a0=function(_0x131261,_0xbd871a){_0x131261=_0x131261-0x0;var _0x58433c=_0x9a0c[_0x131261];return _0x58433c;};'use strict';var _=require('lodash');var util=require(_0xc9a0('0x0'));var moment=require(_0xc9a0('0x1'));var BPromise=require(_0xc9a0('0x2'));var rs=require(_0xc9a0('0x3'));var fs=require('fs');var Redis=require(_0xc9a0('0x4'));var db=require(_0xc9a0('0x5'))['db'];var utils=require(_0xc9a0('0x6'));var logger=require(_0xc9a0('0x7'))(_0xc9a0('0x8'));var config=require(_0xc9a0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc9a0('0xa')][_0xc9a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb6e094,_0x5d26d8,_0x33f345){return new BPromise(function(_0x16a48b,_0xaf35e9){return client[_0xc9a0('0xc')](_0xb6e094,_0x33f345)[_0xc9a0('0xd')](function(_0x37534c){logger[_0xc9a0('0xe')](_0xc9a0('0xf'),_0x5d26d8,_0xc9a0('0x10'));logger[_0xc9a0('0x11')](_0xc9a0('0x12'),_0x5d26d8,_0xc9a0('0x10'),JSON[_0xc9a0('0x13')](_0x37534c));if(_0x37534c[_0xc9a0('0x14')]){if(_0x37534c[_0xc9a0('0x14')][_0xc9a0('0x15')]===0x1f4){logger[_0xc9a0('0x14')](_0xc9a0('0xf'),_0x5d26d8,_0x37534c[_0xc9a0('0x14')][_0xc9a0('0x16')]);return _0xaf35e9(_0x37534c[_0xc9a0('0x14')][_0xc9a0('0x16')]);}logger[_0xc9a0('0x14')](_0xc9a0('0xf'),_0x5d26d8,_0x37534c[_0xc9a0('0x14')][_0xc9a0('0x16')]);return _0x16a48b(_0x37534c[_0xc9a0('0x14')]['message']);}else{logger[_0xc9a0('0xe')](_0xc9a0('0xf'),_0x5d26d8,_0xc9a0('0x10'));_0x16a48b(_0x37534c[_0xc9a0('0x17')]['message']);}})[_0xc9a0('0x18')](function(_0x3d6122){logger['error'](_0xc9a0('0xf'),_0x5d26d8,_0x3d6122);_0xaf35e9(_0x3d6122);});});}
\ No newline at end of file
+var _0xa1ab=['message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x2cade4,_0x4bf38f){var _0x5bafa8=function(_0x59edd4){while(--_0x59edd4){_0x2cade4['push'](_0x2cade4['shift']());}};_0x5bafa8(++_0x4bf38f);}(_0xa1ab,0x1a1));var _0xba1a=function(_0x1e3a63,_0x154185){_0x1e3a63=_0x1e3a63-0x0;var _0x4a7209=_0xa1ab[_0x1e3a63];return _0x4a7209;};'use strict';var _=require('lodash');var util=require(_0xba1a('0x0'));var moment=require(_0xba1a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba1a('0x2'));var db=require(_0xba1a('0x3'))['db'];var utils=require(_0xba1a('0x4'));var logger=require(_0xba1a('0x5'))(_0xba1a('0x6'));var config=require(_0xba1a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba1a('0x8')][_0xba1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19b3bc,_0x35ba1f,_0x40e1fa){return new BPromise(function(_0x1a2cd3,_0x3384b8){return client[_0xba1a('0xa')](_0x19b3bc,_0x40e1fa)[_0xba1a('0xb')](function(_0x213554){logger[_0xba1a('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35ba1f,_0xba1a('0xd'));logger[_0xba1a('0xe')](_0xba1a('0xf'),_0x35ba1f,_0xba1a('0xd'),JSON[_0xba1a('0x10')](_0x213554));if(_0x213554['error']){if(_0x213554[_0xba1a('0x11')][_0xba1a('0x12')]===0x1f4){logger[_0xba1a('0x11')](_0xba1a('0x13'),_0x35ba1f,_0x213554[_0xba1a('0x11')][_0xba1a('0x14')]);return _0x3384b8(_0x213554[_0xba1a('0x11')][_0xba1a('0x14')]);}logger[_0xba1a('0x11')](_0xba1a('0x13'),_0x35ba1f,_0x213554['error'][_0xba1a('0x14')]);return _0x1a2cd3(_0x213554[_0xba1a('0x11')][_0xba1a('0x14')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x35ba1f,'request\x20sent');_0x1a2cd3(_0x213554[_0xba1a('0x15')][_0xba1a('0x14')]);}})[_0xba1a('0x16')](function(_0x13cd4e){logger[_0xba1a('0x11')](_0xba1a('0x13'),_0x35ba1f,_0x13cd4e);_0x3384b8(_0x13cd4e);});});}
\ No newline at end of file
index 5b99618..d297b4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa951=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','put','update','delete','destroy'];(function(_0x588eba,_0x3b1f4e){var _0x157625=function(_0xc37713){while(--_0xc37713){_0x588eba['push'](_0x588eba['shift']());}};_0x157625(++_0x3b1f4e);}(_0xa951,0xf1));var _0x1a95=function(_0x337942,_0x28e1c3){_0x337942=_0x337942-0x0;var _0x398aea=_0xa951[_0x337942];return _0x398aea;};'use strict';var multer=require(_0x1a95('0x0'));var util=require(_0x1a95('0x1'));var path=require('path');var timeout=require(_0x1a95('0x2'));var express=require(_0x1a95('0x3'));var router=express['Router']();var fs_extra=require(_0x1a95('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1a95('0x5'));var config=require(_0x1a95('0x6'));var controller=require(_0x1a95('0x7'));router[_0x1a95('0x8')]('/',auth[_0x1a95('0x9')](),controller[_0x1a95('0xa')]);router[_0x1a95('0x8')](_0x1a95('0xb'),auth[_0x1a95('0x9')](),controller[_0x1a95('0xc')]);router['get'](_0x1a95('0xd'),auth[_0x1a95('0x9')](),controller['download']);router[_0x1a95('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1a95('0xf')]('/:id',auth[_0x1a95('0x9')](),controller[_0x1a95('0x10')]);router[_0x1a95('0x11')](_0x1a95('0xb'),auth['isAuthenticated'](),controller[_0x1a95('0x12')]);module[_0x1a95('0x13')]=router;
\ No newline at end of file
+var _0x77d4=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','/:id','/:id/download','download','post','create','put','update','delete'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x77d4,0x152));var _0x477d=function(_0x5dca60,_0x2b2eeb){_0x5dca60=_0x5dca60-0x0;var _0xb2e3a9=_0x77d4[_0x5dca60];return _0xb2e3a9;};'use strict';var multer=require(_0x477d('0x0'));var util=require('util');var path=require(_0x477d('0x1'));var timeout=require('connect-timeout');var express=require(_0x477d('0x2'));var router=express[_0x477d('0x3')]();var fs_extra=require(_0x477d('0x4'));var auth=require(_0x477d('0x5'));var interaction=require(_0x477d('0x6'));var config=require(_0x477d('0x7'));var controller=require(_0x477d('0x8'));router['get']('/',auth[_0x477d('0x9')](),controller['index']);router[_0x477d('0xa')](_0x477d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x477d('0xa')](_0x477d('0xc'),auth[_0x477d('0x9')](),controller[_0x477d('0xd')]);router[_0x477d('0xe')]('/',auth['isAuthenticated'](),controller[_0x477d('0xf')]);router[_0x477d('0x10')](_0x477d('0xb'),auth[_0x477d('0x9')](),controller[_0x477d('0x11')]);router[_0x477d('0x12')](_0x477d('0xb'),auth['isAuthenticated'](),controller[_0x477d('0x13')]);module[_0x477d('0x14')]=router;
\ No newline at end of file
index 1948754..9e4fba8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f0d=['STRING','BOOLEAN','sequelize'];(function(_0xf22003,_0x4daaad){var _0x1af727=function(_0x99db67){while(--_0x99db67){_0xf22003['push'](_0xf22003['shift']());}};_0x1af727(++_0x4daaad);}(_0x6f0d,0x1a3));var _0xd6f0=function(_0x46eb67,_0x539066){_0x46eb67=_0x46eb67-0x0;var _0x10b133=_0x6f0d[_0x46eb67];return _0x10b133;};'use strict';var Sequelize=require(_0xd6f0('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xd6f0('0x1')]},'format':{'type':Sequelize[_0xd6f0('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd6f0('0x1')]},'custom':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8d12=['exports','TEXT','STRING','BOOLEAN'];(function(_0x598b78,_0xf4ee7e){var _0x6392fa=function(_0x810353){while(--_0x810353){_0x598b78['push'](_0x598b78['shift']());}};_0x6392fa(++_0xf4ee7e);}(_0x8d12,0x70));var _0x28d1=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8d12[_0x20c9b2];return _0x2c6030;};'use strict';var Sequelize=require('sequelize');module[_0x28d1('0x0')]={'field':{'type':Sequelize[_0x28d1('0x1')]},'alias':{'type':Sequelize[_0x28d1('0x2')]},'function':{'type':Sequelize[_0x28d1('0x2')]},'format':{'type':Sequelize[_0x28d1('0x2')]},'groupBy':{'type':Sequelize[_0x28d1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 8e26b3c..7510168 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce92=['order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','AnalyticFieldReport','rawAttributes','type','model','query','intersection','attributes','fields','length'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xce92,0x1e8));var _0x2ce9=function(_0x2145c0,_0x549319){_0x2145c0=_0x2145c0-0x0;var _0x4c613a=_0xce92[_0x2145c0];return _0x4c613a;};'use strict';var emlformat=require(_0x2ce9('0x0'));var rimraf=require(_0x2ce9('0x1'));var zipdir=require(_0x2ce9('0x2'));var jsonpatch=require(_0x2ce9('0x3'));var rp=require(_0x2ce9('0x4'));var moment=require(_0x2ce9('0x5'));var BPromise=require(_0x2ce9('0x6'));var Mustache=require(_0x2ce9('0x7'));var util=require(_0x2ce9('0x8'));var path=require('path');var sox=require(_0x2ce9('0x9'));var csv=require(_0x2ce9('0xa'));var ejs=require(_0x2ce9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ce9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2ce9('0xd'));var deskjs=require(_0x2ce9('0xe'));var toCsv=require(_0x2ce9('0xa'));var querystring=require('querystring');var Papa=require(_0x2ce9('0xf'));var Redis=require('ioredis');var authService=require(_0x2ce9('0x10'));var qs=require(_0x2ce9('0x11'));var as=require(_0x2ce9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ce9('0x13'))(_0x2ce9('0x14'));var utils=require(_0x2ce9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2ce9('0x16'))['db'];function respondWithStatusCode(_0x16cbd0,_0x3a9fbb){_0x3a9fbb=_0x3a9fbb||0xcc;return function(_0x16ebfa){if(_0x16ebfa){return _0x16cbd0['sendStatus'](_0x3a9fbb);}return _0x16cbd0[_0x2ce9('0x17')](_0x3a9fbb)[_0x2ce9('0x18')]();};}function respondWithResult(_0x517bac,_0x4aaea8){_0x4aaea8=_0x4aaea8||0xc8;return function(_0x10c9e5){if(_0x10c9e5){return _0x517bac[_0x2ce9('0x17')](_0x4aaea8)[_0x2ce9('0x19')](_0x10c9e5);}};}function respondWithFilteredResult(_0x26ccd9,_0x3cb913){return function(_0x4a28fc){if(_0x4a28fc){var _0x2c2788=typeof _0x3cb913[_0x2ce9('0x1a')]===_0x2ce9('0x1b')&&typeof _0x3cb913['limit']==='undefined';var _0x15171d=_0x4a28fc[_0x2ce9('0x1c')];var _0x56978c=_0x2c2788?0x0:_0x3cb913['offset'];var _0x273069=_0x2c2788?_0x4a28fc[_0x2ce9('0x1c')]:_0x3cb913[_0x2ce9('0x1a')]+_0x3cb913[_0x2ce9('0x1d')];var _0x379c57;if(_0x273069>=_0x15171d){_0x273069=_0x15171d;_0x379c57=0xc8;}else{_0x379c57=0xce;}_0x26ccd9[_0x2ce9('0x17')](_0x379c57);return _0x26ccd9['set'](_0x2ce9('0x1e'),_0x56978c+'-'+_0x273069+'/'+_0x15171d)[_0x2ce9('0x19')](_0x4a28fc);}return null;};}function patchUpdates(_0x4a7f7a){return function(_0x48690c){try{jsonpatch[_0x2ce9('0x1f')](_0x48690c,_0x4a7f7a,!![]);}catch(_0x1718dc){return BPromise[_0x2ce9('0x20')](_0x1718dc);}return _0x48690c[_0x2ce9('0x21')]();};}function saveUpdates(_0x413570,_0x2fc8ca){return function(_0x3b3806){if(_0x3b3806){return _0x3b3806[_0x2ce9('0x22')](_0x413570)[_0x2ce9('0x23')](function(_0xc61832){return _0xc61832;});}return null;};}function removeEntity(_0x1f5d07,_0xe697bb){return function(_0x467cab){if(_0x467cab){return _0x467cab[_0x2ce9('0x24')]()[_0x2ce9('0x23')](function(){_0x1f5d07[_0x2ce9('0x17')](0xcc)[_0x2ce9('0x18')]();});}};}function handleEntityNotFound(_0x309743,_0x52a608){return function(_0x27f360){if(!_0x27f360){_0x309743[_0x2ce9('0x25')](0x194);}return _0x27f360;};}function handleError(_0xf54c1e,_0x5d3407){_0x5d3407=_0x5d3407||0x1f4;return function(_0x557c16){logger[_0x2ce9('0x26')](_0x557c16['stack']);if(_0x557c16['name']){delete _0x557c16[_0x2ce9('0x27')];}_0xf54c1e['status'](_0x5d3407)['send'](_0x557c16);};}exports[_0x2ce9('0x28')]=function(_0x5f37c4,_0x412e8a){var _0x30c8a1={},_0x23d16a={},_0x301ac7={'count':0x0,'rows':[]};var _0x5835c4=_[_0x2ce9('0x29')](db[_0x2ce9('0x2a')][_0x2ce9('0x2b')],function(_0x4eac0a){return{'name':_0x4eac0a['fieldName'],'type':_0x4eac0a[_0x2ce9('0x2c')]['key']};});_0x23d16a[_0x2ce9('0x2d')]=_[_0x2ce9('0x29')](_0x5835c4,'name');_0x23d16a[_0x2ce9('0x2e')]=_['keys'](_0x5f37c4['query']);_0x23d16a['filters']=_[_0x2ce9('0x2f')](_0x23d16a[_0x2ce9('0x2d')],_0x23d16a[_0x2ce9('0x2e')]);_0x30c8a1[_0x2ce9('0x30')]=_[_0x2ce9('0x2f')](_0x23d16a[_0x2ce9('0x2d')],qs['fields'](_0x5f37c4[_0x2ce9('0x2e')][_0x2ce9('0x31')]));_0x30c8a1[_0x2ce9('0x30')]=_0x30c8a1['attributes'][_0x2ce9('0x32')]?_0x30c8a1[_0x2ce9('0x30')]:_0x23d16a[_0x2ce9('0x2d')];if(!_0x5f37c4['query']['hasOwnProperty']('nolimit')){_0x30c8a1[_0x2ce9('0x1d')]=qs[_0x2ce9('0x1d')](_0x5f37c4[_0x2ce9('0x2e')][_0x2ce9('0x1d')]);_0x30c8a1[_0x2ce9('0x1a')]=qs['offset'](_0x5f37c4[_0x2ce9('0x2e')][_0x2ce9('0x1a')]);}_0x30c8a1[_0x2ce9('0x33')]=qs['sort'](_0x5f37c4[_0x2ce9('0x2e')][_0x2ce9('0x34')]);_0x30c8a1[_0x2ce9('0x35')]=qs[_0x2ce9('0x36')](_[_0x2ce9('0x37')](_0x5f37c4[_0x2ce9('0x2e')],_0x23d16a[_0x2ce9('0x36')]),_0x5835c4);if(_0x5f37c4['query']['filter']){_0x30c8a1[_0x2ce9('0x35')]=_[_0x2ce9('0x38')](_0x30c8a1[_0x2ce9('0x35')],{'$or':_[_0x2ce9('0x29')](_0x5835c4,function(_0xcf5779){if(_0xcf5779[_0x2ce9('0x2c')]!==_0x2ce9('0x39')){var _0x944a7d={};_0x944a7d[_0xcf5779[_0x2ce9('0x27')]]={'$like':'%'+_0x5f37c4[_0x2ce9('0x2e')]['filter']+'%'};return _0x944a7d;}})});}_0x30c8a1=_[_0x2ce9('0x38')]({},_0x30c8a1,_0x5f37c4[_0x2ce9('0x3a')]);var _0x3040af={'where':_0x30c8a1['where']};return db[_0x2ce9('0x2a')]['count'](_0x3040af)['then'](function(_0x4a5b50){_0x301ac7[_0x2ce9('0x1c')]=_0x4a5b50;if(_0x5f37c4['query'][_0x2ce9('0x3b')]){_0x30c8a1[_0x2ce9('0x3c')]=[{'all':!![]}];}return db[_0x2ce9('0x2a')]['findAll'](_0x30c8a1);})[_0x2ce9('0x23')](function(_0x4bb941){_0x301ac7['rows']=_0x4bb941;return _0x301ac7;})[_0x2ce9('0x23')](respondWithFilteredResult(_0x412e8a,_0x30c8a1))[_0x2ce9('0x3d')](handleError(_0x412e8a,null));};exports[_0x2ce9('0x3e')]=function(_0x49f18e,_0x372f68){var _0x95258b={'raw':![],'where':{'id':_0x49f18e[_0x2ce9('0x3f')]['id']}},_0x5eaeb1={};_0x5eaeb1[_0x2ce9('0x2d')]=_[_0x2ce9('0x40')](db['AnalyticFieldReport']['rawAttributes']);_0x5eaeb1['query']=_[_0x2ce9('0x40')](_0x49f18e['query']);_0x5eaeb1[_0x2ce9('0x36')]=_['intersection'](_0x5eaeb1[_0x2ce9('0x2d')],_0x5eaeb1[_0x2ce9('0x2e')]);_0x95258b[_0x2ce9('0x30')]=_[_0x2ce9('0x2f')](_0x5eaeb1[_0x2ce9('0x2d')],qs[_0x2ce9('0x31')](_0x49f18e[_0x2ce9('0x2e')][_0x2ce9('0x31')]));_0x95258b[_0x2ce9('0x30')]=_0x95258b[_0x2ce9('0x30')][_0x2ce9('0x32')]?_0x95258b['attributes']:_0x5eaeb1[_0x2ce9('0x2d')];if(_0x49f18e[_0x2ce9('0x2e')][_0x2ce9('0x3b')]){_0x95258b['include']=[{'all':!![]}];}_0x95258b=_[_0x2ce9('0x38')]({},_0x95258b,_0x49f18e['options']);return db[_0x2ce9('0x2a')][_0x2ce9('0x41')](_0x95258b)[_0x2ce9('0x23')](handleEntityNotFound(_0x372f68,null))[_0x2ce9('0x23')](respondWithResult(_0x372f68,null))['catch'](handleError(_0x372f68,null));};exports[_0x2ce9('0x42')]=function(_0x47732b,_0x2d75c4){return db[_0x2ce9('0x2a')]['create'](_0x47732b['body'],{})[_0x2ce9('0x23')](respondWithResult(_0x2d75c4,0xc9))[_0x2ce9('0x3d')](handleError(_0x2d75c4,null));};exports[_0x2ce9('0x43')]=function(_0x59b969,_0x262071){return db['AnalyticFieldReport']['bulkCreate'](_0x59b969['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x262071,0xc9))[_0x2ce9('0x3d')](handleError(_0x262071,null));};exports[_0x2ce9('0x22')]=function(_0x5f0e0b,_0x3f9031){if(_0x5f0e0b[_0x2ce9('0x44')]['id']){delete _0x5f0e0b[_0x2ce9('0x44')]['id'];}return db[_0x2ce9('0x2a')][_0x2ce9('0x41')]({'where':{'id':_0x5f0e0b[_0x2ce9('0x3f')]['id']}})[_0x2ce9('0x23')](handleEntityNotFound(_0x3f9031,null))[_0x2ce9('0x23')](saveUpdates(_0x5f0e0b[_0x2ce9('0x44')],null))[_0x2ce9('0x23')](respondWithResult(_0x3f9031,null))[_0x2ce9('0x3d')](handleError(_0x3f9031,null));};exports[_0x2ce9('0x24')]=function(_0x3b757c,_0x1c4060){return db['AnalyticFieldReport'][_0x2ce9('0x41')]({'where':{'id':_0x3b757c[_0x2ce9('0x3f')]['id']}})[_0x2ce9('0x23')](handleEntityNotFound(_0x1c4060,null))['then'](removeEntity(_0x1c4060,null))[_0x2ce9('0x3d')](handleError(_0x1c4060,null));};exports[_0x2ce9('0x45')]=function(_0x21981b,_0x384eca){return db[_0x2ce9('0x2a')][_0x2ce9('0x24')]({'where':{'id':_0x21981b[_0x2ce9('0x2e')][_0x2ce9('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x2ce9('0x23')](respondWithResult(_0x384eca,0xcc))[_0x2ce9('0x3d')](handleError(_0x384eca,null));};exports[_0x2ce9('0x47')]=function(_0x45fcc9,_0x2fec49,_0x5406ca){return db[_0x2ce9('0x48')]['findOne']({'where':{'id':_0x45fcc9[_0x2ce9('0x3f')]['id']}})[_0x2ce9('0x23')](handleEntityNotFound(_0x2fec49,null))[_0x2ce9('0x23')](function(_0x49f303){if(_0x49f303){return db[_0x2ce9('0x49')][_0x2ce9('0x4a')](function(_0x34788c){return db[_0x2ce9('0x2a')][_0x2ce9('0x24')]({'where':{'CustomReportId':_0x45fcc9['params']['id']},'transaction':_0x34788c})[_0x2ce9('0x23')](function(_0x5dce53){var _0x685305=_[_0x2ce9('0x29')](_0x45fcc9[_0x2ce9('0x44')],function(_0x500647){delete _0x500647['id'];_0x500647[_0x2ce9('0x4b')]=_0x45fcc9[_0x2ce9('0x3f')]['id'];return _0x500647;});return db[_0x2ce9('0x2a')][_0x2ce9('0x43')](_0x685305,{'transaction':_0x34788c});});})[_0x2ce9('0x23')](function(){return db[_0x2ce9('0x2a')][_0x2ce9('0x4c')]({'where':{'CustomReportId':_0x45fcc9[_0x2ce9('0x3f')]['id']}});});}})[_0x2ce9('0x23')](respondWithResult(_0x2fec49,null))['catch'](handleError(_0x2fec49,null));};
\ No newline at end of file
+var _0x037b=['sox','lodash','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','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','bulkCreate','body','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path'];(function(_0x1f7330,_0x13e6c4){var _0x16ec2e=function(_0xa925b1){while(--_0xa925b1){_0x1f7330['push'](_0x1f7330['shift']());}};_0x16ec2e(++_0x13e6c4);}(_0x037b,0x19c));var _0xb037=function(_0x1d16e8,_0x14d94e){_0x1d16e8=_0x1d16e8-0x0;var _0x8d6085=_0x037b[_0x1d16e8];return _0x8d6085;};'use strict';var emlformat=require(_0xb037('0x0'));var rimraf=require(_0xb037('0x1'));var zipdir=require(_0xb037('0x2'));var jsonpatch=require(_0xb037('0x3'));var rp=require(_0xb037('0x4'));var moment=require(_0xb037('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb037('0x6'));var path=require(_0xb037('0x7'));var sox=require(_0xb037('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb037('0x9'));var squel=require(_0xb037('0xa'));var crypto=require(_0xb037('0xb'));var jsforce=require(_0xb037('0xc'));var deskjs=require(_0xb037('0xd'));var toCsv=require(_0xb037('0xe'));var querystring=require('querystring');var Papa=require(_0xb037('0xf'));var Redis=require(_0xb037('0x10'));var authService=require(_0xb037('0x11'));var qs=require(_0xb037('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb037('0x13'));var logger=require(_0xb037('0x14'))(_0xb037('0x15'));var utils=require('../../config/utils');var config=require(_0xb037('0x16'));var licenseUtil=require(_0xb037('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5287a5,_0x56b843){_0x56b843=_0x56b843||0xcc;return function(_0x3cd18a){if(_0x3cd18a){return _0x5287a5['sendStatus'](_0x56b843);}return _0x5287a5[_0xb037('0x18')](_0x56b843)[_0xb037('0x19')]();};}function respondWithResult(_0x594534,_0xcf9645){_0xcf9645=_0xcf9645||0xc8;return function(_0x2fa2e6){if(_0x2fa2e6){return _0x594534[_0xb037('0x18')](_0xcf9645)[_0xb037('0x1a')](_0x2fa2e6);}};}function respondWithFilteredResult(_0x3757fa,_0x414ba0){return function(_0x24cc65){if(_0x24cc65){var _0x18005b=typeof _0x414ba0[_0xb037('0x1b')]===_0xb037('0x1c')&&typeof _0x414ba0[_0xb037('0x1d')]===_0xb037('0x1c');var _0x281b56=_0x24cc65[_0xb037('0x1e')];var _0x1b9dd5=_0x18005b?0x0:_0x414ba0[_0xb037('0x1b')];var _0x46695e=_0x18005b?_0x24cc65[_0xb037('0x1e')]:_0x414ba0[_0xb037('0x1b')]+_0x414ba0[_0xb037('0x1d')];var _0x1129b3;if(_0x46695e>=_0x281b56){_0x46695e=_0x281b56;_0x1129b3=0xc8;}else{_0x1129b3=0xce;}_0x3757fa['status'](_0x1129b3);return _0x3757fa['set'](_0xb037('0x1f'),_0x1b9dd5+'-'+_0x46695e+'/'+_0x281b56)['json'](_0x24cc65);}return null;};}function patchUpdates(_0xc0e6ab){return function(_0x1ae27c){try{jsonpatch[_0xb037('0x20')](_0x1ae27c,_0xc0e6ab,!![]);}catch(_0x5a686c){return BPromise[_0xb037('0x21')](_0x5a686c);}return _0x1ae27c[_0xb037('0x22')]();};}function saveUpdates(_0x1302a7,_0x3376d2){return function(_0x54cbc1){if(_0x54cbc1){return _0x54cbc1[_0xb037('0x23')](_0x1302a7)[_0xb037('0x24')](function(_0x3e7f31){return _0x3e7f31;});}return null;};}function removeEntity(_0x291bbc,_0x3b38a2){return function(_0x4dc61a){if(_0x4dc61a){return _0x4dc61a['destroy']()['then'](function(){_0x291bbc['status'](0xcc)[_0xb037('0x19')]();});}};}function handleEntityNotFound(_0x302c67,_0x548cfb){return function(_0x23f716){if(!_0x23f716){_0x302c67[_0xb037('0x25')](0x194);}return _0x23f716;};}function handleError(_0x89e2c1,_0x526b1f){_0x526b1f=_0x526b1f||0x1f4;return function(_0x477c15){logger[_0xb037('0x26')](_0x477c15[_0xb037('0x27')]);if(_0x477c15['name']){delete _0x477c15[_0xb037('0x28')];}_0x89e2c1[_0xb037('0x18')](_0x526b1f)[_0xb037('0x29')](_0x477c15);};}exports[_0xb037('0x2a')]=function(_0x57254a,_0x2560ab){var _0x221797={},_0x5f04fc={},_0x504ac7={'count':0x0,'rows':[]};var _0x10d96a=_['map'](db['AnalyticFieldReport'][_0xb037('0x2b')],function(_0x50cb69){return{'name':_0x50cb69[_0xb037('0x2c')],'type':_0x50cb69[_0xb037('0x2d')][_0xb037('0x2e')]};});_0x5f04fc[_0xb037('0x2f')]=_['map'](_0x10d96a,_0xb037('0x28'));_0x5f04fc[_0xb037('0x30')]=_[_0xb037('0x31')](_0x57254a[_0xb037('0x30')]);_0x5f04fc[_0xb037('0x32')]=_[_0xb037('0x33')](_0x5f04fc[_0xb037('0x2f')],_0x5f04fc[_0xb037('0x30')]);_0x221797[_0xb037('0x34')]=_[_0xb037('0x33')](_0x5f04fc[_0xb037('0x2f')],qs['fields'](_0x57254a[_0xb037('0x30')][_0xb037('0x35')]));_0x221797[_0xb037('0x34')]=_0x221797[_0xb037('0x34')][_0xb037('0x36')]?_0x221797['attributes']:_0x5f04fc[_0xb037('0x2f')];if(!_0x57254a[_0xb037('0x30')][_0xb037('0x37')](_0xb037('0x38'))){_0x221797[_0xb037('0x1d')]=qs[_0xb037('0x1d')](_0x57254a['query'][_0xb037('0x1d')]);_0x221797['offset']=qs[_0xb037('0x1b')](_0x57254a[_0xb037('0x30')]['offset']);}_0x221797[_0xb037('0x39')]=qs[_0xb037('0x3a')](_0x57254a[_0xb037('0x30')][_0xb037('0x3a')]);_0x221797[_0xb037('0x3b')]=qs[_0xb037('0x32')](_[_0xb037('0x3c')](_0x57254a[_0xb037('0x30')],_0x5f04fc['filters']),_0x10d96a);if(_0x57254a['query'][_0xb037('0x3d')]){_0x221797[_0xb037('0x3b')]=_[_0xb037('0x3e')](_0x221797[_0xb037('0x3b')],{'$or':_[_0xb037('0x3f')](_0x10d96a,function(_0x33ba05){if(_0x33ba05[_0xb037('0x2d')]!==_0xb037('0x40')){var _0x4e7911={};_0x4e7911[_0x33ba05['name']]={'$like':'%'+_0x57254a['query'][_0xb037('0x3d')]+'%'};return _0x4e7911;}})});}_0x221797=_[_0xb037('0x3e')]({},_0x221797,_0x57254a['options']);var _0x1d5cf4={'where':_0x221797[_0xb037('0x3b')]};return db[_0xb037('0x41')][_0xb037('0x1e')](_0x1d5cf4)[_0xb037('0x24')](function(_0x434690){_0x504ac7[_0xb037('0x1e')]=_0x434690;if(_0x57254a[_0xb037('0x30')][_0xb037('0x42')]){_0x221797[_0xb037('0x43')]=[{'all':!![]}];}return db[_0xb037('0x41')][_0xb037('0x44')](_0x221797);})[_0xb037('0x24')](function(_0x8cf7fe){_0x504ac7[_0xb037('0x45')]=_0x8cf7fe;return _0x504ac7;})['then'](respondWithFilteredResult(_0x2560ab,_0x221797))[_0xb037('0x46')](handleError(_0x2560ab,null));};exports[_0xb037('0x47')]=function(_0x49d902,_0xceb0bd){var _0x4364c5={'raw':![],'where':{'id':_0x49d902[_0xb037('0x48')]['id']}},_0x38f8af={};_0x38f8af['model']=_['keys'](db[_0xb037('0x41')][_0xb037('0x2b')]);_0x38f8af[_0xb037('0x30')]=_['keys'](_0x49d902[_0xb037('0x30')]);_0x38f8af[_0xb037('0x32')]=_[_0xb037('0x33')](_0x38f8af[_0xb037('0x2f')],_0x38f8af[_0xb037('0x30')]);_0x4364c5[_0xb037('0x34')]=_['intersection'](_0x38f8af['model'],qs[_0xb037('0x35')](_0x49d902[_0xb037('0x30')]['fields']));_0x4364c5[_0xb037('0x34')]=_0x4364c5['attributes'][_0xb037('0x36')]?_0x4364c5[_0xb037('0x34')]:_0x38f8af[_0xb037('0x2f')];if(_0x49d902['query'][_0xb037('0x42')]){_0x4364c5[_0xb037('0x43')]=[{'all':!![]}];}_0x4364c5=_[_0xb037('0x3e')]({},_0x4364c5,_0x49d902[_0xb037('0x49')]);return db[_0xb037('0x41')][_0xb037('0x4a')](_0x4364c5)[_0xb037('0x24')](handleEntityNotFound(_0xceb0bd,null))[_0xb037('0x24')](respondWithResult(_0xceb0bd,null))[_0xb037('0x46')](handleError(_0xceb0bd,null));};exports[_0xb037('0x4b')]=function(_0x319c48,_0x4f3aef){return db[_0xb037('0x41')][_0xb037('0x4b')](_0x319c48['body'],{})[_0xb037('0x24')](respondWithResult(_0x4f3aef,0xc9))[_0xb037('0x46')](handleError(_0x4f3aef,null));};exports[_0xb037('0x4c')]=function(_0x58d1c5,_0x1df94f){return db[_0xb037('0x41')][_0xb037('0x4c')](_0x58d1c5['body'],{'raw':![],'individualHooks':!![]})[_0xb037('0x24')](respondWithResult(_0x1df94f,0xc9))[_0xb037('0x46')](handleError(_0x1df94f,null));};exports[_0xb037('0x23')]=function(_0x4fd0cd,_0x5ee22f){if(_0x4fd0cd['body']['id']){delete _0x4fd0cd[_0xb037('0x4d')]['id'];}return db[_0xb037('0x41')][_0xb037('0x4a')]({'where':{'id':_0x4fd0cd['params']['id']}})['then'](handleEntityNotFound(_0x5ee22f,null))[_0xb037('0x24')](saveUpdates(_0x4fd0cd[_0xb037('0x4d')],null))[_0xb037('0x24')](respondWithResult(_0x5ee22f,null))[_0xb037('0x46')](handleError(_0x5ee22f,null));};exports[_0xb037('0x4e')]=function(_0x5c6b76,_0x166de5){return db[_0xb037('0x41')]['find']({'where':{'id':_0x5c6b76['params']['id']}})[_0xb037('0x24')](handleEntityNotFound(_0x166de5,null))['then'](removeEntity(_0x166de5,null))[_0xb037('0x46')](handleError(_0x166de5,null));};exports[_0xb037('0x4f')]=function(_0x50d35a,_0x3f2072){return db[_0xb037('0x41')][_0xb037('0x4e')]({'where':{'id':_0x50d35a['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3f2072,0xcc))[_0xb037('0x46')](handleError(_0x3f2072,null));};exports[_0xb037('0x50')]=function(_0xf04815,_0x830a5d,_0x483ca4){return db[_0xb037('0x51')][_0xb037('0x52')]({'where':{'id':_0xf04815[_0xb037('0x48')]['id']}})[_0xb037('0x24')](handleEntityNotFound(_0x830a5d,null))[_0xb037('0x24')](function(_0x1fc0c0){if(_0x1fc0c0){return db['sequelize'][_0xb037('0x53')](function(_0x2217f4){return db[_0xb037('0x41')][_0xb037('0x4e')]({'where':{'CustomReportId':_0xf04815['params']['id']},'transaction':_0x2217f4})[_0xb037('0x24')](function(_0xb5d70c){var _0x4db1eb=_[_0xb037('0x3f')](_0xf04815[_0xb037('0x4d')],function(_0x574cde){delete _0x574cde['id'];_0x574cde['CustomReportId']=_0xf04815[_0xb037('0x48')]['id'];return _0x574cde;});return db['AnalyticFieldReport'][_0xb037('0x4c')](_0x4db1eb,{'transaction':_0x2217f4});});})[_0xb037('0x24')](function(){return db['AnalyticFieldReport'][_0xb037('0x44')]({'where':{'CustomReportId':_0xf04815[_0xb037('0x48')]['id']}});});}})[_0xb037('0x24')](respondWithResult(_0x830a5d,null))['catch'](handleError(_0x830a5d,null));};
\ No newline at end of file
index d611935..8ce0668 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddac=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x42d2e0,_0x590383){var _0x5e6265=function(_0x5e12e0){while(--_0x5e12e0){_0x42d2e0['push'](_0x42d2e0['shift']());}};_0x5e6265(++_0x590383);}(_0xddac,0xc5));var _0xcdda=function(_0x280988,_0x5551b6){_0x280988=_0x280988-0x0;var _0x5add5d=_0xddac[_0x280988];return _0x5add5d;};'use strict';var _=require('lodash');var util=require(_0xcdda('0x0'));var logger=require(_0xcdda('0x1'))('api');var moment=require(_0xcdda('0x2'));var BPromise=require(_0xcdda('0x3'));var rp=require(_0xcdda('0x4'));var fs=require('fs');var path=require(_0xcdda('0x5'));var rimraf=require(_0xcdda('0x6'));var config=require('../../config/environment');var attributes=require(_0xcdda('0x7'));module[_0xcdda('0x8')]=function(_0x1aa4a7,_0x3ee8a9){return _0x1aa4a7[_0xcdda('0x9')](_0xcdda('0xa'),attributes,{'tableName':_0xcdda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe320=['../../config/logger','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x2694a4,_0x46b7cb){var _0x113c52=function(_0x500d3b){while(--_0x500d3b){_0x2694a4['push'](_0x2694a4['shift']());}};_0x113c52(++_0x46b7cb);}(_0xe320,0x13b));var _0x0e32=function(_0x3ad25e,_0x5d80a6){_0x3ad25e=_0x3ad25e-0x0;var _0x156775=_0xe320[_0x3ad25e];return _0x156775;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0e32('0x0'))('api');var moment=require(_0x0e32('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e32('0x2'));var rimraf=require(_0x0e32('0x3'));var config=require(_0x0e32('0x4'));var attributes=require(_0x0e32('0x5'));module[_0x0e32('0x6')]=function(_0x43d378,_0x3bf241){return _0x43d378[_0x0e32('0x7')](_0x0e32('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c5a8b41..bf30447 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf182=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','lodash','util','moment'];(function(_0x144375,_0x41183d){var _0x4b0399=function(_0x15acb9){while(--_0x15acb9){_0x144375['push'](_0x144375['shift']());}};_0x4b0399(++_0x41183d);}(_0xf182,0x1b5));var _0x2f18=function(_0x4c2c83,_0x4d5747){_0x4c2c83=_0x4c2c83-0x0;var _0x51752d=_0xf182[_0x4c2c83];return _0x51752d;};'use strict';var _=require(_0x2f18('0x0'));var util=require(_0x2f18('0x1'));var moment=require(_0x2f18('0x2'));var BPromise=require(_0x2f18('0x3'));var rs=require(_0x2f18('0x4'));var fs=require('fs');var Redis=require(_0x2f18('0x5'));var db=require(_0x2f18('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f18('0x7'))(_0x2f18('0x8'));var config=require(_0x2f18('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2f18('0xa')][_0x2f18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e3816,_0x244e2a,_0x554012){return new BPromise(function(_0x30e5e7,_0x292b0f){return client[_0x2f18('0xc')](_0x1e3816,_0x554012)[_0x2f18('0xd')](function(_0x1902cd){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x244e2a,_0x2f18('0xe'));logger[_0x2f18('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x244e2a,_0x2f18('0xe'),JSON[_0x2f18('0x10')](_0x1902cd));if(_0x1902cd['error']){if(_0x1902cd[_0x2f18('0x11')]['code']===0x1f4){logger[_0x2f18('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x244e2a,_0x1902cd[_0x2f18('0x11')]['message']);return _0x292b0f(_0x1902cd[_0x2f18('0x11')]['message']);}logger[_0x2f18('0x11')](_0x2f18('0x12'),_0x244e2a,_0x1902cd[_0x2f18('0x11')][_0x2f18('0x13')]);return _0x30e5e7(_0x1902cd[_0x2f18('0x11')][_0x2f18('0x13')]);}else{logger[_0x2f18('0x14')](_0x2f18('0x12'),_0x244e2a,_0x2f18('0xe'));_0x30e5e7(_0x1902cd[_0x2f18('0x15')][_0x2f18('0x13')]);}})['catch'](function(_0x4022a2){logger[_0x2f18('0x11')](_0x2f18('0x12'),_0x244e2a,_0x4022a2);_0x292b0f(_0x4022a2);});});}
\ No newline at end of file
+var _0xcf90=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x36f641,_0x1a3063){var _0x39b299=function(_0x20c0a3){while(--_0x20c0a3){_0x36f641['push'](_0x36f641['shift']());}};_0x39b299(++_0x1a3063);}(_0xcf90,0x175));var _0x0cf9=function(_0x1b514f,_0x30fba3){_0x1b514f=_0x1b514f-0x0;var _0x3d5c97=_0xcf90[_0x1b514f];return _0x3d5c97;};'use strict';var _=require(_0x0cf9('0x0'));var util=require(_0x0cf9('0x1'));var moment=require('moment');var BPromise=require(_0x0cf9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cf9('0x3'));var db=require(_0x0cf9('0x4'))['db'];var utils=require(_0x0cf9('0x5'));var logger=require(_0x0cf9('0x6'))(_0x0cf9('0x7'));var config=require('../../config/environment');var jayson=require(_0x0cf9('0x8'));var client=jayson[_0x0cf9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25973d,_0x20e17d,_0x51a0cb){return new BPromise(function(_0x5a1046,_0x34915){return client[_0x0cf9('0xa')](_0x25973d,_0x51a0cb)[_0x0cf9('0xb')](function(_0x418068){logger[_0x0cf9('0xc')](_0x0cf9('0xd'),_0x20e17d,_0x0cf9('0xe'));logger[_0x0cf9('0xf')](_0x0cf9('0x10'),_0x20e17d,_0x0cf9('0xe'),JSON[_0x0cf9('0x11')](_0x418068));if(_0x418068['error']){if(_0x418068[_0x0cf9('0x12')][_0x0cf9('0x13')]===0x1f4){logger[_0x0cf9('0x12')](_0x0cf9('0xd'),_0x20e17d,_0x418068['error'][_0x0cf9('0x14')]);return _0x34915(_0x418068['error'][_0x0cf9('0x14')]);}logger[_0x0cf9('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x20e17d,_0x418068[_0x0cf9('0x12')][_0x0cf9('0x14')]);return _0x5a1046(_0x418068[_0x0cf9('0x12')][_0x0cf9('0x14')]);}else{logger[_0x0cf9('0xc')](_0x0cf9('0xd'),_0x20e17d,_0x0cf9('0xe'));_0x5a1046(_0x418068[_0x0cf9('0x15')][_0x0cf9('0x14')]);}})['catch'](function(_0x5dbda8){logger['error'](_0x0cf9('0xd'),_0x20e17d,_0x5dbda8);_0x34915(_0x5dbda8);});});}
\ No newline at end of file
index 0c413b1..378dd4e 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(_0x2ab75d,_0x257584){var _0x29c1e0=function(_0x5b46ad){while(--_0x5b46ad){_0x2ab75d['push'](_0x2ab75d['shift']());}};_0x29c1e0(++_0x257584);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x1c7033,_0x895853){var _0xf93472=function(_0x54d328){while(--_0x54d328){_0x1c7033['push'](_0x1c7033['shift']());}};_0xf93472(++_0x895853);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 1387905..0f00c70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e1=['sequelize','exports','STRING','name','TEXT'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xc4e1,0x172));var _0x1c4e=function(_0x17559a,_0x154e59){_0x17559a=_0x17559a-0x0;var _0x61be60=_0xc4e1[_0x17559a];return _0x61be60;};'use strict';var Sequelize=require(_0x1c4e('0x0'));module[_0x1c4e('0x1')]={'name':{'type':Sequelize[_0x1c4e('0x2')],'allowNull':![],'unique':_0x1c4e('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c4e('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xaf1d=['exports','STRING','name','TEXT','sequelize'];(function(_0x1b96f2,_0x14f728){var _0x53eace=function(_0x3eee42){while(--_0x3eee42){_0x1b96f2['push'](_0x1b96f2['shift']());}};_0x53eace(++_0x14f728);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x526cde,_0x505ef0){_0x526cde=_0x526cde-0x0;var _0x489274=_0xaf1d[_0x526cde];return _0x489274;};'use strict';var Sequelize=require(_0xdaf1('0x0'));module[_0xdaf1('0x1')]={'name':{'type':Sequelize[_0xdaf1('0x2')],'allowNull':![],'unique':_0xdaf1('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xdaf1('0x4')]},'description':{'type':Sequelize[_0xdaf1('0x2')]}};
\ No newline at end of file
index af24d2f..050d849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x3f591a,_0x52cd00){var _0x461939=function(_0xe2822c){while(--_0xe2822c){_0x3f591a['push'](_0x3f591a['shift']());}};_0x461939(++_0x52cd00);}(_0x98a8,0x12c));var _0x898a=function(_0x469be9,_0x2f5493){_0x469be9=_0x469be9-0x0;var _0x3e819b=_0x98a8[_0x469be9];return _0x3e819b;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
+var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x3a0f4b,_0x365b6e){var _0x1238c8=function(_0x182d57){while(--_0x182d57){_0x3a0f4b['push'](_0x3a0f4b['shift']());}};_0x1238c8(++_0x365b6e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x00bb[_0x3054be];return _0x3df150;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
index 6760208..4b89328 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbe=['analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x54f573,_0x4bfb56){var _0x458f83=function(_0x58a3da){while(--_0x58a3da){_0x54f573['push'](_0x54f573['shift']());}};_0x458f83(++_0x4bfb56);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x4f6d73,_0x37d4c4){_0x4f6d73=_0x4f6d73-0x0;var _0x411c83=_0xfcbe[_0x4f6d73];return _0x411c83;};'use strict';var _=require('lodash');var util=require(_0xefcb('0x0'));var logger=require(_0xefcb('0x1'))(_0xefcb('0x2'));var moment=require(_0xefcb('0x3'));var BPromise=require(_0xefcb('0x4'));var rp=require(_0xefcb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefcb('0x6'));var config=require(_0xefcb('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x50dcde,_0x3f322c){return _0x50dcde['define']('AnalyticMetric',attributes,{'tableName':_0xefcb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x482d=['path','../../config/environment','./analyticMetric.attributes','exports','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x84d8fb,_0x107be4){var _0x4de1fb=function(_0x28a4b1){while(--_0x28a4b1){_0x84d8fb['push'](_0x84d8fb['shift']());}};_0x4de1fb(++_0x107be4);}(_0x482d,0x16c));var _0xd482=function(_0x3b71e2,_0x35c979){_0x3b71e2=_0x3b71e2-0x0;var _0x1bd52e=_0x482d[_0x3b71e2];return _0x1bd52e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd482('0x0'))(_0xd482('0x1'));var moment=require(_0xd482('0x2'));var BPromise=require(_0xd482('0x3'));var rp=require(_0xd482('0x4'));var fs=require('fs');var path=require(_0xd482('0x5'));var rimraf=require('rimraf');var config=require(_0xd482('0x6'));var attributes=require(_0xd482('0x7'));module[_0xd482('0x8')]=function(_0x57cd2c,_0x3b9989){return _0x57cd2c['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aa5a3c4..433f1b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x305c=['request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x47ad6d,_0xf4793d){var _0x505990=function(_0x2a3f44){while(--_0x2a3f44){_0x47ad6d['push'](_0x47ad6d['shift']());}};_0x505990(++_0xf4793d);}(_0x305c,0x15e));var _0xc305=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x305c[_0x37c22c];return _0x119d79;};'use strict';var _=require('lodash');var util=require(_0xc305('0x0'));var moment=require(_0xc305('0x1'));var BPromise=require(_0xc305('0x2'));var rs=require(_0xc305('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc305('0x4'));var logger=require('../../config/logger')(_0xc305('0x5'));var config=require(_0xc305('0x6'));var jayson=require(_0xc305('0x7'));var client=jayson[_0xc305('0x8')][_0xc305('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d134d,_0x565bff,_0x430e9f){return new BPromise(function(_0x13a02a,_0x3714fa){return client[_0xc305('0xa')](_0x2d134d,_0x430e9f)[_0xc305('0xb')](function(_0x12fe5f){logger[_0xc305('0xc')](_0xc305('0xd'),_0x565bff,_0xc305('0xe'));logger[_0xc305('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x565bff,_0xc305('0xe'),JSON[_0xc305('0x10')](_0x12fe5f));if(_0x12fe5f['error']){if(_0x12fe5f['error'][_0xc305('0x11')]===0x1f4){logger[_0xc305('0x12')](_0xc305('0xd'),_0x565bff,_0x12fe5f[_0xc305('0x12')][_0xc305('0x13')]);return _0x3714fa(_0x12fe5f['error'][_0xc305('0x13')]);}logger[_0xc305('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x565bff,_0x12fe5f[_0xc305('0x12')]['message']);return _0x13a02a(_0x12fe5f[_0xc305('0x12')][_0xc305('0x13')]);}else{logger[_0xc305('0xc')](_0xc305('0xd'),_0x565bff,_0xc305('0xe'));_0x13a02a(_0x12fe5f['result'][_0xc305('0x13')]);}})['catch'](function(_0x4fe07b){logger[_0xc305('0x12')](_0xc305('0xd'),_0x565bff,_0x4fe07b);_0x3714fa(_0x4fe07b);});});}
\ No newline at end of file
+var _0x2e39=['jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2e39,0x1c5));var _0x92e3=function(_0x319a63,_0x3a7d3f){_0x319a63=_0x319a63-0x0;var _0x353bca=_0x2e39[_0x319a63];return _0x353bca;};'use strict';var _=require(_0x92e3('0x0'));var util=require(_0x92e3('0x1'));var moment=require('moment');var BPromise=require(_0x92e3('0x2'));var rs=require(_0x92e3('0x3'));var fs=require('fs');var Redis=require(_0x92e3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x92e3('0x5'));var config=require(_0x92e3('0x6'));var jayson=require(_0x92e3('0x7'));var client=jayson[_0x92e3('0x8')][_0x92e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14f09a,_0x33e336,_0x4d9789){return new BPromise(function(_0x374696,_0x25dc98){return client['request'](_0x14f09a,_0x4d9789)[_0x92e3('0xa')](function(_0x2f4ca2){logger[_0x92e3('0xb')](_0x92e3('0xc'),_0x33e336,'request\x20sent');logger[_0x92e3('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x33e336,_0x92e3('0xe'),JSON[_0x92e3('0xf')](_0x2f4ca2));if(_0x2f4ca2[_0x92e3('0x10')]){if(_0x2f4ca2[_0x92e3('0x10')][_0x92e3('0x11')]===0x1f4){logger[_0x92e3('0x10')](_0x92e3('0xc'),_0x33e336,_0x2f4ca2[_0x92e3('0x10')]['message']);return _0x25dc98(_0x2f4ca2[_0x92e3('0x10')][_0x92e3('0x12')]);}logger[_0x92e3('0x10')](_0x92e3('0xc'),_0x33e336,_0x2f4ca2['error'][_0x92e3('0x12')]);return _0x374696(_0x2f4ca2[_0x92e3('0x10')][_0x92e3('0x12')]);}else{logger[_0x92e3('0xb')](_0x92e3('0xc'),_0x33e336,_0x92e3('0xe'));_0x374696(_0x2f4ca2['result'][_0x92e3('0x12')]);}})[_0x92e3('0x13')](function(_0x5051c4){logger['error'](_0x92e3('0xc'),_0x33e336,_0x5051c4);_0x25dc98(_0x5051c4);});});}
\ No newline at end of file
index e3f7cb6..06ee8a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d7e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','update','exports','util','path','connect-timeout'];(function(_0x3fd9af,_0xe1e30){var _0x2c10b5=function(_0x4549c7){while(--_0x4549c7){_0x3fd9af['push'](_0x3fd9af['shift']());}};_0x2c10b5(++_0xe1e30);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x1d7e[_0x2763f2];return _0x3ef471;};'use strict';var multer=require('multer');var util=require(_0xe1d7('0x0'));var path=require(_0xe1d7('0x1'));var timeout=require(_0xe1d7('0x2'));var express=require('express');var router=express[_0xe1d7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe1d7('0x4'));var interaction=require(_0xe1d7('0x5'));var config=require(_0xe1d7('0x6'));var controller=require(_0xe1d7('0x7'));router[_0xe1d7('0x8')]('/',auth[_0xe1d7('0x9')](),controller[_0xe1d7('0xa')]);router[_0xe1d7('0x8')](_0xe1d7('0xb'),auth[_0xe1d7('0x9')](),controller[_0xe1d7('0xc')]);router['post']('/',auth[_0xe1d7('0x9')](),controller[_0xe1d7('0xd')]);router['put'](_0xe1d7('0xb'),auth['isAuthenticated'](),controller[_0xe1d7('0xe')]);router['delete'](_0xe1d7('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xe1d7('0xf')]=router;
\ No newline at end of file
+var _0x5398=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x5398,0xe2));var _0x8539=function(_0xf771fe,_0x1d1fa8){_0xf771fe=_0xf771fe-0x0;var _0x27eecc=_0x5398[_0xf771fe];return _0x27eecc;};'use strict';var multer=require('multer');var util=require(_0x8539('0x0'));var path=require(_0x8539('0x1'));var timeout=require(_0x8539('0x2'));var express=require(_0x8539('0x3'));var router=express[_0x8539('0x4')]();var fs_extra=require(_0x8539('0x5'));var auth=require(_0x8539('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8539('0x7'));router[_0x8539('0x8')]('/',auth[_0x8539('0x9')](),controller[_0x8539('0xa')]);router[_0x8539('0x8')](_0x8539('0xb'),auth['isAuthenticated'](),controller[_0x8539('0xc')]);router[_0x8539('0xd')]('/',auth[_0x8539('0x9')](),controller[_0x8539('0xe')]);router[_0x8539('0xf')](_0x8539('0xb'),auth[_0x8539('0x9')](),controller[_0x8539('0x10')]);router[_0x8539('0x11')](_0x8539('0xb'),auth['isAuthenticated'](),controller[_0x8539('0x12')]);module[_0x8539('0x13')]=router;
\ No newline at end of file
index 8ffe2f3..6f3e560 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd343=['TEXT'];(function(_0x21dccd,_0x30b1bb){var _0x94fc9b=function(_0x47b91c){while(--_0x47b91c){_0x21dccd['push'](_0x21dccd['shift']());}};_0x94fc9b(++_0x30b1bb);}(_0xd343,0x130));var _0x3d34=function(_0x56c74a,_0x7e7580){_0x56c74a=_0x56c74a-0x0;var _0x409137=_0xd343[_0x56c74a];return _0x409137;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x3d34('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x32ac=['TEXT','sequelize'];(function(_0x313866,_0x3ecd92){var _0x5a818f=function(_0x507e58){while(--_0x507e58){_0x313866['push'](_0x313866['shift']());}};_0x5a818f(++_0x3ecd92);}(_0x32ac,0x113));var _0xc32a=function(_0x4ad9cd,_0x43e881){_0x4ad9cd=_0x4ad9cd-0x0;var _0x5e34b1=_0x32ac[_0x4ad9cd];return _0x5e34b1;};'use strict';var Sequelize=require(_0xc32a('0x0'));module['exports']={'tree':{'type':Sequelize[_0xc32a('0x1')],'allowNull':![]}};
\ No newline at end of file
index 791615c..8c7fd34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa13=['body','find','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','AnalyticTreeReport','fieldName','type','key','model','map','keys','filters','intersection','query','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','create'];(function(_0x41e122,_0xa1a841){var _0x3c927d=function(_0x2e762e){while(--_0x2e762e){_0x41e122['push'](_0x41e122['shift']());}};_0x3c927d(++_0xa1a841);}(_0xaa13,0x179));var _0x3aa1=function(_0x112e83,_0x4c70ab){_0x112e83=_0x112e83-0x0;var _0x5afcaa=_0xaa13[_0x112e83];return _0x5afcaa;};'use strict';var emlformat=require(_0x3aa1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3aa1('0x1'));var rp=require(_0x3aa1('0x2'));var moment=require(_0x3aa1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3aa1('0x4'));var util=require(_0x3aa1('0x5'));var path=require(_0x3aa1('0x6'));var sox=require(_0x3aa1('0x7'));var csv=require(_0x3aa1('0x8'));var ejs=require(_0x3aa1('0x9'));var fs=require('fs');var fs_extra=require(_0x3aa1('0xa'));var _=require(_0x3aa1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3aa1('0xc'));var deskjs=require(_0x3aa1('0xd'));var toCsv=require(_0x3aa1('0x8'));var querystring=require(_0x3aa1('0xe'));var Papa=require(_0x3aa1('0xf'));var Redis=require(_0x3aa1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3aa1('0x11'));var as=require(_0x3aa1('0x12'));var hardwareService=require(_0x3aa1('0x13'));var logger=require(_0x3aa1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3aa1('0x15'));var licenseUtil=require(_0x3aa1('0x16'));var db=require(_0x3aa1('0x17'))['db'];function respondWithStatusCode(_0x5bd7b4,_0xcf9e12){_0xcf9e12=_0xcf9e12||0xcc;return function(_0x49259a){if(_0x49259a){return _0x5bd7b4['sendStatus'](_0xcf9e12);}return _0x5bd7b4[_0x3aa1('0x18')](_0xcf9e12)[_0x3aa1('0x19')]();};}function respondWithResult(_0x5c0899,_0x5c7f44){_0x5c7f44=_0x5c7f44||0xc8;return function(_0xd7be4a){if(_0xd7be4a){return _0x5c0899[_0x3aa1('0x18')](_0x5c7f44)[_0x3aa1('0x1a')](_0xd7be4a);}};}function respondWithFilteredResult(_0x4fec74,_0x214051){return function(_0x49e605){if(_0x49e605){var _0x3a73be=typeof _0x214051[_0x3aa1('0x1b')]===_0x3aa1('0x1c')&&typeof _0x214051[_0x3aa1('0x1d')]===_0x3aa1('0x1c');var _0x1bd01c=_0x49e605[_0x3aa1('0x1e')];var _0x1001c2=_0x3a73be?0x0:_0x214051[_0x3aa1('0x1b')];var _0x2a8a89=_0x3a73be?_0x49e605[_0x3aa1('0x1e')]:_0x214051[_0x3aa1('0x1b')]+_0x214051[_0x3aa1('0x1d')];var _0x1965e3;if(_0x2a8a89>=_0x1bd01c){_0x2a8a89=_0x1bd01c;_0x1965e3=0xc8;}else{_0x1965e3=0xce;}_0x4fec74[_0x3aa1('0x18')](_0x1965e3);return _0x4fec74[_0x3aa1('0x1f')](_0x3aa1('0x20'),_0x1001c2+'-'+_0x2a8a89+'/'+_0x1bd01c)[_0x3aa1('0x1a')](_0x49e605);}return null;};}function patchUpdates(_0x58b026){return function(_0x22b7c9){try{jsonpatch['apply'](_0x22b7c9,_0x58b026,!![]);}catch(_0x23bfbb){return BPromise[_0x3aa1('0x21')](_0x23bfbb);}return _0x22b7c9[_0x3aa1('0x22')]();};}function saveUpdates(_0x31ba9e,_0x2c87e3){return function(_0x4a4647){if(_0x4a4647){return _0x4a4647[_0x3aa1('0x23')](_0x31ba9e)[_0x3aa1('0x24')](function(_0x3d69b2){return _0x3d69b2;});}return null;};}function removeEntity(_0x35bb69,_0x4ee962){return function(_0x5bf926){if(_0x5bf926){return _0x5bf926[_0x3aa1('0x25')]()['then'](function(){_0x35bb69[_0x3aa1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a2113,_0x307161){return function(_0x28758e){if(!_0x28758e){_0x3a2113[_0x3aa1('0x26')](0x194);}return _0x28758e;};}function handleError(_0x5efd75,_0x9727f5){_0x9727f5=_0x9727f5||0x1f4;return function(_0x22707b){logger[_0x3aa1('0x27')](_0x22707b[_0x3aa1('0x28')]);if(_0x22707b['name']){delete _0x22707b[_0x3aa1('0x29')];}_0x5efd75[_0x3aa1('0x18')](_0x9727f5)['send'](_0x22707b);};}exports[_0x3aa1('0x2a')]=function(_0x5a4442,_0x2567e6){var _0x57b7ec={},_0x26af50={},_0x54db2a={'count':0x0,'rows':[]};var _0x5ce255=_['map'](db[_0x3aa1('0x2b')]['rawAttributes'],function(_0x385c0e){return{'name':_0x385c0e[_0x3aa1('0x2c')],'type':_0x385c0e[_0x3aa1('0x2d')][_0x3aa1('0x2e')]};});_0x26af50[_0x3aa1('0x2f')]=_[_0x3aa1('0x30')](_0x5ce255,'name');_0x26af50['query']=_[_0x3aa1('0x31')](_0x5a4442['query']);_0x26af50[_0x3aa1('0x32')]=_[_0x3aa1('0x33')](_0x26af50['model'],_0x26af50[_0x3aa1('0x34')]);_0x57b7ec['attributes']=_[_0x3aa1('0x33')](_0x26af50[_0x3aa1('0x2f')],qs[_0x3aa1('0x35')](_0x5a4442[_0x3aa1('0x34')][_0x3aa1('0x35')]));_0x57b7ec['attributes']=_0x57b7ec['attributes'][_0x3aa1('0x36')]?_0x57b7ec[_0x3aa1('0x37')]:_0x26af50[_0x3aa1('0x2f')];if(!_0x5a4442[_0x3aa1('0x34')][_0x3aa1('0x38')](_0x3aa1('0x39'))){_0x57b7ec[_0x3aa1('0x1d')]=qs[_0x3aa1('0x1d')](_0x5a4442['query']['limit']);_0x57b7ec['offset']=qs[_0x3aa1('0x1b')](_0x5a4442[_0x3aa1('0x34')]['offset']);}_0x57b7ec[_0x3aa1('0x3a')]=qs[_0x3aa1('0x3b')](_0x5a4442[_0x3aa1('0x34')][_0x3aa1('0x3b')]);_0x57b7ec['where']=qs['filters'](_[_0x3aa1('0x3c')](_0x5a4442[_0x3aa1('0x34')],_0x26af50['filters']),_0x5ce255);if(_0x5a4442['query'][_0x3aa1('0x3d')]){_0x57b7ec['where']=_[_0x3aa1('0x3e')](_0x57b7ec[_0x3aa1('0x3f')],{'$or':_[_0x3aa1('0x30')](_0x5ce255,function(_0x1118e7){if(_0x1118e7[_0x3aa1('0x2d')]!==_0x3aa1('0x40')){var _0x49c9a3={};_0x49c9a3[_0x1118e7[_0x3aa1('0x29')]]={'$like':'%'+_0x5a4442[_0x3aa1('0x34')][_0x3aa1('0x3d')]+'%'};return _0x49c9a3;}})});}_0x57b7ec=_[_0x3aa1('0x3e')]({},_0x57b7ec,_0x5a4442[_0x3aa1('0x41')]);var _0x3bd32e={'where':_0x57b7ec['where']};return db[_0x3aa1('0x2b')][_0x3aa1('0x1e')](_0x3bd32e)[_0x3aa1('0x24')](function(_0x206a32){_0x54db2a[_0x3aa1('0x1e')]=_0x206a32;if(_0x5a4442[_0x3aa1('0x34')]['includeAll']){_0x57b7ec[_0x3aa1('0x42')]=[{'all':!![]}];}return db[_0x3aa1('0x2b')][_0x3aa1('0x43')](_0x57b7ec);})['then'](function(_0x3028e6){_0x54db2a[_0x3aa1('0x44')]=_0x3028e6;return _0x54db2a;})['then'](respondWithFilteredResult(_0x2567e6,_0x57b7ec))['catch'](handleError(_0x2567e6,null));};exports[_0x3aa1('0x45')]=function(_0x29cda5,_0x38b88d){var _0x1a15fd={'raw':!![],'where':{'id':_0x29cda5[_0x3aa1('0x46')]['id']}},_0x17ba4a={};_0x17ba4a[_0x3aa1('0x2f')]=_[_0x3aa1('0x31')](db[_0x3aa1('0x2b')][_0x3aa1('0x47')]);_0x17ba4a[_0x3aa1('0x34')]=_[_0x3aa1('0x31')](_0x29cda5[_0x3aa1('0x34')]);_0x17ba4a[_0x3aa1('0x32')]=_[_0x3aa1('0x33')](_0x17ba4a[_0x3aa1('0x2f')],_0x17ba4a[_0x3aa1('0x34')]);_0x1a15fd[_0x3aa1('0x37')]=_[_0x3aa1('0x33')](_0x17ba4a[_0x3aa1('0x2f')],qs[_0x3aa1('0x35')](_0x29cda5['query'][_0x3aa1('0x35')]));_0x1a15fd['attributes']=_0x1a15fd[_0x3aa1('0x37')][_0x3aa1('0x36')]?_0x1a15fd[_0x3aa1('0x37')]:_0x17ba4a[_0x3aa1('0x2f')];if(_0x29cda5[_0x3aa1('0x34')]['includeAll']){_0x1a15fd['include']=[{'all':!![]}];}_0x1a15fd=_[_0x3aa1('0x3e')]({},_0x1a15fd,_0x29cda5[_0x3aa1('0x41')]);return db[_0x3aa1('0x2b')]['find'](_0x1a15fd)[_0x3aa1('0x24')](handleEntityNotFound(_0x38b88d,null))[_0x3aa1('0x24')](respondWithResult(_0x38b88d,null))['catch'](handleError(_0x38b88d,null));};exports[_0x3aa1('0x48')]=function(_0x2c2080,_0x3fa7e2){return db[_0x3aa1('0x2b')]['create'](_0x2c2080[_0x3aa1('0x49')],{})[_0x3aa1('0x24')](respondWithResult(_0x3fa7e2,0xc9))['catch'](handleError(_0x3fa7e2,null));};exports[_0x3aa1('0x23')]=function(_0x5f72fd,_0x410a89){if(_0x5f72fd['body']['id']){delete _0x5f72fd['body']['id'];}return db['AnalyticTreeReport'][_0x3aa1('0x4a')]({'where':{'id':_0x5f72fd['params']['id']}})[_0x3aa1('0x24')](handleEntityNotFound(_0x410a89,null))['then'](saveUpdates(_0x5f72fd[_0x3aa1('0x49')],null))['then'](respondWithResult(_0x410a89,null))['catch'](handleError(_0x410a89,null));};exports['destroy']=function(_0x16d3bd,_0x4fadc4){return db[_0x3aa1('0x2b')]['find']({'where':{'id':_0x16d3bd[_0x3aa1('0x46')]['id']}})[_0x3aa1('0x24')](handleEntityNotFound(_0x4fadc4,null))[_0x3aa1('0x24')](removeEntity(_0x4fadc4,null))['catch'](handleError(_0x4fadc4,null));};
\ No newline at end of file
+var _0x4cf3=['moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','includeAll','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x275d47,_0x2e98e6){var _0x2e09e2=function(_0x3d46bb){while(--_0x3d46bb){_0x275d47['push'](_0x275d47['shift']());}};_0x2e09e2(++_0x2e98e6);}(_0x4cf3,0x13f));var _0x34cf=function(_0x2a5950,_0x12cadf){_0x2a5950=_0x2a5950-0x0;var _0x1bc546=_0x4cf3[_0x2a5950];return _0x1bc546;};'use strict';var emlformat=require(_0x34cf('0x0'));var rimraf=require(_0x34cf('0x1'));var zipdir=require(_0x34cf('0x2'));var jsonpatch=require(_0x34cf('0x3'));var rp=require(_0x34cf('0x4'));var moment=require(_0x34cf('0x5'));var BPromise=require(_0x34cf('0x6'));var Mustache=require(_0x34cf('0x7'));var util=require(_0x34cf('0x8'));var path=require(_0x34cf('0x9'));var sox=require(_0x34cf('0xa'));var csv=require('to-csv');var ejs=require(_0x34cf('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34cf('0xc'));var squel=require(_0x34cf('0xd'));var crypto=require(_0x34cf('0xe'));var jsforce=require(_0x34cf('0xf'));var deskjs=require(_0x34cf('0x10'));var toCsv=require(_0x34cf('0x11'));var querystring=require(_0x34cf('0x12'));var Papa=require(_0x34cf('0x13'));var Redis=require(_0x34cf('0x14'));var authService=require(_0x34cf('0x15'));var qs=require(_0x34cf('0x16'));var as=require(_0x34cf('0x17'));var hardwareService=require(_0x34cf('0x18'));var logger=require(_0x34cf('0x19'))(_0x34cf('0x1a'));var utils=require(_0x34cf('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x34cf('0x1c'));var db=require(_0x34cf('0x1d'))['db'];function respondWithStatusCode(_0xee105d,_0x4cbbeb){_0x4cbbeb=_0x4cbbeb||0xcc;return function(_0x443bd6){if(_0x443bd6){return _0xee105d[_0x34cf('0x1e')](_0x4cbbeb);}return _0xee105d[_0x34cf('0x1f')](_0x4cbbeb)['end']();};}function respondWithResult(_0x631798,_0x251de0){_0x251de0=_0x251de0||0xc8;return function(_0x1e5056){if(_0x1e5056){return _0x631798[_0x34cf('0x1f')](_0x251de0)[_0x34cf('0x20')](_0x1e5056);}};}function respondWithFilteredResult(_0xf79b44,_0xdb1e64){return function(_0x1212e1){if(_0x1212e1){var _0x28086d=typeof _0xdb1e64[_0x34cf('0x21')]==='undefined'&&typeof _0xdb1e64['limit']===_0x34cf('0x22');var _0x4e3380=_0x1212e1[_0x34cf('0x23')];var _0x5ba400=_0x28086d?0x0:_0xdb1e64[_0x34cf('0x21')];var _0x56e976=_0x28086d?_0x1212e1[_0x34cf('0x23')]:_0xdb1e64[_0x34cf('0x21')]+_0xdb1e64['limit'];var _0x146267;if(_0x56e976>=_0x4e3380){_0x56e976=_0x4e3380;_0x146267=0xc8;}else{_0x146267=0xce;}_0xf79b44[_0x34cf('0x1f')](_0x146267);return _0xf79b44[_0x34cf('0x24')](_0x34cf('0x25'),_0x5ba400+'-'+_0x56e976+'/'+_0x4e3380)[_0x34cf('0x20')](_0x1212e1);}return null;};}function patchUpdates(_0x3f47e5){return function(_0x12031b){try{jsonpatch[_0x34cf('0x26')](_0x12031b,_0x3f47e5,!![]);}catch(_0x43cc6f){return BPromise[_0x34cf('0x27')](_0x43cc6f);}return _0x12031b[_0x34cf('0x28')]();};}function saveUpdates(_0x5f5af1,_0x590aae){return function(_0x11cc35){if(_0x11cc35){return _0x11cc35[_0x34cf('0x29')](_0x5f5af1)[_0x34cf('0x2a')](function(_0x94055c){return _0x94055c;});}return null;};}function removeEntity(_0x27ea20,_0x52fd70){return function(_0x3e69f6){if(_0x3e69f6){return _0x3e69f6['destroy']()['then'](function(){_0x27ea20[_0x34cf('0x1f')](0xcc)[_0x34cf('0x2b')]();});}};}function handleEntityNotFound(_0x489cc5,_0x126a6d){return function(_0x3afffb){if(!_0x3afffb){_0x489cc5[_0x34cf('0x1e')](0x194);}return _0x3afffb;};}function handleError(_0x5c8a7e,_0x1888c6){_0x1888c6=_0x1888c6||0x1f4;return function(_0x3bafd6){logger[_0x34cf('0x2c')](_0x3bafd6[_0x34cf('0x2d')]);if(_0x3bafd6[_0x34cf('0x2e')]){delete _0x3bafd6['name'];}_0x5c8a7e['status'](_0x1888c6)['send'](_0x3bafd6);};}exports[_0x34cf('0x2f')]=function(_0x3c241d,_0x41d01a){var _0x514848={},_0x2379ce={},_0x1beb03={'count':0x0,'rows':[]};var _0x531704=_['map'](db[_0x34cf('0x30')][_0x34cf('0x31')],function(_0x559b2e){return{'name':_0x559b2e[_0x34cf('0x32')],'type':_0x559b2e[_0x34cf('0x33')][_0x34cf('0x34')]};});_0x2379ce[_0x34cf('0x35')]=_[_0x34cf('0x36')](_0x531704,_0x34cf('0x2e'));_0x2379ce[_0x34cf('0x37')]=_[_0x34cf('0x38')](_0x3c241d['query']);_0x2379ce[_0x34cf('0x39')]=_[_0x34cf('0x3a')](_0x2379ce[_0x34cf('0x35')],_0x2379ce['query']);_0x514848[_0x34cf('0x3b')]=_[_0x34cf('0x3a')](_0x2379ce[_0x34cf('0x35')],qs['fields'](_0x3c241d[_0x34cf('0x37')][_0x34cf('0x3c')]));_0x514848[_0x34cf('0x3b')]=_0x514848[_0x34cf('0x3b')][_0x34cf('0x3d')]?_0x514848[_0x34cf('0x3b')]:_0x2379ce[_0x34cf('0x35')];if(!_0x3c241d[_0x34cf('0x37')]['hasOwnProperty'](_0x34cf('0x3e'))){_0x514848[_0x34cf('0x3f')]=qs[_0x34cf('0x3f')](_0x3c241d[_0x34cf('0x37')]['limit']);_0x514848[_0x34cf('0x21')]=qs[_0x34cf('0x21')](_0x3c241d['query'][_0x34cf('0x21')]);}_0x514848[_0x34cf('0x40')]=qs[_0x34cf('0x41')](_0x3c241d[_0x34cf('0x37')][_0x34cf('0x41')]);_0x514848[_0x34cf('0x42')]=qs[_0x34cf('0x39')](_[_0x34cf('0x43')](_0x3c241d[_0x34cf('0x37')],_0x2379ce['filters']),_0x531704);if(_0x3c241d[_0x34cf('0x37')][_0x34cf('0x44')]){_0x514848[_0x34cf('0x42')]=_['merge'](_0x514848[_0x34cf('0x42')],{'$or':_[_0x34cf('0x36')](_0x531704,function(_0x3f4402){if(_0x3f4402[_0x34cf('0x33')]!=='VIRTUAL'){var _0x49a9fd={};_0x49a9fd[_0x3f4402['name']]={'$like':'%'+_0x3c241d[_0x34cf('0x37')][_0x34cf('0x44')]+'%'};return _0x49a9fd;}})});}_0x514848=_[_0x34cf('0x45')]({},_0x514848,_0x3c241d[_0x34cf('0x46')]);var _0x5634ec={'where':_0x514848[_0x34cf('0x42')]};return db[_0x34cf('0x30')][_0x34cf('0x23')](_0x5634ec)[_0x34cf('0x2a')](function(_0x345dc5){_0x1beb03['count']=_0x345dc5;if(_0x3c241d['query']['includeAll']){_0x514848[_0x34cf('0x47')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x514848);})[_0x34cf('0x2a')](function(_0x45c597){_0x1beb03[_0x34cf('0x48')]=_0x45c597;return _0x1beb03;})['then'](respondWithFilteredResult(_0x41d01a,_0x514848))[_0x34cf('0x49')](handleError(_0x41d01a,null));};exports[_0x34cf('0x4a')]=function(_0x327044,_0x16fe28){var _0x36da12={'raw':!![],'where':{'id':_0x327044['params']['id']}},_0x3641aa={};_0x3641aa[_0x34cf('0x35')]=_[_0x34cf('0x38')](db[_0x34cf('0x30')]['rawAttributes']);_0x3641aa['query']=_[_0x34cf('0x38')](_0x327044[_0x34cf('0x37')]);_0x3641aa[_0x34cf('0x39')]=_['intersection'](_0x3641aa[_0x34cf('0x35')],_0x3641aa[_0x34cf('0x37')]);_0x36da12[_0x34cf('0x3b')]=_[_0x34cf('0x3a')](_0x3641aa['model'],qs['fields'](_0x327044[_0x34cf('0x37')][_0x34cf('0x3c')]));_0x36da12['attributes']=_0x36da12['attributes'][_0x34cf('0x3d')]?_0x36da12['attributes']:_0x3641aa['model'];if(_0x327044[_0x34cf('0x37')][_0x34cf('0x4b')]){_0x36da12['include']=[{'all':!![]}];}_0x36da12=_['merge']({},_0x36da12,_0x327044[_0x34cf('0x46')]);return db[_0x34cf('0x30')]['find'](_0x36da12)[_0x34cf('0x2a')](handleEntityNotFound(_0x16fe28,null))[_0x34cf('0x2a')](respondWithResult(_0x16fe28,null))['catch'](handleError(_0x16fe28,null));};exports['create']=function(_0x397b44,_0x472969){return db[_0x34cf('0x30')][_0x34cf('0x4c')](_0x397b44[_0x34cf('0x4d')],{})[_0x34cf('0x2a')](respondWithResult(_0x472969,0xc9))[_0x34cf('0x49')](handleError(_0x472969,null));};exports[_0x34cf('0x29')]=function(_0x14bfdf,_0x198f73){if(_0x14bfdf[_0x34cf('0x4d')]['id']){delete _0x14bfdf[_0x34cf('0x4d')]['id'];}return db[_0x34cf('0x30')][_0x34cf('0x4e')]({'where':{'id':_0x14bfdf[_0x34cf('0x4f')]['id']}})[_0x34cf('0x2a')](handleEntityNotFound(_0x198f73,null))[_0x34cf('0x2a')](saveUpdates(_0x14bfdf[_0x34cf('0x4d')],null))[_0x34cf('0x2a')](respondWithResult(_0x198f73,null))[_0x34cf('0x49')](handleError(_0x198f73,null));};exports[_0x34cf('0x50')]=function(_0x39cc72,_0xac54fb){return db[_0x34cf('0x30')][_0x34cf('0x4e')]({'where':{'id':_0x39cc72[_0x34cf('0x4f')]['id']}})[_0x34cf('0x2a')](handleEntityNotFound(_0xac54fb,null))['then'](removeEntity(_0xac54fb,null))[_0x34cf('0x49')](handleError(_0xac54fb,null));};
\ No newline at end of file
index 7e89565..140423d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda8d=['moment','rimraf','./analyticTreeReport.attributes','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x115bf9,_0x5e5adc){var _0x4d8750=function(_0x66e03e){while(--_0x66e03e){_0x115bf9['push'](_0x115bf9['shift']());}};_0x4d8750(++_0x5e5adc);}(_0xda8d,0x74));var _0xdda8=function(_0x36e0f6,_0x4da6a7){_0x36e0f6=_0x36e0f6-0x0;var _0xc90479=_0xda8d[_0x36e0f6];return _0xc90479;};'use strict';var _=require(_0xdda8('0x0'));var util=require(_0xdda8('0x1'));var logger=require(_0xdda8('0x2'))(_0xdda8('0x3'));var moment=require(_0xdda8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdda8('0x5'));var config=require('../../config/environment');var attributes=require(_0xdda8('0x6'));module['exports']=function(_0xf301be,_0x18cb56){return _0xf301be['define']('AnalyticTreeReport',attributes,{'tableName':_0xdda8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x743c=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x743c,0x14d));var _0xc743=function(_0x8e6768,_0x997aad){_0x8e6768=_0x8e6768-0x0;var _0x4db9e9=_0x743c[_0x8e6768];return _0x4db9e9;};'use strict';var _=require(_0xc743('0x0'));var util=require(_0xc743('0x1'));var logger=require('../../config/logger')(_0xc743('0x2'));var moment=require(_0xc743('0x3'));var BPromise=require(_0xc743('0x4'));var rp=require(_0xc743('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc743('0x6'));var config=require(_0xc743('0x7'));var attributes=require(_0xc743('0x8'));module[_0xc743('0x9')]=function(_0x958b03,_0x521ebf){return _0x958b03[_0xc743('0xa')](_0xc743('0xb'),attributes,{'tableName':_0xc743('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 33ec677..9f06527 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','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1970ed,_0x122980){var _0x4ae926=function(_0x20f96c){while(--_0x20f96c){_0x1970ed['push'](_0x1970ed['shift']());}};_0x4ae926(++_0x122980);}(_0xdb28,0x106));var _0x8db2=function(_0x61d1c6,_0x9953a2){_0x61d1c6=_0x61d1c6-0x0;var _0x56fd99=_0xdb28[_0x61d1c6];return _0x56fd99;};'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
+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(_0x18a669,_0x3e97f7){var _0x57cd6f=function(_0x5de55b){while(--_0x5de55b){_0x18a669['push'](_0x18a669['shift']());}};_0x57cd6f(++_0x3e97f7);}(_0xdb28,0x106));var _0x8db2=function(_0x565777,_0x169f59){_0x565777=_0x565777-0x0;var _0x56d505=_0xdb28[_0x565777];return _0x56d505;};'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 1a5110d..88b64a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd377=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post','put','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x42475f,_0x231ca8){var _0x29d6fb=function(_0x4a8fe3){while(--_0x4a8fe3){_0x42475f['push'](_0x42475f['shift']());}};_0x29d6fb(++_0x231ca8);}(_0xd377,0x150));var _0x7d37=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd377[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7d37('0x0'));var util=require(_0x7d37('0x1'));var path=require(_0x7d37('0x2'));var timeout=require(_0x7d37('0x3'));var express=require(_0x7d37('0x4'));var router=express[_0x7d37('0x5')]();var fs_extra=require(_0x7d37('0x6'));var auth=require(_0x7d37('0x7'));var interaction=require(_0x7d37('0x8'));var config=require(_0x7d37('0x9'));var controller=require(_0x7d37('0xa'));router[_0x7d37('0xb')]('/',auth['isAuthenticated'](),controller[_0x7d37('0xc')]);router[_0x7d37('0xb')](_0x7d37('0xd'),auth[_0x7d37('0xe')](),controller['show']);router[_0x7d37('0xf')]('/',auth[_0x7d37('0xe')](),controller['create']);router[_0x7d37('0x10')](_0x7d37('0xd'),auth[_0x7d37('0xe')](),controller['update']);router[_0x7d37('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7d37('0x12')]=router;
\ No newline at end of file
+var _0x2220=['path','express','Router','fs-extra','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','util'];(function(_0x553dca,_0x3dcc0c){var _0x4ecbdf=function(_0x21e89b){while(--_0x21e89b){_0x553dca['push'](_0x553dca['shift']());}};_0x4ecbdf(++_0x3dcc0c);}(_0x2220,0xdf));var _0x0222=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x2220[_0x5f3f88];return _0xd08119;};'use strict';var multer=require('multer');var util=require(_0x0222('0x0'));var path=require(_0x0222('0x1'));var timeout=require('connect-timeout');var express=require(_0x0222('0x2'));var router=express[_0x0222('0x3')]();var fs_extra=require(_0x0222('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x0222('0x5')]('/',auth[_0x0222('0x6')](),controller[_0x0222('0x7')]);router[_0x0222('0x5')]('/:id',auth[_0x0222('0x6')](),controller[_0x0222('0x8')]);router[_0x0222('0x9')]('/',auth[_0x0222('0x6')](),controller['create']);router[_0x0222('0xa')](_0x0222('0xb'),auth[_0x0222('0x6')](),controller['update']);router[_0x0222('0xc')]('/:id',auth[_0x0222('0x6')](),controller[_0x0222('0xd')]);module['exports']=router;
\ No newline at end of file
index 9d27808..28c3deb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ef8=['exports','STRING','sequelize'];(function(_0xe0e3d0,_0x3eabd9){var _0x4a7f63=function(_0x15754d){while(--_0x15754d){_0xe0e3d0['push'](_0xe0e3d0['shift']());}};_0x4a7f63(++_0x3eabd9);}(_0x9ef8,0x17f));var _0x89ef=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x9ef8[_0x5c6244];return _0x5800ce;};'use strict';var Sequelize=require(_0x89ef('0x0'));module[_0x89ef('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x89ef('0x2')]},'type':{'type':Sequelize[_0x89ef('0x2')]}};
\ No newline at end of file
+var _0x2cc1=['STRING','sequelize','exports'];(function(_0x5a4e76,_0x11f33f){var _0x38b339=function(_0x41bfac){while(--_0x41bfac){_0x5a4e76['push'](_0x5a4e76['shift']());}};_0x38b339(++_0x11f33f);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x31f5ce,_0x379d01){_0x31f5ce=_0x31f5ce-0x0;var _0x156662=_0x2cc1[_0x31f5ce];return _0x156662;};'use strict';var Sequelize=require(_0x12cc('0x0'));module[_0x12cc('0x1')]={'name':{'type':Sequelize[_0x12cc('0x2')]},'basename':{'type':Sequelize[_0x12cc('0x2')]},'type':{'type':Sequelize[_0x12cc('0x2')]}};
\ No newline at end of file
index 3f2f97f..aa1ab11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8508=['findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','count','limit','save','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','VIRTUAL','options','includeAll','include','Attachment','findAll','rows','catch','show','find','clone','params','rawAttributes','merge','get','omit','createdAt','body','updatedAt','create','file','originalname','basename','filename','mimetype','download'];(function(_0x394f83,_0xbdc65){var _0x533e74=function(_0x6101e0){while(--_0x6101e0){_0x394f83['push'](_0x394f83['shift']());}};_0x533e74(++_0xbdc65);}(_0x8508,0x165));var _0x8850=function(_0x20dcb9,_0x1018ab){_0x20dcb9=_0x20dcb9-0x0;var _0x3267b1=_0x8508[_0x20dcb9];return _0x3267b1;};'use strict';var emlformat=require(_0x8850('0x0'));var rimraf=require(_0x8850('0x1'));var zipdir=require(_0x8850('0x2'));var jsonpatch=require(_0x8850('0x3'));var rp=require(_0x8850('0x4'));var moment=require(_0x8850('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8850('0x6'));var path=require(_0x8850('0x7'));var sox=require(_0x8850('0x8'));var csv=require(_0x8850('0x9'));var ejs=require(_0x8850('0xa'));var fs=require('fs');var fs_extra=require(_0x8850('0xb'));var _=require(_0x8850('0xc'));var squel=require(_0x8850('0xd'));var crypto=require('crypto');var jsforce=require(_0x8850('0xe'));var deskjs=require(_0x8850('0xf'));var toCsv=require(_0x8850('0x9'));var querystring=require(_0x8850('0x10'));var Papa=require(_0x8850('0x11'));var Redis=require(_0x8850('0x12'));var authService=require(_0x8850('0x13'));var qs=require(_0x8850('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8850('0x15'));var logger=require(_0x8850('0x16'))(_0x8850('0x17'));var utils=require(_0x8850('0x18'));var config=require(_0x8850('0x19'));var licenseUtil=require(_0x8850('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f802,_0x4cfef7){_0x4cfef7=_0x4cfef7||0xcc;return function(_0x467301){if(_0x467301){return _0x14f802['sendStatus'](_0x4cfef7);}return _0x14f802['status'](_0x4cfef7)[_0x8850('0x1b')]();};}function respondWithResult(_0x433fa2,_0x10b63a){_0x10b63a=_0x10b63a||0xc8;return function(_0x511559){if(_0x511559){return _0x433fa2[_0x8850('0x1c')](_0x10b63a)[_0x8850('0x1d')](_0x511559);}};}function respondWithFilteredResult(_0x3e94c6,_0x2a4575){return function(_0x52df25){if(_0x52df25){var _0x4f9459=typeof _0x2a4575[_0x8850('0x1e')]==='undefined'&&typeof _0x2a4575['limit']==='undefined';var _0x52f1b5=_0x52df25[_0x8850('0x1f')];var _0x2b065f=_0x4f9459?0x0:_0x2a4575[_0x8850('0x1e')];var _0x3b3db7=_0x4f9459?_0x52df25[_0x8850('0x1f')]:_0x2a4575[_0x8850('0x1e')]+_0x2a4575[_0x8850('0x20')];var _0xa08d92;if(_0x3b3db7>=_0x52f1b5){_0x3b3db7=_0x52f1b5;_0xa08d92=0xc8;}else{_0xa08d92=0xce;}_0x3e94c6[_0x8850('0x1c')](_0xa08d92);return _0x3e94c6['set']('Content-Range',_0x2b065f+'-'+_0x3b3db7+'/'+_0x52f1b5)['json'](_0x52df25);}return null;};}function patchUpdates(_0x4cdf9b){return function(_0x37cd01){try{jsonpatch['apply'](_0x37cd01,_0x4cdf9b,!![]);}catch(_0x5a97ff){return BPromise['reject'](_0x5a97ff);}return _0x37cd01[_0x8850('0x21')]();};}function saveUpdates(_0x5615f7,_0x47ccb0){return function(_0x3aa1bd){if(_0x3aa1bd){return _0x3aa1bd[_0x8850('0x22')](_0x5615f7)[_0x8850('0x23')](function(_0x4f2d2f){return _0x4f2d2f;});}return null;};}function removeEntity(_0x41fa30,_0x356d27){return function(_0x3e1f3e){if(_0x3e1f3e){return _0x3e1f3e[_0x8850('0x24')]()['then'](function(){_0x41fa30[_0x8850('0x1c')](0xcc)[_0x8850('0x1b')]();});}};}function handleEntityNotFound(_0x5a4fbe,_0xd91635){return function(_0x120a18){if(!_0x120a18){_0x5a4fbe[_0x8850('0x25')](0x194);}return _0x120a18;};}function handleError(_0x4c415f,_0x56045f){_0x56045f=_0x56045f||0x1f4;return function(_0x353792){logger[_0x8850('0x26')](_0x353792['stack']);if(_0x353792[_0x8850('0x27')]){delete _0x353792[_0x8850('0x27')];}_0x4c415f['status'](_0x56045f)[_0x8850('0x28')](_0x353792);};}exports[_0x8850('0x29')]=function(_0x344f8b,_0x246ae6){var _0xf8d9a3={},_0x29fbf9={},_0x4d9ca3={'count':0x0,'rows':[]};var _0x4d11c3=_[_0x8850('0x2a')](db['Attachment']['rawAttributes'],function(_0x27b1e4){return{'name':_0x27b1e4[_0x8850('0x2b')],'type':_0x27b1e4[_0x8850('0x2c')][_0x8850('0x2d')]};});_0x29fbf9[_0x8850('0x2e')]=_[_0x8850('0x2a')](_0x4d11c3,_0x8850('0x27'));_0x29fbf9[_0x8850('0x2f')]=_[_0x8850('0x30')](_0x344f8b[_0x8850('0x2f')]);_0x29fbf9['filters']=_[_0x8850('0x31')](_0x29fbf9[_0x8850('0x2e')],_0x29fbf9[_0x8850('0x2f')]);_0xf8d9a3[_0x8850('0x32')]=_[_0x8850('0x31')](_0x29fbf9['model'],qs[_0x8850('0x33')](_0x344f8b[_0x8850('0x2f')][_0x8850('0x33')]));_0xf8d9a3[_0x8850('0x32')]=_0xf8d9a3[_0x8850('0x32')][_0x8850('0x34')]?_0xf8d9a3[_0x8850('0x32')]:_0x29fbf9[_0x8850('0x2e')];if(!_0x344f8b[_0x8850('0x2f')]['hasOwnProperty'](_0x8850('0x35'))){_0xf8d9a3[_0x8850('0x20')]=qs[_0x8850('0x20')](_0x344f8b[_0x8850('0x2f')][_0x8850('0x20')]);_0xf8d9a3[_0x8850('0x1e')]=qs[_0x8850('0x1e')](_0x344f8b[_0x8850('0x2f')][_0x8850('0x1e')]);}_0xf8d9a3['order']=qs[_0x8850('0x36')](_0x344f8b[_0x8850('0x2f')]['sort']);_0xf8d9a3[_0x8850('0x37')]=qs[_0x8850('0x38')](_['pick'](_0x344f8b[_0x8850('0x2f')],_0x29fbf9['filters']),_0x4d11c3);if(_0x344f8b[_0x8850('0x2f')]['filter']){_0xf8d9a3[_0x8850('0x37')]=_['merge'](_0xf8d9a3[_0x8850('0x37')],{'$or':_[_0x8850('0x2a')](_0x4d11c3,function(_0x414621){if(_0x414621[_0x8850('0x2c')]!==_0x8850('0x39')){var _0x89fa8e={};_0x89fa8e[_0x414621['name']]={'$like':'%'+_0x344f8b['query']['filter']+'%'};return _0x89fa8e;}})});}_0xf8d9a3=_['merge']({},_0xf8d9a3,_0x344f8b[_0x8850('0x3a')]);var _0x4e3857={'where':_0xf8d9a3[_0x8850('0x37')]};return db['Attachment'][_0x8850('0x1f')](_0x4e3857)[_0x8850('0x23')](function(_0x1c1e05){_0x4d9ca3['count']=_0x1c1e05;if(_0x344f8b['query'][_0x8850('0x3b')]){_0xf8d9a3[_0x8850('0x3c')]=[{'all':!![]}];}return db[_0x8850('0x3d')][_0x8850('0x3e')](_0xf8d9a3);})[_0x8850('0x23')](function(_0x15477f){_0x4d9ca3[_0x8850('0x3f')]=_0x15477f;return _0x4d9ca3;})[_0x8850('0x23')](respondWithFilteredResult(_0x246ae6,_0xf8d9a3))[_0x8850('0x40')](handleError(_0x246ae6,null));};exports[_0x8850('0x41')]=function(_0x30880e,_0x49f243){var _0x5780ad={'raw':!![],'where':{'id':_0x30880e['params']['id']}},_0x418170={};_0x418170[_0x8850('0x2e')]=_[_0x8850('0x30')](db[_0x8850('0x3d')]['rawAttributes']);_0x418170[_0x8850('0x2f')]=_['keys'](_0x30880e[_0x8850('0x2f')]);_0x418170[_0x8850('0x38')]=_[_0x8850('0x31')](_0x418170[_0x8850('0x2e')],_0x418170[_0x8850('0x2f')]);_0x5780ad['attributes']=_[_0x8850('0x31')](_0x418170[_0x8850('0x2e')],qs[_0x8850('0x33')](_0x30880e['query'][_0x8850('0x33')]));_0x5780ad[_0x8850('0x32')]=_0x5780ad[_0x8850('0x32')][_0x8850('0x34')]?_0x5780ad[_0x8850('0x32')]:_0x418170[_0x8850('0x2e')];if(_0x30880e[_0x8850('0x2f')]['includeAll']){_0x5780ad[_0x8850('0x3c')]=[{'all':!![]}];}_0x5780ad=_['merge']({},_0x5780ad,_0x30880e['options']);return db[_0x8850('0x3d')][_0x8850('0x42')](_0x5780ad)[_0x8850('0x23')](handleEntityNotFound(_0x49f243,null))[_0x8850('0x23')](respondWithResult(_0x49f243,null))[_0x8850('0x40')](handleError(_0x49f243,null));};exports[_0x8850('0x43')]=function(_0x491b2e,_0x49d189){var _0x174b17={'where':{'id':_0x491b2e[_0x8850('0x44')]['id']}},_0x37133c={};_0x37133c[_0x8850('0x2e')]=_['keys'](db[_0x8850('0x3d')][_0x8850('0x45')]);_0x174b17[_0x8850('0x32')]=_[_0x8850('0x31')](_0x37133c[_0x8850('0x2e')],qs[_0x8850('0x33')](_0x491b2e[_0x8850('0x2f')][_0x8850('0x33')]));_0x174b17[_0x8850('0x32')]=_0x174b17[_0x8850('0x32')][_0x8850('0x34')]?_0x174b17[_0x8850('0x32')]:_0x37133c[_0x8850('0x2e')];if(_0x491b2e[_0x8850('0x2f')][_0x8850('0x3b')]){_0x174b17[_0x8850('0x3c')]=[{'all':!![]}];}_0x174b17=_[_0x8850('0x46')]({},_0x174b17,_0x491b2e[_0x8850('0x3a')]);return db['Attachment'][_0x8850('0x42')](_0x174b17)[_0x8850('0x23')](handleEntityNotFound(_0x49d189,null))[_0x8850('0x23')](function(_0xbb5c9d){if(_0xbb5c9d){var _0x273190=_0xbb5c9d[_0x8850('0x47')]({'plain':!![]});_0x273190=qs[_0x8850('0x48')](_0x273190,['id',_0x8850('0x49'),'updatedAt']);_0x491b2e[_0x8850('0x4a')]=_[_0x8850('0x48')](_0x491b2e[_0x8850('0x4a')],['id',_0x8850('0x49'),_0x8850('0x4b')]);return db[_0x8850('0x3d')]['create'](_['merge'](_0x273190,_0x491b2e[_0x8850('0x4a')]),{'include':_0x491b2e[_0x8850('0x2f')][_0x8850('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x49d189,0xc9))['catch'](handleError(_0x49d189,null));};exports[_0x8850('0x22')]=function(_0x3eb4dd,_0x190cba){if(_0x3eb4dd[_0x8850('0x4a')]['id']){delete _0x3eb4dd[_0x8850('0x4a')]['id'];}return db[_0x8850('0x3d')][_0x8850('0x42')]({'where':{'id':_0x3eb4dd['params']['id']}})['then'](handleEntityNotFound(_0x190cba,null))[_0x8850('0x23')](saveUpdates(_0x3eb4dd[_0x8850('0x4a')],null))[_0x8850('0x23')](respondWithResult(_0x190cba,null))[_0x8850('0x40')](handleError(_0x190cba,null));};exports[_0x8850('0x24')]=function(_0x1d1616,_0x3bc92f){return db[_0x8850('0x3d')][_0x8850('0x42')]({'where':{'id':_0x1d1616[_0x8850('0x44')]['id']}})[_0x8850('0x23')](handleEntityNotFound(_0x3bc92f,null))['then'](removeEntity(_0x3bc92f,null))[_0x8850('0x40')](handleError(_0x3bc92f,null));};exports[_0x8850('0x4c')]=function(_0x32ea7c,_0x3d7839,_0xb1b154){_0x32ea7c[_0x8850('0x4a')][_0x8850('0x27')]=_0x32ea7c[_0x8850('0x4d')][_0x8850('0x4e')];_0x32ea7c['body'][_0x8850('0x4f')]=_0x32ea7c['file'][_0x8850('0x50')];_0x32ea7c[_0x8850('0x4a')][_0x8850('0x2c')]=_0x32ea7c[_0x8850('0x4d')][_0x8850('0x51')];return db[_0x8850('0x3d')][_0x8850('0x4c')](_0x32ea7c['body'])[_0x8850('0x23')](respondWithResult(_0x3d7839,0xc9))[_0x8850('0x40')](handleError(_0x3d7839,null));};exports[_0x8850('0x52')]=function(_0x143624,_0x348c94,_0x134d9){return db['Attachment'][_0x8850('0x53')]({'where':{'id':_0x143624['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x348c94,null))[_0x8850('0x23')](function(_0xe01287){if(_0xe01287){var _0x14c492=_0xe01287[_0x8850('0x54')]!==null;var _0x18681d=path[_0x8850('0x55')](config['root'],_0x8850('0x56'));if(_0x14c492){_0x18681d=path['join'](_0x18681d,_0x8850('0x57'));}var _0x105e34=path['join'](_0x18681d,_0xe01287[_0x8850('0x4f')]);return _0x348c94[_0x8850('0x52')](_0x105e34);}})[_0x8850('0x40')](handleError(_0x348c94,null));};
\ No newline at end of file
+var _0x490c=['clone','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0x490c,0x11c));var _0xc490=function(_0x58f245,_0x3e4f31){_0x58f245=_0x58f245-0x0;var _0x1f0cfb=_0x490c[_0x58f245];return _0x1f0cfb;};'use strict';var emlformat=require(_0xc490('0x0'));var rimraf=require(_0xc490('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc490('0x2'));var rp=require(_0xc490('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc490('0x4'));var util=require(_0xc490('0x5'));var path=require('path');var sox=require(_0xc490('0x6'));var csv=require(_0xc490('0x7'));var ejs=require(_0xc490('0x8'));var fs=require('fs');var fs_extra=require(_0xc490('0x9'));var _=require(_0xc490('0xa'));var squel=require(_0xc490('0xb'));var crypto=require(_0xc490('0xc'));var jsforce=require(_0xc490('0xd'));var deskjs=require(_0xc490('0xe'));var toCsv=require(_0xc490('0x7'));var querystring=require(_0xc490('0xf'));var Papa=require('papaparse');var Redis=require(_0xc490('0x10'));var authService=require(_0xc490('0x11'));var qs=require(_0xc490('0x12'));var as=require(_0xc490('0x13'));var hardwareService=require(_0xc490('0x14'));var logger=require('../../config/logger')(_0xc490('0x15'));var utils=require('../../config/utils');var config=require(_0xc490('0x16'));var licenseUtil=require(_0xc490('0x17'));var db=require(_0xc490('0x18'))['db'];function respondWithStatusCode(_0x13d053,_0x1239c9){_0x1239c9=_0x1239c9||0xcc;return function(_0x19a16a){if(_0x19a16a){return _0x13d053['sendStatus'](_0x1239c9);}return _0x13d053[_0xc490('0x19')](_0x1239c9)[_0xc490('0x1a')]();};}function respondWithResult(_0x259221,_0x11b794){_0x11b794=_0x11b794||0xc8;return function(_0x572e8e){if(_0x572e8e){return _0x259221[_0xc490('0x19')](_0x11b794)[_0xc490('0x1b')](_0x572e8e);}};}function respondWithFilteredResult(_0x18e5d4,_0x241ff3){return function(_0x35e024){if(_0x35e024){var _0x4a9bbf=typeof _0x241ff3[_0xc490('0x1c')]===_0xc490('0x1d')&&typeof _0x241ff3['limit']===_0xc490('0x1d');var _0x19c66d=_0x35e024[_0xc490('0x1e')];var _0x372dca=_0x4a9bbf?0x0:_0x241ff3['offset'];var _0x2ca73a=_0x4a9bbf?_0x35e024[_0xc490('0x1e')]:_0x241ff3['offset']+_0x241ff3[_0xc490('0x1f')];var _0x5f52b5;if(_0x2ca73a>=_0x19c66d){_0x2ca73a=_0x19c66d;_0x5f52b5=0xc8;}else{_0x5f52b5=0xce;}_0x18e5d4[_0xc490('0x19')](_0x5f52b5);return _0x18e5d4[_0xc490('0x20')](_0xc490('0x21'),_0x372dca+'-'+_0x2ca73a+'/'+_0x19c66d)[_0xc490('0x1b')](_0x35e024);}return null;};}function patchUpdates(_0x4eebc0){return function(_0x4fa1c5){try{jsonpatch[_0xc490('0x22')](_0x4fa1c5,_0x4eebc0,!![]);}catch(_0x54a37f){return BPromise[_0xc490('0x23')](_0x54a37f);}return _0x4fa1c5['save']();};}function saveUpdates(_0x3d5c17,_0x5db2f9){return function(_0x315445){if(_0x315445){return _0x315445[_0xc490('0x24')](_0x3d5c17)[_0xc490('0x25')](function(_0x5e24c1){return _0x5e24c1;});}return null;};}function removeEntity(_0x3b5891,_0x50030d){return function(_0x333030){if(_0x333030){return _0x333030[_0xc490('0x26')]()['then'](function(){_0x3b5891[_0xc490('0x19')](0xcc)[_0xc490('0x1a')]();});}};}function handleEntityNotFound(_0x1146fd,_0x17f80b){return function(_0x3c64c3){if(!_0x3c64c3){_0x1146fd[_0xc490('0x27')](0x194);}return _0x3c64c3;};}function handleError(_0x1bc904,_0x20aa0d){_0x20aa0d=_0x20aa0d||0x1f4;return function(_0x51430a){logger[_0xc490('0x28')](_0x51430a[_0xc490('0x29')]);if(_0x51430a['name']){delete _0x51430a[_0xc490('0x2a')];}_0x1bc904[_0xc490('0x19')](_0x20aa0d)['send'](_0x51430a);};}exports[_0xc490('0x2b')]=function(_0x3ea7a2,_0x25a007){var _0x45cb07={},_0x46c13f={},_0x382ebb={'count':0x0,'rows':[]};var _0x27587b=_[_0xc490('0x2c')](db[_0xc490('0x2d')][_0xc490('0x2e')],function(_0x37f80c){return{'name':_0x37f80c[_0xc490('0x2f')],'type':_0x37f80c[_0xc490('0x30')][_0xc490('0x31')]};});_0x46c13f[_0xc490('0x32')]=_[_0xc490('0x2c')](_0x27587b,_0xc490('0x2a'));_0x46c13f['query']=_[_0xc490('0x33')](_0x3ea7a2[_0xc490('0x34')]);_0x46c13f['filters']=_['intersection'](_0x46c13f[_0xc490('0x32')],_0x46c13f[_0xc490('0x34')]);_0x45cb07[_0xc490('0x35')]=_[_0xc490('0x36')](_0x46c13f[_0xc490('0x32')],qs[_0xc490('0x37')](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x37')]));_0x45cb07[_0xc490('0x35')]=_0x45cb07[_0xc490('0x35')][_0xc490('0x38')]?_0x45cb07['attributes']:_0x46c13f['model'];if(!_0x3ea7a2[_0xc490('0x34')][_0xc490('0x39')]('nolimit')){_0x45cb07[_0xc490('0x1f')]=qs['limit'](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x1f')]);_0x45cb07[_0xc490('0x1c')]=qs['offset'](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x1c')]);}_0x45cb07[_0xc490('0x3a')]=qs[_0xc490('0x3b')](_0x3ea7a2[_0xc490('0x34')][_0xc490('0x3b')]);_0x45cb07[_0xc490('0x3c')]=qs[_0xc490('0x3d')](_['pick'](_0x3ea7a2[_0xc490('0x34')],_0x46c13f[_0xc490('0x3d')]),_0x27587b);if(_0x3ea7a2[_0xc490('0x34')][_0xc490('0x3e')]){_0x45cb07[_0xc490('0x3c')]=_[_0xc490('0x3f')](_0x45cb07[_0xc490('0x3c')],{'$or':_[_0xc490('0x2c')](_0x27587b,function(_0x4516f3){if(_0x4516f3['type']!==_0xc490('0x40')){var _0x5930a7={};_0x5930a7[_0x4516f3[_0xc490('0x2a')]]={'$like':'%'+_0x3ea7a2['query'][_0xc490('0x3e')]+'%'};return _0x5930a7;}})});}_0x45cb07=_[_0xc490('0x3f')]({},_0x45cb07,_0x3ea7a2[_0xc490('0x41')]);var _0x5ac065={'where':_0x45cb07[_0xc490('0x3c')]};return db[_0xc490('0x2d')][_0xc490('0x1e')](_0x5ac065)[_0xc490('0x25')](function(_0x381d0f){_0x382ebb[_0xc490('0x1e')]=_0x381d0f;if(_0x3ea7a2[_0xc490('0x34')][_0xc490('0x42')]){_0x45cb07['include']=[{'all':!![]}];}return db[_0xc490('0x2d')]['findAll'](_0x45cb07);})[_0xc490('0x25')](function(_0x48ba3f){_0x382ebb[_0xc490('0x43')]=_0x48ba3f;return _0x382ebb;})[_0xc490('0x25')](respondWithFilteredResult(_0x25a007,_0x45cb07))[_0xc490('0x44')](handleError(_0x25a007,null));};exports['show']=function(_0x1b9637,_0x93ebbe){var _0x588fce={'raw':!![],'where':{'id':_0x1b9637[_0xc490('0x45')]['id']}},_0xd8c8ed={};_0xd8c8ed['model']=_[_0xc490('0x33')](db[_0xc490('0x2d')]['rawAttributes']);_0xd8c8ed['query']=_[_0xc490('0x33')](_0x1b9637['query']);_0xd8c8ed[_0xc490('0x3d')]=_[_0xc490('0x36')](_0xd8c8ed[_0xc490('0x32')],_0xd8c8ed[_0xc490('0x34')]);_0x588fce[_0xc490('0x35')]=_[_0xc490('0x36')](_0xd8c8ed[_0xc490('0x32')],qs[_0xc490('0x37')](_0x1b9637['query']['fields']));_0x588fce[_0xc490('0x35')]=_0x588fce[_0xc490('0x35')][_0xc490('0x38')]?_0x588fce['attributes']:_0xd8c8ed[_0xc490('0x32')];if(_0x1b9637[_0xc490('0x34')][_0xc490('0x42')]){_0x588fce[_0xc490('0x46')]=[{'all':!![]}];}_0x588fce=_['merge']({},_0x588fce,_0x1b9637[_0xc490('0x41')]);return db[_0xc490('0x2d')][_0xc490('0x47')](_0x588fce)['then'](handleEntityNotFound(_0x93ebbe,null))[_0xc490('0x25')](respondWithResult(_0x93ebbe,null))[_0xc490('0x44')](handleError(_0x93ebbe,null));};exports[_0xc490('0x48')]=function(_0x1777e0,_0x31d7c4){var _0x232df8={'where':{'id':_0x1777e0[_0xc490('0x45')]['id']}},_0x3025ea={};_0x3025ea[_0xc490('0x32')]=_[_0xc490('0x33')](db[_0xc490('0x2d')][_0xc490('0x2e')]);_0x232df8['attributes']=_[_0xc490('0x36')](_0x3025ea[_0xc490('0x32')],qs[_0xc490('0x37')](_0x1777e0[_0xc490('0x34')][_0xc490('0x37')]));_0x232df8[_0xc490('0x35')]=_0x232df8['attributes'][_0xc490('0x38')]?_0x232df8[_0xc490('0x35')]:_0x3025ea['model'];if(_0x1777e0[_0xc490('0x34')][_0xc490('0x42')]){_0x232df8[_0xc490('0x46')]=[{'all':!![]}];}_0x232df8=_['merge']({},_0x232df8,_0x1777e0[_0xc490('0x41')]);return db[_0xc490('0x2d')]['find'](_0x232df8)[_0xc490('0x25')](handleEntityNotFound(_0x31d7c4,null))['then'](function(_0x2bc600){if(_0x2bc600){var _0x26523a=_0x2bc600[_0xc490('0x49')]({'plain':!![]});_0x26523a=qs['omit'](_0x26523a,['id',_0xc490('0x4a'),_0xc490('0x4b')]);_0x1777e0[_0xc490('0x4c')]=_[_0xc490('0x4d')](_0x1777e0['body'],['id',_0xc490('0x4a'),_0xc490('0x4b')]);return db['Attachment'][_0xc490('0x4e')](_[_0xc490('0x3f')](_0x26523a,_0x1777e0[_0xc490('0x4c')]),{'include':_0x1777e0[_0xc490('0x34')][_0xc490('0x42')]?[{'all':!![]}]:undefined});}})[_0xc490('0x25')](respondWithResult(_0x31d7c4,0xc9))[_0xc490('0x44')](handleError(_0x31d7c4,null));};exports[_0xc490('0x24')]=function(_0x1d1432,_0xb71699){if(_0x1d1432[_0xc490('0x4c')]['id']){delete _0x1d1432[_0xc490('0x4c')]['id'];}return db[_0xc490('0x2d')]['find']({'where':{'id':_0x1d1432['params']['id']}})[_0xc490('0x25')](handleEntityNotFound(_0xb71699,null))[_0xc490('0x25')](saveUpdates(_0x1d1432['body'],null))['then'](respondWithResult(_0xb71699,null))[_0xc490('0x44')](handleError(_0xb71699,null));};exports[_0xc490('0x26')]=function(_0x3b09ae,_0x51ba3e){return db[_0xc490('0x2d')][_0xc490('0x47')]({'where':{'id':_0x3b09ae[_0xc490('0x45')]['id']}})[_0xc490('0x25')](handleEntityNotFound(_0x51ba3e,null))[_0xc490('0x25')](removeEntity(_0x51ba3e,null))[_0xc490('0x44')](handleError(_0x51ba3e,null));};exports[_0xc490('0x4e')]=function(_0x275937,_0x735f56,_0x358ad4){_0x275937[_0xc490('0x4c')][_0xc490('0x2a')]=_0x275937[_0xc490('0x4f')][_0xc490('0x50')];_0x275937[_0xc490('0x4c')][_0xc490('0x51')]=_0x275937[_0xc490('0x4f')][_0xc490('0x52')];_0x275937['body'][_0xc490('0x30')]=_0x275937['file']['mimetype'];return db['Attachment'][_0xc490('0x4e')](_0x275937[_0xc490('0x4c')])[_0xc490('0x25')](respondWithResult(_0x735f56,0xc9))[_0xc490('0x44')](handleError(_0x735f56,null));};exports[_0xc490('0x53')]=function(_0x1c8f8a,_0x3150a4,_0x2d9a07){return db[_0xc490('0x2d')][_0xc490('0x54')]({'where':{'id':_0x1c8f8a[_0xc490('0x45')]['id']},'raw':!![]})[_0xc490('0x25')](handleEntityNotFound(_0x3150a4,null))[_0xc490('0x25')](function(_0x35aa66){if(_0x35aa66){var _0x426998=_0x35aa66[_0xc490('0x55')]!==null;var _0x1d6fdd=path[_0xc490('0x56')](config[_0xc490('0x57')],_0xc490('0x58'));if(_0x426998){_0x1d6fdd=path[_0xc490('0x56')](_0x1d6fdd,'offline-chat/');}var _0x5b72ac=path['join'](_0x1d6fdd,_0x35aa66[_0xc490('0x51')]);return _0x3150a4['download'](_0x5b72ac);}})[_0xc490('0x44')](handleError(_0x3150a4,null));};
\ No newline at end of file
index 06d0577..49a5534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7939=['Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./attachment.attributes','define'];(function(_0x194e91,_0x42d67f){var _0x39a718=function(_0x598b6f){while(--_0x598b6f){_0x194e91['push'](_0x194e91['shift']());}};_0x39a718(++_0x42d67f);}(_0x7939,0x65));var _0x9793=function(_0x684285,_0x4f2315){_0x684285=_0x684285-0x0;var _0x215e4c=_0x7939[_0x684285];return _0x215e4c;};'use strict';var _=require(_0x9793('0x0'));var util=require(_0x9793('0x1'));var logger=require(_0x9793('0x2'))('api');var moment=require(_0x9793('0x3'));var BPromise=require(_0x9793('0x4'));var rp=require(_0x9793('0x5'));var fs=require('fs');var path=require(_0x9793('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9793('0x7'));module['exports']=function(_0xe5d727,_0x34d8ea){return _0xe5d727[_0x9793('0x8')](_0x9793('0x9'),attributes,{'tableName':_0x9793('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x233b=['rimraf','../../config/environment','./attachment.attributes','exports','define','../../config/logger','api','moment','bluebird','path'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x233b,0x1a9));var _0xb233=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x233b[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb233('0x0'))(_0xb233('0x1'));var moment=require(_0xb233('0x2'));var BPromise=require(_0xb233('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb233('0x4'));var rimraf=require(_0xb233('0x5'));var config=require(_0xb233('0x6'));var attributes=require(_0xb233('0x7'));module[_0xb233('0x8')]=function(_0x45fdc9,_0x49a7fa){return _0x45fdc9[_0xb233('0x9')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 631b5fd..f430c54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa7c=['debug','stringify','error','code','message','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x34e36e,_0x331372){var _0x3d2b23=function(_0x222ceb){while(--_0x222ceb){_0x34e36e['push'](_0x34e36e['shift']());}};_0x3d2b23(++_0x331372);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x53bf95,_0xee0a50){_0x53bf95=_0x53bf95-0x0;var _0xead38f=_0xaa7c[_0x53bf95];return _0xead38f;};'use strict';var _=require(_0xcaa7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcaa7('0x1'));var db=require(_0xcaa7('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xcaa7('0x3'))(_0xcaa7('0x4'));var config=require(_0xcaa7('0x5'));var jayson=require(_0xcaa7('0x6'));var client=jayson[_0xcaa7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b9df0,_0x5bd940,_0x55f6a4){return new BPromise(function(_0x4e4fc1,_0x126043){return client[_0xcaa7('0x8')](_0x4b9df0,_0x55f6a4)['then'](function(_0x20cd40){logger[_0xcaa7('0x9')](_0xcaa7('0xa'),_0x5bd940,_0xcaa7('0xb'));logger[_0xcaa7('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5bd940,_0xcaa7('0xb'),JSON[_0xcaa7('0xd')](_0x20cd40));if(_0x20cd40[_0xcaa7('0xe')]){if(_0x20cd40[_0xcaa7('0xe')][_0xcaa7('0xf')]===0x1f4){logger[_0xcaa7('0xe')]('Attachment,\x20%s,\x20%s',_0x5bd940,_0x20cd40[_0xcaa7('0xe')][_0xcaa7('0x10')]);return _0x126043(_0x20cd40[_0xcaa7('0xe')][_0xcaa7('0x10')]);}logger[_0xcaa7('0xe')](_0xcaa7('0xa'),_0x5bd940,_0x20cd40[_0xcaa7('0xe')]['message']);return _0x4e4fc1(_0x20cd40['error'][_0xcaa7('0x10')]);}else{logger[_0xcaa7('0x9')](_0xcaa7('0xa'),_0x5bd940,_0xcaa7('0xb'));_0x4e4fc1(_0x20cd40['result'][_0xcaa7('0x10')]);}})[_0xcaa7('0x11')](function(_0x23c8f3){logger[_0xcaa7('0xe')](_0xcaa7('0xa'),_0x5bd940,_0x23c8f3);_0x126043(_0x23c8f3);});});}exports[_0xcaa7('0x12')]=function(_0x20ede0){var _0x5c2a74=this;return new Promise(function(_0x53e1cb,_0x4309e0){return db[_0xcaa7('0x13')][_0xcaa7('0x14')](_0x20ede0[_0xcaa7('0x15')],{'raw':_0x20ede0[_0xcaa7('0x16')]?_0x20ede0[_0xcaa7('0x16')][_0xcaa7('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x89e8a0){logger[_0xcaa7('0x9')](_0xcaa7('0x12'),_0x20ede0);logger[_0xcaa7('0xc')](_0xcaa7('0x12'),_0x20ede0,JSON[_0xcaa7('0xd')](_0x89e8a0));_0x53e1cb(_0x89e8a0);})[_0xcaa7('0x11')](function(_0x4259b7){logger[_0xcaa7('0xe')](_0xcaa7('0x12'),_0x4259b7[_0xcaa7('0x10')],_0x20ede0);_0x4309e0(_0x5c2a74[_0xcaa7('0xe')](0x1f4,_0x4259b7[_0xcaa7('0x10')]));});});};
\ No newline at end of file
+var _0x032a=['result','catch','CreateAttachment','Attachment','create','options','raw','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x32a884,_0x183853){var _0x242f9b=function(_0x556c63){while(--_0x556c63){_0x32a884['push'](_0x32a884['shift']());}};_0x242f9b(++_0x183853);}(_0x032a,0xf0));var _0xa032=function(_0x50e7e0,_0x5affce){_0x50e7e0=_0x50e7e0-0x0;var _0x1a0307=_0x032a[_0x50e7e0];return _0x1a0307;};'use strict';var _=require('lodash');var util=require(_0xa032('0x0'));var moment=require('moment');var BPromise=require(_0xa032('0x1'));var rs=require(_0xa032('0x2'));var fs=require('fs');var Redis=require(_0xa032('0x3'));var db=require(_0xa032('0x4'))['db'];var utils=require(_0xa032('0x5'));var logger=require(_0xa032('0x6'))(_0xa032('0x7'));var config=require(_0xa032('0x8'));var jayson=require(_0xa032('0x9'));var client=jayson[_0xa032('0xa')][_0xa032('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40128a,_0x54275c,_0x616437){return new BPromise(function(_0x4a5d8e,_0x5d0744){return client[_0xa032('0xc')](_0x40128a,_0x616437)['then'](function(_0x18283a){logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,_0xa032('0xf'));logger[_0xa032('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x54275c,_0xa032('0xf'),JSON[_0xa032('0x11')](_0x18283a));if(_0x18283a['error']){if(_0x18283a[_0xa032('0x12')][_0xa032('0x13')]===0x1f4){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')]['message']);return _0x5d0744(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);return _0x4a5d8e(_0x18283a[_0xa032('0x12')][_0xa032('0x14')]);}else{logger[_0xa032('0xd')](_0xa032('0xe'),_0x54275c,'request\x20sent');_0x4a5d8e(_0x18283a[_0xa032('0x15')][_0xa032('0x14')]);}})[_0xa032('0x16')](function(_0x2caacd){logger[_0xa032('0x12')](_0xa032('0xe'),_0x54275c,_0x2caacd);_0x5d0744(_0x2caacd);});});}exports[_0xa032('0x17')]=function(_0x577406){var _0xff6817=this;return new Promise(function(_0x54fba7,_0x1d8cf4){return db[_0xa032('0x18')][_0xa032('0x19')](_0x577406['body'],{'raw':_0x577406[_0xa032('0x1a')]?_0x577406['options'][_0xa032('0x1b')]===undefined?!![]:![]:!![]})[_0xa032('0x1c')](function(_0x471757){logger[_0xa032('0xd')](_0xa032('0x17'),_0x577406);logger[_0xa032('0x10')]('CreateAttachment',_0x577406,JSON[_0xa032('0x11')](_0x471757));_0x54fba7(_0x471757);})[_0xa032('0x16')](function(_0x5a817b){logger[_0xa032('0x12')]('CreateAttachment',_0x5a817b[_0xa032('0x14')],_0x577406);_0x1d8cf4(_0xff6817['error'](0x1f4,_0x5a817b[_0xa032('0x14')]));});});};
\ No newline at end of file
index 8aee56f..54e5ff7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x14728d,_0x5c08df){var _0x39216f=function(_0x72c010){while(--_0x72c010){_0x14728d['push'](_0x14728d['shift']());}};_0x39216f(++_0x5c08df);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c37a5,_0x59ee51){_0x1c37a5=_0x1c37a5-0x0;var _0x389d03=_0xb10b[_0x1c37a5];return _0x389d03;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x30e43f,_0x418ef7){var _0x571e18=function(_0x41d3df){while(--_0x41d3df){_0x30e43f['push'](_0x30e43f['shift']());}};_0x571e18(++_0x418ef7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1c802c,_0x177ac9){_0x1c802c=_0x1c802c-0x0;var _0x1e53da=_0x5f2f[_0x1c802c];return _0x1e53da;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
index 3d4a3f6..fe4a83c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf6d=['then','map','emails','value','admin','user','agent','blockedAt','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','authenticate','clientID','clientSecret','secret','callbackURL','Setting','blockDuration'];(function(_0x14996e,_0x108636){var _0x2f0151=function(_0x20dd91){while(--_0x20dd91){_0x14996e['push'](_0x14996e['shift']());}};_0x2f0151(++_0x108636);}(_0xbf6d,0x161));var _0xdbf6=function(_0x5b9d3a,_0x1f1842){_0x5b9d3a=_0x5b9d3a-0x0;var _0x383375=_0xbf6d[_0x5b9d3a];return _0x383375;};'use strict';var _=require('lodash');var passport=require(_0xdbf6('0x0'));var GoogleStrategy=require(_0xdbf6('0x1'))[_0xdbf6('0x2')];var moment=require(_0xdbf6('0x3'));var db=require(_0xdbf6('0x4'))['db'];var config=require(_0xdbf6('0x5'));var signToken=require(_0xdbf6('0x6'))[_0xdbf6('0x7')];var utils=require(_0xdbf6('0x8'));exports[_0xdbf6('0x9')]=passport['authenticate'](_0xdbf6('0xa'),{'failureRedirect':_0xdbf6('0xb'),'scope':[_0xdbf6('0xc'),_0xdbf6('0xd')],'session':![]});exports['callback']=passport[_0xdbf6('0xe')]('google',{'failureRedirect':_0xdbf6('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0xdbf6('0xa')][_0xdbf6('0xf')]:'id','clientSecret':config[_0xdbf6('0xa')]?config['google'][_0xdbf6('0x10')]:_0xdbf6('0x11'),'callbackURL':config['google']?config[_0xdbf6('0xa')][_0xdbf6('0x12')]:''},function(_0x20c4ef,_0x332fab,_0x53744c,_0x580ff8){var _0x560979,_0x4ed14a;return db[_0xdbf6('0x13')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xdbf6('0x14')],'raw':!![]})[_0xdbf6('0x15')](function(_0x28c4d7){_0x560979=_0x28c4d7;return db['User']['find']({'where':{'email':_[_0xdbf6('0x16')](_0x53744c[_0xdbf6('0x17')],_0xdbf6('0x18')),'role':{'$or':[_0xdbf6('0x19'),_0xdbf6('0x1a'),_0xdbf6('0x1b')]}}});})[_0xdbf6('0x15')](function(_0x574d6b){_0x4ed14a=_0x574d6b;if(_0x4ed14a){if(_0x4ed14a['disabled']){return _0x580ff8('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x560979[_0xdbf6('0x14')]>0x0){if(_0x4ed14a['blocked']){if(moment(_0x4ed14a[_0xdbf6('0x1c')])[_0xdbf6('0x1d')](_0x560979[_0xdbf6('0x14')],'minutes')>moment()){return _0x580ff8(_0xdbf6('0x1e'));}else{return utils[_0xdbf6('0x1f')](_0x4ed14a,0x0,![],null)[_0xdbf6('0x15')](function(){return utils[_0xdbf6('0x20')](_0x4ed14a);})['then'](function(){return _0x580ff8(null,_0x4ed14a);});}}else{return utils['getLicense'](_0x4ed14a)['then'](function(){return _0x580ff8(null,_0x4ed14a);});}}else{return utils[_0xdbf6('0x20')](_0x4ed14a)['then'](function(){return _0x580ff8(null,_0x4ed14a);});}}return _0x580ff8(_0xdbf6('0x1e'));})[_0xdbf6('0x21')](function(_0x43d960){_0x580ff8(_0x43d960);});}));
\ No newline at end of file
+var _0x0983=['email','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','map','emails','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','/login','profile'];(function(_0x21a1a6,_0x1474bf){var _0x5cec0e=function(_0x13abb9){while(--_0x13abb9){_0x21a1a6['push'](_0x21a1a6['shift']());}};_0x5cec0e(++_0x1474bf);}(_0x0983,0x151));var _0x3098=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x0983[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x3098('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x3098('0x1'))[_0x3098('0x2')];var moment=require(_0x3098('0x3'));var db=require(_0x3098('0x4'))['db'];var config=require(_0x3098('0x5'));var signToken=require(_0x3098('0x6'))['signToken'];var utils=require(_0x3098('0x7'));exports[_0x3098('0x8')]=passport[_0x3098('0x9')](_0x3098('0xa'),{'failureRedirect':_0x3098('0xb'),'scope':[_0x3098('0xc'),_0x3098('0xd')],'session':![]});exports['callback']=passport[_0x3098('0x9')]('google',{'failureRedirect':_0x3098('0xb'),'session':![]});passport[_0x3098('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x3098('0xa')][_0x3098('0xf')]:'id','clientSecret':config[_0x3098('0xa')]?config[_0x3098('0xa')]['clientSecret']:_0x3098('0x10'),'callbackURL':config['google']?config[_0x3098('0xa')][_0x3098('0x11')]:''},function(_0x4b3b3c,_0x37a2c4,_0x567748,_0x1d3cf2){var _0x522c66,_0x4ce235;return db[_0x3098('0x12')][_0x3098('0x13')]({'where':{'id':0x1},'attributes':[_0x3098('0x14'),_0x3098('0x15')],'raw':!![]})[_0x3098('0x16')](function(_0x58a6fe){_0x522c66=_0x58a6fe;return db[_0x3098('0x17')]['find']({'where':{'email':_[_0x3098('0x18')](_0x567748[_0x3098('0x19')],'value'),'role':{'$or':['admin',_0x3098('0x1a'),_0x3098('0x1b')]}}});})[_0x3098('0x16')](function(_0x869728){_0x4ce235=_0x869728;if(_0x4ce235){if(_0x4ce235[_0x3098('0x1c')]){return _0x1d3cf2(_0x3098('0x1d'));}else if(_0x522c66[_0x3098('0x15')]>0x0){if(_0x4ce235[_0x3098('0x1e')]){if(moment(_0x4ce235[_0x3098('0x1f')])['add'](_0x522c66['blockDuration'],'minutes')>moment()){return _0x1d3cf2(_0x3098('0x1d'));}else{return utils[_0x3098('0x20')](_0x4ce235,0x0,![],null)[_0x3098('0x16')](function(){return utils[_0x3098('0x21')](_0x4ce235);})[_0x3098('0x16')](function(){return _0x1d3cf2(null,_0x4ce235);});}}else{return utils['getLicense'](_0x4ce235)[_0x3098('0x16')](function(){return _0x1d3cf2(null,_0x4ce235);});}}else{return utils['getLicense'](_0x4ce235)[_0x3098('0x16')](function(){return _0x1d3cf2(null,_0x4ce235);});}}return _0x1d3cf2('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x3098('0x22')](function(_0x16a087){_0x1d3cf2(_0x16a087);});}));
\ No newline at end of file
index 44bf7ca..9feafa2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b1e=['exports','express','passport','./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback','isMiddleware'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x2b1e,0x19b));var _0xe2b1=function(_0x59a4a5,_0x59e4fc){_0x59a4a5=_0x59a4a5-0x0;var _0x5dff0e=_0x2b1e[_0x59a4a5];return _0x5dff0e;};'use strict';var express=require(_0xe2b1('0x0'));var passport=require(_0xe2b1('0x1'));var router=express['Router']();var controller=require(_0xe2b1('0x2'));var userController=require(_0xe2b1('0x3'));var authService=require('../../components/auth/service');router[_0xe2b1('0x4')]('/',controller[_0xe2b1('0x5')]);router[_0xe2b1('0x4')](_0xe2b1('0x6'),controller[_0xe2b1('0x7')],authService[_0xe2b1('0x8')],userController['login'],authService['setTokenCookie']);module[_0xe2b1('0x9')]=router;
\ No newline at end of file
+var _0x1d99=['login','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get'];(function(_0x3553cb,_0x16f3db){var _0x47f419=function(_0x398197){while(--_0x398197){_0x3553cb['push'](_0x3553cb['shift']());}};_0x47f419(++_0x16f3db);}(_0x1d99,0xaa));var _0x91d9=function(_0xe289f7,_0x5f21cb){_0xe289f7=_0xe289f7-0x0;var _0x45314c=_0x1d99[_0xe289f7];return _0x45314c;};'use strict';var express=require(_0x91d9('0x0'));var passport=require(_0x91d9('0x1'));var router=express[_0x91d9('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0x91d9('0x3'));var authService=require(_0x91d9('0x4'));router[_0x91d9('0x5')]('/',controller[_0x91d9('0x6')]);router[_0x91d9('0x5')]('/callback',controller[_0x91d9('0x7')],authService[_0x91d9('0x8')],userController[_0x91d9('0x6')],authService[_0x91d9('0x9')]);module[_0x91d9('0xa')]=router;
\ No newline at end of file
index 3f5dc4a..84e52b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f3a=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','clearBlockUser','add','minutes','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local'];(function(_0x4d2bab,_0x2e701b){var _0x239bdd=function(_0x10eadb){while(--_0x10eadb){_0x4d2bab['push'](_0x4d2bab['shift']());}};_0x239bdd(++_0x2e701b);}(_0x5f3a,0x16d));var _0xa5f3=function(_0x137b48,_0x1c5b32){_0x137b48=_0x137b48-0x0;var _0x57d796=_0x5f3a[_0x137b48];return _0x57d796;};'use strict';var util=require(_0xa5f3('0x0'));var passport=require(_0xa5f3('0x1'));var LocalStrategy=require(_0xa5f3('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xa5f3('0x3'));var rs=require(_0xa5f3('0x4'));var moment=require(_0xa5f3('0x5'));var db=require(_0xa5f3('0x6'))['db'];var authService=require(_0xa5f3('0x7'));var utils=require(_0xa5f3('0x8'));var client=jayson[_0xa5f3('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x3b4c8b,_0xc25bf1,_0x2a1b08,_0x1b73bc){var _0x4ea4b6,_0x4a6896;return db[_0xa5f3('0xa')][_0xa5f3('0xb')]({'where':{'id':0x1},'attributes':[_0xa5f3('0xc'),_0xa5f3('0xd')],'raw':!![]})['then'](function(_0x51cc2b){_0x4ea4b6=_0x51cc2b;return _0x3b4c8b[_0xa5f3('0xb')]({'attributes':['id',_0xa5f3('0xe'),_0xa5f3('0xf'),_0xa5f3('0x10'),_0xa5f3('0x11'),_0xa5f3('0x12'),_0xa5f3('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0xc25bf1,'role':{'$or':['admin',_0xa5f3('0x14'),_0xa5f3('0x15')]}}});})[_0xa5f3('0x16')](function(_0x3af0ec){if(!_0x3af0ec||_0x3af0ec&&_0x3af0ec['name']!==_0xc25bf1){throw new Error(_0xa5f3('0x17'));}else{_0x4a6896=_0x3af0ec;return _0x4a6896;}})[_0xa5f3('0x16')](function(){_0x4a6896[_0xa5f3('0x18')](_0x2a1b08,function(_0x3fc084,_0x276c5b){var _0x220abb=_0x4a6896['loginAttempts']+0x1;if(_0x3fc084){return _0x1b73bc(_0x3fc084);}else if(!_0x276c5b){if(_0x4a6896[_0xa5f3('0x12')]){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4ea4b6[_0xa5f3('0xc')]>0x0){if(_0x4a6896['blocked']){if(_0x4ea4b6[_0xa5f3('0xd')]>0x0){if(moment(_0x4a6896[_0xa5f3('0x19')])['add'](_0x4ea4b6[_0xa5f3('0xd')],'minutes')>moment()){return _0x1b73bc(null,![],{'message':_0xa5f3('0x17')});}else{return utils['clearBlockUser'](_0x4a6896,_0x220abb,![],null)['then'](function(){return _0x1b73bc(null,![],{'message':_0xa5f3('0x17')});});}}else{return _0x1b73bc(null,![],{'message':_0xa5f3('0x17')});}}else{if(_0x220abb>=_0x4ea4b6[_0xa5f3('0xc')]){return utils[_0xa5f3('0x1a')](_0x4a6896,0x0,!![],moment())['then'](function(){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xa5f3('0x1a')](_0x4a6896,_0x220abb,![],null)[_0xa5f3('0x16')](function(){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1b73bc(null,![],{'message':_0xa5f3('0x17')});}}else{if(_0x4a6896[_0xa5f3('0x12')]){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4ea4b6[_0xa5f3('0xc')]>0x0){if(_0x4a6896['blocked']){if(_0x4ea4b6['blockDuration']>0x0){if(moment(_0x4a6896['blockedAt'])[_0xa5f3('0x1b')](_0x4ea4b6[_0xa5f3('0xd')],_0xa5f3('0x1c'))>moment()){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x4a6896,0x0,![],null)[_0xa5f3('0x16')](function(){return utils[_0xa5f3('0x1d')](_0x4a6896);})['then'](function(){return _0x1b73bc(null,_0x4a6896);});}}else{return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xa5f3('0x1a')](_0x4a6896,0x0,![],null)[_0xa5f3('0x16')](function(){return utils[_0xa5f3('0x1d')](_0x4a6896);})[_0xa5f3('0x16')](function(){return _0x1b73bc(null,_0x4a6896);})[_0xa5f3('0x1e')](function(_0x6ded35){return _0x1b73bc(null,![],_0x6ded35);});}}else{if(_0x4a6896[_0xa5f3('0x13')]){return _0x1b73bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x4a6896)['then'](function(){return _0x1b73bc(null,_0x4a6896);});}}}});})['catch'](function(_0x5086cc){return _0x1b73bc(null,![],_0x5086cc);});}function sendServiceMail(_0x19f6f4){return db[_0xa5f3('0x1f')][_0xa5f3('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xa5f3('0x21')],'include':[{'model':db['MailServerOut'],'as':_0xa5f3('0x22')}]})[_0xa5f3('0x16')](function(_0x5741da){if(!_0x5741da){throw new Error(_0xa5f3('0x23'));}var _0xcb7e4e={'tls':{'rejectUnauthorized':![]}};if(_0x5741da[_0xa5f3('0x22')]['service']){_0xcb7e4e[_0xa5f3('0x24')]=_0x5741da['Smtp'][_0xa5f3('0x24')];}else{_0xcb7e4e['host']=_0x5741da[_0xa5f3('0x22')][_0xa5f3('0x25')];_0xcb7e4e[_0xa5f3('0x26')]=_0x5741da[_0xa5f3('0x22')][_0xa5f3('0x26')];_0xcb7e4e['secure']=_0x5741da['Smtp'][_0xa5f3('0x27')];}if(_0x5741da[_0xa5f3('0x22')]['authentication']){_0xcb7e4e[_0xa5f3('0x28')]={'user':_0x5741da[_0xa5f3('0x22')][_0xa5f3('0x14')],'pass':_0x5741da['Smtp'][_0xa5f3('0x29')]};}var _0x37185f={'account':_0xcb7e4e,'message':_[_0xa5f3('0x2a')]({'from':util[_0xa5f3('0x2b')](_0xa5f3('0x2c'),_0x5741da['name'],_0x5741da[_0xa5f3('0x21')]||_0x5741da[_0xa5f3('0x22')][_0xa5f3('0x14')])},_0x19f6f4)};return client[_0xa5f3('0x2d')](_0xa5f3('0x2e'),_0x37185f);})['then'](function(_0x2b13c8){if(_0x2b13c8[_0xa5f3('0x2f')]){throw new Error(util[_0xa5f3('0x2b')](_0xa5f3('0x30'),_0x2b13c8[_0xa5f3('0x2f')][_0xa5f3('0x31')]||JSON[_0xa5f3('0x32')](_0x2b13c8[_0xa5f3('0x2f')])));}return!![];});}function handleError(_0x32417a,_0x180e89,_0x3c0714){return _0x32417a[_0xa5f3('0x33')](_0x180e89||0x1f4)[_0xa5f3('0x34')]({'message':_0x3c0714?_0x3c0714['message']||_0x3c0714:''});}exports[_0xa5f3('0x35')]=function(_0x15f8db,_0x11c8e1,_0x9a33e9){passport[_0xa5f3('0x18')](_0xa5f3('0x36'),function(_0x59d1e8,_0x1576be,_0x1a6118){var _0x73cb73=_0x59d1e8||_0x1a6118;if(_0x73cb73){return handleError(_0x11c8e1,0x191,_0x73cb73);}if(!_0x1576be){return handleError(_0x11c8e1,0x194,{'message':_0xa5f3('0x37')});}else{var _0x35fd3c={'payload':{'id':_0x1576be['id'],'role':_0x1576be[_0xa5f3('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xa5f3('0x38')](_0x35fd3c)[_0xa5f3('0x16')](function(_0x5e041){_0x11c8e1['json']({'id':_0x1576be['id'],'token':_0x5e041,'statusCall':'','isAlreadyLogged':_0x1576be['online']});});}})(_0x15f8db,_0x11c8e1,_0x9a33e9);};exports[_0xa5f3('0x39')]=function(_0x54024f,_0x37ff78,_0x2a9e94){if(!_0x54024f[_0xa5f3('0x3a')][_0xa5f3('0x21')]){return handleError(_0x37ff78,0x1f4,{'message':_0xa5f3('0x3b')});}var _0x5bc29a=rs[_0xa5f3('0x3c')]();_0x54024f[_0xa5f3('0x3a')][_0xa5f3('0x21')]=_0x54024f[_0xa5f3('0x3a')]['email']['trim']()['toLowerCase']();var _0x15c17f;return db[_0xa5f3('0xa')][_0xa5f3('0xb')]({'where':{'id':0x1},'attributes':[_0xa5f3('0xc'),_0xa5f3('0xd')],'raw':!![]})[_0xa5f3('0x16')](function(_0x733220){_0x15c17f=_0x733220;return db[_0xa5f3('0x3d')][_0xa5f3('0x20')]({'where':{'email':_0x54024f[_0xa5f3('0x3a')][_0xa5f3('0x21')]}});})['then'](function(_0x16a143){if(!_0x16a143){throw new Error(_0xa5f3('0x3e'));}if(_0x16a143[_0xa5f3('0x12')]){throw new Error(_0xa5f3('0x3f'));}if(_0x16a143[_0xa5f3('0x13')]){if(moment(_0x16a143[_0xa5f3('0x19')])[_0xa5f3('0x1b')](_0x15c17f[_0xa5f3('0xd')],_0xa5f3('0x1c'))>moment()){throw new Error(_0xa5f3('0x40'));}else{_0x16a143[_0xa5f3('0x13')]=![];_0x16a143[_0xa5f3('0x19')]=null;}}_0x16a143['resetPasswordToken']=_0x5bc29a;_0x16a143[_0xa5f3('0x41')]=Date[_0xa5f3('0x42')]()+0x36ee80;return _0x16a143[_0xa5f3('0x43')]();})[_0xa5f3('0x16')](function(){return sendServiceMail({'to':_0x54024f[_0xa5f3('0x3a')]['email'],'subject':_0xa5f3('0x44'),'text':_0xa5f3('0x45')+_0xa5f3('0x46')+_0xa5f3('0x47')+_0x54024f['headers']['host']+_0xa5f3('0x48')+_0x5bc29a+'\x0a\x0a'+_0xa5f3('0x49')});})[_0xa5f3('0x16')](function(){_0x37ff78[_0xa5f3('0x33')](0xc8)[_0xa5f3('0x34')]({'message':_0xa5f3('0x4a')});})[_0xa5f3('0x1e')](function(_0x555378){return handleError(_0x37ff78,0x1f4,_0x555378);});};exports[_0xa5f3('0x4b')]=function(_0x41d376,_0x2d7a75,_0x3ebb68){return db['User'][_0xa5f3('0x20')]({'where':{'resetPasswordToken':_0x41d376['params'][_0xa5f3('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xa5f3('0x42')]()}}})['then'](function(_0x4cfd09){if(!_0x4cfd09){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xa5f3('0xb')]({'attributes':['id',_0xa5f3('0x4d'),_0xa5f3('0x4e'),_0xa5f3('0x4f')]})[_0xa5f3('0x16')](function(_0x36face){if(_0x36face[_0xa5f3('0x4d')])authService['validatePasswordPattern'](_0x41d376['body'][_0xa5f3('0xf')]);if(!_0x36face[_0xa5f3('0x4e')]||!_0x4cfd09['previousPasswords'])return _0x4cfd09;authService[_0xa5f3('0x50')](_0x41d376[_0xa5f3('0x3a')][_0xa5f3('0xf')],_0x4cfd09[_0xa5f3('0x51')],_0x36face[_0xa5f3('0x4f')]);return _0x4cfd09;})[_0xa5f3('0x16')](function(){_0x4cfd09[_0xa5f3('0xf')]=_0x41d376[_0xa5f3('0x3a')][_0xa5f3('0xf')];_0x4cfd09['resetPasswordToken']=null;_0x4cfd09[_0xa5f3('0x41')]=null;return _0x4cfd09['save']();});})[_0xa5f3('0x16')](function(){_0x2d7a75[_0xa5f3('0x33')](0xc8)[_0xa5f3('0x34')]({'message':_0xa5f3('0x52')});})[_0xa5f3('0x1e')](function(_0x1e993b){return handleError(_0x2d7a75,0x1f4,_0x1e993b);});};passport[_0xa5f3('0x53')](new LocalStrategy({'usernameField':_0xa5f3('0xe'),'passwordField':_0xa5f3('0xf')},function(_0x48cbbd,_0xda4af0,_0x4e1e85){return localAuthenticate(db['User'],_0x48cbbd,_0xda4af0,_0x4e1e85);}));
\ No newline at end of file
+var _0x5d44=['error','message','stringify','status','login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','pass','format'];(function(_0x560a6d,_0x42c234){var _0x4b29aa=function(_0x24309c){while(--_0x24309c){_0x560a6d['push'](_0x560a6d['shift']());}};_0x4b29aa(++_0x42c234);}(_0x5d44,0xd1));var _0x45d4=function(_0x20b91e,_0xe4e682){_0x20b91e=_0x20b91e-0x0;var _0x41d214=_0x5d44[_0x20b91e];return _0x41d214;};'use strict';var util=require(_0x45d4('0x0'));var passport=require(_0x45d4('0x1'));var LocalStrategy=require(_0x45d4('0x2'))['Strategy'];var jayson=require(_0x45d4('0x3'));var _=require(_0x45d4('0x4'));var rs=require(_0x45d4('0x5'));var moment=require(_0x45d4('0x6'));var db=require(_0x45d4('0x7'))['db'];var authService=require(_0x45d4('0x8'));var utils=require(_0x45d4('0x9'));var client=jayson['client'][_0x45d4('0xa')]({'port':0x232b});function localAuthenticate(_0x17e99c,_0x32d570,_0x56fe0b,_0x2717b2){var _0x4ecf33,_0x102cbe;return db['Setting'][_0x45d4('0xb')]({'where':{'id':0x1},'attributes':[_0x45d4('0xc'),_0x45d4('0xd')],'raw':!![]})[_0x45d4('0xe')](function(_0x4d9bae){_0x4ecf33=_0x4d9bae;return _0x17e99c[_0x45d4('0xb')]({'attributes':['id',_0x45d4('0xf'),_0x45d4('0x10'),_0x45d4('0x11'),_0x45d4('0x12'),'disabled',_0x45d4('0x13'),_0x45d4('0x14'),_0x45d4('0x15')],'where':{'name':_0x32d570,'role':{'$or':[_0x45d4('0x16'),_0x45d4('0x17'),_0x45d4('0x18')]}}});})[_0x45d4('0xe')](function(_0x45eb36){if(!_0x45eb36||_0x45eb36&&_0x45eb36[_0x45d4('0xf')]!==_0x32d570){throw new Error(_0x45d4('0x19'));}else{_0x102cbe=_0x45eb36;return _0x102cbe;}})[_0x45d4('0xe')](function(){_0x102cbe[_0x45d4('0x1a')](_0x56fe0b,function(_0x152ecb,_0x1adc55){var _0x2ba0e0=_0x102cbe[_0x45d4('0x15')]+0x1;if(_0x152ecb){return _0x2717b2(_0x152ecb);}else if(!_0x1adc55){if(_0x102cbe[_0x45d4('0x1b')]){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else if(_0x4ecf33[_0x45d4('0xc')]>0x0){if(_0x102cbe['blocked']){if(_0x4ecf33[_0x45d4('0xd')]>0x0){if(moment(_0x102cbe[_0x45d4('0x14')])[_0x45d4('0x1c')](_0x4ecf33['blockDuration'],_0x45d4('0x1d'))>moment()){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else{return utils['clearBlockUser'](_0x102cbe,_0x2ba0e0,![],null)['then'](function(){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});});}}else{return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}}else{if(_0x2ba0e0>=_0x4ecf33[_0x45d4('0xc')]){return utils[_0x45d4('0x1e')](_0x102cbe,0x0,!![],moment())[_0x45d4('0xe')](function(){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});});}else{return utils[_0x45d4('0x1e')](_0x102cbe,_0x2ba0e0,![],null)[_0x45d4('0xe')](function(){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});});}}}else{return _0x2717b2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x102cbe[_0x45d4('0x1b')]){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else if(_0x4ecf33['allowedLoginAttempts']>0x0){if(_0x102cbe['blocked']){if(_0x4ecf33['blockDuration']>0x0){if(moment(_0x102cbe[_0x45d4('0x14')])[_0x45d4('0x1c')](_0x4ecf33[_0x45d4('0xd')],'minutes')>moment()){return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}else{return utils['clearBlockUser'](_0x102cbe,0x0,![],null)[_0x45d4('0xe')](function(){return utils[_0x45d4('0x1f')](_0x102cbe);})[_0x45d4('0xe')](function(){return _0x2717b2(null,_0x102cbe);});}}else{return _0x2717b2(null,![],{'message':_0x45d4('0x19')});}}else{return utils[_0x45d4('0x1e')](_0x102cbe,0x0,![],null)[_0x45d4('0xe')](function(){return utils[_0x45d4('0x1f')](_0x102cbe);})[_0x45d4('0xe')](function(){return _0x2717b2(null,_0x102cbe);})[_0x45d4('0x20')](function(_0x30781e){return _0x2717b2(null,![],_0x30781e);});}}else{if(_0x102cbe[_0x45d4('0x13')]){return _0x2717b2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x45d4('0x1f')](_0x102cbe)[_0x45d4('0xe')](function(){return _0x2717b2(null,_0x102cbe);});}}}});})['catch'](function(_0x3cf0c1){return _0x2717b2(null,![],_0x3cf0c1);});}function sendServiceMail(_0x6bc17b){return db[_0x45d4('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0x45d4('0xf'),_0x45d4('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x45d4('0x23')}]})[_0x45d4('0xe')](function(_0x23bd4c){if(!_0x23bd4c){throw new Error(_0x45d4('0x24'));}var _0x4cbdd2={'tls':{'rejectUnauthorized':![]}};if(_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x25')]){_0x4cbdd2[_0x45d4('0x25')]=_0x23bd4c['Smtp'][_0x45d4('0x25')];}else{_0x4cbdd2[_0x45d4('0x26')]=_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x26')];_0x4cbdd2[_0x45d4('0x27')]=_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x27')];_0x4cbdd2[_0x45d4('0x28')]=_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x28')];}if(_0x23bd4c[_0x45d4('0x23')]['authentication']){_0x4cbdd2['auth']={'user':_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x17')],'pass':_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x29')]};}var _0x282f61={'account':_0x4cbdd2,'message':_['merge']({'from':util[_0x45d4('0x2a')]('\x22%s\x22\x20<%s>',_0x23bd4c[_0x45d4('0xf')],_0x23bd4c['email']||_0x23bd4c[_0x45d4('0x23')][_0x45d4('0x17')])},_0x6bc17b)};return client['request']('SendMail',_0x282f61);})[_0x45d4('0xe')](function(_0x2889db){if(_0x2889db[_0x45d4('0x2b')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2889db['error'][_0x45d4('0x2c')]||JSON[_0x45d4('0x2d')](_0x2889db[_0x45d4('0x2b')])));}return!![];});}function handleError(_0x3cc141,_0x15f3e5,_0xe02fb2){return _0x3cc141[_0x45d4('0x2e')](_0x15f3e5||0x1f4)['send']({'message':_0xe02fb2?_0xe02fb2[_0x45d4('0x2c')]||_0xe02fb2:''});}exports[_0x45d4('0x2f')]=function(_0x26aa1f,_0x2e7491,_0x41eba8){passport['authenticate']('local',function(_0x23db01,_0x399f78,_0x569e9d){var _0x139859=_0x23db01||_0x569e9d;if(_0x139859){return handleError(_0x2e7491,0x191,_0x139859);}if(!_0x399f78){return handleError(_0x2e7491,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x55d270={'payload':{'id':_0x399f78['id'],'role':_0x399f78[_0x45d4('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x45d4('0x30')](_0x55d270)[_0x45d4('0xe')](function(_0xfafe6a){_0x2e7491['json']({'id':_0x399f78['id'],'token':_0xfafe6a,'statusCall':'','isAlreadyLogged':_0x399f78[_0x45d4('0x31')]});});}})(_0x26aa1f,_0x2e7491,_0x41eba8);};exports[_0x45d4('0x32')]=function(_0x3be779,_0x2616dd,_0xb51b99){if(!_0x3be779[_0x45d4('0x33')]['email']){return handleError(_0x2616dd,0x1f4,{'message':_0x45d4('0x34')});}var _0x39920e=rs[_0x45d4('0x35')]();_0x3be779[_0x45d4('0x33')][_0x45d4('0x22')]=_0x3be779['body'][_0x45d4('0x22')][_0x45d4('0x36')]()[_0x45d4('0x37')]();var _0x59df68;return db[_0x45d4('0x38')][_0x45d4('0xb')]({'where':{'id':0x1},'attributes':[_0x45d4('0xc'),_0x45d4('0xd')],'raw':!![]})[_0x45d4('0xe')](function(_0x199bf6){_0x59df68=_0x199bf6;return db['User'][_0x45d4('0x39')]({'where':{'email':_0x3be779['body'][_0x45d4('0x22')]}});})[_0x45d4('0xe')](function(_0x16ed41){if(!_0x16ed41){throw new Error(_0x45d4('0x3a'));}if(_0x16ed41[_0x45d4('0x1b')]){throw new Error(_0x45d4('0x3b'));}if(_0x16ed41[_0x45d4('0x13')]){if(moment(_0x16ed41[_0x45d4('0x14')])[_0x45d4('0x1c')](_0x59df68[_0x45d4('0xd')],_0x45d4('0x1d'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x16ed41['blocked']=![];_0x16ed41[_0x45d4('0x14')]=null;}}_0x16ed41[_0x45d4('0x3c')]=_0x39920e;_0x16ed41[_0x45d4('0x3d')]=Date[_0x45d4('0x3e')]()+0x36ee80;return _0x16ed41[_0x45d4('0x3f')]();})[_0x45d4('0xe')](function(){return sendServiceMail({'to':_0x3be779[_0x45d4('0x33')][_0x45d4('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x45d4('0x40')+_0x45d4('0x41')+_0x45d4('0x42')+_0x3be779[_0x45d4('0x43')][_0x45d4('0x26')]+_0x45d4('0x44')+_0x39920e+'\x0a\x0a'+_0x45d4('0x45')});})[_0x45d4('0xe')](function(){_0x2616dd['status'](0xc8)[_0x45d4('0x46')]({'message':_0x45d4('0x47')});})[_0x45d4('0x20')](function(_0x14ef5d){return handleError(_0x2616dd,0x1f4,_0x14ef5d);});};exports[_0x45d4('0x48')]=function(_0x5d56da,_0x206e2c,_0x48e552){return db[_0x45d4('0x49')][_0x45d4('0x39')]({'where':{'resetPasswordToken':_0x5d56da[_0x45d4('0x4a')][_0x45d4('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x45d4('0x3e')]()}}})[_0x45d4('0xe')](function(_0x3a76eb){if(!_0x3a76eb){throw new Error(_0x45d4('0x4c'));}return db[_0x45d4('0x38')]['findOne']({'attributes':['id',_0x45d4('0x4d'),_0x45d4('0x4e'),_0x45d4('0x4f')]})['then'](function(_0xb9bc4f){if(_0xb9bc4f[_0x45d4('0x4d')])authService[_0x45d4('0x50')](_0x5d56da['body'][_0x45d4('0x10')]);if(!_0xb9bc4f[_0x45d4('0x4e')]||!_0x3a76eb[_0x45d4('0x51')])return _0x3a76eb;authService[_0x45d4('0x52')](_0x5d56da['body'][_0x45d4('0x10')],_0x3a76eb['previousPasswords'],_0xb9bc4f[_0x45d4('0x4f')]);return _0x3a76eb;})[_0x45d4('0xe')](function(){_0x3a76eb[_0x45d4('0x10')]=_0x5d56da[_0x45d4('0x33')][_0x45d4('0x10')];_0x3a76eb[_0x45d4('0x3c')]=null;_0x3a76eb[_0x45d4('0x3d')]=null;return _0x3a76eb[_0x45d4('0x3f')]();});})[_0x45d4('0xe')](function(){_0x206e2c[_0x45d4('0x2e')](0xc8)['send']({'message':_0x45d4('0x53')});})[_0x45d4('0x20')](function(_0x59a201){return handleError(_0x206e2c,0x1f4,_0x59a201);});};passport['use'](new LocalStrategy({'usernameField':_0x45d4('0xf'),'passwordField':_0x45d4('0x10')},function(_0x5a1889,_0x115804,_0x51eb90){return localAuthenticate(db[_0x45d4('0x49')],_0x5a1889,_0x115804,_0x51eb90);}));
\ No newline at end of file
index 99eeff3..b145197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0d5=['Router','post','/forgot','forgot','/reset/:token','exports','express'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc0d5,0xfb));var _0x5c0d=function(_0x103e4b,_0x4ecec6){_0x103e4b=_0x103e4b-0x0;var _0x23aef9=_0xc0d5[_0x103e4b];return _0x23aef9;};'use strict';var express=require(_0x5c0d('0x0'));var router=express[_0x5c0d('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0x5c0d('0x2')](_0x5c0d('0x3'),controller[_0x5c0d('0x4')]);router[_0x5c0d('0x2')](_0x5c0d('0x5'),controller['reset']);module[_0x5c0d('0x6')]=router;
\ No newline at end of file
+var _0x8a1a=['login','forgot','./authLocal.controller','post'];(function(_0x155116,_0x27df78){var _0x403b73=function(_0x2eb7b4){while(--_0x2eb7b4){_0x155116['push'](_0x155116['shift']());}};_0x403b73(++_0x27df78);}(_0x8a1a,0x96));var _0xa8a1=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0x8a1a[_0x1168a1];return _0xcc5ad8;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa8a1('0x0'));router[_0xa8a1('0x1')]('/',controller[_0xa8a1('0x2')]);router[_0xa8a1('0x1')]('/forgot',controller[_0xa8a1('0x3')]);router[_0xa8a1('0x1')]('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
index a892be3..adfbbde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fc1=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x51f0dd,_0x13e184){var _0x43df8c=function(_0x1299ac){while(--_0x1299ac){_0x51f0dd['push'](_0x51f0dd['shift']());}};_0x43df8c(++_0x13e184);}(_0x2fc1,0x130));var _0x12fc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2fc1[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x12fc('0x0'));module['exports']={'name':{'type':Sequelize[_0x12fc('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x12fc('0x1')]},'description':{'type':Sequelize[_0x12fc('0x1')]},'status':{'type':Sequelize[_0x12fc('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x12fc('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x84b8=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x267556,_0x293028){var _0x1ec0b1=function(_0xf02080){while(--_0xf02080){_0x267556['push'](_0x267556['shift']());}};_0x1ec0b1(++_0x293028);}(_0x84b8,0x174));var _0x884b=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x84b8[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0x884b('0x0'));module[_0x884b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x884b('0x2')]},'status':{'type':Sequelize[_0x884b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x884b('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index 2967875..3273ced 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfab6=['type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','catch','show','includeAll','find','create','body','params','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','rimraf','zip-dir','request-promise','moment','util','path','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/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','map','Automation','rawAttributes'];(function(_0x3d6157,_0x3f5107){var _0x4be21e=function(_0x52e268){while(--_0x52e268){_0x3d6157['push'](_0x3d6157['shift']());}};_0x4be21e(++_0x3f5107);}(_0xfab6,0x76));var _0x6fab=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xfab6[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0x6fab('0x0'));var rimraf=require(_0x6fab('0x1'));var zipdir=require(_0x6fab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fab('0x3'));var moment=require(_0x6fab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6fab('0x5'));var path=require(_0x6fab('0x6'));var sox=require('sox');var csv=require(_0x6fab('0x7'));var ejs=require(_0x6fab('0x8'));var fs=require('fs');var fs_extra=require(_0x6fab('0x9'));var _=require(_0x6fab('0xa'));var squel=require(_0x6fab('0xb'));var crypto=require(_0x6fab('0xc'));var jsforce=require(_0x6fab('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6fab('0xe'));var Papa=require(_0x6fab('0xf'));var Redis=require(_0x6fab('0x10'));var authService=require(_0x6fab('0x11'));var qs=require(_0x6fab('0x12'));var as=require(_0x6fab('0x13'));var hardwareService=require(_0x6fab('0x14'));var logger=require(_0x6fab('0x15'))(_0x6fab('0x16'));var utils=require(_0x6fab('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6fab('0x18'));var db=require(_0x6fab('0x19'))['db'];function respondWithStatusCode(_0x89dc85,_0x485320){_0x485320=_0x485320||0xcc;return function(_0x2a94a0){if(_0x2a94a0){return _0x89dc85[_0x6fab('0x1a')](_0x485320);}return _0x89dc85['status'](_0x485320)[_0x6fab('0x1b')]();};}function respondWithResult(_0x210f3b,_0x20a129){_0x20a129=_0x20a129||0xc8;return function(_0x1f1922){if(_0x1f1922){return _0x210f3b['status'](_0x20a129)[_0x6fab('0x1c')](_0x1f1922);}};}function respondWithFilteredResult(_0x5183f3,_0x1639e){return function(_0x5ae462){if(_0x5ae462){var _0x5a9611=typeof _0x1639e[_0x6fab('0x1d')]===_0x6fab('0x1e')&&typeof _0x1639e[_0x6fab('0x1f')]===_0x6fab('0x1e');var _0x3f72a3=_0x5ae462['count'];var _0x7ce83b=_0x5a9611?0x0:_0x1639e[_0x6fab('0x1d')];var _0x51c5bf=_0x5a9611?_0x5ae462[_0x6fab('0x20')]:_0x1639e[_0x6fab('0x1d')]+_0x1639e[_0x6fab('0x1f')];var _0x5f3d0e;if(_0x51c5bf>=_0x3f72a3){_0x51c5bf=_0x3f72a3;_0x5f3d0e=0xc8;}else{_0x5f3d0e=0xce;}_0x5183f3[_0x6fab('0x21')](_0x5f3d0e);return _0x5183f3[_0x6fab('0x22')](_0x6fab('0x23'),_0x7ce83b+'-'+_0x51c5bf+'/'+_0x3f72a3)[_0x6fab('0x1c')](_0x5ae462);}return null;};}function patchUpdates(_0x16fccf){return function(_0x3fbcd0){try{jsonpatch[_0x6fab('0x24')](_0x3fbcd0,_0x16fccf,!![]);}catch(_0x426dc4){return BPromise[_0x6fab('0x25')](_0x426dc4);}return _0x3fbcd0['save']();};}function saveUpdates(_0x2aa1a1,_0x157980){return function(_0x1e41cd){if(_0x1e41cd){return _0x1e41cd[_0x6fab('0x26')](_0x2aa1a1)[_0x6fab('0x27')](function(_0x1d6d8e){return _0x1d6d8e;});}return null;};}function removeEntity(_0x6cd75b,_0x427c26){return function(_0x5a31e6){if(_0x5a31e6){return _0x5a31e6[_0x6fab('0x28')]()[_0x6fab('0x27')](function(){_0x6cd75b['status'](0xcc)[_0x6fab('0x1b')]();});}};}function handleEntityNotFound(_0x54e084,_0x3b2e84){return function(_0x2f6155){if(!_0x2f6155){_0x54e084[_0x6fab('0x1a')](0x194);}return _0x2f6155;};}function handleError(_0xb092cc,_0x46711d){_0x46711d=_0x46711d||0x1f4;return function(_0x20baec){logger[_0x6fab('0x29')](_0x20baec[_0x6fab('0x2a')]);if(_0x20baec['name']){delete _0x20baec['name'];}_0xb092cc['status'](_0x46711d)[_0x6fab('0x2b')](_0x20baec);};}exports[_0x6fab('0x2c')]=function(_0x620c1b,_0xb896cc){var _0x8e48db={},_0x22e661={},_0x2aef15={'count':0x0,'rows':[]};var _0x4e9b03=_[_0x6fab('0x2d')](db[_0x6fab('0x2e')][_0x6fab('0x2f')],function(_0xba784a){return{'name':_0xba784a['fieldName'],'type':_0xba784a[_0x6fab('0x30')]['key']};});_0x22e661[_0x6fab('0x31')]=_['map'](_0x4e9b03,_0x6fab('0x32'));_0x22e661[_0x6fab('0x33')]=_[_0x6fab('0x34')](_0x620c1b[_0x6fab('0x33')]);_0x22e661[_0x6fab('0x35')]=_[_0x6fab('0x36')](_0x22e661[_0x6fab('0x31')],_0x22e661['query']);_0x8e48db[_0x6fab('0x37')]=_[_0x6fab('0x36')](_0x22e661[_0x6fab('0x31')],qs[_0x6fab('0x38')](_0x620c1b['query']['fields']));_0x8e48db[_0x6fab('0x37')]=_0x8e48db[_0x6fab('0x37')][_0x6fab('0x39')]?_0x8e48db['attributes']:_0x22e661[_0x6fab('0x31')];if(!_0x620c1b[_0x6fab('0x33')][_0x6fab('0x3a')](_0x6fab('0x3b'))){_0x8e48db[_0x6fab('0x1f')]=qs[_0x6fab('0x1f')](_0x620c1b[_0x6fab('0x33')]['limit']);_0x8e48db['offset']=qs['offset'](_0x620c1b[_0x6fab('0x33')][_0x6fab('0x1d')]);}_0x8e48db[_0x6fab('0x3c')]=qs['sort'](_0x620c1b[_0x6fab('0x33')][_0x6fab('0x3d')]);_0x8e48db[_0x6fab('0x3e')]=qs['filters'](_[_0x6fab('0x3f')](_0x620c1b[_0x6fab('0x33')],_0x22e661['filters']),_0x4e9b03);if(_0x620c1b[_0x6fab('0x33')][_0x6fab('0x40')]){_0x8e48db[_0x6fab('0x3e')]=_[_0x6fab('0x41')](_0x8e48db[_0x6fab('0x3e')],{'$or':_[_0x6fab('0x2d')](_0x4e9b03,function(_0x25b284){if(_0x25b284[_0x6fab('0x30')]!=='VIRTUAL'){var _0x1015a8={};_0x1015a8[_0x25b284[_0x6fab('0x32')]]={'$like':'%'+_0x620c1b[_0x6fab('0x33')][_0x6fab('0x40')]+'%'};return _0x1015a8;}})});}_0x8e48db=_[_0x6fab('0x41')]({},_0x8e48db,_0x620c1b[_0x6fab('0x42')]);var _0x366466={'where':_0x8e48db[_0x6fab('0x3e')]};return db[_0x6fab('0x2e')][_0x6fab('0x20')](_0x366466)[_0x6fab('0x27')](function(_0x16bb03){_0x2aef15[_0x6fab('0x20')]=_0x16bb03;if(_0x620c1b[_0x6fab('0x33')]['includeAll']){_0x8e48db['include']=[{'all':!![]}];}return db[_0x6fab('0x2e')]['findAll'](_0x8e48db);})[_0x6fab('0x27')](function(_0x1be165){_0x2aef15['rows']=_0x1be165;return _0x2aef15;})[_0x6fab('0x27')](respondWithFilteredResult(_0xb896cc,_0x8e48db))[_0x6fab('0x43')](handleError(_0xb896cc,null));};exports[_0x6fab('0x44')]=function(_0x3f4c45,_0x876057){var _0x3c60ef={'raw':![],'where':{'id':_0x3f4c45['params']['id']}},_0x23ab97={};_0x23ab97[_0x6fab('0x31')]=_[_0x6fab('0x34')](db[_0x6fab('0x2e')][_0x6fab('0x2f')]);_0x23ab97[_0x6fab('0x33')]=_['keys'](_0x3f4c45[_0x6fab('0x33')]);_0x23ab97[_0x6fab('0x35')]=_[_0x6fab('0x36')](_0x23ab97['model'],_0x23ab97[_0x6fab('0x33')]);_0x3c60ef[_0x6fab('0x37')]=_[_0x6fab('0x36')](_0x23ab97[_0x6fab('0x31')],qs[_0x6fab('0x38')](_0x3f4c45[_0x6fab('0x33')][_0x6fab('0x38')]));_0x3c60ef[_0x6fab('0x37')]=_0x3c60ef[_0x6fab('0x37')][_0x6fab('0x39')]?_0x3c60ef['attributes']:_0x23ab97[_0x6fab('0x31')];if(_0x3f4c45[_0x6fab('0x33')][_0x6fab('0x45')]){_0x3c60ef['include']=[{'all':!![]}];}_0x3c60ef=_['merge']({},_0x3c60ef,_0x3f4c45[_0x6fab('0x42')]);return db['Automation'][_0x6fab('0x46')](_0x3c60ef)[_0x6fab('0x27')](handleEntityNotFound(_0x876057,null))['then'](respondWithResult(_0x876057,null))['catch'](handleError(_0x876057,null));};exports['create']=function(_0x527dd,_0x378934){return db[_0x6fab('0x2e')][_0x6fab('0x47')](_0x527dd[_0x6fab('0x48')],{})['then'](respondWithResult(_0x378934,0xc9))[_0x6fab('0x43')](handleError(_0x378934,null));};exports['update']=function(_0x350d5c,_0xe7299){if(_0x350d5c[_0x6fab('0x48')]['id']){delete _0x350d5c[_0x6fab('0x48')]['id'];}return db[_0x6fab('0x2e')][_0x6fab('0x46')]({'where':{'id':_0x350d5c[_0x6fab('0x49')]['id']}})[_0x6fab('0x27')](handleEntityNotFound(_0xe7299,null))[_0x6fab('0x27')](saveUpdates(_0x350d5c[_0x6fab('0x48')],null))[_0x6fab('0x27')](respondWithResult(_0xe7299,null))[_0x6fab('0x43')](handleError(_0xe7299,null));};exports['destroy']=function(_0x80e448,_0x17e5a3){return db[_0x6fab('0x2e')][_0x6fab('0x46')]({'where':{'id':_0x80e448[_0x6fab('0x49')]['id']}})[_0x6fab('0x27')](handleEntityNotFound(_0x17e5a3,null))[_0x6fab('0x27')](removeEntity(_0x17e5a3,null))['catch'](handleError(_0x17e5a3,null));};exports[_0x6fab('0x4a')]=function(_0x161d1d,_0x35f853,_0x225264){return db[_0x6fab('0x4b')][_0x6fab('0x46')]({'where':{'id':_0x161d1d[_0x6fab('0x49')]['id']}})[_0x6fab('0x27')](handleEntityNotFound(_0x35f853,null))['then'](function(_0x29bb57){if(_0x29bb57){return _0x29bb57[_0x6fab('0x4a')](_0x161d1d['body'][_0x6fab('0x4c')],_[_0x6fab('0x4d')](_0x161d1d[_0x6fab('0x48')],[_0x6fab('0x4c'),'id'])||{});}})[_0x6fab('0x27')](respondWithResult(_0x35f853,null))[_0x6fab('0x43')](handleError(_0x35f853,null));};exports['getConditions']=function(_0xc0c987,_0x109ee6,_0x39e9a7){var _0x19717b={};var _0xca9bcc={};var _0x157501;var _0xcd992f;return db[_0x6fab('0x2e')]['findOne']({'where':{'id':_0xc0c987[_0x6fab('0x49')]['id']}})['then'](handleEntityNotFound(_0x109ee6,null))[_0x6fab('0x27')](function(_0x164291){if(_0x164291){_0x157501=_0x164291;_0xca9bcc[_0x6fab('0x31')]=_[_0x6fab('0x34')](db[_0x6fab('0x4b')]['rawAttributes']);_0xca9bcc[_0x6fab('0x33')]=_[_0x6fab('0x34')](_0xc0c987['query']);_0xca9bcc[_0x6fab('0x35')]=_[_0x6fab('0x36')](_0xca9bcc[_0x6fab('0x31')],_0xca9bcc[_0x6fab('0x33')]);_0x19717b[_0x6fab('0x37')]=_[_0x6fab('0x36')](_0xca9bcc[_0x6fab('0x31')],qs['fields'](_0xc0c987[_0x6fab('0x33')]['fields']));_0x19717b[_0x6fab('0x37')]=_0x19717b[_0x6fab('0x37')][_0x6fab('0x39')]?_0x19717b[_0x6fab('0x37')]:_0xca9bcc[_0x6fab('0x31')];_0x19717b[_0x6fab('0x3c')]=qs[_0x6fab('0x3d')](_0xc0c987[_0x6fab('0x33')][_0x6fab('0x3d')]);_0x19717b['where']=qs['filters'](_['pick'](_0xc0c987[_0x6fab('0x33')],_0xca9bcc[_0x6fab('0x35')]));if(_0xc0c987[_0x6fab('0x33')]['filter']){_0x19717b[_0x6fab('0x3e')]=_[_0x6fab('0x41')](_0x19717b[_0x6fab('0x3e')],{'$or':_['map'](_0x19717b['attributes'],function(_0x6bbcb4){var _0x11c4e1={};_0x11c4e1[_0x6bbcb4]={'$like':'%'+_0xc0c987[_0x6fab('0x33')][_0x6fab('0x40')]+'%'};return _0x11c4e1;})});}_0x19717b=_[_0x6fab('0x41')]({},_0x19717b,_0xc0c987[_0x6fab('0x42')]);return _0x157501[_0x6fab('0x4e')](_0x19717b);}})[_0x6fab('0x27')](function(_0x5146f){if(_0x5146f){_0xcd992f=_0x5146f['length'];if(!_0xc0c987[_0x6fab('0x33')][_0x6fab('0x3a')]('nolimit')){_0x19717b[_0x6fab('0x1f')]=qs[_0x6fab('0x1f')](_0xc0c987[_0x6fab('0x33')][_0x6fab('0x1f')]);_0x19717b[_0x6fab('0x1d')]=qs[_0x6fab('0x1d')](_0xc0c987[_0x6fab('0x33')][_0x6fab('0x1d')]);}return _0x157501[_0x6fab('0x4e')](_0x19717b);}})['then'](function(_0x5a6af4){if(_0x5a6af4){return _0x5a6af4?{'count':_0xcd992f,'rows':_0x5a6af4}:null;}})[_0x6fab('0x27')](respondWithResult(_0x109ee6,null))['catch'](handleError(_0x109ee6,null));};exports[_0x6fab('0x4f')]=function(_0x448daa,_0x3a11c6,_0x23724f){return db[_0x6fab('0x50')][_0x6fab('0x46')]({'where':{'id':_0x448daa[_0x6fab('0x49')]['id']}})['then'](handleEntityNotFound(_0x3a11c6,null))['then'](function(_0x4202ea){if(_0x4202ea){return _0x4202ea[_0x6fab('0x4f')](_0x448daa[_0x6fab('0x48')][_0x6fab('0x4c')],_[_0x6fab('0x4d')](_0x448daa['body'],[_0x6fab('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x3a11c6,null))[_0x6fab('0x43')](handleError(_0x3a11c6,null));};exports[_0x6fab('0x51')]=function(_0x38d1b9,_0x5aec9a,_0x43cac1){var _0x3ec90e={};var _0x2b4c22={};var _0x29bd89;var _0x59b7e5;return db[_0x6fab('0x2e')][_0x6fab('0x52')]({'where':{'id':_0x38d1b9[_0x6fab('0x49')]['id']}})[_0x6fab('0x27')](handleEntityNotFound(_0x5aec9a,null))['then'](function(_0x22879b){if(_0x22879b){_0x29bd89=_0x22879b;_0x2b4c22[_0x6fab('0x31')]=_[_0x6fab('0x34')](db[_0x6fab('0x50')][_0x6fab('0x2f')]);_0x2b4c22['query']=_[_0x6fab('0x34')](_0x38d1b9['query']);_0x2b4c22[_0x6fab('0x35')]=_[_0x6fab('0x36')](_0x2b4c22[_0x6fab('0x31')],_0x2b4c22['query']);_0x3ec90e[_0x6fab('0x37')]=_['intersection'](_0x2b4c22[_0x6fab('0x31')],qs['fields'](_0x38d1b9[_0x6fab('0x33')][_0x6fab('0x38')]));_0x3ec90e[_0x6fab('0x37')]=_0x3ec90e[_0x6fab('0x37')][_0x6fab('0x39')]?_0x3ec90e[_0x6fab('0x37')]:_0x2b4c22[_0x6fab('0x31')];_0x3ec90e[_0x6fab('0x3c')]=qs[_0x6fab('0x3d')](_0x38d1b9[_0x6fab('0x33')][_0x6fab('0x3d')]);_0x3ec90e[_0x6fab('0x3e')]=qs[_0x6fab('0x35')](_[_0x6fab('0x3f')](_0x38d1b9['query'],_0x2b4c22[_0x6fab('0x35')]));if(_0x38d1b9[_0x6fab('0x33')]['filter']){_0x3ec90e[_0x6fab('0x3e')]=_[_0x6fab('0x41')](_0x3ec90e[_0x6fab('0x3e')],{'$or':_[_0x6fab('0x2d')](_0x3ec90e[_0x6fab('0x37')],function(_0x579c2c){var _0x1574ce={};_0x1574ce[_0x579c2c]={'$like':'%'+_0x38d1b9[_0x6fab('0x33')]['filter']+'%'};return _0x1574ce;})});}_0x3ec90e=_[_0x6fab('0x41')]({},_0x3ec90e,_0x38d1b9[_0x6fab('0x42')]);return _0x29bd89[_0x6fab('0x51')](_0x3ec90e);}})[_0x6fab('0x27')](function(_0x39a2f5){if(_0x39a2f5){_0x59b7e5=_0x39a2f5[_0x6fab('0x39')];if(!_0x38d1b9['query'][_0x6fab('0x3a')](_0x6fab('0x3b'))){_0x3ec90e['limit']=qs[_0x6fab('0x1f')](_0x38d1b9[_0x6fab('0x33')][_0x6fab('0x1f')]);_0x3ec90e[_0x6fab('0x1d')]=qs[_0x6fab('0x1d')](_0x38d1b9[_0x6fab('0x33')][_0x6fab('0x1d')]);}return _0x29bd89[_0x6fab('0x51')](_0x3ec90e);}})[_0x6fab('0x27')](function(_0x3c78b6){if(_0x3c78b6){return _0x3c78b6?{'count':_0x59b7e5,'rows':_0x3c78b6}:null;}})['then'](respondWithResult(_0x5aec9a,null))[_0x6fab('0x43')](handleError(_0x5aec9a,null));};
\ No newline at end of file
+var _0x7ca7=['findOne','Condition','order','pick','getConditions','Action','addActions','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','fields','length','options','find','body','addConditions','ids','omit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7ca7,0x164));var _0x77ca=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x7ca7[_0x238671];return _0x474844;};'use strict';var emlformat=require(_0x77ca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x77ca('0x1'));var rp=require(_0x77ca('0x2'));var moment=require(_0x77ca('0x3'));var BPromise=require(_0x77ca('0x4'));var Mustache=require('mustache');var util=require(_0x77ca('0x5'));var path=require(_0x77ca('0x6'));var sox=require(_0x77ca('0x7'));var csv=require('to-csv');var ejs=require(_0x77ca('0x8'));var fs=require('fs');var fs_extra=require(_0x77ca('0x9'));var _=require(_0x77ca('0xa'));var squel=require(_0x77ca('0xb'));var crypto=require('crypto');var jsforce=require(_0x77ca('0xc'));var deskjs=require(_0x77ca('0xd'));var toCsv=require(_0x77ca('0xe'));var querystring=require('querystring');var Papa=require(_0x77ca('0xf'));var Redis=require(_0x77ca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x77ca('0x11'));var as=require(_0x77ca('0x12'));var hardwareService=require(_0x77ca('0x13'));var logger=require(_0x77ca('0x14'))(_0x77ca('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x77ca('0x16'));var db=require(_0x77ca('0x17'))['db'];function respondWithStatusCode(_0x27d5f9,_0xdb00b5){_0xdb00b5=_0xdb00b5||0xcc;return function(_0x30dc9c){if(_0x30dc9c){return _0x27d5f9[_0x77ca('0x18')](_0xdb00b5);}return _0x27d5f9[_0x77ca('0x19')](_0xdb00b5)[_0x77ca('0x1a')]();};}function respondWithResult(_0xacb434,_0x1e2600){_0x1e2600=_0x1e2600||0xc8;return function(_0x5f1ccb){if(_0x5f1ccb){return _0xacb434['status'](_0x1e2600)[_0x77ca('0x1b')](_0x5f1ccb);}};}function respondWithFilteredResult(_0x5313fe,_0x52614a){return function(_0x119b53){if(_0x119b53){var _0x68daf8=typeof _0x52614a['offset']==='undefined'&&typeof _0x52614a[_0x77ca('0x1c')]===_0x77ca('0x1d');var _0x1c4faf=_0x119b53[_0x77ca('0x1e')];var _0x2e4a87=_0x68daf8?0x0:_0x52614a['offset'];var _0x56905b=_0x68daf8?_0x119b53['count']:_0x52614a[_0x77ca('0x1f')]+_0x52614a[_0x77ca('0x1c')];var _0x41e27b;if(_0x56905b>=_0x1c4faf){_0x56905b=_0x1c4faf;_0x41e27b=0xc8;}else{_0x41e27b=0xce;}_0x5313fe[_0x77ca('0x19')](_0x41e27b);return _0x5313fe[_0x77ca('0x20')](_0x77ca('0x21'),_0x2e4a87+'-'+_0x56905b+'/'+_0x1c4faf)[_0x77ca('0x1b')](_0x119b53);}return null;};}function patchUpdates(_0x4d8655){return function(_0x34ab02){try{jsonpatch[_0x77ca('0x22')](_0x34ab02,_0x4d8655,!![]);}catch(_0x4af6dc){return BPromise[_0x77ca('0x23')](_0x4af6dc);}return _0x34ab02[_0x77ca('0x24')]();};}function saveUpdates(_0xe9d25f,_0x59be2e){return function(_0x42ed21){if(_0x42ed21){return _0x42ed21[_0x77ca('0x25')](_0xe9d25f)['then'](function(_0x1a8e36){return _0x1a8e36;});}return null;};}function removeEntity(_0x10dba5,_0x592483){return function(_0x4b01ea){if(_0x4b01ea){return _0x4b01ea[_0x77ca('0x26')]()[_0x77ca('0x27')](function(){_0x10dba5[_0x77ca('0x19')](0xcc)[_0x77ca('0x1a')]();});}};}function handleEntityNotFound(_0x271b12,_0x571db9){return function(_0x5e5c12){if(!_0x5e5c12){_0x271b12['sendStatus'](0x194);}return _0x5e5c12;};}function handleError(_0x17188f,_0x3bfb29){_0x3bfb29=_0x3bfb29||0x1f4;return function(_0x5a7d44){logger[_0x77ca('0x28')](_0x5a7d44[_0x77ca('0x29')]);if(_0x5a7d44[_0x77ca('0x2a')]){delete _0x5a7d44[_0x77ca('0x2a')];}_0x17188f[_0x77ca('0x19')](_0x3bfb29)[_0x77ca('0x2b')](_0x5a7d44);};}exports[_0x77ca('0x2c')]=function(_0x2f67cc,_0x82a6cd){var _0x358086={},_0xb868a8={},_0x4ac1a2={'count':0x0,'rows':[]};var _0xbfc35a=_[_0x77ca('0x2d')](db[_0x77ca('0x2e')][_0x77ca('0x2f')],function(_0x2c9f69){return{'name':_0x2c9f69[_0x77ca('0x30')],'type':_0x2c9f69[_0x77ca('0x31')][_0x77ca('0x32')]};});_0xb868a8[_0x77ca('0x33')]=_[_0x77ca('0x2d')](_0xbfc35a,_0x77ca('0x2a'));_0xb868a8[_0x77ca('0x34')]=_['keys'](_0x2f67cc['query']);_0xb868a8[_0x77ca('0x35')]=_[_0x77ca('0x36')](_0xb868a8[_0x77ca('0x33')],_0xb868a8[_0x77ca('0x34')]);_0x358086[_0x77ca('0x37')]=_[_0x77ca('0x36')](_0xb868a8[_0x77ca('0x33')],qs['fields'](_0x2f67cc['query']['fields']));_0x358086[_0x77ca('0x37')]=_0x358086[_0x77ca('0x37')]['length']?_0x358086[_0x77ca('0x37')]:_0xb868a8[_0x77ca('0x33')];if(!_0x2f67cc['query'][_0x77ca('0x38')](_0x77ca('0x39'))){_0x358086['limit']=qs[_0x77ca('0x1c')](_0x2f67cc[_0x77ca('0x34')][_0x77ca('0x1c')]);_0x358086[_0x77ca('0x1f')]=qs[_0x77ca('0x1f')](_0x2f67cc[_0x77ca('0x34')][_0x77ca('0x1f')]);}_0x358086['order']=qs[_0x77ca('0x3a')](_0x2f67cc['query'][_0x77ca('0x3a')]);_0x358086[_0x77ca('0x3b')]=qs[_0x77ca('0x35')](_['pick'](_0x2f67cc[_0x77ca('0x34')],_0xb868a8['filters']),_0xbfc35a);if(_0x2f67cc['query'][_0x77ca('0x3c')]){_0x358086[_0x77ca('0x3b')]=_[_0x77ca('0x3d')](_0x358086['where'],{'$or':_[_0x77ca('0x2d')](_0xbfc35a,function(_0x12a9ef){if(_0x12a9ef['type']!==_0x77ca('0x3e')){var _0x30af40={};_0x30af40[_0x12a9ef[_0x77ca('0x2a')]]={'$like':'%'+_0x2f67cc['query']['filter']+'%'};return _0x30af40;}})});}_0x358086=_[_0x77ca('0x3d')]({},_0x358086,_0x2f67cc['options']);var _0x4c3cec={'where':_0x358086[_0x77ca('0x3b')]};return db['Automation'][_0x77ca('0x1e')](_0x4c3cec)['then'](function(_0x2d5e53){_0x4ac1a2[_0x77ca('0x1e')]=_0x2d5e53;if(_0x2f67cc[_0x77ca('0x34')][_0x77ca('0x3f')]){_0x358086[_0x77ca('0x40')]=[{'all':!![]}];}return db[_0x77ca('0x2e')][_0x77ca('0x41')](_0x358086);})[_0x77ca('0x27')](function(_0x5b04bd){_0x4ac1a2[_0x77ca('0x42')]=_0x5b04bd;return _0x4ac1a2;})[_0x77ca('0x27')](respondWithFilteredResult(_0x82a6cd,_0x358086))[_0x77ca('0x43')](handleError(_0x82a6cd,null));};exports[_0x77ca('0x44')]=function(_0x13c9fc,_0x2f62cc){var _0x27d739={'raw':![],'where':{'id':_0x13c9fc[_0x77ca('0x45')]['id']}},_0x18366b={};_0x18366b[_0x77ca('0x33')]=_['keys'](db['Automation'][_0x77ca('0x2f')]);_0x18366b[_0x77ca('0x34')]=_[_0x77ca('0x46')](_0x13c9fc['query']);_0x18366b['filters']=_[_0x77ca('0x36')](_0x18366b[_0x77ca('0x33')],_0x18366b[_0x77ca('0x34')]);_0x27d739['attributes']=_[_0x77ca('0x36')](_0x18366b[_0x77ca('0x33')],qs[_0x77ca('0x47')](_0x13c9fc[_0x77ca('0x34')][_0x77ca('0x47')]));_0x27d739[_0x77ca('0x37')]=_0x27d739[_0x77ca('0x37')][_0x77ca('0x48')]?_0x27d739[_0x77ca('0x37')]:_0x18366b[_0x77ca('0x33')];if(_0x13c9fc['query']['includeAll']){_0x27d739['include']=[{'all':!![]}];}_0x27d739=_[_0x77ca('0x3d')]({},_0x27d739,_0x13c9fc[_0x77ca('0x49')]);return db[_0x77ca('0x2e')][_0x77ca('0x4a')](_0x27d739)[_0x77ca('0x27')](handleEntityNotFound(_0x2f62cc,null))['then'](respondWithResult(_0x2f62cc,null))['catch'](handleError(_0x2f62cc,null));};exports['create']=function(_0x25e635,_0x9e8bcf){return db['Automation']['create'](_0x25e635['body'],{})['then'](respondWithResult(_0x9e8bcf,0xc9))[_0x77ca('0x43')](handleError(_0x9e8bcf,null));};exports['update']=function(_0x3f0279,_0x54a55c){if(_0x3f0279[_0x77ca('0x4b')]['id']){delete _0x3f0279['body']['id'];}return db[_0x77ca('0x2e')]['find']({'where':{'id':_0x3f0279[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x54a55c,null))[_0x77ca('0x27')](saveUpdates(_0x3f0279['body'],null))[_0x77ca('0x27')](respondWithResult(_0x54a55c,null))[_0x77ca('0x43')](handleError(_0x54a55c,null));};exports[_0x77ca('0x26')]=function(_0x4bd644,_0x3901a4){return db['Automation'][_0x77ca('0x4a')]({'where':{'id':_0x4bd644[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x3901a4,null))[_0x77ca('0x27')](removeEntity(_0x3901a4,null))[_0x77ca('0x43')](handleError(_0x3901a4,null));};exports[_0x77ca('0x4c')]=function(_0x4fec2c,_0x118fea,_0x515d27){return db['Condition'][_0x77ca('0x4a')]({'where':{'id':_0x4fec2c[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x118fea,null))[_0x77ca('0x27')](function(_0x5b0e75){if(_0x5b0e75){return _0x5b0e75[_0x77ca('0x4c')](_0x4fec2c['body'][_0x77ca('0x4d')],_[_0x77ca('0x4e')](_0x4fec2c[_0x77ca('0x4b')],[_0x77ca('0x4d'),'id'])||{});}})[_0x77ca('0x27')](respondWithResult(_0x118fea,null))[_0x77ca('0x43')](handleError(_0x118fea,null));};exports['getConditions']=function(_0x3caf44,_0x2eb218,_0x1da7c6){var _0x26212f={};var _0x4a0fdf={};var _0x40f590;var _0x24d8c8;return db[_0x77ca('0x2e')][_0x77ca('0x4f')]({'where':{'id':_0x3caf44[_0x77ca('0x45')]['id']}})['then'](handleEntityNotFound(_0x2eb218,null))['then'](function(_0x19601e){if(_0x19601e){_0x40f590=_0x19601e;_0x4a0fdf[_0x77ca('0x33')]=_['keys'](db[_0x77ca('0x50')][_0x77ca('0x2f')]);_0x4a0fdf[_0x77ca('0x34')]=_[_0x77ca('0x46')](_0x3caf44[_0x77ca('0x34')]);_0x4a0fdf[_0x77ca('0x35')]=_[_0x77ca('0x36')](_0x4a0fdf[_0x77ca('0x33')],_0x4a0fdf['query']);_0x26212f['attributes']=_['intersection'](_0x4a0fdf['model'],qs[_0x77ca('0x47')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x47')]));_0x26212f[_0x77ca('0x37')]=_0x26212f[_0x77ca('0x37')][_0x77ca('0x48')]?_0x26212f['attributes']:_0x4a0fdf['model'];_0x26212f[_0x77ca('0x51')]=qs[_0x77ca('0x3a')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x3a')]);_0x26212f[_0x77ca('0x3b')]=qs[_0x77ca('0x35')](_[_0x77ca('0x52')](_0x3caf44[_0x77ca('0x34')],_0x4a0fdf['filters']));if(_0x3caf44[_0x77ca('0x34')][_0x77ca('0x3c')]){_0x26212f['where']=_['merge'](_0x26212f['where'],{'$or':_['map'](_0x26212f['attributes'],function(_0xaa62f4){var _0x5734d1={};_0x5734d1[_0xaa62f4]={'$like':'%'+_0x3caf44[_0x77ca('0x34')]['filter']+'%'};return _0x5734d1;})});}_0x26212f=_[_0x77ca('0x3d')]({},_0x26212f,_0x3caf44['options']);return _0x40f590[_0x77ca('0x53')](_0x26212f);}})[_0x77ca('0x27')](function(_0x50030f){if(_0x50030f){_0x24d8c8=_0x50030f[_0x77ca('0x48')];if(!_0x3caf44[_0x77ca('0x34')][_0x77ca('0x38')]('nolimit')){_0x26212f[_0x77ca('0x1c')]=qs[_0x77ca('0x1c')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x1c')]);_0x26212f['offset']=qs[_0x77ca('0x1f')](_0x3caf44[_0x77ca('0x34')][_0x77ca('0x1f')]);}return _0x40f590[_0x77ca('0x53')](_0x26212f);}})[_0x77ca('0x27')](function(_0x24602c){if(_0x24602c){return _0x24602c?{'count':_0x24d8c8,'rows':_0x24602c}:null;}})[_0x77ca('0x27')](respondWithResult(_0x2eb218,null))['catch'](handleError(_0x2eb218,null));};exports['addActions']=function(_0x4213fe,_0x28bcfe,_0x73d048){return db[_0x77ca('0x54')][_0x77ca('0x4a')]({'where':{'id':_0x4213fe[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x28bcfe,null))[_0x77ca('0x27')](function(_0x3f2724){if(_0x3f2724){return _0x3f2724[_0x77ca('0x55')](_0x4213fe['body'][_0x77ca('0x4d')],_[_0x77ca('0x4e')](_0x4213fe[_0x77ca('0x4b')],[_0x77ca('0x4d'),'id'])||{});}})[_0x77ca('0x27')](respondWithResult(_0x28bcfe,null))[_0x77ca('0x43')](handleError(_0x28bcfe,null));};exports['getActions']=function(_0x395457,_0x2a4ba4,_0x2f5489){var _0x1f73ea={};var _0x5e0505={};var _0x3bf12a;var _0x47c23c;return db[_0x77ca('0x2e')]['findOne']({'where':{'id':_0x395457[_0x77ca('0x45')]['id']}})[_0x77ca('0x27')](handleEntityNotFound(_0x2a4ba4,null))[_0x77ca('0x27')](function(_0x6ec020){if(_0x6ec020){_0x3bf12a=_0x6ec020;_0x5e0505[_0x77ca('0x33')]=_[_0x77ca('0x46')](db['Action'][_0x77ca('0x2f')]);_0x5e0505[_0x77ca('0x34')]=_[_0x77ca('0x46')](_0x395457[_0x77ca('0x34')]);_0x5e0505['filters']=_['intersection'](_0x5e0505[_0x77ca('0x33')],_0x5e0505[_0x77ca('0x34')]);_0x1f73ea['attributes']=_[_0x77ca('0x36')](_0x5e0505['model'],qs[_0x77ca('0x47')](_0x395457[_0x77ca('0x34')][_0x77ca('0x47')]));_0x1f73ea['attributes']=_0x1f73ea[_0x77ca('0x37')]['length']?_0x1f73ea[_0x77ca('0x37')]:_0x5e0505[_0x77ca('0x33')];_0x1f73ea[_0x77ca('0x51')]=qs['sort'](_0x395457[_0x77ca('0x34')][_0x77ca('0x3a')]);_0x1f73ea['where']=qs[_0x77ca('0x35')](_['pick'](_0x395457['query'],_0x5e0505[_0x77ca('0x35')]));if(_0x395457[_0x77ca('0x34')][_0x77ca('0x3c')]){_0x1f73ea[_0x77ca('0x3b')]=_['merge'](_0x1f73ea[_0x77ca('0x3b')],{'$or':_[_0x77ca('0x2d')](_0x1f73ea[_0x77ca('0x37')],function(_0x26db94){var _0x4b8e5f={};_0x4b8e5f[_0x26db94]={'$like':'%'+_0x395457[_0x77ca('0x34')][_0x77ca('0x3c')]+'%'};return _0x4b8e5f;})});}_0x1f73ea=_[_0x77ca('0x3d')]({},_0x1f73ea,_0x395457['options']);return _0x3bf12a['getActions'](_0x1f73ea);}})['then'](function(_0x58d232){if(_0x58d232){_0x47c23c=_0x58d232[_0x77ca('0x48')];if(!_0x395457['query']['hasOwnProperty'](_0x77ca('0x39'))){_0x1f73ea[_0x77ca('0x1c')]=qs['limit'](_0x395457[_0x77ca('0x34')][_0x77ca('0x1c')]);_0x1f73ea[_0x77ca('0x1f')]=qs['offset'](_0x395457[_0x77ca('0x34')][_0x77ca('0x1f')]);}return _0x3bf12a[_0x77ca('0x56')](_0x1f73ea);}})['then'](function(_0x4e5907){if(_0x4e5907){return _0x4e5907?{'count':_0x47c23c,'rows':_0x4e5907}:null;}})[_0x77ca('0x27')](respondWithResult(_0x2a4ba4,null))[_0x77ca('0x43')](handleError(_0x2a4ba4,null));};
\ No newline at end of file
index bb0fac5..c52220b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27bd=['path','rimraf','./automation.attributes','exports','define','tools_automations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x494eb3,_0x5378c8){var _0x2a7eef=function(_0x20934f){while(--_0x20934f){_0x494eb3['push'](_0x494eb3['shift']());}};_0x2a7eef(++_0x5378c8);}(_0x27bd,0x66));var _0xd27b=function(_0x2a98d4,_0x4a0924){_0x2a98d4=_0x2a98d4-0x0;var _0x48c785=_0x27bd[_0x2a98d4];return _0x48c785;};'use strict';var _=require(_0xd27b('0x0'));var util=require(_0xd27b('0x1'));var logger=require('../../config/logger')(_0xd27b('0x2'));var moment=require(_0xd27b('0x3'));var BPromise=require(_0xd27b('0x4'));var rp=require(_0xd27b('0x5'));var fs=require('fs');var path=require(_0xd27b('0x6'));var rimraf=require(_0xd27b('0x7'));var config=require('../../config/environment');var attributes=require(_0xd27b('0x8'));module[_0xd27b('0x9')]=function(_0x391aba,_0x1ad258){return _0x391aba[_0xd27b('0xa')]('Automation',attributes,{'tableName':_0xd27b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7a4=['define','Automation','lodash','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xb7a4,0xe2));var _0x4b7a=function(_0x258a9f,_0xdd62ce){_0x258a9f=_0x258a9f-0x0;var _0xd06cb8=_0xb7a4[_0x258a9f];return _0xd06cb8;};'use strict';var _=require(_0x4b7a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4b7a('0x1'));var BPromise=require(_0x4b7a('0x2'));var rp=require(_0x4b7a('0x3'));var fs=require('fs');var path=require(_0x4b7a('0x4'));var rimraf=require('rimraf');var config=require(_0x4b7a('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x120f07,_0x144416){return _0x120f07[_0x4b7a('0x6')](_0x4b7a('0x7'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97701ba..d3d443d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x753c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xf911e5,_0x2909ee){var _0x26e8f4=function(_0x331ede){while(--_0x331ede){_0xf911e5['push'](_0xf911e5['shift']());}};_0x26e8f4(++_0x2909ee);}(_0x753c,0x96));var _0xc753=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x753c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xc753('0x0'));var moment=require('moment');var BPromise=require(_0xc753('0x1'));var rs=require(_0xc753('0x2'));var fs=require('fs');var Redis=require(_0xc753('0x3'));var db=require(_0xc753('0x4'))['db'];var utils=require(_0xc753('0x5'));var logger=require(_0xc753('0x6'))(_0xc753('0x7'));var config=require(_0xc753('0x8'));var jayson=require(_0xc753('0x9'));var client=jayson[_0xc753('0xa')][_0xc753('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf96e73,_0xd7ee43,_0x44e544){return new BPromise(function(_0xb80bea,_0x3866e8){return client[_0xc753('0xc')](_0xf96e73,_0x44e544)[_0xc753('0xd')](function(_0x128610){logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,_0xc753('0x10'));logger[_0xc753('0x11')](_0xc753('0x12'),_0xd7ee43,'request\x20sent',JSON[_0xc753('0x13')](_0x128610));if(_0x128610[_0xc753('0x14')]){if(_0x128610['error'][_0xc753('0x15')]===0x1f4){logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610[_0xc753('0x14')][_0xc753('0x16')]);return _0x3866e8(_0x128610['error'][_0xc753('0x16')]);}logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610['error'][_0xc753('0x16')]);return _0xb80bea(_0x128610[_0xc753('0x14')][_0xc753('0x16')]);}else{logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,'request\x20sent');_0xb80bea(_0x128610[_0xc753('0x17')][_0xc753('0x16')]);}})[_0xc753('0x18')](function(_0x2e056c){logger[_0xc753('0x14')](_0xc753('0xf'),_0xd7ee43,_0x2e056c);_0x3866e8(_0x2e056c);});});}
\ No newline at end of file
+var _0xb79a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x689cd7,_0x596cb1){var _0x1da31d=function(_0x132cac){while(--_0x132cac){_0x689cd7['push'](_0x689cd7['shift']());}};_0x1da31d(++_0x596cb1);}(_0xb79a,0x18e));var _0xab79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb79a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xab79('0x0'));var util=require(_0xab79('0x1'));var moment=require('moment');var BPromise=require(_0xab79('0x2'));var rs=require(_0xab79('0x3'));var fs=require('fs');var Redis=require(_0xab79('0x4'));var db=require(_0xab79('0x5'))['db'];var utils=require(_0xab79('0x6'));var logger=require(_0xab79('0x7'))(_0xab79('0x8'));var config=require(_0xab79('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xab79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe8ba5a,_0x10d402,_0x11ceb3){return new BPromise(function(_0x7eabd1,_0x4585fe){return client[_0xab79('0xb')](_0xe8ba5a,_0x11ceb3)[_0xab79('0xc')](function(_0x426cb9){logger[_0xab79('0xd')](_0xab79('0xe'),_0x10d402,_0xab79('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x10d402,_0xab79('0xf'),JSON[_0xab79('0x10')](_0x426cb9));if(_0x426cb9[_0xab79('0x11')]){if(_0x426cb9[_0xab79('0x11')][_0xab79('0x12')]===0x1f4){logger[_0xab79('0x11')]('Automation,\x20%s,\x20%s',_0x10d402,_0x426cb9['error'][_0xab79('0x13')]);return _0x4585fe(_0x426cb9['error'][_0xab79('0x13')]);}logger[_0xab79('0x11')](_0xab79('0xe'),_0x10d402,_0x426cb9['error']['message']);return _0x7eabd1(_0x426cb9['error']['message']);}else{logger[_0xab79('0xd')](_0xab79('0xe'),_0x10d402,'request\x20sent');_0x7eabd1(_0x426cb9['result']['message']);}})[_0xab79('0x14')](function(_0xc9650d){logger['error'](_0xab79('0xe'),_0x10d402,_0xc9650d);_0x4585fe(_0xc9650d);});});}
\ No newline at end of file
index 03c0491..5731bab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1229=['index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','post','addConditions','put','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./automation.controller','get'];(function(_0x215842,_0x533f47){var _0x151ee5=function(_0x25ee9b){while(--_0x25ee9b){_0x215842['push'](_0x215842['shift']());}};_0x151ee5(++_0x533f47);}(_0x1229,0xac));var _0x9122=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x1229[_0x1b4b23];return _0x2a325b;};'use strict';var multer=require('multer');var util=require(_0x9122('0x0'));var path=require(_0x9122('0x1'));var timeout=require(_0x9122('0x2'));var express=require(_0x9122('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9122('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9122('0x5'));var controller=require(_0x9122('0x6'));router[_0x9122('0x7')]('/',auth['isAuthenticated'](),controller[_0x9122('0x8')]);router[_0x9122('0x7')](_0x9122('0x9'),auth[_0x9122('0xa')](),controller[_0x9122('0xb')]);router['get'](_0x9122('0xc'),auth['isAuthenticated'](),controller[_0x9122('0xd')]);router[_0x9122('0x7')](_0x9122('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0x9122('0xf')]('/',auth[_0x9122('0xa')](),controller['create']);router[_0x9122('0xf')](_0x9122('0xc'),auth[_0x9122('0xa')](),controller[_0x9122('0x10')]);router[_0x9122('0xf')](_0x9122('0xe'),auth[_0x9122('0xa')](),controller['addActions']);router[_0x9122('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9122('0x12')](_0x9122('0x9'),auth[_0x9122('0xa')](),controller[_0x9122('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x833b=['get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x833b,0x131));var _0xb833=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x833b[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require(_0xb833('0x0'));var path=require('path');var timeout=require(_0xb833('0x1'));var express=require('express');var router=express[_0xb833('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb833('0x3'));var interaction=require(_0xb833('0x4'));var config=require(_0xb833('0x5'));var controller=require(_0xb833('0x6'));router[_0xb833('0x7')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0x9')]);router['get'](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0xb')]);router[_0xb833('0x7')](_0xb833('0xc'),auth[_0xb833('0x8')](),controller[_0xb833('0xd')]);router['get'](_0xb833('0xe'),auth['isAuthenticated'](),controller[_0xb833('0xf')]);router[_0xb833('0x10')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0x11')]);router['post']('/:id/conditions',auth[_0xb833('0x8')](),controller[_0xb833('0x12')]);router['post'](_0xb833('0xe'),auth['isAuthenticated'](),controller[_0xb833('0x13')]);router[_0xb833('0x14')](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0x15')]);router[_0xb833('0x16')](_0xb833('0xa'),auth[_0xb833('0x8')](),controller['destroy']);module[_0xb833('0x17')]=router;
\ No newline at end of file
index 6d69e94..f7d3d96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fbd=['Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5fbd,0x109));var _0xd5fb=function(_0x3d41ba,_0x4fce49){_0x3d41ba=_0x3d41ba-0x0;var _0x375cfd=_0x5fbd[_0x3d41ba];return _0x375cfd;};'use strict';var Sequelize=require('sequelize');module[_0xd5fb('0x0')]={'name':{'type':Sequelize[_0xd5fb('0x1')],'unique':_0xd5fb('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd5fb('0x3')](_0xd5fb('0x4')),'allowNull':![],'defaultValue':_0xd5fb('0x4')},'description':{'type':Sequelize[_0xd5fb('0x1')]},'active':{'type':Sequelize[_0xd5fb('0x5')],'defaultValue':0x0,'comment':_0xd5fb('0x6')},'limitCalls':{'type':Sequelize[_0xd5fb('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd5fb('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd5fb('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd5fb('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xd5fb('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd5fb('0x11')},'dialTimezone':{'type':Sequelize[_0xd5fb('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd5fb('0x1')],'defaultValue':_0xd5fb('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0xd5fb('0x3')](_0xd5fb('0x13'),_0xd5fb('0x14'),_0xd5fb('0x15')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd5fb('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd5fb('0x7')](0x9)[_0xd5fb('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd5fb('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd5fb('0x7')](0x9)[_0xd5fb('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xd5fb('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd5fb('0x7')](0x9)[_0xd5fb('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xd5fb('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd5fb('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd5fb('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xd5fb('0x1a'),'ASC'),'defaultValue':_0xd5fb('0x1a')},'dialPrefix':{'type':Sequelize[_0xd5fb('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd5fb('0x7')](0x3)[_0xd5fb('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd5fb('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd5fb('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xd5fb('0x7')](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd5fb('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd5fb('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd5fb('0x7')](0x5)[_0xd5fb('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd5fb('0x24')}};
\ No newline at end of file
+var _0x62a8=['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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x62a8,0x16b));var _0x862a=function(_0x49be98,_0x441f1c){_0x49be98=_0x49be98-0x0;var _0x5053b2=_0x62a8[_0x49be98];return _0x5053b2;};'use strict';var Sequelize=require(_0x862a('0x0'));module[_0x862a('0x1')]={'name':{'type':Sequelize[_0x862a('0x2')],'unique':_0x862a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x862a('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x862a('0x5')},'description':{'type':Sequelize[_0x862a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x862a('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x862a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x862a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x862a('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x862a('0xf')},'dialTimezone':{'type':Sequelize[_0x862a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x862a('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x862a('0x4')](_0x862a('0x10'),'never',_0x862a('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x862a('0x12')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x862a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x862a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x862a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x862a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x862a('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x862a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x862a('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x862a('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x862a('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x862a('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x862a('0x1a'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x862a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x862a('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x21')}};
\ No newline at end of file
index 83049b2..486f150 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9563=['CmHopperBlack','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','CmListId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_contacts','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','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','json','offset','undefined','limit','count','status','set','reject','save','update','destroy','then','IvrCampaigns','end','error','stack','name','send','map','Campaign','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','UserProfileSection','getHoppers','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks'];(function(_0x472d57,_0x322895){var _0x6e7242=function(_0x1ed660){while(--_0x1ed660){_0x472d57['push'](_0x472d57['shift']());}};_0x6e7242(++_0x322895);}(_0x9563,0x1e7));var _0x3956=function(_0x238071,_0x317867){_0x238071=_0x238071-0x0;var _0x183456=_0x9563[_0x238071];return _0x183456;};'use strict';var emlformat=require(_0x3956('0x0'));var rimraf=require(_0x3956('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3956('0x2'));var rp=require(_0x3956('0x3'));var moment=require(_0x3956('0x4'));var BPromise=require(_0x3956('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3956('0x6'));var sox=require('sox');var csv=require(_0x3956('0x7'));var ejs=require(_0x3956('0x8'));var fs=require('fs');var fs_extra=require(_0x3956('0x9'));var _=require(_0x3956('0xa'));var squel=require('squel');var crypto=require(_0x3956('0xb'));var jsforce=require(_0x3956('0xc'));var deskjs=require(_0x3956('0xd'));var toCsv=require(_0x3956('0x7'));var querystring=require(_0x3956('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3956('0xf'));var qs=require(_0x3956('0x10'));var as=require(_0x3956('0x11'));var hardwareService=require(_0x3956('0x12'));var logger=require('../../config/logger')(_0x3956('0x13'));var utils=require(_0x3956('0x14'));var config=require(_0x3956('0x15'));var licenseUtil=require(_0x3956('0x16'));var db=require(_0x3956('0x17'))['db'];function respondWithStatusCode(_0x1b417f,_0x44d37c){_0x44d37c=_0x44d37c||0xcc;return function(_0x1156a3){if(_0x1156a3){return _0x1b417f[_0x3956('0x18')](_0x44d37c);}return _0x1b417f['status'](_0x44d37c)['end']();};}function respondWithResult(_0x53c577,_0xb7fad6){_0xb7fad6=_0xb7fad6||0xc8;return function(_0x3b5eb1){if(_0x3b5eb1){return _0x53c577['status'](_0xb7fad6)[_0x3956('0x19')](_0x3b5eb1);}};}function respondWithFilteredResult(_0x384b31,_0x375980){return function(_0x19bd9c){if(_0x19bd9c){var _0x29b3bf=typeof _0x375980[_0x3956('0x1a')]===_0x3956('0x1b')&&typeof _0x375980[_0x3956('0x1c')]===_0x3956('0x1b');var _0x1e9745=_0x19bd9c[_0x3956('0x1d')];var _0x189e6c=_0x29b3bf?0x0:_0x375980[_0x3956('0x1a')];var _0x5e23e5=_0x29b3bf?_0x19bd9c[_0x3956('0x1d')]:_0x375980[_0x3956('0x1a')]+_0x375980[_0x3956('0x1c')];var _0x1a305e;if(_0x5e23e5>=_0x1e9745){_0x5e23e5=_0x1e9745;_0x1a305e=0xc8;}else{_0x1a305e=0xce;}_0x384b31[_0x3956('0x1e')](_0x1a305e);return _0x384b31[_0x3956('0x1f')]('Content-Range',_0x189e6c+'-'+_0x5e23e5+'/'+_0x1e9745)[_0x3956('0x19')](_0x19bd9c);}return null;};}function patchUpdates(_0x401aa2){return function(_0x5a2ba1){try{jsonpatch['apply'](_0x5a2ba1,_0x401aa2,!![]);}catch(_0x4d98b0){return BPromise[_0x3956('0x20')](_0x4d98b0);}return _0x5a2ba1[_0x3956('0x21')]();};}function saveUpdates(_0x4e7e56,_0x2f9bb5){return function(_0x5b2fdd){if(_0x5b2fdd){return _0x5b2fdd[_0x3956('0x22')](_0x4e7e56)['then'](function(_0x13feee){return _0x13feee;});}return null;};}function removeEntity(_0x1d39f7,_0x1395d4){return function(_0x1d9163){if(_0x1d9163){return _0x1d9163[_0x3956('0x23')]()[_0x3956('0x24')](function(){var _0x5e27fd=_0x1d9163['get']({'plain':!![]});var _0x23053d=_0x3956('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x23053d,'resourceId':_0x5e27fd['id']}})[_0x3956('0x24')](function(){return _0x1d9163;});})[_0x3956('0x24')](function(){_0x1d39f7['status'](0xcc)[_0x3956('0x26')]();});}};}function handleEntityNotFound(_0x34c843,_0x6dcf67){return function(_0x98bbcf){if(!_0x98bbcf){_0x34c843[_0x3956('0x18')](0x194);}return _0x98bbcf;};}function handleError(_0x4389be,_0x49d309){_0x49d309=_0x49d309||0x1f4;return function(_0x3fa582){logger[_0x3956('0x27')](_0x3fa582[_0x3956('0x28')]);if(_0x3fa582['name']){delete _0x3fa582[_0x3956('0x29')];}_0x4389be[_0x3956('0x1e')](_0x49d309)[_0x3956('0x2a')](_0x3fa582);};}exports['index']=function(_0x1bc983,_0x887861){var _0x8d5bdb={},_0x1681ba={},_0xef1b56={'count':0x0,'rows':[]};var _0x2e60f9=_[_0x3956('0x2b')](db[_0x3956('0x2c')][_0x3956('0x2d')],function(_0x3a6cdf){return{'name':_0x3a6cdf['fieldName'],'type':_0x3a6cdf[_0x3956('0x2e')][_0x3956('0x2f')]};});_0x1681ba['model']=_[_0x3956('0x2b')](_0x2e60f9,_0x3956('0x29'));_0x1681ba['query']=_[_0x3956('0x30')](_0x1bc983['query']);_0x1681ba[_0x3956('0x31')]=_[_0x3956('0x32')](_0x1681ba[_0x3956('0x33')],_0x1681ba['query']);_0x8d5bdb['attributes']=_[_0x3956('0x32')](_0x1681ba[_0x3956('0x33')],qs['fields'](_0x1bc983[_0x3956('0x34')]['fields']));_0x8d5bdb[_0x3956('0x35')]=_0x8d5bdb[_0x3956('0x35')][_0x3956('0x36')]?_0x8d5bdb[_0x3956('0x35')]:_0x1681ba[_0x3956('0x33')];if(!_0x1bc983[_0x3956('0x34')][_0x3956('0x37')](_0x3956('0x38'))){_0x8d5bdb['limit']=qs[_0x3956('0x1c')](_0x1bc983['query'][_0x3956('0x1c')]);_0x8d5bdb[_0x3956('0x1a')]=qs[_0x3956('0x1a')](_0x1bc983[_0x3956('0x34')][_0x3956('0x1a')]);}_0x8d5bdb[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x1bc983[_0x3956('0x34')][_0x3956('0x3a')]);_0x8d5bdb[_0x3956('0x3b')]=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x1bc983['query'],_0x1681ba[_0x3956('0x31')]),_0x2e60f9);if(_0x1bc983[_0x3956('0x34')][_0x3956('0x3d')]){_0x8d5bdb[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0x8d5bdb[_0x3956('0x3b')],{'$or':_[_0x3956('0x2b')](_0x2e60f9,function(_0x6f98f9){if(_0x6f98f9['type']!==_0x3956('0x3f')){var _0xbddef1={};_0xbddef1[_0x6f98f9[_0x3956('0x29')]]={'$like':'%'+_0x1bc983['query'][_0x3956('0x3d')]+'%'};return _0xbddef1;}})});}_0x8d5bdb=_[_0x3956('0x3e')]({},_0x8d5bdb,_0x1bc983['options']);var _0x4774c6={'where':_0x8d5bdb[_0x3956('0x3b')]};return db[_0x3956('0x2c')]['count'](_0x4774c6)[_0x3956('0x24')](function(_0x3e7e2e){_0xef1b56['count']=_0x3e7e2e;if(_0x1bc983['query'][_0x3956('0x40')]){_0x8d5bdb[_0x3956('0x41')]=[{'all':!![]}];}return db[_0x3956('0x2c')][_0x3956('0x42')](_0x8d5bdb);})[_0x3956('0x24')](function(_0x555fec){_0xef1b56[_0x3956('0x43')]=_0x555fec;return _0xef1b56;})['then'](respondWithFilteredResult(_0x887861,_0x8d5bdb))[_0x3956('0x44')](handleError(_0x887861,null));};exports[_0x3956('0x45')]=function(_0x52ed4e,_0x3bdf1e){var _0x4b4abd={'raw':![],'where':{'id':_0x52ed4e[_0x3956('0x46')]['id']}},_0x3f760d={};_0x3f760d[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x2c')][_0x3956('0x2d')]);_0x3f760d[_0x3956('0x34')]=_[_0x3956('0x30')](_0x52ed4e[_0x3956('0x34')]);_0x3f760d['filters']=_[_0x3956('0x32')](_0x3f760d['model'],_0x3f760d[_0x3956('0x34')]);_0x4b4abd[_0x3956('0x35')]=_[_0x3956('0x32')](_0x3f760d['model'],qs['fields'](_0x52ed4e['query'][_0x3956('0x47')]));_0x4b4abd[_0x3956('0x35')]=_0x4b4abd[_0x3956('0x35')][_0x3956('0x36')]?_0x4b4abd['attributes']:_0x3f760d[_0x3956('0x33')];if(_0x52ed4e[_0x3956('0x34')][_0x3956('0x40')]){_0x4b4abd[_0x3956('0x41')]=[{'all':!![]}];}_0x4b4abd=_[_0x3956('0x3e')]({},_0x4b4abd,_0x52ed4e[_0x3956('0x48')]);return db[_0x3956('0x2c')][_0x3956('0x49')](_0x4b4abd)[_0x3956('0x24')](handleEntityNotFound(_0x3bdf1e,null))['then'](respondWithResult(_0x3bdf1e,null))['catch'](handleError(_0x3bdf1e,null));};exports[_0x3956('0x4a')]=function(_0x42ecf4,_0x388587){return db[_0x3956('0x2c')]['create'](_0x42ecf4[_0x3956('0x4b')],{})['then'](function(_0x5ad00c){var _0x6bd2fd=_0x42ecf4[_0x3956('0x4c')][_0x3956('0x4d')]({'plain':!![]});if(!_0x6bd2fd)throw new Error(_0x3956('0x4e'));if(_0x6bd2fd[_0x3956('0x4f')]===_0x3956('0x4c')){var _0x5ebd96=_0x5ad00c[_0x3956('0x4d')]({'plain':!![]});var _0x39a651=_0x3956('0x25');return db['UserProfileSection'][_0x3956('0x49')]({'where':{'name':_0x39a651,'userProfileId':_0x6bd2fd[_0x3956('0x50')]},'raw':!![]})[_0x3956('0x24')](function(_0x5c01a4){if(_0x5c01a4&&_0x5c01a4[_0x3956('0x51')]===0x0){return db['UserProfileResource'][_0x3956('0x4a')]({'name':_0x5ebd96[_0x3956('0x29')],'resourceId':_0x5ebd96['id'],'type':_0x5c01a4[_0x3956('0x29')],'sectionId':_0x5c01a4['id']},{})[_0x3956('0x24')](function(){return _0x5ad00c;});}else{return _0x5ad00c;}})['catch'](function(_0x179d32){logger[_0x3956('0x27')](_0x3956('0x52'),_0x179d32);throw _0x179d32;});}return _0x5ad00c;})[_0x3956('0x24')](respondWithResult(_0x388587,0xc9))[_0x3956('0x44')](handleError(_0x388587,null));};exports[_0x3956('0x53')]=function(_0x58e930,_0x15e523){var _0x33aac9={'where':{'id':_0x58e930[_0x3956('0x46')]['id']}},_0x26c266={};_0x26c266[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x2c')][_0x3956('0x2d')]);_0x33aac9[_0x3956('0x35')]=_[_0x3956('0x32')](_0x26c266[_0x3956('0x33')],qs[_0x3956('0x47')](_0x58e930['query'][_0x3956('0x47')]));_0x33aac9['attributes']=_0x33aac9['attributes'][_0x3956('0x36')]?_0x33aac9[_0x3956('0x35')]:_0x26c266['model'];if(_0x58e930[_0x3956('0x34')][_0x3956('0x40')]){_0x33aac9[_0x3956('0x41')]=[{'all':!![]}];}_0x33aac9=_['merge']({},_0x33aac9,_0x58e930[_0x3956('0x48')]);return db[_0x3956('0x2c')]['find'](_0x33aac9)['then'](handleEntityNotFound(_0x15e523,null))[_0x3956('0x24')](function(_0x1fd8d6){if(_0x1fd8d6){var _0x290cfe=_0x1fd8d6[_0x3956('0x4d')]({'plain':!![]});_0x290cfe=qs[_0x3956('0x54')](_0x290cfe,['id','createdAt',_0x3956('0x55')]);_0x58e930['body']=_[_0x3956('0x54')](_0x58e930[_0x3956('0x4b')],['id',_0x3956('0x56'),'updatedAt']);return db[_0x3956('0x2c')][_0x3956('0x4a')](_['merge'](_0x290cfe,_0x58e930[_0x3956('0x4b')]),{'include':_0x58e930['query'][_0x3956('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x1fae63){var _0x1cc14a=_0x58e930[_0x3956('0x4c')][_0x3956('0x4d')]({'plain':!![]});if(!_0x1cc14a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cc14a[_0x3956('0x4f')]==='user'){var _0x1ee246=_0x1fae63[_0x3956('0x4d')]({'plain':!![]});var _0x8667ca=_0x3956('0x25');return db[_0x3956('0x57')][_0x3956('0x49')]({'where':{'name':_0x8667ca,'userProfileId':_0x1cc14a[_0x3956('0x50')]},'raw':!![]})[_0x3956('0x24')](function(_0x1954a4){if(_0x1954a4&&_0x1954a4['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1ee246[_0x3956('0x29')],'resourceId':_0x1ee246['id'],'type':_0x1954a4[_0x3956('0x29')],'sectionId':_0x1954a4['id']},{})[_0x3956('0x24')](function(){return _0x1fae63;});}else{return _0x1fae63;}})[_0x3956('0x44')](function(_0x32e201){logger['error'](_0x3956('0x52'),_0x32e201);throw _0x32e201;});}return _0x1fae63;});}})[_0x3956('0x24')](respondWithResult(_0x15e523,0xc9))[_0x3956('0x44')](handleError(_0x15e523,null));};exports[_0x3956('0x22')]=function(_0x567160,_0xf913ed){if(_0x567160[_0x3956('0x4b')]['id']){delete _0x567160[_0x3956('0x4b')]['id'];}return db[_0x3956('0x2c')][_0x3956('0x49')]({'where':{'id':_0x567160[_0x3956('0x46')]['id']}})[_0x3956('0x24')](handleEntityNotFound(_0xf913ed,null))[_0x3956('0x24')](saveUpdates(_0x567160[_0x3956('0x4b')],null))['then'](respondWithResult(_0xf913ed,null))['catch'](handleError(_0xf913ed,null));};exports['destroy']=function(_0x7841a6,_0x14aada){return db['Campaign'][_0x3956('0x49')]({'where':{'id':_0x7841a6['params']['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x14aada,null))['then'](removeEntity(_0x14aada,null))['catch'](handleError(_0x14aada,null));};exports[_0x3956('0x58')]=function(_0x404096,_0x2f3e94,_0xb52013){var _0x4a1baa={'raw':!![],'where':{}};var _0x54d174={};var _0x55e3de={'count':0x0,'rows':[]};return db[_0x3956('0x2c')]['findOne']({'where':{'id':_0x404096['params']['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x2f3e94,null))[_0x3956('0x24')](function(_0x1691e2){if(_0x1691e2){_0x54d174[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x59')][_0x3956('0x2d')]);_0x54d174['query']=_[_0x3956('0x30')](_0x404096[_0x3956('0x34')]);_0x54d174['filters']=_[_0x3956('0x32')](_0x54d174[_0x3956('0x33')],_0x54d174[_0x3956('0x34')]);_0x4a1baa[_0x3956('0x35')]=_[_0x3956('0x32')](_0x54d174[_0x3956('0x33')],qs['fields'](_0x404096[_0x3956('0x34')][_0x3956('0x47')]));_0x4a1baa[_0x3956('0x35')]=_0x4a1baa[_0x3956('0x35')]['length']?_0x4a1baa[_0x3956('0x35')]:_0x54d174[_0x3956('0x33')];if(!_0x404096[_0x3956('0x34')][_0x3956('0x37')](_0x3956('0x38'))){_0x4a1baa[_0x3956('0x1c')]=qs[_0x3956('0x1c')](_0x404096[_0x3956('0x34')][_0x3956('0x1c')]);_0x4a1baa['offset']=qs[_0x3956('0x1a')](_0x404096[_0x3956('0x34')]['offset']);}_0x4a1baa[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x404096[_0x3956('0x34')][_0x3956('0x3a')]);_0x4a1baa[_0x3956('0x3b')]=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x404096[_0x3956('0x34')],_0x54d174[_0x3956('0x31')]));_0x4a1baa['where'][_0x3956('0x5a')]=_0x1691e2['id'];if(_0x404096[_0x3956('0x34')][_0x3956('0x3d')]){_0x4a1baa[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0x4a1baa['where'],{'$or':_[_0x3956('0x2b')](_0x4a1baa[_0x3956('0x35')],function(_0x2cd057){var _0x4d9105={};_0x4d9105[_0x2cd057]={'$like':'%'+_0x404096['query']['filter']+'%'};return _0x4d9105;})});}_0x4a1baa=_['merge']({},_0x4a1baa,_0x404096[_0x3956('0x48')]);return db[_0x3956('0x59')][_0x3956('0x1d')]({'where':_0x4a1baa[_0x3956('0x3b')]})['then'](function(_0x51e223){_0x55e3de[_0x3956('0x1d')]=_0x51e223;if(_0x404096[_0x3956('0x34')][_0x3956('0x40')]){_0x4a1baa[_0x3956('0x41')]=[{'all':!![]}];}return db[_0x3956('0x59')]['findAll'](_0x4a1baa);})['then'](function(_0x32784b){_0x55e3de['rows']=_0x32784b;return _0x55e3de;});}})[_0x3956('0x24')](respondWithFilteredResult(_0x2f3e94,_0x4a1baa))['catch'](handleError(_0x2f3e94,null));};exports[_0x3956('0x5b')]=function(_0x1d1e30,_0x9d9343,_0x59b46f){var _0x5d0d85={'raw':!![],'where':{}};var _0x2fcd97={};var _0x2e1161={'count':0x0,'rows':[]};return db[_0x3956('0x2c')]['findOne']({'where':{'id':_0x1d1e30[_0x3956('0x46')]['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x9d9343,null))[_0x3956('0x24')](function(_0x18f78b){if(_0x18f78b){_0x2fcd97['model']=_[_0x3956('0x30')](db[_0x3956('0x5c')][_0x3956('0x2d')]);_0x2fcd97[_0x3956('0x34')]=_['keys'](_0x1d1e30[_0x3956('0x34')]);_0x2fcd97[_0x3956('0x31')]=_[_0x3956('0x32')](_0x2fcd97['model'],_0x2fcd97[_0x3956('0x34')]);_0x5d0d85[_0x3956('0x35')]=_[_0x3956('0x32')](_0x2fcd97[_0x3956('0x33')],qs[_0x3956('0x47')](_0x1d1e30[_0x3956('0x34')]['fields']));_0x5d0d85[_0x3956('0x35')]=_0x5d0d85[_0x3956('0x35')][_0x3956('0x36')]?_0x5d0d85[_0x3956('0x35')]:_0x2fcd97['model'];if(!_0x1d1e30[_0x3956('0x34')][_0x3956('0x37')](_0x3956('0x38'))){_0x5d0d85[_0x3956('0x1c')]=qs['limit'](_0x1d1e30[_0x3956('0x34')][_0x3956('0x1c')]);_0x5d0d85[_0x3956('0x1a')]=qs[_0x3956('0x1a')](_0x1d1e30[_0x3956('0x34')][_0x3956('0x1a')]);}_0x5d0d85[_0x3956('0x39')]=qs['sort'](_0x1d1e30[_0x3956('0x34')]['sort']);_0x5d0d85[_0x3956('0x3b')]=qs[_0x3956('0x31')](_['pick'](_0x1d1e30[_0x3956('0x34')],_0x2fcd97['filters']));_0x5d0d85[_0x3956('0x3b')][_0x3956('0x5a')]=_0x18f78b['id'];if(_0x1d1e30[_0x3956('0x34')][_0x3956('0x3d')]){_0x5d0d85[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0x5d0d85['where'],{'$or':_[_0x3956('0x2b')](_0x5d0d85[_0x3956('0x35')],function(_0x479e82){var _0x495902={};_0x495902[_0x479e82]={'$like':'%'+_0x1d1e30[_0x3956('0x34')]['filter']+'%'};return _0x495902;})});}_0x5d0d85=_[_0x3956('0x3e')]({},_0x5d0d85,_0x1d1e30[_0x3956('0x48')]);return db['CmHopperHistory'][_0x3956('0x1d')]({'where':_0x5d0d85[_0x3956('0x3b')]})['then'](function(_0x42b110){_0x2e1161[_0x3956('0x1d')]=_0x42b110;if(_0x1d1e30['query']['includeAll']){_0x5d0d85[_0x3956('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3956('0x42')](_0x5d0d85);})[_0x3956('0x24')](function(_0x42ddc9){_0x2e1161['rows']=_0x42ddc9;return _0x2e1161;});}})[_0x3956('0x24')](respondWithFilteredResult(_0x9d9343,_0x5d0d85))['catch'](handleError(_0x9d9343,null));};exports[_0x3956('0x5d')]=function(_0x705055,_0x48741a,_0x20af9e){var _0x4083a8={'raw':!![],'where':{}};var _0x351529={};var _0xec91f7={'count':0x0,'rows':[]};return db[_0x3956('0x2c')][_0x3956('0x5e')]({'where':{'id':_0x705055[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0x48741a,null))[_0x3956('0x24')](function(_0x17cd9d){if(_0x17cd9d){_0x351529[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x5f')][_0x3956('0x2d')]);_0x351529[_0x3956('0x34')]=_[_0x3956('0x30')](_0x705055['query']);_0x351529[_0x3956('0x31')]=_['intersection'](_0x351529[_0x3956('0x33')],_0x351529[_0x3956('0x34')]);_0x4083a8[_0x3956('0x35')]=_[_0x3956('0x32')](_0x351529['model'],qs[_0x3956('0x47')](_0x705055[_0x3956('0x34')][_0x3956('0x47')]));_0x4083a8['attributes']=_0x4083a8[_0x3956('0x35')][_0x3956('0x36')]?_0x4083a8[_0x3956('0x35')]:_0x351529[_0x3956('0x33')];if(!_0x705055['query'][_0x3956('0x37')]('nolimit')){_0x4083a8[_0x3956('0x1c')]=qs['limit'](_0x705055[_0x3956('0x34')]['limit']);_0x4083a8['offset']=qs['offset'](_0x705055[_0x3956('0x34')][_0x3956('0x1a')]);}_0x4083a8[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x705055[_0x3956('0x34')][_0x3956('0x3a')]);_0x4083a8['where']=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x705055['query'],_0x351529[_0x3956('0x31')]));_0x4083a8[_0x3956('0x3b')]['CampaignId']=_0x17cd9d['id'];if(_0x705055['query']['filter']){_0x4083a8['where']=_['merge'](_0x4083a8['where'],{'$or':_[_0x3956('0x2b')](_0x4083a8[_0x3956('0x35')],function(_0x1c2944){var _0x3b7bd1={};_0x3b7bd1[_0x1c2944]={'$like':'%'+_0x705055[_0x3956('0x34')]['filter']+'%'};return _0x3b7bd1;})});}_0x4083a8=_[_0x3956('0x3e')]({},_0x4083a8,_0x705055[_0x3956('0x48')]);return db['CmHopperFinal']['count']({'where':_0x4083a8['where']})[_0x3956('0x24')](function(_0x222b4b){_0xec91f7[_0x3956('0x1d')]=_0x222b4b;if(_0x705055[_0x3956('0x34')][_0x3956('0x40')]){_0x4083a8[_0x3956('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3956('0x42')](_0x4083a8);})['then'](function(_0x5da717){_0xec91f7['rows']=_0x5da717;return _0xec91f7;});}})[_0x3956('0x24')](respondWithFilteredResult(_0x48741a,_0x4083a8))[_0x3956('0x44')](handleError(_0x48741a,null));};exports[_0x3956('0x60')]=function(_0x437730,_0x2172a2,_0x5e2763){var _0x287f8c={'raw':!![],'where':{}};var _0x38b198={};var _0x1c64ed={'count':0x0,'rows':[]};return db[_0x3956('0x2c')][_0x3956('0x5e')]({'where':{'id':_0x437730[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0x2172a2,null))[_0x3956('0x24')](function(_0x14ef33){if(_0x14ef33){_0x38b198[_0x3956('0x33')]=_[_0x3956('0x30')](db[_0x3956('0x61')][_0x3956('0x2d')]);_0x38b198[_0x3956('0x34')]=_['keys'](_0x437730['query']);_0x38b198[_0x3956('0x31')]=_[_0x3956('0x32')](_0x38b198[_0x3956('0x33')],_0x38b198[_0x3956('0x34')]);_0x287f8c[_0x3956('0x35')]=_[_0x3956('0x32')](_0x38b198[_0x3956('0x33')],qs[_0x3956('0x47')](_0x437730['query']['fields']));_0x287f8c[_0x3956('0x35')]=_0x287f8c['attributes'][_0x3956('0x36')]?_0x287f8c['attributes']:_0x38b198[_0x3956('0x33')];if(!_0x437730[_0x3956('0x34')]['hasOwnProperty'](_0x3956('0x38'))){_0x287f8c[_0x3956('0x1c')]=qs[_0x3956('0x1c')](_0x437730[_0x3956('0x34')]['limit']);_0x287f8c['offset']=qs[_0x3956('0x1a')](_0x437730[_0x3956('0x34')]['offset']);}_0x287f8c[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x437730[_0x3956('0x34')][_0x3956('0x3a')]);_0x287f8c['where']=qs['filters'](_[_0x3956('0x3c')](_0x437730['query'],_0x38b198[_0x3956('0x31')]));_0x287f8c[_0x3956('0x3b')][_0x3956('0x5a')]=_0x14ef33['id'];if(_0x437730[_0x3956('0x34')]['filter']){_0x287f8c[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0x287f8c[_0x3956('0x3b')],{'$or':_['map'](_0x287f8c[_0x3956('0x35')],function(_0xbbeff4){var _0x5b5a89={};_0x5b5a89[_0xbbeff4]={'$like':'%'+_0x437730[_0x3956('0x34')][_0x3956('0x3d')]+'%'};return _0x5b5a89;})});}_0x287f8c=_[_0x3956('0x3e')]({},_0x287f8c,_0x437730[_0x3956('0x48')]);return db[_0x3956('0x61')][_0x3956('0x1d')]({'where':_0x287f8c['where']})[_0x3956('0x24')](function(_0x576f34){_0x1c64ed[_0x3956('0x1d')]=_0x576f34;if(_0x437730[_0x3956('0x34')][_0x3956('0x40')]){_0x287f8c[_0x3956('0x41')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x287f8c);})['then'](function(_0x11feda){_0x1c64ed[_0x3956('0x43')]=_0x11feda;return _0x1c64ed;});}})[_0x3956('0x24')](respondWithFilteredResult(_0x2172a2,_0x287f8c))[_0x3956('0x44')](handleError(_0x2172a2,null));};exports[_0x3956('0x62')]=function(_0x151687,_0xa98fd1,_0x3b06ff){var _0x7227a4={};var _0x42eddc={};var _0x370ea9;var _0x57fdb6;return db[_0x3956('0x2c')][_0x3956('0x5e')]({'where':{'id':_0x151687[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0xa98fd1,null))[_0x3956('0x24')](function(_0x891395){if(_0x891395){_0x370ea9=_0x891395;_0x42eddc[_0x3956('0x33')]=_[_0x3956('0x30')](db['CmList']['rawAttributes']);_0x42eddc[_0x3956('0x34')]=_['keys'](_0x151687[_0x3956('0x34')]);_0x42eddc[_0x3956('0x31')]=_[_0x3956('0x32')](_0x42eddc[_0x3956('0x33')],_0x42eddc[_0x3956('0x34')]);_0x7227a4[_0x3956('0x35')]=_[_0x3956('0x32')](_0x42eddc[_0x3956('0x33')],qs[_0x3956('0x47')](_0x151687['query'][_0x3956('0x47')]));_0x7227a4[_0x3956('0x35')]=_0x7227a4[_0x3956('0x35')][_0x3956('0x36')]?_0x7227a4[_0x3956('0x35')]:_0x42eddc[_0x3956('0x33')];_0x7227a4[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x151687['query'][_0x3956('0x3a')]);_0x7227a4[_0x3956('0x3b')]=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x151687[_0x3956('0x34')],_0x42eddc[_0x3956('0x31')]));if(_0x151687[_0x3956('0x34')][_0x3956('0x3d')]){_0x7227a4['where']=_[_0x3956('0x3e')](_0x7227a4[_0x3956('0x3b')],{'$or':_['map'](_0x7227a4['attributes'],function(_0x1b58c2){var _0x3da877={};_0x3da877[_0x1b58c2]={'$like':'%'+_0x151687[_0x3956('0x34')]['filter']+'%'};return _0x3da877;})});}_0x7227a4=_[_0x3956('0x3e')]({},_0x7227a4,_0x151687['options']);return _0x370ea9[_0x3956('0x62')](_0x7227a4);}})['then'](function(_0x1ed3f9){if(_0x1ed3f9){_0x57fdb6=_0x1ed3f9[_0x3956('0x36')];if(!_0x151687['query']['hasOwnProperty']('nolimit')){_0x7227a4['limit']=qs['limit'](_0x151687[_0x3956('0x34')]['limit']);_0x7227a4[_0x3956('0x1a')]=qs[_0x3956('0x1a')](_0x151687['query'][_0x3956('0x1a')]);}return _0x370ea9['getLists'](_0x7227a4);}})[_0x3956('0x24')](function(_0xca7e8){if(_0xca7e8){return _0xca7e8?{'count':_0x57fdb6,'rows':_0xca7e8}:null;}})[_0x3956('0x24')](respondWithResult(_0xa98fd1,null))[_0x3956('0x44')](handleError(_0xa98fd1,null));};exports[_0x3956('0x63')]=function(_0x34c4c8,_0x416e33,_0x365ddd){var _0x544edf,_0x1306e2;var _0x75b3ca=[];var _0x5ac05e=moment()['format'](_0x3956('0x64'));return db['Campaign'][_0x3956('0x49')]({'where':{'id':_0x34c4c8[_0x3956('0x46')]['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x416e33,null))[_0x3956('0x24')](function(_0x2f958e){if(_0x2f958e){_0x1306e2=_0x2f958e;return _0x2f958e['addLists'](_0x34c4c8[_0x3956('0x4b')]['ids'],_['omit'](_0x34c4c8[_0x3956('0x4b')],['ids','id'])||{});}return null;})[_0x3956('0x65')](function(_0x542534){var _0x58c70e;var _0x50a0d3;_0x544edf=_0x542534||[];var _0x110744=[];if(_0x542534){for(var _0x4b4955=0x0;_0x4b4955<_0x542534[_0x3956('0x36')];_0x4b4955+=0x1){var _0x472179=_0x542534[_0x4b4955][_0x3956('0x4d')]({'plain':!![]});_0x1306e2[_0x3956('0x66')]=_0x34c4c8[_0x3956('0x4b')][_0x3956('0x66')]?_0x34c4c8[_0x3956('0x4b')][_0x3956('0x66')]:_0x1306e2[_0x3956('0x66')];switch(_0x1306e2[_0x3956('0x66')]){case _0x3956('0x67'):_0x58c70e=squel['insert']()[_0x3956('0x68')](_0x3956('0x69'))[_0x3956('0x6a')](['phone',_0x3956('0x6b'),_0x3956('0x6c'),'ListId',_0x3956('0x5a'),_0x3956('0x56'),'updatedAt'],squel[_0x3956('0x6d')]()[_0x3956('0x6e')](_0x3956('0x6f'),_0x3956('0x6f'))['field'](_0x3956('0x70'),_0x3956('0x6b'))[_0x3956('0x6e')]('id',_0x3956('0x6c'))[_0x3956('0x6e')](_0x472179[_0x3956('0x71')][_0x3956('0x72')](),_0x3956('0x73'))[_0x3956('0x6e')](_0x34c4c8[_0x3956('0x46')]['id']['toString'](),_0x3956('0x5a'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x56'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27','updatedAt')[_0x3956('0x74')]('cm_contacts')[_0x3956('0x3b')](_0x3956('0x75'))[_0x3956('0x3b')](_0x3956('0x76'),_0x472179[_0x3956('0x71')][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x77'))[_0x3956('0x3b')](_0x3956('0x78'),squel[_0x3956('0x6d')]()[_0x3956('0x6e')](_0x3956('0x79'))[_0x3956('0x74')]('cm_hopper_final')[_0x3956('0x3b')](_0x3956('0x7a'),_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')]()))[_0x3956('0x3b')](_0x3956('0x78'),squel[_0x3956('0x6d')]()['field']('COALESCE(phone,\x27\x27)')[_0x3956('0x74')](_0x3956('0x69'))[_0x3956('0x3b')](_0x3956('0x7a'),_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')]())))[_0x3956('0x72')]();break;case _0x3956('0x7b'):_0x58c70e=squel[_0x3956('0x7c')]()[_0x3956('0x68')](_0x3956('0x69'))['fromQuery'](['phone','scheduledAt',_0x3956('0x6c'),_0x3956('0x73'),_0x3956('0x5a'),_0x3956('0x56'),_0x3956('0x55')],squel[_0x3956('0x6d')]()['field']('phone',_0x3956('0x6f'))[_0x3956('0x6e')](_0x3956('0x70'),_0x3956('0x6b'))['field']('id',_0x3956('0x6c'))[_0x3956('0x6e')](_0x472179[_0x3956('0x71')][_0x3956('0x72')](),'ListId')[_0x3956('0x6e')](_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')](),_0x3956('0x5a'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x56'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27','updatedAt')[_0x3956('0x74')](_0x3956('0x7d'))[_0x3956('0x3b')](_0x3956('0x75'))[_0x3956('0x3b')](_0x3956('0x76'),_0x472179[_0x3956('0x71')][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x77'))['where'](_0x3956('0x78'),squel[_0x3956('0x6d')]()[_0x3956('0x6e')](_0x3956('0x7e'))[_0x3956('0x74')](_0x3956('0x69'))[_0x3956('0x3b')](_0x3956('0x7a'),_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')]())))[_0x3956('0x72')]();break;default:_0x58c70e=squel[_0x3956('0x7c')]()[_0x3956('0x68')]('cm_hopper')[_0x3956('0x6a')](['phone','scheduledAt','ContactId',_0x3956('0x73'),_0x3956('0x5a'),_0x3956('0x56'),_0x3956('0x55')],squel[_0x3956('0x6d')]()['field']('phone',_0x3956('0x6f'))['field']('NOW()',_0x3956('0x6b'))['field']('id',_0x3956('0x6c'))[_0x3956('0x6e')](_0x472179[_0x3956('0x71')][_0x3956('0x72')](),'ListId')[_0x3956('0x6e')](_0x34c4c8[_0x3956('0x46')]['id']['toString'](),'CampaignId')[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x56'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27','updatedAt')[_0x3956('0x74')](_0x3956('0x7d'))[_0x3956('0x3b')]('deletedAt\x20IS\x20NULL')[_0x3956('0x3b')](_0x3956('0x76'),_0x472179[_0x3956('0x71')][_0x3956('0x72')]())['where'](_0x3956('0x77')))[_0x3956('0x72')]();}_0x50a0d3=squel[_0x3956('0x7c')]()[_0x3956('0x68')](_0x3956('0x7f'))[_0x3956('0x6a')]([_0x3956('0x80'),_0x3956('0x6b'),_0x3956('0x6f'),_0x3956('0x81'),_0x3956('0x56'),_0x3956('0x55')],squel[_0x3956('0x6d')]()['field']('h.id','id')[_0x3956('0x6e')](_0x3956('0x70'),_0x3956('0x6b'))[_0x3956('0x6e')]('ci.item',_0x3956('0x6f'))[_0x3956('0x6e')](_0x3956('0x82'),_0x3956('0x81'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x56'))[_0x3956('0x6e')]('\x27'+_0x5ac05e+'\x27',_0x3956('0x55'))[_0x3956('0x74')](_0x3956('0x83'),'ci')['join'](_0x3956('0x69'),'h',_0x3956('0x84'))[_0x3956('0x3b')](_0x3956('0x85'),_0x472179[_0x3956('0x71')][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x86'),_0x34c4c8[_0x3956('0x46')]['id'][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x87'),_0x5ac05e))[_0x3956('0x72')]();_0x110744[_0x3956('0x88')](db[_0x3956('0x89')][_0x3956('0x34')](_0x58c70e));_0x75b3ca[_0x3956('0x88')](db[_0x3956('0x89')][_0x3956('0x34')](_0x50a0d3));}return BPromise[_0x3956('0x8a')](_0x110744);}})[_0x3956('0x24')](function(){return BPromise[_0x3956('0x8a')](_0x75b3ca);})['then'](function(){return _0x544edf;})[_0x3956('0x24')](respondWithResult(_0x416e33,null))[_0x3956('0x44')](handleError(_0x416e33,null));};exports[_0x3956('0x8b')]=function(_0x129263,_0x269f91,_0x17c85f){return db[_0x3956('0x2c')][_0x3956('0x49')]({'where':{'id':_0x129263['params']['id']}})[_0x3956('0x24')](handleEntityNotFound(_0x269f91,null))[_0x3956('0x24')](function(_0x3ebff1){if(_0x3ebff1){return _0x3ebff1[_0x3956('0x8b')](_0x129263[_0x3956('0x34')][_0x3956('0x8c')]);}})['then'](function(_0xe176d){if(_0xe176d){return db[_0x3956('0x59')]['destroy']({'where':{'ListId':_0x129263[_0x3956('0x34')][_0x3956('0x8c')],'CampaignId':_0x129263[_0x3956('0x46')]['id']}})[_0x3956('0x24')](function(){return _0xe176d;});}})[_0x3956('0x24')](respondWithStatusCode(_0x269f91,null))[_0x3956('0x44')](handleError(_0x269f91,null));};exports[_0x3956('0x8d')]=function(_0x141c99,_0x3cff5d,_0x4a999e){var _0xc25415={};var _0x4662d9={};var _0x1b7843;var _0xa17b7c;return db[_0x3956('0x2c')][_0x3956('0x5e')]({'where':{'id':_0x141c99[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0x3cff5d,null))[_0x3956('0x24')](function(_0x25a631){if(_0x25a631){_0x1b7843=_0x25a631;_0x4662d9['model']=_[_0x3956('0x30')](db[_0x3956('0x8e')][_0x3956('0x2d')]);_0x4662d9[_0x3956('0x34')]=_['keys'](_0x141c99[_0x3956('0x34')]);_0x4662d9[_0x3956('0x31')]=_[_0x3956('0x32')](_0x4662d9[_0x3956('0x33')],_0x4662d9[_0x3956('0x34')]);_0xc25415[_0x3956('0x35')]=_[_0x3956('0x32')](_0x4662d9[_0x3956('0x33')],qs[_0x3956('0x47')](_0x141c99[_0x3956('0x34')][_0x3956('0x47')]));_0xc25415[_0x3956('0x35')]=_0xc25415[_0x3956('0x35')][_0x3956('0x36')]?_0xc25415[_0x3956('0x35')]:_0x4662d9[_0x3956('0x33')];_0xc25415[_0x3956('0x39')]=qs[_0x3956('0x3a')](_0x141c99[_0x3956('0x34')][_0x3956('0x3a')]);_0xc25415[_0x3956('0x3b')]=qs[_0x3956('0x31')](_[_0x3956('0x3c')](_0x141c99['query'],_0x4662d9[_0x3956('0x31')]));if(_0x141c99[_0x3956('0x34')]['filter']){_0xc25415[_0x3956('0x3b')]=_[_0x3956('0x3e')](_0xc25415[_0x3956('0x3b')],{'$or':_[_0x3956('0x2b')](_0xc25415['attributes'],function(_0x59e0b7){var _0x2d2581={};_0x2d2581[_0x59e0b7]={'$like':'%'+_0x141c99[_0x3956('0x34')][_0x3956('0x3d')]+'%'};return _0x2d2581;})});}_0xc25415=_[_0x3956('0x3e')]({},_0xc25415,_0x141c99[_0x3956('0x48')]);return _0x1b7843[_0x3956('0x8d')](_0xc25415);}})[_0x3956('0x24')](function(_0x11176f){if(_0x11176f){_0xa17b7c=_0x11176f[_0x3956('0x36')];if(!_0x141c99['query'][_0x3956('0x37')](_0x3956('0x38'))){_0xc25415[_0x3956('0x1c')]=qs[_0x3956('0x1c')](_0x141c99[_0x3956('0x34')]['limit']);_0xc25415[_0x3956('0x1a')]=qs[_0x3956('0x1a')](_0x141c99[_0x3956('0x34')][_0x3956('0x1a')]);}return _0x1b7843['getBlackLists'](_0xc25415);}})[_0x3956('0x24')](function(_0x4d8c7a){if(_0x4d8c7a){return _0x4d8c7a?{'count':_0xa17b7c,'rows':_0x4d8c7a}:null;}})['then'](respondWithResult(_0x3cff5d,null))['catch'](handleError(_0x3cff5d,null));};exports[_0x3956('0x8f')]=function(_0x1bb6af,_0x18ed6b,_0x5fffc9){var _0x10dd2e,_0x43aae2;var _0x31c62a=[];var _0x4ca802=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3956('0x2c')]['find']({'where':{'id':_0x1bb6af[_0x3956('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ed6b,null))[_0x3956('0x24')](function(_0x1f91b5){if(_0x1f91b5){_0x43aae2=_0x1f91b5;return _0x1f91b5[_0x3956('0x8f')](_0x1bb6af[_0x3956('0x4b')][_0x3956('0x8c')],_['omit'](_0x1bb6af[_0x3956('0x4b')],[_0x3956('0x8c'),'id'])||{});}return null;})[_0x3956('0x65')](function(_0x82ae4e){var _0x4f1d80;var _0x4c1bc9;_0x10dd2e=_0x82ae4e||[];var _0x3f7708=[];if(_0x82ae4e){for(var _0x25e5be=0x0;_0x25e5be<_0x82ae4e[_0x3956('0x36')];_0x25e5be+=0x1){var _0xccaaa0=_0x82ae4e[_0x25e5be][_0x3956('0x4d')]({'plain':!![]});_0x4f1d80=squel[_0x3956('0x7c')]()[_0x3956('0x68')](_0x3956('0x90'))[_0x3956('0x6a')](['phone',_0x3956('0x6c'),_0x3956('0x73'),_0x3956('0x5a'),_0x3956('0x56'),_0x3956('0x55')],squel[_0x3956('0x6d')]()[_0x3956('0x6e')](_0x3956('0x6f'),'phone')[_0x3956('0x6e')]('id',_0x3956('0x6c'))[_0x3956('0x6e')](_0xccaaa0[_0x3956('0x71')][_0x3956('0x72')](),_0x3956('0x73'))[_0x3956('0x6e')](_0x1bb6af['params']['id'][_0x3956('0x72')](),_0x3956('0x5a'))[_0x3956('0x6e')](_0x3956('0x70'),_0x3956('0x56'))['field'](_0x3956('0x70'),_0x3956('0x55'))[_0x3956('0x74')]('cm_contacts')[_0x3956('0x3b')](_0x3956('0x75'))[_0x3956('0x3b')](_0x3956('0x76'),_0xccaaa0['CmListId'][_0x3956('0x72')]())[_0x3956('0x3b')](_0x3956('0x77')))[_0x3956('0x72')]();_0x3f7708[_0x3956('0x88')](db[_0x3956('0x89')][_0x3956('0x34')](_0x4f1d80));}return BPromise['all'](_0x3f7708);}})[_0x3956('0x24')](function(){return _0x10dd2e;})['then'](respondWithResult(_0x18ed6b,null))[_0x3956('0x44')](handleError(_0x18ed6b,null));};exports['removeBlackLists']=function(_0x25d2c3,_0x3beaff,_0x40aac6){return db[_0x3956('0x2c')][_0x3956('0x49')]({'where':{'id':_0x25d2c3['params']['id']}})['then'](handleEntityNotFound(_0x3beaff,null))[_0x3956('0x24')](function(_0x374f64){if(_0x374f64){return _0x374f64[_0x3956('0x91')](_0x25d2c3[_0x3956('0x34')][_0x3956('0x8c')]);}})[_0x3956('0x24')](function(_0xce0535){if(_0xce0535){return db[_0x3956('0x61')][_0x3956('0x23')]({'where':{'ListId':_0x25d2c3[_0x3956('0x34')][_0x3956('0x8c')],'CampaignId':_0x25d2c3[_0x3956('0x46')]['id']}})[_0x3956('0x24')](function(){return _0xce0535;});}})[_0x3956('0x24')](respondWithStatusCode(_0x3beaff,null))[_0x3956('0x44')](handleError(_0x3beaff,null));};
\ No newline at end of file
+var _0x60d7=['phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','from','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','CmHopper','hasOwnProperty','nolimit','CampaignId','CmHopperHistory','findAll','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x60d7,0x139));var _0x760d=function(_0x238e2d,_0x3fc80c){_0x238e2d=_0x238e2d-0x0;var _0x51eb18=_0x60d7[_0x238e2d];return _0x51eb18;};'use strict';var emlformat=require(_0x760d('0x0'));var rimraf=require(_0x760d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x760d('0x2'));var rp=require('request-promise');var moment=require(_0x760d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x760d('0x4'));var util=require(_0x760d('0x5'));var path=require(_0x760d('0x6'));var sox=require(_0x760d('0x7'));var csv=require('to-csv');var ejs=require(_0x760d('0x8'));var fs=require('fs');var fs_extra=require(_0x760d('0x9'));var _=require(_0x760d('0xa'));var squel=require(_0x760d('0xb'));var crypto=require(_0x760d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x760d('0xd'));var toCsv=require(_0x760d('0xe'));var querystring=require(_0x760d('0xf'));var Papa=require('papaparse');var Redis=require(_0x760d('0x10'));var authService=require(_0x760d('0x11'));var qs=require(_0x760d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x760d('0x13'));var logger=require(_0x760d('0x14'))('api');var utils=require(_0x760d('0x15'));var config=require(_0x760d('0x16'));var licenseUtil=require(_0x760d('0x17'));var db=require(_0x760d('0x18'))['db'];function respondWithStatusCode(_0x1c6d0d,_0x40b3ee){_0x40b3ee=_0x40b3ee||0xcc;return function(_0xffb1f9){if(_0xffb1f9){return _0x1c6d0d[_0x760d('0x19')](_0x40b3ee);}return _0x1c6d0d[_0x760d('0x1a')](_0x40b3ee)[_0x760d('0x1b')]();};}function respondWithResult(_0x28bd1b,_0x543d6e){_0x543d6e=_0x543d6e||0xc8;return function(_0x1fed3a){if(_0x1fed3a){return _0x28bd1b['status'](_0x543d6e)[_0x760d('0x1c')](_0x1fed3a);}};}function respondWithFilteredResult(_0x62b5e9,_0x13118d){return function(_0x86e62a){if(_0x86e62a){var _0x49c0d4=typeof _0x13118d['offset']===_0x760d('0x1d')&&typeof _0x13118d[_0x760d('0x1e')]===_0x760d('0x1d');var _0x436bbd=_0x86e62a[_0x760d('0x1f')];var _0x1bed8=_0x49c0d4?0x0:_0x13118d['offset'];var _0x49cac3=_0x49c0d4?_0x86e62a[_0x760d('0x1f')]:_0x13118d[_0x760d('0x20')]+_0x13118d[_0x760d('0x1e')];var _0x2bbf82;if(_0x49cac3>=_0x436bbd){_0x49cac3=_0x436bbd;_0x2bbf82=0xc8;}else{_0x2bbf82=0xce;}_0x62b5e9[_0x760d('0x1a')](_0x2bbf82);return _0x62b5e9[_0x760d('0x21')](_0x760d('0x22'),_0x1bed8+'-'+_0x49cac3+'/'+_0x436bbd)[_0x760d('0x1c')](_0x86e62a);}return null;};}function patchUpdates(_0x37d5a5){return function(_0x2f74b5){try{jsonpatch['apply'](_0x2f74b5,_0x37d5a5,!![]);}catch(_0xf3c65f){return BPromise[_0x760d('0x23')](_0xf3c65f);}return _0x2f74b5[_0x760d('0x24')]();};}function saveUpdates(_0x2797bf,_0x234934){return function(_0x57dcea){if(_0x57dcea){return _0x57dcea[_0x760d('0x25')](_0x2797bf)[_0x760d('0x26')](function(_0x1fac3c){return _0x1fac3c;});}return null;};}function removeEntity(_0x516133,_0x55b45a){return function(_0x44b653){if(_0x44b653){return _0x44b653[_0x760d('0x27')]()[_0x760d('0x26')](function(){var _0x19cd53=_0x44b653[_0x760d('0x28')]({'plain':!![]});var _0x16bbdb=_0x760d('0x29');return db[_0x760d('0x2a')]['destroy']({'where':{'type':_0x16bbdb,'resourceId':_0x19cd53['id']}})[_0x760d('0x26')](function(){return _0x44b653;});})[_0x760d('0x26')](function(){_0x516133[_0x760d('0x1a')](0xcc)[_0x760d('0x1b')]();});}};}function handleEntityNotFound(_0x47c5e6,_0x2b2251){return function(_0x58b4fb){if(!_0x58b4fb){_0x47c5e6['sendStatus'](0x194);}return _0x58b4fb;};}function handleError(_0x10696b,_0x4619ed){_0x4619ed=_0x4619ed||0x1f4;return function(_0x3bb676){logger[_0x760d('0x2b')](_0x3bb676[_0x760d('0x2c')]);if(_0x3bb676[_0x760d('0x2d')]){delete _0x3bb676[_0x760d('0x2d')];}_0x10696b[_0x760d('0x1a')](_0x4619ed)['send'](_0x3bb676);};}exports[_0x760d('0x2e')]=function(_0xc4fec8,_0x27cb58){var _0x149732={},_0x4b5bfb={},_0x5584c7={'count':0x0,'rows':[]};var _0x47ef8f=_[_0x760d('0x2f')](db[_0x760d('0x30')][_0x760d('0x31')],function(_0x3cd782){return{'name':_0x3cd782[_0x760d('0x32')],'type':_0x3cd782[_0x760d('0x33')][_0x760d('0x34')]};});_0x4b5bfb[_0x760d('0x35')]=_[_0x760d('0x2f')](_0x47ef8f,_0x760d('0x2d'));_0x4b5bfb[_0x760d('0x36')]=_[_0x760d('0x37')](_0xc4fec8['query']);_0x4b5bfb[_0x760d('0x38')]=_[_0x760d('0x39')](_0x4b5bfb['model'],_0x4b5bfb['query']);_0x149732[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x4b5bfb['model'],qs[_0x760d('0x3b')](_0xc4fec8['query']['fields']));_0x149732[_0x760d('0x3a')]=_0x149732[_0x760d('0x3a')][_0x760d('0x3c')]?_0x149732[_0x760d('0x3a')]:_0x4b5bfb[_0x760d('0x35')];if(!_0xc4fec8['query']['hasOwnProperty']('nolimit')){_0x149732['limit']=qs[_0x760d('0x1e')](_0xc4fec8[_0x760d('0x36')][_0x760d('0x1e')]);_0x149732[_0x760d('0x20')]=qs[_0x760d('0x20')](_0xc4fec8[_0x760d('0x36')]['offset']);}_0x149732[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0xc4fec8[_0x760d('0x36')][_0x760d('0x3e')]);_0x149732[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0xc4fec8[_0x760d('0x36')],_0x4b5bfb['filters']),_0x47ef8f);if(_0xc4fec8[_0x760d('0x36')]['filter']){_0x149732[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x149732['where'],{'$or':_[_0x760d('0x2f')](_0x47ef8f,function(_0x551e9d){if(_0x551e9d['type']!==_0x760d('0x42')){var _0x4ef63f={};_0x4ef63f[_0x551e9d['name']]={'$like':'%'+_0xc4fec8[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x4ef63f;}})});}_0x149732=_[_0x760d('0x41')]({},_0x149732,_0xc4fec8['options']);var _0x57d950={'where':_0x149732['where']};return db[_0x760d('0x30')][_0x760d('0x1f')](_0x57d950)[_0x760d('0x26')](function(_0x3be521){_0x5584c7[_0x760d('0x1f')]=_0x3be521;if(_0xc4fec8[_0x760d('0x36')][_0x760d('0x44')]){_0x149732[_0x760d('0x45')]=[{'all':!![]}];}return db[_0x760d('0x30')]['findAll'](_0x149732);})['then'](function(_0x3dbc36){_0x5584c7['rows']=_0x3dbc36;return _0x5584c7;})[_0x760d('0x26')](respondWithFilteredResult(_0x27cb58,_0x149732))[_0x760d('0x46')](handleError(_0x27cb58,null));};exports[_0x760d('0x47')]=function(_0xe11b50,_0x2e4df3){var _0x974af2={'raw':![],'where':{'id':_0xe11b50[_0x760d('0x48')]['id']}},_0x18d132={};_0x18d132[_0x760d('0x35')]=_[_0x760d('0x37')](db[_0x760d('0x30')][_0x760d('0x31')]);_0x18d132[_0x760d('0x36')]=_[_0x760d('0x37')](_0xe11b50[_0x760d('0x36')]);_0x18d132[_0x760d('0x38')]=_[_0x760d('0x39')](_0x18d132['model'],_0x18d132['query']);_0x974af2['attributes']=_['intersection'](_0x18d132[_0x760d('0x35')],qs[_0x760d('0x3b')](_0xe11b50[_0x760d('0x36')]['fields']));_0x974af2[_0x760d('0x3a')]=_0x974af2[_0x760d('0x3a')][_0x760d('0x3c')]?_0x974af2[_0x760d('0x3a')]:_0x18d132[_0x760d('0x35')];if(_0xe11b50[_0x760d('0x36')]['includeAll']){_0x974af2[_0x760d('0x45')]=[{'all':!![]}];}_0x974af2=_[_0x760d('0x41')]({},_0x974af2,_0xe11b50[_0x760d('0x49')]);return db[_0x760d('0x30')][_0x760d('0x4a')](_0x974af2)[_0x760d('0x26')](handleEntityNotFound(_0x2e4df3,null))[_0x760d('0x26')](respondWithResult(_0x2e4df3,null))[_0x760d('0x46')](handleError(_0x2e4df3,null));};exports[_0x760d('0x4b')]=function(_0x823b7b,_0x5b7555){return db['Campaign'][_0x760d('0x4b')](_0x823b7b[_0x760d('0x4c')],{})['then'](function(_0xa211d6){var _0x5f1e09=_0x823b7b[_0x760d('0x4d')]['get']({'plain':!![]});if(!_0x5f1e09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f1e09[_0x760d('0x4e')]===_0x760d('0x4d')){var _0x3dbfa5=_0xa211d6[_0x760d('0x28')]({'plain':!![]});var _0x5d6426=_0x760d('0x29');return db[_0x760d('0x4f')]['find']({'where':{'name':_0x5d6426,'userProfileId':_0x5f1e09[_0x760d('0x50')]},'raw':!![]})['then'](function(_0x453582){if(_0x453582&&_0x453582[_0x760d('0x51')]===0x0){return db[_0x760d('0x2a')]['create']({'name':_0x3dbfa5[_0x760d('0x2d')],'resourceId':_0x3dbfa5['id'],'type':_0x453582[_0x760d('0x2d')],'sectionId':_0x453582['id']},{})[_0x760d('0x26')](function(){return _0xa211d6;});}else{return _0xa211d6;}})[_0x760d('0x46')](function(_0x102e7d){logger[_0x760d('0x2b')](_0x760d('0x52'),_0x102e7d);throw _0x102e7d;});}return _0xa211d6;})['then'](respondWithResult(_0x5b7555,0xc9))[_0x760d('0x46')](handleError(_0x5b7555,null));};exports[_0x760d('0x53')]=function(_0x6dbc5b,_0xc7610d){var _0x187e28={'where':{'id':_0x6dbc5b['params']['id']}},_0x83749a={};_0x83749a['model']=_[_0x760d('0x37')](db[_0x760d('0x30')]['rawAttributes']);_0x187e28[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x83749a['model'],qs[_0x760d('0x3b')](_0x6dbc5b['query'][_0x760d('0x3b')]));_0x187e28[_0x760d('0x3a')]=_0x187e28[_0x760d('0x3a')][_0x760d('0x3c')]?_0x187e28[_0x760d('0x3a')]:_0x83749a['model'];if(_0x6dbc5b[_0x760d('0x36')][_0x760d('0x44')]){_0x187e28[_0x760d('0x45')]=[{'all':!![]}];}_0x187e28=_[_0x760d('0x41')]({},_0x187e28,_0x6dbc5b[_0x760d('0x49')]);return db[_0x760d('0x30')][_0x760d('0x4a')](_0x187e28)[_0x760d('0x26')](handleEntityNotFound(_0xc7610d,null))[_0x760d('0x26')](function(_0x23fc40){if(_0x23fc40){var _0x42b713=_0x23fc40[_0x760d('0x28')]({'plain':!![]});_0x42b713=qs['omit'](_0x42b713,['id','createdAt',_0x760d('0x54')]);_0x6dbc5b[_0x760d('0x4c')]=_[_0x760d('0x55')](_0x6dbc5b[_0x760d('0x4c')],['id',_0x760d('0x56'),_0x760d('0x54')]);return db[_0x760d('0x30')][_0x760d('0x4b')](_[_0x760d('0x41')](_0x42b713,_0x6dbc5b[_0x760d('0x4c')]),{'include':_0x6dbc5b[_0x760d('0x36')][_0x760d('0x44')]?[{'all':!![]}]:undefined})[_0x760d('0x26')](function(_0x4084a8){var _0x322be2=_0x6dbc5b[_0x760d('0x4d')]['get']({'plain':!![]});if(!_0x322be2)throw new Error(_0x760d('0x57'));if(_0x322be2[_0x760d('0x4e')]===_0x760d('0x4d')){var _0x36dfa0=_0x4084a8[_0x760d('0x28')]({'plain':!![]});var _0x5ca3f7=_0x760d('0x29');return db['UserProfileSection'][_0x760d('0x4a')]({'where':{'name':_0x5ca3f7,'userProfileId':_0x322be2[_0x760d('0x50')]},'raw':!![]})[_0x760d('0x26')](function(_0x1fddbe){if(_0x1fddbe&&_0x1fddbe['autoAssociation']===0x0){return db[_0x760d('0x2a')][_0x760d('0x4b')]({'name':_0x36dfa0['name'],'resourceId':_0x36dfa0['id'],'type':_0x1fddbe[_0x760d('0x2d')],'sectionId':_0x1fddbe['id']},{})[_0x760d('0x26')](function(){return _0x4084a8;});}else{return _0x4084a8;}})[_0x760d('0x46')](function(_0x30d6ec){logger[_0x760d('0x2b')](_0x760d('0x52'),_0x30d6ec);throw _0x30d6ec;});}return _0x4084a8;});}})[_0x760d('0x26')](respondWithResult(_0xc7610d,0xc9))['catch'](handleError(_0xc7610d,null));};exports[_0x760d('0x25')]=function(_0x509100,_0x3ad4bc){if(_0x509100[_0x760d('0x4c')]['id']){delete _0x509100[_0x760d('0x4c')]['id'];}return db['Campaign'][_0x760d('0x4a')]({'where':{'id':_0x509100['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x3ad4bc,null))[_0x760d('0x26')](saveUpdates(_0x509100[_0x760d('0x4c')],null))[_0x760d('0x26')](respondWithResult(_0x3ad4bc,null))[_0x760d('0x46')](handleError(_0x3ad4bc,null));};exports['destroy']=function(_0x1c52f5,_0x17baa4){return db[_0x760d('0x30')]['find']({'where':{'id':_0x1c52f5[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x17baa4,null))[_0x760d('0x26')](removeEntity(_0x17baa4,null))['catch'](handleError(_0x17baa4,null));};exports['getHoppers']=function(_0x5aea04,_0x292b0f,_0x356959){var _0x56b2c2={'raw':!![],'where':{}};var _0x55bd28={};var _0x2ccd9b={'count':0x0,'rows':[]};return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x5aea04[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x292b0f,null))[_0x760d('0x26')](function(_0x1483db){if(_0x1483db){_0x55bd28[_0x760d('0x35')]=_[_0x760d('0x37')](db[_0x760d('0x59')]['rawAttributes']);_0x55bd28[_0x760d('0x36')]=_[_0x760d('0x37')](_0x5aea04['query']);_0x55bd28['filters']=_[_0x760d('0x39')](_0x55bd28[_0x760d('0x35')],_0x55bd28['query']);_0x56b2c2[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x55bd28['model'],qs[_0x760d('0x3b')](_0x5aea04['query'][_0x760d('0x3b')]));_0x56b2c2['attributes']=_0x56b2c2[_0x760d('0x3a')][_0x760d('0x3c')]?_0x56b2c2['attributes']:_0x55bd28['model'];if(!_0x5aea04[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x56b2c2['limit']=qs[_0x760d('0x1e')](_0x5aea04['query']['limit']);_0x56b2c2[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x5aea04[_0x760d('0x36')]['offset']);}_0x56b2c2['order']=qs[_0x760d('0x3e')](_0x5aea04[_0x760d('0x36')][_0x760d('0x3e')]);_0x56b2c2[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x5aea04['query'],_0x55bd28[_0x760d('0x38')]));_0x56b2c2[_0x760d('0x3f')][_0x760d('0x5c')]=_0x1483db['id'];if(_0x5aea04[_0x760d('0x36')]['filter']){_0x56b2c2[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x56b2c2['where'],{'$or':_[_0x760d('0x2f')](_0x56b2c2['attributes'],function(_0xee30f9){var _0x3702b2={};_0x3702b2[_0xee30f9]={'$like':'%'+_0x5aea04[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x3702b2;})});}_0x56b2c2=_[_0x760d('0x41')]({},_0x56b2c2,_0x5aea04['options']);return db['CmHopper'][_0x760d('0x1f')]({'where':_0x56b2c2[_0x760d('0x3f')]})['then'](function(_0x33cb84){_0x2ccd9b[_0x760d('0x1f')]=_0x33cb84;if(_0x5aea04['query'][_0x760d('0x44')]){_0x56b2c2[_0x760d('0x45')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x56b2c2);})[_0x760d('0x26')](function(_0x10de79){_0x2ccd9b['rows']=_0x10de79;return _0x2ccd9b;});}})[_0x760d('0x26')](respondWithFilteredResult(_0x292b0f,_0x56b2c2))[_0x760d('0x46')](handleError(_0x292b0f,null));};exports['getHopperHistories']=function(_0x28e84a,_0x571519,_0x45804b){var _0x3c6431={'raw':!![],'where':{}};var _0x4dbb24={};var _0x429579={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x28e84a[_0x760d('0x48')]['id']}})['then'](handleEntityNotFound(_0x571519,null))['then'](function(_0x5d7a8e){if(_0x5d7a8e){_0x4dbb24['model']=_[_0x760d('0x37')](db[_0x760d('0x5d')][_0x760d('0x31')]);_0x4dbb24[_0x760d('0x36')]=_[_0x760d('0x37')](_0x28e84a[_0x760d('0x36')]);_0x4dbb24['filters']=_['intersection'](_0x4dbb24[_0x760d('0x35')],_0x4dbb24['query']);_0x3c6431[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x4dbb24[_0x760d('0x35')],qs['fields'](_0x28e84a[_0x760d('0x36')][_0x760d('0x3b')]));_0x3c6431[_0x760d('0x3a')]=_0x3c6431[_0x760d('0x3a')][_0x760d('0x3c')]?_0x3c6431[_0x760d('0x3a')]:_0x4dbb24[_0x760d('0x35')];if(!_0x28e84a[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x3c6431[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x28e84a[_0x760d('0x36')][_0x760d('0x1e')]);_0x3c6431[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x28e84a['query']['offset']);}_0x3c6431[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x28e84a[_0x760d('0x36')][_0x760d('0x3e')]);_0x3c6431['where']=qs[_0x760d('0x38')](_['pick'](_0x28e84a['query'],_0x4dbb24[_0x760d('0x38')]));_0x3c6431[_0x760d('0x3f')][_0x760d('0x5c')]=_0x5d7a8e['id'];if(_0x28e84a['query'][_0x760d('0x43')]){_0x3c6431[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x3c6431[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x3c6431[_0x760d('0x3a')],function(_0x211a08){var _0x31d6ee={};_0x31d6ee[_0x211a08]={'$like':'%'+_0x28e84a[_0x760d('0x36')]['filter']+'%'};return _0x31d6ee;})});}_0x3c6431=_[_0x760d('0x41')]({},_0x3c6431,_0x28e84a[_0x760d('0x49')]);return db['CmHopperHistory'][_0x760d('0x1f')]({'where':_0x3c6431[_0x760d('0x3f')]})[_0x760d('0x26')](function(_0x27e44b){_0x429579['count']=_0x27e44b;if(_0x28e84a[_0x760d('0x36')][_0x760d('0x44')]){_0x3c6431['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x760d('0x5e')](_0x3c6431);})[_0x760d('0x26')](function(_0x7ce645){_0x429579[_0x760d('0x5f')]=_0x7ce645;return _0x429579;});}})['then'](respondWithFilteredResult(_0x571519,_0x3c6431))[_0x760d('0x46')](handleError(_0x571519,null));};exports[_0x760d('0x60')]=function(_0x282c3b,_0x4dd845,_0x48f562){var _0x5f24c3={'raw':!![],'where':{}};var _0x135544={};var _0x29219d={'count':0x0,'rows':[]};return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x282c3b[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x4dd845,null))[_0x760d('0x26')](function(_0x18bc64){if(_0x18bc64){_0x135544[_0x760d('0x35')]=_['keys'](db['CmHopperFinal'][_0x760d('0x31')]);_0x135544[_0x760d('0x36')]=_[_0x760d('0x37')](_0x282c3b[_0x760d('0x36')]);_0x135544[_0x760d('0x38')]=_[_0x760d('0x39')](_0x135544[_0x760d('0x35')],_0x135544[_0x760d('0x36')]);_0x5f24c3[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x135544[_0x760d('0x35')],qs[_0x760d('0x3b')](_0x282c3b[_0x760d('0x36')]['fields']));_0x5f24c3['attributes']=_0x5f24c3[_0x760d('0x3a')][_0x760d('0x3c')]?_0x5f24c3['attributes']:_0x135544['model'];if(!_0x282c3b[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x5f24c3[_0x760d('0x1e')]=qs['limit'](_0x282c3b['query'][_0x760d('0x1e')]);_0x5f24c3[_0x760d('0x20')]=qs[_0x760d('0x20')](_0x282c3b[_0x760d('0x36')]['offset']);}_0x5f24c3[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x282c3b[_0x760d('0x36')][_0x760d('0x3e')]);_0x5f24c3[_0x760d('0x3f')]=qs['filters'](_[_0x760d('0x40')](_0x282c3b[_0x760d('0x36')],_0x135544['filters']));_0x5f24c3[_0x760d('0x3f')][_0x760d('0x5c')]=_0x18bc64['id'];if(_0x282c3b[_0x760d('0x36')][_0x760d('0x43')]){_0x5f24c3[_0x760d('0x3f')]=_['merge'](_0x5f24c3[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x5f24c3[_0x760d('0x3a')],function(_0x3265d3){var _0x275662={};_0x275662[_0x3265d3]={'$like':'%'+_0x282c3b[_0x760d('0x36')][_0x760d('0x43')]+'%'};return _0x275662;})});}_0x5f24c3=_[_0x760d('0x41')]({},_0x5f24c3,_0x282c3b['options']);return db[_0x760d('0x61')][_0x760d('0x1f')]({'where':_0x5f24c3[_0x760d('0x3f')]})['then'](function(_0x26ffbe){_0x29219d[_0x760d('0x1f')]=_0x26ffbe;if(_0x282c3b[_0x760d('0x36')]['includeAll']){_0x5f24c3[_0x760d('0x45')]=[{'all':!![]}];}return db[_0x760d('0x61')]['findAll'](_0x5f24c3);})[_0x760d('0x26')](function(_0x189885){_0x29219d[_0x760d('0x5f')]=_0x189885;return _0x29219d;});}})['then'](respondWithFilteredResult(_0x4dd845,_0x5f24c3))[_0x760d('0x46')](handleError(_0x4dd845,null));};exports[_0x760d('0x62')]=function(_0x3ff551,_0x35116b,_0x52e16a){var _0x356602={'raw':!![],'where':{}};var _0x28576f={};var _0x165985={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3ff551[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x35116b,null))['then'](function(_0x364036){if(_0x364036){_0x28576f[_0x760d('0x35')]=_['keys'](db[_0x760d('0x63')][_0x760d('0x31')]);_0x28576f[_0x760d('0x36')]=_['keys'](_0x3ff551[_0x760d('0x36')]);_0x28576f[_0x760d('0x38')]=_[_0x760d('0x39')](_0x28576f['model'],_0x28576f[_0x760d('0x36')]);_0x356602['attributes']=_[_0x760d('0x39')](_0x28576f[_0x760d('0x35')],qs[_0x760d('0x3b')](_0x3ff551[_0x760d('0x36')][_0x760d('0x3b')]));_0x356602[_0x760d('0x3a')]=_0x356602[_0x760d('0x3a')]['length']?_0x356602[_0x760d('0x3a')]:_0x28576f[_0x760d('0x35')];if(!_0x3ff551[_0x760d('0x36')]['hasOwnProperty'](_0x760d('0x5b'))){_0x356602[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x3ff551[_0x760d('0x36')][_0x760d('0x1e')]);_0x356602[_0x760d('0x20')]=qs['offset'](_0x3ff551[_0x760d('0x36')]['offset']);}_0x356602[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x3ff551['query']['sort']);_0x356602[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x3ff551[_0x760d('0x36')],_0x28576f['filters']));_0x356602['where']['CampaignId']=_0x364036['id'];if(_0x3ff551[_0x760d('0x36')][_0x760d('0x43')]){_0x356602[_0x760d('0x3f')]=_['merge'](_0x356602[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x356602[_0x760d('0x3a')],function(_0x5e13e5){var _0x6a2688={};_0x6a2688[_0x5e13e5]={'$like':'%'+_0x3ff551[_0x760d('0x36')]['filter']+'%'};return _0x6a2688;})});}_0x356602=_['merge']({},_0x356602,_0x3ff551['options']);return db[_0x760d('0x63')][_0x760d('0x1f')]({'where':_0x356602[_0x760d('0x3f')]})[_0x760d('0x26')](function(_0x4ccd36){_0x165985[_0x760d('0x1f')]=_0x4ccd36;if(_0x3ff551[_0x760d('0x36')][_0x760d('0x44')]){_0x356602['include']=[{'all':!![]}];}return db[_0x760d('0x63')][_0x760d('0x5e')](_0x356602);})[_0x760d('0x26')](function(_0x24006a){_0x165985[_0x760d('0x5f')]=_0x24006a;return _0x165985;});}})['then'](respondWithFilteredResult(_0x35116b,_0x356602))[_0x760d('0x46')](handleError(_0x35116b,null));};exports[_0x760d('0x64')]=function(_0x3082ed,_0x4c2377,_0x49085c){var _0x18a1ef={};var _0x2b3fb9={};var _0x2eef8e;var _0x8e8791;return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0x3082ed[_0x760d('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c2377,null))[_0x760d('0x26')](function(_0x2a6b76){if(_0x2a6b76){_0x2eef8e=_0x2a6b76;_0x2b3fb9[_0x760d('0x35')]=_[_0x760d('0x37')](db['CmList'][_0x760d('0x31')]);_0x2b3fb9['query']=_[_0x760d('0x37')](_0x3082ed[_0x760d('0x36')]);_0x2b3fb9[_0x760d('0x38')]=_[_0x760d('0x39')](_0x2b3fb9[_0x760d('0x35')],_0x2b3fb9[_0x760d('0x36')]);_0x18a1ef[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x2b3fb9['model'],qs[_0x760d('0x3b')](_0x3082ed[_0x760d('0x36')][_0x760d('0x3b')]));_0x18a1ef[_0x760d('0x3a')]=_0x18a1ef[_0x760d('0x3a')][_0x760d('0x3c')]?_0x18a1ef[_0x760d('0x3a')]:_0x2b3fb9[_0x760d('0x35')];_0x18a1ef[_0x760d('0x3d')]=qs['sort'](_0x3082ed[_0x760d('0x36')][_0x760d('0x3e')]);_0x18a1ef[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0x3082ed['query'],_0x2b3fb9[_0x760d('0x38')]));if(_0x3082ed['query']['filter']){_0x18a1ef[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x18a1ef[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x18a1ef['attributes'],function(_0x463d20){var _0x4b96fd={};_0x4b96fd[_0x463d20]={'$like':'%'+_0x3082ed[_0x760d('0x36')]['filter']+'%'};return _0x4b96fd;})});}_0x18a1ef=_[_0x760d('0x41')]({},_0x18a1ef,_0x3082ed[_0x760d('0x49')]);return _0x2eef8e[_0x760d('0x64')](_0x18a1ef);}})[_0x760d('0x26')](function(_0x58835d){if(_0x58835d){_0x8e8791=_0x58835d['length'];if(!_0x3082ed[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x18a1ef[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0x3082ed[_0x760d('0x36')]['limit']);_0x18a1ef['offset']=qs[_0x760d('0x20')](_0x3082ed[_0x760d('0x36')]['offset']);}return _0x2eef8e['getLists'](_0x18a1ef);}})[_0x760d('0x26')](function(_0x475940){if(_0x475940){return _0x475940?{'count':_0x8e8791,'rows':_0x475940}:null;}})[_0x760d('0x26')](respondWithResult(_0x4c2377,null))[_0x760d('0x46')](handleError(_0x4c2377,null));};exports[_0x760d('0x65')]=function(_0x35bb84,_0x5f5aa3,_0x151416){var _0xbbfbde,_0x440539;var _0x4525a0=[];var _0x6cf52=moment()[_0x760d('0x66')](_0x760d('0x67'));return db[_0x760d('0x30')]['find']({'where':{'id':_0x35bb84['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x5f5aa3,null))[_0x760d('0x26')](function(_0x5d6d3c){if(_0x5d6d3c){_0x440539=_0x5d6d3c;return _0x5d6d3c['addLists'](_0x35bb84[_0x760d('0x4c')]['ids'],_[_0x760d('0x55')](_0x35bb84[_0x760d('0x4c')],['ids','id'])||{});}return null;})[_0x760d('0x68')](function(_0x26c5c8){var _0x260404;var _0x589503;_0xbbfbde=_0x26c5c8||[];var _0x213958=[];if(_0x26c5c8){for(var _0x55c677=0x0;_0x55c677<_0x26c5c8['length'];_0x55c677+=0x1){var _0x1b8928=_0x26c5c8[_0x55c677][_0x760d('0x28')]({'plain':!![]});_0x440539[_0x760d('0x69')]=_0x35bb84[_0x760d('0x4c')][_0x760d('0x69')]?_0x35bb84[_0x760d('0x4c')][_0x760d('0x69')]:_0x440539[_0x760d('0x69')];switch(_0x440539[_0x760d('0x69')]){case _0x760d('0x6a'):_0x260404=squel[_0x760d('0x6b')]()[_0x760d('0x6c')]('cm_hopper')['fromQuery']([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),_0x760d('0x70'),_0x760d('0x5c'),'createdAt',_0x760d('0x54')],squel[_0x760d('0x71')]()[_0x760d('0x72')]('phone',_0x760d('0x6d'))[_0x760d('0x72')](_0x760d('0x73'),'scheduledAt')[_0x760d('0x72')]('id',_0x760d('0x6f'))['field'](_0x1b8928['CmListId'][_0x760d('0x74')](),'ListId')[_0x760d('0x72')](_0x35bb84['params']['id'][_0x760d('0x74')](),_0x760d('0x5c'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27','createdAt')['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from'](_0x760d('0x75'))[_0x760d('0x3f')](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928[_0x760d('0x78')][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79'))[_0x760d('0x3f')](_0x760d('0x7a'),squel[_0x760d('0x71')]()[_0x760d('0x72')](_0x760d('0x7b'))['from']('cm_hopper_final')[_0x760d('0x3f')](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id'][_0x760d('0x74')]()))['where'](_0x760d('0x7a'),squel[_0x760d('0x71')]()['field'](_0x760d('0x7d'))['from'](_0x760d('0x7e'))[_0x760d('0x3f')](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id']['toString']())))[_0x760d('0x74')]();break;case _0x760d('0x7f'):_0x260404=squel['insert']()[_0x760d('0x6c')](_0x760d('0x7e'))[_0x760d('0x80')]([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),'ListId',_0x760d('0x5c'),_0x760d('0x56'),_0x760d('0x54')],squel['select']()['field'](_0x760d('0x6d'),_0x760d('0x6d'))['field'](_0x760d('0x73'),'scheduledAt')[_0x760d('0x72')]('id',_0x760d('0x6f'))[_0x760d('0x72')](_0x1b8928[_0x760d('0x78')][_0x760d('0x74')](),_0x760d('0x70'))['field'](_0x35bb84[_0x760d('0x48')]['id'][_0x760d('0x74')](),_0x760d('0x5c'))['field']('\x27'+_0x6cf52+'\x27','createdAt')[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from']('cm_contacts')['where'](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928['CmListId']['toString']())[_0x760d('0x3f')](_0x760d('0x79'))[_0x760d('0x3f')](_0x760d('0x7a'),squel[_0x760d('0x71')]()[_0x760d('0x72')](_0x760d('0x7d'))[_0x760d('0x81')]('cm_hopper')['where'](_0x760d('0x7c'),_0x35bb84[_0x760d('0x48')]['id']['toString']())))[_0x760d('0x74')]();break;default:_0x260404=squel['insert']()[_0x760d('0x6c')](_0x760d('0x7e'))['fromQuery']([_0x760d('0x6d'),_0x760d('0x6e'),_0x760d('0x6f'),'ListId','CampaignId',_0x760d('0x56'),_0x760d('0x54')],squel['select']()[_0x760d('0x72')](_0x760d('0x6d'),_0x760d('0x6d'))[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x6e'))[_0x760d('0x72')]('id',_0x760d('0x6f'))['field'](_0x1b8928[_0x760d('0x78')][_0x760d('0x74')](),_0x760d('0x70'))[_0x760d('0x72')](_0x35bb84[_0x760d('0x48')]['id']['toString'](),_0x760d('0x5c'))['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x56'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))['from'](_0x760d('0x75'))['where'](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x1b8928['CmListId'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79')))['toString']();}_0x589503=squel['insert']()['into'](_0x760d('0x82'))[_0x760d('0x80')](['cmHopperId','scheduledAt',_0x760d('0x6d'),'OrderBy','createdAt',_0x760d('0x54')],squel['select']()[_0x760d('0x72')]('h.id','id')[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x6e'))[_0x760d('0x72')]('ci.item',_0x760d('0x6d'))[_0x760d('0x72')]('ci.OrderBY',_0x760d('0x83'))['field']('\x27'+_0x6cf52+'\x27',_0x760d('0x56'))[_0x760d('0x72')]('\x27'+_0x6cf52+'\x27',_0x760d('0x54'))[_0x760d('0x81')](_0x760d('0x84'),'ci')[_0x760d('0x85')](_0x760d('0x7e'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x760d('0x3f')]('h.ListId\x20=\x20?',_0x1b8928[_0x760d('0x78')][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x86'),_0x35bb84['params']['id'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x87'),_0x6cf52))[_0x760d('0x74')]();_0x213958[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x260404));_0x4525a0[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x589503));}return BPromise[_0x760d('0x8a')](_0x213958);}})[_0x760d('0x26')](function(){return BPromise[_0x760d('0x8a')](_0x4525a0);})[_0x760d('0x26')](function(){return _0xbbfbde;})['then'](respondWithResult(_0x5f5aa3,null))[_0x760d('0x46')](handleError(_0x5f5aa3,null));};exports[_0x760d('0x8b')]=function(_0x5a3dd0,_0x13e10c,_0x1e02d2){return db['Campaign'][_0x760d('0x4a')]({'where':{'id':_0x5a3dd0['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x13e10c,null))[_0x760d('0x26')](function(_0x56db54){if(_0x56db54){return _0x56db54[_0x760d('0x8b')](_0x5a3dd0['query'][_0x760d('0x8c')]);}})['then'](function(_0x434173){if(_0x434173){return db['CmHopper']['destroy']({'where':{'ListId':_0x5a3dd0['query'][_0x760d('0x8c')],'CampaignId':_0x5a3dd0[_0x760d('0x48')]['id']}})['then'](function(){return _0x434173;});}})['then'](respondWithStatusCode(_0x13e10c,null))[_0x760d('0x46')](handleError(_0x13e10c,null));};exports[_0x760d('0x8d')]=function(_0xeac13,_0x56e2ae,_0x559f2e){var _0x56f9cf={};var _0x176814={};var _0x3dc8ad;var _0x25927b;return db[_0x760d('0x30')][_0x760d('0x58')]({'where':{'id':_0xeac13['params']['id']}})['then'](handleEntityNotFound(_0x56e2ae,null))['then'](function(_0x519188){if(_0x519188){_0x3dc8ad=_0x519188;_0x176814[_0x760d('0x35')]=_[_0x760d('0x37')](db['CmList'][_0x760d('0x31')]);_0x176814[_0x760d('0x36')]=_[_0x760d('0x37')](_0xeac13['query']);_0x176814[_0x760d('0x38')]=_[_0x760d('0x39')](_0x176814['model'],_0x176814[_0x760d('0x36')]);_0x56f9cf[_0x760d('0x3a')]=_[_0x760d('0x39')](_0x176814['model'],qs[_0x760d('0x3b')](_0xeac13[_0x760d('0x36')]['fields']));_0x56f9cf[_0x760d('0x3a')]=_0x56f9cf[_0x760d('0x3a')][_0x760d('0x3c')]?_0x56f9cf[_0x760d('0x3a')]:_0x176814[_0x760d('0x35')];_0x56f9cf[_0x760d('0x3d')]=qs['sort'](_0xeac13[_0x760d('0x36')][_0x760d('0x3e')]);_0x56f9cf[_0x760d('0x3f')]=qs[_0x760d('0x38')](_[_0x760d('0x40')](_0xeac13[_0x760d('0x36')],_0x176814[_0x760d('0x38')]));if(_0xeac13['query'][_0x760d('0x43')]){_0x56f9cf[_0x760d('0x3f')]=_[_0x760d('0x41')](_0x56f9cf[_0x760d('0x3f')],{'$or':_[_0x760d('0x2f')](_0x56f9cf[_0x760d('0x3a')],function(_0x5ae107){var _0xf38411={};_0xf38411[_0x5ae107]={'$like':'%'+_0xeac13['query']['filter']+'%'};return _0xf38411;})});}_0x56f9cf=_[_0x760d('0x41')]({},_0x56f9cf,_0xeac13[_0x760d('0x49')]);return _0x3dc8ad[_0x760d('0x8d')](_0x56f9cf);}})['then'](function(_0x53369d){if(_0x53369d){_0x25927b=_0x53369d[_0x760d('0x3c')];if(!_0xeac13[_0x760d('0x36')][_0x760d('0x5a')](_0x760d('0x5b'))){_0x56f9cf[_0x760d('0x1e')]=qs[_0x760d('0x1e')](_0xeac13['query'][_0x760d('0x1e')]);_0x56f9cf[_0x760d('0x20')]=qs[_0x760d('0x20')](_0xeac13[_0x760d('0x36')][_0x760d('0x20')]);}return _0x3dc8ad[_0x760d('0x8d')](_0x56f9cf);}})['then'](function(_0x1e241f){if(_0x1e241f){return _0x1e241f?{'count':_0x25927b,'rows':_0x1e241f}:null;}})[_0x760d('0x26')](respondWithResult(_0x56e2ae,null))[_0x760d('0x46')](handleError(_0x56e2ae,null));};exports['addBlackLists']=function(_0xecae35,_0xf3cd8b,_0x59b57b){var _0x5aa429,_0xfcb74e;var _0x5b8487=[];var _0x4ecd17=moment()['format'](_0x760d('0x67'));return db[_0x760d('0x30')][_0x760d('0x4a')]({'where':{'id':_0xecae35[_0x760d('0x48')]['id']}})[_0x760d('0x26')](handleEntityNotFound(_0xf3cd8b,null))['then'](function(_0x2117ad){if(_0x2117ad){_0xfcb74e=_0x2117ad;return _0x2117ad[_0x760d('0x8e')](_0xecae35[_0x760d('0x4c')][_0x760d('0x8c')],_[_0x760d('0x55')](_0xecae35['body'],[_0x760d('0x8c'),'id'])||{});}return null;})['spread'](function(_0x3bd7ba){var _0x391200;var _0x228c03;_0x5aa429=_0x3bd7ba||[];var _0x2bdbfe=[];if(_0x3bd7ba){for(var _0x10d180=0x0;_0x10d180<_0x3bd7ba[_0x760d('0x3c')];_0x10d180+=0x1){var _0x3c1c13=_0x3bd7ba[_0x10d180][_0x760d('0x28')]({'plain':!![]});_0x391200=squel['insert']()[_0x760d('0x6c')](_0x760d('0x8f'))[_0x760d('0x80')](['phone',_0x760d('0x6f'),'ListId','CampaignId',_0x760d('0x56'),'updatedAt'],squel['select']()[_0x760d('0x72')](_0x760d('0x6d'),_0x760d('0x6d'))[_0x760d('0x72')]('id','ContactId')[_0x760d('0x72')](_0x3c1c13[_0x760d('0x78')]['toString'](),_0x760d('0x70'))[_0x760d('0x72')](_0xecae35[_0x760d('0x48')]['id'][_0x760d('0x74')](),_0x760d('0x5c'))[_0x760d('0x72')](_0x760d('0x73'),_0x760d('0x56'))['field'](_0x760d('0x73'),_0x760d('0x54'))[_0x760d('0x81')]('cm_contacts')[_0x760d('0x3f')](_0x760d('0x76'))[_0x760d('0x3f')](_0x760d('0x77'),_0x3c1c13['CmListId'][_0x760d('0x74')]())[_0x760d('0x3f')](_0x760d('0x79')))['toString']();_0x2bdbfe[_0x760d('0x88')](db[_0x760d('0x89')][_0x760d('0x36')](_0x391200));}return BPromise[_0x760d('0x8a')](_0x2bdbfe);}})[_0x760d('0x26')](function(){return _0x5aa429;})[_0x760d('0x26')](respondWithResult(_0xf3cd8b,null))[_0x760d('0x46')](handleError(_0xf3cd8b,null));};exports[_0x760d('0x90')]=function(_0x58bb24,_0x3e7f75,_0x428f7f){return db[_0x760d('0x30')][_0x760d('0x4a')]({'where':{'id':_0x58bb24['params']['id']}})[_0x760d('0x26')](handleEntityNotFound(_0x3e7f75,null))[_0x760d('0x26')](function(_0x3b8ad3){if(_0x3b8ad3){return _0x3b8ad3[_0x760d('0x90')](_0x58bb24['query'][_0x760d('0x8c')]);}})[_0x760d('0x26')](function(_0x4a9598){if(_0x4a9598){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x58bb24[_0x760d('0x36')][_0x760d('0x8c')],'CampaignId':_0x58bb24[_0x760d('0x48')]['id']}})[_0x760d('0x26')](function(){return _0x4a9598;});}})['then'](respondWithStatusCode(_0x3e7f75,null))[_0x760d('0x46')](handleError(_0x3e7f75,null));};
\ No newline at end of file
index 7aa8665..d945f9b 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(_0x27b059,_0x275671){var _0x982b2a=function(_0x1e7d71){while(--_0x1e7d71){_0x27b059['push'](_0x27b059['shift']());}};_0x982b2a(++_0x275671);}(_0x7a54,0x106));var _0x47a5=function(_0x26f796,_0x4baec2){_0x26f796=_0x26f796-0x0;var _0x33e8b7=_0x7a54[_0x26f796];return _0x33e8b7;};'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(_0x59f638,_0x45a5d0){var _0x348cfc=function(_0x5a5760){while(--_0x5a5760){_0x59f638['push'](_0x59f638['shift']());}};_0x348cfc(++_0x45a5d0);}(_0x7a54,0x106));var _0x47a5=function(_0xd3f3f4,_0x4ebd90){_0xd3f3f4=_0xd3f3f4-0x0;var _0x1b27d9=_0x7a54[_0xd3f3f4];return _0x1b27d9;};'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 b9572fc..8ebd6ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ebe=['error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetCampaign','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ebe,0x69));var _0xe5eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5ebe[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe5eb('0x0'));var moment=require(_0xe5eb('0x1'));var BPromise=require(_0xe5eb('0x2'));var rs=require(_0xe5eb('0x3'));var fs=require('fs');var Redis=require(_0xe5eb('0x4'));var db=require(_0xe5eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe5eb('0x6'));var config=require(_0xe5eb('0x7'));var jayson=require(_0xe5eb('0x8'));var client=jayson[_0xe5eb('0x9')][_0xe5eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ae8d2,_0x1465d8,_0x1acd9d){return new BPromise(function(_0x5158f0,_0x59234a){return client['request'](_0x3ae8d2,_0x1acd9d)['then'](function(_0x2a15ee){logger['info'](_0xe5eb('0xb'),_0x1465d8,_0xe5eb('0xc'));logger[_0xe5eb('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1465d8,_0xe5eb('0xc'),JSON[_0xe5eb('0xe')](_0x2a15ee));if(_0x2a15ee[_0xe5eb('0xf')]){if(_0x2a15ee[_0xe5eb('0xf')][_0xe5eb('0x10')]===0x1f4){logger['error'](_0xe5eb('0xb'),_0x1465d8,_0x2a15ee[_0xe5eb('0xf')][_0xe5eb('0x11')]);return _0x59234a(_0x2a15ee['error']['message']);}logger[_0xe5eb('0xf')](_0xe5eb('0xb'),_0x1465d8,_0x2a15ee[_0xe5eb('0xf')]['message']);return _0x5158f0(_0x2a15ee[_0xe5eb('0xf')][_0xe5eb('0x11')]);}else{logger['info'](_0xe5eb('0xb'),_0x1465d8,'request\x20sent');_0x5158f0(_0x2a15ee['result']['message']);}})[_0xe5eb('0x12')](function(_0x1590a0){logger['error'](_0xe5eb('0xb'),_0x1465d8,_0x1590a0);_0x59234a(_0x1590a0);});});}exports['GetCampaign']=function(_0x32c84c){var _0xc6b8df=this;return new Promise(function(_0x22d217,_0x2159a4){return db['Campaign'][_0xe5eb('0x13')]({'raw':_0x32c84c[_0xe5eb('0x14')]?_0x32c84c[_0xe5eb('0x14')][_0xe5eb('0x15')]===undefined?!![]:![]:!![],'where':_0x32c84c[_0xe5eb('0x14')]?_0x32c84c[_0xe5eb('0x14')][_0xe5eb('0x16')]||null:null,'attributes':_0x32c84c['options']?_0x32c84c['options'][_0xe5eb('0x17')]||null:null,'limit':_0x32c84c['options']?_0x32c84c[_0xe5eb('0x14')][_0xe5eb('0x18')]||null:null,'include':_0x32c84c['options']?_0x32c84c[_0xe5eb('0x14')][_0xe5eb('0x19')]?_[_0xe5eb('0x1a')](_0x32c84c['options'][_0xe5eb('0x19')],function(_0x430836){return{'model':db[_0x430836[_0xe5eb('0x1b')]],'as':_0x430836['as'],'attributes':_0x430836['attributes'],'include':_0x430836[_0xe5eb('0x19')]?_[_0xe5eb('0x1a')](_0x430836['include'],function(_0x2cd698){return{'model':db[_0x2cd698[_0xe5eb('0x1b')]],'as':_0x2cd698['as'],'attributes':_0x2cd698[_0xe5eb('0x17')],'include':_0x2cd698['include']?_[_0xe5eb('0x1a')](_0x2cd698[_0xe5eb('0x19')],function(_0x40ecb1){return{'model':db[_0x40ecb1[_0xe5eb('0x1b')]],'as':_0x40ecb1['as'],'attributes':_0x40ecb1[_0xe5eb('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22fc1c){logger[_0xe5eb('0x1c')](_0xe5eb('0x1d'),_0x32c84c);logger[_0xe5eb('0xd')]('GetCampaign',_0x32c84c,JSON['stringify'](_0x22fc1c));_0x22d217(_0x22fc1c);})['catch'](function(_0x39dc8f){logger['error'](_0xe5eb('0x1d'),_0x39dc8f[_0xe5eb('0x11')],_0x32c84c);_0x2159a4(_0xc6b8df['error'](0x1f4,_0x39dc8f[_0xe5eb('0x11')]));});});};
\ No newline at end of file
+var _0x80c7=['result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','info','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x2583a8,_0x4130a5){var _0x51b92a=function(_0x3c6ba0){while(--_0x3c6ba0){_0x2583a8['push'](_0x2583a8['shift']());}};_0x51b92a(++_0x4130a5);}(_0x80c7,0x8d));var _0x780c=function(_0x444a1f,_0x22127b){_0x444a1f=_0x444a1f-0x0;var _0x5dec75=_0x80c7[_0x444a1f];return _0x5dec75;};'use strict';var _=require(_0x780c('0x0'));var util=require(_0x780c('0x1'));var moment=require(_0x780c('0x2'));var BPromise=require(_0x780c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x780c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x780c('0x5'))(_0x780c('0x6'));var config=require(_0x780c('0x7'));var jayson=require(_0x780c('0x8'));var client=jayson[_0x780c('0x9')][_0x780c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4170ef,_0x269976,_0x4041cb){return new BPromise(function(_0x2d858f,_0x1d87ca){return client['request'](_0x4170ef,_0x4041cb)[_0x780c('0xb')](function(_0x3411de){logger['info'](_0x780c('0xc'),_0x269976,_0x780c('0xd'));logger[_0x780c('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x269976,_0x780c('0xd'),JSON[_0x780c('0xf')](_0x3411de));if(_0x3411de[_0x780c('0x10')]){if(_0x3411de[_0x780c('0x10')][_0x780c('0x11')]===0x1f4){logger[_0x780c('0x10')](_0x780c('0xc'),_0x269976,_0x3411de[_0x780c('0x10')][_0x780c('0x12')]);return _0x1d87ca(_0x3411de[_0x780c('0x10')][_0x780c('0x12')]);}logger[_0x780c('0x10')]('Campaign,\x20%s,\x20%s',_0x269976,_0x3411de['error'][_0x780c('0x12')]);return _0x2d858f(_0x3411de[_0x780c('0x10')]['message']);}else{logger['info'](_0x780c('0xc'),_0x269976,_0x780c('0xd'));_0x2d858f(_0x3411de[_0x780c('0x13')][_0x780c('0x12')]);}})[_0x780c('0x14')](function(_0x33c514){logger['error'](_0x780c('0xc'),_0x269976,_0x33c514);_0x1d87ca(_0x33c514);});});}exports[_0x780c('0x15')]=function(_0x2127e2){var _0x2dbcd8=this;return new Promise(function(_0x48e6fe,_0xcd171e){return db[_0x780c('0x16')][_0x780c('0x17')]({'raw':_0x2127e2[_0x780c('0x18')]?_0x2127e2['options'][_0x780c('0x19')]===undefined?!![]:![]:!![],'where':_0x2127e2[_0x780c('0x18')]?_0x2127e2['options']['where']||null:null,'attributes':_0x2127e2['options']?_0x2127e2[_0x780c('0x18')][_0x780c('0x1a')]||null:null,'limit':_0x2127e2[_0x780c('0x18')]?_0x2127e2[_0x780c('0x18')][_0x780c('0x1b')]||null:null,'include':_0x2127e2[_0x780c('0x18')]?_0x2127e2[_0x780c('0x18')][_0x780c('0x1c')]?_[_0x780c('0x1d')](_0x2127e2[_0x780c('0x18')][_0x780c('0x1c')],function(_0x55fc81){return{'model':db[_0x55fc81[_0x780c('0x1e')]],'as':_0x55fc81['as'],'attributes':_0x55fc81[_0x780c('0x1a')],'include':_0x55fc81[_0x780c('0x1c')]?_['map'](_0x55fc81[_0x780c('0x1c')],function(_0x121199){return{'model':db[_0x121199[_0x780c('0x1e')]],'as':_0x121199['as'],'attributes':_0x121199[_0x780c('0x1a')],'include':_0x121199[_0x780c('0x1c')]?_[_0x780c('0x1d')](_0x121199['include'],function(_0x1cb65e){return{'model':db[_0x1cb65e[_0x780c('0x1e')]],'as':_0x1cb65e['as'],'attributes':_0x1cb65e[_0x780c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d9702){logger[_0x780c('0x1f')](_0x780c('0x15'),_0x2127e2);logger[_0x780c('0xe')](_0x780c('0x15'),_0x2127e2,JSON[_0x780c('0xf')](_0x2d9702));_0x48e6fe(_0x2d9702);})[_0x780c('0x14')](function(_0x35b97a){logger[_0x780c('0x10')](_0x780c('0x15'),_0x35b97a[_0x780c('0x12')],_0x2127e2);_0xcd171e(_0x2dbcd8[_0x780c('0x10')](0x1f4,_0x35b97a[_0x780c('0x12')]));});});};
\ No newline at end of file
index 864204c..20c5f5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda42=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists'];(function(_0x320909,_0x17e27a){var _0x3b19b5=function(_0x5268c7){while(--_0x5268c7){_0x320909['push'](_0x320909['shift']());}};_0x3b19b5(++_0x17e27a);}(_0xda42,0x155));var _0x2da4=function(_0x549e63,_0x44b35b){_0x549e63=_0x549e63-0x0;var _0x4d102b=_0xda42[_0x549e63];return _0x4d102b;};'use strict';var multer=require(_0x2da4('0x0'));var util=require('util');var path=require(_0x2da4('0x1'));var timeout=require(_0x2da4('0x2'));var express=require(_0x2da4('0x3'));var router=express[_0x2da4('0x4')]();var fs_extra=require(_0x2da4('0x5'));var auth=require(_0x2da4('0x6'));var interaction=require(_0x2da4('0x7'));var config=require('../../config/environment');var controller=require(_0x2da4('0x8'));router['get']('/',auth[_0x2da4('0x9')](),controller[_0x2da4('0xa')]);router[_0x2da4('0xb')](_0x2da4('0xc'),auth[_0x2da4('0x9')](),controller['show']);router[_0x2da4('0xb')]('/:id/hoppers',auth[_0x2da4('0x9')](),controller[_0x2da4('0xd')]);router['get'](_0x2da4('0xe'),auth[_0x2da4('0x9')](),controller[_0x2da4('0xf')]);router[_0x2da4('0xb')](_0x2da4('0x10'),auth['isAuthenticated'](),controller[_0x2da4('0x11')]);router[_0x2da4('0xb')](_0x2da4('0x12'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x13')]);router['get'](_0x2da4('0x14'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x15')]);router['get'](_0x2da4('0x16'),auth[_0x2da4('0x9')](),controller['getBlackLists']);router[_0x2da4('0x17')]('/',auth['isAuthenticated'](),controller[_0x2da4('0x18')]);router[_0x2da4('0x17')]('/:id/clone',auth[_0x2da4('0x9')](),controller[_0x2da4('0x19')]);router[_0x2da4('0x17')](_0x2da4('0x14'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x1a')]);router[_0x2da4('0x17')](_0x2da4('0x16'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x1b')]);router[_0x2da4('0x1c')](_0x2da4('0xc'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x1d')]);router[_0x2da4('0x1e')](_0x2da4('0xc'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x1f')]);router[_0x2da4('0x1e')](_0x2da4('0x14'),auth[_0x2da4('0x9')](),controller[_0x2da4('0x20')]);router[_0x2da4('0x1e')](_0x2da4('0x16'),auth[_0x2da4('0x9')](),controller['removeBlackLists']);module[_0x2da4('0x21')]=router;
\ No newline at end of file
+var _0xce5c=['getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','delete','destroy','removeLists','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x41b1fa,_0x19c954){var _0x1c4822=function(_0xb9e25d){while(--_0xb9e25d){_0x41b1fa['push'](_0x41b1fa['shift']());}};_0x1c4822(++_0x19c954);}(_0xce5c,0x79));var _0xcce5=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xce5c[_0x5a60ce];return _0x393e5e;};'use strict';var multer=require(_0xcce5('0x0'));var util=require('util');var path=require(_0xcce5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcce5('0x2')]();var fs_extra=require(_0xcce5('0x3'));var auth=require(_0xcce5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcce5('0x5'));var controller=require(_0xcce5('0x6'));router[_0xcce5('0x7')]('/',auth[_0xcce5('0x8')](),controller[_0xcce5('0x9')]);router[_0xcce5('0x7')](_0xcce5('0xa'),auth[_0xcce5('0x8')](),controller[_0xcce5('0xb')]);router['get'](_0xcce5('0xc'),auth[_0xcce5('0x8')](),controller[_0xcce5('0xd')]);router[_0xcce5('0x7')](_0xcce5('0xe'),auth[_0xcce5('0x8')](),controller[_0xcce5('0xf')]);router[_0xcce5('0x7')](_0xcce5('0x10'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x11')]);router[_0xcce5('0x7')](_0xcce5('0x12'),auth['isAuthenticated'](),controller[_0xcce5('0x13')]);router['get']('/:id/lists',auth[_0xcce5('0x8')](),controller[_0xcce5('0x14')]);router['get'](_0xcce5('0x15'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x16')]);router[_0xcce5('0x17')]('/',auth['isAuthenticated'](),controller[_0xcce5('0x18')]);router[_0xcce5('0x17')](_0xcce5('0x19'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x1a')]);router[_0xcce5('0x17')](_0xcce5('0x1b'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x1c')]);router[_0xcce5('0x17')]('/:id/blacklists',auth[_0xcce5('0x8')](),controller[_0xcce5('0x1d')]);router['put'](_0xcce5('0xa'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x1e')]);router[_0xcce5('0x1f')]('/:id',auth[_0xcce5('0x8')](),controller[_0xcce5('0x20')]);router['delete'](_0xcce5('0x1b'),auth[_0xcce5('0x8')](),controller[_0xcce5('0x21')]);router[_0xcce5('0x1f')](_0xcce5('0x15'),auth[_0xcce5('0x8')](),controller['removeBlackLists']);module[_0xcce5('0x22')]=router;
\ No newline at end of file
index f766f1a..bb7c5a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3498=['sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x42bc73,_0x17278d){var _0x2f3f24=function(_0x1ec8dc){while(--_0x1ec8dc){_0x42bc73['push'](_0x42bc73['shift']());}};_0x2f3f24(++_0x17278d);}(_0x3498,0x78));var _0x8349=function(_0x50c154,_0x4e08a2){_0x50c154=_0x50c154-0x0;var _0x23aad4=_0x3498[_0x50c154];return _0x23aad4;};'use strict';var Sequelize=require(_0x8349('0x0'));module[_0x8349('0x1')]={'key':{'type':Sequelize[_0x8349('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8349('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x8349('0x2')]},'name':{'type':Sequelize[_0x8349('0x4')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0x5288=['exports','STRING','TEXT','VIRTUAL','key','sequelize'];(function(_0x5276c6,_0x252a1a){var _0x5825d8=function(_0x1f61cf){while(--_0x1f61cf){_0x5276c6['push'](_0x5276c6['shift']());}};_0x5825d8(++_0x252a1a);}(_0x5288,0x197));var _0x8528=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x5288[_0x59d89e];return _0x554e93;};'use strict';var Sequelize=require(_0x8528('0x0'));module[_0x8528('0x1')]={'key':{'type':Sequelize[_0x8528('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8528('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x8528('0x2')]},'name':{'type':Sequelize[_0x8528('0x4')],'get':function(){return this['getDataValue'](_0x8528('0x5'));}}};
\ No newline at end of file
index aa21183..08ccf42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f5=['Sequelize','ValidationError','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','json','offset','undefined','status','Content-Range','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index','CannedAnswer','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','count','includeAll','include','findAll','rows','catch','show','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId'];(function(_0x4162a0,_0x58f1eb){var _0x1f926d=function(_0x4e0eec){while(--_0x4e0eec){_0x4162a0['push'](_0x4162a0['shift']());}};_0x1f926d(++_0x58f1eb);}(_0x28f5,0x162));var _0x528f=function(_0x32f5d4,_0x4f6164){_0x32f5d4=_0x32f5d4-0x0;var _0x4c051=_0x28f5[_0x32f5d4];return _0x4c051;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x528f('0x0'));var zipdir=require(_0x528f('0x1'));var jsonpatch=require(_0x528f('0x2'));var rp=require(_0x528f('0x3'));var moment=require(_0x528f('0x4'));var BPromise=require(_0x528f('0x5'));var Mustache=require(_0x528f('0x6'));var util=require(_0x528f('0x7'));var path=require(_0x528f('0x8'));var sox=require(_0x528f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x528f('0xa'));var _=require(_0x528f('0xb'));var squel=require('squel');var crypto=require(_0x528f('0xc'));var jsforce=require(_0x528f('0xd'));var deskjs=require(_0x528f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x528f('0xf'));var Papa=require(_0x528f('0x10'));var Redis=require(_0x528f('0x11'));var authService=require(_0x528f('0x12'));var qs=require(_0x528f('0x13'));var as=require(_0x528f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x528f('0x15'))(_0x528f('0x16'));var utils=require('../../config/utils');var config=require(_0x528f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x528f('0x18'))['db'];function respondWithStatusCode(_0x1a1e46,_0x51c2c4){_0x51c2c4=_0x51c2c4||0xcc;return function(_0x1aea87){if(_0x1aea87){return _0x1a1e46['sendStatus'](_0x51c2c4);}return _0x1a1e46['status'](_0x51c2c4)[_0x528f('0x19')]();};}function respondWithResult(_0x25d575,_0x248952){_0x248952=_0x248952||0xc8;return function(_0x33a3b6){if(_0x33a3b6){return _0x25d575['status'](_0x248952)[_0x528f('0x1a')](_0x33a3b6);}};}function respondWithFilteredResult(_0x1a0276,_0x16c059){return function(_0x54753d){if(_0x54753d){var _0x9e385c=typeof _0x16c059[_0x528f('0x1b')]===_0x528f('0x1c')&&typeof _0x16c059['limit']===_0x528f('0x1c');var _0x26635d=_0x54753d['count'];var _0x3c0a6d=_0x9e385c?0x0:_0x16c059[_0x528f('0x1b')];var _0x3b7557=_0x9e385c?_0x54753d['count']:_0x16c059['offset']+_0x16c059['limit'];var _0xef558;if(_0x3b7557>=_0x26635d){_0x3b7557=_0x26635d;_0xef558=0xc8;}else{_0xef558=0xce;}_0x1a0276[_0x528f('0x1d')](_0xef558);return _0x1a0276['set'](_0x528f('0x1e'),_0x3c0a6d+'-'+_0x3b7557+'/'+_0x26635d)[_0x528f('0x1a')](_0x54753d);}return null;};}function patchUpdates(_0x35a656){return function(_0x4bd977){try{jsonpatch[_0x528f('0x1f')](_0x4bd977,_0x35a656,!![]);}catch(_0x5e5eb3){return BPromise[_0x528f('0x20')](_0x5e5eb3);}return _0x4bd977[_0x528f('0x21')]();};}function saveUpdates(_0x32e5bd,_0x4bad70){return function(_0x427e93){if(_0x427e93){return _0x427e93['update'](_0x32e5bd)[_0x528f('0x22')](function(_0x228b9a){return _0x228b9a;});}return null;};}function removeEntity(_0x2043e0,_0x27a3ff){return function(_0x52be6e){if(_0x52be6e){return _0x52be6e[_0x528f('0x23')]()[_0x528f('0x22')](function(){var _0x27870a=_0x52be6e[_0x528f('0x24')]({'plain':!![]});var _0x46d232=_0x528f('0x25');return db[_0x528f('0x26')][_0x528f('0x23')]({'where':{'type':_0x46d232,'resourceId':_0x27870a['id']}})['then'](function(){return _0x52be6e;});})[_0x528f('0x22')](function(){_0x2043e0['status'](0xcc)[_0x528f('0x19')]();});}};}function handleEntityNotFound(_0x236299,_0x49f77b){return function(_0x3b3a93){if(!_0x3b3a93){_0x236299[_0x528f('0x27')](0x194);}return _0x3b3a93;};}function handleError(_0x44cda0,_0x1d9dc5){_0x1d9dc5=_0x1d9dc5||0x1f4;return function(_0x4e4d93){logger[_0x528f('0x28')](_0x4e4d93[_0x528f('0x29')]);if(_0x4e4d93[_0x528f('0x2a')]){delete _0x4e4d93[_0x528f('0x2a')];}_0x44cda0['status'](_0x1d9dc5)['send'](_0x4e4d93);};}exports[_0x528f('0x2b')]=function(_0x4882b7,_0x538c4f){var _0x1c9fec={},_0x2a70d6={},_0x3918e3={'count':0x0,'rows':[]};var _0x317f2f=_['map'](db[_0x528f('0x2c')][_0x528f('0x2d')],function(_0x5941e6){return{'name':_0x5941e6['fieldName'],'type':_0x5941e6[_0x528f('0x2e')][_0x528f('0x2f')]};});_0x2a70d6[_0x528f('0x30')]=_['map'](_0x317f2f,_0x528f('0x2a'));_0x2a70d6['query']=_[_0x528f('0x31')](_0x4882b7[_0x528f('0x32')]);_0x2a70d6[_0x528f('0x33')]=_[_0x528f('0x34')](_0x2a70d6[_0x528f('0x30')],_0x2a70d6['query']);_0x1c9fec[_0x528f('0x35')]=_[_0x528f('0x34')](_0x2a70d6[_0x528f('0x30')],qs[_0x528f('0x36')](_0x4882b7[_0x528f('0x32')][_0x528f('0x36')]));_0x1c9fec[_0x528f('0x35')]=_0x1c9fec[_0x528f('0x35')][_0x528f('0x37')]?_0x1c9fec[_0x528f('0x35')]:_0x2a70d6[_0x528f('0x30')];if(!_0x4882b7[_0x528f('0x32')][_0x528f('0x38')](_0x528f('0x39'))){_0x1c9fec[_0x528f('0x3a')]=qs[_0x528f('0x3a')](_0x4882b7[_0x528f('0x32')][_0x528f('0x3a')]);_0x1c9fec[_0x528f('0x1b')]=qs[_0x528f('0x1b')](_0x4882b7[_0x528f('0x32')][_0x528f('0x1b')]);}_0x1c9fec[_0x528f('0x3b')]=qs[_0x528f('0x3c')](_0x4882b7['query'][_0x528f('0x3c')]);_0x1c9fec[_0x528f('0x3d')]=qs[_0x528f('0x33')](_[_0x528f('0x3e')](_0x4882b7[_0x528f('0x32')],_0x2a70d6[_0x528f('0x33')]),_0x317f2f);if(_0x4882b7[_0x528f('0x32')]['filter']){_0x1c9fec[_0x528f('0x3d')]=_[_0x528f('0x3f')](_0x1c9fec[_0x528f('0x3d')],{'$or':[{'key':{'$like':'%'+_0x4882b7[_0x528f('0x32')][_0x528f('0x40')]+'%'}},{'value':{'$like':'%'+_0x4882b7['query']['filter']+'%'}}]});}_0x1c9fec=_[_0x528f('0x3f')]({},_0x1c9fec,_0x4882b7['options']);var _0x58fbb1={'where':_0x1c9fec[_0x528f('0x3d')]};return db['CannedAnswer']['count'](_0x58fbb1)[_0x528f('0x22')](function(_0x4efc51){_0x3918e3[_0x528f('0x41')]=_0x4efc51;if(_0x4882b7[_0x528f('0x32')][_0x528f('0x42')]){_0x1c9fec[_0x528f('0x43')]=[{'all':!![]}];}return db[_0x528f('0x2c')][_0x528f('0x44')](_0x1c9fec);})['then'](function(_0x446d42){_0x3918e3[_0x528f('0x45')]=_0x446d42;return _0x3918e3;})[_0x528f('0x22')](respondWithFilteredResult(_0x538c4f,_0x1c9fec))[_0x528f('0x46')](handleError(_0x538c4f,null));};exports[_0x528f('0x47')]=function(_0x407225,_0x196643){var _0x374b87={'raw':!![],'where':{'id':_0x407225['params']['id']}},_0x27da9b={};_0x27da9b[_0x528f('0x30')]=_[_0x528f('0x31')](db[_0x528f('0x2c')][_0x528f('0x2d')]);_0x27da9b[_0x528f('0x32')]=_[_0x528f('0x31')](_0x407225['query']);_0x27da9b[_0x528f('0x33')]=_[_0x528f('0x34')](_0x27da9b[_0x528f('0x30')],_0x27da9b['query']);_0x374b87['attributes']=_['intersection'](_0x27da9b[_0x528f('0x30')],qs[_0x528f('0x36')](_0x407225[_0x528f('0x32')][_0x528f('0x36')]));_0x374b87[_0x528f('0x35')]=_0x374b87[_0x528f('0x35')][_0x528f('0x37')]?_0x374b87[_0x528f('0x35')]:_0x27da9b['model'];if(_0x407225[_0x528f('0x32')][_0x528f('0x42')]){_0x374b87[_0x528f('0x43')]=[{'all':!![]}];}_0x374b87=_[_0x528f('0x3f')]({},_0x374b87,_0x407225[_0x528f('0x48')]);return db[_0x528f('0x2c')][_0x528f('0x49')](_0x374b87)[_0x528f('0x22')](handleEntityNotFound(_0x196643,null))[_0x528f('0x22')](respondWithResult(_0x196643,null))[_0x528f('0x46')](handleError(_0x196643,null));};exports['update']=function(_0x2af3a5,_0x428d3a){if(_0x2af3a5[_0x528f('0x4a')]['id']){delete _0x2af3a5['body']['id'];}return db['CannedAnswer'][_0x528f('0x49')]({'where':{'id':_0x2af3a5[_0x528f('0x4b')]['id']}})[_0x528f('0x22')](handleEntityNotFound(_0x428d3a,null))[_0x528f('0x22')](saveUpdates(_0x2af3a5['body'],null))['then'](respondWithResult(_0x428d3a,null))[_0x528f('0x46')](handleError(_0x428d3a,null));};exports[_0x528f('0x23')]=function(_0x48bd2e,_0x45a4ee){return db[_0x528f('0x2c')][_0x528f('0x49')]({'where':{'id':_0x48bd2e['params']['id']}})[_0x528f('0x22')](handleEntityNotFound(_0x45a4ee,null))[_0x528f('0x22')](removeEntity(_0x45a4ee,null))[_0x528f('0x46')](handleError(_0x45a4ee,null));};exports[_0x528f('0x4c')]=function(_0x336079,_0x5ad115){var _0x4e9df3={'key':_0x336079[_0x528f('0x4a')][_0x528f('0x2f')]};if(_0x336079[_0x528f('0x4a')][_0x528f('0x4d')]){_0x4e9df3['MailAccountId']=_0x336079['body']['MailAccountId'];}else if(_0x336079[_0x528f('0x4a')][_0x528f('0x4e')]){_0x4e9df3[_0x528f('0x4e')]=_0x336079[_0x528f('0x4a')][_0x528f('0x4e')];}else if(_0x336079[_0x528f('0x4a')]['OpenchannelAccountId']){_0x4e9df3[_0x528f('0x4f')]=_0x336079['body'][_0x528f('0x4f')];}else if(_0x336079[_0x528f('0x4a')][_0x528f('0x50')]){_0x4e9df3['ChatWebsiteId']=_0x336079[_0x528f('0x4a')][_0x528f('0x50')];}return db[_0x528f('0x2c')][_0x528f('0x49')]({'where':_0x4e9df3})[_0x528f('0x22')](function(_0x40b9fc){if(_0x40b9fc){throw new db[(_0x528f('0x51'))][(_0x528f('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x528f('0x2c')][_0x528f('0x4c')](_0x336079[_0x528f('0x4a')]);})[_0x528f('0x22')](function(_0x533c63){var _0x135d21=_0x336079[_0x528f('0x53')][_0x528f('0x24')]({'plain':!![]});if(!_0x135d21)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x135d21[_0x528f('0x54')]===_0x528f('0x53')){var _0x54479c=_0x533c63[_0x528f('0x24')]({'plain':!![]});return db[_0x528f('0x55')]['find']({'where':{'name':_0x528f('0x25'),'userProfileId':_0x135d21['userProfileId']},'raw':!![]})[_0x528f('0x22')](function(_0x391815){if(_0x391815&&_0x391815['autoAssociation']===0x0){return db[_0x528f('0x26')][_0x528f('0x4c')]({'name':_0x54479c['name'],'resourceId':_0x54479c['id'],'type':_0x391815['name'],'sectionId':_0x391815['id']},{})[_0x528f('0x22')](function(){return _0x533c63;});}else{return _0x533c63;}})[_0x528f('0x46')](function(_0x23eb69){logger[_0x528f('0x28')](_0x528f('0x56'),_0x23eb69);throw _0x23eb69;});}return _0x533c63;})[_0x528f('0x22')](respondWithResult(_0x5ad115,0xc9))['catch'](handleError(_0x5ad115,null));};
\ No newline at end of file
+var _0xe7f3=['status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x15882b,_0xc30d9d){var _0x59612d=function(_0x774f8){while(--_0x774f8){_0x15882b['push'](_0x15882b['shift']());}};_0x59612d(++_0xc30d9d);}(_0xe7f3,0x97));var _0x3e7f=function(_0x492039,_0x487df3){_0x492039=_0x492039-0x0;var _0xf1a5a2=_0xe7f3[_0x492039];return _0xf1a5a2;};'use strict';var emlformat=require(_0x3e7f('0x0'));var rimraf=require(_0x3e7f('0x1'));var zipdir=require(_0x3e7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e7f('0x3'));var moment=require('moment');var BPromise=require(_0x3e7f('0x4'));var Mustache=require('mustache');var util=require(_0x3e7f('0x5'));var path=require('path');var sox=require(_0x3e7f('0x6'));var csv=require(_0x3e7f('0x7'));var ejs=require(_0x3e7f('0x8'));var fs=require('fs');var fs_extra=require(_0x3e7f('0x9'));var _=require(_0x3e7f('0xa'));var squel=require(_0x3e7f('0xb'));var crypto=require(_0x3e7f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e7f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3e7f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3e7f('0xf'));var qs=require(_0x3e7f('0x10'));var as=require(_0x3e7f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e7f('0x12'))('api');var utils=require(_0x3e7f('0x13'));var config=require(_0x3e7f('0x14'));var licenseUtil=require(_0x3e7f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51e0e3,_0x542a5a){_0x542a5a=_0x542a5a||0xcc;return function(_0x3e122f){if(_0x3e122f){return _0x51e0e3[_0x3e7f('0x16')](_0x542a5a);}return _0x51e0e3[_0x3e7f('0x17')](_0x542a5a)['end']();};}function respondWithResult(_0x4d8c34,_0x510d08){_0x510d08=_0x510d08||0xc8;return function(_0xa44d8f){if(_0xa44d8f){return _0x4d8c34[_0x3e7f('0x17')](_0x510d08)[_0x3e7f('0x18')](_0xa44d8f);}};}function respondWithFilteredResult(_0x13a887,_0x45b57e){return function(_0x1b4bd1){if(_0x1b4bd1){var _0x39929b=typeof _0x45b57e['offset']===_0x3e7f('0x19')&&typeof _0x45b57e['limit']===_0x3e7f('0x19');var _0x5c8e4a=_0x1b4bd1[_0x3e7f('0x1a')];var _0x199f83=_0x39929b?0x0:_0x45b57e['offset'];var _0x5e0638=_0x39929b?_0x1b4bd1['count']:_0x45b57e[_0x3e7f('0x1b')]+_0x45b57e[_0x3e7f('0x1c')];var _0x26021a;if(_0x5e0638>=_0x5c8e4a){_0x5e0638=_0x5c8e4a;_0x26021a=0xc8;}else{_0x26021a=0xce;}_0x13a887[_0x3e7f('0x17')](_0x26021a);return _0x13a887[_0x3e7f('0x1d')](_0x3e7f('0x1e'),_0x199f83+'-'+_0x5e0638+'/'+_0x5c8e4a)[_0x3e7f('0x18')](_0x1b4bd1);}return null;};}function patchUpdates(_0x17302d){return function(_0x5e7246){try{jsonpatch[_0x3e7f('0x1f')](_0x5e7246,_0x17302d,!![]);}catch(_0x328edb){return BPromise[_0x3e7f('0x20')](_0x328edb);}return _0x5e7246[_0x3e7f('0x21')]();};}function saveUpdates(_0x2d04b,_0x3c0301){return function(_0x26d477){if(_0x26d477){return _0x26d477[_0x3e7f('0x22')](_0x2d04b)[_0x3e7f('0x23')](function(_0x2b185e){return _0x2b185e;});}return null;};}function removeEntity(_0xdbcce6,_0x5db45c){return function(_0x3ccdfe){if(_0x3ccdfe){return _0x3ccdfe[_0x3e7f('0x24')]()['then'](function(){var _0x660f11=_0x3ccdfe['get']({'plain':!![]});var _0x33e901=_0x3e7f('0x25');return db['UserProfileResource'][_0x3e7f('0x24')]({'where':{'type':_0x33e901,'resourceId':_0x660f11['id']}})[_0x3e7f('0x23')](function(){return _0x3ccdfe;});})[_0x3e7f('0x23')](function(){_0xdbcce6[_0x3e7f('0x17')](0xcc)[_0x3e7f('0x26')]();});}};}function handleEntityNotFound(_0x1cd40c,_0x4c7e30){return function(_0x28eb8e){if(!_0x28eb8e){_0x1cd40c[_0x3e7f('0x16')](0x194);}return _0x28eb8e;};}function handleError(_0x8638ca,_0x55a939){_0x55a939=_0x55a939||0x1f4;return function(_0xe1a67b){logger[_0x3e7f('0x27')](_0xe1a67b[_0x3e7f('0x28')]);if(_0xe1a67b[_0x3e7f('0x29')]){delete _0xe1a67b[_0x3e7f('0x29')];}_0x8638ca[_0x3e7f('0x17')](_0x55a939)[_0x3e7f('0x2a')](_0xe1a67b);};}exports[_0x3e7f('0x2b')]=function(_0xff948f,_0x32109f){var _0x362acc={},_0xeee457={},_0x159aea={'count':0x0,'rows':[]};var _0x51fdb3=_['map'](db[_0x3e7f('0x2c')][_0x3e7f('0x2d')],function(_0x57074d){return{'name':_0x57074d[_0x3e7f('0x2e')],'type':_0x57074d[_0x3e7f('0x2f')]['key']};});_0xeee457[_0x3e7f('0x30')]=_[_0x3e7f('0x31')](_0x51fdb3,_0x3e7f('0x29'));_0xeee457['query']=_['keys'](_0xff948f['query']);_0xeee457['filters']=_[_0x3e7f('0x32')](_0xeee457[_0x3e7f('0x30')],_0xeee457[_0x3e7f('0x33')]);_0x362acc[_0x3e7f('0x34')]=_[_0x3e7f('0x32')](_0xeee457[_0x3e7f('0x30')],qs[_0x3e7f('0x35')](_0xff948f['query'][_0x3e7f('0x35')]));_0x362acc['attributes']=_0x362acc[_0x3e7f('0x34')][_0x3e7f('0x36')]?_0x362acc['attributes']:_0xeee457[_0x3e7f('0x30')];if(!_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x37')](_0x3e7f('0x38'))){_0x362acc[_0x3e7f('0x1c')]=qs['limit'](_0xff948f[_0x3e7f('0x33')]['limit']);_0x362acc[_0x3e7f('0x1b')]=qs[_0x3e7f('0x1b')](_0xff948f['query'][_0x3e7f('0x1b')]);}_0x362acc[_0x3e7f('0x39')]=qs[_0x3e7f('0x3a')](_0xff948f['query'][_0x3e7f('0x3a')]);_0x362acc['where']=qs[_0x3e7f('0x3b')](_['pick'](_0xff948f[_0x3e7f('0x33')],_0xeee457[_0x3e7f('0x3b')]),_0x51fdb3);if(_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x3c')]){_0x362acc[_0x3e7f('0x3d')]=_[_0x3e7f('0x3e')](_0x362acc[_0x3e7f('0x3d')],{'$or':[{'key':{'$like':'%'+_0xff948f[_0x3e7f('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x3c')]+'%'}}]});}_0x362acc=_[_0x3e7f('0x3e')]({},_0x362acc,_0xff948f['options']);var _0x1344f4={'where':_0x362acc[_0x3e7f('0x3d')]};return db[_0x3e7f('0x2c')]['count'](_0x1344f4)[_0x3e7f('0x23')](function(_0x201cac){_0x159aea[_0x3e7f('0x1a')]=_0x201cac;if(_0xff948f[_0x3e7f('0x33')][_0x3e7f('0x3f')]){_0x362acc[_0x3e7f('0x40')]=[{'all':!![]}];}return db[_0x3e7f('0x2c')][_0x3e7f('0x41')](_0x362acc);})[_0x3e7f('0x23')](function(_0x17ad0a){_0x159aea[_0x3e7f('0x42')]=_0x17ad0a;return _0x159aea;})[_0x3e7f('0x23')](respondWithFilteredResult(_0x32109f,_0x362acc))[_0x3e7f('0x43')](handleError(_0x32109f,null));};exports[_0x3e7f('0x44')]=function(_0x3e7c08,_0x22cfb0){var _0x52b81b={'raw':!![],'where':{'id':_0x3e7c08[_0x3e7f('0x45')]['id']}},_0x227842={};_0x227842['model']=_['keys'](db[_0x3e7f('0x2c')]['rawAttributes']);_0x227842['query']=_[_0x3e7f('0x46')](_0x3e7c08[_0x3e7f('0x33')]);_0x227842[_0x3e7f('0x3b')]=_['intersection'](_0x227842['model'],_0x227842['query']);_0x52b81b[_0x3e7f('0x34')]=_[_0x3e7f('0x32')](_0x227842[_0x3e7f('0x30')],qs[_0x3e7f('0x35')](_0x3e7c08['query']['fields']));_0x52b81b['attributes']=_0x52b81b[_0x3e7f('0x34')][_0x3e7f('0x36')]?_0x52b81b[_0x3e7f('0x34')]:_0x227842[_0x3e7f('0x30')];if(_0x3e7c08[_0x3e7f('0x33')][_0x3e7f('0x3f')]){_0x52b81b['include']=[{'all':!![]}];}_0x52b81b=_[_0x3e7f('0x3e')]({},_0x52b81b,_0x3e7c08['options']);return db['CannedAnswer'][_0x3e7f('0x47')](_0x52b81b)[_0x3e7f('0x23')](handleEntityNotFound(_0x22cfb0,null))[_0x3e7f('0x23')](respondWithResult(_0x22cfb0,null))['catch'](handleError(_0x22cfb0,null));};exports['update']=function(_0x44f1ec,_0x14a122){if(_0x44f1ec[_0x3e7f('0x48')]['id']){delete _0x44f1ec[_0x3e7f('0x48')]['id'];}return db['CannedAnswer'][_0x3e7f('0x47')]({'where':{'id':_0x44f1ec[_0x3e7f('0x45')]['id']}})[_0x3e7f('0x23')](handleEntityNotFound(_0x14a122,null))['then'](saveUpdates(_0x44f1ec[_0x3e7f('0x48')],null))['then'](respondWithResult(_0x14a122,null))[_0x3e7f('0x43')](handleError(_0x14a122,null));};exports['destroy']=function(_0x515a60,_0x4d83b3){return db[_0x3e7f('0x2c')][_0x3e7f('0x47')]({'where':{'id':_0x515a60['params']['id']}})[_0x3e7f('0x23')](handleEntityNotFound(_0x4d83b3,null))[_0x3e7f('0x23')](removeEntity(_0x4d83b3,null))[_0x3e7f('0x43')](handleError(_0x4d83b3,null));};exports[_0x3e7f('0x49')]=function(_0x42a44c,_0x46a443){var _0x538e37={'key':_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4a')]};if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4b')]){_0x538e37['MailAccountId']=_0x42a44c['body'][_0x3e7f('0x4b')];}else if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4c')]){_0x538e37[_0x3e7f('0x4c')]=_0x42a44c[_0x3e7f('0x48')]['SmsAccountId'];}else if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4d')]){_0x538e37[_0x3e7f('0x4d')]=_0x42a44c[_0x3e7f('0x48')]['OpenchannelAccountId'];}else if(_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4e')]){_0x538e37[_0x3e7f('0x4e')]=_0x42a44c[_0x3e7f('0x48')][_0x3e7f('0x4e')];}return db[_0x3e7f('0x2c')][_0x3e7f('0x47')]({'where':_0x538e37})[_0x3e7f('0x23')](function(_0x139ae2){if(_0x139ae2){throw new db['Sequelize'][(_0x3e7f('0x4f'))](_0x3e7f('0x50'));}return db[_0x3e7f('0x2c')][_0x3e7f('0x49')](_0x42a44c['body']);})[_0x3e7f('0x23')](function(_0x5a624a){var _0x4bda60=_0x42a44c[_0x3e7f('0x51')][_0x3e7f('0x52')]({'plain':!![]});if(!_0x4bda60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bda60[_0x3e7f('0x53')]===_0x3e7f('0x51')){var _0x4ba8e1=_0x5a624a[_0x3e7f('0x52')]({'plain':!![]});return db[_0x3e7f('0x54')]['find']({'where':{'name':_0x3e7f('0x25'),'userProfileId':_0x4bda60[_0x3e7f('0x55')]},'raw':!![]})[_0x3e7f('0x23')](function(_0x2df04e){if(_0x2df04e&&_0x2df04e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4ba8e1['name'],'resourceId':_0x4ba8e1['id'],'type':_0x2df04e['name'],'sectionId':_0x2df04e['id']},{})[_0x3e7f('0x23')](function(){return _0x5a624a;});}else{return _0x5a624a;}})[_0x3e7f('0x43')](function(_0x4db259){logger[_0x3e7f('0x27')](_0x3e7f('0x56'),_0x4db259);throw _0x4db259;});}return _0x5a624a;})[_0x3e7f('0x23')](respondWithResult(_0x46a443,0xc9))['catch'](handleError(_0x46a443,null));};
\ No newline at end of file
index 7297ca5..34ba175 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cf2=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer'];(function(_0x3fa63f,_0x548355){var _0x3a99ed=function(_0x17b249){while(--_0x17b249){_0x3fa63f['push'](_0x3fa63f['shift']());}};_0x3a99ed(++_0x548355);}(_0x8cf2,0x1a7));var _0x28cf=function(_0x3a7ae7,_0x33e3a7){_0x3a7ae7=_0x3a7ae7-0x0;var _0x1b8913=_0x8cf2[_0x3a7ae7];return _0x1b8913;};'use strict';var _=require(_0x28cf('0x0'));var util=require(_0x28cf('0x1'));var logger=require(_0x28cf('0x2'))(_0x28cf('0x3'));var moment=require(_0x28cf('0x4'));var BPromise=require(_0x28cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28cf('0x6'));var rimraf=require(_0x28cf('0x7'));var config=require(_0x28cf('0x8'));var attributes=require(_0x28cf('0x9'));module['exports']=function(_0x13a089,_0xbbabf8){return _0x13a089[_0x28cf('0xa')](_0x28cf('0xb'),attributes,{'tableName':_0x28cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x28cf('0xd'),'collate':_0x28cf('0xe')});};
\ No newline at end of file
+var _0x5e29=['./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5e29,0x149));var _0x95e2=function(_0x57caf0,_0x1fe145){_0x57caf0=_0x57caf0-0x0;var _0x65d871=_0x5e29[_0x57caf0];return _0x65d871;};'use strict';var _=require(_0x95e2('0x0'));var util=require('util');var logger=require(_0x95e2('0x1'))('api');var moment=require(_0x95e2('0x2'));var BPromise=require(_0x95e2('0x3'));var rp=require(_0x95e2('0x4'));var fs=require('fs');var path=require(_0x95e2('0x5'));var rimraf=require(_0x95e2('0x6'));var config=require('../../config/environment');var attributes=require(_0x95e2('0x7'));module[_0x95e2('0x8')]=function(_0x3ba9d3,_0x1373d6){return _0x3ba9d3['define'](_0x95e2('0x9'),attributes,{'tableName':_0x95e2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x95e2('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 5540400..39d4ae1 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(_0x2e7213,_0xe14507){var _0x3643db=function(_0x3c27ee){while(--_0x3c27ee){_0x2e7213['push'](_0x2e7213['shift']());}};_0x3643db(++_0xe14507);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1ad31b,_0x50da64){var _0x17f2f0=function(_0x5483b6){while(--_0x5483b6){_0x1ad31b['push'](_0x1ad31b['shift']());}};_0x17f2f0(++_0x50da64);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index a2d1d30..a92e274 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2241=['util','connect-timeout','express','Router','fs-extra','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x4e5b0e,_0x15a6b0){var _0x1606bd=function(_0x1a18ec){while(--_0x1a18ec){_0x4e5b0e['push'](_0x4e5b0e['shift']());}};_0x1606bd(++_0x15a6b0);}(_0x2241,0x97));var _0x1224=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2241[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x1224('0x0'));var util=require(_0x1224('0x1'));var path=require('path');var timeout=require(_0x1224('0x2'));var express=require(_0x1224('0x3'));var router=express[_0x1224('0x4')]();var fs_extra=require(_0x1224('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1224('0x6'));router[_0x1224('0x7')]('/',auth[_0x1224('0x8')](),controller[_0x1224('0x9')]);router[_0x1224('0x7')]('/:id',auth[_0x1224('0x8')](),controller[_0x1224('0xa')]);router[_0x1224('0xb')]('/',auth[_0x1224('0x8')](),controller[_0x1224('0xc')]);router[_0x1224('0xd')](_0x1224('0xe'),auth[_0x1224('0x8')](),controller[_0x1224('0xf')]);router[_0x1224('0x10')]('/:id',auth[_0x1224('0x8')](),controller[_0x1224('0x11')]);module[_0x1224('0x12')]=router;
\ No newline at end of file
+var _0x9dbc=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x938c4e,_0x2fa5ca){var _0x2bb9a9=function(_0x3a2a61){while(--_0x3a2a61){_0x938c4e['push'](_0x938c4e['shift']());}};_0x2bb9a9(++_0x2fa5ca);}(_0x9dbc,0xc1));var _0xc9db=function(_0xcc1266,_0x27ba6d){_0xcc1266=_0xcc1266-0x0;var _0x34e46a=_0x9dbc[_0xcc1266];return _0x34e46a;};'use strict';var multer=require(_0xc9db('0x0'));var util=require(_0xc9db('0x1'));var path=require(_0xc9db('0x2'));var timeout=require(_0xc9db('0x3'));var express=require(_0xc9db('0x4'));var router=express[_0xc9db('0x5')]();var fs_extra=require(_0xc9db('0x6'));var auth=require(_0xc9db('0x7'));var interaction=require(_0xc9db('0x8'));var config=require(_0xc9db('0x9'));var controller=require('./cannedAnswer.controller');router[_0xc9db('0xa')]('/',auth[_0xc9db('0xb')](),controller[_0xc9db('0xc')]);router[_0xc9db('0xa')](_0xc9db('0xd'),auth[_0xc9db('0xb')](),controller['show']);router[_0xc9db('0xe')]('/',auth[_0xc9db('0xb')](),controller[_0xc9db('0xf')]);router[_0xc9db('0x10')]('/:id',auth[_0xc9db('0xb')](),controller[_0xc9db('0x11')]);router['delete']('/:id',auth[_0xc9db('0xb')](),controller[_0xc9db('0x12')]);module[_0xc9db('0x13')]=router;
\ No newline at end of file
index 8b26f6d..bca494b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2504=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x51b8ec,_0x4293bd){var _0x25d058=function(_0x4d7d3a){while(--_0x4d7d3a){_0x51b8ec['push'](_0x51b8ec['shift']());}};_0x25d058(++_0x4293bd);}(_0x2504,0xee));var _0x4250=function(_0x2fb3b8,_0xf4d664){_0x2fb3b8=_0x2fb3b8-0x0;var _0x51db65=_0x2504[_0x2fb3b8];return _0x51db65;};'use strict';var Sequelize=require(_0x4250('0x0'));module[_0x4250('0x1')]={'calldate':{'type':Sequelize[_0x4250('0x2')],'allowNull':![],'defaultValue':_0x4250('0x3')},'clid':{'type':Sequelize[_0x4250('0x4')]},'src':{'type':Sequelize[_0x4250('0x4')]},'dst':{'type':Sequelize[_0x4250('0x4')]},'dcontext':{'type':Sequelize[_0x4250('0x4')]},'channel':{'type':Sequelize[_0x4250('0x4')]},'dstchannel':{'type':Sequelize[_0x4250('0x4')]},'lastapp':{'type':Sequelize[_0x4250('0x4')]},'lastdata':{'type':Sequelize[_0x4250('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4250('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4250('0x4')]},'userfield':{'type':Sequelize[_0x4250('0x4')]},'uniqueid':{'type':Sequelize[_0x4250('0x4')]},'linkedid':{'type':Sequelize[_0x4250('0x4')]},'sequence':{'type':Sequelize[_0x4250('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4250('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7217=['INTEGER','DATE','STRING'];(function(_0x2fe487,_0x2b78f6){var _0x250916=function(_0x4b9a0c){while(--_0x4b9a0c){_0x2fe487['push'](_0x2fe487['shift']());}};_0x250916(++_0x2b78f6);}(_0x7217,0xa9));var _0x7721=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x7217[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x7721('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7721('0x1')]},'src':{'type':Sequelize[_0x7721('0x1')]},'dst':{'type':Sequelize[_0x7721('0x1')]},'dcontext':{'type':Sequelize[_0x7721('0x1')]},'channel':{'type':Sequelize[_0x7721('0x1')]},'dstchannel':{'type':Sequelize[_0x7721('0x1')]},'lastapp':{'type':Sequelize[_0x7721('0x1')]},'lastdata':{'type':Sequelize[_0x7721('0x1')]},'duration':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7721('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x7721('0x1')]},'userfield':{'type':Sequelize[_0x7721('0x1')]},'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x7721('0x1')]},'peeraccount':{'type':Sequelize[_0x7721('0x1')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x7721('0x1')]}};
\ No newline at end of file
index 4cc4dca..d8cca91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038b=['lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','length','include','options','create','body','find','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv'];(function(_0x375072,_0x1ad2ed){var _0x3e82e7=function(_0x2a03ec){while(--_0x2a03ec){_0x375072['push'](_0x375072['shift']());}};_0x3e82e7(++_0x1ad2ed);}(_0x038b,0x114));var _0xb038=function(_0x236021,_0x5acc10){_0x236021=_0x236021-0x0;var _0x4d5fa6=_0x038b[_0x236021];return _0x4d5fa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb038('0x0'));var zipdir=require(_0xb038('0x1'));var jsonpatch=require(_0xb038('0x2'));var rp=require('request-promise');var moment=require(_0xb038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require('path');var sox=require(_0xb038('0x6'));var csv=require(_0xb038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb038('0x8'));var squel=require(_0xb038('0x9'));var crypto=require(_0xb038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb038('0x7'));var querystring=require(_0xb038('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb038('0xc'));var qs=require(_0xb038('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb038('0xe'));var logger=require(_0xb038('0xf'))(_0xb038('0x10'));var utils=require(_0xb038('0x11'));var config=require(_0xb038('0x12'));var licenseUtil=require(_0xb038('0x13'));var db=require(_0xb038('0x14'))['db'];function respondWithStatusCode(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xcc;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0x15')](_0x16e4a3);}return _0x439751[_0xb038('0x16')](_0x16e4a3)[_0xb038('0x17')]();};}function respondWithResult(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0xc8;return function(_0x13acc7){if(_0x13acc7){return _0x3cc717[_0xb038('0x16')](_0x3a71a6)['json'](_0x13acc7);}};}function respondWithFilteredResult(_0xe8aa7c,_0x26e4f2){return function(_0x183141){if(_0x183141){var _0x39323e=typeof _0x26e4f2[_0xb038('0x18')]===_0xb038('0x19')&&typeof _0x26e4f2['limit']===_0xb038('0x19');var _0x3039b0=_0x183141[_0xb038('0x1a')];var _0x3b095a=_0x39323e?0x0:_0x26e4f2['offset'];var _0x49b237=_0x39323e?_0x183141[_0xb038('0x1a')]:_0x26e4f2[_0xb038('0x18')]+_0x26e4f2[_0xb038('0x1b')];var _0x31c348;if(_0x49b237>=_0x3039b0){_0x49b237=_0x3039b0;_0x31c348=0xc8;}else{_0x31c348=0xce;}_0xe8aa7c['status'](_0x31c348);return _0xe8aa7c[_0xb038('0x1c')](_0xb038('0x1d'),_0x3b095a+'-'+_0x49b237+'/'+_0x3039b0)[_0xb038('0x1e')](_0x183141);}return null;};}function patchUpdates(_0x33a377){return function(_0xc6cd61){try{jsonpatch['apply'](_0xc6cd61,_0x33a377,!![]);}catch(_0x2e0369){return BPromise[_0xb038('0x1f')](_0x2e0369);}return _0xc6cd61[_0xb038('0x20')]();};}function saveUpdates(_0x87b899,_0x5f123d){return function(_0x2812c9){if(_0x2812c9){return _0x2812c9[_0xb038('0x21')](_0x87b899)['then'](function(_0x1eb9cd){return _0x1eb9cd;});}return null;};}function removeEntity(_0x43d403,_0x573f93){return function(_0x241329){if(_0x241329){return _0x241329['destroy']()[_0xb038('0x22')](function(){_0x43d403[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();});}};}function handleEntityNotFound(_0x1df7c4,_0x5d4343){return function(_0xe4ceda){if(!_0xe4ceda){_0x1df7c4[_0xb038('0x15')](0x194);}return _0xe4ceda;};}function handleError(_0x576be5,_0xb6d93f){_0xb6d93f=_0xb6d93f||0x1f4;return function(_0x33cf3c){logger[_0xb038('0x23')](_0x33cf3c['stack']);if(_0x33cf3c[_0xb038('0x24')]){delete _0x33cf3c[_0xb038('0x24')];}_0x576be5[_0xb038('0x16')](_0xb6d93f)['send'](_0x33cf3c);};}exports[_0xb038('0x25')]=function(_0x2855a6,_0x28a6a9){var _0x12b3b6={},_0xc387d={},_0x551b55={'count':0x0,'rows':[]};var _0x1783d4=_[_0xb038('0x26')](db[_0xb038('0x27')][_0xb038('0x28')],function(_0x1abe23){return{'name':_0x1abe23[_0xb038('0x29')],'type':_0x1abe23[_0xb038('0x2a')][_0xb038('0x2b')]};});_0xc387d[_0xb038('0x2c')]=_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24'));_0xc387d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2855a6['query']);_0xc387d[_0xb038('0x2f')]=_['intersection'](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x2d')]);_0x12b3b6[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x32')]));_0x12b3b6[_0xb038('0x30')]=_0x12b3b6[_0xb038('0x30')]['length']?_0x12b3b6[_0xb038('0x30')]:_0xc387d[_0xb038('0x2c')];if(!_0x2855a6[_0xb038('0x2d')]['hasOwnProperty']('nolimit')){_0x12b3b6['limit']=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x2855a6[_0xb038('0x2d')]['offset']);}_0x12b3b6[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x34')]);_0x12b3b6['where']=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x2855a6['query'],_0xc387d['filters']),_0x1783d4);if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]){_0x12b3b6[_0xb038('0x37')]=_[_0xb038('0x38')](_0x12b3b6[_0xb038('0x37')],{'$or':_['map'](_0x1783d4,function(_0x404f82){if(_0x404f82[_0xb038('0x2a')]!==_0xb038('0x39')){var _0x2d1e57={};_0x2d1e57[_0x404f82['name']]={'$like':'%'+_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x2d1e57;}})});}_0x12b3b6=_[_0xb038('0x38')]({},_0x12b3b6,_0x2855a6['options']);var _0x412d71={'where':_0x12b3b6['where']};return db[_0xb038('0x27')][_0xb038('0x1a')](_0x412d71)[_0xb038('0x22')](function(_0x5ce40c){_0x551b55[_0xb038('0x1a')]=_0x5ce40c;if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x3a')]){_0x12b3b6['include']=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3b')](_0x12b3b6);})[_0xb038('0x22')](function(_0x3c291e){_0x551b55['rows']=_0x3c291e;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x3c')](handleError(_0x28a6a9,null));};exports[_0xb038('0x3d')]=function(_0x2a0436,_0x52e1d6){var _0x19dc7b={'raw':!![],'where':{'id':_0x2a0436['params']['id']}},_0x269c7d={};_0x269c7d[_0xb038('0x2c')]=_[_0xb038('0x2e')](db[_0xb038('0x27')]['rawAttributes']);_0x269c7d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2a0436['query']);_0x269c7d['filters']=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],_0x269c7d[_0xb038('0x2d')]);_0x19dc7b[_0xb038('0x30')]=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2a0436[_0xb038('0x2d')]['fields']));_0x19dc7b['attributes']=_0x19dc7b['attributes'][_0xb038('0x3e')]?_0x19dc7b[_0xb038('0x30')]:_0x269c7d['model'];if(_0x2a0436[_0xb038('0x2d')][_0xb038('0x3a')]){_0x19dc7b[_0xb038('0x3f')]=[{'all':!![]}];}_0x19dc7b=_['merge']({},_0x19dc7b,_0x2a0436[_0xb038('0x40')]);return db['Cdr']['find'](_0x19dc7b)[_0xb038('0x22')](handleEntityNotFound(_0x52e1d6,null))[_0xb038('0x22')](respondWithResult(_0x52e1d6,null))[_0xb038('0x3c')](handleError(_0x52e1d6,null));};exports[_0xb038('0x41')]=function(_0x304515,_0x3b09e3){return db[_0xb038('0x27')][_0xb038('0x41')](_0x304515[_0xb038('0x42')],{})[_0xb038('0x22')](respondWithResult(_0x3b09e3,0xc9))['catch'](handleError(_0x3b09e3,null));};exports[_0xb038('0x21')]=function(_0x3ed968,_0x5c11d7){if(_0x3ed968[_0xb038('0x42')]['id']){delete _0x3ed968[_0xb038('0x42')]['id'];}return db['Cdr'][_0xb038('0x43')]({'where':{'id':_0x3ed968[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x5c11d7,null))[_0xb038('0x22')](saveUpdates(_0x3ed968[_0xb038('0x42')],null))[_0xb038('0x22')](respondWithResult(_0x5c11d7,null))[_0xb038('0x3c')](handleError(_0x5c11d7,null));};exports[_0xb038('0x45')]=function(_0x3a291d,_0x54a826){return db[_0xb038('0x27')][_0xb038('0x43')]({'where':{'id':_0x3a291d[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x54a826,null))[_0xb038('0x22')](removeEntity(_0x54a826,null))[_0xb038('0x3c')](handleError(_0x54a826,null));};exports['describe']=function(_0x1f4997,_0x2f3622){return db[_0xb038('0x27')][_0xb038('0x46')]()[_0xb038('0x22')](respondWithResult(_0x2f3622,null))[_0xb038('0x3c')](handleError(_0x2f3622,null));};
\ No newline at end of file
+var _0xcb81=['save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','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','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject'];(function(_0x57e648,_0x2d8f7e){var _0x3edc8f=function(_0x426502){while(--_0x426502){_0x57e648['push'](_0x57e648['shift']());}};_0x3edc8f(++_0x2d8f7e);}(_0xcb81,0x154));var _0x1cb8=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0xcb81[_0x2440fe];return _0x5cf734;};'use strict';var emlformat=require(_0x1cb8('0x0'));var rimraf=require(_0x1cb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cb8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1cb8('0x3'));var util=require(_0x1cb8('0x4'));var path=require(_0x1cb8('0x5'));var sox=require(_0x1cb8('0x6'));var csv=require(_0x1cb8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb8('0x8'));var _=require(_0x1cb8('0x9'));var squel=require('squel');var crypto=require(_0x1cb8('0xa'));var jsforce=require(_0x1cb8('0xb'));var deskjs=require(_0x1cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1cb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cb8('0xe'));var qs=require(_0x1cb8('0xf'));var as=require(_0x1cb8('0x10'));var hardwareService=require(_0x1cb8('0x11'));var logger=require(_0x1cb8('0x12'))(_0x1cb8('0x13'));var utils=require(_0x1cb8('0x14'));var config=require(_0x1cb8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cb8('0x16'))['db'];function respondWithStatusCode(_0x1ffe94,_0x1938ee){_0x1938ee=_0x1938ee||0xcc;return function(_0x299eea){if(_0x299eea){return _0x1ffe94[_0x1cb8('0x17')](_0x1938ee);}return _0x1ffe94['status'](_0x1938ee)[_0x1cb8('0x18')]();};}function respondWithResult(_0x2c600,_0xcb6ad1){_0xcb6ad1=_0xcb6ad1||0xc8;return function(_0x14d84d){if(_0x14d84d){return _0x2c600[_0x1cb8('0x19')](_0xcb6ad1)[_0x1cb8('0x1a')](_0x14d84d);}};}function respondWithFilteredResult(_0x339ad0,_0x243930){return function(_0x5af4a3){if(_0x5af4a3){var _0x17a95d=typeof _0x243930['offset']===_0x1cb8('0x1b')&&typeof _0x243930[_0x1cb8('0x1c')]===_0x1cb8('0x1b');var _0x46abd0=_0x5af4a3[_0x1cb8('0x1d')];var _0x308088=_0x17a95d?0x0:_0x243930[_0x1cb8('0x1e')];var _0x9f0adb=_0x17a95d?_0x5af4a3[_0x1cb8('0x1d')]:_0x243930[_0x1cb8('0x1e')]+_0x243930[_0x1cb8('0x1c')];var _0x3cda27;if(_0x9f0adb>=_0x46abd0){_0x9f0adb=_0x46abd0;_0x3cda27=0xc8;}else{_0x3cda27=0xce;}_0x339ad0['status'](_0x3cda27);return _0x339ad0[_0x1cb8('0x1f')](_0x1cb8('0x20'),_0x308088+'-'+_0x9f0adb+'/'+_0x46abd0)[_0x1cb8('0x1a')](_0x5af4a3);}return null;};}function patchUpdates(_0x3d1682){return function(_0x4abf3a){try{jsonpatch[_0x1cb8('0x21')](_0x4abf3a,_0x3d1682,!![]);}catch(_0x4f9220){return BPromise[_0x1cb8('0x22')](_0x4f9220);}return _0x4abf3a[_0x1cb8('0x23')]();};}function saveUpdates(_0x40b914,_0x38ff3a){return function(_0x559916){if(_0x559916){return _0x559916['update'](_0x40b914)[_0x1cb8('0x24')](function(_0x4040be){return _0x4040be;});}return null;};}function removeEntity(_0x22dafe,_0x44a00d){return function(_0x2473b8){if(_0x2473b8){return _0x2473b8[_0x1cb8('0x25')]()[_0x1cb8('0x24')](function(){_0x22dafe['status'](0xcc)[_0x1cb8('0x18')]();});}};}function handleEntityNotFound(_0x4554d5,_0x35c890){return function(_0xeeb21d){if(!_0xeeb21d){_0x4554d5[_0x1cb8('0x17')](0x194);}return _0xeeb21d;};}function handleError(_0x41ab56,_0x4ca3be){_0x4ca3be=_0x4ca3be||0x1f4;return function(_0x1ec995){logger[_0x1cb8('0x26')](_0x1ec995[_0x1cb8('0x27')]);if(_0x1ec995[_0x1cb8('0x28')]){delete _0x1ec995[_0x1cb8('0x28')];}_0x41ab56['status'](_0x4ca3be)[_0x1cb8('0x29')](_0x1ec995);};}exports[_0x1cb8('0x2a')]=function(_0x3a8b53,_0x21c17a){var _0x4fda96={},_0x2a79e0={},_0x2ba8c8={'count':0x0,'rows':[]};var _0x3a6a67=_['map'](db[_0x1cb8('0x2b')][_0x1cb8('0x2c')],function(_0x17abe1){return{'name':_0x17abe1['fieldName'],'type':_0x17abe1[_0x1cb8('0x2d')][_0x1cb8('0x2e')]};});_0x2a79e0[_0x1cb8('0x2f')]=_[_0x1cb8('0x30')](_0x3a6a67,_0x1cb8('0x28'));_0x2a79e0['query']=_[_0x1cb8('0x31')](_0x3a8b53[_0x1cb8('0x32')]);_0x2a79e0[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],_0x2a79e0[_0x1cb8('0x32')]);_0x4fda96[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x2a79e0[_0x1cb8('0x2f')],qs['fields'](_0x3a8b53['query'][_0x1cb8('0x36')]));_0x4fda96[_0x1cb8('0x35')]=_0x4fda96[_0x1cb8('0x35')]['length']?_0x4fda96['attributes']:_0x2a79e0[_0x1cb8('0x2f')];if(!_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x37')](_0x1cb8('0x38'))){_0x4fda96[_0x1cb8('0x1c')]=qs[_0x1cb8('0x1c')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1c')]);_0x4fda96['offset']=qs[_0x1cb8('0x1e')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x1e')]);}_0x4fda96[_0x1cb8('0x39')]=qs[_0x1cb8('0x3a')](_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x3a')]);_0x4fda96[_0x1cb8('0x3b')]=qs[_0x1cb8('0x33')](_['pick'](_0x3a8b53[_0x1cb8('0x32')],_0x2a79e0[_0x1cb8('0x33')]),_0x3a6a67);if(_0x3a8b53['query'][_0x1cb8('0x3c')]){_0x4fda96[_0x1cb8('0x3b')]=_[_0x1cb8('0x3d')](_0x4fda96[_0x1cb8('0x3b')],{'$or':_[_0x1cb8('0x30')](_0x3a6a67,function(_0x5dc4c0){if(_0x5dc4c0[_0x1cb8('0x2d')]!==_0x1cb8('0x3e')){var _0x2989c6={};_0x2989c6[_0x5dc4c0['name']]={'$like':'%'+_0x3a8b53['query']['filter']+'%'};return _0x2989c6;}})});}_0x4fda96=_[_0x1cb8('0x3d')]({},_0x4fda96,_0x3a8b53[_0x1cb8('0x3f')]);var _0x328f7e={'where':_0x4fda96[_0x1cb8('0x3b')]};return db['Cdr']['count'](_0x328f7e)[_0x1cb8('0x24')](function(_0x25f0a3){_0x2ba8c8[_0x1cb8('0x1d')]=_0x25f0a3;if(_0x3a8b53[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x4fda96[_0x1cb8('0x41')]=[{'all':!![]}];}return db[_0x1cb8('0x2b')][_0x1cb8('0x42')](_0x4fda96);})['then'](function(_0x2044d1){_0x2ba8c8[_0x1cb8('0x43')]=_0x2044d1;return _0x2ba8c8;})[_0x1cb8('0x24')](respondWithFilteredResult(_0x21c17a,_0x4fda96))[_0x1cb8('0x44')](handleError(_0x21c17a,null));};exports['show']=function(_0x156298,_0x47c18a){var _0x2060a6={'raw':!![],'where':{'id':_0x156298['params']['id']}},_0x37230e={};_0x37230e[_0x1cb8('0x2f')]=_[_0x1cb8('0x31')](db[_0x1cb8('0x2b')]['rawAttributes']);_0x37230e['query']=_[_0x1cb8('0x31')](_0x156298['query']);_0x37230e[_0x1cb8('0x33')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],_0x37230e[_0x1cb8('0x32')]);_0x2060a6[_0x1cb8('0x35')]=_[_0x1cb8('0x34')](_0x37230e[_0x1cb8('0x2f')],qs['fields'](_0x156298[_0x1cb8('0x32')][_0x1cb8('0x36')]));_0x2060a6[_0x1cb8('0x35')]=_0x2060a6[_0x1cb8('0x35')]['length']?_0x2060a6[_0x1cb8('0x35')]:_0x37230e[_0x1cb8('0x2f')];if(_0x156298[_0x1cb8('0x32')][_0x1cb8('0x40')]){_0x2060a6[_0x1cb8('0x41')]=[{'all':!![]}];}_0x2060a6=_['merge']({},_0x2060a6,_0x156298[_0x1cb8('0x3f')]);return db[_0x1cb8('0x2b')][_0x1cb8('0x45')](_0x2060a6)[_0x1cb8('0x24')](handleEntityNotFound(_0x47c18a,null))[_0x1cb8('0x24')](respondWithResult(_0x47c18a,null))['catch'](handleError(_0x47c18a,null));};exports[_0x1cb8('0x46')]=function(_0x3a4ec4,_0x5598b1){return db[_0x1cb8('0x2b')][_0x1cb8('0x46')](_0x3a4ec4[_0x1cb8('0x47')],{})[_0x1cb8('0x24')](respondWithResult(_0x5598b1,0xc9))[_0x1cb8('0x44')](handleError(_0x5598b1,null));};exports[_0x1cb8('0x48')]=function(_0x3b063c,_0x219541){if(_0x3b063c[_0x1cb8('0x47')]['id']){delete _0x3b063c[_0x1cb8('0x47')]['id'];}return db[_0x1cb8('0x2b')][_0x1cb8('0x45')]({'where':{'id':_0x3b063c[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x219541,null))['then'](saveUpdates(_0x3b063c[_0x1cb8('0x47')],null))[_0x1cb8('0x24')](respondWithResult(_0x219541,null))[_0x1cb8('0x44')](handleError(_0x219541,null));};exports[_0x1cb8('0x25')]=function(_0x21aba7,_0x15f0ba){return db[_0x1cb8('0x2b')]['find']({'where':{'id':_0x21aba7[_0x1cb8('0x49')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x15f0ba,null))[_0x1cb8('0x24')](removeEntity(_0x15f0ba,null))['catch'](handleError(_0x15f0ba,null));};exports['describe']=function(_0x1c12aa,_0x42cc81){return db[_0x1cb8('0x2b')][_0x1cb8('0x4a')]()[_0x1cb8('0x24')](respondWithResult(_0x42cc81,null))['catch'](handleError(_0x42cc81,null));};
\ No newline at end of file
index 86d50ca..d2c887a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2ab6f0,_0xbcac98){var _0x140f2=function(_0x240529){while(--_0x240529){_0x2ab6f0['push'](_0x2ab6f0['shift']());}};_0x140f2(++_0xbcac98);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x52c27d,_0xda4996){var _0x3e712a=function(_0x4bc790){while(--_0x4bc790){_0x52c27d['push'](_0x52c27d['shift']());}};_0x3e712a(++_0xda4996);}(_0x7a54,0x106));var _0x47a5=function(_0x1ffa19,_0x143952){_0x1ffa19=_0x1ffa19-0x0;var _0x125b11=_0x7a54[_0x1ffa19];return _0x125b11;};'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 8d281fa..10dc045 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93e6=['ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93e6,0xcc));var _0x693e=function(_0x485c9f,_0x399a20){_0x485c9f=_0x485c9f-0x0;var _0x2ba76e=_0x93e6[_0x485c9f];return _0x2ba76e;};'use strict';var _=require(_0x693e('0x0'));var util=require(_0x693e('0x1'));var moment=require(_0x693e('0x2'));var BPromise=require(_0x693e('0x3'));var rs=require(_0x693e('0x4'));var fs=require('fs');var Redis=require(_0x693e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x693e('0x6'));var logger=require(_0x693e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x693e('0x8'));var client=jayson['client'][_0x693e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52cbf5,_0x4f6ffa,_0x3cbefd){return new BPromise(function(_0x38da4c,_0x58b9a3){return client[_0x693e('0xa')](_0x52cbf5,_0x3cbefd)[_0x693e('0xb')](function(_0x56d87f){logger[_0x693e('0xc')](_0x693e('0xd'),_0x4f6ffa,'request\x20sent');logger[_0x693e('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x4f6ffa,_0x693e('0xf'),JSON['stringify'](_0x56d87f));if(_0x56d87f[_0x693e('0x10')]){if(_0x56d87f[_0x693e('0x10')]['code']===0x1f4){logger[_0x693e('0x10')](_0x693e('0xd'),_0x4f6ffa,_0x56d87f[_0x693e('0x10')]['message']);return _0x58b9a3(_0x56d87f[_0x693e('0x10')][_0x693e('0x11')]);}logger[_0x693e('0x10')](_0x693e('0xd'),_0x4f6ffa,_0x56d87f[_0x693e('0x10')][_0x693e('0x11')]);return _0x38da4c(_0x56d87f[_0x693e('0x10')][_0x693e('0x11')]);}else{logger[_0x693e('0xc')](_0x693e('0xd'),_0x4f6ffa,_0x693e('0xf'));_0x38da4c(_0x56d87f['result'][_0x693e('0x11')]);}})[_0x693e('0x12')](function(_0x3a793f){logger['error'](_0x693e('0xd'),_0x4f6ffa,_0x3a793f);_0x58b9a3(_0x3a793f);});});}
\ No newline at end of file
+var _0xecdd=['Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x2a1445,_0x5d2b8d){var _0x5ec7f4=function(_0x54492a){while(--_0x54492a){_0x2a1445['push'](_0x2a1445['shift']());}};_0x5ec7f4(++_0x5d2b8d);}(_0xecdd,0x169));var _0xdecd=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xecdd[_0x4ea69d];return _0x5318e0;};'use strict';var _=require('lodash');var util=require(_0xdecd('0x0'));var moment=require(_0xdecd('0x1'));var BPromise=require('bluebird');var rs=require(_0xdecd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdecd('0x3'))['db'];var utils=require(_0xdecd('0x4'));var logger=require(_0xdecd('0x5'))(_0xdecd('0x6'));var config=require(_0xdecd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdecd('0x8')][_0xdecd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28537c,_0x535609,_0x213407){return new BPromise(function(_0x582899,_0x4302e8){return client[_0xdecd('0xa')](_0x28537c,_0x213407)[_0xdecd('0xb')](function(_0x122a36){logger[_0xdecd('0xc')](_0xdecd('0xd'),_0x535609,_0xdecd('0xe'));logger[_0xdecd('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x535609,_0xdecd('0xe'),JSON[_0xdecd('0x10')](_0x122a36));if(_0x122a36['error']){if(_0x122a36[_0xdecd('0x11')][_0xdecd('0x12')]===0x1f4){logger[_0xdecd('0x11')]('Cdr,\x20%s,\x20%s',_0x535609,_0x122a36[_0xdecd('0x11')]['message']);return _0x4302e8(_0x122a36[_0xdecd('0x11')][_0xdecd('0x13')]);}logger['error'](_0xdecd('0xd'),_0x535609,_0x122a36[_0xdecd('0x11')]['message']);return _0x582899(_0x122a36[_0xdecd('0x11')][_0xdecd('0x13')]);}else{logger[_0xdecd('0xc')](_0xdecd('0xd'),_0x535609,_0xdecd('0xe'));_0x582899(_0x122a36[_0xdecd('0x14')][_0xdecd('0x13')]);}})[_0xdecd('0x15')](function(_0xc014a3){logger[_0xdecd('0x11')](_0xdecd('0xd'),_0x535609,_0xc014a3);_0x4302e8(_0xc014a3);});});}
\ No newline at end of file
index e8e56a6..e322466 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(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x1f808f,_0x172b10){var _0x282348=function(_0xfa8c2){while(--_0xfa8c2){_0x1f808f['push'](_0x1f808f['shift']());}};_0x282348(++_0x172b10);}(_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 c67368e..10536ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbddc=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x575b4c,_0x547381){var _0x1dd85f=function(_0x49317f){while(--_0x49317f){_0x575b4c['push'](_0x575b4c['shift']());}};_0x1dd85f(++_0x547381);}(_0xbddc,0x126));var _0xcbdd=function(_0x1521fa,_0x59b606){_0x1521fa=_0x1521fa-0x0;var _0x4eb3e2=_0xbddc[_0x1521fa];return _0x4eb3e2;};'use strict';var Sequelize=require(_0xcbdd('0x0'));module[_0xcbdd('0x1')]={'priority':{'type':Sequelize[_0xcbdd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcbdd('0x3')],'allowNull':![],'defaultValue':_0xcbdd('0x4')},'appdata':{'type':Sequelize[_0xcbdd('0x5')]()},'description':{'type':Sequelize[_0xcbdd('0x3')]},'interval':{'type':Sequelize[_0xcbdd('0x3')],'defaultValue':_0xcbdd('0x6')}};
\ No newline at end of file
+var _0xbd13=['*,*,*,*','sequelize','exports','noop','TEXT','STRING'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xbd13,0xc7));var _0x3bd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd13[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3bd1('0x0'));module[_0x3bd1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3bd1('0x2')},'appdata':{'type':Sequelize[_0x3bd1('0x3')]()},'description':{'type':Sequelize[_0x3bd1('0x4')]},'interval':{'type':Sequelize[_0x3bd1('0x4')],'defaultValue':_0x3bd1('0x5')}};
\ No newline at end of file
index 0221860..edf1ff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b00=['filters','intersection','model','attributes','fields','length','include','options','find','then','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','reject','save','update','destroy','error','stack','name','show','params','keys','ChatApplication','rawAttributes','query'];(function(_0x452630,_0x1c0fc4){var _0x31ebec=function(_0x18cb48){while(--_0x18cb48){_0x452630['push'](_0x452630['shift']());}};_0x31ebec(++_0x1c0fc4);}(_0x9b00,0xcc));var _0x09b0=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x9b00[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x09b0('0x0'));var rimraf=require(_0x09b0('0x1'));var zipdir=require(_0x09b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09b0('0x3'));var moment=require(_0x09b0('0x4'));var BPromise=require(_0x09b0('0x5'));var Mustache=require(_0x09b0('0x6'));var util=require(_0x09b0('0x7'));var path=require(_0x09b0('0x8'));var sox=require(_0x09b0('0x9'));var csv=require('to-csv');var ejs=require(_0x09b0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09b0('0xb'));var squel=require(_0x09b0('0xc'));var crypto=require(_0x09b0('0xd'));var jsforce=require(_0x09b0('0xe'));var deskjs=require(_0x09b0('0xf'));var toCsv=require(_0x09b0('0x10'));var querystring=require(_0x09b0('0x11'));var Papa=require('papaparse');var Redis=require(_0x09b0('0x12'));var authService=require(_0x09b0('0x13'));var qs=require(_0x09b0('0x14'));var as=require(_0x09b0('0x15'));var hardwareService=require(_0x09b0('0x16'));var logger=require(_0x09b0('0x17'))(_0x09b0('0x18'));var utils=require(_0x09b0('0x19'));var config=require(_0x09b0('0x1a'));var licenseUtil=require(_0x09b0('0x1b'));var db=require(_0x09b0('0x1c'))['db'];function respondWithStatusCode(_0x48689b,_0x2e2ad5){_0x2e2ad5=_0x2e2ad5||0xcc;return function(_0x3a43d9){if(_0x3a43d9){return _0x48689b[_0x09b0('0x1d')](_0x2e2ad5);}return _0x48689b['status'](_0x2e2ad5)[_0x09b0('0x1e')]();};}function respondWithResult(_0xfe198a,_0x4d8830){_0x4d8830=_0x4d8830||0xc8;return function(_0x255354){if(_0x255354){return _0xfe198a['status'](_0x4d8830)[_0x09b0('0x1f')](_0x255354);}};}function respondWithFilteredResult(_0x8eb78b,_0x2b8cdf){return function(_0x223cc1){if(_0x223cc1){var _0x4c23d0=typeof _0x2b8cdf['offset']==='undefined'&&typeof _0x2b8cdf[_0x09b0('0x20')]===_0x09b0('0x21');var _0x493307=_0x223cc1[_0x09b0('0x22')];var _0x4bc35a=_0x4c23d0?0x0:_0x2b8cdf['offset'];var _0x51bc60=_0x4c23d0?_0x223cc1[_0x09b0('0x22')]:_0x2b8cdf[_0x09b0('0x23')]+_0x2b8cdf[_0x09b0('0x20')];var _0x32e8c7;if(_0x51bc60>=_0x493307){_0x51bc60=_0x493307;_0x32e8c7=0xc8;}else{_0x32e8c7=0xce;}_0x8eb78b[_0x09b0('0x24')](_0x32e8c7);return _0x8eb78b[_0x09b0('0x25')](_0x09b0('0x26'),_0x4bc35a+'-'+_0x51bc60+'/'+_0x493307)[_0x09b0('0x1f')](_0x223cc1);}return null;};}function patchUpdates(_0x4b0c2c){return function(_0x243da2){try{jsonpatch['apply'](_0x243da2,_0x4b0c2c,!![]);}catch(_0x14a922){return BPromise[_0x09b0('0x27')](_0x14a922);}return _0x243da2[_0x09b0('0x28')]();};}function saveUpdates(_0x1fd062,_0x29f169){return function(_0x4f71b3){if(_0x4f71b3){return _0x4f71b3[_0x09b0('0x29')](_0x1fd062)['then'](function(_0x560369){return _0x560369;});}return null;};}function removeEntity(_0x3276d1,_0x56b841){return function(_0x47633b){if(_0x47633b){return _0x47633b[_0x09b0('0x2a')]()['then'](function(){_0x3276d1[_0x09b0('0x24')](0xcc)[_0x09b0('0x1e')]();});}};}function handleEntityNotFound(_0x224681,_0x286998){return function(_0x1ba431){if(!_0x1ba431){_0x224681[_0x09b0('0x1d')](0x194);}return _0x1ba431;};}function handleError(_0x8c6e10,_0x13fd45){_0x13fd45=_0x13fd45||0x1f4;return function(_0x35f7cd){logger[_0x09b0('0x2b')](_0x35f7cd[_0x09b0('0x2c')]);if(_0x35f7cd[_0x09b0('0x2d')]){delete _0x35f7cd['name'];}_0x8c6e10[_0x09b0('0x24')](_0x13fd45)['send'](_0x35f7cd);};}exports[_0x09b0('0x2e')]=function(_0x4ea9fa,_0x16894b){var _0x3aecf6={'raw':!![],'where':{'id':_0x4ea9fa[_0x09b0('0x2f')]['id']}},_0x16a864={};_0x16a864['model']=_[_0x09b0('0x30')](db[_0x09b0('0x31')][_0x09b0('0x32')]);_0x16a864['query']=_[_0x09b0('0x30')](_0x4ea9fa[_0x09b0('0x33')]);_0x16a864[_0x09b0('0x34')]=_[_0x09b0('0x35')](_0x16a864[_0x09b0('0x36')],_0x16a864['query']);_0x3aecf6[_0x09b0('0x37')]=_[_0x09b0('0x35')](_0x16a864[_0x09b0('0x36')],qs[_0x09b0('0x38')](_0x4ea9fa[_0x09b0('0x33')][_0x09b0('0x38')]));_0x3aecf6[_0x09b0('0x37')]=_0x3aecf6[_0x09b0('0x37')][_0x09b0('0x39')]?_0x3aecf6[_0x09b0('0x37')]:_0x16a864[_0x09b0('0x36')];if(_0x4ea9fa[_0x09b0('0x33')]['includeAll']){_0x3aecf6[_0x09b0('0x3a')]=[{'all':!![]}];}_0x3aecf6=_['merge']({},_0x3aecf6,_0x4ea9fa[_0x09b0('0x3b')]);return db['ChatApplication'][_0x09b0('0x3c')](_0x3aecf6)[_0x09b0('0x3d')](handleEntityNotFound(_0x16894b,null))[_0x09b0('0x3d')](respondWithResult(_0x16894b,null))[_0x09b0('0x3e')](handleError(_0x16894b,null));};exports['update']=function(_0x4a0934,_0x3be7ab){if(_0x4a0934[_0x09b0('0x3f')]['id']){delete _0x4a0934[_0x09b0('0x3f')]['id'];}return db[_0x09b0('0x31')]['find']({'where':{'id':_0x4a0934[_0x09b0('0x2f')]['id']}})['then'](handleEntityNotFound(_0x3be7ab,null))['then'](saveUpdates(_0x4a0934[_0x09b0('0x3f')],null))[_0x09b0('0x3d')](respondWithResult(_0x3be7ab,null))[_0x09b0('0x3e')](handleError(_0x3be7ab,null));};exports[_0x09b0('0x2a')]=function(_0x6d5576,_0x2bccc4){return db[_0x09b0('0x31')]['find']({'where':{'id':_0x6d5576[_0x09b0('0x2f')]['id']}})[_0x09b0('0x3d')](handleEntityNotFound(_0x2bccc4,null))[_0x09b0('0x3d')](removeEntity(_0x2bccc4,null))['catch'](handleError(_0x2bccc4,null));};
\ No newline at end of file
+var _0xeea4=['../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','keys','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','options','find','then','catch','body','ChatApplication','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xeea4,0x19e));var _0x4eea=function(_0x34bea7,_0x36c7f7){_0x34bea7=_0x34bea7-0x0;var _0x33cf81=_0xeea4[_0x34bea7];return _0x33cf81;};'use strict';var emlformat=require(_0x4eea('0x0'));var rimraf=require(_0x4eea('0x1'));var zipdir=require(_0x4eea('0x2'));var jsonpatch=require(_0x4eea('0x3'));var rp=require(_0x4eea('0x4'));var moment=require(_0x4eea('0x5'));var BPromise=require(_0x4eea('0x6'));var Mustache=require(_0x4eea('0x7'));var util=require(_0x4eea('0x8'));var path=require('path');var sox=require(_0x4eea('0x9'));var csv=require('to-csv');var ejs=require(_0x4eea('0xa'));var fs=require('fs');var fs_extra=require(_0x4eea('0xb'));var _=require(_0x4eea('0xc'));var squel=require('squel');var crypto=require(_0x4eea('0xd'));var jsforce=require(_0x4eea('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4eea('0xf'));var querystring=require(_0x4eea('0x10'));var Papa=require(_0x4eea('0x11'));var Redis=require(_0x4eea('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4eea('0x13'));var as=require(_0x4eea('0x14'));var hardwareService=require(_0x4eea('0x15'));var logger=require(_0x4eea('0x16'))(_0x4eea('0x17'));var utils=require(_0x4eea('0x18'));var config=require(_0x4eea('0x19'));var licenseUtil=require(_0x4eea('0x1a'));var db=require(_0x4eea('0x1b'))['db'];function respondWithStatusCode(_0x130507,_0x47b971){_0x47b971=_0x47b971||0xcc;return function(_0x54fa8c){if(_0x54fa8c){return _0x130507[_0x4eea('0x1c')](_0x47b971);}return _0x130507[_0x4eea('0x1d')](_0x47b971)[_0x4eea('0x1e')]();};}function respondWithResult(_0x238405,_0x3327e0){_0x3327e0=_0x3327e0||0xc8;return function(_0x328275){if(_0x328275){return _0x238405[_0x4eea('0x1d')](_0x3327e0)[_0x4eea('0x1f')](_0x328275);}};}function respondWithFilteredResult(_0x5828e0,_0x1654c0){return function(_0x34ce09){if(_0x34ce09){var _0x150d60=typeof _0x1654c0[_0x4eea('0x20')]==='undefined'&&typeof _0x1654c0[_0x4eea('0x21')]===_0x4eea('0x22');var _0x3fbe8b=_0x34ce09[_0x4eea('0x23')];var _0x27a227=_0x150d60?0x0:_0x1654c0['offset'];var _0x1571f3=_0x150d60?_0x34ce09[_0x4eea('0x23')]:_0x1654c0['offset']+_0x1654c0[_0x4eea('0x21')];var _0x325185;if(_0x1571f3>=_0x3fbe8b){_0x1571f3=_0x3fbe8b;_0x325185=0xc8;}else{_0x325185=0xce;}_0x5828e0[_0x4eea('0x1d')](_0x325185);return _0x5828e0[_0x4eea('0x24')](_0x4eea('0x25'),_0x27a227+'-'+_0x1571f3+'/'+_0x3fbe8b)[_0x4eea('0x1f')](_0x34ce09);}return null;};}function patchUpdates(_0x56fefc){return function(_0xf054a7){try{jsonpatch[_0x4eea('0x26')](_0xf054a7,_0x56fefc,!![]);}catch(_0x24f371){return BPromise[_0x4eea('0x27')](_0x24f371);}return _0xf054a7[_0x4eea('0x28')]();};}function saveUpdates(_0x496ab6,_0x4898e8){return function(_0x3b7513){if(_0x3b7513){return _0x3b7513['update'](_0x496ab6)['then'](function(_0x5a2722){return _0x5a2722;});}return null;};}function removeEntity(_0x37f024,_0x3be3f3){return function(_0x505e50){if(_0x505e50){return _0x505e50[_0x4eea('0x29')]()['then'](function(){_0x37f024[_0x4eea('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x111e65,_0x5a1ec7){return function(_0x1e8f29){if(!_0x1e8f29){_0x111e65[_0x4eea('0x1c')](0x194);}return _0x1e8f29;};}function handleError(_0x22f706,_0x430a46){_0x430a46=_0x430a46||0x1f4;return function(_0xd09e64){logger[_0x4eea('0x2a')](_0xd09e64[_0x4eea('0x2b')]);if(_0xd09e64[_0x4eea('0x2c')]){delete _0xd09e64[_0x4eea('0x2c')];}_0x22f706[_0x4eea('0x1d')](_0x430a46)[_0x4eea('0x2d')](_0xd09e64);};}exports['show']=function(_0x58c0df,_0x3e602c){var _0x3eeb41={'raw':!![],'where':{'id':_0x58c0df['params']['id']}},_0x591b2f={};_0x591b2f['model']=_[_0x4eea('0x2e')](db['ChatApplication'][_0x4eea('0x2f')]);_0x591b2f[_0x4eea('0x30')]=_[_0x4eea('0x2e')](_0x58c0df['query']);_0x591b2f[_0x4eea('0x31')]=_[_0x4eea('0x32')](_0x591b2f[_0x4eea('0x33')],_0x591b2f['query']);_0x3eeb41[_0x4eea('0x34')]=_[_0x4eea('0x32')](_0x591b2f[_0x4eea('0x33')],qs['fields'](_0x58c0df['query'][_0x4eea('0x35')]));_0x3eeb41[_0x4eea('0x34')]=_0x3eeb41['attributes'][_0x4eea('0x36')]?_0x3eeb41[_0x4eea('0x34')]:_0x591b2f[_0x4eea('0x33')];if(_0x58c0df[_0x4eea('0x30')]['includeAll']){_0x3eeb41[_0x4eea('0x37')]=[{'all':!![]}];}_0x3eeb41=_['merge']({},_0x3eeb41,_0x58c0df[_0x4eea('0x38')]);return db['ChatApplication'][_0x4eea('0x39')](_0x3eeb41)[_0x4eea('0x3a')](handleEntityNotFound(_0x3e602c,null))['then'](respondWithResult(_0x3e602c,null))[_0x4eea('0x3b')](handleError(_0x3e602c,null));};exports['update']=function(_0x1df208,_0x2e7b37){if(_0x1df208['body']['id']){delete _0x1df208[_0x4eea('0x3c')]['id'];}return db[_0x4eea('0x3d')][_0x4eea('0x39')]({'where':{'id':_0x1df208['params']['id']}})[_0x4eea('0x3a')](handleEntityNotFound(_0x2e7b37,null))['then'](saveUpdates(_0x1df208['body'],null))[_0x4eea('0x3a')](respondWithResult(_0x2e7b37,null))[_0x4eea('0x3b')](handleError(_0x2e7b37,null));};exports[_0x4eea('0x29')]=function(_0x4c8dd2,_0x57e9b6){return db[_0x4eea('0x3d')][_0x4eea('0x39')]({'where':{'id':_0x4c8dd2[_0x4eea('0x3e')]['id']}})[_0x4eea('0x3a')](handleEntityNotFound(_0x57e9b6,null))[_0x4eea('0x3a')](removeEntity(_0x57e9b6,null))['catch'](handleError(_0x57e9b6,null));};
\ No newline at end of file
index 9b59102..5105a8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9f7=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','lodash','../../config/logger'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0xb9f7,0x1df));var _0x7b9f=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xb9f7[_0x119705];return _0x2affc2;};'use strict';var _=require(_0x7b9f('0x0'));var util=require('util');var logger=require(_0x7b9f('0x1'))(_0x7b9f('0x2'));var moment=require('moment');var BPromise=require(_0x7b9f('0x3'));var rp=require(_0x7b9f('0x4'));var fs=require('fs');var path=require(_0x7b9f('0x5'));var rimraf=require(_0x7b9f('0x6'));var config=require(_0x7b9f('0x7'));var attributes=require(_0x7b9f('0x8'));module[_0x7b9f('0x9')]=function(_0x52b46d,_0x215cb3){return _0x52b46d[_0x7b9f('0xa')](_0x7b9f('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b9f('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xdb90=['../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x2ca94e,_0xd97864){var _0x1c6718=function(_0x44c561){while(--_0x44c561){_0x2ca94e['push'](_0x2ca94e['shift']());}};_0x1c6718(++_0xd97864);}(_0xdb90,0xcb));var _0x0db9=function(_0xc889e1,_0x438415){_0xc889e1=_0xc889e1-0x0;var _0x17ab9e=_0xdb90[_0xc889e1];return _0x17ab9e;};'use strict';var _=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var logger=require('../../config/logger')(_0x0db9('0x2'));var moment=require(_0x0db9('0x3'));var BPromise=require('bluebird');var rp=require(_0x0db9('0x4'));var fs=require('fs');var path=require(_0x0db9('0x5'));var rimraf=require(_0x0db9('0x6'));var config=require(_0x0db9('0x7'));var attributes=require(_0x0db9('0x8'));module[_0x0db9('0x9')]=function(_0x227647,_0x513a01){return _0x227647[_0x0db9('0xa')](_0x0db9('0xb'),attributes,{'tableName':_0x0db9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0db9('0xd'),'collate':_0x0db9('0xe')});};
\ No newline at end of file
index 5a395d4..da4eda1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bb2=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2b69ac,_0x4f94f4){var _0x421f95=function(_0xfdf883){while(--_0xfdf883){_0x2b69ac['push'](_0x2b69ac['shift']());}};_0x421f95(++_0x4f94f4);}(_0x9bb2,0x12b));var _0x29bb=function(_0x252875,_0x3d4d96){_0x252875=_0x252875-0x0;var _0x426a5d=_0x9bb2[_0x252875];return _0x426a5d;};'use strict';var _=require(_0x29bb('0x0'));var util=require(_0x29bb('0x1'));var moment=require('moment');var BPromise=require(_0x29bb('0x2'));var rs=require(_0x29bb('0x3'));var fs=require('fs');var Redis=require(_0x29bb('0x4'));var db=require(_0x29bb('0x5'))['db'];var utils=require(_0x29bb('0x6'));var logger=require('../../config/logger')(_0x29bb('0x7'));var config=require(_0x29bb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x29bb('0x9')][_0x29bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c68fd,_0x330dcf,_0x896344){return new BPromise(function(_0x1e98e2,_0x40ef0d){return client[_0x29bb('0xb')](_0x1c68fd,_0x896344)[_0x29bb('0xc')](function(_0xb06c0d){logger[_0x29bb('0xd')](_0x29bb('0xe'),_0x330dcf,'request\x20sent');logger[_0x29bb('0xf')](_0x29bb('0x10'),_0x330dcf,_0x29bb('0x11'),JSON[_0x29bb('0x12')](_0xb06c0d));if(_0xb06c0d['error']){if(_0xb06c0d[_0x29bb('0x13')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x330dcf,_0xb06c0d[_0x29bb('0x13')][_0x29bb('0x14')]);return _0x40ef0d(_0xb06c0d[_0x29bb('0x13')][_0x29bb('0x14')]);}logger[_0x29bb('0x13')](_0x29bb('0xe'),_0x330dcf,_0xb06c0d[_0x29bb('0x13')]['message']);return _0x1e98e2(_0xb06c0d[_0x29bb('0x13')][_0x29bb('0x14')]);}else{logger['info'](_0x29bb('0xe'),_0x330dcf,'request\x20sent');_0x1e98e2(_0xb06c0d['result'][_0x29bb('0x14')]);}})[_0x29bb('0x15')](function(_0x74ecf2){logger[_0x29bb('0x13')](_0x29bb('0xe'),_0x330dcf,_0x74ecf2);_0x40ef0d(_0x74ecf2);});});}
\ No newline at end of file
+var _0xd6f8=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x11aee6,_0x18af38){var _0x5094cd=function(_0x4d70fe){while(--_0x4d70fe){_0x11aee6['push'](_0x11aee6['shift']());}};_0x5094cd(++_0x18af38);}(_0xd6f8,0x1e4));var _0x8d6f=function(_0x1966f3,_0x210ea3){_0x1966f3=_0x1966f3-0x0;var _0x17575f=_0xd6f8[_0x1966f3];return _0x17575f;};'use strict';var _=require(_0x8d6f('0x0'));var util=require(_0x8d6f('0x1'));var moment=require(_0x8d6f('0x2'));var BPromise=require(_0x8d6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d6f('0x4'));var db=require(_0x8d6f('0x5'))['db'];var utils=require(_0x8d6f('0x6'));var logger=require(_0x8d6f('0x7'))(_0x8d6f('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d6f('0x9'));var client=jayson[_0x8d6f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x738815,_0x459349,_0x383b05){return new BPromise(function(_0x6608f,_0xa86649){return client[_0x8d6f('0xb')](_0x738815,_0x383b05)[_0x8d6f('0xc')](function(_0x238a42){logger[_0x8d6f('0xd')](_0x8d6f('0xe'),_0x459349,_0x8d6f('0xf'));logger[_0x8d6f('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x459349,_0x8d6f('0xf'),JSON['stringify'](_0x238a42));if(_0x238a42[_0x8d6f('0x11')]){if(_0x238a42[_0x8d6f('0x11')][_0x8d6f('0x12')]===0x1f4){logger[_0x8d6f('0x11')](_0x8d6f('0xe'),_0x459349,_0x238a42[_0x8d6f('0x11')][_0x8d6f('0x13')]);return _0xa86649(_0x238a42['error'][_0x8d6f('0x13')]);}logger['error'](_0x8d6f('0xe'),_0x459349,_0x238a42[_0x8d6f('0x11')]['message']);return _0x6608f(_0x238a42[_0x8d6f('0x11')]['message']);}else{logger[_0x8d6f('0xd')](_0x8d6f('0xe'),_0x459349,_0x8d6f('0xf'));_0x6608f(_0x238a42[_0x8d6f('0x14')]['message']);}})['catch'](function(_0x507b82){logger[_0x8d6f('0x11')](_0x8d6f('0xe'),_0x459349,_0x507b82);_0xa86649(_0x507b82);});});}
\ No newline at end of file
index cccb96f..9120d0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb47=['show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xfb47,0x135));var _0x7fb4=function(_0x5402e3,_0x2643c7){_0x5402e3=_0x5402e3-0x0;var _0x2fe81f=_0xfb47[_0x5402e3];return _0x2fe81f;};'use strict';var multer=require(_0x7fb4('0x0'));var util=require(_0x7fb4('0x1'));var path=require(_0x7fb4('0x2'));var timeout=require(_0x7fb4('0x3'));var express=require(_0x7fb4('0x4'));var router=express[_0x7fb4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7fb4('0x6'));var interaction=require(_0x7fb4('0x7'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x7fb4('0x8')](_0x7fb4('0x9'),auth[_0x7fb4('0xa')](),controller[_0x7fb4('0xb')]);router[_0x7fb4('0xc')](_0x7fb4('0x9'),auth[_0x7fb4('0xa')](),controller[_0x7fb4('0xd')]);router[_0x7fb4('0xe')]('/:id',auth[_0x7fb4('0xa')](),controller[_0x7fb4('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x74be=['isAuthenticated','show','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74be,0x67));var _0xe74b=function(_0x548b6,_0x5e84a4){_0x548b6=_0x548b6-0x0;var _0x169764=_0x74be[_0x548b6];return _0x169764;};'use strict';var multer=require('multer');var util=require(_0xe74b('0x0'));var path=require(_0xe74b('0x1'));var timeout=require('connect-timeout');var express=require(_0xe74b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe74b('0x3'));var interaction=require(_0xe74b('0x4'));var config=require(_0xe74b('0x5'));var controller=require(_0xe74b('0x6'));router[_0xe74b('0x7')](_0xe74b('0x8'),auth[_0xe74b('0x9')](),controller[_0xe74b('0xa')]);router[_0xe74b('0xb')](_0xe74b('0x8'),auth['isAuthenticated'](),controller[_0xe74b('0xc')]);router[_0xe74b('0xd')](_0xe74b('0x8'),auth[_0xe74b('0x9')](),controller[_0xe74b('0xe')]);module[_0xe74b('0xf')]=router;
\ No newline at end of file
index d07f895..0ab73e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9536=['exports','STRING','sequelize'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x9536,0x179));var _0x6953=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0x9536[_0x212bf5];return _0xfcad21;};'use strict';var Sequelize=require(_0x6953('0x0'));module[_0x6953('0x1')]={'name':{'type':Sequelize[_0x6953('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6953('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xba6e=['sequelize','exports','STRING'];(function(_0x2433e3,_0x28ac1e){var _0x3e5feb=function(_0x47f203){while(--_0x47f203){_0x2433e3['push'](_0x2433e3['shift']());}};_0x3e5feb(++_0x28ac1e);}(_0xba6e,0x168));var _0xeba6=function(_0x3b1252,_0x43691c){_0x3b1252=_0x3b1252-0x0;var _0x1af329=_0xba6e[_0x3b1252];return _0x1af329;};'use strict';var Sequelize=require(_0xeba6('0x0'));module[_0xeba6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xeba6('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index f51b163..cf53e00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b38=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','keys','filters','model','query','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','fields','include','find','create','body','update','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','sort','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir'];(function(_0x3a5c8a,_0x1b6464){var _0x7b7582=function(_0x89d6){while(--_0x89d6){_0x3a5c8a['push'](_0x3a5c8a['shift']());}};_0x7b7582(++_0x1b6464);}(_0x6b38,0xc6));var _0x86b3=function(_0x1941ee,_0x322665){_0x1941ee=_0x1941ee-0x0;var _0x90e30b=_0x6b38[_0x1941ee];return _0x90e30b;};'use strict';var emlformat=require(_0x86b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86b3('0x1'));var jsonpatch=require(_0x86b3('0x2'));var rp=require(_0x86b3('0x3'));var moment=require(_0x86b3('0x4'));var BPromise=require(_0x86b3('0x5'));var Mustache=require(_0x86b3('0x6'));var util=require(_0x86b3('0x7'));var path=require(_0x86b3('0x8'));var sox=require(_0x86b3('0x9'));var csv=require(_0x86b3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86b3('0xb'));var squel=require(_0x86b3('0xc'));var crypto=require('crypto');var jsforce=require(_0x86b3('0xd'));var deskjs=require(_0x86b3('0xe'));var toCsv=require(_0x86b3('0xa'));var querystring=require(_0x86b3('0xf'));var Papa=require(_0x86b3('0x10'));var Redis=require(_0x86b3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x86b3('0x12'));var as=require(_0x86b3('0x13'));var hardwareService=require(_0x86b3('0x14'));var logger=require(_0x86b3('0x15'))(_0x86b3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x86b3('0x17'));var db=require('../../mysqldb')['db'];config[_0x86b3('0x18')]=_[_0x86b3('0x19')](config[_0x86b3('0x18')],{'host':_0x86b3('0x1a'),'port':0x18eb});var socket=require(_0x86b3('0x1b'))(new Redis(config[_0x86b3('0x18')]));require(_0x86b3('0x1c'))[_0x86b3('0x1d')](socket);function respondWithStatusCode(_0x5d88a4,_0xc8cf43){_0xc8cf43=_0xc8cf43||0xcc;return function(_0xc14a1f){if(_0xc14a1f){return _0x5d88a4[_0x86b3('0x1e')](_0xc8cf43);}return _0x5d88a4[_0x86b3('0x1f')](_0xc8cf43)[_0x86b3('0x20')]();};}function respondWithResult(_0x5eb517,_0x283aa7){_0x283aa7=_0x283aa7||0xc8;return function(_0x3b28e0){if(_0x3b28e0){return _0x5eb517[_0x86b3('0x1f')](_0x283aa7)[_0x86b3('0x21')](_0x3b28e0);}};}function respondWithFilteredResult(_0x1a080e,_0x1d298d){return function(_0x1d9479){if(_0x1d9479){var _0x126dbe=typeof _0x1d298d[_0x86b3('0x22')]===_0x86b3('0x23')&&typeof _0x1d298d['limit']===_0x86b3('0x23');var _0x51b322=_0x1d9479['count'];var _0x323245=_0x126dbe?0x0:_0x1d298d[_0x86b3('0x22')];var _0x3cadd0=_0x126dbe?_0x1d9479[_0x86b3('0x24')]:_0x1d298d[_0x86b3('0x22')]+_0x1d298d[_0x86b3('0x25')];var _0x12a0c3;if(_0x3cadd0>=_0x51b322){_0x3cadd0=_0x51b322;_0x12a0c3=0xc8;}else{_0x12a0c3=0xce;}_0x1a080e[_0x86b3('0x1f')](_0x12a0c3);return _0x1a080e['set']('Content-Range',_0x323245+'-'+_0x3cadd0+'/'+_0x51b322)[_0x86b3('0x21')](_0x1d9479);}return null;};}function patchUpdates(_0x249d7d){return function(_0x53d570){try{jsonpatch[_0x86b3('0x26')](_0x53d570,_0x249d7d,!![]);}catch(_0x24e0a9){return BPromise[_0x86b3('0x27')](_0x24e0a9);}return _0x53d570[_0x86b3('0x28')]();};}function saveUpdates(_0x4c0f80,_0x5ae87e){return function(_0xce5950){if(_0xce5950){return _0xce5950['update'](_0x4c0f80)[_0x86b3('0x29')](function(_0x140ff1){return _0x140ff1;});}return null;};}function removeEntity(_0x5b934c,_0x4ea9f4){return function(_0x2e579c){if(_0x2e579c){return _0x2e579c['destroy']()['then'](function(){_0x5b934c['status'](0xcc)[_0x86b3('0x20')]();});}};}function handleEntityNotFound(_0x3b3372,_0x3b1a15){return function(_0x172b1e){if(!_0x172b1e){_0x3b3372[_0x86b3('0x1e')](0x194);}return _0x172b1e;};}function handleError(_0x2054e8,_0x5d17ba){_0x5d17ba=_0x5d17ba||0x1f4;return function(_0x3d289){logger[_0x86b3('0x2a')](_0x3d289[_0x86b3('0x2b')]);if(_0x3d289[_0x86b3('0x2c')]){delete _0x3d289[_0x86b3('0x2c')];}_0x2054e8[_0x86b3('0x1f')](_0x5d17ba)[_0x86b3('0x2d')](_0x3d289);};}exports[_0x86b3('0x2e')]=function(_0x5adde2,_0x42a1ea){var _0x158817={},_0x1e1274={},_0x1bb7bf={'count':0x0,'rows':[]};var _0x5ed3d9=_[_0x86b3('0x2f')](db[_0x86b3('0x30')][_0x86b3('0x31')],function(_0x46ffcb){return{'name':_0x46ffcb[_0x86b3('0x32')],'type':_0x46ffcb[_0x86b3('0x33')]['key']};});_0x1e1274['model']=_[_0x86b3('0x2f')](_0x5ed3d9,_0x86b3('0x2c'));_0x1e1274['query']=_[_0x86b3('0x34')](_0x5adde2['query']);_0x1e1274[_0x86b3('0x35')]=_['intersection'](_0x1e1274[_0x86b3('0x36')],_0x1e1274[_0x86b3('0x37')]);_0x158817[_0x86b3('0x38')]=_['intersection'](_0x1e1274[_0x86b3('0x36')],qs['fields'](_0x5adde2['query']['fields']));_0x158817[_0x86b3('0x38')]=_0x158817['attributes'][_0x86b3('0x39')]?_0x158817[_0x86b3('0x38')]:_0x1e1274[_0x86b3('0x36')];if(!_0x5adde2[_0x86b3('0x37')][_0x86b3('0x3a')]('nolimit')){_0x158817['limit']=qs[_0x86b3('0x25')](_0x5adde2['query']['limit']);_0x158817[_0x86b3('0x22')]=qs[_0x86b3('0x22')](_0x5adde2['query'][_0x86b3('0x22')]);}_0x158817[_0x86b3('0x3b')]=qs['sort'](_0x5adde2[_0x86b3('0x37')]['sort']);_0x158817[_0x86b3('0x3c')]=qs[_0x86b3('0x35')](_[_0x86b3('0x3d')](_0x5adde2[_0x86b3('0x37')],_0x1e1274[_0x86b3('0x35')]),_0x5ed3d9);if(_0x5adde2[_0x86b3('0x37')][_0x86b3('0x3e')]){_0x158817[_0x86b3('0x3c')]=_[_0x86b3('0x3f')](_0x158817[_0x86b3('0x3c')],{'$or':_[_0x86b3('0x2f')](_0x5ed3d9,function(_0x2efcb3){if(_0x2efcb3[_0x86b3('0x33')]!==_0x86b3('0x40')){var _0x3ea35f={};_0x3ea35f[_0x2efcb3[_0x86b3('0x2c')]]={'$like':'%'+_0x5adde2[_0x86b3('0x37')]['filter']+'%'};return _0x3ea35f;}})});}_0x158817=_[_0x86b3('0x3f')]({},_0x158817,_0x5adde2[_0x86b3('0x41')]);var _0x482346={'where':_0x158817[_0x86b3('0x3c')]};return db[_0x86b3('0x30')][_0x86b3('0x24')](_0x482346)[_0x86b3('0x29')](function(_0x380336){_0x1bb7bf['count']=_0x380336;if(_0x5adde2[_0x86b3('0x37')][_0x86b3('0x42')]){_0x158817['include']=[{'all':!![]}];}return db[_0x86b3('0x30')][_0x86b3('0x43')](_0x158817);})[_0x86b3('0x29')](function(_0x4ae299){_0x1bb7bf[_0x86b3('0x44')]=_0x4ae299;return _0x1bb7bf;})[_0x86b3('0x29')](respondWithFilteredResult(_0x42a1ea,_0x158817))[_0x86b3('0x45')](handleError(_0x42a1ea,null));};exports[_0x86b3('0x46')]=function(_0x4d823d,_0x119ade){var _0xc8f7c9={'raw':!![],'where':{'id':_0x4d823d[_0x86b3('0x47')]['id']}},_0x4e2b24={};_0x4e2b24['model']=_[_0x86b3('0x34')](db[_0x86b3('0x30')][_0x86b3('0x31')]);_0x4e2b24[_0x86b3('0x37')]=_['keys'](_0x4d823d[_0x86b3('0x37')]);_0x4e2b24[_0x86b3('0x35')]=_[_0x86b3('0x48')](_0x4e2b24[_0x86b3('0x36')],_0x4e2b24['query']);_0xc8f7c9['attributes']=_[_0x86b3('0x48')](_0x4e2b24['model'],qs[_0x86b3('0x49')](_0x4d823d['query'][_0x86b3('0x49')]));_0xc8f7c9[_0x86b3('0x38')]=_0xc8f7c9[_0x86b3('0x38')]['length']?_0xc8f7c9['attributes']:_0x4e2b24['model'];if(_0x4d823d[_0x86b3('0x37')][_0x86b3('0x42')]){_0xc8f7c9[_0x86b3('0x4a')]=[{'all':!![]}];}_0xc8f7c9=_[_0x86b3('0x3f')]({},_0xc8f7c9,_0x4d823d[_0x86b3('0x41')]);return db[_0x86b3('0x30')][_0x86b3('0x4b')](_0xc8f7c9)[_0x86b3('0x29')](handleEntityNotFound(_0x119ade,null))['then'](respondWithResult(_0x119ade,null))['catch'](handleError(_0x119ade,null));};exports['create']=function(_0x3081d6,_0x568e31){return db[_0x86b3('0x30')][_0x86b3('0x4c')](_0x3081d6[_0x86b3('0x4d')],{})[_0x86b3('0x29')](respondWithResult(_0x568e31,0xc9))[_0x86b3('0x45')](handleError(_0x568e31,null));};exports[_0x86b3('0x4e')]=function(_0x46ff3c,_0x1fdedc){if(_0x46ff3c[_0x86b3('0x4d')]['id']){delete _0x46ff3c[_0x86b3('0x4d')]['id'];}return db[_0x86b3('0x30')][_0x86b3('0x4b')]({'where':{'id':_0x46ff3c[_0x86b3('0x47')]['id']}})[_0x86b3('0x29')](handleEntityNotFound(_0x1fdedc,null))[_0x86b3('0x29')](saveUpdates(_0x46ff3c[_0x86b3('0x4d')],null))['then'](respondWithResult(_0x1fdedc,null))[_0x86b3('0x45')](handleError(_0x1fdedc,null));};exports[_0x86b3('0x4f')]=function(_0x1fa6ae,_0x3dddc5){return db['ChatGroup'][_0x86b3('0x4b')]({'where':{'id':_0x1fa6ae[_0x86b3('0x47')]['id']}})[_0x86b3('0x29')](handleEntityNotFound(_0x3dddc5,null))['then'](removeEntity(_0x3dddc5,null))[_0x86b3('0x45')](handleError(_0x3dddc5,null));};exports[_0x86b3('0x50')]=function(_0x18956e,_0x1b4c53){return db[_0x86b3('0x30')][_0x86b3('0x50')]()[_0x86b3('0x29')](respondWithResult(_0x1b4c53,null))[_0x86b3('0x45')](handleError(_0x1b4c53,null));};exports[_0x86b3('0x51')]=function(_0xd34a27,_0x1dfd35,_0x47a5fc){return db[_0x86b3('0x52')][_0x86b3('0x24')]({'where':{'ChatGroupId':_0xd34a27[_0x86b3('0x47')]['id'],'ToId':_0xd34a27[_0x86b3('0x53')]['id'],'read':![]}})[_0x86b3('0x29')](function(_0x50c88a){return{'id':_[_0x86b3('0x54')](_0xd34a27[_0x86b3('0x47')]['id']),'count':_0x50c88a};})['then'](respondWithResult(_0x1dfd35,null))[_0x86b3('0x45')](handleError(_0x1dfd35,null));};exports['addMembers']=function(_0x277e32,_0x4ad543,_0x577f3c){return db[_0x86b3('0x30')][_0x86b3('0x4b')]({'where':{'id':_0x277e32[_0x86b3('0x47')]['id']}})[_0x86b3('0x29')](handleEntityNotFound(_0x4ad543,null))[_0x86b3('0x29')](function(_0x42e5ee){if(_0x42e5ee){return _0x42e5ee[_0x86b3('0x55')](_0x277e32[_0x86b3('0x4d')][_0x86b3('0x56')],_[_0x86b3('0x57')](_0x277e32[_0x86b3('0x4d')],[_0x86b3('0x56'),'id'])||{});}})[_0x86b3('0x29')](respondWithResult(_0x4ad543,null))[_0x86b3('0x45')](handleError(_0x4ad543,null));};exports[_0x86b3('0x58')]=function(_0x138147,_0x274f00,_0x1d1b8b){var _0x1def00={};var _0xa466b={};var _0x20b430;var _0x2a6318;return db['ChatGroup'][_0x86b3('0x59')]({'where':{'id':_0x138147[_0x86b3('0x47')]['id']}})['then'](handleEntityNotFound(_0x274f00,null))[_0x86b3('0x29')](function(_0x4319b8){if(_0x4319b8){_0x20b430=_0x4319b8;_0xa466b[_0x86b3('0x36')]=_['keys'](db[_0x86b3('0x5a')]['rawAttributes']);_0xa466b[_0x86b3('0x37')]=_[_0x86b3('0x34')](_0x138147['query']);_0xa466b['filters']=_['intersection'](_0xa466b[_0x86b3('0x36')],_0xa466b['query']);_0x1def00['attributes']=_[_0x86b3('0x48')](_0xa466b[_0x86b3('0x36')],qs[_0x86b3('0x49')](_0x138147['query']['fields']));_0x1def00[_0x86b3('0x38')]=_0x1def00[_0x86b3('0x38')][_0x86b3('0x39')]?_0x1def00[_0x86b3('0x38')]:_0xa466b[_0x86b3('0x36')];_0x1def00[_0x86b3('0x3b')]=qs[_0x86b3('0x5b')](_0x138147['query'][_0x86b3('0x5b')]);_0x1def00[_0x86b3('0x3c')]=qs[_0x86b3('0x35')](_[_0x86b3('0x3d')](_0x138147['query'],_0xa466b[_0x86b3('0x35')]));if(_0x138147[_0x86b3('0x37')]['filter']){_0x1def00[_0x86b3('0x3c')]=_['merge'](_0x1def00[_0x86b3('0x3c')],{'$or':_['map'](_0x1def00[_0x86b3('0x38')],function(_0x5cd582){var _0xb79fd2={};_0xb79fd2[_0x5cd582]={'$like':'%'+_0x138147[_0x86b3('0x37')][_0x86b3('0x3e')]+'%'};return _0xb79fd2;})});}_0x1def00=_['merge']({},_0x1def00,_0x138147[_0x86b3('0x41')]);return _0x20b430[_0x86b3('0x58')](_0x1def00);}})[_0x86b3('0x29')](function(_0x28fe97){if(_0x28fe97){_0x2a6318=_0x28fe97[_0x86b3('0x39')];if(!_0x138147['query'][_0x86b3('0x3a')](_0x86b3('0x5c'))){_0x1def00[_0x86b3('0x25')]=qs['limit'](_0x138147[_0x86b3('0x37')][_0x86b3('0x25')]);_0x1def00['offset']=qs['offset'](_0x138147[_0x86b3('0x37')][_0x86b3('0x22')]);}return _0x20b430[_0x86b3('0x58')](_0x1def00);}})['then'](function(_0x432868){if(_0x432868){return _0x432868?{'count':_0x2a6318,'rows':_0x432868}:null;}})[_0x86b3('0x29')](respondWithResult(_0x274f00,null))['catch'](handleError(_0x274f00,null));};exports['removeMembers']=function(_0x233e5f,_0xc68493,_0x2738f0){return db['ChatGroup']['find']({'where':{'id':_0x233e5f[_0x86b3('0x47')]['id']}})['then'](handleEntityNotFound(_0xc68493,null))[_0x86b3('0x29')](function(_0x4c6e25){if(_0x4c6e25){return _0x4c6e25[_0x86b3('0x5d')](_0x233e5f['query'][_0x86b3('0x56')]);}})[_0x86b3('0x29')](respondWithStatusCode(_0xc68493,null))[_0x86b3('0x45')](handleError(_0xc68493,null));};exports[_0x86b3('0x5e')]=function(_0x1f4091,_0x15d762,_0x5d7730){if(_0x1f4091['body']['id']){delete _0x1f4091[_0x86b3('0x4d')]['id'];}return db[_0x86b3('0x30')][_0x86b3('0x4b')]({'where':{'id':_0x1f4091[_0x86b3('0x47')]['id']}})['then'](handleEntityNotFound(_0x15d762,null))[_0x86b3('0x29')](function(_0x412c17){if(_0x412c17){_0x1f4091['body'][_0x86b3('0x5f')]=_0x412c17['id'];return db['ChatInternalMessage']['create'](_0x1f4091['body']);}})[_0x86b3('0x29')](respondWithResult(_0x15d762,null))[_0x86b3('0x45')](handleError(_0x15d762,null));};exports[_0x86b3('0x60')]=function(_0x62c383,_0x42da31,_0x13ed18){var _0x5745a0={};var _0x7a7daa={};var _0x31c1b5;var _0x5b4b85;return db['ChatGroup'][_0x86b3('0x59')]({'where':{'id':_0x62c383['params']['id']}})['then'](handleEntityNotFound(_0x42da31,null))[_0x86b3('0x29')](function(_0x8c25d6){if(_0x8c25d6){_0x31c1b5=_0x8c25d6;_0x7a7daa[_0x86b3('0x36')]=_[_0x86b3('0x34')](db[_0x86b3('0x52')][_0x86b3('0x31')]);_0x7a7daa[_0x86b3('0x37')]=_[_0x86b3('0x34')](_0x62c383[_0x86b3('0x37')]);_0x7a7daa[_0x86b3('0x35')]=_[_0x86b3('0x48')](_0x7a7daa[_0x86b3('0x36')],_0x7a7daa[_0x86b3('0x37')]);_0x5745a0[_0x86b3('0x38')]=_[_0x86b3('0x48')](_0x7a7daa[_0x86b3('0x36')],qs[_0x86b3('0x49')](_0x62c383[_0x86b3('0x37')][_0x86b3('0x49')]));_0x5745a0[_0x86b3('0x38')]=_0x5745a0[_0x86b3('0x38')][_0x86b3('0x39')]?_0x5745a0[_0x86b3('0x38')]:_0x7a7daa[_0x86b3('0x36')];_0x5745a0['order']=qs[_0x86b3('0x5b')](_0x62c383[_0x86b3('0x37')][_0x86b3('0x5b')]);_0x5745a0[_0x86b3('0x3c')]=qs[_0x86b3('0x35')](_[_0x86b3('0x3d')](_0x62c383[_0x86b3('0x37')],_0x7a7daa[_0x86b3('0x35')]));if(_0x62c383[_0x86b3('0x37')][_0x86b3('0x3e')]){_0x5745a0[_0x86b3('0x3c')]=_[_0x86b3('0x3f')](_0x5745a0[_0x86b3('0x3c')],{'$or':_['map'](_0x5745a0[_0x86b3('0x38')],function(_0x545083){var _0x26baf8={};_0x26baf8[_0x545083]={'$like':'%'+_0x62c383[_0x86b3('0x37')][_0x86b3('0x3e')]+'%'};return _0x26baf8;})});}if(_0x62c383[_0x86b3('0x37')]['$gte']){var _0x866703=_0x62c383[_0x86b3('0x37')][_0x86b3('0x61')]['split'](',');var _0x4098e4={};_0x4098e4[_0x866703[0x0]]={'$gte':moment(_0x866703[0x1])[_0x86b3('0x62')](_0x86b3('0x63'))};_0x5745a0[_0x86b3('0x3c')]=_[_0x86b3('0x3f')](_0x5745a0['where'],_0x4098e4);}_0x5745a0=_[_0x86b3('0x3f')]({},_0x5745a0,_0x62c383[_0x86b3('0x41')]);return _0x31c1b5[_0x86b3('0x60')](_0x5745a0);}})[_0x86b3('0x29')](function(_0x45e58c){if(_0x45e58c){_0x5b4b85=_0x45e58c[_0x86b3('0x39')];if(!_0x62c383[_0x86b3('0x37')][_0x86b3('0x3a')](_0x86b3('0x5c'))){_0x5745a0[_0x86b3('0x25')]=qs[_0x86b3('0x25')](_0x62c383[_0x86b3('0x37')]['limit']);_0x5745a0['offset']=qs['offset'](_0x62c383[_0x86b3('0x37')][_0x86b3('0x22')]);}return _0x31c1b5[_0x86b3('0x60')](_0x5745a0);}})[_0x86b3('0x29')](function(_0x57bfdc){if(_0x57bfdc){return _0x57bfdc?{'count':_0x5b4b85,'rows':_0x57bfdc}:null;}})[_0x86b3('0x29')](respondWithResult(_0x42da31,null))[_0x86b3('0x45')](handleError(_0x42da31,null));};
\ No newline at end of file
+var _0x46b9=['map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ChatGroup','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','order','removeMembers','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x435eac,_0x459918){var _0x436f53=function(_0x450946){while(--_0x450946){_0x435eac['push'](_0x435eac['shift']());}};_0x436f53(++_0x459918);}(_0x46b9,0x90));var _0x946b=function(_0x5c4273,_0x46315e){_0x5c4273=_0x5c4273-0x0;var _0x4a0173=_0x46b9[_0x5c4273];return _0x4a0173;};'use strict';var emlformat=require(_0x946b('0x0'));var rimraf=require(_0x946b('0x1'));var zipdir=require(_0x946b('0x2'));var jsonpatch=require(_0x946b('0x3'));var rp=require(_0x946b('0x4'));var moment=require(_0x946b('0x5'));var BPromise=require(_0x946b('0x6'));var Mustache=require(_0x946b('0x7'));var util=require(_0x946b('0x8'));var path=require('path');var sox=require(_0x946b('0x9'));var csv=require(_0x946b('0xa'));var ejs=require(_0x946b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x946b('0xc'));var squel=require('squel');var crypto=require(_0x946b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x946b('0xe'));var toCsv=require(_0x946b('0xa'));var querystring=require(_0x946b('0xf'));var Papa=require('papaparse');var Redis=require(_0x946b('0x10'));var authService=require(_0x946b('0x11'));var qs=require(_0x946b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x946b('0x13'));var logger=require(_0x946b('0x14'))('api');var utils=require(_0x946b('0x15'));var config=require(_0x946b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x946b('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x946b('0x18'),'port':0x18eb});var socket=require(_0x946b('0x19'))(new Redis(config['redis']));require(_0x946b('0x1a'))[_0x946b('0x1b')](socket);function respondWithStatusCode(_0x34e3dd,_0x35424d){_0x35424d=_0x35424d||0xcc;return function(_0x101e8e){if(_0x101e8e){return _0x34e3dd[_0x946b('0x1c')](_0x35424d);}return _0x34e3dd[_0x946b('0x1d')](_0x35424d)[_0x946b('0x1e')]();};}function respondWithResult(_0x68854d,_0x27e07d){_0x27e07d=_0x27e07d||0xc8;return function(_0x16a27e){if(_0x16a27e){return _0x68854d['status'](_0x27e07d)[_0x946b('0x1f')](_0x16a27e);}};}function respondWithFilteredResult(_0x44e54d,_0x59d005){return function(_0x5e8742){if(_0x5e8742){var _0x248af4=typeof _0x59d005[_0x946b('0x20')]===_0x946b('0x21')&&typeof _0x59d005['limit']===_0x946b('0x21');var _0x38f4fc=_0x5e8742[_0x946b('0x22')];var _0x2dc652=_0x248af4?0x0:_0x59d005[_0x946b('0x20')];var _0x1965ad=_0x248af4?_0x5e8742[_0x946b('0x22')]:_0x59d005[_0x946b('0x20')]+_0x59d005[_0x946b('0x23')];var _0x16134b;if(_0x1965ad>=_0x38f4fc){_0x1965ad=_0x38f4fc;_0x16134b=0xc8;}else{_0x16134b=0xce;}_0x44e54d[_0x946b('0x1d')](_0x16134b);return _0x44e54d[_0x946b('0x24')](_0x946b('0x25'),_0x2dc652+'-'+_0x1965ad+'/'+_0x38f4fc)[_0x946b('0x1f')](_0x5e8742);}return null;};}function patchUpdates(_0x240f88){return function(_0x40d956){try{jsonpatch[_0x946b('0x26')](_0x40d956,_0x240f88,!![]);}catch(_0xe80bd9){return BPromise[_0x946b('0x27')](_0xe80bd9);}return _0x40d956[_0x946b('0x28')]();};}function saveUpdates(_0x401c92,_0x9e3d69){return function(_0x22db9d){if(_0x22db9d){return _0x22db9d[_0x946b('0x29')](_0x401c92)['then'](function(_0x3ed6aa){return _0x3ed6aa;});}return null;};}function removeEntity(_0xceee59,_0x33e298){return function(_0x205237){if(_0x205237){return _0x205237['destroy']()[_0x946b('0x2a')](function(){_0xceee59['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f91da,_0x296646){return function(_0x583897){if(!_0x583897){_0x1f91da[_0x946b('0x1c')](0x194);}return _0x583897;};}function handleError(_0x3f0ddb,_0x564817){_0x564817=_0x564817||0x1f4;return function(_0x5c01db){logger[_0x946b('0x2b')](_0x5c01db[_0x946b('0x2c')]);if(_0x5c01db[_0x946b('0x2d')]){delete _0x5c01db['name'];}_0x3f0ddb[_0x946b('0x1d')](_0x564817)[_0x946b('0x2e')](_0x5c01db);};}exports[_0x946b('0x2f')]=function(_0x3f5318,_0x52cb74){var _0x1b0a8a={},_0x39bdb7={},_0x4debd9={'count':0x0,'rows':[]};var _0x14c88f=_[_0x946b('0x30')](db['ChatGroup']['rawAttributes'],function(_0x53b2aa){return{'name':_0x53b2aa[_0x946b('0x31')],'type':_0x53b2aa[_0x946b('0x32')][_0x946b('0x33')]};});_0x39bdb7[_0x946b('0x34')]=_[_0x946b('0x30')](_0x14c88f,_0x946b('0x2d'));_0x39bdb7[_0x946b('0x35')]=_[_0x946b('0x36')](_0x3f5318[_0x946b('0x35')]);_0x39bdb7[_0x946b('0x37')]=_[_0x946b('0x38')](_0x39bdb7['model'],_0x39bdb7[_0x946b('0x35')]);_0x1b0a8a[_0x946b('0x39')]=_[_0x946b('0x38')](_0x39bdb7['model'],qs[_0x946b('0x3a')](_0x3f5318['query'][_0x946b('0x3a')]));_0x1b0a8a[_0x946b('0x39')]=_0x1b0a8a[_0x946b('0x39')][_0x946b('0x3b')]?_0x1b0a8a[_0x946b('0x39')]:_0x39bdb7[_0x946b('0x34')];if(!_0x3f5318[_0x946b('0x35')][_0x946b('0x3c')](_0x946b('0x3d'))){_0x1b0a8a[_0x946b('0x23')]=qs[_0x946b('0x23')](_0x3f5318['query']['limit']);_0x1b0a8a[_0x946b('0x20')]=qs[_0x946b('0x20')](_0x3f5318[_0x946b('0x35')][_0x946b('0x20')]);}_0x1b0a8a['order']=qs[_0x946b('0x3e')](_0x3f5318[_0x946b('0x35')][_0x946b('0x3e')]);_0x1b0a8a['where']=qs['filters'](_[_0x946b('0x3f')](_0x3f5318[_0x946b('0x35')],_0x39bdb7[_0x946b('0x37')]),_0x14c88f);if(_0x3f5318[_0x946b('0x35')][_0x946b('0x40')]){_0x1b0a8a[_0x946b('0x41')]=_[_0x946b('0x42')](_0x1b0a8a[_0x946b('0x41')],{'$or':_[_0x946b('0x30')](_0x14c88f,function(_0x7e24da){if(_0x7e24da[_0x946b('0x32')]!==_0x946b('0x43')){var _0x3e4489={};_0x3e4489[_0x7e24da[_0x946b('0x2d')]]={'$like':'%'+_0x3f5318['query'][_0x946b('0x40')]+'%'};return _0x3e4489;}})});}_0x1b0a8a=_[_0x946b('0x42')]({},_0x1b0a8a,_0x3f5318[_0x946b('0x44')]);var _0x1fffd5={'where':_0x1b0a8a[_0x946b('0x41')]};return db[_0x946b('0x45')][_0x946b('0x22')](_0x1fffd5)[_0x946b('0x2a')](function(_0x261eb4){_0x4debd9['count']=_0x261eb4;if(_0x3f5318[_0x946b('0x35')][_0x946b('0x46')]){_0x1b0a8a[_0x946b('0x47')]=[{'all':!![]}];}return db[_0x946b('0x45')]['findAll'](_0x1b0a8a);})['then'](function(_0x3a44ab){_0x4debd9[_0x946b('0x48')]=_0x3a44ab;return _0x4debd9;})[_0x946b('0x2a')](respondWithFilteredResult(_0x52cb74,_0x1b0a8a))['catch'](handleError(_0x52cb74,null));};exports[_0x946b('0x49')]=function(_0xd2c78f,_0x4afcc2){var _0xe8cc82={'raw':!![],'where':{'id':_0xd2c78f[_0x946b('0x4a')]['id']}},_0x4a9749={};_0x4a9749[_0x946b('0x34')]=_[_0x946b('0x36')](db['ChatGroup'][_0x946b('0x4b')]);_0x4a9749[_0x946b('0x35')]=_[_0x946b('0x36')](_0xd2c78f[_0x946b('0x35')]);_0x4a9749[_0x946b('0x37')]=_['intersection'](_0x4a9749[_0x946b('0x34')],_0x4a9749['query']);_0xe8cc82[_0x946b('0x39')]=_[_0x946b('0x38')](_0x4a9749[_0x946b('0x34')],qs[_0x946b('0x3a')](_0xd2c78f[_0x946b('0x35')][_0x946b('0x3a')]));_0xe8cc82[_0x946b('0x39')]=_0xe8cc82[_0x946b('0x39')]['length']?_0xe8cc82[_0x946b('0x39')]:_0x4a9749[_0x946b('0x34')];if(_0xd2c78f[_0x946b('0x35')][_0x946b('0x46')]){_0xe8cc82[_0x946b('0x47')]=[{'all':!![]}];}_0xe8cc82=_[_0x946b('0x42')]({},_0xe8cc82,_0xd2c78f[_0x946b('0x44')]);return db['ChatGroup'][_0x946b('0x4c')](_0xe8cc82)[_0x946b('0x2a')](handleEntityNotFound(_0x4afcc2,null))['then'](respondWithResult(_0x4afcc2,null))[_0x946b('0x4d')](handleError(_0x4afcc2,null));};exports['create']=function(_0x56f56e,_0x167d80){return db['ChatGroup'][_0x946b('0x4e')](_0x56f56e[_0x946b('0x4f')],{})[_0x946b('0x2a')](respondWithResult(_0x167d80,0xc9))[_0x946b('0x4d')](handleError(_0x167d80,null));};exports[_0x946b('0x29')]=function(_0x138646,_0x3b3ce7){if(_0x138646[_0x946b('0x4f')]['id']){delete _0x138646[_0x946b('0x4f')]['id'];}return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x138646[_0x946b('0x4a')]['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x3b3ce7,null))[_0x946b('0x2a')](saveUpdates(_0x138646[_0x946b('0x4f')],null))['then'](respondWithResult(_0x3b3ce7,null))[_0x946b('0x4d')](handleError(_0x3b3ce7,null));};exports['destroy']=function(_0x5bda76,_0x493c06){return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x5bda76[_0x946b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x493c06,null))[_0x946b('0x2a')](removeEntity(_0x493c06,null))[_0x946b('0x4d')](handleError(_0x493c06,null));};exports[_0x946b('0x50')]=function(_0x44979c,_0x1df06a){return db[_0x946b('0x45')][_0x946b('0x50')]()[_0x946b('0x2a')](respondWithResult(_0x1df06a,null))[_0x946b('0x4d')](handleError(_0x1df06a,null));};exports['getUnread']=function(_0x88f55c,_0x2060e2,_0xce24fe){return db[_0x946b('0x51')][_0x946b('0x22')]({'where':{'ChatGroupId':_0x88f55c[_0x946b('0x4a')]['id'],'ToId':_0x88f55c[_0x946b('0x52')]['id'],'read':![]}})[_0x946b('0x2a')](function(_0x4bcfc5){return{'id':_[_0x946b('0x53')](_0x88f55c[_0x946b('0x4a')]['id']),'count':_0x4bcfc5};})[_0x946b('0x2a')](respondWithResult(_0x2060e2,null))['catch'](handleError(_0x2060e2,null));};exports[_0x946b('0x54')]=function(_0x284d9f,_0xaec05,_0x1cbcf5){return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x284d9f[_0x946b('0x4a')]['id']}})['then'](handleEntityNotFound(_0xaec05,null))[_0x946b('0x2a')](function(_0x4112a4){if(_0x4112a4){return _0x4112a4[_0x946b('0x54')](_0x284d9f['body'][_0x946b('0x55')],_[_0x946b('0x56')](_0x284d9f[_0x946b('0x4f')],[_0x946b('0x55'),'id'])||{});}})[_0x946b('0x2a')](respondWithResult(_0xaec05,null))[_0x946b('0x4d')](handleError(_0xaec05,null));};exports[_0x946b('0x57')]=function(_0x5c6c66,_0x49c926,_0x4b84dd){var _0x3553c6={};var _0x269a7={};var _0x592793;var _0x201f78;return db[_0x946b('0x45')][_0x946b('0x58')]({'where':{'id':_0x5c6c66[_0x946b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x49c926,null))[_0x946b('0x2a')](function(_0x3b0008){if(_0x3b0008){_0x592793=_0x3b0008;_0x269a7[_0x946b('0x34')]=_['keys'](db['User']['rawAttributes']);_0x269a7[_0x946b('0x35')]=_[_0x946b('0x36')](_0x5c6c66[_0x946b('0x35')]);_0x269a7[_0x946b('0x37')]=_[_0x946b('0x38')](_0x269a7[_0x946b('0x34')],_0x269a7[_0x946b('0x35')]);_0x3553c6['attributes']=_[_0x946b('0x38')](_0x269a7[_0x946b('0x34')],qs[_0x946b('0x3a')](_0x5c6c66[_0x946b('0x35')][_0x946b('0x3a')]));_0x3553c6[_0x946b('0x39')]=_0x3553c6[_0x946b('0x39')][_0x946b('0x3b')]?_0x3553c6['attributes']:_0x269a7[_0x946b('0x34')];_0x3553c6[_0x946b('0x59')]=qs['sort'](_0x5c6c66[_0x946b('0x35')][_0x946b('0x3e')]);_0x3553c6['where']=qs['filters'](_[_0x946b('0x3f')](_0x5c6c66['query'],_0x269a7['filters']));if(_0x5c6c66[_0x946b('0x35')][_0x946b('0x40')]){_0x3553c6['where']=_['merge'](_0x3553c6[_0x946b('0x41')],{'$or':_['map'](_0x3553c6[_0x946b('0x39')],function(_0x5d402f){var _0x5e8ea4={};_0x5e8ea4[_0x5d402f]={'$like':'%'+_0x5c6c66[_0x946b('0x35')][_0x946b('0x40')]+'%'};return _0x5e8ea4;})});}_0x3553c6=_[_0x946b('0x42')]({},_0x3553c6,_0x5c6c66[_0x946b('0x44')]);return _0x592793[_0x946b('0x57')](_0x3553c6);}})[_0x946b('0x2a')](function(_0x4b45eb){if(_0x4b45eb){_0x201f78=_0x4b45eb[_0x946b('0x3b')];if(!_0x5c6c66['query'][_0x946b('0x3c')](_0x946b('0x3d'))){_0x3553c6[_0x946b('0x23')]=qs[_0x946b('0x23')](_0x5c6c66['query']['limit']);_0x3553c6['offset']=qs[_0x946b('0x20')](_0x5c6c66['query'][_0x946b('0x20')]);}return _0x592793[_0x946b('0x57')](_0x3553c6);}})[_0x946b('0x2a')](function(_0x41dd58){if(_0x41dd58){return _0x41dd58?{'count':_0x201f78,'rows':_0x41dd58}:null;}})[_0x946b('0x2a')](respondWithResult(_0x49c926,null))[_0x946b('0x4d')](handleError(_0x49c926,null));};exports[_0x946b('0x5a')]=function(_0x1e8b58,_0x26ef7e,_0xe0f6c8){return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x1e8b58['params']['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x26ef7e,null))['then'](function(_0x257400){if(_0x257400){return _0x257400[_0x946b('0x5a')](_0x1e8b58['query'][_0x946b('0x55')]);}})[_0x946b('0x2a')](respondWithStatusCode(_0x26ef7e,null))['catch'](handleError(_0x26ef7e,null));};exports['addMessage']=function(_0x46479f,_0x2b6c98,_0x2e6790){if(_0x46479f[_0x946b('0x4f')]['id']){delete _0x46479f[_0x946b('0x4f')]['id'];}return db[_0x946b('0x45')][_0x946b('0x4c')]({'where':{'id':_0x46479f[_0x946b('0x4a')]['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x2b6c98,null))[_0x946b('0x2a')](function(_0x3ed570){if(_0x3ed570){_0x46479f[_0x946b('0x4f')][_0x946b('0x5b')]=_0x3ed570['id'];return db[_0x946b('0x51')][_0x946b('0x4e')](_0x46479f[_0x946b('0x4f')]);}})[_0x946b('0x2a')](respondWithResult(_0x2b6c98,null))[_0x946b('0x4d')](handleError(_0x2b6c98,null));};exports[_0x946b('0x5c')]=function(_0x468e60,_0x4973b7,_0x1eccda){var _0x3a1cb1={};var _0x3190ed={};var _0x190b95;var _0xd15be3;return db[_0x946b('0x45')][_0x946b('0x58')]({'where':{'id':_0x468e60[_0x946b('0x4a')]['id']}})[_0x946b('0x2a')](handleEntityNotFound(_0x4973b7,null))[_0x946b('0x2a')](function(_0x66f599){if(_0x66f599){_0x190b95=_0x66f599;_0x3190ed[_0x946b('0x34')]=_[_0x946b('0x36')](db[_0x946b('0x51')]['rawAttributes']);_0x3190ed[_0x946b('0x35')]=_['keys'](_0x468e60['query']);_0x3190ed[_0x946b('0x37')]=_['intersection'](_0x3190ed[_0x946b('0x34')],_0x3190ed[_0x946b('0x35')]);_0x3a1cb1[_0x946b('0x39')]=_['intersection'](_0x3190ed[_0x946b('0x34')],qs[_0x946b('0x3a')](_0x468e60[_0x946b('0x35')]['fields']));_0x3a1cb1[_0x946b('0x39')]=_0x3a1cb1[_0x946b('0x39')][_0x946b('0x3b')]?_0x3a1cb1[_0x946b('0x39')]:_0x3190ed[_0x946b('0x34')];_0x3a1cb1[_0x946b('0x59')]=qs[_0x946b('0x3e')](_0x468e60['query'][_0x946b('0x3e')]);_0x3a1cb1[_0x946b('0x41')]=qs[_0x946b('0x37')](_[_0x946b('0x3f')](_0x468e60[_0x946b('0x35')],_0x3190ed[_0x946b('0x37')]));if(_0x468e60['query'][_0x946b('0x40')]){_0x3a1cb1[_0x946b('0x41')]=_[_0x946b('0x42')](_0x3a1cb1[_0x946b('0x41')],{'$or':_['map'](_0x3a1cb1[_0x946b('0x39')],function(_0xb96e5b){var _0x42b899={};_0x42b899[_0xb96e5b]={'$like':'%'+_0x468e60[_0x946b('0x35')][_0x946b('0x40')]+'%'};return _0x42b899;})});}if(_0x468e60[_0x946b('0x35')][_0x946b('0x5d')]){var _0x3ab846=_0x468e60[_0x946b('0x35')][_0x946b('0x5d')]['split'](',');var _0x447b87={};_0x447b87[_0x3ab846[0x0]]={'$gte':moment(_0x3ab846[0x1])[_0x946b('0x5e')](_0x946b('0x5f'))};_0x3a1cb1[_0x946b('0x41')]=_[_0x946b('0x42')](_0x3a1cb1[_0x946b('0x41')],_0x447b87);}_0x3a1cb1=_[_0x946b('0x42')]({},_0x3a1cb1,_0x468e60[_0x946b('0x44')]);return _0x190b95['getMessages'](_0x3a1cb1);}})[_0x946b('0x2a')](function(_0x33f872){if(_0x33f872){_0xd15be3=_0x33f872[_0x946b('0x3b')];if(!_0x468e60[_0x946b('0x35')][_0x946b('0x3c')]('nolimit')){_0x3a1cb1[_0x946b('0x23')]=qs[_0x946b('0x23')](_0x468e60[_0x946b('0x35')]['limit']);_0x3a1cb1[_0x946b('0x20')]=qs[_0x946b('0x20')](_0x468e60[_0x946b('0x35')][_0x946b('0x20')]);}return _0x190b95[_0x946b('0x5c')](_0x3a1cb1);}})['then'](function(_0x2fb860){if(_0x2fb860){return _0x2fb860?{'count':_0xd15be3,'rows':_0x2fb860}:null;}})[_0x946b('0x2a')](respondWithResult(_0x4973b7,null))['catch'](handleError(_0x4973b7,null));};
\ No newline at end of file
index 292d23d..6849f7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf777=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1765dc,_0x17d194){var _0x5e7800=function(_0x6d8197){while(--_0x6d8197){_0x1765dc['push'](_0x1765dc['shift']());}};_0x5e7800(++_0x17d194);}(_0xf777,0x1e9));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x7f77('0x0'));var ChatGroup=require(_0x7f77('0x1'))['db'][_0x7f77('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7f77('0x3')](0x0);var events={'afterCreate':_0x7f77('0x4'),'afterUpdate':_0x7f77('0x5'),'afterDestroy':_0x7f77('0x6')};function emitEvent(_0x1c10a0){return function(_0x3899ba,_0x5941a2,_0x411b63){ChatGroupEvents[_0x7f77('0x7')](_0x1c10a0+':'+_0x3899ba['id'],_0x3899ba);ChatGroupEvents['emit'](_0x1c10a0,_0x3899ba);_0x411b63(null);};}for(var e in events){if(events[_0x7f77('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x7f77('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xe3cf=['hasOwnProperty','hook','exports','events','ChatGroup','remove','emit'];(function(_0x53cf1c,_0x2c2b16){var _0x27221a=function(_0x104d7c){while(--_0x104d7c){_0x53cf1c['push'](_0x53cf1c['shift']());}};_0x27221a(++_0x2c2b16);}(_0xe3cf,0x16f));var _0xfe3c=function(_0x112df4,_0x14bb3d){_0x112df4=_0x112df4-0x0;var _0x4c2a76=_0xe3cf[_0x112df4];return _0x4c2a76;};'use strict';var EventEmitter=require(_0xfe3c('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xfe3c('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfe3c('0x2')};function emitEvent(_0x2fc7c5){return function(_0x1e474a,_0x32bb6b,_0x1ced6d){ChatGroupEvents[_0xfe3c('0x3')](_0x2fc7c5+':'+_0x1e474a['id'],_0x1e474a);ChatGroupEvents['emit'](_0x2fc7c5,_0x1e474a);_0x1ced6d(null);};}for(var e in events){if(events[_0xfe3c('0x4')](e)){var event=events[e];ChatGroup[_0xfe3c('0x5')](e,emitEvent(event));}}module[_0xfe3c('0x6')]=ChatGroupEvents;
\ No newline at end of file
index 8a61c9f..fd0a534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a53=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','path','./chatGroup.attributes'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x7a53,0x1cf));var _0x37a5=function(_0x94de9c,_0x255ae5){_0x94de9c=_0x94de9c-0x0;var _0x250ae7=_0x7a53[_0x94de9c];return _0x250ae7;};'use strict';var _=require(_0x37a5('0x0'));var util=require(_0x37a5('0x1'));var logger=require(_0x37a5('0x2'))('api');var moment=require(_0x37a5('0x3'));var BPromise=require(_0x37a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37a5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x37a5('0x6'));module['exports']=function(_0x3005f1,_0x27ad8c){return _0x3005f1[_0x37a5('0x7')](_0x37a5('0x8'),attributes,{'tableName':_0x37a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d5e=['request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1bbb91,_0xc65ae3){var _0x46053a=function(_0x3e174e){while(--_0x3e174e){_0x1bbb91['push'](_0x1bbb91['shift']());}};_0x46053a(++_0xc65ae3);}(_0x6d5e,0x190));var _0xe6d5=function(_0x4f8196,_0x6ce644){_0x4f8196=_0x4f8196-0x0;var _0x1d62b3=_0x6d5e[_0x4f8196];return _0x1d62b3;};'use strict';var _=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var logger=require(_0xe6d5('0x2'))(_0xe6d5('0x3'));var moment=require(_0xe6d5('0x4'));var BPromise=require(_0xe6d5('0x5'));var rp=require(_0xe6d5('0x6'));var fs=require('fs');var path=require(_0xe6d5('0x7'));var rimraf=require(_0xe6d5('0x8'));var config=require('../../config/environment');var attributes=require(_0xe6d5('0x9'));module[_0xe6d5('0xa')]=function(_0x42afed,_0x10206e){return _0x42afed[_0xe6d5('0xb')](_0xe6d5('0xc'),attributes,{'tableName':_0xe6d5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8fa488b..a4ffe8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b75=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','lodash'];(function(_0x33f0fc,_0x1c85fe){var _0x12323e=function(_0xde99aa){while(--_0xde99aa){_0x33f0fc['push'](_0x33f0fc['shift']());}};_0x12323e(++_0x1c85fe);}(_0x3b75,0x144));var _0x53b7=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0x3b75[_0x562faf];return _0x22c1f6;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require(_0x53b7('0x5'));var db=require(_0x53b7('0x6'))['db'];var utils=require(_0x53b7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x53b7('0x8'));var jayson=require(_0x53b7('0x9'));var client=jayson[_0x53b7('0xa')][_0x53b7('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x53b7('0xc')],{'host':_0x53b7('0xd'),'port':0x18eb});var socket=require(_0x53b7('0xe'))(new Redis(config[_0x53b7('0xc')]));require(_0x53b7('0xf'))['register'](socket);function respondWithRpcPromise(_0x958344,_0x41afe3,_0x7ac56b){return new BPromise(function(_0x39708d,_0x308e6a){return client[_0x53b7('0x10')](_0x958344,_0x7ac56b)['then'](function(_0x54b69e){logger[_0x53b7('0x11')]('ChatGroup,\x20%s,\x20%s',_0x41afe3,_0x53b7('0x12'));logger['debug'](_0x53b7('0x13'),_0x41afe3,_0x53b7('0x12'),JSON[_0x53b7('0x14')](_0x54b69e));if(_0x54b69e['error']){if(_0x54b69e[_0x53b7('0x15')][_0x53b7('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x41afe3,_0x54b69e[_0x53b7('0x15')][_0x53b7('0x17')]);return _0x308e6a(_0x54b69e[_0x53b7('0x15')][_0x53b7('0x17')]);}logger[_0x53b7('0x15')]('ChatGroup,\x20%s,\x20%s',_0x41afe3,_0x54b69e[_0x53b7('0x15')][_0x53b7('0x17')]);return _0x39708d(_0x54b69e[_0x53b7('0x15')][_0x53b7('0x17')]);}else{logger[_0x53b7('0x11')]('ChatGroup,\x20%s,\x20%s',_0x41afe3,_0x53b7('0x12'));_0x39708d(_0x54b69e['result']['message']);}})['catch'](function(_0x11eff0){logger[_0x53b7('0x15')](_0x53b7('0x18'),_0x41afe3,_0x11eff0);_0x308e6a(_0x11eff0);});});}
\ No newline at end of file
+var _0xa37e=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','moment','bluebird','randomstring'];(function(_0x45961f,_0x40c9ba){var _0x57d209=function(_0x2f0c03){while(--_0x2f0c03){_0x45961f['push'](_0x45961f['shift']());}};_0x57d209(++_0x40c9ba);}(_0xa37e,0x97));var _0xea37=function(_0x5723f9,_0x294319){_0x5723f9=_0x5723f9-0x0;var _0x1c021c=_0xa37e[_0x5723f9];return _0x1c021c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xea37('0x8')]=_['defaults'](config['redis'],{'host':_0xea37('0x9'),'port':0x18eb});var socket=require(_0xea37('0xa'))(new Redis(config[_0xea37('0x8')]));require(_0xea37('0xb'))['register'](socket);function respondWithRpcPromise(_0x315e5f,_0x37ca45,_0x8371a){return new BPromise(function(_0x55d4de,_0x5060cd){return client[_0xea37('0xc')](_0x315e5f,_0x8371a)[_0xea37('0xd')](function(_0x3cd18b){logger['info'](_0xea37('0xe'),_0x37ca45,_0xea37('0xf'));logger[_0xea37('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x37ca45,_0xea37('0xf'),JSON[_0xea37('0x11')](_0x3cd18b));if(_0x3cd18b['error']){if(_0x3cd18b[_0xea37('0x12')]['code']===0x1f4){logger[_0xea37('0x12')]('ChatGroup,\x20%s,\x20%s',_0x37ca45,_0x3cd18b[_0xea37('0x12')][_0xea37('0x13')]);return _0x5060cd(_0x3cd18b[_0xea37('0x12')][_0xea37('0x13')]);}logger['error'](_0xea37('0xe'),_0x37ca45,_0x3cd18b['error']['message']);return _0x55d4de(_0x3cd18b[_0xea37('0x12')]['message']);}else{logger[_0xea37('0x14')](_0xea37('0xe'),_0x37ca45,'request\x20sent');_0x55d4de(_0x3cd18b[_0xea37('0x15')][_0xea37('0x13')]);}})['catch'](function(_0x786ee5){logger[_0xea37('0x12')](_0xea37('0xe'),_0x37ca45,_0x786ee5);_0x5060cd(_0x786ee5);});});}
\ No newline at end of file
index 7f376fa..e1ce1a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4011=['update','emit','removeListener','register','length','chatGroup:','remove'];(function(_0xcb56d2,_0x18c194){var _0x57bed4=function(_0x194ed8){while(--_0x194ed8){_0xcb56d2['push'](_0xcb56d2['shift']());}};_0x57bed4(++_0x18c194);}(_0x4011,0x109));var _0x1401=function(_0x5c2577,_0x48f6c1){_0x5c2577=_0x5c2577-0x0;var _0x1d50da=_0x4011[_0x5c2577];return _0x1d50da;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x1401('0x0'),_0x1401('0x1')];function createListener(_0x6e2b08,_0x38f44d){return function(_0x2b6407){_0x38f44d[_0x1401('0x2')](_0x6e2b08,_0x2b6407);};}function removeListener(_0x2bf9fc,_0x13075d){return function(){ChatGroupEvents[_0x1401('0x3')](_0x2bf9fc,_0x13075d);};}exports[_0x1401('0x4')]=function(_0x47d33e){for(var _0x1815fe=0x0,_0x196f67=events[_0x1401('0x5')];_0x1815fe<_0x196f67;_0x1815fe++){var _0x397a44=events[_0x1815fe];var _0x472ae0=createListener(_0x1401('0x6')+_0x397a44,_0x47d33e);ChatGroupEvents['on'](_0x397a44,_0x472ae0);}};
\ No newline at end of file
+var _0x577c=['register','length','./chatGroup.events','save','remove','update','removeListener'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x577c,0x9c));var _0xc577=function(_0x1d5ff0,_0x251781){_0x1d5ff0=_0x1d5ff0-0x0;var _0x9003ac=_0x577c[_0x1d5ff0];return _0x9003ac;};'use strict';var ChatGroupEvents=require(_0xc577('0x0'));var events=[_0xc577('0x1'),_0xc577('0x2'),_0xc577('0x3')];function createListener(_0x2c1dbe,_0x370e17){return function(_0x2e0e2a){_0x370e17['emit'](_0x2c1dbe,_0x2e0e2a);};}function removeListener(_0x47f25c,_0x5c6f7a){return function(){ChatGroupEvents[_0xc577('0x4')](_0x47f25c,_0x5c6f7a);};}exports[_0xc577('0x5')]=function(_0x4627b4){for(var _0x4fdcbd=0x0,_0x1c31d3=events[_0xc577('0x6')];_0x4fdcbd<_0x1c31d3;_0x4fdcbd++){var _0x258d69=events[_0x4fdcbd];var _0x7be767=createListener('chatGroup:'+_0x258d69,_0x4627b4);ChatGroupEvents['on'](_0x258d69,_0x7be767);}};
\ No newline at end of file
index 47eea1f..8bad05b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94c4=['destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','/:id/messages','addMessage','/:id','update','delete'];(function(_0x3c0595,_0x41a6a9){var _0x1d8f61=function(_0x3e7b61){while(--_0x3e7b61){_0x3c0595['push'](_0x3c0595['shift']());}};_0x1d8f61(++_0x41a6a9);}(_0x94c4,0x7f));var _0x494c=function(_0x3a40a3,_0x1e52d4){_0x3a40a3=_0x3a40a3-0x0;var _0x2d07b9=_0x94c4[_0x3a40a3];return _0x2d07b9;};'use strict';var multer=require(_0x494c('0x0'));var util=require(_0x494c('0x1'));var path=require(_0x494c('0x2'));var timeout=require(_0x494c('0x3'));var express=require(_0x494c('0x4'));var router=express[_0x494c('0x5')]();var fs_extra=require(_0x494c('0x6'));var auth=require(_0x494c('0x7'));var interaction=require(_0x494c('0x8'));var config=require(_0x494c('0x9'));var controller=require(_0x494c('0xa'));router[_0x494c('0xb')]('/',auth[_0x494c('0xc')](),controller[_0x494c('0xd')]);router['get'](_0x494c('0xe'),auth[_0x494c('0xc')](),controller[_0x494c('0xf')]);router[_0x494c('0xb')]('/:id',auth[_0x494c('0xc')](),controller[_0x494c('0x10')]);router['get'](_0x494c('0x11'),auth[_0x494c('0xc')](),controller[_0x494c('0x12')]);router[_0x494c('0xb')](_0x494c('0x13'),auth[_0x494c('0xc')](),controller[_0x494c('0x14')]);router[_0x494c('0xb')]('/:id/messages',auth[_0x494c('0xc')](),controller[_0x494c('0x15')]);router[_0x494c('0x16')]('/',auth[_0x494c('0xc')](),controller['create']);router[_0x494c('0x16')]('/:id/members',auth[_0x494c('0xc')](),controller['addMembers']);router[_0x494c('0x16')](_0x494c('0x17'),auth[_0x494c('0xc')](),controller[_0x494c('0x18')]);router['put'](_0x494c('0x19'),auth[_0x494c('0xc')](),controller[_0x494c('0x1a')]);router[_0x494c('0x1b')](_0x494c('0x19'),auth[_0x494c('0xc')](),controller[_0x494c('0x1c')]);router['delete'](_0x494c('0x13'),auth[_0x494c('0xc')](),controller[_0x494c('0x1d')]);module[_0x494c('0x1e')]=router;
\ No newline at end of file
+var _0x5a3b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMessage','put','update'];(function(_0x427127,_0x3a4a16){var _0x22d8e7=function(_0x210c9f){while(--_0x210c9f){_0x427127['push'](_0x427127['shift']());}};_0x22d8e7(++_0x3a4a16);}(_0x5a3b,0x1bd));var _0xb5a3=function(_0x4682eb,_0x2bfc64){_0x4682eb=_0x4682eb-0x0;var _0x25ee36=_0x5a3b[_0x4682eb];return _0x25ee36;};'use strict';var multer=require(_0xb5a3('0x0'));var util=require(_0xb5a3('0x1'));var path=require(_0xb5a3('0x2'));var timeout=require(_0xb5a3('0x3'));var express=require(_0xb5a3('0x4'));var router=express[_0xb5a3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb5a3('0x6'));var controller=require('./chatGroup.controller');router[_0xb5a3('0x7')]('/',auth[_0xb5a3('0x8')](),controller[_0xb5a3('0x9')]);router[_0xb5a3('0x7')]('/describe',auth[_0xb5a3('0x8')](),controller[_0xb5a3('0xa')]);router['get'](_0xb5a3('0xb'),auth['isAuthenticated'](),controller[_0xb5a3('0xc')]);router[_0xb5a3('0x7')](_0xb5a3('0xd'),auth[_0xb5a3('0x8')](),controller[_0xb5a3('0xe')]);router[_0xb5a3('0x7')](_0xb5a3('0xf'),auth[_0xb5a3('0x8')](),controller['getMembers']);router[_0xb5a3('0x7')](_0xb5a3('0x10'),auth['isAuthenticated'](),controller[_0xb5a3('0x11')]);router[_0xb5a3('0x12')]('/',auth[_0xb5a3('0x8')](),controller[_0xb5a3('0x13')]);router[_0xb5a3('0x12')]('/:id/members',auth[_0xb5a3('0x8')](),controller['addMembers']);router[_0xb5a3('0x12')](_0xb5a3('0x10'),auth[_0xb5a3('0x8')](),controller[_0xb5a3('0x14')]);router[_0xb5a3('0x15')](_0xb5a3('0xb'),auth['isAuthenticated'](),controller[_0xb5a3('0x16')]);router[_0xb5a3('0x17')](_0xb5a3('0xb'),auth['isAuthenticated'](),controller[_0xb5a3('0x18')]);router[_0xb5a3('0x17')]('/:id/members',auth[_0xb5a3('0x8')](),controller['removeMembers']);module[_0xb5a3('0x19')]=router;
\ No newline at end of file
index 8d367a4..f44714a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7269=['star','thumb','TEXT','STRING','DATE','long','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7269,0x76));var _0x9726=function(_0x170148,_0x402a07){_0x170148=_0x170148-0x0;var _0x2f00a7=_0x7269[_0x170148];return _0x2f00a7;};'use strict';var Sequelize=require(_0x9726('0x0'));module[_0x9726('0x1')]={'closed':{'type':Sequelize[_0x9726('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x9726('0x3'),_0x9726('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x9726('0x5')]},'pathTranscript':{'type':Sequelize[_0x9726('0x5')]},'mailTranscript':{'type':Sequelize[_0x9726('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9726('0x7')]},'disposition':{'type':Sequelize[_0x9726('0x6')]},'secondDisposition':{'type':Sequelize[_0x9726('0x6')]},'thirdDisposition':{'type':Sequelize[_0x9726('0x6')]},'note':{'type':Sequelize[_0x9726('0x6')]},'browserName':{'type':Sequelize[_0x9726('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x9726('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9726('0x6')]},'deviceVendor':{'type':Sequelize[_0x9726('0x6')]},'deviceType':{'type':Sequelize[_0x9726('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x9726('0x6')]},'formData':{'type':Sequelize[_0x9726('0x5')](_0x9726('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9726('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x9726('0x9')]('in',_0x9726('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9726('0x6')]},'customerPort':{'type':Sequelize[_0x9726('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x9e6b=['star','TEXT','DATE','STRING','long','ENUM','out','BOOLEAN','sequelize','exports','INTEGER','thumb'];(function(_0x4472b6,_0x3768b6){var _0x153531=function(_0x517b02){while(--_0x517b02){_0x4472b6['push'](_0x4472b6['shift']());}};_0x153531(++_0x3768b6);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9e6b[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xb9e6('0x0'));module[_0xb9e6('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb9e6('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0xb9e6('0x3')),'defaultValue':_0xb9e6('0x4')},'ratingMessage':{'type':Sequelize[_0xb9e6('0x5')]},'pathTranscript':{'type':Sequelize[_0xb9e6('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb9e6('0x6')]},'disposition':{'type':Sequelize[_0xb9e6('0x7')]},'secondDisposition':{'type':Sequelize[_0xb9e6('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb9e6('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xb9e6('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xb9e6('0x7')]},'deviceType':{'type':Sequelize[_0xb9e6('0x7')]},'referer':{'type':Sequelize[_0xb9e6('0x5')]},'customerIp':{'type':Sequelize[_0xb9e6('0x7')]},'formData':{'type':Sequelize[_0xb9e6('0x5')](_0xb9e6('0x8'))},'read1stAt':{'type':Sequelize[_0xb9e6('0x6')]},'lastMsgAt':{'type':Sequelize[_0xb9e6('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xb9e6('0x9')]('in',_0xb9e6('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xb9e6('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xb9e6('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xb9e6('0xb')],'defaultValue':![]}};
\ No newline at end of file
index ef8ea5a..a678ab4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','isNull','vidaooNote','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','filename','mimetype','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','findAll','getMyMessages','includeAgent','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','firstName','lastName','Attachment','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','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'];(function(_0x315638,_0x3e3d45){var _0x3d27cd=function(_0x59c9b4){while(--_0x59c9b4){_0x315638['push'](_0x315638['shift']());}};_0x3d27cd(++_0x3e3d45);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var pdf=require(_0x0baf('0x16'));var hardwareService=require(_0x0baf('0x17'));var logger=require(_0x0baf('0x18'))(_0x0baf('0x19'));var utils=require(_0x0baf('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0baf('0x1b'))['db'];config[_0x0baf('0x1c')]=_[_0x0baf('0x1d')](config[_0x0baf('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0x1e'))(new Redis(config['redis']));require(_0x0baf('0x1f'))[_0x0baf('0x20')](socket);var jayson=require(_0x0baf('0x21'));var client=jayson[_0x0baf('0x22')][_0x0baf('0x23')]({'port':0x232b});var client9004=jayson[_0x0baf('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd79d,_0x2312c7,_0x38395b,_0x283408){return new BPromise(function(_0x3d83a3,_0x2cf7da){var _0x288a98=_0x283408||client;return _0x288a98['request'](_0x4cd79d,_0x38395b)[_0x0baf('0x24')](function(_0xfbecec){logger[_0x0baf('0x25')](_0x0baf('0x26'),_0x2312c7,_0x0baf('0x27'));logger[_0x0baf('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2312c7,'request\x20sent',JSON[_0x0baf('0x29')](_0xfbecec));if(_0xfbecec[_0x0baf('0x2a')]){if(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2b')]===0x1f4){logger[_0x0baf('0x2a')](_0x0baf('0x26'),_0x2312c7,_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);return _0x2cf7da(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);}logger['error'](_0x0baf('0x26'),_0x2312c7,_0xfbecec['error'][_0x0baf('0x2c')]);return _0x3d83a3(_0xfbecec['error']['message']);}else{logger[_0x0baf('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,'request\x20sent');_0x3d83a3(_0xfbecec[_0x0baf('0x2d')][_0x0baf('0x2c')]);}})[_0x0baf('0x2e')](function(_0x19d9fd){logger[_0x0baf('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,_0x19d9fd);_0x2cf7da(_0x19d9fd);});});}function respondWithStatusCode(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0xcc;return function(_0x1ca35a){if(_0x1ca35a){return _0x448617[_0x0baf('0x2f')](_0x4681c5);}return _0x448617[_0x0baf('0x30')](_0x4681c5)[_0x0baf('0x31')]();};}function respondWithResult(_0x453525,_0x549fd0){_0x549fd0=_0x549fd0||0xc8;return function(_0x1590b4){if(_0x1590b4){return _0x453525[_0x0baf('0x30')](_0x549fd0)[_0x0baf('0x32')](_0x1590b4);}};}function respondWithFilteredResult(_0x265915,_0x55c715){return function(_0x29dbdf){if(_0x29dbdf){var _0x34a58a=typeof _0x55c715['offset']===_0x0baf('0x33')&&typeof _0x55c715[_0x0baf('0x34')]===_0x0baf('0x33');var _0xb4dbb1=_0x29dbdf[_0x0baf('0x35')];var _0x366924=_0x34a58a?0x0:_0x55c715[_0x0baf('0x36')];var _0x57476f=_0x34a58a?_0x29dbdf[_0x0baf('0x35')]:_0x55c715[_0x0baf('0x36')]+_0x55c715[_0x0baf('0x34')];var _0x3ed995;if(_0x57476f>=_0xb4dbb1){_0x57476f=_0xb4dbb1;_0x3ed995=0xc8;}else{_0x3ed995=0xce;}_0x265915[_0x0baf('0x30')](_0x3ed995);return _0x265915[_0x0baf('0x37')](_0x0baf('0x38'),_0x366924+'-'+_0x57476f+'/'+_0xb4dbb1)[_0x0baf('0x32')](_0x29dbdf);}return null;};}function patchUpdates(_0x59431b){return function(_0x3ded64){try{jsonpatch[_0x0baf('0x39')](_0x3ded64,_0x59431b,!![]);}catch(_0x165d14){return BPromise[_0x0baf('0x3a')](_0x165d14);}return _0x3ded64[_0x0baf('0x3b')]();};}function saveUpdates(_0x57a6bb,_0x2fd426){return function(_0x53ae1d){if(_0x53ae1d){return _0x53ae1d[_0x0baf('0x3c')](_0x57a6bb)[_0x0baf('0x24')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x3d65f2,_0x5300a5){return function(_0x1a2b03){if(_0x1a2b03){return _0x1a2b03[_0x0baf('0x3d')]()['then'](function(){_0x3d65f2[_0x0baf('0x30')](0xcc)[_0x0baf('0x31')]();});}};}function handleEntityNotFound(_0x62a2ed,_0xbaa9a7){return function(_0x1f60bd){if(!_0x1f60bd){_0x62a2ed[_0x0baf('0x2f')](0x194);}return _0x1f60bd;};}function handleError(_0xe03d82,_0x675461){_0x675461=_0x675461||0x1f4;return function(_0x4aa6ed){logger[_0x0baf('0x2a')](_0x4aa6ed[_0x0baf('0x3e')]);if(_0x4aa6ed['name']){delete _0x4aa6ed[_0x0baf('0x3f')];}_0xe03d82['status'](_0x675461)['send'](_0x4aa6ed);};}function getMustacheRender(_0x11bc49,_0x81af83){return Mustache['render'](_0x11bc49,_['merge'](_0x81af83[_0x0baf('0x40')],{'contact':_0x81af83[_0x0baf('0x41')],'message':_0x81af83[_0x0baf('0x2c')],'agent':_0x81af83[_0x0baf('0x42')],'interaction':_0x81af83[_0x0baf('0x43')],'account':_0x81af83[_0x0baf('0x44')]}))||'';}function getInteractionUsers(_0x290464,_0x37c038){return new BPromise(function(_0x631f74,_0x36c6d2){try{if(_0x37c038[_0x290464['id']]){_0x290464[_0x0baf('0x45')]=_[_0x0baf('0x46')](_0x37c038[_0x290464['id']],function(_0x354cb1){return{'id':_0x354cb1['id'],'fullname':_0x354cb1[_0x0baf('0x47')]};});}}catch(_0x53d6b7){_0x36c6d2(_0x53d6b7);}_0x631f74(_0x290464);});}function getInteractionTags(_0x3573ce,_0x1435d5){return new BPromise(function(_0x4f1de9,_0x38006a){try{if(_0x3573ce[_0x0baf('0x48')]){_0x3573ce[_0x0baf('0x49')]=[];_0x3573ce[_0x0baf('0x48')][_0x0baf('0x4a')](',')[_0x0baf('0x4b')](function(_0x57b581){_0x3573ce[_0x0baf('0x49')][_0x0baf('0x4c')](_0x1435d5[_0x57b581]);});}delete _0x3573ce['TagIds'];}catch(_0x35d442){_0x38006a(_0x35d442);}_0x4f1de9(_0x3573ce);});}function updateChatInteraction(_0x412e6f,_0x45c6aa,_0x57903e){return new BPromise(function(_0x504031,_0x193fd3){return getInteractionUsers(_0x412e6f,_0x57903e)[_0x0baf('0x24')](function(_0x301412){return getInteractionTags(_0x301412,_0x45c6aa);})[_0x0baf('0x24')](function(_0x2b6d54){_0x504031(_0x2b6d54);})[_0x0baf('0x2e')](function(_0x33da34){_0x193fd3(_0x33da34);});});}exports[_0x0baf('0x4d')]=function(_0xce1bf0,_0x355033){var _0x56270e={},_0x2a2a7c={},_0x2bc755={'count':0x0,'rows':[]};var _0x1daf1d=_[_0x0baf('0x46')](db[_0x0baf('0x4e')]['rawAttributes'],function(_0x1e7364){return{'name':_0x1e7364[_0x0baf('0x4f')],'type':_0x1e7364[_0x0baf('0x50')][_0x0baf('0x51')]};});_0x2a2a7c[_0x0baf('0x52')]=_['map'](_0x1daf1d,_0x0baf('0x3f'));_0x2a2a7c[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0xce1bf0[_0x0baf('0x53')]);_0x2a2a7c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],_0x2a2a7c['query']);_0x56270e[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],qs['fields'](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]));_0x56270e[_0x0baf('0x57')]=_0x56270e[_0x0baf('0x57')][_0x0baf('0x59')]?_0x56270e[_0x0baf('0x57')]:_0x2a2a7c[_0x0baf('0x52')];if(!_0xce1bf0['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x56270e[_0x0baf('0x34')]=qs[_0x0baf('0x34')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x34')]);_0x56270e[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x56270e[_0x0baf('0x5c')]=qs['sort'](_0xce1bf0['query'][_0x0baf('0x5d')]);_0x56270e[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0xce1bf0[_0x0baf('0x53')],_0x2a2a7c[_0x0baf('0x55')]),_0x1daf1d);var _0x3403d5=[];var _0x4b492c=squel[_0x0baf('0x60')]()[_0x0baf('0x61')]('id')[_0x0baf('0x61')](_0x0baf('0x3f'))[_0x0baf('0x61')](_0x0baf('0x62'))['from'](_0x0baf('0x63'));var _0x5f123c=squel[_0x0baf('0x60')]()['field'](_0x0baf('0x64'))['field'](_0x0baf('0x65'))['field'](_0x0baf('0x66'))[_0x0baf('0x67')](_0x0baf('0x68'),'ui')[_0x0baf('0x69')](_0x0baf('0x6a'),'u','u.id\x20=\x20ui.UserId');var _0x21f179=squel[_0x0baf('0x60')]()[_0x0baf('0x67')](_0x0baf('0x6b'),'i')[_0x0baf('0x69')](_0x0baf('0x6c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0baf('0x69')](_0x0baf('0x6a'),'o',_0x0baf('0x6d'))[_0x0baf('0x69')](_0x0baf('0x6e'),'a',_0x0baf('0x6f'))[_0x0baf('0x69')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x0baf('0x69')](_0x0baf('0x70'),'it',_0x0baf('0x71'))[_0x0baf('0x69')](_0x0baf('0x63'),'t',_0x0baf('0x72'));var _0xaa4293=squel[_0x0baf('0x73')]();var _0x3d9a32=[];var _0x585969=squel[_0x0baf('0x73')]();var _0x268be8;if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]){_0x268be8=as[_0x0baf('0x75')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]);var _0x51d75f=_0x268be8[_0x0baf('0x76')];for(var _0x27f580=0x0;_0x27f580<_0x268be8[_0x0baf('0x77')][_0x0baf('0x59')];_0x27f580++){var _0x1c7d88=_0x268be8[_0x0baf('0x77')][_0x27f580];var _0x14e6d0='i';var _0x12543e=_['find'](_0x1daf1d,[_0x0baf('0x3f'),_0x1c7d88['field']]);if(!_0x12543e){switch(_0x1c7d88[_0x0baf('0x61')]){case'unreadMessages':if(_0x1c7d88['value']==0x1){_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x79'));}else{_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x7a'));}break;case _0x0baf('0x7b'):if(_0x1c7d88[_0x0baf('0x7c')]==='$substring'){if(_0x1c7d88['value'][_0x0baf('0x4a')]('\x20')[_0x0baf('0x59')]>0x1){_0xaa4293[_0x51d75f](_0x0baf('0x7d'),qs[_0x0baf('0x7e')](_0x1c7d88[_0x0baf('0x7f')]),null);}else{var _0x588b88='%'+_0x1c7d88[_0x0baf('0x7f')]+'%';_0xaa4293[_0x51d75f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x588b88,_0x588b88,_0x588b88);}}else{_0x12543e=_['find'](_0x1daf1d,['name',_0x0baf('0x80')]);_0x1c7d88['field']='ContactId';_0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);}break;case _0x0baf('0x84'):var _0x1a0a67=_0x1c7d88[_0x0baf('0x7f')][_0x0baf('0x4a')](',')[_0x0baf('0x46')](function(_0x1273f4){return Number(_0x1273f4);});_0x1a0a67['forEach'](function(_0x42e8ad){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x42e8ad+',%');});_0x3d9a32=_[_0x0baf('0x86')](_0x3d9a32,_0x1a0a67);break;case'User':if(_0x1c7d88[_0x0baf('0x7c')]===_0x0baf('0x87')){_0xaa4293[_0x51d75f](_0x0baf('0x88'),'%'+_0x1c7d88[_0x0baf('0x7f')]+'%',null);}else{_0x12543e=_[_0x0baf('0x89')](_0x1daf1d,[_0x0baf('0x3f'),_0x0baf('0x8a')]);_0x1c7d88['field']='UserId';_0xf45ec3=as['buildExpression'](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}break;case'body':_0xf45ec3=as['buildExpression']('me',null,_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3['value'][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);break;}}else{var _0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}}}else{var _0xfcc697=_(_0xce1bf0['query'])['keys']()['map'](function(_0x493784){return _['some'](_0x1daf1d,[_0x0baf('0x3f'),_0x493784])?_0x493784:undefined;})[_0x0baf('0x8b')]()[_0x0baf('0x7f')]();if(!_[_0x0baf('0x8c')](_0xfcc697)){_0xfcc697['forEach'](function(_0x1be7f2){if(_0x1be7f2===_0x0baf('0x8d')){_0x21f179['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x0baf('0x8e')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]));}else if(_0x1be7f2===_0x0baf('0x8f')){var _0x442e5f=JSON[_0x0baf('0x90')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x91')];var _0x399f40=JSON['parse'](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x92')];_0x21f179['where'](_0x0baf('0x93'),_0x442e5f,_0x399f40);}else{if(_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]==='null'){_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x94'));}else{_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x95'),_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]);}}});}if(_0xce1bf0['query']['read']){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x96')]==0x1){_0x21f179['having'](_0x0baf('0x97'));}else{_0x21f179[_0x0baf('0x78')](_0x0baf('0x98'));}}if(_0xce1bf0['query'][_0x0baf('0x99')]){_0x3d9a32=_[_0x0baf('0x9a')](_0xce1bf0[_0x0baf('0x53')]['tag'])?_0xce1bf0[_0x0baf('0x53')]['tag']:new Array(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x99')]);_0x3d9a32[_0x0baf('0x4b')](function(_0x2f009f){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x2f009f+',%');});}if(_0xce1bf0['query'][_0x0baf('0x9b')]){var _0x57f33c=_0xce1bf0['query'][_0x0baf('0x9b')][_0x0baf('0x9c')]('\x5c','\x5c\x5c')[_0x0baf('0x9c')](/'/g,'\x27\x27');if(qs[_0x0baf('0x9d')](_0x57f33c)){_0xaa4293['or'](_0x0baf('0x9e'),_0x57f33c+'%');}else{_0xaa4293['or'](_0x0baf('0x9f'),qs[_0x0baf('0x7e')](_0x57f33c))['or'](_0x0baf('0xa0'),_0x57f33c+'%');}}}_0x21f179[_0x0baf('0x5e')](_0xaa4293);_0x21f179[_0x0baf('0xa1')](_0x0baf('0xa2'));var _0x2c2f09={'type':db['Sequelize']['QueryTypes'][_0x0baf('0xa3')],'raw':!![]};var _0x322a09=_0x21f179[_0x0baf('0xa4')]();_0x322a09['field']('i.id');_0x322a09[_0x0baf('0x61')](_0x0baf('0xa5'),_0x0baf('0xa6'));if(_0x56270e[_0x0baf('0x5c')]){_0x56270e[_0x0baf('0x5c')][_0x0baf('0x4b')](function(_0x191d35){var _0xa2d315=_0x191d35[0x0]===_0x0baf('0xa7')?_0x191d35[0x0]:'i.'+_0x191d35[0x0];_0x21f179['order'](_0xa2d315,_0x191d35[0x1]===_0x0baf('0xa8')?![]:!![]);});}if(!_[_0x0baf('0x8c')](_0x3d9a32)){_0x21f179[_0x0baf('0x78')](_0x585969);_0x322a09[_0x0baf('0x5e')]('t.id\x20IN\x20?',_0x3d9a32);}BPromise['resolve']()['then'](function(){if(!_0x268be8){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return;_0x322a09['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x21f179[_0x0baf('0x5e')](_0x0baf('0xa9'));return;}if(_0xce1bf0['user'][_0x0baf('0xaa')]!==_0x0baf('0x42'))return;return _0xce1bf0[_0x0baf('0xab')][_0x0baf('0xac')]({'attributes':['id'],'raw':!![]})[_0x0baf('0x24')](function(_0x25081e){if(_[_0x0baf('0x8c')](_0x25081e)){_0x322a09[_0x0baf('0x5e')](_0x0baf('0xad'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xad'));}else{_0x322a09[_0x0baf('0x5e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0baf('0x46')](_0x25081e,'id'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xae'),_[_0x0baf('0x46')](_0x25081e,'id'));}});})[_0x0baf('0x24')](function(){if(_0xce1bf0[_0x0baf('0xab')]['role']===_0x0baf('0x42')&&!_0x268be8&&!_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return[];return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x322a09['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x30eac8){_0x2bc755[_0x0baf('0x35')]=_0x30eac8[_0x0baf('0x59')];if(_0x2bc755[_0x0baf('0x35')]===0x0)return[];return db['sequelize']['query'](_0x4b492c[_0x0baf('0xb0')](),_0x2c2f09)['then'](function(_0x477cd5){_0x3403d5=_['keyBy'](_0x477cd5,'id');_0x2c2f09=_[_0x0baf('0xb1')](_0x2c2f09,{'model':db[_0x0baf('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]){_0x56270e['attributes'][_0x0baf('0x4b')](function(_0x106ffa){_0x21f179[_0x0baf('0x61')]('i.'+_0x106ffa);});}else{_0x21f179['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x21f179['field'](_0x0baf('0xb2'),_0x0baf('0xb3'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xb4'),'Account.mandatoryDisposition');_0x21f179[_0x0baf('0x61')](_0x0baf('0xb5'),_0x0baf('0xa7'));_0x21f179['field'](_0x0baf('0xb6'));_0x21f179[_0x0baf('0x61')]('c.firstName',_0x0baf('0xb7'));_0x21f179['field'](_0x0baf('0xb8'),_0x0baf('0xb9'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xba'),'Contact.email');_0x21f179['field'](_0x0baf('0xbb'),'Contact.phone');_0x21f179[_0x0baf('0x61')](_0x0baf('0xbc'),_0x0baf('0xbd'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xbe'),'Contact.fax');_0x21f179[_0x0baf('0x61')]('o.fullname',_0x0baf('0xbf'));_0x21f179['field'](_0x0baf('0xc0'),'Owner.internal');_0x21f179[_0x0baf('0x61')](_0x0baf('0xc1'),_0x0baf('0x48'));}if(_0x56270e['limit'])_0x21f179['limit'](_0x56270e[_0x0baf('0x34')]);if(_0x56270e[_0x0baf('0x36')])_0x21f179[_0x0baf('0x36')](_0x56270e[_0x0baf('0x36')]);return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x21f179['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x5ee37f){if(_0x5ee37f[_0x0baf('0x59')]>0x0)_0x5f123c['where'](_0x0baf('0xc2'),_[_0x0baf('0x46')](_0x5ee37f,'id'));return db[_0x0baf('0xaf')]['query'](_0x5f123c[_0x0baf('0xb0')](),_0x2c2f09)[_0x0baf('0x24')](function(_0x4879b4){var _0x544498=_[_0x0baf('0xc3')](_0x4879b4,_0x0baf('0xc4'));var _0x20dd04=[];_0x5ee37f[_0x0baf('0x4b')](function(_0x4823a3){_0x20dd04['push'](updateChatInteraction(_0x4823a3,_0x3403d5,_0x544498));});return BPromise[_0x0baf('0xc5')](_0x20dd04);});});})[_0x0baf('0x24')](function(_0x116d52){_0x2bc755[_0x0baf('0xc6')]=_0x116d52;return _0x2bc755;})[_0x0baf('0x24')](respondWithFilteredResult(_0x355033,_0x56270e))[_0x0baf('0x2e')](handleError(_0x355033,null));};exports[_0x0baf('0xc7')]=function(_0xe0b67c,_0x205de6){var _0x2369f0={'raw':![],'where':{'id':_0xe0b67c[_0x0baf('0xc8')]['id']}},_0x58f95c={};_0x58f95c['model']=_[_0x0baf('0x54')](db[_0x0baf('0x4e')][_0x0baf('0xc9')]);_0x58f95c[_0x0baf('0x53')]=_['keys'](_0xe0b67c[_0x0baf('0x53')]);_0x58f95c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],_0x58f95c[_0x0baf('0x53')]);_0x2369f0[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0xe0b67c['query'][_0x0baf('0x58')]));_0x2369f0[_0x0baf('0x57')]=_0x2369f0['attributes'][_0x0baf('0x59')]?_0x2369f0[_0x0baf('0x57')]:_0x58f95c[_0x0baf('0x52')];if(_0xe0b67c[_0x0baf('0x53')][_0x0baf('0xca')]){_0x2369f0[_0x0baf('0xcb')]=[{'all':!![]}];}_0x2369f0=_[_0x0baf('0xb1')]({},_0x2369f0,_0xe0b67c[_0x0baf('0xcc')]);return db[_0x0baf('0x4e')]['find'](_0x2369f0)[_0x0baf('0x24')](handleEntityNotFound(_0x205de6,null))[_0x0baf('0x24')](respondWithResult(_0x205de6,null))[_0x0baf('0x2e')](handleError(_0x205de6,null));};exports[_0x0baf('0xcd')]=function(_0x4328d5,_0x270d69){return db['ChatInteraction'][_0x0baf('0xcd')](_0x4328d5[_0x0baf('0x40')],{})[_0x0baf('0x24')](respondWithResult(_0x270d69,0xc9))['catch'](handleError(_0x270d69,null));};exports['update']=function(_0x5adbd9,_0x1adb84){if(_0x5adbd9[_0x0baf('0x40')]['id']){delete _0x5adbd9['body']['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x5adbd9[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x1adb84,null))[_0x0baf('0x24')](saveUpdates(_0x5adbd9[_0x0baf('0x40')],null))['then'](respondWithResult(_0x1adb84,null))[_0x0baf('0x2e')](handleError(_0x1adb84,null));};exports[_0x0baf('0x3d')]=function(_0x25d25e,_0x4494de){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x25d25e[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4494de,null))[_0x0baf('0x24')](removeEntity(_0x4494de,null))[_0x0baf('0x2e')](handleError(_0x4494de,null));};exports[_0x0baf('0xce')]=function(_0x2e1629,_0x275cc4){return db[_0x0baf('0x4e')][_0x0baf('0xce')]()[_0x0baf('0x24')](respondWithResult(_0x275cc4,null))[_0x0baf('0x2e')](handleError(_0x275cc4,null));};exports[_0x0baf('0xcf')]=function(_0x308b3f,_0xae8bc2){var _0x1390cd=_0x308b3f[_0x0baf('0xc8')]['id'];var _0x59dd6c;var _0x57b64b;var _0x1cd215;return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x1390cd}})[_0x0baf('0x24')](function(_0x52e98a){_0x59dd6c=_0x52e98a;return db[_0x0baf('0xd1')][_0x0baf('0xd0')]({'where':{'id':_0x52e98a[_0x0baf('0x8d')]},'attributes':['id',_0x0baf('0xd2'),_0x0baf('0xd3'),_0x0baf('0xd4'),'vidaooNote',_0x0baf('0xd5')],'raw':!![]});})[_0x0baf('0x24')](function(_0x347c39){if(_0x347c39&&_0x347c39['vidaooApiKey']&&_0x347c39[_0x0baf('0xd3')]){_0x57b64b=_0x347c39;var _0x106c6e={'interaction':{'id':_0x1390cd},'agent':{'id':_0x308b3f[_0x0baf('0xab')]['id'],'name':_0x308b3f['user']['name'],'fullname':_0x308b3f['user'][_0x0baf('0x47')],'email':_0x308b3f['user'][_0x0baf('0xd6')]},'contact':_0x308b3f[_0x0baf('0x40')]['contact'],'account':_0x308b3f[_0x0baf('0x40')]['account']};var _0x5737b0={'rejectUnauthorized':![],'method':_0x0baf('0xd7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x347c39[_0x0baf('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x308b3f['user']['email']],'buttons':null,'topic':_0x57b64b['vidaooTopic'],'note':_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd9')])?null:getMustacheRender(_0x57b64b[_0x0baf('0xd9')],_0x106c6e),'metadata':null},'redirect':_0x0baf('0xda'),'json':!![]};try{if(!_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd5')])){var _0x20582a=getMustacheRender(_0x57b64b['vidaooMetadata'],_0x106c6e);var _0x36cd08=JSON[_0x0baf('0x90')](_0x20582a);_0x5737b0[_0x0baf('0x40')]['metadata']=_0x36cd08;}}catch(_0x24672f){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5737b0);}else{throw new db[(_0x0baf('0xdb'))]['ValidationError'](_0x0baf('0xdd'));}})[_0x0baf('0x24')](function(_0x57846e){_0x1cd215=_0x57846e;if(_0x1cd215['id']){var _0xd4ed40={'body':_0x1cd215[_0x0baf('0xde')],'ChatWebsiteId':_0x57b64b['id'],'ChatInteractionId':_0x59dd6c['id'],'direction':_0x0baf('0xdf'),'UserId':_0x308b3f[_0x0baf('0xab')]['id']};return db['ChatMessage'][_0x0baf('0xcd')](_0xd4ed40,{});}else{throw new db[(_0x0baf('0xdb'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x0baf('0x24')](function(){return _0x59dd6c[_0x0baf('0xe0')]({'vidaooSessionId':_0x1cd215['id']});})[_0x0baf('0x24')](respondWithResult(_0xae8bc2,null))[_0x0baf('0x2e')](handleError(_0xae8bc2,null));};exports['customUpdate']=function(_0x5571d4,_0x16579f){if(_0x5571d4[_0x0baf('0x40')]['id']){delete _0x5571d4[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x5571d4['params']['id']},'include':[{'model':db[_0x0baf('0xe1')],'as':_0x0baf('0x7b')}]})['then'](handleEntityNotFound(_0x16579f,null))[_0x0baf('0x24')](saveUpdates(_0x5571d4[_0x0baf('0x40')],null))['then'](respondWithResult(_0x16579f,null))[_0x0baf('0x2e')](handleError(_0x16579f,null));};exports[_0x0baf('0xe2')]=function(_0x19457c,_0x1f0b00,_0x2484d4){if(_0x19457c[_0x0baf('0x40')]['id']){delete _0x19457c[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x19457c[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](function(_0x226edd){if(!_0x226edd){logger[_0x0baf('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0baf('0xe2'),0x194,_0x0baf('0xe3'));_0x1f0b00['sendStatus'](0x194);}else{if(_0x226edd[_0x0baf('0x8a')]){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))](_0x0baf('0xe4'));}}return _0x226edd;})['then'](function(_0x3ca1a6){if(_0x3ca1a6){return _0x3ca1a6[_0x0baf('0x3c')]({'closed':_0x19457c[_0x0baf('0x40')][_0x0baf('0xe5')],'disposition':_0x19457c[_0x0baf('0x40')]['disposition']})[_0x0baf('0x24')](function(_0xc5ec1a){return _0xc5ec1a;});}})[_0x0baf('0x24')](function(_0x5d33b4){return respondWithRpcPromise(_0x0baf('0xe6'),_0x0baf('0xe2'),_0x19457c[_0x0baf('0x40')],client9004);})[_0x0baf('0x24')](respondWithResult(_0x1f0b00,null))[_0x0baf('0x2e')](handleError(_0x1f0b00,null));};exports['attachmentUpload']=function(_0x553084,_0x19898e,_0x315ada){_0x553084[_0x0baf('0x40')]['name']=_0x553084[_0x0baf('0xe7')][_0x0baf('0xe8')];_0x553084[_0x0baf('0x40')][_0x0baf('0xe9')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xea')];_0x553084[_0x0baf('0x40')][_0x0baf('0x50')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xeb')];return db['Attachment'][_0x0baf('0xcd')](_0x553084[_0x0baf('0x40')])[_0x0baf('0x24')](respondWithResult(_0x19898e,0xc9))[_0x0baf('0x2e')](handleError(_0x19898e,null));};exports['attachmentDownload']=function(_0x413d0d,_0x3d7667,_0x386928){return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0xc8')]['id']},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null))[_0x0baf('0x24')](function(_0x1e4bf1){if(_0x1e4bf1){if(_0x1e4bf1['closed']){return _0x3d7667[_0x0baf('0x30')](0x193)[_0x0baf('0x32')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0x53')][_0x0baf('0xec')]},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null));}})[_0x0baf('0x24')](function(_0xb22125){if(_0xb22125){var _0x37c83a=_0xb22125['ChatOfflineMessageId']!==null;var _0x5deb7b=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0xef'));if(_0x37c83a){_0x5deb7b=path['join'](_0x5deb7b,_0x0baf('0xf0'));}var _0x3a6bf8=path['join'](_0x5deb7b,_0xb22125[_0x0baf('0xe9')]);return _0x3d7667[_0x0baf('0xf1')](_0x3a6bf8);}})['catch'](handleError(_0x3d7667,null));};exports[_0x0baf('0xf2')]=function(_0x9d6974,_0x939365){var _0x4d6ac4=null;var _0x1d86c9=null;var _0x95fe84=null;var _0x2a7138=null;if(_0x9d6974[_0x0baf('0x40')]['id']){delete _0x9d6974[_0x0baf('0x40')]['id'];}if(_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]){_0x2a7138=path['join'](config[_0x0baf('0xee')],'server/files/chat/upload/',util[_0x0baf('0xf4')](_0x0baf('0xf5'),Date['now']()));_0x9d6974['body'][_0x0baf('0xf6')]=_0x2a7138;}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x9d6974['params']['id']},'include':[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'include':[{'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9')}]}]})[_0x0baf('0x24')](handleEntityNotFound(_0x939365,null))[_0x0baf('0x24')](saveUpdates(_0x9d6974[_0x0baf('0x40')],null))[_0x0baf('0x24')](function(_0x5f3691){if(_0x5f3691){_0x4d6ac4=_0x5f3691;return db['ChatWebsite'][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x8d')]}});}})['then'](function(_0x210047){if(_0x210047){_0x95fe84=_0x210047;return db[_0x0baf('0xe1')][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x80')]}});}})[_0x0baf('0x24')](function(_0x8806f9){if(_0x8806f9){_0x1d86c9=_0x8806f9;if(_0x2a7138){var _0x1cb69a=null;for(var _0x4bc31f=0x1;_0x4bc31f<_0x4d6ac4[_0x0baf('0xf8')]['length'];++_0x4bc31f){_0x1cb69a=_0x4d6ac4[_0x0baf('0xf8')][_0x4bc31f];var _0x32abf2=_0x1cb69a['UserId']?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');var _0x4759d5=_0x9d6974[_0x0baf('0x40')][_0x0baf('0xfd')]||util['format']('%s%d','Visitor',_0x1cb69a[_0x0baf('0x80')]);switch(_0x95fe84['agentIdentifier']){case _0x0baf('0xfe'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format']('%s%d',_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');break;case _0x0baf('0xff'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x100')]||_0x1cb69a[_0x0baf('0xf9')][_0x0baf('0x47')]:_0x0baf('0xfc');break;case _0x0baf('0x101'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x47')]:_0x0baf('0xfc');break;default:_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a['UserId']):_0x0baf('0xfc');}var _0xe93008=util[_0x0baf('0xf4')](_0x0baf('0x102'),moment(_0x1cb69a['createdAt'])['format'](_0x0baf('0x103')),_0x1cb69a[_0x0baf('0x104')]==='in'?_0x4759d5:_0x32abf2,_0x1cb69a['body']);if(!_0x1cb69a[_0x0baf('0x105')]){fs[_0x0baf('0x106')](_0x2a7138,_0xe93008);}}return db[_0x0baf('0x107')][_0x0baf('0xd0')]({'where':{'service':!![]},'include':[{'model':db[_0x0baf('0x108')],'as':'Smtp','raw':!![]}]});}}})[_0x0baf('0x24')](function(_0x1fe362){if(_0x1fe362&&_0x1fe362[_0x0baf('0x109')]&&_0x9d6974[_0x0baf('0x40')]){var _0x51287e={'tls':{'rejectUnauthorized':![]}};if(_0x1fe362[_0x0baf('0x109')]['service']){_0x51287e[_0x0baf('0x10a')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10a')];}else{_0x51287e['host']=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10b')];_0x51287e[_0x0baf('0x10c')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10c')];_0x51287e[_0x0baf('0x10d')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10d')];}if(_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10e')]){_0x51287e[_0x0baf('0x10f')]={'user':_0x1fe362[_0x0baf('0x109')]['user'],'pass':_0x1fe362['Smtp'][_0x0baf('0x110')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51287e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1fe362[_0x0baf('0x3f')],_0x1fe362[_0x0baf('0xd6')]||_0x1fe362['Smtp']['user']),'to':_0x9d6974['body']['mailTranscript'],'subject':_0x0baf('0x111'),'text':util['format'](_0x0baf('0x112'),_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]),'attachments':[{'path':_0x2a7138}]}})[_0x0baf('0x24')](function(){return _0x4d6ac4;})[_0x0baf('0x2e')](function(_0x292469){console[_0x0baf('0x2a')](_0x292469);});}else{return _0x4d6ac4;}})[_0x0baf('0x24')](respondWithStatusCode(_0x939365,0xc8))['catch'](handleError(_0x939365,null));};exports['addMessage']=function(_0x2d7ec3,_0x2a4d79,_0x5ebcad){return db[_0x0baf('0xf7')]['find']({'where':{'id':_0x2d7ec3[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x2a4d79,null))['then'](function(_0x4621ba){if(_0x4621ba){return _0x4621ba[_0x0baf('0x113')](_0x2d7ec3[_0x0baf('0x40')][_0x0baf('0x114')],_[_0x0baf('0x115')](_0x2d7ec3[_0x0baf('0x40')],[_0x0baf('0x114'),'id'])||{});}})[_0x0baf('0x24')](respondWithResult(_0x2a4d79,null))[_0x0baf('0x2e')](handleError(_0x2a4d79,null));};exports[_0x0baf('0x116')]=function(_0x425869,_0x4059e1,_0x2c94ff){var _0x738da0={'raw':![],'where':{}};var _0x268a1c={};var _0x34cb32={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x425869[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4059e1,null))[_0x0baf('0x24')](function(_0x39526b){if(_0x39526b){_0x268a1c['model']=_[_0x0baf('0x54')](db['ChatMessage'][_0x0baf('0xc9')]);_0x268a1c['query']=_[_0x0baf('0x54')](_0x425869['query']);_0x268a1c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],_0x268a1c[_0x0baf('0x53')]);_0x738da0['attributes']=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x425869[_0x0baf('0x53')]['fields']));_0x738da0['attributes']=_0x738da0[_0x0baf('0x57')][_0x0baf('0x59')]?_0x738da0[_0x0baf('0x57')]:_0x268a1c[_0x0baf('0x52')];if(!_0x425869['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x738da0[_0x0baf('0x34')]=qs['limit'](_0x425869['query'][_0x0baf('0x34')]);_0x738da0['offset']=qs[_0x0baf('0x36')](_0x425869['query'][_0x0baf('0x36')]);}_0x738da0[_0x0baf('0x5c')]=qs[_0x0baf('0x5d')](_0x425869['query'][_0x0baf('0x5d')]);_0x738da0[_0x0baf('0x5e')]=qs['filters'](_['pick'](_0x425869[_0x0baf('0x53')],_0x268a1c['filters']));_0x738da0[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x39526b['id'];if(_0x425869['query']['filter']){_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],{'$or':_[_0x0baf('0x46')](_0x738da0['attributes'],function(_0x309220){var _0x376eb3={};_0x376eb3[_0x309220]={'$like':'%'+_0x425869['query'][_0x0baf('0x9b')]+'%'};return _0x376eb3;})});}if(_0x425869[_0x0baf('0x53')][_0x0baf('0x91')]){var _0x2ef76b=_0x425869[_0x0baf('0x53')]['$gte'][_0x0baf('0x4a')](',');var _0x4ca9ea={};_0x4ca9ea[_0x2ef76b[0x0]]={'$gte':moment(_0x2ef76b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],_0x4ca9ea);}_0x738da0=_[_0x0baf('0xb1')]({},_0x738da0,_0x425869[_0x0baf('0xcc')]);return db['ChatMessage'][_0x0baf('0x35')]({'where':_0x738da0[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x3d6ece){_0x34cb32[_0x0baf('0x35')]=_0x3d6ece;if(_0x425869[_0x0baf('0x53')][_0x0baf('0xca')]){_0x738da0[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')][_0x0baf('0x117')](_0x738da0);})['then'](function(_0x19727f){_0x34cb32[_0x0baf('0xc6')]=_0x19727f;return _0x34cb32;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x4059e1,_0x738da0))[_0x0baf('0x2e')](handleError(_0x4059e1,null));};exports[_0x0baf('0x118')]=function(_0x57b26e,_0x3a0a2f,_0x5b676d){var _0x298155={'where':{}},_0xff9b69={},_0x5398c6={'count':0x0,'rows':[]};return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x57b26e[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x3a0a2f,null))['then'](function(_0x2edcf9){if(_0x2edcf9){_0xff9b69[_0x0baf('0x52')]=_[_0x0baf('0x54')](db[_0x0baf('0xf7')][_0x0baf('0xc9')]);_0xff9b69[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0x57b26e[_0x0baf('0x53')]);_0xff9b69[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],_0xff9b69[_0x0baf('0x53')]);_0x298155[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x58')]));_0x298155['attributes']=_0x298155[_0x0baf('0x57')][_0x0baf('0x59')]?_0x298155[_0x0baf('0x57')]:_0xff9b69[_0x0baf('0x52')];if(!_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x298155['limit']=qs[_0x0baf('0x34')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x34')]);_0x298155[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x298155['order']=qs[_0x0baf('0x5d')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5d')]);_0x298155[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0x57b26e['query'],_0xff9b69[_0x0baf('0x55')]));_0x298155[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x2edcf9['id'];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]){_0x298155['where']=_['merge'](_0x298155[_0x0baf('0x5e')],{'$or':_[_0x0baf('0x46')](_0x298155[_0x0baf('0x57')],function(_0x2d43ac){var _0x34126b={};_0x34126b[_0x2d43ac]={'$like':'%'+_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]+'%'};return _0x34126b;})});}_0x298155[_0x0baf('0x5e')][_0x0baf('0x105')]=![];if(_0x57b26e[_0x0baf('0x53')]['id']){_0x298155[_0x0baf('0x5e')]['id']={'$gt':_0x57b26e[_0x0baf('0x53')]['id']};}_0x298155=_[_0x0baf('0xb1')]({},_0x298155,_0x57b26e[_0x0baf('0xcc')]);return db[_0x0baf('0xf7')][_0x0baf('0x35')]({'where':_0x298155[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x18d219){_0x5398c6[_0x0baf('0x35')]=_0x18d219;_0x298155[_0x0baf('0xcb')]=[];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x119')]){_0x298155[_0x0baf('0xcb')][_0x0baf('0x4c')]({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id','fullname',_0x0baf('0x100')]});}if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0xca')]){_0x298155[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')]['findAll'](_0x298155);})[_0x0baf('0x24')](function(_0x344fef){_0x5398c6[_0x0baf('0xc6')]=_0x344fef;return _0x5398c6;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x3a0a2f,_0x298155))[_0x0baf('0x2e')](handleError(_0x3a0a2f,null));};exports[_0x0baf('0x11a')]=function(_0x3358f5,_0x237a20,_0x26dd4c){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x3358f5[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x237a20,null))[_0x0baf('0x24')](function(_0x2867b7){if(_0x2867b7){return _0x2867b7[_0x0baf('0x11b')](_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')],_['omit'](_0x3358f5[_0x0baf('0x40')],['ids','id'])||{})['spread'](function(){return db[_0x0baf('0x84')][_0x0baf('0x117')]({'attributes':['id',_0x0baf('0x3f'),'color'],'where':{'id':_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')]}});})[_0x0baf('0x24')](function(_0x24bc8f){socket[_0x0baf('0x11c')](_0x0baf('0x11d'),{'id':Number(_0x3358f5['params']['id']),'tags':_0x24bc8f||[]});return{'id':Number(_0x3358f5[_0x0baf('0xc8')]['id']),'tags':_0x24bc8f||[]};});}})[_0x0baf('0x24')](respondWithResult(_0x237a20,null))[_0x0baf('0x2e')](handleError(_0x237a20,null));};exports[_0x0baf('0x11e')]=function(_0x262063,_0x216897,_0x4c2bae){return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x262063[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x216897,null))['then'](function(_0x56da3e){if(_0x56da3e){return _0x56da3e[_0x0baf('0x11e')](_0x262063[_0x0baf('0x53')][_0x0baf('0x114')]);}})['then'](respondWithStatusCode(_0x216897,null))[_0x0baf('0x2e')](handleError(_0x216897,null));};exports[_0x0baf('0xf1')]=function(_0x51d2aa,_0x26d73d){var _0x20cc18=moment()[_0x0baf('0x11f')]()[_0x0baf('0xb0')]();var _0x3fa8eb=path[_0x0baf('0xed')](config[_0x0baf('0xee')],'server','files',_0x0baf('0x120'));var _0x1bd67f=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x122'),_0x0baf('0x123'));var _0x4316c5=path[_0x0baf('0xed')](_0x3fa8eb,_0x20cc18);var _0x1d5b73=util['format']('transcript-%d-%s.zip',_0x51d2aa[_0x0baf('0xc8')]['id'],_0x20cc18);var _0x2a84f8=path[_0x0baf('0xed')](_0x3fa8eb,_0x1d5b73);var _0x552504=[];_0x552504['push']({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id',_0x0baf('0x47')],'raw':!![]});_0x552504[_0x0baf('0x4c')]({'model':db['CmContact'],'as':_0x0baf('0x7b'),'attributes':['id',_0x0baf('0x124'),_0x0baf('0x125')],'raw':!![]});if(_0x51d2aa[_0x0baf('0x53')][_0x0baf('0x123')]){_0x552504[_0x0baf('0x4c')]({'model':db[_0x0baf('0x126')],'as':_0x0baf('0x126'),'raw':!![]});}var _0x5bbd33=[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'attributes':['id',_0x0baf('0x40'),_0x0baf('0x8f'),_0x0baf('0x104'),_0x0baf('0x105'),'read'],'include':_0x552504}];_0x5bbd33[_0x0baf('0x4c')]({'model':db[_0x0baf('0xd1')],'as':'Account','attributes':['id','name']});_0x5bbd33[_0x0baf('0x4c')]({'model':db['User'],'as':_0x0baf('0x127'),'attributes':['id',_0x0baf('0x47')]});return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x51d2aa['params']['id']},'include':_0x5bbd33})[_0x0baf('0x24')](handleEntityNotFound(_0x26d73d,null))[_0x0baf('0x24')](function(_0x32c2a8){if(_0x32c2a8){var _0x58fea2=_0x32c2a8[_0x0baf('0x128')]({'plain':!![]});fs[_0x0baf('0x129')](_0x4316c5);var _0x5f5d45={'channel':_0x0baf('0x12a'),'account':_0x58fea2['Account'][_0x0baf('0x3f')],'agent':_0x58fea2[_0x0baf('0x127')]?_0x58fea2[_0x0baf('0x127')][_0x0baf('0x47')]:'N.A.','createdAt':moment(_0x58fea2[_0x0baf('0x8f')])[_0x0baf('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0baf('0xb0')](),'closedAt':_0x58fea2[_0x0baf('0xe5')]?moment(_0x58fea2['closedAt'])[_0x0baf('0xf4')](_0x0baf('0x12b'))['toString']():'','disposition':_0x58fea2[_0x0baf('0x12c')],'chatInfo':{'browser':_0x58fea2[_0x0baf('0x12d')],'os':_0x58fea2[_0x0baf('0x12e')],'referer':_0x58fea2[_0x0baf('0x12f')],'customerIp':_0x58fea2[_0x0baf('0x130')],'customerPort':_0x58fea2[_0x0baf('0x131')]?_0x58fea2['customerPort']:_0x0baf('0x132')},'messages':_(_0x58fea2[_0x0baf('0xf8')])[_0x0baf('0x133')]()[_0x0baf('0x9b')]({'secret':![]})[_0x0baf('0x46')](function(_0x1ca912){if(_0x1ca912[_0x0baf('0x126')]){var _0x70e2e=path[_0x0baf('0xed')](_0x1bd67f,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')]);if(fs[_0x0baf('0x134')](_0x70e2e)){fs[_0x0baf('0x135')](_0x70e2e)[_0x0baf('0x136')](fs[_0x0baf('0x137')](path[_0x0baf('0xed')](_0x4316c5,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')])));}}return{'date':moment(_0x1ca912[_0x0baf('0x8f')])[_0x0baf('0xf4')](_0x0baf('0x12b'))[_0x0baf('0xb0')](),'sender':_0x1ca912['direction']===_0x0baf('0xdf')?_0x1ca912[_0x0baf('0xf9')]?_0x1ca912['User']['fullname']:'System':_0x1ca912[_0x0baf('0x7b')]['firstName']+(_0x1ca912['Contact']['lastName']?'\x20'+_0x1ca912[_0x0baf('0x7b')][_0x0baf('0x125')]:''),'body':_0x1ca912[_0x0baf('0x126')]?_0x1ca912['Attachment'][_0x0baf('0xe9')]:_0x1ca912['body'],'direction':_0x1ca912['direction']===_0x0baf('0xdf')?'A':'C','secret':_0x1ca912[_0x0baf('0x105')],'read':_0x1ca912[_0x0baf('0x96')],'attachment':_0x1ca912['Attachment']};})['value']()};return ejs[_0x0baf('0x138')](path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x139'),_0x0baf('0x13a')),{'interaction':_0x5f5d45})['then'](function(_0x4c1f01){var _0x217cd8=path[_0x0baf('0xed')](_0x4316c5,'transcript-'+_0x58fea2['id']+'-'+_0x20cc18+_0x0baf('0x13b'));var _0x223d32={'path':_0x217cd8,'channel':_0x0baf('0x12a'),'interactionId':_0x58fea2['id']};return pdf[_0x0baf('0x13c')](_0x4c1f01,_0x223d32);})['then'](function(){return new BPromise(function(_0xcca408,_0x557ec9){zipdir(_0x4316c5,{'saveTo':_0x2a84f8},function(_0x479231,_0x320409){if(_0x479231)return _0x557ec9(_0x479231);return _0xcca408(_0x320409);});})['then'](function(){return new BPromise(function(_0x4a0f32,_0xc6fc4d){rimraf(_0x4316c5,function(_0x46b904){if(_0x46b904)_0xc6fc4d(_0x46b904);return _0x4a0f32();});});})['then'](function(){return _0x26d73d[_0x0baf('0xf1')](_0x2a84f8,_0x1d5b73,function(_0x2dea20){if(_0x2dea20){console[_0x0baf('0x13d')](_0x0baf('0x13e'),_0x2dea20);}else{fs[_0x0baf('0x13f')](_0x2a84f8);}});});});}else{return _0x26d73d[_0x0baf('0x2f')](0xc8);}})['catch'](handleError(_0x26d73d,null));};
\ No newline at end of file
+var _0x66fa=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','contact','agent','interaction','TagIds','Tags','split','forEach','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','join_url','out','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','offline-chat/','join','basename','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','include','includeAgent','alias','addTags','setTags','findAll','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4772f7,_0x7ca703){var _0x13c46d=function(_0x3342b6){while(--_0x3342b6){_0x4772f7['push'](_0x4772f7['shift']());}};_0x13c46d(++_0x7ca703);}(_0x66fa,0x117));var _0xa66f=function(_0x55cf68,_0x49959b){_0x55cf68=_0x55cf68-0x0;var _0x1c5151=_0x66fa[_0x55cf68];return _0x1c5151;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa66f('0x19'));var client=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232b});var client9004=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x567d4f,_0x5510dc,_0x19b5ac,_0x32d338){return new BPromise(function(_0x295acf,_0x403f4d){var _0x5c67f5=_0x32d338||client;return _0x5c67f5[_0xa66f('0x1c')](_0x567d4f,_0x19b5ac)['then'](function(_0x4a28d4){logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));logger[_0xa66f('0x20')](_0xa66f('0x21'),_0x5510dc,_0xa66f('0x1f'),JSON[_0xa66f('0x22')](_0x4a28d4));if(_0x4a28d4[_0xa66f('0x23')]){if(_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x24')]===0x1f4){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x403f4d(_0x4a28d4[_0xa66f('0x23')]['message']);}logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x295acf(_0x4a28d4['error'][_0xa66f('0x25')]);}else{logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));_0x295acf(_0x4a28d4['result']['message']);}})[_0xa66f('0x26')](function(_0x598942){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x598942);_0x403f4d(_0x598942);});});}function respondWithStatusCode(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0xcc;return function(_0x4683c7){if(_0x4683c7){return _0x384164[_0xa66f('0x27')](_0x57da7f);}return _0x384164[_0xa66f('0x28')](_0x57da7f)[_0xa66f('0x29')]();};}function respondWithResult(_0x17c103,_0x236046){_0x236046=_0x236046||0xc8;return function(_0x1eb86a){if(_0x1eb86a){return _0x17c103[_0xa66f('0x28')](_0x236046)[_0xa66f('0x2a')](_0x1eb86a);}};}function respondWithFilteredResult(_0x117d03,_0x45f71c){return function(_0x63650b){if(_0x63650b){var _0x42b966=typeof _0x45f71c[_0xa66f('0x2b')]==='undefined'&&typeof _0x45f71c['limit']===_0xa66f('0x2c');var _0x27ceae=_0x63650b['count'];var _0x44c79a=_0x42b966?0x0:_0x45f71c[_0xa66f('0x2b')];var _0x4cd7f2=_0x42b966?_0x63650b[_0xa66f('0x2d')]:_0x45f71c[_0xa66f('0x2b')]+_0x45f71c[_0xa66f('0x2e')];var _0x2c2ace;if(_0x4cd7f2>=_0x27ceae){_0x4cd7f2=_0x27ceae;_0x2c2ace=0xc8;}else{_0x2c2ace=0xce;}_0x117d03[_0xa66f('0x28')](_0x2c2ace);return _0x117d03['set'](_0xa66f('0x2f'),_0x44c79a+'-'+_0x4cd7f2+'/'+_0x27ceae)['json'](_0x63650b);}return null;};}function patchUpdates(_0x306b35){return function(_0x35a0a7){try{jsonpatch[_0xa66f('0x30')](_0x35a0a7,_0x306b35,!![]);}catch(_0x486e4e){return BPromise[_0xa66f('0x31')](_0x486e4e);}return _0x35a0a7[_0xa66f('0x32')]();};}function saveUpdates(_0x4f1668,_0x1a5d4a){return function(_0x35a847){if(_0x35a847){return _0x35a847[_0xa66f('0x33')](_0x4f1668)[_0xa66f('0x34')](function(_0x10a782){return _0x10a782;});}return null;};}function removeEntity(_0x2452d2,_0x25c74c){return function(_0x41303c){if(_0x41303c){return _0x41303c[_0xa66f('0x35')]()[_0xa66f('0x34')](function(){_0x2452d2['status'](0xcc)[_0xa66f('0x29')]();});}};}function handleEntityNotFound(_0x5bf736,_0x1c7eda){return function(_0x46f6cc){if(!_0x46f6cc){_0x5bf736[_0xa66f('0x27')](0x194);}return _0x46f6cc;};}function handleError(_0x3b9261,_0x3722d3){_0x3722d3=_0x3722d3||0x1f4;return function(_0x201432){logger[_0xa66f('0x23')](_0x201432[_0xa66f('0x36')]);if(_0x201432['name']){delete _0x201432[_0xa66f('0x37')];}_0x3b9261['status'](_0x3722d3)[_0xa66f('0x38')](_0x201432);};}function getMustacheRender(_0x45eeb8,_0x2ed1fb){return Mustache['render'](_0x45eeb8,_['merge'](_0x2ed1fb[_0xa66f('0x39')],{'contact':_0x2ed1fb[_0xa66f('0x3a')],'message':_0x2ed1fb[_0xa66f('0x25')],'agent':_0x2ed1fb[_0xa66f('0x3b')],'interaction':_0x2ed1fb[_0xa66f('0x3c')],'account':_0x2ed1fb['account']}))||'';}function getInteractionUsers(_0x5cb0a9,_0x49b869){return new BPromise(function(_0x30f7de,_0x4aeeb4){try{if(_0x49b869[_0x5cb0a9['id']]){_0x5cb0a9['Users']=_['map'](_0x49b869[_0x5cb0a9['id']],function(_0x5fdc3e){return{'id':_0x5fdc3e['id'],'fullname':_0x5fdc3e['fullname']};});}}catch(_0x8965d3){_0x4aeeb4(_0x8965d3);}_0x30f7de(_0x5cb0a9);});}function getInteractionTags(_0x17d942,_0x23a546){return new BPromise(function(_0x1647a0,_0xd65c5d){try{if(_0x17d942[_0xa66f('0x3d')]){_0x17d942[_0xa66f('0x3e')]=[];_0x17d942[_0xa66f('0x3d')][_0xa66f('0x3f')](',')[_0xa66f('0x40')](function(_0x3a7929){_0x17d942[_0xa66f('0x3e')][_0xa66f('0x41')](_0x23a546[_0x3a7929]);});}delete _0x17d942[_0xa66f('0x3d')];}catch(_0x4f01b9){_0xd65c5d(_0x4f01b9);}_0x1647a0(_0x17d942);});}function updateChatInteraction(_0x36037c,_0x25c2cb,_0x58c1f2){return new BPromise(function(_0x248587,_0x4b6e6b){return getInteractionUsers(_0x36037c,_0x58c1f2)[_0xa66f('0x34')](function(_0x27adf4){return getInteractionTags(_0x27adf4,_0x25c2cb);})['then'](function(_0x1ddd2f){_0x248587(_0x1ddd2f);})[_0xa66f('0x26')](function(_0x2126e8){_0x4b6e6b(_0x2126e8);});});}exports['index']=function(_0x394b1e,_0x5cdfe2){var _0x276cd5={},_0x33ed23={},_0xb52cc6={'count':0x0,'rows':[]};var _0x3a499e=_[_0xa66f('0x42')](db[_0xa66f('0x43')][_0xa66f('0x44')],function(_0x50cc47){return{'name':_0x50cc47[_0xa66f('0x45')],'type':_0x50cc47[_0xa66f('0x46')][_0xa66f('0x47')]};});_0x33ed23[_0xa66f('0x48')]=_[_0xa66f('0x42')](_0x3a499e,'name');_0x33ed23['query']=_[_0xa66f('0x49')](_0x394b1e[_0xa66f('0x4a')]);_0x33ed23[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],_0x33ed23[_0xa66f('0x4a')]);_0x276cd5['attributes']=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x394b1e['query']['fields']));_0x276cd5[_0xa66f('0x4e')]=_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x276cd5['attributes']:_0x33ed23['model'];if(!_0x394b1e['query'][_0xa66f('0x50')](_0xa66f('0x51'))){_0x276cd5[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x2e')]);_0x276cd5[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x394b1e['query'][_0xa66f('0x2b')]);}_0x276cd5[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x276cd5[_0xa66f('0x54')]=qs['filters'](_[_0xa66f('0x55')](_0x394b1e[_0xa66f('0x4a')],_0x33ed23[_0xa66f('0x4b')]),_0x3a499e);var _0x13848d=[];var _0x20d6be=squel['select']()[_0xa66f('0x56')]('id')['field'](_0xa66f('0x37'))['field']('color')[_0xa66f('0x57')](_0xa66f('0x58'));var _0x12271d=squel[_0xa66f('0x59')]()[_0xa66f('0x56')](_0xa66f('0x5a'))['field'](_0xa66f('0x5b'))[_0xa66f('0x56')](_0xa66f('0x5c'))[_0xa66f('0x57')]('user_has_chat_interactions','ui')[_0xa66f('0x5d')]('users','u',_0xa66f('0x5e'));var _0x10fc75=squel[_0xa66f('0x59')]()[_0xa66f('0x57')](_0xa66f('0x5f'),'i')[_0xa66f('0x5d')](_0xa66f('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa66f('0x5d')](_0xa66f('0x61'),'o',_0xa66f('0x62'))[_0xa66f('0x5d')](_0xa66f('0x63'),'a',_0xa66f('0x64'))[_0xa66f('0x5d')](_0xa66f('0x65'),'me',_0xa66f('0x66'))['left_join']('chat_interaction_has_tags','it',_0xa66f('0x67'))[_0xa66f('0x5d')](_0xa66f('0x58'),'t',_0xa66f('0x68'));var _0x2f1f1e=squel[_0xa66f('0x69')]();var _0x8bea2b=[];var _0x4b10cf=squel[_0xa66f('0x69')]();var _0x11c89e;if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]){_0x11c89e=as['parseSearch'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]);var _0x19ff30=_0x11c89e[_0xa66f('0x6b')];for(var _0x19f4b5=0x0;_0x19f4b5<_0x11c89e[_0xa66f('0x6c')]['length'];_0x19f4b5++){var _0x4b31f7=_0x11c89e[_0xa66f('0x6c')][_0x19f4b5];var _0x31b81b='i';var _0x174aad=_['find'](_0x3a499e,[_0xa66f('0x37'),_0x4b31f7[_0xa66f('0x56')]]);if(!_0x174aad){switch(_0x4b31f7[_0xa66f('0x56')]){case _0xa66f('0x6d'):if(_0x4b31f7[_0xa66f('0x6e')]==0x1){_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7[_0xa66f('0x56')]+_0xa66f('0x70'));}else{_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7['field']+_0xa66f('0x71'));}break;case _0xa66f('0x72'):if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){if(_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')]('\x20')[_0xa66f('0x4f')]>0x1){_0x2f1f1e[_0x19ff30](_0xa66f('0x75'),qs['getFullTextValue'](_0x4b31f7['value']),null);}else{var _0x46327d='%'+_0x4b31f7[_0xa66f('0x6e')]+'%';_0x2f1f1e[_0x19ff30](_0xa66f('0x76'),_0x46327d,_0x46327d,_0x46327d);}}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),'ContactId']);_0x4b31f7[_0xa66f('0x56')]='ContactId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x7a'):var _0x46ea11=_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')](',')[_0xa66f('0x42')](function(_0x2bdb18){return Number(_0x2bdb18);});_0x46ea11[_0xa66f('0x40')](function(_0x36b92f){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x36b92f+',%');});_0x8bea2b=_[_0xa66f('0x7c')](_0x8bea2b,_0x46ea11);break;case'User':if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){_0x2f1f1e[_0x19ff30](_0xa66f('0x7d'),'%'+_0x4b31f7[_0xa66f('0x6e')]+'%',null);}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),_0xa66f('0x7e')]);_0x4b31f7[_0xa66f('0x56')]='UserId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x39'):_0x53b01b=as['buildExpression']('me',null,_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b['text'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')]['end']);break;}}else{var _0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}}}else{var _0x1d4642=_(_0x394b1e[_0xa66f('0x4a')])[_0xa66f('0x49')]()[_0xa66f('0x42')](function(_0x218128){return _[_0xa66f('0x80')](_0x3a499e,['name',_0x218128])?_0x218128:undefined;})[_0xa66f('0x81')]()[_0xa66f('0x6e')]();if(!_['isEmpty'](_0x1d4642)){_0x1d4642['forEach'](function(_0x183155){if(_0x183155===_0xa66f('0x82')){_0x10fc75['where'](_0xa66f('0x83'),[]['concat'](_0x394b1e[_0xa66f('0x4a')][_0x183155]));}else if(_0x183155==='createdAt'){var _0x4feda0=JSON['parse'](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x84')];var _0x1f05bb=JSON[_0xa66f('0x85')](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x86')];_0x10fc75[_0xa66f('0x54')](_0xa66f('0x87'),_0x4feda0,_0x1f05bb);}else{if(_0x394b1e[_0xa66f('0x4a')][_0x183155]===_0xa66f('0x88')){_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x89'));}else{_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x8a'),_0x394b1e[_0xa66f('0x4a')][_0x183155]);}}});}if(_0x394b1e[_0xa66f('0x4a')]['read']){if(_0x394b1e[_0xa66f('0x4a')]['read']==0x1){_0x10fc75[_0xa66f('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x10fc75[_0xa66f('0x6f')](_0xa66f('0x8b'));}}if(_0x394b1e[_0xa66f('0x4a')]['tag']){_0x8bea2b=_['isArray'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')])?_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]:new Array(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]);_0x8bea2b[_0xa66f('0x40')](function(_0x578bff){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x578bff+',%');});}if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')]){var _0x4426d2=_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')][_0xa66f('0x8e')]('\x5c','\x5c\x5c')[_0xa66f('0x8e')](/'/g,'\x27\x27');if(qs[_0xa66f('0x8f')](_0x4426d2)){_0x2f1f1e['or'](_0xa66f('0x90'),_0x4426d2+'%');}else{_0x2f1f1e['or'](_0xa66f('0x91'),qs[_0xa66f('0x92')](_0x4426d2))['or'](_0xa66f('0x93'),_0x4426d2+'%');}}}_0x10fc75['where'](_0x2f1f1e);_0x10fc75[_0xa66f('0x94')](_0xa66f('0x95'));var _0x34ebfd={'type':db[_0xa66f('0x96')][_0xa66f('0x97')][_0xa66f('0x98')],'raw':!![]};var _0x3058aa=_0x10fc75[_0xa66f('0x99')]();_0x3058aa[_0xa66f('0x56')]('i.id');_0x3058aa[_0xa66f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x6d'));if(_0x276cd5['order']){_0x276cd5[_0xa66f('0x52')]['forEach'](function(_0x298bd8){var _0x5a1750=_0x298bd8[0x0]===_0xa66f('0x9a')?_0x298bd8[0x0]:'i.'+_0x298bd8[0x0];_0x10fc75[_0xa66f('0x52')](_0x5a1750,_0x298bd8[0x1]===_0xa66f('0x9b')?![]:!![]);});}if(!_[_0xa66f('0x9c')](_0x8bea2b)){_0x10fc75[_0xa66f('0x6f')](_0x4b10cf);_0x3058aa[_0xa66f('0x54')]('t.id\x20IN\x20?',_0x8bea2b);}BPromise[_0xa66f('0x9d')]()[_0xa66f('0x34')](function(){if(!_0x11c89e){if(_0x394b1e[_0xa66f('0x4a')]['ChatWebsiteId'])return;_0x3058aa[_0xa66f('0x54')](_0xa66f('0x9e'));_0x10fc75['where'](_0xa66f('0x9e'));return;}if(_0x394b1e[_0xa66f('0x9f')]['role']!=='agent')return;return _0x394b1e[_0xa66f('0x9f')][_0xa66f('0xa0')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x34')](function(_0x2929fe){if(_[_0xa66f('0x9c')](_0x2929fe)){_0x3058aa['where'](_0xa66f('0xa1'));_0x10fc75[_0xa66f('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3058aa[_0xa66f('0x54')](_0xa66f('0x83'),_['map'](_0x2929fe,'id'));_0x10fc75[_0xa66f('0x54')](_0xa66f('0x83'),_[_0xa66f('0x42')](_0x2929fe,'id'));}});})[_0xa66f('0x34')](function(){if(_0x394b1e[_0xa66f('0x9f')]['role']===_0xa66f('0x3b')&&!_0x11c89e&&!_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x82')])return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x3058aa[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x2b2c54){_0xb52cc6[_0xa66f('0x2d')]=_0x2b2c54[_0xa66f('0x4f')];if(_0xb52cc6[_0xa66f('0x2d')]===0x0)return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x20d6be[_0xa66f('0xa3')](),_0x34ebfd)['then'](function(_0x5ec355){_0x13848d=_[_0xa66f('0xa4')](_0x5ec355,'id');_0x34ebfd=_['merge'](_0x34ebfd,{'model':db[_0xa66f('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394b1e[_0xa66f('0x4a')]['fields']){_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x40')](function(_0x3f84f9){_0x10fc75['field']('i.'+_0x3f84f9);});}else{_0x10fc75['field'](_0xa66f('0xa5'),'unreadMessages');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa6'),_0xa66f('0xa7'));_0x10fc75['field'](_0xa66f('0xa8'),'Account.mandatoryDisposition');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa9'),_0xa66f('0x9a'));_0x10fc75[_0xa66f('0x56')]('i.*');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xaa'),_0xa66f('0xab'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xac'),_0xa66f('0xad'));_0x10fc75['field'](_0xa66f('0xae'),_0xa66f('0xaf'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb0'),_0xa66f('0xb1'));_0x10fc75['field']('c.mobile',_0xa66f('0xb2'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb3'),_0xa66f('0xb4'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb5'),_0xa66f('0xb6'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb7'),_0xa66f('0xb8'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb9'),'TagIds');}if(_0x276cd5[_0xa66f('0x2e')])_0x10fc75[_0xa66f('0x2e')](_0x276cd5['limit']);if(_0x276cd5[_0xa66f('0x2b')])_0x10fc75[_0xa66f('0x2b')](_0x276cd5[_0xa66f('0x2b')]);return db['sequelize']['query'](_0x10fc75[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x3520e1){if(_0x3520e1[_0xa66f('0x4f')]>0x0)_0x12271d['where'](_0xa66f('0xba'),_[_0xa66f('0x42')](_0x3520e1,'id'));return db['sequelize'][_0xa66f('0x4a')](_0x12271d[_0xa66f('0xa3')](),_0x34ebfd)[_0xa66f('0x34')](function(_0x176b30){var _0x4bc36d=_['groupBy'](_0x176b30,_0xa66f('0xbb'));var _0xdd2d09=[];_0x3520e1[_0xa66f('0x40')](function(_0x1bab2b){_0xdd2d09[_0xa66f('0x41')](updateChatInteraction(_0x1bab2b,_0x13848d,_0x4bc36d));});return BPromise[_0xa66f('0xbc')](_0xdd2d09);});});})[_0xa66f('0x34')](function(_0xac0e98){_0xb52cc6[_0xa66f('0xbd')]=_0xac0e98;return _0xb52cc6;})[_0xa66f('0x34')](respondWithFilteredResult(_0x5cdfe2,_0x276cd5))['catch'](handleError(_0x5cdfe2,null));};exports['show']=function(_0x1d472d,_0x3cbbb6){var _0x3cf40f={'raw':![],'where':{'id':_0x1d472d[_0xa66f('0xbe')]['id']}},_0x4298ca={};_0x4298ca['model']=_[_0xa66f('0x49')](db[_0xa66f('0x43')][_0xa66f('0x44')]);_0x4298ca['query']=_['keys'](_0x1d472d['query']);_0x4298ca[_0xa66f('0x4b')]=_['intersection'](_0x4298ca[_0xa66f('0x48')],_0x4298ca[_0xa66f('0x4a')]);_0x3cf40f[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x4298ca['model'],qs[_0xa66f('0x4d')](_0x1d472d[_0xa66f('0x4a')]['fields']));_0x3cf40f[_0xa66f('0x4e')]=_0x3cf40f[_0xa66f('0x4e')]['length']?_0x3cf40f['attributes']:_0x4298ca[_0xa66f('0x48')];if(_0x1d472d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3cf40f['include']=[{'all':!![]}];}_0x3cf40f=_['merge']({},_0x3cf40f,_0x1d472d['options']);return db['ChatInteraction'][_0xa66f('0x77')](_0x3cf40f)[_0xa66f('0x34')](handleEntityNotFound(_0x3cbbb6,null))[_0xa66f('0x34')](respondWithResult(_0x3cbbb6,null))[_0xa66f('0x26')](handleError(_0x3cbbb6,null));};exports[_0xa66f('0xc0')]=function(_0x46c9b2,_0x580eb7){return db[_0xa66f('0x43')][_0xa66f('0xc0')](_0x46c9b2[_0xa66f('0x39')],{})[_0xa66f('0x34')](respondWithResult(_0x580eb7,0xc9))['catch'](handleError(_0x580eb7,null));};exports['update']=function(_0xd78ede,_0xe11c2d){if(_0xd78ede[_0xa66f('0x39')]['id']){delete _0xd78ede[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd78ede[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0xe11c2d,null))[_0xa66f('0x34')](saveUpdates(_0xd78ede[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0xe11c2d,null))['catch'](handleError(_0xe11c2d,null));};exports[_0xa66f('0x35')]=function(_0x597ae3,_0x1b93e0){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x597ae3[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x1b93e0,null))['then'](removeEntity(_0x1b93e0,null))['catch'](handleError(_0x1b93e0,null));};exports['describe']=function(_0x484c8e,_0x728faa){return db[_0xa66f('0x43')][_0xa66f('0xc1')]()[_0xa66f('0x34')](respondWithResult(_0x728faa,null))['catch'](handleError(_0x728faa,null));};exports[_0xa66f('0xc2')]=function(_0x174510,_0x4f3985){var _0x348e6b=_0x174510[_0xa66f('0xbe')]['id'];var _0x4ed950;var _0xe43d63;var _0x3c2367;return db['ChatInteraction'][_0xa66f('0xc3')]({'where':{'id':_0x348e6b}})[_0xa66f('0x34')](function(_0x32bea5){_0x4ed950=_0x32bea5;return db[_0xa66f('0xc4')][_0xa66f('0xc3')]({'where':{'id':_0x32bea5[_0xa66f('0x82')]},'attributes':['id',_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'),_0xa66f('0xc8'),_0xa66f('0xc9')],'raw':!![]});})['then'](function(_0x4c8386){if(_0x4c8386&&_0x4c8386[_0xa66f('0xc5')]&&_0x4c8386[_0xa66f('0xc6')]){_0xe43d63=_0x4c8386;var _0x12278e={'interaction':{'id':_0x348e6b},'agent':{'id':_0x174510['user']['id'],'name':_0x174510['user'][_0xa66f('0x37')],'fullname':_0x174510[_0xa66f('0x9f')][_0xa66f('0xca')],'email':_0x174510[_0xa66f('0x9f')][_0xa66f('0xcb')]},'contact':_0x174510['body'][_0xa66f('0x3a')],'account':_0x174510[_0xa66f('0x39')][_0xa66f('0xcc')]};var _0xfc01d7={'rejectUnauthorized':![],'method':'POST','url':_0xa66f('0xcd'),'headers':{'X-APIKEY':_0x4c8386[_0xa66f('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x174510['user'][_0xa66f('0xcb')]],'buttons':null,'topic':_0xe43d63[_0xa66f('0xc7')],'note':_['isNull'](_0xe43d63[_0xa66f('0xc8')])?null:getMustacheRender(_0xe43d63[_0xa66f('0xc8')],_0x12278e),'metadata':null},'redirect':_0xa66f('0xce'),'json':!![]};try{if(!_[_0xa66f('0xcf')](_0xe43d63[_0xa66f('0xc9')])){var _0x3c73cc=getMustacheRender(_0xe43d63[_0xa66f('0xc9')],_0x12278e);var _0x4885bb=JSON['parse'](_0x3c73cc);_0xfc01d7[_0xa66f('0x39')][_0xa66f('0xd0')]=_0x4885bb;}}catch(_0x2e7c26){throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xfc01d7);}else{throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa66f('0x34')](function(_0x56198a){_0x3c2367=_0x56198a;if(_0x3c2367['id']){var _0x41ef9a={'body':_0x3c2367[_0xa66f('0xd2')],'ChatWebsiteId':_0xe43d63['id'],'ChatInteractionId':_0x4ed950['id'],'direction':_0xa66f('0xd3'),'UserId':_0x174510[_0xa66f('0x9f')]['id']};return db['ChatMessage']['create'](_0x41ef9a,{});}else{throw new db['Sequelize'][(_0xa66f('0xd1'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa66f('0x34')](function(){return _0x4ed950['updateAttributes']({'vidaooSessionId':_0x3c2367['id']});})[_0xa66f('0x34')](respondWithResult(_0x4f3985,null))[_0xa66f('0x26')](handleError(_0x4f3985,null));};exports['customUpdate']=function(_0x35a2ce,_0x2d3bca){if(_0x35a2ce[_0xa66f('0x39')]['id']){delete _0x35a2ce[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x35a2ce[_0xa66f('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xa66f('0x72')}]})[_0xa66f('0x34')](handleEntityNotFound(_0x2d3bca,null))[_0xa66f('0x34')](saveUpdates(_0x35a2ce[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0x2d3bca,null))[_0xa66f('0x26')](handleError(_0x2d3bca,null));};exports[_0xa66f('0xd4')]=function(_0x3a2c2c,_0x179953,_0x5dcf9d){if(_0x3a2c2c[_0xa66f('0x39')]['id']){delete _0x3a2c2c['body']['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x3a2c2c[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](function(_0x1f4bc4){if(!_0x1f4bc4){logger['error'](_0xa66f('0xd5'),_0xa66f('0xd4'),0x194,_0xa66f('0xd6'));_0x179953[_0xa66f('0x27')](0x194);}else{if(_0x1f4bc4['UserId']){throw new db['Sequelize']['ValidationError'](_0xa66f('0xd7'));}}return _0x1f4bc4;})[_0xa66f('0x34')](function(_0x4be9ae){if(_0x4be9ae){return _0x4be9ae['update']({'closed':_0x3a2c2c[_0xa66f('0x39')][_0xa66f('0xd8')],'disposition':_0x3a2c2c['body'][_0xa66f('0xd9')]})[_0xa66f('0x34')](function(_0x17dc7d){return _0x17dc7d;});}})[_0xa66f('0x34')](function(_0x551c09){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3a2c2c[_0xa66f('0x39')],client9004);})[_0xa66f('0x34')](respondWithResult(_0x179953,null))[_0xa66f('0x26')](handleError(_0x179953,null));};exports[_0xa66f('0xda')]=function(_0x377764,_0x434764,_0x315b27){_0x377764[_0xa66f('0x39')]['name']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdc')];_0x377764[_0xa66f('0x39')]['basename']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdd')];_0x377764[_0xa66f('0x39')]['type']=_0x377764['file'][_0xa66f('0xde')];return db[_0xa66f('0xdf')][_0xa66f('0xc0')](_0x377764[_0xa66f('0x39')])[_0xa66f('0x34')](respondWithResult(_0x434764,0xc9))[_0xa66f('0x26')](handleError(_0x434764,null));};exports[_0xa66f('0xe0')]=function(_0x5c5550,_0x383ce6,_0x4b2702){return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550[_0xa66f('0xbe')]['id']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null))[_0xa66f('0x34')](function(_0x32f7ab){if(_0x32f7ab){if(_0x32f7ab[_0xa66f('0xd8')]){return _0x383ce6[_0xa66f('0x28')](0x193)[_0xa66f('0x2a')]({'status':0x193,'message':_0xa66f('0xe1')});}return db[_0xa66f('0xdf')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550['query']['attachId']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null));}})[_0xa66f('0x34')](function(_0x29ce7f){if(_0x29ce7f){var _0x1248c9=_0x29ce7f[_0xa66f('0xe2')]!==null;var _0x13948a=path['join'](config[_0xa66f('0xe3')],'server/files/attachments/');if(_0x1248c9){_0x13948a=path['join'](_0x13948a,_0xa66f('0xe4'));}var _0x1ce936=path[_0xa66f('0xe5')](_0x13948a,_0x29ce7f[_0xa66f('0xe6')]);return _0x383ce6['download'](_0x1ce936);}})[_0xa66f('0x26')](handleError(_0x383ce6,null));};exports[_0xa66f('0xe7')]=function(_0x1686df,_0x1889f4){var _0x2a03c8=null;var _0x48b16d=null;var _0x5a05e4=null;var _0x1b78fa=null;if(_0x1686df[_0xa66f('0x39')]['id']){delete _0x1686df[_0xa66f('0x39')]['id'];}if(_0x1686df[_0xa66f('0x39')]['mailTranscript']){_0x1b78fa=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0xe8'),util[_0xa66f('0xe9')](_0xa66f('0xea'),Date[_0xa66f('0xeb')]()));_0x1686df[_0xa66f('0x39')][_0xa66f('0xec')]=_0x1b78fa;}return db['ChatInteraction'][_0xa66f('0x77')]({'where':{'id':_0x1686df[_0xa66f('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66f('0xed'),'include':[{'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee')}]}]})[_0xa66f('0x34')](handleEntityNotFound(_0x1889f4,null))[_0xa66f('0x34')](saveUpdates(_0x1686df['body'],null))[_0xa66f('0x34')](function(_0x4153a0){if(_0x4153a0){_0x2a03c8=_0x4153a0;return db[_0xa66f('0xc4')][_0xa66f('0x77')]({'where':{'id':_0x2a03c8[_0xa66f('0x82')]}});}})['then'](function(_0x820ac1){if(_0x820ac1){_0x5a05e4=_0x820ac1;return db[_0xa66f('0xef')]['find']({'where':{'id':_0x2a03c8[_0xa66f('0xf0')]}});}})[_0xa66f('0x34')](function(_0x22d154){if(_0x22d154){_0x48b16d=_0x22d154;if(_0x1b78fa){var _0x31959f=null;for(var _0x2d3123=0x1;_0x2d3123<_0x2a03c8['Messages'][_0xa66f('0x4f')];++_0x2d3123){_0x31959f=_0x2a03c8[_0xa66f('0xed')][_0x2d3123];var _0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f['UserId']):_0xa66f('0xf3');var _0x19fabd=_0x1686df[_0xa66f('0x39')][_0xa66f('0xf4')]||util['format'](_0xa66f('0xf1'),_0xa66f('0xf5'),_0x31959f['ContactId']);switch(_0x5a05e4[_0xa66f('0xf6')]){case _0xa66f('0xf7'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f[_0xa66f('0x7e')]):'System';break;case _0xa66f('0xf8'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f['User']['alias']||_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:'System';break;case _0xa66f('0xf9'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3');break;default:_0x207ea2=_0x31959f['UserId']?util[_0xa66f('0xe9')](_0xa66f('0xf1'),_0x5a05e4['agentAlias'],_0x31959f[_0xa66f('0x7e')]):'System';}var _0x506797=util[_0xa66f('0xe9')](_0xa66f('0xfa'),moment(_0x31959f['createdAt'])[_0xa66f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x31959f[_0xa66f('0xfb')]==='in'?_0x19fabd:_0x207ea2,_0x31959f[_0xa66f('0x39')]);if(!_0x31959f['secret']){fs['appendFileSync'](_0x1b78fa,_0x506797);}}return db['MailAccount'][_0xa66f('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xa66f('0xfc')],'as':_0xa66f('0xfd'),'raw':!![]}]});}}})[_0xa66f('0x34')](function(_0x168d31){if(_0x168d31&&_0x168d31[_0xa66f('0xfd')]&&_0x1686df[_0xa66f('0x39')]){var _0x5a762d={'tls':{'rejectUnauthorized':![]}};if(_0x168d31['Smtp'][_0xa66f('0xfe')]){_0x5a762d[_0xa66f('0xfe')]=_0x168d31[_0xa66f('0xfd')][_0xa66f('0xfe')];}else{_0x5a762d[_0xa66f('0xff')]=_0x168d31[_0xa66f('0xfd')]['host'];_0x5a762d[_0xa66f('0x100')]=_0x168d31[_0xa66f('0xfd')]['port'];_0x5a762d[_0xa66f('0x101')]=_0x168d31['Smtp'][_0xa66f('0x101')];}if(_0x168d31['Smtp']['authentication']){_0x5a762d[_0xa66f('0x102')]={'user':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x9f')],'pass':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x103')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5a762d,'message':{'from':util[_0xa66f('0xe9')](_0xa66f('0x104'),_0x168d31[_0xa66f('0x37')],_0x168d31['email']||_0x168d31['Smtp']['user']),'to':_0x1686df[_0xa66f('0x39')][_0xa66f('0x105')],'subject':_0xa66f('0x106'),'text':util[_0xa66f('0xe9')](_0xa66f('0x107'),_0x1686df[_0xa66f('0x39')]['mailTranscript']),'attachments':[{'path':_0x1b78fa}]}})[_0xa66f('0x34')](function(){return _0x2a03c8;})[_0xa66f('0x26')](function(_0x3215af){console['error'](_0x3215af);});}else{return _0x2a03c8;}})[_0xa66f('0x34')](respondWithStatusCode(_0x1889f4,0xc8))[_0xa66f('0x26')](handleError(_0x1889f4,null));};exports['addMessage']=function(_0x4e4b66,_0x2aaaab,_0x75d882){return db[_0xa66f('0x108')][_0xa66f('0x77')]({'where':{'id':_0x4e4b66['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x2aaaab,null))[_0xa66f('0x34')](function(_0x21e1d1){if(_0x21e1d1){return _0x21e1d1[_0xa66f('0x109')](_0x4e4b66[_0xa66f('0x39')]['ids'],_[_0xa66f('0x10a')](_0x4e4b66[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{});}})['then'](respondWithResult(_0x2aaaab,null))[_0xa66f('0x26')](handleError(_0x2aaaab,null));};exports[_0xa66f('0x10c')]=function(_0x53170d,_0x5d1e51,_0x3c3aff){var _0x3fb295={'raw':![],'where':{}};var _0x57c403={};var _0x31832f={'count':0x0,'rows':[]};return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x53170d[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5d1e51,null))[_0xa66f('0x34')](function(_0x43cc99){if(_0x43cc99){_0x57c403['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x57c403['query']=_['keys'](_0x53170d[_0xa66f('0x4a')]);_0x57c403[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],_0x57c403[_0xa66f('0x4a')]);_0x3fb295['attributes']=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],qs['fields'](_0x53170d['query']['fields']));_0x3fb295[_0xa66f('0x4e')]=_0x3fb295[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x3fb295['attributes']:_0x57c403[_0xa66f('0x48')];if(!_0x53170d[_0xa66f('0x4a')][_0xa66f('0x50')]('nolimit')){_0x3fb295[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x53170d[_0xa66f('0x4a')]['limit']);_0x3fb295[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x3fb295[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x3fb295['where']=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x53170d[_0xa66f('0x4a')],_0x57c403[_0xa66f('0x4b')]));_0x3fb295[_0xa66f('0x54')][_0xa66f('0xbb')]=_0x43cc99['id'];if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]){_0x3fb295[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x3fb295[_0xa66f('0x54')],{'$or':_[_0xa66f('0x42')](_0x3fb295[_0xa66f('0x4e')],function(_0x2b9a3c){var _0x1d688a={};_0x1d688a[_0x2b9a3c]={'$like':'%'+_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x1d688a;})});}if(_0x53170d['query'][_0xa66f('0x84')]){var _0x570a01=_0x53170d['query']['$gte'][_0xa66f('0x3f')](',');var _0x35919e={};_0x35919e[_0x570a01[0x0]]={'$gte':moment(_0x570a01[0x1])[_0xa66f('0xe9')](_0xa66f('0x10e'))};_0x3fb295[_0xa66f('0x54')]=_['merge'](_0x3fb295[_0xa66f('0x54')],_0x35919e);}_0x3fb295=_['merge']({},_0x3fb295,_0x53170d[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x3fb295['where']})[_0xa66f('0x34')](function(_0x3517eb){_0x31832f[_0xa66f('0x2d')]=_0x3517eb;if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3fb295['include']=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x3fb295);})[_0xa66f('0x34')](function(_0x24c209){_0x31832f[_0xa66f('0xbd')]=_0x24c209;return _0x31832f;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x5d1e51,_0x3fb295))[_0xa66f('0x26')](handleError(_0x5d1e51,null));};exports[_0xa66f('0x110')]=function(_0x1ef4c2,_0x21ec7f,_0x32b1c1){var _0x4ee9a3={'where':{}},_0x12889f={},_0xc813ad={'count':0x0,'rows':[]};return db[_0xa66f('0x43')]['findOne']({'where':{'id':_0x1ef4c2['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x21ec7f,null))[_0xa66f('0x34')](function(_0x3a1e4a){if(_0x3a1e4a){_0x12889f['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x12889f[_0xa66f('0x4a')]=_[_0xa66f('0x49')](_0x1ef4c2[_0xa66f('0x4a')]);_0x12889f[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],_0x12889f[_0xa66f('0x4a')]);_0x4ee9a3[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x1ef4c2[_0xa66f('0x4a')]['fields']));_0x4ee9a3[_0xa66f('0x4e')]=_0x4ee9a3[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x4ee9a3[_0xa66f('0x4e')]:_0x12889f['model'];if(!_0x1ef4c2[_0xa66f('0x4a')]['hasOwnProperty'](_0xa66f('0x51'))){_0x4ee9a3[_0xa66f('0x2e')]=qs['limit'](_0x1ef4c2['query'][_0xa66f('0x2e')]);_0x4ee9a3[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x4ee9a3[_0xa66f('0x52')]=qs['sort'](_0x1ef4c2['query']['sort']);_0x4ee9a3[_0xa66f('0x54')]=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x1ef4c2[_0xa66f('0x4a')],_0x12889f[_0xa66f('0x4b')]));_0x4ee9a3['where'][_0xa66f('0xbb')]=_0x3a1e4a['id'];if(_0x1ef4c2['query'][_0xa66f('0x8d')]){_0x4ee9a3[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x4ee9a3['where'],{'$or':_['map'](_0x4ee9a3[_0xa66f('0x4e')],function(_0x2bf349){var _0x211ac6={};_0x211ac6[_0x2bf349]={'$like':'%'+_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x211ac6;})});}_0x4ee9a3[_0xa66f('0x54')]['secret']=![];if(_0x1ef4c2[_0xa66f('0x4a')]['id']){_0x4ee9a3['where']['id']={'$gt':_0x1ef4c2['query']['id']};}_0x4ee9a3=_[_0xa66f('0x10d')]({},_0x4ee9a3,_0x1ef4c2[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x4ee9a3['where']})['then'](function(_0x533dc1){_0xc813ad[_0xa66f('0x2d')]=_0x533dc1;_0x4ee9a3[_0xa66f('0x111')]=[];if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x112')]){_0x4ee9a3[_0xa66f('0x111')][_0xa66f('0x41')]({'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca'),_0xa66f('0x113')]});}if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x4ee9a3[_0xa66f('0x111')]=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x4ee9a3);})['then'](function(_0x554ba6){_0xc813ad[_0xa66f('0xbd')]=_0x554ba6;return _0xc813ad;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x21ec7f,_0x4ee9a3))[_0xa66f('0x26')](handleError(_0x21ec7f,null));};exports[_0xa66f('0x114')]=function(_0x1a3bac,_0x44649c,_0x5e4fbc){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x1a3bac[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x44649c,null))[_0xa66f('0x34')](function(_0x1d2967){if(_0x1d2967){return _0x1d2967[_0xa66f('0x115')](_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')],_[_0xa66f('0x10a')](_0x1a3bac[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{})['spread'](function(){return db[_0xa66f('0x7a')][_0xa66f('0x116')]({'attributes':['id','name',_0xa66f('0x117')],'where':{'id':_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')]}});})['then'](function(_0x367549){socket[_0xa66f('0x118')](_0xa66f('0x119'),{'id':Number(_0x1a3bac['params']['id']),'tags':_0x367549||[]});return{'id':Number(_0x1a3bac[_0xa66f('0xbe')]['id']),'tags':_0x367549||[]};});}})[_0xa66f('0x34')](respondWithResult(_0x44649c,null))[_0xa66f('0x26')](handleError(_0x44649c,null));};exports[_0xa66f('0x11a')]=function(_0x4a1613,_0x324b7e,_0x1d3395){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x4a1613[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x324b7e,null))[_0xa66f('0x34')](function(_0x33f1ea){if(_0x33f1ea){return _0x33f1ea[_0xa66f('0x11a')](_0x4a1613[_0xa66f('0x4a')]['ids']);}})[_0xa66f('0x34')](respondWithStatusCode(_0x324b7e,null))['catch'](handleError(_0x324b7e,null));};exports[_0xa66f('0x11b')]=function(_0xd7dccf,_0x2b4238){var _0x321fa1=moment()['unix']()['toString']();var _0x254599=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),_0xa66f('0x11d'),_0xa66f('0x11e'));var _0x3b9ff3=path['join'](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'files',_0xa66f('0x11f'));var _0x5206a5=path['join'](_0x254599,_0x321fa1);var _0x6b60bd=util[_0xa66f('0xe9')](_0xa66f('0x120'),_0xd7dccf['params']['id'],_0x321fa1);var _0x3709b6=path['join'](_0x254599,_0x6b60bd);var _0x21bda3=[];_0x21bda3[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca')],'raw':!![]});_0x21bda3[_0xa66f('0x41')]({'model':db[_0xa66f('0xef')],'as':_0xa66f('0x72'),'attributes':['id',_0xa66f('0x121'),_0xa66f('0x122')],'raw':!![]});if(_0xd7dccf['query'][_0xa66f('0x11f')]){_0x21bda3[_0xa66f('0x41')]({'model':db['Attachment'],'as':_0xa66f('0xdf'),'raw':!![]});}var _0x22e7a6=[{'model':db[_0xa66f('0x108')],'as':_0xa66f('0xed'),'attributes':['id',_0xa66f('0x39'),_0xa66f('0x123'),_0xa66f('0xfb'),_0xa66f('0x124'),_0xa66f('0x125')],'include':_0x21bda3}];_0x22e7a6[_0xa66f('0x41')]({'model':db[_0xa66f('0xc4')],'as':_0xa66f('0x126'),'attributes':['id','name']});_0x22e7a6[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0x127'),'attributes':['id',_0xa66f('0xca')]});return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd7dccf[_0xa66f('0xbe')]['id']},'include':_0x22e7a6})[_0xa66f('0x34')](handleEntityNotFound(_0x2b4238,null))[_0xa66f('0x34')](function(_0x5efd6c){if(_0x5efd6c){var _0x24ee72=_0x5efd6c['get']({'plain':!![]});fs[_0xa66f('0x128')](_0x5206a5);var _0xdbb792={'channel':_0xa66f('0x129'),'account':_0x24ee72['Account'][_0xa66f('0x37')],'agent':_0x24ee72[_0xa66f('0x127')]?_0x24ee72['Owner']['fullname']:_0xa66f('0x12a'),'createdAt':moment(_0x24ee72[_0xa66f('0x123')])[_0xa66f('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0xa3')](),'closedAt':_0x24ee72[_0xa66f('0xd8')]?moment(_0x24ee72[_0xa66f('0x12b')])['format'](_0xa66f('0x10e'))[_0xa66f('0xa3')]():'','disposition':_0x24ee72[_0xa66f('0xd9')],'chatInfo':{'browser':_0x24ee72[_0xa66f('0x12c')],'os':_0x24ee72[_0xa66f('0x12d')],'referer':_0x24ee72['referer'],'customerIp':_0x24ee72[_0xa66f('0x12e')],'customerPort':_0x24ee72[_0xa66f('0x12f')]?_0x24ee72[_0xa66f('0x12f')]:_0xa66f('0x12a')},'messages':_(_0x24ee72[_0xa66f('0xed')])[_0xa66f('0x130')]()['filter']({'secret':![]})[_0xa66f('0x42')](function(_0x31cc20){if(_0x31cc20['Attachment']){var _0x10a611=path[_0xa66f('0xe5')](_0x3b9ff3,_0x31cc20['Attachment'][_0xa66f('0xe6')]);if(fs[_0xa66f('0x131')](_0x10a611)){fs[_0xa66f('0x132')](_0x10a611)['pipe'](fs[_0xa66f('0x133')](path['join'](_0x5206a5,_0x31cc20['Attachment']['basename'])));}}return{'date':moment(_0x31cc20['createdAt'])['format'](_0xa66f('0x10e'))['toString'](),'sender':_0x31cc20[_0xa66f('0xfb')]===_0xa66f('0xd3')?_0x31cc20[_0xa66f('0xee')]?_0x31cc20[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3'):_0x31cc20[_0xa66f('0x72')][_0xa66f('0x121')]+(_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]?'\x20'+_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]:''),'body':_0x31cc20[_0xa66f('0xdf')]?_0x31cc20[_0xa66f('0xdf')][_0xa66f('0xe6')]:_0x31cc20[_0xa66f('0x39')],'direction':_0x31cc20[_0xa66f('0xfb')]==='out'?'A':'C','secret':_0x31cc20['secret'],'read':_0x31cc20[_0xa66f('0x125')],'attachment':_0x31cc20[_0xa66f('0xdf')]};})[_0xa66f('0x6e')]()};return ejs[_0xa66f('0x134')](path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'views',_0xa66f('0x135')),{'interaction':_0xdbb792})['then'](function(_0x12024d){var _0x4baf59=path[_0xa66f('0xe5')](_0x5206a5,_0xa66f('0x136')+_0x24ee72['id']+'-'+_0x321fa1+'.pdf');var _0x33198c={'path':_0x4baf59,'channel':_0xa66f('0x129'),'interactionId':_0x24ee72['id']};return pdf[_0xa66f('0x137')](_0x12024d,_0x33198c);})[_0xa66f('0x34')](function(){return new BPromise(function(_0x3792b2,_0x5101f8){zipdir(_0x5206a5,{'saveTo':_0x3709b6},function(_0x4ac4b4,_0x171111){if(_0x4ac4b4)return _0x5101f8(_0x4ac4b4);return _0x3792b2(_0x171111);});})[_0xa66f('0x34')](function(){return new BPromise(function(_0x46691d,_0x136518){rimraf(_0x5206a5,function(_0x1404df){if(_0x1404df)_0x136518(_0x1404df);return _0x46691d();});});})[_0xa66f('0x34')](function(){return _0x2b4238[_0xa66f('0x11b')](_0x3709b6,_0x6b60bd,function(_0x58f445){if(_0x58f445){console[_0xa66f('0x138')](_0xa66f('0x139'),_0x58f445);}else{fs['unlinkSync'](_0x3709b6);}});});});}else{return _0x2b4238[_0xa66f('0x27')](0xc8);}})['catch'](handleError(_0x2b4238,null));};
\ No newline at end of file
index 2b2eeb7..243fce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe892=['ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','Users','map','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe892,0x14e));var _0x2e89=function(_0x54931b,_0x1764a8){_0x54931b=_0x54931b-0x0;var _0x430239=_0xe892[_0x54931b];return _0x430239;};'use strict';var EventEmitter=require(_0x2e89('0x0'));var ChatInteraction=require(_0x2e89('0x1'))['db'][_0x2e89('0x2')];var ChatMessage=require(_0x2e89('0x1'))['db'][_0x2e89('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2e89('0x4')](0x0);var events={'afterCreate':_0x2e89('0x5'),'afterUpdate':_0x2e89('0x6'),'afterDestroy':'remove'};function emitEvent(_0xfdd3){return function(_0x2227c0,_0x4f7400,_0x520fc2){_0x2227c0[_0x2e89('0x7')]({'attributes':['id'],'raw':!![]})[_0x2e89('0x8')](function(_0x210981){_0x2227c0['setDataValue'](_0x2e89('0x9'),_0x210981[_0x2e89('0xa')](function(_0x262b0b){return{'id':_0x262b0b['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2227c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2e89('0x8')](function(_0x3fabd7){_0x2227c0['setDataValue'](_0x2e89('0xb'),_0x3fabd7['length']);ChatInteractionEvents[_0x2e89('0xc')](_0xfdd3+':'+_0x2227c0['id'],_0x2227c0);ChatInteractionEvents['emit'](_0xfdd3,_0x2227c0);_0x520fc2(null);})['catch'](_0x520fc2(null));};}for(var e in events){if(events[_0x2e89('0xd')](e)){var event=events[e];ChatInteraction[_0x2e89('0xe')](e,emitEvent(event));}}module[_0x2e89('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xca31=['save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatMessage','setMaxListeners'];(function(_0x56f552,_0x374061){var _0x21a33a=function(_0x38a83d){while(--_0x38a83d){_0x56f552['push'](_0x56f552['shift']());}};_0x21a33a(++_0x374061);}(_0xca31,0xd5));var _0x1ca3=function(_0x129259,_0x3c39ec){_0x129259=_0x129259-0x0;var _0x110f34=_0xca31[_0x129259];return _0x110f34;};'use strict';var EventEmitter=require(_0x1ca3('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x1ca3('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1ca3('0x2')](0x0);var events={'afterCreate':_0x1ca3('0x3'),'afterUpdate':_0x1ca3('0x4'),'afterDestroy':_0x1ca3('0x5')};function emitEvent(_0x75f7a3){return function(_0x341fae,_0x4e3bbc,_0x4df219){_0x341fae[_0x1ca3('0x6')]({'attributes':['id'],'raw':!![]})[_0x1ca3('0x7')](function(_0x4f131e){_0x341fae[_0x1ca3('0x8')]('Users',_0x4f131e[_0x1ca3('0x9')](function(_0x158da0){return{'id':_0x158da0['id']};}));return ChatMessage[_0x1ca3('0xa')]({'where':{'ChatInteractionId':_0x341fae['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1ca3('0x7')](function(_0x39469b){_0x341fae[_0x1ca3('0x8')](_0x1ca3('0xb'),_0x39469b[_0x1ca3('0xc')]);ChatInteractionEvents[_0x1ca3('0xd')](_0x75f7a3+':'+_0x341fae['id'],_0x341fae);ChatInteractionEvents[_0x1ca3('0xd')](_0x75f7a3,_0x341fae);_0x4df219(null);})[_0x1ca3('0xe')](_0x4df219(null));};}for(var e in events){if(events[_0x1ca3('0xf')](e)){var event=events[e];ChatInteraction[_0x1ca3('0x10')](e,emitEvent(event));}}module[_0x1ca3('0x11')]=ChatInteractionEvents;
\ No newline at end of file
index c827f7d..ac984a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8b2=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x1743bf,_0x15cf86){var _0x9cfb15=function(_0x261bb9){while(--_0x261bb9){_0x1743bf['push'](_0x1743bf['shift']());}};_0x9cfb15(++_0x15cf86);}(_0xa8b2,0x6a));var _0x2a8b=function(_0x4028eb,_0x33ee6a){_0x4028eb=_0x4028eb-0x0;var _0x4edcac=_0xa8b2[_0x4028eb];return _0x4edcac;};'use strict';var _=require(_0x2a8b('0x0'));var util=require(_0x2a8b('0x1'));var logger=require(_0x2a8b('0x2'))(_0x2a8b('0x3'));var moment=require(_0x2a8b('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a8b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a8b('0x6'));var config=require(_0x2a8b('0x7'));var attributes=require(_0x2a8b('0x8'));module[_0x2a8b('0x9')]=function(_0x448d28,_0x295cc7){return _0x448d28[_0x2a8b('0xa')](_0x2a8b('0xb'),attributes,{'tableName':_0x2a8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39b69a,_0x2758a8,_0x5f1cd5){if(_0x39b69a[_0x2a8b('0xd')](_0x2a8b('0xe'))){_0x39b69a[_0x2a8b('0xf')]=moment()[_0x2a8b('0x10')](_0x2a8b('0x11'));}_0x5f1cd5(null,_0x39b69a);}},'charset':_0x2a8b('0x12'),'collate':_0x2a8b('0x13')});};
\ No newline at end of file
+var _0xec4f=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed'];(function(_0x1962a7,_0x14784d){var _0x2a7571=function(_0x278c1d){while(--_0x278c1d){_0x1962a7['push'](_0x1962a7['shift']());}};_0x2a7571(++_0x14784d);}(_0xec4f,0x1cc));var _0xfec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec4f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfec4('0x0'));var util=require(_0xfec4('0x1'));var logger=require(_0xfec4('0x2'))('api');var moment=require(_0xfec4('0x3'));var BPromise=require(_0xfec4('0x4'));var rp=require(_0xfec4('0x5'));var fs=require('fs');var path=require(_0xfec4('0x6'));var rimraf=require(_0xfec4('0x7'));var config=require(_0xfec4('0x8'));var attributes=require(_0xfec4('0x9'));module[_0xfec4('0xa')]=function(_0xc2a126,_0x256c15){return _0xc2a126[_0xfec4('0xb')](_0xfec4('0xc'),attributes,{'tableName':_0xfec4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5fea63,_0x404b37,_0x162402){if(_0x5fea63['changed'](_0xfec4('0xe'))){_0x5fea63[_0xfec4('0xf')]=moment()[_0xfec4('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x162402(null,_0x5fea63);}},'charset':_0xfec4('0x11'),'collate':_0xfec4('0x12')});};
\ No newline at end of file
index fce71a3..8570ef2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b01=['./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatInteraction','body','options','raw','attributes','limit','UpdateChatInteraction','find','where','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x58850c,_0x510e14){var _0x1e098f=function(_0x146958){while(--_0x146958){_0x58850c['push'](_0x58850c['shift']());}};_0x1e098f(++_0x510e14);}(_0x7b01,0x1e7));var _0x17b0=function(_0xd71937,_0x4cfdae){_0xd71937=_0xd71937-0x0;var _0x37bf48=_0x7b01[_0xd71937];return _0x37bf48;};'use strict';var _=require(_0x17b0('0x0'));var util=require(_0x17b0('0x1'));var moment=require(_0x17b0('0x2'));var BPromise=require(_0x17b0('0x3'));var rs=require(_0x17b0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17b0('0x5'))['db'];var utils=require(_0x17b0('0x6'));var logger=require(_0x17b0('0x7'))(_0x17b0('0x8'));var config=require(_0x17b0('0x9'));var jayson=require(_0x17b0('0xa'));var client=jayson[_0x17b0('0xb')][_0x17b0('0xc')]({'port':0x232a});config[_0x17b0('0xd')]=_[_0x17b0('0xe')](config[_0x17b0('0xd')],{'host':_0x17b0('0xf'),'port':0x18eb});var socket=require(_0x17b0('0x10'))(new Redis(config[_0x17b0('0xd')]));require(_0x17b0('0x11'))['register'](socket);function respondWithRpcPromise(_0x5188e1,_0x3a6499,_0x2c07d3){return new BPromise(function(_0x521e97,_0x4db91a){return client['request'](_0x5188e1,_0x2c07d3)[_0x17b0('0x12')](function(_0x1ac9dd){logger[_0x17b0('0x13')](_0x17b0('0x14'),_0x3a6499,_0x17b0('0x15'));logger[_0x17b0('0x16')](_0x17b0('0x17'),_0x3a6499,_0x17b0('0x15'),JSON[_0x17b0('0x18')](_0x1ac9dd));if(_0x1ac9dd[_0x17b0('0x19')]){if(_0x1ac9dd[_0x17b0('0x19')][_0x17b0('0x1a')]===0x1f4){logger[_0x17b0('0x19')](_0x17b0('0x14'),_0x3a6499,_0x1ac9dd[_0x17b0('0x19')]['message']);return _0x4db91a(_0x1ac9dd['error'][_0x17b0('0x1b')]);}logger[_0x17b0('0x19')](_0x17b0('0x14'),_0x3a6499,_0x1ac9dd[_0x17b0('0x19')][_0x17b0('0x1b')]);return _0x521e97(_0x1ac9dd[_0x17b0('0x19')][_0x17b0('0x1b')]);}else{logger[_0x17b0('0x13')](_0x17b0('0x14'),_0x3a6499,'request\x20sent');_0x521e97(_0x1ac9dd['result']['message']);}})[_0x17b0('0x1c')](function(_0x2384c2){logger[_0x17b0('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x3a6499,_0x2384c2);_0x4db91a(_0x2384c2);});});}exports['UpdateChatInteraction']=function(_0x39ad1c){var _0x589d30=this;return new Promise(function(_0x1831a5,_0x17ab3a){return db[_0x17b0('0x1d')]['update'](_0x39ad1c[_0x17b0('0x1e')],{'raw':_0x39ad1c['options']?_0x39ad1c[_0x17b0('0x1f')][_0x17b0('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39ad1c['options']?_0x39ad1c[_0x17b0('0x1f')]['where']||null:null,'attributes':_0x39ad1c['options']?_0x39ad1c[_0x17b0('0x1f')][_0x17b0('0x21')]||null:null,'limit':_0x39ad1c['options']?_0x39ad1c['options'][_0x17b0('0x22')]||null:null})[_0x17b0('0x12')](function(_0x5174fe){logger['info'](_0x17b0('0x23'),_0x39ad1c);logger['debug'](_0x17b0('0x23'),_0x39ad1c,JSON['stringify'](_0x5174fe));_0x1831a5(_0x5174fe);})[_0x17b0('0x1c')](function(_0x2c86af){logger['error'](_0x17b0('0x23'),_0x2c86af[_0x17b0('0x1b')],_0x39ad1c);_0x17ab3a(_0x589d30[_0x17b0('0x19')](0x1f4,_0x2c86af[_0x17b0('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x230e51){return new Promise(function(_0x42e2ab,_0x540b7c){return db[_0x17b0('0x1d')][_0x17b0('0x24')]({'where':_0x230e51[_0x17b0('0x1f')]?_0x230e51[_0x17b0('0x1f')][_0x17b0('0x25')]||null:null})['then'](function(_0x187cb1){if(_0x187cb1){return _0x187cb1['addTags'](_0x230e51['body'][_0x17b0('0x26')],_[_0x17b0('0x27')](_0x230e51['body'],[_0x17b0('0x26'),'id'])||{});}})[_0x17b0('0x28')](function(_0x52fa56){logger[_0x17b0('0x13')]('AddTags',_0x230e51);logger['debug'](_0x17b0('0x29'),_0x230e51,JSON[_0x17b0('0x18')](_0x52fa56));_0x42e2ab(_0x52fa56);})[_0x17b0('0x1c')](function(_0x4e5930){logger[_0x17b0('0x19')](_0x17b0('0x29'),_0x4e5930[_0x17b0('0x1b')],_0x230e51);_0x540b7c(_this['error'](0x1f4,_0x4e5930[_0x17b0('0x1b')]));});});};
\ No newline at end of file
+var _0xc8f8=['find','then','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter','redis','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','AddTagsToChatInteraction'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xc8f8,0xcf));var _0x8c8f=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xc8f8[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x8c8f('0x0'));var util=require('util');var moment=require(_0x8c8f('0x1'));var BPromise=require(_0x8c8f('0x2'));var rs=require(_0x8c8f('0x3'));var fs=require('fs');var Redis=require(_0x8c8f('0x4'));var db=require(_0x8c8f('0x5'))['db'];var utils=require(_0x8c8f('0x6'));var logger=require(_0x8c8f('0x7'))(_0x8c8f('0x8'));var config=require(_0x8c8f('0x9'));var jayson=require(_0x8c8f('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x8c8f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8c8f('0xc'))(new Redis(config[_0x8c8f('0xd')]));require('./chatInteraction.socket')[_0x8c8f('0xe')](socket);function respondWithRpcPromise(_0x36e20a,_0x4c35e4,_0x1b1391){return new BPromise(function(_0x20eca8,_0x279527){return client[_0x8c8f('0xf')](_0x36e20a,_0x1b1391)['then'](function(_0xbf8cad){logger[_0x8c8f('0x10')](_0x8c8f('0x11'),_0x4c35e4,'request\x20sent');logger[_0x8c8f('0x12')](_0x8c8f('0x13'),_0x4c35e4,'request\x20sent',JSON[_0x8c8f('0x14')](_0xbf8cad));if(_0xbf8cad['error']){if(_0xbf8cad[_0x8c8f('0x15')]['code']===0x1f4){logger['error'](_0x8c8f('0x11'),_0x4c35e4,_0xbf8cad['error'][_0x8c8f('0x16')]);return _0x279527(_0xbf8cad['error'][_0x8c8f('0x16')]);}logger[_0x8c8f('0x15')](_0x8c8f('0x11'),_0x4c35e4,_0xbf8cad[_0x8c8f('0x15')][_0x8c8f('0x16')]);return _0x20eca8(_0xbf8cad[_0x8c8f('0x15')][_0x8c8f('0x16')]);}else{logger['info'](_0x8c8f('0x11'),_0x4c35e4,_0x8c8f('0x17'));_0x20eca8(_0xbf8cad['result'][_0x8c8f('0x16')]);}})[_0x8c8f('0x18')](function(_0x2903fc){logger[_0x8c8f('0x15')](_0x8c8f('0x11'),_0x4c35e4,_0x2903fc);_0x279527(_0x2903fc);});});}exports[_0x8c8f('0x19')]=function(_0x2f09fd){var _0x131d06=this;return new Promise(function(_0x6afd41,_0x36bb19){return db[_0x8c8f('0x1a')][_0x8c8f('0x1b')](_0x2f09fd[_0x8c8f('0x1c')],{'raw':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd['options'][_0x8c8f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd[_0x8c8f('0x1d')][_0x8c8f('0x1f')]||null:null,'attributes':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd[_0x8c8f('0x1d')]['attributes']||null:null,'limit':_0x2f09fd[_0x8c8f('0x1d')]?_0x2f09fd['options']['limit']||null:null})['then'](function(_0x274e25){logger[_0x8c8f('0x10')](_0x8c8f('0x19'),_0x2f09fd);logger[_0x8c8f('0x12')]('UpdateChatInteraction',_0x2f09fd,JSON[_0x8c8f('0x14')](_0x274e25));_0x6afd41(_0x274e25);})[_0x8c8f('0x18')](function(_0x2270f9){logger[_0x8c8f('0x15')](_0x8c8f('0x19'),_0x2270f9['message'],_0x2f09fd);_0x36bb19(_0x131d06[_0x8c8f('0x15')](0x1f4,_0x2270f9['message']));});});};exports[_0x8c8f('0x20')]=function(_0x41e386){return new Promise(function(_0xc5bed1,_0x321144){return db[_0x8c8f('0x1a')][_0x8c8f('0x21')]({'where':_0x41e386[_0x8c8f('0x1d')]?_0x41e386[_0x8c8f('0x1d')][_0x8c8f('0x1f')]||null:null})[_0x8c8f('0x22')](function(_0x1f8cd8){if(_0x1f8cd8){return _0x1f8cd8[_0x8c8f('0x23')](_0x41e386[_0x8c8f('0x1c')][_0x8c8f('0x24')],_[_0x8c8f('0x25')](_0x41e386[_0x8c8f('0x1c')],[_0x8c8f('0x24'),'id'])||{});}})[_0x8c8f('0x26')](function(_0x2f825b){logger[_0x8c8f('0x10')](_0x8c8f('0x27'),_0x41e386);logger[_0x8c8f('0x12')](_0x8c8f('0x27'),_0x41e386,JSON[_0x8c8f('0x14')](_0x2f825b));_0xc5bed1(_0x2f825b);})['catch'](function(_0x2c8630){logger[_0x8c8f('0x15')](_0x8c8f('0x27'),_0x2c8630[_0x8c8f('0x16')],_0x41e386);_0x321144(_this[_0x8c8f('0x15')](0x1f4,_0x2c8630[_0x8c8f('0x16')]));});});};
\ No newline at end of file
index 5d3a3c8..41b253a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c3d=['update','emit','register','length','chatInteraction:'];(function(_0x4a85a6,_0x2bda1c){var _0x5b7080=function(_0xc4b84e){while(--_0xc4b84e){_0x4a85a6['push'](_0x4a85a6['shift']());}};_0x5b7080(++_0x2bda1c);}(_0x0c3d,0x1a9));var _0xd0c3=function(_0x46fc6c,_0x297637){_0x46fc6c=_0x46fc6c-0x0;var _0x18694f=_0x0c3d[_0x46fc6c];return _0x18694f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0xd0c3('0x0')];function createListener(_0x44b970,_0x9a6a5d){return function(_0x442cbb){_0x9a6a5d[_0xd0c3('0x1')](_0x44b970,_0x442cbb);};}function removeListener(_0x449ee8,_0x4b2dc8){return function(){ChatInteractionEvents['removeListener'](_0x449ee8,_0x4b2dc8);};}exports[_0xd0c3('0x2')]=function(_0x500509){for(var _0x26c0b6=0x0,_0x4c03f1=events[_0xd0c3('0x3')];_0x26c0b6<_0x4c03f1;_0x26c0b6++){var _0x151886=events[_0x26c0b6];var _0x34d71e=createListener(_0xd0c3('0x4')+_0x151886,_0x500509);ChatInteractionEvents['on'](_0x151886,_0x34d71e);}};
\ No newline at end of file
+var _0x9daa=['remove','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events','save'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9daa,0x146));var _0xa9da=function(_0x28430d,_0x45523a){_0x28430d=_0x28430d-0x0;var _0x5cae1b=_0x9daa[_0x28430d];return _0x5cae1b;};'use strict';var ChatInteractionEvents=require(_0xa9da('0x0'));var events=[_0xa9da('0x1'),_0xa9da('0x2'),_0xa9da('0x3')];function createListener(_0x54105a,_0xa817d9){return function(_0x112851){_0xa817d9[_0xa9da('0x4')](_0x54105a,_0x112851);};}function removeListener(_0xee9072,_0x347ed7){return function(){ChatInteractionEvents[_0xa9da('0x5')](_0xee9072,_0x347ed7);};}exports[_0xa9da('0x6')]=function(_0x56a8fc){for(var _0x4dbf12=0x0,_0x4ef8e6=events['length'];_0x4dbf12<_0x4ef8e6;_0x4dbf12++){var _0x2840df=events[_0x4dbf12];var _0x5e588c=createListener(_0xa9da('0x7')+_0x2840df,_0x56a8fc);ChatInteractionEvents['on'](_0x2840df,_0x5e588c);}};
\ No newline at end of file
index 007bfa2..bae2273 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x415c=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','describe','get','/:id/attachment_download','isChatInteractionAuthorized','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','post','/:id/attachment_upload','single','file','attachmentUpload','tracked','chatinteraction:addtags','addTags','put','/:id','chat','chatinteraction:update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x415c,0x1c2));var _0xc415=function(_0x4a7f7c,_0x345029){_0x4a7f7c=_0x4a7f7c-0x0;var _0x66e958=_0x415c[_0x4a7f7c];return _0x66e958;};'use strict';var multer=require(_0xc415('0x0'));var util=require(_0xc415('0x1'));var path=require(_0xc415('0x2'));var timeout=require(_0xc415('0x3'));var express=require(_0xc415('0x4'));var router=express[_0xc415('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc415('0x6'));var interaction=require(_0xc415('0x7'));var config=require(_0xc415('0x8'));var controller=require(_0xc415('0x9'));router['get']('/',auth[_0xc415('0xa')](),controller['index']);router['get']('/describe',auth[_0xc415('0xa')](),controller[_0xc415('0xb')]);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0xc415('0xc')](_0xc415('0xd'),auth[_0xc415('0xe')](),controller['attachmentDownload']);router[_0xc415('0xc')](_0xc415('0xf'),auth[_0xc415('0xa')](),controller[_0xc415('0x10')]);router[_0xc415('0xc')](_0xc415('0x11'),auth[_0xc415('0xe')](),controller[_0xc415('0x12')]);router['get'](_0xc415('0x13'),auth[_0xc415('0xa')](),controller[_0xc415('0x14')]);router['post']('/',auth[_0xc415('0xa')](),controller[_0xc415('0x15')]);router['post']('/:id/vidaoo',auth[_0xc415('0xa')](),controller[_0xc415('0x16')]);var upload=multer({'storage':multer[_0xc415('0x17')]({'destination':function(_0x2b4e14,_0x19b7e8,_0x3e67e9){_0x3e67e9(null,path['join'](config['root'],_0xc415('0x18')));},'filename':function(_0x5b0729,_0x2d44d8,_0x15c815){_0x15c815(null,util[_0xc415('0x19')](_0xc415('0x1a'),Date[_0xc415('0x1b')](),_0x2d44d8[_0xc415('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc415('0x1d')](_0xc415('0x1e'),upload[_0xc415('0x1f')](_0xc415('0x20')),controller[_0xc415('0x21')]);router['post'](_0xc415('0xf'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xc415('0x22')]('chat',_0xc415('0x23')),controller[_0xc415('0x24')]);router[_0xc415('0x25')](_0xc415('0x26'),auth[_0xc415('0xa')](),interaction['tracked'](_0xc415('0x27'),_0xc415('0x28')),controller['update']);router[_0xc415('0x25')]('/:id/custom_update',controller['customUpdate']);router['put'](_0xc415('0x29'),auth[_0xc415('0xe')](),controller['abandon']);router[_0xc415('0x25')](_0xc415('0x2a'),controller[_0xc415('0x2b')]);router[_0xc415('0x2c')](_0xc415('0x26'),auth[_0xc415('0xa')](),interaction['tracked'](_0xc415('0x27'),_0xc415('0x2d')),controller[_0xc415('0x2e')]);router[_0xc415('0x2c')](_0xc415('0x2f'),auth[_0xc415('0xa')](),controller[_0xc415('0x30')]);module[_0xc415('0x31')]=router;
\ No newline at end of file
+var _0x0fbc=['post','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/close','close','delete','destroy','removeTags','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','isAuthenticated','createVidaooSession','diskStorage','join','server/files/attachments/','format','now'];(function(_0x37835e,_0x3c2095){var _0x46e6f2=function(_0x3956ea){while(--_0x3956ea){_0x37835e['push'](_0x37835e['shift']());}};_0x46e6f2(++_0x3c2095);}(_0x0fbc,0x99));var _0xc0fb=function(_0x350360,_0x36b354){_0x350360=_0x350360-0x0;var _0x4f755c=_0x0fbc[_0x350360];return _0x4f755c;};'use strict';var multer=require(_0xc0fb('0x0'));var util=require(_0xc0fb('0x1'));var path=require('path');var timeout=require(_0xc0fb('0x2'));var express=require(_0xc0fb('0x3'));var router=express[_0xc0fb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc0fb('0x5'));var interaction=require(_0xc0fb('0x6'));var config=require('../../config/environment');var controller=require(_0xc0fb('0x7'));router[_0xc0fb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc0fb('0x8')](_0xc0fb('0x9'),auth['isAuthenticated'](),controller[_0xc0fb('0xa')]);router['get'](_0xc0fb('0xb'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0xd')]);router[_0xc0fb('0x8')](_0xc0fb('0xe'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0xf')]);router[_0xc0fb('0x8')](_0xc0fb('0x10'),auth['isAuthenticated'](),controller[_0xc0fb('0x11')]);router[_0xc0fb('0x8')](_0xc0fb('0x12'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0x13')]);router['get']('/:id/download',auth[_0xc0fb('0x14')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/vidaoo',auth['isAuthenticated'](),controller[_0xc0fb('0x15')]);var upload=multer({'storage':multer[_0xc0fb('0x16')]({'destination':function(_0x4143fb,_0x236e5d,_0x71a10a){_0x71a10a(null,path[_0xc0fb('0x17')](config['root'],_0xc0fb('0x18')));},'filename':function(_0x10cc2a,_0x37fc76,_0x12b20a){_0x12b20a(null,util[_0xc0fb('0x19')]('%s-%s',Date[_0xc0fb('0x1a')](),_0x37fc76['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc0fb('0x1b')]('/:id/attachment_upload',upload[_0xc0fb('0x1c')]('file'),controller[_0xc0fb('0x1d')]);router[_0xc0fb('0x1b')](_0xc0fb('0x10'),auth[_0xc0fb('0xc')](),controller[_0xc0fb('0x1e')]);router[_0xc0fb('0x1b')](_0xc0fb('0x1f'),auth[_0xc0fb('0x14')](),interaction[_0xc0fb('0x20')](_0xc0fb('0x21'),_0xc0fb('0x22')),controller[_0xc0fb('0x23')]);router[_0xc0fb('0x24')](_0xc0fb('0xb'),auth[_0xc0fb('0x14')](),interaction['tracked'](_0xc0fb('0x21'),_0xc0fb('0x25')),controller[_0xc0fb('0x26')]);router[_0xc0fb('0x24')](_0xc0fb('0x27'),controller['customUpdate']);router['put']('/:id/abandon',auth[_0xc0fb('0xc')](),controller['abandon']);router['put'](_0xc0fb('0x28'),controller[_0xc0fb('0x29')]);router[_0xc0fb('0x2a')](_0xc0fb('0xb'),auth[_0xc0fb('0x14')](),interaction[_0xc0fb('0x20')](_0xc0fb('0x21'),'chatinteraction:destroy'),controller[_0xc0fb('0x2b')]);router['delete'](_0xc0fb('0x1f'),auth[_0xc0fb('0x14')](),controller[_0xc0fb('0x2c')]);module['exports']=router;
\ No newline at end of file
index 263a2ce..4086d50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6322=['sequelize','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x342fd5,_0x5dca3c){var _0x2823d5=function(_0x4c9e96){while(--_0x4c9e96){_0x342fd5['push'](_0x342fd5['shift']());}};_0x2823d5(++_0x5dca3c);}(_0x6322,0xd2));var _0x2632=function(_0x5ee50d,_0x4b6e70){_0x5ee50d=_0x5ee50d-0x0;var _0x451fd8=_0x6322[_0x5ee50d];return _0x451fd8;};'use strict';var Sequelize=require(_0x2632('0x0'));module['exports']={'body':{'type':Sequelize[_0x2632('0x1')](_0x2632('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2632('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2632('0x4')]}};
\ No newline at end of file
+var _0xbf04=['exports','TEXT','sequelize'];(function(_0x3eee56,_0x176daf){var _0x506bcd=function(_0x3cfe8b){while(--_0x3cfe8b){_0x3eee56['push'](_0x3eee56['shift']());}};_0x506bcd(++_0x176daf);}(_0xbf04,0x158));var _0x4bf0=function(_0xde1348,_0x5205b6){_0xde1348=_0xde1348-0x0;var _0x32c5e0=_0xbf04[_0xde1348];return _0x32c5e0;};'use strict';var Sequelize=require(_0x4bf0('0x0'));module[_0x4bf0('0x1')]={'body':{'type':Sequelize[_0x4bf0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index ca9d146..9b5210b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x243a=['User','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','-createdAt','all','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','save','destroy','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers'];(function(_0x3dfb51,_0x142a65){var _0x3f1b03=function(_0x1f9134){while(--_0x1f9134){_0x3dfb51['push'](_0x3dfb51['shift']());}};_0x3f1b03(++_0x142a65);}(_0x243a,0x86));var _0xa243=function(_0x2b8189,_0x46de6b){_0x2b8189=_0x2b8189-0x0;var _0x96ccfa=_0x243a[_0x2b8189];return _0x96ccfa;};'use strict';var emlformat=require(_0xa243('0x0'));var rimraf=require(_0xa243('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa243('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa243('0x3'));var util=require(_0xa243('0x4'));var path=require(_0xa243('0x5'));var sox=require(_0xa243('0x6'));var csv=require(_0xa243('0x7'));var ejs=require(_0xa243('0x8'));var fs=require('fs');var fs_extra=require(_0xa243('0x9'));var _=require(_0xa243('0xa'));var squel=require(_0xa243('0xb'));var crypto=require(_0xa243('0xc'));var jsforce=require(_0xa243('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa243('0x7'));var querystring=require('querystring');var Papa=require(_0xa243('0xe'));var Redis=require('ioredis');var authService=require(_0xa243('0xf'));var qs=require(_0xa243('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa243('0x11'));var logger=require(_0xa243('0x12'))(_0xa243('0x13'));var utils=require(_0xa243('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa243('0x15'));var db=require(_0xa243('0x16'))['db'];config[_0xa243('0x17')]=_[_0xa243('0x18')](config['redis'],{'host':_0xa243('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa243('0x17')]));require('./chatInternalMessage.socket')[_0xa243('0x1a')](socket);function respondWithStatusCode(_0x58ec8a,_0x5b4643){_0x5b4643=_0x5b4643||0xcc;return function(_0x561089){if(_0x561089){return _0x58ec8a[_0xa243('0x1b')](_0x5b4643);}return _0x58ec8a['status'](_0x5b4643)[_0xa243('0x1c')]();};}function respondWithResult(_0x222cff,_0x238e3a){_0x238e3a=_0x238e3a||0xc8;return function(_0x509fa8){if(_0x509fa8){return _0x222cff[_0xa243('0x1d')](_0x238e3a)[_0xa243('0x1e')](_0x509fa8);}};}function respondWithFilteredResult(_0x54f3e5,_0x391bbc){return function(_0x397941){if(_0x397941){var _0x102eaf=typeof _0x391bbc['offset']===_0xa243('0x1f')&&typeof _0x391bbc[_0xa243('0x20')]===_0xa243('0x1f');var _0x4b778e=_0x397941[_0xa243('0x21')];var _0xadee09=_0x102eaf?0x0:_0x391bbc[_0xa243('0x22')];var _0x393b48=_0x102eaf?_0x397941['count']:_0x391bbc[_0xa243('0x22')]+_0x391bbc[_0xa243('0x20')];var _0xcc07c1;if(_0x393b48>=_0x4b778e){_0x393b48=_0x4b778e;_0xcc07c1=0xc8;}else{_0xcc07c1=0xce;}_0x54f3e5[_0xa243('0x1d')](_0xcc07c1);return _0x54f3e5[_0xa243('0x23')](_0xa243('0x24'),_0xadee09+'-'+_0x393b48+'/'+_0x4b778e)['json'](_0x397941);}return null;};}function patchUpdates(_0x427de1){return function(_0x44de51){try{jsonpatch['apply'](_0x44de51,_0x427de1,!![]);}catch(_0x5b848b){return BPromise['reject'](_0x5b848b);}return _0x44de51[_0xa243('0x25')]();};}function saveUpdates(_0x33fbdb,_0x53ce45){return function(_0x2b81e3){if(_0x2b81e3){return _0x2b81e3['update'](_0x33fbdb)['then'](function(_0x189e57){return _0x189e57;});}return null;};}function removeEntity(_0x2e00c5,_0x302171){return function(_0x51df04){if(_0x51df04){return _0x51df04[_0xa243('0x26')]()['then'](function(){_0x2e00c5[_0xa243('0x1d')](0xcc)[_0xa243('0x1c')]();});}};}function handleEntityNotFound(_0x1b19b3,_0x341204){return function(_0x42c67e){if(!_0x42c67e){_0x1b19b3[_0xa243('0x1b')](0x194);}return _0x42c67e;};}function handleError(_0x16f6d0,_0x265d06){_0x265d06=_0x265d06||0x1f4;return function(_0x146fe7){logger[_0xa243('0x27')](_0x146fe7[_0xa243('0x28')]);if(_0x146fe7[_0xa243('0x29')]){delete _0x146fe7[_0xa243('0x29')];}_0x16f6d0['status'](_0x265d06)[_0xa243('0x2a')](_0x146fe7);};}exports['index']=function(_0x49a25f,_0x24af7d){var _0x531188={},_0x332ce9={},_0x1eefb3={'count':0x0,'rows':[]};var _0x231372=_['map'](db[_0xa243('0x2b')][_0xa243('0x2c')],function(_0x299c8d){return{'name':_0x299c8d[_0xa243('0x2d')],'type':_0x299c8d[_0xa243('0x2e')]['key']};});_0x332ce9[_0xa243('0x2f')]=_['map'](_0x231372,_0xa243('0x29'));_0x332ce9[_0xa243('0x30')]=_['keys'](_0x49a25f['query']);_0x332ce9['filters']=_[_0xa243('0x31')](_0x332ce9[_0xa243('0x2f')],_0x332ce9['query']);_0x531188[_0xa243('0x32')]=_[_0xa243('0x31')](_0x332ce9['model'],qs[_0xa243('0x33')](_0x49a25f[_0xa243('0x30')][_0xa243('0x33')]));_0x531188[_0xa243('0x32')]=_0x531188[_0xa243('0x32')][_0xa243('0x34')]?_0x531188[_0xa243('0x32')]:_0x332ce9[_0xa243('0x2f')];if(!_0x49a25f[_0xa243('0x30')][_0xa243('0x35')](_0xa243('0x36'))){_0x531188[_0xa243('0x20')]=qs[_0xa243('0x20')](_0x49a25f[_0xa243('0x30')][_0xa243('0x20')]);_0x531188['offset']=qs[_0xa243('0x22')](_0x49a25f[_0xa243('0x30')][_0xa243('0x22')]);}_0x531188[_0xa243('0x37')]=qs[_0xa243('0x38')](_0x49a25f[_0xa243('0x30')][_0xa243('0x38')]);_0x531188[_0xa243('0x39')]=qs[_0xa243('0x3a')](_[_0xa243('0x3b')](_0x49a25f[_0xa243('0x30')],_0x332ce9['filters']),_0x231372);if(_0x49a25f[_0xa243('0x30')][_0xa243('0x3c')]){_0x531188['where']=_['merge'](_0x531188[_0xa243('0x39')],{'$or':_['map'](_0x231372,function(_0x10a955){if(_0x10a955[_0xa243('0x2e')]!==_0xa243('0x3d')){var _0x1d1e35={};_0x1d1e35[_0x10a955[_0xa243('0x29')]]={'$like':'%'+_0x49a25f[_0xa243('0x30')][_0xa243('0x3c')]+'%'};return _0x1d1e35;}})});}_0x531188=_[_0xa243('0x3e')]({},_0x531188,_0x49a25f[_0xa243('0x3f')]);var _0x182533={'where':_0x531188[_0xa243('0x39')]};return db[_0xa243('0x2b')][_0xa243('0x21')](_0x182533)[_0xa243('0x40')](function(_0xa40510){_0x1eefb3['count']=_0xa40510;if(_0x49a25f[_0xa243('0x30')][_0xa243('0x41')]){_0x531188[_0xa243('0x42')]=[{'all':!![]}];}return db[_0xa243('0x2b')][_0xa243('0x43')](_0x531188);})[_0xa243('0x40')](function(_0x4244b0){_0x1eefb3[_0xa243('0x44')]=_0x4244b0;return _0x1eefb3;})[_0xa243('0x40')](respondWithFilteredResult(_0x24af7d,_0x531188))[_0xa243('0x45')](handleError(_0x24af7d,null));};exports[_0xa243('0x46')]=function(_0xdbb082,_0x215fc6){var _0x45bcd9={'raw':!![],'where':{'id':_0xdbb082['params']['id']}},_0xecef31={};_0xecef31[_0xa243('0x2f')]=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0xecef31[_0xa243('0x30')]=_[_0xa243('0x47')](_0xdbb082[_0xa243('0x30')]);_0xecef31['filters']=_[_0xa243('0x31')](_0xecef31[_0xa243('0x2f')],_0xecef31[_0xa243('0x30')]);_0x45bcd9['attributes']=_[_0xa243('0x31')](_0xecef31[_0xa243('0x2f')],qs[_0xa243('0x33')](_0xdbb082['query'][_0xa243('0x33')]));_0x45bcd9['attributes']=_0x45bcd9[_0xa243('0x32')][_0xa243('0x34')]?_0x45bcd9[_0xa243('0x32')]:_0xecef31[_0xa243('0x2f')];if(_0xdbb082[_0xa243('0x30')][_0xa243('0x41')]){_0x45bcd9[_0xa243('0x42')]=[{'all':!![]}];}_0x45bcd9=_[_0xa243('0x3e')]({},_0x45bcd9,_0xdbb082[_0xa243('0x3f')]);return db[_0xa243('0x2b')][_0xa243('0x48')](_0x45bcd9)['then'](handleEntityNotFound(_0x215fc6,null))['then'](respondWithResult(_0x215fc6,null))['catch'](handleError(_0x215fc6,null));};exports['create']=function(_0x48dfb1,_0x524839){return db['ChatInternalMessage'][_0xa243('0x49')](_0x48dfb1[_0xa243('0x4a')],{})[_0xa243('0x40')](respondWithResult(_0x524839,0xc9))[_0xa243('0x45')](handleError(_0x524839,null));};exports[_0xa243('0x4b')]=function(_0x1a57d0,_0x1f51a7){if(_0x1a57d0[_0xa243('0x4a')]['id']){delete _0x1a57d0[_0xa243('0x4a')]['id'];}return db[_0xa243('0x2b')][_0xa243('0x48')]({'where':{'id':_0x1a57d0[_0xa243('0x4c')]['id']}})[_0xa243('0x40')](handleEntityNotFound(_0x1f51a7,null))[_0xa243('0x40')](saveUpdates(_0x1a57d0[_0xa243('0x4a')],null))['then'](respondWithResult(_0x1f51a7,null))[_0xa243('0x45')](handleError(_0x1f51a7,null));};exports[_0xa243('0x26')]=function(_0x16b4cf,_0x287d8f){return db['ChatInternalMessage'][_0xa243('0x48')]({'where':{'id':_0x16b4cf[_0xa243('0x4c')]['id']}})[_0xa243('0x40')](handleEntityNotFound(_0x287d8f,null))[_0xa243('0x40')](removeEntity(_0x287d8f,null))['catch'](handleError(_0x287d8f,null));};exports[_0xa243('0x4d')]=function(_0x51c4f0,_0x5d2497){return db[_0xa243('0x2b')][_0xa243('0x4d')]()[_0xa243('0x40')](respondWithResult(_0x5d2497,null))[_0xa243('0x45')](handleError(_0x5d2497,null));};function wrapUser(_0x59a456){return function(_0x133d25){var _0x55f713=_0x59a456[_0xa243('0x4e')]({'plain':!![]});_0x55f713[_0xa243('0x4f')]=[];if(_0x133d25){_0x55f713[_0xa243('0x50')]=_0x133d25[_0xa243('0x51')];_0x55f713[_0xa243('0x52')]=_0x133d25;}else{_0x55f713['lastMessageAt']=moment(0x0)[_0xa243('0x53')](_0xa243('0x54'));_0x55f713[_0xa243('0x52')]={};}return _0x55f713;};}exports[_0xa243('0x55')]=function(_0x158741,_0x416e34,_0x3f909c){var _0x477fec=[];return db[_0xa243('0x56')][_0xa243('0x43')]({'where':{'role':['agent','admin',_0xa243('0x57')]},'attributes':['id',_0xa243('0x58'),_0xa243('0x29'),_0xa243('0x59'),_0xa243('0x5a'),_0xa243('0x5b'),_0xa243('0x5c'),'lastLoginAt',_0xa243('0x5d'),_0xa243('0x5e')],'order':qs[_0xa243('0x38')](_0xa243('0x5f')),'include':[{'model':db[_0xa243('0x60')],'as':_0xa243('0x61'),'attributes':['id',_0xa243('0x29'),_0xa243('0x2e')],'through':{'attributes':[]}}]})[_0xa243('0x40')](function(_0x4b8301){if(_0x4b8301){var _0x33330f=_0x158741[_0xa243('0x57')]['get']({'plain':!![]});if(!_0x33330f)throw new Error(_0xa243('0x62'));if(_0x33330f[_0xa243('0x59')]===_0xa243('0x57')){return db[_0xa243('0x63')][_0xa243('0x48')]({'where':{'name':_0xa243('0x64'),'userProfileId':_0x33330f[_0xa243('0x65')]},'raw':!![]})['then'](function(_0x5980ca){if(_0x5980ca){if(_0x5980ca[_0xa243('0x66')]===0x0){return db[_0xa243('0x67')][_0xa243('0x43')]({'where':{'sectionId':_0x5980ca['id']},'raw':!![]})[_0xa243('0x40')](function(_0x22f227){var _0x1505a4=[];if(_[_0xa243('0x68')](_0x22f227)){_0x1505a4=_[_0xa243('0x3c')](_0x4b8301,function(_0x1ae142){if(_0x1ae142['role']!==_0xa243('0x69')){return _0x1ae142;}});return _0x1505a4;}else{for(var _0x161518=0x0;_0x161518<_0x4b8301[_0xa243('0x34')];_0x161518++){var _0x1f7c79=_0x4b8301[_0x161518];if(_0x1f7c79[_0xa243('0x59')]===_0xa243('0x69')){var _0x334b55=_['find'](_0x22f227,function(_0x4b1242){return _0x4b1242[_0xa243('0x6a')]===_0x1f7c79['id'];});if(_0x334b55)_0x1505a4[_0xa243('0x6b')](_0x1f7c79);}else{_0x1505a4['push'](_0x1f7c79);}}return _0x1505a4;}});}else{return _0x4b8301;}}else{var _0x1282e1=_[_0xa243('0x3c')](_0x4b8301,function(_0x423d59){if(_0x423d59['role']!==_0xa243('0x69')){return _0x423d59;}});return _0x1282e1;}});}else{return _0x4b8301;}}})['then'](function(_0x254c52){var _0x409759=[];if(_0x254c52){_0x477fec=_0x254c52;for(var _0x46349f=0x0;_0x46349f<_0x254c52[_0xa243('0x34')];_0x46349f+=0x1){_0x477fec[_0x46349f][_0xa243('0x4f')]=[];_0x409759[_0xa243('0x6b')](db[_0xa243('0x2b')][_0xa243('0x48')]({'where':{'FromId':[_0x158741['user']['id'],_0x254c52[_0x46349f]['id']],'ToId':[_0x158741[_0xa243('0x57')]['id'],_0x254c52[_0x46349f]['id']],'ChatGroupId':null},'attributes':['id',_0xa243('0x51'),'FromId','ToId','read',_0xa243('0x4a')],'order':qs[_0xa243('0x38')](_0xa243('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa243('0x40')](wrapUser(_0x254c52[_0x46349f])));}return BPromise[_0xa243('0x6d')](_0x409759);}return[];})['then'](function(_0x4cbf9b){return{'rows':_0x4cbf9b,'count':_0x4cbf9b['length']};})[_0xa243('0x40')](respondWithResult(_0x416e34,null))[_0xa243('0x45')](handleError(_0x416e34,null));};
\ No newline at end of file
+var _0x76ce=['push','createdAt','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','ChatInternalMessage','fieldName','type','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','catch','show','fields','includeAll','include','merge','create','body','find','params','describe','messages','lastMessageAt','lastMessage','format','getUsers','User','findAll','agent','admin','user','role','userpic','internal','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','get','UserProfileSection','autoAssociation','isEmpty','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76ce,0x6d));var _0xe76c=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x76ce[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0xe76c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe76c('0x1'));var jsonpatch=require(_0xe76c('0x2'));var rp=require('request-promise');var moment=require(_0xe76c('0x3'));var BPromise=require(_0xe76c('0x4'));var Mustache=require(_0xe76c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe76c('0x6'));var csv=require(_0xe76c('0x7'));var ejs=require(_0xe76c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe76c('0x9'));var crypto=require(_0xe76c('0xa'));var jsforce=require(_0xe76c('0xb'));var deskjs=require(_0xe76c('0xc'));var toCsv=require(_0xe76c('0x7'));var querystring=require(_0xe76c('0xd'));var Papa=require(_0xe76c('0xe'));var Redis=require(_0xe76c('0xf'));var authService=require(_0xe76c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe76c('0x11'))(_0xe76c('0x12'));var utils=require(_0xe76c('0x13'));var config=require(_0xe76c('0x14'));var licenseUtil=require(_0xe76c('0x15'));var db=require(_0xe76c('0x16'))['db'];config['redis']=_['defaults'](config[_0xe76c('0x17')],{'host':_0xe76c('0x18'),'port':0x18eb});var socket=require(_0xe76c('0x19'))(new Redis(config['redis']));require(_0xe76c('0x1a'))[_0xe76c('0x1b')](socket);function respondWithStatusCode(_0x4ef71c,_0x3f8e3f){_0x3f8e3f=_0x3f8e3f||0xcc;return function(_0x47b2da){if(_0x47b2da){return _0x4ef71c[_0xe76c('0x1c')](_0x3f8e3f);}return _0x4ef71c['status'](_0x3f8e3f)[_0xe76c('0x1d')]();};}function respondWithResult(_0x5f0b99,_0x24bbad){_0x24bbad=_0x24bbad||0xc8;return function(_0x2519f3){if(_0x2519f3){return _0x5f0b99[_0xe76c('0x1e')](_0x24bbad)['json'](_0x2519f3);}};}function respondWithFilteredResult(_0x25b6ef,_0x4ba9fe){return function(_0x5a0bd8){if(_0x5a0bd8){var _0x128ad7=typeof _0x4ba9fe[_0xe76c('0x1f')]===_0xe76c('0x20')&&typeof _0x4ba9fe[_0xe76c('0x21')]===_0xe76c('0x20');var _0x4d2dcb=_0x5a0bd8[_0xe76c('0x22')];var _0xc6c9f8=_0x128ad7?0x0:_0x4ba9fe[_0xe76c('0x1f')];var _0x4f5094=_0x128ad7?_0x5a0bd8[_0xe76c('0x22')]:_0x4ba9fe[_0xe76c('0x1f')]+_0x4ba9fe[_0xe76c('0x21')];var _0x405b2e;if(_0x4f5094>=_0x4d2dcb){_0x4f5094=_0x4d2dcb;_0x405b2e=0xc8;}else{_0x405b2e=0xce;}_0x25b6ef[_0xe76c('0x1e')](_0x405b2e);return _0x25b6ef['set'](_0xe76c('0x23'),_0xc6c9f8+'-'+_0x4f5094+'/'+_0x4d2dcb)[_0xe76c('0x24')](_0x5a0bd8);}return null;};}function patchUpdates(_0x4cadd2){return function(_0x3982c4){try{jsonpatch[_0xe76c('0x25')](_0x3982c4,_0x4cadd2,!![]);}catch(_0x4b24a1){return BPromise[_0xe76c('0x26')](_0x4b24a1);}return _0x3982c4['save']();};}function saveUpdates(_0x5e478c,_0x4e033c){return function(_0x36eb07){if(_0x36eb07){return _0x36eb07[_0xe76c('0x27')](_0x5e478c)[_0xe76c('0x28')](function(_0x29ee32){return _0x29ee32;});}return null;};}function removeEntity(_0x4994f6,_0x26aa6d){return function(_0x15f63a){if(_0x15f63a){return _0x15f63a[_0xe76c('0x29')]()[_0xe76c('0x28')](function(){_0x4994f6[_0xe76c('0x1e')](0xcc)[_0xe76c('0x1d')]();});}};}function handleEntityNotFound(_0xa2bc4f,_0x52605e){return function(_0x1905d1){if(!_0x1905d1){_0xa2bc4f['sendStatus'](0x194);}return _0x1905d1;};}function handleError(_0x54d736,_0x377638){_0x377638=_0x377638||0x1f4;return function(_0x29809d){logger[_0xe76c('0x2a')](_0x29809d[_0xe76c('0x2b')]);if(_0x29809d[_0xe76c('0x2c')]){delete _0x29809d[_0xe76c('0x2c')];}_0x54d736[_0xe76c('0x1e')](_0x377638)[_0xe76c('0x2d')](_0x29809d);};}exports['index']=function(_0x8a5b1c,_0x1c5aa7){var _0x3c1929={},_0x179f9d={},_0x4657cf={'count':0x0,'rows':[]};var _0x4af313=_[_0xe76c('0x2e')](db[_0xe76c('0x2f')]['rawAttributes'],function(_0x24c03b){return{'name':_0x24c03b[_0xe76c('0x30')],'type':_0x24c03b[_0xe76c('0x31')]['key']};});_0x179f9d[_0xe76c('0x32')]=_['map'](_0x4af313,'name');_0x179f9d['query']=_[_0xe76c('0x33')](_0x8a5b1c[_0xe76c('0x34')]);_0x179f9d[_0xe76c('0x35')]=_[_0xe76c('0x36')](_0x179f9d[_0xe76c('0x32')],_0x179f9d[_0xe76c('0x34')]);_0x3c1929[_0xe76c('0x37')]=_[_0xe76c('0x36')](_0x179f9d[_0xe76c('0x32')],qs['fields'](_0x8a5b1c[_0xe76c('0x34')]['fields']));_0x3c1929[_0xe76c('0x37')]=_0x3c1929[_0xe76c('0x37')]['length']?_0x3c1929[_0xe76c('0x37')]:_0x179f9d[_0xe76c('0x32')];if(!_0x8a5b1c['query'][_0xe76c('0x38')](_0xe76c('0x39'))){_0x3c1929[_0xe76c('0x21')]=qs[_0xe76c('0x21')](_0x8a5b1c[_0xe76c('0x34')][_0xe76c('0x21')]);_0x3c1929[_0xe76c('0x1f')]=qs['offset'](_0x8a5b1c[_0xe76c('0x34')]['offset']);}_0x3c1929['order']=qs[_0xe76c('0x3a')](_0x8a5b1c['query']['sort']);_0x3c1929[_0xe76c('0x3b')]=qs['filters'](_[_0xe76c('0x3c')](_0x8a5b1c[_0xe76c('0x34')],_0x179f9d[_0xe76c('0x35')]),_0x4af313);if(_0x8a5b1c[_0xe76c('0x34')]['filter']){_0x3c1929[_0xe76c('0x3b')]=_['merge'](_0x3c1929[_0xe76c('0x3b')],{'$or':_[_0xe76c('0x2e')](_0x4af313,function(_0x32cf0a){if(_0x32cf0a['type']!==_0xe76c('0x3d')){var _0x26c98d={};_0x26c98d[_0x32cf0a[_0xe76c('0x2c')]]={'$like':'%'+_0x8a5b1c[_0xe76c('0x34')][_0xe76c('0x3e')]+'%'};return _0x26c98d;}})});}_0x3c1929=_['merge']({},_0x3c1929,_0x8a5b1c[_0xe76c('0x3f')]);var _0x451ffc={'where':_0x3c1929[_0xe76c('0x3b')]};return db['ChatInternalMessage'][_0xe76c('0x22')](_0x451ffc)[_0xe76c('0x28')](function(_0x2cbf28){_0x4657cf[_0xe76c('0x22')]=_0x2cbf28;if(_0x8a5b1c[_0xe76c('0x34')]['includeAll']){_0x3c1929['include']=[{'all':!![]}];}return db[_0xe76c('0x2f')]['findAll'](_0x3c1929);})[_0xe76c('0x28')](function(_0x5f4e12){_0x4657cf['rows']=_0x5f4e12;return _0x4657cf;})[_0xe76c('0x28')](respondWithFilteredResult(_0x1c5aa7,_0x3c1929))[_0xe76c('0x40')](handleError(_0x1c5aa7,null));};exports[_0xe76c('0x41')]=function(_0x5a254d,_0x31128a){var _0x313115={'raw':!![],'where':{'id':_0x5a254d['params']['id']}},_0x50739a={};_0x50739a[_0xe76c('0x32')]=_['keys'](db[_0xe76c('0x2f')]['rawAttributes']);_0x50739a['query']=_[_0xe76c('0x33')](_0x5a254d[_0xe76c('0x34')]);_0x50739a[_0xe76c('0x35')]=_['intersection'](_0x50739a[_0xe76c('0x32')],_0x50739a[_0xe76c('0x34')]);_0x313115[_0xe76c('0x37')]=_[_0xe76c('0x36')](_0x50739a[_0xe76c('0x32')],qs['fields'](_0x5a254d[_0xe76c('0x34')][_0xe76c('0x42')]));_0x313115[_0xe76c('0x37')]=_0x313115[_0xe76c('0x37')]['length']?_0x313115[_0xe76c('0x37')]:_0x50739a[_0xe76c('0x32')];if(_0x5a254d[_0xe76c('0x34')][_0xe76c('0x43')]){_0x313115[_0xe76c('0x44')]=[{'all':!![]}];}_0x313115=_[_0xe76c('0x45')]({},_0x313115,_0x5a254d[_0xe76c('0x3f')]);return db[_0xe76c('0x2f')]['find'](_0x313115)[_0xe76c('0x28')](handleEntityNotFound(_0x31128a,null))[_0xe76c('0x28')](respondWithResult(_0x31128a,null))[_0xe76c('0x40')](handleError(_0x31128a,null));};exports[_0xe76c('0x46')]=function(_0x5f46a0,_0x504daf){return db[_0xe76c('0x2f')][_0xe76c('0x46')](_0x5f46a0['body'],{})[_0xe76c('0x28')](respondWithResult(_0x504daf,0xc9))['catch'](handleError(_0x504daf,null));};exports[_0xe76c('0x27')]=function(_0xdd704f,_0xea772){if(_0xdd704f[_0xe76c('0x47')]['id']){delete _0xdd704f[_0xe76c('0x47')]['id'];}return db['ChatInternalMessage'][_0xe76c('0x48')]({'where':{'id':_0xdd704f[_0xe76c('0x49')]['id']}})[_0xe76c('0x28')](handleEntityNotFound(_0xea772,null))['then'](saveUpdates(_0xdd704f[_0xe76c('0x47')],null))['then'](respondWithResult(_0xea772,null))[_0xe76c('0x40')](handleError(_0xea772,null));};exports[_0xe76c('0x29')]=function(_0x5daee7,_0x3be4ea){return db[_0xe76c('0x2f')][_0xe76c('0x48')]({'where':{'id':_0x5daee7['params']['id']}})[_0xe76c('0x28')](handleEntityNotFound(_0x3be4ea,null))[_0xe76c('0x28')](removeEntity(_0x3be4ea,null))[_0xe76c('0x40')](handleError(_0x3be4ea,null));};exports[_0xe76c('0x4a')]=function(_0x26f5ca,_0x219af1){return db[_0xe76c('0x2f')]['describe']()[_0xe76c('0x28')](respondWithResult(_0x219af1,null))['catch'](handleError(_0x219af1,null));};function wrapUser(_0x30060e){return function(_0x2f2f77){var _0x334204=_0x30060e['get']({'plain':!![]});_0x334204[_0xe76c('0x4b')]=[];if(_0x2f2f77){_0x334204[_0xe76c('0x4c')]=_0x2f2f77['createdAt'];_0x334204[_0xe76c('0x4d')]=_0x2f2f77;}else{_0x334204[_0xe76c('0x4c')]=moment(0x0)[_0xe76c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x334204[_0xe76c('0x4d')]={};}return _0x334204;};}exports[_0xe76c('0x4f')]=function(_0x18953c,_0x296bed,_0x51f9aa){var _0x98fb02=[];return db[_0xe76c('0x50')][_0xe76c('0x51')]({'where':{'role':[_0xe76c('0x52'),_0xe76c('0x53'),_0xe76c('0x54')]},'attributes':['id','fullname',_0xe76c('0x2c'),_0xe76c('0x55'),_0xe76c('0x56'),_0xe76c('0x57'),'online',_0xe76c('0x58'),_0xe76c('0x59'),'showWebBar'],'order':qs[_0xe76c('0x3a')]('-online'),'include':[{'model':db[_0xe76c('0x5a')],'as':_0xe76c('0x5b'),'attributes':['id',_0xe76c('0x2c'),_0xe76c('0x31')],'through':{'attributes':[]}}]})[_0xe76c('0x28')](function(_0x1698b3){if(_0x1698b3){var _0x449d61=_0x18953c[_0xe76c('0x54')][_0xe76c('0x5c')]({'plain':!![]});if(!_0x449d61)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x449d61['role']===_0xe76c('0x54')){return db[_0xe76c('0x5d')][_0xe76c('0x48')]({'where':{'name':'Agents','userProfileId':_0x449d61['userProfileId']},'raw':!![]})[_0xe76c('0x28')](function(_0x1c534f){if(_0x1c534f){if(_0x1c534f[_0xe76c('0x5e')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1c534f['id']},'raw':!![]})[_0xe76c('0x28')](function(_0x4238d4){var _0x31cc28=[];if(_[_0xe76c('0x5f')](_0x4238d4)){_0x31cc28=_[_0xe76c('0x3e')](_0x1698b3,function(_0x3ca00d){if(_0x3ca00d[_0xe76c('0x55')]!==_0xe76c('0x52')){return _0x3ca00d;}});return _0x31cc28;}else{for(var _0x1b29a5=0x0;_0x1b29a5<_0x1698b3[_0xe76c('0x60')];_0x1b29a5++){var _0xaa41ba=_0x1698b3[_0x1b29a5];if(_0xaa41ba[_0xe76c('0x55')]===_0xe76c('0x52')){var _0x1cc837=_[_0xe76c('0x48')](_0x4238d4,function(_0x1dac22){return _0x1dac22['resourceId']===_0xaa41ba['id'];});if(_0x1cc837)_0x31cc28[_0xe76c('0x61')](_0xaa41ba);}else{_0x31cc28[_0xe76c('0x61')](_0xaa41ba);}}return _0x31cc28;}});}else{return _0x1698b3;}}else{var _0x11825c=_[_0xe76c('0x3e')](_0x1698b3,function(_0x2f52f6){if(_0x2f52f6[_0xe76c('0x55')]!==_0xe76c('0x52')){return _0x2f52f6;}});return _0x11825c;}});}else{return _0x1698b3;}}})[_0xe76c('0x28')](function(_0x17bd49){var _0x50fd55=[];if(_0x17bd49){_0x98fb02=_0x17bd49;for(var _0x139a9c=0x0;_0x139a9c<_0x17bd49[_0xe76c('0x60')];_0x139a9c+=0x1){_0x98fb02[_0x139a9c][_0xe76c('0x4b')]=[];_0x50fd55[_0xe76c('0x61')](db[_0xe76c('0x2f')][_0xe76c('0x48')]({'where':{'FromId':[_0x18953c[_0xe76c('0x54')]['id'],_0x17bd49[_0x139a9c]['id']],'ToId':[_0x18953c[_0xe76c('0x54')]['id'],_0x17bd49[_0x139a9c]['id']],'ChatGroupId':null},'attributes':['id',_0xe76c('0x62'),'FromId',_0xe76c('0x63'),_0xe76c('0x64'),'body'],'order':qs['sort'](_0xe76c('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe76c('0x28')](wrapUser(_0x17bd49[_0x139a9c])));}return BPromise[_0xe76c('0x66')](_0x50fd55);}return[];})[_0xe76c('0x28')](function(_0xa4de4d){return{'rows':_0xa4de4d,'count':_0xa4de4d[_0xe76c('0x60')]};})['then'](respondWithResult(_0x296bed,null))['catch'](handleError(_0x296bed,null));};
\ No newline at end of file
index b509b5a..4750aeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71f0=['update','emit','hook','../../mysqldb','save'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x71f0,0x1b6));var _0x071f=function(_0x1a30c7,_0x5d5441){_0x1a30c7=_0x1a30c7-0x0;var _0x3be1e6=_0x71f0[_0x1a30c7];return _0x3be1e6;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x071f('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x071f('0x1'),'afterUpdate':_0x071f('0x2'),'afterDestroy':'remove'};function emitEvent(_0xf4677){return function(_0x2628a0,_0x548da0,_0x2aea5c){ChatInternalMessageEvents[_0x071f('0x3')](_0xf4677+':'+_0x2628a0['id'],_0x2628a0);ChatInternalMessageEvents['emit'](_0xf4677,_0x2628a0);_0x2aea5c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x071f('0x4')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x6356=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4c983b,_0x16d315){var _0x3d0ff0=function(_0x3939ef){while(--_0x3939ef){_0x4c983b['push'](_0x4c983b['shift']());}};_0x3d0ff0(++_0x16d315);}(_0x6356,0xc7));var _0x6635=function(_0x207114,_0x25902e){_0x207114=_0x207114-0x0;var _0x14d3b4=_0x6356[_0x207114];return _0x14d3b4;};'use strict';var EventEmitter=require(_0x6635('0x0'));var ChatInternalMessage=require(_0x6635('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6635('0x2')](0x0);var events={'afterCreate':_0x6635('0x3'),'afterUpdate':_0x6635('0x4'),'afterDestroy':_0x6635('0x5')};function emitEvent(_0x42bf57){return function(_0x521df7,_0x684e9a,_0x44e99e){ChatInternalMessageEvents[_0x6635('0x6')](_0x42bf57+':'+_0x521df7['id'],_0x521df7);ChatInternalMessageEvents[_0x6635('0x6')](_0x42bf57,_0x521df7);_0x44e99e(null);};}for(var e in events){if(events[_0x6635('0x7')](e)){var event=events[e];ChatInternalMessage[_0x6635('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
index f61c028..d2c8d55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0377=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4','lodash','util','api'];(function(_0x2e7ad7,_0x2972b4){var _0x5c92c7=function(_0x4b5780){while(--_0x4b5780){_0x2e7ad7['push'](_0x2e7ad7['shift']());}};_0x5c92c7(++_0x2972b4);}(_0x0377,0x165));var _0x7037=function(_0x4555b4,_0x4520df){_0x4555b4=_0x4555b4-0x0;var _0x46821c=_0x0377[_0x4555b4];return _0x46821c;};'use strict';var _=require(_0x7037('0x0'));var util=require(_0x7037('0x1'));var logger=require('../../config/logger')(_0x7037('0x2'));var moment=require(_0x7037('0x3'));var BPromise=require(_0x7037('0x4'));var rp=require(_0x7037('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7037('0x6'));var config=require(_0x7037('0x7'));var attributes=require(_0x7037('0x8'));module['exports']=function(_0x59829b,_0x53c7f0){return _0x59829b[_0x7037('0x9')](_0x7037('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7037('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd94e=['request-promise','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x3be2e2,_0x5c166d){var _0x53b9c5=function(_0x248aa7){while(--_0x248aa7){_0x3be2e2['push'](_0x3be2e2['shift']());}};_0x53b9c5(++_0x5c166d);}(_0xd94e,0xc8));var _0xed94=function(_0x35559,_0x36ab81){_0x35559=_0x35559-0x0;var _0x368237=_0xd94e[_0x35559];return _0x368237;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed94('0x0'))(_0xed94('0x1'));var moment=require(_0xed94('0x2'));var BPromise=require(_0xed94('0x3'));var rp=require(_0xed94('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed94('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xed94('0x6')]=function(_0xa776a3,_0x2740ca){return _0xa776a3[_0xed94('0x7')](_0xed94('0x8'),attributes,{'tableName':_0xed94('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xed94('0xa'),'collate':_0xed94('0xb')});};
\ No newline at end of file
index 1f2a061..6853b90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf149=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc'];(function(_0x2d446c,_0x5db1e7){var _0x173652=function(_0x38e6b5){while(--_0x38e6b5){_0x2d446c['push'](_0x2d446c['shift']());}};_0x173652(++_0x5db1e7);}(_0xf149,0xda));var _0x9f14=function(_0x256d97,_0x17b56d){_0x256d97=_0x256d97-0x0;var _0x487ee1=_0xf149[_0x256d97];return _0x487ee1;};'use strict';var _=require(_0x9f14('0x0'));var util=require(_0x9f14('0x1'));var moment=require(_0x9f14('0x2'));var BPromise=require(_0x9f14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f14('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f14('0x5'))(_0x9f14('0x6'));var config=require(_0x9f14('0x7'));var jayson=require(_0x9f14('0x8'));var client=jayson[_0x9f14('0x9')][_0x9f14('0xa')]({'port':0x232a});config[_0x9f14('0xb')]=_[_0x9f14('0xc')](config[_0x9f14('0xb')],{'host':_0x9f14('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f14('0xb')]));require('./chatInternalMessage.socket')[_0x9f14('0xe')](socket);function respondWithRpcPromise(_0x447676,_0x316a29,_0x3a6738){return new BPromise(function(_0x2e1730,_0x5d46d7){return client[_0x9f14('0xf')](_0x447676,_0x3a6738)[_0x9f14('0x10')](function(_0x3b3921){logger[_0x9f14('0x11')](_0x9f14('0x12'),_0x316a29,_0x9f14('0x13'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x316a29,_0x9f14('0x13'),JSON[_0x9f14('0x14')](_0x3b3921));if(_0x3b3921[_0x9f14('0x15')]){if(_0x3b3921['error'][_0x9f14('0x16')]===0x1f4){logger[_0x9f14('0x15')](_0x9f14('0x12'),_0x316a29,_0x3b3921[_0x9f14('0x15')]['message']);return _0x5d46d7(_0x3b3921[_0x9f14('0x15')][_0x9f14('0x17')]);}logger[_0x9f14('0x15')](_0x9f14('0x12'),_0x316a29,_0x3b3921[_0x9f14('0x15')]['message']);return _0x2e1730(_0x3b3921[_0x9f14('0x15')]['message']);}else{logger[_0x9f14('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x316a29,'request\x20sent');_0x2e1730(_0x3b3921[_0x9f14('0x18')][_0x9f14('0x17')]);}})['catch'](function(_0x1eabfc){logger[_0x9f14('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x316a29,_0x1eabfc);_0x5d46d7(_0x1eabfc);});});}
\ No newline at end of file
+var _0x83ea=['http','redis','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','client'];(function(_0x5ace3b,_0x5aeac0){var _0x762c23=function(_0x4b66a3){while(--_0x4b66a3){_0x5ace3b['push'](_0x5ace3b['shift']());}};_0x762c23(++_0x5aeac0);}(_0x83ea,0x158));var _0xa83e=function(_0x327bc7,_0x10fcc5){_0x327bc7=_0x327bc7-0x0;var _0x47e71f=_0x83ea[_0x327bc7];return _0x47e71f;};'use strict';var _=require(_0xa83e('0x0'));var util=require(_0xa83e('0x1'));var moment=require('moment');var BPromise=require(_0xa83e('0x2'));var rs=require(_0xa83e('0x3'));var fs=require('fs');var Redis=require(_0xa83e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa83e('0x5'));var logger=require('../../config/logger')(_0xa83e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa83e('0x7')][_0xa83e('0x8')]({'port':0x232a});config[_0xa83e('0x9')]=_['defaults'](config[_0xa83e('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa83e('0x9')]));require(_0xa83e('0xa'))[_0xa83e('0xb')](socket);function respondWithRpcPromise(_0x2b59a1,_0x1b3ae2,_0x47ab2b){return new BPromise(function(_0x2a19a5,_0xea8495){return client[_0xa83e('0xc')](_0x2b59a1,_0x47ab2b)[_0xa83e('0xd')](function(_0x42dfd6){logger['info'](_0xa83e('0xe'),_0x1b3ae2,_0xa83e('0xf'));logger[_0xa83e('0x10')](_0xa83e('0x11'),_0x1b3ae2,'request\x20sent',JSON[_0xa83e('0x12')](_0x42dfd6));if(_0x42dfd6[_0xa83e('0x13')]){if(_0x42dfd6[_0xa83e('0x13')]['code']===0x1f4){logger['error'](_0xa83e('0xe'),_0x1b3ae2,_0x42dfd6[_0xa83e('0x13')]['message']);return _0xea8495(_0x42dfd6[_0xa83e('0x13')][_0xa83e('0x14')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1b3ae2,_0x42dfd6[_0xa83e('0x13')][_0xa83e('0x14')]);return _0x2a19a5(_0x42dfd6[_0xa83e('0x13')][_0xa83e('0x14')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x1b3ae2,_0xa83e('0xf'));_0x2a19a5(_0x42dfd6['result'][_0xa83e('0x14')]);}})[_0xa83e('0x15')](function(_0x1c7b7f){logger[_0xa83e('0x13')](_0xa83e('0xe'),_0x1b3ae2,_0x1c7b7f);_0xea8495(_0x1c7b7f);});});}
\ No newline at end of file
index 53a30a3..05dcd0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2283=['remove','update','removeListener','register','./chatInternalMessage.events','save'];(function(_0x1f8f66,_0x5dc25a){var _0x3b992d=function(_0x25dadb){while(--_0x25dadb){_0x1f8f66['push'](_0x1f8f66['shift']());}};_0x3b992d(++_0x5dc25a);}(_0x2283,0x1e4));var _0x3228=function(_0x12cf6c,_0xa7928c){_0x12cf6c=_0x12cf6c-0x0;var _0x4431e2=_0x2283[_0x12cf6c];return _0x4431e2;};'use strict';var ChatInternalMessageEvents=require(_0x3228('0x0'));var events=[_0x3228('0x1'),_0x3228('0x2'),_0x3228('0x3')];function createListener(_0x1a055a,_0x49861f){return function(_0xbfd5f4){_0x49861f['emit'](_0x1a055a,_0xbfd5f4);};}function removeListener(_0x133d85,_0x1d8a23){return function(){ChatInternalMessageEvents[_0x3228('0x4')](_0x133d85,_0x1d8a23);};}exports[_0x3228('0x5')]=function(_0x59b525){for(var _0x2a4a0c=0x0,_0x49ef03=events['length'];_0x2a4a0c<_0x49ef03;_0x2a4a0c++){var _0x5c4c5b=events[_0x2a4a0c];var _0x498a51=createListener('chatInternalMessage:'+_0x5c4c5b,_0x59b525);ChatInternalMessageEvents['on'](_0x5c4c5b,_0x498a51);}};
\ No newline at end of file
+var _0x849e=['./chatInternalMessage.events','save','remove','update','length','chatInternalMessage:'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x849e,0xb4));var _0xe849=function(_0x374cbc,_0x37460){_0x374cbc=_0x374cbc-0x0;var _0x45e20b=_0x849e[_0x374cbc];return _0x45e20b;};'use strict';var ChatInternalMessageEvents=require(_0xe849('0x0'));var events=[_0xe849('0x1'),_0xe849('0x2'),_0xe849('0x3')];function createListener(_0x6ce360,_0x1aed09){return function(_0x41f4e4){_0x1aed09['emit'](_0x6ce360,_0x41f4e4);};}function removeListener(_0x5bac9a,_0x5c87ce){return function(){ChatInternalMessageEvents['removeListener'](_0x5bac9a,_0x5c87ce);};}exports['register']=function(_0x3e4ec1){for(var _0x1a5757=0x0,_0x519c27=events[_0xe849('0x4')];_0x1a5757<_0x519c27;_0x1a5757++){var _0x562d16=events[_0x1a5757];var _0x3020ef=createListener(_0xe849('0x5')+_0x562d16,_0x3e4ec1);ChatInternalMessageEvents['on'](_0x562d16,_0x3020ef);}};
\ No newline at end of file
index 62bc4ca..44394e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f79=['create','put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4f79,0x1d2));var _0x94f7=function(_0x298e9f,_0x157cf8){_0x298e9f=_0x298e9f-0x0;var _0xd15552=_0x4f79[_0x298e9f];return _0xd15552;};'use strict';var multer=require(_0x94f7('0x0'));var util=require(_0x94f7('0x1'));var path=require('path');var timeout=require(_0x94f7('0x2'));var express=require(_0x94f7('0x3'));var router=express[_0x94f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x94f7('0x5'));var interaction=require(_0x94f7('0x6'));var config=require(_0x94f7('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x94f7('0x8')]('/',auth[_0x94f7('0x9')](),controller[_0x94f7('0xa')]);router[_0x94f7('0x8')]('/describe',auth[_0x94f7('0x9')](),controller[_0x94f7('0xb')]);router[_0x94f7('0x8')](_0x94f7('0xc'),auth[_0x94f7('0x9')](),controller[_0x94f7('0xd')]);router[_0x94f7('0x8')](_0x94f7('0xe'),auth[_0x94f7('0x9')](),controller[_0x94f7('0xf')]);router[_0x94f7('0x10')]('/',auth['isAuthenticated'](),controller[_0x94f7('0x11')]);router[_0x94f7('0x12')](_0x94f7('0xe'),controller[_0x94f7('0x13')]);router[_0x94f7('0x14')](_0x94f7('0xe'),auth[_0x94f7('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x51e4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x5761b8,_0x27fbf9){var _0x1e7ae0=function(_0xc26727){while(--_0xc26727){_0x5761b8['push'](_0x5761b8['shift']());}};_0x1e7ae0(++_0x27fbf9);}(_0x51e4,0x18b));var _0x451e=function(_0x180fcb,_0x208b94){_0x180fcb=_0x180fcb-0x0;var _0x515f0d=_0x51e4[_0x180fcb];return _0x515f0d;};'use strict';var multer=require(_0x451e('0x0'));var util=require(_0x451e('0x1'));var path=require(_0x451e('0x2'));var timeout=require(_0x451e('0x3'));var express=require(_0x451e('0x4'));var router=express[_0x451e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x451e('0x6'));var interaction=require(_0x451e('0x7'));var config=require(_0x451e('0x8'));var controller=require(_0x451e('0x9'));router[_0x451e('0xa')]('/',auth[_0x451e('0xb')](),controller['index']);router[_0x451e('0xa')](_0x451e('0xc'),auth[_0x451e('0xb')](),controller['describe']);router['get'](_0x451e('0xd'),auth[_0x451e('0xb')](),controller['getUsers']);router[_0x451e('0xa')](_0x451e('0xe'),auth['isAuthenticated'](),controller[_0x451e('0xf')]);router['post']('/',auth[_0x451e('0xb')](),controller['create']);router[_0x451e('0x10')](_0x451e('0xe'),controller[_0x451e('0x11')]);router[_0x451e('0x12')]('/:id',auth[_0x451e('0xb')](),controller[_0x451e('0x13')]);module['exports']=router;
\ No newline at end of file
index 0add3bf..6aa23c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ea2=['ENUM','out','DATE','sequelize','medium','BOOLEAN'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x5ea2,0x99));var _0x25ea=function(_0x366757,_0x4d95f9){_0x366757=_0x366757-0x0;var _0x51f92d=_0x5ea2[_0x366757];return _0x51f92d;};'use strict';var Sequelize=require(_0x25ea('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x25ea('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x25ea('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x25ea('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x25ea('0x3')]('in',_0x25ea('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x25ea('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9e5e=['exports','medium','BOOLEAN','out','DATE','STRING','sequelize'];(function(_0x3c7cca,_0x3f9621){var _0x5c08cd=function(_0x21a761){while(--_0x21a761){_0x3c7cca['push'](_0x3c7cca['shift']());}};_0x5c08cd(++_0x3f9621);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x9e5e[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe9e5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe9e5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe9e5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe9e5('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xe9e5('0x5')]},'providerName':{'type':Sequelize[_0xe9e5('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 38b5d84..11113c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x468c29,_0xe23b46){var _0x446837=function(_0x12095a){while(--_0x12095a){_0x468c29['push'](_0x468c29['shift']());}};_0x446837(++_0xe23b46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x5cb7b0,_0x3b5793){var _0x448a44=function(_0x429bee){while(--_0x429bee){_0x5cb7b0['push'](_0x5cb7b0['shift']());}};_0x448a44(++_0x3b5793);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
index 66e0cb2..7477e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b13=['ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x4eb3bb,_0x56bbb9){var _0xb71763=function(_0x123eb5){while(--_0x123eb5){_0x4eb3bb['push'](_0x4eb3bb['shift']());}};_0xb71763(++_0x56bbb9);}(_0x6b13,0x11f));var _0x36b1=function(_0x83420c,_0x50fd91){_0x83420c=_0x83420c-0x0;var _0x1057d7=_0x6b13[_0x83420c];return _0x1057d7;};'use strict';var EventEmitter=require(_0x36b1('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x36b1('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x36b1('0x2')](0x0);var events={'afterCreate':_0x36b1('0x3'),'afterUpdate':'update','afterDestroy':_0x36b1('0x4')};function emitEvent(_0x59a793){return function(_0x253c98,_0x514c6b,_0x18d3e8){ChatMessageEvents[_0x36b1('0x5')](_0x59a793+':'+_0x253c98['id'],_0x253c98);ChatMessageEvents[_0x36b1('0x5')](_0x59a793,_0x253c98);_0x18d3e8(null);};}for(var e in events){if(events[_0x36b1('0x6')](e)){var event=events[e];ChatMessage[_0x36b1('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x1c11=['ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x119ffd,_0x15bd2f){var _0x264e2c=function(_0x5b978f){while(--_0x5b978f){_0x119ffd['push'](_0x119ffd['shift']());}};_0x264e2c(++_0x15bd2f);}(_0x1c11,0xbf));var _0x11c1=function(_0xce923d,_0x1e1168){_0xce923d=_0xce923d-0x0;var _0x10d7a5=_0x1c11[_0xce923d];return _0x10d7a5;};'use strict';var EventEmitter=require(_0x11c1('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x11c1('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x11c1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11c1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cbbd3){return function(_0x217438,_0x362aa5,_0x2f1537){ChatMessageEvents[_0x11c1('0x4')](_0x3cbbd3+':'+_0x217438['id'],_0x217438);ChatMessageEvents['emit'](_0x3cbbd3,_0x217438);_0x2f1537(null);};}for(var e in events){if(events[_0x11c1('0x5')](e)){var event=events[e];ChatMessage[_0x11c1('0x6')](e,emitEvent(event));}}module[_0x11c1('0x7')]=ChatMessageEvents;
\ No newline at end of file
index 77ed924..cc880b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf412=['UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x5ba92a,_0x3d9c45){var _0x2d36b6=function(_0x3806ce){while(--_0x3806ce){_0x5ba92a['push'](_0x5ba92a['shift']());}};_0x2d36b6(++_0x3d9c45);}(_0xf412,0x121));var _0x2f41=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0xf412[_0x4f8f3b];return _0x4c250c;};'use strict';var _=require(_0x2f41('0x0'));var util=require(_0x2f41('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2f41('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f41('0x3'));var rimraf=require(_0x2f41('0x4'));var config=require(_0x2f41('0x5'));var attributes=require(_0x2f41('0x6'));module[_0x2f41('0x7')]=function(_0x48e094,_0x16b8b1){return _0x48e094['define'](_0x2f41('0x8'),attributes,{'tableName':_0x2f41('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x2f41('0xa')],'type':_0x2f41('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x33e689,_0x324e87,_0x2983f1){var _0x10fcd2=_0x48e094[_0x2f41('0xc')];var _0x24eaee=_0x33e689[_0x2f41('0xd')]({'plain':!![]});if(_0x24eaee[_0x2f41('0xe')][_0x2f41('0xf')]()==='in'||_0x24eaee['direction'][_0x2f41('0xf')]()===_0x2f41('0x10')&&!_0x24eaee[_0x2f41('0x11')]&&!_[_0x2f41('0x12')](_0x24eaee[_0x2f41('0x13')])){_0x10fcd2[_0x2f41('0x14')]['findOne']({'where':{'id':_0x24eaee[_0x2f41('0x15')]}})[_0x2f41('0x16')](function(_0x424164){if(_0x424164){_0x424164[_0x2f41('0x17')]({'lastMsgAt':_0x24eaee[_0x2f41('0x18')],'lastMsgDirection':_0x24eaee['direction'][_0x2f41('0xf')]()});}})[_0x2f41('0x19')](function(_0x31903b){console[_0x2f41('0x1a')](_0x31903b);});}_0x2983f1();}},'charset':'utf8mb4','collate':_0x2f41('0x1b')});};
\ No newline at end of file
+var _0xa8fc=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','then','update','createdAt'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0xa8fc,0x144));var _0xca8f=function(_0x10cf4e,_0x3290e9){_0x10cf4e=_0x10cf4e-0x0;var _0x238609=_0xa8fc[_0x10cf4e];return _0x238609;};'use strict';var _=require(_0xca8f('0x0'));var util=require(_0xca8f('0x1'));var logger=require(_0xca8f('0x2'))(_0xca8f('0x3'));var moment=require(_0xca8f('0x4'));var BPromise=require(_0xca8f('0x5'));var rp=require(_0xca8f('0x6'));var fs=require('fs');var path=require(_0xca8f('0x7'));var rimraf=require(_0xca8f('0x8'));var config=require(_0xca8f('0x9'));var attributes=require(_0xca8f('0xa'));module['exports']=function(_0x412862,_0x2bef4e){return _0x412862[_0xca8f('0xb')](_0xca8f('0xc'),attributes,{'tableName':_0xca8f('0xd'),'paranoid':![],'indexes':[{'name':_0xca8f('0xe'),'fields':[_0xca8f('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29f6bb,_0x5895a9,_0x40c26d){var _0xc5645d=_0x412862[_0xca8f('0x10')];var _0x5ac313=_0x29f6bb[_0xca8f('0x11')]({'plain':!![]});if(_0x5ac313[_0xca8f('0x12')][_0xca8f('0x13')]()==='in'||_0x5ac313[_0xca8f('0x12')][_0xca8f('0x13')]()===_0xca8f('0x14')&&!_0x5ac313[_0xca8f('0x15')]&&!_[_0xca8f('0x16')](_0x5ac313['UserId'])){_0xc5645d[_0xca8f('0x17')][_0xca8f('0x18')]({'where':{'id':_0x5ac313['ChatInteractionId']}})[_0xca8f('0x19')](function(_0x488d63){if(_0x488d63){_0x488d63[_0xca8f('0x1a')]({'lastMsgAt':_0x5ac313[_0xca8f('0x1b')],'lastMsgDirection':_0x5ac313[_0xca8f('0x12')]['toLowerCase']()});}})[_0xca8f('0x1c')](function(_0x514aec){console[_0xca8f('0x1d')](_0x514aec);});}_0x40c26d();}},'charset':_0xca8f('0x1e'),'collate':_0xca8f('0x1f')});};
\ No newline at end of file
index 6edad8a..739d018 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa976=['ChatMessage,\x20%s,\x20%s','CreateChatMessage','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x15f50d,_0x1865c6){var _0x160a8e=function(_0x8b522a){while(--_0x8b522a){_0x15f50d['push'](_0x15f50d['shift']());}};_0x160a8e(++_0x1865c6);}(_0xa976,0xd7));var _0x6a97=function(_0x1b9923,_0x4d76e5){_0x1b9923=_0x1b9923-0x0;var _0x2797c4=_0xa976[_0x1b9923];return _0x2797c4;};'use strict';var _=require(_0x6a97('0x0'));var util=require(_0x6a97('0x1'));var moment=require('moment');var BPromise=require(_0x6a97('0x2'));var rs=require(_0x6a97('0x3'));var fs=require('fs');var Redis=require(_0x6a97('0x4'));var db=require(_0x6a97('0x5'))['db'];var utils=require(_0x6a97('0x6'));var logger=require(_0x6a97('0x7'))('rpc');var config=require(_0x6a97('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6a97('0x9')][_0x6a97('0xa')]({'port':0x232a});config[_0x6a97('0xb')]=_['defaults'](config[_0x6a97('0xb')],{'host':_0x6a97('0xc'),'port':0x18eb});var socket=require(_0x6a97('0xd'))(new Redis(config[_0x6a97('0xb')]));require(_0x6a97('0xe'))[_0x6a97('0xf')](socket);function respondWithRpcPromise(_0x4531ec,_0x26712d,_0x538b68){return new BPromise(function(_0x118d67,_0x450bc7){return client['request'](_0x4531ec,_0x538b68)[_0x6a97('0x10')](function(_0x58c92a){logger[_0x6a97('0x11')]('ChatMessage,\x20%s,\x20%s',_0x26712d,_0x6a97('0x12'));logger['debug'](_0x6a97('0x13'),_0x26712d,_0x6a97('0x12'),JSON[_0x6a97('0x14')](_0x58c92a));if(_0x58c92a[_0x6a97('0x15')]){if(_0x58c92a[_0x6a97('0x15')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x26712d,_0x58c92a[_0x6a97('0x15')][_0x6a97('0x16')]);return _0x450bc7(_0x58c92a[_0x6a97('0x15')][_0x6a97('0x16')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x26712d,_0x58c92a[_0x6a97('0x15')]['message']);return _0x118d67(_0x58c92a[_0x6a97('0x15')][_0x6a97('0x16')]);}else{logger[_0x6a97('0x11')]('ChatMessage,\x20%s,\x20%s',_0x26712d,'request\x20sent');_0x118d67(_0x58c92a[_0x6a97('0x17')]['message']);}})[_0x6a97('0x18')](function(_0x19e490){logger['error'](_0x6a97('0x19'),_0x26712d,_0x19e490);_0x450bc7(_0x19e490);});});}exports[_0x6a97('0x1a')]=function(_0x420caf){var _0x4c8cb1=this;return new Promise(function(_0x40756e,_0x30c1df){return db['ChatMessage'][_0x6a97('0x1b')](_0x420caf['body'],{'raw':_0x420caf[_0x6a97('0x1c')]?_0x420caf[_0x6a97('0x1c')][_0x6a97('0x1d')]===undefined?!![]:![]:!![]})[_0x6a97('0x10')](function(_0x14fa50){logger[_0x6a97('0x11')]('CreateChatMessage',_0x420caf);logger['debug'](_0x6a97('0x1a'),_0x420caf,JSON[_0x6a97('0x14')](_0x14fa50));_0x40756e(_0x14fa50);})['catch'](function(_0x4e6cc8){logger[_0x6a97('0x15')](_0x6a97('0x1a'),_0x4e6cc8['message'],_0x420caf);_0x30c1df(_0x4c8cb1[_0x6a97('0x15')](0x1f4,_0x4e6cc8['message']));});});};
\ No newline at end of file
+var _0x1e8f=['socket.io-emitter','register','request','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','info','result','catch','CreateChatMessage','ChatMessage','body','options','then','debug','stringify','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x11d326,_0x3d48f6){var _0x304839=function(_0x352267){while(--_0x352267){_0x11d326['push'](_0x11d326['shift']());}};_0x304839(++_0x3d48f6);}(_0x1e8f,0x149));var _0xf1e8=function(_0x31fee1,_0x8d0b5){_0x31fee1=_0x31fee1-0x0;var _0x834e13=_0x1e8f[_0x31fee1];return _0x834e13;};'use strict';var _=require('lodash');var util=require(_0xf1e8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf1e8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1e8('0x2'))['db'];var utils=require(_0xf1e8('0x3'));var logger=require(_0xf1e8('0x4'))(_0xf1e8('0x5'));var config=require(_0xf1e8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf1e8('0x7')][_0xf1e8('0x8')]({'port':0x232a});config[_0xf1e8('0x9')]=_[_0xf1e8('0xa')](config[_0xf1e8('0x9')],{'host':_0xf1e8('0xb'),'port':0x18eb});var socket=require(_0xf1e8('0xc'))(new Redis(config[_0xf1e8('0x9')]));require('./chatMessage.socket')[_0xf1e8('0xd')](socket);function respondWithRpcPromise(_0x411f33,_0x1251b4,_0x2dfc0d){return new BPromise(function(_0x2b3ee4,_0x42f9fe){return client[_0xf1e8('0xe')](_0x411f33,_0x2dfc0d)['then'](function(_0x582529){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1251b4,_0xf1e8('0xf'));logger['debug'](_0xf1e8('0x10'),_0x1251b4,_0xf1e8('0xf'),JSON['stringify'](_0x582529));if(_0x582529[_0xf1e8('0x11')]){if(_0x582529[_0xf1e8('0x11')][_0xf1e8('0x12')]===0x1f4){logger[_0xf1e8('0x11')]('ChatMessage,\x20%s,\x20%s',_0x1251b4,_0x582529[_0xf1e8('0x11')][_0xf1e8('0x13')]);return _0x42f9fe(_0x582529['error']['message']);}logger['error'](_0xf1e8('0x14'),_0x1251b4,_0x582529['error'][_0xf1e8('0x13')]);return _0x2b3ee4(_0x582529[_0xf1e8('0x11')][_0xf1e8('0x13')]);}else{logger[_0xf1e8('0x15')](_0xf1e8('0x14'),_0x1251b4,_0xf1e8('0xf'));_0x2b3ee4(_0x582529[_0xf1e8('0x16')][_0xf1e8('0x13')]);}})[_0xf1e8('0x17')](function(_0x27c3e4){logger[_0xf1e8('0x11')](_0xf1e8('0x14'),_0x1251b4,_0x27c3e4);_0x42f9fe(_0x27c3e4);});});}exports[_0xf1e8('0x18')]=function(_0x23051c){var _0x175a7b=this;return new Promise(function(_0x277943,_0x19c91a){return db[_0xf1e8('0x19')]['create'](_0x23051c[_0xf1e8('0x1a')],{'raw':_0x23051c[_0xf1e8('0x1b')]?_0x23051c[_0xf1e8('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf1e8('0x1c')](function(_0x2988b7){logger[_0xf1e8('0x15')]('CreateChatMessage',_0x23051c);logger[_0xf1e8('0x1d')]('CreateChatMessage',_0x23051c,JSON[_0xf1e8('0x1e')](_0x2988b7));_0x277943(_0x2988b7);})[_0xf1e8('0x17')](function(_0x2f149d){logger['error'](_0xf1e8('0x18'),_0x2f149d['message'],_0x23051c);_0x19c91a(_0x175a7b['error'](0x1f4,_0x2f149d[_0xf1e8('0x13')]));});});};
\ No newline at end of file
index 68b71e8..7b6befe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec46=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0xfbbae2,_0x119555){var _0x2a2543=function(_0x31376d){while(--_0x31376d){_0xfbbae2['push'](_0xfbbae2['shift']());}};_0x2a2543(++_0x119555);}(_0xec46,0x19c));var _0x6ec4=function(_0x345a1b,_0x189c9e){_0x345a1b=_0x345a1b-0x0;var _0x1b24ec=_0xec46[_0x345a1b];return _0x1b24ec;};'use strict';var ChatMessageEvents=require(_0x6ec4('0x0'));var events=[_0x6ec4('0x1'),_0x6ec4('0x2'),_0x6ec4('0x3')];function createListener(_0x5e854b,_0x5052d2){return function(_0x307c5c){_0x5052d2[_0x6ec4('0x4')](_0x5e854b,_0x307c5c);};}function removeListener(_0x86b9f8,_0x53bbed){return function(){ChatMessageEvents[_0x6ec4('0x5')](_0x86b9f8,_0x53bbed);};}exports[_0x6ec4('0x6')]=function(_0x55b203){for(var _0x533fda=0x0,_0x55d260=events[_0x6ec4('0x7')];_0x533fda<_0x55d260;_0x533fda++){var _0x391ed9=events[_0x533fda];var _0x42b81b=createListener(_0x6ec4('0x8')+_0x391ed9,_0x55b203);ChatMessageEvents['on'](_0x391ed9,_0x42b81b);}};
\ No newline at end of file
+var _0x8c52=['./chatMessage.events','remove','update','emit','removeListener','register','chatMessage:'];(function(_0x4dc46a,_0x47fbd7){var _0x29fbcb=function(_0xeb2ae1){while(--_0xeb2ae1){_0x4dc46a['push'](_0x4dc46a['shift']());}};_0x29fbcb(++_0x47fbd7);}(_0x8c52,0x7e));var _0x28c5=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x8c52[_0x3e961c];return _0x474f9c;};'use strict';var ChatMessageEvents=require(_0x28c5('0x0'));var events=['save',_0x28c5('0x1'),_0x28c5('0x2')];function createListener(_0x3d994a,_0x37c10f){return function(_0x398f22){_0x37c10f[_0x28c5('0x3')](_0x3d994a,_0x398f22);};}function removeListener(_0x412a0a,_0x3b6b48){return function(){ChatMessageEvents[_0x28c5('0x4')](_0x412a0a,_0x3b6b48);};}exports[_0x28c5('0x5')]=function(_0x209f3d){for(var _0x3b5c38=0x0,_0x53584d=events['length'];_0x3b5c38<_0x53584d;_0x3b5c38++){var _0x5d9299=events[_0x3b5c38];var _0x5099e8=createListener(_0x28c5('0x6')+_0x5d9299,_0x209f3d);ChatMessageEvents['on'](_0x5d9299,_0x5099e8);}};
\ No newline at end of file
index 074cdd9..51a4781 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa55d=['get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','update','/:id/accept','accept','put','destroy','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index'];(function(_0x26e895,_0x4d25e0){var _0x3dfcf1=function(_0x440d25){while(--_0x440d25){_0x26e895['push'](_0x26e895['shift']());}};_0x3dfcf1(++_0x4d25e0);}(_0xa55d,0x16e));var _0xda55=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa55d[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xda55('0x0'));var timeout=require(_0xda55('0x1'));var express=require(_0xda55('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xda55('0x3'));var interaction=require(_0xda55('0x4'));var config=require('../../config/environment');var controller=require(_0xda55('0x5'));router['get']('/',auth[_0xda55('0x6')](),controller[_0xda55('0x7')]);router[_0xda55('0x8')](_0xda55('0x9'),auth[_0xda55('0x6')](),controller[_0xda55('0xa')]);router[_0xda55('0x8')](_0xda55('0xb'),auth[_0xda55('0x6')](),controller[_0xda55('0xc')]);router[_0xda55('0xd')]('/',auth['isAuthenticated'](),interaction[_0xda55('0xe')](_0xda55('0xf'),_0xda55('0x10')),controller['create']);router['put'](_0xda55('0xb'),controller[_0xda55('0x11')]);router['put'](_0xda55('0x12'),auth[_0xda55('0x6')](),controller[_0xda55('0x13')]);router[_0xda55('0x14')]('/:id/reject',auth[_0xda55('0x6')](),controller['reject']);router['delete'](_0xda55('0xb'),auth[_0xda55('0x6')](),controller[_0xda55('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x75b7=['/:id','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x3ef526,_0x2cb29d){var _0x257f66=function(_0x52f25f){while(--_0x52f25f){_0x3ef526['push'](_0x3ef526['shift']());}};_0x257f66(++_0x2cb29d);}(_0x75b7,0x1cc));var _0x775b=function(_0x5ae3e5,_0x4561e7){_0x5ae3e5=_0x5ae3e5-0x0;var _0x3c93c7=_0x75b7[_0x5ae3e5];return _0x3c93c7;};'use strict';var multer=require(_0x775b('0x0'));var util=require(_0x775b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x775b('0x2')]();var fs_extra=require(_0x775b('0x3'));var auth=require(_0x775b('0x4'));var interaction=require(_0x775b('0x5'));var config=require(_0x775b('0x6'));var controller=require(_0x775b('0x7'));router[_0x775b('0x8')]('/',auth[_0x775b('0x9')](),controller[_0x775b('0xa')]);router[_0x775b('0x8')](_0x775b('0xb'),auth['isAuthenticated'](),controller[_0x775b('0xc')]);router['get']('/:id',auth[_0x775b('0x9')](),controller[_0x775b('0xd')]);router[_0x775b('0xe')]('/',auth[_0x775b('0x9')](),interaction[_0x775b('0xf')](_0x775b('0x10'),_0x775b('0x11')),controller[_0x775b('0x12')]);router[_0x775b('0x13')]('/:id',controller[_0x775b('0x14')]);router[_0x775b('0x13')](_0x775b('0x15'),auth[_0x775b('0x9')](),controller[_0x775b('0x16')]);router['put'](_0x775b('0x17'),auth['isAuthenticated'](),controller[_0x775b('0x18')]);router[_0x775b('0x19')](_0x775b('0x1a'),auth[_0x775b('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 64b6c72..cdd77a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3767=['medium','sequelize'];(function(_0x27fe26,_0x3b8ca7){var _0x4fcb35=function(_0x35e0ae){while(--_0x35e0ae){_0x27fe26['push'](_0x27fe26['shift']());}};_0x4fcb35(++_0x3b8ca7);}(_0x3767,0x1d3));var _0x7376=function(_0x1cfed7,_0x123cf8){_0x1cfed7=_0x1cfed7-0x0;var _0x330ef1=_0x3767[_0x1cfed7];return _0x330ef1;};'use strict';var Sequelize=require(_0x7376('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7376('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0xa192=['exports','TEXT'];(function(_0x2b0690,_0x4f742f){var _0x82be1=function(_0x1e1084){while(--_0x1e1084){_0x2b0690['push'](_0x2b0690['shift']());}};_0x82be1(++_0x4f742f);}(_0xa192,0x12e));var _0x2a19=function(_0x45b3ed,_0x192e1a){_0x45b3ed=_0x45b3ed-0x0;var _0x5502a5=_0xa192[_0x45b3ed];return _0x5502a5;};'use strict';var Sequelize=require('sequelize');module[_0x2a19('0x0')]={'body':{'type':Sequelize[_0x2a19('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
index f0f7eae..e87ea0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x7a54,0x106));var _0x47a5=function(_0x5900a,_0x34660f){_0x5900a=_0x5900a-0x0;var _0x316199=_0x7a54[_0x5900a];return _0x316199;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x35cad5,_0x36c77a){var _0x213ddc=function(_0x20dfac){while(--_0x20dfac){_0x35cad5['push'](_0x35cad5['shift']());}};_0x213ddc(++_0x36c77a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['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 3c10fc5..a5799d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd241=['../../config/logger','api','moment','bluebird','path','rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xd241,0x1d2));var _0x1d24=function(_0x40ad90,_0x20ae1e){_0x40ad90=_0x40ad90-0x0;var _0x1bec55=_0xd241[_0x40ad90];return _0x1bec55;};'use strict';var _=require(_0x1d24('0x0'));var util=require(_0x1d24('0x1'));var logger=require(_0x1d24('0x2'))(_0x1d24('0x3'));var moment=require(_0x1d24('0x4'));var BPromise=require(_0x1d24('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d24('0x6'));var rimraf=require(_0x1d24('0x7'));var config=require('../../config/environment');var attributes=require(_0x1d24('0x8'));module['exports']=function(_0x1aeb61,_0x372c4d){return _0x1aeb61[_0x1d24('0x9')](_0x1d24('0xa'),attributes,{'tableName':_0x1d24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1d24('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8690=['request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','api','bluebird'];(function(_0xe609de,_0x1ef5fc){var _0x5aafbd=function(_0x2510c){while(--_0x2510c){_0xe609de['push'](_0xe609de['shift']());}};_0x5aafbd(++_0x1ef5fc);}(_0x8690,0x1df));var _0x0869=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x8690[_0x334d1e];return _0x3b33ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0869('0x0'));var moment=require('moment');var BPromise=require(_0x0869('0x1'));var rp=require(_0x0869('0x2'));var fs=require('fs');var path=require(_0x0869('0x3'));var rimraf=require(_0x0869('0x4'));var config=require(_0x0869('0x5'));var attributes=require(_0x0869('0x6'));module[_0x0869('0x7')]=function(_0x174c88,_0x53fdb9){return _0x174c88[_0x0869('0x8')](_0x0869('0x9'),attributes,{'tableName':_0x0869('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0869('0xb'),'collate':_0x0869('0xc')});};
\ No newline at end of file
index d6fd100..019700a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a1b=['error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3199af,_0x339560){var _0x5aa4d0=function(_0x1cb5f0){while(--_0x1cb5f0){_0x3199af['push'](_0x3199af['shift']());}};_0x5aa4d0(++_0x339560);}(_0x7a1b,0x11c));var _0xb7a1=function(_0x342f86,_0x137b19){_0x342f86=_0x342f86-0x0;var _0x2a3085=_0x7a1b[_0x342f86];return _0x2a3085;};'use strict';var _=require(_0xb7a1('0x0'));var util=require(_0xb7a1('0x1'));var moment=require('moment');var BPromise=require(_0xb7a1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7a1('0x3'))['db'];var utils=require(_0xb7a1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb7a1('0x5'));var jayson=require(_0xb7a1('0x6'));var client=jayson[_0xb7a1('0x7')][_0xb7a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d899b,_0x588b6a,_0x584afe){return new BPromise(function(_0xa9e78e,_0x100e99){return client['request'](_0x1d899b,_0x584afe)[_0xb7a1('0x9')](function(_0x3964a4){logger[_0xb7a1('0xa')](_0xb7a1('0xb'),_0x588b6a,'request\x20sent');logger[_0xb7a1('0xc')](_0xb7a1('0xd'),_0x588b6a,_0xb7a1('0xe'),JSON[_0xb7a1('0xf')](_0x3964a4));if(_0x3964a4['error']){if(_0x3964a4[_0xb7a1('0x10')][_0xb7a1('0x11')]===0x1f4){logger[_0xb7a1('0x10')](_0xb7a1('0xb'),_0x588b6a,_0x3964a4[_0xb7a1('0x10')][_0xb7a1('0x12')]);return _0x100e99(_0x3964a4[_0xb7a1('0x10')][_0xb7a1('0x12')]);}logger[_0xb7a1('0x10')](_0xb7a1('0xb'),_0x588b6a,_0x3964a4['error'][_0xb7a1('0x12')]);return _0xa9e78e(_0x3964a4[_0xb7a1('0x10')][_0xb7a1('0x12')]);}else{logger['info'](_0xb7a1('0xb'),_0x588b6a,'request\x20sent');_0xa9e78e(_0x3964a4['result'][_0xb7a1('0x12')]);}})[_0xb7a1('0x13')](function(_0x1f1f7d){logger[_0xb7a1('0x10')](_0xb7a1('0xb'),_0x588b6a,_0x1f1f7d);_0x100e99(_0x1f1f7d);});});}
\ No newline at end of file
+var _0xf670=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x221952,_0x55ec08){var _0x51e994=function(_0x323927){while(--_0x323927){_0x221952['push'](_0x221952['shift']());}};_0x51e994(++_0x55ec08);}(_0xf670,0x8d));var _0x0f67=function(_0x57643b,_0x1706fe){_0x57643b=_0x57643b-0x0;var _0x53a35b=_0xf670[_0x57643b];return _0x53a35b;};'use strict';var _=require('lodash');var util=require(_0x0f67('0x0'));var moment=require(_0x0f67('0x1'));var BPromise=require(_0x0f67('0x2'));var rs=require(_0x0f67('0x3'));var fs=require('fs');var Redis=require(_0x0f67('0x4'));var db=require(_0x0f67('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f67('0x6'))(_0x0f67('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f67('0x8')][_0x0f67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd6248b,_0x248449,_0x4fc325){return new BPromise(function(_0x5f2f5d,_0x369cf8){return client[_0x0f67('0xa')](_0xd6248b,_0x4fc325)[_0x0f67('0xb')](function(_0x41cf31){logger[_0x0f67('0xc')](_0x0f67('0xd'),_0x248449,_0x0f67('0xe'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x248449,_0x0f67('0xe'),JSON['stringify'](_0x41cf31));if(_0x41cf31[_0x0f67('0xf')]){if(_0x41cf31['error'][_0x0f67('0x10')]===0x1f4){logger['error'](_0x0f67('0xd'),_0x248449,_0x41cf31[_0x0f67('0xf')][_0x0f67('0x11')]);return _0x369cf8(_0x41cf31['error'][_0x0f67('0x11')]);}logger[_0x0f67('0xf')](_0x0f67('0xd'),_0x248449,_0x41cf31[_0x0f67('0xf')][_0x0f67('0x11')]);return _0x5f2f5d(_0x41cf31[_0x0f67('0xf')][_0x0f67('0x11')]);}else{logger[_0x0f67('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x248449,_0x0f67('0xe'));_0x5f2f5d(_0x41cf31[_0x0f67('0x12')][_0x0f67('0x11')]);}})[_0x0f67('0x13')](function(_0x4f4f9f){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x248449,_0x4f4f9f);_0x369cf8(_0x4f4f9f);});});}
\ No newline at end of file
index 6e398b8..93de6ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x871a=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x465465,_0x1d58d2){var _0x278c1e=function(_0x553ff7){while(--_0x553ff7){_0x465465['push'](_0x465465['shift']());}};_0x278c1e(++_0x1d58d2);}(_0x871a,0xd8));var _0xa871=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0x871a[_0x139b85];return _0x1e833f;};'use strict';var multer=require(_0xa871('0x0'));var util=require(_0xa871('0x1'));var path=require('path');var timeout=require(_0xa871('0x2'));var express=require(_0xa871('0x3'));var router=express['Router']();var fs_extra=require(_0xa871('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa871('0x5'));var config=require(_0xa871('0x6'));var controller=require(_0xa871('0x7'));router['get']('/',auth[_0xa871('0x8')](),controller[_0xa871('0x9')]);router[_0xa871('0xa')](_0xa871('0xb'),auth[_0xa871('0x8')](),controller[_0xa871('0xc')]);router[_0xa871('0xa')](_0xa871('0xd'),auth[_0xa871('0x8')](),controller[_0xa871('0xe')]);router[_0xa871('0xf')]('/',auth[_0xa871('0x8')](),controller[_0xa871('0x10')]);router[_0xa871('0x11')](_0xa871('0xd'),auth['isAuthenticated'](),controller[_0xa871('0x12')]);router[_0xa871('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa871('0x14')]=router;
\ No newline at end of file
+var _0x7b9d=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7b9d,0x119));var _0xd7b9=function(_0x592416,_0x2c75e9){_0x592416=_0x592416-0x0;var _0x3005fa=_0x7b9d[_0x592416];return _0x3005fa;};'use strict';var multer=require(_0xd7b9('0x0'));var util=require(_0xd7b9('0x1'));var path=require(_0xd7b9('0x2'));var timeout=require(_0xd7b9('0x3'));var express=require(_0xd7b9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd7b9('0x5'));var interaction=require(_0xd7b9('0x6'));var config=require(_0xd7b9('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0xd7b9('0x8')]('/',auth[_0xd7b9('0x9')](),controller['index']);router[_0xd7b9('0x8')](_0xd7b9('0xa'),auth[_0xd7b9('0x9')](),controller[_0xd7b9('0xb')]);router['get'](_0xd7b9('0xc'),auth[_0xd7b9('0x9')](),controller['show']);router[_0xd7b9('0xd')]('/',auth[_0xd7b9('0x9')](),controller[_0xd7b9('0xe')]);router[_0xd7b9('0xf')](_0xd7b9('0xc'),auth[_0xd7b9('0x9')](),controller[_0xd7b9('0x10')]);router[_0xd7b9('0x11')](_0xd7b9('0xc'),auth['isAuthenticated'](),controller[_0xd7b9('0x12')]);module['exports']=router;
\ No newline at end of file
index e011fe5..95b1a2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e42=['sequelize','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x486271,_0x3b6c33){var _0x40d073=function(_0x1b5a1d){while(--_0x1b5a1d){_0x486271['push'](_0x486271['shift']());}};_0x40d073(++_0x3b6c33);}(_0x4e42,0xd2));var _0x24e4=function(_0x2d6533,_0x19f68c){_0x2d6533=_0x2d6533-0x0;var _0x26c12f=_0x4e42[_0x2d6533];return _0x26c12f;};'use strict';var Sequelize=require(_0x24e4('0x0'));module['exports']={'name':{'type':Sequelize[_0x24e4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x24e4('0x2')](_0x24e4('0x3'),_0x24e4('0x4')),'defaultValue':_0x24e4('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x24e4('0x5')]}};
\ No newline at end of file
+var _0x405e=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x4afa89,_0x1b9ed3){var _0x151c58=function(_0x406491){while(--_0x406491){_0x4afa89['push'](_0x4afa89['shift']());}};_0x151c58(++_0x1b9ed3);}(_0x405e,0x111));var _0xe405=function(_0x2ebb5c,_0x5efe37){_0x2ebb5c=_0x2ebb5c-0x0;var _0x5d965f=_0x405e[_0x2ebb5c];return _0x5d965f;};'use strict';var Sequelize=require(_0xe405('0x0'));module[_0xe405('0x1')]={'name':{'type':Sequelize[_0xe405('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe405('0x3')](_0xe405('0x4'),_0xe405('0x5')),'defaultValue':_0xe405('0x4')},'selector':{'type':Sequelize[_0xe405('0x2')]},'timeout':{'type':Sequelize[_0xe405('0x6')]}};
\ No newline at end of file
index a77231d..2b60135 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49fe=['intersection','attributes','fields','length','includeAll','include','merge','options','catch','create','body','find','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x49fe,0x100));var _0xe49f=function(_0xf29ecd,_0x1444e4){_0xf29ecd=_0xf29ecd-0x0;var _0x31f727=_0x49fe[_0xf29ecd];return _0x31f727;};'use strict';var emlformat=require(_0xe49f('0x0'));var rimraf=require(_0xe49f('0x1'));var zipdir=require(_0xe49f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe49f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe49f('0x4'));var util=require(_0xe49f('0x5'));var path=require(_0xe49f('0x6'));var sox=require(_0xe49f('0x7'));var csv=require('to-csv');var ejs=require(_0xe49f('0x8'));var fs=require('fs');var fs_extra=require(_0xe49f('0x9'));var _=require(_0xe49f('0xa'));var squel=require(_0xe49f('0xb'));var crypto=require('crypto');var jsforce=require(_0xe49f('0xc'));var deskjs=require(_0xe49f('0xd'));var toCsv=require(_0xe49f('0xe'));var querystring=require(_0xe49f('0xf'));var Papa=require(_0xe49f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe49f('0x11'));var as=require(_0xe49f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe49f('0x13'));var utils=require(_0xe49f('0x14'));var config=require(_0xe49f('0x15'));var licenseUtil=require(_0xe49f('0x16'));var db=require(_0xe49f('0x17'))['db'];function respondWithStatusCode(_0x1d5ecc,_0x564edb){_0x564edb=_0x564edb||0xcc;return function(_0x5c8b24){if(_0x5c8b24){return _0x1d5ecc[_0xe49f('0x18')](_0x564edb);}return _0x1d5ecc[_0xe49f('0x19')](_0x564edb)[_0xe49f('0x1a')]();};}function respondWithResult(_0x4213f6,_0x1cd9b4){_0x1cd9b4=_0x1cd9b4||0xc8;return function(_0x517e43){if(_0x517e43){return _0x4213f6[_0xe49f('0x19')](_0x1cd9b4)[_0xe49f('0x1b')](_0x517e43);}};}function respondWithFilteredResult(_0x2cff19,_0x575030){return function(_0x1b9291){if(_0x1b9291){var _0x4268b3=typeof _0x575030[_0xe49f('0x1c')]==='undefined'&&typeof _0x575030[_0xe49f('0x1d')]===_0xe49f('0x1e');var _0x37c30f=_0x1b9291[_0xe49f('0x1f')];var _0x3fcfa4=_0x4268b3?0x0:_0x575030[_0xe49f('0x1c')];var _0xdec8d=_0x4268b3?_0x1b9291[_0xe49f('0x1f')]:_0x575030['offset']+_0x575030[_0xe49f('0x1d')];var _0x4b159c;if(_0xdec8d>=_0x37c30f){_0xdec8d=_0x37c30f;_0x4b159c=0xc8;}else{_0x4b159c=0xce;}_0x2cff19[_0xe49f('0x19')](_0x4b159c);return _0x2cff19[_0xe49f('0x20')](_0xe49f('0x21'),_0x3fcfa4+'-'+_0xdec8d+'/'+_0x37c30f)[_0xe49f('0x1b')](_0x1b9291);}return null;};}function patchUpdates(_0x2a054e){return function(_0xfe4d5d){try{jsonpatch['apply'](_0xfe4d5d,_0x2a054e,!![]);}catch(_0x1a21e9){return BPromise[_0xe49f('0x22')](_0x1a21e9);}return _0xfe4d5d[_0xe49f('0x23')]();};}function saveUpdates(_0x128b89,_0x554398){return function(_0x40018d){if(_0x40018d){return _0x40018d['update'](_0x128b89)[_0xe49f('0x24')](function(_0x11f953){return _0x11f953;});}return null;};}function removeEntity(_0xf0ebd,_0x5e8908){return function(_0x3470e1){if(_0x3470e1){return _0x3470e1[_0xe49f('0x25')]()[_0xe49f('0x24')](function(){_0xf0ebd[_0xe49f('0x19')](0xcc)[_0xe49f('0x1a')]();});}};}function handleEntityNotFound(_0x4d8f38,_0x60cdfa){return function(_0x15cbef){if(!_0x15cbef){_0x4d8f38[_0xe49f('0x18')](0x194);}return _0x15cbef;};}function handleError(_0x3e434c,_0x3708ac){_0x3708ac=_0x3708ac||0x1f4;return function(_0x47aee6){logger['error'](_0x47aee6[_0xe49f('0x26')]);if(_0x47aee6[_0xe49f('0x27')]){delete _0x47aee6[_0xe49f('0x27')];}_0x3e434c['status'](_0x3708ac)[_0xe49f('0x28')](_0x47aee6);};}exports[_0xe49f('0x29')]=function(_0x3b31c3,_0x3b7bf0){var _0x276ecd={'raw':!![],'where':{'id':_0x3b31c3[_0xe49f('0x2a')]['id']}},_0x28d6c0={};_0x28d6c0[_0xe49f('0x2b')]=_[_0xe49f('0x2c')](db[_0xe49f('0x2d')][_0xe49f('0x2e')]);_0x28d6c0[_0xe49f('0x2f')]=_[_0xe49f('0x2c')](_0x3b31c3['query']);_0x28d6c0[_0xe49f('0x30')]=_[_0xe49f('0x31')](_0x28d6c0['model'],_0x28d6c0['query']);_0x276ecd[_0xe49f('0x32')]=_['intersection'](_0x28d6c0[_0xe49f('0x2b')],qs[_0xe49f('0x33')](_0x3b31c3[_0xe49f('0x2f')]['fields']));_0x276ecd[_0xe49f('0x32')]=_0x276ecd['attributes'][_0xe49f('0x34')]?_0x276ecd[_0xe49f('0x32')]:_0x28d6c0[_0xe49f('0x2b')];if(_0x3b31c3[_0xe49f('0x2f')][_0xe49f('0x35')]){_0x276ecd[_0xe49f('0x36')]=[{'all':!![]}];}_0x276ecd=_[_0xe49f('0x37')]({},_0x276ecd,_0x3b31c3[_0xe49f('0x38')]);return db[_0xe49f('0x2d')]['find'](_0x276ecd)[_0xe49f('0x24')](handleEntityNotFound(_0x3b7bf0,null))[_0xe49f('0x24')](respondWithResult(_0x3b7bf0,null))[_0xe49f('0x39')](handleError(_0x3b7bf0,null));};exports[_0xe49f('0x3a')]=function(_0x2fb2b7,_0x4ce45c){return db[_0xe49f('0x2d')][_0xe49f('0x3a')](_0x2fb2b7[_0xe49f('0x3b')],{})[_0xe49f('0x24')](respondWithResult(_0x4ce45c,0xc9))['catch'](handleError(_0x4ce45c,null));};exports['update']=function(_0x56b3fc,_0x1dc3e2){if(_0x56b3fc['body']['id']){delete _0x56b3fc[_0xe49f('0x3b')]['id'];}return db['ChatProactiveAction'][_0xe49f('0x3c')]({'where':{'id':_0x56b3fc[_0xe49f('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1dc3e2,null))[_0xe49f('0x24')](saveUpdates(_0x56b3fc[_0xe49f('0x3b')],null))[_0xe49f('0x24')](respondWithResult(_0x1dc3e2,null))[_0xe49f('0x39')](handleError(_0x1dc3e2,null));};exports[_0xe49f('0x25')]=function(_0x2c89ee,_0x4f9bea){return db[_0xe49f('0x2d')][_0xe49f('0x3c')]({'where':{'id':_0x2c89ee[_0xe49f('0x2a')]['id']}})[_0xe49f('0x24')](handleEntityNotFound(_0x4f9bea,null))[_0xe49f('0x24')](removeEntity(_0x4f9bea,null))['catch'](handleError(_0x4f9bea,null));};
\ No newline at end of file
+var _0xc0a4=['intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters'];(function(_0x5ca04c,_0x27f8db){var _0x5e227e=function(_0x5d256e){while(--_0x5d256e){_0x5ca04c['push'](_0x5ca04c['shift']());}};_0x5e227e(++_0x27f8db);}(_0xc0a4,0x147));var _0x4c0a=function(_0x4a7cb9,_0x4e0fa2){_0x4a7cb9=_0x4a7cb9-0x0;var _0x4cde3b=_0xc0a4[_0x4a7cb9];return _0x4cde3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c0a('0x0'));var zipdir=require(_0x4c0a('0x1'));var jsonpatch=require(_0x4c0a('0x2'));var rp=require('request-promise');var moment=require(_0x4c0a('0x3'));var BPromise=require(_0x4c0a('0x4'));var Mustache=require(_0x4c0a('0x5'));var util=require(_0x4c0a('0x6'));var path=require(_0x4c0a('0x7'));var sox=require('sox');var csv=require(_0x4c0a('0x8'));var ejs=require(_0x4c0a('0x9'));var fs=require('fs');var fs_extra=require(_0x4c0a('0xa'));var _=require(_0x4c0a('0xb'));var squel=require(_0x4c0a('0xc'));var crypto=require(_0x4c0a('0xd'));var jsforce=require(_0x4c0a('0xe'));var deskjs=require(_0x4c0a('0xf'));var toCsv=require(_0x4c0a('0x8'));var querystring=require('querystring');var Papa=require(_0x4c0a('0x10'));var Redis=require(_0x4c0a('0x11'));var authService=require(_0x4c0a('0x12'));var qs=require(_0x4c0a('0x13'));var as=require(_0x4c0a('0x14'));var hardwareService=require(_0x4c0a('0x15'));var logger=require(_0x4c0a('0x16'))(_0x4c0a('0x17'));var utils=require(_0x4c0a('0x18'));var config=require(_0x4c0a('0x19'));var licenseUtil=require(_0x4c0a('0x1a'));var db=require(_0x4c0a('0x1b'))['db'];function respondWithStatusCode(_0x55b124,_0x1ff4d3){_0x1ff4d3=_0x1ff4d3||0xcc;return function(_0xef01ab){if(_0xef01ab){return _0x55b124[_0x4c0a('0x1c')](_0x1ff4d3);}return _0x55b124[_0x4c0a('0x1d')](_0x1ff4d3)['end']();};}function respondWithResult(_0x437513,_0x223c2a){_0x223c2a=_0x223c2a||0xc8;return function(_0x16d852){if(_0x16d852){return _0x437513[_0x4c0a('0x1d')](_0x223c2a)[_0x4c0a('0x1e')](_0x16d852);}};}function respondWithFilteredResult(_0x8055cc,_0x31e574){return function(_0xe6569b){if(_0xe6569b){var _0x22bc77=typeof _0x31e574[_0x4c0a('0x1f')]===_0x4c0a('0x20')&&typeof _0x31e574[_0x4c0a('0x21')]===_0x4c0a('0x20');var _0x1ebf5e=_0xe6569b[_0x4c0a('0x22')];var _0x7e7d4b=_0x22bc77?0x0:_0x31e574['offset'];var _0x251c7f=_0x22bc77?_0xe6569b['count']:_0x31e574[_0x4c0a('0x1f')]+_0x31e574[_0x4c0a('0x21')];var _0x324469;if(_0x251c7f>=_0x1ebf5e){_0x251c7f=_0x1ebf5e;_0x324469=0xc8;}else{_0x324469=0xce;}_0x8055cc[_0x4c0a('0x1d')](_0x324469);return _0x8055cc[_0x4c0a('0x23')]('Content-Range',_0x7e7d4b+'-'+_0x251c7f+'/'+_0x1ebf5e)[_0x4c0a('0x1e')](_0xe6569b);}return null;};}function patchUpdates(_0x5e7cf1){return function(_0x2cd240){try{jsonpatch[_0x4c0a('0x24')](_0x2cd240,_0x5e7cf1,!![]);}catch(_0x33a3c5){return BPromise[_0x4c0a('0x25')](_0x33a3c5);}return _0x2cd240['save']();};}function saveUpdates(_0x2fef66,_0x19705f){return function(_0x271e58){if(_0x271e58){return _0x271e58[_0x4c0a('0x26')](_0x2fef66)[_0x4c0a('0x27')](function(_0x2cbb8b){return _0x2cbb8b;});}return null;};}function removeEntity(_0x18019d,_0x5bd479){return function(_0x5116ee){if(_0x5116ee){return _0x5116ee[_0x4c0a('0x28')]()['then'](function(){_0x18019d[_0x4c0a('0x1d')](0xcc)[_0x4c0a('0x29')]();});}};}function handleEntityNotFound(_0x22a3ad,_0x319b6f){return function(_0x117ac7){if(!_0x117ac7){_0x22a3ad['sendStatus'](0x194);}return _0x117ac7;};}function handleError(_0x241e91,_0xf239ed){_0xf239ed=_0xf239ed||0x1f4;return function(_0x5b91e2){logger['error'](_0x5b91e2['stack']);if(_0x5b91e2[_0x4c0a('0x2a')]){delete _0x5b91e2['name'];}_0x241e91['status'](_0xf239ed)[_0x4c0a('0x2b')](_0x5b91e2);};}exports['show']=function(_0x23bee2,_0x25a139){var _0x167604={'raw':!![],'where':{'id':_0x23bee2[_0x4c0a('0x2c')]['id']}},_0x5baa4b={};_0x5baa4b[_0x4c0a('0x2d')]=_['keys'](db[_0x4c0a('0x2e')][_0x4c0a('0x2f')]);_0x5baa4b[_0x4c0a('0x30')]=_[_0x4c0a('0x31')](_0x23bee2['query']);_0x5baa4b[_0x4c0a('0x32')]=_[_0x4c0a('0x33')](_0x5baa4b['model'],_0x5baa4b[_0x4c0a('0x30')]);_0x167604[_0x4c0a('0x34')]=_[_0x4c0a('0x33')](_0x5baa4b[_0x4c0a('0x2d')],qs[_0x4c0a('0x35')](_0x23bee2[_0x4c0a('0x30')][_0x4c0a('0x35')]));_0x167604['attributes']=_0x167604[_0x4c0a('0x34')][_0x4c0a('0x36')]?_0x167604[_0x4c0a('0x34')]:_0x5baa4b[_0x4c0a('0x2d')];if(_0x23bee2[_0x4c0a('0x30')][_0x4c0a('0x37')]){_0x167604[_0x4c0a('0x38')]=[{'all':!![]}];}_0x167604=_[_0x4c0a('0x39')]({},_0x167604,_0x23bee2[_0x4c0a('0x3a')]);return db['ChatProactiveAction'][_0x4c0a('0x3b')](_0x167604)[_0x4c0a('0x27')](handleEntityNotFound(_0x25a139,null))['then'](respondWithResult(_0x25a139,null))['catch'](handleError(_0x25a139,null));};exports[_0x4c0a('0x3c')]=function(_0x48ed41,_0x484d0a){return db[_0x4c0a('0x2e')][_0x4c0a('0x3c')](_0x48ed41[_0x4c0a('0x3d')],{})[_0x4c0a('0x27')](respondWithResult(_0x484d0a,0xc9))[_0x4c0a('0x3e')](handleError(_0x484d0a,null));};exports['update']=function(_0x36bd3c,_0x44887f){if(_0x36bd3c[_0x4c0a('0x3d')]['id']){delete _0x36bd3c[_0x4c0a('0x3d')]['id'];}return db[_0x4c0a('0x2e')]['find']({'where':{'id':_0x36bd3c[_0x4c0a('0x2c')]['id']}})[_0x4c0a('0x27')](handleEntityNotFound(_0x44887f,null))['then'](saveUpdates(_0x36bd3c[_0x4c0a('0x3d')],null))[_0x4c0a('0x27')](respondWithResult(_0x44887f,null))[_0x4c0a('0x3e')](handleError(_0x44887f,null));};exports[_0x4c0a('0x28')]=function(_0xb03bce,_0x4aa44c){return db[_0x4c0a('0x2e')][_0x4c0a('0x3b')]({'where':{'id':_0xb03bce[_0x4c0a('0x2c')]['id']}})[_0x4c0a('0x27')](handleEntityNotFound(_0x4aa44c,null))['then'](removeEntity(_0x4aa44c,null))[_0x4c0a('0x3e')](handleError(_0x4aa44c,null));};
\ No newline at end of file
index ab3eea4..2363a15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51d4=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x51d4,0x106));var _0x451d=function(_0x10de0a,_0x39f341){_0x10de0a=_0x10de0a-0x0;var _0x500872=_0x51d4[_0x10de0a];return _0x500872;};'use strict';var _=require(_0x451d('0x0'));var util=require(_0x451d('0x1'));var logger=require(_0x451d('0x2'))(_0x451d('0x3'));var moment=require(_0x451d('0x4'));var BPromise=require(_0x451d('0x5'));var rp=require(_0x451d('0x6'));var fs=require('fs');var path=require(_0x451d('0x7'));var rimraf=require(_0x451d('0x8'));var config=require(_0x451d('0x9'));var attributes=require(_0x451d('0xa'));module[_0x451d('0xb')]=function(_0x492c09,_0x1cd7ac){return _0x492c09[_0x451d('0xc')](_0x451d('0xd'),attributes,{'tableName':_0x451d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4363=['ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x37db95,_0x4f2cca){var _0x28070c=function(_0x5712b6){while(--_0x5712b6){_0x37db95['push'](_0x37db95['shift']());}};_0x28070c(++_0x4f2cca);}(_0x4363,0x18e));var _0x3436=function(_0x53c37a,_0x5b1dd4){_0x53c37a=_0x53c37a-0x0;var _0x283edf=_0x4363[_0x53c37a];return _0x283edf;};'use strict';var _=require(_0x3436('0x0'));var util=require('util');var logger=require(_0x3436('0x1'))(_0x3436('0x2'));var moment=require(_0x3436('0x3'));var BPromise=require(_0x3436('0x4'));var rp=require(_0x3436('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3436('0x6'));var config=require(_0x3436('0x7'));var attributes=require(_0x3436('0x8'));module['exports']=function(_0x58d084,_0x1a5ab2){return _0x58d084['define'](_0x3436('0x9'),attributes,{'tableName':_0x3436('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6883780..be05d8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4a6=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x11a2d8,_0x608ae8){var _0x578e04=function(_0x59a790){while(--_0x59a790){_0x11a2d8['push'](_0x11a2d8['shift']());}};_0x578e04(++_0x608ae8);}(_0xc4a6,0x1c9));var _0x6c4a=function(_0x5ecaab,_0x2f3053){_0x5ecaab=_0x5ecaab-0x0;var _0x3db1a8=_0xc4a6[_0x5ecaab];return _0x3db1a8;};'use strict';var _=require(_0x6c4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6c4a('0x1'));var rs=require(_0x6c4a('0x2'));var fs=require('fs');var Redis=require(_0x6c4a('0x3'));var db=require(_0x6c4a('0x4'))['db'];var utils=require(_0x6c4a('0x5'));var logger=require(_0x6c4a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c4a('0x7'));var client=jayson[_0x6c4a('0x8')][_0x6c4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e936e,_0x351ea9,_0xebe3fe){return new BPromise(function(_0x13f74a,_0x459580){return client[_0x6c4a('0xa')](_0x1e936e,_0xebe3fe)[_0x6c4a('0xb')](function(_0x29d2df){logger[_0x6c4a('0xc')](_0x6c4a('0xd'),_0x351ea9,_0x6c4a('0xe'));logger[_0x6c4a('0xf')](_0x6c4a('0x10'),_0x351ea9,_0x6c4a('0xe'),JSON[_0x6c4a('0x11')](_0x29d2df));if(_0x29d2df[_0x6c4a('0x12')]){if(_0x29d2df['error'][_0x6c4a('0x13')]===0x1f4){logger[_0x6c4a('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x351ea9,_0x29d2df['error'][_0x6c4a('0x14')]);return _0x459580(_0x29d2df[_0x6c4a('0x12')][_0x6c4a('0x14')]);}logger[_0x6c4a('0x12')](_0x6c4a('0xd'),_0x351ea9,_0x29d2df[_0x6c4a('0x12')][_0x6c4a('0x14')]);return _0x13f74a(_0x29d2df[_0x6c4a('0x12')][_0x6c4a('0x14')]);}else{logger[_0x6c4a('0xc')](_0x6c4a('0xd'),_0x351ea9,_0x6c4a('0xe'));_0x13f74a(_0x29d2df['result'][_0x6c4a('0x14')]);}})[_0x6c4a('0x15')](function(_0x5d4a60){logger[_0x6c4a('0x12')](_0x6c4a('0xd'),_0x351ea9,_0x5d4a60);_0x459580(_0x5d4a60);});});}
\ No newline at end of file
+var _0xc0d8=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x9996d7,_0x36a17b){var _0x3b0dca=function(_0x510c76){while(--_0x510c76){_0x9996d7['push'](_0x9996d7['shift']());}};_0x3b0dca(++_0x36a17b);}(_0xc0d8,0xa8));var _0x8c0d=function(_0x148670,_0x2b0db3){_0x148670=_0x148670-0x0;var _0x5f52f7=_0xc0d8[_0x148670];return _0x5f52f7;};'use strict';var _=require(_0x8c0d('0x0'));var util=require(_0x8c0d('0x1'));var moment=require(_0x8c0d('0x2'));var BPromise=require(_0x8c0d('0x3'));var rs=require(_0x8c0d('0x4'));var fs=require('fs');var Redis=require(_0x8c0d('0x5'));var db=require(_0x8c0d('0x6'))['db'];var utils=require(_0x8c0d('0x7'));var logger=require(_0x8c0d('0x8'))(_0x8c0d('0x9'));var config=require('../../config/environment');var jayson=require(_0x8c0d('0xa'));var client=jayson[_0x8c0d('0xb')][_0x8c0d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x273063,_0x3d3b26,_0x2ae784){return new BPromise(function(_0x34d5de,_0x4f85a8){return client[_0x8c0d('0xd')](_0x273063,_0x2ae784)[_0x8c0d('0xe')](function(_0x32b6a8){logger[_0x8c0d('0xf')](_0x8c0d('0x10'),_0x3d3b26,'request\x20sent');logger[_0x8c0d('0x11')](_0x8c0d('0x12'),_0x3d3b26,_0x8c0d('0x13'),JSON[_0x8c0d('0x14')](_0x32b6a8));if(_0x32b6a8[_0x8c0d('0x15')]){if(_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x16')]===0x1f4){logger['error'](_0x8c0d('0x10'),_0x3d3b26,_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x17')]);return _0x4f85a8(_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x17')]);}logger['error'](_0x8c0d('0x10'),_0x3d3b26,_0x32b6a8[_0x8c0d('0x15')][_0x8c0d('0x17')]);return _0x34d5de(_0x32b6a8['error'][_0x8c0d('0x17')]);}else{logger[_0x8c0d('0xf')](_0x8c0d('0x10'),_0x3d3b26,_0x8c0d('0x13'));_0x34d5de(_0x32b6a8['result'][_0x8c0d('0x17')]);}})[_0x8c0d('0x18')](function(_0x1ded10){logger[_0x8c0d('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x3d3b26,_0x1ded10);_0x4f85a8(_0x1ded10);});});}
\ No newline at end of file
index 445057f..d93ed59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d58=['/:id','isAuthenticated','show','create','update','delete','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x47dcb1,_0x2e7067){var _0x532b9f=function(_0x1f3fb5){while(--_0x1f3fb5){_0x47dcb1['push'](_0x47dcb1['shift']());}};_0x532b9f(++_0x2e7067);}(_0x5d58,0x187));var _0x85d5=function(_0x2e15f3,_0x8a73eb){_0x2e15f3=_0x2e15f3-0x0;var _0x460ecd=_0x5d58[_0x2e15f3];return _0x460ecd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./chatProactiveAction.controller');router[_0x85d5('0x4')](_0x85d5('0x5'),auth[_0x85d5('0x6')](),controller[_0x85d5('0x7')]);router['post']('/',auth[_0x85d5('0x6')](),controller[_0x85d5('0x8')]);router['put'](_0x85d5('0x5'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')](_0x85d5('0x5'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xfdbd=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x1b698d,_0x1aae30){var _0x49042b=function(_0xae9203){while(--_0xae9203){_0x1b698d['push'](_0x1b698d['shift']());}};_0x49042b(++_0x1aae30);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x19159d,_0x3d05c8){_0x19159d=_0x19159d-0x0;var _0x35884a=_0xfdbd[_0x19159d];return _0x35884a;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get'](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xb')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller[_0xdfdb('0x10')]);module[_0xdfdb('0x11')]=router;
\ No newline at end of file
index b595f99..d603629 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d16=['roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x4d16,0xe5));var _0x64d1=function(_0x1f90df,_0x566cc8){_0x1f90df=_0x1f90df-0x0;var _0x3d45a7=_0x4d16[_0x1f90df];return _0x3d45a7;};'use strict';var Sequelize=require('sequelize');module[_0x64d1('0x0')]={'name':{'type':Sequelize[_0x64d1('0x1')],'unique':_0x64d1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x64d1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x64d1('0x4'),'beepall',_0x64d1('0x5'))}};
\ No newline at end of file
+var _0x1324=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x1324,0x9d));var _0x4132=function(_0x5a6f32,_0x55b359){_0x5a6f32=_0x5a6f32-0x0;var _0x512785=_0x1324[_0x5a6f32];return _0x512785;};'use strict';var Sequelize=require(_0x4132('0x0'));module['exports']={'name':{'type':Sequelize[_0x4132('0x1')],'unique':_0x4132('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4132('0x1')]},'timeout':{'type':Sequelize[_0x4132('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4132('0x4')](_0x4132('0x5'),_0x4132('0x6'),_0x4132('0x7'))}};
\ No newline at end of file
index aca4d45..70cc93a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x500d=['SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','emit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','name','send','index','ChatQueue','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','ChatQueueId','UserChatQueue','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes'];(function(_0x3cad98,_0x3a6539){var _0x53f43c=function(_0x44ff9c){while(--_0x44ff9c){_0x3cad98['push'](_0x3cad98['shift']());}};_0x53f43c(++_0x3a6539);}(_0x500d,0x146));var _0xd500=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x500d[_0x237546];return _0x233e29;};'use strict';var emlformat=require(_0xd500('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd500('0x1'));var jsonpatch=require(_0xd500('0x2'));var rp=require(_0xd500('0x3'));var moment=require(_0xd500('0x4'));var BPromise=require(_0xd500('0x5'));var Mustache=require('mustache');var util=require(_0xd500('0x6'));var path=require(_0xd500('0x7'));var sox=require(_0xd500('0x8'));var csv=require(_0xd500('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd500('0xa'));var _=require(_0xd500('0xb'));var squel=require(_0xd500('0xc'));var crypto=require(_0xd500('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd500('0xe'));var Redis=require(_0xd500('0xf'));var authService=require(_0xd500('0x10'));var qs=require(_0xd500('0x11'));var as=require(_0xd500('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd500('0x13'));var utils=require(_0xd500('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd500('0x15'))['db'];config['redis']=_[_0xd500('0x16')](config[_0xd500('0x17')],{'host':_0xd500('0x18'),'port':0x18eb});var socket=require(_0xd500('0x19'))(new Redis(config['redis']));require(_0xd500('0x1a'))[_0xd500('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd500('0x1c')][_0xd500('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x29d80f,_0xd4ae54,_0x12cbc4,_0x522d41){return new BPromise(function(_0x303cee,_0x280b98){var _0x39aea2=_0x522d41||client;return _0x39aea2[_0xd500('0x1e')](_0x29d80f,_0x12cbc4)[_0xd500('0x1f')](function(_0x1e5102){logger[_0xd500('0x20')]('ChatQueue,\x20%s,\x20%s',_0xd4ae54,_0xd500('0x21'));logger[_0xd500('0x22')](_0xd500('0x23'),_0xd4ae54,_0xd500('0x21'),JSON[_0xd500('0x24')](_0x1e5102));if(_0x1e5102['error']){if(_0x1e5102['error'][_0xd500('0x25')]===0x1f4){logger[_0xd500('0x26')](_0xd500('0x27'),_0xd4ae54,_0x1e5102[_0xd500('0x26')]['message']);return _0x280b98(_0x1e5102[_0xd500('0x26')][_0xd500('0x28')]);}logger['error'](_0xd500('0x27'),_0xd4ae54,_0x1e5102['error'][_0xd500('0x28')]);return _0x303cee(_0x1e5102[_0xd500('0x26')][_0xd500('0x28')]);}else{logger['info'](_0xd500('0x27'),_0xd4ae54,_0xd500('0x21'));_0x303cee(_0x1e5102[_0xd500('0x29')]['message']);}})[_0xd500('0x2a')](function(_0x3aa589){logger[_0xd500('0x26')](_0xd500('0x27'),_0xd4ae54,_0x3aa589);_0x280b98(_0x3aa589);});});}function respondWithStatusCode(_0x355ae4,_0x40bd35){_0x40bd35=_0x40bd35||0xcc;return function(_0x4271a8){if(_0x4271a8){return _0x355ae4[_0xd500('0x2b')](_0x40bd35);}return _0x355ae4['status'](_0x40bd35)['end']();};}function respondWithResult(_0x2293ed,_0x4ec701){_0x4ec701=_0x4ec701||0xc8;return function(_0x48a51b){if(_0x48a51b){return _0x2293ed[_0xd500('0x2c')](_0x4ec701)[_0xd500('0x2d')](_0x48a51b);}};}function respondWithFilteredResult(_0x31c43a,_0x199b92){return function(_0x598306){if(_0x598306){var _0x350cc7=typeof _0x199b92[_0xd500('0x2e')]===_0xd500('0x2f')&&typeof _0x199b92[_0xd500('0x30')]===_0xd500('0x2f');var _0x127a9e=_0x598306['count'];var _0x2c5f4b=_0x350cc7?0x0:_0x199b92[_0xd500('0x2e')];var _0x48c667=_0x350cc7?_0x598306[_0xd500('0x31')]:_0x199b92['offset']+_0x199b92['limit'];var _0x3646ee;if(_0x48c667>=_0x127a9e){_0x48c667=_0x127a9e;_0x3646ee=0xc8;}else{_0x3646ee=0xce;}_0x31c43a[_0xd500('0x2c')](_0x3646ee);return _0x31c43a['set'](_0xd500('0x32'),_0x2c5f4b+'-'+_0x48c667+'/'+_0x127a9e)['json'](_0x598306);}return null;};}function patchUpdates(_0x22af97){return function(_0x479661){try{jsonpatch[_0xd500('0x33')](_0x479661,_0x22af97,!![]);}catch(_0x295a8e){return BPromise[_0xd500('0x34')](_0x295a8e);}return _0x479661[_0xd500('0x35')]();};}function saveUpdates(_0x134bd5,_0x46cb3b){return function(_0x48158a){if(_0x48158a){return _0x48158a[_0xd500('0x36')](_0x134bd5)['then'](function(_0x1e4d2f){return _0x1e4d2f;});}return null;};}function removeEntity(_0x344bf6,_0x395608){return function(_0x8f4cd3){if(_0x8f4cd3){return _0x8f4cd3[_0xd500('0x37')]()['then'](function(){var _0x5b0115=_0x8f4cd3[_0xd500('0x38')]({'plain':!![]});var _0x5424e1=_0xd500('0x39');return db[_0xd500('0x3a')]['destroy']({'where':{'type':_0x5424e1,'resourceId':_0x5b0115['id']}})[_0xd500('0x1f')](function(){return _0x8f4cd3;});})[_0xd500('0x1f')](function(){_0x344bf6[_0xd500('0x2c')](0xcc)[_0xd500('0x3b')]();});}};}function handleEntityNotFound(_0x219efc,_0x4af386){return function(_0x4de4db){if(!_0x4de4db){_0x219efc[_0xd500('0x2b')](0x194);}return _0x4de4db;};}function handleError(_0xdbc86b,_0x13bfc1){_0x13bfc1=_0x13bfc1||0x1f4;return function(_0x48483e){logger[_0xd500('0x26')](_0x48483e['stack']);if(_0x48483e[_0xd500('0x3c')]){delete _0x48483e[_0xd500('0x3c')];}_0xdbc86b[_0xd500('0x2c')](_0x13bfc1)[_0xd500('0x3d')](_0x48483e);};}exports[_0xd500('0x3e')]=function(_0xbd2983,_0x43e118){var _0x4a259d={},_0x4d1424={},_0x34ef3f={'count':0x0,'rows':[]};var _0x1b82fe=_['map'](db[_0xd500('0x3f')][_0xd500('0x40')],function(_0x2cc128){return{'name':_0x2cc128[_0xd500('0x41')],'type':_0x2cc128['type'][_0xd500('0x42')]};});_0x4d1424[_0xd500('0x43')]=_[_0xd500('0x44')](_0x1b82fe,_0xd500('0x3c'));_0x4d1424[_0xd500('0x45')]=_[_0xd500('0x46')](_0xbd2983[_0xd500('0x45')]);_0x4d1424[_0xd500('0x47')]=_[_0xd500('0x48')](_0x4d1424[_0xd500('0x43')],_0x4d1424['query']);_0x4a259d[_0xd500('0x49')]=_['intersection'](_0x4d1424[_0xd500('0x43')],qs[_0xd500('0x4a')](_0xbd2983['query'][_0xd500('0x4a')]));_0x4a259d[_0xd500('0x49')]=_0x4a259d[_0xd500('0x49')][_0xd500('0x4b')]?_0x4a259d['attributes']:_0x4d1424[_0xd500('0x43')];if(!_0xbd2983[_0xd500('0x45')][_0xd500('0x4c')](_0xd500('0x4d'))){_0x4a259d['limit']=qs[_0xd500('0x30')](_0xbd2983[_0xd500('0x45')][_0xd500('0x30')]);_0x4a259d['offset']=qs[_0xd500('0x2e')](_0xbd2983[_0xd500('0x45')][_0xd500('0x2e')]);}_0x4a259d[_0xd500('0x4e')]=qs[_0xd500('0x4f')](_0xbd2983[_0xd500('0x45')][_0xd500('0x4f')]);_0x4a259d[_0xd500('0x50')]=qs[_0xd500('0x47')](_[_0xd500('0x51')](_0xbd2983[_0xd500('0x45')],_0x4d1424['filters']),_0x1b82fe);if(_0xbd2983[_0xd500('0x45')]['filter']){_0x4a259d[_0xd500('0x50')]=_['merge'](_0x4a259d[_0xd500('0x50')],{'$or':_[_0xd500('0x44')](_0x1b82fe,function(_0x383e66){if(_0x383e66[_0xd500('0x52')]!==_0xd500('0x53')){var _0x3a35ec={};_0x3a35ec[_0x383e66[_0xd500('0x3c')]]={'$like':'%'+_0xbd2983['query'][_0xd500('0x54')]+'%'};return _0x3a35ec;}})});}_0x4a259d=_[_0xd500('0x55')]({},_0x4a259d,_0xbd2983[_0xd500('0x56')]);var _0x3a9938={'where':_0x4a259d['where']};return db[_0xd500('0x3f')]['count'](_0x3a9938)[_0xd500('0x1f')](function(_0xd96122){_0x34ef3f[_0xd500('0x31')]=_0xd96122;if(_0xbd2983[_0xd500('0x45')][_0xd500('0x57')]){_0x4a259d[_0xd500('0x58')]=[{'all':!![]}];}return db['ChatQueue'][_0xd500('0x59')](_0x4a259d);})[_0xd500('0x1f')](function(_0xc2f93b){_0x34ef3f[_0xd500('0x5a')]=_0xc2f93b;return _0x34ef3f;})[_0xd500('0x1f')](respondWithFilteredResult(_0x43e118,_0x4a259d))[_0xd500('0x2a')](handleError(_0x43e118,null));};exports['show']=function(_0x475ee9,_0x53a1fc){var _0x5a9652={'raw':!![],'where':{'id':_0x475ee9[_0xd500('0x5b')]['id']}},_0x30acd8={};_0x30acd8['model']=_['keys'](db['ChatQueue'][_0xd500('0x40')]);_0x30acd8['query']=_[_0xd500('0x46')](_0x475ee9['query']);_0x30acd8[_0xd500('0x47')]=_[_0xd500('0x48')](_0x30acd8['model'],_0x30acd8[_0xd500('0x45')]);_0x5a9652[_0xd500('0x49')]=_[_0xd500('0x48')](_0x30acd8[_0xd500('0x43')],qs[_0xd500('0x4a')](_0x475ee9[_0xd500('0x45')][_0xd500('0x4a')]));_0x5a9652[_0xd500('0x49')]=_0x5a9652[_0xd500('0x49')]['length']?_0x5a9652['attributes']:_0x30acd8[_0xd500('0x43')];if(_0x475ee9[_0xd500('0x45')]['includeAll']){_0x5a9652[_0xd500('0x58')]=[{'all':!![]}];}_0x5a9652=_[_0xd500('0x55')]({},_0x5a9652,_0x475ee9['options']);return db[_0xd500('0x3f')]['find'](_0x5a9652)[_0xd500('0x1f')](handleEntityNotFound(_0x53a1fc,null))[_0xd500('0x1f')](respondWithResult(_0x53a1fc,null))[_0xd500('0x2a')](handleError(_0x53a1fc,null));};exports[_0xd500('0x5c')]=function(_0x52a24c,_0x1db396){return db[_0xd500('0x3f')][_0xd500('0x5c')](_0x52a24c[_0xd500('0x5d')],{})[_0xd500('0x1f')](function(_0x29f464){var _0x444128=_0x52a24c[_0xd500('0x5e')][_0xd500('0x38')]({'plain':!![]});if(!_0x444128)throw new Error(_0xd500('0x5f'));if(_0x444128[_0xd500('0x60')]===_0xd500('0x5e')){var _0x34a355=_0x29f464[_0xd500('0x38')]({'plain':!![]});var _0x375f32='ChatQueues';return db[_0xd500('0x61')][_0xd500('0x62')]({'where':{'name':_0x375f32,'userProfileId':_0x444128[_0xd500('0x63')]},'raw':!![]})[_0xd500('0x1f')](function(_0x5dd5f9){if(_0x5dd5f9&&_0x5dd5f9[_0xd500('0x64')]===0x0){return db[_0xd500('0x3a')]['create']({'name':_0x34a355[_0xd500('0x3c')],'resourceId':_0x34a355['id'],'type':_0x5dd5f9[_0xd500('0x3c')],'sectionId':_0x5dd5f9['id']},{})[_0xd500('0x1f')](function(){return _0x29f464;});}else{return _0x29f464;}})[_0xd500('0x2a')](function(_0x2e8826){logger[_0xd500('0x26')](_0xd500('0x65'),_0x2e8826);throw _0x2e8826;});}return _0x29f464;})[_0xd500('0x1f')](respondWithResult(_0x1db396,0xc9))['catch'](handleError(_0x1db396,null));};exports[_0xd500('0x36')]=function(_0x16a76e,_0x4a272e){if(_0x16a76e[_0xd500('0x5d')]['id']){delete _0x16a76e[_0xd500('0x5d')]['id'];}return db[_0xd500('0x3f')]['find']({'where':{'id':_0x16a76e['params']['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x4a272e,null))[_0xd500('0x1f')](saveUpdates(_0x16a76e[_0xd500('0x5d')],null))['then'](respondWithResult(_0x4a272e,null))[_0xd500('0x2a')](handleError(_0x4a272e,null));};exports[_0xd500('0x37')]=function(_0xe91f58,_0x4b51ad){return db[_0xd500('0x3f')][_0xd500('0x62')]({'where':{'id':_0xe91f58[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x4b51ad,null))[_0xd500('0x1f')](removeEntity(_0x4b51ad,null))[_0xd500('0x2a')](handleError(_0x4b51ad,null));};exports['describe']=function(_0x2c1839,_0x234ac1){return db[_0xd500('0x3f')]['describe']()[_0xd500('0x1f')](respondWithResult(_0x234ac1,null))[_0xd500('0x2a')](handleError(_0x234ac1,null));};exports[_0xd500('0x66')]=function(_0x269f3b,_0x390d88,_0x44e29b){var _0x84e652={'raw':!![],'where':{}},_0xf817a={},_0x5c559d;return db[_0xd500('0x3f')][_0xd500('0x67')]({'where':{'id':_0x269f3b[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x390d88,null))[_0xd500('0x1f')](function(_0x2396bd){if(_0x2396bd){_0x5c559d=_0x2396bd['get']({'plain':!![]});_0xf817a[_0xd500('0x43')]=_[_0xd500('0x46')](db['UserChatQueue'][_0xd500('0x40')]);_0xf817a[_0xd500('0x45')]=_[_0xd500('0x46')](_0x269f3b[_0xd500('0x45')]);_0xf817a[_0xd500('0x47')]=_[_0xd500('0x48')](_0xf817a[_0xd500('0x43')],_0xf817a[_0xd500('0x45')]);_0x84e652[_0xd500('0x49')]=_[_0xd500('0x48')](_0xf817a[_0xd500('0x43')],qs[_0xd500('0x4a')](_0x269f3b['query'][_0xd500('0x4a')]));_0x84e652[_0xd500('0x49')]=_0x84e652[_0xd500('0x49')]['length']?_0x84e652[_0xd500('0x49')]:_0xf817a[_0xd500('0x43')];if(!_0x269f3b['query'][_0xd500('0x4c')](_0xd500('0x4d'))){_0x84e652[_0xd500('0x30')]=qs['limit'](_0x269f3b[_0xd500('0x45')][_0xd500('0x30')]);_0x84e652[_0xd500('0x2e')]=qs[_0xd500('0x2e')](_0x269f3b[_0xd500('0x45')][_0xd500('0x2e')]);}_0x84e652['order']=qs[_0xd500('0x4f')](_0x269f3b[_0xd500('0x45')][_0xd500('0x4f')]);_0x84e652[_0xd500('0x50')]=qs['filters'](_[_0xd500('0x51')](_0x269f3b[_0xd500('0x45')],_0xf817a[_0xd500('0x47')]));_0x84e652[_0xd500('0x50')][_0xd500('0x68')]=_0x2396bd['id'];if(_0x269f3b[_0xd500('0x45')][_0xd500('0x54')]){_0x84e652[_0xd500('0x50')]=_[_0xd500('0x55')](_0x84e652[_0xd500('0x50')],{'$or':_[_0xd500('0x44')](_0x84e652[_0xd500('0x49')],function(_0x295012){var _0xb7b3fd={};_0xb7b3fd[_0x295012]={'$like':'%'+_0x269f3b['query'][_0xd500('0x54')]+'%'};return _0xb7b3fd;})});}_0x84e652=_[_0xd500('0x55')]({},_0x84e652,_0x269f3b['options']);return db[_0xd500('0x69')][_0xd500('0x59')](_0x84e652);}})[_0xd500('0x1f')](function(_0x42ddad){if(_0x42ddad){return db['User']['findAndCountAll']({'where':{'id':_[_0xd500('0x44')](_0x42ddad,_0xd500('0x6a')),'role':_0xd500('0x6b')},'attributes':['id',_0xd500('0x3c'),_0xd500('0x6c'),'updatedAt',_0xd500('0x6d')]});}})['then'](function(_0x53d35f){if(_0x53d35f){return{'count':_0x53d35f['count'],'rows':_[_0xd500('0x44')](_0x53d35f[_0xd500('0x5a')],function(_0x337295){return{'membername':_0x337295[_0xd500('0x3c')],'UserId':_0x337295['id'],'queue_name':_0x5c559d[_0xd500('0x3c')],'ChatQueueId':_0x5c559d['id'],'interface':util[_0xd500('0x6e')](_0xd500('0x6f'),_0xd500('0x70'),_0x337295[_0xd500('0x3c')]),'penalty':0x0,'paused':_0x337295[_0xd500('0x6c')],'createdAt':_0x337295[_0xd500('0x6d')],'updatedAt':_0x337295['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x390d88,_0x84e652))[_0xd500('0x2a')](handleError(_0x390d88,null));};exports[_0xd500('0x71')]=function(_0x51c6fd,_0x4e83ec,_0x4eddf2){var _0x4aad62={};var _0x10c2e7={};var _0x1ac580;var _0x2af12a;return db['ChatQueue']['findOne']({'where':{'id':_0x51c6fd['params']['id']}})['then'](handleEntityNotFound(_0x4e83ec,null))[_0xd500('0x1f')](function(_0x49c3ba){if(_0x49c3ba){_0x1ac580=_0x49c3ba;_0x10c2e7[_0xd500('0x43')]=_[_0xd500('0x46')](db[_0xd500('0x72')]['rawAttributes']);_0x10c2e7[_0xd500('0x45')]=_[_0xd500('0x46')](_0x51c6fd[_0xd500('0x45')]);_0x10c2e7[_0xd500('0x47')]=_[_0xd500('0x48')](_0x10c2e7['model'],_0x10c2e7[_0xd500('0x45')]);_0x4aad62[_0xd500('0x49')]=_[_0xd500('0x48')](_0x10c2e7[_0xd500('0x43')],qs['fields'](_0x51c6fd[_0xd500('0x45')]['fields']));_0x4aad62[_0xd500('0x49')]=_0x4aad62['attributes'][_0xd500('0x4b')]?_0x4aad62[_0xd500('0x49')]:_0x10c2e7['model'];_0x4aad62[_0xd500('0x4e')]=qs[_0xd500('0x4f')](_0x51c6fd[_0xd500('0x45')]['sort']);_0x4aad62[_0xd500('0x50')]=qs[_0xd500('0x47')](_[_0xd500('0x51')](_0x51c6fd[_0xd500('0x45')],_0x10c2e7['filters']));if(_0x51c6fd[_0xd500('0x45')]['filter']){_0x4aad62[_0xd500('0x50')]=_[_0xd500('0x55')](_0x4aad62['where'],{'$or':_[_0xd500('0x44')](_0x4aad62[_0xd500('0x49')],function(_0x2317c1){var _0x55a01d={};_0x55a01d[_0x2317c1]={'$like':'%'+_0x51c6fd['query'][_0xd500('0x54')]+'%'};return _0x55a01d;})});}_0x4aad62=_[_0xd500('0x55')]({},_0x4aad62,_0x51c6fd[_0xd500('0x56')]);return _0x1ac580[_0xd500('0x71')](_0x4aad62);}})[_0xd500('0x1f')](function(_0x480e2c){if(_0x480e2c){_0x2af12a=_0x480e2c[_0xd500('0x4b')];if(!_0x51c6fd[_0xd500('0x45')][_0xd500('0x4c')](_0xd500('0x4d'))){_0x4aad62[_0xd500('0x30')]=qs[_0xd500('0x30')](_0x51c6fd[_0xd500('0x45')]['limit']);_0x4aad62[_0xd500('0x2e')]=qs['offset'](_0x51c6fd[_0xd500('0x45')][_0xd500('0x2e')]);}return _0x1ac580[_0xd500('0x71')](_0x4aad62);}})[_0xd500('0x1f')](function(_0x9b58f9){if(_0x9b58f9){return _0x9b58f9?{'count':_0x2af12a,'rows':_0x9b58f9}:null;}})[_0xd500('0x1f')](respondWithResult(_0x4e83ec,null))[_0xd500('0x2a')](handleError(_0x4e83ec,null));};exports[_0xd500('0x73')]=function(_0x2afb8d,_0x5d9928,_0x2cfd7a){var _0x1bf87a=_0x2afb8d[_0xd500('0x5d')][_0xd500('0x74')];return db[_0xd500('0x72')][_0xd500('0x59')]({'where':{'id':_0x1bf87a},'attributes':['id'],'include':[{'model':db[_0xd500('0x75')],'as':_0xd500('0x76'),'attributes':['id',_0xd500('0x3c'),_0xd500('0x77'),_0xd500('0x78'),'interface'],'raw':!![]}]})[_0xd500('0x1f')](function(_0x383860){if(_0x383860){var _0x1b6dff=_[_0xd500('0x79')](_0x383860,function(_0x3773ae){var _0x21e6be=_0x3773ae[_0xd500('0x38')]({'plain':!![]});return _0x21e6be[_0xd500('0x76')];});return db['ChatQueue']['find']({'where':{'id':_0x2afb8d[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](function(_0x7defce){return db[_0xd500('0x7a')][_0xd500('0x7b')](function(_0x353486){return _0x7defce[_0xd500('0x73')](_0x1bf87a,{'transaction':_0x353486})[_0xd500('0x1f')](function(){return BPromise[_0xd500('0x7c')](_0x1b6dff,function(_0x12db5b){return db[_0xd500('0x69')]['findOrCreate']({'where':{'UserId':_0x12db5b['id'],'ChatQueueId':_0x2afb8d[_0xd500('0x5b')]['id']},'transaction':_0x353486});});})[_0xd500('0x1f')](function(){_0x1b6dff['forEach'](function(_0xf36832){socket['emit'](_0xd500('0x7d'),{'UserId':_0xf36832['id'],'ChatQueueId':_0x7defce['id']});});});});});}})[_0xd500('0x1f')](respondWithStatusCode(_0x5d9928,null))['catch'](handleError(_0x5d9928,null));};exports[_0xd500('0x7e')]=function(_0x46aba1,_0x4883af,_0x5913d4){return db[_0xd500('0x72')][_0xd500('0x59')]({'where':{'id':_0x46aba1[_0xd500('0x45')][_0xd500('0x74')]},'attributes':['id'],'include':[{'model':db[_0xd500('0x75')],'as':_0xd500('0x76'),'attributes':['id'],'raw':!![]}]})[_0xd500('0x1f')](handleEntityNotFound(_0x4883af,null))[_0xd500('0x1f')](function(_0x8fbc3b){var _0x15d369=_['map'](_0x8fbc3b,'id');var _0x486f9f=[];var _0x21c46b=[];var _0x183e9a=squel[_0xd500('0x7f')]();_0x183e9a[_0xd500('0x80')](_0xd500('0x81'))[_0xd500('0x82')](_0xd500('0x83'),'tq')['join'](_0xd500('0x84'),'ut',_0xd500('0x85'))[_0xd500('0x50')](_0xd500('0x86'),_0x46aba1[_0xd500('0x5b')]['id']);for(var _0x419de8=0x0;_0x419de8<_0x8fbc3b[_0xd500('0x4b')];_0x419de8+=0x1){let _0x2df685=_0x8fbc3b[_0x419de8];for(var _0x1e5aec=0x0;_0x1e5aec<_0x2df685[_0xd500('0x76')][_0xd500('0x4b')];_0x1e5aec+=0x1){let _0x214815=_0x2df685[_0xd500('0x76')][_0x1e5aec];var _0x4c9995=_0x183e9a[_0xd500('0x87')]();_0x4c9995[_0xd500('0x50')](_0xd500('0x88'),_0x214815['id']);_0x21c46b[_0xd500('0x89')](db[_0xd500('0x7a')][_0xd500('0x45')](_0x4c9995['toString'](),{'type':db['sequelize'][_0xd500('0x8a')][_0xd500('0x8b')]})['then'](function(_0x4fd34c){if(_0x4fd34c[_0xd500('0x4b')]===0x1){return _0x214815['id'];}else{var _0x4dbf4f=_[_0xd500('0x8c')](_[_0xd500('0x44')](_0x4fd34c,_0xd500('0x8d')),function(_0x315db0){return _[_0xd500('0x8e')](_0x15d369,_0x315db0);});if(_0x4dbf4f){return _0x214815['id'];}}}));}}return BPromise[_0xd500('0x8f')](_0x21c46b)['then'](function(_0x29cb9a){_0x486f9f=_(_0x486f9f)[_0xd500('0x90')](_0x29cb9a)['compact']()[_0xd500('0x91')]();return db['ChatQueue'][_0xd500('0x62')]({'where':{'id':_0x46aba1[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](function(_0x5f05f1){return db['sequelize'][_0xd500('0x7b')](function(_0x5cac74){return _0x5f05f1[_0xd500('0x7e')](_0x46aba1[_0xd500('0x45')][_0xd500('0x74')],{'transaction':_0x5cac74})['then'](function(){if(!_[_0xd500('0x92')](_0x486f9f)){return _0x5f05f1[_0xd500('0x93')](_0x486f9f,{'transaction':_0x5cac74});}})[_0xd500('0x1f')](function(){_0x486f9f[_0xd500('0x94')](function(_0x202ea9){socket['emit'](_0xd500('0x95'),{'UserId':_0x202ea9,'ChatQueueId':_0x5f05f1['id']});});});});});});})[_0xd500('0x1f')](respondWithStatusCode(_0x4883af,null))['catch'](handleError(_0x4883af,null));};exports[_0xd500('0x96')]=function(_0x5e1e6f,_0x2f4bc8,_0x2eb1aa){return db[_0xd500('0x3f')]['find']({'where':{'id':_0x5e1e6f[_0xd500('0x5b')]['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x2f4bc8,null))[_0xd500('0x1f')](function(_0x605c56){if(_0x605c56){return _0x605c56[_0xd500('0x96')](_0x5e1e6f[_0xd500('0x5d')][_0xd500('0x74')],_[_0xd500('0x97')](_0x5e1e6f[_0xd500('0x5d')],[_0xd500('0x74'),'id'])||{})['spread'](function(_0x1756b5){for(var _0x4e5b47=0x0;_0x4e5b47<_0x5e1e6f[_0xd500('0x5d')][_0xd500('0x74')][_0xd500('0x4b')];_0x4e5b47+=0x1){socket[_0xd500('0x98')](_0xd500('0x7d'),{'UserId':Number(_0x5e1e6f['body'][_0xd500('0x74')][_0x4e5b47]),'ChatQueueId':Number(_0x5e1e6f[_0xd500('0x5b')]['id'])});}return _0x1756b5;});}})[_0xd500('0x1f')](respondWithResult(_0x2f4bc8,null))[_0xd500('0x2a')](handleError(_0x2f4bc8,null));};exports[_0xd500('0x93')]=function(_0x5c5d36,_0x314055,_0x3b0144){return db[_0xd500('0x3f')]['find']({'where':{'id':_0x5c5d36['params']['id']}})[_0xd500('0x1f')](handleEntityNotFound(_0x314055,null))['then'](function(_0xb9b678){if(_0xb9b678){return _0xb9b678[_0xd500('0x93')](_0x5c5d36['query'][_0xd500('0x74')])[_0xd500('0x1f')](function(){if(_[_0xd500('0x99')](_0x5c5d36['query'][_0xd500('0x74')])){for(var _0x4a047a=0x0;_0x4a047a<_0x5c5d36['query'][_0xd500('0x74')][_0xd500('0x4b')];_0x4a047a+=0x1){socket[_0xd500('0x98')](_0xd500('0x95'),{'UserId':Number(_0x5c5d36[_0xd500('0x45')][_0xd500('0x74')][_0x4a047a]),'ChatQueueId':Number(_0x5c5d36['params']['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x5c5d36[_0xd500('0x45')]['ids']),'ChatQueueId':Number(_0x5c5d36['params']['id'])});}});}})['then'](respondWithStatusCode(_0x314055,null))[_0xd500('0x2a')](handleError(_0x314055,null));};exports[_0xd500('0x9a')]=function(_0x2c264b,_0x21f9b8,_0x2b21e7){var _0x36947c={};var _0x1c7ecf={};var _0x47d5c0;var _0x3169d9;return db[_0xd500('0x3f')]['findOne']({'where':{'id':_0x2c264b['params']['id']}})['then'](handleEntityNotFound(_0x21f9b8,null))[_0xd500('0x1f')](function(_0x25811f){if(_0x25811f){_0x47d5c0=_0x25811f;_0x1c7ecf['model']=_[_0xd500('0x46')](db[_0xd500('0x75')][_0xd500('0x40')]);_0x1c7ecf[_0xd500('0x45')]=_[_0xd500('0x46')](_0x2c264b['query']);_0x1c7ecf[_0xd500('0x47')]=_['intersection'](_0x1c7ecf['model'],_0x1c7ecf[_0xd500('0x45')]);_0x36947c[_0xd500('0x49')]=_['intersection'](_0x1c7ecf[_0xd500('0x43')],qs[_0xd500('0x4a')](_0x2c264b[_0xd500('0x45')]['fields']));_0x36947c['attributes']=_0x36947c[_0xd500('0x49')]['length']?_0x36947c['attributes']:_0x1c7ecf[_0xd500('0x43')];_0x36947c['order']=qs[_0xd500('0x4f')](_0x2c264b[_0xd500('0x45')][_0xd500('0x4f')]);_0x36947c[_0xd500('0x50')]=qs[_0xd500('0x47')](_[_0xd500('0x51')](_0x2c264b['query'],_0x1c7ecf[_0xd500('0x47')]));if(_0x2c264b[_0xd500('0x45')]['filter']){_0x36947c[_0xd500('0x50')]=_[_0xd500('0x55')](_0x36947c[_0xd500('0x50')],{'$or':_[_0xd500('0x44')](_0x36947c[_0xd500('0x49')],function(_0x856734){var _0x19859e={};_0x19859e[_0x856734]={'$like':'%'+_0x2c264b[_0xd500('0x45')][_0xd500('0x54')]+'%'};return _0x19859e;})});}_0x36947c=_[_0xd500('0x55')]({},_0x36947c,_0x2c264b[_0xd500('0x56')]);return _0x47d5c0[_0xd500('0x9a')](_0x36947c);}})[_0xd500('0x1f')](function(_0x4884bc){if(_0x4884bc){_0x3169d9=_0x4884bc['length'];if(!_0x2c264b[_0xd500('0x45')][_0xd500('0x4c')](_0xd500('0x4d'))){_0x36947c[_0xd500('0x30')]=qs[_0xd500('0x30')](_0x2c264b[_0xd500('0x45')][_0xd500('0x30')]);_0x36947c[_0xd500('0x2e')]=qs[_0xd500('0x2e')](_0x2c264b[_0xd500('0x45')][_0xd500('0x2e')]);}return _0x47d5c0[_0xd500('0x9a')](_0x36947c);}})[_0xd500('0x1f')](function(_0x5e9104){if(_0x5e9104){return _0x5e9104?{'count':_0x3169d9,'rows':_0x5e9104}:null;}})[_0xd500('0x1f')](respondWithResult(_0x21f9b8,null))[_0xd500('0x2a')](handleError(_0x21f9b8,null));};
\ No newline at end of file
+var _0x43f2=['request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','ChatQueues','UserProfileResource','end','stack','name','index','map','ChatQueue','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','pick','ChatQueueId','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x40ebff,_0x1dd15e){var _0x40122a=function(_0xae6174){while(--_0xae6174){_0x40ebff['push'](_0x40ebff['shift']());}};_0x40122a(++_0x1dd15e);}(_0x43f2,0x97));var _0x243f=function(_0x5aecfb,_0x4a149d){_0x5aecfb=_0x5aecfb-0x0;var _0x34b827=_0x43f2[_0x5aecfb];return _0x34b827;};'use strict';var emlformat=require(_0x243f('0x0'));var rimraf=require(_0x243f('0x1'));var zipdir=require(_0x243f('0x2'));var jsonpatch=require(_0x243f('0x3'));var rp=require(_0x243f('0x4'));var moment=require(_0x243f('0x5'));var BPromise=require(_0x243f('0x6'));var Mustache=require(_0x243f('0x7'));var util=require('util');var path=require(_0x243f('0x8'));var sox=require(_0x243f('0x9'));var csv=require('to-csv');var ejs=require(_0x243f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x243f('0xb'));var crypto=require(_0x243f('0xc'));var jsforce=require(_0x243f('0xd'));var deskjs=require(_0x243f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x243f('0xf'));var Redis=require('ioredis');var authService=require(_0x243f('0x10'));var qs=require(_0x243f('0x11'));var as=require(_0x243f('0x12'));var hardwareService=require(_0x243f('0x13'));var logger=require(_0x243f('0x14'))(_0x243f('0x15'));var utils=require(_0x243f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x243f('0x17'));var db=require(_0x243f('0x18'))['db'];config[_0x243f('0x19')]=_[_0x243f('0x1a')](config[_0x243f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x243f('0x1b'))(new Redis(config[_0x243f('0x19')]));require(_0x243f('0x1c'))[_0x243f('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x243f('0x1e')][_0x243f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xce6dc6,_0x545782,_0x20b5fb,_0x55f3f0){return new BPromise(function(_0x408f22,_0x22a92c){var _0x5de166=_0x55f3f0||client;return _0x5de166['request'](_0xce6dc6,_0x20b5fb)['then'](function(_0x1a115f){logger[_0x243f('0x20')](_0x243f('0x21'),_0x545782,'request\x20sent');logger[_0x243f('0x22')](_0x243f('0x23'),_0x545782,_0x243f('0x24'),JSON[_0x243f('0x25')](_0x1a115f));if(_0x1a115f[_0x243f('0x26')]){if(_0x1a115f[_0x243f('0x26')][_0x243f('0x27')]===0x1f4){logger[_0x243f('0x26')]('ChatQueue,\x20%s,\x20%s',_0x545782,_0x1a115f[_0x243f('0x26')]['message']);return _0x22a92c(_0x1a115f[_0x243f('0x26')][_0x243f('0x28')]);}logger[_0x243f('0x26')](_0x243f('0x21'),_0x545782,_0x1a115f[_0x243f('0x26')]['message']);return _0x408f22(_0x1a115f[_0x243f('0x26')][_0x243f('0x28')]);}else{logger[_0x243f('0x20')]('ChatQueue,\x20%s,\x20%s',_0x545782,_0x243f('0x24'));_0x408f22(_0x1a115f[_0x243f('0x29')]['message']);}})[_0x243f('0x2a')](function(_0x19c4a1){logger[_0x243f('0x26')](_0x243f('0x21'),_0x545782,_0x19c4a1);_0x22a92c(_0x19c4a1);});});}function respondWithStatusCode(_0x776b3,_0x548ac0){_0x548ac0=_0x548ac0||0xcc;return function(_0x3bb3de){if(_0x3bb3de){return _0x776b3[_0x243f('0x2b')](_0x548ac0);}return _0x776b3[_0x243f('0x2c')](_0x548ac0)['end']();};}function respondWithResult(_0x305be2,_0x543c57){_0x543c57=_0x543c57||0xc8;return function(_0x19cb67){if(_0x19cb67){return _0x305be2[_0x243f('0x2c')](_0x543c57)[_0x243f('0x2d')](_0x19cb67);}};}function respondWithFilteredResult(_0x2c6aa1,_0x1c889f){return function(_0x4754e1){if(_0x4754e1){var _0x436ade=typeof _0x1c889f['offset']===_0x243f('0x2e')&&typeof _0x1c889f[_0x243f('0x2f')]==='undefined';var _0x4ddd69=_0x4754e1[_0x243f('0x30')];var _0x380146=_0x436ade?0x0:_0x1c889f['offset'];var _0xc43768=_0x436ade?_0x4754e1['count']:_0x1c889f[_0x243f('0x31')]+_0x1c889f[_0x243f('0x2f')];var _0x4bcc98;if(_0xc43768>=_0x4ddd69){_0xc43768=_0x4ddd69;_0x4bcc98=0xc8;}else{_0x4bcc98=0xce;}_0x2c6aa1[_0x243f('0x2c')](_0x4bcc98);return _0x2c6aa1['set'](_0x243f('0x32'),_0x380146+'-'+_0xc43768+'/'+_0x4ddd69)[_0x243f('0x2d')](_0x4754e1);}return null;};}function patchUpdates(_0x124cdc){return function(_0x5c923b){try{jsonpatch[_0x243f('0x33')](_0x5c923b,_0x124cdc,!![]);}catch(_0x162cb2){return BPromise[_0x243f('0x34')](_0x162cb2);}return _0x5c923b[_0x243f('0x35')]();};}function saveUpdates(_0x480d7b,_0x1d3a11){return function(_0x1ee370){if(_0x1ee370){return _0x1ee370[_0x243f('0x36')](_0x480d7b)[_0x243f('0x37')](function(_0x5a1b14){return _0x5a1b14;});}return null;};}function removeEntity(_0x199405,_0x38fe37){return function(_0x1f1f95){if(_0x1f1f95){return _0x1f1f95[_0x243f('0x38')]()['then'](function(){var _0x24b21c=_0x1f1f95['get']({'plain':!![]});var _0x499312=_0x243f('0x39');return db[_0x243f('0x3a')][_0x243f('0x38')]({'where':{'type':_0x499312,'resourceId':_0x24b21c['id']}})[_0x243f('0x37')](function(){return _0x1f1f95;});})['then'](function(){_0x199405['status'](0xcc)[_0x243f('0x3b')]();});}};}function handleEntityNotFound(_0x5856f5,_0x43a848){return function(_0x179f66){if(!_0x179f66){_0x5856f5[_0x243f('0x2b')](0x194);}return _0x179f66;};}function handleError(_0x31f6f5,_0x8eaee0){_0x8eaee0=_0x8eaee0||0x1f4;return function(_0x4be4ad){logger[_0x243f('0x26')](_0x4be4ad[_0x243f('0x3c')]);if(_0x4be4ad[_0x243f('0x3d')]){delete _0x4be4ad[_0x243f('0x3d')];}_0x31f6f5[_0x243f('0x2c')](_0x8eaee0)['send'](_0x4be4ad);};}exports[_0x243f('0x3e')]=function(_0x53985c,_0x4ad269){var _0x4038fd={},_0xd4130a={},_0x517359={'count':0x0,'rows':[]};var _0x2221e3=_[_0x243f('0x3f')](db[_0x243f('0x40')]['rawAttributes'],function(_0x272887){return{'name':_0x272887[_0x243f('0x41')],'type':_0x272887['type'][_0x243f('0x42')]};});_0xd4130a[_0x243f('0x43')]=_['map'](_0x2221e3,_0x243f('0x3d'));_0xd4130a[_0x243f('0x44')]=_['keys'](_0x53985c['query']);_0xd4130a[_0x243f('0x45')]=_[_0x243f('0x46')](_0xd4130a[_0x243f('0x43')],_0xd4130a['query']);_0x4038fd[_0x243f('0x47')]=_['intersection'](_0xd4130a[_0x243f('0x43')],qs[_0x243f('0x48')](_0x53985c['query']['fields']));_0x4038fd[_0x243f('0x47')]=_0x4038fd['attributes'][_0x243f('0x49')]?_0x4038fd[_0x243f('0x47')]:_0xd4130a['model'];if(!_0x53985c['query']['hasOwnProperty'](_0x243f('0x4a'))){_0x4038fd[_0x243f('0x2f')]=qs['limit'](_0x53985c['query'][_0x243f('0x2f')]);_0x4038fd['offset']=qs['offset'](_0x53985c[_0x243f('0x44')]['offset']);}_0x4038fd['order']=qs[_0x243f('0x4b')](_0x53985c[_0x243f('0x44')][_0x243f('0x4b')]);_0x4038fd[_0x243f('0x4c')]=qs['filters'](_['pick'](_0x53985c['query'],_0xd4130a[_0x243f('0x45')]),_0x2221e3);if(_0x53985c['query'][_0x243f('0x4d')]){_0x4038fd[_0x243f('0x4c')]=_[_0x243f('0x4e')](_0x4038fd[_0x243f('0x4c')],{'$or':_[_0x243f('0x3f')](_0x2221e3,function(_0x591466){if(_0x591466[_0x243f('0x4f')]!=='VIRTUAL'){var _0x1ce528={};_0x1ce528[_0x591466['name']]={'$like':'%'+_0x53985c[_0x243f('0x44')][_0x243f('0x4d')]+'%'};return _0x1ce528;}})});}_0x4038fd=_[_0x243f('0x4e')]({},_0x4038fd,_0x53985c[_0x243f('0x50')]);var _0x414d6e={'where':_0x4038fd['where']};return db[_0x243f('0x40')][_0x243f('0x30')](_0x414d6e)[_0x243f('0x37')](function(_0x408023){_0x517359[_0x243f('0x30')]=_0x408023;if(_0x53985c[_0x243f('0x44')][_0x243f('0x51')]){_0x4038fd[_0x243f('0x52')]=[{'all':!![]}];}return db[_0x243f('0x40')][_0x243f('0x53')](_0x4038fd);})[_0x243f('0x37')](function(_0x3ad657){_0x517359[_0x243f('0x54')]=_0x3ad657;return _0x517359;})['then'](respondWithFilteredResult(_0x4ad269,_0x4038fd))['catch'](handleError(_0x4ad269,null));};exports['show']=function(_0x371c55,_0x42d122){var _0x37a288={'raw':!![],'where':{'id':_0x371c55[_0x243f('0x55')]['id']}},_0x4afcc3={};_0x4afcc3[_0x243f('0x43')]=_[_0x243f('0x56')](db[_0x243f('0x40')][_0x243f('0x57')]);_0x4afcc3[_0x243f('0x44')]=_['keys'](_0x371c55[_0x243f('0x44')]);_0x4afcc3[_0x243f('0x45')]=_[_0x243f('0x46')](_0x4afcc3[_0x243f('0x43')],_0x4afcc3[_0x243f('0x44')]);_0x37a288[_0x243f('0x47')]=_[_0x243f('0x46')](_0x4afcc3[_0x243f('0x43')],qs[_0x243f('0x48')](_0x371c55[_0x243f('0x44')][_0x243f('0x48')]));_0x37a288[_0x243f('0x47')]=_0x37a288[_0x243f('0x47')]['length']?_0x37a288[_0x243f('0x47')]:_0x4afcc3['model'];if(_0x371c55['query'][_0x243f('0x51')]){_0x37a288[_0x243f('0x52')]=[{'all':!![]}];}_0x37a288=_[_0x243f('0x4e')]({},_0x37a288,_0x371c55[_0x243f('0x50')]);return db['ChatQueue'][_0x243f('0x58')](_0x37a288)[_0x243f('0x37')](handleEntityNotFound(_0x42d122,null))[_0x243f('0x37')](respondWithResult(_0x42d122,null))[_0x243f('0x2a')](handleError(_0x42d122,null));};exports[_0x243f('0x59')]=function(_0x13a02e,_0x38a588){return db['ChatQueue'][_0x243f('0x59')](_0x13a02e['body'],{})['then'](function(_0xb05f7f){var _0x16c148=_0x13a02e[_0x243f('0x5a')][_0x243f('0x5b')]({'plain':!![]});if(!_0x16c148)throw new Error(_0x243f('0x5c'));if(_0x16c148[_0x243f('0x5d')]===_0x243f('0x5a')){var _0x5e8b90=_0xb05f7f[_0x243f('0x5b')]({'plain':!![]});var _0x17f49d=_0x243f('0x39');return db[_0x243f('0x5e')][_0x243f('0x58')]({'where':{'name':_0x17f49d,'userProfileId':_0x16c148[_0x243f('0x5f')]},'raw':!![]})[_0x243f('0x37')](function(_0xc829b3){if(_0xc829b3&&_0xc829b3[_0x243f('0x60')]===0x0){return db['UserProfileResource'][_0x243f('0x59')]({'name':_0x5e8b90[_0x243f('0x3d')],'resourceId':_0x5e8b90['id'],'type':_0xc829b3[_0x243f('0x3d')],'sectionId':_0xc829b3['id']},{})[_0x243f('0x37')](function(){return _0xb05f7f;});}else{return _0xb05f7f;}})[_0x243f('0x2a')](function(_0x152f30){logger[_0x243f('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x152f30);throw _0x152f30;});}return _0xb05f7f;})[_0x243f('0x37')](respondWithResult(_0x38a588,0xc9))[_0x243f('0x2a')](handleError(_0x38a588,null));};exports[_0x243f('0x36')]=function(_0x5383f2,_0x5b1873){if(_0x5383f2[_0x243f('0x61')]['id']){delete _0x5383f2[_0x243f('0x61')]['id'];}return db[_0x243f('0x40')][_0x243f('0x58')]({'where':{'id':_0x5383f2['params']['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x5b1873,null))[_0x243f('0x37')](saveUpdates(_0x5383f2['body'],null))[_0x243f('0x37')](respondWithResult(_0x5b1873,null))[_0x243f('0x2a')](handleError(_0x5b1873,null));};exports[_0x243f('0x38')]=function(_0x4ac4db,_0x1b7a67){return db['ChatQueue']['find']({'where':{'id':_0x4ac4db[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x1b7a67,null))['then'](removeEntity(_0x1b7a67,null))[_0x243f('0x2a')](handleError(_0x1b7a67,null));};exports[_0x243f('0x62')]=function(_0x45d7dc,_0x6f1b59){return db['ChatQueue'][_0x243f('0x62')]()['then'](respondWithResult(_0x6f1b59,null))[_0x243f('0x2a')](handleError(_0x6f1b59,null));};exports[_0x243f('0x63')]=function(_0x56ad7d,_0x3421ef,_0x312e63){var _0xfc36e5={'raw':!![],'where':{}},_0x2221ec={},_0x2764e3;return db['ChatQueue'][_0x243f('0x64')]({'where':{'id':_0x56ad7d[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x3421ef,null))[_0x243f('0x37')](function(_0x54fca3){if(_0x54fca3){_0x2764e3=_0x54fca3['get']({'plain':!![]});_0x2221ec['model']=_[_0x243f('0x56')](db[_0x243f('0x65')][_0x243f('0x57')]);_0x2221ec[_0x243f('0x44')]=_[_0x243f('0x56')](_0x56ad7d[_0x243f('0x44')]);_0x2221ec[_0x243f('0x45')]=_[_0x243f('0x46')](_0x2221ec['model'],_0x2221ec['query']);_0xfc36e5[_0x243f('0x47')]=_[_0x243f('0x46')](_0x2221ec[_0x243f('0x43')],qs['fields'](_0x56ad7d[_0x243f('0x44')]['fields']));_0xfc36e5[_0x243f('0x47')]=_0xfc36e5[_0x243f('0x47')][_0x243f('0x49')]?_0xfc36e5[_0x243f('0x47')]:_0x2221ec['model'];if(!_0x56ad7d[_0x243f('0x44')][_0x243f('0x66')](_0x243f('0x4a'))){_0xfc36e5[_0x243f('0x2f')]=qs[_0x243f('0x2f')](_0x56ad7d[_0x243f('0x44')]['limit']);_0xfc36e5['offset']=qs[_0x243f('0x31')](_0x56ad7d[_0x243f('0x44')][_0x243f('0x31')]);}_0xfc36e5[_0x243f('0x67')]=qs[_0x243f('0x4b')](_0x56ad7d['query'][_0x243f('0x4b')]);_0xfc36e5[_0x243f('0x4c')]=qs[_0x243f('0x45')](_[_0x243f('0x68')](_0x56ad7d['query'],_0x2221ec[_0x243f('0x45')]));_0xfc36e5[_0x243f('0x4c')][_0x243f('0x69')]=_0x54fca3['id'];if(_0x56ad7d[_0x243f('0x44')][_0x243f('0x4d')]){_0xfc36e5[_0x243f('0x4c')]=_[_0x243f('0x4e')](_0xfc36e5['where'],{'$or':_[_0x243f('0x3f')](_0xfc36e5['attributes'],function(_0x53948e){var _0x4610df={};_0x4610df[_0x53948e]={'$like':'%'+_0x56ad7d['query']['filter']+'%'};return _0x4610df;})});}_0xfc36e5=_[_0x243f('0x4e')]({},_0xfc36e5,_0x56ad7d[_0x243f('0x50')]);return db[_0x243f('0x65')]['findAll'](_0xfc36e5);}})['then'](function(_0x47d078){if(_0x47d078){return db['User'][_0x243f('0x6a')]({'where':{'id':_[_0x243f('0x3f')](_0x47d078,_0x243f('0x6b')),'role':'agent'},'attributes':['id',_0x243f('0x3d'),'chatPause',_0x243f('0x6c'),_0x243f('0x6d')]});}})['then'](function(_0x419c39){if(_0x419c39){return{'count':_0x419c39[_0x243f('0x30')],'rows':_['map'](_0x419c39[_0x243f('0x54')],function(_0x55acbc){return{'membername':_0x55acbc['name'],'UserId':_0x55acbc['id'],'queue_name':_0x2764e3[_0x243f('0x3d')],'ChatQueueId':_0x2764e3['id'],'interface':util[_0x243f('0x6e')](_0x243f('0x6f'),_0x243f('0x70'),_0x55acbc[_0x243f('0x3d')]),'penalty':0x0,'paused':_0x55acbc['chatPause'],'createdAt':_0x55acbc[_0x243f('0x6d')],'updatedAt':_0x55acbc[_0x243f('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3421ef,_0xfc36e5))[_0x243f('0x2a')](handleError(_0x3421ef,null));};exports[_0x243f('0x71')]=function(_0x825b5f,_0x268be6,_0x330501){var _0x566a56={};var _0x4fcf5f={};var _0xf7520e;var _0x1d4841;return db[_0x243f('0x40')][_0x243f('0x64')]({'where':{'id':_0x825b5f[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x268be6,null))[_0x243f('0x37')](function(_0x264188){if(_0x264188){_0xf7520e=_0x264188;_0x4fcf5f['model']=_[_0x243f('0x56')](db[_0x243f('0x72')]['rawAttributes']);_0x4fcf5f[_0x243f('0x44')]=_['keys'](_0x825b5f[_0x243f('0x44')]);_0x4fcf5f[_0x243f('0x45')]=_[_0x243f('0x46')](_0x4fcf5f[_0x243f('0x43')],_0x4fcf5f[_0x243f('0x44')]);_0x566a56['attributes']=_[_0x243f('0x46')](_0x4fcf5f['model'],qs['fields'](_0x825b5f[_0x243f('0x44')][_0x243f('0x48')]));_0x566a56['attributes']=_0x566a56[_0x243f('0x47')]['length']?_0x566a56[_0x243f('0x47')]:_0x4fcf5f['model'];_0x566a56[_0x243f('0x67')]=qs[_0x243f('0x4b')](_0x825b5f['query'][_0x243f('0x4b')]);_0x566a56[_0x243f('0x4c')]=qs[_0x243f('0x45')](_[_0x243f('0x68')](_0x825b5f[_0x243f('0x44')],_0x4fcf5f[_0x243f('0x45')]));if(_0x825b5f[_0x243f('0x44')]['filter']){_0x566a56['where']=_[_0x243f('0x4e')](_0x566a56[_0x243f('0x4c')],{'$or':_[_0x243f('0x3f')](_0x566a56[_0x243f('0x47')],function(_0x23f59b){var _0x38bfd9={};_0x38bfd9[_0x23f59b]={'$like':'%'+_0x825b5f[_0x243f('0x44')][_0x243f('0x4d')]+'%'};return _0x38bfd9;})});}_0x566a56=_[_0x243f('0x4e')]({},_0x566a56,_0x825b5f['options']);return _0xf7520e[_0x243f('0x71')](_0x566a56);}})['then'](function(_0x54bdd2){if(_0x54bdd2){_0x1d4841=_0x54bdd2['length'];if(!_0x825b5f[_0x243f('0x44')][_0x243f('0x66')](_0x243f('0x4a'))){_0x566a56[_0x243f('0x2f')]=qs[_0x243f('0x2f')](_0x825b5f[_0x243f('0x44')]['limit']);_0x566a56['offset']=qs['offset'](_0x825b5f[_0x243f('0x44')]['offset']);}return _0xf7520e[_0x243f('0x71')](_0x566a56);}})['then'](function(_0x185534){if(_0x185534){return _0x185534?{'count':_0x1d4841,'rows':_0x185534}:null;}})[_0x243f('0x37')](respondWithResult(_0x268be6,null))[_0x243f('0x2a')](handleError(_0x268be6,null));};exports[_0x243f('0x73')]=function(_0x573645,_0x346899,_0x4748b6){var _0x495cbd=_0x573645[_0x243f('0x61')][_0x243f('0x74')];return db[_0x243f('0x72')]['findAll']({'where':{'id':_0x495cbd},'attributes':['id'],'include':[{'model':db[_0x243f('0x75')],'as':'Agents','attributes':['id',_0x243f('0x3d'),_0x243f('0x76'),_0x243f('0x77'),_0x243f('0x78')],'raw':!![]}]})[_0x243f('0x37')](function(_0x206a3e){if(_0x206a3e){var _0xd02535=_[_0x243f('0x79')](_0x206a3e,function(_0x3eb9a9){var _0x4bf5be=_0x3eb9a9[_0x243f('0x5b')]({'plain':!![]});return _0x4bf5be[_0x243f('0x7a')];});return db['ChatQueue'][_0x243f('0x58')]({'where':{'id':_0x573645[_0x243f('0x55')]['id']}})[_0x243f('0x37')](function(_0xda7872){return db[_0x243f('0x7b')][_0x243f('0x7c')](function(_0x3fff63){return _0xda7872['addTeams'](_0x495cbd,{'transaction':_0x3fff63})['then'](function(){return BPromise[_0x243f('0x7d')](_0xd02535,function(_0x80a2d9){return db['UserChatQueue'][_0x243f('0x7e')]({'where':{'UserId':_0x80a2d9['id'],'ChatQueueId':_0x573645[_0x243f('0x55')]['id']},'transaction':_0x3fff63});});})[_0x243f('0x37')](function(){_0xd02535[_0x243f('0x7f')](function(_0x46b827){socket[_0x243f('0x80')](_0x243f('0x81'),{'UserId':_0x46b827['id'],'ChatQueueId':_0xda7872['id']});});});});});}})[_0x243f('0x37')](respondWithStatusCode(_0x346899,null))[_0x243f('0x2a')](handleError(_0x346899,null));};exports[_0x243f('0x82')]=function(_0x5c02cd,_0x162f8d,_0x49942f){return db['Team'][_0x243f('0x53')]({'where':{'id':_0x5c02cd['query'][_0x243f('0x74')]},'attributes':['id'],'include':[{'model':db[_0x243f('0x75')],'as':_0x243f('0x7a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x162f8d,null))['then'](function(_0x54e46b){var _0x86f2cc=_[_0x243f('0x3f')](_0x54e46b,'id');var _0x184235=[];var _0x383120=[];var _0x556155=squel[_0x243f('0x83')]();_0x556155[_0x243f('0x84')](_0x243f('0x85'))['from'](_0x243f('0x86'),'tq')[_0x243f('0x87')](_0x243f('0x88'),'ut',_0x243f('0x89'))['where']('ChatQueueId\x20=\x20?',_0x5c02cd[_0x243f('0x55')]['id']);for(var _0x5bb5ed=0x0;_0x5bb5ed<_0x54e46b[_0x243f('0x49')];_0x5bb5ed+=0x1){let _0x13e070=_0x54e46b[_0x5bb5ed];for(var _0x443147=0x0;_0x443147<_0x13e070[_0x243f('0x7a')][_0x243f('0x49')];_0x443147+=0x1){let _0x3e117b=_0x13e070['Agents'][_0x443147];var _0x51d2b5=_0x556155['clone']();_0x51d2b5[_0x243f('0x4c')]('ut.UserId\x20=\x20?',_0x3e117b['id']);_0x383120['push'](db['sequelize']['query'](_0x51d2b5[_0x243f('0x8a')](),{'type':db[_0x243f('0x7b')][_0x243f('0x8b')][_0x243f('0x8c')]})[_0x243f('0x37')](function(_0x38ce34){if(_0x38ce34[_0x243f('0x49')]===0x1){return _0x3e117b['id'];}else{var _0x394ff8=_[_0x243f('0x8d')](_['map'](_0x38ce34,_0x243f('0x8e')),function(_0x31709e){return _[_0x243f('0x8f')](_0x86f2cc,_0x31709e);});if(_0x394ff8){return _0x3e117b['id'];}}}));}}return BPromise[_0x243f('0x90')](_0x383120)[_0x243f('0x37')](function(_0x305cf8){_0x184235=_(_0x184235)[_0x243f('0x91')](_0x305cf8)[_0x243f('0x92')]()[_0x243f('0x93')]();return db[_0x243f('0x40')][_0x243f('0x58')]({'where':{'id':_0x5c02cd['params']['id']}})[_0x243f('0x37')](function(_0x2e4599){return db['sequelize']['transaction'](function(_0x16a592){return _0x2e4599['removeTeams'](_0x5c02cd['query'][_0x243f('0x74')],{'transaction':_0x16a592})[_0x243f('0x37')](function(){if(!_[_0x243f('0x94')](_0x184235)){return _0x2e4599['removeAgents'](_0x184235,{'transaction':_0x16a592});}})[_0x243f('0x37')](function(){_0x184235['forEach'](function(_0x1eb1c1){socket[_0x243f('0x80')](_0x243f('0x95'),{'UserId':_0x1eb1c1,'ChatQueueId':_0x2e4599['id']});});});});});});})[_0x243f('0x37')](respondWithStatusCode(_0x162f8d,null))[_0x243f('0x2a')](handleError(_0x162f8d,null));};exports[_0x243f('0x96')]=function(_0x30b216,_0x2e9f4a,_0x1c3ec8){return db[_0x243f('0x40')][_0x243f('0x58')]({'where':{'id':_0x30b216['params']['id']}})['then'](handleEntityNotFound(_0x2e9f4a,null))[_0x243f('0x37')](function(_0x244cd5){if(_0x244cd5){return _0x244cd5['addAgents'](_0x30b216['body'][_0x243f('0x74')],_[_0x243f('0x97')](_0x30b216[_0x243f('0x61')],['ids','id'])||{})['spread'](function(_0x58c738){for(var _0x13c11c=0x0;_0x13c11c<_0x30b216[_0x243f('0x61')][_0x243f('0x74')][_0x243f('0x49')];_0x13c11c+=0x1){socket[_0x243f('0x80')](_0x243f('0x81'),{'UserId':Number(_0x30b216[_0x243f('0x61')]['ids'][_0x13c11c]),'ChatQueueId':Number(_0x30b216['params']['id'])});}return _0x58c738;});}})['then'](respondWithResult(_0x2e9f4a,null))[_0x243f('0x2a')](handleError(_0x2e9f4a,null));};exports[_0x243f('0x98')]=function(_0x4305b6,_0x167eaa,_0x1031bd){return db['ChatQueue'][_0x243f('0x58')]({'where':{'id':_0x4305b6[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x167eaa,null))[_0x243f('0x37')](function(_0x3d0439){if(_0x3d0439){return _0x3d0439[_0x243f('0x98')](_0x4305b6[_0x243f('0x44')]['ids'])['then'](function(){if(_[_0x243f('0x99')](_0x4305b6[_0x243f('0x44')][_0x243f('0x74')])){for(var _0x706e34=0x0;_0x706e34<_0x4305b6[_0x243f('0x44')][_0x243f('0x74')]['length'];_0x706e34+=0x1){socket[_0x243f('0x80')](_0x243f('0x95'),{'UserId':Number(_0x4305b6[_0x243f('0x44')][_0x243f('0x74')][_0x706e34]),'ChatQueueId':Number(_0x4305b6[_0x243f('0x55')]['id'])});}}else{socket[_0x243f('0x80')](_0x243f('0x95'),{'UserId':Number(_0x4305b6['query']['ids']),'ChatQueueId':Number(_0x4305b6[_0x243f('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x167eaa,null))[_0x243f('0x2a')](handleError(_0x167eaa,null));};exports['getAgents']=function(_0x432d62,_0x2778bb,_0x3ca30d){var _0x5753eb={};var _0x1b289c={};var _0x51f830;var _0x1c76ce;return db[_0x243f('0x40')][_0x243f('0x64')]({'where':{'id':_0x432d62[_0x243f('0x55')]['id']}})[_0x243f('0x37')](handleEntityNotFound(_0x2778bb,null))[_0x243f('0x37')](function(_0x4c5e7e){if(_0x4c5e7e){_0x51f830=_0x4c5e7e;_0x1b289c[_0x243f('0x43')]=_[_0x243f('0x56')](db[_0x243f('0x75')]['rawAttributes']);_0x1b289c['query']=_[_0x243f('0x56')](_0x432d62[_0x243f('0x44')]);_0x1b289c[_0x243f('0x45')]=_['intersection'](_0x1b289c[_0x243f('0x43')],_0x1b289c[_0x243f('0x44')]);_0x5753eb[_0x243f('0x47')]=_['intersection'](_0x1b289c[_0x243f('0x43')],qs[_0x243f('0x48')](_0x432d62[_0x243f('0x44')][_0x243f('0x48')]));_0x5753eb[_0x243f('0x47')]=_0x5753eb[_0x243f('0x47')]['length']?_0x5753eb['attributes']:_0x1b289c['model'];_0x5753eb[_0x243f('0x67')]=qs[_0x243f('0x4b')](_0x432d62[_0x243f('0x44')][_0x243f('0x4b')]);_0x5753eb[_0x243f('0x4c')]=qs[_0x243f('0x45')](_[_0x243f('0x68')](_0x432d62[_0x243f('0x44')],_0x1b289c[_0x243f('0x45')]));if(_0x432d62[_0x243f('0x44')][_0x243f('0x4d')]){_0x5753eb[_0x243f('0x4c')]=_[_0x243f('0x4e')](_0x5753eb['where'],{'$or':_[_0x243f('0x3f')](_0x5753eb[_0x243f('0x47')],function(_0x2f0737){var _0x5330ca={};_0x5330ca[_0x2f0737]={'$like':'%'+_0x432d62[_0x243f('0x44')][_0x243f('0x4d')]+'%'};return _0x5330ca;})});}_0x5753eb=_[_0x243f('0x4e')]({},_0x5753eb,_0x432d62['options']);return _0x51f830['getAgents'](_0x5753eb);}})[_0x243f('0x37')](function(_0x2a0607){if(_0x2a0607){_0x1c76ce=_0x2a0607[_0x243f('0x49')];if(!_0x432d62[_0x243f('0x44')][_0x243f('0x66')](_0x243f('0x4a'))){_0x5753eb[_0x243f('0x2f')]=qs['limit'](_0x432d62[_0x243f('0x44')][_0x243f('0x2f')]);_0x5753eb[_0x243f('0x31')]=qs['offset'](_0x432d62[_0x243f('0x44')][_0x243f('0x31')]);}return _0x51f830[_0x243f('0x9a')](_0x5753eb);}})[_0x243f('0x37')](function(_0x5b49fa){if(_0x5b49fa){return _0x5b49fa?{'count':_0x1c76ce,'rows':_0x5b49fa}:null;}})['then'](respondWithResult(_0x2778bb,null))[_0x243f('0x2a')](handleError(_0x2778bb,null));};
\ No newline at end of file
index 996c661..0807f8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x441a=['save','update','remove','hasOwnProperty','events','ChatQueue'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0x441a,0x7c));var _0xa441=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x441a[_0x38537f];return _0x141e23;};'use strict';var EventEmitter=require(_0xa441('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xa441('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa441('0x2'),'afterUpdate':_0xa441('0x3'),'afterDestroy':_0xa441('0x4')};function emitEvent(_0xc8e953){return function(_0x4fad7d,_0x573d87,_0x3346aa){ChatQueueEvents['emit'](_0xc8e953+':'+_0x4fad7d['id'],_0x4fad7d);ChatQueueEvents['emit'](_0xc8e953,_0x4fad7d);_0x3346aa(null);};}for(var e in events){if(events[_0xa441('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x1c06=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x20c522,_0x50e1d2){var _0x346df6=function(_0x2ef44c){while(--_0x2ef44c){_0x20c522['push'](_0x20c522['shift']());}};_0x346df6(++_0x50e1d2);}(_0x1c06,0xc0));var _0x61c0=function(_0x4e90e3,_0x570a1d){_0x4e90e3=_0x4e90e3-0x0;var _0x295e5b=_0x1c06[_0x4e90e3];return _0x295e5b;};'use strict';var EventEmitter=require(_0x61c0('0x0'));var ChatQueue=require(_0x61c0('0x1'))['db'][_0x61c0('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x61c0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x61c0('0x4'),'afterDestroy':_0x61c0('0x5')};function emitEvent(_0x5a1865){return function(_0x3ccc01,_0xf4617f,_0x3dfe21){ChatQueueEvents[_0x61c0('0x6')](_0x5a1865+':'+_0x3ccc01['id'],_0x3ccc01);ChatQueueEvents[_0x61c0('0x6')](_0x5a1865,_0x3ccc01);_0x3dfe21(null);};}for(var e in events){if(events[_0x61c0('0x7')](e)){var event=events[e];ChatQueue[_0x61c0('0x8')](e,emitEvent(event));}}module[_0x61c0('0x9')]=ChatQueueEvents;
\ No newline at end of file
index 0f0703e..20d9775 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf596=['ChatQueue','chat_queues','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x47962a,_0x1ac3f4){var _0xaf0a07=function(_0x18f5fd){while(--_0x18f5fd){_0x47962a['push'](_0x47962a['shift']());}};_0xaf0a07(++_0x1ac3f4);}(_0xf596,0x1ca));var _0x6f59=function(_0x421f35,_0x52ba84){_0x421f35=_0x421f35-0x0;var _0x580a22=_0xf596[_0x421f35];return _0x580a22;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f59('0x0'))(_0x6f59('0x1'));var moment=require(_0x6f59('0x2'));var BPromise=require(_0x6f59('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f59('0x4'));var rimraf=require(_0x6f59('0x5'));var config=require(_0x6f59('0x6'));var attributes=require(_0x6f59('0x7'));module[_0x6f59('0x8')]=function(_0x7edd7,_0x26cb0f){return _0x7edd7[_0x6f59('0x9')](_0x6f59('0xa'),attributes,{'tableName':_0x6f59('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe819=['api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','lodash','../../config/logger'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0xe819,0x17f));var _0x9e81=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe819[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9e81('0x0'));var util=require('util');var logger=require(_0x9e81('0x1'))(_0x9e81('0x2'));var moment=require(_0x9e81('0x3'));var BPromise=require(_0x9e81('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e81('0x5'));var rimraf=require(_0x9e81('0x6'));var config=require(_0x9e81('0x7'));var attributes=require(_0x9e81('0x8'));module['exports']=function(_0x1ad12d,_0x30a50b){return _0x1ad12d['define'](_0x9e81('0x9'),attributes,{'tableName':_0x9e81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 35a813f..acc5c96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x285b=['http','redis','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options','limit','include','map','model','attributes','ShowChatQueue','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xaf2d57,_0x1e904e){var _0x1e2141=function(_0x2bd658){while(--_0x2bd658){_0xaf2d57['push'](_0xaf2d57['shift']());}};_0x1e2141(++_0x1e904e);}(_0x285b,0x171));var _0xb285=function(_0x3a5d2f,_0x3d5590){_0x3a5d2f=_0x3a5d2f-0x0;var _0x107045=_0x285b[_0x3a5d2f];return _0x107045;};'use strict';var _=require(_0xb285('0x0'));var util=require('util');var moment=require(_0xb285('0x1'));var BPromise=require(_0xb285('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb285('0x3'));var db=require(_0xb285('0x4'))['db'];var utils=require(_0xb285('0x5'));var logger=require(_0xb285('0x6'))(_0xb285('0x7'));var config=require(_0xb285('0x8'));var jayson=require(_0xb285('0x9'));var client=jayson[_0xb285('0xa')][_0xb285('0xb')]({'port':0x232a});config[_0xb285('0xc')]=_['defaults'](config[_0xb285('0xc')],{'host':_0xb285('0xd'),'port':0x18eb});var socket=require(_0xb285('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xb285('0xf')](socket);function respondWithRpcPromise(_0x2556dc,_0x133cc7,_0xd138d8){return new BPromise(function(_0x4e5976,_0x3d2a2b){return client['request'](_0x2556dc,_0xd138d8)[_0xb285('0x10')](function(_0x46ef65){logger[_0xb285('0x11')](_0xb285('0x12'),_0x133cc7,_0xb285('0x13'));logger[_0xb285('0x14')](_0xb285('0x15'),_0x133cc7,_0xb285('0x13'),JSON[_0xb285('0x16')](_0x46ef65));if(_0x46ef65[_0xb285('0x17')]){if(_0x46ef65['error']['code']===0x1f4){logger[_0xb285('0x17')](_0xb285('0x12'),_0x133cc7,_0x46ef65[_0xb285('0x17')][_0xb285('0x18')]);return _0x3d2a2b(_0x46ef65['error'][_0xb285('0x18')]);}logger[_0xb285('0x17')](_0xb285('0x12'),_0x133cc7,_0x46ef65[_0xb285('0x17')]['message']);return _0x4e5976(_0x46ef65[_0xb285('0x17')]['message']);}else{logger[_0xb285('0x11')](_0xb285('0x12'),_0x133cc7,_0xb285('0x13'));_0x4e5976(_0x46ef65['result'][_0xb285('0x18')]);}})[_0xb285('0x19')](function(_0x99b1e6){logger[_0xb285('0x17')](_0xb285('0x12'),_0x133cc7,_0x99b1e6);_0x3d2a2b(_0x99b1e6);});});}exports[_0xb285('0x1a')]=function(_0x17ad6f){var _0x378069=this;return new Promise(function(_0x402822,_0x5d77cb){return db[_0xb285('0x1b')][_0xb285('0x1c')]({'raw':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')]['where']||null:null,'attributes':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')]['attributes']||null:null,'limit':_0x17ad6f['options']?_0x17ad6f[_0xb285('0x1d')][_0xb285('0x1e')]||null:null,'include':_0x17ad6f[_0xb285('0x1d')]?_0x17ad6f[_0xb285('0x1d')][_0xb285('0x1f')]?_[_0xb285('0x20')](_0x17ad6f[_0xb285('0x1d')][_0xb285('0x1f')],function(_0x8d9a16){return{'model':db[_0x8d9a16[_0xb285('0x21')]],'as':_0x8d9a16['as'],'attributes':_0x8d9a16[_0xb285('0x22')],'include':_0x8d9a16['include']?_[_0xb285('0x20')](_0x8d9a16[_0xb285('0x1f')],function(_0x56c81f){return{'model':db[_0x56c81f[_0xb285('0x21')]],'as':_0x56c81f['as'],'attributes':_0x56c81f['attributes'],'include':_0x56c81f[_0xb285('0x1f')]?_[_0xb285('0x20')](_0x56c81f[_0xb285('0x1f')],function(_0x4377aa){return{'model':db[_0x4377aa[_0xb285('0x21')]],'as':_0x4377aa['as'],'attributes':_0x4377aa[_0xb285('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb285('0x10')](function(_0x4a4408){logger[_0xb285('0x11')]('GetChatQueue',_0x17ad6f);logger[_0xb285('0x14')](_0xb285('0x1a'),_0x17ad6f,JSON[_0xb285('0x16')](_0x4a4408));_0x402822(_0x4a4408);})[_0xb285('0x19')](function(_0x3f7139){logger[_0xb285('0x17')](_0xb285('0x1a'),_0x3f7139['message'],_0x17ad6f);_0x5d77cb(_0x378069[_0xb285('0x17')](0x1f4,_0x3f7139[_0xb285('0x18')]));});});};exports[_0xb285('0x23')]=function(_0x2ece08){var _0x152e0d=this;return new Promise(function(_0x521837,_0x4ed2b5){return db[_0xb285('0x1b')][_0xb285('0x24')]({'raw':_0x2ece08[_0xb285('0x1d')]?_0x2ece08[_0xb285('0x1d')][_0xb285('0x25')]===undefined?!![]:![]:!![],'where':_0x2ece08[_0xb285('0x1d')]?_0x2ece08[_0xb285('0x1d')]['where']||null:null,'attributes':_0x2ece08[_0xb285('0x1d')]?_0x2ece08[_0xb285('0x1d')][_0xb285('0x22')]||null:null,'include':_0x2ece08[_0xb285('0x1d')]?_0x2ece08['options'][_0xb285('0x1f')]?_[_0xb285('0x20')](_0x2ece08[_0xb285('0x1d')][_0xb285('0x1f')],function(_0x2efbaf){return{'model':db[_0x2efbaf[_0xb285('0x21')]],'as':_0x2efbaf['as'],'attributes':_0x2efbaf['attributes'],'include':_0x2efbaf[_0xb285('0x1f')]?_[_0xb285('0x20')](_0x2efbaf['include'],function(_0x420fa8){return{'model':db[_0x420fa8[_0xb285('0x21')]],'as':_0x420fa8['as'],'attributes':_0x420fa8['attributes'],'include':_0x420fa8[_0xb285('0x1f')]?_[_0xb285('0x20')](_0x420fa8['include'],function(_0x14ef0d){return{'model':db[_0x14ef0d[_0xb285('0x21')]],'as':_0x14ef0d['as'],'attributes':_0x14ef0d[_0xb285('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb285('0x10')](function(_0x1afa35){logger[_0xb285('0x11')](_0xb285('0x23'),_0x2ece08);logger[_0xb285('0x14')](_0xb285('0x23'),_0x2ece08,JSON['stringify'](_0x1afa35));_0x521837(_0x1afa35);})[_0xb285('0x19')](function(_0x2346f4){logger[_0xb285('0x17')](_0xb285('0x23'),_0x2346f4[_0xb285('0x18')],_0x2ece08);_0x4ed2b5(_0x152e0d[_0xb285('0x17')](0x1f4,_0x2346f4['message']));});});};
\ No newline at end of file
+var _0x30d6=['ChatQueue','options','raw','attributes','limit','map','include','model','GetChatQueue','stringify','ShowChatQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x5802bb,_0x4bef35){var _0x4b02b7=function(_0x3502a1){while(--_0x3502a1){_0x5802bb['push'](_0x5802bb['shift']());}};_0x4b02b7(++_0x4bef35);}(_0x30d6,0x1b0));var _0x630d=function(_0x3ee5df,_0x583073){_0x3ee5df=_0x3ee5df-0x0;var _0x446d24=_0x30d6[_0x3ee5df];return _0x446d24;};'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});config[_0x630d('0x9')]=_[_0x630d('0xa')](config[_0x630d('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x630d('0x9')]));require(_0x630d('0xb'))[_0x630d('0xc')](socket);function respondWithRpcPromise(_0x382760,_0x4d4f13,_0xc5bc63){return new BPromise(function(_0x43ea98,_0x2f88fb){return client[_0x630d('0xd')](_0x382760,_0xc5bc63)[_0x630d('0xe')](function(_0x4294d0){logger[_0x630d('0xf')](_0x630d('0x10'),_0x4d4f13,_0x630d('0x11'));logger[_0x630d('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'),JSON['stringify'](_0x4294d0));if(_0x4294d0[_0x630d('0x13')]){if(_0x4294d0[_0x630d('0x13')]['code']===0x1f4){logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);return _0x2f88fb(_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);}logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0['error'][_0x630d('0x14')]);return _0x43ea98(_0x4294d0['error'][_0x630d('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'));_0x43ea98(_0x4294d0[_0x630d('0x15')]['message']);}})[_0x630d('0x16')](function(_0x18e685){logger['error'](_0x630d('0x10'),_0x4d4f13,_0x18e685);_0x2f88fb(_0x18e685);});});}exports['GetChatQueue']=function(_0x4df27f){var _0x456b07=this;return new Promise(function(_0x53498b,_0x2d960f){return db[_0x630d('0x17')]['findAll']({'raw':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x4df27f[_0x630d('0x18')]?_0x4df27f['options']['where']||null:null,'attributes':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'limit':_0x4df27f['options']?_0x4df27f[_0x630d('0x18')][_0x630d('0x1b')]||null:null,'include':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')]['include']?_[_0x630d('0x1c')](_0x4df27f[_0x630d('0x18')][_0x630d('0x1d')],function(_0x2ba2c9){return{'model':db[_0x2ba2c9[_0x630d('0x1e')]],'as':_0x2ba2c9['as'],'attributes':_0x2ba2c9[_0x630d('0x1a')],'include':_0x2ba2c9[_0x630d('0x1d')]?_['map'](_0x2ba2c9[_0x630d('0x1d')],function(_0x5c5d36){return{'model':db[_0x5c5d36[_0x630d('0x1e')]],'as':_0x5c5d36['as'],'attributes':_0x5c5d36['attributes'],'include':_0x5c5d36['include']?_[_0x630d('0x1c')](_0x5c5d36[_0x630d('0x1d')],function(_0x3d62dd){return{'model':db[_0x3d62dd['model']],'as':_0x3d62dd['as'],'attributes':_0x3d62dd[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bed85){logger[_0x630d('0xf')](_0x630d('0x1f'),_0x4df27f);logger[_0x630d('0x12')](_0x630d('0x1f'),_0x4df27f,JSON[_0x630d('0x20')](_0x2bed85));_0x53498b(_0x2bed85);})[_0x630d('0x16')](function(_0x2d6d26){logger[_0x630d('0x13')](_0x630d('0x1f'),_0x2d6d26['message'],_0x4df27f);_0x2d960f(_0x456b07[_0x630d('0x13')](0x1f4,_0x2d6d26[_0x630d('0x14')]));});});};exports[_0x630d('0x21')]=function(_0x789005){var _0x25cf85=this;return new Promise(function(_0x18c8a2,_0x58e392){return db[_0x630d('0x17')][_0x630d('0x22')]({'raw':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x789005['options']?_0x789005[_0x630d('0x18')]['where']||null:null,'attributes':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'include':_0x789005[_0x630d('0x18')]?_0x789005['options'][_0x630d('0x1d')]?_['map'](_0x789005[_0x630d('0x18')][_0x630d('0x1d')],function(_0x63c194){return{'model':db[_0x63c194[_0x630d('0x1e')]],'as':_0x63c194['as'],'attributes':_0x63c194['attributes'],'include':_0x63c194[_0x630d('0x1d')]?_[_0x630d('0x1c')](_0x63c194['include'],function(_0xa10a79){return{'model':db[_0xa10a79[_0x630d('0x1e')]],'as':_0xa10a79['as'],'attributes':_0xa10a79[_0x630d('0x1a')],'include':_0xa10a79['include']?_[_0x630d('0x1c')](_0xa10a79[_0x630d('0x1d')],function(_0x22ae2c){return{'model':db[_0x22ae2c['model']],'as':_0x22ae2c['as'],'attributes':_0x22ae2c[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x630d('0xe')](function(_0x598a60){logger[_0x630d('0xf')](_0x630d('0x21'),_0x789005);logger[_0x630d('0x12')](_0x630d('0x21'),_0x789005,JSON[_0x630d('0x20')](_0x598a60));_0x18c8a2(_0x598a60);})[_0x630d('0x16')](function(_0x4609ce){logger[_0x630d('0x13')](_0x630d('0x21'),_0x4609ce['message'],_0x789005);_0x58e392(_0x25cf85[_0x630d('0x13')](0x1f4,_0x4609ce['message']));});});};
\ No newline at end of file
index 1b87555..87a39a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524a=['./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x2917cf,_0x223521){var _0xb1335b=function(_0x313d36){while(--_0x313d36){_0x2917cf['push'](_0x2917cf['shift']());}};_0xb1335b(++_0x223521);}(_0x524a,0xf5));var _0xa524=function(_0x520502,_0x4a38cb){_0x520502=_0x520502-0x0;var _0x216ce7=_0x524a[_0x520502];return _0x216ce7;};'use strict';var ChatQueueEvents=require(_0xa524('0x0'));var events=[_0xa524('0x1'),_0xa524('0x2'),_0xa524('0x3')];function createListener(_0x53c48c,_0x4a29b7){return function(_0x2ef77c){_0x4a29b7[_0xa524('0x4')](_0x53c48c,_0x2ef77c);};}function removeListener(_0x56ab08,_0x50ec75){return function(){ChatQueueEvents[_0xa524('0x5')](_0x56ab08,_0x50ec75);};}exports[_0xa524('0x6')]=function(_0x16227b){for(var _0x5f472f=0x0,_0x460738=events['length'];_0x5f472f<_0x460738;_0x5f472f++){var _0x3a2dd6=events[_0x5f472f];var _0x11aa98=createListener('chatQueue:'+_0x3a2dd6,_0x16227b);ChatQueueEvents['on'](_0x3a2dd6,_0x11aa98);}};
\ No newline at end of file
+var _0xe13a=['update','emit','removeListener','register','chatQueue:','save','remove'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0xe13a,0x178));var _0xae13=function(_0x859e7b,_0x560c8a){_0x859e7b=_0x859e7b-0x0;var _0xb9c8a8=_0xe13a[_0x859e7b];return _0xb9c8a8;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xae13('0x0'),_0xae13('0x1'),_0xae13('0x2')];function createListener(_0x6066c0,_0x4cf961){return function(_0x3aaf90){_0x4cf961[_0xae13('0x3')](_0x6066c0,_0x3aaf90);};}function removeListener(_0x3ebbfe,_0x10abd7){return function(){ChatQueueEvents[_0xae13('0x4')](_0x3ebbfe,_0x10abd7);};}exports[_0xae13('0x5')]=function(_0x412a07){for(var _0x3379ed=0x0,_0x341ba4=events['length'];_0x3379ed<_0x341ba4;_0x3379ed++){var _0x2f6d10=events[_0x3379ed];var _0x2b2e1f=createListener(_0xae13('0x6')+_0x2f6d10,_0x412a07);ChatQueueEvents['on'](_0x2f6d10,_0x2b2e1f);}};
\ No newline at end of file
index 46d14f0..e0f1c57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x560509,_0x4a1347){var _0xf9b114=function(_0x3b0fe3){while(--_0x3b0fe3){_0x560509['push'](_0x560509['shift']());}};_0xf9b114(++_0x4a1347);}(_0x814b,0x1a2));var _0xb814=function(_0x6465b0,_0x45653a){_0x6465b0=_0x6465b0-0x0;var _0x4884fe=_0x814b[_0x6465b0];return _0x4884fe;};'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
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x266494,_0x34269f){var _0x446c0d=function(_0x438258){while(--_0x438258){_0x266494['push'](_0x266494['shift']());}};_0x446c0d(++_0x34269f);}(_0xe14b,0x93));var _0xbe14=function(_0x13fe04,_0x261b1c){_0x13fe04=_0x13fe04-0x0;var _0x45867b=_0xe14b[_0x13fe04];return _0x45867b;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
index bc99a8b..b98935d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['exports','STRING','DATE','moment'];(function(_0x5bc17b,_0xf2a36f){var _0x10a5c0=function(_0x50a8da){while(--_0x50a8da){_0x5bc17b['push'](_0x5bc17b['shift']());}};_0x10a5c0(++_0xf2a36f);}(_0x31f0,0xb7));var _0x031f=function(_0x5db012,_0x156b6f){_0x5db012=_0x5db012-0x0;var _0x127ca8=_0x31f0[_0x5db012];return _0x127ca8;};'use strict';var moment=require(_0x031f('0x0'));var Sequelize=require('sequelize');module[_0x031f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x031f('0x2')]},'joinAt':{'type':Sequelize[_0x031f('0x3')]},'leaveAt':{'type':Sequelize[_0x031f('0x3')]},'acceptAt':{'type':Sequelize[_0x031f('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
+var _0xee26=['sequelize','exports','STRING','DATE'];(function(_0x5a685a,_0x14937e){var _0x19db1c=function(_0xa06c44){while(--_0xa06c44){_0x5a685a['push'](_0x5a685a['shift']());}};_0x19db1c(++_0x14937e);}(_0xee26,0x9c));var _0x6ee2=function(_0xef338e,_0x22256e){_0xef338e=_0xef338e-0x0;var _0x3a3dde=_0xee26[_0xef338e];return _0x3a3dde;};'use strict';var moment=require('moment');var Sequelize=require(_0x6ee2('0x0'));module[_0x6ee2('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6ee2('0x2')]},'joinAt':{'type':Sequelize[_0x6ee2('0x3')]},'leaveAt':{'type':Sequelize[_0x6ee2('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6ee2('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 91207c8..9e5a593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb67=['create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','ChatQueueReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','rawAttributes','find'];(function(_0x4b01b7,_0x183b04){var _0x2ed185=function(_0x4a1222){while(--_0x4a1222){_0x4b01b7['push'](_0x4b01b7['shift']());}};_0x2ed185(++_0x183b04);}(_0xfb67,0xdd));var _0x7fb6=function(_0x4abeab,_0x5e52b8){_0x4abeab=_0x4abeab-0x0;var _0x3d9932=_0xfb67[_0x4abeab];return _0x3d9932;};'use strict';var emlformat=require(_0x7fb6('0x0'));var rimraf=require(_0x7fb6('0x1'));var zipdir=require(_0x7fb6('0x2'));var jsonpatch=require(_0x7fb6('0x3'));var rp=require(_0x7fb6('0x4'));var moment=require(_0x7fb6('0x5'));var BPromise=require(_0x7fb6('0x6'));var Mustache=require('mustache');var util=require(_0x7fb6('0x7'));var path=require(_0x7fb6('0x8'));var sox=require(_0x7fb6('0x9'));var csv=require(_0x7fb6('0xa'));var ejs=require(_0x7fb6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fb6('0xc'));var squel=require(_0x7fb6('0xd'));var crypto=require(_0x7fb6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7fb6('0xf'));var toCsv=require(_0x7fb6('0xa'));var querystring=require('querystring');var Papa=require(_0x7fb6('0x10'));var Redis=require(_0x7fb6('0x11'));var authService=require(_0x7fb6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7fb6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fb6('0x14'))(_0x7fb6('0x15'));var utils=require(_0x7fb6('0x16'));var config=require(_0x7fb6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fb6('0x18'))['db'];function respondWithStatusCode(_0x1b6ac7,_0x3c594f){_0x3c594f=_0x3c594f||0xcc;return function(_0x549370){if(_0x549370){return _0x1b6ac7['sendStatus'](_0x3c594f);}return _0x1b6ac7['status'](_0x3c594f)['end']();};}function respondWithResult(_0x4fe18e,_0x59287e){_0x59287e=_0x59287e||0xc8;return function(_0x2e8b7c){if(_0x2e8b7c){return _0x4fe18e[_0x7fb6('0x19')](_0x59287e)['json'](_0x2e8b7c);}};}function respondWithFilteredResult(_0x196700,_0x3e4441){return function(_0x5046e2){if(_0x5046e2){var _0xb4c375=typeof _0x3e4441[_0x7fb6('0x1a')]===_0x7fb6('0x1b')&&typeof _0x3e4441[_0x7fb6('0x1c')]===_0x7fb6('0x1b');var _0x26c3ec=_0x5046e2[_0x7fb6('0x1d')];var _0x3ef701=_0xb4c375?0x0:_0x3e4441[_0x7fb6('0x1a')];var _0x5de506=_0xb4c375?_0x5046e2[_0x7fb6('0x1d')]:_0x3e4441[_0x7fb6('0x1a')]+_0x3e4441[_0x7fb6('0x1c')];var _0x169389;if(_0x5de506>=_0x26c3ec){_0x5de506=_0x26c3ec;_0x169389=0xc8;}else{_0x169389=0xce;}_0x196700[_0x7fb6('0x19')](_0x169389);return _0x196700[_0x7fb6('0x1e')](_0x7fb6('0x1f'),_0x3ef701+'-'+_0x5de506+'/'+_0x26c3ec)['json'](_0x5046e2);}return null;};}function patchUpdates(_0x5e6997){return function(_0x1fa63a){try{jsonpatch[_0x7fb6('0x20')](_0x1fa63a,_0x5e6997,!![]);}catch(_0x293c9d){return BPromise[_0x7fb6('0x21')](_0x293c9d);}return _0x1fa63a['save']();};}function saveUpdates(_0xc44cf5,_0x13ad95){return function(_0x490749){if(_0x490749){return _0x490749[_0x7fb6('0x22')](_0xc44cf5)['then'](function(_0x488cd2){return _0x488cd2;});}return null;};}function removeEntity(_0x34a4d1,_0x4b15e5){return function(_0x51ed55){if(_0x51ed55){return _0x51ed55['destroy']()[_0x7fb6('0x23')](function(){_0x34a4d1['status'](0xcc)[_0x7fb6('0x24')]();});}};}function handleEntityNotFound(_0x4a9866,_0x3566a1){return function(_0xc60290){if(!_0xc60290){_0x4a9866[_0x7fb6('0x25')](0x194);}return _0xc60290;};}function handleError(_0x260e8b,_0x253f23){_0x253f23=_0x253f23||0x1f4;return function(_0x4c9b90){logger[_0x7fb6('0x26')](_0x4c9b90['stack']);if(_0x4c9b90[_0x7fb6('0x27')]){delete _0x4c9b90[_0x7fb6('0x27')];}_0x260e8b['status'](_0x253f23)['send'](_0x4c9b90);};}exports['index']=function(_0x25216a,_0x440a04){var _0x35e18f={},_0x3bf606={},_0x7f3844={'count':0x0,'rows':[]};var _0x2bc3b9=_['map'](db[_0x7fb6('0x28')]['rawAttributes'],function(_0x4221c3){return{'name':_0x4221c3[_0x7fb6('0x29')],'type':_0x4221c3[_0x7fb6('0x2a')][_0x7fb6('0x2b')]};});_0x3bf606[_0x7fb6('0x2c')]=_[_0x7fb6('0x2d')](_0x2bc3b9,_0x7fb6('0x27'));_0x3bf606[_0x7fb6('0x2e')]=_[_0x7fb6('0x2f')](_0x25216a['query']);_0x3bf606[_0x7fb6('0x30')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],_0x3bf606[_0x7fb6('0x2e')]);_0x35e18f[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x3bf606[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x25216a[_0x7fb6('0x2e')]['fields']));_0x35e18f[_0x7fb6('0x32')]=_0x35e18f[_0x7fb6('0x32')][_0x7fb6('0x34')]?_0x35e18f[_0x7fb6('0x32')]:_0x3bf606['model'];if(!_0x25216a['query'][_0x7fb6('0x35')](_0x7fb6('0x36'))){_0x35e18f[_0x7fb6('0x1c')]=qs[_0x7fb6('0x1c')](_0x25216a[_0x7fb6('0x2e')]['limit']);_0x35e18f[_0x7fb6('0x1a')]=qs[_0x7fb6('0x1a')](_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x1a')]);}_0x35e18f['order']=qs[_0x7fb6('0x37')](_0x25216a[_0x7fb6('0x2e')]['sort']);_0x35e18f[_0x7fb6('0x38')]=qs['filters'](_[_0x7fb6('0x39')](_0x25216a['query'],_0x3bf606[_0x7fb6('0x30')]),_0x2bc3b9);if(_0x25216a['query'][_0x7fb6('0x3a')]){_0x35e18f[_0x7fb6('0x38')]=_[_0x7fb6('0x3b')](_0x35e18f[_0x7fb6('0x38')],{'$or':_[_0x7fb6('0x2d')](_0x2bc3b9,function(_0x39edfe){if(_0x39edfe['type']!=='VIRTUAL'){var _0x5d237={};_0x5d237[_0x39edfe[_0x7fb6('0x27')]]={'$like':'%'+_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3a')]+'%'};return _0x5d237;}})});}_0x35e18f=_['merge']({},_0x35e18f,_0x25216a['options']);var _0x213e6a={'where':_0x35e18f['where']};return db[_0x7fb6('0x28')][_0x7fb6('0x1d')](_0x213e6a)[_0x7fb6('0x23')](function(_0x33828c){_0x7f3844[_0x7fb6('0x1d')]=_0x33828c;if(_0x25216a[_0x7fb6('0x2e')][_0x7fb6('0x3c')]){_0x35e18f[_0x7fb6('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x35e18f);})[_0x7fb6('0x23')](function(_0x543de3){_0x7f3844[_0x7fb6('0x3e')]=_0x543de3;return _0x7f3844;})[_0x7fb6('0x23')](respondWithFilteredResult(_0x440a04,_0x35e18f))[_0x7fb6('0x3f')](handleError(_0x440a04,null));};exports[_0x7fb6('0x40')]=function(_0x6fa286,_0x3b77ba){var _0x1dbfb8={'raw':!![],'where':{'id':_0x6fa286['params']['id']}},_0x661d04={};_0x661d04['model']=_[_0x7fb6('0x2f')](db['ChatQueueReport'][_0x7fb6('0x41')]);_0x661d04['query']=_[_0x7fb6('0x2f')](_0x6fa286[_0x7fb6('0x2e')]);_0x661d04['filters']=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],_0x661d04[_0x7fb6('0x2e')]);_0x1dbfb8[_0x7fb6('0x32')]=_[_0x7fb6('0x31')](_0x661d04[_0x7fb6('0x2c')],qs[_0x7fb6('0x33')](_0x6fa286[_0x7fb6('0x2e')][_0x7fb6('0x33')]));_0x1dbfb8['attributes']=_0x1dbfb8[_0x7fb6('0x32')]['length']?_0x1dbfb8[_0x7fb6('0x32')]:_0x661d04[_0x7fb6('0x2c')];if(_0x6fa286['query'][_0x7fb6('0x3c')]){_0x1dbfb8[_0x7fb6('0x3d')]=[{'all':!![]}];}_0x1dbfb8=_[_0x7fb6('0x3b')]({},_0x1dbfb8,_0x6fa286['options']);return db[_0x7fb6('0x28')][_0x7fb6('0x42')](_0x1dbfb8)[_0x7fb6('0x23')](handleEntityNotFound(_0x3b77ba,null))[_0x7fb6('0x23')](respondWithResult(_0x3b77ba,null))[_0x7fb6('0x3f')](handleError(_0x3b77ba,null));};exports[_0x7fb6('0x43')]=function(_0x363564,_0x4eac42){return db[_0x7fb6('0x28')][_0x7fb6('0x43')](_0x363564['body'],{})[_0x7fb6('0x23')](respondWithResult(_0x4eac42,0xc9))['catch'](handleError(_0x4eac42,null));};exports[_0x7fb6('0x22')]=function(_0x597eac,_0x2fb8f0){if(_0x597eac['body']['id']){delete _0x597eac[_0x7fb6('0x44')]['id'];}return db[_0x7fb6('0x28')]['find']({'where':{'id':_0x597eac[_0x7fb6('0x45')]['id']}})[_0x7fb6('0x23')](handleEntityNotFound(_0x2fb8f0,null))[_0x7fb6('0x23')](saveUpdates(_0x597eac[_0x7fb6('0x44')],null))[_0x7fb6('0x23')](respondWithResult(_0x2fb8f0,null))[_0x7fb6('0x3f')](handleError(_0x2fb8f0,null));};exports[_0x7fb6('0x46')]=function(_0x164bfd,_0x14993f){return db[_0x7fb6('0x28')][_0x7fb6('0x42')]({'where':{'id':_0x164bfd[_0x7fb6('0x45')]['id']}})['then'](handleEntityNotFound(_0x14993f,null))['then'](removeEntity(_0x14993f,null))[_0x7fb6('0x3f')](handleError(_0x14993f,null));};exports['describe']=function(_0x340a96,_0x18aa5f){return db[_0x7fb6('0x28')][_0x7fb6('0x47')]()['then'](respondWithResult(_0x18aa5f,null))[_0x7fb6('0x3f')](handleError(_0x18aa5f,null));};
\ No newline at end of file
+var _0x46cb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x46cb,0x84));var _0xb46c=function(_0x1d5a32,_0x47974a){_0x1d5a32=_0x1d5a32-0x0;var _0x361ca0=_0x46cb[_0x1d5a32];return _0x361ca0;};'use strict';var emlformat=require(_0xb46c('0x0'));var rimraf=require(_0xb46c('0x1'));var zipdir=require(_0xb46c('0x2'));var jsonpatch=require(_0xb46c('0x3'));var rp=require('request-promise');var moment=require(_0xb46c('0x4'));var BPromise=require(_0xb46c('0x5'));var Mustache=require(_0xb46c('0x6'));var util=require(_0xb46c('0x7'));var path=require('path');var sox=require(_0xb46c('0x8'));var csv=require(_0xb46c('0x9'));var ejs=require(_0xb46c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb46c('0xb'));var squel=require('squel');var crypto=require(_0xb46c('0xc'));var jsforce=require(_0xb46c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb46c('0xe'));var Papa=require(_0xb46c('0xf'));var Redis=require(_0xb46c('0x10'));var authService=require(_0xb46c('0x11'));var qs=require(_0xb46c('0x12'));var as=require(_0xb46c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb46c('0x14'))(_0xb46c('0x15'));var utils=require(_0xb46c('0x16'));var config=require(_0xb46c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb46c('0x18'))['db'];function respondWithStatusCode(_0x3059da,_0x1dd251){_0x1dd251=_0x1dd251||0xcc;return function(_0x4a3399){if(_0x4a3399){return _0x3059da[_0xb46c('0x19')](_0x1dd251);}return _0x3059da[_0xb46c('0x1a')](_0x1dd251)['end']();};}function respondWithResult(_0x18f1d0,_0x213f4a){_0x213f4a=_0x213f4a||0xc8;return function(_0x967278){if(_0x967278){return _0x18f1d0[_0xb46c('0x1a')](_0x213f4a)[_0xb46c('0x1b')](_0x967278);}};}function respondWithFilteredResult(_0x45c3e1,_0x172bb8){return function(_0x5d431b){if(_0x5d431b){var _0xe4261a=typeof _0x172bb8[_0xb46c('0x1c')]===_0xb46c('0x1d')&&typeof _0x172bb8[_0xb46c('0x1e')]===_0xb46c('0x1d');var _0x2437a0=_0x5d431b['count'];var _0x572860=_0xe4261a?0x0:_0x172bb8[_0xb46c('0x1c')];var _0x4c7ef6=_0xe4261a?_0x5d431b[_0xb46c('0x1f')]:_0x172bb8[_0xb46c('0x1c')]+_0x172bb8[_0xb46c('0x1e')];var _0x32ade3;if(_0x4c7ef6>=_0x2437a0){_0x4c7ef6=_0x2437a0;_0x32ade3=0xc8;}else{_0x32ade3=0xce;}_0x45c3e1['status'](_0x32ade3);return _0x45c3e1[_0xb46c('0x20')]('Content-Range',_0x572860+'-'+_0x4c7ef6+'/'+_0x2437a0)['json'](_0x5d431b);}return null;};}function patchUpdates(_0x87d31d){return function(_0x1b8c8d){try{jsonpatch[_0xb46c('0x21')](_0x1b8c8d,_0x87d31d,!![]);}catch(_0x43ae7c){return BPromise[_0xb46c('0x22')](_0x43ae7c);}return _0x1b8c8d[_0xb46c('0x23')]();};}function saveUpdates(_0x5f3cfb,_0x4d68b1){return function(_0x184038){if(_0x184038){return _0x184038[_0xb46c('0x24')](_0x5f3cfb)[_0xb46c('0x25')](function(_0x11b121){return _0x11b121;});}return null;};}function removeEntity(_0x1e40ed,_0x2b4412){return function(_0x8d71cd){if(_0x8d71cd){return _0x8d71cd['destroy']()[_0xb46c('0x25')](function(){_0x1e40ed[_0xb46c('0x1a')](0xcc)[_0xb46c('0x26')]();});}};}function handleEntityNotFound(_0x47960b,_0x4e822a){return function(_0x20fc36){if(!_0x20fc36){_0x47960b[_0xb46c('0x19')](0x194);}return _0x20fc36;};}function handleError(_0x3ff2a6,_0x2585c6){_0x2585c6=_0x2585c6||0x1f4;return function(_0x463a71){logger[_0xb46c('0x27')](_0x463a71[_0xb46c('0x28')]);if(_0x463a71[_0xb46c('0x29')]){delete _0x463a71[_0xb46c('0x29')];}_0x3ff2a6[_0xb46c('0x1a')](_0x2585c6)[_0xb46c('0x2a')](_0x463a71);};}exports[_0xb46c('0x2b')]=function(_0x4220a9,_0x2c8956){var _0x3cd6e0={},_0x3fab04={},_0x56310b={'count':0x0,'rows':[]};var _0x2412a7=_['map'](db[_0xb46c('0x2c')]['rawAttributes'],function(_0x4dd0bd){return{'name':_0x4dd0bd[_0xb46c('0x2d')],'type':_0x4dd0bd[_0xb46c('0x2e')][_0xb46c('0x2f')]};});_0x3fab04[_0xb46c('0x30')]=_['map'](_0x2412a7,_0xb46c('0x29'));_0x3fab04[_0xb46c('0x31')]=_[_0xb46c('0x32')](_0x4220a9['query']);_0x3fab04[_0xb46c('0x33')]=_['intersection'](_0x3fab04[_0xb46c('0x30')],_0x3fab04['query']);_0x3cd6e0[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x3fab04[_0xb46c('0x30')],qs[_0xb46c('0x36')](_0x4220a9[_0xb46c('0x31')][_0xb46c('0x36')]));_0x3cd6e0[_0xb46c('0x34')]=_0x3cd6e0[_0xb46c('0x34')][_0xb46c('0x37')]?_0x3cd6e0[_0xb46c('0x34')]:_0x3fab04[_0xb46c('0x30')];if(!_0x4220a9[_0xb46c('0x31')]['hasOwnProperty'](_0xb46c('0x38'))){_0x3cd6e0[_0xb46c('0x1e')]=qs['limit'](_0x4220a9['query']['limit']);_0x3cd6e0['offset']=qs[_0xb46c('0x1c')](_0x4220a9['query'][_0xb46c('0x1c')]);}_0x3cd6e0[_0xb46c('0x39')]=qs[_0xb46c('0x3a')](_0x4220a9[_0xb46c('0x31')]['sort']);_0x3cd6e0[_0xb46c('0x3b')]=qs[_0xb46c('0x33')](_['pick'](_0x4220a9[_0xb46c('0x31')],_0x3fab04[_0xb46c('0x33')]),_0x2412a7);if(_0x4220a9['query'][_0xb46c('0x3c')]){_0x3cd6e0['where']=_[_0xb46c('0x3d')](_0x3cd6e0[_0xb46c('0x3b')],{'$or':_[_0xb46c('0x3e')](_0x2412a7,function(_0x302580){if(_0x302580['type']!==_0xb46c('0x3f')){var _0x4c9db1={};_0x4c9db1[_0x302580[_0xb46c('0x29')]]={'$like':'%'+_0x4220a9[_0xb46c('0x31')]['filter']+'%'};return _0x4c9db1;}})});}_0x3cd6e0=_[_0xb46c('0x3d')]({},_0x3cd6e0,_0x4220a9[_0xb46c('0x40')]);var _0xfa2a48={'where':_0x3cd6e0['where']};return db['ChatQueueReport'][_0xb46c('0x1f')](_0xfa2a48)[_0xb46c('0x25')](function(_0x4e4169){_0x56310b[_0xb46c('0x1f')]=_0x4e4169;if(_0x4220a9['query'][_0xb46c('0x41')]){_0x3cd6e0[_0xb46c('0x42')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x3cd6e0);})[_0xb46c('0x25')](function(_0x1c38fe){_0x56310b[_0xb46c('0x43')]=_0x1c38fe;return _0x56310b;})[_0xb46c('0x25')](respondWithFilteredResult(_0x2c8956,_0x3cd6e0))[_0xb46c('0x44')](handleError(_0x2c8956,null));};exports['show']=function(_0x1b9af7,_0x7e15f3){var _0x4fd0d9={'raw':!![],'where':{'id':_0x1b9af7['params']['id']}},_0x20d2e5={};_0x20d2e5[_0xb46c('0x30')]=_[_0xb46c('0x32')](db[_0xb46c('0x2c')]['rawAttributes']);_0x20d2e5[_0xb46c('0x31')]=_['keys'](_0x1b9af7[_0xb46c('0x31')]);_0x20d2e5[_0xb46c('0x33')]=_[_0xb46c('0x35')](_0x20d2e5[_0xb46c('0x30')],_0x20d2e5[_0xb46c('0x31')]);_0x4fd0d9[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x20d2e5['model'],qs[_0xb46c('0x36')](_0x1b9af7['query'][_0xb46c('0x36')]));_0x4fd0d9[_0xb46c('0x34')]=_0x4fd0d9['attributes'][_0xb46c('0x37')]?_0x4fd0d9[_0xb46c('0x34')]:_0x20d2e5[_0xb46c('0x30')];if(_0x1b9af7['query']['includeAll']){_0x4fd0d9['include']=[{'all':!![]}];}_0x4fd0d9=_['merge']({},_0x4fd0d9,_0x1b9af7['options']);return db[_0xb46c('0x2c')][_0xb46c('0x45')](_0x4fd0d9)[_0xb46c('0x25')](handleEntityNotFound(_0x7e15f3,null))[_0xb46c('0x25')](respondWithResult(_0x7e15f3,null))[_0xb46c('0x44')](handleError(_0x7e15f3,null));};exports[_0xb46c('0x46')]=function(_0x40ca97,_0x44b792){return db[_0xb46c('0x2c')][_0xb46c('0x46')](_0x40ca97['body'],{})[_0xb46c('0x25')](respondWithResult(_0x44b792,0xc9))[_0xb46c('0x44')](handleError(_0x44b792,null));};exports['update']=function(_0x4db28a,_0x63d0d6){if(_0x4db28a['body']['id']){delete _0x4db28a[_0xb46c('0x47')]['id'];}return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x4db28a[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x63d0d6,null))[_0xb46c('0x25')](saveUpdates(_0x4db28a[_0xb46c('0x47')],null))[_0xb46c('0x25')](respondWithResult(_0x63d0d6,null))[_0xb46c('0x44')](handleError(_0x63d0d6,null));};exports['destroy']=function(_0x1e0ffe,_0x841649){return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x1e0ffe[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x841649,null))[_0xb46c('0x25')](removeEntity(_0x841649,null))[_0xb46c('0x44')](handleError(_0x841649,null));};exports[_0xb46c('0x49')]=function(_0xa6800d,_0x191054){return db['ChatQueueReport'][_0xb46c('0x49')]()[_0xb46c('0x25')](respondWithResult(_0x191054,null))['catch'](handleError(_0x191054,null));};
\ No newline at end of file
index 2e22b2b..c60a4a3 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(_0x263b35,_0x421508){var _0x48168e=function(_0x3bb3a6){while(--_0x3bb3a6){_0x263b35['push'](_0x263b35['shift']());}};_0x48168e(++_0x421508);}(_0xb10b,0x12a));var _0xbb10=function(_0x19754a,_0x3050aa){_0x19754a=_0x19754a-0x0;var _0x4f8f3f=_0xb10b[_0x19754a];return _0x4f8f3f;};'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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x435b13,_0x43f5b9){var _0x1309a3=function(_0xfe6e8a){while(--_0xfe6e8a){_0x435b13['push'](_0x435b13['shift']());}};_0x1309a3(++_0x43f5b9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xcb91[_0x44a64f];return _0x52024b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 4fdf773..1b69600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa935=['ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','ChatQueueReport,\x20%s,\x20%s','error','message','info','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','then','update','attributes','limit','UpdateChatQueueReport','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','request\x20sent','debug'];(function(_0x4d4fb3,_0x5b34bd){var _0x1c6a7c=function(_0x4ad730){while(--_0x4ad730){_0x4d4fb3['push'](_0x4d4fb3['shift']());}};_0x1c6a7c(++_0x5b34bd);}(_0xa935,0x13e));var _0x5a93=function(_0x14ddd4,_0x5b527d){_0x14ddd4=_0x14ddd4-0x0;var _0x421616=_0xa935[_0x14ddd4];return _0x421616;};'use strict';var _=require('lodash');var util=require(_0x5a93('0x0'));var moment=require(_0x5a93('0x1'));var BPromise=require(_0x5a93('0x2'));var rs=require(_0x5a93('0x3'));var fs=require('fs');var Redis=require(_0x5a93('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a93('0x5'));var config=require(_0x5a93('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5a93('0x7')][_0x5a93('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8c237b,_0x42ef93,_0x5a9803){return new BPromise(function(_0x4ee1c9,_0x44006c){return client[_0x5a93('0x9')](_0x8c237b,_0x5a9803)['then'](function(_0x2b8c9a){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x42ef93,_0x5a93('0xa'));logger[_0x5a93('0xb')](_0x5a93('0xc'),_0x42ef93,_0x5a93('0xa'),JSON[_0x5a93('0xd')](_0x2b8c9a));if(_0x2b8c9a['error']){if(_0x2b8c9a['error'][_0x5a93('0xe')]===0x1f4){logger['error'](_0x5a93('0xf'),_0x42ef93,_0x2b8c9a[_0x5a93('0x10')][_0x5a93('0x11')]);return _0x44006c(_0x2b8c9a['error'][_0x5a93('0x11')]);}logger[_0x5a93('0x10')](_0x5a93('0xf'),_0x42ef93,_0x2b8c9a[_0x5a93('0x10')][_0x5a93('0x11')]);return _0x4ee1c9(_0x2b8c9a[_0x5a93('0x10')][_0x5a93('0x11')]);}else{logger[_0x5a93('0x12')](_0x5a93('0xf'),_0x42ef93,_0x5a93('0xa'));_0x4ee1c9(_0x2b8c9a['result'][_0x5a93('0x11')]);}})[_0x5a93('0x13')](function(_0x290c86){logger[_0x5a93('0x10')](_0x5a93('0xf'),_0x42ef93,_0x290c86);_0x44006c(_0x290c86);});});}exports[_0x5a93('0x14')]=function(_0x36bca7){var _0x52204f=this;return new Promise(function(_0x48ccb0,_0x38a969){return db[_0x5a93('0x15')]['create'](_0x36bca7[_0x5a93('0x16')],{'raw':_0x36bca7['options']?_0x36bca7[_0x5a93('0x17')][_0x5a93('0x18')]===undefined?!![]:![]:!![]})[_0x5a93('0x19')](function(_0x58fa83){logger[_0x5a93('0x12')](_0x5a93('0x14'),_0x36bca7);logger['debug'](_0x5a93('0x14'),_0x36bca7,JSON['stringify'](_0x58fa83));_0x48ccb0(_0x58fa83);})['catch'](function(_0x3c8090){logger['error'](_0x5a93('0x14'),_0x3c8090[_0x5a93('0x11')],_0x36bca7);_0x38a969(_0x52204f['error'](0x1f4,_0x3c8090['message']));});});};exports['UpdateChatQueueReport']=function(_0x1ffdc0){var _0x3d4b0e=this;return new Promise(function(_0x2277e0,_0x53ce2d){return db[_0x5a93('0x15')][_0x5a93('0x1a')](_0x1ffdc0[_0x5a93('0x16')],{'raw':_0x1ffdc0[_0x5a93('0x17')]?_0x1ffdc0['options'][_0x5a93('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ffdc0['options']?_0x1ffdc0[_0x5a93('0x17')]['where']||null:null,'attributes':_0x1ffdc0[_0x5a93('0x17')]?_0x1ffdc0[_0x5a93('0x17')][_0x5a93('0x1b')]||null:null,'limit':_0x1ffdc0[_0x5a93('0x17')]?_0x1ffdc0[_0x5a93('0x17')][_0x5a93('0x1c')]||null:null})[_0x5a93('0x19')](function(_0x54bf8d){logger[_0x5a93('0x12')]('UpdateChatQueueReport',_0x1ffdc0);logger[_0x5a93('0xb')](_0x5a93('0x1d'),_0x1ffdc0,JSON[_0x5a93('0xd')](_0x54bf8d));_0x2277e0(_0x54bf8d);})[_0x5a93('0x13')](function(_0x58229a){logger[_0x5a93('0x10')](_0x5a93('0x1d'),_0x58229a[_0x5a93('0x11')],_0x1ffdc0);_0x53ce2d(_0x3d4b0e[_0x5a93('0x10')](0x1f4,_0x58229a[_0x5a93('0x11')]));});});};
\ No newline at end of file
+var _0x0cce=['message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','update','body','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c81c2,_0x3e18a2){var _0x16a5a4=function(_0x3d60ec){while(--_0x3d60ec){_0x5c81c2['push'](_0x5c81c2['shift']());}};_0x16a5a4(++_0x3e18a2);}(_0x0cce,0xf6));var _0xe0cc=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0x0cce[_0x3e0dc4];return _0x586111;};'use strict';var _=require(_0xe0cc('0x0'));var util=require(_0xe0cc('0x1'));var moment=require(_0xe0cc('0x2'));var BPromise=require(_0xe0cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0cc('0x4'));var db=require(_0xe0cc('0x5'))['db'];var utils=require(_0xe0cc('0x6'));var logger=require('../../config/logger')(_0xe0cc('0x7'));var config=require(_0xe0cc('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe0cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x437d77,_0x2c06bb,_0x2d0a0d){return new BPromise(function(_0x1354e6,_0x1a48ab){return client[_0xe0cc('0xa')](_0x437d77,_0x2d0a0d)[_0xe0cc('0xb')](function(_0x353b76){logger[_0xe0cc('0xc')](_0xe0cc('0xd'),_0x2c06bb,_0xe0cc('0xe'));logger['debug'](_0xe0cc('0xf'),_0x2c06bb,'request\x20sent',JSON[_0xe0cc('0x10')](_0x353b76));if(_0x353b76[_0xe0cc('0x11')]){if(_0x353b76[_0xe0cc('0x11')]['code']===0x1f4){logger[_0xe0cc('0x11')](_0xe0cc('0xd'),_0x2c06bb,_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);return _0x1a48ab(_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);}logger['error'](_0xe0cc('0xd'),_0x2c06bb,_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);return _0x1354e6(_0x353b76[_0xe0cc('0x11')][_0xe0cc('0x12')]);}else{logger['info'](_0xe0cc('0xd'),_0x2c06bb,_0xe0cc('0xe'));_0x1354e6(_0x353b76[_0xe0cc('0x13')][_0xe0cc('0x12')]);}})['catch'](function(_0x5708be){logger[_0xe0cc('0x11')](_0xe0cc('0xd'),_0x2c06bb,_0x5708be);_0x1a48ab(_0x5708be);});});}exports[_0xe0cc('0x14')]=function(_0x5777e3){var _0x2ea767=this;return new Promise(function(_0x585760,_0x1e2bf9){return db[_0xe0cc('0x15')][_0xe0cc('0x16')](_0x5777e3['body'],{'raw':_0x5777e3[_0xe0cc('0x17')]?_0x5777e3['options'][_0xe0cc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x597136){logger[_0xe0cc('0xc')](_0xe0cc('0x14'),_0x5777e3);logger['debug'](_0xe0cc('0x14'),_0x5777e3,JSON[_0xe0cc('0x10')](_0x597136));_0x585760(_0x597136);})[_0xe0cc('0x19')](function(_0x4aca44){logger[_0xe0cc('0x11')](_0xe0cc('0x14'),_0x4aca44[_0xe0cc('0x12')],_0x5777e3);_0x1e2bf9(_0x2ea767[_0xe0cc('0x11')](0x1f4,_0x4aca44['message']));});});};exports[_0xe0cc('0x1a')]=function(_0x1c45af){var _0x24c006=this;return new Promise(function(_0x5c9382,_0x28b7ac){return db[_0xe0cc('0x15')][_0xe0cc('0x1b')](_0x1c45af[_0xe0cc('0x1c')],{'raw':_0x1c45af[_0xe0cc('0x17')]?_0x1c45af[_0xe0cc('0x17')][_0xe0cc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c45af['options']?_0x1c45af['options'][_0xe0cc('0x1d')]||null:null,'attributes':_0x1c45af[_0xe0cc('0x17')]?_0x1c45af[_0xe0cc('0x17')][_0xe0cc('0x1e')]||null:null,'limit':_0x1c45af[_0xe0cc('0x17')]?_0x1c45af[_0xe0cc('0x17')][_0xe0cc('0x1f')]||null:null})['then'](function(_0x5ef449){logger[_0xe0cc('0xc')](_0xe0cc('0x1a'),_0x1c45af);logger[_0xe0cc('0x20')](_0xe0cc('0x1a'),_0x1c45af,JSON[_0xe0cc('0x10')](_0x5ef449));_0x5c9382(_0x5ef449);})['catch'](function(_0x2b8aa9){logger[_0xe0cc('0x11')]('UpdateChatQueueReport',_0x2b8aa9[_0xe0cc('0x12')],_0x1c45af);_0x28b7ac(_0x24c006[_0xe0cc('0x11')](0x1f4,_0x2b8aa9[_0xe0cc('0x12')]));});});};
\ No newline at end of file
index de0711e..4300b84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59ec=['/:id','show','post','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe'];(function(_0x1f016c,_0x418c4c){var _0x4f6c97=function(_0x35e128){while(--_0x35e128){_0x1f016c['push'](_0x1f016c['shift']());}};_0x4f6c97(++_0x418c4c);}(_0x59ec,0x110));var _0xc59e=function(_0x3f444e,_0x3400b1){_0x3f444e=_0x3f444e-0x0;var _0xd20cb6=_0x59ec[_0x3f444e];return _0xd20cb6;};'use strict';var multer=require(_0xc59e('0x0'));var util=require(_0xc59e('0x1'));var path=require(_0xc59e('0x2'));var timeout=require('connect-timeout');var express=require(_0xc59e('0x3'));var router=express['Router']();var fs_extra=require(_0xc59e('0x4'));var auth=require(_0xc59e('0x5'));var interaction=require(_0xc59e('0x6'));var config=require(_0xc59e('0x7'));var controller=require(_0xc59e('0x8'));router[_0xc59e('0x9')]('/',auth[_0xc59e('0xa')](),controller[_0xc59e('0xb')]);router[_0xc59e('0x9')]('/describe',auth[_0xc59e('0xa')](),controller[_0xc59e('0xc')]);router[_0xc59e('0x9')](_0xc59e('0xd'),auth[_0xc59e('0xa')](),controller[_0xc59e('0xe')]);router[_0xc59e('0xf')]('/',auth[_0xc59e('0xa')](),controller['create']);router[_0xc59e('0x10')](_0xc59e('0xd'),auth[_0xc59e('0xa')](),controller[_0xc59e('0x11')]);router[_0xc59e('0x12')]('/:id',auth[_0xc59e('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc5df=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','multer'];(function(_0x32dce6,_0x23f570){var _0x1191ba=function(_0x58efa8){while(--_0x58efa8){_0x32dce6['push'](_0x32dce6['shift']());}};_0x1191ba(++_0x23f570);}(_0xc5df,0x143));var _0xfc5d=function(_0x2d0b33,_0x13b6d3){_0x2d0b33=_0x2d0b33-0x0;var _0x5ceb77=_0xc5df[_0x2d0b33];return _0x5ceb77;};'use strict';var multer=require(_0xfc5d('0x0'));var util=require(_0xfc5d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfc5d('0x2'));var router=express[_0xfc5d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfc5d('0x4'));var interaction=require(_0xfc5d('0x5'));var config=require(_0xfc5d('0x6'));var controller=require(_0xfc5d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xfc5d('0x8')]);router['get'](_0xfc5d('0x9'),auth[_0xfc5d('0xa')](),controller[_0xfc5d('0xb')]);router['get'](_0xfc5d('0xc'),auth[_0xfc5d('0xa')](),controller[_0xfc5d('0xd')]);router[_0xfc5d('0xe')]('/',auth[_0xfc5d('0xa')](),controller[_0xfc5d('0xf')]);router['put'](_0xfc5d('0xc'),auth[_0xfc5d('0xa')](),controller[_0xfc5d('0x10')]);router[_0xfc5d('0x11')](_0xfc5d('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index f2a78ab..253c1f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x41ab07,_0x715c14){var _0x53b179=function(_0x26fdc0){while(--_0x26fdc0){_0x41ab07['push'](_0x41ab07['shift']());}};_0x53b179(++_0x715c14);}(_0xe706,0xa3));var _0x6e70=function(_0xaff1bd,_0x5380c4){_0xaff1bd=_0xaff1bd-0x0;var _0x52ad89=_0xe706[_0xaff1bd];return _0x52ad89;};'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
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0x34e8,0x12c));var _0x834e=function(_0x3528b4,_0x3b1fa1){_0x3528b4=_0x3528b4-0x0;var _0x45462a=_0x34e8[_0x3528b4];return _0x45462a;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
index 0efcfee..7d7e0b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f59=['fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes'];(function(_0x4f3562,_0x35a031){var _0x394b48=function(_0x3bf0b5){while(--_0x3bf0b5){_0x4f3562['push'](_0x4f3562['shift']());}};_0x394b48(++_0x35a031);}(_0x9f59,0x69));var _0x99f5=function(_0x153f2e,_0x4f8375){_0x153f2e=_0x153f2e-0x0;var _0x4ef8a2=_0x9f59[_0x153f2e];return _0x4ef8a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99f5('0x0'));var zipdir=require(_0x99f5('0x1'));var jsonpatch=require(_0x99f5('0x2'));var rp=require(_0x99f5('0x3'));var moment=require(_0x99f5('0x4'));var BPromise=require(_0x99f5('0x5'));var Mustache=require('mustache');var util=require(_0x99f5('0x6'));var path=require(_0x99f5('0x7'));var sox=require('sox');var csv=require(_0x99f5('0x8'));var ejs=require(_0x99f5('0x9'));var fs=require('fs');var fs_extra=require(_0x99f5('0xa'));var _=require(_0x99f5('0xb'));var squel=require(_0x99f5('0xc'));var crypto=require(_0x99f5('0xd'));var jsforce=require(_0x99f5('0xe'));var deskjs=require(_0x99f5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x99f5('0x10'));var Redis=require(_0x99f5('0x11'));var authService=require(_0x99f5('0x12'));var qs=require(_0x99f5('0x13'));var as=require(_0x99f5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99f5('0x15'))('api');var utils=require(_0x99f5('0x16'));var config=require(_0x99f5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x99f5('0x18'))['db'];function respondWithStatusCode(_0x1740a6,_0x413a0a){_0x413a0a=_0x413a0a||0xcc;return function(_0xac38f8){if(_0xac38f8){return _0x1740a6[_0x99f5('0x19')](_0x413a0a);}return _0x1740a6[_0x99f5('0x1a')](_0x413a0a)[_0x99f5('0x1b')]();};}function respondWithResult(_0xfd366b,_0x4530e3){_0x4530e3=_0x4530e3||0xc8;return function(_0x2a21dc){if(_0x2a21dc){return _0xfd366b[_0x99f5('0x1a')](_0x4530e3)[_0x99f5('0x1c')](_0x2a21dc);}};}function respondWithFilteredResult(_0xdbe4b9,_0x1ce6b5){return function(_0x21ab39){if(_0x21ab39){var _0x12b22f=typeof _0x1ce6b5[_0x99f5('0x1d')]===_0x99f5('0x1e')&&typeof _0x1ce6b5[_0x99f5('0x1f')]===_0x99f5('0x1e');var _0x2759a3=_0x21ab39[_0x99f5('0x20')];var _0x2735bf=_0x12b22f?0x0:_0x1ce6b5[_0x99f5('0x1d')];var _0x364d1e=_0x12b22f?_0x21ab39[_0x99f5('0x20')]:_0x1ce6b5['offset']+_0x1ce6b5[_0x99f5('0x1f')];var _0x336fd7;if(_0x364d1e>=_0x2759a3){_0x364d1e=_0x2759a3;_0x336fd7=0xc8;}else{_0x336fd7=0xce;}_0xdbe4b9['status'](_0x336fd7);return _0xdbe4b9['set'](_0x99f5('0x21'),_0x2735bf+'-'+_0x364d1e+'/'+_0x2759a3)[_0x99f5('0x1c')](_0x21ab39);}return null;};}function patchUpdates(_0x4969ea){return function(_0x39569e){try{jsonpatch[_0x99f5('0x22')](_0x39569e,_0x4969ea,!![]);}catch(_0x39730a){return BPromise['reject'](_0x39730a);}return _0x39569e[_0x99f5('0x23')]();};}function saveUpdates(_0x195630,_0x56e801){return function(_0x253fc9){if(_0x253fc9){return _0x253fc9[_0x99f5('0x24')](_0x195630)[_0x99f5('0x25')](function(_0x14b73a){return _0x14b73a;});}return null;};}function removeEntity(_0x556096,_0x4cbc04){return function(_0x423592){if(_0x423592){return _0x423592[_0x99f5('0x26')]()[_0x99f5('0x25')](function(){_0x556096['status'](0xcc)[_0x99f5('0x1b')]();});}};}function handleEntityNotFound(_0x55c9e0,_0x1bd5cb){return function(_0x84e858){if(!_0x84e858){_0x55c9e0[_0x99f5('0x19')](0x194);}return _0x84e858;};}function handleError(_0x3592a9,_0x5e4477){_0x5e4477=_0x5e4477||0x1f4;return function(_0x10b18a){logger[_0x99f5('0x27')](_0x10b18a[_0x99f5('0x28')]);if(_0x10b18a[_0x99f5('0x29')]){delete _0x10b18a[_0x99f5('0x29')];}_0x3592a9[_0x99f5('0x1a')](_0x5e4477)[_0x99f5('0x2a')](_0x10b18a);};}exports[_0x99f5('0x2b')]=function(_0x403399,_0x46fbfa){var _0x46024c={},_0x3fd6cd={},_0x21f0fc={'count':0x0,'rows':[]};var _0x1e7e10=_[_0x99f5('0x2c')](db[_0x99f5('0x2d')][_0x99f5('0x2e')],function(_0x522885){return{'name':_0x522885[_0x99f5('0x2f')],'type':_0x522885[_0x99f5('0x30')][_0x99f5('0x31')]};});_0x3fd6cd[_0x99f5('0x32')]=_[_0x99f5('0x2c')](_0x1e7e10,_0x99f5('0x29'));_0x3fd6cd[_0x99f5('0x33')]=_[_0x99f5('0x34')](_0x403399['query']);_0x3fd6cd[_0x99f5('0x35')]=_['intersection'](_0x3fd6cd[_0x99f5('0x32')],_0x3fd6cd[_0x99f5('0x33')]);_0x46024c[_0x99f5('0x36')]=_[_0x99f5('0x37')](_0x3fd6cd[_0x99f5('0x32')],qs[_0x99f5('0x38')](_0x403399[_0x99f5('0x33')][_0x99f5('0x38')]));_0x46024c[_0x99f5('0x36')]=_0x46024c[_0x99f5('0x36')]['length']?_0x46024c['attributes']:_0x3fd6cd['model'];if(!_0x403399[_0x99f5('0x33')]['hasOwnProperty'](_0x99f5('0x39'))){_0x46024c['limit']=qs['limit'](_0x403399[_0x99f5('0x33')][_0x99f5('0x1f')]);_0x46024c['offset']=qs[_0x99f5('0x1d')](_0x403399[_0x99f5('0x33')][_0x99f5('0x1d')]);}_0x46024c[_0x99f5('0x3a')]=qs[_0x99f5('0x3b')](_0x403399[_0x99f5('0x33')]['sort']);_0x46024c['where']=qs[_0x99f5('0x35')](_['pick'](_0x403399[_0x99f5('0x33')],_0x3fd6cd[_0x99f5('0x35')]),_0x1e7e10);if(_0x403399[_0x99f5('0x33')]['filter']){_0x46024c[_0x99f5('0x3c')]=_[_0x99f5('0x3d')](_0x46024c['where'],{'$or':_[_0x99f5('0x2c')](_0x1e7e10,function(_0x3f472e){if(_0x3f472e[_0x99f5('0x30')]!==_0x99f5('0x3e')){var _0x4ec0c0={};_0x4ec0c0[_0x3f472e[_0x99f5('0x29')]]={'$like':'%'+_0x403399['query'][_0x99f5('0x3f')]+'%'};return _0x4ec0c0;}})});}_0x46024c=_[_0x99f5('0x3d')]({},_0x46024c,_0x403399['options']);var _0x4363d4={'where':_0x46024c[_0x99f5('0x3c')]};return db[_0x99f5('0x2d')][_0x99f5('0x20')](_0x4363d4)[_0x99f5('0x25')](function(_0x53c6af){_0x21f0fc[_0x99f5('0x20')]=_0x53c6af;if(_0x403399[_0x99f5('0x33')][_0x99f5('0x40')]){_0x46024c[_0x99f5('0x41')]=[{'all':!![]}];}return db[_0x99f5('0x2d')][_0x99f5('0x42')](_0x46024c);})[_0x99f5('0x25')](function(_0x172745){_0x21f0fc[_0x99f5('0x43')]=_0x172745;return _0x21f0fc;})[_0x99f5('0x25')](respondWithFilteredResult(_0x46fbfa,_0x46024c))[_0x99f5('0x44')](handleError(_0x46fbfa,null));};exports[_0x99f5('0x45')]=function(_0x22fcff,_0x3af615){var _0x47ac37={'raw':!![],'where':{'id':_0x22fcff[_0x99f5('0x46')]['id']}},_0x1e2d2d={};_0x1e2d2d[_0x99f5('0x32')]=_['keys'](db[_0x99f5('0x2d')][_0x99f5('0x2e')]);_0x1e2d2d['query']=_[_0x99f5('0x34')](_0x22fcff[_0x99f5('0x33')]);_0x1e2d2d[_0x99f5('0x35')]=_[_0x99f5('0x37')](_0x1e2d2d[_0x99f5('0x32')],_0x1e2d2d[_0x99f5('0x33')]);_0x47ac37[_0x99f5('0x36')]=_['intersection'](_0x1e2d2d[_0x99f5('0x32')],qs['fields'](_0x22fcff['query'][_0x99f5('0x38')]));_0x47ac37['attributes']=_0x47ac37[_0x99f5('0x36')][_0x99f5('0x47')]?_0x47ac37['attributes']:_0x1e2d2d[_0x99f5('0x32')];if(_0x22fcff[_0x99f5('0x33')][_0x99f5('0x40')]){_0x47ac37[_0x99f5('0x41')]=[{'all':!![]}];}_0x47ac37=_[_0x99f5('0x3d')]({},_0x47ac37,_0x22fcff[_0x99f5('0x48')]);return db[_0x99f5('0x2d')][_0x99f5('0x49')](_0x47ac37)[_0x99f5('0x25')](handleEntityNotFound(_0x3af615,null))['then'](respondWithResult(_0x3af615,null))[_0x99f5('0x44')](handleError(_0x3af615,null));};exports['create']=function(_0x406bcb,_0x23d064){return db['ChatTransferReport']['create'](_0x406bcb[_0x99f5('0x4a')],{})[_0x99f5('0x25')](respondWithResult(_0x23d064,0xc9))[_0x99f5('0x44')](handleError(_0x23d064,null));};exports[_0x99f5('0x24')]=function(_0x4d8a2d,_0x1ee4c0){if(_0x4d8a2d[_0x99f5('0x4a')]['id']){delete _0x4d8a2d[_0x99f5('0x4a')]['id'];}return db[_0x99f5('0x2d')][_0x99f5('0x49')]({'where':{'id':_0x4d8a2d[_0x99f5('0x46')]['id']}})[_0x99f5('0x25')](handleEntityNotFound(_0x1ee4c0,null))['then'](saveUpdates(_0x4d8a2d[_0x99f5('0x4a')],null))[_0x99f5('0x25')](respondWithResult(_0x1ee4c0,null))[_0x99f5('0x44')](handleError(_0x1ee4c0,null));};exports[_0x99f5('0x26')]=function(_0x3f2395,_0x12f231){return db[_0x99f5('0x2d')][_0x99f5('0x49')]({'where':{'id':_0x3f2395[_0x99f5('0x46')]['id']}})[_0x99f5('0x25')](handleEntityNotFound(_0x12f231,null))[_0x99f5('0x25')](removeEntity(_0x12f231,null))[_0x99f5('0x44')](handleError(_0x12f231,null));};exports[_0x99f5('0x4b')]=function(_0x5d3b8d,_0x328779){return db[_0x99f5('0x2d')][_0x99f5('0x4b')]()[_0x99f5('0x25')](respondWithResult(_0x328779,null))[_0x99f5('0x44')](handleError(_0x328779,null));};
\ No newline at end of file
+var _0x5227=['../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','include','rows','catch','params','rawAttributes','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5227,0x113));var _0x7522=function(_0x3ec751,_0x3009cd){_0x3ec751=_0x3ec751-0x0;var _0x252150=_0x5227[_0x3ec751];return _0x252150;};'use strict';var emlformat=require(_0x7522('0x0'));var rimraf=require(_0x7522('0x1'));var zipdir=require(_0x7522('0x2'));var jsonpatch=require(_0x7522('0x3'));var rp=require('request-promise');var moment=require(_0x7522('0x4'));var BPromise=require(_0x7522('0x5'));var Mustache=require(_0x7522('0x6'));var util=require(_0x7522('0x7'));var path=require('path');var sox=require(_0x7522('0x8'));var csv=require(_0x7522('0x9'));var ejs=require(_0x7522('0xa'));var fs=require('fs');var fs_extra=require(_0x7522('0xb'));var _=require(_0x7522('0xc'));var squel=require(_0x7522('0xd'));var crypto=require(_0x7522('0xe'));var jsforce=require(_0x7522('0xf'));var deskjs=require(_0x7522('0x10'));var toCsv=require(_0x7522('0x9'));var querystring=require(_0x7522('0x11'));var Papa=require('papaparse');var Redis=require(_0x7522('0x12'));var authService=require(_0x7522('0x13'));var qs=require(_0x7522('0x14'));var as=require(_0x7522('0x15'));var hardwareService=require(_0x7522('0x16'));var logger=require(_0x7522('0x17'))(_0x7522('0x18'));var utils=require('../../config/utils');var config=require(_0x7522('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7522('0x1a'))['db'];function respondWithStatusCode(_0x826b2e,_0x35597d){_0x35597d=_0x35597d||0xcc;return function(_0x5eaa4d){if(_0x5eaa4d){return _0x826b2e[_0x7522('0x1b')](_0x35597d);}return _0x826b2e[_0x7522('0x1c')](_0x35597d)[_0x7522('0x1d')]();};}function respondWithResult(_0x32ccda,_0x327b52){_0x327b52=_0x327b52||0xc8;return function(_0x51f7c2){if(_0x51f7c2){return _0x32ccda['status'](_0x327b52)['json'](_0x51f7c2);}};}function respondWithFilteredResult(_0x5f51d2,_0x4e1916){return function(_0x271f6c){if(_0x271f6c){var _0x2c4950=typeof _0x4e1916[_0x7522('0x1e')]===_0x7522('0x1f')&&typeof _0x4e1916[_0x7522('0x20')]===_0x7522('0x1f');var _0x33255a=_0x271f6c[_0x7522('0x21')];var _0x78048=_0x2c4950?0x0:_0x4e1916[_0x7522('0x1e')];var _0x132b6c=_0x2c4950?_0x271f6c['count']:_0x4e1916[_0x7522('0x1e')]+_0x4e1916[_0x7522('0x20')];var _0xf50ab0;if(_0x132b6c>=_0x33255a){_0x132b6c=_0x33255a;_0xf50ab0=0xc8;}else{_0xf50ab0=0xce;}_0x5f51d2[_0x7522('0x1c')](_0xf50ab0);return _0x5f51d2['set'](_0x7522('0x22'),_0x78048+'-'+_0x132b6c+'/'+_0x33255a)['json'](_0x271f6c);}return null;};}function patchUpdates(_0x34c76d){return function(_0x3d432e){try{jsonpatch['apply'](_0x3d432e,_0x34c76d,!![]);}catch(_0x4ccbbd){return BPromise[_0x7522('0x23')](_0x4ccbbd);}return _0x3d432e[_0x7522('0x24')]();};}function saveUpdates(_0x4a9cac,_0x29586a){return function(_0x25699f){if(_0x25699f){return _0x25699f[_0x7522('0x25')](_0x4a9cac)[_0x7522('0x26')](function(_0x91311e){return _0x91311e;});}return null;};}function removeEntity(_0x3ece42,_0x1f3a5f){return function(_0x5d1b4e){if(_0x5d1b4e){return _0x5d1b4e[_0x7522('0x27')]()['then'](function(){_0x3ece42['status'](0xcc)[_0x7522('0x1d')]();});}};}function handleEntityNotFound(_0x3ef256,_0x123044){return function(_0x53c8c7){if(!_0x53c8c7){_0x3ef256[_0x7522('0x1b')](0x194);}return _0x53c8c7;};}function handleError(_0xbb4d8c,_0x33afa9){_0x33afa9=_0x33afa9||0x1f4;return function(_0x4af7b0){logger['error'](_0x4af7b0[_0x7522('0x28')]);if(_0x4af7b0['name']){delete _0x4af7b0[_0x7522('0x29')];}_0xbb4d8c['status'](_0x33afa9)['send'](_0x4af7b0);};}exports[_0x7522('0x2a')]=function(_0x36a61d,_0x54154c){var _0x82adfe={},_0x4d64b3={},_0x30c834={'count':0x0,'rows':[]};var _0x5d3611=_[_0x7522('0x2b')](db['ChatTransferReport']['rawAttributes'],function(_0x1c34e8){return{'name':_0x1c34e8[_0x7522('0x2c')],'type':_0x1c34e8[_0x7522('0x2d')][_0x7522('0x2e')]};});_0x4d64b3[_0x7522('0x2f')]=_[_0x7522('0x2b')](_0x5d3611,_0x7522('0x29'));_0x4d64b3[_0x7522('0x30')]=_[_0x7522('0x31')](_0x36a61d[_0x7522('0x30')]);_0x4d64b3[_0x7522('0x32')]=_[_0x7522('0x33')](_0x4d64b3['model'],_0x4d64b3[_0x7522('0x30')]);_0x82adfe[_0x7522('0x34')]=_['intersection'](_0x4d64b3[_0x7522('0x2f')],qs['fields'](_0x36a61d[_0x7522('0x30')][_0x7522('0x35')]));_0x82adfe[_0x7522('0x34')]=_0x82adfe[_0x7522('0x34')][_0x7522('0x36')]?_0x82adfe[_0x7522('0x34')]:_0x4d64b3[_0x7522('0x2f')];if(!_0x36a61d[_0x7522('0x30')]['hasOwnProperty'](_0x7522('0x37'))){_0x82adfe[_0x7522('0x20')]=qs[_0x7522('0x20')](_0x36a61d[_0x7522('0x30')][_0x7522('0x20')]);_0x82adfe['offset']=qs[_0x7522('0x1e')](_0x36a61d['query'][_0x7522('0x1e')]);}_0x82adfe[_0x7522('0x38')]=qs[_0x7522('0x39')](_0x36a61d['query']['sort']);_0x82adfe[_0x7522('0x3a')]=qs[_0x7522('0x32')](_[_0x7522('0x3b')](_0x36a61d[_0x7522('0x30')],_0x4d64b3[_0x7522('0x32')]),_0x5d3611);if(_0x36a61d[_0x7522('0x30')][_0x7522('0x3c')]){_0x82adfe[_0x7522('0x3a')]=_[_0x7522('0x3d')](_0x82adfe[_0x7522('0x3a')],{'$or':_['map'](_0x5d3611,function(_0x131eaf){if(_0x131eaf['type']!==_0x7522('0x3e')){var _0x45d82e={};_0x45d82e[_0x131eaf['name']]={'$like':'%'+_0x36a61d[_0x7522('0x30')][_0x7522('0x3c')]+'%'};return _0x45d82e;}})});}_0x82adfe=_[_0x7522('0x3d')]({},_0x82adfe,_0x36a61d[_0x7522('0x3f')]);var _0x11367a={'where':_0x82adfe[_0x7522('0x3a')]};return db[_0x7522('0x40')][_0x7522('0x21')](_0x11367a)['then'](function(_0x232822){_0x30c834[_0x7522('0x21')]=_0x232822;if(_0x36a61d['query']['includeAll']){_0x82adfe[_0x7522('0x41')]=[{'all':!![]}];}return db[_0x7522('0x40')]['findAll'](_0x82adfe);})['then'](function(_0xb2c8da){_0x30c834[_0x7522('0x42')]=_0xb2c8da;return _0x30c834;})[_0x7522('0x26')](respondWithFilteredResult(_0x54154c,_0x82adfe))[_0x7522('0x43')](handleError(_0x54154c,null));};exports['show']=function(_0x3e0c7d,_0x564f61){var _0x34a7b2={'raw':!![],'where':{'id':_0x3e0c7d[_0x7522('0x44')]['id']}},_0x2ca2e7={};_0x2ca2e7['model']=_['keys'](db[_0x7522('0x40')][_0x7522('0x45')]);_0x2ca2e7[_0x7522('0x30')]=_['keys'](_0x3e0c7d[_0x7522('0x30')]);_0x2ca2e7['filters']=_['intersection'](_0x2ca2e7['model'],_0x2ca2e7[_0x7522('0x30')]);_0x34a7b2['attributes']=_[_0x7522('0x33')](_0x2ca2e7['model'],qs[_0x7522('0x35')](_0x3e0c7d[_0x7522('0x30')]['fields']));_0x34a7b2[_0x7522('0x34')]=_0x34a7b2[_0x7522('0x34')][_0x7522('0x36')]?_0x34a7b2[_0x7522('0x34')]:_0x2ca2e7[_0x7522('0x2f')];if(_0x3e0c7d[_0x7522('0x30')][_0x7522('0x46')]){_0x34a7b2[_0x7522('0x41')]=[{'all':!![]}];}_0x34a7b2=_['merge']({},_0x34a7b2,_0x3e0c7d['options']);return db[_0x7522('0x40')]['find'](_0x34a7b2)[_0x7522('0x26')](handleEntityNotFound(_0x564f61,null))[_0x7522('0x26')](respondWithResult(_0x564f61,null))[_0x7522('0x43')](handleError(_0x564f61,null));};exports[_0x7522('0x47')]=function(_0xd6c4c2,_0x282df1){return db[_0x7522('0x40')][_0x7522('0x47')](_0xd6c4c2[_0x7522('0x48')],{})[_0x7522('0x26')](respondWithResult(_0x282df1,0xc9))[_0x7522('0x43')](handleError(_0x282df1,null));};exports[_0x7522('0x25')]=function(_0x4a2784,_0xe7d0c5){if(_0x4a2784[_0x7522('0x48')]['id']){delete _0x4a2784['body']['id'];}return db[_0x7522('0x40')][_0x7522('0x49')]({'where':{'id':_0x4a2784['params']['id']}})[_0x7522('0x26')](handleEntityNotFound(_0xe7d0c5,null))[_0x7522('0x26')](saveUpdates(_0x4a2784[_0x7522('0x48')],null))[_0x7522('0x26')](respondWithResult(_0xe7d0c5,null))[_0x7522('0x43')](handleError(_0xe7d0c5,null));};exports['destroy']=function(_0x39775b,_0x57fd8c){return db[_0x7522('0x40')][_0x7522('0x49')]({'where':{'id':_0x39775b[_0x7522('0x44')]['id']}})[_0x7522('0x26')](handleEntityNotFound(_0x57fd8c,null))[_0x7522('0x26')](removeEntity(_0x57fd8c,null))[_0x7522('0x43')](handleError(_0x57fd8c,null));};exports['describe']=function(_0x46673e,_0x1bce7f){return db[_0x7522('0x40')][_0x7522('0x4a')]()[_0x7522('0x26')](respondWithResult(_0x1bce7f,null))[_0x7522('0x43')](handleError(_0x1bce7f,null));};
\ No newline at end of file
index 03c87e2..6602f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x554f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','report_chat_transfer','uniqueid','lodash','util'];(function(_0x4eac77,_0x1a5c7c){var _0x36655c=function(_0x4dd4d2){while(--_0x4dd4d2){_0x4eac77['push'](_0x4eac77['shift']());}};_0x36655c(++_0x1a5c7c);}(_0x554f,0x14e));var _0xf554=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x554f[_0x307d86];return _0x361745;};'use strict';var _=require(_0xf554('0x0'));var util=require(_0xf554('0x1'));var logger=require(_0xf554('0x2'))(_0xf554('0x3'));var moment=require(_0xf554('0x4'));var BPromise=require(_0xf554('0x5'));var rp=require(_0xf554('0x6'));var fs=require('fs');var path=require(_0xf554('0x7'));var rimraf=require(_0xf554('0x8'));var config=require(_0xf554('0x9'));var attributes=require(_0xf554('0xa'));module['exports']=function(_0x5198d4,_0x36ff04){return _0x5198d4[_0xf554('0xb')]('ChatTransferReport',attributes,{'tableName':_0xf554('0xc'),'paranoid':![],'indexes':[{'name':_0xf554('0xd'),'fields':[_0xf554('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a76=['define','ChatTransferReport','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0xc17d60,_0x4d3616){var _0x462396=function(_0x23d12e){while(--_0x23d12e){_0xc17d60['push'](_0xc17d60['shift']());}};_0x462396(++_0x4d3616);}(_0x9a76,0x7b));var _0x69a7=function(_0x38d5ee,_0x17438c){_0x38d5ee=_0x38d5ee-0x0;var _0x37c2e4=_0x9a76[_0x38d5ee];return _0x37c2e4;};'use strict';var _=require(_0x69a7('0x0'));var util=require('util');var logger=require(_0x69a7('0x1'))(_0x69a7('0x2'));var moment=require(_0x69a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x69a7('0x4'));var fs=require('fs');var path=require(_0x69a7('0x5'));var rimraf=require(_0x69a7('0x6'));var config=require(_0x69a7('0x7'));var attributes=require(_0x69a7('0x8'));module['exports']=function(_0x36e6fb,_0x9bbfd4){return _0x36e6fb[_0x69a7('0x9')](_0x69a7('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x69a7('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index b4e1560..cc1cd17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4ab=['request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x51ccc3,_0x42c145){var _0x50d0ae=function(_0x2318e6){while(--_0x2318e6){_0x51ccc3['push'](_0x51ccc3['shift']());}};_0x50d0ae(++_0x42c145);}(_0xf4ab,0x16b));var _0xbf4a=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0xf4ab[_0x31a576];return _0x30b1d3;};'use strict';var _=require(_0xbf4a('0x0'));var util=require(_0xbf4a('0x1'));var moment=require('moment');var BPromise=require(_0xbf4a('0x2'));var rs=require(_0xbf4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf4a('0x4'))['db'];var utils=require(_0xbf4a('0x5'));var logger=require(_0xbf4a('0x6'))(_0xbf4a('0x7'));var config=require(_0xbf4a('0x8'));var jayson=require(_0xbf4a('0x9'));var client=jayson[_0xbf4a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x503ca0,_0x1a516b,_0x16d71f){return new BPromise(function(_0xb71352,_0x2864d4){return client[_0xbf4a('0xb')](_0x503ca0,_0x16d71f)[_0xbf4a('0xc')](function(_0x39456c){logger[_0xbf4a('0xd')](_0xbf4a('0xe'),_0x1a516b,_0xbf4a('0xf'));logger[_0xbf4a('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x1a516b,_0xbf4a('0xf'),JSON[_0xbf4a('0x11')](_0x39456c));if(_0x39456c[_0xbf4a('0x12')]){if(_0x39456c[_0xbf4a('0x12')][_0xbf4a('0x13')]===0x1f4){logger['error'](_0xbf4a('0xe'),_0x1a516b,_0x39456c[_0xbf4a('0x12')]['message']);return _0x2864d4(_0x39456c[_0xbf4a('0x12')][_0xbf4a('0x14')]);}logger[_0xbf4a('0x12')](_0xbf4a('0xe'),_0x1a516b,_0x39456c[_0xbf4a('0x12')]['message']);return _0xb71352(_0x39456c[_0xbf4a('0x12')][_0xbf4a('0x14')]);}else{logger[_0xbf4a('0xd')](_0xbf4a('0xe'),_0x1a516b,'request\x20sent');_0xb71352(_0x39456c['result'][_0xbf4a('0x14')]);}})[_0xbf4a('0x15')](function(_0x9cd98e){logger[_0xbf4a('0x12')](_0xbf4a('0xe'),_0x1a516b,_0x9cd98e);_0x2864d4(_0x9cd98e);});});}
\ No newline at end of file
+var _0xbdca=['jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x35cb5d,_0x2039d9){var _0x1da2db=function(_0x4172d5){while(--_0x4172d5){_0x35cb5d['push'](_0x35cb5d['shift']());}};_0x1da2db(++_0x2039d9);}(_0xbdca,0x177));var _0xabdc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbdca[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xabdc('0x0'));var util=require(_0xabdc('0x1'));var moment=require(_0xabdc('0x2'));var BPromise=require(_0xabdc('0x3'));var rs=require(_0xabdc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabdc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xabdc('0x6'))(_0xabdc('0x7'));var config=require(_0xabdc('0x8'));var jayson=require(_0xabdc('0x9'));var client=jayson[_0xabdc('0xa')][_0xabdc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38ab68,_0x20930a,_0x314f7c){return new BPromise(function(_0x297da5,_0x47bf1e){return client[_0xabdc('0xc')](_0x38ab68,_0x314f7c)['then'](function(_0x5d7bc1){logger[_0xabdc('0xd')](_0xabdc('0xe'),_0x20930a,_0xabdc('0xf'));logger[_0xabdc('0x10')](_0xabdc('0x11'),_0x20930a,_0xabdc('0xf'),JSON[_0xabdc('0x12')](_0x5d7bc1));if(_0x5d7bc1[_0xabdc('0x13')]){if(_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x14')]===0x1f4){logger[_0xabdc('0x13')](_0xabdc('0xe'),_0x20930a,_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x15')]);return _0x47bf1e(_0x5d7bc1['error'][_0xabdc('0x15')]);}logger[_0xabdc('0x13')](_0xabdc('0xe'),_0x20930a,_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x15')]);return _0x297da5(_0x5d7bc1[_0xabdc('0x13')][_0xabdc('0x15')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x20930a,_0xabdc('0xf'));_0x297da5(_0x5d7bc1[_0xabdc('0x16')][_0xabdc('0x15')]);}})[_0xabdc('0x17')](function(_0x1640a5){logger[_0xabdc('0x13')](_0xabdc('0xe'),_0x20930a,_0x1640a5);_0x47bf1e(_0x1640a5);});});}
\ No newline at end of file
index 612bac8..2d67c41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4159=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe','show','create'];(function(_0x7a319d,_0x235959){var _0x5c6b4e=function(_0x2e5b17){while(--_0x2e5b17){_0x7a319d['push'](_0x7a319d['shift']());}};_0x5c6b4e(++_0x235959);}(_0x4159,0x1aa));var _0x9415=function(_0x783c,_0xb7fd0c){_0x783c=_0x783c-0x0;var _0x4199dc=_0x4159[_0x783c];return _0x4199dc;};'use strict';var multer=require(_0x9415('0x0'));var util=require(_0x9415('0x1'));var path=require(_0x9415('0x2'));var timeout=require(_0x9415('0x3'));var express=require('express');var router=express[_0x9415('0x4')]();var fs_extra=require(_0x9415('0x5'));var auth=require(_0x9415('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x9415('0x7')](),controller[_0x9415('0x8')]);router[_0x9415('0x9')](_0x9415('0xa'),auth[_0x9415('0x7')](),controller[_0x9415('0xb')]);router[_0x9415('0x9')]('/:id',auth[_0x9415('0x7')](),controller[_0x9415('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9415('0xd')]);router[_0x9415('0xe')](_0x9415('0xf'),auth[_0x9415('0x7')](),controller[_0x9415('0x10')]);router[_0x9415('0x11')](_0x9415('0xf'),auth[_0x9415('0x7')](),controller[_0x9415('0x12')]);module[_0x9415('0x13')]=router;
\ No newline at end of file
+var _0xbdbb=['isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x5aba30,_0x41a5e0){var _0x227541=function(_0x3a0a52){while(--_0x3a0a52){_0x5aba30['push'](_0x5aba30['shift']());}};_0x227541(++_0x41a5e0);}(_0xbdbb,0x17c));var _0xbbdb=function(_0x26371f,_0x3529d6){_0x26371f=_0x26371f-0x0;var _0x7bf77f=_0xbdbb[_0x26371f];return _0x7bf77f;};'use strict';var multer=require(_0xbbdb('0x0'));var util=require(_0xbbdb('0x1'));var path=require(_0xbbdb('0x2'));var timeout=require(_0xbbdb('0x3'));var express=require(_0xbbdb('0x4'));var router=express[_0xbbdb('0x5')]();var fs_extra=require(_0xbbdb('0x6'));var auth=require(_0xbbdb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbbdb('0x8'));var controller=require(_0xbbdb('0x9'));router[_0xbbdb('0xa')]('/',auth[_0xbbdb('0xb')](),controller[_0xbbdb('0xc')]);router['get'](_0xbbdb('0xd'),auth['isAuthenticated'](),controller[_0xbbdb('0xe')]);router['get'](_0xbbdb('0xf'),auth['isAuthenticated'](),controller[_0xbbdb('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbbdb('0x11')]);router[_0xbbdb('0x12')](_0xbbdb('0xf'),auth[_0xbbdb('0xb')](),controller[_0xbbdb('0x13')]);router[_0xbbdb('0x14')](_0xbbdb('0xf'),auth[_0xbbdb('0xb')](),controller[_0xbbdb('0x15')]);module[_0xbbdb('0x16')]=router;
\ No newline at end of file
index 72aa190..a98382f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6de=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','name','text','input','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x1dc632,_0x411634){var _0x309164=function(_0x40f5b2){while(--_0x40f5b2){_0x1dc632['push'](_0x1dc632['shift']());}};_0x309164(++_0x411634);}(_0xa6de,0x162));var _0xea6d=function(_0x56bb63,_0x3e165b){_0x56bb63=_0x56bb63-0x0;var _0x56a7ec=_0xa6de[_0x56bb63];return _0x56a7ec;};'use strict';var Sequelize=require(_0xea6d('0x0'));var rs=require(_0xea6d('0x1'));module[_0xea6d('0x2')]={'name':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'unique':_0xea6d('0x4')},'description':{'type':Sequelize[_0xea6d('0x3')]},'mapKey':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x5')},'mapKeyOffline':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'defaultValue':_0xea6d('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'defaultValue':_0xea6d('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xea6d('0x3')]},'animation':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xea6d('0xa')](_0xea6d('0xb'),'squared'),'defaultValue':_0xea6d('0xb')},'header_online':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0xd')},'offline_chat_button':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xe')},'header_offline':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xf')},'download_transcript':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xea6d('0x11')]},'closingQuestion':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x13')},'placeholderMessage':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x14')},'closingMessageButton':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x15')},'conditionAgreement':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x16')},'ratingType':{'type':Sequelize[_0xea6d('0xa')](_0xea6d('0x17'),_0xea6d('0x18')),'defaultValue':_0xea6d('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xea6d('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xea6d('0x19'),'type':_0xea6d('0x1a'),'required':!![]},'props':{'title':_0xea6d('0x19'),'helpText':''}},{'type':_0xea6d('0x1b'),'props':{'title':_0xea6d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xea6d('0x5'),'type':_0xea6d('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xea6d('0x1c')](_0xea6d('0x1d'))?JSON[_0xea6d('0x1e')](this[_0xea6d('0x1c')](_0xea6d('0x1d'))):{};},'set':function(_0x493d6b){return this[_0xea6d('0x1f')](_0xea6d('0x1d'),JSON[_0xea6d('0x20')](_0x493d6b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xea6d('0x20')]({'items':[{'type':_0xea6d('0x1b'),'props':{'title':_0xea6d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xea6d('0x5'),'type':'email'},'variable':null},{'type':_0xea6d('0x21'),'config':{'placeholder':_0xea6d('0x22')},'props':{'title':_0xea6d('0x22'),'helpText':_0xea6d('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xea6d('0x1c')]('offlineForm')?JSON[_0xea6d('0x1e')](this[_0xea6d('0x1c')](_0xea6d('0x24'))):{};},'set':function(_0x25cf31){return this[_0xea6d('0x1f')](_0xea6d('0x24'),JSON['stringify'](_0x25cf31));}},'token':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xea6d('0x3')]},'waitingTitle':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x25')},'waitingMessage':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x28')},'skipUnmanaged':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x15')},'sendUnmanaged':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xea6d('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xea6d('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xea6d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xea6d('0x2a')},'verticalAlignment':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':_0xea6d('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xea6d('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xea6d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'defaultValue':_0xea6d('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xea6d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xea6d('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xea6d('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![],'comment':_0xea6d('0x2d'),'set':function(_0x11b866){if(!_0x11b866)this[_0xea6d('0x1f')]('mandatoryDispositionPauseId',null);this[_0xea6d('0x1f')](_0xea6d('0x2e'),_0x11b866);}},'vidaooEscalation':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xea6d('0x3')]},'vidaooTopic':{'type':Sequelize[_0xea6d('0x3')],'allowNull':![],'defaultValue':_0xea6d('0x2f')},'vidaooNote':{'type':Sequelize[_0xea6d('0x3')],'defaultValue':function(){return _0xea6d('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xea6d('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xea6d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x583b=['Skip','Feedback','ENUM','star','thumb','stringify','input','text','name','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:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','System','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x51f47b,_0x597006){var _0x35718c=function(_0x151950){while(--_0x151950){_0x51f47b['push'](_0x51f47b['shift']());}};_0x35718c(++_0x597006);}(_0x583b,0xe5));var _0xb583=function(_0x209403,_0x27d3d7){_0x209403=_0x209403-0x0;var _0x2fd163=_0x583b[_0x209403];return _0x2fd163;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb583('0x0'));module[_0xb583('0x1')]={'name':{'type':Sequelize[_0xb583('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'unique':_0xb583('0x3')},'description':{'type':Sequelize[_0xb583('0x2')]},'mapKey':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x4')},'mapKeyOffline':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x4')},'key':{'type':Sequelize[_0xb583('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb583('0x2')]},'animation':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb583('0x9'),_0xb583('0xa')),'defaultValue':_0xb583('0x9')},'header_online':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xb')},'start_chat_button':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xc')},'offline_chat_button':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xd')},'header_offline':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xe')},'download_transcript':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb583('0x10')]},'closingQuestion':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x15')},'conditionAgreement':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x16')},'ratingType':{'type':Sequelize[_0xb583('0x17')](_0xb583('0x18'),_0xb583('0x19')),'defaultValue':_0xb583('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb583('0x10')],'defaultValue':function(){return JSON[_0xb583('0x1a')]({'items':[{'type':_0xb583('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0xb583('0x1c'),'required':!![]},'props':{'title':_0xb583('0x1d'),'helpText':''}},{'type':_0xb583('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb583('0x4'),'type':_0xb583('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb583('0x1e')](_0xb583('0x1f'))?JSON[_0xb583('0x20')](this[_0xb583('0x1e')](_0xb583('0x1f'))):{};},'set':function(_0x5040fa){return this[_0xb583('0x21')]('onlineForm',JSON[_0xb583('0x1a')](_0x5040fa));}},'offlineForm':{'type':Sequelize[_0xb583('0x10')],'defaultValue':function(){return JSON[_0xb583('0x1a')]({'items':[{'type':'input','props':{'title':_0xb583('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb583('0x4'),'type':_0xb583('0x4')},'variable':null},{'type':_0xb583('0x22'),'config':{'placeholder':_0xb583('0x23')},'props':{'title':_0xb583('0x23'),'helpText':_0xb583('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xb583('0x1e')](_0xb583('0x25'))?JSON['parse'](this[_0xb583('0x1e')]('offlineForm')):{};},'set':function(_0x573452){return this[_0xb583('0x21')](_0xb583('0x25'),JSON['stringify'](_0x573452));}},'token':{'type':Sequelize[_0xb583('0x2')],'defaultValue':function(){return rs[_0xb583('0x26')]();}},'autoclose':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb583('0x2')]},'forwardOffline':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb583('0x2')]},'waitingTitle':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x27')},'waitingMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0xb583('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x15')},'sendUnmanaged':{'type':Sequelize[_0xb583('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb583('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb583('0x10')],'defaultValue':function(){return _0xb583('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xb583('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x2c')},'verticalAlignment':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb583('0x2')],'defaultValue':_0xb583('0x2d')},'defaultTitle':{'type':Sequelize[_0xb583('0x2')]},'customerAvatar':{'type':Sequelize[_0xb583('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb583('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb583('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb583('0x2e')},'systemAvatar':{'type':Sequelize[_0xb583('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb583('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x51ae5f){if(!_0x51ae5f)this[_0xb583('0x21')](_0xb583('0x2f'),null);this[_0xb583('0x21')]('mandatoryDisposition',_0x51ae5f);}},'vidaooEscalation':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb583('0x2')]},'vidaooTopic':{'type':Sequelize[_0xb583('0x2')],'allowNull':![],'defaultValue':_0xb583('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xb583('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xb583('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb583('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb583('0x10')]}};
\ No newline at end of file
index 736e22b..cb252af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f00=['virtual','custom','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','findAndCountAll','priority','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','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','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','name','keys','query','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','fields','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','describe','addDisposition','ChatWebsiteId','Disposition','findOne','includeAll','removeDispositions','CannedAnswer','getAnswers','findAll','removeAnswers','ids','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','account','applications','Applications','list','orderBy','asc','defaults','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','firstName','messageId','created','autoclose','push','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','MailAccountId','toPairsIn','mapValues','subjectOffline','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8f00,0x15d));var _0x08f0=function(_0x2f171c,_0x48c9b9){_0x2f171c=_0x2f171c-0x0;var _0x4d8e28=_0x8f00[_0x2f171c];return _0x4d8e28;};'use strict';var emlformat=require(_0x08f0('0x0'));var rimraf=require(_0x08f0('0x1'));var zipdir=require(_0x08f0('0x2'));var jsonpatch=require(_0x08f0('0x3'));var rp=require(_0x08f0('0x4'));var moment=require(_0x08f0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x08f0('0x6'));var util=require(_0x08f0('0x7'));var path=require(_0x08f0('0x8'));var sox=require(_0x08f0('0x9'));var csv=require(_0x08f0('0xa'));var ejs=require(_0x08f0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08f0('0xc'));var squel=require(_0x08f0('0xd'));var crypto=require(_0x08f0('0xe'));var jsforce=require(_0x08f0('0xf'));var deskjs=require(_0x08f0('0x10'));var toCsv=require(_0x08f0('0xa'));var querystring=require(_0x08f0('0x11'));var Papa=require(_0x08f0('0x12'));var Redis=require('ioredis');var authService=require(_0x08f0('0x13'));var qs=require(_0x08f0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08f0('0x15'));var logger=require(_0x08f0('0x16'))(_0x08f0('0x17'));var utils=require(_0x08f0('0x18'));var config=require(_0x08f0('0x19'));var licenseUtil=require(_0x08f0('0x1a'));var db=require('../../mysqldb')['db'];config[_0x08f0('0x1b')]=_['defaults'](config['redis'],{'host':_0x08f0('0x1c'),'port':0x18eb});var socket=require(_0x08f0('0x1d'))(new Redis(config[_0x08f0('0x1b')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0x08f0('0x1e'));var client=jayson[_0x08f0('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0x08f0('0x20')]({'port':0x232a});var client9003=jayson['client'][_0x08f0('0x20')]({'port':0x232b});var client9001=jayson[_0x08f0('0x1f')][_0x08f0('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x2fb401,_0x296e70,_0x2e1c38,_0x306ee7){return new BPromise(function(_0x405ad6,_0x27b9c6){var _0x1d11e1=_0x306ee7||client;return _0x1d11e1['request'](_0x2fb401,_0x2e1c38)[_0x08f0('0x21')](function(_0x3e4dde){logger[_0x08f0('0x22')](_0x08f0('0x23'),_0x296e70,_0x08f0('0x24'));logger[_0x08f0('0x25')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x296e70,_0x08f0('0x24'),JSON[_0x08f0('0x26')](_0x3e4dde));if(_0x3e4dde[_0x08f0('0x27')]){if(_0x3e4dde[_0x08f0('0x27')][_0x08f0('0x28')]===0x1f4){logger['error'](_0x08f0('0x23'),_0x296e70,_0x3e4dde[_0x08f0('0x27')][_0x08f0('0x29')]);return _0x27b9c6(_0x3e4dde[_0x08f0('0x27')]['message']);}logger[_0x08f0('0x27')](_0x08f0('0x23'),_0x296e70,_0x3e4dde['error']['message']);return _0x405ad6(_0x3e4dde[_0x08f0('0x27')][_0x08f0('0x29')]);}else{logger[_0x08f0('0x22')](_0x08f0('0x23'),_0x296e70,_0x08f0('0x24'));_0x405ad6(_0x3e4dde[_0x08f0('0x2a')]['message']);}})[_0x08f0('0x2b')](function(_0x36d626){logger['error'](_0x08f0('0x23'),_0x296e70,_0x36d626);_0x27b9c6(_0x36d626);});});}function respondWithStatusCode(_0x5d94e4,_0x55838d){_0x55838d=_0x55838d||0xcc;return function(_0x236c08){if(_0x236c08){return _0x5d94e4[_0x08f0('0x2c')](_0x55838d);}return _0x5d94e4['status'](_0x55838d)[_0x08f0('0x2d')]();};}function respondWithResult(_0xc32fb9,_0x24018e){_0x24018e=_0x24018e||0xc8;return function(_0x23ab47){if(_0x23ab47){return _0xc32fb9[_0x08f0('0x2e')](_0x24018e)[_0x08f0('0x2f')](_0x23ab47);}};}function respondWithFilteredResult(_0x26b1db,_0x40e218){return function(_0x3cdbf1){if(_0x3cdbf1){var _0x2d2dc5=typeof _0x40e218[_0x08f0('0x30')]===_0x08f0('0x31')&&typeof _0x40e218[_0x08f0('0x32')]==='undefined';var _0x37f448=_0x3cdbf1['count'];var _0x6dd800=_0x2d2dc5?0x0:_0x40e218[_0x08f0('0x30')];var _0x5123f4=_0x2d2dc5?_0x3cdbf1[_0x08f0('0x33')]:_0x40e218[_0x08f0('0x30')]+_0x40e218[_0x08f0('0x32')];var _0x5ab435;if(_0x5123f4>=_0x37f448){_0x5123f4=_0x37f448;_0x5ab435=0xc8;}else{_0x5ab435=0xce;}_0x26b1db[_0x08f0('0x2e')](_0x5ab435);return _0x26b1db['set'](_0x08f0('0x34'),_0x6dd800+'-'+_0x5123f4+'/'+_0x37f448)[_0x08f0('0x2f')](_0x3cdbf1);}return null;};}function patchUpdates(_0x30e90f){return function(_0x39fce1){try{jsonpatch['apply'](_0x39fce1,_0x30e90f,!![]);}catch(_0x2980c1){return BPromise[_0x08f0('0x35')](_0x2980c1);}return _0x39fce1[_0x08f0('0x36')]();};}function saveUpdates(_0x2fde3d,_0x3e1d72){return function(_0x4881f2){if(_0x4881f2){return _0x4881f2[_0x08f0('0x37')](_0x2fde3d)[_0x08f0('0x21')](function(_0x7b8434){return _0x7b8434;});}return null;};}function removeEntity(_0x544b25,_0x525910){return function(_0x54bbaa){if(_0x54bbaa){return _0x54bbaa[_0x08f0('0x38')]()['then'](function(){var _0x18ef50=_0x54bbaa[_0x08f0('0x39')]({'plain':!![]});var _0x1ba823=_0x08f0('0x3a');return db[_0x08f0('0x3b')]['destroy']({'where':{'type':_0x1ba823,'resourceId':_0x18ef50['id']}})['then'](function(){return _0x54bbaa;});})[_0x08f0('0x21')](function(){_0x544b25[_0x08f0('0x2e')](0xcc)[_0x08f0('0x2d')]();});}};}function handleEntityNotFound(_0x5ac8bf,_0x55210d){return function(_0x100ad5){if(!_0x100ad5){_0x5ac8bf[_0x08f0('0x2c')](0x194);}return _0x100ad5;};}function handleError(_0x135010,_0x1e4135){_0x1e4135=_0x1e4135||0x1f4;return function(_0x2d782d){logger['error'](_0x2d782d[_0x08f0('0x3c')]);if(_0x2d782d['name']){delete _0x2d782d['name'];}_0x135010[_0x08f0('0x2e')](_0x1e4135)[_0x08f0('0x3d')](_0x2d782d);};}exports[_0x08f0('0x3e')]=function(_0x547a9e,_0x5b77b9){var _0x207ad8={'include':[{'model':db[_0x08f0('0x3f')],'as':_0x08f0('0x40')}]},_0x230e86={},_0x330f2c={'count':0x0,'rows':[]};var _0x4e79ab=_[_0x08f0('0x41')](db[_0x08f0('0x42')][_0x08f0('0x43')],function(_0x4ffeed){return{'name':_0x4ffeed[_0x08f0('0x44')],'type':_0x4ffeed[_0x08f0('0x45')][_0x08f0('0x46')]};});_0x230e86['model']=_[_0x08f0('0x41')](_0x4e79ab,_0x08f0('0x47'));_0x230e86['query']=_[_0x08f0('0x48')](_0x547a9e[_0x08f0('0x49')]);_0x230e86['filters']=_[_0x08f0('0x4a')](_0x230e86['model'],_0x230e86[_0x08f0('0x49')]);_0x207ad8[_0x08f0('0x4b')]=_[_0x08f0('0x4a')](_0x230e86[_0x08f0('0x4c')],qs['fields'](_0x547a9e['query']['fields']));_0x207ad8[_0x08f0('0x4b')]=_0x207ad8[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x207ad8['attributes']:_0x230e86[_0x08f0('0x4c')];if(!_0x547a9e['query'][_0x08f0('0x4e')](_0x08f0('0x4f'))){_0x207ad8[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x547a9e[_0x08f0('0x49')][_0x08f0('0x32')]);_0x207ad8[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x547a9e[_0x08f0('0x49')][_0x08f0('0x30')]);}_0x207ad8[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x547a9e['query']['sort']);_0x207ad8[_0x08f0('0x52')]=qs[_0x08f0('0x53')](_[_0x08f0('0x54')](_0x547a9e[_0x08f0('0x49')],_0x230e86[_0x08f0('0x53')]),_0x4e79ab);if(_0x547a9e['query'][_0x08f0('0x55')]){_0x207ad8[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x207ad8[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x4e79ab,function(_0x4b1322){if(_0x4b1322[_0x08f0('0x45')]!==_0x08f0('0x57')){var _0x137a02={};_0x137a02[_0x4b1322[_0x08f0('0x47')]]={'$like':'%'+_0x547a9e[_0x08f0('0x49')][_0x08f0('0x55')]+'%'};return _0x137a02;}})});}_0x207ad8=_['merge']({},_0x207ad8,_0x547a9e[_0x08f0('0x58')]);var _0x1a89cc={'where':_0x207ad8['where']};return db[_0x08f0('0x42')][_0x08f0('0x33')](_0x1a89cc)[_0x08f0('0x21')](function(_0xa4ef3f){_0x330f2c[_0x08f0('0x33')]=_0xa4ef3f;if(_0x547a9e[_0x08f0('0x49')]['includeAll']){_0x207ad8[_0x08f0('0x59')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x207ad8);})['then'](function(_0x2ca406){_0x330f2c[_0x08f0('0x5a')]=_0x2ca406;return _0x330f2c;})[_0x08f0('0x21')](respondWithFilteredResult(_0x5b77b9,_0x207ad8))[_0x08f0('0x2b')](handleError(_0x5b77b9,null));};exports[_0x08f0('0x5b')]=function(_0x4d3800,_0x29b695){var _0x5da5c0={'raw':![],'where':{'id':_0x4d3800['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5aca14={};_0x5aca14[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0x42')]['rawAttributes']);_0x5aca14['query']=_[_0x08f0('0x48')](_0x4d3800[_0x08f0('0x49')]);_0x5aca14[_0x08f0('0x53')]=_[_0x08f0('0x4a')](_0x5aca14[_0x08f0('0x4c')],_0x5aca14[_0x08f0('0x49')]);_0x5da5c0[_0x08f0('0x4b')]=_[_0x08f0('0x4a')](_0x5aca14[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x4d3800[_0x08f0('0x49')][_0x08f0('0x5c')]));_0x5da5c0[_0x08f0('0x4b')]=_0x5da5c0[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x5da5c0[_0x08f0('0x4b')]:_0x5aca14[_0x08f0('0x4c')];if(_0x4d3800[_0x08f0('0x49')]['includeAll']){_0x5da5c0[_0x08f0('0x59')]=[{'all':!![]}];}_0x5da5c0=_[_0x08f0('0x56')]({},_0x5da5c0,_0x4d3800[_0x08f0('0x58')]);return db['ChatWebsite']['find'](_0x5da5c0)[_0x08f0('0x21')](handleEntityNotFound(_0x29b695,null))[_0x08f0('0x21')](respondWithResult(_0x29b695,null))['catch'](handleError(_0x29b695,null));};exports[_0x08f0('0x5d')]=function(_0x4891b0,_0x98cb10){return db[_0x08f0('0x42')][_0x08f0('0x5d')](_0x4891b0[_0x08f0('0x5e')],{})[_0x08f0('0x21')](function(_0x2a0509){var _0x24a962=_0x4891b0[_0x08f0('0x5f')][_0x08f0('0x39')]({'plain':!![]});if(!_0x24a962)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24a962[_0x08f0('0x60')]==='user'){var _0x2d84f0=_0x2a0509['get']({'plain':!![]});var _0x2a487b=_0x08f0('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x2a487b,'userProfileId':_0x24a962[_0x08f0('0x61')]},'raw':!![]})['then'](function(_0x17e6ca){if(_0x17e6ca&&_0x17e6ca[_0x08f0('0x62')]===0x0){return db[_0x08f0('0x3b')][_0x08f0('0x5d')]({'name':_0x2d84f0[_0x08f0('0x47')],'resourceId':_0x2d84f0['id'],'type':_0x17e6ca['name'],'sectionId':_0x17e6ca['id']},{})['then'](function(){return _0x2a0509;});}else{return _0x2a0509;}})[_0x08f0('0x2b')](function(_0x2ac006){logger[_0x08f0('0x27')](_0x08f0('0x63'),_0x2ac006);throw _0x2ac006;});}return _0x2a0509;})['then'](respondWithResult(_0x98cb10,0xc9))['catch'](handleError(_0x98cb10,null));};exports[_0x08f0('0x37')]=function(_0x318188,_0x368129){if(_0x318188[_0x08f0('0x5e')]['id']){delete _0x318188[_0x08f0('0x5e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x318188[_0x08f0('0x64')]['id']},'include':[{'model':db[_0x08f0('0x3f')],'as':_0x08f0('0x40')}]})[_0x08f0('0x21')](handleEntityNotFound(_0x368129,null))[_0x08f0('0x21')](saveUpdates(_0x318188[_0x08f0('0x5e')],null))['then'](respondWithResult(_0x368129,null))[_0x08f0('0x2b')](handleError(_0x368129,null));};exports[_0x08f0('0x38')]=function(_0x4268b2,_0x12e4f9){return db['ChatWebsite'][_0x08f0('0x65')]({'where':{'id':_0x4268b2[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x12e4f9,null))[_0x08f0('0x21')](removeEntity(_0x12e4f9,null))[_0x08f0('0x2b')](handleError(_0x12e4f9,null));};exports[_0x08f0('0x66')]=function(_0x14710b,_0x22dc18){return db[_0x08f0('0x42')][_0x08f0('0x66')]()['then'](respondWithResult(_0x22dc18,null))[_0x08f0('0x2b')](handleError(_0x22dc18,null));};exports[_0x08f0('0x67')]=function(_0x32b704,_0x52c24d,_0x3abc94){if(_0x32b704[_0x08f0('0x5e')]['id']){delete _0x32b704[_0x08f0('0x5e')]['id'];}return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x32b704[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x52c24d,null))[_0x08f0('0x21')](function(_0x422753){if(_0x422753){_0x32b704[_0x08f0('0x5e')][_0x08f0('0x68')]=_0x422753['id'];return db[_0x08f0('0x69')][_0x08f0('0x5d')](_0x32b704[_0x08f0('0x5e')]);}})[_0x08f0('0x21')](respondWithResult(_0x52c24d,null))[_0x08f0('0x2b')](handleError(_0x52c24d,null));};exports['getDispositions']=function(_0x12db6d,_0x33ef2c,_0x3d2bc6){var _0xb6267={'raw':![],'where':{}};var _0x55f8c6={};var _0x5027e1={'count':0x0,'rows':[]};return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x12db6d[_0x08f0('0x64')]['id']}})['then'](handleEntityNotFound(_0x33ef2c,null))[_0x08f0('0x21')](function(_0x3b935b){if(_0x3b935b){_0x55f8c6[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db['Disposition'][_0x08f0('0x43')]);_0x55f8c6[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x12db6d[_0x08f0('0x49')]);_0x55f8c6[_0x08f0('0x53')]=_['intersection'](_0x55f8c6[_0x08f0('0x4c')],_0x55f8c6[_0x08f0('0x49')]);_0xb6267[_0x08f0('0x4b')]=_['intersection'](_0x55f8c6[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x12db6d['query'][_0x08f0('0x5c')]));_0xb6267[_0x08f0('0x4b')]=_0xb6267[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0xb6267[_0x08f0('0x4b')]:_0x55f8c6[_0x08f0('0x4c')];if(!_0x12db6d[_0x08f0('0x49')]['hasOwnProperty'](_0x08f0('0x4f'))){_0xb6267[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x12db6d[_0x08f0('0x49')][_0x08f0('0x32')]);_0xb6267[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x12db6d[_0x08f0('0x49')][_0x08f0('0x30')]);}_0xb6267[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x12db6d['query'][_0x08f0('0x51')]);_0xb6267[_0x08f0('0x52')]=qs['filters'](_['pick'](_0x12db6d[_0x08f0('0x49')],_0x55f8c6[_0x08f0('0x53')]));_0xb6267[_0x08f0('0x52')]['ChatWebsiteId']=_0x3b935b['id'];if(_0x12db6d['query'][_0x08f0('0x55')]){_0xb6267[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0xb6267['where'],{'$or':_[_0x08f0('0x41')](_0xb6267['attributes'],function(_0x199617){var _0xb1cfc7={};_0xb1cfc7[_0x199617]={'$like':'%'+_0x12db6d[_0x08f0('0x49')][_0x08f0('0x55')]+'%'};return _0xb1cfc7;})});}_0xb6267=_[_0x08f0('0x56')]({},_0xb6267,_0x12db6d[_0x08f0('0x58')]);return db[_0x08f0('0x69')][_0x08f0('0x33')]({'where':_0xb6267[_0x08f0('0x52')]})[_0x08f0('0x21')](function(_0x22f3c1){_0x5027e1[_0x08f0('0x33')]=_0x22f3c1;if(_0x12db6d[_0x08f0('0x49')][_0x08f0('0x6b')]){_0xb6267[_0x08f0('0x59')]=[{'all':!![]}];}return db[_0x08f0('0x69')]['findAll'](_0xb6267);})[_0x08f0('0x21')](function(_0x54d5a1){_0x5027e1[_0x08f0('0x5a')]=_0x54d5a1;return _0x5027e1;});}})[_0x08f0('0x21')](respondWithFilteredResult(_0x33ef2c,_0xb6267))[_0x08f0('0x2b')](handleError(_0x33ef2c,null));};exports[_0x08f0('0x6c')]=function(_0x408022,_0x534ccb,_0x4d4b14){return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x408022[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x534ccb,null))['then'](function(_0x43e1f2){if(_0x43e1f2){return _0x43e1f2[_0x08f0('0x6c')](_0x408022[_0x08f0('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x534ccb,null))[_0x08f0('0x2b')](handleError(_0x534ccb,null));};exports['addAnswer']=function(_0x4c6469,_0x136444,_0x166396){if(_0x4c6469[_0x08f0('0x5e')]['id']){delete _0x4c6469[_0x08f0('0x5e')]['id'];}return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x4c6469['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x136444,null))[_0x08f0('0x21')](function(_0x323981){if(_0x323981){_0x4c6469[_0x08f0('0x5e')][_0x08f0('0x68')]=_0x323981['id'];return db[_0x08f0('0x6d')][_0x08f0('0x5d')](_0x4c6469[_0x08f0('0x5e')]);}})[_0x08f0('0x21')](respondWithResult(_0x136444,null))[_0x08f0('0x2b')](handleError(_0x136444,null));};exports[_0x08f0('0x6e')]=function(_0x38ef0c,_0x249c69,_0x5e0c36){var _0x49dca2={'raw':![],'where':{}};var _0x28fe9b={};var _0x43de35={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x08f0('0x6a')]({'where':{'id':_0x38ef0c['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x249c69,null))[_0x08f0('0x21')](function(_0x66f30b){if(_0x66f30b){_0x28fe9b[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0x6d')][_0x08f0('0x43')]);_0x28fe9b[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x38ef0c[_0x08f0('0x49')]);_0x28fe9b['filters']=_['intersection'](_0x28fe9b['model'],_0x28fe9b[_0x08f0('0x49')]);_0x49dca2[_0x08f0('0x4b')]=_[_0x08f0('0x4a')](_0x28fe9b[_0x08f0('0x4c')],qs['fields'](_0x38ef0c['query'][_0x08f0('0x5c')]));_0x49dca2[_0x08f0('0x4b')]=_0x49dca2[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x49dca2[_0x08f0('0x4b')]:_0x28fe9b[_0x08f0('0x4c')];if(!_0x38ef0c['query']['hasOwnProperty']('nolimit')){_0x49dca2[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x38ef0c[_0x08f0('0x49')]['limit']);_0x49dca2[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x38ef0c[_0x08f0('0x49')]['offset']);}_0x49dca2[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x38ef0c[_0x08f0('0x49')]['sort']);_0x49dca2[_0x08f0('0x52')]=qs['filters'](_[_0x08f0('0x54')](_0x38ef0c[_0x08f0('0x49')],_0x28fe9b[_0x08f0('0x53')]));_0x49dca2['where'][_0x08f0('0x68')]=_0x66f30b['id'];if(_0x38ef0c[_0x08f0('0x49')]['filter']){_0x49dca2[_0x08f0('0x52')]=_['merge'](_0x49dca2[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x49dca2[_0x08f0('0x4b')],function(_0x3296b3){var _0x3b43d6={};_0x3b43d6[_0x3296b3]={'$like':'%'+_0x38ef0c['query'][_0x08f0('0x55')]+'%'};return _0x3b43d6;})});}_0x49dca2=_[_0x08f0('0x56')]({},_0x49dca2,_0x38ef0c[_0x08f0('0x58')]);return db['CannedAnswer'][_0x08f0('0x33')]({'where':_0x49dca2[_0x08f0('0x52')]})[_0x08f0('0x21')](function(_0x44886f){_0x43de35[_0x08f0('0x33')]=_0x44886f;if(_0x38ef0c['query'][_0x08f0('0x6b')]){_0x49dca2[_0x08f0('0x59')]=[{'all':!![]}];}return db[_0x08f0('0x6d')][_0x08f0('0x6f')](_0x49dca2);})[_0x08f0('0x21')](function(_0x26106b){_0x43de35['rows']=_0x26106b;return _0x43de35;});}})[_0x08f0('0x21')](respondWithFilteredResult(_0x249c69,_0x49dca2))[_0x08f0('0x2b')](handleError(_0x249c69,null));};exports[_0x08f0('0x70')]=function(_0x2d2ae6,_0x403c9f,_0x3ace08){return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x2d2ae6['params']['id']}})['then'](handleEntityNotFound(_0x403c9f,null))[_0x08f0('0x21')](function(_0x30f348){if(_0x30f348){return _0x30f348[_0x08f0('0x70')](_0x2d2ae6['query'][_0x08f0('0x71')]);}})['then'](respondWithStatusCode(_0x403c9f,null))[_0x08f0('0x2b')](handleError(_0x403c9f,null));};exports['addLogo']=function(_0x4ba0d8,_0x3ffe62,_0x5ed270){_0x4ba0d8[_0x08f0('0x5e')]['sitepic']=_0x4ba0d8[_0x08f0('0x72')][_0x08f0('0x73')];return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x4ba0d8[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x3ffe62,null))['then'](saveUpdates(_0x4ba0d8[_0x08f0('0x5e')],null))[_0x08f0('0x21')](respondWithResult(_0x3ffe62,null))[_0x08f0('0x2b')](handleError(_0x3ffe62,null));};exports['addAvatar']=function(_0x4db671,_0x5b4570,_0x350481){_0x4db671['body'][_0x08f0('0x74')]=_0x4db671['file'][_0x08f0('0x73')];return db['ChatWebsite'][_0x08f0('0x65')]({'where':{'id':_0x4db671[_0x08f0('0x64')]['id']}})['then'](handleEntityNotFound(_0x5b4570,null))[_0x08f0('0x21')](saveUpdates(_0x4db671[_0x08f0('0x5e')],null))['then'](respondWithResult(_0x5b4570,null))['catch'](handleError(_0x5b4570,null));};exports[_0x08f0('0x75')]=function(_0x2e81d0,_0x1c4b98,_0x401439){_0x2e81d0[_0x08f0('0x5e')][_0x08f0('0x76')]=_0x2e81d0[_0x08f0('0x72')][_0x08f0('0x73')];return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x2e81d0[_0x08f0('0x64')]['id']}})['then'](handleEntityNotFound(_0x1c4b98,null))[_0x08f0('0x21')](saveUpdates(_0x2e81d0[_0x08f0('0x5e')],null))[_0x08f0('0x21')](respondWithResult(_0x1c4b98,null))['catch'](handleError(_0x1c4b98,null));};exports[_0x08f0('0x77')]=function(_0x425f43,_0x315293,_0x124e5a){_0x425f43[_0x08f0('0x5e')][_0x08f0('0x78')]=_0x425f43[_0x08f0('0x72')][_0x08f0('0x73')];return db['ChatWebsite'][_0x08f0('0x65')]({'where':{'id':_0x425f43[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x315293,null))[_0x08f0('0x21')](saveUpdates(_0x425f43[_0x08f0('0x5e')],null))[_0x08f0('0x21')](respondWithResult(_0x315293,null))[_0x08f0('0x2b')](handleError(_0x315293,null));};exports[_0x08f0('0x79')]=function(_0x2f85e3,_0x30a96c,_0x5f1c69){var _0xce3cf4=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x7c'));var _0x1fea0a={'where':{'id':_0x2f85e3[_0x08f0('0x64')]['id']},'attributes':['id',_0x08f0('0x7d')],'raw':!![]};var _0xbf7ea=![];return require('../../config/license/util')[_0x08f0('0x7e')]()[_0x08f0('0x21')](function(_0x3af0ce){if(_0x3af0ce){_0xbf7ea=_0x3af0ce['custom'];}})['then'](function(){return db[_0x08f0('0x42')]['find'](_0x1fea0a);})['then'](handleEntityNotFound(_0x30a96c,null))['then'](function(_0x105c39){if(_0x105c39){if(!_[_0x08f0('0x7f')](_0x105c39[_0x08f0('0x7d')])){if(fs[_0x08f0('0x80')](path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x81'),_0x105c39[_0x08f0('0x7d')]))&&_0xbf7ea){_0xce3cf4=path[_0x08f0('0x7a')](config['root'],_0x08f0('0x81'),_0x105c39['sitepic']);}}return _0x30a96c[_0x08f0('0x82')](_0xce3cf4);}})[_0x08f0('0x2b')](handleError(_0x30a96c,null));};exports[_0x08f0('0x83')]=function(_0x313d5c,_0x265c51,_0x55ae54){var _0x388391=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x84'));var _0x40416e={'where':{'id':_0x313d5c[_0x08f0('0x64')]['id']},'attributes':['id',_0x08f0('0x74')],'raw':!![]};return db[_0x08f0('0x42')][_0x08f0('0x65')](_0x40416e)[_0x08f0('0x21')](handleEntityNotFound(_0x265c51,null))[_0x08f0('0x21')](function(_0x3c29ee){if(_0x3c29ee){if(!_['isNil'](_0x3c29ee['agentAvatar'])){if(fs['existsSync'](path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x85'),_0x3c29ee['agentAvatar']))){_0x388391=path['join'](config[_0x08f0('0x7b')],_0x08f0('0x85'),_0x3c29ee[_0x08f0('0x74')]);}}return _0x265c51['download'](_0x388391);}})[_0x08f0('0x2b')](handleError(_0x265c51,null));};exports['getCustomerAvatar']=function(_0x256f87,_0x5f4bf7,_0x2cd607){var _0x4378e7=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x86'));var _0x2bc5b6={'where':{'id':_0x256f87[_0x08f0('0x64')]['id']},'attributes':['id',_0x08f0('0x76'),'showCustomerAvatar'],'raw':!![]};return db[_0x08f0('0x42')][_0x08f0('0x65')](_0x2bc5b6)['then'](handleEntityNotFound(_0x5f4bf7,null))[_0x08f0('0x21')](function(_0x2c2225){if(_0x2c2225){if(!_[_0x08f0('0x7f')](_0x2c2225[_0x08f0('0x76')])){if(fs[_0x08f0('0x80')](path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x85'),_0x2c2225[_0x08f0('0x76')]))&&_0x2c2225[_0x08f0('0x87')]){_0x4378e7=path['join'](config['root'],_0x08f0('0x85'),_0x2c2225[_0x08f0('0x76')]);}}return _0x5f4bf7['download'](_0x4378e7);}})[_0x08f0('0x2b')](handleError(_0x5f4bf7,null));};exports[_0x08f0('0x88')]=function(_0xd3c2e7,_0x57c52f,_0x51c371){var _0xca10e0=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x89'));var _0x456177={'where':{'id':_0xd3c2e7[_0x08f0('0x64')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x08f0('0x42')]['find'](_0x456177)[_0x08f0('0x21')](handleEntityNotFound(_0x57c52f,null))[_0x08f0('0x21')](function(_0x333e2c){if(_0x333e2c){if(!_[_0x08f0('0x7f')](_0x333e2c[_0x08f0('0x78')])){if(fs[_0x08f0('0x80')](path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],_0x08f0('0x85'),_0x333e2c[_0x08f0('0x78')]))){_0xca10e0=path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],'server/files/images/avatars/',_0x333e2c['systemAvatar']);}}return _0x57c52f[_0x08f0('0x82')](_0xca10e0);}})[_0x08f0('0x2b')](handleError(_0x57c52f,null));};exports[_0x08f0('0x8a')]=function(_0x55338b,_0x4d24e0,_0x4e36ad){var _0x2d950c=require(_0x08f0('0x8b'));var _0x3e1605=new _0x2d950c();var _0x190e07=_0x3e1605[_0x08f0('0x8c')](_0x55338b['headers'][_0x08f0('0x8d')])[_0x08f0('0x8e')]();var _0x4e2288={'body':_0x55338b['body'],'channel':_0x08f0('0x8f')};var _0x446b9c=[];var _0x4e8dd1=[];var _0x46ac8c={};var _0x207d59=![];return db[_0x08f0('0x90')][_0x08f0('0x66')]()[_0x08f0('0x21')](function(_0x5e6258){if(!_0x5e6258){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))]('no\x20available\x20attributes');}_0x446b9c=_[_0x08f0('0x93')](_[_0x08f0('0x48')](_0x5e6258),[_0x08f0('0x94'),_0x08f0('0x95')]);_0x4e8dd1=_['difference'](_[_0x08f0('0x48')](_0x5e6258),[_0x08f0('0x94'),_0x08f0('0x95'),'CompanyId',_0x08f0('0x96')]);if(_0x55338b[_0x08f0('0x5e')]['id']){delete _0x55338b[_0x08f0('0x5e')]['id'];}if(_['isNil'](_0x55338b[_0x08f0('0x5e')][_0x08f0('0x97')])){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0x98'));}if(_[_0x08f0('0x7f')](_0x55338b[_0x08f0('0x5e')][_0x08f0('0x5e')])||_0x55338b[_0x08f0('0x5e')][_0x08f0('0x5e')]===''){throw new db['Sequelize'][(_0x08f0('0x92'))](_0x08f0('0x99'));}if(_['isNil'](_0x55338b[_0x08f0('0x5e')][_0x08f0('0x9a')])){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0x9b')+_0x4e8dd1);}if(!_['includes'](_0x4e8dd1,_0x55338b[_0x08f0('0x5e')][_0x08f0('0x9a')])){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e8dd1);}_0x46ac8c[_0x55338b[_0x08f0('0x5e')][_0x08f0('0x9a')]]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0x97')];})[_0x08f0('0x21')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x55338b[_0x08f0('0x64')]['id']},'include':[{'model':db[_0x08f0('0x9c')],'as':_0x08f0('0x9d'),'include':[{'model':db['CmContact'],'as':_0x08f0('0x9e'),'where':_0x46ac8c,'limit':0x1,'order':[[_0x08f0('0x95'),'DESC']]}]},{'model':db[_0x08f0('0x9f')],'as':'Applications'}]});})[_0x08f0('0x21')](handleEntityNotFound(_0x4d24e0,null))[_0x08f0('0x21')](function(_0x29fc98){if(_0x29fc98&&_0x29fc98[_0x08f0('0x9d')]){_0x4e2288[_0x08f0('0xa0')]=_0x29fc98;_0x4e2288[_0x08f0('0xa1')]=_0x29fc98[_0x08f0('0xa2')];_0x4e2288[_0x08f0('0xa3')]=_0x29fc98['List'];_0x4e2288['applications']=_[_0x08f0('0xa4')](_0x4e2288[_0x08f0('0xa1')],['priority'],[_0x08f0('0xa5')]);if(_0x4e2288[_0x08f0('0xa0')][_0x08f0('0xa2')]){delete _0x4e2288[_0x08f0('0xa0')]['Applications'];}if(_0x4e2288['account'][_0x08f0('0x9d')]&&_0x4e2288[_0x08f0('0xa0')][_0x08f0('0x9d')][_0x08f0('0x9e')]['length']){return _0x4e2288[_0x08f0('0xa0')][_0x08f0('0x9d')][_0x08f0('0x9e')][0x0];}var _0x322cc6=_[_0x08f0('0xa6')](_0x55338b[_0x08f0('0x5e')],{'firstName':_0x55338b[_0x08f0('0x5e')][_0x08f0('0x97')],'ListId':_0x29fc98['ListId']});_0x322cc6[_0x55338b['body'][_0x08f0('0x9a')]]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0x97')];return db[_0x08f0('0x90')][_0x08f0('0x5d')](_0x322cc6,{'fields':_0x446b9c,'raw':!![]});}})['then'](handleEntityNotFound(_0x4d24e0,null))[_0x08f0('0x21')](function(_0x296cc4){_0x4e2288['contact']=_0x296cc4;var _0x1856a3=_0x55338b[_0x08f0('0x5e')][_0x08f0('0xa7')];if(_0x55338b[_0x08f0('0xa8')][_0x08f0('0xa9')]){_0x1856a3=_0x55338b['headers'][_0x08f0('0xa9')];}else if(_0x55338b[_0x08f0('0xa8')][_0x08f0('0xaa')]){_0x1856a3=_[_0x08f0('0xab')](_0x55338b[_0x08f0('0xa8')][_0x08f0('0xaa')][_0x08f0('0xac')](','));}if(_0x296cc4){var _0xd19d03={'ContactId':_0x296cc4['id'],'ChatWebsiteId':_0x55338b[_0x08f0('0x64')]['id'],'from':(_0x296cc4['firstName']||'')+'\x20'+(_0x296cc4['lastName']||''),'customerIp':_0x1856a3,'customerPort':_0x55338b['headers'][_0x08f0('0xad')]?_0x55338b[_0x08f0('0xa8')]['x-real-port']:null,'referer':_0x55338b['body'][_0x08f0('0xae')],'browserName':_0x190e07[_0x08f0('0xaf')][_0x08f0('0x47')]&&_0x190e07[_0x08f0('0xaf')][_0x08f0('0xb0')]?util[_0x08f0('0xb1')]('%s\x20%s',_0x190e07['browser']['name'],_0x190e07[_0x08f0('0xaf')][_0x08f0('0xb0')]):_0x08f0('0xb2'),'browserVersion':_0x190e07[_0x08f0('0xaf')][_0x08f0('0xb0')]||_0x08f0('0xb2'),'osName':util['format'](_0x08f0('0xb3'),_0x190e07['os'][_0x08f0('0x47')],_0x190e07['os'][_0x08f0('0xb0')]),'osVersion':_0x190e07['os']['version'],'deviceModel':_0x190e07[_0x08f0('0xb4')][_0x08f0('0x4c')]&&_0x190e07[_0x08f0('0xb4')][_0x08f0('0xb5')]?util[_0x08f0('0xb1')](_0x08f0('0xb6'),_0x190e07['device']['model'],_0x190e07[_0x08f0('0xb4')][_0x08f0('0xb5')],_0x190e07['device']['type']):null,'deviceVendor':_0x190e07[_0x08f0('0xb4')][_0x08f0('0xb5')],'deviceType':_0x190e07[_0x08f0('0xb4')]['type'],'formData':JSON[_0x08f0('0x26')](_0x55338b['body'])};var _0x2829d4={'ChatWebsiteId':_0x55338b[_0x08f0('0x64')]['id'],'closed':![]};if(_0x55338b['body'][_0x08f0('0xb7')]){_0x2829d4['threadId']=_0x55338b[_0x08f0('0x5e')]['threadId'];return db[_0x08f0('0xb8')][_0x08f0('0x65')]({'where':_0x2829d4})[_0x08f0('0x21')](function(_0x242eef){if(_0x242eef){return[_0x242eef,![]];}_0xd19d03[_0x08f0('0xb7')]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0xb7')];_0xd19d03[_0x08f0('0xb9')]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0xb9')];return db[_0x08f0('0xb8')][_0x08f0('0x5d')](_0xd19d03)[_0x08f0('0x21')](function(_0x2b5c6b){return[_0x2b5c6b,!![]];});});}_0x2829d4[_0x08f0('0xba')]=_0x296cc4['id'];if(_0x55338b[_0x08f0('0x5e')][_0x08f0('0xbb')]&&_0x55338b[_0x08f0('0x5e')][_0x08f0('0xbb')]['id']){_0x2829d4['id']=_0x55338b[_0x08f0('0x5e')]['interaction']['id'];return db['ChatInteraction'][_0x08f0('0x65')]({'where':_0x2829d4})[_0x08f0('0x21')](function(_0x549227){if(_0x549227){return[_0x549227,![]];}return db['ChatInteraction'][_0x08f0('0x5d')](_0xd19d03)[_0x08f0('0x21')](function(_0x3043da){return[_0x3043da,!![]];});});}return db[_0x08f0('0xb8')]['create'](_0xd19d03)[_0x08f0('0x21')](function(_0x3db0ef){return[_0x3db0ef,!![]];});}})['spread'](function(_0x30d6a3,_0x2c8fe5){if(_0x30d6a3){_0x207d59=_0x2c8fe5;if(!_0x2c8fe5){var _0x143b34={'from':(_0x4e2288[_0x08f0('0xbc')][_0x08f0('0xbd')]||'')+'\x20'+(_0x4e2288[_0x08f0('0xbc')]['lastName']||'')};if(_0x55338b['body'][_0x08f0('0xb7')]&&_0x55338b[_0x08f0('0x5e')]['messageId']&&_0x55338b[_0x08f0('0x5e')]['threadId']!=_0x55338b['body'][_0x08f0('0xbe')]){_0x143b34[_0x08f0('0xb7')]=_0x55338b[_0x08f0('0x5e')][_0x08f0('0xbe')];}return _0x30d6a3[_0x08f0('0x37')](_0x143b34);}else{return _0x30d6a3;}}})[_0x08f0('0x21')](function(_0x10164a){_0x4e2288[_0x08f0('0xbb')]=_0x10164a[_0x08f0('0x39')]({'plain':!![]});_0x4e2288[_0x08f0('0xbb')][_0x08f0('0xbf')]=_0x207d59;if(_0x4e2288[_0x08f0('0xbb')][_0x08f0('0xbf')]){if(_0x4e2288[_0x08f0('0xa0')][_0x08f0('0xc0')]){_0x4e2288['applications'][_0x08f0('0xc1')]({'id':0x0,'priority':_0x4e2288[_0x08f0('0xa1')][_0x08f0('0x4d')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x08f0('0xc2')});}}return db[_0x08f0('0xc3')][_0x08f0('0x5d')]({'body':_0x55338b['body']['body'],'ChatWebsiteId':_0x55338b[_0x08f0('0x64')]['id'],'ChatInteractionId':_0x10164a['id'],'direction':'in','ContactId':_0x4e2288['contact']['id'],'AttachmentId':_0x55338b[_0x08f0('0x5e')][_0x08f0('0xc4')]});})[_0x08f0('0x21')](function(_0x2cffe3){_0x4e2288['message']=_0x2cffe3;if(_0x4e2288[_0x08f0('0xbb')][_0x08f0('0xc5')]){return db[_0x08f0('0xc6')][_0x08f0('0x65')]({'attributes':['id',_0x08f0('0x47')],'where':{'id':_0x4e2288[_0x08f0('0xbb')][_0x08f0('0xc5')]}})['then'](function(_0x2b5685){if(_0x2b5685){_0x4e2288['applications'][_0x08f0('0xc7')]({'id':0x0,'priority':0x0,'app':_0x08f0('0xc8'),'appdata':_0x2b5685[_0x08f0('0x47')]+','+(_0x4e2288[_0x08f0('0xa0')][_0x08f0('0xc9')]||0xa),'interval':_0x08f0('0xc2')});_0x4e2288[_0x08f0('0xca')]=!![];}return respondWithRpcPromise(_0x08f0('0xcb'),_0x08f0('0xcc'),_0x4e2288);});}return respondWithRpcPromise(_0x08f0('0xcb'),'startRouting',_0x4e2288);})[_0x08f0('0x21')](function(_0x1a5752){respondWithRpcPromise('EventManager',_0x08f0('0xcd'),{'event':_0x08f0('0x8a'),'message':_0x1a5752},client9002);return _0x1a5752;})[_0x08f0('0x21')](respondWithResult(_0x4d24e0,null))[_0x08f0('0x2b')](handleError(_0x4d24e0,null));};exports[_0x08f0('0xce')]=function(_0xf2ce9e,_0x47680c,_0x1b8dc3){var _0x224563,_0x5deb81,_0x525a1c;var _0x56a946=[];var _0xfbf183=[];var _0xe95793={};var _0x303532=_0xf2ce9e[_0x08f0('0xcf')]||[];var _0xd5b04e=[];var _0x468d71;return db['CmContact'][_0x08f0('0x66')]()[_0x08f0('0x21')](function(_0x4a74e8){if(!_0x4a74e8){throw new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0xd0'));}_0xfbf183=_[_0x08f0('0x93')](_[_0x08f0('0x48')](_0x4a74e8),[_0x08f0('0x94'),_0x08f0('0x95')]);_0x56a946=_['difference'](_['keys'](_0x4a74e8),[_0x08f0('0x94'),_0x08f0('0x95'),'CompanyId',_0x08f0('0x96')]);if(_0xf2ce9e[_0x08f0('0x5e')]['id']){delete _0xf2ce9e[_0x08f0('0x5e')]['id'];}if(_[_0x08f0('0x7f')](_0xf2ce9e['body'][_0x08f0('0x97')])){throw _0x47680c[_0x08f0('0x2e')](0x1f4)['send'](new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0xf2ce9e['body']['body'])||_0xf2ce9e['body'][_0x08f0('0x5e')]===''){throw _0x47680c[_0x08f0('0x2e')](0x1f4)[_0x08f0('0x3d')](new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0x99')));}if(_[_0x08f0('0x7f')](_0xf2ce9e[_0x08f0('0x5e')]['mapKeyOffline'])){throw _0x47680c[_0x08f0('0x2e')](0x1f4)[_0x08f0('0x3d')](new db[(_0x08f0('0x91'))]['ValidationError'](_0x08f0('0xd1')+_0x56a946));}if(!_[_0x08f0('0xd2')](_0x56a946,_0xf2ce9e['body'][_0x08f0('0xd3')])){throw _0x47680c[_0x08f0('0x2e')](0x1f4)[_0x08f0('0x3d')](new db[(_0x08f0('0x91'))][(_0x08f0('0x92'))](_0x08f0('0xd4')+_0x56a946));}_0xe95793[_0xf2ce9e[_0x08f0('0x5e')][_0x08f0('0xd3')]]=_0xf2ce9e[_0x08f0('0x5e')][_0x08f0('0x97')];})[_0x08f0('0x21')](function(){return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0xf2ce9e[_0x08f0('0x64')]['id']},'include':[{'model':db[_0x08f0('0x9c')],'as':'List'},{'model':db[_0x08f0('0xd5')],'as':'MailAccount'}]});})[_0x08f0('0x21')](handleEntityNotFound(_0x47680c,null))[_0x08f0('0x21')](function(_0x514acc){if(_0x514acc&&_0x514acc[_0x08f0('0x9d')]){_0x5deb81=_0x514acc;var _0x4c3f03=_[_0x08f0('0xa6')](_0xf2ce9e[_0x08f0('0x5e')],{'firstName':_0xf2ce9e[_0x08f0('0x5e')]['from'],'phone':_0xf2ce9e[_0x08f0('0x5e')][_0x08f0('0x97')],'ListId':_0x514acc['ListId']});_0x4c3f03[_0xf2ce9e[_0x08f0('0x5e')]['mapKeyOffline']]=_0xf2ce9e[_0x08f0('0x5e')][_0x08f0('0x97')];return db[_0x08f0('0x90')][_0x08f0('0xd6')]({'where':_0xe95793,'defaults':_0x4c3f03});}})[_0x08f0('0xd7')](function(_0x570e3a){if(_0x570e3a){_0x525a1c=_0x570e3a;var _0x3ad43b=fs[_0x08f0('0xd8')](path['join'](config[_0x08f0('0x7b')],'server/files/templates/chatOfflineMessage.ejs'),_0x08f0('0xd9'));var _0x14b029=ejs['render'](_0x3ad43b,{'body':_['toPairs'](_0xf2ce9e['body'][_0x08f0('0x5e')]),'bodyTitle':_0x5deb81[_0x08f0('0xda')]});return db[_0x08f0('0xdb')][_0x08f0('0x5d')]({'body':_0x14b029,'ContactId':_0x570e3a['id'],'ChatWebsiteId':_0x5deb81['id']});}})[_0x08f0('0x21')](function(_0x2ee567){_0x468d71=_0x2ee567;if(_0x303532[_0x08f0('0x4d')]){var _0x5165d6=_0x303532[_0x08f0('0x41')](function(_0x37c190){return{'name':_0x37c190[_0x08f0('0xdc')],'basename':_0x37c190[_0x08f0('0x73')],'type':_0x37c190[_0x08f0('0xdd')],'ChatOfflineMessageId':_0x2ee567['id']};});_0xd5b04e=_0x5165d6[_0x08f0('0x41')](_0xb5e998=>{var _0x169c28={'filename':_0xb5e998['name'],'path':path[_0x08f0('0x7a')](config[_0x08f0('0x7b')],'server',_0x08f0('0xcf'),_0x08f0('0xde'),'offline-chat',_0xb5e998[_0x08f0('0xdf')])};return _0x169c28;});if(!_0x5deb81[_0x08f0('0xe0')]){return db[_0x08f0('0xe1')][_0x08f0('0xe2')](function(_0x23fe4b){return db[_0x08f0('0xe3')]['bulkCreate'](_0x5165d6,{'transaction':_0x23fe4b});});}}})[_0x08f0('0x21')](function(){if(_0x468d71){_0x224563=_0x468d71;return db[_0x08f0('0xd5')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x08f0('0xe4')],'as':'Smtp','raw':!![]}]});}})[_0x08f0('0x21')](function(_0x31de15){if(_0x31de15&&_0x31de15[_0x08f0('0xe5')]&&_0x5deb81['forwardOffline']&&_0x5deb81[_0x08f0('0xe6')]){var _0x30a22d={'tls':{'rejectUnauthorized':![]}};if(_0x31de15[_0x08f0('0xe5')]['service']){_0x30a22d[_0x08f0('0xe7')]=_0x31de15[_0x08f0('0xe5')][_0x08f0('0xe7')];}else{_0x30a22d['host']=_0x31de15['Smtp'][_0x08f0('0xe8')];_0x30a22d[_0x08f0('0xe9')]=_0x31de15['Smtp']['port'];_0x30a22d['secure']=_0x31de15[_0x08f0('0xe5')][_0x08f0('0xea')];}if(_0x31de15[_0x08f0('0xe5')][_0x08f0('0xeb')]){_0x30a22d[_0x08f0('0xec')]={'user':_0x31de15[_0x08f0('0xe5')][_0x08f0('0x5f')],'pass':_0x31de15[_0x08f0('0xe5')][_0x08f0('0xed')]};}return respondWithRpcPromise(_0x08f0('0xee'),'sendMail',{'account':_0x30a22d,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x31de15['name'],_0x31de15['email']||_0x31de15[_0x08f0('0xe5')][_0x08f0('0x5f')]),'to':_0x5deb81['forwardOfflineAddress'],'subject':_0x5deb81['offlineMessageSubject'],'html':_0x224563[_0x08f0('0x5e')],'attachments':_0xd5b04e}},client9003)[_0x08f0('0x21')](function(){return _0x224563;})['catch'](function(_0xf74233){console[_0x08f0('0x27')](_0xf74233);});}})['then'](function(){if(_0x5deb81&&_0x5deb81[_0x08f0('0xe0')]&&_0x5deb81[_0x08f0('0xef')]){var _0x266631=[];if(_0x303532[_0x08f0('0x4d')]){_0x266631=_0x303532[_0x08f0('0x41')](function(_0x186278){return{'name':_0x186278[_0x08f0('0xdc')],'basename':_0x186278['filename'],'type':_0x186278[_0x08f0('0xdd')],'ChatOfflineMessageId':_0x468d71['id']};});}var _0xe306c6;if(!_[_0x08f0('0x7f')](_0x5deb81['subjectOffline'])){var _0x22e74d=_[_0x08f0('0x41')](_0xf2ce9e[_0x08f0('0x5e')],function(_0x1b1332){return _0x1b1332;});var _0x358910=_[_0x08f0('0xf0')](_0x22e74d)[0x0];var _0x2e2f42=_[_0x08f0('0xf1')](_0x358910,function(_0xab0e39){return _0xab0e39;});_0xe306c6=_0x2e2f42[0x1][_0x5deb81[_0x08f0('0xf2')]];}var _0x14e84e={'from':_0x525a1c[_0x08f0('0xf3')],'firstName':_0x525a1c[_0x08f0('0xbd')],'lastName':_0x525a1c['lastName'],'mapKey':_0x08f0('0xf3'),'message':{'from':_0x525a1c[_0x08f0('0xf3')],'to':_0x5deb81[_0x08f0('0xd5')][_0x08f0('0xf3')],'cc':'','subject':_[_0x08f0('0x7f')](_0xe306c6)?_0x5deb81[_0x08f0('0xf4')]:_0xe306c6,'messageId':'','sentAt':new Date(),'attach':_0x266631[_0x08f0('0x4d')],'attachments':_0x266631,'originChannel':_0x08f0('0xf5'),'ChatWebsiteId':_0x5deb81['id'],'ChatOfflineMessageId':_0x224563['id'],'originTo':_0x5deb81[_0x08f0('0xd5')][_0x08f0('0xf3')]},'body':_0x224563[_0x08f0('0x5e')]};var _0x4b8bea={'account':{'id':_0x5deb81['MailAccountId']},'body':_0x14e84e,'log':_0x08f0('0xf6')};return respondWithRpcPromise(_0x08f0('0xf6'),_0x08f0('0xf7'),_0x4b8bea,client9001)['then'](function(){return _0x224563;})[_0x08f0('0x2b')](function(_0x7a9015){console[_0x08f0('0x27')](_0x7a9015);});}return;})['then'](function(){if(_0x224563){return _0x224563;}})[_0x08f0('0x21')](respondWithResult(_0x47680c,null))[_0x08f0('0x2b')](function(_0x1ea3fc){console[_0x08f0('0x27')](_0x08f0('0x2b'),_0x1ea3fc);for(var _0x53bc15 of _0x303532){var _0x197ecb=path[_0x08f0('0x7a')](config['root'],_0x08f0('0xf8'),_0x08f0('0xcf'),_0x08f0('0xde'),'offline-chat',_0x53bc15[_0x08f0('0x73')]);fs_extra['remove'](_0x197ecb)[_0x08f0('0x2b')](function(_0x21e6a3){console[_0x08f0('0x27')](_0x08f0('0xf9'),_0x197ecb,_0x21e6a3);});}});};exports['addInteraction']=function(_0x174777,_0xdcef0,_0x2ea229){return db[_0x08f0('0xb8')][_0x08f0('0x65')]({'where':{'id':_0x174777[_0x08f0('0x64')]['id']}})['then'](handleEntityNotFound(_0xdcef0,null))[_0x08f0('0x21')](function(_0x31f839){if(_0x31f839){return _0x31f839['addInteraction'](_0x174777[_0x08f0('0x5e')][_0x08f0('0x71')],_[_0x08f0('0xfa')](_0x174777['body'],[_0x08f0('0x71'),'id'])||{});}})['then'](respondWithResult(_0xdcef0,null))[_0x08f0('0x2b')](handleError(_0xdcef0,null));};exports[_0x08f0('0xfb')]=function(_0x3ac299,_0x12defc,_0x51b033){var _0x394ef3={'raw':![],'where':{}};var _0x1ac665={};var _0x49b94b={'count':0x0,'rows':[]};return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x3ac299[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x12defc,null))[_0x08f0('0x21')](function(_0x4ff617){if(_0x4ff617){_0x1ac665[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0xb8')][_0x08f0('0x43')]);_0x1ac665[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x3ac299[_0x08f0('0x49')]);_0x1ac665['filters']=_[_0x08f0('0x4a')](_0x1ac665['model'],_0x1ac665[_0x08f0('0x49')]);_0x394ef3['attributes']=_[_0x08f0('0x4a')](_0x1ac665[_0x08f0('0x4c')],qs['fields'](_0x3ac299['query'][_0x08f0('0x5c')]));_0x394ef3[_0x08f0('0x4b')]=_0x394ef3['attributes'][_0x08f0('0x4d')]?_0x394ef3[_0x08f0('0x4b')]:_0x1ac665[_0x08f0('0x4c')];if(!_0x3ac299[_0x08f0('0x49')][_0x08f0('0x4e')](_0x08f0('0x4f'))){_0x394ef3[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x3ac299[_0x08f0('0x49')][_0x08f0('0x32')]);_0x394ef3[_0x08f0('0x30')]=qs['offset'](_0x3ac299[_0x08f0('0x49')][_0x08f0('0x30')]);}_0x394ef3[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x3ac299[_0x08f0('0x49')][_0x08f0('0x51')]);_0x394ef3['where']=qs[_0x08f0('0x53')](_[_0x08f0('0x54')](_0x3ac299['query'],_0x1ac665[_0x08f0('0x53')]));_0x394ef3[_0x08f0('0x52')][_0x08f0('0x68')]=_0x4ff617['id'];if(_0x3ac299[_0x08f0('0x49')][_0x08f0('0x55')]){_0x394ef3[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x394ef3[_0x08f0('0x52')],{'$or':_['map'](_0x394ef3[_0x08f0('0x4b')],function(_0x56dee7){var _0xf2139={};_0xf2139[_0x56dee7]={'$like':'%'+_0x3ac299['query'][_0x08f0('0x55')]+'%'};return _0xf2139;})});}_0x394ef3=_[_0x08f0('0x56')]({},_0x394ef3,_0x3ac299[_0x08f0('0x58')]);return db[_0x08f0('0xb8')]['count']({'where':_0x394ef3['where']})[_0x08f0('0x21')](function(_0x5ca733){_0x49b94b[_0x08f0('0x33')]=_0x5ca733;if(_0x3ac299[_0x08f0('0x49')]['includeAll']){_0x394ef3[_0x08f0('0x59')]=[{'model':db[_0x08f0('0x90')],'as':_0x08f0('0xfc'),'required':![]},{'model':db[_0x08f0('0xc6')],'as':_0x08f0('0xfd'),'attributes':[_0x08f0('0x47'),_0x08f0('0xfe'),_0x08f0('0xff')],'required':![]},{'model':db['Tag'],'as':_0x08f0('0x100'),'attributes':['id',_0x08f0('0x47'),_0x08f0('0x101')],'where':_0x3ac299[_0x08f0('0x49')][_0x08f0('0x102')]?{'id':_0x3ac299[_0x08f0('0x49')][_0x08f0('0x102')]}:undefined,'required':_0x3ac299[_0x08f0('0x49')][_0x08f0('0x102')]?!![]:![]}];}return db[_0x08f0('0xb8')][_0x08f0('0x6f')](_0x394ef3);})['then'](function(_0x46a63c){_0x49b94b['rows']=_0x46a63c;return _0x49b94b;});}})[_0x08f0('0x21')](respondWithFilteredResult(_0x12defc,_0x394ef3))[_0x08f0('0x2b')](handleError(_0x12defc,null));};function iftimePromise(_0x3dd505,_0x454f83){return respondWithRpcPromise('Command',_0x08f0('0x103'),{'command':_0x454f83[_0x08f0('0x104')]?util[_0x08f0('0xb1')]('iftime\x20%s,%s',_0x3dd505[_0x08f0('0x105')],_0x454f83[_0x08f0('0x104')]):util[_0x08f0('0xb1')]('iftime\x20%s',_0x3dd505[_0x08f0('0x105')])},client9002)['then'](function(_0xc900e0){var _0xb795cd=_0xc900e0&&_0xc900e0['indexOf'](_0x08f0('0x106'))>=0x0?!![]:![];logger[_0x08f0('0x22')](_0x08f0('0x107'),_0x454f83['id'],_0x3dd505['id'],_0x3dd505[_0x08f0('0x105')],_0xb795cd?'ONLINE':_0x08f0('0x108'),_0x454f83[_0x08f0('0x104')]?_0x454f83[_0x08f0('0x104')]:_0x08f0('0x109'));return _0xb795cd;})[_0x08f0('0x2b')](function(_0x5e79cc){logger['error'](_0x08f0('0x107'),_0x454f83['id'],_0x3dd505['id'],_0x3dd505[_0x08f0('0x105')],util[_0x08f0('0x10a')](_0x5e79cc,{'showHidden':![],'depth':null}),_0x454f83[_0x08f0('0x104')]?_0x454f83['timezone']:_0x08f0('0x109'));return![];});}exports[_0x08f0('0x103')]=function(_0x38185c,_0x310364,_0x273a22){var _0x3be30c=0x0;var _0x3a0efc=0x0;var _0x2e7964=![];var _0x479153;var _0x3eb03c;return db['ChatWebsite']['find']({'where':{'id':_0x38185c[_0x08f0('0x64')]['id']},'include':[{'model':db[_0x08f0('0x10b')],'as':_0x08f0('0x10b'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x08f0('0x105')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x310364,null))[_0x08f0('0x21')](function(_0x47336b){if(_0x47336b){_0x479153=_0x47336b;return _0x47336b[_0x08f0('0x10c')]({'raw':!![]});}})[_0x08f0('0x21')](function(_0x300944){if(_0x479153){if(_0x300944){_0x3eb03c=_0x300944;}}return require(_0x08f0('0x1a'))[_0x08f0('0x7e')]();})[_0x08f0('0x21')](function(_0x244723){if(_0x244723){_0x3a0efc=_0x244723[_0x08f0('0x10d')];_0x2e7964=_0x244723[_0x08f0('0x10e')];}})['then'](function(){return db['ChatInteraction'][_0x08f0('0x33')]({'where':{'closed':![]}});})['then'](function(_0x13a735){_0x3be30c=_0x13a735;if(_0x3a0efc&&_0x13a735>_0x3a0efc){return db[_0x08f0('0x10f')][_0x08f0('0x6a')]({'where':{'id':0x1}})[_0x08f0('0x21')](function(_0x3f8f17){if(_0x3f8f17){_0x3f8f17[_0x08f0('0x110')](_0x08f0('0x111'));}});}})[_0x08f0('0x21')](function(){if(_0x479153['Interval']&&_0x479153[_0x08f0('0x10b')]['Intervals']){var _0x5b2af1=[];for(var _0x1b82ad=0x0;_0x1b82ad<_0x479153[_0x08f0('0x10b')][_0x08f0('0x112')][_0x08f0('0x4d')];_0x1b82ad++){var _0x5281f6=_0x479153['Interval'][_0x08f0('0x112')][_0x1b82ad][_0x08f0('0x39')]({'plain':!![]});_0x5b2af1[_0x08f0('0xc1')](iftimePromise(_0x5281f6,_0x479153));}return BPromise[_0x08f0('0x113')](_0x5b2af1)[_0x08f0('0x21')](function(_0x1feb5b){return _[_0x08f0('0x114')](_0x1feb5b);});}else{return!![];}})[_0x08f0('0x21')](function(_0x442bd8){var _0x1b409a=fs['readFileSync'](path['join'](config[_0x08f0('0x7b')],_0x08f0('0x115')),'utf8');var _0x3eb8a3={'remote':_0x479153[_0x08f0('0x116')],'query':querystring['stringify'](_[_0x08f0('0x56')](_0x479153['get']({'plain':!![]}),{'customerIp':_0x38185c[_0x08f0('0xa8')][_0x08f0('0xaa')]||_0x38185c[_0x08f0('0xa8')][_0x08f0('0x117')]||_0x38185c[_0x08f0('0x118')][_0x08f0('0x119')]||_0x38185c['ip'],'referer':_0x38185c[_0x08f0('0xa8')][_0x08f0('0xae')],'openedInteractions':_0x3be30c,'maxInteractions':_0x3a0efc,'virtual':_0x2e7964[_0x08f0('0x10d')],'online':_0x442bd8,'custom':_0x2e7964}))['replace'](/'/g,'\x5c\x27')};_0x310364[_0x08f0('0x3d')](ejs[_0x08f0('0x11a')](Mustache[_0x08f0('0x11a')](_0x1b409a,_0x3eb8a3),{'proactiveActions':_0x3eb03c,'alignment':_0x479153[_0x08f0('0x11b')],'verticalAlignment':_0x479153[_0x08f0('0x11c')],'div_color':_0x479153[_0x08f0('0x101')],'text_color':_0x479153[_0x08f0('0x11d')],'button_color':_0x479153[_0x08f0('0x11e')],'background_color':_0x479153[_0x08f0('0x11f')]}));})[_0x08f0('0x2b')](handleError(_0x310364,null));};exports['addApplications']=function(_0x5c3fd1,_0x3583a7,_0x5adf94){return db['ChatWebsite']['findOne']({'where':{'id':_0x5c3fd1[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x3583a7,null))[_0x08f0('0x21')](function(_0x98e192){if(_0x98e192){return db[_0x08f0('0xe1')][_0x08f0('0xe2')](function(_0x4237a1){return db[_0x08f0('0x9f')]['destroy']({'where':{'ChatWebsiteId':_0x5c3fd1[_0x08f0('0x64')]['id']},'transaction':_0x4237a1})[_0x08f0('0x21')](function(_0x4b11a0){var _0x29fa9d=_[_0x08f0('0x41')](_0x5c3fd1[_0x08f0('0x5e')],function(_0x1587bf){_0x1587bf[_0x08f0('0x68')]=_0x5c3fd1[_0x08f0('0x64')]['id'];return _0x1587bf;});return db[_0x08f0('0x9f')]['bulkCreate'](_0x29fa9d,{'transaction':_0x4237a1});});})[_0x08f0('0x21')](function(){return db[_0x08f0('0x9f')][_0x08f0('0x120')]({'where':{'ChatWebsiteId':_0x5c3fd1[_0x08f0('0x64')]['id']},'order':_0x08f0('0x121')});});}})[_0x08f0('0x21')](respondWithResult(_0x3583a7,null))['catch'](handleError(_0x3583a7,null));};exports['getApplications']=function(_0x1fbce6,_0x18b9a6,_0x386344){var _0x121198={};var _0x3ca093={};var _0x5c2001;var _0x265cee;return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x1fbce6['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x18b9a6,null))[_0x08f0('0x21')](function(_0x52a3d7){if(_0x52a3d7){_0x5c2001=_0x52a3d7;_0x3ca093[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db['ChatApplication'][_0x08f0('0x43')]);_0x3ca093[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x1fbce6[_0x08f0('0x49')]);_0x3ca093['filters']=_[_0x08f0('0x4a')](_0x3ca093[_0x08f0('0x4c')],_0x3ca093['query']);_0x121198[_0x08f0('0x4b')]=_['intersection'](_0x3ca093[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x1fbce6[_0x08f0('0x49')]['fields']));_0x121198[_0x08f0('0x4b')]=_0x121198[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x121198[_0x08f0('0x4b')]:_0x3ca093[_0x08f0('0x4c')];_0x121198[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x51')]);_0x121198['where']=qs['filters'](_[_0x08f0('0x54')](_0x1fbce6[_0x08f0('0x49')],_0x3ca093[_0x08f0('0x53')]));if(_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x55')]){_0x121198[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x121198[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x121198[_0x08f0('0x4b')],function(_0x1917ce){var _0x6cf3ff={};_0x6cf3ff[_0x1917ce]={'$like':'%'+_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x55')]+'%'};return _0x6cf3ff;})});}_0x121198=_['merge']({},_0x121198,_0x1fbce6[_0x08f0('0x58')]);return _0x5c2001[_0x08f0('0x122')](_0x121198);}})[_0x08f0('0x21')](function(_0x494431){if(_0x494431){_0x265cee=_0x494431[_0x08f0('0x4d')];if(!_0x1fbce6[_0x08f0('0x49')]['hasOwnProperty'](_0x08f0('0x4f'))){_0x121198[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x32')]);_0x121198[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x1fbce6[_0x08f0('0x49')][_0x08f0('0x30')]);}return _0x5c2001['getApplications'](_0x121198);}})[_0x08f0('0x21')](function(_0x4e61ad){if(_0x4e61ad){return _0x4e61ad?{'count':_0x265cee,'rows':_0x4e61ad}:null;}})[_0x08f0('0x21')](respondWithResult(_0x18b9a6,null))[_0x08f0('0x2b')](handleError(_0x18b9a6,null));};exports[_0x08f0('0x123')]=function(_0x210d45,_0x2822b3,_0x16decd){return db['chatProactiveAction'][_0x08f0('0x65')]({'where':{'id':_0x210d45[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x2822b3,null))[_0x08f0('0x21')](function(_0x4120b7){if(_0x4120b7){return _0x4120b7[_0x08f0('0x123')](_0x210d45['body'][_0x08f0('0x71')],_[_0x08f0('0xfa')](_0x210d45[_0x08f0('0x5e')],[_0x08f0('0x71'),'id'])||{});}})[_0x08f0('0x21')](respondWithResult(_0x2822b3,null))[_0x08f0('0x2b')](handleError(_0x2822b3,null));};exports[_0x08f0('0x10c')]=function(_0x24b701,_0x57285c,_0xd2c8c2){var _0x3d544a={};var _0x52789f={};var _0x1f8200;var _0x56d504;return db['ChatWebsite'][_0x08f0('0x6a')]({'where':{'id':_0x24b701['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x57285c,null))[_0x08f0('0x21')](function(_0x28ae9b){if(_0x28ae9b){_0x1f8200=_0x28ae9b;_0x52789f[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0x124')][_0x08f0('0x43')]);_0x52789f['query']=_[_0x08f0('0x48')](_0x24b701['query']);_0x52789f[_0x08f0('0x53')]=_[_0x08f0('0x4a')](_0x52789f[_0x08f0('0x4c')],_0x52789f['query']);_0x3d544a['attributes']=_['intersection'](_0x52789f[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x24b701[_0x08f0('0x49')][_0x08f0('0x5c')]));_0x3d544a['attributes']=_0x3d544a[_0x08f0('0x4b')][_0x08f0('0x4d')]?_0x3d544a[_0x08f0('0x4b')]:_0x52789f[_0x08f0('0x4c')];_0x3d544a[_0x08f0('0x50')]=qs[_0x08f0('0x51')](_0x24b701[_0x08f0('0x49')][_0x08f0('0x51')]);_0x3d544a[_0x08f0('0x52')]=qs[_0x08f0('0x53')](_[_0x08f0('0x54')](_0x24b701[_0x08f0('0x49')],_0x52789f[_0x08f0('0x53')]));if(_0x24b701['query']['filter']){_0x3d544a[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x3d544a[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x3d544a[_0x08f0('0x4b')],function(_0x53f42c){var _0x5db5d7={};_0x5db5d7[_0x53f42c]={'$like':'%'+_0x24b701[_0x08f0('0x49')]['filter']+'%'};return _0x5db5d7;})});}_0x3d544a=_[_0x08f0('0x56')]({},_0x3d544a,_0x24b701[_0x08f0('0x58')]);return _0x1f8200[_0x08f0('0x10c')](_0x3d544a);}})[_0x08f0('0x21')](function(_0x4b4ff0){if(_0x4b4ff0){_0x56d504=_0x4b4ff0['length'];if(!_0x24b701[_0x08f0('0x49')]['hasOwnProperty']('nolimit')){_0x3d544a[_0x08f0('0x32')]=qs[_0x08f0('0x32')](_0x24b701[_0x08f0('0x49')][_0x08f0('0x32')]);_0x3d544a['offset']=qs[_0x08f0('0x30')](_0x24b701[_0x08f0('0x49')]['offset']);}return _0x1f8200[_0x08f0('0x10c')](_0x3d544a);}})[_0x08f0('0x21')](function(_0x2a549c){if(_0x2a549c){return _0x2a549c?{'count':_0x56d504,'rows':_0x2a549c}:null;}})['then'](respondWithResult(_0x57285c,null))['catch'](handleError(_0x57285c,null));};exports[_0x08f0('0x125')]=function(_0x138d64,_0xd0df30,_0x59c533){var _0x2f145a=_0x138d64[_0x08f0('0x49')][_0x08f0('0x126')]===_0x08f0('0x127')?_0x08f0('0x128'):_0x08f0('0x129');return db[_0x08f0('0x42')][_0x08f0('0x65')]({'attributes':['id',_0x2f145a],'where':{'id':_0x138d64['params']['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0xd0df30,null))[_0x08f0('0x21')](function(_0x18d31e){if(_0x18d31e){var _0x3dcb33=_0x18d31e[_0x2f145a];var _0x2f714a=_0x3dcb33&&_0x3dcb33[_0x08f0('0x12a')]?_0x3dcb33[_0x08f0('0x12a')]:[];_0xd0df30[_0x08f0('0x3d')]({'fromKey':_[_0x08f0('0x7f')](_0x3dcb33[_0x08f0('0x12b')])?undefined:_0x3dcb33[_0x08f0('0x12b')],'count':_0x2f714a[_0x08f0('0x4d')],'rows':_0x2f714a});}})[_0x08f0('0x2b')](handleError(_0xd0df30,null));};exports[_0x08f0('0x12c')]=function(_0x3f0068,_0x5c1236,_0x3ed5d5){var _0x433289={'raw':![],'where':{}};var _0x97a19e={};var _0x3c6018={'count':0x0,'rows':[]};return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x3f0068[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x5c1236,null))[_0x08f0('0x21')](function(_0x2884cf){if(_0x2884cf){_0x97a19e['model']=_['keys'](db[_0x08f0('0xdb')]['rawAttributes']);_0x97a19e[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x3f0068[_0x08f0('0x49')]);_0x97a19e[_0x08f0('0x53')]=_[_0x08f0('0x4a')](_0x97a19e['model'],_0x97a19e[_0x08f0('0x49')]);_0x433289[_0x08f0('0x4b')]=_['intersection'](_0x97a19e[_0x08f0('0x4c')],qs[_0x08f0('0x5c')](_0x3f0068[_0x08f0('0x49')]['fields']));_0x433289['attributes']=_0x433289['attributes'][_0x08f0('0x4d')]?_0x433289[_0x08f0('0x4b')]:_0x97a19e[_0x08f0('0x4c')];if(!_0x3f0068[_0x08f0('0x49')][_0x08f0('0x4e')](_0x08f0('0x4f'))){_0x433289['limit']=qs['limit'](_0x3f0068[_0x08f0('0x49')][_0x08f0('0x32')]);_0x433289[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x3f0068['query'][_0x08f0('0x30')]);}_0x433289[_0x08f0('0x50')]=qs['sort'](_0x3f0068[_0x08f0('0x49')][_0x08f0('0x51')]);_0x433289['where']=qs[_0x08f0('0x53')](_['pick'](_0x3f0068[_0x08f0('0x49')],_0x97a19e[_0x08f0('0x53')]));_0x433289[_0x08f0('0x52')]['ChatWebsiteId']=_0x2884cf['id'];if(_0x3f0068[_0x08f0('0x49')][_0x08f0('0x55')]){_0x433289[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x433289['where'],{'$or':_[_0x08f0('0x41')](_0x433289[_0x08f0('0x4b')],function(_0x23e258){var _0x1043c7={};_0x1043c7[_0x23e258]={'$like':'%'+_0x3f0068['query'][_0x08f0('0x55')]+'%'};return _0x1043c7;})});}_0x433289=_[_0x08f0('0x56')]({},_0x433289,_0x3f0068[_0x08f0('0x58')]);return db['ChatOfflineMessage'][_0x08f0('0x33')]({'where':_0x433289[_0x08f0('0x52')]})[_0x08f0('0x21')](function(_0x50d652){_0x3c6018[_0x08f0('0x33')]=_0x50d652;if(_0x3f0068['query'][_0x08f0('0x6b')]){_0x433289['include']=[{'all':!![]}];}else{_0x433289[_0x08f0('0x59')]=[{'model':db[_0x08f0('0x90')],'as':'Contact','required':![]},{'model':db[_0x08f0('0xe3')],'as':_0x08f0('0x12d'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x433289);})['then'](function(_0x35ad5e){_0x3c6018[_0x08f0('0x5a')]=_0x35ad5e;return _0x3c6018;});}})[_0x08f0('0x21')](respondWithFilteredResult(_0x5c1236,_0x433289))[_0x08f0('0x2b')](handleError(_0x5c1236,null));};exports[_0x08f0('0x12e')]=function(_0x6b1700,_0x42f1db,_0x57f331){return db[_0x08f0('0x42')][_0x08f0('0x65')]({'where':{'id':_0x6b1700[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x42f1db,null))[_0x08f0('0x21')](function(_0x5b96ef){if(_0x5b96ef){return _0x5b96ef['addAgents'](_0x6b1700[_0x08f0('0x5e')][_0x08f0('0x71')],_[_0x08f0('0xfa')](_0x6b1700[_0x08f0('0x5e')],[_0x08f0('0x71'),'id'])||{})[_0x08f0('0xd7')](function(_0x2390e2){for(var _0x58f663=0x0;_0x58f663<_0x6b1700[_0x08f0('0x5e')][_0x08f0('0x71')][_0x08f0('0x4d')];_0x58f663+=0x1){socket[_0x08f0('0x12f')](_0x08f0('0x130'),{'UserId':Number(_0x6b1700[_0x08f0('0x5e')][_0x08f0('0x71')][_0x58f663]),'ChatWebsiteId':Number(_0x6b1700[_0x08f0('0x64')]['id'])});}return _0x2390e2;});}})[_0x08f0('0x21')](respondWithResult(_0x42f1db,null))[_0x08f0('0x2b')](handleError(_0x42f1db,null));};exports['removeAgents']=function(_0xd6db7e,_0x38b80d,_0x9e2e5c){return db['ChatWebsite'][_0x08f0('0x65')]({'where':{'id':_0xd6db7e['params']['id']}})['then'](handleEntityNotFound(_0x38b80d,null))[_0x08f0('0x21')](function(_0x175dd5){if(_0x175dd5){return _0x175dd5[_0x08f0('0x131')](_0xd6db7e['query'][_0x08f0('0x71')])[_0x08f0('0x21')](function(){if(_[_0x08f0('0x132')](_0xd6db7e[_0x08f0('0x49')][_0x08f0('0x71')])){for(var _0x181cb2=0x0;_0x181cb2<_0xd6db7e[_0x08f0('0x49')][_0x08f0('0x71')]['length'];_0x181cb2+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xd6db7e[_0x08f0('0x49')][_0x08f0('0x71')][_0x181cb2]),'ChatWebsiteId':Number(_0xd6db7e['params']['id'])});}}else{socket[_0x08f0('0x12f')](_0x08f0('0x133'),{'UserId':Number(_0xd6db7e[_0x08f0('0x49')][_0x08f0('0x71')]),'ChatWebsiteId':Number(_0xd6db7e[_0x08f0('0x64')]['id'])});}});}})[_0x08f0('0x21')](respondWithStatusCode(_0x38b80d,null))[_0x08f0('0x2b')](handleError(_0x38b80d,null));};exports[_0x08f0('0x134')]=function(_0x1e751e,_0x2449a9,_0x4d4ec6){var _0x29028e={};var _0x2f4bfe={};var _0x44c960;var _0x32b34f;return db[_0x08f0('0x42')][_0x08f0('0x6a')]({'where':{'id':_0x1e751e[_0x08f0('0x64')]['id']}})[_0x08f0('0x21')](handleEntityNotFound(_0x2449a9,null))['then'](function(_0x5809ba){if(_0x5809ba){_0x44c960=_0x5809ba;_0x2f4bfe[_0x08f0('0x4c')]=_[_0x08f0('0x48')](db[_0x08f0('0xc6')][_0x08f0('0x43')]);_0x2f4bfe[_0x08f0('0x49')]=_[_0x08f0('0x48')](_0x1e751e[_0x08f0('0x49')]);_0x2f4bfe['filters']=_[_0x08f0('0x4a')](_0x2f4bfe[_0x08f0('0x4c')],_0x2f4bfe[_0x08f0('0x49')]);_0x29028e[_0x08f0('0x4b')]=_['intersection'](_0x2f4bfe[_0x08f0('0x4c')],qs['fields'](_0x1e751e['query'][_0x08f0('0x5c')]));_0x29028e[_0x08f0('0x4b')]=_0x29028e['attributes'][_0x08f0('0x4d')]?_0x29028e['attributes']:_0x2f4bfe[_0x08f0('0x4c')];_0x29028e[_0x08f0('0x50')]=qs['sort'](_0x1e751e[_0x08f0('0x49')][_0x08f0('0x51')]);_0x29028e['where']=qs['filters'](_['pick'](_0x1e751e[_0x08f0('0x49')],_0x2f4bfe[_0x08f0('0x53')]));if(_0x1e751e[_0x08f0('0x49')][_0x08f0('0x55')]){_0x29028e[_0x08f0('0x52')]=_[_0x08f0('0x56')](_0x29028e[_0x08f0('0x52')],{'$or':_[_0x08f0('0x41')](_0x29028e['attributes'],function(_0x22a2d2){var _0x2271c1={};_0x2271c1[_0x22a2d2]={'$like':'%'+_0x1e751e['query']['filter']+'%'};return _0x2271c1;})});}_0x29028e=_[_0x08f0('0x56')]({},_0x29028e,_0x1e751e[_0x08f0('0x58')]);return _0x44c960['getAgents'](_0x29028e);}})[_0x08f0('0x21')](function(_0x404304){if(_0x404304){_0x32b34f=_0x404304[_0x08f0('0x4d')];if(!_0x1e751e[_0x08f0('0x49')][_0x08f0('0x4e')](_0x08f0('0x4f'))){_0x29028e['limit']=qs[_0x08f0('0x32')](_0x1e751e['query'][_0x08f0('0x32')]);_0x29028e[_0x08f0('0x30')]=qs[_0x08f0('0x30')](_0x1e751e[_0x08f0('0x49')][_0x08f0('0x30')]);}return _0x44c960[_0x08f0('0x134')](_0x29028e);}})[_0x08f0('0x21')](function(_0x2e7478){if(_0x2e7478){return _0x2e7478?{'count':_0x32b34f,'rows':_0x2e7478}:null;}})[_0x08f0('0x21')](respondWithResult(_0x2449a9,null))[_0x08f0('0x2b')](handleError(_0x2449a9,null));};
\ No newline at end of file
+var _0xfe33=['waitForTheAssignedAgent','forcedOwnership','Start','EventManager','notify','offline','files','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','transaction','Attachment','MailAccount','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','findAll','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','Intervals','getProactiveActions','getLicense','License','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','virtual','render','verticalAlignment','textColor','color_button','backgroundColor','sequelize','ChatApplication','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','Attachments','addAgents','omit','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','keys','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','customerAvatar','filename','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','account','applications','Applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','referer','browser','version','format','%s\x20%s','unknown','device','vendor','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xfe33,0x6e));var _0x3fe3=function(_0x1d32ac,_0x16f800){_0x1d32ac=_0x1d32ac-0x0;var _0x2e15e4=_0xfe33[_0x1d32ac];return _0x2e15e4;};'use strict';var emlformat=require(_0x3fe3('0x0'));var rimraf=require(_0x3fe3('0x1'));var zipdir=require(_0x3fe3('0x2'));var jsonpatch=require(_0x3fe3('0x3'));var rp=require(_0x3fe3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3fe3('0x5'));var csv=require(_0x3fe3('0x6'));var ejs=require(_0x3fe3('0x7'));var fs=require('fs');var fs_extra=require(_0x3fe3('0x8'));var _=require('lodash');var squel=require(_0x3fe3('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3fe3('0xa'));var toCsv=require(_0x3fe3('0x6'));var querystring=require('querystring');var Papa=require(_0x3fe3('0xb'));var Redis=require('ioredis');var authService=require(_0x3fe3('0xc'));var qs=require(_0x3fe3('0xd'));var as=require(_0x3fe3('0xe'));var hardwareService=require(_0x3fe3('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x3fe3('0x10'));var config=require(_0x3fe3('0x11'));var licenseUtil=require(_0x3fe3('0x12'));var db=require(_0x3fe3('0x13'))['db'];config['redis']=_[_0x3fe3('0x14')](config[_0x3fe3('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3fe3('0x16'))(new Redis(config['redis']));require(_0x3fe3('0x17'))['register'](socket);var jayson=require(_0x3fe3('0x18'));var client=jayson[_0x3fe3('0x19')]['http']({'port':0x232c});var client9002=jayson[_0x3fe3('0x19')][_0x3fe3('0x1a')]({'port':0x232a});var client9003=jayson[_0x3fe3('0x19')][_0x3fe3('0x1a')]({'port':0x232b});var client9001=jayson['client'][_0x3fe3('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x32765f,_0x341524,_0x28478d,_0x5d5526){return new BPromise(function(_0x589f2a,_0xdc2fe3){var _0x36af23=_0x5d5526||client;return _0x36af23[_0x3fe3('0x1b')](_0x32765f,_0x28478d)[_0x3fe3('0x1c')](function(_0x57a784){logger[_0x3fe3('0x1d')](_0x3fe3('0x1e'),_0x341524,_0x3fe3('0x1f'));logger[_0x3fe3('0x20')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x341524,_0x3fe3('0x1f'),JSON['stringify'](_0x57a784));if(_0x57a784[_0x3fe3('0x21')]){if(_0x57a784['error'][_0x3fe3('0x22')]===0x1f4){logger[_0x3fe3('0x21')](_0x3fe3('0x1e'),_0x341524,_0x57a784['error']['message']);return _0xdc2fe3(_0x57a784[_0x3fe3('0x21')][_0x3fe3('0x23')]);}logger[_0x3fe3('0x21')](_0x3fe3('0x1e'),_0x341524,_0x57a784['error'][_0x3fe3('0x23')]);return _0x589f2a(_0x57a784[_0x3fe3('0x21')]['message']);}else{logger[_0x3fe3('0x1d')](_0x3fe3('0x1e'),_0x341524,'request\x20sent');_0x589f2a(_0x57a784[_0x3fe3('0x24')][_0x3fe3('0x23')]);}})[_0x3fe3('0x25')](function(_0x1c731d){logger[_0x3fe3('0x21')](_0x3fe3('0x1e'),_0x341524,_0x1c731d);_0xdc2fe3(_0x1c731d);});});}function respondWithStatusCode(_0x2b5e33,_0xf9a689){_0xf9a689=_0xf9a689||0xcc;return function(_0x9bf9ed){if(_0x9bf9ed){return _0x2b5e33[_0x3fe3('0x26')](_0xf9a689);}return _0x2b5e33[_0x3fe3('0x27')](_0xf9a689)[_0x3fe3('0x28')]();};}function respondWithResult(_0x4aef2e,_0x1e243c){_0x1e243c=_0x1e243c||0xc8;return function(_0x48e7f7){if(_0x48e7f7){return _0x4aef2e[_0x3fe3('0x27')](_0x1e243c)[_0x3fe3('0x29')](_0x48e7f7);}};}function respondWithFilteredResult(_0x3db9b3,_0x3ec7f5){return function(_0x59e27d){if(_0x59e27d){var _0x242701=typeof _0x3ec7f5[_0x3fe3('0x2a')]===_0x3fe3('0x2b')&&typeof _0x3ec7f5[_0x3fe3('0x2c')]===_0x3fe3('0x2b');var _0x54934a=_0x59e27d[_0x3fe3('0x2d')];var _0xa423bd=_0x242701?0x0:_0x3ec7f5[_0x3fe3('0x2a')];var _0xe68adb=_0x242701?_0x59e27d[_0x3fe3('0x2d')]:_0x3ec7f5['offset']+_0x3ec7f5[_0x3fe3('0x2c')];var _0xfea885;if(_0xe68adb>=_0x54934a){_0xe68adb=_0x54934a;_0xfea885=0xc8;}else{_0xfea885=0xce;}_0x3db9b3[_0x3fe3('0x27')](_0xfea885);return _0x3db9b3[_0x3fe3('0x2e')](_0x3fe3('0x2f'),_0xa423bd+'-'+_0xe68adb+'/'+_0x54934a)[_0x3fe3('0x29')](_0x59e27d);}return null;};}function patchUpdates(_0x13b9e3){return function(_0xf5da50){try{jsonpatch[_0x3fe3('0x30')](_0xf5da50,_0x13b9e3,!![]);}catch(_0x40dc5d){return BPromise['reject'](_0x40dc5d);}return _0xf5da50['save']();};}function saveUpdates(_0x45828c,_0x3f8f49){return function(_0x5e8b03){if(_0x5e8b03){return _0x5e8b03[_0x3fe3('0x31')](_0x45828c)[_0x3fe3('0x1c')](function(_0xe03238){return _0xe03238;});}return null;};}function removeEntity(_0x379a4b,_0x520ea9){return function(_0x58b018){if(_0x58b018){return _0x58b018[_0x3fe3('0x32')]()[_0x3fe3('0x1c')](function(){var _0xb46c34=_0x58b018[_0x3fe3('0x33')]({'plain':!![]});var _0xcafc68=_0x3fe3('0x34');return db[_0x3fe3('0x35')][_0x3fe3('0x32')]({'where':{'type':_0xcafc68,'resourceId':_0xb46c34['id']}})[_0x3fe3('0x1c')](function(){return _0x58b018;});})['then'](function(){_0x379a4b[_0x3fe3('0x27')](0xcc)[_0x3fe3('0x28')]();});}};}function handleEntityNotFound(_0x3e2f64,_0x4f9f85){return function(_0x302f18){if(!_0x302f18){_0x3e2f64['sendStatus'](0x194);}return _0x302f18;};}function handleError(_0x2e2738,_0x4b3f30){_0x4b3f30=_0x4b3f30||0x1f4;return function(_0x4c05ca){logger['error'](_0x4c05ca[_0x3fe3('0x36')]);if(_0x4c05ca[_0x3fe3('0x37')]){delete _0x4c05ca['name'];}_0x2e2738[_0x3fe3('0x27')](_0x4b3f30)[_0x3fe3('0x38')](_0x4c05ca);};}exports[_0x3fe3('0x39')]=function(_0x4946b3,_0x1fbb55){var _0x242037={'include':[{'model':db[_0x3fe3('0x3a')],'as':_0x3fe3('0x3b')}]},_0x3f15af={},_0xb447d3={'count':0x0,'rows':[]};var _0x5a4593=_['map'](db[_0x3fe3('0x3c')][_0x3fe3('0x3d')],function(_0x3e6f7d){return{'name':_0x3e6f7d[_0x3fe3('0x3e')],'type':_0x3e6f7d[_0x3fe3('0x3f')][_0x3fe3('0x40')]};});_0x3f15af[_0x3fe3('0x41')]=_[_0x3fe3('0x42')](_0x5a4593,_0x3fe3('0x37'));_0x3f15af[_0x3fe3('0x43')]=_['keys'](_0x4946b3[_0x3fe3('0x43')]);_0x3f15af[_0x3fe3('0x44')]=_['intersection'](_0x3f15af['model'],_0x3f15af[_0x3fe3('0x43')]);_0x242037['attributes']=_[_0x3fe3('0x45')](_0x3f15af['model'],qs[_0x3fe3('0x46')](_0x4946b3['query'][_0x3fe3('0x46')]));_0x242037['attributes']=_0x242037[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x242037['attributes']:_0x3f15af['model'];if(!_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x242037[_0x3fe3('0x2c')]=qs['limit'](_0x4946b3['query'][_0x3fe3('0x2c')]);_0x242037['offset']=qs[_0x3fe3('0x2a')](_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}_0x242037[_0x3fe3('0x4b')]=qs['sort'](_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x242037[_0x3fe3('0x4d')]=qs['filters'](_[_0x3fe3('0x4e')](_0x4946b3[_0x3fe3('0x43')],_0x3f15af[_0x3fe3('0x44')]),_0x5a4593);if(_0x4946b3['query'][_0x3fe3('0x4f')]){_0x242037[_0x3fe3('0x4d')]=_['merge'](_0x242037[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x5a4593,function(_0x45d719){if(_0x45d719[_0x3fe3('0x3f')]!==_0x3fe3('0x50')){var _0xc960f6={};_0xc960f6[_0x45d719[_0x3fe3('0x37')]]={'$like':'%'+_0x4946b3[_0x3fe3('0x43')]['filter']+'%'};return _0xc960f6;}})});}_0x242037=_['merge']({},_0x242037,_0x4946b3[_0x3fe3('0x51')]);var _0x38443d={'where':_0x242037['where']};return db[_0x3fe3('0x3c')][_0x3fe3('0x2d')](_0x38443d)[_0x3fe3('0x1c')](function(_0x1130d7){_0xb447d3['count']=_0x1130d7;if(_0x4946b3[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x242037[_0x3fe3('0x53')]=[{'all':!![]}];}return db[_0x3fe3('0x3c')]['findAll'](_0x242037);})[_0x3fe3('0x1c')](function(_0x57d9e6){_0xb447d3[_0x3fe3('0x54')]=_0x57d9e6;return _0xb447d3;})[_0x3fe3('0x1c')](respondWithFilteredResult(_0x1fbb55,_0x242037))[_0x3fe3('0x25')](handleError(_0x1fbb55,null));};exports[_0x3fe3('0x55')]=function(_0xe70851,_0x16937a){var _0x2c990f={'raw':![],'where':{'id':_0xe70851[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x3a')],'as':'mandatoryDispositionPause'}]},_0x58ff4b={};_0x58ff4b[_0x3fe3('0x41')]=_['keys'](db[_0x3fe3('0x3c')]['rawAttributes']);_0x58ff4b[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0xe70851[_0x3fe3('0x43')]);_0x58ff4b[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x58ff4b[_0x3fe3('0x41')],_0x58ff4b[_0x3fe3('0x43')]);_0x2c990f['attributes']=_[_0x3fe3('0x45')](_0x58ff4b[_0x3fe3('0x41')],qs['fields'](_0xe70851[_0x3fe3('0x43')]['fields']));_0x2c990f[_0x3fe3('0x47')]=_0x2c990f['attributes'][_0x3fe3('0x48')]?_0x2c990f[_0x3fe3('0x47')]:_0x58ff4b['model'];if(_0xe70851[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x2c990f[_0x3fe3('0x53')]=[{'all':!![]}];}_0x2c990f=_[_0x3fe3('0x58')]({},_0x2c990f,_0xe70851[_0x3fe3('0x51')]);return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x2c990f)[_0x3fe3('0x1c')](handleEntityNotFound(_0x16937a,null))[_0x3fe3('0x1c')](respondWithResult(_0x16937a,null))[_0x3fe3('0x25')](handleError(_0x16937a,null));};exports[_0x3fe3('0x5a')]=function(_0x5724e8,_0xba56e){return db[_0x3fe3('0x3c')][_0x3fe3('0x5a')](_0x5724e8['body'],{})[_0x3fe3('0x1c')](function(_0x421ffb){var _0x33b1e4=_0x5724e8[_0x3fe3('0x5b')][_0x3fe3('0x33')]({'plain':!![]});if(!_0x33b1e4)throw new Error(_0x3fe3('0x5c'));if(_0x33b1e4['role']===_0x3fe3('0x5b')){var _0x285c8b=_0x421ffb['get']({'plain':!![]});var _0x508b57='ChatWebsites';return db[_0x3fe3('0x5d')]['find']({'where':{'name':_0x508b57,'userProfileId':_0x33b1e4[_0x3fe3('0x5e')]},'raw':!![]})['then'](function(_0x1cdcad){if(_0x1cdcad&&_0x1cdcad[_0x3fe3('0x5f')]===0x0){return db[_0x3fe3('0x35')][_0x3fe3('0x5a')]({'name':_0x285c8b[_0x3fe3('0x37')],'resourceId':_0x285c8b['id'],'type':_0x1cdcad[_0x3fe3('0x37')],'sectionId':_0x1cdcad['id']},{})[_0x3fe3('0x1c')](function(){return _0x421ffb;});}else{return _0x421ffb;}})['catch'](function(_0x56e3b9){logger[_0x3fe3('0x21')](_0x3fe3('0x60'),_0x56e3b9);throw _0x56e3b9;});}return _0x421ffb;})[_0x3fe3('0x1c')](respondWithResult(_0xba56e,0xc9))[_0x3fe3('0x25')](handleError(_0xba56e,null));};exports['update']=function(_0x22ab38,_0x496a77){if(_0x22ab38['body']['id']){delete _0x22ab38[_0x3fe3('0x61')]['id'];}return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x22ab38[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x3a')],'as':_0x3fe3('0x3b')}]})[_0x3fe3('0x1c')](handleEntityNotFound(_0x496a77,null))[_0x3fe3('0x1c')](saveUpdates(_0x22ab38[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x496a77,null))[_0x3fe3('0x25')](handleError(_0x496a77,null));};exports[_0x3fe3('0x32')]=function(_0x4ff239,_0x2b1fa0){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x4ff239[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b1fa0,null))['then'](removeEntity(_0x2b1fa0,null))[_0x3fe3('0x25')](handleError(_0x2b1fa0,null));};exports[_0x3fe3('0x62')]=function(_0x3007e6,_0x39a557){return db[_0x3fe3('0x3c')]['describe']()[_0x3fe3('0x1c')](respondWithResult(_0x39a557,null))[_0x3fe3('0x25')](handleError(_0x39a557,null));};exports[_0x3fe3('0x63')]=function(_0x469d06,_0x229132,_0x5f3e18){if(_0x469d06['body']['id']){delete _0x469d06[_0x3fe3('0x61')]['id'];}return db[_0x3fe3('0x3c')]['find']({'where':{'id':_0x469d06['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x229132,null))[_0x3fe3('0x1c')](function(_0x11bbdd){if(_0x11bbdd){_0x469d06[_0x3fe3('0x61')]['ChatWebsiteId']=_0x11bbdd['id'];return db[_0x3fe3('0x64')][_0x3fe3('0x5a')](_0x469d06[_0x3fe3('0x61')]);}})[_0x3fe3('0x1c')](respondWithResult(_0x229132,null))[_0x3fe3('0x25')](handleError(_0x229132,null));};exports[_0x3fe3('0x65')]=function(_0x35ecc7,_0x58b242,_0x695b26){var _0x44d88f={'raw':![],'where':{}};var _0x27646a={};var _0x22785d={'count':0x0,'rows':[]};return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x35ecc7['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x58b242,null))['then'](function(_0x5d8e6b){if(_0x5d8e6b){_0x27646a[_0x3fe3('0x41')]=_['keys'](db[_0x3fe3('0x64')][_0x3fe3('0x3d')]);_0x27646a[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x35ecc7[_0x3fe3('0x43')]);_0x27646a[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x27646a[_0x3fe3('0x41')],_0x27646a[_0x3fe3('0x43')]);_0x44d88f[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x27646a[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x35ecc7['query']['fields']));_0x44d88f[_0x3fe3('0x47')]=_0x44d88f[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x44d88f[_0x3fe3('0x47')]:_0x27646a[_0x3fe3('0x41')];if(!_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x44d88f[_0x3fe3('0x2c')]=qs['limit'](_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x44d88f[_0x3fe3('0x2a')]=qs[_0x3fe3('0x2a')](_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}_0x44d88f[_0x3fe3('0x4b')]=qs[_0x3fe3('0x4c')](_0x35ecc7['query'][_0x3fe3('0x4c')]);_0x44d88f[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x35ecc7[_0x3fe3('0x43')],_0x27646a['filters']));_0x44d88f['where'][_0x3fe3('0x67')]=_0x5d8e6b['id'];if(_0x35ecc7['query']['filter']){_0x44d88f[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x44d88f[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x44d88f[_0x3fe3('0x47')],function(_0x1ae1a5){var _0x4b917e={};_0x4b917e[_0x1ae1a5]={'$like':'%'+_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x4f')]+'%'};return _0x4b917e;})});}_0x44d88f=_['merge']({},_0x44d88f,_0x35ecc7[_0x3fe3('0x51')]);return db['Disposition'][_0x3fe3('0x2d')]({'where':_0x44d88f[_0x3fe3('0x4d')]})[_0x3fe3('0x1c')](function(_0x3ceb8b){_0x22785d[_0x3fe3('0x2d')]=_0x3ceb8b;if(_0x35ecc7[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x44d88f['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x44d88f);})[_0x3fe3('0x1c')](function(_0x3f77bb){_0x22785d['rows']=_0x3f77bb;return _0x22785d;});}})[_0x3fe3('0x1c')](respondWithFilteredResult(_0x58b242,_0x44d88f))[_0x3fe3('0x25')](handleError(_0x58b242,null));};exports[_0x3fe3('0x68')]=function(_0x57643f,_0x29b240,_0x1c11c7){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x57643f['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x29b240,null))[_0x3fe3('0x1c')](function(_0x122247){if(_0x122247){return _0x122247[_0x3fe3('0x68')](_0x57643f['query'][_0x3fe3('0x69')]);}})[_0x3fe3('0x1c')](respondWithStatusCode(_0x29b240,null))['catch'](handleError(_0x29b240,null));};exports[_0x3fe3('0x6a')]=function(_0xabb2fc,_0x16a922,_0x15c379){if(_0xabb2fc['body']['id']){delete _0xabb2fc[_0x3fe3('0x61')]['id'];}return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0xabb2fc['params']['id']}})['then'](handleEntityNotFound(_0x16a922,null))[_0x3fe3('0x1c')](function(_0x4f1c8d){if(_0x4f1c8d){_0xabb2fc[_0x3fe3('0x61')][_0x3fe3('0x67')]=_0x4f1c8d['id'];return db['CannedAnswer'][_0x3fe3('0x5a')](_0xabb2fc[_0x3fe3('0x61')]);}})[_0x3fe3('0x1c')](respondWithResult(_0x16a922,null))['catch'](handleError(_0x16a922,null));};exports[_0x3fe3('0x6b')]=function(_0xf0bca4,_0x1e4df7,_0x53c7ca){var _0x865f4b={'raw':![],'where':{}};var _0x111b45={};var _0x3f0cf2={'count':0x0,'rows':[]};return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0xf0bca4[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x1e4df7,null))[_0x3fe3('0x1c')](function(_0x103c3f){if(_0x103c3f){_0x111b45[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0x6c')][_0x3fe3('0x3d')]);_0x111b45[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0xf0bca4['query']);_0x111b45['filters']=_[_0x3fe3('0x45')](_0x111b45['model'],_0x111b45[_0x3fe3('0x43')]);_0x865f4b['attributes']=_[_0x3fe3('0x45')](_0x111b45[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x865f4b[_0x3fe3('0x47')]=_0x865f4b[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x865f4b[_0x3fe3('0x47')]:_0x111b45[_0x3fe3('0x41')];if(!_0xf0bca4['query'][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x865f4b[_0x3fe3('0x2c')]=qs[_0x3fe3('0x2c')](_0xf0bca4['query'][_0x3fe3('0x2c')]);_0x865f4b['offset']=qs[_0x3fe3('0x2a')](_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}_0x865f4b[_0x3fe3('0x4b')]=qs['sort'](_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x865f4b['where']=qs[_0x3fe3('0x44')](_['pick'](_0xf0bca4[_0x3fe3('0x43')],_0x111b45['filters']));_0x865f4b['where'][_0x3fe3('0x67')]=_0x103c3f['id'];if(_0xf0bca4[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x865f4b[_0x3fe3('0x4d')]=_['merge'](_0x865f4b[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x865f4b[_0x3fe3('0x47')],function(_0x3b5d8d){var _0x3ec497={};_0x3ec497[_0x3b5d8d]={'$like':'%'+_0xf0bca4['query'][_0x3fe3('0x4f')]+'%'};return _0x3ec497;})});}_0x865f4b=_[_0x3fe3('0x58')]({},_0x865f4b,_0xf0bca4['options']);return db[_0x3fe3('0x6c')][_0x3fe3('0x2d')]({'where':_0x865f4b[_0x3fe3('0x4d')]})[_0x3fe3('0x1c')](function(_0x4a438e){_0x3f0cf2[_0x3fe3('0x2d')]=_0x4a438e;if(_0xf0bca4['query']['includeAll']){_0x865f4b[_0x3fe3('0x53')]=[{'all':!![]}];}return db[_0x3fe3('0x6c')]['findAll'](_0x865f4b);})[_0x3fe3('0x1c')](function(_0x365ec9){_0x3f0cf2[_0x3fe3('0x54')]=_0x365ec9;return _0x3f0cf2;});}})['then'](respondWithFilteredResult(_0x1e4df7,_0x865f4b))[_0x3fe3('0x25')](handleError(_0x1e4df7,null));};exports[_0x3fe3('0x6d')]=function(_0x4b61ea,_0x4c3f4f,_0x6a99eb){return db['ChatWebsite'][_0x3fe3('0x59')]({'where':{'id':_0x4b61ea['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x4c3f4f,null))[_0x3fe3('0x1c')](function(_0x378fea){if(_0x378fea){return _0x378fea['removeAnswers'](_0x4b61ea[_0x3fe3('0x43')][_0x3fe3('0x69')]);}})[_0x3fe3('0x1c')](respondWithStatusCode(_0x4c3f4f,null))[_0x3fe3('0x25')](handleError(_0x4c3f4f,null));};exports[_0x3fe3('0x6e')]=function(_0x5d8e3b,_0x3448e6,_0x4bb9d3){_0x5d8e3b['body'][_0x3fe3('0x6f')]=_0x5d8e3b[_0x3fe3('0x70')]['filename'];return db[_0x3fe3('0x3c')]['find']({'where':{'id':_0x5d8e3b[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x3448e6,null))[_0x3fe3('0x1c')](saveUpdates(_0x5d8e3b[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x3448e6,null))['catch'](handleError(_0x3448e6,null));};exports[_0x3fe3('0x71')]=function(_0x28bcb8,_0x33a892,_0x321a32){_0x28bcb8[_0x3fe3('0x61')][_0x3fe3('0x72')]=_0x28bcb8[_0x3fe3('0x70')]['filename'];return db[_0x3fe3('0x3c')]['find']({'where':{'id':_0x28bcb8[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x33a892,null))[_0x3fe3('0x1c')](saveUpdates(_0x28bcb8[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x33a892,null))[_0x3fe3('0x25')](handleError(_0x33a892,null));};exports['addCustomerAvatar']=function(_0x1845dd,_0x15408b,_0x219cb9){_0x1845dd[_0x3fe3('0x61')][_0x3fe3('0x73')]=_0x1845dd['file'][_0x3fe3('0x74')];return db['ChatWebsite'][_0x3fe3('0x59')]({'where':{'id':_0x1845dd[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x15408b,null))['then'](saveUpdates(_0x1845dd[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x15408b,null))['catch'](handleError(_0x15408b,null));};exports['addSystemAvatar']=function(_0x57ac0f,_0x4eb740,_0x56f0ae){_0x57ac0f[_0x3fe3('0x61')][_0x3fe3('0x75')]=_0x57ac0f['file'][_0x3fe3('0x74')];return db['ChatWebsite']['find']({'where':{'id':_0x57ac0f[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x4eb740,null))[_0x3fe3('0x1c')](saveUpdates(_0x57ac0f[_0x3fe3('0x61')],null))[_0x3fe3('0x1c')](respondWithResult(_0x4eb740,null))[_0x3fe3('0x25')](handleError(_0x4eb740,null));};exports[_0x3fe3('0x76')]=function(_0x6245cd,_0x44c754,_0x2a2cca){var _0x8eae21=path['join'](config[_0x3fe3('0x77')],_0x3fe3('0x78'));var _0x250101={'where':{'id':_0x6245cd[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x6f')],'raw':!![]};var _0x4c59c5=![];return require(_0x3fe3('0x12'))['getLicense']()['then'](function(_0x573578){if(_0x573578){_0x4c59c5=_0x573578[_0x3fe3('0x79')];}})[_0x3fe3('0x1c')](function(){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x250101);})[_0x3fe3('0x1c')](handleEntityNotFound(_0x44c754,null))[_0x3fe3('0x1c')](function(_0x5e590b){if(_0x5e590b){if(!_[_0x3fe3('0x7a')](_0x5e590b['sitepic'])){if(fs[_0x3fe3('0x7b')](path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x7d'),_0x5e590b[_0x3fe3('0x6f')]))&&_0x4c59c5){_0x8eae21=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x7d'),_0x5e590b[_0x3fe3('0x6f')]);}}return _0x44c754[_0x3fe3('0x7e')](_0x8eae21);}})[_0x3fe3('0x25')](handleError(_0x44c754,null));};exports['getAvatar']=function(_0x203f60,_0x5581d7,_0x6284f9){var _0x3c71d5=path['join'](config['root'],_0x3fe3('0x7f'));var _0x2b86e8={'where':{'id':_0x203f60[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x72')],'raw':!![]};return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x2b86e8)[_0x3fe3('0x1c')](handleEntityNotFound(_0x5581d7,null))[_0x3fe3('0x1c')](function(_0x19f25e){if(_0x19f25e){if(!_['isNil'](_0x19f25e['agentAvatar'])){if(fs[_0x3fe3('0x7b')](path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x19f25e['agentAvatar']))){_0x3c71d5=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x19f25e[_0x3fe3('0x72')]);}}return _0x5581d7[_0x3fe3('0x7e')](_0x3c71d5);}})[_0x3fe3('0x25')](handleError(_0x5581d7,null));};exports[_0x3fe3('0x81')]=function(_0x46bb9d,_0x15b981,_0x27803d){var _0x3bf029=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x82'));var _0x1a0a6d={'where':{'id':_0x46bb9d[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x73'),'showCustomerAvatar'],'raw':!![]};return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x1a0a6d)[_0x3fe3('0x1c')](handleEntityNotFound(_0x15b981,null))[_0x3fe3('0x1c')](function(_0x35d384){if(_0x35d384){if(!_[_0x3fe3('0x7a')](_0x35d384[_0x3fe3('0x73')])){if(fs[_0x3fe3('0x7b')](path[_0x3fe3('0x7c')](config['root'],_0x3fe3('0x80'),_0x35d384['customerAvatar']))&&_0x35d384[_0x3fe3('0x83')]){_0x3bf029=path['join'](config[_0x3fe3('0x77')],'server/files/images/avatars/',_0x35d384[_0x3fe3('0x73')]);}}return _0x15b981[_0x3fe3('0x7e')](_0x3bf029);}})[_0x3fe3('0x25')](handleError(_0x15b981,null));};exports[_0x3fe3('0x84')]=function(_0x2b8eb8,_0x2bf28f,_0x24f160){var _0x512d61=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x85'));var _0x53c285={'where':{'id':_0x2b8eb8[_0x3fe3('0x56')]['id']},'attributes':['id',_0x3fe3('0x75')],'raw':!![]};return db[_0x3fe3('0x3c')][_0x3fe3('0x59')](_0x53c285)[_0x3fe3('0x1c')](handleEntityNotFound(_0x2bf28f,null))[_0x3fe3('0x1c')](function(_0x1c81cf){if(_0x1c81cf){if(!_[_0x3fe3('0x7a')](_0x1c81cf['systemAvatar'])){if(fs[_0x3fe3('0x7b')](path['join'](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x1c81cf[_0x3fe3('0x75')]))){_0x512d61=path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0x80'),_0x1c81cf[_0x3fe3('0x75')]);}}return _0x2bf28f['download'](_0x512d61);}})[_0x3fe3('0x25')](handleError(_0x2bf28f,null));};exports['notify']=function(_0x50743b,_0x217f32,_0x2026c4){var _0x17d825=require(_0x3fe3('0x86'));var _0x50500d=new _0x17d825();var _0x344c85=_0x50500d[_0x3fe3('0x87')](_0x50743b[_0x3fe3('0x88')]['user-agent'])[_0x3fe3('0x89')]();var _0x4dfd69={'body':_0x50743b['body'],'channel':_0x3fe3('0x8a')};var _0x4c2c21=[];var _0x4daecd=[];var _0x411d13={};var _0x1e9122=![];return db[_0x3fe3('0x8b')][_0x3fe3('0x62')]()['then'](function(_0xa4fcfd){if(!_0xa4fcfd){throw new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x8d'));}_0x4c2c21=_[_0x3fe3('0x8e')](_[_0x3fe3('0x57')](_0xa4fcfd),['createdAt',_0x3fe3('0x8f')]);_0x4daecd=_['difference'](_[_0x3fe3('0x57')](_0xa4fcfd),['createdAt',_0x3fe3('0x8f'),_0x3fe3('0x90'),_0x3fe3('0x91')]);if(_0x50743b['body']['id']){delete _0x50743b[_0x3fe3('0x61')]['id'];}if(_[_0x3fe3('0x7a')](_0x50743b[_0x3fe3('0x61')]['from'])){throw new db[(_0x3fe3('0x92'))][(_0x3fe3('0x8c'))](_0x3fe3('0x93'));}if(_[_0x3fe3('0x7a')](_0x50743b[_0x3fe3('0x61')]['body'])||_0x50743b['body'][_0x3fe3('0x61')]===''){throw new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x94'));}if(_['isNil'](_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x95')])){throw new db[(_0x3fe3('0x92'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4daecd);}if(!_['includes'](_0x4daecd,_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x95')])){throw new db[(_0x3fe3('0x92'))]['ValidationError'](_0x3fe3('0x96')+_0x4daecd);}_0x411d13[_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x95')]]=_0x50743b['body'][_0x3fe3('0x97')];})[_0x3fe3('0x1c')](function(){return db['ChatWebsite'][_0x3fe3('0x59')]({'where':{'id':_0x50743b[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x98')],'as':_0x3fe3('0x99'),'include':[{'model':db[_0x3fe3('0x8b')],'as':_0x3fe3('0x9a'),'where':_0x411d13,'limit':0x1,'order':[[_0x3fe3('0x8f'),_0x3fe3('0x9b')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x3fe3('0x1c')](handleEntityNotFound(_0x217f32,null))[_0x3fe3('0x1c')](function(_0x59b703){if(_0x59b703&&_0x59b703[_0x3fe3('0x99')]){_0x4dfd69[_0x3fe3('0x9c')]=_0x59b703;_0x4dfd69[_0x3fe3('0x9d')]=_0x59b703[_0x3fe3('0x9e')];_0x4dfd69[_0x3fe3('0x9f')]=_0x59b703[_0x3fe3('0x99')];_0x4dfd69[_0x3fe3('0x9d')]=_[_0x3fe3('0xa0')](_0x4dfd69[_0x3fe3('0x9d')],[_0x3fe3('0xa1')],[_0x3fe3('0xa2')]);if(_0x4dfd69[_0x3fe3('0x9c')]['Applications']){delete _0x4dfd69['account'][_0x3fe3('0x9e')];}if(_0x4dfd69['account'][_0x3fe3('0x99')]&&_0x4dfd69[_0x3fe3('0x9c')][_0x3fe3('0x99')][_0x3fe3('0x9a')][_0x3fe3('0x48')]){return _0x4dfd69['account']['List'][_0x3fe3('0x9a')][0x0];}var _0xb252ec=_['defaults'](_0x50743b['body'],{'firstName':_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x97')],'ListId':_0x59b703[_0x3fe3('0x91')]});_0xb252ec[_0x50743b['body']['mapKey']]=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x97')];return db['CmContact'][_0x3fe3('0x5a')](_0xb252ec,{'fields':_0x4c2c21,'raw':!![]});}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x217f32,null))[_0x3fe3('0x1c')](function(_0xd17ec2){_0x4dfd69[_0x3fe3('0xa3')]=_0xd17ec2;var _0x1f9b5c=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xa4')];if(_0x50743b[_0x3fe3('0x88')][_0x3fe3('0xa5')]){_0x1f9b5c=_0x50743b[_0x3fe3('0x88')]['cf-connecting-ip'];}else if(_0x50743b['headers'][_0x3fe3('0xa6')]){_0x1f9b5c=_[_0x3fe3('0xa7')](_0x50743b[_0x3fe3('0x88')][_0x3fe3('0xa6')][_0x3fe3('0xa8')](','));}if(_0xd17ec2){var _0x1c9f96={'ContactId':_0xd17ec2['id'],'ChatWebsiteId':_0x50743b[_0x3fe3('0x56')]['id'],'from':(_0xd17ec2[_0x3fe3('0xa9')]||'')+'\x20'+(_0xd17ec2['lastName']||''),'customerIp':_0x1f9b5c,'customerPort':_0x50743b[_0x3fe3('0x88')]['x-real-port']?_0x50743b['headers']['x-real-port']:null,'referer':_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xaa')],'browserName':_0x344c85[_0x3fe3('0xab')][_0x3fe3('0x37')]&&_0x344c85[_0x3fe3('0xab')][_0x3fe3('0xac')]?util[_0x3fe3('0xad')](_0x3fe3('0xae'),_0x344c85[_0x3fe3('0xab')][_0x3fe3('0x37')],_0x344c85[_0x3fe3('0xab')][_0x3fe3('0xac')]):_0x3fe3('0xaf'),'browserVersion':_0x344c85[_0x3fe3('0xab')][_0x3fe3('0xac')]||_0x3fe3('0xaf'),'osName':util['format']('%s\x20%s',_0x344c85['os'][_0x3fe3('0x37')],_0x344c85['os'][_0x3fe3('0xac')]),'osVersion':_0x344c85['os'][_0x3fe3('0xac')],'deviceModel':_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x41')]&&_0x344c85[_0x3fe3('0xb0')]['vendor']?util[_0x3fe3('0xad')]('%s\x20%s\x20%s',_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x41')],_0x344c85[_0x3fe3('0xb0')]['vendor'],_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x3f')]):null,'deviceVendor':_0x344c85['device'][_0x3fe3('0xb1')],'deviceType':_0x344c85[_0x3fe3('0xb0')][_0x3fe3('0x3f')],'formData':JSON[_0x3fe3('0xb2')](_0x50743b[_0x3fe3('0x61')])};var _0x511746={'ChatWebsiteId':_0x50743b[_0x3fe3('0x56')]['id'],'closed':![]};if(_0x50743b['body'][_0x3fe3('0xb3')]){_0x511746['threadId']=_0x50743b['body']['threadId'];return db['ChatInteraction'][_0x3fe3('0x59')]({'where':_0x511746})[_0x3fe3('0x1c')](function(_0xd158f1){if(_0xd158f1){return[_0xd158f1,![]];}_0x1c9f96[_0x3fe3('0xb3')]=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb3')];_0x1c9f96[_0x3fe3('0xb4')]=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb4')];return db[_0x3fe3('0xb5')]['create'](_0x1c9f96)[_0x3fe3('0x1c')](function(_0x138561){return[_0x138561,!![]];});});}_0x511746[_0x3fe3('0xb6')]=_0xd17ec2['id'];if(_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb7')]&&_0x50743b[_0x3fe3('0x61')]['interaction']['id']){_0x511746['id']=_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb7')]['id'];return db['ChatInteraction'][_0x3fe3('0x59')]({'where':_0x511746})['then'](function(_0x4b8ca1){if(_0x4b8ca1){return[_0x4b8ca1,![]];}return db['ChatInteraction'][_0x3fe3('0x5a')](_0x1c9f96)[_0x3fe3('0x1c')](function(_0x562264){return[_0x562264,!![]];});});}return db[_0x3fe3('0xb5')][_0x3fe3('0x5a')](_0x1c9f96)['then'](function(_0x305b67){return[_0x305b67,!![]];});}})[_0x3fe3('0xb8')](function(_0x2befc8,_0x59e5c7){if(_0x2befc8){_0x1e9122=_0x59e5c7;if(!_0x59e5c7){var _0x3467e1={'from':(_0x4dfd69[_0x3fe3('0xa3')][_0x3fe3('0xa9')]||'')+'\x20'+(_0x4dfd69[_0x3fe3('0xa3')][_0x3fe3('0xb9')]||'')};if(_0x50743b[_0x3fe3('0x61')]['threadId']&&_0x50743b['body'][_0x3fe3('0xba')]&&_0x50743b[_0x3fe3('0x61')][_0x3fe3('0xb3')]!=_0x50743b[_0x3fe3('0x61')]['messageId']){_0x3467e1['threadId']=_0x50743b[_0x3fe3('0x61')]['messageId'];}return _0x2befc8[_0x3fe3('0x31')](_0x3467e1);}else{return _0x2befc8;}}})[_0x3fe3('0x1c')](function(_0x474e26){_0x4dfd69['interaction']=_0x474e26[_0x3fe3('0x33')]({'plain':!![]});_0x4dfd69[_0x3fe3('0xb7')][_0x3fe3('0xbb')]=_0x1e9122;if(_0x4dfd69[_0x3fe3('0xb7')]['created']){if(_0x4dfd69[_0x3fe3('0x9c')][_0x3fe3('0xbc')]){_0x4dfd69['applications']['push']({'id':0x0,'priority':_0x4dfd69[_0x3fe3('0x9d')]['length']+0x1,'app':_0x3fe3('0xbd'),'appdata':_0x3fe3('0xbe'),'interval':_0x3fe3('0xbf')});}}return db[_0x3fe3('0xc0')]['create']({'body':_0x50743b[_0x3fe3('0x61')][_0x3fe3('0x61')],'ChatWebsiteId':_0x50743b[_0x3fe3('0x56')]['id'],'ChatInteractionId':_0x474e26['id'],'direction':'in','ContactId':_0x4dfd69[_0x3fe3('0xa3')]['id'],'AttachmentId':_0x50743b['body'][_0x3fe3('0xc1')]});})[_0x3fe3('0x1c')](function(_0x369912){_0x4dfd69[_0x3fe3('0x23')]=_0x369912;if(_0x4dfd69['interaction']['UserId']){return db[_0x3fe3('0xc2')][_0x3fe3('0x59')]({'attributes':['id',_0x3fe3('0x37')],'where':{'id':_0x4dfd69[_0x3fe3('0xb7')][_0x3fe3('0xc3')]}})[_0x3fe3('0x1c')](function(_0x403f02){if(_0x403f02){_0x4dfd69[_0x3fe3('0x9d')][_0x3fe3('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x403f02[_0x3fe3('0x37')]+','+(_0x4dfd69['account'][_0x3fe3('0xc5')]||0xa),'interval':_0x3fe3('0xbf')});_0x4dfd69[_0x3fe3('0xc6')]=!![];}return respondWithRpcPromise(_0x3fe3('0xc7'),'startRouting',_0x4dfd69);});}return respondWithRpcPromise(_0x3fe3('0xc7'),'startRouting',_0x4dfd69);})[_0x3fe3('0x1c')](function(_0x444fe9){respondWithRpcPromise('EventManager',_0x3fe3('0xc8'),{'event':_0x3fe3('0xc9'),'message':_0x444fe9},client9002);return _0x444fe9;})[_0x3fe3('0x1c')](respondWithResult(_0x217f32,null))[_0x3fe3('0x25')](handleError(_0x217f32,null));};exports[_0x3fe3('0xca')]=function(_0x399100,_0x3857c6,_0x56d3d3){var _0x2215e2,_0x2e075a,_0x2d3a89;var _0x8cddf4=[];var _0x5b04a0=[];var _0x158444={};var _0x2bd590=_0x399100[_0x3fe3('0xcb')]||[];var _0x314763=[];var _0x501707;return db[_0x3fe3('0x8b')][_0x3fe3('0x62')]()[_0x3fe3('0x1c')](function(_0x1357cd){if(!_0x1357cd){throw new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x8d'));}_0x5b04a0=_[_0x3fe3('0x8e')](_[_0x3fe3('0x57')](_0x1357cd),[_0x3fe3('0xcc'),_0x3fe3('0x8f')]);_0x8cddf4=_[_0x3fe3('0x8e')](_[_0x3fe3('0x57')](_0x1357cd),[_0x3fe3('0xcc'),'updatedAt','CompanyId','ListId']);if(_0x399100['body']['id']){delete _0x399100['body']['id'];}if(_[_0x3fe3('0x7a')](_0x399100[_0x3fe3('0x61')][_0x3fe3('0x97')])){throw _0x3857c6['status'](0x1f4)[_0x3fe3('0x38')](new db[(_0x3fe3('0x92'))]['ValidationError'](_0x3fe3('0x93')));}if(_[_0x3fe3('0x7a')](_0x399100['body'][_0x3fe3('0x61')])||_0x399100[_0x3fe3('0x61')][_0x3fe3('0x61')]===''){throw _0x3857c6[_0x3fe3('0x27')](0x1f4)[_0x3fe3('0x38')](new db['Sequelize'][(_0x3fe3('0x8c'))](_0x3fe3('0x94')));}if(_[_0x3fe3('0x7a')](_0x399100[_0x3fe3('0x61')][_0x3fe3('0xcd')])){throw _0x3857c6[_0x3fe3('0x27')](0x1f4)[_0x3fe3('0x38')](new db[(_0x3fe3('0x92'))]['ValidationError'](_0x3fe3('0xce')+_0x8cddf4));}if(!_[_0x3fe3('0xcf')](_0x8cddf4,_0x399100[_0x3fe3('0x61')][_0x3fe3('0xcd')])){throw _0x3857c6[_0x3fe3('0x27')](0x1f4)[_0x3fe3('0x38')](new db[(_0x3fe3('0x92'))][(_0x3fe3('0x8c'))](_0x3fe3('0xd0')+_0x8cddf4));}_0x158444[_0x399100[_0x3fe3('0x61')][_0x3fe3('0xcd')]]=_0x399100['body'][_0x3fe3('0x97')];})[_0x3fe3('0x1c')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x399100[_0x3fe3('0x56')]['id']},'include':[{'model':db[_0x3fe3('0x98')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x3fe3('0x1c')](handleEntityNotFound(_0x3857c6,null))['then'](function(_0x1b4f47){if(_0x1b4f47&&_0x1b4f47[_0x3fe3('0x99')]){_0x2e075a=_0x1b4f47;var _0xe3f278=_['defaults'](_0x399100[_0x3fe3('0x61')],{'firstName':_0x399100[_0x3fe3('0x61')]['from'],'phone':_0x399100['body'][_0x3fe3('0x97')],'ListId':_0x1b4f47[_0x3fe3('0x91')]});_0xe3f278[_0x399100[_0x3fe3('0x61')]['mapKeyOffline']]=_0x399100['body'][_0x3fe3('0x97')];return db[_0x3fe3('0x8b')]['findOrCreate']({'where':_0x158444,'defaults':_0xe3f278});}})[_0x3fe3('0xb8')](function(_0x363519){if(_0x363519){_0x2d3a89=_0x363519;var _0x5a1d14=fs[_0x3fe3('0xd1')](path['join'](config[_0x3fe3('0x77')],_0x3fe3('0xd2')),_0x3fe3('0xd3'));var _0x304d96=ejs['render'](_0x5a1d14,{'body':_[_0x3fe3('0xd4')](_0x399100['body']['body']),'bodyTitle':_0x2e075a['offlineMessageBody']});return db[_0x3fe3('0xd5')]['create']({'body':_0x304d96,'ContactId':_0x363519['id'],'ChatWebsiteId':_0x2e075a['id']});}})[_0x3fe3('0x1c')](function(_0x46ba1f){_0x501707=_0x46ba1f;if(_0x2bd590['length']){var _0x1de25f=_0x2bd590[_0x3fe3('0x42')](function(_0x2e89b1){return{'name':_0x2e89b1[_0x3fe3('0xd6')],'basename':_0x2e89b1['filename'],'type':_0x2e89b1[_0x3fe3('0xd7')],'ChatOfflineMessageId':_0x46ba1f['id']};});_0x314763=_0x1de25f[_0x3fe3('0x42')](_0x1a1e31=>{var _0x2e93e3={'filename':_0x1a1e31[_0x3fe3('0x37')],'path':path[_0x3fe3('0x7c')](config[_0x3fe3('0x77')],_0x3fe3('0xd8'),'files',_0x3fe3('0xd9'),_0x3fe3('0xda'),_0x1a1e31[_0x3fe3('0xdb')])};return _0x2e93e3;});if(!_0x2e075a['openNewInteraction']){return db['sequelize'][_0x3fe3('0xdc')](function(_0x1a9e1a){return db[_0x3fe3('0xdd')]['bulkCreate'](_0x1de25f,{'transaction':_0x1a9e1a});});}}})[_0x3fe3('0x1c')](function(){if(_0x501707){_0x2215e2=_0x501707;return db[_0x3fe3('0xde')][_0x3fe3('0x66')]({'where':{'active':!![]},'include':[{'model':db[_0x3fe3('0xdf')],'as':_0x3fe3('0xe0'),'raw':!![]}]});}})[_0x3fe3('0x1c')](function(_0x119488){if(_0x119488&&_0x119488[_0x3fe3('0xe0')]&&_0x2e075a[_0x3fe3('0xe1')]&&_0x2e075a[_0x3fe3('0xe2')]){var _0x19abf5={'tls':{'rejectUnauthorized':![]}};if(_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe3')]){_0x19abf5[_0x3fe3('0xe3')]=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe3')];}else{_0x19abf5[_0x3fe3('0xe4')]=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe4')];_0x19abf5['port']=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe5')];_0x19abf5[_0x3fe3('0xe6')]=_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe6')];}if(_0x119488[_0x3fe3('0xe0')]['authentication']){_0x19abf5[_0x3fe3('0xe7')]={'user':_0x119488['Smtp'][_0x3fe3('0x5b')],'pass':_0x119488[_0x3fe3('0xe0')][_0x3fe3('0xe8')]};}return respondWithRpcPromise(_0x3fe3('0xe9'),_0x3fe3('0xea'),{'account':_0x19abf5,'message':{'from':util['format'](_0x3fe3('0xeb'),_0x119488[_0x3fe3('0x37')],_0x119488[_0x3fe3('0xec')]||_0x119488[_0x3fe3('0xe0')][_0x3fe3('0x5b')]),'to':_0x2e075a[_0x3fe3('0xe2')],'subject':_0x2e075a[_0x3fe3('0xed')],'html':_0x2215e2[_0x3fe3('0x61')],'attachments':_0x314763}},client9003)['then'](function(){return _0x2215e2;})[_0x3fe3('0x25')](function(_0x508de8){console['error'](_0x508de8);});}})['then'](function(){if(_0x2e075a&&_0x2e075a[_0x3fe3('0xee')]&&_0x2e075a[_0x3fe3('0xef')]){var _0x54c642=[];if(_0x2bd590[_0x3fe3('0x48')]){_0x54c642=_0x2bd590[_0x3fe3('0x42')](function(_0x47b509){return{'name':_0x47b509[_0x3fe3('0xd6')],'basename':_0x47b509['filename'],'type':_0x47b509[_0x3fe3('0xd7')],'ChatOfflineMessageId':_0x501707['id']};});}var _0x90f0ad;if(!_[_0x3fe3('0x7a')](_0x2e075a['subjectOffline'])){var _0x397af7=_[_0x3fe3('0x42')](_0x399100[_0x3fe3('0x61')],function(_0x2de4fa){return _0x2de4fa;});var _0x3cb069=_[_0x3fe3('0xf0')](_0x397af7)[0x0];var _0x73c122=_[_0x3fe3('0xf1')](_0x3cb069,function(_0x70272){return _0x70272;});_0x90f0ad=_0x73c122[0x1][_0x2e075a[_0x3fe3('0xf2')]];}var _0x52d2b4={'from':_0x2d3a89['email'],'firstName':_0x2d3a89[_0x3fe3('0xa9')],'lastName':_0x2d3a89[_0x3fe3('0xb9')],'mapKey':'email','message':{'from':_0x2d3a89[_0x3fe3('0xec')],'to':_0x2e075a[_0x3fe3('0xde')][_0x3fe3('0xec')],'cc':'','subject':_['isNil'](_0x90f0ad)?_0x2e075a[_0x3fe3('0xed')]:_0x90f0ad,'messageId':'','sentAt':new Date(),'attach':_0x54c642[_0x3fe3('0x48')],'attachments':_0x54c642,'originChannel':_0x3fe3('0xf3'),'ChatWebsiteId':_0x2e075a['id'],'ChatOfflineMessageId':_0x2215e2['id'],'originTo':_0x2e075a[_0x3fe3('0xde')][_0x3fe3('0xec')]},'body':_0x2215e2[_0x3fe3('0x61')]};var _0x424ca3={'account':{'id':_0x2e075a[_0x3fe3('0xef')]},'body':_0x52d2b4,'log':_0x3fe3('0xf4')};return respondWithRpcPromise(_0x3fe3('0xf4'),_0x3fe3('0xf5'),_0x424ca3,client9001)['then'](function(){return _0x2215e2;})[_0x3fe3('0x25')](function(_0x15e907){console[_0x3fe3('0x21')](_0x15e907);});}return;})[_0x3fe3('0x1c')](function(){if(_0x2215e2){return _0x2215e2;}})[_0x3fe3('0x1c')](respondWithResult(_0x3857c6,null))['catch'](function(_0x135ef3){console['error'](_0x3fe3('0x25'),_0x135ef3);for(var _0x37f2ce of _0x2bd590){var _0x5acbb7=path[_0x3fe3('0x7c')](config['root'],_0x3fe3('0xd8'),_0x3fe3('0xcb'),'attachments',_0x3fe3('0xda'),_0x37f2ce[_0x3fe3('0x74')]);fs_extra[_0x3fe3('0xf6')](_0x5acbb7)[_0x3fe3('0x25')](function(_0x36e0f8){console[_0x3fe3('0x21')](_0x3fe3('0xf7'),_0x5acbb7,_0x36e0f8);});}});};exports[_0x3fe3('0xf8')]=function(_0x24c859,_0x2e74cf,_0x406d54){return db['ChatInteraction'][_0x3fe3('0x59')]({'where':{'id':_0x24c859[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x2e74cf,null))[_0x3fe3('0x1c')](function(_0x851102){if(_0x851102){return _0x851102[_0x3fe3('0xf8')](_0x24c859[_0x3fe3('0x61')][_0x3fe3('0x69')],_['omit'](_0x24c859[_0x3fe3('0x61')],[_0x3fe3('0x69'),'id'])||{});}})[_0x3fe3('0x1c')](respondWithResult(_0x2e74cf,null))[_0x3fe3('0x25')](handleError(_0x2e74cf,null));};exports[_0x3fe3('0xf9')]=function(_0x68e6e5,_0x45c71e,_0x2b6aa9){var _0xab4aac={'raw':![],'where':{}};var _0x511bcf={};var _0x1bc35e={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x68e6e5[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0x45c71e,null))[_0x3fe3('0x1c')](function(_0x4700d2){if(_0x4700d2){_0x511bcf[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db['ChatInteraction'][_0x3fe3('0x3d')]);_0x511bcf[_0x3fe3('0x43')]=_['keys'](_0x68e6e5[_0x3fe3('0x43')]);_0x511bcf[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x511bcf[_0x3fe3('0x41')],_0x511bcf[_0x3fe3('0x43')]);_0xab4aac[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x511bcf[_0x3fe3('0x41')],qs['fields'](_0x68e6e5['query'][_0x3fe3('0x46')]));_0xab4aac[_0x3fe3('0x47')]=_0xab4aac[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0xab4aac['attributes']:_0x511bcf[_0x3fe3('0x41')];if(!_0x68e6e5['query'][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0xab4aac[_0x3fe3('0x2c')]=qs['limit'](_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0xab4aac[_0x3fe3('0x2a')]=qs['offset'](_0x68e6e5['query'][_0x3fe3('0x2a')]);}_0xab4aac[_0x3fe3('0x4b')]=qs['sort'](_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0xab4aac[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x68e6e5[_0x3fe3('0x43')],_0x511bcf['filters']));_0xab4aac[_0x3fe3('0x4d')][_0x3fe3('0x67')]=_0x4700d2['id'];if(_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0xab4aac['where']=_[_0x3fe3('0x58')](_0xab4aac[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0xab4aac['attributes'],function(_0x48377b){var _0x128ebd={};_0x128ebd[_0x48377b]={'$like':'%'+_0x68e6e5['query'][_0x3fe3('0x4f')]+'%'};return _0x128ebd;})});}_0xab4aac=_[_0x3fe3('0x58')]({},_0xab4aac,_0x68e6e5['options']);return db[_0x3fe3('0xb5')][_0x3fe3('0x2d')]({'where':_0xab4aac[_0x3fe3('0x4d')]})[_0x3fe3('0x1c')](function(_0x4f9c27){_0x1bc35e[_0x3fe3('0x2d')]=_0x4f9c27;if(_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0xab4aac[_0x3fe3('0x53')]=[{'model':db['CmContact'],'as':_0x3fe3('0xfa'),'required':![]},{'model':db[_0x3fe3('0xc2')],'as':_0x3fe3('0xfb'),'attributes':[_0x3fe3('0x37'),_0x3fe3('0xfc'),_0x3fe3('0xfd')],'required':![]},{'model':db['Tag'],'as':_0x3fe3('0xfe'),'attributes':['id','name',_0x3fe3('0xff')],'where':_0x68e6e5[_0x3fe3('0x43')]['tag']?{'id':_0x68e6e5[_0x3fe3('0x43')]['tag']}:undefined,'required':_0x68e6e5[_0x3fe3('0x43')][_0x3fe3('0x100')]?!![]:![]}];}return db['ChatInteraction'][_0x3fe3('0x101')](_0xab4aac);})[_0x3fe3('0x1c')](function(_0x576d9e){_0x1bc35e[_0x3fe3('0x54')]=_0x576d9e;return _0x1bc35e;});}})[_0x3fe3('0x1c')](respondWithFilteredResult(_0x45c71e,_0xab4aac))[_0x3fe3('0x25')](handleError(_0x45c71e,null));};function iftimePromise(_0x42f9ae,_0x1f5dd1){return respondWithRpcPromise('Command',_0x3fe3('0x102'),{'command':_0x1f5dd1[_0x3fe3('0x103')]?util[_0x3fe3('0xad')](_0x3fe3('0x104'),_0x42f9ae[_0x3fe3('0x105')],_0x1f5dd1[_0x3fe3('0x103')]):util[_0x3fe3('0xad')](_0x3fe3('0x106'),_0x42f9ae[_0x3fe3('0x105')])},client9002)[_0x3fe3('0x1c')](function(_0x2b6d88){var _0x4028dc=_0x2b6d88&&_0x2b6d88['indexOf']('true')>=0x0?!![]:![];logger[_0x3fe3('0x1d')](_0x3fe3('0x107'),_0x1f5dd1['id'],_0x42f9ae['id'],_0x42f9ae[_0x3fe3('0x105')],_0x4028dc?_0x3fe3('0x108'):_0x3fe3('0x109'),_0x1f5dd1[_0x3fe3('0x103')]?_0x1f5dd1[_0x3fe3('0x103')]:'No\x20timezone');return _0x4028dc;})[_0x3fe3('0x25')](function(_0xa5746c){logger[_0x3fe3('0x21')](_0x3fe3('0x107'),_0x1f5dd1['id'],_0x42f9ae['id'],_0x42f9ae[_0x3fe3('0x105')],util[_0x3fe3('0x10a')](_0xa5746c,{'showHidden':![],'depth':null}),_0x1f5dd1['timezone']?_0x1f5dd1['timezone']:'No\x20timezone');return![];});}exports[_0x3fe3('0x102')]=function(_0x3a28f8,_0xbc6d2a,_0x1e1622){var _0x34ba1a=0x0;var _0x31179d=0x0;var _0x2dc4e1=![];var _0x4325b2;var _0x4c2a77;return db['ChatWebsite']['find']({'where':{'id':_0x3a28f8[_0x3fe3('0x56')]['id']},'include':[{'model':db['Interval'],'as':_0x3fe3('0x10b'),'include':[{'model':db['Interval'],'as':_0x3fe3('0x10c'),'attributes':['id',_0x3fe3('0x105')],'raw':!![]}]}]})[_0x3fe3('0x1c')](handleEntityNotFound(_0xbc6d2a,null))['then'](function(_0x383efd){if(_0x383efd){_0x4325b2=_0x383efd;return _0x383efd[_0x3fe3('0x10d')]({'raw':!![]});}})['then'](function(_0x360a3e){if(_0x4325b2){if(_0x360a3e){_0x4c2a77=_0x360a3e;}}return require(_0x3fe3('0x12'))[_0x3fe3('0x10e')]();})[_0x3fe3('0x1c')](function(_0x453891){if(_0x453891){_0x31179d=_0x453891['virtual'];_0x2dc4e1=_0x453891[_0x3fe3('0x79')];}})[_0x3fe3('0x1c')](function(){return db['ChatInteraction'][_0x3fe3('0x2d')]({'where':{'closed':![]}});})[_0x3fe3('0x1c')](function(_0x5f5de4){_0x34ba1a=_0x5f5de4;if(_0x31179d&&_0x5f5de4>_0x31179d){return db[_0x3fe3('0x10f')][_0x3fe3('0x66')]({'where':{'id':0x1}})['then'](function(_0x18ceef){if(_0x18ceef){_0x18ceef['increment'](_0x3fe3('0x110'));}});}})['then'](function(){if(_0x4325b2['Interval']&&_0x4325b2[_0x3fe3('0x10b')]['Intervals']){var _0x43fe11=[];for(var _0x4744db=0x0;_0x4744db<_0x4325b2[_0x3fe3('0x10b')][_0x3fe3('0x10c')][_0x3fe3('0x48')];_0x4744db++){var _0x2cccb6=_0x4325b2[_0x3fe3('0x10b')][_0x3fe3('0x10c')][_0x4744db][_0x3fe3('0x33')]({'plain':!![]});_0x43fe11[_0x3fe3('0x111')](iftimePromise(_0x2cccb6,_0x4325b2));}return BPromise[_0x3fe3('0x112')](_0x43fe11)[_0x3fe3('0x1c')](function(_0x4af8a2){return _[_0x3fe3('0x113')](_0x4af8a2);});}else{return!![];}})['then'](function(_0x411e42){var _0x4e7aad=fs[_0x3fe3('0xd1')](path[_0x3fe3('0x7c')](config['root'],_0x3fe3('0x114')),'utf8');var _0xfbbab8={'remote':_0x4325b2[_0x3fe3('0x115')],'query':querystring['stringify'](_['merge'](_0x4325b2[_0x3fe3('0x33')]({'plain':!![]}),{'customerIp':_0x3a28f8[_0x3fe3('0x88')]['x-forwarded-for']||_0x3a28f8[_0x3fe3('0x88')]['x-real-ip']||_0x3a28f8[_0x3fe3('0x116')][_0x3fe3('0x117')]||_0x3a28f8['ip'],'referer':_0x3a28f8['headers'][_0x3fe3('0xaa')],'openedInteractions':_0x34ba1a,'maxInteractions':_0x31179d,'virtual':_0x2dc4e1[_0x3fe3('0x118')],'online':_0x411e42,'custom':_0x2dc4e1}))['replace'](/'/g,'\x5c\x27')};_0xbc6d2a['send'](ejs[_0x3fe3('0x119')](Mustache[_0x3fe3('0x119')](_0x4e7aad,_0xfbbab8),{'proactiveActions':_0x4c2a77,'alignment':_0x4325b2['alignment'],'verticalAlignment':_0x4325b2[_0x3fe3('0x11a')],'div_color':_0x4325b2[_0x3fe3('0xff')],'text_color':_0x4325b2[_0x3fe3('0x11b')],'button_color':_0x4325b2[_0x3fe3('0x11c')],'background_color':_0x4325b2[_0x3fe3('0x11d')]}));})[_0x3fe3('0x25')](handleError(_0xbc6d2a,null));};exports['addApplications']=function(_0x5237c0,_0x1dd617,_0x327a1d){return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x5237c0[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x1dd617,null))[_0x3fe3('0x1c')](function(_0x4f7b09){if(_0x4f7b09){return db[_0x3fe3('0x11e')][_0x3fe3('0xdc')](function(_0x1a903a){return db['ChatApplication'][_0x3fe3('0x32')]({'where':{'ChatWebsiteId':_0x5237c0[_0x3fe3('0x56')]['id']},'transaction':_0x1a903a})[_0x3fe3('0x1c')](function(_0x1dfe0a){var _0x32957c=_['map'](_0x5237c0[_0x3fe3('0x61')],function(_0x4be523){_0x4be523[_0x3fe3('0x67')]=_0x5237c0[_0x3fe3('0x56')]['id'];return _0x4be523;});return db[_0x3fe3('0x11f')][_0x3fe3('0x120')](_0x32957c,{'transaction':_0x1a903a});});})[_0x3fe3('0x1c')](function(){return db[_0x3fe3('0x11f')][_0x3fe3('0x121')]({'where':{'ChatWebsiteId':_0x5237c0['params']['id']},'order':_0x3fe3('0xa1')});});}})[_0x3fe3('0x1c')](respondWithResult(_0x1dd617,null))[_0x3fe3('0x25')](handleError(_0x1dd617,null));};exports['getApplications']=function(_0x51ef55,_0x4dde8b,_0x232f07){var _0x1ecd85={};var _0x204396={};var _0x3e7f07;var _0x25349;return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x51ef55[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x4dde8b,null))[_0x3fe3('0x1c')](function(_0x4dcbda){if(_0x4dcbda){_0x3e7f07=_0x4dcbda;_0x204396[_0x3fe3('0x41')]=_['keys'](db[_0x3fe3('0x11f')][_0x3fe3('0x3d')]);_0x204396[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x51ef55[_0x3fe3('0x43')]);_0x204396[_0x3fe3('0x44')]=_['intersection'](_0x204396[_0x3fe3('0x41')],_0x204396[_0x3fe3('0x43')]);_0x1ecd85[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x204396[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x51ef55['query'][_0x3fe3('0x46')]));_0x1ecd85[_0x3fe3('0x47')]=_0x1ecd85['attributes'][_0x3fe3('0x48')]?_0x1ecd85[_0x3fe3('0x47')]:_0x204396[_0x3fe3('0x41')];_0x1ecd85[_0x3fe3('0x4b')]=qs[_0x3fe3('0x4c')](_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x1ecd85[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_['pick'](_0x51ef55[_0x3fe3('0x43')],_0x204396[_0x3fe3('0x44')]));if(_0x51ef55[_0x3fe3('0x43')]['filter']){_0x1ecd85[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x1ecd85[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x1ecd85[_0x3fe3('0x47')],function(_0x5bf79f){var _0x1976ba={};_0x1976ba[_0x5bf79f]={'$like':'%'+_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x4f')]+'%'};return _0x1976ba;})});}_0x1ecd85=_[_0x3fe3('0x58')]({},_0x1ecd85,_0x51ef55['options']);return _0x3e7f07[_0x3fe3('0x122')](_0x1ecd85);}})[_0x3fe3('0x1c')](function(_0x4ff7d3){if(_0x4ff7d3){_0x25349=_0x4ff7d3['length'];if(!_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x49')]('nolimit')){_0x1ecd85[_0x3fe3('0x2c')]=qs[_0x3fe3('0x2c')](_0x51ef55[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x1ecd85[_0x3fe3('0x2a')]=qs[_0x3fe3('0x2a')](_0x51ef55['query']['offset']);}return _0x3e7f07[_0x3fe3('0x122')](_0x1ecd85);}})[_0x3fe3('0x1c')](function(_0x189e49){if(_0x189e49){return _0x189e49?{'count':_0x25349,'rows':_0x189e49}:null;}})[_0x3fe3('0x1c')](respondWithResult(_0x4dde8b,null))['catch'](handleError(_0x4dde8b,null));};exports['addProactiveActions']=function(_0x459192,_0x3789a2,_0x3c1083){return db[_0x3fe3('0x123')]['find']({'where':{'id':_0x459192[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x3789a2,null))[_0x3fe3('0x1c')](function(_0x1a15e9){if(_0x1a15e9){return _0x1a15e9[_0x3fe3('0x124')](_0x459192[_0x3fe3('0x61')][_0x3fe3('0x69')],_['omit'](_0x459192[_0x3fe3('0x61')],[_0x3fe3('0x69'),'id'])||{});}})['then'](respondWithResult(_0x3789a2,null))['catch'](handleError(_0x3789a2,null));};exports[_0x3fe3('0x10d')]=function(_0x5d29e3,_0x2240d9,_0x286186){var _0x24182d={};var _0x4e1422={};var _0x3ba0b1;var _0x3c7898;return db[_0x3fe3('0x3c')][_0x3fe3('0x66')]({'where':{'id':_0x5d29e3[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x2240d9,null))[_0x3fe3('0x1c')](function(_0x2eec8a){if(_0x2eec8a){_0x3ba0b1=_0x2eec8a;_0x4e1422[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0x125')][_0x3fe3('0x3d')]);_0x4e1422[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x5d29e3['query']);_0x4e1422['filters']=_[_0x3fe3('0x45')](_0x4e1422[_0x3fe3('0x41')],_0x4e1422[_0x3fe3('0x43')]);_0x24182d[_0x3fe3('0x47')]=_['intersection'](_0x4e1422[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x24182d[_0x3fe3('0x47')]=_0x24182d[_0x3fe3('0x47')]['length']?_0x24182d[_0x3fe3('0x47')]:_0x4e1422['model'];_0x24182d['order']=qs['sort'](_0x5d29e3['query'][_0x3fe3('0x4c')]);_0x24182d[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x5d29e3[_0x3fe3('0x43')],_0x4e1422[_0x3fe3('0x44')]));if(_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x24182d[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x24182d[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x24182d[_0x3fe3('0x47')],function(_0x472bd9){var _0x1340f4={};_0x1340f4[_0x472bd9]={'$like':'%'+_0x5d29e3[_0x3fe3('0x43')]['filter']+'%'};return _0x1340f4;})});}_0x24182d=_[_0x3fe3('0x58')]({},_0x24182d,_0x5d29e3[_0x3fe3('0x51')]);return _0x3ba0b1['getProactiveActions'](_0x24182d);}})[_0x3fe3('0x1c')](function(_0x556f86){if(_0x556f86){_0x3c7898=_0x556f86[_0x3fe3('0x48')];if(!_0x5d29e3['query'][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x24182d[_0x3fe3('0x2c')]=qs['limit'](_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x24182d['offset']=qs[_0x3fe3('0x2a')](_0x5d29e3[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}return _0x3ba0b1[_0x3fe3('0x10d')](_0x24182d);}})['then'](function(_0x514d53){if(_0x514d53){return _0x514d53?{'count':_0x3c7898,'rows':_0x514d53}:null;}})[_0x3fe3('0x1c')](respondWithResult(_0x2240d9,null))['catch'](handleError(_0x2240d9,null));};exports[_0x3fe3('0x126')]=function(_0x513053,_0x258fc9,_0x1a0d4e){var _0xdfd02b=_0x513053[_0x3fe3('0x43')][_0x3fe3('0x127')]===_0x3fe3('0x128')?'offlineForm':_0x3fe3('0x129');return db['ChatWebsite']['find']({'attributes':['id',_0xdfd02b],'where':{'id':_0x513053['params']['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x258fc9,null))[_0x3fe3('0x1c')](function(_0x575e34){if(_0x575e34){var _0x2d7c82=_0x575e34[_0xdfd02b];var _0x205777=_0x2d7c82&&_0x2d7c82[_0x3fe3('0x12a')]?_0x2d7c82['items']:[];_0x258fc9[_0x3fe3('0x38')]({'fromKey':_['isNil'](_0x2d7c82[_0x3fe3('0x12b')])?undefined:_0x2d7c82[_0x3fe3('0x12b')],'count':_0x205777[_0x3fe3('0x48')],'rows':_0x205777});}})['catch'](handleError(_0x258fc9,null));};exports['getOfflineMessages']=function(_0x4a4992,_0xbafff3,_0x171396){var _0x130569={'raw':![],'where':{}};var _0x7c1b4b={};var _0x2e0754={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3fe3('0x66')]({'where':{'id':_0x4a4992[_0x3fe3('0x56')]['id']}})['then'](handleEntityNotFound(_0xbafff3,null))[_0x3fe3('0x1c')](function(_0x33af9d){if(_0x33af9d){_0x7c1b4b[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0xd5')]['rawAttributes']);_0x7c1b4b[_0x3fe3('0x43')]=_[_0x3fe3('0x57')](_0x4a4992[_0x3fe3('0x43')]);_0x7c1b4b['filters']=_[_0x3fe3('0x45')](_0x7c1b4b[_0x3fe3('0x41')],_0x7c1b4b[_0x3fe3('0x43')]);_0x130569[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x7c1b4b[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x130569[_0x3fe3('0x47')]=_0x130569['attributes'][_0x3fe3('0x48')]?_0x130569[_0x3fe3('0x47')]:_0x7c1b4b[_0x3fe3('0x41')];if(!_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x49')](_0x3fe3('0x4a'))){_0x130569[_0x3fe3('0x2c')]=qs['limit'](_0x4a4992[_0x3fe3('0x43')]['limit']);_0x130569[_0x3fe3('0x2a')]=qs['offset'](_0x4a4992['query'][_0x3fe3('0x2a')]);}_0x130569[_0x3fe3('0x4b')]=qs['sort'](_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x4c')]);_0x130569['where']=qs[_0x3fe3('0x44')](_[_0x3fe3('0x4e')](_0x4a4992[_0x3fe3('0x43')],_0x7c1b4b[_0x3fe3('0x44')]));_0x130569[_0x3fe3('0x4d')][_0x3fe3('0x67')]=_0x33af9d['id'];if(_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x130569['where']=_[_0x3fe3('0x58')](_0x130569[_0x3fe3('0x4d')],{'$or':_[_0x3fe3('0x42')](_0x130569[_0x3fe3('0x47')],function(_0xfbcf0f){var _0x4eb31c={};_0x4eb31c[_0xfbcf0f]={'$like':'%'+_0x4a4992['query'][_0x3fe3('0x4f')]+'%'};return _0x4eb31c;})});}_0x130569=_['merge']({},_0x130569,_0x4a4992[_0x3fe3('0x51')]);return db['ChatOfflineMessage']['count']({'where':_0x130569['where']})['then'](function(_0x2a0886){_0x2e0754[_0x3fe3('0x2d')]=_0x2a0886;if(_0x4a4992[_0x3fe3('0x43')][_0x3fe3('0x52')]){_0x130569[_0x3fe3('0x53')]=[{'all':!![]}];}else{_0x130569[_0x3fe3('0x53')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x3fe3('0xdd')],'as':_0x3fe3('0x12c'),'required':![]}];}return db[_0x3fe3('0xd5')][_0x3fe3('0x101')](_0x130569);})[_0x3fe3('0x1c')](function(_0x3f7516){_0x2e0754[_0x3fe3('0x54')]=_0x3f7516;return _0x2e0754;});}})[_0x3fe3('0x1c')](respondWithFilteredResult(_0xbafff3,_0x130569))['catch'](handleError(_0xbafff3,null));};exports[_0x3fe3('0x12d')]=function(_0x55aa16,_0x118c4a,_0x365910){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x55aa16[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x118c4a,null))['then'](function(_0x19db34){if(_0x19db34){return _0x19db34[_0x3fe3('0x12d')](_0x55aa16['body'][_0x3fe3('0x69')],_[_0x3fe3('0x12e')](_0x55aa16['body'],[_0x3fe3('0x69'),'id'])||{})[_0x3fe3('0xb8')](function(_0x817a2){for(var _0x316431=0x0;_0x316431<_0x55aa16[_0x3fe3('0x61')][_0x3fe3('0x69')][_0x3fe3('0x48')];_0x316431+=0x1){socket[_0x3fe3('0x12f')]('userChatWebsite:save',{'UserId':Number(_0x55aa16[_0x3fe3('0x61')][_0x3fe3('0x69')][_0x316431]),'ChatWebsiteId':Number(_0x55aa16[_0x3fe3('0x56')]['id'])});}return _0x817a2;});}})[_0x3fe3('0x1c')](respondWithResult(_0x118c4a,null))[_0x3fe3('0x25')](handleError(_0x118c4a,null));};exports[_0x3fe3('0x130')]=function(_0x2417ee,_0x5902ec,_0x51c2c6){return db[_0x3fe3('0x3c')][_0x3fe3('0x59')]({'where':{'id':_0x2417ee[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x5902ec,null))['then'](function(_0x55dbb7){if(_0x55dbb7){return _0x55dbb7['removeAgents'](_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')])[_0x3fe3('0x1c')](function(){if(_['isArray'](_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')])){for(var _0x46801b=0x0;_0x46801b<_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')][_0x3fe3('0x48')];_0x46801b+=0x1){socket[_0x3fe3('0x12f')]('userChatWebsite:remove',{'UserId':Number(_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')][_0x46801b]),'ChatWebsiteId':Number(_0x2417ee[_0x3fe3('0x56')]['id'])});}}else{socket[_0x3fe3('0x12f')](_0x3fe3('0x131'),{'UserId':Number(_0x2417ee[_0x3fe3('0x43')][_0x3fe3('0x69')]),'ChatWebsiteId':Number(_0x2417ee[_0x3fe3('0x56')]['id'])});}});}})[_0x3fe3('0x1c')](respondWithStatusCode(_0x5902ec,null))[_0x3fe3('0x25')](handleError(_0x5902ec,null));};exports[_0x3fe3('0x132')]=function(_0x44ffae,_0x1715bb,_0x2a9f08){var _0x210c63={};var _0x43740a={};var _0x287142;var _0x3275b2;return db['ChatWebsite'][_0x3fe3('0x66')]({'where':{'id':_0x44ffae[_0x3fe3('0x56')]['id']}})[_0x3fe3('0x1c')](handleEntityNotFound(_0x1715bb,null))['then'](function(_0x968c98){if(_0x968c98){_0x287142=_0x968c98;_0x43740a[_0x3fe3('0x41')]=_[_0x3fe3('0x57')](db[_0x3fe3('0xc2')]['rawAttributes']);_0x43740a['query']=_['keys'](_0x44ffae[_0x3fe3('0x43')]);_0x43740a[_0x3fe3('0x44')]=_[_0x3fe3('0x45')](_0x43740a['model'],_0x43740a[_0x3fe3('0x43')]);_0x210c63[_0x3fe3('0x47')]=_[_0x3fe3('0x45')](_0x43740a[_0x3fe3('0x41')],qs[_0x3fe3('0x46')](_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x46')]));_0x210c63[_0x3fe3('0x47')]=_0x210c63[_0x3fe3('0x47')][_0x3fe3('0x48')]?_0x210c63[_0x3fe3('0x47')]:_0x43740a[_0x3fe3('0x41')];_0x210c63[_0x3fe3('0x4b')]=qs[_0x3fe3('0x4c')](_0x44ffae[_0x3fe3('0x43')]['sort']);_0x210c63[_0x3fe3('0x4d')]=qs[_0x3fe3('0x44')](_['pick'](_0x44ffae[_0x3fe3('0x43')],_0x43740a['filters']));if(_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x4f')]){_0x210c63[_0x3fe3('0x4d')]=_[_0x3fe3('0x58')](_0x210c63[_0x3fe3('0x4d')],{'$or':_['map'](_0x210c63['attributes'],function(_0x1ef9c5){var _0x3255db={};_0x3255db[_0x1ef9c5]={'$like':'%'+_0x44ffae['query'][_0x3fe3('0x4f')]+'%'};return _0x3255db;})});}_0x210c63=_[_0x3fe3('0x58')]({},_0x210c63,_0x44ffae[_0x3fe3('0x51')]);return _0x287142['getAgents'](_0x210c63);}})[_0x3fe3('0x1c')](function(_0x327e06){if(_0x327e06){_0x3275b2=_0x327e06['length'];if(!_0x44ffae[_0x3fe3('0x43')]['hasOwnProperty'](_0x3fe3('0x4a'))){_0x210c63[_0x3fe3('0x2c')]=qs['limit'](_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x2c')]);_0x210c63['offset']=qs[_0x3fe3('0x2a')](_0x44ffae[_0x3fe3('0x43')][_0x3fe3('0x2a')]);}return _0x287142[_0x3fe3('0x132')](_0x210c63);}})['then'](function(_0x14c517){if(_0x14c517){return _0x14c517?{'count':_0x3275b2,'rows':_0x14c517}:null;}})[_0x3fe3('0x1c')](respondWithResult(_0x1715bb,null))[_0x3fe3('0x25')](handleError(_0x1715bb,null));};
\ No newline at end of file
index e9eb1d5..16940c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3663=['../../mysqldb','ChatWebsite','save','update','emit','hasOwnProperty','hook','events'];(function(_0x4a1835,_0xe4a237){var _0x203f1b=function(_0x52886e){while(--_0x52886e){_0x4a1835['push'](_0x4a1835['shift']());}};_0x203f1b(++_0xe4a237);}(_0x3663,0x1cf));var _0x3366=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0x3663[_0x3de4f8];return _0x3d81fc;};'use strict';var EventEmitter=require(_0x3366('0x0'));var ChatWebsite=require(_0x3366('0x1'))['db'][_0x3366('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3366('0x3'),'afterUpdate':_0x3366('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2daeb7){return function(_0x206d65,_0x2c87e1,_0x16593e){ChatWebsiteEvents[_0x3366('0x5')](_0x2daeb7+':'+_0x206d65['id'],_0x206d65);ChatWebsiteEvents['emit'](_0x2daeb7,_0x206d65);_0x16593e(null);};}for(var e in events){if(events[_0x3366('0x6')](e)){var event=events[e];ChatWebsite[_0x3366('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x757f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite'];(function(_0x7ddf5a,_0x3e0253){var _0x2c8abd=function(_0x15cc34){while(--_0x15cc34){_0x7ddf5a['push'](_0x7ddf5a['shift']());}};_0x2c8abd(++_0x3e0253);}(_0x757f,0xee));var _0xf757=function(_0x2fbb8c,_0x15bc93){_0x2fbb8c=_0x2fbb8c-0x0;var _0x1005b4=_0x757f[_0x2fbb8c];return _0x1005b4;};'use strict';var EventEmitter=require(_0xf757('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xf757('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf757('0x2')](0x0);var events={'afterCreate':_0xf757('0x3'),'afterUpdate':_0xf757('0x4'),'afterDestroy':_0xf757('0x5')};function emitEvent(_0x44ebcf){return function(_0x26a38a,_0x302fba,_0x958ba7){ChatWebsiteEvents['emit'](_0x44ebcf+':'+_0x26a38a['id'],_0x26a38a);ChatWebsiteEvents[_0xf757('0x6')](_0x44ebcf,_0x26a38a);_0x958ba7(null);};}for(var e in events){if(events[_0xf757('0x7')](e)){var event=events[e];ChatWebsite[_0xf757('0x8')](e,emitEvent(event));}}module[_0xf757('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
index 846c287..ab4102a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x676e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite'];(function(_0x1aa2a2,_0x570bb3){var _0x596b90=function(_0x3c6c5e){while(--_0x3c6c5e){_0x1aa2a2['push'](_0x1aa2a2['shift']());}};_0x596b90(++_0x570bb3);}(_0x676e,0x1c7));var _0xe676=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x676e[_0x3f3a47];return _0x57a682;};'use strict';var _=require(_0xe676('0x0'));var util=require(_0xe676('0x1'));var logger=require(_0xe676('0x2'))(_0xe676('0x3'));var moment=require(_0xe676('0x4'));var BPromise=require(_0xe676('0x5'));var rp=require(_0xe676('0x6'));var fs=require('fs');var path=require(_0xe676('0x7'));var rimraf=require(_0xe676('0x8'));var config=require(_0xe676('0x9'));var attributes=require(_0xe676('0xa'));module['exports']=function(_0x1318b7,_0x300a78){return _0x1318b7[_0xe676('0xb')](_0xe676('0xc'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x424f=['chat_websites','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','ChatWebsite'];(function(_0x1b8e60,_0x21b885){var _0x363363=function(_0x5987c7){while(--_0x5987c7){_0x1b8e60['push'](_0x1b8e60['shift']());}};_0x363363(++_0x21b885);}(_0x424f,0x76));var _0xf424=function(_0x4fce1e,_0x5e9dfe){_0x4fce1e=_0x4fce1e-0x0;var _0x27ea1c=_0x424f[_0x4fce1e];return _0x27ea1c;};'use strict';var _=require(_0xf424('0x0'));var util=require('util');var logger=require(_0xf424('0x1'))(_0xf424('0x2'));var moment=require(_0xf424('0x3'));var BPromise=require(_0xf424('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf424('0x5'));var config=require(_0xf424('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x1ef4d0,_0x11250c){return _0x1ef4d0['define'](_0xf424('0x7'),attributes,{'tableName':_0xf424('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a2d712f..5ac06ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97fe=['defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x97fe,0x1ac));var _0xe97f=function(_0x1bc084,_0x204724){_0x1bc084=_0x1bc084-0x0;var _0x50e8a0=_0x97fe[_0x1bc084];return _0x50e8a0;};'use strict';var _=require(_0xe97f('0x0'));var util=require(_0xe97f('0x1'));var moment=require(_0xe97f('0x2'));var BPromise=require(_0xe97f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97f('0x4'));var db=require(_0xe97f('0x5'))['db'];var utils=require(_0xe97f('0x6'));var logger=require(_0xe97f('0x7'))(_0xe97f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe97f('0x9')](config[_0xe97f('0xa')],{'host':_0xe97f('0xb'),'port':0x18eb});var socket=require(_0xe97f('0xc'))(new Redis(config[_0xe97f('0xa')]));require(_0xe97f('0xd'))['register'](socket);function respondWithRpcPromise(_0x9abcf2,_0x10a08a,_0x5302fc){return new BPromise(function(_0x51bb90,_0x431749){return client[_0xe97f('0xe')](_0x9abcf2,_0x5302fc)[_0xe97f('0xf')](function(_0x201b00){logger[_0xe97f('0x10')](_0xe97f('0x11'),_0x10a08a,_0xe97f('0x12'));logger[_0xe97f('0x13')](_0xe97f('0x14'),_0x10a08a,_0xe97f('0x12'),JSON['stringify'](_0x201b00));if(_0x201b00[_0xe97f('0x15')]){if(_0x201b00[_0xe97f('0x15')]['code']===0x1f4){logger[_0xe97f('0x15')](_0xe97f('0x11'),_0x10a08a,_0x201b00[_0xe97f('0x15')]['message']);return _0x431749(_0x201b00[_0xe97f('0x15')][_0xe97f('0x16')]);}logger[_0xe97f('0x15')](_0xe97f('0x11'),_0x10a08a,_0x201b00['error'][_0xe97f('0x16')]);return _0x51bb90(_0x201b00[_0xe97f('0x15')]['message']);}else{logger['info'](_0xe97f('0x11'),_0x10a08a,'request\x20sent');_0x51bb90(_0x201b00['result'][_0xe97f('0x16')]);}})['catch'](function(_0x467838){logger[_0xe97f('0x15')](_0xe97f('0x11'),_0x10a08a,_0x467838);_0x431749(_0x467838);});});}
\ No newline at end of file
+var _0x0ba3=['redis','defaults','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x45b976,_0x3ac0e3){var _0x42c656=function(_0x8025da){while(--_0x8025da){_0x45b976['push'](_0x45b976['shift']());}};_0x42c656(++_0x3ac0e3);}(_0x0ba3,0x70));var _0x30ba=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x0ba3[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0x30ba('0x0'));var util=require(_0x30ba('0x1'));var moment=require(_0x30ba('0x2'));var BPromise=require(_0x30ba('0x3'));var rs=require(_0x30ba('0x4'));var fs=require('fs');var Redis=require(_0x30ba('0x5'));var db=require(_0x30ba('0x6'))['db'];var utils=require(_0x30ba('0x7'));var logger=require(_0x30ba('0x8'))(_0x30ba('0x9'));var config=require('../../config/environment');var jayson=require(_0x30ba('0xa'));var client=jayson[_0x30ba('0xb')][_0x30ba('0xc')]({'port':0x232a});config[_0x30ba('0xd')]=_[_0x30ba('0xe')](config[_0x30ba('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x30ba('0xf'))(new Redis(config['redis']));require(_0x30ba('0x10'))['register'](socket);function respondWithRpcPromise(_0x13359a,_0x11e2a2,_0xd77125){return new BPromise(function(_0x3b04f1,_0x166e04){return client['request'](_0x13359a,_0xd77125)['then'](function(_0x4a6634){logger[_0x30ba('0x11')](_0x30ba('0x12'),_0x11e2a2,_0x30ba('0x13'));logger[_0x30ba('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x11e2a2,_0x30ba('0x13'),JSON['stringify'](_0x4a6634));if(_0x4a6634[_0x30ba('0x15')]){if(_0x4a6634[_0x30ba('0x15')][_0x30ba('0x16')]===0x1f4){logger[_0x30ba('0x15')](_0x30ba('0x12'),_0x11e2a2,_0x4a6634['error'][_0x30ba('0x17')]);return _0x166e04(_0x4a6634['error'][_0x30ba('0x17')]);}logger[_0x30ba('0x15')](_0x30ba('0x12'),_0x11e2a2,_0x4a6634['error'][_0x30ba('0x17')]);return _0x3b04f1(_0x4a6634[_0x30ba('0x15')][_0x30ba('0x17')]);}else{logger['info'](_0x30ba('0x12'),_0x11e2a2,'request\x20sent');_0x3b04f1(_0x4a6634[_0x30ba('0x18')][_0x30ba('0x17')]);}})['catch'](function(_0x1ae53d){logger[_0x30ba('0x15')](_0x30ba('0x12'),_0x11e2a2,_0x1ae53d);_0x166e04(_0x1ae53d);});});}
\ No newline at end of file
index 3d27332..7022856 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6111=['./chatWebsite.events','save','update','emit','removeListener'];(function(_0x248ae0,_0x33ba9b){var _0xa8500d=function(_0x17de2e){while(--_0x17de2e){_0x248ae0['push'](_0x248ae0['shift']());}};_0xa8500d(++_0x33ba9b);}(_0x6111,0x64));var _0x1611=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6111[_0x502c7d];return _0x30b7ed;};'use strict';var ChatWebsiteEvents=require(_0x1611('0x0'));var events=[_0x1611('0x1'),'remove',_0x1611('0x2')];function createListener(_0x199fc0,_0x418f7b){return function(_0x522246){_0x418f7b[_0x1611('0x3')](_0x199fc0,_0x522246);};}function removeListener(_0x36745f,_0x43b078){return function(){ChatWebsiteEvents[_0x1611('0x4')](_0x36745f,_0x43b078);};}exports['register']=function(_0x591cb2){for(var _0xbbbf61=0x0,_0x148989=events['length'];_0xbbbf61<_0x148989;_0xbbbf61++){var _0x5b5960=events[_0xbbbf61];var _0x3b52a1=createListener('chatWebsite:'+_0x5b5960,_0x591cb2);ChatWebsiteEvents['on'](_0x5b5960,_0x3b52a1);}};
\ No newline at end of file
+var _0xf65a=['./chatWebsite.events','remove','update','emit','removeListener','register','chatWebsite:'];(function(_0x505dcb,_0x3d3646){var _0x3f1944=function(_0x22dfa1){while(--_0x22dfa1){_0x505dcb['push'](_0x505dcb['shift']());}};_0x3f1944(++_0x3d3646);}(_0xf65a,0x10a));var _0xaf65=function(_0x2b2641,_0x28312b){_0x2b2641=_0x2b2641-0x0;var _0x36d9f4=_0xf65a[_0x2b2641];return _0x36d9f4;};'use strict';var ChatWebsiteEvents=require(_0xaf65('0x0'));var events=['save',_0xaf65('0x1'),_0xaf65('0x2')];function createListener(_0x52f995,_0x3b40ec){return function(_0x1e017e){_0x3b40ec[_0xaf65('0x3')](_0x52f995,_0x1e017e);};}function removeListener(_0x30026c,_0x2de4ae){return function(){ChatWebsiteEvents[_0xaf65('0x4')](_0x30026c,_0x2de4ae);};}exports[_0xaf65('0x5')]=function(_0x1ba358){for(var _0x63857f=0x0,_0x284cfa=events['length'];_0x63857f<_0x284cfa;_0x63857f++){var _0x2c2a48=events[_0x63857f];var _0x37bf1f=createListener(_0xaf65('0x6')+_0x2c2a48,_0x1ba358);ChatWebsiteEvents['on'](_0x2c2a48,_0x37bf1f);}};
\ No newline at end of file
index 2891eca..7ed7c47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4531=['removeDispositions','removeAnswers','delete','removeAgents','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','describe','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','server/files/images/avatars/','single','file','addAvatar','addCustomerAvatar','addSystemAvatar','server/files','attachments','ensureDir','replace','any','addInteraction','/:id/applications','addProactiveActions','addAgents','put','update','destroy'];(function(_0x340a30,_0x23aa69){var _0x4a54ba=function(_0x4e4064){while(--_0x4e4064){_0x340a30['push'](_0x340a30['shift']());}};_0x4a54ba(++_0x23aa69);}(_0x4531,0x13f));var _0x1453=function(_0x4c8076,_0x332091){_0x4c8076=_0x4c8076-0x0;var _0x50ee21=_0x4531[_0x4c8076];return _0x50ee21;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1453('0x0'));var express=require('express');var router=express[_0x1453('0x1')]();var fs_extra=require(_0x1453('0x2'));var auth=require(_0x1453('0x3'));var interaction=require(_0x1453('0x4'));var config=require('../../config/environment');var controller=require(_0x1453('0x5'));router['get']('/',auth[_0x1453('0x6')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1453('0x7')]);router[_0x1453('0x8')]('/:id',auth[_0x1453('0x6')](),controller[_0x1453('0x9')]);router[_0x1453('0x8')](_0x1453('0xa'),auth[_0x1453('0x6')](),controller[_0x1453('0xb')]);router[_0x1453('0x8')](_0x1453('0xc'),auth['isAuthenticated'](),controller[_0x1453('0xd')]);router[_0x1453('0x8')](_0x1453('0xe'),controller[_0x1453('0xf')]);router[_0x1453('0x8')](_0x1453('0x10'),controller[_0x1453('0x11')]);router[_0x1453('0x8')](_0x1453('0x12'),controller[_0x1453('0x13')]);router[_0x1453('0x8')]('/:id/system_avatar',controller[_0x1453('0x14')]);router[_0x1453('0x8')](_0x1453('0x15'),auth[_0x1453('0x6')](),controller[_0x1453('0x16')]);router[_0x1453('0x8')]('/:id/snippet',controller[_0x1453('0x17')]);router['get']('/:id/applications',auth[_0x1453('0x6')](),controller['getApplications']);router['get'](_0x1453('0x18'),auth[_0x1453('0x6')](),controller[_0x1453('0x19')]);router[_0x1453('0x8')](_0x1453('0x1a'),controller[_0x1453('0x1b')]);router['get'](_0x1453('0x1c'),auth[_0x1453('0x6')](),controller[_0x1453('0x1d')]);router[_0x1453('0x8')](_0x1453('0x1e'),auth[_0x1453('0x6')](),controller[_0x1453('0x1f')]);router[_0x1453('0x20')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1453('0x20')](_0x1453('0xa'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x1453('0xc'),auth[_0x1453('0x6')](),controller[_0x1453('0x21')]);var upload=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x4e2b18,_0x4020d3,_0x133482){_0x133482(null,path[_0x1453('0x23')](config[_0x1453('0x24')],'server/files/images/logos/'));},'filename':function(_0x13c1ef,_0x292144,_0x189249){_0x189249(null,util[_0x1453('0x25')](_0x1453('0x26'),Date[_0x1453('0x27')](),_0x292144[_0x1453('0x28')]));}})});router[_0x1453('0x20')]('/:id/logo',upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x5d89d3,_0x3965c1,_0x204c99){_0x204c99(null,path[_0x1453('0x23')](config['root'],_0x1453('0x29')));},'filename':function(_0x598811,_0x53c77d,_0x2e9eaf){_0x2e9eaf(null,util[_0x1453('0x25')]('%s-%s',Date['now'](),_0x53c77d[_0x1453('0x28')]));}})});router['post'](_0x1453('0x10'),upload[_0x1453('0x2a')](_0x1453('0x2b')),controller[_0x1453('0x2c')]);var upload=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x4d2faf,_0x3ad949,_0x456270){_0x456270(null,path[_0x1453('0x23')](config['root'],_0x1453('0x29')));},'filename':function(_0x5ee0b6,_0x144e1e,_0x130b29){_0x130b29(null,util[_0x1453('0x25')](_0x1453('0x26'),Date[_0x1453('0x27')](),_0x144e1e[_0x1453('0x28')]));}})});router[_0x1453('0x20')](_0x1453('0x12'),upload[_0x1453('0x2a')](_0x1453('0x2b')),controller[_0x1453('0x2d')]);var upload=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x3ea81a,_0x276190,_0x3ce4ce){_0x3ce4ce(null,path[_0x1453('0x23')](config[_0x1453('0x24')],_0x1453('0x29')));},'filename':function(_0x73a10a,_0x140eaa,_0x4784fb){_0x4784fb(null,util[_0x1453('0x25')](_0x1453('0x26'),Date[_0x1453('0x27')](),_0x140eaa[_0x1453('0x28')]));}})});router[_0x1453('0x20')]('/:id/system_avatar',upload['single'](_0x1453('0x2b')),controller[_0x1453('0x2e')]);router[_0x1453('0x20')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x1453('0x22')]({'destination':function(_0x21e15c,_0x5942a7,_0x3b8559){const _0x7af293=path[_0x1453('0x23')](config[_0x1453('0x24')],_0x1453('0x2f'),_0x1453('0x30'),'offline-chat');fs_extra[_0x1453('0x31')](_0x7af293,function(){_0x3b8559(null,_0x7af293);});},'filename':function(_0x9c5f,_0x30667b,_0x55223c){const _0x33f876=_0x30667b[_0x1453('0x28')][_0x1453('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1e08ad=path['extname'](_0x33f876);const _0x34647c=Date[_0x1453('0x27')]()+'-'+_0x33f876[_0x1453('0x32')](_0x1e08ad,'')+_0x1e08ad;_0x55223c(null,_0x34647c);}})});router[_0x1453('0x20')]('/:id/offline',offlineUploadMulter[_0x1453('0x33')](),controller['offline']);router['post'](_0x1453('0x15'),auth['isAuthenticated'](),controller[_0x1453('0x34')]);router[_0x1453('0x20')](_0x1453('0x35'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x1453('0x18'),auth[_0x1453('0x6')](),controller[_0x1453('0x36')]);router[_0x1453('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0x1453('0x37')]);router[_0x1453('0x38')]('/:id',auth[_0x1453('0x6')](),controller[_0x1453('0x39')]);router['delete']('/:id',auth[_0x1453('0x6')](),controller[_0x1453('0x3a')]);router['delete'](_0x1453('0xa'),auth['isAuthenticated'](),controller[_0x1453('0x3b')]);router['delete'](_0x1453('0xc'),auth[_0x1453('0x6')](),controller[_0x1453('0x3c')]);router[_0x1453('0x3d')]('/:id/users',auth['isAuthenticated'](),controller[_0x1453('0x3e')]);module['exports']=router;
\ No newline at end of file
+var _0xcc60=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatWebsite.controller','isAuthenticated','/describe','get','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','root','format','%s-%s','now','single','addLogo','join','server/files/images/avatars/','originalname','file','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','extname','/:id/offline','any','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','put','/:id','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x2e2c52,_0x7e90fb){var _0x5918c5=function(_0x3f99a7){while(--_0x3f99a7){_0x2e2c52['push'](_0x2e2c52['shift']());}};_0x5918c5(++_0x7e90fb);}(_0xcc60,0x94));var _0x0cc6=function(_0xb38540,_0x1fc920){_0xb38540=_0xb38540-0x0;var _0x27fa72=_0xcc60[_0xb38540];return _0x27fa72;};'use strict';var multer=require(_0x0cc6('0x0'));var util=require(_0x0cc6('0x1'));var path=require(_0x0cc6('0x2'));var timeout=require(_0x0cc6('0x3'));var express=require(_0x0cc6('0x4'));var router=express[_0x0cc6('0x5')]();var fs_extra=require(_0x0cc6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0cc6('0x7'));var controller=require(_0x0cc6('0x8'));router['get']('/',auth[_0x0cc6('0x9')](),controller['index']);router['get'](_0x0cc6('0xa'),auth[_0x0cc6('0x9')](),controller['describe']);router[_0x0cc6('0xb')]('/:id',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0xc')]);router[_0x0cc6('0xb')](_0x0cc6('0xd'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0xe')]);router['get'](_0x0cc6('0xf'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x10')]);router[_0x0cc6('0xb')](_0x0cc6('0x11'),controller[_0x0cc6('0x12')]);router[_0x0cc6('0xb')](_0x0cc6('0x13'),controller[_0x0cc6('0x14')]);router['get']('/:id/customer_avatar',controller[_0x0cc6('0x15')]);router[_0x0cc6('0xb')](_0x0cc6('0x16'),controller['getSystemAvatar']);router[_0x0cc6('0xb')](_0x0cc6('0x17'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x18')]);router[_0x0cc6('0xb')]('/:id/snippet',controller[_0x0cc6('0x19')]);router[_0x0cc6('0xb')](_0x0cc6('0x1a'),auth[_0x0cc6('0x9')](),controller['getApplications']);router[_0x0cc6('0xb')]('/:id/proactive_actions',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x1b')]);router[_0x0cc6('0xb')](_0x0cc6('0x1c'),controller[_0x0cc6('0x1d')]);router[_0x0cc6('0xb')](_0x0cc6('0x1e'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x1f')]);router[_0x0cc6('0xb')](_0x0cc6('0x20'),auth[_0x0cc6('0x9')](),controller['getAgents']);router[_0x0cc6('0x21')]('/',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x22')]);router[_0x0cc6('0x21')](_0x0cc6('0xd'),auth['isAuthenticated'](),controller[_0x0cc6('0x23')]);router['post'](_0x0cc6('0xf'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x24')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x42c430,_0x56dbf9,_0x4cac90){_0x4cac90(null,path['join'](config[_0x0cc6('0x26')],'server/files/images/logos/'));},'filename':function(_0x14b259,_0x5d6a39,_0x15afa8){_0x15afa8(null,util[_0x0cc6('0x27')](_0x0cc6('0x28'),Date[_0x0cc6('0x29')](),_0x5d6a39['originalname']));}})});router[_0x0cc6('0x21')](_0x0cc6('0x11'),upload[_0x0cc6('0x2a')]('file'),controller[_0x0cc6('0x2b')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x5affc4,_0x2090c8,_0x20d982){_0x20d982(null,path[_0x0cc6('0x2c')](config[_0x0cc6('0x26')],_0x0cc6('0x2d')));},'filename':function(_0x882ef3,_0x3b603e,_0x24728e){_0x24728e(null,util[_0x0cc6('0x27')]('%s-%s',Date['now'](),_0x3b603e[_0x0cc6('0x2e')]));}})});router[_0x0cc6('0x21')](_0x0cc6('0x13'),upload[_0x0cc6('0x2a')](_0x0cc6('0x2f')),controller[_0x0cc6('0x30')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x67d9f8,_0x344ec6,_0x1392fb){_0x1392fb(null,path[_0x0cc6('0x2c')](config[_0x0cc6('0x26')],'server/files/images/avatars/'));},'filename':function(_0x47cfd3,_0x1448a9,_0x30a663){_0x30a663(null,util['format'](_0x0cc6('0x28'),Date[_0x0cc6('0x29')](),_0x1448a9[_0x0cc6('0x2e')]));}})});router[_0x0cc6('0x21')](_0x0cc6('0x31'),upload[_0x0cc6('0x2a')](_0x0cc6('0x2f')),controller[_0x0cc6('0x32')]);var upload=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x2b5517,_0x9fba4e,_0x342ee4){_0x342ee4(null,path['join'](config[_0x0cc6('0x26')],_0x0cc6('0x2d')));},'filename':function(_0x570efa,_0x42a49e,_0x3facf5){_0x3facf5(null,util[_0x0cc6('0x27')]('%s-%s',Date['now'](),_0x42a49e[_0x0cc6('0x2e')]));}})});router[_0x0cc6('0x21')](_0x0cc6('0x16'),upload[_0x0cc6('0x2a')](_0x0cc6('0x2f')),controller[_0x0cc6('0x33')]);router[_0x0cc6('0x21')](_0x0cc6('0x34'),controller[_0x0cc6('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x0cc6('0x25')]({'destination':function(_0x9fabb1,_0x1b88b7,_0x226bb8){const _0x5920d1=path[_0x0cc6('0x2c')](config[_0x0cc6('0x26')],_0x0cc6('0x36'),_0x0cc6('0x37'),'offline-chat');fs_extra[_0x0cc6('0x38')](_0x5920d1,function(){_0x226bb8(null,_0x5920d1);});},'filename':function(_0x4d1257,_0x5add92,_0x12e22b){const _0xf281b=_0x5add92['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1c065d=path[_0x0cc6('0x39')](_0xf281b);const _0x5d3a7b=Date[_0x0cc6('0x29')]()+'-'+_0xf281b['replace'](_0x1c065d,'')+_0x1c065d;_0x12e22b(null,_0x5d3a7b);}})});router['post'](_0x0cc6('0x3a'),offlineUploadMulter[_0x0cc6('0x3b')](),controller['offline']);router[_0x0cc6('0x21')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x0cc6('0x3c')]);router['post'](_0x0cc6('0x1a'),auth['isAuthenticated'](),controller[_0x0cc6('0x3d')]);router[_0x0cc6('0x21')](_0x0cc6('0x3e'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x3f')]);router[_0x0cc6('0x21')](_0x0cc6('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x0cc6('0x40')](_0x0cc6('0x41'),auth['isAuthenticated'](),controller[_0x0cc6('0x42')]);router[_0x0cc6('0x43')]('/:id',auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x44')]);router[_0x0cc6('0x43')](_0x0cc6('0xd'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x45')]);router[_0x0cc6('0x43')](_0x0cc6('0xf'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x46')]);router[_0x0cc6('0x43')](_0x0cc6('0x20'),auth[_0x0cc6('0x9')](),controller[_0x0cc6('0x47')]);module[_0x0cc6('0x48')]=router;
\ No newline at end of file
index e808847..c387ff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd072=['sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x3cc1ca,_0x42e033){var _0x4007ff=function(_0x2608a2){while(--_0x2608a2){_0x3cc1ca['push'](_0x3cc1ca['shift']());}};_0x4007ff(++_0x42e033);}(_0xd072,0x132));var _0x2d07=function(_0x142b70,_0x910f9b){_0x142b70=_0x142b70-0x0;var _0x49222a=_0xd072[_0x142b70];return _0x49222a;};'use strict';var Sequelize=require(_0x2d07('0x0'));module[_0x2d07('0x1')]={'name':{'type':Sequelize[_0x2d07('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2d07('0x3')](_0x2d07('0x4'),_0x2d07('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2d07('0x2')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0763=['STRING','ENUM','Google','sequelize'];(function(_0x52c51a,_0x31478a){var _0x20089c=function(_0x5b163c){while(--_0x5b163c){_0x52c51a['push'](_0x52c51a['shift']());}};_0x20089c(++_0x31478a);}(_0x0763,0x87));var _0x3076=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x0763[_0xa45395];return _0x3c83d2;};'use strict';var Sequelize=require(_0x3076('0x0'));module['exports']={'name':{'type':Sequelize[_0x3076('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3076('0x2')]('AmazonAWS',_0x3076('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3076('0x1')]},'data2':{'type':Sequelize[_0x3076('0x1')]}};
\ No newline at end of file
index 249d164..af5fe45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['update','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','CloudProvider','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x490cf7,_0x21e01){var _0x26b65e=function(_0x2f9ec9){while(--_0x2f9ec9){_0x490cf7['push'](_0x490cf7['shift']());}};_0x26b65e(++_0x21e01);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['CloudProvider'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};
\ No newline at end of file
+var _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x41dc41,_0x11b458){var _0x3a112f=function(_0x42e7c1){while(--_0x42e7c1){_0x41dc41['push'](_0x41dc41['shift']());}};_0x3a112f(++_0x11b458);}(_0x2032,0xd9));var _0x2203=function(_0x277f49,_0x4717d1){_0x277f49=_0x277f49-0x0;var _0x1bb801=_0x2032[_0x277f49];return _0x1bb801;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));};
\ No newline at end of file
index dba386d..9c87f26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x433f=['moment','bluebird','request-promise','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x329c21,_0x1d1548){var _0x353b8f=function(_0x33af04){while(--_0x33af04){_0x329c21['push'](_0x329c21['shift']());}};_0x353b8f(++_0x1d1548);}(_0x433f,0x8b));var _0xf433=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x433f[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xf433('0x0'));var util=require(_0xf433('0x1'));var logger=require(_0xf433('0x2'))(_0xf433('0x3'));var moment=require(_0xf433('0x4'));var BPromise=require(_0xf433('0x5'));var rp=require(_0xf433('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf433('0x7'));var attributes=require(_0xf433('0x8'));module[_0xf433('0x9')]=function(_0x42c584,_0x3cc9e0){return _0x42c584[_0xf433('0xa')](_0xf433('0xb'),attributes,{'tableName':_0xf433('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f3d=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0x3f3d,0x1ac));var _0xd3f3=function(_0x4e9861,_0x25fe5f){_0x4e9861=_0x4e9861-0x0;var _0x49802f=_0x3f3d[_0x4e9861];return _0x49802f;};'use strict';var _=require(_0xd3f3('0x0'));var util=require('util');var logger=require(_0xd3f3('0x1'))(_0xd3f3('0x2'));var moment=require(_0xd3f3('0x3'));var BPromise=require(_0xd3f3('0x4'));var rp=require(_0xd3f3('0x5'));var fs=require('fs');var path=require(_0xd3f3('0x6'));var rimraf=require(_0xd3f3('0x7'));var config=require(_0xd3f3('0x8'));var attributes=require(_0xd3f3('0x9'));module[_0xd3f3('0xa')]=function(_0xe78eba,_0x13a2a1){return _0xe78eba[_0xd3f3('0xb')](_0xd3f3('0xc'),attributes,{'tableName':_0xd3f3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12dd469..104d31c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab00=['error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','stringify'];(function(_0x36a3a6,_0x23112c){var _0x111157=function(_0x5683f8){while(--_0x5683f8){_0x36a3a6['push'](_0x36a3a6['shift']());}};_0x111157(++_0x23112c);}(_0xab00,0x1b9));var _0x0ab0=function(_0x3601ba,_0x1671cd){_0x3601ba=_0x3601ba-0x0;var _0x58fe09=_0xab00[_0x3601ba];return _0x58fe09;};'use strict';var _=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var moment=require(_0x0ab0('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ab0('0x3'));var fs=require('fs');var Redis=require(_0x0ab0('0x4'));var db=require(_0x0ab0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ab0('0x6'))('rpc');var config=require(_0x0ab0('0x7'));var jayson=require(_0x0ab0('0x8'));var client=jayson[_0x0ab0('0x9')][_0x0ab0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x363359,_0x25742b,_0x59fb03){return new BPromise(function(_0x3e934d,_0x2cbb53){return client['request'](_0x363359,_0x59fb03)[_0x0ab0('0xb')](function(_0x4f4a28){logger[_0x0ab0('0xc')](_0x0ab0('0xd'),_0x25742b,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x25742b,'request\x20sent',JSON[_0x0ab0('0xe')](_0x4f4a28));if(_0x4f4a28['error']){if(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x10')]===0x1f4){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x2cbb53(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}logger[_0x0ab0('0xf')](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x3e934d(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}else{logger[_0x0ab0('0xc')]('CloudProvider,\x20%s,\x20%s',_0x25742b,'request\x20sent');_0x3e934d(_0x4f4a28['result'][_0x0ab0('0x11')]);}})[_0x0ab0('0x12')](function(_0x2f594b){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x2f594b);_0x2cbb53(_0x2f594b);});});}
\ No newline at end of file
+var _0xd786=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2cd969,_0x35dcd4){var _0x10d32f=function(_0xa86b97){while(--_0xa86b97){_0x2cd969['push'](_0x2cd969['shift']());}};_0x10d32f(++_0x35dcd4);}(_0xd786,0x1dc));var _0x6d78=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd786[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6d78('0x0'));var util=require(_0x6d78('0x1'));var moment=require(_0x6d78('0x2'));var BPromise=require(_0x6d78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d78('0x4'));var db=require(_0x6d78('0x5'))['db'];var utils=require(_0x6d78('0x6'));var logger=require(_0x6d78('0x7'))(_0x6d78('0x8'));var config=require(_0x6d78('0x9'));var jayson=require(_0x6d78('0xa'));var client=jayson['client'][_0x6d78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e9e5,_0x5c3f38,_0x44db98){return new BPromise(function(_0x33b85e,_0x10f58a){return client[_0x6d78('0xc')](_0x30e9e5,_0x44db98)['then'](function(_0x3198b6){logger[_0x6d78('0xd')](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');logger[_0x6d78('0xf')](_0x6d78('0x10'),_0x5c3f38,_0x6d78('0x11'),JSON[_0x6d78('0x12')](_0x3198b6));if(_0x3198b6[_0x6d78('0x13')]){if(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x14')]===0x1f4){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x10f58a(_0x3198b6[_0x6d78('0x13')][_0x6d78('0x15')]);}logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x3198b6[_0x6d78('0x13')]['message']);return _0x33b85e(_0x3198b6['error'][_0x6d78('0x15')]);}else{logger['info'](_0x6d78('0xe'),_0x5c3f38,'request\x20sent');_0x33b85e(_0x3198b6[_0x6d78('0x16')]['message']);}})[_0x6d78('0x17')](function(_0x378c59){logger[_0x6d78('0x13')](_0x6d78('0xe'),_0x5c3f38,_0x378c59);_0x10f58a(_0x378c59);});});}
\ No newline at end of file
index aa77f14..a20c43c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9613=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','index','get','/:id','show','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x54b4a8,_0x3abef0){var _0x4c7a5f=function(_0x50e054){while(--_0x50e054){_0x54b4a8['push'](_0x54b4a8['shift']());}};_0x4c7a5f(++_0x3abef0);}(_0x9613,0x1c9));var _0x3961=function(_0xe9c9a8,_0x3e4574){_0xe9c9a8=_0xe9c9a8-0x0;var _0xd60a75=_0x9613[_0xe9c9a8];return _0xd60a75;};'use strict';var multer=require(_0x3961('0x0'));var util=require(_0x3961('0x1'));var path=require(_0x3961('0x2'));var timeout=require(_0x3961('0x3'));var express=require('express');var router=express[_0x3961('0x4')]();var fs_extra=require(_0x3961('0x5'));var auth=require(_0x3961('0x6'));var interaction=require(_0x3961('0x7'));var config=require('../../config/environment');var controller=require(_0x3961('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3961('0x9')]);router[_0x3961('0xa')](_0x3961('0xb'),auth['isAuthenticated'](),controller[_0x3961('0xc')]);router['post']('/',auth[_0x3961('0xd')](),controller[_0x3961('0xe')]);router[_0x3961('0xf')](_0x3961('0xb'),auth['isAuthenticated'](),controller[_0x3961('0x10')]);router[_0x3961('0x11')]('/:id',auth[_0x3961('0xd')](),controller[_0x3961('0x12')]);module[_0x3961('0x13')]=router;
\ No newline at end of file
+var _0xa03d=['show','post','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','isAuthenticated','index','get'];(function(_0x334292,_0xa12527){var _0x3af4a9=function(_0x26e948){while(--_0x26e948){_0x334292['push'](_0x334292['shift']());}};_0x3af4a9(++_0xa12527);}(_0xa03d,0x15b));var _0xda03=function(_0xa45300,_0x12b025){_0xa45300=_0xa45300-0x0;var _0x4b9521=_0xa03d[_0xa45300];return _0x4b9521;};'use strict';var multer=require(_0xda03('0x0'));var util=require(_0xda03('0x1'));var path=require('path');var timeout=require(_0xda03('0x2'));var express=require('express');var router=express[_0xda03('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda03('0x4'));var interaction=require(_0xda03('0x5'));var config=require('../../config/environment');var controller=require(_0xda03('0x6'));router['get']('/',auth[_0xda03('0x7')](),controller[_0xda03('0x8')]);router[_0xda03('0x9')]('/:id',auth[_0xda03('0x7')](),controller[_0xda03('0xa')]);router[_0xda03('0xb')]('/',auth[_0xda03('0x7')](),controller['create']);router['put'](_0xda03('0xc'),auth[_0xda03('0x7')](),controller[_0xda03('0xd')]);router[_0xda03('0xe')](_0xda03('0xc'),auth['isAuthenticated'](),controller[_0xda03('0xf')]);module[_0xda03('0x10')]=router;
\ No newline at end of file
index 1c0aef9..c43b7d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bfc=['name','STRING','sequelize'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x9bfc,0x173));var _0xc9bf=function(_0x11cd67,_0x5402e2){_0x11cd67=_0x11cd67-0x0;var _0x4f1f3b=_0x9bfc[_0x11cd67];return _0x4f1f3b;};'use strict';var Sequelize=require(_0xc9bf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc9bf('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc9bf('0x2')]},'companyId':{'type':Sequelize[_0xc9bf('0x2')]},'website':{'type':Sequelize[_0xc9bf('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc9bf('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc9bf('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc9bf('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc9bf('0x2')]},'sStreet':{'type':Sequelize[_0xc9bf('0x2')]},'sPostalCode':{'type':Sequelize[_0xc9bf('0x2')]},'sCity':{'type':Sequelize[_0xc9bf('0x2')]},'sCountry':{'type':Sequelize[_0xc9bf('0x2')]},'description':{'type':Sequelize[_0xc9bf('0x2')]}};
\ No newline at end of file
+var _0x357f=['name','sequelize','exports','STRING'];(function(_0xa20571,_0x49a4b9){var _0x16beae=function(_0x402d7d){while(--_0x402d7d){_0xa20571['push'](_0xa20571['shift']());}};_0x16beae(++_0x49a4b9);}(_0x357f,0x99));var _0xf357=function(_0x386297,_0x5bfc15){_0x386297=_0x386297-0x0;var _0x4c051e=_0x357f[_0x386297];return _0x4c051e;};'use strict';var Sequelize=require(_0xf357('0x0'));module[_0xf357('0x1')]={'name':{'type':Sequelize[_0xf357('0x2')],'unique':_0xf357('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf357('0x2')]},'companyId':{'type':Sequelize[_0xf357('0x2')]},'website':{'type':Sequelize[_0xf357('0x2')]},'phone':{'type':Sequelize[_0xf357('0x2')]},'fax':{'type':Sequelize[_0xf357('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf357('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf357('0x2')]},'country':{'type':Sequelize[_0xf357('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf357('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xf357('0x2')]},'sCountry':{'type':Sequelize[_0xf357('0x2')]},'description':{'type':Sequelize[_0xf357('0x2')]}};
\ No newline at end of file
index 5ae559a..e34bd98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29b6=['includeAll','include','findAll','rows','catch','params','merge','find','create','body','role','user','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','get','destroy','send','index','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','map','options','CmCompany','count'];(function(_0x5a4f3b,_0x344159){var _0x33e973=function(_0x2ff5b0){while(--_0x2ff5b0){_0x5a4f3b['push'](_0x5a4f3b['shift']());}};_0x33e973(++_0x344159);}(_0x29b6,0xb8));var _0x629b=function(_0x153f98,_0x2ee426){_0x153f98=_0x153f98-0x0;var _0xf7b9ba=_0x29b6[_0x153f98];return _0xf7b9ba;};'use strict';var emlformat=require(_0x629b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x629b('0x1'));var jsonpatch=require(_0x629b('0x2'));var rp=require(_0x629b('0x3'));var moment=require(_0x629b('0x4'));var BPromise=require(_0x629b('0x5'));var Mustache=require(_0x629b('0x6'));var util=require('util');var path=require(_0x629b('0x7'));var sox=require(_0x629b('0x8'));var csv=require('to-csv');var ejs=require(_0x629b('0x9'));var fs=require('fs');var fs_extra=require(_0x629b('0xa'));var _=require(_0x629b('0xb'));var squel=require('squel');var crypto=require(_0x629b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x629b('0xd'));var toCsv=require(_0x629b('0xe'));var querystring=require(_0x629b('0xf'));var Papa=require(_0x629b('0x10'));var Redis=require('ioredis');var authService=require(_0x629b('0x11'));var qs=require(_0x629b('0x12'));var as=require(_0x629b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x629b('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x629b('0x15'));var db=require(_0x629b('0x16'))['db'];function respondWithStatusCode(_0x1ba07e,_0x28cbe6){_0x28cbe6=_0x28cbe6||0xcc;return function(_0x3aa807){if(_0x3aa807){return _0x1ba07e[_0x629b('0x17')](_0x28cbe6);}return _0x1ba07e['status'](_0x28cbe6)[_0x629b('0x18')]();};}function respondWithResult(_0x4cfa07,_0x4f5c6f){_0x4f5c6f=_0x4f5c6f||0xc8;return function(_0x10bf14){if(_0x10bf14){return _0x4cfa07[_0x629b('0x19')](_0x4f5c6f)[_0x629b('0x1a')](_0x10bf14);}};}function respondWithFilteredResult(_0x535d18,_0x96ffe8){return function(_0x4c244a){if(_0x4c244a){var _0x32200a=typeof _0x96ffe8['offset']===_0x629b('0x1b')&&typeof _0x96ffe8['limit']===_0x629b('0x1b');var _0x3e42aa=_0x4c244a['count'];var _0x3d3b83=_0x32200a?0x0:_0x96ffe8['offset'];var _0x47260c=_0x32200a?_0x4c244a['count']:_0x96ffe8[_0x629b('0x1c')]+_0x96ffe8[_0x629b('0x1d')];var _0x40afdc;if(_0x47260c>=_0x3e42aa){_0x47260c=_0x3e42aa;_0x40afdc=0xc8;}else{_0x40afdc=0xce;}_0x535d18[_0x629b('0x19')](_0x40afdc);return _0x535d18[_0x629b('0x1e')](_0x629b('0x1f'),_0x3d3b83+'-'+_0x47260c+'/'+_0x3e42aa)['json'](_0x4c244a);}return null;};}function patchUpdates(_0x21eb5e){return function(_0x3a7fbc){try{jsonpatch[_0x629b('0x20')](_0x3a7fbc,_0x21eb5e,!![]);}catch(_0x3b5ba4){return BPromise[_0x629b('0x21')](_0x3b5ba4);}return _0x3a7fbc[_0x629b('0x22')]();};}function saveUpdates(_0x1dd9b2,_0x294b1c){return function(_0xa33289){if(_0xa33289){return _0xa33289[_0x629b('0x23')](_0x1dd9b2)[_0x629b('0x24')](function(_0x3f0ad4){return _0x3f0ad4;});}return null;};}function removeEntity(_0x5956d4,_0x2e1211){return function(_0x3e4ad1){if(_0x3e4ad1){return _0x3e4ad1['destroy']()['then'](function(){var _0x511d9b=_0x3e4ad1[_0x629b('0x25')]({'plain':!![]});var _0x170f50='Companies';return db['UserProfileResource'][_0x629b('0x26')]({'where':{'type':_0x170f50,'resourceId':_0x511d9b['id']}})[_0x629b('0x24')](function(){return _0x3e4ad1;});})[_0x629b('0x24')](function(){_0x5956d4[_0x629b('0x19')](0xcc)[_0x629b('0x18')]();});}};}function handleEntityNotFound(_0x2c0711,_0x400191){return function(_0x3cadae){if(!_0x3cadae){_0x2c0711[_0x629b('0x17')](0x194);}return _0x3cadae;};}function handleError(_0x3ff78e,_0x3e6e34){_0x3e6e34=_0x3e6e34||0x1f4;return function(_0x3087c5){logger['error'](_0x3087c5['stack']);if(_0x3087c5['name']){delete _0x3087c5['name'];}_0x3ff78e[_0x629b('0x19')](_0x3e6e34)[_0x629b('0x27')](_0x3087c5);};}exports[_0x629b('0x28')]=function(_0x578472,_0x1b0270){var _0x387253={},_0x4444ad={},_0x2abd8e={'count':0x0,'rows':[]};return db['CmCompany'][_0x629b('0x29')]()[_0x629b('0x24')](function(_0x57f3a6){_0x4444ad[_0x629b('0x2a')]=_[_0x629b('0x2b')](_0x57f3a6);_0x4444ad[_0x629b('0x2c')]=_[_0x629b('0x2b')](_0x578472[_0x629b('0x2c')]);_0x4444ad[_0x629b('0x2d')]=_[_0x629b('0x2e')](_0x4444ad[_0x629b('0x2a')],_0x4444ad['query']);_0x387253['attributes']=_['intersection'](_0x4444ad[_0x629b('0x2a')],qs[_0x629b('0x2f')](_0x578472['query'][_0x629b('0x2f')]));_0x387253[_0x629b('0x30')]=_0x387253[_0x629b('0x30')][_0x629b('0x31')]?_0x387253[_0x629b('0x30')]:_0x4444ad[_0x629b('0x2a')];if(!_0x578472[_0x629b('0x2c')][_0x629b('0x32')](_0x629b('0x33'))){_0x387253['limit']=qs[_0x629b('0x1d')](_0x578472[_0x629b('0x2c')]['limit']);_0x387253['offset']=qs[_0x629b('0x1c')](_0x578472[_0x629b('0x2c')][_0x629b('0x1c')]);}_0x387253['order']=qs[_0x629b('0x34')](_0x578472[_0x629b('0x2c')]['sort']);_0x387253[_0x629b('0x35')]=qs[_0x629b('0x2d')](_['pick'](_0x578472[_0x629b('0x2c')],_0x4444ad['filters']),_0x57f3a6);if(_0x578472[_0x629b('0x2c')][_0x629b('0x36')]){_0x387253[_0x629b('0x35')]=_['merge'](_0x387253[_0x629b('0x35')],{'$or':_[_0x629b('0x37')](_0x387253[_0x629b('0x30')],function(_0x5248e5){var _0x34adb2={};_0x34adb2[_0x5248e5]={'$like':'%'+_0x578472[_0x629b('0x2c')][_0x629b('0x36')]+'%'};return _0x34adb2;})});}_0x387253=_['merge']({},_0x387253,_0x578472[_0x629b('0x38')]);var _0x403ee1={'where':_0x387253['where']};return db[_0x629b('0x39')][_0x629b('0x3a')](_0x403ee1)[_0x629b('0x24')](function(_0x1808a3){_0x2abd8e[_0x629b('0x3a')]=_0x1808a3;if(_0x578472[_0x629b('0x2c')][_0x629b('0x3b')]){_0x387253[_0x629b('0x3c')]=[{'all':!![]}];}return db[_0x629b('0x39')][_0x629b('0x3d')](_0x387253);})['then'](function(_0x39d15e){_0x2abd8e[_0x629b('0x3e')]=_0x39d15e;return _0x2abd8e;})[_0x629b('0x24')](respondWithFilteredResult(_0x1b0270,_0x387253))['catch'](handleError(_0x1b0270,null));})[_0x629b('0x3f')](handleError(_0x1b0270,null));};exports['show']=function(_0x21ca96,_0x226058){var _0x401569={'raw':![],'where':{'id':_0x21ca96[_0x629b('0x40')]['id']}},_0x2bc27e={};_0x2bc27e[_0x629b('0x2a')]=_[_0x629b('0x2b')](db[_0x629b('0x39')]['rawAttributes']);_0x2bc27e[_0x629b('0x2c')]=_['keys'](_0x21ca96['query']);_0x2bc27e[_0x629b('0x2d')]=_[_0x629b('0x2e')](_0x2bc27e[_0x629b('0x2a')],_0x2bc27e[_0x629b('0x2c')]);_0x401569['attributes']=_[_0x629b('0x2e')](_0x2bc27e['model'],qs[_0x629b('0x2f')](_0x21ca96[_0x629b('0x2c')][_0x629b('0x2f')]));_0x401569[_0x629b('0x30')]=_0x401569['attributes'][_0x629b('0x31')]?_0x401569[_0x629b('0x30')]:_0x2bc27e[_0x629b('0x2a')];if(_0x21ca96[_0x629b('0x2c')][_0x629b('0x3b')]){_0x401569['include']=[{'all':!![]}];}_0x401569=_[_0x629b('0x41')]({},_0x401569,_0x21ca96['options']);return db[_0x629b('0x39')][_0x629b('0x42')](_0x401569)[_0x629b('0x24')](handleEntityNotFound(_0x226058,null))[_0x629b('0x24')](respondWithResult(_0x226058,null))[_0x629b('0x3f')](handleError(_0x226058,null));};exports[_0x629b('0x43')]=function(_0x1236a2,_0x2ddf0b){return db[_0x629b('0x39')][_0x629b('0x43')](_0x1236a2[_0x629b('0x44')],{})[_0x629b('0x24')](function(_0x56db61){var _0xbede8c=_0x1236a2['user'][_0x629b('0x25')]({'plain':!![]});if(!_0xbede8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbede8c[_0x629b('0x45')]===_0x629b('0x46')){var _0x5b428b=_0x56db61['get']({'plain':!![]});var _0x3230fc='Companies';return db['UserProfileSection'][_0x629b('0x42')]({'where':{'name':_0x3230fc,'userProfileId':_0xbede8c['userProfileId']},'raw':!![]})[_0x629b('0x24')](function(_0x3b1195){if(_0x3b1195&&_0x3b1195[_0x629b('0x47')]===0x0){return db['UserProfileResource'][_0x629b('0x43')]({'name':_0x5b428b[_0x629b('0x48')],'resourceId':_0x5b428b['id'],'type':_0x3b1195[_0x629b('0x48')],'sectionId':_0x3b1195['id']},{})[_0x629b('0x24')](function(){return _0x56db61;});}else{return _0x56db61;}})[_0x629b('0x3f')](function(_0x4a859e){logger[_0x629b('0x49')](_0x629b('0x4a'),_0x4a859e);throw _0x4a859e;});}return _0x56db61;})[_0x629b('0x24')](respondWithResult(_0x2ddf0b,0xc9))['catch'](handleError(_0x2ddf0b,null));};exports[_0x629b('0x23')]=function(_0x32a1e9,_0x356b19){if(_0x32a1e9[_0x629b('0x44')]['id']){delete _0x32a1e9[_0x629b('0x44')]['id'];}return db[_0x629b('0x39')][_0x629b('0x42')]({'where':{'id':_0x32a1e9[_0x629b('0x40')]['id']}})[_0x629b('0x24')](handleEntityNotFound(_0x356b19,null))[_0x629b('0x24')](saveUpdates(_0x32a1e9[_0x629b('0x44')],null))[_0x629b('0x24')](respondWithResult(_0x356b19,null))[_0x629b('0x3f')](handleError(_0x356b19,null));};exports[_0x629b('0x26')]=function(_0x1669c6,_0x20c318){return db[_0x629b('0x39')][_0x629b('0x42')]({'where':{'id':_0x1669c6['params']['id']}})[_0x629b('0x24')](handleEntityNotFound(_0x20c318,null))[_0x629b('0x24')](removeEntity(_0x20c318,null))['catch'](handleError(_0x20c318,null));};exports[_0x629b('0x29')]=function(_0x43875a,_0x33677d){return db[_0x629b('0x39')]['describe']()[_0x629b('0x24')](respondWithResult(_0x33677d,null))[_0x629b('0x3f')](handleError(_0x33677d,null));};exports[_0x629b('0x4b')]=function(_0x43645c,_0x4de89b,_0x233dd7){return db[_0x629b('0x4c')][_0x629b('0x42')]({'where':{'id':_0x43645c[_0x629b('0x40')]['id']}})[_0x629b('0x24')](handleEntityNotFound(_0x4de89b,null))['then'](function(_0x1f94e2){if(_0x1f94e2){return _0x1f94e2['addContacts'](_0x43645c['body'][_0x629b('0x4d')],_[_0x629b('0x4e')](_0x43645c[_0x629b('0x44')],['ids','id'])||{});}})[_0x629b('0x24')](respondWithResult(_0x4de89b,null))[_0x629b('0x3f')](handleError(_0x4de89b,null));};exports[_0x629b('0x4f')]=function(_0x26a293,_0x27c4ff,_0x4b301){var _0x4db000={};var _0x2ce013={};var _0x4da3b0;var _0x41842c;return db['CmCompany'][_0x629b('0x50')]({'where':{'id':_0x26a293[_0x629b('0x40')]['id']}})[_0x629b('0x24')](handleEntityNotFound(_0x27c4ff,null))[_0x629b('0x24')](function(_0x536bef){if(_0x536bef){_0x4da3b0=_0x536bef;_0x2ce013['model']=_[_0x629b('0x2b')](db[_0x629b('0x4c')]['rawAttributes']);_0x2ce013[_0x629b('0x2c')]=_['keys'](_0x26a293['query']);_0x2ce013[_0x629b('0x2d')]=_[_0x629b('0x2e')](_0x2ce013[_0x629b('0x2a')],_0x2ce013[_0x629b('0x2c')]);_0x4db000[_0x629b('0x30')]=_['intersection'](_0x2ce013[_0x629b('0x2a')],qs['fields'](_0x26a293[_0x629b('0x2c')][_0x629b('0x2f')]));_0x4db000[_0x629b('0x30')]=_0x4db000[_0x629b('0x30')][_0x629b('0x31')]?_0x4db000[_0x629b('0x30')]:_0x2ce013[_0x629b('0x2a')];_0x4db000['order']=qs[_0x629b('0x34')](_0x26a293[_0x629b('0x2c')][_0x629b('0x34')]);_0x4db000['where']=qs[_0x629b('0x2d')](_['pick'](_0x26a293[_0x629b('0x2c')],_0x2ce013['filters']));if(_0x26a293[_0x629b('0x2c')][_0x629b('0x36')]){_0x4db000[_0x629b('0x35')]=_[_0x629b('0x41')](_0x4db000['where'],{'$or':_[_0x629b('0x37')](_0x4db000[_0x629b('0x30')],function(_0xcc1c8){var _0x23fc70={};_0x23fc70[_0xcc1c8]={'$like':'%'+_0x26a293['query']['filter']+'%'};return _0x23fc70;})});}_0x4db000=_[_0x629b('0x41')]({},_0x4db000,_0x26a293[_0x629b('0x38')]);return _0x4da3b0[_0x629b('0x4f')](_0x4db000);}})[_0x629b('0x24')](function(_0x4f8721){if(_0x4f8721){_0x41842c=_0x4f8721[_0x629b('0x31')];if(!_0x26a293[_0x629b('0x2c')][_0x629b('0x32')](_0x629b('0x33'))){_0x4db000[_0x629b('0x1d')]=qs[_0x629b('0x1d')](_0x26a293[_0x629b('0x2c')]['limit']);_0x4db000[_0x629b('0x1c')]=qs['offset'](_0x26a293['query'][_0x629b('0x1c')]);}return _0x4da3b0[_0x629b('0x4f')](_0x4db000);}})[_0x629b('0x24')](function(_0x144699){if(_0x144699){return _0x144699?{'count':_0x41842c,'rows':_0x144699}:null;}})[_0x629b('0x24')](respondWithResult(_0x27c4ff,null))[_0x629b('0x3f')](handleError(_0x27c4ff,null));};
\ No newline at end of file
+var _0xfa3a=['end','json','limit','offset','set','Content-Range','reject','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','count','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','ids','findOne','CmContact','length','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3bf194,_0x342216){var _0x105954=function(_0x40732d){while(--_0x40732d){_0x3bf194['push'](_0x3bf194['shift']());}};_0x105954(++_0x342216);}(_0xfa3a,0x145));var _0xafa3=function(_0x32e59e,_0x252469){_0x32e59e=_0x32e59e-0x0;var _0x4a621d=_0xfa3a[_0x32e59e];return _0x4a621d;};'use strict';var emlformat=require(_0xafa3('0x0'));var rimraf=require(_0xafa3('0x1'));var zipdir=require(_0xafa3('0x2'));var jsonpatch=require(_0xafa3('0x3'));var rp=require(_0xafa3('0x4'));var moment=require(_0xafa3('0x5'));var BPromise=require(_0xafa3('0x6'));var Mustache=require(_0xafa3('0x7'));var util=require('util');var path=require(_0xafa3('0x8'));var sox=require(_0xafa3('0x9'));var csv=require('to-csv');var ejs=require(_0xafa3('0xa'));var fs=require('fs');var fs_extra=require(_0xafa3('0xb'));var _=require(_0xafa3('0xc'));var squel=require(_0xafa3('0xd'));var crypto=require('crypto');var jsforce=require(_0xafa3('0xe'));var deskjs=require(_0xafa3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xafa3('0x10'));var Redis=require(_0xafa3('0x11'));var authService=require(_0xafa3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xafa3('0x13'));var hardwareService=require(_0xafa3('0x14'));var logger=require(_0xafa3('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xafa3('0x16'));var licenseUtil=require(_0xafa3('0x17'));var db=require(_0xafa3('0x18'))['db'];function respondWithStatusCode(_0x33fc81,_0x3c9324){_0x3c9324=_0x3c9324||0xcc;return function(_0x2b4ec4){if(_0x2b4ec4){return _0x33fc81[_0xafa3('0x19')](_0x3c9324);}return _0x33fc81[_0xafa3('0x1a')](_0x3c9324)[_0xafa3('0x1b')]();};}function respondWithResult(_0x5ed5bd,_0x168d69){_0x168d69=_0x168d69||0xc8;return function(_0xae981f){if(_0xae981f){return _0x5ed5bd[_0xafa3('0x1a')](_0x168d69)[_0xafa3('0x1c')](_0xae981f);}};}function respondWithFilteredResult(_0x40feef,_0x1d0377){return function(_0x2c8f4f){if(_0x2c8f4f){var _0x4b823f=typeof _0x1d0377['offset']==='undefined'&&typeof _0x1d0377[_0xafa3('0x1d')]==='undefined';var _0x4628b7=_0x2c8f4f['count'];var _0x413e6b=_0x4b823f?0x0:_0x1d0377[_0xafa3('0x1e')];var _0x58a450=_0x4b823f?_0x2c8f4f['count']:_0x1d0377[_0xafa3('0x1e')]+_0x1d0377['limit'];var _0x337dcf;if(_0x58a450>=_0x4628b7){_0x58a450=_0x4628b7;_0x337dcf=0xc8;}else{_0x337dcf=0xce;}_0x40feef[_0xafa3('0x1a')](_0x337dcf);return _0x40feef[_0xafa3('0x1f')](_0xafa3('0x20'),_0x413e6b+'-'+_0x58a450+'/'+_0x4628b7)[_0xafa3('0x1c')](_0x2c8f4f);}return null;};}function patchUpdates(_0x1b0c2c){return function(_0x5bdc4d){try{jsonpatch['apply'](_0x5bdc4d,_0x1b0c2c,!![]);}catch(_0x301d1a){return BPromise[_0xafa3('0x21')](_0x301d1a);}return _0x5bdc4d[_0xafa3('0x22')]();};}function saveUpdates(_0x1f25cf,_0x4ef5e1){return function(_0x3fde81){if(_0x3fde81){return _0x3fde81[_0xafa3('0x23')](_0x1f25cf)['then'](function(_0x21ad2a){return _0x21ad2a;});}return null;};}function removeEntity(_0x5de009,_0x3b80a1){return function(_0x3ed3f1){if(_0x3ed3f1){return _0x3ed3f1[_0xafa3('0x24')]()[_0xafa3('0x25')](function(){var _0x356413=_0x3ed3f1[_0xafa3('0x26')]({'plain':!![]});var _0x4fb2b0=_0xafa3('0x27');return db[_0xafa3('0x28')][_0xafa3('0x24')]({'where':{'type':_0x4fb2b0,'resourceId':_0x356413['id']}})[_0xafa3('0x25')](function(){return _0x3ed3f1;});})['then'](function(){_0x5de009[_0xafa3('0x1a')](0xcc)[_0xafa3('0x1b')]();});}};}function handleEntityNotFound(_0x4b008a,_0x5f41c2){return function(_0x48f2da){if(!_0x48f2da){_0x4b008a[_0xafa3('0x19')](0x194);}return _0x48f2da;};}function handleError(_0x41f9f7,_0xdd4506){_0xdd4506=_0xdd4506||0x1f4;return function(_0x5f2ce2){logger[_0xafa3('0x29')](_0x5f2ce2[_0xafa3('0x2a')]);if(_0x5f2ce2[_0xafa3('0x2b')]){delete _0x5f2ce2['name'];}_0x41f9f7[_0xafa3('0x1a')](_0xdd4506)[_0xafa3('0x2c')](_0x5f2ce2);};}exports[_0xafa3('0x2d')]=function(_0x56d23b,_0x320e6d){var _0x2abd46={},_0x257fa5={},_0x1e9023={'count':0x0,'rows':[]};return db[_0xafa3('0x2e')][_0xafa3('0x2f')]()['then'](function(_0x1b0bb5){_0x257fa5['model']=_[_0xafa3('0x30')](_0x1b0bb5);_0x257fa5[_0xafa3('0x31')]=_[_0xafa3('0x30')](_0x56d23b[_0xafa3('0x31')]);_0x257fa5['filters']=_[_0xafa3('0x32')](_0x257fa5[_0xafa3('0x33')],_0x257fa5[_0xafa3('0x31')]);_0x2abd46['attributes']=_[_0xafa3('0x32')](_0x257fa5['model'],qs[_0xafa3('0x34')](_0x56d23b[_0xafa3('0x31')]['fields']));_0x2abd46[_0xafa3('0x35')]=_0x2abd46[_0xafa3('0x35')]['length']?_0x2abd46[_0xafa3('0x35')]:_0x257fa5['model'];if(!_0x56d23b['query'][_0xafa3('0x36')](_0xafa3('0x37'))){_0x2abd46['limit']=qs[_0xafa3('0x1d')](_0x56d23b[_0xafa3('0x31')][_0xafa3('0x1d')]);_0x2abd46[_0xafa3('0x1e')]=qs['offset'](_0x56d23b[_0xafa3('0x31')][_0xafa3('0x1e')]);}_0x2abd46[_0xafa3('0x38')]=qs[_0xafa3('0x39')](_0x56d23b[_0xafa3('0x31')]['sort']);_0x2abd46[_0xafa3('0x3a')]=qs[_0xafa3('0x3b')](_[_0xafa3('0x3c')](_0x56d23b[_0xafa3('0x31')],_0x257fa5[_0xafa3('0x3b')]),_0x1b0bb5);if(_0x56d23b[_0xafa3('0x31')][_0xafa3('0x3d')]){_0x2abd46['where']=_[_0xafa3('0x3e')](_0x2abd46[_0xafa3('0x3a')],{'$or':_[_0xafa3('0x3f')](_0x2abd46[_0xafa3('0x35')],function(_0x5dbce1){var _0x13da20={};_0x13da20[_0x5dbce1]={'$like':'%'+_0x56d23b[_0xafa3('0x31')]['filter']+'%'};return _0x13da20;})});}_0x2abd46=_['merge']({},_0x2abd46,_0x56d23b['options']);var _0x11d101={'where':_0x2abd46[_0xafa3('0x3a')]};return db[_0xafa3('0x2e')]['count'](_0x11d101)[_0xafa3('0x25')](function(_0x47a2bb){_0x1e9023[_0xafa3('0x40')]=_0x47a2bb;if(_0x56d23b['query'][_0xafa3('0x41')]){_0x2abd46[_0xafa3('0x42')]=[{'all':!![]}];}return db[_0xafa3('0x2e')][_0xafa3('0x43')](_0x2abd46);})['then'](function(_0x1f131e){_0x1e9023[_0xafa3('0x44')]=_0x1f131e;return _0x1e9023;})[_0xafa3('0x25')](respondWithFilteredResult(_0x320e6d,_0x2abd46))[_0xafa3('0x45')](handleError(_0x320e6d,null));})[_0xafa3('0x45')](handleError(_0x320e6d,null));};exports['show']=function(_0x4b5959,_0x5315c1){var _0x1a0163={'raw':![],'where':{'id':_0x4b5959[_0xafa3('0x46')]['id']}},_0x2db8a4={};_0x2db8a4[_0xafa3('0x33')]=_[_0xafa3('0x30')](db[_0xafa3('0x2e')][_0xafa3('0x47')]);_0x2db8a4[_0xafa3('0x31')]=_[_0xafa3('0x30')](_0x4b5959[_0xafa3('0x31')]);_0x2db8a4[_0xafa3('0x3b')]=_[_0xafa3('0x32')](_0x2db8a4['model'],_0x2db8a4[_0xafa3('0x31')]);_0x1a0163['attributes']=_[_0xafa3('0x32')](_0x2db8a4[_0xafa3('0x33')],qs[_0xafa3('0x34')](_0x4b5959['query'][_0xafa3('0x34')]));_0x1a0163[_0xafa3('0x35')]=_0x1a0163[_0xafa3('0x35')]['length']?_0x1a0163[_0xafa3('0x35')]:_0x2db8a4[_0xafa3('0x33')];if(_0x4b5959[_0xafa3('0x31')][_0xafa3('0x41')]){_0x1a0163[_0xafa3('0x42')]=[{'all':!![]}];}_0x1a0163=_[_0xafa3('0x3e')]({},_0x1a0163,_0x4b5959[_0xafa3('0x48')]);return db[_0xafa3('0x2e')][_0xafa3('0x49')](_0x1a0163)[_0xafa3('0x25')](handleEntityNotFound(_0x5315c1,null))[_0xafa3('0x25')](respondWithResult(_0x5315c1,null))[_0xafa3('0x45')](handleError(_0x5315c1,null));};exports[_0xafa3('0x4a')]=function(_0x4efa80,_0x34fc93){return db[_0xafa3('0x2e')]['create'](_0x4efa80[_0xafa3('0x4b')],{})[_0xafa3('0x25')](function(_0x5a48d4){var _0x49acd8=_0x4efa80['user'][_0xafa3('0x26')]({'plain':!![]});if(!_0x49acd8)throw new Error(_0xafa3('0x4c'));if(_0x49acd8[_0xafa3('0x4d')]===_0xafa3('0x4e')){var _0x3a78a8=_0x5a48d4[_0xafa3('0x26')]({'plain':!![]});var _0x2a94d0=_0xafa3('0x27');return db[_0xafa3('0x4f')]['find']({'where':{'name':_0x2a94d0,'userProfileId':_0x49acd8['userProfileId']},'raw':!![]})['then'](function(_0x2ab1e3){if(_0x2ab1e3&&_0x2ab1e3['autoAssociation']===0x0){return db[_0xafa3('0x28')][_0xafa3('0x4a')]({'name':_0x3a78a8[_0xafa3('0x2b')],'resourceId':_0x3a78a8['id'],'type':_0x2ab1e3[_0xafa3('0x2b')],'sectionId':_0x2ab1e3['id']},{})[_0xafa3('0x25')](function(){return _0x5a48d4;});}else{return _0x5a48d4;}})[_0xafa3('0x45')](function(_0x50c799){logger[_0xafa3('0x29')](_0xafa3('0x50'),_0x50c799);throw _0x50c799;});}return _0x5a48d4;})['then'](respondWithResult(_0x34fc93,0xc9))[_0xafa3('0x45')](handleError(_0x34fc93,null));};exports[_0xafa3('0x23')]=function(_0x73676f,_0x27b457){if(_0x73676f[_0xafa3('0x4b')]['id']){delete _0x73676f[_0xafa3('0x4b')]['id'];}return db['CmCompany'][_0xafa3('0x49')]({'where':{'id':_0x73676f['params']['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x27b457,null))[_0xafa3('0x25')](saveUpdates(_0x73676f['body'],null))[_0xafa3('0x25')](respondWithResult(_0x27b457,null))[_0xafa3('0x45')](handleError(_0x27b457,null));};exports[_0xafa3('0x24')]=function(_0x15cb85,_0x5ef9f6){return db[_0xafa3('0x2e')][_0xafa3('0x49')]({'where':{'id':_0x15cb85[_0xafa3('0x46')]['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x5ef9f6,null))[_0xafa3('0x25')](removeEntity(_0x5ef9f6,null))['catch'](handleError(_0x5ef9f6,null));};exports[_0xafa3('0x2f')]=function(_0xe813c5,_0x201e59){return db[_0xafa3('0x2e')]['describe']()[_0xafa3('0x25')](respondWithResult(_0x201e59,null))[_0xafa3('0x45')](handleError(_0x201e59,null));};exports[_0xafa3('0x51')]=function(_0x5c09ad,_0x1af878,_0x23ce5d){return db['CmContact'][_0xafa3('0x49')]({'where':{'id':_0x5c09ad['params']['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x1af878,null))[_0xafa3('0x25')](function(_0x13e4e9){if(_0x13e4e9){return _0x13e4e9[_0xafa3('0x51')](_0x5c09ad[_0xafa3('0x4b')]['ids'],_[_0xafa3('0x52')](_0x5c09ad[_0xafa3('0x4b')],[_0xafa3('0x53'),'id'])||{});}})[_0xafa3('0x25')](respondWithResult(_0x1af878,null))[_0xafa3('0x45')](handleError(_0x1af878,null));};exports['getContacts']=function(_0x25e51c,_0x1b8801,_0x3d7144){var _0x247de5={};var _0x483038={};var _0x388328;var _0x4e1ad6;return db[_0xafa3('0x2e')][_0xafa3('0x54')]({'where':{'id':_0x25e51c[_0xafa3('0x46')]['id']}})[_0xafa3('0x25')](handleEntityNotFound(_0x1b8801,null))[_0xafa3('0x25')](function(_0x4fcbee){if(_0x4fcbee){_0x388328=_0x4fcbee;_0x483038[_0xafa3('0x33')]=_['keys'](db[_0xafa3('0x55')][_0xafa3('0x47')]);_0x483038[_0xafa3('0x31')]=_[_0xafa3('0x30')](_0x25e51c['query']);_0x483038[_0xafa3('0x3b')]=_[_0xafa3('0x32')](_0x483038[_0xafa3('0x33')],_0x483038[_0xafa3('0x31')]);_0x247de5[_0xafa3('0x35')]=_['intersection'](_0x483038[_0xafa3('0x33')],qs[_0xafa3('0x34')](_0x25e51c[_0xafa3('0x31')][_0xafa3('0x34')]));_0x247de5[_0xafa3('0x35')]=_0x247de5[_0xafa3('0x35')][_0xafa3('0x56')]?_0x247de5[_0xafa3('0x35')]:_0x483038['model'];_0x247de5[_0xafa3('0x38')]=qs[_0xafa3('0x39')](_0x25e51c['query'][_0xafa3('0x39')]);_0x247de5['where']=qs['filters'](_['pick'](_0x25e51c[_0xafa3('0x31')],_0x483038[_0xafa3('0x3b')]));if(_0x25e51c[_0xafa3('0x31')][_0xafa3('0x3d')]){_0x247de5[_0xafa3('0x3a')]=_[_0xafa3('0x3e')](_0x247de5[_0xafa3('0x3a')],{'$or':_[_0xafa3('0x3f')](_0x247de5[_0xafa3('0x35')],function(_0x2e9d4e){var _0x18bc4f={};_0x18bc4f[_0x2e9d4e]={'$like':'%'+_0x25e51c[_0xafa3('0x31')][_0xafa3('0x3d')]+'%'};return _0x18bc4f;})});}_0x247de5=_['merge']({},_0x247de5,_0x25e51c[_0xafa3('0x48')]);return _0x388328['getContacts'](_0x247de5);}})[_0xafa3('0x25')](function(_0x2be164){if(_0x2be164){_0x4e1ad6=_0x2be164[_0xafa3('0x56')];if(!_0x25e51c[_0xafa3('0x31')]['hasOwnProperty'](_0xafa3('0x37'))){_0x247de5[_0xafa3('0x1d')]=qs[_0xafa3('0x1d')](_0x25e51c[_0xafa3('0x31')][_0xafa3('0x1d')]);_0x247de5[_0xafa3('0x1e')]=qs['offset'](_0x25e51c[_0xafa3('0x31')][_0xafa3('0x1e')]);}return _0x388328[_0xafa3('0x57')](_0x247de5);}})[_0xafa3('0x25')](function(_0xdeeda6){if(_0xdeeda6){return _0xdeeda6?{'count':_0x4e1ad6,'rows':_0xdeeda6}:null;}})[_0xafa3('0x25')](respondWithResult(_0x1b8801,null))[_0xafa3('0x45')](handleError(_0x1b8801,null));};
\ No newline at end of file
index 078448e..81dc3b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc84c=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x359397,_0x656f9c){var _0x1d5d68=function(_0x4e6ef2){while(--_0x4e6ef2){_0x359397['push'](_0x359397['shift']());}};_0x1d5d68(++_0x656f9c);}(_0xc84c,0x1e7));var _0xcc84=function(_0x2de4e6,_0x2dbab4){_0x2de4e6=_0x2de4e6-0x0;var _0x156984=_0xc84c[_0x2de4e6];return _0x156984;};'use strict';var _=require(_0xcc84('0x0'));var util=require(_0xcc84('0x1'));var logger=require('../../config/logger')(_0xcc84('0x2'));var moment=require(_0xcc84('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc84('0x4'));var fs=require('fs');var path=require(_0xcc84('0x5'));var rimraf=require(_0xcc84('0x6'));var config=require(_0xcc84('0x7'));var attributes=require(_0xcc84('0x8'));module[_0xcc84('0x9')]=function(_0x4fb891,_0x455976){return _0x4fb891[_0xcc84('0xa')](_0xcc84('0xb'),attributes,{'tableName':_0xcc84('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc6d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','lodash','util','../../config/logger'];(function(_0x4b125d,_0x3dc671){var _0x535ead=function(_0x1e9b7e){while(--_0x1e9b7e){_0x4b125d['push'](_0x4b125d['shift']());}};_0x535ead(++_0x3dc671);}(_0xbc6d,0x189));var _0xdbc6=function(_0x5d82d9,_0x3d7694){_0x5d82d9=_0x5d82d9-0x0;var _0x3dfd86=_0xbc6d[_0x5d82d9];return _0x3dfd86;};'use strict';var _=require(_0xdbc6('0x0'));var util=require(_0xdbc6('0x1'));var logger=require(_0xdbc6('0x2'))(_0xdbc6('0x3'));var moment=require(_0xdbc6('0x4'));var BPromise=require(_0xdbc6('0x5'));var rp=require(_0xdbc6('0x6'));var fs=require('fs');var path=require(_0xdbc6('0x7'));var rimraf=require(_0xdbc6('0x8'));var config=require(_0xdbc6('0x9'));var attributes=require(_0xdbc6('0xa'));module['exports']=function(_0x190fdd,_0x3a9ebb){return _0x190fdd[_0xdbc6('0xb')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f09eb39..ef7e702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdae9=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2b2861,_0x5f4bf5){var _0xb48543=function(_0x40f80e){while(--_0x40f80e){_0x2b2861['push'](_0x2b2861['shift']());}};_0xb48543(++_0x5f4bf5);}(_0xdae9,0x118));var _0x9dae=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdae9[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x9dae('0x0'));var util=require(_0x9dae('0x1'));var moment=require(_0x9dae('0x2'));var BPromise=require('bluebird');var rs=require(_0x9dae('0x3'));var fs=require('fs');var Redis=require(_0x9dae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9dae('0x5'));var logger=require(_0x9dae('0x6'))(_0x9dae('0x7'));var config=require(_0x9dae('0x8'));var jayson=require(_0x9dae('0x9'));var client=jayson[_0x9dae('0xa')][_0x9dae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2662cf,_0x17456e,_0x10beed){return new BPromise(function(_0x393e38,_0x9ac464){return client[_0x9dae('0xc')](_0x2662cf,_0x10beed)[_0x9dae('0xd')](function(_0x581980){logger[_0x9dae('0xe')]('CmCompany,\x20%s,\x20%s',_0x17456e,_0x9dae('0xf'));logger[_0x9dae('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x17456e,_0x9dae('0xf'),JSON[_0x9dae('0x11')](_0x581980));if(_0x581980[_0x9dae('0x12')]){if(_0x581980['error'][_0x9dae('0x13')]===0x1f4){logger[_0x9dae('0x12')](_0x9dae('0x14'),_0x17456e,_0x581980['error']['message']);return _0x9ac464(_0x581980[_0x9dae('0x12')][_0x9dae('0x15')]);}logger[_0x9dae('0x12')](_0x9dae('0x14'),_0x17456e,_0x581980[_0x9dae('0x12')][_0x9dae('0x15')]);return _0x393e38(_0x581980['error'][_0x9dae('0x15')]);}else{logger[_0x9dae('0xe')](_0x9dae('0x14'),_0x17456e,_0x9dae('0xf'));_0x393e38(_0x581980[_0x9dae('0x16')][_0x9dae('0x15')]);}})[_0x9dae('0x17')](function(_0x4892ee){logger['error'](_0x9dae('0x14'),_0x17456e,_0x4892ee);_0x9ac464(_0x4892ee);});});}
\ No newline at end of file
+var _0x8af7=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util'];(function(_0x136290,_0x3e6b8f){var _0x290e92=function(_0x4095d6){while(--_0x4095d6){_0x136290['push'](_0x136290['shift']());}};_0x290e92(++_0x3e6b8f);}(_0x8af7,0x141));var _0x78af=function(_0x2e9921,_0x35501a){_0x2e9921=_0x2e9921-0x0;var _0x44575a=_0x8af7[_0x2e9921];return _0x44575a;};'use strict';var _=require(_0x78af('0x0'));var util=require(_0x78af('0x1'));var moment=require(_0x78af('0x2'));var BPromise=require(_0x78af('0x3'));var rs=require(_0x78af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78af('0x5'))['db'];var utils=require(_0x78af('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x78af('0x7'));var jayson=require(_0x78af('0x8'));var client=jayson[_0x78af('0x9')][_0x78af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222a7a,_0x25f854,_0x4b813e){return new BPromise(function(_0x43b884,_0x28f212){return client['request'](_0x222a7a,_0x4b813e)[_0x78af('0xb')](function(_0x28e2f6){logger['info'](_0x78af('0xc'),_0x25f854,'request\x20sent');logger[_0x78af('0xd')](_0x78af('0xe'),_0x25f854,'request\x20sent',JSON[_0x78af('0xf')](_0x28e2f6));if(_0x28e2f6[_0x78af('0x10')]){if(_0x28e2f6[_0x78af('0x10')]['code']===0x1f4){logger[_0x78af('0x10')](_0x78af('0xc'),_0x25f854,_0x28e2f6[_0x78af('0x10')][_0x78af('0x11')]);return _0x28f212(_0x28e2f6[_0x78af('0x10')][_0x78af('0x11')]);}logger[_0x78af('0x10')](_0x78af('0xc'),_0x25f854,_0x28e2f6[_0x78af('0x10')][_0x78af('0x11')]);return _0x43b884(_0x28e2f6[_0x78af('0x10')]['message']);}else{logger[_0x78af('0x12')](_0x78af('0xc'),_0x25f854,'request\x20sent');_0x43b884(_0x28e2f6['result']['message']);}})['catch'](function(_0x1c48c1){logger['error'](_0x78af('0xc'),_0x25f854,_0x1c48c1);_0x28f212(_0x1c48c1);});});}
\ No newline at end of file
index 541bd7f..d1d6e70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe196=['isAuthenticated','describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xe196,0x1ec));var _0x6e19=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe196[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6e19('0x0'));var util=require(_0x6e19('0x1'));var path=require('path');var timeout=require(_0x6e19('0x2'));var express=require('express');var router=express[_0x6e19('0x3')]();var fs_extra=require(_0x6e19('0x4'));var auth=require(_0x6e19('0x5'));var interaction=require(_0x6e19('0x6'));var config=require(_0x6e19('0x7'));var controller=require(_0x6e19('0x8'));router[_0x6e19('0x9')]('/',auth['isAuthenticated'](),controller[_0x6e19('0xa')]);router[_0x6e19('0x9')](_0x6e19('0xb'),auth[_0x6e19('0xc')](),controller[_0x6e19('0xd')]);router[_0x6e19('0x9')](_0x6e19('0xe'),auth[_0x6e19('0xc')](),controller[_0x6e19('0xf')]);router[_0x6e19('0x9')]('/:id/contacts',auth[_0x6e19('0xc')](),controller[_0x6e19('0x10')]);router[_0x6e19('0x11')]('/',auth[_0x6e19('0xc')](),controller['create']);router[_0x6e19('0x11')](_0x6e19('0x12'),auth[_0x6e19('0xc')](),controller[_0x6e19('0x13')]);router[_0x6e19('0x14')]('/:id',auth[_0x6e19('0xc')](),controller['update']);router[_0x6e19('0x15')](_0x6e19('0xe'),auth[_0x6e19('0xc')](),controller[_0x6e19('0x16')]);module[_0x6e19('0x17')]=router;
\ No newline at end of file
+var _0xe455=['./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5e0531,_0x4537b9){var _0xce690a=function(_0x2f015f){while(--_0x2f015f){_0x5e0531['push'](_0x5e0531['shift']());}};_0xce690a(++_0x4537b9);}(_0xe455,0xad));var _0x5e45=function(_0x30be10,_0x374300){_0x30be10=_0x30be10-0x0;var _0x3b379f=_0xe455[_0x30be10];return _0x3b379f;};'use strict';var multer=require(_0x5e45('0x0'));var util=require(_0x5e45('0x1'));var path=require('path');var timeout=require(_0x5e45('0x2'));var express=require(_0x5e45('0x3'));var router=express[_0x5e45('0x4')]();var fs_extra=require(_0x5e45('0x5'));var auth=require(_0x5e45('0x6'));var interaction=require(_0x5e45('0x7'));var config=require(_0x5e45('0x8'));var controller=require(_0x5e45('0x9'));router[_0x5e45('0xa')]('/',auth[_0x5e45('0xb')](),controller[_0x5e45('0xc')]);router[_0x5e45('0xa')](_0x5e45('0xd'),auth[_0x5e45('0xb')](),controller[_0x5e45('0xe')]);router[_0x5e45('0xa')](_0x5e45('0xf'),auth[_0x5e45('0xb')](),controller[_0x5e45('0x10')]);router['get'](_0x5e45('0x11'),auth['isAuthenticated'](),controller[_0x5e45('0x12')]);router[_0x5e45('0x13')]('/',auth[_0x5e45('0xb')](),controller['create']);router[_0x5e45('0x13')](_0x5e45('0x11'),auth[_0x5e45('0xb')](),controller[_0x5e45('0x14')]);router[_0x5e45('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x5e45('0x16')]);router[_0x5e45('0x17')](_0x5e45('0xf'),auth[_0x5e45('0xb')](),controller[_0x5e45('0x18')]);module[_0x5e45('0x19')]=router;
\ No newline at end of file
index 173e38e..3afea2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b27=['STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash','exports'];(function(_0x1becfa,_0x1ae0dd){var _0x171363=function(_0x25813f){while(--_0x25813f){_0x1becfa['push'](_0x1becfa['shift']());}};_0x171363(++_0x1ae0dd);}(_0x7b27,0x186));var _0x77b2=function(_0x3efd1d,_0x1e0d7b){_0x3efd1d=_0x3efd1d-0x0;var _0x169e70=_0x7b27[_0x3efd1d];return _0x169e70;};'use strict';var _=require(_0x77b2('0x0'));var Sequelize=require('sequelize');module[_0x77b2('0x1')]={'firstName':{'type':Sequelize[_0x77b2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x77b2('0x2')]},'street':{'type':Sequelize[_0x77b2('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x77b2('0x2')]},'country':{'type':Sequelize[_0x77b2('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77b2('0x3')]},'phone':{'type':Sequelize[_0x77b2('0x2')]},'mobile':{'type':Sequelize[_0x77b2('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x77b2('0x2')]},'url':{'type':Sequelize[_0x77b2('0x2')]},'facebook':{'type':Sequelize[_0x77b2('0x2')]},'fb_data':{'type':Sequelize[_0x77b2('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x77b2('0x2')]},'teams':{'type':Sequelize[_0x77b2('0x2')]},'viber':{'type':Sequelize[_0x77b2('0x2')]},'line':{'type':Sequelize[_0x77b2('0x2')]},'wechat':{'type':Sequelize[_0x77b2('0x2')]},'telegram':{'type':Sequelize[_0x77b2('0x2')]},'UserId':{'type':Sequelize[_0x77b2('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x77b2('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x77b2('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x77b2('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xca9e=['exports','STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize'];(function(_0x2d73da,_0x4e9643){var _0x2d06af=function(_0x2f5810){while(--_0x2f5810){_0x2d73da['push'](_0x2d73da['shift']());}};_0x2d06af(++_0x4e9643);}(_0xca9e,0x136));var _0xeca9=function(_0x1fc62f,_0x547477){_0x1fc62f=_0x1fc62f-0x0;var _0x2cb919=_0xca9e[_0x1fc62f];return _0x2cb919;};'use strict';var _=require(_0xeca9('0x0'));var Sequelize=require(_0xeca9('0x1'));module[_0xeca9('0x2')]={'firstName':{'type':Sequelize[_0xeca9('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xeca9('0x3')]},'street':{'type':Sequelize[_0xeca9('0x3')]},'postalCode':{'type':Sequelize[_0xeca9('0x3')]},'city':{'type':Sequelize[_0xeca9('0x3')]},'country':{'type':Sequelize[_0xeca9('0x3')]},'dateOfBirth':{'type':Sequelize[_0xeca9('0x3')]},'description':{'type':Sequelize[_0xeca9('0x4')]},'phone':{'type':Sequelize[_0xeca9('0x3')]},'mobile':{'type':Sequelize[_0xeca9('0x3')]},'fax':{'type':Sequelize[_0xeca9('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xeca9('0x3')]},'facebook':{'type':Sequelize[_0xeca9('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xeca9('0x3')]},'teams':{'type':Sequelize[_0xeca9('0x3')]},'viber':{'type':Sequelize[_0xeca9('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xeca9('0x3')]},'telegram':{'type':Sequelize[_0xeca9('0x3')]},'UserId':{'type':Sequelize[_0xeca9('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xeca9('0x3')]},'priority':{'type':Sequelize[_0xeca9('0x5')](0x2)[_0xeca9('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xeca9('0x7')]}};
\ No newline at end of file
index 76d7e1a..6834242 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be1=['fullname','DESC','createdAt','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','openchannel','threadId','Interaction','channel','Owner','flatten','reverse','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./cmContact.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','send','index','describe','keys','length','startsWith','cf_','push','CmCustomField','trimStart','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','start','filter','isNil','Contact','forEach','ListId','c.ListId\x20IN\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)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','clone','order','isEmpty','having','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','CmContact','c.lastName','c.phone','c.fax','c.email','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','alias','values','merge','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','additionalPhones','bulkCreate','each','duplicates','findOrCreate','spread','all','show','Phones','`Phones.ItemType`.OrderBy','$and','findAll','omit','pickBy','format','cf_%d','table','setFields','id\x20=\x20?','text','phone','CmHopper','getTags','setTags','findOne','ids','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ContactItemType','ItemType','literal','`ItemType`.OrderBy','CmHopperId','OrderBy','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','nolimit','options','includeAll','getHopperHistories','ContactId','include','getHopperFinals','rawAttributes','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','meta','binding','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','whatsapp','voice','-createdAt','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId'];(function(_0xc99e20,_0xf0d744){var _0x57226d=function(_0x390180){while(--_0x390180){_0xc99e20['push'](_0xc99e20['shift']());}};_0x57226d(++_0xf0d744);}(_0x7be1,0x165));var _0x17be=function(_0xc48869,_0x56b37b){_0xc48869=_0xc48869-0x0;var _0x1f5dca=_0x7be1[_0xc48869];return _0x1f5dca;};'use strict';var emlformat=require(_0x17be('0x0'));var rimraf=require(_0x17be('0x1'));var zipdir=require(_0x17be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x17be('0x3'));var moment=require(_0x17be('0x4'));var BPromise=require(_0x17be('0x5'));var Mustache=require(_0x17be('0x6'));var util=require(_0x17be('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x17be('0x8'));var fs=require('fs');var fs_extra=require(_0x17be('0x9'));var _=require('lodash');var squel=require(_0x17be('0xa'));var crypto=require(_0x17be('0xb'));var jsforce=require(_0x17be('0xc'));var deskjs=require(_0x17be('0xd'));var toCsv=require(_0x17be('0xe'));var querystring=require(_0x17be('0xf'));var Papa=require('papaparse');var Redis=require(_0x17be('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x17be('0x11'));var as=require(_0x17be('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x17be('0x13'))(_0x17be('0x14'));var utils=require(_0x17be('0x15'));var config=require(_0x17be('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x17be('0x17'))['db'];config['redis']=_[_0x17be('0x18')](config['redis'],{'host':_0x17be('0x19'),'port':0x18eb});var socket=require(_0x17be('0x1a'))(new Redis(config[_0x17be('0x1b')]));require(_0x17be('0x1c'))[_0x17be('0x1d')](socket);function respondWithStatusCode(_0x4cbd7e,_0x127e5a){_0x127e5a=_0x127e5a||0xcc;return function(_0x497a95){if(_0x497a95){return _0x4cbd7e['sendStatus'](_0x127e5a);}return _0x4cbd7e[_0x17be('0x1e')](_0x127e5a)['end']();};}function respondWithResult(_0x2a37ec,_0x4abdbc){_0x4abdbc=_0x4abdbc||0xc8;return function(_0x2aa9a6){if(_0x2aa9a6){return _0x2a37ec[_0x17be('0x1e')](_0x4abdbc)['json'](_0x2aa9a6);}};}function respondWithFilteredResult(_0x179a31,_0x5a1454){return function(_0x222009){if(_0x222009){var _0x4cff4b=typeof _0x5a1454[_0x17be('0x1f')]===_0x17be('0x20')&&typeof _0x5a1454[_0x17be('0x21')]===_0x17be('0x20');var _0x445e9b=_0x222009['count'];var _0x1b664c=_0x4cff4b?0x0:_0x5a1454[_0x17be('0x1f')];var _0x138b97=_0x4cff4b?_0x222009[_0x17be('0x22')]:_0x5a1454['offset']+_0x5a1454[_0x17be('0x21')];var _0x5310a3;if(_0x138b97>=_0x445e9b){_0x138b97=_0x445e9b;_0x5310a3=0xc8;}else{_0x5310a3=0xce;}_0x179a31['status'](_0x5310a3);return _0x179a31[_0x17be('0x23')](_0x17be('0x24'),_0x1b664c+'-'+_0x138b97+'/'+_0x445e9b)[_0x17be('0x25')](_0x222009);}return null;};}function patchUpdates(_0x285afc){return function(_0x5ec450){try{jsonpatch[_0x17be('0x26')](_0x5ec450,_0x285afc,!![]);}catch(_0x1aa54f){return BPromise['reject'](_0x1aa54f);}return _0x5ec450[_0x17be('0x27')]();};}function saveUpdates(_0x484d71,_0x1389a9){return function(_0x47839d){if(_0x47839d){return _0x47839d[_0x17be('0x28')](_0x484d71)[_0x17be('0x29')](function(_0x53320b){return _0x53320b;});}return null;};}function removeEntity(_0x4459fb,_0x4f535a){return function(_0x48ae1f){if(_0x48ae1f){return _0x48ae1f[_0x17be('0x2a')]()['then'](function(){_0x4459fb[_0x17be('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16a3ad,_0x1efef0){return function(_0x165046){if(!_0x165046){_0x16a3ad[_0x17be('0x2b')](0x194);}return _0x165046;};}function handleError(_0x339d11,_0x1f8908){_0x1f8908=_0x1f8908||0x1f4;return function(_0x266b84){logger[_0x17be('0x2c')](_0x266b84['stack']);if(_0x266b84[_0x17be('0x2d')]){delete _0x266b84[_0x17be('0x2d')];}_0x339d11[_0x17be('0x1e')](_0x1f8908)[_0x17be('0x2e')](_0x266b84);};}exports[_0x17be('0x2f')]=function(_0x564897,_0x233c28){var _0x294f46={},_0x456978={},_0x50e0c2={'count':0x0,'rows':[]};return db['CmContact'][_0x17be('0x30')]()[_0x17be('0x29')](function(_0x57c5b2){var _0x24c39a=[];for(var _0x48d695=0x0;_0x48d695<Object[_0x17be('0x31')](_0x57c5b2)[_0x17be('0x32')];_0x48d695++){var _0x20ddb0=Object[_0x17be('0x31')](_0x57c5b2)[_0x48d695];if(_[_0x17be('0x33')](_0x20ddb0,_0x17be('0x34'))){_0x24c39a[_0x17be('0x35')](db[_0x17be('0x36')]['findOne']({'where':{'id':_[_0x17be('0x37')](_0x20ddb0,_0x17be('0x34'))},'raw':!![]}));}}return BPromise['all'](_0x24c39a)[_0x17be('0x29')](function(_0x469181){for(var _0x5c3655=0x0;_0x5c3655<_0x469181[_0x17be('0x32')];_0x5c3655++){if(_0x469181[_0x5c3655]){var _0x5b4f9a=_0x17be('0x34')+_0x469181[_0x5c3655]['id'];var _0xf01ac1=_0x57c5b2[_0x5b4f9a];_0xf01ac1['fieldType']=_0x469181[_0x5c3655][_0x17be('0x38')];}}return _0x57c5b2;});})[_0x17be('0x29')](function(_0x3bf796){_0x456978[_0x17be('0x39')]=_[_0x17be('0x31')](_0x3bf796);_0x456978[_0x17be('0x3a')]=_['keys'](_0x564897[_0x17be('0x3a')]);_0x456978[_0x17be('0x3b')]=_['intersection'](_0x456978[_0x17be('0x39')],_0x456978['query']);_0x294f46[_0x17be('0x3c')]=_[_0x17be('0x3d')](_0x456978[_0x17be('0x39')],qs['fields'](_0x564897[_0x17be('0x3a')][_0x17be('0x3e')]));_0x294f46[_0x17be('0x3c')]=_0x294f46[_0x17be('0x3c')][_0x17be('0x32')]?_0x294f46[_0x17be('0x3c')]:_0x456978[_0x17be('0x39')];if(!_0x564897[_0x17be('0x3a')][_0x17be('0x3f')]('nolimit')){_0x294f46['limit']=qs[_0x17be('0x21')](_0x564897[_0x17be('0x3a')][_0x17be('0x21')]);_0x294f46['offset']=qs[_0x17be('0x1f')](_0x564897[_0x17be('0x3a')][_0x17be('0x1f')]);}_0x294f46['order']=qs[_0x17be('0x40')](_0x564897[_0x17be('0x3a')][_0x17be('0x40')]);_0x294f46[_0x17be('0x41')]=qs['filters'](_[_0x17be('0x42')](_0x564897['query'],_0x456978[_0x17be('0x3b')]),_0x3bf796);var _0x2f79f8=[];var _0x42b50b=squel[_0x17be('0x43')]()[_0x17be('0x44')]('id')[_0x17be('0x44')]('name')[_0x17be('0x44')](_0x17be('0x45'))[_0x17be('0x46')](_0x17be('0x47'));var _0x1536ca=squel[_0x17be('0x43')]()[_0x17be('0x46')](_0x17be('0x48'),'c')[_0x17be('0x49')](_0x17be('0x4a'),'uc',_0x17be('0x4b'))[_0x17be('0x49')]('cm_contact_has_tags','ct',_0x17be('0x4c'))[_0x17be('0x49')](_0x17be('0x47'),'t',_0x17be('0x4d'))[_0x17be('0x41')](_0x17be('0x4e'));var _0x5b07e6=squel[_0x17be('0x4f')]();var _0x81a890=[];var _0x2ce6c5=squel[_0x17be('0x4f')]();var _0x450edd;if(_0x564897[_0x17be('0x3a')][_0x17be('0x50')]){_0x450edd=as[_0x17be('0x51')](_0x564897[_0x17be('0x3a')]['search']);var _0x50b6e3=_0x450edd[_0x17be('0x52')];for(var _0x2786c2=0x0;_0x2786c2<_0x450edd[_0x17be('0x53')][_0x17be('0x32')];_0x2786c2++){var _0x43be24=_0x450edd[_0x17be('0x53')][_0x2786c2];var _0x29fe75='c';var _0x36983e=_(_0x3bf796)['keys']()[_0x17be('0x54')](function(_0x22994d){return _0x22994d===_0x43be24[_0x17be('0x44')];});if(_0x36983e)_0x36983e=_0x3bf796[_0x43be24[_0x17be('0x44')]];if(!_0x36983e){if(_0x43be24[_0x17be('0x44')]===_0x17be('0x55')){var _0x4cad37=_0x43be24['value'][_0x17be('0x56')](',')[_0x17be('0x57')](function(_0x38dc2f){return Number(_0x38dc2f);});_0x4cad37['forEach'](function(_0x3f576d){_0x2ce6c5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f576d+',%');});_0x81a890=_['union'](_0x81a890,_0x4cad37);}else if(_0x43be24[_0x17be('0x44')]===_0x17be('0x58')){_0x5b07e6[_0x17be('0x59')](_0x17be('0x5a'),_0x43be24[_0x17be('0x5b')]);}}else{if(_0x43be24[_0x17be('0x44')]===_0x17be('0x5c')||_0x36983e[_0x17be('0x5d')]===_0x17be('0x5e'))_0x43be24[_0x17be('0x5f')]=_0x17be('0x60');var _0x5bac4a=as[_0x17be('0x61')](_0x29fe75,_0x36983e['type'],_0x43be24);_0x5b07e6[_0x50b6e3](_0x5bac4a['text'],_0x5bac4a[_0x17be('0x5b')][_0x17be('0x62')],_0x5bac4a[_0x17be('0x5b')]['end']);}}}else{var _0x32b4f8=_(Object[_0x17be('0x31')](_0x564897[_0x17be('0x3a')]))[_0x17be('0x57')](function(_0xeef622){return _0x3bf796[_0x17be('0x3f')](_0xeef622)?_0xeef622:undefined;})[_0x17be('0x63')](function(_0x46862a){return!_[_0x17be('0x64')](_0x46862a);})[_0x17be('0x5b')]();if(_0x564897[_0x17be('0x3a')][_0x17be('0x65')])_0x32b4f8[_0x17be('0x35')](_0x17be('0x65'));if(!_['isEmpty'](_0x32b4f8)){_0x32b4f8[_0x17be('0x66')](function(_0x37af37){if(_0x37af37===_0x17be('0x67')){_0x1536ca[_0x17be('0x41')](_0x17be('0x68'),[]['concat'](_0x564897[_0x17be('0x3a')][_0x37af37]));}else if(_0x37af37===_0x17be('0x65')){var _0x54d681='%'+_0x564897[_0x17be('0x3a')][_0x37af37]+'%';_0x1536ca[_0x17be('0x41')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x54d681);}else{_0x1536ca[_0x17be('0x41')]('c.'+_0x37af37+_0x17be('0x69'),_0x564897[_0x17be('0x3a')][_0x37af37]);}});}if(_0x564897[_0x17be('0x3a')][_0x17be('0x6a')]){_0x81a890=_[_0x17be('0x6b')](_0x564897[_0x17be('0x3a')][_0x17be('0x6a')])?_0x564897[_0x17be('0x3a')]['tag']:new Array(_0x564897['query']['tag']);_0x81a890[_0x17be('0x66')](function(_0x5b1900){_0x2ce6c5['or'](_0x17be('0x6c'),'%,'+_0x5b1900+',%');});}if(_0x564897['query'][_0x17be('0x63')]){var _0x19e1e8=_0x564897[_0x17be('0x3a')][_0x17be('0x63')][_0x17be('0x6d')]('\x5c','\x5c\x5c')[_0x17be('0x6d')](/'/g,'\x27\x27');if(_0x19e1e8['split']('\x20')['length']>0x1){_0x5b07e6['or'](_0x17be('0x6e'),qs[_0x17be('0x6f')](_0x19e1e8),null);}else{if(qs[_0x17be('0x70')](_0x19e1e8)){_0x5b07e6['or'](_0x17be('0x71'),_0x19e1e8+'%');_0x5b07e6['or'](_0x17be('0x72'),_0x19e1e8+'%');_0x5b07e6['or'](_0x17be('0x73'),_0x19e1e8+'%');_0x5b07e6['or']('c.fax\x20LIKE\x20?',_0x19e1e8+'%');}else if(qs[_0x17be('0x74')](_0x19e1e8)){_0x5b07e6['or'](_0x17be('0x75'),_0x19e1e8+'%');}else{_0x5b07e6['or']('c.firstName\x20LIKE\x20?','%'+_0x19e1e8+'%');_0x5b07e6['or'](_0x17be('0x76'),'%'+_0x19e1e8+'%');_0x5b07e6['or']('c.email\x20LIKE\x20?','%'+_0x19e1e8+'%');}}}}_0x1536ca[_0x17be('0x41')](_0x5b07e6);_0x1536ca['group'](_0x17be('0x77'));var _0x272132={'type':db[_0x17be('0x78')][_0x17be('0x79')]['SELECT'],'raw':!![]};var _0x4c92f1=_0x1536ca[_0x17be('0x7a')]()[_0x17be('0x44')](_0x17be('0x77'));if(_0x294f46[_0x17be('0x7b')]){_0x294f46[_0x17be('0x7b')]['forEach'](function(_0x18e9c4){_0x1536ca[_0x17be('0x7b')]('c.'+_0x18e9c4[0x0],_0x18e9c4[0x1]==='DESC'?![]:!![]);});}if(!_[_0x17be('0x7c')](_0x81a890)){_0x1536ca[_0x17be('0x7d')](_0x2ce6c5);_0x4c92f1['where']('t.id\x20IN\x20?',_0x81a890);}BPromise[_0x17be('0x7e')]()[_0x17be('0x29')](function(){if(!_0x450edd)return;if(_0x564897['user'][_0x17be('0x7f')]!==_0x17be('0x80'))return;if(!_[_0x17be('0x81')](_0x450edd[_0x17be('0x53')],[_0x17be('0x44'),_0x17be('0x58')])){return _0x564897[_0x17be('0x82')][_0x17be('0x83')]({'attributes':['id'],'raw':!![]})[_0x17be('0x29')](function(_0x39452f){if(_[_0x17be('0x7c')](_0x39452f)){_0x4c92f1[_0x17be('0x41')](_0x17be('0x84'));_0x1536ca[_0x17be('0x41')]('c.ListId\x20IS\x20NULL');}else{_0x4c92f1['where'](_0x17be('0x68'),_[_0x17be('0x57')](_0x39452f,'id'));_0x1536ca[_0x17be('0x41')](_0x17be('0x68'),_[_0x17be('0x57')](_0x39452f,'id'));}});}})[_0x17be('0x29')](function(){if(_0x564897[_0x17be('0x82')]['role']===_0x17be('0x80')&&!_0x450edd&&!_0x564897[_0x17be('0x3a')][_0x17be('0x67')])return[];return db[_0x17be('0x85')]['query'](_0x4c92f1[_0x17be('0x86')](),_0x272132);})[_0x17be('0x29')](function(_0x554d61){_0x50e0c2[_0x17be('0x22')]=_0x554d61['length'];if(_0x50e0c2['count']===0x0)return[];return db[_0x17be('0x85')]['query'](_0x42b50b['toString'](),_0x272132)['then'](function(_0x3ecf36){_0x2f79f8=_[_0x17be('0x87')](_0x3ecf36,'id');_0x272132=_['merge'](_0x272132,{'model':db[_0x17be('0x88')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x564897['query'][_0x17be('0x3e')]){_0x294f46[_0x17be('0x3c')][_0x17be('0x66')](function(_0x3c3f27){_0x1536ca[_0x17be('0x44')]('c.'+_0x3c3f27);});}else{_0x1536ca[_0x17be('0x44')]('c.id');_0x1536ca['field']('c.firstName');_0x1536ca[_0x17be('0x44')](_0x17be('0x89'));_0x1536ca[_0x17be('0x44')](_0x17be('0x8a'));_0x1536ca[_0x17be('0x44')]('c.mobile');_0x1536ca[_0x17be('0x44')](_0x17be('0x8b'));_0x1536ca[_0x17be('0x44')](_0x17be('0x8c'));_0x1536ca[_0x17be('0x44')]('c.ListId');_0x1536ca[_0x17be('0x44')](_0x17be('0x8d'));_0x1536ca[_0x17be('0x44')]('c.deletedAt');_0x1536ca[_0x17be('0x44')](_0x17be('0x8e'));_0x1536ca[_0x17be('0x44')](_0x17be('0x8f'),_0x17be('0x90'));}if(_0x294f46[_0x17be('0x21')])_0x1536ca[_0x17be('0x21')](_0x294f46[_0x17be('0x21')]);if(_0x294f46[_0x17be('0x1f')])_0x1536ca[_0x17be('0x1f')](_0x294f46[_0x17be('0x1f')]);return db[_0x17be('0x85')]['query'](_0x1536ca[_0x17be('0x86')](),_0x272132);});})[_0x17be('0x29')](function(_0x4851ad){_0x4851ad[_0x17be('0x66')](function(_0x3e552d){if(_0x3e552d['TagIds']){_0x3e552d[_0x17be('0x91')]=[];_0x3e552d[_0x17be('0x90')]['split'](',')['forEach'](function(_0xbbd80){_0x3e552d['Tags']['push'](_0x2f79f8[_0xbbd80]);});}delete _0x3e552d[_0x17be('0x90')];});_0x50e0c2[_0x17be('0x92')]=_0x4851ad;return _0x50e0c2;})[_0x17be('0x29')](respondWithFilteredResult(_0x233c28,_0x294f46));})[_0x17be('0x93')](handleError(_0x233c28,null));};exports[_0x17be('0x2a')]=function(_0x1b4372,_0x32022e){return db[_0x17be('0x88')][_0x17be('0x54')]({'where':{'id':_0x1b4372[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x32022e,null))[_0x17be('0x29')](removeEntity(_0x32022e,null))[_0x17be('0x93')](handleError(_0x32022e,null));};exports['describe']=function(_0x3c8b95,_0x590c29){return db[_0x17be('0x88')][_0x17be('0x30')]()['then'](function(_0xede2dc){delete _0xede2dc[_0x17be('0x95')];for(var _0x2afcf6=0x0;_0x2afcf6<Object[_0x17be('0x31')](_0xede2dc)[_0x17be('0x32')];_0x2afcf6++){var _0x40ee11=Object[_0x17be('0x31')](_0xede2dc)[_0x2afcf6];if(!_[_0x17be('0x33')](_0x40ee11,_0x17be('0x34'))){_0xede2dc[_0x40ee11][_0x17be('0x96')]=_0x40ee11;_0xede2dc[_0x40ee11][_0x17be('0x97')]=_0x40ee11;}}return _0xede2dc;})[_0x17be('0x29')](function(_0x3aabf2){var _0xa19336={'where':{'$or':[{'ListId':_0x3c8b95['query']['id']},{'ListId':null}]},'raw':!![]};return db['CmCustomField']['findAll'](_0xa19336)[_0x17be('0x29')](function(_0xf1d829){for(var _0x341c66=0x0;_0x341c66<_0xf1d829[_0x17be('0x32')];_0x341c66++){var _0xd004ad='cf_'+_0xf1d829[_0x341c66]['id'];_0x3aabf2[_0xd004ad][_0x17be('0x96')]=_0xd004ad;_0x3aabf2[_0xd004ad][_0x17be('0x97')]=_0xf1d829[_0x341c66][_0x17be('0x98')];_0x3aabf2[_0xd004ad]['custom']={'type':_0xf1d829[_0x341c66][_0x17be('0x38')],'values':_0xf1d829[_0x341c66][_0x17be('0x99')]};}Object['keys'](_0x3aabf2)[_0x17be('0x66')](function(_0x1dbfdb){if(!_0x3aabf2[_0x1dbfdb][_0x17be('0x3f')]('columnName')){delete _0x3aabf2[_0x1dbfdb];}});return _0x3aabf2;});})[_0x17be('0x29')](respondWithResult(_0x590c29,null))[_0x17be('0x93')](handleError(_0x590c29,null));};exports[_0x17be('0x9a')]=function(_0x1fc01f,_0x1af9b2){var _0x26aeef;var _0x2c2e0f;var _0x397af5;if(_0x1fc01f[_0x17be('0x9b')]['id']){delete _0x1fc01f[_0x17be('0x9b')]['id'];}return db['CmContact']['findAll']({'where':{'id':[_0x1fc01f[_0x17be('0x9b')]['to'],_0x1fc01f[_0x17be('0x9b')][_0x17be('0x46')]]}})[_0x17be('0x29')](function(_0x451e28){if(_0x451e28){if(_0x451e28[_0x17be('0x32')]!==0x2){return null;}_0x451e28[0x0]=_0x451e28[0x0][_0x17be('0x9c')]({'plain':!![]});_0x451e28[0x1]=_0x451e28[0x1][_0x17be('0x9c')]({'plain':!![]});delete _0x451e28[0x0]['id'];delete _0x451e28[0x1]['id'];return _[_0x17be('0x9d')](_0x451e28[0x0],_0x451e28[0x1],function(_0x274673,_0x11c0f6){if(Array[_0x17be('0x6b')](_0x11c0f6)&&!_0x11c0f6[_0x17be('0x32')]){return _0x274673;}else if(!_0x11c0f6){return _0x274673;}});}})[_0x17be('0x29')](handleEntityNotFound(_0x1af9b2,null))[_0x17be('0x29')](function(_0x4ea972){if(_0x4ea972){if(_0x4ea972[_0x17be('0x95')]&&_[_0x17be('0x6b')](_0x4ea972[_0x17be('0x95')])){_0x4ea972[_0x17be('0x95')]=_0x4ea972[_0x17be('0x95')][_0x17be('0x9e')]();}logger['info'](_0x17be('0x9f'),_0x1fc01f[_0x17be('0x9b')]['to'],_0x1fc01f[_0x17be('0x9b')][_0x17be('0x46')]);return db['CmHopper']['destroy']({'where':{'ContactId':[_0x1fc01f[_0x17be('0x9b')]['to'],_0x1fc01f[_0x17be('0x9b')]['from']]}})[_0x17be('0x29')](function(_0x38e4bd){logger[_0x17be('0xa0')](_0x17be('0xa1'),_0x38e4bd);return db[_0x17be('0xa2')][_0x17be('0x2a')]({'where':{'ContactId':[_0x1fc01f[_0x17be('0x9b')]['to'],_0x1fc01f['body']['from']]}})[_0x17be('0x29')](function(_0x3e8a12){logger[_0x17be('0xa0')](_0x17be('0xa3'),_0x3e8a12);return db[_0x17be('0x88')][_0x17be('0xa4')](_0x4ea972);});});}})[_0x17be('0x29')](function(_0x41a33d){if(_0x41a33d){_0x26aeef=_0x41a33d;_0x2c2e0f={'ContactId':_0x26aeef['id']};_0x397af5={'where':{'ContactId':[_0x1fc01f['body']['to'],_0x1fc01f[_0x17be('0x9b')]['from']]}};return db[_0x17be('0xa5')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xa6')]['update'](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xa7')]['update'](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xa8')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})['then'](function(){if(_0x26aeef){return db['MailMessage']['update'](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xa8')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xa9')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db['SmsInteraction'][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})['then'](function(){if(_0x26aeef){return db['SmsMessage'][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db['FaxInteraction'][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})['then'](function(){if(_0x26aeef){return db['FaxMessage'][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db['OpenchannelInteraction'][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xaa')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})['then'](function(){if(_0x26aeef){return db[_0x17be('0xab')][_0x17be('0x28')]({'CmContactId':_0x26aeef['id']},{'where':{'CmContactId':[_0x1fc01f[_0x17be('0x9b')]['to'],_0x1fc01f['body'][_0x17be('0x46')]]}});}})['then'](function(){if(_0x26aeef){return db[_0x17be('0xac')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xad')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})['then'](function(){if(_0x26aeef){return db['ReportAgentPreview']['update'](_0x2c2e0f,_0x397af5);}})['then'](function(){if(_0x26aeef){return db[_0x17be('0xae')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xaf')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xb0')]['update'](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db['MailQueueReport'][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})['then'](function(){if(_0x26aeef){return db[_0x17be('0xb1')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})['then'](function(){if(_0x26aeef){return db[_0x17be('0xb2')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xb3')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xb4')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xb5')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0xb6')][_0x17be('0x28')](_0x2c2e0f,_0x397af5);}})[_0x17be('0x29')](function(){if(_0x26aeef){return db[_0x17be('0x88')][_0x17be('0x2a')]({'where':{'id':[_0x1fc01f[_0x17be('0x9b')]['to'],_0x1fc01f['body'][_0x17be('0x46')]]}});}})['then'](function(){if(_0x26aeef){return _0x26aeef;}})[_0x17be('0x29')](respondWithResult(_0x1af9b2,null))[_0x17be('0x93')](handleError(_0x1af9b2,null));};exports[_0x17be('0xa4')]=function(_0xace6fa,_0x16bb65){return db[_0x17be('0x88')][_0x17be('0x30')]()[_0x17be('0x29')](function(_0x403992){if(_0xace6fa[_0x17be('0x9b')]['tags']&&_[_0x17be('0x6b')](_0xace6fa[_0x17be('0x9b')]['tags'])){if(_0xace6fa[_0x17be('0x9b')]['tags']['length']){_0xace6fa[_0x17be('0x9b')][_0x17be('0x95')]=_0xace6fa['body'][_0x17be('0x95')][_0x17be('0x9e')](';')+';';}else{_0xace6fa['body'][_0x17be('0x95')]=null;}}else{_0xace6fa[_0x17be('0x9b')][_0x17be('0x95')]=null;}return db[_0x17be('0x88')]['create'](_0xace6fa[_0x17be('0x9b')],{'fields':_[_0x17be('0x31')](_0x403992),'raw':!![]});})[_0x17be('0x29')](function(_0x2c19ee){if(_0xace6fa['body'][_0x17be('0xb7')]){return insertAdditionalPhones(_0x2c19ee,_0xace6fa['body'][_0x17be('0xb7')]);}else{return _0x2c19ee;}})['then'](respondWithResult(_0x16bb65,0xc9))[_0x17be('0x93')](handleError(_0x16bb65,null));};exports[_0x17be('0xb8')]=function(_0x293ddd,_0x1f611a){var _0x620050=[];var _0x46c3a8=0x0;var _0x5ea16e=0x0;var _0x2ca38a=0x0;var _0x2bbcd3=[];return db[_0x17be('0x88')][_0x17be('0x30')]()[_0x17be('0x29')](function(_0x4fb114){return BPromise[_0x17be('0xb9')](_0x293ddd[_0x17be('0x9b')],function(_0x2531d8){var _0x1e1ea2={'where':{'$or':[]},'defaults':_0x2531d8,'fields':_['keys'](_0x4fb114),'raw':!![]};if(_0x2531d8[_0x17be('0xba')]){for(var _0x3e36fd=0x0;_0x3e36fd<_0x2531d8[_0x17be('0xba')][_0x17be('0x32')];_0x3e36fd++){var _0x430b23={};_0x430b23[_0x2531d8['duplicates'][_0x3e36fd]]=_0x2531d8[_0x2531d8[_0x17be('0xba')][_0x3e36fd]];_0x1e1ea2[_0x17be('0x41')]['$or'][_0x17be('0x35')](_0x430b23);}_0x1e1ea2[_0x17be('0x41')]['ListId']=_0x2531d8['ListId'];}return db[_0x17be('0x88')][_0x17be('0xbb')](_0x1e1ea2)[_0x17be('0xbc')](function(_0x27e496,_0x281699){if(_0x281699){if(_0x2531d8[_0x17be('0x3f')](_0x17be('0xb7'))){_0x2bbcd3[_0x17be('0x35')]({'contact':_0x27e496,'additionalPhones':_0x2531d8['additionalPhones']});}_0x46c3a8++;}else{_0x2ca38a++;}})['catch'](function(_0x1198b5){console[_0x17be('0x2c')](_0x1198b5);_0x5ea16e++;});});})['then'](function(_0x2f71e3){if(_0x2f71e3){if(_0x2bbcd3[_0x17be('0x32')]>0x0){return new Promise(function(_0xbc6f2f,_0x1e5b25){var _0x525a74=[];for(var _0x1f0860=0x0;_0x1f0860<_0x2bbcd3[_0x17be('0x32')];_0x1f0860++){_0x525a74[_0x17be('0x35')](insertAdditionalPhones(_0x2bbcd3[_0x1f0860]['contact'],_0x2bbcd3[_0x1f0860][_0x17be('0xb7')]));}Promise[_0x17be('0xbd')](_0x525a74)[_0x17be('0x29')](function(){_0xbc6f2f(0x1);});})[_0x17be('0x29')](function(){return{'success':_0x46c3a8,'failure':_0x5ea16e,'duplicates':_0x2ca38a};});}else{return{'success':_0x46c3a8,'failure':_0x5ea16e,'duplicates':_0x2ca38a};}}})['then'](respondWithResult(_0x1f611a,0xc9))[_0x17be('0x93')](handleError(_0x1f611a,null));};exports[_0x17be('0xbe')]=function(_0x401e53,_0x469c70,_0x51cf9c){var _0x426b1b;return db[_0x17be('0x88')][_0x17be('0x30')]()[_0x17be('0x29')](function(_0x893b64){return db[_0x17be('0x88')][_0x17be('0x54')]({'where':{'id':_0x401e53[_0x17be('0x94')]['id']},'include':[{'model':db['Tag'],'as':_0x17be('0x91'),'attributes':['id',_0x17be('0x2d'),_0x17be('0x45')],'required':_0x401e53['query'][_0x17be('0x6a')]?!![]:![]},{'model':db[_0x17be('0xab')],'as':_0x17be('0xbf'),'where':{'CmContactId':_0x401e53['params']['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':'ItemType'}]}],'order':[db[_0x17be('0x85')]['literal'](_0x17be('0xc0'))],'logging':console['log'],'attributes':_[_0x17be('0x31')](_0x893b64)});})['then'](function(_0x2264cd){_0x426b1b=_0x2264cd[_0x17be('0x9c')]({'plain':!![]});var _0x4a9bec={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2264cd&&_0x2264cd[_0x17be('0x67')]){if(_0x2264cd[_0x17be('0x67')]){_0x4a9bec[_0x17be('0x41')][_0x17be('0xc1')][_0x17be('0x35')]({'ListId':{'$ne':_0x2264cd['ListId']}});}}return db[_0x17be('0x36')]['findAll'](_0x4a9bec);})['then'](function(_0x397539){return _['omit'](_0x426b1b,_['map'](_0x397539,function(_0x5363f1){return util['format']('cf_%d',_0x5363f1['id']);}));})['then'](handleEntityNotFound(_0x469c70,null))[_0x17be('0x29')](respondWithResult(_0x469c70,null))['catch'](handleError(_0x469c70,null));};exports[_0x17be('0x28')]=function(_0x20e204,_0x584117){var _0x16835a;if(_0x20e204['body']['id']){delete _0x20e204[_0x17be('0x9b')]['id'];}return db['CmContact'][_0x17be('0x54')]({'where':{'id':_0x20e204[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x584117,null))['then'](saveUpdates(_0x20e204[_0x17be('0x9b')],null))['then'](function(_0x28c0dd){_0x16835a=_0x28c0dd;var _0x14a06b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x28c0dd&&_0x28c0dd[_0x17be('0x67')]){if(_0x28c0dd[_0x17be('0x67')]){_0x14a06b['where'][_0x17be('0xc1')][_0x17be('0x35')]({'ListId':{'$ne':_0x28c0dd[_0x17be('0x67')]}});}}return db[_0x17be('0x36')][_0x17be('0xc2')](_0x14a06b);})[_0x17be('0x29')](function(_0x4502aa){if(_0x4502aa){return _[_0x17be('0xc3')](_[_0x17be('0xc4')](_0x20e204[_0x17be('0x9b')],function(_0x19f7d6,_0x582eec){return _[_0x17be('0x33')](_0x582eec,'cf_');}),_[_0x17be('0x57')](_0x4502aa,function(_0x194aa0){return util[_0x17be('0xc5')](_0x17be('0xc6'),_0x194aa0['id']);}));}})[_0x17be('0x29')](function(_0x5dab34){if(_0x5dab34&&!_['isEmpty'](_0x5dab34)){var _0x2eceb7=squel[_0x17be('0x28')]()[_0x17be('0xc7')]('cm_contacts')[_0x17be('0xc8')](_0x5dab34)['where'](_0x17be('0xc9'),_0x20e204[_0x17be('0x94')]['id'])['toParam']();return db[_0x17be('0x85')]['query'](_0x2eceb7[_0x17be('0xca')],{'replacements':_0x2eceb7[_0x17be('0x99')]});}})[_0x17be('0x29')](function(){if(_0x20e204[_0x17be('0x9b')][_0x17be('0xcb')]&&_0x16835a){return db[_0x17be('0xcc')]['update']({'phone':_0x20e204[_0x17be('0x9b')]['phone']},{'where':{'ContactId':_0x16835a['id']}});}})[_0x17be('0x29')](function(){return _0x16835a;})[_0x17be('0x29')](respondWithResult(_0x584117,null))[_0x17be('0x93')](handleError(_0x584117,null));};exports['getTags']=function(_0x23592a,_0x73ca71,_0x27bec8){var _0x20118f={};var _0x3b511a={};var _0x5e0239;var _0x3e0fa7;return db[_0x17be('0x88')]['findOne']({'where':{'id':_0x23592a[_0x17be('0x94')]['id']}})['then'](handleEntityNotFound(_0x73ca71,null))[_0x17be('0x29')](function(_0x5883d5){if(_0x5883d5){_0x5e0239=_0x5883d5;_0x3b511a['model']=_[_0x17be('0x31')](db['Tag']['rawAttributes']);_0x3b511a[_0x17be('0x3a')]=_[_0x17be('0x31')](_0x23592a[_0x17be('0x3a')]);_0x3b511a[_0x17be('0x3b')]=_[_0x17be('0x3d')](_0x3b511a['model'],_0x3b511a[_0x17be('0x3a')]);_0x20118f[_0x17be('0x3c')]=_['intersection'](_0x3b511a[_0x17be('0x39')],qs[_0x17be('0x3e')](_0x23592a[_0x17be('0x3a')][_0x17be('0x3e')]));_0x20118f[_0x17be('0x3c')]=_0x20118f['attributes']['length']?_0x20118f['attributes']:_0x3b511a[_0x17be('0x39')];_0x20118f[_0x17be('0x7b')]=qs['sort'](_0x23592a[_0x17be('0x3a')]['sort']);_0x20118f[_0x17be('0x41')]=qs[_0x17be('0x3b')](_['pick'](_0x23592a['query'],_0x3b511a[_0x17be('0x3b')]));if(_0x23592a[_0x17be('0x3a')][_0x17be('0x63')]){_0x20118f[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x20118f['where'],{'$or':_[_0x17be('0x57')](_0x20118f[_0x17be('0x3c')],function(_0x48593d){var _0x4a762d={};_0x4a762d[_0x48593d]={'$like':'%'+_0x23592a[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x4a762d;})});}_0x20118f=_[_0x17be('0x9a')]({},_0x20118f,_0x23592a['options']);return _0x5e0239[_0x17be('0xcd')](_0x20118f);}})[_0x17be('0x29')](function(_0x439be0){if(_0x439be0){_0x3e0fa7=_0x439be0[_0x17be('0x32')];if(!_0x23592a['query'][_0x17be('0x3f')]('nolimit')){_0x20118f[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x23592a[_0x17be('0x3a')][_0x17be('0x21')]);_0x20118f[_0x17be('0x1f')]=qs['offset'](_0x23592a[_0x17be('0x3a')][_0x17be('0x1f')]);}return _0x5e0239['getTags'](_0x20118f);}})[_0x17be('0x29')](function(_0x3e98bf){if(_0x3e98bf){return _0x3e98bf?{'count':_0x3e0fa7,'rows':_0x3e98bf}:null;}})[_0x17be('0x29')](respondWithResult(_0x73ca71,null))[_0x17be('0x93')](handleError(_0x73ca71,null));};exports[_0x17be('0xce')]=function(_0xb030da,_0x251c22,_0x21a546){if(_0xb030da[_0x17be('0x9b')]['id']){delete _0xb030da[_0x17be('0x9b')]['id'];}return db[_0x17be('0x88')][_0x17be('0xcf')]({'where':{'id':_0xb030da['params']['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x251c22,null))['then'](function(_0x3bf4b2){if(_0x3bf4b2){return _0x3bf4b2[_0x17be('0xce')](_0xb030da[_0x17be('0x9b')][_0x17be('0xd0')]||[]);}return null;})[_0x17be('0x29')](respondWithResult(_0x251c22,null))['catch'](handleError(_0x251c22,null));};exports['setAdditionalPhones']=function(_0x5c160b,_0x4f9b36){var _0x404181=[];_0x404181['push'](addAdditionalPhones(_0x5c160b[_0x17be('0x9b')]));Promise[_0x17be('0xbd')](_0x404181)[_0x17be('0x29')](function(){_0x404181=[];_0x404181[_0x17be('0x35')](deleteCmHopperPhones(_0x5c160b[_0x17be('0x9b')]['id']));_0x404181['push'](addCmHopperPhones(_0x5c160b[_0x17be('0x9b')]['id']));Promise['all'](_0x404181)[_0x17be('0x29')](function(){return[0x1];})[_0x17be('0x29')](respondWithResult(_0x4f9b36,null));});};function addAdditionalPhones(_0x2f1fd0){var _0x358c04;return new Promise(function(_0xe46107,_0x30f9cf){return db[_0x17be('0xab')][_0x17be('0x2a')]({'where':{'CmContactId':_0x2f1fd0['id']}})[_0x17be('0x29')](function(){var _0x4c37f4=[];for(var _0x58072d=0x0;_0x58072d<_0x2f1fd0[_0x17be('0xd1')][_0x17be('0x32')];_0x58072d++){var _0x227f93=_0x2f1fd0[_0x17be('0xd2')]?_[_0x17be('0x64')](_0x2f1fd0[_0x17be('0xd2')][_0x58072d])?'':_0x2f1fd0['item_types'][_0x58072d]:_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xd3')]?_0x2f1fd0['items'][_0x58072d][_0x17be('0xd3')]:'';var _0x59de60=_[_0x17be('0x64')](_0x2f1fd0[_0x17be('0xd1')][_0x58072d]['description'])?'':_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xd4')];var _0xc20026=_0x227f93+':'+_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xcb')]+'§'+_0x59de60;if(_[_0x17be('0x64')](_0x358c04))_0x358c04=_0xc20026;else _0x358c04+=';'+_0xc20026;_0x4c37f4[_0x17be('0x35')](addAdditionalPhone(_0x2f1fd0['id'],_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xcb')],_0x2f1fd0[_0x17be('0xd2')]?_['isNil'](_0x2f1fd0[_0x17be('0xd2')][_0x58072d])?null:_0x2f1fd0[_0x17be('0xd2')][_0x58072d]:_0x2f1fd0[_0x17be('0xd1')][_0x58072d]['ItemTypeId']?_0x2f1fd0[_0x17be('0xd1')][_0x58072d][_0x17be('0xd3')]:null,_0x58072d,_0x59de60));}Promise[_0x17be('0xbd')](_0x4c37f4)[_0x17be('0x29')](function(){db['CmContact'][_0x17be('0x28')]({'AdditionalPhones':_0x358c04},{'where':{'id':_0x2f1fd0['id']}})[_0x17be('0x29')](function(){_0xe46107(0x1);});});});});}function addAdditionalPhone(_0xf0f27f,_0x3c41a9,_0x46f628,_0x976cc5,_0x16b144){return db[_0x17be('0xab')]['find']({'where':{'CmContactId':_0xf0f27f,'item':_0x3c41a9}})[_0x17be('0x29')](function(_0xfb3900){if(_0xfb3900)logger[_0x17be('0xa0')](_0x17be('0xd5'),_0xfb3900);else{db['CmContactHasItem'][_0x17be('0xa4')]({'CmContactId':_0xf0f27f,'item':_0x3c41a9,'ItemTypeId':_0x46f628,'OrderBy':_0x976cc5,'ItemClass':_0x17be('0xd6'),'description':_0x16b144});}});}function deletePhones(_0x47e3d4){return db[_0x17be('0xab')]['destroy']({'where':{'CmContactId':_0x47e3d4}});}function deleteCmHopperPhones(_0x445456){return new Promise(function(_0x557df4,_0x17c724){return db[_0x17be('0xcc')][_0x17be('0xc2')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x445456}})[_0x17be('0x29')](function(_0x528dff){db[_0x17be('0xd7')][_0x17be('0x2a')]({'where':{'CmHopperId':{'$in':_[_0x17be('0x57')](_0x528dff,'id')}}});})[_0x17be('0x29')](function(){_0x557df4(0x1);});});}function addCmHopperPhones(_0x31a51c){return new Promise(function(_0x51f8ca,_0x2547b5){return db[_0x17be('0xcc')][_0x17be('0xc2')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x31a51c}})[_0x17be('0x29')](function(_0x55054a){var _0x4de8c1=[];_[_0x17be('0x57')](_0x55054a,function(_0x923da9){_0x4de8c1['push'](createCmHopperPhone(_0x31a51c,_0x923da9['id']));});Promise[_0x17be('0xbd')](_0x4de8c1)[_0x17be('0x29')](function(){_0x51f8ca(0x1);});});});}function createCmHopperPhone(_0x511fc8,_0x591e5a){return new Promise(function(_0x5e228f,_0x5db52c){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':[_0x17be('0xd8')],'where':{'CmContactId':_0x511fc8,'ItemClass':_0x17be('0xd6')},'include':[{'model':db[_0x17be('0xd9')],'attributes':['OrderBy'],'as':_0x17be('0xda')}],'order':[db[_0x17be('0x85')][_0x17be('0xdb')](_0x17be('0xdc'))]})[_0x17be('0x29')](function(_0x51324f){var _0x266114=0x1;var _0x481a3a=_['map'](_0x51324f,function(_0x544d9b){_0x544d9b[_0x17be('0xdd')]=_0x591e5a;_0x544d9b[_0x17be('0xcb')]=_0x544d9b['item'];_0x544d9b[_0x17be('0xde')]=_0x544d9b[_0x17be('0xdf')]||_0x266114;delete _0x544d9b[_0x17be('0xdf')];_0x266114=_0x266114+0x1;return _0x544d9b;});return db[_0x17be('0xd7')]['bulkCreate'](_0x481a3a,{});})[_0x17be('0x29')](function(){_0x5e228f(0x1);});});}function insertAdditionalPhones(_0x27cb62,_0x1fe32c){return new Promise(function(_0x14d62e,_0x4a49da){var _0x45393f=[];for(var _0x3ed267=0x0;_0x3ed267<_0x1fe32c[_0x17be('0x32')];_0x3ed267++){var _0x4f5aeb=_0x1fe32c[_0x3ed267];_0x45393f[_0x17be('0x35')](parseContactItemType(_0x4f5aeb));}Promise['all'](_0x45393f)['then'](function(){var _0x4e69a3={'id':_0x27cb62['id'],'items':_0x1fe32c};return addAdditionalPhones(_0x4e69a3)[_0x17be('0x29')](function(_0x2da76b){return addCmHopperPhones(_0x27cb62['id']);});})[_0x17be('0x29')](function(){_0x14d62e(_0x27cb62);});});}function parseContactItemType(_0x159ed9){return new Promise(function(_0xdc8bc8,_0x48219e){if(_0x159ed9[_0x17be('0x3f')](_0x17be('0xd3'))){_0xdc8bc8(_0x159ed9);}else{return db[_0x17be('0xd9')][_0x17be('0x54')]({'where':{'name':_0x159ed9['ItemType']}})[_0x17be('0x29')](function(_0x12cf8d){if(_['isNil'](_0x12cf8d))_0x159ed9[_0x17be('0xd3')]=null;else _0x159ed9[_0x17be('0xd3')]=_0x12cf8d['id'];_0xdc8bc8(_0x159ed9);});}});}exports['getAdditionalPhones']=function(_0xd86765,_0x5c49b4){return db[_0x17be('0xab')][_0x17be('0xc2')]({'raw':!![],'where':{'CmContactId':_0xd86765[_0x17be('0x94')]['id'],'ItemClass':_0x17be('0xd6')},'include':[{'model':db[_0x17be('0xd9')],'as':_0x17be('0xda')}],'order':[[db[_0x17be('0x85')]['literal'](_0x17be('0xdc'))],['OrderBy']]})[_0x17be('0x29')](function(_0x4b53fa){return _0x4b53fa;})[_0x17be('0x29')](respondWithResult(_0x5c49b4,null))[_0x17be('0x93')](handleError(_0x5c49b4,null));};exports[_0x17be('0xe0')]=function(_0x46c06a,_0x3ca3d6){return db[_0x17be('0xab')]['findAll']({'raw':!![],'where':{'CmContactId':_0x46c06a[_0x17be('0x9b')][_0x17be('0xe1')]}})[_0x17be('0x29')](function(_0xe7dd4){var _0x2da5a8=_[_0x17be('0x57')](_0xe7dd4,function(_0xad9ceb){_0xad9ceb[_0x17be('0xe2')]=_0x46c06a[_0x17be('0x9b')]['toContactId'];return _0xad9ceb;});return db[_0x17be('0xab')][_0x17be('0xb8')](_0x2da5a8,{});})['then'](function(_0x339036){return addCmHopperPhones(_0x46c06a[_0x17be('0x9b')][_0x17be('0xe3')]);})['then'](function(_0x2bde39){return['ok'];})[_0x17be('0x29')](respondWithResult(_0x3ca3d6,null))[_0x17be('0x93')](handleError(_0x3ca3d6,null));};exports['rescheduleAdditionalPhones']=function(_0x7308c,_0x39d41b){var _0x43b6bc=[];_0x43b6bc[_0x17be('0x35')](createCmHopperPhone(_0x7308c[_0x17be('0x9b')]['id'],_0x7308c['body'][_0x17be('0xe4')]));Promise[_0x17be('0xbd')](_0x43b6bc)[_0x17be('0x29')](function(){return[0x1];})[_0x17be('0x29')](respondWithResult(_0x39d41b,null));};exports[_0x17be('0xe5')]=function(_0x48c63c,_0x12e083,_0x12bcfd){var _0x430dc7={'raw':![],'where':{}};var _0x439977={};var _0x19975d={'count':0x0,'rows':[]};return db[_0x17be('0x88')][_0x17be('0xcf')]({'where':{'id':_0x48c63c['params']['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x12e083,null))[_0x17be('0x29')](function(_0x44be2c){if(_0x44be2c){_0x439977[_0x17be('0x39')]=_[_0x17be('0x31')](db[_0x17be('0xcc')]['rawAttributes']);_0x439977[_0x17be('0x3a')]=_['keys'](_0x48c63c[_0x17be('0x3a')]);_0x439977[_0x17be('0x3b')]=_[_0x17be('0x3d')](_0x439977['model'],_0x439977['query']);_0x430dc7['attributes']=_['intersection'](_0x439977['model'],qs[_0x17be('0x3e')](_0x48c63c[_0x17be('0x3a')][_0x17be('0x3e')]));_0x430dc7[_0x17be('0x3c')]=_0x430dc7[_0x17be('0x3c')][_0x17be('0x32')]?_0x430dc7[_0x17be('0x3c')]:_0x439977[_0x17be('0x39')];if(!_0x48c63c[_0x17be('0x3a')]['hasOwnProperty'](_0x17be('0xe6'))){_0x430dc7[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x48c63c[_0x17be('0x3a')][_0x17be('0x21')]);_0x430dc7[_0x17be('0x1f')]=qs['offset'](_0x48c63c['query'][_0x17be('0x1f')]);}_0x430dc7[_0x17be('0x7b')]=qs[_0x17be('0x40')](_0x48c63c[_0x17be('0x3a')][_0x17be('0x40')]);_0x430dc7[_0x17be('0x41')]=qs[_0x17be('0x3b')](_[_0x17be('0x42')](_0x48c63c[_0x17be('0x3a')],_0x439977['filters']));_0x430dc7[_0x17be('0x41')]['ContactId']=_0x44be2c['id'];if(_0x48c63c[_0x17be('0x3a')][_0x17be('0x63')]){_0x430dc7[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x430dc7['where'],{'$or':_[_0x17be('0x57')](_0x430dc7['attributes'],function(_0x4a8450){var _0x2aefef={};_0x2aefef[_0x4a8450]={'$like':'%'+_0x48c63c[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x2aefef;})});}_0x430dc7=_[_0x17be('0x9a')]({},_0x430dc7,_0x48c63c[_0x17be('0xe7')]);return db['CmHopper'][_0x17be('0x22')]({'where':_0x430dc7[_0x17be('0x41')]})[_0x17be('0x29')](function(_0x56f4c1){_0x19975d[_0x17be('0x22')]=_0x56f4c1;if(_0x48c63c['query'][_0x17be('0xe8')]){_0x430dc7['include']=[{'all':!![]}];}return db[_0x17be('0xcc')][_0x17be('0xc2')](_0x430dc7);})[_0x17be('0x29')](function(_0x510273){_0x19975d[_0x17be('0x92')]=_0x510273;return _0x19975d;});}})[_0x17be('0x29')](respondWithFilteredResult(_0x12e083,_0x430dc7))[_0x17be('0x93')](handleError(_0x12e083,null));};exports[_0x17be('0xe9')]=function(_0x5d609c,_0x2e3f89,_0x528a0c){var _0x404105={'raw':!![],'where':{}};var _0x485bf0={};var _0x1d96a1={'count':0x0,'rows':[]};return db[_0x17be('0x88')]['findOne']({'where':{'id':_0x5d609c[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0x2e3f89,null))[_0x17be('0x29')](function(_0x488439){if(_0x488439){_0x485bf0[_0x17be('0x39')]=_['keys'](db[_0x17be('0xad')]['rawAttributes']);_0x485bf0[_0x17be('0x3a')]=_['keys'](_0x5d609c[_0x17be('0x3a')]);_0x485bf0['filters']=_[_0x17be('0x3d')](_0x485bf0[_0x17be('0x39')],_0x485bf0[_0x17be('0x3a')]);_0x404105[_0x17be('0x3c')]=_[_0x17be('0x3d')](_0x485bf0[_0x17be('0x39')],qs[_0x17be('0x3e')](_0x5d609c['query'][_0x17be('0x3e')]));_0x404105[_0x17be('0x3c')]=_0x404105[_0x17be('0x3c')][_0x17be('0x32')]?_0x404105[_0x17be('0x3c')]:_0x485bf0[_0x17be('0x39')];if(!_0x5d609c[_0x17be('0x3a')]['hasOwnProperty'](_0x17be('0xe6'))){_0x404105[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x5d609c['query'][_0x17be('0x21')]);_0x404105[_0x17be('0x1f')]=qs[_0x17be('0x1f')](_0x5d609c[_0x17be('0x3a')][_0x17be('0x1f')]);}_0x404105[_0x17be('0x7b')]=qs['sort'](_0x5d609c[_0x17be('0x3a')][_0x17be('0x40')]);_0x404105[_0x17be('0x41')]=qs['filters'](_['pick'](_0x5d609c[_0x17be('0x3a')],_0x485bf0[_0x17be('0x3b')]));_0x404105[_0x17be('0x41')][_0x17be('0xea')]=_0x488439['id'];if(_0x5d609c['query'][_0x17be('0x63')]){_0x404105[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x404105[_0x17be('0x41')],{'$or':_[_0x17be('0x57')](_0x404105[_0x17be('0x3c')],function(_0x952c51){var _0x21d6df={};_0x21d6df[_0x952c51]={'$like':'%'+_0x5d609c[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x21d6df;})});}_0x404105=_[_0x17be('0x9a')]({},_0x404105,_0x5d609c[_0x17be('0xe7')]);return db[_0x17be('0xad')][_0x17be('0x22')]({'where':_0x404105[_0x17be('0x41')]})[_0x17be('0x29')](function(_0x5dd882){_0x1d96a1['count']=_0x5dd882;if(_0x5d609c[_0x17be('0x3a')]['includeAll']){_0x404105[_0x17be('0xeb')]=[{'all':!![]}];}return db[_0x17be('0xad')][_0x17be('0xc2')](_0x404105);})[_0x17be('0x29')](function(_0x413cb1){_0x1d96a1['rows']=_0x413cb1;return _0x1d96a1;});}})[_0x17be('0x29')](respondWithFilteredResult(_0x2e3f89,_0x404105))[_0x17be('0x93')](handleError(_0x2e3f89,null));};exports[_0x17be('0xec')]=function(_0x265fdc,_0xf3271d,_0x33616f){var _0x3d682d={'raw':!![],'where':{}};var _0xea0b7d={};var _0x4936dc={'count':0x0,'rows':[]};return db['CmContact'][_0x17be('0xcf')]({'where':{'id':_0x265fdc[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0xf3271d,null))['then'](function(_0x41f91c){if(_0x41f91c){_0xea0b7d[_0x17be('0x39')]=_[_0x17be('0x31')](db[_0x17be('0xac')][_0x17be('0xed')]);_0xea0b7d[_0x17be('0x3a')]=_[_0x17be('0x31')](_0x265fdc['query']);_0xea0b7d['filters']=_[_0x17be('0x3d')](_0xea0b7d[_0x17be('0x39')],_0xea0b7d['query']);_0x3d682d['attributes']=_[_0x17be('0x3d')](_0xea0b7d['model'],qs['fields'](_0x265fdc[_0x17be('0x3a')][_0x17be('0x3e')]));_0x3d682d[_0x17be('0x3c')]=_0x3d682d[_0x17be('0x3c')][_0x17be('0x32')]?_0x3d682d[_0x17be('0x3c')]:_0xea0b7d[_0x17be('0x39')];if(!_0x265fdc[_0x17be('0x3a')][_0x17be('0x3f')]('nolimit')){_0x3d682d[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x265fdc['query'][_0x17be('0x21')]);_0x3d682d[_0x17be('0x1f')]=qs[_0x17be('0x1f')](_0x265fdc['query']['offset']);}_0x3d682d[_0x17be('0x7b')]=qs[_0x17be('0x40')](_0x265fdc[_0x17be('0x3a')][_0x17be('0x40')]);_0x3d682d['where']=qs[_0x17be('0x3b')](_['pick'](_0x265fdc[_0x17be('0x3a')],_0xea0b7d['filters']));_0x3d682d[_0x17be('0x41')][_0x17be('0xea')]=_0x41f91c['id'];if(_0x265fdc[_0x17be('0x3a')][_0x17be('0x63')]){_0x3d682d[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x3d682d[_0x17be('0x41')],{'$or':_[_0x17be('0x57')](_0x3d682d[_0x17be('0x3c')],function(_0x9c5c6a){var _0x218ad7={};_0x218ad7[_0x9c5c6a]={'$like':'%'+_0x265fdc[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x218ad7;})});}_0x3d682d=_[_0x17be('0x9a')]({},_0x3d682d,_0x265fdc[_0x17be('0xe7')]);return db[_0x17be('0xac')][_0x17be('0x22')]({'where':_0x3d682d[_0x17be('0x41')]})['then'](function(_0x47a042){_0x4936dc[_0x17be('0x22')]=_0x47a042;if(_0x265fdc[_0x17be('0x3a')][_0x17be('0xe8')]){_0x3d682d['include']=[{'all':!![]}];}return db[_0x17be('0xac')]['findAll'](_0x3d682d);})[_0x17be('0x29')](function(_0xbc64f){_0x4936dc['rows']=_0xbc64f;return _0x4936dc;});}})[_0x17be('0x29')](respondWithFilteredResult(_0xf3271d,_0x3d682d))[_0x17be('0x93')](handleError(_0xf3271d,null));};exports[_0x17be('0xee')]=function(_0xde87fd,_0xa9e77d,_0x36942f){var _0x517c2c={'raw':!![],'where':{}};var _0x3e12c4={};var _0x16689c={'count':0x0,'rows':[]};return db[_0x17be('0x88')][_0x17be('0xcf')]({'where':{'id':_0xde87fd[_0x17be('0x94')]['id']}})[_0x17be('0x29')](handleEntityNotFound(_0xa9e77d,null))[_0x17be('0x29')](function(_0x16fd52){if(_0x16fd52){_0x3e12c4['model']=_[_0x17be('0x31')](db[_0x17be('0xb3')][_0x17be('0xed')]);_0x3e12c4[_0x17be('0x3a')]=_['keys'](_0xde87fd['query']);_0x3e12c4[_0x17be('0x3b')]=_[_0x17be('0x3d')](_0x3e12c4['model'],_0x3e12c4['query']);_0x517c2c[_0x17be('0x3c')]=_[_0x17be('0x3d')](_0x3e12c4[_0x17be('0x39')],qs[_0x17be('0x3e')](_0xde87fd[_0x17be('0x3a')][_0x17be('0x3e')]));_0x517c2c['attributes']=_0x517c2c['attributes']['length']?_0x517c2c[_0x17be('0x3c')]:_0x3e12c4[_0x17be('0x39')];if(!_0xde87fd['query'][_0x17be('0x3f')](_0x17be('0xe6'))){_0x517c2c['limit']=qs[_0x17be('0x21')](_0xde87fd['query']['limit']);_0x517c2c[_0x17be('0x1f')]=qs[_0x17be('0x1f')](_0xde87fd[_0x17be('0x3a')]['offset']);}_0x517c2c[_0x17be('0x7b')]=qs[_0x17be('0x40')](_0xde87fd[_0x17be('0x3a')][_0x17be('0x40')]);_0x517c2c['where']=qs[_0x17be('0x3b')](_['pick'](_0xde87fd['query'],_0x3e12c4[_0x17be('0x3b')]));_0x517c2c[_0x17be('0x41')][_0x17be('0xea')]=_0x16fd52['id'];if(_0xde87fd[_0x17be('0x3a')][_0x17be('0x63')]){_0x517c2c[_0x17be('0x41')]=_[_0x17be('0x9a')](_0x517c2c[_0x17be('0x41')],{'$or':_[_0x17be('0x57')](_0x517c2c[_0x17be('0x3c')],function(_0x4ce649){var _0x36f552={};_0x36f552[_0x4ce649]={'$like':'%'+_0xde87fd[_0x17be('0x3a')][_0x17be('0x63')]+'%'};return _0x36f552;})});}_0x517c2c=_['merge']({},_0x517c2c,_0xde87fd[_0x17be('0xe7')]);return db['JscriptySessionReport'][_0x17be('0x22')]({'where':_0x517c2c[_0x17be('0x41')]})[_0x17be('0x29')](function(_0x28f3c2){_0x16689c[_0x17be('0x22')]=_0x28f3c2;if(_0xde87fd['query'][_0x17be('0xe8')]){_0x517c2c['include']=[{'all':!![]}];}return db[_0x17be('0xb3')]['findAll'](_0x517c2c);})['then'](function(_0x5830b1){_0x16689c[_0x17be('0x92')]=_0x5830b1;return _0x16689c;});}})['then'](respondWithFilteredResult(_0xa9e77d,_0x517c2c))['catch'](handleError(_0xa9e77d,null));};exports[_0x17be('0xef')]=function(_0x4196fe,_0x478026,_0xbed496){try{if(!_0x4196fe[_0x17be('0x9b')][_0x17be('0x67')]){throw new Error(_0x17be('0xf0'));}if(!_0x4196fe[_0x17be('0x9b')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x4196fe[_0x17be('0x9b')][_0x17be('0xf1')]){throw new Error(_0x17be('0xf2'));}if(!_0x4196fe['body']['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x30bff7=_0x4196fe[_0x17be('0x9b')][_0x17be('0xf3')]['split'](',');var _0x49b80e=_0x4196fe['body'][_0x17be('0xf1')][_0x17be('0x56')](',');if(!_0x30bff7[_0x17be('0x32')]||!_0x49b80e['length']||_0x30bff7['length']!==_0x49b80e[_0x17be('0x32')]){throw new Error(_0x17be('0xf4'));}_0x4196fe[_0x17be('0x9b')]['fields']=_[_0x17be('0xf5')](_0x30bff7,_0x49b80e);if(!_0x4196fe[_0x17be('0x9b')]['fields']['phone']){throw new Error(_0x17be('0xf6'));}if(!_0x4196fe[_0x17be('0x9b')][_0x17be('0x3e')][_0x17be('0xf7')]){throw new Error(_0x17be('0xf8'));}var _0x3c1729=path['join'](config[_0x17be('0xf9')],_0x17be('0xfa'),_0x4196fe[_0x17be('0xfb')][_0x17be('0xfc')]);fs[_0x17be('0xfd')](_0x3c1729,parseInt(_0x17be('0xfe'),0x8));var _0x3d7d42=require(_0x17be('0xff'))[_0x17be('0x100')](path['join'](__dirname,_0x17be('0x101')),[_0x3c1729,_0x4196fe['body']['binding_keys'],_0x4196fe[_0x17be('0x9b')][_0x17be('0xf1')],_0x4196fe[_0x17be('0x9b')][_0x17be('0x67')],_0x4196fe[_0x17be('0x9b')][_0x17be('0x102')],_0x4196fe[_0x17be('0x9b')][_0x17be('0xba')],_0x4196fe[_0x17be('0x9b')]['socket_timestamp']]);return _0x478026[_0x17be('0x1e')](0xc8)[_0x17be('0x25')]({'message':_0x17be('0x103'),'pid':_0x3d7d42[_0x17be('0x104')]});}catch(_0x24ab40){return _0x478026[_0x17be('0x1e')](0x1f4)[_0x17be('0x2e')](_0x24ab40);}};exports[_0x17be('0x105')]=function(_0x2430a7,_0x406bbe,_0x36fb88){var _0x353209=fs[_0x17be('0x106')](_0x2430a7['file'][_0x17be('0x107')]);Papa[_0x17be('0x108')](_0x353209,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x9e8be9){return _0x406bbe[_0x17be('0x1e')](0xc8)[_0x17be('0x25')]({'file':_0x2430a7[_0x17be('0xfb')],'fields':_0x9e8be9[_0x17be('0x109')][_0x17be('0x3e')]});}});};exports['import']=function(_0x2fc9e2,_0x5c7852,_0x370cf0){return db[_0x17be('0x58')][_0x17be('0xc2')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x17be('0x29')](function(_0x1f1182){var _0x342e81=![];if(!_0x2fc9e2[_0x17be('0x9b')][_0x17be('0x67')]){throw new Error(_0x17be('0xf0'));}if(!_0x2fc9e2['body'][_0x17be('0x10a')][_0x17be('0xcb')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x2fc9e2[_0x17be('0x9b')]['binding'][_0x17be('0xf7')]){throw new Error(_0x17be('0xf8'));}if(!_0x2fc9e2[_0x17be('0x9b')][_0x17be('0x10b')]){throw new Error(_0x17be('0x10c'));}var _0x9fcaef=require(_0x17be('0xff'))[_0x17be('0x100')](path[_0x17be('0x9e')](__dirname,_0x17be('0x10d')),[_0x2fc9e2[_0x17be('0x94')]['id'],JSON[_0x17be('0x10e')](_0x2fc9e2[_0x17be('0x9b')]),JSON[_0x17be('0x10e')](_0x1f1182)]);_0x9fcaef['on'](_0x17be('0x10f'),function(_0x11fdef){_0x342e81=!![];return _0x5c7852['status'](0xc8)[_0x17be('0x25')]({'message':_0x17be('0x110'),'pid':_0x9fcaef[_0x17be('0x104')]});});_0x9fcaef['on'](_0x17be('0x111'),function(_0x2d8be2){if(_0x2d8be2&&!_0x342e81){return _0x5c7852[_0x17be('0x1e')](0x1f4)[_0x17be('0x25')]({'message':_0x17be('0x112'),'pid':_0x9fcaef[_0x17be('0x104')]});}});})[_0x17be('0x93')](handleError(_0x5c7852,null));};exports['importUpdates']=function(_0x2a349b,_0x268536,_0x546c64){return db[_0x17be('0x58')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x17be('0x80')}})['then'](function(_0x1b9d1){var _0x7ca428=![];if(!_0x2a349b[_0x17be('0x9b')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x2a349b[_0x17be('0x9b')]['binding'][_0x17be('0xcb')]){throw new Error(_0x17be('0xf6'));}if(!_0x2a349b['body'][_0x17be('0x10a')][_0x17be('0xf7')]){throw new Error(_0x17be('0xf8'));}if(!_0x2a349b[_0x17be('0x9b')][_0x17be('0x10b')]){throw new Error(_0x17be('0x10c'));}var _0x5bae0c=require(_0x17be('0xff'))[_0x17be('0x100')](path[_0x17be('0x9e')](__dirname,_0x17be('0x113')),[_0x2a349b[_0x17be('0x94')]['id'],JSON[_0x17be('0x10e')](_0x2a349b[_0x17be('0x9b')]),JSON[_0x17be('0x10e')](_0x1b9d1)]);_0x5bae0c['on'](_0x17be('0x10f'),function(_0x2b2b2f){_0x7ca428=!![];return _0x268536['status'](0xc8)['json']({'message':_0x17be('0x110'),'pid':_0x5bae0c[_0x17be('0x104')]});});_0x5bae0c['on'](_0x17be('0x111'),function(_0x3f05dc){if(_0x3f05dc&&!_0x7ca428){return _0x268536[_0x17be('0x1e')](0x1f4)[_0x17be('0x25')]({'message':_0x17be('0x112'),'pid':_0x5bae0c[_0x17be('0x104')]});}});})['catch'](handleError(_0x268536,null));};exports[_0x17be('0x114')]=function(_0x419fce,_0x7d7008){var _0x4decd3=[_0x17be('0x115'),_0x17be('0x116'),_0x17be('0x117'),'openchannel',_0x17be('0x118'),_0x17be('0x119'),_0x17be('0x11a')];var _0x1d1945={'offset':0x0,'order':qs[_0x17be('0x40')](_0x17be('0x11b'))},_0x4fd1a3={'count':0x0,'rows':[]};Promise[_0x17be('0x7e')]()[_0x17be('0x29')](function(){if(_0x419fce[_0x17be('0x3a')]['channel']){if(!_[_0x17be('0x11c')](_0x4decd3,_0x419fce['query']['channel'][_0x17be('0x11d')]())){throw new Error(_0x17be('0x11e'));}_0x4decd3=[_0x419fce[_0x17be('0x3a')]['channel']['toLowerCase']()];}if(_0x419fce[_0x17be('0x3a')][_0x17be('0x11f')]){try{var _0x73556e=JSON['parse'](_0x419fce['query'][_0x17be('0x11f')]);if(!moment(_0x73556e[_0x17be('0x46')])['isValid']()){throw new Error(_0x17be('0x120'));}if(!moment(_0x73556e['to'])['isValid']()){throw new Error(_0x17be('0x121'));}}catch(_0x29f2e8){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x419fce['query']['hasOwnProperty'](_0x17be('0xe6'))){_0x1d1945[_0x17be('0x21')]=qs[_0x17be('0x21')](_0x419fce['query']['limit']||0xa);_0x1d1945['offset']=qs['offset'](_0x419fce[_0x17be('0x3a')][_0x17be('0x1f')]);}var _0x29f7aa=_0x4decd3[_0x17be('0x57')](function(_0x50547b){if(_0x50547b===_0x17be('0x11a')){var _0x3f9be0={'attributes':['id',_0x17be('0x122'),_0x17be('0x38'),_0x17be('0x123'),_0x17be('0x124'),'callerid',_0x17be('0x125'),_0x17be('0x126'),_0x17be('0x127'),_0x17be('0x128'),'createdAt',_0x17be('0x129'),_0x17be('0x12a'),_0x17be('0x12b'),_0x17be('0x12c')],'where':{'ContactId':_0x419fce[_0x17be('0x94')]['id']},'include':[{'model':db[_0x17be('0x58')],'as':_0x17be('0x58'),'attributes':['id','name',_0x17be('0x12d'),'alias']}],'order':[['createdAt',_0x17be('0x12e')]]};if(_0x419fce[_0x17be('0x3a')]['range']){_0x3f9be0['where'][_0x17be('0x12f')]={'$gte':_0x73556e[_0x17be('0x46')],'$lte':_0x73556e['to']};}return db[_0x17be('0xae')][_0x17be('0x130')](_0x3f9be0)['then'](function(_0x33b3f9){_0x4fd1a3[_0x17be('0x22')]+=_0x33b3f9[_0x17be('0x22')];return _[_0x17be('0x57')](_0x33b3f9[_0x17be('0x92')],function(_0x337a08){var _0x1b9eb1=_0x337a08[_0x17be('0x9c')]({'plain':!![]});_0x1b9eb1['channel']=_0x50547b;if(_0x1b9eb1['User']){_0x1b9eb1[_0x17be('0x58')]={'id':_0x1b9eb1['User']['id'],'name':_0x1b9eb1['User'][_0x17be('0x2d')],'fullname':_0x1b9eb1[_0x17be('0x58')]['fullname'],'alias':_0x1b9eb1[_0x17be('0x58')][_0x17be('0x98')]};}return _0x1b9eb1;});});}else{var _0x3506cd=_[_0x17be('0x131')](_0x50547b)+(_0x50547b==='chat'?_0x17be('0x132'):_0x17be('0x133'));var _0x18b05e={'attributes':['id',_0x17be('0x134'),_0x17be('0x135'),'createdAt',_0x17be('0x128'),_0x17be('0x136'),_0x17be('0x137'),_0x17be('0x138'),_0x17be('0x12c'),_0x3506cd+'Id'],'where':{'ContactId':_0x419fce[_0x17be('0x94')]['id']},'include':[{'model':db[_0x3506cd],'as':_0x17be('0x133'),'attributes':['id',_0x17be('0x2d'),_0x17be('0x139')]},{'model':db['User'],'as':'Owner','attributes':['id',_0x17be('0x2d'),_0x17be('0x12d')]},{'model':db[_0x17be('0x55')],'as':_0x17be('0x91'),'attributes':['id',_0x17be('0x2d'),_0x17be('0x45')],'through':{'attributes':[]}}],'order':[[_0x17be('0x12f'),_0x17be('0x12e')]]};if(_0x419fce[_0x17be('0x3a')][_0x17be('0x11f')]){_0x18b05e[_0x17be('0x41')]['createdAt']={'$gte':_0x73556e[_0x17be('0x46')],'$lte':_0x73556e['to']};}switch(_0x50547b){case'chat':_0x18b05e[_0x17be('0x3c')][_0x17be('0x35')]('browserName',_0x17be('0x13a'),'customerPort',_0x17be('0x13b'),_0x17be('0x13c'),_0x17be('0x13d'),_0x17be('0x13e'),_0x17be('0x13f'),_0x17be('0x140'));break;case _0x17be('0x115'):_0x18b05e[_0x17be('0x3c')][_0x17be('0x35')](_0x17be('0x141'),'substatus');break;case _0x17be('0x142'):_0x18b05e[_0x17be('0x3c')][_0x17be('0x35')]('externalUrl',_0x17be('0x143'));break;}return db[_[_0x17be('0x131')](_0x50547b)+_0x17be('0x144')][_0x17be('0x130')](_0x18b05e)[_0x17be('0x29')](function(_0x3b145d){_0x4fd1a3[_0x17be('0x22')]+=_0x3b145d['count'];return _[_0x17be('0x57')](_0x3b145d[_0x17be('0x92')],function(_0x265549){var _0x3af777=_0x265549[_0x17be('0x9c')]({'plain':!![]});_0x3af777[_0x17be('0x145')]=_0x50547b;if(_0x3af777[_0x17be('0x146')]){_0x3af777[_0x17be('0x146')]={'id':_0x3af777['Owner']['id'],'name':_0x3af777['Owner'][_0x17be('0x2d')],'fullname':_0x3af777[_0x17be('0x146')][_0x17be('0x12d')]};}return _0x3af777;});});}});return Promise[_0x17be('0xbd')](_0x29f7aa);})[_0x17be('0x29')](function(_0x1c6eb1){return _(_0x1c6eb1)[_0x17be('0x147')]()['sortBy'](_0x17be('0x12f'))[_0x17be('0x148')]()[_0x17be('0x5b')]();})[_0x17be('0x29')](function(_0x3f1886){_0x4fd1a3[_0x17be('0x92')]=_0x1d1945[_0x17be('0x21')]?_0x3f1886['slice'](_0x1d1945[_0x17be('0x1f')],_0x1d1945['offset']+_0x1d1945[_0x17be('0x21')]):_0x3f1886;return _0x4fd1a3;})[_0x17be('0x29')](respondWithFilteredResult(_0x7d7008,_0x1d1945))[_0x17be('0x93')](handleError(_0x7d7008,null));};
\ No newline at end of file
+var _0xe3d4=['agent','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','destroy','describe','tags','columnName','displayName','CmCustomField','findAll','alias','values','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','body','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','additionalPhones','each','duplicates','$or','findOrCreate','spread','contact','show','params','CmContactHasItem','Phones','ContactItemType','ItemType','literal','`Phones.ItemType`.OrderBy','log','$and','format','cf_%d','pickBy','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','setAdditionalPhones','item_types','items','ItemTypeId','description','PHONE','OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','bulkCreate','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20firstName\x20column\x20specified','join','file','filename','chmodSync','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','parse','meta','import','binding','No\x20phone\x20column\x20specified','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','whatsapp','voice','resolve','channel','includes','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','get','startCase','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','threadId','Interaction','flatten','reverse','slice','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','error','name','index','length','startsWith','cf_','push','findOne','trimStart','all','fieldType','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','cm_user_has_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','union','User','and','uc.UserId\x20=\x20?','value','datetime','castTo','DATE','buildExpression','text','filter','isNil','Contact','forEach','c.ListId\x20IN\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)','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','DESC','isEmpty','t.id\x20IN\x20?','user','role'];(function(_0x44f39d,_0x1d05df){var _0x295cdf=function(_0x563147){while(--_0x563147){_0x44f39d['push'](_0x44f39d['shift']());}};_0x295cdf(++_0x1d05df);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0xe3d4[_0x231a47];return _0x48d7c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e3d('0x0'));var zipdir=require(_0x4e3d('0x1'));var jsonpatch=require(_0x4e3d('0x2'));var rp=require('request-promise');var moment=require(_0x4e3d('0x3'));var BPromise=require(_0x4e3d('0x4'));var Mustache=require('mustache');var util=require(_0x4e3d('0x5'));var path=require('path');var sox=require(_0x4e3d('0x6'));var csv=require(_0x4e3d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e3d('0x8'));var _=require(_0x4e3d('0x9'));var squel=require('squel');var crypto=require(_0x4e3d('0xa'));var jsforce=require(_0x4e3d('0xb'));var deskjs=require(_0x4e3d('0xc'));var toCsv=require(_0x4e3d('0x7'));var querystring=require(_0x4e3d('0xd'));var Papa=require(_0x4e3d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4e3d('0xf'));var as=require(_0x4e3d('0x10'));var hardwareService=require(_0x4e3d('0x11'));var logger=require(_0x4e3d('0x12'))(_0x4e3d('0x13'));var utils=require(_0x4e3d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4e3d('0x15'));var db=require(_0x4e3d('0x16'))['db'];config[_0x4e3d('0x17')]=_[_0x4e3d('0x18')](config[_0x4e3d('0x17')],{'host':_0x4e3d('0x19'),'port':0x18eb});var socket=require(_0x4e3d('0x1a'))(new Redis(config[_0x4e3d('0x17')]));require('./cmContact.socket')[_0x4e3d('0x1b')](socket);function respondWithStatusCode(_0x4325b4,_0x3b7b45){_0x3b7b45=_0x3b7b45||0xcc;return function(_0x5e0d2c){if(_0x5e0d2c){return _0x4325b4[_0x4e3d('0x1c')](_0x3b7b45);}return _0x4325b4[_0x4e3d('0x1d')](_0x3b7b45)[_0x4e3d('0x1e')]();};}function respondWithResult(_0xc20768,_0x1b829e){_0x1b829e=_0x1b829e||0xc8;return function(_0x364798){if(_0x364798){return _0xc20768[_0x4e3d('0x1d')](_0x1b829e)[_0x4e3d('0x1f')](_0x364798);}};}function respondWithFilteredResult(_0x554ba6,_0x2aab75){return function(_0x5129d5){if(_0x5129d5){var _0x4b74cb=typeof _0x2aab75[_0x4e3d('0x20')]==='undefined'&&typeof _0x2aab75['limit']===_0x4e3d('0x21');var _0x2e37ad=_0x5129d5[_0x4e3d('0x22')];var _0x318bd4=_0x4b74cb?0x0:_0x2aab75['offset'];var _0x35d75c=_0x4b74cb?_0x5129d5['count']:_0x2aab75[_0x4e3d('0x20')]+_0x2aab75['limit'];var _0x170f88;if(_0x35d75c>=_0x2e37ad){_0x35d75c=_0x2e37ad;_0x170f88=0xc8;}else{_0x170f88=0xce;}_0x554ba6[_0x4e3d('0x1d')](_0x170f88);return _0x554ba6[_0x4e3d('0x23')](_0x4e3d('0x24'),_0x318bd4+'-'+_0x35d75c+'/'+_0x2e37ad)[_0x4e3d('0x1f')](_0x5129d5);}return null;};}function patchUpdates(_0x2c8186){return function(_0x575c72){try{jsonpatch['apply'](_0x575c72,_0x2c8186,!![]);}catch(_0x18271a){return BPromise[_0x4e3d('0x25')](_0x18271a);}return _0x575c72[_0x4e3d('0x26')]();};}function saveUpdates(_0x49301f,_0x3e6b53){return function(_0x58a9cb){if(_0x58a9cb){return _0x58a9cb[_0x4e3d('0x27')](_0x49301f)[_0x4e3d('0x28')](function(_0x43bc1b){return _0x43bc1b;});}return null;};}function removeEntity(_0x50d9db,_0x2434ea){return function(_0xa6569b){if(_0xa6569b){return _0xa6569b['destroy']()[_0x4e3d('0x28')](function(){_0x50d9db[_0x4e3d('0x1d')](0xcc)[_0x4e3d('0x1e')]();});}};}function handleEntityNotFound(_0x4a7820,_0x727783){return function(_0x56395b){if(!_0x56395b){_0x4a7820[_0x4e3d('0x1c')](0x194);}return _0x56395b;};}function handleError(_0x5271a1,_0x2edb44){_0x2edb44=_0x2edb44||0x1f4;return function(_0x2d1991){logger[_0x4e3d('0x29')](_0x2d1991['stack']);if(_0x2d1991[_0x4e3d('0x2a')]){delete _0x2d1991[_0x4e3d('0x2a')];}_0x5271a1['status'](_0x2edb44)['send'](_0x2d1991);};}exports[_0x4e3d('0x2b')]=function(_0x333fff,_0x36621d){var _0x49ba5b={},_0x4157e5={},_0x1be6aa={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x4e3d('0x28')](function(_0x21c9d1){var _0x575957=[];for(var _0xefeafa=0x0;_0xefeafa<Object['keys'](_0x21c9d1)[_0x4e3d('0x2c')];_0xefeafa++){var _0x14853f=Object['keys'](_0x21c9d1)[_0xefeafa];if(_[_0x4e3d('0x2d')](_0x14853f,_0x4e3d('0x2e'))){_0x575957[_0x4e3d('0x2f')](db['CmCustomField'][_0x4e3d('0x30')]({'where':{'id':_[_0x4e3d('0x31')](_0x14853f,'cf_')},'raw':!![]}));}}return BPromise[_0x4e3d('0x32')](_0x575957)[_0x4e3d('0x28')](function(_0x4b3ac7){for(var _0x2ae342=0x0;_0x2ae342<_0x4b3ac7[_0x4e3d('0x2c')];_0x2ae342++){if(_0x4b3ac7[_0x2ae342]){var _0x2034bb=_0x4e3d('0x2e')+_0x4b3ac7[_0x2ae342]['id'];var _0x1a4d94=_0x21c9d1[_0x2034bb];_0x1a4d94[_0x4e3d('0x33')]=_0x4b3ac7[_0x2ae342][_0x4e3d('0x34')];}}return _0x21c9d1;});})[_0x4e3d('0x28')](function(_0x255b1d){_0x4157e5[_0x4e3d('0x35')]=_[_0x4e3d('0x36')](_0x255b1d);_0x4157e5['query']=_[_0x4e3d('0x36')](_0x333fff[_0x4e3d('0x37')]);_0x4157e5[_0x4e3d('0x38')]=_[_0x4e3d('0x39')](_0x4157e5[_0x4e3d('0x35')],_0x4157e5[_0x4e3d('0x37')]);_0x49ba5b['attributes']=_[_0x4e3d('0x39')](_0x4157e5[_0x4e3d('0x35')],qs[_0x4e3d('0x3a')](_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x3a')]));_0x49ba5b[_0x4e3d('0x3b')]=_0x49ba5b[_0x4e3d('0x3b')][_0x4e3d('0x2c')]?_0x49ba5b[_0x4e3d('0x3b')]:_0x4157e5[_0x4e3d('0x35')];if(!_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x3c')](_0x4e3d('0x3d'))){_0x49ba5b[_0x4e3d('0x3e')]=qs[_0x4e3d('0x3e')](_0x333fff['query'][_0x4e3d('0x3e')]);_0x49ba5b['offset']=qs[_0x4e3d('0x20')](_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x20')]);}_0x49ba5b[_0x4e3d('0x3f')]=qs[_0x4e3d('0x40')](_0x333fff[_0x4e3d('0x37')]['sort']);_0x49ba5b[_0x4e3d('0x41')]=qs[_0x4e3d('0x38')](_[_0x4e3d('0x42')](_0x333fff[_0x4e3d('0x37')],_0x4157e5[_0x4e3d('0x38')]),_0x255b1d);var _0x4e1b89=[];var _0x4fc35b=squel[_0x4e3d('0x43')]()[_0x4e3d('0x44')]('id')[_0x4e3d('0x44')]('name')[_0x4e3d('0x44')](_0x4e3d('0x45'))['from'](_0x4e3d('0x46'));var _0x5b6fe0=squel[_0x4e3d('0x43')]()[_0x4e3d('0x47')](_0x4e3d('0x48'),'c')['left_join'](_0x4e3d('0x49'),'uc','uc.CmContactId\x20=\x20c.id')[_0x4e3d('0x4a')](_0x4e3d('0x4b'),'ct',_0x4e3d('0x4c'))['left_join'](_0x4e3d('0x46'),'t',_0x4e3d('0x4d'))[_0x4e3d('0x41')](_0x4e3d('0x4e'));var _0x44926a=squel[_0x4e3d('0x4f')]();var _0xee533a=[];var _0xa3ff1f=squel[_0x4e3d('0x4f')]();var _0x454a6f;if(_0x333fff['query'][_0x4e3d('0x50')]){_0x454a6f=as[_0x4e3d('0x51')](_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x50')]);var _0x145ea8=_0x454a6f[_0x4e3d('0x52')];for(var _0x1cb9c=0x0;_0x1cb9c<_0x454a6f[_0x4e3d('0x53')][_0x4e3d('0x2c')];_0x1cb9c++){var _0x8b1cf=_0x454a6f[_0x4e3d('0x53')][_0x1cb9c];var _0x63bcae='c';var _0x4fba01=_(_0x255b1d)['keys']()[_0x4e3d('0x54')](function(_0x56b662){return _0x56b662===_0x8b1cf[_0x4e3d('0x44')];});if(_0x4fba01)_0x4fba01=_0x255b1d[_0x8b1cf[_0x4e3d('0x44')]];if(!_0x4fba01){if(_0x8b1cf[_0x4e3d('0x44')]===_0x4e3d('0x55')){var _0x403fa7=_0x8b1cf['value'][_0x4e3d('0x56')](',')[_0x4e3d('0x57')](function(_0x4c9b1d){return Number(_0x4c9b1d);});_0x403fa7['forEach'](function(_0x504eb6){_0xa3ff1f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x504eb6+',%');});_0xee533a=_[_0x4e3d('0x58')](_0xee533a,_0x403fa7);}else if(_0x8b1cf[_0x4e3d('0x44')]===_0x4e3d('0x59')){_0x44926a[_0x4e3d('0x5a')](_0x4e3d('0x5b'),_0x8b1cf[_0x4e3d('0x5c')]);}}else{if(_0x8b1cf[_0x4e3d('0x44')]==='dateOfBirth'||_0x4fba01[_0x4e3d('0x33')]===_0x4e3d('0x5d'))_0x8b1cf[_0x4e3d('0x5e')]=_0x4e3d('0x5f');var _0x4bf687=as[_0x4e3d('0x60')](_0x63bcae,_0x4fba01[_0x4e3d('0x34')],_0x8b1cf);_0x44926a[_0x145ea8](_0x4bf687[_0x4e3d('0x61')],_0x4bf687[_0x4e3d('0x5c')]['start'],_0x4bf687[_0x4e3d('0x5c')][_0x4e3d('0x1e')]);}}}else{var _0x16f081=_(Object['keys'](_0x333fff[_0x4e3d('0x37')]))[_0x4e3d('0x57')](function(_0x5bdb65){return _0x255b1d['hasOwnProperty'](_0x5bdb65)?_0x5bdb65:undefined;})[_0x4e3d('0x62')](function(_0x27505e){return!_[_0x4e3d('0x63')](_0x27505e);})[_0x4e3d('0x5c')]();if(_0x333fff[_0x4e3d('0x37')]['Contact'])_0x16f081['push'](_0x4e3d('0x64'));if(!_['isEmpty'](_0x16f081)){_0x16f081[_0x4e3d('0x65')](function(_0x2d5f70){if(_0x2d5f70==='ListId'){_0x5b6fe0[_0x4e3d('0x41')](_0x4e3d('0x66'),[]['concat'](_0x333fff[_0x4e3d('0x37')][_0x2d5f70]));}else if(_0x2d5f70==='Contact'){var _0x21358a='%'+_0x333fff[_0x4e3d('0x37')][_0x2d5f70]+'%';_0x5b6fe0[_0x4e3d('0x41')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x21358a);}else{_0x5b6fe0[_0x4e3d('0x41')]('c.'+_0x2d5f70+'\x20=\x20?',_0x333fff['query'][_0x2d5f70]);}});}if(_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x67')]){_0xee533a=_[_0x4e3d('0x68')](_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x67')])?_0x333fff['query'][_0x4e3d('0x67')]:new Array(_0x333fff['query']['tag']);_0xee533a['forEach'](function(_0x5b7d99){_0xa3ff1f['or'](_0x4e3d('0x69'),'%,'+_0x5b7d99+',%');});}if(_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x62')]){var _0x211591=_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x62')][_0x4e3d('0x6a')]('\x5c','\x5c\x5c')[_0x4e3d('0x6a')](/'/g,'\x27\x27');if(_0x211591[_0x4e3d('0x56')]('\x20')['length']>0x1){_0x44926a['or'](_0x4e3d('0x6b'),qs[_0x4e3d('0x6c')](_0x211591),null);}else{if(qs[_0x4e3d('0x6d')](_0x211591)){_0x44926a['or']('c.id\x20LIKE\x20?',_0x211591+'%');_0x44926a['or']('c.phone\x20LIKE\x20?',_0x211591+'%');_0x44926a['or'](_0x4e3d('0x6e'),_0x211591+'%');_0x44926a['or'](_0x4e3d('0x6f'),_0x211591+'%');}else if(qs[_0x4e3d('0x70')](_0x211591)){_0x44926a['or'](_0x4e3d('0x71'),_0x211591+'%');}else{_0x44926a['or'](_0x4e3d('0x72'),'%'+_0x211591+'%');_0x44926a['or'](_0x4e3d('0x73'),'%'+_0x211591+'%');_0x44926a['or'](_0x4e3d('0x71'),'%'+_0x211591+'%');}}}}_0x5b6fe0[_0x4e3d('0x41')](_0x44926a);_0x5b6fe0[_0x4e3d('0x74')](_0x4e3d('0x75'));var _0x45095f={'type':db['Sequelize'][_0x4e3d('0x76')][_0x4e3d('0x77')],'raw':!![]};var _0x3d069f=_0x5b6fe0['clone']()[_0x4e3d('0x44')](_0x4e3d('0x75'));if(_0x49ba5b[_0x4e3d('0x3f')]){_0x49ba5b[_0x4e3d('0x3f')][_0x4e3d('0x65')](function(_0x270f34){_0x5b6fe0['order']('c.'+_0x270f34[0x0],_0x270f34[0x1]===_0x4e3d('0x78')?![]:!![]);});}if(!_[_0x4e3d('0x79')](_0xee533a)){_0x5b6fe0['having'](_0xa3ff1f);_0x3d069f[_0x4e3d('0x41')](_0x4e3d('0x7a'),_0xee533a);}BPromise['resolve']()['then'](function(){if(!_0x454a6f)return;if(_0x333fff[_0x4e3d('0x7b')][_0x4e3d('0x7c')]!==_0x4e3d('0x7d'))return;if(!_['some'](_0x454a6f[_0x4e3d('0x53')],['field','User'])){return _0x333fff[_0x4e3d('0x7b')][_0x4e3d('0x7e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d914c){if(_[_0x4e3d('0x79')](_0x4d914c)){_0x3d069f[_0x4e3d('0x41')](_0x4e3d('0x7f'));_0x5b6fe0[_0x4e3d('0x41')](_0x4e3d('0x7f'));}else{_0x3d069f[_0x4e3d('0x41')](_0x4e3d('0x66'),_['map'](_0x4d914c,'id'));_0x5b6fe0[_0x4e3d('0x41')](_0x4e3d('0x66'),_[_0x4e3d('0x57')](_0x4d914c,'id'));}});}})[_0x4e3d('0x28')](function(){if(_0x333fff['user']['role']===_0x4e3d('0x7d')&&!_0x454a6f&&!_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x80')])return[];return db[_0x4e3d('0x81')][_0x4e3d('0x37')](_0x3d069f[_0x4e3d('0x82')](),_0x45095f);})[_0x4e3d('0x28')](function(_0x59cdd6){_0x1be6aa[_0x4e3d('0x22')]=_0x59cdd6[_0x4e3d('0x2c')];if(_0x1be6aa[_0x4e3d('0x22')]===0x0)return[];return db[_0x4e3d('0x81')][_0x4e3d('0x37')](_0x4fc35b[_0x4e3d('0x82')](),_0x45095f)[_0x4e3d('0x28')](function(_0x2e7d5c){_0x4e1b89=_[_0x4e3d('0x83')](_0x2e7d5c,'id');_0x45095f=_[_0x4e3d('0x84')](_0x45095f,{'model':db[_0x4e3d('0x85')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x333fff[_0x4e3d('0x37')][_0x4e3d('0x3a')]){_0x49ba5b[_0x4e3d('0x3b')]['forEach'](function(_0x209313){_0x5b6fe0[_0x4e3d('0x44')]('c.'+_0x209313);});}else{_0x5b6fe0[_0x4e3d('0x44')]('c.id');_0x5b6fe0[_0x4e3d('0x44')](_0x4e3d('0x86'));_0x5b6fe0[_0x4e3d('0x44')](_0x4e3d('0x87'));_0x5b6fe0[_0x4e3d('0x44')](_0x4e3d('0x88'));_0x5b6fe0[_0x4e3d('0x44')](_0x4e3d('0x89'));_0x5b6fe0[_0x4e3d('0x44')]('c.fax');_0x5b6fe0[_0x4e3d('0x44')](_0x4e3d('0x8a'));_0x5b6fe0[_0x4e3d('0x44')](_0x4e3d('0x8b'));_0x5b6fe0['field']('c.createdAt');_0x5b6fe0[_0x4e3d('0x44')](_0x4e3d('0x8c'));_0x5b6fe0[_0x4e3d('0x44')]('c.CompanyId');_0x5b6fe0[_0x4e3d('0x44')](_0x4e3d('0x8d'),'TagIds');}if(_0x49ba5b[_0x4e3d('0x3e')])_0x5b6fe0[_0x4e3d('0x3e')](_0x49ba5b[_0x4e3d('0x3e')]);if(_0x49ba5b[_0x4e3d('0x20')])_0x5b6fe0['offset'](_0x49ba5b['offset']);return db['sequelize'][_0x4e3d('0x37')](_0x5b6fe0['toString'](),_0x45095f);});})['then'](function(_0x4bb959){_0x4bb959[_0x4e3d('0x65')](function(_0x9aa22b){if(_0x9aa22b[_0x4e3d('0x8e')]){_0x9aa22b[_0x4e3d('0x8f')]=[];_0x9aa22b[_0x4e3d('0x8e')][_0x4e3d('0x56')](',')[_0x4e3d('0x65')](function(_0x37dac9){_0x9aa22b[_0x4e3d('0x8f')][_0x4e3d('0x2f')](_0x4e1b89[_0x37dac9]);});}delete _0x9aa22b['TagIds'];});_0x1be6aa[_0x4e3d('0x90')]=_0x4bb959;return _0x1be6aa;})[_0x4e3d('0x28')](respondWithFilteredResult(_0x36621d,_0x49ba5b));})[_0x4e3d('0x91')](handleError(_0x36621d,null));};exports[_0x4e3d('0x92')]=function(_0x282e03,_0x25fcf6){return db[_0x4e3d('0x85')][_0x4e3d('0x54')]({'where':{'id':_0x282e03['params']['id']}})[_0x4e3d('0x28')](handleEntityNotFound(_0x25fcf6,null))[_0x4e3d('0x28')](removeEntity(_0x25fcf6,null))[_0x4e3d('0x91')](handleError(_0x25fcf6,null));};exports[_0x4e3d('0x93')]=function(_0x4a5deb,_0x18975b){return db['CmContact'][_0x4e3d('0x93')]()[_0x4e3d('0x28')](function(_0x3a3ebc){delete _0x3a3ebc[_0x4e3d('0x94')];for(var _0xb3f80e=0x0;_0xb3f80e<Object[_0x4e3d('0x36')](_0x3a3ebc)[_0x4e3d('0x2c')];_0xb3f80e++){var _0x29e020=Object[_0x4e3d('0x36')](_0x3a3ebc)[_0xb3f80e];if(!_[_0x4e3d('0x2d')](_0x29e020,_0x4e3d('0x2e'))){_0x3a3ebc[_0x29e020][_0x4e3d('0x95')]=_0x29e020;_0x3a3ebc[_0x29e020][_0x4e3d('0x96')]=_0x29e020;}}return _0x3a3ebc;})[_0x4e3d('0x28')](function(_0x14f259){var _0x125691={'where':{'$or':[{'ListId':_0x4a5deb[_0x4e3d('0x37')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x4e3d('0x97')][_0x4e3d('0x98')](_0x125691)[_0x4e3d('0x28')](function(_0x21f4b1){for(var _0x1455cb=0x0;_0x1455cb<_0x21f4b1[_0x4e3d('0x2c')];_0x1455cb++){var _0x37990b=_0x4e3d('0x2e')+_0x21f4b1[_0x1455cb]['id'];_0x14f259[_0x37990b][_0x4e3d('0x95')]=_0x37990b;_0x14f259[_0x37990b][_0x4e3d('0x96')]=_0x21f4b1[_0x1455cb][_0x4e3d('0x99')];_0x14f259[_0x37990b]['custom']={'type':_0x21f4b1[_0x1455cb]['type'],'values':_0x21f4b1[_0x1455cb][_0x4e3d('0x9a')]};}Object[_0x4e3d('0x36')](_0x14f259)[_0x4e3d('0x65')](function(_0x3d9c0d){if(!_0x14f259[_0x3d9c0d][_0x4e3d('0x3c')](_0x4e3d('0x95'))){delete _0x14f259[_0x3d9c0d];}});return _0x14f259;});})[_0x4e3d('0x28')](respondWithResult(_0x18975b,null))[_0x4e3d('0x91')](handleError(_0x18975b,null));};exports[_0x4e3d('0x84')]=function(_0x22c90f,_0x30e260){var _0x1129ca;var _0x3a1ccb;var _0x5b8c49;if(_0x22c90f['body']['id']){delete _0x22c90f['body']['id'];}return db[_0x4e3d('0x85')][_0x4e3d('0x98')]({'where':{'id':[_0x22c90f['body']['to'],_0x22c90f['body'][_0x4e3d('0x47')]]}})[_0x4e3d('0x28')](function(_0x29d454){if(_0x29d454){if(_0x29d454[_0x4e3d('0x2c')]!==0x2){return null;}_0x29d454[0x0]=_0x29d454[0x0]['get']({'plain':!![]});_0x29d454[0x1]=_0x29d454[0x1]['get']({'plain':!![]});delete _0x29d454[0x0]['id'];delete _0x29d454[0x1]['id'];return _['mergeWith'](_0x29d454[0x0],_0x29d454[0x1],function(_0x102132,_0x29db4b){if(Array[_0x4e3d('0x68')](_0x29db4b)&&!_0x29db4b[_0x4e3d('0x2c')]){return _0x102132;}else if(!_0x29db4b){return _0x102132;}});}})['then'](handleEntityNotFound(_0x30e260,null))['then'](function(_0x1d1bf8){if(_0x1d1bf8){if(_0x1d1bf8['tags']&&_[_0x4e3d('0x68')](_0x1d1bf8['tags'])){_0x1d1bf8['tags']=_0x1d1bf8[_0x4e3d('0x94')]['join']();}logger[_0x4e3d('0x9b')](_0x4e3d('0x9c'),_0x22c90f[_0x4e3d('0x9d')]['to'],_0x22c90f[_0x4e3d('0x9d')][_0x4e3d('0x47')]);return db[_0x4e3d('0x9e')][_0x4e3d('0x92')]({'where':{'ContactId':[_0x22c90f[_0x4e3d('0x9d')]['to'],_0x22c90f['body'][_0x4e3d('0x47')]]}})['then'](function(_0x5e92fd){logger[_0x4e3d('0x9b')](_0x4e3d('0x9f'),_0x5e92fd);return db[_0x4e3d('0xa0')][_0x4e3d('0x92')]({'where':{'ContactId':[_0x22c90f[_0x4e3d('0x9d')]['to'],_0x22c90f['body'][_0x4e3d('0x47')]]}})[_0x4e3d('0x28')](function(_0x27a067){logger[_0x4e3d('0x9b')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x27a067);return db['CmContact'][_0x4e3d('0xa1')](_0x1d1bf8);});});}})[_0x4e3d('0x28')](function(_0x1a8472){if(_0x1a8472){_0x1129ca=_0x1a8472;_0x3a1ccb={'ContactId':_0x1129ca['id']};_0x5b8c49={'where':{'ContactId':[_0x22c90f[_0x4e3d('0x9d')]['to'],_0x22c90f[_0x4e3d('0x9d')][_0x4e3d('0x47')]]}};return db['ChatInteraction'][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xa2')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xa3')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xa4')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db['MailMessage']['update'](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xa4')]['update'](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db['MailMessage']['update'](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xa5')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})['then'](function(){if(_0x1129ca){return db[_0x4e3d('0xa6')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xa7')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xa8')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})['then'](function(){if(_0x1129ca){return db[_0x4e3d('0xa9')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xaa')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db['CmContactHasItem'][_0x4e3d('0x27')]({'CmContactId':_0x1129ca['id']},{'where':{'CmContactId':[_0x22c90f['body']['to'],_0x22c90f[_0x4e3d('0x9d')][_0x4e3d('0x47')]]}});}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db['CmHopperFinal'][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})['then'](function(){if(_0x1129ca){return db[_0x4e3d('0xab')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db['ReportAgentPreview'][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})['then'](function(){if(_0x1129ca){return db[_0x4e3d('0xac')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db['ChatQueueReport'][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xad')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})['then'](function(){if(_0x1129ca){return db[_0x4e3d('0xae')]['update'](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xaf')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xb0')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})['then'](function(){if(_0x1129ca){return db[_0x4e3d('0xb1')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xb2')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xb3')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0xb4')][_0x4e3d('0x27')](_0x3a1ccb,_0x5b8c49);}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return db[_0x4e3d('0x85')][_0x4e3d('0x92')]({'where':{'id':[_0x22c90f[_0x4e3d('0x9d')]['to'],_0x22c90f['body'][_0x4e3d('0x47')]]}});}})[_0x4e3d('0x28')](function(){if(_0x1129ca){return _0x1129ca;}})['then'](respondWithResult(_0x30e260,null))['catch'](handleError(_0x30e260,null));};exports[_0x4e3d('0xa1')]=function(_0x2aba0a,_0x8fa105){return db['CmContact'][_0x4e3d('0x93')]()[_0x4e3d('0x28')](function(_0x266f99){if(_0x2aba0a[_0x4e3d('0x9d')][_0x4e3d('0x94')]&&_[_0x4e3d('0x68')](_0x2aba0a['body'][_0x4e3d('0x94')])){if(_0x2aba0a[_0x4e3d('0x9d')]['tags'][_0x4e3d('0x2c')]){_0x2aba0a[_0x4e3d('0x9d')][_0x4e3d('0x94')]=_0x2aba0a['body'][_0x4e3d('0x94')]['join'](';')+';';}else{_0x2aba0a['body'][_0x4e3d('0x94')]=null;}}else{_0x2aba0a['body'][_0x4e3d('0x94')]=null;}return db[_0x4e3d('0x85')]['create'](_0x2aba0a['body'],{'fields':_[_0x4e3d('0x36')](_0x266f99),'raw':!![]});})[_0x4e3d('0x28')](function(_0x2e8ef7){if(_0x2aba0a['body'][_0x4e3d('0xb5')]){return insertAdditionalPhones(_0x2e8ef7,_0x2aba0a[_0x4e3d('0x9d')][_0x4e3d('0xb5')]);}else{return _0x2e8ef7;}})['then'](respondWithResult(_0x8fa105,0xc9))[_0x4e3d('0x91')](handleError(_0x8fa105,null));};exports['bulkCreate']=function(_0x1e79ad,_0x14db21){var _0x177d59=[];var _0x12fe73=0x0;var _0x1d72ec=0x0;var _0x24efce=0x0;var _0x19851c=[];return db[_0x4e3d('0x85')][_0x4e3d('0x93')]()[_0x4e3d('0x28')](function(_0x8e778f){return BPromise[_0x4e3d('0xb6')](_0x1e79ad[_0x4e3d('0x9d')],function(_0x17bd98){var _0x5960c7={'where':{'$or':[]},'defaults':_0x17bd98,'fields':_[_0x4e3d('0x36')](_0x8e778f),'raw':!![]};if(_0x17bd98[_0x4e3d('0xb7')]){for(var _0x4a8ce8=0x0;_0x4a8ce8<_0x17bd98[_0x4e3d('0xb7')][_0x4e3d('0x2c')];_0x4a8ce8++){var _0x2166c8={};_0x2166c8[_0x17bd98['duplicates'][_0x4a8ce8]]=_0x17bd98[_0x17bd98[_0x4e3d('0xb7')][_0x4a8ce8]];_0x5960c7[_0x4e3d('0x41')][_0x4e3d('0xb8')][_0x4e3d('0x2f')](_0x2166c8);}_0x5960c7[_0x4e3d('0x41')][_0x4e3d('0x80')]=_0x17bd98[_0x4e3d('0x80')];}return db[_0x4e3d('0x85')][_0x4e3d('0xb9')](_0x5960c7)[_0x4e3d('0xba')](function(_0x5b4692,_0x20ef4a){if(_0x20ef4a){if(_0x17bd98[_0x4e3d('0x3c')](_0x4e3d('0xb5'))){_0x19851c[_0x4e3d('0x2f')]({'contact':_0x5b4692,'additionalPhones':_0x17bd98[_0x4e3d('0xb5')]});}_0x12fe73++;}else{_0x24efce++;}})['catch'](function(_0xf3317f){console['error'](_0xf3317f);_0x1d72ec++;});});})['then'](function(_0x489070){if(_0x489070){if(_0x19851c[_0x4e3d('0x2c')]>0x0){return new Promise(function(_0x115418,_0x21f929){var _0x8ee723=[];for(var _0x2b00da=0x0;_0x2b00da<_0x19851c[_0x4e3d('0x2c')];_0x2b00da++){_0x8ee723['push'](insertAdditionalPhones(_0x19851c[_0x2b00da][_0x4e3d('0xbb')],_0x19851c[_0x2b00da][_0x4e3d('0xb5')]));}Promise['all'](_0x8ee723)['then'](function(){_0x115418(0x1);});})['then'](function(){return{'success':_0x12fe73,'failure':_0x1d72ec,'duplicates':_0x24efce};});}else{return{'success':_0x12fe73,'failure':_0x1d72ec,'duplicates':_0x24efce};}}})[_0x4e3d('0x28')](respondWithResult(_0x14db21,0xc9))['catch'](handleError(_0x14db21,null));};exports[_0x4e3d('0xbc')]=function(_0x50217f,_0xed0e42,_0x2902ca){var _0x32df8;return db[_0x4e3d('0x85')][_0x4e3d('0x93')]()[_0x4e3d('0x28')](function(_0x2cf647){return db[_0x4e3d('0x85')]['find']({'where':{'id':_0x50217f[_0x4e3d('0xbd')]['id']},'include':[{'model':db['Tag'],'as':_0x4e3d('0x8f'),'attributes':['id','name','color'],'required':_0x50217f[_0x4e3d('0x37')][_0x4e3d('0x67')]?!![]:![]},{'model':db[_0x4e3d('0xbe')],'as':_0x4e3d('0xbf'),'where':{'CmContactId':_0x50217f[_0x4e3d('0xbd')]['id']},'required':![],'include':[{'model':db[_0x4e3d('0xc0')],'as':_0x4e3d('0xc1')}]}],'order':[db[_0x4e3d('0x81')][_0x4e3d('0xc2')](_0x4e3d('0xc3'))],'logging':console[_0x4e3d('0xc4')],'attributes':_['keys'](_0x2cf647)});})[_0x4e3d('0x28')](function(_0x40083f){_0x32df8=_0x40083f['get']({'plain':!![]});var _0x56513b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x40083f&&_0x40083f[_0x4e3d('0x80')]){if(_0x40083f[_0x4e3d('0x80')]){_0x56513b[_0x4e3d('0x41')][_0x4e3d('0xc5')]['push']({'ListId':{'$ne':_0x40083f[_0x4e3d('0x80')]}});}}return db[_0x4e3d('0x97')][_0x4e3d('0x98')](_0x56513b);})[_0x4e3d('0x28')](function(_0x5e93ea){return _['omit'](_0x32df8,_[_0x4e3d('0x57')](_0x5e93ea,function(_0x15e32c){return util[_0x4e3d('0xc6')](_0x4e3d('0xc7'),_0x15e32c['id']);}));})['then'](handleEntityNotFound(_0xed0e42,null))[_0x4e3d('0x28')](respondWithResult(_0xed0e42,null))[_0x4e3d('0x91')](handleError(_0xed0e42,null));};exports[_0x4e3d('0x27')]=function(_0x5224bd,_0x3ba69c){var _0x449321;if(_0x5224bd['body']['id']){delete _0x5224bd['body']['id'];}return db[_0x4e3d('0x85')][_0x4e3d('0x54')]({'where':{'id':_0x5224bd['params']['id']}})[_0x4e3d('0x28')](handleEntityNotFound(_0x3ba69c,null))[_0x4e3d('0x28')](saveUpdates(_0x5224bd[_0x4e3d('0x9d')],null))[_0x4e3d('0x28')](function(_0x326ac2){_0x449321=_0x326ac2;var _0x194bb2={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x326ac2&&_0x326ac2[_0x4e3d('0x80')]){if(_0x326ac2[_0x4e3d('0x80')]){_0x194bb2[_0x4e3d('0x41')]['$and'][_0x4e3d('0x2f')]({'ListId':{'$ne':_0x326ac2[_0x4e3d('0x80')]}});}}return db[_0x4e3d('0x97')][_0x4e3d('0x98')](_0x194bb2);})[_0x4e3d('0x28')](function(_0x47f4f8){if(_0x47f4f8){return _['omit'](_[_0x4e3d('0xc8')](_0x5224bd[_0x4e3d('0x9d')],function(_0x184b36,_0x466cf3){return _[_0x4e3d('0x2d')](_0x466cf3,_0x4e3d('0x2e'));}),_[_0x4e3d('0x57')](_0x47f4f8,function(_0x6f5f6e){return util[_0x4e3d('0xc6')](_0x4e3d('0xc7'),_0x6f5f6e['id']);}));}})[_0x4e3d('0x28')](function(_0x122cbe){if(_0x122cbe&&!_['isEmpty'](_0x122cbe)){var _0x4a9def=squel[_0x4e3d('0x27')]()['table'](_0x4e3d('0x48'))[_0x4e3d('0xc9')](_0x122cbe)[_0x4e3d('0x41')](_0x4e3d('0xca'),_0x5224bd[_0x4e3d('0xbd')]['id'])[_0x4e3d('0xcb')]();return db[_0x4e3d('0x81')][_0x4e3d('0x37')](_0x4a9def['text'],{'replacements':_0x4a9def[_0x4e3d('0x9a')]});}})[_0x4e3d('0x28')](function(){if(_0x5224bd['body']['phone']&&_0x449321){return db[_0x4e3d('0x9e')][_0x4e3d('0x27')]({'phone':_0x5224bd[_0x4e3d('0x9d')][_0x4e3d('0xcc')]},{'where':{'ContactId':_0x449321['id']}});}})[_0x4e3d('0x28')](function(){return _0x449321;})[_0x4e3d('0x28')](respondWithResult(_0x3ba69c,null))['catch'](handleError(_0x3ba69c,null));};exports[_0x4e3d('0xcd')]=function(_0x1b108f,_0x85b2c1,_0x4a10ae){var _0x21c995={};var _0x57ddab={};var _0x131043;var _0x558320;return db[_0x4e3d('0x85')]['findOne']({'where':{'id':_0x1b108f[_0x4e3d('0xbd')]['id']}})['then'](handleEntityNotFound(_0x85b2c1,null))[_0x4e3d('0x28')](function(_0x1e2cad){if(_0x1e2cad){_0x131043=_0x1e2cad;_0x57ddab[_0x4e3d('0x35')]=_[_0x4e3d('0x36')](db[_0x4e3d('0x55')][_0x4e3d('0xce')]);_0x57ddab[_0x4e3d('0x37')]=_[_0x4e3d('0x36')](_0x1b108f[_0x4e3d('0x37')]);_0x57ddab['filters']=_['intersection'](_0x57ddab['model'],_0x57ddab[_0x4e3d('0x37')]);_0x21c995['attributes']=_[_0x4e3d('0x39')](_0x57ddab[_0x4e3d('0x35')],qs[_0x4e3d('0x3a')](_0x1b108f[_0x4e3d('0x37')][_0x4e3d('0x3a')]));_0x21c995[_0x4e3d('0x3b')]=_0x21c995[_0x4e3d('0x3b')][_0x4e3d('0x2c')]?_0x21c995[_0x4e3d('0x3b')]:_0x57ddab[_0x4e3d('0x35')];_0x21c995[_0x4e3d('0x3f')]=qs[_0x4e3d('0x40')](_0x1b108f[_0x4e3d('0x37')][_0x4e3d('0x40')]);_0x21c995['where']=qs['filters'](_[_0x4e3d('0x42')](_0x1b108f[_0x4e3d('0x37')],_0x57ddab[_0x4e3d('0x38')]));if(_0x1b108f['query'][_0x4e3d('0x62')]){_0x21c995[_0x4e3d('0x41')]=_[_0x4e3d('0x84')](_0x21c995[_0x4e3d('0x41')],{'$or':_[_0x4e3d('0x57')](_0x21c995[_0x4e3d('0x3b')],function(_0x470489){var _0x5a5808={};_0x5a5808[_0x470489]={'$like':'%'+_0x1b108f[_0x4e3d('0x37')][_0x4e3d('0x62')]+'%'};return _0x5a5808;})});}_0x21c995=_['merge']({},_0x21c995,_0x1b108f[_0x4e3d('0xcf')]);return _0x131043['getTags'](_0x21c995);}})['then'](function(_0x5526fc){if(_0x5526fc){_0x558320=_0x5526fc[_0x4e3d('0x2c')];if(!_0x1b108f[_0x4e3d('0x37')]['hasOwnProperty'](_0x4e3d('0x3d'))){_0x21c995[_0x4e3d('0x3e')]=qs[_0x4e3d('0x3e')](_0x1b108f[_0x4e3d('0x37')][_0x4e3d('0x3e')]);_0x21c995[_0x4e3d('0x20')]=qs[_0x4e3d('0x20')](_0x1b108f[_0x4e3d('0x37')][_0x4e3d('0x20')]);}return _0x131043['getTags'](_0x21c995);}})[_0x4e3d('0x28')](function(_0x1ccc33){if(_0x1ccc33){return _0x1ccc33?{'count':_0x558320,'rows':_0x1ccc33}:null;}})[_0x4e3d('0x28')](respondWithResult(_0x85b2c1,null))[_0x4e3d('0x91')](handleError(_0x85b2c1,null));};exports[_0x4e3d('0xd0')]=function(_0x4b274e,_0x177b64,_0x4f8a81){if(_0x4b274e[_0x4e3d('0x9d')]['id']){delete _0x4b274e[_0x4e3d('0x9d')]['id'];}return db[_0x4e3d('0x85')]['findOne']({'where':{'id':_0x4b274e[_0x4e3d('0xbd')]['id']}})[_0x4e3d('0x28')](handleEntityNotFound(_0x177b64,null))[_0x4e3d('0x28')](function(_0x5bc8bf){if(_0x5bc8bf){return _0x5bc8bf['setTags'](_0x4b274e[_0x4e3d('0x9d')][_0x4e3d('0xd1')]||[]);}return null;})[_0x4e3d('0x28')](respondWithResult(_0x177b64,null))['catch'](handleError(_0x177b64,null));};exports[_0x4e3d('0xd2')]=function(_0x2990f5,_0x285982){var _0x5dd6df=[];_0x5dd6df['push'](addAdditionalPhones(_0x2990f5['body']));Promise[_0x4e3d('0x32')](_0x5dd6df)[_0x4e3d('0x28')](function(){_0x5dd6df=[];_0x5dd6df[_0x4e3d('0x2f')](deleteCmHopperPhones(_0x2990f5[_0x4e3d('0x9d')]['id']));_0x5dd6df[_0x4e3d('0x2f')](addCmHopperPhones(_0x2990f5[_0x4e3d('0x9d')]['id']));Promise[_0x4e3d('0x32')](_0x5dd6df)[_0x4e3d('0x28')](function(){return[0x1];})[_0x4e3d('0x28')](respondWithResult(_0x285982,null));});};function addAdditionalPhones(_0x57402c){var _0x58195a;return new Promise(function(_0x4fb601,_0x2e7b4a){return db[_0x4e3d('0xbe')][_0x4e3d('0x92')]({'where':{'CmContactId':_0x57402c['id']}})[_0x4e3d('0x28')](function(){var _0x56a0d0=[];for(var _0x34d1e8=0x0;_0x34d1e8<_0x57402c['items']['length'];_0x34d1e8++){var _0xb3be28=_0x57402c['item_types']?_[_0x4e3d('0x63')](_0x57402c[_0x4e3d('0xd3')][_0x34d1e8])?'':_0x57402c[_0x4e3d('0xd3')][_0x34d1e8]:_0x57402c[_0x4e3d('0xd4')][_0x34d1e8][_0x4e3d('0xd5')]?_0x57402c[_0x4e3d('0xd4')][_0x34d1e8][_0x4e3d('0xd5')]:'';var _0xad84f9=_[_0x4e3d('0x63')](_0x57402c['items'][_0x34d1e8][_0x4e3d('0xd6')])?'':_0x57402c[_0x4e3d('0xd4')][_0x34d1e8][_0x4e3d('0xd6')];var _0x48754d=_0xb3be28+':'+_0x57402c[_0x4e3d('0xd4')][_0x34d1e8][_0x4e3d('0xcc')]+'§'+_0xad84f9;if(_['isNil'](_0x58195a))_0x58195a=_0x48754d;else _0x58195a+=';'+_0x48754d;_0x56a0d0['push'](addAdditionalPhone(_0x57402c['id'],_0x57402c[_0x4e3d('0xd4')][_0x34d1e8]['phone'],_0x57402c[_0x4e3d('0xd3')]?_[_0x4e3d('0x63')](_0x57402c[_0x4e3d('0xd3')][_0x34d1e8])?null:_0x57402c[_0x4e3d('0xd3')][_0x34d1e8]:_0x57402c[_0x4e3d('0xd4')][_0x34d1e8]['ItemTypeId']?_0x57402c[_0x4e3d('0xd4')][_0x34d1e8][_0x4e3d('0xd5')]:null,_0x34d1e8,_0xad84f9));}Promise['all'](_0x56a0d0)[_0x4e3d('0x28')](function(){db[_0x4e3d('0x85')][_0x4e3d('0x27')]({'AdditionalPhones':_0x58195a},{'where':{'id':_0x57402c['id']}})[_0x4e3d('0x28')](function(){_0x4fb601(0x1);});});});});}function addAdditionalPhone(_0xf2afa7,_0x5752a6,_0x47b520,_0x5bd426,_0x200178){return db[_0x4e3d('0xbe')][_0x4e3d('0x54')]({'where':{'CmContactId':_0xf2afa7,'item':_0x5752a6}})[_0x4e3d('0x28')](function(_0x55a3e7){if(_0x55a3e7)logger[_0x4e3d('0x9b')]('contact\x20phone\x20exists',_0x55a3e7);else{db['CmContactHasItem'][_0x4e3d('0xa1')]({'CmContactId':_0xf2afa7,'item':_0x5752a6,'ItemTypeId':_0x47b520,'OrderBy':_0x5bd426,'ItemClass':_0x4e3d('0xd7'),'description':_0x200178});}});}function deletePhones(_0x3cf87d){return db[_0x4e3d('0xbe')][_0x4e3d('0x92')]({'where':{'CmContactId':_0x3cf87d}});}function deleteCmHopperPhones(_0x2aeaa2){return new Promise(function(_0x1c9c48,_0x5467f0){return db[_0x4e3d('0x9e')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2aeaa2}})[_0x4e3d('0x28')](function(_0x4f764f){db['CmHopperAdditionalPhone'][_0x4e3d('0x92')]({'where':{'CmHopperId':{'$in':_[_0x4e3d('0x57')](_0x4f764f,'id')}}});})['then'](function(){_0x1c9c48(0x1);});});}function addCmHopperPhones(_0x173dc2){return new Promise(function(_0x3775c9,_0x298086){return db[_0x4e3d('0x9e')][_0x4e3d('0x98')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x173dc2}})[_0x4e3d('0x28')](function(_0x5016b7){var _0x4d6c1a=[];_[_0x4e3d('0x57')](_0x5016b7,function(_0x54c2c9){_0x4d6c1a[_0x4e3d('0x2f')](createCmHopperPhone(_0x173dc2,_0x54c2c9['id']));});Promise[_0x4e3d('0x32')](_0x4d6c1a)['then'](function(){_0x3775c9(0x1);});});});}function createCmHopperPhone(_0x58c218,_0x171ce8){return new Promise(function(_0x38e2fc,_0x50867e){db[_0x4e3d('0xbe')][_0x4e3d('0x98')]({'raw':!![],'attributes':['item'],'where':{'CmContactId':_0x58c218,'ItemClass':_0x4e3d('0xd7')},'include':[{'model':db[_0x4e3d('0xc0')],'attributes':[_0x4e3d('0xd8')],'as':'ItemType'}],'order':[db[_0x4e3d('0x81')][_0x4e3d('0xc2')]('`ItemType`.OrderBy')]})[_0x4e3d('0x28')](function(_0x52372b){var _0x107747=0x1;var _0x3d4c19=_[_0x4e3d('0x57')](_0x52372b,function(_0x423f93){_0x423f93[_0x4e3d('0xd9')]=_0x171ce8;_0x423f93[_0x4e3d('0xcc')]=_0x423f93['item'];_0x423f93[_0x4e3d('0xd8')]=_0x423f93[_0x4e3d('0xda')]||_0x107747;delete _0x423f93['ItemType.OrderBy'];_0x107747=_0x107747+0x1;return _0x423f93;});return db[_0x4e3d('0xdb')][_0x4e3d('0xdc')](_0x3d4c19,{});})[_0x4e3d('0x28')](function(){_0x38e2fc(0x1);});});}function insertAdditionalPhones(_0x402ed2,_0x463933){return new Promise(function(_0x18adf6,_0x4ada6b){var _0x31a948=[];for(var _0x1059fc=0x0;_0x1059fc<_0x463933[_0x4e3d('0x2c')];_0x1059fc++){var _0x46f622=_0x463933[_0x1059fc];_0x31a948['push'](parseContactItemType(_0x46f622));}Promise['all'](_0x31a948)[_0x4e3d('0x28')](function(){var _0x5a86d8={'id':_0x402ed2['id'],'items':_0x463933};return addAdditionalPhones(_0x5a86d8)['then'](function(_0x50f463){return addCmHopperPhones(_0x402ed2['id']);});})[_0x4e3d('0x28')](function(){_0x18adf6(_0x402ed2);});});}function parseContactItemType(_0x365e2f){return new Promise(function(_0x4021c6,_0x119302){if(_0x365e2f['hasOwnProperty'](_0x4e3d('0xd5'))){_0x4021c6(_0x365e2f);}else{return db[_0x4e3d('0xc0')][_0x4e3d('0x54')]({'where':{'name':_0x365e2f[_0x4e3d('0xc1')]}})['then'](function(_0x288ca8){if(_['isNil'](_0x288ca8))_0x365e2f[_0x4e3d('0xd5')]=null;else _0x365e2f[_0x4e3d('0xd5')]=_0x288ca8['id'];_0x4021c6(_0x365e2f);});}});}exports[_0x4e3d('0xdd')]=function(_0x42bdd4,_0x1fb73e){return db[_0x4e3d('0xbe')]['findAll']({'raw':!![],'where':{'CmContactId':_0x42bdd4[_0x4e3d('0xbd')]['id'],'ItemClass':_0x4e3d('0xd7')},'include':[{'model':db[_0x4e3d('0xc0')],'as':_0x4e3d('0xc1')}],'order':[[db[_0x4e3d('0x81')][_0x4e3d('0xc2')](_0x4e3d('0xde'))],[_0x4e3d('0xd8')]]})[_0x4e3d('0x28')](function(_0x348cf3){return _0x348cf3;})['then'](respondWithResult(_0x1fb73e,null))['catch'](handleError(_0x1fb73e,null));};exports[_0x4e3d('0xdf')]=function(_0x30e59d,_0x4d7f1a){return db[_0x4e3d('0xbe')]['findAll']({'raw':!![],'where':{'CmContactId':_0x30e59d[_0x4e3d('0x9d')][_0x4e3d('0xe0')]}})['then'](function(_0x17f6ab){var _0x3a2be7=_[_0x4e3d('0x57')](_0x17f6ab,function(_0x3fd259){_0x3fd259[_0x4e3d('0xe1')]=_0x30e59d[_0x4e3d('0x9d')][_0x4e3d('0xe2')];return _0x3fd259;});return db['CmContactHasItem']['bulkCreate'](_0x3a2be7,{});})[_0x4e3d('0x28')](function(_0x5abc54){return addCmHopperPhones(_0x30e59d[_0x4e3d('0x9d')][_0x4e3d('0xe2')]);})['then'](function(_0x65866a){return['ok'];})[_0x4e3d('0x28')](respondWithResult(_0x4d7f1a,null))[_0x4e3d('0x91')](handleError(_0x4d7f1a,null));};exports['rescheduleAdditionalPhones']=function(_0x2ded40,_0x42ae40){var _0x495986=[];_0x495986[_0x4e3d('0x2f')](createCmHopperPhone(_0x2ded40['body']['id'],_0x2ded40['body'][_0x4e3d('0xe3')]));Promise['all'](_0x495986)['then'](function(){return[0x1];})[_0x4e3d('0x28')](respondWithResult(_0x42ae40,null));};exports[_0x4e3d('0xe4')]=function(_0x3fce2,_0x514ab0,_0x37822e){var _0x4dc450={'raw':![],'where':{}};var _0x5f0eed={};var _0x4b1e19={'count':0x0,'rows':[]};return db['CmContact'][_0x4e3d('0x30')]({'where':{'id':_0x3fce2[_0x4e3d('0xbd')]['id']}})['then'](handleEntityNotFound(_0x514ab0,null))['then'](function(_0x34d949){if(_0x34d949){_0x5f0eed[_0x4e3d('0x35')]=_[_0x4e3d('0x36')](db[_0x4e3d('0x9e')][_0x4e3d('0xce')]);_0x5f0eed[_0x4e3d('0x37')]=_[_0x4e3d('0x36')](_0x3fce2[_0x4e3d('0x37')]);_0x5f0eed[_0x4e3d('0x38')]=_['intersection'](_0x5f0eed[_0x4e3d('0x35')],_0x5f0eed[_0x4e3d('0x37')]);_0x4dc450[_0x4e3d('0x3b')]=_[_0x4e3d('0x39')](_0x5f0eed[_0x4e3d('0x35')],qs[_0x4e3d('0x3a')](_0x3fce2['query'][_0x4e3d('0x3a')]));_0x4dc450[_0x4e3d('0x3b')]=_0x4dc450[_0x4e3d('0x3b')][_0x4e3d('0x2c')]?_0x4dc450[_0x4e3d('0x3b')]:_0x5f0eed[_0x4e3d('0x35')];if(!_0x3fce2[_0x4e3d('0x37')][_0x4e3d('0x3c')](_0x4e3d('0x3d'))){_0x4dc450['limit']=qs[_0x4e3d('0x3e')](_0x3fce2[_0x4e3d('0x37')][_0x4e3d('0x3e')]);_0x4dc450[_0x4e3d('0x20')]=qs[_0x4e3d('0x20')](_0x3fce2[_0x4e3d('0x37')]['offset']);}_0x4dc450[_0x4e3d('0x3f')]=qs[_0x4e3d('0x40')](_0x3fce2['query'][_0x4e3d('0x40')]);_0x4dc450[_0x4e3d('0x41')]=qs[_0x4e3d('0x38')](_[_0x4e3d('0x42')](_0x3fce2[_0x4e3d('0x37')],_0x5f0eed['filters']));_0x4dc450[_0x4e3d('0x41')][_0x4e3d('0xe5')]=_0x34d949['id'];if(_0x3fce2['query'][_0x4e3d('0x62')]){_0x4dc450[_0x4e3d('0x41')]=_[_0x4e3d('0x84')](_0x4dc450[_0x4e3d('0x41')],{'$or':_[_0x4e3d('0x57')](_0x4dc450[_0x4e3d('0x3b')],function(_0x19b305){var _0x5465ac={};_0x5465ac[_0x19b305]={'$like':'%'+_0x3fce2[_0x4e3d('0x37')][_0x4e3d('0x62')]+'%'};return _0x5465ac;})});}_0x4dc450=_['merge']({},_0x4dc450,_0x3fce2[_0x4e3d('0xcf')]);return db['CmHopper'][_0x4e3d('0x22')]({'where':_0x4dc450[_0x4e3d('0x41')]})[_0x4e3d('0x28')](function(_0x2318d3){_0x4b1e19[_0x4e3d('0x22')]=_0x2318d3;if(_0x3fce2[_0x4e3d('0x37')][_0x4e3d('0xe6')]){_0x4dc450[_0x4e3d('0xe7')]=[{'all':!![]}];}return db[_0x4e3d('0x9e')][_0x4e3d('0x98')](_0x4dc450);})['then'](function(_0x4c9b00){_0x4b1e19[_0x4e3d('0x90')]=_0x4c9b00;return _0x4b1e19;});}})[_0x4e3d('0x28')](respondWithFilteredResult(_0x514ab0,_0x4dc450))['catch'](handleError(_0x514ab0,null));};exports[_0x4e3d('0xe8')]=function(_0x4ad5e9,_0x540554,_0x494a18){var _0x4b1db2={'raw':!![],'where':{}};var _0x4bb6ba={};var _0x4c69c1={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x4ad5e9[_0x4e3d('0xbd')]['id']}})['then'](handleEntityNotFound(_0x540554,null))[_0x4e3d('0x28')](function(_0x1d6cee){if(_0x1d6cee){_0x4bb6ba[_0x4e3d('0x35')]=_[_0x4e3d('0x36')](db[_0x4e3d('0xab')][_0x4e3d('0xce')]);_0x4bb6ba['query']=_[_0x4e3d('0x36')](_0x4ad5e9[_0x4e3d('0x37')]);_0x4bb6ba[_0x4e3d('0x38')]=_['intersection'](_0x4bb6ba['model'],_0x4bb6ba[_0x4e3d('0x37')]);_0x4b1db2[_0x4e3d('0x3b')]=_[_0x4e3d('0x39')](_0x4bb6ba[_0x4e3d('0x35')],qs[_0x4e3d('0x3a')](_0x4ad5e9[_0x4e3d('0x37')]['fields']));_0x4b1db2['attributes']=_0x4b1db2['attributes'][_0x4e3d('0x2c')]?_0x4b1db2['attributes']:_0x4bb6ba[_0x4e3d('0x35')];if(!_0x4ad5e9[_0x4e3d('0x37')][_0x4e3d('0x3c')](_0x4e3d('0x3d'))){_0x4b1db2[_0x4e3d('0x3e')]=qs[_0x4e3d('0x3e')](_0x4ad5e9[_0x4e3d('0x37')]['limit']);_0x4b1db2[_0x4e3d('0x20')]=qs[_0x4e3d('0x20')](_0x4ad5e9[_0x4e3d('0x37')][_0x4e3d('0x20')]);}_0x4b1db2[_0x4e3d('0x3f')]=qs[_0x4e3d('0x40')](_0x4ad5e9[_0x4e3d('0x37')][_0x4e3d('0x40')]);_0x4b1db2[_0x4e3d('0x41')]=qs[_0x4e3d('0x38')](_[_0x4e3d('0x42')](_0x4ad5e9[_0x4e3d('0x37')],_0x4bb6ba['filters']));_0x4b1db2[_0x4e3d('0x41')][_0x4e3d('0xe5')]=_0x1d6cee['id'];if(_0x4ad5e9[_0x4e3d('0x37')]['filter']){_0x4b1db2['where']=_[_0x4e3d('0x84')](_0x4b1db2['where'],{'$or':_[_0x4e3d('0x57')](_0x4b1db2[_0x4e3d('0x3b')],function(_0x3b21aa){var _0x4b2e66={};_0x4b2e66[_0x3b21aa]={'$like':'%'+_0x4ad5e9[_0x4e3d('0x37')]['filter']+'%'};return _0x4b2e66;})});}_0x4b1db2=_[_0x4e3d('0x84')]({},_0x4b1db2,_0x4ad5e9[_0x4e3d('0xcf')]);return db[_0x4e3d('0xab')][_0x4e3d('0x22')]({'where':_0x4b1db2[_0x4e3d('0x41')]})['then'](function(_0x4d2c38){_0x4c69c1[_0x4e3d('0x22')]=_0x4d2c38;if(_0x4ad5e9['query'][_0x4e3d('0xe6')]){_0x4b1db2[_0x4e3d('0xe7')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4e3d('0x98')](_0x4b1db2);})['then'](function(_0x19d773){_0x4c69c1['rows']=_0x19d773;return _0x4c69c1;});}})[_0x4e3d('0x28')](respondWithFilteredResult(_0x540554,_0x4b1db2))[_0x4e3d('0x91')](handleError(_0x540554,null));};exports[_0x4e3d('0xe9')]=function(_0x3d8e0e,_0x193c7f,_0x2844c9){var _0x29e3f1={'raw':!![],'where':{}};var _0x4d5b0f={};var _0x5bc838={'count':0x0,'rows':[]};return db[_0x4e3d('0x85')][_0x4e3d('0x30')]({'where':{'id':_0x3d8e0e['params']['id']}})[_0x4e3d('0x28')](handleEntityNotFound(_0x193c7f,null))['then'](function(_0x16752c){if(_0x16752c){_0x4d5b0f[_0x4e3d('0x35')]=_[_0x4e3d('0x36')](db['CmHopperFinal']['rawAttributes']);_0x4d5b0f[_0x4e3d('0x37')]=_[_0x4e3d('0x36')](_0x3d8e0e['query']);_0x4d5b0f[_0x4e3d('0x38')]=_[_0x4e3d('0x39')](_0x4d5b0f[_0x4e3d('0x35')],_0x4d5b0f[_0x4e3d('0x37')]);_0x29e3f1['attributes']=_[_0x4e3d('0x39')](_0x4d5b0f['model'],qs[_0x4e3d('0x3a')](_0x3d8e0e[_0x4e3d('0x37')]['fields']));_0x29e3f1['attributes']=_0x29e3f1['attributes'][_0x4e3d('0x2c')]?_0x29e3f1['attributes']:_0x4d5b0f[_0x4e3d('0x35')];if(!_0x3d8e0e['query'][_0x4e3d('0x3c')](_0x4e3d('0x3d'))){_0x29e3f1[_0x4e3d('0x3e')]=qs[_0x4e3d('0x3e')](_0x3d8e0e[_0x4e3d('0x37')][_0x4e3d('0x3e')]);_0x29e3f1[_0x4e3d('0x20')]=qs[_0x4e3d('0x20')](_0x3d8e0e['query'][_0x4e3d('0x20')]);}_0x29e3f1[_0x4e3d('0x3f')]=qs[_0x4e3d('0x40')](_0x3d8e0e['query'][_0x4e3d('0x40')]);_0x29e3f1[_0x4e3d('0x41')]=qs[_0x4e3d('0x38')](_[_0x4e3d('0x42')](_0x3d8e0e[_0x4e3d('0x37')],_0x4d5b0f[_0x4e3d('0x38')]));_0x29e3f1['where'][_0x4e3d('0xe5')]=_0x16752c['id'];if(_0x3d8e0e[_0x4e3d('0x37')][_0x4e3d('0x62')]){_0x29e3f1[_0x4e3d('0x41')]=_['merge'](_0x29e3f1[_0x4e3d('0x41')],{'$or':_[_0x4e3d('0x57')](_0x29e3f1[_0x4e3d('0x3b')],function(_0x1003d1){var _0x2ebf00={};_0x2ebf00[_0x1003d1]={'$like':'%'+_0x3d8e0e[_0x4e3d('0x37')]['filter']+'%'};return _0x2ebf00;})});}_0x29e3f1=_['merge']({},_0x29e3f1,_0x3d8e0e[_0x4e3d('0xcf')]);return db[_0x4e3d('0xea')][_0x4e3d('0x22')]({'where':_0x29e3f1['where']})[_0x4e3d('0x28')](function(_0x4d9b36){_0x5bc838[_0x4e3d('0x22')]=_0x4d9b36;if(_0x3d8e0e[_0x4e3d('0x37')][_0x4e3d('0xe6')]){_0x29e3f1[_0x4e3d('0xe7')]=[{'all':!![]}];}return db[_0x4e3d('0xea')]['findAll'](_0x29e3f1);})[_0x4e3d('0x28')](function(_0x5dcf90){_0x5bc838[_0x4e3d('0x90')]=_0x5dcf90;return _0x5bc838;});}})[_0x4e3d('0x28')](respondWithFilteredResult(_0x193c7f,_0x29e3f1))[_0x4e3d('0x91')](handleError(_0x193c7f,null));};exports[_0x4e3d('0xeb')]=function(_0x5ccabb,_0x3beddb,_0x5ce43e){var _0x2d8f18={'raw':!![],'where':{}};var _0x4a505e={};var _0x453b18={'count':0x0,'rows':[]};return db[_0x4e3d('0x85')][_0x4e3d('0x30')]({'where':{'id':_0x5ccabb['params']['id']}})[_0x4e3d('0x28')](handleEntityNotFound(_0x3beddb,null))[_0x4e3d('0x28')](function(_0x25f2ea){if(_0x25f2ea){_0x4a505e[_0x4e3d('0x35')]=_[_0x4e3d('0x36')](db[_0x4e3d('0xb1')][_0x4e3d('0xce')]);_0x4a505e[_0x4e3d('0x37')]=_[_0x4e3d('0x36')](_0x5ccabb['query']);_0x4a505e[_0x4e3d('0x38')]=_[_0x4e3d('0x39')](_0x4a505e[_0x4e3d('0x35')],_0x4a505e[_0x4e3d('0x37')]);_0x2d8f18[_0x4e3d('0x3b')]=_['intersection'](_0x4a505e[_0x4e3d('0x35')],qs['fields'](_0x5ccabb[_0x4e3d('0x37')][_0x4e3d('0x3a')]));_0x2d8f18[_0x4e3d('0x3b')]=_0x2d8f18[_0x4e3d('0x3b')][_0x4e3d('0x2c')]?_0x2d8f18[_0x4e3d('0x3b')]:_0x4a505e[_0x4e3d('0x35')];if(!_0x5ccabb[_0x4e3d('0x37')][_0x4e3d('0x3c')]('nolimit')){_0x2d8f18[_0x4e3d('0x3e')]=qs[_0x4e3d('0x3e')](_0x5ccabb['query'][_0x4e3d('0x3e')]);_0x2d8f18['offset']=qs['offset'](_0x5ccabb['query'][_0x4e3d('0x20')]);}_0x2d8f18[_0x4e3d('0x3f')]=qs[_0x4e3d('0x40')](_0x5ccabb[_0x4e3d('0x37')][_0x4e3d('0x40')]);_0x2d8f18['where']=qs[_0x4e3d('0x38')](_[_0x4e3d('0x42')](_0x5ccabb[_0x4e3d('0x37')],_0x4a505e[_0x4e3d('0x38')]));_0x2d8f18[_0x4e3d('0x41')][_0x4e3d('0xe5')]=_0x25f2ea['id'];if(_0x5ccabb[_0x4e3d('0x37')][_0x4e3d('0x62')]){_0x2d8f18[_0x4e3d('0x41')]=_[_0x4e3d('0x84')](_0x2d8f18[_0x4e3d('0x41')],{'$or':_[_0x4e3d('0x57')](_0x2d8f18['attributes'],function(_0x1dd795){var _0x5010a1={};_0x5010a1[_0x1dd795]={'$like':'%'+_0x5ccabb['query'][_0x4e3d('0x62')]+'%'};return _0x5010a1;})});}_0x2d8f18=_[_0x4e3d('0x84')]({},_0x2d8f18,_0x5ccabb[_0x4e3d('0xcf')]);return db[_0x4e3d('0xb1')][_0x4e3d('0x22')]({'where':_0x2d8f18[_0x4e3d('0x41')]})[_0x4e3d('0x28')](function(_0x5cd07c){_0x453b18[_0x4e3d('0x22')]=_0x5cd07c;if(_0x5ccabb['query']['includeAll']){_0x2d8f18[_0x4e3d('0xe7')]=[{'all':!![]}];}return db[_0x4e3d('0xb1')]['findAll'](_0x2d8f18);})[_0x4e3d('0x28')](function(_0x3f923f){_0x453b18[_0x4e3d('0x90')]=_0x3f923f;return _0x453b18;});}})['then'](respondWithFilteredResult(_0x3beddb,_0x2d8f18))['catch'](handleError(_0x3beddb,null));};exports[_0x4e3d('0xec')]=function(_0x3cb934,_0x2f450f,_0x3485ba){try{if(!_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0x80')]){throw new Error(_0x4e3d('0xed'));}if(!_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0xee')]){throw new Error(_0x4e3d('0xef'));}if(!_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0xf0')]){throw new Error(_0x4e3d('0xf1'));}if(!_0x3cb934['body'][_0x4e3d('0xf2')]){throw new Error(_0x4e3d('0xf3'));}var _0x4ebf64=_0x3cb934['body']['binding_keys']['split'](',');var _0x1441a5=_0x3cb934[_0x4e3d('0x9d')]['binding_values'][_0x4e3d('0x56')](',');if(!_0x4ebf64[_0x4e3d('0x2c')]||!_0x1441a5[_0x4e3d('0x2c')]||_0x4ebf64['length']!==_0x1441a5['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0x3a')]=_[_0x4e3d('0xf4')](_0x4ebf64,_0x1441a5);if(!_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0x3a')][_0x4e3d('0xcc')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0x3a')]['firstName']){throw new Error(_0x4e3d('0xf5'));}var _0x5ede77=path[_0x4e3d('0xf6')](config['root'],'server/files/tmp',_0x3cb934[_0x4e3d('0xf7')][_0x4e3d('0xf8')]);fs[_0x4e3d('0xf9')](_0x5ede77,parseInt('0777',0x8));var _0x27c9e0=require(_0x4e3d('0xfa'))[_0x4e3d('0xfb')](path['join'](__dirname,'../../components/import/cm/csv'),[_0x5ede77,_0x3cb934['body'][_0x4e3d('0xee')],_0x3cb934[_0x4e3d('0x9d')]['binding_values'],_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0x80')],_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0xfc')],_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0xb7')],_0x3cb934[_0x4e3d('0x9d')][_0x4e3d('0xf2')]]);return _0x2f450f[_0x4e3d('0x1d')](0xc8)[_0x4e3d('0x1f')]({'message':_0x4e3d('0xfd'),'pid':_0x27c9e0[_0x4e3d('0xfe')]});}catch(_0x17091a){return _0x2f450f[_0x4e3d('0x1d')](0x1f4)[_0x4e3d('0xff')](_0x17091a);}};exports[_0x4e3d('0x100')]=function(_0x91e3e2,_0x566e49,_0x18ef54){var _0x315bb8=fs[_0x4e3d('0x101')](_0x91e3e2[_0x4e3d('0xf7')]['path']);Papa[_0x4e3d('0x102')](_0x315bb8,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x121cec){return _0x566e49[_0x4e3d('0x1d')](0xc8)['json']({'file':_0x91e3e2[_0x4e3d('0xf7')],'fields':_0x121cec[_0x4e3d('0x103')][_0x4e3d('0x3a')]});}});};exports[_0x4e3d('0x104')]=function(_0x474eac,_0x19cf96,_0x1e2ed1){return db[_0x4e3d('0x59')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x4e3d('0x7d')}})[_0x4e3d('0x28')](function(_0xf93674){var _0x4e3931=![];if(!_0x474eac[_0x4e3d('0x9d')][_0x4e3d('0x80')]){throw new Error(_0x4e3d('0xed'));}if(!_0x474eac[_0x4e3d('0x9d')][_0x4e3d('0x105')][_0x4e3d('0xcc')]){throw new Error(_0x4e3d('0x106'));}if(!_0x474eac[_0x4e3d('0x9d')][_0x4e3d('0x105')][_0x4e3d('0x107')]){throw new Error(_0x4e3d('0xf5'));}if(!_0x474eac[_0x4e3d('0x9d')][_0x4e3d('0xf2')]){throw new Error(_0x4e3d('0xf3'));}var _0x51960b=require(_0x4e3d('0xfa'))[_0x4e3d('0xfb')](path['join'](__dirname,_0x4e3d('0x108')),[_0x474eac[_0x4e3d('0xbd')]['id'],JSON[_0x4e3d('0x109')](_0x474eac[_0x4e3d('0x9d')]),JSON[_0x4e3d('0x109')](_0xf93674)]);_0x51960b['on'](_0x4e3d('0x10a'),function(_0xddb4e2){_0x4e3931=!![];return _0x19cf96[_0x4e3d('0x1d')](0xc8)['json']({'message':_0x4e3d('0x10b'),'pid':_0x51960b[_0x4e3d('0xfe')]});});_0x51960b['on'](_0x4e3d('0x10c'),function(_0x2469b1){if(_0x2469b1&&!_0x4e3931){return _0x19cf96['status'](0x1f4)[_0x4e3d('0x1f')]({'message':_0x4e3d('0x10d'),'pid':_0x51960b[_0x4e3d('0xfe')]});}});})[_0x4e3d('0x91')](handleError(_0x19cf96,null));};exports['importUpdates']=function(_0x45e686,_0x10268b,_0x51899f){return db[_0x4e3d('0x59')][_0x4e3d('0x98')]({'raw':!![],'attributes':['id'],'where':{'role':_0x4e3d('0x7d')}})[_0x4e3d('0x28')](function(_0x232b39){var _0x3bf6e5=![];if(!_0x45e686[_0x4e3d('0x9d')][_0x4e3d('0x80')]){throw new Error(_0x4e3d('0xed'));}if(!_0x45e686[_0x4e3d('0x9d')]['binding'][_0x4e3d('0xcc')]){throw new Error(_0x4e3d('0x106'));}if(!_0x45e686[_0x4e3d('0x9d')][_0x4e3d('0x105')][_0x4e3d('0x107')]){throw new Error(_0x4e3d('0xf5'));}if(!_0x45e686[_0x4e3d('0x9d')][_0x4e3d('0xf2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x14f1b3=require('child_process')['fork'](path['join'](__dirname,_0x4e3d('0x10e')),[_0x45e686['params']['id'],JSON[_0x4e3d('0x109')](_0x45e686[_0x4e3d('0x9d')]),JSON[_0x4e3d('0x109')](_0x232b39)]);_0x14f1b3['on'](_0x4e3d('0x10a'),function(_0x61797){_0x3bf6e5=!![];return _0x10268b[_0x4e3d('0x1d')](0xc8)[_0x4e3d('0x1f')]({'message':_0x4e3d('0x10b'),'pid':_0x14f1b3[_0x4e3d('0xfe')]});});_0x14f1b3['on']('exit',function(_0x22dfec){if(_0x22dfec&&!_0x3bf6e5){return _0x10268b[_0x4e3d('0x1d')](0x1f4)[_0x4e3d('0x1f')]({'message':_0x4e3d('0x10d'),'pid':_0x14f1b3[_0x4e3d('0xfe')]});}});})[_0x4e3d('0x91')](handleError(_0x10268b,null));};exports[_0x4e3d('0x10f')]=function(_0x21d4d8,_0x38c30f){var _0x3acd26=[_0x4e3d('0x110'),_0x4e3d('0x111'),_0x4e3d('0x112'),'openchannel','fax',_0x4e3d('0x113'),_0x4e3d('0x114')];var _0x2683fc={'offset':0x0,'order':qs[_0x4e3d('0x40')]('-createdAt')},_0x3605bf={'count':0x0,'rows':[]};Promise[_0x4e3d('0x115')]()[_0x4e3d('0x28')](function(){if(_0x21d4d8['query'][_0x4e3d('0x116')]){if(!_[_0x4e3d('0x117')](_0x3acd26,_0x21d4d8[_0x4e3d('0x37')][_0x4e3d('0x116')]['toLowerCase']())){throw new Error('Invalid\x20channel');}_0x3acd26=[_0x21d4d8[_0x4e3d('0x37')]['channel']['toLowerCase']()];}if(_0x21d4d8['query'][_0x4e3d('0x118')]){try{var _0x36eb93=JSON[_0x4e3d('0x102')](_0x21d4d8['query'][_0x4e3d('0x118')]);if(!moment(_0x36eb93['from'])[_0x4e3d('0x119')]()){throw new Error(_0x4e3d('0x11a'));}if(!moment(_0x36eb93['to'])[_0x4e3d('0x119')]()){throw new Error(_0x4e3d('0x11b'));}}catch(_0x33645f){throw new Error(_0x4e3d('0x11c'));}}if(!_0x21d4d8['query'][_0x4e3d('0x3c')](_0x4e3d('0x3d'))){_0x2683fc['limit']=qs['limit'](_0x21d4d8['query'][_0x4e3d('0x3e')]||0xa);_0x2683fc['offset']=qs[_0x4e3d('0x20')](_0x21d4d8[_0x4e3d('0x37')][_0x4e3d('0x20')]);}var _0xc3164f=_0x3acd26[_0x4e3d('0x57')](function(_0x5ec4bd){if(_0x5ec4bd===_0x4e3d('0x114')){var _0x2eb9e3={'attributes':['id',_0x4e3d('0x11d'),_0x4e3d('0x34'),'source',_0x4e3d('0x11e'),'callerid','starttime',_0x4e3d('0x11f'),'duration',_0x4e3d('0x120'),_0x4e3d('0x121'),_0x4e3d('0x122'),_0x4e3d('0x123'),_0x4e3d('0x124'),_0x4e3d('0x125')],'where':{'ContactId':_0x21d4d8[_0x4e3d('0xbd')]['id']},'include':[{'model':db[_0x4e3d('0x59')],'as':_0x4e3d('0x59'),'attributes':['id',_0x4e3d('0x2a'),_0x4e3d('0x126'),_0x4e3d('0x99')]}],'order':[['createdAt',_0x4e3d('0x78')]]};if(_0x21d4d8['query'][_0x4e3d('0x118')]){_0x2eb9e3[_0x4e3d('0x41')]['createdAt']={'$gte':_0x36eb93[_0x4e3d('0x47')],'$lte':_0x36eb93['to']};}return db[_0x4e3d('0xac')][_0x4e3d('0x127')](_0x2eb9e3)[_0x4e3d('0x28')](function(_0x4019d6){_0x3605bf['count']+=_0x4019d6[_0x4e3d('0x22')];return _[_0x4e3d('0x57')](_0x4019d6['rows'],function(_0x3390a7){var _0x2e15c9=_0x3390a7[_0x4e3d('0x128')]({'plain':!![]});_0x2e15c9['channel']=_0x5ec4bd;if(_0x2e15c9[_0x4e3d('0x59')]){_0x2e15c9[_0x4e3d('0x59')]={'id':_0x2e15c9[_0x4e3d('0x59')]['id'],'name':_0x2e15c9[_0x4e3d('0x59')][_0x4e3d('0x2a')],'fullname':_0x2e15c9['User'][_0x4e3d('0x126')],'alias':_0x2e15c9[_0x4e3d('0x59')][_0x4e3d('0x99')]};}return _0x2e15c9;});});}else{var _0x173383=_[_0x4e3d('0x129')](_0x5ec4bd)+(_0x5ec4bd===_0x4e3d('0x111')?'Website':'Account');var _0x17bad0={'attributes':['id',_0x4e3d('0x12a'),_0x4e3d('0x12b'),_0x4e3d('0x121'),_0x4e3d('0x120'),_0x4e3d('0x12c'),_0x4e3d('0x12d'),_0x4e3d('0x12e'),_0x4e3d('0x125'),_0x173383+'Id'],'where':{'ContactId':_0x21d4d8[_0x4e3d('0xbd')]['id']},'include':[{'model':db[_0x173383],'as':_0x4e3d('0x12f'),'attributes':['id',_0x4e3d('0x2a'),_0x4e3d('0x130')]},{'model':db['User'],'as':_0x4e3d('0x131'),'attributes':['id',_0x4e3d('0x2a'),'fullname']},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x4e3d('0x45')],'through':{'attributes':[]}}],'order':[[_0x4e3d('0x121'),'DESC']]};if(_0x21d4d8[_0x4e3d('0x37')][_0x4e3d('0x118')]){_0x17bad0[_0x4e3d('0x41')][_0x4e3d('0x121')]={'$gte':_0x36eb93['from'],'$lte':_0x36eb93['to']};}switch(_0x5ec4bd){case _0x4e3d('0x111'):_0x17bad0[_0x4e3d('0x3b')][_0x4e3d('0x2f')](_0x4e3d('0x132'),_0x4e3d('0x133'),_0x4e3d('0x134'),_0x4e3d('0x135'),_0x4e3d('0x136'),_0x4e3d('0x137'),_0x4e3d('0x138'),_0x4e3d('0x139'),_0x4e3d('0x13a'));break;case'mail':_0x17bad0[_0x4e3d('0x3b')]['push'](_0x4e3d('0x13b'),_0x4e3d('0x13c'));break;case _0x4e3d('0x13d'):_0x17bad0['attributes'][_0x4e3d('0x2f')]('externalUrl',_0x4e3d('0x13e'));break;}return db[_[_0x4e3d('0x129')](_0x5ec4bd)+_0x4e3d('0x13f')][_0x4e3d('0x127')](_0x17bad0)[_0x4e3d('0x28')](function(_0x514cb7){_0x3605bf[_0x4e3d('0x22')]+=_0x514cb7[_0x4e3d('0x22')];return _[_0x4e3d('0x57')](_0x514cb7['rows'],function(_0x59b8b7){var _0x282e16=_0x59b8b7[_0x4e3d('0x128')]({'plain':!![]});_0x282e16[_0x4e3d('0x116')]=_0x5ec4bd;if(_0x282e16['Owner']){_0x282e16[_0x4e3d('0x131')]={'id':_0x282e16['Owner']['id'],'name':_0x282e16[_0x4e3d('0x131')][_0x4e3d('0x2a')],'fullname':_0x282e16['Owner'][_0x4e3d('0x126')]};}return _0x282e16;});});}});return Promise[_0x4e3d('0x32')](_0xc3164f);})[_0x4e3d('0x28')](function(_0x39b4f5){return _(_0x39b4f5)[_0x4e3d('0x140')]()['sortBy'](_0x4e3d('0x121'))[_0x4e3d('0x141')]()[_0x4e3d('0x5c')]();})['then'](function(_0x1e44f6){_0x3605bf[_0x4e3d('0x90')]=_0x2683fc['limit']?_0x1e44f6[_0x4e3d('0x142')](_0x2683fc['offset'],_0x2683fc[_0x4e3d('0x20')]+_0x2683fc[_0x4e3d('0x3e')]):_0x1e44f6;return _0x3605bf;})[_0x4e3d('0x28')](respondWithFilteredResult(_0x38c30f,_0x2683fc))[_0x4e3d('0x91')](handleError(_0x38c30f,null));};
\ No newline at end of file
index e63d9e6..100294e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8534=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x20156c,_0x12e1ff){var _0x4cb19a=function(_0x1e6a2c){while(--_0x1e6a2c){_0x20156c['push'](_0x20156c['shift']());}};_0x4cb19a(++_0x12e1ff);}(_0x8534,0x10d));var _0x4853=function(_0x5a8dda,_0x2b415b){_0x5a8dda=_0x5a8dda-0x0;var _0x2b91e9=_0x8534[_0x5a8dda];return _0x2b91e9;};'use strict';var EventEmitter=require(_0x4853('0x0'));var CmContact=require(_0x4853('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x4853('0x2')](0x0);var events={'afterCreate':_0x4853('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3dd096){return function(_0x35937f,_0x3dc3b0,_0x47dc28){CmContactEvents[_0x4853('0x4')](_0x3dd096+':'+_0x35937f['id'],_0x35937f);CmContactEvents[_0x4853('0x4')](_0x3dd096,_0x35937f);_0x47dc28(null);};}for(var e in events){if(events[_0x4853('0x5')](e)){var event=events[e];CmContact[_0x4853('0x6')](e,emitEvent(event));}}module[_0x4853('0x7')]=CmContactEvents;
\ No newline at end of file
+var _0x363a=['hasOwnProperty','exports','../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit'];(function(_0x26c4aa,_0x2eb22c){var _0xd7c782=function(_0x538ee9){while(--_0x538ee9){_0x26c4aa['push'](_0x26c4aa['shift']());}};_0xd7c782(++_0x2eb22c);}(_0x363a,0x1a9));var _0xa363=function(_0x1ba19c,_0x3975e2){_0x1ba19c=_0x1ba19c-0x0;var _0x4e069b=_0x363a[_0x1ba19c];return _0x4e069b;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xa363('0x0'))['db'][_0xa363('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xa363('0x2')](0x0);var events={'afterCreate':_0xa363('0x3'),'afterUpdate':_0xa363('0x4'),'afterDestroy':_0xa363('0x5')};function emitEvent(_0x53c99e){return function(_0x439236,_0x1504a1,_0x599cb8){CmContactEvents['emit'](_0x53c99e+':'+_0x439236['id'],_0x439236);CmContactEvents[_0xa363('0x6')](_0x53c99e,_0x439236);_0x599cb8(null);};}for(var e in events){if(events[_0xa363('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xa363('0x8')]=CmContactEvents;
\ No newline at end of file
index 35af120..56c348c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc927=['define','cm_contacts','phone','fti_cm_contacts','firstName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','afterCreate','inspect','CmHopper','findOne','then','isNil','cmContact,\x20afterCreate\x20','create','ListId','priority','scheduledat','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','format','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','length','always','onlyIfOpen','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Lists','Campaign','List\x20not\x20found','models','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0xfd01f9,_0x11e85d){var _0x4b1d90=function(_0x39f430){while(--_0x39f430){_0xfd01f9['push'](_0xfd01f9['shift']());}};_0x4b1d90(++_0x11e85d);}(_0xc927,0xea));var _0x7c92=function(_0x567c71,_0x19ec0e){_0x567c71=_0x567c71-0x0;var _0x5337ae=_0xc927[_0x567c71];return _0x5337ae;};'use strict';var _=require(_0x7c92('0x0'));var util=require('util');var logger=require(_0x7c92('0x1'))('api');var moment=require(_0x7c92('0x2'));var BPromise=require('bluebird');var rp=require(_0x7c92('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c92('0x4'));var config=require(_0x7c92('0x5'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x42cb45,_0x205f35){return _0x42cb45[_0x7c92('0x6')]('CmContact',attributes,{'tableName':_0x7c92('0x7'),'paranoid':!![],'indexes':[{'name':_0x7c92('0x8'),'fields':['phone']},{'name':_0x7c92('0x9'),'fields':[_0x7c92('0xa'),'lastName',_0x7c92('0x8'),_0x7c92('0xb'),_0x7c92('0xc'),'email'],'type':_0x7c92('0xd')}],'timestamps':!![],'charset':_0x7c92('0xe'),'collate':_0x7c92('0xf'),'hooks':{'afterCreate':function(_0xc1558e,_0x478d1b,_0x40bc06){var _0x9db99e=_0x42cb45['models'];var _0x23faa1=_0xc1558e[_0x7c92('0x10')]({'plain':!![]});function _0x22adef(){return function(_0x320f8c){logger[_0x7c92('0x11')](_0x7c92('0x12'),_0x7c92('0x13'),util[_0x7c92('0x14')](_0x320f8c,{'showHidden':![],'depth':null}));};}var _0x58882a=function(_0x409451){return new BPromise(function(_0x167d63,_0x390f8e){_0x9db99e[_0x7c92('0x15')][_0x7c92('0x16')]({'where':{'phone':_0x23faa1['phone'],'VoiceQueueId':_0x409451['id']}})[_0x7c92('0x17')](function(_0x3b698d){if(!_[_0x7c92('0x18')](_0x3b698d)){throw new Error(_0x7c92('0x19')+_0x23faa1['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x409451['id']);}return _0x9db99e[_0x7c92('0x15')][_0x7c92('0x1a')]({'phone':_0x23faa1[_0x7c92('0x8')],'ContactId':_0x23faa1['id'],'ListId':_0x23faa1[_0x7c92('0x1b')],'priority':_0x23faa1[_0x7c92('0x1c')]?_0x23faa1[_0x7c92('0x1c')]:0x2,'scheduledat':_0x23faa1[_0x7c92('0x1d')]?_0x23faa1[_0x7c92('0x1d')]:moment()['format'](_0x7c92('0x1e')),'callback':_0x23faa1[_0x7c92('0x1f')]?!![]:![],'callbackuniqueid':_0x23faa1['callbackUniqueid']?_0x23faa1[_0x7c92('0x1f')]:undefined,'callbackat':_0x23faa1[_0x7c92('0x1f')]?moment()[_0x7c92('0x20')](_0x7c92('0x1e')):undefined,'VoiceQueueId':_0x409451['id']});})['catch'](function(_0x324f69){_0x390f8e(_0x324f69);});});};var _0x181338=function(_0x9693d8){return new BPromise(function(_0x2da433,_0x2385bc){_0x9db99e[_0x7c92('0x15')][_0x7c92('0x16')]({'where':{'phone':_0x23faa1[_0x7c92('0x8')],'VoiceQueueId':_0x9693d8['id']}})[_0x7c92('0x17')](function(_0x2f43cd){if(!_[_0x7c92('0x18')](_0x2f43cd)){throw new Error(_0x7c92('0x19')+_0x23faa1[_0x7c92('0x8')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x9693d8['id']);}return _0x9db99e['CmHopperFinal'][_0x7c92('0x16')]({'where':{'calleridnum':_0x23faa1['phone'],'VoiceQueueId':_0x9693d8['id']}});})[_0x7c92('0x17')](function(_0x2e0227){if(!_['isNil'](_0x2e0227)){throw new Error(_0x7c92('0x21')+_0x23faa1[_0x7c92('0x8')]+_0x7c92('0x22')+_0x9693d8['id']);}return _0x9db99e[_0x7c92('0x15')][_0x7c92('0x1a')]({'phone':_0x23faa1['phone'],'ContactId':_0x23faa1['id'],'ListId':_0x23faa1[_0x7c92('0x1b')],'priority':_0x23faa1['priority']?_0x23faa1['priority']:0x2,'scheduledat':_0x23faa1['scheduledat']?_0x23faa1['scheduledat']:moment()[_0x7c92('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x23faa1[_0x7c92('0x1f')]?!![]:![],'callbackuniqueid':_0x23faa1[_0x7c92('0x1f')]?_0x23faa1[_0x7c92('0x1f')]:undefined,'callbackat':_0x23faa1[_0x7c92('0x1f')]?moment()[_0x7c92('0x20')](_0x7c92('0x1e')):undefined,'VoiceQueueId':_0x9693d8['id']});})[_0x7c92('0x23')](function(_0x2c5d39){_0x2385bc(_0x2c5d39);});});};function _0x3e0baa(){return function(_0x37d4c7){logger[_0x7c92('0x11')](_0x7c92('0x12'),_0x7c92('0x13'),util[_0x7c92('0x14')](_0x37d4c7,{'showHidden':![],'depth':null}));};}var _0xaf73c8=function(_0x30fcdf){return new BPromise(function(_0x51ce8d,_0x15708a){_0x9db99e[_0x7c92('0x15')][_0x7c92('0x16')]({'where':{'phone':_0x23faa1['phone'],'CampaignId':_0x30fcdf['id']}})[_0x7c92('0x17')](function(_0x5e9f9c){if(!_['isNil'](_0x5e9f9c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x23faa1['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x30fcdf['id']);}return _0x9db99e[_0x7c92('0x15')][_0x7c92('0x1a')]({'phone':_0x23faa1[_0x7c92('0x8')],'ContactId':_0x23faa1['id'],'ListId':_0x23faa1[_0x7c92('0x1b')],'priority':_0x23faa1[_0x7c92('0x1c')]?_0x23faa1[_0x7c92('0x1c')]:0x2,'scheduledat':_0x23faa1[_0x7c92('0x1d')]?_0x23faa1[_0x7c92('0x1d')]:moment()['format'](_0x7c92('0x1e')),'callback':_0x23faa1[_0x7c92('0x1f')]?!![]:![],'callbackuniqueid':_0x23faa1[_0x7c92('0x1f')]?_0x23faa1['callbackUniqueid']:undefined,'callbackat':_0x23faa1[_0x7c92('0x1f')]?moment()[_0x7c92('0x20')](_0x7c92('0x1e')):undefined,'CampaignId':_0x30fcdf['id']});})['catch'](function(_0x3e97fa){_0x15708a(_0x3e97fa);});});};var _0x41e8d9=function(_0x45c37a){return new BPromise(function(_0x59325c,_0x4ce5c3){_0x9db99e[_0x7c92('0x15')][_0x7c92('0x16')]({'where':{'phone':_0x23faa1[_0x7c92('0x8')],'CampaignId':_0x45c37a['id']}})['then'](function(_0x24ec36){if(!_['isNil'](_0x24ec36)){throw new Error(_0x7c92('0x19')+_0x23faa1['phone']+_0x7c92('0x24')+_0x45c37a['id']);}return _0x9db99e['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x23faa1['phone'],'CampaignId':_0x45c37a['id']}});})[_0x7c92('0x17')](function(_0x481798){if(!_[_0x7c92('0x18')](_0x481798)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x23faa1['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x45c37a['id']);}return _0x9db99e['CmHopper'][_0x7c92('0x1a')]({'phone':_0x23faa1['phone'],'ContactId':_0x23faa1['id'],'ListId':_0x23faa1['ListId'],'priority':_0x23faa1[_0x7c92('0x1c')]?_0x23faa1[_0x7c92('0x1c')]:0x2,'scheduledat':_0x23faa1['scheduledat']?_0x23faa1[_0x7c92('0x1d')]:moment()[_0x7c92('0x20')](_0x7c92('0x1e')),'callback':_0x23faa1[_0x7c92('0x1f')]?!![]:![],'callbackuniqueid':_0x23faa1[_0x7c92('0x1f')]?_0x23faa1[_0x7c92('0x1f')]:undefined,'callbackat':_0x23faa1[_0x7c92('0x1f')]?moment()[_0x7c92('0x20')](_0x7c92('0x1e')):undefined,'CampaignId':_0x45c37a['id']});})[_0x7c92('0x23')](function(_0x2720fe){_0x4ce5c3(_0x2720fe);});});};if(_0x23faa1[_0x7c92('0x1b')]){_0x9db99e[_0x7c92('0x25')][_0x7c92('0x26')]({'where':{'type':'outbound'},'attributes':['id',_0x7c92('0x27')],'include':[{'model':_0x9db99e['CmList'],'as':'Lists','where':{'id':_0x23faa1[_0x7c92('0x1b')]}}]})['then'](function(_0x293d94){if(_0x293d94){var _0x4c7066=[];for(var _0x2c5f06=0x0,_0x4b2a0e;_0x2c5f06<_0x293d94[_0x7c92('0x28')];_0x2c5f06+=0x1){_0x4b2a0e=_0x293d94[_0x2c5f06][_0x7c92('0x10')]({'plain':!![]});switch(_0x4b2a0e[_0x7c92('0x27')]){case _0x7c92('0x29'):_0x181338(_0x4b2a0e)['catch'](_0x22adef());break;case _0x7c92('0x2a'):_0x58882a(_0x4b2a0e)[_0x7c92('0x23')](_0x22adef());break;default:_0x9db99e[_0x7c92('0x15')]['create']({'phone':_0x23faa1[_0x7c92('0x8')],'ContactId':_0x23faa1['id'],'ListId':_0x23faa1[_0x7c92('0x1b')],'scheduledat':_0x23faa1['scheduledat']?_0x23faa1[_0x7c92('0x1d')]:moment()[_0x7c92('0x20')](_0x7c92('0x1e')),'priority':_0x23faa1[_0x7c92('0x1c')]?_0x23faa1[_0x7c92('0x1c')]:0x2,'callback':_0x23faa1[_0x7c92('0x1f')]?!![]:![],'callbackuniqueid':_0x23faa1['callbackUniqueid']?_0x23faa1[_0x7c92('0x1f')]:undefined,'callbackat':_0x23faa1[_0x7c92('0x1f')]?moment()[_0x7c92('0x20')](_0x7c92('0x1e')):undefined,'VoiceQueueId':_0x4b2a0e['id']})[_0x7c92('0x23')](_0x22adef());}}}})[_0x7c92('0x17')](function(){return _0x9db99e[_0x7c92('0x25')][_0x7c92('0x26')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x9db99e[_0x7c92('0x2b')],'as':_0x7c92('0x2c'),'where':{'id':_0x23faa1[_0x7c92('0x1b')]}}]})[_0x7c92('0x17')](function(_0x4f1741){if(_0x4f1741){var _0x19731c=[];for(var _0x232d85=0x0,_0x3e7968;_0x232d85<_0x4f1741[_0x7c92('0x28')];_0x232d85+=0x1){_0x3e7968=_0x4f1741[_0x232d85][_0x7c92('0x10')]({'plain':!![]});_0x9db99e[_0x7c92('0x2d')][_0x7c92('0x1a')]({'phone':_0x23faa1[_0x7c92('0x8')],'ContactId':_0x23faa1['id'],'ListId':_0x23faa1[_0x7c92('0x1b')],'VoiceQueueId':_0x3e7968['id']})[_0x7c92('0x23')](function(_0x27fdac){logger['error'](_0x7c92('0x2e'),'afterCreate',_0x27fdac[_0x7c92('0x2f')]);});}}});})[_0x7c92('0x17')](function(){return _0x9db99e['Campaign']['findAll']({'attributes':['id',_0x7c92('0x27')],'include':[{'model':_0x9db99e[_0x7c92('0x2b')],'as':_0x7c92('0x30'),'where':{'id':_0x23faa1[_0x7c92('0x1b')]}}]})[_0x7c92('0x17')](function(_0x22d69c){if(_0x22d69c){var _0x1ec39e=[];for(var _0x52a5f9=0x0,_0x3cca96;_0x52a5f9<_0x22d69c['length'];_0x52a5f9+=0x1){_0x3cca96=_0x22d69c[_0x52a5f9][_0x7c92('0x10')]({'plain':!![]});switch(_0x3cca96[_0x7c92('0x27')]){case _0x7c92('0x29'):_0x41e8d9(_0x3cca96)[_0x7c92('0x23')](_0x3e0baa());break;case _0x7c92('0x2a'):_0xaf73c8(_0x3cca96)[_0x7c92('0x23')](_0x3e0baa());break;default:_0x9db99e[_0x7c92('0x15')][_0x7c92('0x1a')]({'phone':_0x23faa1['phone'],'ContactId':_0x23faa1['id'],'ListId':_0x23faa1[_0x7c92('0x1b')],'scheduledat':_0x23faa1[_0x7c92('0x1d')]?_0x23faa1[_0x7c92('0x1d')]:moment()[_0x7c92('0x20')](_0x7c92('0x1e')),'priority':_0x23faa1[_0x7c92('0x1c')]?_0x23faa1[_0x7c92('0x1c')]:0x2,'callback':_0x23faa1[_0x7c92('0x1f')]?!![]:![],'callbackuniqueid':_0x23faa1[_0x7c92('0x1f')]?_0x23faa1[_0x7c92('0x1f')]:undefined,'callbackat':_0x23faa1['callbackUniqueid']?moment()[_0x7c92('0x20')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3cca96['id']})[_0x7c92('0x23')](_0x3e0baa());}}}});})['then'](function(){return _0x9db99e[_0x7c92('0x31')]['findAll']({'attributes':['id'],'include':[{'model':_0x9db99e['CmList'],'as':_0x7c92('0x2c'),'where':{'id':_0x23faa1[_0x7c92('0x1b')]}}]})[_0x7c92('0x17')](function(_0x18effe){if(_0x18effe){var _0x58ed86=[];for(var _0x366d1c=0x0,_0x4967a0;_0x366d1c<_0x18effe[_0x7c92('0x28')];_0x366d1c+=0x1){_0x4967a0=_0x18effe[_0x366d1c][_0x7c92('0x10')]({'plain':!![]});_0x9db99e[_0x7c92('0x2d')][_0x7c92('0x1a')]({'phone':_0x23faa1['phone'],'ContactId':_0x23faa1['id'],'ListId':_0x23faa1[_0x7c92('0x1b')],'CampaignId':_0x4967a0['id']})[_0x7c92('0x23')](function(_0x52e738){logger['error']('cmContact,\x20%s,\x20%s',_0x7c92('0x13'),_0x52e738[_0x7c92('0x2f')]);});}}});})[_0x7c92('0x17')](function(){_0x40bc06();})['catch'](function(_0x3310d3){logger[_0x7c92('0x11')](_0x7c92('0x2e'),_0x7c92('0x13'),_0x3310d3[_0x7c92('0x2f')]);_0x40bc06(_0x3310d3);});}else{_0x40bc06(new Error(_0x7c92('0x32')));}},'afterDestroy':function(_0x5af4a3,_0xfda0a1,_0x1e103d){var _0x28dd58=_0x42cb45[_0x7c92('0x33')];var _0x320f12=_0x5af4a3[_0x7c92('0x10')]({'plain':!![]});return _0x28dd58['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x320f12[_0x7c92('0x1b')],'ContactId':_0x320f12['id']}})[_0x7c92('0x17')](function(_0x4ec7a8){if(!_[_0x7c92('0x34')](_0x4ec7a8)){var _0x45dbe3=[];for(var _0x15ea2c=0x0;_0x15ea2c<_0x4ec7a8[_0x7c92('0x28')];_0x15ea2c+=0x1){var _0x2d4056=_0x28dd58[_0x7c92('0x15')][_0x7c92('0x35')]({'where':{'ListId':_0x4ec7a8[_0x15ea2c][_0x7c92('0x1b')],'ContactId':_0x4ec7a8[_0x15ea2c]['ContactId'],'VoiceQueueId':_0x4ec7a8[_0x15ea2c][_0x7c92('0x36')],'CampaignId':_0x4ec7a8[_0x15ea2c][_0x7c92('0x37')]}});_0x45dbe3[_0x7c92('0x38')](_0x2d4056);}return BPromise[_0x7c92('0x39')](_0x45dbe3);}})[_0x7c92('0x17')](function(_0x1fe6dc){logger[_0x7c92('0x3a')]('[CmContact][afterDestroy][Succesfull]',util[_0x7c92('0x14')](_0x1fe6dc,{'showHidden':![],'depth':null}));_0x1e103d();})[_0x7c92('0x23')](function(_0x6f66e2){logger['error'](_0x7c92('0x3b'),util[_0x7c92('0x14')](_0x6f66e2,{'showHidden':![],'depth':null}));_0x1e103d(_0x6f66e2);});}}});};
\ No newline at end of file
+var _0xd827=['rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','findOne','then','isNil','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','priority','scheduledat','callbackUniqueid','YYYY-MM-DD\x20HH:mm:ss','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','CmHopper','ListId','format','catch','afterCreate','inspect','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','create','\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','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','VoiceQueue','BlackLists','CmHopperBlack','message','Campaign','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3778fb,_0x4fb11f){var _0x1cbe9e=function(_0x4909c2){while(--_0x4909c2){_0x3778fb['push'](_0x3778fb['shift']());}};_0x1cbe9e(++_0x4fb11f);}(_0xd827,0x1d6));var _0x7d82=function(_0x4e77c6,_0x4c359c){_0x4e77c6=_0x4e77c6-0x0;var _0x3e326c=_0xd827[_0x4e77c6];return _0x3e326c;};'use strict';var _=require(_0x7d82('0x0'));var util=require('util');var logger=require(_0x7d82('0x1'))(_0x7d82('0x2'));var moment=require('moment');var BPromise=require(_0x7d82('0x3'));var rp=require(_0x7d82('0x4'));var fs=require('fs');var path=require(_0x7d82('0x5'));var rimraf=require(_0x7d82('0x6'));var config=require(_0x7d82('0x7'));var attributes=require(_0x7d82('0x8'));module[_0x7d82('0x9')]=function(_0x2a7b17,_0x2321b1){return _0x2a7b17[_0x7d82('0xa')](_0x7d82('0xb'),attributes,{'tableName':_0x7d82('0xc'),'paranoid':!![],'indexes':[{'name':_0x7d82('0xd'),'fields':['phone']},{'name':_0x7d82('0xe'),'fields':[_0x7d82('0xf'),'lastName',_0x7d82('0xd'),_0x7d82('0x10'),_0x7d82('0x11'),'email'],'type':_0x7d82('0x12')}],'timestamps':!![],'charset':_0x7d82('0x13'),'collate':_0x7d82('0x14'),'hooks':{'afterCreate':function(_0x3651cc,_0x5152e6,_0xf94042){var _0x226f98=_0x2a7b17[_0x7d82('0x15')];var _0x3351e3=_0x3651cc[_0x7d82('0x16')]({'plain':!![]});function _0x460bf8(){return function(_0x5c7504){logger[_0x7d82('0x17')](_0x7d82('0x18'),'afterCreate',util['inspect'](_0x5c7504,{'showHidden':![],'depth':null}));};}var _0x2ca26d=function(_0x1505e9){return new BPromise(function(_0x260180,_0x438ca6){_0x226f98['CmHopper'][_0x7d82('0x19')]({'where':{'phone':_0x3351e3[_0x7d82('0xd')],'VoiceQueueId':_0x1505e9['id']}})[_0x7d82('0x1a')](function(_0x1613c6){if(!_[_0x7d82('0x1b')](_0x1613c6)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3351e3['phone']+_0x7d82('0x1c')+_0x1505e9['id']);}return _0x226f98['CmHopper']['create']({'phone':_0x3351e3[_0x7d82('0xd')],'ContactId':_0x3351e3['id'],'ListId':_0x3351e3['ListId'],'priority':_0x3351e3[_0x7d82('0x1d')]?_0x3351e3[_0x7d82('0x1d')]:0x2,'scheduledat':_0x3351e3['scheduledat']?_0x3351e3[_0x7d82('0x1e')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3351e3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3351e3[_0x7d82('0x1f')]?_0x3351e3[_0x7d82('0x1f')]:undefined,'callbackat':_0x3351e3[_0x7d82('0x1f')]?moment()['format'](_0x7d82('0x20')):undefined,'VoiceQueueId':_0x1505e9['id']});})['catch'](function(_0x1bb64e){_0x438ca6(_0x1bb64e);});});};var _0x3de4b2=function(_0x20d95e){return new BPromise(function(_0x4a99ff,_0xad6eb1){_0x226f98['CmHopper'][_0x7d82('0x19')]({'where':{'phone':_0x3351e3[_0x7d82('0xd')],'VoiceQueueId':_0x20d95e['id']}})['then'](function(_0x54ceb4){if(!_[_0x7d82('0x1b')](_0x54ceb4)){throw new Error(_0x7d82('0x21')+_0x3351e3[_0x7d82('0xd')]+_0x7d82('0x22')+_0x20d95e['id']);}return _0x226f98[_0x7d82('0x23')][_0x7d82('0x19')]({'where':{'calleridnum':_0x3351e3['phone'],'VoiceQueueId':_0x20d95e['id']}});})[_0x7d82('0x1a')](function(_0x3f8228){if(!_[_0x7d82('0x1b')](_0x3f8228)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3351e3[_0x7d82('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x20d95e['id']);}return _0x226f98[_0x7d82('0x24')]['create']({'phone':_0x3351e3['phone'],'ContactId':_0x3351e3['id'],'ListId':_0x3351e3[_0x7d82('0x25')],'priority':_0x3351e3['priority']?_0x3351e3[_0x7d82('0x1d')]:0x2,'scheduledat':_0x3351e3[_0x7d82('0x1e')]?_0x3351e3[_0x7d82('0x1e')]:moment()[_0x7d82('0x26')](_0x7d82('0x20')),'callback':_0x3351e3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3351e3[_0x7d82('0x1f')]?_0x3351e3[_0x7d82('0x1f')]:undefined,'callbackat':_0x3351e3[_0x7d82('0x1f')]?moment()[_0x7d82('0x26')](_0x7d82('0x20')):undefined,'VoiceQueueId':_0x20d95e['id']});})[_0x7d82('0x27')](function(_0x22cd14){_0xad6eb1(_0x22cd14);});});};function _0x274c55(){return function(_0x3e0086){logger[_0x7d82('0x17')]('cmContact',_0x7d82('0x28'),util[_0x7d82('0x29')](_0x3e0086,{'showHidden':![],'depth':null}));};}var _0x132462=function(_0x23786e){return new BPromise(function(_0x5aa429,_0x3ec9df){_0x226f98['CmHopper']['findOne']({'where':{'phone':_0x3351e3['phone'],'CampaignId':_0x23786e['id']}})[_0x7d82('0x1a')](function(_0x42a1bc){if(!_[_0x7d82('0x1b')](_0x42a1bc)){throw new Error(_0x7d82('0x21')+_0x3351e3[_0x7d82('0xd')]+_0x7d82('0x2a')+_0x23786e['id']);}return _0x226f98[_0x7d82('0x24')][_0x7d82('0x2b')]({'phone':_0x3351e3[_0x7d82('0xd')],'ContactId':_0x3351e3['id'],'ListId':_0x3351e3[_0x7d82('0x25')],'priority':_0x3351e3[_0x7d82('0x1d')]?_0x3351e3[_0x7d82('0x1d')]:0x2,'scheduledat':_0x3351e3[_0x7d82('0x1e')]?_0x3351e3[_0x7d82('0x1e')]:moment()['format'](_0x7d82('0x20')),'callback':_0x3351e3[_0x7d82('0x1f')]?!![]:![],'callbackuniqueid':_0x3351e3[_0x7d82('0x1f')]?_0x3351e3['callbackUniqueid']:undefined,'callbackat':_0x3351e3[_0x7d82('0x1f')]?moment()[_0x7d82('0x26')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x23786e['id']});})[_0x7d82('0x27')](function(_0x2605ff){_0x3ec9df(_0x2605ff);});});};var _0x49673e=function(_0x112a96){return new BPromise(function(_0x1b1072,_0x2a22b8){_0x226f98[_0x7d82('0x24')][_0x7d82('0x19')]({'where':{'phone':_0x3351e3[_0x7d82('0xd')],'CampaignId':_0x112a96['id']}})[_0x7d82('0x1a')](function(_0x37c014){if(!_[_0x7d82('0x1b')](_0x37c014)){throw new Error(_0x7d82('0x21')+_0x3351e3[_0x7d82('0xd')]+_0x7d82('0x2c')+_0x112a96['id']);}return _0x226f98[_0x7d82('0x23')][_0x7d82('0x19')]({'where':{'calleridnum':_0x3351e3[_0x7d82('0xd')],'CampaignId':_0x112a96['id']}});})[_0x7d82('0x1a')](function(_0x5e2427){if(!_[_0x7d82('0x1b')](_0x5e2427)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3351e3['phone']+_0x7d82('0x2d')+_0x112a96['id']);}return _0x226f98[_0x7d82('0x24')][_0x7d82('0x2b')]({'phone':_0x3351e3[_0x7d82('0xd')],'ContactId':_0x3351e3['id'],'ListId':_0x3351e3[_0x7d82('0x25')],'priority':_0x3351e3['priority']?_0x3351e3[_0x7d82('0x1d')]:0x2,'scheduledat':_0x3351e3[_0x7d82('0x1e')]?_0x3351e3['scheduledat']:moment()[_0x7d82('0x26')](_0x7d82('0x20')),'callback':_0x3351e3[_0x7d82('0x1f')]?!![]:![],'callbackuniqueid':_0x3351e3[_0x7d82('0x1f')]?_0x3351e3['callbackUniqueid']:undefined,'callbackat':_0x3351e3['callbackUniqueid']?moment()[_0x7d82('0x26')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x112a96['id']});})[_0x7d82('0x27')](function(_0x5e32a4){_0x2a22b8(_0x5e32a4);});});};if(_0x3351e3['ListId']){_0x226f98['VoiceQueue'][_0x7d82('0x2e')]({'where':{'type':_0x7d82('0x2f')},'attributes':['id',_0x7d82('0x30')],'include':[{'model':_0x226f98[_0x7d82('0x31')],'as':_0x7d82('0x32'),'where':{'id':_0x3351e3[_0x7d82('0x25')]}}]})['then'](function(_0x21d8fc){if(_0x21d8fc){var _0x487fc4=[];for(var _0x11b9f1=0x0,_0x4bdb59;_0x11b9f1<_0x21d8fc[_0x7d82('0x33')];_0x11b9f1+=0x1){_0x4bdb59=_0x21d8fc[_0x11b9f1][_0x7d82('0x16')]({'plain':!![]});switch(_0x4bdb59[_0x7d82('0x30')]){case _0x7d82('0x34'):_0x3de4b2(_0x4bdb59)[_0x7d82('0x27')](_0x460bf8());break;case _0x7d82('0x35'):_0x2ca26d(_0x4bdb59)[_0x7d82('0x27')](_0x460bf8());break;default:_0x226f98[_0x7d82('0x24')][_0x7d82('0x2b')]({'phone':_0x3351e3[_0x7d82('0xd')],'ContactId':_0x3351e3['id'],'ListId':_0x3351e3[_0x7d82('0x25')],'scheduledat':_0x3351e3[_0x7d82('0x1e')]?_0x3351e3[_0x7d82('0x1e')]:moment()[_0x7d82('0x26')](_0x7d82('0x20')),'priority':_0x3351e3[_0x7d82('0x1d')]?_0x3351e3['priority']:0x2,'callback':_0x3351e3[_0x7d82('0x1f')]?!![]:![],'callbackuniqueid':_0x3351e3[_0x7d82('0x1f')]?_0x3351e3[_0x7d82('0x1f')]:undefined,'callbackat':_0x3351e3[_0x7d82('0x1f')]?moment()[_0x7d82('0x26')](_0x7d82('0x20')):undefined,'VoiceQueueId':_0x4bdb59['id']})[_0x7d82('0x27')](_0x460bf8());}}}})[_0x7d82('0x1a')](function(){return _0x226f98[_0x7d82('0x36')]['findAll']({'where':{'type':_0x7d82('0x2f')},'attributes':['id'],'include':[{'model':_0x226f98[_0x7d82('0x31')],'as':_0x7d82('0x37'),'where':{'id':_0x3351e3[_0x7d82('0x25')]}}]})['then'](function(_0x3ff623){if(_0x3ff623){var _0xdc0895=[];for(var _0x260118=0x0,_0x524f23;_0x260118<_0x3ff623[_0x7d82('0x33')];_0x260118+=0x1){_0x524f23=_0x3ff623[_0x260118]['get']({'plain':!![]});_0x226f98[_0x7d82('0x38')]['create']({'phone':_0x3351e3[_0x7d82('0xd')],'ContactId':_0x3351e3['id'],'ListId':_0x3351e3['ListId'],'VoiceQueueId':_0x524f23['id']})['catch'](function(_0x917756){logger[_0x7d82('0x17')]('cmContact,\x20%s,\x20%s',_0x7d82('0x28'),_0x917756[_0x7d82('0x39')]);});}}});})[_0x7d82('0x1a')](function(){return _0x226f98[_0x7d82('0x3a')][_0x7d82('0x2e')]({'attributes':['id',_0x7d82('0x30')],'include':[{'model':_0x226f98[_0x7d82('0x31')],'as':_0x7d82('0x32'),'where':{'id':_0x3351e3[_0x7d82('0x25')]}}]})[_0x7d82('0x1a')](function(_0x38d19c){if(_0x38d19c){var _0x4ad5c0=[];for(var _0x1638a2=0x0,_0x1e1031;_0x1638a2<_0x38d19c[_0x7d82('0x33')];_0x1638a2+=0x1){_0x1e1031=_0x38d19c[_0x1638a2][_0x7d82('0x16')]({'plain':!![]});switch(_0x1e1031[_0x7d82('0x30')]){case'always':_0x49673e(_0x1e1031)[_0x7d82('0x27')](_0x274c55());break;case _0x7d82('0x35'):_0x132462(_0x1e1031)[_0x7d82('0x27')](_0x274c55());break;default:_0x226f98['CmHopper'][_0x7d82('0x2b')]({'phone':_0x3351e3[_0x7d82('0xd')],'ContactId':_0x3351e3['id'],'ListId':_0x3351e3['ListId'],'scheduledat':_0x3351e3[_0x7d82('0x1e')]?_0x3351e3[_0x7d82('0x1e')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x3351e3['priority']?_0x3351e3[_0x7d82('0x1d')]:0x2,'callback':_0x3351e3[_0x7d82('0x1f')]?!![]:![],'callbackuniqueid':_0x3351e3['callbackUniqueid']?_0x3351e3[_0x7d82('0x1f')]:undefined,'callbackat':_0x3351e3['callbackUniqueid']?moment()[_0x7d82('0x26')](_0x7d82('0x20')):undefined,'CampaignId':_0x1e1031['id']})[_0x7d82('0x27')](_0x274c55());}}}});})[_0x7d82('0x1a')](function(){return _0x226f98['Campaign'][_0x7d82('0x2e')]({'attributes':['id'],'include':[{'model':_0x226f98['CmList'],'as':_0x7d82('0x37'),'where':{'id':_0x3351e3[_0x7d82('0x25')]}}]})[_0x7d82('0x1a')](function(_0xed6f19){if(_0xed6f19){var _0x26eed6=[];for(var _0x1f5ffa=0x0,_0x4a68af;_0x1f5ffa<_0xed6f19[_0x7d82('0x33')];_0x1f5ffa+=0x1){_0x4a68af=_0xed6f19[_0x1f5ffa][_0x7d82('0x16')]({'plain':!![]});_0x226f98[_0x7d82('0x38')]['create']({'phone':_0x3351e3[_0x7d82('0xd')],'ContactId':_0x3351e3['id'],'ListId':_0x3351e3[_0x7d82('0x25')],'CampaignId':_0x4a68af['id']})[_0x7d82('0x27')](function(_0x274ccf){logger['error'](_0x7d82('0x3b'),'afterCreate',_0x274ccf[_0x7d82('0x39')]);});}}});})[_0x7d82('0x1a')](function(){_0xf94042();})[_0x7d82('0x27')](function(_0x4da574){logger[_0x7d82('0x17')]('cmContact,\x20%s,\x20%s',_0x7d82('0x28'),_0x4da574[_0x7d82('0x39')]);_0xf94042(_0x4da574);});}else{_0xf94042(new Error(_0x7d82('0x3c')));}},'afterDestroy':function(_0x4801b7,_0x33c86c,_0xce4f98){var _0x27c781=_0x2a7b17[_0x7d82('0x15')];var _0x27a129=_0x4801b7[_0x7d82('0x16')]({'plain':!![]});return _0x27c781[_0x7d82('0x24')][_0x7d82('0x2e')]({'raw':!![],'where':{'ListId':_0x27a129[_0x7d82('0x25')],'ContactId':_0x27a129['id']}})['then'](function(_0x3b2dcb){if(!_[_0x7d82('0x3d')](_0x3b2dcb)){var _0x3096d8=[];for(var _0xdc02f0=0x0;_0xdc02f0<_0x3b2dcb[_0x7d82('0x33')];_0xdc02f0+=0x1){var _0x52131a=_0x27c781[_0x7d82('0x24')]['destroy']({'where':{'ListId':_0x3b2dcb[_0xdc02f0][_0x7d82('0x25')],'ContactId':_0x3b2dcb[_0xdc02f0]['ContactId'],'VoiceQueueId':_0x3b2dcb[_0xdc02f0][_0x7d82('0x3e')],'CampaignId':_0x3b2dcb[_0xdc02f0]['CampaignId']}});_0x3096d8[_0x7d82('0x3f')](_0x52131a);}return BPromise[_0x7d82('0x40')](_0x3096d8);}})[_0x7d82('0x1a')](function(_0x68b261){logger[_0x7d82('0x41')](_0x7d82('0x42'),util[_0x7d82('0x29')](_0x68b261,{'showHidden':![],'depth':null}));_0xce4f98();})[_0x7d82('0x27')](function(_0x337911){logger['error'](_0x7d82('0x43'),util[_0x7d82('0x29')](_0x337911,{'showHidden':![],'depth':null}));_0xce4f98(_0x337911);});}}});};
\ No newline at end of file
index defd250..bae4758 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9568=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./cmContact.socket','info','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmContact,\x20%s,\x20%s','result','catch','GetCmContact','CmContact','findAll','options','raw','attributes','limit','include','map','model','CreateCmContact','body','then','keys','length','cf_','update','set','id\x20=\x20?','toString','sequelize','query','lodash','util'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x9568,0x147));var _0x8956=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0x9568[_0x5ac0f0];return _0x4aceec;};'use strict';var _=require(_0x8956('0x0'));var util=require(_0x8956('0x1'));var moment=require('moment');var BPromise=require(_0x8956('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var squel=require('squel');var db=require(_0x8956('0x3'))['db'];var utils=require(_0x8956('0x4'));var logger=require(_0x8956('0x5'))(_0x8956('0x6'));var config=require(_0x8956('0x7'));var jayson=require(_0x8956('0x8'));var client=jayson['client'][_0x8956('0x9')]({'port':0x232a});config[_0x8956('0xa')]=_['defaults'](config[_0x8956('0xa')],{'host':_0x8956('0xb'),'port':0x18eb});var socket=require(_0x8956('0xc'))(new Redis(config[_0x8956('0xa')]));require(_0x8956('0xd'))['register'](socket);function respondWithRpcPromise(_0x27a9c9,_0x4b9fbb,_0x7569d){return new BPromise(function(_0x460925,_0x51c364){return client['request'](_0x27a9c9,_0x7569d)['then'](function(_0x2c4943){logger[_0x8956('0xe')]('CmContact,\x20%s,\x20%s',_0x4b9fbb,_0x8956('0xf'));logger[_0x8956('0x10')](_0x8956('0x11'),_0x4b9fbb,_0x8956('0xf'),JSON[_0x8956('0x12')](_0x2c4943));if(_0x2c4943[_0x8956('0x13')]){if(_0x2c4943[_0x8956('0x13')][_0x8956('0x14')]===0x1f4){logger['error']('CmContact,\x20%s,\x20%s',_0x4b9fbb,_0x2c4943[_0x8956('0x13')]['message']);return _0x51c364(_0x2c4943[_0x8956('0x13')][_0x8956('0x15')]);}logger[_0x8956('0x13')](_0x8956('0x16'),_0x4b9fbb,_0x2c4943[_0x8956('0x13')]['message']);return _0x460925(_0x2c4943['error'][_0x8956('0x15')]);}else{logger[_0x8956('0xe')](_0x8956('0x16'),_0x4b9fbb,'request\x20sent');_0x460925(_0x2c4943[_0x8956('0x17')][_0x8956('0x15')]);}})[_0x8956('0x18')](function(_0x3b50d7){logger[_0x8956('0x13')]('CmContact,\x20%s,\x20%s',_0x4b9fbb,_0x3b50d7);_0x51c364(_0x3b50d7);});});}exports[_0x8956('0x19')]=function(_0xb3ebb5){var _0x4f08d9=this;return new Promise(function(_0x356653,_0x1c124f){return db[_0x8956('0x1a')][_0x8956('0x1b')]({'raw':_0xb3ebb5[_0x8956('0x1c')]?_0xb3ebb5['options'][_0x8956('0x1d')]===undefined?!![]:![]:!![],'where':_0xb3ebb5[_0x8956('0x1c')]?_0xb3ebb5['options']['where']||null:null,'attributes':_0xb3ebb5[_0x8956('0x1c')]?_0xb3ebb5[_0x8956('0x1c')][_0x8956('0x1e')]||null:null,'limit':_0xb3ebb5['options']?_0xb3ebb5[_0x8956('0x1c')][_0x8956('0x1f')]||null:null,'include':_0xb3ebb5[_0x8956('0x1c')]?_0xb3ebb5[_0x8956('0x1c')][_0x8956('0x20')]?_[_0x8956('0x21')](_0xb3ebb5[_0x8956('0x1c')]['include'],function(_0x4370a9){return{'model':db[_0x4370a9[_0x8956('0x22')]],'as':_0x4370a9['as'],'attributes':_0x4370a9[_0x8956('0x1e')],'include':_0x4370a9['include']?_['map'](_0x4370a9[_0x8956('0x20')],function(_0x42e856){return{'model':db[_0x42e856[_0x8956('0x22')]],'as':_0x42e856['as'],'attributes':_0x42e856[_0x8956('0x1e')],'include':_0x42e856[_0x8956('0x20')]?_[_0x8956('0x21')](_0x42e856['include'],function(_0x1e5e7c){return{'model':db[_0x1e5e7c[_0x8956('0x22')]],'as':_0x1e5e7c['as'],'attributes':_0x1e5e7c[_0x8956('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52cb6d){logger[_0x8956('0xe')](_0x8956('0x19'),_0xb3ebb5);logger['debug'](_0x8956('0x19'),_0xb3ebb5,JSON['stringify'](_0x52cb6d));_0x356653(_0x52cb6d);})[_0x8956('0x18')](function(_0xe5657c){logger[_0x8956('0x13')](_0x8956('0x19'),_0xe5657c[_0x8956('0x15')],_0xb3ebb5);_0x1c124f(_0x4f08d9[_0x8956('0x13')](0x1f4,_0xe5657c['message']));});});};exports[_0x8956('0x23')]=function(_0x37094b){var _0x378527=this;return new Promise(function(_0x433cb4,_0x49ee9a){return db['CmContact']['create'](_0x37094b[_0x8956('0x24')],{'raw':_0x37094b[_0x8956('0x1c')]?_0x37094b[_0x8956('0x1c')][_0x8956('0x1d')]===undefined?!![]:![]:!![]})[_0x8956('0x25')](function(_0x10ed04){var _0x364081;for(var _0x59e51f=0x0;_0x59e51f<Object[_0x8956('0x26')](_0x37094b[_0x8956('0x24')])[_0x8956('0x27')];_0x59e51f++){var _0x28120e=Object[_0x8956('0x26')](_0x37094b['body'])[_0x59e51f];if(_0x28120e['startsWith'](_0x8956('0x28'))){_0x364081=squel[_0x8956('0x29')]()['table']('cm_contacts')[_0x8956('0x2a')](_0x28120e,_0x37094b['body'][_0x28120e])['where'](_0x8956('0x2b'),_0x10ed04['id'])[_0x8956('0x2c')]();break;}}if(!_0x364081)return _0x10ed04;return db[_0x8956('0x2d')][_0x8956('0x2e')](_0x364081)['then'](function(){return _0x10ed04;});})[_0x8956('0x25')](function(_0xf922fc){logger[_0x8956('0xe')]('CreateCmContact',_0x37094b);logger['debug'](_0x8956('0x23'),_0x37094b,JSON[_0x8956('0x12')](_0xf922fc));_0x433cb4(_0xf922fc);})[_0x8956('0x18')](function(_0x3cf1bf){logger[_0x8956('0x13')]('CreateCmContact',_0x3cf1bf['message'],_0x37094b);_0x49ee9a(_0x378527[_0x8956('0x13')](0x1f4,_0x3cf1bf[_0x8956('0x15')]));});});};
\ No newline at end of file
+var _0x11d4=['options','raw','attributes','limit','include','map','model','stringify','catch','CreateCmContact','create','body','then','keys','length','table','set','where','id\x20=\x20?','toString','sequelize','query','util','moment','bluebird','ioredis','squel','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','request','info','CmContact,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','GetCmContact','CmContact','findAll'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x11d4,0x196));var _0x411d=function(_0xbb98ce,_0x273f4e){_0xbb98ce=_0xbb98ce-0x0;var _0xf953e4=_0x11d4[_0xbb98ce];return _0xf953e4;};'use strict';var _=require('lodash');var util=require(_0x411d('0x0'));var moment=require(_0x411d('0x1'));var BPromise=require(_0x411d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x411d('0x3'));var squel=require(_0x411d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x411d('0x5'));var config=require(_0x411d('0x6'));var jayson=require(_0x411d('0x7'));var client=jayson['client'][_0x411d('0x8')]({'port':0x232a});config[_0x411d('0x9')]=_[_0x411d('0xa')](config[_0x411d('0x9')],{'host':_0x411d('0xb'),'port':0x18eb});var socket=require(_0x411d('0xc'))(new Redis(config[_0x411d('0x9')]));require(_0x411d('0xd'))['register'](socket);function respondWithRpcPromise(_0x37a427,_0x181239,_0x4342a1){return new BPromise(function(_0x26ee40,_0x53c33c){return client[_0x411d('0xe')](_0x37a427,_0x4342a1)['then'](function(_0x5158bf){logger[_0x411d('0xf')](_0x411d('0x10'),_0x181239,'request\x20sent');logger[_0x411d('0x11')]('CmContact,\x20%s,\x20%s,\x20%s',_0x181239,_0x411d('0x12'),JSON['stringify'](_0x5158bf));if(_0x5158bf[_0x411d('0x13')]){if(_0x5158bf['error'][_0x411d('0x14')]===0x1f4){logger[_0x411d('0x13')]('CmContact,\x20%s,\x20%s',_0x181239,_0x5158bf['error'][_0x411d('0x15')]);return _0x53c33c(_0x5158bf[_0x411d('0x13')][_0x411d('0x15')]);}logger['error'](_0x411d('0x10'),_0x181239,_0x5158bf['error'][_0x411d('0x15')]);return _0x26ee40(_0x5158bf['error'][_0x411d('0x15')]);}else{logger[_0x411d('0xf')]('CmContact,\x20%s,\x20%s',_0x181239,_0x411d('0x12'));_0x26ee40(_0x5158bf[_0x411d('0x16')]['message']);}})['catch'](function(_0x183ffb){logger['error']('CmContact,\x20%s,\x20%s',_0x181239,_0x183ffb);_0x53c33c(_0x183ffb);});});}exports[_0x411d('0x17')]=function(_0xb39a68){var _0x409911=this;return new Promise(function(_0x4a77dd,_0x58cc58){return db[_0x411d('0x18')][_0x411d('0x19')]({'raw':_0xb39a68['options']?_0xb39a68[_0x411d('0x1a')][_0x411d('0x1b')]===undefined?!![]:![]:!![],'where':_0xb39a68[_0x411d('0x1a')]?_0xb39a68[_0x411d('0x1a')]['where']||null:null,'attributes':_0xb39a68[_0x411d('0x1a')]?_0xb39a68['options'][_0x411d('0x1c')]||null:null,'limit':_0xb39a68[_0x411d('0x1a')]?_0xb39a68[_0x411d('0x1a')][_0x411d('0x1d')]||null:null,'include':_0xb39a68[_0x411d('0x1a')]?_0xb39a68[_0x411d('0x1a')][_0x411d('0x1e')]?_[_0x411d('0x1f')](_0xb39a68[_0x411d('0x1a')]['include'],function(_0x87002e){return{'model':db[_0x87002e[_0x411d('0x20')]],'as':_0x87002e['as'],'attributes':_0x87002e[_0x411d('0x1c')],'include':_0x87002e['include']?_[_0x411d('0x1f')](_0x87002e[_0x411d('0x1e')],function(_0x5270b4){return{'model':db[_0x5270b4[_0x411d('0x20')]],'as':_0x5270b4['as'],'attributes':_0x5270b4[_0x411d('0x1c')],'include':_0x5270b4['include']?_[_0x411d('0x1f')](_0x5270b4[_0x411d('0x1e')],function(_0x48ef3f){return{'model':db[_0x48ef3f[_0x411d('0x20')]],'as':_0x48ef3f['as'],'attributes':_0x48ef3f[_0x411d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b0f59){logger[_0x411d('0xf')]('GetCmContact',_0xb39a68);logger[_0x411d('0x11')](_0x411d('0x17'),_0xb39a68,JSON[_0x411d('0x21')](_0x3b0f59));_0x4a77dd(_0x3b0f59);})[_0x411d('0x22')](function(_0x52e121){logger[_0x411d('0x13')](_0x411d('0x17'),_0x52e121[_0x411d('0x15')],_0xb39a68);_0x58cc58(_0x409911[_0x411d('0x13')](0x1f4,_0x52e121[_0x411d('0x15')]));});});};exports[_0x411d('0x23')]=function(_0x390d62){var _0x417c64=this;return new Promise(function(_0x36e16f,_0x2b2f66){return db[_0x411d('0x18')][_0x411d('0x24')](_0x390d62[_0x411d('0x25')],{'raw':_0x390d62[_0x411d('0x1a')]?_0x390d62['options'][_0x411d('0x1b')]===undefined?!![]:![]:!![]})[_0x411d('0x26')](function(_0x51b257){var _0x489e62;for(var _0x539f89=0x0;_0x539f89<Object[_0x411d('0x27')](_0x390d62[_0x411d('0x25')])[_0x411d('0x28')];_0x539f89++){var _0x5ab721=Object['keys'](_0x390d62[_0x411d('0x25')])[_0x539f89];if(_0x5ab721['startsWith']('cf_')){_0x489e62=squel['update']()[_0x411d('0x29')]('cm_contacts')[_0x411d('0x2a')](_0x5ab721,_0x390d62['body'][_0x5ab721])[_0x411d('0x2b')](_0x411d('0x2c'),_0x51b257['id'])[_0x411d('0x2d')]();break;}}if(!_0x489e62)return _0x51b257;return db[_0x411d('0x2e')][_0x411d('0x2f')](_0x489e62)[_0x411d('0x26')](function(){return _0x51b257;});})[_0x411d('0x26')](function(_0x563cfb){logger[_0x411d('0xf')](_0x411d('0x23'),_0x390d62);logger[_0x411d('0x11')](_0x411d('0x23'),_0x390d62,JSON[_0x411d('0x21')](_0x563cfb));_0x36e16f(_0x563cfb);})[_0x411d('0x22')](function(_0x20d992){logger[_0x411d('0x13')]('CreateCmContact',_0x20d992[_0x411d('0x15')],_0x390d62);_0x2b2f66(_0x417c64[_0x411d('0x13')](0x1f4,_0x20d992[_0x411d('0x15')]));});});};
\ No newline at end of file
index ba6f390..f42ce0c 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 4e9217c..86d6d4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x4fa33a,_0xeaa1f8){var _0x303ff1=function(_0x5ac0b0){while(--_0x5ac0b0){_0x4fa33a['push'](_0x4fa33a['shift']());}};_0x303ff1(++_0xeaa1f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
+var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x2f2a24,_0x2e390){var _0x130e4f=function(_0x1cd410){while(--_0x1cd410){_0x2f2a24['push'](_0x2f2a24['shift']());}};_0x130e4f(++_0x2e390);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
index 2eb25ee..b11ad22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x593e=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0x593e,0xcb));var _0xe593=function(_0x42a59f,_0x138a14){_0x42a59f=_0x42a59f-0x0;var _0x4c17a4=_0x593e[_0x42a59f];return _0x4c17a4;};'use strict';var Sequelize=require(_0xe593('0x0'));module[_0xe593('0x1')]={'CmContactId':{'type':Sequelize[_0xe593('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xe593('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xe593('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xe593('0x3')],'defaultValue':_0xe593('0x4')},'OrderBy':{'type':Sequelize[_0xe593('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}};
\ No newline at end of file
+var _0xa74d=['INTEGER','STRING','PHONE','exports'];(function(_0xfe3407,_0x2d93f9){var _0x2a86ba=function(_0x557e9e){while(--_0x557e9e){_0xfe3407['push'](_0xfe3407['shift']());}};_0x2a86ba(++_0x2d93f9);}(_0xa74d,0x1cf));var _0xda74=function(_0x4fef08,_0x4c98c7){_0x4fef08=_0x4fef08-0x0;var _0x1bde5d=_0xa74d[_0x4fef08];return _0x1bde5d;};'use strict';var Sequelize=require('sequelize');module[_0xda74('0x0')]={'CmContactId':{'type':Sequelize[_0xda74('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xda74('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xda74('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xda74('0x2')],'defaultValue':_0xda74('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xda74('0x2')],'defaultValue':null}};
\ No newline at end of file
index 197167c..2191dce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19c1=['query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','rawAttributes','includeAll','find','create','body','user','get','role','CmContactHasItems','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','UserProfileResource','error','stack','name','send','CmContactHasItem','fieldName','type','key','model','map','keys'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x19c1,0x1e9));var _0x119c=function(_0x4c643d,_0x4a51d0){_0x4c643d=_0x4c643d-0x0;var _0x430d0d=_0x19c1[_0x4c643d];return _0x430d0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x119c('0x0'));var zipdir=require(_0x119c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x119c('0x2'));var Mustache=require(_0x119c('0x3'));var util=require('util');var path=require(_0x119c('0x4'));var sox=require(_0x119c('0x5'));var csv=require(_0x119c('0x6'));var ejs=require(_0x119c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x119c('0x8'));var crypto=require('crypto');var jsforce=require(_0x119c('0x9'));var deskjs=require(_0x119c('0xa'));var toCsv=require(_0x119c('0x6'));var querystring=require(_0x119c('0xb'));var Papa=require(_0x119c('0xc'));var Redis=require(_0x119c('0xd'));var authService=require(_0x119c('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x119c('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x119c('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12ed01,_0x188ed2){_0x188ed2=_0x188ed2||0xcc;return function(_0x1e9650){if(_0x1e9650){return _0x12ed01[_0x119c('0x11')](_0x188ed2);}return _0x12ed01[_0x119c('0x12')](_0x188ed2)[_0x119c('0x13')]();};}function respondWithResult(_0x5e595e,_0x12535e){_0x12535e=_0x12535e||0xc8;return function(_0x4a228d){if(_0x4a228d){return _0x5e595e[_0x119c('0x12')](_0x12535e)[_0x119c('0x14')](_0x4a228d);}};}function respondWithFilteredResult(_0x3e16e2,_0x21576f){return function(_0x2942b7){if(_0x2942b7){var _0x432a85=typeof _0x21576f[_0x119c('0x15')]===_0x119c('0x16')&&typeof _0x21576f[_0x119c('0x17')]===_0x119c('0x16');var _0x341873=_0x2942b7[_0x119c('0x18')];var _0x412efd=_0x432a85?0x0:_0x21576f[_0x119c('0x15')];var _0x451ee8=_0x432a85?_0x2942b7[_0x119c('0x18')]:_0x21576f[_0x119c('0x15')]+_0x21576f[_0x119c('0x17')];var _0x2f48b8;if(_0x451ee8>=_0x341873){_0x451ee8=_0x341873;_0x2f48b8=0xc8;}else{_0x2f48b8=0xce;}_0x3e16e2['status'](_0x2f48b8);return _0x3e16e2[_0x119c('0x19')](_0x119c('0x1a'),_0x412efd+'-'+_0x451ee8+'/'+_0x341873)['json'](_0x2942b7);}return null;};}function patchUpdates(_0x551840){return function(_0x543376){try{jsonpatch[_0x119c('0x1b')](_0x543376,_0x551840,!![]);}catch(_0x1018ac){return BPromise[_0x119c('0x1c')](_0x1018ac);}return _0x543376['save']();};}function saveUpdates(_0x3011e2,_0x31504c){return function(_0x518c69){if(_0x518c69){return _0x518c69['update'](_0x3011e2)[_0x119c('0x1d')](function(_0x39fec4){return _0x39fec4;});}return null;};}function removeEntity(_0x356e1f,_0x2bae24){return function(_0x11312b){if(_0x11312b){return _0x11312b[_0x119c('0x1e')]()[_0x119c('0x1d')](function(){var _0x48d057=_0x11312b['get']({'plain':!![]});var _0x32bfa9='CmContactHasItems';return db[_0x119c('0x1f')]['destroy']({'where':{'type':_0x32bfa9,'resourceId':_0x48d057['id']}})[_0x119c('0x1d')](function(){return _0x11312b;});})[_0x119c('0x1d')](function(){_0x356e1f['status'](0xcc)[_0x119c('0x13')]();});}};}function handleEntityNotFound(_0x5c1fcf,_0x318dff){return function(_0x5c5db5){if(!_0x5c5db5){_0x5c1fcf['sendStatus'](0x194);}return _0x5c5db5;};}function handleError(_0x8568d2,_0x31ae18){_0x31ae18=_0x31ae18||0x1f4;return function(_0x2bf162){logger[_0x119c('0x20')](_0x2bf162[_0x119c('0x21')]);if(_0x2bf162[_0x119c('0x22')]){delete _0x2bf162[_0x119c('0x22')];}_0x8568d2['status'](_0x31ae18)[_0x119c('0x23')](_0x2bf162);};}exports['index']=function(_0x4b0399,_0x350d3d){var _0xdbdb04={},_0x1f6dbf={},_0x5c26b3={'count':0x0,'rows':[]};var _0x4cb5a2=_['map'](db[_0x119c('0x24')]['rawAttributes'],function(_0x35a229){return{'name':_0x35a229[_0x119c('0x25')],'type':_0x35a229[_0x119c('0x26')][_0x119c('0x27')]};});_0x1f6dbf[_0x119c('0x28')]=_[_0x119c('0x29')](_0x4cb5a2,_0x119c('0x22'));_0x1f6dbf['query']=_[_0x119c('0x2a')](_0x4b0399[_0x119c('0x2b')]);_0x1f6dbf[_0x119c('0x2c')]=_[_0x119c('0x2d')](_0x1f6dbf[_0x119c('0x28')],_0x1f6dbf[_0x119c('0x2b')]);_0xdbdb04[_0x119c('0x2e')]=_['intersection'](_0x1f6dbf['model'],qs[_0x119c('0x2f')](_0x4b0399[_0x119c('0x2b')][_0x119c('0x2f')]));_0xdbdb04[_0x119c('0x2e')]=_0xdbdb04[_0x119c('0x2e')][_0x119c('0x30')]?_0xdbdb04[_0x119c('0x2e')]:_0x1f6dbf[_0x119c('0x28')];if(!_0x4b0399[_0x119c('0x2b')][_0x119c('0x31')]('nolimit')){_0xdbdb04[_0x119c('0x17')]=qs[_0x119c('0x17')](_0x4b0399[_0x119c('0x2b')][_0x119c('0x17')]);_0xdbdb04[_0x119c('0x15')]=qs[_0x119c('0x15')](_0x4b0399[_0x119c('0x2b')][_0x119c('0x15')]);}_0xdbdb04[_0x119c('0x32')]=qs['sort'](_0x4b0399[_0x119c('0x2b')][_0x119c('0x33')]);_0xdbdb04[_0x119c('0x34')]=qs[_0x119c('0x2c')](_[_0x119c('0x35')](_0x4b0399[_0x119c('0x2b')],_0x1f6dbf[_0x119c('0x2c')]),_0x4cb5a2);if(_0x4b0399[_0x119c('0x2b')][_0x119c('0x36')]){_0xdbdb04[_0x119c('0x34')]=_[_0x119c('0x37')](_0xdbdb04[_0x119c('0x34')],{'$or':_[_0x119c('0x29')](_0x4cb5a2,function(_0x580240){if(_0x580240[_0x119c('0x26')]!==_0x119c('0x38')){var _0x2e74ae={};_0x2e74ae[_0x580240[_0x119c('0x22')]]={'$like':'%'+_0x4b0399[_0x119c('0x2b')][_0x119c('0x36')]+'%'};return _0x2e74ae;}})});}_0xdbdb04=_['merge']({},_0xdbdb04,_0x4b0399[_0x119c('0x39')]);var _0xc52d19={'where':_0xdbdb04['where']};return db[_0x119c('0x24')][_0x119c('0x18')](_0xc52d19)[_0x119c('0x1d')](function(_0x5760fc){_0x5c26b3[_0x119c('0x18')]=_0x5760fc;if(_0x4b0399['query']['includeAll']){_0xdbdb04[_0x119c('0x3a')]=[{'all':!![]}];}return db[_0x119c('0x24')][_0x119c('0x3b')](_0xdbdb04);})[_0x119c('0x1d')](function(_0x1db9e6){_0x5c26b3['rows']=_0x1db9e6;return _0x5c26b3;})[_0x119c('0x1d')](respondWithFilteredResult(_0x350d3d,_0xdbdb04))['catch'](handleError(_0x350d3d,null));};exports[_0x119c('0x3c')]=function(_0x2aed31,_0x4b4022){var _0xcf32fc={'raw':!![],'where':{'id':_0x2aed31['params']['id']}},_0x3401b4={};_0x3401b4['model']=_[_0x119c('0x2a')](db[_0x119c('0x24')][_0x119c('0x3d')]);_0x3401b4[_0x119c('0x2b')]=_[_0x119c('0x2a')](_0x2aed31['query']);_0x3401b4[_0x119c('0x2c')]=_['intersection'](_0x3401b4['model'],_0x3401b4[_0x119c('0x2b')]);_0xcf32fc['attributes']=_[_0x119c('0x2d')](_0x3401b4[_0x119c('0x28')],qs[_0x119c('0x2f')](_0x2aed31[_0x119c('0x2b')][_0x119c('0x2f')]));_0xcf32fc[_0x119c('0x2e')]=_0xcf32fc['attributes']['length']?_0xcf32fc['attributes']:_0x3401b4[_0x119c('0x28')];if(_0x2aed31[_0x119c('0x2b')][_0x119c('0x3e')]){_0xcf32fc['include']=[{'all':!![]}];}_0xcf32fc=_[_0x119c('0x37')]({},_0xcf32fc,_0x2aed31['options']);return db[_0x119c('0x24')][_0x119c('0x3f')](_0xcf32fc)[_0x119c('0x1d')](handleEntityNotFound(_0x4b4022,null))[_0x119c('0x1d')](respondWithResult(_0x4b4022,null))['catch'](handleError(_0x4b4022,null));};exports[_0x119c('0x40')]=function(_0x2f0d35,_0x47d588){return db[_0x119c('0x24')][_0x119c('0x40')](_0x2f0d35[_0x119c('0x41')],{})[_0x119c('0x1d')](function(_0xb46592){var _0x45ec8f=_0x2f0d35[_0x119c('0x42')][_0x119c('0x43')]({'plain':!![]});if(!_0x45ec8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45ec8f[_0x119c('0x44')]===_0x119c('0x42')){var _0xc5259e=_0xb46592[_0x119c('0x43')]({'plain':!![]});var _0x48af21=_0x119c('0x45');return db[_0x119c('0x46')][_0x119c('0x3f')]({'where':{'name':_0x48af21,'userProfileId':_0x45ec8f[_0x119c('0x47')]},'raw':!![]})[_0x119c('0x1d')](function(_0x2015eb){if(_0x2015eb&&_0x2015eb['autoAssociation']===0x0){return db[_0x119c('0x1f')]['create']({'name':_0xc5259e[_0x119c('0x22')],'resourceId':_0xc5259e['id'],'type':_0x2015eb['name'],'sectionId':_0x2015eb['id']},{})[_0x119c('0x1d')](function(){return _0xb46592;});}else{return _0xb46592;}})[_0x119c('0x48')](function(_0x9d78a){logger['error'](_0x119c('0x49'),_0x9d78a);throw _0x9d78a;});}return _0xb46592;})[_0x119c('0x1d')](respondWithResult(_0x47d588,0xc9))[_0x119c('0x48')](handleError(_0x47d588,null));};exports[_0x119c('0x4a')]=function(_0x557860,_0x41aea3){if(_0x557860[_0x119c('0x41')]['id']){delete _0x557860[_0x119c('0x41')]['id'];}return db['CmContactHasItem'][_0x119c('0x3f')]({'where':{'id':_0x557860[_0x119c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41aea3,null))[_0x119c('0x1d')](saveUpdates(_0x557860[_0x119c('0x41')],null))[_0x119c('0x1d')](respondWithResult(_0x41aea3,null))['catch'](handleError(_0x41aea3,null));};exports['destroy']=function(_0x21febb,_0xe3f42a){return db[_0x119c('0x24')][_0x119c('0x3f')]({'where':{'id':_0x21febb['params']['id']}})[_0x119c('0x1d')](handleEntityNotFound(_0xe3f42a,null))[_0x119c('0x1d')](removeEntity(_0xe3f42a,null))[_0x119c('0x48')](handleError(_0xe3f42a,null));};
\ No newline at end of file
+var _0x5bf8=['reject','save','then','destroy','CmContactHasItems','UserProfileResource','name','send','index','map','rawAttributes','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','CmContactHasItem','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','user','role','UserProfileSection','userProfileId','error','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x7ad6cb,_0xffee6c){var _0x22a0ba=function(_0x47f291){while(--_0x47f291){_0x7ad6cb['push'](_0x7ad6cb['shift']());}};_0x22a0ba(++_0xffee6c);}(_0x5bf8,0xce));var _0x85bf=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0x5bf8[_0x9b5bb2];return _0x2e1e92;};'use strict';var emlformat=require(_0x85bf('0x0'));var rimraf=require(_0x85bf('0x1'));var zipdir=require(_0x85bf('0x2'));var jsonpatch=require(_0x85bf('0x3'));var rp=require(_0x85bf('0x4'));var moment=require(_0x85bf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x85bf('0x6'));var util=require(_0x85bf('0x7'));var path=require(_0x85bf('0x8'));var sox=require(_0x85bf('0x9'));var csv=require(_0x85bf('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85bf('0xb'));var _=require(_0x85bf('0xc'));var squel=require('squel');var crypto=require(_0x85bf('0xd'));var jsforce=require(_0x85bf('0xe'));var deskjs=require(_0x85bf('0xf'));var toCsv=require(_0x85bf('0xa'));var querystring=require(_0x85bf('0x10'));var Papa=require('papaparse');var Redis=require(_0x85bf('0x11'));var authService=require(_0x85bf('0x12'));var qs=require(_0x85bf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85bf('0x14'))('api');var utils=require(_0x85bf('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x85bf('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54b5e3,_0x5266f7){_0x5266f7=_0x5266f7||0xcc;return function(_0x1b667e){if(_0x1b667e){return _0x54b5e3[_0x85bf('0x17')](_0x5266f7);}return _0x54b5e3[_0x85bf('0x18')](_0x5266f7)[_0x85bf('0x19')]();};}function respondWithResult(_0xbdc583,_0x23a098){_0x23a098=_0x23a098||0xc8;return function(_0x5a57fe){if(_0x5a57fe){return _0xbdc583[_0x85bf('0x18')](_0x23a098)[_0x85bf('0x1a')](_0x5a57fe);}};}function respondWithFilteredResult(_0x1b7cda,_0x1a808e){return function(_0x4156fa){if(_0x4156fa){var _0x38c6d2=typeof _0x1a808e[_0x85bf('0x1b')]===_0x85bf('0x1c')&&typeof _0x1a808e[_0x85bf('0x1d')]===_0x85bf('0x1c');var _0x53a2eb=_0x4156fa[_0x85bf('0x1e')];var _0x239554=_0x38c6d2?0x0:_0x1a808e['offset'];var _0x3ce9a1=_0x38c6d2?_0x4156fa[_0x85bf('0x1e')]:_0x1a808e['offset']+_0x1a808e['limit'];var _0x2a6ba3;if(_0x3ce9a1>=_0x53a2eb){_0x3ce9a1=_0x53a2eb;_0x2a6ba3=0xc8;}else{_0x2a6ba3=0xce;}_0x1b7cda['status'](_0x2a6ba3);return _0x1b7cda[_0x85bf('0x1f')](_0x85bf('0x20'),_0x239554+'-'+_0x3ce9a1+'/'+_0x53a2eb)[_0x85bf('0x1a')](_0x4156fa);}return null;};}function patchUpdates(_0x1bc94c){return function(_0x36c87b){try{jsonpatch[_0x85bf('0x21')](_0x36c87b,_0x1bc94c,!![]);}catch(_0x34442b){return BPromise[_0x85bf('0x22')](_0x34442b);}return _0x36c87b[_0x85bf('0x23')]();};}function saveUpdates(_0x125993,_0x56ea9c){return function(_0x101236){if(_0x101236){return _0x101236['update'](_0x125993)[_0x85bf('0x24')](function(_0x5b8543){return _0x5b8543;});}return null;};}function removeEntity(_0x5ae027,_0x13678f){return function(_0x13c8c2){if(_0x13c8c2){return _0x13c8c2[_0x85bf('0x25')]()[_0x85bf('0x24')](function(){var _0x2adb8f=_0x13c8c2['get']({'plain':!![]});var _0x189709=_0x85bf('0x26');return db[_0x85bf('0x27')][_0x85bf('0x25')]({'where':{'type':_0x189709,'resourceId':_0x2adb8f['id']}})[_0x85bf('0x24')](function(){return _0x13c8c2;});})[_0x85bf('0x24')](function(){_0x5ae027[_0x85bf('0x18')](0xcc)[_0x85bf('0x19')]();});}};}function handleEntityNotFound(_0x4c2ad5,_0x19ee50){return function(_0x16b946){if(!_0x16b946){_0x4c2ad5['sendStatus'](0x194);}return _0x16b946;};}function handleError(_0xae3877,_0x2ea63b){_0x2ea63b=_0x2ea63b||0x1f4;return function(_0x3abbf8){logger['error'](_0x3abbf8['stack']);if(_0x3abbf8[_0x85bf('0x28')]){delete _0x3abbf8[_0x85bf('0x28')];}_0xae3877[_0x85bf('0x18')](_0x2ea63b)[_0x85bf('0x29')](_0x3abbf8);};}exports[_0x85bf('0x2a')]=function(_0x526d51,_0x524cb7){var _0xdb52f4={},_0x18b007={},_0x21e5be={'count':0x0,'rows':[]};var _0x45235e=_[_0x85bf('0x2b')](db['CmContactHasItem'][_0x85bf('0x2c')],function(_0x2c1c59){return{'name':_0x2c1c59['fieldName'],'type':_0x2c1c59[_0x85bf('0x2d')][_0x85bf('0x2e')]};});_0x18b007[_0x85bf('0x2f')]=_[_0x85bf('0x2b')](_0x45235e,_0x85bf('0x28'));_0x18b007['query']=_['keys'](_0x526d51['query']);_0x18b007[_0x85bf('0x30')]=_[_0x85bf('0x31')](_0x18b007[_0x85bf('0x2f')],_0x18b007[_0x85bf('0x32')]);_0xdb52f4[_0x85bf('0x33')]=_[_0x85bf('0x31')](_0x18b007[_0x85bf('0x2f')],qs[_0x85bf('0x34')](_0x526d51[_0x85bf('0x32')][_0x85bf('0x34')]));_0xdb52f4[_0x85bf('0x33')]=_0xdb52f4[_0x85bf('0x33')]['length']?_0xdb52f4[_0x85bf('0x33')]:_0x18b007['model'];if(!_0x526d51['query'][_0x85bf('0x35')](_0x85bf('0x36'))){_0xdb52f4['limit']=qs[_0x85bf('0x1d')](_0x526d51['query'][_0x85bf('0x1d')]);_0xdb52f4[_0x85bf('0x1b')]=qs[_0x85bf('0x1b')](_0x526d51[_0x85bf('0x32')][_0x85bf('0x1b')]);}_0xdb52f4[_0x85bf('0x37')]=qs[_0x85bf('0x38')](_0x526d51[_0x85bf('0x32')][_0x85bf('0x38')]);_0xdb52f4[_0x85bf('0x39')]=qs[_0x85bf('0x30')](_['pick'](_0x526d51['query'],_0x18b007[_0x85bf('0x30')]),_0x45235e);if(_0x526d51[_0x85bf('0x32')]['filter']){_0xdb52f4['where']=_[_0x85bf('0x3a')](_0xdb52f4[_0x85bf('0x39')],{'$or':_[_0x85bf('0x2b')](_0x45235e,function(_0x302709){if(_0x302709[_0x85bf('0x2d')]!==_0x85bf('0x3b')){var _0x4c8ae3={};_0x4c8ae3[_0x302709[_0x85bf('0x28')]]={'$like':'%'+_0x526d51[_0x85bf('0x32')][_0x85bf('0x3c')]+'%'};return _0x4c8ae3;}})});}_0xdb52f4=_[_0x85bf('0x3a')]({},_0xdb52f4,_0x526d51[_0x85bf('0x3d')]);var _0x1b0990={'where':_0xdb52f4['where']};return db[_0x85bf('0x3e')][_0x85bf('0x1e')](_0x1b0990)[_0x85bf('0x24')](function(_0x7fe0c6){_0x21e5be[_0x85bf('0x1e')]=_0x7fe0c6;if(_0x526d51['query'][_0x85bf('0x3f')]){_0xdb52f4[_0x85bf('0x40')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x85bf('0x41')](_0xdb52f4);})[_0x85bf('0x24')](function(_0x5aaa7c){_0x21e5be[_0x85bf('0x42')]=_0x5aaa7c;return _0x21e5be;})[_0x85bf('0x24')](respondWithFilteredResult(_0x524cb7,_0xdb52f4))[_0x85bf('0x43')](handleError(_0x524cb7,null));};exports['show']=function(_0x13a859,_0x1d654a){var _0x604778={'raw':!![],'where':{'id':_0x13a859[_0x85bf('0x44')]['id']}},_0xfe6166={};_0xfe6166[_0x85bf('0x2f')]=_[_0x85bf('0x45')](db['CmContactHasItem']['rawAttributes']);_0xfe6166['query']=_[_0x85bf('0x45')](_0x13a859[_0x85bf('0x32')]);_0xfe6166['filters']=_[_0x85bf('0x31')](_0xfe6166[_0x85bf('0x2f')],_0xfe6166['query']);_0x604778['attributes']=_['intersection'](_0xfe6166[_0x85bf('0x2f')],qs[_0x85bf('0x34')](_0x13a859[_0x85bf('0x32')][_0x85bf('0x34')]));_0x604778[_0x85bf('0x33')]=_0x604778[_0x85bf('0x33')][_0x85bf('0x46')]?_0x604778[_0x85bf('0x33')]:_0xfe6166[_0x85bf('0x2f')];if(_0x13a859[_0x85bf('0x32')][_0x85bf('0x3f')]){_0x604778['include']=[{'all':!![]}];}_0x604778=_['merge']({},_0x604778,_0x13a859[_0x85bf('0x3d')]);return db[_0x85bf('0x3e')][_0x85bf('0x47')](_0x604778)[_0x85bf('0x24')](handleEntityNotFound(_0x1d654a,null))[_0x85bf('0x24')](respondWithResult(_0x1d654a,null))[_0x85bf('0x43')](handleError(_0x1d654a,null));};exports[_0x85bf('0x48')]=function(_0x5d1d37,_0x520f29){return db['CmContactHasItem'][_0x85bf('0x48')](_0x5d1d37[_0x85bf('0x49')],{})[_0x85bf('0x24')](function(_0x199a42){var _0x5bd7c8=_0x5d1d37[_0x85bf('0x4a')]['get']({'plain':!![]});if(!_0x5bd7c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5bd7c8[_0x85bf('0x4b')]===_0x85bf('0x4a')){var _0x529f57=_0x199a42['get']({'plain':!![]});var _0x50eccd='CmContactHasItems';return db[_0x85bf('0x4c')][_0x85bf('0x47')]({'where':{'name':_0x50eccd,'userProfileId':_0x5bd7c8[_0x85bf('0x4d')]},'raw':!![]})[_0x85bf('0x24')](function(_0x2b7974){if(_0x2b7974&&_0x2b7974['autoAssociation']===0x0){return db[_0x85bf('0x27')]['create']({'name':_0x529f57[_0x85bf('0x28')],'resourceId':_0x529f57['id'],'type':_0x2b7974[_0x85bf('0x28')],'sectionId':_0x2b7974['id']},{})[_0x85bf('0x24')](function(){return _0x199a42;});}else{return _0x199a42;}})['catch'](function(_0x570590){logger[_0x85bf('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x570590);throw _0x570590;});}return _0x199a42;})[_0x85bf('0x24')](respondWithResult(_0x520f29,0xc9))['catch'](handleError(_0x520f29,null));};exports[_0x85bf('0x4f')]=function(_0x1bae5e,_0x464543){if(_0x1bae5e[_0x85bf('0x49')]['id']){delete _0x1bae5e[_0x85bf('0x49')]['id'];}return db[_0x85bf('0x3e')][_0x85bf('0x47')]({'where':{'id':_0x1bae5e[_0x85bf('0x44')]['id']}})[_0x85bf('0x24')](handleEntityNotFound(_0x464543,null))['then'](saveUpdates(_0x1bae5e[_0x85bf('0x49')],null))[_0x85bf('0x24')](respondWithResult(_0x464543,null))[_0x85bf('0x43')](handleError(_0x464543,null));};exports[_0x85bf('0x25')]=function(_0x333fb2,_0x3b3bb4){return db[_0x85bf('0x3e')][_0x85bf('0x47')]({'where':{'id':_0x333fb2[_0x85bf('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b3bb4,null))[_0x85bf('0x24')](removeEntity(_0x3b3bb4,null))[_0x85bf('0x43')](handleError(_0x3b3bb4,null));};
\ No newline at end of file
index 42cb2c3..550f653 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa663=['define','CmContactHasItem','cm_contact_has_items','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmContactHasItem.attributes','exports'];(function(_0x38dbb5,_0x427be1){var _0x34bd46=function(_0x24056c){while(--_0x24056c){_0x38dbb5['push'](_0x38dbb5['shift']());}};_0x34bd46(++_0x427be1);}(_0xa663,0x9f));var _0x3a66=function(_0x2179e3,_0x3f7767){_0x2179e3=_0x2179e3-0x0;var _0x3a350b=_0xa663[_0x2179e3];return _0x3a350b;};'use strict';var _=require('lodash');var util=require(_0x3a66('0x0'));var logger=require(_0x3a66('0x1'))(_0x3a66('0x2'));var moment=require(_0x3a66('0x3'));var BPromise=require(_0x3a66('0x4'));var rp=require(_0x3a66('0x5'));var fs=require('fs');var path=require(_0x3a66('0x6'));var rimraf=require('rimraf');var config=require(_0x3a66('0x7'));var attributes=require(_0x3a66('0x8'));module[_0x3a66('0x9')]=function(_0x3f7ba1,_0x3424a5){return _0x3f7ba1[_0x3a66('0xa')](_0x3a66('0xb'),attributes,{'tableName':_0x3a66('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x248e=['path','rimraf','./cmContactHasItem.attributes','define','cm_contact_has_items','util','../../config/logger','api','moment','request-promise'];(function(_0x39f59e,_0x36b9cf){var _0x54f7a5=function(_0x342855){while(--_0x342855){_0x39f59e['push'](_0x39f59e['shift']());}};_0x54f7a5(++_0x36b9cf);}(_0x248e,0xc3));var _0xe248=function(_0x13d85b,_0x16a963){_0x13d85b=_0x13d85b-0x0;var _0x56e679=_0x248e[_0x13d85b];return _0x56e679;};'use strict';var _=require('lodash');var util=require(_0xe248('0x0'));var logger=require(_0xe248('0x1'))(_0xe248('0x2'));var moment=require(_0xe248('0x3'));var BPromise=require('bluebird');var rp=require(_0xe248('0x4'));var fs=require('fs');var path=require(_0xe248('0x5'));var rimraf=require(_0xe248('0x6'));var config=require('../../config/environment');var attributes=require(_0xe248('0x7'));module['exports']=function(_0xbd8ae7,_0x36b0df){return _0xbd8ae7[_0xe248('0x8')]('CmContactHasItem',attributes,{'tableName':_0xe248('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bf779c7..3f42858 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1dc=['message','result','lodash','bluebird','../../config/utils','../../config/environment','client','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x363842,_0x369636){var _0x257bc2=function(_0x2516cf){while(--_0x2516cf){_0x363842['push'](_0x363842['shift']());}};_0x257bc2(++_0x369636);}(_0xf1dc,0x19a));var _0xcf1d=function(_0x2de43d,_0x4c5cb5){_0x2de43d=_0x2de43d-0x0;var _0x611457=_0xf1dc[_0x2de43d];return _0x611457;};'use strict';var _=require(_0xcf1d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf1d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcf1d('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf1d('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xcf1d('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23a182,_0x1a1a85,_0x1ac5d9){return new BPromise(function(_0x1c9783,_0x5e9b7f){return client[_0xcf1d('0x5')](_0x23a182,_0x1ac5d9)[_0xcf1d('0x6')](function(_0x11d718){logger[_0xcf1d('0x7')](_0xcf1d('0x8'),_0x1a1a85,_0xcf1d('0x9'));logger[_0xcf1d('0xa')](_0xcf1d('0xb'),_0x1a1a85,'request\x20sent',JSON[_0xcf1d('0xc')](_0x11d718));if(_0x11d718[_0xcf1d('0xd')]){if(_0x11d718[_0xcf1d('0xd')][_0xcf1d('0xe')]===0x1f4){logger[_0xcf1d('0xd')](_0xcf1d('0x8'),_0x1a1a85,_0x11d718['error']['message']);return _0x5e9b7f(_0x11d718[_0xcf1d('0xd')][_0xcf1d('0xf')]);}logger['error'](_0xcf1d('0x8'),_0x1a1a85,_0x11d718['error'][_0xcf1d('0xf')]);return _0x1c9783(_0x11d718[_0xcf1d('0xd')][_0xcf1d('0xf')]);}else{logger[_0xcf1d('0x7')]('CmContactHasItem,\x20%s,\x20%s',_0x1a1a85,_0xcf1d('0x9'));_0x1c9783(_0x11d718[_0xcf1d('0x10')][_0xcf1d('0xf')]);}})['catch'](function(_0x496f02){logger['error'](_0xcf1d('0x8'),_0x1a1a85,_0x496f02);_0x5e9b7f(_0x496f02);});});}
\ No newline at end of file
+var _0xe526=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird'];(function(_0x43246d,_0x472d31){var _0x3fd15d=function(_0x3782f4){while(--_0x3782f4){_0x43246d['push'](_0x43246d['shift']());}};_0x3fd15d(++_0x472d31);}(_0xe526,0xe4));var _0x6e52=function(_0x434544,_0x12b511){_0x434544=_0x434544-0x0;var _0x3f039e=_0xe526[_0x434544];return _0x3f039e;};'use strict';var _=require('lodash');var util=require(_0x6e52('0x0'));var moment=require(_0x6e52('0x1'));var BPromise=require(_0x6e52('0x2'));var rs=require(_0x6e52('0x3'));var fs=require('fs');var Redis=require(_0x6e52('0x4'));var db=require(_0x6e52('0x5'))['db'];var utils=require(_0x6e52('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6e52('0x7'));var jayson=require(_0x6e52('0x8'));var client=jayson[_0x6e52('0x9')][_0x6e52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d0ebb,_0x5862dc,_0x1d3ef0){return new BPromise(function(_0xf130a5,_0x24e7d8){return client[_0x6e52('0xb')](_0x2d0ebb,_0x1d3ef0)[_0x6e52('0xc')](function(_0x2963d6){logger[_0x6e52('0xd')](_0x6e52('0xe'),_0x5862dc,_0x6e52('0xf'));logger[_0x6e52('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x5862dc,_0x6e52('0xf'),JSON[_0x6e52('0x11')](_0x2963d6));if(_0x2963d6[_0x6e52('0x12')]){if(_0x2963d6[_0x6e52('0x12')]['code']===0x1f4){logger['error'](_0x6e52('0xe'),_0x5862dc,_0x2963d6[_0x6e52('0x12')]['message']);return _0x24e7d8(_0x2963d6['error'][_0x6e52('0x13')]);}logger[_0x6e52('0x12')](_0x6e52('0xe'),_0x5862dc,_0x2963d6[_0x6e52('0x12')][_0x6e52('0x13')]);return _0xf130a5(_0x2963d6['error'][_0x6e52('0x13')]);}else{logger[_0x6e52('0xd')](_0x6e52('0xe'),_0x5862dc,_0x6e52('0xf'));_0xf130a5(_0x2963d6['result']['message']);}})[_0x6e52('0x14')](function(_0x2d8da3){logger[_0x6e52('0x12')](_0x6e52('0xe'),_0x5862dc,_0x2d8da3);_0x24e7d8(_0x2d8da3);});});}
\ No newline at end of file
index 5d936f8..4ba819e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c8b=['post','create','put','update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x3aeb92,_0x2c6c49){var _0x173af0=function(_0x249b10){while(--_0x249b10){_0x3aeb92['push'](_0x3aeb92['shift']());}};_0x173af0(++_0x2c6c49);}(_0x3c8b,0x19d));var _0xb3c8=function(_0x3f5941,_0x5438fe){_0x3f5941=_0x3f5941-0x0;var _0x44f39a=_0x3c8b[_0x3f5941];return _0x44f39a;};'use strict';var multer=require(_0xb3c8('0x0'));var util=require(_0xb3c8('0x1'));var path=require(_0xb3c8('0x2'));var timeout=require('connect-timeout');var express=require(_0xb3c8('0x3'));var router=express[_0xb3c8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb3c8('0x5'));var interaction=require(_0xb3c8('0x6'));var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0xb3c8('0x7')]('/',auth[_0xb3c8('0x8')](),controller[_0xb3c8('0x9')]);router['get'](_0xb3c8('0xa'),auth[_0xb3c8('0x8')](),controller[_0xb3c8('0xb')]);router[_0xb3c8('0xc')]('/',auth['isAuthenticated'](),controller[_0xb3c8('0xd')]);router[_0xb3c8('0xe')](_0xb3c8('0xa'),auth['isAuthenticated'](),controller[_0xb3c8('0xf')]);router[_0xb3c8('0x10')](_0xb3c8('0xa'),auth[_0xb3c8('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4a7d=['../../components/auth/service','../../config/environment','./cmContactHasItem.controller','index','/:id','isAuthenticated','show','post','create','put','update','multer','util','path','express','Router','fs-extra'];(function(_0x579c5b,_0x39e023){var _0x2f6eb1=function(_0x532a6){while(--_0x532a6){_0x579c5b['push'](_0x579c5b['shift']());}};_0x2f6eb1(++_0x39e023);}(_0x4a7d,0xe8));var _0xd4a7=function(_0x47872c,_0x8fc111){_0x47872c=_0x47872c-0x0;var _0x266863=_0x4a7d[_0x47872c];return _0x266863;};'use strict';var multer=require(_0xd4a7('0x0'));var util=require(_0xd4a7('0x1'));var path=require(_0xd4a7('0x2'));var timeout=require('connect-timeout');var express=require(_0xd4a7('0x3'));var router=express[_0xd4a7('0x4')]();var fs_extra=require(_0xd4a7('0x5'));var auth=require(_0xd4a7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd4a7('0x7'));var controller=require(_0xd4a7('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd4a7('0x9')]);router['get'](_0xd4a7('0xa'),auth[_0xd4a7('0xb')](),controller[_0xd4a7('0xc')]);router[_0xd4a7('0xd')]('/',auth[_0xd4a7('0xb')](),controller[_0xd4a7('0xe')]);router[_0xd4a7('0xf')](_0xd4a7('0xa'),auth[_0xd4a7('0xb')](),controller[_0xd4a7('0x10')]);router['delete']('/:id',auth[_0xd4a7('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index f2a8ef4..c1a4344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e28=['name','TEXT','select','parse','values','isArray','setDataValue','BOOLEAN','ENUM','voice','sequelize','lodash','exports','alias','STRING','getDataValue'];(function(_0x3413cb,_0x2e14ea){var _0x3695cc=function(_0x19557e){while(--_0x19557e){_0x3413cb['push'](_0x3413cb['shift']());}};_0x3695cc(++_0x2e14ea);}(_0x2e28,0x11a));var _0x82e2=function(_0x16920b,_0x36b4f6){_0x16920b=_0x16920b-0x0;var _0x86c33a=_0x2e28[_0x16920b];return _0x86c33a;};'use strict';var Sequelize=require(_0x82e2('0x0'));var _=require(_0x82e2('0x1'));module[_0x82e2('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1fd674){return this['getDataValue'](_0x82e2('0x3'));}},'alias':{'type':Sequelize[_0x82e2('0x4')],'allowNull':![],'set':function(_0x35b333){this['setDataValue'](_0x82e2('0x3'),_0x35b333?_0x35b333:this[_0x82e2('0x5')](_0x82e2('0x6')));}},'type':{'type':Sequelize[_0x82e2('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x82e2('0x7')]('long'),'get':function(){if(this[_0x82e2('0x5')]('type')===_0x82e2('0x8')){return JSON[_0x82e2('0x9')](this[_0x82e2('0x5')](_0x82e2('0xa')));}else{return this[_0x82e2('0x5')]('values');}},'set':function(_0x3e99f4){if(Array[_0x82e2('0xb')](_0x3e99f4)){this['setDataValue']('values',JSON['stringify'](_0x3e99f4));}else{this[_0x82e2('0xc')](_0x82e2('0xa'),_0x3e99f4);}}},'required':{'type':Sequelize[_0x82e2('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x82e2('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x82e2('0xe')](_0x82e2('0xf'))}};
\ No newline at end of file
+var _0x4f68=['name','TEXT','long','parse','getDataValue','values','stringify','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL','STRING','setDataValue'];(function(_0x1c22ac,_0x4c86bd){var _0x4c867a=function(_0x370c7d){while(--_0x370c7d){_0x1c22ac['push'](_0x1c22ac['shift']());}};_0x4c867a(++_0x4c86bd);}(_0x4f68,0xf9));var _0x84f6=function(_0x46a30a,_0x6aa2a6){_0x46a30a=_0x46a30a-0x0;var _0x3328b3=_0x4f68[_0x46a30a];return _0x3328b3;};'use strict';var Sequelize=require(_0x84f6('0x0'));var _=require(_0x84f6('0x1'));module[_0x84f6('0x2')]={'name':{'type':Sequelize[_0x84f6('0x3')],'get':function(_0x2d83d1){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x84f6('0x4')],'allowNull':![],'set':function(_0x342791){this[_0x84f6('0x5')]('alias',_0x342791?_0x342791:this['getDataValue'](_0x84f6('0x6')));}},'type':{'type':Sequelize[_0x84f6('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x84f6('0x7')](_0x84f6('0x8')),'get':function(){if(this['getDataValue']('type')==='select'){return JSON[_0x84f6('0x9')](this[_0x84f6('0xa')]('values'));}else{return this['getDataValue']('values');}},'set':function(_0x3b2421){if(Array['isArray'](_0x3b2421)){this[_0x84f6('0x5')](_0x84f6('0xb'),JSON[_0x84f6('0xc')](_0x3b2421));}else{this['setDataValue']('values',_0x3b2421);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x84f6('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x84f6('0xe'))}};
\ No newline at end of file
index 6a1f25d..1474af2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d8c=['Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','CmCustomField','rows','catch','show','params','find','body','create','sequelize'];(function(_0xf72786,_0x1a0ddd){var _0x113f3e=function(_0x57337a){while(--_0x57337a){_0xf72786['push'](_0xf72786['shift']());}};_0x113f3e(++_0x1a0ddd);}(_0x1d8c,0x1ae));var _0xc1d8=function(_0x7bcce,_0x275edf){_0x7bcce=_0x7bcce-0x0;var _0x1e80b4=_0x1d8c[_0x7bcce];return _0x1e80b4;};'use strict';var emlformat=require(_0xc1d8('0x0'));var rimraf=require(_0xc1d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1d8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc1d8('0x3'));var util=require(_0xc1d8('0x4'));var path=require(_0xc1d8('0x5'));var sox=require(_0xc1d8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1d8('0x7'));var _=require(_0xc1d8('0x8'));var squel=require('squel');var crypto=require(_0xc1d8('0x9'));var jsforce=require(_0xc1d8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc1d8('0xb'));var querystring=require(_0xc1d8('0xc'));var Papa=require(_0xc1d8('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc1d8('0xe'));var as=require(_0xc1d8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1d8('0x10'))(_0xc1d8('0x11'));var utils=require(_0xc1d8('0x12'));var config=require(_0xc1d8('0x13'));var licenseUtil=require(_0xc1d8('0x14'));var db=require(_0xc1d8('0x15'))['db'];function respondWithStatusCode(_0x2720ed,_0x373f6e){_0x373f6e=_0x373f6e||0xcc;return function(_0x2bdcc1){if(_0x2bdcc1){return _0x2720ed[_0xc1d8('0x16')](_0x373f6e);}return _0x2720ed[_0xc1d8('0x17')](_0x373f6e)[_0xc1d8('0x18')]();};}function respondWithResult(_0x1373fc,_0x2506fc){_0x2506fc=_0x2506fc||0xc8;return function(_0x4a7e9b){if(_0x4a7e9b){return _0x1373fc[_0xc1d8('0x17')](_0x2506fc)[_0xc1d8('0x19')](_0x4a7e9b);}};}function respondWithFilteredResult(_0x427f73,_0x5a57e8){return function(_0x6d2932){if(_0x6d2932){var _0x29294a=typeof _0x5a57e8[_0xc1d8('0x1a')]===_0xc1d8('0x1b')&&typeof _0x5a57e8[_0xc1d8('0x1c')]==='undefined';var _0x4e79ad=_0x6d2932[_0xc1d8('0x1d')];var _0x301274=_0x29294a?0x0:_0x5a57e8[_0xc1d8('0x1a')];var _0x20825c=_0x29294a?_0x6d2932['count']:_0x5a57e8['offset']+_0x5a57e8[_0xc1d8('0x1c')];var _0x5d424a;if(_0x20825c>=_0x4e79ad){_0x20825c=_0x4e79ad;_0x5d424a=0xc8;}else{_0x5d424a=0xce;}_0x427f73[_0xc1d8('0x17')](_0x5d424a);return _0x427f73[_0xc1d8('0x1e')](_0xc1d8('0x1f'),_0x301274+'-'+_0x20825c+'/'+_0x4e79ad)[_0xc1d8('0x19')](_0x6d2932);}return null;};}function patchUpdates(_0x20bd94){return function(_0x246f4b){try{jsonpatch[_0xc1d8('0x20')](_0x246f4b,_0x20bd94,!![]);}catch(_0x33b885){return BPromise[_0xc1d8('0x21')](_0x33b885);}return _0x246f4b[_0xc1d8('0x22')]();};}function saveUpdates(_0x598dd4,_0x244a5d){return function(_0x4d8a37){if(_0x4d8a37){return _0x4d8a37[_0xc1d8('0x23')](_0x598dd4)[_0xc1d8('0x24')](function(_0x33770e){return _0x33770e;});}return null;};}function removeEntity(_0x34c1f3,_0x499816){return function(_0x49f1f8){if(_0x49f1f8){return _0x49f1f8[_0xc1d8('0x25')]()['then'](function(){_0x34c1f3[_0xc1d8('0x17')](0xcc)[_0xc1d8('0x18')]();});}};}function handleEntityNotFound(_0x4eaf70,_0x33e9d7){return function(_0x4b82fc){if(!_0x4b82fc){_0x4eaf70['sendStatus'](0x194);}return _0x4b82fc;};}function handleError(_0x58d96a,_0x2d2c35){_0x2d2c35=_0x2d2c35||0x1f4;return function(_0x13ecbc){logger[_0xc1d8('0x26')](_0x13ecbc['stack']);if(_0x13ecbc[_0xc1d8('0x27')]){delete _0x13ecbc['name'];}_0x58d96a['status'](_0x2d2c35)['send'](_0x13ecbc);};}exports[_0xc1d8('0x28')]=function(_0x39f385,_0x251b7b){var _0x520cf7={},_0x51b832={},_0x34aeba={'count':0x0,'rows':[]};var _0xf35ac3=_[_0xc1d8('0x29')](db['CmCustomField'][_0xc1d8('0x2a')],function(_0x44fe6c){return{'name':_0x44fe6c[_0xc1d8('0x2b')],'type':_0x44fe6c[_0xc1d8('0x2c')]['key']};});_0x51b832[_0xc1d8('0x2d')]=_['differenceBy'](_['map'](_0xf35ac3,'name'),[_0xc1d8('0x27')]);_0x51b832[_0xc1d8('0x2e')]=_[_0xc1d8('0x2f')](_0x39f385['query']);_0x51b832[_0xc1d8('0x30')]=_[_0xc1d8('0x31')](_0x51b832[_0xc1d8('0x2d')],_0x51b832[_0xc1d8('0x2e')]);_0x520cf7[_0xc1d8('0x32')]=_[_0xc1d8('0x31')](_0x51b832['model'],qs[_0xc1d8('0x33')](_0x39f385[_0xc1d8('0x2e')][_0xc1d8('0x33')]));_0x520cf7['attributes']=_0x520cf7[_0xc1d8('0x32')][_0xc1d8('0x34')]?_0x520cf7[_0xc1d8('0x32')]:_0x51b832[_0xc1d8('0x2d')];if(!_0x39f385[_0xc1d8('0x2e')][_0xc1d8('0x35')](_0xc1d8('0x36'))){_0x520cf7[_0xc1d8('0x1c')]=qs['limit'](_0x39f385[_0xc1d8('0x2e')]['limit']);_0x520cf7[_0xc1d8('0x1a')]=qs[_0xc1d8('0x1a')](_0x39f385[_0xc1d8('0x2e')]['offset']);}_0x520cf7[_0xc1d8('0x37')]=qs[_0xc1d8('0x38')](_0x39f385[_0xc1d8('0x2e')][_0xc1d8('0x38')]);_0x520cf7['where']=qs[_0xc1d8('0x30')](_[_0xc1d8('0x39')](_0x39f385[_0xc1d8('0x2e')],_0x51b832[_0xc1d8('0x30')]),_0xf35ac3);if(_0x39f385[_0xc1d8('0x2e')][_0xc1d8('0x3a')]){_0x520cf7[_0xc1d8('0x3b')]=_[_0xc1d8('0x3c')](_0x520cf7[_0xc1d8('0x3b')],{'$or':_[_0xc1d8('0x29')](_0xf35ac3,function(_0x2c335c){if(_0x2c335c[_0xc1d8('0x2c')]!==_0xc1d8('0x3d')){var _0x49fbbd={};_0x49fbbd[_0x2c335c[_0xc1d8('0x27')]]={'$like':'%'+_0x39f385[_0xc1d8('0x2e')]['filter']+'%'};return _0x49fbbd;}})});}_0x520cf7=_[_0xc1d8('0x3c')]({},_0x520cf7,_0x39f385[_0xc1d8('0x3e')]);var _0x2fc3c6={'where':_0x520cf7[_0xc1d8('0x3b')]};return db['CmCustomField'][_0xc1d8('0x1d')](_0x2fc3c6)[_0xc1d8('0x24')](function(_0x40e5ac){_0x34aeba['count']=_0x40e5ac;if(_0x39f385[_0xc1d8('0x2e')][_0xc1d8('0x3f')]){_0x520cf7[_0xc1d8('0x40')]=[{'all':!![]}];}return db[_0xc1d8('0x41')]['findAll'](_0x520cf7);})['then'](function(_0x4f6c8f){_0x34aeba[_0xc1d8('0x42')]=_0x4f6c8f;return _0x34aeba;})[_0xc1d8('0x24')](respondWithFilteredResult(_0x251b7b,_0x520cf7))[_0xc1d8('0x43')](handleError(_0x251b7b,null));};exports[_0xc1d8('0x44')]=function(_0x2b2210,_0x4a1990){var _0x3a1087={'raw':!![],'where':{'id':_0x2b2210[_0xc1d8('0x45')]['id']}},_0x46a00b={};_0x46a00b['model']=_['keys'](db[_0xc1d8('0x41')]['rawAttributes']);_0x46a00b[_0xc1d8('0x2e')]=_['keys'](_0x2b2210[_0xc1d8('0x2e')]);_0x46a00b[_0xc1d8('0x30')]=_[_0xc1d8('0x31')](_0x46a00b['model'],_0x46a00b[_0xc1d8('0x2e')]);_0x3a1087[_0xc1d8('0x32')]=_[_0xc1d8('0x31')](_0x46a00b[_0xc1d8('0x2d')],qs[_0xc1d8('0x33')](_0x2b2210['query'][_0xc1d8('0x33')]));_0x3a1087['attributes']=_0x3a1087[_0xc1d8('0x32')]['length']?_0x3a1087[_0xc1d8('0x32')]:_0x46a00b[_0xc1d8('0x2d')];if(_0x2b2210[_0xc1d8('0x2e')][_0xc1d8('0x3f')]){_0x3a1087[_0xc1d8('0x40')]=[{'all':!![]}];}_0x3a1087=_['merge']({},_0x3a1087,_0x2b2210['options']);return db[_0xc1d8('0x41')][_0xc1d8('0x46')](_0x3a1087)['then'](handleEntityNotFound(_0x4a1990,null))['then'](respondWithResult(_0x4a1990,null))[_0xc1d8('0x43')](handleError(_0x4a1990,null));};exports[_0xc1d8('0x23')]=function(_0x40aa7d,_0x5c2687){if(_0x40aa7d[_0xc1d8('0x47')]['id']){delete _0x40aa7d[_0xc1d8('0x47')]['id'];}return db[_0xc1d8('0x41')]['find']({'where':{'id':_0x40aa7d['params']['id']}})[_0xc1d8('0x24')](handleEntityNotFound(_0x5c2687,null))[_0xc1d8('0x24')](saveUpdates(_0x40aa7d[_0xc1d8('0x47')],null))['then'](respondWithResult(_0x5c2687,null))[_0xc1d8('0x43')](handleError(_0x5c2687,null));};exports['destroy']=function(_0x16a57b,_0xd923fd){return db[_0xc1d8('0x41')][_0xc1d8('0x46')]({'where':{'id':_0x16a57b[_0xc1d8('0x45')]['id']}})[_0xc1d8('0x24')](handleEntityNotFound(_0xd923fd,null))['then'](removeEntity(_0xd923fd,null))[_0xc1d8('0x43')](handleError(_0xd923fd,null));};exports[_0xc1d8('0x48')]=function(_0x1eb2e3,_0x5c2adc){var _0xfdb3e;return db[_0xc1d8('0x49')]['transaction'](function(_0x1ba130){return db[_0xc1d8('0x41')][_0xc1d8('0x48')](_0x1eb2e3[_0xc1d8('0x47')],{'transaction':_0x1ba130})['then'](function(_0x1fc7ef){_0xfdb3e=_0x1fc7ef;var _0x4fa718={'type':db[_0xc1d8('0x4a')][_0xc1d8('0x4b')],'transaction':_0x1ba130};switch(_0x1eb2e3[_0xc1d8('0x47')][_0xc1d8('0x2c')]){case _0xc1d8('0x4c'):_0x4fa718[_0xc1d8('0x2c')]=db[_0xc1d8('0x4a')][_0xc1d8('0x4b')];break;case _0xc1d8('0x4d'):_0x4fa718[_0xc1d8('0x2c')]=db[_0xc1d8('0x4a')][_0xc1d8('0x4e')];break;case'switch':_0x4fa718[_0xc1d8('0x2c')]=db[_0xc1d8('0x4a')][_0xc1d8('0x4f')];_0x4fa718['defaultValue']=![];break;default:}return db[_0xc1d8('0x49')][_0xc1d8('0x50')][_0xc1d8('0x51')](_0xc1d8('0x52'),util['format'](_0xc1d8('0x53'),_0xfdb3e['id']),_0x4fa718);})['then'](function(){return _0xfdb3e;});})[_0xc1d8('0x24')](respondWithResult(_0x5c2adc,0xc9))[_0xc1d8('0x43')](handleError(_0x5c2adc,null));};
\ No newline at end of file
+var _0x9deb=['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','limit','count','Content-Range','reject','save','update','then','error','stack','send','rawAttributes','fieldName','type','model','differenceBy','map','name','query','keys','filters','intersection','attributes','fields','length','nolimit','where','merge','VIRTUAL','filter','options','CmCustomField','includeAll','include','findAll','catch','show','params','find','body','create','sequelize','transaction','Sequelize','TEXT','number','BOOLEAN','queryInterface','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9deb,0xdf));var _0xb9de=function(_0x56c65b,_0x234be9){_0x56c65b=_0x56c65b-0x0;var _0x54d3f2=_0x9deb[_0x56c65b];return _0x54d3f2;};'use strict';var emlformat=require(_0xb9de('0x0'));var rimraf=require(_0xb9de('0x1'));var zipdir=require(_0xb9de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9de('0x3'));var moment=require(_0xb9de('0x4'));var BPromise=require(_0xb9de('0x5'));var Mustache=require(_0xb9de('0x6'));var util=require(_0xb9de('0x7'));var path=require('path');var sox=require(_0xb9de('0x8'));var csv=require(_0xb9de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9de('0xa'));var _=require(_0xb9de('0xb'));var squel=require('squel');var crypto=require(_0xb9de('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb9de('0xd'));var toCsv=require(_0xb9de('0x9'));var querystring=require('querystring');var Papa=require(_0xb9de('0xe'));var Redis=require(_0xb9de('0xf'));var authService=require(_0xb9de('0x10'));var qs=require(_0xb9de('0x11'));var as=require(_0xb9de('0x12'));var hardwareService=require(_0xb9de('0x13'));var logger=require(_0xb9de('0x14'))(_0xb9de('0x15'));var utils=require(_0xb9de('0x16'));var config=require(_0xb9de('0x17'));var licenseUtil=require(_0xb9de('0x18'));var db=require(_0xb9de('0x19'))['db'];function respondWithStatusCode(_0x47843a,_0x271efc){_0x271efc=_0x271efc||0xcc;return function(_0x57af46){if(_0x57af46){return _0x47843a['sendStatus'](_0x271efc);}return _0x47843a[_0xb9de('0x1a')](_0x271efc)[_0xb9de('0x1b')]();};}function respondWithResult(_0x5cb1a2,_0x246979){_0x246979=_0x246979||0xc8;return function(_0x5b1a73){if(_0x5b1a73){return _0x5cb1a2['status'](_0x246979)[_0xb9de('0x1c')](_0x5b1a73);}};}function respondWithFilteredResult(_0x5490fe,_0x3566ca){return function(_0xb62748){if(_0xb62748){var _0x13d1a5=typeof _0x3566ca[_0xb9de('0x1d')]==='undefined'&&typeof _0x3566ca[_0xb9de('0x1e')]==='undefined';var _0x55650f=_0xb62748[_0xb9de('0x1f')];var _0x41e462=_0x13d1a5?0x0:_0x3566ca['offset'];var _0x39b9e4=_0x13d1a5?_0xb62748[_0xb9de('0x1f')]:_0x3566ca[_0xb9de('0x1d')]+_0x3566ca[_0xb9de('0x1e')];var _0x3a072d;if(_0x39b9e4>=_0x55650f){_0x39b9e4=_0x55650f;_0x3a072d=0xc8;}else{_0x3a072d=0xce;}_0x5490fe['status'](_0x3a072d);return _0x5490fe['set'](_0xb9de('0x20'),_0x41e462+'-'+_0x39b9e4+'/'+_0x55650f)['json'](_0xb62748);}return null;};}function patchUpdates(_0x5d8051){return function(_0xb31dd8){try{jsonpatch['apply'](_0xb31dd8,_0x5d8051,!![]);}catch(_0x255b68){return BPromise[_0xb9de('0x21')](_0x255b68);}return _0xb31dd8[_0xb9de('0x22')]();};}function saveUpdates(_0x479ddf,_0x411341){return function(_0x26f5ba){if(_0x26f5ba){return _0x26f5ba[_0xb9de('0x23')](_0x479ddf)[_0xb9de('0x24')](function(_0x67f8b0){return _0x67f8b0;});}return null;};}function removeEntity(_0x5906b7,_0x869ad1){return function(_0x1285f2){if(_0x1285f2){return _0x1285f2['destroy']()['then'](function(){_0x5906b7[_0xb9de('0x1a')](0xcc)[_0xb9de('0x1b')]();});}};}function handleEntityNotFound(_0x3fd386,_0x1bf048){return function(_0x1540f8){if(!_0x1540f8){_0x3fd386['sendStatus'](0x194);}return _0x1540f8;};}function handleError(_0x5270a4,_0x59de8f){_0x59de8f=_0x59de8f||0x1f4;return function(_0x5911de){logger[_0xb9de('0x25')](_0x5911de[_0xb9de('0x26')]);if(_0x5911de['name']){delete _0x5911de['name'];}_0x5270a4[_0xb9de('0x1a')](_0x59de8f)[_0xb9de('0x27')](_0x5911de);};}exports['index']=function(_0x17a694,_0x3787d1){var _0x34a766={},_0x524550={},_0x28ec62={'count':0x0,'rows':[]};var _0x22290c=_['map'](db['CmCustomField'][_0xb9de('0x28')],function(_0x2cbda9){return{'name':_0x2cbda9[_0xb9de('0x29')],'type':_0x2cbda9[_0xb9de('0x2a')]['key']};});_0x524550[_0xb9de('0x2b')]=_[_0xb9de('0x2c')](_[_0xb9de('0x2d')](_0x22290c,'name'),[_0xb9de('0x2e')]);_0x524550[_0xb9de('0x2f')]=_[_0xb9de('0x30')](_0x17a694[_0xb9de('0x2f')]);_0x524550[_0xb9de('0x31')]=_[_0xb9de('0x32')](_0x524550[_0xb9de('0x2b')],_0x524550[_0xb9de('0x2f')]);_0x34a766[_0xb9de('0x33')]=_[_0xb9de('0x32')](_0x524550[_0xb9de('0x2b')],qs[_0xb9de('0x34')](_0x17a694[_0xb9de('0x2f')][_0xb9de('0x34')]));_0x34a766[_0xb9de('0x33')]=_0x34a766[_0xb9de('0x33')][_0xb9de('0x35')]?_0x34a766[_0xb9de('0x33')]:_0x524550[_0xb9de('0x2b')];if(!_0x17a694[_0xb9de('0x2f')]['hasOwnProperty'](_0xb9de('0x36'))){_0x34a766[_0xb9de('0x1e')]=qs[_0xb9de('0x1e')](_0x17a694['query'][_0xb9de('0x1e')]);_0x34a766[_0xb9de('0x1d')]=qs['offset'](_0x17a694[_0xb9de('0x2f')]['offset']);}_0x34a766['order']=qs['sort'](_0x17a694[_0xb9de('0x2f')]['sort']);_0x34a766[_0xb9de('0x37')]=qs[_0xb9de('0x31')](_['pick'](_0x17a694[_0xb9de('0x2f')],_0x524550[_0xb9de('0x31')]),_0x22290c);if(_0x17a694[_0xb9de('0x2f')]['filter']){_0x34a766[_0xb9de('0x37')]=_[_0xb9de('0x38')](_0x34a766[_0xb9de('0x37')],{'$or':_[_0xb9de('0x2d')](_0x22290c,function(_0x346b8d){if(_0x346b8d[_0xb9de('0x2a')]!==_0xb9de('0x39')){var _0x11c6c6={};_0x11c6c6[_0x346b8d['name']]={'$like':'%'+_0x17a694['query'][_0xb9de('0x3a')]+'%'};return _0x11c6c6;}})});}_0x34a766=_[_0xb9de('0x38')]({},_0x34a766,_0x17a694[_0xb9de('0x3b')]);var _0x144f32={'where':_0x34a766[_0xb9de('0x37')]};return db[_0xb9de('0x3c')][_0xb9de('0x1f')](_0x144f32)[_0xb9de('0x24')](function(_0x4561af){_0x28ec62[_0xb9de('0x1f')]=_0x4561af;if(_0x17a694[_0xb9de('0x2f')][_0xb9de('0x3d')]){_0x34a766[_0xb9de('0x3e')]=[{'all':!![]}];}return db[_0xb9de('0x3c')][_0xb9de('0x3f')](_0x34a766);})[_0xb9de('0x24')](function(_0x13eaca){_0x28ec62['rows']=_0x13eaca;return _0x28ec62;})[_0xb9de('0x24')](respondWithFilteredResult(_0x3787d1,_0x34a766))[_0xb9de('0x40')](handleError(_0x3787d1,null));};exports[_0xb9de('0x41')]=function(_0x1825be,_0x3598f3){var _0x29e4f3={'raw':!![],'where':{'id':_0x1825be[_0xb9de('0x42')]['id']}},_0x48276f={};_0x48276f[_0xb9de('0x2b')]=_[_0xb9de('0x30')](db[_0xb9de('0x3c')][_0xb9de('0x28')]);_0x48276f[_0xb9de('0x2f')]=_[_0xb9de('0x30')](_0x1825be[_0xb9de('0x2f')]);_0x48276f[_0xb9de('0x31')]=_['intersection'](_0x48276f['model'],_0x48276f['query']);_0x29e4f3[_0xb9de('0x33')]=_[_0xb9de('0x32')](_0x48276f[_0xb9de('0x2b')],qs[_0xb9de('0x34')](_0x1825be[_0xb9de('0x2f')][_0xb9de('0x34')]));_0x29e4f3[_0xb9de('0x33')]=_0x29e4f3[_0xb9de('0x33')][_0xb9de('0x35')]?_0x29e4f3['attributes']:_0x48276f[_0xb9de('0x2b')];if(_0x1825be[_0xb9de('0x2f')]['includeAll']){_0x29e4f3[_0xb9de('0x3e')]=[{'all':!![]}];}_0x29e4f3=_[_0xb9de('0x38')]({},_0x29e4f3,_0x1825be[_0xb9de('0x3b')]);return db[_0xb9de('0x3c')][_0xb9de('0x43')](_0x29e4f3)[_0xb9de('0x24')](handleEntityNotFound(_0x3598f3,null))[_0xb9de('0x24')](respondWithResult(_0x3598f3,null))['catch'](handleError(_0x3598f3,null));};exports['update']=function(_0xc64a9d,_0x336634){if(_0xc64a9d[_0xb9de('0x44')]['id']){delete _0xc64a9d[_0xb9de('0x44')]['id'];}return db['CmCustomField'][_0xb9de('0x43')]({'where':{'id':_0xc64a9d['params']['id']}})[_0xb9de('0x24')](handleEntityNotFound(_0x336634,null))[_0xb9de('0x24')](saveUpdates(_0xc64a9d[_0xb9de('0x44')],null))[_0xb9de('0x24')](respondWithResult(_0x336634,null))['catch'](handleError(_0x336634,null));};exports['destroy']=function(_0x143268,_0x74863d){return db['CmCustomField'][_0xb9de('0x43')]({'where':{'id':_0x143268[_0xb9de('0x42')]['id']}})[_0xb9de('0x24')](handleEntityNotFound(_0x74863d,null))[_0xb9de('0x24')](removeEntity(_0x74863d,null))[_0xb9de('0x40')](handleError(_0x74863d,null));};exports[_0xb9de('0x45')]=function(_0x2d1bd6,_0x27ee56){var _0x2d9c7c;return db[_0xb9de('0x46')][_0xb9de('0x47')](function(_0x7871c8){return db[_0xb9de('0x3c')]['create'](_0x2d1bd6[_0xb9de('0x44')],{'transaction':_0x7871c8})[_0xb9de('0x24')](function(_0x1530bf){_0x2d9c7c=_0x1530bf;var _0x4e3e4d={'type':db[_0xb9de('0x48')][_0xb9de('0x49')],'transaction':_0x7871c8};switch(_0x2d1bd6[_0xb9de('0x44')][_0xb9de('0x2a')]){case'text':_0x4e3e4d[_0xb9de('0x2a')]=db[_0xb9de('0x48')][_0xb9de('0x49')];break;case _0xb9de('0x4a'):_0x4e3e4d[_0xb9de('0x2a')]=db[_0xb9de('0x48')]['INTEGER'];break;case'switch':_0x4e3e4d['type']=db[_0xb9de('0x48')][_0xb9de('0x4b')];_0x4e3e4d['defaultValue']=![];break;default:}return db[_0xb9de('0x46')][_0xb9de('0x4c')]['addColumn']('cm_contacts',util[_0xb9de('0x4d')](_0xb9de('0x4e'),_0x2d9c7c['id']),_0x4e3e4d);})[_0xb9de('0x24')](function(){return _0x2d9c7c;});})[_0xb9de('0x24')](respondWithResult(_0x27ee56,0xc9))[_0xb9de('0x40')](handleError(_0x27ee56,null));};
\ No newline at end of file
index 182695e..a43f114 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9a4=['../../config/environment','define','cm_custom_fields','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x450d03,_0xe14c8f){var _0x13d42e=function(_0x52654d){while(--_0x52654d){_0x450d03['push'](_0x450d03['shift']());}};_0x13d42e(++_0xe14c8f);}(_0xe9a4,0xae));var _0x4e9a=function(_0x28c752,_0x238454){_0x28c752=_0x28c752-0x0;var _0x30cd6c=_0xe9a4[_0x28c752];return _0x30cd6c;};'use strict';var _=require(_0x4e9a('0x0'));var util=require('util');var logger=require(_0x4e9a('0x1'))(_0x4e9a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4e9a('0x3'));var fs=require('fs');var path=require(_0x4e9a('0x4'));var rimraf=require(_0x4e9a('0x5'));var config=require(_0x4e9a('0x6'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x85f3df,_0x45930b){return _0x85f3df[_0x4e9a('0x7')]('CmCustomField',attributes,{'tableName':_0x4e9a('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7035=['bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','moment'];(function(_0xbb0ae2,_0x1263b4){var _0x493d06=function(_0x3a80bd){while(--_0x3a80bd){_0xbb0ae2['push'](_0xbb0ae2['shift']());}};_0x493d06(++_0x1263b4);}(_0x7035,0x1ad));var _0x5703=function(_0x1acff6,_0x2fe5fd){_0x1acff6=_0x1acff6-0x0;var _0xa038bb=_0x7035[_0x1acff6];return _0xa038bb;};'use strict';var _=require(_0x5703('0x0'));var util=require('util');var logger=require(_0x5703('0x1'))('api');var moment=require(_0x5703('0x2'));var BPromise=require(_0x5703('0x3'));var rp=require(_0x5703('0x4'));var fs=require('fs');var path=require(_0x5703('0x5'));var rimraf=require('rimraf');var config=require(_0x5703('0x6'));var attributes=require(_0x5703('0x7'));module[_0x5703('0x8')]=function(_0x3f4b1a,_0x349570){return _0x3f4b1a[_0x5703('0x9')](_0x5703('0xa'),attributes,{'tableName':_0x5703('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c7f5c3e..ca7e955 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x482f=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','code','CmCustomField,\x20%s,\x20%s','error','message','info'];(function(_0x18e1a1,_0x5426d6){var _0x3613d0=function(_0xfd2d84){while(--_0xfd2d84){_0x18e1a1['push'](_0x18e1a1['shift']());}};_0x3613d0(++_0x5426d6);}(_0x482f,0x74));var _0xf482=function(_0x57d7ce,_0x48be6f){_0x57d7ce=_0x57d7ce-0x0;var _0x1ce61b=_0x482f[_0x57d7ce];return _0x1ce61b;};'use strict';var _=require(_0xf482('0x0'));var util=require(_0xf482('0x1'));var moment=require('moment');var BPromise=require(_0xf482('0x2'));var rs=require(_0xf482('0x3'));var fs=require('fs');var Redis=require(_0xf482('0x4'));var db=require(_0xf482('0x5'))['db'];var utils=require(_0xf482('0x6'));var logger=require(_0xf482('0x7'))(_0xf482('0x8'));var config=require(_0xf482('0x9'));var jayson=require(_0xf482('0xa'));var client=jayson[_0xf482('0xb')][_0xf482('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x473465,_0x5b586a,_0x2e66eb){return new BPromise(function(_0x9cd781,_0x330de9){return client[_0xf482('0xd')](_0x473465,_0x2e66eb)['then'](function(_0x4d1531){logger['info']('CmCustomField,\x20%s,\x20%s',_0x5b586a,_0xf482('0xe'));logger[_0xf482('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x5b586a,_0xf482('0xe'),JSON[_0xf482('0x10')](_0x4d1531));if(_0x4d1531['error']){if(_0x4d1531['error'][_0xf482('0x11')]===0x1f4){logger['error'](_0xf482('0x12'),_0x5b586a,_0x4d1531[_0xf482('0x13')][_0xf482('0x14')]);return _0x330de9(_0x4d1531[_0xf482('0x13')]['message']);}logger[_0xf482('0x13')]('CmCustomField,\x20%s,\x20%s',_0x5b586a,_0x4d1531[_0xf482('0x13')][_0xf482('0x14')]);return _0x9cd781(_0x4d1531['error'][_0xf482('0x14')]);}else{logger[_0xf482('0x15')](_0xf482('0x12'),_0x5b586a,_0xf482('0xe'));_0x9cd781(_0x4d1531['result'][_0xf482('0x14')]);}})[_0xf482('0x16')](function(_0xcbcba6){logger[_0xf482('0x13')](_0xf482('0x12'),_0x5b586a,_0xcbcba6);_0x330de9(_0xcbcba6);});});}
\ No newline at end of file
+var _0x8c17=['debug','CmCustomField,\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','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x4dfc4f,_0x3147a4){var _0x29338c=function(_0x4751a9){while(--_0x4751a9){_0x4dfc4f['push'](_0x4dfc4f['shift']());}};_0x29338c(++_0x3147a4);}(_0x8c17,0xd7));var _0x78c1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8c17[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x78c1('0x0'));var BPromise=require(_0x78c1('0x1'));var rs=require(_0x78c1('0x2'));var fs=require('fs');var Redis=require(_0x78c1('0x3'));var db=require(_0x78c1('0x4'))['db'];var utils=require(_0x78c1('0x5'));var logger=require(_0x78c1('0x6'))(_0x78c1('0x7'));var config=require(_0x78c1('0x8'));var jayson=require(_0x78c1('0x9'));var client=jayson['client'][_0x78c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40f828,_0x40ed27,_0x50900f){return new BPromise(function(_0x379805,_0x3602d5){return client[_0x78c1('0xb')](_0x40f828,_0x50900f)[_0x78c1('0xc')](function(_0x1866d0){logger['info'](_0x78c1('0xd'),_0x40ed27,_0x78c1('0xe'));logger[_0x78c1('0xf')](_0x78c1('0x10'),_0x40ed27,_0x78c1('0xe'),JSON[_0x78c1('0x11')](_0x1866d0));if(_0x1866d0['error']){if(_0x1866d0[_0x78c1('0x12')][_0x78c1('0x13')]===0x1f4){logger[_0x78c1('0x12')](_0x78c1('0xd'),_0x40ed27,_0x1866d0[_0x78c1('0x12')]['message']);return _0x3602d5(_0x1866d0[_0x78c1('0x12')][_0x78c1('0x14')]);}logger[_0x78c1('0x12')]('CmCustomField,\x20%s,\x20%s',_0x40ed27,_0x1866d0['error'][_0x78c1('0x14')]);return _0x379805(_0x1866d0[_0x78c1('0x12')]['message']);}else{logger['info'](_0x78c1('0xd'),_0x40ed27,_0x78c1('0xe'));_0x379805(_0x1866d0[_0x78c1('0x15')][_0x78c1('0x14')]);}})[_0x78c1('0x16')](function(_0x13fa42){logger[_0x78c1('0x12')](_0x78c1('0xd'),_0x40ed27,_0x13fa42);_0x3602d5(_0x13fa42);});});}
\ No newline at end of file
index ecdc215..e78f071 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef8b=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','show','post','isAuthenticated','update','delete'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0xef8b,0x192));var _0xbef8=function(_0x53f608,_0x256def){_0x53f608=_0x53f608-0x0;var _0x495b7d=_0xef8b[_0x53f608];return _0x495b7d;};'use strict';var multer=require('multer');var util=require(_0xbef8('0x0'));var path=require(_0xbef8('0x1'));var timeout=require(_0xbef8('0x2'));var express=require(_0xbef8('0x3'));var router=express[_0xbef8('0x4')]();var fs_extra=require(_0xbef8('0x5'));var auth=require(_0xbef8('0x6'));var interaction=require(_0xbef8('0x7'));var config=require(_0xbef8('0x8'));var controller=require(_0xbef8('0x9'));router[_0xbef8('0xa')]('/',auth['isAuthenticated'](),controller[_0xbef8('0xb')]);router[_0xbef8('0xa')](_0xbef8('0xc'),auth['isAuthenticated'](),controller[_0xbef8('0xd')]);router[_0xbef8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xbef8('0xc'),auth[_0xbef8('0xf')](),controller[_0xbef8('0x10')]);router[_0xbef8('0x11')](_0xbef8('0xc'),auth[_0xbef8('0xf')](),controller[_0xbef8('0x12')]);module[_0xbef8('0x13')]=router;
\ No newline at end of file
+var _0x4453=['create','put','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0xcfcbaa,_0x369d95){var _0x157ed0=function(_0x3a0b62){while(--_0x3a0b62){_0xcfcbaa['push'](_0xcfcbaa['shift']());}};_0x157ed0(++_0x369d95);}(_0x4453,0x9c));var _0x3445=function(_0x2b41cd,_0x2b4d13){_0x2b41cd=_0x2b41cd-0x0;var _0x4d021b=_0x4453[_0x2b41cd];return _0x4d021b;};'use strict';var multer=require(_0x3445('0x0'));var util=require(_0x3445('0x1'));var path=require('path');var timeout=require(_0x3445('0x2'));var express=require(_0x3445('0x3'));var router=express['Router']();var fs_extra=require(_0x3445('0x4'));var auth=require(_0x3445('0x5'));var interaction=require(_0x3445('0x6'));var config=require(_0x3445('0x7'));var controller=require(_0x3445('0x8'));router[_0x3445('0x9')]('/',auth[_0x3445('0xa')](),controller[_0x3445('0xb')]);router[_0x3445('0x9')](_0x3445('0xc'),auth['isAuthenticated'](),controller[_0x3445('0xd')]);router[_0x3445('0xe')]('/',auth[_0x3445('0xa')](),controller[_0x3445('0xf')]);router[_0x3445('0x10')](_0x3445('0xc'),auth[_0x3445('0xa')](),controller['update']);router[_0x3445('0x11')](_0x3445('0xc'),auth[_0x3445('0xa')](),controller[_0x3445('0x12')]);module['exports']=router;
\ No newline at end of file
index bee293c..0fb0359 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc56=['STRING','UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x4f34ae,_0x13ed24){var _0x4f4576=function(_0x5e0e9d){while(--_0x5e0e9d){_0x4f34ae['push'](_0x4f34ae['shift']());}};_0x4f4576(++_0x13ed24);}(_0xfc56,0x142));var _0x6fc5=function(_0x2ca5d6,_0x54ed99){_0x2ca5d6=_0x2ca5d6-0x0;var _0x47cdc1=_0xfc56[_0x2ca5d6];return _0x47cdc1;};'use strict';var moment=require(_0x6fc5('0x0'));var Sequelize=require(_0x6fc5('0x1'));module[_0x6fc5('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6fc5('0x4')],'defaultValue':moment()[_0x6fc5('0x5')](_0x6fc5('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6fc5('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6fc5('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6fc5('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6fc5('0x4')]},'priority':{'type':Sequelize[_0x6fc5('0x7')](0x2)[_0x6fc5('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6fc5('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6fc5('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x6fc5('0x7')],'unique':_0x6fc5('0xa')},'UserId':{'type':Sequelize[_0x6fc5('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x6fc5('0x7')],'unique':_0x6fc5('0xa')},'CampaignId':{'type':Sequelize[_0x6fc5('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x6fc5('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6fc5('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6fc5('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6fc5('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x6fc5('0x7')],'allowNull':!![],'defaultValue':0x0}};
\ No newline at end of file
+var _0x00e9=['BOOLEAN','format','INTEGER','UNSIGNED','contactListQueue','sequelize','exports'];(function(_0x1395d8,_0x56f5d6){var _0x4e3962=function(_0x340eb0){while(--_0x340eb0){_0x1395d8['push'](_0x1395d8['shift']());}};_0x4e3962(++_0x56f5d6);}(_0x00e9,0x8a));var _0x900e=function(_0x5a27f1,_0x11312d){_0x5a27f1=_0x5a27f1-0x0;var _0xbbb997=_0x00e9[_0x5a27f1];return _0xbbb997;};'use strict';var moment=require('moment');var Sequelize=require(_0x900e('0x0'));module[_0x900e('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x900e('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x900e('0x3')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x900e('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x900e('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x900e('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x900e('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x900e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x900e('0x4')],'unique':_0x900e('0x6')},'ListId':{'type':Sequelize[_0x900e('0x4')],'unique':_0x900e('0x6')},'UserId':{'type':Sequelize[_0x900e('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x900e('0x4')],'unique':_0x900e('0x6')},'CampaignId':{'type':Sequelize[_0x900e('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x900e('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x900e('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x900e('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x900e('0x4')],'allowNull':!![],'defaultValue':0x0}};
\ No newline at end of file
index 54fa678..da0826e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c4e=['CampaignId','omit','dataValues','createdAt','updatedAt','deleted','campaign','membername','user','UserId','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','lastName','calleridname','firstName','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','direction','hopperIds','scheduledAt','ASC','DESC','literal','isEmpty','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','sendStatus','name','index','map','CmHopper','rawAttributes','type','key','model','keys','query','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','destroy','VoiceQueueId'];(function(_0x133fc0,_0x1edda8){var _0x4ce619=function(_0x308be5){while(--_0x308be5){_0x133fc0['push'](_0x133fc0['shift']());}};_0x4ce619(++_0x1edda8);}(_0x4c4e,0x152));var _0xe4c4=function(_0x45c320,_0x115cdb){_0x45c320=_0x45c320-0x0;var _0x22c5a4=_0x4c4e[_0x45c320];return _0x22c5a4;};'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(){_0x1db719['status'](0xcc)[_0xe4c4('0x1b')]();});}};}function handleEntityNotFound(_0x5374fd,_0x3adfcb){return function(_0x5efc4c){if(!_0x5efc4c){_0x5374fd[_0xe4c4('0x27')](0x194);}return _0x5efc4c;};}function handleError(_0x583393,_0xba53ef){_0xba53ef=_0xba53ef||0x1f4;return function(_0x4a0199){logger['error'](_0x4a0199['stack']);if(_0x4a0199['name']){delete _0x4a0199[_0xe4c4('0x28')];}_0x583393['status'](_0xba53ef)['send'](_0x4a0199);};}exports[_0xe4c4('0x29')]=function(_0x11deab,_0x4bb911){var _0x57ba43={},_0x7428ad={},_0x33de43={'count':0x0,'rows':[]};var _0x4aa6c1=_[_0xe4c4('0x2a')](db[_0xe4c4('0x2b')][_0xe4c4('0x2c')],function(_0x48060e){return{'name':_0x48060e['fieldName'],'type':_0x48060e[_0xe4c4('0x2d')][_0xe4c4('0x2e')]};});_0x7428ad[_0xe4c4('0x2f')]=_[_0xe4c4('0x2a')](_0x4aa6c1,'name');_0x7428ad['query']=_[_0xe4c4('0x30')](_0x11deab[_0xe4c4('0x31')]);_0x7428ad['filters']=_[_0xe4c4('0x32')](_0x7428ad[_0xe4c4('0x2f')],_0x7428ad[_0xe4c4('0x31')]);_0x7428ad['filters']=_[_0xe4c4('0x33')](_0x7428ad['filters'],[_0xe4c4('0x34'),_0xe4c4('0x35'),_0xe4c4('0x36'),_0xe4c4('0x37'),_0xe4c4('0x38'),_0xe4c4('0x39'),_0xe4c4('0x3a'),_0xe4c4('0x3b'),_0xe4c4('0x3c'),_0xe4c4('0x3d'),_0xe4c4('0x3e'),_0xe4c4('0x3f'),'$notIn',_0xe4c4('0x40'),_0xe4c4('0x41'),_0xe4c4('0x42'),'$notILike',_0xe4c4('0x40'),_0xe4c4('0x43'),_0xe4c4('0x44'),'$contained',_0xe4c4('0x45')]);_0x57ba43[_0xe4c4('0x46')]=_[_0xe4c4('0x32')](_0x7428ad[_0xe4c4('0x2f')],qs[_0xe4c4('0x47')](_0x11deab[_0xe4c4('0x31')][_0xe4c4('0x47')]));_0x57ba43[_0xe4c4('0x46')]=_0x57ba43[_0xe4c4('0x46')][_0xe4c4('0x48')]?_0x57ba43['attributes']:_0x7428ad[_0xe4c4('0x2f')];if(!_0x11deab[_0xe4c4('0x31')][_0xe4c4('0x49')](_0xe4c4('0x4a'))){_0x57ba43['limit']=qs[_0xe4c4('0x1f')](_0x11deab[_0xe4c4('0x31')]['limit']);_0x57ba43[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x11deab['query'][_0xe4c4('0x1d')]);}_0x57ba43[_0xe4c4('0x4b')]=qs[_0xe4c4('0x4c')](_0x11deab[_0xe4c4('0x31')][_0xe4c4('0x4c')]);_0x57ba43[_0xe4c4('0x4d')]=qs[_0xe4c4('0x4e')](_[_0xe4c4('0x4f')](_0x11deab[_0xe4c4('0x31')],_0x7428ad[_0xe4c4('0x4e')]),_0x4aa6c1);if(_0x11deab[_0xe4c4('0x31')][_0xe4c4('0x50')]){_0x57ba43['where']=_[_0xe4c4('0x51')](_0x57ba43[_0xe4c4('0x4d')],{'$or':_[_0xe4c4('0x2a')](_0x4aa6c1,function(_0x2e4c44){if(_0x2e4c44[_0xe4c4('0x2d')]!==_0xe4c4('0x52')){var _0x580df0={};_0x580df0[_0x2e4c44[_0xe4c4('0x28')]]={'$like':'%'+_0x11deab['query'][_0xe4c4('0x50')]+'%'};return _0x580df0;}})});}_0x57ba43=_[_0xe4c4('0x51')]({},_0x57ba43,_0x11deab[_0xe4c4('0x53')]);var _0x369c25={'where':_0x57ba43[_0xe4c4('0x4d')]};return db['CmHopper']['count'](_0x369c25)[_0xe4c4('0x26')](function(_0x41bd7a){_0x33de43[_0xe4c4('0x20')]=_0x41bd7a;if(_0x11deab['query'][_0xe4c4('0x54')]){_0x57ba43[_0xe4c4('0x55')]=[{'all':!![]}];}return db[_0xe4c4('0x2b')][_0xe4c4('0x56')](_0x57ba43);})['then'](function(_0x18c9ad){_0x33de43[_0xe4c4('0x57')]=_0x18c9ad;return _0x33de43;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x4bb911,_0x57ba43))[_0xe4c4('0x58')](handleError(_0x4bb911,null));};exports[_0xe4c4('0x59')]=function(_0x1e459e,_0x1eda5e){var _0x176712={'raw':!![],'where':{'id':_0x1e459e['params']['id']}},_0x3ee4db={};_0x3ee4db[_0xe4c4('0x2f')]=_['keys'](db[_0xe4c4('0x2b')][_0xe4c4('0x2c')]);_0x3ee4db[_0xe4c4('0x31')]=_[_0xe4c4('0x30')](_0x1e459e[_0xe4c4('0x31')]);_0x3ee4db[_0xe4c4('0x4e')]=_[_0xe4c4('0x32')](_0x3ee4db[_0xe4c4('0x2f')],_0x3ee4db[_0xe4c4('0x31')]);_0x176712[_0xe4c4('0x46')]=_[_0xe4c4('0x32')](_0x3ee4db[_0xe4c4('0x2f')],qs[_0xe4c4('0x47')](_0x1e459e[_0xe4c4('0x31')]['fields']));_0x176712['attributes']=_0x176712[_0xe4c4('0x46')][_0xe4c4('0x48')]?_0x176712['attributes']:_0x3ee4db[_0xe4c4('0x2f')];if(_0x1e459e[_0xe4c4('0x31')][_0xe4c4('0x54')]){_0x176712[_0xe4c4('0x55')]=[{'all':!![]}];}_0x176712=_[_0xe4c4('0x51')]({},_0x176712,_0x1e459e['options']);return db[_0xe4c4('0x2b')][_0xe4c4('0x5a')](_0x176712)['then'](handleEntityNotFound(_0x1eda5e,null))[_0xe4c4('0x26')](respondWithResult(_0x1eda5e,null))[_0xe4c4('0x58')](handleError(_0x1eda5e,null));};exports['create']=function(_0x100a35,_0x53699d){return db[_0xe4c4('0x2b')][_0xe4c4('0x5b')](_0x100a35[_0xe4c4('0x5c')],{})[_0xe4c4('0x26')](respondWithResult(_0x53699d,0xc9))[_0xe4c4('0x58')](handleError(_0x53699d,null));};exports['update']=function(_0x1c8b2e,_0x4284ec){if(_0x1c8b2e[_0xe4c4('0x5c')]['id']){delete _0x1c8b2e[_0xe4c4('0x5c')]['id'];}return db[_0xe4c4('0x2b')][_0xe4c4('0x5a')]({'where':{'id':_0x1c8b2e[_0xe4c4('0x5d')]['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x4284ec,null))[_0xe4c4('0x26')](saveUpdates(_0x1c8b2e[_0xe4c4('0x5c')],null))[_0xe4c4('0x26')](respondWithResult(_0x4284ec,null))[_0xe4c4('0x58')](handleError(_0x4284ec,null));};exports[_0xe4c4('0x5e')]=function(_0x28052f,_0x466882){return db[_0xe4c4('0x2b')]['describe']()[_0xe4c4('0x26')](respondWithResult(_0x466882,null))[_0xe4c4('0x58')](handleError(_0x466882,null));};exports[_0xe4c4('0x5f')]=function(_0x4ad6ac,_0x3c6632){var _0xb7e4da;var _0x35f750=_0x4ad6ac['params']['id'];return db[_0xe4c4('0x2b')]['find']({'where':{'id':_0x4ad6ac[_0xe4c4('0x5d')]['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x3c6632,null))[_0xe4c4('0x26')](function(_0x5b7194){if(_0x5b7194){return _0x5b7194['destroy']()[_0xe4c4('0x26')](function(_0x7d4896){return _0x7d4896;});}})[_0xe4c4('0x26')](function(_0x5edcae){_0xb7e4da=_0x5edcae;if(_0x5edcae){if(_0x5edcae[_0xe4c4('0x60')]||_0x5edcae['CampaignId']){return db[_0x5edcae['VoiceQueueId']?'VoiceQueue':'Campaign'][_0xe4c4('0x5a')]({'where':{'id':_0x5edcae[_0xe4c4('0x60')]?_0x5edcae[_0xe4c4('0x60')]:_0x5edcae[_0xe4c4('0x61')]},'attributes':['id',_0xe4c4('0x28')],'raw':!![]});}}})[_0xe4c4('0x26')](function(_0x487201){var _0x2a0f4a={};if(_0x487201){_[_0xe4c4('0x51')](_0x2a0f4a,_[_0xe4c4('0x62')](_0xb7e4da[_0xe4c4('0x63')],[_0xe4c4('0x64'),_0xe4c4('0x65'),'id']));_0x2a0f4a['state']=0x15;_0x2a0f4a['statedesc']=_0xe4c4('0x66');_0x2a0f4a[_0xe4c4('0x67')]=_0x487201[_0xe4c4('0x28')];_0x2a0f4a[_0xe4c4('0x68')]=_0x4ad6ac[_0xe4c4('0x69')][_0xe4c4('0x28')];_0x2a0f4a[_0xe4c4('0x6a')]=_0x4ad6ac[_0xe4c4('0x69')]['id'];_0x2a0f4a[_0xe4c4('0x66')]=!![];_0x2a0f4a['deletedat']=moment()['format'](_0xe4c4('0x6b'));_0x2a0f4a['calleridnum']=_0xb7e4da[_0xe4c4('0x6c')];_0x2a0f4a[_0xe4c4('0x6d')]=_0xb7e4da[_0xe4c4('0x60')]?'queue':_0xe4c4('0x6e');return db['CmContact'][_0xe4c4('0x5a')]({'where':{'id':_0x2a0f4a['ContactId']},'attributes':['firstName',_0xe4c4('0x6f')]})[_0xe4c4('0x26')](function(_0xfe9714){if(!_['isNil'](_0x3c6632)&&!_['isNil'](_0xfe9714['firstName'])){_0x2a0f4a[_0xe4c4('0x70')]=_0xfe9714[_0xe4c4('0x71')];if(!_['isNil'](_0xfe9714[_0xe4c4('0x6f')])){_0x2a0f4a[_0xe4c4('0x70')]+='\x20'+_0xfe9714[_0xe4c4('0x6f')];}}})['finally'](function(){return db['CmHopperFinal'][_0xe4c4('0x5b')](_0x2a0f4a);});}})[_0xe4c4('0x26')](function(_0x7328e1){return db[_0xe4c4('0x72')][_0xe4c4('0x5f')]({'where':{'CmHopperId':_0x35f750}});})[_0xe4c4('0x26')](function(){return _0x3c6632['status'](0xcc)[_0xe4c4('0x1b')]();})[_0xe4c4('0x58')](handleError(_0x3c6632,null));};exports[_0xe4c4('0x73')]=function(_0x55be06,_0x1e1f55,_0x4e5baa){var _0x248c4e=[];return db['CmContact']['describe']()[_0xe4c4('0x26')](function(_0x5dbd4d){_0x248c4e=_['keys'](_0x5dbd4d);return _0x55be06[_0xe4c4('0x69')][_0xe4c4('0x74')]({'where':{'type':_0xe4c4('0x75'),'dialActive':!![],'dialMethod':_0xe4c4('0x76')},'attributes':['id',_0xe4c4('0x77')],'raw':!![]});})[_0xe4c4('0x26')](function(_0x433633){if(_0x433633&&_0x433633[_0xe4c4('0x48')]){return db['sequelize'][_0xe4c4('0x78')](function(_0x475c2b){var _0x4bb16e={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xe4c4('0x6b'))},'VoiceQueueId':{'$in':_[_0xe4c4('0x2a')](_0x433633,'id')},'$or':[{'UserId':null},{'UserId':_0x55be06[_0xe4c4('0x69')]['id']}]};var _0x12971a=[];if(_0x55be06['body'][_0xe4c4('0x79')]&&_0x55be06[_0xe4c4('0x5c')][_0xe4c4('0x79')]==='prev'){if(!_['isEmpty'](_0x55be06[_0xe4c4('0x5c')][_0xe4c4('0x7a')])){_0x4bb16e['id']={'$in':_0x55be06[_0xe4c4('0x5c')][_0xe4c4('0x7a')]};}_0x12971a=[['priority','ASC'],[_0xe4c4('0x7b'),_0x433633[0x0][_0xe4c4('0x77')]===_0xe4c4('0x7c')?_0xe4c4('0x7d'):_0xe4c4('0x7c')],db['sequelize'][_0xe4c4('0x7e')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xe4c4('0x7d')]];}else{if(!_[_0xe4c4('0x7f')](_0x55be06['body']['hopperIds'])){_0x4bb16e['id']={'$notIn':_0x55be06[_0xe4c4('0x5c')][_0xe4c4('0x7a')]};}_0x12971a=[[_0xe4c4('0x80'),_0xe4c4('0x7d')],[_0xe4c4('0x7b'),_0x433633[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal'](_0xe4c4('0x81')),['id',_0xe4c4('0x7c')]];}return db['CmHopper'][_0xe4c4('0x82')]({'attributes':['id',_0xe4c4('0x83'),_0xe4c4('0x6c')],'where':_0x4bb16e,'order':_0x12971a,'transaction':_0x475c2b,'lock':_0x475c2b[_0xe4c4('0x84')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xe4c4('0x85'),'attributes':_0x248c4e,'include':[{'model':db[_0xe4c4('0x86')],'as':_0xe4c4('0x87'),'attributes':['id',_0xe4c4('0x28')]}]},{'model':db[_0xe4c4('0x88')],'as':_0xe4c4('0x89'),'attributes':['id',_0xe4c4('0x28')]},{'model':db['VoiceQueue'],'as':_0xe4c4('0x8a'),'attributes':['id',_0xe4c4('0x28'),_0xe4c4('0x8b')]}]})[_0xe4c4('0x26')](function(_0x511250){if(_0x511250){return _0x511250[_0xe4c4('0x25')]({'UserId':_0x55be06[_0xe4c4('0x69')]['id']},{'transaction':_0x475c2b});}});});}})[_0xe4c4('0x26')](handleEntityNotFound(_0x1e1f55,null))[_0xe4c4('0x26')](respondWithResult(_0x1e1f55,null))['catch'](handleError(_0x1e1f55,null));};exports[_0xe4c4('0x8c')]=function(_0x209fa2,_0x4f3263,_0x48e089){return _0x209fa2[_0xe4c4('0x69')][_0xe4c4('0x74')]({'where':{'type':_0xe4c4('0x75'),'dialActive':!![],'dialMethod':_0xe4c4('0x76')},'attributes':['id'],'raw':!![]})[_0xe4c4('0x26')](function(_0x746a03){if(_0x746a03&&_0x746a03[_0xe4c4('0x48')]){return db[_0xe4c4('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xe4c4('0x6b'))},'VoiceQueueId':{'$in':_[_0xe4c4('0x2a')](_0x746a03,'id')},'$or':[{'UserId':null},{'UserId':_0x209fa2[_0xe4c4('0x69')]['id']}]}});}return 0x0;})[_0xe4c4('0x26')](function(_0x2ab254){if(!_['isNil'](_0x2ab254)&&_[_0xe4c4('0x8d')](_0x2ab254)){return _0x4f3263[_0xe4c4('0x1a')](0xc8)[_0xe4c4('0x1c')]({'contacts':_0x2ab254});}else{logger[_0xe4c4('0x8e')](_0xe4c4('0x8f'),_0xe4c4('0x8c'),0x194,_0xe4c4('0x90'));_0x4f3263[_0xe4c4('0x27')](0x194);}})[_0xe4c4('0x58')](handleError(_0x4f3263,null));};
\ No newline at end of file
+var _0xe5b3=['sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','findOne','scheduledat','phone','LOCK','Contact','CmList','List','getOpenContacts','isNumber','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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','index','map','CmHopper','rawAttributes','type','key','model','query','keys','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notILike','$overlap','$contains','$contained','$any','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','describe','destroy','VoiceQueue','Campaign','VoiceQueueId','CampaignId','omit','dataValues','createdAt','state','deleted','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt'];(function(_0x277a66,_0x338269){var _0x268450=function(_0x171acc){while(--_0x171acc){_0x277a66['push'](_0x277a66['shift']());}};_0x268450(++_0x338269);}(_0xe5b3,0x133));var _0x3e5b=function(_0x41d73c,_0x50af9f){_0x41d73c=_0x41d73c-0x0;var _0x2f81a9=_0xe5b3[_0x41d73c];return _0x2f81a9;};'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(){_0x150674[_0x3e5b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b684,_0x2f6368){return function(_0x42d7e9){if(!_0x42d7e9){_0x41b684[_0x3e5b('0x19')](0x194);}return _0x42d7e9;};}function handleError(_0x3bb749,_0x26c7f2){_0x26c7f2=_0x26c7f2||0x1f4;return function(_0x160e87){logger[_0x3e5b('0x28')](_0x160e87['stack']);if(_0x160e87[_0x3e5b('0x29')]){delete _0x160e87['name'];}_0x3bb749[_0x3e5b('0x1b')](_0x26c7f2)['send'](_0x160e87);};}exports[_0x3e5b('0x2a')]=function(_0x1f6473,_0x1296ec){var _0x475b39={},_0x10d2ed={},_0x3cfaf6={'count':0x0,'rows':[]};var _0x307091=_[_0x3e5b('0x2b')](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')],function(_0x1e1565){return{'name':_0x1e1565['fieldName'],'type':_0x1e1565[_0x3e5b('0x2e')][_0x3e5b('0x2f')]};});_0x10d2ed[_0x3e5b('0x30')]=_[_0x3e5b('0x2b')](_0x307091,_0x3e5b('0x29'));_0x10d2ed[_0x3e5b('0x31')]=_[_0x3e5b('0x32')](_0x1f6473['query']);_0x10d2ed[_0x3e5b('0x33')]=_['intersection'](_0x10d2ed['model'],_0x10d2ed[_0x3e5b('0x31')]);_0x10d2ed[_0x3e5b('0x33')]=_['concat'](_0x10d2ed[_0x3e5b('0x33')],[_0x3e5b('0x34'),_0x3e5b('0x35'),_0x3e5b('0x36'),_0x3e5b('0x37'),_0x3e5b('0x38'),_0x3e5b('0x39'),_0x3e5b('0x3a'),_0x3e5b('0x3b'),_0x3e5b('0x3c'),_0x3e5b('0x3d'),_0x3e5b('0x3e'),'$in',_0x3e5b('0x3f'),_0x3e5b('0x40'),'$notLike','$iLike',_0x3e5b('0x41'),'$like',_0x3e5b('0x42'),_0x3e5b('0x43'),_0x3e5b('0x44'),_0x3e5b('0x45')]);_0x475b39['attributes']=_[_0x3e5b('0x46')](_0x10d2ed['model'],qs[_0x3e5b('0x47')](_0x1f6473['query']['fields']));_0x475b39['attributes']=_0x475b39[_0x3e5b('0x48')][_0x3e5b('0x49')]?_0x475b39[_0x3e5b('0x48')]:_0x10d2ed[_0x3e5b('0x30')];if(!_0x1f6473[_0x3e5b('0x31')][_0x3e5b('0x4a')]('nolimit')){_0x475b39['limit']=qs['limit'](_0x1f6473['query']['limit']);_0x475b39['offset']=qs['offset'](_0x1f6473[_0x3e5b('0x31')][_0x3e5b('0x20')]);}_0x475b39[_0x3e5b('0x4b')]=qs[_0x3e5b('0x4c')](_0x1f6473[_0x3e5b('0x31')][_0x3e5b('0x4c')]);_0x475b39[_0x3e5b('0x4d')]=qs[_0x3e5b('0x33')](_[_0x3e5b('0x4e')](_0x1f6473[_0x3e5b('0x31')],_0x10d2ed[_0x3e5b('0x33')]),_0x307091);if(_0x1f6473['query'][_0x3e5b('0x4f')]){_0x475b39[_0x3e5b('0x4d')]=_[_0x3e5b('0x50')](_0x475b39[_0x3e5b('0x4d')],{'$or':_[_0x3e5b('0x2b')](_0x307091,function(_0xc69499){if(_0xc69499[_0x3e5b('0x2e')]!==_0x3e5b('0x51')){var _0x351d5d={};_0x351d5d[_0xc69499[_0x3e5b('0x29')]]={'$like':'%'+_0x1f6473[_0x3e5b('0x31')]['filter']+'%'};return _0x351d5d;}})});}_0x475b39=_['merge']({},_0x475b39,_0x1f6473['options']);var _0x4a6c66={'where':_0x475b39[_0x3e5b('0x4d')]};return db[_0x3e5b('0x2c')][_0x3e5b('0x1f')](_0x4a6c66)[_0x3e5b('0x27')](function(_0x252cd0){_0x3cfaf6[_0x3e5b('0x1f')]=_0x252cd0;if(_0x1f6473[_0x3e5b('0x31')][_0x3e5b('0x52')]){_0x475b39[_0x3e5b('0x53')]=[{'all':!![]}];}return db[_0x3e5b('0x2c')]['findAll'](_0x475b39);})[_0x3e5b('0x27')](function(_0x28a105){_0x3cfaf6[_0x3e5b('0x54')]=_0x28a105;return _0x3cfaf6;})[_0x3e5b('0x27')](respondWithFilteredResult(_0x1296ec,_0x475b39))[_0x3e5b('0x55')](handleError(_0x1296ec,null));};exports['show']=function(_0x588ee7,_0x495217){var _0x1fbd87={'raw':!![],'where':{'id':_0x588ee7[_0x3e5b('0x56')]['id']}},_0x20af6a={};_0x20af6a['model']=_['keys'](db[_0x3e5b('0x2c')][_0x3e5b('0x2d')]);_0x20af6a[_0x3e5b('0x31')]=_['keys'](_0x588ee7['query']);_0x20af6a[_0x3e5b('0x33')]=_['intersection'](_0x20af6a[_0x3e5b('0x30')],_0x20af6a[_0x3e5b('0x31')]);_0x1fbd87[_0x3e5b('0x48')]=_[_0x3e5b('0x46')](_0x20af6a[_0x3e5b('0x30')],qs[_0x3e5b('0x47')](_0x588ee7[_0x3e5b('0x31')][_0x3e5b('0x47')]));_0x1fbd87[_0x3e5b('0x48')]=_0x1fbd87['attributes'][_0x3e5b('0x49')]?_0x1fbd87['attributes']:_0x20af6a[_0x3e5b('0x30')];if(_0x588ee7[_0x3e5b('0x31')][_0x3e5b('0x52')]){_0x1fbd87[_0x3e5b('0x53')]=[{'all':!![]}];}_0x1fbd87=_[_0x3e5b('0x50')]({},_0x1fbd87,_0x588ee7[_0x3e5b('0x57')]);return db[_0x3e5b('0x2c')][_0x3e5b('0x58')](_0x1fbd87)[_0x3e5b('0x27')](handleEntityNotFound(_0x495217,null))[_0x3e5b('0x27')](respondWithResult(_0x495217,null))[_0x3e5b('0x55')](handleError(_0x495217,null));};exports[_0x3e5b('0x59')]=function(_0x458058,_0x59d311){return db[_0x3e5b('0x2c')][_0x3e5b('0x59')](_0x458058[_0x3e5b('0x5a')],{})[_0x3e5b('0x27')](respondWithResult(_0x59d311,0xc9))[_0x3e5b('0x55')](handleError(_0x59d311,null));};exports[_0x3e5b('0x26')]=function(_0x55b46c,_0x131af1){if(_0x55b46c[_0x3e5b('0x5a')]['id']){delete _0x55b46c[_0x3e5b('0x5a')]['id'];}return db[_0x3e5b('0x2c')][_0x3e5b('0x58')]({'where':{'id':_0x55b46c[_0x3e5b('0x56')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x131af1,null))[_0x3e5b('0x27')](saveUpdates(_0x55b46c['body'],null))[_0x3e5b('0x27')](respondWithResult(_0x131af1,null))['catch'](handleError(_0x131af1,null));};exports['describe']=function(_0x207176,_0x53000e){return db[_0x3e5b('0x2c')][_0x3e5b('0x5b')]()[_0x3e5b('0x27')](respondWithResult(_0x53000e,null))[_0x3e5b('0x55')](handleError(_0x53000e,null));};exports['destroy']=function(_0x5ddeee,_0x545712){var _0x581b94;var _0x2ab5f3=_0x5ddeee[_0x3e5b('0x56')]['id'];return db[_0x3e5b('0x2c')][_0x3e5b('0x58')]({'where':{'id':_0x5ddeee[_0x3e5b('0x56')]['id']}})['then'](handleEntityNotFound(_0x545712,null))['then'](function(_0xa0a18d){if(_0xa0a18d){return _0xa0a18d[_0x3e5b('0x5c')]()[_0x3e5b('0x27')](function(_0x325f7b){return _0x325f7b;});}})[_0x3e5b('0x27')](function(_0x51efbd){_0x581b94=_0x51efbd;if(_0x51efbd){if(_0x51efbd['VoiceQueueId']||_0x51efbd['CampaignId']){return db[_0x51efbd['VoiceQueueId']?_0x3e5b('0x5d'):_0x3e5b('0x5e')][_0x3e5b('0x58')]({'where':{'id':_0x51efbd[_0x3e5b('0x5f')]?_0x51efbd[_0x3e5b('0x5f')]:_0x51efbd[_0x3e5b('0x60')]},'attributes':['id',_0x3e5b('0x29')],'raw':!![]});}}})[_0x3e5b('0x27')](function(_0x485951){var _0x285db6={};if(_0x485951){_[_0x3e5b('0x50')](_0x285db6,_[_0x3e5b('0x61')](_0x581b94[_0x3e5b('0x62')],[_0x3e5b('0x63'),'updatedAt','id']));_0x285db6[_0x3e5b('0x64')]=0x15;_0x285db6['statedesc']=_0x3e5b('0x65');_0x285db6[_0x3e5b('0x66')]=_0x485951['name'];_0x285db6['membername']=_0x5ddeee['user'][_0x3e5b('0x29')];_0x285db6['UserId']=_0x5ddeee[_0x3e5b('0x67')]['id'];_0x285db6[_0x3e5b('0x65')]=!![];_0x285db6[_0x3e5b('0x68')]=moment()[_0x3e5b('0x69')](_0x3e5b('0x6a'));_0x285db6['calleridnum']=_0x581b94['phone'];_0x285db6[_0x3e5b('0x6b')]=_0x581b94[_0x3e5b('0x5f')]?_0x3e5b('0x6c'):'ivr';return db[_0x3e5b('0x6d')][_0x3e5b('0x58')]({'where':{'id':_0x285db6[_0x3e5b('0x6e')]},'attributes':[_0x3e5b('0x6f'),_0x3e5b('0x70')]})[_0x3e5b('0x27')](function(_0x455594){if(!_[_0x3e5b('0x71')](_0x545712)&&!_[_0x3e5b('0x71')](_0x455594[_0x3e5b('0x6f')])){_0x285db6[_0x3e5b('0x72')]=_0x455594[_0x3e5b('0x6f')];if(!_[_0x3e5b('0x71')](_0x455594[_0x3e5b('0x70')])){_0x285db6[_0x3e5b('0x72')]+='\x20'+_0x455594[_0x3e5b('0x70')];}}})[_0x3e5b('0x73')](function(){return db[_0x3e5b('0x74')]['create'](_0x285db6);});}})[_0x3e5b('0x27')](function(_0x360303){return db['CmHopperAdditionalPhone'][_0x3e5b('0x5c')]({'where':{'CmHopperId':_0x2ab5f3}});})[_0x3e5b('0x27')](function(){return _0x545712['status'](0xcc)['end']();})['catch'](handleError(_0x545712,null));};exports[_0x3e5b('0x75')]=function(_0x465826,_0x498e6d,_0x2929ba){var _0x1f3a1e=[];return db['CmContact'][_0x3e5b('0x5b')]()[_0x3e5b('0x27')](function(_0x43f28f){_0x1f3a1e=_[_0x3e5b('0x32')](_0x43f28f);return _0x465826[_0x3e5b('0x67')][_0x3e5b('0x76')]({'where':{'type':_0x3e5b('0x77'),'dialActive':!![],'dialMethod':_0x3e5b('0x78')},'attributes':['id',_0x3e5b('0x79')],'raw':!![]});})['then'](function(_0x310238){if(_0x310238&&_0x310238[_0x3e5b('0x49')]){return db[_0x3e5b('0x7a')][_0x3e5b('0x7b')](function(_0x1adb46){var _0x1ec1f6={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3e5b('0x69')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x310238,'id')},'$or':[{'UserId':null},{'UserId':_0x465826[_0x3e5b('0x67')]['id']}]};var _0x3ee33c=[];if(_0x465826['body'][_0x3e5b('0x7c')]&&_0x465826[_0x3e5b('0x5a')][_0x3e5b('0x7c')]===_0x3e5b('0x7d')){if(!_[_0x3e5b('0x7e')](_0x465826[_0x3e5b('0x5a')][_0x3e5b('0x7f')])){_0x1ec1f6['id']={'$in':_0x465826['body'][_0x3e5b('0x7f')]};}_0x3ee33c=[[_0x3e5b('0x80'),'ASC'],['scheduledAt',_0x310238[0x0]['dialOrderByScheduledAt']===_0x3e5b('0x81')?_0x3e5b('0x82'):_0x3e5b('0x81')],db[_0x3e5b('0x7a')][_0x3e5b('0x83')](_0x3e5b('0x84')),['id','DESC']];}else{if(!_[_0x3e5b('0x7e')](_0x465826[_0x3e5b('0x5a')]['hopperIds'])){_0x1ec1f6['id']={'$notIn':_0x465826[_0x3e5b('0x5a')]['hopperIds']};}_0x3ee33c=[['priority',_0x3e5b('0x82')],[_0x3e5b('0x85'),_0x310238[0x0]['dialOrderByScheduledAt']],db[_0x3e5b('0x7a')][_0x3e5b('0x83')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x3e5b('0x81')]];}return db[_0x3e5b('0x2c')][_0x3e5b('0x86')]({'attributes':['id',_0x3e5b('0x87'),_0x3e5b('0x88')],'where':_0x1ec1f6,'order':_0x3ee33c,'transaction':_0x1adb46,'lock':_0x1adb46[_0x3e5b('0x89')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x3e5b('0x8a'),'attributes':_0x1f3a1e,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0x3e5b('0x29')]}]},{'model':db[_0x3e5b('0x8b')],'as':_0x3e5b('0x8c'),'attributes':['id','name']},{'model':db[_0x3e5b('0x5d')],'as':'Queue','attributes':['id',_0x3e5b('0x29'),'dialActive']}]})[_0x3e5b('0x27')](function(_0x923269){if(_0x923269){return _0x923269[_0x3e5b('0x26')]({'UserId':_0x465826[_0x3e5b('0x67')]['id']},{'transaction':_0x1adb46});}});});}})['then'](handleEntityNotFound(_0x498e6d,null))[_0x3e5b('0x27')](respondWithResult(_0x498e6d,null))['catch'](handleError(_0x498e6d,null));};exports[_0x3e5b('0x8d')]=function(_0x8f992f,_0x58ccf3,_0x272ef1){return _0x8f992f[_0x3e5b('0x67')][_0x3e5b('0x76')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x3e5b('0x78')},'attributes':['id'],'raw':!![]})[_0x3e5b('0x27')](function(_0x2085be){if(_0x2085be&&_0x2085be['length']){return db[_0x3e5b('0x2c')][_0x3e5b('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x3e5b('0x6a'))},'VoiceQueueId':{'$in':_[_0x3e5b('0x2b')](_0x2085be,'id')},'$or':[{'UserId':null},{'UserId':_0x8f992f[_0x3e5b('0x67')]['id']}]}});}return 0x0;})['then'](function(_0x3b3306){if(!_[_0x3e5b('0x71')](_0x3b3306)&&_[_0x3e5b('0x8e')](_0x3b3306)){return _0x58ccf3[_0x3e5b('0x1b')](0xc8)['json']({'contacts':_0x3b3306});}else{logger[_0x3e5b('0x28')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x3e5b('0x8d'),0x194,'entity\x20not\x20found');_0x58ccf3[_0x3e5b('0x19')](0x194);}})[_0x3e5b('0x55')](handleError(_0x58ccf3,null));};
\ No newline at end of file
index ec48463..99bd8ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['define','scheduledat','phone','priority','lodash','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x0295,0x1f0));var _0x5029=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x0295[_0xa3fadc];return _0x23ecb8;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5029('0x9')]},{'name':'phone','fields':[_0x5029('0xa')]},{'name':'priority','fields':[_0x5029('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','cm_hopper','scheduledat','phone','priority','lodash'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xabce,0x103));var _0xeabc=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xabce[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./cmHopper.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('CmHopper',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]},{'name':'phone','fields':[_0xeabc('0xb')]},{'name':_0xeabc('0xc'),'fields':[_0xeabc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 5faa1e5..9f29d9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87d4=['stringify','ShowCmHopper','find','raw','catch','CreateCmHopper','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','order','LOCK','keys','Agent','name','voicePause','length','UserId','push','body','includes','MoveContactManagedDialer','transaction','CmHopperFinal','CountReScheduled','sequelize','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','all','GetCmHopperPreview','Contact','util','bluebird','randomstring','ioredis','../../config/utils','rpc','client','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model'];(function(_0x592d48,_0x23f1ba){var _0x5d789e=function(_0x156900){while(--_0x156900){_0x592d48['push'](_0x592d48['shift']());}};_0x5d789e(++_0x23f1ba);}(_0x87d4,0x1b3));var _0x487d=function(_0x27d917,_0x546143){_0x27d917=_0x27d917-0x0;var _0x52fdb5=_0x87d4[_0x27d917];return _0x52fdb5;};'use strict';var _=require('lodash');var util=require(_0x487d('0x0'));var moment=require('moment');var BPromise=require(_0x487d('0x1'));var rs=require(_0x487d('0x2'));var fs=require('fs');var Redis=require(_0x487d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x487d('0x4'));var logger=require('../../config/logger')(_0x487d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x487d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2493d3,_0x3e9356,_0x4099e2){return new BPromise(function(_0x19cccb,_0x4a3e76){return client[_0x487d('0x7')](_0x2493d3,_0x4099e2)[_0x487d('0x8')](function(_0x28dd7c){logger['info'](_0x487d('0x9'),_0x3e9356,_0x487d('0xa'));logger[_0x487d('0xb')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x3e9356,_0x487d('0xa'),JSON['stringify'](_0x28dd7c));if(_0x28dd7c[_0x487d('0xc')]){if(_0x28dd7c[_0x487d('0xc')][_0x487d('0xd')]===0x1f4){logger['error'](_0x487d('0x9'),_0x3e9356,_0x28dd7c[_0x487d('0xc')]['message']);return _0x4a3e76(_0x28dd7c['error'][_0x487d('0xe')]);}logger['error'](_0x487d('0x9'),_0x3e9356,_0x28dd7c[_0x487d('0xc')][_0x487d('0xe')]);return _0x19cccb(_0x28dd7c[_0x487d('0xc')][_0x487d('0xe')]);}else{logger[_0x487d('0xf')]('CmHopper,\x20%s,\x20%s',_0x3e9356,_0x487d('0xa'));_0x19cccb(_0x28dd7c[_0x487d('0x10')][_0x487d('0xe')]);}})['catch'](function(_0x12c97d){logger[_0x487d('0xc')]('CmHopper,\x20%s,\x20%s',_0x3e9356,_0x12c97d);_0x4a3e76(_0x12c97d);});});}exports[_0x487d('0x11')]=function(_0x3ea930){var _0x222c3e=this;return new Promise(function(_0x218b02,_0x5e9e61){return db[_0x487d('0x12')][_0x487d('0x13')]({'raw':_0x3ea930[_0x487d('0x14')]?_0x3ea930[_0x487d('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3ea930[_0x487d('0x14')]?_0x3ea930['options'][_0x487d('0x15')]||null:null,'attributes':_0x3ea930[_0x487d('0x14')]?_0x3ea930[_0x487d('0x14')][_0x487d('0x16')]||null:null,'limit':_0x3ea930[_0x487d('0x14')]?_0x3ea930[_0x487d('0x14')][_0x487d('0x17')]||null:null,'include':_0x3ea930[_0x487d('0x14')]?_0x3ea930['options'][_0x487d('0x18')]?_[_0x487d('0x19')](_0x3ea930[_0x487d('0x14')][_0x487d('0x18')],function(_0xf628d9){return{'model':db[_0xf628d9[_0x487d('0x1a')]],'as':_0xf628d9['as'],'attributes':_0xf628d9[_0x487d('0x16')],'include':_0xf628d9[_0x487d('0x18')]?_[_0x487d('0x19')](_0xf628d9[_0x487d('0x18')],function(_0xfff95b){return{'model':db[_0xfff95b[_0x487d('0x1a')]],'as':_0xfff95b['as'],'attributes':_0xfff95b[_0x487d('0x16')],'include':_0xfff95b[_0x487d('0x18')]?_[_0x487d('0x19')](_0xfff95b['include'],function(_0xeb8710){return{'model':db[_0xeb8710[_0x487d('0x1a')]],'as':_0xeb8710['as'],'attributes':_0xeb8710[_0x487d('0x16')]};}):[]};}):[]};}):[]:[]})[_0x487d('0x8')](function(_0x4b1490){logger[_0x487d('0xf')]('GetCmHopper',_0x3ea930);logger[_0x487d('0xb')](_0x487d('0x11'),_0x3ea930,JSON[_0x487d('0x1b')](_0x4b1490));_0x218b02(_0x4b1490);})['catch'](function(_0x34d639){logger[_0x487d('0xc')]('GetCmHopper',_0x34d639[_0x487d('0xe')],_0x3ea930);_0x5e9e61(_0x222c3e[_0x487d('0xc')](0x1f4,_0x34d639[_0x487d('0xe')]));});});};exports[_0x487d('0x1c')]=function(_0x89f578){var _0x28cb61=this;return new Promise(function(_0x550521,_0x5d2e19){return db['CmHopper'][_0x487d('0x1d')]({'raw':_0x89f578['options']?_0x89f578['options'][_0x487d('0x1e')]===undefined?!![]:![]:!![],'where':_0x89f578['options']?_0x89f578[_0x487d('0x14')][_0x487d('0x15')]||null:null,'attributes':_0x89f578[_0x487d('0x14')]?_0x89f578[_0x487d('0x14')][_0x487d('0x16')]||null:null,'include':_0x89f578[_0x487d('0x14')]?_0x89f578[_0x487d('0x14')][_0x487d('0x18')]?_[_0x487d('0x19')](_0x89f578[_0x487d('0x14')]['include'],function(_0x51836d){return{'model':db[_0x51836d['model']],'as':_0x51836d['as'],'attributes':_0x51836d[_0x487d('0x16')],'include':_0x51836d[_0x487d('0x18')]?_['map'](_0x51836d[_0x487d('0x18')],function(_0x21be5c){return{'model':db[_0x21be5c[_0x487d('0x1a')]],'as':_0x21be5c['as'],'attributes':_0x21be5c[_0x487d('0x16')],'include':_0x21be5c[_0x487d('0x18')]?_[_0x487d('0x19')](_0x21be5c[_0x487d('0x18')],function(_0x203f99){return{'model':db[_0x203f99[_0x487d('0x1a')]],'as':_0x203f99['as'],'attributes':_0x203f99[_0x487d('0x16')]};}):[]};}):[]};}):[]:[]})[_0x487d('0x8')](function(_0x4386a9){logger[_0x487d('0xf')](_0x487d('0x1c'),_0x89f578);logger[_0x487d('0xb')]('ShowCmHopper',_0x89f578,JSON[_0x487d('0x1b')](_0x4386a9));_0x550521(_0x4386a9);})[_0x487d('0x1f')](function(_0x1ebb44){logger[_0x487d('0xc')](_0x487d('0x1c'),_0x1ebb44[_0x487d('0xe')],_0x89f578);_0x5d2e19(_0x28cb61[_0x487d('0xc')](0x1f4,_0x1ebb44[_0x487d('0xe')]));});});};exports[_0x487d('0x20')]=function(_0x3cd523){var _0x5cd589=this;return new Promise(function(_0x577ed1,_0xf254c1){return db['CmHopper']['create'](_0x3cd523['body'],{'raw':_0x3cd523['options']?_0x3cd523[_0x487d('0x14')][_0x487d('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x312e76){logger[_0x487d('0xf')](_0x487d('0x20'),_0x3cd523);logger['debug'](_0x487d('0x20'),_0x3cd523,JSON[_0x487d('0x1b')](_0x312e76));_0x577ed1(_0x312e76);})['catch'](function(_0x5bf1f7){logger[_0x487d('0xc')](_0x487d('0x20'),_0x5bf1f7[_0x487d('0xe')],_0x3cd523);_0xf254c1(_0x5cd589['error'](0x1f4,_0x5bf1f7[_0x487d('0xe')]));});});};exports['UpdateCmHopper']=function(_0x49e646){var _0x3674ee=this;return new Promise(function(_0x221c85,_0x2e33e4){return db['CmHopper'][_0x487d('0x21')](_0x49e646['body'],{'raw':_0x49e646[_0x487d('0x14')]?_0x49e646[_0x487d('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49e646['options']?_0x49e646['options'][_0x487d('0x15')]||null:null,'attributes':_0x49e646[_0x487d('0x14')]?_0x49e646[_0x487d('0x14')]['attributes']||null:null,'limit':_0x49e646[_0x487d('0x14')]?_0x49e646[_0x487d('0x14')][_0x487d('0x17')]||null:null})[_0x487d('0x8')](function(_0x521a6c){logger[_0x487d('0xf')](_0x487d('0x22'),_0x49e646);logger[_0x487d('0xb')](_0x487d('0x22'),_0x49e646,JSON[_0x487d('0x1b')](_0x521a6c));_0x221c85(_0x521a6c);})[_0x487d('0x1f')](function(_0x25e7b1){logger[_0x487d('0xc')]('UpdateCmHopper',_0x25e7b1[_0x487d('0xe')],_0x49e646);_0x2e33e4(_0x3674ee['error'](0x1f4,_0x25e7b1['message']));});});};exports[_0x487d('0x23')]=function(_0x252ae8){var _0x250f6a=this;return new Promise(function(_0x50a8e5,_0x185d36){return db[_0x487d('0x12')][_0x487d('0x24')]({'where':_0x252ae8['options']?_0x252ae8[_0x487d('0x14')]['where']||null:null})[_0x487d('0x8')](function(_0x247eaa){logger[_0x487d('0xf')](_0x487d('0x23'),_0x252ae8);logger['debug'](_0x487d('0x23'),_0x252ae8,JSON[_0x487d('0x1b')](_0x247eaa));_0x50a8e5(_0x247eaa);})['catch'](function(_0x33dc67){logger[_0x487d('0xc')]('DestroyCmHopper',_0x33dc67[_0x487d('0xe')],_0x252ae8);_0x185d36(_0x250f6a[_0x487d('0xc')](0x1f4,_0x33dc67[_0x487d('0xe')]));});});};exports[_0x487d('0x25')]=function(_0x4279b1){var _0x202f9f=this;return new Promise(function(_0x2a6705,_0x58c094){return db[_0x487d('0x26')][_0x487d('0x27')]()[_0x487d('0x8')](function(_0x29a01d){return db['sequelize']['transaction'](function(_0x481bc5){return db[_0x487d('0x12')][_0x487d('0x13')]({'where':_0x4279b1[_0x487d('0x14')]?_0x4279b1[_0x487d('0x14')]['where']||null:null,'attributes':_0x4279b1['options']?_0x4279b1[_0x487d('0x14')][_0x487d('0x16')]||null:null,'limit':_0x4279b1[_0x487d('0x14')]?_0x4279b1[_0x487d('0x14')][_0x487d('0x17')]||null:null,'order':_0x4279b1[_0x487d('0x14')]?_0x4279b1[_0x487d('0x14')][_0x487d('0x28')]||null:null,'transaction':_0x481bc5,'lock':_0x481bc5[_0x487d('0x29')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x487d('0x2a')](_0x29a01d)},{'model':db['User'],'as':_0x487d('0x2b'),'attributes':['id',_0x487d('0x2c'),_0x487d('0x2d')]}]})[_0x487d('0x8')](function(_0x552067){var _0xebd3ce=[];var _0x466130=[];for(var _0x5dd6a5=0x0;_0x5dd6a5<_0x552067[_0x487d('0x2e')];_0x5dd6a5+=0x1){var _0x1b9d5d=_0x552067[_0x5dd6a5][_0x487d('0x2f')];if(_0x1b9d5d===null){_0xebd3ce[_0x487d('0x30')](_0x552067[_0x5dd6a5][_0x487d('0x21')](_0x4279b1[_0x487d('0x31')],{'transaction':_0x481bc5}));}else if(!_0x466130[_0x487d('0x32')](_0x1b9d5d)){_0x466130[_0x487d('0x30')](_0x1b9d5d);_0xebd3ce[_0x487d('0x30')](_0x552067[_0x5dd6a5][_0x487d('0x21')](_0x4279b1[_0x487d('0x31')],{'transaction':_0x481bc5}));}}return BPromise['all'](_0xebd3ce);});})['then'](function(_0x57c0c8){logger[_0x487d('0xf')](_0x487d('0x25'),_0x4279b1);logger['debug'](_0x487d('0x25'),_0x4279b1,JSON[_0x487d('0x1b')](_0x57c0c8));_0x2a6705(_0x57c0c8);})['catch'](function(_0x348432){logger['error'](_0x487d('0x25'),_0x348432['message'],_0x4279b1);_0x58c094(_0x202f9f['error'](0x1f4,_0x348432[_0x487d('0xe')]));});});});};exports[_0x487d('0x33')]=function(_0x1dea52){var _0x23f26d=this;return new Promise(function(_0xd5e0e8,_0x2a3054){return db['sequelize'][_0x487d('0x34')](function(_0x35a2a3){return db[_0x487d('0x35')]['create'](_0x1dea52['body'],{'raw':_0x1dea52['options']?_0x1dea52[_0x487d('0x14')][_0x487d('0x1e')]===undefined?!![]:![]:!![],'transaction':_0x35a2a3})['then'](function(){return db[_0x487d('0x12')]['destroy']({'where':_0x1dea52[_0x487d('0x14')]?_0x1dea52[_0x487d('0x14')]['where']||null:null,'transaction':_0x35a2a3});});})[_0x487d('0x8')](function(_0x338ab2){logger[_0x487d('0xf')](_0x487d('0x33'),_0x1dea52);logger[_0x487d('0xb')](_0x487d('0x33'),_0x1dea52,JSON[_0x487d('0x1b')](_0x338ab2));_0xd5e0e8(_0x338ab2);})['catch'](function(_0x385c73){logger[_0x487d('0xc')](_0x487d('0x33'),_0x385c73[_0x487d('0xe')],_0x1dea52);_0x2a3054(_0x23f26d[_0x487d('0xc')](0x1f4,_0x385c73[_0x487d('0xe')]));});});};exports[_0x487d('0x36')]=function(_0x542b6d){var _0x409b9c=this;return new Promise(function(_0x207451,_0x5dac25){return db[_0x487d('0x12')]['findAll']({'raw':_0x542b6d[_0x487d('0x14')]?_0x542b6d[_0x487d('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x542b6d[_0x487d('0x14')]?_0x542b6d['options'][_0x487d('0x15')]||null:null,'attributes':[[db[_0x487d('0x37')]['fn'](_0x487d('0x38'),db[_0x487d('0x37')]['fn']('IF',db[_0x487d('0x37')]['literal'](_0x487d('0x39')+util[_0x487d('0x3a')](_0x487d('0x3b'),moment()[_0x487d('0x3a')](_0x487d('0x3c')))+'\x20,\x201,\x20null'))),_0x487d('0x3d')]]})[_0x487d('0x8')](function(_0x550e24){logger[_0x487d('0xf')](_0x487d('0x36'),_0x542b6d);logger[_0x487d('0xb')]('CountReScheduled',_0x542b6d,JSON[_0x487d('0x1b')](_0x550e24));_0x207451(_0x550e24);})[_0x487d('0x1f')](function(_0x498b8b){logger[_0x487d('0xc')](_0x487d('0x36'),_0x498b8b[_0x487d('0xe')],_0x542b6d);_0x5dac25(_0x409b9c[_0x487d('0xc')](0x1f4,_0x498b8b[_0x487d('0xe')]));});});};exports[_0x487d('0x3e')]=function(_0x170a6b){var _0xd0d9=this;return new Promise(function(_0x18772f,_0x56564c){return db[_0x487d('0x26')][_0x487d('0x27')]()[_0x487d('0x8')](function(_0x16fa1b){return db['sequelize'][_0x487d('0x34')](function(_0x2e6f3e){return db['CmHopper'][_0x487d('0x13')]({'where':_0x170a6b[_0x487d('0x14')]?_0x170a6b['options'][_0x487d('0x15')]||null:null,'attributes':_0x170a6b[_0x487d('0x14')]?_0x170a6b['options'][_0x487d('0x16')]||null:null,'limit':0x1,'order':_0x170a6b[_0x487d('0x14')]?_0x170a6b['options'][_0x487d('0x28')]||null:null,'group':db['CmHopper'][_0x487d('0x2f')],'transaction':_0x2e6f3e,'lock':_0x2e6f3e['LOCK']['UPDATE'],'include':_0x170a6b[_0x487d('0x14')]?_0x170a6b[_0x487d('0x14')][_0x487d('0x18')]?_[_0x487d('0x19')](_0x170a6b['options']['include'],function(_0xf01b8a){return{'model':db[_0xf01b8a[_0x487d('0x1a')]],'as':_0xf01b8a['as'],'attributes':_0xf01b8a[_0x487d('0x16')],'include':_0xf01b8a[_0x487d('0x18')]?_[_0x487d('0x19')](_0xf01b8a[_0x487d('0x18')],function(_0x5a16e0){return{'model':db[_0x5a16e0['model']],'as':_0x5a16e0['as'],'attributes':_0x5a16e0[_0x487d('0x16')],'include':_0x5a16e0['include']?_[_0x487d('0x19')](_0x5a16e0[_0x487d('0x18')],function(_0x288050){return{'model':db[_0x288050['model']],'as':_0x288050['as'],'attributes':_0x288050['attributes']};}):[]};}):[]};}):[]:[]})[_0x487d('0x8')](function(_0x5b89ae){var _0x21db2a=[];for(var _0x2e0e8d=0x0;_0x2e0e8d<_0x5b89ae['length'];_0x2e0e8d+=0x1){_0x21db2a['push'](_0x5b89ae[_0x2e0e8d][_0x487d('0x21')](_0x170a6b[_0x487d('0x31')],{'transaction':_0x2e6f3e}));}return BPromise[_0x487d('0x3f')](_0x21db2a);});})[_0x487d('0x8')](function(_0x10a886){logger[_0x487d('0xf')](_0x487d('0x3e'),_0x170a6b);logger[_0x487d('0xb')](_0x487d('0x3e'),_0x170a6b,JSON[_0x487d('0x1b')](_0x10a886));_0x18772f(_0x10a886);})[_0x487d('0x1f')](function(_0x4ca214){logger[_0x487d('0xc')](_0x487d('0x3e'),_0x4ca214[_0x487d('0xe')],_0x170a6b);_0x56564c(_0xd0d9[_0x487d('0xc')](0x1f4,_0x4ca214[_0x487d('0xe')]));});});});};exports[_0x487d('0x40')]=function(_0x57c04f){var _0x3d2beb=this;return new Promise(function(_0x56f3d8,_0x14224f){db['CmContact'][_0x487d('0x27')]()[_0x487d('0x8')](function(_0x67c80d){return db[_0x487d('0x12')][_0x487d('0x13')]({'raw':_0x57c04f[_0x487d('0x14')]?_0x57c04f[_0x487d('0x14')][_0x487d('0x1e')]===undefined?!![]:![]:!![],'where':_0x57c04f[_0x487d('0x14')]?_0x57c04f[_0x487d('0x14')]['where']||null:null,'attributes':_0x57c04f['options']?_0x57c04f[_0x487d('0x14')][_0x487d('0x16')]||null:null,'limit':_0x57c04f['options']?_0x57c04f[_0x487d('0x14')][_0x487d('0x17')]||null:null,'include':_0x57c04f[_0x487d('0x14')]?_0x57c04f[_0x487d('0x14')]['include']?_[_0x487d('0x19')](_0x57c04f[_0x487d('0x14')]['include'],function(_0x5aee56){return{'model':db[_0x5aee56['model']],'as':_0x5aee56['as'],'attributes':_0x5aee56['as']===_0x487d('0x41')?_[_0x487d('0x2a')](_0x67c80d):_0x5aee56[_0x487d('0x16')],'include':_0x5aee56[_0x487d('0x18')]?_[_0x487d('0x19')](_0x5aee56['include'],function(_0x321b62){return{'model':db[_0x321b62[_0x487d('0x1a')]],'as':_0x321b62['as'],'attributes':_0x321b62['attributes'],'include':_0x321b62[_0x487d('0x18')]?_['map'](_0x321b62[_0x487d('0x18')],function(_0x5a5744){return{'model':db[_0x5a5744['model']],'as':_0x5a5744['as'],'attributes':_0x5a5744[_0x487d('0x16')]};}):[]};}):[]};}):[]:[]})[_0x487d('0x8')](function(_0x590f74){logger[_0x487d('0xf')](_0x487d('0x11'),_0x57c04f);logger['debug'](_0x487d('0x11'),_0x57c04f,JSON['stringify'](_0x590f74));_0x56f3d8(_0x590f74);})[_0x487d('0x1f')](function(_0x1271a7){logger[_0x487d('0xc')](_0x487d('0x11'),_0x1271a7[_0x487d('0xe')],_0x57c04f);_0x14224f(_0x3d2beb[_0x487d('0xc')](0x1f4,_0x1271a7[_0x487d('0xe')]));});});});};
\ No newline at end of file
+var _0xb821=['raw','ShowCmHopper','create','body','CreateCmHopper','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','Contact','keys','User','Agent','name','voicePause','length','UserId','push','update','includes','MoveContactManagedDialer','transaction','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','UPDATE','all','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','info','result','catch','CmHopper','findAll','options','where','include','model','map','attributes','GetCmHopper','find'];(function(_0x3902db,_0x594d5b){var _0xda52cf=function(_0x1d220){while(--_0x1d220){_0x3902db['push'](_0x3902db['shift']());}};_0xda52cf(++_0x594d5b);}(_0xb821,0x1d7));var _0x1b82=function(_0x126e4b,_0x505a51){_0x126e4b=_0x126e4b-0x0;var _0x2915e3=_0xb821[_0x126e4b];return _0x2915e3;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b82('0x2'));var fs=require('fs');var Redis=require(_0x1b82('0x3'));var db=require(_0x1b82('0x4'))['db'];var utils=require(_0x1b82('0x5'));var logger=require(_0x1b82('0x6'))('rpc');var config=require(_0x1b82('0x7'));var jayson=require(_0x1b82('0x8'));var client=jayson['client'][_0x1b82('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37c758,_0x3a53ad,_0x5ae5a5){return new BPromise(function(_0x5ca3d6,_0x49b45c){return client[_0x1b82('0xa')](_0x37c758,_0x5ae5a5)[_0x1b82('0xb')](function(_0x5e9181){logger['info']('CmHopper,\x20%s,\x20%s',_0x3a53ad,_0x1b82('0xc'));logger[_0x1b82('0xd')](_0x1b82('0xe'),_0x3a53ad,'request\x20sent',JSON[_0x1b82('0xf')](_0x5e9181));if(_0x5e9181[_0x1b82('0x10')]){if(_0x5e9181[_0x1b82('0x10')][_0x1b82('0x11')]===0x1f4){logger['error'](_0x1b82('0x12'),_0x3a53ad,_0x5e9181[_0x1b82('0x10')][_0x1b82('0x13')]);return _0x49b45c(_0x5e9181[_0x1b82('0x10')]['message']);}logger['error']('CmHopper,\x20%s,\x20%s',_0x3a53ad,_0x5e9181[_0x1b82('0x10')][_0x1b82('0x13')]);return _0x5ca3d6(_0x5e9181['error'][_0x1b82('0x13')]);}else{logger[_0x1b82('0x14')](_0x1b82('0x12'),_0x3a53ad,_0x1b82('0xc'));_0x5ca3d6(_0x5e9181[_0x1b82('0x15')][_0x1b82('0x13')]);}})[_0x1b82('0x16')](function(_0x3d986d){logger[_0x1b82('0x10')](_0x1b82('0x12'),_0x3a53ad,_0x3d986d);_0x49b45c(_0x3d986d);});});}exports['GetCmHopper']=function(_0x57e125){var _0x59ef4b=this;return new Promise(function(_0x5b20fa,_0x6921c7){return db[_0x1b82('0x17')][_0x1b82('0x18')]({'raw':_0x57e125['options']?_0x57e125['options']['raw']===undefined?!![]:![]:!![],'where':_0x57e125[_0x1b82('0x19')]?_0x57e125[_0x1b82('0x19')][_0x1b82('0x1a')]||null:null,'attributes':_0x57e125[_0x1b82('0x19')]?_0x57e125[_0x1b82('0x19')]['attributes']||null:null,'limit':_0x57e125[_0x1b82('0x19')]?_0x57e125[_0x1b82('0x19')]['limit']||null:null,'include':_0x57e125['options']?_0x57e125[_0x1b82('0x19')][_0x1b82('0x1b')]?_['map'](_0x57e125[_0x1b82('0x19')][_0x1b82('0x1b')],function(_0x4d0c18){return{'model':db[_0x4d0c18[_0x1b82('0x1c')]],'as':_0x4d0c18['as'],'attributes':_0x4d0c18['attributes'],'include':_0x4d0c18[_0x1b82('0x1b')]?_[_0x1b82('0x1d')](_0x4d0c18['include'],function(_0x1363a3){return{'model':db[_0x1363a3[_0x1b82('0x1c')]],'as':_0x1363a3['as'],'attributes':_0x1363a3[_0x1b82('0x1e')],'include':_0x1363a3[_0x1b82('0x1b')]?_[_0x1b82('0x1d')](_0x1363a3['include'],function(_0x570c13){return{'model':db[_0x570c13[_0x1b82('0x1c')]],'as':_0x570c13['as'],'attributes':_0x570c13[_0x1b82('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1b82('0xb')](function(_0x5adda0){logger[_0x1b82('0x14')](_0x1b82('0x1f'),_0x57e125);logger[_0x1b82('0xd')](_0x1b82('0x1f'),_0x57e125,JSON[_0x1b82('0xf')](_0x5adda0));_0x5b20fa(_0x5adda0);})[_0x1b82('0x16')](function(_0x16c78e){logger[_0x1b82('0x10')](_0x1b82('0x1f'),_0x16c78e[_0x1b82('0x13')],_0x57e125);_0x6921c7(_0x59ef4b[_0x1b82('0x10')](0x1f4,_0x16c78e[_0x1b82('0x13')]));});});};exports['ShowCmHopper']=function(_0x490944){var _0xf0a504=this;return new Promise(function(_0x33bc0d,_0x99fa1){return db[_0x1b82('0x17')][_0x1b82('0x20')]({'raw':_0x490944[_0x1b82('0x19')]?_0x490944['options'][_0x1b82('0x21')]===undefined?!![]:![]:!![],'where':_0x490944[_0x1b82('0x19')]?_0x490944[_0x1b82('0x19')][_0x1b82('0x1a')]||null:null,'attributes':_0x490944[_0x1b82('0x19')]?_0x490944[_0x1b82('0x19')][_0x1b82('0x1e')]||null:null,'include':_0x490944[_0x1b82('0x19')]?_0x490944[_0x1b82('0x19')]['include']?_['map'](_0x490944[_0x1b82('0x19')][_0x1b82('0x1b')],function(_0x4e2300){return{'model':db[_0x4e2300[_0x1b82('0x1c')]],'as':_0x4e2300['as'],'attributes':_0x4e2300[_0x1b82('0x1e')],'include':_0x4e2300[_0x1b82('0x1b')]?_['map'](_0x4e2300[_0x1b82('0x1b')],function(_0x2523fe){return{'model':db[_0x2523fe[_0x1b82('0x1c')]],'as':_0x2523fe['as'],'attributes':_0x2523fe[_0x1b82('0x1e')],'include':_0x2523fe['include']?_[_0x1b82('0x1d')](_0x2523fe['include'],function(_0xa83a5a){return{'model':db[_0xa83a5a[_0x1b82('0x1c')]],'as':_0xa83a5a['as'],'attributes':_0xa83a5a[_0x1b82('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1b82('0xb')](function(_0x347720){logger[_0x1b82('0x14')](_0x1b82('0x22'),_0x490944);logger['debug']('ShowCmHopper',_0x490944,JSON['stringify'](_0x347720));_0x33bc0d(_0x347720);})[_0x1b82('0x16')](function(_0x294646){logger[_0x1b82('0x10')]('ShowCmHopper',_0x294646[_0x1b82('0x13')],_0x490944);_0x99fa1(_0xf0a504[_0x1b82('0x10')](0x1f4,_0x294646[_0x1b82('0x13')]));});});};exports['CreateCmHopper']=function(_0x38413e){var _0x5c8ce7=this;return new Promise(function(_0x37e95b,_0x220ac9){return db['CmHopper'][_0x1b82('0x23')](_0x38413e[_0x1b82('0x24')],{'raw':_0x38413e[_0x1b82('0x19')]?_0x38413e[_0x1b82('0x19')][_0x1b82('0x21')]===undefined?!![]:![]:!![]})[_0x1b82('0xb')](function(_0x19f3ec){logger[_0x1b82('0x14')]('CreateCmHopper',_0x38413e);logger[_0x1b82('0xd')](_0x1b82('0x25'),_0x38413e,JSON[_0x1b82('0xf')](_0x19f3ec));_0x37e95b(_0x19f3ec);})[_0x1b82('0x16')](function(_0x64cb3d){logger['error'](_0x1b82('0x25'),_0x64cb3d['message'],_0x38413e);_0x220ac9(_0x5c8ce7['error'](0x1f4,_0x64cb3d['message']));});});};exports[_0x1b82('0x26')]=function(_0x54aa81){var _0x417389=this;return new Promise(function(_0x324800,_0x5d4f10){return db[_0x1b82('0x17')]['update'](_0x54aa81['body'],{'raw':_0x54aa81[_0x1b82('0x19')]?_0x54aa81['options'][_0x1b82('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54aa81[_0x1b82('0x19')]?_0x54aa81[_0x1b82('0x19')][_0x1b82('0x1a')]||null:null,'attributes':_0x54aa81['options']?_0x54aa81[_0x1b82('0x19')][_0x1b82('0x1e')]||null:null,'limit':_0x54aa81[_0x1b82('0x19')]?_0x54aa81[_0x1b82('0x19')]['limit']||null:null})[_0x1b82('0xb')](function(_0x18f3f7){logger['info'](_0x1b82('0x26'),_0x54aa81);logger[_0x1b82('0xd')](_0x1b82('0x26'),_0x54aa81,JSON[_0x1b82('0xf')](_0x18f3f7));_0x324800(_0x18f3f7);})[_0x1b82('0x16')](function(_0x157ff6){logger[_0x1b82('0x10')](_0x1b82('0x26'),_0x157ff6[_0x1b82('0x13')],_0x54aa81);_0x5d4f10(_0x417389[_0x1b82('0x10')](0x1f4,_0x157ff6['message']));});});};exports[_0x1b82('0x27')]=function(_0x55e90a){var _0x346e81=this;return new Promise(function(_0x4afa9a,_0x1f2db7){return db['CmHopper'][_0x1b82('0x28')]({'where':_0x55e90a[_0x1b82('0x19')]?_0x55e90a['options'][_0x1b82('0x1a')]||null:null})['then'](function(_0x19a914){logger['info']('DestroyCmHopper',_0x55e90a);logger[_0x1b82('0xd')]('DestroyCmHopper',_0x55e90a,JSON[_0x1b82('0xf')](_0x19a914));_0x4afa9a(_0x19a914);})[_0x1b82('0x16')](function(_0x3d11e6){logger['error'](_0x1b82('0x27'),_0x3d11e6[_0x1b82('0x13')],_0x55e90a);_0x1f2db7(_0x346e81['error'](0x1f4,_0x3d11e6[_0x1b82('0x13')]));});});};exports[_0x1b82('0x29')]=function(_0x4979d6){var _0x1548d1=this;return new Promise(function(_0x461c6c,_0x562562){return db[_0x1b82('0x2a')][_0x1b82('0x2b')]()[_0x1b82('0xb')](function(_0x3d10c1){return db[_0x1b82('0x2c')]['transaction'](function(_0x41a2b5){return db['CmHopper'][_0x1b82('0x18')]({'where':_0x4979d6[_0x1b82('0x19')]?_0x4979d6[_0x1b82('0x19')]['where']||null:null,'attributes':_0x4979d6['options']?_0x4979d6[_0x1b82('0x19')][_0x1b82('0x1e')]||null:null,'limit':_0x4979d6[_0x1b82('0x19')]?_0x4979d6[_0x1b82('0x19')]['limit']||null:null,'order':_0x4979d6[_0x1b82('0x19')]?_0x4979d6[_0x1b82('0x19')][_0x1b82('0x2d')]||null:null,'transaction':_0x41a2b5,'lock':_0x41a2b5['LOCK']['UPDATE'],'include':[{'model':db[_0x1b82('0x2a')],'as':_0x1b82('0x2e'),'attributes':_[_0x1b82('0x2f')](_0x3d10c1)},{'model':db[_0x1b82('0x30')],'as':_0x1b82('0x31'),'attributes':['id',_0x1b82('0x32'),_0x1b82('0x33')]}]})[_0x1b82('0xb')](function(_0x3fbe92){var _0x20d14c=[];var _0x1560ff=[];for(var _0x2d0a7c=0x0;_0x2d0a7c<_0x3fbe92[_0x1b82('0x34')];_0x2d0a7c+=0x1){var _0xdc8a6a=_0x3fbe92[_0x2d0a7c][_0x1b82('0x35')];if(_0xdc8a6a===null){_0x20d14c[_0x1b82('0x36')](_0x3fbe92[_0x2d0a7c][_0x1b82('0x37')](_0x4979d6['body'],{'transaction':_0x41a2b5}));}else if(!_0x1560ff[_0x1b82('0x38')](_0xdc8a6a)){_0x1560ff[_0x1b82('0x36')](_0xdc8a6a);_0x20d14c['push'](_0x3fbe92[_0x2d0a7c][_0x1b82('0x37')](_0x4979d6['body'],{'transaction':_0x41a2b5}));}}return BPromise['all'](_0x20d14c);});})[_0x1b82('0xb')](function(_0xbdc055){logger[_0x1b82('0x14')]('GetContactDialer',_0x4979d6);logger['debug'](_0x1b82('0x29'),_0x4979d6,JSON[_0x1b82('0xf')](_0xbdc055));_0x461c6c(_0xbdc055);})[_0x1b82('0x16')](function(_0x5ae519){logger[_0x1b82('0x10')](_0x1b82('0x29'),_0x5ae519[_0x1b82('0x13')],_0x4979d6);_0x562562(_0x1548d1[_0x1b82('0x10')](0x1f4,_0x5ae519[_0x1b82('0x13')]));});});});};exports[_0x1b82('0x39')]=function(_0x58f8ac){var _0x8fca96=this;return new Promise(function(_0xff307b,_0x21cf70){return db[_0x1b82('0x2c')][_0x1b82('0x3a')](function(_0x4c609e){return db['CmHopperFinal']['create'](_0x58f8ac[_0x1b82('0x24')],{'raw':_0x58f8ac['options']?_0x58f8ac['options'][_0x1b82('0x21')]===undefined?!![]:![]:!![],'transaction':_0x4c609e})[_0x1b82('0xb')](function(){return db[_0x1b82('0x17')]['destroy']({'where':_0x58f8ac['options']?_0x58f8ac[_0x1b82('0x19')][_0x1b82('0x1a')]||null:null,'transaction':_0x4c609e});});})[_0x1b82('0xb')](function(_0x1c4122){logger['info'](_0x1b82('0x39'),_0x58f8ac);logger[_0x1b82('0xd')](_0x1b82('0x39'),_0x58f8ac,JSON[_0x1b82('0xf')](_0x1c4122));_0xff307b(_0x1c4122);})[_0x1b82('0x16')](function(_0x4953d8){logger['error']('MoveContactManagedDialer',_0x4953d8[_0x1b82('0x13')],_0x58f8ac);_0x21cf70(_0x8fca96[_0x1b82('0x10')](0x1f4,_0x4953d8['message']));});});};exports[_0x1b82('0x3b')]=function(_0xa0cfc2){var _0x295eb9=this;return new Promise(function(_0x43e684,_0x216c67){return db[_0x1b82('0x17')]['findAll']({'raw':_0xa0cfc2[_0x1b82('0x19')]?_0xa0cfc2[_0x1b82('0x19')][_0x1b82('0x21')]===undefined?!![]:![]:!![],'where':_0xa0cfc2[_0x1b82('0x19')]?_0xa0cfc2[_0x1b82('0x19')][_0x1b82('0x1a')]||null:null,'attributes':[[db[_0x1b82('0x2c')]['fn'](_0x1b82('0x3c'),db[_0x1b82('0x2c')]['fn']('IF',db[_0x1b82('0x2c')][_0x1b82('0x3d')](_0x1b82('0x3e')+util['format'](_0x1b82('0x3f'),moment()[_0x1b82('0x40')](_0x1b82('0x41')))+_0x1b82('0x42')))),_0x1b82('0x43')]]})[_0x1b82('0xb')](function(_0x4e2dd1){logger['info'](_0x1b82('0x3b'),_0xa0cfc2);logger['debug'](_0x1b82('0x3b'),_0xa0cfc2,JSON[_0x1b82('0xf')](_0x4e2dd1));_0x43e684(_0x4e2dd1);})[_0x1b82('0x16')](function(_0x4b7865){logger[_0x1b82('0x10')](_0x1b82('0x3b'),_0x4b7865[_0x1b82('0x13')],_0xa0cfc2);_0x216c67(_0x295eb9[_0x1b82('0x10')](0x1f4,_0x4b7865['message']));});});};exports[_0x1b82('0x44')]=function(_0x848189){var _0x4ee3c2=this;return new Promise(function(_0x2205ef,_0x4f6a20){return db[_0x1b82('0x2a')][_0x1b82('0x2b')]()[_0x1b82('0xb')](function(_0x3c4bc9){return db['sequelize'][_0x1b82('0x3a')](function(_0x23a85c){return db[_0x1b82('0x17')][_0x1b82('0x18')]({'where':_0x848189[_0x1b82('0x19')]?_0x848189[_0x1b82('0x19')][_0x1b82('0x1a')]||null:null,'attributes':_0x848189[_0x1b82('0x19')]?_0x848189[_0x1b82('0x19')][_0x1b82('0x1e')]||null:null,'limit':0x1,'order':_0x848189[_0x1b82('0x19')]?_0x848189[_0x1b82('0x19')][_0x1b82('0x2d')]||null:null,'group':db['CmHopper'][_0x1b82('0x35')],'transaction':_0x23a85c,'lock':_0x23a85c[_0x1b82('0x45')][_0x1b82('0x46')],'include':_0x848189['options']?_0x848189[_0x1b82('0x19')][_0x1b82('0x1b')]?_[_0x1b82('0x1d')](_0x848189['options']['include'],function(_0x302089){return{'model':db[_0x302089[_0x1b82('0x1c')]],'as':_0x302089['as'],'attributes':_0x302089['attributes'],'include':_0x302089[_0x1b82('0x1b')]?_[_0x1b82('0x1d')](_0x302089[_0x1b82('0x1b')],function(_0x47c04f){return{'model':db[_0x47c04f[_0x1b82('0x1c')]],'as':_0x47c04f['as'],'attributes':_0x47c04f[_0x1b82('0x1e')],'include':_0x47c04f[_0x1b82('0x1b')]?_[_0x1b82('0x1d')](_0x47c04f[_0x1b82('0x1b')],function(_0x41e727){return{'model':db[_0x41e727[_0x1b82('0x1c')]],'as':_0x41e727['as'],'attributes':_0x41e727[_0x1b82('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1b82('0xb')](function(_0x3c26fc){var _0x6db296=[];for(var _0x173e9e=0x0;_0x173e9e<_0x3c26fc[_0x1b82('0x34')];_0x173e9e+=0x1){_0x6db296[_0x1b82('0x36')](_0x3c26fc[_0x173e9e][_0x1b82('0x37')](_0x848189[_0x1b82('0x24')],{'transaction':_0x23a85c}));}return BPromise[_0x1b82('0x47')](_0x6db296);});})[_0x1b82('0xb')](function(_0x2bff09){logger[_0x1b82('0x14')](_0x1b82('0x44'),_0x848189);logger[_0x1b82('0xd')]('GetContactRecallMe',_0x848189,JSON[_0x1b82('0xf')](_0x2bff09));_0x2205ef(_0x2bff09);})[_0x1b82('0x16')](function(_0x4d89fc){logger[_0x1b82('0x10')](_0x1b82('0x44'),_0x4d89fc['message'],_0x848189);_0x4f6a20(_0x4ee3c2['error'](0x1f4,_0x4d89fc[_0x1b82('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x46cb20){var _0x1179dd=this;return new Promise(function(_0x150981,_0x4a7845){db[_0x1b82('0x2a')][_0x1b82('0x2b')]()['then'](function(_0x4060aa){return db[_0x1b82('0x17')][_0x1b82('0x18')]({'raw':_0x46cb20[_0x1b82('0x19')]?_0x46cb20[_0x1b82('0x19')][_0x1b82('0x21')]===undefined?!![]:![]:!![],'where':_0x46cb20[_0x1b82('0x19')]?_0x46cb20[_0x1b82('0x19')][_0x1b82('0x1a')]||null:null,'attributes':_0x46cb20[_0x1b82('0x19')]?_0x46cb20[_0x1b82('0x19')][_0x1b82('0x1e')]||null:null,'limit':_0x46cb20['options']?_0x46cb20['options']['limit']||null:null,'include':_0x46cb20[_0x1b82('0x19')]?_0x46cb20['options'][_0x1b82('0x1b')]?_[_0x1b82('0x1d')](_0x46cb20[_0x1b82('0x19')][_0x1b82('0x1b')],function(_0x544daf){return{'model':db[_0x544daf[_0x1b82('0x1c')]],'as':_0x544daf['as'],'attributes':_0x544daf['as']===_0x1b82('0x2e')?_[_0x1b82('0x2f')](_0x4060aa):_0x544daf[_0x1b82('0x1e')],'include':_0x544daf[_0x1b82('0x1b')]?_[_0x1b82('0x1d')](_0x544daf['include'],function(_0x36c269){return{'model':db[_0x36c269[_0x1b82('0x1c')]],'as':_0x36c269['as'],'attributes':_0x36c269[_0x1b82('0x1e')],'include':_0x36c269['include']?_['map'](_0x36c269[_0x1b82('0x1b')],function(_0x239309){return{'model':db[_0x239309[_0x1b82('0x1c')]],'as':_0x239309['as'],'attributes':_0x239309[_0x1b82('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1b82('0xb')](function(_0x34a20e){logger[_0x1b82('0x14')]('GetCmHopper',_0x46cb20);logger[_0x1b82('0xd')](_0x1b82('0x1f'),_0x46cb20,JSON[_0x1b82('0xf')](_0x34a20e));_0x150981(_0x34a20e);})[_0x1b82('0x16')](function(_0x33a27c){logger['error'](_0x1b82('0x1f'),_0x33a27c[_0x1b82('0x13')],_0x46cb20);_0x4a7845(_0x1179dd['error'](0x1f4,_0x33a27c[_0x1b82('0x13')]));});});});};
\ No newline at end of file
index 0493bc5..3602a60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebea=['destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopper.controller','isAuthenticated','/describe','describe','/opencontacts','get','show','post','getPreview','put','/:id','update','delete'];(function(_0x427ce9,_0x4cf02f){var _0x7e76a1=function(_0x5c8c19){while(--_0x5c8c19){_0x427ce9['push'](_0x427ce9['shift']());}};_0x7e76a1(++_0x4cf02f);}(_0xebea,0x1e5));var _0xaebe=function(_0x255384,_0xd1dc8b){_0x255384=_0x255384-0x0;var _0x174a68=_0xebea[_0x255384];return _0x174a68;};'use strict';var multer=require(_0xaebe('0x0'));var util=require('util');var path=require(_0xaebe('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaebe('0x2')]();var fs_extra=require(_0xaebe('0x3'));var auth=require(_0xaebe('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaebe('0x5'));var controller=require(_0xaebe('0x6'));router['get']('/',auth[_0xaebe('0x7')](),controller['index']);router['get'](_0xaebe('0x8'),auth[_0xaebe('0x7')](),controller[_0xaebe('0x9')]);router['get'](_0xaebe('0xa'),auth[_0xaebe('0x7')](),controller['getOpenContacts']);router[_0xaebe('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xaebe('0xc')]);router[_0xaebe('0xd')]('/',auth[_0xaebe('0x7')](),controller['create']);router[_0xaebe('0xd')]('/preview',auth['isAuthenticated'](),controller[_0xaebe('0xe')]);router[_0xaebe('0xf')](_0xaebe('0x10'),auth[_0xaebe('0x7')](),controller[_0xaebe('0x11')]);router[_0xaebe('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xaebe('0x13')]);module[_0xaebe('0x14')]=router;
\ No newline at end of file
+var _0xab1d=['../../config/environment','./cmHopper.controller','/describe','isAuthenticated','describe','get','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0xb10ff2,_0x16eb90){var _0x2631da=function(_0x52960f){while(--_0x52960f){_0xb10ff2['push'](_0xb10ff2['shift']());}};_0x2631da(++_0x16eb90);}(_0xab1d,0x132));var _0xdab1=function(_0x30482d,_0x751e39){_0x30482d=_0x30482d-0x0;var _0x58f212=_0xab1d[_0x30482d];return _0x58f212;};'use strict';var multer=require(_0xdab1('0x0'));var util=require(_0xdab1('0x1'));var path=require(_0xdab1('0x2'));var timeout=require(_0xdab1('0x3'));var express=require('express');var router=express[_0xdab1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdab1('0x5'));var config=require(_0xdab1('0x6'));var controller=require(_0xdab1('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xdab1('0x8'),auth[_0xdab1('0x9')](),controller[_0xdab1('0xa')]);router[_0xdab1('0xb')](_0xdab1('0xc'),auth[_0xdab1('0x9')](),controller[_0xdab1('0xd')]);router[_0xdab1('0xb')](_0xdab1('0xe'),auth['isAuthenticated'](),controller[_0xdab1('0xf')]);router[_0xdab1('0x10')]('/',auth[_0xdab1('0x9')](),controller[_0xdab1('0x11')]);router[_0xdab1('0x10')](_0xdab1('0x12'),auth[_0xdab1('0x9')](),controller[_0xdab1('0x13')]);router[_0xdab1('0x14')]('/:id',auth[_0xdab1('0x9')](),controller[_0xdab1('0x15')]);router[_0xdab1('0x16')](_0xdab1('0xe'),auth[_0xdab1('0x9')](),controller[_0xdab1('0x17')]);module['exports']=router;
\ No newline at end of file
index b8398d4..c384657 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e03=['YYYY-MM-DD\x20HH:mm:ss','exports','INTEGER','format'];(function(_0x9862c5,_0x476800){var _0x109d5b=function(_0x582ad1){while(--_0x582ad1){_0x9862c5['push'](_0x9862c5['shift']());}};_0x109d5b(++_0x476800);}(_0x1e03,0x161));var _0x31e0=function(_0x5701a5,_0x231966){_0x5701a5=_0x5701a5-0x0;var _0x4d0a98=_0x1e03[_0x5701a5];return _0x4d0a98;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x31e0('0x0')]={'CmHopperId':{'type':Sequelize[_0x31e0('0x1')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x31e0('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x31e0('0x2')](_0x31e0('0x3'))},'countbusyretry':{'type':Sequelize[_0x31e0('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x31e0('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x31e0('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x31e0('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x31e0('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x31e0('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x31e0('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6a13=['exports','INTEGER','STRING','DATE','format','sequelize'];(function(_0x3a7a9a,_0x560f34){var _0x521a2c=function(_0x68a5d2){while(--_0x68a5d2){_0x3a7a9a['push'](_0x3a7a9a['shift']());}};_0x521a2c(++_0x560f34);}(_0x6a13,0x1c1));var _0x36a1=function(_0x488964,_0x37ddb0){_0x488964=_0x488964-0x0;var _0x404b25=_0x6a13[_0x488964];return _0x404b25;};'use strict';var moment=require('moment');var Sequelize=require(_0x36a1('0x0'));module[_0x36a1('0x1')]={'CmHopperId':{'type':Sequelize[_0x36a1('0x2')]},'phone':{'type':Sequelize[_0x36a1('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x36a1('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x36a1('0x4')],'defaultValue':moment()[_0x36a1('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x36a1('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x36a1('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x36a1('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x36a1('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x36a1('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x36a1('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 791e7d6..79caf54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cca=['../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','end','error','name','send','index','CmHopperAdditionalPhone','rawAttributes','query','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','options','findAll','rows','params','keys','includeAll','include','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x4cca,0x84));var _0xa4cc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4cca[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4cc('0x0'));var zipdir=require(_0xa4cc('0x1'));var jsonpatch=require(_0xa4cc('0x2'));var rp=require(_0xa4cc('0x3'));var moment=require(_0xa4cc('0x4'));var BPromise=require(_0xa4cc('0x5'));var Mustache=require(_0xa4cc('0x6'));var util=require(_0xa4cc('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa4cc('0x8'));var fs=require('fs');var fs_extra=require(_0xa4cc('0x9'));var _=require(_0xa4cc('0xa'));var squel=require(_0xa4cc('0xb'));var crypto=require(_0xa4cc('0xc'));var jsforce=require(_0xa4cc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa4cc('0xe'));var Redis=require(_0xa4cc('0xf'));var authService=require(_0xa4cc('0x10'));var qs=require(_0xa4cc('0x11'));var as=require(_0xa4cc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa4cc('0x13'));var config=require(_0xa4cc('0x14'));var licenseUtil=require(_0xa4cc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461a78,_0x26042b){_0x26042b=_0x26042b||0xcc;return function(_0x23b810){if(_0x23b810){return _0x461a78[_0xa4cc('0x16')](_0x26042b);}return _0x461a78[_0xa4cc('0x17')](_0x26042b)['end']();};}function respondWithResult(_0x221b60,_0x1b968b){_0x1b968b=_0x1b968b||0xc8;return function(_0x34e195){if(_0x34e195){return _0x221b60[_0xa4cc('0x17')](_0x1b968b)[_0xa4cc('0x18')](_0x34e195);}};}function respondWithFilteredResult(_0x5aa81a,_0x4cde59){return function(_0x4682d8){if(_0x4682d8){var _0x325ca6=typeof _0x4cde59[_0xa4cc('0x19')]===_0xa4cc('0x1a')&&typeof _0x4cde59['limit']==='undefined';var _0x3f9cb5=_0x4682d8[_0xa4cc('0x1b')];var _0x4e78a0=_0x325ca6?0x0:_0x4cde59[_0xa4cc('0x19')];var _0x15b2fe=_0x325ca6?_0x4682d8[_0xa4cc('0x1b')]:_0x4cde59['offset']+_0x4cde59[_0xa4cc('0x1c')];var _0x2ad978;if(_0x15b2fe>=_0x3f9cb5){_0x15b2fe=_0x3f9cb5;_0x2ad978=0xc8;}else{_0x2ad978=0xce;}_0x5aa81a[_0xa4cc('0x17')](_0x2ad978);return _0x5aa81a[_0xa4cc('0x1d')](_0xa4cc('0x1e'),_0x4e78a0+'-'+_0x15b2fe+'/'+_0x3f9cb5)[_0xa4cc('0x18')](_0x4682d8);}return null;};}function patchUpdates(_0x624a08){return function(_0x29e11c){try{jsonpatch['apply'](_0x29e11c,_0x624a08,!![]);}catch(_0x1007e9){return BPromise['reject'](_0x1007e9);}return _0x29e11c['save']();};}function saveUpdates(_0x4750f1,_0x15a3ee){return function(_0x3836cf){if(_0x3836cf){return _0x3836cf[_0xa4cc('0x1f')](_0x4750f1)[_0xa4cc('0x20')](function(_0x4deadb){return _0x4deadb;});}return null;};}function removeEntity(_0x2c65ba,_0x2da6cc){return function(_0x1c1e04){if(_0x1c1e04){return _0x1c1e04['destroy']()[_0xa4cc('0x20')](function(){var _0x28aa58=_0x1c1e04[_0xa4cc('0x21')]({'plain':!![]});var _0xf93ecc=_0xa4cc('0x22');return db[_0xa4cc('0x23')][_0xa4cc('0x24')]({'where':{'type':_0xf93ecc,'resourceId':_0x28aa58['id']}})['then'](function(){return _0x1c1e04;});})[_0xa4cc('0x20')](function(){_0x2c65ba[_0xa4cc('0x17')](0xcc)[_0xa4cc('0x25')]();});}};}function handleEntityNotFound(_0x7c0fa8,_0x1add61){return function(_0x5f493b){if(!_0x5f493b){_0x7c0fa8[_0xa4cc('0x16')](0x194);}return _0x5f493b;};}function handleError(_0x37eccb,_0x7c65b6){_0x7c65b6=_0x7c65b6||0x1f4;return function(_0x142f30){logger[_0xa4cc('0x26')](_0x142f30['stack']);if(_0x142f30[_0xa4cc('0x27')]){delete _0x142f30['name'];}_0x37eccb[_0xa4cc('0x17')](_0x7c65b6)[_0xa4cc('0x28')](_0x142f30);};}exports[_0xa4cc('0x29')]=function(_0x51a0f8,_0x5d884d){var _0x375f9e={},_0x3ddc20={},_0x11e793={'count':0x0,'rows':[]};var _0x23567a=_['map'](db[_0xa4cc('0x2a')][_0xa4cc('0x2b')],function(_0x30e37a){return{'name':_0x30e37a['fieldName'],'type':_0x30e37a['type']['key']};});_0x3ddc20['model']=_['map'](_0x23567a,'name');_0x3ddc20[_0xa4cc('0x2c')]=_['keys'](_0x51a0f8[_0xa4cc('0x2c')]);_0x3ddc20['filters']=_['intersection'](_0x3ddc20[_0xa4cc('0x2d')],_0x3ddc20['query']);_0x375f9e[_0xa4cc('0x2e')]=_[_0xa4cc('0x2f')](_0x3ddc20['model'],qs[_0xa4cc('0x30')](_0x51a0f8['query'][_0xa4cc('0x30')]));_0x375f9e['attributes']=_0x375f9e[_0xa4cc('0x2e')][_0xa4cc('0x31')]?_0x375f9e[_0xa4cc('0x2e')]:_0x3ddc20[_0xa4cc('0x2d')];if(!_0x51a0f8[_0xa4cc('0x2c')]['hasOwnProperty'](_0xa4cc('0x32'))){_0x375f9e['limit']=qs[_0xa4cc('0x1c')](_0x51a0f8[_0xa4cc('0x2c')][_0xa4cc('0x1c')]);_0x375f9e[_0xa4cc('0x19')]=qs[_0xa4cc('0x19')](_0x51a0f8['query'][_0xa4cc('0x19')]);}_0x375f9e[_0xa4cc('0x33')]=qs[_0xa4cc('0x34')](_0x51a0f8[_0xa4cc('0x2c')][_0xa4cc('0x34')]);_0x375f9e[_0xa4cc('0x35')]=qs[_0xa4cc('0x36')](_[_0xa4cc('0x37')](_0x51a0f8[_0xa4cc('0x2c')],_0x3ddc20[_0xa4cc('0x36')]),_0x23567a);if(_0x51a0f8[_0xa4cc('0x2c')][_0xa4cc('0x38')]){_0x375f9e['where']=_[_0xa4cc('0x39')](_0x375f9e[_0xa4cc('0x35')],{'$or':_[_0xa4cc('0x3a')](_0x23567a,function(_0x2310b2){if(_0x2310b2['type']!=='VIRTUAL'){var _0x3c4849={};_0x3c4849[_0x2310b2['name']]={'$like':'%'+_0x51a0f8[_0xa4cc('0x2c')][_0xa4cc('0x38')]+'%'};return _0x3c4849;}})});}_0x375f9e=_[_0xa4cc('0x39')]({},_0x375f9e,_0x51a0f8[_0xa4cc('0x3b')]);var _0x5c7092={'where':_0x375f9e[_0xa4cc('0x35')]};return db[_0xa4cc('0x2a')][_0xa4cc('0x1b')](_0x5c7092)[_0xa4cc('0x20')](function(_0x696392){_0x11e793[_0xa4cc('0x1b')]=_0x696392;if(_0x51a0f8['query']['includeAll']){_0x375f9e['include']=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xa4cc('0x3c')](_0x375f9e);})[_0xa4cc('0x20')](function(_0x47946d){_0x11e793[_0xa4cc('0x3d')]=_0x47946d;return _0x11e793;})[_0xa4cc('0x20')](respondWithFilteredResult(_0x5d884d,_0x375f9e))['catch'](handleError(_0x5d884d,null));};exports['show']=function(_0x59871f,_0x56e938){var _0x1d9002={'raw':!![],'where':{'id':_0x59871f[_0xa4cc('0x3e')]['id']}},_0x1b7d4e={};_0x1b7d4e[_0xa4cc('0x2d')]=_[_0xa4cc('0x3f')](db[_0xa4cc('0x2a')]['rawAttributes']);_0x1b7d4e[_0xa4cc('0x2c')]=_[_0xa4cc('0x3f')](_0x59871f[_0xa4cc('0x2c')]);_0x1b7d4e['filters']=_[_0xa4cc('0x2f')](_0x1b7d4e['model'],_0x1b7d4e[_0xa4cc('0x2c')]);_0x1d9002[_0xa4cc('0x2e')]=_[_0xa4cc('0x2f')](_0x1b7d4e[_0xa4cc('0x2d')],qs[_0xa4cc('0x30')](_0x59871f[_0xa4cc('0x2c')][_0xa4cc('0x30')]));_0x1d9002[_0xa4cc('0x2e')]=_0x1d9002['attributes'][_0xa4cc('0x31')]?_0x1d9002[_0xa4cc('0x2e')]:_0x1b7d4e[_0xa4cc('0x2d')];if(_0x59871f['query'][_0xa4cc('0x40')]){_0x1d9002[_0xa4cc('0x41')]=[{'all':!![]}];}_0x1d9002=_[_0xa4cc('0x39')]({},_0x1d9002,_0x59871f[_0xa4cc('0x3b')]);return db['CmHopperAdditionalPhone']['find'](_0x1d9002)['then'](handleEntityNotFound(_0x56e938,null))[_0xa4cc('0x20')](respondWithResult(_0x56e938,null))[_0xa4cc('0x42')](handleError(_0x56e938,null));};exports[_0xa4cc('0x43')]=function(_0xf3e9ab,_0x1153ed){return db[_0xa4cc('0x2a')][_0xa4cc('0x43')](_0xf3e9ab[_0xa4cc('0x44')],{})[_0xa4cc('0x20')](function(_0xf814cb){var _0x349f18=_0xf3e9ab['user'][_0xa4cc('0x21')]({'plain':!![]});if(!_0x349f18)throw new Error(_0xa4cc('0x45'));if(_0x349f18['role']===_0xa4cc('0x46')){var _0x17c32b=_0xf814cb[_0xa4cc('0x21')]({'plain':!![]});var _0x32ac5e=_0xa4cc('0x22');return db[_0xa4cc('0x47')][_0xa4cc('0x48')]({'where':{'name':_0x32ac5e,'userProfileId':_0x349f18['userProfileId']},'raw':!![]})[_0xa4cc('0x20')](function(_0x392a0c){if(_0x392a0c&&_0x392a0c[_0xa4cc('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x17c32b[_0xa4cc('0x27')],'resourceId':_0x17c32b['id'],'type':_0x392a0c[_0xa4cc('0x27')],'sectionId':_0x392a0c['id']},{})[_0xa4cc('0x20')](function(){return _0xf814cb;});}else{return _0xf814cb;}})[_0xa4cc('0x42')](function(_0xa9d712){logger[_0xa4cc('0x26')](_0xa4cc('0x4a'),_0xa9d712);throw _0xa9d712;});}return _0xf814cb;})[_0xa4cc('0x20')](respondWithResult(_0x1153ed,0xc9))[_0xa4cc('0x42')](handleError(_0x1153ed,null));};exports[_0xa4cc('0x1f')]=function(_0x541be4,_0x56f88b){if(_0x541be4[_0xa4cc('0x44')]['id']){delete _0x541be4[_0xa4cc('0x44')]['id'];}return db[_0xa4cc('0x2a')][_0xa4cc('0x48')]({'where':{'id':_0x541be4['params']['id']}})['then'](handleEntityNotFound(_0x56f88b,null))['then'](saveUpdates(_0x541be4[_0xa4cc('0x44')],null))[_0xa4cc('0x20')](respondWithResult(_0x56f88b,null))[_0xa4cc('0x42')](handleError(_0x56f88b,null));};exports[_0xa4cc('0x24')]=function(_0x424723,_0x3e4624){return db[_0xa4cc('0x2a')][_0xa4cc('0x48')]({'where':{'id':_0x424723[_0xa4cc('0x3e')]['id']}})[_0xa4cc('0x20')](handleEntityNotFound(_0x3e4624,null))[_0xa4cc('0x20')](removeEntity(_0x3e4624,null))[_0xa4cc('0x42')](handleError(_0x3e4624,null));};
\ No newline at end of file
+var _0xb8f0=['stack','name','send','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','includeAll','include','rows','catch','show','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','error'];(function(_0x129954,_0x17b156){var _0x2b40f2=function(_0x5b3ce1){while(--_0x5b3ce1){_0x129954['push'](_0x129954['shift']());}};_0x2b40f2(++_0x17b156);}(_0xb8f0,0x174));var _0x0b8f=function(_0x3d35b9,_0x1d9037){_0x3d35b9=_0x3d35b9-0x0;var _0x5f19b0=_0xb8f0[_0x3d35b9];return _0x5f19b0;};'use strict';var emlformat=require(_0x0b8f('0x0'));var rimraf=require(_0x0b8f('0x1'));var zipdir=require(_0x0b8f('0x2'));var jsonpatch=require(_0x0b8f('0x3'));var rp=require(_0x0b8f('0x4'));var moment=require(_0x0b8f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0b8f('0x6'));var util=require(_0x0b8f('0x7'));var path=require(_0x0b8f('0x8'));var sox=require(_0x0b8f('0x9'));var csv=require(_0x0b8f('0xa'));var ejs=require(_0x0b8f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b8f('0xc'));var squel=require(_0x0b8f('0xd'));var crypto=require('crypto');var jsforce=require(_0x0b8f('0xe'));var deskjs=require(_0x0b8f('0xf'));var toCsv=require(_0x0b8f('0xa'));var querystring=require(_0x0b8f('0x10'));var Papa=require(_0x0b8f('0x11'));var Redis=require('ioredis');var authService=require(_0x0b8f('0x12'));var qs=require(_0x0b8f('0x13'));var as=require(_0x0b8f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0b8f('0x15'));var utils=require(_0x0b8f('0x16'));var config=require(_0x0b8f('0x17'));var licenseUtil=require(_0x0b8f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x538117,_0x4e2897){_0x4e2897=_0x4e2897||0xcc;return function(_0x51bbe1){if(_0x51bbe1){return _0x538117[_0x0b8f('0x19')](_0x4e2897);}return _0x538117['status'](_0x4e2897)[_0x0b8f('0x1a')]();};}function respondWithResult(_0x413809,_0x569a8f){_0x569a8f=_0x569a8f||0xc8;return function(_0x245d51){if(_0x245d51){return _0x413809['status'](_0x569a8f)['json'](_0x245d51);}};}function respondWithFilteredResult(_0x164307,_0x5a058d){return function(_0x1c468a){if(_0x1c468a){var _0x42737a=typeof _0x5a058d['offset']===_0x0b8f('0x1b')&&typeof _0x5a058d[_0x0b8f('0x1c')]===_0x0b8f('0x1b');var _0x3fc35a=_0x1c468a[_0x0b8f('0x1d')];var _0x507774=_0x42737a?0x0:_0x5a058d['offset'];var _0x371783=_0x42737a?_0x1c468a[_0x0b8f('0x1d')]:_0x5a058d['offset']+_0x5a058d['limit'];var _0x3c843f;if(_0x371783>=_0x3fc35a){_0x371783=_0x3fc35a;_0x3c843f=0xc8;}else{_0x3c843f=0xce;}_0x164307[_0x0b8f('0x1e')](_0x3c843f);return _0x164307[_0x0b8f('0x1f')](_0x0b8f('0x20'),_0x507774+'-'+_0x371783+'/'+_0x3fc35a)[_0x0b8f('0x21')](_0x1c468a);}return null;};}function patchUpdates(_0x3d5ad0){return function(_0x238146){try{jsonpatch[_0x0b8f('0x22')](_0x238146,_0x3d5ad0,!![]);}catch(_0x45d198){return BPromise[_0x0b8f('0x23')](_0x45d198);}return _0x238146[_0x0b8f('0x24')]();};}function saveUpdates(_0x5360a1,_0x361abc){return function(_0x15fd4d){if(_0x15fd4d){return _0x15fd4d[_0x0b8f('0x25')](_0x5360a1)[_0x0b8f('0x26')](function(_0x3bf226){return _0x3bf226;});}return null;};}function removeEntity(_0x2b0477,_0x5f300a){return function(_0x436afc){if(_0x436afc){return _0x436afc[_0x0b8f('0x27')]()[_0x0b8f('0x26')](function(){var _0x18817f=_0x436afc['get']({'plain':!![]});var _0x15b85b=_0x0b8f('0x28');return db[_0x0b8f('0x29')][_0x0b8f('0x27')]({'where':{'type':_0x15b85b,'resourceId':_0x18817f['id']}})[_0x0b8f('0x26')](function(){return _0x436afc;});})[_0x0b8f('0x26')](function(){_0x2b0477[_0x0b8f('0x1e')](0xcc)[_0x0b8f('0x1a')]();});}};}function handleEntityNotFound(_0x41a132,_0x271edd){return function(_0x168ba8){if(!_0x168ba8){_0x41a132[_0x0b8f('0x19')](0x194);}return _0x168ba8;};}function handleError(_0x3ac8a2,_0x29dc5f){_0x29dc5f=_0x29dc5f||0x1f4;return function(_0x461073){logger[_0x0b8f('0x2a')](_0x461073[_0x0b8f('0x2b')]);if(_0x461073[_0x0b8f('0x2c')]){delete _0x461073[_0x0b8f('0x2c')];}_0x3ac8a2['status'](_0x29dc5f)[_0x0b8f('0x2d')](_0x461073);};}exports['index']=function(_0x4c7985,_0x471573){var _0x39a006={},_0x5272d8={},_0x2d10a4={'count':0x0,'rows':[]};var _0xc141c8=_['map'](db[_0x0b8f('0x2e')][_0x0b8f('0x2f')],function(_0xe0ce2e){return{'name':_0xe0ce2e[_0x0b8f('0x30')],'type':_0xe0ce2e[_0x0b8f('0x31')][_0x0b8f('0x32')]};});_0x5272d8['model']=_[_0x0b8f('0x33')](_0xc141c8,_0x0b8f('0x2c'));_0x5272d8[_0x0b8f('0x34')]=_[_0x0b8f('0x35')](_0x4c7985[_0x0b8f('0x34')]);_0x5272d8[_0x0b8f('0x36')]=_[_0x0b8f('0x37')](_0x5272d8['model'],_0x5272d8[_0x0b8f('0x34')]);_0x39a006['attributes']=_[_0x0b8f('0x37')](_0x5272d8['model'],qs[_0x0b8f('0x38')](_0x4c7985[_0x0b8f('0x34')][_0x0b8f('0x38')]));_0x39a006[_0x0b8f('0x39')]=_0x39a006[_0x0b8f('0x39')][_0x0b8f('0x3a')]?_0x39a006[_0x0b8f('0x39')]:_0x5272d8[_0x0b8f('0x3b')];if(!_0x4c7985[_0x0b8f('0x34')][_0x0b8f('0x3c')](_0x0b8f('0x3d'))){_0x39a006['limit']=qs[_0x0b8f('0x1c')](_0x4c7985[_0x0b8f('0x34')][_0x0b8f('0x1c')]);_0x39a006[_0x0b8f('0x3e')]=qs['offset'](_0x4c7985[_0x0b8f('0x34')]['offset']);}_0x39a006[_0x0b8f('0x3f')]=qs[_0x0b8f('0x40')](_0x4c7985[_0x0b8f('0x34')][_0x0b8f('0x40')]);_0x39a006[_0x0b8f('0x41')]=qs['filters'](_['pick'](_0x4c7985[_0x0b8f('0x34')],_0x5272d8[_0x0b8f('0x36')]),_0xc141c8);if(_0x4c7985[_0x0b8f('0x34')][_0x0b8f('0x42')]){_0x39a006[_0x0b8f('0x41')]=_[_0x0b8f('0x43')](_0x39a006[_0x0b8f('0x41')],{'$or':_[_0x0b8f('0x33')](_0xc141c8,function(_0x43a4ea){if(_0x43a4ea[_0x0b8f('0x31')]!=='VIRTUAL'){var _0x3871f7={};_0x3871f7[_0x43a4ea['name']]={'$like':'%'+_0x4c7985['query'][_0x0b8f('0x42')]+'%'};return _0x3871f7;}})});}_0x39a006=_[_0x0b8f('0x43')]({},_0x39a006,_0x4c7985['options']);var _0x2897a4={'where':_0x39a006[_0x0b8f('0x41')]};return db[_0x0b8f('0x2e')][_0x0b8f('0x1d')](_0x2897a4)[_0x0b8f('0x26')](function(_0x5c8402){_0x2d10a4[_0x0b8f('0x1d')]=_0x5c8402;if(_0x4c7985['query'][_0x0b8f('0x44')]){_0x39a006[_0x0b8f('0x45')]=[{'all':!![]}];}return db[_0x0b8f('0x2e')]['findAll'](_0x39a006);})[_0x0b8f('0x26')](function(_0x37d45b){_0x2d10a4[_0x0b8f('0x46')]=_0x37d45b;return _0x2d10a4;})[_0x0b8f('0x26')](respondWithFilteredResult(_0x471573,_0x39a006))[_0x0b8f('0x47')](handleError(_0x471573,null));};exports[_0x0b8f('0x48')]=function(_0x301c4d,_0x30d7e6){var _0x41307c={'raw':!![],'where':{'id':_0x301c4d[_0x0b8f('0x49')]['id']}},_0x592bf1={};_0x592bf1['model']=_['keys'](db[_0x0b8f('0x2e')][_0x0b8f('0x2f')]);_0x592bf1[_0x0b8f('0x34')]=_[_0x0b8f('0x35')](_0x301c4d[_0x0b8f('0x34')]);_0x592bf1[_0x0b8f('0x36')]=_[_0x0b8f('0x37')](_0x592bf1['model'],_0x592bf1[_0x0b8f('0x34')]);_0x41307c[_0x0b8f('0x39')]=_[_0x0b8f('0x37')](_0x592bf1[_0x0b8f('0x3b')],qs[_0x0b8f('0x38')](_0x301c4d[_0x0b8f('0x34')][_0x0b8f('0x38')]));_0x41307c[_0x0b8f('0x39')]=_0x41307c['attributes'][_0x0b8f('0x3a')]?_0x41307c['attributes']:_0x592bf1[_0x0b8f('0x3b')];if(_0x301c4d['query'][_0x0b8f('0x44')]){_0x41307c[_0x0b8f('0x45')]=[{'all':!![]}];}_0x41307c=_[_0x0b8f('0x43')]({},_0x41307c,_0x301c4d[_0x0b8f('0x4a')]);return db['CmHopperAdditionalPhone'][_0x0b8f('0x4b')](_0x41307c)[_0x0b8f('0x26')](handleEntityNotFound(_0x30d7e6,null))[_0x0b8f('0x26')](respondWithResult(_0x30d7e6,null))[_0x0b8f('0x47')](handleError(_0x30d7e6,null));};exports[_0x0b8f('0x4c')]=function(_0x489768,_0x2aaac3){return db['CmHopperAdditionalPhone'][_0x0b8f('0x4c')](_0x489768['body'],{})['then'](function(_0x1b859c){var _0x42e6d3=_0x489768[_0x0b8f('0x4d')][_0x0b8f('0x4e')]({'plain':!![]});if(!_0x42e6d3)throw new Error(_0x0b8f('0x4f'));if(_0x42e6d3['role']===_0x0b8f('0x4d')){var _0x518a20=_0x1b859c[_0x0b8f('0x4e')]({'plain':!![]});var _0x4d1387=_0x0b8f('0x28');return db['UserProfileSection'][_0x0b8f('0x4b')]({'where':{'name':_0x4d1387,'userProfileId':_0x42e6d3[_0x0b8f('0x50')]},'raw':!![]})[_0x0b8f('0x26')](function(_0x22c97f){if(_0x22c97f&&_0x22c97f[_0x0b8f('0x51')]===0x0){return db['UserProfileResource'][_0x0b8f('0x4c')]({'name':_0x518a20[_0x0b8f('0x2c')],'resourceId':_0x518a20['id'],'type':_0x22c97f[_0x0b8f('0x2c')],'sectionId':_0x22c97f['id']},{})['then'](function(){return _0x1b859c;});}else{return _0x1b859c;}})[_0x0b8f('0x47')](function(_0x387e87){logger[_0x0b8f('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x387e87);throw _0x387e87;});}return _0x1b859c;})[_0x0b8f('0x26')](respondWithResult(_0x2aaac3,0xc9))[_0x0b8f('0x47')](handleError(_0x2aaac3,null));};exports[_0x0b8f('0x25')]=function(_0x2331e5,_0x49542f){if(_0x2331e5[_0x0b8f('0x52')]['id']){delete _0x2331e5[_0x0b8f('0x52')]['id'];}return db[_0x0b8f('0x2e')][_0x0b8f('0x4b')]({'where':{'id':_0x2331e5[_0x0b8f('0x49')]['id']}})['then'](handleEntityNotFound(_0x49542f,null))[_0x0b8f('0x26')](saveUpdates(_0x2331e5['body'],null))['then'](respondWithResult(_0x49542f,null))['catch'](handleError(_0x49542f,null));};exports[_0x0b8f('0x27')]=function(_0xc90e4f,_0x55f355){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0xc90e4f[_0x0b8f('0x49')]['id']}})['then'](handleEntityNotFound(_0x55f355,null))['then'](removeEntity(_0x55f355,null))[_0x0b8f('0x47')](handleError(_0x55f355,null));};
\ No newline at end of file
index 65581d4..ae563a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8a7=['bluebird','request-promise','rimraf','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','moment'];(function(_0xee4c5f,_0x1bf72d){var _0x5accbc=function(_0x5ca2aa){while(--_0x5ca2aa){_0xee4c5f['push'](_0xee4c5f['shift']());}};_0x5accbc(++_0x1bf72d);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x29e22e,_0x10c69c){_0x29e22e=_0x29e22e-0x0;var _0xc88c6f=_0xd8a7[_0x29e22e];return _0xc88c6f;};'use strict';var _=require(_0x7d8a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7d8a('0x1'));var BPromise=require(_0x7d8a('0x2'));var rp=require(_0x7d8a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d8a('0x4'));var config=require('../../config/environment');var attributes=require(_0x7d8a('0x5'));module['exports']=function(_0x27ef8e,_0x530308){return _0x27ef8e[_0x7d8a('0x6')](_0x7d8a('0x7'),attributes,{'tableName':_0x7d8a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d3f=['lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x9d3f,0x1b8));var _0xf9d3=function(_0x29714b,_0x5c8856){_0x29714b=_0x29714b-0x0;var _0x219de9=_0x9d3f[_0x29714b];return _0x219de9;};'use strict';var _=require(_0xf9d3('0x0'));var util=require(_0xf9d3('0x1'));var logger=require(_0xf9d3('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf9d3('0x3'));var rp=require(_0xf9d3('0x4'));var fs=require('fs');var path=require(_0xf9d3('0x5'));var rimraf=require('rimraf');var config=require(_0xf9d3('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xf9d3('0x7')]=function(_0x48c971,_0x49c1d8){return _0x48c971[_0xf9d3('0x8')](_0xf9d3('0x9'),attributes,{'tableName':_0xf9d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 20f85ea..ef7a8ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa474=['http','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnoanswerretry','countabandonedretry','SwapAdditionalPhones','CmHopper','duration','waitTime','scheduledat','add','minutes','updatedAt','phone','isNil','createdAt','hopperToAdd','additionalToHop','sequelize','transaction','IncrementPreviewCounters','update','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x429003,_0x3508da){var _0x3cc0d9=function(_0x1bc27c){while(--_0x1bc27c){_0x429003['push'](_0x429003['shift']());}};_0x3cc0d9(++_0x3508da);}(_0xa474,0xe9));var _0x4a47=function(_0x29021d,_0x25fc15){_0x29021d=_0x29021d-0x0;var _0x36aabc=_0xa474[_0x29021d];return _0x36aabc;};'use strict';var _=require(_0x4a47('0x0'));var util=require(_0x4a47('0x1'));var moment=require(_0x4a47('0x2'));var BPromise=require(_0x4a47('0x3'));var rs=require(_0x4a47('0x4'));var fs=require('fs');var Redis=require(_0x4a47('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a47('0x6'));var logger=require(_0x4a47('0x7'))(_0x4a47('0x8'));var config=require('../../config/environment');var jayson=require(_0x4a47('0x9'));var client=jayson[_0x4a47('0xa')][_0x4a47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d04e9,_0xbe8a87,_0x34e93b){return new BPromise(function(_0x4d935e,_0x2bde9b){return client['request'](_0x2d04e9,_0x34e93b)[_0x4a47('0xc')](function(_0xb9c778){logger['info'](_0x4a47('0xd'),_0xbe8a87,_0x4a47('0xe'));logger[_0x4a47('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0xbe8a87,_0x4a47('0xe'),JSON[_0x4a47('0x10')](_0xb9c778));if(_0xb9c778[_0x4a47('0x11')]){if(_0xb9c778[_0x4a47('0x11')][_0x4a47('0x12')]===0x1f4){logger['error'](_0x4a47('0xd'),_0xbe8a87,_0xb9c778[_0x4a47('0x11')]['message']);return _0x2bde9b(_0xb9c778[_0x4a47('0x11')][_0x4a47('0x13')]);}logger[_0x4a47('0x11')](_0x4a47('0xd'),_0xbe8a87,_0xb9c778['error'][_0x4a47('0x13')]);return _0x4d935e(_0xb9c778['error'][_0x4a47('0x13')]);}else{logger[_0x4a47('0x14')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0xbe8a87,_0x4a47('0xe'));_0x4d935e(_0xb9c778[_0x4a47('0x15')][_0x4a47('0x13')]);}})[_0x4a47('0x16')](function(_0x182dd2){logger[_0x4a47('0x11')](_0x4a47('0xd'),_0xbe8a87,_0x182dd2);_0x2bde9b(_0x182dd2);});});}exports[_0x4a47('0x17')]=function(_0x4f6649){var _0x512c8c=this;return new Promise(function(_0x3693ce,_0x514fc6){return db['CmHopper'][_0x4a47('0x18')]({'raw':!![],'where':{'ContactId':_0x4f6649[_0x4a47('0x19')][_0x4a47('0x1a')],'ListId':_0x4f6649[_0x4a47('0x19')][_0x4a47('0x1b')],'VoiceQueueId':_0x4f6649[_0x4a47('0x19')][_0x4a47('0x1c')]===undefined?null:_0x4f6649[_0x4a47('0x19')][_0x4a47('0x1c')],'CampaignId':_0x4f6649[_0x4a47('0x19')][_0x4a47('0x1d')]===undefined?null:_0x4f6649[_0x4a47('0x19')][_0x4a47('0x1d')]}})[_0x4a47('0xc')](function(_0xd76e2){if(_0xd76e2!=null){return db[_0x4a47('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xd76e2['id'],'OrderBy':{'$gt':_0xd76e2['OrderBy']}},'order':[[_0x4a47('0x1f'),_0x4a47('0x20')]]})[_0x4a47('0xc')](function(_0x5c7466){var _0x59c827=0x0;if(_0x5c7466){if(_0x5c7466[_0x4a47('0x21')]+_0x5c7466[_0x4a47('0x22')]+_0x5c7466['countnoanswerretry']+_0x5c7466[_0x4a47('0x23')]+_0x5c7466[_0x4a47('0x24')]+_0x5c7466['countabandonedretry']+_0x5c7466[_0x4a47('0x25')]+_0x5c7466[_0x4a47('0x26')]<_0x4f6649[_0x4a47('0x27')][_0x4a47('0x28')])_0x59c827=0x1;_0x3693ce({'additional':_0x59c827});}else{return db[_0x4a47('0x1e')][_0x4a47('0x18')]({'raw':!![],'where':{'CmHopperId':_0xd76e2['id']},'order':[[_0x4a47('0x1f'),_0x4a47('0x20')]]})[_0x4a47('0xc')](function(_0xc0dc3b){var _0x1e0231=0x0;if(_0xc0dc3b){if(_0xc0dc3b['countbusyretry']+_0xc0dc3b[_0x4a47('0x22')]+_0xc0dc3b[_0x4a47('0x29')]+_0xc0dc3b[_0x4a47('0x23')]+_0xc0dc3b['countdropretry']+_0xc0dc3b[_0x4a47('0x2a')]+_0xc0dc3b[_0x4a47('0x25')]+_0xc0dc3b[_0x4a47('0x26')]<_0x4f6649['entity']['dialGlobalMaxRetry'])_0x1e0231=0x1;_0x3693ce({'additional':_0x1e0231});}else{_0x3693ce({'additional':0x0});}})[_0x4a47('0x16')](function(_0x1bceb6){logger['error'](_0x4a47('0x17'),_0x1bceb6[_0x4a47('0x13')],_0x4f6649);_0x514fc6(_0x512c8c[_0x4a47('0x11')](0x1f4,_0x1bceb6['message']));});}})[_0x4a47('0x16')](function(_0x2aa684){logger[_0x4a47('0x11')](_0x4a47('0x17'),_0x2aa684['message'],_0x4f6649);_0x514fc6(_0x512c8c[_0x4a47('0x11')](0x1f4,_0x2aa684['message']));});}else _0x3693ce({'additional':0x0});});});};exports[_0x4a47('0x2b')]=function(_0x468123){var _0x29d1b7=this;return new Promise(function(_0x4581f7,_0x2d01e9){return db[_0x4a47('0x2c')][_0x4a47('0x18')]({'raw':!![],'where':{'ContactId':_0x468123['body'][_0x4a47('0x1a')],'ListId':_0x468123['body'][_0x4a47('0x1b')],'VoiceQueueId':_0x468123[_0x4a47('0x19')][_0x4a47('0x1c')]===undefined?null:_0x468123[_0x4a47('0x19')][_0x4a47('0x1c')],'CampaignId':_0x468123[_0x4a47('0x19')][_0x4a47('0x1d')]===undefined?null:_0x468123[_0x4a47('0x19')][_0x4a47('0x1d')]}})[_0x4a47('0xc')](function(_0x593b05){if(_0x593b05!=null){return db['CmHopperAdditionalPhone'][_0x4a47('0x18')]({'raw':!![],'where':{'CmHopperId':_0x593b05['id'],'OrderBy':{'$gte':_0x593b05['OrderBy']}},'order':[['OrderBy','ASC']]})[_0x4a47('0xc')](function(_0x2c4932){if(_0x2c4932)return activateAdditionalPhone(_0x593b05,_0x468123[_0x4a47('0x19')],_0x2c4932,_0x468123[_0x4a47('0x2d')],_0x468123[_0x4a47('0x2e')])['then'](function(_0x7a64d0){_0x4581f7(_0x7a64d0);});else{return db[_0x4a47('0x1e')][_0x4a47('0x18')]({'raw':!![],'where':{'CmHopperId':_0x593b05['id']},'order':[[_0x4a47('0x1f'),_0x4a47('0x20')]]})['then'](function(_0x45b158){if(_0x45b158)return activateAdditionalPhone(_0x593b05,_0x468123[_0x4a47('0x19')],_0x45b158,_0x468123['duration'],_0x468123['waitTime'])[_0x4a47('0xc')](function(_0x468595){_0x4581f7(_0x468595);});else{_0x4581f7({'id':_0x593b05['id'],'phone':''});}})[_0x4a47('0x16')](function(_0x21228f){logger['error'](_0x4a47('0x17'),_0x21228f[_0x4a47('0x13')],_0x468123);_0x2d01e9(_0x29d1b7[_0x4a47('0x11')](0x1f4,_0x21228f[_0x4a47('0x13')]));});}})['catch'](function(_0x27798b){logger[_0x4a47('0x11')]('VerifyAdditionalPhones',_0x27798b['message'],_0x468123);_0x2d01e9(_0x29d1b7['error'](0x1f4,_0x27798b['message']));});}else _0x4581f7(0x1);});});};function activateAdditionalPhone(_0x1755ba,_0x2c5289,_0x454972,_0x37fdd8,_0x1830e7){return new Promise(function(_0x1696c6,_0x49a91c){logger['info'](_0x4a47('0x17'),_0x454972);var _0x4ec7b0;if(moment()>moment(_0x454972[_0x4a47('0x2f')])){_0x4ec7b0=moment()[_0x4a47('0x30')](_0x1830e7||0x3,_0x4a47('0x31'));}else{if(_0x454972[_0x4a47('0x1f')]==0x0){_0x4ec7b0=moment(_0x454972['scheduledat']);}else{_0x4ec7b0=moment()[_0x4a47('0x30')](_0x1830e7||0x3,_0x4a47('0x31'));}}var _0x37d135={'phone':_0x1755ba['phone'],'active':0x0,'OrderBy':_['isNil'](_0x1755ba[_0x4a47('0x1f')])?0x0:_0x1755ba[_0x4a47('0x1f')],'scheduledat':moment()[_0x4a47('0x30')](_0x37fdd8||0x1,_0x4a47('0x31')),'countbusyretry':_0x2c5289[_0x4a47('0x21')],'countcongestionretry':_0x2c5289[_0x4a47('0x22')],'countnoanswerretry':_0x2c5289[_0x4a47('0x29')],'countnosuchnumberretry':_0x2c5289[_0x4a47('0x23')],'countdropretry':_0x2c5289[_0x4a47('0x24')],'countabandonedretry':_0x2c5289['countabandonedretry'],'countmachineretry':_0x2c5289['countmachineretry'],'countagentrejectretry':_0x2c5289[_0x4a47('0x26')],'createdAt':_0x2c5289['createdAt'],'updatedAt':_0x2c5289[_0x4a47('0x32')]};var _0x3020b7={'CmHopperId':_0x1755ba['id'],'phone':_0x454972[_0x4a47('0x33')],'active':0x0,'OrderBy':_[_0x4a47('0x34')](_0x454972['OrderBy'])?0x0:_0x454972[_0x4a47('0x1f')],'scheduledat':_0x4ec7b0,'countbusyretry':_0x454972[_0x4a47('0x21')],'countcongestionretry':_0x454972[_0x4a47('0x22')],'countnoanswerretry':_0x454972['countnoanswerretry'],'countnosuchnumberretry':_0x454972[_0x4a47('0x23')],'countdropretry':_0x454972[_0x4a47('0x24')],'countabandonedretry':_0x454972[_0x4a47('0x2a')],'countmachineretry':_0x454972[_0x4a47('0x25')],'countagentrejectretry':_0x454972[_0x4a47('0x26')],'createdAt':_0x454972[_0x4a47('0x35')],'updatedAt':_0x454972[_0x4a47('0x32')]};logger['info'](_0x4a47('0x36'),_0x37d135);logger['info'](_0x4a47('0x37'),_0x3020b7);return db[_0x4a47('0x38')][_0x4a47('0x39')](function(_0xf753be){return db[_0x4a47('0x1e')]['update'](_0x37d135,{'where':{'id':_0x454972['id']}},{'transaction':_0xf753be})['then'](function(){return db['CmHopper']['update'](_0x3020b7,{'where':{'id':_0x1755ba['id']}},{'transaction':_0xf753be});});})[_0x4a47('0xc')](function(_0x2278ee){_0x1696c6({'id':_0x1755ba['id'],'phone':_0x454972[_0x4a47('0x33')]});})[_0x4a47('0x16')](function(_0x4dd2b7){logger[_0x4a47('0x11')](_0x4a47('0x17'),_0x4dd2b7[_0x4a47('0x13')],req);_0x49a91c(_this[_0x4a47('0x11')](0x1f4,_0x4dd2b7['message']));});});}exports[_0x4a47('0x3a')]=function(_0x201795){var _0x5daf84=this;return new Promise(function(_0x2edde0,_0xcce5fc){return db[_0x4a47('0x2c')][_0x4a47('0x3b')](_0x201795[_0x4a47('0x19')][_0x4a47('0x3c')],{'where':{'id':_0x201795['body']['id']}})['then'](function(_0x331a26){_0x2edde0(_0x331a26);})[_0x4a47('0x16')](function(_0x11d9e8){logger[_0x4a47('0x11')](_0x4a47('0x3a'),_0x11d9e8[_0x4a47('0x13')],_0x201795);_0xcce5fc(_0x5daf84['error'](0x1f4,_0x11d9e8['message']));});});};
\ No newline at end of file
+var _0x0177=['result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','SwapAdditionalPhones','ListId','duration','waitTime','minutes','scheduledat','add','phone','isNil','createdAt','updatedAt','hopperToAdd','additionalToHop','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x47e9dc,_0x347e4e){var _0x58e385=function(_0x4cf524){while(--_0x4cf524){_0x47e9dc['push'](_0x47e9dc['shift']());}};_0x58e385(++_0x347e4e);}(_0x0177,0x197));var _0x7017=function(_0x113e13,_0x55459c){_0x113e13=_0x113e13-0x0;var _0x54c79a=_0x0177[_0x113e13];return _0x54c79a;};'use strict';var _=require(_0x7017('0x0'));var util=require(_0x7017('0x1'));var moment=require(_0x7017('0x2'));var BPromise=require(_0x7017('0x3'));var rs=require(_0x7017('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7017('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7017('0x6'))(_0x7017('0x7'));var config=require('../../config/environment');var jayson=require(_0x7017('0x8'));var client=jayson['client'][_0x7017('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d54bd,_0x237e18,_0x268a64){return new BPromise(function(_0x3922b5,_0x3cbe76){return client[_0x7017('0xa')](_0x5d54bd,_0x268a64)['then'](function(_0x30e160){logger[_0x7017('0xb')](_0x7017('0xc'),_0x237e18,_0x7017('0xd'));logger[_0x7017('0xe')](_0x7017('0xf'),_0x237e18,_0x7017('0xd'),JSON[_0x7017('0x10')](_0x30e160));if(_0x30e160['error']){if(_0x30e160[_0x7017('0x11')][_0x7017('0x12')]===0x1f4){logger[_0x7017('0x11')](_0x7017('0xc'),_0x237e18,_0x30e160[_0x7017('0x11')][_0x7017('0x13')]);return _0x3cbe76(_0x30e160[_0x7017('0x11')][_0x7017('0x13')]);}logger['error'](_0x7017('0xc'),_0x237e18,_0x30e160[_0x7017('0x11')]['message']);return _0x3922b5(_0x30e160['error'][_0x7017('0x13')]);}else{logger[_0x7017('0xb')](_0x7017('0xc'),_0x237e18,_0x7017('0xd'));_0x3922b5(_0x30e160[_0x7017('0x14')][_0x7017('0x13')]);}})[_0x7017('0x15')](function(_0xb8a193){logger[_0x7017('0x11')](_0x7017('0xc'),_0x237e18,_0xb8a193);_0x3cbe76(_0xb8a193);});});}exports[_0x7017('0x16')]=function(_0x4d49da){var _0x500232=this;return new Promise(function(_0x4fde1c,_0x613e6){return db[_0x7017('0x17')][_0x7017('0x18')]({'raw':!![],'where':{'ContactId':_0x4d49da[_0x7017('0x19')][_0x7017('0x1a')],'ListId':_0x4d49da[_0x7017('0x19')]['ListId'],'VoiceQueueId':_0x4d49da[_0x7017('0x19')][_0x7017('0x1b')]===undefined?null:_0x4d49da['body'][_0x7017('0x1b')],'CampaignId':_0x4d49da['body'][_0x7017('0x1c')]===undefined?null:_0x4d49da[_0x7017('0x19')][_0x7017('0x1c')]}})[_0x7017('0x1d')](function(_0x58cae1){if(_0x58cae1!=null){return db[_0x7017('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x58cae1['id'],'OrderBy':{'$gt':_0x58cae1[_0x7017('0x1f')]}},'order':[[_0x7017('0x1f'),_0x7017('0x20')]]})[_0x7017('0x1d')](function(_0x5925dd){var _0x50282b=0x0;if(_0x5925dd){if(_0x5925dd[_0x7017('0x21')]+_0x5925dd['countcongestionretry']+_0x5925dd[_0x7017('0x22')]+_0x5925dd['countnosuchnumberretry']+_0x5925dd['countdropretry']+_0x5925dd[_0x7017('0x23')]+_0x5925dd['countmachineretry']+_0x5925dd[_0x7017('0x24')]<_0x4d49da[_0x7017('0x25')][_0x7017('0x26')])_0x50282b=0x1;_0x4fde1c({'additional':_0x50282b});}else{return db[_0x7017('0x1e')][_0x7017('0x18')]({'raw':!![],'where':{'CmHopperId':_0x58cae1['id']},'order':[[_0x7017('0x1f'),'ASC']]})[_0x7017('0x1d')](function(_0xf09e78){var _0x1a109f=0x0;if(_0xf09e78){if(_0xf09e78[_0x7017('0x21')]+_0xf09e78[_0x7017('0x27')]+_0xf09e78[_0x7017('0x22')]+_0xf09e78[_0x7017('0x28')]+_0xf09e78[_0x7017('0x29')]+_0xf09e78[_0x7017('0x23')]+_0xf09e78[_0x7017('0x2a')]+_0xf09e78[_0x7017('0x24')]<_0x4d49da['entity'][_0x7017('0x26')])_0x1a109f=0x1;_0x4fde1c({'additional':_0x1a109f});}else{_0x4fde1c({'additional':0x0});}})[_0x7017('0x15')](function(_0x25a858){logger[_0x7017('0x11')](_0x7017('0x16'),_0x25a858[_0x7017('0x13')],_0x4d49da);_0x613e6(_0x500232[_0x7017('0x11')](0x1f4,_0x25a858[_0x7017('0x13')]));});}})[_0x7017('0x15')](function(_0x15adab){logger[_0x7017('0x11')]('VerifyAdditionalPhones',_0x15adab['message'],_0x4d49da);_0x613e6(_0x500232[_0x7017('0x11')](0x1f4,_0x15adab[_0x7017('0x13')]));});}else _0x4fde1c({'additional':0x0});});});};exports[_0x7017('0x2b')]=function(_0x23c2c5){var _0x4ed53c=this;return new Promise(function(_0x33838f,_0x3f3805){return db[_0x7017('0x17')][_0x7017('0x18')]({'raw':!![],'where':{'ContactId':_0x23c2c5['body'][_0x7017('0x1a')],'ListId':_0x23c2c5[_0x7017('0x19')][_0x7017('0x2c')],'VoiceQueueId':_0x23c2c5[_0x7017('0x19')][_0x7017('0x1b')]===undefined?null:_0x23c2c5[_0x7017('0x19')][_0x7017('0x1b')],'CampaignId':_0x23c2c5[_0x7017('0x19')]['CampaignId']===undefined?null:_0x23c2c5['body'][_0x7017('0x1c')]}})[_0x7017('0x1d')](function(_0x353c5d){if(_0x353c5d!=null){return db[_0x7017('0x1e')][_0x7017('0x18')]({'raw':!![],'where':{'CmHopperId':_0x353c5d['id'],'OrderBy':{'$gte':_0x353c5d[_0x7017('0x1f')]}},'order':[[_0x7017('0x1f'),_0x7017('0x20')]]})['then'](function(_0x59348b){if(_0x59348b)return activateAdditionalPhone(_0x353c5d,_0x23c2c5[_0x7017('0x19')],_0x59348b,_0x23c2c5[_0x7017('0x2d')],_0x23c2c5[_0x7017('0x2e')])['then'](function(_0x286512){_0x33838f(_0x286512);});else{return db[_0x7017('0x1e')][_0x7017('0x18')]({'raw':!![],'where':{'CmHopperId':_0x353c5d['id']},'order':[[_0x7017('0x1f'),'ASC']]})['then'](function(_0x34a112){if(_0x34a112)return activateAdditionalPhone(_0x353c5d,_0x23c2c5[_0x7017('0x19')],_0x34a112,_0x23c2c5[_0x7017('0x2d')],_0x23c2c5[_0x7017('0x2e')])[_0x7017('0x1d')](function(_0x439201){_0x33838f(_0x439201);});else{_0x33838f({'id':_0x353c5d['id'],'phone':''});}})[_0x7017('0x15')](function(_0x1d09de){logger[_0x7017('0x11')]('VerifyAdditionalPhones',_0x1d09de[_0x7017('0x13')],_0x23c2c5);_0x3f3805(_0x4ed53c[_0x7017('0x11')](0x1f4,_0x1d09de['message']));});}})[_0x7017('0x15')](function(_0x2e9aae){logger[_0x7017('0x11')](_0x7017('0x16'),_0x2e9aae[_0x7017('0x13')],_0x23c2c5);_0x3f3805(_0x4ed53c[_0x7017('0x11')](0x1f4,_0x2e9aae['message']));});}else _0x33838f(0x1);});});};function activateAdditionalPhone(_0x3abcef,_0x4c77a1,_0x2d1332,_0x2e5570,_0x4dac6f){return new Promise(function(_0x5d5fe4,_0x41d00c){logger[_0x7017('0xb')](_0x7017('0x16'),_0x2d1332);var _0x2b4a47;if(moment()>moment(_0x2d1332['scheduledat'])){_0x2b4a47=moment()['add'](_0x4dac6f||0x3,_0x7017('0x2f'));}else{if(_0x2d1332[_0x7017('0x1f')]==0x0){_0x2b4a47=moment(_0x2d1332[_0x7017('0x30')]);}else{_0x2b4a47=moment()[_0x7017('0x31')](_0x4dac6f||0x3,_0x7017('0x2f'));}}var _0x44d607={'phone':_0x3abcef[_0x7017('0x32')],'active':0x0,'OrderBy':_[_0x7017('0x33')](_0x3abcef['OrderBy'])?0x0:_0x3abcef[_0x7017('0x1f')],'scheduledat':moment()[_0x7017('0x31')](_0x2e5570||0x1,'minutes'),'countbusyretry':_0x4c77a1[_0x7017('0x21')],'countcongestionretry':_0x4c77a1[_0x7017('0x27')],'countnoanswerretry':_0x4c77a1[_0x7017('0x22')],'countnosuchnumberretry':_0x4c77a1[_0x7017('0x28')],'countdropretry':_0x4c77a1['countdropretry'],'countabandonedretry':_0x4c77a1[_0x7017('0x23')],'countmachineretry':_0x4c77a1[_0x7017('0x2a')],'countagentrejectretry':_0x4c77a1[_0x7017('0x24')],'createdAt':_0x4c77a1[_0x7017('0x34')],'updatedAt':_0x4c77a1[_0x7017('0x35')]};var _0x41798a={'CmHopperId':_0x3abcef['id'],'phone':_0x2d1332[_0x7017('0x32')],'active':0x0,'OrderBy':_[_0x7017('0x33')](_0x2d1332['OrderBy'])?0x0:_0x2d1332[_0x7017('0x1f')],'scheduledat':_0x2b4a47,'countbusyretry':_0x2d1332[_0x7017('0x21')],'countcongestionretry':_0x2d1332[_0x7017('0x27')],'countnoanswerretry':_0x2d1332[_0x7017('0x22')],'countnosuchnumberretry':_0x2d1332[_0x7017('0x28')],'countdropretry':_0x2d1332[_0x7017('0x29')],'countabandonedretry':_0x2d1332[_0x7017('0x23')],'countmachineretry':_0x2d1332[_0x7017('0x2a')],'countagentrejectretry':_0x2d1332[_0x7017('0x24')],'createdAt':_0x2d1332[_0x7017('0x34')],'updatedAt':_0x2d1332[_0x7017('0x35')]};logger[_0x7017('0xb')](_0x7017('0x36'),_0x44d607);logger['info'](_0x7017('0x37'),_0x41798a);return db[_0x7017('0x38')][_0x7017('0x39')](function(_0x329328){return db[_0x7017('0x1e')][_0x7017('0x3a')](_0x44d607,{'where':{'id':_0x2d1332['id']}},{'transaction':_0x329328})[_0x7017('0x1d')](function(){return db[_0x7017('0x17')][_0x7017('0x3a')](_0x41798a,{'where':{'id':_0x3abcef['id']}},{'transaction':_0x329328});});})[_0x7017('0x1d')](function(_0x24875e){_0x5d5fe4({'id':_0x3abcef['id'],'phone':_0x2d1332[_0x7017('0x32')]});})[_0x7017('0x15')](function(_0x1de5a7){logger[_0x7017('0x11')](_0x7017('0x16'),_0x1de5a7[_0x7017('0x13')],req);_0x41d00c(_this[_0x7017('0x11')](0x1f4,_0x1de5a7[_0x7017('0x13')]));});});}exports[_0x7017('0x3b')]=function(_0x458e19){var _0xcc24b6=this;return new Promise(function(_0x4eb91e,_0x31c4da){return db[_0x7017('0x17')][_0x7017('0x3a')](_0x458e19[_0x7017('0x19')][_0x7017('0x3c')],{'where':{'id':_0x458e19[_0x7017('0x19')]['id']}})[_0x7017('0x1d')](function(_0xcedb4a){_0x4eb91e(_0xcedb4a);})[_0x7017('0x15')](function(_0x3edbba){logger['error'](_0x7017('0x3b'),_0x3edbba[_0x7017('0x13')],_0x458e19);_0x31c4da(_0xcc24b6[_0x7017('0x11')](0x1f4,_0x3edbba[_0x7017('0x13')]));});});};
\ No newline at end of file
index b87bf5e..f8e6101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8821=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8821,0x8d));var _0x1882=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0x8821[_0x45b29d];return _0x32d74;};'use strict';var multer=require(_0x1882('0x0'));var util=require(_0x1882('0x1'));var path=require(_0x1882('0x2'));var timeout=require(_0x1882('0x3'));var express=require(_0x1882('0x4'));var router=express[_0x1882('0x5')]();var fs_extra=require(_0x1882('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1882('0x7'));var config=require(_0x1882('0x8'));var controller=require(_0x1882('0x9'));router[_0x1882('0xa')]('/',auth['isAuthenticated'](),controller[_0x1882('0xb')]);router[_0x1882('0xa')](_0x1882('0xc'),auth[_0x1882('0xd')](),controller[_0x1882('0xe')]);router[_0x1882('0xf')]('/',auth[_0x1882('0xd')](),controller[_0x1882('0x10')]);router[_0x1882('0x11')](_0x1882('0xc'),auth[_0x1882('0xd')](),controller[_0x1882('0x12')]);router[_0x1882('0x13')](_0x1882('0xc'),auth[_0x1882('0xd')](),controller[_0x1882('0x14')]);module[_0x1882('0x15')]=router;
\ No newline at end of file
+var _0xeff6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','create','put','/:id','update','destroy','multer','util','path'];(function(_0x4b8806,_0x5d473f){var _0x1e7f0e=function(_0x3637ec){while(--_0x3637ec){_0x4b8806['push'](_0x4b8806['shift']());}};_0x1e7f0e(++_0x5d473f);}(_0xeff6,0xf9));var _0x6eff=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeff6[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6eff('0x0'));var util=require(_0x6eff('0x1'));var path=require(_0x6eff('0x2'));var timeout=require(_0x6eff('0x3'));var express=require(_0x6eff('0x4'));var router=express[_0x6eff('0x5')]();var fs_extra=require(_0x6eff('0x6'));var auth=require(_0x6eff('0x7'));var interaction=require(_0x6eff('0x8'));var config=require(_0x6eff('0x9'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x6eff('0xa')]('/',auth[_0x6eff('0xb')](),controller['index']);router['get']('/:id',auth[_0x6eff('0xb')](),controller['show']);router[_0x6eff('0xc')]('/',auth[_0x6eff('0xb')](),controller[_0x6eff('0xd')]);router[_0x6eff('0xe')](_0x6eff('0xf'),auth['isAuthenticated'](),controller[_0x6eff('0x10')]);router['delete']('/:id',auth[_0x6eff('0xb')](),controller[_0x6eff('0x11')]);module['exports']=router;
\ No newline at end of file
index 9b8c78b..7afbe33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b47=['contactListQueue','moment','exports','STRING','INTEGER'];(function(_0x54fea7,_0x33e39c){var _0x502ed1=function(_0x2980ed){while(--_0x2980ed){_0x54fea7['push'](_0x54fea7['shift']());}};_0x502ed1(++_0x33e39c);}(_0x4b47,0x1b4));var _0x74b4=function(_0xfeed16,_0x527ce2){_0xfeed16=_0xfeed16-0x0;var _0x40e7bb=_0x4b47[_0xfeed16];return _0x40e7bb;};'use strict';var moment=require(_0x74b4('0x0'));var Sequelize=require('sequelize');module[_0x74b4('0x1')]={'phone':{'type':Sequelize[_0x74b4('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x74b4('0x3')],'unique':_0x74b4('0x4')},'ListId':{'type':Sequelize[_0x74b4('0x3')],'unique':_0x74b4('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}};
\ No newline at end of file
+var _0x3c2a=['sequelize','STRING','contactListQueue','INTEGER','moment'];(function(_0x5a9570,_0x255c95){var _0x55d2c0=function(_0xb803cb){while(--_0xb803cb){_0x5a9570['push'](_0x5a9570['shift']());}};_0x55d2c0(++_0x255c95);}(_0x3c2a,0x1b2));var _0xa3c2=function(_0x2275dc,_0x51a8ca){_0x2275dc=_0x2275dc-0x0;var _0x3e864a=_0x3c2a[_0x2275dc];return _0x3e864a;};'use strict';var moment=require(_0xa3c2('0x0'));var Sequelize=require(_0xa3c2('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa3c2('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa3c2('0x3')},'ListId':{'type':Sequelize[_0xa3c2('0x4')],'unique':_0xa3c2('0x3')},'VoiceQueueId':{'type':Sequelize[_0xa3c2('0x4')],'unique':_0xa3c2('0x3')}};
\ No newline at end of file
index 53f06bf..b9c292a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6daf=['params','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','name','send','CmHopperBlack','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','catch','keys','length','includeAll','find','body'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x6daf,0xd7));var _0xf6da=function(_0x14060d,_0x52e046){_0x14060d=_0x14060d-0x0;var _0x2a4633=_0x6daf[_0x14060d];return _0x2a4633;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6da('0x0'));var zipdir=require(_0xf6da('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6da('0x2'));var moment=require(_0xf6da('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf6da('0x4'));var util=require(_0xf6da('0x5'));var path=require(_0xf6da('0x6'));var sox=require('sox');var csv=require(_0xf6da('0x7'));var ejs=require(_0xf6da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6da('0x9'));var squel=require('squel');var crypto=require(_0xf6da('0xa'));var jsforce=require(_0xf6da('0xb'));var deskjs=require(_0xf6da('0xc'));var toCsv=require(_0xf6da('0x7'));var querystring=require(_0xf6da('0xd'));var Papa=require(_0xf6da('0xe'));var Redis=require(_0xf6da('0xf'));var authService=require(_0xf6da('0x10'));var qs=require(_0xf6da('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6da('0x12'));var logger=require(_0xf6da('0x13'))('api');var utils=require(_0xf6da('0x14'));var config=require(_0xf6da('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf6da('0x16'))['db'];function respondWithStatusCode(_0x4a70f0,_0x57957f){_0x57957f=_0x57957f||0xcc;return function(_0x206783){if(_0x206783){return _0x4a70f0[_0xf6da('0x17')](_0x57957f);}return _0x4a70f0[_0xf6da('0x18')](_0x57957f)[_0xf6da('0x19')]();};}function respondWithResult(_0x160e32,_0x15d123){_0x15d123=_0x15d123||0xc8;return function(_0x56bb77){if(_0x56bb77){return _0x160e32[_0xf6da('0x18')](_0x15d123)[_0xf6da('0x1a')](_0x56bb77);}};}function respondWithFilteredResult(_0x437ad2,_0x3a3813){return function(_0xea7e39){if(_0xea7e39){var _0x328e14=typeof _0x3a3813['offset']===_0xf6da('0x1b')&&typeof _0x3a3813[_0xf6da('0x1c')]==='undefined';var _0x3196c2=_0xea7e39[_0xf6da('0x1d')];var _0x1c4768=_0x328e14?0x0:_0x3a3813[_0xf6da('0x1e')];var _0x46d177=_0x328e14?_0xea7e39[_0xf6da('0x1d')]:_0x3a3813[_0xf6da('0x1e')]+_0x3a3813[_0xf6da('0x1c')];var _0x4ecaff;if(_0x46d177>=_0x3196c2){_0x46d177=_0x3196c2;_0x4ecaff=0xc8;}else{_0x4ecaff=0xce;}_0x437ad2[_0xf6da('0x18')](_0x4ecaff);return _0x437ad2[_0xf6da('0x1f')](_0xf6da('0x20'),_0x1c4768+'-'+_0x46d177+'/'+_0x3196c2)[_0xf6da('0x1a')](_0xea7e39);}return null;};}function patchUpdates(_0x5b3771){return function(_0x1f13be){try{jsonpatch[_0xf6da('0x21')](_0x1f13be,_0x5b3771,!![]);}catch(_0x4236aa){return BPromise['reject'](_0x4236aa);}return _0x1f13be[_0xf6da('0x22')]();};}function saveUpdates(_0x311b3a,_0x4722f0){return function(_0x10dd04){if(_0x10dd04){return _0x10dd04[_0xf6da('0x23')](_0x311b3a)['then'](function(_0x2fee5e){return _0x2fee5e;});}return null;};}function removeEntity(_0x58efae,_0x4943bb){return function(_0xb1c10a){if(_0xb1c10a){return _0xb1c10a[_0xf6da('0x24')]()[_0xf6da('0x25')](function(){_0x58efae[_0xf6da('0x18')](0xcc)[_0xf6da('0x19')]();});}};}function handleEntityNotFound(_0x26d1dd,_0x259c8d){return function(_0x4a8618){if(!_0x4a8618){_0x26d1dd['sendStatus'](0x194);}return _0x4a8618;};}function handleError(_0x365e85,_0x1e6a87){_0x1e6a87=_0x1e6a87||0x1f4;return function(_0x3e382d){logger['error'](_0x3e382d['stack']);if(_0x3e382d[_0xf6da('0x26')]){delete _0x3e382d[_0xf6da('0x26')];}_0x365e85[_0xf6da('0x18')](_0x1e6a87)[_0xf6da('0x27')](_0x3e382d);};}exports['index']=function(_0x168fff,_0x2c2b62){var _0x10d98c={},_0x5e3e2a={},_0x2101ef={'count':0x0,'rows':[]};var _0x25de02=_['map'](db[_0xf6da('0x28')][_0xf6da('0x29')],function(_0x48ab17){return{'name':_0x48ab17[_0xf6da('0x2a')],'type':_0x48ab17[_0xf6da('0x2b')][_0xf6da('0x2c')]};});_0x5e3e2a['model']=_[_0xf6da('0x2d')](_0x25de02,'name');_0x5e3e2a[_0xf6da('0x2e')]=_['keys'](_0x168fff[_0xf6da('0x2e')]);_0x5e3e2a[_0xf6da('0x2f')]=_[_0xf6da('0x30')](_0x5e3e2a['model'],_0x5e3e2a[_0xf6da('0x2e')]);_0x10d98c[_0xf6da('0x31')]=_['intersection'](_0x5e3e2a[_0xf6da('0x32')],qs[_0xf6da('0x33')](_0x168fff[_0xf6da('0x2e')][_0xf6da('0x33')]));_0x10d98c['attributes']=_0x10d98c[_0xf6da('0x31')]['length']?_0x10d98c['attributes']:_0x5e3e2a[_0xf6da('0x32')];if(!_0x168fff[_0xf6da('0x2e')][_0xf6da('0x34')](_0xf6da('0x35'))){_0x10d98c[_0xf6da('0x1c')]=qs[_0xf6da('0x1c')](_0x168fff['query'][_0xf6da('0x1c')]);_0x10d98c[_0xf6da('0x1e')]=qs[_0xf6da('0x1e')](_0x168fff[_0xf6da('0x2e')][_0xf6da('0x1e')]);}_0x10d98c[_0xf6da('0x36')]=qs['sort'](_0x168fff['query'][_0xf6da('0x37')]);_0x10d98c[_0xf6da('0x38')]=qs[_0xf6da('0x2f')](_[_0xf6da('0x39')](_0x168fff['query'],_0x5e3e2a[_0xf6da('0x2f')]),_0x25de02);if(_0x168fff['query']['filter']){_0x10d98c[_0xf6da('0x38')]=_[_0xf6da('0x3a')](_0x10d98c[_0xf6da('0x38')],{'$or':_[_0xf6da('0x2d')](_0x25de02,function(_0x1bcf20){if(_0x1bcf20['type']!==_0xf6da('0x3b')){var _0x3093c9={};_0x3093c9[_0x1bcf20['name']]={'$like':'%'+_0x168fff['query']['filter']+'%'};return _0x3093c9;}})});}_0x10d98c=_['merge']({},_0x10d98c,_0x168fff[_0xf6da('0x3c')]);var _0x3e250b={'where':_0x10d98c[_0xf6da('0x38')]};return db[_0xf6da('0x28')][_0xf6da('0x1d')](_0x3e250b)[_0xf6da('0x25')](function(_0x534363){_0x2101ef[_0xf6da('0x1d')]=_0x534363;if(_0x168fff[_0xf6da('0x2e')]['includeAll']){_0x10d98c[_0xf6da('0x3d')]=[{'all':!![]}];}return db[_0xf6da('0x28')][_0xf6da('0x3e')](_0x10d98c);})['then'](function(_0x273ff3){_0x2101ef['rows']=_0x273ff3;return _0x2101ef;})['then'](respondWithFilteredResult(_0x2c2b62,_0x10d98c))[_0xf6da('0x3f')](handleError(_0x2c2b62,null));};exports['show']=function(_0x2d3417,_0xfbf262){var _0xc64aa2={'raw':!![],'where':{'id':_0x2d3417['params']['id']}},_0x848365={};_0x848365['model']=_[_0xf6da('0x40')](db[_0xf6da('0x28')]['rawAttributes']);_0x848365[_0xf6da('0x2e')]=_[_0xf6da('0x40')](_0x2d3417[_0xf6da('0x2e')]);_0x848365[_0xf6da('0x2f')]=_[_0xf6da('0x30')](_0x848365[_0xf6da('0x32')],_0x848365['query']);_0xc64aa2[_0xf6da('0x31')]=_['intersection'](_0x848365[_0xf6da('0x32')],qs[_0xf6da('0x33')](_0x2d3417['query'][_0xf6da('0x33')]));_0xc64aa2['attributes']=_0xc64aa2[_0xf6da('0x31')][_0xf6da('0x41')]?_0xc64aa2[_0xf6da('0x31')]:_0x848365['model'];if(_0x2d3417[_0xf6da('0x2e')][_0xf6da('0x42')]){_0xc64aa2[_0xf6da('0x3d')]=[{'all':!![]}];}_0xc64aa2=_['merge']({},_0xc64aa2,_0x2d3417['options']);return db['CmHopperBlack'][_0xf6da('0x43')](_0xc64aa2)[_0xf6da('0x25')](handleEntityNotFound(_0xfbf262,null))['then'](respondWithResult(_0xfbf262,null))[_0xf6da('0x3f')](handleError(_0xfbf262,null));};exports[_0xf6da('0x23')]=function(_0x162938,_0x871e79){if(_0x162938[_0xf6da('0x44')]['id']){delete _0x162938[_0xf6da('0x44')]['id'];}return db[_0xf6da('0x28')]['find']({'where':{'id':_0x162938[_0xf6da('0x45')]['id']}})[_0xf6da('0x25')](handleEntityNotFound(_0x871e79,null))[_0xf6da('0x25')](saveUpdates(_0x162938['body'],null))[_0xf6da('0x25')](respondWithResult(_0x871e79,null))['catch'](handleError(_0x871e79,null));};exports[_0xf6da('0x24')]=function(_0x4f3070,_0x367f9e){return db[_0xf6da('0x28')][_0xf6da('0x43')]({'where':{'id':_0x4f3070[_0xf6da('0x45')]['id']}})[_0xf6da('0x25')](handleEntityNotFound(_0x367f9e,null))[_0xf6da('0x25')](removeEntity(_0x367f9e,null))[_0xf6da('0x3f')](handleError(_0x367f9e,null));};exports['describe']=function(_0x27f7d8,_0x1a8646){return db[_0xf6da('0x28')][_0xf6da('0x46')]()[_0xf6da('0x25')](respondWithResult(_0x1a8646,null))['catch'](handleError(_0x1a8646,null));};
\ No newline at end of file
+var _0x3067=['json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperBlack','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','length','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status'];(function(_0x305d88,_0x56620a){var _0x1e39e3=function(_0x26b20c){while(--_0x26b20c){_0x305d88['push'](_0x305d88['shift']());}};_0x1e39e3(++_0x56620a);}(_0x3067,0x7e));var _0x7306=function(_0x21809a,_0x14b2d3){_0x21809a=_0x21809a-0x0;var _0x348d83=_0x3067[_0x21809a];return _0x348d83;};'use strict';var emlformat=require(_0x7306('0x0'));var rimraf=require(_0x7306('0x1'));var zipdir=require(_0x7306('0x2'));var jsonpatch=require(_0x7306('0x3'));var rp=require(_0x7306('0x4'));var moment=require(_0x7306('0x5'));var BPromise=require(_0x7306('0x6'));var Mustache=require(_0x7306('0x7'));var util=require(_0x7306('0x8'));var path=require(_0x7306('0x9'));var sox=require(_0x7306('0xa'));var csv=require(_0x7306('0xb'));var ejs=require(_0x7306('0xc'));var fs=require('fs');var fs_extra=require(_0x7306('0xd'));var _=require(_0x7306('0xe'));var squel=require(_0x7306('0xf'));var crypto=require(_0x7306('0x10'));var jsforce=require(_0x7306('0x11'));var deskjs=require(_0x7306('0x12'));var toCsv=require(_0x7306('0xb'));var querystring=require(_0x7306('0x13'));var Papa=require(_0x7306('0x14'));var Redis=require(_0x7306('0x15'));var authService=require(_0x7306('0x16'));var qs=require(_0x7306('0x17'));var as=require(_0x7306('0x18'));var hardwareService=require(_0x7306('0x19'));var logger=require(_0x7306('0x1a'))(_0x7306('0x1b'));var utils=require(_0x7306('0x1c'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7306('0x1d'))['db'];function respondWithStatusCode(_0x26b43d,_0x191032){_0x191032=_0x191032||0xcc;return function(_0x2e0c76){if(_0x2e0c76){return _0x26b43d['sendStatus'](_0x191032);}return _0x26b43d['status'](_0x191032)[_0x7306('0x1e')]();};}function respondWithResult(_0x37ddac,_0x492bc6){_0x492bc6=_0x492bc6||0xc8;return function(_0x3b784f){if(_0x3b784f){return _0x37ddac[_0x7306('0x1f')](_0x492bc6)[_0x7306('0x20')](_0x3b784f);}};}function respondWithFilteredResult(_0x21764a,_0x546d58){return function(_0x1cbf0a){if(_0x1cbf0a){var _0x8e6278=typeof _0x546d58['offset']===_0x7306('0x21')&&typeof _0x546d58[_0x7306('0x22')]==='undefined';var _0x3c5e18=_0x1cbf0a[_0x7306('0x23')];var _0x50f5ef=_0x8e6278?0x0:_0x546d58[_0x7306('0x24')];var _0x33a144=_0x8e6278?_0x1cbf0a[_0x7306('0x23')]:_0x546d58[_0x7306('0x24')]+_0x546d58[_0x7306('0x22')];var _0x20baec;if(_0x33a144>=_0x3c5e18){_0x33a144=_0x3c5e18;_0x20baec=0xc8;}else{_0x20baec=0xce;}_0x21764a[_0x7306('0x1f')](_0x20baec);return _0x21764a['set']('Content-Range',_0x50f5ef+'-'+_0x33a144+'/'+_0x3c5e18)[_0x7306('0x20')](_0x1cbf0a);}return null;};}function patchUpdates(_0x5ee224){return function(_0x3ff934){try{jsonpatch[_0x7306('0x25')](_0x3ff934,_0x5ee224,!![]);}catch(_0xda48a0){return BPromise[_0x7306('0x26')](_0xda48a0);}return _0x3ff934[_0x7306('0x27')]();};}function saveUpdates(_0xf3d021,_0x223f21){return function(_0x2ae177){if(_0x2ae177){return _0x2ae177[_0x7306('0x28')](_0xf3d021)[_0x7306('0x29')](function(_0xa87e91){return _0xa87e91;});}return null;};}function removeEntity(_0x2bfb37,_0x1da87b){return function(_0x56f5c8){if(_0x56f5c8){return _0x56f5c8[_0x7306('0x2a')]()[_0x7306('0x29')](function(){_0x2bfb37[_0x7306('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be940,_0x419b1a){return function(_0xb9b205){if(!_0xb9b205){_0x4be940['sendStatus'](0x194);}return _0xb9b205;};}function handleError(_0x237de5,_0x863b4){_0x863b4=_0x863b4||0x1f4;return function(_0x4b8ed3){logger[_0x7306('0x2b')](_0x4b8ed3[_0x7306('0x2c')]);if(_0x4b8ed3[_0x7306('0x2d')]){delete _0x4b8ed3[_0x7306('0x2d')];}_0x237de5[_0x7306('0x1f')](_0x863b4)[_0x7306('0x2e')](_0x4b8ed3);};}exports['index']=function(_0x29f7d6,_0x4c952d){var _0x1f623a={},_0x557473={},_0x1954eb={'count':0x0,'rows':[]};var _0x441fe9=_[_0x7306('0x2f')](db[_0x7306('0x30')]['rawAttributes'],function(_0x4e6a54){return{'name':_0x4e6a54[_0x7306('0x31')],'type':_0x4e6a54[_0x7306('0x32')][_0x7306('0x33')]};});_0x557473[_0x7306('0x34')]=_[_0x7306('0x2f')](_0x441fe9,'name');_0x557473['query']=_['keys'](_0x29f7d6[_0x7306('0x35')]);_0x557473[_0x7306('0x36')]=_[_0x7306('0x37')](_0x557473[_0x7306('0x34')],_0x557473[_0x7306('0x35')]);_0x1f623a['attributes']=_[_0x7306('0x37')](_0x557473['model'],qs['fields'](_0x29f7d6['query'][_0x7306('0x38')]));_0x1f623a['attributes']=_0x1f623a[_0x7306('0x39')]['length']?_0x1f623a[_0x7306('0x39')]:_0x557473[_0x7306('0x34')];if(!_0x29f7d6[_0x7306('0x35')][_0x7306('0x3a')](_0x7306('0x3b'))){_0x1f623a[_0x7306('0x22')]=qs[_0x7306('0x22')](_0x29f7d6['query'][_0x7306('0x22')]);_0x1f623a[_0x7306('0x24')]=qs[_0x7306('0x24')](_0x29f7d6[_0x7306('0x35')][_0x7306('0x24')]);}_0x1f623a[_0x7306('0x3c')]=qs['sort'](_0x29f7d6[_0x7306('0x35')][_0x7306('0x3d')]);_0x1f623a[_0x7306('0x3e')]=qs[_0x7306('0x36')](_[_0x7306('0x3f')](_0x29f7d6[_0x7306('0x35')],_0x557473['filters']),_0x441fe9);if(_0x29f7d6[_0x7306('0x35')]['filter']){_0x1f623a[_0x7306('0x3e')]=_['merge'](_0x1f623a[_0x7306('0x3e')],{'$or':_[_0x7306('0x2f')](_0x441fe9,function(_0x4d86a4){if(_0x4d86a4[_0x7306('0x32')]!==_0x7306('0x40')){var _0x18535c={};_0x18535c[_0x4d86a4['name']]={'$like':'%'+_0x29f7d6[_0x7306('0x35')][_0x7306('0x41')]+'%'};return _0x18535c;}})});}_0x1f623a=_[_0x7306('0x42')]({},_0x1f623a,_0x29f7d6[_0x7306('0x43')]);var _0x39647f={'where':_0x1f623a[_0x7306('0x3e')]};return db['CmHopperBlack'][_0x7306('0x23')](_0x39647f)['then'](function(_0x39479e){_0x1954eb['count']=_0x39479e;if(_0x29f7d6['query'][_0x7306('0x44')]){_0x1f623a[_0x7306('0x45')]=[{'all':!![]}];}return db[_0x7306('0x30')][_0x7306('0x46')](_0x1f623a);})[_0x7306('0x29')](function(_0x4df175){_0x1954eb['rows']=_0x4df175;return _0x1954eb;})[_0x7306('0x29')](respondWithFilteredResult(_0x4c952d,_0x1f623a))[_0x7306('0x47')](handleError(_0x4c952d,null));};exports[_0x7306('0x48')]=function(_0x42fa55,_0x2fdaa3){var _0x44fb77={'raw':!![],'where':{'id':_0x42fa55[_0x7306('0x49')]['id']}},_0x2f7b14={};_0x2f7b14[_0x7306('0x34')]=_['keys'](db[_0x7306('0x30')]['rawAttributes']);_0x2f7b14['query']=_[_0x7306('0x4a')](_0x42fa55[_0x7306('0x35')]);_0x2f7b14[_0x7306('0x36')]=_[_0x7306('0x37')](_0x2f7b14['model'],_0x2f7b14['query']);_0x44fb77[_0x7306('0x39')]=_[_0x7306('0x37')](_0x2f7b14['model'],qs[_0x7306('0x38')](_0x42fa55[_0x7306('0x35')][_0x7306('0x38')]));_0x44fb77[_0x7306('0x39')]=_0x44fb77[_0x7306('0x39')][_0x7306('0x4b')]?_0x44fb77[_0x7306('0x39')]:_0x2f7b14['model'];if(_0x42fa55[_0x7306('0x35')][_0x7306('0x44')]){_0x44fb77['include']=[{'all':!![]}];}_0x44fb77=_[_0x7306('0x42')]({},_0x44fb77,_0x42fa55[_0x7306('0x43')]);return db[_0x7306('0x30')][_0x7306('0x4c')](_0x44fb77)['then'](handleEntityNotFound(_0x2fdaa3,null))[_0x7306('0x29')](respondWithResult(_0x2fdaa3,null))[_0x7306('0x47')](handleError(_0x2fdaa3,null));};exports[_0x7306('0x28')]=function(_0x3f5bd6,_0x23ebed){if(_0x3f5bd6[_0x7306('0x4d')]['id']){delete _0x3f5bd6[_0x7306('0x4d')]['id'];}return db[_0x7306('0x30')][_0x7306('0x4c')]({'where':{'id':_0x3f5bd6['params']['id']}})[_0x7306('0x29')](handleEntityNotFound(_0x23ebed,null))['then'](saveUpdates(_0x3f5bd6['body'],null))['then'](respondWithResult(_0x23ebed,null))['catch'](handleError(_0x23ebed,null));};exports[_0x7306('0x2a')]=function(_0x1faf7a,_0x5c2ba0){return db[_0x7306('0x30')][_0x7306('0x4c')]({'where':{'id':_0x1faf7a[_0x7306('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c2ba0,null))['then'](removeEntity(_0x5c2ba0,null))[_0x7306('0x47')](handleError(_0x5c2ba0,null));};exports[_0x7306('0x4e')]=function(_0x14418c,_0x362b64){return db[_0x7306('0x30')]['describe']()['then'](respondWithResult(_0x362b64,null))[_0x7306('0x47')](handleError(_0x362b64,null));};
\ No newline at end of file
index 218811b..c3cd4b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0584=['./cmHopperBlack.attributes','exports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5dea34,_0x2453d5){var _0x59eb20=function(_0x4fd5f6){while(--_0x4fd5f6){_0x5dea34['push'](_0x5dea34['shift']());}};_0x59eb20(++_0x2453d5);}(_0x0584,0xc0));var _0x4058=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x0584[_0x187ee1];return _0x388160;};'use strict';var _=require('lodash');var util=require(_0x4058('0x0'));var logger=require(_0x4058('0x1'))(_0x4058('0x2'));var moment=require(_0x4058('0x3'));var BPromise=require(_0x4058('0x4'));var rp=require(_0x4058('0x5'));var fs=require('fs');var path=require(_0x4058('0x6'));var rimraf=require(_0x4058('0x7'));var config=require('../../config/environment');var attributes=require(_0x4058('0x8'));module[_0x4058('0x9')]=function(_0x207a72,_0x47804d){return _0x207a72['define']('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x45d3=['moment','bluebird','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api'];(function(_0x1a4708,_0xbec007){var _0xd3e4c0=function(_0x15f352){while(--_0x15f352){_0x1a4708['push'](_0x1a4708['shift']());}};_0xd3e4c0(++_0xbec007);}(_0x45d3,0xbf));var _0x345d=function(_0xde142b,_0x40682c){_0xde142b=_0xde142b-0x0;var _0x4c9561=_0x45d3[_0xde142b];return _0x4c9561;};'use strict';var _=require(_0x345d('0x0'));var util=require(_0x345d('0x1'));var logger=require(_0x345d('0x2'))(_0x345d('0x3'));var moment=require(_0x345d('0x4'));var BPromise=require(_0x345d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x345d('0x6'));var config=require(_0x345d('0x7'));var attributes=require(_0x345d('0x8'));module[_0x345d('0x9')]=function(_0x2e25f8,_0xfd7b86){return _0x2e25f8[_0x345d('0xa')](_0x345d('0xb'),attributes,{'tableName':_0x345d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 35910cb..3d226f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0379=['CmHopperBlack,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','CmHopperBlack','findAll','options','include','map','model','attributes','GetCmHopperBlack','UpdateCmHopperBlack','update','body','raw','where','limit','DestroyCmHopperBlack','destroy','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info'];(function(_0x475ae4,_0x3d2b19){var _0x26da43=function(_0x7cce83){while(--_0x7cce83){_0x475ae4['push'](_0x475ae4['shift']());}};_0x26da43(++_0x3d2b19);}(_0x0379,0x195));var _0x9037=function(_0x412a32,_0x42fc14){_0x412a32=_0x412a32-0x0;var _0xcf6f5c=_0x0379[_0x412a32];return _0xcf6f5c;};'use strict';var _=require(_0x9037('0x0'));var util=require(_0x9037('0x1'));var moment=require('moment');var BPromise=require(_0x9037('0x2'));var rs=require(_0x9037('0x3'));var fs=require('fs');var Redis=require(_0x9037('0x4'));var db=require(_0x9037('0x5'))['db'];var utils=require(_0x9037('0x6'));var logger=require(_0x9037('0x7'))(_0x9037('0x8'));var config=require(_0x9037('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9037('0xa')][_0x9037('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e23de,_0x55e59c,_0x55d584){return new BPromise(function(_0x30a265,_0x30ba92){return client['request'](_0x5e23de,_0x55d584)['then'](function(_0x4bfa52){logger[_0x9037('0xc')](_0x9037('0xd'),_0x55e59c,'request\x20sent');logger[_0x9037('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x55e59c,'request\x20sent',JSON[_0x9037('0xf')](_0x4bfa52));if(_0x4bfa52[_0x9037('0x10')]){if(_0x4bfa52['error'][_0x9037('0x11')]===0x1f4){logger[_0x9037('0x10')](_0x9037('0xd'),_0x55e59c,_0x4bfa52[_0x9037('0x10')]['message']);return _0x30ba92(_0x4bfa52[_0x9037('0x10')][_0x9037('0x12')]);}logger[_0x9037('0x10')](_0x9037('0xd'),_0x55e59c,_0x4bfa52[_0x9037('0x10')][_0x9037('0x12')]);return _0x30a265(_0x4bfa52[_0x9037('0x10')][_0x9037('0x12')]);}else{logger['info'](_0x9037('0xd'),_0x55e59c,_0x9037('0x13'));_0x30a265(_0x4bfa52['result']['message']);}})[_0x9037('0x14')](function(_0x8a37ce){logger[_0x9037('0x10')](_0x9037('0xd'),_0x55e59c,_0x8a37ce);_0x30ba92(_0x8a37ce);});});}exports['GetCmHopperBlack']=function(_0x35d609){var _0x1164cc=this;return new Promise(function(_0x19096a,_0xb2d1fe){return db[_0x9037('0x15')][_0x9037('0x16')]({'raw':_0x35d609['options']?_0x35d609['options']['raw']===undefined?!![]:![]:!![],'where':_0x35d609[_0x9037('0x17')]?_0x35d609[_0x9037('0x17')]['where']||null:null,'attributes':_0x35d609[_0x9037('0x17')]?_0x35d609[_0x9037('0x17')]['attributes']||null:null,'limit':_0x35d609['options']?_0x35d609[_0x9037('0x17')]['limit']||null:null,'include':_0x35d609[_0x9037('0x17')]?_0x35d609[_0x9037('0x17')][_0x9037('0x18')]?_[_0x9037('0x19')](_0x35d609[_0x9037('0x17')][_0x9037('0x18')],function(_0xd8b76a){return{'model':db[_0xd8b76a[_0x9037('0x1a')]],'as':_0xd8b76a['as'],'attributes':_0xd8b76a[_0x9037('0x1b')],'include':_0xd8b76a[_0x9037('0x18')]?_['map'](_0xd8b76a['include'],function(_0x9d6909){return{'model':db[_0x9d6909[_0x9037('0x1a')]],'as':_0x9d6909['as'],'attributes':_0x9d6909['attributes'],'include':_0x9d6909[_0x9037('0x18')]?_[_0x9037('0x19')](_0x9d6909[_0x9037('0x18')],function(_0xefd8e2){return{'model':db[_0xefd8e2[_0x9037('0x1a')]],'as':_0xefd8e2['as'],'attributes':_0xefd8e2[_0x9037('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e7446){logger[_0x9037('0xc')](_0x9037('0x1c'),_0x35d609);logger['debug'](_0x9037('0x1c'),_0x35d609,JSON[_0x9037('0xf')](_0x1e7446));_0x19096a(_0x1e7446);})['catch'](function(_0x37b174){logger[_0x9037('0x10')](_0x9037('0x1c'),_0x37b174[_0x9037('0x12')],_0x35d609);_0xb2d1fe(_0x1164cc[_0x9037('0x10')](0x1f4,_0x37b174[_0x9037('0x12')]));});});};exports[_0x9037('0x1d')]=function(_0x3a49f9){var _0x2b1d6e=this;return new Promise(function(_0x3214c1,_0x1d59e1){return db[_0x9037('0x15')][_0x9037('0x1e')](_0x3a49f9[_0x9037('0x1f')],{'raw':_0x3a49f9[_0x9037('0x17')]?_0x3a49f9[_0x9037('0x17')][_0x9037('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a49f9[_0x9037('0x17')]?_0x3a49f9[_0x9037('0x17')][_0x9037('0x21')]||null:null,'attributes':_0x3a49f9[_0x9037('0x17')]?_0x3a49f9[_0x9037('0x17')][_0x9037('0x1b')]||null:null,'limit':_0x3a49f9[_0x9037('0x17')]?_0x3a49f9[_0x9037('0x17')][_0x9037('0x22')]||null:null})['then'](function(_0x451742){logger[_0x9037('0xc')](_0x9037('0x1d'),_0x3a49f9);logger[_0x9037('0xe')](_0x9037('0x1d'),_0x3a49f9,JSON[_0x9037('0xf')](_0x451742));_0x3214c1(_0x451742);})[_0x9037('0x14')](function(_0x38712f){logger[_0x9037('0x10')]('UpdateCmHopperBlack',_0x38712f[_0x9037('0x12')],_0x3a49f9);_0x1d59e1(_0x2b1d6e[_0x9037('0x10')](0x1f4,_0x38712f[_0x9037('0x12')]));});});};exports[_0x9037('0x23')]=function(_0x5e8eed){var _0x4f40df=this;return new Promise(function(_0x5c760c,_0x2e55aa){return db['CmHopperBlack'][_0x9037('0x24')]({'where':_0x5e8eed['options']?_0x5e8eed[_0x9037('0x17')]['where']||null:null})[_0x9037('0x25')](function(_0x28eeeb){logger[_0x9037('0xc')](_0x9037('0x23'),_0x5e8eed);logger[_0x9037('0xe')](_0x9037('0x23'),_0x5e8eed,JSON[_0x9037('0xf')](_0x28eeeb));_0x5c760c(_0x28eeeb);})[_0x9037('0x14')](function(_0x387254){logger[_0x9037('0x10')](_0x9037('0x23'),_0x387254[_0x9037('0x12')],_0x5e8eed);_0x2e55aa(_0x4f40df[_0x9037('0x10')](0x1f4,_0x387254['message']));});});};
\ No newline at end of file
+var _0xd447=['GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','include','model','attributes','map','UpdateCmHopperBlack','update','where','DestroyCmHopperBlack','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch'];(function(_0x44f0ed,_0x5725a1){var _0x3d3683=function(_0x2668ee){while(--_0x2668ee){_0x44f0ed['push'](_0x44f0ed['shift']());}};_0x3d3683(++_0x5725a1);}(_0xd447,0x1a6));var _0x7d44=function(_0x328a9e,_0x23d474){_0x328a9e=_0x328a9e-0x0;var _0x3214a3=_0xd447[_0x328a9e];return _0x3214a3;};'use strict';var _=require(_0x7d44('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7d44('0x1'));var fs=require('fs');var Redis=require(_0x7d44('0x2'));var db=require(_0x7d44('0x3'))['db'];var utils=require(_0x7d44('0x4'));var logger=require('../../config/logger')(_0x7d44('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7d44('0x6')][_0x7d44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32a8f7,_0x57eb61,_0x26db6d){return new BPromise(function(_0x4a1f5b,_0x18c015){return client[_0x7d44('0x8')](_0x32a8f7,_0x26db6d)[_0x7d44('0x9')](function(_0x4a5b90){logger[_0x7d44('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x57eb61,_0x7d44('0xb'));logger[_0x7d44('0xc')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x57eb61,_0x7d44('0xb'),JSON[_0x7d44('0xd')](_0x4a5b90));if(_0x4a5b90[_0x7d44('0xe')]){if(_0x4a5b90[_0x7d44('0xe')][_0x7d44('0xf')]===0x1f4){logger['error'](_0x7d44('0x10'),_0x57eb61,_0x4a5b90['error']['message']);return _0x18c015(_0x4a5b90[_0x7d44('0xe')][_0x7d44('0x11')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x57eb61,_0x4a5b90['error']['message']);return _0x4a1f5b(_0x4a5b90['error'][_0x7d44('0x11')]);}else{logger[_0x7d44('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x57eb61,_0x7d44('0xb'));_0x4a1f5b(_0x4a5b90[_0x7d44('0x12')]['message']);}})[_0x7d44('0x13')](function(_0xf8b80f){logger[_0x7d44('0xe')](_0x7d44('0x10'),_0x57eb61,_0xf8b80f);_0x18c015(_0xf8b80f);});});}exports[_0x7d44('0x14')]=function(_0x2f0561){var _0x31d653=this;return new Promise(function(_0x50e748,_0x261509){return db[_0x7d44('0x15')][_0x7d44('0x16')]({'raw':_0x2f0561[_0x7d44('0x17')]?_0x2f0561[_0x7d44('0x17')][_0x7d44('0x18')]===undefined?!![]:![]:!![],'where':_0x2f0561[_0x7d44('0x17')]?_0x2f0561[_0x7d44('0x17')]['where']||null:null,'attributes':_0x2f0561[_0x7d44('0x17')]?_0x2f0561[_0x7d44('0x17')]['attributes']||null:null,'limit':_0x2f0561[_0x7d44('0x17')]?_0x2f0561[_0x7d44('0x17')][_0x7d44('0x19')]||null:null,'include':_0x2f0561['options']?_0x2f0561[_0x7d44('0x17')][_0x7d44('0x1a')]?_['map'](_0x2f0561[_0x7d44('0x17')][_0x7d44('0x1a')],function(_0x7c224){return{'model':db[_0x7c224[_0x7d44('0x1b')]],'as':_0x7c224['as'],'attributes':_0x7c224[_0x7d44('0x1c')],'include':_0x7c224[_0x7d44('0x1a')]?_[_0x7d44('0x1d')](_0x7c224[_0x7d44('0x1a')],function(_0x1f0880){return{'model':db[_0x1f0880['model']],'as':_0x1f0880['as'],'attributes':_0x1f0880[_0x7d44('0x1c')],'include':_0x1f0880[_0x7d44('0x1a')]?_[_0x7d44('0x1d')](_0x1f0880[_0x7d44('0x1a')],function(_0x41191a){return{'model':db[_0x41191a['model']],'as':_0x41191a['as'],'attributes':_0x41191a[_0x7d44('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x108ee3){logger['info'](_0x7d44('0x14'),_0x2f0561);logger[_0x7d44('0xc')](_0x7d44('0x14'),_0x2f0561,JSON['stringify'](_0x108ee3));_0x50e748(_0x108ee3);})[_0x7d44('0x13')](function(_0x21b420){logger[_0x7d44('0xe')](_0x7d44('0x14'),_0x21b420[_0x7d44('0x11')],_0x2f0561);_0x261509(_0x31d653[_0x7d44('0xe')](0x1f4,_0x21b420[_0x7d44('0x11')]));});});};exports[_0x7d44('0x1e')]=function(_0x2f14f2){var _0x26bbc5=this;return new Promise(function(_0x36fb65,_0x333bc3){return db['CmHopperBlack'][_0x7d44('0x1f')](_0x2f14f2['body'],{'raw':_0x2f14f2[_0x7d44('0x17')]?_0x2f14f2['options'][_0x7d44('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f14f2[_0x7d44('0x17')]?_0x2f14f2[_0x7d44('0x17')][_0x7d44('0x20')]||null:null,'attributes':_0x2f14f2[_0x7d44('0x17')]?_0x2f14f2[_0x7d44('0x17')][_0x7d44('0x1c')]||null:null,'limit':_0x2f14f2[_0x7d44('0x17')]?_0x2f14f2['options'][_0x7d44('0x19')]||null:null})[_0x7d44('0x9')](function(_0x2d016e){logger[_0x7d44('0xa')](_0x7d44('0x1e'),_0x2f14f2);logger[_0x7d44('0xc')](_0x7d44('0x1e'),_0x2f14f2,JSON[_0x7d44('0xd')](_0x2d016e));_0x36fb65(_0x2d016e);})['catch'](function(_0x20b95a){logger[_0x7d44('0xe')](_0x7d44('0x1e'),_0x20b95a[_0x7d44('0x11')],_0x2f14f2);_0x333bc3(_0x26bbc5[_0x7d44('0xe')](0x1f4,_0x20b95a[_0x7d44('0x11')]));});});};exports[_0x7d44('0x21')]=function(_0x218812){var _0x43513c=this;return new Promise(function(_0x157bc3,_0xb49ca1){return db['CmHopperBlack']['destroy']({'where':_0x218812[_0x7d44('0x17')]?_0x218812['options'][_0x7d44('0x20')]||null:null})['then'](function(_0x856cc6){logger['info']('DestroyCmHopperBlack',_0x218812);logger[_0x7d44('0xc')]('DestroyCmHopperBlack',_0x218812,JSON[_0x7d44('0xd')](_0x856cc6));_0x157bc3(_0x856cc6);})[_0x7d44('0x13')](function(_0x43055d){logger[_0x7d44('0xe')](_0x7d44('0x21'),_0x43055d[_0x7d44('0x11')],_0x218812);_0xb49ca1(_0x43513c[_0x7d44('0xe')](0x1f4,_0x43055d[_0x7d44('0x11')]));});});};
\ No newline at end of file
index 03f03b8..3d4a48b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf072=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x5d3a2e,_0x381d38){var _0x1a4841=function(_0x1067bf){while(--_0x1067bf){_0x5d3a2e['push'](_0x5d3a2e['shift']());}};_0x1a4841(++_0x381d38);}(_0xf072,0x1cf));var _0x2f07=function(_0x535173,_0xf91ad7){_0x535173=_0x535173-0x0;var _0x4ce73c=_0xf072[_0x535173];return _0x4ce73c;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0xf')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller['update']);router[_0x2f07('0x10')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x0a6b=['fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','show','put','/:id','delete','destroy','exports','multer','express'];(function(_0x3f5c73,_0x7334d1){var _0x1d9c6d=function(_0x8237f){while(--_0x8237f){_0x3f5c73['push'](_0x3f5c73['shift']());}};_0x1d9c6d(++_0x7334d1);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x4bb6f6,_0x44aff4){_0x4bb6f6=_0x4bb6f6-0x0;var _0x4e71c3=_0x0a6b[_0x4bb6f6];return _0x4e71c3;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var fs_extra=require(_0xb0a6('0x2'));var auth=require(_0xb0a6('0x3'));var interaction=require(_0xb0a6('0x4'));var config=require('../../config/environment');var controller=require(_0xb0a6('0x5'));router['get']('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x7')]);router['get'](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb0a6('0xa')]);router[_0xb0a6('0xb')](_0xb0a6('0xc'),auth[_0xb0a6('0x6')](),controller['update']);router[_0xb0a6('0xd')](_0xb0a6('0xc'),auth['isAuthenticated'](),controller[_0xb0a6('0xe')]);module[_0xb0a6('0xf')]=router;
\ No newline at end of file
index 254d7db..e4cd54b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a6b=['BOOLEAN','sequelize','INTEGER','STRING','DATE','endtime','followuptime','diff','seconds'];(function(_0x2d76b7,_0x4aa7d5){var _0x1ed750=function(_0x3f8835){while(--_0x3f8835){_0x2d76b7['push'](_0x2d76b7['shift']());}};_0x1ed750(++_0x4aa7d5);}(_0x9a6b,0x7f));var _0xb9a6=function(_0x32f9c6,_0x357629){_0x32f9c6=_0x32f9c6-0x0;var _0x2c90ea=_0x9a6b[_0x32f9c6];return _0x2c90ea;};'use strict';var Sequelize=require(_0xb9a6('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xb9a6('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb9a6('0x2')]},'scheduledat':{'type':Sequelize[_0xb9a6('0x3')]},'countbusyretry':{'type':Sequelize[_0xb9a6('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb9a6('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb9a6('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb9a6('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xb9a6('0x2')]},'originatecalleridname':{'type':Sequelize[_0xb9a6('0x2')]},'calleridnum':{'type':Sequelize[_0xb9a6('0x2')]},'calleridname':{'type':Sequelize[_0xb9a6('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb9a6('0x3')]},'answertime':{'type':Sequelize[_0xb9a6('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb9a6('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb9a6('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb9a6('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb9a6('0x2')]},'membername':{'type':Sequelize[_0xb9a6('0x2')]},'reason':{'type':Sequelize[_0xb9a6('0x2')]},'disposition':{'type':Sequelize[_0xb9a6('0x2')]},'secondDisposition':{'type':Sequelize[_0xb9a6('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb9a6('0x2')]},'dispositionat':{'type':Sequelize[_0xb9a6('0x3')],'set':function(_0x26afe1){var _0x5d0017=this['getDataValue'](_0xb9a6('0x4'));if(_0x5d0017&&_0x26afe1){this['setDataValue'](_0xb9a6('0x5'),moment(_0x26afe1)[_0xb9a6('0x6')](moment(_0x5d0017),_0xb9a6('0x7')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xb9a6('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb9a6('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb9a6('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb9a6('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb9a6('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb9a6('0x3')]},'deleted':{'type':Sequelize[_0xb9a6('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb9a6('0x3')]},'recallme':{'type':Sequelize[_0xb9a6('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb9a6('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xb9a6('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb9a6('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb9a6('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcaeb=['moment','STRING','DATE','INTEGER','getDataValue','setDataValue','followuptime','seconds','BOOLEAN','sequelize'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0xcaeb,0x121));var _0xbcae=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xcaeb[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xbcae('0x0'));var moment=require(_0xbcae('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xbcae('0x2')]},'scheduledat':{'type':Sequelize[_0xbcae('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbcae('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbcae('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xbcae('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xbcae('0x2')]},'originatecalleridname':{'type':Sequelize[_0xbcae('0x2')]},'calleridnum':{'type':Sequelize[_0xbcae('0x2')]},'calleridname':{'type':Sequelize[_0xbcae('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xbcae('0x3')]},'answertime':{'type':Sequelize[_0xbcae('0x3')]},'droptime':{'type':Sequelize[_0xbcae('0x3')]},'endtime':{'type':Sequelize[_0xbcae('0x3')]},'ringtime':{'type':Sequelize[_0xbcae('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbcae('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbcae('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xbcae('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xbcae('0x2')]},'membername':{'type':Sequelize[_0xbcae('0x2')]},'reason':{'type':Sequelize[_0xbcae('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbcae('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x262e5a){var _0x4b2fb8=this[_0xbcae('0x5')]('endtime');if(_0x4b2fb8&&_0x262e5a){this[_0xbcae('0x6')](_0xbcae('0x7'),moment(_0x262e5a)['diff'](moment(_0x4b2fb8),_0xbcae('0x8')));}}},'amd':{'type':Sequelize[_0xbcae('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xbcae('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xbcae('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbcae('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbcae('0x3')]},'deleted':{'type':Sequelize[_0xbcae('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xbcae('0x3')]},'recallme':{'type':Sequelize[_0xbcae('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xbcae('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xbcae('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbcae('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbcae('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index d091929..57d6496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0x781d,0x14a));var _0xd781=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x781d[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':!![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['describe']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['describe']()[_0xd781('0x26')](respondWithResult(_0x16d16e,null))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x39ecdb,_0x336d30){if(_0x39ecdb[_0xd781('0x44')][_0xd781('0x45')]){delete _0x39ecdb['body'][_0xd781('0x45')];}return db[_0xd781('0x2c')][_0xd781('0x46')]({'where':{'uniqueid':_0x39ecdb['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x336d30,null))[_0xd781('0x26')](saveUpdates(_0x39ecdb['body'],null))[_0xd781('0x26')](respondWithResult(_0x336d30,null))[_0xd781('0x3f')](handleError(_0x336d30,null));};exports[_0xd781('0x47')]=function(_0x207546,_0x42a2f9,_0x599915){return db[_0xd781('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x207546[_0xd781('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd781('0x4b')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd781('0x4c')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd781('0x4f')))),_0xd781('0x50')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd781('0x53')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x54')))),_0xd781('0x55')]]})['then'](handleEntityNotFound(_0x42a2f9,null))[_0xd781('0x26')](respondWithResult(_0x42a2f9,null))[_0xd781('0x3f')](handleError(_0x42a2f9,null));};exports[_0xd781('0x56')]=function(_0x2c4874,_0x2e8bab,_0x38bd3e){return db[_0xd781('0x2c')][_0xd781('0x57')]({'raw':![],'where':{'CampaignId':_0x2c4874[_0xd781('0x41')]['id']},'attributes':[[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x58')))),_0xd781('0x59')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5a')))),_0xd781('0x4b')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4f')))),_0xd781('0x50')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5b')))),_0xd781('0x53')],[db['sequelize']['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd781('0x26')](handleEntityNotFound(_0x2e8bab,null))[_0xd781('0x26')](respondWithResult(_0x2e8bab,null))[_0xd781('0x3f')](handleError(_0x2e8bab,null));};exports[_0xd781('0x5c')]=function(_0x26a0a9,_0x172a05,_0x2e0401){return db[_0xd781('0x5d')][_0xd781('0x46')]({'where':{'id':_0x26a0a9['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x172a05,null))[_0xd781('0x26')](function(_0x4c712f){var _0x24e3f5;if(_0x4c712f){_0x24e3f5=squel['insert']()[_0xd781('0x5e')](_0xd781('0x5f'))['fromQuery'](['phone',_0xd781('0x60'),_0xd781('0x61'),_0xd781('0x62'),_0xd781('0x63'),_0xd781('0x64'),_0xd781('0x65')],squel['select']()[_0xd781('0x66')](_0xd781('0x67'),_0xd781('0x68'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),'ListId')[_0xd781('0x66')]('ANY_VALUE(VoiceQueueId)',_0xd781('0x63'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x65'))[_0xd781('0x6c')](_0xd781('0x6d'))[_0xd781('0x39')]('VoiceQueueId\x20=\x20?',_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]())['where'](_0xd781('0x6f'),_0x26a0a9[_0xd781('0x44')][_0xd781('0x70')]['toString']())['where'](_0xd781('0x71'))['where'](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x68'))[_0xd781('0x6c')]('cm_hopper')[_0xd781('0x39')](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))[_0xd781('0x6c')](_0xd781('0x6d'))['where'](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id']['toString']())[_0xd781('0x39')](_0xd781('0x76')))[_0xd781('0x77')]('ContactId'))[_0xd781('0x6e')]();return db[_0xd781('0x49')]['query'](_0x24e3f5);}return[];})[_0xd781('0x26')](respondWithResult(_0x172a05,null))['catch'](handleError(_0x172a05,null));};exports[_0xd781('0x78')]=function(_0x23dba5,_0x3e0749,_0x192c95){return db[_0xd781('0x79')]['find']({'where':{'id':_0x23dba5[_0xd781('0x41')]['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x3e0749,null))[_0xd781('0x26')](function(_0x3897bf){var _0xaa945b;if(_0x3897bf){_0xaa945b=squel[_0xd781('0x7a')]()['into'](_0xd781('0x5f'))[_0xd781('0x7b')](['phone',_0xd781('0x60'),_0xd781('0x61'),'ListId',_0xd781('0x7c'),_0xd781('0x64'),_0xd781('0x65')],squel[_0xd781('0x73')]()[_0xd781('0x66')]('ANY_VALUE(calleridnum)','phone')['field'](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),_0xd781('0x62'))[_0xd781('0x66')]('ANY_VALUE(CampaignId)',_0xd781('0x7c'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')]('NOW()','updatedAt')['from'](_0xd781('0x6d'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id']['toString']())['where'](_0xd781('0x6f'),_0x23dba5[_0xd781('0x44')][_0xd781('0x70')][_0xd781('0x6e')]())['where'](_0xd781('0x71'))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')]('phone')[_0xd781('0x6c')](_0xd781('0x5f'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))['from']('cm_hopper_final')[_0xd781('0x39')](_0xd781('0x7d'),_0x23dba5['params']['id'][_0xd781('0x6e')]())[_0xd781('0x39')]('state\x20=\x204'))[_0xd781('0x77')](_0xd781('0x61')))['toString']();return db[_0xd781('0x49')]['query'](_0xaa945b);}return[];})[_0xd781('0x26')](respondWithResult(_0x3e0749,null))[_0xd781('0x3f')](handleError(_0x3e0749,null));};exports[_0xd781('0x7e')]=function(_0x52b9c6,_0x5a2252,_0x356c56){return db[_0xd781('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x63')],'CampaignId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x7c')],'ContactId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x61')]}})[_0xd781('0x26')](handleEntityNotFound(_0x5a2252,null))[_0xd781('0x26')](function(_0x532fd8){if(_0x532fd8){return _0x532fd8;}return null;})[_0xd781('0x26')](respondWithResult(_0x5a2252,null))[_0xd781('0x3f')](handleError(_0x5a2252,null));};
\ No newline at end of file
+var _0x430c=['field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','createdAt','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','from','checkContactHopper','CmHopper','findOne','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','describe','update','uniqueid','body','find','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x208,\x201,\x20null','dropContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select'];(function(_0x447678,_0x3a16b3){var _0x4355ba=function(_0x415e47){while(--_0x415e47){_0x447678['push'](_0x447678['shift']());}};_0x4355ba(++_0x3a16b3);}(_0x430c,0x1a1));var _0xc430=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x430c[_0x1304c6];return _0x2e6654;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['describe']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')]()[_0xc430('0x1e')](respondWithResult(_0x4eafae,null))['catch'](handleError(_0x4eafae,null));};exports[_0xc430('0x45')]=function(_0x2e7052,_0x19e563){if(_0x2e7052['body'][_0xc430('0x46')]){delete _0x2e7052[_0xc430('0x47')][_0xc430('0x46')];}return db[_0xc430('0x25')][_0xc430('0x48')]({'where':{'uniqueid':_0x2e7052[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19e563,null))['then'](saveUpdates(_0x2e7052[_0xc430('0x47')],null))[_0xc430('0x1e')](respondWithResult(_0x19e563,null))[_0xc430('0x40')](handleError(_0x19e563,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x23cb41,_0x4178d7,_0x2d064b){return db[_0xc430('0x25')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x23cb41[_0xc430('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x4e')))),_0xc430('0x4f')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x50')))),_0xc430('0x51')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xc430('0x52')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x53')))),'dropContacts'],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x58')))),'answeringMachine']]})[_0xc430('0x1e')](handleEntityNotFound(_0x4178d7,null))[_0xc430('0x1e')](respondWithResult(_0x4178d7,null))[_0xc430('0x40')](handleError(_0x4178d7,null));};exports[_0xc430('0x59')]=function(_0x147062,_0x45eec6,_0x5d3393){return db[_0xc430('0x25')][_0xc430('0x3e')]({'raw':![],'where':{'CampaignId':_0x147062['params']['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4e')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0xc430('0x51')],[db['sequelize']['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x5a')))),'congestionContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xc430('0x5b')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x58')))),_0xc430('0x5c')]]})['then'](handleEntityNotFound(_0x45eec6,null))['then'](respondWithResult(_0x45eec6,null))[_0xc430('0x40')](handleError(_0x45eec6,null));};exports[_0xc430('0x5d')]=function(_0x31ae3c,_0x19c080,_0x256290){return db[_0xc430('0x5e')][_0xc430('0x48')]({'where':{'id':_0x31ae3c[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19c080,null))[_0xc430('0x1e')](function(_0x5ca0f2){var _0x6debfb;if(_0x5ca0f2){_0x6debfb=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery'](['phone',_0xc430('0x61'),_0xc430('0x62'),_0xc430('0x63'),_0xc430('0x64'),'createdAt',_0xc430('0x65')],squel[_0xc430('0x66')]()[_0xc430('0x67')]('ANY_VALUE(calleridnum)',_0xc430('0x68'))['field'](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),_0xc430('0x62'))['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x6c'),'VoiceQueueId')['field'](_0xc430('0x69'),'createdAt')['field'](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x6e'),_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())[_0xc430('0x34')]('state\x20=\x20?',_0x31ae3c[_0xc430('0x47')][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()['field'](_0xc430('0x68'))['from']('cm_hopper')[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id']['toString']()))[_0xc430('0x34')](_0xc430('0x71'),squel['select']()[_0xc430('0x67')](_0xc430('0x72'))['from'](_0xc430('0x6d'))[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())['where'](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x6debfb);}return[];})[_0xc430('0x1e')](respondWithResult(_0x19c080,null))[_0xc430('0x40')](handleError(_0x19c080,null));};exports[_0xc430('0x75')]=function(_0x19789f,_0x24b380,_0x4fe467){return db[_0xc430('0x76')][_0xc430('0x48')]({'where':{'id':_0x19789f[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x24b380,null))['then'](function(_0x150a8a){var _0x4edead;if(_0x150a8a){_0x4edead=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery']([_0xc430('0x68'),_0xc430('0x61'),_0xc430('0x62'),'ListId',_0xc430('0x77'),'createdAt','updatedAt'],squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x78'),'phone')[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),'ContactId')['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x79'),_0xc430('0x77'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x7a'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())['where'](_0xc430('0x7c'),_0x19789f['body'][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')](_0xc430('0x7d'))[_0xc430('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')[_0xc430('0x7e')]('cm_hopper')['where'](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id'][_0xc430('0x6f')]()))[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x72'))[_0xc430('0x7e')](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())[_0xc430('0x34')](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x4edead);}return[];})[_0xc430('0x1e')](respondWithResult(_0x24b380,null))['catch'](handleError(_0x24b380,null));};exports[_0xc430('0x7f')]=function(_0x6e48a3,_0x5be78a,_0x3bd6e1){return db[_0xc430('0x80')][_0xc430('0x81')]({'where':{'VoiceQueueId':_0x6e48a3[_0xc430('0x47')]['VoiceQueueId'],'CampaignId':_0x6e48a3[_0xc430('0x47')]['CampaignId'],'ContactId':_0x6e48a3['body'][_0xc430('0x62')]}})[_0xc430('0x1e')](handleEntityNotFound(_0x5be78a,null))[_0xc430('0x1e')](function(_0x207067){if(_0x207067){return _0x207067;}return null;})[_0xc430('0x1e')](respondWithResult(_0x5be78a,null))[_0xc430('0x40')](handleError(_0x5be78a,null));};
\ No newline at end of file
index b8d3e0c..5bb5722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x840f=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x44ab66,_0x5e37f6){var _0x3207c9=function(_0x3bcb43){while(--_0x3bcb43){_0x44ab66['push'](_0x44ab66['shift']());}};_0x3207c9(++_0x5e37f6);}(_0x840f,0x1c2));var _0xf840=function(_0x13998d,_0x10875f){_0x13998d=_0x13998d-0x0;var _0x491bc1=_0x840f[_0x13998d];return _0x491bc1;};'use strict';var _=require(_0xf840('0x0'));var util=require(_0xf840('0x1'));var logger=require(_0xf840('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf840('0x3'));var rp=require(_0xf840('0x4'));var fs=require('fs');var path=require(_0xf840('0x5'));var rimraf=require(_0xf840('0x6'));var config=require(_0xf840('0x7'));var attributes=require(_0xf840('0x8'));module['exports']=function(_0x1cf34c,_0x4927ed){return _0x1cf34c['define'](_0xf840('0x9'),attributes,{'tableName':_0xf840('0xa'),'paranoid':![],'indexes':[{'name':_0xf840('0xb'),'fields':[_0xf840('0xb')]},{'name':_0xf840('0xc'),'fields':[_0xf840('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdfb7=['CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','bluebird','rimraf','./cmHopperFinal.attributes','exports'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xdfb7,0x178));var _0x7dfb=function(_0x685047,_0x51decf){_0x685047=_0x685047-0x0;var _0x1bb61f=_0xdfb7[_0x685047];return _0x1bb61f;};'use strict';var _=require(_0x7dfb('0x0'));var util=require(_0x7dfb('0x1'));var logger=require(_0x7dfb('0x2'))('api');var moment=require(_0x7dfb('0x3'));var BPromise=require(_0x7dfb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7dfb('0x5'));var config=require('../../config/environment');var attributes=require(_0x7dfb('0x6'));module[_0x7dfb('0x7')]=function(_0x3aebfb,_0x2bdc6d){return _0x3aebfb['define'](_0x7dfb('0x8'),attributes,{'tableName':_0x7dfb('0x9'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x7dfb('0xa')]},{'name':_0x7dfb('0xb'),'fields':[_0x7dfb('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 94d35e2..d3d4d83 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(_0x27d604,_0x1268a5){var _0x5143c5=function(_0x479521){while(--_0x479521){_0x27d604['push'](_0x27d604['shift']());}};_0x5143c5(++_0x1268a5);}(_0xb10b,0x12a));var _0xbb10=function(_0x45271c,_0x1bf2d8){_0x45271c=_0x45271c-0x0;var _0x44bfda=_0xb10b[_0x45271c];return _0x44bfda;};'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(_0x37ad58,_0x6e5a80){var _0x29ccce=function(_0x26043b){while(--_0x26043b){_0x37ad58['push'](_0x37ad58['shift']());}};_0x29ccce(++_0x6e5a80);}(_0x7a54,0x106));var _0x47a5=function(_0x35fe96,_0x3c274c){_0x35fe96=_0x35fe96-0x0;var _0x54a649=_0x7a54[_0x35fe96];return _0x54a649;};'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 0b17453..6dd525d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2a2=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','put','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post'];(function(_0xaca348,_0x4d3993){var _0x560057=function(_0x41e145){while(--_0x41e145){_0xaca348['push'](_0xaca348['shift']());}};_0x560057(++_0x4d3993);}(_0xc2a2,0x84));var _0x2c2a=function(_0x5d207d,_0x1932d6){_0x5d207d=_0x5d207d-0x0;var _0x217f1d=_0xc2a2[_0x5d207d];return _0x217f1d;};'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']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2c2a('0x9')]('/:id',auth[_0x2c2a('0xa')](),controller['show']);router[_0x2c2a('0x9')](_0x2c2a('0xb'),auth[_0x2c2a('0xa')](),controller[_0x2c2a('0xc')]);router[_0x2c2a('0x9')](_0x2c2a('0xd'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x2c2a('0xe')](_0x2c2a('0xf'),auth[_0x2c2a('0xa')](),controller[_0x2c2a('0x10')]);router[_0x2c2a('0xe')](_0x2c2a('0x11'),auth['isAuthenticated'](),controller[_0x2c2a('0x12')]);router[_0x2c2a('0xe')]('/checkContactHopper',auth[_0x2c2a('0xa')](),controller['checkContactHopper']);router[_0x2c2a('0x13')]('/:id',auth[_0x2c2a('0xa')](),controller[_0x2c2a('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x5324=['update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper'];(function(_0x50720c,_0x13f3e0){var _0x3674cd=function(_0x4ae5e4){while(--_0x4ae5e4){_0x50720c['push'](_0x50720c['shift']());}};_0x3674cd(++_0x13f3e0);}(_0x5324,0x154));var _0x4532=function(_0x4f5a99,_0x505eba){_0x4f5a99=_0x4f5a99-0x0;var _0x43d44d=_0x5324[_0x4f5a99];return _0x43d44d;};'use strict';var multer=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var path=require(_0x4532('0x2'));var timeout=require(_0x4532('0x3'));var express=require('express');var router=express[_0x4532('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4532('0x5'));var interaction=require(_0x4532('0x6'));var config=require(_0x4532('0x7'));var controller=require(_0x4532('0x8'));router[_0x4532('0x9')]('/',auth[_0x4532('0xa')](),controller[_0x4532('0xb')]);router[_0x4532('0x9')]('/describe',auth[_0x4532('0xa')](),controller[_0x4532('0xc')]);router[_0x4532('0x9')](_0x4532('0xd'),auth[_0x4532('0xa')](),controller[_0x4532('0xe')]);router[_0x4532('0x9')](_0x4532('0xf'),auth[_0x4532('0xa')](),controller[_0x4532('0x10')]);router[_0x4532('0x9')](_0x4532('0x11'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x4532('0x12')]('/voice/queue/moveContacts/:id',auth[_0x4532('0xa')](),controller[_0x4532('0x13')]);router[_0x4532('0x12')](_0x4532('0x14'),auth['isAuthenticated'](),controller[_0x4532('0x15')]);router[_0x4532('0x12')](_0x4532('0x16'),auth[_0x4532('0xa')](),controller[_0x4532('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4532('0x18')]);module[_0x4532('0x19')]=router;
\ No newline at end of file
index 3843474..36f9750 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6cf=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xb6cf,0xd6));var _0xfb6c=function(_0x49f19e,_0x1c3aa3){_0x49f19e=_0x49f19e-0x0;var _0x280b5a=_0xb6cf[_0x49f19e];return _0x280b5a;};'use strict';var Sequelize=require(_0xfb6c('0x0'));module[_0xfb6c('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xfb6c('0x2')]},'scheduledat':{'type':Sequelize[_0xfb6c('0x3')]},'countbusyretry':{'type':Sequelize[_0xfb6c('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfb6c('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xfb6c('0x2')]},'originatecalleridname':{'type':Sequelize[_0xfb6c('0x2')]},'calleridnum':{'type':Sequelize[_0xfb6c('0x2')]},'calleridname':{'type':Sequelize[_0xfb6c('0x2')]},'starttime':{'type':Sequelize[_0xfb6c('0x3')]},'responsetime':{'type':Sequelize[_0xfb6c('0x3')]},'answertime':{'type':Sequelize[_0xfb6c('0x3')]},'droptime':{'type':Sequelize[_0xfb6c('0x3')]},'endtime':{'type':Sequelize[_0xfb6c('0x3')]},'ringtime':{'type':Sequelize[_0xfb6c('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfb6c('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfb6c('0x2')]},'campaign':{'type':Sequelize[_0xfb6c('0x2')]},'campaigntype':{'type':Sequelize[_0xfb6c('0x2')]},'membername':{'type':Sequelize[_0xfb6c('0x2')]},'reason':{'type':Sequelize[_0xfb6c('0x2')]},'amd':{'type':Sequelize[_0xfb6c('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfb6c('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfb6c('0x3')]},'recallme':{'type':Sequelize[_0xfb6c('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xfb6c('0x3')]},'edited':{'type':Sequelize[_0xfb6c('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xfb6c('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfb6c('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfb6c('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x44b5=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x44b5,0xe4));var _0x544b=function(_0x56a9ae,_0xe89971){_0x56a9ae=_0x56a9ae-0x0;var _0x5e5f28=_0x44b5[_0x56a9ae];return _0x5e5f28;};'use strict';var Sequelize=require(_0x544b('0x0'));module['exports']={'state':{'type':Sequelize[_0x544b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x544b('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x544b('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x544b('0x2')]},'originatecalleridname':{'type':Sequelize[_0x544b('0x2')]},'calleridnum':{'type':Sequelize[_0x544b('0x2')]},'calleridname':{'type':Sequelize[_0x544b('0x2')]},'starttime':{'type':Sequelize[_0x544b('0x3')]},'responsetime':{'type':Sequelize[_0x544b('0x3')]},'answertime':{'type':Sequelize[_0x544b('0x3')]},'droptime':{'type':Sequelize[_0x544b('0x3')]},'endtime':{'type':Sequelize[_0x544b('0x3')]},'ringtime':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x544b('0x2')]},'amd':{'type':Sequelize[_0x544b('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x544b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x544b('0x3')]},'recallme':{'type':Sequelize[_0x544b('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x544b('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index e983735..ee894e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cfd=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','save','update','then','destroy','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','filter','merge','map','options','includeAll','include','rows','catch','show','params','length','create','body','describe','uniqueid','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x0cfd,0x1e7));var _0xd0cf=function(_0x252b2a,_0x31afd0){_0x252b2a=_0x252b2a-0x0;var _0x127ad1=_0x0cfd[_0x252b2a];return _0x127ad1;};'use strict';var emlformat=require(_0xd0cf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0cf('0x1'));var jsonpatch=require(_0xd0cf('0x2'));var rp=require(_0xd0cf('0x3'));var moment=require('moment');var BPromise=require(_0xd0cf('0x4'));var Mustache=require('mustache');var util=require(_0xd0cf('0x5'));var path=require(_0xd0cf('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd0cf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0cf('0x8'));var squel=require(_0xd0cf('0x9'));var crypto=require(_0xd0cf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd0cf('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd0cf('0xc'));var Papa=require(_0xd0cf('0xd'));var Redis=require('ioredis');var authService=require(_0xd0cf('0xe'));var qs=require(_0xd0cf('0xf'));var as=require(_0xd0cf('0x10'));var hardwareService=require(_0xd0cf('0x11'));var logger=require(_0xd0cf('0x12'))('api');var utils=require(_0xd0cf('0x13'));var config=require(_0xd0cf('0x14'));var licenseUtil=require(_0xd0cf('0x15'));var db=require(_0xd0cf('0x16'))['db'];function respondWithStatusCode(_0x592dc6,_0x3416e3){_0x3416e3=_0x3416e3||0xcc;return function(_0x27a5cb){if(_0x27a5cb){return _0x592dc6[_0xd0cf('0x17')](_0x3416e3);}return _0x592dc6[_0xd0cf('0x18')](_0x3416e3)[_0xd0cf('0x19')]();};}function respondWithResult(_0x4a2579,_0x5e75bb){_0x5e75bb=_0x5e75bb||0xc8;return function(_0x206ad2){if(_0x206ad2){return _0x4a2579['status'](_0x5e75bb)[_0xd0cf('0x1a')](_0x206ad2);}};}function respondWithFilteredResult(_0x2432a6,_0x179dfd){return function(_0x3469c5){if(_0x3469c5){var _0xa40d6a=typeof _0x179dfd['offset']===_0xd0cf('0x1b')&&typeof _0x179dfd[_0xd0cf('0x1c')]===_0xd0cf('0x1b');var _0x553d60=_0x3469c5[_0xd0cf('0x1d')];var _0x3f4f97=_0xa40d6a?0x0:_0x179dfd[_0xd0cf('0x1e')];var _0x289c4e=_0xa40d6a?_0x3469c5[_0xd0cf('0x1d')]:_0x179dfd['offset']+_0x179dfd[_0xd0cf('0x1c')];var _0x24db39;if(_0x289c4e>=_0x553d60){_0x289c4e=_0x553d60;_0x24db39=0xc8;}else{_0x24db39=0xce;}_0x2432a6['status'](_0x24db39);return _0x2432a6['set']('Content-Range',_0x3f4f97+'-'+_0x289c4e+'/'+_0x553d60)[_0xd0cf('0x1a')](_0x3469c5);}return null;};}function patchUpdates(_0x2c7609){return function(_0x840fc6){try{jsonpatch[_0xd0cf('0x1f')](_0x840fc6,_0x2c7609,!![]);}catch(_0x6b4291){return BPromise['reject'](_0x6b4291);}return _0x840fc6[_0xd0cf('0x20')]();};}function saveUpdates(_0x3f6bbd,_0x3d3925){return function(_0x2a0c54){if(_0x2a0c54){return _0x2a0c54[_0xd0cf('0x21')](_0x3f6bbd)[_0xd0cf('0x22')](function(_0x45c8ef){return _0x45c8ef;});}return null;};}function removeEntity(_0x3be688,_0x4dda1a){return function(_0x2a5e5d){if(_0x2a5e5d){return _0x2a5e5d[_0xd0cf('0x23')]()[_0xd0cf('0x22')](function(){_0x3be688[_0xd0cf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cb97c,_0x5829f0){return function(_0xea9758){if(!_0xea9758){_0x2cb97c[_0xd0cf('0x17')](0x194);}return _0xea9758;};}function handleError(_0xbef5b7,_0x52adc0){_0x52adc0=_0x52adc0||0x1f4;return function(_0x216c26){logger['error'](_0x216c26['stack']);if(_0x216c26[_0xd0cf('0x24')]){delete _0x216c26[_0xd0cf('0x24')];}_0xbef5b7[_0xd0cf('0x18')](_0x52adc0)[_0xd0cf('0x25')](_0x216c26);};}exports[_0xd0cf('0x26')]=function(_0x51fb76,_0x3e7dd4){var _0x39f2f6={},_0xfcdf7a={},_0x1eccb3={'count':0x0,'rows':[]};var _0x4653fc=_['map'](db[_0xd0cf('0x27')][_0xd0cf('0x28')],function(_0x590883){return{'name':_0x590883[_0xd0cf('0x29')],'type':_0x590883[_0xd0cf('0x2a')][_0xd0cf('0x2b')]};});_0xfcdf7a['model']=_['map'](_0x4653fc,_0xd0cf('0x24'));_0xfcdf7a[_0xd0cf('0x2c')]=_[_0xd0cf('0x2d')](_0x51fb76[_0xd0cf('0x2c')]);_0xfcdf7a['filters']=_[_0xd0cf('0x2e')](_0xfcdf7a[_0xd0cf('0x2f')],_0xfcdf7a[_0xd0cf('0x2c')]);_0x39f2f6[_0xd0cf('0x30')]=_[_0xd0cf('0x2e')](_0xfcdf7a[_0xd0cf('0x2f')],qs[_0xd0cf('0x31')](_0x51fb76[_0xd0cf('0x2c')]['fields']));_0x39f2f6['attributes']=_0x39f2f6[_0xd0cf('0x30')]['length']?_0x39f2f6[_0xd0cf('0x30')]:_0xfcdf7a[_0xd0cf('0x2f')];if(!_0x51fb76[_0xd0cf('0x2c')][_0xd0cf('0x32')](_0xd0cf('0x33'))){_0x39f2f6[_0xd0cf('0x1c')]=qs[_0xd0cf('0x1c')](_0x51fb76[_0xd0cf('0x2c')][_0xd0cf('0x1c')]);_0x39f2f6[_0xd0cf('0x1e')]=qs[_0xd0cf('0x1e')](_0x51fb76[_0xd0cf('0x2c')][_0xd0cf('0x1e')]);}_0x39f2f6[_0xd0cf('0x34')]=qs['sort'](_0x51fb76['query']['sort']);_0x39f2f6[_0xd0cf('0x35')]=qs[_0xd0cf('0x36')](_['pick'](_0x51fb76[_0xd0cf('0x2c')],_0xfcdf7a[_0xd0cf('0x36')]),_0x4653fc);if(_0x51fb76[_0xd0cf('0x2c')][_0xd0cf('0x37')]){_0x39f2f6[_0xd0cf('0x35')]=_[_0xd0cf('0x38')](_0x39f2f6[_0xd0cf('0x35')],{'$or':_[_0xd0cf('0x39')](_0x4653fc,function(_0xbc99f7){if(_0xbc99f7[_0xd0cf('0x2a')]!=='VIRTUAL'){var _0x407d8d={};_0x407d8d[_0xbc99f7['name']]={'$like':'%'+_0x51fb76[_0xd0cf('0x2c')][_0xd0cf('0x37')]+'%'};return _0x407d8d;}})});}_0x39f2f6=_[_0xd0cf('0x38')]({},_0x39f2f6,_0x51fb76[_0xd0cf('0x3a')]);var _0x46dc76={'where':_0x39f2f6[_0xd0cf('0x35')]};return db[_0xd0cf('0x27')]['count'](_0x46dc76)[_0xd0cf('0x22')](function(_0x1b150b){_0x1eccb3[_0xd0cf('0x1d')]=_0x1b150b;if(_0x51fb76[_0xd0cf('0x2c')][_0xd0cf('0x3b')]){_0x39f2f6[_0xd0cf('0x3c')]=[{'all':!![]}];}return db[_0xd0cf('0x27')]['findAll'](_0x39f2f6);})[_0xd0cf('0x22')](function(_0xe3f30){_0x1eccb3[_0xd0cf('0x3d')]=_0xe3f30;return _0x1eccb3;})['then'](respondWithFilteredResult(_0x3e7dd4,_0x39f2f6))[_0xd0cf('0x3e')](handleError(_0x3e7dd4,null));};exports[_0xd0cf('0x3f')]=function(_0x4e62df,_0x396752){var _0x3d017d={'raw':!![],'where':{'id':_0x4e62df[_0xd0cf('0x40')]['id']}},_0x25576d={};_0x25576d[_0xd0cf('0x2f')]=_['keys'](db[_0xd0cf('0x27')][_0xd0cf('0x28')]);_0x25576d['query']=_['keys'](_0x4e62df[_0xd0cf('0x2c')]);_0x25576d[_0xd0cf('0x36')]=_[_0xd0cf('0x2e')](_0x25576d['model'],_0x25576d[_0xd0cf('0x2c')]);_0x3d017d[_0xd0cf('0x30')]=_[_0xd0cf('0x2e')](_0x25576d['model'],qs[_0xd0cf('0x31')](_0x4e62df[_0xd0cf('0x2c')][_0xd0cf('0x31')]));_0x3d017d[_0xd0cf('0x30')]=_0x3d017d['attributes'][_0xd0cf('0x41')]?_0x3d017d[_0xd0cf('0x30')]:_0x25576d[_0xd0cf('0x2f')];if(_0x4e62df[_0xd0cf('0x2c')][_0xd0cf('0x3b')]){_0x3d017d[_0xd0cf('0x3c')]=[{'all':!![]}];}_0x3d017d=_[_0xd0cf('0x38')]({},_0x3d017d,_0x4e62df['options']);return db[_0xd0cf('0x27')]['find'](_0x3d017d)[_0xd0cf('0x22')](handleEntityNotFound(_0x396752,null))['then'](respondWithResult(_0x396752,null))[_0xd0cf('0x3e')](handleError(_0x396752,null));};exports[_0xd0cf('0x42')]=function(_0x94b367,_0x5212cc){return db[_0xd0cf('0x27')]['create'](_0x94b367[_0xd0cf('0x43')],{})[_0xd0cf('0x22')](respondWithResult(_0x5212cc,0xc9))[_0xd0cf('0x3e')](handleError(_0x5212cc,null));};exports[_0xd0cf('0x44')]=function(_0x34d4cf,_0x1a1044){return db[_0xd0cf('0x27')][_0xd0cf('0x44')]()[_0xd0cf('0x22')](respondWithResult(_0x1a1044,null))[_0xd0cf('0x3e')](handleError(_0x1a1044,null));};exports[_0xd0cf('0x21')]=function(_0x3ce840,_0x182848){if(_0x3ce840[_0xd0cf('0x43')][_0xd0cf('0x45')]){delete _0x3ce840['body'][_0xd0cf('0x45')];}return db[_0xd0cf('0x27')][_0xd0cf('0x46')]({'where':{'uniqueid':_0x3ce840[_0xd0cf('0x40')]['id']}})[_0xd0cf('0x22')](handleEntityNotFound(_0x182848,null))['then'](saveUpdates(_0x3ce840[_0xd0cf('0x43')],null))[_0xd0cf('0x22')](respondWithResult(_0x182848,null))['catch'](handleError(_0x182848,null));};
\ No newline at end of file
+var _0x6e79=['key','model','map','name','query','keys','intersection','fields','attributes','length','order','sort','filters','pick','filter','merge','where','options','CmHopperHistory','includeAll','include','findAll','rows','params','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','error','stack','send','rawAttributes','fieldName','type'];(function(_0x1792a9,_0x112b0d){var _0x392586=function(_0x486cf4){while(--_0x486cf4){_0x1792a9['push'](_0x1792a9['shift']());}};_0x392586(++_0x112b0d);}(_0x6e79,0x6a));var _0x96e7=function(_0x1d2c0c,_0x40dc5a){_0x1d2c0c=_0x1d2c0c-0x0;var _0x423cef=_0x6e79[_0x1d2c0c];return _0x423cef;};'use strict';var emlformat=require(_0x96e7('0x0'));var rimraf=require(_0x96e7('0x1'));var zipdir=require(_0x96e7('0x2'));var jsonpatch=require(_0x96e7('0x3'));var rp=require(_0x96e7('0x4'));var moment=require(_0x96e7('0x5'));var BPromise=require(_0x96e7('0x6'));var Mustache=require(_0x96e7('0x7'));var util=require('util');var path=require(_0x96e7('0x8'));var sox=require(_0x96e7('0x9'));var csv=require(_0x96e7('0xa'));var ejs=require(_0x96e7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96e7('0xc'));var squel=require(_0x96e7('0xd'));var crypto=require(_0x96e7('0xe'));var jsforce=require(_0x96e7('0xf'));var deskjs=require(_0x96e7('0x10'));var toCsv=require(_0x96e7('0xa'));var querystring=require('querystring');var Papa=require(_0x96e7('0x11'));var Redis=require(_0x96e7('0x12'));var authService=require(_0x96e7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x96e7('0x14'));var hardwareService=require(_0x96e7('0x15'));var logger=require(_0x96e7('0x16'))(_0x96e7('0x17'));var utils=require('../../config/utils');var config=require(_0x96e7('0x18'));var licenseUtil=require(_0x96e7('0x19'));var db=require(_0x96e7('0x1a'))['db'];function respondWithStatusCode(_0x2bf090,_0x5b03f3){_0x5b03f3=_0x5b03f3||0xcc;return function(_0xbb742e){if(_0xbb742e){return _0x2bf090['sendStatus'](_0x5b03f3);}return _0x2bf090[_0x96e7('0x1b')](_0x5b03f3)[_0x96e7('0x1c')]();};}function respondWithResult(_0x42e274,_0x2360c5){_0x2360c5=_0x2360c5||0xc8;return function(_0x2528eb){if(_0x2528eb){return _0x42e274[_0x96e7('0x1b')](_0x2360c5)[_0x96e7('0x1d')](_0x2528eb);}};}function respondWithFilteredResult(_0x5df744,_0x12da42){return function(_0x5edeba){if(_0x5edeba){var _0xc21b6e=typeof _0x12da42['offset']===_0x96e7('0x1e')&&typeof _0x12da42['limit']===_0x96e7('0x1e');var _0x573555=_0x5edeba[_0x96e7('0x1f')];var _0x1dd571=_0xc21b6e?0x0:_0x12da42[_0x96e7('0x20')];var _0x3de32f=_0xc21b6e?_0x5edeba['count']:_0x12da42[_0x96e7('0x20')]+_0x12da42[_0x96e7('0x21')];var _0x3329d1;if(_0x3de32f>=_0x573555){_0x3de32f=_0x573555;_0x3329d1=0xc8;}else{_0x3329d1=0xce;}_0x5df744['status'](_0x3329d1);return _0x5df744[_0x96e7('0x22')]('Content-Range',_0x1dd571+'-'+_0x3de32f+'/'+_0x573555)[_0x96e7('0x1d')](_0x5edeba);}return null;};}function patchUpdates(_0x34ac33){return function(_0x4b3ac7){try{jsonpatch[_0x96e7('0x23')](_0x4b3ac7,_0x34ac33,!![]);}catch(_0x56fc24){return BPromise[_0x96e7('0x24')](_0x56fc24);}return _0x4b3ac7[_0x96e7('0x25')]();};}function saveUpdates(_0x38d12f,_0xff8342){return function(_0xb3495){if(_0xb3495){return _0xb3495[_0x96e7('0x26')](_0x38d12f)[_0x96e7('0x27')](function(_0x411761){return _0x411761;});}return null;};}function removeEntity(_0x2f6a39,_0x14eaf4){return function(_0x30d4a0){if(_0x30d4a0){return _0x30d4a0['destroy']()[_0x96e7('0x27')](function(){_0x2f6a39['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x487b8f,_0x5c4e42){return function(_0x4f536f){if(!_0x4f536f){_0x487b8f['sendStatus'](0x194);}return _0x4f536f;};}function handleError(_0x5265f1,_0x232728){_0x232728=_0x232728||0x1f4;return function(_0x4f1b4f){logger[_0x96e7('0x28')](_0x4f1b4f[_0x96e7('0x29')]);if(_0x4f1b4f['name']){delete _0x4f1b4f['name'];}_0x5265f1[_0x96e7('0x1b')](_0x232728)[_0x96e7('0x2a')](_0x4f1b4f);};}exports['index']=function(_0x11e5a7,_0x582760){var _0x272503={},_0x319f0c={},_0x59519e={'count':0x0,'rows':[]};var _0xe9e8a5=_['map'](db['CmHopperHistory'][_0x96e7('0x2b')],function(_0xa44597){return{'name':_0xa44597[_0x96e7('0x2c')],'type':_0xa44597[_0x96e7('0x2d')][_0x96e7('0x2e')]};});_0x319f0c[_0x96e7('0x2f')]=_[_0x96e7('0x30')](_0xe9e8a5,_0x96e7('0x31'));_0x319f0c[_0x96e7('0x32')]=_[_0x96e7('0x33')](_0x11e5a7[_0x96e7('0x32')]);_0x319f0c['filters']=_['intersection'](_0x319f0c[_0x96e7('0x2f')],_0x319f0c[_0x96e7('0x32')]);_0x272503['attributes']=_[_0x96e7('0x34')](_0x319f0c[_0x96e7('0x2f')],qs[_0x96e7('0x35')](_0x11e5a7[_0x96e7('0x32')][_0x96e7('0x35')]));_0x272503[_0x96e7('0x36')]=_0x272503[_0x96e7('0x36')][_0x96e7('0x37')]?_0x272503[_0x96e7('0x36')]:_0x319f0c[_0x96e7('0x2f')];if(!_0x11e5a7[_0x96e7('0x32')]['hasOwnProperty']('nolimit')){_0x272503[_0x96e7('0x21')]=qs[_0x96e7('0x21')](_0x11e5a7[_0x96e7('0x32')][_0x96e7('0x21')]);_0x272503[_0x96e7('0x20')]=qs[_0x96e7('0x20')](_0x11e5a7[_0x96e7('0x32')][_0x96e7('0x20')]);}_0x272503[_0x96e7('0x38')]=qs[_0x96e7('0x39')](_0x11e5a7[_0x96e7('0x32')][_0x96e7('0x39')]);_0x272503['where']=qs[_0x96e7('0x3a')](_[_0x96e7('0x3b')](_0x11e5a7[_0x96e7('0x32')],_0x319f0c[_0x96e7('0x3a')]),_0xe9e8a5);if(_0x11e5a7[_0x96e7('0x32')][_0x96e7('0x3c')]){_0x272503['where']=_[_0x96e7('0x3d')](_0x272503[_0x96e7('0x3e')],{'$or':_['map'](_0xe9e8a5,function(_0x3eb28c){if(_0x3eb28c['type']!=='VIRTUAL'){var _0x1cbbd7={};_0x1cbbd7[_0x3eb28c[_0x96e7('0x31')]]={'$like':'%'+_0x11e5a7[_0x96e7('0x32')][_0x96e7('0x3c')]+'%'};return _0x1cbbd7;}})});}_0x272503=_[_0x96e7('0x3d')]({},_0x272503,_0x11e5a7[_0x96e7('0x3f')]);var _0xcbb44b={'where':_0x272503[_0x96e7('0x3e')]};return db[_0x96e7('0x40')]['count'](_0xcbb44b)[_0x96e7('0x27')](function(_0x3d753f){_0x59519e['count']=_0x3d753f;if(_0x11e5a7['query'][_0x96e7('0x41')]){_0x272503[_0x96e7('0x42')]=[{'all':!![]}];}return db[_0x96e7('0x40')][_0x96e7('0x43')](_0x272503);})[_0x96e7('0x27')](function(_0x3060f3){_0x59519e[_0x96e7('0x44')]=_0x3060f3;return _0x59519e;})[_0x96e7('0x27')](respondWithFilteredResult(_0x582760,_0x272503))['catch'](handleError(_0x582760,null));};exports['show']=function(_0x4fb1f9,_0x30a702){var _0x2546c0={'raw':!![],'where':{'id':_0x4fb1f9[_0x96e7('0x45')]['id']}},_0x25285b={};_0x25285b[_0x96e7('0x2f')]=_[_0x96e7('0x33')](db[_0x96e7('0x40')][_0x96e7('0x2b')]);_0x25285b[_0x96e7('0x32')]=_[_0x96e7('0x33')](_0x4fb1f9['query']);_0x25285b['filters']=_[_0x96e7('0x34')](_0x25285b[_0x96e7('0x2f')],_0x25285b['query']);_0x2546c0[_0x96e7('0x36')]=_[_0x96e7('0x34')](_0x25285b[_0x96e7('0x2f')],qs[_0x96e7('0x35')](_0x4fb1f9[_0x96e7('0x32')][_0x96e7('0x35')]));_0x2546c0['attributes']=_0x2546c0['attributes'][_0x96e7('0x37')]?_0x2546c0['attributes']:_0x25285b[_0x96e7('0x2f')];if(_0x4fb1f9['query'][_0x96e7('0x41')]){_0x2546c0[_0x96e7('0x42')]=[{'all':!![]}];}_0x2546c0=_[_0x96e7('0x3d')]({},_0x2546c0,_0x4fb1f9[_0x96e7('0x3f')]);return db[_0x96e7('0x40')][_0x96e7('0x46')](_0x2546c0)[_0x96e7('0x27')](handleEntityNotFound(_0x30a702,null))[_0x96e7('0x27')](respondWithResult(_0x30a702,null))[_0x96e7('0x47')](handleError(_0x30a702,null));};exports[_0x96e7('0x48')]=function(_0x2d457d,_0x4ad779){return db[_0x96e7('0x40')][_0x96e7('0x48')](_0x2d457d[_0x96e7('0x49')],{})[_0x96e7('0x27')](respondWithResult(_0x4ad779,0xc9))['catch'](handleError(_0x4ad779,null));};exports[_0x96e7('0x4a')]=function(_0x2b70bc,_0x251560){return db[_0x96e7('0x40')][_0x96e7('0x4a')]()[_0x96e7('0x27')](respondWithResult(_0x251560,null))['catch'](handleError(_0x251560,null));};exports[_0x96e7('0x26')]=function(_0x47e9e6,_0x404847){if(_0x47e9e6['body'][_0x96e7('0x4b')]){delete _0x47e9e6[_0x96e7('0x49')][_0x96e7('0x4b')];}return db[_0x96e7('0x40')][_0x96e7('0x46')]({'where':{'uniqueid':_0x47e9e6[_0x96e7('0x45')]['id']}})[_0x96e7('0x27')](handleEntityNotFound(_0x404847,null))['then'](saveUpdates(_0x47e9e6['body'],null))[_0x96e7('0x27')](respondWithResult(_0x404847,null))[_0x96e7('0x47')](handleError(_0x404847,null));};
\ No newline at end of file
index 8095a86..7a329f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3e2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0xf3e2,0x168));var _0x2f3e=function(_0x15a600,_0x292ff5){_0x15a600=_0x15a600-0x0;var _0x13df75=_0xf3e2[_0x15a600];return _0x13df75;};'use strict';var _=require(_0x2f3e('0x0'));var util=require(_0x2f3e('0x1'));var logger=require(_0x2f3e('0x2'))(_0x2f3e('0x3'));var moment=require(_0x2f3e('0x4'));var BPromise=require(_0x2f3e('0x5'));var rp=require(_0x2f3e('0x6'));var fs=require('fs');var path=require(_0x2f3e('0x7'));var rimraf=require('rimraf');var config=require(_0x2f3e('0x8'));var attributes=require('./cmHopperHistory.attributes');module[_0x2f3e('0x9')]=function(_0xd3f5b,_0x3a0b5a){return _0xd3f5b[_0x2f3e('0xa')](_0x2f3e('0xb'),attributes,{'tableName':_0x2f3e('0xc'),'paranoid':![],'indexes':[{'name':_0x2f3e('0xd'),'fields':[_0x2f3e('0xd')]},{'name':'uniqueid','fields':[_0x2f3e('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x87f1=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x87f1,0x170));var _0x187f=function(_0x815de6,_0x2772bc){_0x815de6=_0x815de6-0x0;var _0x5251d5=_0x87f1[_0x815de6];return _0x5251d5;};'use strict';var _=require('lodash');var util=require(_0x187f('0x0'));var logger=require(_0x187f('0x1'))(_0x187f('0x2'));var moment=require(_0x187f('0x3'));var BPromise=require(_0x187f('0x4'));var rp=require(_0x187f('0x5'));var fs=require('fs');var path=require(_0x187f('0x6'));var rimraf=require('rimraf');var config=require(_0x187f('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x187f('0x8')]=function(_0x591147,_0x1115d1){return _0x591147['define'](_0x187f('0x9'),attributes,{'tableName':_0x187f('0xa'),'paranoid':![],'indexes':[{'name':_0x187f('0xb'),'fields':[_0x187f('0xb')]},{'name':_0x187f('0xc'),'fields':[_0x187f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 4163db9..473f868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb95d=['code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','then','AvgHandleTime','where','sequelize','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','debug','request\x20sent','stringify','error'];(function(_0x357669,_0x5929e3){var _0x33fbcd=function(_0x34c95c){while(--_0x34c95c){_0x357669['push'](_0x357669['shift']());}};_0x33fbcd(++_0x5929e3);}(_0xb95d,0x1c5));var _0xdb95=function(_0x3311a1,_0xb1b4a2){_0x3311a1=_0x3311a1-0x0;var _0x2f3041=_0xb95d[_0x3311a1];return _0x2f3041;};'use strict';var _=require(_0xdb95('0x0'));var util=require('util');var moment=require(_0xdb95('0x1'));var BPromise=require(_0xdb95('0x2'));var rs=require(_0xdb95('0x3'));var fs=require('fs');var Redis=require(_0xdb95('0x4'));var db=require(_0xdb95('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb95('0x6'))(_0xdb95('0x7'));var config=require(_0xdb95('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdb95('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52f892,_0x526075,_0x43df2c){return new BPromise(function(_0x41a17b,_0x2e0fbd){return client[_0xdb95('0xa')](_0x52f892,_0x43df2c)['then'](function(_0x255352){logger[_0xdb95('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x526075,'request\x20sent');logger[_0xdb95('0xc')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x526075,_0xdb95('0xd'),JSON[_0xdb95('0xe')](_0x255352));if(_0x255352[_0xdb95('0xf')]){if(_0x255352[_0xdb95('0xf')][_0xdb95('0x10')]===0x1f4){logger[_0xdb95('0xf')](_0xdb95('0x11'),_0x526075,_0x255352[_0xdb95('0xf')][_0xdb95('0x12')]);return _0x2e0fbd(_0x255352['error']['message']);}logger[_0xdb95('0xf')](_0xdb95('0x11'),_0x526075,_0x255352['error'][_0xdb95('0x12')]);return _0x41a17b(_0x255352[_0xdb95('0xf')][_0xdb95('0x12')]);}else{logger['info'](_0xdb95('0x11'),_0x526075,_0xdb95('0xd'));_0x41a17b(_0x255352[_0xdb95('0x13')][_0xdb95('0x12')]);}})[_0xdb95('0x14')](function(_0x2ea38f){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x526075,_0x2ea38f);_0x2e0fbd(_0x2ea38f);});});}exports[_0xdb95('0x15')]=function(_0x1ac252){var _0x1416ab=this;return new Promise(function(_0xa8d1ac,_0x4f397c){return db[_0xdb95('0x16')][_0xdb95('0x17')](_0x1ac252['body'],{'raw':_0x1ac252[_0xdb95('0x18')]?_0x1ac252['options'][_0xdb95('0x19')]===undefined?!![]:![]:!![]})[_0xdb95('0x1a')](function(_0x5d703b){logger[_0xdb95('0xb')](_0xdb95('0x15'),_0x1ac252);logger[_0xdb95('0xc')](_0xdb95('0x15'),_0x1ac252,JSON[_0xdb95('0xe')](_0x5d703b));_0xa8d1ac(_0x5d703b);})[_0xdb95('0x14')](function(_0x3dda15){logger[_0xdb95('0xf')](_0xdb95('0x15'),_0x3dda15[_0xdb95('0x12')],_0x1ac252);_0x4f397c(_0x1416ab[_0xdb95('0xf')](0x1f4,_0x3dda15[_0xdb95('0x12')]));});});};exports[_0xdb95('0x1b')]=function(_0xba9d34){var _0x18d0b1=this;return new Promise(function(_0x1f3854,_0x3f7170){return db[_0xdb95('0x16')]['findAll']({'raw':_0xba9d34[_0xdb95('0x18')]?_0xba9d34[_0xdb95('0x18')][_0xdb95('0x19')]===undefined?!![]:![]:!![],'where':_0xba9d34[_0xdb95('0x18')]?_0xba9d34[_0xdb95('0x18')][_0xdb95('0x1c')]||null:null,'attributes':[[db[_0xdb95('0x1d')]['fn']('COUNT',db[_0xdb95('0x1d')]['col']('id')),_0xdb95('0x1e')],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')](_0xdb95('0x21')))),'predictiveIntervalAnsweredCalls'],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),_0xdb95('0x22')],[db[_0xdb95('0x1d')]['fn']('COUNT',db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),_0xdb95('0x23')],[db['sequelize']['fn'](_0xdb95('0x24'),db[_0xdb95('0x1d')]['fn']('IF',db['sequelize'][_0xdb95('0x20')](_0xdb95('0x25')))),'predictiveIntervalAvgHoldtime'],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x24'),db['sequelize']['fn']('IF',db[_0xdb95('0x1d')]['literal'](_0xdb95('0x26')))),_0xdb95('0x27')]]})['then'](function(_0x37f08f){logger[_0xdb95('0xb')](_0xdb95('0x1b'),_0xba9d34);logger[_0xdb95('0xc')](_0xdb95('0x1b'),_0xba9d34,JSON[_0xdb95('0xe')](_0x37f08f));_0x1f3854(_0x37f08f);})[_0xdb95('0x14')](function(_0x49df38){logger[_0xdb95('0xf')]('AvgHandleTime',_0x49df38[_0xdb95('0x12')],_0xba9d34);_0x3f7170(_0x18d0b1[_0xdb95('0xf')](0x1f4,_0x49df38[_0xdb95('0x12')]));});});};exports[_0xdb95('0x28')]=function(_0x48a9ee){var _0x41f978=this;return new Promise(function(_0x582834,_0x4f33d5){return db['CmHopperHistory'][_0xdb95('0x29')]({'raw':_0x48a9ee[_0xdb95('0x18')]?_0x48a9ee[_0xdb95('0x18')][_0xdb95('0x19')]===undefined?!![]:![]:!![],'where':_0x48a9ee[_0xdb95('0x18')]?_0x48a9ee['options'][_0xdb95('0x1c')]||null:null,'attributes':[[_0xdb95('0x2a'),_0xdb95('0x2b')],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')](_0xdb95('0x2c')))),'outboundNoSuchCallsDay'],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xdb95('0x2d')))),'outboundNoAnswerCallsDay'],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')](_0xdb95('0x21')))),'outboundAnswerCallsDay'],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')]['literal'](_0xdb95('0x2e')))),_0xdb95('0x2f')],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db['sequelize']['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')](_0xdb95('0x30')))),_0xdb95('0x31')],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')](_0xdb95('0x32')))),_0xdb95('0x33')],[db[_0xdb95('0x1d')]['fn']('COUNT',db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')]['literal'](_0xdb95('0x34')))),_0xdb95('0x35')],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')](_0xdb95('0x36')))),_0xdb95('0x37')],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xdb95('0x38')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0xdb95('0x1d')]['fn']('COUNT',db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')](_0xdb95('0x39')))),_0xdb95('0x3a')],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')](_0xdb95('0x3b')))),'outboundAnswerAgiCallsDay'],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')][_0xdb95('0x20')](_0xdb95('0x3c')))),'outboundRejectCallsDay'],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')]['fn']('IF',db[_0xdb95('0x1d')]['literal'](_0xdb95('0x3d')))),_0xdb95('0x3e')]],'group':['campaign']})[_0xdb95('0x1a')](function(_0x1f9452){logger['info'](_0xdb95('0x28'),_0x48a9ee);logger['debug'](_0xdb95('0x28'),_0x48a9ee,JSON[_0xdb95('0xe')](_0x1f9452));_0x582834(_0x1f9452);})[_0xdb95('0x14')](function(_0x2206dd){logger[_0xdb95('0xf')](_0xdb95('0x28'),_0x2206dd[_0xdb95('0x12')],_0x48a9ee);_0x4f33d5(_0x41f978[_0xdb95('0xf')](0x1f4,_0x2206dd[_0xdb95('0x12')]));});});};exports[_0xdb95('0x3f')]=function(_0xe2bae){var _0x5a5365=this;return new Promise(function(_0x404293,_0x5f4496){return db[_0xdb95('0x16')]['findAll']({'raw':_0xe2bae[_0xdb95('0x18')]?_0xe2bae['options']['raw']===undefined?!![]:![]:!![],'where':_0xe2bae[_0xdb95('0x18')]?_0xe2bae['options'][_0xdb95('0x1c')]||null:null,'attributes':[['campaign',_0xdb95('0x2b')],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db[_0xdb95('0x1d')][_0xdb95('0x40')]('id')),_0xdb95('0x41')],[db[_0xdb95('0x1d')]['fn'](_0xdb95('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xdb95('0x21')))),_0xdb95('0x42')]],'group':[_0xdb95('0x2a')]})[_0xdb95('0x1a')](function(_0xdad321){logger[_0xdb95('0xb')](_0xdb95('0x3f'),_0xe2bae);logger[_0xdb95('0xc')](_0xdb95('0x3f'),_0xe2bae,JSON[_0xdb95('0xe')](_0xdad321));_0x404293(_0xdad321);})[_0xdb95('0x14')](function(_0x51e831){logger[_0xdb95('0xf')](_0xdb95('0x3f'),_0x51e831[_0xdb95('0x12')],_0xe2bae);_0x5f4496(_0x5a5365[_0xdb95('0xf')](0x1f4,_0x51e831[_0xdb95('0x12')]));});});};
\ No newline at end of file
+var _0x2b52=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','campaign','GetVoiceQueueHopperHistory','name','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','stringify','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null'];(function(_0x42e462,_0x316aff){var _0x19f62b=function(_0x1a07cc){while(--_0x1a07cc){_0x42e462['push'](_0x42e462['shift']());}};_0x19f62b(++_0x316aff);}(_0x2b52,0x12a));var _0x22b5=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x2b52[_0x23c73d];return _0x36ba47;};'use strict';var _=require(_0x22b5('0x0'));var util=require(_0x22b5('0x1'));var moment=require('moment');var BPromise=require(_0x22b5('0x2'));var rs=require(_0x22b5('0x3'));var fs=require('fs');var Redis=require(_0x22b5('0x4'));var db=require(_0x22b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x22b5('0x6'));var config=require(_0x22b5('0x7'));var jayson=require(_0x22b5('0x8'));var client=jayson[_0x22b5('0x9')][_0x22b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d4087,_0x51a96c,_0x41976f){return new BPromise(function(_0x53b1cc,_0x4e0efa){return client['request'](_0x2d4087,_0x41976f)[_0x22b5('0xb')](function(_0xa9a8b9){logger[_0x22b5('0xc')](_0x22b5('0xd'),_0x51a96c,_0x22b5('0xe'));logger[_0x22b5('0xf')](_0x22b5('0x10'),_0x51a96c,_0x22b5('0xe'),JSON['stringify'](_0xa9a8b9));if(_0xa9a8b9[_0x22b5('0x11')]){if(_0xa9a8b9[_0x22b5('0x11')][_0x22b5('0x12')]===0x1f4){logger[_0x22b5('0x11')](_0x22b5('0xd'),_0x51a96c,_0xa9a8b9[_0x22b5('0x11')][_0x22b5('0x13')]);return _0x4e0efa(_0xa9a8b9[_0x22b5('0x11')]['message']);}logger[_0x22b5('0x11')](_0x22b5('0xd'),_0x51a96c,_0xa9a8b9[_0x22b5('0x11')][_0x22b5('0x13')]);return _0x53b1cc(_0xa9a8b9[_0x22b5('0x11')][_0x22b5('0x13')]);}else{logger['info'](_0x22b5('0xd'),_0x51a96c,_0x22b5('0xe'));_0x53b1cc(_0xa9a8b9[_0x22b5('0x14')][_0x22b5('0x13')]);}})[_0x22b5('0x15')](function(_0xec0c63){logger[_0x22b5('0x11')](_0x22b5('0xd'),_0x51a96c,_0xec0c63);_0x4e0efa(_0xec0c63);});});}exports[_0x22b5('0x16')]=function(_0x1f41b9){var _0x439b87=this;return new Promise(function(_0x4e6da4,_0x413611){return db[_0x22b5('0x17')][_0x22b5('0x18')](_0x1f41b9[_0x22b5('0x19')],{'raw':_0x1f41b9[_0x22b5('0x1a')]?_0x1f41b9['options'][_0x22b5('0x1b')]===undefined?!![]:![]:!![]})[_0x22b5('0xb')](function(_0x3a3537){logger['info'](_0x22b5('0x16'),_0x1f41b9);logger[_0x22b5('0xf')](_0x22b5('0x16'),_0x1f41b9,JSON[_0x22b5('0x1c')](_0x3a3537));_0x4e6da4(_0x3a3537);})['catch'](function(_0x3b0c31){logger[_0x22b5('0x11')](_0x22b5('0x16'),_0x3b0c31[_0x22b5('0x13')],_0x1f41b9);_0x413611(_0x439b87[_0x22b5('0x11')](0x1f4,_0x3b0c31[_0x22b5('0x13')]));});});};exports[_0x22b5('0x1d')]=function(_0x3ccdbd){var _0x280f93=this;return new Promise(function(_0x4d10fe,_0x47d3c5){return db[_0x22b5('0x17')][_0x22b5('0x1e')]({'raw':_0x3ccdbd[_0x22b5('0x1a')]?_0x3ccdbd[_0x22b5('0x1a')][_0x22b5('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ccdbd[_0x22b5('0x1a')]?_0x3ccdbd[_0x22b5('0x1a')][_0x22b5('0x1f')]||null:null,'attributes':[[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')][_0x22b5('0x22')]('id')),_0x22b5('0x23')],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x22b5('0x24')](_0x22b5('0x25')))),_0x22b5('0x26')],[db[_0x22b5('0x20')]['fn']('COUNT',db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x22b5('0x20')]['fn']('COUNT',db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x28')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x29'),db[_0x22b5('0x20')]['fn']('IF',db['sequelize'][_0x22b5('0x24')](_0x22b5('0x2a')))),_0x22b5('0x2b')],[db[_0x22b5('0x20')]['fn']('AVG',db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x2c')))),_0x22b5('0x2d')]]})[_0x22b5('0xb')](function(_0x507798){logger[_0x22b5('0xc')](_0x22b5('0x1d'),_0x3ccdbd);logger[_0x22b5('0xf')](_0x22b5('0x1d'),_0x3ccdbd,JSON[_0x22b5('0x1c')](_0x507798));_0x4d10fe(_0x507798);})['catch'](function(_0x16ba7b){logger['error'](_0x22b5('0x1d'),_0x16ba7b[_0x22b5('0x13')],_0x3ccdbd);_0x47d3c5(_0x280f93[_0x22b5('0x11')](0x1f4,_0x16ba7b[_0x22b5('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x59c00d){var _0x2aca3e=this;return new Promise(function(_0x2c905e,_0x3b8899){return db[_0x22b5('0x17')][_0x22b5('0x1e')]({'raw':_0x59c00d[_0x22b5('0x1a')]?_0x59c00d[_0x22b5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x59c00d[_0x22b5('0x1a')]?_0x59c00d['options']['where']||null:null,'attributes':[['campaign','name'],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')]['literal'](_0x22b5('0x2e')))),'outboundNoSuchCallsDay'],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x2f')))),_0x22b5('0x30')],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x25')))),_0x22b5('0x31')],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db['sequelize'][_0x22b5('0x24')]('`state`\x20=\x205,\x201,\x20null'))),_0x22b5('0x32')],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db['sequelize']['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x33')))),_0x22b5('0x34')],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x35')))),_0x22b5('0x36')],[db['sequelize']['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0x22b5('0x20')]['fn']('COUNT',db[_0x22b5('0x20')]['fn']('IF',db['sequelize'][_0x22b5('0x24')](_0x22b5('0x38')))),'outboundUnknownCallsDay'],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x39')))),_0x22b5('0x3a')],[db['sequelize']['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x3b')))),'outboundOriginateFailureCallsDay'],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x3c')))),_0x22b5('0x3d')],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db['sequelize'][_0x22b5('0x24')](_0x22b5('0x3e')))),_0x22b5('0x3f')],[db[_0x22b5('0x20')]['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x40')))),_0x22b5('0x3d')],[db[_0x22b5('0x20')]['fn']('COUNT',db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x22b5('0x41')]})[_0x22b5('0xb')](function(_0x3e5548){logger[_0x22b5('0xc')]('GetVoiceQueueHopperHistory',_0x59c00d);logger[_0x22b5('0xf')]('GetVoiceQueueHopperHistory',_0x59c00d,JSON['stringify'](_0x3e5548));_0x2c905e(_0x3e5548);})[_0x22b5('0x15')](function(_0x4d4cff){logger[_0x22b5('0x11')](_0x22b5('0x42'),_0x4d4cff[_0x22b5('0x13')],_0x59c00d);_0x3b8899(_0x2aca3e[_0x22b5('0x11')](0x1f4,_0x4d4cff[_0x22b5('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x144d4c){var _0x4aa074=this;return new Promise(function(_0xd191ae,_0x3cca57){return db['CmHopperHistory'][_0x22b5('0x1e')]({'raw':_0x144d4c['options']?_0x144d4c[_0x22b5('0x1a')][_0x22b5('0x1b')]===undefined?!![]:![]:!![],'where':_0x144d4c['options']?_0x144d4c[_0x22b5('0x1a')][_0x22b5('0x1f')]||null:null,'attributes':[[_0x22b5('0x41'),_0x22b5('0x43')],[db[_0x22b5('0x20')]['fn']('COUNT',db['sequelize'][_0x22b5('0x22')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x22b5('0x21'),db[_0x22b5('0x20')]['fn']('IF',db[_0x22b5('0x20')][_0x22b5('0x24')](_0x22b5('0x25')))),_0x22b5('0x44')]],'group':['campaign']})[_0x22b5('0xb')](function(_0x3675c4){logger['info']('GetCampaignHopperHistory',_0x144d4c);logger[_0x22b5('0xf')](_0x22b5('0x45'),_0x144d4c,JSON['stringify'](_0x3675c4));_0xd191ae(_0x3675c4);})[_0x22b5('0x15')](function(_0x157dae){logger['error'](_0x22b5('0x45'),_0x157dae[_0x22b5('0x13')],_0x144d4c);_0x3cca57(_0x4aa074[_0x22b5('0x11')](0x1f4,_0x157dae['message']));});});};
\ No newline at end of file
index b3ca9df..fac86b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x965b=['post','create','put','update','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x78699f,_0x9b5e13){var _0x26bfc7=function(_0x2fbc27){while(--_0x2fbc27){_0x78699f['push'](_0x78699f['shift']());}};_0x26bfc7(++_0x9b5e13);}(_0x965b,0x137));var _0xb965=function(_0xedf47a,_0x109ed9){_0xedf47a=_0xedf47a-0x0;var _0x2643ce=_0x965b[_0xedf47a];return _0x2643ce;};'use strict';var multer=require('multer');var util=require(_0xb965('0x0'));var path=require(_0xb965('0x1'));var timeout=require(_0xb965('0x2'));var express=require(_0xb965('0x3'));var router=express['Router']();var fs_extra=require(_0xb965('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb965('0x5'));var config=require('../../config/environment');var controller=require(_0xb965('0x6'));router[_0xb965('0x7')]('/',auth[_0xb965('0x8')](),controller[_0xb965('0x9')]);router[_0xb965('0x7')](_0xb965('0xa'),auth[_0xb965('0x8')](),controller['describe']);router[_0xb965('0x7')](_0xb965('0xb'),auth[_0xb965('0x8')](),controller[_0xb965('0xc')]);router[_0xb965('0xd')]('/',auth['isAuthenticated'](),controller[_0xb965('0xe')]);router[_0xb965('0xf')]('/:id',auth[_0xb965('0x8')](),controller[_0xb965('0x10')]);module[_0xb965('0x11')]=router;
\ No newline at end of file
+var _0xe2e5=['isAuthenticated','index','/describe','describe','/:id','show','post','create','update','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x5ab04b,_0x1642f8){var _0x8c04a4=function(_0x58aed5){while(--_0x58aed5){_0x5ab04b['push'](_0x5ab04b['shift']());}};_0x8c04a4(++_0x1642f8);}(_0xe2e5,0x186));var _0x5e2e=function(_0x412572,_0x11e943){_0x412572=_0x412572-0x0;var _0x18691f=_0xe2e5[_0x412572];return _0x18691f;};'use strict';var multer=require(_0x5e2e('0x0'));var util=require(_0x5e2e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5e2e('0x2'));var router=express[_0x5e2e('0x3')]();var fs_extra=require(_0x5e2e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5e2e('0x5'));var config=require(_0x5e2e('0x6'));var controller=require(_0x5e2e('0x7'));router[_0x5e2e('0x8')]('/',auth[_0x5e2e('0x9')](),controller[_0x5e2e('0xa')]);router[_0x5e2e('0x8')](_0x5e2e('0xb'),auth[_0x5e2e('0x9')](),controller[_0x5e2e('0xc')]);router['get'](_0x5e2e('0xd'),auth[_0x5e2e('0x9')](),controller[_0x5e2e('0xe')]);router[_0x5e2e('0xf')]('/',auth[_0x5e2e('0x9')](),controller[_0x5e2e('0x10')]);router['put'](_0x5e2e('0xd'),auth['isAuthenticated'](),controller[_0x5e2e('0x11')]);module[_0x5e2e('0x12')]=router;
\ No newline at end of file
index 604ea81..cfc7e86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06bf=['name','sequelize','exports','STRING'];(function(_0x1c40c4,_0x10cc59){var _0x1f0f63=function(_0x10f399){while(--_0x10f399){_0x1c40c4['push'](_0x1c40c4['shift']());}};_0x1f0f63(++_0x10cc59);}(_0x06bf,0x105));var _0xf06b=function(_0x47eba9,_0xcf5034){_0x47eba9=_0x47eba9-0x0;var _0x320463=_0x06bf[_0x47eba9];return _0x320463;};'use strict';var Sequelize=require(_0xf06b('0x0'));module[_0xf06b('0x1')]={'name':{'type':Sequelize[_0xf06b('0x2')],'unique':_0xf06b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf06b('0x2')]},'dialPrefix':{'type':Sequelize[_0xf06b('0x2')]}};
\ No newline at end of file
+var _0x5900=['exports','STRING'];(function(_0x1ef213,_0x54de15){var _0x38f93d=function(_0x4642b6){while(--_0x4642b6){_0x1ef213['push'](_0x1ef213['shift']());}};_0x38f93d(++_0x54de15);}(_0x5900,0xd2));var _0x0590=function(_0x12885b,_0x4ce691){_0x12885b=_0x12885b-0x0;var _0x52625a=_0x5900[_0x12885b];return _0x52625a;};'use strict';var Sequelize=require('sequelize');module[_0x0590('0x0')]={'name':{'type':Sequelize[_0x0590('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0590('0x1')]},'dialPrefix':{'type':Sequelize[_0x0590('0x1')]}};
\ No newline at end of file
index e4c0f14..46d3d53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b21=['count','set','Content-Range','reject','update','then','get','Lists','destroy','error','stack','send','index','map','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','CmList','includeAll','include','findAll','catch','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ListId','Disposition','getDispositions','findOne','rows','removeDispositions','tags','join','push','each','omit','ids','success','dataValues','errors','message','json','CmCustomField','CustomFields','CmContact','concat','format','nolimit','raw','getContacts','getContactsCsv','cf_%d','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','number','switch','sequelize','addColumn','cm_contacts','cf_%s','addAgents','spread','emit','userCmList:save','removeAgents','isArray','userCmList:remove','getAgents','User','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','offset','undefined','limit'];(function(_0x1ab4fa,_0x3a3c3a){var _0x1d84ef=function(_0x92a013){while(--_0x92a013){_0x1ab4fa['push'](_0x1ab4fa['shift']());}};_0x1d84ef(++_0x3a3c3a);}(_0x0b21,0x6d));var _0x10b2=function(_0x5de98e,_0x17c6f4){_0x5de98e=_0x5de98e-0x0;var _0x5f58c5=_0x0b21[_0x5de98e];return _0x5f58c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x10b2('0x0'));var zipdir=require(_0x10b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x10b2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x10b2('0x3'));var util=require(_0x10b2('0x4'));var path=require('path');var sox=require(_0x10b2('0x5'));var csv=require(_0x10b2('0x6'));var ejs=require(_0x10b2('0x7'));var fs=require('fs');var fs_extra=require(_0x10b2('0x8'));var _=require(_0x10b2('0x9'));var squel=require(_0x10b2('0xa'));var crypto=require(_0x10b2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x10b2('0xc'));var toCsv=require(_0x10b2('0x6'));var querystring=require('querystring');var Papa=require(_0x10b2('0xd'));var Redis=require(_0x10b2('0xe'));var authService=require(_0x10b2('0xf'));var qs=require(_0x10b2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10b2('0x11'));var logger=require(_0x10b2('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x10b2('0x13'));var db=require(_0x10b2('0x14'))['db'];config[_0x10b2('0x15')]=_[_0x10b2('0x16')](config[_0x10b2('0x15')],{'host':_0x10b2('0x17'),'port':0x18eb});var socket=require(_0x10b2('0x18'))(new Redis(config[_0x10b2('0x15')]));require(_0x10b2('0x19'))[_0x10b2('0x1a')](socket);function respondWithStatusCode(_0x199dfe,_0x4c92f6){_0x4c92f6=_0x4c92f6||0xcc;return function(_0xb33173){if(_0xb33173){return _0x199dfe[_0x10b2('0x1b')](_0x4c92f6);}return _0x199dfe['status'](_0x4c92f6)[_0x10b2('0x1c')]();};}function respondWithResult(_0x54e4da,_0x2499df){_0x2499df=_0x2499df||0xc8;return function(_0x5990c0){if(_0x5990c0){return _0x54e4da[_0x10b2('0x1d')](_0x2499df)['json'](_0x5990c0);}};}function respondWithFilteredResult(_0x2d03fd,_0x2da2d8){return function(_0x131605){if(_0x131605){var _0x4d1b0b=typeof _0x2da2d8[_0x10b2('0x1e')]===_0x10b2('0x1f')&&typeof _0x2da2d8[_0x10b2('0x20')]==='undefined';var _0x4d3f09=_0x131605[_0x10b2('0x21')];var _0x89eb87=_0x4d1b0b?0x0:_0x2da2d8[_0x10b2('0x1e')];var _0x5d50a6=_0x4d1b0b?_0x131605[_0x10b2('0x21')]:_0x2da2d8[_0x10b2('0x1e')]+_0x2da2d8[_0x10b2('0x20')];var _0x3bf1b6;if(_0x5d50a6>=_0x4d3f09){_0x5d50a6=_0x4d3f09;_0x3bf1b6=0xc8;}else{_0x3bf1b6=0xce;}_0x2d03fd[_0x10b2('0x1d')](_0x3bf1b6);return _0x2d03fd[_0x10b2('0x22')](_0x10b2('0x23'),_0x89eb87+'-'+_0x5d50a6+'/'+_0x4d3f09)['json'](_0x131605);}return null;};}function patchUpdates(_0x2cd7cd){return function(_0x4b62f2){try{jsonpatch['apply'](_0x4b62f2,_0x2cd7cd,!![]);}catch(_0x10c907){return BPromise[_0x10b2('0x24')](_0x10c907);}return _0x4b62f2['save']();};}function saveUpdates(_0x35035a,_0x36dda2){return function(_0x4e7874){if(_0x4e7874){return _0x4e7874[_0x10b2('0x25')](_0x35035a)[_0x10b2('0x26')](function(_0xf42411){return _0xf42411;});}return null;};}function removeEntity(_0x50bb3c,_0x39f97d){return function(_0x3a8610){if(_0x3a8610){return _0x3a8610['destroy']()[_0x10b2('0x26')](function(){var _0x1303d6=_0x3a8610[_0x10b2('0x27')]({'plain':!![]});var _0xdaea6=_0x10b2('0x28');return db['UserProfileResource'][_0x10b2('0x29')]({'where':{'type':_0xdaea6,'resourceId':_0x1303d6['id']}})[_0x10b2('0x26')](function(){return _0x3a8610;});})[_0x10b2('0x26')](function(){_0x50bb3c[_0x10b2('0x1d')](0xcc)[_0x10b2('0x1c')]();});}};}function handleEntityNotFound(_0x359513,_0x33a220){return function(_0x174be7){if(!_0x174be7){_0x359513[_0x10b2('0x1b')](0x194);}return _0x174be7;};}function handleError(_0x6f8afc,_0x373db4){_0x373db4=_0x373db4||0x1f4;return function(_0x1d5871){logger[_0x10b2('0x2a')](_0x1d5871[_0x10b2('0x2b')]);if(_0x1d5871['name']){delete _0x1d5871['name'];}_0x6f8afc['status'](_0x373db4)[_0x10b2('0x2c')](_0x1d5871);};}exports[_0x10b2('0x2d')]=function(_0x2d75e1,_0x50c4d1){var _0x31bc9b={},_0x2592c6={},_0x49193d={'count':0x0,'rows':[]};var _0x2fcdc2=_[_0x10b2('0x2e')](db['CmList']['rawAttributes'],function(_0x267bf7){return{'name':_0x267bf7[_0x10b2('0x2f')],'type':_0x267bf7['type'][_0x10b2('0x30')]};});_0x2592c6[_0x10b2('0x31')]=_[_0x10b2('0x2e')](_0x2fcdc2,_0x10b2('0x32'));_0x2592c6[_0x10b2('0x33')]=_[_0x10b2('0x34')](_0x2d75e1[_0x10b2('0x33')]);_0x2592c6['filters']=_[_0x10b2('0x35')](_0x2592c6[_0x10b2('0x31')],_0x2592c6[_0x10b2('0x33')]);_0x31bc9b[_0x10b2('0x36')]=_[_0x10b2('0x35')](_0x2592c6[_0x10b2('0x31')],qs[_0x10b2('0x37')](_0x2d75e1['query']['fields']));_0x31bc9b['attributes']=_0x31bc9b[_0x10b2('0x36')][_0x10b2('0x38')]?_0x31bc9b[_0x10b2('0x36')]:_0x2592c6[_0x10b2('0x31')];if(!_0x2d75e1[_0x10b2('0x33')][_0x10b2('0x39')]('nolimit')){_0x31bc9b['limit']=qs[_0x10b2('0x20')](_0x2d75e1[_0x10b2('0x33')][_0x10b2('0x20')]);_0x31bc9b[_0x10b2('0x1e')]=qs[_0x10b2('0x1e')](_0x2d75e1[_0x10b2('0x33')][_0x10b2('0x1e')]);}_0x31bc9b[_0x10b2('0x3a')]=qs['sort'](_0x2d75e1[_0x10b2('0x33')][_0x10b2('0x3b')]);_0x31bc9b['where']=qs[_0x10b2('0x3c')](_[_0x10b2('0x3d')](_0x2d75e1['query'],_0x2592c6[_0x10b2('0x3c')]),_0x2fcdc2);if(_0x2d75e1[_0x10b2('0x33')][_0x10b2('0x3e')]){_0x31bc9b[_0x10b2('0x3f')]=_[_0x10b2('0x40')](_0x31bc9b[_0x10b2('0x3f')],{'$or':_[_0x10b2('0x2e')](_0x2fcdc2,function(_0x13d07e){if(_0x13d07e[_0x10b2('0x41')]!==_0x10b2('0x42')){var _0x48e17f={};_0x48e17f[_0x13d07e['name']]={'$like':'%'+_0x2d75e1[_0x10b2('0x33')]['filter']+'%'};return _0x48e17f;}})});}_0x31bc9b=_['merge']({},_0x31bc9b,_0x2d75e1['options']);var _0xcd716e={'where':_0x31bc9b['where']};return db[_0x10b2('0x43')][_0x10b2('0x21')](_0xcd716e)[_0x10b2('0x26')](function(_0x1a3b47){_0x49193d[_0x10b2('0x21')]=_0x1a3b47;if(_0x2d75e1[_0x10b2('0x33')][_0x10b2('0x44')]){_0x31bc9b[_0x10b2('0x45')]=[{'all':!![]}];}return db[_0x10b2('0x43')][_0x10b2('0x46')](_0x31bc9b);})[_0x10b2('0x26')](function(_0x54eece){_0x49193d['rows']=_0x54eece;return _0x49193d;})[_0x10b2('0x26')](respondWithFilteredResult(_0x50c4d1,_0x31bc9b))[_0x10b2('0x47')](handleError(_0x50c4d1,null));};exports['show']=function(_0x132d46,_0x505cf0){var _0x4b872f={'raw':![],'where':{'id':_0x132d46[_0x10b2('0x48')]['id']}},_0x3a23a4={};_0x3a23a4[_0x10b2('0x31')]=_[_0x10b2('0x34')](db[_0x10b2('0x43')][_0x10b2('0x49')]);_0x3a23a4[_0x10b2('0x33')]=_[_0x10b2('0x34')](_0x132d46[_0x10b2('0x33')]);_0x3a23a4[_0x10b2('0x3c')]=_['intersection'](_0x3a23a4['model'],_0x3a23a4[_0x10b2('0x33')]);_0x4b872f[_0x10b2('0x36')]=_[_0x10b2('0x35')](_0x3a23a4[_0x10b2('0x31')],qs[_0x10b2('0x37')](_0x132d46[_0x10b2('0x33')][_0x10b2('0x37')]));_0x4b872f[_0x10b2('0x36')]=_0x4b872f[_0x10b2('0x36')]['length']?_0x4b872f[_0x10b2('0x36')]:_0x3a23a4[_0x10b2('0x31')];if(_0x132d46[_0x10b2('0x33')][_0x10b2('0x44')]){_0x4b872f['include']=[{'all':!![]}];}_0x4b872f=_[_0x10b2('0x40')]({},_0x4b872f,_0x132d46[_0x10b2('0x4a')]);return db[_0x10b2('0x43')][_0x10b2('0x4b')](_0x4b872f)[_0x10b2('0x26')](handleEntityNotFound(_0x505cf0,null))[_0x10b2('0x26')](respondWithResult(_0x505cf0,null))[_0x10b2('0x47')](handleError(_0x505cf0,null));};exports[_0x10b2('0x4c')]=function(_0x562305,_0x255dc0){return db[_0x10b2('0x43')]['create'](_0x562305['body'],{})[_0x10b2('0x26')](function(_0x1b8494){var _0x246e71=_0x562305[_0x10b2('0x4d')]['get']({'plain':!![]});if(!_0x246e71)throw new Error(_0x10b2('0x4e'));if(_0x246e71['role']==='user'){var _0x5c8a75=_0x1b8494['get']({'plain':!![]});var _0x5415b5=_0x10b2('0x28');return db[_0x10b2('0x4f')]['find']({'where':{'name':_0x5415b5,'userProfileId':_0x246e71[_0x10b2('0x50')]},'raw':!![]})['then'](function(_0x557ca8){if(_0x557ca8&&_0x557ca8[_0x10b2('0x51')]===0x0){return db['UserProfileResource'][_0x10b2('0x4c')]({'name':_0x5c8a75[_0x10b2('0x32')],'resourceId':_0x5c8a75['id'],'type':_0x557ca8['name'],'sectionId':_0x557ca8['id']},{})['then'](function(){return _0x1b8494;});}else{return _0x1b8494;}})[_0x10b2('0x47')](function(_0x22949e){logger[_0x10b2('0x2a')](_0x10b2('0x52'),_0x22949e);throw _0x22949e;});}return _0x1b8494;})[_0x10b2('0x26')](respondWithResult(_0x255dc0,0xc9))[_0x10b2('0x47')](handleError(_0x255dc0,null));};exports[_0x10b2('0x25')]=function(_0x3e2975,_0x41a5f6){if(_0x3e2975[_0x10b2('0x53')]['id']){delete _0x3e2975['body']['id'];}return db[_0x10b2('0x43')]['find']({'where':{'id':_0x3e2975['params']['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0x41a5f6,null))[_0x10b2('0x26')](saveUpdates(_0x3e2975[_0x10b2('0x53')],null))[_0x10b2('0x26')](respondWithResult(_0x41a5f6,null))[_0x10b2('0x47')](handleError(_0x41a5f6,null));};exports['destroy']=function(_0x5868be,_0x1d711b){return db[_0x10b2('0x43')]['find']({'where':{'id':_0x5868be['params']['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0x1d711b,null))['then'](removeEntity(_0x1d711b,null))[_0x10b2('0x47')](handleError(_0x1d711b,null));};exports[_0x10b2('0x54')]=function(_0x5ad70b,_0x37a14e){return db[_0x10b2('0x43')]['describe']()[_0x10b2('0x26')](respondWithResult(_0x37a14e,null))[_0x10b2('0x47')](handleError(_0x37a14e,null));};exports['addDisposition']=function(_0x482633,_0xb25ee4,_0x55f295){if(_0x482633[_0x10b2('0x53')]['id']){delete _0x482633['body']['id'];}return db['CmList']['find']({'where':{'id':_0x482633[_0x10b2('0x48')]['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0xb25ee4,null))[_0x10b2('0x26')](function(_0x1103d2){if(_0x1103d2){_0x482633[_0x10b2('0x53')][_0x10b2('0x55')]=_0x1103d2['id'];return db[_0x10b2('0x56')]['create'](_0x482633[_0x10b2('0x53')]);}})[_0x10b2('0x26')](respondWithResult(_0xb25ee4,null))[_0x10b2('0x47')](handleError(_0xb25ee4,null));};exports[_0x10b2('0x57')]=function(_0x32824b,_0x42154f,_0x27ab30){var _0x5bf7c2={'raw':![],'where':{}};var _0x5264f5={};var _0x1d9a81={'count':0x0,'rows':[]};return db[_0x10b2('0x43')][_0x10b2('0x58')]({'where':{'id':_0x32824b[_0x10b2('0x48')]['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0x42154f,null))[_0x10b2('0x26')](function(_0x462f92){if(_0x462f92){_0x5264f5['model']=_[_0x10b2('0x34')](db[_0x10b2('0x56')]['rawAttributes']);_0x5264f5[_0x10b2('0x33')]=_['keys'](_0x32824b[_0x10b2('0x33')]);_0x5264f5[_0x10b2('0x3c')]=_[_0x10b2('0x35')](_0x5264f5[_0x10b2('0x31')],_0x5264f5[_0x10b2('0x33')]);_0x5bf7c2[_0x10b2('0x36')]=_['intersection'](_0x5264f5[_0x10b2('0x31')],qs[_0x10b2('0x37')](_0x32824b['query'][_0x10b2('0x37')]));_0x5bf7c2[_0x10b2('0x36')]=_0x5bf7c2[_0x10b2('0x36')][_0x10b2('0x38')]?_0x5bf7c2[_0x10b2('0x36')]:_0x5264f5[_0x10b2('0x31')];if(!_0x32824b[_0x10b2('0x33')][_0x10b2('0x39')]('nolimit')){_0x5bf7c2[_0x10b2('0x20')]=qs[_0x10b2('0x20')](_0x32824b['query'][_0x10b2('0x20')]);_0x5bf7c2[_0x10b2('0x1e')]=qs[_0x10b2('0x1e')](_0x32824b['query'][_0x10b2('0x1e')]);}_0x5bf7c2[_0x10b2('0x3a')]=qs[_0x10b2('0x3b')](_0x32824b['query'][_0x10b2('0x3b')]);_0x5bf7c2[_0x10b2('0x3f')]=qs[_0x10b2('0x3c')](_['pick'](_0x32824b['query'],_0x5264f5[_0x10b2('0x3c')]));_0x5bf7c2['where'][_0x10b2('0x55')]=_0x462f92['id'];if(_0x32824b[_0x10b2('0x33')][_0x10b2('0x3e')]){_0x5bf7c2['where']=_['merge'](_0x5bf7c2[_0x10b2('0x3f')],{'$or':_[_0x10b2('0x2e')](_0x5bf7c2[_0x10b2('0x36')],function(_0x508fb4){var _0x3e92fc={};_0x3e92fc[_0x508fb4]={'$like':'%'+_0x32824b[_0x10b2('0x33')][_0x10b2('0x3e')]+'%'};return _0x3e92fc;})});}_0x5bf7c2=_['merge']({},_0x5bf7c2,_0x32824b['options']);return db[_0x10b2('0x56')][_0x10b2('0x21')]({'where':_0x5bf7c2[_0x10b2('0x3f')]})[_0x10b2('0x26')](function(_0x59fab8){_0x1d9a81['count']=_0x59fab8;if(_0x32824b['query']['includeAll']){_0x5bf7c2['include']=[{'all':!![]}];}return db[_0x10b2('0x56')][_0x10b2('0x46')](_0x5bf7c2);})[_0x10b2('0x26')](function(_0x528419){_0x1d9a81[_0x10b2('0x59')]=_0x528419;return _0x1d9a81;});}})[_0x10b2('0x26')](respondWithFilteredResult(_0x42154f,_0x5bf7c2))['catch'](handleError(_0x42154f,null));};exports[_0x10b2('0x5a')]=function(_0x1f6785,_0x118514,_0x655ccb){return db[_0x10b2('0x43')][_0x10b2('0x4b')]({'where':{'id':_0x1f6785[_0x10b2('0x48')]['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0x118514,null))['then'](function(_0xf5b4c5){if(_0xf5b4c5){return _0xf5b4c5[_0x10b2('0x5a')](_0x1f6785[_0x10b2('0x33')]['ids']);}})[_0x10b2('0x26')](respondWithStatusCode(_0x118514,null))[_0x10b2('0x47')](handleError(_0x118514,null));};exports['addContacts']=function(_0x45d030,_0x46e9c4,_0x3e8c0a){return db[_0x10b2('0x43')][_0x10b2('0x4b')]({'where':{'id':_0x45d030[_0x10b2('0x48')]['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0x46e9c4,null))['then'](function(_0xb752ff){if(_0xb752ff){var _0x1010bc=[];var _0x2f7776={'success':[],'errors':[]};return db['CmContact'][_0x10b2('0x54')]()[_0x10b2('0x26')](function(_0x179a78){if(_0x45d030[_0x10b2('0x53')][_0x10b2('0x5b')]&&_['isArray'](_0x45d030['body'][_0x10b2('0x5b')])){if(_0x45d030[_0x10b2('0x53')][_0x10b2('0x5b')][_0x10b2('0x38')]){_0x45d030[_0x10b2('0x53')][_0x10b2('0x5b')]=_0x45d030[_0x10b2('0x53')][_0x10b2('0x5b')][_0x10b2('0x5c')](';')+';';}else{_0x45d030[_0x10b2('0x53')][_0x10b2('0x5b')]=null;}}else{_0x45d030[_0x10b2('0x53')]['tags']=null;}if(_0x45d030[_0x10b2('0x53')]&&_['isArray'](_0x45d030[_0x10b2('0x53')])){for(var _0x526568=0x0;_0x526568<_0x45d030[_0x10b2('0x53')][_0x10b2('0x38')];_0x526568+=0x1){_0x45d030[_0x10b2('0x53')][_0x526568][_0x10b2('0x55')]=_0x45d030['params']['id'];_0x1010bc[_0x10b2('0x5d')](_0x45d030['body'][_0x526568]);}return BPromise[_0x10b2('0x5e')](_0x1010bc,function(_0x184af2){return db['CmContact']['create'](_[_0x10b2('0x5f')](_0x184af2,[_0x10b2('0x60'),'id'])||{},{'fields':_[_0x10b2('0x34')](_0x179a78),'raw':!![]})['then'](function(_0x350125){_0x2f7776[_0x10b2('0x61')][_0x10b2('0x5d')](_0x350125[_0x10b2('0x62')]);})[_0x10b2('0x47')](function(_0x211b37){_0x2f7776[_0x10b2('0x63')][_0x10b2('0x5d')]({'data':_0x184af2,'error':_0x211b37[_0x10b2('0x64')]});});})['then'](function(_0x30b5b2){return _0x2f7776;})[_0x10b2('0x47')](function(_0x55a97b){return _0x55a97b;});}else{_0x46e9c4[_0x10b2('0x1d')](0x190)[_0x10b2('0x65')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x10b2('0x26')](respondWithResult(_0x46e9c4,null))[_0x10b2('0x47')](handleError(_0x46e9c4,null));};exports['getContacts']=function(_0x2d4a11,_0x4ad7bf,_0x1170ba){var _0x41d6b5;return db[_0x10b2('0x43')][_0x10b2('0x4b')]({'where':{'id':_0x2d4a11[_0x10b2('0x48')]['id']},'include':[{'model':db[_0x10b2('0x66')],'as':_0x10b2('0x67')}]})['then'](handleEntityNotFound(_0x4ad7bf,null))['then'](function(_0x3116a8){if(_0x3116a8){_0x41d6b5=_0x3116a8;return db[_0x10b2('0x68')][_0x10b2('0x49')];}})['then'](function(_0x14fd02){if(_0x14fd02){var _0x5c5b3d={};var _0x358057={};_0x358057[_0x10b2('0x31')]=_[_0x10b2('0x69')](_[_0x10b2('0x34')](_0x14fd02),_[_0x10b2('0x2e')](_0x41d6b5[_0x10b2('0x67')],function(_0x458dc1){return util[_0x10b2('0x6a')]('cf_%d',_0x458dc1['id']);}));_0x358057['query']=_[_0x10b2('0x34')](_0x2d4a11[_0x10b2('0x33')]);_0x358057['filters']=_['intersection'](_0x358057[_0x10b2('0x31')],_0x358057['query']);_0x5c5b3d['attributes']=_[_0x10b2('0x35')](_0x358057['model'],qs[_0x10b2('0x37')](_0x2d4a11[_0x10b2('0x33')]['fields']));_0x5c5b3d['attributes']=_0x5c5b3d[_0x10b2('0x36')]['length']?_0x5c5b3d[_0x10b2('0x36')]:_0x358057['model'];if(!_0x2d4a11[_0x10b2('0x33')]['hasOwnProperty'](_0x10b2('0x6b'))){_0x5c5b3d[_0x10b2('0x20')]=qs[_0x10b2('0x20')](_0x2d4a11[_0x10b2('0x33')]['limit']);_0x5c5b3d[_0x10b2('0x1e')]=qs['offset'](_0x2d4a11[_0x10b2('0x33')][_0x10b2('0x1e')]);}_0x5c5b3d[_0x10b2('0x3a')]=qs[_0x10b2('0x3b')](_0x2d4a11[_0x10b2('0x33')][_0x10b2('0x3b')]);_0x5c5b3d[_0x10b2('0x3f')]=qs[_0x10b2('0x3c')](_['pick'](_0x2d4a11['query'],_0x358057[_0x10b2('0x3c')]));_0x5c5b3d[_0x10b2('0x6c')]=!![];if(_0x2d4a11['query'][_0x10b2('0x3e')]){_0x5c5b3d['where']=_[_0x10b2('0x40')](_0x5c5b3d[_0x10b2('0x3f')],{'$or':_[_0x10b2('0x2e')](_0x5c5b3d[_0x10b2('0x36')],function(_0xe2f72c){var _0xe50064={};_0xe50064[_0xe2f72c]={'$like':'%'+_0x2d4a11[_0x10b2('0x33')]['filter']+'%'};return _0xe50064;})});}_0x5c5b3d=_[_0x10b2('0x40')]({},_0x5c5b3d,_0x2d4a11[_0x10b2('0x4a')]);return _0x41d6b5[_0x10b2('0x6d')](_0x5c5b3d);}})['then'](respondWithResult(_0x4ad7bf,null))[_0x10b2('0x47')](handleError(_0x4ad7bf,null));};exports[_0x10b2('0x6e')]=function(_0x4458b9,_0x42c3a7,_0x2cb9f1){var _0x1f789f;return db['CmList'][_0x10b2('0x4b')]({'where':{'id':_0x4458b9[_0x10b2('0x48')]['id']},'include':[{'model':db[_0x10b2('0x66')],'as':_0x10b2('0x67')}]})[_0x10b2('0x26')](handleEntityNotFound(_0x42c3a7,null))['then'](function(_0x4146f9){if(_0x4146f9){_0x1f789f=_0x4146f9;return db[_0x10b2('0x68')][_0x10b2('0x49')];}})[_0x10b2('0x26')](function(_0x113269){if(_0x113269){var _0x4aa59c={};var _0x5bc335={};_0x5bc335[_0x10b2('0x31')]=_['concat'](_[_0x10b2('0x34')](_0x113269),_[_0x10b2('0x2e')](_0x1f789f[_0x10b2('0x67')],function(_0x35932f){return util['format'](_0x10b2('0x6f'),_0x35932f['id']);}));_0x5bc335[_0x10b2('0x33')]=_[_0x10b2('0x34')](_0x4458b9[_0x10b2('0x33')]);_0x5bc335[_0x10b2('0x3c')]=_[_0x10b2('0x35')](_0x5bc335[_0x10b2('0x31')],_0x5bc335[_0x10b2('0x33')]);_0x4aa59c[_0x10b2('0x36')]=_[_0x10b2('0x35')](_0x5bc335['model'],qs['fields'](_0x4458b9[_0x10b2('0x33')][_0x10b2('0x37')]));_0x4aa59c[_0x10b2('0x36')]=_0x4aa59c[_0x10b2('0x36')][_0x10b2('0x38')]?_0x4aa59c['attributes']:_0x5bc335[_0x10b2('0x31')];if(!_0x4458b9[_0x10b2('0x33')][_0x10b2('0x39')](_0x10b2('0x6b'))){_0x4aa59c[_0x10b2('0x20')]=qs[_0x10b2('0x20')](_0x4458b9[_0x10b2('0x33')][_0x10b2('0x20')]);_0x4aa59c[_0x10b2('0x1e')]=qs[_0x10b2('0x1e')](_0x4458b9['query']['offset']);}_0x4aa59c['order']=qs[_0x10b2('0x3b')](_0x4458b9[_0x10b2('0x33')][_0x10b2('0x3b')]);_0x4aa59c[_0x10b2('0x3f')]=qs[_0x10b2('0x3c')](_['pick'](_0x4458b9['query'],_0x5bc335[_0x10b2('0x3c')]));_0x4aa59c['raw']=!![];if(_0x4458b9[_0x10b2('0x33')][_0x10b2('0x3e')]){_0x4aa59c['where']=_['merge'](_0x4aa59c['where'],{'$or':_[_0x10b2('0x2e')](_0x4aa59c['attributes'],function(_0x5e0d38){var _0x4c2ec1={};_0x4c2ec1[_0x5e0d38]={'$like':'%'+_0x4458b9[_0x10b2('0x33')]['filter']+'%'};return _0x4c2ec1;})});}_0x4aa59c=_[_0x10b2('0x40')]({},_0x4aa59c,_0x4458b9[_0x10b2('0x4a')]);return _0x1f789f[_0x10b2('0x6d')](_0x4aa59c);}})['then'](function(_0x2866df){if(!_[_0x10b2('0x70')](_0x2866df)){var _0x53d4d0=toCsv(_0x2866df);var _0x520a22=Date[_0x10b2('0x71')]();fs['writeFileSync'](util[_0x10b2('0x6a')](_0x10b2('0x72'),_0x1f789f['id'],_0x520a22),_0x53d4d0);_0x42c3a7[_0x10b2('0x73')](_0x10b2('0x74'),_0x10b2('0x75')+util['format'](_0x10b2('0x76'),_0x1f789f['id'],_0x520a22));_0x42c3a7[_0x10b2('0x73')](_0x10b2('0x77'),_0x10b2('0x78'));return _0x42c3a7[_0x10b2('0x79')](util[_0x10b2('0x6a')](_0x10b2('0x72'),_0x1f789f['id'],_0x520a22));}else{return _0x42c3a7[_0x10b2('0x1b')](0xcc);}})[_0x10b2('0x47')](handleError(_0x42c3a7,null));};exports[_0x10b2('0x7a')]=function(_0x105fbf,_0xc36b6f,_0x5acb81){var _0x2b8707;delete _0x105fbf['body']['id'];return db[_0x10b2('0x43')][_0x10b2('0x58')]({'where':{'id':_0x105fbf[_0x10b2('0x48')]['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0xc36b6f,null))['then'](function(_0x35fb94){if(_0x35fb94){return db['sequelize'][_0x10b2('0x7b')](function(_0x367095){return db[_0x10b2('0x66')]['create'](_0x105fbf[_0x10b2('0x53')],{'transaction':_0x367095})[_0x10b2('0x26')](function(_0x3f14a9){_0x2b8707=_0x3f14a9;return _0x35fb94[_0x10b2('0x7c')](_0x3f14a9,{'transaction':_0x367095});})[_0x10b2('0x26')](function(){var _0x398840={'type':db[_0x10b2('0x7d')][_0x10b2('0x7e')],'transaction':_0x367095};switch(_0x105fbf[_0x10b2('0x53')][_0x10b2('0x41')]){case'text':_0x398840[_0x10b2('0x41')]=db['Sequelize'][_0x10b2('0x7e')];break;case _0x10b2('0x7f'):_0x398840[_0x10b2('0x41')]=db[_0x10b2('0x7d')]['INTEGER'];break;case _0x10b2('0x80'):_0x398840['type']=db[_0x10b2('0x7d')]['BOOLEAN'];_0x398840['defaultValue']=![];break;default:}return db[_0x10b2('0x81')]['queryInterface'][_0x10b2('0x82')](_0x10b2('0x83'),util[_0x10b2('0x6a')](_0x10b2('0x84'),_0x2b8707['id']),_0x398840);})[_0x10b2('0x26')](function(){return _0x2b8707;});});}})[_0x10b2('0x26')](respondWithResult(_0xc36b6f,null))[_0x10b2('0x47')](handleError(_0xc36b6f,null));};exports['getCustomFields']=function(_0x1adf7a,_0x32c295,_0x245082){var _0x419d00={};var _0x103b03={};var _0xf971b;var _0x3e0f95;return db[_0x10b2('0x43')][_0x10b2('0x58')]({'where':{'id':_0x1adf7a[_0x10b2('0x48')]['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0x32c295,null))[_0x10b2('0x26')](function(_0x12c286){if(_0x12c286){_0xf971b=_0x12c286;_0x103b03[_0x10b2('0x31')]=_[_0x10b2('0x34')](db[_0x10b2('0x66')][_0x10b2('0x49')]);_0x103b03[_0x10b2('0x33')]=_[_0x10b2('0x34')](_0x1adf7a[_0x10b2('0x33')]);_0x103b03['filters']=_[_0x10b2('0x35')](_0x103b03[_0x10b2('0x31')],_0x103b03[_0x10b2('0x33')]);_0x419d00[_0x10b2('0x36')]=_[_0x10b2('0x35')](_0x103b03[_0x10b2('0x31')],qs['fields'](_0x1adf7a['query']['fields']));_0x419d00[_0x10b2('0x36')]=_0x419d00['attributes'][_0x10b2('0x38')]?_0x419d00[_0x10b2('0x36')]:_0x103b03['model'];_0x419d00[_0x10b2('0x3a')]=qs['sort'](_0x1adf7a[_0x10b2('0x33')][_0x10b2('0x3b')]);_0x419d00[_0x10b2('0x3f')]=qs[_0x10b2('0x3c')](_[_0x10b2('0x3d')](_0x1adf7a[_0x10b2('0x33')],_0x103b03[_0x10b2('0x3c')]));_0x419d00[_0x10b2('0x3f')]=_[_0x10b2('0x40')](_0x419d00['where'],{'$or':[{'ListId':_0x12c286['id']},{'ListId':null}]});if(_0x1adf7a[_0x10b2('0x33')][_0x10b2('0x3e')]){_0x419d00[_0x10b2('0x3f')]=_[_0x10b2('0x40')](_0x419d00[_0x10b2('0x3f')],{'$or':_[_0x10b2('0x2e')](_0x419d00[_0x10b2('0x36')],function(_0x48e3bd){var _0x18efd9={};_0x18efd9[_0x48e3bd]={'$like':'%'+_0x1adf7a['query']['filter']+'%'};return _0x18efd9;})});}_0x419d00=_[_0x10b2('0x40')]({},_0x419d00,_0x1adf7a[_0x10b2('0x4a')]);return db[_0x10b2('0x66')]['findAndCountAll'](_0x419d00);}})[_0x10b2('0x26')](respondWithResult(_0x32c295,null))['catch'](handleError(_0x32c295,null));};exports['addAgents']=function(_0xb2dae6,_0x511814,_0x5586bf){return db[_0x10b2('0x43')][_0x10b2('0x4b')]({'where':{'id':_0xb2dae6[_0x10b2('0x48')]['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0x511814,null))['then'](function(_0x5a91a1){if(_0x5a91a1){return _0x5a91a1[_0x10b2('0x85')](_0xb2dae6[_0x10b2('0x53')][_0x10b2('0x60')],_[_0x10b2('0x5f')](_0xb2dae6[_0x10b2('0x53')],['ids','id'])||{})[_0x10b2('0x86')](function(_0x50b403){for(var _0x3c4f58=0x0;_0x3c4f58<_0xb2dae6[_0x10b2('0x53')]['ids']['length'];_0x3c4f58+=0x1){socket[_0x10b2('0x87')](_0x10b2('0x88'),{'UserId':Number(_0xb2dae6['body'][_0x10b2('0x60')][_0x3c4f58]),'CmListId':Number(_0xb2dae6['params']['id'])});}return _0x50b403;});}})['then'](respondWithResult(_0x511814,null))[_0x10b2('0x47')](handleError(_0x511814,null));};exports[_0x10b2('0x89')]=function(_0x27ebeb,_0x17d523,_0x2f2970){return db['CmList']['find']({'where':{'id':_0x27ebeb['params']['id']}})['then'](handleEntityNotFound(_0x17d523,null))['then'](function(_0x490442){if(_0x490442){return _0x490442[_0x10b2('0x89')](_0x27ebeb[_0x10b2('0x33')][_0x10b2('0x60')])[_0x10b2('0x26')](function(){if(_[_0x10b2('0x8a')](_0x27ebeb[_0x10b2('0x33')][_0x10b2('0x60')])){for(var _0x2836a8=0x0;_0x2836a8<_0x27ebeb[_0x10b2('0x33')][_0x10b2('0x60')][_0x10b2('0x38')];_0x2836a8+=0x1){socket['emit'](_0x10b2('0x8b'),{'UserId':Number(_0x27ebeb[_0x10b2('0x33')][_0x10b2('0x60')][_0x2836a8]),'CmListId':Number(_0x27ebeb[_0x10b2('0x48')]['id'])});}}else{socket[_0x10b2('0x87')](_0x10b2('0x8b'),{'UserId':Number(_0x27ebeb[_0x10b2('0x33')][_0x10b2('0x60')]),'CmListId':Number(_0x27ebeb[_0x10b2('0x48')]['id'])});}});}})[_0x10b2('0x26')](respondWithStatusCode(_0x17d523,null))['catch'](handleError(_0x17d523,null));};exports[_0x10b2('0x8c')]=function(_0xa9d83,_0x21bb0f,_0x1642f7){var _0x507ae2={};var _0x50f161={};var _0x52c95a;var _0x2c0bc6;return db[_0x10b2('0x43')][_0x10b2('0x58')]({'where':{'id':_0xa9d83[_0x10b2('0x48')]['id']}})[_0x10b2('0x26')](handleEntityNotFound(_0x21bb0f,null))[_0x10b2('0x26')](function(_0x3e73f2){if(_0x3e73f2){_0x52c95a=_0x3e73f2;_0x50f161[_0x10b2('0x31')]=_[_0x10b2('0x34')](db[_0x10b2('0x8d')]['rawAttributes']);_0x50f161[_0x10b2('0x33')]=_[_0x10b2('0x34')](_0xa9d83['query']);_0x50f161[_0x10b2('0x3c')]=_['intersection'](_0x50f161[_0x10b2('0x31')],_0x50f161[_0x10b2('0x33')]);_0x507ae2[_0x10b2('0x36')]=_['intersection'](_0x50f161[_0x10b2('0x31')],qs[_0x10b2('0x37')](_0xa9d83[_0x10b2('0x33')]['fields']));_0x507ae2[_0x10b2('0x36')]=_0x507ae2['attributes'][_0x10b2('0x38')]?_0x507ae2[_0x10b2('0x36')]:_0x50f161[_0x10b2('0x31')];_0x507ae2['order']=qs[_0x10b2('0x3b')](_0xa9d83[_0x10b2('0x33')][_0x10b2('0x3b')]);_0x507ae2[_0x10b2('0x3f')]=qs[_0x10b2('0x3c')](_['pick'](_0xa9d83[_0x10b2('0x33')],_0x50f161[_0x10b2('0x3c')]));if(_0xa9d83[_0x10b2('0x33')][_0x10b2('0x3e')]){_0x507ae2[_0x10b2('0x3f')]=_['merge'](_0x507ae2[_0x10b2('0x3f')],{'$or':_[_0x10b2('0x2e')](_0x507ae2[_0x10b2('0x36')],function(_0x262532){var _0x624b59={};_0x624b59[_0x262532]={'$like':'%'+_0xa9d83[_0x10b2('0x33')][_0x10b2('0x3e')]+'%'};return _0x624b59;})});}_0x507ae2=_[_0x10b2('0x40')]({},_0x507ae2,_0xa9d83[_0x10b2('0x4a')]);return _0x52c95a[_0x10b2('0x8c')](_0x507ae2);}})[_0x10b2('0x26')](function(_0x1638b2){if(_0x1638b2){_0x2c0bc6=_0x1638b2['length'];if(!_0xa9d83[_0x10b2('0x33')][_0x10b2('0x39')](_0x10b2('0x6b'))){_0x507ae2[_0x10b2('0x20')]=qs[_0x10b2('0x20')](_0xa9d83[_0x10b2('0x33')][_0x10b2('0x20')]);_0x507ae2[_0x10b2('0x1e')]=qs['offset'](_0xa9d83['query']['offset']);}return _0x52c95a[_0x10b2('0x8c')](_0x507ae2);}})['then'](function(_0x5b0e53){if(_0x5b0e53){return _0x5b0e53?{'count':_0x2c0bc6,'rows':_0x5b0e53}:null;}})['then'](respondWithResult(_0x21bb0f,null))[_0x10b2('0x47')](handleError(_0x21bb0f,null));};
\ No newline at end of file
+var _0xb0c5=['limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','sendStatus','stack','name','send','index','map','CmList','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Lists','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','addDisposition','ListId','findOne','Disposition','options','rows','removeDispositions','ids','describe','isArray','tags','join','push','each','CmContact','omit','dataValues','message','getContacts','CustomFields','format','hasOwnProperty','getContactsCsv','concat','cf_%d','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','getCustomFields','CmCustomField','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','undefined','count','offset'];(function(_0x419571,_0x5ad855){var _0x28be78=function(_0x4e2f0c){while(--_0x4e2f0c){_0x419571['push'](_0x419571['shift']());}};_0x28be78(++_0x5ad855);}(_0xb0c5,0xfa));var _0x5b0c=function(_0x3e3735,_0xaad8ef){_0x3e3735=_0x3e3735-0x0;var _0x1bf323=_0xb0c5[_0x3e3735];return _0x1bf323;};'use strict';var emlformat=require(_0x5b0c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5b0c('0x1'));var moment=require(_0x5b0c('0x2'));var BPromise=require(_0x5b0c('0x3'));var Mustache=require(_0x5b0c('0x4'));var util=require(_0x5b0c('0x5'));var path=require(_0x5b0c('0x6'));var sox=require(_0x5b0c('0x7'));var csv=require(_0x5b0c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b0c('0x9'));var crypto=require(_0x5b0c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5b0c('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5b0c('0xc'));var Papa=require(_0x5b0c('0xd'));var Redis=require('ioredis');var authService=require(_0x5b0c('0xe'));var qs=require(_0x5b0c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b0c('0x10'))(_0x5b0c('0x11'));var utils=require(_0x5b0c('0x12'));var config=require(_0x5b0c('0x13'));var licenseUtil=require(_0x5b0c('0x14'));var db=require(_0x5b0c('0x15'))['db'];config[_0x5b0c('0x16')]=_[_0x5b0c('0x17')](config[_0x5b0c('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b0c('0x18'))(new Redis(config['redis']));require('./cmList.socket')[_0x5b0c('0x19')](socket);function respondWithStatusCode(_0x4d3ed3,_0x1a68da){_0x1a68da=_0x1a68da||0xcc;return function(_0x49f0a8){if(_0x49f0a8){return _0x4d3ed3['sendStatus'](_0x1a68da);}return _0x4d3ed3[_0x5b0c('0x1a')](_0x1a68da)[_0x5b0c('0x1b')]();};}function respondWithResult(_0x328d32,_0x8c181e){_0x8c181e=_0x8c181e||0xc8;return function(_0x10db54){if(_0x10db54){return _0x328d32[_0x5b0c('0x1a')](_0x8c181e)[_0x5b0c('0x1c')](_0x10db54);}};}function respondWithFilteredResult(_0x5148ec,_0x46cbc0){return function(_0x324531){if(_0x324531){var _0x150452=typeof _0x46cbc0['offset']===_0x5b0c('0x1d')&&typeof _0x46cbc0['limit']===_0x5b0c('0x1d');var _0x4ce01c=_0x324531[_0x5b0c('0x1e')];var _0x5b02ac=_0x150452?0x0:_0x46cbc0[_0x5b0c('0x1f')];var _0x7094b7=_0x150452?_0x324531['count']:_0x46cbc0['offset']+_0x46cbc0[_0x5b0c('0x20')];var _0x181fe0;if(_0x7094b7>=_0x4ce01c){_0x7094b7=_0x4ce01c;_0x181fe0=0xc8;}else{_0x181fe0=0xce;}_0x5148ec[_0x5b0c('0x1a')](_0x181fe0);return _0x5148ec[_0x5b0c('0x21')](_0x5b0c('0x22'),_0x5b02ac+'-'+_0x7094b7+'/'+_0x4ce01c)[_0x5b0c('0x1c')](_0x324531);}return null;};}function patchUpdates(_0x5561a7){return function(_0x1000f2){try{jsonpatch[_0x5b0c('0x23')](_0x1000f2,_0x5561a7,!![]);}catch(_0x3be0ea){return BPromise[_0x5b0c('0x24')](_0x3be0ea);}return _0x1000f2[_0x5b0c('0x25')]();};}function saveUpdates(_0x163250,_0x63d161){return function(_0xbbc5bc){if(_0xbbc5bc){return _0xbbc5bc[_0x5b0c('0x26')](_0x163250)[_0x5b0c('0x27')](function(_0x3449a8){return _0x3449a8;});}return null;};}function removeEntity(_0x553894,_0x7c5809){return function(_0xcb101f){if(_0xcb101f){return _0xcb101f['destroy']()[_0x5b0c('0x27')](function(){var _0xc659e6=_0xcb101f[_0x5b0c('0x28')]({'plain':!![]});var _0x454614='Lists';return db[_0x5b0c('0x29')]['destroy']({'where':{'type':_0x454614,'resourceId':_0xc659e6['id']}})[_0x5b0c('0x27')](function(){return _0xcb101f;});})[_0x5b0c('0x27')](function(){_0x553894[_0x5b0c('0x1a')](0xcc)[_0x5b0c('0x1b')]();});}};}function handleEntityNotFound(_0xdc2d94,_0x40a8d2){return function(_0x1f7475){if(!_0x1f7475){_0xdc2d94[_0x5b0c('0x2a')](0x194);}return _0x1f7475;};}function handleError(_0x593a19,_0x23df3f){_0x23df3f=_0x23df3f||0x1f4;return function(_0x27dd74){logger['error'](_0x27dd74[_0x5b0c('0x2b')]);if(_0x27dd74[_0x5b0c('0x2c')]){delete _0x27dd74['name'];}_0x593a19['status'](_0x23df3f)[_0x5b0c('0x2d')](_0x27dd74);};}exports[_0x5b0c('0x2e')]=function(_0x2278f2,_0x3c67f1){var _0x418757={},_0xc45ad4={},_0xe50f9c={'count':0x0,'rows':[]};var _0x554680=_[_0x5b0c('0x2f')](db[_0x5b0c('0x30')][_0x5b0c('0x31')],function(_0x403e23){return{'name':_0x403e23['fieldName'],'type':_0x403e23['type'][_0x5b0c('0x32')]};});_0xc45ad4[_0x5b0c('0x33')]=_[_0x5b0c('0x2f')](_0x554680,'name');_0xc45ad4[_0x5b0c('0x34')]=_['keys'](_0x2278f2[_0x5b0c('0x34')]);_0xc45ad4[_0x5b0c('0x35')]=_[_0x5b0c('0x36')](_0xc45ad4[_0x5b0c('0x33')],_0xc45ad4['query']);_0x418757[_0x5b0c('0x37')]=_[_0x5b0c('0x36')](_0xc45ad4[_0x5b0c('0x33')],qs[_0x5b0c('0x38')](_0x2278f2[_0x5b0c('0x34')]['fields']));_0x418757[_0x5b0c('0x37')]=_0x418757[_0x5b0c('0x37')][_0x5b0c('0x39')]?_0x418757['attributes']:_0xc45ad4[_0x5b0c('0x33')];if(!_0x2278f2[_0x5b0c('0x34')]['hasOwnProperty'](_0x5b0c('0x3a'))){_0x418757[_0x5b0c('0x20')]=qs[_0x5b0c('0x20')](_0x2278f2[_0x5b0c('0x34')][_0x5b0c('0x20')]);_0x418757['offset']=qs[_0x5b0c('0x1f')](_0x2278f2[_0x5b0c('0x34')][_0x5b0c('0x1f')]);}_0x418757[_0x5b0c('0x3b')]=qs[_0x5b0c('0x3c')](_0x2278f2[_0x5b0c('0x34')][_0x5b0c('0x3c')]);_0x418757[_0x5b0c('0x3d')]=qs[_0x5b0c('0x35')](_[_0x5b0c('0x3e')](_0x2278f2[_0x5b0c('0x34')],_0xc45ad4[_0x5b0c('0x35')]),_0x554680);if(_0x2278f2[_0x5b0c('0x34')][_0x5b0c('0x3f')]){_0x418757[_0x5b0c('0x3d')]=_[_0x5b0c('0x40')](_0x418757[_0x5b0c('0x3d')],{'$or':_[_0x5b0c('0x2f')](_0x554680,function(_0x47d63a){if(_0x47d63a[_0x5b0c('0x41')]!==_0x5b0c('0x42')){var _0x14619a={};_0x14619a[_0x47d63a[_0x5b0c('0x2c')]]={'$like':'%'+_0x2278f2[_0x5b0c('0x34')]['filter']+'%'};return _0x14619a;}})});}_0x418757=_[_0x5b0c('0x40')]({},_0x418757,_0x2278f2['options']);var _0x4092ad={'where':_0x418757[_0x5b0c('0x3d')]};return db[_0x5b0c('0x30')][_0x5b0c('0x1e')](_0x4092ad)['then'](function(_0x38fb73){_0xe50f9c['count']=_0x38fb73;if(_0x2278f2[_0x5b0c('0x34')][_0x5b0c('0x43')]){_0x418757[_0x5b0c('0x44')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x418757);})['then'](function(_0x2025b1){_0xe50f9c['rows']=_0x2025b1;return _0xe50f9c;})['then'](respondWithFilteredResult(_0x3c67f1,_0x418757))[_0x5b0c('0x45')](handleError(_0x3c67f1,null));};exports[_0x5b0c('0x46')]=function(_0x35c15e,_0x50b544){var _0x105bc7={'raw':![],'where':{'id':_0x35c15e[_0x5b0c('0x47')]['id']}},_0x1b6e46={};_0x1b6e46[_0x5b0c('0x33')]=_[_0x5b0c('0x48')](db[_0x5b0c('0x30')][_0x5b0c('0x31')]);_0x1b6e46[_0x5b0c('0x34')]=_['keys'](_0x35c15e['query']);_0x1b6e46[_0x5b0c('0x35')]=_['intersection'](_0x1b6e46['model'],_0x1b6e46['query']);_0x105bc7[_0x5b0c('0x37')]=_[_0x5b0c('0x36')](_0x1b6e46[_0x5b0c('0x33')],qs[_0x5b0c('0x38')](_0x35c15e[_0x5b0c('0x34')][_0x5b0c('0x38')]));_0x105bc7[_0x5b0c('0x37')]=_0x105bc7[_0x5b0c('0x37')][_0x5b0c('0x39')]?_0x105bc7[_0x5b0c('0x37')]:_0x1b6e46[_0x5b0c('0x33')];if(_0x35c15e[_0x5b0c('0x34')][_0x5b0c('0x43')]){_0x105bc7['include']=[{'all':!![]}];}_0x105bc7=_[_0x5b0c('0x40')]({},_0x105bc7,_0x35c15e['options']);return db[_0x5b0c('0x30')][_0x5b0c('0x49')](_0x105bc7)[_0x5b0c('0x27')](handleEntityNotFound(_0x50b544,null))[_0x5b0c('0x27')](respondWithResult(_0x50b544,null))[_0x5b0c('0x45')](handleError(_0x50b544,null));};exports[_0x5b0c('0x4a')]=function(_0x14bf1e,_0x4cc965){return db[_0x5b0c('0x30')]['create'](_0x14bf1e['body'],{})[_0x5b0c('0x27')](function(_0x320703){var _0x185f18=_0x14bf1e['user'][_0x5b0c('0x28')]({'plain':!![]});if(!_0x185f18)throw new Error(_0x5b0c('0x4b'));if(_0x185f18[_0x5b0c('0x4c')]===_0x5b0c('0x4d')){var _0x2419ec=_0x320703['get']({'plain':!![]});var _0x4a785e=_0x5b0c('0x4e');return db[_0x5b0c('0x4f')]['find']({'where':{'name':_0x4a785e,'userProfileId':_0x185f18[_0x5b0c('0x50')]},'raw':!![]})['then'](function(_0x568868){if(_0x568868&&_0x568868['autoAssociation']===0x0){return db[_0x5b0c('0x29')][_0x5b0c('0x4a')]({'name':_0x2419ec[_0x5b0c('0x2c')],'resourceId':_0x2419ec['id'],'type':_0x568868[_0x5b0c('0x2c')],'sectionId':_0x568868['id']},{})['then'](function(){return _0x320703;});}else{return _0x320703;}})['catch'](function(_0x15e4a0){logger['error'](_0x5b0c('0x51'),_0x15e4a0);throw _0x15e4a0;});}return _0x320703;})[_0x5b0c('0x27')](respondWithResult(_0x4cc965,0xc9))[_0x5b0c('0x45')](handleError(_0x4cc965,null));};exports[_0x5b0c('0x26')]=function(_0x2c9ed5,_0x4efa13){if(_0x2c9ed5['body']['id']){delete _0x2c9ed5[_0x5b0c('0x52')]['id'];}return db[_0x5b0c('0x30')]['find']({'where':{'id':_0x2c9ed5['params']['id']}})[_0x5b0c('0x27')](handleEntityNotFound(_0x4efa13,null))[_0x5b0c('0x27')](saveUpdates(_0x2c9ed5['body'],null))[_0x5b0c('0x27')](respondWithResult(_0x4efa13,null))[_0x5b0c('0x45')](handleError(_0x4efa13,null));};exports[_0x5b0c('0x53')]=function(_0x199a25,_0x536766){return db[_0x5b0c('0x30')]['find']({'where':{'id':_0x199a25[_0x5b0c('0x47')]['id']}})['then'](handleEntityNotFound(_0x536766,null))[_0x5b0c('0x27')](removeEntity(_0x536766,null))[_0x5b0c('0x45')](handleError(_0x536766,null));};exports['describe']=function(_0x1bc4ff,_0x1c7a2d){return db[_0x5b0c('0x30')]['describe']()['then'](respondWithResult(_0x1c7a2d,null))['catch'](handleError(_0x1c7a2d,null));};exports[_0x5b0c('0x54')]=function(_0x572175,_0x301df4,_0x3899f7){if(_0x572175[_0x5b0c('0x52')]['id']){delete _0x572175[_0x5b0c('0x52')]['id'];}return db[_0x5b0c('0x30')][_0x5b0c('0x49')]({'where':{'id':_0x572175[_0x5b0c('0x47')]['id']}})[_0x5b0c('0x27')](handleEntityNotFound(_0x301df4,null))[_0x5b0c('0x27')](function(_0x1969e3){if(_0x1969e3){_0x572175[_0x5b0c('0x52')][_0x5b0c('0x55')]=_0x1969e3['id'];return db['Disposition'][_0x5b0c('0x4a')](_0x572175[_0x5b0c('0x52')]);}})[_0x5b0c('0x27')](respondWithResult(_0x301df4,null))[_0x5b0c('0x45')](handleError(_0x301df4,null));};exports['getDispositions']=function(_0x3111ae,_0x48f59f,_0x4d8dc1){var _0x30df2d={'raw':![],'where':{}};var _0x1b55c5={};var _0x2e17b8={'count':0x0,'rows':[]};return db['CmList'][_0x5b0c('0x56')]({'where':{'id':_0x3111ae['params']['id']}})[_0x5b0c('0x27')](handleEntityNotFound(_0x48f59f,null))['then'](function(_0x86556f){if(_0x86556f){_0x1b55c5[_0x5b0c('0x33')]=_[_0x5b0c('0x48')](db[_0x5b0c('0x57')][_0x5b0c('0x31')]);_0x1b55c5[_0x5b0c('0x34')]=_[_0x5b0c('0x48')](_0x3111ae['query']);_0x1b55c5[_0x5b0c('0x35')]=_[_0x5b0c('0x36')](_0x1b55c5[_0x5b0c('0x33')],_0x1b55c5[_0x5b0c('0x34')]);_0x30df2d['attributes']=_['intersection'](_0x1b55c5['model'],qs[_0x5b0c('0x38')](_0x3111ae[_0x5b0c('0x34')][_0x5b0c('0x38')]));_0x30df2d['attributes']=_0x30df2d[_0x5b0c('0x37')][_0x5b0c('0x39')]?_0x30df2d['attributes']:_0x1b55c5['model'];if(!_0x3111ae['query']['hasOwnProperty']('nolimit')){_0x30df2d[_0x5b0c('0x20')]=qs['limit'](_0x3111ae[_0x5b0c('0x34')][_0x5b0c('0x20')]);_0x30df2d[_0x5b0c('0x1f')]=qs['offset'](_0x3111ae[_0x5b0c('0x34')]['offset']);}_0x30df2d[_0x5b0c('0x3b')]=qs[_0x5b0c('0x3c')](_0x3111ae[_0x5b0c('0x34')][_0x5b0c('0x3c')]);_0x30df2d[_0x5b0c('0x3d')]=qs['filters'](_[_0x5b0c('0x3e')](_0x3111ae[_0x5b0c('0x34')],_0x1b55c5['filters']));_0x30df2d[_0x5b0c('0x3d')][_0x5b0c('0x55')]=_0x86556f['id'];if(_0x3111ae[_0x5b0c('0x34')]['filter']){_0x30df2d[_0x5b0c('0x3d')]=_[_0x5b0c('0x40')](_0x30df2d['where'],{'$or':_[_0x5b0c('0x2f')](_0x30df2d[_0x5b0c('0x37')],function(_0x51420d){var _0x1301ce={};_0x1301ce[_0x51420d]={'$like':'%'+_0x3111ae[_0x5b0c('0x34')][_0x5b0c('0x3f')]+'%'};return _0x1301ce;})});}_0x30df2d=_['merge']({},_0x30df2d,_0x3111ae[_0x5b0c('0x58')]);return db[_0x5b0c('0x57')][_0x5b0c('0x1e')]({'where':_0x30df2d['where']})[_0x5b0c('0x27')](function(_0xf154c7){_0x2e17b8[_0x5b0c('0x1e')]=_0xf154c7;if(_0x3111ae['query']['includeAll']){_0x30df2d[_0x5b0c('0x44')]=[{'all':!![]}];}return db[_0x5b0c('0x57')]['findAll'](_0x30df2d);})[_0x5b0c('0x27')](function(_0x4929cd){_0x2e17b8[_0x5b0c('0x59')]=_0x4929cd;return _0x2e17b8;});}})['then'](respondWithFilteredResult(_0x48f59f,_0x30df2d))[_0x5b0c('0x45')](handleError(_0x48f59f,null));};exports[_0x5b0c('0x5a')]=function(_0x25f48a,_0x72d7dd,_0x20e6a8){return db[_0x5b0c('0x30')]['find']({'where':{'id':_0x25f48a[_0x5b0c('0x47')]['id']}})[_0x5b0c('0x27')](handleEntityNotFound(_0x72d7dd,null))['then'](function(_0x31f501){if(_0x31f501){return _0x31f501[_0x5b0c('0x5a')](_0x25f48a[_0x5b0c('0x34')][_0x5b0c('0x5b')]);}})[_0x5b0c('0x27')](respondWithStatusCode(_0x72d7dd,null))['catch'](handleError(_0x72d7dd,null));};exports['addContacts']=function(_0x5b8200,_0x2167b4,_0x1915b8){return db[_0x5b0c('0x30')][_0x5b0c('0x49')]({'where':{'id':_0x5b8200[_0x5b0c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2167b4,null))[_0x5b0c('0x27')](function(_0x3e49c5){if(_0x3e49c5){var _0x2ee5d0=[];var _0x240481={'success':[],'errors':[]};return db['CmContact'][_0x5b0c('0x5c')]()[_0x5b0c('0x27')](function(_0x2c8661){if(_0x5b8200[_0x5b0c('0x52')]['tags']&&_[_0x5b0c('0x5d')](_0x5b8200[_0x5b0c('0x52')][_0x5b0c('0x5e')])){if(_0x5b8200[_0x5b0c('0x52')][_0x5b0c('0x5e')]['length']){_0x5b8200[_0x5b0c('0x52')][_0x5b0c('0x5e')]=_0x5b8200[_0x5b0c('0x52')]['tags'][_0x5b0c('0x5f')](';')+';';}else{_0x5b8200[_0x5b0c('0x52')][_0x5b0c('0x5e')]=null;}}else{_0x5b8200['body']['tags']=null;}if(_0x5b8200[_0x5b0c('0x52')]&&_['isArray'](_0x5b8200[_0x5b0c('0x52')])){for(var _0x4613dc=0x0;_0x4613dc<_0x5b8200[_0x5b0c('0x52')][_0x5b0c('0x39')];_0x4613dc+=0x1){_0x5b8200[_0x5b0c('0x52')][_0x4613dc]['ListId']=_0x5b8200[_0x5b0c('0x47')]['id'];_0x2ee5d0[_0x5b0c('0x60')](_0x5b8200[_0x5b0c('0x52')][_0x4613dc]);}return BPromise[_0x5b0c('0x61')](_0x2ee5d0,function(_0x2cb660){return db[_0x5b0c('0x62')][_0x5b0c('0x4a')](_[_0x5b0c('0x63')](_0x2cb660,[_0x5b0c('0x5b'),'id'])||{},{'fields':_[_0x5b0c('0x48')](_0x2c8661),'raw':!![]})['then'](function(_0x5b0fa5){_0x240481['success'][_0x5b0c('0x60')](_0x5b0fa5[_0x5b0c('0x64')]);})[_0x5b0c('0x45')](function(_0x8f101){_0x240481['errors'][_0x5b0c('0x60')]({'data':_0x2cb660,'error':_0x8f101[_0x5b0c('0x65')]});});})['then'](function(_0x53b85a){return _0x240481;})[_0x5b0c('0x45')](function(_0x495dda){return _0x495dda;});}else{_0x2167b4[_0x5b0c('0x1a')](0x190)[_0x5b0c('0x1c')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x5b0c('0x27')](respondWithResult(_0x2167b4,null))[_0x5b0c('0x45')](handleError(_0x2167b4,null));};exports[_0x5b0c('0x66')]=function(_0x46beda,_0x1b1489,_0x493245){var _0x22b135;return db[_0x5b0c('0x30')][_0x5b0c('0x49')]({'where':{'id':_0x46beda['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x5b0c('0x67')}]})[_0x5b0c('0x27')](handleEntityNotFound(_0x1b1489,null))[_0x5b0c('0x27')](function(_0x2179f2){if(_0x2179f2){_0x22b135=_0x2179f2;return db[_0x5b0c('0x62')]['rawAttributes'];}})['then'](function(_0x1699e9){if(_0x1699e9){var _0x2116c2={};var _0x58cf97={};_0x58cf97['model']=_['concat'](_[_0x5b0c('0x48')](_0x1699e9),_[_0x5b0c('0x2f')](_0x22b135[_0x5b0c('0x67')],function(_0x39cf6d){return util[_0x5b0c('0x68')]('cf_%d',_0x39cf6d['id']);}));_0x58cf97['query']=_[_0x5b0c('0x48')](_0x46beda[_0x5b0c('0x34')]);_0x58cf97[_0x5b0c('0x35')]=_[_0x5b0c('0x36')](_0x58cf97['model'],_0x58cf97['query']);_0x2116c2[_0x5b0c('0x37')]=_[_0x5b0c('0x36')](_0x58cf97[_0x5b0c('0x33')],qs['fields'](_0x46beda['query'][_0x5b0c('0x38')]));_0x2116c2[_0x5b0c('0x37')]=_0x2116c2['attributes']['length']?_0x2116c2[_0x5b0c('0x37')]:_0x58cf97[_0x5b0c('0x33')];if(!_0x46beda[_0x5b0c('0x34')][_0x5b0c('0x69')]('nolimit')){_0x2116c2[_0x5b0c('0x20')]=qs[_0x5b0c('0x20')](_0x46beda['query']['limit']);_0x2116c2[_0x5b0c('0x1f')]=qs[_0x5b0c('0x1f')](_0x46beda[_0x5b0c('0x34')][_0x5b0c('0x1f')]);}_0x2116c2[_0x5b0c('0x3b')]=qs[_0x5b0c('0x3c')](_0x46beda[_0x5b0c('0x34')][_0x5b0c('0x3c')]);_0x2116c2[_0x5b0c('0x3d')]=qs[_0x5b0c('0x35')](_[_0x5b0c('0x3e')](_0x46beda[_0x5b0c('0x34')],_0x58cf97['filters']));_0x2116c2['raw']=!![];if(_0x46beda[_0x5b0c('0x34')][_0x5b0c('0x3f')]){_0x2116c2[_0x5b0c('0x3d')]=_[_0x5b0c('0x40')](_0x2116c2[_0x5b0c('0x3d')],{'$or':_[_0x5b0c('0x2f')](_0x2116c2[_0x5b0c('0x37')],function(_0x5b05ee){var _0x44befa={};_0x44befa[_0x5b05ee]={'$like':'%'+_0x46beda[_0x5b0c('0x34')][_0x5b0c('0x3f')]+'%'};return _0x44befa;})});}_0x2116c2=_[_0x5b0c('0x40')]({},_0x2116c2,_0x46beda['options']);return _0x22b135[_0x5b0c('0x66')](_0x2116c2);}})[_0x5b0c('0x27')](respondWithResult(_0x1b1489,null))[_0x5b0c('0x45')](handleError(_0x1b1489,null));};exports[_0x5b0c('0x6a')]=function(_0x1fddc3,_0x478753,_0x1b4829){var _0x17125c;return db[_0x5b0c('0x30')][_0x5b0c('0x49')]({'where':{'id':_0x1fddc3['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x5b0c('0x67')}]})['then'](handleEntityNotFound(_0x478753,null))[_0x5b0c('0x27')](function(_0x4291b8){if(_0x4291b8){_0x17125c=_0x4291b8;return db[_0x5b0c('0x62')][_0x5b0c('0x31')];}})[_0x5b0c('0x27')](function(_0x449328){if(_0x449328){var _0xe608a8={};var _0x4faf47={};_0x4faf47[_0x5b0c('0x33')]=_[_0x5b0c('0x6b')](_[_0x5b0c('0x48')](_0x449328),_[_0x5b0c('0x2f')](_0x17125c[_0x5b0c('0x67')],function(_0x34e29e){return util[_0x5b0c('0x68')](_0x5b0c('0x6c'),_0x34e29e['id']);}));_0x4faf47[_0x5b0c('0x34')]=_[_0x5b0c('0x48')](_0x1fddc3[_0x5b0c('0x34')]);_0x4faf47['filters']=_[_0x5b0c('0x36')](_0x4faf47[_0x5b0c('0x33')],_0x4faf47[_0x5b0c('0x34')]);_0xe608a8[_0x5b0c('0x37')]=_[_0x5b0c('0x36')](_0x4faf47[_0x5b0c('0x33')],qs['fields'](_0x1fddc3['query'][_0x5b0c('0x38')]));_0xe608a8['attributes']=_0xe608a8[_0x5b0c('0x37')][_0x5b0c('0x39')]?_0xe608a8['attributes']:_0x4faf47[_0x5b0c('0x33')];if(!_0x1fddc3[_0x5b0c('0x34')][_0x5b0c('0x69')](_0x5b0c('0x3a'))){_0xe608a8[_0x5b0c('0x20')]=qs[_0x5b0c('0x20')](_0x1fddc3[_0x5b0c('0x34')]['limit']);_0xe608a8[_0x5b0c('0x1f')]=qs['offset'](_0x1fddc3[_0x5b0c('0x34')]['offset']);}_0xe608a8[_0x5b0c('0x3b')]=qs[_0x5b0c('0x3c')](_0x1fddc3[_0x5b0c('0x34')][_0x5b0c('0x3c')]);_0xe608a8['where']=qs[_0x5b0c('0x35')](_[_0x5b0c('0x3e')](_0x1fddc3[_0x5b0c('0x34')],_0x4faf47[_0x5b0c('0x35')]));_0xe608a8['raw']=!![];if(_0x1fddc3[_0x5b0c('0x34')][_0x5b0c('0x3f')]){_0xe608a8[_0x5b0c('0x3d')]=_[_0x5b0c('0x40')](_0xe608a8['where'],{'$or':_[_0x5b0c('0x2f')](_0xe608a8[_0x5b0c('0x37')],function(_0x549f74){var _0x267773={};_0x267773[_0x549f74]={'$like':'%'+_0x1fddc3[_0x5b0c('0x34')][_0x5b0c('0x3f')]+'%'};return _0x267773;})});}_0xe608a8=_[_0x5b0c('0x40')]({},_0xe608a8,_0x1fddc3[_0x5b0c('0x58')]);return _0x17125c[_0x5b0c('0x66')](_0xe608a8);}})[_0x5b0c('0x27')](function(_0xcb39ad){if(!_[_0x5b0c('0x6d')](_0xcb39ad)){var _0x1bb377=toCsv(_0xcb39ad);var _0x46d3c8=Date[_0x5b0c('0x6e')]();fs[_0x5b0c('0x6f')](util[_0x5b0c('0x68')](_0x5b0c('0x70'),_0x17125c['id'],_0x46d3c8),_0x1bb377);_0x478753['setHeader']('Content-disposition',_0x5b0c('0x71')+util[_0x5b0c('0x68')](_0x5b0c('0x72'),_0x17125c['id'],_0x46d3c8));_0x478753[_0x5b0c('0x73')](_0x5b0c('0x74'),'text/csv');return _0x478753[_0x5b0c('0x75')](util[_0x5b0c('0x68')](_0x5b0c('0x70'),_0x17125c['id'],_0x46d3c8));}else{return _0x478753['sendStatus'](0xcc);}})[_0x5b0c('0x45')](handleError(_0x478753,null));};exports[_0x5b0c('0x76')]=function(_0x1ee091,_0x17ead6,_0x534d91){var _0x4075ea;delete _0x1ee091[_0x5b0c('0x52')]['id'];return db[_0x5b0c('0x30')]['findOne']({'where':{'id':_0x1ee091['params']['id']}})[_0x5b0c('0x27')](handleEntityNotFound(_0x17ead6,null))[_0x5b0c('0x27')](function(_0x557695){if(_0x557695){return db['sequelize'][_0x5b0c('0x77')](function(_0x130ed3){return db['CmCustomField'][_0x5b0c('0x4a')](_0x1ee091[_0x5b0c('0x52')],{'transaction':_0x130ed3})[_0x5b0c('0x27')](function(_0x596d14){_0x4075ea=_0x596d14;return _0x557695[_0x5b0c('0x78')](_0x596d14,{'transaction':_0x130ed3});})[_0x5b0c('0x27')](function(){var _0x1a1176={'type':db['Sequelize']['TEXT'],'transaction':_0x130ed3};switch(_0x1ee091[_0x5b0c('0x52')]['type']){case'text':_0x1a1176[_0x5b0c('0x41')]=db[_0x5b0c('0x79')][_0x5b0c('0x7a')];break;case _0x5b0c('0x7b'):_0x1a1176[_0x5b0c('0x41')]=db[_0x5b0c('0x79')][_0x5b0c('0x7c')];break;case _0x5b0c('0x7d'):_0x1a1176[_0x5b0c('0x41')]=db[_0x5b0c('0x79')]['BOOLEAN'];_0x1a1176[_0x5b0c('0x7e')]=![];break;default:}return db[_0x5b0c('0x7f')][_0x5b0c('0x80')][_0x5b0c('0x81')](_0x5b0c('0x82'),util['format']('cf_%s',_0x4075ea['id']),_0x1a1176);})[_0x5b0c('0x27')](function(){return _0x4075ea;});});}})[_0x5b0c('0x27')](respondWithResult(_0x17ead6,null))[_0x5b0c('0x45')](handleError(_0x17ead6,null));};exports[_0x5b0c('0x83')]=function(_0x88102d,_0x315b03,_0x11278b){var _0xc0f0cd={};var _0x204d39={};var _0x5f5397;var _0x28935c;return db[_0x5b0c('0x30')][_0x5b0c('0x56')]({'where':{'id':_0x88102d['params']['id']}})[_0x5b0c('0x27')](handleEntityNotFound(_0x315b03,null))[_0x5b0c('0x27')](function(_0x370e8f){if(_0x370e8f){_0x5f5397=_0x370e8f;_0x204d39[_0x5b0c('0x33')]=_[_0x5b0c('0x48')](db[_0x5b0c('0x84')][_0x5b0c('0x31')]);_0x204d39[_0x5b0c('0x34')]=_['keys'](_0x88102d[_0x5b0c('0x34')]);_0x204d39[_0x5b0c('0x35')]=_[_0x5b0c('0x36')](_0x204d39['model'],_0x204d39[_0x5b0c('0x34')]);_0xc0f0cd[_0x5b0c('0x37')]=_[_0x5b0c('0x36')](_0x204d39[_0x5b0c('0x33')],qs[_0x5b0c('0x38')](_0x88102d[_0x5b0c('0x34')][_0x5b0c('0x38')]));_0xc0f0cd['attributes']=_0xc0f0cd['attributes']['length']?_0xc0f0cd[_0x5b0c('0x37')]:_0x204d39[_0x5b0c('0x33')];_0xc0f0cd[_0x5b0c('0x3b')]=qs[_0x5b0c('0x3c')](_0x88102d[_0x5b0c('0x34')]['sort']);_0xc0f0cd['where']=qs[_0x5b0c('0x35')](_[_0x5b0c('0x3e')](_0x88102d[_0x5b0c('0x34')],_0x204d39[_0x5b0c('0x35')]));_0xc0f0cd[_0x5b0c('0x3d')]=_[_0x5b0c('0x40')](_0xc0f0cd[_0x5b0c('0x3d')],{'$or':[{'ListId':_0x370e8f['id']},{'ListId':null}]});if(_0x88102d[_0x5b0c('0x34')]['filter']){_0xc0f0cd[_0x5b0c('0x3d')]=_['merge'](_0xc0f0cd[_0x5b0c('0x3d')],{'$or':_['map'](_0xc0f0cd[_0x5b0c('0x37')],function(_0x3d4943){var _0x12f5d3={};_0x12f5d3[_0x3d4943]={'$like':'%'+_0x88102d[_0x5b0c('0x34')][_0x5b0c('0x3f')]+'%'};return _0x12f5d3;})});}_0xc0f0cd=_['merge']({},_0xc0f0cd,_0x88102d[_0x5b0c('0x58')]);return db[_0x5b0c('0x84')][_0x5b0c('0x85')](_0xc0f0cd);}})[_0x5b0c('0x27')](respondWithResult(_0x315b03,null))['catch'](handleError(_0x315b03,null));};exports[_0x5b0c('0x86')]=function(_0x1926e9,_0x2cf0e5,_0x3eaa15){return db[_0x5b0c('0x30')][_0x5b0c('0x49')]({'where':{'id':_0x1926e9[_0x5b0c('0x47')]['id']}})[_0x5b0c('0x27')](handleEntityNotFound(_0x2cf0e5,null))[_0x5b0c('0x27')](function(_0xaa2ab2){if(_0xaa2ab2){return _0xaa2ab2[_0x5b0c('0x86')](_0x1926e9['body'][_0x5b0c('0x5b')],_['omit'](_0x1926e9['body'],['ids','id'])||{})[_0x5b0c('0x87')](function(_0x436683){for(var _0x6fe69b=0x0;_0x6fe69b<_0x1926e9[_0x5b0c('0x52')][_0x5b0c('0x5b')][_0x5b0c('0x39')];_0x6fe69b+=0x1){socket[_0x5b0c('0x88')](_0x5b0c('0x89'),{'UserId':Number(_0x1926e9[_0x5b0c('0x52')][_0x5b0c('0x5b')][_0x6fe69b]),'CmListId':Number(_0x1926e9['params']['id'])});}return _0x436683;});}})[_0x5b0c('0x27')](respondWithResult(_0x2cf0e5,null))['catch'](handleError(_0x2cf0e5,null));};exports[_0x5b0c('0x8a')]=function(_0x18546b,_0xa14d89,_0x240d18){return db[_0x5b0c('0x30')][_0x5b0c('0x49')]({'where':{'id':_0x18546b['params']['id']}})['then'](handleEntityNotFound(_0xa14d89,null))[_0x5b0c('0x27')](function(_0x358ebc){if(_0x358ebc){return _0x358ebc[_0x5b0c('0x8a')](_0x18546b[_0x5b0c('0x34')][_0x5b0c('0x5b')])[_0x5b0c('0x27')](function(){if(_[_0x5b0c('0x5d')](_0x18546b['query'][_0x5b0c('0x5b')])){for(var _0x380b56=0x0;_0x380b56<_0x18546b[_0x5b0c('0x34')][_0x5b0c('0x5b')][_0x5b0c('0x39')];_0x380b56+=0x1){socket[_0x5b0c('0x88')]('userCmList:remove',{'UserId':Number(_0x18546b[_0x5b0c('0x34')]['ids'][_0x380b56]),'CmListId':Number(_0x18546b[_0x5b0c('0x47')]['id'])});}}else{socket[_0x5b0c('0x88')](_0x5b0c('0x8b'),{'UserId':Number(_0x18546b[_0x5b0c('0x34')]['ids']),'CmListId':Number(_0x18546b[_0x5b0c('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0xa14d89,null))['catch'](handleError(_0xa14d89,null));};exports['getAgents']=function(_0x23f5ec,_0x9929f2,_0x30dd35){var _0x5e382d={};var _0x579371={};var _0x2b6788;var _0x3c9e54;return db[_0x5b0c('0x30')][_0x5b0c('0x56')]({'where':{'id':_0x23f5ec[_0x5b0c('0x47')]['id']}})['then'](handleEntityNotFound(_0x9929f2,null))['then'](function(_0x142c00){if(_0x142c00){_0x2b6788=_0x142c00;_0x579371[_0x5b0c('0x33')]=_['keys'](db['User'][_0x5b0c('0x31')]);_0x579371[_0x5b0c('0x34')]=_[_0x5b0c('0x48')](_0x23f5ec['query']);_0x579371[_0x5b0c('0x35')]=_[_0x5b0c('0x36')](_0x579371[_0x5b0c('0x33')],_0x579371['query']);_0x5e382d[_0x5b0c('0x37')]=_[_0x5b0c('0x36')](_0x579371[_0x5b0c('0x33')],qs[_0x5b0c('0x38')](_0x23f5ec[_0x5b0c('0x34')][_0x5b0c('0x38')]));_0x5e382d[_0x5b0c('0x37')]=_0x5e382d[_0x5b0c('0x37')][_0x5b0c('0x39')]?_0x5e382d[_0x5b0c('0x37')]:_0x579371[_0x5b0c('0x33')];_0x5e382d[_0x5b0c('0x3b')]=qs[_0x5b0c('0x3c')](_0x23f5ec[_0x5b0c('0x34')][_0x5b0c('0x3c')]);_0x5e382d[_0x5b0c('0x3d')]=qs[_0x5b0c('0x35')](_[_0x5b0c('0x3e')](_0x23f5ec['query'],_0x579371[_0x5b0c('0x35')]));if(_0x23f5ec[_0x5b0c('0x34')][_0x5b0c('0x3f')]){_0x5e382d[_0x5b0c('0x3d')]=_[_0x5b0c('0x40')](_0x5e382d[_0x5b0c('0x3d')],{'$or':_[_0x5b0c('0x2f')](_0x5e382d[_0x5b0c('0x37')],function(_0x15c4d8){var _0x5ede0d={};_0x5ede0d[_0x15c4d8]={'$like':'%'+_0x23f5ec[_0x5b0c('0x34')]['filter']+'%'};return _0x5ede0d;})});}_0x5e382d=_[_0x5b0c('0x40')]({},_0x5e382d,_0x23f5ec[_0x5b0c('0x58')]);return _0x2b6788[_0x5b0c('0x8c')](_0x5e382d);}})[_0x5b0c('0x27')](function(_0x4a21dd){if(_0x4a21dd){_0x3c9e54=_0x4a21dd[_0x5b0c('0x39')];if(!_0x23f5ec[_0x5b0c('0x34')][_0x5b0c('0x69')](_0x5b0c('0x3a'))){_0x5e382d[_0x5b0c('0x20')]=qs[_0x5b0c('0x20')](_0x23f5ec[_0x5b0c('0x34')][_0x5b0c('0x20')]);_0x5e382d['offset']=qs[_0x5b0c('0x1f')](_0x23f5ec[_0x5b0c('0x34')]['offset']);}return _0x2b6788[_0x5b0c('0x8c')](_0x5e382d);}})[_0x5b0c('0x27')](function(_0x63b6cf){if(_0x63b6cf){return _0x63b6cf?{'count':_0x3c9e54,'rows':_0x63b6cf}:null;}})[_0x5b0c('0x27')](respondWithResult(_0x9929f2,null))[_0x5b0c('0x45')](handleError(_0x9929f2,null));};
\ No newline at end of file
index c16e895..049b927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x4bfe08,_0x48ae7b){var _0x1f9125=function(_0x11450e){while(--_0x11450e){_0x4bfe08['push'](_0x4bfe08['shift']());}};_0x1f9125(++_0x48ae7b);}(_0x7217,0x19e));var _0x7721=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x7217[_0x3899d1];return _0xeb4a7d;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents;
\ No newline at end of file
+var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x5fc3[_0x34021d];return _0x16597b;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
index 9ece4a7..fd5a7cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x20bfab,_0x34b2ef){var _0x55bbf2=function(_0x2fa094){while(--_0x2fa094){_0x20bfab['push'](_0x20bfab['shift']());}};_0x55bbf2(++_0x34b2ef);}(_0x5ff3,0x17d));var _0x35ff=function(_0x4fed2f,_0xa7c0ee){_0x4fed2f=_0x4fed2f-0x0;var _0x598075=_0x5ff3[_0x4fed2f];return _0x598075;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55e0=['./cmList.attributes','exports','define','cm_lists','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x55e0,0xdc));var _0x055e=function(_0x3421ac,_0x3228b5){_0x3421ac=_0x3421ac-0x0;var _0x16c2d2=_0x55e0[_0x3421ac];return _0x16c2d2;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x055e('0x4'));var fs=require('fs');var path=require(_0x055e('0x5'));var rimraf=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var attributes=require(_0x055e('0x8'));module[_0x055e('0x9')]=function(_0x490ee1,_0x5239f6){return _0x490ee1[_0x055e('0xa')]('CmList',attributes,{'tableName':_0x055e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24637b1..6e6773f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a9e=['debug','CmList,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0x7a9e,0x88));var _0xe7a9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7a9e[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xe7a9('0x0'));var util=require(_0xe7a9('0x1'));var moment=require(_0xe7a9('0x2'));var BPromise=require(_0xe7a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7a9('0x5'))(_0xe7a9('0x6'));var config=require(_0xe7a9('0x7'));var jayson=require(_0xe7a9('0x8'));var client=jayson['client'][_0xe7a9('0x9')]({'port':0x232a});config[_0xe7a9('0xa')]=_[_0xe7a9('0xb')](config[_0xe7a9('0xa')],{'host':_0xe7a9('0xc'),'port':0x18eb});var socket=require(_0xe7a9('0xd'))(new Redis(config[_0xe7a9('0xa')]));require(_0xe7a9('0xe'))['register'](socket);function respondWithRpcPromise(_0x50ce0c,_0x490e18,_0x487a01){return new BPromise(function(_0x48672f,_0x4392f5){return client[_0xe7a9('0xf')](_0x50ce0c,_0x487a01)[_0xe7a9('0x10')](function(_0x140acf){logger[_0xe7a9('0x11')](_0xe7a9('0x12'),_0x490e18,_0xe7a9('0x13'));logger[_0xe7a9('0x14')](_0xe7a9('0x15'),_0x490e18,'request\x20sent',JSON['stringify'](_0x140acf));if(_0x140acf['error']){if(_0x140acf['error']['code']===0x1f4){logger['error'](_0xe7a9('0x12'),_0x490e18,_0x140acf[_0xe7a9('0x16')][_0xe7a9('0x17')]);return _0x4392f5(_0x140acf[_0xe7a9('0x16')][_0xe7a9('0x17')]);}logger[_0xe7a9('0x16')](_0xe7a9('0x12'),_0x490e18,_0x140acf[_0xe7a9('0x16')][_0xe7a9('0x17')]);return _0x48672f(_0x140acf[_0xe7a9('0x16')][_0xe7a9('0x17')]);}else{logger['info'](_0xe7a9('0x12'),_0x490e18,_0xe7a9('0x13'));_0x48672f(_0x140acf[_0xe7a9('0x18')][_0xe7a9('0x17')]);}})[_0xe7a9('0x19')](function(_0x54de8d){logger[_0xe7a9('0x16')]('CmList,\x20%s,\x20%s',_0x490e18,_0x54de8d);_0x4392f5(_0x54de8d);});});}
\ No newline at end of file
+var _0x9641=['./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x22aadd,_0x3a0f58){var _0x54e9e9=function(_0x2f4a3e){while(--_0x2f4a3e){_0x22aadd['push'](_0x22aadd['shift']());}};_0x54e9e9(++_0x3a0f58);}(_0x9641,0x75));var _0x1964=function(_0x34204b,_0x3f91e9){_0x34204b=_0x34204b-0x0;var _0x24e995=_0x9641[_0x34204b];return _0x24e995;};'use strict';var _=require(_0x1964('0x0'));var util=require('util');var moment=require(_0x1964('0x1'));var BPromise=require(_0x1964('0x2'));var rs=require(_0x1964('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1964('0x4'))['db'];var utils=require(_0x1964('0x5'));var logger=require('../../config/logger')(_0x1964('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1964('0x7')][_0x1964('0x8')]({'port':0x232a});config['redis']=_[_0x1964('0x9')](config[_0x1964('0xa')],{'host':_0x1964('0xb'),'port':0x18eb});var socket=require(_0x1964('0xc'))(new Redis(config[_0x1964('0xa')]));require(_0x1964('0xd'))[_0x1964('0xe')](socket);function respondWithRpcPromise(_0x3f7672,_0x383d46,_0x2bb928){return new BPromise(function(_0x3a9f45,_0x161684){return client['request'](_0x3f7672,_0x2bb928)[_0x1964('0xf')](function(_0x3bc484){logger[_0x1964('0x10')](_0x1964('0x11'),_0x383d46,'request\x20sent');logger['debug'](_0x1964('0x12'),_0x383d46,_0x1964('0x13'),JSON[_0x1964('0x14')](_0x3bc484));if(_0x3bc484[_0x1964('0x15')]){if(_0x3bc484[_0x1964('0x15')][_0x1964('0x16')]===0x1f4){logger['error'](_0x1964('0x11'),_0x383d46,_0x3bc484[_0x1964('0x15')][_0x1964('0x17')]);return _0x161684(_0x3bc484[_0x1964('0x15')]['message']);}logger[_0x1964('0x15')](_0x1964('0x11'),_0x383d46,_0x3bc484['error']['message']);return _0x3a9f45(_0x3bc484['error'][_0x1964('0x17')]);}else{logger['info'](_0x1964('0x11'),_0x383d46,_0x1964('0x13'));_0x3a9f45(_0x3bc484[_0x1964('0x18')][_0x1964('0x17')]);}})[_0x1964('0x19')](function(_0x39f7d0){logger['error'](_0x1964('0x11'),_0x383d46,_0x39f7d0);_0x161684(_0x39f7d0);});});}
\ No newline at end of file
index 1e8cc94..b109976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x915e=['save','remove','update','emit','removeListener','length','cmList:'];(function(_0x43b370,_0xdcf77d){var _0x5201c4=function(_0x2d6734){while(--_0x2d6734){_0x43b370['push'](_0x43b370['shift']());}};_0x5201c4(++_0xdcf77d);}(_0x915e,0xd2));var _0xe915=function(_0x169d89,_0x3c3090){_0x169d89=_0x169d89-0x0;var _0x5e876a=_0x915e[_0x169d89];return _0x5e876a;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xe915('0x0'),_0xe915('0x1'),_0xe915('0x2')];function createListener(_0x55c1ba,_0x53a4a6){return function(_0x264914){_0x53a4a6[_0xe915('0x3')](_0x55c1ba,_0x264914);};}function removeListener(_0x45b671,_0xffbac0){return function(){CmListEvents[_0xe915('0x4')](_0x45b671,_0xffbac0);};}exports['register']=function(_0x5d7a30){for(var _0x2273a9=0x0,_0x22279d=events[_0xe915('0x5')];_0x2273a9<_0x22279d;_0x2273a9++){var _0x2a874d=events[_0x2273a9];var _0x47f49b=createListener(_0xe915('0x6')+_0x2a874d,_0x5d7a30);CmListEvents['on'](_0x2a874d,_0x47f49b);}};
\ No newline at end of file
+var _0x386c=['register','length','cmList:','./cmList.events','remove','update','emit','removeListener'];(function(_0x244857,_0x549d34){var _0xdfbd3c=function(_0x2dd2b3){while(--_0x2dd2b3){_0x244857['push'](_0x244857['shift']());}};_0xdfbd3c(++_0x549d34);}(_0x386c,0x1bb));var _0xc386=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x386c[_0x178e48];return _0x440d7e;};'use strict';var CmListEvents=require(_0xc386('0x0'));var events=['save',_0xc386('0x1'),_0xc386('0x2')];function createListener(_0x3e892e,_0x1a0690){return function(_0xb681fd){_0x1a0690[_0xc386('0x3')](_0x3e892e,_0xb681fd);};}function removeListener(_0x1047d2,_0x53cbbf){return function(){CmListEvents[_0xc386('0x4')](_0x1047d2,_0x53cbbf);};}exports[_0xc386('0x5')]=function(_0xe622d6){for(var _0x44bd02=0x0,_0x3fca5e=events[_0xc386('0x6')];_0x44bd02<_0x3fca5e;_0x44bd02++){var _0x457e33=events[_0x44bd02];var _0x542e60=createListener(_0xc386('0x7')+_0x457e33,_0xe622d6);CmListEvents['on'](_0x457e33,_0x542e60);}};
\ No newline at end of file
index 4a33d78..a808975 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f96=['update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','/:id/dispositions','addDisposition','addCustomField','put'];(function(_0x1d16be,_0x3f1d65){var _0x27877e=function(_0x1f3211){while(--_0x1f3211){_0x1d16be['push'](_0x1d16be['shift']());}};_0x27877e(++_0x3f1d65);}(_0x1f96,0xed));var _0x61f9=function(_0x15e644,_0x70297e){_0x15e644=_0x15e644-0x0;var _0x458b23=_0x1f96[_0x15e644];return _0x458b23;};'use strict';var multer=require('multer');var util=require(_0x61f9('0x0'));var path=require(_0x61f9('0x1'));var timeout=require(_0x61f9('0x2'));var express=require(_0x61f9('0x3'));var router=express[_0x61f9('0x4')]();var fs_extra=require(_0x61f9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x61f9('0x6'));var config=require(_0x61f9('0x7'));var controller=require('./cmList.controller');router[_0x61f9('0x8')]('/',auth[_0x61f9('0x9')](),controller[_0x61f9('0xa')]);router[_0x61f9('0x8')]('/describe',auth[_0x61f9('0x9')](),controller[_0x61f9('0xb')]);router[_0x61f9('0x8')](_0x61f9('0xc'),auth[_0x61f9('0x9')](),controller[_0x61f9('0xd')]);router[_0x61f9('0x8')]('/:id/dispositions',auth[_0x61f9('0x9')](),controller['getDispositions']);router[_0x61f9('0x8')](_0x61f9('0xe'),auth[_0x61f9('0x9')](),controller[_0x61f9('0xf')]);router[_0x61f9('0x8')]('/:id/contacts/csv',auth[_0x61f9('0x9')](),controller[_0x61f9('0x10')]);router[_0x61f9('0x8')](_0x61f9('0x11'),auth[_0x61f9('0x9')](),controller[_0x61f9('0x12')]);router['get'](_0x61f9('0x13'),auth[_0x61f9('0x9')](),controller[_0x61f9('0x14')]);router['post']('/',auth[_0x61f9('0x9')](),controller[_0x61f9('0x15')]);router[_0x61f9('0x16')](_0x61f9('0x17'),auth[_0x61f9('0x9')](),controller[_0x61f9('0x18')]);router['post'](_0x61f9('0xe'),auth[_0x61f9('0x9')](),controller['addContacts']);router[_0x61f9('0x16')](_0x61f9('0x11'),auth['isAuthenticated'](),controller[_0x61f9('0x19')]);router['post'](_0x61f9('0x13'),auth[_0x61f9('0x9')](),controller['addAgents']);router[_0x61f9('0x1a')](_0x61f9('0xc'),auth['isAuthenticated'](),controller[_0x61f9('0x1b')]);router[_0x61f9('0x1c')](_0x61f9('0xc'),auth['isAuthenticated'](),controller[_0x61f9('0x1d')]);router[_0x61f9('0x1c')](_0x61f9('0x17'),auth['isAuthenticated'](),controller[_0x61f9('0x1e')]);router['delete'](_0x61f9('0x13'),auth[_0x61f9('0x9')](),controller[_0x61f9('0x1f')]);module[_0x61f9('0x20')]=router;
\ No newline at end of file
+var _0x688c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','/:id/users','addAgents','delete','multer'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x688c,0xa9));var _0xc688=function(_0x6dba45,_0xf92d0a){_0x6dba45=_0x6dba45-0x0;var _0xbe9f78=_0x688c[_0x6dba45];return _0xbe9f78;};'use strict';var multer=require(_0xc688('0x0'));var util=require('util');var path=require(_0xc688('0x1'));var timeout=require(_0xc688('0x2'));var express=require(_0xc688('0x3'));var router=express[_0xc688('0x4')]();var fs_extra=require(_0xc688('0x5'));var auth=require(_0xc688('0x6'));var interaction=require(_0xc688('0x7'));var config=require(_0xc688('0x8'));var controller=require(_0xc688('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc688('0xa')]);router[_0xc688('0xb')](_0xc688('0xc'),auth[_0xc688('0xd')](),controller[_0xc688('0xe')]);router[_0xc688('0xb')](_0xc688('0xf'),auth[_0xc688('0xd')](),controller[_0xc688('0x10')]);router[_0xc688('0xb')](_0xc688('0x11'),auth[_0xc688('0xd')](),controller[_0xc688('0x12')]);router[_0xc688('0xb')]('/:id/contacts',auth[_0xc688('0xd')](),controller[_0xc688('0x13')]);router['get'](_0xc688('0x14'),auth[_0xc688('0xd')](),controller[_0xc688('0x15')]);router[_0xc688('0xb')](_0xc688('0x16'),auth[_0xc688('0xd')](),controller[_0xc688('0x17')]);router[_0xc688('0xb')]('/:id/users',auth['isAuthenticated'](),controller[_0xc688('0x18')]);router[_0xc688('0x19')]('/',auth['isAuthenticated'](),controller[_0xc688('0x1a')]);router[_0xc688('0x19')]('/:id/dispositions',auth[_0xc688('0xd')](),controller[_0xc688('0x1b')]);router[_0xc688('0x19')](_0xc688('0x1c'),auth[_0xc688('0xd')](),controller[_0xc688('0x1d')]);router[_0xc688('0x19')](_0xc688('0x16'),auth[_0xc688('0xd')](),controller[_0xc688('0x1e')]);router[_0xc688('0x19')](_0xc688('0x1f'),auth[_0xc688('0xd')](),controller[_0xc688('0x20')]);router['put'](_0xc688('0xf'),auth[_0xc688('0xd')](),controller['update']);router['delete'](_0xc688('0xf'),auth[_0xc688('0xd')](),controller['destroy']);router['delete'](_0xc688('0x11'),auth[_0xc688('0xd')](),controller['removeDispositions']);router[_0xc688('0x21')](_0xc688('0x1f'),auth[_0xc688('0xd')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 0a5f5c8..1498f69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a35=['sequelize','VIRTUAL','getDataValue','field','STRING'];(function(_0x338f03,_0x28941b){var _0x514d7e=function(_0x417fba){while(--_0x417fba){_0x338f03['push'](_0x338f03['shift']());}};_0x514d7e(++_0x28941b);}(_0x2a35,0x122));var _0x52a3=function(_0xc7157a,_0x531b8c){_0xc7157a=_0xc7157a-0x0;var _0x595aad=_0x2a35[_0xc7157a];return _0x595aad;};'use strict';var Sequelize=require(_0x52a3('0x0'));module['exports']={'name':{'type':Sequelize[_0x52a3('0x1')],'get':function(_0x4e831a){return this[_0x52a3('0x2')](_0x52a3('0x3'));}},'field':{'type':Sequelize[_0x52a3('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x52a3('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x223e=['VIRTUAL','getDataValue','STRING','sequelize','exports'];(function(_0x3b5bee,_0x5aa74d){var _0x486d58=function(_0x8ab1f7){while(--_0x8ab1f7){_0x3b5bee['push'](_0x3b5bee['shift']());}};_0x486d58(++_0x5aa74d);}(_0x223e,0x1cf));var _0xe223=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x223e[_0x42f009];return _0x22a1e0;};'use strict';var Sequelize=require(_0xe223('0x0'));module[_0xe223('0x1')]={'name':{'type':Sequelize[_0xe223('0x2')],'get':function(_0x33022){return this[_0xe223('0x3')]('field');}},'field':{'type':Sequelize[_0xe223('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xe223('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xe223('0x4')],'allowNull':![]}};
\ No newline at end of file
index 8edfc85..817e157 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(_0x2573d0,_0x5a9850){var _0xa75fc4=function(_0x2b79ee){while(--_0x2b79ee){_0x2573d0['push'](_0x2573d0['shift']());}};_0xa75fc4(++_0x5a9850);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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(_0x10159d,_0x4ca01f){var _0x586ae1=function(_0x564b1e){while(--_0x564b1e){_0x10159d['push'](_0x10159d['shift']());}};_0x586ae1(++_0x4ca01f);}(_0x7a54,0x106));var _0x47a5=function(_0x220b9e,_0x46bf44){_0x220b9e=_0x220b9e-0x0;var _0x5d9e73=_0x7a54[_0x220b9e];return _0x5d9e73;};'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 54e2092..0f2123f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0254=['bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','define','lodash','api','moment'];(function(_0x20e13b,_0x3f7cd9){var _0x44d9d3=function(_0x8f1a5b){while(--_0x8f1a5b){_0x20e13b['push'](_0x20e13b['shift']());}};_0x44d9d3(++_0x3f7cd9);}(_0x0254,0xed));var _0x4025=function(_0x1f5650,_0x581f4d){_0x1f5650=_0x1f5650-0x0;var _0x20ec89=_0x0254[_0x1f5650];return _0x20ec89;};'use strict';var _=require(_0x4025('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4025('0x1'));var moment=require(_0x4025('0x2'));var BPromise=require(_0x4025('0x3'));var rp=require(_0x4025('0x4'));var fs=require('fs');var path=require(_0x4025('0x5'));var rimraf=require('rimraf');var config=require(_0x4025('0x6'));var attributes=require(_0x4025('0x7'));module[_0x4025('0x8')]=function(_0x32048f,_0x10e77b){return _0x32048f[_0x4025('0x9')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7897=['path','rimraf','../../config/environment','./condition.attributes','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4826b7,_0x28aa1d){var _0xe07c3f=function(_0x5971d1){while(--_0x5971d1){_0x4826b7['push'](_0x4826b7['shift']());}};_0xe07c3f(++_0x28aa1d);}(_0x7897,0xae));var _0x7789=function(_0x2ae640,_0x182f3d){_0x2ae640=_0x2ae640-0x0;var _0x2f80d7=_0x7897[_0x2ae640];return _0x2f80d7;};'use strict';var _=require(_0x7789('0x0'));var util=require(_0x7789('0x1'));var logger=require(_0x7789('0x2'))('api');var moment=require(_0x7789('0x3'));var BPromise=require(_0x7789('0x4'));var rp=require(_0x7789('0x5'));var fs=require('fs');var path=require(_0x7789('0x6'));var rimraf=require(_0x7789('0x7'));var config=require(_0x7789('0x8'));var attributes=require(_0x7789('0x9'));module['exports']=function(_0x38435e,_0x152cd1){return _0x38435e['define']('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6914029..aa80a5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd0e=['request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbd0e,0x170));var _0xebd0=function(_0x414658,_0x32591f){_0x414658=_0x414658-0x0;var _0x3f33b8=_0xbd0e[_0x414658];return _0x3f33b8;};'use strict';var _=require(_0xebd0('0x0'));var util=require('util');var moment=require(_0xebd0('0x1'));var BPromise=require(_0xebd0('0x2'));var rs=require(_0xebd0('0x3'));var fs=require('fs');var Redis=require(_0xebd0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xebd0('0x5'));var logger=require('../../config/logger')(_0xebd0('0x6'));var config=require(_0xebd0('0x7'));var jayson=require(_0xebd0('0x8'));var client=jayson['client'][_0xebd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17b61c,_0xe98a2b,_0x4ec9a6){return new BPromise(function(_0x20ee92,_0x3d876a){return client[_0xebd0('0xa')](_0x17b61c,_0x4ec9a6)[_0xebd0('0xb')](function(_0x4f704b){logger[_0xebd0('0xc')](_0xebd0('0xd'),_0xe98a2b,'request\x20sent');logger[_0xebd0('0xe')](_0xebd0('0xf'),_0xe98a2b,_0xebd0('0x10'),JSON[_0xebd0('0x11')](_0x4f704b));if(_0x4f704b[_0xebd0('0x12')]){if(_0x4f704b['error']['code']===0x1f4){logger[_0xebd0('0x12')](_0xebd0('0xd'),_0xe98a2b,_0x4f704b['error'][_0xebd0('0x13')]);return _0x3d876a(_0x4f704b[_0xebd0('0x12')][_0xebd0('0x13')]);}logger[_0xebd0('0x12')](_0xebd0('0xd'),_0xe98a2b,_0x4f704b[_0xebd0('0x12')]['message']);return _0x20ee92(_0x4f704b[_0xebd0('0x12')][_0xebd0('0x13')]);}else{logger['info'](_0xebd0('0xd'),_0xe98a2b,_0xebd0('0x10'));_0x20ee92(_0x4f704b[_0xebd0('0x14')]['message']);}})['catch'](function(_0x4db90c){logger[_0xebd0('0x12')](_0xebd0('0xd'),_0xe98a2b,_0x4db90c);_0x3d876a(_0x4db90c);});});}
\ No newline at end of file
+var _0xb2f5=['error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x25e88e,_0x1fbcd4){var _0xeead36=function(_0x16ab8f){while(--_0x16ab8f){_0x25e88e['push'](_0x25e88e['shift']());}};_0xeead36(++_0x1fbcd4);}(_0xb2f5,0x7c));var _0x5b2f=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xb2f5[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0x5b2f('0x0'));var util=require(_0x5b2f('0x1'));var moment=require(_0x5b2f('0x2'));var BPromise=require(_0x5b2f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b2f('0x4'));var db=require(_0x5b2f('0x5'))['db'];var utils=require(_0x5b2f('0x6'));var logger=require(_0x5b2f('0x7'))(_0x5b2f('0x8'));var config=require(_0x5b2f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5b2f('0xa')][_0x5b2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dd7eb,_0xedd2f5,_0x5cc6ca){return new BPromise(function(_0x546c7d,_0x9ccd93){return client[_0x5b2f('0xc')](_0x4dd7eb,_0x5cc6ca)[_0x5b2f('0xd')](function(_0x4f261a){logger[_0x5b2f('0xe')](_0x5b2f('0xf'),_0xedd2f5,'request\x20sent');logger[_0x5b2f('0x10')](_0x5b2f('0x11'),_0xedd2f5,_0x5b2f('0x12'),JSON[_0x5b2f('0x13')](_0x4f261a));if(_0x4f261a[_0x5b2f('0x14')]){if(_0x4f261a[_0x5b2f('0x14')][_0x5b2f('0x15')]===0x1f4){logger['error'](_0x5b2f('0xf'),_0xedd2f5,_0x4f261a[_0x5b2f('0x14')][_0x5b2f('0x16')]);return _0x9ccd93(_0x4f261a[_0x5b2f('0x14')][_0x5b2f('0x16')]);}logger[_0x5b2f('0x14')](_0x5b2f('0xf'),_0xedd2f5,_0x4f261a[_0x5b2f('0x14')][_0x5b2f('0x16')]);return _0x546c7d(_0x4f261a[_0x5b2f('0x14')][_0x5b2f('0x16')]);}else{logger[_0x5b2f('0xe')]('Condition,\x20%s,\x20%s',_0xedd2f5,_0x5b2f('0x12'));_0x546c7d(_0x4f261a[_0x5b2f('0x17')][_0x5b2f('0x16')]);}})['catch'](function(_0xf6a0c0){logger[_0x5b2f('0x14')](_0x5b2f('0xf'),_0xedd2f5,_0xf6a0c0);_0x9ccd93(_0xf6a0c0);});});}
\ No newline at end of file
index 6227057..029efb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcfc=['./condition.controller','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x31d016,_0x4f9c85){var _0x4cb27b=function(_0x16179b){while(--_0x16179b){_0x31d016['push'](_0x31d016['shift']());}};_0x4cb27b(++_0x4f9c85);}(_0xfcfc,0x1c7));var _0xcfcf=function(_0x5a166a,_0x4aab51){_0x5a166a=_0x5a166a-0x0;var _0x2dbd53=_0xfcfc[_0x5a166a];return _0x2dbd53;};'use strict';var multer=require(_0xcfcf('0x0'));var util=require(_0xcfcf('0x1'));var path=require('path');var timeout=require(_0xcfcf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcfcf('0x3'));var auth=require(_0xcfcf('0x4'));var interaction=require(_0xcfcf('0x5'));var config=require(_0xcfcf('0x6'));var controller=require(_0xcfcf('0x7'));router['put']('/:id',auth[_0xcfcf('0x8')](),controller[_0xcfcf('0x9')]);router[_0xcfcf('0xa')](_0xcfcf('0xb'),auth[_0xcfcf('0x8')](),controller[_0xcfcf('0xc')]);module[_0xcfcf('0xd')]=router;
\ No newline at end of file
+var _0x21a0=['delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x3578aa,_0x28f55a){var _0x2f267f=function(_0x52b9c8){while(--_0x52b9c8){_0x3578aa['push'](_0x3578aa['shift']());}};_0x2f267f(++_0x28f55a);}(_0x21a0,0x84));var _0x021a=function(_0x42506c,_0x2a1044){_0x42506c=_0x42506c-0x0;var _0x5c9464=_0x21a0[_0x42506c];return _0x5c9464;};'use strict';var multer=require(_0x021a('0x0'));var util=require(_0x021a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x021a('0x2'));var router=express[_0x021a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x021a('0x4'));var interaction=require(_0x021a('0x5'));var config=require('../../config/environment');var controller=require(_0x021a('0x6'));router[_0x021a('0x7')](_0x021a('0x8'),auth[_0x021a('0x9')](),controller[_0x021a('0xa')]);router[_0x021a('0xb')](_0x021a('0x8'),auth[_0x021a('0x9')](),controller[_0x021a('0xc')]);module['exports']=router;
\ No newline at end of file
index 0c5c98e..981bb02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfe2=['INTEGER','exports','STRING','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcfe2,0x9d));var _0x2cfe=function(_0x2eec1b,_0x5f4faf){_0x2eec1b=_0x2eec1b-0x0;var _0x3973ef=_0xcfe2[_0x2eec1b];return _0x3973ef;};'use strict';var Sequelize=require('sequelize');module[_0x2cfe('0x0')]={'name':{'type':Sequelize[_0x2cfe('0x1')],'allowNull':![],'unique':_0x2cfe('0x2')},'OrderBy':{'type':Sequelize[_0x2cfe('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x2cfe('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0xdfd4=['INTEGER','sequelize','exports','STRING'];(function(_0x4f96ec,_0x203eec){var _0x52f867=function(_0x504b5b){while(--_0x504b5b){_0x4f96ec['push'](_0x4f96ec['shift']());}};_0x52f867(++_0x203eec);}(_0xdfd4,0x1ad));var _0x4dfd=function(_0x2fc764,_0x24d9f1){_0x2fc764=_0x2fc764-0x0;var _0x265ead=_0xdfd4[_0x2fc764];return _0x265ead;};'use strict';var Sequelize=require(_0x4dfd('0x0'));module[_0x4dfd('0x1')]={'name':{'type':Sequelize[_0x4dfd('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x4dfd('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x4dfd('0x2')],'allowNull':!![]}};
\ No newline at end of file
index ed9bc6f..c163bd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3990=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','name','map','ContactItemType','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter'];(function(_0xb68695,_0x1881a4){var _0x15a817=function(_0x4d04d6){while(--_0x4d04d6){_0xb68695['push'](_0xb68695['shift']());}};_0x15a817(++_0x1881a4);}(_0x3990,0xb7));var _0x0399=function(_0x137935,_0x199bf2){_0x137935=_0x137935-0x0;var _0x5ebdef=_0x3990[_0x137935];return _0x5ebdef;};'use strict';var emlformat=require(_0x0399('0x0'));var rimraf=require(_0x0399('0x1'));var zipdir=require(_0x0399('0x2'));var jsonpatch=require(_0x0399('0x3'));var rp=require('request-promise');var moment=require(_0x0399('0x4'));var BPromise=require(_0x0399('0x5'));var Mustache=require(_0x0399('0x6'));var util=require(_0x0399('0x7'));var path=require('path');var sox=require(_0x0399('0x8'));var csv=require(_0x0399('0x9'));var ejs=require(_0x0399('0xa'));var fs=require('fs');var fs_extra=require(_0x0399('0xb'));var _=require('lodash');var squel=require(_0x0399('0xc'));var crypto=require(_0x0399('0xd'));var jsforce=require(_0x0399('0xe'));var deskjs=require(_0x0399('0xf'));var toCsv=require(_0x0399('0x9'));var querystring=require('querystring');var Papa=require(_0x0399('0x10'));var Redis=require(_0x0399('0x11'));var authService=require(_0x0399('0x12'));var qs=require(_0x0399('0x13'));var as=require(_0x0399('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0399('0x15'))(_0x0399('0x16'));var utils=require(_0x0399('0x17'));var config=require(_0x0399('0x18'));var licenseUtil=require(_0x0399('0x19'));var db=require(_0x0399('0x1a'))['db'];function respondWithStatusCode(_0x537710,_0xa35286){_0xa35286=_0xa35286||0xcc;return function(_0x3909be){if(_0x3909be){return _0x537710[_0x0399('0x1b')](_0xa35286);}return _0x537710[_0x0399('0x1c')](_0xa35286)['end']();};}function respondWithResult(_0x44fff8,_0xaf3a53){_0xaf3a53=_0xaf3a53||0xc8;return function(_0xbc45c3){if(_0xbc45c3){return _0x44fff8[_0x0399('0x1c')](_0xaf3a53)[_0x0399('0x1d')](_0xbc45c3);}};}function respondWithFilteredResult(_0x2565b4,_0x20f84c){return function(_0x56224f){if(_0x56224f){var _0x5026c5=typeof _0x20f84c[_0x0399('0x1e')]===_0x0399('0x1f')&&typeof _0x20f84c[_0x0399('0x20')]===_0x0399('0x1f');var _0x57d1f5=_0x56224f[_0x0399('0x21')];var _0x1b5d11=_0x5026c5?0x0:_0x20f84c[_0x0399('0x1e')];var _0x21b365=_0x5026c5?_0x56224f[_0x0399('0x21')]:_0x20f84c[_0x0399('0x1e')]+_0x20f84c[_0x0399('0x20')];var _0x5c4128;if(_0x21b365>=_0x57d1f5){_0x21b365=_0x57d1f5;_0x5c4128=0xc8;}else{_0x5c4128=0xce;}_0x2565b4['status'](_0x5c4128);return _0x2565b4[_0x0399('0x22')]('Content-Range',_0x1b5d11+'-'+_0x21b365+'/'+_0x57d1f5)[_0x0399('0x1d')](_0x56224f);}return null;};}function patchUpdates(_0x37052b){return function(_0x46eaa8){try{jsonpatch[_0x0399('0x23')](_0x46eaa8,_0x37052b,!![]);}catch(_0x5607e1){return BPromise[_0x0399('0x24')](_0x5607e1);}return _0x46eaa8[_0x0399('0x25')]();};}function saveUpdates(_0xbd67e2,_0x314228){return function(_0x1b7e20){if(_0x1b7e20){return _0x1b7e20['update'](_0xbd67e2)['then'](function(_0x21f3b0){return _0x21f3b0;});}return null;};}function removeEntity(_0x47e193,_0x8257a6){return function(_0x4a3a8a){if(_0x4a3a8a){return _0x4a3a8a['destroy']()[_0x0399('0x26')](function(){var _0x4a311e=_0x4a3a8a['get']({'plain':!![]});var _0x117846='ContactItemTypes';return db['UserProfileResource'][_0x0399('0x27')]({'where':{'type':_0x117846,'resourceId':_0x4a311e['id']}})[_0x0399('0x26')](function(){return _0x4a3a8a;});})['then'](function(){_0x47e193['status'](0xcc)[_0x0399('0x28')]();});}};}function handleEntityNotFound(_0x3075c1,_0x10be97){return function(_0x241224){if(!_0x241224){_0x3075c1['sendStatus'](0x194);}return _0x241224;};}function handleError(_0x1f3cdb,_0xf5ac80){_0xf5ac80=_0xf5ac80||0x1f4;return function(_0x230bfc){logger[_0x0399('0x29')](_0x230bfc['stack']);if(_0x230bfc[_0x0399('0x2a')]){delete _0x230bfc[_0x0399('0x2a')];}_0x1f3cdb[_0x0399('0x1c')](_0xf5ac80)['send'](_0x230bfc);};}exports['index']=function(_0x4a4414,_0x11d718){var _0x4bc1e8={},_0x2275e3={},_0x261179={'count':0x0,'rows':[]};var _0x343a67=_[_0x0399('0x2b')](db[_0x0399('0x2c')][_0x0399('0x2d')],function(_0x4436d5){return{'name':_0x4436d5[_0x0399('0x2e')],'type':_0x4436d5[_0x0399('0x2f')]['key']};});_0x2275e3['model']=_[_0x0399('0x2b')](_0x343a67,_0x0399('0x2a'));_0x2275e3[_0x0399('0x30')]=_['keys'](_0x4a4414['query']);_0x2275e3[_0x0399('0x31')]=_[_0x0399('0x32')](_0x2275e3[_0x0399('0x33')],_0x2275e3[_0x0399('0x30')]);_0x4bc1e8[_0x0399('0x34')]=_['intersection'](_0x2275e3['model'],qs[_0x0399('0x35')](_0x4a4414['query']['fields']));_0x4bc1e8[_0x0399('0x34')]=_0x4bc1e8[_0x0399('0x34')][_0x0399('0x36')]?_0x4bc1e8[_0x0399('0x34')]:_0x2275e3[_0x0399('0x33')];if(!_0x4a4414[_0x0399('0x30')]['hasOwnProperty']('nolimit')){_0x4bc1e8['limit']=qs[_0x0399('0x20')](_0x4a4414['query'][_0x0399('0x20')]);_0x4bc1e8['offset']=qs['offset'](_0x4a4414[_0x0399('0x30')][_0x0399('0x1e')]);}_0x4bc1e8[_0x0399('0x37')]=qs[_0x0399('0x38')](_0x4a4414[_0x0399('0x30')][_0x0399('0x38')]);_0x4bc1e8[_0x0399('0x39')]=qs[_0x0399('0x31')](_[_0x0399('0x3a')](_0x4a4414['query'],_0x2275e3[_0x0399('0x31')]),_0x343a67);if(_0x4a4414[_0x0399('0x30')][_0x0399('0x3b')]){_0x4bc1e8['where']=_[_0x0399('0x3c')](_0x4bc1e8[_0x0399('0x39')],{'$or':_[_0x0399('0x2b')](_0x343a67,function(_0x4a6ae1){if(_0x4a6ae1[_0x0399('0x2f')]!==_0x0399('0x3d')){var _0x26e6fb={};_0x26e6fb[_0x4a6ae1[_0x0399('0x2a')]]={'$like':'%'+_0x4a4414[_0x0399('0x30')][_0x0399('0x3b')]+'%'};return _0x26e6fb;}})});}_0x4bc1e8=_[_0x0399('0x3c')]({},_0x4bc1e8,_0x4a4414[_0x0399('0x3e')]);var _0x15f4cc={'where':_0x4bc1e8[_0x0399('0x39')]};return db['ContactItemType'][_0x0399('0x21')](_0x15f4cc)[_0x0399('0x26')](function(_0x1cc6c6){_0x261179['count']=_0x1cc6c6;if(_0x4a4414['query'][_0x0399('0x3f')]){_0x4bc1e8[_0x0399('0x40')]=[{'all':!![]}];}return db[_0x0399('0x2c')][_0x0399('0x41')](_0x4bc1e8);})['then'](function(_0x198d93){_0x261179[_0x0399('0x42')]=_0x198d93;return _0x261179;})[_0x0399('0x26')](respondWithFilteredResult(_0x11d718,_0x4bc1e8))[_0x0399('0x43')](handleError(_0x11d718,null));};exports[_0x0399('0x44')]=function(_0x3361f7,_0x82dbf1){var _0x2fd368={'raw':!![],'where':{'id':_0x3361f7[_0x0399('0x45')]['id']}},_0x15b58a={};_0x15b58a[_0x0399('0x33')]=_[_0x0399('0x46')](db[_0x0399('0x2c')][_0x0399('0x2d')]);_0x15b58a[_0x0399('0x30')]=_['keys'](_0x3361f7['query']);_0x15b58a[_0x0399('0x31')]=_[_0x0399('0x32')](_0x15b58a['model'],_0x15b58a[_0x0399('0x30')]);_0x2fd368['attributes']=_[_0x0399('0x32')](_0x15b58a['model'],qs[_0x0399('0x35')](_0x3361f7[_0x0399('0x30')][_0x0399('0x35')]));_0x2fd368[_0x0399('0x34')]=_0x2fd368[_0x0399('0x34')]['length']?_0x2fd368[_0x0399('0x34')]:_0x15b58a[_0x0399('0x33')];if(_0x3361f7[_0x0399('0x30')][_0x0399('0x3f')]){_0x2fd368['include']=[{'all':!![]}];}_0x2fd368=_[_0x0399('0x3c')]({},_0x2fd368,_0x3361f7[_0x0399('0x3e')]);return db[_0x0399('0x2c')][_0x0399('0x47')](_0x2fd368)['then'](handleEntityNotFound(_0x82dbf1,null))[_0x0399('0x26')](respondWithResult(_0x82dbf1,null))[_0x0399('0x43')](handleError(_0x82dbf1,null));};exports['create']=function(_0x5d6b50,_0xae4878){return db[_0x0399('0x2c')]['create'](_0x5d6b50[_0x0399('0x48')],{})[_0x0399('0x26')](function(_0x3f64f2){var _0x2836f8=_0x5d6b50[_0x0399('0x49')][_0x0399('0x4a')]({'plain':!![]});if(!_0x2836f8)throw new Error(_0x0399('0x4b'));if(_0x2836f8[_0x0399('0x4c')]===_0x0399('0x49')){var _0x28a808=_0x3f64f2[_0x0399('0x4a')]({'plain':!![]});var _0x5d7425=_0x0399('0x4d');return db['UserProfileSection'][_0x0399('0x47')]({'where':{'name':_0x5d7425,'userProfileId':_0x2836f8['userProfileId']},'raw':!![]})[_0x0399('0x26')](function(_0xcc87c5){if(_0xcc87c5&&_0xcc87c5['autoAssociation']===0x0){return db[_0x0399('0x4e')]['create']({'name':_0x28a808[_0x0399('0x2a')],'resourceId':_0x28a808['id'],'type':_0xcc87c5['name'],'sectionId':_0xcc87c5['id']},{})[_0x0399('0x26')](function(){return _0x3f64f2;});}else{return _0x3f64f2;}})[_0x0399('0x43')](function(_0x525f39){logger['error'](_0x0399('0x4f'),_0x525f39);throw _0x525f39;});}return _0x3f64f2;})['then'](respondWithResult(_0xae4878,0xc9))['catch'](handleError(_0xae4878,null));};exports[_0x0399('0x50')]=function(_0x107d28,_0x1e9147){if(_0x107d28[_0x0399('0x48')]['id']){delete _0x107d28[_0x0399('0x48')]['id'];}return db[_0x0399('0x2c')][_0x0399('0x47')]({'where':{'id':_0x107d28[_0x0399('0x45')]['id']}})[_0x0399('0x26')](handleEntityNotFound(_0x1e9147,null))[_0x0399('0x26')](saveUpdates(_0x107d28[_0x0399('0x48')],null))[_0x0399('0x26')](respondWithResult(_0x1e9147,null))['catch'](handleError(_0x1e9147,null));};exports[_0x0399('0x27')]=function(_0x482c8d,_0x551281){return db[_0x0399('0x2c')]['find']({'where':{'id':_0x482c8d[_0x0399('0x45')]['id']}})['then'](handleEntityNotFound(_0x551281,null))[_0x0399('0x26')](removeEntity(_0x551281,null))[_0x0399('0x43')](handleError(_0x551281,null));};
\ No newline at end of file
+var _0x3bea=['error','stack','name','send','index','map','ContactItemType','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','ContactItemTypes'];(function(_0x337581,_0x32f492){var _0x1623a8=function(_0x58f463){while(--_0x58f463){_0x337581['push'](_0x337581['shift']());}};_0x1623a8(++_0x32f492);}(_0x3bea,0x11d));var _0xa3be=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3bea[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xa3be('0x0'));var rimraf=require(_0xa3be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa3be('0x2'));var rp=require(_0xa3be('0x3'));var moment=require('moment');var BPromise=require(_0xa3be('0x4'));var Mustache=require('mustache');var util=require(_0xa3be('0x5'));var path=require(_0xa3be('0x6'));var sox=require(_0xa3be('0x7'));var csv=require(_0xa3be('0x8'));var ejs=require(_0xa3be('0x9'));var fs=require('fs');var fs_extra=require(_0xa3be('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa3be('0x8'));var querystring=require(_0xa3be('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa3be('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3be('0xd'));var logger=require(_0xa3be('0xe'))(_0xa3be('0xf'));var utils=require(_0xa3be('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa3be('0x11'))['db'];function respondWithStatusCode(_0x4c12d1,_0x15eeca){_0x15eeca=_0x15eeca||0xcc;return function(_0x4a5393){if(_0x4a5393){return _0x4c12d1[_0xa3be('0x12')](_0x15eeca);}return _0x4c12d1[_0xa3be('0x13')](_0x15eeca)[_0xa3be('0x14')]();};}function respondWithResult(_0xe59873,_0x276ad8){_0x276ad8=_0x276ad8||0xc8;return function(_0xf9bbd5){if(_0xf9bbd5){return _0xe59873[_0xa3be('0x13')](_0x276ad8)[_0xa3be('0x15')](_0xf9bbd5);}};}function respondWithFilteredResult(_0x25d44f,_0x129e1f){return function(_0x4b9a2f){if(_0x4b9a2f){var _0x5e9f76=typeof _0x129e1f[_0xa3be('0x16')]===_0xa3be('0x17')&&typeof _0x129e1f['limit']===_0xa3be('0x17');var _0x268dfc=_0x4b9a2f[_0xa3be('0x18')];var _0x125c15=_0x5e9f76?0x0:_0x129e1f[_0xa3be('0x16')];var _0x44e059=_0x5e9f76?_0x4b9a2f[_0xa3be('0x18')]:_0x129e1f[_0xa3be('0x16')]+_0x129e1f[_0xa3be('0x19')];var _0x23b893;if(_0x44e059>=_0x268dfc){_0x44e059=_0x268dfc;_0x23b893=0xc8;}else{_0x23b893=0xce;}_0x25d44f['status'](_0x23b893);return _0x25d44f[_0xa3be('0x1a')](_0xa3be('0x1b'),_0x125c15+'-'+_0x44e059+'/'+_0x268dfc)['json'](_0x4b9a2f);}return null;};}function patchUpdates(_0x50fac1){return function(_0x2d83c3){try{jsonpatch['apply'](_0x2d83c3,_0x50fac1,!![]);}catch(_0x435e72){return BPromise[_0xa3be('0x1c')](_0x435e72);}return _0x2d83c3[_0xa3be('0x1d')]();};}function saveUpdates(_0x31b532,_0x1284a2){return function(_0x1a38db){if(_0x1a38db){return _0x1a38db[_0xa3be('0x1e')](_0x31b532)['then'](function(_0x3b741){return _0x3b741;});}return null;};}function removeEntity(_0x3842fe,_0x5ab206){return function(_0x4ba945){if(_0x4ba945){return _0x4ba945[_0xa3be('0x1f')]()[_0xa3be('0x20')](function(){var _0x242237=_0x4ba945[_0xa3be('0x21')]({'plain':!![]});var _0x1d5c42=_0xa3be('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x1d5c42,'resourceId':_0x242237['id']}})[_0xa3be('0x20')](function(){return _0x4ba945;});})[_0xa3be('0x20')](function(){_0x3842fe[_0xa3be('0x13')](0xcc)[_0xa3be('0x14')]();});}};}function handleEntityNotFound(_0x3f5b07,_0x25af84){return function(_0x123834){if(!_0x123834){_0x3f5b07['sendStatus'](0x194);}return _0x123834;};}function handleError(_0x206e97,_0x512fff){_0x512fff=_0x512fff||0x1f4;return function(_0x193f62){logger[_0xa3be('0x23')](_0x193f62[_0xa3be('0x24')]);if(_0x193f62[_0xa3be('0x25')]){delete _0x193f62[_0xa3be('0x25')];}_0x206e97[_0xa3be('0x13')](_0x512fff)[_0xa3be('0x26')](_0x193f62);};}exports[_0xa3be('0x27')]=function(_0x2483ba,_0x376b54){var _0x15fb72={},_0x56ed08={},_0x507447={'count':0x0,'rows':[]};var _0x30b721=_[_0xa3be('0x28')](db[_0xa3be('0x29')]['rawAttributes'],function(_0x973f8){return{'name':_0x973f8[_0xa3be('0x2a')],'type':_0x973f8[_0xa3be('0x2b')][_0xa3be('0x2c')]};});_0x56ed08[_0xa3be('0x2d')]=_['map'](_0x30b721,'name');_0x56ed08[_0xa3be('0x2e')]=_[_0xa3be('0x2f')](_0x2483ba['query']);_0x56ed08['filters']=_['intersection'](_0x56ed08[_0xa3be('0x2d')],_0x56ed08[_0xa3be('0x2e')]);_0x15fb72['attributes']=_[_0xa3be('0x30')](_0x56ed08[_0xa3be('0x2d')],qs[_0xa3be('0x31')](_0x2483ba['query'][_0xa3be('0x31')]));_0x15fb72[_0xa3be('0x32')]=_0x15fb72[_0xa3be('0x32')][_0xa3be('0x33')]?_0x15fb72[_0xa3be('0x32')]:_0x56ed08['model'];if(!_0x2483ba[_0xa3be('0x2e')][_0xa3be('0x34')](_0xa3be('0x35'))){_0x15fb72[_0xa3be('0x19')]=qs[_0xa3be('0x19')](_0x2483ba[_0xa3be('0x2e')][_0xa3be('0x19')]);_0x15fb72[_0xa3be('0x16')]=qs[_0xa3be('0x16')](_0x2483ba[_0xa3be('0x2e')][_0xa3be('0x16')]);}_0x15fb72[_0xa3be('0x36')]=qs[_0xa3be('0x37')](_0x2483ba[_0xa3be('0x2e')]['sort']);_0x15fb72[_0xa3be('0x38')]=qs[_0xa3be('0x39')](_[_0xa3be('0x3a')](_0x2483ba[_0xa3be('0x2e')],_0x56ed08[_0xa3be('0x39')]),_0x30b721);if(_0x2483ba[_0xa3be('0x2e')][_0xa3be('0x3b')]){_0x15fb72[_0xa3be('0x38')]=_[_0xa3be('0x3c')](_0x15fb72[_0xa3be('0x38')],{'$or':_[_0xa3be('0x28')](_0x30b721,function(_0x4cfc7d){if(_0x4cfc7d[_0xa3be('0x2b')]!==_0xa3be('0x3d')){var _0x26dfd4={};_0x26dfd4[_0x4cfc7d['name']]={'$like':'%'+_0x2483ba[_0xa3be('0x2e')][_0xa3be('0x3b')]+'%'};return _0x26dfd4;}})});}_0x15fb72=_[_0xa3be('0x3c')]({},_0x15fb72,_0x2483ba[_0xa3be('0x3e')]);var _0x6cef44={'where':_0x15fb72[_0xa3be('0x38')]};return db['ContactItemType'][_0xa3be('0x18')](_0x6cef44)[_0xa3be('0x20')](function(_0x483f66){_0x507447[_0xa3be('0x18')]=_0x483f66;if(_0x2483ba['query'][_0xa3be('0x3f')]){_0x15fb72[_0xa3be('0x40')]=[{'all':!![]}];}return db['ContactItemType'][_0xa3be('0x41')](_0x15fb72);})[_0xa3be('0x20')](function(_0x15e122){_0x507447[_0xa3be('0x42')]=_0x15e122;return _0x507447;})['then'](respondWithFilteredResult(_0x376b54,_0x15fb72))[_0xa3be('0x43')](handleError(_0x376b54,null));};exports[_0xa3be('0x44')]=function(_0x3d744b,_0x1d60bd){var _0xadc2a9={'raw':!![],'where':{'id':_0x3d744b[_0xa3be('0x45')]['id']}},_0x138011={};_0x138011[_0xa3be('0x2d')]=_[_0xa3be('0x2f')](db['ContactItemType'][_0xa3be('0x46')]);_0x138011['query']=_[_0xa3be('0x2f')](_0x3d744b[_0xa3be('0x2e')]);_0x138011[_0xa3be('0x39')]=_['intersection'](_0x138011['model'],_0x138011[_0xa3be('0x2e')]);_0xadc2a9[_0xa3be('0x32')]=_[_0xa3be('0x30')](_0x138011[_0xa3be('0x2d')],qs[_0xa3be('0x31')](_0x3d744b[_0xa3be('0x2e')]['fields']));_0xadc2a9['attributes']=_0xadc2a9[_0xa3be('0x32')]['length']?_0xadc2a9[_0xa3be('0x32')]:_0x138011[_0xa3be('0x2d')];if(_0x3d744b[_0xa3be('0x2e')][_0xa3be('0x3f')]){_0xadc2a9['include']=[{'all':!![]}];}_0xadc2a9=_[_0xa3be('0x3c')]({},_0xadc2a9,_0x3d744b[_0xa3be('0x3e')]);return db[_0xa3be('0x29')]['find'](_0xadc2a9)[_0xa3be('0x20')](handleEntityNotFound(_0x1d60bd,null))[_0xa3be('0x20')](respondWithResult(_0x1d60bd,null))['catch'](handleError(_0x1d60bd,null));};exports['create']=function(_0x2bc8a7,_0x4c4779){return db[_0xa3be('0x29')][_0xa3be('0x47')](_0x2bc8a7[_0xa3be('0x48')],{})[_0xa3be('0x20')](function(_0x1f1031){var _0x5ade5d=_0x2bc8a7[_0xa3be('0x49')][_0xa3be('0x21')]({'plain':!![]});if(!_0x5ade5d)throw new Error(_0xa3be('0x4a'));if(_0x5ade5d[_0xa3be('0x4b')]==='user'){var _0x27c945=_0x1f1031[_0xa3be('0x21')]({'plain':!![]});var _0x2b97ad=_0xa3be('0x22');return db[_0xa3be('0x4c')]['find']({'where':{'name':_0x2b97ad,'userProfileId':_0x5ade5d[_0xa3be('0x4d')]},'raw':!![]})[_0xa3be('0x20')](function(_0x52341f){if(_0x52341f&&_0x52341f['autoAssociation']===0x0){return db['UserProfileResource'][_0xa3be('0x47')]({'name':_0x27c945['name'],'resourceId':_0x27c945['id'],'type':_0x52341f[_0xa3be('0x25')],'sectionId':_0x52341f['id']},{})[_0xa3be('0x20')](function(){return _0x1f1031;});}else{return _0x1f1031;}})['catch'](function(_0x200b0c){logger['error'](_0xa3be('0x4e'),_0x200b0c);throw _0x200b0c;});}return _0x1f1031;})[_0xa3be('0x20')](respondWithResult(_0x4c4779,0xc9))[_0xa3be('0x43')](handleError(_0x4c4779,null));};exports[_0xa3be('0x1e')]=function(_0x364dd7,_0x521021){if(_0x364dd7[_0xa3be('0x48')]['id']){delete _0x364dd7[_0xa3be('0x48')]['id'];}return db[_0xa3be('0x29')][_0xa3be('0x4f')]({'where':{'id':_0x364dd7['params']['id']}})['then'](handleEntityNotFound(_0x521021,null))[_0xa3be('0x20')](saveUpdates(_0x364dd7[_0xa3be('0x48')],null))['then'](respondWithResult(_0x521021,null))[_0xa3be('0x43')](handleError(_0x521021,null));};exports['destroy']=function(_0x1bed1c,_0x2c76e8){return db['ContactItemType'][_0xa3be('0x4f')]({'where':{'id':_0x1bed1c['params']['id']}})[_0xa3be('0x20')](handleEntityNotFound(_0x2c76e8,null))[_0xa3be('0x20')](removeEntity(_0x2c76e8,null))['catch'](handleError(_0x2c76e8,null));};
\ No newline at end of file
index 7c0132f..b206ce7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51ba=['ContactItemType','tools_contact_item_types','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x51ba,0x92));var _0xa51b=function(_0x3d6f40,_0x864758){_0x3d6f40=_0x3d6f40-0x0;var _0x5004bf=_0x51ba[_0x3d6f40];return _0x5004bf;};'use strict';var _=require(_0xa51b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa51b('0x1'));var moment=require(_0xa51b('0x2'));var BPromise=require(_0xa51b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa51b('0x4'));var rimraf=require(_0xa51b('0x5'));var config=require(_0xa51b('0x6'));var attributes=require(_0xa51b('0x7'));module[_0xa51b('0x8')]=function(_0x3d07e1,_0x4e94df){return _0x3d07e1[_0xa51b('0x9')](_0xa51b('0xa'),attributes,{'tableName':_0xa51b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4cd9=['exports','tools_contact_item_types','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x39e15b,_0x555185){var _0x4e5766=function(_0x45ef45){while(--_0x45ef45){_0x39e15b['push'](_0x39e15b['shift']());}};_0x4e5766(++_0x555185);}(_0x4cd9,0x98));var _0x94cd=function(_0xdd62e3,_0x257fe9){_0xdd62e3=_0xdd62e3-0x0;var _0x3e10b5=_0x4cd9[_0xdd62e3];return _0x3e10b5;};'use strict';var _=require(_0x94cd('0x0'));var util=require('util');var logger=require(_0x94cd('0x1'))(_0x94cd('0x2'));var moment=require(_0x94cd('0x3'));var BPromise=require(_0x94cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94cd('0x5'));var rimraf=require(_0x94cd('0x6'));var config=require(_0x94cd('0x7'));var attributes=require('./contactItemType.attributes');module[_0x94cd('0x8')]=function(_0x4bc8f9,_0x34b4fc){return _0x4bc8f9['define']('ContactItemType',attributes,{'tableName':_0x94cd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bc9c335..cea2224 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6900=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x6900,0x189));var _0x0690=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x6900[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x0690('0x0'));var util=require(_0x0690('0x1'));var moment=require(_0x0690('0x2'));var BPromise=require(_0x0690('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0690('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0690('0x5'));var logger=require(_0x0690('0x6'))(_0x0690('0x7'));var config=require(_0x0690('0x8'));var jayson=require(_0x0690('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5dc015,_0x55067c,_0x4edf8e){return new BPromise(function(_0x212112,_0x1595be){return client[_0x0690('0xa')](_0x5dc015,_0x4edf8e)[_0x0690('0xb')](function(_0x6dcde6){logger[_0x0690('0xc')](_0x0690('0xd'),_0x55067c,_0x0690('0xe'));logger['debug'](_0x0690('0xf'),_0x55067c,_0x0690('0xe'),JSON[_0x0690('0x10')](_0x6dcde6));if(_0x6dcde6[_0x0690('0x11')]){if(_0x6dcde6[_0x0690('0x11')][_0x0690('0x12')]===0x1f4){logger[_0x0690('0x11')]('ContactItemType,\x20%s,\x20%s',_0x55067c,_0x6dcde6['error'][_0x0690('0x13')]);return _0x1595be(_0x6dcde6['error'][_0x0690('0x13')]);}logger[_0x0690('0x11')]('ContactItemType,\x20%s,\x20%s',_0x55067c,_0x6dcde6[_0x0690('0x11')][_0x0690('0x13')]);return _0x212112(_0x6dcde6[_0x0690('0x11')][_0x0690('0x13')]);}else{logger[_0x0690('0xc')](_0x0690('0xd'),_0x55067c,_0x0690('0xe'));_0x212112(_0x6dcde6[_0x0690('0x14')][_0x0690('0x13')]);}})['catch'](function(_0x4bfdd5){logger[_0x0690('0x11')](_0x0690('0xd'),_0x55067c,_0x4bfdd5);_0x1595be(_0x4bfdd5);});});}
\ No newline at end of file
+var _0x09e1=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x539ae5,_0x58a7b0){var _0x52f155=function(_0x82f686){while(--_0x82f686){_0x539ae5['push'](_0x539ae5['shift']());}};_0x52f155(++_0x58a7b0);}(_0x09e1,0x9d));var _0x109e=function(_0x2f5e62,_0x59f646){_0x2f5e62=_0x2f5e62-0x0;var _0x5f1d4e=_0x09e1[_0x2f5e62];return _0x5f1d4e;};'use strict';var _=require(_0x109e('0x0'));var util=require('util');var moment=require(_0x109e('0x1'));var BPromise=require(_0x109e('0x2'));var rs=require(_0x109e('0x3'));var fs=require('fs');var Redis=require(_0x109e('0x4'));var db=require(_0x109e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x109e('0x6'))(_0x109e('0x7'));var config=require('../../config/environment');var jayson=require(_0x109e('0x8'));var client=jayson['client'][_0x109e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30b164,_0x2c6b89,_0xf4ffa2){return new BPromise(function(_0x353142,_0x44fade){return client[_0x109e('0xa')](_0x30b164,_0xf4ffa2)[_0x109e('0xb')](function(_0x33bb62){logger['info']('ContactItemType,\x20%s,\x20%s',_0x2c6b89,_0x109e('0xc'));logger[_0x109e('0xd')](_0x109e('0xe'),_0x2c6b89,_0x109e('0xc'),JSON[_0x109e('0xf')](_0x33bb62));if(_0x33bb62[_0x109e('0x10')]){if(_0x33bb62['error'][_0x109e('0x11')]===0x1f4){logger['error'](_0x109e('0x12'),_0x2c6b89,_0x33bb62[_0x109e('0x10')][_0x109e('0x13')]);return _0x44fade(_0x33bb62[_0x109e('0x10')][_0x109e('0x13')]);}logger[_0x109e('0x10')](_0x109e('0x12'),_0x2c6b89,_0x33bb62[_0x109e('0x10')][_0x109e('0x13')]);return _0x353142(_0x33bb62[_0x109e('0x10')][_0x109e('0x13')]);}else{logger[_0x109e('0x14')](_0x109e('0x12'),_0x2c6b89,_0x109e('0xc'));_0x353142(_0x33bb62[_0x109e('0x15')][_0x109e('0x13')]);}})[_0x109e('0x16')](function(_0x3883f4){logger[_0x109e('0x10')]('ContactItemType,\x20%s,\x20%s',_0x2c6b89,_0x3883f4);_0x44fade(_0x3883f4);});});}
\ No newline at end of file
index 61ce84d..e6e3946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a96=['update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','show','post','create','/:id'];(function(_0x39ef12,_0x46be20){var _0x2e6f4e=function(_0x4365dc){while(--_0x4365dc){_0x39ef12['push'](_0x39ef12['shift']());}};_0x2e6f4e(++_0x46be20);}(_0x8a96,0xa5));var _0x68a9=function(_0x5c80b7,_0x5c6250){_0x5c80b7=_0x5c80b7-0x0;var _0x4a20a7=_0x8a96[_0x5c80b7];return _0x4a20a7;};'use strict';var multer=require('multer');var util=require(_0x68a9('0x0'));var path=require(_0x68a9('0x1'));var timeout=require(_0x68a9('0x2'));var express=require(_0x68a9('0x3'));var router=express['Router']();var fs_extra=require(_0x68a9('0x4'));var auth=require(_0x68a9('0x5'));var interaction=require(_0x68a9('0x6'));var config=require('../../config/environment');var controller=require(_0x68a9('0x7'));router[_0x68a9('0x8')]('/',auth[_0x68a9('0x9')](),controller[_0x68a9('0xa')]);router[_0x68a9('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x68a9('0xb')]);router[_0x68a9('0xc')]('/',auth[_0x68a9('0x9')](),controller[_0x68a9('0xd')]);router['put'](_0x68a9('0xe'),auth['isAuthenticated'](),controller[_0x68a9('0xf')]);router[_0x68a9('0x10')](_0x68a9('0xe'),auth[_0x68a9('0x9')](),controller[_0x68a9('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xac35=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','path','connect-timeout'];(function(_0x29d2e9,_0x42c128){var _0x18c2ff=function(_0x169aac){while(--_0x169aac){_0x29d2e9['push'](_0x29d2e9['shift']());}};_0x18c2ff(++_0x42c128);}(_0xac35,0x195));var _0x5ac3=function(_0x479722,_0x912451){_0x479722=_0x479722-0x0;var _0x468d94=_0xac35[_0x479722];return _0x468d94;};'use strict';var multer=require(_0x5ac3('0x0'));var util=require('util');var path=require(_0x5ac3('0x1'));var timeout=require(_0x5ac3('0x2'));var express=require('express');var router=express[_0x5ac3('0x3')]();var fs_extra=require(_0x5ac3('0x4'));var auth=require(_0x5ac3('0x5'));var interaction=require(_0x5ac3('0x6'));var config=require(_0x5ac3('0x7'));var controller=require(_0x5ac3('0x8'));router[_0x5ac3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5ac3('0xa'),auth[_0x5ac3('0xb')](),controller[_0x5ac3('0xc')]);router[_0x5ac3('0xd')]('/',auth[_0x5ac3('0xb')](),controller['create']);router[_0x5ac3('0xe')](_0x5ac3('0xa'),auth[_0x5ac3('0xb')](),controller[_0x5ac3('0xf')]);router['delete'](_0x5ac3('0xa'),auth['isAuthenticated'](),controller[_0x5ac3('0x10')]);module['exports']=router;
\ No newline at end of file
index 3ff7d29..2a8b6ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['exports','STRING'];(function(_0x19d11d,_0x3aa857){var _0x2eb185=function(_0x31ec49){while(--_0x31ec49){_0x19d11d['push'](_0x19d11d['shift']());}};_0x2eb185(++_0x3aa857);}(_0x757a,0xde));var _0xa757=function(_0x4415b5,_0x3a89c6){_0x4415b5=_0x4415b5-0x0;var _0x489e4e=_0x757a[_0x4415b5];return _0x489e4e;};'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 _0xb10b=['name','sequelize','STRING'];(function(_0x5c7431,_0x2380be){var _0x51420c=function(_0x14baeb){while(--_0x14baeb){_0x5c7431['push'](_0x5c7431['shift']());}};_0x51420c(++_0x2380be);}(_0xb10b,0x12a));var _0xbb10=function(_0x3fb743,_0x2b6886){_0x3fb743=_0x3fb743-0x0;var _0x135901=_0xb10b[_0x3fb743];return _0x135901;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
index a60026c..2c5d1be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdc8=['counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','DashboardId','DashboardItem','getItems','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','lodash','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','status','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','omit','updatedAt','autoAssociation','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize'];(function(_0x58c67a,_0x1fdf49){var _0x2ada00=function(_0x3145c7){while(--_0x3145c7){_0x58c67a['push'](_0x58c67a['shift']());}};_0x2ada00(++_0x1fdf49);}(_0xbdc8,0xfd));var _0x8bdc=function(_0x42947c,_0x4e1cb3){_0x42947c=_0x42947c-0x0;var _0x17448a=_0xbdc8[_0x42947c];return _0x17448a;};'use strict';var emlformat=require(_0x8bdc('0x0'));var rimraf=require(_0x8bdc('0x1'));var zipdir=require(_0x8bdc('0x2'));var jsonpatch=require(_0x8bdc('0x3'));var rp=require('request-promise');var moment=require(_0x8bdc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8bdc('0x5'));var util=require(_0x8bdc('0x6'));var path=require('path');var sox=require(_0x8bdc('0x7'));var csv=require('to-csv');var ejs=require(_0x8bdc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bdc('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8bdc('0xa'));var toCsv=require(_0x8bdc('0xb'));var querystring=require(_0x8bdc('0xc'));var Papa=require(_0x8bdc('0xd'));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(_0x8bdc('0xe'));var logger=require(_0x8bdc('0xf'))(_0x8bdc('0x10'));var utils=require(_0x8bdc('0x11'));var config=require(_0x8bdc('0x12'));var licenseUtil=require(_0x8bdc('0x13'));var db=require(_0x8bdc('0x14'))['db'];config['redis']=_['defaults'](config[_0x8bdc('0x15')],{'host':_0x8bdc('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8bdc('0x15')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x30d1d4,_0x23a442){_0x23a442=_0x23a442||0xcc;return function(_0x1c9176){if(_0x1c9176){return _0x30d1d4[_0x8bdc('0x17')](_0x23a442);}return _0x30d1d4['status'](_0x23a442)[_0x8bdc('0x18')]();};}function respondWithResult(_0x4c035a,_0x44739d){_0x44739d=_0x44739d||0xc8;return function(_0x3d6a33){if(_0x3d6a33){return _0x4c035a['status'](_0x44739d)[_0x8bdc('0x19')](_0x3d6a33);}};}function respondWithFilteredResult(_0x5c4d25,_0x1ff75e){return function(_0x2c1231){if(_0x2c1231){var _0x3c7ada=typeof _0x1ff75e[_0x8bdc('0x1a')]===_0x8bdc('0x1b')&&typeof _0x1ff75e[_0x8bdc('0x1c')]===_0x8bdc('0x1b');var _0x252bd9=_0x2c1231[_0x8bdc('0x1d')];var _0x2a1595=_0x3c7ada?0x0:_0x1ff75e[_0x8bdc('0x1a')];var _0x4aa5fa=_0x3c7ada?_0x2c1231[_0x8bdc('0x1d')]:_0x1ff75e[_0x8bdc('0x1a')]+_0x1ff75e[_0x8bdc('0x1c')];var _0x2a107c;if(_0x4aa5fa>=_0x252bd9){_0x4aa5fa=_0x252bd9;_0x2a107c=0xc8;}else{_0x2a107c=0xce;}_0x5c4d25['status'](_0x2a107c);return _0x5c4d25[_0x8bdc('0x1e')](_0x8bdc('0x1f'),_0x2a1595+'-'+_0x4aa5fa+'/'+_0x252bd9)[_0x8bdc('0x19')](_0x2c1231);}return null;};}function patchUpdates(_0x113424){return function(_0x426d49){try{jsonpatch[_0x8bdc('0x20')](_0x426d49,_0x113424,!![]);}catch(_0x2284e0){return BPromise[_0x8bdc('0x21')](_0x2284e0);}return _0x426d49[_0x8bdc('0x22')]();};}function saveUpdates(_0x570f31,_0x2777d0){return function(_0x5f5c62){if(_0x5f5c62){return _0x5f5c62[_0x8bdc('0x23')](_0x570f31)[_0x8bdc('0x24')](function(_0x194900){return _0x194900;});}return null;};}function removeEntity(_0x341f83,_0x5b92da){return function(_0x5b0b9c){if(_0x5b0b9c){return _0x5b0b9c[_0x8bdc('0x25')]()[_0x8bdc('0x24')](function(){var _0x1b8ff5=_0x5b0b9c[_0x8bdc('0x26')]({'plain':!![]});var _0x291732=_0x8bdc('0x27');return db['UserProfileResource'][_0x8bdc('0x25')]({'where':{'type':_0x291732,'resourceId':_0x1b8ff5['id']}})[_0x8bdc('0x24')](function(){return _0x5b0b9c;});})[_0x8bdc('0x24')](function(){_0x341f83[_0x8bdc('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1afc04,_0x42136d){return function(_0x1d36e7){if(!_0x1d36e7){_0x1afc04[_0x8bdc('0x17')](0x194);}return _0x1d36e7;};}function handleError(_0x2f7190,_0x1a8d79){_0x1a8d79=_0x1a8d79||0x1f4;return function(_0x4b9f11){logger['error'](_0x4b9f11[_0x8bdc('0x29')]);if(_0x4b9f11[_0x8bdc('0x2a')]){delete _0x4b9f11[_0x8bdc('0x2a')];}_0x2f7190['status'](_0x1a8d79)[_0x8bdc('0x2b')](_0x4b9f11);};}exports[_0x8bdc('0x2c')]=function(_0x431cc7,_0xc437be){var _0x2fd59d={},_0x573e17={},_0x257d15={'count':0x0,'rows':[]};var _0x51beee=_[_0x8bdc('0x2d')](db[_0x8bdc('0x2e')][_0x8bdc('0x2f')],function(_0x34bf8e){return{'name':_0x34bf8e[_0x8bdc('0x30')],'type':_0x34bf8e[_0x8bdc('0x31')][_0x8bdc('0x32')]};});_0x573e17['model']=_[_0x8bdc('0x2d')](_0x51beee,'name');_0x573e17[_0x8bdc('0x33')]=_[_0x8bdc('0x34')](_0x431cc7[_0x8bdc('0x33')]);_0x573e17['filters']=_[_0x8bdc('0x35')](_0x573e17[_0x8bdc('0x36')],_0x573e17[_0x8bdc('0x33')]);_0x2fd59d[_0x8bdc('0x37')]=_['intersection'](_0x573e17[_0x8bdc('0x36')],qs[_0x8bdc('0x38')](_0x431cc7[_0x8bdc('0x33')][_0x8bdc('0x38')]));_0x2fd59d[_0x8bdc('0x37')]=_0x2fd59d['attributes'][_0x8bdc('0x39')]?_0x2fd59d[_0x8bdc('0x37')]:_0x573e17['model'];if(!_0x431cc7['query'][_0x8bdc('0x3a')](_0x8bdc('0x3b'))){_0x2fd59d['limit']=qs['limit'](_0x431cc7[_0x8bdc('0x33')][_0x8bdc('0x1c')]);_0x2fd59d[_0x8bdc('0x1a')]=qs[_0x8bdc('0x1a')](_0x431cc7[_0x8bdc('0x33')][_0x8bdc('0x1a')]);}_0x2fd59d[_0x8bdc('0x3c')]=qs[_0x8bdc('0x3d')](_0x431cc7[_0x8bdc('0x33')][_0x8bdc('0x3d')]);_0x2fd59d[_0x8bdc('0x3e')]=qs[_0x8bdc('0x3f')](_['pick'](_0x431cc7[_0x8bdc('0x33')],_0x573e17[_0x8bdc('0x3f')]),_0x51beee);if(_0x431cc7[_0x8bdc('0x33')][_0x8bdc('0x40')]){_0x2fd59d['where']=_['merge'](_0x2fd59d[_0x8bdc('0x3e')],{'$or':_[_0x8bdc('0x2d')](_0x51beee,function(_0x45a153){if(_0x45a153[_0x8bdc('0x31')]!==_0x8bdc('0x41')){var _0x34c880={};_0x34c880[_0x45a153[_0x8bdc('0x2a')]]={'$like':'%'+_0x431cc7[_0x8bdc('0x33')][_0x8bdc('0x40')]+'%'};return _0x34c880;}})});}_0x2fd59d=_[_0x8bdc('0x42')]({},_0x2fd59d,_0x431cc7[_0x8bdc('0x43')]);var _0x2b3bd9={'where':_0x2fd59d[_0x8bdc('0x3e')]};return db[_0x8bdc('0x2e')][_0x8bdc('0x1d')](_0x2b3bd9)['then'](function(_0x1f50f2){_0x257d15[_0x8bdc('0x1d')]=_0x1f50f2;if(_0x431cc7['query'][_0x8bdc('0x44')]){_0x2fd59d[_0x8bdc('0x45')]=[{'all':!![]}];}return db[_0x8bdc('0x2e')][_0x8bdc('0x46')](_0x2fd59d);})[_0x8bdc('0x24')](function(_0x34d082){_0x257d15[_0x8bdc('0x47')]=_0x34d082;return _0x257d15;})[_0x8bdc('0x24')](respondWithFilteredResult(_0xc437be,_0x2fd59d))[_0x8bdc('0x48')](handleError(_0xc437be,null));};exports[_0x8bdc('0x49')]=function(_0x167ecd,_0xd6aac){var _0x16b520={'raw':![],'where':{'id':_0x167ecd[_0x8bdc('0x4a')]['id']}},_0x3b2fc3={};_0x3b2fc3[_0x8bdc('0x36')]=_['keys'](db[_0x8bdc('0x2e')][_0x8bdc('0x2f')]);_0x3b2fc3[_0x8bdc('0x33')]=_[_0x8bdc('0x34')](_0x167ecd[_0x8bdc('0x33')]);_0x3b2fc3[_0x8bdc('0x3f')]=_[_0x8bdc('0x35')](_0x3b2fc3[_0x8bdc('0x36')],_0x3b2fc3['query']);_0x16b520[_0x8bdc('0x37')]=_[_0x8bdc('0x35')](_0x3b2fc3['model'],qs[_0x8bdc('0x38')](_0x167ecd[_0x8bdc('0x33')][_0x8bdc('0x38')]));_0x16b520[_0x8bdc('0x37')]=_0x16b520[_0x8bdc('0x37')][_0x8bdc('0x39')]?_0x16b520[_0x8bdc('0x37')]:_0x3b2fc3['model'];if(_0x167ecd[_0x8bdc('0x33')]['includeAll']){_0x16b520[_0x8bdc('0x45')]=[{'all':!![]}];}_0x16b520=_[_0x8bdc('0x42')]({},_0x16b520,_0x167ecd[_0x8bdc('0x43')]);return db[_0x8bdc('0x2e')]['find'](_0x16b520)['then'](handleEntityNotFound(_0xd6aac,null))['then'](respondWithResult(_0xd6aac,null))[_0x8bdc('0x48')](handleError(_0xd6aac,null));};exports['create']=function(_0x2cc517,_0x391c35){return db[_0x8bdc('0x2e')][_0x8bdc('0x4b')](_0x2cc517[_0x8bdc('0x4c')],{})[_0x8bdc('0x24')](function(_0x290afd){var _0x32fd83=_0x2cc517['user']['get']({'plain':!![]});if(!_0x32fd83)throw new Error(_0x8bdc('0x4d'));if(_0x32fd83[_0x8bdc('0x4e')]===_0x8bdc('0x4f')){var _0x11991f=_0x290afd[_0x8bdc('0x26')]({'plain':!![]});var _0x458a31=_0x8bdc('0x27');return db[_0x8bdc('0x50')]['find']({'where':{'name':_0x458a31,'userProfileId':_0x32fd83[_0x8bdc('0x51')]},'raw':!![]})[_0x8bdc('0x24')](function(_0x73174c){if(_0x73174c&&_0x73174c['autoAssociation']===0x0){return db[_0x8bdc('0x52')][_0x8bdc('0x4b')]({'name':_0x11991f[_0x8bdc('0x2a')],'resourceId':_0x11991f['id'],'type':_0x73174c[_0x8bdc('0x2a')],'sectionId':_0x73174c['id']},{})['then'](function(){return _0x290afd;});}else{return _0x290afd;}})['catch'](function(_0x171647){logger[_0x8bdc('0x53')](_0x8bdc('0x54'),_0x171647);throw _0x171647;});}return _0x290afd;})[_0x8bdc('0x24')](respondWithResult(_0x391c35,0xc9))[_0x8bdc('0x48')](handleError(_0x391c35,null));};exports['clone']=function(_0x426e84,_0x598f85){var _0x3ff346={'where':{'id':_0x426e84[_0x8bdc('0x4a')]['id']}},_0x4cf747={};_0x4cf747[_0x8bdc('0x36')]=_[_0x8bdc('0x34')](db['Dashboard'][_0x8bdc('0x2f')]);_0x3ff346[_0x8bdc('0x37')]=_[_0x8bdc('0x35')](_0x4cf747[_0x8bdc('0x36')],qs[_0x8bdc('0x38')](_0x426e84[_0x8bdc('0x33')][_0x8bdc('0x38')]));_0x3ff346[_0x8bdc('0x37')]=_0x3ff346[_0x8bdc('0x37')][_0x8bdc('0x39')]?_0x3ff346[_0x8bdc('0x37')]:_0x4cf747[_0x8bdc('0x36')];if(_0x426e84[_0x8bdc('0x33')]['includeAll']){_0x3ff346['include']=[{'all':!![]}];}_0x3ff346=_['merge']({},_0x3ff346,_0x426e84[_0x8bdc('0x43')]);return db[_0x8bdc('0x2e')][_0x8bdc('0x55')](_0x3ff346)[_0x8bdc('0x24')](handleEntityNotFound(_0x598f85,null))['then'](function(_0x5de95a){if(_0x5de95a){var _0x16ea1c=_0x5de95a[_0x8bdc('0x26')]({'plain':!![]});_0x16ea1c=qs[_0x8bdc('0x56')](_0x16ea1c,['id','createdAt',_0x8bdc('0x57')]);_0x426e84[_0x8bdc('0x4c')]=_[_0x8bdc('0x56')](_0x426e84[_0x8bdc('0x4c')],['id','createdAt',_0x8bdc('0x57')]);return db[_0x8bdc('0x2e')][_0x8bdc('0x4b')](_[_0x8bdc('0x42')](_0x16ea1c,_0x426e84[_0x8bdc('0x4c')]),{'include':_0x426e84['query'][_0x8bdc('0x44')]?[{'all':!![]}]:undefined})[_0x8bdc('0x24')](function(_0x48ed78){var _0x168f8d=_0x426e84[_0x8bdc('0x4f')][_0x8bdc('0x26')]({'plain':!![]});if(!_0x168f8d)throw new Error(_0x8bdc('0x4d'));if(_0x168f8d[_0x8bdc('0x4e')]==='user'){var _0x4e9507=_0x48ed78[_0x8bdc('0x26')]({'plain':!![]});var _0x44dfcd=_0x8bdc('0x27');return db['UserProfileSection'][_0x8bdc('0x55')]({'where':{'name':_0x44dfcd,'userProfileId':_0x168f8d['userProfileId']},'raw':!![]})[_0x8bdc('0x24')](function(_0x24b03b){if(_0x24b03b&&_0x24b03b[_0x8bdc('0x58')]===0x0){return db[_0x8bdc('0x52')][_0x8bdc('0x4b')]({'name':_0x4e9507[_0x8bdc('0x2a')],'resourceId':_0x4e9507['id'],'type':_0x24b03b[_0x8bdc('0x2a')],'sectionId':_0x24b03b['id']},{})[_0x8bdc('0x24')](function(){return _0x48ed78;});}else{return _0x48ed78;}})[_0x8bdc('0x48')](function(_0x9fb020){logger[_0x8bdc('0x53')](_0x8bdc('0x54'),_0x9fb020);throw _0x9fb020;});}return _0x48ed78;});}})[_0x8bdc('0x24')](respondWithResult(_0x598f85,0xc9))[_0x8bdc('0x48')](handleError(_0x598f85,null));};exports[_0x8bdc('0x23')]=function(_0x36ab43,_0x16f880){if(_0x36ab43['body']['id']){delete _0x36ab43[_0x8bdc('0x4c')]['id'];}return db[_0x8bdc('0x2e')]['find']({'where':{'id':_0x36ab43[_0x8bdc('0x4a')]['id']}})[_0x8bdc('0x24')](handleEntityNotFound(_0x16f880,null))['then'](saveUpdates(_0x36ab43['body'],null))[_0x8bdc('0x24')](respondWithResult(_0x16f880,null))[_0x8bdc('0x48')](handleError(_0x16f880,null));};exports[_0x8bdc('0x25')]=function(_0x3f89cc,_0x5152c1){return db[_0x8bdc('0x2e')][_0x8bdc('0x55')]({'where':{'id':_0x3f89cc[_0x8bdc('0x4a')]['id']}})[_0x8bdc('0x24')](handleEntityNotFound(_0x5152c1,null))['then'](removeEntity(_0x5152c1,null))[_0x8bdc('0x48')](handleError(_0x5152c1,null));};function widgetAttributes(_0x317a08){try{switch(_0x317a08[_0x8bdc('0x31')]){case'iframe':return[{'name':_0x8bdc('0x59'),'value':_0x317a08['attrUrl']||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x0]?_0x317a08[_0x8bdc('0x5a')][0x0]['value']:undefined)||_0x8bdc('0x5b')}];case _0x8bdc('0x5c'):return[{'name':_0x8bdc('0x5d'),'value':_0x317a08[_0x8bdc('0x5d')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x0]?_0x317a08[_0x8bdc('0x5a')][0x0][_0x8bdc('0x5e')]:undefined)||''}];case _0x8bdc('0x5f'):return[{'name':_0x8bdc('0x60'),'value':_0x317a08[_0x8bdc('0x60')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x0]?_0x317a08['attrs'][0x0][_0x8bdc('0x5e')]:undefined)||_0x8bdc('0x61')},{'name':'attrTimezone','value':_0x317a08[_0x8bdc('0x62')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08['attrs'][0x1]?_0x317a08[_0x8bdc('0x5a')][0x1][_0x8bdc('0x5e')]:undefined)||_0x8bdc('0x63')},{'name':'attrFontSize','value':_0x317a08[_0x8bdc('0x64')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x2]?_0x317a08[_0x8bdc('0x5a')][0x2][_0x8bdc('0x5e')]:undefined)||0xc}];case _0x8bdc('0x65'):return[{'name':_0x8bdc('0x66'),'value':_0x317a08[_0x8bdc('0x66')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x0]?_0x317a08[_0x8bdc('0x5a')][0x0][_0x8bdc('0x5e')]:undefined)||_0x8bdc('0x67')},{'name':_0x8bdc('0x68'),'value':_0x317a08['attrVoiceQueues']||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08['attrs'][0x1]?_0x317a08[_0x8bdc('0x5a')][0x1]['value']:undefined)||[]},{'name':_0x8bdc('0x64'),'value':_0x317a08[_0x8bdc('0x64')]||(_0x317a08['attrs']&&_0x317a08[_0x8bdc('0x5a')][0x2]?_0x317a08[_0x8bdc('0x5a')][0x2]['value']:undefined)||0x14}];case _0x8bdc('0x69'):case _0x8bdc('0x6a'):return[{'name':_0x8bdc('0x6b'),'value':_0x317a08[_0x8bdc('0x6b')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x0]?_0x317a08[_0x8bdc('0x5a')][0x0][_0x8bdc('0x5e')]:undefined)||'total'},{'name':_0x8bdc('0x6c'),'value':_0x317a08[_0x8bdc('0x6c')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x1]?_0x317a08[_0x8bdc('0x5a')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x317a08[_0x8bdc('0x6d')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x2]?_0x317a08[_0x8bdc('0x5a')][0x2][_0x8bdc('0x5e')]:undefined)||null},{'name':_0x8bdc('0x68'),'value':_0x317a08[_0x8bdc('0x68')]||(_0x317a08['attrs']&&_0x317a08['attrs'][0x3]?_0x317a08['attrs'][0x3][_0x8bdc('0x5e')]:undefined)||[]}];case _0x8bdc('0x6e'):return[{'name':_0x8bdc('0x6f'),'type':_0x317a08[_0x8bdc('0x70')]||(_0x317a08['attrs']&&_0x317a08[_0x8bdc('0x5a')][0x0]?_0x317a08[_0x8bdc('0x5a')][0x0][_0x8bdc('0x31')]:undefined)||null,'value':_0x317a08[_0x8bdc('0x6f')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x0]?_0x317a08['attrs'][0x0]['value']:undefined)||null},{'name':_0x8bdc('0x71'),'value':_0x317a08[_0x8bdc('0x71')]||(_0x317a08[_0x8bdc('0x5a')]&&_0x317a08[_0x8bdc('0x5a')][0x1]?_0x317a08[_0x8bdc('0x5a')][0x1][_0x8bdc('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x1ef82c){logger[_0x8bdc('0x53')]('widgetAttributes:\x20%s',JSON['stringify'](_0x1ef82c));return[];}}exports['addItem']=function(_0x4fbeba,_0x4bf559,_0x5ef98a){if(_0x4fbeba[_0x8bdc('0x4c')]['id']){delete _0x4fbeba['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x4fbeba[_0x8bdc('0x4a')]['id']}})[_0x8bdc('0x24')](handleEntityNotFound(_0x4bf559,null))[_0x8bdc('0x24')](function(_0x204e26){if(_0x204e26){_0x4fbeba[_0x8bdc('0x4c')][_0x8bdc('0x72')]=_0x204e26['id'];_0x4fbeba[_0x8bdc('0x4c')]['attrs']=widgetAttributes(_0x4fbeba[_0x8bdc('0x4c')]);return db[_0x8bdc('0x73')][_0x8bdc('0x4b')](_0x4fbeba[_0x8bdc('0x4c')]);}})['then'](respondWithResult(_0x4bf559,null))[_0x8bdc('0x48')](handleError(_0x4bf559,null));};exports[_0x8bdc('0x74')]=function(_0x1fee74,_0x5a3da7,_0x3ab361){var _0x3dc5ee={};var _0x433f51={};var _0x17f202;var _0x11c0c1;return db[_0x8bdc('0x2e')]['findOne']({'where':{'id':_0x1fee74[_0x8bdc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a3da7,null))['then'](function(_0x3922ff){if(_0x3922ff){_0x17f202=_0x3922ff;_0x433f51['model']=_[_0x8bdc('0x34')](db[_0x8bdc('0x73')]['rawAttributes']);_0x433f51[_0x8bdc('0x33')]=_[_0x8bdc('0x34')](_0x1fee74[_0x8bdc('0x33')]);_0x433f51[_0x8bdc('0x3f')]=_[_0x8bdc('0x35')](_0x433f51[_0x8bdc('0x36')],_0x433f51[_0x8bdc('0x33')]);_0x3dc5ee[_0x8bdc('0x37')]=_[_0x8bdc('0x35')](_0x433f51['model'],qs[_0x8bdc('0x38')](_0x1fee74[_0x8bdc('0x33')][_0x8bdc('0x38')]));_0x3dc5ee[_0x8bdc('0x37')]=_0x3dc5ee[_0x8bdc('0x37')][_0x8bdc('0x39')]?_0x3dc5ee[_0x8bdc('0x37')]:_0x433f51[_0x8bdc('0x36')];_0x3dc5ee[_0x8bdc('0x3c')]=qs[_0x8bdc('0x3d')](_0x1fee74[_0x8bdc('0x33')][_0x8bdc('0x3d')]);_0x3dc5ee['where']=qs['filters'](_[_0x8bdc('0x75')](_0x1fee74[_0x8bdc('0x33')],_0x433f51[_0x8bdc('0x3f')]));if(_0x1fee74[_0x8bdc('0x33')][_0x8bdc('0x40')]){_0x3dc5ee[_0x8bdc('0x3e')]=_[_0x8bdc('0x42')](_0x3dc5ee['where'],{'$or':_[_0x8bdc('0x2d')](_0x3dc5ee[_0x8bdc('0x37')],function(_0xaf60b1){var _0x16cff2={};_0x16cff2[_0xaf60b1]={'$like':'%'+_0x1fee74['query'][_0x8bdc('0x40')]+'%'};return _0x16cff2;})});}_0x3dc5ee=_['merge']({},_0x3dc5ee,_0x1fee74[_0x8bdc('0x43')]);return _0x17f202[_0x8bdc('0x74')](_0x3dc5ee);}})['then'](function(_0x466954){if(_0x466954){_0x11c0c1=_0x466954[_0x8bdc('0x39')];if(!_0x1fee74['query'][_0x8bdc('0x3a')](_0x8bdc('0x3b'))){_0x3dc5ee[_0x8bdc('0x1c')]=qs['limit'](_0x1fee74[_0x8bdc('0x33')][_0x8bdc('0x1c')]);_0x3dc5ee[_0x8bdc('0x1a')]=qs[_0x8bdc('0x1a')](_0x1fee74[_0x8bdc('0x33')][_0x8bdc('0x1a')]);}return _0x17f202[_0x8bdc('0x74')](_0x3dc5ee);}})[_0x8bdc('0x24')](function(_0x2c24a8){if(_0x2c24a8){return _0x2c24a8?{'count':_0x11c0c1,'rows':_0x2c24a8}:null;}})[_0x8bdc('0x24')](respondWithResult(_0x5a3da7,null))['catch'](handleError(_0x5a3da7,null));};
\ No newline at end of file
+var _0x69b5=['save','then','CustomDashboards','UserProfileResource','destroy','status','error','stack','name','send','index','Dashboard','rawAttributes','type','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','get','omit','createdAt','updatedAt','role','UserProfileSection','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','end','json','offset','undefined','set','Content-Range','apply','reject'];(function(_0x334c48,_0x4cd1bd){var _0x4fe16d=function(_0x27be44){while(--_0x27be44){_0x334c48['push'](_0x334c48['shift']());}};_0x4fe16d(++_0x4cd1bd);}(_0x69b5,0x1c6));var _0x569b=function(_0x501732,_0x53aaa0){_0x501732=_0x501732-0x0;var _0x588ae8=_0x69b5[_0x501732];return _0x588ae8;};'use strict';var emlformat=require(_0x569b('0x0'));var rimraf=require(_0x569b('0x1'));var zipdir=require(_0x569b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x569b('0x3'));var moment=require(_0x569b('0x4'));var BPromise=require(_0x569b('0x5'));var Mustache=require(_0x569b('0x6'));var util=require(_0x569b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x569b('0x8'));var ejs=require(_0x569b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x569b('0xa'));var squel=require('squel');var crypto=require(_0x569b('0xb'));var jsforce=require(_0x569b('0xc'));var deskjs=require(_0x569b('0xd'));var toCsv=require(_0x569b('0x8'));var querystring=require(_0x569b('0xe'));var Papa=require(_0x569b('0xf'));var Redis=require(_0x569b('0x10'));var authService=require(_0x569b('0x11'));var qs=require(_0x569b('0x12'));var as=require(_0x569b('0x13'));var hardwareService=require(_0x569b('0x14'));var logger=require('../../config/logger')(_0x569b('0x15'));var utils=require(_0x569b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x569b('0x17'));var db=require(_0x569b('0x18'))['db'];config[_0x569b('0x19')]=_[_0x569b('0x1a')](config[_0x569b('0x19')],{'host':_0x569b('0x1b'),'port':0x18eb});var socket=require(_0x569b('0x1c'))(new Redis(config[_0x569b('0x19')]));require(_0x569b('0x1d'))['register'](socket);function respondWithStatusCode(_0x5efda3,_0xd2c151){_0xd2c151=_0xd2c151||0xcc;return function(_0x40772d){if(_0x40772d){return _0x5efda3['sendStatus'](_0xd2c151);}return _0x5efda3['status'](_0xd2c151)[_0x569b('0x1e')]();};}function respondWithResult(_0x15743f,_0x38ddfa){_0x38ddfa=_0x38ddfa||0xc8;return function(_0x52160a){if(_0x52160a){return _0x15743f['status'](_0x38ddfa)[_0x569b('0x1f')](_0x52160a);}};}function respondWithFilteredResult(_0x5969e0,_0x4e3c31){return function(_0x2136b3){if(_0x2136b3){var _0x3adb81=typeof _0x4e3c31[_0x569b('0x20')]===_0x569b('0x21')&&typeof _0x4e3c31['limit']===_0x569b('0x21');var _0x5ce2ad=_0x2136b3['count'];var _0x2e9e43=_0x3adb81?0x0:_0x4e3c31[_0x569b('0x20')];var _0x8e4f91=_0x3adb81?_0x2136b3['count']:_0x4e3c31['offset']+_0x4e3c31['limit'];var _0x1151be;if(_0x8e4f91>=_0x5ce2ad){_0x8e4f91=_0x5ce2ad;_0x1151be=0xc8;}else{_0x1151be=0xce;}_0x5969e0['status'](_0x1151be);return _0x5969e0[_0x569b('0x22')](_0x569b('0x23'),_0x2e9e43+'-'+_0x8e4f91+'/'+_0x5ce2ad)[_0x569b('0x1f')](_0x2136b3);}return null;};}function patchUpdates(_0x1bcee6){return function(_0x45aeea){try{jsonpatch[_0x569b('0x24')](_0x45aeea,_0x1bcee6,!![]);}catch(_0x508307){return BPromise[_0x569b('0x25')](_0x508307);}return _0x45aeea[_0x569b('0x26')]();};}function saveUpdates(_0x9e95e2,_0x54cca8){return function(_0x30382a){if(_0x30382a){return _0x30382a['update'](_0x9e95e2)[_0x569b('0x27')](function(_0x20e0b9){return _0x20e0b9;});}return null;};}function removeEntity(_0x32f8db,_0x242275){return function(_0xd7651e){if(_0xd7651e){return _0xd7651e['destroy']()[_0x569b('0x27')](function(){var _0x342ab4=_0xd7651e['get']({'plain':!![]});var _0x4af699=_0x569b('0x28');return db[_0x569b('0x29')][_0x569b('0x2a')]({'where':{'type':_0x4af699,'resourceId':_0x342ab4['id']}})[_0x569b('0x27')](function(){return _0xd7651e;});})[_0x569b('0x27')](function(){_0x32f8db[_0x569b('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x162231,_0x5c786a){return function(_0x52c598){if(!_0x52c598){_0x162231['sendStatus'](0x194);}return _0x52c598;};}function handleError(_0x430a4f,_0x32da9a){_0x32da9a=_0x32da9a||0x1f4;return function(_0x56e27c){logger[_0x569b('0x2c')](_0x56e27c[_0x569b('0x2d')]);if(_0x56e27c['name']){delete _0x56e27c[_0x569b('0x2e')];}_0x430a4f[_0x569b('0x2b')](_0x32da9a)[_0x569b('0x2f')](_0x56e27c);};}exports[_0x569b('0x30')]=function(_0x4c4b86,_0x37bb53){var _0x52905d={},_0x68e7bf={},_0x3eeac1={'count':0x0,'rows':[]};var _0x293bd8=_['map'](db[_0x569b('0x31')][_0x569b('0x32')],function(_0x31cc3b){return{'name':_0x31cc3b['fieldName'],'type':_0x31cc3b[_0x569b('0x33')]['key']};});_0x68e7bf['model']=_[_0x569b('0x34')](_0x293bd8,'name');_0x68e7bf[_0x569b('0x35')]=_['keys'](_0x4c4b86[_0x569b('0x35')]);_0x68e7bf['filters']=_[_0x569b('0x36')](_0x68e7bf[_0x569b('0x37')],_0x68e7bf[_0x569b('0x35')]);_0x52905d[_0x569b('0x38')]=_[_0x569b('0x36')](_0x68e7bf[_0x569b('0x37')],qs[_0x569b('0x39')](_0x4c4b86[_0x569b('0x35')][_0x569b('0x39')]));_0x52905d['attributes']=_0x52905d[_0x569b('0x38')][_0x569b('0x3a')]?_0x52905d[_0x569b('0x38')]:_0x68e7bf[_0x569b('0x37')];if(!_0x4c4b86[_0x569b('0x35')][_0x569b('0x3b')](_0x569b('0x3c'))){_0x52905d[_0x569b('0x3d')]=qs[_0x569b('0x3d')](_0x4c4b86[_0x569b('0x35')][_0x569b('0x3d')]);_0x52905d['offset']=qs['offset'](_0x4c4b86[_0x569b('0x35')][_0x569b('0x20')]);}_0x52905d[_0x569b('0x3e')]=qs[_0x569b('0x3f')](_0x4c4b86['query'][_0x569b('0x3f')]);_0x52905d[_0x569b('0x40')]=qs[_0x569b('0x41')](_[_0x569b('0x42')](_0x4c4b86[_0x569b('0x35')],_0x68e7bf[_0x569b('0x41')]),_0x293bd8);if(_0x4c4b86['query'][_0x569b('0x43')]){_0x52905d['where']=_[_0x569b('0x44')](_0x52905d[_0x569b('0x40')],{'$or':_[_0x569b('0x34')](_0x293bd8,function(_0x439909){if(_0x439909['type']!==_0x569b('0x45')){var _0x29c01b={};_0x29c01b[_0x439909[_0x569b('0x2e')]]={'$like':'%'+_0x4c4b86[_0x569b('0x35')][_0x569b('0x43')]+'%'};return _0x29c01b;}})});}_0x52905d=_[_0x569b('0x44')]({},_0x52905d,_0x4c4b86[_0x569b('0x46')]);var _0x4f84f4={'where':_0x52905d[_0x569b('0x40')]};return db[_0x569b('0x31')]['count'](_0x4f84f4)['then'](function(_0x2b38ae){_0x3eeac1[_0x569b('0x47')]=_0x2b38ae;if(_0x4c4b86[_0x569b('0x35')][_0x569b('0x48')]){_0x52905d[_0x569b('0x49')]=[{'all':!![]}];}return db[_0x569b('0x31')][_0x569b('0x4a')](_0x52905d);})['then'](function(_0xba0c66){_0x3eeac1['rows']=_0xba0c66;return _0x3eeac1;})[_0x569b('0x27')](respondWithFilteredResult(_0x37bb53,_0x52905d))['catch'](handleError(_0x37bb53,null));};exports[_0x569b('0x4b')]=function(_0x51feb7,_0x10a9d6){var _0x5bb901={'raw':![],'where':{'id':_0x51feb7[_0x569b('0x4c')]['id']}},_0x51e14f={};_0x51e14f[_0x569b('0x37')]=_[_0x569b('0x4d')](db[_0x569b('0x31')][_0x569b('0x32')]);_0x51e14f[_0x569b('0x35')]=_[_0x569b('0x4d')](_0x51feb7[_0x569b('0x35')]);_0x51e14f[_0x569b('0x41')]=_['intersection'](_0x51e14f['model'],_0x51e14f['query']);_0x5bb901[_0x569b('0x38')]=_['intersection'](_0x51e14f[_0x569b('0x37')],qs['fields'](_0x51feb7[_0x569b('0x35')]['fields']));_0x5bb901[_0x569b('0x38')]=_0x5bb901[_0x569b('0x38')]['length']?_0x5bb901['attributes']:_0x51e14f['model'];if(_0x51feb7[_0x569b('0x35')][_0x569b('0x48')]){_0x5bb901['include']=[{'all':!![]}];}_0x5bb901=_[_0x569b('0x44')]({},_0x5bb901,_0x51feb7[_0x569b('0x46')]);return db[_0x569b('0x31')]['find'](_0x5bb901)[_0x569b('0x27')](handleEntityNotFound(_0x10a9d6,null))['then'](respondWithResult(_0x10a9d6,null))['catch'](handleError(_0x10a9d6,null));};exports[_0x569b('0x4e')]=function(_0xb5b974,_0x4efd93){return db[_0x569b('0x31')][_0x569b('0x4e')](_0xb5b974[_0x569b('0x4f')],{})[_0x569b('0x27')](function(_0x13a3fa){var _0x258020=_0xb5b974[_0x569b('0x50')]['get']({'plain':!![]});if(!_0x258020)throw new Error(_0x569b('0x51'));if(_0x258020['role']===_0x569b('0x50')){var _0x1b42da=_0x13a3fa['get']({'plain':!![]});var _0x50836f='CustomDashboards';return db['UserProfileSection'][_0x569b('0x52')]({'where':{'name':_0x50836f,'userProfileId':_0x258020[_0x569b('0x53')]},'raw':!![]})['then'](function(_0x2f3625){if(_0x2f3625&&_0x2f3625[_0x569b('0x54')]===0x0){return db[_0x569b('0x29')]['create']({'name':_0x1b42da[_0x569b('0x2e')],'resourceId':_0x1b42da['id'],'type':_0x2f3625[_0x569b('0x2e')],'sectionId':_0x2f3625['id']},{})[_0x569b('0x27')](function(){return _0x13a3fa;});}else{return _0x13a3fa;}})[_0x569b('0x55')](function(_0x524f82){logger[_0x569b('0x2c')](_0x569b('0x56'),_0x524f82);throw _0x524f82;});}return _0x13a3fa;})['then'](respondWithResult(_0x4efd93,0xc9))['catch'](handleError(_0x4efd93,null));};exports['clone']=function(_0x458f2e,_0x217483){var _0x1b9cf1={'where':{'id':_0x458f2e[_0x569b('0x4c')]['id']}},_0x3a7802={};_0x3a7802[_0x569b('0x37')]=_[_0x569b('0x4d')](db[_0x569b('0x31')][_0x569b('0x32')]);_0x1b9cf1[_0x569b('0x38')]=_[_0x569b('0x36')](_0x3a7802[_0x569b('0x37')],qs[_0x569b('0x39')](_0x458f2e['query'][_0x569b('0x39')]));_0x1b9cf1[_0x569b('0x38')]=_0x1b9cf1[_0x569b('0x38')][_0x569b('0x3a')]?_0x1b9cf1[_0x569b('0x38')]:_0x3a7802[_0x569b('0x37')];if(_0x458f2e[_0x569b('0x35')][_0x569b('0x48')]){_0x1b9cf1['include']=[{'all':!![]}];}_0x1b9cf1=_[_0x569b('0x44')]({},_0x1b9cf1,_0x458f2e[_0x569b('0x46')]);return db[_0x569b('0x31')][_0x569b('0x52')](_0x1b9cf1)[_0x569b('0x27')](handleEntityNotFound(_0x217483,null))[_0x569b('0x27')](function(_0x45ed91){if(_0x45ed91){var _0x5a3409=_0x45ed91[_0x569b('0x57')]({'plain':!![]});_0x5a3409=qs[_0x569b('0x58')](_0x5a3409,['id',_0x569b('0x59'),_0x569b('0x5a')]);_0x458f2e['body']=_[_0x569b('0x58')](_0x458f2e[_0x569b('0x4f')],['id',_0x569b('0x59'),_0x569b('0x5a')]);return db[_0x569b('0x31')][_0x569b('0x4e')](_[_0x569b('0x44')](_0x5a3409,_0x458f2e[_0x569b('0x4f')]),{'include':_0x458f2e[_0x569b('0x35')][_0x569b('0x48')]?[{'all':!![]}]:undefined})[_0x569b('0x27')](function(_0x26d0e6){var _0x1ad2d6=_0x458f2e[_0x569b('0x50')][_0x569b('0x57')]({'plain':!![]});if(!_0x1ad2d6)throw new Error(_0x569b('0x51'));if(_0x1ad2d6[_0x569b('0x5b')]==='user'){var _0xde17a3=_0x26d0e6['get']({'plain':!![]});var _0x126f47=_0x569b('0x28');return db[_0x569b('0x5c')][_0x569b('0x52')]({'where':{'name':_0x126f47,'userProfileId':_0x1ad2d6[_0x569b('0x53')]},'raw':!![]})[_0x569b('0x27')](function(_0x46e1aa){if(_0x46e1aa&&_0x46e1aa[_0x569b('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0xde17a3[_0x569b('0x2e')],'resourceId':_0xde17a3['id'],'type':_0x46e1aa['name'],'sectionId':_0x46e1aa['id']},{})['then'](function(){return _0x26d0e6;});}else{return _0x26d0e6;}})[_0x569b('0x55')](function(_0x9e913c){logger[_0x569b('0x2c')](_0x569b('0x56'),_0x9e913c);throw _0x9e913c;});}return _0x26d0e6;});}})[_0x569b('0x27')](respondWithResult(_0x217483,0xc9))['catch'](handleError(_0x217483,null));};exports['update']=function(_0x41a066,_0x2908b9){if(_0x41a066[_0x569b('0x4f')]['id']){delete _0x41a066[_0x569b('0x4f')]['id'];}return db['Dashboard'][_0x569b('0x52')]({'where':{'id':_0x41a066[_0x569b('0x4c')]['id']}})[_0x569b('0x27')](handleEntityNotFound(_0x2908b9,null))[_0x569b('0x27')](saveUpdates(_0x41a066['body'],null))[_0x569b('0x27')](respondWithResult(_0x2908b9,null))[_0x569b('0x55')](handleError(_0x2908b9,null));};exports[_0x569b('0x2a')]=function(_0x21a9a9,_0x30f81a){return db[_0x569b('0x31')][_0x569b('0x52')]({'where':{'id':_0x21a9a9['params']['id']}})[_0x569b('0x27')](handleEntityNotFound(_0x30f81a,null))[_0x569b('0x27')](removeEntity(_0x30f81a,null))['catch'](handleError(_0x30f81a,null));};function widgetAttributes(_0x49abff){try{switch(_0x49abff[_0x569b('0x33')]){case _0x569b('0x5d'):return[{'name':'attrUrl','value':_0x49abff[_0x569b('0x5e')]||(_0x49abff['attrs']&&_0x49abff[_0x569b('0x5f')][0x0]?_0x49abff[_0x569b('0x5f')][0x0][_0x569b('0x60')]:undefined)||_0x569b('0x61')}];case _0x569b('0x62'):return[{'name':'attrPath','value':_0x49abff[_0x569b('0x63')]||(_0x49abff[_0x569b('0x5f')]&&_0x49abff[_0x569b('0x5f')][0x0]?_0x49abff['attrs'][0x0][_0x569b('0x60')]:undefined)||''}];case _0x569b('0x64'):return[{'name':'attrHourFormat','value':_0x49abff[_0x569b('0x65')]||(_0x49abff[_0x569b('0x5f')]&&_0x49abff[_0x569b('0x5f')][0x0]?_0x49abff['attrs'][0x0][_0x569b('0x60')]:undefined)||_0x569b('0x66')},{'name':_0x569b('0x67'),'value':_0x49abff['attrTimezone']||(_0x49abff['attrs']&&_0x49abff['attrs'][0x1]?_0x49abff[_0x569b('0x5f')][0x1][_0x569b('0x60')]:undefined)||'0.00'},{'name':_0x569b('0x68'),'value':_0x49abff[_0x569b('0x68')]||(_0x49abff['attrs']&&_0x49abff[_0x569b('0x5f')][0x2]?_0x49abff[_0x569b('0x5f')][0x2][_0x569b('0x60')]:undefined)||0xc}];case _0x569b('0x69'):return[{'name':_0x569b('0x6a'),'value':_0x49abff[_0x569b('0x6a')]||(_0x49abff[_0x569b('0x5f')]&&_0x49abff[_0x569b('0x5f')][0x0]?_0x49abff[_0x569b('0x5f')][0x0][_0x569b('0x60')]:undefined)||_0x569b('0x6b')},{'name':'attrVoiceQueues','value':_0x49abff[_0x569b('0x6c')]||(_0x49abff[_0x569b('0x5f')]&&_0x49abff[_0x569b('0x5f')][0x1]?_0x49abff[_0x569b('0x5f')][0x1]['value']:undefined)||[]},{'name':_0x569b('0x68'),'value':_0x49abff['attrFontSize']||(_0x49abff[_0x569b('0x5f')]&&_0x49abff[_0x569b('0x5f')][0x2]?_0x49abff[_0x569b('0x5f')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x49abff[_0x569b('0x6d')]||(_0x49abff[_0x569b('0x5f')]&&_0x49abff[_0x569b('0x5f')][0x0]?_0x49abff['attrs'][0x0][_0x569b('0x60')]:undefined)||_0x569b('0x6b')},{'name':_0x569b('0x6e'),'value':_0x49abff[_0x569b('0x6e')]||(_0x49abff[_0x569b('0x5f')]&&_0x49abff[_0x569b('0x5f')][0x1]?_0x49abff[_0x569b('0x5f')][0x1][_0x569b('0x60')]:undefined)||null},{'name':_0x569b('0x6f'),'value':_0x49abff[_0x569b('0x6f')]||(_0x49abff[_0x569b('0x5f')]&&_0x49abff['attrs'][0x2]?_0x49abff['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x49abff[_0x569b('0x6c')]||(_0x49abff['attrs']&&_0x49abff['attrs'][0x3]?_0x49abff[_0x569b('0x5f')][0x3][_0x569b('0x60')]:undefined)||[]}];case _0x569b('0x70'):return[{'name':_0x569b('0x71'),'type':_0x49abff[_0x569b('0x72')]||(_0x49abff[_0x569b('0x5f')]&&_0x49abff[_0x569b('0x5f')][0x0]?_0x49abff['attrs'][0x0][_0x569b('0x33')]:undefined)||null,'value':_0x49abff[_0x569b('0x71')]||(_0x49abff[_0x569b('0x5f')]&&_0x49abff['attrs'][0x0]?_0x49abff[_0x569b('0x5f')][0x0][_0x569b('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x49abff[_0x569b('0x73')]||(_0x49abff['attrs']&&_0x49abff[_0x569b('0x5f')][0x1]?_0x49abff[_0x569b('0x5f')][0x1][_0x569b('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x254e42){logger[_0x569b('0x2c')](_0x569b('0x74'),JSON[_0x569b('0x75')](_0x254e42));return[];}}exports[_0x569b('0x76')]=function(_0x307f8b,_0x364194,_0x5eb747){if(_0x307f8b['body']['id']){delete _0x307f8b['body']['id'];}return db['Dashboard'][_0x569b('0x52')]({'where':{'id':_0x307f8b[_0x569b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x364194,null))[_0x569b('0x27')](function(_0x5b7482){if(_0x5b7482){_0x307f8b[_0x569b('0x4f')][_0x569b('0x77')]=_0x5b7482['id'];_0x307f8b[_0x569b('0x4f')][_0x569b('0x5f')]=widgetAttributes(_0x307f8b[_0x569b('0x4f')]);return db[_0x569b('0x78')]['create'](_0x307f8b[_0x569b('0x4f')]);}})[_0x569b('0x27')](respondWithResult(_0x364194,null))[_0x569b('0x55')](handleError(_0x364194,null));};exports[_0x569b('0x79')]=function(_0x16f4f8,_0x39d981,_0x57ff9a){var _0x43017c={};var _0x2453a3={};var _0x272a8d;var _0x15842f;return db['Dashboard'][_0x569b('0x7a')]({'where':{'id':_0x16f4f8[_0x569b('0x4c')]['id']}})[_0x569b('0x27')](handleEntityNotFound(_0x39d981,null))[_0x569b('0x27')](function(_0x2ca280){if(_0x2ca280){_0x272a8d=_0x2ca280;_0x2453a3[_0x569b('0x37')]=_['keys'](db[_0x569b('0x78')][_0x569b('0x32')]);_0x2453a3[_0x569b('0x35')]=_[_0x569b('0x4d')](_0x16f4f8[_0x569b('0x35')]);_0x2453a3[_0x569b('0x41')]=_[_0x569b('0x36')](_0x2453a3[_0x569b('0x37')],_0x2453a3['query']);_0x43017c[_0x569b('0x38')]=_[_0x569b('0x36')](_0x2453a3[_0x569b('0x37')],qs['fields'](_0x16f4f8[_0x569b('0x35')][_0x569b('0x39')]));_0x43017c[_0x569b('0x38')]=_0x43017c[_0x569b('0x38')]['length']?_0x43017c[_0x569b('0x38')]:_0x2453a3[_0x569b('0x37')];_0x43017c['order']=qs[_0x569b('0x3f')](_0x16f4f8[_0x569b('0x35')]['sort']);_0x43017c[_0x569b('0x40')]=qs['filters'](_[_0x569b('0x42')](_0x16f4f8['query'],_0x2453a3[_0x569b('0x41')]));if(_0x16f4f8['query'][_0x569b('0x43')]){_0x43017c[_0x569b('0x40')]=_[_0x569b('0x44')](_0x43017c[_0x569b('0x40')],{'$or':_[_0x569b('0x34')](_0x43017c[_0x569b('0x38')],function(_0x5b96f2){var _0x2eb033={};_0x2eb033[_0x5b96f2]={'$like':'%'+_0x16f4f8['query']['filter']+'%'};return _0x2eb033;})});}_0x43017c=_[_0x569b('0x44')]({},_0x43017c,_0x16f4f8['options']);return _0x272a8d[_0x569b('0x79')](_0x43017c);}})[_0x569b('0x27')](function(_0x593bc4){if(_0x593bc4){_0x15842f=_0x593bc4[_0x569b('0x3a')];if(!_0x16f4f8[_0x569b('0x35')]['hasOwnProperty'](_0x569b('0x3c'))){_0x43017c[_0x569b('0x3d')]=qs[_0x569b('0x3d')](_0x16f4f8[_0x569b('0x35')][_0x569b('0x3d')]);_0x43017c[_0x569b('0x20')]=qs[_0x569b('0x20')](_0x16f4f8[_0x569b('0x35')][_0x569b('0x20')]);}return _0x272a8d[_0x569b('0x79')](_0x43017c);}})[_0x569b('0x27')](function(_0x231d02){if(_0x231d02){return _0x231d02?{'count':_0x15842f,'rows':_0x231d02}:null;}})[_0x569b('0x27')](respondWithResult(_0x39d981,null))[_0x569b('0x55')](handleError(_0x39d981,null));};
\ No newline at end of file
index 3af4d54..c7ac4bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44cd=['exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x38e0f3,_0x4390d8){var _0x44bb24=function(_0x46a457){while(--_0x46a457){_0x38e0f3['push'](_0x38e0f3['shift']());}};_0x44bb24(++_0x4390d8);}(_0x44cd,0xd3));var _0xd44c=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x44cd[_0x5d1044];return _0x3cd90e;};'use strict';var EventEmitter=require(_0xd44c('0x0'));var Dashboard=require(_0xd44c('0x1'))['db'][_0xd44c('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd44c('0x3')](0x0);var events={'afterCreate':_0xd44c('0x4'),'afterUpdate':_0xd44c('0x5'),'afterDestroy':_0xd44c('0x6')};function emitEvent(_0x13de81){return function(_0x3ee9bc,_0x49156d,_0x2bb7cf){DashboardEvents['emit'](_0x13de81+':'+_0x3ee9bc['id'],_0x3ee9bc);DashboardEvents['emit'](_0x13de81,_0x3ee9bc);_0x2bb7cf(null);};}for(var e in events){if(events[_0xd44c('0x7')](e)){var event=events[e];Dashboard[_0xd44c('0x8')](e,emitEvent(event));}}module[_0xd44c('0x9')]=DashboardEvents;
\ No newline at end of file
+var _0xcaaf=['update','remove','emit','hasOwnProperty','hook','exports','events','Dashboard'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcaaf,0x66));var _0xfcaa=function(_0x1e4a58,_0x24b93a){_0x1e4a58=_0x1e4a58-0x0;var _0x2a6171=_0xcaaf[_0x1e4a58];return _0x2a6171;};'use strict';var EventEmitter=require(_0xfcaa('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xfcaa('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfcaa('0x2'),'afterDestroy':_0xfcaa('0x3')};function emitEvent(_0x4b8844){return function(_0xf120fe,_0x540311,_0x581a66){DashboardEvents[_0xfcaa('0x4')](_0x4b8844+':'+_0xf120fe['id'],_0xf120fe);DashboardEvents[_0xfcaa('0x4')](_0x4b8844,_0xf120fe);_0x581a66(null);};}for(var e in events){if(events[_0xfcaa('0x5')](e)){var event=events[e];Dashboard[_0xfcaa('0x6')](e,emitEvent(event));}}module[_0xfcaa('0x7')]=DashboardEvents;
\ No newline at end of file
index 27e3925..508a0af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe25a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dashboard','dashboards','lodash','../../config/logger'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xe25a,0x1c6));var _0xae25=function(_0x5103de,_0x3b2843){_0x5103de=_0x5103de-0x0;var _0x1e98e2=_0xe25a[_0x5103de];return _0x1e98e2;};'use strict';var _=require(_0xae25('0x0'));var util=require('util');var logger=require(_0xae25('0x1'))('api');var moment=require(_0xae25('0x2'));var BPromise=require(_0xae25('0x3'));var rp=require(_0xae25('0x4'));var fs=require('fs');var path=require(_0xae25('0x5'));var rimraf=require(_0xae25('0x6'));var config=require(_0xae25('0x7'));var attributes=require('./dashboard.attributes');module[_0xae25('0x8')]=function(_0x2a1d92,_0x273f15){return _0x2a1d92[_0xae25('0x9')](_0xae25('0xa'),attributes,{'tableName':_0xae25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c94=['./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x165f97,_0x1d941b){var _0x149b10=function(_0xa647a4){while(--_0xa647a4){_0x165f97['push'](_0x165f97['shift']());}};_0x149b10(++_0x1d941b);}(_0x5c94,0x149));var _0x45c9=function(_0x5a3c8f,_0x3be0ee){_0x5a3c8f=_0x5a3c8f-0x0;var _0x286a94=_0x5c94[_0x5a3c8f];return _0x286a94;};'use strict';var _=require(_0x45c9('0x0'));var util=require(_0x45c9('0x1'));var logger=require(_0x45c9('0x2'))(_0x45c9('0x3'));var moment=require('moment');var BPromise=require(_0x45c9('0x4'));var rp=require(_0x45c9('0x5'));var fs=require('fs');var path=require(_0x45c9('0x6'));var rimraf=require(_0x45c9('0x7'));var config=require(_0x45c9('0x8'));var attributes=require(_0x45c9('0x9'));module['exports']=function(_0x52ad45,_0x4e3d30){return _0x52ad45[_0x45c9('0xa')](_0x45c9('0xb'),attributes,{'tableName':_0x45c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9c2aa75..b9a51ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4ce=['../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x45ce93,_0x3a6520){var _0x1fadc4=function(_0x4249a4){while(--_0x4249a4){_0x45ce93['push'](_0x45ce93['shift']());}};_0x1fadc4(++_0x3a6520);}(_0xd4ce,0xb3));var _0xed4c=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xd4ce[_0x12d033];return _0x3b4e80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xed4c('0x0'));var BPromise=require(_0xed4c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed4c('0x2'));var db=require(_0xed4c('0x3'))['db'];var utils=require(_0xed4c('0x4'));var logger=require(_0xed4c('0x5'))(_0xed4c('0x6'));var config=require('../../config/environment');var jayson=require(_0xed4c('0x7'));var client=jayson[_0xed4c('0x8')]['http']({'port':0x232a});config[_0xed4c('0x9')]=_[_0xed4c('0xa')](config[_0xed4c('0x9')],{'host':_0xed4c('0xb'),'port':0x18eb});var socket=require(_0xed4c('0xc'))(new Redis(config[_0xed4c('0x9')]));require('./dashboard.socket')[_0xed4c('0xd')](socket);function respondWithRpcPromise(_0x54cca1,_0x2ecdd4,_0x268fba){return new BPromise(function(_0x41cbb8,_0x57f7fb){return client['request'](_0x54cca1,_0x268fba)['then'](function(_0x1fafab){logger[_0xed4c('0xe')](_0xed4c('0xf'),_0x2ecdd4,_0xed4c('0x10'));logger[_0xed4c('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2ecdd4,_0xed4c('0x10'),JSON[_0xed4c('0x12')](_0x1fafab));if(_0x1fafab[_0xed4c('0x13')]){if(_0x1fafab[_0xed4c('0x13')][_0xed4c('0x14')]===0x1f4){logger[_0xed4c('0x13')]('Dashboard,\x20%s,\x20%s',_0x2ecdd4,_0x1fafab['error'][_0xed4c('0x15')]);return _0x57f7fb(_0x1fafab[_0xed4c('0x13')]['message']);}logger[_0xed4c('0x13')]('Dashboard,\x20%s,\x20%s',_0x2ecdd4,_0x1fafab[_0xed4c('0x13')]['message']);return _0x41cbb8(_0x1fafab[_0xed4c('0x13')]['message']);}else{logger[_0xed4c('0xe')](_0xed4c('0xf'),_0x2ecdd4,_0xed4c('0x10'));_0x41cbb8(_0x1fafab[_0xed4c('0x16')][_0xed4c('0x15')]);}})['catch'](function(_0x23a154){logger[_0xed4c('0x13')](_0xed4c('0xf'),_0x2ecdd4,_0x23a154);_0x57f7fb(_0x23a154);});});}
\ No newline at end of file
+var _0x12c0=['code','message','info','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3f670b,_0x10f414){var _0x1c0978=function(_0x5c1276){while(--_0x5c1276){_0x3f670b['push'](_0x3f670b['shift']());}};_0x1c0978(++_0x10f414);}(_0x12c0,0xc1));var _0x012c=function(_0x80f91,_0x346217){_0x80f91=_0x80f91-0x0;var _0x50c9e9=_0x12c0[_0x80f91];return _0x50c9e9;};'use strict';var _=require(_0x012c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x012c('0x1'));var rs=require(_0x012c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x012c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x012c('0x4'))(_0x012c('0x5'));var config=require('../../config/environment');var jayson=require(_0x012c('0x6'));var client=jayson[_0x012c('0x7')][_0x012c('0x8')]({'port':0x232a});config[_0x012c('0x9')]=_[_0x012c('0xa')](config[_0x012c('0x9')],{'host':_0x012c('0xb'),'port':0x18eb});var socket=require(_0x012c('0xc'))(new Redis(config[_0x012c('0x9')]));require(_0x012c('0xd'))[_0x012c('0xe')](socket);function respondWithRpcPromise(_0x45ffce,_0x5920dc,_0x4b893c){return new BPromise(function(_0x5700e7,_0x2e2013){return client[_0x012c('0xf')](_0x45ffce,_0x4b893c)[_0x012c('0x10')](function(_0x312509){logger['info'](_0x012c('0x11'),_0x5920dc,'request\x20sent');logger[_0x012c('0x12')](_0x012c('0x13'),_0x5920dc,_0x012c('0x14'),JSON[_0x012c('0x15')](_0x312509));if(_0x312509[_0x012c('0x16')]){if(_0x312509['error'][_0x012c('0x17')]===0x1f4){logger[_0x012c('0x16')]('Dashboard,\x20%s,\x20%s',_0x5920dc,_0x312509['error'][_0x012c('0x18')]);return _0x2e2013(_0x312509[_0x012c('0x16')][_0x012c('0x18')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x5920dc,_0x312509['error']['message']);return _0x5700e7(_0x312509[_0x012c('0x16')][_0x012c('0x18')]);}else{logger[_0x012c('0x19')]('Dashboard,\x20%s,\x20%s',_0x5920dc,_0x012c('0x14'));_0x5700e7(_0x312509['result'][_0x012c('0x18')]);}})[_0x012c('0x1a')](function(_0x197dd2){logger[_0x012c('0x16')](_0x012c('0x11'),_0x5920dc,_0x197dd2);_0x2e2013(_0x197dd2);});});}
\ No newline at end of file
index 2c20c39..2e4a713 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7f6=['dashboard:','./dashboard.events','remove','emit','register'];(function(_0x369e27,_0x44751c){var _0x251f35=function(_0x2bac3b){while(--_0x2bac3b){_0x369e27['push'](_0x369e27['shift']());}};_0x251f35(++_0x44751c);}(_0xe7f6,0x150));var _0x6e7f=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0xe7f6[_0x35d59c];return _0x18cd27;};'use strict';var DashboardEvents=require(_0x6e7f('0x0'));var events=['save',_0x6e7f('0x1'),'update'];function createListener(_0x3c6dea,_0x1ee0fc){return function(_0x4b51e0){_0x1ee0fc[_0x6e7f('0x2')](_0x3c6dea,_0x4b51e0);};}function removeListener(_0x2df317,_0x538344){return function(){DashboardEvents['removeListener'](_0x2df317,_0x538344);};}exports[_0x6e7f('0x3')]=function(_0x45ba66){for(var _0x50d6b1=0x0,_0x4d3625=events['length'];_0x50d6b1<_0x4d3625;_0x50d6b1++){var _0x2cb994=events[_0x50d6b1];var _0x33087e=createListener(_0x6e7f('0x4')+_0x2cb994,_0x45ba66);DashboardEvents['on'](_0x2cb994,_0x33087e);}};
\ No newline at end of file
+var _0x12b9=['removeListener','register','dashboard:','remove','update'];(function(_0xadd525,_0x3b22e2){var _0x4c2195=function(_0x539d59){while(--_0x539d59){_0xadd525['push'](_0xadd525['shift']());}};_0x4c2195(++_0x3b22e2);}(_0x12b9,0xa3));var _0x912b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x12b9[_0x2dafbe];return _0x58a45a;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x912b('0x0'),_0x912b('0x1')];function createListener(_0x194ff1,_0x3f9bc1){return function(_0x4d4827){_0x3f9bc1['emit'](_0x194ff1,_0x4d4827);};}function removeListener(_0xb08708,_0x30a750){return function(){DashboardEvents[_0x912b('0x2')](_0xb08708,_0x30a750);};}exports[_0x912b('0x3')]=function(_0x4928aa){for(var _0x465221=0x0,_0x2190c5=events['length'];_0x465221<_0x2190c5;_0x465221++){var _0x129392=events[_0x465221];var _0x31619b=createListener(_0x912b('0x4')+_0x129392,_0x4928aa);DashboardEvents['on'](_0x129392,_0x31619b);}};
\ No newline at end of file
index c5b9727..3dfc556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe480=['/:id/clone','clone','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/items','getItems','create','post'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe480,0x1c9));var _0x0e48=function(_0x528482,_0x3e91db){_0x528482=_0x528482-0x0;var _0x5c5416=_0xe480[_0x528482];return _0x5c5416;};'use strict';var multer=require('multer');var util=require(_0x0e48('0x0'));var path=require(_0x0e48('0x1'));var timeout=require(_0x0e48('0x2'));var express=require(_0x0e48('0x3'));var router=express[_0x0e48('0x4')]();var fs_extra=require(_0x0e48('0x5'));var auth=require(_0x0e48('0x6'));var interaction=require(_0x0e48('0x7'));var config=require(_0x0e48('0x8'));var controller=require('./dashboard.controller');router[_0x0e48('0x9')]('/',auth['isAuthenticated'](),controller[_0x0e48('0xa')]);router['get'](_0x0e48('0xb'),auth[_0x0e48('0xc')](),controller[_0x0e48('0xd')]);router[_0x0e48('0x9')](_0x0e48('0xe'),auth[_0x0e48('0xc')](),controller[_0x0e48('0xf')]);router['post']('/',auth[_0x0e48('0xc')](),controller[_0x0e48('0x10')]);router[_0x0e48('0x11')](_0x0e48('0x12'),auth[_0x0e48('0xc')](),controller[_0x0e48('0x13')]);router[_0x0e48('0x11')](_0x0e48('0xe'),auth['isAuthenticated'](),controller['addItem']);router[_0x0e48('0x14')](_0x0e48('0xb'),auth[_0x0e48('0xc')](),controller[_0x0e48('0x15')]);router[_0x0e48('0x16')](_0x0e48('0xb'),auth[_0x0e48('0xc')](),controller[_0x0e48('0x17')]);module[_0x0e48('0x18')]=router;
\ No newline at end of file
+var _0x4c21=['./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','/:id/clone','addItem','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x466d98,_0x4829a6){var _0x4e1690=function(_0x1f7bd1){while(--_0x1f7bd1){_0x466d98['push'](_0x466d98['shift']());}};_0x4e1690(++_0x4829a6);}(_0x4c21,0x154));var _0x14c2=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0x4c21[_0x5f519b];return _0x2461e2;};'use strict';var multer=require(_0x14c2('0x0'));var util=require(_0x14c2('0x1'));var path=require(_0x14c2('0x2'));var timeout=require(_0x14c2('0x3'));var express=require(_0x14c2('0x4'));var router=express[_0x14c2('0x5')]();var fs_extra=require(_0x14c2('0x6'));var auth=require(_0x14c2('0x7'));var interaction=require(_0x14c2('0x8'));var config=require(_0x14c2('0x9'));var controller=require(_0x14c2('0xa'));router[_0x14c2('0xb')]('/',auth[_0x14c2('0xc')](),controller[_0x14c2('0xd')]);router['get'](_0x14c2('0xe'),auth[_0x14c2('0xc')](),controller[_0x14c2('0xf')]);router['get'](_0x14c2('0x10'),auth['isAuthenticated'](),controller[_0x14c2('0x11')]);router[_0x14c2('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x14c2('0x12')](_0x14c2('0x13'),auth[_0x14c2('0xc')](),controller['clone']);router[_0x14c2('0x12')]('/:id/items',auth[_0x14c2('0xc')](),controller[_0x14c2('0x14')]);router[_0x14c2('0x15')](_0x14c2('0xe'),auth[_0x14c2('0xc')](),controller['update']);router[_0x14c2('0x16')](_0x14c2('0xe'),auth[_0x14c2('0xc')](),controller[_0x14c2('0x17')]);module[_0x14c2('0x18')]=router;
\ No newline at end of file
index 0f3d566..31f8f4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long'];(function(_0x5600ba,_0xe51f7c){var _0x2db0f1=function(_0x4a5896){while(--_0x4a5896){_0x5600ba['push'](_0x5600ba['shift']());}};_0x2db0f1(++_0xe51f7c);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x454fa7,_0x4e3a42){_0x454fa7=_0x454fa7-0x0;var _0x206cf6=_0x3f8a[_0x454fa7];return _0x206cf6;};'use strict';var Sequelize=require(_0xa3f8('0x0'));var squel=require(_0xa3f8('0x1'));var _=require(_0xa3f8('0x2'));module[_0xa3f8('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa3f8('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xa3f8('0x5')](_0xa3f8('0x6')),'get':function(){try{return JSON[_0xa3f8('0x7')](this[_0xa3f8('0x8')](_0xa3f8('0x9')));}catch(_0x39d2e4){return[];}},'set':function(_0x471464){try{this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')](_0x471464));}catch(_0x268332){this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xa3f8('0xc')]},'background':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':_0xa3f8('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xa3f8('0x4')]},'titleFontSize':{'type':Sequelize[_0xa3f8('0xc')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x4c60=['attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0xe80803,_0x19c5d9){var _0x10f2b3=function(_0x318f4b){while(--_0x318f4b){_0xe80803['push'](_0xe80803['shift']());}};_0x10f2b3(++_0x19c5d9);}(_0x4c60,0xc1));var _0x04c6=function(_0x295872,_0x3bca98){_0x295872=_0x295872-0x0;var _0x51df6e=_0x4c60[_0x295872];return _0x51df6e;};'use strict';var Sequelize=require(_0x04c6('0x0'));var squel=require(_0x04c6('0x1'));var _=require(_0x04c6('0x2'));module[_0x04c6('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x04c6('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x04c6('0x5')));}catch(_0xc6e772){return[];}},'set':function(_0x2054da){try{this[_0x04c6('0x6')](_0x04c6('0x5'),JSON[_0x04c6('0x7')](_0x2054da));}catch(_0x8f9b13){this['setDataValue'](_0x04c6('0x5'),JSON[_0x04c6('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x04c6('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x04c6('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x04c6('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x04c6('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x04c6('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
index 189a23f..b89b83d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef81=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','find','catch','iframe','attrUrl','attrs','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','type','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x33b453,_0x4c0324){var _0x5a6019=function(_0x4d5ba4){while(--_0x4d5ba4){_0x33b453['push'](_0x33b453['shift']());}};_0x5a6019(++_0x4c0324);}(_0xef81,0x1a7));var _0x1ef8=function(_0x2ce227,_0x6239c1){_0x2ce227=_0x2ce227-0x0;var _0x527154=_0xef81[_0x2ce227];return _0x527154;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ef8('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1ef8('0x1'));var Mustache=require(_0x1ef8('0x2'));var util=require(_0x1ef8('0x3'));var path=require(_0x1ef8('0x4'));var sox=require(_0x1ef8('0x5'));var csv=require(_0x1ef8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ef8('0x7'));var _=require(_0x1ef8('0x8'));var squel=require(_0x1ef8('0x9'));var crypto=require(_0x1ef8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1ef8('0xb'));var toCsv=require(_0x1ef8('0x6'));var querystring=require(_0x1ef8('0xc'));var Papa=require('papaparse');var Redis=require(_0x1ef8('0xd'));var authService=require(_0x1ef8('0xe'));var qs=require(_0x1ef8('0xf'));var as=require(_0x1ef8('0x10'));var hardwareService=require(_0x1ef8('0x11'));var logger=require(_0x1ef8('0x12'))('api');var utils=require(_0x1ef8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1ef8('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x1ef8('0x15')],{'host':_0x1ef8('0x16'),'port':0x18eb});var socket=require(_0x1ef8('0x17'))(new Redis(config[_0x1ef8('0x15')]));require(_0x1ef8('0x18'))[_0x1ef8('0x19')](socket);function respondWithStatusCode(_0x2d07d2,_0x569ec3){_0x569ec3=_0x569ec3||0xcc;return function(_0xb018f1){if(_0xb018f1){return _0x2d07d2['sendStatus'](_0x569ec3);}return _0x2d07d2[_0x1ef8('0x1a')](_0x569ec3)['end']();};}function respondWithResult(_0x3ec5d4,_0x3dcc6f){_0x3dcc6f=_0x3dcc6f||0xc8;return function(_0x42e7e1){if(_0x42e7e1){return _0x3ec5d4[_0x1ef8('0x1a')](_0x3dcc6f)[_0x1ef8('0x1b')](_0x42e7e1);}};}function respondWithFilteredResult(_0x548e9a,_0x2af9b4){return function(_0x3b2a31){if(_0x3b2a31){var _0x365e34=typeof _0x2af9b4[_0x1ef8('0x1c')]===_0x1ef8('0x1d')&&typeof _0x2af9b4[_0x1ef8('0x1e')]===_0x1ef8('0x1d');var _0x54f522=_0x3b2a31[_0x1ef8('0x1f')];var _0x1cd6d8=_0x365e34?0x0:_0x2af9b4['offset'];var _0x162f40=_0x365e34?_0x3b2a31[_0x1ef8('0x1f')]:_0x2af9b4[_0x1ef8('0x1c')]+_0x2af9b4['limit'];var _0x31427f;if(_0x162f40>=_0x54f522){_0x162f40=_0x54f522;_0x31427f=0xc8;}else{_0x31427f=0xce;}_0x548e9a[_0x1ef8('0x1a')](_0x31427f);return _0x548e9a[_0x1ef8('0x20')](_0x1ef8('0x21'),_0x1cd6d8+'-'+_0x162f40+'/'+_0x54f522)['json'](_0x3b2a31);}return null;};}function patchUpdates(_0x409c4b){return function(_0x5d633f){try{jsonpatch[_0x1ef8('0x22')](_0x5d633f,_0x409c4b,!![]);}catch(_0x1ccea2){return BPromise[_0x1ef8('0x23')](_0x1ccea2);}return _0x5d633f[_0x1ef8('0x24')]();};}function saveUpdates(_0x15c4ab,_0x4cd043){return function(_0x56a77d){if(_0x56a77d){return _0x56a77d['update'](_0x15c4ab)[_0x1ef8('0x25')](function(_0x5b3557){return _0x5b3557;});}return null;};}function removeEntity(_0x2de6e9,_0x19663c){return function(_0x3c883a){if(_0x3c883a){return _0x3c883a[_0x1ef8('0x26')]()['then'](function(){_0x2de6e9[_0x1ef8('0x1a')](0xcc)[_0x1ef8('0x27')]();});}};}function handleEntityNotFound(_0x4609c6,_0x21c12f){return function(_0x1e4d60){if(!_0x1e4d60){_0x4609c6[_0x1ef8('0x28')](0x194);}return _0x1e4d60;};}function handleError(_0x5b126c,_0x230ac8){_0x230ac8=_0x230ac8||0x1f4;return function(_0x33abf3){logger[_0x1ef8('0x29')](_0x33abf3[_0x1ef8('0x2a')]);if(_0x33abf3[_0x1ef8('0x2b')]){delete _0x33abf3[_0x1ef8('0x2b')];}_0x5b126c[_0x1ef8('0x1a')](_0x230ac8)[_0x1ef8('0x2c')](_0x33abf3);};}exports['show']=function(_0x549bf1,_0x3c5847){var _0x4c5e9b={'raw':![],'where':{'id':_0x549bf1[_0x1ef8('0x2d')]['id']}},_0x43e524={};_0x43e524[_0x1ef8('0x2e')]=_[_0x1ef8('0x2f')](db[_0x1ef8('0x30')][_0x1ef8('0x31')]);_0x43e524[_0x1ef8('0x32')]=_['keys'](_0x549bf1['query']);_0x43e524[_0x1ef8('0x33')]=_['intersection'](_0x43e524[_0x1ef8('0x2e')],_0x43e524['query']);_0x4c5e9b[_0x1ef8('0x34')]=_[_0x1ef8('0x35')](_0x43e524['model'],qs['fields'](_0x549bf1[_0x1ef8('0x32')][_0x1ef8('0x36')]));_0x4c5e9b['attributes']=_0x4c5e9b[_0x1ef8('0x34')][_0x1ef8('0x37')]?_0x4c5e9b[_0x1ef8('0x34')]:_0x43e524['model'];if(_0x549bf1['query'][_0x1ef8('0x38')]){_0x4c5e9b[_0x1ef8('0x39')]=[{'all':!![]}];}_0x4c5e9b=_[_0x1ef8('0x3a')]({},_0x4c5e9b,_0x549bf1['options']);return db[_0x1ef8('0x30')][_0x1ef8('0x3b')](_0x4c5e9b)[_0x1ef8('0x25')](handleEntityNotFound(_0x3c5847,null))[_0x1ef8('0x25')](respondWithResult(_0x3c5847,null))[_0x1ef8('0x3c')](handleError(_0x3c5847,null));};exports[_0x1ef8('0x26')]=function(_0x2a787a,_0x34de9a){return db[_0x1ef8('0x30')]['find']({'where':{'id':_0x2a787a[_0x1ef8('0x2d')]['id']}})[_0x1ef8('0x25')](handleEntityNotFound(_0x34de9a,null))[_0x1ef8('0x25')](removeEntity(_0x34de9a,null))['catch'](handleError(_0x34de9a,null));};function widgetAttributes(_0x1d80f8){try{switch(_0x1d80f8['type']){case _0x1ef8('0x3d'):return[{'name':_0x1ef8('0x3e'),'value':_0x1d80f8['attrUrl']||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8['attrs'][0x0]?_0x1d80f8[_0x1ef8('0x3f')][0x0][_0x1ef8('0x40')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x1d80f8['attrPath']||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8['attrs'][0x0]?_0x1d80f8[_0x1ef8('0x3f')][0x0]['value']:undefined)||''}];case _0x1ef8('0x41'):return[{'name':_0x1ef8('0x42'),'value':_0x1d80f8[_0x1ef8('0x42')]||(_0x1d80f8['attrs']&&_0x1d80f8[_0x1ef8('0x3f')][0x0]?_0x1d80f8[_0x1ef8('0x3f')][0x0]['value']:undefined)||_0x1ef8('0x43')},{'name':_0x1ef8('0x44'),'value':_0x1d80f8[_0x1ef8('0x44')]||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8[_0x1ef8('0x3f')][0x1]?_0x1d80f8[_0x1ef8('0x3f')][0x1][_0x1ef8('0x40')]:undefined)||_0x1ef8('0x45')},{'name':_0x1ef8('0x46'),'value':_0x1d80f8[_0x1ef8('0x46')]||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8[_0x1ef8('0x3f')][0x2]?_0x1d80f8[_0x1ef8('0x3f')][0x2][_0x1ef8('0x40')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x1d80f8[_0x1ef8('0x47')]||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8[_0x1ef8('0x3f')][0x0]?_0x1d80f8[_0x1ef8('0x3f')][0x0][_0x1ef8('0x40')]:undefined)||_0x1ef8('0x48')},{'name':_0x1ef8('0x49'),'value':_0x1d80f8[_0x1ef8('0x49')]||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8[_0x1ef8('0x3f')][0x1]?_0x1d80f8[_0x1ef8('0x3f')][0x1]['value']:undefined)||[]},{'name':_0x1ef8('0x46'),'value':_0x1d80f8[_0x1ef8('0x46')]||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8['attrs'][0x2]?_0x1d80f8[_0x1ef8('0x3f')][0x2][_0x1ef8('0x40')]:undefined)||0x14}];case _0x1ef8('0x4a'):case _0x1ef8('0x4b'):return[{'name':_0x1ef8('0x4c'),'value':_0x1d80f8['attrSerie1']||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8[_0x1ef8('0x3f')][0x0]?_0x1d80f8[_0x1ef8('0x3f')][0x0][_0x1ef8('0x40')]:undefined)||_0x1ef8('0x48')},{'name':_0x1ef8('0x4d'),'value':_0x1d80f8[_0x1ef8('0x4d')]||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8[_0x1ef8('0x3f')][0x1]?_0x1d80f8[_0x1ef8('0x3f')][0x1]['value']:undefined)||null},{'name':_0x1ef8('0x4e'),'value':_0x1d80f8[_0x1ef8('0x4e')]||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8[_0x1ef8('0x3f')][0x2]?_0x1d80f8[_0x1ef8('0x3f')][0x2][_0x1ef8('0x40')]:undefined)||null},{'name':_0x1ef8('0x49'),'value':_0x1d80f8[_0x1ef8('0x49')]||(_0x1d80f8['attrs']&&_0x1d80f8[_0x1ef8('0x3f')][0x3]?_0x1d80f8[_0x1ef8('0x3f')][0x3]['value']:undefined)||[]}];case _0x1ef8('0x4f'):return[{'name':'attrReport','type':_0x1d80f8['reportType']||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8[_0x1ef8('0x3f')][0x0]?_0x1d80f8[_0x1ef8('0x3f')][0x0][_0x1ef8('0x50')]:undefined)||null,'value':_0x1d80f8[_0x1ef8('0x51')]||(_0x1d80f8['attrs']&&_0x1d80f8['attrs'][0x0]?_0x1d80f8['attrs'][0x0][_0x1ef8('0x40')]:undefined)||null},{'name':_0x1ef8('0x52'),'value':_0x1d80f8['attrRefresh']||(_0x1d80f8[_0x1ef8('0x3f')]&&_0x1d80f8[_0x1ef8('0x3f')][0x1]?_0x1d80f8[_0x1ef8('0x3f')][0x1][_0x1ef8('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x4329c7){logger[_0x1ef8('0x29')](_0x1ef8('0x53'),JSON[_0x1ef8('0x54')](_0x4329c7));return[];}}exports[_0x1ef8('0x55')]=function(_0x3b7718,_0x3fe23d){if(_0x3b7718[_0x1ef8('0x56')]){_0x3b7718[_0x1ef8('0x56')][_0x1ef8('0x3f')]=widgetAttributes(_0x3b7718[_0x1ef8('0x56')]);}return db[_0x1ef8('0x30')]['create'](_0x3b7718[_0x1ef8('0x56')],{})['then'](respondWithResult(_0x3fe23d,0xc9))[_0x1ef8('0x3c')](handleError(_0x3fe23d,null));};exports[_0x1ef8('0x57')]=function(_0xad0208,_0x3a7c5a){if(_0xad0208[_0x1ef8('0x56')]['id']){delete _0xad0208['body']['id'];}_0xad0208[_0x1ef8('0x56')][_0x1ef8('0x3f')]=widgetAttributes(_0xad0208['body']);return db[_0x1ef8('0x30')][_0x1ef8('0x3b')]({'where':{'id':_0xad0208[_0x1ef8('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3a7c5a,null))[_0x1ef8('0x25')](saveUpdates(_0xad0208[_0x1ef8('0x56')],null))[_0x1ef8('0x25')](respondWithResult(_0x3a7c5a,null))[_0x1ef8('0x3c')](handleError(_0x3a7c5a,null));};
\ No newline at end of file
+var _0x250c=['show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','find','catch','DashboardItem','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send'];(function(_0x1a6304,_0x37b41e){var _0x825ac7=function(_0x342321){while(--_0x342321){_0x1a6304['push'](_0x1a6304['shift']());}};_0x825ac7(++_0x37b41e);}(_0x250c,0x135));var _0xc250=function(_0x985416,_0x3bba68){_0x985416=_0x985416-0x0;var _0x416937=_0x250c[_0x985416];return _0x416937;};'use strict';var emlformat=require(_0xc250('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc250('0x1'));var jsonpatch=require(_0xc250('0x2'));var rp=require(_0xc250('0x3'));var moment=require('moment');var BPromise=require(_0xc250('0x4'));var Mustache=require(_0xc250('0x5'));var util=require(_0xc250('0x6'));var path=require(_0xc250('0x7'));var sox=require('sox');var csv=require(_0xc250('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc250('0x9'));var _=require(_0xc250('0xa'));var squel=require(_0xc250('0xb'));var crypto=require(_0xc250('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc250('0xd'));var toCsv=require(_0xc250('0x8'));var querystring=require('querystring');var Papa=require(_0xc250('0xe'));var Redis=require('ioredis');var authService=require(_0xc250('0xf'));var qs=require(_0xc250('0x10'));var as=require(_0xc250('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc250('0x12'))('api');var utils=require(_0xc250('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc250('0x14'));var db=require(_0xc250('0x15'))['db'];config[_0xc250('0x16')]=_[_0xc250('0x17')](config[_0xc250('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xc250('0x18'))(new Redis(config[_0xc250('0x16')]));require(_0xc250('0x19'))[_0xc250('0x1a')](socket);function respondWithStatusCode(_0x2790f8,_0x2aab22){_0x2aab22=_0x2aab22||0xcc;return function(_0x807017){if(_0x807017){return _0x2790f8['sendStatus'](_0x2aab22);}return _0x2790f8[_0xc250('0x1b')](_0x2aab22)[_0xc250('0x1c')]();};}function respondWithResult(_0x5bd982,_0x2d4c9b){_0x2d4c9b=_0x2d4c9b||0xc8;return function(_0x56755c){if(_0x56755c){return _0x5bd982[_0xc250('0x1b')](_0x2d4c9b)['json'](_0x56755c);}};}function respondWithFilteredResult(_0x2b4909,_0x135ea6){return function(_0x3ce3cf){if(_0x3ce3cf){var _0x127b94=typeof _0x135ea6[_0xc250('0x1d')]===_0xc250('0x1e')&&typeof _0x135ea6[_0xc250('0x1f')]==='undefined';var _0x553bcf=_0x3ce3cf[_0xc250('0x20')];var _0x1e58a7=_0x127b94?0x0:_0x135ea6[_0xc250('0x1d')];var _0x146a0e=_0x127b94?_0x3ce3cf[_0xc250('0x20')]:_0x135ea6[_0xc250('0x1d')]+_0x135ea6[_0xc250('0x1f')];var _0x304e1a;if(_0x146a0e>=_0x553bcf){_0x146a0e=_0x553bcf;_0x304e1a=0xc8;}else{_0x304e1a=0xce;}_0x2b4909['status'](_0x304e1a);return _0x2b4909[_0xc250('0x21')](_0xc250('0x22'),_0x1e58a7+'-'+_0x146a0e+'/'+_0x553bcf)[_0xc250('0x23')](_0x3ce3cf);}return null;};}function patchUpdates(_0x343e07){return function(_0x25b7bc){try{jsonpatch[_0xc250('0x24')](_0x25b7bc,_0x343e07,!![]);}catch(_0x9d8811){return BPromise[_0xc250('0x25')](_0x9d8811);}return _0x25b7bc[_0xc250('0x26')]();};}function saveUpdates(_0x38ccd5,_0x3359d4){return function(_0x3f3e69){if(_0x3f3e69){return _0x3f3e69[_0xc250('0x27')](_0x38ccd5)['then'](function(_0x6912e3){return _0x6912e3;});}return null;};}function removeEntity(_0x33e48c,_0x4adff0){return function(_0x1929ef){if(_0x1929ef){return _0x1929ef[_0xc250('0x28')]()[_0xc250('0x29')](function(){_0x33e48c[_0xc250('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ee21,_0x657063){return function(_0x479f00){if(!_0x479f00){_0x56ee21[_0xc250('0x2a')](0x194);}return _0x479f00;};}function handleError(_0xce47a0,_0x545f36){_0x545f36=_0x545f36||0x1f4;return function(_0x155eac){logger[_0xc250('0x2b')](_0x155eac[_0xc250('0x2c')]);if(_0x155eac[_0xc250('0x2d')]){delete _0x155eac['name'];}_0xce47a0['status'](_0x545f36)[_0xc250('0x2e')](_0x155eac);};}exports[_0xc250('0x2f')]=function(_0xd7a93c,_0x2cb880){var _0x285e9a={'raw':![],'where':{'id':_0xd7a93c[_0xc250('0x30')]['id']}},_0x48eed2={};_0x48eed2[_0xc250('0x31')]=_[_0xc250('0x32')](db['DashboardItem'][_0xc250('0x33')]);_0x48eed2[_0xc250('0x34')]=_[_0xc250('0x32')](_0xd7a93c[_0xc250('0x34')]);_0x48eed2['filters']=_[_0xc250('0x35')](_0x48eed2[_0xc250('0x31')],_0x48eed2[_0xc250('0x34')]);_0x285e9a[_0xc250('0x36')]=_[_0xc250('0x35')](_0x48eed2[_0xc250('0x31')],qs[_0xc250('0x37')](_0xd7a93c[_0xc250('0x34')]['fields']));_0x285e9a[_0xc250('0x36')]=_0x285e9a[_0xc250('0x36')][_0xc250('0x38')]?_0x285e9a[_0xc250('0x36')]:_0x48eed2[_0xc250('0x31')];if(_0xd7a93c[_0xc250('0x34')]['includeAll']){_0x285e9a[_0xc250('0x39')]=[{'all':!![]}];}_0x285e9a=_[_0xc250('0x3a')]({},_0x285e9a,_0xd7a93c['options']);return db['DashboardItem'][_0xc250('0x3b')](_0x285e9a)['then'](handleEntityNotFound(_0x2cb880,null))[_0xc250('0x29')](respondWithResult(_0x2cb880,null))[_0xc250('0x3c')](handleError(_0x2cb880,null));};exports[_0xc250('0x28')]=function(_0x5952b8,_0x40c660){return db[_0xc250('0x3d')][_0xc250('0x3b')]({'where':{'id':_0x5952b8[_0xc250('0x30')]['id']}})[_0xc250('0x29')](handleEntityNotFound(_0x40c660,null))[_0xc250('0x29')](removeEntity(_0x40c660,null))[_0xc250('0x3c')](handleError(_0x40c660,null));};function widgetAttributes(_0x3a5b52){try{switch(_0x3a5b52['type']){case'iframe':return[{'name':_0xc250('0x3e'),'value':_0x3a5b52[_0xc250('0x3e')]||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x0]?_0x3a5b52[_0xc250('0x3f')][0x0][_0xc250('0x40')]:undefined)||'https://'}];case _0xc250('0x41'):return[{'name':_0xc250('0x42'),'value':_0x3a5b52[_0xc250('0x42')]||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x0]?_0x3a5b52[_0xc250('0x3f')][0x0]['value']:undefined)||''}];case _0xc250('0x43'):return[{'name':'attrHourFormat','value':_0x3a5b52[_0xc250('0x44')]||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x0]?_0x3a5b52['attrs'][0x0][_0xc250('0x40')]:undefined)||_0xc250('0x45')},{'name':_0xc250('0x46'),'value':_0x3a5b52[_0xc250('0x46')]||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x1]?_0x3a5b52['attrs'][0x1]['value']:undefined)||_0xc250('0x47')},{'name':'attrFontSize','value':_0x3a5b52[_0xc250('0x48')]||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x2]?_0x3a5b52[_0xc250('0x3f')][0x2][_0xc250('0x40')]:undefined)||0xc}];case _0xc250('0x49'):return[{'name':'attrMetric','value':_0x3a5b52[_0xc250('0x4a')]||(_0x3a5b52['attrs']&&_0x3a5b52[_0xc250('0x3f')][0x0]?_0x3a5b52[_0xc250('0x3f')][0x0][_0xc250('0x40')]:undefined)||_0xc250('0x4b')},{'name':_0xc250('0x4c'),'value':_0x3a5b52['attrVoiceQueues']||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x1]?_0x3a5b52[_0xc250('0x3f')][0x1][_0xc250('0x40')]:undefined)||[]},{'name':_0xc250('0x48'),'value':_0x3a5b52['attrFontSize']||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x2]?_0x3a5b52[_0xc250('0x3f')][0x2][_0xc250('0x40')]:undefined)||0x14}];case _0xc250('0x4d'):case _0xc250('0x4e'):return[{'name':_0xc250('0x4f'),'value':_0x3a5b52[_0xc250('0x4f')]||(_0x3a5b52['attrs']&&_0x3a5b52['attrs'][0x0]?_0x3a5b52[_0xc250('0x3f')][0x0][_0xc250('0x40')]:undefined)||'total'},{'name':_0xc250('0x50'),'value':_0x3a5b52[_0xc250('0x50')]||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x1]?_0x3a5b52[_0xc250('0x3f')][0x1][_0xc250('0x40')]:undefined)||null},{'name':_0xc250('0x51'),'value':_0x3a5b52[_0xc250('0x51')]||(_0x3a5b52['attrs']&&_0x3a5b52[_0xc250('0x3f')][0x2]?_0x3a5b52[_0xc250('0x3f')][0x2][_0xc250('0x40')]:undefined)||null},{'name':_0xc250('0x4c'),'value':_0x3a5b52['attrVoiceQueues']||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x3]?_0x3a5b52['attrs'][0x3][_0xc250('0x40')]:undefined)||[]}];case'web-report':return[{'name':_0xc250('0x52'),'type':_0x3a5b52[_0xc250('0x53')]||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52[_0xc250('0x3f')][0x0]?_0x3a5b52[_0xc250('0x3f')][0x0][_0xc250('0x54')]:undefined)||null,'value':_0x3a5b52[_0xc250('0x52')]||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52['attrs'][0x0]?_0x3a5b52[_0xc250('0x3f')][0x0][_0xc250('0x40')]:undefined)||null},{'name':_0xc250('0x55'),'value':_0x3a5b52[_0xc250('0x55')]||(_0x3a5b52[_0xc250('0x3f')]&&_0x3a5b52['attrs'][0x1]?_0x3a5b52[_0xc250('0x3f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x59c813){logger[_0xc250('0x2b')](_0xc250('0x56'),JSON['stringify'](_0x59c813));return[];}}exports[_0xc250('0x57')]=function(_0x48a6c4,_0x7090c3){if(_0x48a6c4['body']){_0x48a6c4[_0xc250('0x58')][_0xc250('0x3f')]=widgetAttributes(_0x48a6c4[_0xc250('0x58')]);}return db[_0xc250('0x3d')][_0xc250('0x57')](_0x48a6c4[_0xc250('0x58')],{})[_0xc250('0x29')](respondWithResult(_0x7090c3,0xc9))[_0xc250('0x3c')](handleError(_0x7090c3,null));};exports[_0xc250('0x27')]=function(_0x4ad5d1,_0xb45d46){if(_0x4ad5d1[_0xc250('0x58')]['id']){delete _0x4ad5d1[_0xc250('0x58')]['id'];}_0x4ad5d1[_0xc250('0x58')][_0xc250('0x3f')]=widgetAttributes(_0x4ad5d1[_0xc250('0x58')]);return db['DashboardItem'][_0xc250('0x3b')]({'where':{'id':_0x4ad5d1[_0xc250('0x30')]['id']}})[_0xc250('0x29')](handleEntityNotFound(_0xb45d46,null))['then'](saveUpdates(_0x4ad5d1[_0xc250('0x58')],null))[_0xc250('0x29')](respondWithResult(_0xb45d46,null))[_0xc250('0x3c')](handleError(_0xb45d46,null));};
\ No newline at end of file
index 1ef301c..db89361 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x523d=['exports','events','DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4d8e83,_0x466624){var _0x408c91=function(_0x3ac53c){while(--_0x3ac53c){_0x4d8e83['push'](_0x4d8e83['shift']());}};_0x408c91(++_0x466624);}(_0x523d,0x119));var _0xd523=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x523d[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xd523('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xd523('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd523('0x2')](0x0);var events={'afterCreate':_0xd523('0x3'),'afterUpdate':'update','afterDestroy':_0xd523('0x4')};function emitEvent(_0x273119){return function(_0x28d6dc,_0x26e0c2,_0x41dd76){DashboardItemEvents[_0xd523('0x5')](_0x273119+':'+_0x28d6dc['id'],_0x28d6dc);DashboardItemEvents[_0xd523('0x5')](_0x273119,_0x28d6dc);_0x41dd76(null);};}for(var e in events){if(events[_0xd523('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xd523('0x7')]=DashboardItemEvents;
\ No newline at end of file
+var _0xd248=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x115159,_0xbb2343){var _0x4b886d=function(_0x3fafe1){while(--_0x3fafe1){_0x115159['push'](_0x115159['shift']());}};_0x4b886d(++_0xbb2343);}(_0xd248,0x11f));var _0x8d24=function(_0x2debb4,_0xdcc685){_0x2debb4=_0x2debb4-0x0;var _0x427de3=_0xd248[_0x2debb4];return _0x427de3;};'use strict';var EventEmitter=require(_0x8d24('0x0'));var DashboardItem=require(_0x8d24('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8d24('0x2'),'afterUpdate':_0x8d24('0x3'),'afterDestroy':_0x8d24('0x4')};function emitEvent(_0x39c48f){return function(_0x9ea700,_0x4952f1,_0x287b7c){DashboardItemEvents['emit'](_0x39c48f+':'+_0x9ea700['id'],_0x9ea700);DashboardItemEvents[_0x8d24('0x5')](_0x39c48f,_0x9ea700);_0x287b7c(null);};}for(var e in events){if(events[_0x8d24('0x6')](e)){var event=events[e];DashboardItem[_0x8d24('0x7')](e,emitEvent(event));}}module[_0x8d24('0x8')]=DashboardItemEvents;
\ No newline at end of file
index ce39daa..454d6ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c6d=['request-promise','rimraf','define','dashboard_items','util','../../config/logger','api','moment','bluebird'];(function(_0xda1d2f,_0x270bcc){var _0x4cbdd2=function(_0x324aeb){while(--_0x324aeb){_0xda1d2f['push'](_0xda1d2f['shift']());}};_0x4cbdd2(++_0x270bcc);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x8fd5d3,_0xa3c6a1){_0x8fd5d3=_0x8fd5d3-0x0;var _0x5ae8bf=_0x0c6d[_0x8fd5d3];return _0x5ae8bf;};'use strict';var _=require('lodash');var util=require(_0xd0c6('0x0'));var logger=require(_0xd0c6('0x1'))(_0xd0c6('0x2'));var moment=require(_0xd0c6('0x3'));var BPromise=require(_0xd0c6('0x4'));var rp=require(_0xd0c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0c6('0x6'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x2b4c40,_0x41f475){return _0x2b4c40[_0xd0c6('0x7')]('DashboardItem',attributes,{'tableName':_0xd0c6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d02=['moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','DashboardItem','dashboard_items'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8d02,0x13b));var _0x28d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8d02[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x28d0('0x0'));var BPromise=require(_0x28d0('0x1'));var rp=require(_0x28d0('0x2'));var fs=require('fs');var path=require(_0x28d0('0x3'));var rimraf=require(_0x28d0('0x4'));var config=require('../../config/environment');var attributes=require(_0x28d0('0x5'));module[_0x28d0('0x6')]=function(_0x1543c0,_0x23b77c){return _0x1543c0['define'](_0x28d0('0x7'),attributes,{'tableName':_0x28d0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 17e50f4..10f92a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ea4=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ea4,0xa4));var _0x45ea=function(_0x479684,_0x248619){_0x479684=_0x479684-0x0;var _0x3df188=_0x5ea4[_0x479684];return _0x3df188;};'use strict';var _=require(_0x45ea('0x0'));var util=require(_0x45ea('0x1'));var moment=require(_0x45ea('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45ea('0x3'));var db=require(_0x45ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x45ea('0x5'))('rpc');var config=require(_0x45ea('0x6'));var jayson=require(_0x45ea('0x7'));var client=jayson['client'][_0x45ea('0x8')]({'port':0x232a});config[_0x45ea('0x9')]=_[_0x45ea('0xa')](config['redis'],{'host':_0x45ea('0xb'),'port':0x18eb});var socket=require(_0x45ea('0xc'))(new Redis(config[_0x45ea('0x9')]));require(_0x45ea('0xd'))[_0x45ea('0xe')](socket);function respondWithRpcPromise(_0x530397,_0x290f67,_0xb0841a){return new BPromise(function(_0x27277a,_0x4f8567){return client[_0x45ea('0xf')](_0x530397,_0xb0841a)[_0x45ea('0x10')](function(_0x382f0d){logger[_0x45ea('0x11')](_0x45ea('0x12'),_0x290f67,_0x45ea('0x13'));logger[_0x45ea('0x14')](_0x45ea('0x15'),_0x290f67,'request\x20sent',JSON[_0x45ea('0x16')](_0x382f0d));if(_0x382f0d[_0x45ea('0x17')]){if(_0x382f0d[_0x45ea('0x17')][_0x45ea('0x18')]===0x1f4){logger[_0x45ea('0x17')](_0x45ea('0x12'),_0x290f67,_0x382f0d['error'][_0x45ea('0x19')]);return _0x4f8567(_0x382f0d['error'][_0x45ea('0x19')]);}logger[_0x45ea('0x17')](_0x45ea('0x12'),_0x290f67,_0x382f0d[_0x45ea('0x17')][_0x45ea('0x19')]);return _0x27277a(_0x382f0d[_0x45ea('0x17')][_0x45ea('0x19')]);}else{logger[_0x45ea('0x11')]('DashboardItem,\x20%s,\x20%s',_0x290f67,_0x45ea('0x13'));_0x27277a(_0x382f0d[_0x45ea('0x1a')][_0x45ea('0x19')]);}})[_0x45ea('0x1b')](function(_0x167628){logger[_0x45ea('0x17')](_0x45ea('0x12'),_0x290f67,_0x167628);_0x4f8567(_0x167628);});});}
\ No newline at end of file
+var _0x3de9=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','info','request\x20sent','debug','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','util'];(function(_0x4dc095,_0x2e510e){var _0x37b1b1=function(_0x3e6001){while(--_0x3e6001){_0x4dc095['push'](_0x4dc095['shift']());}};_0x37b1b1(++_0x2e510e);}(_0x3de9,0x1f3));var _0x93de=function(_0x522f80,_0x1f8ebb){_0x522f80=_0x522f80-0x0;var _0x8f37e3=_0x3de9[_0x522f80];return _0x8f37e3;};'use strict';var _=require('lodash');var util=require(_0x93de('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x93de('0x1'));var fs=require('fs');var Redis=require(_0x93de('0x2'));var db=require(_0x93de('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x93de('0x4'));var config=require(_0x93de('0x5'));var jayson=require(_0x93de('0x6'));var client=jayson[_0x93de('0x7')][_0x93de('0x8')]({'port':0x232a});config[_0x93de('0x9')]=_[_0x93de('0xa')](config[_0x93de('0x9')],{'host':_0x93de('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x93de('0x9')]));require(_0x93de('0xc'))[_0x93de('0xd')](socket);function respondWithRpcPromise(_0x39bdf8,_0x3ce8b0,_0x19a504){return new BPromise(function(_0x13f359,_0x180b21){return client[_0x93de('0xe')](_0x39bdf8,_0x19a504)['then'](function(_0x37dfa4){logger[_0x93de('0xf')]('DashboardItem,\x20%s,\x20%s',_0x3ce8b0,_0x93de('0x10'));logger[_0x93de('0x11')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3ce8b0,'request\x20sent',JSON[_0x93de('0x12')](_0x37dfa4));if(_0x37dfa4[_0x93de('0x13')]){if(_0x37dfa4[_0x93de('0x13')][_0x93de('0x14')]===0x1f4){logger[_0x93de('0x13')](_0x93de('0x15'),_0x3ce8b0,_0x37dfa4[_0x93de('0x13')]['message']);return _0x180b21(_0x37dfa4['error'][_0x93de('0x16')]);}logger[_0x93de('0x13')](_0x93de('0x15'),_0x3ce8b0,_0x37dfa4['error'][_0x93de('0x16')]);return _0x13f359(_0x37dfa4['error']['message']);}else{logger[_0x93de('0xf')](_0x93de('0x15'),_0x3ce8b0,_0x93de('0x10'));_0x13f359(_0x37dfa4[_0x93de('0x17')][_0x93de('0x16')]);}})[_0x93de('0x18')](function(_0x28f081){logger[_0x93de('0x13')](_0x93de('0x15'),_0x3ce8b0,_0x28f081);_0x180b21(_0x28f081);});});}
\ No newline at end of file
index 8daf393..a9d8b05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06db=['emit','./dashboardItem.events','save','update'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x06db,0x101));var _0xb06d=function(_0x20c9c3,_0x526dc3){_0x20c9c3=_0x20c9c3-0x0;var _0x10e0e6=_0x06db[_0x20c9c3];return _0x10e0e6;};'use strict';var DashboardItemEvents=require(_0xb06d('0x0'));var events=[_0xb06d('0x1'),'remove',_0xb06d('0x2')];function createListener(_0x27a24f,_0x2b3ab6){return function(_0x105db9){_0x2b3ab6[_0xb06d('0x3')](_0x27a24f,_0x105db9);};}function removeListener(_0x48df83,_0x17ecf4){return function(){DashboardItemEvents['removeListener'](_0x48df83,_0x17ecf4);};}exports['register']=function(_0x397e7e){for(var _0x5301aa=0x0,_0x68020e=events['length'];_0x5301aa<_0x68020e;_0x5301aa++){var _0x3ea1b0=events[_0x5301aa];var _0x5369ef=createListener('dashboardItem:'+_0x3ea1b0,_0x397e7e);DashboardItemEvents['on'](_0x3ea1b0,_0x5369ef);}};
\ No newline at end of file
+var _0x8c24=['register','length','dashboardItem:','./dashboardItem.events','save','emit','removeListener'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8c24,0x130));var _0x48c2=function(_0x3ee9d6,_0x11b438){_0x3ee9d6=_0x3ee9d6-0x0;var _0x3cda3b=_0x8c24[_0x3ee9d6];return _0x3cda3b;};'use strict';var DashboardItemEvents=require(_0x48c2('0x0'));var events=[_0x48c2('0x1'),'remove','update'];function createListener(_0x4e637c,_0x2087e8){return function(_0x30e6d2){_0x2087e8[_0x48c2('0x2')](_0x4e637c,_0x30e6d2);};}function removeListener(_0x58b0c0,_0x2d2bfe){return function(){DashboardItemEvents[_0x48c2('0x3')](_0x58b0c0,_0x2d2bfe);};}exports[_0x48c2('0x4')]=function(_0x284a61){for(var _0x24f903=0x0,_0x57c864=events[_0x48c2('0x5')];_0x24f903<_0x57c864;_0x24f903++){var _0x17a91=events[_0x24f903];var _0x3b7e58=createListener(_0x48c2('0x6')+_0x17a91,_0x284a61);DashboardItemEvents['on'](_0x17a91,_0x3b7e58);}};
\ No newline at end of file
index 0b1c597..fb8838f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53e3=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./dashboardItem.controller','get','isAuthenticated','show'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x53e3,0x138));var _0x353e=function(_0x360580,_0x3d0666){_0x360580=_0x360580-0x0;var _0x4f3b3a=_0x53e3[_0x360580];return _0x4f3b3a;};'use strict';var multer=require(_0x353e('0x0'));var util=require(_0x353e('0x1'));var path=require(_0x353e('0x2'));var timeout=require(_0x353e('0x3'));var express=require(_0x353e('0x4'));var router=express[_0x353e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x353e('0x6'));var config=require('../../config/environment');var controller=require(_0x353e('0x7'));router[_0x353e('0x8')]('/:id',auth[_0x353e('0x9')](),controller[_0x353e('0xa')]);router[_0x353e('0xb')]('/',auth[_0x353e('0x9')](),controller[_0x353e('0xc')]);router[_0x353e('0xd')](_0x353e('0xe'),auth[_0x353e('0x9')](),controller[_0x353e('0xf')]);router[_0x353e('0x10')](_0x353e('0xe'),auth[_0x353e('0x9')](),controller[_0x353e('0x11')]);module[_0x353e('0x12')]=router;
\ No newline at end of file
+var _0x649a=['create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x649a,0x1df));var _0xa649=function(_0x21eb3c,_0x7ce88b){_0x21eb3c=_0x21eb3c-0x0;var _0x4bd2aa=_0x649a[_0x21eb3c];return _0x4bd2aa;};'use strict';var multer=require(_0xa649('0x0'));var util=require(_0xa649('0x1'));var path=require(_0xa649('0x2'));var timeout=require(_0xa649('0x3'));var express=require(_0xa649('0x4'));var router=express[_0xa649('0x5')]();var fs_extra=require(_0xa649('0x6'));var auth=require(_0xa649('0x7'));var interaction=require(_0xa649('0x8'));var config=require(_0xa649('0x9'));var controller=require(_0xa649('0xa'));router[_0xa649('0xb')]('/:id',auth[_0xa649('0xc')](),controller[_0xa649('0xd')]);router[_0xa649('0xe')]('/',auth[_0xa649('0xc')](),controller[_0xa649('0xf')]);router[_0xa649('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa649('0x11')]('/:id',auth[_0xa649('0xc')](),controller[_0xa649('0x12')]);module['exports']=router;
\ No newline at end of file
index 9afeb15..821366c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa96c=['exports','STRING','ENUM','first','third'];(function(_0x41a985,_0x138e2c){var _0x43f9f2=function(_0x236d24){while(--_0x236d24){_0x41a985['push'](_0x41a985['shift']());}};_0x43f9f2(++_0x138e2c);}(_0xa96c,0xc8));var _0xca96=function(_0x163b7b,_0x2da650){_0x163b7b=_0x163b7b-0x0;var _0x547a33=_0xa96c[_0x163b7b];return _0x547a33;};'use strict';var Sequelize=require('sequelize');module[_0xca96('0x0')]={'name':{'type':Sequelize[_0xca96('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xca96('0x2')](_0xca96('0x3'),'second',_0xca96('0x4')),'allowNull':![],'defaultValue':_0xca96('0x3')},'description':{'type':Sequelize[_0xca96('0x1')]}};
\ No newline at end of file
+var _0x4116=['first','second','third','sequelize','exports','STRING'];(function(_0x15ec4e,_0x40b7e0){var _0xb5e5dd=function(_0x42bdd7){while(--_0x42bdd7){_0x15ec4e['push'](_0x15ec4e['shift']());}};_0xb5e5dd(++_0x40b7e0);}(_0x4116,0x1d1));var _0x6411=function(_0x35d291,_0x1a131b){_0x35d291=_0x35d291-0x0;var _0x370b86=_0x4116[_0x35d291];return _0x370b86;};'use strict';var Sequelize=require(_0x6411('0x0'));module[_0x6411('0x1')]={'name':{'type':Sequelize[_0x6411('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x6411('0x3'),_0x6411('0x4'),_0x6411('0x5')),'allowNull':![],'defaultValue':_0x6411('0x3')},'description':{'type':Sequelize[_0x6411('0x2')]}};
\ No newline at end of file
index e2ee653..2ad4564 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbff5=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','include','findAll','rows','show','params','includeAll','merge','options','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','name','send','index','map','Disposition','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0x428b22,_0x455b1a){var _0x1e5bce=function(_0xc0f5e9){while(--_0xc0f5e9){_0x428b22['push'](_0x428b22['shift']());}};_0x1e5bce(++_0x455b1a);}(_0xbff5,0x1bc));var _0x5bff=function(_0x495a09,_0x32bd82){_0x495a09=_0x495a09-0x0;var _0x2dabe3=_0xbff5[_0x495a09];return _0x2dabe3;};'use strict';var emlformat=require(_0x5bff('0x0'));var rimraf=require(_0x5bff('0x1'));var zipdir=require(_0x5bff('0x2'));var jsonpatch=require(_0x5bff('0x3'));var rp=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var BPromise=require(_0x5bff('0x6'));var Mustache=require('mustache');var util=require(_0x5bff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bff('0x8'));var ejs=require(_0x5bff('0x9'));var fs=require('fs');var fs_extra=require(_0x5bff('0xa'));var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x8'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bff('0x13'));var logger=require('../../config/logger')(_0x5bff('0x14'));var utils=require('../../config/utils');var config=require(_0x5bff('0x15'));var licenseUtil=require(_0x5bff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132dc9,_0x50e1e9){_0x50e1e9=_0x50e1e9||0xcc;return function(_0x335e78){if(_0x335e78){return _0x132dc9[_0x5bff('0x17')](_0x50e1e9);}return _0x132dc9['status'](_0x50e1e9)[_0x5bff('0x18')]();};}function respondWithResult(_0xa16a3f,_0x5b0d2d){_0x5b0d2d=_0x5b0d2d||0xc8;return function(_0x5f2a55){if(_0x5f2a55){return _0xa16a3f[_0x5bff('0x19')](_0x5b0d2d)[_0x5bff('0x1a')](_0x5f2a55);}};}function respondWithFilteredResult(_0x3a507c,_0x4d883e){return function(_0x2d22ab){if(_0x2d22ab){var _0x4612ec=typeof _0x4d883e[_0x5bff('0x1b')]==='undefined'&&typeof _0x4d883e[_0x5bff('0x1c')]===_0x5bff('0x1d');var _0x38daa0=_0x2d22ab['count'];var _0xc9fbc3=_0x4612ec?0x0:_0x4d883e[_0x5bff('0x1b')];var _0x36653b=_0x4612ec?_0x2d22ab[_0x5bff('0x1e')]:_0x4d883e['offset']+_0x4d883e[_0x5bff('0x1c')];var _0x5357d4;if(_0x36653b>=_0x38daa0){_0x36653b=_0x38daa0;_0x5357d4=0xc8;}else{_0x5357d4=0xce;}_0x3a507c[_0x5bff('0x19')](_0x5357d4);return _0x3a507c['set'](_0x5bff('0x1f'),_0xc9fbc3+'-'+_0x36653b+'/'+_0x38daa0)[_0x5bff('0x1a')](_0x2d22ab);}return null;};}function patchUpdates(_0x2a83ce){return function(_0x6cbfa){try{jsonpatch[_0x5bff('0x20')](_0x6cbfa,_0x2a83ce,!![]);}catch(_0x2012e4){return BPromise[_0x5bff('0x21')](_0x2012e4);}return _0x6cbfa[_0x5bff('0x22')]();};}function saveUpdates(_0x155e16,_0x490bc1){return function(_0x5f2593){if(_0x5f2593){return _0x5f2593[_0x5bff('0x23')](_0x155e16)[_0x5bff('0x24')](function(_0x1e7f8a){return _0x1e7f8a;});}return null;};}function removeEntity(_0x352b1f,_0x31d26b){return function(_0x3913fd){if(_0x3913fd){return _0x3913fd[_0x5bff('0x25')]()['then'](function(){var _0x5741d9=_0x3913fd[_0x5bff('0x26')]({'plain':!![]});var _0x53bd97=_0x5bff('0x27');return db[_0x5bff('0x28')][_0x5bff('0x25')]({'where':{'type':_0x53bd97,'resourceId':_0x5741d9['id']}})[_0x5bff('0x24')](function(){return _0x3913fd;});})[_0x5bff('0x24')](function(){_0x352b1f[_0x5bff('0x19')](0xcc)[_0x5bff('0x18')]();});}};}function handleEntityNotFound(_0xedba9d,_0x5a4e82){return function(_0x4df57a){if(!_0x4df57a){_0xedba9d[_0x5bff('0x17')](0x194);}return _0x4df57a;};}function handleError(_0x2dd52f,_0x4d7640){_0x4d7640=_0x4d7640||0x1f4;return function(_0x36a7d2){logger['error'](_0x36a7d2['stack']);if(_0x36a7d2[_0x5bff('0x29')]){delete _0x36a7d2['name'];}_0x2dd52f[_0x5bff('0x19')](_0x4d7640)[_0x5bff('0x2a')](_0x36a7d2);};}exports[_0x5bff('0x2b')]=function(_0x11d48a,_0x48aee1){var _0x71783={},_0x4ee6f1={},_0x3c1405={'count':0x0,'rows':[]};var _0x5a7873=_[_0x5bff('0x2c')](db[_0x5bff('0x2d')][_0x5bff('0x2e')],function(_0x3491e0){return{'name':_0x3491e0[_0x5bff('0x2f')],'type':_0x3491e0[_0x5bff('0x30')]['key']};});_0x4ee6f1[_0x5bff('0x31')]=_[_0x5bff('0x2c')](_0x5a7873,_0x5bff('0x29'));_0x4ee6f1[_0x5bff('0x32')]=_[_0x5bff('0x33')](_0x11d48a[_0x5bff('0x32')]);_0x4ee6f1[_0x5bff('0x34')]=_[_0x5bff('0x35')](_0x4ee6f1['model'],_0x4ee6f1[_0x5bff('0x32')]);_0x71783[_0x5bff('0x36')]=_[_0x5bff('0x35')](_0x4ee6f1[_0x5bff('0x31')],qs['fields'](_0x11d48a[_0x5bff('0x32')][_0x5bff('0x37')]));_0x71783['attributes']=_0x71783[_0x5bff('0x36')][_0x5bff('0x38')]?_0x71783[_0x5bff('0x36')]:_0x4ee6f1[_0x5bff('0x31')];if(!_0x11d48a['query'][_0x5bff('0x39')](_0x5bff('0x3a'))){_0x71783[_0x5bff('0x1c')]=qs['limit'](_0x11d48a[_0x5bff('0x32')]['limit']);_0x71783[_0x5bff('0x1b')]=qs[_0x5bff('0x1b')](_0x11d48a[_0x5bff('0x32')]['offset']);}_0x71783[_0x5bff('0x3b')]=qs[_0x5bff('0x3c')](_0x11d48a[_0x5bff('0x32')]['sort']);_0x71783[_0x5bff('0x3d')]=qs[_0x5bff('0x34')](_['pick'](_0x11d48a[_0x5bff('0x32')],_0x4ee6f1[_0x5bff('0x34')]),_0x5a7873);if(_0x11d48a[_0x5bff('0x32')][_0x5bff('0x3e')]){_0x71783[_0x5bff('0x3d')]=_['merge'](_0x71783[_0x5bff('0x3d')],{'$or':_['map'](_0x5a7873,function(_0x449c6a){if(_0x449c6a[_0x5bff('0x30')]!==_0x5bff('0x3f')){var _0x3a0a20={};_0x3a0a20[_0x449c6a[_0x5bff('0x29')]]={'$like':'%'+_0x11d48a[_0x5bff('0x32')][_0x5bff('0x3e')]+'%'};return _0x3a0a20;}})});}_0x71783=_['merge']({},_0x71783,_0x11d48a['options']);var _0x12f0db={'where':_0x71783[_0x5bff('0x3d')]};return db[_0x5bff('0x2d')][_0x5bff('0x1e')](_0x12f0db)[_0x5bff('0x24')](function(_0xb7b82a){_0x3c1405[_0x5bff('0x1e')]=_0xb7b82a;if(_0x11d48a[_0x5bff('0x32')]['includeAll']){_0x71783[_0x5bff('0x40')]=[{'all':!![]}];}return db['Disposition'][_0x5bff('0x41')](_0x71783);})[_0x5bff('0x24')](function(_0x543517){_0x3c1405[_0x5bff('0x42')]=_0x543517;return _0x3c1405;})[_0x5bff('0x24')](respondWithFilteredResult(_0x48aee1,_0x71783))['catch'](handleError(_0x48aee1,null));};exports[_0x5bff('0x43')]=function(_0x11a75b,_0x2c3afe){var _0x4bb4be={'raw':!![],'where':{'id':_0x11a75b[_0x5bff('0x44')]['id']}},_0x35e5f4={};_0x35e5f4[_0x5bff('0x31')]=_['keys'](db[_0x5bff('0x2d')][_0x5bff('0x2e')]);_0x35e5f4[_0x5bff('0x32')]=_[_0x5bff('0x33')](_0x11a75b['query']);_0x35e5f4[_0x5bff('0x34')]=_['intersection'](_0x35e5f4['model'],_0x35e5f4[_0x5bff('0x32')]);_0x4bb4be[_0x5bff('0x36')]=_['intersection'](_0x35e5f4[_0x5bff('0x31')],qs[_0x5bff('0x37')](_0x11a75b['query'][_0x5bff('0x37')]));_0x4bb4be[_0x5bff('0x36')]=_0x4bb4be[_0x5bff('0x36')][_0x5bff('0x38')]?_0x4bb4be['attributes']:_0x35e5f4[_0x5bff('0x31')];if(_0x11a75b[_0x5bff('0x32')][_0x5bff('0x45')]){_0x4bb4be[_0x5bff('0x40')]=[{'all':!![]}];}_0x4bb4be=_[_0x5bff('0x46')]({},_0x4bb4be,_0x11a75b[_0x5bff('0x47')]);return db['Disposition'][_0x5bff('0x48')](_0x4bb4be)[_0x5bff('0x24')](handleEntityNotFound(_0x2c3afe,null))['then'](respondWithResult(_0x2c3afe,null))[_0x5bff('0x49')](handleError(_0x2c3afe,null));};exports['create']=function(_0x47fc14,_0x4ff13a){return db[_0x5bff('0x2d')][_0x5bff('0x4a')](_0x47fc14['body'],{})[_0x5bff('0x24')](function(_0xd89c21){var _0x3360d8=_0x47fc14[_0x5bff('0x4b')][_0x5bff('0x26')]({'plain':!![]});if(!_0x3360d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3360d8[_0x5bff('0x4c')]===_0x5bff('0x4b')){var _0x5e99f5=_0xd89c21[_0x5bff('0x26')]({'plain':!![]});var _0x48feaa=_0x5bff('0x27');return db[_0x5bff('0x4d')][_0x5bff('0x48')]({'where':{'name':_0x48feaa,'userProfileId':_0x3360d8[_0x5bff('0x4e')]},'raw':!![]})[_0x5bff('0x24')](function(_0x4914e7){if(_0x4914e7&&_0x4914e7[_0x5bff('0x4f')]===0x0){return db[_0x5bff('0x28')]['create']({'name':_0x5e99f5[_0x5bff('0x29')],'resourceId':_0x5e99f5['id'],'type':_0x4914e7[_0x5bff('0x29')],'sectionId':_0x4914e7['id']},{})['then'](function(){return _0xd89c21;});}else{return _0xd89c21;}})[_0x5bff('0x49')](function(_0x3cb8ae){logger[_0x5bff('0x50')](_0x5bff('0x51'),_0x3cb8ae);throw _0x3cb8ae;});}return _0xd89c21;})[_0x5bff('0x24')](respondWithResult(_0x4ff13a,0xc9))[_0x5bff('0x49')](handleError(_0x4ff13a,null));};exports['update']=function(_0x4c8847,_0x111f7e){if(_0x4c8847['body']['id']){delete _0x4c8847[_0x5bff('0x52')]['id'];}return db[_0x5bff('0x2d')][_0x5bff('0x48')]({'where':{'id':_0x4c8847[_0x5bff('0x44')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x111f7e,null))[_0x5bff('0x24')](saveUpdates(_0x4c8847[_0x5bff('0x52')],null))[_0x5bff('0x24')](respondWithResult(_0x111f7e,null))[_0x5bff('0x49')](handleError(_0x111f7e,null));};exports[_0x5bff('0x25')]=function(_0x4364c7,_0x50c812){return db['Disposition'][_0x5bff('0x48')]({'where':{'id':_0x4364c7['params']['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x50c812,null))['then'](removeEntity(_0x50c812,null))[_0x5bff('0x49')](handleError(_0x50c812,null));};
\ No newline at end of file
+var _0x3d46=['map','Disposition','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','user','get','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','Dispositions','sendStatus','error','stack','name','send','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d46,0x170));var _0x63d4=function(_0x52ce97,_0xd348c5){_0x52ce97=_0x52ce97-0x0;var _0x23d707=_0x3d46[_0x52ce97];return _0x23d707;};'use strict';var emlformat=require(_0x63d4('0x0'));var rimraf=require(_0x63d4('0x1'));var zipdir=require(_0x63d4('0x2'));var jsonpatch=require(_0x63d4('0x3'));var rp=require(_0x63d4('0x4'));var moment=require(_0x63d4('0x5'));var BPromise=require(_0x63d4('0x6'));var Mustache=require(_0x63d4('0x7'));var util=require('util');var path=require(_0x63d4('0x8'));var sox=require('sox');var csv=require(_0x63d4('0x9'));var ejs=require(_0x63d4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x63d4('0xb'));var squel=require(_0x63d4('0xc'));var crypto=require(_0x63d4('0xd'));var jsforce=require(_0x63d4('0xe'));var deskjs=require(_0x63d4('0xf'));var toCsv=require(_0x63d4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x63d4('0x10'));var authService=require(_0x63d4('0x11'));var qs=require(_0x63d4('0x12'));var as=require(_0x63d4('0x13'));var hardwareService=require(_0x63d4('0x14'));var logger=require('../../config/logger')(_0x63d4('0x15'));var utils=require(_0x63d4('0x16'));var config=require(_0x63d4('0x17'));var licenseUtil=require(_0x63d4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20a885,_0x3366d2){_0x3366d2=_0x3366d2||0xcc;return function(_0x5c85e8){if(_0x5c85e8){return _0x20a885['sendStatus'](_0x3366d2);}return _0x20a885[_0x63d4('0x19')](_0x3366d2)[_0x63d4('0x1a')]();};}function respondWithResult(_0x3005c4,_0x2d4c59){_0x2d4c59=_0x2d4c59||0xc8;return function(_0x1739f5){if(_0x1739f5){return _0x3005c4[_0x63d4('0x19')](_0x2d4c59)[_0x63d4('0x1b')](_0x1739f5);}};}function respondWithFilteredResult(_0x415f31,_0x4c57d3){return function(_0x5a63cf){if(_0x5a63cf){var _0x39b9f1=typeof _0x4c57d3[_0x63d4('0x1c')]===_0x63d4('0x1d')&&typeof _0x4c57d3[_0x63d4('0x1e')]===_0x63d4('0x1d');var _0x181243=_0x5a63cf['count'];var _0xdfd0da=_0x39b9f1?0x0:_0x4c57d3[_0x63d4('0x1c')];var _0x258999=_0x39b9f1?_0x5a63cf[_0x63d4('0x1f')]:_0x4c57d3[_0x63d4('0x1c')]+_0x4c57d3['limit'];var _0x103482;if(_0x258999>=_0x181243){_0x258999=_0x181243;_0x103482=0xc8;}else{_0x103482=0xce;}_0x415f31[_0x63d4('0x19')](_0x103482);return _0x415f31[_0x63d4('0x20')](_0x63d4('0x21'),_0xdfd0da+'-'+_0x258999+'/'+_0x181243)[_0x63d4('0x1b')](_0x5a63cf);}return null;};}function patchUpdates(_0x11e7b3){return function(_0x19a46a){try{jsonpatch[_0x63d4('0x22')](_0x19a46a,_0x11e7b3,!![]);}catch(_0x4a719e){return BPromise[_0x63d4('0x23')](_0x4a719e);}return _0x19a46a[_0x63d4('0x24')]();};}function saveUpdates(_0x562c5b,_0x3c7f5a){return function(_0x29a277){if(_0x29a277){return _0x29a277[_0x63d4('0x25')](_0x562c5b)['then'](function(_0x1ef28d){return _0x1ef28d;});}return null;};}function removeEntity(_0x34618c,_0x13143f){return function(_0x46206d){if(_0x46206d){return _0x46206d[_0x63d4('0x26')]()[_0x63d4('0x27')](function(){var _0x5df662=_0x46206d['get']({'plain':!![]});var _0x18bfe6=_0x63d4('0x28');return db['UserProfileResource'][_0x63d4('0x26')]({'where':{'type':_0x18bfe6,'resourceId':_0x5df662['id']}})[_0x63d4('0x27')](function(){return _0x46206d;});})[_0x63d4('0x27')](function(){_0x34618c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc93809,_0x3b38a0){return function(_0x4d22ec){if(!_0x4d22ec){_0xc93809[_0x63d4('0x29')](0x194);}return _0x4d22ec;};}function handleError(_0x4cfd35,_0x233a23){_0x233a23=_0x233a23||0x1f4;return function(_0x17d3eb){logger[_0x63d4('0x2a')](_0x17d3eb[_0x63d4('0x2b')]);if(_0x17d3eb[_0x63d4('0x2c')]){delete _0x17d3eb[_0x63d4('0x2c')];}_0x4cfd35[_0x63d4('0x19')](_0x233a23)[_0x63d4('0x2d')](_0x17d3eb);};}exports[_0x63d4('0x2e')]=function(_0x474115,_0x1c33f6){var _0x55a105={},_0x1a90b0={},_0x5e287b={'count':0x0,'rows':[]};var _0x1fb3e4=_[_0x63d4('0x2f')](db[_0x63d4('0x30')]['rawAttributes'],function(_0x4d7ff1){return{'name':_0x4d7ff1[_0x63d4('0x31')],'type':_0x4d7ff1[_0x63d4('0x32')][_0x63d4('0x33')]};});_0x1a90b0[_0x63d4('0x34')]=_[_0x63d4('0x2f')](_0x1fb3e4,_0x63d4('0x2c'));_0x1a90b0[_0x63d4('0x35')]=_[_0x63d4('0x36')](_0x474115[_0x63d4('0x35')]);_0x1a90b0[_0x63d4('0x37')]=_[_0x63d4('0x38')](_0x1a90b0[_0x63d4('0x34')],_0x1a90b0['query']);_0x55a105['attributes']=_[_0x63d4('0x38')](_0x1a90b0['model'],qs['fields'](_0x474115['query'][_0x63d4('0x39')]));_0x55a105[_0x63d4('0x3a')]=_0x55a105[_0x63d4('0x3a')][_0x63d4('0x3b')]?_0x55a105[_0x63d4('0x3a')]:_0x1a90b0[_0x63d4('0x34')];if(!_0x474115[_0x63d4('0x35')][_0x63d4('0x3c')]('nolimit')){_0x55a105[_0x63d4('0x1e')]=qs['limit'](_0x474115[_0x63d4('0x35')][_0x63d4('0x1e')]);_0x55a105[_0x63d4('0x1c')]=qs['offset'](_0x474115[_0x63d4('0x35')][_0x63d4('0x1c')]);}_0x55a105['order']=qs[_0x63d4('0x3d')](_0x474115['query'][_0x63d4('0x3d')]);_0x55a105[_0x63d4('0x3e')]=qs[_0x63d4('0x37')](_['pick'](_0x474115[_0x63d4('0x35')],_0x1a90b0[_0x63d4('0x37')]),_0x1fb3e4);if(_0x474115[_0x63d4('0x35')]['filter']){_0x55a105['where']=_[_0x63d4('0x3f')](_0x55a105[_0x63d4('0x3e')],{'$or':_[_0x63d4('0x2f')](_0x1fb3e4,function(_0x7571c6){if(_0x7571c6[_0x63d4('0x32')]!==_0x63d4('0x40')){var _0x34769f={};_0x34769f[_0x7571c6[_0x63d4('0x2c')]]={'$like':'%'+_0x474115[_0x63d4('0x35')][_0x63d4('0x41')]+'%'};return _0x34769f;}})});}_0x55a105=_['merge']({},_0x55a105,_0x474115[_0x63d4('0x42')]);var _0x44556e={'where':_0x55a105['where']};return db['Disposition'][_0x63d4('0x1f')](_0x44556e)[_0x63d4('0x27')](function(_0x3aec5a){_0x5e287b[_0x63d4('0x1f')]=_0x3aec5a;if(_0x474115[_0x63d4('0x35')][_0x63d4('0x43')]){_0x55a105[_0x63d4('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x63d4('0x45')](_0x55a105);})[_0x63d4('0x27')](function(_0x47c5cf){_0x5e287b[_0x63d4('0x46')]=_0x47c5cf;return _0x5e287b;})[_0x63d4('0x27')](respondWithFilteredResult(_0x1c33f6,_0x55a105))['catch'](handleError(_0x1c33f6,null));};exports[_0x63d4('0x47')]=function(_0x9bb1e4,_0x5d5ee5){var _0x137bf8={'raw':!![],'where':{'id':_0x9bb1e4[_0x63d4('0x48')]['id']}},_0x2db127={};_0x2db127['model']=_['keys'](db[_0x63d4('0x30')][_0x63d4('0x49')]);_0x2db127[_0x63d4('0x35')]=_['keys'](_0x9bb1e4[_0x63d4('0x35')]);_0x2db127[_0x63d4('0x37')]=_[_0x63d4('0x38')](_0x2db127[_0x63d4('0x34')],_0x2db127[_0x63d4('0x35')]);_0x137bf8[_0x63d4('0x3a')]=_[_0x63d4('0x38')](_0x2db127[_0x63d4('0x34')],qs['fields'](_0x9bb1e4[_0x63d4('0x35')][_0x63d4('0x39')]));_0x137bf8[_0x63d4('0x3a')]=_0x137bf8[_0x63d4('0x3a')][_0x63d4('0x3b')]?_0x137bf8[_0x63d4('0x3a')]:_0x2db127[_0x63d4('0x34')];if(_0x9bb1e4[_0x63d4('0x35')][_0x63d4('0x43')]){_0x137bf8['include']=[{'all':!![]}];}_0x137bf8=_[_0x63d4('0x3f')]({},_0x137bf8,_0x9bb1e4[_0x63d4('0x42')]);return db[_0x63d4('0x30')]['find'](_0x137bf8)[_0x63d4('0x27')](handleEntityNotFound(_0x5d5ee5,null))[_0x63d4('0x27')](respondWithResult(_0x5d5ee5,null))[_0x63d4('0x4a')](handleError(_0x5d5ee5,null));};exports[_0x63d4('0x4b')]=function(_0x258eda,_0x2050c2){return db['Disposition'][_0x63d4('0x4b')](_0x258eda[_0x63d4('0x4c')],{})['then'](function(_0x1f1d31){var _0x3e1a15=_0x258eda[_0x63d4('0x4d')][_0x63d4('0x4e')]({'plain':!![]});if(!_0x3e1a15)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1a15['role']===_0x63d4('0x4d')){var _0x165641=_0x1f1d31[_0x63d4('0x4e')]({'plain':!![]});var _0x3cf3bf=_0x63d4('0x28');return db['UserProfileSection'][_0x63d4('0x4f')]({'where':{'name':_0x3cf3bf,'userProfileId':_0x3e1a15['userProfileId']},'raw':!![]})[_0x63d4('0x27')](function(_0x4117fc){if(_0x4117fc&&_0x4117fc[_0x63d4('0x50')]===0x0){return db[_0x63d4('0x51')]['create']({'name':_0x165641[_0x63d4('0x2c')],'resourceId':_0x165641['id'],'type':_0x4117fc['name'],'sectionId':_0x4117fc['id']},{})[_0x63d4('0x27')](function(){return _0x1f1d31;});}else{return _0x1f1d31;}})[_0x63d4('0x4a')](function(_0x1f650b){logger[_0x63d4('0x2a')](_0x63d4('0x52'),_0x1f650b);throw _0x1f650b;});}return _0x1f1d31;})[_0x63d4('0x27')](respondWithResult(_0x2050c2,0xc9))[_0x63d4('0x4a')](handleError(_0x2050c2,null));};exports[_0x63d4('0x25')]=function(_0x195755,_0x19d401){if(_0x195755['body']['id']){delete _0x195755[_0x63d4('0x4c')]['id'];}return db['Disposition'][_0x63d4('0x4f')]({'where':{'id':_0x195755[_0x63d4('0x48')]['id']}})[_0x63d4('0x27')](handleEntityNotFound(_0x19d401,null))['then'](saveUpdates(_0x195755['body'],null))[_0x63d4('0x27')](respondWithResult(_0x19d401,null))['catch'](handleError(_0x19d401,null));};exports['destroy']=function(_0x32d45c,_0x1a2564){return db[_0x63d4('0x30')][_0x63d4('0x4f')]({'where':{'id':_0x32d45c['params']['id']}})['then'](handleEntityNotFound(_0x1a2564,null))[_0x63d4('0x27')](removeEntity(_0x1a2564,null))[_0x63d4('0x4a')](handleError(_0x1a2564,null));};
\ No newline at end of file
index 323c2c1..0855b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bb4=['moment','bluebird','path','rimraf','./disposition.attributes','exports','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api'];(function(_0x5b47e0,_0x4105fb){var _0x588597=function(_0x3fd5a7){while(--_0x3fd5a7){_0x5b47e0['push'](_0x5b47e0['shift']());}};_0x588597(++_0x4105fb);}(_0x7bb4,0x1dc));var _0x47bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bb4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x47bb('0x0'));var util=require(_0x47bb('0x1'));var logger=require(_0x47bb('0x2'))(_0x47bb('0x3'));var moment=require(_0x47bb('0x4'));var BPromise=require(_0x47bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47bb('0x6'));var rimraf=require(_0x47bb('0x7'));var config=require('../../config/environment');var attributes=require(_0x47bb('0x8'));module[_0x47bb('0x9')]=function(_0x3237ff,_0x37cb01){return _0x3237ff['define'](_0x47bb('0xa'),attributes,{'tableName':_0x47bb('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x47bb('0xc'),_0x47bb('0xd')]},{'unique':!![],'name':_0x47bb('0xe'),'fields':['name',_0x47bb('0xf')]},{'unique':!![],'name':_0x47bb('0x10'),'fields':[_0x47bb('0xc'),_0x47bb('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x47bb('0xc'),_0x47bb('0x12')]},{'unique':!![],'name':_0x47bb('0x13'),'fields':[_0x47bb('0xc'),_0x47bb('0x14')]},{'unique':!![],'name':_0x47bb('0x15'),'fields':[_0x47bb('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0x47bb('0x16'),'fields':[_0x47bb('0xc'),_0x47bb('0x17')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x53e2=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','name_sms','SmsAccountId','FaxAccountId','WhatsappAccountId'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x53e2,0xd1));var _0x253e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x53e2[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x253e('0x0'));var util=require(_0x253e('0x1'));var logger=require('../../config/logger')(_0x253e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x253e('0x3'));var fs=require('fs');var path=require(_0x253e('0x4'));var rimraf=require(_0x253e('0x5'));var config=require(_0x253e('0x6'));var attributes=require(_0x253e('0x7'));module['exports']=function(_0x3beb7b,_0x425762){return _0x3beb7b[_0x253e('0x8')](_0x253e('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x253e('0xa'),'fields':[_0x253e('0xb'),_0x253e('0xc')]},{'unique':!![],'name':_0x253e('0xd'),'fields':[_0x253e('0xb'),_0x253e('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0x253e('0xb'),'MailAccountId']},{'unique':!![],'name':_0x253e('0xf'),'fields':[_0x253e('0xb'),_0x253e('0x10')]},{'unique':!![],'name':'name_fax','fields':[_0x253e('0xb'),_0x253e('0x11')]},{'unique':!![],'name':'name_openchannel','fields':[_0x253e('0xb'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x253e('0xb'),_0x253e('0x12')]}],'timestamps':!![]});};
\ No newline at end of file
index 2353b5c..7d7dcc6 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(_0x14ab0c,_0x2e1a23){var _0x47c24f=function(_0x3f5717){while(--_0x3f5717){_0x14ab0c['push'](_0x14ab0c['shift']());}};_0x47c24f(++_0x2e1a23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x573aa8,_0x5242b9){var _0x397576=function(_0x298b43){while(--_0x298b43){_0x573aa8['push'](_0x573aa8['shift']());}};_0x397576(++_0x5242b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 d0c15ba..8384f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf240=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4760b5,_0x27112a){var _0x138635=function(_0x5a59fa){while(--_0x5a59fa){_0x4760b5['push'](_0x4760b5['shift']());}};_0x138635(++_0x27112a);}(_0xf240,0x7a));var _0x0f24=function(_0x1bd8db,_0x25e0e4){_0x1bd8db=_0x1bd8db-0x0;var _0x199eca=_0xf240[_0x1bd8db];return _0x199eca;};'use strict';var multer=require(_0x0f24('0x0'));var util=require(_0x0f24('0x1'));var path=require(_0x0f24('0x2'));var timeout=require(_0x0f24('0x3'));var express=require('express');var router=express[_0x0f24('0x4')]();var fs_extra=require(_0x0f24('0x5'));var auth=require(_0x0f24('0x6'));var interaction=require(_0x0f24('0x7'));var config=require(_0x0f24('0x8'));var controller=require(_0x0f24('0x9'));router[_0x0f24('0xa')]('/',auth['isAuthenticated'](),controller[_0x0f24('0xb')]);router[_0x0f24('0xa')](_0x0f24('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0f24('0xd')]('/',auth[_0x0f24('0xe')](),controller[_0x0f24('0xf')]);router[_0x0f24('0x10')](_0x0f24('0xc'),auth[_0x0f24('0xe')](),controller[_0x0f24('0x11')]);router[_0x0f24('0x12')](_0x0f24('0xc'),auth[_0x0f24('0xe')](),controller[_0x0f24('0x13')]);module[_0x0f24('0x14')]=router;
\ No newline at end of file
+var _0x9999=['fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x4b2d4a,_0x2bf2fc){var _0x517874=function(_0x3849e3){while(--_0x3849e3){_0x4b2d4a['push'](_0x4b2d4a['shift']());}};_0x517874(++_0x2bf2fc);}(_0x9999,0xa7));var _0x9999=function(_0x1d9661,_0x56b058){_0x1d9661=_0x1d9661-0x0;var _0x55b2c8=_0x9999[_0x1d9661];return _0x55b2c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9999('0x0'));var timeout=require(_0x9999('0x1'));var express=require(_0x9999('0x2'));var router=express[_0x9999('0x3')]();var fs_extra=require(_0x9999('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9999('0x5'));var config=require(_0x9999('0x6'));var controller=require(_0x9999('0x7'));router[_0x9999('0x8')]('/',auth[_0x9999('0x9')](),controller[_0x9999('0xa')]);router['get'](_0x9999('0xb'),auth['isAuthenticated'](),controller[_0x9999('0xc')]);router[_0x9999('0xd')]('/',auth[_0x9999('0x9')](),controller[_0x9999('0xe')]);router[_0x9999('0xf')](_0x9999('0xb'),auth[_0x9999('0x9')](),controller[_0x9999('0x10')]);router[_0x9999('0x11')](_0x9999('0xb'),auth[_0x9999('0x9')](),controller[_0x9999('0x12')]);module['exports']=router;
\ No newline at end of file
index 75bb562..a4e73bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe60c=['xCALLY\x20Motion\x20Fax','localstationid','2400','9600','12000','14400','4800','7200','INTEGER','SIP','IAX','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'];(function(_0x28388e,_0x461f91){var _0x264097=function(_0x3d5aa0){while(--_0x3d5aa0){_0x28388e['push'](_0x28388e['shift']());}};_0x264097(++_0x461f91);}(_0xe60c,0x12f));var _0xce60=function(_0x673722,_0x275d7e){_0x673722=_0x673722-0x0;var _0x21249c=_0xe60c[_0x673722];return _0x21249c;};'use strict';var Sequelize=require(_0xce60('0x0'));module[_0xce60('0x1')]={'name':{'type':Sequelize[_0xce60('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xce60('0x3')](_0xce60('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xce60('0x2')],'defaultValue':_0xce60('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xce60('0x6')},'minrate':{'type':Sequelize[_0xce60('0x3')](_0xce60('0x7'),'4800','7200',_0xce60('0x8'),_0xce60('0x9'),_0xce60('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xce60('0x3')]('2400',_0xce60('0xb'),_0xce60('0xc'),_0xce60('0x8'),_0xce60('0x9'),_0xce60('0xa')),'defaultValue':_0xce60('0xa')},'modem':{'type':Sequelize[_0xce60('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xce60('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xce60('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xce60('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xce60('0xe'),_0xce60('0xf'),'DADHI','KHOMP'),'defaultValue':_0xce60('0xe')},'key':{'type':Sequelize[_0xce60('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xce60('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xce60('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xce60('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xce60('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xce60('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xce60('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xce60('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xce60('0x11')],'defaultValue':![],'comment':_0xce60('0x13'),'set':function(_0x232c97){if(!_0x232c97)this[_0xce60('0x14')](_0xce60('0x15'),null);this['setDataValue']('mandatoryDisposition',_0x232c97);}}};
\ No newline at end of file
+var _0x4ea9=['4800','7200','9600','12000','2400','14400','v17,v27,v29','INTEGER','IAX','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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid'];(function(_0x536261,_0x1e3489){var _0x2df67f=function(_0x5e00a6){while(--_0x5e00a6){_0x536261['push'](_0x536261['shift']());}};_0x2df67f(++_0x1e3489);}(_0x4ea9,0xfd));var _0x94ea=function(_0x34d81e,_0x86c65c){_0x34d81e=_0x34d81e-0x0;var _0x1d4f25=_0x4ea9[_0x34d81e];return _0x1d4f25;};'use strict';var Sequelize=require(_0x94ea('0x0'));module[_0x94ea('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x94ea('0x2')]},'ecm':{'type':Sequelize[_0x94ea('0x3')](_0x94ea('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x94ea('0x2')],'defaultValue':_0x94ea('0x5')},'localstationid':{'type':Sequelize[_0x94ea('0x2')],'unique':_0x94ea('0x6')},'minrate':{'type':Sequelize['ENUM']('2400',_0x94ea('0x7'),_0x94ea('0x8'),_0x94ea('0x9'),_0x94ea('0xa'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x94ea('0x3')](_0x94ea('0xb'),_0x94ea('0x7'),_0x94ea('0x8'),_0x94ea('0x9'),_0x94ea('0xa'),_0x94ea('0xc')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x94ea('0x2')],'defaultValue':_0x94ea('0xd')},'gateway':{'type':Sequelize[_0x94ea('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[_0x94ea('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x94ea('0x3')]('SIP',_0x94ea('0xf'),_0x94ea('0x10'),_0x94ea('0x11')),'defaultValue':_0x94ea('0x12')},'key':{'type':Sequelize[_0x94ea('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x94ea('0x13')],'defaultValue':function(){return _0x94ea('0x14');}},'notificationSound':{'type':Sequelize[_0x94ea('0x15')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x94ea('0x15')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x94ea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x94ea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x94ea('0x15')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x94ea('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x94ea('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x94ea('0x16')},'mandatoryDisposition':{'type':Sequelize[_0x94ea('0x15')],'defaultValue':![],'comment':_0x94ea('0x17'),'set':function(_0x57a90f){if(!_0x57a90f)this['setDataValue'](_0x94ea('0x18'),null);this['setDataValue'](_0x94ea('0x19'),_0x57a90f);}}};
\ No newline at end of file
index 91ce139..bf84818 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd497=['FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','FaxAccounts','UserProfileResource','destroy','end','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','include','FaxAccount','findAll','show','params','mandatoryDispositionPause','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addInteraction','omit','CmContact','Contact','User','Owner','internal','Tag','Tags','tag','FaxInteraction','addApplications','sequelize','FaxApplication','bulkCreate','priority','getApplications','context','localstationid','app','system','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','CmList','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','client','http','request'];(function(_0x4b7230,_0x22e351){var _0x2fc0cf=function(_0x25448d){while(--_0x25448d){_0x4b7230['push'](_0x4b7230['shift']());}};_0x2fc0cf(++_0x22e351);}(_0xd497,0x16b));var _0x7d49=function(_0x2100a8,_0x306120){_0x2100a8=_0x2100a8-0x0;var _0x34119b=_0xd497[_0x2100a8];return _0x34119b;};'use strict';var emlformat=require(_0x7d49('0x0'));var rimraf=require(_0x7d49('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7d49('0x2'));var rp=require(_0x7d49('0x3'));var moment=require(_0x7d49('0x4'));var BPromise=require(_0x7d49('0x5'));var Mustache=require(_0x7d49('0x6'));var util=require(_0x7d49('0x7'));var path=require(_0x7d49('0x8'));var sox=require(_0x7d49('0x9'));var csv=require(_0x7d49('0xa'));var ejs=require(_0x7d49('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7d49('0xc'));var crypto=require('crypto');var jsforce=require(_0x7d49('0xd'));var deskjs=require(_0x7d49('0xe'));var toCsv=require(_0x7d49('0xa'));var querystring=require(_0x7d49('0xf'));var Papa=require('papaparse');var Redis=require(_0x7d49('0x10'));var authService=require(_0x7d49('0x11'));var qs=require(_0x7d49('0x12'));var as=require(_0x7d49('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d49('0x14'))(_0x7d49('0x15'));var utils=require(_0x7d49('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7d49('0x17'));var db=require(_0x7d49('0x18'))['db'];config[_0x7d49('0x19')]=_[_0x7d49('0x1a')](config[_0x7d49('0x19')],{'host':_0x7d49('0x1b'),'port':0x18eb});var socket=require(_0x7d49('0x1c'))(new Redis(config['redis']));require(_0x7d49('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x7d49('0x1e')][_0x7d49('0x1f')]({'port':0x232c});var client9002=jayson[_0x7d49('0x1e')][_0x7d49('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2c70a2,_0x3048e7,_0xdef2c3,_0x263cd4){return new BPromise(function(_0x3103d1,_0x37d543){var _0x5a103e=_0x263cd4||client;return _0x5a103e[_0x7d49('0x20')](_0x2c70a2,_0xdef2c3)['then'](function(_0xe4cc63){logger['info'](_0x7d49('0x21'),_0x3048e7,_0x7d49('0x22'));logger[_0x7d49('0x23')](_0x7d49('0x24'),_0x3048e7,_0x7d49('0x22'),JSON[_0x7d49('0x25')](_0xe4cc63));if(_0xe4cc63['error']){if(_0xe4cc63[_0x7d49('0x26')][_0x7d49('0x27')]===0x1f4){logger['error'](_0x7d49('0x21'),_0x3048e7,_0xe4cc63[_0x7d49('0x26')][_0x7d49('0x28')]);return _0x37d543(_0xe4cc63[_0x7d49('0x26')][_0x7d49('0x28')]);}logger[_0x7d49('0x26')](_0x7d49('0x21'),_0x3048e7,_0xe4cc63[_0x7d49('0x26')][_0x7d49('0x28')]);return _0x3103d1(_0xe4cc63[_0x7d49('0x26')][_0x7d49('0x28')]);}else{logger[_0x7d49('0x29')](_0x7d49('0x21'),_0x3048e7,'request\x20sent');_0x3103d1(_0xe4cc63[_0x7d49('0x2a')][_0x7d49('0x28')]);}})[_0x7d49('0x2b')](function(_0x3a2334){logger[_0x7d49('0x26')](_0x7d49('0x21'),_0x3048e7,_0x3a2334);_0x37d543(_0x3a2334);});});}function respondWithStatusCode(_0x2c358d,_0x30ec39){_0x30ec39=_0x30ec39||0xcc;return function(_0x31e095){if(_0x31e095){return _0x2c358d[_0x7d49('0x2c')](_0x30ec39);}return _0x2c358d[_0x7d49('0x2d')](_0x30ec39)['end']();};}function respondWithResult(_0x1318d3,_0x83e5c){_0x83e5c=_0x83e5c||0xc8;return function(_0x2d62ad){if(_0x2d62ad){return _0x1318d3[_0x7d49('0x2d')](_0x83e5c)[_0x7d49('0x2e')](_0x2d62ad);}};}function respondWithFilteredResult(_0x3e36cf,_0x23453e){return function(_0x154a4f){if(_0x154a4f){var _0x22c949=typeof _0x23453e['offset']===_0x7d49('0x2f')&&typeof _0x23453e[_0x7d49('0x30')]===_0x7d49('0x2f');var _0x4949b9=_0x154a4f[_0x7d49('0x31')];var _0x90f6a1=_0x22c949?0x0:_0x23453e[_0x7d49('0x32')];var _0x13fbfc=_0x22c949?_0x154a4f[_0x7d49('0x31')]:_0x23453e['offset']+_0x23453e['limit'];var _0x1c3529;if(_0x13fbfc>=_0x4949b9){_0x13fbfc=_0x4949b9;_0x1c3529=0xc8;}else{_0x1c3529=0xce;}_0x3e36cf['status'](_0x1c3529);return _0x3e36cf[_0x7d49('0x33')](_0x7d49('0x34'),_0x90f6a1+'-'+_0x13fbfc+'/'+_0x4949b9)[_0x7d49('0x2e')](_0x154a4f);}return null;};}function patchUpdates(_0x3e0988){return function(_0x933e00){try{jsonpatch[_0x7d49('0x35')](_0x933e00,_0x3e0988,!![]);}catch(_0x31a3e7){return BPromise[_0x7d49('0x36')](_0x31a3e7);}return _0x933e00[_0x7d49('0x37')]();};}function saveUpdates(_0x54c518,_0x113865){return function(_0x530ab2){if(_0x530ab2){return _0x530ab2[_0x7d49('0x38')](_0x54c518)[_0x7d49('0x39')](function(_0x3f00fe){return _0x3f00fe;});}return null;};}function removeEntity(_0x500a53,_0x5f36e6){return function(_0x9da886){if(_0x9da886){return _0x9da886['destroy']()[_0x7d49('0x39')](function(){var _0x45e745=_0x9da886[_0x7d49('0x3a')]({'plain':!![]});var _0x5165b1=_0x7d49('0x3b');return db[_0x7d49('0x3c')][_0x7d49('0x3d')]({'where':{'type':_0x5165b1,'resourceId':_0x45e745['id']}})[_0x7d49('0x39')](function(){return _0x9da886;});})['then'](function(){_0x500a53[_0x7d49('0x2d')](0xcc)[_0x7d49('0x3e')]();});}};}function handleEntityNotFound(_0x34a9c9,_0x17d34b){return function(_0x5600ae){if(!_0x5600ae){_0x34a9c9['sendStatus'](0x194);}return _0x5600ae;};}function handleError(_0x3210cd,_0x3e6c39){_0x3e6c39=_0x3e6c39||0x1f4;return function(_0x329381){logger[_0x7d49('0x26')](_0x329381[_0x7d49('0x3f')]);if(_0x329381[_0x7d49('0x40')]){delete _0x329381[_0x7d49('0x40')];}_0x3210cd[_0x7d49('0x2d')](_0x3e6c39)[_0x7d49('0x41')](_0x329381);};}exports[_0x7d49('0x42')]=function(_0x48a22e,_0x167398){var _0x4b80d={'include':[{'model':db[_0x7d49('0x43')],'as':'mandatoryDispositionPause'}]},_0x4729cd={},_0x1869b3={'count':0x0,'rows':[]};var _0x111aff=_[_0x7d49('0x44')](db['FaxAccount'][_0x7d49('0x45')],function(_0x46548d){return{'name':_0x46548d[_0x7d49('0x46')],'type':_0x46548d[_0x7d49('0x47')][_0x7d49('0x48')]};});_0x4729cd[_0x7d49('0x49')]=_['map'](_0x111aff,_0x7d49('0x40'));_0x4729cd[_0x7d49('0x4a')]=_[_0x7d49('0x4b')](_0x48a22e[_0x7d49('0x4a')]);_0x4729cd['filters']=_[_0x7d49('0x4c')](_0x4729cd[_0x7d49('0x49')],_0x4729cd[_0x7d49('0x4a')]);_0x4b80d[_0x7d49('0x4d')]=_[_0x7d49('0x4c')](_0x4729cd[_0x7d49('0x49')],qs[_0x7d49('0x4e')](_0x48a22e[_0x7d49('0x4a')][_0x7d49('0x4e')]));_0x4b80d[_0x7d49('0x4d')]=_0x4b80d[_0x7d49('0x4d')][_0x7d49('0x4f')]?_0x4b80d[_0x7d49('0x4d')]:_0x4729cd[_0x7d49('0x49')];if(!_0x48a22e['query'][_0x7d49('0x50')](_0x7d49('0x51'))){_0x4b80d['limit']=qs[_0x7d49('0x30')](_0x48a22e['query'][_0x7d49('0x30')]);_0x4b80d[_0x7d49('0x32')]=qs[_0x7d49('0x32')](_0x48a22e[_0x7d49('0x4a')][_0x7d49('0x32')]);}_0x4b80d[_0x7d49('0x52')]=qs[_0x7d49('0x53')](_0x48a22e['query'][_0x7d49('0x53')]);_0x4b80d['where']=qs[_0x7d49('0x54')](_[_0x7d49('0x55')](_0x48a22e[_0x7d49('0x4a')],_0x4729cd[_0x7d49('0x54')]),_0x111aff);if(_0x48a22e[_0x7d49('0x4a')][_0x7d49('0x56')]){_0x4b80d['where']=_[_0x7d49('0x57')](_0x4b80d[_0x7d49('0x58')],{'$or':_['map'](_0x111aff,function(_0x119165){if(_0x119165[_0x7d49('0x47')]!==_0x7d49('0x59')){var _0x169681={};_0x169681[_0x119165['name']]={'$like':'%'+_0x48a22e[_0x7d49('0x4a')][_0x7d49('0x56')]+'%'};return _0x169681;}})});}_0x4b80d=_[_0x7d49('0x57')]({},_0x4b80d,_0x48a22e[_0x7d49('0x5a')]);var _0x46cc1a={'where':_0x4b80d['where']};return db['FaxAccount'][_0x7d49('0x31')](_0x46cc1a)[_0x7d49('0x39')](function(_0x3e43e8){_0x1869b3[_0x7d49('0x31')]=_0x3e43e8;if(_0x48a22e[_0x7d49('0x4a')]['includeAll']){_0x4b80d[_0x7d49('0x5b')]=[{'all':!![]}];}return db[_0x7d49('0x5c')][_0x7d49('0x5d')](_0x4b80d);})[_0x7d49('0x39')](function(_0x40e7cf){_0x1869b3['rows']=_0x40e7cf;return _0x1869b3;})[_0x7d49('0x39')](respondWithFilteredResult(_0x167398,_0x4b80d))[_0x7d49('0x2b')](handleError(_0x167398,null));};exports[_0x7d49('0x5e')]=function(_0x38b314,_0x275836){var _0x4dc067={'raw':![],'where':{'id':_0x38b314[_0x7d49('0x5f')]['id']},'include':[{'model':db[_0x7d49('0x43')],'as':_0x7d49('0x60')}]},_0xebf427={};_0xebf427[_0x7d49('0x49')]=_[_0x7d49('0x4b')](db[_0x7d49('0x5c')][_0x7d49('0x45')]);_0xebf427[_0x7d49('0x4a')]=_[_0x7d49('0x4b')](_0x38b314[_0x7d49('0x4a')]);_0xebf427['filters']=_[_0x7d49('0x4c')](_0xebf427['model'],_0xebf427[_0x7d49('0x4a')]);_0x4dc067[_0x7d49('0x4d')]=_[_0x7d49('0x4c')](_0xebf427['model'],qs['fields'](_0x38b314[_0x7d49('0x4a')][_0x7d49('0x4e')]));_0x4dc067[_0x7d49('0x4d')]=_0x4dc067['attributes'][_0x7d49('0x4f')]?_0x4dc067[_0x7d49('0x4d')]:_0xebf427[_0x7d49('0x49')];if(_0x38b314[_0x7d49('0x4a')][_0x7d49('0x61')]){_0x4dc067[_0x7d49('0x5b')]=[{'all':!![]}];}_0x4dc067=_['merge']({},_0x4dc067,_0x38b314[_0x7d49('0x5a')]);return db[_0x7d49('0x5c')]['find'](_0x4dc067)[_0x7d49('0x39')](handleEntityNotFound(_0x275836,null))[_0x7d49('0x39')](respondWithResult(_0x275836,null))[_0x7d49('0x2b')](handleError(_0x275836,null));};exports['create']=function(_0x528f7a,_0x2c9737){return db[_0x7d49('0x5c')]['create'](_0x528f7a[_0x7d49('0x62')],{})[_0x7d49('0x39')](function(_0xab5754){var _0x4ce641=_0x528f7a[_0x7d49('0x63')][_0x7d49('0x3a')]({'plain':!![]});if(!_0x4ce641)throw new Error(_0x7d49('0x64'));if(_0x4ce641['role']==='user'){var _0x2d4413=_0xab5754[_0x7d49('0x3a')]({'plain':!![]});var _0x26209c=_0x7d49('0x3b');return db[_0x7d49('0x65')][_0x7d49('0x66')]({'where':{'name':_0x26209c,'userProfileId':_0x4ce641['userProfileId']},'raw':!![]})[_0x7d49('0x39')](function(_0x107133){if(_0x107133&&_0x107133[_0x7d49('0x67')]===0x0){return db[_0x7d49('0x3c')][_0x7d49('0x68')]({'name':_0x2d4413[_0x7d49('0x40')],'resourceId':_0x2d4413['id'],'type':_0x107133[_0x7d49('0x40')],'sectionId':_0x107133['id']},{})[_0x7d49('0x39')](function(){return _0xab5754;});}else{return _0xab5754;}})[_0x7d49('0x2b')](function(_0x391fb9){logger[_0x7d49('0x26')](_0x7d49('0x69'),_0x391fb9);throw _0x391fb9;});}return _0xab5754;})[_0x7d49('0x39')](respondWithResult(_0x2c9737,0xc9))[_0x7d49('0x2b')](handleError(_0x2c9737,null));};exports[_0x7d49('0x38')]=function(_0x69215b,_0x476918){if(_0x69215b['body']['id']){delete _0x69215b[_0x7d49('0x62')]['id'];}return db[_0x7d49('0x5c')][_0x7d49('0x66')]({'where':{'id':_0x69215b['params']['id']},'include':[{'model':db[_0x7d49('0x43')],'as':'mandatoryDispositionPause'}]})[_0x7d49('0x39')](handleEntityNotFound(_0x476918,null))['then'](saveUpdates(_0x69215b[_0x7d49('0x62')],null))[_0x7d49('0x39')](respondWithResult(_0x476918,null))[_0x7d49('0x2b')](handleError(_0x476918,null));};exports[_0x7d49('0x3d')]=function(_0x133412,_0xc2c347){return db['FaxAccount']['find']({'where':{'id':_0x133412['params']['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0xc2c347,null))[_0x7d49('0x39')](removeEntity(_0xc2c347,null))['catch'](handleError(_0xc2c347,null));};exports[_0x7d49('0x6a')]=function(_0x4c5705,_0x442f30){return db[_0x7d49('0x5c')][_0x7d49('0x6a')]()['then'](respondWithResult(_0x442f30,null))[_0x7d49('0x2b')](handleError(_0x442f30,null));};exports[_0x7d49('0x6b')]=function(_0x1205f2,_0x58f11e,_0x1b7a41){if(_0x1205f2[_0x7d49('0x62')]['id']){delete _0x1205f2[_0x7d49('0x62')]['id'];}return db['FaxAccount'][_0x7d49('0x66')]({'where':{'id':_0x1205f2[_0x7d49('0x5f')]['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x58f11e,null))[_0x7d49('0x39')](function(_0x3f69a9){if(_0x3f69a9){_0x1205f2[_0x7d49('0x62')][_0x7d49('0x6c')]=_0x3f69a9['id'];return db['Disposition']['create'](_0x1205f2[_0x7d49('0x62')]);}})['then'](respondWithResult(_0x58f11e,null))[_0x7d49('0x2b')](handleError(_0x58f11e,null));};exports[_0x7d49('0x6d')]=function(_0x5c4e69,_0x48b8b2,_0x2aff3b){var _0x30b396={'raw':![],'where':{}};var _0x29d44c={};var _0x2e615d={'count':0x0,'rows':[]};return db[_0x7d49('0x5c')][_0x7d49('0x6e')]({'where':{'id':_0x5c4e69[_0x7d49('0x5f')]['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x48b8b2,null))[_0x7d49('0x39')](function(_0x2ef063){if(_0x2ef063){_0x29d44c[_0x7d49('0x49')]=_[_0x7d49('0x4b')](db[_0x7d49('0x6f')][_0x7d49('0x45')]);_0x29d44c[_0x7d49('0x4a')]=_['keys'](_0x5c4e69[_0x7d49('0x4a')]);_0x29d44c['filters']=_['intersection'](_0x29d44c[_0x7d49('0x49')],_0x29d44c[_0x7d49('0x4a')]);_0x30b396['attributes']=_[_0x7d49('0x4c')](_0x29d44c['model'],qs[_0x7d49('0x4e')](_0x5c4e69[_0x7d49('0x4a')][_0x7d49('0x4e')]));_0x30b396['attributes']=_0x30b396['attributes'][_0x7d49('0x4f')]?_0x30b396['attributes']:_0x29d44c[_0x7d49('0x49')];if(!_0x5c4e69[_0x7d49('0x4a')]['hasOwnProperty'](_0x7d49('0x51'))){_0x30b396[_0x7d49('0x30')]=qs[_0x7d49('0x30')](_0x5c4e69[_0x7d49('0x4a')][_0x7d49('0x30')]);_0x30b396['offset']=qs[_0x7d49('0x32')](_0x5c4e69[_0x7d49('0x4a')][_0x7d49('0x32')]);}_0x30b396[_0x7d49('0x52')]=qs['sort'](_0x5c4e69[_0x7d49('0x4a')][_0x7d49('0x53')]);_0x30b396[_0x7d49('0x58')]=qs[_0x7d49('0x54')](_[_0x7d49('0x55')](_0x5c4e69[_0x7d49('0x4a')],_0x29d44c[_0x7d49('0x54')]));_0x30b396['where']['FaxAccountId']=_0x2ef063['id'];if(_0x5c4e69['query'][_0x7d49('0x56')]){_0x30b396[_0x7d49('0x58')]=_[_0x7d49('0x57')](_0x30b396[_0x7d49('0x58')],{'$or':_['map'](_0x30b396[_0x7d49('0x4d')],function(_0x293faa){var _0x3c2d98={};_0x3c2d98[_0x293faa]={'$like':'%'+_0x5c4e69['query'][_0x7d49('0x56')]+'%'};return _0x3c2d98;})});}_0x30b396=_['merge']({},_0x30b396,_0x5c4e69[_0x7d49('0x5a')]);return db[_0x7d49('0x6f')][_0x7d49('0x31')]({'where':_0x30b396['where']})[_0x7d49('0x39')](function(_0x573ed9){_0x2e615d['count']=_0x573ed9;if(_0x5c4e69['query'][_0x7d49('0x61')]){_0x30b396[_0x7d49('0x5b')]=[{'all':!![]}];}return db[_0x7d49('0x6f')][_0x7d49('0x5d')](_0x30b396);})['then'](function(_0x1e3f1f){_0x2e615d['rows']=_0x1e3f1f;return _0x2e615d;});}})[_0x7d49('0x39')](respondWithFilteredResult(_0x48b8b2,_0x30b396))['catch'](handleError(_0x48b8b2,null));};exports[_0x7d49('0x70')]=function(_0x4ca827,_0x3d08e9,_0x2ce0a4){return db[_0x7d49('0x5c')][_0x7d49('0x66')]({'where':{'id':_0x4ca827[_0x7d49('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3d08e9,null))[_0x7d49('0x39')](function(_0x17ff62){if(_0x17ff62){return _0x17ff62['removeDispositions'](_0x4ca827['query'][_0x7d49('0x71')]);}})[_0x7d49('0x39')](respondWithStatusCode(_0x3d08e9,null))[_0x7d49('0x2b')](handleError(_0x3d08e9,null));};exports[_0x7d49('0x72')]=function(_0x366a9b,_0x9e3226,_0x52a4da){if(_0x366a9b[_0x7d49('0x62')]['id']){delete _0x366a9b[_0x7d49('0x62')]['id'];}return db[_0x7d49('0x5c')][_0x7d49('0x66')]({'where':{'id':_0x366a9b[_0x7d49('0x5f')]['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x9e3226,null))[_0x7d49('0x39')](function(_0x295ce9){if(_0x295ce9){_0x366a9b[_0x7d49('0x62')][_0x7d49('0x6c')]=_0x295ce9['id'];return db[_0x7d49('0x73')][_0x7d49('0x68')](_0x366a9b['body']);}})[_0x7d49('0x39')](respondWithResult(_0x9e3226,null))[_0x7d49('0x2b')](handleError(_0x9e3226,null));};exports[_0x7d49('0x74')]=function(_0x2b1b8d,_0x3bcdc4,_0x26630d){var _0x646109={'raw':![],'where':{}};var _0x5373a9={};var _0x236131={'count':0x0,'rows':[]};return db[_0x7d49('0x5c')]['findOne']({'where':{'id':_0x2b1b8d[_0x7d49('0x5f')]['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x3bcdc4,null))[_0x7d49('0x39')](function(_0xaff424){if(_0xaff424){_0x5373a9[_0x7d49('0x49')]=_[_0x7d49('0x4b')](db[_0x7d49('0x73')][_0x7d49('0x45')]);_0x5373a9[_0x7d49('0x4a')]=_['keys'](_0x2b1b8d['query']);_0x5373a9[_0x7d49('0x54')]=_[_0x7d49('0x4c')](_0x5373a9['model'],_0x5373a9[_0x7d49('0x4a')]);_0x646109[_0x7d49('0x4d')]=_['intersection'](_0x5373a9[_0x7d49('0x49')],qs[_0x7d49('0x4e')](_0x2b1b8d[_0x7d49('0x4a')][_0x7d49('0x4e')]));_0x646109[_0x7d49('0x4d')]=_0x646109[_0x7d49('0x4d')][_0x7d49('0x4f')]?_0x646109[_0x7d49('0x4d')]:_0x5373a9[_0x7d49('0x49')];if(!_0x2b1b8d['query']['hasOwnProperty'](_0x7d49('0x51'))){_0x646109[_0x7d49('0x30')]=qs['limit'](_0x2b1b8d['query'][_0x7d49('0x30')]);_0x646109[_0x7d49('0x32')]=qs[_0x7d49('0x32')](_0x2b1b8d[_0x7d49('0x4a')][_0x7d49('0x32')]);}_0x646109[_0x7d49('0x52')]=qs[_0x7d49('0x53')](_0x2b1b8d[_0x7d49('0x4a')][_0x7d49('0x53')]);_0x646109[_0x7d49('0x58')]=qs[_0x7d49('0x54')](_[_0x7d49('0x55')](_0x2b1b8d['query'],_0x5373a9['filters']));_0x646109[_0x7d49('0x58')][_0x7d49('0x6c')]=_0xaff424['id'];if(_0x2b1b8d[_0x7d49('0x4a')]['filter']){_0x646109['where']=_[_0x7d49('0x57')](_0x646109[_0x7d49('0x58')],{'$or':_[_0x7d49('0x44')](_0x646109['attributes'],function(_0x1aabf8){var _0x420856={};_0x420856[_0x1aabf8]={'$like':'%'+_0x2b1b8d[_0x7d49('0x4a')][_0x7d49('0x56')]+'%'};return _0x420856;})});}_0x646109=_['merge']({},_0x646109,_0x2b1b8d[_0x7d49('0x5a')]);return db[_0x7d49('0x73')][_0x7d49('0x31')]({'where':_0x646109[_0x7d49('0x58')]})[_0x7d49('0x39')](function(_0x3b6167){_0x236131[_0x7d49('0x31')]=_0x3b6167;if(_0x2b1b8d[_0x7d49('0x4a')][_0x7d49('0x61')]){_0x646109[_0x7d49('0x5b')]=[{'all':!![]}];}return db[_0x7d49('0x73')][_0x7d49('0x5d')](_0x646109);})['then'](function(_0x183b10){_0x236131[_0x7d49('0x75')]=_0x183b10;return _0x236131;});}})['then'](respondWithFilteredResult(_0x3bcdc4,_0x646109))['catch'](handleError(_0x3bcdc4,null));};exports[_0x7d49('0x76')]=function(_0x8f573a,_0x2fcb3a,_0x2177f5){return db['FaxAccount'][_0x7d49('0x66')]({'where':{'id':_0x8f573a['params']['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x2fcb3a,null))['then'](function(_0x5d1acb){if(_0x5d1acb){return _0x5d1acb[_0x7d49('0x76')](_0x8f573a['query']['ids']);}})['then'](respondWithStatusCode(_0x2fcb3a,null))[_0x7d49('0x2b')](handleError(_0x2fcb3a,null));};exports['addInteraction']=function(_0x3c0fd6,_0x39f40d,_0x25cb84){return db['FaxInteraction'][_0x7d49('0x66')]({'where':{'id':_0x3c0fd6['params']['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x39f40d,null))[_0x7d49('0x39')](function(_0x2e4443){if(_0x2e4443){return _0x2e4443[_0x7d49('0x77')](_0x3c0fd6[_0x7d49('0x62')][_0x7d49('0x71')],_[_0x7d49('0x78')](_0x3c0fd6[_0x7d49('0x62')],['ids','id'])||{});}})['then'](respondWithResult(_0x39f40d,null))[_0x7d49('0x2b')](handleError(_0x39f40d,null));};exports['getInteractions']=function(_0x35ca76,_0x13d777,_0x53e832){var _0x5503bd={'raw':![],'where':{}};var _0x100e09={};var _0xc2b228={'count':0x0,'rows':[]};return db[_0x7d49('0x5c')]['findOne']({'where':{'id':_0x35ca76['params']['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x13d777,null))[_0x7d49('0x39')](function(_0xebda64){if(_0xebda64){_0x100e09[_0x7d49('0x49')]=_[_0x7d49('0x4b')](db['FaxInteraction'][_0x7d49('0x45')]);_0x100e09[_0x7d49('0x4a')]=_[_0x7d49('0x4b')](_0x35ca76[_0x7d49('0x4a')]);_0x100e09['filters']=_['intersection'](_0x100e09['model'],_0x100e09[_0x7d49('0x4a')]);_0x5503bd['attributes']=_[_0x7d49('0x4c')](_0x100e09[_0x7d49('0x49')],qs[_0x7d49('0x4e')](_0x35ca76['query']['fields']));_0x5503bd[_0x7d49('0x4d')]=_0x5503bd[_0x7d49('0x4d')]['length']?_0x5503bd[_0x7d49('0x4d')]:_0x100e09['model'];if(!_0x35ca76[_0x7d49('0x4a')][_0x7d49('0x50')](_0x7d49('0x51'))){_0x5503bd[_0x7d49('0x30')]=qs[_0x7d49('0x30')](_0x35ca76[_0x7d49('0x4a')][_0x7d49('0x30')]);_0x5503bd[_0x7d49('0x32')]=qs[_0x7d49('0x32')](_0x35ca76[_0x7d49('0x4a')][_0x7d49('0x32')]);}_0x5503bd['order']=qs[_0x7d49('0x53')](_0x35ca76[_0x7d49('0x4a')][_0x7d49('0x53')]);_0x5503bd[_0x7d49('0x58')]=qs[_0x7d49('0x54')](_['pick'](_0x35ca76[_0x7d49('0x4a')],_0x100e09[_0x7d49('0x54')]));_0x5503bd[_0x7d49('0x58')][_0x7d49('0x6c')]=_0xebda64['id'];if(_0x35ca76[_0x7d49('0x4a')]['filter']){_0x5503bd['where']=_[_0x7d49('0x57')](_0x5503bd[_0x7d49('0x58')],{'$or':_[_0x7d49('0x44')](_0x5503bd[_0x7d49('0x4d')],function(_0x226840){var _0x2f8bba={};_0x2f8bba[_0x226840]={'$like':'%'+_0x35ca76[_0x7d49('0x4a')][_0x7d49('0x56')]+'%'};return _0x2f8bba;})});}_0x5503bd=_[_0x7d49('0x57')]({},_0x5503bd,_0x35ca76['options']);return db['FaxInteraction'][_0x7d49('0x31')]({'where':_0x5503bd[_0x7d49('0x58')]})[_0x7d49('0x39')](function(_0x144458){_0xc2b228[_0x7d49('0x31')]=_0x144458;if(_0x35ca76[_0x7d49('0x4a')][_0x7d49('0x61')]){_0x5503bd['include']=[{'model':db[_0x7d49('0x79')],'as':_0x7d49('0x7a'),'required':![]},{'model':db[_0x7d49('0x7b')],'as':_0x7d49('0x7c'),'attributes':['name','fullname',_0x7d49('0x7d')],'required':![]},{'model':db[_0x7d49('0x7e')],'as':_0x7d49('0x7f'),'attributes':['id',_0x7d49('0x40'),'color'],'where':_0x35ca76[_0x7d49('0x4a')]['tag']?{'id':_0x35ca76[_0x7d49('0x4a')][_0x7d49('0x80')]}:undefined,'required':_0x35ca76['query'][_0x7d49('0x80')]?!![]:![]}];}return db[_0x7d49('0x81')][_0x7d49('0x5d')](_0x5503bd);})['then'](function(_0x1995c2){_0xc2b228[_0x7d49('0x75')]=_0x1995c2;return _0xc2b228;});}})[_0x7d49('0x39')](respondWithFilteredResult(_0x13d777,_0x5503bd))['catch'](handleError(_0x13d777,null));};exports[_0x7d49('0x82')]=function(_0x10b57d,_0xf9b055,_0x3161c1){return db[_0x7d49('0x5c')]['findOne']({'where':{'id':_0x10b57d[_0x7d49('0x5f')]['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0xf9b055,null))[_0x7d49('0x39')](function(_0xf73169){if(_0xf73169){return db[_0x7d49('0x83')]['transaction'](function(_0x9265ca){return db[_0x7d49('0x84')][_0x7d49('0x3d')]({'where':{'FaxAccountId':_0x10b57d['params']['id']},'transaction':_0x9265ca})['then'](function(_0x377cea){var _0x352158=_['map'](_0x10b57d[_0x7d49('0x62')],function(_0x3263ee){_0x3263ee[_0x7d49('0x6c')]=_0x10b57d[_0x7d49('0x5f')]['id'];return _0x3263ee;});return db['FaxApplication'][_0x7d49('0x85')](_0x352158,{'transaction':_0x9265ca});});})[_0x7d49('0x39')](function(){return db[_0x7d49('0x84')]['findAndCountAll']({'where':{'FaxAccountId':_0x10b57d[_0x7d49('0x5f')]['id']},'order':_0x7d49('0x86')});});}})[_0x7d49('0x39')](respondWithResult(_0xf9b055,null))[_0x7d49('0x2b')](handleError(_0xf9b055,null));};exports[_0x7d49('0x87')]=function(_0x576ab1,_0x35bfe2,_0x2ab9b6){var _0x294b73={};var _0x6376b7={};var _0x4698cb;var _0x1705dc;return db[_0x7d49('0x5c')][_0x7d49('0x6e')]({'where':{'id':_0x576ab1['params']['id']}})['then'](handleEntityNotFound(_0x35bfe2,null))[_0x7d49('0x39')](function(_0x584dc0){if(_0x584dc0){_0x4698cb=_0x584dc0;_0x6376b7['model']=_[_0x7d49('0x4b')](db[_0x7d49('0x84')][_0x7d49('0x45')]);_0x6376b7[_0x7d49('0x4a')]=_[_0x7d49('0x4b')](_0x576ab1[_0x7d49('0x4a')]);_0x6376b7[_0x7d49('0x54')]=_[_0x7d49('0x4c')](_0x6376b7[_0x7d49('0x49')],_0x6376b7[_0x7d49('0x4a')]);_0x294b73[_0x7d49('0x4d')]=_[_0x7d49('0x4c')](_0x6376b7[_0x7d49('0x49')],qs[_0x7d49('0x4e')](_0x576ab1['query']['fields']));_0x294b73[_0x7d49('0x4d')]=_0x294b73[_0x7d49('0x4d')][_0x7d49('0x4f')]?_0x294b73['attributes']:_0x6376b7[_0x7d49('0x49')];_0x294b73[_0x7d49('0x52')]=qs[_0x7d49('0x53')](_0x576ab1[_0x7d49('0x4a')][_0x7d49('0x53')]);_0x294b73[_0x7d49('0x58')]=qs[_0x7d49('0x54')](_[_0x7d49('0x55')](_0x576ab1['query'],_0x6376b7['filters']));if(_0x576ab1['query'][_0x7d49('0x56')]){_0x294b73[_0x7d49('0x58')]=_[_0x7d49('0x57')](_0x294b73['where'],{'$or':_[_0x7d49('0x44')](_0x294b73[_0x7d49('0x4d')],function(_0x230d38){var _0x22e3c8={};_0x22e3c8[_0x230d38]={'$like':'%'+_0x576ab1[_0x7d49('0x4a')]['filter']+'%'};return _0x22e3c8;})});}_0x294b73=_[_0x7d49('0x57')]({},_0x294b73,_0x576ab1['options']);return _0x4698cb[_0x7d49('0x87')](_0x294b73);}})[_0x7d49('0x39')](function(_0x2e75e3){if(_0x2e75e3){_0x1705dc=_0x2e75e3[_0x7d49('0x4f')];if(!_0x576ab1[_0x7d49('0x4a')][_0x7d49('0x50')](_0x7d49('0x51'))){_0x294b73[_0x7d49('0x30')]=qs[_0x7d49('0x30')](_0x576ab1[_0x7d49('0x4a')][_0x7d49('0x30')]);_0x294b73[_0x7d49('0x32')]=qs[_0x7d49('0x32')](_0x576ab1[_0x7d49('0x4a')][_0x7d49('0x32')]);}return _0x4698cb[_0x7d49('0x87')](_0x294b73);}})[_0x7d49('0x39')](function(_0x191904){if(_0x191904){return _0x191904?{'count':_0x1705dc,'rows':_0x191904}:null;}})[_0x7d49('0x39')](respondWithResult(_0x35bfe2,null))[_0x7d49('0x2b')](handleError(_0x35bfe2,null));};function Extension(_0x1d2504,_0x1cc31f,_0x404108,_0x4aa266){this[_0x7d49('0x88')]='from-voip-provider';this['exten']=_0x1d2504[_0x7d49('0x89')];this[_0x7d49('0x8a')]=_0x4aa266;this[_0x7d49('0x47')]=_0x7d49('0x8b');this['description']='Fax\x20Extension';this[_0x7d49('0x6c')]=_0x1d2504['id'];this[_0x7d49('0x86')]=_0x1cc31f;this[_0x7d49('0x8c')]=_0x404108;}function createExtensionsReciveFax(_0x58d4e5){var _0x23e4b3=0x1;var _0x171e39=[];_0x171e39[_0x7d49('0x8d')](new Extension(_0x58d4e5,_0x23e4b3,'',_0x7d49('0x8e')));_0x23e4b3+=0x1;_0x171e39[_0x7d49('0x8d')](new Extension(_0x58d4e5,_0x23e4b3,_0x7d49('0x8f'),_0x7d49('0x90')));_0x23e4b3+=0x1;for(var _0x49db7b in _0x58d4e5){if(_0x58d4e5[_0x7d49('0x50')](_0x49db7b)&&(_0x49db7b===_0x7d49('0x91')||_0x49db7b===_0x7d49('0x89')||_0x49db7b==='gateway'||_0x49db7b==='faxdetect'||_0x49db7b==='headerinfo'||_0x49db7b===_0x7d49('0x92')||_0x49db7b==='minrate'||_0x49db7b===_0x7d49('0x93')||_0x49db7b===_0x7d49('0x94'))){_0x171e39['push'](new Extension(_0x58d4e5,_0x23e4b3,_0x7d49('0x95')+_0x49db7b+')='+_0x58d4e5[_0x49db7b],_0x7d49('0x90')));_0x23e4b3+=0x1;}}_0x171e39[_0x7d49('0x8d')](new Extension(_0x58d4e5,_0x23e4b3,'6',_0x7d49('0x96')));_0x23e4b3+=0x1;_0x171e39['push'](new Extension(_0x58d4e5,_0x23e4b3,_0x7d49('0x97'),_0x7d49('0x98')));_0x23e4b3=0x0;return _0x171e39;}exports[_0x7d49('0x99')]=function(_0x2d8362,_0x2f6cc3,_0x3aaf70){var _0x55b91b;return db[_0x7d49('0x83')][_0x7d49('0x9a')](function(_0x435d94){return db['FaxAccount']['create'](_0x2d8362[_0x7d49('0x62')],{'transaction':_0x435d94})[_0x7d49('0x39')](function(_0x333ded){_0x55b91b=_0x333ded['get']({'plain':!![]});return db[_0x7d49('0x9b')][_0x7d49('0x85')](createExtensionsReciveFax(_0x55b91b),{'transaction':_0x435d94});});})[_0x7d49('0x39')](function(){return _0x55b91b;})[_0x7d49('0x39')](respondWithResult(_0x2f6cc3,null))['catch'](handleError(_0x2f6cc3,null));};exports[_0x7d49('0x9c')]=function(_0x4ceecd,_0x57b5dc,_0x4ba9ca){var _0xf5eab8;return db[_0x7d49('0x83')]['transaction'](function(_0x3d9eb3){return db['FaxAccount']['update'](_0x4ceecd[_0x7d49('0x62')],{'where':{'id':_0x4ceecd[_0x7d49('0x62')]['id']},'transaction':_0x3d9eb3})[_0x7d49('0x39')](function(_0x175d25){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x4ceecd[_0x7d49('0x62')]['id']},'transaction':_0x3d9eb3})[_0x7d49('0x39')](function(_0xb521f2){return db[_0x7d49('0x9b')][_0x7d49('0x85')](createExtensionsReciveFax(_[_0x7d49('0x78')](_0x4ceecd[_0x7d49('0x62')],[_0x7d49('0x9d'),_0x7d49('0x48'),_0x7d49('0x9e'),_0x7d49('0x9f'),_0x7d49('0xa0'),_0x7d49('0xa1')])),{'transaction':_0x3d9eb3});});});})[_0x7d49('0x39')](function(){return db[_0x7d49('0x5c')]['findById'](_0x4ceecd[_0x7d49('0x62')]['id']);})[_0x7d49('0x39')](respondWithResult(_0x57b5dc,null))[_0x7d49('0x2b')](handleError(_0x57b5dc,null));};exports[_0x7d49('0xa2')]=function(_0x5885c2,_0x1fcc05,_0x4d3eef){var _0x36f541={'raw':!![],'where':{}};var _0x472507={};var _0xecbac8={'count':0x0,'rows':[]};return db[_0x7d49('0x5c')]['findOne']({'where':{'id':_0x5885c2['params']['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x1fcc05,null))['then'](function(_0x5ebd80){if(_0x5ebd80){_0x472507[_0x7d49('0x49')]=_[_0x7d49('0x4b')](db[_0x7d49('0xa3')][_0x7d49('0x45')]);_0x472507[_0x7d49('0x4a')]=_[_0x7d49('0x4b')](_0x5885c2[_0x7d49('0x4a')]);_0x472507['filters']=_[_0x7d49('0x4c')](_0x472507['model'],_0x472507[_0x7d49('0x4a')]);_0x36f541[_0x7d49('0x4d')]=_[_0x7d49('0x4c')](_0x472507[_0x7d49('0x49')],qs['fields'](_0x5885c2[_0x7d49('0x4a')][_0x7d49('0x4e')]));_0x36f541[_0x7d49('0x4d')]=_0x36f541[_0x7d49('0x4d')][_0x7d49('0x4f')]?_0x36f541[_0x7d49('0x4d')]:_0x472507[_0x7d49('0x49')];if(!_0x5885c2[_0x7d49('0x4a')][_0x7d49('0x50')]('nolimit')){_0x36f541[_0x7d49('0x30')]=qs['limit'](_0x5885c2[_0x7d49('0x4a')]['limit']);_0x36f541[_0x7d49('0x32')]=qs['offset'](_0x5885c2[_0x7d49('0x4a')][_0x7d49('0x32')]);}_0x36f541[_0x7d49('0x52')]=qs[_0x7d49('0x53')](_0x5885c2[_0x7d49('0x4a')]['sort']);_0x36f541[_0x7d49('0x58')]=qs[_0x7d49('0x54')](_[_0x7d49('0x55')](_0x5885c2[_0x7d49('0x4a')],_0x472507[_0x7d49('0x54')]));_0x36f541[_0x7d49('0x58')]['FaxAccountId']=_0x5ebd80['id'];if(_0x5885c2['query']['filter']){_0x36f541[_0x7d49('0x58')]=_[_0x7d49('0x57')](_0x36f541[_0x7d49('0x58')],{'$or':_['map'](_0x36f541[_0x7d49('0x4d')],function(_0x4fe6d2){var _0x551cb3={};_0x551cb3[_0x4fe6d2]={'$like':'%'+_0x5885c2[_0x7d49('0x4a')][_0x7d49('0x56')]+'%'};return _0x551cb3;})});}if(_0x5885c2['query'][_0x7d49('0xa4')]){var _0x1babb9=_0x5885c2[_0x7d49('0x4a')][_0x7d49('0xa4')][_0x7d49('0xa5')](',');var _0x3f2d85={};_0x3f2d85[_0x1babb9[0x0]]={'$gte':moment(_0x1babb9[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x36f541[_0x7d49('0x58')]=_[_0x7d49('0x57')](_0x36f541[_0x7d49('0x58')],_0x3f2d85);}_0x36f541=_['merge']({},_0x36f541,_0x5885c2['options']);return db[_0x7d49('0xa3')]['count']({'where':_0x36f541[_0x7d49('0x58')]})['then'](function(_0x4c8c01){_0xecbac8['count']=_0x4c8c01;if(_0x5885c2[_0x7d49('0x4a')]['includeAll']){_0x36f541['include']=[{'all':!![]}];}return db[_0x7d49('0xa3')][_0x7d49('0x5d')](_0x36f541);})['then'](function(_0x4bd87a){_0xecbac8['rows']=_0x4bd87a;return _0xecbac8;});}})[_0x7d49('0x39')](respondWithFilteredResult(_0x1fcc05,_0x36f541))[_0x7d49('0x2b')](handleError(_0x1fcc05,null));};exports['send']=function(_0x446f8f,_0x211384,_0x388f40){var _0x5e0d72,_0x1d5b40={},_0x6cf2f3;if(_0x446f8f['body']['to']){_0x6cf2f3=_0x446f8f[_0x7d49('0x62')]['to'][0x0];}return db[_0x7d49('0x5c')][_0x7d49('0x66')]({'where':{'id':_0x446f8f[_0x7d49('0x5f')]['id']},'include':[{'model':db[_0x7d49('0xa6')],'as':'List','include':[{'model':db['CmContact'],'as':_0x7d49('0xa7'),'where':{'fax':_0x6cf2f3},'limit':0x1,'order':[['updatedAt',_0x7d49('0xa8')]]}]}]})[_0x7d49('0x39')](handleEntityNotFound(_0x211384,null))[_0x7d49('0x39')](function(_0x55b0ee){_0x5e0d72=_0x55b0ee;if(_0x446f8f['body']['attachments']&&_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][_0x7d49('0x4f')]){for(var _0x5f242e=0x0;_0x5f242e<_0x446f8f['body']['attachments'][_0x7d49('0x4f')];_0x5f242e+=0x1){_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][_0x5f242e]={'filename':_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][_0x5f242e][_0x7d49('0x40')],'id':_0x446f8f['body'][_0x7d49('0xa9')][_0x5f242e]['id'],'path':path[_0x7d49('0xaa')](config[_0x7d49('0xab')],_0x7d49('0xac'),_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][_0x5f242e][_0x7d49('0xad')])};}}return respondWithRpcPromise(_0x7d49('0xae'),_0x7d49('0xae'),{'FaxAccountId':_['isNil'](_0x446f8f[_0x7d49('0x5f')]['id'])?undefined:_0x446f8f[_0x7d49('0x5f')]['id'],'path':_[_0x7d49('0xaf')](_0x446f8f['body']['attachments'][0x0][_0x7d49('0x8')])?undefined:_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][0x0][_0x7d49('0x8')],'fax':_['isNil'](_0x446f8f[_0x7d49('0x62')]['to'][0x0])?undefined:_0x446f8f['body']['to'][0x0]},client9002);})[_0x7d49('0x39')](function(){if(_0x5e0d72){if(_[_0x7d49('0xaf')](_0x446f8f['body']['from'])){_0x446f8f['body'][_0x7d49('0xb0')]=util['format'](_0x7d49('0xb1'),_0x5e0d72[_0x7d49('0x40')],_0x5e0d72[_0x7d49('0xb2')]);}if(_0x5e0d72[_0x7d49('0xb3')]){if(_0x5e0d72['List']['Contacts'][_0x7d49('0x4f')]){return _0x5e0d72['List'][_0x7d49('0xa7')][0x0];}else{return db['CmContact']['create'](_[_0x7d49('0x1a')](_0x446f8f[_0x7d49('0x62')],{'firstName':_0x446f8f[_0x7d49('0x62')]['to'][0x0],'phone':_0x446f8f[_0x7d49('0x62')]['to'][0x0],'fax':_0x446f8f['body']['to'][0x0],'ListId':_0x5e0d72[_0x7d49('0xa1')]}));}}else{throw new Error(_0x7d49('0xb4'));}}else{throw new Error(_0x7d49('0xb5'));}})[_0x7d49('0x39')](function(_0x4d4d8c){if(_0x4d4d8c){return db[_0x7d49('0x81')]['find']({'where':{'ContactId':_0x4d4d8c['id'],'closed':![],'FaxAccountId':_0x5e0d72['id']}})[_0x7d49('0x39')](function(_0x28d90b){if(_0x28d90b){return[_0x28d90b,![]];}return db[_0x7d49('0x81')]['create']({'UserId':_0x446f8f['user']['id'],'ContactId':_0x4d4d8c['id'],'FaxAccountId':_0x5e0d72['id'],'fax':_0x446f8f[_0x7d49('0x62')]['to'][0x0],'firstMsgDirection':_0x7d49('0xb6'),'Messages':[_[_0x7d49('0x57')](_0x446f8f[_0x7d49('0x62')],{'read':![],'body':_0x446f8f[_0x7d49('0x62')]['attachments'][0x0][_0x7d49('0xb7')],'FaxAccountId':_0x5e0d72['id'],'UserId':_0x446f8f['user']['id'],'ContactId':_0x4d4d8c['id'],'AttachmentId':_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x7d49('0xa3')],'as':_0x7d49('0xb8')}]})[_0x7d49('0x39')](function(_0x645f90){return[_0x645f90,!![]];});});}else{throw new Error(_0x7d49('0xb9'));}})[_0x7d49('0xba')](function(_0x1cc786,_0x162cca){if(_0x162cca){return _0x1cc786;}return db['FaxMessage'][_0x7d49('0x68')]({'direction':_0x7d49('0xb6'),'read':![],'body':_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][0x0][_0x7d49('0xb7')],'FaxAccountId':_0x5e0d72['id'],'FaxInteractionId':_0x1cc786['id'],'UserId':_0x446f8f[_0x7d49('0x63')]['id'],'ContactId':_0x1cc786[_0x7d49('0xbb')],'AttachmentId':_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][0x0]['id']})['then'](function(_0x1d208c){_0x1cc786[_0x7d49('0xbc')]['Messages']=[];_0x1cc786[_0x7d49('0xbc')][_0x7d49('0xb8')]['push'](_0x1d208c[_0x7d49('0xbc')]);return _0x1cc786;});})[_0x7d49('0x39')](function(_0x31a039){respondWithRpcPromise(_0x7d49('0xbd'),_0x7d49('0xbd'),{'FaxAccountId':_[_0x7d49('0xaf')](_0x446f8f[_0x7d49('0x5f')]['id'])?undefined:_0x446f8f[_0x7d49('0x5f')]['id'],'path':_['isNil'](_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][0x0][_0x7d49('0x8')])?undefined:_0x446f8f[_0x7d49('0x62')][_0x7d49('0xa9')][0x0]['path'],'fax':_[_0x7d49('0xaf')](_0x446f8f[_0x7d49('0x62')]['to'][0x0])?undefined:_0x446f8f[_0x7d49('0x62')]['to'][0x0],'AttachmentId':_0x446f8f['body'][_0x7d49('0xa9')][0x0]['id']},client9002)[_0x7d49('0x39')](function(_0x1a4b90){logger[_0x7d49('0x29')]('SendFaxRpc,\x20%s',_0x1a4b90);})['catch'](function(_0x2baae6){logger[_0x7d49('0x29')](_0x7d49('0xbe'),_0x2baae6);});return _0x31a039;})[_0x7d49('0x39')](respondWithResult(_0x211384,null))[_0x7d49('0x2b')](handleError(_0x211384,null));};exports[_0x7d49('0xbf')]=function(_0x18e908,_0x3af6f6,_0x3cbce0){return db[_0x7d49('0x5c')][_0x7d49('0x66')]({'where':{'id':_0x18e908[_0x7d49('0x5f')]['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x3af6f6,null))['then'](function(_0xa3897){if(_0xa3897){return _0xa3897[_0x7d49('0xbf')](_0x18e908[_0x7d49('0x62')][_0x7d49('0x71')],_[_0x7d49('0x78')](_0x18e908[_0x7d49('0x62')],[_0x7d49('0x71'),'id'])||{})[_0x7d49('0xba')](function(_0x4697ab){for(var _0x1e223e=0x0;_0x1e223e<_0x18e908[_0x7d49('0x62')][_0x7d49('0x71')][_0x7d49('0x4f')];_0x1e223e+=0x1){socket['emit'](_0x7d49('0xc0'),{'UserId':Number(_0x18e908[_0x7d49('0x62')][_0x7d49('0x71')][_0x1e223e]),'FaxAccountId':Number(_0x18e908[_0x7d49('0x5f')]['id'])});}return _0x4697ab;});}})[_0x7d49('0x39')](respondWithResult(_0x3af6f6,null))['catch'](handleError(_0x3af6f6,null));};exports[_0x7d49('0xc1')]=function(_0x57e776,_0x3eaacb,_0x1be13b){return db[_0x7d49('0x5c')][_0x7d49('0x66')]({'where':{'id':_0x57e776['params']['id']}})[_0x7d49('0x39')](handleEntityNotFound(_0x3eaacb,null))[_0x7d49('0x39')](function(_0x3b1a58){if(_0x3b1a58){return _0x3b1a58[_0x7d49('0xc1')](_0x57e776[_0x7d49('0x4a')]['ids'])[_0x7d49('0x39')](function(){if(_[_0x7d49('0xc2')](_0x57e776[_0x7d49('0x4a')]['ids'])){for(var _0xd6938e=0x0;_0xd6938e<_0x57e776[_0x7d49('0x4a')][_0x7d49('0x71')][_0x7d49('0x4f')];_0xd6938e+=0x1){socket[_0x7d49('0xc3')]('userFaxAccount:remove',{'UserId':Number(_0x57e776[_0x7d49('0x4a')][_0x7d49('0x71')][_0xd6938e]),'FaxAccountId':Number(_0x57e776[_0x7d49('0x5f')]['id'])});}}else{socket[_0x7d49('0xc3')](_0x7d49('0xc4'),{'UserId':Number(_0x57e776[_0x7d49('0x4a')][_0x7d49('0x71')]),'FaxAccountId':Number(_0x57e776[_0x7d49('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eaacb,null))['catch'](handleError(_0x3eaacb,null));};exports['getAgents']=function(_0x8b31d0,_0x5aca55,_0xbe53b7){var _0x453fb1={};var _0x393a6e={};var _0x25a6fe;var _0x176d33;return db[_0x7d49('0x5c')]['findOne']({'where':{'id':_0x8b31d0[_0x7d49('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5aca55,null))[_0x7d49('0x39')](function(_0x435e88){if(_0x435e88){_0x25a6fe=_0x435e88;_0x393a6e[_0x7d49('0x49')]=_[_0x7d49('0x4b')](db[_0x7d49('0x7b')]['rawAttributes']);_0x393a6e[_0x7d49('0x4a')]=_[_0x7d49('0x4b')](_0x8b31d0[_0x7d49('0x4a')]);_0x393a6e[_0x7d49('0x54')]=_['intersection'](_0x393a6e[_0x7d49('0x49')],_0x393a6e['query']);_0x453fb1[_0x7d49('0x4d')]=_[_0x7d49('0x4c')](_0x393a6e[_0x7d49('0x49')],qs[_0x7d49('0x4e')](_0x8b31d0[_0x7d49('0x4a')]['fields']));_0x453fb1[_0x7d49('0x4d')]=_0x453fb1['attributes'][_0x7d49('0x4f')]?_0x453fb1['attributes']:_0x393a6e[_0x7d49('0x49')];_0x453fb1['order']=qs[_0x7d49('0x53')](_0x8b31d0[_0x7d49('0x4a')][_0x7d49('0x53')]);_0x453fb1['where']=qs[_0x7d49('0x54')](_[_0x7d49('0x55')](_0x8b31d0[_0x7d49('0x4a')],_0x393a6e[_0x7d49('0x54')]));if(_0x8b31d0[_0x7d49('0x4a')]['filter']){_0x453fb1[_0x7d49('0x58')]=_[_0x7d49('0x57')](_0x453fb1['where'],{'$or':_[_0x7d49('0x44')](_0x453fb1[_0x7d49('0x4d')],function(_0x51b5fc){var _0x476686={};_0x476686[_0x51b5fc]={'$like':'%'+_0x8b31d0['query'][_0x7d49('0x56')]+'%'};return _0x476686;})});}_0x453fb1=_[_0x7d49('0x57')]({},_0x453fb1,_0x8b31d0[_0x7d49('0x5a')]);return _0x25a6fe[_0x7d49('0xc5')](_0x453fb1);}})[_0x7d49('0x39')](function(_0x27c522){if(_0x27c522){_0x176d33=_0x27c522[_0x7d49('0x4f')];if(!_0x8b31d0[_0x7d49('0x4a')]['hasOwnProperty']('nolimit')){_0x453fb1[_0x7d49('0x30')]=qs[_0x7d49('0x30')](_0x8b31d0[_0x7d49('0x4a')][_0x7d49('0x30')]);_0x453fb1['offset']=qs['offset'](_0x8b31d0['query'][_0x7d49('0x32')]);}return _0x25a6fe[_0x7d49('0xc5')](_0x453fb1);}})[_0x7d49('0x39')](function(_0x361396){if(_0x361396){return _0x361396?{'count':_0x176d33,'rows':_0x361396}:null;}})[_0x7d49('0x39')](respondWithResult(_0x5aca55,null))['catch'](handleError(_0x5aca55,null));};
\ No newline at end of file
+var _0x300d=['jayson/promise','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','order','sort','where','filters','merge','map','options','includeAll','include','findAll','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','pick','filter','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addInteraction','omit','FaxInteraction','Contact','User','Owner','Tag','color','tag','addApplications','transaction','bulkCreate','FaxApplication','findAndCountAll','priority','getApplications','context','exten','localstationid','system','description','push','Answer','CDR(type)=inbound-fax','Set','gateway','maxrate','minrate','modem','t38timeout','Wait','ReceiveFax','addAccountApplications','sequelize','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','CmContact','defaults','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxAccount.socket','register'];(function(_0x1de2f3,_0x4100ad){var _0x562cb8=function(_0x24edb){while(--_0x24edb){_0x1de2f3['push'](_0x1de2f3['shift']());}};_0x562cb8(++_0x4100ad);}(_0x300d,0xa5));var _0xd300=function(_0x43bbde,_0x310be1){_0x43bbde=_0x43bbde-0x0;var _0x134d52=_0x300d[_0x43bbde];return _0x134d52;};'use strict';var emlformat=require(_0xd300('0x0'));var rimraf=require(_0xd300('0x1'));var zipdir=require(_0xd300('0x2'));var jsonpatch=require(_0xd300('0x3'));var rp=require(_0xd300('0x4'));var moment=require(_0xd300('0x5'));var BPromise=require(_0xd300('0x6'));var Mustache=require(_0xd300('0x7'));var util=require(_0xd300('0x8'));var path=require(_0xd300('0x9'));var sox=require(_0xd300('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd300('0xb'));var _=require(_0xd300('0xc'));var squel=require(_0xd300('0xd'));var crypto=require(_0xd300('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd300('0xf'));var toCsv=require(_0xd300('0x10'));var querystring=require(_0xd300('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd300('0x12'));var qs=require(_0xd300('0x13'));var as=require(_0xd300('0x14'));var hardwareService=require(_0xd300('0x15'));var logger=require(_0xd300('0x16'))(_0xd300('0x17'));var utils=require(_0xd300('0x18'));var config=require(_0xd300('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd300('0x1a'))['db'];config[_0xd300('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd300('0x1c'))(new Redis(config[_0xd300('0x1b')]));require(_0xd300('0x1d'))[_0xd300('0x1e')](socket);var jayson=require(_0xd300('0x1f'));var client=jayson['client'][_0xd300('0x20')]({'port':0x232c});var client9002=jayson[_0xd300('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ff5e1,_0x3e2ce9,_0x4bbfc4,_0x26cd61){return new BPromise(function(_0x576736,_0x514a35){var _0xa8777c=_0x26cd61||client;return _0xa8777c[_0xd300('0x22')](_0x4ff5e1,_0x4bbfc4)[_0xd300('0x23')](function(_0x8bddc7){logger[_0xd300('0x24')](_0xd300('0x25'),_0x3e2ce9,_0xd300('0x26'));logger[_0xd300('0x27')](_0xd300('0x28'),_0x3e2ce9,_0xd300('0x26'),JSON[_0xd300('0x29')](_0x8bddc7));if(_0x8bddc7['error']){if(_0x8bddc7[_0xd300('0x2a')][_0xd300('0x2b')]===0x1f4){logger['error'](_0xd300('0x25'),_0x3e2ce9,_0x8bddc7[_0xd300('0x2a')]['message']);return _0x514a35(_0x8bddc7[_0xd300('0x2a')][_0xd300('0x2c')]);}logger[_0xd300('0x2a')](_0xd300('0x25'),_0x3e2ce9,_0x8bddc7['error'][_0xd300('0x2c')]);return _0x576736(_0x8bddc7[_0xd300('0x2a')][_0xd300('0x2c')]);}else{logger['info'](_0xd300('0x25'),_0x3e2ce9,'request\x20sent');_0x576736(_0x8bddc7['result'][_0xd300('0x2c')]);}})[_0xd300('0x2d')](function(_0x1b138a){logger[_0xd300('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x3e2ce9,_0x1b138a);_0x514a35(_0x1b138a);});});}function respondWithStatusCode(_0x59e43a,_0x151dbf){_0x151dbf=_0x151dbf||0xcc;return function(_0x23a03b){if(_0x23a03b){return _0x59e43a[_0xd300('0x2e')](_0x151dbf);}return _0x59e43a[_0xd300('0x2f')](_0x151dbf)[_0xd300('0x30')]();};}function respondWithResult(_0x5e2671,_0x20f17c){_0x20f17c=_0x20f17c||0xc8;return function(_0x19d724){if(_0x19d724){return _0x5e2671[_0xd300('0x2f')](_0x20f17c)['json'](_0x19d724);}};}function respondWithFilteredResult(_0x402343,_0x5bc235){return function(_0xb36fe8){if(_0xb36fe8){var _0x4dabc4=typeof _0x5bc235[_0xd300('0x31')]===_0xd300('0x32')&&typeof _0x5bc235[_0xd300('0x33')]===_0xd300('0x32');var _0x1cf855=_0xb36fe8[_0xd300('0x34')];var _0x10508c=_0x4dabc4?0x0:_0x5bc235[_0xd300('0x31')];var _0x39f7ff=_0x4dabc4?_0xb36fe8['count']:_0x5bc235[_0xd300('0x31')]+_0x5bc235[_0xd300('0x33')];var _0x6eb980;if(_0x39f7ff>=_0x1cf855){_0x39f7ff=_0x1cf855;_0x6eb980=0xc8;}else{_0x6eb980=0xce;}_0x402343[_0xd300('0x2f')](_0x6eb980);return _0x402343[_0xd300('0x35')](_0xd300('0x36'),_0x10508c+'-'+_0x39f7ff+'/'+_0x1cf855)[_0xd300('0x37')](_0xb36fe8);}return null;};}function patchUpdates(_0x1d5aca){return function(_0x9ae6e0){try{jsonpatch[_0xd300('0x38')](_0x9ae6e0,_0x1d5aca,!![]);}catch(_0x1807ff){return BPromise[_0xd300('0x39')](_0x1807ff);}return _0x9ae6e0[_0xd300('0x3a')]();};}function saveUpdates(_0x365f5b,_0x45c3db){return function(_0x1935dc){if(_0x1935dc){return _0x1935dc[_0xd300('0x3b')](_0x365f5b)['then'](function(_0x313f23){return _0x313f23;});}return null;};}function removeEntity(_0x357016,_0x57c0b9){return function(_0x35d392){if(_0x35d392){return _0x35d392[_0xd300('0x3c')]()[_0xd300('0x23')](function(){var _0x41f0ae=_0x35d392[_0xd300('0x3d')]({'plain':!![]});var _0x80ab20=_0xd300('0x3e');return db[_0xd300('0x3f')][_0xd300('0x3c')]({'where':{'type':_0x80ab20,'resourceId':_0x41f0ae['id']}})[_0xd300('0x23')](function(){return _0x35d392;});})[_0xd300('0x23')](function(){_0x357016[_0xd300('0x2f')](0xcc)[_0xd300('0x30')]();});}};}function handleEntityNotFound(_0x1fc62b,_0x49c09e){return function(_0x937b49){if(!_0x937b49){_0x1fc62b['sendStatus'](0x194);}return _0x937b49;};}function handleError(_0x36f0e2,_0x538447){_0x538447=_0x538447||0x1f4;return function(_0x564ad0){logger[_0xd300('0x2a')](_0x564ad0['stack']);if(_0x564ad0[_0xd300('0x40')]){delete _0x564ad0[_0xd300('0x40')];}_0x36f0e2[_0xd300('0x2f')](_0x538447)[_0xd300('0x41')](_0x564ad0);};}exports[_0xd300('0x42')]=function(_0x882b62,_0x34fc00){var _0x2ea22d={'include':[{'model':db[_0xd300('0x43')],'as':_0xd300('0x44')}]},_0x475683={},_0x396dbb={'count':0x0,'rows':[]};var _0x2b8f50=_['map'](db[_0xd300('0x45')][_0xd300('0x46')],function(_0x286cf7){return{'name':_0x286cf7[_0xd300('0x47')],'type':_0x286cf7[_0xd300('0x48')][_0xd300('0x49')]};});_0x475683['model']=_['map'](_0x2b8f50,_0xd300('0x40'));_0x475683[_0xd300('0x4a')]=_['keys'](_0x882b62[_0xd300('0x4a')]);_0x475683['filters']=_['intersection'](_0x475683[_0xd300('0x4b')],_0x475683[_0xd300('0x4a')]);_0x2ea22d[_0xd300('0x4c')]=_[_0xd300('0x4d')](_0x475683[_0xd300('0x4b')],qs[_0xd300('0x4e')](_0x882b62[_0xd300('0x4a')][_0xd300('0x4e')]));_0x2ea22d[_0xd300('0x4c')]=_0x2ea22d['attributes'][_0xd300('0x4f')]?_0x2ea22d[_0xd300('0x4c')]:_0x475683[_0xd300('0x4b')];if(!_0x882b62[_0xd300('0x4a')]['hasOwnProperty']('nolimit')){_0x2ea22d[_0xd300('0x33')]=qs[_0xd300('0x33')](_0x882b62['query'][_0xd300('0x33')]);_0x2ea22d[_0xd300('0x31')]=qs[_0xd300('0x31')](_0x882b62[_0xd300('0x4a')][_0xd300('0x31')]);}_0x2ea22d[_0xd300('0x50')]=qs['sort'](_0x882b62[_0xd300('0x4a')][_0xd300('0x51')]);_0x2ea22d[_0xd300('0x52')]=qs['filters'](_['pick'](_0x882b62[_0xd300('0x4a')],_0x475683[_0xd300('0x53')]),_0x2b8f50);if(_0x882b62[_0xd300('0x4a')]['filter']){_0x2ea22d[_0xd300('0x52')]=_[_0xd300('0x54')](_0x2ea22d[_0xd300('0x52')],{'$or':_[_0xd300('0x55')](_0x2b8f50,function(_0x4eccfc){if(_0x4eccfc[_0xd300('0x48')]!=='VIRTUAL'){var _0x4e4970={};_0x4e4970[_0x4eccfc[_0xd300('0x40')]]={'$like':'%'+_0x882b62[_0xd300('0x4a')]['filter']+'%'};return _0x4e4970;}})});}_0x2ea22d=_[_0xd300('0x54')]({},_0x2ea22d,_0x882b62[_0xd300('0x56')]);var _0x4b4dd5={'where':_0x2ea22d[_0xd300('0x52')]};return db[_0xd300('0x45')][_0xd300('0x34')](_0x4b4dd5)[_0xd300('0x23')](function(_0x20a4d4){_0x396dbb['count']=_0x20a4d4;if(_0x882b62[_0xd300('0x4a')][_0xd300('0x57')]){_0x2ea22d[_0xd300('0x58')]=[{'all':!![]}];}return db[_0xd300('0x45')][_0xd300('0x59')](_0x2ea22d);})[_0xd300('0x23')](function(_0x310669){_0x396dbb['rows']=_0x310669;return _0x396dbb;})[_0xd300('0x23')](respondWithFilteredResult(_0x34fc00,_0x2ea22d))[_0xd300('0x2d')](handleError(_0x34fc00,null));};exports['show']=function(_0x1c670d,_0x4ca325){var _0x542be5={'raw':![],'where':{'id':_0x1c670d[_0xd300('0x5a')]['id']},'include':[{'model':db[_0xd300('0x43')],'as':_0xd300('0x44')}]},_0xf79626={};_0xf79626[_0xd300('0x4b')]=_['keys'](db['FaxAccount'][_0xd300('0x46')]);_0xf79626[_0xd300('0x4a')]=_[_0xd300('0x5b')](_0x1c670d['query']);_0xf79626[_0xd300('0x53')]=_[_0xd300('0x4d')](_0xf79626[_0xd300('0x4b')],_0xf79626[_0xd300('0x4a')]);_0x542be5[_0xd300('0x4c')]=_[_0xd300('0x4d')](_0xf79626[_0xd300('0x4b')],qs[_0xd300('0x4e')](_0x1c670d[_0xd300('0x4a')][_0xd300('0x4e')]));_0x542be5['attributes']=_0x542be5[_0xd300('0x4c')][_0xd300('0x4f')]?_0x542be5['attributes']:_0xf79626[_0xd300('0x4b')];if(_0x1c670d[_0xd300('0x4a')][_0xd300('0x57')]){_0x542be5[_0xd300('0x58')]=[{'all':!![]}];}_0x542be5=_[_0xd300('0x54')]({},_0x542be5,_0x1c670d[_0xd300('0x56')]);return db[_0xd300('0x45')]['find'](_0x542be5)[_0xd300('0x23')](handleEntityNotFound(_0x4ca325,null))[_0xd300('0x23')](respondWithResult(_0x4ca325,null))[_0xd300('0x2d')](handleError(_0x4ca325,null));};exports[_0xd300('0x5c')]=function(_0x4e170a,_0x5c7d73){return db['FaxAccount'][_0xd300('0x5c')](_0x4e170a[_0xd300('0x5d')],{})[_0xd300('0x23')](function(_0x2a5952){var _0x527742=_0x4e170a[_0xd300('0x5e')][_0xd300('0x3d')]({'plain':!![]});if(!_0x527742)throw new Error(_0xd300('0x5f'));if(_0x527742[_0xd300('0x60')]===_0xd300('0x5e')){var _0x5e4d87=_0x2a5952[_0xd300('0x3d')]({'plain':!![]});var _0x327e6d=_0xd300('0x3e');return db['UserProfileSection'][_0xd300('0x61')]({'where':{'name':_0x327e6d,'userProfileId':_0x527742['userProfileId']},'raw':!![]})[_0xd300('0x23')](function(_0xff147f){if(_0xff147f&&_0xff147f[_0xd300('0x62')]===0x0){return db[_0xd300('0x3f')][_0xd300('0x5c')]({'name':_0x5e4d87[_0xd300('0x40')],'resourceId':_0x5e4d87['id'],'type':_0xff147f[_0xd300('0x40')],'sectionId':_0xff147f['id']},{})['then'](function(){return _0x2a5952;});}else{return _0x2a5952;}})['catch'](function(_0x1a3e6d){logger[_0xd300('0x2a')](_0xd300('0x63'),_0x1a3e6d);throw _0x1a3e6d;});}return _0x2a5952;})[_0xd300('0x23')](respondWithResult(_0x5c7d73,0xc9))[_0xd300('0x2d')](handleError(_0x5c7d73,null));};exports[_0xd300('0x3b')]=function(_0x4deecd,_0x11320e){if(_0x4deecd[_0xd300('0x5d')]['id']){delete _0x4deecd[_0xd300('0x5d')]['id'];}return db[_0xd300('0x45')][_0xd300('0x61')]({'where':{'id':_0x4deecd[_0xd300('0x5a')]['id']},'include':[{'model':db[_0xd300('0x43')],'as':'mandatoryDispositionPause'}]})[_0xd300('0x23')](handleEntityNotFound(_0x11320e,null))[_0xd300('0x23')](saveUpdates(_0x4deecd[_0xd300('0x5d')],null))[_0xd300('0x23')](respondWithResult(_0x11320e,null))[_0xd300('0x2d')](handleError(_0x11320e,null));};exports['destroy']=function(_0x4c588c,_0x921ddb){return db[_0xd300('0x45')][_0xd300('0x61')]({'where':{'id':_0x4c588c[_0xd300('0x5a')]['id']}})['then'](handleEntityNotFound(_0x921ddb,null))[_0xd300('0x23')](removeEntity(_0x921ddb,null))[_0xd300('0x2d')](handleError(_0x921ddb,null));};exports[_0xd300('0x64')]=function(_0x63758f,_0xa39c2){return db['FaxAccount']['describe']()[_0xd300('0x23')](respondWithResult(_0xa39c2,null))[_0xd300('0x2d')](handleError(_0xa39c2,null));};exports[_0xd300('0x65')]=function(_0x3d4e07,_0x136e6a,_0x3f3574){if(_0x3d4e07[_0xd300('0x5d')]['id']){delete _0x3d4e07[_0xd300('0x5d')]['id'];}return db[_0xd300('0x45')]['find']({'where':{'id':_0x3d4e07['params']['id']}})['then'](handleEntityNotFound(_0x136e6a,null))[_0xd300('0x23')](function(_0x8cc6f3){if(_0x8cc6f3){_0x3d4e07[_0xd300('0x5d')][_0xd300('0x66')]=_0x8cc6f3['id'];return db[_0xd300('0x67')][_0xd300('0x5c')](_0x3d4e07['body']);}})[_0xd300('0x23')](respondWithResult(_0x136e6a,null))[_0xd300('0x2d')](handleError(_0x136e6a,null));};exports[_0xd300('0x68')]=function(_0x23c847,_0x4ea503,_0x25d6e8){var _0x51d063={'raw':![],'where':{}};var _0x1ae85d={};var _0x38d00b={'count':0x0,'rows':[]};return db[_0xd300('0x45')][_0xd300('0x69')]({'where':{'id':_0x23c847[_0xd300('0x5a')]['id']}})[_0xd300('0x23')](handleEntityNotFound(_0x4ea503,null))[_0xd300('0x23')](function(_0x3b567c){if(_0x3b567c){_0x1ae85d['model']=_[_0xd300('0x5b')](db[_0xd300('0x67')][_0xd300('0x46')]);_0x1ae85d[_0xd300('0x4a')]=_[_0xd300('0x5b')](_0x23c847[_0xd300('0x4a')]);_0x1ae85d[_0xd300('0x53')]=_[_0xd300('0x4d')](_0x1ae85d['model'],_0x1ae85d['query']);_0x51d063[_0xd300('0x4c')]=_[_0xd300('0x4d')](_0x1ae85d[_0xd300('0x4b')],qs['fields'](_0x23c847['query'][_0xd300('0x4e')]));_0x51d063[_0xd300('0x4c')]=_0x51d063[_0xd300('0x4c')][_0xd300('0x4f')]?_0x51d063[_0xd300('0x4c')]:_0x1ae85d[_0xd300('0x4b')];if(!_0x23c847[_0xd300('0x4a')][_0xd300('0x6a')]('nolimit')){_0x51d063['limit']=qs[_0xd300('0x33')](_0x23c847[_0xd300('0x4a')]['limit']);_0x51d063[_0xd300('0x31')]=qs['offset'](_0x23c847[_0xd300('0x4a')]['offset']);}_0x51d063['order']=qs[_0xd300('0x51')](_0x23c847[_0xd300('0x4a')][_0xd300('0x51')]);_0x51d063[_0xd300('0x52')]=qs[_0xd300('0x53')](_[_0xd300('0x6b')](_0x23c847[_0xd300('0x4a')],_0x1ae85d[_0xd300('0x53')]));_0x51d063[_0xd300('0x52')]['FaxAccountId']=_0x3b567c['id'];if(_0x23c847[_0xd300('0x4a')]['filter']){_0x51d063[_0xd300('0x52')]=_[_0xd300('0x54')](_0x51d063[_0xd300('0x52')],{'$or':_[_0xd300('0x55')](_0x51d063[_0xd300('0x4c')],function(_0x324a5a){var _0x5550ae={};_0x5550ae[_0x324a5a]={'$like':'%'+_0x23c847[_0xd300('0x4a')][_0xd300('0x6c')]+'%'};return _0x5550ae;})});}_0x51d063=_['merge']({},_0x51d063,_0x23c847[_0xd300('0x56')]);return db['Disposition'][_0xd300('0x34')]({'where':_0x51d063[_0xd300('0x52')]})[_0xd300('0x23')](function(_0x56511c){_0x38d00b['count']=_0x56511c;if(_0x23c847[_0xd300('0x4a')][_0xd300('0x57')]){_0x51d063[_0xd300('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xd300('0x59')](_0x51d063);})['then'](function(_0x58cb32){_0x38d00b[_0xd300('0x6d')]=_0x58cb32;return _0x38d00b;});}})[_0xd300('0x23')](respondWithFilteredResult(_0x4ea503,_0x51d063))['catch'](handleError(_0x4ea503,null));};exports['removeDispositions']=function(_0xc9d018,_0x262ca1,_0x922bd7){return db[_0xd300('0x45')][_0xd300('0x61')]({'where':{'id':_0xc9d018[_0xd300('0x5a')]['id']}})['then'](handleEntityNotFound(_0x262ca1,null))['then'](function(_0x6a1bde){if(_0x6a1bde){return _0x6a1bde[_0xd300('0x6e')](_0xc9d018['query'][_0xd300('0x6f')]);}})[_0xd300('0x23')](respondWithStatusCode(_0x262ca1,null))[_0xd300('0x2d')](handleError(_0x262ca1,null));};exports[_0xd300('0x70')]=function(_0x319512,_0x1bb5e5,_0x3acf5e){if(_0x319512[_0xd300('0x5d')]['id']){delete _0x319512[_0xd300('0x5d')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x319512[_0xd300('0x5a')]['id']}})[_0xd300('0x23')](handleEntityNotFound(_0x1bb5e5,null))['then'](function(_0x5a9873){if(_0x5a9873){_0x319512[_0xd300('0x5d')]['FaxAccountId']=_0x5a9873['id'];return db[_0xd300('0x71')]['create'](_0x319512[_0xd300('0x5d')]);}})[_0xd300('0x23')](respondWithResult(_0x1bb5e5,null))[_0xd300('0x2d')](handleError(_0x1bb5e5,null));};exports[_0xd300('0x72')]=function(_0x5ed157,_0x2e0b2e,_0x19bef0){var _0x162e97={'raw':![],'where':{}};var _0x22df56={};var _0x199965={'count':0x0,'rows':[]};return db[_0xd300('0x45')][_0xd300('0x69')]({'where':{'id':_0x5ed157[_0xd300('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2e0b2e,null))[_0xd300('0x23')](function(_0x14f942){if(_0x14f942){_0x22df56[_0xd300('0x4b')]=_[_0xd300('0x5b')](db[_0xd300('0x71')][_0xd300('0x46')]);_0x22df56[_0xd300('0x4a')]=_[_0xd300('0x5b')](_0x5ed157[_0xd300('0x4a')]);_0x22df56[_0xd300('0x53')]=_[_0xd300('0x4d')](_0x22df56[_0xd300('0x4b')],_0x22df56[_0xd300('0x4a')]);_0x162e97[_0xd300('0x4c')]=_[_0xd300('0x4d')](_0x22df56[_0xd300('0x4b')],qs[_0xd300('0x4e')](_0x5ed157[_0xd300('0x4a')][_0xd300('0x4e')]));_0x162e97['attributes']=_0x162e97[_0xd300('0x4c')][_0xd300('0x4f')]?_0x162e97[_0xd300('0x4c')]:_0x22df56[_0xd300('0x4b')];if(!_0x5ed157[_0xd300('0x4a')][_0xd300('0x6a')](_0xd300('0x73'))){_0x162e97[_0xd300('0x33')]=qs['limit'](_0x5ed157[_0xd300('0x4a')][_0xd300('0x33')]);_0x162e97['offset']=qs['offset'](_0x5ed157['query'][_0xd300('0x31')]);}_0x162e97[_0xd300('0x50')]=qs[_0xd300('0x51')](_0x5ed157[_0xd300('0x4a')]['sort']);_0x162e97['where']=qs['filters'](_[_0xd300('0x6b')](_0x5ed157['query'],_0x22df56[_0xd300('0x53')]));_0x162e97[_0xd300('0x52')][_0xd300('0x66')]=_0x14f942['id'];if(_0x5ed157[_0xd300('0x4a')][_0xd300('0x6c')]){_0x162e97[_0xd300('0x52')]=_[_0xd300('0x54')](_0x162e97[_0xd300('0x52')],{'$or':_[_0xd300('0x55')](_0x162e97[_0xd300('0x4c')],function(_0x24d30f){var _0x467296={};_0x467296[_0x24d30f]={'$like':'%'+_0x5ed157['query'][_0xd300('0x6c')]+'%'};return _0x467296;})});}_0x162e97=_['merge']({},_0x162e97,_0x5ed157[_0xd300('0x56')]);return db['CannedAnswer'][_0xd300('0x34')]({'where':_0x162e97[_0xd300('0x52')]})[_0xd300('0x23')](function(_0x24d889){_0x199965[_0xd300('0x34')]=_0x24d889;if(_0x5ed157[_0xd300('0x4a')][_0xd300('0x57')]){_0x162e97[_0xd300('0x58')]=[{'all':!![]}];}return db[_0xd300('0x71')][_0xd300('0x59')](_0x162e97);})['then'](function(_0x22925f){_0x199965['rows']=_0x22925f;return _0x199965;});}})[_0xd300('0x23')](respondWithFilteredResult(_0x2e0b2e,_0x162e97))[_0xd300('0x2d')](handleError(_0x2e0b2e,null));};exports['removeAnswers']=function(_0x4ee90c,_0x43518e,_0x586ea1){return db[_0xd300('0x45')][_0xd300('0x61')]({'where':{'id':_0x4ee90c[_0xd300('0x5a')]['id']}})[_0xd300('0x23')](handleEntityNotFound(_0x43518e,null))['then'](function(_0x284cea){if(_0x284cea){return _0x284cea[_0xd300('0x74')](_0x4ee90c[_0xd300('0x4a')][_0xd300('0x6f')]);}})[_0xd300('0x23')](respondWithStatusCode(_0x43518e,null))['catch'](handleError(_0x43518e,null));};exports[_0xd300('0x75')]=function(_0x182236,_0x724fc2,_0x560963){return db['FaxInteraction']['find']({'where':{'id':_0x182236[_0xd300('0x5a')]['id']}})['then'](handleEntityNotFound(_0x724fc2,null))[_0xd300('0x23')](function(_0x640573){if(_0x640573){return _0x640573[_0xd300('0x75')](_0x182236[_0xd300('0x5d')][_0xd300('0x6f')],_[_0xd300('0x76')](_0x182236['body'],[_0xd300('0x6f'),'id'])||{});}})[_0xd300('0x23')](respondWithResult(_0x724fc2,null))['catch'](handleError(_0x724fc2,null));};exports['getInteractions']=function(_0xb277a5,_0x1cedcd,_0x3bcd79){var _0x30ae14={'raw':![],'where':{}};var _0x19aba0={};var _0x243cc9={'count':0x0,'rows':[]};return db[_0xd300('0x45')][_0xd300('0x69')]({'where':{'id':_0xb277a5[_0xd300('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1cedcd,null))[_0xd300('0x23')](function(_0x30741a){if(_0x30741a){_0x19aba0[_0xd300('0x4b')]=_[_0xd300('0x5b')](db[_0xd300('0x77')]['rawAttributes']);_0x19aba0[_0xd300('0x4a')]=_[_0xd300('0x5b')](_0xb277a5[_0xd300('0x4a')]);_0x19aba0[_0xd300('0x53')]=_[_0xd300('0x4d')](_0x19aba0[_0xd300('0x4b')],_0x19aba0[_0xd300('0x4a')]);_0x30ae14[_0xd300('0x4c')]=_['intersection'](_0x19aba0['model'],qs['fields'](_0xb277a5[_0xd300('0x4a')]['fields']));_0x30ae14[_0xd300('0x4c')]=_0x30ae14[_0xd300('0x4c')][_0xd300('0x4f')]?_0x30ae14[_0xd300('0x4c')]:_0x19aba0[_0xd300('0x4b')];if(!_0xb277a5[_0xd300('0x4a')]['hasOwnProperty'](_0xd300('0x73'))){_0x30ae14[_0xd300('0x33')]=qs[_0xd300('0x33')](_0xb277a5[_0xd300('0x4a')]['limit']);_0x30ae14[_0xd300('0x31')]=qs[_0xd300('0x31')](_0xb277a5['query'][_0xd300('0x31')]);}_0x30ae14[_0xd300('0x50')]=qs['sort'](_0xb277a5['query'][_0xd300('0x51')]);_0x30ae14[_0xd300('0x52')]=qs[_0xd300('0x53')](_[_0xd300('0x6b')](_0xb277a5[_0xd300('0x4a')],_0x19aba0[_0xd300('0x53')]));_0x30ae14[_0xd300('0x52')][_0xd300('0x66')]=_0x30741a['id'];if(_0xb277a5[_0xd300('0x4a')][_0xd300('0x6c')]){_0x30ae14[_0xd300('0x52')]=_[_0xd300('0x54')](_0x30ae14[_0xd300('0x52')],{'$or':_[_0xd300('0x55')](_0x30ae14[_0xd300('0x4c')],function(_0x501f1a){var _0x129d7b={};_0x129d7b[_0x501f1a]={'$like':'%'+_0xb277a5[_0xd300('0x4a')][_0xd300('0x6c')]+'%'};return _0x129d7b;})});}_0x30ae14=_['merge']({},_0x30ae14,_0xb277a5[_0xd300('0x56')]);return db[_0xd300('0x77')][_0xd300('0x34')]({'where':_0x30ae14['where']})[_0xd300('0x23')](function(_0x5e1007){_0x243cc9['count']=_0x5e1007;if(_0xb277a5[_0xd300('0x4a')][_0xd300('0x57')]){_0x30ae14[_0xd300('0x58')]=[{'model':db['CmContact'],'as':_0xd300('0x78'),'required':![]},{'model':db[_0xd300('0x79')],'as':_0xd300('0x7a'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xd300('0x7b')],'as':'Tags','attributes':['id',_0xd300('0x40'),_0xd300('0x7c')],'where':_0xb277a5[_0xd300('0x4a')]['tag']?{'id':_0xb277a5[_0xd300('0x4a')][_0xd300('0x7d')]}:undefined,'required':_0xb277a5[_0xd300('0x4a')][_0xd300('0x7d')]?!![]:![]}];}return db[_0xd300('0x77')]['findAll'](_0x30ae14);})[_0xd300('0x23')](function(_0xff7517){_0x243cc9[_0xd300('0x6d')]=_0xff7517;return _0x243cc9;});}})[_0xd300('0x23')](respondWithFilteredResult(_0x1cedcd,_0x30ae14))[_0xd300('0x2d')](handleError(_0x1cedcd,null));};exports[_0xd300('0x7e')]=function(_0x46e9f2,_0x4647d8,_0x5c27e0){return db[_0xd300('0x45')][_0xd300('0x69')]({'where':{'id':_0x46e9f2[_0xd300('0x5a')]['id']}})[_0xd300('0x23')](handleEntityNotFound(_0x4647d8,null))[_0xd300('0x23')](function(_0x50a8c3){if(_0x50a8c3){return db['sequelize'][_0xd300('0x7f')](function(_0x184f94){return db['FaxApplication'][_0xd300('0x3c')]({'where':{'FaxAccountId':_0x46e9f2[_0xd300('0x5a')]['id']},'transaction':_0x184f94})[_0xd300('0x23')](function(_0x1d8866){var _0x21aeae=_[_0xd300('0x55')](_0x46e9f2[_0xd300('0x5d')],function(_0x2eef89){_0x2eef89[_0xd300('0x66')]=_0x46e9f2[_0xd300('0x5a')]['id'];return _0x2eef89;});return db['FaxApplication'][_0xd300('0x80')](_0x21aeae,{'transaction':_0x184f94});});})[_0xd300('0x23')](function(){return db[_0xd300('0x81')][_0xd300('0x82')]({'where':{'FaxAccountId':_0x46e9f2[_0xd300('0x5a')]['id']},'order':_0xd300('0x83')});});}})[_0xd300('0x23')](respondWithResult(_0x4647d8,null))['catch'](handleError(_0x4647d8,null));};exports[_0xd300('0x84')]=function(_0x10a8e8,_0x2fbb81,_0x340f69){var _0xd8c3fb={};var _0x3ff2a7={};var _0x4d23d0;var _0x3b8cf6;return db[_0xd300('0x45')][_0xd300('0x69')]({'where':{'id':_0x10a8e8[_0xd300('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2fbb81,null))[_0xd300('0x23')](function(_0x59f8b1){if(_0x59f8b1){_0x4d23d0=_0x59f8b1;_0x3ff2a7[_0xd300('0x4b')]=_['keys'](db['FaxApplication'][_0xd300('0x46')]);_0x3ff2a7[_0xd300('0x4a')]=_[_0xd300('0x5b')](_0x10a8e8[_0xd300('0x4a')]);_0x3ff2a7[_0xd300('0x53')]=_[_0xd300('0x4d')](_0x3ff2a7[_0xd300('0x4b')],_0x3ff2a7['query']);_0xd8c3fb[_0xd300('0x4c')]=_[_0xd300('0x4d')](_0x3ff2a7[_0xd300('0x4b')],qs[_0xd300('0x4e')](_0x10a8e8['query'][_0xd300('0x4e')]));_0xd8c3fb[_0xd300('0x4c')]=_0xd8c3fb['attributes']['length']?_0xd8c3fb[_0xd300('0x4c')]:_0x3ff2a7[_0xd300('0x4b')];_0xd8c3fb[_0xd300('0x50')]=qs[_0xd300('0x51')](_0x10a8e8[_0xd300('0x4a')][_0xd300('0x51')]);_0xd8c3fb['where']=qs[_0xd300('0x53')](_['pick'](_0x10a8e8[_0xd300('0x4a')],_0x3ff2a7[_0xd300('0x53')]));if(_0x10a8e8[_0xd300('0x4a')]['filter']){_0xd8c3fb[_0xd300('0x52')]=_[_0xd300('0x54')](_0xd8c3fb['where'],{'$or':_[_0xd300('0x55')](_0xd8c3fb[_0xd300('0x4c')],function(_0x55ac14){var _0x3e1858={};_0x3e1858[_0x55ac14]={'$like':'%'+_0x10a8e8[_0xd300('0x4a')][_0xd300('0x6c')]+'%'};return _0x3e1858;})});}_0xd8c3fb=_[_0xd300('0x54')]({},_0xd8c3fb,_0x10a8e8[_0xd300('0x56')]);return _0x4d23d0[_0xd300('0x84')](_0xd8c3fb);}})[_0xd300('0x23')](function(_0x2db9b){if(_0x2db9b){_0x3b8cf6=_0x2db9b[_0xd300('0x4f')];if(!_0x10a8e8[_0xd300('0x4a')][_0xd300('0x6a')]('nolimit')){_0xd8c3fb[_0xd300('0x33')]=qs[_0xd300('0x33')](_0x10a8e8['query'][_0xd300('0x33')]);_0xd8c3fb['offset']=qs['offset'](_0x10a8e8['query'][_0xd300('0x31')]);}return _0x4d23d0['getApplications'](_0xd8c3fb);}})['then'](function(_0x1b6408){if(_0x1b6408){return _0x1b6408?{'count':_0x3b8cf6,'rows':_0x1b6408}:null;}})[_0xd300('0x23')](respondWithResult(_0x2fbb81,null))[_0xd300('0x2d')](handleError(_0x2fbb81,null));};function Extension(_0x7b0afb,_0x2869cf,_0x359c69,_0x1d0ed1){this[_0xd300('0x85')]='from-voip-provider';this[_0xd300('0x86')]=_0x7b0afb[_0xd300('0x87')];this['app']=_0x1d0ed1;this['type']=_0xd300('0x88');this[_0xd300('0x89')]='Fax\x20Extension';this[_0xd300('0x66')]=_0x7b0afb['id'];this['priority']=_0x2869cf;this['appdata']=_0x359c69;}function createExtensionsReciveFax(_0x1fdf60){var _0x42f2c0=0x1;var _0xc31d6a=[];_0xc31d6a[_0xd300('0x8a')](new Extension(_0x1fdf60,_0x42f2c0,'',_0xd300('0x8b')));_0x42f2c0+=0x1;_0xc31d6a[_0xd300('0x8a')](new Extension(_0x1fdf60,_0x42f2c0,_0xd300('0x8c'),_0xd300('0x8d')));_0x42f2c0+=0x1;for(var _0x578b5e in _0x1fdf60){if(_0x1fdf60[_0xd300('0x6a')](_0x578b5e)&&(_0x578b5e==='ecm'||_0x578b5e===_0xd300('0x87')||_0x578b5e===_0xd300('0x8e')||_0x578b5e==='faxdetect'||_0x578b5e==='headerinfo'||_0x578b5e===_0xd300('0x8f')||_0x578b5e===_0xd300('0x90')||_0x578b5e===_0xd300('0x91')||_0x578b5e===_0xd300('0x92'))){_0xc31d6a[_0xd300('0x8a')](new Extension(_0x1fdf60,_0x42f2c0,'FAXOPT('+_0x578b5e+')='+_0x1fdf60[_0x578b5e],'Set'));_0x42f2c0+=0x1;}}_0xc31d6a['push'](new Extension(_0x1fdf60,_0x42f2c0,'6',_0xd300('0x93')));_0x42f2c0+=0x1;_0xc31d6a[_0xd300('0x8a')](new Extension(_0x1fdf60,_0x42f2c0,'/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',_0xd300('0x94')));_0x42f2c0=0x0;return _0xc31d6a;}exports[_0xd300('0x95')]=function(_0x3ee5c9,_0x180394,_0x13d821){var _0x1b5148;return db[_0xd300('0x96')][_0xd300('0x7f')](function(_0x53e4c6){return db['FaxAccount']['create'](_0x3ee5c9['body'],{'transaction':_0x53e4c6})[_0xd300('0x23')](function(_0x4c1a27){_0x1b5148=_0x4c1a27[_0xd300('0x3d')]({'plain':!![]});return db['VoiceExtension'][_0xd300('0x80')](createExtensionsReciveFax(_0x1b5148),{'transaction':_0x53e4c6});});})[_0xd300('0x23')](function(){return _0x1b5148;})['then'](respondWithResult(_0x180394,null))['catch'](handleError(_0x180394,null));};exports[_0xd300('0x97')]=function(_0x43948c,_0x47bb78,_0x3169c5){var _0x283b71;return db[_0xd300('0x96')]['transaction'](function(_0x3ee693){return db[_0xd300('0x45')][_0xd300('0x3b')](_0x43948c['body'],{'where':{'id':_0x43948c[_0xd300('0x5d')]['id']},'transaction':_0x3ee693})[_0xd300('0x23')](function(_0x3054bc){return db[_0xd300('0x98')][_0xd300('0x3c')]({'where':{'FaxAccountId':_0x43948c[_0xd300('0x5d')]['id']},'transaction':_0x3ee693})['then'](function(_0x2bfb30){return db[_0xd300('0x98')][_0xd300('0x80')](createExtensionsReciveFax(_[_0xd300('0x76')](_0x43948c[_0xd300('0x5d')],[_0xd300('0x99'),_0xd300('0x49'),_0xd300('0x9a'),_0xd300('0x9b'),_0xd300('0x9c'),_0xd300('0x9d')])),{'transaction':_0x3ee693});});});})[_0xd300('0x23')](function(){return db[_0xd300('0x45')]['findById'](_0x43948c[_0xd300('0x5d')]['id']);})[_0xd300('0x23')](respondWithResult(_0x47bb78,null))[_0xd300('0x2d')](handleError(_0x47bb78,null));};exports['getMessages']=function(_0x3df20d,_0x3e35fe,_0x1f976c){var _0x4dda38={'raw':!![],'where':{}};var _0x54205f={};var _0x39257a={'count':0x0,'rows':[]};return db[_0xd300('0x45')][_0xd300('0x69')]({'where':{'id':_0x3df20d['params']['id']}})[_0xd300('0x23')](handleEntityNotFound(_0x3e35fe,null))[_0xd300('0x23')](function(_0x2fe6b0){if(_0x2fe6b0){_0x54205f[_0xd300('0x4b')]=_[_0xd300('0x5b')](db[_0xd300('0x9e')][_0xd300('0x46')]);_0x54205f[_0xd300('0x4a')]=_[_0xd300('0x5b')](_0x3df20d[_0xd300('0x4a')]);_0x54205f[_0xd300('0x53')]=_['intersection'](_0x54205f[_0xd300('0x4b')],_0x54205f[_0xd300('0x4a')]);_0x4dda38[_0xd300('0x4c')]=_[_0xd300('0x4d')](_0x54205f[_0xd300('0x4b')],qs[_0xd300('0x4e')](_0x3df20d[_0xd300('0x4a')][_0xd300('0x4e')]));_0x4dda38[_0xd300('0x4c')]=_0x4dda38[_0xd300('0x4c')][_0xd300('0x4f')]?_0x4dda38[_0xd300('0x4c')]:_0x54205f['model'];if(!_0x3df20d['query'][_0xd300('0x6a')](_0xd300('0x73'))){_0x4dda38[_0xd300('0x33')]=qs['limit'](_0x3df20d['query']['limit']);_0x4dda38['offset']=qs[_0xd300('0x31')](_0x3df20d[_0xd300('0x4a')][_0xd300('0x31')]);}_0x4dda38[_0xd300('0x50')]=qs[_0xd300('0x51')](_0x3df20d['query']['sort']);_0x4dda38['where']=qs[_0xd300('0x53')](_[_0xd300('0x6b')](_0x3df20d[_0xd300('0x4a')],_0x54205f[_0xd300('0x53')]));_0x4dda38['where'][_0xd300('0x66')]=_0x2fe6b0['id'];if(_0x3df20d[_0xd300('0x4a')][_0xd300('0x6c')]){_0x4dda38[_0xd300('0x52')]=_[_0xd300('0x54')](_0x4dda38[_0xd300('0x52')],{'$or':_[_0xd300('0x55')](_0x4dda38[_0xd300('0x4c')],function(_0x59d903){var _0x25fe09={};_0x25fe09[_0x59d903]={'$like':'%'+_0x3df20d[_0xd300('0x4a')]['filter']+'%'};return _0x25fe09;})});}if(_0x3df20d[_0xd300('0x4a')][_0xd300('0x9f')]){var _0x5e3387=_0x3df20d[_0xd300('0x4a')]['$gte'][_0xd300('0xa0')](',');var _0x87c75a={};_0x87c75a[_0x5e3387[0x0]]={'$gte':moment(_0x5e3387[0x1])[_0xd300('0xa1')](_0xd300('0xa2'))};_0x4dda38[_0xd300('0x52')]=_[_0xd300('0x54')](_0x4dda38[_0xd300('0x52')],_0x87c75a);}_0x4dda38=_[_0xd300('0x54')]({},_0x4dda38,_0x3df20d[_0xd300('0x56')]);return db['FaxMessage']['count']({'where':_0x4dda38[_0xd300('0x52')]})[_0xd300('0x23')](function(_0x3ee012){_0x39257a[_0xd300('0x34')]=_0x3ee012;if(_0x3df20d[_0xd300('0x4a')][_0xd300('0x57')]){_0x4dda38[_0xd300('0x58')]=[{'all':!![]}];}return db[_0xd300('0x9e')][_0xd300('0x59')](_0x4dda38);})[_0xd300('0x23')](function(_0x156b0a){_0x39257a[_0xd300('0x6d')]=_0x156b0a;return _0x39257a;});}})[_0xd300('0x23')](respondWithFilteredResult(_0x3e35fe,_0x4dda38))['catch'](handleError(_0x3e35fe,null));};exports[_0xd300('0x41')]=function(_0x11087a,_0x4fd6ee,_0x59472b){var _0x32ff82,_0x59c2bd={},_0xf6b4ea;if(_0x11087a[_0xd300('0x5d')]['to']){_0xf6b4ea=_0x11087a[_0xd300('0x5d')]['to'][0x0];}return db[_0xd300('0x45')][_0xd300('0x61')]({'where':{'id':_0x11087a['params']['id']},'include':[{'model':db[_0xd300('0xa3')],'as':_0xd300('0xa4'),'include':[{'model':db['CmContact'],'as':_0xd300('0xa5'),'where':{'fax':_0xf6b4ea},'limit':0x1,'order':[[_0xd300('0x9b'),_0xd300('0xa6')]]}]}]})[_0xd300('0x23')](handleEntityNotFound(_0x4fd6ee,null))[_0xd300('0x23')](function(_0x317ee4){_0x32ff82=_0x317ee4;if(_0x11087a[_0xd300('0x5d')][_0xd300('0xa7')]&&_0x11087a[_0xd300('0x5d')]['attachments']['length']){for(var _0x37280c=0x0;_0x37280c<_0x11087a[_0xd300('0x5d')]['attachments']['length'];_0x37280c+=0x1){_0x11087a[_0xd300('0x5d')][_0xd300('0xa7')][_0x37280c]={'filename':_0x11087a[_0xd300('0x5d')]['attachments'][_0x37280c]['name'],'id':_0x11087a[_0xd300('0x5d')][_0xd300('0xa7')][_0x37280c]['id'],'path':path[_0xd300('0xa8')](config[_0xd300('0xa9')],_0xd300('0xaa'),_0x11087a[_0xd300('0x5d')][_0xd300('0xa7')][_0x37280c][_0xd300('0xab')])};}}return respondWithRpcPromise(_0xd300('0xac'),_0xd300('0xac'),{'FaxAccountId':_[_0xd300('0xad')](_0x11087a[_0xd300('0x5a')]['id'])?undefined:_0x11087a[_0xd300('0x5a')]['id'],'path':_[_0xd300('0xad')](_0x11087a['body'][_0xd300('0xa7')][0x0][_0xd300('0x9')])?undefined:_0x11087a[_0xd300('0x5d')]['attachments'][0x0][_0xd300('0x9')],'fax':_[_0xd300('0xad')](_0x11087a['body']['to'][0x0])?undefined:_0x11087a[_0xd300('0x5d')]['to'][0x0]},client9002);})[_0xd300('0x23')](function(){if(_0x32ff82){if(_[_0xd300('0xad')](_0x11087a[_0xd300('0x5d')][_0xd300('0xae')])){_0x11087a['body'][_0xd300('0xae')]=util[_0xd300('0xa1')](_0xd300('0xaf'),_0x32ff82[_0xd300('0x40')],_0x32ff82[_0xd300('0xb0')]);}if(_0x32ff82[_0xd300('0xa4')]){if(_0x32ff82[_0xd300('0xa4')][_0xd300('0xa5')]['length']){return _0x32ff82[_0xd300('0xa4')][_0xd300('0xa5')][0x0];}else{return db[_0xd300('0xb1')][_0xd300('0x5c')](_[_0xd300('0xb2')](_0x11087a[_0xd300('0x5d')],{'firstName':_0x11087a[_0xd300('0x5d')]['to'][0x0],'phone':_0x11087a[_0xd300('0x5d')]['to'][0x0],'fax':_0x11087a['body']['to'][0x0],'ListId':_0x32ff82['ListId']}));}}else{throw new Error(_0xd300('0xb3'));}}else{throw new Error(_0xd300('0xb4'));}})['then'](function(_0x5691a2){if(_0x5691a2){return db['FaxInteraction'][_0xd300('0x61')]({'where':{'ContactId':_0x5691a2['id'],'closed':![],'FaxAccountId':_0x32ff82['id']}})[_0xd300('0x23')](function(_0x154ada){if(_0x154ada){return[_0x154ada,![]];}return db[_0xd300('0x77')][_0xd300('0x5c')]({'UserId':_0x11087a['user']['id'],'ContactId':_0x5691a2['id'],'FaxAccountId':_0x32ff82['id'],'fax':_0x11087a[_0xd300('0x5d')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xd300('0x54')](_0x11087a['body'],{'read':![],'body':_0x11087a[_0xd300('0x5d')][_0xd300('0xa7')][0x0][_0xd300('0xb5')],'FaxAccountId':_0x32ff82['id'],'UserId':_0x11087a[_0xd300('0x5e')]['id'],'ContactId':_0x5691a2['id'],'AttachmentId':_0x11087a[_0xd300('0x5d')][_0xd300('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0xd300('0x9e')],'as':_0xd300('0xb6')}]})['then'](function(_0x2f8191){return[_0x2f8191,!![]];});});}else{throw new Error(_0xd300('0xb7'));}})[_0xd300('0xb8')](function(_0x49475c,_0x1e0d9b){if(_0x1e0d9b){return _0x49475c;}return db[_0xd300('0x9e')][_0xd300('0x5c')]({'direction':_0xd300('0xb9'),'read':![],'body':_0x11087a[_0xd300('0x5d')]['attachments'][0x0]['filename'],'FaxAccountId':_0x32ff82['id'],'FaxInteractionId':_0x49475c['id'],'UserId':_0x11087a[_0xd300('0x5e')]['id'],'ContactId':_0x49475c[_0xd300('0xba')],'AttachmentId':_0x11087a[_0xd300('0x5d')]['attachments'][0x0]['id']})[_0xd300('0x23')](function(_0x20e08b){_0x49475c[_0xd300('0xbb')][_0xd300('0xb6')]=[];_0x49475c['dataValues'][_0xd300('0xb6')][_0xd300('0x8a')](_0x20e08b[_0xd300('0xbb')]);return _0x49475c;});})[_0xd300('0x23')](function(_0x36b89e){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xd300('0xad')](_0x11087a[_0xd300('0x5a')]['id'])?undefined:_0x11087a[_0xd300('0x5a')]['id'],'path':_[_0xd300('0xad')](_0x11087a[_0xd300('0x5d')][_0xd300('0xa7')][0x0][_0xd300('0x9')])?undefined:_0x11087a[_0xd300('0x5d')][_0xd300('0xa7')][0x0]['path'],'fax':_[_0xd300('0xad')](_0x11087a[_0xd300('0x5d')]['to'][0x0])?undefined:_0x11087a['body']['to'][0x0],'AttachmentId':_0x11087a[_0xd300('0x5d')]['attachments'][0x0]['id']},client9002)['then'](function(_0x58acf3){logger[_0xd300('0x24')](_0xd300('0xbc'),_0x58acf3);})['catch'](function(_0x943e87){logger[_0xd300('0x24')](_0xd300('0xbc'),_0x943e87);});return _0x36b89e;})[_0xd300('0x23')](respondWithResult(_0x4fd6ee,null))[_0xd300('0x2d')](handleError(_0x4fd6ee,null));};exports[_0xd300('0xbd')]=function(_0x2a91c7,_0xa07a77,_0x442b2c){return db[_0xd300('0x45')][_0xd300('0x61')]({'where':{'id':_0x2a91c7[_0xd300('0x5a')]['id']}})[_0xd300('0x23')](handleEntityNotFound(_0xa07a77,null))[_0xd300('0x23')](function(_0x365e50){if(_0x365e50){return _0x365e50[_0xd300('0xbd')](_0x2a91c7[_0xd300('0x5d')][_0xd300('0x6f')],_[_0xd300('0x76')](_0x2a91c7[_0xd300('0x5d')],[_0xd300('0x6f'),'id'])||{})[_0xd300('0xb8')](function(_0x476647){for(var _0x21e6f7=0x0;_0x21e6f7<_0x2a91c7[_0xd300('0x5d')][_0xd300('0x6f')][_0xd300('0x4f')];_0x21e6f7+=0x1){socket[_0xd300('0xbe')](_0xd300('0xbf'),{'UserId':Number(_0x2a91c7['body'][_0xd300('0x6f')][_0x21e6f7]),'FaxAccountId':Number(_0x2a91c7[_0xd300('0x5a')]['id'])});}return _0x476647;});}})[_0xd300('0x23')](respondWithResult(_0xa07a77,null))[_0xd300('0x2d')](handleError(_0xa07a77,null));};exports[_0xd300('0xc0')]=function(_0x3d773c,_0x2f30a4,_0x5abd58){return db[_0xd300('0x45')]['find']({'where':{'id':_0x3d773c[_0xd300('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2f30a4,null))[_0xd300('0x23')](function(_0x169b3f){if(_0x169b3f){return _0x169b3f[_0xd300('0xc0')](_0x3d773c[_0xd300('0x4a')][_0xd300('0x6f')])['then'](function(){if(_[_0xd300('0xc1')](_0x3d773c[_0xd300('0x4a')][_0xd300('0x6f')])){for(var _0x154e18=0x0;_0x154e18<_0x3d773c['query'][_0xd300('0x6f')][_0xd300('0x4f')];_0x154e18+=0x1){socket[_0xd300('0xbe')](_0xd300('0xc2'),{'UserId':Number(_0x3d773c[_0xd300('0x4a')][_0xd300('0x6f')][_0x154e18]),'FaxAccountId':Number(_0x3d773c[_0xd300('0x5a')]['id'])});}}else{socket[_0xd300('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x3d773c['query'][_0xd300('0x6f')]),'FaxAccountId':Number(_0x3d773c[_0xd300('0x5a')]['id'])});}});}})[_0xd300('0x23')](respondWithStatusCode(_0x2f30a4,null))[_0xd300('0x2d')](handleError(_0x2f30a4,null));};exports[_0xd300('0xc3')]=function(_0x3c9dfc,_0x21b204,_0x53767e){var _0x5d1bc1={};var _0x2e95cb={};var _0x38d71b;var _0x5d0311;return db[_0xd300('0x45')][_0xd300('0x69')]({'where':{'id':_0x3c9dfc[_0xd300('0x5a')]['id']}})['then'](handleEntityNotFound(_0x21b204,null))[_0xd300('0x23')](function(_0x2d718f){if(_0x2d718f){_0x38d71b=_0x2d718f;_0x2e95cb['model']=_[_0xd300('0x5b')](db[_0xd300('0x79')][_0xd300('0x46')]);_0x2e95cb[_0xd300('0x4a')]=_[_0xd300('0x5b')](_0x3c9dfc[_0xd300('0x4a')]);_0x2e95cb[_0xd300('0x53')]=_[_0xd300('0x4d')](_0x2e95cb[_0xd300('0x4b')],_0x2e95cb[_0xd300('0x4a')]);_0x5d1bc1['attributes']=_['intersection'](_0x2e95cb['model'],qs[_0xd300('0x4e')](_0x3c9dfc[_0xd300('0x4a')]['fields']));_0x5d1bc1['attributes']=_0x5d1bc1[_0xd300('0x4c')]['length']?_0x5d1bc1[_0xd300('0x4c')]:_0x2e95cb[_0xd300('0x4b')];_0x5d1bc1[_0xd300('0x50')]=qs[_0xd300('0x51')](_0x3c9dfc[_0xd300('0x4a')][_0xd300('0x51')]);_0x5d1bc1[_0xd300('0x52')]=qs[_0xd300('0x53')](_[_0xd300('0x6b')](_0x3c9dfc[_0xd300('0x4a')],_0x2e95cb[_0xd300('0x53')]));if(_0x3c9dfc[_0xd300('0x4a')]['filter']){_0x5d1bc1[_0xd300('0x52')]=_[_0xd300('0x54')](_0x5d1bc1['where'],{'$or':_[_0xd300('0x55')](_0x5d1bc1['attributes'],function(_0x379dd4){var _0x5ac373={};_0x5ac373[_0x379dd4]={'$like':'%'+_0x3c9dfc[_0xd300('0x4a')][_0xd300('0x6c')]+'%'};return _0x5ac373;})});}_0x5d1bc1=_['merge']({},_0x5d1bc1,_0x3c9dfc[_0xd300('0x56')]);return _0x38d71b[_0xd300('0xc3')](_0x5d1bc1);}})[_0xd300('0x23')](function(_0x16db2b){if(_0x16db2b){_0x5d0311=_0x16db2b['length'];if(!_0x3c9dfc[_0xd300('0x4a')]['hasOwnProperty'](_0xd300('0x73'))){_0x5d1bc1[_0xd300('0x33')]=qs[_0xd300('0x33')](_0x3c9dfc[_0xd300('0x4a')][_0xd300('0x33')]);_0x5d1bc1['offset']=qs[_0xd300('0x31')](_0x3c9dfc[_0xd300('0x4a')]['offset']);}return _0x38d71b['getAgents'](_0x5d1bc1);}})['then'](function(_0x488998){if(_0x488998){return _0x488998?{'count':_0x5d0311,'rows':_0x488998}:null;}})[_0xd300('0x23')](respondWithResult(_0x21b204,null))['catch'](handleError(_0x21b204,null));};
\ No newline at end of file
index af46fa2..8f15a87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7101=['emit','../../mysqldb','FaxAccount','setMaxListeners','update','remove'];(function(_0x11fb71,_0x87c46d){var _0x2a4c23=function(_0x44bcfb){while(--_0x44bcfb){_0x11fb71['push'](_0x11fb71['shift']());}};_0x2a4c23(++_0x87c46d);}(_0x7101,0xdf));var _0x1710=function(_0x5e3f0f,_0x16c6c7){_0x5e3f0f=_0x5e3f0f-0x0;var _0xbd8d66=_0x7101[_0x5e3f0f];return _0xbd8d66;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x1710('0x0'))['db'][_0x1710('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1710('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1710('0x3'),'afterDestroy':_0x1710('0x4')};function emitEvent(_0xb9d399){return function(_0x7fcc3f,_0x23395a,_0x25df1b){FaxAccountEvents['emit'](_0xb9d399+':'+_0x7fcc3f['id'],_0x7fcc3f);FaxAccountEvents[_0x1710('0x5')](_0xb9d399,_0x7fcc3f);_0x25df1b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0x333a=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x333a,0xe0));var _0xa333=function(_0x1a80e8,_0x3bb766){_0x1a80e8=_0x1a80e8-0x0;var _0x563d21=_0x333a[_0x1a80e8];return _0x563d21;};'use strict';var EventEmitter=require(_0xa333('0x0'));var FaxAccount=require(_0xa333('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa333('0x2')](0x0);var events={'afterCreate':_0xa333('0x3'),'afterUpdate':_0xa333('0x4'),'afterDestroy':_0xa333('0x5')};function emitEvent(_0x59ca82){return function(_0x3d7ad1,_0x1d0c16,_0x476ac4){FaxAccountEvents[_0xa333('0x6')](_0x59ca82+':'+_0x3d7ad1['id'],_0x3d7ad1);FaxAccountEvents[_0xa333('0x6')](_0x59ca82,_0x3d7ad1);_0x476ac4(null);};}for(var e in events){if(events[_0xa333('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xa333('0x8')]=FaxAccountEvents;
\ No newline at end of file
index 3ec47b1..0e924b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ab=['./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0x17ab,0x13c));var _0xb17a=function(_0x2e2c05,_0x30ba57){_0x2e2c05=_0x2e2c05-0x0;var _0x1ee5d8=_0x17ab[_0x2e2c05];return _0x1ee5d8;};'use strict';var _=require(_0xb17a('0x0'));var util=require(_0xb17a('0x1'));var logger=require(_0xb17a('0x2'))(_0xb17a('0x3'));var moment=require(_0xb17a('0x4'));var BPromise=require(_0xb17a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb17a('0x6'));var rimraf=require(_0xb17a('0x7'));var config=require(_0xb17a('0x8'));var attributes=require(_0xb17a('0x9'));module[_0xb17a('0xa')]=function(_0x3508e4,_0x407e66){return _0x3508e4[_0xb17a('0xb')]('FaxAccount',attributes,{'tableName':_0xb17a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55c0=['../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','moment','bluebird','path'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x55c0,0x131));var _0x055c=function(_0x2a07c9,_0x185c10){_0x2a07c9=_0x2a07c9-0x0;var _0x4e5723=_0x55c0[_0x2a07c9];return _0x4e5723;};'use strict';var _=require(_0x055c('0x0'));var util=require('util');var logger=require(_0x055c('0x1'))('api');var moment=require(_0x055c('0x2'));var BPromise=require(_0x055c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x055c('0x4'));var rimraf=require('rimraf');var config=require(_0x055c('0x5'));var attributes=require('./faxAccount.attributes');module[_0x055c('0x6')]=function(_0xc09765,_0x2c47b4){return _0xc09765[_0x055c('0x7')](_0x055c('0x8'),attributes,{'tableName':_0x055c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8f6114b..b878dd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0977=['Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','orderBy','asc','create','FaxInteraction','spread','push','length','unmanaged','*,*,*,*','created','interaction','UserId','User','unshift','agent','startRouting','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','FaxAccount','findAll','options','where','attributes','limit','include','map','model','GetFaxAccount','body','fax','CmContact','describe','ValidationError','difference','keys','createdAt','updatedAt','ListId','isNil','from'];(function(_0x3ec613,_0x189b5d){var _0x36806c=function(_0x2be152){while(--_0x2be152){_0x3ec613['push'](_0x3ec613['shift']());}};_0x36806c(++_0x189b5d);}(_0x0977,0x1cb));var _0x7097=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0977[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x7097('0x0'));var moment=require(_0x7097('0x1'));var BPromise=require(_0x7097('0x2'));var rs=require(_0x7097('0x3'));var fs=require('fs');var Redis=require(_0x7097('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7097('0x5'))(_0x7097('0x6'));var config=require('../../config/environment');var jayson=require(_0x7097('0x7'));var client=jayson[_0x7097('0x8')][_0x7097('0x9')]({'port':0x232c});config[_0x7097('0xa')]=_[_0x7097('0xb')](config[_0x7097('0xa')],{'host':_0x7097('0xc'),'port':0x18eb});var socket=require(_0x7097('0xd'))(new Redis(config[_0x7097('0xa')]));require(_0x7097('0xe'))[_0x7097('0xf')](socket);function respondWithRpcPromise(_0x1d6691,_0xaf4706,_0x222893){return new BPromise(function(_0x302d33,_0x13f061){return client[_0x7097('0x10')](_0x1d6691,_0x222893)[_0x7097('0x11')](function(_0x36c2fa){logger[_0x7097('0x12')]('FaxAccount,\x20%s,\x20%s',_0xaf4706,_0x7097('0x13'));logger[_0x7097('0x14')](_0x7097('0x15'),_0xaf4706,_0x7097('0x13'),JSON[_0x7097('0x16')](_0x36c2fa));if(_0x36c2fa[_0x7097('0x17')]){if(_0x36c2fa[_0x7097('0x17')][_0x7097('0x18')]===0x1f4){logger[_0x7097('0x17')](_0x7097('0x19'),_0xaf4706,_0x36c2fa[_0x7097('0x17')][_0x7097('0x1a')]);return _0x13f061(_0x36c2fa[_0x7097('0x17')][_0x7097('0x1a')]);}logger[_0x7097('0x17')]('FaxAccount,\x20%s,\x20%s',_0xaf4706,_0x36c2fa[_0x7097('0x17')][_0x7097('0x1a')]);return _0x302d33(_0x36c2fa[_0x7097('0x17')][_0x7097('0x1a')]);}else{logger[_0x7097('0x12')]('FaxAccount,\x20%s,\x20%s',_0xaf4706,'request\x20sent');_0x302d33(_0x36c2fa[_0x7097('0x1b')][_0x7097('0x1a')]);}})[_0x7097('0x1c')](function(_0x51f29d){logger[_0x7097('0x17')]('FaxAccount,\x20%s,\x20%s',_0xaf4706,_0x51f29d);_0x13f061(_0x51f29d);});});}exports['GetFaxAccount']=function(_0x39cc9d){var _0x562ecc=this;return new Promise(function(_0x1d5756,_0x38e0ea){return db[_0x7097('0x1d')][_0x7097('0x1e')]({'raw':_0x39cc9d[_0x7097('0x1f')]?_0x39cc9d['options']['raw']===undefined?!![]:![]:!![],'where':_0x39cc9d[_0x7097('0x1f')]?_0x39cc9d[_0x7097('0x1f')][_0x7097('0x20')]||null:null,'attributes':_0x39cc9d[_0x7097('0x1f')]?_0x39cc9d[_0x7097('0x1f')][_0x7097('0x21')]||null:null,'limit':_0x39cc9d[_0x7097('0x1f')]?_0x39cc9d[_0x7097('0x1f')][_0x7097('0x22')]||null:null,'include':_0x39cc9d[_0x7097('0x1f')]?_0x39cc9d['options'][_0x7097('0x23')]?_[_0x7097('0x24')](_0x39cc9d['options'][_0x7097('0x23')],function(_0x163a62){return{'model':db[_0x163a62[_0x7097('0x25')]],'as':_0x163a62['as'],'attributes':_0x163a62[_0x7097('0x21')],'include':_0x163a62[_0x7097('0x23')]?_[_0x7097('0x24')](_0x163a62['include'],function(_0x4f184a){return{'model':db[_0x4f184a[_0x7097('0x25')]],'as':_0x4f184a['as'],'attributes':_0x4f184a[_0x7097('0x21')],'include':_0x4f184a[_0x7097('0x23')]?_[_0x7097('0x24')](_0x4f184a[_0x7097('0x23')],function(_0x5b4e27){return{'model':db[_0x5b4e27['model']],'as':_0x5b4e27['as'],'attributes':_0x5b4e27[_0x7097('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7097('0x11')](function(_0x4af5f7){logger[_0x7097('0x12')](_0x7097('0x26'),_0x39cc9d);logger['debug'](_0x7097('0x26'),_0x39cc9d,JSON[_0x7097('0x16')](_0x4af5f7));_0x1d5756(_0x4af5f7);})[_0x7097('0x1c')](function(_0x570a5f){logger['error'](_0x7097('0x26'),_0x570a5f[_0x7097('0x1a')],_0x39cc9d);_0x38e0ea(_0x562ecc[_0x7097('0x17')](0x1f4,_0x570a5f['message']));});});};exports['NotifyFaxAccount']=function(_0x146d0f,_0x4d19fc,_0x9d3e46){var _0x272983=this;return new Promise(function(_0x4aa5ec,_0x24f36a){var _0xf97a1e={'body':_0x146d0f[_0x7097('0x27')],'channel':_0x7097('0x28')};var _0x2c116e=[];var _0x4579eb=[];var _0x1b903b={};return db[_0x7097('0x29')][_0x7097('0x2a')]()['then'](function(_0xa2c70a){if(!_0xa2c70a){throw new db['Sequelize'][(_0x7097('0x2b'))]('no\x20available\x20attributes');}_0x2c116e=_[_0x7097('0x2c')](_[_0x7097('0x2d')](_0xa2c70a),[_0x7097('0x2e'),_0x7097('0x2f')]);_0x4579eb=_['difference'](_['keys'](_0xa2c70a),[_0x7097('0x2e'),_0x7097('0x2f'),'CompanyId',_0x7097('0x30')]);if(_0x146d0f['body']['id']){delete _0x146d0f[_0x7097('0x27')]['id'];}if(_[_0x7097('0x31')](_0x146d0f[_0x7097('0x27')][_0x7097('0x32')])){throw new db[(_0x7097('0x33'))][(_0x7097('0x2b'))](_0x7097('0x34'));}if(_[_0x7097('0x31')](_0x146d0f[_0x7097('0x27')][_0x7097('0x27')])||_0x146d0f[_0x7097('0x27')][_0x7097('0x27')]===''){throw new db['Sequelize'][(_0x7097('0x2b'))](_0x7097('0x35'));}if(_[_0x7097('0x31')](_0x146d0f['body'][_0x7097('0x36')])){throw new db[(_0x7097('0x33'))]['ValidationError'](_0x7097('0x37')+_0x4579eb);}if(!_[_0x7097('0x38')](_0x4579eb,_0x146d0f[_0x7097('0x27')][_0x7097('0x36')])){throw new db[(_0x7097('0x33'))][(_0x7097('0x2b'))](_0x7097('0x39')+_0x4579eb);}_0x1b903b[_0x146d0f[_0x7097('0x27')]['mapKey']]=_0x146d0f['body'][_0x7097('0x32')];})['then'](function(){return db[_0x7097('0x1d')][_0x7097('0x3a')]({'where':{'id':_0x146d0f[_0x7097('0x3b')]['id']},'include':[{'model':db[_0x7097('0x3c')],'as':'List','include':[{'model':db[_0x7097('0x29')],'as':_0x7097('0x3d'),'where':_0x1b903b,'limit':0x1,'order':[['updatedAt',_0x7097('0x3e')]]}]},{'model':db[_0x7097('0x3f')],'as':_0x7097('0x40')}]});})[_0x7097('0x11')](function(_0x13fa39){if(_0x13fa39&&_0x13fa39[_0x7097('0x41')]){var _0x2a4a7a=_0x13fa39[_0x7097('0x42')]({'plain':!![]});_0xf97a1e[_0x7097('0x3b')]=_0x2a4a7a;_0xf97a1e[_0x7097('0x43')]=_0x2a4a7a[_0x7097('0x40')];_0xf97a1e[_0x7097('0x44')]=_0x2a4a7a[_0x7097('0x41')];_0xf97a1e['applications']=_[_0x7097('0x45')](_0xf97a1e[_0x7097('0x43')],['priority'],[_0x7097('0x46')]);if(_0xf97a1e[_0x7097('0x3b')][_0x7097('0x40')]){delete _0xf97a1e[_0x7097('0x3b')]['Applications'];}if(_0xf97a1e[_0x7097('0x3b')][_0x7097('0x41')]&&_0xf97a1e[_0x7097('0x3b')]['List']['Contacts']['length']){return _0xf97a1e['account'][_0x7097('0x41')][_0x7097('0x3d')][0x0];}var _0x336c80=_['defaults'](_0x146d0f[_0x7097('0x27')],{'firstName':_0x146d0f[_0x7097('0x27')][_0x7097('0x32')],'ListId':_0x2a4a7a[_0x7097('0x30')]});_0x336c80[_0x146d0f['body'][_0x7097('0x36')]]=_0x146d0f[_0x7097('0x27')][_0x7097('0x32')];return db[_0x7097('0x29')][_0x7097('0x47')](_0x336c80,{'fields':_0x2c116e,'raw':!![]});}})[_0x7097('0x11')](function(_0x3c2431){_0xf97a1e['contact']=_0x3c2431;if(_0x3c2431){var _0x43782e={'ContactId':_0x3c2431['id'],'FaxAccountId':_0x146d0f[_0x7097('0x3b')]['id'],'fax':_0x3c2431[_0x7097('0x28')]};return db[_0x7097('0x48')][_0x7097('0x3a')]({'where':{'ContactId':_0x3c2431['id'],'closed':![],'FaxAccountId':_0x146d0f[_0x7097('0x3b')]['id']}})[_0x7097('0x11')](function(_0x1b38e0){if(_0x1b38e0){return[_0x1b38e0,![]];}return db[_0x7097('0x48')][_0x7097('0x47')](_0x43782e)[_0x7097('0x11')](function(_0xa9b511){return[_0xa9b511,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7097('0x49')](function(_0x9fbec2,_0x417de8){var _0x4be0a8=_0x9fbec2[_0x7097('0x42')]({'plain':!![]});if(_0x417de8){if(_0xf97a1e[_0x7097('0x3b')]['autoclose']){_0xf97a1e['applications'][_0x7097('0x4a')]({'id':0x0,'priority':_0xf97a1e[_0x7097('0x43')][_0x7097('0x4b')]+0x1,'app':'close','appdata':_0x7097('0x4c'),'interval':_0x7097('0x4d')});}_0x4be0a8['created']=!![];}else{_0x4be0a8[_0x7097('0x4e')]=![];}_0xf97a1e[_0x7097('0x4f')]=_0x4be0a8;return db['FaxMessage'][_0x7097('0x47')]({'body':_0x146d0f[_0x7097('0x27')][_0x7097('0x27')],'FaxAccountId':_0x146d0f['account']['id'],'FaxInteractionId':_0x9fbec2['id'],'direction':'in','ContactId':_0x9fbec2['ContactId'],'AttachmentId':_0x146d0f[_0x7097('0x27')]['AttachmentId']});})[_0x7097('0x11')](function(_0xb9baec){_0xf97a1e[_0x7097('0x1a')]=_0xb9baec;if(_0xf97a1e[_0x7097('0x4f')][_0x7097('0x50')]){return db[_0x7097('0x51')]['find']({'attributes':['id','name'],'where':{'id':_0xf97a1e[_0x7097('0x4f')][_0x7097('0x50')]}})['then'](function(_0x53ace6){if(_0x53ace6){_0xf97a1e['applications'][_0x7097('0x52')]({'id':0x0,'priority':0x0,'app':_0x7097('0x53'),'appdata':_0x53ace6['name']+','+(_0xf97a1e[_0x7097('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':_0x7097('0x4d')});}return respondWithRpcPromise('Start',_0x7097('0x54'),_0xf97a1e);});}return respondWithRpcPromise('Start','startRouting',_0xf97a1e);})[_0x7097('0x11')](function(_0x7889e5){_0x4aa5ec(_0x7889e5);})['catch'](function(_0x319a75){_0x24f36a(_0x272983[_0x7097('0x17')](0x1f4,_0x319a75[_0x7097('0x1a')]));});});};
\ No newline at end of file
+var _0x70c9=['ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','FaxAccount','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','asc','length','create','fax','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','defaults','redis','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','where','limit','include','model','attributes','NotifyFaxAccount','body','CmContact','describe','Sequelize'];(function(_0x51639a,_0x35f006){var _0x3abae4=function(_0x89b35e){while(--_0x89b35e){_0x51639a['push'](_0x51639a['shift']());}};_0x3abae4(++_0x35f006);}(_0x70c9,0x190));var _0x970c=function(_0x2e1593,_0x59e9b7){_0x2e1593=_0x2e1593-0x0;var _0x71d483=_0x70c9[_0x2e1593];return _0x71d483;};'use strict';var _=require(_0x970c('0x0'));var util=require(_0x970c('0x1'));var moment=require(_0x970c('0x2'));var BPromise=require(_0x970c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x970c('0x4'));var db=require(_0x970c('0x5'))['db'];var utils=require(_0x970c('0x6'));var logger=require(_0x970c('0x7'))(_0x970c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x970c('0x9')]({'port':0x232c});config['redis']=_[_0x970c('0xa')](config[_0x970c('0xb')],{'host':_0x970c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x970c('0xb')]));require(_0x970c('0xd'))[_0x970c('0xe')](socket);function respondWithRpcPromise(_0x5cacf0,_0x2738fe,_0x34cb61){return new BPromise(function(_0x243293,_0x3040aa){return client[_0x970c('0xf')](_0x5cacf0,_0x34cb61)[_0x970c('0x10')](function(_0x22dc85){logger[_0x970c('0x11')](_0x970c('0x12'),_0x2738fe,_0x970c('0x13'));logger['debug'](_0x970c('0x14'),_0x2738fe,_0x970c('0x13'),JSON[_0x970c('0x15')](_0x22dc85));if(_0x22dc85['error']){if(_0x22dc85[_0x970c('0x16')][_0x970c('0x17')]===0x1f4){logger[_0x970c('0x16')](_0x970c('0x12'),_0x2738fe,_0x22dc85['error'][_0x970c('0x18')]);return _0x3040aa(_0x22dc85[_0x970c('0x16')]['message']);}logger[_0x970c('0x16')](_0x970c('0x12'),_0x2738fe,_0x22dc85['error']['message']);return _0x243293(_0x22dc85[_0x970c('0x16')][_0x970c('0x18')]);}else{logger[_0x970c('0x11')](_0x970c('0x12'),_0x2738fe,_0x970c('0x13'));_0x243293(_0x22dc85[_0x970c('0x19')][_0x970c('0x18')]);}})[_0x970c('0x1a')](function(_0x55e8f8){logger['error'](_0x970c('0x12'),_0x2738fe,_0x55e8f8);_0x3040aa(_0x55e8f8);});});}exports[_0x970c('0x1b')]=function(_0x1ef0dc){var _0x3d7af2=this;return new Promise(function(_0x5172cd,_0x5922c6){return db['FaxAccount'][_0x970c('0x1c')]({'raw':_0x1ef0dc['options']?_0x1ef0dc[_0x970c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1ef0dc[_0x970c('0x1d')]?_0x1ef0dc[_0x970c('0x1d')][_0x970c('0x1e')]||null:null,'attributes':_0x1ef0dc['options']?_0x1ef0dc[_0x970c('0x1d')]['attributes']||null:null,'limit':_0x1ef0dc[_0x970c('0x1d')]?_0x1ef0dc[_0x970c('0x1d')][_0x970c('0x1f')]||null:null,'include':_0x1ef0dc['options']?_0x1ef0dc[_0x970c('0x1d')]['include']?_['map'](_0x1ef0dc['options'][_0x970c('0x20')],function(_0x1c58bb){return{'model':db[_0x1c58bb[_0x970c('0x21')]],'as':_0x1c58bb['as'],'attributes':_0x1c58bb['attributes'],'include':_0x1c58bb[_0x970c('0x20')]?_['map'](_0x1c58bb[_0x970c('0x20')],function(_0x3000ff){return{'model':db[_0x3000ff[_0x970c('0x21')]],'as':_0x3000ff['as'],'attributes':_0x3000ff[_0x970c('0x22')],'include':_0x3000ff[_0x970c('0x20')]?_['map'](_0x3000ff[_0x970c('0x20')],function(_0x2edad5){return{'model':db[_0x2edad5['model']],'as':_0x2edad5['as'],'attributes':_0x2edad5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x348282){logger['info'](_0x970c('0x1b'),_0x1ef0dc);logger['debug'](_0x970c('0x1b'),_0x1ef0dc,JSON['stringify'](_0x348282));_0x5172cd(_0x348282);})['catch'](function(_0x352bec){logger[_0x970c('0x16')]('GetFaxAccount',_0x352bec[_0x970c('0x18')],_0x1ef0dc);_0x5922c6(_0x3d7af2[_0x970c('0x16')](0x1f4,_0x352bec[_0x970c('0x18')]));});});};exports[_0x970c('0x23')]=function(_0x4d12c7,_0x1e16ac,_0x409c72){var _0x2849a9=this;return new Promise(function(_0x313a79,_0x323b86){var _0x1f6975={'body':_0x4d12c7[_0x970c('0x24')],'channel':'fax'};var _0x19455e=[];var _0x164324=[];var _0x2b0017={};return db[_0x970c('0x25')][_0x970c('0x26')]()['then'](function(_0x22338c){if(!_0x22338c){throw new db[(_0x970c('0x27'))][(_0x970c('0x28'))](_0x970c('0x29'));}_0x19455e=_[_0x970c('0x2a')](_[_0x970c('0x2b')](_0x22338c),[_0x970c('0x2c'),_0x970c('0x2d')]);_0x164324=_[_0x970c('0x2a')](_[_0x970c('0x2b')](_0x22338c),[_0x970c('0x2c'),'updatedAt',_0x970c('0x2e'),_0x970c('0x2f')]);if(_0x4d12c7[_0x970c('0x24')]['id']){delete _0x4d12c7[_0x970c('0x24')]['id'];}if(_[_0x970c('0x30')](_0x4d12c7[_0x970c('0x24')]['from'])){throw new db['Sequelize'][(_0x970c('0x28'))](_0x970c('0x31'));}if(_[_0x970c('0x30')](_0x4d12c7[_0x970c('0x24')]['body'])||_0x4d12c7[_0x970c('0x24')][_0x970c('0x24')]===''){throw new db[(_0x970c('0x27'))][(_0x970c('0x28'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x970c('0x30')](_0x4d12c7['body']['mapKey'])){throw new db['Sequelize'][(_0x970c('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x164324);}if(!_[_0x970c('0x32')](_0x164324,_0x4d12c7['body']['mapKey'])){throw new db[(_0x970c('0x27'))][(_0x970c('0x28'))](_0x970c('0x33')+_0x164324);}_0x2b0017[_0x4d12c7[_0x970c('0x24')][_0x970c('0x34')]]=_0x4d12c7[_0x970c('0x24')][_0x970c('0x35')];})[_0x970c('0x10')](function(){return db[_0x970c('0x36')][_0x970c('0x37')]({'where':{'id':_0x4d12c7[_0x970c('0x38')]['id']},'include':[{'model':db[_0x970c('0x39')],'as':'List','include':[{'model':db[_0x970c('0x25')],'as':_0x970c('0x3a'),'where':_0x2b0017,'limit':0x1,'order':[['updatedAt',_0x970c('0x3b')]]}]},{'model':db[_0x970c('0x3c')],'as':_0x970c('0x3d')}]});})[_0x970c('0x10')](function(_0x4f5728){if(_0x4f5728&&_0x4f5728[_0x970c('0x3e')]){var _0x3cd199=_0x4f5728[_0x970c('0x3f')]({'plain':!![]});_0x1f6975[_0x970c('0x38')]=_0x3cd199;_0x1f6975[_0x970c('0x40')]=_0x3cd199['Applications'];_0x1f6975[_0x970c('0x41')]=_0x3cd199[_0x970c('0x3e')];_0x1f6975['applications']=_['orderBy'](_0x1f6975[_0x970c('0x40')],['priority'],[_0x970c('0x42')]);if(_0x1f6975[_0x970c('0x38')]['Applications']){delete _0x1f6975[_0x970c('0x38')][_0x970c('0x3d')];}if(_0x1f6975['account'][_0x970c('0x3e')]&&_0x1f6975[_0x970c('0x38')][_0x970c('0x3e')][_0x970c('0x3a')][_0x970c('0x43')]){return _0x1f6975[_0x970c('0x38')][_0x970c('0x3e')]['Contacts'][0x0];}var _0x54efdf=_[_0x970c('0xa')](_0x4d12c7[_0x970c('0x24')],{'firstName':_0x4d12c7['body'][_0x970c('0x35')],'ListId':_0x3cd199[_0x970c('0x2f')]});_0x54efdf[_0x4d12c7[_0x970c('0x24')][_0x970c('0x34')]]=_0x4d12c7[_0x970c('0x24')][_0x970c('0x35')];return db['CmContact'][_0x970c('0x44')](_0x54efdf,{'fields':_0x19455e,'raw':!![]});}})['then'](function(_0x24094b){_0x1f6975['contact']=_0x24094b;if(_0x24094b){var _0x55d6d6={'ContactId':_0x24094b['id'],'FaxAccountId':_0x4d12c7[_0x970c('0x38')]['id'],'fax':_0x24094b[_0x970c('0x45')]};return db[_0x970c('0x46')][_0x970c('0x37')]({'where':{'ContactId':_0x24094b['id'],'closed':![],'FaxAccountId':_0x4d12c7[_0x970c('0x38')]['id']}})[_0x970c('0x10')](function(_0x36545d){if(_0x36545d){return[_0x36545d,![]];}return db[_0x970c('0x46')][_0x970c('0x44')](_0x55d6d6)[_0x970c('0x10')](function(_0x41fd59){return[_0x41fd59,!![]];});});}else{throw new Error(_0x970c('0x47'));}})[_0x970c('0x48')](function(_0x46b236,_0x439f8e){var _0x35f66b=_0x46b236[_0x970c('0x3f')]({'plain':!![]});if(_0x439f8e){if(_0x1f6975[_0x970c('0x38')]['autoclose']){_0x1f6975[_0x970c('0x40')][_0x970c('0x49')]({'id':0x0,'priority':_0x1f6975[_0x970c('0x40')][_0x970c('0x43')]+0x1,'app':_0x970c('0x4a'),'appdata':_0x970c('0x4b'),'interval':_0x970c('0x4c')});}_0x35f66b[_0x970c('0x4d')]=!![];}else{_0x35f66b[_0x970c('0x4d')]=![];}_0x1f6975['interaction']=_0x35f66b;return db[_0x970c('0x4e')]['create']({'body':_0x4d12c7[_0x970c('0x24')]['body'],'FaxAccountId':_0x4d12c7[_0x970c('0x38')]['id'],'FaxInteractionId':_0x46b236['id'],'direction':'in','ContactId':_0x46b236[_0x970c('0x4f')],'AttachmentId':_0x4d12c7['body'][_0x970c('0x50')]});})[_0x970c('0x10')](function(_0x1ae8c4){_0x1f6975['message']=_0x1ae8c4;if(_0x1f6975['interaction']['UserId']){return db[_0x970c('0x51')][_0x970c('0x37')]({'attributes':['id','name'],'where':{'id':_0x1f6975['interaction'][_0x970c('0x52')]}})[_0x970c('0x10')](function(_0x357abe){if(_0x357abe){_0x1f6975[_0x970c('0x40')][_0x970c('0x53')]({'id':0x0,'priority':0x0,'app':_0x970c('0x54'),'appdata':_0x357abe['name']+','+(_0x1f6975[_0x970c('0x38')][_0x970c('0x55')]||0xa),'interval':_0x970c('0x4c')});}return respondWithRpcPromise(_0x970c('0x56'),'startRouting',_0x1f6975);});}return respondWithRpcPromise('Start',_0x970c('0x57'),_0x1f6975);})[_0x970c('0x10')](function(_0x3d0385){_0x313a79(_0x3d0385);})['catch'](function(_0x1c26f6){_0x323b86(_0x2849a9['error'](0x1f4,_0x1c26f6['message']));});});};
\ No newline at end of file
index 4084b23..7293f41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd922=['./faxAccount.events','save','emit','removeListener','register','faxAccount:'];(function(_0xcbbbf1,_0x1c3a8b){var _0xc6d711=function(_0x318e28){while(--_0x318e28){_0xcbbbf1['push'](_0xcbbbf1['shift']());}};_0xc6d711(++_0x1c3a8b);}(_0xd922,0x1d4));var _0x2d92=function(_0xe56790,_0x5f304d){_0xe56790=_0xe56790-0x0;var _0x145cf7=_0xd922[_0xe56790];return _0x145cf7;};'use strict';var FaxAccountEvents=require(_0x2d92('0x0'));var events=[_0x2d92('0x1'),'remove','update'];function createListener(_0x110684,_0x5be4ca){return function(_0x12cb98){_0x5be4ca[_0x2d92('0x2')](_0x110684,_0x12cb98);};}function removeListener(_0x114298,_0x40c7fc){return function(){FaxAccountEvents[_0x2d92('0x3')](_0x114298,_0x40c7fc);};}exports[_0x2d92('0x4')]=function(_0x52f84f){for(var _0x5ca004=0x0,_0x411caa=events['length'];_0x5ca004<_0x411caa;_0x5ca004++){var _0x56b52e=events[_0x5ca004];var _0x2e6957=createListener(_0x2d92('0x5')+_0x56b52e,_0x52f84f);FaxAccountEvents['on'](_0x56b52e,_0x2e6957);}};
\ No newline at end of file
+var _0x2853=['update','emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x2853,0xd5));var _0x3285=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x2853[_0x68ee8b];return _0x5148f7;};'use strict';var FaxAccountEvents=require(_0x3285('0x0'));var events=[_0x3285('0x1'),_0x3285('0x2'),_0x3285('0x3')];function createListener(_0x2673fb,_0x3532c8){return function(_0x4d0dac){_0x3532c8[_0x3285('0x4')](_0x2673fb,_0x4d0dac);};}function removeListener(_0x555f51,_0xa8b089){return function(){FaxAccountEvents[_0x3285('0x5')](_0x555f51,_0xa8b089);};}exports[_0x3285('0x6')]=function(_0x10f90c){for(var _0x55ffd9=0x0,_0x432b01=events[_0x3285('0x7')];_0x55ffd9<_0x432b01;_0x55ffd9++){var _0x36ccb9=events[_0x55ffd9];var _0xb27f1e=createListener(_0x3285('0x8')+_0x36ccb9,_0x10f90c);FaxAccountEvents['on'](_0x36ccb9,_0xb27f1e);}};
\ No newline at end of file
index 57d92a5..bca0ca2 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(_0xddf202,_0x1890fa){var _0x1a95da=function(_0x3e9943){while(--_0x3e9943){_0xddf202['push'](_0xddf202['shift']());}};_0x1a95da(++_0x1890fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x30ee45,_0x514bf0){var _0x1a0dbd=function(_0x12b405){while(--_0x12b405){_0x30ee45['push'](_0x30ee45['shift']());}};_0x1a0dbd(++_0x514bf0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 94565ed..1bb52b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09d3=['INTEGER','noop','TEXT','STRING','sequelize','exports'];(function(_0x3eb1d7,_0x1c4d35){var _0x468e2f=function(_0x3da282){while(--_0x3da282){_0x3eb1d7['push'](_0x3eb1d7['shift']());}};_0x468e2f(++_0x1c4d35);}(_0x09d3,0x16c));var _0x309d=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x09d3[_0x295a3d];return _0x23a732;};'use strict';var Sequelize=require(_0x309d('0x0'));module[_0x309d('0x1')]={'priority':{'type':Sequelize[_0x309d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x309d('0x3')},'appdata':{'type':Sequelize[_0x309d('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x309d('0x5')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x713e=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x2b1305,_0x381ddb){var _0x435623=function(_0x52060e){while(--_0x52060e){_0x2b1305['push'](_0x2b1305['shift']());}};_0x435623(++_0x381ddb);}(_0x713e,0x147));var _0xe713=function(_0x50445d,_0x4e568c){_0x50445d=_0x50445d-0x0;var _0x1bfa93=_0x713e[_0x50445d];return _0x1bfa93;};'use strict';var Sequelize=require(_0xe713('0x0'));module[_0xe713('0x1')]={'priority':{'type':Sequelize[_0xe713('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe713('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe713('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe713('0x3')],'defaultValue':_0xe713('0x5')}};
\ No newline at end of file
index 13b0d3a..4e3fe41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7cb=['body','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','VIRTUAL','where','FaxApplication','include','findAll','rows','then','catch','show','params','keys','includeAll','find','create'];(function(_0x51a2aa,_0x1702d6){var _0x219a74=function(_0x504771){while(--_0x504771){_0x51a2aa['push'](_0x51a2aa['shift']());}};_0x219a74(++_0x1702d6);}(_0xa7cb,0x125));var _0xba7c=function(_0x462729,_0x226b5a){_0x462729=_0x462729-0x0;var _0x107767=_0xa7cb[_0x462729];return _0x107767;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xba7c('0x0'));var jsonpatch=require(_0xba7c('0x1'));var rp=require(_0xba7c('0x2'));var moment=require(_0xba7c('0x3'));var BPromise=require(_0xba7c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xba7c('0x5'));var sox=require(_0xba7c('0x6'));var csv=require(_0xba7c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba7c('0x8'));var _=require(_0xba7c('0x9'));var squel=require(_0xba7c('0xa'));var crypto=require(_0xba7c('0xb'));var jsforce=require(_0xba7c('0xc'));var deskjs=require(_0xba7c('0xd'));var toCsv=require(_0xba7c('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xba7c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xba7c('0xf'));var as=require(_0xba7c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba7c('0x11'))(_0xba7c('0x12'));var utils=require(_0xba7c('0x13'));var config=require(_0xba7c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xba7c('0x15'))['db'];function respondWithStatusCode(_0x1c20ca,_0x5d48b6){_0x5d48b6=_0x5d48b6||0xcc;return function(_0xfbc983){if(_0xfbc983){return _0x1c20ca[_0xba7c('0x16')](_0x5d48b6);}return _0x1c20ca['status'](_0x5d48b6)[_0xba7c('0x17')]();};}function respondWithResult(_0x51d52b,_0x46c23c){_0x46c23c=_0x46c23c||0xc8;return function(_0x8a2550){if(_0x8a2550){return _0x51d52b[_0xba7c('0x18')](_0x46c23c)[_0xba7c('0x19')](_0x8a2550);}};}function respondWithFilteredResult(_0x1a82aa,_0x3eaf66){return function(_0x3de1d4){if(_0x3de1d4){var _0x2416de=typeof _0x3eaf66[_0xba7c('0x1a')]===_0xba7c('0x1b')&&typeof _0x3eaf66['limit']===_0xba7c('0x1b');var _0x1a0843=_0x3de1d4['count'];var _0x581f41=_0x2416de?0x0:_0x3eaf66['offset'];var _0x573b5d=_0x2416de?_0x3de1d4[_0xba7c('0x1c')]:_0x3eaf66[_0xba7c('0x1a')]+_0x3eaf66[_0xba7c('0x1d')];var _0x6e0fe4;if(_0x573b5d>=_0x1a0843){_0x573b5d=_0x1a0843;_0x6e0fe4=0xc8;}else{_0x6e0fe4=0xce;}_0x1a82aa[_0xba7c('0x18')](_0x6e0fe4);return _0x1a82aa['set'](_0xba7c('0x1e'),_0x581f41+'-'+_0x573b5d+'/'+_0x1a0843)[_0xba7c('0x19')](_0x3de1d4);}return null;};}function patchUpdates(_0x4d03e3){return function(_0x3374d8){try{jsonpatch[_0xba7c('0x1f')](_0x3374d8,_0x4d03e3,!![]);}catch(_0xae591e){return BPromise[_0xba7c('0x20')](_0xae591e);}return _0x3374d8[_0xba7c('0x21')]();};}function saveUpdates(_0x2b3475,_0x2d7eb6){return function(_0x26a1f8){if(_0x26a1f8){return _0x26a1f8[_0xba7c('0x22')](_0x2b3475)['then'](function(_0xa5c0c8){return _0xa5c0c8;});}return null;};}function removeEntity(_0x31ec3b,_0x443227){return function(_0x4433dd){if(_0x4433dd){return _0x4433dd[_0xba7c('0x23')]()['then'](function(){_0x31ec3b[_0xba7c('0x18')](0xcc)[_0xba7c('0x17')]();});}};}function handleEntityNotFound(_0x3935a3,_0x15e93a){return function(_0x28ad50){if(!_0x28ad50){_0x3935a3[_0xba7c('0x16')](0x194);}return _0x28ad50;};}function handleError(_0x2ccfdf,_0x4c47a3){_0x4c47a3=_0x4c47a3||0x1f4;return function(_0x532f9e){logger[_0xba7c('0x24')](_0x532f9e[_0xba7c('0x25')]);if(_0x532f9e[_0xba7c('0x26')]){delete _0x532f9e[_0xba7c('0x26')];}_0x2ccfdf['status'](_0x4c47a3)[_0xba7c('0x27')](_0x532f9e);};}exports[_0xba7c('0x28')]=function(_0x34d1ee,_0x402cf3){var _0x1bfc5f={},_0xdf3b11={},_0x44cc56={'count':0x0,'rows':[]};var _0x5a0c2a=_['map'](db['FaxApplication'][_0xba7c('0x29')],function(_0x437c31){return{'name':_0x437c31['fieldName'],'type':_0x437c31[_0xba7c('0x2a')][_0xba7c('0x2b')]};});_0xdf3b11[_0xba7c('0x2c')]=_[_0xba7c('0x2d')](_0x5a0c2a,_0xba7c('0x26'));_0xdf3b11[_0xba7c('0x2e')]=_['keys'](_0x34d1ee[_0xba7c('0x2e')]);_0xdf3b11[_0xba7c('0x2f')]=_[_0xba7c('0x30')](_0xdf3b11[_0xba7c('0x2c')],_0xdf3b11[_0xba7c('0x2e')]);_0x1bfc5f[_0xba7c('0x31')]=_['intersection'](_0xdf3b11[_0xba7c('0x2c')],qs[_0xba7c('0x32')](_0x34d1ee[_0xba7c('0x2e')]['fields']));_0x1bfc5f[_0xba7c('0x31')]=_0x1bfc5f['attributes'][_0xba7c('0x33')]?_0x1bfc5f[_0xba7c('0x31')]:_0xdf3b11[_0xba7c('0x2c')];if(!_0x34d1ee[_0xba7c('0x2e')][_0xba7c('0x34')](_0xba7c('0x35'))){_0x1bfc5f[_0xba7c('0x1d')]=qs[_0xba7c('0x1d')](_0x34d1ee['query'][_0xba7c('0x1d')]);_0x1bfc5f[_0xba7c('0x1a')]=qs[_0xba7c('0x1a')](_0x34d1ee[_0xba7c('0x2e')][_0xba7c('0x1a')]);}_0x1bfc5f[_0xba7c('0x36')]=qs['sort'](_0x34d1ee[_0xba7c('0x2e')][_0xba7c('0x37')]);_0x1bfc5f['where']=qs[_0xba7c('0x2f')](_['pick'](_0x34d1ee[_0xba7c('0x2e')],_0xdf3b11[_0xba7c('0x2f')]),_0x5a0c2a);if(_0x34d1ee[_0xba7c('0x2e')][_0xba7c('0x38')]){_0x1bfc5f['where']=_[_0xba7c('0x39')](_0x1bfc5f['where'],{'$or':_[_0xba7c('0x2d')](_0x5a0c2a,function(_0x34206e){if(_0x34206e[_0xba7c('0x2a')]!==_0xba7c('0x3a')){var _0x5947d3={};_0x5947d3[_0x34206e[_0xba7c('0x26')]]={'$like':'%'+_0x34d1ee[_0xba7c('0x2e')][_0xba7c('0x38')]+'%'};return _0x5947d3;}})});}_0x1bfc5f=_[_0xba7c('0x39')]({},_0x1bfc5f,_0x34d1ee['options']);var _0x5b09c7={'where':_0x1bfc5f[_0xba7c('0x3b')]};return db[_0xba7c('0x3c')][_0xba7c('0x1c')](_0x5b09c7)['then'](function(_0x2679ee){_0x44cc56[_0xba7c('0x1c')]=_0x2679ee;if(_0x34d1ee[_0xba7c('0x2e')]['includeAll']){_0x1bfc5f[_0xba7c('0x3d')]=[{'all':!![]}];}return db['FaxApplication'][_0xba7c('0x3e')](_0x1bfc5f);})['then'](function(_0x29c059){_0x44cc56[_0xba7c('0x3f')]=_0x29c059;return _0x44cc56;})[_0xba7c('0x40')](respondWithFilteredResult(_0x402cf3,_0x1bfc5f))[_0xba7c('0x41')](handleError(_0x402cf3,null));};exports[_0xba7c('0x42')]=function(_0x54eb3c,_0x5f482c){var _0x4e8550={'raw':!![],'where':{'id':_0x54eb3c[_0xba7c('0x43')]['id']}},_0x3ad8a6={};_0x3ad8a6['model']=_['keys'](db['FaxApplication']['rawAttributes']);_0x3ad8a6['query']=_[_0xba7c('0x44')](_0x54eb3c['query']);_0x3ad8a6['filters']=_[_0xba7c('0x30')](_0x3ad8a6[_0xba7c('0x2c')],_0x3ad8a6[_0xba7c('0x2e')]);_0x4e8550[_0xba7c('0x31')]=_[_0xba7c('0x30')](_0x3ad8a6['model'],qs[_0xba7c('0x32')](_0x54eb3c[_0xba7c('0x2e')][_0xba7c('0x32')]));_0x4e8550[_0xba7c('0x31')]=_0x4e8550[_0xba7c('0x31')]['length']?_0x4e8550['attributes']:_0x3ad8a6[_0xba7c('0x2c')];if(_0x54eb3c[_0xba7c('0x2e')][_0xba7c('0x45')]){_0x4e8550['include']=[{'all':!![]}];}_0x4e8550=_['merge']({},_0x4e8550,_0x54eb3c['options']);return db[_0xba7c('0x3c')][_0xba7c('0x46')](_0x4e8550)['then'](handleEntityNotFound(_0x5f482c,null))[_0xba7c('0x40')](respondWithResult(_0x5f482c,null))[_0xba7c('0x41')](handleError(_0x5f482c,null));};exports['create']=function(_0x182455,_0x5ae62e){return db[_0xba7c('0x3c')][_0xba7c('0x47')](_0x182455[_0xba7c('0x48')],{})[_0xba7c('0x40')](respondWithResult(_0x5ae62e,0xc9))[_0xba7c('0x41')](handleError(_0x5ae62e,null));};exports[_0xba7c('0x22')]=function(_0x10a2e5,_0x25e48c){if(_0x10a2e5[_0xba7c('0x48')]['id']){delete _0x10a2e5[_0xba7c('0x48')]['id'];}return db[_0xba7c('0x3c')]['find']({'where':{'id':_0x10a2e5['params']['id']}})[_0xba7c('0x40')](handleEntityNotFound(_0x25e48c,null))[_0xba7c('0x40')](saveUpdates(_0x10a2e5[_0xba7c('0x48')],null))[_0xba7c('0x40')](respondWithResult(_0x25e48c,null))['catch'](handleError(_0x25e48c,null));};exports[_0xba7c('0x23')]=function(_0x33599b,_0x5f45a5){return db[_0xba7c('0x3c')][_0xba7c('0x46')]({'where':{'id':_0x33599b[_0xba7c('0x43')]['id']}})[_0xba7c('0x40')](handleEntityNotFound(_0x5f45a5,null))[_0xba7c('0x40')](removeEntity(_0x5f45a5,null))['catch'](handleError(_0x5f45a5,null));};
\ No newline at end of file
+var _0x41d9=['where','filters','pick','filter','VIRTUAL','merge','findAll','catch','show','includeAll','include','find','create','body','params','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x453ba9,_0x41b71a){var _0x2cc439=function(_0x4cb664){while(--_0x4cb664){_0x453ba9['push'](_0x453ba9['shift']());}};_0x2cc439(++_0x41b71a);}(_0x41d9,0x9d));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x941d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x941d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x941d('0x2'));var moment=require('moment');var BPromise=require(_0x941d('0x3'));var Mustache=require(_0x941d('0x4'));var util=require(_0x941d('0x5'));var path=require(_0x941d('0x6'));var sox=require(_0x941d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x941d('0x8'));var _=require('lodash');var squel=require(_0x941d('0x9'));var crypto=require(_0x941d('0xa'));var jsforce=require(_0x941d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x941d('0xc'));var Redis=require(_0x941d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x941d('0xe'));var as=require(_0x941d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x941d('0x10'))(_0x941d('0x11'));var utils=require(_0x941d('0x12'));var config=require(_0x941d('0x13'));var licenseUtil=require(_0x941d('0x14'));var db=require(_0x941d('0x15'))['db'];function respondWithStatusCode(_0x35b577,_0x25fd34){_0x25fd34=_0x25fd34||0xcc;return function(_0x5e2039){if(_0x5e2039){return _0x35b577[_0x941d('0x16')](_0x25fd34);}return _0x35b577['status'](_0x25fd34)['end']();};}function respondWithResult(_0x5000a2,_0x40879d){_0x40879d=_0x40879d||0xc8;return function(_0x5e314f){if(_0x5e314f){return _0x5000a2[_0x941d('0x17')](_0x40879d)[_0x941d('0x18')](_0x5e314f);}};}function respondWithFilteredResult(_0x1cf11f,_0x2ba97d){return function(_0x103525){if(_0x103525){var _0xfea36=typeof _0x2ba97d[_0x941d('0x19')]===_0x941d('0x1a')&&typeof _0x2ba97d[_0x941d('0x1b')]===_0x941d('0x1a');var _0x23e559=_0x103525[_0x941d('0x1c')];var _0x213d24=_0xfea36?0x0:_0x2ba97d[_0x941d('0x19')];var _0x538383=_0xfea36?_0x103525[_0x941d('0x1c')]:_0x2ba97d['offset']+_0x2ba97d['limit'];var _0xaac076;if(_0x538383>=_0x23e559){_0x538383=_0x23e559;_0xaac076=0xc8;}else{_0xaac076=0xce;}_0x1cf11f[_0x941d('0x17')](_0xaac076);return _0x1cf11f[_0x941d('0x1d')](_0x941d('0x1e'),_0x213d24+'-'+_0x538383+'/'+_0x23e559)[_0x941d('0x18')](_0x103525);}return null;};}function patchUpdates(_0x23519e){return function(_0x562152){try{jsonpatch[_0x941d('0x1f')](_0x562152,_0x23519e,!![]);}catch(_0x2c9626){return BPromise[_0x941d('0x20')](_0x2c9626);}return _0x562152['save']();};}function saveUpdates(_0x3b3a20,_0x399c8a){return function(_0x100210){if(_0x100210){return _0x100210[_0x941d('0x21')](_0x3b3a20)[_0x941d('0x22')](function(_0x561c98){return _0x561c98;});}return null;};}function removeEntity(_0x3c7cc4,_0x1f3c2c){return function(_0x2c56e0){if(_0x2c56e0){return _0x2c56e0[_0x941d('0x23')]()['then'](function(){_0x3c7cc4[_0x941d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeca1b6,_0x87d9af){return function(_0x2891ef){if(!_0x2891ef){_0xeca1b6[_0x941d('0x16')](0x194);}return _0x2891ef;};}function handleError(_0x335839,_0xb58045){_0xb58045=_0xb58045||0x1f4;return function(_0x22cae2){logger[_0x941d('0x24')](_0x22cae2[_0x941d('0x25')]);if(_0x22cae2[_0x941d('0x26')]){delete _0x22cae2[_0x941d('0x26')];}_0x335839[_0x941d('0x17')](_0xb58045)[_0x941d('0x27')](_0x22cae2);};}exports['index']=function(_0x391a0e,_0xaeff9){var _0x4a7b4b={},_0x5cc76b={},_0x3067ee={'count':0x0,'rows':[]};var _0x5a6e96=_[_0x941d('0x28')](db[_0x941d('0x29')][_0x941d('0x2a')],function(_0x3ccffc){return{'name':_0x3ccffc[_0x941d('0x2b')],'type':_0x3ccffc[_0x941d('0x2c')][_0x941d('0x2d')]};});_0x5cc76b[_0x941d('0x2e')]=_[_0x941d('0x28')](_0x5a6e96,_0x941d('0x26'));_0x5cc76b[_0x941d('0x2f')]=_[_0x941d('0x30')](_0x391a0e['query']);_0x5cc76b['filters']=_[_0x941d('0x31')](_0x5cc76b[_0x941d('0x2e')],_0x5cc76b[_0x941d('0x2f')]);_0x4a7b4b[_0x941d('0x32')]=_[_0x941d('0x31')](_0x5cc76b[_0x941d('0x2e')],qs[_0x941d('0x33')](_0x391a0e[_0x941d('0x2f')][_0x941d('0x33')]));_0x4a7b4b[_0x941d('0x32')]=_0x4a7b4b[_0x941d('0x32')][_0x941d('0x34')]?_0x4a7b4b[_0x941d('0x32')]:_0x5cc76b[_0x941d('0x2e')];if(!_0x391a0e['query'][_0x941d('0x35')]('nolimit')){_0x4a7b4b[_0x941d('0x1b')]=qs[_0x941d('0x1b')](_0x391a0e[_0x941d('0x2f')][_0x941d('0x1b')]);_0x4a7b4b[_0x941d('0x19')]=qs[_0x941d('0x19')](_0x391a0e['query'][_0x941d('0x19')]);}_0x4a7b4b[_0x941d('0x36')]=qs['sort'](_0x391a0e[_0x941d('0x2f')][_0x941d('0x37')]);_0x4a7b4b[_0x941d('0x38')]=qs[_0x941d('0x39')](_[_0x941d('0x3a')](_0x391a0e[_0x941d('0x2f')],_0x5cc76b[_0x941d('0x39')]),_0x5a6e96);if(_0x391a0e[_0x941d('0x2f')][_0x941d('0x3b')]){_0x4a7b4b[_0x941d('0x38')]=_['merge'](_0x4a7b4b[_0x941d('0x38')],{'$or':_[_0x941d('0x28')](_0x5a6e96,function(_0x5da7ca){if(_0x5da7ca[_0x941d('0x2c')]!==_0x941d('0x3c')){var _0x28ca35={};_0x28ca35[_0x5da7ca[_0x941d('0x26')]]={'$like':'%'+_0x391a0e[_0x941d('0x2f')]['filter']+'%'};return _0x28ca35;}})});}_0x4a7b4b=_[_0x941d('0x3d')]({},_0x4a7b4b,_0x391a0e['options']);var _0x5c2dc7={'where':_0x4a7b4b[_0x941d('0x38')]};return db[_0x941d('0x29')]['count'](_0x5c2dc7)[_0x941d('0x22')](function(_0x45e749){_0x3067ee[_0x941d('0x1c')]=_0x45e749;if(_0x391a0e[_0x941d('0x2f')]['includeAll']){_0x4a7b4b['include']=[{'all':!![]}];}return db[_0x941d('0x29')][_0x941d('0x3e')](_0x4a7b4b);})['then'](function(_0x461b3c){_0x3067ee['rows']=_0x461b3c;return _0x3067ee;})[_0x941d('0x22')](respondWithFilteredResult(_0xaeff9,_0x4a7b4b))[_0x941d('0x3f')](handleError(_0xaeff9,null));};exports[_0x941d('0x40')]=function(_0x33287c,_0x320590){var _0xa73095={'raw':!![],'where':{'id':_0x33287c['params']['id']}},_0x3fbe7e={};_0x3fbe7e[_0x941d('0x2e')]=_['keys'](db[_0x941d('0x29')][_0x941d('0x2a')]);_0x3fbe7e[_0x941d('0x2f')]=_[_0x941d('0x30')](_0x33287c[_0x941d('0x2f')]);_0x3fbe7e[_0x941d('0x39')]=_['intersection'](_0x3fbe7e[_0x941d('0x2e')],_0x3fbe7e[_0x941d('0x2f')]);_0xa73095['attributes']=_[_0x941d('0x31')](_0x3fbe7e['model'],qs[_0x941d('0x33')](_0x33287c[_0x941d('0x2f')][_0x941d('0x33')]));_0xa73095[_0x941d('0x32')]=_0xa73095['attributes'][_0x941d('0x34')]?_0xa73095[_0x941d('0x32')]:_0x3fbe7e[_0x941d('0x2e')];if(_0x33287c[_0x941d('0x2f')][_0x941d('0x41')]){_0xa73095[_0x941d('0x42')]=[{'all':!![]}];}_0xa73095=_[_0x941d('0x3d')]({},_0xa73095,_0x33287c['options']);return db['FaxApplication'][_0x941d('0x43')](_0xa73095)[_0x941d('0x22')](handleEntityNotFound(_0x320590,null))['then'](respondWithResult(_0x320590,null))['catch'](handleError(_0x320590,null));};exports['create']=function(_0x3751fb,_0xc8976f){return db[_0x941d('0x29')][_0x941d('0x44')](_0x3751fb[_0x941d('0x45')],{})[_0x941d('0x22')](respondWithResult(_0xc8976f,0xc9))['catch'](handleError(_0xc8976f,null));};exports['update']=function(_0x3a9dd6,_0x3e9815){if(_0x3a9dd6[_0x941d('0x45')]['id']){delete _0x3a9dd6[_0x941d('0x45')]['id'];}return db[_0x941d('0x29')]['find']({'where':{'id':_0x3a9dd6[_0x941d('0x46')]['id']}})[_0x941d('0x22')](handleEntityNotFound(_0x3e9815,null))[_0x941d('0x22')](saveUpdates(_0x3a9dd6[_0x941d('0x45')],null))[_0x941d('0x22')](respondWithResult(_0x3e9815,null))[_0x941d('0x3f')](handleError(_0x3e9815,null));};exports['destroy']=function(_0x2c775d,_0x3304e9){return db[_0x941d('0x29')][_0x941d('0x43')]({'where':{'id':_0x2c775d[_0x941d('0x46')]['id']}})['then'](handleEntityNotFound(_0x3304e9,null))['then'](removeEntity(_0x3304e9,null))[_0x941d('0x3f')](handleError(_0x3304e9,null));};
\ No newline at end of file
index 6ae6c09..dc3240a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e7d=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports'];(function(_0x546da9,_0x3286b2){var _0x54d8d9=function(_0xde68ff){while(--_0xde68ff){_0x546da9['push'](_0x546da9['shift']());}};_0x54d8d9(++_0x3286b2);}(_0x2e7d,0x125));var _0xd2e7=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x2e7d[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xd2e7('0x0'));var util=require(_0xd2e7('0x1'));var logger=require(_0xd2e7('0x2'))(_0xd2e7('0x3'));var moment=require(_0xd2e7('0x4'));var BPromise=require(_0xd2e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2e7('0x6'));var rimraf=require(_0xd2e7('0x7'));var config=require(_0xd2e7('0x8'));var attributes=require(_0xd2e7('0x9'));module[_0xd2e7('0xa')]=function(_0x2b00a5,_0x445c2e){return _0x2b00a5[_0xd2e7('0xb')](_0xd2e7('0xc'),attributes,{'tableName':_0xd2e7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd2e7('0xe'),'collate':_0xd2e7('0xf')});};
\ No newline at end of file
+var _0x3291=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3ffe3f,_0x464d70){var _0x130c0b=function(_0x4d137e){while(--_0x4d137e){_0x3ffe3f['push'](_0x3ffe3f['shift']());}};_0x130c0b(++_0x464d70);}(_0x3291,0x1f0));var _0x1329=function(_0x529008,_0x25d31b){_0x529008=_0x529008-0x0;var _0x3206a1=_0x3291[_0x529008];return _0x3206a1;};'use strict';var _=require(_0x1329('0x0'));var util=require(_0x1329('0x1'));var logger=require('../../config/logger')(_0x1329('0x2'));var moment=require(_0x1329('0x3'));var BPromise=require(_0x1329('0x4'));var rp=require(_0x1329('0x5'));var fs=require('fs');var path=require(_0x1329('0x6'));var rimraf=require(_0x1329('0x7'));var config=require(_0x1329('0x8'));var attributes=require(_0x1329('0x9'));module[_0x1329('0xa')]=function(_0x109ae6,_0x79c41f){return _0x109ae6[_0x1329('0xb')](_0x1329('0xc'),attributes,{'tableName':_0x1329('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1329('0xe'),'collate':_0x1329('0xf')});};
\ No newline at end of file
index d8cff29..d19fe98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c48=['catch','update','body','raw','options','attributes','limit','then','UpdateFaxApplication','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5c48,0x172));var _0x85c4=function(_0x44d71c,_0x2f6747){_0x44d71c=_0x44d71c-0x0;var _0x45655c=_0x5c48[_0x44d71c];return _0x45655c;};'use strict';var _=require(_0x85c4('0x0'));var util=require(_0x85c4('0x1'));var moment=require(_0x85c4('0x2'));var BPromise=require(_0x85c4('0x3'));var rs=require(_0x85c4('0x4'));var fs=require('fs');var Redis=require(_0x85c4('0x5'));var db=require(_0x85c4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x85c4('0x7'))('rpc');var config=require(_0x85c4('0x8'));var jayson=require(_0x85c4('0x9'));var client=jayson['client'][_0x85c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4666cf,_0x193dc9,_0x1eff96){return new BPromise(function(_0x41a648,_0x2ee4e1){return client[_0x85c4('0xb')](_0x4666cf,_0x1eff96)['then'](function(_0x4d4d64){logger[_0x85c4('0xc')](_0x85c4('0xd'),_0x193dc9,_0x85c4('0xe'));logger['debug'](_0x85c4('0xf'),_0x193dc9,'request\x20sent',JSON[_0x85c4('0x10')](_0x4d4d64));if(_0x4d4d64[_0x85c4('0x11')]){if(_0x4d4d64['error']['code']===0x1f4){logger[_0x85c4('0x11')](_0x85c4('0xd'),_0x193dc9,_0x4d4d64[_0x85c4('0x11')][_0x85c4('0x12')]);return _0x2ee4e1(_0x4d4d64[_0x85c4('0x11')][_0x85c4('0x12')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x193dc9,_0x4d4d64['error']['message']);return _0x41a648(_0x4d4d64['error'][_0x85c4('0x12')]);}else{logger[_0x85c4('0xc')](_0x85c4('0xd'),_0x193dc9,_0x85c4('0xe'));_0x41a648(_0x4d4d64[_0x85c4('0x13')][_0x85c4('0x12')]);}})[_0x85c4('0x14')](function(_0x76e9ce){logger[_0x85c4('0x11')](_0x85c4('0xd'),_0x193dc9,_0x76e9ce);_0x2ee4e1(_0x76e9ce);});});}exports['UpdateFaxApplication']=function(_0x2851aa){var _0xfe1e=this;return new Promise(function(_0x88d1c2,_0x255aa1){return db['FaxApplication'][_0x85c4('0x15')](_0x2851aa[_0x85c4('0x16')],{'raw':_0x2851aa['options']?_0x2851aa['options'][_0x85c4('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2851aa[_0x85c4('0x18')]?_0x2851aa[_0x85c4('0x18')]['where']||null:null,'attributes':_0x2851aa[_0x85c4('0x18')]?_0x2851aa[_0x85c4('0x18')][_0x85c4('0x19')]||null:null,'limit':_0x2851aa[_0x85c4('0x18')]?_0x2851aa[_0x85c4('0x18')][_0x85c4('0x1a')]||null:null})[_0x85c4('0x1b')](function(_0x4dc360){logger[_0x85c4('0xc')](_0x85c4('0x1c'),_0x2851aa);logger[_0x85c4('0x1d')](_0x85c4('0x1c'),_0x2851aa,JSON[_0x85c4('0x10')](_0x4dc360));_0x88d1c2(_0x4dc360);})[_0x85c4('0x14')](function(_0x2fb569){logger['error']('UpdateFaxApplication',_0x2fb569[_0x85c4('0x12')],_0x2851aa);_0x255aa1(_0xfe1e['error'](0x1f4,_0x2fb569['message']));});});};
\ No newline at end of file
+var _0xbf22=['stringify','error','message','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','info','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2c0241,_0x21542e){var _0x269049=function(_0x6d4208){while(--_0x6d4208){_0x2c0241['push'](_0x2c0241['shift']());}};_0x269049(++_0x21542e);}(_0xbf22,0x11c));var _0x2bf2=function(_0x70dee5,_0x3b711b){_0x70dee5=_0x70dee5-0x0;var _0x14d387=_0xbf22[_0x70dee5];return _0x14d387;};'use strict';var _=require(_0x2bf2('0x0'));var util=require(_0x2bf2('0x1'));var moment=require('moment');var BPromise=require(_0x2bf2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2bf2('0x3'));var db=require(_0x2bf2('0x4'))['db'];var utils=require(_0x2bf2('0x5'));var logger=require('../../config/logger')(_0x2bf2('0x6'));var config=require(_0x2bf2('0x7'));var jayson=require(_0x2bf2('0x8'));var client=jayson[_0x2bf2('0x9')][_0x2bf2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f21ea,_0x580950,_0xb3a43f){return new BPromise(function(_0xf0d6e8,_0x18a129){return client[_0x2bf2('0xb')](_0x1f21ea,_0xb3a43f)[_0x2bf2('0xc')](function(_0x36aad9){logger['info'](_0x2bf2('0xd'),_0x580950,'request\x20sent');logger[_0x2bf2('0xe')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x580950,_0x2bf2('0xf'),JSON[_0x2bf2('0x10')](_0x36aad9));if(_0x36aad9[_0x2bf2('0x11')]){if(_0x36aad9[_0x2bf2('0x11')]['code']===0x1f4){logger[_0x2bf2('0x11')]('FaxApplication,\x20%s,\x20%s',_0x580950,_0x36aad9[_0x2bf2('0x11')][_0x2bf2('0x12')]);return _0x18a129(_0x36aad9[_0x2bf2('0x11')]['message']);}logger[_0x2bf2('0x11')](_0x2bf2('0xd'),_0x580950,_0x36aad9[_0x2bf2('0x11')][_0x2bf2('0x12')]);return _0xf0d6e8(_0x36aad9[_0x2bf2('0x11')][_0x2bf2('0x12')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x580950,_0x2bf2('0xf'));_0xf0d6e8(_0x36aad9['result'][_0x2bf2('0x12')]);}})['catch'](function(_0x5dae46){logger[_0x2bf2('0x11')](_0x2bf2('0xd'),_0x580950,_0x5dae46);_0x18a129(_0x5dae46);});});}exports[_0x2bf2('0x13')]=function(_0x34d1a2){var _0x5da642=this;return new Promise(function(_0x2b6773,_0x10a2f7){return db[_0x2bf2('0x14')][_0x2bf2('0x15')](_0x34d1a2[_0x2bf2('0x16')],{'raw':_0x34d1a2[_0x2bf2('0x17')]?_0x34d1a2[_0x2bf2('0x17')][_0x2bf2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34d1a2['options']?_0x34d1a2[_0x2bf2('0x17')][_0x2bf2('0x19')]||null:null,'attributes':_0x34d1a2[_0x2bf2('0x17')]?_0x34d1a2['options'][_0x2bf2('0x1a')]||null:null,'limit':_0x34d1a2['options']?_0x34d1a2[_0x2bf2('0x17')][_0x2bf2('0x1b')]||null:null})[_0x2bf2('0xc')](function(_0x9a89a6){logger[_0x2bf2('0x1c')]('UpdateFaxApplication',_0x34d1a2);logger[_0x2bf2('0xe')](_0x2bf2('0x13'),_0x34d1a2,JSON[_0x2bf2('0x10')](_0x9a89a6));_0x2b6773(_0x9a89a6);})[_0x2bf2('0x1d')](function(_0x7da2b2){logger[_0x2bf2('0x11')]('UpdateFaxApplication',_0x7da2b2[_0x2bf2('0x12')],_0x34d1a2);_0x10a2f7(_0x5da642[_0x2bf2('0x11')](0x1f4,_0x7da2b2[_0x2bf2('0x12')]));});});};
\ No newline at end of file
index d7a1406..cd719fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['./faxApplication.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5dc5f3,_0x3aa2e0){var _0x2ad1ca=function(_0x42a7ba){while(--_0x42a7ba){_0x5dc5f3['push'](_0x5dc5f3['shift']());}};_0x2ad1ca(++_0x3aa2e0);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a93f0,_0x172b1b){_0x5a93f0=_0x5a93f0-0x0;var _0x53844d=_0xb10b[_0x5a93f0];return _0x53844d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xe605=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x6c434,_0x2508c5){var _0x25d130=function(_0x14b3c5){while(--_0x14b3c5){_0x6c434['push'](_0x6c434['shift']());}};_0x25d130(++_0x2508c5);}(_0xe605,0x92));var _0x5e60=function(_0x51f72a,_0x3d9f14){_0x51f72a=_0x51f72a-0x0;var _0x51b514=_0xe605[_0x51f72a];return _0x51b514;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/:id',auth[_0x5e60('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x5e60('0xd')]);router[_0x5e60('0xe')](_0x5e60('0xf'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x10')]);router[_0x5e60('0x11')]('/:id',auth[_0x5e60('0xb')](),controller['destroy']);module[_0x5e60('0x12')]=router;
\ No newline at end of file
index 65f5a82..344e0c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5977=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x2d93d4,_0x149172){var _0x44df30=function(_0x22e8d8){while(--_0x22e8d8){_0x2d93d4['push'](_0x2d93d4['shift']());}};_0x44df30(++_0x149172);}(_0x5977,0x11e));var _0x7597=function(_0xc66e97,_0x725f7b){_0xc66e97=_0xc66e97-0x0;var _0x55f29f=_0x5977[_0xc66e97];return _0x55f29f;};'use strict';var Sequelize=require(_0x7597('0x0'));module[_0x7597('0x1')]={'closed':{'type':Sequelize[_0x7597('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7597('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7597('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7597('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7597('0x3')]},'fax':{'type':Sequelize[_0x7597('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x7597('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7597('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7597('0x5')]('in',_0x7597('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x38d3=['STRING','out','sequelize','DATE'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0x38d3,0x176));var _0x338d=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x38d3[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x338d('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x338d('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x338d('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x338d('0x2')]},'read1stAt':{'type':Sequelize[_0x338d('0x1')]},'fax':{'type':Sequelize[_0x338d('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x338d('0x3')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index d086cd9..c7b22be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6868=['rows','show','params','merge','options','create','body','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','rawAttributes','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','setTags','spread','color','faxInteractionTags:save','removeTags','download','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','./faxInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','name','Users','map','TagIds','Tags','split','forEach','push','catch','FaxInteraction','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','end','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','i.FaxAccountId\x20IS\x20NULL','role','toString','sequelize','keyBy','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all'];(function(_0x575125,_0x575714){var _0x4ebae0=function(_0x606292){while(--_0x606292){_0x575125['push'](_0x575125['shift']());}};_0x4ebae0(++_0x575714);}(_0x6868,0x1eb));var _0x8686=function(_0xe1496,_0x25b843){_0xe1496=_0xe1496-0x0;var _0x574e8a=_0x6868[_0xe1496];return _0x574e8a;};'use strict';var emlformat=require(_0x8686('0x0'));var rimraf=require(_0x8686('0x1'));var zipdir=require(_0x8686('0x2'));var jsonpatch=require(_0x8686('0x3'));var rp=require(_0x8686('0x4'));var moment=require(_0x8686('0x5'));var BPromise=require(_0x8686('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8686('0x7'));var sox=require('sox');var csv=require(_0x8686('0x8'));var ejs=require(_0x8686('0x9'));var fs=require('fs');var fs_extra=require(_0x8686('0xa'));var _=require(_0x8686('0xb'));var squel=require(_0x8686('0xc'));var crypto=require(_0x8686('0xd'));var jsforce=require(_0x8686('0xe'));var deskjs=require(_0x8686('0xf'));var toCsv=require(_0x8686('0x8'));var querystring=require(_0x8686('0x10'));var Papa=require(_0x8686('0x11'));var Redis=require(_0x8686('0x12'));var authService=require(_0x8686('0x13'));var qs=require(_0x8686('0x14'));var as=require(_0x8686('0x15'));var hardwareService=require(_0x8686('0x16'));var logger=require('../../config/logger')(_0x8686('0x17'));var utils=require(_0x8686('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8686('0x19'));var db=require(_0x8686('0x1a'))['db'];config[_0x8686('0x1b')]=_[_0x8686('0x1c')](config[_0x8686('0x1b')],{'host':_0x8686('0x1d'),'port':0x18eb});var socket=require(_0x8686('0x1e'))(new Redis(config[_0x8686('0x1b')]));require(_0x8686('0x1f'))[_0x8686('0x20')](socket);function respondWithStatusCode(_0x56caf7,_0x122c0f){_0x122c0f=_0x122c0f||0xcc;return function(_0x454fda){if(_0x454fda){return _0x56caf7[_0x8686('0x21')](_0x122c0f);}return _0x56caf7['status'](_0x122c0f)['end']();};}function respondWithResult(_0x213a5d,_0x2d4f51){_0x2d4f51=_0x2d4f51||0xc8;return function(_0x41f724){if(_0x41f724){return _0x213a5d[_0x8686('0x22')](_0x2d4f51)['json'](_0x41f724);}};}function respondWithFilteredResult(_0x49df36,_0x4a2fbe){return function(_0x441ef6){if(_0x441ef6){var _0x513905=typeof _0x4a2fbe[_0x8686('0x23')]===_0x8686('0x24')&&typeof _0x4a2fbe[_0x8686('0x25')]===_0x8686('0x24');var _0x123052=_0x441ef6[_0x8686('0x26')];var _0x48064c=_0x513905?0x0:_0x4a2fbe['offset'];var _0x570949=_0x513905?_0x441ef6[_0x8686('0x26')]:_0x4a2fbe[_0x8686('0x23')]+_0x4a2fbe[_0x8686('0x25')];var _0x46e22;if(_0x570949>=_0x123052){_0x570949=_0x123052;_0x46e22=0xc8;}else{_0x46e22=0xce;}_0x49df36[_0x8686('0x22')](_0x46e22);return _0x49df36[_0x8686('0x27')]('Content-Range',_0x48064c+'-'+_0x570949+'/'+_0x123052)[_0x8686('0x28')](_0x441ef6);}return null;};}function patchUpdates(_0x26ccf3){return function(_0x12199e){try{jsonpatch[_0x8686('0x29')](_0x12199e,_0x26ccf3,!![]);}catch(_0x80355b){return BPromise[_0x8686('0x2a')](_0x80355b);}return _0x12199e[_0x8686('0x2b')]();};}function saveUpdates(_0x8562bd,_0x25ea2a){return function(_0x7876f5){if(_0x7876f5){return _0x7876f5[_0x8686('0x2c')](_0x8562bd)[_0x8686('0x2d')](function(_0x3a696c){return _0x3a696c;});}return null;};}function removeEntity(_0x38f8a6,_0x4f24ed){return function(_0xd514ed){if(_0xd514ed){return _0xd514ed[_0x8686('0x2e')]()[_0x8686('0x2d')](function(){_0x38f8a6[_0x8686('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db2c4,_0x424780){return function(_0x39e7ce){if(!_0x39e7ce){_0x4db2c4[_0x8686('0x21')](0x194);}return _0x39e7ce;};}function handleError(_0x121bbf,_0x3ff94b){_0x3ff94b=_0x3ff94b||0x1f4;return function(_0x35f514){logger[_0x8686('0x2f')](_0x35f514['stack']);if(_0x35f514[_0x8686('0x30')]){delete _0x35f514[_0x8686('0x30')];}_0x121bbf[_0x8686('0x22')](_0x3ff94b)['send'](_0x35f514);};}function getInteractionUsers(_0x33378d,_0xa9aec7){return new BPromise(function(_0x1e7a78,_0x28fc83){try{if(_0xa9aec7[_0x33378d['id']]){_0x33378d[_0x8686('0x31')]=_[_0x8686('0x32')](_0xa9aec7[_0x33378d['id']],function(_0x5b5706){return{'id':_0x5b5706['id'],'fullname':_0x5b5706['fullname']};});}}catch(_0x5271d5){_0x28fc83(_0x5271d5);}_0x1e7a78(_0x33378d);});}function getInteractionTags(_0x5c7962,_0xdd1649){return new BPromise(function(_0x4487f0,_0x5d04a2){try{if(_0x5c7962[_0x8686('0x33')]){_0x5c7962[_0x8686('0x34')]=[];_0x5c7962[_0x8686('0x33')][_0x8686('0x35')](',')[_0x8686('0x36')](function(_0x48b455){_0x5c7962[_0x8686('0x34')][_0x8686('0x37')](_0xdd1649[_0x48b455]);});}delete _0x5c7962['TagIds'];}catch(_0x1785de){_0x5d04a2(_0x1785de);}_0x4487f0(_0x5c7962);});}function updateFaxInteraction(_0x8c2444,_0x4fb2f0,_0x38515f){return new BPromise(function(_0x4b5df6,_0x23683e){return getInteractionUsers(_0x8c2444,_0x38515f)[_0x8686('0x2d')](function(_0x45c155){return getInteractionTags(_0x45c155,_0x4fb2f0);})[_0x8686('0x2d')](function(_0x3387ad){_0x4b5df6(_0x3387ad);})[_0x8686('0x38')](function(_0x343d76){_0x23683e(_0x343d76);});});}exports['index']=function(_0x5bac2d,_0x2e379a){var _0x2e3ead={},_0x1029ce={},_0x832f45={'count':0x0,'rows':[]};var _0x193e70=_[_0x8686('0x32')](db[_0x8686('0x39')]['rawAttributes'],function(_0x183e20){return{'name':_0x183e20[_0x8686('0x3a')],'type':_0x183e20[_0x8686('0x3b')]['key']};});_0x1029ce[_0x8686('0x3c')]=_[_0x8686('0x32')](_0x193e70,_0x8686('0x30'));_0x1029ce[_0x8686('0x3d')]=_[_0x8686('0x3e')](_0x5bac2d[_0x8686('0x3d')]);_0x1029ce[_0x8686('0x3f')]=_[_0x8686('0x40')](_0x1029ce[_0x8686('0x3c')],_0x1029ce['query']);_0x2e3ead['attributes']=_['intersection'](_0x1029ce[_0x8686('0x3c')],qs['fields'](_0x5bac2d[_0x8686('0x3d')][_0x8686('0x41')]));_0x2e3ead[_0x8686('0x42')]=_0x2e3ead[_0x8686('0x42')][_0x8686('0x43')]?_0x2e3ead['attributes']:_0x1029ce[_0x8686('0x3c')];if(!_0x5bac2d[_0x8686('0x3d')][_0x8686('0x44')](_0x8686('0x45'))){_0x2e3ead['limit']=qs[_0x8686('0x25')](_0x5bac2d[_0x8686('0x3d')][_0x8686('0x25')]);_0x2e3ead[_0x8686('0x23')]=qs[_0x8686('0x23')](_0x5bac2d[_0x8686('0x3d')][_0x8686('0x23')]);}_0x2e3ead[_0x8686('0x46')]=qs[_0x8686('0x47')](_0x5bac2d[_0x8686('0x3d')][_0x8686('0x47')]);_0x2e3ead[_0x8686('0x48')]=qs['filters'](_[_0x8686('0x49')](_0x5bac2d[_0x8686('0x3d')],_0x1029ce[_0x8686('0x3f')]),_0x193e70);var _0x393833=[];var _0x4229f5=squel[_0x8686('0x4a')]()['field']('id')[_0x8686('0x4b')](_0x8686('0x30'))[_0x8686('0x4b')]('color')[_0x8686('0x4c')](_0x8686('0x4d'));var _0x701545=squel[_0x8686('0x4a')]()[_0x8686('0x4b')]('u.id')['field'](_0x8686('0x4e'))[_0x8686('0x4b')](_0x8686('0x4f'))[_0x8686('0x4c')](_0x8686('0x50'),'ui')[_0x8686('0x51')](_0x8686('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x539445=squel[_0x8686('0x4a')]()[_0x8686('0x4c')](_0x8686('0x53'),'i')[_0x8686('0x51')](_0x8686('0x54'),'c',_0x8686('0x55'))[_0x8686('0x51')](_0x8686('0x52'),'o',_0x8686('0x56'))['left_join'](_0x8686('0x57'),'a',_0x8686('0x58'))[_0x8686('0x51')](_0x8686('0x59'),'me',_0x8686('0x5a'))['left_join'](_0x8686('0x5b'),'it',_0x8686('0x5c'))[_0x8686('0x51')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x36dfd8=squel['expr']();var _0x168aa0=[];var _0x2c538=squel['expr']();var _0x239600;if(_0x5bac2d[_0x8686('0x3d')][_0x8686('0x5d')]){_0x239600=as[_0x8686('0x5e')](_0x5bac2d['query'][_0x8686('0x5d')]);var _0x3bd5a0=_0x239600[_0x8686('0x5f')];for(var _0x253086=0x0;_0x253086<_0x239600[_0x8686('0x60')][_0x8686('0x43')];_0x253086++){var _0xa56e89=_0x239600[_0x8686('0x60')][_0x253086];var _0x525642='i';var _0x1b6d93=_[_0x8686('0x61')](_0x193e70,[_0x8686('0x30'),_0xa56e89[_0x8686('0x4b')]]);if(!_0x1b6d93){switch(_0xa56e89['field']){case _0x8686('0x62'):if(_0xa56e89[_0x8686('0x63')]==0x1){_0x539445[_0x8686('0x64')]('`'+_0xa56e89['field']+_0x8686('0x65'));}else{_0x539445[_0x8686('0x64')]('`'+_0xa56e89[_0x8686('0x4b')]+'`\x20>\x200');}break;case _0x8686('0x66'):if(_0xa56e89[_0x8686('0x67')]===_0x8686('0x68')){if(_0xa56e89[_0x8686('0x63')][_0x8686('0x35')]('\x20')[_0x8686('0x43')]>0x1){_0x36dfd8[_0x3bd5a0](_0x8686('0x69'),qs[_0x8686('0x6a')](_0xa56e89[_0x8686('0x63')]),null);}else{var _0x466cc6='%'+_0xa56e89[_0x8686('0x63')]+'%';_0x36dfd8[_0x3bd5a0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x466cc6,_0x466cc6,_0x466cc6);}}else{_0x1b6d93=_[_0x8686('0x61')](_0x193e70,[_0x8686('0x30'),_0x8686('0x6b')]);_0xa56e89[_0x8686('0x4b')]='ContactId';_0x3a67a9=as[_0x8686('0x6c')](_0x525642,_0x1b6d93[_0x8686('0x3b')],_0xa56e89);_0x36dfd8[_0x3bd5a0](_0x3a67a9[_0x8686('0x6d')],_0x3a67a9[_0x8686('0x63')][_0x8686('0x6e')],_0x3a67a9[_0x8686('0x63')]['end']);}break;case _0x8686('0x6f'):var _0x55b387=_0xa56e89[_0x8686('0x63')]['split'](',')['map'](function(_0x208465){return Number(_0x208465);});_0x55b387[_0x8686('0x36')](function(_0x1da2ee){_0x2c538['or'](_0x8686('0x70'),'%,'+_0x1da2ee+',%');});_0x168aa0=_[_0x8686('0x71')](_0x168aa0,_0x55b387);break;case _0x8686('0x72'):if(_0xa56e89[_0x8686('0x67')]===_0x8686('0x68')){_0x36dfd8[_0x3bd5a0]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xa56e89[_0x8686('0x63')]+'%',null);}else{_0x1b6d93=_[_0x8686('0x61')](_0x193e70,[_0x8686('0x30'),'UserId']);_0xa56e89['field']=_0x8686('0x73');_0x3a67a9=as[_0x8686('0x6c')](_0x525642,_0x1b6d93[_0x8686('0x3b')],_0xa56e89);_0x36dfd8[_0x3bd5a0](_0x3a67a9[_0x8686('0x6d')],_0x3a67a9['value'][_0x8686('0x6e')],_0x3a67a9[_0x8686('0x63')]['end']);}break;case'body':_0x3a67a9=as[_0x8686('0x6c')]('me',null,_0xa56e89);_0x36dfd8[_0x3bd5a0](_0x3a67a9[_0x8686('0x6d')],_0x3a67a9[_0x8686('0x63')][_0x8686('0x6e')],_0x3a67a9['value'][_0x8686('0x74')]);break;}}else{var _0x3a67a9=as[_0x8686('0x6c')](_0x525642,_0x1b6d93[_0x8686('0x3b')],_0xa56e89);_0x36dfd8[_0x3bd5a0](_0x3a67a9[_0x8686('0x6d')],_0x3a67a9['value'][_0x8686('0x6e')],_0x3a67a9['value']['end']);}}}else{var _0x41008b=_(_0x5bac2d[_0x8686('0x3d')])[_0x8686('0x3e')]()[_0x8686('0x32')](function(_0x11277e){return _[_0x8686('0x75')](_0x193e70,['name',_0x11277e])?_0x11277e:undefined;})[_0x8686('0x76')]()[_0x8686('0x63')]();if(!_[_0x8686('0x77')](_0x41008b)){_0x41008b['forEach'](function(_0x2ed74a){if(_0x2ed74a===_0x8686('0x78')){_0x539445[_0x8686('0x48')](_0x8686('0x79'),[][_0x8686('0x7a')](_0x5bac2d['query'][_0x2ed74a]));}else if(_0x2ed74a===_0x8686('0x7b')){var _0xd02a6a=JSON[_0x8686('0x7c')](_0x5bac2d[_0x8686('0x3d')][_0x2ed74a])['$gte'];var _0x2f1856=JSON[_0x8686('0x7c')](_0x5bac2d[_0x8686('0x3d')][_0x2ed74a])[_0x8686('0x7d')];_0x539445[_0x8686('0x48')](_0x8686('0x7e'),_0xd02a6a,_0x2f1856);}else{if(_0x5bac2d[_0x8686('0x3d')][_0x2ed74a]===_0x8686('0x7f')){_0x539445[_0x8686('0x48')]('i.'+_0x2ed74a+'\x20IS\x20NULL');}else{_0x539445[_0x8686('0x48')]('i.'+_0x2ed74a+_0x8686('0x80'),_0x5bac2d[_0x8686('0x3d')][_0x2ed74a]);}}});}if(_0x5bac2d[_0x8686('0x3d')][_0x8686('0x81')]){if(_0x5bac2d[_0x8686('0x3d')]['read']==0x1){_0x539445[_0x8686('0x64')](_0x8686('0x82'));}else{_0x539445[_0x8686('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x5bac2d['query']['tag']){_0x168aa0=_[_0x8686('0x83')](_0x5bac2d['query'][_0x8686('0x84')])?_0x5bac2d[_0x8686('0x3d')][_0x8686('0x84')]:new Array(_0x5bac2d[_0x8686('0x3d')]['tag']);_0x168aa0['forEach'](function(_0x363596){_0x2c538['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x363596+',%');});}if(_0x5bac2d[_0x8686('0x3d')][_0x8686('0x85')]){var _0x97a158=_0x5bac2d[_0x8686('0x3d')]['filter'][_0x8686('0x86')]('\x5c','\x5c\x5c')[_0x8686('0x86')](/'/g,'\x27\x27');if(qs[_0x8686('0x87')](_0x97a158)){_0x36dfd8['or'](_0x8686('0x88'),_0x97a158+'%')['or'](_0x8686('0x89'),_0x97a158+'%');}_0x36dfd8['or'](_0x8686('0x8a'),_0x97a158+'%');}}_0x539445[_0x8686('0x48')](_0x36dfd8);_0x539445[_0x8686('0x8b')](_0x8686('0x8c'));var _0x4e8095={'type':db[_0x8686('0x8d')][_0x8686('0x8e')][_0x8686('0x8f')],'raw':!![]};var _0x2b5b63=_0x539445[_0x8686('0x90')]();_0x2b5b63[_0x8686('0x4b')](_0x8686('0x8c'));_0x2b5b63[_0x8686('0x4b')](_0x8686('0x91'),_0x8686('0x62'));if(_0x2e3ead['order']){_0x2e3ead[_0x8686('0x46')][_0x8686('0x36')](function(_0xc9b23f){var _0x3eaa70=_0xc9b23f[0x0]==='contactName'?_0xc9b23f[0x0]:'i.'+_0xc9b23f[0x0];_0x539445[_0x8686('0x46')](_0x3eaa70,_0xc9b23f[0x1]===_0x8686('0x92')?![]:!![]);});}if(!_[_0x8686('0x77')](_0x168aa0)){_0x539445[_0x8686('0x64')](_0x2c538);_0x2b5b63['where']('t.id\x20IN\x20?',_0x168aa0);}BPromise[_0x8686('0x93')]()[_0x8686('0x2d')](function(){if(!_0x239600){if(_0x5bac2d['query'][_0x8686('0x78')])return;_0x2b5b63[_0x8686('0x48')](_0x8686('0x94'));_0x539445['where'](_0x8686('0x94'));return;}if(_0x5bac2d[_0x8686('0x95')]['role']!==_0x8686('0x96'))return;return _0x5bac2d[_0x8686('0x95')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x2baa76){if(_[_0x8686('0x77')](_0x2baa76)){_0x2b5b63['where'](_0x8686('0x97'));_0x539445[_0x8686('0x48')](_0x8686('0x97'));}else{_0x2b5b63[_0x8686('0x48')](_0x8686('0x79'),_['map'](_0x2baa76,'id'));_0x539445[_0x8686('0x48')](_0x8686('0x79'),_['map'](_0x2baa76,'id'));}});})['then'](function(){if(_0x5bac2d[_0x8686('0x95')][_0x8686('0x98')]==='agent'&&!_0x239600&&!_0x5bac2d[_0x8686('0x3d')][_0x8686('0x78')])return[];return db['sequelize'][_0x8686('0x3d')](_0x2b5b63[_0x8686('0x99')](),_0x4e8095);})[_0x8686('0x2d')](function(_0xa70def){_0x832f45['count']=_0xa70def['length'];if(_0x832f45[_0x8686('0x26')]===0x0)return[];return db[_0x8686('0x9a')][_0x8686('0x3d')](_0x4229f5[_0x8686('0x99')](),_0x4e8095)[_0x8686('0x2d')](function(_0x19f9cd){_0x393833=_[_0x8686('0x9b')](_0x19f9cd,'id');_0x4e8095=_['merge'](_0x4e8095,{'model':db[_0x8686('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5bac2d[_0x8686('0x3d')]['fields']){_0x2e3ead['attributes']['forEach'](function(_0x144ad5){_0x539445[_0x8686('0x4b')]('i.'+_0x144ad5);});}else{_0x539445[_0x8686('0x4b')](_0x8686('0x91'),'unreadMessages');_0x539445[_0x8686('0x4b')](_0x8686('0x9c'),'Account.key');_0x539445[_0x8686('0x4b')](_0x8686('0x9d'),'Account.mandatoryDisposition');_0x539445['field'](_0x8686('0x9e'),_0x8686('0x9f'));_0x539445[_0x8686('0x4b')](_0x8686('0xa0'));_0x539445[_0x8686('0x4b')](_0x8686('0xa1'),_0x8686('0xa2'));_0x539445[_0x8686('0x4b')](_0x8686('0xa3'),'Contact.lastName');_0x539445['field']('c.email',_0x8686('0xa4'));_0x539445[_0x8686('0x4b')](_0x8686('0xa5'),_0x8686('0xa6'));_0x539445[_0x8686('0x4b')](_0x8686('0xa7'),_0x8686('0xa8'));_0x539445[_0x8686('0x4b')]('c.fax',_0x8686('0xa9'));_0x539445[_0x8686('0x4b')](_0x8686('0xaa'),_0x8686('0xab'));_0x539445[_0x8686('0x4b')](_0x8686('0xac'),'Owner.internal');_0x539445['field'](_0x8686('0xad'),'TagIds');}if(_0x2e3ead[_0x8686('0x25')])_0x539445[_0x8686('0x25')](_0x2e3ead['limit']);if(_0x2e3ead[_0x8686('0x23')])_0x539445[_0x8686('0x23')](_0x2e3ead[_0x8686('0x23')]);return db[_0x8686('0x9a')][_0x8686('0x3d')](_0x539445[_0x8686('0x99')](),_0x4e8095);})[_0x8686('0x2d')](function(_0xdcb20c){if(_0xdcb20c[_0x8686('0x43')]>0x0)_0x701545[_0x8686('0x48')](_0x8686('0xae'),_['map'](_0xdcb20c,'id'));return db['sequelize'][_0x8686('0x3d')](_0x701545[_0x8686('0x99')](),_0x4e8095)[_0x8686('0x2d')](function(_0x482afb){var _0x3ef547=_[_0x8686('0xaf')](_0x482afb,_0x8686('0xb0'));var _0x10c890=[];_0xdcb20c[_0x8686('0x36')](function(_0x420582){_0x10c890[_0x8686('0x37')](updateFaxInteraction(_0x420582,_0x393833,_0x3ef547));});return BPromise[_0x8686('0xb1')](_0x10c890);});});})[_0x8686('0x2d')](function(_0x6cc9f3){_0x832f45[_0x8686('0xb2')]=_0x6cc9f3;return _0x832f45;})[_0x8686('0x2d')](respondWithFilteredResult(_0x2e379a,_0x2e3ead))[_0x8686('0x38')](handleError(_0x2e379a,null));};exports[_0x8686('0xb3')]=function(_0x4acf5f,_0x3c0c70){var _0x178f59={'raw':![],'where':{'id':_0x4acf5f[_0x8686('0xb4')]['id']}},_0x2a0924={};_0x2a0924[_0x8686('0x3c')]=_[_0x8686('0x3e')](db['FaxInteraction']['rawAttributes']);_0x2a0924['query']=_[_0x8686('0x3e')](_0x4acf5f[_0x8686('0x3d')]);_0x2a0924[_0x8686('0x3f')]=_[_0x8686('0x40')](_0x2a0924[_0x8686('0x3c')],_0x2a0924['query']);_0x178f59['attributes']=_[_0x8686('0x40')](_0x2a0924[_0x8686('0x3c')],qs[_0x8686('0x41')](_0x4acf5f[_0x8686('0x3d')][_0x8686('0x41')]));_0x178f59['attributes']=_0x178f59[_0x8686('0x42')]['length']?_0x178f59[_0x8686('0x42')]:_0x2a0924['model'];if(_0x4acf5f[_0x8686('0x3d')]['includeAll']){_0x178f59['include']=[{'all':!![]}];}_0x178f59=_[_0x8686('0xb5')]({},_0x178f59,_0x4acf5f[_0x8686('0xb6')]);return db[_0x8686('0x39')][_0x8686('0x61')](_0x178f59)['then'](handleEntityNotFound(_0x3c0c70,null))[_0x8686('0x2d')](respondWithResult(_0x3c0c70,null))[_0x8686('0x38')](handleError(_0x3c0c70,null));};exports[_0x8686('0xb7')]=function(_0x318fc8,_0x4e02dc){return db['FaxInteraction'][_0x8686('0xb7')](_0x318fc8['body'],{})['then'](respondWithResult(_0x4e02dc,0xc9))['catch'](handleError(_0x4e02dc,null));};exports[_0x8686('0x2c')]=function(_0x1f3f19,_0x1618a3){if(_0x1f3f19[_0x8686('0xb8')]['id']){delete _0x1f3f19[_0x8686('0xb8')]['id'];}return db[_0x8686('0x39')][_0x8686('0x61')]({'where':{'id':_0x1f3f19[_0x8686('0xb4')]['id']}})[_0x8686('0x2d')](handleEntityNotFound(_0x1618a3,null))[_0x8686('0x2d')](saveUpdates(_0x1f3f19[_0x8686('0xb8')],null))['then'](respondWithResult(_0x1618a3,null))[_0x8686('0x38')](handleError(_0x1618a3,null));};exports[_0x8686('0x2e')]=function(_0x3b572f,_0x30e178){return db[_0x8686('0x39')][_0x8686('0x61')]({'where':{'id':_0x3b572f['params']['id']}})['then'](handleEntityNotFound(_0x30e178,null))[_0x8686('0x2d')](removeEntity(_0x30e178,null))[_0x8686('0x38')](handleError(_0x30e178,null));};exports['describe']=function(_0x3bfe32,_0x1ad248){return db[_0x8686('0x39')][_0x8686('0xb9')]()[_0x8686('0x2d')](respondWithResult(_0x1ad248,null))[_0x8686('0x38')](handleError(_0x1ad248,null));};exports[_0x8686('0xba')]=function(_0x49fd2a,_0x4966f5,_0x476b80){return db[_0x8686('0xbb')]['find']({'where':{'id':_0x49fd2a[_0x8686('0xb4')]['id']}})[_0x8686('0x2d')](handleEntityNotFound(_0x4966f5,null))[_0x8686('0x2d')](function(_0x171da0){if(_0x171da0){return _0x171da0['addMessage'](_0x49fd2a[_0x8686('0xb8')]['ids'],_[_0x8686('0xbc')](_0x49fd2a[_0x8686('0xb8')],[_0x8686('0xbd'),'id'])||{});}})[_0x8686('0x2d')](respondWithResult(_0x4966f5,null))[_0x8686('0x38')](handleError(_0x4966f5,null));};exports[_0x8686('0xbe')]=function(_0x1d4d47,_0x19705e,_0x2059e5){var _0x51b009={'raw':![],'where':{}};var _0x164fbc={};var _0x91b607={'count':0x0,'rows':[]};return db[_0x8686('0x39')][_0x8686('0xbf')]({'where':{'id':_0x1d4d47[_0x8686('0xb4')]['id']}})[_0x8686('0x2d')](handleEntityNotFound(_0x19705e,null))[_0x8686('0x2d')](function(_0x46acbb){if(_0x46acbb){_0x164fbc[_0x8686('0x3c')]=_['keys'](db['FaxMessage'][_0x8686('0xc0')]);_0x164fbc[_0x8686('0x3d')]=_[_0x8686('0x3e')](_0x1d4d47[_0x8686('0x3d')]);_0x164fbc[_0x8686('0x3f')]=_['intersection'](_0x164fbc[_0x8686('0x3c')],_0x164fbc['query']);_0x51b009[_0x8686('0x42')]=_[_0x8686('0x40')](_0x164fbc[_0x8686('0x3c')],qs[_0x8686('0x41')](_0x1d4d47[_0x8686('0x3d')][_0x8686('0x41')]));_0x51b009[_0x8686('0x42')]=_0x51b009[_0x8686('0x42')][_0x8686('0x43')]?_0x51b009[_0x8686('0x42')]:_0x164fbc[_0x8686('0x3c')];if(!_0x1d4d47[_0x8686('0x3d')]['hasOwnProperty'](_0x8686('0x45'))){_0x51b009['limit']=qs[_0x8686('0x25')](_0x1d4d47[_0x8686('0x3d')][_0x8686('0x25')]);_0x51b009[_0x8686('0x23')]=qs[_0x8686('0x23')](_0x1d4d47['query'][_0x8686('0x23')]);}_0x51b009[_0x8686('0x46')]=qs[_0x8686('0x47')](_0x1d4d47[_0x8686('0x3d')][_0x8686('0x47')]);_0x51b009[_0x8686('0x48')]=qs['filters'](_[_0x8686('0x49')](_0x1d4d47[_0x8686('0x3d')],_0x164fbc[_0x8686('0x3f')]));_0x51b009['where'][_0x8686('0xb0')]=_0x46acbb['id'];if(_0x1d4d47[_0x8686('0x3d')]['filter']){_0x51b009['where']=_['merge'](_0x51b009[_0x8686('0x48')],{'$or':_[_0x8686('0x32')](_0x51b009[_0x8686('0x42')],function(_0xcbac0b){var _0x58daa9={};_0x58daa9[_0xcbac0b]={'$like':'%'+_0x1d4d47[_0x8686('0x3d')][_0x8686('0x85')]+'%'};return _0x58daa9;})});}if(_0x1d4d47[_0x8686('0x3d')][_0x8686('0xc1')]){var _0x12c9cd=_0x1d4d47['query'][_0x8686('0xc1')][_0x8686('0x35')](',');var _0x404699={};_0x404699[_0x12c9cd[0x0]]={'$gte':moment(_0x12c9cd[0x1])['format'](_0x8686('0xc2'))};_0x51b009[_0x8686('0x48')]=_['merge'](_0x51b009[_0x8686('0x48')],_0x404699);}_0x51b009=_[_0x8686('0xb5')]({},_0x51b009,_0x1d4d47[_0x8686('0xb6')]);return db['FaxMessage'][_0x8686('0x26')]({'where':_0x51b009[_0x8686('0x48')]})[_0x8686('0x2d')](function(_0x4a9e18){_0x91b607[_0x8686('0x26')]=_0x4a9e18;if(_0x1d4d47['query'][_0x8686('0xc3')]){_0x51b009[_0x8686('0xc4')]=[{'all':!![]}];}return db[_0x8686('0xbb')][_0x8686('0xc5')](_0x51b009);})[_0x8686('0x2d')](function(_0x224009){_0x91b607[_0x8686('0xb2')]=_0x224009;return _0x91b607;});}})['then'](respondWithFilteredResult(_0x19705e,_0x51b009))[_0x8686('0x38')](handleError(_0x19705e,null));};exports['addTags']=function(_0x3c48cb,_0x42ebac,_0x4f2a6a){return db['FaxInteraction'][_0x8686('0x61')]({'where':{'id':_0x3c48cb['params']['id']}})[_0x8686('0x2d')](handleEntityNotFound(_0x42ebac,null))[_0x8686('0x2d')](function(_0x44c6fa){if(_0x44c6fa){return _0x44c6fa[_0x8686('0xc6')](_0x3c48cb['body']['ids'],_[_0x8686('0xbc')](_0x3c48cb[_0x8686('0xb8')],['ids','id'])||{})[_0x8686('0xc7')](function(){return db[_0x8686('0x6f')][_0x8686('0xc5')]({'attributes':['id',_0x8686('0x30'),_0x8686('0xc8')],'where':{'id':_0x3c48cb[_0x8686('0xb8')][_0x8686('0xbd')]}});})[_0x8686('0x2d')](function(_0x4f3a5c){socket['emit'](_0x8686('0xc9'),{'id':Number(_0x3c48cb[_0x8686('0xb4')]['id']),'tags':_0x4f3a5c||[]});return{'id':Number(_0x3c48cb[_0x8686('0xb4')]['id']),'tags':_0x4f3a5c||[]};});}})[_0x8686('0x2d')](respondWithResult(_0x42ebac,null))[_0x8686('0x38')](handleError(_0x42ebac,null));};exports[_0x8686('0xca')]=function(_0x1a8eae,_0x182105,_0xf1e27b){return db[_0x8686('0x39')][_0x8686('0x61')]({'where':{'id':_0x1a8eae[_0x8686('0xb4')]['id']}})['then'](handleEntityNotFound(_0x182105,null))[_0x8686('0x2d')](function(_0x42ebd3){if(_0x42ebd3){return _0x42ebd3[_0x8686('0xca')](_0x1a8eae['query'][_0x8686('0xbd')]);}})['then'](respondWithStatusCode(_0x182105,null))[_0x8686('0x38')](handleError(_0x182105,null));};exports[_0x8686('0xcb')]=function(_0x5290d8,_0x656f0){var _0xcfe44b=moment()[_0x8686('0xcc')]()[_0x8686('0x99')]();var _0x476a1d=path['join'](config[_0x8686('0xcd')],_0x8686('0xce'),_0x8686('0xcf'),_0x8686('0xd0'));var _0xe6567e=path['join'](config[_0x8686('0xcd')],_0x8686('0xce'),_0x8686('0xcf'),_0x8686('0xd1'));var _0x2323a2=path[_0x8686('0xd2')](_0x476a1d,_0xcfe44b);var _0x3b119f=util['format'](_0x8686('0xd3'),_0x5290d8[_0x8686('0xb4')]['id'],_0xcfe44b);var _0x1bc05b=path['join'](_0x476a1d,_0x3b119f);var _0x193428=[];_0x193428[_0x8686('0x37')]({'model':db[_0x8686('0xd4')],'as':'Attachment','raw':!![]});var _0x88cd5d=[{'model':db[_0x8686('0xbb')],'as':_0x8686('0xd5'),'attributes':['id',_0x8686('0xb8'),'createdAt'],'include':_0x193428}];return db[_0x8686('0x39')][_0x8686('0x61')]({'where':{'id':_0x5290d8[_0x8686('0xb4')]['id']},'include':_0x88cd5d})[_0x8686('0x2d')](handleEntityNotFound(_0x656f0,null))[_0x8686('0x2d')](function(_0x2c2f00){if(_0x2c2f00&&_0x2c2f00[_0x8686('0xd5')]){var _0x103248=_0x2c2f00[_0x8686('0xd6')]({'plain':!![]});fs[_0x8686('0xd7')](_0x2323a2);for(var _0x15167a=0x0;_0x15167a<_0x103248[_0x8686('0xd5')][_0x8686('0x43')];_0x15167a++){var _0x821928=_0x103248[_0x8686('0xd5')][_0x15167a][_0x8686('0xd4')];if(_0x821928){var _0x730962=path[_0x8686('0xd2')](_0xe6567e,_0x821928[_0x8686('0xd8')]);if(fs['existsSync'](_0x730962)){fs[_0x8686('0xd9')](_0x730962)[_0x8686('0xda')](fs[_0x8686('0xdb')](path['join'](_0x2323a2,_0x821928[_0x8686('0xd8')])));}}}return BPromise[_0x8686('0x93')]()[_0x8686('0x2d')](function(){return new BPromise(function(_0x4454d0,_0x3131a2){zipdir(_0x2323a2,{'saveTo':_0x1bc05b},function(_0xeee9fa,_0x255a11){if(_0xeee9fa)return _0x3131a2(_0xeee9fa);return _0x4454d0(_0x255a11);});})['then'](function(){return new BPromise(function(_0x1bcecd,_0x1f61de){rimraf(_0x2323a2,function(_0x5b7204){if(_0x5b7204)_0x1f61de(_0x5b7204);return _0x1bcecd();});});})[_0x8686('0x2d')](function(){return _0x656f0[_0x8686('0xcb')](_0x1bc05b,_0x3b119f,function(_0x45def7){if(_0x45def7){console[_0x8686('0xdc')](_0x8686('0xdd'),_0x45def7);}else{fs[_0x8686('0xde')](_0x1bc05b);}});});});}else{return _0x656f0[_0x8686('0x21')](0xc8);}})[_0x8686('0x38')](handleError(_0x656f0,null));};
\ No newline at end of file
+var _0x3720=['format','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','addTags','setTags','omit','spread','findAll','emit','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','pipe','createWriteStream','resolve','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','save','then','error','stack','name','Users','map','TagIds','split','forEach','Tags','push','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','UserId','buildExpression','type','body','some','compact','isEmpty','FaxAccountId','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','role','toString','sequelize','keyBy','merge','FaxInteraction','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','catch','show','includeAll','create','update','params','destroy','describe','addMessage','ids','findOne','FaxMessage'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3720,0x1ca));var _0x0372=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x3720[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require(_0x0372('0x0'));var rimraf=require(_0x0372('0x1'));var zipdir=require(_0x0372('0x2'));var jsonpatch=require(_0x0372('0x3'));var rp=require(_0x0372('0x4'));var moment=require(_0x0372('0x5'));var BPromise=require(_0x0372('0x6'));var Mustache=require(_0x0372('0x7'));var util=require(_0x0372('0x8'));var path=require(_0x0372('0x9'));var sox=require(_0x0372('0xa'));var csv=require(_0x0372('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0372('0xc'));var _=require('lodash');var squel=require(_0x0372('0xd'));var crypto=require(_0x0372('0xe'));var jsforce=require(_0x0372('0xf'));var deskjs=require(_0x0372('0x10'));var toCsv=require(_0x0372('0xb'));var querystring=require(_0x0372('0x11'));var Papa=require(_0x0372('0x12'));var Redis=require(_0x0372('0x13'));var authService=require(_0x0372('0x14'));var qs=require(_0x0372('0x15'));var as=require(_0x0372('0x16'));var hardwareService=require(_0x0372('0x17'));var logger=require(_0x0372('0x18'))(_0x0372('0x19'));var utils=require(_0x0372('0x1a'));var config=require(_0x0372('0x1b'));var licenseUtil=require(_0x0372('0x1c'));var db=require(_0x0372('0x1d'))['db'];config[_0x0372('0x1e')]=_[_0x0372('0x1f')](config[_0x0372('0x1e')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0372('0x20'))[_0x0372('0x21')](socket);function respondWithStatusCode(_0x4b2fcc,_0x4310e0){_0x4310e0=_0x4310e0||0xcc;return function(_0x101ce2){if(_0x101ce2){return _0x4b2fcc[_0x0372('0x22')](_0x4310e0);}return _0x4b2fcc['status'](_0x4310e0)[_0x0372('0x23')]();};}function respondWithResult(_0x56a3b2,_0x130364){_0x130364=_0x130364||0xc8;return function(_0x22ee79){if(_0x22ee79){return _0x56a3b2[_0x0372('0x24')](_0x130364)[_0x0372('0x25')](_0x22ee79);}};}function respondWithFilteredResult(_0x3fb5b7,_0x539343){return function(_0x5bc052){if(_0x5bc052){var _0x5a4bb3=typeof _0x539343['offset']===_0x0372('0x26')&&typeof _0x539343['limit']==='undefined';var _0x5efae5=_0x5bc052[_0x0372('0x27')];var _0x1ec299=_0x5a4bb3?0x0:_0x539343[_0x0372('0x28')];var _0x1051d0=_0x5a4bb3?_0x5bc052[_0x0372('0x27')]:_0x539343[_0x0372('0x28')]+_0x539343[_0x0372('0x29')];var _0x559cc9;if(_0x1051d0>=_0x5efae5){_0x1051d0=_0x5efae5;_0x559cc9=0xc8;}else{_0x559cc9=0xce;}_0x3fb5b7[_0x0372('0x24')](_0x559cc9);return _0x3fb5b7[_0x0372('0x2a')]('Content-Range',_0x1ec299+'-'+_0x1051d0+'/'+_0x5efae5)[_0x0372('0x25')](_0x5bc052);}return null;};}function patchUpdates(_0x3ac2d0){return function(_0x4dcb90){try{jsonpatch[_0x0372('0x2b')](_0x4dcb90,_0x3ac2d0,!![]);}catch(_0x34b1c1){return BPromise['reject'](_0x34b1c1);}return _0x4dcb90[_0x0372('0x2c')]();};}function saveUpdates(_0x47249f,_0x2c3076){return function(_0x35ac0c){if(_0x35ac0c){return _0x35ac0c['update'](_0x47249f)['then'](function(_0x3bc6d5){return _0x3bc6d5;});}return null;};}function removeEntity(_0x110381,_0x42ae87){return function(_0x49b848){if(_0x49b848){return _0x49b848['destroy']()[_0x0372('0x2d')](function(){_0x110381['status'](0xcc)[_0x0372('0x23')]();});}};}function handleEntityNotFound(_0x4efd14,_0x53f905){return function(_0x543496){if(!_0x543496){_0x4efd14[_0x0372('0x22')](0x194);}return _0x543496;};}function handleError(_0x43e5b1,_0xff42b4){_0xff42b4=_0xff42b4||0x1f4;return function(_0x32ce1c){logger[_0x0372('0x2e')](_0x32ce1c[_0x0372('0x2f')]);if(_0x32ce1c['name']){delete _0x32ce1c[_0x0372('0x30')];}_0x43e5b1[_0x0372('0x24')](_0xff42b4)['send'](_0x32ce1c);};}function getInteractionUsers(_0x156d7c,_0x35fa76){return new BPromise(function(_0x4f6323,_0x50ef16){try{if(_0x35fa76[_0x156d7c['id']]){_0x156d7c[_0x0372('0x31')]=_[_0x0372('0x32')](_0x35fa76[_0x156d7c['id']],function(_0x2dffe2){return{'id':_0x2dffe2['id'],'fullname':_0x2dffe2['fullname']};});}}catch(_0x2a7c02){_0x50ef16(_0x2a7c02);}_0x4f6323(_0x156d7c);});}function getInteractionTags(_0x30444d,_0x5decb3){return new BPromise(function(_0x11cef3,_0x477d95){try{if(_0x30444d[_0x0372('0x33')]){_0x30444d['Tags']=[];_0x30444d[_0x0372('0x33')][_0x0372('0x34')](',')[_0x0372('0x35')](function(_0x433568){_0x30444d[_0x0372('0x36')][_0x0372('0x37')](_0x5decb3[_0x433568]);});}delete _0x30444d[_0x0372('0x33')];}catch(_0x1de53b){_0x477d95(_0x1de53b);}_0x11cef3(_0x30444d);});}function updateFaxInteraction(_0x61cb07,_0x291e1e,_0x1631ac){return new BPromise(function(_0x4bf622,_0x3a6636){return getInteractionUsers(_0x61cb07,_0x1631ac)[_0x0372('0x2d')](function(_0x52561f){return getInteractionTags(_0x52561f,_0x291e1e);})[_0x0372('0x2d')](function(_0x3c2f33){_0x4bf622(_0x3c2f33);})['catch'](function(_0xc93575){_0x3a6636(_0xc93575);});});}exports['index']=function(_0x4c9f7d,_0x407e73){var _0x316554={},_0x17d5f9={},_0x47c80b={'count':0x0,'rows':[]};var _0x33e6a6=_[_0x0372('0x32')](db['FaxInteraction'][_0x0372('0x38')],function(_0x548716){return{'name':_0x548716[_0x0372('0x39')],'type':_0x548716['type'][_0x0372('0x3a')]};});_0x17d5f9[_0x0372('0x3b')]=_['map'](_0x33e6a6,_0x0372('0x30'));_0x17d5f9['query']=_[_0x0372('0x3c')](_0x4c9f7d[_0x0372('0x3d')]);_0x17d5f9[_0x0372('0x3e')]=_[_0x0372('0x3f')](_0x17d5f9['model'],_0x17d5f9[_0x0372('0x3d')]);_0x316554[_0x0372('0x40')]=_[_0x0372('0x3f')](_0x17d5f9['model'],qs[_0x0372('0x41')](_0x4c9f7d[_0x0372('0x3d')]['fields']));_0x316554[_0x0372('0x40')]=_0x316554['attributes'][_0x0372('0x42')]?_0x316554[_0x0372('0x40')]:_0x17d5f9['model'];if(!_0x4c9f7d[_0x0372('0x3d')]['hasOwnProperty'](_0x0372('0x43'))){_0x316554[_0x0372('0x29')]=qs[_0x0372('0x29')](_0x4c9f7d['query'][_0x0372('0x29')]);_0x316554['offset']=qs[_0x0372('0x28')](_0x4c9f7d['query'][_0x0372('0x28')]);}_0x316554[_0x0372('0x44')]=qs[_0x0372('0x45')](_0x4c9f7d[_0x0372('0x3d')]['sort']);_0x316554[_0x0372('0x46')]=qs[_0x0372('0x3e')](_[_0x0372('0x47')](_0x4c9f7d[_0x0372('0x3d')],_0x17d5f9[_0x0372('0x3e')]),_0x33e6a6);var _0x592f14=[];var _0x569e81=squel[_0x0372('0x48')]()['field']('id')['field'](_0x0372('0x30'))[_0x0372('0x49')](_0x0372('0x4a'))[_0x0372('0x4b')](_0x0372('0x4c'));var _0x385ef6=squel[_0x0372('0x48')]()[_0x0372('0x49')](_0x0372('0x4d'))[_0x0372('0x49')](_0x0372('0x4e'))[_0x0372('0x49')](_0x0372('0x4f'))[_0x0372('0x4b')](_0x0372('0x50'),'ui')[_0x0372('0x51')](_0x0372('0x52'),'u',_0x0372('0x53'));var _0x8f38fd=squel[_0x0372('0x48')]()['from']('fax_interactions','i')[_0x0372('0x51')](_0x0372('0x54'),'c',_0x0372('0x55'))[_0x0372('0x51')]('users','o',_0x0372('0x56'))[_0x0372('0x51')](_0x0372('0x57'),'a',_0x0372('0x58'))[_0x0372('0x51')](_0x0372('0x59'),'me',_0x0372('0x5a'))['left_join'](_0x0372('0x5b'),'it',_0x0372('0x5c'))[_0x0372('0x51')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5ab659=squel['expr']();var _0x10d2d1=[];var _0xe1a3d7=squel[_0x0372('0x5d')]();var _0x30cbc4;if(_0x4c9f7d[_0x0372('0x3d')][_0x0372('0x5e')]){_0x30cbc4=as[_0x0372('0x5f')](_0x4c9f7d[_0x0372('0x3d')][_0x0372('0x5e')]);var _0x5aac4e=_0x30cbc4[_0x0372('0x60')];for(var _0xa3f2b6=0x0;_0xa3f2b6<_0x30cbc4[_0x0372('0x61')]['length'];_0xa3f2b6++){var _0x4c2740=_0x30cbc4[_0x0372('0x61')][_0xa3f2b6];var _0x24a575='i';var _0x40c4c1=_[_0x0372('0x62')](_0x33e6a6,[_0x0372('0x30'),_0x4c2740[_0x0372('0x49')]]);if(!_0x40c4c1){switch(_0x4c2740[_0x0372('0x49')]){case _0x0372('0x63'):if(_0x4c2740[_0x0372('0x64')]==0x1){_0x8f38fd[_0x0372('0x65')]('`'+_0x4c2740[_0x0372('0x49')]+_0x0372('0x66'));}else{_0x8f38fd[_0x0372('0x65')]('`'+_0x4c2740[_0x0372('0x49')]+_0x0372('0x67'));}break;case _0x0372('0x68'):if(_0x4c2740[_0x0372('0x69')]===_0x0372('0x6a')){if(_0x4c2740['value'][_0x0372('0x34')]('\x20')[_0x0372('0x42')]>0x1){_0x5ab659[_0x5aac4e](_0x0372('0x6b'),qs['getFullTextValue'](_0x4c2740[_0x0372('0x64')]),null);}else{var _0x28d4d5='%'+_0x4c2740['value']+'%';_0x5ab659[_0x5aac4e](_0x0372('0x6c'),_0x28d4d5,_0x28d4d5,_0x28d4d5);}}else{_0x40c4c1=_[_0x0372('0x62')](_0x33e6a6,[_0x0372('0x30'),_0x0372('0x6d')]);_0x4c2740[_0x0372('0x49')]=_0x0372('0x6d');_0x33b9ae=as['buildExpression'](_0x24a575,_0x40c4c1['type'],_0x4c2740);_0x5ab659[_0x5aac4e](_0x33b9ae[_0x0372('0x6e')],_0x33b9ae[_0x0372('0x64')][_0x0372('0x6f')],_0x33b9ae[_0x0372('0x64')][_0x0372('0x23')]);}break;case _0x0372('0x70'):var _0x10d81c=_0x4c2740[_0x0372('0x64')][_0x0372('0x34')](',')['map'](function(_0x84b7f9){return Number(_0x84b7f9);});_0x10d81c['forEach'](function(_0x5ab16c){_0xe1a3d7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ab16c+',%');});_0x10d2d1=_['union'](_0x10d2d1,_0x10d81c);break;case'User':if(_0x4c2740['operator']===_0x0372('0x6a')){_0x5ab659[_0x5aac4e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4c2740['value']+'%',null);}else{_0x40c4c1=_[_0x0372('0x62')](_0x33e6a6,['name','UserId']);_0x4c2740[_0x0372('0x49')]=_0x0372('0x71');_0x33b9ae=as[_0x0372('0x72')](_0x24a575,_0x40c4c1[_0x0372('0x73')],_0x4c2740);_0x5ab659[_0x5aac4e](_0x33b9ae['text'],_0x33b9ae['value'][_0x0372('0x6f')],_0x33b9ae[_0x0372('0x64')][_0x0372('0x23')]);}break;case _0x0372('0x74'):_0x33b9ae=as[_0x0372('0x72')]('me',null,_0x4c2740);_0x5ab659[_0x5aac4e](_0x33b9ae[_0x0372('0x6e')],_0x33b9ae[_0x0372('0x64')][_0x0372('0x6f')],_0x33b9ae[_0x0372('0x64')][_0x0372('0x23')]);break;}}else{var _0x33b9ae=as[_0x0372('0x72')](_0x24a575,_0x40c4c1[_0x0372('0x73')],_0x4c2740);_0x5ab659[_0x5aac4e](_0x33b9ae['text'],_0x33b9ae[_0x0372('0x64')][_0x0372('0x6f')],_0x33b9ae[_0x0372('0x64')][_0x0372('0x23')]);}}}else{var _0x441832=_(_0x4c9f7d[_0x0372('0x3d')])['keys']()['map'](function(_0xc482c1){return _[_0x0372('0x75')](_0x33e6a6,[_0x0372('0x30'),_0xc482c1])?_0xc482c1:undefined;})[_0x0372('0x76')]()[_0x0372('0x64')]();if(!_[_0x0372('0x77')](_0x441832)){_0x441832[_0x0372('0x35')](function(_0xd7fe5c){if(_0xd7fe5c===_0x0372('0x78')){_0x8f38fd[_0x0372('0x46')]('i.FaxAccountId\x20IN\x20?',[][_0x0372('0x79')](_0x4c9f7d[_0x0372('0x3d')][_0xd7fe5c]));}else if(_0xd7fe5c===_0x0372('0x7a')){var _0x23a4fc=JSON[_0x0372('0x7b')](_0x4c9f7d[_0x0372('0x3d')][_0xd7fe5c])[_0x0372('0x7c')];var _0xcec295=JSON['parse'](_0x4c9f7d[_0x0372('0x3d')][_0xd7fe5c])['$lte'];_0x8f38fd['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x23a4fc,_0xcec295);}else{if(_0x4c9f7d['query'][_0xd7fe5c]===_0x0372('0x7d')){_0x8f38fd[_0x0372('0x46')]('i.'+_0xd7fe5c+_0x0372('0x7e'));}else{_0x8f38fd[_0x0372('0x46')]('i.'+_0xd7fe5c+'\x20=\x20?',_0x4c9f7d[_0x0372('0x3d')][_0xd7fe5c]);}}});}if(_0x4c9f7d[_0x0372('0x3d')][_0x0372('0x7f')]){if(_0x4c9f7d['query']['read']==0x1){_0x8f38fd[_0x0372('0x65')](_0x0372('0x80'));}else{_0x8f38fd['having'](_0x0372('0x81'));}}if(_0x4c9f7d[_0x0372('0x3d')]['tag']){_0x10d2d1=_['isArray'](_0x4c9f7d[_0x0372('0x3d')][_0x0372('0x82')])?_0x4c9f7d[_0x0372('0x3d')][_0x0372('0x82')]:new Array(_0x4c9f7d[_0x0372('0x3d')]['tag']);_0x10d2d1[_0x0372('0x35')](function(_0x37a69d){_0xe1a3d7['or'](_0x0372('0x83'),'%,'+_0x37a69d+',%');});}if(_0x4c9f7d[_0x0372('0x3d')]['filter']){var _0x2dd938=_0x4c9f7d[_0x0372('0x3d')][_0x0372('0x84')]['replace']('\x5c','\x5c\x5c')[_0x0372('0x85')](/'/g,'\x27\x27');if(qs[_0x0372('0x86')](_0x2dd938)){_0x5ab659['or']('i.id\x20LIKE\x20?',_0x2dd938+'%')['or'](_0x0372('0x87'),_0x2dd938+'%');}_0x5ab659['or'](_0x0372('0x88'),_0x2dd938+'%');}}_0x8f38fd[_0x0372('0x46')](_0x5ab659);_0x8f38fd['group'](_0x0372('0x89'));var _0x3b8a35={'type':db[_0x0372('0x8a')]['QueryTypes']['SELECT'],'raw':!![]};var _0x395168=_0x8f38fd['clone']();_0x395168[_0x0372('0x49')](_0x0372('0x89'));_0x395168[_0x0372('0x49')](_0x0372('0x8b'),_0x0372('0x63'));if(_0x316554[_0x0372('0x44')]){_0x316554[_0x0372('0x44')][_0x0372('0x35')](function(_0xb958c5){var _0x5058d2=_0xb958c5[0x0]===_0x0372('0x8c')?_0xb958c5[0x0]:'i.'+_0xb958c5[0x0];_0x8f38fd[_0x0372('0x44')](_0x5058d2,_0xb958c5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0372('0x77')](_0x10d2d1)){_0x8f38fd[_0x0372('0x65')](_0xe1a3d7);_0x395168[_0x0372('0x46')](_0x0372('0x8d'),_0x10d2d1);}BPromise['resolve']()[_0x0372('0x2d')](function(){if(!_0x30cbc4){if(_0x4c9f7d['query'][_0x0372('0x78')])return;_0x395168[_0x0372('0x46')](_0x0372('0x8e'));_0x8f38fd[_0x0372('0x46')](_0x0372('0x8e'));return;}if(_0x4c9f7d[_0x0372('0x8f')]['role']!==_0x0372('0x90'))return;return _0x4c9f7d['user'][_0x0372('0x91')]({'attributes':['id'],'raw':!![]})[_0x0372('0x2d')](function(_0x2172c3){if(_[_0x0372('0x77')](_0x2172c3)){_0x395168[_0x0372('0x46')](_0x0372('0x92'));_0x8f38fd['where'](_0x0372('0x92'));}else{_0x395168['where'](_0x0372('0x93'),_[_0x0372('0x32')](_0x2172c3,'id'));_0x8f38fd[_0x0372('0x46')]('i.FaxAccountId\x20IN\x20?',_[_0x0372('0x32')](_0x2172c3,'id'));}});})[_0x0372('0x2d')](function(){if(_0x4c9f7d[_0x0372('0x8f')][_0x0372('0x94')]===_0x0372('0x90')&&!_0x30cbc4&&!_0x4c9f7d[_0x0372('0x3d')][_0x0372('0x78')])return[];return db['sequelize']['query'](_0x395168[_0x0372('0x95')](),_0x3b8a35);})[_0x0372('0x2d')](function(_0x377329){_0x47c80b[_0x0372('0x27')]=_0x377329['length'];if(_0x47c80b[_0x0372('0x27')]===0x0)return[];return db[_0x0372('0x96')][_0x0372('0x3d')](_0x569e81[_0x0372('0x95')](),_0x3b8a35)[_0x0372('0x2d')](function(_0x4ce930){_0x592f14=_[_0x0372('0x97')](_0x4ce930,'id');_0x3b8a35=_[_0x0372('0x98')](_0x3b8a35,{'model':db[_0x0372('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c9f7d[_0x0372('0x3d')][_0x0372('0x41')]){_0x316554[_0x0372('0x40')][_0x0372('0x35')](function(_0x1971de){_0x8f38fd[_0x0372('0x49')]('i.'+_0x1971de);});}else{_0x8f38fd[_0x0372('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0372('0x63'));_0x8f38fd[_0x0372('0x49')](_0x0372('0x9a'),_0x0372('0x9b'));_0x8f38fd[_0x0372('0x49')]('a.mandatoryDisposition',_0x0372('0x9c'));_0x8f38fd['field'](_0x0372('0x9d'),_0x0372('0x8c'));_0x8f38fd[_0x0372('0x49')](_0x0372('0x9e'));_0x8f38fd[_0x0372('0x49')]('c.firstName',_0x0372('0x9f'));_0x8f38fd[_0x0372('0x49')]('c.lastName',_0x0372('0xa0'));_0x8f38fd[_0x0372('0x49')](_0x0372('0xa1'),_0x0372('0xa2'));_0x8f38fd[_0x0372('0x49')](_0x0372('0xa3'),_0x0372('0xa4'));_0x8f38fd[_0x0372('0x49')]('c.mobile','Contact.mobile');_0x8f38fd[_0x0372('0x49')]('c.fax',_0x0372('0xa5'));_0x8f38fd['field']('o.fullname','Owner.fullname');_0x8f38fd['field'](_0x0372('0xa6'),_0x0372('0xa7'));_0x8f38fd[_0x0372('0x49')](_0x0372('0xa8'),_0x0372('0x33'));}if(_0x316554[_0x0372('0x29')])_0x8f38fd[_0x0372('0x29')](_0x316554['limit']);if(_0x316554[_0x0372('0x28')])_0x8f38fd['offset'](_0x316554[_0x0372('0x28')]);return db[_0x0372('0x96')][_0x0372('0x3d')](_0x8f38fd[_0x0372('0x95')](),_0x3b8a35);})[_0x0372('0x2d')](function(_0x5ec68e){if(_0x5ec68e['length']>0x0)_0x385ef6[_0x0372('0x46')](_0x0372('0xa9'),_[_0x0372('0x32')](_0x5ec68e,'id'));return db[_0x0372('0x96')][_0x0372('0x3d')](_0x385ef6['toString'](),_0x3b8a35)[_0x0372('0x2d')](function(_0x3b9bb6){var _0x5a0400=_[_0x0372('0xaa')](_0x3b9bb6,_0x0372('0xab'));var _0x4bd323=[];_0x5ec68e[_0x0372('0x35')](function(_0x2eef57){_0x4bd323[_0x0372('0x37')](updateFaxInteraction(_0x2eef57,_0x592f14,_0x5a0400));});return BPromise['all'](_0x4bd323);});});})['then'](function(_0x5954c3){_0x47c80b['rows']=_0x5954c3;return _0x47c80b;})['then'](respondWithFilteredResult(_0x407e73,_0x316554))[_0x0372('0xac')](handleError(_0x407e73,null));};exports[_0x0372('0xad')]=function(_0x1129d9,_0x2a637b){var _0x43d922={'raw':![],'where':{'id':_0x1129d9['params']['id']}},_0x4eaa6e={};_0x4eaa6e[_0x0372('0x3b')]=_['keys'](db[_0x0372('0x99')]['rawAttributes']);_0x4eaa6e[_0x0372('0x3d')]=_[_0x0372('0x3c')](_0x1129d9[_0x0372('0x3d')]);_0x4eaa6e['filters']=_[_0x0372('0x3f')](_0x4eaa6e['model'],_0x4eaa6e[_0x0372('0x3d')]);_0x43d922[_0x0372('0x40')]=_[_0x0372('0x3f')](_0x4eaa6e['model'],qs[_0x0372('0x41')](_0x1129d9[_0x0372('0x3d')][_0x0372('0x41')]));_0x43d922[_0x0372('0x40')]=_0x43d922[_0x0372('0x40')]['length']?_0x43d922['attributes']:_0x4eaa6e[_0x0372('0x3b')];if(_0x1129d9[_0x0372('0x3d')][_0x0372('0xae')]){_0x43d922['include']=[{'all':!![]}];}_0x43d922=_[_0x0372('0x98')]({},_0x43d922,_0x1129d9['options']);return db[_0x0372('0x99')][_0x0372('0x62')](_0x43d922)[_0x0372('0x2d')](handleEntityNotFound(_0x2a637b,null))[_0x0372('0x2d')](respondWithResult(_0x2a637b,null))['catch'](handleError(_0x2a637b,null));};exports[_0x0372('0xaf')]=function(_0x15c420,_0x1acb6a){return db[_0x0372('0x99')][_0x0372('0xaf')](_0x15c420['body'],{})[_0x0372('0x2d')](respondWithResult(_0x1acb6a,0xc9))[_0x0372('0xac')](handleError(_0x1acb6a,null));};exports[_0x0372('0xb0')]=function(_0xad6f05,_0x5b62f5){if(_0xad6f05['body']['id']){delete _0xad6f05[_0x0372('0x74')]['id'];}return db[_0x0372('0x99')][_0x0372('0x62')]({'where':{'id':_0xad6f05[_0x0372('0xb1')]['id']}})[_0x0372('0x2d')](handleEntityNotFound(_0x5b62f5,null))[_0x0372('0x2d')](saveUpdates(_0xad6f05[_0x0372('0x74')],null))[_0x0372('0x2d')](respondWithResult(_0x5b62f5,null))[_0x0372('0xac')](handleError(_0x5b62f5,null));};exports[_0x0372('0xb2')]=function(_0x55aabe,_0x5766f3){return db[_0x0372('0x99')][_0x0372('0x62')]({'where':{'id':_0x55aabe[_0x0372('0xb1')]['id']}})['then'](handleEntityNotFound(_0x5766f3,null))[_0x0372('0x2d')](removeEntity(_0x5766f3,null))[_0x0372('0xac')](handleError(_0x5766f3,null));};exports[_0x0372('0xb3')]=function(_0x3971a8,_0x351d05){return db['FaxInteraction'][_0x0372('0xb3')]()[_0x0372('0x2d')](respondWithResult(_0x351d05,null))[_0x0372('0xac')](handleError(_0x351d05,null));};exports[_0x0372('0xb4')]=function(_0x43d26d,_0x36d755,_0x5b1c0a){return db['FaxMessage'][_0x0372('0x62')]({'where':{'id':_0x43d26d[_0x0372('0xb1')]['id']}})[_0x0372('0x2d')](handleEntityNotFound(_0x36d755,null))['then'](function(_0x285dea){if(_0x285dea){return _0x285dea['addMessage'](_0x43d26d['body'][_0x0372('0xb5')],_['omit'](_0x43d26d[_0x0372('0x74')],[_0x0372('0xb5'),'id'])||{});}})[_0x0372('0x2d')](respondWithResult(_0x36d755,null))[_0x0372('0xac')](handleError(_0x36d755,null));};exports['getMessages']=function(_0x5aa522,_0x2a0719,_0x3db6db){var _0x19c351={'raw':![],'where':{}};var _0x50ede4={};var _0x2dd982={'count':0x0,'rows':[]};return db[_0x0372('0x99')][_0x0372('0xb6')]({'where':{'id':_0x5aa522[_0x0372('0xb1')]['id']}})[_0x0372('0x2d')](handleEntityNotFound(_0x2a0719,null))[_0x0372('0x2d')](function(_0x5f5b3f){if(_0x5f5b3f){_0x50ede4[_0x0372('0x3b')]=_[_0x0372('0x3c')](db[_0x0372('0xb7')][_0x0372('0x38')]);_0x50ede4['query']=_['keys'](_0x5aa522[_0x0372('0x3d')]);_0x50ede4[_0x0372('0x3e')]=_[_0x0372('0x3f')](_0x50ede4[_0x0372('0x3b')],_0x50ede4['query']);_0x19c351[_0x0372('0x40')]=_[_0x0372('0x3f')](_0x50ede4[_0x0372('0x3b')],qs[_0x0372('0x41')](_0x5aa522['query'][_0x0372('0x41')]));_0x19c351['attributes']=_0x19c351[_0x0372('0x40')][_0x0372('0x42')]?_0x19c351['attributes']:_0x50ede4[_0x0372('0x3b')];if(!_0x5aa522['query']['hasOwnProperty'](_0x0372('0x43'))){_0x19c351['limit']=qs[_0x0372('0x29')](_0x5aa522[_0x0372('0x3d')][_0x0372('0x29')]);_0x19c351['offset']=qs[_0x0372('0x28')](_0x5aa522[_0x0372('0x3d')]['offset']);}_0x19c351[_0x0372('0x44')]=qs[_0x0372('0x45')](_0x5aa522[_0x0372('0x3d')][_0x0372('0x45')]);_0x19c351[_0x0372('0x46')]=qs[_0x0372('0x3e')](_[_0x0372('0x47')](_0x5aa522['query'],_0x50ede4[_0x0372('0x3e')]));_0x19c351['where']['FaxInteractionId']=_0x5f5b3f['id'];if(_0x5aa522[_0x0372('0x3d')][_0x0372('0x84')]){_0x19c351[_0x0372('0x46')]=_['merge'](_0x19c351['where'],{'$or':_[_0x0372('0x32')](_0x19c351[_0x0372('0x40')],function(_0xdacfa7){var _0x3cb397={};_0x3cb397[_0xdacfa7]={'$like':'%'+_0x5aa522['query'][_0x0372('0x84')]+'%'};return _0x3cb397;})});}if(_0x5aa522[_0x0372('0x3d')][_0x0372('0x7c')]){var _0x58491d=_0x5aa522['query']['$gte'][_0x0372('0x34')](',');var _0x56c770={};_0x56c770[_0x58491d[0x0]]={'$gte':moment(_0x58491d[0x1])[_0x0372('0xb8')](_0x0372('0xb9'))};_0x19c351[_0x0372('0x46')]=_[_0x0372('0x98')](_0x19c351['where'],_0x56c770);}_0x19c351=_[_0x0372('0x98')]({},_0x19c351,_0x5aa522[_0x0372('0xba')]);return db[_0x0372('0xb7')][_0x0372('0x27')]({'where':_0x19c351[_0x0372('0x46')]})[_0x0372('0x2d')](function(_0xf9754){_0x2dd982[_0x0372('0x27')]=_0xf9754;if(_0x5aa522[_0x0372('0x3d')]['includeAll']){_0x19c351[_0x0372('0xbb')]=[{'all':!![]}];}return db[_0x0372('0xb7')]['findAll'](_0x19c351);})[_0x0372('0x2d')](function(_0x40fc68){_0x2dd982[_0x0372('0xbc')]=_0x40fc68;return _0x2dd982;});}})[_0x0372('0x2d')](respondWithFilteredResult(_0x2a0719,_0x19c351))[_0x0372('0xac')](handleError(_0x2a0719,null));};exports[_0x0372('0xbd')]=function(_0xdbbcc7,_0x50a53c,_0x48d04a){return db[_0x0372('0x99')][_0x0372('0x62')]({'where':{'id':_0xdbbcc7[_0x0372('0xb1')]['id']}})[_0x0372('0x2d')](handleEntityNotFound(_0x50a53c,null))[_0x0372('0x2d')](function(_0x5abbc1){if(_0x5abbc1){return _0x5abbc1[_0x0372('0xbe')](_0xdbbcc7[_0x0372('0x74')][_0x0372('0xb5')],_[_0x0372('0xbf')](_0xdbbcc7[_0x0372('0x74')],['ids','id'])||{})[_0x0372('0xc0')](function(){return db[_0x0372('0x70')][_0x0372('0xc1')]({'attributes':['id',_0x0372('0x30'),_0x0372('0x4a')],'where':{'id':_0xdbbcc7[_0x0372('0x74')][_0x0372('0xb5')]}});})['then'](function(_0x5bd345){socket[_0x0372('0xc2')]('faxInteractionTags:save',{'id':Number(_0xdbbcc7[_0x0372('0xb1')]['id']),'tags':_0x5bd345||[]});return{'id':Number(_0xdbbcc7[_0x0372('0xb1')]['id']),'tags':_0x5bd345||[]};});}})[_0x0372('0x2d')](respondWithResult(_0x50a53c,null))[_0x0372('0xac')](handleError(_0x50a53c,null));};exports[_0x0372('0xc3')]=function(_0x24fc6c,_0x142003,_0x940c43){return db[_0x0372('0x99')][_0x0372('0x62')]({'where':{'id':_0x24fc6c[_0x0372('0xb1')]['id']}})['then'](handleEntityNotFound(_0x142003,null))[_0x0372('0x2d')](function(_0x23ae81){if(_0x23ae81){return _0x23ae81[_0x0372('0xc3')](_0x24fc6c[_0x0372('0x3d')][_0x0372('0xb5')]);}})[_0x0372('0x2d')](respondWithStatusCode(_0x142003,null))[_0x0372('0xac')](handleError(_0x142003,null));};exports[_0x0372('0xc4')]=function(_0x32a5bb,_0x22c69e){var _0x13bf04=moment()[_0x0372('0xc5')]()[_0x0372('0x95')]();var _0x789a34=path[_0x0372('0xc6')](config[_0x0372('0xc7')],_0x0372('0xc8'),_0x0372('0xc9'),'tmp');var _0x3d4538=path[_0x0372('0xc6')](config[_0x0372('0xc7')],_0x0372('0xc8'),_0x0372('0xc9'),'attachments');var _0x49db8d=path[_0x0372('0xc6')](_0x789a34,_0x13bf04);var _0x1ac944=util[_0x0372('0xb8')](_0x0372('0xca'),_0x32a5bb[_0x0372('0xb1')]['id'],_0x13bf04);var _0x47ee47=path[_0x0372('0xc6')](_0x789a34,_0x1ac944);var _0x5c17f5=[];_0x5c17f5[_0x0372('0x37')]({'model':db[_0x0372('0xcb')],'as':_0x0372('0xcb'),'raw':!![]});var _0x48d62a=[{'model':db['FaxMessage'],'as':_0x0372('0xcc'),'attributes':['id',_0x0372('0x74'),_0x0372('0x7a')],'include':_0x5c17f5}];return db['FaxInteraction'][_0x0372('0x62')]({'where':{'id':_0x32a5bb[_0x0372('0xb1')]['id']},'include':_0x48d62a})[_0x0372('0x2d')](handleEntityNotFound(_0x22c69e,null))[_0x0372('0x2d')](function(_0x5814ac){if(_0x5814ac&&_0x5814ac[_0x0372('0xcc')]){var _0x14c950=_0x5814ac['get']({'plain':!![]});fs[_0x0372('0xcd')](_0x49db8d);for(var _0x4dde0c=0x0;_0x4dde0c<_0x14c950[_0x0372('0xcc')][_0x0372('0x42')];_0x4dde0c++){var _0x45aa8c=_0x14c950[_0x0372('0xcc')][_0x4dde0c]['Attachment'];if(_0x45aa8c){var _0x4fc2ab=path['join'](_0x3d4538,_0x45aa8c[_0x0372('0xce')]);if(fs[_0x0372('0xcf')](_0x4fc2ab)){fs['createReadStream'](_0x4fc2ab)[_0x0372('0xd0')](fs[_0x0372('0xd1')](path['join'](_0x49db8d,_0x45aa8c[_0x0372('0xce')])));}}}return BPromise[_0x0372('0xd2')]()[_0x0372('0x2d')](function(){return new BPromise(function(_0x338661,_0xb5bee4){zipdir(_0x49db8d,{'saveTo':_0x47ee47},function(_0x1c4c6a,_0x339dc3){if(_0x1c4c6a)return _0xb5bee4(_0x1c4c6a);return _0x338661(_0x339dc3);});})[_0x0372('0x2d')](function(){return new BPromise(function(_0x5d362b,_0x5d1a8e){rimraf(_0x49db8d,function(_0xf069e0){if(_0xf069e0)_0x5d1a8e(_0xf069e0);return _0x5d362b();});});})[_0x0372('0x2d')](function(){return _0x22c69e[_0x0372('0xc4')](_0x47ee47,_0x1ac944,function(_0x240824){if(_0x240824){console[_0x0372('0xd3')](_0x0372('0xd4'),_0x240824);}else{fs[_0x0372('0xd5')](_0x47ee47);}});});});}else{return _0x22c69e['sendStatus'](0xc8);}})[_0x0372('0xac')](handleError(_0x22c69e,null));};
\ No newline at end of file
index bfed875..4ed8a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x190f=['FaxMessage','save','remove','then','map','findAll','unreadMessages','length','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5d2fea,_0x55edc9){var _0x1c1cba=function(_0x1e5112){while(--_0x1e5112){_0x5d2fea['push'](_0x5d2fea['shift']());}};_0x1c1cba(++_0x55edc9);}(_0x190f,0x73));var _0xf190=function(_0x56df2d,_0x4bbe6f){_0x56df2d=_0x56df2d-0x0;var _0xd53599=_0x190f[_0x56df2d];return _0xd53599;};'use strict';var EventEmitter=require(_0xf190('0x0'));var FaxInteraction=require(_0xf190('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xf190('0x1'))['db'][_0xf190('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf190('0x3'),'afterUpdate':'update','afterDestroy':_0xf190('0x4')};function emitEvent(_0xa87646){return function(_0x488c08,_0x3ad61f,_0x541694){_0x488c08['getUsers']({'attributes':['id'],'raw':!![]})[_0xf190('0x5')](function(_0x34de23){_0x488c08['setDataValue']('Users',_0x34de23[_0xf190('0x6')](function(_0x3f49a5){return{'id':_0x3f49a5['id']};}));return FaxMessage[_0xf190('0x7')]({'where':{'FaxInteractionId':_0x488c08['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf190('0x5')](function(_0xba439d){_0x488c08['setDataValue'](_0xf190('0x8'),_0xba439d[_0xf190('0x9')]);FaxInteractionEvents['emit'](_0xa87646+':'+_0x488c08['id'],_0x488c08);FaxInteractionEvents['emit'](_0xa87646,_0x488c08);_0x541694(null);})[_0xf190('0xa')](_0x541694(null));};}for(var e in events){if(events[_0xf190('0xb')](e)){var event=events[e];FaxInteraction[_0xf190('0xc')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0x89d4=['exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','remove','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x3dd0b9,_0x1d6c92){var _0x4c0351=function(_0x2cf6a8){while(--_0x2cf6a8){_0x3dd0b9['push'](_0x3dd0b9['shift']());}};_0x4c0351(++_0x1d6c92);}(_0x89d4,0x1e1));var _0x489d=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0x89d4[_0x235482];return _0x5f5bea;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x489d('0x0'))['db'][_0x489d('0x1')];var FaxMessage=require(_0x489d('0x0'))['db'][_0x489d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x489d('0x3')](0x0);var events={'afterCreate':_0x489d('0x4'),'afterUpdate':'update','afterDestroy':_0x489d('0x5')};function emitEvent(_0x509322){return function(_0x2667af,_0x4fd180,_0x398cae){_0x2667af['getUsers']({'attributes':['id'],'raw':!![]})[_0x489d('0x6')](function(_0x898e20){_0x2667af[_0x489d('0x7')](_0x489d('0x8'),_0x898e20['map'](function(_0x24d6a8){return{'id':_0x24d6a8['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x2667af['id'],'direction':'in','read':![]},'raw':!![]});})[_0x489d('0x6')](function(_0x4c7ccf){_0x2667af[_0x489d('0x7')](_0x489d('0x9'),_0x4c7ccf[_0x489d('0xa')]);FaxInteractionEvents[_0x489d('0xb')](_0x509322+':'+_0x2667af['id'],_0x2667af);FaxInteractionEvents['emit'](_0x509322,_0x2667af);_0x398cae(null);})[_0x489d('0xc')](_0x398cae(null));};}for(var e in events){if(events[_0x489d('0xd')](e)){var event=events[e];FaxInteraction[_0x489d('0xe')](e,emitEvent(event));}}module[_0x489d('0xf')]=FaxInteractionEvents;
\ No newline at end of file
index 86d2692..6e6e2da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c4b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format'];(function(_0xe7d561,_0x146cef){var _0x4c27f0=function(_0x287ac7){while(--_0x287ac7){_0xe7d561['push'](_0xe7d561['shift']());}};_0x4c27f0(++_0x146cef);}(_0x9c4b,0x14a));var _0xb9c4=function(_0x4bddba,_0xf1dcdd){_0x4bddba=_0x4bddba-0x0;var _0x26eb93=_0x9c4b[_0x4bddba];return _0x26eb93;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb9c4('0x0'))(_0xb9c4('0x1'));var moment=require(_0xb9c4('0x2'));var BPromise=require(_0xb9c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9c4('0x4'));var rimraf=require(_0xb9c4('0x5'));var config=require(_0xb9c4('0x6'));var attributes=require(_0xb9c4('0x7'));module[_0xb9c4('0x8')]=function(_0x2433e6,_0x4b96f8){return _0x2433e6['define'](_0xb9c4('0x9'),attributes,{'tableName':_0xb9c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x558bb4,_0x48a598,_0x54d2ec){if(_0x558bb4[_0xb9c4('0xb')](_0xb9c4('0xc'))){_0x558bb4[_0xb9c4('0xd')]=moment()[_0xb9c4('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x54d2ec(null,_0x558bb4);}}});};
\ No newline at end of file
+var _0x8742=['./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x5c02a8,_0x323419){var _0x157ea7=function(_0x1e99ea){while(--_0x1e99ea){_0x5c02a8['push'](_0x5c02a8['shift']());}};_0x157ea7(++_0x323419);}(_0x8742,0xe9));var _0x2874=function(_0x105c50,_0x29ba3e){_0x105c50=_0x105c50-0x0;var _0x570327=_0x8742[_0x105c50];return _0x570327;};'use strict';var _=require(_0x2874('0x0'));var util=require(_0x2874('0x1'));var logger=require(_0x2874('0x2'))('api');var moment=require(_0x2874('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2874('0x4'));var rimraf=require(_0x2874('0x5'));var config=require(_0x2874('0x6'));var attributes=require(_0x2874('0x7'));module[_0x2874('0x8')]=function(_0x28fdb7,_0xb3ba8){return _0x28fdb7['define'](_0x2874('0x9'),attributes,{'tableName':_0x2874('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56730c,_0x317517,_0x23f55b){if(_0x56730c[_0x2874('0xb')](_0x2874('0xc'))){_0x56730c[_0x2874('0xd')]=moment()[_0x2874('0xe')](_0x2874('0xf'));}_0x23f55b(null,_0x56730c);}}});};
\ No newline at end of file
index 67eb680..88bfd99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04eb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','AddTagsToFaxInteraction','find','ids','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1a9436,_0x1f9d2b){var _0x5c1867=function(_0x2e4131){while(--_0x2e4131){_0x1a9436['push'](_0x1a9436['shift']());}};_0x5c1867(++_0x1f9d2b);}(_0x04eb,0x76));var _0xb04e=function(_0x5d64b7,_0x47cc37){_0x5d64b7=_0x5d64b7-0x0;var _0x327642=_0x04eb[_0x5d64b7];return _0x327642;};'use strict';var _=require(_0xb04e('0x0'));var util=require('util');var moment=require(_0xb04e('0x1'));var BPromise=require(_0xb04e('0x2'));var rs=require(_0xb04e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb04e('0x4'))['db'];var utils=require(_0xb04e('0x5'));var logger=require(_0xb04e('0x6'))(_0xb04e('0x7'));var config=require(_0xb04e('0x8'));var jayson=require(_0xb04e('0x9'));var client=jayson[_0xb04e('0xa')][_0xb04e('0xb')]({'port':0x232a});config[_0xb04e('0xc')]=_[_0xb04e('0xd')](config[_0xb04e('0xc')],{'host':_0xb04e('0xe'),'port':0x18eb});var socket=require(_0xb04e('0xf'))(new Redis(config[_0xb04e('0xc')]));require('./faxInteraction.socket')[_0xb04e('0x10')](socket);function respondWithRpcPromise(_0x462f7a,_0x3c9be0,_0x26d171){return new BPromise(function(_0xb87a78,_0x46b417){return client[_0xb04e('0x11')](_0x462f7a,_0x26d171)[_0xb04e('0x12')](function(_0x332814){logger[_0xb04e('0x13')](_0xb04e('0x14'),_0x3c9be0,_0xb04e('0x15'));logger[_0xb04e('0x16')](_0xb04e('0x17'),_0x3c9be0,'request\x20sent',JSON[_0xb04e('0x18')](_0x332814));if(_0x332814[_0xb04e('0x19')]){if(_0x332814[_0xb04e('0x19')][_0xb04e('0x1a')]===0x1f4){logger['error'](_0xb04e('0x14'),_0x3c9be0,_0x332814[_0xb04e('0x19')][_0xb04e('0x1b')]);return _0x46b417(_0x332814['error'][_0xb04e('0x1b')]);}logger[_0xb04e('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x3c9be0,_0x332814['error'][_0xb04e('0x1b')]);return _0xb87a78(_0x332814[_0xb04e('0x19')][_0xb04e('0x1b')]);}else{logger[_0xb04e('0x13')](_0xb04e('0x14'),_0x3c9be0,'request\x20sent');_0xb87a78(_0x332814['result'][_0xb04e('0x1b')]);}})[_0xb04e('0x1c')](function(_0x2e0f36){logger[_0xb04e('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x3c9be0,_0x2e0f36);_0x46b417(_0x2e0f36);});});}exports[_0xb04e('0x1d')]=function(_0x540031){var _0x45a5dc=this;return new Promise(function(_0x2dc79b,_0x44ef23){return db[_0xb04e('0x1e')][_0xb04e('0x1f')](_0x540031[_0xb04e('0x20')],{'raw':_0x540031[_0xb04e('0x21')]?_0x540031['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540031[_0xb04e('0x21')]?_0x540031[_0xb04e('0x21')][_0xb04e('0x22')]||null:null,'attributes':_0x540031['options']?_0x540031[_0xb04e('0x21')][_0xb04e('0x23')]||null:null,'limit':_0x540031[_0xb04e('0x21')]?_0x540031['options'][_0xb04e('0x24')]||null:null})['then'](function(_0x23ccb9){logger[_0xb04e('0x13')](_0xb04e('0x1d'),_0x540031);logger[_0xb04e('0x16')](_0xb04e('0x1d'),_0x540031,JSON[_0xb04e('0x18')](_0x23ccb9));_0x2dc79b(_0x23ccb9);})[_0xb04e('0x1c')](function(_0x14b9c3){logger['error'](_0xb04e('0x1d'),_0x14b9c3[_0xb04e('0x1b')],_0x540031);_0x44ef23(_0x45a5dc[_0xb04e('0x19')](0x1f4,_0x14b9c3[_0xb04e('0x1b')]));});});};exports[_0xb04e('0x25')]=function(_0x3dc354){return new Promise(function(_0x4da72e,_0x17f285){return db[_0xb04e('0x1e')][_0xb04e('0x26')]({'where':_0x3dc354[_0xb04e('0x21')]?_0x3dc354[_0xb04e('0x21')][_0xb04e('0x22')]||null:null})[_0xb04e('0x12')](function(_0x2aa0ce){if(_0x2aa0ce){return _0x2aa0ce['addTags'](_0x3dc354[_0xb04e('0x20')]['ids'],_['omit'](_0x3dc354[_0xb04e('0x20')],[_0xb04e('0x27'),'id'])||{});}})['spread'](function(_0x343a72){logger[_0xb04e('0x13')](_0xb04e('0x28'),_0x3dc354);logger[_0xb04e('0x16')](_0xb04e('0x28'),_0x3dc354,JSON[_0xb04e('0x18')](_0x343a72));_0x4da72e(_0x343a72);})[_0xb04e('0x1c')](function(_0x2648d6){logger[_0xb04e('0x19')](_0xb04e('0x28'),_0x2648d6[_0xb04e('0x1b')],_0x3dc354);_0x17f285(_this[_0xb04e('0x19')](0x1f4,_0x2648d6['message']));});});};
\ No newline at end of file
+var _0xf1ab=['find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','AddTagsToFaxInteraction'];(function(_0x10a353,_0x4a85fb){var _0x52d01f=function(_0x5eb8d8){while(--_0x5eb8d8){_0x10a353['push'](_0x10a353['shift']());}};_0x52d01f(++_0x4a85fb);}(_0xf1ab,0xa9));var _0xbf1a=function(_0x3a6523,_0x5b012d){_0x3a6523=_0x3a6523-0x0;var _0x12a982=_0xf1ab[_0x3a6523];return _0x12a982;};'use strict';var _=require(_0xbf1a('0x0'));var util=require(_0xbf1a('0x1'));var moment=require(_0xbf1a('0x2'));var BPromise=require(_0xbf1a('0x3'));var rs=require(_0xbf1a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf1a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbf1a('0x6'));var config=require(_0xbf1a('0x7'));var jayson=require(_0xbf1a('0x8'));var client=jayson[_0xbf1a('0x9')][_0xbf1a('0xa')]({'port':0x232a});config[_0xbf1a('0xb')]=_[_0xbf1a('0xc')](config[_0xbf1a('0xb')],{'host':_0xbf1a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf1a('0xb')]));require(_0xbf1a('0xe'))[_0xbf1a('0xf')](socket);function respondWithRpcPromise(_0x50ad52,_0x174231,_0xcf4b34){return new BPromise(function(_0x4d9f56,_0x4482bb){return client[_0xbf1a('0x10')](_0x50ad52,_0xcf4b34)[_0xbf1a('0x11')](function(_0xfcd0e6){logger[_0xbf1a('0x12')](_0xbf1a('0x13'),_0x174231,_0xbf1a('0x14'));logger[_0xbf1a('0x15')](_0xbf1a('0x16'),_0x174231,_0xbf1a('0x14'),JSON[_0xbf1a('0x17')](_0xfcd0e6));if(_0xfcd0e6[_0xbf1a('0x18')]){if(_0xfcd0e6['error'][_0xbf1a('0x19')]===0x1f4){logger[_0xbf1a('0x18')](_0xbf1a('0x13'),_0x174231,_0xfcd0e6[_0xbf1a('0x18')][_0xbf1a('0x1a')]);return _0x4482bb(_0xfcd0e6[_0xbf1a('0x18')][_0xbf1a('0x1a')]);}logger[_0xbf1a('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x174231,_0xfcd0e6['error'][_0xbf1a('0x1a')]);return _0x4d9f56(_0xfcd0e6[_0xbf1a('0x18')][_0xbf1a('0x1a')]);}else{logger[_0xbf1a('0x12')](_0xbf1a('0x13'),_0x174231,_0xbf1a('0x14'));_0x4d9f56(_0xfcd0e6['result'][_0xbf1a('0x1a')]);}})[_0xbf1a('0x1b')](function(_0x1a8d6a){logger['error'](_0xbf1a('0x13'),_0x174231,_0x1a8d6a);_0x4482bb(_0x1a8d6a);});});}exports[_0xbf1a('0x1c')]=function(_0x404eda){var _0x466b2e=this;return new Promise(function(_0x18c713,_0x3dd7fa){return db[_0xbf1a('0x1d')][_0xbf1a('0x1e')](_0x404eda[_0xbf1a('0x1f')],{'raw':_0x404eda[_0xbf1a('0x20')]?_0x404eda[_0xbf1a('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x404eda[_0xbf1a('0x20')]?_0x404eda[_0xbf1a('0x20')][_0xbf1a('0x21')]||null:null,'attributes':_0x404eda[_0xbf1a('0x20')]?_0x404eda[_0xbf1a('0x20')][_0xbf1a('0x22')]||null:null,'limit':_0x404eda[_0xbf1a('0x20')]?_0x404eda[_0xbf1a('0x20')]['limit']||null:null})[_0xbf1a('0x11')](function(_0x5b9315){logger[_0xbf1a('0x12')](_0xbf1a('0x1c'),_0x404eda);logger[_0xbf1a('0x15')](_0xbf1a('0x1c'),_0x404eda,JSON[_0xbf1a('0x17')](_0x5b9315));_0x18c713(_0x5b9315);})[_0xbf1a('0x1b')](function(_0xc0c6c8){logger[_0xbf1a('0x18')](_0xbf1a('0x1c'),_0xc0c6c8[_0xbf1a('0x1a')],_0x404eda);_0x3dd7fa(_0x466b2e['error'](0x1f4,_0xc0c6c8['message']));});});};exports[_0xbf1a('0x23')]=function(_0x59feae){return new Promise(function(_0x29ff1b,_0x1aa2eb){return db[_0xbf1a('0x1d')][_0xbf1a('0x24')]({'where':_0x59feae['options']?_0x59feae[_0xbf1a('0x20')]['where']||null:null})[_0xbf1a('0x11')](function(_0x5958f4){if(_0x5958f4){return _0x5958f4[_0xbf1a('0x25')](_0x59feae[_0xbf1a('0x1f')][_0xbf1a('0x26')],_['omit'](_0x59feae[_0xbf1a('0x1f')],[_0xbf1a('0x26'),'id'])||{});}})[_0xbf1a('0x27')](function(_0x44b92a){logger[_0xbf1a('0x12')](_0xbf1a('0x28'),_0x59feae);logger[_0xbf1a('0x15')](_0xbf1a('0x28'),_0x59feae,JSON[_0xbf1a('0x17')](_0x44b92a));_0x29ff1b(_0x44b92a);})[_0xbf1a('0x1b')](function(_0x36f1d3){logger[_0xbf1a('0x18')](_0xbf1a('0x28'),_0x36f1d3['message'],_0x59feae);_0x1aa2eb(_this[_0xbf1a('0x18')](0x1f4,_0x36f1d3[_0xbf1a('0x1a')]));});});};
\ No newline at end of file
index ff50d3b..9506652 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1576=['update','register','./faxInteraction.events','save','remove'];(function(_0x32ad1a,_0x17638d){var _0x76bdb=function(_0x17cea3){while(--_0x17cea3){_0x32ad1a['push'](_0x32ad1a['shift']());}};_0x76bdb(++_0x17638d);}(_0x1576,0xe8));var _0x6157=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x1576[_0x2a558d];return _0xa7bc9c;};'use strict';var FaxInteractionEvents=require(_0x6157('0x0'));var events=[_0x6157('0x1'),_0x6157('0x2'),_0x6157('0x3')];function createListener(_0x245bee,_0x2eeef7){return function(_0x1c2002){_0x2eeef7['emit'](_0x245bee,_0x1c2002);};}function removeListener(_0xd8aad7,_0x43a2c5){return function(){FaxInteractionEvents['removeListener'](_0xd8aad7,_0x43a2c5);};}exports[_0x6157('0x4')]=function(_0x27120d){for(var _0x36da7b=0x0,_0x317039=events['length'];_0x36da7b<_0x317039;_0x36da7b++){var _0x4a8d8e=events[_0x36da7b];var _0x598ac9=createListener('faxInteraction:'+_0x4a8d8e,_0x27120d);FaxInteractionEvents['on'](_0x4a8d8e,_0x598ac9);}};
\ No newline at end of file
+var _0xd10e=['update','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x3bd111,_0x368984){var _0x45f678=function(_0x471477){while(--_0x471477){_0x3bd111['push'](_0x3bd111['shift']());}};_0x45f678(++_0x368984);}(_0xd10e,0x10f));var _0xed10=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0xd10e[_0x34325b];return _0x3da348;};'use strict';var FaxInteractionEvents=require(_0xed10('0x0'));var events=[_0xed10('0x1'),'remove',_0xed10('0x2')];function createListener(_0x474135,_0x5f5b7a){return function(_0x16bf5d){_0x5f5b7a['emit'](_0x474135,_0x16bf5d);};}function removeListener(_0x5754fa,_0x14ccce){return function(){FaxInteractionEvents[_0xed10('0x3')](_0x5754fa,_0x14ccce);};}exports[_0xed10('0x4')]=function(_0x3a49d6){for(var _0x33d4f1=0x0,_0x2a79f9=events[_0xed10('0x5')];_0x33d4f1<_0x2a79f9;_0x33d4f1++){var _0x5f5285=events[_0x33d4f1];var _0x423827=createListener(_0xed10('0x6')+_0x5f5285,_0x3a49d6);FaxInteractionEvents['on'](_0x5f5285,_0x423827);}};
\ No newline at end of file
index 869d640..9723160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4032=['/describe','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','faxinteraction:addtags','put','/:id','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','multer','util','path','connect-timeout','express','fs-extra','./faxInteraction.controller','get','index'];(function(_0x1be370,_0xfb6985){var _0x4610ac=function(_0x407172){while(--_0x407172){_0x1be370['push'](_0x1be370['shift']());}};_0x4610ac(++_0xfb6985);}(_0x4032,0x6b));var _0x2403=function(_0x14a24e,_0x5a6b15){_0x14a24e=_0x14a24e-0x0;var _0x5c06d8=_0x4032[_0x14a24e];return _0x5c06d8;};'use strict';var multer=require(_0x2403('0x0'));var util=require(_0x2403('0x1'));var path=require(_0x2403('0x2'));var timeout=require(_0x2403('0x3'));var express=require(_0x2403('0x4'));var router=express['Router']();var fs_extra=require(_0x2403('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2403('0x6'));router[_0x2403('0x7')]('/',auth['isAuthenticated'](),controller[_0x2403('0x8')]);router[_0x2403('0x7')](_0x2403('0x9'),auth[_0x2403('0xa')](),controller[_0x2403('0xb')]);router[_0x2403('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x2403('0xc'),auth[_0x2403('0xa')](),controller[_0x2403('0xd')]);router[_0x2403('0x7')](_0x2403('0xe'),auth['isAuthenticated'](),controller[_0x2403('0xf')]);router[_0x2403('0x10')]('/',auth[_0x2403('0xa')](),controller[_0x2403('0x11')]);router[_0x2403('0x10')](_0x2403('0xc'),auth[_0x2403('0xa')](),controller[_0x2403('0x12')]);router['post'](_0x2403('0x13'),auth['isAuthenticated'](),interaction['tracked']('fax',_0x2403('0x14')),controller['addTags']);router[_0x2403('0x15')](_0x2403('0x16'),auth[_0x2403('0xa')](),interaction['tracked'](_0x2403('0x17'),_0x2403('0x18')),controller[_0x2403('0x19')]);router[_0x2403('0x1a')](_0x2403('0x16'),auth[_0x2403('0xa')](),interaction['tracked'](_0x2403('0x17'),_0x2403('0x1b')),controller[_0x2403('0x1c')]);router[_0x2403('0x1a')](_0x2403('0x13'),auth[_0x2403('0xa')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0xcbef=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','update','fax','faxinteraction:destroy','destroy','removeTags','util','path','connect-timeout','express'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xcbef,0x78));var _0xfcbe=function(_0x241de8,_0x24c165){_0x241de8=_0x241de8-0x0;var _0x19fb75=_0xcbef[_0x241de8];return _0x19fb75;};'use strict';var multer=require('multer');var util=require(_0xfcbe('0x0'));var path=require(_0xfcbe('0x1'));var timeout=require(_0xfcbe('0x2'));var express=require(_0xfcbe('0x3'));var router=express[_0xfcbe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfcbe('0x5'));var interaction=require(_0xfcbe('0x6'));var config=require(_0xfcbe('0x7'));var controller=require(_0xfcbe('0x8'));router['get']('/',auth[_0xfcbe('0x9')](),controller['index']);router[_0xfcbe('0xa')](_0xfcbe('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xfcbe('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfcbe('0xa')](_0xfcbe('0xc'),auth['isAuthenticated'](),controller[_0xfcbe('0xd')]);router[_0xfcbe('0xa')](_0xfcbe('0xe'),auth['isAuthenticated'](),controller[_0xfcbe('0xf')]);router[_0xfcbe('0x10')]('/',auth[_0xfcbe('0x9')](),controller[_0xfcbe('0x11')]);router[_0xfcbe('0x10')](_0xfcbe('0xc'),auth[_0xfcbe('0x9')](),controller[_0xfcbe('0x12')]);router['post'](_0xfcbe('0x13'),auth['isAuthenticated'](),interaction[_0xfcbe('0x14')]('fax',_0xfcbe('0x15')),controller[_0xfcbe('0x16')]);router[_0xfcbe('0x17')](_0xfcbe('0x18'),auth[_0xfcbe('0x9')](),interaction['tracked']('fax',_0xfcbe('0x19')),controller[_0xfcbe('0x1a')]);router['delete']('/:id',auth[_0xfcbe('0x9')](),interaction[_0xfcbe('0x14')](_0xfcbe('0x1b'),_0xfcbe('0x1c')),controller[_0xfcbe('0x1d')]);router['delete'](_0xfcbe('0x13'),auth['isAuthenticated'](),controller[_0xfcbe('0x1e')]);module['exports']=router;
\ No newline at end of file
index 55d09bf..2ab8cc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c32=['TEXT','medium','BOOLEAN','ENUM','out','sequelize','exports'];(function(_0x5ccb98,_0x2b52af){var _0x508c07=function(_0x531b66){while(--_0x531b66){_0x5ccb98['push'](_0x5ccb98['shift']());}};_0x508c07(++_0x2b52af);}(_0x6c32,0x6e));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x26c3('0x0'));module[_0x26c3('0x1')]={'body':{'type':Sequelize[_0x26c3('0x2')](_0x26c3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x26c3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x26c3('0x5')]('in',_0x26c3('0x6')),'defaultValue':_0x26c3('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x26c3('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x56e6=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x5280e6,_0x4121c6){var _0x3c8d3e=function(_0x313fb2){while(--_0x313fb2){_0x5280e6['push'](_0x5280e6['shift']());}};_0x3c8d3e(++_0x4121c6);}(_0x56e6,0x6b));var _0x656e=function(_0x5e4fdc,_0x183475){_0x5e4fdc=_0x5e4fdc-0x0;var _0xe2d401=_0x56e6[_0x5e4fdc];return _0xe2d401;};'use strict';var Sequelize=require(_0x656e('0x0'));module[_0x656e('0x1')]={'body':{'type':Sequelize[_0x656e('0x2')](_0x656e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x656e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x656e('0x5')]('in','out'),'defaultValue':_0x656e('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x656e('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x656e('0x7')]}};
\ No newline at end of file
index 11822db..8ada178 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe957=['stack','name','map','FaxMessage','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','show','params','rawAttributes','include','find','body','describe','fax-interactions','accept','fax','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE: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','agent','manual','SIP/%s','channel','event','EventManager','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','interface','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files','attachments','Attachment','eml-format','rimraf','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x40183f,_0x304848){var _0x17fbd7=function(_0x475f7a){while(--_0x475f7a){_0x40183f['push'](_0x40183f['shift']());}};_0x17fbd7(++_0x304848);}(_0xe957,0x170));var _0x7e95=function(_0xd586a3,_0x2e8fc8){_0xd586a3=_0xd586a3-0x0;var _0x3c23a7=_0xe957[_0xd586a3];return _0x3c23a7;};'use strict';var emlformat=require(_0x7e95('0x0'));var rimraf=require(_0x7e95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7e95('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7e95('0x3'));var util=require(_0x7e95('0x4'));var path=require(_0x7e95('0x5'));var sox=require('sox');var csv=require(_0x7e95('0x6'));var ejs=require(_0x7e95('0x7'));var fs=require('fs');var fs_extra=require(_0x7e95('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7e95('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e95('0x6'));var querystring=require(_0x7e95('0xa'));var Papa=require(_0x7e95('0xb'));var Redis=require(_0x7e95('0xc'));var authService=require(_0x7e95('0xd'));var qs=require(_0x7e95('0xe'));var as=require(_0x7e95('0xf'));var hardwareService=require(_0x7e95('0x10'));var logger=require(_0x7e95('0x11'))(_0x7e95('0x12'));var utils=require(_0x7e95('0x13'));var config=require(_0x7e95('0x14'));var licenseUtil=require(_0x7e95('0x15'));var db=require(_0x7e95('0x16'))['db'];config[_0x7e95('0x17')]=_[_0x7e95('0x18')](config[_0x7e95('0x17')],{'host':_0x7e95('0x19'),'port':0x18eb});var socket=require(_0x7e95('0x1a'))(new Redis(config[_0x7e95('0x17')]));require(_0x7e95('0x1b'))[_0x7e95('0x1c')](socket);var jayson=require(_0x7e95('0x1d'));var client=jayson[_0x7e95('0x1e')][_0x7e95('0x1f')]({'port':0x232c});var client9002=jayson[_0x7e95('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x561b94,_0x26c281,_0x45581c,_0x20fceb){return new BPromise(function(_0x8b6f73,_0x285c9f){var _0x46eabe=_0x20fceb||client;return _0x46eabe['request'](_0x561b94,_0x45581c)[_0x7e95('0x20')](function(_0x393ddf){logger[_0x7e95('0x21')](_0x7e95('0x22'),_0x26c281,_0x7e95('0x23'));logger[_0x7e95('0x24')](_0x7e95('0x25'),_0x26c281,'request\x20sent',JSON[_0x7e95('0x26')](_0x393ddf));if(_0x393ddf[_0x7e95('0x27')]){if(_0x393ddf[_0x7e95('0x27')][_0x7e95('0x28')]===0x1f4){logger[_0x7e95('0x27')](_0x7e95('0x22'),_0x26c281,_0x393ddf[_0x7e95('0x27')]['message']);return _0x285c9f(_0x393ddf['error']['message']);}logger[_0x7e95('0x27')](_0x7e95('0x22'),_0x26c281,_0x393ddf[_0x7e95('0x27')][_0x7e95('0x29')]);return _0x8b6f73(_0x393ddf[_0x7e95('0x27')][_0x7e95('0x29')]);}else{logger[_0x7e95('0x21')](_0x7e95('0x22'),_0x26c281,_0x7e95('0x23'));_0x8b6f73(_0x393ddf['result'][_0x7e95('0x29')]);}})[_0x7e95('0x2a')](function(_0x5e2a90){logger[_0x7e95('0x27')](_0x7e95('0x22'),_0x26c281,_0x5e2a90);_0x285c9f(_0x5e2a90);});});}function respondWithStatusCode(_0x442fa2,_0x45d11e){_0x45d11e=_0x45d11e||0xcc;return function(_0x5aaa59){if(_0x5aaa59){return _0x442fa2[_0x7e95('0x2b')](_0x45d11e);}return _0x442fa2['status'](_0x45d11e)[_0x7e95('0x2c')]();};}function respondWithResult(_0x363970,_0x192efa){_0x192efa=_0x192efa||0xc8;return function(_0x6563a8){if(_0x6563a8){return _0x363970[_0x7e95('0x2d')](_0x192efa)[_0x7e95('0x2e')](_0x6563a8);}};}function respondWithFilteredResult(_0x16406c,_0x124e86){return function(_0x4ca28d){if(_0x4ca28d){var _0x1bffd8=typeof _0x124e86[_0x7e95('0x2f')]===_0x7e95('0x30')&&typeof _0x124e86['limit']==='undefined';var _0x103875=_0x4ca28d[_0x7e95('0x31')];var _0x17ea40=_0x1bffd8?0x0:_0x124e86[_0x7e95('0x2f')];var _0x234c8a=_0x1bffd8?_0x4ca28d[_0x7e95('0x31')]:_0x124e86[_0x7e95('0x2f')]+_0x124e86[_0x7e95('0x32')];var _0xd2e090;if(_0x234c8a>=_0x103875){_0x234c8a=_0x103875;_0xd2e090=0xc8;}else{_0xd2e090=0xce;}_0x16406c[_0x7e95('0x2d')](_0xd2e090);return _0x16406c[_0x7e95('0x33')](_0x7e95('0x34'),_0x17ea40+'-'+_0x234c8a+'/'+_0x103875)[_0x7e95('0x2e')](_0x4ca28d);}return null;};}function patchUpdates(_0x2a00b3){return function(_0x23a1c1){try{jsonpatch[_0x7e95('0x35')](_0x23a1c1,_0x2a00b3,!![]);}catch(_0x1eaf81){return BPromise[_0x7e95('0x36')](_0x1eaf81);}return _0x23a1c1[_0x7e95('0x37')]();};}function saveUpdates(_0x441971,_0x320fd5){return function(_0xc1db82){if(_0xc1db82){return _0xc1db82[_0x7e95('0x38')](_0x441971)[_0x7e95('0x20')](function(_0x47b6de){return _0x47b6de;});}return null;};}function removeEntity(_0x54244c,_0x574dcd){return function(_0x97f5f2){if(_0x97f5f2){return _0x97f5f2[_0x7e95('0x39')]()[_0x7e95('0x20')](function(){_0x54244c[_0x7e95('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x96ecf0,_0x1ff35d){return function(_0x51b08b){if(!_0x51b08b){_0x96ecf0[_0x7e95('0x2b')](0x194);}return _0x51b08b;};}function handleError(_0x479e13,_0x2fa074){_0x2fa074=_0x2fa074||0x1f4;return function(_0x585dac){logger['error'](_0x585dac[_0x7e95('0x3a')]);if(_0x585dac[_0x7e95('0x3b')]){delete _0x585dac[_0x7e95('0x3b')];}_0x479e13['status'](_0x2fa074)['send'](_0x585dac);};}exports['index']=function(_0x38488c,_0x29e7b7){var _0x430859={},_0x30749a={},_0x40f390={'count':0x0,'rows':[]};var _0x3a688f=_[_0x7e95('0x3c')](db[_0x7e95('0x3d')]['rawAttributes'],function(_0x1b3ae2){return{'name':_0x1b3ae2[_0x7e95('0x3e')],'type':_0x1b3ae2[_0x7e95('0x3f')][_0x7e95('0x40')]};});_0x30749a[_0x7e95('0x41')]=_['map'](_0x3a688f,_0x7e95('0x3b'));_0x30749a['query']=_[_0x7e95('0x42')](_0x38488c[_0x7e95('0x43')]);_0x30749a[_0x7e95('0x44')]=_[_0x7e95('0x45')](_0x30749a[_0x7e95('0x41')],_0x30749a[_0x7e95('0x43')]);_0x430859[_0x7e95('0x46')]=_['intersection'](_0x30749a['model'],qs['fields'](_0x38488c[_0x7e95('0x43')][_0x7e95('0x47')]));_0x430859[_0x7e95('0x46')]=_0x430859[_0x7e95('0x46')][_0x7e95('0x48')]?_0x430859[_0x7e95('0x46')]:_0x30749a[_0x7e95('0x41')];if(!_0x38488c[_0x7e95('0x43')]['hasOwnProperty'](_0x7e95('0x49'))){_0x430859[_0x7e95('0x32')]=qs[_0x7e95('0x32')](_0x38488c[_0x7e95('0x43')][_0x7e95('0x32')]);_0x430859[_0x7e95('0x2f')]=qs[_0x7e95('0x2f')](_0x38488c[_0x7e95('0x43')]['offset']);}_0x430859['order']=qs[_0x7e95('0x4a')](_0x38488c[_0x7e95('0x43')][_0x7e95('0x4a')]);_0x430859[_0x7e95('0x4b')]=qs[_0x7e95('0x44')](_[_0x7e95('0x4c')](_0x38488c[_0x7e95('0x43')],_0x30749a[_0x7e95('0x44')]),_0x3a688f);if(_0x38488c[_0x7e95('0x43')][_0x7e95('0x4d')]){_0x430859[_0x7e95('0x4b')]=_[_0x7e95('0x4e')](_0x430859[_0x7e95('0x4b')],{'$or':_['map'](_0x3a688f,function(_0x454fe7){if(_0x454fe7[_0x7e95('0x3f')]!==_0x7e95('0x4f')){var _0x1aeb86={};_0x1aeb86[_0x454fe7[_0x7e95('0x3b')]]={'$like':'%'+_0x38488c['query'][_0x7e95('0x4d')]+'%'};return _0x1aeb86;}})});}_0x430859=_[_0x7e95('0x4e')]({},_0x430859,_0x38488c[_0x7e95('0x50')]);var _0xbc98e7={'where':_0x430859[_0x7e95('0x4b')]};return db['FaxMessage'][_0x7e95('0x31')](_0xbc98e7)[_0x7e95('0x20')](function(_0x5931d6){_0x40f390[_0x7e95('0x31')]=_0x5931d6;if(_0x38488c[_0x7e95('0x43')][_0x7e95('0x51')]){_0x430859['include']=[{'all':!![]}];}return db[_0x7e95('0x3d')]['findAll'](_0x430859);})[_0x7e95('0x20')](function(_0x23fe1e){_0x40f390['rows']=_0x23fe1e;return _0x40f390;})[_0x7e95('0x20')](respondWithFilteredResult(_0x29e7b7,_0x430859))[_0x7e95('0x2a')](handleError(_0x29e7b7,null));};exports[_0x7e95('0x52')]=function(_0x35c1fe,_0x41f60f){var _0xec0736={'raw':!![],'where':{'id':_0x35c1fe[_0x7e95('0x53')]['id']}},_0x3ca309={};_0x3ca309[_0x7e95('0x41')]=_[_0x7e95('0x42')](db[_0x7e95('0x3d')][_0x7e95('0x54')]);_0x3ca309[_0x7e95('0x43')]=_[_0x7e95('0x42')](_0x35c1fe[_0x7e95('0x43')]);_0x3ca309[_0x7e95('0x44')]=_['intersection'](_0x3ca309['model'],_0x3ca309[_0x7e95('0x43')]);_0xec0736[_0x7e95('0x46')]=_[_0x7e95('0x45')](_0x3ca309['model'],qs['fields'](_0x35c1fe[_0x7e95('0x43')][_0x7e95('0x47')]));_0xec0736[_0x7e95('0x46')]=_0xec0736[_0x7e95('0x46')][_0x7e95('0x48')]?_0xec0736[_0x7e95('0x46')]:_0x3ca309['model'];if(_0x35c1fe[_0x7e95('0x43')][_0x7e95('0x51')]){_0xec0736[_0x7e95('0x55')]=[{'all':!![]}];}_0xec0736=_['merge']({},_0xec0736,_0x35c1fe[_0x7e95('0x50')]);return db['FaxMessage'][_0x7e95('0x56')](_0xec0736)[_0x7e95('0x20')](handleEntityNotFound(_0x41f60f,null))[_0x7e95('0x20')](respondWithResult(_0x41f60f,null))[_0x7e95('0x2a')](handleError(_0x41f60f,null));};exports[_0x7e95('0x38')]=function(_0x53de8b,_0x488dc7){if(_0x53de8b[_0x7e95('0x57')]['id']){delete _0x53de8b[_0x7e95('0x57')]['id'];}return db[_0x7e95('0x3d')][_0x7e95('0x56')]({'where':{'id':_0x53de8b[_0x7e95('0x53')]['id']}})[_0x7e95('0x20')](handleEntityNotFound(_0x488dc7,null))[_0x7e95('0x20')](saveUpdates(_0x53de8b[_0x7e95('0x57')],null))[_0x7e95('0x20')](respondWithResult(_0x488dc7,null))['catch'](handleError(_0x488dc7,null));};exports[_0x7e95('0x39')]=function(_0x3f992f,_0x15651c){return db[_0x7e95('0x3d')][_0x7e95('0x56')]({'where':{'id':_0x3f992f[_0x7e95('0x53')]['id']}})[_0x7e95('0x20')](handleEntityNotFound(_0x15651c,null))[_0x7e95('0x20')](removeEntity(_0x15651c,null))['catch'](handleError(_0x15651c,null));};exports['describe']=function(_0x47a94d,_0x59a748){return db[_0x7e95('0x3d')][_0x7e95('0x58')]()[_0x7e95('0x20')](respondWithResult(_0x59a748,null))[_0x7e95('0x2a')](handleError(_0x59a748,null));};var interaction_log=require(_0x7e95('0x11'))(_0x7e95('0x59'));exports[_0x7e95('0x5a')]=function(_0x1b6028,_0x403f17,_0x409856){var _0x1172cb={'agent':{},'channel':_0x7e95('0x5b')};if(_0x1b6028[_0x7e95('0x57')]['id']){delete _0x1b6028[_0x7e95('0x57')]['id'];}_0x1b6028[_0x7e95('0x57')]['read']=!![];_0x1b6028['body']['readAt']=moment()['format'](_0x7e95('0x5c'));_0x1b6028[_0x7e95('0x57')][_0x7e95('0x5d')]=_0x1b6028[_0x7e95('0x57')][_0x7e95('0x5d')]||_0x1b6028[_0x7e95('0x5e')]['id'];_0x1172cb['agent']['id']=_0x1b6028[_0x7e95('0x57')][_0x7e95('0x5d')];return db[_0x7e95('0x3d')][_0x7e95('0x56')]({'where':{'id':_0x1b6028[_0x7e95('0x53')]['id'],'UserId':null}})[_0x7e95('0x20')](handleEntityNotFound(_0x403f17,null))[_0x7e95('0x20')](saveUpdates(_0x1b6028[_0x7e95('0x57')],null))[_0x7e95('0x20')](function(_0x10cd4c){if(_0x10cd4c){_0x1172cb[_0x7e95('0x29')]=_0x10cd4c[_0x7e95('0x5f')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x10cd4c[_0x7e95('0x60')]}});}return null;})[_0x7e95('0x20')](handleEntityNotFound(_0x403f17,null))[_0x7e95('0x20')](function(_0x1106db){if(_0x1106db){return _0x1106db[_0x7e95('0x38')]({'UserId':_0x1b6028['body'][_0x7e95('0x5d')],'read1stAt':_[_0x7e95('0x61')](_0x1106db[_0x7e95('0x62')])?moment()[_0x7e95('0x63')](_0x7e95('0x5c')):undefined});}return null;})[_0x7e95('0x20')](function(_0x5dff0a){if(_0x5dff0a){_0x1172cb[_0x7e95('0x64')]=_0x5dff0a[_0x7e95('0x5f')]({'plain':!![]});interaction_log[_0x7e95('0x21')](_0x7e95('0x65'),_0x1b6028[_0x7e95('0x5e')]['id'],_0x1b6028[_0x7e95('0x5e')][_0x7e95('0x3b')],_0x1b6028['user']['role'],_0x1172cb[_0x7e95('0x64')]['id'],_0x1b6028[_0x7e95('0x57')]?JSON[_0x7e95('0x26')](_0x1b6028['body']):_0x7e95('0x66'));return respondWithRpcPromise(_0x7e95('0x67'),_0x7e95('0x68'),_0x1172cb);}return null;})[_0x7e95('0x20')](function(_0x956960){var _0x1c692b=_0x7e95('0x69')+_0x956960[_0x7e95('0x29')][_0x7e95('0x6a')];return db[_0x7e95('0x6b')]['query'](_0x1c692b,{'type':db[_0x7e95('0x6c')][_0x7e95('0x6d')][_0x7e95('0x6e')],'raw':!![]})[_0x7e95('0x20')](function(_0x37ab76){return _0x37ab76;});})[_0x7e95('0x20')](function(_0x2afbf4){if(_0x2afbf4){_0x1172cb['message'][_0x7e95('0x6f')]=_0x2afbf4[0x0];if(!_0x1b6028[_0x7e95('0x57')][_0x7e95('0x5d')])return;return db[_0x7e95('0x70')][_0x7e95('0x56')]({'where':{'id':_0x1b6028[_0x7e95('0x57')][_0x7e95('0x5d')],'role':'agent'},'attributes':['id',_0x7e95('0x3b'),_0x7e95('0x71'),_0x7e95('0x72'),_0x7e95('0x73')],'raw':!![]});}return null;})[_0x7e95('0x20')](function(_0x2e6372){if(!_0x2e6372)return null;_0x1172cb['message'][_0x7e95('0x74')]=_0x2e6372;return _0x1172cb;})[_0x7e95('0x20')](function(_0x1a65dd){if(_0x1a65dd){if(_0x1b6028[_0x7e95('0x57')][_0x7e95('0x75')]){_0x1172cb[_0x7e95('0x29')]['interface']=util[_0x7e95('0x63')](_0x7e95('0x76'),_0x1b6028[_0x7e95('0x5e')][_0x7e95('0x3b')]);_0x1172cb[_0x7e95('0x29')][_0x7e95('0x77')]=_0x1172cb[_0x7e95('0x77')];_0x1172cb[_0x7e95('0x29')][_0x7e95('0x78')]=_0x7e95('0x5a');return respondWithRpcPromise('EventManager',_0x7e95('0x79'),{'event':'acceptmessage','message':_0x1172cb[_0x7e95('0x29')]},client9002)[_0x7e95('0x20')](function(){return _0x1172cb;});}return _0x1172cb;}return null;})['then'](respondWithResult(_0x403f17,null))['catch'](handleError(_0x403f17,null));};var interaction_log=require(_0x7e95('0x11'))(_0x7e95('0x59'));exports[_0x7e95('0x36')]=function(_0x46faa4,_0x49b5a2,_0x344456){var _0x183f46={'agent':{},'channel':_0x7e95('0x5b')};if(_0x46faa4['body']['id']){delete _0x46faa4[_0x7e95('0x57')]['id'];}_0x46faa4[_0x7e95('0x57')][_0x7e95('0x5d')]=_0x46faa4[_0x7e95('0x57')][_0x7e95('0x5d')]||_0x46faa4[_0x7e95('0x5e')]['id'];_0x183f46[_0x7e95('0x74')]['id']=_0x46faa4[_0x7e95('0x57')][_0x7e95('0x5d')];return db[_0x7e95('0x3d')][_0x7e95('0x56')]({'where':{'id':_0x46faa4[_0x7e95('0x53')]['id'],'UserId':null}})[_0x7e95('0x20')](handleEntityNotFound(_0x49b5a2,null))['then'](function(_0x456e18){if(_0x456e18){_0x183f46['message']=_0x456e18['get']({'plain':!![]});return db[_0x7e95('0x7a')][_0x7e95('0x56')]({'where':{'id':_0x456e18[_0x7e95('0x60')]}});}return null;})[_0x7e95('0x20')](handleEntityNotFound(_0x49b5a2,null))[_0x7e95('0x20')](function(_0x4d913f){if(_0x4d913f){_0x183f46['interaction']=_0x4d913f[_0x7e95('0x5f')]({'plain':!![]});interaction_log['info'](_0x7e95('0x7b'),_0x46faa4[_0x7e95('0x5e')]['id'],_0x46faa4[_0x7e95('0x5e')][_0x7e95('0x3b')],_0x46faa4[_0x7e95('0x5e')][_0x7e95('0x7c')],_0x183f46[_0x7e95('0x64')]['id'],_0x46faa4['body']?JSON[_0x7e95('0x26')](_0x46faa4['body']):'null');return respondWithRpcPromise('RejectMessage',_0x7e95('0x7d'),_0x183f46);}return null;})[_0x7e95('0x20')](function(_0x5ae880){var _0x315ba4=_0x7e95('0x69')+_0x5ae880[_0x7e95('0x29')][_0x7e95('0x6a')];return db[_0x7e95('0x6b')]['query'](_0x315ba4,{'type':db[_0x7e95('0x6c')][_0x7e95('0x6d')][_0x7e95('0x6e')],'raw':!![]})[_0x7e95('0x20')](function(_0x51bcc0){return _0x51bcc0;});})['then'](function(_0x1d61d7){if(_0x1d61d7){_0x183f46[_0x7e95('0x29')][_0x7e95('0x6f')]=_0x1d61d7[0x0];if(!_0x46faa4['body'][_0x7e95('0x5d')])return;return db['User'][_0x7e95('0x56')]({'where':{'id':_0x46faa4[_0x7e95('0x57')]['UserId'],'role':_0x7e95('0x74')},'attributes':['id',_0x7e95('0x3b'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x7e95('0x20')](function(_0x27173b){if(!_0x27173b)return null;_0x183f46[_0x7e95('0x29')][_0x7e95('0x74')]=_0x27173b;return _0x183f46;})['then'](function(_0x295643){if(_0x295643){_0x295643[_0x7e95('0x29')][_0x7e95('0x7e')]=util[_0x7e95('0x63')](_0x7e95('0x76'),_0x46faa4['user']['name']);_0x295643[_0x7e95('0x29')][_0x7e95('0x77')]=_0x183f46[_0x7e95('0x77')];_0x295643[_0x7e95('0x29')][_0x7e95('0x78')]=_0x7e95('0x36');respondWithRpcPromise('EventManager',_0x7e95('0x79'),{'event':_0x7e95('0x7f'),'message':_0x295643['message']},client9002);return _0x183f46;}return null;})[_0x7e95('0x20')](respondWithResult(_0x49b5a2,null))[_0x7e95('0x2a')](handleError(_0x49b5a2,null));};exports[_0x7e95('0x80')]=function(_0x6acce5,_0x490eb7){var _0x3fbc1b;return db[_0x7e95('0x3d')][_0x7e95('0x80')](_0x6acce5[_0x7e95('0x57')],{})[_0x7e95('0x20')](function(_0x410683){_0x3fbc1b=_0x410683;return db[_0x7e95('0x81')][_0x7e95('0x82')]({'where':{'id':_0x3fbc1b[_0x7e95('0x6a')]}});})['then'](function(_0x4158bb){if(_[_0x7e95('0x61')](_0x4158bb)){return;}else{_0x3fbc1b[_0x7e95('0x5b')]=_0x4158bb['fax'];return db['Attachment']['findOne']({'where':{'id':_0x3fbc1b[_0x7e95('0x83')]}});}})[_0x7e95('0x20')](function(_0x35f31d){return respondWithRpcPromise(_0x7e95('0x84'),_0x7e95('0x84'),{'FaxAccountId':_[_0x7e95('0x61')](_0x6acce5[_0x7e95('0x57')])?undefined:_0x6acce5[_0x7e95('0x57')][_0x7e95('0x85')],'path':_['isNil'](_0x35f31d)?undefined:util[_0x7e95('0x63')](_0x7e95('0x86'),_0x35f31d[_0x7e95('0x87')]),'fax':_[_0x7e95('0x61')](_0x3fbc1b[_0x7e95('0x5b')])?undefined:_0x3fbc1b[_0x7e95('0x5b')],'AttachmentId':_0x3fbc1b[_0x7e95('0x83')]},client9002);})[_0x7e95('0x20')](respondWithResult(_0x490eb7,0xc9))[_0x7e95('0x2a')](handleError(_0x490eb7,null));};exports[_0x7e95('0x88')]=function(_0xeb57de,_0x8458d4){var _0x23f11a=path[_0x7e95('0x89')](config[_0x7e95('0x8a')],'server',_0x7e95('0x8b'),_0x7e95('0x8c'));return db[_0x7e95('0x3d')][_0x7e95('0x56')]({'where':{'id':_0xeb57de[_0x7e95('0x53')]['id']},'include':[{'model':db[_0x7e95('0x8d')],'as':_0x7e95('0x8d')}]})[_0x7e95('0x20')](handleEntityNotFound(_0x8458d4,null))['then'](function(_0x58a357){if(_0x58a357){return _0x8458d4['download'](path[_0x7e95('0x89')](_0x23f11a,_0x58a357[_0x7e95('0x8d')][_0x7e95('0x87')]));}})[_0x7e95('0x2a')](handleError(_0x8458d4,null));};
\ No newline at end of file
+var _0x43a6=['readAt','format','UserId','agent','FaxInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','User','fullname','internal','manual','interface','channel','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','contact','event','rejectmessage','create','CmContact','findOne','Attachment','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','attachments','rimraf','zip-dir','request-promise','moment','bluebird','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','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxMessage.socket','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','end','stack','name','send','index','FaxMessage','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','rows','show','rawAttributes','find','body','params','destroy','describe','fax-interactions','accept','fax','read'];(function(_0xd8c6d,_0x21aeaa){var _0x42c38f=function(_0x1e1c8f){while(--_0x1e1c8f){_0xd8c6d['push'](_0xd8c6d['shift']());}};_0x42c38f(++_0x21aeaa);}(_0x43a6,0x148));var _0x643a=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x43a6[_0x9fd887];return _0x1a54ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x643a('0x0'));var zipdir=require(_0x643a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x643a('0x2'));var moment=require(_0x643a('0x3'));var BPromise=require(_0x643a('0x4'));var Mustache=require('mustache');var util=require(_0x643a('0x5'));var path=require('path');var sox=require(_0x643a('0x6'));var csv=require(_0x643a('0x7'));var ejs=require(_0x643a('0x8'));var fs=require('fs');var fs_extra=require(_0x643a('0x9'));var _=require(_0x643a('0xa'));var squel=require(_0x643a('0xb'));var crypto=require(_0x643a('0xc'));var jsforce=require(_0x643a('0xd'));var deskjs=require(_0x643a('0xe'));var toCsv=require(_0x643a('0x7'));var querystring=require(_0x643a('0xf'));var Papa=require(_0x643a('0x10'));var Redis=require(_0x643a('0x11'));var authService=require(_0x643a('0x12'));var qs=require(_0x643a('0x13'));var as=require(_0x643a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x643a('0x15'))('api');var utils=require(_0x643a('0x16'));var config=require(_0x643a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x643a('0x18'))['db'];config[_0x643a('0x19')]=_[_0x643a('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x643a('0x19')]));require(_0x643a('0x1b'))['register'](socket);var jayson=require(_0x643a('0x1c'));var client=jayson[_0x643a('0x1d')][_0x643a('0x1e')]({'port':0x232c});var client9002=jayson[_0x643a('0x1d')][_0x643a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x42689d,_0x41bade,_0x2f704c,_0x298ce9){return new BPromise(function(_0x245f25,_0x5d6b4a){var _0x5145a9=_0x298ce9||client;return _0x5145a9['request'](_0x42689d,_0x2f704c)[_0x643a('0x1f')](function(_0xe2f4b8){logger[_0x643a('0x20')](_0x643a('0x21'),_0x41bade,_0x643a('0x22'));logger[_0x643a('0x23')](_0x643a('0x24'),_0x41bade,_0x643a('0x22'),JSON[_0x643a('0x25')](_0xe2f4b8));if(_0xe2f4b8[_0x643a('0x26')]){if(_0xe2f4b8[_0x643a('0x26')][_0x643a('0x27')]===0x1f4){logger['error'](_0x643a('0x21'),_0x41bade,_0xe2f4b8['error'][_0x643a('0x28')]);return _0x5d6b4a(_0xe2f4b8[_0x643a('0x26')][_0x643a('0x28')]);}logger['error'](_0x643a('0x21'),_0x41bade,_0xe2f4b8[_0x643a('0x26')]['message']);return _0x245f25(_0xe2f4b8[_0x643a('0x26')][_0x643a('0x28')]);}else{logger[_0x643a('0x20')](_0x643a('0x21'),_0x41bade,'request\x20sent');_0x245f25(_0xe2f4b8['result'][_0x643a('0x28')]);}})[_0x643a('0x29')](function(_0x38c838){logger['error'](_0x643a('0x21'),_0x41bade,_0x38c838);_0x5d6b4a(_0x38c838);});});}function respondWithStatusCode(_0x62dbad,_0x5b530c){_0x5b530c=_0x5b530c||0xcc;return function(_0x430c5a){if(_0x430c5a){return _0x62dbad[_0x643a('0x2a')](_0x5b530c);}return _0x62dbad[_0x643a('0x2b')](_0x5b530c)['end']();};}function respondWithResult(_0xbe7056,_0x493c83){_0x493c83=_0x493c83||0xc8;return function(_0x3c02e1){if(_0x3c02e1){return _0xbe7056[_0x643a('0x2b')](_0x493c83)[_0x643a('0x2c')](_0x3c02e1);}};}function respondWithFilteredResult(_0x5843b0,_0x3869d8){return function(_0xe04752){if(_0xe04752){var _0x166e65=typeof _0x3869d8[_0x643a('0x2d')]===_0x643a('0x2e')&&typeof _0x3869d8[_0x643a('0x2f')]===_0x643a('0x2e');var _0x3065c9=_0xe04752['count'];var _0x25b122=_0x166e65?0x0:_0x3869d8[_0x643a('0x2d')];var _0x1a7faa=_0x166e65?_0xe04752[_0x643a('0x30')]:_0x3869d8[_0x643a('0x2d')]+_0x3869d8[_0x643a('0x2f')];var _0x53cff6;if(_0x1a7faa>=_0x3065c9){_0x1a7faa=_0x3065c9;_0x53cff6=0xc8;}else{_0x53cff6=0xce;}_0x5843b0[_0x643a('0x2b')](_0x53cff6);return _0x5843b0['set'](_0x643a('0x31'),_0x25b122+'-'+_0x1a7faa+'/'+_0x3065c9)['json'](_0xe04752);}return null;};}function patchUpdates(_0x22adaa){return function(_0x4aaada){try{jsonpatch[_0x643a('0x32')](_0x4aaada,_0x22adaa,!![]);}catch(_0xa49fc5){return BPromise[_0x643a('0x33')](_0xa49fc5);}return _0x4aaada[_0x643a('0x34')]();};}function saveUpdates(_0xfff0bf,_0x4ed87b){return function(_0x3b70e7){if(_0x3b70e7){return _0x3b70e7[_0x643a('0x35')](_0xfff0bf)[_0x643a('0x1f')](function(_0x3d0b68){return _0x3d0b68;});}return null;};}function removeEntity(_0x5e6b38,_0xd0f13a){return function(_0x1c4eeb){if(_0x1c4eeb){return _0x1c4eeb['destroy']()[_0x643a('0x1f')](function(){_0x5e6b38['status'](0xcc)[_0x643a('0x36')]();});}};}function handleEntityNotFound(_0x39c210,_0x16b4f5){return function(_0x3fc979){if(!_0x3fc979){_0x39c210['sendStatus'](0x194);}return _0x3fc979;};}function handleError(_0x5ee269,_0xa4edd8){_0xa4edd8=_0xa4edd8||0x1f4;return function(_0x2bb6a4){logger[_0x643a('0x26')](_0x2bb6a4[_0x643a('0x37')]);if(_0x2bb6a4[_0x643a('0x38')]){delete _0x2bb6a4[_0x643a('0x38')];}_0x5ee269[_0x643a('0x2b')](_0xa4edd8)[_0x643a('0x39')](_0x2bb6a4);};}exports[_0x643a('0x3a')]=function(_0x4c44b0,_0x100b7d){var _0x49a29e={},_0xd91f11={},_0x4e3604={'count':0x0,'rows':[]};var _0x4c8c7e=_['map'](db[_0x643a('0x3b')]['rawAttributes'],function(_0x3b8e5f){return{'name':_0x3b8e5f[_0x643a('0x3c')],'type':_0x3b8e5f[_0x643a('0x3d')][_0x643a('0x3e')]};});_0xd91f11['model']=_['map'](_0x4c8c7e,'name');_0xd91f11[_0x643a('0x3f')]=_[_0x643a('0x40')](_0x4c44b0[_0x643a('0x3f')]);_0xd91f11['filters']=_[_0x643a('0x41')](_0xd91f11[_0x643a('0x42')],_0xd91f11[_0x643a('0x3f')]);_0x49a29e[_0x643a('0x43')]=_['intersection'](_0xd91f11[_0x643a('0x42')],qs[_0x643a('0x44')](_0x4c44b0['query'][_0x643a('0x44')]));_0x49a29e[_0x643a('0x43')]=_0x49a29e[_0x643a('0x43')][_0x643a('0x45')]?_0x49a29e[_0x643a('0x43')]:_0xd91f11[_0x643a('0x42')];if(!_0x4c44b0[_0x643a('0x3f')][_0x643a('0x46')]('nolimit')){_0x49a29e['limit']=qs[_0x643a('0x2f')](_0x4c44b0[_0x643a('0x3f')][_0x643a('0x2f')]);_0x49a29e[_0x643a('0x2d')]=qs[_0x643a('0x2d')](_0x4c44b0['query'][_0x643a('0x2d')]);}_0x49a29e[_0x643a('0x47')]=qs[_0x643a('0x48')](_0x4c44b0['query'][_0x643a('0x48')]);_0x49a29e[_0x643a('0x49')]=qs[_0x643a('0x4a')](_[_0x643a('0x4b')](_0x4c44b0[_0x643a('0x3f')],_0xd91f11[_0x643a('0x4a')]),_0x4c8c7e);if(_0x4c44b0[_0x643a('0x3f')][_0x643a('0x4c')]){_0x49a29e[_0x643a('0x49')]=_[_0x643a('0x4d')](_0x49a29e['where'],{'$or':_['map'](_0x4c8c7e,function(_0x1ed700){if(_0x1ed700[_0x643a('0x3d')]!=='VIRTUAL'){var _0x3d722f={};_0x3d722f[_0x1ed700[_0x643a('0x38')]]={'$like':'%'+_0x4c44b0['query'][_0x643a('0x4c')]+'%'};return _0x3d722f;}})});}_0x49a29e=_['merge']({},_0x49a29e,_0x4c44b0[_0x643a('0x4e')]);var _0x1c32a7={'where':_0x49a29e[_0x643a('0x49')]};return db['FaxMessage'][_0x643a('0x30')](_0x1c32a7)[_0x643a('0x1f')](function(_0x4293c2){_0x4e3604[_0x643a('0x30')]=_0x4293c2;if(_0x4c44b0[_0x643a('0x3f')]['includeAll']){_0x49a29e[_0x643a('0x4f')]=[{'all':!![]}];}return db[_0x643a('0x3b')]['findAll'](_0x49a29e);})[_0x643a('0x1f')](function(_0x978baa){_0x4e3604[_0x643a('0x50')]=_0x978baa;return _0x4e3604;})[_0x643a('0x1f')](respondWithFilteredResult(_0x100b7d,_0x49a29e))['catch'](handleError(_0x100b7d,null));};exports[_0x643a('0x51')]=function(_0x2f9ee0,_0x4144a3){var _0x2aab45={'raw':!![],'where':{'id':_0x2f9ee0['params']['id']}},_0xf80397={};_0xf80397[_0x643a('0x42')]=_[_0x643a('0x40')](db[_0x643a('0x3b')][_0x643a('0x52')]);_0xf80397[_0x643a('0x3f')]=_[_0x643a('0x40')](_0x2f9ee0[_0x643a('0x3f')]);_0xf80397[_0x643a('0x4a')]=_[_0x643a('0x41')](_0xf80397[_0x643a('0x42')],_0xf80397[_0x643a('0x3f')]);_0x2aab45[_0x643a('0x43')]=_[_0x643a('0x41')](_0xf80397[_0x643a('0x42')],qs[_0x643a('0x44')](_0x2f9ee0[_0x643a('0x3f')]['fields']));_0x2aab45['attributes']=_0x2aab45[_0x643a('0x43')]['length']?_0x2aab45['attributes']:_0xf80397['model'];if(_0x2f9ee0[_0x643a('0x3f')]['includeAll']){_0x2aab45['include']=[{'all':!![]}];}_0x2aab45=_['merge']({},_0x2aab45,_0x2f9ee0[_0x643a('0x4e')]);return db[_0x643a('0x3b')][_0x643a('0x53')](_0x2aab45)[_0x643a('0x1f')](handleEntityNotFound(_0x4144a3,null))[_0x643a('0x1f')](respondWithResult(_0x4144a3,null))[_0x643a('0x29')](handleError(_0x4144a3,null));};exports[_0x643a('0x35')]=function(_0x563b94,_0x204f27){if(_0x563b94[_0x643a('0x54')]['id']){delete _0x563b94[_0x643a('0x54')]['id'];}return db[_0x643a('0x3b')][_0x643a('0x53')]({'where':{'id':_0x563b94[_0x643a('0x55')]['id']}})['then'](handleEntityNotFound(_0x204f27,null))['then'](saveUpdates(_0x563b94['body'],null))['then'](respondWithResult(_0x204f27,null))[_0x643a('0x29')](handleError(_0x204f27,null));};exports[_0x643a('0x56')]=function(_0x3681aa,_0x3b9259){return db[_0x643a('0x3b')][_0x643a('0x53')]({'where':{'id':_0x3681aa['params']['id']}})['then'](handleEntityNotFound(_0x3b9259,null))['then'](removeEntity(_0x3b9259,null))[_0x643a('0x29')](handleError(_0x3b9259,null));};exports[_0x643a('0x57')]=function(_0x1a097f,_0x19d053){return db[_0x643a('0x3b')]['describe']()['then'](respondWithResult(_0x19d053,null))['catch'](handleError(_0x19d053,null));};var interaction_log=require(_0x643a('0x15'))(_0x643a('0x58'));exports[_0x643a('0x59')]=function(_0x5e590d,_0xd5cf45,_0x272d38){var _0x35c099={'agent':{},'channel':_0x643a('0x5a')};if(_0x5e590d[_0x643a('0x54')]['id']){delete _0x5e590d[_0x643a('0x54')]['id'];}_0x5e590d['body'][_0x643a('0x5b')]=!![];_0x5e590d[_0x643a('0x54')][_0x643a('0x5c')]=moment()[_0x643a('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e590d[_0x643a('0x54')][_0x643a('0x5e')]=_0x5e590d[_0x643a('0x54')][_0x643a('0x5e')]||_0x5e590d['user']['id'];_0x35c099[_0x643a('0x5f')]['id']=_0x5e590d[_0x643a('0x54')][_0x643a('0x5e')];return db[_0x643a('0x3b')]['find']({'where':{'id':_0x5e590d['params']['id'],'UserId':null}})[_0x643a('0x1f')](handleEntityNotFound(_0xd5cf45,null))[_0x643a('0x1f')](saveUpdates(_0x5e590d[_0x643a('0x54')],null))[_0x643a('0x1f')](function(_0x49d7fe){if(_0x49d7fe){_0x35c099[_0x643a('0x28')]=_0x49d7fe['get']({'plain':!![]});return db['FaxInteraction'][_0x643a('0x53')]({'where':{'id':_0x49d7fe[_0x643a('0x60')]}});}return null;})['then'](handleEntityNotFound(_0xd5cf45,null))[_0x643a('0x1f')](function(_0x51fb7d){if(_0x51fb7d){return _0x51fb7d[_0x643a('0x35')]({'UserId':_0x5e590d[_0x643a('0x54')][_0x643a('0x5e')],'read1stAt':_[_0x643a('0x61')](_0x51fb7d['read1stAt'])?moment()[_0x643a('0x5d')](_0x643a('0x62')):undefined});}return null;})[_0x643a('0x1f')](function(_0x24dd17){if(_0x24dd17){_0x35c099[_0x643a('0x63')]=_0x24dd17[_0x643a('0x64')]({'plain':!![]});interaction_log[_0x643a('0x20')](_0x643a('0x65'),_0x5e590d[_0x643a('0x66')]['id'],_0x5e590d[_0x643a('0x66')][_0x643a('0x38')],_0x5e590d[_0x643a('0x66')][_0x643a('0x67')],_0x35c099[_0x643a('0x63')]['id'],_0x5e590d['body']?JSON['stringify'](_0x5e590d[_0x643a('0x54')]):_0x643a('0x68'));return respondWithRpcPromise(_0x643a('0x69'),_0x643a('0x6a'),_0x35c099);}return null;})[_0x643a('0x1f')](function(_0x4739f2){var _0xaafd70=_0x643a('0x6b')+_0x4739f2[_0x643a('0x28')][_0x643a('0x6c')];return db[_0x643a('0x6d')]['query'](_0xaafd70,{'type':db['Sequelize'][_0x643a('0x6e')]['SELECT'],'raw':!![]})[_0x643a('0x1f')](function(_0x223b33){return _0x223b33;});})['then'](function(_0x53bd92){if(_0x53bd92){_0x35c099[_0x643a('0x28')]['contact']=_0x53bd92[0x0];if(!_0x5e590d['body'][_0x643a('0x5e')])return;return db[_0x643a('0x6f')]['find']({'where':{'id':_0x5e590d[_0x643a('0x54')][_0x643a('0x5e')],'role':_0x643a('0x5f')},'attributes':['id',_0x643a('0x38'),_0x643a('0x70'),'email',_0x643a('0x71')],'raw':!![]});}return null;})['then'](function(_0x2d3b1f){if(!_0x2d3b1f)return null;_0x35c099[_0x643a('0x28')]['agent']=_0x2d3b1f;return _0x35c099;})['then'](function(_0x2f803f){if(_0x2f803f){if(_0x5e590d[_0x643a('0x54')][_0x643a('0x72')]){_0x35c099[_0x643a('0x28')][_0x643a('0x73')]=util[_0x643a('0x5d')]('SIP/%s',_0x5e590d['user']['name']);_0x35c099['message'][_0x643a('0x74')]=_0x35c099[_0x643a('0x74')];_0x35c099[_0x643a('0x28')]['event']=_0x643a('0x59');return respondWithRpcPromise(_0x643a('0x75'),_0x643a('0x75'),{'event':_0x643a('0x76'),'message':_0x35c099[_0x643a('0x28')]},client9002)[_0x643a('0x1f')](function(){return _0x35c099;});}return _0x35c099;}return null;})['then'](respondWithResult(_0xd5cf45,null))[_0x643a('0x29')](handleError(_0xd5cf45,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x643a('0x33')]=function(_0x42956d,_0x359e21,_0x5196b8){var _0x1f274e={'agent':{},'channel':'fax'};if(_0x42956d[_0x643a('0x54')]['id']){delete _0x42956d[_0x643a('0x54')]['id'];}_0x42956d[_0x643a('0x54')][_0x643a('0x5e')]=_0x42956d[_0x643a('0x54')][_0x643a('0x5e')]||_0x42956d['user']['id'];_0x1f274e[_0x643a('0x5f')]['id']=_0x42956d['body'][_0x643a('0x5e')];return db[_0x643a('0x3b')][_0x643a('0x53')]({'where':{'id':_0x42956d[_0x643a('0x55')]['id'],'UserId':null}})[_0x643a('0x1f')](handleEntityNotFound(_0x359e21,null))[_0x643a('0x1f')](function(_0x39ac75){if(_0x39ac75){_0x1f274e[_0x643a('0x28')]=_0x39ac75[_0x643a('0x64')]({'plain':!![]});return db[_0x643a('0x77')][_0x643a('0x53')]({'where':{'id':_0x39ac75[_0x643a('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x359e21,null))[_0x643a('0x1f')](function(_0x4b3d8c){if(_0x4b3d8c){_0x1f274e['interaction']=_0x4b3d8c[_0x643a('0x64')]({'plain':!![]});interaction_log[_0x643a('0x20')](_0x643a('0x78'),_0x42956d['user']['id'],_0x42956d['user']['name'],_0x42956d[_0x643a('0x66')][_0x643a('0x67')],_0x1f274e['interaction']['id'],_0x42956d[_0x643a('0x54')]?JSON[_0x643a('0x25')](_0x42956d[_0x643a('0x54')]):_0x643a('0x68'));return respondWithRpcPromise(_0x643a('0x79'),'rejectMessage',_0x1f274e);}return null;})[_0x643a('0x1f')](function(_0x2a96b5){var _0x24acc2=_0x643a('0x6b')+_0x2a96b5[_0x643a('0x28')][_0x643a('0x6c')];return db[_0x643a('0x6d')][_0x643a('0x3f')](_0x24acc2,{'type':db[_0x643a('0x7a')][_0x643a('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x118365){return _0x118365;});})[_0x643a('0x1f')](function(_0x1f340f){if(_0x1f340f){_0x1f274e['message'][_0x643a('0x7b')]=_0x1f340f[0x0];if(!_0x42956d['body'][_0x643a('0x5e')])return;return db[_0x643a('0x6f')][_0x643a('0x53')]({'where':{'id':_0x42956d[_0x643a('0x54')]['UserId'],'role':_0x643a('0x5f')},'attributes':['id',_0x643a('0x38'),'fullname','email',_0x643a('0x71')],'raw':!![]});}return null;})[_0x643a('0x1f')](function(_0x31d57c){if(!_0x31d57c)return null;_0x1f274e['message'][_0x643a('0x5f')]=_0x31d57c;return _0x1f274e;})[_0x643a('0x1f')](function(_0x1d9f06){if(_0x1d9f06){_0x1d9f06[_0x643a('0x28')]['interface']=util[_0x643a('0x5d')]('SIP/%s',_0x42956d[_0x643a('0x66')]['name']);_0x1d9f06[_0x643a('0x28')]['channel']=_0x1f274e['channel'];_0x1d9f06[_0x643a('0x28')][_0x643a('0x7c')]=_0x643a('0x33');respondWithRpcPromise(_0x643a('0x75'),_0x643a('0x75'),{'event':_0x643a('0x7d'),'message':_0x1d9f06[_0x643a('0x28')]},client9002);return _0x1f274e;}return null;})['then'](respondWithResult(_0x359e21,null))[_0x643a('0x29')](handleError(_0x359e21,null));};exports[_0x643a('0x7e')]=function(_0x588527,_0x400169){var _0x13ea33;return db[_0x643a('0x3b')][_0x643a('0x7e')](_0x588527[_0x643a('0x54')],{})[_0x643a('0x1f')](function(_0x4072f8){_0x13ea33=_0x4072f8;return db[_0x643a('0x7f')][_0x643a('0x80')]({'where':{'id':_0x13ea33[_0x643a('0x6c')]}});})[_0x643a('0x1f')](function(_0x25bb04){if(_['isNil'](_0x25bb04)){return;}else{_0x13ea33[_0x643a('0x5a')]=_0x25bb04[_0x643a('0x5a')];return db[_0x643a('0x81')][_0x643a('0x80')]({'where':{'id':_0x13ea33['AttachmentId']}});}})[_0x643a('0x1f')](function(_0x523c67){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x643a('0x61')](_0x588527[_0x643a('0x54')])?undefined:_0x588527['body'][_0x643a('0x82')],'path':_['isNil'](_0x523c67)?undefined:util['format'](_0x643a('0x83'),_0x523c67[_0x643a('0x84')]),'fax':_[_0x643a('0x61')](_0x13ea33[_0x643a('0x5a')])?undefined:_0x13ea33[_0x643a('0x5a')],'AttachmentId':_0x13ea33[_0x643a('0x85')]},client9002);})['then'](respondWithResult(_0x400169,0xc9))[_0x643a('0x29')](handleError(_0x400169,null));};exports[_0x643a('0x86')]=function(_0x31da87,_0x2035ca){var _0x4b7350=path[_0x643a('0x87')](config[_0x643a('0x88')],_0x643a('0x89'),_0x643a('0x8a'),_0x643a('0x8b'));return db[_0x643a('0x3b')][_0x643a('0x53')]({'where':{'id':_0x31da87[_0x643a('0x55')]['id']},'include':[{'model':db['Attachment'],'as':_0x643a('0x81')}]})['then'](handleEntityNotFound(_0x2035ca,null))[_0x643a('0x1f')](function(_0x506a62){if(_0x506a62){return _0x2035ca['download'](path['join'](_0x4b7350,_0x506a62[_0x643a('0x81')][_0x643a('0x84')]));}})[_0x643a('0x29')](handleError(_0x2035ca,null));};
\ No newline at end of file
index 350b88c..2debcb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x282a=['hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save','update','emit'];(function(_0x3c8f91,_0x95a462){var _0x5f1f71=function(_0x2118e8){while(--_0x2118e8){_0x3c8f91['push'](_0x3c8f91['shift']());}};_0x5f1f71(++_0x95a462);}(_0x282a,0xa2));var _0xa282=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x282a[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xa282('0x0'))['db'][_0xa282('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa282('0x2')](0x0);var events={'afterCreate':_0xa282('0x3'),'afterUpdate':_0xa282('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a51f8){return function(_0x3344f0,_0x5af988,_0xde1168){FaxMessageEvents['emit'](_0x3a51f8+':'+_0x3344f0['id'],_0x3344f0);FaxMessageEvents[_0xa282('0x5')](_0x3a51f8,_0x3344f0);_0xde1168(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xa282('0x6')](e,emitEvent(event));}}module[_0xa282('0x7')]=FaxMessageEvents;
\ No newline at end of file
+var _0x11c8=['hook','exports','../../mysqldb','FaxMessage','save','update','remove','emit'];(function(_0x2dcf6e,_0x379f35){var _0x2ddf90=function(_0x321810){while(--_0x321810){_0x2dcf6e['push'](_0x2dcf6e['shift']());}};_0x2ddf90(++_0x379f35);}(_0x11c8,0x19a));var _0x811c=function(_0x1f52f5,_0x404fcc){_0x1f52f5=_0x1f52f5-0x0;var _0x3921be=_0x11c8[_0x1f52f5];return _0x3921be;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x811c('0x0'))['db'][_0x811c('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x811c('0x2'),'afterUpdate':_0x811c('0x3'),'afterDestroy':_0x811c('0x4')};function emitEvent(_0x85a54c){return function(_0x16f1d6,_0x432f5b,_0x49a07c){FaxMessageEvents[_0x811c('0x5')](_0x85a54c+':'+_0x16f1d6['id'],_0x16f1d6);FaxMessageEvents[_0x811c('0x5')](_0x85a54c,_0x16f1d6);_0x49a07c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x811c('0x6')](e,emitEvent(event));}}module[_0x811c('0x7')]=FaxMessageEvents;
\ No newline at end of file
index 3433f47..af02656 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c21=['direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models'];(function(_0x1acc2d,_0x1cfdac){var _0x1cc820=function(_0x4b7492){while(--_0x4b7492){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0x1cc820(++_0x1cfdac);}(_0x7c21,0xe4));var _0x17c2=function(_0x5de1cc,_0x12731b){_0x5de1cc=_0x5de1cc-0x0;var _0x3626b5=_0x7c21[_0x5de1cc];return _0x3626b5;};'use strict';var _=require(_0x17c2('0x0'));var util=require(_0x17c2('0x1'));var logger=require(_0x17c2('0x2'))(_0x17c2('0x3'));var moment=require(_0x17c2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x17c2('0x5'));var rimraf=require(_0x17c2('0x6'));var config=require(_0x17c2('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x5bb645,_0x26093a){return _0x5bb645[_0x17c2('0x8')](_0x17c2('0x9'),attributes,{'tableName':_0x17c2('0xa'),'paranoid':![],'indexes':[{'name':_0x17c2('0xb'),'fields':[_0x17c2('0xc')],'type':_0x17c2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x137fdc,_0x5bbf68,_0xf22f4f){var _0x4ec5ca=_0x5bb645[_0x17c2('0xe')];var _0x24d469=_0x137fdc['get']({'plain':!![]});if(_0x24d469[_0x17c2('0xf')][_0x17c2('0x10')]()==='in'||_0x24d469[_0x17c2('0xf')][_0x17c2('0x10')]()===_0x17c2('0x11')&&!_0x24d469[_0x17c2('0x12')]&&!_[_0x17c2('0x13')](_0x24d469[_0x17c2('0x14')])){_0x4ec5ca[_0x17c2('0x15')]['findOne']({'where':{'id':_0x24d469[_0x17c2('0x16')]}})['then'](function(_0x226a52){if(_0x226a52){_0x226a52[_0x17c2('0x17')]({'lastMsgAt':_0x24d469['createdAt'],'lastMsgDirection':_0x24d469['direction'][_0x17c2('0x10')]()});}})[_0x17c2('0x18')](function(_0x5f32e0){console['error'](_0x5f32e0);});}_0xf22f4f();}},'charset':_0x17c2('0x19'),'collate':_0x17c2('0x1a')});};
\ No newline at end of file
+var _0x810e=['rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fti_fax_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path'];(function(_0x38172a,_0x2b1d49){var _0x10123c=function(_0x26976d){while(--_0x26976d){_0x38172a['push'](_0x38172a['shift']());}};_0x10123c(++_0x2b1d49);}(_0x810e,0x1e7));var _0xe810=function(_0x4cc765,_0x3cc6fc){_0x4cc765=_0x4cc765-0x0;var _0xfae330=_0x810e[_0x4cc765];return _0xfae330;};'use strict';var _=require(_0xe810('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe810('0x1'));var moment=require(_0xe810('0x2'));var BPromise=require(_0xe810('0x3'));var rp=require(_0xe810('0x4'));var fs=require('fs');var path=require(_0xe810('0x5'));var rimraf=require(_0xe810('0x6'));var config=require(_0xe810('0x7'));var attributes=require(_0xe810('0x8'));module[_0xe810('0x9')]=function(_0x2d1439,_0x36acdc){return _0x2d1439['define'](_0xe810('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xe810('0xb'),'fields':['body'],'type':_0xe810('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b0466,_0x60ea35,_0x109d5e){var _0x3b7828=_0x2d1439[_0xe810('0xd')];var _0x52d370=_0x2b0466['get']({'plain':!![]});if(_0x52d370[_0xe810('0xe')][_0xe810('0xf')]()==='in'||_0x52d370[_0xe810('0xe')]['toLowerCase']()==='out'&&!_0x52d370[_0xe810('0x10')]&&!_[_0xe810('0x11')](_0x52d370[_0xe810('0x12')])){_0x3b7828[_0xe810('0x13')][_0xe810('0x14')]({'where':{'id':_0x52d370[_0xe810('0x15')]}})[_0xe810('0x16')](function(_0x361d35){if(_0x361d35){_0x361d35[_0xe810('0x17')]({'lastMsgAt':_0x52d370[_0xe810('0x18')],'lastMsgDirection':_0x52d370[_0xe810('0xe')]['toLowerCase']()});}})[_0xe810('0x19')](function(_0x2daac3){console[_0xe810('0x1a')](_0x2daac3);});}_0x109d5e();}},'charset':_0xe810('0x1b'),'collate':_0xe810('0x1c')});};
\ No newline at end of file
index 87f213b..8e231e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./faxMessage.socket','request','then','info','request\x20sent','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x47c99e,_0x301028){var _0x29c0a5=function(_0x1e0613){while(--_0x1e0613){_0x47c99e['push'](_0x47c99e['shift']());}};_0x29c0a5(++_0x301028);}(_0x54ef,0x112));var _0xf54e=function(_0x54f73e,_0x214145){_0x54f73e=_0x54f73e-0x0;var _0xaaf0f5=_0x54ef[_0x54f73e];return _0xaaf0f5;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});config[_0xf54e('0xb')]=_[_0xf54e('0xc')](config['redis'],{'host':_0xf54e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf54e('0xb')]));require(_0xf54e('0xe'))['register'](socket);function respondWithRpcPromise(_0x26fc3e,_0xefa1c0,_0x6b9e61){return new BPromise(function(_0x3ecfb3,_0x5f232a){return client[_0xf54e('0xf')](_0x26fc3e,_0x6b9e61)[_0xf54e('0x10')](function(_0x143d66){logger[_0xf54e('0x11')]('FaxMessage,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'),JSON[_0xf54e('0x13')](_0x143d66));if(_0x143d66[_0xf54e('0x14')]){if(_0x143d66[_0xf54e('0x14')]['code']===0x1f4){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);return _0x5f232a(_0x143d66['error'][_0xf54e('0x16')]);}logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66['error']['message']);return _0x3ecfb3(_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);}else{logger[_0xf54e('0x11')](_0xf54e('0x15'),_0xefa1c0,_0xf54e('0x12'));_0x3ecfb3(_0x143d66[_0xf54e('0x17')][_0xf54e('0x16')]);}})[_0xf54e('0x18')](function(_0x1dcc04){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x1dcc04);_0x5f232a(_0x1dcc04);});});}exports['CreateFaxMessage']=function(_0x48a7e1){var _0x23e14=this;return new Promise(function(_0x59f338,_0x3e1556){return db[_0xf54e('0x19')][_0xf54e('0x1a')](_0x48a7e1[_0xf54e('0x1b')],{'raw':_0x48a7e1[_0xf54e('0x1c')]?_0x48a7e1[_0xf54e('0x1c')][_0xf54e('0x1d')]===undefined?!![]:![]:!![]})[_0xf54e('0x10')](function(_0x3c0169){logger[_0xf54e('0x11')](_0xf54e('0x1e'),_0x48a7e1);logger['debug'](_0xf54e('0x1e'),_0x48a7e1,JSON['stringify'](_0x3c0169));_0x59f338(_0x3c0169);})[_0xf54e('0x18')](function(_0x272df6){logger[_0xf54e('0x14')](_0xf54e('0x1e'),_0x272df6[_0xf54e('0x16')],_0x48a7e1);_0x3e1556(_0x23e14[_0xf54e('0x14')](0x1f4,_0x272df6[_0xf54e('0x16')]));});});};exports[_0xf54e('0x1f')]=function(_0x2342a9){var _0x33457f=this;return new Promise(function(_0xf6cdd7,_0x39c0ae){return db[_0xf54e('0x19')]['update'](_0x2342a9[_0xf54e('0x1b')],{'raw':_0x2342a9['options']?_0x2342a9[_0xf54e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x20')]||null:null,'attributes':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x21')]||null:null,'limit':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9['options']['limit']||null:null})[_0xf54e('0x10')](function(_0x258d29){logger[_0xf54e('0x11')](_0xf54e('0x1f'),_0x2342a9);logger[_0xf54e('0x22')](_0xf54e('0x1f'),_0x2342a9,JSON[_0xf54e('0x13')](_0x258d29));_0xf6cdd7(_0x258d29);})[_0xf54e('0x18')](function(_0x3ae704){logger[_0xf54e('0x14')]('UpdateFaxMessage',_0x3ae704['message'],_0x2342a9);_0x39c0ae(_0x33457f[_0xf54e('0x14')](0x1f4,_0x3ae704[_0xf54e('0x16')]));});});};
\ No newline at end of file
+var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0x40bd1f,_0x2b974f){var _0x40f6ca=function(_0x1a29d6){while(--_0x1a29d6){_0x40bd1f['push'](_0x40bd1f['shift']());}};_0x40f6ca(++_0x2b974f);}(_0x9f62,0x154));var _0x29f6=function(_0x116aed,_0x302e54){_0x116aed=_0x116aed-0x0;var _0x564e21=_0x9f62[_0x116aed];return _0x564e21;};'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});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});};
\ No newline at end of file
index c312e8e..07c471c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3815=['save','update','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x101cb8,_0x49910f){var _0x3d834f=function(_0x32811a){while(--_0x32811a){_0x101cb8['push'](_0x101cb8['shift']());}};_0x3d834f(++_0x49910f);}(_0x3815,0x7d));var _0x5381=function(_0x400996,_0x2f4c6b){_0x400996=_0x400996-0x0;var _0x55538f=_0x3815[_0x400996];return _0x55538f;};'use strict';var FaxMessageEvents=require(_0x5381('0x0'));var events=[_0x5381('0x1'),'remove',_0x5381('0x2')];function createListener(_0x547efe,_0x2545ad){return function(_0x21fc0f){_0x2545ad['emit'](_0x547efe,_0x21fc0f);};}function removeListener(_0x3c123b,_0x2754de){return function(){FaxMessageEvents[_0x5381('0x3')](_0x3c123b,_0x2754de);};}exports[_0x5381('0x4')]=function(_0x3640b9){for(var _0x5424e8=0x0,_0x370cb3=events['length'];_0x5424e8<_0x370cb3;_0x5424e8++){var _0x45f4d9=events[_0x5424e8];var _0x94c1eb=createListener(_0x5381('0x5')+_0x45f4d9,_0x3640b9);FaxMessageEvents['on'](_0x45f4d9,_0x94c1eb);}};
\ No newline at end of file
+var _0xd5d6=['update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','remove'];(function(_0x1a07e1,_0x14df72){var _0x1e2a3e=function(_0xec3201){while(--_0xec3201){_0x1a07e1['push'](_0x1a07e1['shift']());}};_0x1e2a3e(++_0x14df72);}(_0xd5d6,0x12e));var _0x6d5d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd5d6[_0x167cc1];return _0x10bc4b;};'use strict';var FaxMessageEvents=require(_0x6d5d('0x0'));var events=['save',_0x6d5d('0x1'),_0x6d5d('0x2')];function createListener(_0x3a1fd8,_0x3b9356){return function(_0x267b6e){_0x3b9356[_0x6d5d('0x3')](_0x3a1fd8,_0x267b6e);};}function removeListener(_0x45bd86,_0x1bbaba){return function(){FaxMessageEvents[_0x6d5d('0x4')](_0x45bd86,_0x1bbaba);};}exports[_0x6d5d('0x5')]=function(_0x53ba2a){for(var _0x501f95=0x0,_0x4a8a41=events[_0x6d5d('0x6')];_0x501f95<_0x4a8a41;_0x501f95++){var _0x2abb0b=events[_0x501f95];var _0x343c33=createListener(_0x6d5d('0x7')+_0x2abb0b,_0x53ba2a);FaxMessageEvents['on'](_0x2abb0b,_0x343c33);}};
\ No newline at end of file
index d846d09..83c6bf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxMessage.controller','isAuthenticated','index','get','/describe','/:id','show','download','tracked','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'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['get']('/:id/download',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['post']('/',auth[_0x49c4('0x7')](),interaction[_0x49c4('0xe')]('fax','faxmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router['put'](_0x49c4('0x12'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x10')](_0x49c4('0x14'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x15')]);router[_0x49c4('0x16')]('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x17')]);module[_0x49c4('0x18')]=router;
\ No newline at end of file
+var _0xec56=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','reject','delete','exports','multer','connect-timeout','express'];(function(_0x222424,_0x27e416){var _0x24d19a=function(_0x1418e2){while(--_0x1418e2){_0x222424['push'](_0x222424['shift']());}};_0x24d19a(++_0x27e416);}(_0xec56,0x1bd));var _0x6ec5=function(_0x178af7,_0x16a17c){_0x178af7=_0x178af7-0x0;var _0x46ea16=_0xec56[_0x178af7];return _0x46ea16;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['get'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x11')]);router[_0x6ec5('0x12')]('/',auth[_0x6ec5('0xa')](),interaction[_0x6ec5('0x13')](_0x6ec5('0x14'),'faxmessage:create'),controller[_0x6ec5('0x15')]);router[_0x6ec5('0x16')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x17')]);router[_0x6ec5('0x16')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller['accept']);router[_0x6ec5('0x16')]('/:id/reject',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x19')]);router[_0x6ec5('0x1a')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller['destroy']);module[_0x6ec5('0x1b')]=router;
\ No newline at end of file
index aa3ec40..2713288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4137=['exports','name','beepall','roundrobin','INTEGER','sequelize'];(function(_0x59d6f3,_0xbff235){var _0x5c3f23=function(_0x237e1d){while(--_0x237e1d){_0x59d6f3['push'](_0x59d6f3['shift']());}};_0x5c3f23(++_0xbff235);}(_0x4137,0xfb));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7413('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x7413('0x3'),_0x7413('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7413('0x5')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xb8ee=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','INTEGER','sequelize'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xb8ee,0x14c));var _0xeb8e=function(_0xb36843,_0x57c1f4){_0xb36843=_0xb36843-0x0;var _0x227b83=_0xb8ee[_0xb36843];return _0x227b83;};'use strict';var Sequelize=require(_0xeb8e('0x0'));module[_0xeb8e('0x1')]={'name':{'type':Sequelize[_0xeb8e('0x2')],'unique':_0xeb8e('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeb8e('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeb8e('0x4')](_0xeb8e('0x5'),_0xeb8e('0x6'),_0xeb8e('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xeb8e('0x8')],'defaultValue':0x0}};
\ No newline at end of file
index 402c9db..81e4262 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x597d=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','UserFaxQueue','FaxQueueId','findAll','User','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','hasOwnProperty','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','spread','userFaxQueue:remove','getAgents','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js'];(function(_0x59cce9,_0x216c0a){var _0x49ce84=function(_0x9de979){while(--_0x9de979){_0x59cce9['push'](_0x59cce9['shift']());}};_0x49ce84(++_0x216c0a);}(_0x597d,0x81));var _0xd597=function(_0x11e3b0,_0x303231){_0x11e3b0=_0x11e3b0-0x0;var _0xf84908=_0x597d[_0x11e3b0];return _0xf84908;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd597('0x0'));var zipdir=require(_0xd597('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd597('0x2'));var Mustache=require(_0xd597('0x3'));var util=require(_0xd597('0x4'));var path=require(_0xd597('0x5'));var sox=require(_0xd597('0x6'));var csv=require('to-csv');var ejs=require(_0xd597('0x7'));var fs=require('fs');var fs_extra=require(_0xd597('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd597('0x9'));var jsforce=require(_0xd597('0xa'));var deskjs=require(_0xd597('0xb'));var toCsv=require(_0xd597('0xc'));var querystring=require(_0xd597('0xd'));var Papa=require(_0xd597('0xe'));var Redis=require('ioredis');var authService=require(_0xd597('0xf'));var qs=require(_0xd597('0x10'));var as=require(_0xd597('0x11'));var hardwareService=require(_0xd597('0x12'));var logger=require('../../config/logger')(_0xd597('0x13'));var utils=require(_0xd597('0x14'));var config=require(_0xd597('0x15'));var licenseUtil=require(_0xd597('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd597('0x17')](config[_0xd597('0x18')],{'host':_0xd597('0x19'),'port':0x18eb});var socket=require(_0xd597('0x1a'))(new Redis(config[_0xd597('0x18')]));require(_0xd597('0x1b'))['register'](socket);function respondWithStatusCode(_0x5bf862,_0x3f7b06){_0x3f7b06=_0x3f7b06||0xcc;return function(_0x2b8e5e){if(_0x2b8e5e){return _0x5bf862[_0xd597('0x1c')](_0x3f7b06);}return _0x5bf862[_0xd597('0x1d')](_0x3f7b06)[_0xd597('0x1e')]();};}function respondWithResult(_0x598ea4,_0xd40197){_0xd40197=_0xd40197||0xc8;return function(_0xef59e9){if(_0xef59e9){return _0x598ea4[_0xd597('0x1d')](_0xd40197)[_0xd597('0x1f')](_0xef59e9);}};}function respondWithFilteredResult(_0xf99185,_0x11d6b1){return function(_0x4835d8){if(_0x4835d8){var _0x5803f5=typeof _0x11d6b1[_0xd597('0x20')]===_0xd597('0x21')&&typeof _0x11d6b1[_0xd597('0x22')]===_0xd597('0x21');var _0x4dbf16=_0x4835d8['count'];var _0x188313=_0x5803f5?0x0:_0x11d6b1[_0xd597('0x20')];var _0x4a03b5=_0x5803f5?_0x4835d8[_0xd597('0x23')]:_0x11d6b1['offset']+_0x11d6b1[_0xd597('0x22')];var _0x2fb61e;if(_0x4a03b5>=_0x4dbf16){_0x4a03b5=_0x4dbf16;_0x2fb61e=0xc8;}else{_0x2fb61e=0xce;}_0xf99185[_0xd597('0x1d')](_0x2fb61e);return _0xf99185[_0xd597('0x24')](_0xd597('0x25'),_0x188313+'-'+_0x4a03b5+'/'+_0x4dbf16)[_0xd597('0x1f')](_0x4835d8);}return null;};}function patchUpdates(_0x421959){return function(_0xd675e7){try{jsonpatch[_0xd597('0x26')](_0xd675e7,_0x421959,!![]);}catch(_0x46b4ad){return BPromise[_0xd597('0x27')](_0x46b4ad);}return _0xd675e7['save']();};}function saveUpdates(_0x369cad,_0x36d789){return function(_0x3d2945){if(_0x3d2945){return _0x3d2945[_0xd597('0x28')](_0x369cad)[_0xd597('0x29')](function(_0x579b5a){return _0x579b5a;});}return null;};}function removeEntity(_0x21fcd6,_0x55df7e){return function(_0x4ed918){if(_0x4ed918){return _0x4ed918[_0xd597('0x2a')]()[_0xd597('0x29')](function(){var _0x24b351=_0x4ed918[_0xd597('0x2b')]({'plain':!![]});var _0x3cd338='FaxQueues';return db[_0xd597('0x2c')]['destroy']({'where':{'type':_0x3cd338,'resourceId':_0x24b351['id']}})[_0xd597('0x29')](function(){return _0x4ed918;});})[_0xd597('0x29')](function(){_0x21fcd6[_0xd597('0x1d')](0xcc)[_0xd597('0x1e')]();});}};}function handleEntityNotFound(_0x1c7473,_0x4ea343){return function(_0x1102cd){if(!_0x1102cd){_0x1c7473[_0xd597('0x1c')](0x194);}return _0x1102cd;};}function handleError(_0x541182,_0x3e0005){_0x3e0005=_0x3e0005||0x1f4;return function(_0x10fbee){logger[_0xd597('0x2d')](_0x10fbee['stack']);if(_0x10fbee['name']){delete _0x10fbee[_0xd597('0x2e')];}_0x541182[_0xd597('0x1d')](_0x3e0005)[_0xd597('0x2f')](_0x10fbee);};}exports[_0xd597('0x30')]=function(_0x475556,_0x4cfe1d){var _0x33fcda={},_0x369508={},_0x12b918={'count':0x0,'rows':[]};var _0x39f220=_[_0xd597('0x31')](db[_0xd597('0x32')][_0xd597('0x33')],function(_0x32d6ef){return{'name':_0x32d6ef[_0xd597('0x34')],'type':_0x32d6ef[_0xd597('0x35')]['key']};});_0x369508[_0xd597('0x36')]=_[_0xd597('0x31')](_0x39f220,'name');_0x369508['query']=_['keys'](_0x475556[_0xd597('0x37')]);_0x369508[_0xd597('0x38')]=_[_0xd597('0x39')](_0x369508[_0xd597('0x36')],_0x369508[_0xd597('0x37')]);_0x33fcda[_0xd597('0x3a')]=_[_0xd597('0x39')](_0x369508[_0xd597('0x36')],qs[_0xd597('0x3b')](_0x475556[_0xd597('0x37')][_0xd597('0x3b')]));_0x33fcda[_0xd597('0x3a')]=_0x33fcda[_0xd597('0x3a')][_0xd597('0x3c')]?_0x33fcda[_0xd597('0x3a')]:_0x369508[_0xd597('0x36')];if(!_0x475556['query']['hasOwnProperty'](_0xd597('0x3d'))){_0x33fcda[_0xd597('0x22')]=qs[_0xd597('0x22')](_0x475556['query'][_0xd597('0x22')]);_0x33fcda[_0xd597('0x20')]=qs[_0xd597('0x20')](_0x475556['query']['offset']);}_0x33fcda[_0xd597('0x3e')]=qs[_0xd597('0x3f')](_0x475556[_0xd597('0x37')][_0xd597('0x3f')]);_0x33fcda[_0xd597('0x40')]=qs['filters'](_[_0xd597('0x41')](_0x475556[_0xd597('0x37')],_0x369508[_0xd597('0x38')]),_0x39f220);if(_0x475556[_0xd597('0x37')][_0xd597('0x42')]){_0x33fcda[_0xd597('0x40')]=_[_0xd597('0x43')](_0x33fcda[_0xd597('0x40')],{'$or':_[_0xd597('0x31')](_0x39f220,function(_0x33d414){if(_0x33d414[_0xd597('0x35')]!==_0xd597('0x44')){var _0x1f9522={};_0x1f9522[_0x33d414[_0xd597('0x2e')]]={'$like':'%'+_0x475556[_0xd597('0x37')][_0xd597('0x42')]+'%'};return _0x1f9522;}})});}_0x33fcda=_[_0xd597('0x43')]({},_0x33fcda,_0x475556[_0xd597('0x45')]);var _0x6ca287={'where':_0x33fcda[_0xd597('0x40')]};return db[_0xd597('0x32')]['count'](_0x6ca287)['then'](function(_0x59f943){_0x12b918[_0xd597('0x23')]=_0x59f943;if(_0x475556['query']['includeAll']){_0x33fcda[_0xd597('0x46')]=[{'all':!![]}];}return db[_0xd597('0x32')]['findAll'](_0x33fcda);})[_0xd597('0x29')](function(_0x1557a9){_0x12b918[_0xd597('0x47')]=_0x1557a9;return _0x12b918;})[_0xd597('0x29')](respondWithFilteredResult(_0x4cfe1d,_0x33fcda))[_0xd597('0x48')](handleError(_0x4cfe1d,null));};exports[_0xd597('0x49')]=function(_0x33f412,_0x15de0c){var _0x366a81={'raw':!![],'where':{'id':_0x33f412['params']['id']}},_0x1c08fb={};_0x1c08fb[_0xd597('0x36')]=_[_0xd597('0x4a')](db[_0xd597('0x32')][_0xd597('0x33')]);_0x1c08fb[_0xd597('0x37')]=_[_0xd597('0x4a')](_0x33f412[_0xd597('0x37')]);_0x1c08fb[_0xd597('0x38')]=_[_0xd597('0x39')](_0x1c08fb['model'],_0x1c08fb[_0xd597('0x37')]);_0x366a81['attributes']=_[_0xd597('0x39')](_0x1c08fb[_0xd597('0x36')],qs[_0xd597('0x3b')](_0x33f412[_0xd597('0x37')]['fields']));_0x366a81['attributes']=_0x366a81['attributes'][_0xd597('0x3c')]?_0x366a81[_0xd597('0x3a')]:_0x1c08fb['model'];if(_0x33f412[_0xd597('0x37')]['includeAll']){_0x366a81[_0xd597('0x46')]=[{'all':!![]}];}_0x366a81=_[_0xd597('0x43')]({},_0x366a81,_0x33f412[_0xd597('0x45')]);return db[_0xd597('0x32')]['find'](_0x366a81)[_0xd597('0x29')](handleEntityNotFound(_0x15de0c,null))[_0xd597('0x29')](respondWithResult(_0x15de0c,null))[_0xd597('0x48')](handleError(_0x15de0c,null));};exports[_0xd597('0x4b')]=function(_0x3632e8,_0x41c6a1){return db[_0xd597('0x32')][_0xd597('0x4b')](_0x3632e8[_0xd597('0x4c')],{})[_0xd597('0x29')](function(_0x379aa9){var _0x9a471c=_0x3632e8[_0xd597('0x4d')][_0xd597('0x2b')]({'plain':!![]});if(!_0x9a471c)throw new Error(_0xd597('0x4e'));if(_0x9a471c['role']===_0xd597('0x4d')){var _0x334e34=_0x379aa9['get']({'plain':!![]});var _0x3357f2=_0xd597('0x4f');return db[_0xd597('0x50')][_0xd597('0x51')]({'where':{'name':_0x3357f2,'userProfileId':_0x9a471c[_0xd597('0x52')]},'raw':!![]})[_0xd597('0x29')](function(_0x1bf2f3){if(_0x1bf2f3&&_0x1bf2f3['autoAssociation']===0x0){return db['UserProfileResource'][_0xd597('0x4b')]({'name':_0x334e34['name'],'resourceId':_0x334e34['id'],'type':_0x1bf2f3[_0xd597('0x2e')],'sectionId':_0x1bf2f3['id']},{})[_0xd597('0x29')](function(){return _0x379aa9;});}else{return _0x379aa9;}})['catch'](function(_0x4bd62b){logger[_0xd597('0x2d')](_0xd597('0x53'),_0x4bd62b);throw _0x4bd62b;});}return _0x379aa9;})[_0xd597('0x29')](respondWithResult(_0x41c6a1,0xc9))[_0xd597('0x48')](handleError(_0x41c6a1,null));};exports[_0xd597('0x28')]=function(_0x1b8e60,_0x229481){if(_0x1b8e60[_0xd597('0x4c')]['id']){delete _0x1b8e60[_0xd597('0x4c')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x1b8e60[_0xd597('0x54')]['id']}})[_0xd597('0x29')](handleEntityNotFound(_0x229481,null))[_0xd597('0x29')](saveUpdates(_0x1b8e60['body'],null))['then'](respondWithResult(_0x229481,null))[_0xd597('0x48')](handleError(_0x229481,null));};exports[_0xd597('0x2a')]=function(_0x29b3d8,_0x41a666){return db[_0xd597('0x32')][_0xd597('0x51')]({'where':{'id':_0x29b3d8['params']['id']}})[_0xd597('0x29')](handleEntityNotFound(_0x41a666,null))[_0xd597('0x29')](removeEntity(_0x41a666,null))[_0xd597('0x48')](handleError(_0x41a666,null));};exports['describe']=function(_0x5a3e9b,_0xe4c413){return db[_0xd597('0x32')]['describe']()[_0xd597('0x29')](respondWithResult(_0xe4c413,null))[_0xd597('0x48')](handleError(_0xe4c413,null));};exports[_0xd597('0x55')]=function(_0x334c28,_0x31c1c,_0x2ac238){var _0x5a980e={'raw':!![],'where':{}},_0x4b415a={},_0x43332e;return db[_0xd597('0x32')]['findOne']({'where':{'id':_0x334c28[_0xd597('0x54')]['id']}})[_0xd597('0x29')](handleEntityNotFound(_0x31c1c,null))[_0xd597('0x29')](function(_0x5dc60d){if(_0x5dc60d){_0x43332e=_0x5dc60d[_0xd597('0x2b')]({'plain':!![]});_0x4b415a[_0xd597('0x36')]=_[_0xd597('0x4a')](db[_0xd597('0x56')][_0xd597('0x33')]);_0x4b415a[_0xd597('0x37')]=_['keys'](_0x334c28[_0xd597('0x37')]);_0x4b415a[_0xd597('0x38')]=_[_0xd597('0x39')](_0x4b415a[_0xd597('0x36')],_0x4b415a['query']);_0x5a980e[_0xd597('0x3a')]=_[_0xd597('0x39')](_0x4b415a['model'],qs[_0xd597('0x3b')](_0x334c28['query'][_0xd597('0x3b')]));_0x5a980e[_0xd597('0x3a')]=_0x5a980e[_0xd597('0x3a')][_0xd597('0x3c')]?_0x5a980e[_0xd597('0x3a')]:_0x4b415a[_0xd597('0x36')];if(!_0x334c28[_0xd597('0x37')]['hasOwnProperty'](_0xd597('0x3d'))){_0x5a980e['limit']=qs[_0xd597('0x22')](_0x334c28[_0xd597('0x37')][_0xd597('0x22')]);_0x5a980e[_0xd597('0x20')]=qs[_0xd597('0x20')](_0x334c28[_0xd597('0x37')][_0xd597('0x20')]);}_0x5a980e[_0xd597('0x3e')]=qs[_0xd597('0x3f')](_0x334c28['query'][_0xd597('0x3f')]);_0x5a980e['where']=qs[_0xd597('0x38')](_[_0xd597('0x41')](_0x334c28['query'],_0x4b415a[_0xd597('0x38')]));_0x5a980e[_0xd597('0x40')][_0xd597('0x57')]=_0x5dc60d['id'];if(_0x334c28[_0xd597('0x37')][_0xd597('0x42')]){_0x5a980e['where']=_[_0xd597('0x43')](_0x5a980e[_0xd597('0x40')],{'$or':_[_0xd597('0x31')](_0x5a980e[_0xd597('0x3a')],function(_0x113f71){var _0x940ef5={};_0x940ef5[_0x113f71]={'$like':'%'+_0x334c28[_0xd597('0x37')][_0xd597('0x42')]+'%'};return _0x940ef5;})});}_0x5a980e=_['merge']({},_0x5a980e,_0x334c28[_0xd597('0x45')]);return db[_0xd597('0x56')][_0xd597('0x58')](_0x5a980e);}})[_0xd597('0x29')](function(_0x13bc02){if(_0x13bc02){return db[_0xd597('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x13bc02,_0xd597('0x5a')),'role':_0xd597('0x5b')},'attributes':['id',_0xd597('0x2e'),_0xd597('0x5c'),_0xd597('0x5d'),_0xd597('0x5e')]});}})[_0xd597('0x29')](function(_0x326b33){if(_0x326b33){return{'count':_0x326b33[_0xd597('0x23')],'rows':_[_0xd597('0x31')](_0x326b33['rows'],function(_0x3b6bb6){return{'membername':_0x3b6bb6[_0xd597('0x2e')],'UserId':_0x3b6bb6['id'],'queue_name':_0x43332e[_0xd597('0x2e')],'FaxQueueId':_0x43332e['id'],'interface':util[_0xd597('0x5f')](_0xd597('0x60'),'SIP',_0x3b6bb6[_0xd597('0x2e')]),'penalty':0x0,'paused':_0x3b6bb6[_0xd597('0x5c')],'createdAt':_0x3b6bb6[_0xd597('0x5e')],'updatedAt':_0x3b6bb6[_0xd597('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x31c1c,_0x5a980e))['catch'](handleError(_0x31c1c,null));};exports[_0xd597('0x61')]=function(_0x102494,_0xa982d9,_0x267a4a){var _0x345b58={};var _0x2dbdfa={};var _0x26c4bc;var _0x64ed95;return db[_0xd597('0x32')][_0xd597('0x62')]({'where':{'id':_0x102494[_0xd597('0x54')]['id']}})['then'](handleEntityNotFound(_0xa982d9,null))['then'](function(_0x349ee5){if(_0x349ee5){_0x26c4bc=_0x349ee5;_0x2dbdfa['model']=_[_0xd597('0x4a')](db['Team']['rawAttributes']);_0x2dbdfa[_0xd597('0x37')]=_[_0xd597('0x4a')](_0x102494[_0xd597('0x37')]);_0x2dbdfa[_0xd597('0x38')]=_['intersection'](_0x2dbdfa[_0xd597('0x36')],_0x2dbdfa['query']);_0x345b58[_0xd597('0x3a')]=_[_0xd597('0x39')](_0x2dbdfa[_0xd597('0x36')],qs[_0xd597('0x3b')](_0x102494['query'][_0xd597('0x3b')]));_0x345b58['attributes']=_0x345b58['attributes'][_0xd597('0x3c')]?_0x345b58[_0xd597('0x3a')]:_0x2dbdfa[_0xd597('0x36')];_0x345b58[_0xd597('0x3e')]=qs[_0xd597('0x3f')](_0x102494[_0xd597('0x37')][_0xd597('0x3f')]);_0x345b58[_0xd597('0x40')]=qs[_0xd597('0x38')](_['pick'](_0x102494['query'],_0x2dbdfa[_0xd597('0x38')]));if(_0x102494[_0xd597('0x37')][_0xd597('0x42')]){_0x345b58['where']=_[_0xd597('0x43')](_0x345b58['where'],{'$or':_['map'](_0x345b58[_0xd597('0x3a')],function(_0x4fc35d){var _0x33853d={};_0x33853d[_0x4fc35d]={'$like':'%'+_0x102494[_0xd597('0x37')][_0xd597('0x42')]+'%'};return _0x33853d;})});}_0x345b58=_[_0xd597('0x43')]({},_0x345b58,_0x102494[_0xd597('0x45')]);return _0x26c4bc['getTeams'](_0x345b58);}})['then'](function(_0x1f9237){if(_0x1f9237){_0x64ed95=_0x1f9237[_0xd597('0x3c')];if(!_0x102494[_0xd597('0x37')][_0xd597('0x63')](_0xd597('0x3d'))){_0x345b58[_0xd597('0x22')]=qs[_0xd597('0x22')](_0x102494[_0xd597('0x37')][_0xd597('0x22')]);_0x345b58[_0xd597('0x20')]=qs[_0xd597('0x20')](_0x102494[_0xd597('0x37')]['offset']);}return _0x26c4bc[_0xd597('0x61')](_0x345b58);}})['then'](function(_0x327459){if(_0x327459){return _0x327459?{'count':_0x64ed95,'rows':_0x327459}:null;}})['then'](respondWithResult(_0xa982d9,null))['catch'](handleError(_0xa982d9,null));};exports['addTeams']=function(_0x407dc9,_0x51d662,_0x50425b){var _0x5474db=_0x407dc9[_0xd597('0x4c')][_0xd597('0x64')];return db[_0xd597('0x65')][_0xd597('0x58')]({'where':{'id':_0x5474db},'attributes':['id'],'include':[{'model':db[_0xd597('0x59')],'as':_0xd597('0x66'),'attributes':['id',_0xd597('0x2e'),_0xd597('0x67'),_0xd597('0x68'),_0xd597('0x69')],'raw':!![]}]})[_0xd597('0x29')](function(_0x1deb20){if(_0x1deb20){var _0x4e6638=_[_0xd597('0x6a')](_0x1deb20,function(_0x28dee7){var _0x325c29=_0x28dee7[_0xd597('0x2b')]({'plain':!![]});return _0x325c29[_0xd597('0x66')];});return db[_0xd597('0x32')]['find']({'where':{'id':_0x407dc9[_0xd597('0x54')]['id']}})['then'](function(_0x20d06c){return db[_0xd597('0x6b')][_0xd597('0x6c')](function(_0x2a37ef){return _0x20d06c['addTeams'](_0x5474db,{'transaction':_0x2a37ef})[_0xd597('0x29')](function(){return BPromise[_0xd597('0x6d')](_0x4e6638,function(_0x4e6b4a){return db[_0xd597('0x56')][_0xd597('0x6e')]({'where':{'UserId':_0x4e6b4a['id'],'FaxQueueId':_0x407dc9[_0xd597('0x54')]['id']},'transaction':_0x2a37ef});});})[_0xd597('0x29')](function(){_0x4e6638[_0xd597('0x6f')](function(_0x2f1df3){socket['emit'](_0xd597('0x70'),{'UserId':_0x2f1df3['id'],'FaxQueueId':_0x20d06c['id']});});});});});}})[_0xd597('0x29')](respondWithStatusCode(_0x51d662,null))[_0xd597('0x48')](handleError(_0x51d662,null));};exports[_0xd597('0x71')]=function(_0x1f9900,_0x33f71c,_0x29835d){return db[_0xd597('0x65')]['findAll']({'where':{'id':_0x1f9900['query'][_0xd597('0x64')]},'attributes':['id'],'include':[{'model':db[_0xd597('0x59')],'as':_0xd597('0x66'),'attributes':['id'],'raw':!![]}]})[_0xd597('0x29')](handleEntityNotFound(_0x33f71c,null))[_0xd597('0x29')](function(_0x4d8d81){var _0x323ff2=_['map'](_0x4d8d81,'id');var _0x5586cc=[];var _0x3313c2=[];var _0x4e7fe8=squel[_0xd597('0x72')]();_0x4e7fe8[_0xd597('0x73')](_0xd597('0x74'))[_0xd597('0x75')](_0xd597('0x76'),'tq')[_0xd597('0x77')](_0xd597('0x78'),'ut',_0xd597('0x79'))['where']('FaxQueueId\x20=\x20?',_0x1f9900[_0xd597('0x54')]['id']);for(var _0x2a0194=0x0;_0x2a0194<_0x4d8d81[_0xd597('0x3c')];_0x2a0194+=0x1){let _0xe6b95f=_0x4d8d81[_0x2a0194];for(var _0x271ebc=0x0;_0x271ebc<_0xe6b95f['Agents'][_0xd597('0x3c')];_0x271ebc+=0x1){let _0x125374=_0xe6b95f['Agents'][_0x271ebc];var _0x15147b=_0x4e7fe8[_0xd597('0x7a')]();_0x15147b[_0xd597('0x40')]('ut.UserId\x20=\x20?',_0x125374['id']);_0x3313c2[_0xd597('0x7b')](db[_0xd597('0x6b')][_0xd597('0x37')](_0x15147b[_0xd597('0x7c')](),{'type':db[_0xd597('0x6b')][_0xd597('0x7d')][_0xd597('0x7e')]})[_0xd597('0x29')](function(_0x120c6b){if(_0x120c6b[_0xd597('0x3c')]===0x1){return _0x125374['id'];}else{var _0x55dc9e=_[_0xd597('0x7f')](_[_0xd597('0x31')](_0x120c6b,_0xd597('0x80')),function(_0x3238d2){return _[_0xd597('0x81')](_0x323ff2,_0x3238d2);});if(_0x55dc9e){return _0x125374['id'];}}}));}}return BPromise[_0xd597('0x82')](_0x3313c2)[_0xd597('0x29')](function(_0x14bb7f){_0x5586cc=_(_0x5586cc)[_0xd597('0x83')](_0x14bb7f)[_0xd597('0x84')]()[_0xd597('0x85')]();return db[_0xd597('0x32')][_0xd597('0x51')]({'where':{'id':_0x1f9900[_0xd597('0x54')]['id']}})[_0xd597('0x29')](function(_0x20cde4){return db['sequelize'][_0xd597('0x6c')](function(_0x36bad4){return _0x20cde4[_0xd597('0x71')](_0x1f9900[_0xd597('0x37')][_0xd597('0x64')],{'transaction':_0x36bad4})[_0xd597('0x29')](function(){if(!_[_0xd597('0x86')](_0x5586cc)){return _0x20cde4[_0xd597('0x87')](_0x5586cc,{'transaction':_0x36bad4});}})[_0xd597('0x29')](function(){_0x5586cc[_0xd597('0x6f')](function(_0x2a2df4){socket[_0xd597('0x88')]('userFaxQueue:remove',{'UserId':_0x2a2df4,'FaxQueueId':_0x20cde4['id']});});});});});});})[_0xd597('0x29')](respondWithStatusCode(_0x33f71c,null))[_0xd597('0x48')](handleError(_0x33f71c,null));};exports[_0xd597('0x89')]=function(_0x591555,_0x15bbc1,_0x4f20ac){return db[_0xd597('0x32')][_0xd597('0x51')]({'where':{'id':_0x591555[_0xd597('0x54')]['id']}})[_0xd597('0x29')](handleEntityNotFound(_0x15bbc1,null))['then'](function(_0x48848b){if(_0x48848b){return _0x48848b['addAgents'](_0x591555[_0xd597('0x4c')][_0xd597('0x64')],_['omit'](_0x591555[_0xd597('0x4c')],[_0xd597('0x64'),'id'])||{})[_0xd597('0x8a')](function(_0x3f0f1b){for(var _0x54e7a4=0x0;_0x54e7a4<_0x591555[_0xd597('0x4c')][_0xd597('0x64')][_0xd597('0x3c')];_0x54e7a4+=0x1){socket[_0xd597('0x88')](_0xd597('0x70'),{'UserId':Number(_0x591555['body']['ids'][_0x54e7a4]),'FaxQueueId':Number(_0x591555[_0xd597('0x54')]['id'])});}return _0x3f0f1b;});}})[_0xd597('0x29')](respondWithResult(_0x15bbc1,null))[_0xd597('0x48')](handleError(_0x15bbc1,null));};exports['removeAgents']=function(_0x5c6b97,_0x11136d,_0x436ec8){return db[_0xd597('0x32')][_0xd597('0x51')]({'where':{'id':_0x5c6b97[_0xd597('0x54')]['id']}})['then'](handleEntityNotFound(_0x11136d,null))[_0xd597('0x29')](function(_0x22cedc){if(_0x22cedc){return _0x22cedc[_0xd597('0x87')](_0x5c6b97[_0xd597('0x37')]['ids'])[_0xd597('0x29')](function(){if(_['isArray'](_0x5c6b97[_0xd597('0x37')][_0xd597('0x64')])){for(var _0x2e7e78=0x0;_0x2e7e78<_0x5c6b97[_0xd597('0x37')][_0xd597('0x64')][_0xd597('0x3c')];_0x2e7e78+=0x1){socket[_0xd597('0x88')](_0xd597('0x8b'),{'UserId':Number(_0x5c6b97[_0xd597('0x37')]['ids'][_0x2e7e78]),'FaxQueueId':Number(_0x5c6b97[_0xd597('0x54')]['id'])});}}else{socket['emit'](_0xd597('0x8b'),{'UserId':Number(_0x5c6b97['query']['ids']),'FaxQueueId':Number(_0x5c6b97[_0xd597('0x54')]['id'])});}});}})[_0xd597('0x29')](respondWithStatusCode(_0x11136d,null))[_0xd597('0x48')](handleError(_0x11136d,null));};exports[_0xd597('0x8c')]=function(_0x5d683e,_0x1609d6,_0x7f0f1d){var _0x202dfc={};var _0x179806={};var _0x1f3ddf;var _0x597489;return db[_0xd597('0x32')][_0xd597('0x62')]({'where':{'id':_0x5d683e[_0xd597('0x54')]['id']}})['then'](handleEntityNotFound(_0x1609d6,null))[_0xd597('0x29')](function(_0x1afe39){if(_0x1afe39){_0x1f3ddf=_0x1afe39;_0x179806[_0xd597('0x36')]=_['keys'](db['User'][_0xd597('0x33')]);_0x179806[_0xd597('0x37')]=_['keys'](_0x5d683e[_0xd597('0x37')]);_0x179806[_0xd597('0x38')]=_[_0xd597('0x39')](_0x179806['model'],_0x179806[_0xd597('0x37')]);_0x202dfc[_0xd597('0x3a')]=_[_0xd597('0x39')](_0x179806[_0xd597('0x36')],qs[_0xd597('0x3b')](_0x5d683e['query']['fields']));_0x202dfc[_0xd597('0x3a')]=_0x202dfc[_0xd597('0x3a')][_0xd597('0x3c')]?_0x202dfc[_0xd597('0x3a')]:_0x179806['model'];_0x202dfc[_0xd597('0x3e')]=qs[_0xd597('0x3f')](_0x5d683e[_0xd597('0x37')][_0xd597('0x3f')]);_0x202dfc[_0xd597('0x40')]=qs[_0xd597('0x38')](_['pick'](_0x5d683e[_0xd597('0x37')],_0x179806['filters']));if(_0x5d683e[_0xd597('0x37')]['filter']){_0x202dfc[_0xd597('0x40')]=_[_0xd597('0x43')](_0x202dfc[_0xd597('0x40')],{'$or':_[_0xd597('0x31')](_0x202dfc[_0xd597('0x3a')],function(_0x591dc){var _0x96af18={};_0x96af18[_0x591dc]={'$like':'%'+_0x5d683e[_0xd597('0x37')]['filter']+'%'};return _0x96af18;})});}_0x202dfc=_['merge']({},_0x202dfc,_0x5d683e['options']);return _0x1f3ddf[_0xd597('0x8c')](_0x202dfc);}})[_0xd597('0x29')](function(_0x4445b2){if(_0x4445b2){_0x597489=_0x4445b2[_0xd597('0x3c')];if(!_0x5d683e[_0xd597('0x37')][_0xd597('0x63')]('nolimit')){_0x202dfc[_0xd597('0x22')]=qs[_0xd597('0x22')](_0x5d683e[_0xd597('0x37')][_0xd597('0x22')]);_0x202dfc[_0xd597('0x20')]=qs['offset'](_0x5d683e[_0xd597('0x37')][_0xd597('0x20')]);}return _0x1f3ddf[_0xd597('0x8c')](_0x202dfc);}})[_0xd597('0x29')](function(_0x30b953){if(_0x30b953){return _0x30b953?{'count':_0x597489,'rows':_0x30b953}:null;}})['then'](respondWithResult(_0x1609d6,null))[_0xd597('0x48')](handleError(_0x1609d6,null));};
\ No newline at end of file
+var _0xc189=['removeAgents','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','FaxQueues','UserProfileResource','end','sendStatus','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','filter','where','merge','VIRTUAL','FaxQueue','includeAll','include','findAll','catch','params','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','getMembers','findOne','UserFaxQueue','hasOwnProperty','sort','pick','FaxQueueId','options','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','%s/%s','Team','getTeams','addTeams','ids','online','interface','flatMap','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','User','Agents','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','push','toString','sequelize','QueryTypes','TeamId','includes','union','compact','value','isEmpty'];(function(_0xf17e6,_0x4fe6d6){var _0x2635b4=function(_0x4c1a08){while(--_0x4c1a08){_0xf17e6['push'](_0xf17e6['shift']());}};_0x2635b4(++_0x4fe6d6);}(_0xc189,0x91));var _0x9c18=function(_0x487f15,_0x1cf5fb){_0x487f15=_0x487f15-0x0;var _0x32c8a1=_0xc189[_0x487f15];return _0x32c8a1;};'use strict';var emlformat=require(_0x9c18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c18('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c18('0x2'));var moment=require(_0x9c18('0x3'));var BPromise=require(_0x9c18('0x4'));var Mustache=require(_0x9c18('0x5'));var util=require(_0x9c18('0x6'));var path=require(_0x9c18('0x7'));var sox=require(_0x9c18('0x8'));var csv=require(_0x9c18('0x9'));var ejs=require(_0x9c18('0xa'));var fs=require('fs');var fs_extra=require(_0x9c18('0xb'));var _=require('lodash');var squel=require(_0x9c18('0xc'));var crypto=require(_0x9c18('0xd'));var jsforce=require(_0x9c18('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9c18('0x9'));var querystring=require(_0x9c18('0xf'));var Papa=require(_0x9c18('0x10'));var Redis=require(_0x9c18('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9c18('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c18('0x13'))('api');var utils=require(_0x9c18('0x14'));var config=require(_0x9c18('0x15'));var licenseUtil=require(_0x9c18('0x16'));var db=require(_0x9c18('0x17'))['db'];config[_0x9c18('0x18')]=_[_0x9c18('0x19')](config[_0x9c18('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c18('0x1a'))(new Redis(config['redis']));require(_0x9c18('0x1b'))[_0x9c18('0x1c')](socket);function respondWithStatusCode(_0x162154,_0x5da40a){_0x5da40a=_0x5da40a||0xcc;return function(_0x2ab37c){if(_0x2ab37c){return _0x162154['sendStatus'](_0x5da40a);}return _0x162154[_0x9c18('0x1d')](_0x5da40a)['end']();};}function respondWithResult(_0x2eded4,_0x14fd02){_0x14fd02=_0x14fd02||0xc8;return function(_0x3c8fa8){if(_0x3c8fa8){return _0x2eded4['status'](_0x14fd02)[_0x9c18('0x1e')](_0x3c8fa8);}};}function respondWithFilteredResult(_0x2a3a5f,_0x559d92){return function(_0x3bc066){if(_0x3bc066){var _0x4ae540=typeof _0x559d92[_0x9c18('0x1f')]===_0x9c18('0x20')&&typeof _0x559d92['limit']===_0x9c18('0x20');var _0x704170=_0x3bc066[_0x9c18('0x21')];var _0x47696d=_0x4ae540?0x0:_0x559d92[_0x9c18('0x1f')];var _0xfdb743=_0x4ae540?_0x3bc066[_0x9c18('0x21')]:_0x559d92[_0x9c18('0x1f')]+_0x559d92[_0x9c18('0x22')];var _0x48d65d;if(_0xfdb743>=_0x704170){_0xfdb743=_0x704170;_0x48d65d=0xc8;}else{_0x48d65d=0xce;}_0x2a3a5f[_0x9c18('0x1d')](_0x48d65d);return _0x2a3a5f[_0x9c18('0x23')](_0x9c18('0x24'),_0x47696d+'-'+_0xfdb743+'/'+_0x704170)[_0x9c18('0x1e')](_0x3bc066);}return null;};}function patchUpdates(_0x9feff7){return function(_0x21025b){try{jsonpatch[_0x9c18('0x25')](_0x21025b,_0x9feff7,!![]);}catch(_0x332fad){return BPromise['reject'](_0x332fad);}return _0x21025b[_0x9c18('0x26')]();};}function saveUpdates(_0x3e26c3,_0x3e311c){return function(_0x29c9b5){if(_0x29c9b5){return _0x29c9b5['update'](_0x3e26c3)[_0x9c18('0x27')](function(_0x4ad782){return _0x4ad782;});}return null;};}function removeEntity(_0x4498f1,_0x5b9082){return function(_0x20f90c){if(_0x20f90c){return _0x20f90c[_0x9c18('0x28')]()['then'](function(){var _0x3424b4=_0x20f90c['get']({'plain':!![]});var _0x10232f=_0x9c18('0x29');return db[_0x9c18('0x2a')][_0x9c18('0x28')]({'where':{'type':_0x10232f,'resourceId':_0x3424b4['id']}})[_0x9c18('0x27')](function(){return _0x20f90c;});})[_0x9c18('0x27')](function(){_0x4498f1[_0x9c18('0x1d')](0xcc)[_0x9c18('0x2b')]();});}};}function handleEntityNotFound(_0x12467e,_0xe289d7){return function(_0x45800b){if(!_0x45800b){_0x12467e[_0x9c18('0x2c')](0x194);}return _0x45800b;};}function handleError(_0x1e363f,_0x38a2ba){_0x38a2ba=_0x38a2ba||0x1f4;return function(_0x34abb2){logger['error'](_0x34abb2[_0x9c18('0x2d')]);if(_0x34abb2[_0x9c18('0x2e')]){delete _0x34abb2['name'];}_0x1e363f[_0x9c18('0x1d')](_0x38a2ba)['send'](_0x34abb2);};}exports[_0x9c18('0x2f')]=function(_0x33971f,_0x46a0af){var _0x239536={},_0x5e8c7e={},_0x3692b0={'count':0x0,'rows':[]};var _0x235c58=_[_0x9c18('0x30')](db['FaxQueue'][_0x9c18('0x31')],function(_0x2e2166){return{'name':_0x2e2166['fieldName'],'type':_0x2e2166[_0x9c18('0x32')][_0x9c18('0x33')]};});_0x5e8c7e[_0x9c18('0x34')]=_[_0x9c18('0x30')](_0x235c58,_0x9c18('0x2e'));_0x5e8c7e[_0x9c18('0x35')]=_['keys'](_0x33971f[_0x9c18('0x35')]);_0x5e8c7e[_0x9c18('0x36')]=_[_0x9c18('0x37')](_0x5e8c7e[_0x9c18('0x34')],_0x5e8c7e[_0x9c18('0x35')]);_0x239536[_0x9c18('0x38')]=_[_0x9c18('0x37')](_0x5e8c7e[_0x9c18('0x34')],qs[_0x9c18('0x39')](_0x33971f[_0x9c18('0x35')][_0x9c18('0x39')]));_0x239536[_0x9c18('0x38')]=_0x239536[_0x9c18('0x38')][_0x9c18('0x3a')]?_0x239536[_0x9c18('0x38')]:_0x5e8c7e['model'];if(!_0x33971f[_0x9c18('0x35')]['hasOwnProperty'](_0x9c18('0x3b'))){_0x239536[_0x9c18('0x22')]=qs[_0x9c18('0x22')](_0x33971f['query']['limit']);_0x239536[_0x9c18('0x1f')]=qs[_0x9c18('0x1f')](_0x33971f[_0x9c18('0x35')][_0x9c18('0x1f')]);}_0x239536[_0x9c18('0x3c')]=qs['sort'](_0x33971f[_0x9c18('0x35')]['sort']);_0x239536['where']=qs[_0x9c18('0x36')](_['pick'](_0x33971f['query'],_0x5e8c7e[_0x9c18('0x36')]),_0x235c58);if(_0x33971f[_0x9c18('0x35')][_0x9c18('0x3d')]){_0x239536[_0x9c18('0x3e')]=_[_0x9c18('0x3f')](_0x239536[_0x9c18('0x3e')],{'$or':_[_0x9c18('0x30')](_0x235c58,function(_0x13bd4c){if(_0x13bd4c[_0x9c18('0x32')]!==_0x9c18('0x40')){var _0x1edc92={};_0x1edc92[_0x13bd4c[_0x9c18('0x2e')]]={'$like':'%'+_0x33971f['query'][_0x9c18('0x3d')]+'%'};return _0x1edc92;}})});}_0x239536=_['merge']({},_0x239536,_0x33971f['options']);var _0x1c8c49={'where':_0x239536[_0x9c18('0x3e')]};return db[_0x9c18('0x41')][_0x9c18('0x21')](_0x1c8c49)[_0x9c18('0x27')](function(_0x3ca8ad){_0x3692b0['count']=_0x3ca8ad;if(_0x33971f[_0x9c18('0x35')][_0x9c18('0x42')]){_0x239536[_0x9c18('0x43')]=[{'all':!![]}];}return db[_0x9c18('0x41')][_0x9c18('0x44')](_0x239536);})[_0x9c18('0x27')](function(_0x273924){_0x3692b0['rows']=_0x273924;return _0x3692b0;})['then'](respondWithFilteredResult(_0x46a0af,_0x239536))[_0x9c18('0x45')](handleError(_0x46a0af,null));};exports['show']=function(_0x3158e8,_0x13f9ef){var _0x185e17={'raw':!![],'where':{'id':_0x3158e8[_0x9c18('0x46')]['id']}},_0x20b739={};_0x20b739[_0x9c18('0x34')]=_[_0x9c18('0x47')](db[_0x9c18('0x41')][_0x9c18('0x31')]);_0x20b739[_0x9c18('0x35')]=_['keys'](_0x3158e8[_0x9c18('0x35')]);_0x20b739[_0x9c18('0x36')]=_[_0x9c18('0x37')](_0x20b739[_0x9c18('0x34')],_0x20b739[_0x9c18('0x35')]);_0x185e17[_0x9c18('0x38')]=_['intersection'](_0x20b739[_0x9c18('0x34')],qs['fields'](_0x3158e8[_0x9c18('0x35')][_0x9c18('0x39')]));_0x185e17[_0x9c18('0x38')]=_0x185e17[_0x9c18('0x38')][_0x9c18('0x3a')]?_0x185e17[_0x9c18('0x38')]:_0x20b739[_0x9c18('0x34')];if(_0x3158e8[_0x9c18('0x35')][_0x9c18('0x42')]){_0x185e17[_0x9c18('0x43')]=[{'all':!![]}];}_0x185e17=_['merge']({},_0x185e17,_0x3158e8['options']);return db[_0x9c18('0x41')][_0x9c18('0x48')](_0x185e17)[_0x9c18('0x27')](handleEntityNotFound(_0x13f9ef,null))[_0x9c18('0x27')](respondWithResult(_0x13f9ef,null))[_0x9c18('0x45')](handleError(_0x13f9ef,null));};exports[_0x9c18('0x49')]=function(_0x5d9326,_0x59c5c3){return db[_0x9c18('0x41')][_0x9c18('0x49')](_0x5d9326[_0x9c18('0x4a')],{})[_0x9c18('0x27')](function(_0x4aa59c){var _0x3da561=_0x5d9326['user'][_0x9c18('0x4b')]({'plain':!![]});if(!_0x3da561)throw new Error(_0x9c18('0x4c'));if(_0x3da561[_0x9c18('0x4d')]==='user'){var _0x15c68c=_0x4aa59c[_0x9c18('0x4b')]({'plain':!![]});var _0x1ffa69=_0x9c18('0x29');return db['UserProfileSection'][_0x9c18('0x48')]({'where':{'name':_0x1ffa69,'userProfileId':_0x3da561[_0x9c18('0x4e')]},'raw':!![]})['then'](function(_0x39a0d6){if(_0x39a0d6&&_0x39a0d6[_0x9c18('0x4f')]===0x0){return db['UserProfileResource'][_0x9c18('0x49')]({'name':_0x15c68c['name'],'resourceId':_0x15c68c['id'],'type':_0x39a0d6[_0x9c18('0x2e')],'sectionId':_0x39a0d6['id']},{})['then'](function(){return _0x4aa59c;});}else{return _0x4aa59c;}})[_0x9c18('0x45')](function(_0xadfbf8){logger[_0x9c18('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xadfbf8);throw _0xadfbf8;});}return _0x4aa59c;})['then'](respondWithResult(_0x59c5c3,0xc9))[_0x9c18('0x45')](handleError(_0x59c5c3,null));};exports['update']=function(_0x21cb47,_0x3a1134){if(_0x21cb47[_0x9c18('0x4a')]['id']){delete _0x21cb47[_0x9c18('0x4a')]['id'];}return db[_0x9c18('0x41')]['find']({'where':{'id':_0x21cb47[_0x9c18('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a1134,null))[_0x9c18('0x27')](saveUpdates(_0x21cb47[_0x9c18('0x4a')],null))[_0x9c18('0x27')](respondWithResult(_0x3a1134,null))[_0x9c18('0x45')](handleError(_0x3a1134,null));};exports[_0x9c18('0x28')]=function(_0x5d1483,_0xc209c1){return db[_0x9c18('0x41')][_0x9c18('0x48')]({'where':{'id':_0x5d1483['params']['id']}})[_0x9c18('0x27')](handleEntityNotFound(_0xc209c1,null))[_0x9c18('0x27')](removeEntity(_0xc209c1,null))[_0x9c18('0x45')](handleError(_0xc209c1,null));};exports['describe']=function(_0xd217ba,_0x38af1e){return db[_0x9c18('0x41')]['describe']()['then'](respondWithResult(_0x38af1e,null))['catch'](handleError(_0x38af1e,null));};exports[_0x9c18('0x51')]=function(_0xf663f1,_0x5c3e6b,_0x2ed998){var _0xa9ef5c={'raw':!![],'where':{}},_0x54052a={},_0x132610;return db['FaxQueue'][_0x9c18('0x52')]({'where':{'id':_0xf663f1[_0x9c18('0x46')]['id']}})[_0x9c18('0x27')](handleEntityNotFound(_0x5c3e6b,null))[_0x9c18('0x27')](function(_0x3c2889){if(_0x3c2889){_0x132610=_0x3c2889['get']({'plain':!![]});_0x54052a[_0x9c18('0x34')]=_[_0x9c18('0x47')](db[_0x9c18('0x53')][_0x9c18('0x31')]);_0x54052a['query']=_['keys'](_0xf663f1[_0x9c18('0x35')]);_0x54052a[_0x9c18('0x36')]=_[_0x9c18('0x37')](_0x54052a[_0x9c18('0x34')],_0x54052a[_0x9c18('0x35')]);_0xa9ef5c[_0x9c18('0x38')]=_[_0x9c18('0x37')](_0x54052a[_0x9c18('0x34')],qs[_0x9c18('0x39')](_0xf663f1['query']['fields']));_0xa9ef5c[_0x9c18('0x38')]=_0xa9ef5c[_0x9c18('0x38')][_0x9c18('0x3a')]?_0xa9ef5c[_0x9c18('0x38')]:_0x54052a[_0x9c18('0x34')];if(!_0xf663f1[_0x9c18('0x35')][_0x9c18('0x54')]('nolimit')){_0xa9ef5c[_0x9c18('0x22')]=qs[_0x9c18('0x22')](_0xf663f1['query'][_0x9c18('0x22')]);_0xa9ef5c['offset']=qs[_0x9c18('0x1f')](_0xf663f1[_0x9c18('0x35')]['offset']);}_0xa9ef5c[_0x9c18('0x3c')]=qs[_0x9c18('0x55')](_0xf663f1['query'][_0x9c18('0x55')]);_0xa9ef5c[_0x9c18('0x3e')]=qs[_0x9c18('0x36')](_[_0x9c18('0x56')](_0xf663f1[_0x9c18('0x35')],_0x54052a[_0x9c18('0x36')]));_0xa9ef5c['where'][_0x9c18('0x57')]=_0x3c2889['id'];if(_0xf663f1[_0x9c18('0x35')][_0x9c18('0x3d')]){_0xa9ef5c[_0x9c18('0x3e')]=_[_0x9c18('0x3f')](_0xa9ef5c[_0x9c18('0x3e')],{'$or':_[_0x9c18('0x30')](_0xa9ef5c['attributes'],function(_0x49edde){var _0x43c200={};_0x43c200[_0x49edde]={'$like':'%'+_0xf663f1[_0x9c18('0x35')][_0x9c18('0x3d')]+'%'};return _0x43c200;})});}_0xa9ef5c=_[_0x9c18('0x3f')]({},_0xa9ef5c,_0xf663f1[_0x9c18('0x58')]);return db['UserFaxQueue']['findAll'](_0xa9ef5c);}})['then'](function(_0x39f242){if(_0x39f242){return db['User'][_0x9c18('0x59')]({'where':{'id':_['map'](_0x39f242,_0x9c18('0x5a')),'role':_0x9c18('0x5b')},'attributes':['id',_0x9c18('0x2e'),_0x9c18('0x5c'),_0x9c18('0x5d'),_0x9c18('0x5e')]});}})[_0x9c18('0x27')](function(_0x59c9af){if(_0x59c9af){return{'count':_0x59c9af['count'],'rows':_[_0x9c18('0x30')](_0x59c9af[_0x9c18('0x5f')],function(_0x38d48b){return{'membername':_0x38d48b[_0x9c18('0x2e')],'UserId':_0x38d48b['id'],'queue_name':_0x132610[_0x9c18('0x2e')],'FaxQueueId':_0x132610['id'],'interface':util['format'](_0x9c18('0x60'),'SIP',_0x38d48b[_0x9c18('0x2e')]),'penalty':0x0,'paused':_0x38d48b['faxPause'],'createdAt':_0x38d48b[_0x9c18('0x5e')],'updatedAt':_0x38d48b[_0x9c18('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5c3e6b,_0xa9ef5c))['catch'](handleError(_0x5c3e6b,null));};exports['getTeams']=function(_0x21f63c,_0x1e2847,_0x3f8cb1){var _0x548b83={};var _0x263b3c={};var _0x549652;var _0x1a9940;return db[_0x9c18('0x41')][_0x9c18('0x52')]({'where':{'id':_0x21f63c[_0x9c18('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e2847,null))['then'](function(_0x21c33e){if(_0x21c33e){_0x549652=_0x21c33e;_0x263b3c['model']=_[_0x9c18('0x47')](db[_0x9c18('0x61')][_0x9c18('0x31')]);_0x263b3c['query']=_[_0x9c18('0x47')](_0x21f63c['query']);_0x263b3c[_0x9c18('0x36')]=_['intersection'](_0x263b3c[_0x9c18('0x34')],_0x263b3c[_0x9c18('0x35')]);_0x548b83[_0x9c18('0x38')]=_[_0x9c18('0x37')](_0x263b3c[_0x9c18('0x34')],qs['fields'](_0x21f63c[_0x9c18('0x35')]['fields']));_0x548b83[_0x9c18('0x38')]=_0x548b83[_0x9c18('0x38')]['length']?_0x548b83[_0x9c18('0x38')]:_0x263b3c[_0x9c18('0x34')];_0x548b83[_0x9c18('0x3c')]=qs[_0x9c18('0x55')](_0x21f63c[_0x9c18('0x35')][_0x9c18('0x55')]);_0x548b83[_0x9c18('0x3e')]=qs[_0x9c18('0x36')](_[_0x9c18('0x56')](_0x21f63c['query'],_0x263b3c[_0x9c18('0x36')]));if(_0x21f63c[_0x9c18('0x35')][_0x9c18('0x3d')]){_0x548b83['where']=_[_0x9c18('0x3f')](_0x548b83['where'],{'$or':_[_0x9c18('0x30')](_0x548b83[_0x9c18('0x38')],function(_0x5d9445){var _0x142a6f={};_0x142a6f[_0x5d9445]={'$like':'%'+_0x21f63c['query'][_0x9c18('0x3d')]+'%'};return _0x142a6f;})});}_0x548b83=_['merge']({},_0x548b83,_0x21f63c[_0x9c18('0x58')]);return _0x549652[_0x9c18('0x62')](_0x548b83);}})[_0x9c18('0x27')](function(_0x36a4e3){if(_0x36a4e3){_0x1a9940=_0x36a4e3['length'];if(!_0x21f63c['query'][_0x9c18('0x54')]('nolimit')){_0x548b83[_0x9c18('0x22')]=qs[_0x9c18('0x22')](_0x21f63c[_0x9c18('0x35')][_0x9c18('0x22')]);_0x548b83[_0x9c18('0x1f')]=qs[_0x9c18('0x1f')](_0x21f63c[_0x9c18('0x35')]['offset']);}return _0x549652['getTeams'](_0x548b83);}})[_0x9c18('0x27')](function(_0x30b43a){if(_0x30b43a){return _0x30b43a?{'count':_0x1a9940,'rows':_0x30b43a}:null;}})[_0x9c18('0x27')](respondWithResult(_0x1e2847,null))[_0x9c18('0x45')](handleError(_0x1e2847,null));};exports[_0x9c18('0x63')]=function(_0x3e0a28,_0x466589,_0x3650f2){var _0x58c450=_0x3e0a28[_0x9c18('0x4a')][_0x9c18('0x64')];return db[_0x9c18('0x61')][_0x9c18('0x44')]({'where':{'id':_0x58c450},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x9c18('0x2e'),_0x9c18('0x65'),'voicePause',_0x9c18('0x66')],'raw':!![]}]})[_0x9c18('0x27')](function(_0x3717f6){if(_0x3717f6){var _0x13ee1e=_[_0x9c18('0x67')](_0x3717f6,function(_0x41e6cd){var _0x52b95e=_0x41e6cd['get']({'plain':!![]});return _0x52b95e['Agents'];});return db[_0x9c18('0x41')]['find']({'where':{'id':_0x3e0a28[_0x9c18('0x46')]['id']}})[_0x9c18('0x27')](function(_0x184633){return db['sequelize']['transaction'](function(_0x5bc04a){return _0x184633[_0x9c18('0x63')](_0x58c450,{'transaction':_0x5bc04a})[_0x9c18('0x27')](function(){return BPromise[_0x9c18('0x68')](_0x13ee1e,function(_0x1c180a){return db[_0x9c18('0x53')][_0x9c18('0x69')]({'where':{'UserId':_0x1c180a['id'],'FaxQueueId':_0x3e0a28[_0x9c18('0x46')]['id']},'transaction':_0x5bc04a});});})[_0x9c18('0x27')](function(){_0x13ee1e[_0x9c18('0x6a')](function(_0x4bd5ee){socket[_0x9c18('0x6b')](_0x9c18('0x6c'),{'UserId':_0x4bd5ee['id'],'FaxQueueId':_0x184633['id']});});});});});}})[_0x9c18('0x27')](respondWithStatusCode(_0x466589,null))[_0x9c18('0x45')](handleError(_0x466589,null));};exports[_0x9c18('0x6d')]=function(_0x33ed7c,_0x6969ea,_0x264e47){return db[_0x9c18('0x61')][_0x9c18('0x44')]({'where':{'id':_0x33ed7c[_0x9c18('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9c18('0x6e')],'as':_0x9c18('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x9c18('0x27')](handleEntityNotFound(_0x6969ea,null))['then'](function(_0x221f27){var _0x323956=_[_0x9c18('0x30')](_0x221f27,'id');var _0x47e040=[];var _0x32af8a=[];var _0x3f053d=squel[_0x9c18('0x70')]();_0x3f053d[_0x9c18('0x71')](_0x9c18('0x72'))[_0x9c18('0x73')](_0x9c18('0x74'),'tq')[_0x9c18('0x75')](_0x9c18('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9c18('0x3e')](_0x9c18('0x77'),_0x33ed7c[_0x9c18('0x46')]['id']);for(var _0x51db7b=0x0;_0x51db7b<_0x221f27[_0x9c18('0x3a')];_0x51db7b+=0x1){let _0x1e1cb4=_0x221f27[_0x51db7b];for(var _0x2241c5=0x0;_0x2241c5<_0x1e1cb4[_0x9c18('0x6f')]['length'];_0x2241c5+=0x1){let _0x195654=_0x1e1cb4[_0x9c18('0x6f')][_0x2241c5];var _0x5988d3=_0x3f053d[_0x9c18('0x78')]();_0x5988d3[_0x9c18('0x3e')]('ut.UserId\x20=\x20?',_0x195654['id']);_0x32af8a[_0x9c18('0x79')](db['sequelize'][_0x9c18('0x35')](_0x5988d3[_0x9c18('0x7a')](),{'type':db[_0x9c18('0x7b')][_0x9c18('0x7c')]['SELECT']})[_0x9c18('0x27')](function(_0x9750aa){if(_0x9750aa[_0x9c18('0x3a')]===0x1){return _0x195654['id'];}else{var _0xf2d4ef=_['every'](_[_0x9c18('0x30')](_0x9750aa,_0x9c18('0x7d')),function(_0x52b401){return _[_0x9c18('0x7e')](_0x323956,_0x52b401);});if(_0xf2d4ef){return _0x195654['id'];}}}));}}return BPromise['all'](_0x32af8a)[_0x9c18('0x27')](function(_0x4dd7f4){_0x47e040=_(_0x47e040)[_0x9c18('0x7f')](_0x4dd7f4)[_0x9c18('0x80')]()[_0x9c18('0x81')]();return db[_0x9c18('0x41')][_0x9c18('0x48')]({'where':{'id':_0x33ed7c[_0x9c18('0x46')]['id']}})[_0x9c18('0x27')](function(_0x3adff7){return db[_0x9c18('0x7b')]['transaction'](function(_0x4e326c){return _0x3adff7[_0x9c18('0x6d')](_0x33ed7c['query'][_0x9c18('0x64')],{'transaction':_0x4e326c})[_0x9c18('0x27')](function(){if(!_[_0x9c18('0x82')](_0x47e040)){return _0x3adff7[_0x9c18('0x83')](_0x47e040,{'transaction':_0x4e326c});}})[_0x9c18('0x27')](function(){_0x47e040[_0x9c18('0x6a')](function(_0x282944){socket[_0x9c18('0x6b')]('userFaxQueue:remove',{'UserId':_0x282944,'FaxQueueId':_0x3adff7['id']});});});});});});})[_0x9c18('0x27')](respondWithStatusCode(_0x6969ea,null))[_0x9c18('0x45')](handleError(_0x6969ea,null));};exports[_0x9c18('0x84')]=function(_0x3caa90,_0xaa829c,_0x1dc25f){return db[_0x9c18('0x41')]['find']({'where':{'id':_0x3caa90[_0x9c18('0x46')]['id']}})[_0x9c18('0x27')](handleEntityNotFound(_0xaa829c,null))[_0x9c18('0x27')](function(_0x4f7fe6){if(_0x4f7fe6){return _0x4f7fe6[_0x9c18('0x84')](_0x3caa90['body']['ids'],_[_0x9c18('0x85')](_0x3caa90['body'],['ids','id'])||{})[_0x9c18('0x86')](function(_0x409949){for(var _0x427f57=0x0;_0x427f57<_0x3caa90[_0x9c18('0x4a')][_0x9c18('0x64')]['length'];_0x427f57+=0x1){socket['emit'](_0x9c18('0x6c'),{'UserId':Number(_0x3caa90[_0x9c18('0x4a')][_0x9c18('0x64')][_0x427f57]),'FaxQueueId':Number(_0x3caa90[_0x9c18('0x46')]['id'])});}return _0x409949;});}})[_0x9c18('0x27')](respondWithResult(_0xaa829c,null))['catch'](handleError(_0xaa829c,null));};exports['removeAgents']=function(_0x5e2510,_0xaffbe5,_0x2b8efe){return db[_0x9c18('0x41')][_0x9c18('0x48')]({'where':{'id':_0x5e2510['params']['id']}})[_0x9c18('0x27')](handleEntityNotFound(_0xaffbe5,null))['then'](function(_0x2f8c80){if(_0x2f8c80){return _0x2f8c80[_0x9c18('0x83')](_0x5e2510['query']['ids'])[_0x9c18('0x27')](function(){if(_[_0x9c18('0x87')](_0x5e2510['query'][_0x9c18('0x64')])){for(var _0x4558b4=0x0;_0x4558b4<_0x5e2510[_0x9c18('0x35')][_0x9c18('0x64')][_0x9c18('0x3a')];_0x4558b4+=0x1){socket['emit'](_0x9c18('0x88'),{'UserId':Number(_0x5e2510[_0x9c18('0x35')][_0x9c18('0x64')][_0x4558b4]),'FaxQueueId':Number(_0x5e2510[_0x9c18('0x46')]['id'])});}}else{socket[_0x9c18('0x6b')](_0x9c18('0x88'),{'UserId':Number(_0x5e2510[_0x9c18('0x35')][_0x9c18('0x64')]),'FaxQueueId':Number(_0x5e2510[_0x9c18('0x46')]['id'])});}});}})[_0x9c18('0x27')](respondWithStatusCode(_0xaffbe5,null))[_0x9c18('0x45')](handleError(_0xaffbe5,null));};exports[_0x9c18('0x89')]=function(_0x1ee5c9,_0xff8d35,_0x5ae1ab){var _0x9fd8ba={};var _0x2abb49={};var _0x3dc4f7;var _0x5c214a;return db[_0x9c18('0x41')][_0x9c18('0x52')]({'where':{'id':_0x1ee5c9[_0x9c18('0x46')]['id']}})[_0x9c18('0x27')](handleEntityNotFound(_0xff8d35,null))[_0x9c18('0x27')](function(_0x501e32){if(_0x501e32){_0x3dc4f7=_0x501e32;_0x2abb49[_0x9c18('0x34')]=_[_0x9c18('0x47')](db['User'][_0x9c18('0x31')]);_0x2abb49[_0x9c18('0x35')]=_[_0x9c18('0x47')](_0x1ee5c9[_0x9c18('0x35')]);_0x2abb49[_0x9c18('0x36')]=_[_0x9c18('0x37')](_0x2abb49[_0x9c18('0x34')],_0x2abb49[_0x9c18('0x35')]);_0x9fd8ba[_0x9c18('0x38')]=_[_0x9c18('0x37')](_0x2abb49[_0x9c18('0x34')],qs[_0x9c18('0x39')](_0x1ee5c9[_0x9c18('0x35')][_0x9c18('0x39')]));_0x9fd8ba['attributes']=_0x9fd8ba['attributes'][_0x9c18('0x3a')]?_0x9fd8ba[_0x9c18('0x38')]:_0x2abb49[_0x9c18('0x34')];_0x9fd8ba[_0x9c18('0x3c')]=qs[_0x9c18('0x55')](_0x1ee5c9[_0x9c18('0x35')]['sort']);_0x9fd8ba[_0x9c18('0x3e')]=qs[_0x9c18('0x36')](_[_0x9c18('0x56')](_0x1ee5c9[_0x9c18('0x35')],_0x2abb49[_0x9c18('0x36')]));if(_0x1ee5c9[_0x9c18('0x35')][_0x9c18('0x3d')]){_0x9fd8ba['where']=_['merge'](_0x9fd8ba['where'],{'$or':_[_0x9c18('0x30')](_0x9fd8ba[_0x9c18('0x38')],function(_0x5ca25a){var _0x247425={};_0x247425[_0x5ca25a]={'$like':'%'+_0x1ee5c9[_0x9c18('0x35')]['filter']+'%'};return _0x247425;})});}_0x9fd8ba=_[_0x9c18('0x3f')]({},_0x9fd8ba,_0x1ee5c9[_0x9c18('0x58')]);return _0x3dc4f7[_0x9c18('0x89')](_0x9fd8ba);}})[_0x9c18('0x27')](function(_0x5358e5){if(_0x5358e5){_0x5c214a=_0x5358e5['length'];if(!_0x1ee5c9[_0x9c18('0x35')][_0x9c18('0x54')](_0x9c18('0x3b'))){_0x9fd8ba['limit']=qs[_0x9c18('0x22')](_0x1ee5c9[_0x9c18('0x35')]['limit']);_0x9fd8ba[_0x9c18('0x1f')]=qs['offset'](_0x1ee5c9[_0x9c18('0x35')][_0x9c18('0x1f')]);}return _0x3dc4f7['getAgents'](_0x9fd8ba);}})['then'](function(_0xbaf056){if(_0xbaf056){return _0xbaf056?{'count':_0x5c214a,'rows':_0xbaf056}:null;}})[_0x9c18('0x27')](respondWithResult(_0xff8d35,null))[_0x9c18('0x45')](handleError(_0xff8d35,null));};
\ No newline at end of file
index b564a13..0864e53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x050e=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x2c8d9f,_0x2aa2b0){var _0x1e2f30=function(_0x3ee85e){while(--_0x3ee85e){_0x2c8d9f['push'](_0x2c8d9f['shift']());}};_0x1e2f30(++_0x2aa2b0);}(_0x050e,0xb9));var _0xe050=function(_0x58e5b5,_0xe6a8b3){_0x58e5b5=_0x58e5b5-0x0;var _0x115384=_0x050e[_0x58e5b5];return _0x115384;};'use strict';var EventEmitter=require(_0xe050('0x0'));var FaxQueue=require(_0xe050('0x1'))['db'][_0xe050('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe050('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe050('0x4'),'afterDestroy':_0xe050('0x5')};function emitEvent(_0x252060){return function(_0x3ad33c,_0x34f520,_0x5a9091){FaxQueueEvents[_0xe050('0x6')](_0x252060+':'+_0x3ad33c['id'],_0x3ad33c);FaxQueueEvents[_0xe050('0x6')](_0x252060,_0x3ad33c);_0x5a9091(null);};}for(var e in events){if(events[_0xe050('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xe050('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0xa37d=['hasOwnProperty','hook','exports','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x320cd2,_0x563ec1){var _0x49bc84=function(_0x433155){while(--_0x433155){_0x320cd2['push'](_0x320cd2['shift']());}};_0x49bc84(++_0x563ec1);}(_0xa37d,0x19d));var _0xda37=function(_0x4fde9a,_0x5d1eda){_0x4fde9a=_0x4fde9a-0x0;var _0x58f321=_0xa37d[_0x4fde9a];return _0x58f321;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xda37('0x0'))['db'][_0xda37('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xda37('0x2')](0x0);var events={'afterCreate':_0xda37('0x3'),'afterUpdate':_0xda37('0x4'),'afterDestroy':_0xda37('0x5')};function emitEvent(_0x15171b){return function(_0x4865c7,_0x30ba5e,_0xc1de9f){FaxQueueEvents[_0xda37('0x6')](_0x15171b+':'+_0x4865c7['id'],_0x4865c7);FaxQueueEvents[_0xda37('0x6')](_0x15171b,_0x4865c7);_0xc1de9f(null);};}for(var e in events){if(events[_0xda37('0x7')](e)){var event=events[e];FaxQueue[_0xda37('0x8')](e,emitEvent(event));}}module[_0xda37('0x9')]=FaxQueueEvents;
\ No newline at end of file
index bbb9691..a96930d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc32f=['./faxQueue.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x4de461,_0x2099e5){var _0x406dd8=function(_0x63e774){while(--_0x63e774){_0x4de461['push'](_0x4de461['shift']());}};_0x406dd8(++_0x2099e5);}(_0xc32f,0x1e3));var _0xfc32=function(_0x4fbf53,_0x98f966){_0x4fbf53=_0x4fbf53-0x0;var _0x230870=_0xc32f[_0x4fbf53];return _0x230870;};'use strict';var _=require(_0xfc32('0x0'));var util=require(_0xfc32('0x1'));var logger=require(_0xfc32('0x2'))(_0xfc32('0x3'));var moment=require('moment');var BPromise=require(_0xfc32('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc32('0x5'));var rimraf=require('rimraf');var config=require(_0xfc32('0x6'));var attributes=require(_0xfc32('0x7'));module[_0xfc32('0x8')]=function(_0x5117a2,_0x285fea){return _0x5117a2[_0xfc32('0x9')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf87e=['path','../../config/environment','define','FaxQueue','fax_queues','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x2bf5c0,_0x116255){var _0x36c63c=function(_0x9cc164){while(--_0x9cc164){_0x2bf5c0['push'](_0x2bf5c0['shift']());}};_0x36c63c(++_0x116255);}(_0xf87e,0x11d));var _0xef87=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xf87e[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xef87('0x0'));var util=require('util');var logger=require(_0xef87('0x1'))(_0xef87('0x2'));var moment=require('moment');var BPromise=require(_0xef87('0x3'));var rp=require(_0xef87('0x4'));var fs=require('fs');var path=require(_0xef87('0x5'));var rimraf=require('rimraf');var config=require(_0xef87('0x6'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x31626e,_0x299501){return _0x31626e[_0xef87('0x7')](_0xef87('0x8'),attributes,{'tableName':_0xef87('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d7be27c..75b2958 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0190=['find','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug','stringify','ShowFaxQueue'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0x0190,0x1e1));var _0x0019=function(_0x5d25ec,_0x7c7fa2){_0x5d25ec=_0x5d25ec-0x0;var _0x15ad87=_0x0190[_0x5d25ec];return _0x15ad87;};'use strict';var _=require(_0x0019('0x0'));var util=require(_0x0019('0x1'));var moment=require(_0x0019('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0019('0x3'))['db'];var utils=require(_0x0019('0x4'));var logger=require(_0x0019('0x5'))(_0x0019('0x6'));var config=require(_0x0019('0x7'));var jayson=require(_0x0019('0x8'));var client=jayson['client'][_0x0019('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x0019('0xa'),'port':0x18eb});var socket=require(_0x0019('0xb'))(new Redis(config[_0x0019('0xc')]));require(_0x0019('0xd'))[_0x0019('0xe')](socket);function respondWithRpcPromise(_0x4c45e5,_0xa94aae,_0x57697f){return new BPromise(function(_0x45711a,_0x4171bd){return client[_0x0019('0xf')](_0x4c45e5,_0x57697f)[_0x0019('0x10')](function(_0x211559){logger['info'](_0x0019('0x11'),_0xa94aae,_0x0019('0x12'));logger['debug'](_0x0019('0x13'),_0xa94aae,'request\x20sent',JSON['stringify'](_0x211559));if(_0x211559[_0x0019('0x14')]){if(_0x211559[_0x0019('0x14')]['code']===0x1f4){logger[_0x0019('0x14')](_0x0019('0x11'),_0xa94aae,_0x211559[_0x0019('0x14')]['message']);return _0x4171bd(_0x211559[_0x0019('0x14')][_0x0019('0x15')]);}logger[_0x0019('0x14')]('FaxQueue,\x20%s,\x20%s',_0xa94aae,_0x211559[_0x0019('0x14')][_0x0019('0x15')]);return _0x45711a(_0x211559[_0x0019('0x14')][_0x0019('0x15')]);}else{logger[_0x0019('0x16')]('FaxQueue,\x20%s,\x20%s',_0xa94aae,'request\x20sent');_0x45711a(_0x211559[_0x0019('0x17')][_0x0019('0x15')]);}})[_0x0019('0x18')](function(_0x223d17){logger[_0x0019('0x14')]('FaxQueue,\x20%s,\x20%s',_0xa94aae,_0x223d17);_0x4171bd(_0x223d17);});});}exports[_0x0019('0x19')]=function(_0x1fa416){var _0x385016=this;return new Promise(function(_0x5d1ab0,_0x2c52a4){return db[_0x0019('0x1a')][_0x0019('0x1b')]({'raw':_0x1fa416[_0x0019('0x1c')]?_0x1fa416[_0x0019('0x1c')][_0x0019('0x1d')]===undefined?!![]:![]:!![],'where':_0x1fa416[_0x0019('0x1c')]?_0x1fa416[_0x0019('0x1c')][_0x0019('0x1e')]||null:null,'attributes':_0x1fa416[_0x0019('0x1c')]?_0x1fa416[_0x0019('0x1c')]['attributes']||null:null,'limit':_0x1fa416[_0x0019('0x1c')]?_0x1fa416[_0x0019('0x1c')][_0x0019('0x1f')]||null:null,'include':_0x1fa416[_0x0019('0x1c')]?_0x1fa416['options']['include']?_[_0x0019('0x20')](_0x1fa416[_0x0019('0x1c')][_0x0019('0x21')],function(_0x32da6f){return{'model':db[_0x32da6f[_0x0019('0x22')]],'as':_0x32da6f['as'],'attributes':_0x32da6f['attributes'],'include':_0x32da6f[_0x0019('0x21')]?_[_0x0019('0x20')](_0x32da6f['include'],function(_0xf2ab86){return{'model':db[_0xf2ab86['model']],'as':_0xf2ab86['as'],'attributes':_0xf2ab86[_0x0019('0x23')],'include':_0xf2ab86[_0x0019('0x21')]?_['map'](_0xf2ab86[_0x0019('0x21')],function(_0x262527){return{'model':db[_0x262527[_0x0019('0x22')]],'as':_0x262527['as'],'attributes':_0x262527[_0x0019('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0019('0x10')](function(_0x36d43c){logger[_0x0019('0x16')](_0x0019('0x19'),_0x1fa416);logger[_0x0019('0x24')](_0x0019('0x19'),_0x1fa416,JSON[_0x0019('0x25')](_0x36d43c));_0x5d1ab0(_0x36d43c);})[_0x0019('0x18')](function(_0x4595b5){logger[_0x0019('0x14')]('GetFaxQueue',_0x4595b5[_0x0019('0x15')],_0x1fa416);_0x2c52a4(_0x385016['error'](0x1f4,_0x4595b5[_0x0019('0x15')]));});});};exports[_0x0019('0x26')]=function(_0xd7e519){var _0x178cfa=this;return new Promise(function(_0x41e83e,_0x3e238a){return db[_0x0019('0x1a')][_0x0019('0x27')]({'raw':_0xd7e519[_0x0019('0x1c')]?_0xd7e519['options'][_0x0019('0x1d')]===undefined?!![]:![]:!![],'where':_0xd7e519['options']?_0xd7e519[_0x0019('0x1c')][_0x0019('0x1e')]||null:null,'attributes':_0xd7e519[_0x0019('0x1c')]?_0xd7e519[_0x0019('0x1c')]['attributes']||null:null,'include':_0xd7e519[_0x0019('0x1c')]?_0xd7e519[_0x0019('0x1c')]['include']?_[_0x0019('0x20')](_0xd7e519['options'][_0x0019('0x21')],function(_0x47c9ac){return{'model':db[_0x47c9ac['model']],'as':_0x47c9ac['as'],'attributes':_0x47c9ac[_0x0019('0x23')],'include':_0x47c9ac[_0x0019('0x21')]?_[_0x0019('0x20')](_0x47c9ac['include'],function(_0x450bdd){return{'model':db[_0x450bdd[_0x0019('0x22')]],'as':_0x450bdd['as'],'attributes':_0x450bdd[_0x0019('0x23')],'include':_0x450bdd['include']?_[_0x0019('0x20')](_0x450bdd['include'],function(_0x13fe37){return{'model':db[_0x13fe37[_0x0019('0x22')]],'as':_0x13fe37['as'],'attributes':_0x13fe37[_0x0019('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0019('0x10')](function(_0x20bcff){logger[_0x0019('0x16')](_0x0019('0x26'),_0xd7e519);logger[_0x0019('0x24')](_0x0019('0x26'),_0xd7e519,JSON[_0x0019('0x25')](_0x20bcff));_0x41e83e(_0x20bcff);})[_0x0019('0x18')](function(_0x4174ae){logger[_0x0019('0x14')]('ShowFaxQueue',_0x4174ae[_0x0019('0x15')],_0xd7e519);_0x3e238a(_0x178cfa[_0x0019('0x14')](0x1f4,_0x4174ae[_0x0019('0x15')]));});});};
\ No newline at end of file
+var _0xe110=['result','catch','FaxQueue','findAll','options','raw','attributes','include','map','model','GetFaxQueue','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0xe110,0x1d5));var _0x0e11=function(_0x2e5cfd,_0x3e18a1){_0x2e5cfd=_0x2e5cfd-0x0;var _0x171636=_0xe110[_0x2e5cfd];return _0x171636;};'use strict';var _=require(_0x0e11('0x0'));var util=require(_0x0e11('0x1'));var moment=require(_0x0e11('0x2'));var BPromise=require(_0x0e11('0x3'));var rs=require(_0x0e11('0x4'));var fs=require('fs');var Redis=require(_0x0e11('0x5'));var db=require(_0x0e11('0x6'))['db'];var utils=require(_0x0e11('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0e11('0x8'));var jayson=require(_0x0e11('0x9'));var client=jayson[_0x0e11('0xa')][_0x0e11('0xb')]({'port':0x232a});config[_0x0e11('0xc')]=_['defaults'](config[_0x0e11('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e11('0xd'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x0e11('0xe')](socket);function respondWithRpcPromise(_0x579b1a,_0x248a1f,_0x4da43b){return new BPromise(function(_0x2ce440,_0x140ec3){return client['request'](_0x579b1a,_0x4da43b)[_0x0e11('0xf')](function(_0x443804){logger[_0x0e11('0x10')](_0x0e11('0x11'),_0x248a1f,_0x0e11('0x12'));logger[_0x0e11('0x13')](_0x0e11('0x14'),_0x248a1f,_0x0e11('0x12'),JSON[_0x0e11('0x15')](_0x443804));if(_0x443804[_0x0e11('0x16')]){if(_0x443804[_0x0e11('0x16')][_0x0e11('0x17')]===0x1f4){logger[_0x0e11('0x16')](_0x0e11('0x11'),_0x248a1f,_0x443804['error'][_0x0e11('0x18')]);return _0x140ec3(_0x443804[_0x0e11('0x16')][_0x0e11('0x18')]);}logger[_0x0e11('0x16')](_0x0e11('0x11'),_0x248a1f,_0x443804['error'][_0x0e11('0x18')]);return _0x2ce440(_0x443804[_0x0e11('0x16')]['message']);}else{logger[_0x0e11('0x10')](_0x0e11('0x11'),_0x248a1f,_0x0e11('0x12'));_0x2ce440(_0x443804[_0x0e11('0x19')]['message']);}})[_0x0e11('0x1a')](function(_0x2cb008){logger[_0x0e11('0x16')](_0x0e11('0x11'),_0x248a1f,_0x2cb008);_0x140ec3(_0x2cb008);});});}exports['GetFaxQueue']=function(_0x38a525){var _0x3b4846=this;return new Promise(function(_0x40320c,_0x485e49){return db[_0x0e11('0x1b')][_0x0e11('0x1c')]({'raw':_0x38a525[_0x0e11('0x1d')]?_0x38a525[_0x0e11('0x1d')][_0x0e11('0x1e')]===undefined?!![]:![]:!![],'where':_0x38a525['options']?_0x38a525[_0x0e11('0x1d')]['where']||null:null,'attributes':_0x38a525['options']?_0x38a525[_0x0e11('0x1d')][_0x0e11('0x1f')]||null:null,'limit':_0x38a525[_0x0e11('0x1d')]?_0x38a525['options']['limit']||null:null,'include':_0x38a525['options']?_0x38a525[_0x0e11('0x1d')][_0x0e11('0x20')]?_[_0x0e11('0x21')](_0x38a525['options']['include'],function(_0x29d2e6){return{'model':db[_0x29d2e6[_0x0e11('0x22')]],'as':_0x29d2e6['as'],'attributes':_0x29d2e6[_0x0e11('0x1f')],'include':_0x29d2e6[_0x0e11('0x20')]?_['map'](_0x29d2e6[_0x0e11('0x20')],function(_0x58309b){return{'model':db[_0x58309b[_0x0e11('0x22')]],'as':_0x58309b['as'],'attributes':_0x58309b[_0x0e11('0x1f')],'include':_0x58309b[_0x0e11('0x20')]?_[_0x0e11('0x21')](_0x58309b[_0x0e11('0x20')],function(_0x444785){return{'model':db[_0x444785[_0x0e11('0x22')]],'as':_0x444785['as'],'attributes':_0x444785[_0x0e11('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0e11('0xf')](function(_0x211203){logger[_0x0e11('0x10')](_0x0e11('0x23'),_0x38a525);logger['debug'](_0x0e11('0x23'),_0x38a525,JSON['stringify'](_0x211203));_0x40320c(_0x211203);})[_0x0e11('0x1a')](function(_0x70cdc0){logger[_0x0e11('0x16')](_0x0e11('0x23'),_0x70cdc0[_0x0e11('0x18')],_0x38a525);_0x485e49(_0x3b4846[_0x0e11('0x16')](0x1f4,_0x70cdc0['message']));});});};exports['ShowFaxQueue']=function(_0x31735e){var _0x210e55=this;return new Promise(function(_0x21555b,_0x1c9c48){return db[_0x0e11('0x1b')][_0x0e11('0x24')]({'raw':_0x31735e['options']?_0x31735e[_0x0e11('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x31735e['options']?_0x31735e['options']['where']||null:null,'attributes':_0x31735e[_0x0e11('0x1d')]?_0x31735e[_0x0e11('0x1d')]['attributes']||null:null,'include':_0x31735e['options']?_0x31735e[_0x0e11('0x1d')]['include']?_['map'](_0x31735e['options'][_0x0e11('0x20')],function(_0x3e3f61){return{'model':db[_0x3e3f61[_0x0e11('0x22')]],'as':_0x3e3f61['as'],'attributes':_0x3e3f61['attributes'],'include':_0x3e3f61[_0x0e11('0x20')]?_[_0x0e11('0x21')](_0x3e3f61['include'],function(_0x3e6280){return{'model':db[_0x3e6280['model']],'as':_0x3e6280['as'],'attributes':_0x3e6280[_0x0e11('0x1f')],'include':_0x3e6280['include']?_[_0x0e11('0x21')](_0x3e6280[_0x0e11('0x20')],function(_0x4a95fe){return{'model':db[_0x4a95fe['model']],'as':_0x4a95fe['as'],'attributes':_0x4a95fe[_0x0e11('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0e11('0xf')](function(_0x3ec829){logger[_0x0e11('0x10')](_0x0e11('0x25'),_0x31735e);logger[_0x0e11('0x13')](_0x0e11('0x25'),_0x31735e,JSON[_0x0e11('0x15')](_0x3ec829));_0x21555b(_0x3ec829);})[_0x0e11('0x1a')](function(_0x4ef598){logger[_0x0e11('0x16')](_0x0e11('0x25'),_0x4ef598[_0x0e11('0x18')],_0x31735e);_0x1c9c48(_0x210e55[_0x0e11('0x16')](0x1f4,_0x4ef598[_0x0e11('0x18')]));});});};
\ No newline at end of file
index e73c961..da6d41c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2937=['./faxQueue.events','remove','update','emit','register','length'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x2937,0xb4));var _0x7293=function(_0x27ac17,_0x3ffee7){_0x27ac17=_0x27ac17-0x0;var _0x2209ba=_0x2937[_0x27ac17];return _0x2209ba;};'use strict';var FaxQueueEvents=require(_0x7293('0x0'));var events=['save',_0x7293('0x1'),_0x7293('0x2')];function createListener(_0xdab64a,_0x39b96b){return function(_0x513bd){_0x39b96b[_0x7293('0x3')](_0xdab64a,_0x513bd);};}function removeListener(_0x4f0f2f,_0x4633d1){return function(){FaxQueueEvents['removeListener'](_0x4f0f2f,_0x4633d1);};}exports[_0x7293('0x4')]=function(_0x3ae37b){for(var _0x3f21db=0x0,_0x5164e0=events[_0x7293('0x5')];_0x3f21db<_0x5164e0;_0x3f21db++){var _0x23cfba=events[_0x3f21db];var _0x42f775=createListener('faxQueue:'+_0x23cfba,_0x3ae37b);FaxQueueEvents['on'](_0x23cfba,_0x42f775);}};
\ No newline at end of file
+var _0xd0a4=['remove','update','./faxQueue.events','save'];(function(_0x505d3b,_0x26b68f){var _0x4b108a=function(_0x275daa){while(--_0x275daa){_0x505d3b['push'](_0x505d3b['shift']());}};_0x4b108a(++_0x26b68f);}(_0xd0a4,0x13e));var _0x4d0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0a4[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x4d0a('0x0'));var events=[_0x4d0a('0x1'),_0x4d0a('0x2'),_0x4d0a('0x3')];function createListener(_0x34644b,_0x1d4d97){return function(_0xe486d0){_0x1d4d97['emit'](_0x34644b,_0xe486d0);};}function removeListener(_0x344180,_0x98ca03){return function(){FaxQueueEvents['removeListener'](_0x344180,_0x98ca03);};}exports['register']=function(_0x4dae1f){for(var _0x44c7a7=0x0,_0x5ebbb3=events['length'];_0x44c7a7<_0x5ebbb3;_0x44c7a7++){var _0x2491d0=events[_0x44c7a7];var _0x5b1797=createListener('faxQueue:'+_0x2491d0,_0x4dae1f);FaxQueueEvents['on'](_0x2491d0,_0x5b1797);}};
\ No newline at end of file
index 101ebfc..628e272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x964b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x48de27,_0x3cbbdc){var _0x1b4fba=function(_0x80a440){while(--_0x80a440){_0x48de27['push'](_0x48de27['shift']());}};_0x1b4fba(++_0x3cbbdc);}(_0x964b,0x112));var _0xb964=function(_0x1d845e,_0x54bcc3){_0x1d845e=_0x1d845e-0x0;var _0x50bde9=_0x964b[_0x1d845e];return _0x50bde9;};'use strict';var multer=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var path=require('path');var timeout=require(_0xb964('0x2'));var express=require(_0xb964('0x3'));var router=express[_0xb964('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb964('0x5'));var config=require('../../config/environment');var controller=require(_0xb964('0x6'));router[_0xb964('0x7')]('/',auth[_0xb964('0x8')](),controller[_0xb964('0x9')]);router[_0xb964('0x7')](_0xb964('0xa'),auth[_0xb964('0x8')](),controller['describe']);router['get'](_0xb964('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb964('0x7')](_0xb964('0xc'),auth[_0xb964('0x8')](),controller[_0xb964('0xd')]);router[_0xb964('0x7')](_0xb964('0xe'),auth['isAuthenticated'](),controller[_0xb964('0xf')]);router[_0xb964('0x7')](_0xb964('0x10'),auth[_0xb964('0x8')](),controller['getAgents']);router[_0xb964('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb964('0x11')](_0xb964('0xe'),auth[_0xb964('0x8')](),controller[_0xb964('0x12')]);router[_0xb964('0x11')](_0xb964('0x10'),auth[_0xb964('0x8')](),controller['addAgents']);router[_0xb964('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb964('0x14')]);router[_0xb964('0x15')](_0xb964('0xb'),auth[_0xb964('0x8')](),controller[_0xb964('0x16')]);router[_0xb964('0x15')](_0xb964('0xe'),auth[_0xb964('0x8')](),controller[_0xb964('0x17')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb964('0x18')]);module[_0xb964('0x19')]=router;
\ No newline at end of file
+var _0xb091=['/:id','show','/:id/members','getMembers','getTeams','getAgents','post','create','/:id/teams','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','util','path','connect-timeout','express','fs-extra','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','describe'];(function(_0x576197,_0x21ffeb){var _0x53c2ee=function(_0x3f0c3c){while(--_0x3f0c3c){_0x576197['push'](_0x576197['shift']());}};_0x53c2ee(++_0x21ffeb);}(_0xb091,0x16e));var _0x1b09=function(_0x1a0a37,_0x11dc36){_0x1a0a37=_0x1a0a37-0x0;var _0xf9983b=_0xb091[_0x1a0a37];return _0xf9983b;};'use strict';var multer=require('multer');var util=require(_0x1b09('0x0'));var path=require(_0x1b09('0x1'));var timeout=require(_0x1b09('0x2'));var express=require(_0x1b09('0x3'));var router=express['Router']();var fs_extra=require(_0x1b09('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b09('0x5'));var controller=require(_0x1b09('0x6'));router['get']('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0x8')]);router[_0x1b09('0x9')]('/describe',auth[_0x1b09('0x7')](),controller[_0x1b09('0xa')]);router[_0x1b09('0x9')](_0x1b09('0xb'),auth[_0x1b09('0x7')](),controller[_0x1b09('0xc')]);router[_0x1b09('0x9')](_0x1b09('0xd'),auth[_0x1b09('0x7')](),controller[_0x1b09('0xe')]);router[_0x1b09('0x9')]('/:id/teams',auth[_0x1b09('0x7')](),controller[_0x1b09('0xf')]);router['get']('/:id/users',auth[_0x1b09('0x7')](),controller[_0x1b09('0x10')]);router[_0x1b09('0x11')]('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0x12')]);router[_0x1b09('0x11')](_0x1b09('0x13'),auth['isAuthenticated'](),controller[_0x1b09('0x14')]);router['post'](_0x1b09('0x15'),auth[_0x1b09('0x7')](),controller[_0x1b09('0x16')]);router[_0x1b09('0x17')](_0x1b09('0xb'),auth[_0x1b09('0x7')](),controller[_0x1b09('0x18')]);router[_0x1b09('0x19')](_0x1b09('0xb'),auth[_0x1b09('0x7')](),controller[_0x1b09('0x1a')]);router[_0x1b09('0x19')](_0x1b09('0x13'),auth['isAuthenticated'](),controller[_0x1b09('0x1b')]);router[_0x1b09('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x1b09('0x1c')]);module['exports']=router;
\ No newline at end of file
index 8a7f2d5..99d219a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33d0=['sequelize','exports','STRING','DATE','moment'];(function(_0x238f73,_0x12c296){var _0x2cdf32=function(_0x18f020){while(--_0x18f020){_0x238f73['push'](_0x238f73['shift']());}};_0x2cdf32(++_0x12c296);}(_0x33d0,0x144));var _0x033d=function(_0x35cb37,_0x5a3fc6){_0x35cb37=_0x35cb37-0x0;var _0x5c1beb=_0x33d0[_0x35cb37];return _0x5c1beb;};'use strict';var moment=require(_0x033d('0x0'));var Sequelize=require(_0x033d('0x1'));module[_0x033d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x033d('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x033d('0x4')]},'acceptAt':{'type':Sequelize[_0x033d('0x4')]},'exitAt':{'type':Sequelize[_0x033d('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4af4=['sequelize','exports','STRING','DATE','moment'];(function(_0x2e8fd1,_0x17377c){var _0x1d6927=function(_0x4743fc){while(--_0x4743fc){_0x2e8fd1['push'](_0x2e8fd1['shift']());}};_0x1d6927(++_0x17377c);}(_0x4af4,0x13f));var _0x44af=function(_0x4d60ee,_0x2f5206){_0x4d60ee=_0x4d60ee-0x0;var _0x4d772c=_0x4af4[_0x4d60ee];return _0x4d772c;};'use strict';var moment=require(_0x44af('0x0'));var Sequelize=require(_0x44af('0x1'));module[_0x44af('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x44af('0x3')]},'joinAt':{'type':Sequelize[_0x44af('0x4')]},'leaveAt':{'type':Sequelize[_0x44af('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x44af('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fb32357..faca1b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc577=['send','FaxQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','then','destroy','end','sendStatus','error','name'];(function(_0x5b4afc,_0x470044){var _0x4faa4c=function(_0x16f437){while(--_0x16f437){_0x5b4afc['push'](_0x5b4afc['shift']());}};_0x4faa4c(++_0x470044);}(_0xc577,0x172));var _0x7c57=function(_0x441819,_0x5b8d0a){_0x441819=_0x441819-0x0;var _0x478882=_0xc577[_0x441819];return _0x478882;};'use strict';var emlformat=require(_0x7c57('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c57('0x1'));var rp=require(_0x7c57('0x2'));var moment=require(_0x7c57('0x3'));var BPromise=require(_0x7c57('0x4'));var Mustache=require(_0x7c57('0x5'));var util=require(_0x7c57('0x6'));var path=require(_0x7c57('0x7'));var sox=require('sox');var csv=require(_0x7c57('0x8'));var ejs=require(_0x7c57('0x9'));var fs=require('fs');var fs_extra=require(_0x7c57('0xa'));var _=require(_0x7c57('0xb'));var squel=require(_0x7c57('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7c57('0x8'));var querystring=require('querystring');var Papa=require(_0x7c57('0xd'));var Redis=require(_0x7c57('0xe'));var authService=require(_0x7c57('0xf'));var qs=require(_0x7c57('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c57('0x11'));var logger=require(_0x7c57('0x12'))('api');var utils=require(_0x7c57('0x13'));var config=require(_0x7c57('0x14'));var licenseUtil=require(_0x7c57('0x15'));var db=require(_0x7c57('0x16'))['db'];function respondWithStatusCode(_0xbd2172,_0x10a675){_0x10a675=_0x10a675||0xcc;return function(_0x296cef){if(_0x296cef){return _0xbd2172['sendStatus'](_0x10a675);}return _0xbd2172['status'](_0x10a675)['end']();};}function respondWithResult(_0x46cae6,_0x373a4b){_0x373a4b=_0x373a4b||0xc8;return function(_0x4c5af2){if(_0x4c5af2){return _0x46cae6[_0x7c57('0x17')](_0x373a4b)[_0x7c57('0x18')](_0x4c5af2);}};}function respondWithFilteredResult(_0x11903b,_0x1ba2d0){return function(_0x14ce67){if(_0x14ce67){var _0x517d8a=typeof _0x1ba2d0['offset']===_0x7c57('0x19')&&typeof _0x1ba2d0[_0x7c57('0x1a')]===_0x7c57('0x19');var _0x3c40d3=_0x14ce67[_0x7c57('0x1b')];var _0x48cf4f=_0x517d8a?0x0:_0x1ba2d0[_0x7c57('0x1c')];var _0x30f5b1=_0x517d8a?_0x14ce67[_0x7c57('0x1b')]:_0x1ba2d0[_0x7c57('0x1c')]+_0x1ba2d0[_0x7c57('0x1a')];var _0x3e2dc0;if(_0x30f5b1>=_0x3c40d3){_0x30f5b1=_0x3c40d3;_0x3e2dc0=0xc8;}else{_0x3e2dc0=0xce;}_0x11903b[_0x7c57('0x17')](_0x3e2dc0);return _0x11903b[_0x7c57('0x1d')](_0x7c57('0x1e'),_0x48cf4f+'-'+_0x30f5b1+'/'+_0x3c40d3)['json'](_0x14ce67);}return null;};}function patchUpdates(_0x45221e){return function(_0x3472b8){try{jsonpatch[_0x7c57('0x1f')](_0x3472b8,_0x45221e,!![]);}catch(_0x373b5b){return BPromise['reject'](_0x373b5b);}return _0x3472b8['save']();};}function saveUpdates(_0x4c4140,_0x140376){return function(_0x368bb6){if(_0x368bb6){return _0x368bb6['update'](_0x4c4140)[_0x7c57('0x20')](function(_0x13f696){return _0x13f696;});}return null;};}function removeEntity(_0x260d58,_0xfb0f2e){return function(_0x4734de){if(_0x4734de){return _0x4734de[_0x7c57('0x21')]()[_0x7c57('0x20')](function(){_0x260d58['status'](0xcc)[_0x7c57('0x22')]();});}};}function handleEntityNotFound(_0x3232f8,_0x16a517){return function(_0x1641f1){if(!_0x1641f1){_0x3232f8[_0x7c57('0x23')](0x194);}return _0x1641f1;};}function handleError(_0x984924,_0x41125b){_0x41125b=_0x41125b||0x1f4;return function(_0x1219f2){logger[_0x7c57('0x24')](_0x1219f2['stack']);if(_0x1219f2['name']){delete _0x1219f2[_0x7c57('0x25')];}_0x984924[_0x7c57('0x17')](_0x41125b)[_0x7c57('0x26')](_0x1219f2);};}exports['index']=function(_0x9b9d1f,_0x59ae2f){var _0x5acc20={},_0x5ad979={},_0x1d5b54={'count':0x0,'rows':[]};var _0x50c5fa=_['map'](db[_0x7c57('0x27')][_0x7c57('0x28')],function(_0x1ce1fd){return{'name':_0x1ce1fd['fieldName'],'type':_0x1ce1fd[_0x7c57('0x29')][_0x7c57('0x2a')]};});_0x5ad979[_0x7c57('0x2b')]=_['map'](_0x50c5fa,_0x7c57('0x25'));_0x5ad979[_0x7c57('0x2c')]=_[_0x7c57('0x2d')](_0x9b9d1f[_0x7c57('0x2c')]);_0x5ad979[_0x7c57('0x2e')]=_[_0x7c57('0x2f')](_0x5ad979[_0x7c57('0x2b')],_0x5ad979[_0x7c57('0x2c')]);_0x5acc20[_0x7c57('0x30')]=_[_0x7c57('0x2f')](_0x5ad979['model'],qs[_0x7c57('0x31')](_0x9b9d1f[_0x7c57('0x2c')]['fields']));_0x5acc20[_0x7c57('0x30')]=_0x5acc20[_0x7c57('0x30')][_0x7c57('0x32')]?_0x5acc20['attributes']:_0x5ad979[_0x7c57('0x2b')];if(!_0x9b9d1f[_0x7c57('0x2c')]['hasOwnProperty'](_0x7c57('0x33'))){_0x5acc20[_0x7c57('0x1a')]=qs['limit'](_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x1a')]);_0x5acc20[_0x7c57('0x1c')]=qs[_0x7c57('0x1c')](_0x9b9d1f['query'][_0x7c57('0x1c')]);}_0x5acc20['order']=qs['sort'](_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x34')]);_0x5acc20[_0x7c57('0x35')]=qs[_0x7c57('0x2e')](_['pick'](_0x9b9d1f[_0x7c57('0x2c')],_0x5ad979[_0x7c57('0x2e')]),_0x50c5fa);if(_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x36')]){_0x5acc20[_0x7c57('0x35')]=_[_0x7c57('0x37')](_0x5acc20[_0x7c57('0x35')],{'$or':_['map'](_0x50c5fa,function(_0x3cbdc7){if(_0x3cbdc7[_0x7c57('0x29')]!==_0x7c57('0x38')){var _0x35377a={};_0x35377a[_0x3cbdc7['name']]={'$like':'%'+_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x36')]+'%'};return _0x35377a;}})});}_0x5acc20=_[_0x7c57('0x37')]({},_0x5acc20,_0x9b9d1f[_0x7c57('0x39')]);var _0x4ebbec={'where':_0x5acc20[_0x7c57('0x35')]};return db[_0x7c57('0x27')][_0x7c57('0x1b')](_0x4ebbec)[_0x7c57('0x20')](function(_0xae3f4c){_0x1d5b54[_0x7c57('0x1b')]=_0xae3f4c;if(_0x9b9d1f[_0x7c57('0x2c')][_0x7c57('0x3a')]){_0x5acc20[_0x7c57('0x3b')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x7c57('0x3c')](_0x5acc20);})['then'](function(_0x27cca7){_0x1d5b54[_0x7c57('0x3d')]=_0x27cca7;return _0x1d5b54;})[_0x7c57('0x20')](respondWithFilteredResult(_0x59ae2f,_0x5acc20))[_0x7c57('0x3e')](handleError(_0x59ae2f,null));};exports['show']=function(_0x5d99bf,_0x54982b){var _0x286cd2={'raw':!![],'where':{'id':_0x5d99bf[_0x7c57('0x3f')]['id']}},_0x2f59c0={};_0x2f59c0[_0x7c57('0x2b')]=_[_0x7c57('0x2d')](db[_0x7c57('0x27')][_0x7c57('0x28')]);_0x2f59c0['query']=_[_0x7c57('0x2d')](_0x5d99bf[_0x7c57('0x2c')]);_0x2f59c0['filters']=_[_0x7c57('0x2f')](_0x2f59c0['model'],_0x2f59c0[_0x7c57('0x2c')]);_0x286cd2[_0x7c57('0x30')]=_[_0x7c57('0x2f')](_0x2f59c0['model'],qs[_0x7c57('0x31')](_0x5d99bf[_0x7c57('0x2c')]['fields']));_0x286cd2[_0x7c57('0x30')]=_0x286cd2['attributes']['length']?_0x286cd2[_0x7c57('0x30')]:_0x2f59c0[_0x7c57('0x2b')];if(_0x5d99bf[_0x7c57('0x2c')]['includeAll']){_0x286cd2[_0x7c57('0x3b')]=[{'all':!![]}];}_0x286cd2=_[_0x7c57('0x37')]({},_0x286cd2,_0x5d99bf[_0x7c57('0x39')]);return db['FaxQueueReport'][_0x7c57('0x40')](_0x286cd2)[_0x7c57('0x20')](handleEntityNotFound(_0x54982b,null))[_0x7c57('0x20')](respondWithResult(_0x54982b,null))['catch'](handleError(_0x54982b,null));};exports[_0x7c57('0x41')]=function(_0x2bb4d2,_0x1d2ed4){return db[_0x7c57('0x27')]['create'](_0x2bb4d2[_0x7c57('0x42')],{})[_0x7c57('0x20')](respondWithResult(_0x1d2ed4,0xc9))[_0x7c57('0x3e')](handleError(_0x1d2ed4,null));};exports['update']=function(_0x236ae5,_0x35b350){if(_0x236ae5[_0x7c57('0x42')]['id']){delete _0x236ae5[_0x7c57('0x42')]['id'];}return db['FaxQueueReport'][_0x7c57('0x40')]({'where':{'id':_0x236ae5['params']['id']}})[_0x7c57('0x20')](handleEntityNotFound(_0x35b350,null))[_0x7c57('0x20')](saveUpdates(_0x236ae5[_0x7c57('0x42')],null))[_0x7c57('0x20')](respondWithResult(_0x35b350,null))[_0x7c57('0x3e')](handleError(_0x35b350,null));};exports['destroy']=function(_0x2a953e,_0x4f6d05){return db['FaxQueueReport'][_0x7c57('0x40')]({'where':{'id':_0x2a953e[_0x7c57('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4f6d05,null))[_0x7c57('0x20')](removeEntity(_0x4f6d05,null))['catch'](handleError(_0x4f6d05,null));};exports[_0x7c57('0x43')]=function(_0x3b66f3,_0x422bd6){return db['FaxQueueReport'][_0x7c57('0x43')]()[_0x7c57('0x20')](respondWithResult(_0x422bd6,null))[_0x7c57('0x3e')](handleError(_0x422bd6,null));};
\ No newline at end of file
+var _0x0eec=['limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','json','apply','reject','update','destroy','then','end','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x3f4315,_0xd6ec89){var _0x5842e3=function(_0x4b12f5){while(--_0x4b12f5){_0x3f4315['push'](_0x3f4315['shift']());}};_0x5842e3(++_0xd6ec89);}(_0x0eec,0xac));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xc0ee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc0ee('0x1'));var rp=require(_0xc0ee('0x2'));var moment=require(_0xc0ee('0x3'));var BPromise=require(_0xc0ee('0x4'));var Mustache=require(_0xc0ee('0x5'));var util=require(_0xc0ee('0x6'));var path=require(_0xc0ee('0x7'));var sox=require('sox');var csv=require(_0xc0ee('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0ee('0x9'));var _=require(_0xc0ee('0xa'));var squel=require(_0xc0ee('0xb'));var crypto=require(_0xc0ee('0xc'));var jsforce=require(_0xc0ee('0xd'));var deskjs=require(_0xc0ee('0xe'));var toCsv=require(_0xc0ee('0x8'));var querystring=require('querystring');var Papa=require(_0xc0ee('0xf'));var Redis=require(_0xc0ee('0x10'));var authService=require(_0xc0ee('0x11'));var qs=require(_0xc0ee('0x12'));var as=require(_0xc0ee('0x13'));var hardwareService=require(_0xc0ee('0x14'));var logger=require(_0xc0ee('0x15'))('api');var utils=require(_0xc0ee('0x16'));var config=require(_0xc0ee('0x17'));var licenseUtil=require(_0xc0ee('0x18'));var db=require(_0xc0ee('0x19'))['db'];function respondWithStatusCode(_0x22d46b,_0x2d4e3c){_0x2d4e3c=_0x2d4e3c||0xcc;return function(_0x454f5d){if(_0x454f5d){return _0x22d46b[_0xc0ee('0x1a')](_0x2d4e3c);}return _0x22d46b[_0xc0ee('0x1b')](_0x2d4e3c)['end']();};}function respondWithResult(_0x51ae2e,_0x1f3ad9){_0x1f3ad9=_0x1f3ad9||0xc8;return function(_0x325193){if(_0x325193){return _0x51ae2e[_0xc0ee('0x1b')](_0x1f3ad9)['json'](_0x325193);}};}function respondWithFilteredResult(_0x170bf9,_0x30c324){return function(_0x448448){if(_0x448448){var _0x58e1f0=typeof _0x30c324['offset']===_0xc0ee('0x1c')&&typeof _0x30c324['limit']===_0xc0ee('0x1c');var _0x20195b=_0x448448[_0xc0ee('0x1d')];var _0x59aad9=_0x58e1f0?0x0:_0x30c324['offset'];var _0x16d050=_0x58e1f0?_0x448448[_0xc0ee('0x1d')]:_0x30c324[_0xc0ee('0x1e')]+_0x30c324['limit'];var _0x390ee4;if(_0x16d050>=_0x20195b){_0x16d050=_0x20195b;_0x390ee4=0xc8;}else{_0x390ee4=0xce;}_0x170bf9[_0xc0ee('0x1b')](_0x390ee4);return _0x170bf9['set']('Content-Range',_0x59aad9+'-'+_0x16d050+'/'+_0x20195b)[_0xc0ee('0x1f')](_0x448448);}return null;};}function patchUpdates(_0x233333){return function(_0x4dd8c9){try{jsonpatch[_0xc0ee('0x20')](_0x4dd8c9,_0x233333,!![]);}catch(_0x30a00c){return BPromise[_0xc0ee('0x21')](_0x30a00c);}return _0x4dd8c9['save']();};}function saveUpdates(_0x49be2a,_0x5af925){return function(_0x7ec74){if(_0x7ec74){return _0x7ec74[_0xc0ee('0x22')](_0x49be2a)['then'](function(_0x2c3d95){return _0x2c3d95;});}return null;};}function removeEntity(_0x453490,_0x20b657){return function(_0x11b6a4){if(_0x11b6a4){return _0x11b6a4[_0xc0ee('0x23')]()[_0xc0ee('0x24')](function(){_0x453490[_0xc0ee('0x1b')](0xcc)[_0xc0ee('0x25')]();});}};}function handleEntityNotFound(_0x38abc9,_0x6d1087){return function(_0x2b0584){if(!_0x2b0584){_0x38abc9[_0xc0ee('0x1a')](0x194);}return _0x2b0584;};}function handleError(_0x168ab5,_0x30582e){_0x30582e=_0x30582e||0x1f4;return function(_0x4288e1){logger['error'](_0x4288e1[_0xc0ee('0x26')]);if(_0x4288e1[_0xc0ee('0x27')]){delete _0x4288e1['name'];}_0x168ab5[_0xc0ee('0x1b')](_0x30582e)['send'](_0x4288e1);};}exports[_0xc0ee('0x28')]=function(_0x410fb2,_0x44b511){var _0x1d3594={},_0x46ca29={},_0x369764={'count':0x0,'rows':[]};var _0x24a67a=_[_0xc0ee('0x29')](db[_0xc0ee('0x2a')][_0xc0ee('0x2b')],function(_0x394777){return{'name':_0x394777[_0xc0ee('0x2c')],'type':_0x394777[_0xc0ee('0x2d')][_0xc0ee('0x2e')]};});_0x46ca29['model']=_['map'](_0x24a67a,_0xc0ee('0x27'));_0x46ca29[_0xc0ee('0x2f')]=_[_0xc0ee('0x30')](_0x410fb2[_0xc0ee('0x2f')]);_0x46ca29[_0xc0ee('0x31')]=_[_0xc0ee('0x32')](_0x46ca29[_0xc0ee('0x33')],_0x46ca29[_0xc0ee('0x2f')]);_0x1d3594[_0xc0ee('0x34')]=_[_0xc0ee('0x32')](_0x46ca29[_0xc0ee('0x33')],qs['fields'](_0x410fb2[_0xc0ee('0x2f')][_0xc0ee('0x35')]));_0x1d3594[_0xc0ee('0x34')]=_0x1d3594[_0xc0ee('0x34')][_0xc0ee('0x36')]?_0x1d3594['attributes']:_0x46ca29[_0xc0ee('0x33')];if(!_0x410fb2[_0xc0ee('0x2f')][_0xc0ee('0x37')]('nolimit')){_0x1d3594[_0xc0ee('0x38')]=qs[_0xc0ee('0x38')](_0x410fb2[_0xc0ee('0x2f')][_0xc0ee('0x38')]);_0x1d3594['offset']=qs[_0xc0ee('0x1e')](_0x410fb2['query'][_0xc0ee('0x1e')]);}_0x1d3594[_0xc0ee('0x39')]=qs[_0xc0ee('0x3a')](_0x410fb2[_0xc0ee('0x2f')][_0xc0ee('0x3a')]);_0x1d3594[_0xc0ee('0x3b')]=qs[_0xc0ee('0x31')](_[_0xc0ee('0x3c')](_0x410fb2[_0xc0ee('0x2f')],_0x46ca29[_0xc0ee('0x31')]),_0x24a67a);if(_0x410fb2[_0xc0ee('0x2f')]['filter']){_0x1d3594[_0xc0ee('0x3b')]=_[_0xc0ee('0x3d')](_0x1d3594[_0xc0ee('0x3b')],{'$or':_[_0xc0ee('0x29')](_0x24a67a,function(_0x1cb120){if(_0x1cb120[_0xc0ee('0x2d')]!==_0xc0ee('0x3e')){var _0x2d7b9e={};_0x2d7b9e[_0x1cb120['name']]={'$like':'%'+_0x410fb2['query'][_0xc0ee('0x3f')]+'%'};return _0x2d7b9e;}})});}_0x1d3594=_['merge']({},_0x1d3594,_0x410fb2[_0xc0ee('0x40')]);var _0xf46dc5={'where':_0x1d3594['where']};return db[_0xc0ee('0x2a')]['count'](_0xf46dc5)[_0xc0ee('0x24')](function(_0x4f385a){_0x369764['count']=_0x4f385a;if(_0x410fb2['query'][_0xc0ee('0x41')]){_0x1d3594[_0xc0ee('0x42')]=[{'all':!![]}];}return db[_0xc0ee('0x2a')][_0xc0ee('0x43')](_0x1d3594);})['then'](function(_0x3c0c7b){_0x369764[_0xc0ee('0x44')]=_0x3c0c7b;return _0x369764;})[_0xc0ee('0x24')](respondWithFilteredResult(_0x44b511,_0x1d3594))[_0xc0ee('0x45')](handleError(_0x44b511,null));};exports[_0xc0ee('0x46')]=function(_0x5c2111,_0x388c7b){var _0x264a41={'raw':!![],'where':{'id':_0x5c2111[_0xc0ee('0x47')]['id']}},_0x5577aa={};_0x5577aa['model']=_[_0xc0ee('0x30')](db[_0xc0ee('0x2a')]['rawAttributes']);_0x5577aa[_0xc0ee('0x2f')]=_[_0xc0ee('0x30')](_0x5c2111['query']);_0x5577aa[_0xc0ee('0x31')]=_[_0xc0ee('0x32')](_0x5577aa['model'],_0x5577aa[_0xc0ee('0x2f')]);_0x264a41[_0xc0ee('0x34')]=_[_0xc0ee('0x32')](_0x5577aa[_0xc0ee('0x33')],qs[_0xc0ee('0x35')](_0x5c2111['query']['fields']));_0x264a41[_0xc0ee('0x34')]=_0x264a41[_0xc0ee('0x34')][_0xc0ee('0x36')]?_0x264a41[_0xc0ee('0x34')]:_0x5577aa['model'];if(_0x5c2111['query'][_0xc0ee('0x41')]){_0x264a41[_0xc0ee('0x42')]=[{'all':!![]}];}_0x264a41=_[_0xc0ee('0x3d')]({},_0x264a41,_0x5c2111['options']);return db['FaxQueueReport'][_0xc0ee('0x48')](_0x264a41)[_0xc0ee('0x24')](handleEntityNotFound(_0x388c7b,null))[_0xc0ee('0x24')](respondWithResult(_0x388c7b,null))['catch'](handleError(_0x388c7b,null));};exports[_0xc0ee('0x49')]=function(_0x3d6a10,_0x5e5f5e){return db[_0xc0ee('0x2a')][_0xc0ee('0x49')](_0x3d6a10[_0xc0ee('0x4a')],{})[_0xc0ee('0x24')](respondWithResult(_0x5e5f5e,0xc9))['catch'](handleError(_0x5e5f5e,null));};exports['update']=function(_0x22c742,_0x5ca93b){if(_0x22c742['body']['id']){delete _0x22c742['body']['id'];}return db[_0xc0ee('0x2a')]['find']({'where':{'id':_0x22c742[_0xc0ee('0x47')]['id']}})[_0xc0ee('0x24')](handleEntityNotFound(_0x5ca93b,null))[_0xc0ee('0x24')](saveUpdates(_0x22c742['body'],null))[_0xc0ee('0x24')](respondWithResult(_0x5ca93b,null))['catch'](handleError(_0x5ca93b,null));};exports[_0xc0ee('0x23')]=function(_0x4b2fcc,_0x3bb5ae){return db[_0xc0ee('0x2a')][_0xc0ee('0x48')]({'where':{'id':_0x4b2fcc[_0xc0ee('0x47')]['id']}})[_0xc0ee('0x24')](handleEntityNotFound(_0x3bb5ae,null))[_0xc0ee('0x24')](removeEntity(_0x3bb5ae,null))['catch'](handleError(_0x3bb5ae,null));};exports['describe']=function(_0x6e6b2c,_0x497ed9){return db[_0xc0ee('0x2a')][_0xc0ee('0x4b')]()[_0xc0ee('0x24')](respondWithResult(_0x497ed9,null))[_0xc0ee('0x45')](handleError(_0x497ed9,null));};
\ No newline at end of file
index 2922858..682ac3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x40db73,_0x417449){var _0x1e6382=function(_0x1ae1b6){while(--_0x1ae1b6){_0x40db73['push'](_0x40db73['shift']());}};_0x1e6382(++_0x417449);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0x7fbe[_0xcfd89f];return _0x59acd4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x3e6b66,_0x558128){var _0x4bb516=function(_0x3e4134){while(--_0x3e4134){_0x3e6b66['push'](_0x3e6b66['shift']());}};_0x4bb516(++_0x558128);}(_0xf494,0x1c6));var _0x4f49=function(_0x11ba6e,_0x3e07a2){_0x11ba6e=_0x11ba6e-0x0;var _0x3a1937=_0xf494[_0x11ba6e];return _0x3a1937;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index b415d24..3a9ac0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5474=['code','message','result','catch','CreateFaxQueueReport','create','body','options','raw','then','stringify','FaxQueueReport','update','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0x5474,0x74));var _0x4547=function(_0x20e3b7,_0x13cdc6){_0x20e3b7=_0x20e3b7-0x0;var _0x2d19c7=_0x5474[_0x20e3b7];return _0x2d19c7;};'use strict';var _=require(_0x4547('0x0'));var util=require(_0x4547('0x1'));var moment=require(_0x4547('0x2'));var BPromise=require('bluebird');var rs=require(_0x4547('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4547('0x4'))(_0x4547('0x5'));var config=require(_0x4547('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4547('0x7')][_0x4547('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c4d5d,_0x4adbeb,_0x2c920f){return new BPromise(function(_0x2c42a6,_0x41c94c){return client[_0x4547('0x9')](_0x4c4d5d,_0x2c920f)['then'](function(_0x20e3b7){logger[_0x4547('0xa')](_0x4547('0xb'),_0x4adbeb,_0x4547('0xc'));logger[_0x4547('0xd')](_0x4547('0xe'),_0x4adbeb,_0x4547('0xc'),JSON['stringify'](_0x20e3b7));if(_0x20e3b7[_0x4547('0xf')]){if(_0x20e3b7[_0x4547('0xf')][_0x4547('0x10')]===0x1f4){logger[_0x4547('0xf')](_0x4547('0xb'),_0x4adbeb,_0x20e3b7[_0x4547('0xf')][_0x4547('0x11')]);return _0x41c94c(_0x20e3b7[_0x4547('0xf')][_0x4547('0x11')]);}logger[_0x4547('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x4adbeb,_0x20e3b7[_0x4547('0xf')][_0x4547('0x11')]);return _0x2c42a6(_0x20e3b7[_0x4547('0xf')][_0x4547('0x11')]);}else{logger['info'](_0x4547('0xb'),_0x4adbeb,'request\x20sent');_0x2c42a6(_0x20e3b7[_0x4547('0x12')]['message']);}})[_0x4547('0x13')](function(_0x2fd801){logger['error'](_0x4547('0xb'),_0x4adbeb,_0x2fd801);_0x41c94c(_0x2fd801);});});}exports[_0x4547('0x14')]=function(_0xc5be5b){var _0x52fc4c=this;return new Promise(function(_0x5311f8,_0x5510cb){return db['FaxQueueReport'][_0x4547('0x15')](_0xc5be5b[_0x4547('0x16')],{'raw':_0xc5be5b[_0x4547('0x17')]?_0xc5be5b[_0x4547('0x17')][_0x4547('0x18')]===undefined?!![]:![]:!![]})[_0x4547('0x19')](function(_0x56185f){logger[_0x4547('0xa')](_0x4547('0x14'),_0xc5be5b);logger[_0x4547('0xd')](_0x4547('0x14'),_0xc5be5b,JSON[_0x4547('0x1a')](_0x56185f));_0x5311f8(_0x56185f);})['catch'](function(_0x3e70ee){logger[_0x4547('0xf')](_0x4547('0x14'),_0x3e70ee['message'],_0xc5be5b);_0x5510cb(_0x52fc4c['error'](0x1f4,_0x3e70ee[_0x4547('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0xe06511){var _0x29c5b3=this;return new Promise(function(_0x49679a,_0x6d19c4){return db[_0x4547('0x1b')][_0x4547('0x1c')](_0xe06511[_0x4547('0x16')],{'raw':_0xe06511[_0x4547('0x17')]?_0xe06511[_0x4547('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe06511[_0x4547('0x17')]?_0xe06511[_0x4547('0x17')][_0x4547('0x1d')]||null:null,'attributes':_0xe06511['options']?_0xe06511['options'][_0x4547('0x1e')]||null:null,'limit':_0xe06511[_0x4547('0x17')]?_0xe06511[_0x4547('0x17')][_0x4547('0x1f')]||null:null})[_0x4547('0x19')](function(_0x74655){logger[_0x4547('0xa')](_0x4547('0x20'),_0xe06511);logger[_0x4547('0xd')](_0x4547('0x20'),_0xe06511,JSON[_0x4547('0x1a')](_0x74655));_0x49679a(_0x74655);})[_0x4547('0x13')](function(_0x18e8c0){logger[_0x4547('0xf')](_0x4547('0x20'),_0x18e8c0[_0x4547('0x11')],_0xe06511);_0x6d19c4(_0x29c5b3[_0x4547('0xf')](0x1f4,_0x18e8c0['message']));});});};
\ No newline at end of file
+var _0x7196=['request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','create','options','raw','FaxQueueReport','body','where','attributes','limit','then','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x99692,_0x32528e){var _0xe5fbb4=function(_0x58a4e1){while(--_0x58a4e1){_0x99692['push'](_0x99692['shift']());}};_0xe5fbb4(++_0x32528e);}(_0x7196,0x10c));var _0x6719=function(_0x8978e5,_0xd5e61d){_0x8978e5=_0x8978e5-0x0;var _0x178b81=_0x7196[_0x8978e5];return _0x178b81;};'use strict';var _=require(_0x6719('0x0'));var util=require(_0x6719('0x1'));var moment=require(_0x6719('0x2'));var BPromise=require(_0x6719('0x3'));var rs=require(_0x6719('0x4'));var fs=require('fs');var Redis=require(_0x6719('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6719('0x6'))(_0x6719('0x7'));var config=require(_0x6719('0x8'));var jayson=require(_0x6719('0x9'));var client=jayson[_0x6719('0xa')][_0x6719('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1af09c,_0x2dd302,_0x12891d){return new BPromise(function(_0x53f537,_0x227fd9){return client[_0x6719('0xc')](_0x1af09c,_0x12891d)['then'](function(_0x39697f){logger[_0x6719('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x2dd302,_0x6719('0xe'));logger[_0x6719('0xf')](_0x6719('0x10'),_0x2dd302,_0x6719('0xe'),JSON[_0x6719('0x11')](_0x39697f));if(_0x39697f[_0x6719('0x12')]){if(_0x39697f[_0x6719('0x12')][_0x6719('0x13')]===0x1f4){logger[_0x6719('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x2dd302,_0x39697f[_0x6719('0x12')][_0x6719('0x14')]);return _0x227fd9(_0x39697f[_0x6719('0x12')]['message']);}logger[_0x6719('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x2dd302,_0x39697f[_0x6719('0x12')][_0x6719('0x14')]);return _0x53f537(_0x39697f[_0x6719('0x12')][_0x6719('0x14')]);}else{logger[_0x6719('0xd')](_0x6719('0x15'),_0x2dd302,_0x6719('0xe'));_0x53f537(_0x39697f[_0x6719('0x16')]['message']);}})[_0x6719('0x17')](function(_0x5b72a4){logger[_0x6719('0x12')](_0x6719('0x15'),_0x2dd302,_0x5b72a4);_0x227fd9(_0x5b72a4);});});}exports[_0x6719('0x18')]=function(_0x1e7b7a){var _0x273595=this;return new Promise(function(_0x180653,_0x394f85){return db['FaxQueueReport'][_0x6719('0x19')](_0x1e7b7a['body'],{'raw':_0x1e7b7a[_0x6719('0x1a')]?_0x1e7b7a['options'][_0x6719('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3c93df){logger[_0x6719('0xd')](_0x6719('0x18'),_0x1e7b7a);logger['debug'](_0x6719('0x18'),_0x1e7b7a,JSON['stringify'](_0x3c93df));_0x180653(_0x3c93df);})[_0x6719('0x17')](function(_0x4ab430){logger[_0x6719('0x12')]('CreateFaxQueueReport',_0x4ab430['message'],_0x1e7b7a);_0x394f85(_0x273595[_0x6719('0x12')](0x1f4,_0x4ab430[_0x6719('0x14')]));});});};exports['UpdateFaxQueueReport']=function(_0x26131f){var _0x414416=this;return new Promise(function(_0x42ca27,_0x345e61){return db[_0x6719('0x1c')]['update'](_0x26131f[_0x6719('0x1d')],{'raw':_0x26131f[_0x6719('0x1a')]?_0x26131f[_0x6719('0x1a')][_0x6719('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26131f[_0x6719('0x1a')]?_0x26131f['options'][_0x6719('0x1e')]||null:null,'attributes':_0x26131f[_0x6719('0x1a')]?_0x26131f[_0x6719('0x1a')][_0x6719('0x1f')]||null:null,'limit':_0x26131f[_0x6719('0x1a')]?_0x26131f[_0x6719('0x1a')][_0x6719('0x20')]||null:null})[_0x6719('0x21')](function(_0x30f4d4){logger[_0x6719('0xd')](_0x6719('0x22'),_0x26131f);logger[_0x6719('0xf')](_0x6719('0x22'),_0x26131f,JSON[_0x6719('0x11')](_0x30f4d4));_0x42ca27(_0x30f4d4);})[_0x6719('0x17')](function(_0x2a772f){logger[_0x6719('0x12')](_0x6719('0x22'),_0x2a772f[_0x6719('0x14')],_0x26131f);_0x345e61(_0x414416[_0x6719('0x12')](0x1f4,_0x2a772f[_0x6719('0x14')]));});});};
\ No newline at end of file
index 74792f0..2a9238f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb87=['path','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','describe','get','show','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x506e1d,_0x1e358a){var _0x4dfb73=function(_0xb7e86e){while(--_0xb7e86e){_0x506e1d['push'](_0x506e1d['shift']());}};_0x4dfb73(++_0x1e358a);}(_0xfb87,0x166));var _0x7fb8=function(_0x10a546,_0x5ea132){_0x10a546=_0x10a546-0x0;var _0x30e897=_0xfb87[_0x10a546];return _0x30e897;};'use strict';var multer=require(_0x7fb8('0x0'));var util=require(_0x7fb8('0x1'));var path=require(_0x7fb8('0x2'));var timeout=require('connect-timeout');var express=require(_0x7fb8('0x3'));var router=express['Router']();var fs_extra=require(_0x7fb8('0x4'));var auth=require(_0x7fb8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7fb8('0x6'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x7fb8('0x7')](),controller['index']);router['get']('/describe',auth[_0x7fb8('0x7')](),controller[_0x7fb8('0x8')]);router[_0x7fb8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7fb8('0xa')]);router[_0x7fb8('0xb')]('/',auth[_0x7fb8('0x7')](),controller[_0x7fb8('0xc')]);router[_0x7fb8('0xd')](_0x7fb8('0xe'),auth[_0x7fb8('0x7')](),controller[_0x7fb8('0xf')]);router[_0x7fb8('0x10')](_0x7fb8('0xe'),auth[_0x7fb8('0x7')](),controller[_0x7fb8('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x4d38=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./faxQueueReport.controller','index','get','/describe','isAuthenticated','show','post','create'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x4d38,0x84));var _0x84d3=function(_0x44d9e8,_0x2f0bc2){_0x44d9e8=_0x44d9e8-0x0;var _0x64816e=_0x4d38[_0x44d9e8];return _0x64816e;};'use strict';var multer=require(_0x84d3('0x0'));var util=require('util');var path=require(_0x84d3('0x1'));var timeout=require(_0x84d3('0x2'));var express=require(_0x84d3('0x3'));var router=express[_0x84d3('0x4')]();var fs_extra=require(_0x84d3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x84d3('0x6'));var controller=require(_0x84d3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x84d3('0x8')]);router[_0x84d3('0x9')](_0x84d3('0xa'),auth[_0x84d3('0xb')](),controller['describe']);router[_0x84d3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x84d3('0xc')]);router[_0x84d3('0xd')]('/',auth[_0x84d3('0xb')](),controller[_0x84d3('0xe')]);router[_0x84d3('0xf')](_0x84d3('0x10'),auth[_0x84d3('0xb')](),controller[_0x84d3('0x11')]);router[_0x84d3('0x12')](_0x84d3('0x10'),auth['isAuthenticated'](),controller[_0x84d3('0x13')]);module[_0x84d3('0x14')]=router;
\ No newline at end of file
index 4138f2a..761cbb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x1591f7,_0x5aedd6){var _0x4e1517=function(_0x544aff){while(--_0x544aff){_0x1591f7['push'](_0x1591f7['shift']());}};_0x4e1517(++_0x5aedd6);}(_0x54ef,0x112));var _0xf54e=function(_0x1c87ce,_0x291c12){_0x1c87ce=_0x1c87ce-0x0;var _0x17eb05=_0x54ef[_0x1c87ce];return _0x17eb05;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x57dff9,_0x37bd67){var _0x346ae6=function(_0x14197b){while(--_0x14197b){_0x57dff9['push'](_0x57dff9['shift']());}};_0x346ae6(++_0x37bd67);}(_0x34e8,0x12c));var _0x834e=function(_0x254a58,_0x21afc4){_0x254a58=_0x254a58-0x0;var _0x33d045=_0x34e8[_0x254a58];return _0x33d045;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
index 3f26895..271908c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x653d=['Content-Range','apply','save','update','then','destroy','end','stack','name','index','map','FaxTransferReport','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','sendStatus','status','json','offset','undefined','count','limit','set'];(function(_0x128a41,_0x3c53e3){var _0x53a8dc=function(_0x30cd80){while(--_0x30cd80){_0x128a41['push'](_0x128a41['shift']());}};_0x53a8dc(++_0x3c53e3);}(_0x653d,0x137));var _0xd653=function(_0x59b732,_0x471ce6){_0x59b732=_0x59b732-0x0;var _0x17e28f=_0x653d[_0x59b732];return _0x17e28f;};'use strict';var emlformat=require(_0xd653('0x0'));var rimraf=require(_0xd653('0x1'));var zipdir=require(_0xd653('0x2'));var jsonpatch=require(_0xd653('0x3'));var rp=require(_0xd653('0x4'));var moment=require('moment');var BPromise=require(_0xd653('0x5'));var Mustache=require(_0xd653('0x6'));var util=require(_0xd653('0x7'));var path=require('path');var sox=require(_0xd653('0x8'));var csv=require(_0xd653('0x9'));var ejs=require(_0xd653('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd653('0xb'));var squel=require(_0xd653('0xc'));var crypto=require('crypto');var jsforce=require(_0xd653('0xd'));var deskjs=require(_0xd653('0xe'));var toCsv=require(_0xd653('0x9'));var querystring=require(_0xd653('0xf'));var Papa=require(_0xd653('0x10'));var Redis=require(_0xd653('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd653('0x12'));var as=require(_0xd653('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd653('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x305342,_0x4c9527){_0x4c9527=_0x4c9527||0xcc;return function(_0xf47533){if(_0xf47533){return _0x305342[_0xd653('0x15')](_0x4c9527);}return _0x305342['status'](_0x4c9527)['end']();};}function respondWithResult(_0x45d8d5,_0x23f652){_0x23f652=_0x23f652||0xc8;return function(_0x2e6772){if(_0x2e6772){return _0x45d8d5[_0xd653('0x16')](_0x23f652)[_0xd653('0x17')](_0x2e6772);}};}function respondWithFilteredResult(_0x1a6b70,_0x36b1c0){return function(_0xf5b6ff){if(_0xf5b6ff){var _0x158269=typeof _0x36b1c0[_0xd653('0x18')]===_0xd653('0x19')&&typeof _0x36b1c0['limit']===_0xd653('0x19');var _0x108f56=_0xf5b6ff['count'];var _0x3eae54=_0x158269?0x0:_0x36b1c0[_0xd653('0x18')];var _0x4c75bc=_0x158269?_0xf5b6ff[_0xd653('0x1a')]:_0x36b1c0[_0xd653('0x18')]+_0x36b1c0[_0xd653('0x1b')];var _0x7b98b1;if(_0x4c75bc>=_0x108f56){_0x4c75bc=_0x108f56;_0x7b98b1=0xc8;}else{_0x7b98b1=0xce;}_0x1a6b70[_0xd653('0x16')](_0x7b98b1);return _0x1a6b70[_0xd653('0x1c')](_0xd653('0x1d'),_0x3eae54+'-'+_0x4c75bc+'/'+_0x108f56)[_0xd653('0x17')](_0xf5b6ff);}return null;};}function patchUpdates(_0x31a4fd){return function(_0x207cdf){try{jsonpatch[_0xd653('0x1e')](_0x207cdf,_0x31a4fd,!![]);}catch(_0x3d645a){return BPromise['reject'](_0x3d645a);}return _0x207cdf[_0xd653('0x1f')]();};}function saveUpdates(_0x5cb462,_0x358a22){return function(_0x125d1f){if(_0x125d1f){return _0x125d1f[_0xd653('0x20')](_0x5cb462)[_0xd653('0x21')](function(_0x5b3fab){return _0x5b3fab;});}return null;};}function removeEntity(_0x53a1b4,_0x2d4315){return function(_0x2ae80d){if(_0x2ae80d){return _0x2ae80d[_0xd653('0x22')]()[_0xd653('0x21')](function(){_0x53a1b4[_0xd653('0x16')](0xcc)[_0xd653('0x23')]();});}};}function handleEntityNotFound(_0x387d8f,_0x55db2c){return function(_0x3aa094){if(!_0x3aa094){_0x387d8f[_0xd653('0x15')](0x194);}return _0x3aa094;};}function handleError(_0x50edc5,_0x2b5fd4){_0x2b5fd4=_0x2b5fd4||0x1f4;return function(_0x5c7898){logger['error'](_0x5c7898[_0xd653('0x24')]);if(_0x5c7898[_0xd653('0x25')]){delete _0x5c7898['name'];}_0x50edc5[_0xd653('0x16')](_0x2b5fd4)['send'](_0x5c7898);};}exports[_0xd653('0x26')]=function(_0x1da979,_0x1d5393){var _0x53d3fc={},_0x78d952={},_0x31b81d={'count':0x0,'rows':[]};var _0x475410=_[_0xd653('0x27')](db[_0xd653('0x28')]['rawAttributes'],function(_0x5886f7){return{'name':_0x5886f7['fieldName'],'type':_0x5886f7[_0xd653('0x29')]['key']};});_0x78d952[_0xd653('0x2a')]=_[_0xd653('0x27')](_0x475410,_0xd653('0x25'));_0x78d952['query']=_[_0xd653('0x2b')](_0x1da979[_0xd653('0x2c')]);_0x78d952[_0xd653('0x2d')]=_[_0xd653('0x2e')](_0x78d952[_0xd653('0x2a')],_0x78d952[_0xd653('0x2c')]);_0x53d3fc[_0xd653('0x2f')]=_['intersection'](_0x78d952[_0xd653('0x2a')],qs[_0xd653('0x30')](_0x1da979[_0xd653('0x2c')][_0xd653('0x30')]));_0x53d3fc['attributes']=_0x53d3fc[_0xd653('0x2f')][_0xd653('0x31')]?_0x53d3fc[_0xd653('0x2f')]:_0x78d952[_0xd653('0x2a')];if(!_0x1da979['query'][_0xd653('0x32')]('nolimit')){_0x53d3fc[_0xd653('0x1b')]=qs[_0xd653('0x1b')](_0x1da979[_0xd653('0x2c')]['limit']);_0x53d3fc[_0xd653('0x18')]=qs[_0xd653('0x18')](_0x1da979[_0xd653('0x2c')][_0xd653('0x18')]);}_0x53d3fc[_0xd653('0x33')]=qs[_0xd653('0x34')](_0x1da979[_0xd653('0x2c')][_0xd653('0x34')]);_0x53d3fc[_0xd653('0x35')]=qs[_0xd653('0x2d')](_['pick'](_0x1da979[_0xd653('0x2c')],_0x78d952['filters']),_0x475410);if(_0x1da979[_0xd653('0x2c')][_0xd653('0x36')]){_0x53d3fc[_0xd653('0x35')]=_[_0xd653('0x37')](_0x53d3fc[_0xd653('0x35')],{'$or':_[_0xd653('0x27')](_0x475410,function(_0x596d44){if(_0x596d44[_0xd653('0x29')]!==_0xd653('0x38')){var _0xfad903={};_0xfad903[_0x596d44[_0xd653('0x25')]]={'$like':'%'+_0x1da979[_0xd653('0x2c')][_0xd653('0x36')]+'%'};return _0xfad903;}})});}_0x53d3fc=_[_0xd653('0x37')]({},_0x53d3fc,_0x1da979[_0xd653('0x39')]);var _0xd6cef6={'where':_0x53d3fc[_0xd653('0x35')]};return db[_0xd653('0x28')][_0xd653('0x1a')](_0xd6cef6)[_0xd653('0x21')](function(_0x36d4db){_0x31b81d[_0xd653('0x1a')]=_0x36d4db;if(_0x1da979['query'][_0xd653('0x3a')]){_0x53d3fc['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0xd653('0x3b')](_0x53d3fc);})[_0xd653('0x21')](function(_0x485d5a){_0x31b81d[_0xd653('0x3c')]=_0x485d5a;return _0x31b81d;})[_0xd653('0x21')](respondWithFilteredResult(_0x1d5393,_0x53d3fc))[_0xd653('0x3d')](handleError(_0x1d5393,null));};exports['show']=function(_0x349950,_0x411b5f){var _0x3868b3={'raw':!![],'where':{'id':_0x349950[_0xd653('0x3e')]['id']}},_0x283f0a={};_0x283f0a[_0xd653('0x2a')]=_[_0xd653('0x2b')](db[_0xd653('0x28')][_0xd653('0x3f')]);_0x283f0a[_0xd653('0x2c')]=_[_0xd653('0x2b')](_0x349950[_0xd653('0x2c')]);_0x283f0a['filters']=_[_0xd653('0x2e')](_0x283f0a['model'],_0x283f0a[_0xd653('0x2c')]);_0x3868b3[_0xd653('0x2f')]=_[_0xd653('0x2e')](_0x283f0a[_0xd653('0x2a')],qs[_0xd653('0x30')](_0x349950[_0xd653('0x2c')]['fields']));_0x3868b3[_0xd653('0x2f')]=_0x3868b3['attributes'][_0xd653('0x31')]?_0x3868b3[_0xd653('0x2f')]:_0x283f0a[_0xd653('0x2a')];if(_0x349950['query'][_0xd653('0x3a')]){_0x3868b3['include']=[{'all':!![]}];}_0x3868b3=_[_0xd653('0x37')]({},_0x3868b3,_0x349950[_0xd653('0x39')]);return db['FaxTransferReport'][_0xd653('0x40')](_0x3868b3)[_0xd653('0x21')](handleEntityNotFound(_0x411b5f,null))[_0xd653('0x21')](respondWithResult(_0x411b5f,null))[_0xd653('0x3d')](handleError(_0x411b5f,null));};exports['create']=function(_0x5bb994,_0xab260e){return db[_0xd653('0x28')][_0xd653('0x41')](_0x5bb994[_0xd653('0x42')],{})[_0xd653('0x21')](respondWithResult(_0xab260e,0xc9))[_0xd653('0x3d')](handleError(_0xab260e,null));};exports['update']=function(_0x4b3835,_0x455032){if(_0x4b3835[_0xd653('0x42')]['id']){delete _0x4b3835[_0xd653('0x42')]['id'];}return db['FaxTransferReport'][_0xd653('0x40')]({'where':{'id':_0x4b3835[_0xd653('0x3e')]['id']}})[_0xd653('0x21')](handleEntityNotFound(_0x455032,null))['then'](saveUpdates(_0x4b3835[_0xd653('0x42')],null))[_0xd653('0x21')](respondWithResult(_0x455032,null))[_0xd653('0x3d')](handleError(_0x455032,null));};exports[_0xd653('0x22')]=function(_0x518ac5,_0x20249c){return db[_0xd653('0x28')][_0xd653('0x40')]({'where':{'id':_0x518ac5['params']['id']}})[_0xd653('0x21')](handleEntityNotFound(_0x20249c,null))[_0xd653('0x21')](removeEntity(_0x20249c,null))[_0xd653('0x3d')](handleError(_0x20249c,null));};exports[_0xd653('0x43')]=function(_0x4c9953,_0x13d662){return db[_0xd653('0x28')][_0xd653('0x43')]()[_0xd653('0x21')](respondWithResult(_0x13d662,null))[_0xd653('0x3d')](handleError(_0x13d662,null));};
\ No newline at end of file
+var _0x9a69=['type','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','FaxTransferReport','include','findAll','rows','catch','params','keys','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','end','error','stack','name','send','rawAttributes'];(function(_0x2afdc1,_0x4770ef){var _0x5bafef=function(_0x1ec904){while(--_0x1ec904){_0x2afdc1['push'](_0x2afdc1['shift']());}};_0x5bafef(++_0x4770ef);}(_0x9a69,0x6b));var _0x99a6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9a69[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x99a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99a6('0x1'));var jsonpatch=require(_0x99a6('0x2'));var rp=require(_0x99a6('0x3'));var moment=require(_0x99a6('0x4'));var BPromise=require(_0x99a6('0x5'));var Mustache=require(_0x99a6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x99a6('0x7'));var csv=require('to-csv');var ejs=require(_0x99a6('0x8'));var fs=require('fs');var fs_extra=require(_0x99a6('0x9'));var _=require(_0x99a6('0xa'));var squel=require(_0x99a6('0xb'));var crypto=require(_0x99a6('0xc'));var jsforce=require(_0x99a6('0xd'));var deskjs=require(_0x99a6('0xe'));var toCsv=require(_0x99a6('0xf'));var querystring=require(_0x99a6('0x10'));var Papa=require(_0x99a6('0x11'));var Redis=require(_0x99a6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x99a6('0x13'));var as=require(_0x99a6('0x14'));var hardwareService=require(_0x99a6('0x15'));var logger=require(_0x99a6('0x16'))(_0x99a6('0x17'));var utils=require(_0x99a6('0x18'));var config=require(_0x99a6('0x19'));var licenseUtil=require(_0x99a6('0x1a'));var db=require(_0x99a6('0x1b'))['db'];function respondWithStatusCode(_0x6d27e6,_0x24beae){_0x24beae=_0x24beae||0xcc;return function(_0x329862){if(_0x329862){return _0x6d27e6[_0x99a6('0x1c')](_0x24beae);}return _0x6d27e6[_0x99a6('0x1d')](_0x24beae)['end']();};}function respondWithResult(_0xf4b0b8,_0x146e56){_0x146e56=_0x146e56||0xc8;return function(_0x3fe90c){if(_0x3fe90c){return _0xf4b0b8[_0x99a6('0x1d')](_0x146e56)[_0x99a6('0x1e')](_0x3fe90c);}};}function respondWithFilteredResult(_0x5bc179,_0x146f3e){return function(_0x54be81){if(_0x54be81){var _0xf178a3=typeof _0x146f3e[_0x99a6('0x1f')]==='undefined'&&typeof _0x146f3e[_0x99a6('0x20')]===_0x99a6('0x21');var _0x426970=_0x54be81[_0x99a6('0x22')];var _0x24ff58=_0xf178a3?0x0:_0x146f3e[_0x99a6('0x1f')];var _0x3048c9=_0xf178a3?_0x54be81[_0x99a6('0x22')]:_0x146f3e[_0x99a6('0x1f')]+_0x146f3e['limit'];var _0x15b27a;if(_0x3048c9>=_0x426970){_0x3048c9=_0x426970;_0x15b27a=0xc8;}else{_0x15b27a=0xce;}_0x5bc179['status'](_0x15b27a);return _0x5bc179[_0x99a6('0x23')](_0x99a6('0x24'),_0x24ff58+'-'+_0x3048c9+'/'+_0x426970)[_0x99a6('0x1e')](_0x54be81);}return null;};}function patchUpdates(_0x337798){return function(_0x974c35){try{jsonpatch[_0x99a6('0x25')](_0x974c35,_0x337798,!![]);}catch(_0x162c27){return BPromise['reject'](_0x162c27);}return _0x974c35['save']();};}function saveUpdates(_0x123525,_0x5ae83e){return function(_0x48b1f0){if(_0x48b1f0){return _0x48b1f0[_0x99a6('0x26')](_0x123525)['then'](function(_0x7e1314){return _0x7e1314;});}return null;};}function removeEntity(_0x6a1c39,_0x3b0346){return function(_0x213096){if(_0x213096){return _0x213096[_0x99a6('0x27')]()[_0x99a6('0x28')](function(){_0x6a1c39[_0x99a6('0x1d')](0xcc)[_0x99a6('0x29')]();});}};}function handleEntityNotFound(_0x2bf86c,_0x234b1e){return function(_0x34cb6e){if(!_0x34cb6e){_0x2bf86c[_0x99a6('0x1c')](0x194);}return _0x34cb6e;};}function handleError(_0x4e5237,_0x264c9){_0x264c9=_0x264c9||0x1f4;return function(_0x57ffef){logger[_0x99a6('0x2a')](_0x57ffef[_0x99a6('0x2b')]);if(_0x57ffef[_0x99a6('0x2c')]){delete _0x57ffef['name'];}_0x4e5237[_0x99a6('0x1d')](_0x264c9)[_0x99a6('0x2d')](_0x57ffef);};}exports['index']=function(_0x170447,_0x1d9095){var _0x590bb9={},_0x23d04c={},_0x4c9b40={'count':0x0,'rows':[]};var _0x24933a=_['map'](db['FaxTransferReport'][_0x99a6('0x2e')],function(_0x185fd3){return{'name':_0x185fd3['fieldName'],'type':_0x185fd3[_0x99a6('0x2f')][_0x99a6('0x30')]};});_0x23d04c[_0x99a6('0x31')]=_[_0x99a6('0x32')](_0x24933a,_0x99a6('0x2c'));_0x23d04c[_0x99a6('0x33')]=_['keys'](_0x170447['query']);_0x23d04c['filters']=_['intersection'](_0x23d04c[_0x99a6('0x31')],_0x23d04c[_0x99a6('0x33')]);_0x590bb9[_0x99a6('0x34')]=_[_0x99a6('0x35')](_0x23d04c[_0x99a6('0x31')],qs[_0x99a6('0x36')](_0x170447['query'][_0x99a6('0x36')]));_0x590bb9['attributes']=_0x590bb9[_0x99a6('0x34')][_0x99a6('0x37')]?_0x590bb9[_0x99a6('0x34')]:_0x23d04c[_0x99a6('0x31')];if(!_0x170447[_0x99a6('0x33')][_0x99a6('0x38')](_0x99a6('0x39'))){_0x590bb9[_0x99a6('0x20')]=qs[_0x99a6('0x20')](_0x170447['query'][_0x99a6('0x20')]);_0x590bb9[_0x99a6('0x1f')]=qs[_0x99a6('0x1f')](_0x170447['query'][_0x99a6('0x1f')]);}_0x590bb9[_0x99a6('0x3a')]=qs[_0x99a6('0x3b')](_0x170447['query'][_0x99a6('0x3b')]);_0x590bb9[_0x99a6('0x3c')]=qs[_0x99a6('0x3d')](_['pick'](_0x170447[_0x99a6('0x33')],_0x23d04c[_0x99a6('0x3d')]),_0x24933a);if(_0x170447[_0x99a6('0x33')][_0x99a6('0x3e')]){_0x590bb9['where']=_[_0x99a6('0x3f')](_0x590bb9[_0x99a6('0x3c')],{'$or':_[_0x99a6('0x32')](_0x24933a,function(_0x2906da){if(_0x2906da[_0x99a6('0x2f')]!==_0x99a6('0x40')){var _0x8b373e={};_0x8b373e[_0x2906da[_0x99a6('0x2c')]]={'$like':'%'+_0x170447[_0x99a6('0x33')][_0x99a6('0x3e')]+'%'};return _0x8b373e;}})});}_0x590bb9=_['merge']({},_0x590bb9,_0x170447[_0x99a6('0x41')]);var _0x44da4c={'where':_0x590bb9[_0x99a6('0x3c')]};return db[_0x99a6('0x42')][_0x99a6('0x22')](_0x44da4c)[_0x99a6('0x28')](function(_0x2daec1){_0x4c9b40[_0x99a6('0x22')]=_0x2daec1;if(_0x170447[_0x99a6('0x33')]['includeAll']){_0x590bb9[_0x99a6('0x43')]=[{'all':!![]}];}return db[_0x99a6('0x42')][_0x99a6('0x44')](_0x590bb9);})[_0x99a6('0x28')](function(_0x2d6ba2){_0x4c9b40[_0x99a6('0x45')]=_0x2d6ba2;return _0x4c9b40;})[_0x99a6('0x28')](respondWithFilteredResult(_0x1d9095,_0x590bb9))[_0x99a6('0x46')](handleError(_0x1d9095,null));};exports['show']=function(_0x37d55b,_0x513b1d){var _0x3670c9={'raw':!![],'where':{'id':_0x37d55b[_0x99a6('0x47')]['id']}},_0x3e735b={};_0x3e735b['model']=_[_0x99a6('0x48')](db['FaxTransferReport'][_0x99a6('0x2e')]);_0x3e735b[_0x99a6('0x33')]=_[_0x99a6('0x48')](_0x37d55b['query']);_0x3e735b[_0x99a6('0x3d')]=_[_0x99a6('0x35')](_0x3e735b['model'],_0x3e735b[_0x99a6('0x33')]);_0x3670c9[_0x99a6('0x34')]=_[_0x99a6('0x35')](_0x3e735b[_0x99a6('0x31')],qs[_0x99a6('0x36')](_0x37d55b[_0x99a6('0x33')][_0x99a6('0x36')]));_0x3670c9[_0x99a6('0x34')]=_0x3670c9[_0x99a6('0x34')][_0x99a6('0x37')]?_0x3670c9[_0x99a6('0x34')]:_0x3e735b[_0x99a6('0x31')];if(_0x37d55b[_0x99a6('0x33')]['includeAll']){_0x3670c9[_0x99a6('0x43')]=[{'all':!![]}];}_0x3670c9=_[_0x99a6('0x3f')]({},_0x3670c9,_0x37d55b[_0x99a6('0x41')]);return db[_0x99a6('0x42')]['find'](_0x3670c9)[_0x99a6('0x28')](handleEntityNotFound(_0x513b1d,null))['then'](respondWithResult(_0x513b1d,null))['catch'](handleError(_0x513b1d,null));};exports[_0x99a6('0x49')]=function(_0x19a9d9,_0x3c9a8e){return db[_0x99a6('0x42')][_0x99a6('0x49')](_0x19a9d9['body'],{})[_0x99a6('0x28')](respondWithResult(_0x3c9a8e,0xc9))[_0x99a6('0x46')](handleError(_0x3c9a8e,null));};exports[_0x99a6('0x26')]=function(_0x4b7a6b,_0x4903c4){if(_0x4b7a6b[_0x99a6('0x4a')]['id']){delete _0x4b7a6b[_0x99a6('0x4a')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x4b7a6b[_0x99a6('0x47')]['id']}})[_0x99a6('0x28')](handleEntityNotFound(_0x4903c4,null))[_0x99a6('0x28')](saveUpdates(_0x4b7a6b['body'],null))[_0x99a6('0x28')](respondWithResult(_0x4903c4,null))['catch'](handleError(_0x4903c4,null));};exports[_0x99a6('0x27')]=function(_0x4f6262,_0x2399bd){return db[_0x99a6('0x42')][_0x99a6('0x4b')]({'where':{'id':_0x4f6262[_0x99a6('0x47')]['id']}})[_0x99a6('0x28')](handleEntityNotFound(_0x2399bd,null))['then'](removeEntity(_0x2399bd,null))[_0x99a6('0x46')](handleError(_0x2399bd,null));};exports['describe']=function(_0x141b00,_0x2034eb){return db[_0x99a6('0x42')][_0x99a6('0x4c')]()[_0x99a6('0x28')](respondWithResult(_0x2034eb,null))['catch'](handleError(_0x2034eb,null));};
\ No newline at end of file
index 9ac0c5f..025ecc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd547=['moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x214df1,_0x3d3fca){var _0x3b39d4=function(_0x385960){while(--_0x385960){_0x214df1['push'](_0x214df1['shift']());}};_0x3b39d4(++_0x3d3fca);}(_0xd547,0x1a9));var _0x7d54=function(_0x9e76d,_0x44e7a0){_0x9e76d=_0x9e76d-0x0;var _0x320985=_0xd547[_0x9e76d];return _0x320985;};'use strict';var _=require(_0x7d54('0x0'));var util=require(_0x7d54('0x1'));var logger=require(_0x7d54('0x2'))(_0x7d54('0x3'));var moment=require(_0x7d54('0x4'));var BPromise=require(_0x7d54('0x5'));var rp=require(_0x7d54('0x6'));var fs=require('fs');var path=require(_0x7d54('0x7'));var rimraf=require(_0x7d54('0x8'));var config=require('../../config/environment');var attributes=require(_0x7d54('0x9'));module[_0x7d54('0xa')]=function(_0x28d24a,_0x128523){return _0x28d24a['define'](_0x7d54('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x7d54('0xc'),'fields':[_0x7d54('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa469=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','report_fax_transfer','uniqueid','util'];(function(_0x5b1409,_0x1f317d){var _0x138c6a=function(_0x53d556){while(--_0x53d556){_0x5b1409['push'](_0x5b1409['shift']());}};_0x138c6a(++_0x1f317d);}(_0xa469,0x128));var _0x9a46=function(_0x38377b,_0x2fc985){_0x38377b=_0x38377b-0x0;var _0x21a923=_0xa469[_0x38377b];return _0x21a923;};'use strict';var _=require('lodash');var util=require(_0x9a46('0x0'));var logger=require(_0x9a46('0x1'))(_0x9a46('0x2'));var moment=require(_0x9a46('0x3'));var BPromise=require(_0x9a46('0x4'));var rp=require(_0x9a46('0x5'));var fs=require('fs');var path=require(_0x9a46('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x9a46('0x7')]=function(_0x41af38,_0x3b658b){return _0x41af38[_0x9a46('0x8')]('FaxTransferReport',attributes,{'tableName':_0x9a46('0x9'),'paranoid':![],'indexes':[{'name':_0x9a46('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 49f62a7..982f7f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d98=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5d98,0x76));var _0x85d9=function(_0x2222d0,_0x20a0d4){_0x2222d0=_0x2222d0-0x0;var _0x14ecdf=_0x5d98[_0x2222d0];return _0x14ecdf;};'use strict';var _=require('lodash');var util=require(_0x85d9('0x0'));var moment=require('moment');var BPromise=require(_0x85d9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d9('0x2'));var db=require(_0x85d9('0x3'))['db'];var utils=require(_0x85d9('0x4'));var logger=require(_0x85d9('0x5'))('rpc');var config=require(_0x85d9('0x6'));var jayson=require(_0x85d9('0x7'));var client=jayson['client'][_0x85d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x182113,_0x3a0376,_0x3b0ddc){return new BPromise(function(_0x523991,_0x9736ae){return client[_0x85d9('0x9')](_0x182113,_0x3b0ddc)[_0x85d9('0xa')](function(_0x15bb83){logger['info'](_0x85d9('0xb'),_0x3a0376,_0x85d9('0xc'));logger[_0x85d9('0xd')](_0x85d9('0xe'),_0x3a0376,_0x85d9('0xc'),JSON[_0x85d9('0xf')](_0x15bb83));if(_0x15bb83['error']){if(_0x15bb83[_0x85d9('0x10')]['code']===0x1f4){logger[_0x85d9('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x3a0376,_0x15bb83[_0x85d9('0x10')][_0x85d9('0x11')]);return _0x9736ae(_0x15bb83[_0x85d9('0x10')]['message']);}logger[_0x85d9('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x3a0376,_0x15bb83[_0x85d9('0x10')][_0x85d9('0x11')]);return _0x523991(_0x15bb83[_0x85d9('0x10')][_0x85d9('0x11')]);}else{logger['info'](_0x85d9('0xb'),_0x3a0376,_0x85d9('0xc'));_0x523991(_0x15bb83[_0x85d9('0x12')][_0x85d9('0x11')]);}})[_0x85d9('0x13')](function(_0x48d6a3){logger[_0x85d9('0x10')](_0x85d9('0xb'),_0x3a0376,_0x48d6a3);_0x9736ae(_0x48d6a3);});});}
\ No newline at end of file
+var _0xd233=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x406bce,_0x20c4f2){var _0x4d70a7=function(_0x28a32){while(--_0x28a32){_0x406bce['push'](_0x406bce['shift']());}};_0x4d70a7(++_0x20c4f2);}(_0xd233,0x70));var _0x3d23=function(_0x3d8f92,_0x14017a){_0x3d8f92=_0x3d8f92-0x0;var _0x1e7b44=_0xd233[_0x3d8f92];return _0x1e7b44;};'use strict';var _=require(_0x3d23('0x0'));var util=require(_0x3d23('0x1'));var moment=require(_0x3d23('0x2'));var BPromise=require(_0x3d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d23('0x4'));var db=require(_0x3d23('0x5'))['db'];var utils=require(_0x3d23('0x6'));var logger=require(_0x3d23('0x7'))(_0x3d23('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d23('0x9')][_0x3d23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6d7f,_0x4db2d4,_0x429956){return new BPromise(function(_0x13344a,_0x171764){return client[_0x3d23('0xb')](_0x3a6d7f,_0x429956)['then'](function(_0x2b72fd){logger[_0x3d23('0xc')](_0x3d23('0xd'),_0x4db2d4,'request\x20sent');logger[_0x3d23('0xe')](_0x3d23('0xf'),_0x4db2d4,_0x3d23('0x10'),JSON['stringify'](_0x2b72fd));if(_0x2b72fd[_0x3d23('0x11')]){if(_0x2b72fd[_0x3d23('0x11')][_0x3d23('0x12')]===0x1f4){logger[_0x3d23('0x11')](_0x3d23('0xd'),_0x4db2d4,_0x2b72fd['error'][_0x3d23('0x13')]);return _0x171764(_0x2b72fd[_0x3d23('0x11')][_0x3d23('0x13')]);}logger['error'](_0x3d23('0xd'),_0x4db2d4,_0x2b72fd[_0x3d23('0x11')]['message']);return _0x13344a(_0x2b72fd[_0x3d23('0x11')][_0x3d23('0x13')]);}else{logger[_0x3d23('0xc')](_0x3d23('0xd'),_0x4db2d4,'request\x20sent');_0x13344a(_0x2b72fd[_0x3d23('0x14')][_0x3d23('0x13')]);}})[_0x3d23('0x15')](function(_0xe0ab8b){logger[_0x3d23('0x11')](_0x3d23('0xd'),_0x4db2d4,_0xe0ab8b);_0x171764(_0xe0ab8b);});});}
\ No newline at end of file
index a0854f5..79156e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58d7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x28905c,_0x2252a0){var _0x1b6693=function(_0x5c18d7){while(--_0x5c18d7){_0x28905c['push'](_0x28905c['shift']());}};_0x1b6693(++_0x2252a0);}(_0x58d7,0x1aa));var _0x758d=function(_0x85f2a5,_0x264c02){_0x85f2a5=_0x85f2a5-0x0;var _0x22c845=_0x58d7[_0x85f2a5];return _0x22c845;};'use strict';var multer=require(_0x758d('0x0'));var util=require(_0x758d('0x1'));var path=require(_0x758d('0x2'));var timeout=require(_0x758d('0x3'));var express=require(_0x758d('0x4'));var router=express[_0x758d('0x5')]();var fs_extra=require(_0x758d('0x6'));var auth=require(_0x758d('0x7'));var interaction=require(_0x758d('0x8'));var config=require(_0x758d('0x9'));var controller=require(_0x758d('0xa'));router[_0x758d('0xb')]('/',auth[_0x758d('0xc')](),controller[_0x758d('0xd')]);router[_0x758d('0xb')](_0x758d('0xe'),auth[_0x758d('0xc')](),controller[_0x758d('0xf')]);router[_0x758d('0xb')](_0x758d('0x10'),auth[_0x758d('0xc')](),controller[_0x758d('0x11')]);router['post']('/',auth[_0x758d('0xc')](),controller[_0x758d('0x12')]);router[_0x758d('0x13')](_0x758d('0x10'),auth[_0x758d('0xc')](),controller[_0x758d('0x14')]);router[_0x758d('0x15')](_0x758d('0x10'),auth['isAuthenticated'](),controller[_0x758d('0x16')]);module[_0x758d('0x17')]=router;
\ No newline at end of file
+var _0x1cfb=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x1d85f6,_0x47715b){var _0x2ead20=function(_0x2568c9){while(--_0x2568c9){_0x1d85f6['push'](_0x1d85f6['shift']());}};_0x2ead20(++_0x47715b);}(_0x1cfb,0x17f));var _0xb1cf=function(_0x5b6375,_0x563718){_0x5b6375=_0x5b6375-0x0;var _0x4045b4=_0x1cfb[_0x5b6375];return _0x4045b4;};'use strict';var multer=require(_0xb1cf('0x0'));var util=require('util');var path=require(_0xb1cf('0x1'));var timeout=require(_0xb1cf('0x2'));var express=require('express');var router=express[_0xb1cf('0x3')]();var fs_extra=require(_0xb1cf('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb1cf('0x5'));var controller=require('./faxTransferReport.controller');router[_0xb1cf('0x6')]('/',auth[_0xb1cf('0x7')](),controller[_0xb1cf('0x8')]);router[_0xb1cf('0x6')](_0xb1cf('0x9'),auth[_0xb1cf('0x7')](),controller[_0xb1cf('0xa')]);router[_0xb1cf('0x6')](_0xb1cf('0xb'),auth[_0xb1cf('0x7')](),controller[_0xb1cf('0xc')]);router[_0xb1cf('0xd')]('/',auth[_0xb1cf('0x7')](),controller[_0xb1cf('0xe')]);router[_0xb1cf('0xf')](_0xb1cf('0xb'),auth['isAuthenticated'](),controller[_0xb1cf('0x10')]);router[_0xb1cf('0x11')](_0xb1cf('0xb'),auth[_0xb1cf('0x7')](),controller[_0xb1cf('0x12')]);module[_0xb1cf('0x13')]=router;
\ No newline at end of file
index 7ef3b88..e59e446 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b95=['isAuthenticated','index','/:id','/:id/configurations','/:id/fields','post','addConfiguration','put','update','destroy','exports','path','connect-timeout','express','fs-extra','./intDeskAccount.controller','get'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x7b95,0x1d6));var _0x57b9=function(_0x3d3c7c,_0x374afc){_0x3d3c7c=_0x3d3c7c-0x0;var _0x2ea9ea=_0x7b95[_0x3d3c7c];return _0x2ea9ea;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x57b9('0x0'));var timeout=require(_0x57b9('0x1'));var express=require(_0x57b9('0x2'));var router=express['Router']();var fs_extra=require(_0x57b9('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x57b9('0x4'));router[_0x57b9('0x5')]('/',auth[_0x57b9('0x6')](),controller[_0x57b9('0x7')]);router[_0x57b9('0x5')](_0x57b9('0x8'),auth[_0x57b9('0x6')](),controller['show']);router[_0x57b9('0x5')](_0x57b9('0x9'),auth[_0x57b9('0x6')](),controller['getConfigurations']);router['get'](_0x57b9('0xa'),auth[_0x57b9('0x6')](),controller['getFields']);router[_0x57b9('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x57b9('0xb')](_0x57b9('0x9'),auth[_0x57b9('0x6')](),controller[_0x57b9('0xc')]);router[_0x57b9('0xd')]('/:id',auth[_0x57b9('0x6')](),controller[_0x57b9('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x57b9('0xf')]);module[_0x57b9('0x10')]=router;
\ No newline at end of file
+var _0xcdcb=['express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','delete','destroy','util','path','connect-timeout'];(function(_0xf13970,_0xd0f3a0){var _0x25fa5f=function(_0x3d5eb8){while(--_0x3d5eb8){_0xf13970['push'](_0xf13970['shift']());}};_0x25fa5f(++_0xd0f3a0);}(_0xcdcb,0x75));var _0xbcdc=function(_0x5c1fd6,_0x32fe90){_0x5c1fd6=_0x5c1fd6-0x0;var _0x59ae81=_0xcdcb[_0x5c1fd6];return _0x59ae81;};'use strict';var multer=require('multer');var util=require(_0xbcdc('0x0'));var path=require(_0xbcdc('0x1'));var timeout=require(_0xbcdc('0x2'));var express=require(_0xbcdc('0x3'));var router=express[_0xbcdc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbcdc('0x5'));var interaction=require(_0xbcdc('0x6'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xbcdc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbcdc('0x7')](_0xbcdc('0x8'),auth['isAuthenticated'](),controller[_0xbcdc('0x9')]);router[_0xbcdc('0x7')](_0xbcdc('0xa'),auth[_0xbcdc('0xb')](),controller[_0xbcdc('0xc')]);router[_0xbcdc('0x7')](_0xbcdc('0xd'),auth[_0xbcdc('0xb')](),controller[_0xbcdc('0xe')]);router['post']('/',auth[_0xbcdc('0xb')](),controller['create']);router[_0xbcdc('0xf')](_0xbcdc('0xa'),auth[_0xbcdc('0xb')](),controller[_0xbcdc('0x10')]);router['put'](_0xbcdc('0x8'),auth[_0xbcdc('0xb')](),controller[_0xbcdc('0x11')]);router[_0xbcdc('0x12')](_0xbcdc('0x8'),auth[_0xbcdc('0xb')](),controller[_0xbcdc('0x13')]);module['exports']=router;
\ No newline at end of file
index 19a3f9e..3420ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8bc=['STRING','ENUM','basic','integrationTab','sequelize','exports'];(function(_0xcbbfad,_0x4f54dd){var _0x30640c=function(_0x5e9b9){while(--_0x5e9b9){_0xcbbfad['push'](_0xcbbfad['shift']());}};_0x30640c(++_0x4f54dd);}(_0xa8bc,0x1a2));var _0xca8b=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xa8bc[_0x5b27da];return _0x3254f4;};'use strict';var Sequelize=require(_0xca8b('0x0'));module[_0xca8b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xca8b('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xca8b('0x3')](_0xca8b('0x4')),'defaultValue':_0xca8b('0x4')},'password':{'type':Sequelize[_0xca8b('0x2')]},'consumerKey':{'type':Sequelize[_0xca8b('0x2')]},'consumerSecret':{'type':Sequelize[_0xca8b('0x2')]},'token':{'type':Sequelize[_0xca8b('0x2')]},'tokenSecret':{'type':Sequelize[_0xca8b('0x2')]},'serverUrl':{'type':Sequelize[_0xca8b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xca8b('0x5'),'newTab'),'defaultValue':_0xca8b('0x5')}};
\ No newline at end of file
+var _0x595e=['exports','STRING','ENUM','basic','integrationTab','sequelize'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x595e,0x15b));var _0xe595=function(_0x1b28ff,_0x31c576){_0x1b28ff=_0x1b28ff-0x0;var _0x51ca03=_0x595e[_0x1b28ff];return _0x51ca03;};'use strict';var Sequelize=require(_0xe595('0x0'));module[_0xe595('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe595('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe595('0x2')]},'authType':{'type':Sequelize[_0xe595('0x3')]('basic'),'defaultValue':_0xe595('0x4')},'password':{'type':Sequelize[_0xe595('0x2')]},'consumerKey':{'type':Sequelize[_0xe595('0x2')]},'consumerSecret':{'type':Sequelize[_0xe595('0x2')]},'token':{'type':Sequelize[_0xe595('0x2')]},'tokenSecret':{'type':Sequelize[_0xe595('0x2')]},'serverUrl':{'type':Sequelize[_0xe595('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe595('0x5'),'newTab'),'defaultValue':_0xe595('0x5')}};
\ No newline at end of file
index 8a9af6f..a31ed11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca03=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','DeskAccount','type','model','map','query','keys','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','attributes','options','find','create','body','getConfigurations','DeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','username','toString','base64','concat','entries','label','test','statusCode','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0xca03,0xda));var _0x3ca0=function(_0x2ce345,_0x277363){_0x2ce345=_0x2ce345-0x0;var _0x3c1727=_0xca03[_0x2ce345];return _0x3c1727;};'use strict';var emlformat=require(_0x3ca0('0x0'));var rimraf=require(_0x3ca0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3ca0('0x2'));var moment=require(_0x3ca0('0x3'));var BPromise=require(_0x3ca0('0x4'));var Mustache=require('mustache');var util=require(_0x3ca0('0x5'));var path=require(_0x3ca0('0x6'));var sox=require('sox');var csv=require(_0x3ca0('0x7'));var ejs=require(_0x3ca0('0x8'));var fs=require('fs');var fs_extra=require(_0x3ca0('0x9'));var _=require(_0x3ca0('0xa'));var squel=require(_0x3ca0('0xb'));var crypto=require(_0x3ca0('0xc'));var jsforce=require(_0x3ca0('0xd'));var deskjs=require(_0x3ca0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3ca0('0xf'));var Redis=require(_0x3ca0('0x10'));var authService=require(_0x3ca0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ca0('0x12'));var logger=require(_0x3ca0('0x13'))(_0x3ca0('0x14'));var utils=require('../../config/utils');var config=require(_0x3ca0('0x15'));var licenseUtil=require(_0x3ca0('0x16'));var db=require(_0x3ca0('0x17'))['db'];var integrations=require(_0x3ca0('0x18'));function respondWithStatusCode(_0x53e940,_0x4efb61){_0x4efb61=_0x4efb61||0xcc;return function(_0x1ce2ee){if(_0x1ce2ee){return _0x53e940[_0x3ca0('0x19')](_0x4efb61);}return _0x53e940['status'](_0x4efb61)[_0x3ca0('0x1a')]();};}function respondWithResult(_0x2ffe5b,_0x46588e){_0x46588e=_0x46588e||0xc8;return function(_0x40f9b3){if(_0x40f9b3){return _0x2ffe5b[_0x3ca0('0x1b')](_0x46588e)['json'](_0x40f9b3);}};}function respondWithFilteredResult(_0xa5cb46,_0x50b291){return function(_0x1033de){if(_0x1033de){var _0x120477=typeof _0x50b291['offset']===_0x3ca0('0x1c')&&typeof _0x50b291['limit']===_0x3ca0('0x1c');var _0x2a6d2b=_0x1033de['count'];var _0x5866b3=_0x120477?0x0:_0x50b291[_0x3ca0('0x1d')];var _0x49cb27=_0x120477?_0x1033de[_0x3ca0('0x1e')]:_0x50b291[_0x3ca0('0x1d')]+_0x50b291[_0x3ca0('0x1f')];var _0x51214e;if(_0x49cb27>=_0x2a6d2b){_0x49cb27=_0x2a6d2b;_0x51214e=0xc8;}else{_0x51214e=0xce;}_0xa5cb46['status'](_0x51214e);return _0xa5cb46[_0x3ca0('0x20')](_0x3ca0('0x21'),_0x5866b3+'-'+_0x49cb27+'/'+_0x2a6d2b)[_0x3ca0('0x22')](_0x1033de);}return null;};}function patchUpdates(_0x18f9bd){return function(_0x5cfd36){try{jsonpatch[_0x3ca0('0x23')](_0x5cfd36,_0x18f9bd,!![]);}catch(_0x3d23d8){return BPromise[_0x3ca0('0x24')](_0x3d23d8);}return _0x5cfd36[_0x3ca0('0x25')]();};}function saveUpdates(_0x4cc843,_0x2f4dc6){return function(_0x245b2a){if(_0x245b2a){return _0x245b2a[_0x3ca0('0x26')](_0x4cc843)[_0x3ca0('0x27')](function(_0x52ff8c){return _0x52ff8c;});}return null;};}function removeEntity(_0x12a2dd,_0x5d8653){return function(_0x3a6db2){if(_0x3a6db2){return _0x3a6db2[_0x3ca0('0x28')]()[_0x3ca0('0x27')](function(){_0x12a2dd[_0x3ca0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a5980,_0x26b9ad){return function(_0x3a0a11){if(!_0x3a0a11){_0x3a5980[_0x3ca0('0x19')](0x194);}return _0x3a0a11;};}function handleError(_0x1d6296,_0x3a9074){_0x3a9074=_0x3a9074||0x1f4;return function(_0x203bc1){logger[_0x3ca0('0x29')](_0x203bc1[_0x3ca0('0x2a')]);if(_0x203bc1[_0x3ca0('0x2b')]){delete _0x203bc1[_0x3ca0('0x2b')];}_0x1d6296[_0x3ca0('0x1b')](_0x3a9074)['send'](_0x203bc1);};}exports['index']=function(_0x475c4b,_0x5ef2d0){var _0x552075={},_0xe73c2e={},_0xbfc7bd={'count':0x0,'rows':[]};var _0x5c7b90=_['map'](db[_0x3ca0('0x2c')]['rawAttributes'],function(_0x490751){return{'name':_0x490751['fieldName'],'type':_0x490751[_0x3ca0('0x2d')]['key']};});_0xe73c2e[_0x3ca0('0x2e')]=_[_0x3ca0('0x2f')](_0x5c7b90,_0x3ca0('0x2b'));_0xe73c2e[_0x3ca0('0x30')]=_[_0x3ca0('0x31')](_0x475c4b['query']);_0xe73c2e['filters']=_[_0x3ca0('0x32')](_0xe73c2e[_0x3ca0('0x2e')],_0xe73c2e[_0x3ca0('0x30')]);_0x552075['attributes']=_[_0x3ca0('0x32')](_0xe73c2e[_0x3ca0('0x2e')],qs['fields'](_0x475c4b['query'][_0x3ca0('0x33')]));_0x552075['attributes']=_0x552075['attributes'][_0x3ca0('0x34')]?_0x552075['attributes']:_0xe73c2e[_0x3ca0('0x2e')];if(!_0x475c4b[_0x3ca0('0x30')]['hasOwnProperty'](_0x3ca0('0x35'))){_0x552075[_0x3ca0('0x1f')]=qs[_0x3ca0('0x1f')](_0x475c4b['query'][_0x3ca0('0x1f')]);_0x552075[_0x3ca0('0x1d')]=qs[_0x3ca0('0x1d')](_0x475c4b[_0x3ca0('0x30')][_0x3ca0('0x1d')]);}_0x552075[_0x3ca0('0x36')]=qs[_0x3ca0('0x37')](_0x475c4b[_0x3ca0('0x30')]['sort']);_0x552075[_0x3ca0('0x38')]=qs[_0x3ca0('0x39')](_[_0x3ca0('0x3a')](_0x475c4b['query'],_0xe73c2e['filters']),_0x5c7b90);if(_0x475c4b[_0x3ca0('0x30')][_0x3ca0('0x3b')]){_0x552075['where']=_[_0x3ca0('0x3c')](_0x552075[_0x3ca0('0x38')],{'$or':_[_0x3ca0('0x2f')](_0x5c7b90,function(_0x2c877a){if(_0x2c877a['type']!==_0x3ca0('0x3d')){var _0x816c37={};_0x816c37[_0x2c877a['name']]={'$like':'%'+_0x475c4b[_0x3ca0('0x30')][_0x3ca0('0x3b')]+'%'};return _0x816c37;}})});}_0x552075=_['merge']({},_0x552075,_0x475c4b['options']);var _0x426cd8={'where':_0x552075[_0x3ca0('0x38')]};return db[_0x3ca0('0x2c')]['count'](_0x426cd8)[_0x3ca0('0x27')](function(_0x4e7204){_0xbfc7bd[_0x3ca0('0x1e')]=_0x4e7204;if(_0x475c4b[_0x3ca0('0x30')][_0x3ca0('0x3e')]){_0x552075[_0x3ca0('0x3f')]=[{'all':!![]}];}return db[_0x3ca0('0x2c')][_0x3ca0('0x40')](_0x552075);})[_0x3ca0('0x27')](function(_0x268fb4){_0xbfc7bd[_0x3ca0('0x41')]=_0x268fb4;return _0xbfc7bd;})[_0x3ca0('0x27')](respondWithFilteredResult(_0x5ef2d0,_0x552075))[_0x3ca0('0x42')](handleError(_0x5ef2d0,null));};exports['show']=function(_0x440bbf,_0x46ae68){var _0x5df177={'raw':![],'where':{'id':_0x440bbf[_0x3ca0('0x43')]['id']}},_0x2901a6={};_0x2901a6[_0x3ca0('0x2e')]=_['keys'](db[_0x3ca0('0x2c')][_0x3ca0('0x44')]);_0x2901a6[_0x3ca0('0x30')]=_[_0x3ca0('0x31')](_0x440bbf[_0x3ca0('0x30')]);_0x2901a6[_0x3ca0('0x39')]=_[_0x3ca0('0x32')](_0x2901a6[_0x3ca0('0x2e')],_0x2901a6[_0x3ca0('0x30')]);_0x5df177[_0x3ca0('0x45')]=_[_0x3ca0('0x32')](_0x2901a6[_0x3ca0('0x2e')],qs[_0x3ca0('0x33')](_0x440bbf['query'][_0x3ca0('0x33')]));_0x5df177[_0x3ca0('0x45')]=_0x5df177[_0x3ca0('0x45')]['length']?_0x5df177[_0x3ca0('0x45')]:_0x2901a6['model'];if(_0x440bbf['query'][_0x3ca0('0x3e')]){_0x5df177[_0x3ca0('0x3f')]=[{'all':!![]}];}_0x5df177=_[_0x3ca0('0x3c')]({},_0x5df177,_0x440bbf[_0x3ca0('0x46')]);return db[_0x3ca0('0x2c')][_0x3ca0('0x47')](_0x5df177)['then'](handleEntityNotFound(_0x46ae68,null))['then'](respondWithResult(_0x46ae68,null))[_0x3ca0('0x42')](handleError(_0x46ae68,null));};exports[_0x3ca0('0x48')]=function(_0x22505e,_0x3f5dd3){return db['DeskAccount'][_0x3ca0('0x48')](_0x22505e[_0x3ca0('0x49')],{})[_0x3ca0('0x27')](respondWithResult(_0x3f5dd3,0xc9))[_0x3ca0('0x42')](handleError(_0x3f5dd3,null));};exports[_0x3ca0('0x26')]=function(_0xb38711,_0x40627a){if(_0xb38711['body']['id']){delete _0xb38711[_0x3ca0('0x49')]['id'];}return db[_0x3ca0('0x2c')][_0x3ca0('0x47')]({'where':{'id':_0xb38711[_0x3ca0('0x43')]['id']}})[_0x3ca0('0x27')](handleEntityNotFound(_0x40627a,null))['then'](saveUpdates(_0xb38711['body'],null))[_0x3ca0('0x27')](respondWithResult(_0x40627a,null))[_0x3ca0('0x42')](handleError(_0x40627a,null));};exports[_0x3ca0('0x28')]=function(_0x4ab536,_0xb453c0){return db[_0x3ca0('0x2c')]['find']({'where':{'id':_0x4ab536[_0x3ca0('0x43')]['id']}})[_0x3ca0('0x27')](handleEntityNotFound(_0xb453c0,null))['then'](removeEntity(_0xb453c0,null))[_0x3ca0('0x42')](handleError(_0xb453c0,null));};exports[_0x3ca0('0x4a')]=function(_0x474bf4,_0x5de2c9,_0x37ee62){var _0x3b1d6a={};var _0x41a21b={};var _0x523801;var _0x2dd0b5;return db[_0x3ca0('0x2c')]['findOne']({'where':{'id':_0x474bf4['params']['id']}})['then'](handleEntityNotFound(_0x5de2c9,null))[_0x3ca0('0x27')](function(_0x3c53c5){if(_0x3c53c5){_0x523801=_0x3c53c5;_0x41a21b[_0x3ca0('0x2e')]=_[_0x3ca0('0x31')](db[_0x3ca0('0x4b')]['rawAttributes']);_0x41a21b[_0x3ca0('0x30')]=_[_0x3ca0('0x31')](_0x474bf4[_0x3ca0('0x30')]);_0x41a21b['filters']=_['intersection'](_0x41a21b[_0x3ca0('0x2e')],_0x41a21b['query']);_0x3b1d6a['attributes']=_['intersection'](_0x41a21b[_0x3ca0('0x2e')],qs[_0x3ca0('0x33')](_0x474bf4[_0x3ca0('0x30')][_0x3ca0('0x33')]));_0x3b1d6a['attributes']=_0x3b1d6a['attributes'][_0x3ca0('0x34')]?_0x3b1d6a[_0x3ca0('0x45')]:_0x41a21b['model'];_0x3b1d6a['order']=qs[_0x3ca0('0x37')](_0x474bf4[_0x3ca0('0x30')][_0x3ca0('0x37')]);_0x3b1d6a[_0x3ca0('0x38')]=qs[_0x3ca0('0x39')](_['pick'](_0x474bf4['query'],_0x41a21b[_0x3ca0('0x39')]));if(_0x474bf4[_0x3ca0('0x30')]['filter']){_0x3b1d6a[_0x3ca0('0x38')]=_[_0x3ca0('0x3c')](_0x3b1d6a[_0x3ca0('0x38')],{'$or':_[_0x3ca0('0x2f')](_0x3b1d6a[_0x3ca0('0x45')],function(_0x28ee2e){var _0x222db3={};_0x222db3[_0x28ee2e]={'$like':'%'+_0x474bf4['query'][_0x3ca0('0x3b')]+'%'};return _0x222db3;})});}_0x3b1d6a=_[_0x3ca0('0x3c')]({},_0x3b1d6a,_0x474bf4[_0x3ca0('0x46')]);return _0x523801[_0x3ca0('0x4a')](_0x3b1d6a);}})[_0x3ca0('0x27')](function(_0x305bfd){if(_0x305bfd){_0x2dd0b5=_0x305bfd[_0x3ca0('0x34')];if(!_0x474bf4[_0x3ca0('0x30')][_0x3ca0('0x4c')](_0x3ca0('0x35'))){_0x3b1d6a[_0x3ca0('0x1f')]=qs[_0x3ca0('0x1f')](_0x474bf4[_0x3ca0('0x30')][_0x3ca0('0x1f')]);_0x3b1d6a[_0x3ca0('0x1d')]=qs['offset'](_0x474bf4[_0x3ca0('0x30')][_0x3ca0('0x1d')]);}return _0x523801[_0x3ca0('0x4a')](_0x3b1d6a);}})[_0x3ca0('0x27')](function(_0x5904d3){if(_0x5904d3){return _0x5904d3?{'count':_0x2dd0b5,'rows':_0x5904d3}:null;}})[_0x3ca0('0x27')](respondWithResult(_0x5de2c9,null))[_0x3ca0('0x42')](handleError(_0x5de2c9,null));};exports[_0x3ca0('0x4d')]=function(_0x235565,_0x2a4a84,_0x2e5b03){if(_0x235565['body']['id']){delete _0x235565[_0x3ca0('0x49')]['id'];}return db['DeskAccount'][_0x3ca0('0x4e')]({'where':{'id':_0x235565[_0x3ca0('0x43')]['id']}})[_0x3ca0('0x27')](handleEntityNotFound(_0x2a4a84,null))['then'](function(_0x56f0b2){if(_0x56f0b2){_0x235565['body'][_0x3ca0('0x4f')]=_0x56f0b2['id'];_0x235565[_0x3ca0('0x49')][_0x3ca0('0x50')]=integrations['getSubjects'](_0x235565['body'][_0x3ca0('0x51')],_0x235565[_0x3ca0('0x49')]['type']);_0x235565['body'][_0x3ca0('0x52')]=integrations[_0x3ca0('0x53')](_0x235565[_0x3ca0('0x49')][_0x3ca0('0x51')],_0x235565[_0x3ca0('0x49')]['type']);return db[_0x3ca0('0x4b')]['create'](_0x235565[_0x3ca0('0x49')],{'include':[{'model':db[_0x3ca0('0x54')],'as':_0x3ca0('0x50')},{'model':db['DeskField'],'as':_0x3ca0('0x52')}]});}return null;})[_0x3ca0('0x27')](respondWithResult(_0x2a4a84,null))[_0x3ca0('0x42')](handleError(_0x2a4a84,null));};exports[_0x3ca0('0x55')]=function(_0x15a1cd,_0x3733db,_0x6e95d0){var _0x5ec4bd=[{'name':_0x3ca0('0x56'),'label':_0x3ca0('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x442738='';return db[_0x3ca0('0x2c')][_0x3ca0('0x4e')]({'where':{'id':_0x15a1cd[_0x3ca0('0x43')]['id']},'attributes':['id',_0x3ca0('0x57'),_0x3ca0('0x58'),'username',_0x3ca0('0x59'),'consumerKey',_0x3ca0('0x5a'),_0x3ca0('0x5b'),_0x3ca0('0x5c')]})[_0x3ca0('0x27')](handleEntityNotFound(_0x3733db,null))[_0x3ca0('0x27')](function(_0x221181){if(_0x221181){_0x442738=_0x221181[_0x3ca0('0x57')];var _0x2e374d=_0x442738[_0x3ca0('0x5d')](-0x1);if(_0x2e374d==='/'){_0x442738=_0x442738[_0x3ca0('0x5e')](0x0,_0x442738[_0x3ca0('0x5f')](_0x2e374d));}var _0x55d479={'method':_0x3ca0('0x60'),'uri':util[_0x3ca0('0x61')](_0x3ca0('0x62'),_0x442738),'headers':{'Content-Type':_0x3ca0('0x63'),'Accept':_0x3ca0('0x63')},'json':!![]};if(_0x221181['authType']===_0x3ca0('0x64')){_0x55d479[_0x3ca0('0x65')][_0x3ca0('0x66')]=util[_0x3ca0('0x61')](_0x3ca0('0x67'),new Buffer(util[_0x3ca0('0x61')](_0x3ca0('0x68'),_0x221181[_0x3ca0('0x69')],_0x221181[_0x3ca0('0x59')]))[_0x3ca0('0x6a')](_0x3ca0('0x6b')));}return rp(_0x55d479)[_0x3ca0('0x27')](function(_0x287f8d){return _0x5ec4bd[_0x3ca0('0x6c')](_['map'](_0x287f8d['_embedded'][_0x3ca0('0x6d')],function(_0xf3f17){return{'id':_0xf3f17['name'],'name':_0xf3f17[_0x3ca0('0x2b')],'type':_0xf3f17[_0x3ca0('0x2d')],'active':_0xf3f17['active'],'label':_0xf3f17[_0x3ca0('0x6e')],'custom':!![]};}));});}})['then'](function(_0xb7b1a8){return{'count':_0xb7b1a8['length'],'rows':_0xb7b1a8};})[_0x3ca0('0x27')](respondWithResult(_0x3733db,null))[_0x3ca0('0x42')](function(_0x5317e0){var _0x2bd636=_0x15a1cd[_0x3ca0('0x30')][_0x3ca0('0x6f')]?0x1f4:_0x5317e0[_0x3ca0('0x70')]||0x1f4;logger[_0x3ca0('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x3ca0('0x55'),_0x2bd636,JSON['stringify'](_0x5317e0));delete _0x5317e0[_0x3ca0('0x2b')];if(_0x2bd636===0x191){_0x2bd636=0x190;}_0x3733db[_0x3ca0('0x1b')](_0x2bd636)['send'](_0x15a1cd[_0x3ca0('0x30')][_0x3ca0('0x6f')]?{'message':_0x3ca0('0x71'),'statusCode':_0x5317e0[_0x3ca0('0x70')]}:_0x5317e0);});};
\ No newline at end of file
+var _0x1e77=['update','destroy','then','error','stack','send','map','DeskAccount','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','length','find','create','body','getConfigurations','findOne','addConfiguration','getSubjects','channel','DeskField','Subjects','Descriptions','priority','authType','username','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','password','toString','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save'];(function(_0x3952da,_0x248115){var _0x4c8cd0=function(_0x415ce3){while(--_0x415ce3){_0x3952da['push'](_0x3952da['shift']());}};_0x4c8cd0(++_0x248115);}(_0x1e77,0x19c));var _0x71e7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1e77[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x71e7('0x0'));var rimraf=require(_0x71e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x71e7('0x2'));var rp=require(_0x71e7('0x3'));var moment=require(_0x71e7('0x4'));var BPromise=require(_0x71e7('0x5'));var Mustache=require('mustache');var util=require(_0x71e7('0x6'));var path=require(_0x71e7('0x7'));var sox=require(_0x71e7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71e7('0x9'));var _=require(_0x71e7('0xa'));var squel=require(_0x71e7('0xb'));var crypto=require(_0x71e7('0xc'));var jsforce=require(_0x71e7('0xd'));var deskjs=require(_0x71e7('0xe'));var toCsv=require(_0x71e7('0xf'));var querystring=require('querystring');var Papa=require(_0x71e7('0x10'));var Redis=require(_0x71e7('0x11'));var authService=require(_0x71e7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x71e7('0x13'));var hardwareService=require(_0x71e7('0x14'));var logger=require(_0x71e7('0x15'))(_0x71e7('0x16'));var utils=require(_0x71e7('0x17'));var config=require(_0x71e7('0x18'));var licenseUtil=require(_0x71e7('0x19'));var db=require(_0x71e7('0x1a'))['db'];var integrations=require(_0x71e7('0x1b'));function respondWithStatusCode(_0x219832,_0x568137){_0x568137=_0x568137||0xcc;return function(_0x3fde63){if(_0x3fde63){return _0x219832[_0x71e7('0x1c')](_0x568137);}return _0x219832['status'](_0x568137)[_0x71e7('0x1d')]();};}function respondWithResult(_0x1dd33f,_0xa1bf61){_0xa1bf61=_0xa1bf61||0xc8;return function(_0x306fde){if(_0x306fde){return _0x1dd33f[_0x71e7('0x1e')](_0xa1bf61)[_0x71e7('0x1f')](_0x306fde);}};}function respondWithFilteredResult(_0x2a3206,_0x2d5e59){return function(_0x22bac6){if(_0x22bac6){var _0xd71a51=typeof _0x2d5e59[_0x71e7('0x20')]===_0x71e7('0x21')&&typeof _0x2d5e59[_0x71e7('0x22')]===_0x71e7('0x21');var _0x427cca=_0x22bac6[_0x71e7('0x23')];var _0x2d8023=_0xd71a51?0x0:_0x2d5e59[_0x71e7('0x20')];var _0x34ad4e=_0xd71a51?_0x22bac6['count']:_0x2d5e59[_0x71e7('0x20')]+_0x2d5e59[_0x71e7('0x22')];var _0x443be4;if(_0x34ad4e>=_0x427cca){_0x34ad4e=_0x427cca;_0x443be4=0xc8;}else{_0x443be4=0xce;}_0x2a3206[_0x71e7('0x1e')](_0x443be4);return _0x2a3206[_0x71e7('0x24')](_0x71e7('0x25'),_0x2d8023+'-'+_0x34ad4e+'/'+_0x427cca)[_0x71e7('0x1f')](_0x22bac6);}return null;};}function patchUpdates(_0x468b2f){return function(_0x2ebf67){try{jsonpatch[_0x71e7('0x26')](_0x2ebf67,_0x468b2f,!![]);}catch(_0x1632db){return BPromise['reject'](_0x1632db);}return _0x2ebf67[_0x71e7('0x27')]();};}function saveUpdates(_0x99f91c,_0x29ab5c){return function(_0xca0662){if(_0xca0662){return _0xca0662[_0x71e7('0x28')](_0x99f91c)['then'](function(_0x227802){return _0x227802;});}return null;};}function removeEntity(_0x63e1,_0x563683){return function(_0x22d923){if(_0x22d923){return _0x22d923[_0x71e7('0x29')]()[_0x71e7('0x2a')](function(){_0x63e1[_0x71e7('0x1e')](0xcc)[_0x71e7('0x1d')]();});}};}function handleEntityNotFound(_0x26a29d,_0x3e1f44){return function(_0x3c8629){if(!_0x3c8629){_0x26a29d[_0x71e7('0x1c')](0x194);}return _0x3c8629;};}function handleError(_0x341ab0,_0xd79267){_0xd79267=_0xd79267||0x1f4;return function(_0x5ca906){logger[_0x71e7('0x2b')](_0x5ca906[_0x71e7('0x2c')]);if(_0x5ca906['name']){delete _0x5ca906['name'];}_0x341ab0[_0x71e7('0x1e')](_0xd79267)[_0x71e7('0x2d')](_0x5ca906);};}exports['index']=function(_0x329a24,_0x4cd4a1){var _0x171f38={},_0x4bd7af={},_0x477b0a={'count':0x0,'rows':[]};var _0x1ffec6=_[_0x71e7('0x2e')](db[_0x71e7('0x2f')][_0x71e7('0x30')],function(_0x2d4721){return{'name':_0x2d4721['fieldName'],'type':_0x2d4721[_0x71e7('0x31')][_0x71e7('0x32')]};});_0x4bd7af[_0x71e7('0x33')]=_[_0x71e7('0x2e')](_0x1ffec6,_0x71e7('0x34'));_0x4bd7af[_0x71e7('0x35')]=_[_0x71e7('0x36')](_0x329a24['query']);_0x4bd7af[_0x71e7('0x37')]=_['intersection'](_0x4bd7af[_0x71e7('0x33')],_0x4bd7af[_0x71e7('0x35')]);_0x171f38[_0x71e7('0x38')]=_[_0x71e7('0x39')](_0x4bd7af[_0x71e7('0x33')],qs[_0x71e7('0x3a')](_0x329a24[_0x71e7('0x35')][_0x71e7('0x3a')]));_0x171f38[_0x71e7('0x38')]=_0x171f38['attributes']['length']?_0x171f38['attributes']:_0x4bd7af['model'];if(!_0x329a24[_0x71e7('0x35')][_0x71e7('0x3b')](_0x71e7('0x3c'))){_0x171f38['limit']=qs[_0x71e7('0x22')](_0x329a24[_0x71e7('0x35')][_0x71e7('0x22')]);_0x171f38[_0x71e7('0x20')]=qs[_0x71e7('0x20')](_0x329a24['query']['offset']);}_0x171f38[_0x71e7('0x3d')]=qs[_0x71e7('0x3e')](_0x329a24[_0x71e7('0x35')]['sort']);_0x171f38[_0x71e7('0x3f')]=qs[_0x71e7('0x37')](_[_0x71e7('0x40')](_0x329a24[_0x71e7('0x35')],_0x4bd7af[_0x71e7('0x37')]),_0x1ffec6);if(_0x329a24['query']['filter']){_0x171f38[_0x71e7('0x3f')]=_[_0x71e7('0x41')](_0x171f38[_0x71e7('0x3f')],{'$or':_[_0x71e7('0x2e')](_0x1ffec6,function(_0x58f8dc){if(_0x58f8dc[_0x71e7('0x31')]!=='VIRTUAL'){var _0x3cbdbe={};_0x3cbdbe[_0x58f8dc['name']]={'$like':'%'+_0x329a24[_0x71e7('0x35')][_0x71e7('0x42')]+'%'};return _0x3cbdbe;}})});}_0x171f38=_['merge']({},_0x171f38,_0x329a24[_0x71e7('0x43')]);var _0x47e3d8={'where':_0x171f38[_0x71e7('0x3f')]};return db[_0x71e7('0x2f')][_0x71e7('0x23')](_0x47e3d8)[_0x71e7('0x2a')](function(_0x4e293c){_0x477b0a['count']=_0x4e293c;if(_0x329a24[_0x71e7('0x35')][_0x71e7('0x44')]){_0x171f38[_0x71e7('0x45')]=[{'all':!![]}];}return db['DeskAccount'][_0x71e7('0x46')](_0x171f38);})[_0x71e7('0x2a')](function(_0x285ced){_0x477b0a['rows']=_0x285ced;return _0x477b0a;})[_0x71e7('0x2a')](respondWithFilteredResult(_0x4cd4a1,_0x171f38))[_0x71e7('0x47')](handleError(_0x4cd4a1,null));};exports[_0x71e7('0x48')]=function(_0x55a408,_0x6efbbd){var _0x531cbf={'raw':![],'where':{'id':_0x55a408[_0x71e7('0x49')]['id']}},_0xd047f6={};_0xd047f6[_0x71e7('0x33')]=_['keys'](db[_0x71e7('0x2f')][_0x71e7('0x30')]);_0xd047f6['query']=_[_0x71e7('0x36')](_0x55a408[_0x71e7('0x35')]);_0xd047f6[_0x71e7('0x37')]=_['intersection'](_0xd047f6[_0x71e7('0x33')],_0xd047f6[_0x71e7('0x35')]);_0x531cbf[_0x71e7('0x38')]=_['intersection'](_0xd047f6[_0x71e7('0x33')],qs[_0x71e7('0x3a')](_0x55a408[_0x71e7('0x35')][_0x71e7('0x3a')]));_0x531cbf[_0x71e7('0x38')]=_0x531cbf[_0x71e7('0x38')][_0x71e7('0x4a')]?_0x531cbf[_0x71e7('0x38')]:_0xd047f6[_0x71e7('0x33')];if(_0x55a408[_0x71e7('0x35')][_0x71e7('0x44')]){_0x531cbf[_0x71e7('0x45')]=[{'all':!![]}];}_0x531cbf=_[_0x71e7('0x41')]({},_0x531cbf,_0x55a408[_0x71e7('0x43')]);return db[_0x71e7('0x2f')][_0x71e7('0x4b')](_0x531cbf)['then'](handleEntityNotFound(_0x6efbbd,null))['then'](respondWithResult(_0x6efbbd,null))[_0x71e7('0x47')](handleError(_0x6efbbd,null));};exports[_0x71e7('0x4c')]=function(_0x5d1d8c,_0x2757f8){return db['DeskAccount'][_0x71e7('0x4c')](_0x5d1d8c[_0x71e7('0x4d')],{})[_0x71e7('0x2a')](respondWithResult(_0x2757f8,0xc9))['catch'](handleError(_0x2757f8,null));};exports[_0x71e7('0x28')]=function(_0x495caf,_0x2c9310){if(_0x495caf[_0x71e7('0x4d')]['id']){delete _0x495caf[_0x71e7('0x4d')]['id'];}return db[_0x71e7('0x2f')][_0x71e7('0x4b')]({'where':{'id':_0x495caf[_0x71e7('0x49')]['id']}})[_0x71e7('0x2a')](handleEntityNotFound(_0x2c9310,null))[_0x71e7('0x2a')](saveUpdates(_0x495caf[_0x71e7('0x4d')],null))[_0x71e7('0x2a')](respondWithResult(_0x2c9310,null))[_0x71e7('0x47')](handleError(_0x2c9310,null));};exports[_0x71e7('0x29')]=function(_0x42b856,_0x27ecca){return db['DeskAccount'][_0x71e7('0x4b')]({'where':{'id':_0x42b856['params']['id']}})[_0x71e7('0x2a')](handleEntityNotFound(_0x27ecca,null))[_0x71e7('0x2a')](removeEntity(_0x27ecca,null))[_0x71e7('0x47')](handleError(_0x27ecca,null));};exports[_0x71e7('0x4e')]=function(_0x5bd4af,_0x1258e6,_0x312dc8){var _0x583611={};var _0x8c9b98={};var _0x1227b5;var _0x106721;return db['DeskAccount'][_0x71e7('0x4f')]({'where':{'id':_0x5bd4af[_0x71e7('0x49')]['id']}})['then'](handleEntityNotFound(_0x1258e6,null))[_0x71e7('0x2a')](function(_0x2fc0a7){if(_0x2fc0a7){_0x1227b5=_0x2fc0a7;_0x8c9b98[_0x71e7('0x33')]=_['keys'](db['DeskConfiguration'][_0x71e7('0x30')]);_0x8c9b98[_0x71e7('0x35')]=_[_0x71e7('0x36')](_0x5bd4af[_0x71e7('0x35')]);_0x8c9b98[_0x71e7('0x37')]=_[_0x71e7('0x39')](_0x8c9b98[_0x71e7('0x33')],_0x8c9b98[_0x71e7('0x35')]);_0x583611[_0x71e7('0x38')]=_[_0x71e7('0x39')](_0x8c9b98[_0x71e7('0x33')],qs['fields'](_0x5bd4af[_0x71e7('0x35')][_0x71e7('0x3a')]));_0x583611[_0x71e7('0x38')]=_0x583611[_0x71e7('0x38')]['length']?_0x583611['attributes']:_0x8c9b98[_0x71e7('0x33')];_0x583611[_0x71e7('0x3d')]=qs[_0x71e7('0x3e')](_0x5bd4af[_0x71e7('0x35')][_0x71e7('0x3e')]);_0x583611[_0x71e7('0x3f')]=qs[_0x71e7('0x37')](_[_0x71e7('0x40')](_0x5bd4af[_0x71e7('0x35')],_0x8c9b98['filters']));if(_0x5bd4af[_0x71e7('0x35')]['filter']){_0x583611[_0x71e7('0x3f')]=_[_0x71e7('0x41')](_0x583611[_0x71e7('0x3f')],{'$or':_[_0x71e7('0x2e')](_0x583611[_0x71e7('0x38')],function(_0x205352){var _0x2b47ca={};_0x2b47ca[_0x205352]={'$like':'%'+_0x5bd4af[_0x71e7('0x35')][_0x71e7('0x42')]+'%'};return _0x2b47ca;})});}_0x583611=_['merge']({},_0x583611,_0x5bd4af[_0x71e7('0x43')]);return _0x1227b5[_0x71e7('0x4e')](_0x583611);}})[_0x71e7('0x2a')](function(_0x29c87b){if(_0x29c87b){_0x106721=_0x29c87b[_0x71e7('0x4a')];if(!_0x5bd4af[_0x71e7('0x35')][_0x71e7('0x3b')](_0x71e7('0x3c'))){_0x583611['limit']=qs[_0x71e7('0x22')](_0x5bd4af[_0x71e7('0x35')][_0x71e7('0x22')]);_0x583611['offset']=qs[_0x71e7('0x20')](_0x5bd4af[_0x71e7('0x35')][_0x71e7('0x20')]);}return _0x1227b5[_0x71e7('0x4e')](_0x583611);}})[_0x71e7('0x2a')](function(_0x13b7af){if(_0x13b7af){return _0x13b7af?{'count':_0x106721,'rows':_0x13b7af}:null;}})[_0x71e7('0x2a')](respondWithResult(_0x1258e6,null))[_0x71e7('0x47')](handleError(_0x1258e6,null));};exports[_0x71e7('0x50')]=function(_0xcc0f30,_0xc1605,_0x12afc0){if(_0xcc0f30['body']['id']){delete _0xcc0f30[_0x71e7('0x4d')]['id'];}return db[_0x71e7('0x2f')]['findOne']({'where':{'id':_0xcc0f30[_0x71e7('0x49')]['id']}})[_0x71e7('0x2a')](handleEntityNotFound(_0xc1605,null))[_0x71e7('0x2a')](function(_0x2ae3cf){if(_0x2ae3cf){_0xcc0f30['body']['AccountId']=_0x2ae3cf['id'];_0xcc0f30['body']['Subjects']=integrations[_0x71e7('0x51')](_0xcc0f30[_0x71e7('0x4d')]['channel'],_0xcc0f30[_0x71e7('0x4d')][_0x71e7('0x31')]);_0xcc0f30[_0x71e7('0x4d')]['Descriptions']=integrations['getDescriptions'](_0xcc0f30[_0x71e7('0x4d')][_0x71e7('0x52')],_0xcc0f30['body']['type']);return db['DeskConfiguration']['create'](_0xcc0f30[_0x71e7('0x4d')],{'include':[{'model':db[_0x71e7('0x53')],'as':_0x71e7('0x54')},{'model':db[_0x71e7('0x53')],'as':_0x71e7('0x55')}]});}return null;})[_0x71e7('0x2a')](respondWithResult(_0xc1605,null))[_0x71e7('0x47')](handleError(_0xc1605,null));};exports['getFields']=function(_0x4c1645,_0x461714,_0x2199a2){var _0x1ea779=[{'name':_0x71e7('0x56'),'label':_0x71e7('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x33dfbb='';return db[_0x71e7('0x2f')][_0x71e7('0x4f')]({'where':{'id':_0x4c1645[_0x71e7('0x49')]['id']},'attributes':['id','remoteUri',_0x71e7('0x57'),_0x71e7('0x58'),'password',_0x71e7('0x59'),_0x71e7('0x5a'),_0x71e7('0x5b'),'tokenSecret']})[_0x71e7('0x2a')](handleEntityNotFound(_0x461714,null))[_0x71e7('0x2a')](function(_0x5c9a20){if(_0x5c9a20){_0x33dfbb=_0x5c9a20['remoteUri'];var _0xc589ea=_0x33dfbb[_0x71e7('0x5c')](-0x1);if(_0xc589ea==='/'){_0x33dfbb=_0x33dfbb[_0x71e7('0x5d')](0x0,_0x33dfbb[_0x71e7('0x5e')](_0xc589ea));}var _0x24781f={'method':'GET','uri':util[_0x71e7('0x5f')](_0x71e7('0x60'),_0x33dfbb),'headers':{'Content-Type':'application/json','Accept':_0x71e7('0x61')},'json':!![]};if(_0x5c9a20['authType']===_0x71e7('0x62')){_0x24781f['headers'][_0x71e7('0x63')]=util[_0x71e7('0x5f')](_0x71e7('0x64'),new Buffer(util['format'](_0x71e7('0x65'),_0x5c9a20[_0x71e7('0x58')],_0x5c9a20[_0x71e7('0x66')]))[_0x71e7('0x67')]('base64'));}return rp(_0x24781f)[_0x71e7('0x2a')](function(_0x5a70cc){return _0x1ea779['concat'](_['map'](_0x5a70cc['_embedded'][_0x71e7('0x68')],function(_0x46b566){return{'id':_0x46b566[_0x71e7('0x34')],'name':_0x46b566[_0x71e7('0x34')],'type':_0x46b566[_0x71e7('0x31')],'active':_0x46b566[_0x71e7('0x69')],'label':_0x46b566[_0x71e7('0x6a')],'custom':!![]};}));});}})['then'](function(_0x5985db){return{'count':_0x5985db['length'],'rows':_0x5985db};})[_0x71e7('0x2a')](respondWithResult(_0x461714,null))[_0x71e7('0x47')](function(_0x3c8508){var _0x5151ee=_0x4c1645['query']['test']?0x1f4:_0x3c8508['statusCode']||0x1f4;logger[_0x71e7('0x2b')](_0x71e7('0x6b'),_0x71e7('0x6c'),_0x5151ee,JSON[_0x71e7('0x6d')](_0x3c8508));delete _0x3c8508[_0x71e7('0x34')];if(_0x5151ee===0x191){_0x5151ee=0x190;}_0x461714[_0x71e7('0x1e')](_0x5151ee)[_0x71e7('0x2d')](_0x4c1645[_0x71e7('0x35')][_0x71e7('0x6e')]?{'message':_0x71e7('0x6f'),'statusCode':_0x3c8508[_0x71e7('0x70')]}:_0x3c8508);});};
\ No newline at end of file
index d5c4930..688fa9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x698f=['api','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x698f,0x141));var _0xf698=function(_0x126687,_0x1903dc){_0x126687=_0x126687-0x0;var _0x1c683d=_0x698f[_0x126687];return _0x1c683d;};'use strict';var _=require(_0xf698('0x0'));var util=require(_0xf698('0x1'));var logger=require(_0xf698('0x2'))(_0xf698('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf698('0x4'));var fs=require('fs');var path=require(_0xf698('0x5'));var rimraf=require(_0xf698('0x6'));var config=require(_0xf698('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xf698('0x8'));module[_0xf698('0x9')]=function(_0x33b4aa,_0x527525){return _0x33b4aa['define'](_0xf698('0xa'),attributes,{'tableName':_0xf698('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x60d9=['path','rimraf','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x396795,_0xaa9d18){var _0x2f8e87=function(_0x178850){while(--_0x178850){_0x396795['push'](_0x396795['shift']());}};_0x2f8e87(++_0xaa9d18);}(_0x60d9,0x6f));var _0x960d=function(_0xc495,_0x33d8da){_0xc495=_0xc495-0x0;var _0xd10a11=_0x60d9[_0xc495];return _0xd10a11;};'use strict';var _=require(_0x960d('0x0'));var util=require(_0x960d('0x1'));var logger=require(_0x960d('0x2'))(_0x960d('0x3'));var moment=require(_0x960d('0x4'));var BPromise=require('bluebird');var rp=require(_0x960d('0x5'));var fs=require('fs');var path=require(_0x960d('0x6'));var rimraf=require(_0x960d('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x960d('0x8'));module[_0x960d('0x9')]=function(_0x969c4a,_0x4887f6){return _0x969c4a[_0x960d('0xa')](_0x960d('0xb'),attributes,{'tableName':_0x960d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 191e8da..bf4ef37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ea=['where','attributes','limit','include','model','map','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','DeskAccount,\x20%s,\x20%s','result','catch','DeskAccount','options','raw'];(function(_0x38b4ee,_0x210b6b){var _0x2dae07=function(_0x478ad3){while(--_0x478ad3){_0x38b4ee['push'](_0x38b4ee['shift']());}};_0x2dae07(++_0x210b6b);}(_0x80ea,0x1dd));var _0xa80e=function(_0xb3dc7c,_0x429438){_0xb3dc7c=_0xb3dc7c-0x0;var _0x347502=_0x80ea[_0xb3dc7c];return _0x347502;};'use strict';var _=require(_0xa80e('0x0'));var util=require(_0xa80e('0x1'));var moment=require(_0xa80e('0x2'));var BPromise=require(_0xa80e('0x3'));var rs=require(_0xa80e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa80e('0x5'));var logger=require(_0xa80e('0x6'))(_0xa80e('0x7'));var config=require(_0xa80e('0x8'));var jayson=require(_0xa80e('0x9'));var client=jayson[_0xa80e('0xa')][_0xa80e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c7797,_0x320a42,_0x522b23){return new BPromise(function(_0x1bfd7b,_0x2c0d4c){return client[_0xa80e('0xc')](_0x5c7797,_0x522b23)[_0xa80e('0xd')](function(_0x2be7c1){logger[_0xa80e('0xe')]('DeskAccount,\x20%s,\x20%s',_0x320a42,'request\x20sent');logger[_0xa80e('0xf')](_0xa80e('0x10'),_0x320a42,_0xa80e('0x11'),JSON[_0xa80e('0x12')](_0x2be7c1));if(_0x2be7c1[_0xa80e('0x13')]){if(_0x2be7c1['error']['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x320a42,_0x2be7c1[_0xa80e('0x13')][_0xa80e('0x14')]);return _0x2c0d4c(_0x2be7c1[_0xa80e('0x13')][_0xa80e('0x14')]);}logger[_0xa80e('0x13')](_0xa80e('0x15'),_0x320a42,_0x2be7c1[_0xa80e('0x13')][_0xa80e('0x14')]);return _0x1bfd7b(_0x2be7c1[_0xa80e('0x13')]['message']);}else{logger[_0xa80e('0xe')]('DeskAccount,\x20%s,\x20%s',_0x320a42,_0xa80e('0x11'));_0x1bfd7b(_0x2be7c1[_0xa80e('0x16')]['message']);}})[_0xa80e('0x17')](function(_0x338555){logger['error']('DeskAccount,\x20%s,\x20%s',_0x320a42,_0x338555);_0x2c0d4c(_0x338555);});});}exports['GetDeskAccount']=function(_0x4a0a83){var _0x153a03=this;return new Promise(function(_0x268889,_0x264a86){return db[_0xa80e('0x18')]['findAll']({'raw':_0x4a0a83[_0xa80e('0x19')]?_0x4a0a83[_0xa80e('0x19')][_0xa80e('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a0a83['options']?_0x4a0a83['options'][_0xa80e('0x1b')]||null:null,'attributes':_0x4a0a83[_0xa80e('0x19')]?_0x4a0a83['options'][_0xa80e('0x1c')]||null:null,'limit':_0x4a0a83['options']?_0x4a0a83[_0xa80e('0x19')][_0xa80e('0x1d')]||null:null,'include':_0x4a0a83[_0xa80e('0x19')]?_0x4a0a83[_0xa80e('0x19')]['include']?_['map'](_0x4a0a83[_0xa80e('0x19')][_0xa80e('0x1e')],function(_0x2cc1f4){return{'model':db[_0x2cc1f4[_0xa80e('0x1f')]],'as':_0x2cc1f4['as'],'attributes':_0x2cc1f4['attributes'],'include':_0x2cc1f4[_0xa80e('0x1e')]?_[_0xa80e('0x20')](_0x2cc1f4[_0xa80e('0x1e')],function(_0x21a51d){return{'model':db[_0x21a51d['model']],'as':_0x21a51d['as'],'attributes':_0x21a51d[_0xa80e('0x1c')],'include':_0x21a51d['include']?_['map'](_0x21a51d[_0xa80e('0x1e')],function(_0x41a87a){return{'model':db[_0x41a87a[_0xa80e('0x1f')]],'as':_0x41a87a['as'],'attributes':_0x41a87a[_0xa80e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa80e('0xd')](function(_0x50bb2b){logger[_0xa80e('0xe')](_0xa80e('0x21'),_0x4a0a83);logger[_0xa80e('0xf')](_0xa80e('0x21'),_0x4a0a83,JSON[_0xa80e('0x12')](_0x50bb2b));_0x268889(_0x50bb2b);})[_0xa80e('0x17')](function(_0x166b9c){logger[_0xa80e('0x13')](_0xa80e('0x21'),_0x166b9c[_0xa80e('0x14')],_0x4a0a83);_0x264a86(_0x153a03[_0xa80e('0x13')](0x1f4,_0x166b9c[_0xa80e('0x14')]));});});};exports[_0xa80e('0x22')]=function(_0x5250b9){var _0xb2dfdf=this;return new Promise(function(_0x55c06f,_0x1dfb81){return db[_0xa80e('0x18')][_0xa80e('0x23')]({'raw':_0x5250b9[_0xa80e('0x19')]?_0x5250b9[_0xa80e('0x19')][_0xa80e('0x1a')]===undefined?!![]:![]:!![],'where':_0x5250b9[_0xa80e('0x19')]?_0x5250b9[_0xa80e('0x19')]['where']||null:null,'attributes':_0x5250b9[_0xa80e('0x19')]?_0x5250b9[_0xa80e('0x19')][_0xa80e('0x1c')]||null:null,'include':_0x5250b9[_0xa80e('0x19')]?_0x5250b9['options']['include']?_[_0xa80e('0x20')](_0x5250b9['options'][_0xa80e('0x1e')],function(_0x3707eb){return{'model':db[_0x3707eb['model']],'as':_0x3707eb['as'],'attributes':_0x3707eb[_0xa80e('0x1c')],'include':_0x3707eb['include']?_[_0xa80e('0x20')](_0x3707eb['include'],function(_0x7002d){return{'model':db[_0x7002d[_0xa80e('0x1f')]],'as':_0x7002d['as'],'attributes':_0x7002d[_0xa80e('0x1c')],'include':_0x7002d[_0xa80e('0x1e')]?_['map'](_0x7002d[_0xa80e('0x1e')],function(_0x5b8d8a){return{'model':db[_0x5b8d8a['model']],'as':_0x5b8d8a['as'],'attributes':_0x5b8d8a[_0xa80e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa80e('0xd')](function(_0x571314){logger['info'](_0xa80e('0x22'),_0x5250b9);logger[_0xa80e('0xf')](_0xa80e('0x22'),_0x5250b9,JSON[_0xa80e('0x12')](_0x571314));_0x55c06f(_0x571314);})[_0xa80e('0x17')](function(_0x38c9c1){logger[_0xa80e('0x13')](_0xa80e('0x22'),_0x38c9c1[_0xa80e('0x14')],_0x5250b9);_0x1dfb81(_0xb2dfdf['error'](0x1f4,_0x38c9c1[_0xa80e('0x14')]));});});};
\ No newline at end of file
+var _0xbce2=['map','model','attributes','ShowDeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','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','where','limit','include'];(function(_0x47e815,_0x347f27){var _0x595994=function(_0x2c7e4b){while(--_0x2c7e4b){_0x47e815['push'](_0x47e815['shift']());}};_0x595994(++_0x347f27);}(_0xbce2,0xf0));var _0x2bce=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xbce2[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x2bce('0x0'));var util=require(_0x2bce('0x1'));var moment=require(_0x2bce('0x2'));var BPromise=require(_0x2bce('0x3'));var rs=require(_0x2bce('0x4'));var fs=require('fs');var Redis=require(_0x2bce('0x5'));var db=require(_0x2bce('0x6'))['db'];var utils=require(_0x2bce('0x7'));var logger=require(_0x2bce('0x8'))(_0x2bce('0x9'));var config=require('../../config/environment');var jayson=require(_0x2bce('0xa'));var client=jayson[_0x2bce('0xb')][_0x2bce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24bf31,_0x5a7900,_0x4f4bfd){return new BPromise(function(_0x2f9a3b,_0x465375){return client[_0x2bce('0xd')](_0x24bf31,_0x4f4bfd)[_0x2bce('0xe')](function(_0x575ccd){logger[_0x2bce('0xf')](_0x2bce('0x10'),_0x5a7900,_0x2bce('0x11'));logger[_0x2bce('0x12')](_0x2bce('0x13'),_0x5a7900,'request\x20sent',JSON[_0x2bce('0x14')](_0x575ccd));if(_0x575ccd[_0x2bce('0x15')]){if(_0x575ccd[_0x2bce('0x15')][_0x2bce('0x16')]===0x1f4){logger[_0x2bce('0x15')](_0x2bce('0x10'),_0x5a7900,_0x575ccd[_0x2bce('0x15')][_0x2bce('0x17')]);return _0x465375(_0x575ccd[_0x2bce('0x15')][_0x2bce('0x17')]);}logger[_0x2bce('0x15')](_0x2bce('0x10'),_0x5a7900,_0x575ccd[_0x2bce('0x15')]['message']);return _0x2f9a3b(_0x575ccd['error'][_0x2bce('0x17')]);}else{logger[_0x2bce('0xf')](_0x2bce('0x10'),_0x5a7900,_0x2bce('0x11'));_0x2f9a3b(_0x575ccd[_0x2bce('0x18')][_0x2bce('0x17')]);}})[_0x2bce('0x19')](function(_0x1ec44b){logger['error'](_0x2bce('0x10'),_0x5a7900,_0x1ec44b);_0x465375(_0x1ec44b);});});}exports[_0x2bce('0x1a')]=function(_0x4a761d){var _0x330ee7=this;return new Promise(function(_0x39dbfd,_0x1aa106){return db[_0x2bce('0x1b')][_0x2bce('0x1c')]({'raw':_0x4a761d[_0x2bce('0x1d')]?_0x4a761d[_0x2bce('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4a761d[_0x2bce('0x1d')]?_0x4a761d[_0x2bce('0x1d')][_0x2bce('0x1e')]||null:null,'attributes':_0x4a761d['options']?_0x4a761d[_0x2bce('0x1d')]['attributes']||null:null,'limit':_0x4a761d[_0x2bce('0x1d')]?_0x4a761d[_0x2bce('0x1d')][_0x2bce('0x1f')]||null:null,'include':_0x4a761d[_0x2bce('0x1d')]?_0x4a761d[_0x2bce('0x1d')][_0x2bce('0x20')]?_[_0x2bce('0x21')](_0x4a761d['options']['include'],function(_0x4030d5){return{'model':db[_0x4030d5[_0x2bce('0x22')]],'as':_0x4030d5['as'],'attributes':_0x4030d5[_0x2bce('0x23')],'include':_0x4030d5['include']?_[_0x2bce('0x21')](_0x4030d5['include'],function(_0x148513){return{'model':db[_0x148513[_0x2bce('0x22')]],'as':_0x148513['as'],'attributes':_0x148513[_0x2bce('0x23')],'include':_0x148513['include']?_[_0x2bce('0x21')](_0x148513[_0x2bce('0x20')],function(_0x3e7f22){return{'model':db[_0x3e7f22[_0x2bce('0x22')]],'as':_0x3e7f22['as'],'attributes':_0x3e7f22['attributes']};}):[]};}):[]};}):[]:[]})[_0x2bce('0xe')](function(_0x359337){logger[_0x2bce('0xf')]('GetDeskAccount',_0x4a761d);logger['debug'](_0x2bce('0x1a'),_0x4a761d,JSON[_0x2bce('0x14')](_0x359337));_0x39dbfd(_0x359337);})[_0x2bce('0x19')](function(_0x196451){logger[_0x2bce('0x15')](_0x2bce('0x1a'),_0x196451[_0x2bce('0x17')],_0x4a761d);_0x1aa106(_0x330ee7[_0x2bce('0x15')](0x1f4,_0x196451[_0x2bce('0x17')]));});});};exports[_0x2bce('0x24')]=function(_0x4184b8){var _0x2515d2=this;return new Promise(function(_0xbc1d48,_0x124260){return db['DeskAccount'][_0x2bce('0x25')]({'raw':_0x4184b8[_0x2bce('0x1d')]?_0x4184b8[_0x2bce('0x1d')][_0x2bce('0x26')]===undefined?!![]:![]:!![],'where':_0x4184b8[_0x2bce('0x1d')]?_0x4184b8[_0x2bce('0x1d')][_0x2bce('0x1e')]||null:null,'attributes':_0x4184b8[_0x2bce('0x1d')]?_0x4184b8[_0x2bce('0x1d')][_0x2bce('0x23')]||null:null,'include':_0x4184b8['options']?_0x4184b8[_0x2bce('0x1d')][_0x2bce('0x20')]?_[_0x2bce('0x21')](_0x4184b8[_0x2bce('0x1d')][_0x2bce('0x20')],function(_0x237c79){return{'model':db[_0x237c79[_0x2bce('0x22')]],'as':_0x237c79['as'],'attributes':_0x237c79[_0x2bce('0x23')],'include':_0x237c79[_0x2bce('0x20')]?_[_0x2bce('0x21')](_0x237c79[_0x2bce('0x20')],function(_0x432721){return{'model':db[_0x432721[_0x2bce('0x22')]],'as':_0x432721['as'],'attributes':_0x432721[_0x2bce('0x23')],'include':_0x432721[_0x2bce('0x20')]?_[_0x2bce('0x21')](_0x432721[_0x2bce('0x20')],function(_0x2a5c30){return{'model':db[_0x2a5c30[_0x2bce('0x22')]],'as':_0x2a5c30['as'],'attributes':_0x2a5c30['attributes']};}):[]};}):[]};}):[]:[]})[_0x2bce('0xe')](function(_0xa140){logger[_0x2bce('0xf')](_0x2bce('0x24'),_0x4184b8);logger[_0x2bce('0x12')](_0x2bce('0x24'),_0x4184b8,JSON['stringify'](_0xa140));_0xbc1d48(_0xa140);})[_0x2bce('0x19')](function(_0x88c9c1){logger[_0x2bce('0x15')](_0x2bce('0x24'),_0x88c9c1['message'],_0x4184b8);_0x124260(_0x2515d2[_0x2bce('0x15')](0x1f4,_0x88c9c1[_0x2bce('0x17')]));});});};
\ No newline at end of file
index c972574..23f83b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5432f8,_0x25059e){var _0x44ee66=function(_0x284a2c){while(--_0x284a2c){_0x5432f8['push'](_0x5432f8['shift']());}};_0x44ee66(++_0x25059e);}(_0x008c,0x188));var _0xc008=function(_0x4c53c3,_0x360764){_0x4c53c3=_0x4c53c3-0x0;var _0x32bf24=_0x008c[_0x4c53c3];return _0x32bf24;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router;
\ No newline at end of file
+var _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(_0x11c1a4,_0x2238b1){var _0x137ac5=function(_0x22fb55){while(--_0x22fb55){_0x11c1a4['push'](_0x11c1a4['shift']());}};_0x137ac5(++_0x2238b1);}(_0x34e8,0x12c));var _0x834e=function(_0x48533d,_0x50171a){_0x48533d=_0x48533d-0x0;var _0x475381=_0x34e8[_0x48533d];return _0x475381;};'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
index 96c9632..cbaa045 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6e5=['STRING','sequelize','exports'];(function(_0xff2bba,_0x791602){var _0x584bb5=function(_0x5bf34b){while(--_0x5bf34b){_0xff2bba['push'](_0xff2bba['shift']());}};_0x584bb5(++_0x791602);}(_0xb6e5,0x139));var _0x5b6e=function(_0x213efd,_0x38d85a){_0x213efd=_0x213efd-0x0;var _0x3a6ff2=_0xb6e5[_0x213efd];return _0x3a6ff2;};'use strict';var Sequelize=require(_0x5b6e('0x0'));module[_0x5b6e('0x1')]={'name':{'type':Sequelize[_0x5b6e('0x2')]},'description':{'type':Sequelize[_0x5b6e('0x2')]}};
\ No newline at end of file
+var _0x10cc=['sequelize','exports','STRING'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x10cc,0xc9));var _0xc10c=function(_0x29c2bb,_0x1bde54){_0x29c2bb=_0x29c2bb-0x0;var _0x5446f1=_0x10cc[_0x29c2bb];return _0x5446f1;};'use strict';var Sequelize=require(_0xc10c('0x0'));module[_0xc10c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc10c('0x2')]}};
\ No newline at end of file
index 937f62f..e99b111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['undefined','limit','count','Content-Range','apply','save','update','destroy','error','send','map','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','then','includeAll','include','DeskConfiguration','findAll','catch','show','params','find','create','body','getFields','DeskField','getSubjects','findOne','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5eb8,0x85));var _0x85eb=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x5eb8[_0x5b5cde];return _0x364ad2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x85eb('0x0'));var zipdir=require(_0x85eb('0x1'));var jsonpatch=require(_0x85eb('0x2'));var rp=require(_0x85eb('0x3'));var moment=require(_0x85eb('0x4'));var BPromise=require(_0x85eb('0x5'));var Mustache=require(_0x85eb('0x6'));var util=require(_0x85eb('0x7'));var path=require(_0x85eb('0x8'));var sox=require(_0x85eb('0x9'));var csv=require('to-csv');var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85eb('0xb'));var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x85eb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85eb('0x12'));var logger=require(_0x85eb('0x13'))('api');var utils=require(_0x85eb('0x14'));var config=require(_0x85eb('0x15'));var licenseUtil=require(_0x85eb('0x16'));var db=require(_0x85eb('0x17'))['db'];function respondWithStatusCode(_0x530d93,_0x5c04f7){_0x5c04f7=_0x5c04f7||0xcc;return function(_0x301088){if(_0x301088){return _0x530d93[_0x85eb('0x18')](_0x5c04f7);}return _0x530d93[_0x85eb('0x19')](_0x5c04f7)[_0x85eb('0x1a')]();};}function respondWithResult(_0x9540b1,_0x4f0521){_0x4f0521=_0x4f0521||0xc8;return function(_0x155e62){if(_0x155e62){return _0x9540b1[_0x85eb('0x19')](_0x4f0521)[_0x85eb('0x1b')](_0x155e62);}};}function respondWithFilteredResult(_0x50d915,_0x10cbff){return function(_0x4a3cd6){if(_0x4a3cd6){var _0x2f62a2=typeof _0x10cbff[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x10cbff[_0x85eb('0x1e')]==='undefined';var _0x22f8e5=_0x4a3cd6[_0x85eb('0x1f')];var _0x342c96=_0x2f62a2?0x0:_0x10cbff[_0x85eb('0x1c')];var _0x56adde=_0x2f62a2?_0x4a3cd6[_0x85eb('0x1f')]:_0x10cbff[_0x85eb('0x1c')]+_0x10cbff[_0x85eb('0x1e')];var _0x4756c0;if(_0x56adde>=_0x22f8e5){_0x56adde=_0x22f8e5;_0x4756c0=0xc8;}else{_0x4756c0=0xce;}_0x50d915[_0x85eb('0x19')](_0x4756c0);return _0x50d915['set'](_0x85eb('0x20'),_0x342c96+'-'+_0x56adde+'/'+_0x22f8e5)[_0x85eb('0x1b')](_0x4a3cd6);}return null;};}function patchUpdates(_0x26c29a){return function(_0x4f8fb9){try{jsonpatch[_0x85eb('0x21')](_0x4f8fb9,_0x26c29a,!![]);}catch(_0x5d1697){return BPromise['reject'](_0x5d1697);}return _0x4f8fb9[_0x85eb('0x22')]();};}function saveUpdates(_0x1cceac,_0x5db490){return function(_0x3414aa){if(_0x3414aa){return _0x3414aa[_0x85eb('0x23')](_0x1cceac)['then'](function(_0x46fb46){return _0x46fb46;});}return null;};}function removeEntity(_0x3a8cda,_0x18920b){return function(_0x57009a){if(_0x57009a){return _0x57009a[_0x85eb('0x24')]()['then'](function(){_0x3a8cda[_0x85eb('0x19')](0xcc)[_0x85eb('0x1a')]();});}};}function handleEntityNotFound(_0x4e229a,_0x4ee41f){return function(_0x3a9eaa){if(!_0x3a9eaa){_0x4e229a[_0x85eb('0x18')](0x194);}return _0x3a9eaa;};}function handleError(_0x1cb364,_0x18fd34){_0x18fd34=_0x18fd34||0x1f4;return function(_0x199e68){logger[_0x85eb('0x25')](_0x199e68['stack']);if(_0x199e68['name']){delete _0x199e68['name'];}_0x1cb364['status'](_0x18fd34)[_0x85eb('0x26')](_0x199e68);};}exports['index']=function(_0x4192ba,_0x206682){var _0x4572a5={},_0xdc42d2={},_0x185cd8={'count':0x0,'rows':[]};var _0x3f326f=_[_0x85eb('0x27')](db['DeskConfiguration'][_0x85eb('0x28')],function(_0xe3557){return{'name':_0xe3557[_0x85eb('0x29')],'type':_0xe3557[_0x85eb('0x2a')][_0x85eb('0x2b')]};});_0xdc42d2['model']=_[_0x85eb('0x27')](_0x3f326f,_0x85eb('0x2c'));_0xdc42d2[_0x85eb('0x2d')]=_[_0x85eb('0x2e')](_0x4192ba[_0x85eb('0x2d')]);_0xdc42d2['filters']=_[_0x85eb('0x2f')](_0xdc42d2[_0x85eb('0x30')],_0xdc42d2['query']);_0x4572a5['attributes']=_['intersection'](_0xdc42d2[_0x85eb('0x30')],qs[_0x85eb('0x31')](_0x4192ba['query'][_0x85eb('0x31')]));_0x4572a5[_0x85eb('0x32')]=_0x4572a5[_0x85eb('0x32')][_0x85eb('0x33')]?_0x4572a5['attributes']:_0xdc42d2[_0x85eb('0x30')];if(!_0x4192ba[_0x85eb('0x2d')][_0x85eb('0x34')](_0x85eb('0x35'))){_0x4572a5['limit']=qs[_0x85eb('0x1e')](_0x4192ba[_0x85eb('0x2d')][_0x85eb('0x1e')]);_0x4572a5['offset']=qs[_0x85eb('0x1c')](_0x4192ba[_0x85eb('0x2d')][_0x85eb('0x1c')]);}_0x4572a5[_0x85eb('0x36')]=qs['sort'](_0x4192ba[_0x85eb('0x2d')][_0x85eb('0x37')]);_0x4572a5[_0x85eb('0x38')]=qs[_0x85eb('0x39')](_[_0x85eb('0x3a')](_0x4192ba['query'],_0xdc42d2[_0x85eb('0x39')]),_0x3f326f);if(_0x4192ba['query'][_0x85eb('0x3b')]){_0x4572a5[_0x85eb('0x38')]=_[_0x85eb('0x3c')](_0x4572a5['where'],{'$or':_[_0x85eb('0x27')](_0x3f326f,function(_0x4c9671){if(_0x4c9671[_0x85eb('0x2a')]!=='VIRTUAL'){var _0x23d634={};_0x23d634[_0x4c9671[_0x85eb('0x2c')]]={'$like':'%'+_0x4192ba[_0x85eb('0x2d')][_0x85eb('0x3b')]+'%'};return _0x23d634;}})});}_0x4572a5=_[_0x85eb('0x3c')]({},_0x4572a5,_0x4192ba[_0x85eb('0x3d')]);var _0x5304f0={'where':_0x4572a5[_0x85eb('0x38')]};return db['DeskConfiguration'][_0x85eb('0x1f')](_0x5304f0)[_0x85eb('0x3e')](function(_0x3322dc){_0x185cd8[_0x85eb('0x1f')]=_0x3322dc;if(_0x4192ba[_0x85eb('0x2d')][_0x85eb('0x3f')]){_0x4572a5[_0x85eb('0x40')]=[{'all':!![]}];}return db[_0x85eb('0x41')][_0x85eb('0x42')](_0x4572a5);})['then'](function(_0x3fbe98){_0x185cd8['rows']=_0x3fbe98;return _0x185cd8;})[_0x85eb('0x3e')](respondWithFilteredResult(_0x206682,_0x4572a5))[_0x85eb('0x43')](handleError(_0x206682,null));};exports[_0x85eb('0x44')]=function(_0x4b621a,_0x414ca2){var _0x7bed7c={'raw':![],'where':{'id':_0x4b621a[_0x85eb('0x45')]['id']}},_0x39d170={};_0x39d170['model']=_['keys'](db[_0x85eb('0x41')][_0x85eb('0x28')]);_0x39d170['query']=_['keys'](_0x4b621a[_0x85eb('0x2d')]);_0x39d170[_0x85eb('0x39')]=_[_0x85eb('0x2f')](_0x39d170['model'],_0x39d170[_0x85eb('0x2d')]);_0x7bed7c[_0x85eb('0x32')]=_['intersection'](_0x39d170['model'],qs[_0x85eb('0x31')](_0x4b621a['query'][_0x85eb('0x31')]));_0x7bed7c[_0x85eb('0x32')]=_0x7bed7c[_0x85eb('0x32')][_0x85eb('0x33')]?_0x7bed7c[_0x85eb('0x32')]:_0x39d170[_0x85eb('0x30')];if(_0x4b621a['query'][_0x85eb('0x3f')]){_0x7bed7c[_0x85eb('0x40')]=[{'all':!![]}];}_0x7bed7c=_[_0x85eb('0x3c')]({},_0x7bed7c,_0x4b621a[_0x85eb('0x3d')]);return db[_0x85eb('0x41')][_0x85eb('0x46')](_0x7bed7c)[_0x85eb('0x3e')](handleEntityNotFound(_0x414ca2,null))[_0x85eb('0x3e')](respondWithResult(_0x414ca2,null))['catch'](handleError(_0x414ca2,null));};exports[_0x85eb('0x47')]=function(_0x4534fa,_0x46d469){return db[_0x85eb('0x41')][_0x85eb('0x47')](_0x4534fa[_0x85eb('0x48')],{})['then'](respondWithResult(_0x46d469,0xc9))['catch'](handleError(_0x46d469,null));};exports[_0x85eb('0x23')]=function(_0x5773ad,_0x4ef433){if(_0x5773ad[_0x85eb('0x48')]['id']){delete _0x5773ad['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x5773ad[_0x85eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ef433,null))['then'](saveUpdates(_0x5773ad[_0x85eb('0x48')],null))['then'](respondWithResult(_0x4ef433,null))[_0x85eb('0x43')](handleError(_0x4ef433,null));};exports[_0x85eb('0x24')]=function(_0x2fd3e1,_0x1e5170){return db['DeskConfiguration'][_0x85eb('0x46')]({'where':{'id':_0x2fd3e1[_0x85eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e5170,null))[_0x85eb('0x3e')](removeEntity(_0x1e5170,null))[_0x85eb('0x43')](handleError(_0x1e5170,null));};exports[_0x85eb('0x49')]=function(_0x32918a,_0x2db387,_0x434155){var _0x2e8d3b={};var _0x207c08={};var _0x3ee1a3;var _0x2432c3;return db[_0x85eb('0x41')]['findOne']({'where':{'id':_0x32918a[_0x85eb('0x45')]['id']}})[_0x85eb('0x3e')](handleEntityNotFound(_0x2db387,null))[_0x85eb('0x3e')](function(_0x3ff541){if(_0x3ff541){_0x3ee1a3=_0x3ff541;_0x207c08[_0x85eb('0x30')]=_[_0x85eb('0x2e')](db[_0x85eb('0x4a')][_0x85eb('0x28')]);_0x207c08[_0x85eb('0x2d')]=_['keys'](_0x32918a[_0x85eb('0x2d')]);_0x207c08[_0x85eb('0x39')]=_['intersection'](_0x207c08['model'],_0x207c08[_0x85eb('0x2d')]);_0x2e8d3b[_0x85eb('0x32')]=_['intersection'](_0x207c08[_0x85eb('0x30')],qs['fields'](_0x32918a[_0x85eb('0x2d')][_0x85eb('0x31')]));_0x2e8d3b['attributes']=_0x2e8d3b[_0x85eb('0x32')][_0x85eb('0x33')]?_0x2e8d3b[_0x85eb('0x32')]:_0x207c08[_0x85eb('0x30')];_0x2e8d3b[_0x85eb('0x36')]=qs[_0x85eb('0x37')](_0x32918a[_0x85eb('0x2d')][_0x85eb('0x37')]);_0x2e8d3b['where']=qs[_0x85eb('0x39')](_[_0x85eb('0x3a')](_0x32918a['query'],_0x207c08['filters']));if(_0x32918a['query'][_0x85eb('0x3b')]){_0x2e8d3b[_0x85eb('0x38')]=_[_0x85eb('0x3c')](_0x2e8d3b[_0x85eb('0x38')],{'$or':_[_0x85eb('0x27')](_0x2e8d3b[_0x85eb('0x32')],function(_0x8829e5){var _0xe8ed6a={};_0xe8ed6a[_0x8829e5]={'$like':'%'+_0x32918a[_0x85eb('0x2d')][_0x85eb('0x3b')]+'%'};return _0xe8ed6a;})});}_0x2e8d3b=_[_0x85eb('0x3c')]({},_0x2e8d3b,_0x32918a[_0x85eb('0x3d')]);return _0x3ee1a3[_0x85eb('0x49')](_0x2e8d3b);}})[_0x85eb('0x3e')](function(_0x5bbd42){if(_0x5bbd42){_0x2432c3=_0x5bbd42[_0x85eb('0x33')];if(!_0x32918a[_0x85eb('0x2d')][_0x85eb('0x34')](_0x85eb('0x35'))){_0x2e8d3b[_0x85eb('0x1e')]=qs['limit'](_0x32918a['query'][_0x85eb('0x1e')]);_0x2e8d3b[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x32918a[_0x85eb('0x2d')][_0x85eb('0x1c')]);}return _0x3ee1a3[_0x85eb('0x49')](_0x2e8d3b);}})['then'](function(_0x53f17e){if(_0x53f17e){return _0x53f17e?{'count':_0x2432c3,'rows':_0x53f17e}:null;}})[_0x85eb('0x3e')](respondWithResult(_0x2db387,null))['catch'](handleError(_0x2db387,null));};exports[_0x85eb('0x4b')]=function(_0x166055,_0x361af2,_0x392fc7){var _0x5ce588={};var _0x54ed1a={};var _0x20fe7e;var _0x1d53d4;return db[_0x85eb('0x41')][_0x85eb('0x4c')]({'where':{'id':_0x166055['params']['id']}})['then'](handleEntityNotFound(_0x361af2,null))['then'](function(_0x2f48c6){if(_0x2f48c6){_0x20fe7e=_0x2f48c6;_0x54ed1a[_0x85eb('0x30')]=_[_0x85eb('0x2e')](db[_0x85eb('0x4a')]['rawAttributes']);_0x54ed1a['query']=_[_0x85eb('0x2e')](_0x166055[_0x85eb('0x2d')]);_0x54ed1a['filters']=_[_0x85eb('0x2f')](_0x54ed1a[_0x85eb('0x30')],_0x54ed1a[_0x85eb('0x2d')]);_0x5ce588['attributes']=_['intersection'](_0x54ed1a[_0x85eb('0x30')],qs[_0x85eb('0x31')](_0x166055[_0x85eb('0x2d')]['fields']));_0x5ce588[_0x85eb('0x32')]=_0x5ce588['attributes'][_0x85eb('0x33')]?_0x5ce588[_0x85eb('0x32')]:_0x54ed1a[_0x85eb('0x30')];_0x5ce588[_0x85eb('0x36')]=qs[_0x85eb('0x37')](_0x166055['query']['sort']);_0x5ce588[_0x85eb('0x38')]=qs[_0x85eb('0x39')](_[_0x85eb('0x3a')](_0x166055[_0x85eb('0x2d')],_0x54ed1a['filters']));if(_0x166055[_0x85eb('0x2d')][_0x85eb('0x3b')]){_0x5ce588['where']=_[_0x85eb('0x3c')](_0x5ce588['where'],{'$or':_[_0x85eb('0x27')](_0x5ce588['attributes'],function(_0x5c100c){var _0x2d8b2b={};_0x2d8b2b[_0x5c100c]={'$like':'%'+_0x166055[_0x85eb('0x2d')][_0x85eb('0x3b')]+'%'};return _0x2d8b2b;})});}_0x5ce588=_[_0x85eb('0x3c')]({},_0x5ce588,_0x166055[_0x85eb('0x3d')]);return _0x20fe7e[_0x85eb('0x4b')](_0x5ce588);}})[_0x85eb('0x3e')](function(_0x4224db){if(_0x4224db){_0x1d53d4=_0x4224db[_0x85eb('0x33')];if(!_0x166055[_0x85eb('0x2d')][_0x85eb('0x34')]('nolimit')){_0x5ce588[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x166055['query'][_0x85eb('0x1e')]);_0x5ce588[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x166055[_0x85eb('0x2d')][_0x85eb('0x1c')]);}return _0x20fe7e[_0x85eb('0x4b')](_0x5ce588);}})[_0x85eb('0x3e')](function(_0x35e30f){if(_0x35e30f){return _0x35e30f?{'count':_0x1d53d4,'rows':_0x35e30f}:null;}})[_0x85eb('0x3e')](respondWithResult(_0x361af2,null))[_0x85eb('0x43')](handleError(_0x361af2,null));};exports[_0x85eb('0x4d')]=function(_0x1a0057,_0x1696d1,_0x59563b){var _0x548bbf={};var _0x5dc125={};var _0xe8433a;var _0xbf6548;return db['DeskConfiguration'][_0x85eb('0x4c')]({'where':{'id':_0x1a0057['params']['id']}})['then'](handleEntityNotFound(_0x1696d1,null))[_0x85eb('0x3e')](function(_0x47a293){if(_0x47a293){_0xe8433a=_0x47a293;_0x5dc125[_0x85eb('0x30')]=_[_0x85eb('0x2e')](db[_0x85eb('0x4a')][_0x85eb('0x28')]);_0x5dc125[_0x85eb('0x2d')]=_[_0x85eb('0x2e')](_0x1a0057[_0x85eb('0x2d')]);_0x5dc125[_0x85eb('0x39')]=_[_0x85eb('0x2f')](_0x5dc125[_0x85eb('0x30')],_0x5dc125[_0x85eb('0x2d')]);_0x548bbf[_0x85eb('0x32')]=_[_0x85eb('0x2f')](_0x5dc125[_0x85eb('0x30')],qs[_0x85eb('0x31')](_0x1a0057[_0x85eb('0x2d')]['fields']));_0x548bbf[_0x85eb('0x32')]=_0x548bbf[_0x85eb('0x32')][_0x85eb('0x33')]?_0x548bbf[_0x85eb('0x32')]:_0x5dc125['model'];_0x548bbf['order']=qs[_0x85eb('0x37')](_0x1a0057[_0x85eb('0x2d')]['sort']);_0x548bbf[_0x85eb('0x38')]=qs[_0x85eb('0x39')](_[_0x85eb('0x3a')](_0x1a0057[_0x85eb('0x2d')],_0x5dc125['filters']));if(_0x1a0057[_0x85eb('0x2d')][_0x85eb('0x3b')]){_0x548bbf[_0x85eb('0x38')]=_[_0x85eb('0x3c')](_0x548bbf[_0x85eb('0x38')],{'$or':_[_0x85eb('0x27')](_0x548bbf[_0x85eb('0x32')],function(_0x11c0f6){var _0x1c3f4f={};_0x1c3f4f[_0x11c0f6]={'$like':'%'+_0x1a0057['query'][_0x85eb('0x3b')]+'%'};return _0x1c3f4f;})});}_0x548bbf=_[_0x85eb('0x3c')]({},_0x548bbf,_0x1a0057[_0x85eb('0x3d')]);return _0xe8433a[_0x85eb('0x4d')](_0x548bbf);}})[_0x85eb('0x3e')](function(_0x138761){if(_0x138761){_0xbf6548=_0x138761[_0x85eb('0x33')];if(!_0x1a0057[_0x85eb('0x2d')][_0x85eb('0x34')](_0x85eb('0x35'))){_0x548bbf['limit']=qs[_0x85eb('0x1e')](_0x1a0057['query'][_0x85eb('0x1e')]);_0x548bbf[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x1a0057[_0x85eb('0x2d')][_0x85eb('0x1c')]);}return _0xe8433a[_0x85eb('0x4d')](_0x548bbf);}})['then'](function(_0x46a551){if(_0x46a551){return _0x46a551?{'count':_0xbf6548,'rows':_0x46a551}:null;}})['then'](respondWithResult(_0x1696d1,null))['catch'](handleError(_0x1696d1,null));};exports[_0x85eb('0x4e')]=function(_0x581660,_0x430fea,_0x43346e){var _0x4d3ae5={};var _0x56d070={};var _0x2a4126;var _0x52f5d3;return db[_0x85eb('0x41')][_0x85eb('0x4c')]({'where':{'id':_0x581660[_0x85eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x430fea,null))[_0x85eb('0x3e')](function(_0x398082){if(_0x398082){_0x2a4126=_0x398082;_0x56d070[_0x85eb('0x30')]=_[_0x85eb('0x2e')](db['Tag'][_0x85eb('0x28')]);_0x56d070[_0x85eb('0x2d')]=_[_0x85eb('0x2e')](_0x581660[_0x85eb('0x2d')]);_0x56d070['filters']=_[_0x85eb('0x2f')](_0x56d070[_0x85eb('0x30')],_0x56d070['query']);_0x4d3ae5[_0x85eb('0x32')]=_[_0x85eb('0x2f')](_0x56d070[_0x85eb('0x30')],qs[_0x85eb('0x31')](_0x581660[_0x85eb('0x2d')][_0x85eb('0x31')]));_0x4d3ae5['attributes']=_0x4d3ae5[_0x85eb('0x32')][_0x85eb('0x33')]?_0x4d3ae5[_0x85eb('0x32')]:_0x56d070[_0x85eb('0x30')];_0x4d3ae5['order']=qs[_0x85eb('0x37')](_0x581660['query'][_0x85eb('0x37')]);_0x4d3ae5[_0x85eb('0x38')]=qs[_0x85eb('0x39')](_[_0x85eb('0x3a')](_0x581660[_0x85eb('0x2d')],_0x56d070[_0x85eb('0x39')]));if(_0x581660[_0x85eb('0x2d')][_0x85eb('0x3b')]){_0x4d3ae5[_0x85eb('0x38')]=_[_0x85eb('0x3c')](_0x4d3ae5[_0x85eb('0x38')],{'$or':_[_0x85eb('0x27')](_0x4d3ae5[_0x85eb('0x32')],function(_0x42204f){var _0x3b038f={};_0x3b038f[_0x42204f]={'$like':'%'+_0x581660['query'][_0x85eb('0x3b')]+'%'};return _0x3b038f;})});}_0x4d3ae5=_[_0x85eb('0x3c')]({},_0x4d3ae5,_0x581660[_0x85eb('0x3d')]);return _0x2a4126['getTags'](_0x4d3ae5);}})[_0x85eb('0x3e')](function(_0xf9fa82){if(_0xf9fa82){_0x52f5d3=_0xf9fa82[_0x85eb('0x33')];if(!_0x581660[_0x85eb('0x2d')][_0x85eb('0x34')](_0x85eb('0x35'))){_0x4d3ae5['limit']=qs[_0x85eb('0x1e')](_0x581660[_0x85eb('0x2d')]['limit']);_0x4d3ae5[_0x85eb('0x1c')]=qs['offset'](_0x581660[_0x85eb('0x2d')][_0x85eb('0x1c')]);}return _0x2a4126['getTags'](_0x4d3ae5);}})[_0x85eb('0x3e')](function(_0x5687e9){if(_0x5687e9){return _0x5687e9?{'count':_0x52f5d3,'rows':_0x5687e9}:null;}})['then'](respondWithResult(_0x430fea,null))[_0x85eb('0x43')](handleError(_0x430fea,null));};exports['setTags']=function(_0x12d6e3,_0x38b5e0,_0x13d68d){if(_0x12d6e3[_0x85eb('0x48')]['id']){delete _0x12d6e3['body']['id'];}return db[_0x85eb('0x41')]['findOne']({'where':{'id':_0x12d6e3[_0x85eb('0x45')]['id']}})[_0x85eb('0x3e')](handleEntityNotFound(_0x38b5e0,null))['then'](function(_0x1babda){if(_0x1babda){return _0x1babda[_0x85eb('0x4f')](_0x12d6e3[_0x85eb('0x48')][_0x85eb('0x50')]||[]);}return null;})['then'](respondWithResult(_0x38b5e0,null))[_0x85eb('0x43')](handleError(_0x38b5e0,null));};
\ No newline at end of file
+var _0x49eb=['sox','to-csv','fs-extra','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','params','getFields','DeskField','hasOwnProperty','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','mustache','util','path'];(function(_0x2856af,_0xc60fec){var _0x4f153e=function(_0x53e896){while(--_0x53e896){_0x2856af['push'](_0x2856af['shift']());}};_0x4f153e(++_0xc60fec);}(_0x49eb,0x9a));var _0xb49e=function(_0x1d9922,_0x5c6f6f){_0x1d9922=_0x1d9922-0x0;var _0x164afb=_0x49eb[_0x1d9922];return _0x164afb;};'use strict';var emlformat=require(_0xb49e('0x0'));var rimraf=require(_0xb49e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb49e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb49e('0x3'));var util=require(_0xb49e('0x4'));var path=require(_0xb49e('0x5'));var sox=require(_0xb49e('0x6'));var csv=require(_0xb49e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb49e('0x8'));var _=require('lodash');var squel=require(_0xb49e('0x9'));var crypto=require(_0xb49e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb49e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb49e('0xb'));var qs=require(_0xb49e('0xc'));var as=require(_0xb49e('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb49e('0xe'));var utils=require(_0xb49e('0xf'));var config=require(_0xb49e('0x10'));var licenseUtil=require(_0xb49e('0x11'));var db=require(_0xb49e('0x12'))['db'];function respondWithStatusCode(_0x254ce9,_0x244c96){_0x244c96=_0x244c96||0xcc;return function(_0x6a47cb){if(_0x6a47cb){return _0x254ce9[_0xb49e('0x13')](_0x244c96);}return _0x254ce9['status'](_0x244c96)[_0xb49e('0x14')]();};}function respondWithResult(_0x735981,_0x41163b){_0x41163b=_0x41163b||0xc8;return function(_0x553198){if(_0x553198){return _0x735981[_0xb49e('0x15')](_0x41163b)['json'](_0x553198);}};}function respondWithFilteredResult(_0x54f68b,_0x280fb8){return function(_0x1b9f45){if(_0x1b9f45){var _0x7078f6=typeof _0x280fb8[_0xb49e('0x16')]===_0xb49e('0x17')&&typeof _0x280fb8[_0xb49e('0x18')]===_0xb49e('0x17');var _0x173783=_0x1b9f45[_0xb49e('0x19')];var _0x50c6f5=_0x7078f6?0x0:_0x280fb8[_0xb49e('0x16')];var _0x1da889=_0x7078f6?_0x1b9f45[_0xb49e('0x19')]:_0x280fb8[_0xb49e('0x16')]+_0x280fb8['limit'];var _0xa77497;if(_0x1da889>=_0x173783){_0x1da889=_0x173783;_0xa77497=0xc8;}else{_0xa77497=0xce;}_0x54f68b['status'](_0xa77497);return _0x54f68b[_0xb49e('0x1a')](_0xb49e('0x1b'),_0x50c6f5+'-'+_0x1da889+'/'+_0x173783)[_0xb49e('0x1c')](_0x1b9f45);}return null;};}function patchUpdates(_0x4dea51){return function(_0x51e26b){try{jsonpatch[_0xb49e('0x1d')](_0x51e26b,_0x4dea51,!![]);}catch(_0x1f585c){return BPromise[_0xb49e('0x1e')](_0x1f585c);}return _0x51e26b[_0xb49e('0x1f')]();};}function saveUpdates(_0x48308e,_0x19864c){return function(_0x357a4e){if(_0x357a4e){return _0x357a4e[_0xb49e('0x20')](_0x48308e)[_0xb49e('0x21')](function(_0x2aa3eb){return _0x2aa3eb;});}return null;};}function removeEntity(_0x3f1f2f,_0x120a5e){return function(_0x1d8481){if(_0x1d8481){return _0x1d8481[_0xb49e('0x22')]()['then'](function(){_0x3f1f2f[_0xb49e('0x15')](0xcc)[_0xb49e('0x14')]();});}};}function handleEntityNotFound(_0x466519,_0x3bf8cf){return function(_0x281d37){if(!_0x281d37){_0x466519[_0xb49e('0x13')](0x194);}return _0x281d37;};}function handleError(_0x407537,_0xdf320f){_0xdf320f=_0xdf320f||0x1f4;return function(_0x1422b0){logger[_0xb49e('0x23')](_0x1422b0[_0xb49e('0x24')]);if(_0x1422b0[_0xb49e('0x25')]){delete _0x1422b0[_0xb49e('0x25')];}_0x407537[_0xb49e('0x15')](_0xdf320f)['send'](_0x1422b0);};}exports['index']=function(_0x206819,_0x41a9c1){var _0x7d3bff={},_0x5dee5b={},_0x434dd0={'count':0x0,'rows':[]};var _0x298dfa=_[_0xb49e('0x26')](db[_0xb49e('0x27')][_0xb49e('0x28')],function(_0x26a8ed){return{'name':_0x26a8ed[_0xb49e('0x29')],'type':_0x26a8ed[_0xb49e('0x2a')][_0xb49e('0x2b')]};});_0x5dee5b[_0xb49e('0x2c')]=_[_0xb49e('0x26')](_0x298dfa,_0xb49e('0x25'));_0x5dee5b[_0xb49e('0x2d')]=_[_0xb49e('0x2e')](_0x206819[_0xb49e('0x2d')]);_0x5dee5b[_0xb49e('0x2f')]=_[_0xb49e('0x30')](_0x5dee5b[_0xb49e('0x2c')],_0x5dee5b[_0xb49e('0x2d')]);_0x7d3bff['attributes']=_[_0xb49e('0x30')](_0x5dee5b[_0xb49e('0x2c')],qs[_0xb49e('0x31')](_0x206819[_0xb49e('0x2d')]['fields']));_0x7d3bff['attributes']=_0x7d3bff[_0xb49e('0x32')][_0xb49e('0x33')]?_0x7d3bff[_0xb49e('0x32')]:_0x5dee5b[_0xb49e('0x2c')];if(!_0x206819[_0xb49e('0x2d')]['hasOwnProperty'](_0xb49e('0x34'))){_0x7d3bff[_0xb49e('0x18')]=qs[_0xb49e('0x18')](_0x206819[_0xb49e('0x2d')][_0xb49e('0x18')]);_0x7d3bff[_0xb49e('0x16')]=qs[_0xb49e('0x16')](_0x206819[_0xb49e('0x2d')][_0xb49e('0x16')]);}_0x7d3bff[_0xb49e('0x35')]=qs[_0xb49e('0x36')](_0x206819[_0xb49e('0x2d')][_0xb49e('0x36')]);_0x7d3bff['where']=qs[_0xb49e('0x2f')](_[_0xb49e('0x37')](_0x206819[_0xb49e('0x2d')],_0x5dee5b[_0xb49e('0x2f')]),_0x298dfa);if(_0x206819[_0xb49e('0x2d')][_0xb49e('0x38')]){_0x7d3bff[_0xb49e('0x39')]=_[_0xb49e('0x3a')](_0x7d3bff[_0xb49e('0x39')],{'$or':_[_0xb49e('0x26')](_0x298dfa,function(_0x554fd0){if(_0x554fd0[_0xb49e('0x2a')]!==_0xb49e('0x3b')){var _0x47b4f5={};_0x47b4f5[_0x554fd0['name']]={'$like':'%'+_0x206819[_0xb49e('0x2d')][_0xb49e('0x38')]+'%'};return _0x47b4f5;}})});}_0x7d3bff=_[_0xb49e('0x3a')]({},_0x7d3bff,_0x206819['options']);var _0xe8c415={'where':_0x7d3bff[_0xb49e('0x39')]};return db['DeskConfiguration'][_0xb49e('0x19')](_0xe8c415)['then'](function(_0x3249b0){_0x434dd0[_0xb49e('0x19')]=_0x3249b0;if(_0x206819[_0xb49e('0x2d')][_0xb49e('0x3c')]){_0x7d3bff[_0xb49e('0x3d')]=[{'all':!![]}];}return db[_0xb49e('0x27')][_0xb49e('0x3e')](_0x7d3bff);})[_0xb49e('0x21')](function(_0x1930a9){_0x434dd0[_0xb49e('0x3f')]=_0x1930a9;return _0x434dd0;})[_0xb49e('0x21')](respondWithFilteredResult(_0x41a9c1,_0x7d3bff))[_0xb49e('0x40')](handleError(_0x41a9c1,null));};exports['show']=function(_0x39c05c,_0x27f8f5){var _0x90dc8a={'raw':![],'where':{'id':_0x39c05c['params']['id']}},_0xdddd19={};_0xdddd19['model']=_[_0xb49e('0x2e')](db[_0xb49e('0x27')][_0xb49e('0x28')]);_0xdddd19[_0xb49e('0x2d')]=_[_0xb49e('0x2e')](_0x39c05c[_0xb49e('0x2d')]);_0xdddd19[_0xb49e('0x2f')]=_['intersection'](_0xdddd19[_0xb49e('0x2c')],_0xdddd19[_0xb49e('0x2d')]);_0x90dc8a[_0xb49e('0x32')]=_[_0xb49e('0x30')](_0xdddd19[_0xb49e('0x2c')],qs[_0xb49e('0x31')](_0x39c05c['query']['fields']));_0x90dc8a['attributes']=_0x90dc8a[_0xb49e('0x32')]['length']?_0x90dc8a['attributes']:_0xdddd19[_0xb49e('0x2c')];if(_0x39c05c['query']['includeAll']){_0x90dc8a[_0xb49e('0x3d')]=[{'all':!![]}];}_0x90dc8a=_[_0xb49e('0x3a')]({},_0x90dc8a,_0x39c05c[_0xb49e('0x41')]);return db['DeskConfiguration'][_0xb49e('0x42')](_0x90dc8a)[_0xb49e('0x21')](handleEntityNotFound(_0x27f8f5,null))[_0xb49e('0x21')](respondWithResult(_0x27f8f5,null))['catch'](handleError(_0x27f8f5,null));};exports[_0xb49e('0x43')]=function(_0x37cebb,_0x21a239){return db[_0xb49e('0x27')]['create'](_0x37cebb[_0xb49e('0x44')],{})['then'](respondWithResult(_0x21a239,0xc9))[_0xb49e('0x40')](handleError(_0x21a239,null));};exports[_0xb49e('0x20')]=function(_0x5503d1,_0x581e0b){if(_0x5503d1[_0xb49e('0x44')]['id']){delete _0x5503d1[_0xb49e('0x44')]['id'];}return db['DeskConfiguration'][_0xb49e('0x42')]({'where':{'id':_0x5503d1['params']['id']}})[_0xb49e('0x21')](handleEntityNotFound(_0x581e0b,null))[_0xb49e('0x21')](saveUpdates(_0x5503d1[_0xb49e('0x44')],null))[_0xb49e('0x21')](respondWithResult(_0x581e0b,null))[_0xb49e('0x40')](handleError(_0x581e0b,null));};exports[_0xb49e('0x22')]=function(_0x321f55,_0x33282f){return db[_0xb49e('0x27')]['find']({'where':{'id':_0x321f55[_0xb49e('0x45')]['id']}})[_0xb49e('0x21')](handleEntityNotFound(_0x33282f,null))[_0xb49e('0x21')](removeEntity(_0x33282f,null))[_0xb49e('0x40')](handleError(_0x33282f,null));};exports[_0xb49e('0x46')]=function(_0x3fb81f,_0x3bff05,_0x197795){var _0x3cdd01={};var _0x241425={};var _0x230ce8;var _0x42de63;return db[_0xb49e('0x27')]['findOne']({'where':{'id':_0x3fb81f[_0xb49e('0x45')]['id']}})[_0xb49e('0x21')](handleEntityNotFound(_0x3bff05,null))[_0xb49e('0x21')](function(_0x40c24b){if(_0x40c24b){_0x230ce8=_0x40c24b;_0x241425[_0xb49e('0x2c')]=_[_0xb49e('0x2e')](db[_0xb49e('0x47')][_0xb49e('0x28')]);_0x241425['query']=_['keys'](_0x3fb81f[_0xb49e('0x2d')]);_0x241425['filters']=_['intersection'](_0x241425[_0xb49e('0x2c')],_0x241425[_0xb49e('0x2d')]);_0x3cdd01[_0xb49e('0x32')]=_[_0xb49e('0x30')](_0x241425['model'],qs[_0xb49e('0x31')](_0x3fb81f[_0xb49e('0x2d')][_0xb49e('0x31')]));_0x3cdd01[_0xb49e('0x32')]=_0x3cdd01[_0xb49e('0x32')][_0xb49e('0x33')]?_0x3cdd01['attributes']:_0x241425[_0xb49e('0x2c')];_0x3cdd01[_0xb49e('0x35')]=qs[_0xb49e('0x36')](_0x3fb81f[_0xb49e('0x2d')][_0xb49e('0x36')]);_0x3cdd01[_0xb49e('0x39')]=qs[_0xb49e('0x2f')](_[_0xb49e('0x37')](_0x3fb81f[_0xb49e('0x2d')],_0x241425[_0xb49e('0x2f')]));if(_0x3fb81f[_0xb49e('0x2d')][_0xb49e('0x38')]){_0x3cdd01['where']=_[_0xb49e('0x3a')](_0x3cdd01['where'],{'$or':_['map'](_0x3cdd01['attributes'],function(_0x58d566){var _0x30e183={};_0x30e183[_0x58d566]={'$like':'%'+_0x3fb81f['query'][_0xb49e('0x38')]+'%'};return _0x30e183;})});}_0x3cdd01=_[_0xb49e('0x3a')]({},_0x3cdd01,_0x3fb81f['options']);return _0x230ce8['getFields'](_0x3cdd01);}})[_0xb49e('0x21')](function(_0x157781){if(_0x157781){_0x42de63=_0x157781[_0xb49e('0x33')];if(!_0x3fb81f['query'][_0xb49e('0x48')](_0xb49e('0x34'))){_0x3cdd01['limit']=qs['limit'](_0x3fb81f[_0xb49e('0x2d')][_0xb49e('0x18')]);_0x3cdd01[_0xb49e('0x16')]=qs[_0xb49e('0x16')](_0x3fb81f[_0xb49e('0x2d')][_0xb49e('0x16')]);}return _0x230ce8[_0xb49e('0x46')](_0x3cdd01);}})[_0xb49e('0x21')](function(_0x2be929){if(_0x2be929){return _0x2be929?{'count':_0x42de63,'rows':_0x2be929}:null;}})[_0xb49e('0x21')](respondWithResult(_0x3bff05,null))[_0xb49e('0x40')](handleError(_0x3bff05,null));};exports[_0xb49e('0x49')]=function(_0x5b55db,_0x4c200c,_0x4ae469){var _0x151af4={};var _0x370c33={};var _0x401f24;var _0x200728;return db[_0xb49e('0x27')]['findOne']({'where':{'id':_0x5b55db[_0xb49e('0x45')]['id']}})[_0xb49e('0x21')](handleEntityNotFound(_0x4c200c,null))['then'](function(_0x4bace4){if(_0x4bace4){_0x401f24=_0x4bace4;_0x370c33[_0xb49e('0x2c')]=_['keys'](db[_0xb49e('0x47')]['rawAttributes']);_0x370c33[_0xb49e('0x2d')]=_[_0xb49e('0x2e')](_0x5b55db[_0xb49e('0x2d')]);_0x370c33[_0xb49e('0x2f')]=_[_0xb49e('0x30')](_0x370c33['model'],_0x370c33[_0xb49e('0x2d')]);_0x151af4[_0xb49e('0x32')]=_[_0xb49e('0x30')](_0x370c33[_0xb49e('0x2c')],qs[_0xb49e('0x31')](_0x5b55db[_0xb49e('0x2d')][_0xb49e('0x31')]));_0x151af4['attributes']=_0x151af4[_0xb49e('0x32')][_0xb49e('0x33')]?_0x151af4[_0xb49e('0x32')]:_0x370c33[_0xb49e('0x2c')];_0x151af4['order']=qs[_0xb49e('0x36')](_0x5b55db[_0xb49e('0x2d')][_0xb49e('0x36')]);_0x151af4[_0xb49e('0x39')]=qs[_0xb49e('0x2f')](_[_0xb49e('0x37')](_0x5b55db[_0xb49e('0x2d')],_0x370c33[_0xb49e('0x2f')]));if(_0x5b55db[_0xb49e('0x2d')][_0xb49e('0x38')]){_0x151af4[_0xb49e('0x39')]=_[_0xb49e('0x3a')](_0x151af4[_0xb49e('0x39')],{'$or':_['map'](_0x151af4['attributes'],function(_0x41370e){var _0x486961={};_0x486961[_0x41370e]={'$like':'%'+_0x5b55db[_0xb49e('0x2d')]['filter']+'%'};return _0x486961;})});}_0x151af4=_[_0xb49e('0x3a')]({},_0x151af4,_0x5b55db[_0xb49e('0x41')]);return _0x401f24[_0xb49e('0x49')](_0x151af4);}})[_0xb49e('0x21')](function(_0x4559c6){if(_0x4559c6){_0x200728=_0x4559c6[_0xb49e('0x33')];if(!_0x5b55db['query']['hasOwnProperty'](_0xb49e('0x34'))){_0x151af4['limit']=qs[_0xb49e('0x18')](_0x5b55db[_0xb49e('0x2d')][_0xb49e('0x18')]);_0x151af4[_0xb49e('0x16')]=qs[_0xb49e('0x16')](_0x5b55db['query']['offset']);}return _0x401f24['getSubjects'](_0x151af4);}})[_0xb49e('0x21')](function(_0x3efe31){if(_0x3efe31){return _0x3efe31?{'count':_0x200728,'rows':_0x3efe31}:null;}})['then'](respondWithResult(_0x4c200c,null))[_0xb49e('0x40')](handleError(_0x4c200c,null));};exports['getDescriptions']=function(_0x4069de,_0x24cef2,_0x55a844){var _0x41fa12={};var _0x1f4023={};var _0x18f9ba;var _0x1d2ca0;return db[_0xb49e('0x27')][_0xb49e('0x4a')]({'where':{'id':_0x4069de[_0xb49e('0x45')]['id']}})['then'](handleEntityNotFound(_0x24cef2,null))[_0xb49e('0x21')](function(_0x196f04){if(_0x196f04){_0x18f9ba=_0x196f04;_0x1f4023[_0xb49e('0x2c')]=_[_0xb49e('0x2e')](db['DeskField'][_0xb49e('0x28')]);_0x1f4023['query']=_[_0xb49e('0x2e')](_0x4069de[_0xb49e('0x2d')]);_0x1f4023['filters']=_['intersection'](_0x1f4023[_0xb49e('0x2c')],_0x1f4023['query']);_0x41fa12[_0xb49e('0x32')]=_[_0xb49e('0x30')](_0x1f4023[_0xb49e('0x2c')],qs['fields'](_0x4069de[_0xb49e('0x2d')][_0xb49e('0x31')]));_0x41fa12['attributes']=_0x41fa12['attributes'][_0xb49e('0x33')]?_0x41fa12[_0xb49e('0x32')]:_0x1f4023[_0xb49e('0x2c')];_0x41fa12[_0xb49e('0x35')]=qs[_0xb49e('0x36')](_0x4069de['query'][_0xb49e('0x36')]);_0x41fa12[_0xb49e('0x39')]=qs[_0xb49e('0x2f')](_['pick'](_0x4069de[_0xb49e('0x2d')],_0x1f4023[_0xb49e('0x2f')]));if(_0x4069de[_0xb49e('0x2d')]['filter']){_0x41fa12['where']=_['merge'](_0x41fa12[_0xb49e('0x39')],{'$or':_['map'](_0x41fa12[_0xb49e('0x32')],function(_0x5d3459){var _0x108fb8={};_0x108fb8[_0x5d3459]={'$like':'%'+_0x4069de['query']['filter']+'%'};return _0x108fb8;})});}_0x41fa12=_['merge']({},_0x41fa12,_0x4069de[_0xb49e('0x41')]);return _0x18f9ba[_0xb49e('0x4b')](_0x41fa12);}})['then'](function(_0x37c0f8){if(_0x37c0f8){_0x1d2ca0=_0x37c0f8[_0xb49e('0x33')];if(!_0x4069de[_0xb49e('0x2d')][_0xb49e('0x48')](_0xb49e('0x34'))){_0x41fa12['limit']=qs[_0xb49e('0x18')](_0x4069de['query'][_0xb49e('0x18')]);_0x41fa12[_0xb49e('0x16')]=qs[_0xb49e('0x16')](_0x4069de[_0xb49e('0x2d')][_0xb49e('0x16')]);}return _0x18f9ba[_0xb49e('0x4b')](_0x41fa12);}})[_0xb49e('0x21')](function(_0x3f516a){if(_0x3f516a){return _0x3f516a?{'count':_0x1d2ca0,'rows':_0x3f516a}:null;}})[_0xb49e('0x21')](respondWithResult(_0x24cef2,null))[_0xb49e('0x40')](handleError(_0x24cef2,null));};exports[_0xb49e('0x4c')]=function(_0x1d64c1,_0x431c17,_0x4fcc46){var _0x4011cd={};var _0x2920a8={};var _0x580fdf;var _0x4fda34;return db['DeskConfiguration']['findOne']({'where':{'id':_0x1d64c1['params']['id']}})['then'](handleEntityNotFound(_0x431c17,null))['then'](function(_0xea72d8){if(_0xea72d8){_0x580fdf=_0xea72d8;_0x2920a8[_0xb49e('0x2c')]=_[_0xb49e('0x2e')](db[_0xb49e('0x4d')][_0xb49e('0x28')]);_0x2920a8[_0xb49e('0x2d')]=_['keys'](_0x1d64c1[_0xb49e('0x2d')]);_0x2920a8[_0xb49e('0x2f')]=_['intersection'](_0x2920a8[_0xb49e('0x2c')],_0x2920a8['query']);_0x4011cd[_0xb49e('0x32')]=_[_0xb49e('0x30')](_0x2920a8[_0xb49e('0x2c')],qs[_0xb49e('0x31')](_0x1d64c1[_0xb49e('0x2d')][_0xb49e('0x31')]));_0x4011cd[_0xb49e('0x32')]=_0x4011cd[_0xb49e('0x32')][_0xb49e('0x33')]?_0x4011cd['attributes']:_0x2920a8[_0xb49e('0x2c')];_0x4011cd[_0xb49e('0x35')]=qs['sort'](_0x1d64c1[_0xb49e('0x2d')][_0xb49e('0x36')]);_0x4011cd[_0xb49e('0x39')]=qs[_0xb49e('0x2f')](_[_0xb49e('0x37')](_0x1d64c1[_0xb49e('0x2d')],_0x2920a8[_0xb49e('0x2f')]));if(_0x1d64c1[_0xb49e('0x2d')][_0xb49e('0x38')]){_0x4011cd[_0xb49e('0x39')]=_['merge'](_0x4011cd[_0xb49e('0x39')],{'$or':_[_0xb49e('0x26')](_0x4011cd[_0xb49e('0x32')],function(_0x681160){var _0x3a82c3={};_0x3a82c3[_0x681160]={'$like':'%'+_0x1d64c1[_0xb49e('0x2d')][_0xb49e('0x38')]+'%'};return _0x3a82c3;})});}_0x4011cd=_['merge']({},_0x4011cd,_0x1d64c1['options']);return _0x580fdf[_0xb49e('0x4c')](_0x4011cd);}})[_0xb49e('0x21')](function(_0x5bb789){if(_0x5bb789){_0x4fda34=_0x5bb789['length'];if(!_0x1d64c1['query'][_0xb49e('0x48')](_0xb49e('0x34'))){_0x4011cd['limit']=qs[_0xb49e('0x18')](_0x1d64c1[_0xb49e('0x2d')][_0xb49e('0x18')]);_0x4011cd[_0xb49e('0x16')]=qs[_0xb49e('0x16')](_0x1d64c1[_0xb49e('0x2d')]['offset']);}return _0x580fdf[_0xb49e('0x4c')](_0x4011cd);}})[_0xb49e('0x21')](function(_0x2fca76){if(_0x2fca76){return _0x2fca76?{'count':_0x4fda34,'rows':_0x2fca76}:null;}})[_0xb49e('0x21')](respondWithResult(_0x431c17,null))[_0xb49e('0x40')](handleError(_0x431c17,null));};exports[_0xb49e('0x4e')]=function(_0xfb1566,_0xac473e,_0x557a72){if(_0xfb1566[_0xb49e('0x44')]['id']){delete _0xfb1566[_0xb49e('0x44')]['id'];}return db[_0xb49e('0x27')][_0xb49e('0x4a')]({'where':{'id':_0xfb1566[_0xb49e('0x45')]['id']}})[_0xb49e('0x21')](handleEntityNotFound(_0xac473e,null))['then'](function(_0x58799d){if(_0x58799d){return _0x58799d[_0xb49e('0x4e')](_0xfb1566[_0xb49e('0x44')][_0xb49e('0x4f')]||[]);}return null;})[_0xb49e('0x21')](respondWithResult(_0xac473e,null))[_0xb49e('0x40')](handleError(_0xac473e,null));};
\ No newline at end of file
index e577564..945175b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x131e=['int_desk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','DeskConfiguration'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x131e,0x1d5));var _0xe131=function(_0x4abf68,_0x1c2cfd){_0x4abf68=_0x4abf68-0x0;var _0x18fa5e=_0x131e[_0x4abf68];return _0x18fa5e;};'use strict';var _=require(_0xe131('0x0'));var util=require(_0xe131('0x1'));var logger=require(_0xe131('0x2'))(_0xe131('0x3'));var moment=require('moment');var BPromise=require(_0xe131('0x4'));var rp=require(_0xe131('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe131('0x6'));var config=require(_0xe131('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xe131('0x8')]=function(_0x16402c,_0x3d7810){return _0x16402c[_0xe131('0x9')](_0xe131('0xa'),attributes,{'tableName':_0xe131('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a43=['bluebird','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','util','../../config/logger','api','moment'];(function(_0x5e9817,_0xa29439){var _0x25b437=function(_0x46851b){while(--_0x46851b){_0x5e9817['push'](_0x5e9817['shift']());}};_0x25b437(++_0xa29439);}(_0x9a43,0x15a));var _0x39a4=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0x9a43[_0x147497];return _0x35f45;};'use strict';var _=require('lodash');var util=require(_0x39a4('0x0'));var logger=require(_0x39a4('0x1'))(_0x39a4('0x2'));var moment=require(_0x39a4('0x3'));var BPromise=require(_0x39a4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x39a4('0x5'));var attributes=require(_0x39a4('0x6'));module[_0x39a4('0x7')]=function(_0x52b622,_0x3b728f){return _0x52b622[_0x39a4('0x8')]('DeskConfiguration',attributes,{'tableName':_0x39a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eebe681..454adf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6af6=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x6af6,0x176));var _0x66af=function(_0x24e07f,_0x50e821){_0x24e07f=_0x24e07f-0x0;var _0x550ae5=_0x6af6[_0x24e07f];return _0x550ae5;};'use strict';var _=require(_0x66af('0x0'));var util=require(_0x66af('0x1'));var moment=require(_0x66af('0x2'));var BPromise=require(_0x66af('0x3'));var rs=require(_0x66af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66af('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x66af('0x6'))(_0x66af('0x7'));var config=require(_0x66af('0x8'));var jayson=require(_0x66af('0x9'));var client=jayson['client'][_0x66af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4989a5,_0x45bd30,_0xcf9131){return new BPromise(function(_0x132168,_0x3da3cf){return client[_0x66af('0xb')](_0x4989a5,_0xcf9131)['then'](function(_0x230dd1){logger[_0x66af('0xc')](_0x66af('0xd'),_0x45bd30,_0x66af('0xe'));logger[_0x66af('0xf')](_0x66af('0x10'),_0x45bd30,_0x66af('0xe'),JSON[_0x66af('0x11')](_0x230dd1));if(_0x230dd1[_0x66af('0x12')]){if(_0x230dd1[_0x66af('0x12')][_0x66af('0x13')]===0x1f4){logger[_0x66af('0x12')](_0x66af('0xd'),_0x45bd30,_0x230dd1[_0x66af('0x12')][_0x66af('0x14')]);return _0x3da3cf(_0x230dd1[_0x66af('0x12')][_0x66af('0x14')]);}logger['error'](_0x66af('0xd'),_0x45bd30,_0x230dd1[_0x66af('0x12')]['message']);return _0x132168(_0x230dd1[_0x66af('0x12')]['message']);}else{logger[_0x66af('0xc')](_0x66af('0xd'),_0x45bd30,'request\x20sent');_0x132168(_0x230dd1[_0x66af('0x15')][_0x66af('0x14')]);}})[_0x66af('0x16')](function(_0x1547a5){logger['error'](_0x66af('0xd'),_0x45bd30,_0x1547a5);_0x3da3cf(_0x1547a5);});});}
\ No newline at end of file
+var _0x8d5e=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash'];(function(_0x2e1cf1,_0xac9c91){var _0x4a0556=function(_0x4a107a){while(--_0x4a107a){_0x2e1cf1['push'](_0x2e1cf1['shift']());}};_0x4a0556(++_0xac9c91);}(_0x8d5e,0xf6));var _0xe8d5=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x8d5e[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xe8d5('0x0'));var util=require(_0xe8d5('0x1'));var moment=require(_0xe8d5('0x2'));var BPromise=require(_0xe8d5('0x3'));var rs=require(_0xe8d5('0x4'));var fs=require('fs');var Redis=require(_0xe8d5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe8d5('0x6'))(_0xe8d5('0x7'));var config=require(_0xe8d5('0x8'));var jayson=require(_0xe8d5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31ff1a,_0x1c1b96,_0x5252a8){return new BPromise(function(_0x262fae,_0x4348a4){return client[_0xe8d5('0xa')](_0x31ff1a,_0x5252a8)[_0xe8d5('0xb')](function(_0x4e4eae){logger[_0xe8d5('0xc')](_0xe8d5('0xd'),_0x1c1b96,'request\x20sent');logger['debug'](_0xe8d5('0xe'),_0x1c1b96,_0xe8d5('0xf'),JSON['stringify'](_0x4e4eae));if(_0x4e4eae[_0xe8d5('0x10')]){if(_0x4e4eae['error']['code']===0x1f4){logger['error'](_0xe8d5('0xd'),_0x1c1b96,_0x4e4eae[_0xe8d5('0x10')][_0xe8d5('0x11')]);return _0x4348a4(_0x4e4eae[_0xe8d5('0x10')][_0xe8d5('0x11')]);}logger[_0xe8d5('0x10')](_0xe8d5('0xd'),_0x1c1b96,_0x4e4eae[_0xe8d5('0x10')][_0xe8d5('0x11')]);return _0x262fae(_0x4e4eae[_0xe8d5('0x10')][_0xe8d5('0x11')]);}else{logger['info'](_0xe8d5('0xd'),_0x1c1b96,_0xe8d5('0xf'));_0x262fae(_0x4e4eae['result'][_0xe8d5('0x11')]);}})[_0xe8d5('0x12')](function(_0xc877c0){logger[_0xe8d5('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x1c1b96,_0xc877c0);_0x4348a4(_0xc877c0);});});}
\ No newline at end of file
index 19c9c77..6e39c65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7d6=['./intDeskField.controller','isAuthenticated','index','get','/:id','show','create','put','delete','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3786ea,_0x466efe){var _0xe5bcd0=function(_0x165942){while(--_0x165942){_0x3786ea['push'](_0x3786ea['shift']());}};_0xe5bcd0(++_0x466efe);}(_0xb7d6,0xca));var _0x6b7d=function(_0x317cc5,_0x3b6179){_0x317cc5=_0x317cc5-0x0;var _0x44fe81=_0xb7d6[_0x317cc5];return _0x44fe81;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6b7d('0x0'));var express=require(_0x6b7d('0x1'));var router=express[_0x6b7d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6b7d('0x3'));var interaction=require(_0x6b7d('0x4'));var config=require(_0x6b7d('0x5'));var controller=require(_0x6b7d('0x6'));router['get']('/',auth[_0x6b7d('0x7')](),controller[_0x6b7d('0x8')]);router[_0x6b7d('0x9')](_0x6b7d('0xa'),auth[_0x6b7d('0x7')](),controller[_0x6b7d('0xb')]);router['post']('/',auth[_0x6b7d('0x7')](),controller[_0x6b7d('0xc')]);router[_0x6b7d('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6b7d('0xe')](_0x6b7d('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x6b7d('0xf')]=router;
\ No newline at end of file
+var _0x005f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x005f,0x19e));var _0xf005=function(_0xc98b6c,_0x1985f3){_0xc98b6c=_0xc98b6c-0x0;var _0x11a2cb=_0x005f[_0xc98b6c];return _0x11a2cb;};'use strict';var multer=require(_0xf005('0x0'));var util=require(_0xf005('0x1'));var path=require(_0xf005('0x2'));var timeout=require('connect-timeout');var express=require(_0xf005('0x3'));var router=express[_0xf005('0x4')]();var fs_extra=require(_0xf005('0x5'));var auth=require(_0xf005('0x6'));var interaction=require(_0xf005('0x7'));var config=require(_0xf005('0x8'));var controller=require(_0xf005('0x9'));router[_0xf005('0xa')]('/',auth[_0xf005('0xb')](),controller[_0xf005('0xc')]);router[_0xf005('0xa')](_0xf005('0xd'),auth[_0xf005('0xb')](),controller[_0xf005('0xe')]);router[_0xf005('0xf')]('/',auth[_0xf005('0xb')](),controller[_0xf005('0x10')]);router['put']('/:id',auth[_0xf005('0xb')](),controller[_0xf005('0x11')]);router[_0xf005('0x12')]('/:id',auth[_0xf005('0xb')](),controller['destroy']);module[_0xf005('0x13')]=router;
\ No newline at end of file
index 0879708..7889f84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a5b=['keyValue','STRING','customVariable','exports','ENUM','string','variable'];(function(_0x1294d4,_0x23c50b){var _0x37735e=function(_0x3c186a){while(--_0x3c186a){_0x1294d4['push'](_0x1294d4['shift']());}};_0x37735e(++_0x23c50b);}(_0x7a5b,0x18b));var _0xb7a5=function(_0x3c2246,_0x516cd5){_0x3c2246=_0x3c2246-0x0;var _0xbf30b3=_0x7a5b[_0x3c2246];return _0xbf30b3;};'use strict';var Sequelize=require('sequelize');module[_0xb7a5('0x0')]={'type':{'type':Sequelize[_0xb7a5('0x1')](_0xb7a5('0x2'),_0xb7a5('0x3'),'customVariable',_0xb7a5('0x4'),'picklist'),'defaultValue':_0xb7a5('0x2')},'content':{'type':Sequelize[_0xb7a5('0x5')]},'key':{'type':Sequelize[_0xb7a5('0x5')]},'keyType':{'type':Sequelize[_0xb7a5('0x1')](_0xb7a5('0x2'),_0xb7a5('0x3'),_0xb7a5('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb7a5('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb7a5('0x5')]}};
\ No newline at end of file
+var _0x66aa=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x5206f1,_0x28d4e3){var _0x299e50=function(_0x3f8594){while(--_0x3f8594){_0x5206f1['push'](_0x5206f1['shift']());}};_0x299e50(++_0x28d4e3);}(_0x66aa,0xe4));var _0xa66a=function(_0x19d0f4,_0x38b420){_0x19d0f4=_0x19d0f4-0x0;var _0x186ed6=_0x66aa[_0x19d0f4];return _0x186ed6;};'use strict';var Sequelize=require(_0xa66a('0x0'));module[_0xa66a('0x1')]={'type':{'type':Sequelize[_0xa66a('0x2')](_0xa66a('0x3'),_0xa66a('0x4'),'customVariable',_0xa66a('0x5'),_0xa66a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa66a('0x7')]},'keyType':{'type':Sequelize[_0xa66a('0x2')](_0xa66a('0x3'),_0xa66a('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xa66a('0x7')]},'idField':{'type':Sequelize[_0xa66a('0x7')]},'nameField':{'type':Sequelize[_0xa66a('0x7')]},'customField':{'type':Sequelize[_0xa66a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa66a('0x7')]}};
\ No newline at end of file
index 1084e85..6d42c20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','DeskField','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x4c60,0xc1));var _0x04c6=function(_0x737b1d,_0x50be43){_0x737b1d=_0x737b1d-0x0;var _0x733cfe=_0x4c60[_0x737b1d];return _0x733cfe;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['DeskField'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['DeskField'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':!![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['DeskField'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['DeskField'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['DeskField'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};
\ No newline at end of file
+var _0x4da5=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','DeskField','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash'];(function(_0x7872ea,_0xa530f3){var _0x42eec9=function(_0x267c77){while(--_0x267c77){_0x7872ea['push'](_0x7872ea['shift']());}};_0x42eec9(++_0xa530f3);}(_0x4da5,0x1b7));var _0x54da=function(_0x31f470,_0x48cce8){_0x31f470=_0x31f470-0x0;var _0x5b79b8=_0x4da5[_0x31f470];return _0x5b79b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54da('0x0'));var zipdir=require(_0x54da('0x1'));var jsonpatch=require(_0x54da('0x2'));var rp=require('request-promise');var moment=require(_0x54da('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x54da('0x4'));var util=require(_0x54da('0x5'));var path=require(_0x54da('0x6'));var sox=require(_0x54da('0x7'));var csv=require('to-csv');var ejs=require(_0x54da('0x8'));var fs=require('fs');var fs_extra=require(_0x54da('0x9'));var _=require(_0x54da('0xa'));var squel=require(_0x54da('0xb'));var crypto=require(_0x54da('0xc'));var jsforce=require(_0x54da('0xd'));var deskjs=require(_0x54da('0xe'));var toCsv=require('to-csv');var querystring=require(_0x54da('0xf'));var Papa=require(_0x54da('0x10'));var Redis=require(_0x54da('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x54da('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x54da('0x13'))(_0x54da('0x14'));var utils=require(_0x54da('0x15'));var config=require(_0x54da('0x16'));var licenseUtil=require(_0x54da('0x17'));var db=require(_0x54da('0x18'))['db'];function respondWithStatusCode(_0x1b4244,_0x2c6240){_0x2c6240=_0x2c6240||0xcc;return function(_0x1963fe){if(_0x1963fe){return _0x1b4244[_0x54da('0x19')](_0x2c6240);}return _0x1b4244[_0x54da('0x1a')](_0x2c6240)[_0x54da('0x1b')]();};}function respondWithResult(_0x425756,_0x58c020){_0x58c020=_0x58c020||0xc8;return function(_0x411e66){if(_0x411e66){return _0x425756[_0x54da('0x1a')](_0x58c020)[_0x54da('0x1c')](_0x411e66);}};}function respondWithFilteredResult(_0x2754fd,_0x5ef918){return function(_0xe142b){if(_0xe142b){var _0x34fab6=typeof _0x5ef918[_0x54da('0x1d')]===_0x54da('0x1e')&&typeof _0x5ef918[_0x54da('0x1f')]===_0x54da('0x1e');var _0x5e17e1=_0xe142b[_0x54da('0x20')];var _0x14aa08=_0x34fab6?0x0:_0x5ef918['offset'];var _0x2cad22=_0x34fab6?_0xe142b[_0x54da('0x20')]:_0x5ef918['offset']+_0x5ef918['limit'];var _0x363334;if(_0x2cad22>=_0x5e17e1){_0x2cad22=_0x5e17e1;_0x363334=0xc8;}else{_0x363334=0xce;}_0x2754fd['status'](_0x363334);return _0x2754fd[_0x54da('0x21')](_0x54da('0x22'),_0x14aa08+'-'+_0x2cad22+'/'+_0x5e17e1)['json'](_0xe142b);}return null;};}function patchUpdates(_0x123cac){return function(_0x4c9f9d){try{jsonpatch[_0x54da('0x23')](_0x4c9f9d,_0x123cac,!![]);}catch(_0x1e9a5d){return BPromise[_0x54da('0x24')](_0x1e9a5d);}return _0x4c9f9d[_0x54da('0x25')]();};}function saveUpdates(_0x348c56,_0x415598){return function(_0x340d26){if(_0x340d26){return _0x340d26[_0x54da('0x26')](_0x348c56)['then'](function(_0x17dfb8){return _0x17dfb8;});}return null;};}function removeEntity(_0xb67cbf,_0x16b09a){return function(_0x3d062b){if(_0x3d062b){return _0x3d062b[_0x54da('0x27')]()[_0x54da('0x28')](function(){_0xb67cbf['status'](0xcc)[_0x54da('0x1b')]();});}};}function handleEntityNotFound(_0xef179d,_0x1f42ec){return function(_0x18d1bd){if(!_0x18d1bd){_0xef179d[_0x54da('0x19')](0x194);}return _0x18d1bd;};}function handleError(_0x126da9,_0x58eee9){_0x58eee9=_0x58eee9||0x1f4;return function(_0x9ea13f){logger['error'](_0x9ea13f[_0x54da('0x29')]);if(_0x9ea13f[_0x54da('0x2a')]){delete _0x9ea13f[_0x54da('0x2a')];}_0x126da9['status'](_0x58eee9)['send'](_0x9ea13f);};}exports[_0x54da('0x2b')]=function(_0x3cc6cc,_0x43610e){var _0x4f7f84={},_0x1f69e6={},_0x1ef2ac={'count':0x0,'rows':[]};var _0x56942a=_[_0x54da('0x2c')](db[_0x54da('0x2d')][_0x54da('0x2e')],function(_0x4f7ee2){return{'name':_0x4f7ee2['fieldName'],'type':_0x4f7ee2[_0x54da('0x2f')]['key']};});_0x1f69e6[_0x54da('0x30')]=_[_0x54da('0x2c')](_0x56942a,_0x54da('0x2a'));_0x1f69e6[_0x54da('0x31')]=_[_0x54da('0x32')](_0x3cc6cc[_0x54da('0x31')]);_0x1f69e6[_0x54da('0x33')]=_[_0x54da('0x34')](_0x1f69e6['model'],_0x1f69e6[_0x54da('0x31')]);_0x4f7f84[_0x54da('0x35')]=_['intersection'](_0x1f69e6['model'],qs[_0x54da('0x36')](_0x3cc6cc[_0x54da('0x31')][_0x54da('0x36')]));_0x4f7f84[_0x54da('0x35')]=_0x4f7f84[_0x54da('0x35')][_0x54da('0x37')]?_0x4f7f84[_0x54da('0x35')]:_0x1f69e6[_0x54da('0x30')];if(!_0x3cc6cc[_0x54da('0x31')][_0x54da('0x38')](_0x54da('0x39'))){_0x4f7f84[_0x54da('0x1f')]=qs['limit'](_0x3cc6cc[_0x54da('0x31')][_0x54da('0x1f')]);_0x4f7f84['offset']=qs[_0x54da('0x1d')](_0x3cc6cc[_0x54da('0x31')][_0x54da('0x1d')]);}_0x4f7f84[_0x54da('0x3a')]=qs[_0x54da('0x3b')](_0x3cc6cc['query']['sort']);_0x4f7f84[_0x54da('0x3c')]=qs['filters'](_['pick'](_0x3cc6cc['query'],_0x1f69e6[_0x54da('0x33')]),_0x56942a);if(_0x3cc6cc[_0x54da('0x31')][_0x54da('0x3d')]){_0x4f7f84[_0x54da('0x3c')]=_[_0x54da('0x3e')](_0x4f7f84[_0x54da('0x3c')],{'$or':_[_0x54da('0x2c')](_0x56942a,function(_0x1c2268){if(_0x1c2268[_0x54da('0x2f')]!==_0x54da('0x3f')){var _0x27b65e={};_0x27b65e[_0x1c2268[_0x54da('0x2a')]]={'$like':'%'+_0x3cc6cc[_0x54da('0x31')][_0x54da('0x3d')]+'%'};return _0x27b65e;}})});}_0x4f7f84=_[_0x54da('0x3e')]({},_0x4f7f84,_0x3cc6cc[_0x54da('0x40')]);var _0x33464a={'where':_0x4f7f84[_0x54da('0x3c')]};return db['DeskField'][_0x54da('0x20')](_0x33464a)['then'](function(_0x33dd65){_0x1ef2ac['count']=_0x33dd65;if(_0x3cc6cc[_0x54da('0x31')][_0x54da('0x41')]){_0x4f7f84[_0x54da('0x42')]=[{'all':!![]}];}return db['DeskField'][_0x54da('0x43')](_0x4f7f84);})['then'](function(_0x28cad0){_0x1ef2ac[_0x54da('0x44')]=_0x28cad0;return _0x1ef2ac;})[_0x54da('0x28')](respondWithFilteredResult(_0x43610e,_0x4f7f84))['catch'](handleError(_0x43610e,null));};exports[_0x54da('0x45')]=function(_0x3f990b,_0x333f0a){var _0x314af0={'raw':!![],'where':{'id':_0x3f990b[_0x54da('0x46')]['id']}},_0x260c32={};_0x260c32[_0x54da('0x30')]=_[_0x54da('0x32')](db[_0x54da('0x2d')]['rawAttributes']);_0x260c32[_0x54da('0x31')]=_[_0x54da('0x32')](_0x3f990b[_0x54da('0x31')]);_0x260c32['filters']=_[_0x54da('0x34')](_0x260c32['model'],_0x260c32[_0x54da('0x31')]);_0x314af0[_0x54da('0x35')]=_['intersection'](_0x260c32[_0x54da('0x30')],qs['fields'](_0x3f990b['query'][_0x54da('0x36')]));_0x314af0['attributes']=_0x314af0[_0x54da('0x35')]['length']?_0x314af0['attributes']:_0x260c32[_0x54da('0x30')];if(_0x3f990b[_0x54da('0x31')][_0x54da('0x41')]){_0x314af0[_0x54da('0x42')]=[{'all':!![]}];}_0x314af0=_[_0x54da('0x3e')]({},_0x314af0,_0x3f990b['options']);return db[_0x54da('0x2d')][_0x54da('0x47')](_0x314af0)[_0x54da('0x28')](handleEntityNotFound(_0x333f0a,null))[_0x54da('0x28')](respondWithResult(_0x333f0a,null))[_0x54da('0x48')](handleError(_0x333f0a,null));};exports[_0x54da('0x49')]=function(_0x48675a,_0x32cbac){return db[_0x54da('0x2d')][_0x54da('0x49')](_0x48675a['body'],{})[_0x54da('0x28')](respondWithResult(_0x32cbac,0xc9))['catch'](handleError(_0x32cbac,null));};exports[_0x54da('0x26')]=function(_0x604a93,_0xddb15d){if(_0x604a93['body']['id']){delete _0x604a93[_0x54da('0x4a')]['id'];}return db[_0x54da('0x2d')][_0x54da('0x47')]({'where':{'id':_0x604a93[_0x54da('0x46')]['id']}})[_0x54da('0x28')](handleEntityNotFound(_0xddb15d,null))[_0x54da('0x28')](saveUpdates(_0x604a93[_0x54da('0x4a')],null))['then'](respondWithResult(_0xddb15d,null))[_0x54da('0x48')](handleError(_0xddb15d,null));};exports[_0x54da('0x27')]=function(_0x361577,_0xa5cdd6){return db['DeskField']['find']({'where':{'id':_0x361577[_0x54da('0x46')]['id']}})['then'](handleEntityNotFound(_0xa5cdd6,null))[_0x54da('0x28')](removeEntity(_0xa5cdd6,null))['catch'](handleError(_0xa5cdd6,null));};
\ No newline at end of file
index c03d436..41facac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9acb=['DeskField','int_desk_fields','idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define'];(function(_0x1bb64b,_0x55c207){var _0x4c90d2=function(_0x4c1507){while(--_0x4c1507){_0x1bb64b['push'](_0x1bb64b['shift']());}};_0x4c90d2(++_0x55c207);}(_0x9acb,0x9e));var _0xb9ac=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x9acb[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xb9ac('0x0'));var util=require(_0xb9ac('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb9ac('0x2'));var BPromise=require(_0xb9ac('0x3'));var rp=require(_0xb9ac('0x4'));var fs=require('fs');var path=require(_0xb9ac('0x5'));var rimraf=require(_0xb9ac('0x6'));var config=require(_0xb9ac('0x7'));var attributes=require(_0xb9ac('0x8'));module['exports']=function(_0x14ae14,_0x247c82){return _0x14ae14[_0xb9ac('0x9')](_0xb9ac('0xa'),attributes,{'tableName':_0xb9ac('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xb9ac('0xc'),_0xb9ac('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e34=['define','int_desk_fields','desk_unique_index','lodash','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports'];(function(_0x42a8c0,_0x36c472){var _0x426d7b=function(_0x71cca2){while(--_0x71cca2){_0x42a8c0['push'](_0x42a8c0['shift']());}};_0x426d7b(++_0x36c472);}(_0x0e34,0xab));var _0x40e3=function(_0x3f0474,_0xb79c2e){_0x3f0474=_0x3f0474-0x0;var _0x7b9b05=_0x0e34[_0x3f0474];return _0x7b9b05;};'use strict';var _=require(_0x40e3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40e3('0x1'));var moment=require(_0x40e3('0x2'));var BPromise=require(_0x40e3('0x3'));var rp=require(_0x40e3('0x4'));var fs=require('fs');var path=require(_0x40e3('0x5'));var rimraf=require(_0x40e3('0x6'));var config=require('../../config/environment');var attributes=require(_0x40e3('0x7'));module[_0x40e3('0x8')]=function(_0x12d1bf,_0x1bffbb){return _0x12d1bf[_0x40e3('0x9')]('DeskField',attributes,{'tableName':_0x40e3('0xa'),'paranoid':![],'indexes':[{'name':_0x40e3('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 3791d51..8960dc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64e6=['http','request','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x64e6,0x1b0));var _0x664e=function(_0x193028,_0x369014){_0x193028=_0x193028-0x0;var _0x1802bb=_0x64e6[_0x193028];return _0x1802bb;};'use strict';var _=require(_0x664e('0x0'));var util=require('util');var moment=require(_0x664e('0x1'));var BPromise=require(_0x664e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x664e('0x3'));var db=require(_0x664e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x664e('0x5'));var jayson=require(_0x664e('0x6'));var client=jayson[_0x664e('0x7')][_0x664e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x364b02,_0x3c81e4,_0x3e8d1e){return new BPromise(function(_0x1d66e7,_0x41b6e3){return client[_0x664e('0x9')](_0x364b02,_0x3e8d1e)['then'](function(_0x2b1911){logger['info'](_0x664e('0xa'),_0x3c81e4,_0x664e('0xb'));logger[_0x664e('0xc')](_0x664e('0xd'),_0x3c81e4,_0x664e('0xb'),JSON[_0x664e('0xe')](_0x2b1911));if(_0x2b1911[_0x664e('0xf')]){if(_0x2b1911['error'][_0x664e('0x10')]===0x1f4){logger[_0x664e('0xf')](_0x664e('0xa'),_0x3c81e4,_0x2b1911[_0x664e('0xf')][_0x664e('0x11')]);return _0x41b6e3(_0x2b1911[_0x664e('0xf')][_0x664e('0x11')]);}logger[_0x664e('0xf')]('DeskField,\x20%s,\x20%s',_0x3c81e4,_0x2b1911['error']['message']);return _0x1d66e7(_0x2b1911[_0x664e('0xf')][_0x664e('0x11')]);}else{logger[_0x664e('0x12')](_0x664e('0xa'),_0x3c81e4,_0x664e('0xb'));_0x1d66e7(_0x2b1911[_0x664e('0x13')][_0x664e('0x11')]);}})['catch'](function(_0x2756e6){logger[_0x664e('0xf')](_0x664e('0xa'),_0x3c81e4,_0x2756e6);_0x41b6e3(_0x2756e6);});});}
\ No newline at end of file
+var _0xdf7c=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird'];(function(_0x1f5890,_0x599bd3){var _0x5dde01=function(_0x59bcb2){while(--_0x59bcb2){_0x1f5890['push'](_0x1f5890['shift']());}};_0x5dde01(++_0x599bd3);}(_0xdf7c,0x179));var _0xcdf7=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0xdf7c[_0x22b8a3];return _0x199a0c;};'use strict';var _=require('lodash');var util=require(_0xcdf7('0x0'));var moment=require(_0xcdf7('0x1'));var BPromise=require(_0xcdf7('0x2'));var rs=require(_0xcdf7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcdf7('0x4'));var logger=require(_0xcdf7('0x5'))(_0xcdf7('0x6'));var config=require(_0xcdf7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcdf7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23a6f2,_0x311484,_0x3e2c5e){return new BPromise(function(_0x10919a,_0x547503){return client[_0xcdf7('0x9')](_0x23a6f2,_0x3e2c5e)['then'](function(_0x27c3de){logger[_0xcdf7('0xa')](_0xcdf7('0xb'),_0x311484,_0xcdf7('0xc'));logger[_0xcdf7('0xd')](_0xcdf7('0xe'),_0x311484,'request\x20sent',JSON[_0xcdf7('0xf')](_0x27c3de));if(_0x27c3de[_0xcdf7('0x10')]){if(_0x27c3de[_0xcdf7('0x10')][_0xcdf7('0x11')]===0x1f4){logger['error'](_0xcdf7('0xb'),_0x311484,_0x27c3de[_0xcdf7('0x10')][_0xcdf7('0x12')]);return _0x547503(_0x27c3de['error'][_0xcdf7('0x12')]);}logger[_0xcdf7('0x10')](_0xcdf7('0xb'),_0x311484,_0x27c3de[_0xcdf7('0x10')]['message']);return _0x10919a(_0x27c3de[_0xcdf7('0x10')]['message']);}else{logger[_0xcdf7('0xa')](_0xcdf7('0xb'),_0x311484,'request\x20sent');_0x10919a(_0x27c3de['result'][_0xcdf7('0x12')]);}})['catch'](function(_0x17288e){logger['error'](_0xcdf7('0xb'),_0x311484,_0x17288e);_0x547503(_0x17288e);});});}
\ No newline at end of file
index 67a5d89..01cb30d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e49=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','path'];(function(_0x18ac3f,_0x386630){var _0x4c6563=function(_0xcc161f){while(--_0xcc161f){_0x18ac3f['push'](_0x18ac3f['shift']());}};_0x4c6563(++_0x386630);}(_0x2e49,0x1cb));var _0x92e4=function(_0xb757a,_0x55774f){_0xb757a=_0xb757a-0x0;var _0x55ff22=_0x2e49[_0xb757a];return _0x55ff22;};'use strict';var multer=require(_0x92e4('0x0'));var util=require(_0x92e4('0x1'));var path=require(_0x92e4('0x2'));var timeout=require(_0x92e4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x92e4('0x4'));var auth=require(_0x92e4('0x5'));var interaction=require(_0x92e4('0x6'));var config=require(_0x92e4('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x92e4('0x8')]('/',auth[_0x92e4('0x9')](),controller['index']);router[_0x92e4('0x8')](_0x92e4('0xa'),auth[_0x92e4('0x9')](),controller[_0x92e4('0xb')]);router[_0x92e4('0x8')]('/:id/configurations',auth[_0x92e4('0x9')](),controller['getConfigurations']);router[_0x92e4('0x8')](_0x92e4('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x92e4('0xd')]('/',auth[_0x92e4('0x9')](),controller[_0x92e4('0xe')]);router[_0x92e4('0xd')](_0x92e4('0xf'),auth[_0x92e4('0x9')](),controller['addConfiguration']);router[_0x92e4('0x10')](_0x92e4('0xa'),auth[_0x92e4('0x9')](),controller[_0x92e4('0x11')]);router[_0x92e4('0x12')](_0x92e4('0xa'),auth[_0x92e4('0x9')](),controller[_0x92e4('0x13')]);module[_0x92e4('0x14')]=router;
\ No newline at end of file
+var _0xd752=['../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4d704e,_0x256541){var _0x16dbb1=function(_0x42d65a){while(--_0x42d65a){_0x4d704e['push'](_0x4d704e['shift']());}};_0x16dbb1(++_0x256541);}(_0xd752,0xa9));var _0x2d75=function(_0x46a59e,_0x4bf9ff){_0x46a59e=_0x46a59e-0x0;var _0x35aae0=_0xd752[_0x46a59e];return _0x35aae0;};'use strict';var multer=require(_0x2d75('0x0'));var util=require(_0x2d75('0x1'));var path=require('path');var timeout=require(_0x2d75('0x2'));var express=require(_0x2d75('0x3'));var router=express[_0x2d75('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2d75('0x5'));var interaction=require(_0x2d75('0x6'));var config=require(_0x2d75('0x7'));var controller=require(_0x2d75('0x8'));router[_0x2d75('0x9')]('/',auth[_0x2d75('0xa')](),controller[_0x2d75('0xb')]);router[_0x2d75('0x9')]('/:id',auth[_0x2d75('0xa')](),controller[_0x2d75('0xc')]);router['get']('/:id/configurations',auth[_0x2d75('0xa')](),controller[_0x2d75('0xd')]);router[_0x2d75('0x9')](_0x2d75('0xe'),auth[_0x2d75('0xa')](),controller[_0x2d75('0xf')]);router[_0x2d75('0x10')]('/',auth[_0x2d75('0xa')](),controller[_0x2d75('0x11')]);router[_0x2d75('0x10')](_0x2d75('0x12'),auth[_0x2d75('0xa')](),controller[_0x2d75('0x13')]);router[_0x2d75('0x14')](_0x2d75('0x15'),auth[_0x2d75('0xa')](),controller[_0x2d75('0x16')]);router['delete'](_0x2d75('0x15'),auth[_0x2d75('0xa')](),controller[_0x2d75('0x17')]);module[_0x2d75('0x18')]=router;
\ No newline at end of file
index e537835..d658846 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73ed=['STRING','exports'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0x73ed,0x95));var _0xd73e=function(_0x3ea698,_0x137d79){_0x3ea698=_0x3ea698-0x0;var _0x5480da=_0x73ed[_0x3ea698];return _0x5480da;};'use strict';var Sequelize=require('sequelize');module[_0xd73e('0x0')]={'name':{'type':Sequelize[_0xd73e('0x1')]},'username':{'type':Sequelize[_0xd73e('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xd73e('0x1')]},'tenantId':{'type':Sequelize[_0xd73e('0x1')]},'clientId':{'type':Sequelize[_0xd73e('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd73e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd73e('0x1')]}};
\ No newline at end of file
+var _0x6ce7=['STRING','sequelize','exports'];(function(_0x2382bb,_0x3552e9){var _0x25c761=function(_0x469456){while(--_0x469456){_0x2382bb['push'](_0x2382bb['shift']());}};_0x25c761(++_0x3552e9);}(_0x6ce7,0x76));var _0x76ce=function(_0x406aa9,_0x47a602){_0x406aa9=_0x406aa9-0x0;var _0x1848f5=_0x6ce7[_0x406aa9];return _0x1848f5;};'use strict';var Sequelize=require(_0x76ce('0x0'));module[_0x76ce('0x1')]={'name':{'type':Sequelize[_0x76ce('0x2')]},'username':{'type':Sequelize[_0x76ce('0x2')]},'password':{'type':Sequelize[_0x76ce('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x76ce('0x2')]},'clientId':{'type':Sequelize[_0x76ce('0x2')]},'clientSecret':{'type':Sequelize[_0x76ce('0x2')]},'serverUrl':{'type':Sequelize[_0x76ce('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b452cfe..7e3bdd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8eb=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','filter','options','includeAll','Dynamics365Account','findAll','rows','catch','show','params','intersection','include','find','body','getConfigurations','Dynamics365Configuration','order','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','create','Dynamics365Field','Subjects','getFields','ticketType','PhoneCall','title','customerid','subject','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','password','remoteUri','tenantId','clientId','clientSecret','slice','%s/api/data/v9.0/','POST','username','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(','Attributes','LogicalName','forEach','@odata.type','substring','lastIndexOf','PicklistAttributeMetadata','push','isNil','all','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption',')/Microsoft.Dynamics.CRM.','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8eb,0x179));var _0xba8e=function(_0x193d38,_0x5d4cad){_0x193d38=_0x193d38-0x0;var _0x1294b8=_0xa8eb[_0x193d38];return _0x1294b8;};'use strict';var emlformat=require(_0xba8e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba8e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba8e('0x2'));var moment=require(_0xba8e('0x3'));var BPromise=require(_0xba8e('0x4'));var Mustache=require('mustache');var util=require(_0xba8e('0x5'));var path=require(_0xba8e('0x6'));var sox=require('sox');var csv=require(_0xba8e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba8e('0x8'));var _=require('lodash');var squel=require(_0xba8e('0x9'));var crypto=require(_0xba8e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba8e('0x7'));var querystring=require(_0xba8e('0xb'));var Papa=require(_0xba8e('0xc'));var Redis=require(_0xba8e('0xd'));var authService=require(_0xba8e('0xe'));var qs=require(_0xba8e('0xf'));var as=require(_0xba8e('0x10'));var hardwareService=require(_0xba8e('0x11'));var logger=require(_0xba8e('0x12'))('api');var utils=require(_0xba8e('0x13'));var config=require(_0xba8e('0x14'));var licenseUtil=require(_0xba8e('0x15'));var db=require(_0xba8e('0x16'))['db'];var integrations=require(_0xba8e('0x17'));function respondWithStatusCode(_0x56e63e,_0x4e9f6d){_0x4e9f6d=_0x4e9f6d||0xcc;return function(_0x1b0b0d){if(_0x1b0b0d){return _0x56e63e[_0xba8e('0x18')](_0x4e9f6d);}return _0x56e63e[_0xba8e('0x19')](_0x4e9f6d)[_0xba8e('0x1a')]();};}function respondWithResult(_0xec4952,_0x327fc5){_0x327fc5=_0x327fc5||0xc8;return function(_0x224ec9){if(_0x224ec9){return _0xec4952[_0xba8e('0x19')](_0x327fc5)[_0xba8e('0x1b')](_0x224ec9);}};}function respondWithFilteredResult(_0x310513,_0x414a6e){return function(_0x579249){if(_0x579249){var _0x76810d=typeof _0x414a6e['offset']===_0xba8e('0x1c')&&typeof _0x414a6e[_0xba8e('0x1d')]===_0xba8e('0x1c');var _0x4dbd80=_0x579249[_0xba8e('0x1e')];var _0xbe34dc=_0x76810d?0x0:_0x414a6e[_0xba8e('0x1f')];var _0x390906=_0x76810d?_0x579249[_0xba8e('0x1e')]:_0x414a6e[_0xba8e('0x1f')]+_0x414a6e[_0xba8e('0x1d')];var _0x16284d;if(_0x390906>=_0x4dbd80){_0x390906=_0x4dbd80;_0x16284d=0xc8;}else{_0x16284d=0xce;}_0x310513[_0xba8e('0x19')](_0x16284d);return _0x310513[_0xba8e('0x20')](_0xba8e('0x21'),_0xbe34dc+'-'+_0x390906+'/'+_0x4dbd80)[_0xba8e('0x1b')](_0x579249);}return null;};}function patchUpdates(_0x19b728){return function(_0x3f316d){try{jsonpatch[_0xba8e('0x22')](_0x3f316d,_0x19b728,!![]);}catch(_0x2a18c7){return BPromise[_0xba8e('0x23')](_0x2a18c7);}return _0x3f316d[_0xba8e('0x24')]();};}function saveUpdates(_0x1564fc,_0x49323a){return function(_0x544bea){if(_0x544bea){return _0x544bea['update'](_0x1564fc)[_0xba8e('0x25')](function(_0x7d4ca){return _0x7d4ca;});}return null;};}function removeEntity(_0x5a8ab1,_0x3421b1){return function(_0x55ca98){if(_0x55ca98){return _0x55ca98[_0xba8e('0x26')]()['then'](function(){_0x5a8ab1[_0xba8e('0x19')](0xcc)[_0xba8e('0x1a')]();});}};}function handleEntityNotFound(_0x46dca7,_0x57f4a2){return function(_0x2ea017){if(!_0x2ea017){_0x46dca7[_0xba8e('0x18')](0x194);}return _0x2ea017;};}function handleError(_0x507c31,_0xcbec){_0xcbec=_0xcbec||0x1f4;return function(_0xe1c16f){logger[_0xba8e('0x27')](_0xe1c16f[_0xba8e('0x28')]);if(_0xe1c16f[_0xba8e('0x29')]){delete _0xe1c16f[_0xba8e('0x29')];}_0x507c31[_0xba8e('0x19')](_0xcbec)[_0xba8e('0x2a')](_0xe1c16f);};}exports[_0xba8e('0x2b')]=function(_0x40f988,_0x1abc58){var _0x22571f={},_0x1baffd={},_0x5c0434={'count':0x0,'rows':[]};var _0x385ca6=_['map'](db['Dynamics365Account'][_0xba8e('0x2c')],function(_0x271715){return{'name':_0x271715[_0xba8e('0x2d')],'type':_0x271715['type'][_0xba8e('0x2e')]};});_0x1baffd[_0xba8e('0x2f')]=_[_0xba8e('0x30')](_0x385ca6,_0xba8e('0x29'));_0x1baffd[_0xba8e('0x31')]=_[_0xba8e('0x32')](_0x40f988[_0xba8e('0x31')]);_0x1baffd[_0xba8e('0x33')]=_['intersection'](_0x1baffd['model'],_0x1baffd[_0xba8e('0x31')]);_0x22571f[_0xba8e('0x34')]=_['intersection'](_0x1baffd[_0xba8e('0x2f')],qs['fields'](_0x40f988[_0xba8e('0x31')][_0xba8e('0x35')]));_0x22571f['attributes']=_0x22571f[_0xba8e('0x34')][_0xba8e('0x36')]?_0x22571f['attributes']:_0x1baffd[_0xba8e('0x2f')];if(!_0x40f988[_0xba8e('0x31')][_0xba8e('0x37')](_0xba8e('0x38'))){_0x22571f[_0xba8e('0x1d')]=qs[_0xba8e('0x1d')](_0x40f988[_0xba8e('0x31')]['limit']);_0x22571f[_0xba8e('0x1f')]=qs[_0xba8e('0x1f')](_0x40f988['query'][_0xba8e('0x1f')]);}_0x22571f['order']=qs['sort'](_0x40f988[_0xba8e('0x31')][_0xba8e('0x39')]);_0x22571f['where']=qs[_0xba8e('0x33')](_[_0xba8e('0x3a')](_0x40f988['query'],_0x1baffd['filters']),_0x385ca6);if(_0x40f988[_0xba8e('0x31')]['filter']){_0x22571f[_0xba8e('0x3b')]=_[_0xba8e('0x3c')](_0x22571f[_0xba8e('0x3b')],{'$or':_[_0xba8e('0x30')](_0x385ca6,function(_0x136dd0){if(_0x136dd0[_0xba8e('0x3d')]!=='VIRTUAL'){var _0x2c197a={};_0x2c197a[_0x136dd0[_0xba8e('0x29')]]={'$like':'%'+_0x40f988[_0xba8e('0x31')][_0xba8e('0x3e')]+'%'};return _0x2c197a;}})});}_0x22571f=_[_0xba8e('0x3c')]({},_0x22571f,_0x40f988[_0xba8e('0x3f')]);var _0x5003b0={'where':_0x22571f[_0xba8e('0x3b')]};return db['Dynamics365Account'][_0xba8e('0x1e')](_0x5003b0)[_0xba8e('0x25')](function(_0x43677e){_0x5c0434['count']=_0x43677e;if(_0x40f988[_0xba8e('0x31')][_0xba8e('0x40')]){_0x22571f['include']=[{'all':!![]}];}return db[_0xba8e('0x41')][_0xba8e('0x42')](_0x22571f);})['then'](function(_0x404323){_0x5c0434[_0xba8e('0x43')]=_0x404323;return _0x5c0434;})['then'](respondWithFilteredResult(_0x1abc58,_0x22571f))[_0xba8e('0x44')](handleError(_0x1abc58,null));};exports[_0xba8e('0x45')]=function(_0x5387a8,_0x371877){var _0xd624a6={'raw':![],'where':{'id':_0x5387a8[_0xba8e('0x46')]['id']}},_0x47fc0a={};_0x47fc0a['model']=_[_0xba8e('0x32')](db[_0xba8e('0x41')][_0xba8e('0x2c')]);_0x47fc0a[_0xba8e('0x31')]=_[_0xba8e('0x32')](_0x5387a8['query']);_0x47fc0a['filters']=_[_0xba8e('0x47')](_0x47fc0a[_0xba8e('0x2f')],_0x47fc0a['query']);_0xd624a6[_0xba8e('0x34')]=_[_0xba8e('0x47')](_0x47fc0a[_0xba8e('0x2f')],qs[_0xba8e('0x35')](_0x5387a8[_0xba8e('0x31')][_0xba8e('0x35')]));_0xd624a6[_0xba8e('0x34')]=_0xd624a6[_0xba8e('0x34')][_0xba8e('0x36')]?_0xd624a6[_0xba8e('0x34')]:_0x47fc0a[_0xba8e('0x2f')];if(_0x5387a8[_0xba8e('0x31')][_0xba8e('0x40')]){_0xd624a6[_0xba8e('0x48')]=[{'all':!![]}];}_0xd624a6=_[_0xba8e('0x3c')]({},_0xd624a6,_0x5387a8['options']);return db[_0xba8e('0x41')][_0xba8e('0x49')](_0xd624a6)['then'](handleEntityNotFound(_0x371877,null))[_0xba8e('0x25')](respondWithResult(_0x371877,null))['catch'](handleError(_0x371877,null));};exports['create']=function(_0xefd3b7,_0x191f6e){return db[_0xba8e('0x41')]['create'](_0xefd3b7['body'],{})['then'](respondWithResult(_0x191f6e,0xc9))[_0xba8e('0x44')](handleError(_0x191f6e,null));};exports['update']=function(_0x901bdf,_0x467e8d){if(_0x901bdf['body']['id']){delete _0x901bdf[_0xba8e('0x4a')]['id'];}return db[_0xba8e('0x41')][_0xba8e('0x49')]({'where':{'id':_0x901bdf[_0xba8e('0x46')]['id']}})[_0xba8e('0x25')](handleEntityNotFound(_0x467e8d,null))[_0xba8e('0x25')](saveUpdates(_0x901bdf[_0xba8e('0x4a')],null))['then'](respondWithResult(_0x467e8d,null))[_0xba8e('0x44')](handleError(_0x467e8d,null));};exports[_0xba8e('0x26')]=function(_0x2410d2,_0x3c99ae){return db[_0xba8e('0x41')][_0xba8e('0x49')]({'where':{'id':_0x2410d2[_0xba8e('0x46')]['id']}})[_0xba8e('0x25')](handleEntityNotFound(_0x3c99ae,null))[_0xba8e('0x25')](removeEntity(_0x3c99ae,null))[_0xba8e('0x44')](handleError(_0x3c99ae,null));};exports[_0xba8e('0x4b')]=function(_0xc8d9f1,_0x519c73,_0x232610){var _0xc7db2f={};var _0x288570={};var _0x3fcdee;var _0x3486eb;return db['Dynamics365Account']['findOne']({'where':{'id':_0xc8d9f1[_0xba8e('0x46')]['id']}})[_0xba8e('0x25')](handleEntityNotFound(_0x519c73,null))[_0xba8e('0x25')](function(_0x787449){if(_0x787449){_0x3fcdee=_0x787449;_0x288570['model']=_[_0xba8e('0x32')](db[_0xba8e('0x4c')][_0xba8e('0x2c')]);_0x288570[_0xba8e('0x31')]=_[_0xba8e('0x32')](_0xc8d9f1['query']);_0x288570[_0xba8e('0x33')]=_[_0xba8e('0x47')](_0x288570['model'],_0x288570[_0xba8e('0x31')]);_0xc7db2f['attributes']=_[_0xba8e('0x47')](_0x288570[_0xba8e('0x2f')],qs[_0xba8e('0x35')](_0xc8d9f1[_0xba8e('0x31')][_0xba8e('0x35')]));_0xc7db2f[_0xba8e('0x34')]=_0xc7db2f['attributes'][_0xba8e('0x36')]?_0xc7db2f[_0xba8e('0x34')]:_0x288570[_0xba8e('0x2f')];_0xc7db2f[_0xba8e('0x4d')]=qs['sort'](_0xc8d9f1['query']['sort']);_0xc7db2f[_0xba8e('0x3b')]=qs['filters'](_[_0xba8e('0x3a')](_0xc8d9f1[_0xba8e('0x31')],_0x288570[_0xba8e('0x33')]));if(_0xc8d9f1[_0xba8e('0x31')][_0xba8e('0x3e')]){_0xc7db2f[_0xba8e('0x3b')]=_[_0xba8e('0x3c')](_0xc7db2f[_0xba8e('0x3b')],{'$or':_[_0xba8e('0x30')](_0xc7db2f['attributes'],function(_0x5c41c2){var _0x25ffdf={};_0x25ffdf[_0x5c41c2]={'$like':'%'+_0xc8d9f1[_0xba8e('0x31')][_0xba8e('0x3e')]+'%'};return _0x25ffdf;})});}_0xc7db2f=_[_0xba8e('0x3c')]({},_0xc7db2f,_0xc8d9f1[_0xba8e('0x3f')]);return _0x3fcdee[_0xba8e('0x4b')](_0xc7db2f);}})[_0xba8e('0x25')](function(_0x48662f){if(_0x48662f){_0x3486eb=_0x48662f['length'];if(!_0xc8d9f1[_0xba8e('0x31')]['hasOwnProperty']('nolimit')){_0xc7db2f['limit']=qs[_0xba8e('0x1d')](_0xc8d9f1[_0xba8e('0x31')][_0xba8e('0x1d')]);_0xc7db2f[_0xba8e('0x1f')]=qs[_0xba8e('0x1f')](_0xc8d9f1[_0xba8e('0x31')][_0xba8e('0x1f')]);}return _0x3fcdee[_0xba8e('0x4b')](_0xc7db2f);}})[_0xba8e('0x25')](function(_0x3aac13){if(_0x3aac13){return _0x3aac13?{'count':_0x3486eb,'rows':_0x3aac13}:null;}})['then'](respondWithResult(_0x519c73,null))[_0xba8e('0x44')](handleError(_0x519c73,null));};exports['addConfiguration']=function(_0x443499,_0x9338a7,_0x1e4111){if(_0x443499[_0xba8e('0x4a')]['id']){delete _0x443499[_0xba8e('0x4a')]['id'];}return db[_0xba8e('0x41')][_0xba8e('0x4e')]({'where':{'id':_0x443499[_0xba8e('0x46')]['id']}})[_0xba8e('0x25')](handleEntityNotFound(_0x9338a7,null))['then'](function(_0x33aecb){if(_0x33aecb){_0x443499['body'][_0xba8e('0x4f')]=_0x33aecb['id'];_0x443499[_0xba8e('0x4a')]['Subjects']=integrations[_0xba8e('0x50')](_0x443499[_0xba8e('0x4a')][_0xba8e('0x51')],_0x443499[_0xba8e('0x4a')]['type']);_0x443499[_0xba8e('0x4a')][_0xba8e('0x52')]=integrations[_0xba8e('0x53')](_0x443499[_0xba8e('0x4a')][_0xba8e('0x51')],_0x443499[_0xba8e('0x4a')][_0xba8e('0x3d')]);return db[_0xba8e('0x4c')][_0xba8e('0x54')](_0x443499['body'],{'include':[{'model':db[_0xba8e('0x55')],'as':_0xba8e('0x56')},{'model':db[_0xba8e('0x55')],'as':_0xba8e('0x52')}]});}return null;})[_0xba8e('0x25')](respondWithResult(_0x9338a7,null))[_0xba8e('0x44')](handleError(_0x9338a7,null));};exports[_0xba8e('0x57')]=function(_0x38c3ab,_0x570b13,_0x3772d3){var _0x2bb383=_0x38c3ab['query'][_0xba8e('0x58')];var _0x5be6c3=_0x2bb383==='incident'?'Incident':_0xba8e('0x59');var _0x4a1e54='';var _0x1958db='';var _0x1f820d='';var _0x226286='';var _0x2de86b='';var _0x30c2d5='';var _0x6e7565='';var _0x212ac0='';var _0x2aeef7=[_0xba8e('0x5a'),'description',_0xba8e('0x5b'),'ownerid','caseorigincode',_0xba8e('0x5c'),'phonenumber','regardingobjectid',_0xba8e('0x5d'),'phonecall_activity_parties'];var _0x58c222=[_0xba8e('0x5e'),'accountidyominame',_0xba8e('0x5f'),_0xba8e('0x60'),_0xba8e('0x61'),'contactidyominame','contractdetailidname',_0xba8e('0x62'),_0xba8e('0x63'),'createdbyexternalpartyyominame',_0xba8e('0x64'),'createdbyyominame',_0xba8e('0x65'),'createdonbehalfbyname',_0xba8e('0x66'),_0xba8e('0x67'),_0xba8e('0x68'),'customeridyominame',_0xba8e('0x69'),'entitlementidname',_0xba8e('0x6a'),_0xba8e('0x6b'),_0xba8e('0x6c'),_0xba8e('0x6d'),_0xba8e('0x6e'),_0xba8e('0x6f'),'importsequencenumber',_0xba8e('0x70'),_0xba8e('0x71'),_0xba8e('0x72'),_0xba8e('0x73'),_0xba8e('0x74'),_0xba8e('0x75'),_0xba8e('0x76'),'modifiedbyyominame',_0xba8e('0x77'),'modifiedonbehalfbyname',_0xba8e('0x78'),_0xba8e('0x79'),_0xba8e('0x7a'),_0xba8e('0x7b'),'onholdtime',_0xba8e('0x7c'),_0xba8e('0x7d'),_0xba8e('0x7e'),_0xba8e('0x7f'),'parentcaseidname',_0xba8e('0x80'),_0xba8e('0x81'),_0xba8e('0x82'),_0xba8e('0x83'),_0xba8e('0x84'),_0xba8e('0x85'),_0xba8e('0x86'),_0xba8e('0x87'),_0xba8e('0x88'),_0xba8e('0x89'),_0xba8e('0x8a'),'slainvokedidname',_0xba8e('0x8b'),_0xba8e('0x8c'),_0xba8e('0x8d'),_0xba8e('0x8e'),_0xba8e('0x8f'),_0xba8e('0x90'),_0xba8e('0x91'),_0xba8e('0x92'),_0xba8e('0x93'),'utcconversiontimezonecode','versionnumber'];var _0x16fd59=_0x2aeef7[_0xba8e('0x94')](_0x58c222);return db[_0xba8e('0x41')][_0xba8e('0x4e')]({'where':{'id':_0x38c3ab['params']['id']},'attributes':['id','username',_0xba8e('0x95'),_0xba8e('0x96'),_0xba8e('0x97'),_0xba8e('0x98'),_0xba8e('0x99')]})[_0xba8e('0x25')](handleEntityNotFound(_0x570b13,null))[_0xba8e('0x25')](function(_0x3f999a){if(_0x3f999a){_0x212ac0=_0x3f999a[_0xba8e('0x96')];var _0xf0540d=_0x212ac0[_0xba8e('0x9a')](-0x1);if(_0xf0540d==='/'){_0x212ac0=_0x212ac0['substring'](0x0,_0x212ac0['lastIndexOf'](_0xf0540d));}_0x6e7565=util['format'](_0xba8e('0x9b'),_0x212ac0);var _0x5addad={'method':_0xba8e('0x9c'),'uri':'https://login.microsoftonline.com/'+_0x3f999a[_0xba8e('0x97')]+'/oauth2/token','form':{'client_id':_0x3f999a[_0xba8e('0x98')],'resource':_0x212ac0,'username':_0x3f999a[_0xba8e('0x9d')],'password':_0x3f999a[_0xba8e('0x95')],'grant_type':_0xba8e('0x95'),'client_secret':_0x3f999a[_0xba8e('0x99')]},'json':!![]};return rp(_0x5addad);}})[_0xba8e('0x25')](function(_0x57318c){_0x30c2d5=_0x57318c[_0xba8e('0x9e')];var _0x1e5082={'method':'GET','uri':encodeURI(_0x6e7565+_0xba8e('0x9f')+_0x5be6c3+'\x27'),'headers':{'Authorization':_0xba8e('0xa0')+_0x30c2d5,'If-None-Match':null,'OData-Version':_0xba8e('0xa1')},'json':!![]};return rp(_0x1e5082);})[_0xba8e('0x25')](function(_0x52f4eb){var _0x2b9100=_0x52f4eb[_0xba8e('0xa2')][0x0];var _0x25aebc=_0x2b9100[_0xba8e('0xa3')];var _0x5cfc27={'method':_0xba8e('0xa4'),'uri':_0x6e7565+_0xba8e('0xa5')+_0x25aebc+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xba8e('0xa0')+_0x30c2d5,'If-None-Match':null,'OData-Version':_0xba8e('0xa1')},'json':!![]};return rp(_0x5cfc27);})[_0xba8e('0x25')](function(_0x40f3d9){_0x4a1e54=_0x40f3d9;_0x1958db=_0x4a1e54[_0xba8e('0xa6')];_0x1958db=_['remove'](_0x1958db,function(_0x3f4d58){return!_0x16fd59['includes'](_0x3f4d58[_0xba8e('0xa7')]);});var _0x2373ad=[];var _0x70a335=[];_0x1958db[_0xba8e('0xa8')](function(_0x44c77d){if(_0x44c77d[_0xba8e('0xa9')]){var _0x56426f=_0x44c77d[_0xba8e('0xa9')][_0xba8e('0xaa')](_0x44c77d[_0xba8e('0xa9')][_0xba8e('0xab')]('.')+0x1);if(_0x56426f===_0xba8e('0xac')){_0x2373ad[_0xba8e('0xad')](getSelectList(_0x6e7565,_0x2bb383,_0x70a335,_0x4a1e54[_0xba8e('0xa3')],_0x44c77d[_0xba8e('0xa3')],_0x30c2d5));}}});return Promise['all'](_0x2373ad);})['then'](function(_0x4bfd72){_0x1f820d=_0x4bfd72[0x0];var _0x2cf42a=[];var _0xc2430c=[];_0x1958db[_0xba8e('0xa8')](function(_0x49d565){if(!_[_0xba8e('0xae')](_0x49d565[_0xba8e('0xa9')])){var _0x32abfb=_0x49d565[_0xba8e('0xa9')]['substring'](_0x49d565[_0xba8e('0xa9')][_0xba8e('0xab')]('.')+0x1);if(_0x32abfb==='BooleanAttributeMetadata'){_0x2cf42a['push'](getBooleanList(_0x6e7565,_0x2bb383,_0xc2430c,_0x4a1e54[_0xba8e('0xa3')],_0x49d565[_0xba8e('0xa3')],_0x30c2d5));}}});return Promise[_0xba8e('0xaf')](_0x2cf42a);})[_0xba8e('0x25')](function(_0x54f0fd){_0x226286=_0x54f0fd[0x0];var _0x3e82be=[];var _0x5bfbdf=[];_0x1958db[_0xba8e('0xa8')](function(_0x112493){if(_0x112493[_0xba8e('0xa9')]){var _0x35dac5=_0x112493[_0xba8e('0xa9')][_0xba8e('0xaa')](_0x112493['@odata.type']['lastIndexOf']('.')+0x1);if(_0x35dac5==='StringAttributeMetadata'||_0x35dac5===_0xba8e('0xb0')||_0x35dac5===_0xba8e('0xb1')||_0x35dac5==='IntegerAttributeMetadata'||_0x35dac5==='MemoAttributeMetadata'||_0x35dac5===_0xba8e('0xb2')||_0x35dac5===_0xba8e('0xb3')||_0x35dac5===_0xba8e('0xb4')||_0x35dac5===_0xba8e('0xb5')||_0x35dac5==='DecimalAttributeMetadata'){_0x3e82be[_0xba8e('0xad')](getInputList(_0x6e7565,_0x2bb383,_0x35dac5,_0x5bfbdf,_0x4a1e54[_0xba8e('0xa3')],_0x112493['MetadataId'],_0x30c2d5));}}});return Promise[_0xba8e('0xaf')](_0x3e82be);})[_0xba8e('0x25')](function(_0x50ddce){_0x2de86b=_0x50ddce[0x0];var _0xb7b48c=_0x1f820d[_0xba8e('0x94')](_0x226286)['concat'](_0x2de86b);var _0x28e836={'count':_0xb7b48c[_0xba8e('0x36')],'rows':_0xb7b48c};return _0x28e836;})['then'](respondWithResult(_0x570b13,null))[_0xba8e('0x44')](function(_0x4117a0){var _0x4f201d=_0x38c3ab[_0xba8e('0x31')][_0xba8e('0xb6')]?0x1f4:_0x4117a0['statusCode']||0x1f4;logger[_0xba8e('0x27')](_0x4117a0[_0xba8e('0x28')]);delete _0x4117a0[_0xba8e('0x29')];if(_0x4f201d===0x191){_0x4f201d=0x190;}_0x570b13['status'](_0x4f201d)[_0xba8e('0x2a')](_0x38c3ab[_0xba8e('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4117a0[_0xba8e('0xb7')]}:_0x4117a0);});};function getSelectList(_0x2c9e24,_0x2907d4,_0x5c7843,_0x406d16,_0x5b2248,_0x5e3749){var _0x5bb9e4={'method':_0xba8e('0xa4'),'uri':_0x2c9e24+_0xba8e('0xa5')+_0x406d16+_0xba8e('0xb8')+_0x5b2248+_0xba8e('0xb9')+_0xba8e('0xba'),'headers':{'Authorization':_0xba8e('0xa0')+_0x5e3749,'If-None-Match':null,'OData-Version':_0xba8e('0xa1')},'json':!![]};return rp(_0x5bb9e4)[_0xba8e('0x25')](function(_0x48c97c){var _0x100b4f=[];var _0xdb31e7=_0x48c97c[_0xba8e('0xbb')][_0xba8e('0xbc')];_0xdb31e7[_0xba8e('0xa8')](function(_0x12ff93){_0x100b4f[_0xba8e('0xad')]({'name':_0x12ff93['Label'][_0xba8e('0xbd')][_0xba8e('0xbe')],'value':String(_0x12ff93[_0xba8e('0xbf')])});});var _0x5702e7={'id':_0x2907d4+'_'+_0x48c97c[_0xba8e('0xa7')],'name':_0x48c97c[_0xba8e('0xc0')][_0xba8e('0xbd')][_0xba8e('0xbe')],'custom':![],'options':_0x100b4f};_0x5c7843[_0xba8e('0xad')](_0x5702e7);return _0x5c7843;});}function getBooleanList(_0x4fcf33,_0x571e90,_0x4d9852,_0x5d9c3a,_0x587115,_0x31bb16){var _0x5195be={'method':_0xba8e('0xa4'),'uri':_0x4fcf33+'EntityDefinitions('+_0x5d9c3a+')/Attributes('+_0x587115+_0xba8e('0xc1'),'headers':{'Authorization':_0xba8e('0xa0')+_0x31bb16,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5195be)[_0xba8e('0x25')](function(_0x286f92){var _0x1e2b13=[];_0x1e2b13[_0xba8e('0xad')]({'name':_0x286f92[_0xba8e('0xbb')]['TrueOption'][_0xba8e('0xbe')]['UserLocalizedLabel'][_0xba8e('0xbe')],'value':_0xba8e('0xc2')},{'name':_0x286f92[_0xba8e('0xbb')][_0xba8e('0xc3')][_0xba8e('0xbe')][_0xba8e('0xbd')][_0xba8e('0xbe')],'value':'false'});var _0x413ef6={'id':_0x571e90+'_'+_0x286f92[_0xba8e('0xa7')],'name':_0x286f92[_0xba8e('0xc0')][_0xba8e('0xbd')][_0xba8e('0xbe')],'custom':![],'options':_0x1e2b13};_0x4d9852[_0xba8e('0xad')](_0x413ef6);return _0x4d9852;});}function getInputList(_0x38ac5b,_0xa12860,_0x1a57ba,_0x15a949,_0x1a3e3e,_0x234ea6,_0x4a7508){var _0x4111d7={'method':_0xba8e('0xa4'),'uri':_0x38ac5b+'EntityDefinitions('+_0x1a3e3e+_0xba8e('0xb8')+_0x234ea6+_0xba8e('0xc4')+_0x1a57ba+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xba8e('0xa0')+_0x4a7508,'If-None-Match':null,'OData-Version':_0xba8e('0xa1')},'json':!![]};return rp(_0x4111d7)[_0xba8e('0x25')](function(_0x3fad24){var _0x55533d={'id':_0xa12860+'_'+_0x3fad24[_0xba8e('0xa7')],'name':_0x3fad24['DisplayName'][_0xba8e('0xbd')]?_0x3fad24[_0xba8e('0xc0')]['UserLocalizedLabel'][_0xba8e('0xbe')]:_0x3fad24['LogicalName'],'custom':![],'options':[]};_0x15a949[_0xba8e('0xad')](_0x55533d);return _0x15a949;});}
\ No newline at end of file
+var _0x3140=['../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','Dynamics365Account','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','includeAll','include','rows','catch','show','params','keys','options','create','body','find','getConfigurations','findOne','Dynamics365Configuration','sort','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','ticketType','incident','PhoneCall','customerid','ownerid','caseorigincode','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidyominame','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientSecret','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','includes','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','isNil','BooleanAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4e9749,_0x2ddac7){var _0x3cfc03=function(_0x420d0e){while(--_0x420d0e){_0x4e9749['push'](_0x4e9749['shift']());}};_0x3cfc03(++_0x2ddac7);}(_0x3140,0xaf));var _0x0314=function(_0x478708,_0x816b6c){_0x478708=_0x478708-0x0;var _0x5c4bf0=_0x3140[_0x478708];return _0x5c4bf0;};'use strict';var emlformat=require(_0x0314('0x0'));var rimraf=require(_0x0314('0x1'));var zipdir=require(_0x0314('0x2'));var jsonpatch=require(_0x0314('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0314('0x4'));var Mustache=require(_0x0314('0x5'));var util=require(_0x0314('0x6'));var path=require(_0x0314('0x7'));var sox=require(_0x0314('0x8'));var csv=require(_0x0314('0x9'));var ejs=require(_0x0314('0xa'));var fs=require('fs');var fs_extra=require(_0x0314('0xb'));var _=require(_0x0314('0xc'));var squel=require(_0x0314('0xd'));var crypto=require(_0x0314('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0314('0xf'));var toCsv=require(_0x0314('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0314('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0314('0x11'));var as=require(_0x0314('0x12'));var hardwareService=require(_0x0314('0x13'));var logger=require(_0x0314('0x14'))(_0x0314('0x15'));var utils=require(_0x0314('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0314('0x17'));var db=require(_0x0314('0x18'))['db'];var integrations=require(_0x0314('0x19'));function respondWithStatusCode(_0x4602ec,_0x153077){_0x153077=_0x153077||0xcc;return function(_0x4318d6){if(_0x4318d6){return _0x4602ec[_0x0314('0x1a')](_0x153077);}return _0x4602ec['status'](_0x153077)[_0x0314('0x1b')]();};}function respondWithResult(_0xbe0b07,_0x1316a0){_0x1316a0=_0x1316a0||0xc8;return function(_0x12d026){if(_0x12d026){return _0xbe0b07[_0x0314('0x1c')](_0x1316a0)[_0x0314('0x1d')](_0x12d026);}};}function respondWithFilteredResult(_0x413bfa,_0x3ea356){return function(_0x5e460f){if(_0x5e460f){var _0xb9730b=typeof _0x3ea356[_0x0314('0x1e')]===_0x0314('0x1f')&&typeof _0x3ea356['limit']===_0x0314('0x1f');var _0x5f2e82=_0x5e460f['count'];var _0x39db0b=_0xb9730b?0x0:_0x3ea356[_0x0314('0x1e')];var _0x583d39=_0xb9730b?_0x5e460f[_0x0314('0x20')]:_0x3ea356[_0x0314('0x1e')]+_0x3ea356['limit'];var _0x1a25cf;if(_0x583d39>=_0x5f2e82){_0x583d39=_0x5f2e82;_0x1a25cf=0xc8;}else{_0x1a25cf=0xce;}_0x413bfa['status'](_0x1a25cf);return _0x413bfa[_0x0314('0x21')](_0x0314('0x22'),_0x39db0b+'-'+_0x583d39+'/'+_0x5f2e82)[_0x0314('0x1d')](_0x5e460f);}return null;};}function patchUpdates(_0x77ddfd){return function(_0x3bdb1){try{jsonpatch[_0x0314('0x23')](_0x3bdb1,_0x77ddfd,!![]);}catch(_0x4d3bc6){return BPromise['reject'](_0x4d3bc6);}return _0x3bdb1[_0x0314('0x24')]();};}function saveUpdates(_0xbd3ad0,_0x1945f8){return function(_0x174119){if(_0x174119){return _0x174119[_0x0314('0x25')](_0xbd3ad0)[_0x0314('0x26')](function(_0x58a1c9){return _0x58a1c9;});}return null;};}function removeEntity(_0x3c743e,_0x43fb0e){return function(_0x590e94){if(_0x590e94){return _0x590e94[_0x0314('0x27')]()[_0x0314('0x26')](function(){_0x3c743e[_0x0314('0x1c')](0xcc)[_0x0314('0x1b')]();});}};}function handleEntityNotFound(_0x867cf7,_0x3af9d3){return function(_0x5d5b13){if(!_0x5d5b13){_0x867cf7[_0x0314('0x1a')](0x194);}return _0x5d5b13;};}function handleError(_0x2e0c77,_0x2d636b){_0x2d636b=_0x2d636b||0x1f4;return function(_0x47c2d1){logger[_0x0314('0x28')](_0x47c2d1[_0x0314('0x29')]);if(_0x47c2d1['name']){delete _0x47c2d1['name'];}_0x2e0c77[_0x0314('0x1c')](_0x2d636b)[_0x0314('0x2a')](_0x47c2d1);};}exports['index']=function(_0x1c3dfd,_0x288535){var _0x5291c2={},_0x547ab3={},_0x15fbfb={'count':0x0,'rows':[]};var _0x345cef=_['map'](db[_0x0314('0x2b')][_0x0314('0x2c')],function(_0x3d6652){return{'name':_0x3d6652['fieldName'],'type':_0x3d6652[_0x0314('0x2d')][_0x0314('0x2e')]};});_0x547ab3[_0x0314('0x2f')]=_[_0x0314('0x30')](_0x345cef,'name');_0x547ab3[_0x0314('0x31')]=_['keys'](_0x1c3dfd['query']);_0x547ab3[_0x0314('0x32')]=_[_0x0314('0x33')](_0x547ab3[_0x0314('0x2f')],_0x547ab3['query']);_0x5291c2[_0x0314('0x34')]=_['intersection'](_0x547ab3[_0x0314('0x2f')],qs['fields'](_0x1c3dfd['query'][_0x0314('0x35')]));_0x5291c2['attributes']=_0x5291c2[_0x0314('0x34')][_0x0314('0x36')]?_0x5291c2[_0x0314('0x34')]:_0x547ab3[_0x0314('0x2f')];if(!_0x1c3dfd[_0x0314('0x31')][_0x0314('0x37')](_0x0314('0x38'))){_0x5291c2['limit']=qs[_0x0314('0x39')](_0x1c3dfd[_0x0314('0x31')][_0x0314('0x39')]);_0x5291c2[_0x0314('0x1e')]=qs[_0x0314('0x1e')](_0x1c3dfd[_0x0314('0x31')]['offset']);}_0x5291c2[_0x0314('0x3a')]=qs['sort'](_0x1c3dfd[_0x0314('0x31')]['sort']);_0x5291c2[_0x0314('0x3b')]=qs['filters'](_['pick'](_0x1c3dfd['query'],_0x547ab3[_0x0314('0x32')]),_0x345cef);if(_0x1c3dfd[_0x0314('0x31')][_0x0314('0x3c')]){_0x5291c2[_0x0314('0x3b')]=_[_0x0314('0x3d')](_0x5291c2['where'],{'$or':_[_0x0314('0x30')](_0x345cef,function(_0x2457b4){if(_0x2457b4[_0x0314('0x2d')]!=='VIRTUAL'){var _0x273f2c={};_0x273f2c[_0x2457b4['name']]={'$like':'%'+_0x1c3dfd[_0x0314('0x31')]['filter']+'%'};return _0x273f2c;}})});}_0x5291c2=_[_0x0314('0x3d')]({},_0x5291c2,_0x1c3dfd['options']);var _0x57c748={'where':_0x5291c2[_0x0314('0x3b')]};return db[_0x0314('0x2b')]['count'](_0x57c748)[_0x0314('0x26')](function(_0x522055){_0x15fbfb[_0x0314('0x20')]=_0x522055;if(_0x1c3dfd[_0x0314('0x31')][_0x0314('0x3e')]){_0x5291c2[_0x0314('0x3f')]=[{'all':!![]}];}return db[_0x0314('0x2b')]['findAll'](_0x5291c2);})[_0x0314('0x26')](function(_0x37c07e){_0x15fbfb[_0x0314('0x40')]=_0x37c07e;return _0x15fbfb;})['then'](respondWithFilteredResult(_0x288535,_0x5291c2))[_0x0314('0x41')](handleError(_0x288535,null));};exports[_0x0314('0x42')]=function(_0x47525f,_0x599473){var _0x2b328c={'raw':![],'where':{'id':_0x47525f[_0x0314('0x43')]['id']}},_0x596216={};_0x596216[_0x0314('0x2f')]=_[_0x0314('0x44')](db['Dynamics365Account'][_0x0314('0x2c')]);_0x596216[_0x0314('0x31')]=_['keys'](_0x47525f['query']);_0x596216['filters']=_[_0x0314('0x33')](_0x596216[_0x0314('0x2f')],_0x596216[_0x0314('0x31')]);_0x2b328c['attributes']=_[_0x0314('0x33')](_0x596216[_0x0314('0x2f')],qs[_0x0314('0x35')](_0x47525f[_0x0314('0x31')][_0x0314('0x35')]));_0x2b328c['attributes']=_0x2b328c[_0x0314('0x34')][_0x0314('0x36')]?_0x2b328c[_0x0314('0x34')]:_0x596216[_0x0314('0x2f')];if(_0x47525f[_0x0314('0x31')][_0x0314('0x3e')]){_0x2b328c[_0x0314('0x3f')]=[{'all':!![]}];}_0x2b328c=_['merge']({},_0x2b328c,_0x47525f[_0x0314('0x45')]);return db[_0x0314('0x2b')]['find'](_0x2b328c)[_0x0314('0x26')](handleEntityNotFound(_0x599473,null))[_0x0314('0x26')](respondWithResult(_0x599473,null))[_0x0314('0x41')](handleError(_0x599473,null));};exports['create']=function(_0x4a1850,_0x128889){return db[_0x0314('0x2b')][_0x0314('0x46')](_0x4a1850[_0x0314('0x47')],{})[_0x0314('0x26')](respondWithResult(_0x128889,0xc9))[_0x0314('0x41')](handleError(_0x128889,null));};exports[_0x0314('0x25')]=function(_0x478b8b,_0x3fc699){if(_0x478b8b['body']['id']){delete _0x478b8b[_0x0314('0x47')]['id'];}return db[_0x0314('0x2b')][_0x0314('0x48')]({'where':{'id':_0x478b8b[_0x0314('0x43')]['id']}})[_0x0314('0x26')](handleEntityNotFound(_0x3fc699,null))['then'](saveUpdates(_0x478b8b['body'],null))[_0x0314('0x26')](respondWithResult(_0x3fc699,null))[_0x0314('0x41')](handleError(_0x3fc699,null));};exports[_0x0314('0x27')]=function(_0x26ecb7,_0x5b3c49){return db[_0x0314('0x2b')][_0x0314('0x48')]({'where':{'id':_0x26ecb7[_0x0314('0x43')]['id']}})[_0x0314('0x26')](handleEntityNotFound(_0x5b3c49,null))[_0x0314('0x26')](removeEntity(_0x5b3c49,null))[_0x0314('0x41')](handleError(_0x5b3c49,null));};exports[_0x0314('0x49')]=function(_0x55f806,_0x28ca8f,_0x9d4b1e){var _0x2fed7d={};var _0x577a91={};var _0x123916;var _0x11695d;return db['Dynamics365Account'][_0x0314('0x4a')]({'where':{'id':_0x55f806[_0x0314('0x43')]['id']}})[_0x0314('0x26')](handleEntityNotFound(_0x28ca8f,null))[_0x0314('0x26')](function(_0x544a03){if(_0x544a03){_0x123916=_0x544a03;_0x577a91[_0x0314('0x2f')]=_[_0x0314('0x44')](db[_0x0314('0x4b')][_0x0314('0x2c')]);_0x577a91[_0x0314('0x31')]=_[_0x0314('0x44')](_0x55f806[_0x0314('0x31')]);_0x577a91[_0x0314('0x32')]=_[_0x0314('0x33')](_0x577a91[_0x0314('0x2f')],_0x577a91['query']);_0x2fed7d[_0x0314('0x34')]=_[_0x0314('0x33')](_0x577a91[_0x0314('0x2f')],qs[_0x0314('0x35')](_0x55f806[_0x0314('0x31')][_0x0314('0x35')]));_0x2fed7d[_0x0314('0x34')]=_0x2fed7d['attributes']['length']?_0x2fed7d['attributes']:_0x577a91[_0x0314('0x2f')];_0x2fed7d[_0x0314('0x3a')]=qs['sort'](_0x55f806[_0x0314('0x31')][_0x0314('0x4c')]);_0x2fed7d[_0x0314('0x3b')]=qs['filters'](_['pick'](_0x55f806[_0x0314('0x31')],_0x577a91[_0x0314('0x32')]));if(_0x55f806['query'][_0x0314('0x3c')]){_0x2fed7d['where']=_[_0x0314('0x3d')](_0x2fed7d[_0x0314('0x3b')],{'$or':_[_0x0314('0x30')](_0x2fed7d[_0x0314('0x34')],function(_0x4c4420){var _0x9c35f1={};_0x9c35f1[_0x4c4420]={'$like':'%'+_0x55f806[_0x0314('0x31')][_0x0314('0x3c')]+'%'};return _0x9c35f1;})});}_0x2fed7d=_['merge']({},_0x2fed7d,_0x55f806[_0x0314('0x45')]);return _0x123916[_0x0314('0x49')](_0x2fed7d);}})[_0x0314('0x26')](function(_0x1ed23a){if(_0x1ed23a){_0x11695d=_0x1ed23a[_0x0314('0x36')];if(!_0x55f806[_0x0314('0x31')][_0x0314('0x37')]('nolimit')){_0x2fed7d[_0x0314('0x39')]=qs['limit'](_0x55f806['query'][_0x0314('0x39')]);_0x2fed7d['offset']=qs[_0x0314('0x1e')](_0x55f806[_0x0314('0x31')][_0x0314('0x1e')]);}return _0x123916[_0x0314('0x49')](_0x2fed7d);}})[_0x0314('0x26')](function(_0x308985){if(_0x308985){return _0x308985?{'count':_0x11695d,'rows':_0x308985}:null;}})[_0x0314('0x26')](respondWithResult(_0x28ca8f,null))[_0x0314('0x41')](handleError(_0x28ca8f,null));};exports['addConfiguration']=function(_0x545bd8,_0x524fce,_0x277979){if(_0x545bd8[_0x0314('0x47')]['id']){delete _0x545bd8['body']['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x545bd8[_0x0314('0x43')]['id']}})[_0x0314('0x26')](handleEntityNotFound(_0x524fce,null))['then'](function(_0x273dc6){if(_0x273dc6){_0x545bd8[_0x0314('0x47')][_0x0314('0x4d')]=_0x273dc6['id'];_0x545bd8[_0x0314('0x47')][_0x0314('0x4e')]=integrations[_0x0314('0x4f')](_0x545bd8['body'][_0x0314('0x50')],_0x545bd8[_0x0314('0x47')][_0x0314('0x2d')]);_0x545bd8['body'][_0x0314('0x51')]=integrations[_0x0314('0x52')](_0x545bd8[_0x0314('0x47')]['channel'],_0x545bd8[_0x0314('0x47')][_0x0314('0x2d')]);return db['Dynamics365Configuration'][_0x0314('0x46')](_0x545bd8[_0x0314('0x47')],{'include':[{'model':db[_0x0314('0x53')],'as':_0x0314('0x4e')},{'model':db[_0x0314('0x53')],'as':'Descriptions'}]});}return null;})[_0x0314('0x26')](respondWithResult(_0x524fce,null))[_0x0314('0x41')](handleError(_0x524fce,null));};exports['getFields']=function(_0x58f666,_0x186dde,_0x381a5d){var _0x30726f=_0x58f666[_0x0314('0x31')][_0x0314('0x54')];var _0x2bcaf5=_0x30726f===_0x0314('0x55')?'Incident':_0x0314('0x56');var _0x1b6cc5='';var _0x1cbdd7='';var _0x11fb3f='';var _0x5d990c='';var _0xfc1bbe='';var _0x10c942='';var _0x576190='';var _0xf38fa4='';var _0x24a6a5=['title','description',_0x0314('0x57'),_0x0314('0x58'),_0x0314('0x59'),'subject','phonenumber',_0x0314('0x5a'),_0x0314('0x5b'),_0x0314('0x5c')];var _0xd5c054=[_0x0314('0x5d'),'accountidyominame',_0x0314('0x5e'),_0x0314('0x5f'),_0x0314('0x60'),_0x0314('0x61'),_0x0314('0x62'),_0x0314('0x63'),_0x0314('0x64'),_0x0314('0x65'),_0x0314('0x66'),'createdbyyominame',_0x0314('0x67'),_0x0314('0x68'),_0x0314('0x69'),_0x0314('0x6a'),_0x0314('0x6b'),_0x0314('0x6c'),_0x0314('0x6d'),_0x0314('0x6e'),_0x0314('0x6f'),_0x0314('0x70'),_0x0314('0x71'),'exchangerate',_0x0314('0x72'),_0x0314('0x73'),_0x0314('0x74'),'influencescore',_0x0314('0x75'),_0x0314('0x76'),_0x0314('0x77'),_0x0314('0x78'),_0x0314('0x79'),_0x0314('0x7a'),_0x0314('0x7b'),_0x0314('0x7c'),_0x0314('0x7d'),_0x0314('0x7e'),_0x0314('0x7f'),'msdyn_iotalertname',_0x0314('0x80'),_0x0314('0x81'),_0x0314('0x82'),_0x0314('0x83'),_0x0314('0x84'),'owneridyominame',_0x0314('0x85'),'primarycontactidname',_0x0314('0x86'),'prioritycodename','productidname',_0x0314('0x87'),'resolveby',_0x0314('0x88'),_0x0314('0x89'),_0x0314('0x8a'),_0x0314('0x8b'),'sentimentvalue',_0x0314('0x8c'),_0x0314('0x8d'),'socialprofileidname',_0x0314('0x8e'),'statuscode',_0x0314('0x8f'),_0x0314('0x90'),_0x0314('0x91'),_0x0314('0x92'),_0x0314('0x93'),_0x0314('0x94'),'versionnumber'];var _0x2bd970=_0x24a6a5[_0x0314('0x95')](_0xd5c054);return db[_0x0314('0x2b')][_0x0314('0x4a')]({'where':{'id':_0x58f666[_0x0314('0x43')]['id']},'attributes':['id',_0x0314('0x96'),_0x0314('0x97'),_0x0314('0x98'),_0x0314('0x99'),'clientId',_0x0314('0x9a')]})[_0x0314('0x26')](handleEntityNotFound(_0x186dde,null))[_0x0314('0x26')](function(_0x182909){if(_0x182909){_0xf38fa4=_0x182909[_0x0314('0x98')];var _0x3c06e4=_0xf38fa4['slice'](-0x1);if(_0x3c06e4==='/'){_0xf38fa4=_0xf38fa4[_0x0314('0x9b')](0x0,_0xf38fa4['lastIndexOf'](_0x3c06e4));}_0x576190=util[_0x0314('0x9c')](_0x0314('0x9d'),_0xf38fa4);var _0x242c5a={'method':_0x0314('0x9e'),'uri':_0x0314('0x9f')+_0x182909[_0x0314('0x99')]+_0x0314('0xa0'),'form':{'client_id':_0x182909[_0x0314('0xa1')],'resource':_0xf38fa4,'username':_0x182909['username'],'password':_0x182909[_0x0314('0x97')],'grant_type':_0x0314('0x97'),'client_secret':_0x182909[_0x0314('0x9a')]},'json':!![]};return rp(_0x242c5a);}})[_0x0314('0x26')](function(_0x4c0d7e){_0x10c942=_0x4c0d7e[_0x0314('0xa2')];var _0x1a1192={'method':'GET','uri':encodeURI(_0x576190+_0x0314('0xa3')+_0x2bcaf5+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x10c942,'If-None-Match':null,'OData-Version':_0x0314('0xa4')},'json':!![]};return rp(_0x1a1192);})[_0x0314('0x26')](function(_0x4e4a44){var _0x3941e3=_0x4e4a44['value'][0x0];var _0x292bdb=_0x3941e3[_0x0314('0xa5')];var _0x914260={'method':_0x0314('0xa6'),'uri':_0x576190+_0x0314('0xa7')+_0x292bdb+_0x0314('0xa8'),'headers':{'Authorization':_0x0314('0xa9')+_0x10c942,'If-None-Match':null,'OData-Version':_0x0314('0xa4')},'json':!![]};return rp(_0x914260);})[_0x0314('0x26')](function(_0x18131e){_0x1b6cc5=_0x18131e;_0x1cbdd7=_0x1b6cc5[_0x0314('0xaa')];_0x1cbdd7=_['remove'](_0x1cbdd7,function(_0x547d8c){return!_0x2bd970[_0x0314('0xab')](_0x547d8c['LogicalName']);});var _0x2a6579=[];var _0x20589c=[];_0x1cbdd7[_0x0314('0xac')](function(_0x4e808c){if(_0x4e808c[_0x0314('0xad')]){var _0x235013=_0x4e808c[_0x0314('0xad')][_0x0314('0x9b')](_0x4e808c[_0x0314('0xad')][_0x0314('0xae')]('.')+0x1);if(_0x235013===_0x0314('0xaf')){_0x2a6579['push'](getSelectList(_0x576190,_0x30726f,_0x20589c,_0x1b6cc5[_0x0314('0xa5')],_0x4e808c['MetadataId'],_0x10c942));}}});return Promise['all'](_0x2a6579);})[_0x0314('0x26')](function(_0x3f09e8){_0x11fb3f=_0x3f09e8[0x0];var _0x2bbcbc=[];var _0x41210a=[];_0x1cbdd7[_0x0314('0xac')](function(_0x8aaa2a){if(!_[_0x0314('0xb0')](_0x8aaa2a[_0x0314('0xad')])){var _0x2b8982=_0x8aaa2a[_0x0314('0xad')][_0x0314('0x9b')](_0x8aaa2a['@odata.type'][_0x0314('0xae')]('.')+0x1);if(_0x2b8982===_0x0314('0xb1')){_0x2bbcbc[_0x0314('0xb2')](getBooleanList(_0x576190,_0x30726f,_0x41210a,_0x1b6cc5['MetadataId'],_0x8aaa2a['MetadataId'],_0x10c942));}}});return Promise[_0x0314('0xb3')](_0x2bbcbc);})['then'](function(_0x4c952e){_0x5d990c=_0x4c952e[0x0];var _0xa9774c=[];var _0x239fbd=[];_0x1cbdd7[_0x0314('0xac')](function(_0x135062){if(_0x135062[_0x0314('0xad')]){var _0x36cfaf=_0x135062['@odata.type'][_0x0314('0x9b')](_0x135062['@odata.type'][_0x0314('0xae')]('.')+0x1);if(_0x36cfaf===_0x0314('0xb4')||_0x36cfaf===_0x0314('0xb5')||_0x36cfaf===_0x0314('0xb6')||_0x36cfaf===_0x0314('0xb7')||_0x36cfaf===_0x0314('0xb8')||_0x36cfaf==='DateTimeAttributeMetadata'||_0x36cfaf==='StatusAttributeMetadata'||_0x36cfaf===_0x0314('0xb9')||_0x36cfaf===_0x0314('0xba')||_0x36cfaf===_0x0314('0xbb')){_0xa9774c[_0x0314('0xb2')](getInputList(_0x576190,_0x30726f,_0x36cfaf,_0x239fbd,_0x1b6cc5[_0x0314('0xa5')],_0x135062[_0x0314('0xa5')],_0x10c942));}}});return Promise[_0x0314('0xb3')](_0xa9774c);})['then'](function(_0x26f3da){_0xfc1bbe=_0x26f3da[0x0];var _0x5bcb8d=_0x11fb3f['concat'](_0x5d990c)[_0x0314('0x95')](_0xfc1bbe);var _0xb5728e={'count':_0x5bcb8d['length'],'rows':_0x5bcb8d};return _0xb5728e;})[_0x0314('0x26')](respondWithResult(_0x186dde,null))[_0x0314('0x41')](function(_0x1e3b8e){var _0x39d4a4=_0x58f666['query'][_0x0314('0xbc')]?0x1f4:_0x1e3b8e[_0x0314('0xbd')]||0x1f4;logger[_0x0314('0x28')](_0x1e3b8e['stack']);delete _0x1e3b8e['name'];if(_0x39d4a4===0x191){_0x39d4a4=0x190;}_0x186dde['status'](_0x39d4a4)[_0x0314('0x2a')](_0x58f666[_0x0314('0x31')][_0x0314('0xbc')]?{'message':'Wrong\x20credentials','statusCode':_0x1e3b8e[_0x0314('0xbd')]}:_0x1e3b8e);});};function getSelectList(_0x5c7cbd,_0x522143,_0x480164,_0x26d5ab,_0x2df492,_0x25c3d5){var _0xa44687={'method':_0x0314('0xa6'),'uri':_0x5c7cbd+_0x0314('0xa7')+_0x26d5ab+_0x0314('0xbe')+_0x2df492+_0x0314('0xbf')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x25c3d5,'If-None-Match':null,'OData-Version':_0x0314('0xa4')},'json':!![]};return rp(_0xa44687)[_0x0314('0x26')](function(_0x305807){var _0x14dc00=[];var _0x479060=_0x305807[_0x0314('0xc0')][_0x0314('0xc1')];_0x479060[_0x0314('0xac')](function(_0x3d6bbd){_0x14dc00[_0x0314('0xb2')]({'name':_0x3d6bbd[_0x0314('0xc2')][_0x0314('0xc3')]['Label'],'value':String(_0x3d6bbd[_0x0314('0xc4')])});});var _0x59c9fb={'id':_0x522143+'_'+_0x305807[_0x0314('0xc5')],'name':_0x305807[_0x0314('0xc6')][_0x0314('0xc3')]['Label'],'custom':![],'options':_0x14dc00};_0x480164[_0x0314('0xb2')](_0x59c9fb);return _0x480164;});}function getBooleanList(_0x1503ab,_0x59787b,_0x1734ca,_0x3e3a43,_0x4c144a,_0xdf5fbc){var _0x3737b8={'method':_0x0314('0xa6'),'uri':_0x1503ab+'EntityDefinitions('+_0x3e3a43+_0x0314('0xbe')+_0x4c144a+_0x0314('0xc7'),'headers':{'Authorization':'Bearer\x20'+_0xdf5fbc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3737b8)[_0x0314('0x26')](function(_0x91fc94){var _0x103475=[];_0x103475[_0x0314('0xb2')]({'name':_0x91fc94[_0x0314('0xc0')]['TrueOption']['Label'][_0x0314('0xc3')]['Label'],'value':'true'},{'name':_0x91fc94['OptionSet']['FalseOption'][_0x0314('0xc2')][_0x0314('0xc3')]['Label'],'value':'false'});var _0x38724c={'id':_0x59787b+'_'+_0x91fc94[_0x0314('0xc5')],'name':_0x91fc94[_0x0314('0xc6')]['UserLocalizedLabel'][_0x0314('0xc2')],'custom':![],'options':_0x103475};_0x1734ca[_0x0314('0xb2')](_0x38724c);return _0x1734ca;});}function getInputList(_0x306c61,_0x1cd3c9,_0x30f3fd,_0x2347fe,_0x27d22d,_0x4fb439,_0x225937){var _0x48081a={'method':_0x0314('0xa6'),'uri':_0x306c61+_0x0314('0xa7')+_0x27d22d+_0x0314('0xbe')+_0x4fb439+')/Microsoft.Dynamics.CRM.'+_0x30f3fd+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x0314('0xa9')+_0x225937,'If-None-Match':null,'OData-Version':_0x0314('0xa4')},'json':!![]};return rp(_0x48081a)[_0x0314('0x26')](function(_0x54c988){var _0x41a51b={'id':_0x1cd3c9+'_'+_0x54c988[_0x0314('0xc5')],'name':_0x54c988[_0x0314('0xc6')][_0x0314('0xc3')]?_0x54c988['DisplayName'][_0x0314('0xc3')][_0x0314('0xc2')]:_0x54c988[_0x0314('0xc5')],'custom':![],'options':[]};_0x2347fe['push'](_0x41a51b);return _0x2347fe;});}
\ No newline at end of file
index 82ee803..5ae86d7 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(_0x2a9da3,_0x369469){var _0x307e42=function(_0x986b7){while(--_0x986b7){_0x2a9da3['push'](_0x2a9da3['shift']());}};_0x307e42(++_0x369469);}(_0xb7e7,0x121));var _0x7b7e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xb7e7[_0x710815];return _0x5b3b89;};'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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x17cf1e,_0x1a089d){var _0x51e8c8=function(_0x1772bb){while(--_0x1772bb){_0x17cf1e['push'](_0x17cf1e['shift']());}};_0x51e8c8(++_0x1a089d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e4c8ee9..ebc89ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e99=['findAll','options','where','attributes','include','map','model','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','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'];(function(_0x396dc6,_0x529342){var _0x285078=function(_0x198a28){while(--_0x198a28){_0x396dc6['push'](_0x396dc6['shift']());}};_0x285078(++_0x529342);}(_0x6e99,0x118));var _0x96e9=function(_0x314e22,_0x4cd065){_0x314e22=_0x314e22-0x0;var _0x46a815=_0x6e99[_0x314e22];return _0x46a815;};'use strict';var _=require(_0x96e9('0x0'));var util=require(_0x96e9('0x1'));var moment=require('moment');var BPromise=require(_0x96e9('0x2'));var rs=require(_0x96e9('0x3'));var fs=require('fs');var Redis=require(_0x96e9('0x4'));var db=require(_0x96e9('0x5'))['db'];var utils=require(_0x96e9('0x6'));var logger=require(_0x96e9('0x7'))(_0x96e9('0x8'));var config=require('../../config/environment');var jayson=require(_0x96e9('0x9'));var client=jayson[_0x96e9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541b11,_0x520bba,_0x24a746){return new BPromise(function(_0x7e97fd,_0x12b032){return client[_0x96e9('0xb')](_0x541b11,_0x24a746)[_0x96e9('0xc')](function(_0x4dea6a){logger[_0x96e9('0xd')](_0x96e9('0xe'),_0x520bba,_0x96e9('0xf'));logger[_0x96e9('0x10')](_0x96e9('0x11'),_0x520bba,_0x96e9('0xf'),JSON[_0x96e9('0x12')](_0x4dea6a));if(_0x4dea6a[_0x96e9('0x13')]){if(_0x4dea6a[_0x96e9('0x13')][_0x96e9('0x14')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x520bba,_0x4dea6a[_0x96e9('0x13')]['message']);return _0x12b032(_0x4dea6a['error'][_0x96e9('0x15')]);}logger[_0x96e9('0x13')](_0x96e9('0xe'),_0x520bba,_0x4dea6a[_0x96e9('0x13')][_0x96e9('0x15')]);return _0x7e97fd(_0x4dea6a[_0x96e9('0x13')][_0x96e9('0x15')]);}else{logger[_0x96e9('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x520bba,_0x96e9('0xf'));_0x7e97fd(_0x4dea6a[_0x96e9('0x16')]['message']);}})[_0x96e9('0x17')](function(_0x4885b1){logger[_0x96e9('0x13')](_0x96e9('0xe'),_0x520bba,_0x4885b1);_0x12b032(_0x4885b1);});});}exports[_0x96e9('0x18')]=function(_0x9a0fb5){var _0xa08462=this;return new Promise(function(_0x1b3167,_0x2a739e){return db[_0x96e9('0x19')][_0x96e9('0x1a')]({'raw':_0x9a0fb5[_0x96e9('0x1b')]?_0x9a0fb5[_0x96e9('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x9a0fb5[_0x96e9('0x1b')]?_0x9a0fb5[_0x96e9('0x1b')][_0x96e9('0x1c')]||null:null,'attributes':_0x9a0fb5[_0x96e9('0x1b')]?_0x9a0fb5[_0x96e9('0x1b')][_0x96e9('0x1d')]||null:null,'limit':_0x9a0fb5[_0x96e9('0x1b')]?_0x9a0fb5[_0x96e9('0x1b')]['limit']||null:null,'include':_0x9a0fb5[_0x96e9('0x1b')]?_0x9a0fb5['options'][_0x96e9('0x1e')]?_[_0x96e9('0x1f')](_0x9a0fb5['options'][_0x96e9('0x1e')],function(_0x2b9084){return{'model':db[_0x2b9084[_0x96e9('0x20')]],'as':_0x2b9084['as'],'attributes':_0x2b9084[_0x96e9('0x1d')],'include':_0x2b9084[_0x96e9('0x1e')]?_[_0x96e9('0x1f')](_0x2b9084[_0x96e9('0x1e')],function(_0x17e298){return{'model':db[_0x17e298[_0x96e9('0x20')]],'as':_0x17e298['as'],'attributes':_0x17e298[_0x96e9('0x1d')],'include':_0x17e298[_0x96e9('0x1e')]?_[_0x96e9('0x1f')](_0x17e298['include'],function(_0x5ee577){return{'model':db[_0x5ee577['model']],'as':_0x5ee577['as'],'attributes':_0x5ee577['attributes']};}):[]};}):[]};}):[]:[]})[_0x96e9('0xc')](function(_0x59fac2){logger[_0x96e9('0xd')](_0x96e9('0x18'),_0x9a0fb5);logger[_0x96e9('0x10')](_0x96e9('0x18'),_0x9a0fb5,JSON['stringify'](_0x59fac2));_0x1b3167(_0x59fac2);})[_0x96e9('0x17')](function(_0x3993df){logger[_0x96e9('0x13')](_0x96e9('0x18'),_0x3993df[_0x96e9('0x15')],_0x9a0fb5);_0x2a739e(_0xa08462[_0x96e9('0x13')](0x1f4,_0x3993df[_0x96e9('0x15')]));});});};exports['ShowDynamics365Account']=function(_0x37c5d6){var _0x50b351=this;return new Promise(function(_0x44d43f,_0x18d4b6){return db[_0x96e9('0x19')][_0x96e9('0x21')]({'raw':_0x37c5d6[_0x96e9('0x1b')]?_0x37c5d6[_0x96e9('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x37c5d6[_0x96e9('0x1b')]?_0x37c5d6['options']['where']||null:null,'attributes':_0x37c5d6[_0x96e9('0x1b')]?_0x37c5d6[_0x96e9('0x1b')][_0x96e9('0x1d')]||null:null,'include':_0x37c5d6[_0x96e9('0x1b')]?_0x37c5d6[_0x96e9('0x1b')][_0x96e9('0x1e')]?_[_0x96e9('0x1f')](_0x37c5d6[_0x96e9('0x1b')][_0x96e9('0x1e')],function(_0x5cd941){return{'model':db[_0x5cd941[_0x96e9('0x20')]],'as':_0x5cd941['as'],'attributes':_0x5cd941[_0x96e9('0x1d')],'include':_0x5cd941[_0x96e9('0x1e')]?_[_0x96e9('0x1f')](_0x5cd941[_0x96e9('0x1e')],function(_0x5c053f){return{'model':db[_0x5c053f[_0x96e9('0x20')]],'as':_0x5c053f['as'],'attributes':_0x5c053f[_0x96e9('0x1d')],'include':_0x5c053f['include']?_[_0x96e9('0x1f')](_0x5c053f['include'],function(_0x370d92){return{'model':db[_0x370d92[_0x96e9('0x20')]],'as':_0x370d92['as'],'attributes':_0x370d92['attributes']};}):[]};}):[]};}):[]:[]})[_0x96e9('0xc')](function(_0x196ee7){logger[_0x96e9('0xd')]('ShowDynamics365Account',_0x37c5d6);logger[_0x96e9('0x10')]('ShowDynamics365Account',_0x37c5d6,JSON[_0x96e9('0x12')](_0x196ee7));_0x44d43f(_0x196ee7);})['catch'](function(_0x56a32e){logger[_0x96e9('0x13')]('ShowDynamics365Account',_0x56a32e['message'],_0x37c5d6);_0x18d4b6(_0x50b351['error'](0x1f4,_0x56a32e['message']));});});};
\ No newline at end of file
+var _0x07ae=['then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','ShowDynamics365Account'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x07ae,0x1bd));var _0xe07a=function(_0x1233e1,_0x1259e0){_0x1233e1=_0x1233e1-0x0;var _0x5d5824=_0x07ae[_0x1233e1];return _0x5d5824;};'use strict';var _=require(_0xe07a('0x0'));var util=require(_0xe07a('0x1'));var moment=require(_0xe07a('0x2'));var BPromise=require(_0xe07a('0x3'));var rs=require(_0xe07a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe07a('0x5'))['db'];var utils=require(_0xe07a('0x6'));var logger=require(_0xe07a('0x7'))(_0xe07a('0x8'));var config=require(_0xe07a('0x9'));var jayson=require(_0xe07a('0xa'));var client=jayson[_0xe07a('0xb')][_0xe07a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4066ed,_0x556460,_0xef4717){return new BPromise(function(_0xc77e64,_0x3e1ba3){return client[_0xe07a('0xd')](_0x4066ed,_0xef4717)['then'](function(_0x326087){logger[_0xe07a('0xe')](_0xe07a('0xf'),_0x556460,_0xe07a('0x10'));logger[_0xe07a('0x11')](_0xe07a('0x12'),_0x556460,_0xe07a('0x10'),JSON[_0xe07a('0x13')](_0x326087));if(_0x326087['error']){if(_0x326087[_0xe07a('0x14')][_0xe07a('0x15')]===0x1f4){logger[_0xe07a('0x14')](_0xe07a('0xf'),_0x556460,_0x326087['error'][_0xe07a('0x16')]);return _0x3e1ba3(_0x326087[_0xe07a('0x14')]['message']);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x556460,_0x326087['error']['message']);return _0xc77e64(_0x326087['error']['message']);}else{logger[_0xe07a('0xe')](_0xe07a('0xf'),_0x556460,_0xe07a('0x10'));_0xc77e64(_0x326087['result'][_0xe07a('0x16')]);}})[_0xe07a('0x17')](function(_0x23369c){logger[_0xe07a('0x14')](_0xe07a('0xf'),_0x556460,_0x23369c);_0x3e1ba3(_0x23369c);});});}exports[_0xe07a('0x18')]=function(_0x5bd196){var _0x2d5787=this;return new Promise(function(_0x8c8677,_0xb2d15a){return db[_0xe07a('0x19')][_0xe07a('0x1a')]({'raw':_0x5bd196[_0xe07a('0x1b')]?_0x5bd196[_0xe07a('0x1b')][_0xe07a('0x1c')]===undefined?!![]:![]:!![],'where':_0x5bd196[_0xe07a('0x1b')]?_0x5bd196[_0xe07a('0x1b')][_0xe07a('0x1d')]||null:null,'attributes':_0x5bd196[_0xe07a('0x1b')]?_0x5bd196['options']['attributes']||null:null,'limit':_0x5bd196[_0xe07a('0x1b')]?_0x5bd196[_0xe07a('0x1b')][_0xe07a('0x1e')]||null:null,'include':_0x5bd196['options']?_0x5bd196[_0xe07a('0x1b')][_0xe07a('0x1f')]?_[_0xe07a('0x20')](_0x5bd196[_0xe07a('0x1b')]['include'],function(_0xe9cae5){return{'model':db[_0xe9cae5[_0xe07a('0x21')]],'as':_0xe9cae5['as'],'attributes':_0xe9cae5[_0xe07a('0x22')],'include':_0xe9cae5[_0xe07a('0x1f')]?_[_0xe07a('0x20')](_0xe9cae5['include'],function(_0x277b31){return{'model':db[_0x277b31['model']],'as':_0x277b31['as'],'attributes':_0x277b31[_0xe07a('0x22')],'include':_0x277b31[_0xe07a('0x1f')]?_[_0xe07a('0x20')](_0x277b31[_0xe07a('0x1f')],function(_0x73223d){return{'model':db[_0x73223d[_0xe07a('0x21')]],'as':_0x73223d['as'],'attributes':_0x73223d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x507f26){logger[_0xe07a('0xe')]('GetDynamics365Account',_0x5bd196);logger[_0xe07a('0x11')]('GetDynamics365Account',_0x5bd196,JSON[_0xe07a('0x13')](_0x507f26));_0x8c8677(_0x507f26);})['catch'](function(_0x27b0d6){logger['error'](_0xe07a('0x18'),_0x27b0d6[_0xe07a('0x16')],_0x5bd196);_0xb2d15a(_0x2d5787['error'](0x1f4,_0x27b0d6[_0xe07a('0x16')]));});});};exports[_0xe07a('0x23')]=function(_0x1ab895){var _0x2a1ecd=this;return new Promise(function(_0x1b1ed1,_0x1fa400){return db[_0xe07a('0x19')]['find']({'raw':_0x1ab895[_0xe07a('0x1b')]?_0x1ab895[_0xe07a('0x1b')][_0xe07a('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ab895[_0xe07a('0x1b')]?_0x1ab895[_0xe07a('0x1b')][_0xe07a('0x1d')]||null:null,'attributes':_0x1ab895['options']?_0x1ab895[_0xe07a('0x1b')][_0xe07a('0x22')]||null:null,'include':_0x1ab895['options']?_0x1ab895['options'][_0xe07a('0x1f')]?_[_0xe07a('0x20')](_0x1ab895[_0xe07a('0x1b')][_0xe07a('0x1f')],function(_0x6e2313){return{'model':db[_0x6e2313[_0xe07a('0x21')]],'as':_0x6e2313['as'],'attributes':_0x6e2313[_0xe07a('0x22')],'include':_0x6e2313[_0xe07a('0x1f')]?_[_0xe07a('0x20')](_0x6e2313[_0xe07a('0x1f')],function(_0x1b56b3){return{'model':db[_0x1b56b3[_0xe07a('0x21')]],'as':_0x1b56b3['as'],'attributes':_0x1b56b3[_0xe07a('0x22')],'include':_0x1b56b3['include']?_[_0xe07a('0x20')](_0x1b56b3[_0xe07a('0x1f')],function(_0x1a1f7d){return{'model':db[_0x1a1f7d[_0xe07a('0x21')]],'as':_0x1a1f7d['as'],'attributes':_0x1a1f7d[_0xe07a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe07a('0x24')](function(_0x461c17){logger['info'](_0xe07a('0x23'),_0x1ab895);logger[_0xe07a('0x11')](_0xe07a('0x23'),_0x1ab895,JSON['stringify'](_0x461c17));_0x1b1ed1(_0x461c17);})[_0xe07a('0x17')](function(_0x2fb970){logger[_0xe07a('0x14')]('ShowDynamics365Account',_0x2fb970[_0xe07a('0x16')],_0x1ab895);_0x1fa400(_0x2a1ecd[_0xe07a('0x14')](0x1f4,_0x2fb970[_0xe07a('0x16')]));});});};
\ No newline at end of file
index 6d87ed3..559e4b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf84a=['put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','post','create'];(function(_0x3956bf,_0x2fa1eb){var _0x2896d3=function(_0x3ed9ab){while(--_0x3ed9ab){_0x3956bf['push'](_0x3956bf['shift']());}};_0x2896d3(++_0x2fa1eb);}(_0xf84a,0x97));var _0xaf84=function(_0x264e1f,_0x35a5d4){_0x264e1f=_0x264e1f-0x0;var _0x3593af=_0xf84a[_0x264e1f];return _0x3593af;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaf84('0x0'));var timeout=require(_0xaf84('0x1'));var express=require(_0xaf84('0x2'));var router=express[_0xaf84('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaf84('0x4'));var interaction=require(_0xaf84('0x5'));var config=require('../../config/environment');var controller=require(_0xaf84('0x6'));router[_0xaf84('0x7')]('/',auth[_0xaf84('0x8')](),controller[_0xaf84('0x9')]);router['get'](_0xaf84('0xa'),auth[_0xaf84('0x8')](),controller[_0xaf84('0xb')]);router[_0xaf84('0x7')]('/:id/fields',auth[_0xaf84('0x8')](),controller[_0xaf84('0xc')]);router[_0xaf84('0x7')](_0xaf84('0xd'),auth[_0xaf84('0x8')](),controller[_0xaf84('0xe')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xaf84('0xf')]('/',auth[_0xaf84('0x8')](),controller[_0xaf84('0x10')]);router[_0xaf84('0x11')](_0xaf84('0xa'),auth[_0xaf84('0x8')](),controller[_0xaf84('0x12')]);router[_0xaf84('0x13')]('/:id',auth[_0xaf84('0x8')](),controller[_0xaf84('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x6c79=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x50db94,_0x536efd){var _0x320e48=function(_0x577a7d){while(--_0x577a7d){_0x50db94['push'](_0x50db94['shift']());}};_0x320e48(++_0x536efd);}(_0x6c79,0x184));var _0x96c7=function(_0x92713a,_0x68f8b0){_0x92713a=_0x92713a-0x0;var _0x1893e1=_0x6c79[_0x92713a];return _0x1893e1;};'use strict';var multer=require(_0x96c7('0x0'));var util=require(_0x96c7('0x1'));var path=require(_0x96c7('0x2'));var timeout=require(_0x96c7('0x3'));var express=require(_0x96c7('0x4'));var router=express['Router']();var fs_extra=require(_0x96c7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x96c7('0x6'));var config=require(_0x96c7('0x7'));var controller=require(_0x96c7('0x8'));router[_0x96c7('0x9')]('/',auth[_0x96c7('0xa')](),controller['index']);router[_0x96c7('0x9')](_0x96c7('0xb'),auth[_0x96c7('0xa')](),controller[_0x96c7('0xc')]);router[_0x96c7('0x9')]('/:id/fields',auth[_0x96c7('0xa')](),controller[_0x96c7('0xd')]);router[_0x96c7('0x9')](_0x96c7('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x96c7('0x9')](_0x96c7('0xf'),auth['isAuthenticated'](),controller[_0x96c7('0x10')]);router[_0x96c7('0x11')]('/',auth['isAuthenticated'](),controller[_0x96c7('0x12')]);router[_0x96c7('0x13')]('/:id',auth[_0x96c7('0xa')](),controller['update']);router[_0x96c7('0x14')](_0x96c7('0xb'),auth[_0x96c7('0xa')](),controller[_0x96c7('0x15')]);module[_0x96c7('0x16')]=router;
\ No newline at end of file
index f263ba0..c262329 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ce7=['sequelize','exports','STRING','ENUM','phonecall','incident'];(function(_0x718203,_0x132c76){var _0x2f9960=function(_0x417199){while(--_0x417199){_0x718203['push'](_0x718203['shift']());}};_0x2f9960(++_0x132c76);}(_0x7ce7,0x11a));var _0x77ce=function(_0x1281e,_0x48bb39){_0x1281e=_0x1281e-0x0;var _0x544810=_0x7ce7[_0x1281e];return _0x544810;};'use strict';var Sequelize=require(_0x77ce('0x0'));module[_0x77ce('0x1')]={'name':{'type':Sequelize[_0x77ce('0x2')]},'description':{'type':Sequelize[_0x77ce('0x2')]},'ticketType':{'type':Sequelize[_0x77ce('0x3')]('incident',_0x77ce('0x4')),'defaultValue':_0x77ce('0x5')}};
\ No newline at end of file
+var _0xc46c=['incident','phonecall','sequelize','exports','STRING','ENUM'];(function(_0x4df7c6,_0x1b537a){var _0x5e58ce=function(_0x32ced9){while(--_0x32ced9){_0x4df7c6['push'](_0x4df7c6['shift']());}};_0x5e58ce(++_0x1b537a);}(_0xc46c,0x158));var _0xcc46=function(_0x322522,_0x4db288){_0x322522=_0x322522-0x0;var _0x293bcf=_0xc46c[_0x322522];return _0x293bcf;};'use strict';var Sequelize=require(_0xcc46('0x0'));module[_0xcc46('0x1')]={'name':{'type':Sequelize[_0xcc46('0x2')]},'description':{'type':Sequelize[_0xcc46('0x2')]},'ticketType':{'type':Sequelize[_0xcc46('0x3')](_0xcc46('0x4'),_0xcc46('0x5')),'defaultValue':_0xcc46('0x4')}};
\ No newline at end of file
index f29444d..502f6b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x273a=['findOne','Dynamics365Field','order','pick','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields'];(function(_0x22ea66,_0x30123a){var _0x529757=function(_0x2340e){while(--_0x2340e){_0x22ea66['push'](_0x22ea66['shift']());}};_0x529757(++_0x30123a);}(_0x273a,0x14b));var _0xa273=function(_0x13e19d,_0x56308e){_0x13e19d=_0x13e19d-0x0;var _0xbc76b=_0x273a[_0x13e19d];return _0xbc76b;};'use strict';var emlformat=require(_0xa273('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa273('0x1'));var jsonpatch=require(_0xa273('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa273('0x3'));var Mustache=require(_0xa273('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa273('0x5'));var csv=require(_0xa273('0x6'));var ejs=require(_0xa273('0x7'));var fs=require('fs');var fs_extra=require(_0xa273('0x8'));var _=require(_0xa273('0x9'));var squel=require(_0xa273('0xa'));var crypto=require(_0xa273('0xb'));var jsforce=require(_0xa273('0xc'));var deskjs=require(_0xa273('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa273('0xe'));var authService=require(_0xa273('0xf'));var qs=require(_0xa273('0x10'));var as=require(_0xa273('0x11'));var hardwareService=require(_0xa273('0x12'));var logger=require(_0xa273('0x13'))('api');var utils=require(_0xa273('0x14'));var config=require(_0xa273('0x15'));var licenseUtil=require(_0xa273('0x16'));var db=require(_0xa273('0x17'))['db'];function respondWithStatusCode(_0x10f933,_0x4eef9e){_0x4eef9e=_0x4eef9e||0xcc;return function(_0x52bdf5){if(_0x52bdf5){return _0x10f933[_0xa273('0x18')](_0x4eef9e);}return _0x10f933[_0xa273('0x19')](_0x4eef9e)[_0xa273('0x1a')]();};}function respondWithResult(_0x4844b4,_0x2f7209){_0x2f7209=_0x2f7209||0xc8;return function(_0x465cb0){if(_0x465cb0){return _0x4844b4[_0xa273('0x19')](_0x2f7209)[_0xa273('0x1b')](_0x465cb0);}};}function respondWithFilteredResult(_0x11e234,_0xaf8908){return function(_0x218381){if(_0x218381){var _0x1a2bfd=typeof _0xaf8908['offset']===_0xa273('0x1c')&&typeof _0xaf8908[_0xa273('0x1d')]===_0xa273('0x1c');var _0x5ee567=_0x218381[_0xa273('0x1e')];var _0x1920d9=_0x1a2bfd?0x0:_0xaf8908['offset'];var _0x1129ed=_0x1a2bfd?_0x218381[_0xa273('0x1e')]:_0xaf8908[_0xa273('0x1f')]+_0xaf8908[_0xa273('0x1d')];var _0x204b78;if(_0x1129ed>=_0x5ee567){_0x1129ed=_0x5ee567;_0x204b78=0xc8;}else{_0x204b78=0xce;}_0x11e234[_0xa273('0x19')](_0x204b78);return _0x11e234[_0xa273('0x20')](_0xa273('0x21'),_0x1920d9+'-'+_0x1129ed+'/'+_0x5ee567)[_0xa273('0x1b')](_0x218381);}return null;};}function patchUpdates(_0x675fe){return function(_0x26be97){try{jsonpatch[_0xa273('0x22')](_0x26be97,_0x675fe,!![]);}catch(_0x539f62){return BPromise[_0xa273('0x23')](_0x539f62);}return _0x26be97[_0xa273('0x24')]();};}function saveUpdates(_0x264b14,_0x39cddc){return function(_0x50e54b){if(_0x50e54b){return _0x50e54b[_0xa273('0x25')](_0x264b14)[_0xa273('0x26')](function(_0x5012ef){return _0x5012ef;});}return null;};}function removeEntity(_0x1a882b,_0x42de05){return function(_0x40b0e5){if(_0x40b0e5){return _0x40b0e5[_0xa273('0x27')]()['then'](function(){_0x1a882b[_0xa273('0x19')](0xcc)[_0xa273('0x1a')]();});}};}function handleEntityNotFound(_0x47444,_0x5ab554){return function(_0x10d966){if(!_0x10d966){_0x47444[_0xa273('0x18')](0x194);}return _0x10d966;};}function handleError(_0x50c750,_0x61d0c1){_0x61d0c1=_0x61d0c1||0x1f4;return function(_0x26ecf8){logger[_0xa273('0x28')](_0x26ecf8['stack']);if(_0x26ecf8[_0xa273('0x29')]){delete _0x26ecf8['name'];}_0x50c750[_0xa273('0x19')](_0x61d0c1)[_0xa273('0x2a')](_0x26ecf8);};}exports[_0xa273('0x2b')]=function(_0x38ee4a,_0x20ad13){var _0x31f33a={},_0x1e92b8={},_0xf891d6={'count':0x0,'rows':[]};var _0x3fad32=_[_0xa273('0x2c')](db[_0xa273('0x2d')][_0xa273('0x2e')],function(_0x5eeaaf){return{'name':_0x5eeaaf['fieldName'],'type':_0x5eeaaf[_0xa273('0x2f')][_0xa273('0x30')]};});_0x1e92b8[_0xa273('0x31')]=_[_0xa273('0x2c')](_0x3fad32,_0xa273('0x29'));_0x1e92b8['query']=_[_0xa273('0x32')](_0x38ee4a[_0xa273('0x33')]);_0x1e92b8[_0xa273('0x34')]=_[_0xa273('0x35')](_0x1e92b8[_0xa273('0x31')],_0x1e92b8[_0xa273('0x33')]);_0x31f33a[_0xa273('0x36')]=_[_0xa273('0x35')](_0x1e92b8[_0xa273('0x31')],qs['fields'](_0x38ee4a[_0xa273('0x33')][_0xa273('0x37')]));_0x31f33a[_0xa273('0x36')]=_0x31f33a[_0xa273('0x36')][_0xa273('0x38')]?_0x31f33a[_0xa273('0x36')]:_0x1e92b8[_0xa273('0x31')];if(!_0x38ee4a[_0xa273('0x33')][_0xa273('0x39')]('nolimit')){_0x31f33a['limit']=qs[_0xa273('0x1d')](_0x38ee4a[_0xa273('0x33')][_0xa273('0x1d')]);_0x31f33a[_0xa273('0x1f')]=qs[_0xa273('0x1f')](_0x38ee4a[_0xa273('0x33')][_0xa273('0x1f')]);}_0x31f33a['order']=qs[_0xa273('0x3a')](_0x38ee4a[_0xa273('0x33')][_0xa273('0x3a')]);_0x31f33a[_0xa273('0x3b')]=qs[_0xa273('0x34')](_['pick'](_0x38ee4a['query'],_0x1e92b8[_0xa273('0x34')]),_0x3fad32);if(_0x38ee4a[_0xa273('0x33')][_0xa273('0x3c')]){_0x31f33a[_0xa273('0x3b')]=_[_0xa273('0x3d')](_0x31f33a['where'],{'$or':_[_0xa273('0x2c')](_0x3fad32,function(_0xd2738a){if(_0xd2738a[_0xa273('0x2f')]!==_0xa273('0x3e')){var _0x35ee82={};_0x35ee82[_0xd2738a[_0xa273('0x29')]]={'$like':'%'+_0x38ee4a['query'][_0xa273('0x3c')]+'%'};return _0x35ee82;}})});}_0x31f33a=_[_0xa273('0x3d')]({},_0x31f33a,_0x38ee4a[_0xa273('0x3f')]);var _0x4d73c7={'where':_0x31f33a[_0xa273('0x3b')]};return db[_0xa273('0x2d')][_0xa273('0x1e')](_0x4d73c7)[_0xa273('0x26')](function(_0x4772ee){_0xf891d6[_0xa273('0x1e')]=_0x4772ee;if(_0x38ee4a[_0xa273('0x33')][_0xa273('0x40')]){_0x31f33a[_0xa273('0x41')]=[{'all':!![]}];}return db[_0xa273('0x2d')][_0xa273('0x42')](_0x31f33a);})['then'](function(_0x326394){_0xf891d6[_0xa273('0x43')]=_0x326394;return _0xf891d6;})[_0xa273('0x26')](respondWithFilteredResult(_0x20ad13,_0x31f33a))[_0xa273('0x44')](handleError(_0x20ad13,null));};exports['show']=function(_0x2b1a16,_0x4d0a65){var _0x52a255={'raw':![],'where':{'id':_0x2b1a16[_0xa273('0x45')]['id']}},_0x5521ab={};_0x5521ab['model']=_['keys'](db[_0xa273('0x2d')][_0xa273('0x2e')]);_0x5521ab['query']=_['keys'](_0x2b1a16[_0xa273('0x33')]);_0x5521ab[_0xa273('0x34')]=_['intersection'](_0x5521ab[_0xa273('0x31')],_0x5521ab[_0xa273('0x33')]);_0x52a255[_0xa273('0x36')]=_[_0xa273('0x35')](_0x5521ab[_0xa273('0x31')],qs[_0xa273('0x37')](_0x2b1a16[_0xa273('0x33')][_0xa273('0x37')]));_0x52a255[_0xa273('0x36')]=_0x52a255['attributes'][_0xa273('0x38')]?_0x52a255[_0xa273('0x36')]:_0x5521ab[_0xa273('0x31')];if(_0x2b1a16[_0xa273('0x33')][_0xa273('0x40')]){_0x52a255[_0xa273('0x41')]=[{'all':!![]}];}_0x52a255=_['merge']({},_0x52a255,_0x2b1a16['options']);return db['Dynamics365Configuration'][_0xa273('0x46')](_0x52a255)[_0xa273('0x26')](handleEntityNotFound(_0x4d0a65,null))[_0xa273('0x26')](respondWithResult(_0x4d0a65,null))[_0xa273('0x44')](handleError(_0x4d0a65,null));};exports[_0xa273('0x47')]=function(_0x324d8d,_0x33c1f9){return db[_0xa273('0x2d')][_0xa273('0x47')](_0x324d8d[_0xa273('0x48')],{})[_0xa273('0x26')](respondWithResult(_0x33c1f9,0xc9))['catch'](handleError(_0x33c1f9,null));};exports[_0xa273('0x25')]=function(_0x81d1d8,_0x46c950){if(_0x81d1d8[_0xa273('0x48')]['id']){delete _0x81d1d8[_0xa273('0x48')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x81d1d8[_0xa273('0x45')]['id']}})[_0xa273('0x26')](handleEntityNotFound(_0x46c950,null))[_0xa273('0x26')](saveUpdates(_0x81d1d8['body'],null))[_0xa273('0x26')](respondWithResult(_0x46c950,null))[_0xa273('0x44')](handleError(_0x46c950,null));};exports['destroy']=function(_0x375451,_0x25c033){return db[_0xa273('0x2d')]['find']({'where':{'id':_0x375451['params']['id']}})[_0xa273('0x26')](handleEntityNotFound(_0x25c033,null))[_0xa273('0x26')](removeEntity(_0x25c033,null))[_0xa273('0x44')](handleError(_0x25c033,null));};exports[_0xa273('0x49')]=function(_0x2cbee2,_0x504586,_0x55193e){var _0x85488c={};var _0x336863={};var _0x5e1dd5;var _0x402d17;return db[_0xa273('0x2d')][_0xa273('0x4a')]({'where':{'id':_0x2cbee2['params']['id']}})[_0xa273('0x26')](handleEntityNotFound(_0x504586,null))[_0xa273('0x26')](function(_0x4ea8be){if(_0x4ea8be){_0x5e1dd5=_0x4ea8be;_0x336863[_0xa273('0x31')]=_[_0xa273('0x32')](db[_0xa273('0x4b')][_0xa273('0x2e')]);_0x336863[_0xa273('0x33')]=_[_0xa273('0x32')](_0x2cbee2[_0xa273('0x33')]);_0x336863['filters']=_[_0xa273('0x35')](_0x336863[_0xa273('0x31')],_0x336863[_0xa273('0x33')]);_0x85488c[_0xa273('0x36')]=_[_0xa273('0x35')](_0x336863[_0xa273('0x31')],qs[_0xa273('0x37')](_0x2cbee2['query'][_0xa273('0x37')]));_0x85488c[_0xa273('0x36')]=_0x85488c[_0xa273('0x36')][_0xa273('0x38')]?_0x85488c['attributes']:_0x336863['model'];_0x85488c[_0xa273('0x4c')]=qs[_0xa273('0x3a')](_0x2cbee2['query'][_0xa273('0x3a')]);_0x85488c[_0xa273('0x3b')]=qs[_0xa273('0x34')](_[_0xa273('0x4d')](_0x2cbee2['query'],_0x336863['filters']));if(_0x2cbee2[_0xa273('0x33')][_0xa273('0x3c')]){_0x85488c[_0xa273('0x3b')]=_[_0xa273('0x3d')](_0x85488c[_0xa273('0x3b')],{'$or':_[_0xa273('0x2c')](_0x85488c['attributes'],function(_0x499b01){var _0x1ad42f={};_0x1ad42f[_0x499b01]={'$like':'%'+_0x2cbee2['query'][_0xa273('0x3c')]+'%'};return _0x1ad42f;})});}_0x85488c=_[_0xa273('0x3d')]({},_0x85488c,_0x2cbee2[_0xa273('0x3f')]);return _0x5e1dd5['getFields'](_0x85488c);}})[_0xa273('0x26')](function(_0x55de94){if(_0x55de94){_0x402d17=_0x55de94[_0xa273('0x38')];if(!_0x2cbee2['query'][_0xa273('0x39')](_0xa273('0x4e'))){_0x85488c[_0xa273('0x1d')]=qs[_0xa273('0x1d')](_0x2cbee2['query'][_0xa273('0x1d')]);_0x85488c[_0xa273('0x1f')]=qs[_0xa273('0x1f')](_0x2cbee2['query'][_0xa273('0x1f')]);}return _0x5e1dd5[_0xa273('0x49')](_0x85488c);}})[_0xa273('0x26')](function(_0x36eeff){if(_0x36eeff){return _0x36eeff?{'count':_0x402d17,'rows':_0x36eeff}:null;}})['then'](respondWithResult(_0x504586,null))[_0xa273('0x44')](handleError(_0x504586,null));};exports[_0xa273('0x4f')]=function(_0x31f33d,_0xb718bf,_0xc4fc26){var _0x36cc29={};var _0xb8b08f={};var _0x3ece67;var _0x36f390;return db['Dynamics365Configuration'][_0xa273('0x4a')]({'where':{'id':_0x31f33d[_0xa273('0x45')]['id']}})[_0xa273('0x26')](handleEntityNotFound(_0xb718bf,null))[_0xa273('0x26')](function(_0x830a50){if(_0x830a50){_0x3ece67=_0x830a50;_0xb8b08f[_0xa273('0x31')]=_['keys'](db[_0xa273('0x4b')][_0xa273('0x2e')]);_0xb8b08f[_0xa273('0x33')]=_[_0xa273('0x32')](_0x31f33d['query']);_0xb8b08f[_0xa273('0x34')]=_[_0xa273('0x35')](_0xb8b08f['model'],_0xb8b08f[_0xa273('0x33')]);_0x36cc29[_0xa273('0x36')]=_[_0xa273('0x35')](_0xb8b08f[_0xa273('0x31')],qs[_0xa273('0x37')](_0x31f33d[_0xa273('0x33')][_0xa273('0x37')]));_0x36cc29[_0xa273('0x36')]=_0x36cc29['attributes'][_0xa273('0x38')]?_0x36cc29[_0xa273('0x36')]:_0xb8b08f['model'];_0x36cc29[_0xa273('0x4c')]=qs[_0xa273('0x3a')](_0x31f33d[_0xa273('0x33')][_0xa273('0x3a')]);_0x36cc29[_0xa273('0x3b')]=qs['filters'](_[_0xa273('0x4d')](_0x31f33d[_0xa273('0x33')],_0xb8b08f[_0xa273('0x34')]));if(_0x31f33d['query'][_0xa273('0x3c')]){_0x36cc29[_0xa273('0x3b')]=_['merge'](_0x36cc29[_0xa273('0x3b')],{'$or':_['map'](_0x36cc29[_0xa273('0x36')],function(_0x193f8a){var _0x5bf41d={};_0x5bf41d[_0x193f8a]={'$like':'%'+_0x31f33d[_0xa273('0x33')][_0xa273('0x3c')]+'%'};return _0x5bf41d;})});}_0x36cc29=_[_0xa273('0x3d')]({},_0x36cc29,_0x31f33d['options']);return _0x3ece67[_0xa273('0x4f')](_0x36cc29);}})[_0xa273('0x26')](function(_0x16f54d){if(_0x16f54d){_0x36f390=_0x16f54d[_0xa273('0x38')];if(!_0x31f33d[_0xa273('0x33')][_0xa273('0x39')](_0xa273('0x4e'))){_0x36cc29[_0xa273('0x1d')]=qs[_0xa273('0x1d')](_0x31f33d[_0xa273('0x33')][_0xa273('0x1d')]);_0x36cc29['offset']=qs['offset'](_0x31f33d['query'][_0xa273('0x1f')]);}return _0x3ece67[_0xa273('0x4f')](_0x36cc29);}})[_0xa273('0x26')](function(_0xbd1e1e){if(_0xbd1e1e){return _0xbd1e1e?{'count':_0x36f390,'rows':_0xbd1e1e}:null;}})['then'](respondWithResult(_0xb718bf,null))[_0xa273('0x44')](handleError(_0xb718bf,null));};exports[_0xa273('0x50')]=function(_0x4524b1,_0x13bb6e,_0x283c5f){var _0x86152b={};var _0x359206={};var _0x2effc0;var _0xce6a9f;return db[_0xa273('0x2d')]['findOne']({'where':{'id':_0x4524b1[_0xa273('0x45')]['id']}})['then'](handleEntityNotFound(_0x13bb6e,null))[_0xa273('0x26')](function(_0x1abe1c){if(_0x1abe1c){_0x2effc0=_0x1abe1c;_0x359206[_0xa273('0x31')]=_[_0xa273('0x32')](db[_0xa273('0x4b')][_0xa273('0x2e')]);_0x359206['query']=_[_0xa273('0x32')](_0x4524b1[_0xa273('0x33')]);_0x359206['filters']=_[_0xa273('0x35')](_0x359206[_0xa273('0x31')],_0x359206[_0xa273('0x33')]);_0x86152b['attributes']=_[_0xa273('0x35')](_0x359206['model'],qs['fields'](_0x4524b1[_0xa273('0x33')][_0xa273('0x37')]));_0x86152b[_0xa273('0x36')]=_0x86152b[_0xa273('0x36')][_0xa273('0x38')]?_0x86152b[_0xa273('0x36')]:_0x359206[_0xa273('0x31')];_0x86152b[_0xa273('0x4c')]=qs[_0xa273('0x3a')](_0x4524b1[_0xa273('0x33')][_0xa273('0x3a')]);_0x86152b['where']=qs[_0xa273('0x34')](_[_0xa273('0x4d')](_0x4524b1[_0xa273('0x33')],_0x359206['filters']));if(_0x4524b1[_0xa273('0x33')][_0xa273('0x3c')]){_0x86152b[_0xa273('0x3b')]=_[_0xa273('0x3d')](_0x86152b[_0xa273('0x3b')],{'$or':_[_0xa273('0x2c')](_0x86152b[_0xa273('0x36')],function(_0x2674e4){var _0x2e88fa={};_0x2e88fa[_0x2674e4]={'$like':'%'+_0x4524b1[_0xa273('0x33')]['filter']+'%'};return _0x2e88fa;})});}_0x86152b=_[_0xa273('0x3d')]({},_0x86152b,_0x4524b1[_0xa273('0x3f')]);return _0x2effc0[_0xa273('0x50')](_0x86152b);}})[_0xa273('0x26')](function(_0x1ab22f){if(_0x1ab22f){_0xce6a9f=_0x1ab22f[_0xa273('0x38')];if(!_0x4524b1['query'][_0xa273('0x39')](_0xa273('0x4e'))){_0x86152b['limit']=qs['limit'](_0x4524b1['query'][_0xa273('0x1d')]);_0x86152b[_0xa273('0x1f')]=qs[_0xa273('0x1f')](_0x4524b1['query'][_0xa273('0x1f')]);}return _0x2effc0[_0xa273('0x50')](_0x86152b);}})['then'](function(_0x4f9b0a){if(_0x4f9b0a){return _0x4f9b0a?{'count':_0xce6a9f,'rows':_0x4f9b0a}:null;}})[_0xa273('0x26')](respondWithResult(_0x13bb6e,null))[_0xa273('0x44')](handleError(_0x13bb6e,null));};
\ No newline at end of file
+var _0x1418=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','Dynamics365Configuration','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','update','find','getFields','findOne','Dynamics365Field','rawAttributes','sort','nolimit','getSubjects','getDescriptions','order','rimraf','request-promise','moment','util','ejs'];(function(_0x37e2a6,_0xc52f3d){var _0x3c4754=function(_0x2d8ffb){while(--_0x2d8ffb){_0x37e2a6['push'](_0x37e2a6['shift']());}};_0x3c4754(++_0xc52f3d);}(_0x1418,0x12f));var _0x8141=function(_0x322bf2,_0x675eaf){_0x322bf2=_0x322bf2-0x0;var _0x5bbda9=_0x1418[_0x322bf2];return _0x5bbda9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8141('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8141('0x1'));var moment=require(_0x8141('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8141('0x3'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8141('0x4'));var fs=require('fs');var fs_extra=require(_0x8141('0x5'));var _=require(_0x8141('0x6'));var squel=require(_0x8141('0x7'));var crypto=require(_0x8141('0x8'));var jsforce=require(_0x8141('0x9'));var deskjs=require(_0x8141('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8141('0xb'));var Papa=require(_0x8141('0xc'));var Redis=require(_0x8141('0xd'));var authService=require(_0x8141('0xe'));var qs=require(_0x8141('0xf'));var as=require(_0x8141('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8141('0x11'));var config=require(_0x8141('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x8141('0x13'))['db'];function respondWithStatusCode(_0x52be76,_0x129f9b){_0x129f9b=_0x129f9b||0xcc;return function(_0x20860f){if(_0x20860f){return _0x52be76[_0x8141('0x14')](_0x129f9b);}return _0x52be76[_0x8141('0x15')](_0x129f9b)[_0x8141('0x16')]();};}function respondWithResult(_0x343a5e,_0x3a9af5){_0x3a9af5=_0x3a9af5||0xc8;return function(_0x3eeccb){if(_0x3eeccb){return _0x343a5e[_0x8141('0x15')](_0x3a9af5)[_0x8141('0x17')](_0x3eeccb);}};}function respondWithFilteredResult(_0x36e814,_0x2a5b70){return function(_0x359be9){if(_0x359be9){var _0x16f541=typeof _0x2a5b70['offset']===_0x8141('0x18')&&typeof _0x2a5b70['limit']==='undefined';var _0x1fa78c=_0x359be9[_0x8141('0x19')];var _0x2e32c1=_0x16f541?0x0:_0x2a5b70[_0x8141('0x1a')];var _0x2b2190=_0x16f541?_0x359be9[_0x8141('0x19')]:_0x2a5b70['offset']+_0x2a5b70['limit'];var _0x892cc2;if(_0x2b2190>=_0x1fa78c){_0x2b2190=_0x1fa78c;_0x892cc2=0xc8;}else{_0x892cc2=0xce;}_0x36e814['status'](_0x892cc2);return _0x36e814[_0x8141('0x1b')](_0x8141('0x1c'),_0x2e32c1+'-'+_0x2b2190+'/'+_0x1fa78c)['json'](_0x359be9);}return null;};}function patchUpdates(_0x19a801){return function(_0x30ea1b){try{jsonpatch[_0x8141('0x1d')](_0x30ea1b,_0x19a801,!![]);}catch(_0x5d7faf){return BPromise[_0x8141('0x1e')](_0x5d7faf);}return _0x30ea1b[_0x8141('0x1f')]();};}function saveUpdates(_0x3ee7c0,_0x450612){return function(_0x1fd942){if(_0x1fd942){return _0x1fd942['update'](_0x3ee7c0)['then'](function(_0x4aa490){return _0x4aa490;});}return null;};}function removeEntity(_0x31a5fe,_0x3d764b){return function(_0x4449c9){if(_0x4449c9){return _0x4449c9[_0x8141('0x20')]()[_0x8141('0x21')](function(){_0x31a5fe['status'](0xcc)[_0x8141('0x16')]();});}};}function handleEntityNotFound(_0x261d5d,_0x25be8a){return function(_0x952cc5){if(!_0x952cc5){_0x261d5d[_0x8141('0x14')](0x194);}return _0x952cc5;};}function handleError(_0x374513,_0x5ed58d){_0x5ed58d=_0x5ed58d||0x1f4;return function(_0x27c3e1){logger[_0x8141('0x22')](_0x27c3e1['stack']);if(_0x27c3e1[_0x8141('0x23')]){delete _0x27c3e1['name'];}_0x374513['status'](_0x5ed58d)[_0x8141('0x24')](_0x27c3e1);};}exports[_0x8141('0x25')]=function(_0x38b090,_0xfaec65){var _0x472db9={},_0x211ddb={},_0x52b604={'count':0x0,'rows':[]};var _0x4c8437=_[_0x8141('0x26')](db[_0x8141('0x27')]['rawAttributes'],function(_0x8061a6){return{'name':_0x8061a6[_0x8141('0x28')],'type':_0x8061a6[_0x8141('0x29')]['key']};});_0x211ddb[_0x8141('0x2a')]=_[_0x8141('0x26')](_0x4c8437,_0x8141('0x23'));_0x211ddb[_0x8141('0x2b')]=_['keys'](_0x38b090['query']);_0x211ddb[_0x8141('0x2c')]=_[_0x8141('0x2d')](_0x211ddb[_0x8141('0x2a')],_0x211ddb[_0x8141('0x2b')]);_0x472db9[_0x8141('0x2e')]=_[_0x8141('0x2d')](_0x211ddb['model'],qs['fields'](_0x38b090['query'][_0x8141('0x2f')]));_0x472db9[_0x8141('0x2e')]=_0x472db9[_0x8141('0x2e')][_0x8141('0x30')]?_0x472db9[_0x8141('0x2e')]:_0x211ddb[_0x8141('0x2a')];if(!_0x38b090[_0x8141('0x2b')][_0x8141('0x31')]('nolimit')){_0x472db9[_0x8141('0x32')]=qs[_0x8141('0x32')](_0x38b090['query'][_0x8141('0x32')]);_0x472db9[_0x8141('0x1a')]=qs[_0x8141('0x1a')](_0x38b090[_0x8141('0x2b')][_0x8141('0x1a')]);}_0x472db9['order']=qs['sort'](_0x38b090[_0x8141('0x2b')]['sort']);_0x472db9[_0x8141('0x33')]=qs['filters'](_[_0x8141('0x34')](_0x38b090[_0x8141('0x2b')],_0x211ddb[_0x8141('0x2c')]),_0x4c8437);if(_0x38b090[_0x8141('0x2b')][_0x8141('0x35')]){_0x472db9['where']=_[_0x8141('0x36')](_0x472db9['where'],{'$or':_['map'](_0x4c8437,function(_0x2c3832){if(_0x2c3832[_0x8141('0x29')]!=='VIRTUAL'){var _0x59c681={};_0x59c681[_0x2c3832['name']]={'$like':'%'+_0x38b090['query']['filter']+'%'};return _0x59c681;}})});}_0x472db9=_[_0x8141('0x36')]({},_0x472db9,_0x38b090[_0x8141('0x37')]);var _0x4dee38={'where':_0x472db9[_0x8141('0x33')]};return db[_0x8141('0x27')][_0x8141('0x19')](_0x4dee38)['then'](function(_0x2f8180){_0x52b604[_0x8141('0x19')]=_0x2f8180;if(_0x38b090['query'][_0x8141('0x38')]){_0x472db9[_0x8141('0x39')]=[{'all':!![]}];}return db[_0x8141('0x27')][_0x8141('0x3a')](_0x472db9);})[_0x8141('0x21')](function(_0x1adcdd){_0x52b604[_0x8141('0x3b')]=_0x1adcdd;return _0x52b604;})[_0x8141('0x21')](respondWithFilteredResult(_0xfaec65,_0x472db9))['catch'](handleError(_0xfaec65,null));};exports[_0x8141('0x3c')]=function(_0x49a767,_0x9afa0){var _0x336fe5={'raw':![],'where':{'id':_0x49a767[_0x8141('0x3d')]['id']}},_0x336f21={};_0x336f21[_0x8141('0x2a')]=_[_0x8141('0x3e')](db[_0x8141('0x27')]['rawAttributes']);_0x336f21[_0x8141('0x2b')]=_[_0x8141('0x3e')](_0x49a767['query']);_0x336f21[_0x8141('0x2c')]=_[_0x8141('0x2d')](_0x336f21['model'],_0x336f21['query']);_0x336fe5[_0x8141('0x2e')]=_[_0x8141('0x2d')](_0x336f21[_0x8141('0x2a')],qs['fields'](_0x49a767[_0x8141('0x2b')]['fields']));_0x336fe5[_0x8141('0x2e')]=_0x336fe5[_0x8141('0x2e')][_0x8141('0x30')]?_0x336fe5[_0x8141('0x2e')]:_0x336f21[_0x8141('0x2a')];if(_0x49a767[_0x8141('0x2b')][_0x8141('0x38')]){_0x336fe5[_0x8141('0x39')]=[{'all':!![]}];}_0x336fe5=_[_0x8141('0x36')]({},_0x336fe5,_0x49a767[_0x8141('0x37')]);return db['Dynamics365Configuration']['find'](_0x336fe5)[_0x8141('0x21')](handleEntityNotFound(_0x9afa0,null))[_0x8141('0x21')](respondWithResult(_0x9afa0,null))[_0x8141('0x3f')](handleError(_0x9afa0,null));};exports[_0x8141('0x40')]=function(_0x45a721,_0x302d77){return db[_0x8141('0x27')]['create'](_0x45a721[_0x8141('0x41')],{})[_0x8141('0x21')](respondWithResult(_0x302d77,0xc9))[_0x8141('0x3f')](handleError(_0x302d77,null));};exports[_0x8141('0x42')]=function(_0x21fd9d,_0x198999){if(_0x21fd9d[_0x8141('0x41')]['id']){delete _0x21fd9d['body']['id'];}return db[_0x8141('0x27')][_0x8141('0x43')]({'where':{'id':_0x21fd9d[_0x8141('0x3d')]['id']}})[_0x8141('0x21')](handleEntityNotFound(_0x198999,null))[_0x8141('0x21')](saveUpdates(_0x21fd9d[_0x8141('0x41')],null))[_0x8141('0x21')](respondWithResult(_0x198999,null))[_0x8141('0x3f')](handleError(_0x198999,null));};exports['destroy']=function(_0xc4c8b2,_0x5c551e){return db['Dynamics365Configuration'][_0x8141('0x43')]({'where':{'id':_0xc4c8b2['params']['id']}})[_0x8141('0x21')](handleEntityNotFound(_0x5c551e,null))[_0x8141('0x21')](removeEntity(_0x5c551e,null))[_0x8141('0x3f')](handleError(_0x5c551e,null));};exports[_0x8141('0x44')]=function(_0x38a899,_0x46ee22,_0x5b7b15){var _0x4a0722={};var _0x1369dc={};var _0x292e51;var _0x4dc006;return db[_0x8141('0x27')][_0x8141('0x45')]({'where':{'id':_0x38a899[_0x8141('0x3d')]['id']}})[_0x8141('0x21')](handleEntityNotFound(_0x46ee22,null))[_0x8141('0x21')](function(_0x3dc0c8){if(_0x3dc0c8){_0x292e51=_0x3dc0c8;_0x1369dc['model']=_[_0x8141('0x3e')](db[_0x8141('0x46')][_0x8141('0x47')]);_0x1369dc[_0x8141('0x2b')]=_[_0x8141('0x3e')](_0x38a899[_0x8141('0x2b')]);_0x1369dc['filters']=_[_0x8141('0x2d')](_0x1369dc['model'],_0x1369dc[_0x8141('0x2b')]);_0x4a0722[_0x8141('0x2e')]=_['intersection'](_0x1369dc[_0x8141('0x2a')],qs[_0x8141('0x2f')](_0x38a899[_0x8141('0x2b')][_0x8141('0x2f')]));_0x4a0722[_0x8141('0x2e')]=_0x4a0722['attributes'][_0x8141('0x30')]?_0x4a0722['attributes']:_0x1369dc['model'];_0x4a0722['order']=qs[_0x8141('0x48')](_0x38a899[_0x8141('0x2b')]['sort']);_0x4a0722[_0x8141('0x33')]=qs[_0x8141('0x2c')](_['pick'](_0x38a899['query'],_0x1369dc[_0x8141('0x2c')]));if(_0x38a899[_0x8141('0x2b')][_0x8141('0x35')]){_0x4a0722[_0x8141('0x33')]=_['merge'](_0x4a0722[_0x8141('0x33')],{'$or':_[_0x8141('0x26')](_0x4a0722[_0x8141('0x2e')],function(_0x1193e9){var _0x58f704={};_0x58f704[_0x1193e9]={'$like':'%'+_0x38a899[_0x8141('0x2b')][_0x8141('0x35')]+'%'};return _0x58f704;})});}_0x4a0722=_[_0x8141('0x36')]({},_0x4a0722,_0x38a899[_0x8141('0x37')]);return _0x292e51[_0x8141('0x44')](_0x4a0722);}})[_0x8141('0x21')](function(_0x4df9af){if(_0x4df9af){_0x4dc006=_0x4df9af['length'];if(!_0x38a899[_0x8141('0x2b')][_0x8141('0x31')](_0x8141('0x49'))){_0x4a0722[_0x8141('0x32')]=qs[_0x8141('0x32')](_0x38a899[_0x8141('0x2b')][_0x8141('0x32')]);_0x4a0722[_0x8141('0x1a')]=qs[_0x8141('0x1a')](_0x38a899[_0x8141('0x2b')][_0x8141('0x1a')]);}return _0x292e51[_0x8141('0x44')](_0x4a0722);}})[_0x8141('0x21')](function(_0x5c1073){if(_0x5c1073){return _0x5c1073?{'count':_0x4dc006,'rows':_0x5c1073}:null;}})['then'](respondWithResult(_0x46ee22,null))[_0x8141('0x3f')](handleError(_0x46ee22,null));};exports[_0x8141('0x4a')]=function(_0x4a45e8,_0x4dfe71,_0x54ba7f){var _0x59034f={};var _0x4e0394={};var _0x2bbc8b;var _0x4bb89c;return db[_0x8141('0x27')][_0x8141('0x45')]({'where':{'id':_0x4a45e8[_0x8141('0x3d')]['id']}})[_0x8141('0x21')](handleEntityNotFound(_0x4dfe71,null))['then'](function(_0x3e3f67){if(_0x3e3f67){_0x2bbc8b=_0x3e3f67;_0x4e0394[_0x8141('0x2a')]=_[_0x8141('0x3e')](db[_0x8141('0x46')]['rawAttributes']);_0x4e0394[_0x8141('0x2b')]=_[_0x8141('0x3e')](_0x4a45e8[_0x8141('0x2b')]);_0x4e0394[_0x8141('0x2c')]=_[_0x8141('0x2d')](_0x4e0394['model'],_0x4e0394[_0x8141('0x2b')]);_0x59034f[_0x8141('0x2e')]=_['intersection'](_0x4e0394[_0x8141('0x2a')],qs[_0x8141('0x2f')](_0x4a45e8[_0x8141('0x2b')][_0x8141('0x2f')]));_0x59034f[_0x8141('0x2e')]=_0x59034f[_0x8141('0x2e')][_0x8141('0x30')]?_0x59034f[_0x8141('0x2e')]:_0x4e0394[_0x8141('0x2a')];_0x59034f['order']=qs[_0x8141('0x48')](_0x4a45e8[_0x8141('0x2b')]['sort']);_0x59034f[_0x8141('0x33')]=qs[_0x8141('0x2c')](_[_0x8141('0x34')](_0x4a45e8['query'],_0x4e0394['filters']));if(_0x4a45e8[_0x8141('0x2b')][_0x8141('0x35')]){_0x59034f[_0x8141('0x33')]=_[_0x8141('0x36')](_0x59034f[_0x8141('0x33')],{'$or':_[_0x8141('0x26')](_0x59034f[_0x8141('0x2e')],function(_0x497730){var _0x335c3f={};_0x335c3f[_0x497730]={'$like':'%'+_0x4a45e8[_0x8141('0x2b')][_0x8141('0x35')]+'%'};return _0x335c3f;})});}_0x59034f=_[_0x8141('0x36')]({},_0x59034f,_0x4a45e8[_0x8141('0x37')]);return _0x2bbc8b[_0x8141('0x4a')](_0x59034f);}})[_0x8141('0x21')](function(_0x26fb71){if(_0x26fb71){_0x4bb89c=_0x26fb71['length'];if(!_0x4a45e8[_0x8141('0x2b')][_0x8141('0x31')](_0x8141('0x49'))){_0x59034f[_0x8141('0x32')]=qs[_0x8141('0x32')](_0x4a45e8[_0x8141('0x2b')]['limit']);_0x59034f['offset']=qs[_0x8141('0x1a')](_0x4a45e8['query'][_0x8141('0x1a')]);}return _0x2bbc8b['getSubjects'](_0x59034f);}})[_0x8141('0x21')](function(_0x47be71){if(_0x47be71){return _0x47be71?{'count':_0x4bb89c,'rows':_0x47be71}:null;}})[_0x8141('0x21')](respondWithResult(_0x4dfe71,null))[_0x8141('0x3f')](handleError(_0x4dfe71,null));};exports[_0x8141('0x4b')]=function(_0x272099,_0x309a7a,_0x286bc6){var _0x263fe7={};var _0x3154b8={};var _0x119687;var _0x28a6ca;return db[_0x8141('0x27')][_0x8141('0x45')]({'where':{'id':_0x272099[_0x8141('0x3d')]['id']}})['then'](handleEntityNotFound(_0x309a7a,null))[_0x8141('0x21')](function(_0x4002bc){if(_0x4002bc){_0x119687=_0x4002bc;_0x3154b8[_0x8141('0x2a')]=_[_0x8141('0x3e')](db[_0x8141('0x46')][_0x8141('0x47')]);_0x3154b8[_0x8141('0x2b')]=_[_0x8141('0x3e')](_0x272099['query']);_0x3154b8[_0x8141('0x2c')]=_[_0x8141('0x2d')](_0x3154b8[_0x8141('0x2a')],_0x3154b8[_0x8141('0x2b')]);_0x263fe7['attributes']=_[_0x8141('0x2d')](_0x3154b8[_0x8141('0x2a')],qs[_0x8141('0x2f')](_0x272099[_0x8141('0x2b')]['fields']));_0x263fe7[_0x8141('0x2e')]=_0x263fe7[_0x8141('0x2e')][_0x8141('0x30')]?_0x263fe7['attributes']:_0x3154b8[_0x8141('0x2a')];_0x263fe7[_0x8141('0x4c')]=qs[_0x8141('0x48')](_0x272099[_0x8141('0x2b')]['sort']);_0x263fe7['where']=qs['filters'](_[_0x8141('0x34')](_0x272099[_0x8141('0x2b')],_0x3154b8[_0x8141('0x2c')]));if(_0x272099[_0x8141('0x2b')][_0x8141('0x35')]){_0x263fe7[_0x8141('0x33')]=_['merge'](_0x263fe7[_0x8141('0x33')],{'$or':_['map'](_0x263fe7[_0x8141('0x2e')],function(_0x1eee34){var _0x317c7d={};_0x317c7d[_0x1eee34]={'$like':'%'+_0x272099[_0x8141('0x2b')]['filter']+'%'};return _0x317c7d;})});}_0x263fe7=_[_0x8141('0x36')]({},_0x263fe7,_0x272099[_0x8141('0x37')]);return _0x119687[_0x8141('0x4b')](_0x263fe7);}})[_0x8141('0x21')](function(_0x5a6183){if(_0x5a6183){_0x28a6ca=_0x5a6183[_0x8141('0x30')];if(!_0x272099['query'][_0x8141('0x31')](_0x8141('0x49'))){_0x263fe7['limit']=qs[_0x8141('0x32')](_0x272099[_0x8141('0x2b')][_0x8141('0x32')]);_0x263fe7[_0x8141('0x1a')]=qs[_0x8141('0x1a')](_0x272099['query'][_0x8141('0x1a')]);}return _0x119687[_0x8141('0x4b')](_0x263fe7);}})['then'](function(_0x1af713){if(_0x1af713){return _0x1af713?{'count':_0x28a6ca,'rows':_0x1af713}:null;}})[_0x8141('0x21')](respondWithResult(_0x309a7a,null))[_0x8141('0x3f')](handleError(_0x309a7a,null));};
\ No newline at end of file
index c1bedf9..26a0674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x55ca,0x126));var _0xa55c=function(_0x3f4bb3,_0x54f0de){_0x3f4bb3=_0x3f4bb3-0x0;var _0x1cb73a=_0x55ca[_0x3f4bb3];return _0x1cb73a;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Dynamics365Configuration',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0x2c67a9,_0x37c2df){var _0x578b9c=function(_0x335f3d){while(--_0x335f3d){_0x2c67a9['push'](_0x2c67a9['shift']());}};_0x578b9c(++_0x37c2df);}(_0x9bde,0xe1));var _0xe9bd=function(_0x58b6fe,_0x80c95d){_0x58b6fe=_0x58b6fe-0x0;var _0x442ad2=_0x9bde[_0x58b6fe];return _0x442ad2;};'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 4f5d9be..1cb61a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dbb=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x388cf7,_0x158793){var _0x2dfcab=function(_0x45cac6){while(--_0x45cac6){_0x388cf7['push'](_0x388cf7['shift']());}};_0x2dfcab(++_0x158793);}(_0x0dbb,0x85));var _0xb0db=function(_0x5cde9e,_0x374adf){_0x5cde9e=_0x5cde9e-0x0;var _0x25dc9d=_0x0dbb[_0x5cde9e];return _0x25dc9d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb0db('0x0'));var BPromise=require(_0xb0db('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0db('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb0db('0x3'));var config=require(_0xb0db('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xb0db('0x5')][_0xb0db('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4dead2,_0x5bb962,_0x277390){return new BPromise(function(_0x6a1497,_0x795d2f){return client[_0xb0db('0x7')](_0x4dead2,_0x277390)[_0xb0db('0x8')](function(_0x4ef38e){logger[_0xb0db('0x9')](_0xb0db('0xa'),_0x5bb962,_0xb0db('0xb'));logger[_0xb0db('0xc')](_0xb0db('0xd'),_0x5bb962,_0xb0db('0xb'),JSON['stringify'](_0x4ef38e));if(_0x4ef38e[_0xb0db('0xe')]){if(_0x4ef38e['error'][_0xb0db('0xf')]===0x1f4){logger[_0xb0db('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5bb962,_0x4ef38e[_0xb0db('0xe')][_0xb0db('0x10')]);return _0x795d2f(_0x4ef38e['error'][_0xb0db('0x10')]);}logger['error'](_0xb0db('0xa'),_0x5bb962,_0x4ef38e[_0xb0db('0xe')][_0xb0db('0x10')]);return _0x6a1497(_0x4ef38e['error']['message']);}else{logger[_0xb0db('0x9')](_0xb0db('0xa'),_0x5bb962,_0xb0db('0xb'));_0x6a1497(_0x4ef38e['result'][_0xb0db('0x10')]);}})[_0xb0db('0x11')](function(_0x3027d5){logger[_0xb0db('0xe')](_0xb0db('0xa'),_0x5bb962,_0x3027d5);_0x795d2f(_0x3027d5);});});}
\ No newline at end of file
+var _0xc64d=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x37dcf8,_0x50437b){var _0x1d121c=function(_0x5bf87f){while(--_0x5bf87f){_0x37dcf8['push'](_0x37dcf8['shift']());}};_0x1d121c(++_0x50437b);}(_0xc64d,0x100));var _0xdc64=function(_0x4ac256,_0x2b6e15){_0x4ac256=_0x4ac256-0x0;var _0x25478e=_0xc64d[_0x4ac256];return _0x25478e;};'use strict';var _=require('lodash');var util=require(_0xdc64('0x0'));var moment=require(_0xdc64('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(_0xdc64('0x2'));var logger=require(_0xdc64('0x3'))(_0xdc64('0x4'));var config=require(_0xdc64('0x5'));var jayson=require(_0xdc64('0x6'));var client=jayson[_0xdc64('0x7')][_0xdc64('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51bf13,_0x2fdac8,_0x5ba6d9){return new BPromise(function(_0x186935,_0x1e3857){return client['request'](_0x51bf13,_0x5ba6d9)[_0xdc64('0x9')](function(_0xcedda1){logger[_0xdc64('0xa')](_0xdc64('0xb'),_0x2fdac8,_0xdc64('0xc'));logger[_0xdc64('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2fdac8,'request\x20sent',JSON[_0xdc64('0xe')](_0xcedda1));if(_0xcedda1['error']){if(_0xcedda1[_0xdc64('0xf')]['code']===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2fdac8,_0xcedda1[_0xdc64('0xf')][_0xdc64('0x10')]);return _0x1e3857(_0xcedda1[_0xdc64('0xf')][_0xdc64('0x10')]);}logger['error'](_0xdc64('0xb'),_0x2fdac8,_0xcedda1['error'][_0xdc64('0x10')]);return _0x186935(_0xcedda1[_0xdc64('0xf')][_0xdc64('0x10')]);}else{logger[_0xdc64('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2fdac8,'request\x20sent');_0x186935(_0xcedda1[_0xdc64('0x11')][_0xdc64('0x10')]);}})[_0xdc64('0x12')](function(_0x407160){logger[_0xdc64('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2fdac8,_0x407160);_0x1e3857(_0x407160);});});}
\ No newline at end of file
index 516f2cb..d01fe9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cca=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','create','put','delete','exports','multer'];(function(_0x31b748,_0x416766){var _0x750871=function(_0x5a7a3a){while(--_0x5a7a3a){_0x31b748['push'](_0x31b748['shift']());}};_0x750871(++_0x416766);}(_0x7cca,0x6b));var _0xa7cc=function(_0x209e43,_0x39c9b3){_0x209e43=_0x209e43-0x0;var _0xa7a1d4=_0x7cca[_0x209e43];return _0xa7a1d4;};'use strict';var multer=require(_0xa7cc('0x0'));var util=require(_0xa7cc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa7cc('0x2'));var router=express[_0xa7cc('0x3')]();var fs_extra=require(_0xa7cc('0x4'));var auth=require(_0xa7cc('0x5'));var interaction=require(_0xa7cc('0x6'));var config=require(_0xa7cc('0x7'));var controller=require(_0xa7cc('0x8'));router[_0xa7cc('0x9')]('/',auth[_0xa7cc('0xa')](),controller[_0xa7cc('0xb')]);router['get'](_0xa7cc('0xc'),auth[_0xa7cc('0xa')](),controller[_0xa7cc('0xd')]);router['post']('/',auth[_0xa7cc('0xa')](),controller[_0xa7cc('0xe')]);router[_0xa7cc('0xf')](_0xa7cc('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa7cc('0x10')](_0xa7cc('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa7cc('0x11')]=router;
\ No newline at end of file
+var _0x28c6=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','update','destroy'];(function(_0x2d3f28,_0x58fdf4){var _0x456b31=function(_0x5a4154){while(--_0x5a4154){_0x2d3f28['push'](_0x2d3f28['shift']());}};_0x456b31(++_0x58fdf4);}(_0x28c6,0x132));var _0x628c=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0x28c6[_0x2468b5];return _0x1056e4;};'use strict';var multer=require(_0x628c('0x0'));var util=require(_0x628c('0x1'));var path=require(_0x628c('0x2'));var timeout=require(_0x628c('0x3'));var express=require(_0x628c('0x4'));var router=express[_0x628c('0x5')]();var fs_extra=require(_0x628c('0x6'));var auth=require(_0x628c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x628c('0x8'));var controller=require(_0x628c('0x9'));router[_0x628c('0xa')]('/',auth[_0x628c('0xb')](),controller[_0x628c('0xc')]);router['get'](_0x628c('0xd'),auth[_0x628c('0xb')](),controller['show']);router[_0x628c('0xe')]('/',auth[_0x628c('0xb')](),controller[_0x628c('0xf')]);router['put']('/:id',auth[_0x628c('0xb')](),controller[_0x628c('0x10')]);router['delete'](_0x628c('0xd'),auth[_0x628c('0xb')](),controller[_0x628c('0x11')]);module['exports']=router;
\ No newline at end of file
index 506179c..e4820f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7696=['STRING','BOOLEAN','sequelize','ENUM','string','customVariable'];(function(_0x3d61c6,_0x4571e6){var _0x47e0df=function(_0x25adfd){while(--_0x25adfd){_0x3d61c6['push'](_0x3d61c6['shift']());}};_0x47e0df(++_0x4571e6);}(_0x7696,0x134));var _0x6769=function(_0x3aced7,_0x1ebc3a){_0x3aced7=_0x3aced7-0x0;var _0x249c14=_0x7696[_0x3aced7];return _0x249c14;};'use strict';var Sequelize=require(_0x6769('0x0'));module['exports']={'type':{'type':Sequelize[_0x6769('0x1')](_0x6769('0x2'),'variable',_0x6769('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x6769('0x4')]},'key':{'type':Sequelize[_0x6769('0x4')]},'keyType':{'type':Sequelize[_0x6769('0x1')](_0x6769('0x2'),'variable',_0x6769('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6769('0x4')]},'customField':{'type':Sequelize[_0x6769('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6769('0x4')]}};
\ No newline at end of file
+var _0x80ba=['sequelize','ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0x80ba,0x1a0));var _0xa80b=function(_0x30810d,_0x519cbe){_0x30810d=_0x30810d-0x0;var _0x56388f=_0x80ba[_0x30810d];return _0x56388f;};'use strict';var Sequelize=require(_0xa80b('0x0'));module['exports']={'type':{'type':Sequelize[_0xa80b('0x1')](_0xa80b('0x2'),_0xa80b('0x3'),'customVariable',_0xa80b('0x4'),_0xa80b('0x5')),'defaultValue':_0xa80b('0x2')},'content':{'type':Sequelize[_0xa80b('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa80b('0x1')](_0xa80b('0x2'),_0xa80b('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa80b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa80b('0x6')]},'customField':{'type':Sequelize[_0xa80b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa80b('0x6')]}};
\ No newline at end of file
index fffe63d..accc8bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d62=['catch','show','create','body','find','params','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows'];(function(_0x4624c7,_0xce5996){var _0x5ea1fd=function(_0x3e9977){while(--_0x3e9977){_0x4624c7['push'](_0x4624c7['shift']());}};_0x5ea1fd(++_0xce5996);}(_0x8d62,0x155));var _0x28d6=function(_0x5ddb0d,_0x576dff){_0x5ddb0d=_0x5ddb0d-0x0;var _0x355a94=_0x8d62[_0x5ddb0d];return _0x355a94;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x28d6('0x0'));var jsonpatch=require(_0x28d6('0x1'));var rp=require(_0x28d6('0x2'));var moment=require('moment');var BPromise=require(_0x28d6('0x3'));var Mustache=require(_0x28d6('0x4'));var util=require('util');var path=require(_0x28d6('0x5'));var sox=require('sox');var csv=require(_0x28d6('0x6'));var ejs=require(_0x28d6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28d6('0x8'));var squel=require('squel');var crypto=require(_0x28d6('0x9'));var jsforce=require(_0x28d6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x28d6('0x6'));var querystring=require(_0x28d6('0xb'));var Papa=require(_0x28d6('0xc'));var Redis=require(_0x28d6('0xd'));var authService=require(_0x28d6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x28d6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x28d6('0x10'));var utils=require('../../config/utils');var config=require(_0x28d6('0x11'));var licenseUtil=require(_0x28d6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31287c,_0xe1bd28){_0xe1bd28=_0xe1bd28||0xcc;return function(_0xa0ed72){if(_0xa0ed72){return _0x31287c[_0x28d6('0x13')](_0xe1bd28);}return _0x31287c[_0x28d6('0x14')](_0xe1bd28)[_0x28d6('0x15')]();};}function respondWithResult(_0x4eddd7,_0x3a5b59){_0x3a5b59=_0x3a5b59||0xc8;return function(_0x13d5ae){if(_0x13d5ae){return _0x4eddd7[_0x28d6('0x14')](_0x3a5b59)[_0x28d6('0x16')](_0x13d5ae);}};}function respondWithFilteredResult(_0x200c88,_0x218642){return function(_0xecf4c4){if(_0xecf4c4){var _0x4198cf=typeof _0x218642[_0x28d6('0x17')]===_0x28d6('0x18')&&typeof _0x218642['limit']===_0x28d6('0x18');var _0x4a11cd=_0xecf4c4[_0x28d6('0x19')];var _0x28fb63=_0x4198cf?0x0:_0x218642[_0x28d6('0x17')];var _0x74160a=_0x4198cf?_0xecf4c4[_0x28d6('0x19')]:_0x218642['offset']+_0x218642['limit'];var _0x32768c;if(_0x74160a>=_0x4a11cd){_0x74160a=_0x4a11cd;_0x32768c=0xc8;}else{_0x32768c=0xce;}_0x200c88[_0x28d6('0x14')](_0x32768c);return _0x200c88['set'](_0x28d6('0x1a'),_0x28fb63+'-'+_0x74160a+'/'+_0x4a11cd)[_0x28d6('0x16')](_0xecf4c4);}return null;};}function patchUpdates(_0x16b35e){return function(_0x1c1a69){try{jsonpatch['apply'](_0x1c1a69,_0x16b35e,!![]);}catch(_0x130aa2){return BPromise[_0x28d6('0x1b')](_0x130aa2);}return _0x1c1a69[_0x28d6('0x1c')]();};}function saveUpdates(_0x844d72,_0x16ff50){return function(_0x4d51f6){if(_0x4d51f6){return _0x4d51f6[_0x28d6('0x1d')](_0x844d72)[_0x28d6('0x1e')](function(_0x5cadc6){return _0x5cadc6;});}return null;};}function removeEntity(_0x44a2cc,_0x1c20ac){return function(_0x507e46){if(_0x507e46){return _0x507e46[_0x28d6('0x1f')]()['then'](function(){_0x44a2cc[_0x28d6('0x14')](0xcc)[_0x28d6('0x15')]();});}};}function handleEntityNotFound(_0x4e412c,_0x1940e0){return function(_0xc1d6d0){if(!_0xc1d6d0){_0x4e412c[_0x28d6('0x13')](0x194);}return _0xc1d6d0;};}function handleError(_0x55c2ba,_0x1d8a11){_0x1d8a11=_0x1d8a11||0x1f4;return function(_0x2db6e4){logger[_0x28d6('0x20')](_0x2db6e4[_0x28d6('0x21')]);if(_0x2db6e4[_0x28d6('0x22')]){delete _0x2db6e4[_0x28d6('0x22')];}_0x55c2ba[_0x28d6('0x14')](_0x1d8a11)[_0x28d6('0x23')](_0x2db6e4);};}exports[_0x28d6('0x24')]=function(_0x2d21d2,_0x47f04f){var _0x5a6a6b={},_0x113e4c={},_0x6bf759={'count':0x0,'rows':[]};var _0x511c0e=_[_0x28d6('0x25')](db[_0x28d6('0x26')]['rawAttributes'],function(_0x228f75){return{'name':_0x228f75[_0x28d6('0x27')],'type':_0x228f75[_0x28d6('0x28')]['key']};});_0x113e4c[_0x28d6('0x29')]=_[_0x28d6('0x25')](_0x511c0e,_0x28d6('0x22'));_0x113e4c[_0x28d6('0x2a')]=_[_0x28d6('0x2b')](_0x2d21d2['query']);_0x113e4c[_0x28d6('0x2c')]=_[_0x28d6('0x2d')](_0x113e4c[_0x28d6('0x29')],_0x113e4c[_0x28d6('0x2a')]);_0x5a6a6b['attributes']=_[_0x28d6('0x2d')](_0x113e4c[_0x28d6('0x29')],qs[_0x28d6('0x2e')](_0x2d21d2['query'][_0x28d6('0x2e')]));_0x5a6a6b['attributes']=_0x5a6a6b[_0x28d6('0x2f')][_0x28d6('0x30')]?_0x5a6a6b[_0x28d6('0x2f')]:_0x113e4c[_0x28d6('0x29')];if(!_0x2d21d2[_0x28d6('0x2a')]['hasOwnProperty'](_0x28d6('0x31'))){_0x5a6a6b[_0x28d6('0x32')]=qs['limit'](_0x2d21d2[_0x28d6('0x2a')][_0x28d6('0x32')]);_0x5a6a6b[_0x28d6('0x17')]=qs['offset'](_0x2d21d2[_0x28d6('0x2a')]['offset']);}_0x5a6a6b[_0x28d6('0x33')]=qs[_0x28d6('0x34')](_0x2d21d2['query'][_0x28d6('0x34')]);_0x5a6a6b[_0x28d6('0x35')]=qs[_0x28d6('0x2c')](_[_0x28d6('0x36')](_0x2d21d2['query'],_0x113e4c[_0x28d6('0x2c')]),_0x511c0e);if(_0x2d21d2[_0x28d6('0x2a')][_0x28d6('0x37')]){_0x5a6a6b['where']=_['merge'](_0x5a6a6b[_0x28d6('0x35')],{'$or':_[_0x28d6('0x25')](_0x511c0e,function(_0xa32bf8){if(_0xa32bf8['type']!=='VIRTUAL'){var _0x13bacc={};_0x13bacc[_0xa32bf8[_0x28d6('0x22')]]={'$like':'%'+_0x2d21d2[_0x28d6('0x2a')][_0x28d6('0x37')]+'%'};return _0x13bacc;}})});}_0x5a6a6b=_['merge']({},_0x5a6a6b,_0x2d21d2[_0x28d6('0x38')]);var _0x1c40d0={'where':_0x5a6a6b[_0x28d6('0x35')]};return db[_0x28d6('0x26')][_0x28d6('0x19')](_0x1c40d0)['then'](function(_0x20e3b3){_0x6bf759[_0x28d6('0x19')]=_0x20e3b3;if(_0x2d21d2[_0x28d6('0x2a')][_0x28d6('0x39')]){_0x5a6a6b[_0x28d6('0x3a')]=[{'all':!![]}];}return db[_0x28d6('0x26')][_0x28d6('0x3b')](_0x5a6a6b);})[_0x28d6('0x1e')](function(_0x5669a2){_0x6bf759[_0x28d6('0x3c')]=_0x5669a2;return _0x6bf759;})['then'](respondWithFilteredResult(_0x47f04f,_0x5a6a6b))[_0x28d6('0x3d')](handleError(_0x47f04f,null));};exports[_0x28d6('0x3e')]=function(_0x106f8f,_0x37c857){var _0x46233e={'raw':!![],'where':{'id':_0x106f8f['params']['id']}},_0x408503={};_0x408503[_0x28d6('0x29')]=_[_0x28d6('0x2b')](db[_0x28d6('0x26')]['rawAttributes']);_0x408503[_0x28d6('0x2a')]=_['keys'](_0x106f8f[_0x28d6('0x2a')]);_0x408503['filters']=_[_0x28d6('0x2d')](_0x408503[_0x28d6('0x29')],_0x408503[_0x28d6('0x2a')]);_0x46233e[_0x28d6('0x2f')]=_[_0x28d6('0x2d')](_0x408503[_0x28d6('0x29')],qs[_0x28d6('0x2e')](_0x106f8f['query'][_0x28d6('0x2e')]));_0x46233e[_0x28d6('0x2f')]=_0x46233e[_0x28d6('0x2f')][_0x28d6('0x30')]?_0x46233e['attributes']:_0x408503['model'];if(_0x106f8f[_0x28d6('0x2a')][_0x28d6('0x39')]){_0x46233e[_0x28d6('0x3a')]=[{'all':!![]}];}_0x46233e=_['merge']({},_0x46233e,_0x106f8f[_0x28d6('0x38')]);return db[_0x28d6('0x26')]['find'](_0x46233e)[_0x28d6('0x1e')](handleEntityNotFound(_0x37c857,null))[_0x28d6('0x1e')](respondWithResult(_0x37c857,null))['catch'](handleError(_0x37c857,null));};exports[_0x28d6('0x3f')]=function(_0x6a5677,_0x2b1756){return db[_0x28d6('0x26')][_0x28d6('0x3f')](_0x6a5677[_0x28d6('0x40')],{})[_0x28d6('0x1e')](respondWithResult(_0x2b1756,0xc9))[_0x28d6('0x3d')](handleError(_0x2b1756,null));};exports['update']=function(_0x5f22bd,_0x53bb99){if(_0x5f22bd[_0x28d6('0x40')]['id']){delete _0x5f22bd[_0x28d6('0x40')]['id'];}return db[_0x28d6('0x26')][_0x28d6('0x41')]({'where':{'id':_0x5f22bd['params']['id']}})[_0x28d6('0x1e')](handleEntityNotFound(_0x53bb99,null))['then'](saveUpdates(_0x5f22bd['body'],null))[_0x28d6('0x1e')](respondWithResult(_0x53bb99,null))['catch'](handleError(_0x53bb99,null));};exports[_0x28d6('0x1f')]=function(_0x53f0cb,_0x276388){return db['Dynamics365Field'][_0x28d6('0x41')]({'where':{'id':_0x53f0cb[_0x28d6('0x42')]['id']}})[_0x28d6('0x1e')](handleEntityNotFound(_0x276388,null))['then'](removeEntity(_0x276388,null))[_0x28d6('0x3d')](handleError(_0x276388,null));};
\ No newline at end of file
+var _0x9224=['includeAll','include','Dynamics365Field','findAll','rows','catch','show','attributes','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x431b45,_0x40b3c8){var _0x21b559=function(_0x25fb10){while(--_0x25fb10){_0x431b45['push'](_0x431b45['shift']());}};_0x21b559(++_0x40b3c8);}(_0x9224,0x1bc));var _0x4922=function(_0x3853e9,_0x4bc67e){_0x3853e9=_0x3853e9-0x0;var _0x46e85f=_0x9224[_0x3853e9];return _0x46e85f;};'use strict';var emlformat=require(_0x4922('0x0'));var rimraf=require(_0x4922('0x1'));var zipdir=require(_0x4922('0x2'));var jsonpatch=require(_0x4922('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4922('0x4'));var Mustache=require(_0x4922('0x5'));var util=require('util');var path=require(_0x4922('0x6'));var sox=require('sox');var csv=require(_0x4922('0x7'));var ejs=require(_0x4922('0x8'));var fs=require('fs');var fs_extra=require(_0x4922('0x9'));var _=require(_0x4922('0xa'));var squel=require(_0x4922('0xb'));var crypto=require(_0x4922('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4922('0xd'));var Papa=require(_0x4922('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4922('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4922('0x10'))(_0x4922('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4922('0x12'));var db=require(_0x4922('0x13'))['db'];function respondWithStatusCode(_0x4ced26,_0x931925){_0x931925=_0x931925||0xcc;return function(_0x367f89){if(_0x367f89){return _0x4ced26[_0x4922('0x14')](_0x931925);}return _0x4ced26['status'](_0x931925)[_0x4922('0x15')]();};}function respondWithResult(_0x3a3230,_0x3da736){_0x3da736=_0x3da736||0xc8;return function(_0x45828b){if(_0x45828b){return _0x3a3230[_0x4922('0x16')](_0x3da736)[_0x4922('0x17')](_0x45828b);}};}function respondWithFilteredResult(_0x42acd3,_0x1558d8){return function(_0x57565a){if(_0x57565a){var _0x239f2e=typeof _0x1558d8[_0x4922('0x18')]===_0x4922('0x19')&&typeof _0x1558d8['limit']===_0x4922('0x19');var _0x2834f4=_0x57565a[_0x4922('0x1a')];var _0x2fc825=_0x239f2e?0x0:_0x1558d8[_0x4922('0x18')];var _0x28819d=_0x239f2e?_0x57565a[_0x4922('0x1a')]:_0x1558d8[_0x4922('0x18')]+_0x1558d8[_0x4922('0x1b')];var _0x57bbc4;if(_0x28819d>=_0x2834f4){_0x28819d=_0x2834f4;_0x57bbc4=0xc8;}else{_0x57bbc4=0xce;}_0x42acd3[_0x4922('0x16')](_0x57bbc4);return _0x42acd3['set'](_0x4922('0x1c'),_0x2fc825+'-'+_0x28819d+'/'+_0x2834f4)[_0x4922('0x17')](_0x57565a);}return null;};}function patchUpdates(_0x47e033){return function(_0x12b682){try{jsonpatch[_0x4922('0x1d')](_0x12b682,_0x47e033,!![]);}catch(_0x59a31f){return BPromise[_0x4922('0x1e')](_0x59a31f);}return _0x12b682[_0x4922('0x1f')]();};}function saveUpdates(_0x4e5211,_0x2febe0){return function(_0x4d9e98){if(_0x4d9e98){return _0x4d9e98[_0x4922('0x20')](_0x4e5211)[_0x4922('0x21')](function(_0x229e88){return _0x229e88;});}return null;};}function removeEntity(_0x37b6cb,_0xf3fc32){return function(_0xfbfd5e){if(_0xfbfd5e){return _0xfbfd5e[_0x4922('0x22')]()[_0x4922('0x21')](function(){_0x37b6cb[_0x4922('0x16')](0xcc)[_0x4922('0x15')]();});}};}function handleEntityNotFound(_0x1ca234,_0x1be276){return function(_0x508458){if(!_0x508458){_0x1ca234[_0x4922('0x14')](0x194);}return _0x508458;};}function handleError(_0x2bdc26,_0x67fd90){_0x67fd90=_0x67fd90||0x1f4;return function(_0x3d1771){logger['error'](_0x3d1771[_0x4922('0x23')]);if(_0x3d1771[_0x4922('0x24')]){delete _0x3d1771[_0x4922('0x24')];}_0x2bdc26[_0x4922('0x16')](_0x67fd90)[_0x4922('0x25')](_0x3d1771);};}exports[_0x4922('0x26')]=function(_0x36b961,_0x426528){var _0x41252b={},_0x262307={},_0x40e815={'count':0x0,'rows':[]};var _0x53ad4e=_[_0x4922('0x27')](db['Dynamics365Field'][_0x4922('0x28')],function(_0x8be362){return{'name':_0x8be362[_0x4922('0x29')],'type':_0x8be362[_0x4922('0x2a')][_0x4922('0x2b')]};});_0x262307[_0x4922('0x2c')]=_[_0x4922('0x27')](_0x53ad4e,'name');_0x262307['query']=_[_0x4922('0x2d')](_0x36b961[_0x4922('0x2e')]);_0x262307[_0x4922('0x2f')]=_[_0x4922('0x30')](_0x262307['model'],_0x262307[_0x4922('0x2e')]);_0x41252b['attributes']=_[_0x4922('0x30')](_0x262307[_0x4922('0x2c')],qs[_0x4922('0x31')](_0x36b961[_0x4922('0x2e')][_0x4922('0x31')]));_0x41252b['attributes']=_0x41252b['attributes'][_0x4922('0x32')]?_0x41252b['attributes']:_0x262307['model'];if(!_0x36b961[_0x4922('0x2e')][_0x4922('0x33')](_0x4922('0x34'))){_0x41252b[_0x4922('0x1b')]=qs[_0x4922('0x1b')](_0x36b961[_0x4922('0x2e')][_0x4922('0x1b')]);_0x41252b[_0x4922('0x18')]=qs[_0x4922('0x18')](_0x36b961[_0x4922('0x2e')]['offset']);}_0x41252b[_0x4922('0x35')]=qs[_0x4922('0x36')](_0x36b961[_0x4922('0x2e')][_0x4922('0x36')]);_0x41252b[_0x4922('0x37')]=qs[_0x4922('0x2f')](_['pick'](_0x36b961['query'],_0x262307[_0x4922('0x2f')]),_0x53ad4e);if(_0x36b961['query'][_0x4922('0x38')]){_0x41252b[_0x4922('0x37')]=_[_0x4922('0x39')](_0x41252b[_0x4922('0x37')],{'$or':_['map'](_0x53ad4e,function(_0x50180f){if(_0x50180f[_0x4922('0x2a')]!==_0x4922('0x3a')){var _0x2ae276={};_0x2ae276[_0x50180f[_0x4922('0x24')]]={'$like':'%'+_0x36b961[_0x4922('0x2e')][_0x4922('0x38')]+'%'};return _0x2ae276;}})});}_0x41252b=_[_0x4922('0x39')]({},_0x41252b,_0x36b961[_0x4922('0x3b')]);var _0x400ce2={'where':_0x41252b[_0x4922('0x37')]};return db['Dynamics365Field'][_0x4922('0x1a')](_0x400ce2)[_0x4922('0x21')](function(_0x23c576){_0x40e815[_0x4922('0x1a')]=_0x23c576;if(_0x36b961['query'][_0x4922('0x3c')]){_0x41252b[_0x4922('0x3d')]=[{'all':!![]}];}return db[_0x4922('0x3e')][_0x4922('0x3f')](_0x41252b);})[_0x4922('0x21')](function(_0x130ac7){_0x40e815[_0x4922('0x40')]=_0x130ac7;return _0x40e815;})[_0x4922('0x21')](respondWithFilteredResult(_0x426528,_0x41252b))[_0x4922('0x41')](handleError(_0x426528,null));};exports[_0x4922('0x42')]=function(_0x4fedaf,_0x398f9c){var _0x1d83db={'raw':!![],'where':{'id':_0x4fedaf['params']['id']}},_0x7ab5e={};_0x7ab5e[_0x4922('0x2c')]=_[_0x4922('0x2d')](db[_0x4922('0x3e')][_0x4922('0x28')]);_0x7ab5e[_0x4922('0x2e')]=_[_0x4922('0x2d')](_0x4fedaf[_0x4922('0x2e')]);_0x7ab5e[_0x4922('0x2f')]=_[_0x4922('0x30')](_0x7ab5e[_0x4922('0x2c')],_0x7ab5e[_0x4922('0x2e')]);_0x1d83db[_0x4922('0x43')]=_[_0x4922('0x30')](_0x7ab5e['model'],qs['fields'](_0x4fedaf[_0x4922('0x2e')]['fields']));_0x1d83db['attributes']=_0x1d83db[_0x4922('0x43')][_0x4922('0x32')]?_0x1d83db[_0x4922('0x43')]:_0x7ab5e['model'];if(_0x4fedaf[_0x4922('0x2e')][_0x4922('0x3c')]){_0x1d83db[_0x4922('0x3d')]=[{'all':!![]}];}_0x1d83db=_[_0x4922('0x39')]({},_0x1d83db,_0x4fedaf['options']);return db['Dynamics365Field'][_0x4922('0x44')](_0x1d83db)[_0x4922('0x21')](handleEntityNotFound(_0x398f9c,null))[_0x4922('0x21')](respondWithResult(_0x398f9c,null))[_0x4922('0x41')](handleError(_0x398f9c,null));};exports[_0x4922('0x45')]=function(_0xc50983,_0xed5b3a){return db[_0x4922('0x3e')][_0x4922('0x45')](_0xc50983[_0x4922('0x46')],{})[_0x4922('0x21')](respondWithResult(_0xed5b3a,0xc9))[_0x4922('0x41')](handleError(_0xed5b3a,null));};exports[_0x4922('0x20')]=function(_0x194074,_0xc177a1){if(_0x194074[_0x4922('0x46')]['id']){delete _0x194074[_0x4922('0x46')]['id'];}return db['Dynamics365Field'][_0x4922('0x44')]({'where':{'id':_0x194074['params']['id']}})[_0x4922('0x21')](handleEntityNotFound(_0xc177a1,null))[_0x4922('0x21')](saveUpdates(_0x194074[_0x4922('0x46')],null))[_0x4922('0x21')](respondWithResult(_0xc177a1,null))[_0x4922('0x41')](handleError(_0xc177a1,null));};exports[_0x4922('0x22')]=function(_0x1f5d6a,_0xaf4966){return db[_0x4922('0x3e')][_0x4922('0x44')]({'where':{'id':_0x1f5d6a[_0x4922('0x47')]['id']}})['then'](handleEntityNotFound(_0xaf4966,null))['then'](removeEntity(_0xaf4966,null))['catch'](handleError(_0xaf4966,null));};
\ No newline at end of file
index 84a6177..3b8a02c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d26=['../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x29026e,_0x56f565){var _0x403a21=function(_0x5bcf84){while(--_0x5bcf84){_0x29026e['push'](_0x29026e['shift']());}};_0x403a21(++_0x56f565);}(_0x3d26,0x95));var _0x63d2=function(_0x5b8524,_0x45cf3b){_0x5b8524=_0x5b8524-0x0;var _0x54c541=_0x3d26[_0x5b8524];return _0x54c541;};'use strict';var _=require(_0x63d2('0x0'));var util=require(_0x63d2('0x1'));var logger=require(_0x63d2('0x2'))(_0x63d2('0x3'));var moment=require(_0x63d2('0x4'));var BPromise=require(_0x63d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63d2('0x6'));var rimraf=require('rimraf');var config=require(_0x63d2('0x7'));var attributes=require(_0x63d2('0x8'));module['exports']=function(_0x5500e5,_0x4acb6b){return _0x5500e5[_0x63d2('0x9')](_0x63d2('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x63d2('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa268=['rimraf','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','moment','request-promise','path'];(function(_0x1266e5,_0x414df8){var _0x13c49b=function(_0x9c22e1){while(--_0x9c22e1){_0x1266e5['push'](_0x1266e5['shift']());}};_0x13c49b(++_0x414df8);}(_0xa268,0x98));var _0x8a26=function(_0x5a0b57,_0x2ebef9){_0x5a0b57=_0x5a0b57-0x0;var _0x49404b=_0xa268[_0x5a0b57];return _0x49404b;};'use strict';var _=require('lodash');var util=require(_0x8a26('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8a26('0x1'));var BPromise=require('bluebird');var rp=require(_0x8a26('0x2'));var fs=require('fs');var path=require(_0x8a26('0x3'));var rimraf=require(_0x8a26('0x4'));var config=require('../../config/environment');var attributes=require(_0x8a26('0x5'));module[_0x8a26('0x6')]=function(_0x19656f,_0x49ec93){return _0x19656f[_0x8a26('0x7')]('Dynamics365Field',attributes,{'tableName':_0x8a26('0x8'),'paranoid':![],'indexes':[{'name':_0x8a26('0x9'),'fields':[_0x8a26('0xa'),_0x8a26('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index f9d16f0..f141b86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb31e=['jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\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'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xb31e,0xf9));var _0xeb31=function(_0x370a29,_0xacabdd){_0x370a29=_0x370a29-0x0;var _0x3044c8=_0xb31e[_0x370a29];return _0x3044c8;};'use strict';var _=require(_0xeb31('0x0'));var util=require(_0xeb31('0x1'));var moment=require(_0xeb31('0x2'));var BPromise=require(_0xeb31('0x3'));var rs=require(_0xeb31('0x4'));var fs=require('fs');var Redis=require(_0xeb31('0x5'));var db=require(_0xeb31('0x6'))['db'];var utils=require(_0xeb31('0x7'));var logger=require(_0xeb31('0x8'))(_0xeb31('0x9'));var config=require(_0xeb31('0xa'));var jayson=require(_0xeb31('0xb'));var client=jayson[_0xeb31('0xc')][_0xeb31('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5cfc49,_0x42cb98,_0x442520){return new BPromise(function(_0x71b28,_0x1b645d){return client['request'](_0x5cfc49,_0x442520)[_0xeb31('0xe')](function(_0x345302){logger[_0xeb31('0xf')](_0xeb31('0x10'),_0x42cb98,_0xeb31('0x11'));logger[_0xeb31('0x12')](_0xeb31('0x13'),_0x42cb98,'request\x20sent',JSON[_0xeb31('0x14')](_0x345302));if(_0x345302[_0xeb31('0x15')]){if(_0x345302['error'][_0xeb31('0x16')]===0x1f4){logger['error'](_0xeb31('0x10'),_0x42cb98,_0x345302[_0xeb31('0x15')][_0xeb31('0x17')]);return _0x1b645d(_0x345302[_0xeb31('0x15')]['message']);}logger[_0xeb31('0x15')](_0xeb31('0x10'),_0x42cb98,_0x345302['error'][_0xeb31('0x17')]);return _0x71b28(_0x345302[_0xeb31('0x15')][_0xeb31('0x17')]);}else{logger['info'](_0xeb31('0x10'),_0x42cb98,_0xeb31('0x11'));_0x71b28(_0x345302[_0xeb31('0x18')][_0xeb31('0x17')]);}})[_0xeb31('0x19')](function(_0x5cdd3f){logger[_0xeb31('0x15')]('Dynamics365Field,\x20%s,\x20%s',_0x42cb98,_0x5cdd3f);_0x1b645d(_0x5cdd3f);});});}
\ No newline at end of file
+var _0x2a94=['error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2a94,0x139));var _0x42a9=function(_0x30283d,_0x4104a1){_0x30283d=_0x30283d-0x0;var _0x449f51=_0x2a94[_0x30283d];return _0x449f51;};'use strict';var _=require(_0x42a9('0x0'));var util=require(_0x42a9('0x1'));var moment=require(_0x42a9('0x2'));var BPromise=require('bluebird');var rs=require(_0x42a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42a9('0x4'))['db'];var utils=require(_0x42a9('0x5'));var logger=require(_0x42a9('0x6'))(_0x42a9('0x7'));var config=require(_0x42a9('0x8'));var jayson=require(_0x42a9('0x9'));var client=jayson[_0x42a9('0xa')][_0x42a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x348139,_0x39ae59,_0x345363){return new BPromise(function(_0x10d189,_0x3654ee){return client[_0x42a9('0xc')](_0x348139,_0x345363)['then'](function(_0x543a1e){logger['info'](_0x42a9('0xd'),_0x39ae59,'request\x20sent');logger[_0x42a9('0xe')](_0x42a9('0xf'),_0x39ae59,_0x42a9('0x10'),JSON['stringify'](_0x543a1e));if(_0x543a1e[_0x42a9('0x11')]){if(_0x543a1e[_0x42a9('0x11')][_0x42a9('0x12')]===0x1f4){logger[_0x42a9('0x11')](_0x42a9('0xd'),_0x39ae59,_0x543a1e[_0x42a9('0x11')][_0x42a9('0x13')]);return _0x3654ee(_0x543a1e[_0x42a9('0x11')][_0x42a9('0x13')]);}logger[_0x42a9('0x11')](_0x42a9('0xd'),_0x39ae59,_0x543a1e['error'][_0x42a9('0x13')]);return _0x10d189(_0x543a1e[_0x42a9('0x11')][_0x42a9('0x13')]);}else{logger['info'](_0x42a9('0xd'),_0x39ae59,_0x42a9('0x10'));_0x10d189(_0x543a1e[_0x42a9('0x14')][_0x42a9('0x13')]);}})[_0x42a9('0x15')](function(_0x4cbd97){logger[_0x42a9('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x39ae59,_0x4cbd97);_0x3654ee(_0x4cbd97);});});}
\ No newline at end of file
index f61b8f7..be25abd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4294=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update'];(function(_0x544506,_0x130979){var _0x1b138e=function(_0x1770f3){while(--_0x1770f3){_0x544506['push'](_0x544506['shift']());}};_0x1b138e(++_0x130979);}(_0x4294,0x6b));var _0x4429=function(_0x4cb587,_0x2e1283){_0x4cb587=_0x4cb587-0x0;var _0x26a88f=_0x4294[_0x4cb587];return _0x26a88f;};'use strict';var multer=require(_0x4429('0x0'));var util=require(_0x4429('0x1'));var path=require('path');var timeout=require(_0x4429('0x2'));var express=require(_0x4429('0x3'));var router=express[_0x4429('0x4')]();var fs_extra=require(_0x4429('0x5'));var auth=require(_0x4429('0x6'));var interaction=require(_0x4429('0x7'));var config=require(_0x4429('0x8'));var controller=require(_0x4429('0x9'));router[_0x4429('0xa')]('/',auth[_0x4429('0xb')](),controller[_0x4429('0xc')]);router[_0x4429('0xa')](_0x4429('0xd'),auth['isAuthenticated'](),controller[_0x4429('0xe')]);router[_0x4429('0xa')](_0x4429('0xf'),auth[_0x4429('0xb')](),controller['getConfigurations']);router[_0x4429('0xa')](_0x4429('0x10'),auth[_0x4429('0xb')](),controller[_0x4429('0x11')]);router['post']('/',auth[_0x4429('0xb')](),controller[_0x4429('0x12')]);router[_0x4429('0x13')](_0x4429('0xf'),auth['isAuthenticated'](),controller[_0x4429('0x14')]);router[_0x4429('0x15')](_0x4429('0xd'),auth[_0x4429('0xb')](),controller[_0x4429('0x16')]);router[_0x4429('0x17')]('/:id',auth[_0x4429('0xb')](),controller[_0x4429('0x18')]);module[_0x4429('0x19')]=router;
\ No newline at end of file
+var _0xb55d=['index','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xb55d,0x12b));var _0xdb55=function(_0x2abe18,_0x258093){_0x2abe18=_0x2abe18-0x0;var _0x2c686d=_0xb55d[_0x2abe18];return _0x2c686d;};'use strict';var multer=require(_0xdb55('0x0'));var util=require('util');var path=require(_0xdb55('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdb55('0x2')]();var fs_extra=require(_0xdb55('0x3'));var auth=require(_0xdb55('0x4'));var interaction=require(_0xdb55('0x5'));var config=require('../../config/environment');var controller=require(_0xdb55('0x6'));router[_0xdb55('0x7')]('/',auth[_0xdb55('0x8')](),controller[_0xdb55('0x9')]);router[_0xdb55('0x7')]('/:id',auth[_0xdb55('0x8')](),controller['show']);router[_0xdb55('0x7')](_0xdb55('0xa'),auth[_0xdb55('0x8')](),controller[_0xdb55('0xb')]);router[_0xdb55('0x7')](_0xdb55('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xdb55('0xd')]('/',auth[_0xdb55('0x8')](),controller[_0xdb55('0xe')]);router[_0xdb55('0xd')](_0xdb55('0xa'),auth[_0xdb55('0x8')](),controller[_0xdb55('0xf')]);router[_0xdb55('0x10')](_0xdb55('0x11'),auth['isAuthenticated'](),controller[_0xdb55('0x12')]);router[_0xdb55('0x13')](_0xdb55('0x11'),auth[_0xdb55('0x8')](),controller[_0xdb55('0x14')]);module[_0xdb55('0x15')]=router;
\ No newline at end of file
index 46051be..58aa782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['username','remoteUri','sequelize','exports','STRING'];(function(_0x52e872,_0x219c3a){var _0x413434=function(_0x36e59a){while(--_0x36e59a){_0x52e872['push'](_0x52e872['shift']());}};_0x413434(++_0x219c3a);}(_0xdb28,0x106));var _0x8db2=function(_0x5646c4,_0x27f93c){_0x5646c4=_0x5646c4-0x0;var _0x369414=_0xdb28[_0x5646c4];return _0x369414;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'name':{'type':Sequelize[_0x8db2('0x2')]},'description':{'type':Sequelize[_0x8db2('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x8db2('0x3')},'apiKey':{'type':Sequelize[_0x8db2('0x2')]},'remoteUri':{'type':Sequelize[_0x8db2('0x2')],'unique':_0x8db2('0x4')},'serverUrl':{'type':Sequelize[_0x8db2('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x6a55=['STRING','sequelize'];(function(_0x485408,_0x30732d){var _0x377466=function(_0x4f8502){while(--_0x4f8502){_0x485408['push'](_0x485408['shift']());}};_0x377466(++_0x30732d);}(_0x6a55,0xdb));var _0x56a5=function(_0x4a6156,_0x2b8ce6){_0x4a6156=_0x4a6156-0x0;var _0x12c1f6=_0x6a55[_0x4a6156];return _0x12c1f6;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56a5('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56a5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![]}};
\ No newline at end of file
index f348d76..76355f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca2b=['squel','crypto','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','FreshdeskAccount','rawAttributes','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xca2b,0x156));var _0xbca2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xca2b[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xbca2('0x0'));var rimraf=require(_0xbca2('0x1'));var zipdir=require(_0xbca2('0x2'));var jsonpatch=require(_0xbca2('0x3'));var rp=require(_0xbca2('0x4'));var moment=require(_0xbca2('0x5'));var BPromise=require(_0xbca2('0x6'));var Mustache=require(_0xbca2('0x7'));var util=require('util');var path=require(_0xbca2('0x8'));var sox=require(_0xbca2('0x9'));var csv=require('to-csv');var ejs=require(_0xbca2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbca2('0xb'));var squel=require(_0xbca2('0xc'));var crypto=require(_0xbca2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbca2('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbca2('0xf'));var authService=require(_0xbca2('0x10'));var qs=require(_0xbca2('0x11'));var as=require(_0xbca2('0x12'));var hardwareService=require(_0xbca2('0x13'));var logger=require(_0xbca2('0x14'))(_0xbca2('0x15'));var utils=require(_0xbca2('0x16'));var config=require(_0xbca2('0x17'));var licenseUtil=require(_0xbca2('0x18'));var db=require(_0xbca2('0x19'))['db'];var integrations=require(_0xbca2('0x1a'));function respondWithStatusCode(_0x26bca0,_0x562689){_0x562689=_0x562689||0xcc;return function(_0x32e4e8){if(_0x32e4e8){return _0x26bca0[_0xbca2('0x1b')](_0x562689);}return _0x26bca0[_0xbca2('0x1c')](_0x562689)[_0xbca2('0x1d')]();};}function respondWithResult(_0x1e84d5,_0x170913){_0x170913=_0x170913||0xc8;return function(_0xe2eb6b){if(_0xe2eb6b){return _0x1e84d5[_0xbca2('0x1c')](_0x170913)[_0xbca2('0x1e')](_0xe2eb6b);}};}function respondWithFilteredResult(_0x5f2a39,_0x4dadaf){return function(_0x11e7c6){if(_0x11e7c6){var _0x1b593b=typeof _0x4dadaf['offset']===_0xbca2('0x1f')&&typeof _0x4dadaf[_0xbca2('0x20')]===_0xbca2('0x1f');var _0x481319=_0x11e7c6[_0xbca2('0x21')];var _0xfd34d3=_0x1b593b?0x0:_0x4dadaf[_0xbca2('0x22')];var _0x345a9e=_0x1b593b?_0x11e7c6[_0xbca2('0x21')]:_0x4dadaf['offset']+_0x4dadaf['limit'];var _0x328306;if(_0x345a9e>=_0x481319){_0x345a9e=_0x481319;_0x328306=0xc8;}else{_0x328306=0xce;}_0x5f2a39[_0xbca2('0x1c')](_0x328306);return _0x5f2a39['set'](_0xbca2('0x23'),_0xfd34d3+'-'+_0x345a9e+'/'+_0x481319)[_0xbca2('0x1e')](_0x11e7c6);}return null;};}function patchUpdates(_0x434699){return function(_0x4b5d84){try{jsonpatch[_0xbca2('0x24')](_0x4b5d84,_0x434699,!![]);}catch(_0x3bc192){return BPromise['reject'](_0x3bc192);}return _0x4b5d84[_0xbca2('0x25')]();};}function saveUpdates(_0x20b65d,_0x37c911){return function(_0x392817){if(_0x392817){return _0x392817[_0xbca2('0x26')](_0x20b65d)[_0xbca2('0x27')](function(_0x1e0756){return _0x1e0756;});}return null;};}function removeEntity(_0x204c89,_0x8cdb5d){return function(_0x269ba4){if(_0x269ba4){return _0x269ba4[_0xbca2('0x28')]()[_0xbca2('0x27')](function(){_0x204c89['status'](0xcc)[_0xbca2('0x1d')]();});}};}function handleEntityNotFound(_0x2b4d8b,_0x3119dd){return function(_0x465316){if(!_0x465316){_0x2b4d8b[_0xbca2('0x1b')](0x194);}return _0x465316;};}function handleError(_0x1be0e5,_0x3cf9da){_0x3cf9da=_0x3cf9da||0x1f4;return function(_0x4bbf2f){logger[_0xbca2('0x29')](_0x4bbf2f[_0xbca2('0x2a')]);if(_0x4bbf2f[_0xbca2('0x2b')]){delete _0x4bbf2f[_0xbca2('0x2b')];}_0x1be0e5[_0xbca2('0x1c')](_0x3cf9da)[_0xbca2('0x2c')](_0x4bbf2f);};}exports[_0xbca2('0x2d')]=function(_0x21d0f5,_0x28e5c9){var _0x89c900={},_0x4f2578={},_0x41bce8={'count':0x0,'rows':[]};var _0x563b5f=_[_0xbca2('0x2e')](db['FreshdeskAccount']['rawAttributes'],function(_0x2fa44e){return{'name':_0x2fa44e['fieldName'],'type':_0x2fa44e[_0xbca2('0x2f')][_0xbca2('0x30')]};});_0x4f2578['model']=_['map'](_0x563b5f,_0xbca2('0x2b'));_0x4f2578[_0xbca2('0x31')]=_[_0xbca2('0x32')](_0x21d0f5[_0xbca2('0x31')]);_0x4f2578[_0xbca2('0x33')]=_[_0xbca2('0x34')](_0x4f2578[_0xbca2('0x35')],_0x4f2578[_0xbca2('0x31')]);_0x89c900[_0xbca2('0x36')]=_[_0xbca2('0x34')](_0x4f2578[_0xbca2('0x35')],qs['fields'](_0x21d0f5[_0xbca2('0x31')][_0xbca2('0x37')]));_0x89c900[_0xbca2('0x36')]=_0x89c900['attributes'][_0xbca2('0x38')]?_0x89c900[_0xbca2('0x36')]:_0x4f2578[_0xbca2('0x35')];if(!_0x21d0f5[_0xbca2('0x31')][_0xbca2('0x39')](_0xbca2('0x3a'))){_0x89c900[_0xbca2('0x20')]=qs[_0xbca2('0x20')](_0x21d0f5[_0xbca2('0x31')][_0xbca2('0x20')]);_0x89c900[_0xbca2('0x22')]=qs['offset'](_0x21d0f5['query'][_0xbca2('0x22')]);}_0x89c900[_0xbca2('0x3b')]=qs[_0xbca2('0x3c')](_0x21d0f5[_0xbca2('0x31')][_0xbca2('0x3c')]);_0x89c900['where']=qs[_0xbca2('0x33')](_[_0xbca2('0x3d')](_0x21d0f5[_0xbca2('0x31')],_0x4f2578[_0xbca2('0x33')]),_0x563b5f);if(_0x21d0f5[_0xbca2('0x31')][_0xbca2('0x3e')]){_0x89c900[_0xbca2('0x3f')]=_[_0xbca2('0x40')](_0x89c900[_0xbca2('0x3f')],{'$or':_[_0xbca2('0x2e')](_0x563b5f,function(_0x423388){if(_0x423388[_0xbca2('0x2f')]!=='VIRTUAL'){var _0xa93494={};_0xa93494[_0x423388['name']]={'$like':'%'+_0x21d0f5[_0xbca2('0x31')][_0xbca2('0x3e')]+'%'};return _0xa93494;}})});}_0x89c900=_[_0xbca2('0x40')]({},_0x89c900,_0x21d0f5[_0xbca2('0x41')]);var _0x2b18cc={'where':_0x89c900['where']};return db['FreshdeskAccount']['count'](_0x2b18cc)['then'](function(_0x57551e){_0x41bce8[_0xbca2('0x21')]=_0x57551e;if(_0x21d0f5['query'][_0xbca2('0x42')]){_0x89c900[_0xbca2('0x43')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x89c900);})[_0xbca2('0x27')](function(_0x758ffa){_0x41bce8[_0xbca2('0x44')]=_0x758ffa;return _0x41bce8;})[_0xbca2('0x27')](respondWithFilteredResult(_0x28e5c9,_0x89c900))[_0xbca2('0x45')](handleError(_0x28e5c9,null));};exports[_0xbca2('0x46')]=function(_0x46649f,_0x51f709){var _0xd2622c={'raw':![],'where':{'id':_0x46649f[_0xbca2('0x47')]['id']}},_0x10fce6={};_0x10fce6['model']=_['keys'](db[_0xbca2('0x48')][_0xbca2('0x49')]);_0x10fce6[_0xbca2('0x31')]=_['keys'](_0x46649f['query']);_0x10fce6[_0xbca2('0x33')]=_['intersection'](_0x10fce6['model'],_0x10fce6['query']);_0xd2622c['attributes']=_[_0xbca2('0x34')](_0x10fce6[_0xbca2('0x35')],qs[_0xbca2('0x37')](_0x46649f['query'][_0xbca2('0x37')]));_0xd2622c[_0xbca2('0x36')]=_0xd2622c[_0xbca2('0x36')][_0xbca2('0x38')]?_0xd2622c[_0xbca2('0x36')]:_0x10fce6[_0xbca2('0x35')];if(_0x46649f[_0xbca2('0x31')]['includeAll']){_0xd2622c[_0xbca2('0x43')]=[{'all':!![]}];}_0xd2622c=_[_0xbca2('0x40')]({},_0xd2622c,_0x46649f[_0xbca2('0x41')]);return db['FreshdeskAccount'][_0xbca2('0x4a')](_0xd2622c)[_0xbca2('0x27')](handleEntityNotFound(_0x51f709,null))['then'](respondWithResult(_0x51f709,null))[_0xbca2('0x45')](handleError(_0x51f709,null));};exports['create']=function(_0x136eeb,_0x44542c){return db[_0xbca2('0x48')][_0xbca2('0x4b')](_0x136eeb[_0xbca2('0x4c')],{})[_0xbca2('0x27')](respondWithResult(_0x44542c,0xc9))[_0xbca2('0x45')](handleError(_0x44542c,null));};exports[_0xbca2('0x26')]=function(_0x25ae6e,_0x20d882){if(_0x25ae6e[_0xbca2('0x4c')]['id']){delete _0x25ae6e[_0xbca2('0x4c')]['id'];}return db[_0xbca2('0x48')][_0xbca2('0x4a')]({'where':{'id':_0x25ae6e[_0xbca2('0x47')]['id']}})[_0xbca2('0x27')](handleEntityNotFound(_0x20d882,null))[_0xbca2('0x27')](saveUpdates(_0x25ae6e[_0xbca2('0x4c')],null))[_0xbca2('0x27')](respondWithResult(_0x20d882,null))['catch'](handleError(_0x20d882,null));};exports[_0xbca2('0x28')]=function(_0xf5b3eb,_0x5464c9){return db[_0xbca2('0x48')][_0xbca2('0x4a')]({'where':{'id':_0xf5b3eb[_0xbca2('0x47')]['id']}})[_0xbca2('0x27')](handleEntityNotFound(_0x5464c9,null))[_0xbca2('0x27')](removeEntity(_0x5464c9,null))[_0xbca2('0x45')](handleError(_0x5464c9,null));};exports[_0xbca2('0x4d')]=function(_0x1c644e,_0xfa3669,_0xec9713){var _0x1a52de={};var _0x515146={};var _0x36925f;var _0x472f39;return db[_0xbca2('0x48')][_0xbca2('0x4e')]({'where':{'id':_0x1c644e[_0xbca2('0x47')]['id']}})[_0xbca2('0x27')](handleEntityNotFound(_0xfa3669,null))[_0xbca2('0x27')](function(_0x55df1e){if(_0x55df1e){_0x36925f=_0x55df1e;_0x515146['model']=_[_0xbca2('0x32')](db[_0xbca2('0x4f')][_0xbca2('0x49')]);_0x515146['query']=_[_0xbca2('0x32')](_0x1c644e[_0xbca2('0x31')]);_0x515146[_0xbca2('0x33')]=_[_0xbca2('0x34')](_0x515146[_0xbca2('0x35')],_0x515146[_0xbca2('0x31')]);_0x1a52de[_0xbca2('0x36')]=_['intersection'](_0x515146['model'],qs[_0xbca2('0x37')](_0x1c644e[_0xbca2('0x31')][_0xbca2('0x37')]));_0x1a52de[_0xbca2('0x36')]=_0x1a52de[_0xbca2('0x36')][_0xbca2('0x38')]?_0x1a52de[_0xbca2('0x36')]:_0x515146['model'];_0x1a52de[_0xbca2('0x3b')]=qs[_0xbca2('0x3c')](_0x1c644e['query'][_0xbca2('0x3c')]);_0x1a52de['where']=qs[_0xbca2('0x33')](_[_0xbca2('0x3d')](_0x1c644e[_0xbca2('0x31')],_0x515146[_0xbca2('0x33')]));if(_0x1c644e[_0xbca2('0x31')][_0xbca2('0x3e')]){_0x1a52de[_0xbca2('0x3f')]=_[_0xbca2('0x40')](_0x1a52de[_0xbca2('0x3f')],{'$or':_['map'](_0x1a52de['attributes'],function(_0x41be8c){var _0x69036e={};_0x69036e[_0x41be8c]={'$like':'%'+_0x1c644e[_0xbca2('0x31')][_0xbca2('0x3e')]+'%'};return _0x69036e;})});}_0x1a52de=_[_0xbca2('0x40')]({},_0x1a52de,_0x1c644e['options']);return _0x36925f[_0xbca2('0x4d')](_0x1a52de);}})[_0xbca2('0x27')](function(_0x11ffb8){if(_0x11ffb8){_0x472f39=_0x11ffb8['length'];if(!_0x1c644e[_0xbca2('0x31')][_0xbca2('0x39')]('nolimit')){_0x1a52de['limit']=qs[_0xbca2('0x20')](_0x1c644e[_0xbca2('0x31')][_0xbca2('0x20')]);_0x1a52de[_0xbca2('0x22')]=qs[_0xbca2('0x22')](_0x1c644e[_0xbca2('0x31')]['offset']);}return _0x36925f['getConfigurations'](_0x1a52de);}})[_0xbca2('0x27')](function(_0x52a83d){if(_0x52a83d){return _0x52a83d?{'count':_0x472f39,'rows':_0x52a83d}:null;}})['then'](respondWithResult(_0xfa3669,null))[_0xbca2('0x45')](handleError(_0xfa3669,null));};exports[_0xbca2('0x50')]=function(_0x1e727d,_0x3eb0ae,_0x4458fc){if(_0x1e727d[_0xbca2('0x4c')]['id']){delete _0x1e727d[_0xbca2('0x4c')]['id'];}return db[_0xbca2('0x48')][_0xbca2('0x4e')]({'where':{'id':_0x1e727d[_0xbca2('0x47')]['id']}})[_0xbca2('0x27')](handleEntityNotFound(_0x3eb0ae,null))['then'](function(_0x266ce5){if(_0x266ce5){_0x1e727d['body']['AccountId']=_0x266ce5['id'];_0x1e727d[_0xbca2('0x4c')][_0xbca2('0x51')]=integrations[_0xbca2('0x52')](_0x1e727d[_0xbca2('0x4c')]['channel'],_0x1e727d['body'][_0xbca2('0x2f')]);_0x1e727d[_0xbca2('0x4c')][_0xbca2('0x53')]=integrations[_0xbca2('0x54')](_0x1e727d[_0xbca2('0x4c')][_0xbca2('0x55')],_0x1e727d[_0xbca2('0x4c')][_0xbca2('0x2f')]);return db['FreshdeskConfiguration']['create'](_0x1e727d['body'],{'include':[{'model':db['FreshdeskField'],'as':_0xbca2('0x51')},{'model':db['FreshdeskField'],'as':_0xbca2('0x53')}]});}return null;})['then'](respondWithResult(_0x3eb0ae,null))[_0xbca2('0x45')](handleError(_0x3eb0ae,null));};exports[_0xbca2('0x56')]=function(_0x21b51a,_0x3fba58,_0x344cf1){var _0x2e8829='';return db[_0xbca2('0x48')][_0xbca2('0x4e')]({'where':{'id':_0x21b51a[_0xbca2('0x47')]['id']},'attributes':['id',_0xbca2('0x57'),_0xbca2('0x58')]})['then'](handleEntityNotFound(_0x3fba58,null))[_0xbca2('0x27')](function(_0x26066d){if(_0x26066d){_0x2e8829=_0x26066d['remoteUri'];var _0x108745=_0x2e8829[_0xbca2('0x59')](-0x1);if(_0x108745==='/'){_0x2e8829=_0x2e8829[_0xbca2('0x5a')](0x0,_0x2e8829[_0xbca2('0x5b')](_0x108745));}return rp({'method':_0xbca2('0x5c'),'uri':util['format'](_0xbca2('0x5d'),_0x2e8829,_0xbca2('0x5e')),'headers':{'Authorization':util[_0xbca2('0x5f')](_0xbca2('0x60'),new Buffer(util[_0xbca2('0x5f')](_0xbca2('0x61'),_0x26066d[_0xbca2('0x58')]))[_0xbca2('0x62')](_0xbca2('0x63')))},'json':!![]});}})[_0xbca2('0x27')](function(_0x143d9){if(_0x143d9){var _0x4cb4e3=[_0xbca2('0x64'),_0xbca2('0x65'),_0xbca2('0x66'),_0xbca2('0x67'),_0xbca2('0x1c'),_0xbca2('0x68'),_0xbca2('0x69'),_0xbca2('0x6a'),'ticket_type','group','company'];_[_0xbca2('0x6b')](_0x143d9,function(_0x18ea0c){return _0x4cb4e3[_0xbca2('0x6c')](_0x18ea0c['name'])||!_0x18ea0c[_0xbca2('0x6d')]&&_0x18ea0c[_0xbca2('0x2f')]!==_0xbca2('0x6e')&&_0x18ea0c[_0xbca2('0x2f')]!==_0xbca2('0x6f');});return{'count':_0x143d9[_0xbca2('0x38')],'rows':_[_0xbca2('0x2e')](_0x143d9,function(_0x445c08){return{'id':_0x445c08[_0xbca2('0x2b')],'name':_0x445c08[_0xbca2('0x70')],'custom':!_0x445c08[_0xbca2('0x6d')],'options':_0x445c08[_0xbca2('0x71')]?_[_0xbca2('0x2e')](_0x445c08['choices'],function(_0x1651e3){return{'name':_[_0xbca2('0x72')](_0x1651e3),'value':_0x1651e3};}):[]};})};}})[_0xbca2('0x27')](respondWithResult(_0x3fba58,null))[_0xbca2('0x45')](function(_0x27acca){var _0x5dc712=_0x21b51a[_0xbca2('0x31')][_0xbca2('0x73')]?0x1f4:_0x27acca['statusCode']||0x1f4;logger[_0xbca2('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xbca2('0x56'),_0x5dc712,JSON['stringify'](_0x27acca));delete _0x27acca[_0xbca2('0x2b')];if(_0x5dc712===0x191){_0x5dc712=0x190;}_0x3fba58[_0xbca2('0x1c')](_0x5dc712)[_0xbca2('0x2c')](_0x21b51a['query'][_0xbca2('0x73')]?{'message':_0xbca2('0x74'),'statusCode':_0x27acca[_0xbca2('0x75')]}:_0x27acca);});};
\ No newline at end of file
+var _0x3308=['AccountId','Subjects','channel','Descriptions','FreshdeskField','remoteUri','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','requester','agent','description','priority','ticket_type','group','company','remove','includes','default','label','choices','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','save','update','then','error','name','send','index','FreshdeskAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','fields','catch','create','body','find','destroy','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration'];(function(_0x5b880d,_0x77fc89){var _0x15c40e=function(_0x432c67){while(--_0x432c67){_0x5b880d['push'](_0x5b880d['shift']());}};_0x15c40e(++_0x77fc89);}(_0x3308,0x160));var _0x8330=function(_0x552beb,_0x3cde51){_0x552beb=_0x552beb-0x0;var _0x40b9f0=_0x3308[_0x552beb];return _0x40b9f0;};'use strict';var emlformat=require(_0x8330('0x0'));var rimraf=require(_0x8330('0x1'));var zipdir=require(_0x8330('0x2'));var jsonpatch=require(_0x8330('0x3'));var rp=require(_0x8330('0x4'));var moment=require(_0x8330('0x5'));var BPromise=require(_0x8330('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8330('0x7'));var sox=require('sox');var csv=require(_0x8330('0x8'));var ejs=require(_0x8330('0x9'));var fs=require('fs');var fs_extra=require(_0x8330('0xa'));var _=require('lodash');var squel=require(_0x8330('0xb'));var crypto=require(_0x8330('0xc'));var jsforce=require(_0x8330('0xd'));var deskjs=require(_0x8330('0xe'));var toCsv=require(_0x8330('0x8'));var querystring=require(_0x8330('0xf'));var Papa=require('papaparse');var Redis=require(_0x8330('0x10'));var authService=require(_0x8330('0x11'));var qs=require(_0x8330('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8330('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8330('0x14'));function respondWithStatusCode(_0x1da381,_0x252953){_0x252953=_0x252953||0xcc;return function(_0x3ceb1e){if(_0x3ceb1e){return _0x1da381[_0x8330('0x15')](_0x252953);}return _0x1da381['status'](_0x252953)[_0x8330('0x16')]();};}function respondWithResult(_0x4f0cf0,_0x293658){_0x293658=_0x293658||0xc8;return function(_0x2d7e87){if(_0x2d7e87){return _0x4f0cf0[_0x8330('0x17')](_0x293658)[_0x8330('0x18')](_0x2d7e87);}};}function respondWithFilteredResult(_0x432aca,_0x28998e){return function(_0x2c3e2f){if(_0x2c3e2f){var _0x1f230a=typeof _0x28998e[_0x8330('0x19')]==='undefined'&&typeof _0x28998e[_0x8330('0x1a')]===_0x8330('0x1b');var _0x47895b=_0x2c3e2f[_0x8330('0x1c')];var _0x3c9e7b=_0x1f230a?0x0:_0x28998e[_0x8330('0x19')];var _0x56fc18=_0x1f230a?_0x2c3e2f[_0x8330('0x1c')]:_0x28998e['offset']+_0x28998e[_0x8330('0x1a')];var _0x58e614;if(_0x56fc18>=_0x47895b){_0x56fc18=_0x47895b;_0x58e614=0xc8;}else{_0x58e614=0xce;}_0x432aca[_0x8330('0x17')](_0x58e614);return _0x432aca[_0x8330('0x1d')]('Content-Range',_0x3c9e7b+'-'+_0x56fc18+'/'+_0x47895b)[_0x8330('0x18')](_0x2c3e2f);}return null;};}function patchUpdates(_0x518236){return function(_0x3320fb){try{jsonpatch['apply'](_0x3320fb,_0x518236,!![]);}catch(_0x239822){return BPromise[_0x8330('0x1e')](_0x239822);}return _0x3320fb[_0x8330('0x1f')]();};}function saveUpdates(_0x350895,_0x317045){return function(_0x1ebee7){if(_0x1ebee7){return _0x1ebee7[_0x8330('0x20')](_0x350895)[_0x8330('0x21')](function(_0x21ddaf){return _0x21ddaf;});}return null;};}function removeEntity(_0x2770ca,_0x3fa722){return function(_0x5cb80c){if(_0x5cb80c){return _0x5cb80c['destroy']()['then'](function(){_0x2770ca[_0x8330('0x17')](0xcc)[_0x8330('0x16')]();});}};}function handleEntityNotFound(_0x36db54,_0xa04d8){return function(_0x44adb5){if(!_0x44adb5){_0x36db54[_0x8330('0x15')](0x194);}return _0x44adb5;};}function handleError(_0x19465b,_0x4e7aaa){_0x4e7aaa=_0x4e7aaa||0x1f4;return function(_0x339b99){logger[_0x8330('0x22')](_0x339b99['stack']);if(_0x339b99[_0x8330('0x23')]){delete _0x339b99[_0x8330('0x23')];}_0x19465b[_0x8330('0x17')](_0x4e7aaa)[_0x8330('0x24')](_0x339b99);};}exports[_0x8330('0x25')]=function(_0x5297af,_0x38e8d2){var _0x4baceb={},_0x3cce2f={},_0x162436={'count':0x0,'rows':[]};var _0x2cf1e2=_['map'](db[_0x8330('0x26')][_0x8330('0x27')],function(_0x553ca2){return{'name':_0x553ca2[_0x8330('0x28')],'type':_0x553ca2['type'][_0x8330('0x29')]};});_0x3cce2f[_0x8330('0x2a')]=_[_0x8330('0x2b')](_0x2cf1e2,_0x8330('0x23'));_0x3cce2f[_0x8330('0x2c')]=_[_0x8330('0x2d')](_0x5297af[_0x8330('0x2c')]);_0x3cce2f[_0x8330('0x2e')]=_[_0x8330('0x2f')](_0x3cce2f[_0x8330('0x2a')],_0x3cce2f[_0x8330('0x2c')]);_0x4baceb['attributes']=_['intersection'](_0x3cce2f[_0x8330('0x2a')],qs['fields'](_0x5297af[_0x8330('0x2c')]['fields']));_0x4baceb['attributes']=_0x4baceb[_0x8330('0x30')][_0x8330('0x31')]?_0x4baceb[_0x8330('0x30')]:_0x3cce2f[_0x8330('0x2a')];if(!_0x5297af['query'][_0x8330('0x32')]('nolimit')){_0x4baceb[_0x8330('0x1a')]=qs[_0x8330('0x1a')](_0x5297af[_0x8330('0x2c')][_0x8330('0x1a')]);_0x4baceb[_0x8330('0x19')]=qs[_0x8330('0x19')](_0x5297af['query'][_0x8330('0x19')]);}_0x4baceb[_0x8330('0x33')]=qs[_0x8330('0x34')](_0x5297af[_0x8330('0x2c')][_0x8330('0x34')]);_0x4baceb[_0x8330('0x35')]=qs[_0x8330('0x2e')](_[_0x8330('0x36')](_0x5297af['query'],_0x3cce2f['filters']),_0x2cf1e2);if(_0x5297af[_0x8330('0x2c')][_0x8330('0x37')]){_0x4baceb[_0x8330('0x35')]=_[_0x8330('0x38')](_0x4baceb[_0x8330('0x35')],{'$or':_[_0x8330('0x2b')](_0x2cf1e2,function(_0x18bfd0){if(_0x18bfd0[_0x8330('0x39')]!==_0x8330('0x3a')){var _0x4a7634={};_0x4a7634[_0x18bfd0[_0x8330('0x23')]]={'$like':'%'+_0x5297af[_0x8330('0x2c')][_0x8330('0x37')]+'%'};return _0x4a7634;}})});}_0x4baceb=_[_0x8330('0x38')]({},_0x4baceb,_0x5297af[_0x8330('0x3b')]);var _0x297fd3={'where':_0x4baceb[_0x8330('0x35')]};return db[_0x8330('0x26')][_0x8330('0x1c')](_0x297fd3)[_0x8330('0x21')](function(_0x8adf86){_0x162436[_0x8330('0x1c')]=_0x8adf86;if(_0x5297af[_0x8330('0x2c')][_0x8330('0x3c')]){_0x4baceb[_0x8330('0x3d')]=[{'all':!![]}];}return db[_0x8330('0x26')]['findAll'](_0x4baceb);})[_0x8330('0x21')](function(_0x41fb20){_0x162436[_0x8330('0x3e')]=_0x41fb20;return _0x162436;})[_0x8330('0x21')](respondWithFilteredResult(_0x38e8d2,_0x4baceb))['catch'](handleError(_0x38e8d2,null));};exports[_0x8330('0x3f')]=function(_0x752941,_0x1e71df){var _0x11dabe={'raw':![],'where':{'id':_0x752941[_0x8330('0x40')]['id']}},_0x4fa1d1={};_0x4fa1d1['model']=_['keys'](db[_0x8330('0x26')]['rawAttributes']);_0x4fa1d1['query']=_['keys'](_0x752941[_0x8330('0x2c')]);_0x4fa1d1[_0x8330('0x2e')]=_[_0x8330('0x2f')](_0x4fa1d1[_0x8330('0x2a')],_0x4fa1d1[_0x8330('0x2c')]);_0x11dabe[_0x8330('0x30')]=_[_0x8330('0x2f')](_0x4fa1d1[_0x8330('0x2a')],qs[_0x8330('0x41')](_0x752941['query'][_0x8330('0x41')]));_0x11dabe[_0x8330('0x30')]=_0x11dabe[_0x8330('0x30')][_0x8330('0x31')]?_0x11dabe[_0x8330('0x30')]:_0x4fa1d1[_0x8330('0x2a')];if(_0x752941[_0x8330('0x2c')][_0x8330('0x3c')]){_0x11dabe[_0x8330('0x3d')]=[{'all':!![]}];}_0x11dabe=_[_0x8330('0x38')]({},_0x11dabe,_0x752941[_0x8330('0x3b')]);return db[_0x8330('0x26')]['find'](_0x11dabe)[_0x8330('0x21')](handleEntityNotFound(_0x1e71df,null))[_0x8330('0x21')](respondWithResult(_0x1e71df,null))[_0x8330('0x42')](handleError(_0x1e71df,null));};exports[_0x8330('0x43')]=function(_0x3afffc,_0x5279d4){return db[_0x8330('0x26')][_0x8330('0x43')](_0x3afffc[_0x8330('0x44')],{})['then'](respondWithResult(_0x5279d4,0xc9))[_0x8330('0x42')](handleError(_0x5279d4,null));};exports['update']=function(_0x4d5466,_0xe4cd8b){if(_0x4d5466[_0x8330('0x44')]['id']){delete _0x4d5466[_0x8330('0x44')]['id'];}return db['FreshdeskAccount'][_0x8330('0x45')]({'where':{'id':_0x4d5466[_0x8330('0x40')]['id']}})[_0x8330('0x21')](handleEntityNotFound(_0xe4cd8b,null))[_0x8330('0x21')](saveUpdates(_0x4d5466['body'],null))[_0x8330('0x21')](respondWithResult(_0xe4cd8b,null))[_0x8330('0x42')](handleError(_0xe4cd8b,null));};exports[_0x8330('0x46')]=function(_0x5df830,_0x411ad1){return db['FreshdeskAccount'][_0x8330('0x45')]({'where':{'id':_0x5df830[_0x8330('0x40')]['id']}})[_0x8330('0x21')](handleEntityNotFound(_0x411ad1,null))['then'](removeEntity(_0x411ad1,null))[_0x8330('0x42')](handleError(_0x411ad1,null));};exports[_0x8330('0x47')]=function(_0xc20baa,_0x2a3e84,_0x211e77){var _0x4d976f={};var _0x9b36c6={};var _0x3d1636;var _0x2b4a09;return db[_0x8330('0x26')][_0x8330('0x48')]({'where':{'id':_0xc20baa[_0x8330('0x40')]['id']}})[_0x8330('0x21')](handleEntityNotFound(_0x2a3e84,null))[_0x8330('0x21')](function(_0x2e5ebe){if(_0x2e5ebe){_0x3d1636=_0x2e5ebe;_0x9b36c6[_0x8330('0x2a')]=_[_0x8330('0x2d')](db[_0x8330('0x49')][_0x8330('0x27')]);_0x9b36c6['query']=_[_0x8330('0x2d')](_0xc20baa['query']);_0x9b36c6['filters']=_[_0x8330('0x2f')](_0x9b36c6[_0x8330('0x2a')],_0x9b36c6[_0x8330('0x2c')]);_0x4d976f[_0x8330('0x30')]=_['intersection'](_0x9b36c6[_0x8330('0x2a')],qs[_0x8330('0x41')](_0xc20baa[_0x8330('0x2c')]['fields']));_0x4d976f[_0x8330('0x30')]=_0x4d976f[_0x8330('0x30')][_0x8330('0x31')]?_0x4d976f['attributes']:_0x9b36c6['model'];_0x4d976f[_0x8330('0x33')]=qs[_0x8330('0x34')](_0xc20baa[_0x8330('0x2c')][_0x8330('0x34')]);_0x4d976f[_0x8330('0x35')]=qs[_0x8330('0x2e')](_[_0x8330('0x36')](_0xc20baa[_0x8330('0x2c')],_0x9b36c6[_0x8330('0x2e')]));if(_0xc20baa[_0x8330('0x2c')]['filter']){_0x4d976f[_0x8330('0x35')]=_['merge'](_0x4d976f['where'],{'$or':_[_0x8330('0x2b')](_0x4d976f['attributes'],function(_0x864763){var _0x484c25={};_0x484c25[_0x864763]={'$like':'%'+_0xc20baa[_0x8330('0x2c')][_0x8330('0x37')]+'%'};return _0x484c25;})});}_0x4d976f=_[_0x8330('0x38')]({},_0x4d976f,_0xc20baa[_0x8330('0x3b')]);return _0x3d1636['getConfigurations'](_0x4d976f);}})[_0x8330('0x21')](function(_0x250e47){if(_0x250e47){_0x2b4a09=_0x250e47['length'];if(!_0xc20baa[_0x8330('0x2c')]['hasOwnProperty'](_0x8330('0x4a'))){_0x4d976f[_0x8330('0x1a')]=qs[_0x8330('0x1a')](_0xc20baa[_0x8330('0x2c')][_0x8330('0x1a')]);_0x4d976f[_0x8330('0x19')]=qs['offset'](_0xc20baa[_0x8330('0x2c')][_0x8330('0x19')]);}return _0x3d1636[_0x8330('0x47')](_0x4d976f);}})[_0x8330('0x21')](function(_0x4988b5){if(_0x4988b5){return _0x4988b5?{'count':_0x2b4a09,'rows':_0x4988b5}:null;}})['then'](respondWithResult(_0x2a3e84,null))[_0x8330('0x42')](handleError(_0x2a3e84,null));};exports[_0x8330('0x4b')]=function(_0x2af35b,_0x44b83e,_0x19362f){if(_0x2af35b['body']['id']){delete _0x2af35b['body']['id'];}return db[_0x8330('0x26')]['findOne']({'where':{'id':_0x2af35b[_0x8330('0x40')]['id']}})['then'](handleEntityNotFound(_0x44b83e,null))[_0x8330('0x21')](function(_0x324a36){if(_0x324a36){_0x2af35b[_0x8330('0x44')][_0x8330('0x4c')]=_0x324a36['id'];_0x2af35b[_0x8330('0x44')][_0x8330('0x4d')]=integrations['getSubjects'](_0x2af35b[_0x8330('0x44')][_0x8330('0x4e')],_0x2af35b[_0x8330('0x44')]['type']);_0x2af35b[_0x8330('0x44')][_0x8330('0x4f')]=integrations['getDescriptions'](_0x2af35b[_0x8330('0x44')]['channel'],_0x2af35b[_0x8330('0x44')][_0x8330('0x39')]);return db[_0x8330('0x49')][_0x8330('0x43')](_0x2af35b[_0x8330('0x44')],{'include':[{'model':db[_0x8330('0x50')],'as':'Subjects'},{'model':db[_0x8330('0x50')],'as':'Descriptions'}]});}return null;})[_0x8330('0x21')](respondWithResult(_0x44b83e,null))[_0x8330('0x42')](handleError(_0x44b83e,null));};exports['getFields']=function(_0x1ad7f6,_0x27ceb2,_0x3a3981){var _0x4d8511='';return db[_0x8330('0x26')][_0x8330('0x48')]({'where':{'id':_0x1ad7f6[_0x8330('0x40')]['id']},'attributes':['id',_0x8330('0x51'),'apiKey']})[_0x8330('0x21')](handleEntityNotFound(_0x27ceb2,null))[_0x8330('0x21')](function(_0x10825c){if(_0x10825c){_0x4d8511=_0x10825c['remoteUri'];var _0x4765e9=_0x4d8511['slice'](-0x1);if(_0x4765e9==='/'){_0x4d8511=_0x4d8511[_0x8330('0x52')](0x0,_0x4d8511[_0x8330('0x53')](_0x4765e9));}return rp({'method':_0x8330('0x54'),'uri':util[_0x8330('0x55')](_0x8330('0x56'),_0x4d8511,_0x8330('0x57')),'headers':{'Authorization':util[_0x8330('0x55')](_0x8330('0x58'),new Buffer(util[_0x8330('0x55')](_0x8330('0x59'),_0x10825c[_0x8330('0x5a')]))['toString']('base64'))},'json':!![]});}})['then'](function(_0x1c2417){if(_0x1c2417){var _0x3340ca=[_0x8330('0x5b'),'subject',_0x8330('0x5c'),_0x8330('0x5d'),_0x8330('0x17'),_0x8330('0x5e'),'group','source',_0x8330('0x5f'),_0x8330('0x60'),_0x8330('0x61')];_[_0x8330('0x62')](_0x1c2417,function(_0x3dcab8){return _0x3340ca[_0x8330('0x63')](_0x3dcab8[_0x8330('0x23')])||!_0x3dcab8[_0x8330('0x64')]&&_0x3dcab8[_0x8330('0x39')]!=='custom_text'&&_0x3dcab8[_0x8330('0x39')]!=='custom_dropdown';});return{'count':_0x1c2417[_0x8330('0x31')],'rows':_['map'](_0x1c2417,function(_0x3ccb74){return{'id':_0x3ccb74[_0x8330('0x23')],'name':_0x3ccb74[_0x8330('0x65')],'custom':!_0x3ccb74[_0x8330('0x64')],'options':_0x3ccb74[_0x8330('0x66')]?_[_0x8330('0x2b')](_0x3ccb74['choices'],function(_0xf58aba){return{'name':_['capitalize'](_0xf58aba),'value':_0xf58aba};}):[]};})};}})[_0x8330('0x21')](respondWithResult(_0x27ceb2,null))[_0x8330('0x42')](function(_0x6d1882){var _0x551b05=_0x1ad7f6[_0x8330('0x2c')]['test']?0x1f4:_0x6d1882[_0x8330('0x67')]||0x1f4;logger[_0x8330('0x22')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x551b05,JSON[_0x8330('0x68')](_0x6d1882));delete _0x6d1882[_0x8330('0x23')];if(_0x551b05===0x191){_0x551b05=0x190;}_0x27ceb2[_0x8330('0x17')](_0x551b05)[_0x8330('0x24')](_0x1ad7f6['query'][_0x8330('0x69')]?{'message':_0x8330('0x6a'),'statusCode':_0x6d1882['statusCode']}:_0x6d1882);});};
\ No newline at end of file
index b45589e..d42dae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc1=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x13f6c7,_0x359631){var _0x249007=function(_0x120a41){while(--_0x120a41){_0x13f6c7['push'](_0x13f6c7['shift']());}};_0x249007(++_0x359631);}(_0x9bc1,0x17e));var _0x19bc=function(_0x3dcc78,_0x5a3972){_0x3dcc78=_0x3dcc78-0x0;var _0x4c173c=_0x9bc1[_0x3dcc78];return _0x4c173c;};'use strict';var _=require(_0x19bc('0x0'));var util=require(_0x19bc('0x1'));var logger=require(_0x19bc('0x2'))(_0x19bc('0x3'));var moment=require(_0x19bc('0x4'));var BPromise=require(_0x19bc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19bc('0x6'));var rimraf=require('rimraf');var config=require(_0x19bc('0x7'));var attributes=require(_0x19bc('0x8'));var integrations=require(_0x19bc('0x9'));module[_0x19bc('0xa')]=function(_0x56bd51,_0x29c5b0){return _0x56bd51[_0x19bc('0xb')]('FreshdeskAccount',attributes,{'tableName':_0x19bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6de6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x6de6,0x8f));var _0x66de=function(_0x3c8893,_0x3bb73e){_0x3c8893=_0x3c8893-0x0;var _0x3f9f4b=_0x6de6[_0x3c8893];return _0x3f9f4b;};'use strict';var _=require(_0x66de('0x0'));var util=require(_0x66de('0x1'));var logger=require(_0x66de('0x2'))(_0x66de('0x3'));var moment=require(_0x66de('0x4'));var BPromise=require(_0x66de('0x5'));var rp=require(_0x66de('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x66de('0x7'));var attributes=require(_0x66de('0x8'));var integrations=require(_0x66de('0x9'));module[_0x66de('0xa')]=function(_0x192634,_0x134a5b){return _0x192634[_0x66de('0xb')](_0x66de('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 40f2ac9..5b3879c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2df1=['FreshdeskAccount','findAll','raw','options','where','attributes','include','map','model','ShowFreshdeskAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount'];(function(_0x599eee,_0x154fb0){var _0x266943=function(_0x3d071e){while(--_0x3d071e){_0x599eee['push'](_0x599eee['shift']());}};_0x266943(++_0x154fb0);}(_0x2df1,0x18c));var _0x12df=function(_0x166982,_0xa086a){_0x166982=_0x166982-0x0;var _0x280ae6=_0x2df1[_0x166982];return _0x280ae6;};'use strict';var _=require(_0x12df('0x0'));var util=require(_0x12df('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12df('0x2'));var fs=require('fs');var Redis=require(_0x12df('0x3'));var db=require(_0x12df('0x4'))['db'];var utils=require(_0x12df('0x5'));var logger=require('../../config/logger')(_0x12df('0x6'));var config=require(_0x12df('0x7'));var jayson=require(_0x12df('0x8'));var client=jayson[_0x12df('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x519f6a,_0x151175,_0x4330b6){return new BPromise(function(_0x567041,_0x224220){return client[_0x12df('0xa')](_0x519f6a,_0x4330b6)[_0x12df('0xb')](function(_0x4ebd49){logger[_0x12df('0xc')](_0x12df('0xd'),_0x151175,_0x12df('0xe'));logger[_0x12df('0xf')](_0x12df('0x10'),_0x151175,_0x12df('0xe'),JSON[_0x12df('0x11')](_0x4ebd49));if(_0x4ebd49[_0x12df('0x12')]){if(_0x4ebd49[_0x12df('0x12')][_0x12df('0x13')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x151175,_0x4ebd49['error'][_0x12df('0x14')]);return _0x224220(_0x4ebd49['error']['message']);}logger[_0x12df('0x12')](_0x12df('0xd'),_0x151175,_0x4ebd49['error']['message']);return _0x567041(_0x4ebd49[_0x12df('0x12')][_0x12df('0x14')]);}else{logger['info'](_0x12df('0xd'),_0x151175,_0x12df('0xe'));_0x567041(_0x4ebd49[_0x12df('0x15')][_0x12df('0x14')]);}})[_0x12df('0x16')](function(_0x42bbfc){logger[_0x12df('0x12')](_0x12df('0xd'),_0x151175,_0x42bbfc);_0x224220(_0x42bbfc);});});}exports[_0x12df('0x17')]=function(_0x5057ee){var _0x2c1a19=this;return new Promise(function(_0xa32128,_0x3c99d7){return db[_0x12df('0x18')][_0x12df('0x19')]({'raw':_0x5057ee['options']?_0x5057ee['options'][_0x12df('0x1a')]===undefined?!![]:![]:!![],'where':_0x5057ee[_0x12df('0x1b')]?_0x5057ee[_0x12df('0x1b')][_0x12df('0x1c')]||null:null,'attributes':_0x5057ee['options']?_0x5057ee['options'][_0x12df('0x1d')]||null:null,'limit':_0x5057ee[_0x12df('0x1b')]?_0x5057ee[_0x12df('0x1b')]['limit']||null:null,'include':_0x5057ee[_0x12df('0x1b')]?_0x5057ee[_0x12df('0x1b')][_0x12df('0x1e')]?_[_0x12df('0x1f')](_0x5057ee[_0x12df('0x1b')][_0x12df('0x1e')],function(_0x1493cb){return{'model':db[_0x1493cb[_0x12df('0x20')]],'as':_0x1493cb['as'],'attributes':_0x1493cb[_0x12df('0x1d')],'include':_0x1493cb['include']?_[_0x12df('0x1f')](_0x1493cb[_0x12df('0x1e')],function(_0x17d249){return{'model':db[_0x17d249[_0x12df('0x20')]],'as':_0x17d249['as'],'attributes':_0x17d249[_0x12df('0x1d')],'include':_0x17d249[_0x12df('0x1e')]?_[_0x12df('0x1f')](_0x17d249[_0x12df('0x1e')],function(_0x1cf522){return{'model':db[_0x1cf522[_0x12df('0x20')]],'as':_0x1cf522['as'],'attributes':_0x1cf522[_0x12df('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x12df('0xb')](function(_0x20fb26){logger[_0x12df('0xc')](_0x12df('0x17'),_0x5057ee);logger[_0x12df('0xf')](_0x12df('0x17'),_0x5057ee,JSON['stringify'](_0x20fb26));_0xa32128(_0x20fb26);})[_0x12df('0x16')](function(_0x2fb42b){logger[_0x12df('0x12')](_0x12df('0x17'),_0x2fb42b[_0x12df('0x14')],_0x5057ee);_0x3c99d7(_0x2c1a19[_0x12df('0x12')](0x1f4,_0x2fb42b[_0x12df('0x14')]));});});};exports[_0x12df('0x21')]=function(_0x5377c2){var _0x93b9ab=this;return new Promise(function(_0xaf8c17,_0xe4ede6){return db[_0x12df('0x18')][_0x12df('0x22')]({'raw':_0x5377c2[_0x12df('0x1b')]?_0x5377c2[_0x12df('0x1b')][_0x12df('0x1a')]===undefined?!![]:![]:!![],'where':_0x5377c2[_0x12df('0x1b')]?_0x5377c2['options']['where']||null:null,'attributes':_0x5377c2['options']?_0x5377c2[_0x12df('0x1b')][_0x12df('0x1d')]||null:null,'include':_0x5377c2[_0x12df('0x1b')]?_0x5377c2[_0x12df('0x1b')]['include']?_['map'](_0x5377c2[_0x12df('0x1b')][_0x12df('0x1e')],function(_0x9586fe){return{'model':db[_0x9586fe[_0x12df('0x20')]],'as':_0x9586fe['as'],'attributes':_0x9586fe['attributes'],'include':_0x9586fe[_0x12df('0x1e')]?_[_0x12df('0x1f')](_0x9586fe[_0x12df('0x1e')],function(_0x5386ac){return{'model':db[_0x5386ac[_0x12df('0x20')]],'as':_0x5386ac['as'],'attributes':_0x5386ac[_0x12df('0x1d')],'include':_0x5386ac['include']?_[_0x12df('0x1f')](_0x5386ac['include'],function(_0x5540b5){return{'model':db[_0x5540b5[_0x12df('0x20')]],'as':_0x5540b5['as'],'attributes':_0x5540b5[_0x12df('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x12df('0xb')](function(_0x3dc02c){logger[_0x12df('0xc')]('ShowFreshdeskAccount',_0x5377c2);logger[_0x12df('0xf')]('ShowFreshdeskAccount',_0x5377c2,JSON[_0x12df('0x11')](_0x3dc02c));_0xaf8c17(_0x3dc02c);})[_0x12df('0x16')](function(_0x4a7501){logger[_0x12df('0x12')](_0x12df('0x21'),_0x4a7501[_0x12df('0x14')],_0x5377c2);_0xe4ede6(_0x93b9ab['error'](0x1f4,_0x4a7501[_0x12df('0x14')]));});});};
\ No newline at end of file
+var _0xd6cb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x40b3d7,_0x2ea362){var _0x44eb89=function(_0x16c424){while(--_0x16c424){_0x40b3d7['push'](_0x40b3d7['shift']());}};_0x44eb89(++_0x2ea362);}(_0xd6cb,0xde));var _0xbd6c=function(_0x2e6516,_0x125bc3){_0x2e6516=_0x2e6516-0x0;var _0xafbb16=_0xd6cb[_0x2e6516];return _0xafbb16;};'use strict';var _=require(_0xbd6c('0x0'));var util=require(_0xbd6c('0x1'));var moment=require(_0xbd6c('0x2'));var BPromise=require(_0xbd6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd6c('0x4'));var db=require(_0xbd6c('0x5'))['db'];var utils=require(_0xbd6c('0x6'));var logger=require(_0xbd6c('0x7'))(_0xbd6c('0x8'));var config=require(_0xbd6c('0x9'));var jayson=require(_0xbd6c('0xa'));var client=jayson[_0xbd6c('0xb')][_0xbd6c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23af88,_0x758b3e,_0x31a732){return new BPromise(function(_0x3cb386,_0x2f701c){return client['request'](_0x23af88,_0x31a732)[_0xbd6c('0xd')](function(_0x191b5a){logger[_0xbd6c('0xe')](_0xbd6c('0xf'),_0x758b3e,_0xbd6c('0x10'));logger[_0xbd6c('0x11')](_0xbd6c('0x12'),_0x758b3e,_0xbd6c('0x10'),JSON[_0xbd6c('0x13')](_0x191b5a));if(_0x191b5a[_0xbd6c('0x14')]){if(_0x191b5a[_0xbd6c('0x14')][_0xbd6c('0x15')]===0x1f4){logger[_0xbd6c('0x14')](_0xbd6c('0xf'),_0x758b3e,_0x191b5a['error'][_0xbd6c('0x16')]);return _0x2f701c(_0x191b5a['error'][_0xbd6c('0x16')]);}logger[_0xbd6c('0x14')](_0xbd6c('0xf'),_0x758b3e,_0x191b5a['error']['message']);return _0x3cb386(_0x191b5a[_0xbd6c('0x14')][_0xbd6c('0x16')]);}else{logger[_0xbd6c('0xe')](_0xbd6c('0xf'),_0x758b3e,_0xbd6c('0x10'));_0x3cb386(_0x191b5a[_0xbd6c('0x17')][_0xbd6c('0x16')]);}})[_0xbd6c('0x18')](function(_0x55a034){logger['error'](_0xbd6c('0xf'),_0x758b3e,_0x55a034);_0x2f701c(_0x55a034);});});}exports[_0xbd6c('0x19')]=function(_0x38c006){var _0x488725=this;return new Promise(function(_0x28c989,_0x5e349f){return db[_0xbd6c('0x1a')][_0xbd6c('0x1b')]({'raw':_0x38c006[_0xbd6c('0x1c')]?_0x38c006[_0xbd6c('0x1c')][_0xbd6c('0x1d')]===undefined?!![]:![]:!![],'where':_0x38c006['options']?_0x38c006[_0xbd6c('0x1c')][_0xbd6c('0x1e')]||null:null,'attributes':_0x38c006[_0xbd6c('0x1c')]?_0x38c006[_0xbd6c('0x1c')]['attributes']||null:null,'limit':_0x38c006[_0xbd6c('0x1c')]?_0x38c006[_0xbd6c('0x1c')][_0xbd6c('0x1f')]||null:null,'include':_0x38c006[_0xbd6c('0x1c')]?_0x38c006[_0xbd6c('0x1c')][_0xbd6c('0x20')]?_[_0xbd6c('0x21')](_0x38c006[_0xbd6c('0x1c')]['include'],function(_0xac147b){return{'model':db[_0xac147b[_0xbd6c('0x22')]],'as':_0xac147b['as'],'attributes':_0xac147b['attributes'],'include':_0xac147b[_0xbd6c('0x20')]?_[_0xbd6c('0x21')](_0xac147b[_0xbd6c('0x20')],function(_0x33576e){return{'model':db[_0x33576e['model']],'as':_0x33576e['as'],'attributes':_0x33576e[_0xbd6c('0x23')],'include':_0x33576e['include']?_['map'](_0x33576e['include'],function(_0x20dc9e){return{'model':db[_0x20dc9e['model']],'as':_0x20dc9e['as'],'attributes':_0x20dc9e[_0xbd6c('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17fa7e){logger[_0xbd6c('0xe')](_0xbd6c('0x19'),_0x38c006);logger['debug'](_0xbd6c('0x19'),_0x38c006,JSON['stringify'](_0x17fa7e));_0x28c989(_0x17fa7e);})[_0xbd6c('0x18')](function(_0x27cea0){logger[_0xbd6c('0x14')](_0xbd6c('0x19'),_0x27cea0[_0xbd6c('0x16')],_0x38c006);_0x5e349f(_0x488725[_0xbd6c('0x14')](0x1f4,_0x27cea0[_0xbd6c('0x16')]));});});};exports['ShowFreshdeskAccount']=function(_0x4abe74){var _0x11c529=this;return new Promise(function(_0x4560d7,_0x5f45af){return db[_0xbd6c('0x1a')][_0xbd6c('0x24')]({'raw':_0x4abe74[_0xbd6c('0x1c')]?_0x4abe74[_0xbd6c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4abe74[_0xbd6c('0x1c')]?_0x4abe74[_0xbd6c('0x1c')][_0xbd6c('0x1e')]||null:null,'attributes':_0x4abe74[_0xbd6c('0x1c')]?_0x4abe74[_0xbd6c('0x1c')][_0xbd6c('0x23')]||null:null,'include':_0x4abe74['options']?_0x4abe74[_0xbd6c('0x1c')][_0xbd6c('0x20')]?_[_0xbd6c('0x21')](_0x4abe74[_0xbd6c('0x1c')][_0xbd6c('0x20')],function(_0x3b6d97){return{'model':db[_0x3b6d97['model']],'as':_0x3b6d97['as'],'attributes':_0x3b6d97[_0xbd6c('0x23')],'include':_0x3b6d97['include']?_[_0xbd6c('0x21')](_0x3b6d97['include'],function(_0x97fae){return{'model':db[_0x97fae[_0xbd6c('0x22')]],'as':_0x97fae['as'],'attributes':_0x97fae[_0xbd6c('0x23')],'include':_0x97fae['include']?_[_0xbd6c('0x21')](_0x97fae[_0xbd6c('0x20')],function(_0x6f4552){return{'model':db[_0x6f4552[_0xbd6c('0x22')]],'as':_0x6f4552['as'],'attributes':_0x6f4552[_0xbd6c('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbd6c('0xd')](function(_0x458ac4){logger['info'](_0xbd6c('0x25'),_0x4abe74);logger[_0xbd6c('0x11')](_0xbd6c('0x25'),_0x4abe74,JSON[_0xbd6c('0x13')](_0x458ac4));_0x4560d7(_0x458ac4);})[_0xbd6c('0x18')](function(_0x4eee8f){logger[_0xbd6c('0x14')](_0xbd6c('0x25'),_0x4eee8f[_0xbd6c('0x16')],_0x4abe74);_0x5f45af(_0x11c529[_0xbd6c('0x14')](0x1f4,_0x4eee8f['message']));});});};
\ No newline at end of file
index d8335c9..2cc2280 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f73=['getDescriptions','/:id/tags','create','setTags','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions'];(function(_0x32bca0,_0x44e426){var _0x16bb8b=function(_0x8b67f8){while(--_0x8b67f8){_0x32bca0['push'](_0x32bca0['shift']());}};_0x16bb8b(++_0x44e426);}(_0x0f73,0x18e));var _0x30f7=function(_0x3cbc2e,_0x189f64){_0x3cbc2e=_0x3cbc2e-0x0;var _0x506a42=_0x0f73[_0x3cbc2e];return _0x506a42;};'use strict';var multer=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var path=require(_0x30f7('0x2'));var timeout=require(_0x30f7('0x3'));var express=require('express');var router=express[_0x30f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x30f7('0x5'));var interaction=require(_0x30f7('0x6'));var config=require(_0x30f7('0x7'));var controller=require(_0x30f7('0x8'));router[_0x30f7('0x9')]('/',auth[_0x30f7('0xa')](),controller[_0x30f7('0xb')]);router['get'](_0x30f7('0xc'),auth[_0x30f7('0xa')](),controller[_0x30f7('0xd')]);router['get'](_0x30f7('0xe'),auth['isAuthenticated'](),controller[_0x30f7('0xf')]);router[_0x30f7('0x9')](_0x30f7('0x10'),auth[_0x30f7('0xa')](),controller['getSubjects']);router[_0x30f7('0x9')](_0x30f7('0x11'),auth[_0x30f7('0xa')](),controller[_0x30f7('0x12')]);router[_0x30f7('0x9')](_0x30f7('0x13'),auth[_0x30f7('0xa')](),controller['getTags']);router['post']('/',auth[_0x30f7('0xa')](),controller[_0x30f7('0x14')]);router['post'](_0x30f7('0x13'),auth[_0x30f7('0xa')](),controller[_0x30f7('0x15')]);router[_0x30f7('0x16')](_0x30f7('0xc'),auth['isAuthenticated'](),controller[_0x30f7('0x17')]);router[_0x30f7('0x18')](_0x30f7('0xc'),auth[_0x30f7('0xa')](),controller[_0x30f7('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x56a8=['/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x56a8,0xe2));var _0x856a=function(_0x5de598,_0x1b2a84){_0x5de598=_0x5de598-0x0;var _0x16289a=_0x56a8[_0x5de598];return _0x16289a;};'use strict';var multer=require('multer');var util=require(_0x856a('0x0'));var path=require(_0x856a('0x1'));var timeout=require(_0x856a('0x2'));var express=require(_0x856a('0x3'));var router=express[_0x856a('0x4')]();var fs_extra=require(_0x856a('0x5'));var auth=require(_0x856a('0x6'));var interaction=require(_0x856a('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x856a('0x8')](),controller[_0x856a('0x9')]);router[_0x856a('0xa')](_0x856a('0xb'),auth[_0x856a('0x8')](),controller[_0x856a('0xc')]);router[_0x856a('0xa')](_0x856a('0xd'),auth[_0x856a('0x8')](),controller[_0x856a('0xe')]);router[_0x856a('0xa')](_0x856a('0xf'),auth[_0x856a('0x8')](),controller[_0x856a('0x10')]);router[_0x856a('0xa')](_0x856a('0x11'),auth['isAuthenticated'](),controller[_0x856a('0x12')]);router[_0x856a('0xa')](_0x856a('0x13'),auth[_0x856a('0x8')](),controller[_0x856a('0x14')]);router[_0x856a('0x15')]('/',auth['isAuthenticated'](),controller[_0x856a('0x16')]);router[_0x856a('0x15')](_0x856a('0x13'),auth[_0x856a('0x8')](),controller[_0x856a('0x17')]);router[_0x856a('0x18')](_0x856a('0xb'),auth[_0x856a('0x8')](),controller[_0x856a('0x19')]);router['delete'](_0x856a('0xb'),auth[_0x856a('0x8')](),controller['destroy']);module[_0x856a('0x1a')]=router;
\ No newline at end of file
index 1e9e9ef..0db2af6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa155=['STRING','sequelize','exports'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0xa155,0x196));var _0x5a15=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa155[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x5a15('0x0'));module[_0x5a15('0x1')]={'name':{'type':Sequelize[_0x5a15('0x2')]},'description':{'type':Sequelize[_0x5a15('0x2')]}};
\ No newline at end of file
+var _0xa303=['sequelize','exports','STRING'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0xa303,0x13b));var _0x3a30=function(_0x374cf4,_0x458dfe){_0x374cf4=_0x374cf4-0x0;var _0x55df79=_0xa303[_0x374cf4];return _0x55df79;};'use strict';var Sequelize=require(_0x3a30('0x0'));module[_0x3a30('0x1')]={'name':{'type':Sequelize[_0x3a30('0x2')]},'description':{'type':Sequelize[_0x3a30('0x2')]}};
\ No newline at end of file
index 918a1f2..82ecfdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b4c=['merge','VIRTUAL','options','includeAll','include','FreshdeskConfiguration','findAll','rows','catch','show','params','find','create','body','getFields','findOne','FreshdeskField','length','getSubjects','order','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x2d17de,_0x33a3ea){var _0x22ecd7=function(_0x3c92c6){while(--_0x3c92c6){_0x2d17de['push'](_0x2d17de['shift']());}};_0x22ecd7(++_0x33a3ea);}(_0x8b4c,0x11a));var _0xc8b4=function(_0x2af138,_0x18d453){_0x2af138=_0x2af138-0x0;var _0x428b5c=_0x8b4c[_0x2af138];return _0x428b5c;};'use strict';var emlformat=require(_0xc8b4('0x0'));var rimraf=require(_0xc8b4('0x1'));var zipdir=require(_0xc8b4('0x2'));var jsonpatch=require(_0xc8b4('0x3'));var rp=require(_0xc8b4('0x4'));var moment=require(_0xc8b4('0x5'));var BPromise=require(_0xc8b4('0x6'));var Mustache=require(_0xc8b4('0x7'));var util=require(_0xc8b4('0x8'));var path=require(_0xc8b4('0x9'));var sox=require('sox');var csv=require(_0xc8b4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8b4('0xb'));var _=require('lodash');var squel=require(_0xc8b4('0xc'));var crypto=require(_0xc8b4('0xd'));var jsforce=require(_0xc8b4('0xe'));var deskjs=require(_0xc8b4('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc8b4('0x10'));var Papa=require(_0xc8b4('0x11'));var Redis=require(_0xc8b4('0x12'));var authService=require(_0xc8b4('0x13'));var qs=require(_0xc8b4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8b4('0x15'));var logger=require(_0xc8b4('0x16'))(_0xc8b4('0x17'));var utils=require(_0xc8b4('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e6180,_0x508725){_0x508725=_0x508725||0xcc;return function(_0x205b90){if(_0x205b90){return _0x1e6180[_0xc8b4('0x19')](_0x508725);}return _0x1e6180['status'](_0x508725)[_0xc8b4('0x1a')]();};}function respondWithResult(_0x163577,_0x3d084d){_0x3d084d=_0x3d084d||0xc8;return function(_0x297e09){if(_0x297e09){return _0x163577[_0xc8b4('0x1b')](_0x3d084d)[_0xc8b4('0x1c')](_0x297e09);}};}function respondWithFilteredResult(_0x1a2ced,_0x5b9854){return function(_0x2be000){if(_0x2be000){var _0x51fe56=typeof _0x5b9854['offset']==='undefined'&&typeof _0x5b9854[_0xc8b4('0x1d')]==='undefined';var _0x4d502c=_0x2be000[_0xc8b4('0x1e')];var _0x33400d=_0x51fe56?0x0:_0x5b9854[_0xc8b4('0x1f')];var _0x1f543b=_0x51fe56?_0x2be000[_0xc8b4('0x1e')]:_0x5b9854[_0xc8b4('0x1f')]+_0x5b9854['limit'];var _0xbfcebf;if(_0x1f543b>=_0x4d502c){_0x1f543b=_0x4d502c;_0xbfcebf=0xc8;}else{_0xbfcebf=0xce;}_0x1a2ced[_0xc8b4('0x1b')](_0xbfcebf);return _0x1a2ced[_0xc8b4('0x20')](_0xc8b4('0x21'),_0x33400d+'-'+_0x1f543b+'/'+_0x4d502c)['json'](_0x2be000);}return null;};}function patchUpdates(_0x4a7223){return function(_0x175a7f){try{jsonpatch[_0xc8b4('0x22')](_0x175a7f,_0x4a7223,!![]);}catch(_0x45726a){return BPromise[_0xc8b4('0x23')](_0x45726a);}return _0x175a7f['save']();};}function saveUpdates(_0x4af1ab,_0xf7b196){return function(_0x58b00f){if(_0x58b00f){return _0x58b00f[_0xc8b4('0x24')](_0x4af1ab)['then'](function(_0x42ba11){return _0x42ba11;});}return null;};}function removeEntity(_0x405e58,_0x362926){return function(_0x3082c9){if(_0x3082c9){return _0x3082c9[_0xc8b4('0x25')]()[_0xc8b4('0x26')](function(){_0x405e58[_0xc8b4('0x1b')](0xcc)[_0xc8b4('0x1a')]();});}};}function handleEntityNotFound(_0x191594,_0x6b82fa){return function(_0x1d3a1b){if(!_0x1d3a1b){_0x191594[_0xc8b4('0x19')](0x194);}return _0x1d3a1b;};}function handleError(_0x525e52,_0x467984){_0x467984=_0x467984||0x1f4;return function(_0xeb52fc){logger[_0xc8b4('0x27')](_0xeb52fc[_0xc8b4('0x28')]);if(_0xeb52fc[_0xc8b4('0x29')]){delete _0xeb52fc[_0xc8b4('0x29')];}_0x525e52['status'](_0x467984)[_0xc8b4('0x2a')](_0xeb52fc);};}exports[_0xc8b4('0x2b')]=function(_0x1442ef,_0x11bdb1){var _0x503bb7={},_0x42b784={},_0xb5570d={'count':0x0,'rows':[]};var _0x354f50=_[_0xc8b4('0x2c')](db['FreshdeskConfiguration'][_0xc8b4('0x2d')],function(_0x5b97d1){return{'name':_0x5b97d1[_0xc8b4('0x2e')],'type':_0x5b97d1[_0xc8b4('0x2f')][_0xc8b4('0x30')]};});_0x42b784[_0xc8b4('0x31')]=_[_0xc8b4('0x2c')](_0x354f50,_0xc8b4('0x29'));_0x42b784[_0xc8b4('0x32')]=_[_0xc8b4('0x33')](_0x1442ef[_0xc8b4('0x32')]);_0x42b784[_0xc8b4('0x34')]=_['intersection'](_0x42b784[_0xc8b4('0x31')],_0x42b784[_0xc8b4('0x32')]);_0x503bb7['attributes']=_[_0xc8b4('0x35')](_0x42b784[_0xc8b4('0x31')],qs[_0xc8b4('0x36')](_0x1442ef[_0xc8b4('0x32')]['fields']));_0x503bb7[_0xc8b4('0x37')]=_0x503bb7[_0xc8b4('0x37')]['length']?_0x503bb7['attributes']:_0x42b784[_0xc8b4('0x31')];if(!_0x1442ef[_0xc8b4('0x32')][_0xc8b4('0x38')](_0xc8b4('0x39'))){_0x503bb7['limit']=qs[_0xc8b4('0x1d')](_0x1442ef[_0xc8b4('0x32')][_0xc8b4('0x1d')]);_0x503bb7[_0xc8b4('0x1f')]=qs[_0xc8b4('0x1f')](_0x1442ef[_0xc8b4('0x32')][_0xc8b4('0x1f')]);}_0x503bb7['order']=qs[_0xc8b4('0x3a')](_0x1442ef[_0xc8b4('0x32')][_0xc8b4('0x3a')]);_0x503bb7[_0xc8b4('0x3b')]=qs[_0xc8b4('0x34')](_[_0xc8b4('0x3c')](_0x1442ef[_0xc8b4('0x32')],_0x42b784[_0xc8b4('0x34')]),_0x354f50);if(_0x1442ef[_0xc8b4('0x32')][_0xc8b4('0x3d')]){_0x503bb7[_0xc8b4('0x3b')]=_[_0xc8b4('0x3e')](_0x503bb7[_0xc8b4('0x3b')],{'$or':_['map'](_0x354f50,function(_0x4c45b2){if(_0x4c45b2[_0xc8b4('0x2f')]!==_0xc8b4('0x3f')){var _0x137966={};_0x137966[_0x4c45b2[_0xc8b4('0x29')]]={'$like':'%'+_0x1442ef[_0xc8b4('0x32')][_0xc8b4('0x3d')]+'%'};return _0x137966;}})});}_0x503bb7=_[_0xc8b4('0x3e')]({},_0x503bb7,_0x1442ef[_0xc8b4('0x40')]);var _0x34255a={'where':_0x503bb7[_0xc8b4('0x3b')]};return db['FreshdeskConfiguration'][_0xc8b4('0x1e')](_0x34255a)[_0xc8b4('0x26')](function(_0x1ea8de){_0xb5570d[_0xc8b4('0x1e')]=_0x1ea8de;if(_0x1442ef['query'][_0xc8b4('0x41')]){_0x503bb7[_0xc8b4('0x42')]=[{'all':!![]}];}return db[_0xc8b4('0x43')][_0xc8b4('0x44')](_0x503bb7);})[_0xc8b4('0x26')](function(_0x11a4b6){_0xb5570d[_0xc8b4('0x45')]=_0x11a4b6;return _0xb5570d;})[_0xc8b4('0x26')](respondWithFilteredResult(_0x11bdb1,_0x503bb7))[_0xc8b4('0x46')](handleError(_0x11bdb1,null));};exports[_0xc8b4('0x47')]=function(_0x5d6f37,_0x1dcff8){var _0x17ed1c={'raw':![],'where':{'id':_0x5d6f37[_0xc8b4('0x48')]['id']}},_0x21928d={};_0x21928d[_0xc8b4('0x31')]=_['keys'](db[_0xc8b4('0x43')][_0xc8b4('0x2d')]);_0x21928d['query']=_[_0xc8b4('0x33')](_0x5d6f37[_0xc8b4('0x32')]);_0x21928d[_0xc8b4('0x34')]=_['intersection'](_0x21928d[_0xc8b4('0x31')],_0x21928d[_0xc8b4('0x32')]);_0x17ed1c[_0xc8b4('0x37')]=_['intersection'](_0x21928d[_0xc8b4('0x31')],qs[_0xc8b4('0x36')](_0x5d6f37['query']['fields']));_0x17ed1c[_0xc8b4('0x37')]=_0x17ed1c[_0xc8b4('0x37')]['length']?_0x17ed1c[_0xc8b4('0x37')]:_0x21928d[_0xc8b4('0x31')];if(_0x5d6f37[_0xc8b4('0x32')][_0xc8b4('0x41')]){_0x17ed1c[_0xc8b4('0x42')]=[{'all':!![]}];}_0x17ed1c=_[_0xc8b4('0x3e')]({},_0x17ed1c,_0x5d6f37[_0xc8b4('0x40')]);return db[_0xc8b4('0x43')][_0xc8b4('0x49')](_0x17ed1c)[_0xc8b4('0x26')](handleEntityNotFound(_0x1dcff8,null))[_0xc8b4('0x26')](respondWithResult(_0x1dcff8,null))[_0xc8b4('0x46')](handleError(_0x1dcff8,null));};exports['create']=function(_0x4c9bba,_0x510af8){return db['FreshdeskConfiguration'][_0xc8b4('0x4a')](_0x4c9bba[_0xc8b4('0x4b')],{})[_0xc8b4('0x26')](respondWithResult(_0x510af8,0xc9))['catch'](handleError(_0x510af8,null));};exports[_0xc8b4('0x24')]=function(_0x2aeb20,_0x3621ec){if(_0x2aeb20[_0xc8b4('0x4b')]['id']){delete _0x2aeb20[_0xc8b4('0x4b')]['id'];}return db[_0xc8b4('0x43')]['find']({'where':{'id':_0x2aeb20[_0xc8b4('0x48')]['id']}})['then'](handleEntityNotFound(_0x3621ec,null))[_0xc8b4('0x26')](saveUpdates(_0x2aeb20[_0xc8b4('0x4b')],null))[_0xc8b4('0x26')](respondWithResult(_0x3621ec,null))[_0xc8b4('0x46')](handleError(_0x3621ec,null));};exports['destroy']=function(_0x1f500c,_0x2ddd86){return db[_0xc8b4('0x43')]['find']({'where':{'id':_0x1f500c['params']['id']}})[_0xc8b4('0x26')](handleEntityNotFound(_0x2ddd86,null))[_0xc8b4('0x26')](removeEntity(_0x2ddd86,null))[_0xc8b4('0x46')](handleError(_0x2ddd86,null));};exports[_0xc8b4('0x4c')]=function(_0x36a148,_0x4dc05b,_0x4b5d9d){var _0xb8091={};var _0x3c590d={};var _0x21678f;var _0x4bd7f3;return db['FreshdeskConfiguration'][_0xc8b4('0x4d')]({'where':{'id':_0x36a148[_0xc8b4('0x48')]['id']}})[_0xc8b4('0x26')](handleEntityNotFound(_0x4dc05b,null))[_0xc8b4('0x26')](function(_0x16ca04){if(_0x16ca04){_0x21678f=_0x16ca04;_0x3c590d[_0xc8b4('0x31')]=_[_0xc8b4('0x33')](db[_0xc8b4('0x4e')][_0xc8b4('0x2d')]);_0x3c590d[_0xc8b4('0x32')]=_[_0xc8b4('0x33')](_0x36a148[_0xc8b4('0x32')]);_0x3c590d[_0xc8b4('0x34')]=_['intersection'](_0x3c590d['model'],_0x3c590d['query']);_0xb8091['attributes']=_[_0xc8b4('0x35')](_0x3c590d[_0xc8b4('0x31')],qs[_0xc8b4('0x36')](_0x36a148[_0xc8b4('0x32')][_0xc8b4('0x36')]));_0xb8091['attributes']=_0xb8091['attributes'][_0xc8b4('0x4f')]?_0xb8091[_0xc8b4('0x37')]:_0x3c590d['model'];_0xb8091['order']=qs[_0xc8b4('0x3a')](_0x36a148[_0xc8b4('0x32')][_0xc8b4('0x3a')]);_0xb8091[_0xc8b4('0x3b')]=qs[_0xc8b4('0x34')](_['pick'](_0x36a148['query'],_0x3c590d[_0xc8b4('0x34')]));if(_0x36a148[_0xc8b4('0x32')][_0xc8b4('0x3d')]){_0xb8091[_0xc8b4('0x3b')]=_[_0xc8b4('0x3e')](_0xb8091[_0xc8b4('0x3b')],{'$or':_[_0xc8b4('0x2c')](_0xb8091['attributes'],function(_0x3388ff){var _0x1f6b48={};_0x1f6b48[_0x3388ff]={'$like':'%'+_0x36a148[_0xc8b4('0x32')][_0xc8b4('0x3d')]+'%'};return _0x1f6b48;})});}_0xb8091=_[_0xc8b4('0x3e')]({},_0xb8091,_0x36a148['options']);return _0x21678f[_0xc8b4('0x4c')](_0xb8091);}})[_0xc8b4('0x26')](function(_0x37d303){if(_0x37d303){_0x4bd7f3=_0x37d303[_0xc8b4('0x4f')];if(!_0x36a148['query']['hasOwnProperty'](_0xc8b4('0x39'))){_0xb8091[_0xc8b4('0x1d')]=qs[_0xc8b4('0x1d')](_0x36a148[_0xc8b4('0x32')][_0xc8b4('0x1d')]);_0xb8091['offset']=qs[_0xc8b4('0x1f')](_0x36a148[_0xc8b4('0x32')][_0xc8b4('0x1f')]);}return _0x21678f[_0xc8b4('0x4c')](_0xb8091);}})[_0xc8b4('0x26')](function(_0x8bc46e){if(_0x8bc46e){return _0x8bc46e?{'count':_0x4bd7f3,'rows':_0x8bc46e}:null;}})[_0xc8b4('0x26')](respondWithResult(_0x4dc05b,null))[_0xc8b4('0x46')](handleError(_0x4dc05b,null));};exports[_0xc8b4('0x50')]=function(_0x8c22b8,_0x4ce910,_0x3f1e9c){var _0xbe56aa={};var _0xd6f2f3={};var _0x508c2e;var _0x2b8c2a;return db[_0xc8b4('0x43')][_0xc8b4('0x4d')]({'where':{'id':_0x8c22b8[_0xc8b4('0x48')]['id']}})[_0xc8b4('0x26')](handleEntityNotFound(_0x4ce910,null))[_0xc8b4('0x26')](function(_0x4fb569){if(_0x4fb569){_0x508c2e=_0x4fb569;_0xd6f2f3[_0xc8b4('0x31')]=_[_0xc8b4('0x33')](db[_0xc8b4('0x4e')][_0xc8b4('0x2d')]);_0xd6f2f3['query']=_[_0xc8b4('0x33')](_0x8c22b8['query']);_0xd6f2f3[_0xc8b4('0x34')]=_[_0xc8b4('0x35')](_0xd6f2f3[_0xc8b4('0x31')],_0xd6f2f3[_0xc8b4('0x32')]);_0xbe56aa[_0xc8b4('0x37')]=_[_0xc8b4('0x35')](_0xd6f2f3['model'],qs['fields'](_0x8c22b8['query'][_0xc8b4('0x36')]));_0xbe56aa[_0xc8b4('0x37')]=_0xbe56aa[_0xc8b4('0x37')][_0xc8b4('0x4f')]?_0xbe56aa['attributes']:_0xd6f2f3['model'];_0xbe56aa[_0xc8b4('0x51')]=qs['sort'](_0x8c22b8['query'][_0xc8b4('0x3a')]);_0xbe56aa['where']=qs[_0xc8b4('0x34')](_['pick'](_0x8c22b8[_0xc8b4('0x32')],_0xd6f2f3['filters']));if(_0x8c22b8[_0xc8b4('0x32')][_0xc8b4('0x3d')]){_0xbe56aa[_0xc8b4('0x3b')]=_[_0xc8b4('0x3e')](_0xbe56aa['where'],{'$or':_['map'](_0xbe56aa[_0xc8b4('0x37')],function(_0x551b77){var _0x49357e={};_0x49357e[_0x551b77]={'$like':'%'+_0x8c22b8[_0xc8b4('0x32')][_0xc8b4('0x3d')]+'%'};return _0x49357e;})});}_0xbe56aa=_[_0xc8b4('0x3e')]({},_0xbe56aa,_0x8c22b8[_0xc8b4('0x40')]);return _0x508c2e[_0xc8b4('0x50')](_0xbe56aa);}})[_0xc8b4('0x26')](function(_0x144f20){if(_0x144f20){_0x2b8c2a=_0x144f20['length'];if(!_0x8c22b8[_0xc8b4('0x32')][_0xc8b4('0x38')](_0xc8b4('0x39'))){_0xbe56aa[_0xc8b4('0x1d')]=qs[_0xc8b4('0x1d')](_0x8c22b8[_0xc8b4('0x32')][_0xc8b4('0x1d')]);_0xbe56aa[_0xc8b4('0x1f')]=qs[_0xc8b4('0x1f')](_0x8c22b8[_0xc8b4('0x32')]['offset']);}return _0x508c2e[_0xc8b4('0x50')](_0xbe56aa);}})['then'](function(_0x288a96){if(_0x288a96){return _0x288a96?{'count':_0x2b8c2a,'rows':_0x288a96}:null;}})[_0xc8b4('0x26')](respondWithResult(_0x4ce910,null))['catch'](handleError(_0x4ce910,null));};exports[_0xc8b4('0x52')]=function(_0x443d5d,_0x314e02,_0xd0d80a){var _0x472ed5={};var _0xef189d={};var _0x451733;var _0x1bf582;return db[_0xc8b4('0x43')]['findOne']({'where':{'id':_0x443d5d[_0xc8b4('0x48')]['id']}})[_0xc8b4('0x26')](handleEntityNotFound(_0x314e02,null))[_0xc8b4('0x26')](function(_0x4c2b27){if(_0x4c2b27){_0x451733=_0x4c2b27;_0xef189d[_0xc8b4('0x31')]=_['keys'](db[_0xc8b4('0x4e')][_0xc8b4('0x2d')]);_0xef189d[_0xc8b4('0x32')]=_['keys'](_0x443d5d[_0xc8b4('0x32')]);_0xef189d[_0xc8b4('0x34')]=_[_0xc8b4('0x35')](_0xef189d[_0xc8b4('0x31')],_0xef189d[_0xc8b4('0x32')]);_0x472ed5[_0xc8b4('0x37')]=_[_0xc8b4('0x35')](_0xef189d[_0xc8b4('0x31')],qs[_0xc8b4('0x36')](_0x443d5d['query']['fields']));_0x472ed5['attributes']=_0x472ed5['attributes'][_0xc8b4('0x4f')]?_0x472ed5[_0xc8b4('0x37')]:_0xef189d[_0xc8b4('0x31')];_0x472ed5[_0xc8b4('0x51')]=qs[_0xc8b4('0x3a')](_0x443d5d[_0xc8b4('0x32')][_0xc8b4('0x3a')]);_0x472ed5[_0xc8b4('0x3b')]=qs[_0xc8b4('0x34')](_[_0xc8b4('0x3c')](_0x443d5d[_0xc8b4('0x32')],_0xef189d[_0xc8b4('0x34')]));if(_0x443d5d[_0xc8b4('0x32')][_0xc8b4('0x3d')]){_0x472ed5[_0xc8b4('0x3b')]=_[_0xc8b4('0x3e')](_0x472ed5['where'],{'$or':_['map'](_0x472ed5[_0xc8b4('0x37')],function(_0x2eb6da){var _0x2d3763={};_0x2d3763[_0x2eb6da]={'$like':'%'+_0x443d5d[_0xc8b4('0x32')][_0xc8b4('0x3d')]+'%'};return _0x2d3763;})});}_0x472ed5=_[_0xc8b4('0x3e')]({},_0x472ed5,_0x443d5d[_0xc8b4('0x40')]);return _0x451733['getDescriptions'](_0x472ed5);}})['then'](function(_0x3a7e25){if(_0x3a7e25){_0x1bf582=_0x3a7e25[_0xc8b4('0x4f')];if(!_0x443d5d[_0xc8b4('0x32')][_0xc8b4('0x38')](_0xc8b4('0x39'))){_0x472ed5[_0xc8b4('0x1d')]=qs[_0xc8b4('0x1d')](_0x443d5d[_0xc8b4('0x32')][_0xc8b4('0x1d')]);_0x472ed5[_0xc8b4('0x1f')]=qs[_0xc8b4('0x1f')](_0x443d5d['query'][_0xc8b4('0x1f')]);}return _0x451733[_0xc8b4('0x52')](_0x472ed5);}})[_0xc8b4('0x26')](function(_0x46d109){if(_0x46d109){return _0x46d109?{'count':_0x1bf582,'rows':_0x46d109}:null;}})[_0xc8b4('0x26')](respondWithResult(_0x314e02,null))['catch'](handleError(_0x314e02,null));};exports[_0xc8b4('0x53')]=function(_0x5b79c9,_0x24a6a7,_0xad5ea9){var _0x2f644b={};var _0x4c8bd7={};var _0x408607;var _0x36ebaa;return db['FreshdeskConfiguration'][_0xc8b4('0x4d')]({'where':{'id':_0x5b79c9[_0xc8b4('0x48')]['id']}})[_0xc8b4('0x26')](handleEntityNotFound(_0x24a6a7,null))[_0xc8b4('0x26')](function(_0x263eb4){if(_0x263eb4){_0x408607=_0x263eb4;_0x4c8bd7[_0xc8b4('0x31')]=_['keys'](db[_0xc8b4('0x54')]['rawAttributes']);_0x4c8bd7[_0xc8b4('0x32')]=_[_0xc8b4('0x33')](_0x5b79c9[_0xc8b4('0x32')]);_0x4c8bd7[_0xc8b4('0x34')]=_[_0xc8b4('0x35')](_0x4c8bd7[_0xc8b4('0x31')],_0x4c8bd7[_0xc8b4('0x32')]);_0x2f644b[_0xc8b4('0x37')]=_[_0xc8b4('0x35')](_0x4c8bd7['model'],qs[_0xc8b4('0x36')](_0x5b79c9[_0xc8b4('0x32')][_0xc8b4('0x36')]));_0x2f644b['attributes']=_0x2f644b[_0xc8b4('0x37')]['length']?_0x2f644b[_0xc8b4('0x37')]:_0x4c8bd7[_0xc8b4('0x31')];_0x2f644b[_0xc8b4('0x51')]=qs['sort'](_0x5b79c9['query']['sort']);_0x2f644b['where']=qs[_0xc8b4('0x34')](_[_0xc8b4('0x3c')](_0x5b79c9[_0xc8b4('0x32')],_0x4c8bd7[_0xc8b4('0x34')]));if(_0x5b79c9[_0xc8b4('0x32')][_0xc8b4('0x3d')]){_0x2f644b[_0xc8b4('0x3b')]=_['merge'](_0x2f644b[_0xc8b4('0x3b')],{'$or':_['map'](_0x2f644b[_0xc8b4('0x37')],function(_0x1fceba){var _0x1e33c8={};_0x1e33c8[_0x1fceba]={'$like':'%'+_0x5b79c9[_0xc8b4('0x32')][_0xc8b4('0x3d')]+'%'};return _0x1e33c8;})});}_0x2f644b=_['merge']({},_0x2f644b,_0x5b79c9[_0xc8b4('0x40')]);return _0x408607[_0xc8b4('0x53')](_0x2f644b);}})[_0xc8b4('0x26')](function(_0x127e31){if(_0x127e31){_0x36ebaa=_0x127e31['length'];if(!_0x5b79c9[_0xc8b4('0x32')][_0xc8b4('0x38')](_0xc8b4('0x39'))){_0x2f644b[_0xc8b4('0x1d')]=qs[_0xc8b4('0x1d')](_0x5b79c9[_0xc8b4('0x32')][_0xc8b4('0x1d')]);_0x2f644b[_0xc8b4('0x1f')]=qs[_0xc8b4('0x1f')](_0x5b79c9[_0xc8b4('0x32')][_0xc8b4('0x1f')]);}return _0x408607[_0xc8b4('0x53')](_0x2f644b);}})[_0xc8b4('0x26')](function(_0x140f2d){if(_0x140f2d){return _0x140f2d?{'count':_0x36ebaa,'rows':_0x140f2d}:null;}})[_0xc8b4('0x26')](respondWithResult(_0x24a6a7,null))['catch'](handleError(_0x24a6a7,null));};exports[_0xc8b4('0x55')]=function(_0x590346,_0x462293,_0x5540c4){if(_0x590346[_0xc8b4('0x4b')]['id']){delete _0x590346[_0xc8b4('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0xc8b4('0x4d')]({'where':{'id':_0x590346[_0xc8b4('0x48')]['id']}})[_0xc8b4('0x26')](handleEntityNotFound(_0x462293,null))[_0xc8b4('0x26')](function(_0x454792){if(_0x454792){return _0x454792['setTags'](_0x590346['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x462293,null))['catch'](handleError(_0x462293,null));};
\ No newline at end of file
+var _0x581e=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','include','findAll','catch','show','params','find','create','body','getFields','FreshdeskField','pick','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','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'];(function(_0x454321,_0x551e07){var _0x1dd220=function(_0x3e652b){while(--_0x3e652b){_0x454321['push'](_0x454321['shift']());}};_0x1dd220(++_0x551e07);}(_0x581e,0x1db));var _0xe581=function(_0x27660b,_0x14148f){_0x27660b=_0x27660b-0x0;var _0xbc5762=_0x581e[_0x27660b];return _0xbc5762;};'use strict';var emlformat=require(_0xe581('0x0'));var rimraf=require(_0xe581('0x1'));var zipdir=require(_0xe581('0x2'));var jsonpatch=require(_0xe581('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe581('0x4'));var Mustache=require('mustache');var util=require(_0xe581('0x5'));var path=require(_0xe581('0x6'));var sox=require(_0xe581('0x7'));var csv=require(_0xe581('0x8'));var ejs=require(_0xe581('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe581('0xa'));var squel=require(_0xe581('0xb'));var crypto=require(_0xe581('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe581('0xd'));var toCsv=require(_0xe581('0x8'));var querystring=require(_0xe581('0xe'));var Papa=require(_0xe581('0xf'));var Redis=require(_0xe581('0x10'));var authService=require(_0xe581('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe581('0x12'));var logger=require(_0xe581('0x13'))(_0xe581('0x14'));var utils=require(_0xe581('0x15'));var config=require(_0xe581('0x16'));var licenseUtil=require(_0xe581('0x17'));var db=require(_0xe581('0x18'))['db'];function respondWithStatusCode(_0x269f6a,_0x2939e1){_0x2939e1=_0x2939e1||0xcc;return function(_0x208967){if(_0x208967){return _0x269f6a[_0xe581('0x19')](_0x2939e1);}return _0x269f6a[_0xe581('0x1a')](_0x2939e1)['end']();};}function respondWithResult(_0x264665,_0x255dd4){_0x255dd4=_0x255dd4||0xc8;return function(_0x2f95e4){if(_0x2f95e4){return _0x264665[_0xe581('0x1a')](_0x255dd4)[_0xe581('0x1b')](_0x2f95e4);}};}function respondWithFilteredResult(_0x496150,_0x344437){return function(_0x389f0c){if(_0x389f0c){var _0x4e1ab4=typeof _0x344437[_0xe581('0x1c')]===_0xe581('0x1d')&&typeof _0x344437['limit']===_0xe581('0x1d');var _0x346398=_0x389f0c[_0xe581('0x1e')];var _0x1d56fe=_0x4e1ab4?0x0:_0x344437[_0xe581('0x1c')];var _0x4f1fdb=_0x4e1ab4?_0x389f0c['count']:_0x344437[_0xe581('0x1c')]+_0x344437[_0xe581('0x1f')];var _0x570922;if(_0x4f1fdb>=_0x346398){_0x4f1fdb=_0x346398;_0x570922=0xc8;}else{_0x570922=0xce;}_0x496150[_0xe581('0x1a')](_0x570922);return _0x496150['set']('Content-Range',_0x1d56fe+'-'+_0x4f1fdb+'/'+_0x346398)['json'](_0x389f0c);}return null;};}function patchUpdates(_0x5d5afd){return function(_0x2af38e){try{jsonpatch[_0xe581('0x20')](_0x2af38e,_0x5d5afd,!![]);}catch(_0x2223ad){return BPromise[_0xe581('0x21')](_0x2223ad);}return _0x2af38e[_0xe581('0x22')]();};}function saveUpdates(_0x22d9c3,_0x29b522){return function(_0x34a8e4){if(_0x34a8e4){return _0x34a8e4[_0xe581('0x23')](_0x22d9c3)[_0xe581('0x24')](function(_0x46eeb6){return _0x46eeb6;});}return null;};}function removeEntity(_0x3f36d1,_0x11c829){return function(_0x155f60){if(_0x155f60){return _0x155f60[_0xe581('0x25')]()['then'](function(){_0x3f36d1[_0xe581('0x1a')](0xcc)[_0xe581('0x26')]();});}};}function handleEntityNotFound(_0x429596,_0x5249d4){return function(_0x103f5b){if(!_0x103f5b){_0x429596[_0xe581('0x19')](0x194);}return _0x103f5b;};}function handleError(_0x45fa8d,_0x4058e0){_0x4058e0=_0x4058e0||0x1f4;return function(_0x155c7d){logger[_0xe581('0x27')](_0x155c7d[_0xe581('0x28')]);if(_0x155c7d[_0xe581('0x29')]){delete _0x155c7d[_0xe581('0x29')];}_0x45fa8d[_0xe581('0x1a')](_0x4058e0)[_0xe581('0x2a')](_0x155c7d);};}exports[_0xe581('0x2b')]=function(_0xe7b54f,_0x5192cb){var _0x2473fb={},_0x36318a={},_0x5a0b36={'count':0x0,'rows':[]};var _0x3599c8=_[_0xe581('0x2c')](db[_0xe581('0x2d')][_0xe581('0x2e')],function(_0x328778){return{'name':_0x328778['fieldName'],'type':_0x328778['type'][_0xe581('0x2f')]};});_0x36318a[_0xe581('0x30')]=_[_0xe581('0x2c')](_0x3599c8,_0xe581('0x29'));_0x36318a[_0xe581('0x31')]=_[_0xe581('0x32')](_0xe7b54f[_0xe581('0x31')]);_0x36318a[_0xe581('0x33')]=_[_0xe581('0x34')](_0x36318a[_0xe581('0x30')],_0x36318a[_0xe581('0x31')]);_0x2473fb['attributes']=_[_0xe581('0x34')](_0x36318a[_0xe581('0x30')],qs['fields'](_0xe7b54f[_0xe581('0x31')][_0xe581('0x35')]));_0x2473fb[_0xe581('0x36')]=_0x2473fb[_0xe581('0x36')][_0xe581('0x37')]?_0x2473fb['attributes']:_0x36318a[_0xe581('0x30')];if(!_0xe7b54f[_0xe581('0x31')][_0xe581('0x38')](_0xe581('0x39'))){_0x2473fb[_0xe581('0x1f')]=qs[_0xe581('0x1f')](_0xe7b54f[_0xe581('0x31')]['limit']);_0x2473fb[_0xe581('0x1c')]=qs[_0xe581('0x1c')](_0xe7b54f[_0xe581('0x31')]['offset']);}_0x2473fb[_0xe581('0x3a')]=qs[_0xe581('0x3b')](_0xe7b54f[_0xe581('0x31')][_0xe581('0x3b')]);_0x2473fb[_0xe581('0x3c')]=qs[_0xe581('0x33')](_['pick'](_0xe7b54f[_0xe581('0x31')],_0x36318a['filters']),_0x3599c8);if(_0xe7b54f[_0xe581('0x31')][_0xe581('0x3d')]){_0x2473fb[_0xe581('0x3c')]=_[_0xe581('0x3e')](_0x2473fb[_0xe581('0x3c')],{'$or':_['map'](_0x3599c8,function(_0xebf077){if(_0xebf077[_0xe581('0x3f')]!=='VIRTUAL'){var _0x39068e={};_0x39068e[_0xebf077[_0xe581('0x29')]]={'$like':'%'+_0xe7b54f[_0xe581('0x31')][_0xe581('0x3d')]+'%'};return _0x39068e;}})});}_0x2473fb=_['merge']({},_0x2473fb,_0xe7b54f[_0xe581('0x40')]);var _0x28f5f7={'where':_0x2473fb[_0xe581('0x3c')]};return db[_0xe581('0x2d')][_0xe581('0x1e')](_0x28f5f7)[_0xe581('0x24')](function(_0x3ad037){_0x5a0b36['count']=_0x3ad037;if(_0xe7b54f[_0xe581('0x31')]['includeAll']){_0x2473fb[_0xe581('0x41')]=[{'all':!![]}];}return db[_0xe581('0x2d')][_0xe581('0x42')](_0x2473fb);})[_0xe581('0x24')](function(_0x5777c9){_0x5a0b36['rows']=_0x5777c9;return _0x5a0b36;})['then'](respondWithFilteredResult(_0x5192cb,_0x2473fb))[_0xe581('0x43')](handleError(_0x5192cb,null));};exports[_0xe581('0x44')]=function(_0x5cd0ce,_0x79484e){var _0x586830={'raw':![],'where':{'id':_0x5cd0ce[_0xe581('0x45')]['id']}},_0x243b35={};_0x243b35[_0xe581('0x30')]=_[_0xe581('0x32')](db[_0xe581('0x2d')]['rawAttributes']);_0x243b35[_0xe581('0x31')]=_[_0xe581('0x32')](_0x5cd0ce[_0xe581('0x31')]);_0x243b35[_0xe581('0x33')]=_[_0xe581('0x34')](_0x243b35[_0xe581('0x30')],_0x243b35[_0xe581('0x31')]);_0x586830['attributes']=_[_0xe581('0x34')](_0x243b35[_0xe581('0x30')],qs[_0xe581('0x35')](_0x5cd0ce[_0xe581('0x31')][_0xe581('0x35')]));_0x586830[_0xe581('0x36')]=_0x586830[_0xe581('0x36')][_0xe581('0x37')]?_0x586830[_0xe581('0x36')]:_0x243b35[_0xe581('0x30')];if(_0x5cd0ce[_0xe581('0x31')]['includeAll']){_0x586830[_0xe581('0x41')]=[{'all':!![]}];}_0x586830=_[_0xe581('0x3e')]({},_0x586830,_0x5cd0ce[_0xe581('0x40')]);return db['FreshdeskConfiguration'][_0xe581('0x46')](_0x586830)[_0xe581('0x24')](handleEntityNotFound(_0x79484e,null))[_0xe581('0x24')](respondWithResult(_0x79484e,null))[_0xe581('0x43')](handleError(_0x79484e,null));};exports[_0xe581('0x47')]=function(_0x346a2c,_0x3c7293){return db[_0xe581('0x2d')][_0xe581('0x47')](_0x346a2c[_0xe581('0x48')],{})[_0xe581('0x24')](respondWithResult(_0x3c7293,0xc9))[_0xe581('0x43')](handleError(_0x3c7293,null));};exports[_0xe581('0x23')]=function(_0x1deec4,_0x502e1e){if(_0x1deec4[_0xe581('0x48')]['id']){delete _0x1deec4['body']['id'];}return db[_0xe581('0x2d')][_0xe581('0x46')]({'where':{'id':_0x1deec4[_0xe581('0x45')]['id']}})[_0xe581('0x24')](handleEntityNotFound(_0x502e1e,null))['then'](saveUpdates(_0x1deec4[_0xe581('0x48')],null))[_0xe581('0x24')](respondWithResult(_0x502e1e,null))[_0xe581('0x43')](handleError(_0x502e1e,null));};exports[_0xe581('0x25')]=function(_0x2b8e69,_0x1e836a){return db[_0xe581('0x2d')][_0xe581('0x46')]({'where':{'id':_0x2b8e69[_0xe581('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e836a,null))['then'](removeEntity(_0x1e836a,null))[_0xe581('0x43')](handleError(_0x1e836a,null));};exports[_0xe581('0x49')]=function(_0x11c576,_0xf91f7,_0x154c51){var _0x355748={};var _0x228c9f={};var _0x1ea49d;var _0x55b2aa;return db[_0xe581('0x2d')]['findOne']({'where':{'id':_0x11c576[_0xe581('0x45')]['id']}})['then'](handleEntityNotFound(_0xf91f7,null))[_0xe581('0x24')](function(_0x10f474){if(_0x10f474){_0x1ea49d=_0x10f474;_0x228c9f[_0xe581('0x30')]=_[_0xe581('0x32')](db[_0xe581('0x4a')][_0xe581('0x2e')]);_0x228c9f[_0xe581('0x31')]=_[_0xe581('0x32')](_0x11c576['query']);_0x228c9f['filters']=_[_0xe581('0x34')](_0x228c9f[_0xe581('0x30')],_0x228c9f['query']);_0x355748[_0xe581('0x36')]=_[_0xe581('0x34')](_0x228c9f['model'],qs[_0xe581('0x35')](_0x11c576[_0xe581('0x31')][_0xe581('0x35')]));_0x355748['attributes']=_0x355748[_0xe581('0x36')][_0xe581('0x37')]?_0x355748[_0xe581('0x36')]:_0x228c9f['model'];_0x355748['order']=qs[_0xe581('0x3b')](_0x11c576[_0xe581('0x31')][_0xe581('0x3b')]);_0x355748['where']=qs[_0xe581('0x33')](_[_0xe581('0x4b')](_0x11c576[_0xe581('0x31')],_0x228c9f[_0xe581('0x33')]));if(_0x11c576[_0xe581('0x31')][_0xe581('0x3d')]){_0x355748[_0xe581('0x3c')]=_[_0xe581('0x3e')](_0x355748[_0xe581('0x3c')],{'$or':_[_0xe581('0x2c')](_0x355748[_0xe581('0x36')],function(_0x2c855a){var _0x2ed9ae={};_0x2ed9ae[_0x2c855a]={'$like':'%'+_0x11c576[_0xe581('0x31')][_0xe581('0x3d')]+'%'};return _0x2ed9ae;})});}_0x355748=_[_0xe581('0x3e')]({},_0x355748,_0x11c576[_0xe581('0x40')]);return _0x1ea49d[_0xe581('0x49')](_0x355748);}})[_0xe581('0x24')](function(_0x2145fc){if(_0x2145fc){_0x55b2aa=_0x2145fc[_0xe581('0x37')];if(!_0x11c576[_0xe581('0x31')][_0xe581('0x38')](_0xe581('0x39'))){_0x355748[_0xe581('0x1f')]=qs[_0xe581('0x1f')](_0x11c576[_0xe581('0x31')][_0xe581('0x1f')]);_0x355748[_0xe581('0x1c')]=qs[_0xe581('0x1c')](_0x11c576['query'][_0xe581('0x1c')]);}return _0x1ea49d['getFields'](_0x355748);}})[_0xe581('0x24')](function(_0x443108){if(_0x443108){return _0x443108?{'count':_0x55b2aa,'rows':_0x443108}:null;}})[_0xe581('0x24')](respondWithResult(_0xf91f7,null))[_0xe581('0x43')](handleError(_0xf91f7,null));};exports[_0xe581('0x4c')]=function(_0xfecf36,_0x5a80f0,_0x3131a4){var _0x994ca={};var _0x444fc0={};var _0x59e396;var _0x22a834;return db[_0xe581('0x2d')][_0xe581('0x4d')]({'where':{'id':_0xfecf36[_0xe581('0x45')]['id']}})[_0xe581('0x24')](handleEntityNotFound(_0x5a80f0,null))[_0xe581('0x24')](function(_0x3ccf95){if(_0x3ccf95){_0x59e396=_0x3ccf95;_0x444fc0[_0xe581('0x30')]=_['keys'](db[_0xe581('0x4a')]['rawAttributes']);_0x444fc0[_0xe581('0x31')]=_[_0xe581('0x32')](_0xfecf36[_0xe581('0x31')]);_0x444fc0[_0xe581('0x33')]=_[_0xe581('0x34')](_0x444fc0[_0xe581('0x30')],_0x444fc0[_0xe581('0x31')]);_0x994ca[_0xe581('0x36')]=_['intersection'](_0x444fc0[_0xe581('0x30')],qs['fields'](_0xfecf36[_0xe581('0x31')][_0xe581('0x35')]));_0x994ca['attributes']=_0x994ca['attributes'][_0xe581('0x37')]?_0x994ca[_0xe581('0x36')]:_0x444fc0[_0xe581('0x30')];_0x994ca[_0xe581('0x3a')]=qs[_0xe581('0x3b')](_0xfecf36[_0xe581('0x31')][_0xe581('0x3b')]);_0x994ca[_0xe581('0x3c')]=qs[_0xe581('0x33')](_[_0xe581('0x4b')](_0xfecf36[_0xe581('0x31')],_0x444fc0[_0xe581('0x33')]));if(_0xfecf36['query'][_0xe581('0x3d')]){_0x994ca['where']=_['merge'](_0x994ca[_0xe581('0x3c')],{'$or':_[_0xe581('0x2c')](_0x994ca[_0xe581('0x36')],function(_0xbda27d){var _0x450c8b={};_0x450c8b[_0xbda27d]={'$like':'%'+_0xfecf36[_0xe581('0x31')][_0xe581('0x3d')]+'%'};return _0x450c8b;})});}_0x994ca=_['merge']({},_0x994ca,_0xfecf36[_0xe581('0x40')]);return _0x59e396[_0xe581('0x4c')](_0x994ca);}})[_0xe581('0x24')](function(_0x1ec050){if(_0x1ec050){_0x22a834=_0x1ec050[_0xe581('0x37')];if(!_0xfecf36[_0xe581('0x31')][_0xe581('0x38')](_0xe581('0x39'))){_0x994ca[_0xe581('0x1f')]=qs[_0xe581('0x1f')](_0xfecf36[_0xe581('0x31')][_0xe581('0x1f')]);_0x994ca[_0xe581('0x1c')]=qs[_0xe581('0x1c')](_0xfecf36[_0xe581('0x31')][_0xe581('0x1c')]);}return _0x59e396[_0xe581('0x4c')](_0x994ca);}})['then'](function(_0xc64087){if(_0xc64087){return _0xc64087?{'count':_0x22a834,'rows':_0xc64087}:null;}})[_0xe581('0x24')](respondWithResult(_0x5a80f0,null))['catch'](handleError(_0x5a80f0,null));};exports['getDescriptions']=function(_0x49237c,_0x385e29,_0x2aa54f){var _0x116536={};var _0x5bdb12={};var _0x348cc4;var _0x26c343;return db[_0xe581('0x2d')][_0xe581('0x4d')]({'where':{'id':_0x49237c[_0xe581('0x45')]['id']}})[_0xe581('0x24')](handleEntityNotFound(_0x385e29,null))['then'](function(_0x5c1aa7){if(_0x5c1aa7){_0x348cc4=_0x5c1aa7;_0x5bdb12[_0xe581('0x30')]=_[_0xe581('0x32')](db[_0xe581('0x4a')][_0xe581('0x2e')]);_0x5bdb12[_0xe581('0x31')]=_['keys'](_0x49237c[_0xe581('0x31')]);_0x5bdb12[_0xe581('0x33')]=_[_0xe581('0x34')](_0x5bdb12[_0xe581('0x30')],_0x5bdb12[_0xe581('0x31')]);_0x116536[_0xe581('0x36')]=_[_0xe581('0x34')](_0x5bdb12[_0xe581('0x30')],qs[_0xe581('0x35')](_0x49237c[_0xe581('0x31')][_0xe581('0x35')]));_0x116536[_0xe581('0x36')]=_0x116536['attributes'][_0xe581('0x37')]?_0x116536[_0xe581('0x36')]:_0x5bdb12[_0xe581('0x30')];_0x116536[_0xe581('0x3a')]=qs[_0xe581('0x3b')](_0x49237c[_0xe581('0x31')][_0xe581('0x3b')]);_0x116536[_0xe581('0x3c')]=qs[_0xe581('0x33')](_[_0xe581('0x4b')](_0x49237c['query'],_0x5bdb12[_0xe581('0x33')]));if(_0x49237c['query'][_0xe581('0x3d')]){_0x116536['where']=_[_0xe581('0x3e')](_0x116536[_0xe581('0x3c')],{'$or':_['map'](_0x116536[_0xe581('0x36')],function(_0x5e14e2){var _0x4361b5={};_0x4361b5[_0x5e14e2]={'$like':'%'+_0x49237c[_0xe581('0x31')][_0xe581('0x3d')]+'%'};return _0x4361b5;})});}_0x116536=_[_0xe581('0x3e')]({},_0x116536,_0x49237c['options']);return _0x348cc4[_0xe581('0x4e')](_0x116536);}})[_0xe581('0x24')](function(_0x3c943e){if(_0x3c943e){_0x26c343=_0x3c943e[_0xe581('0x37')];if(!_0x49237c['query'][_0xe581('0x38')]('nolimit')){_0x116536['limit']=qs[_0xe581('0x1f')](_0x49237c[_0xe581('0x31')]['limit']);_0x116536[_0xe581('0x1c')]=qs[_0xe581('0x1c')](_0x49237c[_0xe581('0x31')][_0xe581('0x1c')]);}return _0x348cc4[_0xe581('0x4e')](_0x116536);}})[_0xe581('0x24')](function(_0x46eb1a){if(_0x46eb1a){return _0x46eb1a?{'count':_0x26c343,'rows':_0x46eb1a}:null;}})[_0xe581('0x24')](respondWithResult(_0x385e29,null))[_0xe581('0x43')](handleError(_0x385e29,null));};exports['getTags']=function(_0x569474,_0x13dff3,_0x9c095){var _0x3f8b83={};var _0x5c4df1={};var _0x32bafd;var _0xc18c64;return db[_0xe581('0x2d')][_0xe581('0x4d')]({'where':{'id':_0x569474[_0xe581('0x45')]['id']}})[_0xe581('0x24')](handleEntityNotFound(_0x13dff3,null))[_0xe581('0x24')](function(_0x1cfa3e){if(_0x1cfa3e){_0x32bafd=_0x1cfa3e;_0x5c4df1['model']=_[_0xe581('0x32')](db[_0xe581('0x4f')][_0xe581('0x2e')]);_0x5c4df1[_0xe581('0x31')]=_[_0xe581('0x32')](_0x569474[_0xe581('0x31')]);_0x5c4df1[_0xe581('0x33')]=_[_0xe581('0x34')](_0x5c4df1['model'],_0x5c4df1['query']);_0x3f8b83[_0xe581('0x36')]=_[_0xe581('0x34')](_0x5c4df1[_0xe581('0x30')],qs['fields'](_0x569474[_0xe581('0x31')]['fields']));_0x3f8b83[_0xe581('0x36')]=_0x3f8b83[_0xe581('0x36')][_0xe581('0x37')]?_0x3f8b83['attributes']:_0x5c4df1['model'];_0x3f8b83[_0xe581('0x3a')]=qs[_0xe581('0x3b')](_0x569474[_0xe581('0x31')][_0xe581('0x3b')]);_0x3f8b83['where']=qs[_0xe581('0x33')](_['pick'](_0x569474[_0xe581('0x31')],_0x5c4df1['filters']));if(_0x569474['query'][_0xe581('0x3d')]){_0x3f8b83['where']=_['merge'](_0x3f8b83['where'],{'$or':_[_0xe581('0x2c')](_0x3f8b83[_0xe581('0x36')],function(_0x2fbf01){var _0x25bf9c={};_0x25bf9c[_0x2fbf01]={'$like':'%'+_0x569474['query'][_0xe581('0x3d')]+'%'};return _0x25bf9c;})});}_0x3f8b83=_['merge']({},_0x3f8b83,_0x569474[_0xe581('0x40')]);return _0x32bafd[_0xe581('0x50')](_0x3f8b83);}})[_0xe581('0x24')](function(_0x42e8c6){if(_0x42e8c6){_0xc18c64=_0x42e8c6[_0xe581('0x37')];if(!_0x569474[_0xe581('0x31')][_0xe581('0x38')]('nolimit')){_0x3f8b83[_0xe581('0x1f')]=qs[_0xe581('0x1f')](_0x569474[_0xe581('0x31')][_0xe581('0x1f')]);_0x3f8b83['offset']=qs['offset'](_0x569474[_0xe581('0x31')]['offset']);}return _0x32bafd[_0xe581('0x50')](_0x3f8b83);}})['then'](function(_0x48ba26){if(_0x48ba26){return _0x48ba26?{'count':_0xc18c64,'rows':_0x48ba26}:null;}})[_0xe581('0x24')](respondWithResult(_0x13dff3,null))[_0xe581('0x43')](handleError(_0x13dff3,null));};exports[_0xe581('0x51')]=function(_0x3426cd,_0x3979d5,_0x2aa97b){if(_0x3426cd[_0xe581('0x48')]['id']){delete _0x3426cd[_0xe581('0x48')]['id'];}return db[_0xe581('0x2d')]['findOne']({'where':{'id':_0x3426cd[_0xe581('0x45')]['id']}})['then'](handleEntityNotFound(_0x3979d5,null))['then'](function(_0x32ac3f){if(_0x32ac3f){return _0x32ac3f[_0xe581('0x51')](_0x3426cd[_0xe581('0x48')][_0xe581('0x52')]||[]);}return null;})[_0xe581('0x24')](respondWithResult(_0x3979d5,null))[_0xe581('0x43')](handleError(_0x3979d5,null));};
\ No newline at end of file
index 42f0166..86a497d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ad7=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FreshdeskConfiguration','lodash'];(function(_0x33f110,_0x4d76a1){var _0x43e027=function(_0x16e277){while(--_0x16e277){_0x33f110['push'](_0x33f110['shift']());}};_0x43e027(++_0x4d76a1);}(_0x5ad7,0x12b));var _0x75ad=function(_0x4ebf57,_0x229213){_0x4ebf57=_0x4ebf57-0x0;var _0x233b13=_0x5ad7[_0x4ebf57];return _0x233b13;};'use strict';var _=require(_0x75ad('0x0'));var util=require(_0x75ad('0x1'));var logger=require(_0x75ad('0x2'))(_0x75ad('0x3'));var moment=require(_0x75ad('0x4'));var BPromise=require(_0x75ad('0x5'));var rp=require(_0x75ad('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75ad('0x7'));var config=require(_0x75ad('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x75ad('0x9')]=function(_0x3267e3,_0x59507b){return _0x3267e3[_0x75ad('0xa')](_0x75ad('0xb'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe398=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0xe398,0x1ae));var _0x8e39=function(_0x4ca0b5,_0x3a5c1d){_0x4ca0b5=_0x4ca0b5-0x0;var _0x3b9d77=_0xe398[_0x4ca0b5];return _0x3b9d77;};'use strict';var _=require(_0x8e39('0x0'));var util=require(_0x8e39('0x1'));var logger=require(_0x8e39('0x2'))(_0x8e39('0x3'));var moment=require(_0x8e39('0x4'));var BPromise=require(_0x8e39('0x5'));var rp=require(_0x8e39('0x6'));var fs=require('fs');var path=require(_0x8e39('0x7'));var rimraf=require(_0x8e39('0x8'));var config=require(_0x8e39('0x9'));var attributes=require(_0x8e39('0xa'));module[_0x8e39('0xb')]=function(_0x534cfd,_0x227e46){return _0x534cfd[_0x8e39('0xc')]('FreshdeskConfiguration',attributes,{'tableName':_0x8e39('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c8edc84..2af33e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x815b=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x57e35e,_0x3c0b29){var _0x3577f8=function(_0x5c3b3d){while(--_0x5c3b3d){_0x57e35e['push'](_0x57e35e['shift']());}};_0x3577f8(++_0x3c0b29);}(_0x815b,0x1ce));var _0xb815=function(_0xf66bd5,_0x3ec83f){_0xf66bd5=_0xf66bd5-0x0;var _0x444831=_0x815b[_0xf66bd5];return _0x444831;};'use strict';var _=require('lodash');var util=require(_0xb815('0x0'));var moment=require(_0xb815('0x1'));var BPromise=require(_0xb815('0x2'));var rs=require(_0xb815('0x3'));var fs=require('fs');var Redis=require(_0xb815('0x4'));var db=require(_0xb815('0x5'))['db'];var utils=require(_0xb815('0x6'));var logger=require('../../config/logger')(_0xb815('0x7'));var config=require(_0xb815('0x8'));var jayson=require(_0xb815('0x9'));var client=jayson[_0xb815('0xa')][_0xb815('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30d98d,_0x20ffcb,_0x4de3db){return new BPromise(function(_0xf9a704,_0x3aae4e){return client[_0xb815('0xc')](_0x30d98d,_0x4de3db)[_0xb815('0xd')](function(_0x3d6fc0){logger[_0xb815('0xe')](_0xb815('0xf'),_0x20ffcb,_0xb815('0x10'));logger['debug'](_0xb815('0x11'),_0x20ffcb,_0xb815('0x10'),JSON['stringify'](_0x3d6fc0));if(_0x3d6fc0['error']){if(_0x3d6fc0[_0xb815('0x12')][_0xb815('0x13')]===0x1f4){logger['error'](_0xb815('0xf'),_0x20ffcb,_0x3d6fc0[_0xb815('0x12')][_0xb815('0x14')]);return _0x3aae4e(_0x3d6fc0['error']['message']);}logger[_0xb815('0x12')](_0xb815('0xf'),_0x20ffcb,_0x3d6fc0[_0xb815('0x12')][_0xb815('0x14')]);return _0xf9a704(_0x3d6fc0[_0xb815('0x12')][_0xb815('0x14')]);}else{logger[_0xb815('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x20ffcb,_0xb815('0x10'));_0xf9a704(_0x3d6fc0[_0xb815('0x15')][_0xb815('0x14')]);}})[_0xb815('0x16')](function(_0x59f661){logger['error'](_0xb815('0xf'),_0x20ffcb,_0x59f661);_0x3aae4e(_0x59f661);});});}
\ No newline at end of file
+var _0x5da3=['info','debug','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x34dd3c,_0x12616c){var _0x19beab=function(_0x327c96){while(--_0x327c96){_0x34dd3c['push'](_0x34dd3c['shift']());}};_0x19beab(++_0x12616c);}(_0x5da3,0x116));var _0x35da=function(_0x458b0,_0x15f01d){_0x458b0=_0x458b0-0x0;var _0x294e1f=_0x5da3[_0x458b0];return _0x294e1f;};'use strict';var _=require('lodash');var util=require(_0x35da('0x0'));var moment=require(_0x35da('0x1'));var BPromise=require(_0x35da('0x2'));var rs=require(_0x35da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35da('0x4'))['db'];var utils=require(_0x35da('0x5'));var logger=require('../../config/logger')(_0x35da('0x6'));var config=require(_0x35da('0x7'));var jayson=require(_0x35da('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34843e,_0x5285f1,_0x3f125b){return new BPromise(function(_0xc821f7,_0x4d2d1e){return client[_0x35da('0x9')](_0x34843e,_0x3f125b)['then'](function(_0x24a757){logger[_0x35da('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5285f1,'request\x20sent');logger[_0x35da('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5285f1,'request\x20sent',JSON['stringify'](_0x24a757));if(_0x24a757['error']){if(_0x24a757[_0x35da('0xc')][_0x35da('0xd')]===0x1f4){logger[_0x35da('0xc')](_0x35da('0xe'),_0x5285f1,_0x24a757[_0x35da('0xc')][_0x35da('0xf')]);return _0x4d2d1e(_0x24a757[_0x35da('0xc')]['message']);}logger[_0x35da('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5285f1,_0x24a757[_0x35da('0xc')][_0x35da('0xf')]);return _0xc821f7(_0x24a757[_0x35da('0xc')][_0x35da('0xf')]);}else{logger[_0x35da('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5285f1,_0x35da('0x10'));_0xc821f7(_0x24a757['result'][_0x35da('0xf')]);}})[_0x35da('0x11')](function(_0x27ad46){logger['error'](_0x35da('0xe'),_0x5285f1,_0x27ad46);_0x4d2d1e(_0x27ad46);});});}
\ No newline at end of file
index f0302ac..630ef2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43b8=['../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5316f4,_0x133dfc){var _0x1eb38b=function(_0x15c74f){while(--_0x15c74f){_0x5316f4['push'](_0x5316f4['shift']());}};_0x1eb38b(++_0x133dfc);}(_0x43b8,0x7b));var _0x843b=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x43b8[_0x2a390b];return _0x5df10a;};'use strict';var multer=require(_0x843b('0x0'));var util=require(_0x843b('0x1'));var path=require(_0x843b('0x2'));var timeout=require(_0x843b('0x3'));var express=require(_0x843b('0x4'));var router=express[_0x843b('0x5')]();var fs_extra=require(_0x843b('0x6'));var auth=require(_0x843b('0x7'));var interaction=require(_0x843b('0x8'));var config=require(_0x843b('0x9'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0x843b('0xa')](),controller[_0x843b('0xb')]);router[_0x843b('0xc')]('/:id',auth[_0x843b('0xa')](),controller[_0x843b('0xd')]);router[_0x843b('0xe')]('/',auth[_0x843b('0xa')](),controller[_0x843b('0xf')]);router[_0x843b('0x10')](_0x843b('0x11'),auth[_0x843b('0xa')](),controller[_0x843b('0x12')]);router[_0x843b('0x13')]('/:id',auth[_0x843b('0xa')](),controller[_0x843b('0x14')]);module[_0x843b('0x15')]=router;
\ No newline at end of file
+var _0x3083=['../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x3083,0x127));var _0x3308=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x3083[_0xce6f11];return _0x35b709;};'use strict';var multer=require('multer');var util=require(_0x3308('0x0'));var path=require(_0x3308('0x1'));var timeout=require('connect-timeout');var express=require(_0x3308('0x2'));var router=express[_0x3308('0x3')]();var fs_extra=require(_0x3308('0x4'));var auth=require(_0x3308('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3308('0x6'));var controller=require(_0x3308('0x7'));router[_0x3308('0x8')]('/',auth['isAuthenticated'](),controller[_0x3308('0x9')]);router['get'](_0x3308('0xa'),auth['isAuthenticated'](),controller[_0x3308('0xb')]);router[_0x3308('0xc')]('/',auth['isAuthenticated'](),controller[_0x3308('0xd')]);router[_0x3308('0xe')]('/:id',auth[_0x3308('0xf')](),controller[_0x3308('0x10')]);router[_0x3308('0x11')](_0x3308('0xa'),auth[_0x3308('0xf')](),controller[_0x3308('0x12')]);module[_0x3308('0x13')]=router;
\ No newline at end of file
index 8471709..5879322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16a8=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x3a8e53,_0x2cda8e){var _0x4c8689=function(_0x1e144e){while(--_0x1e144e){_0x3a8e53['push'](_0x3a8e53['shift']());}};_0x4c8689(++_0x2cda8e);}(_0x16a8,0xd1));var _0x816a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x16a8[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x816a('0x0'));module[_0x816a('0x1')]={'type':{'type':Sequelize[_0x816a('0x2')](_0x816a('0x3'),_0x816a('0x4'),_0x816a('0x5'),'keyValue',_0x816a('0x6')),'defaultValue':_0x816a('0x3')},'content':{'type':Sequelize[_0x816a('0x7')]},'key':{'type':Sequelize[_0x816a('0x7')]},'keyType':{'type':Sequelize[_0x816a('0x2')]('string','variable',_0x816a('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x816a('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x816a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x816a('0x7')]}};
\ No newline at end of file
+var _0x8bc2=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','picklist','STRING'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x8bc2,0x134));var _0x28bc=function(_0x28923f,_0x1c4dd0){_0x28923f=_0x28923f-0x0;var _0x495ca1=_0x8bc2[_0x28923f];return _0x495ca1;};'use strict';var Sequelize=require(_0x28bc('0x0'));module[_0x28bc('0x1')]={'type':{'type':Sequelize[_0x28bc('0x2')](_0x28bc('0x3'),'variable',_0x28bc('0x4'),'keyValue',_0x28bc('0x5')),'defaultValue':_0x28bc('0x3')},'content':{'type':Sequelize[_0x28bc('0x6')]},'key':{'type':Sequelize[_0x28bc('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x28bc('0x7'),_0x28bc('0x4'))},'keyContent':{'type':Sequelize[_0x28bc('0x6')]},'idField':{'type':Sequelize[_0x28bc('0x6')]},'nameField':{'type':Sequelize[_0x28bc('0x6')]},'customField':{'type':Sequelize[_0x28bc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 7a8e25f..9552de6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['../../config/license/util','status','end','offset','undefined','count','set','json','destroy','then','sendStatus','error','stack','name','send','map','FreshdeskField','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','catch','create','body','update','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment'];(function(_0x2a6e16,_0x798415){var _0xe9a662=function(_0x4a0da7){while(--_0x4a0da7){_0x2a6e16['push'](_0x2a6e16['shift']());}};_0xe9a662(++_0x798415);}(_0x750a,0x140));var _0xa750=function(_0x4cabae,_0x15a573){_0x4cabae=_0x4cabae-0x0;var _0x151763=_0x750a[_0x4cabae];return _0x151763;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ec62,_0x1c5657){_0x1c5657=_0x1c5657||0xcc;return function(_0x344c67){if(_0x344c67){return _0x24ec62['sendStatus'](_0x1c5657);}return _0x24ec62[_0xa750('0x15')](_0x1c5657)[_0xa750('0x16')]();};}function respondWithResult(_0x2d3421,_0x24e48a){_0x24e48a=_0x24e48a||0xc8;return function(_0xa66181){if(_0xa66181){return _0x2d3421[_0xa750('0x15')](_0x24e48a)['json'](_0xa66181);}};}function respondWithFilteredResult(_0x3ae2a1,_0x8488ea){return function(_0x290d46){if(_0x290d46){var _0x49fe3b=typeof _0x8488ea[_0xa750('0x17')]===_0xa750('0x18')&&typeof _0x8488ea['limit']==='undefined';var _0x321eb2=_0x290d46['count'];var _0x433dbd=_0x49fe3b?0x0:_0x8488ea[_0xa750('0x17')];var _0x4f1faa=_0x49fe3b?_0x290d46[_0xa750('0x19')]:_0x8488ea['offset']+_0x8488ea['limit'];var _0x25e335;if(_0x4f1faa>=_0x321eb2){_0x4f1faa=_0x321eb2;_0x25e335=0xc8;}else{_0x25e335=0xce;}_0x3ae2a1['status'](_0x25e335);return _0x3ae2a1[_0xa750('0x1a')]('Content-Range',_0x433dbd+'-'+_0x4f1faa+'/'+_0x321eb2)[_0xa750('0x1b')](_0x290d46);}return null;};}function patchUpdates(_0x4a007d){return function(_0x3dc7f1){try{jsonpatch['apply'](_0x3dc7f1,_0x4a007d,!![]);}catch(_0x1efb68){return BPromise['reject'](_0x1efb68);}return _0x3dc7f1['save']();};}function saveUpdates(_0xaa9d3e,_0x52da84){return function(_0x216fbf){if(_0x216fbf){return _0x216fbf['update'](_0xaa9d3e)['then'](function(_0x5b433d){return _0x5b433d;});}return null;};}function removeEntity(_0x5d758e,_0x15d72f){return function(_0x2ec6c4){if(_0x2ec6c4){return _0x2ec6c4[_0xa750('0x1c')]()[_0xa750('0x1d')](function(){_0x5d758e[_0xa750('0x15')](0xcc)[_0xa750('0x16')]();});}};}function handleEntityNotFound(_0x3001bc,_0x7e22ad){return function(_0x3d52b3){if(!_0x3d52b3){_0x3001bc[_0xa750('0x1e')](0x194);}return _0x3d52b3;};}function handleError(_0xe92342,_0x27a5eb){_0x27a5eb=_0x27a5eb||0x1f4;return function(_0x31ea63){logger[_0xa750('0x1f')](_0x31ea63[_0xa750('0x20')]);if(_0x31ea63['name']){delete _0x31ea63[_0xa750('0x21')];}_0xe92342[_0xa750('0x15')](_0x27a5eb)[_0xa750('0x22')](_0x31ea63);};}exports['index']=function(_0x35ab53,_0x6ade2b){var _0x3270e3={},_0x1223d2={},_0x579f1c={'count':0x0,'rows':[]};var _0x297eef=_[_0xa750('0x23')](db[_0xa750('0x24')][_0xa750('0x25')],function(_0x2c5253){return{'name':_0x2c5253['fieldName'],'type':_0x2c5253[_0xa750('0x26')]['key']};});_0x1223d2[_0xa750('0x27')]=_[_0xa750('0x23')](_0x297eef,'name');_0x1223d2[_0xa750('0x28')]=_[_0xa750('0x29')](_0x35ab53[_0xa750('0x28')]);_0x1223d2[_0xa750('0x2a')]=_[_0xa750('0x2b')](_0x1223d2[_0xa750('0x27')],_0x1223d2[_0xa750('0x28')]);_0x3270e3[_0xa750('0x2c')]=_['intersection'](_0x1223d2[_0xa750('0x27')],qs['fields'](_0x35ab53[_0xa750('0x28')][_0xa750('0x2d')]));_0x3270e3[_0xa750('0x2c')]=_0x3270e3[_0xa750('0x2c')]['length']?_0x3270e3[_0xa750('0x2c')]:_0x1223d2[_0xa750('0x27')];if(!_0x35ab53['query'][_0xa750('0x2e')](_0xa750('0x2f'))){_0x3270e3[_0xa750('0x30')]=qs[_0xa750('0x30')](_0x35ab53['query'][_0xa750('0x30')]);_0x3270e3['offset']=qs['offset'](_0x35ab53[_0xa750('0x28')][_0xa750('0x17')]);}_0x3270e3[_0xa750('0x31')]=qs['sort'](_0x35ab53[_0xa750('0x28')][_0xa750('0x32')]);_0x3270e3[_0xa750('0x33')]=qs['filters'](_[_0xa750('0x34')](_0x35ab53[_0xa750('0x28')],_0x1223d2[_0xa750('0x2a')]),_0x297eef);if(_0x35ab53['query'][_0xa750('0x35')]){_0x3270e3[_0xa750('0x33')]=_[_0xa750('0x36')](_0x3270e3['where'],{'$or':_[_0xa750('0x23')](_0x297eef,function(_0x339f10){if(_0x339f10[_0xa750('0x26')]!==_0xa750('0x37')){var _0x4dd8d5={};_0x4dd8d5[_0x339f10['name']]={'$like':'%'+_0x35ab53[_0xa750('0x28')][_0xa750('0x35')]+'%'};return _0x4dd8d5;}})});}_0x3270e3=_['merge']({},_0x3270e3,_0x35ab53[_0xa750('0x38')]);var _0x2f57e9={'where':_0x3270e3[_0xa750('0x33')]};return db[_0xa750('0x24')][_0xa750('0x19')](_0x2f57e9)['then'](function(_0x6c99c4){_0x579f1c[_0xa750('0x19')]=_0x6c99c4;if(_0x35ab53[_0xa750('0x28')][_0xa750('0x39')]){_0x3270e3[_0xa750('0x3a')]=[{'all':!![]}];}return db[_0xa750('0x24')][_0xa750('0x3b')](_0x3270e3);})['then'](function(_0x3daa38){_0x579f1c['rows']=_0x3daa38;return _0x579f1c;})[_0xa750('0x1d')](respondWithFilteredResult(_0x6ade2b,_0x3270e3))['catch'](handleError(_0x6ade2b,null));};exports[_0xa750('0x3c')]=function(_0x376afb,_0xf9fd5f){var _0x1be24e={'raw':!![],'where':{'id':_0x376afb[_0xa750('0x3d')]['id']}},_0x430d60={};_0x430d60[_0xa750('0x27')]=_[_0xa750('0x29')](db[_0xa750('0x24')][_0xa750('0x25')]);_0x430d60[_0xa750('0x28')]=_[_0xa750('0x29')](_0x376afb[_0xa750('0x28')]);_0x430d60[_0xa750('0x2a')]=_[_0xa750('0x2b')](_0x430d60[_0xa750('0x27')],_0x430d60[_0xa750('0x28')]);_0x1be24e[_0xa750('0x2c')]=_[_0xa750('0x2b')](_0x430d60[_0xa750('0x27')],qs['fields'](_0x376afb[_0xa750('0x28')][_0xa750('0x2d')]));_0x1be24e[_0xa750('0x2c')]=_0x1be24e[_0xa750('0x2c')][_0xa750('0x3e')]?_0x1be24e[_0xa750('0x2c')]:_0x430d60[_0xa750('0x27')];if(_0x376afb[_0xa750('0x28')][_0xa750('0x39')]){_0x1be24e['include']=[{'all':!![]}];}_0x1be24e=_[_0xa750('0x36')]({},_0x1be24e,_0x376afb[_0xa750('0x38')]);return db['FreshdeskField'][_0xa750('0x3f')](_0x1be24e)[_0xa750('0x1d')](handleEntityNotFound(_0xf9fd5f,null))[_0xa750('0x1d')](respondWithResult(_0xf9fd5f,null))[_0xa750('0x40')](handleError(_0xf9fd5f,null));};exports[_0xa750('0x41')]=function(_0x2c2c9a,_0x5e7a95){return db[_0xa750('0x24')][_0xa750('0x41')](_0x2c2c9a[_0xa750('0x42')],{})['then'](respondWithResult(_0x5e7a95,0xc9))[_0xa750('0x40')](handleError(_0x5e7a95,null));};exports[_0xa750('0x43')]=function(_0x58afd2,_0x93e49f){if(_0x58afd2[_0xa750('0x42')]['id']){delete _0x58afd2[_0xa750('0x42')]['id'];}return db['FreshdeskField'][_0xa750('0x3f')]({'where':{'id':_0x58afd2[_0xa750('0x3d')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x93e49f,null))[_0xa750('0x1d')](saveUpdates(_0x58afd2['body'],null))[_0xa750('0x1d')](respondWithResult(_0x93e49f,null))[_0xa750('0x40')](handleError(_0x93e49f,null));};exports[_0xa750('0x1c')]=function(_0xed4f88,_0x4ce363){return db[_0xa750('0x24')][_0xa750('0x3f')]({'where':{'id':_0xed4f88['params']['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x4ce363,null))['then'](removeEntity(_0x4ce363,null))[_0xa750('0x40')](handleError(_0x4ce363,null));};
\ No newline at end of file
+var _0x1339=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','end','sendStatus','error','name','send','index','map','FreshdeskField','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','update','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x1339,0x1ed));var _0x9133=function(_0x41f277,_0x851c9b){_0x41f277=_0x41f277-0x0;var _0x30c40f=_0x1339[_0x41f277];return _0x30c40f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x22')]();});}};}function handleEntityNotFound(_0x3f278d,_0x14c1cb){return function(_0x4483ef){if(!_0x4483ef){_0x3f278d[_0x9133('0x23')](0x194);}return _0x4483ef;};}function handleError(_0x294332,_0x313d43){_0x313d43=_0x313d43||0x1f4;return function(_0x1b6b3e){logger[_0x9133('0x24')](_0x1b6b3e['stack']);if(_0x1b6b3e['name']){delete _0x1b6b3e[_0x9133('0x25')];}_0x294332[_0x9133('0x1a')](_0x313d43)[_0x9133('0x26')](_0x1b6b3e);};}exports[_0x9133('0x27')]=function(_0x4de894,_0x4ecd9e){var _0x3e2404={},_0x45966d={},_0x188c49={'count':0x0,'rows':[]};var _0x26d351=_[_0x9133('0x28')](db[_0x9133('0x29')]['rawAttributes'],function(_0x58afe0){return{'name':_0x58afe0['fieldName'],'type':_0x58afe0[_0x9133('0x2a')]['key']};});_0x45966d[_0x9133('0x2b')]=_[_0x9133('0x28')](_0x26d351,'name');_0x45966d[_0x9133('0x2c')]=_['keys'](_0x4de894[_0x9133('0x2c')]);_0x45966d[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x45966d['model'],_0x45966d[_0x9133('0x2c')]);_0x3e2404[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x45966d['model'],qs[_0x9133('0x30')](_0x4de894[_0x9133('0x2c')][_0x9133('0x30')]));_0x3e2404['attributes']=_0x3e2404[_0x9133('0x2f')][_0x9133('0x31')]?_0x3e2404[_0x9133('0x2f')]:_0x45966d[_0x9133('0x2b')];if(!_0x4de894['query'][_0x9133('0x32')](_0x9133('0x33'))){_0x3e2404['limit']=qs[_0x9133('0x1d')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1d')]);_0x3e2404[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1e')]);}_0x3e2404[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4de894[_0x9133('0x2c')][_0x9133('0x35')]);_0x3e2404['where']=qs[_0x9133('0x2d')](_[_0x9133('0x36')](_0x4de894['query'],_0x45966d[_0x9133('0x2d')]),_0x26d351);if(_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]){_0x3e2404[_0x9133('0x38')]=_[_0x9133('0x39')](_0x3e2404[_0x9133('0x38')],{'$or':_['map'](_0x26d351,function(_0x4e16d2){if(_0x4e16d2[_0x9133('0x2a')]!==_0x9133('0x3a')){var _0x156905={};_0x156905[_0x4e16d2[_0x9133('0x25')]]={'$like':'%'+_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]+'%'};return _0x156905;}})});}_0x3e2404=_[_0x9133('0x39')]({},_0x3e2404,_0x4de894[_0x9133('0x3b')]);var _0x720048={'where':_0x3e2404['where']};return db[_0x9133('0x29')][_0x9133('0x3c')](_0x720048)[_0x9133('0x20')](function(_0x199ae9){_0x188c49[_0x9133('0x3c')]=_0x199ae9;if(_0x4de894['query'][_0x9133('0x3d')]){_0x3e2404[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x29')][_0x9133('0x3f')](_0x3e2404);})['then'](function(_0x146734){_0x188c49[_0x9133('0x40')]=_0x146734;return _0x188c49;})[_0x9133('0x20')](respondWithFilteredResult(_0x4ecd9e,_0x3e2404))[_0x9133('0x41')](handleError(_0x4ecd9e,null));};exports[_0x9133('0x42')]=function(_0x338049,_0x3b2287){var _0x4ca1a3={'raw':!![],'where':{'id':_0x338049['params']['id']}},_0x7f6cd9={};_0x7f6cd9['model']=_[_0x9133('0x43')](db[_0x9133('0x29')][_0x9133('0x44')]);_0x7f6cd9[_0x9133('0x2c')]=_[_0x9133('0x43')](_0x338049[_0x9133('0x2c')]);_0x7f6cd9[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],_0x7f6cd9['query']);_0x4ca1a3[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],qs['fields'](_0x338049['query'][_0x9133('0x30')]));_0x4ca1a3[_0x9133('0x2f')]=_0x4ca1a3['attributes'][_0x9133('0x31')]?_0x4ca1a3[_0x9133('0x2f')]:_0x7f6cd9[_0x9133('0x2b')];if(_0x338049[_0x9133('0x2c')][_0x9133('0x3d')]){_0x4ca1a3['include']=[{'all':!![]}];}_0x4ca1a3=_[_0x9133('0x39')]({},_0x4ca1a3,_0x338049[_0x9133('0x3b')]);return db[_0x9133('0x29')]['find'](_0x4ca1a3)[_0x9133('0x20')](handleEntityNotFound(_0x3b2287,null))[_0x9133('0x20')](respondWithResult(_0x3b2287,null))['catch'](handleError(_0x3b2287,null));};exports['create']=function(_0x42c188,_0x2cd935){return db[_0x9133('0x29')][_0x9133('0x45')](_0x42c188[_0x9133('0x46')],{})[_0x9133('0x20')](respondWithResult(_0x2cd935,0xc9))[_0x9133('0x41')](handleError(_0x2cd935,null));};exports[_0x9133('0x47')]=function(_0x23f134,_0xf07fbb){if(_0x23f134[_0x9133('0x46')]['id']){delete _0x23f134[_0x9133('0x46')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x23f134[_0x9133('0x48')]['id']}})['then'](handleEntityNotFound(_0xf07fbb,null))[_0x9133('0x20')](saveUpdates(_0x23f134[_0x9133('0x46')],null))[_0x9133('0x20')](respondWithResult(_0xf07fbb,null))[_0x9133('0x41')](handleError(_0xf07fbb,null));};exports['destroy']=function(_0x2a3848,_0x25750f){return db[_0x9133('0x29')]['find']({'where':{'id':_0x2a3848[_0x9133('0x48')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x25750f,null))[_0x9133('0x20')](removeEntity(_0x25750f,null))['catch'](handleError(_0x25750f,null));};
\ No newline at end of file
index 7aa3f6c..2f5c292 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bde=['./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2a2a03,_0x3578cf){var _0x3e71bf=function(_0x4139a1){while(--_0x4139a1){_0x2a2a03['push'](_0x2a2a03['shift']());}};_0x3e71bf(++_0x3578cf);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe0bd('0x0'));var logger=require('../../config/logger')(_0xe0bd('0x1'));var moment=require(_0xe0bd('0x2'));var BPromise=require(_0xe0bd('0x3'));var rp=require(_0xe0bd('0x4'));var fs=require('fs');var path=require(_0xe0bd('0x5'));var rimraf=require('rimraf');var config=require(_0xe0bd('0x6'));var attributes=require(_0xe0bd('0x7'));module[_0xe0bd('0x8')]=function(_0x3b712a,_0x22bfd1){return _0x3b712a[_0xe0bd('0x9')](_0xe0bd('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xe0bd('0xb'),'fields':[_0xe0bd('0xc'),_0xe0bd('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c39=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','FreshdeskField','freshdesk_unique_index','idField','lodash'];(function(_0x294f38,_0x4452f9){var _0x223bef=function(_0xe615fb){while(--_0xe615fb){_0x294f38['push'](_0x294f38['shift']());}};_0x223bef(++_0x4452f9);}(_0x8c39,0x1df));var _0x98c3=function(_0x429d5d,_0x4a8a1f){_0x429d5d=_0x429d5d-0x0;var _0x4bcced=_0x8c39[_0x429d5d];return _0x4bcced;};'use strict';var _=require(_0x98c3('0x0'));var util=require('util');var logger=require(_0x98c3('0x1'))(_0x98c3('0x2'));var moment=require(_0x98c3('0x3'));var BPromise=require(_0x98c3('0x4'));var rp=require(_0x98c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x98c3('0x6'));var config=require(_0x98c3('0x7'));var attributes=require(_0x98c3('0x8'));module['exports']=function(_0x1bee5c,_0xfc9011){return _0x1bee5c['define'](_0x98c3('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x98c3('0xa'),'fields':[_0x98c3('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7128e42..d3ac430 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd815=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd815,0x1a3));var _0x5d81=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd815[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5d81('0x0'));var util=require(_0x5d81('0x1'));var moment=require(_0x5d81('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d81('0x3'));var fs=require('fs');var Redis=require(_0x5d81('0x4'));var db=require(_0x5d81('0x5'))['db'];var utils=require(_0x5d81('0x6'));var logger=require('../../config/logger')(_0x5d81('0x7'));var config=require('../../config/environment');var jayson=require(_0x5d81('0x8'));var client=jayson[_0x5d81('0x9')][_0x5d81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d34f4,_0x2d7f8b,_0x44a6b7){return new BPromise(function(_0x5a0a46,_0x228410){return client['request'](_0x1d34f4,_0x44a6b7)[_0x5d81('0xb')](function(_0x45044d){logger[_0x5d81('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x2d7f8b,_0x5d81('0xd'));logger['debug'](_0x5d81('0xe'),_0x2d7f8b,_0x5d81('0xd'),JSON[_0x5d81('0xf')](_0x45044d));if(_0x45044d['error']){if(_0x45044d[_0x5d81('0x10')][_0x5d81('0x11')]===0x1f4){logger[_0x5d81('0x10')](_0x5d81('0x12'),_0x2d7f8b,_0x45044d[_0x5d81('0x10')][_0x5d81('0x13')]);return _0x228410(_0x45044d[_0x5d81('0x10')][_0x5d81('0x13')]);}logger[_0x5d81('0x10')](_0x5d81('0x12'),_0x2d7f8b,_0x45044d[_0x5d81('0x10')][_0x5d81('0x13')]);return _0x5a0a46(_0x45044d['error'][_0x5d81('0x13')]);}else{logger[_0x5d81('0xc')](_0x5d81('0x12'),_0x2d7f8b,'request\x20sent');_0x5a0a46(_0x45044d[_0x5d81('0x14')]['message']);}})[_0x5d81('0x15')](function(_0x411675){logger['error'](_0x5d81('0x12'),_0x2d7f8b,_0x411675);_0x228410(_0x411675);});});}
\ No newline at end of file
+var _0xb950=['then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x2d9a23,_0x481dc4){var _0x5198ee=function(_0x27d373){while(--_0x27d373){_0x2d9a23['push'](_0x2d9a23['shift']());}};_0x5198ee(++_0x481dc4);}(_0xb950,0x165));var _0x0b95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb950[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0b95('0x0'));var util=require('util');var moment=require(_0x0b95('0x1'));var BPromise=require(_0x0b95('0x2'));var rs=require(_0x0b95('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b95('0x4'))['db'];var utils=require(_0x0b95('0x5'));var logger=require(_0x0b95('0x6'))('rpc');var config=require(_0x0b95('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0b95('0x8')][_0x0b95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19a91a,_0x3275a8,_0x24646b){return new BPromise(function(_0x5e4371,_0x2bf46c){return client[_0x0b95('0xa')](_0x19a91a,_0x24646b)[_0x0b95('0xb')](function(_0x17dbb9){logger[_0x0b95('0xc')](_0x0b95('0xd'),_0x3275a8,'request\x20sent');logger[_0x0b95('0xe')](_0x0b95('0xf'),_0x3275a8,_0x0b95('0x10'),JSON[_0x0b95('0x11')](_0x17dbb9));if(_0x17dbb9['error']){if(_0x17dbb9['error'][_0x0b95('0x12')]===0x1f4){logger[_0x0b95('0x13')](_0x0b95('0xd'),_0x3275a8,_0x17dbb9[_0x0b95('0x13')][_0x0b95('0x14')]);return _0x2bf46c(_0x17dbb9[_0x0b95('0x13')][_0x0b95('0x14')]);}logger[_0x0b95('0x13')](_0x0b95('0xd'),_0x3275a8,_0x17dbb9[_0x0b95('0x13')][_0x0b95('0x14')]);return _0x5e4371(_0x17dbb9['error'][_0x0b95('0x14')]);}else{logger[_0x0b95('0xc')](_0x0b95('0xd'),_0x3275a8,_0x0b95('0x10'));_0x5e4371(_0x17dbb9[_0x0b95('0x15')][_0x0b95('0x14')]);}})[_0x0b95('0x16')](function(_0x42364d){logger[_0x0b95('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x3275a8,_0x42364d);_0x2bf46c(_0x42364d);});});}
\ No newline at end of file
index 4ffe11b..0229f16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['index','/:id','show','/:id/configurations','getConfigurations','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x5320b3,_0x52c2a8){var _0x4e16e4=function(_0x1fb093){while(--_0x1fb093){_0x5320b3['push'](_0x5320b3['shift']());}};_0x4e16e4(++_0x52c2a8);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xe5b5[_0x4b2863];return _0x567d67;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/fields',auth[_0x5e5b('0xc')](),controller['getFields']);router[_0x5e5b('0x12')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router[_0x5e5b('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x5e5b('0x14')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x15')]);router[_0x5e5b('0x16')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller['destroy']);module[_0x5e5b('0x17')]=router;
\ No newline at end of file
+var _0xe1e3=['get','isAuthenticated','index','/:id','show','/:id/configurations','post','create','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x440f8b,_0x143979){_0x440f8b=_0x440f8b-0x0;var _0x3502b6=_0xe1e3[_0x440f8b];return _0x3502b6;};'use strict';var multer=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var path=require('path');var timeout=require(_0x3e1e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3e1e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var controller=require(_0x3e1e('0x6'));router[_0x3e1e('0x7')]('/',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x9')]);router['get'](_0x3e1e('0xa'),auth[_0x3e1e('0x8')](),controller[_0x3e1e('0xb')]);router[_0x3e1e('0x7')](_0x3e1e('0xc'),auth[_0x3e1e('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x3e1e('0x8')](),controller['getFields']);router[_0x3e1e('0xd')]('/',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0xe')]);router['post'](_0x3e1e('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3e1e('0xf')]);router['delete']('/:id',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x10')]);module[_0x3e1e('0x11')]=router;
\ No newline at end of file
index 4e2ce51..8a6fb94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d4=['exports','STRING','username'];(function(_0x1f62e4,_0x24435f){var _0x50014b=function(_0x1b4685){while(--_0x1b4685){_0x1f62e4['push'](_0x1f62e4['shift']());}};_0x50014b(++_0x24435f);}(_0x77d4,0x108));var _0x477d=function(_0x316bcd,_0x560e96){_0x316bcd=_0x316bcd-0x0;var _0x2dce07=_0x77d4[_0x316bcd];return _0x2dce07;};'use strict';var Sequelize=require('sequelize');module[_0x477d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x477d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x477d('0x2')},'apiKey':{'type':Sequelize[_0x477d('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x477d('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x583c=['exports','STRING','username','sequelize'];(function(_0xdc1723,_0x4aed6b){var _0x39da46=function(_0x597001){while(--_0x597001){_0xdc1723['push'](_0xdc1723['shift']());}};_0x39da46(++_0x4aed6b);}(_0x583c,0x12b));var _0xc583=function(_0x189c9e,_0x1c3b55){_0x189c9e=_0x189c9e-0x0;var _0x3f38ca=_0x583c[_0x189c9e];return _0x3f38ca;};'use strict';var Sequelize=require(_0xc583('0x0'));module[_0xc583('0x1')]={'name':{'type':Sequelize[_0xc583('0x2')]},'description':{'type':Sequelize[_0xc583('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc583('0x3')},'apiKey':{'type':Sequelize[_0xc583('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xc583('0x2')],'allowNull':![]}};
\ No newline at end of file
index bb97057..e0e3927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06c4=['send','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','reject','save','update','destroy','then','error','name','index','FreshsalesAccount','type','map','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','remoteUri','apiKey','username','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2c3ab1,_0x241bdd){var _0x45c603=function(_0x3ae903){while(--_0x3ae903){_0x2c3ab1['push'](_0x2c3ab1['shift']());}};_0x45c603(++_0x241bdd);}(_0x06c4,0xca));var _0x406c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06c4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x406c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x406c('0x1'));var jsonpatch=require(_0x406c('0x2'));var rp=require(_0x406c('0x3'));var moment=require('moment');var BPromise=require(_0x406c('0x4'));var Mustache=require('mustache');var util=require(_0x406c('0x5'));var path=require(_0x406c('0x6'));var sox=require(_0x406c('0x7'));var csv=require(_0x406c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x406c('0x9'));var crypto=require(_0x406c('0xa'));var jsforce=require(_0x406c('0xb'));var deskjs=require(_0x406c('0xc'));var toCsv=require(_0x406c('0x8'));var querystring=require(_0x406c('0xd'));var Papa=require(_0x406c('0xe'));var Redis=require(_0x406c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x406c('0x10'));var as=require(_0x406c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x406c('0x12'))(_0x406c('0x13'));var utils=require(_0x406c('0x14'));var config=require(_0x406c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x406c('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2bb211,_0x39b7e5){_0x39b7e5=_0x39b7e5||0xcc;return function(_0x42d8d7){if(_0x42d8d7){return _0x2bb211[_0x406c('0x17')](_0x39b7e5);}return _0x2bb211['status'](_0x39b7e5)[_0x406c('0x18')]();};}function respondWithResult(_0x3369df,_0xb349b3){_0xb349b3=_0xb349b3||0xc8;return function(_0x2f86b5){if(_0x2f86b5){return _0x3369df[_0x406c('0x19')](_0xb349b3)[_0x406c('0x1a')](_0x2f86b5);}};}function respondWithFilteredResult(_0x455955,_0x4b0d96){return function(_0x2324ce){if(_0x2324ce){var _0x1ff97d=typeof _0x4b0d96['offset']==='undefined'&&typeof _0x4b0d96['limit']===_0x406c('0x1b');var _0x16ee2a=_0x2324ce[_0x406c('0x1c')];var _0x5de6f3=_0x1ff97d?0x0:_0x4b0d96[_0x406c('0x1d')];var _0x2083d3=_0x1ff97d?_0x2324ce[_0x406c('0x1c')]:_0x4b0d96[_0x406c('0x1d')]+_0x4b0d96[_0x406c('0x1e')];var _0x3f4330;if(_0x2083d3>=_0x16ee2a){_0x2083d3=_0x16ee2a;_0x3f4330=0xc8;}else{_0x3f4330=0xce;}_0x455955[_0x406c('0x19')](_0x3f4330);return _0x455955['set'](_0x406c('0x1f'),_0x5de6f3+'-'+_0x2083d3+'/'+_0x16ee2a)[_0x406c('0x1a')](_0x2324ce);}return null;};}function patchUpdates(_0x3bd7f6){return function(_0x24e919){try{jsonpatch['apply'](_0x24e919,_0x3bd7f6,!![]);}catch(_0x1c92ee){return BPromise[_0x406c('0x20')](_0x1c92ee);}return _0x24e919[_0x406c('0x21')]();};}function saveUpdates(_0x44be96,_0x24e488){return function(_0x1ab231){if(_0x1ab231){return _0x1ab231[_0x406c('0x22')](_0x44be96)['then'](function(_0x177824){return _0x177824;});}return null;};}function removeEntity(_0x1b785f,_0x1598d4){return function(_0x577bf6){if(_0x577bf6){return _0x577bf6[_0x406c('0x23')]()[_0x406c('0x24')](function(){_0x1b785f['status'](0xcc)[_0x406c('0x18')]();});}};}function handleEntityNotFound(_0x59399c,_0x97a62a){return function(_0x439172){if(!_0x439172){_0x59399c[_0x406c('0x17')](0x194);}return _0x439172;};}function handleError(_0x1a43fd,_0x46bd43){_0x46bd43=_0x46bd43||0x1f4;return function(_0x4b3b90){logger[_0x406c('0x25')](_0x4b3b90['stack']);if(_0x4b3b90['name']){delete _0x4b3b90[_0x406c('0x26')];}_0x1a43fd[_0x406c('0x19')](_0x46bd43)['send'](_0x4b3b90);};}exports[_0x406c('0x27')]=function(_0x4b41bc,_0x583e8a){var _0x30963a={},_0x10c475={},_0x3240b2={'count':0x0,'rows':[]};var _0x248ff3=_['map'](db[_0x406c('0x28')]['rawAttributes'],function(_0x39720c){return{'name':_0x39720c['fieldName'],'type':_0x39720c[_0x406c('0x29')]['key']};});_0x10c475['model']=_[_0x406c('0x2a')](_0x248ff3,_0x406c('0x26'));_0x10c475[_0x406c('0x2b')]=_['keys'](_0x4b41bc[_0x406c('0x2b')]);_0x10c475[_0x406c('0x2c')]=_['intersection'](_0x10c475[_0x406c('0x2d')],_0x10c475[_0x406c('0x2b')]);_0x30963a[_0x406c('0x2e')]=_[_0x406c('0x2f')](_0x10c475[_0x406c('0x2d')],qs[_0x406c('0x30')](_0x4b41bc[_0x406c('0x2b')][_0x406c('0x30')]));_0x30963a['attributes']=_0x30963a['attributes'][_0x406c('0x31')]?_0x30963a[_0x406c('0x2e')]:_0x10c475['model'];if(!_0x4b41bc['query']['hasOwnProperty'](_0x406c('0x32'))){_0x30963a[_0x406c('0x1e')]=qs['limit'](_0x4b41bc[_0x406c('0x2b')][_0x406c('0x1e')]);_0x30963a[_0x406c('0x1d')]=qs[_0x406c('0x1d')](_0x4b41bc[_0x406c('0x2b')]['offset']);}_0x30963a[_0x406c('0x33')]=qs[_0x406c('0x34')](_0x4b41bc['query']['sort']);_0x30963a[_0x406c('0x35')]=qs[_0x406c('0x2c')](_[_0x406c('0x36')](_0x4b41bc['query'],_0x10c475[_0x406c('0x2c')]),_0x248ff3);if(_0x4b41bc[_0x406c('0x2b')]['filter']){_0x30963a[_0x406c('0x35')]=_[_0x406c('0x37')](_0x30963a[_0x406c('0x35')],{'$or':_[_0x406c('0x2a')](_0x248ff3,function(_0x10412e){if(_0x10412e[_0x406c('0x29')]!=='VIRTUAL'){var _0x48d63d={};_0x48d63d[_0x10412e['name']]={'$like':'%'+_0x4b41bc[_0x406c('0x2b')][_0x406c('0x38')]+'%'};return _0x48d63d;}})});}_0x30963a=_['merge']({},_0x30963a,_0x4b41bc['options']);var _0x6c6a5d={'where':_0x30963a[_0x406c('0x35')]};return db['FreshsalesAccount'][_0x406c('0x1c')](_0x6c6a5d)['then'](function(_0x6c2fac){_0x3240b2[_0x406c('0x1c')]=_0x6c2fac;if(_0x4b41bc['query'][_0x406c('0x39')]){_0x30963a[_0x406c('0x3a')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x406c('0x3b')](_0x30963a);})[_0x406c('0x24')](function(_0x5e6114){_0x3240b2[_0x406c('0x3c')]=_0x5e6114;return _0x3240b2;})[_0x406c('0x24')](respondWithFilteredResult(_0x583e8a,_0x30963a))[_0x406c('0x3d')](handleError(_0x583e8a,null));};exports['show']=function(_0xb5c9e2,_0x4c9199){var _0x42cf10={'raw':![],'where':{'id':_0xb5c9e2[_0x406c('0x3e')]['id']}},_0x40fe59={};_0x40fe59['model']=_[_0x406c('0x3f')](db[_0x406c('0x28')][_0x406c('0x40')]);_0x40fe59[_0x406c('0x2b')]=_[_0x406c('0x3f')](_0xb5c9e2[_0x406c('0x2b')]);_0x40fe59[_0x406c('0x2c')]=_[_0x406c('0x2f')](_0x40fe59[_0x406c('0x2d')],_0x40fe59[_0x406c('0x2b')]);_0x42cf10['attributes']=_['intersection'](_0x40fe59[_0x406c('0x2d')],qs[_0x406c('0x30')](_0xb5c9e2[_0x406c('0x2b')][_0x406c('0x30')]));_0x42cf10[_0x406c('0x2e')]=_0x42cf10[_0x406c('0x2e')][_0x406c('0x31')]?_0x42cf10['attributes']:_0x40fe59[_0x406c('0x2d')];if(_0xb5c9e2[_0x406c('0x2b')][_0x406c('0x39')]){_0x42cf10['include']=[{'all':!![]}];}_0x42cf10=_[_0x406c('0x37')]({},_0x42cf10,_0xb5c9e2['options']);return db[_0x406c('0x28')]['find'](_0x42cf10)[_0x406c('0x24')](handleEntityNotFound(_0x4c9199,null))['then'](respondWithResult(_0x4c9199,null))[_0x406c('0x3d')](handleError(_0x4c9199,null));};exports[_0x406c('0x41')]=function(_0x26b78b,_0x491497){return db['FreshsalesAccount']['create'](_0x26b78b[_0x406c('0x42')],{})['then'](respondWithResult(_0x491497,0xc9))['catch'](handleError(_0x491497,null));};exports[_0x406c('0x22')]=function(_0x3881eb,_0x330536){if(_0x3881eb[_0x406c('0x42')]['id']){delete _0x3881eb[_0x406c('0x42')]['id'];}return db['FreshsalesAccount'][_0x406c('0x43')]({'where':{'id':_0x3881eb[_0x406c('0x3e')]['id']}})[_0x406c('0x24')](handleEntityNotFound(_0x330536,null))[_0x406c('0x24')](saveUpdates(_0x3881eb[_0x406c('0x42')],null))[_0x406c('0x24')](respondWithResult(_0x330536,null))[_0x406c('0x3d')](handleError(_0x330536,null));};exports[_0x406c('0x23')]=function(_0x4b13a0,_0x354d7d){return db[_0x406c('0x28')][_0x406c('0x43')]({'where':{'id':_0x4b13a0['params']['id']}})[_0x406c('0x24')](handleEntityNotFound(_0x354d7d,null))[_0x406c('0x24')](removeEntity(_0x354d7d,null))[_0x406c('0x3d')](handleError(_0x354d7d,null));};exports[_0x406c('0x44')]=function(_0x2ae962,_0x248762,_0x59dcec){var _0x556ab0={};var _0x4e2304={};var _0x556f9e;var _0xfcac99;return db[_0x406c('0x28')][_0x406c('0x45')]({'where':{'id':_0x2ae962[_0x406c('0x3e')]['id']}})[_0x406c('0x24')](handleEntityNotFound(_0x248762,null))['then'](function(_0x5d0a86){if(_0x5d0a86){_0x556f9e=_0x5d0a86;_0x4e2304[_0x406c('0x2d')]=_[_0x406c('0x3f')](db[_0x406c('0x46')][_0x406c('0x40')]);_0x4e2304[_0x406c('0x2b')]=_[_0x406c('0x3f')](_0x2ae962['query']);_0x4e2304[_0x406c('0x2c')]=_[_0x406c('0x2f')](_0x4e2304[_0x406c('0x2d')],_0x4e2304['query']);_0x556ab0[_0x406c('0x2e')]=_['intersection'](_0x4e2304['model'],qs[_0x406c('0x30')](_0x2ae962['query'][_0x406c('0x30')]));_0x556ab0[_0x406c('0x2e')]=_0x556ab0[_0x406c('0x2e')][_0x406c('0x31')]?_0x556ab0[_0x406c('0x2e')]:_0x4e2304['model'];_0x556ab0['order']=qs[_0x406c('0x34')](_0x2ae962[_0x406c('0x2b')][_0x406c('0x34')]);_0x556ab0['where']=qs['filters'](_['pick'](_0x2ae962['query'],_0x4e2304['filters']));if(_0x2ae962[_0x406c('0x2b')][_0x406c('0x38')]){_0x556ab0[_0x406c('0x35')]=_[_0x406c('0x37')](_0x556ab0[_0x406c('0x35')],{'$or':_[_0x406c('0x2a')](_0x556ab0[_0x406c('0x2e')],function(_0x5f15a7){var _0x27ba8c={};_0x27ba8c[_0x5f15a7]={'$like':'%'+_0x2ae962['query'][_0x406c('0x38')]+'%'};return _0x27ba8c;})});}_0x556ab0=_[_0x406c('0x37')]({},_0x556ab0,_0x2ae962[_0x406c('0x47')]);return _0x556f9e[_0x406c('0x44')](_0x556ab0);}})[_0x406c('0x24')](function(_0x563a8d){if(_0x563a8d){_0xfcac99=_0x563a8d[_0x406c('0x31')];if(!_0x2ae962[_0x406c('0x2b')]['hasOwnProperty'](_0x406c('0x32'))){_0x556ab0['limit']=qs['limit'](_0x2ae962['query'][_0x406c('0x1e')]);_0x556ab0[_0x406c('0x1d')]=qs[_0x406c('0x1d')](_0x2ae962['query'][_0x406c('0x1d')]);}return _0x556f9e[_0x406c('0x44')](_0x556ab0);}})[_0x406c('0x24')](function(_0x382d16){if(_0x382d16){return _0x382d16?{'count':_0xfcac99,'rows':_0x382d16}:null;}})[_0x406c('0x24')](respondWithResult(_0x248762,null))[_0x406c('0x3d')](handleError(_0x248762,null));};exports[_0x406c('0x48')]=function(_0x267f00,_0x1d4250,_0x3dc132){if(_0x267f00[_0x406c('0x42')]['id']){delete _0x267f00[_0x406c('0x42')]['id'];}return db['FreshsalesAccount'][_0x406c('0x45')]({'where':{'id':_0x267f00[_0x406c('0x3e')]['id']}})[_0x406c('0x24')](handleEntityNotFound(_0x1d4250,null))[_0x406c('0x24')](function(_0x7884b0){if(_0x7884b0){_0x267f00[_0x406c('0x42')][_0x406c('0x49')]=_0x7884b0['id'];_0x267f00[_0x406c('0x42')][_0x406c('0x4a')]=integrations[_0x406c('0x4b')](_0x267f00[_0x406c('0x42')][_0x406c('0x4c')],_0x267f00[_0x406c('0x42')][_0x406c('0x29')]);_0x267f00[_0x406c('0x42')][_0x406c('0x4d')]=integrations[_0x406c('0x4e')](_0x267f00['body'][_0x406c('0x4c')],_0x267f00[_0x406c('0x42')][_0x406c('0x29')]);return db[_0x406c('0x46')]['create'](_0x267f00[_0x406c('0x42')],{'include':[{'model':db[_0x406c('0x4f')],'as':_0x406c('0x4a')},{'model':db['FreshsalesField'],'as':_0x406c('0x4d')}]});}return null;})[_0x406c('0x24')](respondWithResult(_0x1d4250,null))['catch'](handleError(_0x1d4250,null));};exports[_0x406c('0x50')]=function(_0xaa6682,_0x1adc6d,_0x19524c){var _0x641dc7='';var _0x48fc6e='';return db['FreshsalesAccount'][_0x406c('0x45')]({'where':{'id':_0xaa6682[_0x406c('0x3e')]['id']},'attributes':['id','username',_0x406c('0x51'),_0x406c('0x52')]})[_0x406c('0x24')](handleEntityNotFound(_0x1adc6d,null))[_0x406c('0x24')](function(_0x96bd92){if(_0x96bd92){_0x48fc6e=_0x96bd92[_0x406c('0x53')];_0x641dc7=_0x96bd92[_0x406c('0x51')];var _0x4f0fa9=_0x96bd92[_0x406c('0x51')]['slice'](-0x1);if(_0x4f0fa9==='/'){_0x641dc7=_0x641dc7[_0x406c('0x54')](0x0,_0x641dc7[_0x406c('0x55')](_0x4f0fa9));}return rp({'method':_0x406c('0x56'),'uri':util[_0x406c('0x57')](_0x406c('0x58'),_0x641dc7,'/api/selector/owners'),'headers':{'Authorization':_0x406c('0x59')+_0x96bd92[_0x406c('0x52')]},'json':!![]});}})[_0x406c('0x24')](function(_0x12ee71){if(_0x12ee71){var _0x3d1c03=_0x12ee71[_0x406c('0x5a')];var _0x53a478=![];var _0x15da5c=null;for(_0x15da5c=0x0;_0x15da5c<_0x3d1c03['length'];_0x15da5c++){if(_0x3d1c03[_0x15da5c][_0x406c('0x5b')]===_0x48fc6e){_0x53a478=!![];}}if(_0x53a478){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x406c('0x5c')});}}})['then'](respondWithResult(_0x1adc6d,null))[_0x406c('0x3d')](function(_0x5f201f){var _0xbcac1d=_0xaa6682[_0x406c('0x2b')]['test']?0x1f4:_0x5f201f['statusCode']||0x1f4;logger[_0x406c('0x25')](_0x406c('0x5d'),'getFields',_0xbcac1d,JSON[_0x406c('0x5e')](_0x5f201f));delete _0x5f201f[_0x406c('0x26')];if(_0xbcac1d===0x191){_0xbcac1d=0x190;}_0x1adc6d[_0x406c('0x19')](_0xbcac1d)[_0x406c('0x5f')](_0xaa6682[_0x406c('0x2b')][_0x406c('0x60')]?{'message':_0x406c('0x61'),'statusCode':_0x5f201f[_0x406c('0x62')]}:_0x5f201f);});};
\ No newline at end of file
+var _0x1193=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','FreshsalesAccount','then','includeAll','findAll','rows','catch','options','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','length','addConfiguration','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','username','remoteUri','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x1193,0xc0));var _0x3119=function(_0x1eefa5,_0x35fdd3){_0x1eefa5=_0x1eefa5-0x0;var _0x53e478=_0x1193[_0x1eefa5];return _0x53e478;};'use strict';var emlformat=require(_0x3119('0x0'));var rimraf=require(_0x3119('0x1'));var zipdir=require(_0x3119('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3119('0x3'));var moment=require('moment');var BPromise=require(_0x3119('0x4'));var Mustache=require(_0x3119('0x5'));var util=require(_0x3119('0x6'));var path=require(_0x3119('0x7'));var sox=require(_0x3119('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3119('0x9'));var _=require(_0x3119('0xa'));var squel=require(_0x3119('0xb'));var crypto=require(_0x3119('0xc'));var jsforce=require(_0x3119('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3119('0xe'));var querystring=require(_0x3119('0xf'));var Papa=require('papaparse');var Redis=require(_0x3119('0x10'));var authService=require(_0x3119('0x11'));var qs=require(_0x3119('0x12'));var as=require(_0x3119('0x13'));var hardwareService=require(_0x3119('0x14'));var logger=require(_0x3119('0x15'))(_0x3119('0x16'));var utils=require(_0x3119('0x17'));var config=require(_0x3119('0x18'));var licenseUtil=require(_0x3119('0x19'));var db=require(_0x3119('0x1a'))['db'];var integrations=require(_0x3119('0x1b'));function respondWithStatusCode(_0x31a867,_0x50806a){_0x50806a=_0x50806a||0xcc;return function(_0x166250){if(_0x166250){return _0x31a867[_0x3119('0x1c')](_0x50806a);}return _0x31a867[_0x3119('0x1d')](_0x50806a)['end']();};}function respondWithResult(_0x54965b,_0x5eb6b3){_0x5eb6b3=_0x5eb6b3||0xc8;return function(_0x51cbbf){if(_0x51cbbf){return _0x54965b[_0x3119('0x1d')](_0x5eb6b3)[_0x3119('0x1e')](_0x51cbbf);}};}function respondWithFilteredResult(_0x5d0037,_0x4f13cd){return function(_0x414977){if(_0x414977){var _0x40be25=typeof _0x4f13cd[_0x3119('0x1f')]===_0x3119('0x20')&&typeof _0x4f13cd[_0x3119('0x21')]===_0x3119('0x20');var _0x46efe8=_0x414977[_0x3119('0x22')];var _0x2766e5=_0x40be25?0x0:_0x4f13cd[_0x3119('0x1f')];var _0x4b0a8e=_0x40be25?_0x414977['count']:_0x4f13cd['offset']+_0x4f13cd[_0x3119('0x21')];var _0x4f26cf;if(_0x4b0a8e>=_0x46efe8){_0x4b0a8e=_0x46efe8;_0x4f26cf=0xc8;}else{_0x4f26cf=0xce;}_0x5d0037[_0x3119('0x1d')](_0x4f26cf);return _0x5d0037[_0x3119('0x23')](_0x3119('0x24'),_0x2766e5+'-'+_0x4b0a8e+'/'+_0x46efe8)['json'](_0x414977);}return null;};}function patchUpdates(_0x4ca943){return function(_0x397ee3){try{jsonpatch[_0x3119('0x25')](_0x397ee3,_0x4ca943,!![]);}catch(_0x47e831){return BPromise[_0x3119('0x26')](_0x47e831);}return _0x397ee3[_0x3119('0x27')]();};}function saveUpdates(_0x28255c,_0x5d574f){return function(_0xd95b84){if(_0xd95b84){return _0xd95b84[_0x3119('0x28')](_0x28255c)['then'](function(_0x515d34){return _0x515d34;});}return null;};}function removeEntity(_0x352505,_0x1adfc8){return function(_0x4fc6dd){if(_0x4fc6dd){return _0x4fc6dd[_0x3119('0x29')]()['then'](function(){_0x352505[_0x3119('0x1d')](0xcc)[_0x3119('0x2a')]();});}};}function handleEntityNotFound(_0x108e00,_0x502b3e){return function(_0x5dcb48){if(!_0x5dcb48){_0x108e00['sendStatus'](0x194);}return _0x5dcb48;};}function handleError(_0x5e1c14,_0xcba87c){_0xcba87c=_0xcba87c||0x1f4;return function(_0x3aa80e){logger[_0x3119('0x2b')](_0x3aa80e[_0x3119('0x2c')]);if(_0x3aa80e[_0x3119('0x2d')]){delete _0x3aa80e[_0x3119('0x2d')];}_0x5e1c14[_0x3119('0x1d')](_0xcba87c)[_0x3119('0x2e')](_0x3aa80e);};}exports[_0x3119('0x2f')]=function(_0x1feda0,_0x329870){var _0x49ad53={},_0x388f21={},_0x48ecb6={'count':0x0,'rows':[]};var _0xc88d82=_[_0x3119('0x30')](db['FreshsalesAccount'][_0x3119('0x31')],function(_0x1ddcd6){return{'name':_0x1ddcd6[_0x3119('0x32')],'type':_0x1ddcd6[_0x3119('0x33')][_0x3119('0x34')]};});_0x388f21['model']=_[_0x3119('0x30')](_0xc88d82,_0x3119('0x2d'));_0x388f21[_0x3119('0x35')]=_[_0x3119('0x36')](_0x1feda0[_0x3119('0x35')]);_0x388f21[_0x3119('0x37')]=_['intersection'](_0x388f21[_0x3119('0x38')],_0x388f21['query']);_0x49ad53['attributes']=_[_0x3119('0x39')](_0x388f21[_0x3119('0x38')],qs[_0x3119('0x3a')](_0x1feda0[_0x3119('0x35')][_0x3119('0x3a')]));_0x49ad53['attributes']=_0x49ad53[_0x3119('0x3b')]['length']?_0x49ad53[_0x3119('0x3b')]:_0x388f21['model'];if(!_0x1feda0[_0x3119('0x35')][_0x3119('0x3c')]('nolimit')){_0x49ad53[_0x3119('0x21')]=qs['limit'](_0x1feda0[_0x3119('0x35')][_0x3119('0x21')]);_0x49ad53['offset']=qs[_0x3119('0x1f')](_0x1feda0[_0x3119('0x35')][_0x3119('0x1f')]);}_0x49ad53[_0x3119('0x3d')]=qs['sort'](_0x1feda0[_0x3119('0x35')][_0x3119('0x3e')]);_0x49ad53['where']=qs[_0x3119('0x37')](_[_0x3119('0x3f')](_0x1feda0['query'],_0x388f21['filters']),_0xc88d82);if(_0x1feda0['query']['filter']){_0x49ad53[_0x3119('0x40')]=_[_0x3119('0x41')](_0x49ad53[_0x3119('0x40')],{'$or':_[_0x3119('0x30')](_0xc88d82,function(_0x64cb5b){if(_0x64cb5b['type']!==_0x3119('0x42')){var _0x32a86c={};_0x32a86c[_0x64cb5b['name']]={'$like':'%'+_0x1feda0[_0x3119('0x35')][_0x3119('0x43')]+'%'};return _0x32a86c;}})});}_0x49ad53=_[_0x3119('0x41')]({},_0x49ad53,_0x1feda0['options']);var _0x2c126c={'where':_0x49ad53[_0x3119('0x40')]};return db[_0x3119('0x44')][_0x3119('0x22')](_0x2c126c)[_0x3119('0x45')](function(_0x3b6271){_0x48ecb6[_0x3119('0x22')]=_0x3b6271;if(_0x1feda0[_0x3119('0x35')][_0x3119('0x46')]){_0x49ad53['include']=[{'all':!![]}];}return db[_0x3119('0x44')][_0x3119('0x47')](_0x49ad53);})[_0x3119('0x45')](function(_0x130426){_0x48ecb6[_0x3119('0x48')]=_0x130426;return _0x48ecb6;})[_0x3119('0x45')](respondWithFilteredResult(_0x329870,_0x49ad53))[_0x3119('0x49')](handleError(_0x329870,null));};exports['show']=function(_0x527ad9,_0x31d012){var _0x4ee556={'raw':![],'where':{'id':_0x527ad9['params']['id']}},_0x23513a={};_0x23513a[_0x3119('0x38')]=_['keys'](db[_0x3119('0x44')][_0x3119('0x31')]);_0x23513a[_0x3119('0x35')]=_[_0x3119('0x36')](_0x527ad9[_0x3119('0x35')]);_0x23513a[_0x3119('0x37')]=_[_0x3119('0x39')](_0x23513a['model'],_0x23513a['query']);_0x4ee556[_0x3119('0x3b')]=_[_0x3119('0x39')](_0x23513a[_0x3119('0x38')],qs[_0x3119('0x3a')](_0x527ad9[_0x3119('0x35')][_0x3119('0x3a')]));_0x4ee556[_0x3119('0x3b')]=_0x4ee556[_0x3119('0x3b')]['length']?_0x4ee556[_0x3119('0x3b')]:_0x23513a[_0x3119('0x38')];if(_0x527ad9['query'][_0x3119('0x46')]){_0x4ee556['include']=[{'all':!![]}];}_0x4ee556=_[_0x3119('0x41')]({},_0x4ee556,_0x527ad9[_0x3119('0x4a')]);return db[_0x3119('0x44')][_0x3119('0x4b')](_0x4ee556)['then'](handleEntityNotFound(_0x31d012,null))['then'](respondWithResult(_0x31d012,null))[_0x3119('0x49')](handleError(_0x31d012,null));};exports[_0x3119('0x4c')]=function(_0x42a01c,_0x13ec9e){return db[_0x3119('0x44')]['create'](_0x42a01c[_0x3119('0x4d')],{})[_0x3119('0x45')](respondWithResult(_0x13ec9e,0xc9))[_0x3119('0x49')](handleError(_0x13ec9e,null));};exports['update']=function(_0x10ee79,_0x3f85b1){if(_0x10ee79['body']['id']){delete _0x10ee79[_0x3119('0x4d')]['id'];}return db[_0x3119('0x44')][_0x3119('0x4b')]({'where':{'id':_0x10ee79[_0x3119('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3f85b1,null))[_0x3119('0x45')](saveUpdates(_0x10ee79[_0x3119('0x4d')],null))[_0x3119('0x45')](respondWithResult(_0x3f85b1,null))[_0x3119('0x49')](handleError(_0x3f85b1,null));};exports[_0x3119('0x29')]=function(_0x8c2b1f,_0x5cb9ea){return db[_0x3119('0x44')][_0x3119('0x4b')]({'where':{'id':_0x8c2b1f[_0x3119('0x4e')]['id']}})[_0x3119('0x45')](handleEntityNotFound(_0x5cb9ea,null))[_0x3119('0x45')](removeEntity(_0x5cb9ea,null))[_0x3119('0x49')](handleError(_0x5cb9ea,null));};exports[_0x3119('0x4f')]=function(_0x2624a0,_0x2a0737,_0x25a897){var _0x3a7f31={};var _0x40ed51={};var _0x20de7f;var _0x4541fd;return db[_0x3119('0x44')][_0x3119('0x50')]({'where':{'id':_0x2624a0[_0x3119('0x4e')]['id']}})[_0x3119('0x45')](handleEntityNotFound(_0x2a0737,null))[_0x3119('0x45')](function(_0x5b0660){if(_0x5b0660){_0x20de7f=_0x5b0660;_0x40ed51[_0x3119('0x38')]=_['keys'](db[_0x3119('0x51')][_0x3119('0x31')]);_0x40ed51['query']=_[_0x3119('0x36')](_0x2624a0[_0x3119('0x35')]);_0x40ed51['filters']=_[_0x3119('0x39')](_0x40ed51[_0x3119('0x38')],_0x40ed51['query']);_0x3a7f31[_0x3119('0x3b')]=_['intersection'](_0x40ed51[_0x3119('0x38')],qs[_0x3119('0x3a')](_0x2624a0[_0x3119('0x35')]['fields']));_0x3a7f31[_0x3119('0x3b')]=_0x3a7f31['attributes'][_0x3119('0x52')]?_0x3a7f31[_0x3119('0x3b')]:_0x40ed51['model'];_0x3a7f31[_0x3119('0x3d')]=qs[_0x3119('0x3e')](_0x2624a0['query'][_0x3119('0x3e')]);_0x3a7f31['where']=qs['filters'](_[_0x3119('0x3f')](_0x2624a0[_0x3119('0x35')],_0x40ed51[_0x3119('0x37')]));if(_0x2624a0[_0x3119('0x35')]['filter']){_0x3a7f31[_0x3119('0x40')]=_['merge'](_0x3a7f31[_0x3119('0x40')],{'$or':_[_0x3119('0x30')](_0x3a7f31['attributes'],function(_0x3a5b23){var _0x53b4a4={};_0x53b4a4[_0x3a5b23]={'$like':'%'+_0x2624a0[_0x3119('0x35')][_0x3119('0x43')]+'%'};return _0x53b4a4;})});}_0x3a7f31=_['merge']({},_0x3a7f31,_0x2624a0['options']);return _0x20de7f['getConfigurations'](_0x3a7f31);}})[_0x3119('0x45')](function(_0x20c6ab){if(_0x20c6ab){_0x4541fd=_0x20c6ab[_0x3119('0x52')];if(!_0x2624a0['query']['hasOwnProperty']('nolimit')){_0x3a7f31['limit']=qs[_0x3119('0x21')](_0x2624a0[_0x3119('0x35')][_0x3119('0x21')]);_0x3a7f31['offset']=qs['offset'](_0x2624a0[_0x3119('0x35')][_0x3119('0x1f')]);}return _0x20de7f['getConfigurations'](_0x3a7f31);}})[_0x3119('0x45')](function(_0x501334){if(_0x501334){return _0x501334?{'count':_0x4541fd,'rows':_0x501334}:null;}})[_0x3119('0x45')](respondWithResult(_0x2a0737,null))['catch'](handleError(_0x2a0737,null));};exports[_0x3119('0x53')]=function(_0x2ac855,_0x4e5db8,_0x2c0fa7){if(_0x2ac855[_0x3119('0x4d')]['id']){delete _0x2ac855[_0x3119('0x4d')]['id'];}return db[_0x3119('0x44')][_0x3119('0x50')]({'where':{'id':_0x2ac855['params']['id']}})['then'](handleEntityNotFound(_0x4e5db8,null))[_0x3119('0x45')](function(_0x40cb25){if(_0x40cb25){_0x2ac855[_0x3119('0x4d')]['AccountId']=_0x40cb25['id'];_0x2ac855[_0x3119('0x4d')][_0x3119('0x54')]=integrations['getSubjects'](_0x2ac855[_0x3119('0x4d')][_0x3119('0x55')],_0x2ac855[_0x3119('0x4d')][_0x3119('0x33')]);_0x2ac855[_0x3119('0x4d')]['Descriptions']=integrations[_0x3119('0x56')](_0x2ac855[_0x3119('0x4d')][_0x3119('0x55')],_0x2ac855[_0x3119('0x4d')][_0x3119('0x33')]);return db['FreshsalesConfiguration']['create'](_0x2ac855[_0x3119('0x4d')],{'include':[{'model':db[_0x3119('0x57')],'as':_0x3119('0x54')},{'model':db['FreshsalesField'],'as':_0x3119('0x58')}]});}return null;})[_0x3119('0x45')](respondWithResult(_0x4e5db8,null))[_0x3119('0x49')](handleError(_0x4e5db8,null));};exports['getFields']=function(_0x70e551,_0x51a55f,_0x1737bb){var _0x4773cc='';var _0x166897='';return db[_0x3119('0x44')][_0x3119('0x50')]({'where':{'id':_0x70e551[_0x3119('0x4e')]['id']},'attributes':['id',_0x3119('0x59'),_0x3119('0x5a'),'apiKey']})[_0x3119('0x45')](handleEntityNotFound(_0x51a55f,null))[_0x3119('0x45')](function(_0x476d1b){if(_0x476d1b){_0x166897=_0x476d1b[_0x3119('0x59')];_0x4773cc=_0x476d1b[_0x3119('0x5a')];var _0x458bd2=_0x476d1b[_0x3119('0x5a')]['slice'](-0x1);if(_0x458bd2==='/'){_0x4773cc=_0x4773cc[_0x3119('0x5b')](0x0,_0x4773cc[_0x3119('0x5c')](_0x458bd2));}return rp({'method':_0x3119('0x5d'),'uri':util[_0x3119('0x5e')](_0x3119('0x5f'),_0x4773cc,_0x3119('0x60')),'headers':{'Authorization':_0x3119('0x61')+_0x476d1b[_0x3119('0x62')]},'json':!![]});}})[_0x3119('0x45')](function(_0x4e25bb){if(_0x4e25bb){var _0x34727a=_0x4e25bb[_0x3119('0x63')];var _0x56c893=![];var _0x1487bb=null;for(_0x1487bb=0x0;_0x1487bb<_0x34727a[_0x3119('0x52')];_0x1487bb++){if(_0x34727a[_0x1487bb][_0x3119('0x64')]===_0x166897){_0x56c893=!![];}}if(_0x56c893){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3119('0x65')});}}})[_0x3119('0x45')](respondWithResult(_0x51a55f,null))[_0x3119('0x49')](function(_0x2e68c1){var _0x3097db=_0x70e551[_0x3119('0x35')]['test']?0x1f4:_0x2e68c1[_0x3119('0x66')]||0x1f4;logger[_0x3119('0x2b')](_0x3119('0x67'),_0x3119('0x68'),_0x3097db,JSON[_0x3119('0x69')](_0x2e68c1));delete _0x2e68c1[_0x3119('0x2d')];if(_0x3097db===0x191){_0x3097db=0x190;}_0x51a55f[_0x3119('0x1d')](_0x3097db)[_0x3119('0x2e')](_0x70e551[_0x3119('0x35')][_0x3119('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x2e68c1[_0x3119('0x66')]}:_0x2e68c1);});};
\ No newline at end of file
index 83fedf7..041bbc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4745=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x59d279,_0x467add){var _0x5ea222=function(_0x3d69a3){while(--_0x3d69a3){_0x59d279['push'](_0x59d279['shift']());}};_0x5ea222(++_0x467add);}(_0x4745,0x1e7));var _0x5474=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x4745[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));var integrations=require(_0x5474('0xb'));module['exports']=function(_0x3d1e1,_0x431f81){return _0x3d1e1['define'](_0x5474('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a85=['moment','path','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshsalesAccount','../../config/logger','api'];(function(_0x169dd5,_0x353e02){var _0x1fb73c=function(_0x33751a){while(--_0x33751a){_0x169dd5['push'](_0x169dd5['shift']());}};_0x1fb73c(++_0x353e02);}(_0x1a85,0x178));var _0x51a8=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0x1a85[_0x4d934b];return _0xc0338b;};'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('./intFreshsalesAccount.attributes');var integrations=require(_0x51a8('0x6'));module['exports']=function(_0x2c1180,_0x5cf430){return _0x2c1180[_0x51a8('0x7')](_0x51a8('0x8'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7e7d44a..9487b8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c3c=['find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','debug','catch','ShowFreshsalesAccount'];(function(_0x8398a9,_0x510eef){var _0x175a1e=function(_0x187466){while(--_0x187466){_0x8398a9['push'](_0x8398a9['shift']());}};_0x175a1e(++_0x510eef);}(_0x5c3c,0x132));var _0xc5c3=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x5c3c[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')]({'raw':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1b')]||null:null,'attributes':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')]['attributes']||null:null,'limit':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1c')]||null:null,'include':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x2ff158['options']['include'],function(_0x45affe){return{'model':db[_0x45affe[_0xc5c3('0x1f')]],'as':_0x45affe['as'],'attributes':_0x45affe['attributes'],'include':_0x45affe['include']?_[_0xc5c3('0x1e')](_0x45affe[_0xc5c3('0x1d')],function(_0x38a3df){return{'model':db[_0x38a3df['model']],'as':_0x38a3df['as'],'attributes':_0x38a3df['attributes'],'include':_0x38a3df[_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x38a3df[_0xc5c3('0x1d')],function(_0x29791c){return{'model':db[_0x29791c['model']],'as':_0x29791c['as'],'attributes':_0x29791c[_0xc5c3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2eacec){logger['info'](_0xc5c3('0x17'),_0x2ff158);logger[_0xc5c3('0x21')](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x2eacec));_0x28bae6(_0x2eacec);})[_0xc5c3('0x22')](function(_0x2d07e1){logger[_0xc5c3('0x12')]('GetFreshsalesAccount',_0x2d07e1[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x2d07e1[_0xc5c3('0x14')]));});});};exports[_0xc5c3('0x23')]=function(_0x5b26e9){var _0x4daa8b=this;return new Promise(function(_0x2e648f,_0x46f149){return db[_0xc5c3('0x18')][_0xc5c3('0x24')]({'raw':_0x5b26e9['options']?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x25')]===undefined?!![]:![]:!![],'where':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x1b')]||null:null,'attributes':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x20')]||null:null,'include':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9['options'][_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x1d')],function(_0x330391){return{'model':db[_0x330391[_0xc5c3('0x1f')]],'as':_0x330391['as'],'attributes':_0x330391[_0xc5c3('0x20')],'include':_0x330391['include']?_['map'](_0x330391[_0xc5c3('0x1d')],function(_0x55fccf){return{'model':db[_0x55fccf[_0xc5c3('0x1f')]],'as':_0x55fccf['as'],'attributes':_0x55fccf[_0xc5c3('0x20')],'include':_0x55fccf[_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x55fccf[_0xc5c3('0x1d')],function(_0x498677){return{'model':db[_0x498677[_0xc5c3('0x1f')]],'as':_0x498677['as'],'attributes':_0x498677[_0xc5c3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29f57d){logger[_0xc5c3('0x15')](_0xc5c3('0x23'),_0x5b26e9);logger[_0xc5c3('0x21')](_0xc5c3('0x23'),_0x5b26e9,JSON[_0xc5c3('0x11')](_0x29f57d));_0x2e648f(_0x29f57d);})[_0xc5c3('0x22')](function(_0x2ad440){logger[_0xc5c3('0x12')](_0xc5c3('0x23'),_0x2ad440['message'],_0x5b26e9);_0x46f149(_0x4daa8b[_0xc5c3('0x12')](0x1f4,_0x2ad440['message']));});});};
\ No newline at end of file
+var _0x4bd3=['where','attributes','limit','include','model','map','stringify','find','ShowFreshsalesAccount','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x4bd3,0x174));var _0x34bd=function(_0x3952e7,_0x583213){_0x3952e7=_0x3952e7-0x0;var _0x103081=_0x4bd3[_0x3952e7];return _0x103081;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('FreshsalesAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});}exports[_0x34bd('0x13')]=function(_0x3b4bf8){var _0x72b197=this;return new Promise(function(_0x4b5ebb,_0x48d2ba){return db[_0x34bd('0x14')][_0x34bd('0x15')]({'raw':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options'][_0x34bd('0x19')]||null:null,'limit':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x1a')]||null:null,'include':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options']['include']?_['map'](_0x3b4bf8['options'][_0x34bd('0x1b')],function(_0x503a60){return{'model':db[_0x503a60[_0x34bd('0x1c')]],'as':_0x503a60['as'],'attributes':_0x503a60[_0x34bd('0x19')],'include':_0x503a60[_0x34bd('0x1b')]?_['map'](_0x503a60[_0x34bd('0x1b')],function(_0x14479a){return{'model':db[_0x14479a[_0x34bd('0x1c')]],'as':_0x14479a['as'],'attributes':_0x14479a[_0x34bd('0x19')],'include':_0x14479a['include']?_[_0x34bd('0x1d')](_0x14479a[_0x34bd('0x1b')],function(_0x264c94){return{'model':db[_0x264c94[_0x34bd('0x1c')]],'as':_0x264c94['as'],'attributes':_0x264c94['attributes']};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x3fe8b0){logger['info'](_0x34bd('0x13'),_0x3b4bf8);logger[_0x34bd('0xc')](_0x34bd('0x13'),_0x3b4bf8,JSON[_0x34bd('0x1e')](_0x3fe8b0));_0x4b5ebb(_0x3fe8b0);})[_0x34bd('0x12')](function(_0x4500c8){logger[_0x34bd('0xe')]('GetFreshsalesAccount',_0x4500c8[_0x34bd('0x10')],_0x3b4bf8);_0x48d2ba(_0x72b197[_0x34bd('0xe')](0x1f4,_0x4500c8['message']));});});};exports['ShowFreshsalesAccount']=function(_0x38bdba){var _0xca9897=this;return new Promise(function(_0xd176f7,_0x536b2c){return db['FreshsalesAccount'][_0x34bd('0x1f')]({'raw':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x38bdba['options']?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x19')]||null:null,'include':_0x38bdba[_0x34bd('0x16')]?_0x38bdba['options'][_0x34bd('0x1b')]?_['map'](_0x38bdba[_0x34bd('0x16')][_0x34bd('0x1b')],function(_0xf12ee6){return{'model':db[_0xf12ee6['model']],'as':_0xf12ee6['as'],'attributes':_0xf12ee6[_0x34bd('0x19')],'include':_0xf12ee6[_0x34bd('0x1b')]?_['map'](_0xf12ee6[_0x34bd('0x1b')],function(_0x21c7d6){return{'model':db[_0x21c7d6[_0x34bd('0x1c')]],'as':_0x21c7d6['as'],'attributes':_0x21c7d6['attributes'],'include':_0x21c7d6[_0x34bd('0x1b')]?_[_0x34bd('0x1d')](_0x21c7d6['include'],function(_0x117188){return{'model':db[_0x117188[_0x34bd('0x1c')]],'as':_0x117188['as'],'attributes':_0x117188[_0x34bd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x320643){logger[_0x34bd('0xa')]('ShowFreshsalesAccount',_0x38bdba);logger['debug']('ShowFreshsalesAccount',_0x38bdba,JSON[_0x34bd('0x1e')](_0x320643));_0xd176f7(_0x320643);})[_0x34bd('0x12')](function(_0x5e30c5){logger['error'](_0x34bd('0x20'),_0x5e30c5['message'],_0x38bdba);_0x536b2c(_0xca9897['error'](0x1f4,_0x5e30c5[_0x34bd('0x10')]));});});};
\ No newline at end of file
index f7ed7a4..153acac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda44=['/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x24d711,_0x3cdb28){var _0x3491b4=function(_0xd5957e){while(--_0xd5957e){_0x24d711['push'](_0x24d711['shift']());}};_0x3491b4(++_0x3cdb28);}(_0xda44,0x15a));var _0x4da4=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xda44[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x4da4('0x0'));var util=require('util');var path=require(_0x4da4('0x1'));var timeout=require(_0x4da4('0x2'));var express=require(_0x4da4('0x3'));var router=express[_0x4da4('0x4')]();var fs_extra=require(_0x4da4('0x5'));var auth=require(_0x4da4('0x6'));var interaction=require(_0x4da4('0x7'));var config=require('../../config/environment');var controller=require(_0x4da4('0x8'));router['get']('/',auth[_0x4da4('0x9')](),controller[_0x4da4('0xa')]);router[_0x4da4('0xb')](_0x4da4('0xc'),auth[_0x4da4('0x9')](),controller[_0x4da4('0xd')]);router['get'](_0x4da4('0xe'),auth[_0x4da4('0x9')](),controller[_0x4da4('0xf')]);router[_0x4da4('0xb')](_0x4da4('0x10'),auth[_0x4da4('0x9')](),controller[_0x4da4('0x11')]);router[_0x4da4('0xb')](_0x4da4('0x12'),auth['isAuthenticated'](),controller[_0x4da4('0x13')]);router[_0x4da4('0x14')]('/',auth[_0x4da4('0x9')](),controller['create']);router[_0x4da4('0x15')]('/:id',auth[_0x4da4('0x9')](),controller[_0x4da4('0x16')]);router[_0x4da4('0x17')](_0x4da4('0xc'),auth['isAuthenticated'](),controller[_0x4da4('0x18')]);module[_0x4da4('0x19')]=router;
\ No newline at end of file
+var _0x52a8=['isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','create','put','update','exports','multer','path','express','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x596921,_0x71146d){var _0x4b3ed0=function(_0x4c591c){while(--_0x4c591c){_0x596921['push'](_0x596921['shift']());}};_0x4b3ed0(++_0x71146d);}(_0x52a8,0x1ee));var _0x852a=function(_0x29c7b0,_0x1b0793){_0x29c7b0=_0x29c7b0-0x0;var _0x2c0b65=_0x52a8[_0x29c7b0];return _0x2c0b65;};'use strict';var multer=require(_0x852a('0x0'));var util=require('util');var path=require(_0x852a('0x1'));var timeout=require('connect-timeout');var express=require(_0x852a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x852a('0x3'));var config=require(_0x852a('0x4'));var controller=require(_0x852a('0x5'));router['get']('/',auth[_0x852a('0x6')](),controller[_0x852a('0x7')]);router[_0x852a('0x8')](_0x852a('0x9'),auth[_0x852a('0x6')](),controller[_0x852a('0xa')]);router[_0x852a('0x8')](_0x852a('0xb'),auth[_0x852a('0x6')](),controller[_0x852a('0xc')]);router[_0x852a('0x8')](_0x852a('0xd'),auth[_0x852a('0x6')](),controller[_0x852a('0xe')]);router[_0x852a('0x8')](_0x852a('0xf'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x852a('0x6')](),controller[_0x852a('0x10')]);router[_0x852a('0x11')](_0x852a('0x9'),auth['isAuthenticated'](),controller[_0x852a('0x12')]);router['delete'](_0x852a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x852a('0x13')]=router;
\ No newline at end of file
index 7ca4201..268b167 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadfd=['sequelize','exports','STRING'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xadfd,0x126));var _0xdadf=function(_0x1392a4,_0x1deb8b){_0x1392a4=_0x1392a4-0x0;var _0x3d62da=_0xadfd[_0x1392a4];return _0x3d62da;};'use strict';var Sequelize=require(_0xdadf('0x0'));module[_0xdadf('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdadf('0x2')]}};
\ No newline at end of file
+var _0x0dd6=['sequelize','STRING'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x0dd6,0x1de));var _0x60dd=function(_0x3216f7,_0x45a5cd){_0x3216f7=_0x3216f7-0x0;var _0x1ea482=_0x0dd6[_0x3216f7];return _0x1ea482;};'use strict';var Sequelize=require(_0x60dd('0x0'));module['exports']={'name':{'type':Sequelize[_0x60dd('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 137fda8..57d73e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5309=['map','FreshsalesConfiguration','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','intersection','find','catch','create','body','findOne','pick','getSubjects','getDescriptions','FreshsalesField','nolimit','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x458dd7,_0xe5602b){var _0x2a12f3=function(_0x547dee){while(--_0x547dee){_0x458dd7['push'](_0x458dd7['shift']());}};_0x2a12f3(++_0xe5602b);}(_0x5309,0x165));var _0x9530=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0x5309[_0x1e4f2d];return _0xd05ce5;};'use strict';var emlformat=require(_0x9530('0x0'));var rimraf=require(_0x9530('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9530('0x2'));var rp=require(_0x9530('0x3'));var moment=require(_0x9530('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9530('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9530('0x6'));var ejs=require(_0x9530('0x7'));var fs=require('fs');var fs_extra=require(_0x9530('0x8'));var _=require(_0x9530('0x9'));var squel=require(_0x9530('0xa'));var crypto=require(_0x9530('0xb'));var jsforce=require(_0x9530('0xc'));var deskjs=require(_0x9530('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9530('0xe'));var Redis=require(_0x9530('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9530('0x10'));var hardwareService=require(_0x9530('0x11'));var logger=require(_0x9530('0x12'))(_0x9530('0x13'));var utils=require('../../config/utils');var config=require(_0x9530('0x14'));var licenseUtil=require(_0x9530('0x15'));var db=require(_0x9530('0x16'))['db'];function respondWithStatusCode(_0xfabb74,_0x364fd9){_0x364fd9=_0x364fd9||0xcc;return function(_0x5ac2a5){if(_0x5ac2a5){return _0xfabb74[_0x9530('0x17')](_0x364fd9);}return _0xfabb74[_0x9530('0x18')](_0x364fd9)[_0x9530('0x19')]();};}function respondWithResult(_0x5c5cc8,_0x209f8c){_0x209f8c=_0x209f8c||0xc8;return function(_0x467a3d){if(_0x467a3d){return _0x5c5cc8[_0x9530('0x18')](_0x209f8c)[_0x9530('0x1a')](_0x467a3d);}};}function respondWithFilteredResult(_0x18a712,_0x36bda3){return function(_0x2a1b9c){if(_0x2a1b9c){var _0x27f6b8=typeof _0x36bda3[_0x9530('0x1b')]==='undefined'&&typeof _0x36bda3[_0x9530('0x1c')]===_0x9530('0x1d');var _0x1ca71a=_0x2a1b9c[_0x9530('0x1e')];var _0x42df25=_0x27f6b8?0x0:_0x36bda3['offset'];var _0x270375=_0x27f6b8?_0x2a1b9c[_0x9530('0x1e')]:_0x36bda3[_0x9530('0x1b')]+_0x36bda3['limit'];var _0x30b274;if(_0x270375>=_0x1ca71a){_0x270375=_0x1ca71a;_0x30b274=0xc8;}else{_0x30b274=0xce;}_0x18a712['status'](_0x30b274);return _0x18a712['set'](_0x9530('0x1f'),_0x42df25+'-'+_0x270375+'/'+_0x1ca71a)[_0x9530('0x1a')](_0x2a1b9c);}return null;};}function patchUpdates(_0x9f4484){return function(_0xe4db8){try{jsonpatch[_0x9530('0x20')](_0xe4db8,_0x9f4484,!![]);}catch(_0x43d47d){return BPromise[_0x9530('0x21')](_0x43d47d);}return _0xe4db8[_0x9530('0x22')]();};}function saveUpdates(_0x371e99,_0x475d98){return function(_0x242ec4){if(_0x242ec4){return _0x242ec4[_0x9530('0x23')](_0x371e99)[_0x9530('0x24')](function(_0x4cf58e){return _0x4cf58e;});}return null;};}function removeEntity(_0x4c98e0,_0x2e05d8){return function(_0xed9cfa){if(_0xed9cfa){return _0xed9cfa[_0x9530('0x25')]()[_0x9530('0x24')](function(){_0x4c98e0[_0x9530('0x18')](0xcc)[_0x9530('0x19')]();});}};}function handleEntityNotFound(_0x50349e,_0x4de891){return function(_0x184d6f){if(!_0x184d6f){_0x50349e['sendStatus'](0x194);}return _0x184d6f;};}function handleError(_0x4fa31b,_0x151296){_0x151296=_0x151296||0x1f4;return function(_0x688dbc){logger[_0x9530('0x26')](_0x688dbc[_0x9530('0x27')]);if(_0x688dbc['name']){delete _0x688dbc[_0x9530('0x28')];}_0x4fa31b[_0x9530('0x18')](_0x151296)[_0x9530('0x29')](_0x688dbc);};}exports[_0x9530('0x2a')]=function(_0x541f33,_0x4e4aa6){var _0x1a86a3={},_0x25d176={},_0x143e8b={'count':0x0,'rows':[]};var _0x1330ec=_[_0x9530('0x2b')](db[_0x9530('0x2c')][_0x9530('0x2d')],function(_0x5a20f2){return{'name':_0x5a20f2[_0x9530('0x2e')],'type':_0x5a20f2['type']['key']};});_0x25d176[_0x9530('0x2f')]=_[_0x9530('0x2b')](_0x1330ec,'name');_0x25d176[_0x9530('0x30')]=_[_0x9530('0x31')](_0x541f33[_0x9530('0x30')]);_0x25d176[_0x9530('0x32')]=_['intersection'](_0x25d176[_0x9530('0x2f')],_0x25d176[_0x9530('0x30')]);_0x1a86a3[_0x9530('0x33')]=_['intersection'](_0x25d176[_0x9530('0x2f')],qs[_0x9530('0x34')](_0x541f33['query']['fields']));_0x1a86a3[_0x9530('0x33')]=_0x1a86a3['attributes'][_0x9530('0x35')]?_0x1a86a3[_0x9530('0x33')]:_0x25d176[_0x9530('0x2f')];if(!_0x541f33[_0x9530('0x30')][_0x9530('0x36')]('nolimit')){_0x1a86a3['limit']=qs[_0x9530('0x1c')](_0x541f33[_0x9530('0x30')]['limit']);_0x1a86a3['offset']=qs[_0x9530('0x1b')](_0x541f33[_0x9530('0x30')][_0x9530('0x1b')]);}_0x1a86a3[_0x9530('0x37')]=qs[_0x9530('0x38')](_0x541f33['query'][_0x9530('0x38')]);_0x1a86a3[_0x9530('0x39')]=qs[_0x9530('0x32')](_['pick'](_0x541f33[_0x9530('0x30')],_0x25d176[_0x9530('0x32')]),_0x1330ec);if(_0x541f33[_0x9530('0x30')][_0x9530('0x3a')]){_0x1a86a3[_0x9530('0x39')]=_[_0x9530('0x3b')](_0x1a86a3[_0x9530('0x39')],{'$or':_[_0x9530('0x2b')](_0x1330ec,function(_0x3b5ad1){if(_0x3b5ad1[_0x9530('0x3c')]!==_0x9530('0x3d')){var _0x4e2c70={};_0x4e2c70[_0x3b5ad1[_0x9530('0x28')]]={'$like':'%'+_0x541f33[_0x9530('0x30')][_0x9530('0x3a')]+'%'};return _0x4e2c70;}})});}_0x1a86a3=_[_0x9530('0x3b')]({},_0x1a86a3,_0x541f33[_0x9530('0x3e')]);var _0x49c201={'where':_0x1a86a3[_0x9530('0x39')]};return db[_0x9530('0x2c')][_0x9530('0x1e')](_0x49c201)[_0x9530('0x24')](function(_0x527f99){_0x143e8b[_0x9530('0x1e')]=_0x527f99;if(_0x541f33[_0x9530('0x30')][_0x9530('0x3f')]){_0x1a86a3[_0x9530('0x40')]=[{'all':!![]}];}return db[_0x9530('0x2c')][_0x9530('0x41')](_0x1a86a3);})[_0x9530('0x24')](function(_0x2a30f3){_0x143e8b[_0x9530('0x42')]=_0x2a30f3;return _0x143e8b;})[_0x9530('0x24')](respondWithFilteredResult(_0x4e4aa6,_0x1a86a3))['catch'](handleError(_0x4e4aa6,null));};exports['show']=function(_0x592ba5,_0x472a14){var _0x2d60af={'raw':![],'where':{'id':_0x592ba5[_0x9530('0x43')]['id']}},_0x5cbe7d={};_0x5cbe7d[_0x9530('0x2f')]=_[_0x9530('0x31')](db['FreshsalesConfiguration'][_0x9530('0x2d')]);_0x5cbe7d[_0x9530('0x30')]=_[_0x9530('0x31')](_0x592ba5[_0x9530('0x30')]);_0x5cbe7d[_0x9530('0x32')]=_[_0x9530('0x44')](_0x5cbe7d[_0x9530('0x2f')],_0x5cbe7d[_0x9530('0x30')]);_0x2d60af[_0x9530('0x33')]=_['intersection'](_0x5cbe7d[_0x9530('0x2f')],qs['fields'](_0x592ba5['query'][_0x9530('0x34')]));_0x2d60af[_0x9530('0x33')]=_0x2d60af[_0x9530('0x33')][_0x9530('0x35')]?_0x2d60af[_0x9530('0x33')]:_0x5cbe7d[_0x9530('0x2f')];if(_0x592ba5[_0x9530('0x30')]['includeAll']){_0x2d60af[_0x9530('0x40')]=[{'all':!![]}];}_0x2d60af=_['merge']({},_0x2d60af,_0x592ba5[_0x9530('0x3e')]);return db[_0x9530('0x2c')][_0x9530('0x45')](_0x2d60af)[_0x9530('0x24')](handleEntityNotFound(_0x472a14,null))[_0x9530('0x24')](respondWithResult(_0x472a14,null))[_0x9530('0x46')](handleError(_0x472a14,null));};exports[_0x9530('0x47')]=function(_0x368655,_0x2347cc){return db['FreshsalesConfiguration'][_0x9530('0x47')](_0x368655[_0x9530('0x48')],{})[_0x9530('0x24')](respondWithResult(_0x2347cc,0xc9))[_0x9530('0x46')](handleError(_0x2347cc,null));};exports['update']=function(_0x225332,_0x476b75){if(_0x225332[_0x9530('0x48')]['id']){delete _0x225332[_0x9530('0x48')]['id'];}return db[_0x9530('0x2c')]['find']({'where':{'id':_0x225332[_0x9530('0x43')]['id']}})[_0x9530('0x24')](handleEntityNotFound(_0x476b75,null))['then'](saveUpdates(_0x225332['body'],null))[_0x9530('0x24')](respondWithResult(_0x476b75,null))[_0x9530('0x46')](handleError(_0x476b75,null));};exports[_0x9530('0x25')]=function(_0x2f0b28,_0x4f8bde){return db[_0x9530('0x2c')][_0x9530('0x45')]({'where':{'id':_0x2f0b28['params']['id']}})[_0x9530('0x24')](handleEntityNotFound(_0x4f8bde,null))['then'](removeEntity(_0x4f8bde,null))[_0x9530('0x46')](handleError(_0x4f8bde,null));};exports['getSubjects']=function(_0x5b2fa3,_0x372b1b,_0x398268){var _0x501ff7={};var _0x22d854={};var _0x5941ed;var _0x62e208;return db[_0x9530('0x2c')][_0x9530('0x49')]({'where':{'id':_0x5b2fa3[_0x9530('0x43')]['id']}})[_0x9530('0x24')](handleEntityNotFound(_0x372b1b,null))[_0x9530('0x24')](function(_0x52ca99){if(_0x52ca99){_0x5941ed=_0x52ca99;_0x22d854[_0x9530('0x2f')]=_[_0x9530('0x31')](db['FreshsalesField'][_0x9530('0x2d')]);_0x22d854[_0x9530('0x30')]=_[_0x9530('0x31')](_0x5b2fa3['query']);_0x22d854[_0x9530('0x32')]=_[_0x9530('0x44')](_0x22d854[_0x9530('0x2f')],_0x22d854[_0x9530('0x30')]);_0x501ff7[_0x9530('0x33')]=_[_0x9530('0x44')](_0x22d854['model'],qs[_0x9530('0x34')](_0x5b2fa3['query'][_0x9530('0x34')]));_0x501ff7['attributes']=_0x501ff7['attributes'][_0x9530('0x35')]?_0x501ff7[_0x9530('0x33')]:_0x22d854['model'];_0x501ff7[_0x9530('0x37')]=qs[_0x9530('0x38')](_0x5b2fa3[_0x9530('0x30')][_0x9530('0x38')]);_0x501ff7[_0x9530('0x39')]=qs[_0x9530('0x32')](_[_0x9530('0x4a')](_0x5b2fa3[_0x9530('0x30')],_0x22d854[_0x9530('0x32')]));if(_0x5b2fa3[_0x9530('0x30')][_0x9530('0x3a')]){_0x501ff7[_0x9530('0x39')]=_['merge'](_0x501ff7['where'],{'$or':_[_0x9530('0x2b')](_0x501ff7[_0x9530('0x33')],function(_0x3e928f){var _0x51e182={};_0x51e182[_0x3e928f]={'$like':'%'+_0x5b2fa3['query'][_0x9530('0x3a')]+'%'};return _0x51e182;})});}_0x501ff7=_[_0x9530('0x3b')]({},_0x501ff7,_0x5b2fa3['options']);return _0x5941ed[_0x9530('0x4b')](_0x501ff7);}})[_0x9530('0x24')](function(_0x2019f1){if(_0x2019f1){_0x62e208=_0x2019f1[_0x9530('0x35')];if(!_0x5b2fa3[_0x9530('0x30')]['hasOwnProperty']('nolimit')){_0x501ff7['limit']=qs[_0x9530('0x1c')](_0x5b2fa3[_0x9530('0x30')]['limit']);_0x501ff7[_0x9530('0x1b')]=qs['offset'](_0x5b2fa3['query'][_0x9530('0x1b')]);}return _0x5941ed[_0x9530('0x4b')](_0x501ff7);}})['then'](function(_0x40ef87){if(_0x40ef87){return _0x40ef87?{'count':_0x62e208,'rows':_0x40ef87}:null;}})[_0x9530('0x24')](respondWithResult(_0x372b1b,null))[_0x9530('0x46')](handleError(_0x372b1b,null));};exports[_0x9530('0x4c')]=function(_0x44c828,_0x254c9b,_0x1e8a30){var _0x562b77={};var _0x150ef9={};var _0x491fd7;var _0x51113c;return db[_0x9530('0x2c')][_0x9530('0x49')]({'where':{'id':_0x44c828[_0x9530('0x43')]['id']}})[_0x9530('0x24')](handleEntityNotFound(_0x254c9b,null))[_0x9530('0x24')](function(_0x3d25ef){if(_0x3d25ef){_0x491fd7=_0x3d25ef;_0x150ef9[_0x9530('0x2f')]=_['keys'](db[_0x9530('0x4d')][_0x9530('0x2d')]);_0x150ef9[_0x9530('0x30')]=_[_0x9530('0x31')](_0x44c828[_0x9530('0x30')]);_0x150ef9[_0x9530('0x32')]=_['intersection'](_0x150ef9[_0x9530('0x2f')],_0x150ef9['query']);_0x562b77[_0x9530('0x33')]=_[_0x9530('0x44')](_0x150ef9[_0x9530('0x2f')],qs[_0x9530('0x34')](_0x44c828[_0x9530('0x30')][_0x9530('0x34')]));_0x562b77[_0x9530('0x33')]=_0x562b77[_0x9530('0x33')][_0x9530('0x35')]?_0x562b77[_0x9530('0x33')]:_0x150ef9[_0x9530('0x2f')];_0x562b77[_0x9530('0x37')]=qs[_0x9530('0x38')](_0x44c828[_0x9530('0x30')]['sort']);_0x562b77[_0x9530('0x39')]=qs[_0x9530('0x32')](_[_0x9530('0x4a')](_0x44c828[_0x9530('0x30')],_0x150ef9['filters']));if(_0x44c828[_0x9530('0x30')][_0x9530('0x3a')]){_0x562b77[_0x9530('0x39')]=_[_0x9530('0x3b')](_0x562b77[_0x9530('0x39')],{'$or':_[_0x9530('0x2b')](_0x562b77[_0x9530('0x33')],function(_0x3931ff){var _0x1882c9={};_0x1882c9[_0x3931ff]={'$like':'%'+_0x44c828[_0x9530('0x30')][_0x9530('0x3a')]+'%'};return _0x1882c9;})});}_0x562b77=_[_0x9530('0x3b')]({},_0x562b77,_0x44c828[_0x9530('0x3e')]);return _0x491fd7[_0x9530('0x4c')](_0x562b77);}})['then'](function(_0x374f40){if(_0x374f40){_0x51113c=_0x374f40[_0x9530('0x35')];if(!_0x44c828[_0x9530('0x30')]['hasOwnProperty'](_0x9530('0x4e'))){_0x562b77[_0x9530('0x1c')]=qs['limit'](_0x44c828[_0x9530('0x30')][_0x9530('0x1c')]);_0x562b77[_0x9530('0x1b')]=qs[_0x9530('0x1b')](_0x44c828[_0x9530('0x30')][_0x9530('0x1b')]);}return _0x491fd7['getDescriptions'](_0x562b77);}})[_0x9530('0x24')](function(_0x5a5116){if(_0x5a5116){return _0x5a5116?{'count':_0x51113c,'rows':_0x5a5116}:null;}})['then'](respondWithResult(_0x254c9b,null))['catch'](handleError(_0x254c9b,null));};exports[_0x9530('0x4f')]=function(_0x3c8052,_0x1d0e57,_0x259ead){var _0x5cfcca={};var _0xa992ac={};var _0x10f3bc;var _0x2304df;return db['FreshsalesConfiguration'][_0x9530('0x49')]({'where':{'id':_0x3c8052[_0x9530('0x43')]['id']}})[_0x9530('0x24')](handleEntityNotFound(_0x1d0e57,null))[_0x9530('0x24')](function(_0x19f295){if(_0x19f295){_0x10f3bc=_0x19f295;_0xa992ac[_0x9530('0x2f')]=_[_0x9530('0x31')](db['FreshsalesField'][_0x9530('0x2d')]);_0xa992ac[_0x9530('0x30')]=_[_0x9530('0x31')](_0x3c8052[_0x9530('0x30')]);_0xa992ac['filters']=_[_0x9530('0x44')](_0xa992ac[_0x9530('0x2f')],_0xa992ac[_0x9530('0x30')]);_0x5cfcca[_0x9530('0x33')]=_['intersection'](_0xa992ac[_0x9530('0x2f')],qs[_0x9530('0x34')](_0x3c8052[_0x9530('0x30')]['fields']));_0x5cfcca['attributes']=_0x5cfcca['attributes'][_0x9530('0x35')]?_0x5cfcca['attributes']:_0xa992ac['model'];_0x5cfcca[_0x9530('0x37')]=qs[_0x9530('0x38')](_0x3c8052[_0x9530('0x30')][_0x9530('0x38')]);_0x5cfcca[_0x9530('0x39')]=qs[_0x9530('0x32')](_[_0x9530('0x4a')](_0x3c8052['query'],_0xa992ac['filters']));if(_0x3c8052[_0x9530('0x30')][_0x9530('0x3a')]){_0x5cfcca['where']=_[_0x9530('0x3b')](_0x5cfcca['where'],{'$or':_[_0x9530('0x2b')](_0x5cfcca['attributes'],function(_0x3dcbf7){var _0x5b0902={};_0x5b0902[_0x3dcbf7]={'$like':'%'+_0x3c8052['query'][_0x9530('0x3a')]+'%'};return _0x5b0902;})});}_0x5cfcca=_[_0x9530('0x3b')]({},_0x5cfcca,_0x3c8052['options']);return _0x10f3bc[_0x9530('0x4f')](_0x5cfcca);}})['then'](function(_0x2be134){if(_0x2be134){_0x2304df=_0x2be134['length'];if(!_0x3c8052['query'][_0x9530('0x36')]('nolimit')){_0x5cfcca[_0x9530('0x1c')]=qs[_0x9530('0x1c')](_0x3c8052[_0x9530('0x30')][_0x9530('0x1c')]);_0x5cfcca[_0x9530('0x1b')]=qs['offset'](_0x3c8052[_0x9530('0x30')][_0x9530('0x1b')]);}return _0x10f3bc['getFields'](_0x5cfcca);}})['then'](function(_0x7300b6){if(_0x7300b6){return _0x7300b6?{'count':_0x2304df,'rows':_0x7300b6}:null;}})['then'](respondWithResult(_0x1d0e57,null))['catch'](handleError(_0x1d0e57,null));};
\ No newline at end of file
+var _0x5b17=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','getSubjects','FreshsalesField','pick','getDescriptions','findOne','getFields','eml-format','fast-json-patch','request-promise','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x87f102,_0x4a0419){var _0x55049d=function(_0x47f245){while(--_0x47f245){_0x87f102['push'](_0x87f102['shift']());}};_0x55049d(++_0x4a0419);}(_0x5b17,0x1be));var _0x75b1=function(_0x1e651a,_0x4ef85d){_0x1e651a=_0x1e651a-0x0;var _0x266949=_0x5b17[_0x1e651a];return _0x266949;};'use strict';var emlformat=require(_0x75b1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x75b1('0x1'));var rp=require(_0x75b1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x75b1('0x3'));var path=require(_0x75b1('0x4'));var sox=require(_0x75b1('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75b1('0x6'));var squel=require('squel');var crypto=require(_0x75b1('0x7'));var jsforce=require(_0x75b1('0x8'));var deskjs=require(_0x75b1('0x9'));var toCsv=require(_0x75b1('0xa'));var querystring=require(_0x75b1('0xb'));var Papa=require(_0x75b1('0xc'));var Redis=require('ioredis');var authService=require(_0x75b1('0xd'));var qs=require(_0x75b1('0xe'));var as=require(_0x75b1('0xf'));var hardwareService=require(_0x75b1('0x10'));var logger=require(_0x75b1('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x75b1('0x12'));var db=require(_0x75b1('0x13'))['db'];function respondWithStatusCode(_0x171c29,_0x225833){_0x225833=_0x225833||0xcc;return function(_0x3bc7b6){if(_0x3bc7b6){return _0x171c29[_0x75b1('0x14')](_0x225833);}return _0x171c29['status'](_0x225833)['end']();};}function respondWithResult(_0x8479b,_0x540d72){_0x540d72=_0x540d72||0xc8;return function(_0x53d1e1){if(_0x53d1e1){return _0x8479b[_0x75b1('0x15')](_0x540d72)[_0x75b1('0x16')](_0x53d1e1);}};}function respondWithFilteredResult(_0x151c4b,_0x39123a){return function(_0x2a3945){if(_0x2a3945){var _0x3c7145=typeof _0x39123a['offset']===_0x75b1('0x17')&&typeof _0x39123a[_0x75b1('0x18')]==='undefined';var _0x5a232b=_0x2a3945[_0x75b1('0x19')];var _0x49b922=_0x3c7145?0x0:_0x39123a[_0x75b1('0x1a')];var _0x365a5e=_0x3c7145?_0x2a3945['count']:_0x39123a['offset']+_0x39123a[_0x75b1('0x18')];var _0x2b6c1a;if(_0x365a5e>=_0x5a232b){_0x365a5e=_0x5a232b;_0x2b6c1a=0xc8;}else{_0x2b6c1a=0xce;}_0x151c4b['status'](_0x2b6c1a);return _0x151c4b[_0x75b1('0x1b')](_0x75b1('0x1c'),_0x49b922+'-'+_0x365a5e+'/'+_0x5a232b)[_0x75b1('0x16')](_0x2a3945);}return null;};}function patchUpdates(_0x1e8b32){return function(_0x50fdee){try{jsonpatch[_0x75b1('0x1d')](_0x50fdee,_0x1e8b32,!![]);}catch(_0x4612f4){return BPromise[_0x75b1('0x1e')](_0x4612f4);}return _0x50fdee[_0x75b1('0x1f')]();};}function saveUpdates(_0x5ed77d,_0xedd0){return function(_0x4b07d6){if(_0x4b07d6){return _0x4b07d6[_0x75b1('0x20')](_0x5ed77d)[_0x75b1('0x21')](function(_0x172aaa){return _0x172aaa;});}return null;};}function removeEntity(_0x5dfcc4,_0x3dfd72){return function(_0x5ca483){if(_0x5ca483){return _0x5ca483[_0x75b1('0x22')]()['then'](function(){_0x5dfcc4[_0x75b1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5184b4,_0x34d3ac){return function(_0x81cf85){if(!_0x81cf85){_0x5184b4[_0x75b1('0x14')](0x194);}return _0x81cf85;};}function handleError(_0x1f9d2b,_0x313164){_0x313164=_0x313164||0x1f4;return function(_0x2d5991){logger[_0x75b1('0x23')](_0x2d5991[_0x75b1('0x24')]);if(_0x2d5991[_0x75b1('0x25')]){delete _0x2d5991[_0x75b1('0x25')];}_0x1f9d2b['status'](_0x313164)[_0x75b1('0x26')](_0x2d5991);};}exports[_0x75b1('0x27')]=function(_0x23ecad,_0x31c29f){var _0x43931d={},_0x16d967={},_0x2cc6ce={'count':0x0,'rows':[]};var _0x3b2bc3=_['map'](db[_0x75b1('0x28')][_0x75b1('0x29')],function(_0x4bade6){return{'name':_0x4bade6[_0x75b1('0x2a')],'type':_0x4bade6[_0x75b1('0x2b')][_0x75b1('0x2c')]};});_0x16d967[_0x75b1('0x2d')]=_[_0x75b1('0x2e')](_0x3b2bc3,'name');_0x16d967['query']=_[_0x75b1('0x2f')](_0x23ecad[_0x75b1('0x30')]);_0x16d967[_0x75b1('0x31')]=_[_0x75b1('0x32')](_0x16d967[_0x75b1('0x2d')],_0x16d967[_0x75b1('0x30')]);_0x43931d['attributes']=_[_0x75b1('0x32')](_0x16d967[_0x75b1('0x2d')],qs['fields'](_0x23ecad[_0x75b1('0x30')][_0x75b1('0x33')]));_0x43931d[_0x75b1('0x34')]=_0x43931d['attributes']['length']?_0x43931d[_0x75b1('0x34')]:_0x16d967[_0x75b1('0x2d')];if(!_0x23ecad[_0x75b1('0x30')][_0x75b1('0x35')](_0x75b1('0x36'))){_0x43931d[_0x75b1('0x18')]=qs[_0x75b1('0x18')](_0x23ecad[_0x75b1('0x30')][_0x75b1('0x18')]);_0x43931d['offset']=qs[_0x75b1('0x1a')](_0x23ecad[_0x75b1('0x30')]['offset']);}_0x43931d[_0x75b1('0x37')]=qs[_0x75b1('0x38')](_0x23ecad[_0x75b1('0x30')][_0x75b1('0x38')]);_0x43931d[_0x75b1('0x39')]=qs[_0x75b1('0x31')](_['pick'](_0x23ecad[_0x75b1('0x30')],_0x16d967[_0x75b1('0x31')]),_0x3b2bc3);if(_0x23ecad[_0x75b1('0x30')][_0x75b1('0x3a')]){_0x43931d[_0x75b1('0x39')]=_[_0x75b1('0x3b')](_0x43931d[_0x75b1('0x39')],{'$or':_[_0x75b1('0x2e')](_0x3b2bc3,function(_0x15e3ec){if(_0x15e3ec[_0x75b1('0x2b')]!==_0x75b1('0x3c')){var _0x2225f2={};_0x2225f2[_0x15e3ec[_0x75b1('0x25')]]={'$like':'%'+_0x23ecad[_0x75b1('0x30')][_0x75b1('0x3a')]+'%'};return _0x2225f2;}})});}_0x43931d=_[_0x75b1('0x3b')]({},_0x43931d,_0x23ecad[_0x75b1('0x3d')]);var _0x482f98={'where':_0x43931d[_0x75b1('0x39')]};return db['FreshsalesConfiguration'][_0x75b1('0x19')](_0x482f98)[_0x75b1('0x21')](function(_0x46bd6b){_0x2cc6ce[_0x75b1('0x19')]=_0x46bd6b;if(_0x23ecad[_0x75b1('0x30')]['includeAll']){_0x43931d[_0x75b1('0x3e')]=[{'all':!![]}];}return db[_0x75b1('0x28')][_0x75b1('0x3f')](_0x43931d);})[_0x75b1('0x21')](function(_0x23211d){_0x2cc6ce[_0x75b1('0x40')]=_0x23211d;return _0x2cc6ce;})['then'](respondWithFilteredResult(_0x31c29f,_0x43931d))[_0x75b1('0x41')](handleError(_0x31c29f,null));};exports[_0x75b1('0x42')]=function(_0xfc5724,_0x2a6905){var _0xcc1b9a={'raw':![],'where':{'id':_0xfc5724[_0x75b1('0x43')]['id']}},_0xaf18b6={};_0xaf18b6[_0x75b1('0x2d')]=_['keys'](db[_0x75b1('0x28')][_0x75b1('0x29')]);_0xaf18b6['query']=_[_0x75b1('0x2f')](_0xfc5724[_0x75b1('0x30')]);_0xaf18b6[_0x75b1('0x31')]=_[_0x75b1('0x32')](_0xaf18b6[_0x75b1('0x2d')],_0xaf18b6['query']);_0xcc1b9a[_0x75b1('0x34')]=_[_0x75b1('0x32')](_0xaf18b6[_0x75b1('0x2d')],qs[_0x75b1('0x33')](_0xfc5724[_0x75b1('0x30')][_0x75b1('0x33')]));_0xcc1b9a[_0x75b1('0x34')]=_0xcc1b9a[_0x75b1('0x34')][_0x75b1('0x44')]?_0xcc1b9a['attributes']:_0xaf18b6[_0x75b1('0x2d')];if(_0xfc5724[_0x75b1('0x30')]['includeAll']){_0xcc1b9a['include']=[{'all':!![]}];}_0xcc1b9a=_[_0x75b1('0x3b')]({},_0xcc1b9a,_0xfc5724['options']);return db[_0x75b1('0x28')][_0x75b1('0x45')](_0xcc1b9a)[_0x75b1('0x21')](handleEntityNotFound(_0x2a6905,null))[_0x75b1('0x21')](respondWithResult(_0x2a6905,null))[_0x75b1('0x41')](handleError(_0x2a6905,null));};exports[_0x75b1('0x46')]=function(_0x1d5cf5,_0x4ff846){return db['FreshsalesConfiguration'][_0x75b1('0x46')](_0x1d5cf5[_0x75b1('0x47')],{})[_0x75b1('0x21')](respondWithResult(_0x4ff846,0xc9))[_0x75b1('0x41')](handleError(_0x4ff846,null));};exports[_0x75b1('0x20')]=function(_0x21c5e,_0x58c779){if(_0x21c5e['body']['id']){delete _0x21c5e[_0x75b1('0x47')]['id'];}return db[_0x75b1('0x28')]['find']({'where':{'id':_0x21c5e[_0x75b1('0x43')]['id']}})[_0x75b1('0x21')](handleEntityNotFound(_0x58c779,null))[_0x75b1('0x21')](saveUpdates(_0x21c5e[_0x75b1('0x47')],null))['then'](respondWithResult(_0x58c779,null))['catch'](handleError(_0x58c779,null));};exports[_0x75b1('0x22')]=function(_0x1095e1,_0x187d97){return db[_0x75b1('0x28')][_0x75b1('0x45')]({'where':{'id':_0x1095e1[_0x75b1('0x43')]['id']}})['then'](handleEntityNotFound(_0x187d97,null))[_0x75b1('0x21')](removeEntity(_0x187d97,null))[_0x75b1('0x41')](handleError(_0x187d97,null));};exports[_0x75b1('0x48')]=function(_0x18d4f4,_0x53571b,_0x4f8f02){var _0x2a17e4={};var _0x32a360={};var _0x3e814d;var _0x303c9f;return db[_0x75b1('0x28')]['findOne']({'where':{'id':_0x18d4f4[_0x75b1('0x43')]['id']}})[_0x75b1('0x21')](handleEntityNotFound(_0x53571b,null))[_0x75b1('0x21')](function(_0x329767){if(_0x329767){_0x3e814d=_0x329767;_0x32a360[_0x75b1('0x2d')]=_[_0x75b1('0x2f')](db[_0x75b1('0x49')][_0x75b1('0x29')]);_0x32a360[_0x75b1('0x30')]=_['keys'](_0x18d4f4[_0x75b1('0x30')]);_0x32a360['filters']=_[_0x75b1('0x32')](_0x32a360[_0x75b1('0x2d')],_0x32a360['query']);_0x2a17e4[_0x75b1('0x34')]=_[_0x75b1('0x32')](_0x32a360[_0x75b1('0x2d')],qs[_0x75b1('0x33')](_0x18d4f4[_0x75b1('0x30')][_0x75b1('0x33')]));_0x2a17e4[_0x75b1('0x34')]=_0x2a17e4[_0x75b1('0x34')][_0x75b1('0x44')]?_0x2a17e4[_0x75b1('0x34')]:_0x32a360[_0x75b1('0x2d')];_0x2a17e4[_0x75b1('0x37')]=qs[_0x75b1('0x38')](_0x18d4f4[_0x75b1('0x30')][_0x75b1('0x38')]);_0x2a17e4[_0x75b1('0x39')]=qs[_0x75b1('0x31')](_[_0x75b1('0x4a')](_0x18d4f4[_0x75b1('0x30')],_0x32a360[_0x75b1('0x31')]));if(_0x18d4f4[_0x75b1('0x30')][_0x75b1('0x3a')]){_0x2a17e4[_0x75b1('0x39')]=_[_0x75b1('0x3b')](_0x2a17e4[_0x75b1('0x39')],{'$or':_[_0x75b1('0x2e')](_0x2a17e4['attributes'],function(_0x3303cb){var _0x23cb05={};_0x23cb05[_0x3303cb]={'$like':'%'+_0x18d4f4[_0x75b1('0x30')]['filter']+'%'};return _0x23cb05;})});}_0x2a17e4=_[_0x75b1('0x3b')]({},_0x2a17e4,_0x18d4f4[_0x75b1('0x3d')]);return _0x3e814d[_0x75b1('0x48')](_0x2a17e4);}})[_0x75b1('0x21')](function(_0x15dcbf){if(_0x15dcbf){_0x303c9f=_0x15dcbf[_0x75b1('0x44')];if(!_0x18d4f4[_0x75b1('0x30')][_0x75b1('0x35')](_0x75b1('0x36'))){_0x2a17e4[_0x75b1('0x18')]=qs[_0x75b1('0x18')](_0x18d4f4[_0x75b1('0x30')][_0x75b1('0x18')]);_0x2a17e4['offset']=qs[_0x75b1('0x1a')](_0x18d4f4[_0x75b1('0x30')][_0x75b1('0x1a')]);}return _0x3e814d[_0x75b1('0x48')](_0x2a17e4);}})[_0x75b1('0x21')](function(_0xb3d669){if(_0xb3d669){return _0xb3d669?{'count':_0x303c9f,'rows':_0xb3d669}:null;}})[_0x75b1('0x21')](respondWithResult(_0x53571b,null))[_0x75b1('0x41')](handleError(_0x53571b,null));};exports[_0x75b1('0x4b')]=function(_0x10a9a7,_0x284d46,_0x13dfd7){var _0x516ee4={};var _0x43c957={};var _0x4ee993;var _0x28bd14;return db[_0x75b1('0x28')][_0x75b1('0x4c')]({'where':{'id':_0x10a9a7[_0x75b1('0x43')]['id']}})[_0x75b1('0x21')](handleEntityNotFound(_0x284d46,null))[_0x75b1('0x21')](function(_0x13f33a){if(_0x13f33a){_0x4ee993=_0x13f33a;_0x43c957[_0x75b1('0x2d')]=_[_0x75b1('0x2f')](db['FreshsalesField'][_0x75b1('0x29')]);_0x43c957['query']=_[_0x75b1('0x2f')](_0x10a9a7['query']);_0x43c957[_0x75b1('0x31')]=_[_0x75b1('0x32')](_0x43c957[_0x75b1('0x2d')],_0x43c957[_0x75b1('0x30')]);_0x516ee4[_0x75b1('0x34')]=_['intersection'](_0x43c957[_0x75b1('0x2d')],qs['fields'](_0x10a9a7[_0x75b1('0x30')][_0x75b1('0x33')]));_0x516ee4[_0x75b1('0x34')]=_0x516ee4[_0x75b1('0x34')][_0x75b1('0x44')]?_0x516ee4[_0x75b1('0x34')]:_0x43c957[_0x75b1('0x2d')];_0x516ee4['order']=qs[_0x75b1('0x38')](_0x10a9a7[_0x75b1('0x30')][_0x75b1('0x38')]);_0x516ee4[_0x75b1('0x39')]=qs[_0x75b1('0x31')](_[_0x75b1('0x4a')](_0x10a9a7[_0x75b1('0x30')],_0x43c957[_0x75b1('0x31')]));if(_0x10a9a7[_0x75b1('0x30')][_0x75b1('0x3a')]){_0x516ee4['where']=_[_0x75b1('0x3b')](_0x516ee4[_0x75b1('0x39')],{'$or':_[_0x75b1('0x2e')](_0x516ee4['attributes'],function(_0x32224e){var _0x2ab494={};_0x2ab494[_0x32224e]={'$like':'%'+_0x10a9a7[_0x75b1('0x30')][_0x75b1('0x3a')]+'%'};return _0x2ab494;})});}_0x516ee4=_[_0x75b1('0x3b')]({},_0x516ee4,_0x10a9a7[_0x75b1('0x3d')]);return _0x4ee993[_0x75b1('0x4b')](_0x516ee4);}})[_0x75b1('0x21')](function(_0x51b3ee){if(_0x51b3ee){_0x28bd14=_0x51b3ee[_0x75b1('0x44')];if(!_0x10a9a7[_0x75b1('0x30')][_0x75b1('0x35')](_0x75b1('0x36'))){_0x516ee4[_0x75b1('0x18')]=qs[_0x75b1('0x18')](_0x10a9a7[_0x75b1('0x30')]['limit']);_0x516ee4[_0x75b1('0x1a')]=qs[_0x75b1('0x1a')](_0x10a9a7[_0x75b1('0x30')][_0x75b1('0x1a')]);}return _0x4ee993[_0x75b1('0x4b')](_0x516ee4);}})[_0x75b1('0x21')](function(_0x25d688){if(_0x25d688){return _0x25d688?{'count':_0x28bd14,'rows':_0x25d688}:null;}})[_0x75b1('0x21')](respondWithResult(_0x284d46,null))[_0x75b1('0x41')](handleError(_0x284d46,null));};exports['getFields']=function(_0x4f01d3,_0x2290f8,_0x1c7215){var _0x355878={};var _0x3b6fea={};var _0x2f5d0c;var _0x9d74d9;return db[_0x75b1('0x28')]['findOne']({'where':{'id':_0x4f01d3[_0x75b1('0x43')]['id']}})[_0x75b1('0x21')](handleEntityNotFound(_0x2290f8,null))[_0x75b1('0x21')](function(_0x175570){if(_0x175570){_0x2f5d0c=_0x175570;_0x3b6fea['model']=_[_0x75b1('0x2f')](db[_0x75b1('0x49')][_0x75b1('0x29')]);_0x3b6fea[_0x75b1('0x30')]=_[_0x75b1('0x2f')](_0x4f01d3[_0x75b1('0x30')]);_0x3b6fea[_0x75b1('0x31')]=_[_0x75b1('0x32')](_0x3b6fea['model'],_0x3b6fea['query']);_0x355878[_0x75b1('0x34')]=_['intersection'](_0x3b6fea[_0x75b1('0x2d')],qs[_0x75b1('0x33')](_0x4f01d3[_0x75b1('0x30')][_0x75b1('0x33')]));_0x355878['attributes']=_0x355878[_0x75b1('0x34')]['length']?_0x355878[_0x75b1('0x34')]:_0x3b6fea[_0x75b1('0x2d')];_0x355878[_0x75b1('0x37')]=qs[_0x75b1('0x38')](_0x4f01d3[_0x75b1('0x30')]['sort']);_0x355878[_0x75b1('0x39')]=qs[_0x75b1('0x31')](_['pick'](_0x4f01d3[_0x75b1('0x30')],_0x3b6fea[_0x75b1('0x31')]));if(_0x4f01d3[_0x75b1('0x30')][_0x75b1('0x3a')]){_0x355878[_0x75b1('0x39')]=_['merge'](_0x355878[_0x75b1('0x39')],{'$or':_['map'](_0x355878[_0x75b1('0x34')],function(_0x3b7426){var _0x1e6bdf={};_0x1e6bdf[_0x3b7426]={'$like':'%'+_0x4f01d3[_0x75b1('0x30')][_0x75b1('0x3a')]+'%'};return _0x1e6bdf;})});}_0x355878=_[_0x75b1('0x3b')]({},_0x355878,_0x4f01d3[_0x75b1('0x3d')]);return _0x2f5d0c[_0x75b1('0x4d')](_0x355878);}})['then'](function(_0x6bd58a){if(_0x6bd58a){_0x9d74d9=_0x6bd58a[_0x75b1('0x44')];if(!_0x4f01d3[_0x75b1('0x30')][_0x75b1('0x35')](_0x75b1('0x36'))){_0x355878[_0x75b1('0x18')]=qs['limit'](_0x4f01d3[_0x75b1('0x30')][_0x75b1('0x18')]);_0x355878['offset']=qs[_0x75b1('0x1a')](_0x4f01d3[_0x75b1('0x30')][_0x75b1('0x1a')]);}return _0x2f5d0c[_0x75b1('0x4d')](_0x355878);}})[_0x75b1('0x21')](function(_0x3887c5){if(_0x3887c5){return _0x3887c5?{'count':_0x9d74d9,'rows':_0x3887c5}:null;}})[_0x75b1('0x21')](respondWithResult(_0x2290f8,null))[_0x75b1('0x41')](handleError(_0x2290f8,null));};
\ No newline at end of file
index 91496be..2757ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb137=['path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','lodash','moment','bluebird','request-promise'];(function(_0x410a3c,_0x25817e){var _0x55f1b1=function(_0xa1b748){while(--_0xa1b748){_0x410a3c['push'](_0x410a3c['shift']());}};_0x55f1b1(++_0x25817e);}(_0xb137,0x13c));var _0x7b13=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0xb137[_0x3bd52b];return _0x1e5b89;};'use strict';var _=require(_0x7b13('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7b13('0x1'));var BPromise=require(_0x7b13('0x2'));var rp=require(_0x7b13('0x3'));var fs=require('fs');var path=require(_0x7b13('0x4'));var rimraf=require(_0x7b13('0x5'));var config=require(_0x7b13('0x6'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x7b13('0x7')]=function(_0x6b2dc9,_0x46b6b9){return _0x6b2dc9[_0x7b13('0x8')](_0x7b13('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2add=['FreshsalesConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x2f5677,_0x570730){var _0x1f4c72=function(_0x2feffa){while(--_0x2feffa){_0x2f5677['push'](_0x2f5677['shift']());}};_0x1f4c72(++_0x570730);}(_0x2add,0xeb));var _0xd2ad=function(_0x3d7da2,_0x46f1ff){_0x3d7da2=_0x3d7da2-0x0;var _0x3bf4c7=_0x2add[_0x3d7da2];return _0x3bf4c7;};'use strict';var _=require(_0xd2ad('0x0'));var util=require(_0xd2ad('0x1'));var logger=require(_0xd2ad('0x2'))(_0xd2ad('0x3'));var moment=require(_0xd2ad('0x4'));var BPromise=require(_0xd2ad('0x5'));var rp=require(_0xd2ad('0x6'));var fs=require('fs');var path=require(_0xd2ad('0x7'));var rimraf=require(_0xd2ad('0x8'));var config=require('../../config/environment');var attributes=require(_0xd2ad('0x9'));module[_0xd2ad('0xa')]=function(_0x14093d,_0x971bc0){return _0x14093d[_0xd2ad('0xb')](_0xd2ad('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 03f6837..7b2bd34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd01=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x5179cc,_0x393d4a){var _0x5e9b0c=function(_0x3aeedb){while(--_0x3aeedb){_0x5179cc['push'](_0x5179cc['shift']());}};_0x5e9b0c(++_0x393d4a);}(_0xdd01,0x1e0));var _0x1dd0=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xdd01[_0x24f31b];return _0x488401;};'use strict';var _=require('lodash');var util=require(_0x1dd0('0x0'));var moment=require('moment');var BPromise=require(_0x1dd0('0x1'));var rs=require(_0x1dd0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dd0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dd0('0x4'))(_0x1dd0('0x5'));var config=require(_0x1dd0('0x6'));var jayson=require(_0x1dd0('0x7'));var client=jayson[_0x1dd0('0x8')][_0x1dd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x266742,_0x39f01b,_0x3949b0){return new BPromise(function(_0x1247a2,_0x44e864){return client[_0x1dd0('0xa')](_0x266742,_0x3949b0)['then'](function(_0x3f6714){logger[_0x1dd0('0xb')](_0x1dd0('0xc'),_0x39f01b,_0x1dd0('0xd'));logger[_0x1dd0('0xe')](_0x1dd0('0xf'),_0x39f01b,'request\x20sent',JSON[_0x1dd0('0x10')](_0x3f6714));if(_0x3f6714[_0x1dd0('0x11')]){if(_0x3f6714[_0x1dd0('0x11')][_0x1dd0('0x12')]===0x1f4){logger['error'](_0x1dd0('0xc'),_0x39f01b,_0x3f6714[_0x1dd0('0x11')][_0x1dd0('0x13')]);return _0x44e864(_0x3f6714[_0x1dd0('0x11')][_0x1dd0('0x13')]);}logger['error'](_0x1dd0('0xc'),_0x39f01b,_0x3f6714[_0x1dd0('0x11')][_0x1dd0('0x13')]);return _0x1247a2(_0x3f6714['error'][_0x1dd0('0x13')]);}else{logger['info'](_0x1dd0('0xc'),_0x39f01b,'request\x20sent');_0x1247a2(_0x3f6714[_0x1dd0('0x14')][_0x1dd0('0x13')]);}})[_0x1dd0('0x15')](function(_0x1ac96e){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x39f01b,_0x1ac96e);_0x44e864(_0x1ac96e);});});}
\ No newline at end of file
+var _0x9671=['http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x576914,_0x4f6861){var _0x393184=function(_0x5c4236){while(--_0x5c4236){_0x576914['push'](_0x576914['shift']());}};_0x393184(++_0x4f6861);}(_0x9671,0x1b2));var _0x1967=function(_0x13319e,_0x383335){_0x13319e=_0x13319e-0x0;var _0x30b027=_0x9671[_0x13319e];return _0x30b027;};'use strict';var _=require(_0x1967('0x0'));var util=require('util');var moment=require(_0x1967('0x1'));var BPromise=require('bluebird');var rs=require(_0x1967('0x2'));var fs=require('fs');var Redis=require(_0x1967('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1967('0x4'));var logger=require('../../config/logger')(_0x1967('0x5'));var config=require('../../config/environment');var jayson=require(_0x1967('0x6'));var client=jayson['client'][_0x1967('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4812f2,_0x49e542,_0x487a26){return new BPromise(function(_0x15d2f1,_0x1b81f9){return client[_0x1967('0x8')](_0x4812f2,_0x487a26)[_0x1967('0x9')](function(_0x3a2c14){logger[_0x1967('0xa')](_0x1967('0xb'),_0x49e542,_0x1967('0xc'));logger[_0x1967('0xd')](_0x1967('0xe'),_0x49e542,'request\x20sent',JSON[_0x1967('0xf')](_0x3a2c14));if(_0x3a2c14['error']){if(_0x3a2c14[_0x1967('0x10')][_0x1967('0x11')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x49e542,_0x3a2c14[_0x1967('0x10')][_0x1967('0x12')]);return _0x1b81f9(_0x3a2c14[_0x1967('0x10')][_0x1967('0x12')]);}logger[_0x1967('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x49e542,_0x3a2c14[_0x1967('0x10')][_0x1967('0x12')]);return _0x15d2f1(_0x3a2c14['error']['message']);}else{logger['info'](_0x1967('0xb'),_0x49e542,_0x1967('0xc'));_0x15d2f1(_0x3a2c14[_0x1967('0x13')][_0x1967('0x12')]);}})[_0x1967('0x14')](function(_0x115895){logger[_0x1967('0x10')](_0x1967('0xb'),_0x49e542,_0x115895);_0x1b81f9(_0x115895);});});}
\ No newline at end of file
index dd9a958..db7b818 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a55=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','path'];(function(_0x33c32a,_0x2143db){var _0x221571=function(_0x253f42){while(--_0x253f42){_0x33c32a['push'](_0x33c32a['shift']());}};_0x221571(++_0x2143db);}(_0x6a55,0x154));var _0x56a5=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x6a55[_0x4eb6ec];return _0x58881b;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require(_0x56a5('0x1'));var timeout=require(_0x56a5('0x2'));var express=require('express');var router=express[_0x56a5('0x3')]();var fs_extra=require(_0x56a5('0x4'));var auth=require(_0x56a5('0x5'));var interaction=require(_0x56a5('0x6'));var config=require(_0x56a5('0x7'));var controller=require(_0x56a5('0x8'));router[_0x56a5('0x9')]('/',auth[_0x56a5('0xa')](),controller[_0x56a5('0xb')]);router[_0x56a5('0x9')](_0x56a5('0xc'),auth[_0x56a5('0xa')](),controller[_0x56a5('0xd')]);router[_0x56a5('0xe')]('/',auth['isAuthenticated'](),controller[_0x56a5('0xf')]);router[_0x56a5('0x10')]('/:id',auth[_0x56a5('0xa')](),controller['update']);router['delete'](_0x56a5('0xc'),auth[_0x56a5('0xa')](),controller[_0x56a5('0x11')]);module[_0x56a5('0x12')]=router;
\ No newline at end of file
+var _0xd353=['multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1a3ee2,_0x2194f0){var _0x1e729f=function(_0x9d6846){while(--_0x9d6846){_0x1a3ee2['push'](_0x1a3ee2['shift']());}};_0x1e729f(++_0x2194f0);}(_0xd353,0x7e));var _0x3d35=function(_0x3c6799,_0x55a34c){_0x3c6799=_0x3c6799-0x0;var _0xd75d86=_0xd353[_0x3c6799];return _0xd75d86;};'use strict';var multer=require(_0x3d35('0x0'));var util=require(_0x3d35('0x1'));var path=require('path');var timeout=require(_0x3d35('0x2'));var express=require(_0x3d35('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3d35('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3d35('0x5'));var controller=require(_0x3d35('0x6'));router[_0x3d35('0x7')]('/',auth[_0x3d35('0x8')](),controller[_0x3d35('0x9')]);router[_0x3d35('0x7')](_0x3d35('0xa'),auth['isAuthenticated'](),controller[_0x3d35('0xb')]);router[_0x3d35('0xc')]('/',auth[_0x3d35('0x8')](),controller[_0x3d35('0xd')]);router[_0x3d35('0xe')](_0x3d35('0xa'),auth[_0x3d35('0x8')](),controller[_0x3d35('0xf')]);router[_0x3d35('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3d35('0x11')]);module['exports']=router;
\ No newline at end of file
index 9cbc1d0..f76588f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x105b=['sequelize','string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN'];(function(_0x129959,_0x33083d){var _0x2279f5=function(_0x46cefa){while(--_0x46cefa){_0x129959['push'](_0x129959['shift']());}};_0x2279f5(++_0x33083d);}(_0x105b,0x183));var _0xb105=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x105b[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0xb105('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xb105('0x1'),_0xb105('0x2'),_0xb105('0x3'),_0xb105('0x4'),_0xb105('0x5')),'defaultValue':_0xb105('0x1')},'content':{'type':Sequelize[_0xb105('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb105('0x7')](_0xb105('0x1'),_0xb105('0x2'),_0xb105('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb105('0x6')]},'nameField':{'type':Sequelize[_0xb105('0x6')]},'customField':{'type':Sequelize[_0xb105('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x64a9=['picklist','STRING','string','customVariable','BOOLEAN','sequelize','exports','variable','keyValue'];(function(_0x252d51,_0x1774e3){var _0x43fa9c=function(_0x192078){while(--_0x192078){_0x252d51['push'](_0x252d51['shift']());}};_0x43fa9c(++_0x1774e3);}(_0x64a9,0x1ac));var _0x964a=function(_0x1a7348,_0x1b95bf){_0x1a7348=_0x1a7348-0x0;var _0x238890=_0x64a9[_0x1a7348];return _0x238890;};'use strict';var Sequelize=require(_0x964a('0x0'));module[_0x964a('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x964a('0x2'),'customVariable',_0x964a('0x3'),_0x964a('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x964a('0x5')]},'key':{'type':Sequelize[_0x964a('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x964a('0x6'),_0x964a('0x2'),_0x964a('0x7'))},'keyContent':{'type':Sequelize[_0x964a('0x5')]},'idField':{'type':Sequelize[_0x964a('0x5')]},'nameField':{'type':Sequelize[_0x964a('0x5')]},'customField':{'type':Sequelize[_0x964a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e36da48..900085c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb55d=['find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','fields','include','catch','create','body','update'];(function(_0x1845e0,_0x312b1c){var _0x47f865=function(_0x500795){while(--_0x500795){_0x1845e0['push'](_0x1845e0['shift']());}};_0x47f865(++_0x312b1c);}(_0xb55d,0x12e));var _0xdb55=function(_0xf621fe,_0x5d380b){_0xf621fe=_0xf621fe-0x0;var _0x1696f5=_0xb55d[_0xf621fe];return _0x1696f5;};'use strict';var emlformat=require(_0xdb55('0x0'));var rimraf=require(_0xdb55('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb55('0x2'));var rp=require(_0xdb55('0x3'));var moment=require(_0xdb55('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdb55('0x5'));var util=require(_0xdb55('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdb55('0x7'));var ejs=require(_0xdb55('0x8'));var fs=require('fs');var fs_extra=require(_0xdb55('0x9'));var _=require('lodash');var squel=require(_0xdb55('0xa'));var crypto=require('crypto');var jsforce=require(_0xdb55('0xb'));var deskjs=require(_0xdb55('0xc'));var toCsv=require(_0xdb55('0x7'));var querystring=require(_0xdb55('0xd'));var Papa=require(_0xdb55('0xe'));var Redis=require(_0xdb55('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdb55('0x10'));var hardwareService=require(_0xdb55('0x11'));var logger=require(_0xdb55('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xdb55('0x13'));var licenseUtil=require(_0xdb55('0x14'));var db=require(_0xdb55('0x15'))['db'];function respondWithStatusCode(_0xcd327a,_0x451cd9){_0x451cd9=_0x451cd9||0xcc;return function(_0x2c17d4){if(_0x2c17d4){return _0xcd327a[_0xdb55('0x16')](_0x451cd9);}return _0xcd327a[_0xdb55('0x17')](_0x451cd9)['end']();};}function respondWithResult(_0xe1c645,_0x469f52){_0x469f52=_0x469f52||0xc8;return function(_0x5974e4){if(_0x5974e4){return _0xe1c645[_0xdb55('0x17')](_0x469f52)[_0xdb55('0x18')](_0x5974e4);}};}function respondWithFilteredResult(_0x2f6935,_0x1ec468){return function(_0x174043){if(_0x174043){var _0xb1cdc1=typeof _0x1ec468[_0xdb55('0x19')]===_0xdb55('0x1a')&&typeof _0x1ec468['limit']===_0xdb55('0x1a');var _0x220992=_0x174043['count'];var _0x5db212=_0xb1cdc1?0x0:_0x1ec468['offset'];var _0x3ca892=_0xb1cdc1?_0x174043[_0xdb55('0x1b')]:_0x1ec468[_0xdb55('0x19')]+_0x1ec468[_0xdb55('0x1c')];var _0x55cdac;if(_0x3ca892>=_0x220992){_0x3ca892=_0x220992;_0x55cdac=0xc8;}else{_0x55cdac=0xce;}_0x2f6935[_0xdb55('0x17')](_0x55cdac);return _0x2f6935['set'](_0xdb55('0x1d'),_0x5db212+'-'+_0x3ca892+'/'+_0x220992)['json'](_0x174043);}return null;};}function patchUpdates(_0x23e3df){return function(_0x1a5a27){try{jsonpatch[_0xdb55('0x1e')](_0x1a5a27,_0x23e3df,!![]);}catch(_0x36c867){return BPromise[_0xdb55('0x1f')](_0x36c867);}return _0x1a5a27[_0xdb55('0x20')]();};}function saveUpdates(_0x52f537,_0x1e7911){return function(_0xea58f){if(_0xea58f){return _0xea58f['update'](_0x52f537)[_0xdb55('0x21')](function(_0x2ad971){return _0x2ad971;});}return null;};}function removeEntity(_0x48c0d9,_0x1fc96d){return function(_0x55c61a){if(_0x55c61a){return _0x55c61a['destroy']()['then'](function(){_0x48c0d9[_0xdb55('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x354508,_0x5fd456){return function(_0x33f5cf){if(!_0x33f5cf){_0x354508[_0xdb55('0x16')](0x194);}return _0x33f5cf;};}function handleError(_0x14863d,_0x2bd7ca){_0x2bd7ca=_0x2bd7ca||0x1f4;return function(_0x3a8ffe){logger[_0xdb55('0x22')](_0x3a8ffe[_0xdb55('0x23')]);if(_0x3a8ffe['name']){delete _0x3a8ffe[_0xdb55('0x24')];}_0x14863d[_0xdb55('0x17')](_0x2bd7ca)[_0xdb55('0x25')](_0x3a8ffe);};}exports[_0xdb55('0x26')]=function(_0x5a4aa5,_0x2e2486){var _0x5d4dac={},_0x43e63d={},_0x17adfe={'count':0x0,'rows':[]};var _0x3d096b=_[_0xdb55('0x27')](db[_0xdb55('0x28')][_0xdb55('0x29')],function(_0x27989e){return{'name':_0x27989e[_0xdb55('0x2a')],'type':_0x27989e[_0xdb55('0x2b')][_0xdb55('0x2c')]};});_0x43e63d['model']=_[_0xdb55('0x27')](_0x3d096b,'name');_0x43e63d[_0xdb55('0x2d')]=_[_0xdb55('0x2e')](_0x5a4aa5[_0xdb55('0x2d')]);_0x43e63d[_0xdb55('0x2f')]=_[_0xdb55('0x30')](_0x43e63d[_0xdb55('0x31')],_0x43e63d[_0xdb55('0x2d')]);_0x5d4dac[_0xdb55('0x32')]=_[_0xdb55('0x30')](_0x43e63d[_0xdb55('0x31')],qs['fields'](_0x5a4aa5[_0xdb55('0x2d')]['fields']));_0x5d4dac[_0xdb55('0x32')]=_0x5d4dac['attributes'][_0xdb55('0x33')]?_0x5d4dac[_0xdb55('0x32')]:_0x43e63d['model'];if(!_0x5a4aa5[_0xdb55('0x2d')][_0xdb55('0x34')](_0xdb55('0x35'))){_0x5d4dac[_0xdb55('0x1c')]=qs[_0xdb55('0x1c')](_0x5a4aa5[_0xdb55('0x2d')][_0xdb55('0x1c')]);_0x5d4dac['offset']=qs[_0xdb55('0x19')](_0x5a4aa5['query'][_0xdb55('0x19')]);}_0x5d4dac[_0xdb55('0x36')]=qs[_0xdb55('0x37')](_0x5a4aa5[_0xdb55('0x2d')][_0xdb55('0x37')]);_0x5d4dac[_0xdb55('0x38')]=qs[_0xdb55('0x2f')](_[_0xdb55('0x39')](_0x5a4aa5[_0xdb55('0x2d')],_0x43e63d['filters']),_0x3d096b);if(_0x5a4aa5[_0xdb55('0x2d')][_0xdb55('0x3a')]){_0x5d4dac['where']=_[_0xdb55('0x3b')](_0x5d4dac[_0xdb55('0x38')],{'$or':_[_0xdb55('0x27')](_0x3d096b,function(_0x597e0c){if(_0x597e0c['type']!==_0xdb55('0x3c')){var _0x2d0a28={};_0x2d0a28[_0x597e0c[_0xdb55('0x24')]]={'$like':'%'+_0x5a4aa5[_0xdb55('0x2d')][_0xdb55('0x3a')]+'%'};return _0x2d0a28;}})});}_0x5d4dac=_[_0xdb55('0x3b')]({},_0x5d4dac,_0x5a4aa5[_0xdb55('0x3d')]);var _0xcb94ff={'where':_0x5d4dac[_0xdb55('0x38')]};return db['FreshsalesField']['count'](_0xcb94ff)['then'](function(_0x4638df){_0x17adfe['count']=_0x4638df;if(_0x5a4aa5['query'][_0xdb55('0x3e')]){_0x5d4dac['include']=[{'all':!![]}];}return db['FreshsalesField'][_0xdb55('0x3f')](_0x5d4dac);})[_0xdb55('0x21')](function(_0x36f047){_0x17adfe[_0xdb55('0x40')]=_0x36f047;return _0x17adfe;})['then'](respondWithFilteredResult(_0x2e2486,_0x5d4dac))['catch'](handleError(_0x2e2486,null));};exports[_0xdb55('0x41')]=function(_0x125b09,_0xee8208){var _0x27c960={'raw':!![],'where':{'id':_0x125b09[_0xdb55('0x42')]['id']}},_0x5bfd06={};_0x5bfd06[_0xdb55('0x31')]=_[_0xdb55('0x2e')](db[_0xdb55('0x28')][_0xdb55('0x29')]);_0x5bfd06[_0xdb55('0x2d')]=_[_0xdb55('0x2e')](_0x125b09[_0xdb55('0x2d')]);_0x5bfd06[_0xdb55('0x2f')]=_[_0xdb55('0x30')](_0x5bfd06[_0xdb55('0x31')],_0x5bfd06['query']);_0x27c960['attributes']=_[_0xdb55('0x30')](_0x5bfd06[_0xdb55('0x31')],qs[_0xdb55('0x43')](_0x125b09[_0xdb55('0x2d')][_0xdb55('0x43')]));_0x27c960[_0xdb55('0x32')]=_0x27c960[_0xdb55('0x32')][_0xdb55('0x33')]?_0x27c960['attributes']:_0x5bfd06[_0xdb55('0x31')];if(_0x125b09[_0xdb55('0x2d')][_0xdb55('0x3e')]){_0x27c960[_0xdb55('0x44')]=[{'all':!![]}];}_0x27c960=_[_0xdb55('0x3b')]({},_0x27c960,_0x125b09[_0xdb55('0x3d')]);return db['FreshsalesField']['find'](_0x27c960)[_0xdb55('0x21')](handleEntityNotFound(_0xee8208,null))[_0xdb55('0x21')](respondWithResult(_0xee8208,null))[_0xdb55('0x45')](handleError(_0xee8208,null));};exports['create']=function(_0x111f85,_0x3f6b05){return db['FreshsalesField'][_0xdb55('0x46')](_0x111f85[_0xdb55('0x47')],{})[_0xdb55('0x21')](respondWithResult(_0x3f6b05,0xc9))[_0xdb55('0x45')](handleError(_0x3f6b05,null));};exports[_0xdb55('0x48')]=function(_0x44bbf6,_0x50062a){if(_0x44bbf6['body']['id']){delete _0x44bbf6[_0xdb55('0x47')]['id'];}return db[_0xdb55('0x28')][_0xdb55('0x49')]({'where':{'id':_0x44bbf6[_0xdb55('0x42')]['id']}})[_0xdb55('0x21')](handleEntityNotFound(_0x50062a,null))['then'](saveUpdates(_0x44bbf6[_0xdb55('0x47')],null))[_0xdb55('0x21')](respondWithResult(_0x50062a,null))['catch'](handleError(_0x50062a,null));};exports[_0xdb55('0x4a')]=function(_0xf479b1,_0x53bb7e){return db['FreshsalesField'][_0xdb55('0x49')]({'where':{'id':_0xf479b1[_0xdb55('0x42')]['id']}})[_0xdb55('0x21')](handleEntityNotFound(_0x53bb7e,null))[_0xdb55('0x21')](removeEntity(_0x53bb7e,null))[_0xdb55('0x45')](handleError(_0x53bb7e,null));};
\ No newline at end of file
+var _0x4beb=['save','then','destroy','name','index','map','fieldName','key','model','query','intersection','attributes','length','hasOwnProperty','sort','where','pick','filters','type','VIRTUAL','FreshsalesField','includeAll','findAll','catch','show','params','keys','rawAttributes','fields','merge','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','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','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0x4beb,0x66));var _0xb4be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4beb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb4be('0x0'));var rimraf=require(_0xb4be('0x1'));var zipdir=require(_0xb4be('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4be('0x3'));var moment=require('moment');var BPromise=require(_0xb4be('0x4'));var Mustache=require(_0xb4be('0x5'));var util=require(_0xb4be('0x6'));var path=require(_0xb4be('0x7'));var sox=require(_0xb4be('0x8'));var csv=require('to-csv');var ejs=require(_0xb4be('0x9'));var fs=require('fs');var fs_extra=require(_0xb4be('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb4be('0xb'));var jsforce=require(_0xb4be('0xc'));var deskjs=require(_0xb4be('0xd'));var toCsv=require(_0xb4be('0xe'));var querystring=require(_0xb4be('0xf'));var Papa=require(_0xb4be('0x10'));var Redis=require('ioredis');var authService=require(_0xb4be('0x11'));var qs=require(_0xb4be('0x12'));var as=require(_0xb4be('0x13'));var hardwareService=require(_0xb4be('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb4be('0x15'));var config=require(_0xb4be('0x16'));var licenseUtil=require(_0xb4be('0x17'));var db=require(_0xb4be('0x18'))['db'];function respondWithStatusCode(_0x55180c,_0x446c67){_0x446c67=_0x446c67||0xcc;return function(_0xd74e2b){if(_0xd74e2b){return _0x55180c[_0xb4be('0x19')](_0x446c67);}return _0x55180c[_0xb4be('0x1a')](_0x446c67)[_0xb4be('0x1b')]();};}function respondWithResult(_0x2b7b97,_0x5ba723){_0x5ba723=_0x5ba723||0xc8;return function(_0x21d648){if(_0x21d648){return _0x2b7b97['status'](_0x5ba723)[_0xb4be('0x1c')](_0x21d648);}};}function respondWithFilteredResult(_0x16ee19,_0x591e7a){return function(_0x5be860){if(_0x5be860){var _0x584fa2=typeof _0x591e7a[_0xb4be('0x1d')]==='undefined'&&typeof _0x591e7a[_0xb4be('0x1e')]==='undefined';var _0x500438=_0x5be860['count'];var _0x5a794a=_0x584fa2?0x0:_0x591e7a[_0xb4be('0x1d')];var _0x5464e6=_0x584fa2?_0x5be860[_0xb4be('0x1f')]:_0x591e7a[_0xb4be('0x1d')]+_0x591e7a[_0xb4be('0x1e')];var _0x24df40;if(_0x5464e6>=_0x500438){_0x5464e6=_0x500438;_0x24df40=0xc8;}else{_0x24df40=0xce;}_0x16ee19['status'](_0x24df40);return _0x16ee19[_0xb4be('0x20')](_0xb4be('0x21'),_0x5a794a+'-'+_0x5464e6+'/'+_0x500438)[_0xb4be('0x1c')](_0x5be860);}return null;};}function patchUpdates(_0x44b5d6){return function(_0x13ae59){try{jsonpatch[_0xb4be('0x22')](_0x13ae59,_0x44b5d6,!![]);}catch(_0x30c611){return BPromise[_0xb4be('0x23')](_0x30c611);}return _0x13ae59[_0xb4be('0x24')]();};}function saveUpdates(_0x39afca,_0x453420){return function(_0x3a1e42){if(_0x3a1e42){return _0x3a1e42['update'](_0x39afca)[_0xb4be('0x25')](function(_0xa59ca6){return _0xa59ca6;});}return null;};}function removeEntity(_0x5e3b5d,_0x3c6b51){return function(_0x9826cb){if(_0x9826cb){return _0x9826cb[_0xb4be('0x26')]()['then'](function(){_0x5e3b5d[_0xb4be('0x1a')](0xcc)[_0xb4be('0x1b')]();});}};}function handleEntityNotFound(_0x389d47,_0xd5395b){return function(_0x214d4f){if(!_0x214d4f){_0x389d47[_0xb4be('0x19')](0x194);}return _0x214d4f;};}function handleError(_0xf7156,_0x339857){_0x339857=_0x339857||0x1f4;return function(_0x16c8a4){logger['error'](_0x16c8a4['stack']);if(_0x16c8a4[_0xb4be('0x27')]){delete _0x16c8a4[_0xb4be('0x27')];}_0xf7156[_0xb4be('0x1a')](_0x339857)['send'](_0x16c8a4);};}exports[_0xb4be('0x28')]=function(_0x3c70e1,_0x17215a){var _0x65a510={},_0x1aa6c2={},_0x42872a={'count':0x0,'rows':[]};var _0x1d2814=_[_0xb4be('0x29')](db['FreshsalesField']['rawAttributes'],function(_0x160aa2){return{'name':_0x160aa2[_0xb4be('0x2a')],'type':_0x160aa2['type'][_0xb4be('0x2b')]};});_0x1aa6c2[_0xb4be('0x2c')]=_[_0xb4be('0x29')](_0x1d2814,_0xb4be('0x27'));_0x1aa6c2[_0xb4be('0x2d')]=_['keys'](_0x3c70e1['query']);_0x1aa6c2['filters']=_[_0xb4be('0x2e')](_0x1aa6c2[_0xb4be('0x2c')],_0x1aa6c2[_0xb4be('0x2d')]);_0x65a510[_0xb4be('0x2f')]=_['intersection'](_0x1aa6c2[_0xb4be('0x2c')],qs['fields'](_0x3c70e1['query']['fields']));_0x65a510[_0xb4be('0x2f')]=_0x65a510[_0xb4be('0x2f')][_0xb4be('0x30')]?_0x65a510['attributes']:_0x1aa6c2[_0xb4be('0x2c')];if(!_0x3c70e1[_0xb4be('0x2d')][_0xb4be('0x31')]('nolimit')){_0x65a510[_0xb4be('0x1e')]=qs[_0xb4be('0x1e')](_0x3c70e1[_0xb4be('0x2d')][_0xb4be('0x1e')]);_0x65a510['offset']=qs['offset'](_0x3c70e1[_0xb4be('0x2d')][_0xb4be('0x1d')]);}_0x65a510['order']=qs[_0xb4be('0x32')](_0x3c70e1[_0xb4be('0x2d')]['sort']);_0x65a510[_0xb4be('0x33')]=qs['filters'](_[_0xb4be('0x34')](_0x3c70e1[_0xb4be('0x2d')],_0x1aa6c2[_0xb4be('0x35')]),_0x1d2814);if(_0x3c70e1[_0xb4be('0x2d')]['filter']){_0x65a510[_0xb4be('0x33')]=_['merge'](_0x65a510['where'],{'$or':_[_0xb4be('0x29')](_0x1d2814,function(_0x57a597){if(_0x57a597[_0xb4be('0x36')]!==_0xb4be('0x37')){var _0x5d8a7e={};_0x5d8a7e[_0x57a597[_0xb4be('0x27')]]={'$like':'%'+_0x3c70e1[_0xb4be('0x2d')]['filter']+'%'};return _0x5d8a7e;}})});}_0x65a510=_['merge']({},_0x65a510,_0x3c70e1['options']);var _0x178297={'where':_0x65a510[_0xb4be('0x33')]};return db[_0xb4be('0x38')][_0xb4be('0x1f')](_0x178297)[_0xb4be('0x25')](function(_0x5614fa){_0x42872a[_0xb4be('0x1f')]=_0x5614fa;if(_0x3c70e1[_0xb4be('0x2d')][_0xb4be('0x39')]){_0x65a510['include']=[{'all':!![]}];}return db[_0xb4be('0x38')][_0xb4be('0x3a')](_0x65a510);})[_0xb4be('0x25')](function(_0x1a1328){_0x42872a['rows']=_0x1a1328;return _0x42872a;})[_0xb4be('0x25')](respondWithFilteredResult(_0x17215a,_0x65a510))[_0xb4be('0x3b')](handleError(_0x17215a,null));};exports[_0xb4be('0x3c')]=function(_0x2c3d2,_0x447e89){var _0x288926={'raw':!![],'where':{'id':_0x2c3d2[_0xb4be('0x3d')]['id']}},_0x8dd376={};_0x8dd376[_0xb4be('0x2c')]=_[_0xb4be('0x3e')](db[_0xb4be('0x38')][_0xb4be('0x3f')]);_0x8dd376[_0xb4be('0x2d')]=_[_0xb4be('0x3e')](_0x2c3d2[_0xb4be('0x2d')]);_0x8dd376[_0xb4be('0x35')]=_[_0xb4be('0x2e')](_0x8dd376[_0xb4be('0x2c')],_0x8dd376[_0xb4be('0x2d')]);_0x288926['attributes']=_[_0xb4be('0x2e')](_0x8dd376['model'],qs[_0xb4be('0x40')](_0x2c3d2[_0xb4be('0x2d')]['fields']));_0x288926[_0xb4be('0x2f')]=_0x288926['attributes'][_0xb4be('0x30')]?_0x288926[_0xb4be('0x2f')]:_0x8dd376[_0xb4be('0x2c')];if(_0x2c3d2[_0xb4be('0x2d')]['includeAll']){_0x288926['include']=[{'all':!![]}];}_0x288926=_[_0xb4be('0x41')]({},_0x288926,_0x2c3d2['options']);return db[_0xb4be('0x38')][_0xb4be('0x42')](_0x288926)[_0xb4be('0x25')](handleEntityNotFound(_0x447e89,null))[_0xb4be('0x25')](respondWithResult(_0x447e89,null))[_0xb4be('0x3b')](handleError(_0x447e89,null));};exports[_0xb4be('0x43')]=function(_0x5e452f,_0x472f29){return db[_0xb4be('0x38')]['create'](_0x5e452f[_0xb4be('0x44')],{})['then'](respondWithResult(_0x472f29,0xc9))['catch'](handleError(_0x472f29,null));};exports['update']=function(_0x4f6e41,_0x4c300a){if(_0x4f6e41[_0xb4be('0x44')]['id']){delete _0x4f6e41[_0xb4be('0x44')]['id'];}return db[_0xb4be('0x38')][_0xb4be('0x42')]({'where':{'id':_0x4f6e41[_0xb4be('0x3d')]['id']}})[_0xb4be('0x25')](handleEntityNotFound(_0x4c300a,null))['then'](saveUpdates(_0x4f6e41[_0xb4be('0x44')],null))[_0xb4be('0x25')](respondWithResult(_0x4c300a,null))[_0xb4be('0x3b')](handleError(_0x4c300a,null));};exports[_0xb4be('0x26')]=function(_0x29a4d6,_0x45b7f7){return db[_0xb4be('0x38')][_0xb4be('0x42')]({'where':{'id':_0x29a4d6['params']['id']}})[_0xb4be('0x25')](handleEntityNotFound(_0x45b7f7,null))['then'](removeEntity(_0x45b7f7,null))[_0xb4be('0x3b')](handleError(_0x45b7f7,null));};
\ No newline at end of file
index dc2b2d8..c1b817d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eef=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','freshsales_unique_index','idField','FieldId'];(function(_0x1af2db,_0x4e7f52){var _0x4dbe2d=function(_0x551c08){while(--_0x551c08){_0x1af2db['push'](_0x1af2db['shift']());}};_0x4dbe2d(++_0x4e7f52);}(_0x5eef,0x9c));var _0xf5ee=function(_0x5d3c26,_0x4d0e9f){_0x5d3c26=_0x5d3c26-0x0;var _0x40b244=_0x5eef[_0x5d3c26];return _0x40b244;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5ee('0x0'))('api');var moment=require(_0xf5ee('0x1'));var BPromise=require('bluebird');var rp=require(_0xf5ee('0x2'));var fs=require('fs');var path=require(_0xf5ee('0x3'));var rimraf=require(_0xf5ee('0x4'));var config=require(_0xf5ee('0x5'));var attributes=require(_0xf5ee('0x6'));module['exports']=function(_0x4d4175,_0x594128){return _0x4d4175[_0xf5ee('0x7')](_0xf5ee('0x8'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xf5ee('0x9'),'fields':[_0xf5ee('0xa'),_0xf5ee('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc933=['api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x410707,_0x46d17e){var _0x2b7037=function(_0xb440c4){while(--_0xb440c4){_0x410707['push'](_0x410707['shift']());}};_0x2b7037(++_0x46d17e);}(_0xc933,0xf9));var _0x3c93=function(_0x4aa43d,_0x3fe952){_0x4aa43d=_0x4aa43d-0x0;var _0x1285dd=_0xc933[_0x4aa43d];return _0x1285dd;};'use strict';var _=require(_0x3c93('0x0'));var util=require(_0x3c93('0x1'));var logger=require(_0x3c93('0x2'))(_0x3c93('0x3'));var moment=require(_0x3c93('0x4'));var BPromise=require('bluebird');var rp=require(_0x3c93('0x5'));var fs=require('fs');var path=require(_0x3c93('0x6'));var rimraf=require(_0x3c93('0x7'));var config=require(_0x3c93('0x8'));var attributes=require(_0x3c93('0x9'));module['exports']=function(_0x1f2667,_0x19939f){return _0x1f2667['define'](_0x3c93('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x3c93('0xb'),'fields':[_0x3c93('0xc'),_0x3c93('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index cd34e35..2e2cc8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4e9e0d,_0xd86384){var _0x514622=function(_0xe6b57b){while(--_0xe6b57b){_0x4e9e0d['push'](_0x4e9e0d['shift']());}};_0x514622(++_0xd86384);}(_0xadb5,0xad));var _0x5adb=function(_0x87d773,_0xe9559b){_0x87d773=_0x87d773-0x0;var _0x41bb1d=_0xadb5[_0x87d773];return _0x41bb1d;};'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']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0xc6ac=['http','request','then','info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2ad6eb,_0x26e819){var _0x3bf37c=function(_0x469e62){while(--_0x469e62){_0x2ad6eb['push'](_0x2ad6eb['shift']());}};_0x3bf37c(++_0x26e819);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4a4002,_0x4c2cbd){_0x4a4002=_0x4a4002-0x0;var _0x1cac5e=_0xc6ac[_0x4a4002];return _0x1cac5e;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});}
\ No newline at end of file
index f880c5c..c61d937 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(_0x3be26f,_0x305a92){var _0x3d52bb=function(_0xb254ec){while(--_0xb254ec){_0x3be26f['push'](_0x3be26f['shift']());}};_0x3d52bb(++_0x305a92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4708eb,_0x572847){var _0x1385fd=function(_0x1e57cf){while(--_0x1e57cf){_0x4708eb['push'](_0x4708eb['shift']());}};_0x1385fd(++_0x572847);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 0b3d538..9bc6253 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27de=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x537ea1,_0x3f8f41){var _0x7fd9f1=function(_0x427aae){while(--_0x427aae){_0x537ea1['push'](_0x537ea1['shift']());}};_0x7fd9f1(++_0x3f8f41);}(_0x27de,0x111));var _0xe27d=function(_0x41c45e,_0x8b84e7){_0x41c45e=_0x41c45e-0x0;var _0x5c3ee1=_0x27de[_0x41c45e];return _0x5c3ee1;};'use strict';var Sequelize=require(_0xe27d('0x0'));module[_0xe27d('0x1')]={'name':{'type':Sequelize[_0xe27d('0x2')]},'description':{'type':Sequelize[_0xe27d('0x2')]},'username':{'type':Sequelize[_0xe27d('0x2')],'unique':_0xe27d('0x3')},'remoteUri':{'type':Sequelize[_0xe27d('0x2')]},'password':{'type':Sequelize[_0xe27d('0x2')]},'clientId':{'type':Sequelize[_0xe27d('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xe27d('0x2')]},'serverUrl':{'type':Sequelize[_0xe27d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe27d('0x4')](_0xe27d('0x5'),_0xe27d('0x6')),'defaultValue':_0xe27d('0x5')}};
\ No newline at end of file
+var _0x36d3=['exports','STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x36d3,0xb5));var _0x336d=function(_0x449616,_0x1cf413){_0x449616=_0x449616-0x0;var _0x5d9a7c=_0x36d3[_0x449616];return _0x5d9a7c;};'use strict';var Sequelize=require(_0x336d('0x0'));module[_0x336d('0x1')]={'name':{'type':Sequelize[_0x336d('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x336d('0x3')},'remoteUri':{'type':Sequelize[_0x336d('0x2')]},'password':{'type':Sequelize[_0x336d('0x2')]},'clientId':{'type':Sequelize[_0x336d('0x2')]},'clientSecret':{'type':Sequelize[_0x336d('0x2')]},'securityToken':{'type':Sequelize[_0x336d('0x2')]},'serverUrl':{'type':Sequelize[_0x336d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x336d('0x4')](_0x336d('0x5'),_0x336d('0x6')),'defaultValue':_0x336d('0x5')}};
\ No newline at end of file
index e718554..73b0d40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f29=['label','custom','picklistValues','boolean','True','true','False','false','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','limit','order','where','pick','filters','filter','merge','type','VIRTUAL','options','SalesforceAccount','includeAll','include','findAll','rows','show','params','find','catch','create','body','getConfigurations','findOne','sort','hasOwnProperty','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','slice','substring','lastIndexOf','Connection','login','password','concat','isNil','ticketType','describe','OwnerId','IsReminderSet','IsRecurrence','Description','string','int','picklist','email','textarea','includes'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7f29,0xfa));var _0x97f2=function(_0x33c16d,_0x46a817){_0x33c16d=_0x33c16d-0x0;var _0x1ffb49=_0x7f29[_0x33c16d];return _0x1ffb49;};'use strict';var emlformat=require(_0x97f2('0x0'));var rimraf=require(_0x97f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97f2('0x2'));var rp=require(_0x97f2('0x3'));var moment=require(_0x97f2('0x4'));var BPromise=require(_0x97f2('0x5'));var Mustache=require(_0x97f2('0x6'));var util=require(_0x97f2('0x7'));var path=require(_0x97f2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97f2('0x9'));var _=require(_0x97f2('0xa'));var squel=require(_0x97f2('0xb'));var crypto=require(_0x97f2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x97f2('0xd'));var querystring=require(_0x97f2('0xe'));var Papa=require('papaparse');var Redis=require(_0x97f2('0xf'));var authService=require(_0x97f2('0x10'));var qs=require(_0x97f2('0x11'));var as=require(_0x97f2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97f2('0x13'))(_0x97f2('0x14'));var utils=require(_0x97f2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x97f2('0x16'))['db'];var integrations=require(_0x97f2('0x17'));function respondWithStatusCode(_0x3fc55f,_0x2df0ca){_0x2df0ca=_0x2df0ca||0xcc;return function(_0x4b3c80){if(_0x4b3c80){return _0x3fc55f[_0x97f2('0x18')](_0x2df0ca);}return _0x3fc55f[_0x97f2('0x19')](_0x2df0ca)[_0x97f2('0x1a')]();};}function respondWithResult(_0x495b66,_0x66136d){_0x66136d=_0x66136d||0xc8;return function(_0x427651){if(_0x427651){return _0x495b66[_0x97f2('0x19')](_0x66136d)[_0x97f2('0x1b')](_0x427651);}};}function respondWithFilteredResult(_0x536041,_0x137336){return function(_0x55fb70){if(_0x55fb70){var _0x478737=typeof _0x137336[_0x97f2('0x1c')]===_0x97f2('0x1d')&&typeof _0x137336['limit']===_0x97f2('0x1d');var _0x2683f=_0x55fb70[_0x97f2('0x1e')];var _0x527193=_0x478737?0x0:_0x137336[_0x97f2('0x1c')];var _0x57c21f=_0x478737?_0x55fb70[_0x97f2('0x1e')]:_0x137336[_0x97f2('0x1c')]+_0x137336['limit'];var _0x617b00;if(_0x57c21f>=_0x2683f){_0x57c21f=_0x2683f;_0x617b00=0xc8;}else{_0x617b00=0xce;}_0x536041[_0x97f2('0x19')](_0x617b00);return _0x536041[_0x97f2('0x1f')]('Content-Range',_0x527193+'-'+_0x57c21f+'/'+_0x2683f)[_0x97f2('0x1b')](_0x55fb70);}return null;};}function patchUpdates(_0x9629a7){return function(_0x274eb2){try{jsonpatch['apply'](_0x274eb2,_0x9629a7,!![]);}catch(_0x4fc958){return BPromise[_0x97f2('0x20')](_0x4fc958);}return _0x274eb2[_0x97f2('0x21')]();};}function saveUpdates(_0x1a8ee9,_0x500045){return function(_0x567d0b){if(_0x567d0b){return _0x567d0b[_0x97f2('0x22')](_0x1a8ee9)[_0x97f2('0x23')](function(_0x57277b){return _0x57277b;});}return null;};}function removeEntity(_0x14601f,_0x7e62c2){return function(_0x2f7b0c){if(_0x2f7b0c){return _0x2f7b0c[_0x97f2('0x24')]()[_0x97f2('0x23')](function(){_0x14601f[_0x97f2('0x19')](0xcc)[_0x97f2('0x1a')]();});}};}function handleEntityNotFound(_0x58c105,_0x3dc9ec){return function(_0x125acd){if(!_0x125acd){_0x58c105['sendStatus'](0x194);}return _0x125acd;};}function handleError(_0x56fb35,_0x226744){_0x226744=_0x226744||0x1f4;return function(_0x39b85d){logger[_0x97f2('0x25')](_0x39b85d['stack']);if(_0x39b85d[_0x97f2('0x26')]){delete _0x39b85d[_0x97f2('0x26')];}_0x56fb35[_0x97f2('0x19')](_0x226744)[_0x97f2('0x27')](_0x39b85d);};}exports[_0x97f2('0x28')]=function(_0x45773a,_0x1663ca){var _0x35240e={},_0x39dd9c={},_0x49121e={'count':0x0,'rows':[]};var _0x5ed745=_[_0x97f2('0x29')](db['SalesforceAccount'][_0x97f2('0x2a')],function(_0x21acdc){return{'name':_0x21acdc[_0x97f2('0x2b')],'type':_0x21acdc['type'][_0x97f2('0x2c')]};});_0x39dd9c[_0x97f2('0x2d')]=_[_0x97f2('0x29')](_0x5ed745,_0x97f2('0x26'));_0x39dd9c['query']=_[_0x97f2('0x2e')](_0x45773a[_0x97f2('0x2f')]);_0x39dd9c['filters']=_[_0x97f2('0x30')](_0x39dd9c['model'],_0x39dd9c['query']);_0x35240e[_0x97f2('0x31')]=_['intersection'](_0x39dd9c[_0x97f2('0x2d')],qs['fields'](_0x45773a[_0x97f2('0x2f')][_0x97f2('0x32')]));_0x35240e[_0x97f2('0x31')]=_0x35240e[_0x97f2('0x31')][_0x97f2('0x33')]?_0x35240e['attributes']:_0x39dd9c[_0x97f2('0x2d')];if(!_0x45773a[_0x97f2('0x2f')]['hasOwnProperty'](_0x97f2('0x34'))){_0x35240e['limit']=qs[_0x97f2('0x35')](_0x45773a['query'][_0x97f2('0x35')]);_0x35240e[_0x97f2('0x1c')]=qs[_0x97f2('0x1c')](_0x45773a[_0x97f2('0x2f')]['offset']);}_0x35240e[_0x97f2('0x36')]=qs['sort'](_0x45773a[_0x97f2('0x2f')]['sort']);_0x35240e[_0x97f2('0x37')]=qs['filters'](_[_0x97f2('0x38')](_0x45773a[_0x97f2('0x2f')],_0x39dd9c[_0x97f2('0x39')]),_0x5ed745);if(_0x45773a[_0x97f2('0x2f')][_0x97f2('0x3a')]){_0x35240e[_0x97f2('0x37')]=_[_0x97f2('0x3b')](_0x35240e[_0x97f2('0x37')],{'$or':_[_0x97f2('0x29')](_0x5ed745,function(_0x339ad0){if(_0x339ad0[_0x97f2('0x3c')]!==_0x97f2('0x3d')){var _0x491e7d={};_0x491e7d[_0x339ad0[_0x97f2('0x26')]]={'$like':'%'+_0x45773a[_0x97f2('0x2f')][_0x97f2('0x3a')]+'%'};return _0x491e7d;}})});}_0x35240e=_[_0x97f2('0x3b')]({},_0x35240e,_0x45773a[_0x97f2('0x3e')]);var _0x2b71e8={'where':_0x35240e[_0x97f2('0x37')]};return db[_0x97f2('0x3f')]['count'](_0x2b71e8)[_0x97f2('0x23')](function(_0x2821fd){_0x49121e['count']=_0x2821fd;if(_0x45773a['query'][_0x97f2('0x40')]){_0x35240e[_0x97f2('0x41')]=[{'all':!![]}];}return db[_0x97f2('0x3f')][_0x97f2('0x42')](_0x35240e);})[_0x97f2('0x23')](function(_0x32ffca){_0x49121e[_0x97f2('0x43')]=_0x32ffca;return _0x49121e;})[_0x97f2('0x23')](respondWithFilteredResult(_0x1663ca,_0x35240e))['catch'](handleError(_0x1663ca,null));};exports[_0x97f2('0x44')]=function(_0x589548,_0x280b60){var _0x21ca4d={'raw':![],'where':{'id':_0x589548[_0x97f2('0x45')]['id']}},_0x33a26a={};_0x33a26a['model']=_[_0x97f2('0x2e')](db[_0x97f2('0x3f')][_0x97f2('0x2a')]);_0x33a26a[_0x97f2('0x2f')]=_['keys'](_0x589548[_0x97f2('0x2f')]);_0x33a26a['filters']=_[_0x97f2('0x30')](_0x33a26a[_0x97f2('0x2d')],_0x33a26a[_0x97f2('0x2f')]);_0x21ca4d[_0x97f2('0x31')]=_[_0x97f2('0x30')](_0x33a26a[_0x97f2('0x2d')],qs[_0x97f2('0x32')](_0x589548[_0x97f2('0x2f')][_0x97f2('0x32')]));_0x21ca4d['attributes']=_0x21ca4d['attributes'][_0x97f2('0x33')]?_0x21ca4d[_0x97f2('0x31')]:_0x33a26a[_0x97f2('0x2d')];if(_0x589548[_0x97f2('0x2f')][_0x97f2('0x40')]){_0x21ca4d[_0x97f2('0x41')]=[{'all':!![]}];}_0x21ca4d=_[_0x97f2('0x3b')]({},_0x21ca4d,_0x589548[_0x97f2('0x3e')]);return db['SalesforceAccount'][_0x97f2('0x46')](_0x21ca4d)[_0x97f2('0x23')](handleEntityNotFound(_0x280b60,null))[_0x97f2('0x23')](respondWithResult(_0x280b60,null))[_0x97f2('0x47')](handleError(_0x280b60,null));};exports[_0x97f2('0x48')]=function(_0xde39d6,_0x4428c8){return db[_0x97f2('0x3f')][_0x97f2('0x48')](_0xde39d6[_0x97f2('0x49')],{})[_0x97f2('0x23')](respondWithResult(_0x4428c8,0xc9))[_0x97f2('0x47')](handleError(_0x4428c8,null));};exports[_0x97f2('0x22')]=function(_0x58b301,_0x1cb279){if(_0x58b301['body']['id']){delete _0x58b301[_0x97f2('0x49')]['id'];}return db['SalesforceAccount'][_0x97f2('0x46')]({'where':{'id':_0x58b301[_0x97f2('0x45')]['id']}})['then'](handleEntityNotFound(_0x1cb279,null))['then'](saveUpdates(_0x58b301[_0x97f2('0x49')],null))[_0x97f2('0x23')](respondWithResult(_0x1cb279,null))[_0x97f2('0x47')](handleError(_0x1cb279,null));};exports[_0x97f2('0x24')]=function(_0x4a747e,_0x472282){return db[_0x97f2('0x3f')]['find']({'where':{'id':_0x4a747e[_0x97f2('0x45')]['id']}})['then'](handleEntityNotFound(_0x472282,null))[_0x97f2('0x23')](removeEntity(_0x472282,null))[_0x97f2('0x47')](handleError(_0x472282,null));};exports[_0x97f2('0x4a')]=function(_0x79b9aa,_0x1cba1b,_0x140cfc){var _0x2d7e7e={};var _0xdb566f={};var _0x2f8460;var _0x57be8e;return db[_0x97f2('0x3f')][_0x97f2('0x4b')]({'where':{'id':_0x79b9aa[_0x97f2('0x45')]['id']}})[_0x97f2('0x23')](handleEntityNotFound(_0x1cba1b,null))[_0x97f2('0x23')](function(_0x394593){if(_0x394593){_0x2f8460=_0x394593;_0xdb566f[_0x97f2('0x2d')]=_[_0x97f2('0x2e')](db['SalesforceConfiguration'][_0x97f2('0x2a')]);_0xdb566f[_0x97f2('0x2f')]=_[_0x97f2('0x2e')](_0x79b9aa[_0x97f2('0x2f')]);_0xdb566f['filters']=_['intersection'](_0xdb566f['model'],_0xdb566f[_0x97f2('0x2f')]);_0x2d7e7e[_0x97f2('0x31')]=_['intersection'](_0xdb566f[_0x97f2('0x2d')],qs[_0x97f2('0x32')](_0x79b9aa[_0x97f2('0x2f')]['fields']));_0x2d7e7e[_0x97f2('0x31')]=_0x2d7e7e[_0x97f2('0x31')]['length']?_0x2d7e7e[_0x97f2('0x31')]:_0xdb566f[_0x97f2('0x2d')];_0x2d7e7e['order']=qs['sort'](_0x79b9aa[_0x97f2('0x2f')][_0x97f2('0x4c')]);_0x2d7e7e[_0x97f2('0x37')]=qs['filters'](_['pick'](_0x79b9aa[_0x97f2('0x2f')],_0xdb566f[_0x97f2('0x39')]));if(_0x79b9aa[_0x97f2('0x2f')][_0x97f2('0x3a')]){_0x2d7e7e['where']=_[_0x97f2('0x3b')](_0x2d7e7e[_0x97f2('0x37')],{'$or':_[_0x97f2('0x29')](_0x2d7e7e[_0x97f2('0x31')],function(_0x632354){var _0x199e71={};_0x199e71[_0x632354]={'$like':'%'+_0x79b9aa['query'][_0x97f2('0x3a')]+'%'};return _0x199e71;})});}_0x2d7e7e=_['merge']({},_0x2d7e7e,_0x79b9aa['options']);return _0x2f8460[_0x97f2('0x4a')](_0x2d7e7e);}})[_0x97f2('0x23')](function(_0x3e892b){if(_0x3e892b){_0x57be8e=_0x3e892b[_0x97f2('0x33')];if(!_0x79b9aa[_0x97f2('0x2f')][_0x97f2('0x4d')](_0x97f2('0x34'))){_0x2d7e7e[_0x97f2('0x35')]=qs[_0x97f2('0x35')](_0x79b9aa[_0x97f2('0x2f')][_0x97f2('0x35')]);_0x2d7e7e[_0x97f2('0x1c')]=qs[_0x97f2('0x1c')](_0x79b9aa['query'][_0x97f2('0x1c')]);}return _0x2f8460[_0x97f2('0x4a')](_0x2d7e7e);}})[_0x97f2('0x23')](function(_0x23ea47){if(_0x23ea47){return _0x23ea47?{'count':_0x57be8e,'rows':_0x23ea47}:null;}})['then'](respondWithResult(_0x1cba1b,null))[_0x97f2('0x47')](handleError(_0x1cba1b,null));};exports['addConfiguration']=function(_0x8bce0b,_0x4f8b60,_0x4f2b63){if(_0x8bce0b[_0x97f2('0x49')]['id']){delete _0x8bce0b[_0x97f2('0x49')]['id'];}return db[_0x97f2('0x3f')][_0x97f2('0x4b')]({'where':{'id':_0x8bce0b[_0x97f2('0x45')]['id']}})[_0x97f2('0x23')](handleEntityNotFound(_0x4f8b60,null))[_0x97f2('0x23')](function(_0x331351){if(_0x331351){_0x8bce0b[_0x97f2('0x49')]['AccountId']=_0x331351['id'];_0x8bce0b['body']['Subjects']=integrations['getSubjects'](_0x8bce0b[_0x97f2('0x49')][_0x97f2('0x4e')],_0x8bce0b[_0x97f2('0x49')][_0x97f2('0x3c')]);_0x8bce0b[_0x97f2('0x49')][_0x97f2('0x4f')]=integrations[_0x97f2('0x50')](_0x8bce0b[_0x97f2('0x49')][_0x97f2('0x4e')],_0x8bce0b[_0x97f2('0x49')][_0x97f2('0x3c')]);return db['SalesforceConfiguration']['create'](_0x8bce0b[_0x97f2('0x49')],{'include':[{'model':db[_0x97f2('0x51')],'as':'Subjects'},{'model':db[_0x97f2('0x51')],'as':_0x97f2('0x4f')}]});}return null;})[_0x97f2('0x23')](respondWithResult(_0x4f8b60,null))[_0x97f2('0x47')](handleError(_0x4f8b60,null));};exports[_0x97f2('0x52')]=function(_0x5b82ea,_0x13f9c4,_0x18a196){var _0x294f99;var _0x54131c='';var _0x21944b='Task';return db[_0x97f2('0x3f')][_0x97f2('0x4b')]({'where':{'id':_0x5b82ea[_0x97f2('0x45')]['id']},'attributes':['id',_0x97f2('0x53'),_0x97f2('0x54'),_0x97f2('0x55'),_0x97f2('0x56'),'password','securityToken']})[_0x97f2('0x23')](handleEntityNotFound(_0x13f9c4,null))[_0x97f2('0x23')](function(_0x2c6d37){if(_0x2c6d37){_0x54131c=_0x2c6d37[_0x97f2('0x53')];var _0x5d3e32=_0x54131c[_0x97f2('0x57')](-0x1);if(_0x5d3e32==='/'){_0x54131c=_0x54131c[_0x97f2('0x58')](0x0,_0x54131c[_0x97f2('0x59')](_0x5d3e32));}_0x294f99=new jsforce[(_0x97f2('0x5a'))]({'oauth2':{'loginUrl':_0x54131c,'clientId':_0x2c6d37[_0x97f2('0x54')],'clientSecret':_0x2c6d37[_0x97f2('0x55')]}});return _0x294f99[_0x97f2('0x5b')](_0x2c6d37[_0x97f2('0x56')],_0x2c6d37[_0x97f2('0x5c')][_0x97f2('0x5d')](_0x2c6d37['securityToken']));}})[_0x97f2('0x23')](function(_0x26e3ce){if(_0x26e3ce){if(!_[_0x97f2('0x5e')](_0x5b82ea[_0x97f2('0x2f')][_0x97f2('0x5f')])){_0x21944b=_0x5b82ea[_0x97f2('0x2f')][_0x97f2('0x5f')];}return _0x294f99['sobject'](_0x21944b)[_0x97f2('0x60')]();}})['then'](function(_0x2fedf3){var _0x46cad4=[_0x97f2('0x61'),'ActivityDate',_0x97f2('0x62'),_0x97f2('0x63'),'Subject',_0x97f2('0x64')];var _0x5b81c0=[_0x97f2('0x65'),_0x97f2('0x66'),_0x97f2('0x67'),'boolean',_0x97f2('0x68'),_0x97f2('0x69'),'phone'];if(_0x2fedf3){_['remove'](_0x2fedf3['fields'],function(_0x3ced07){return _0x46cad4['includes'](_0x3ced07[_0x97f2('0x26')])||!_0x5b81c0[_0x97f2('0x6a')](_0x3ced07[_0x97f2('0x3c')]);});return{'count':_0x2fedf3[_0x97f2('0x32')][_0x97f2('0x33')],'rows':_[_0x97f2('0x29')](_0x2fedf3[_0x97f2('0x32')],function(_0x13b660){return{'id':_0x13b660[_0x97f2('0x26')],'name':_0x13b660[_0x97f2('0x6b')],'custom':_0x13b660[_0x97f2('0x6c')],'options':_0x13b660[_0x97f2('0x6d')][_0x97f2('0x33')]>0x0?_[_0x97f2('0x29')](_0x13b660[_0x97f2('0x6d')],function(_0x4b6ac4){return{'name':_0x4b6ac4[_0x97f2('0x6b')],'value':_0x4b6ac4['value']};}):_0x13b660[_0x97f2('0x3c')]==_0x97f2('0x6e')?[{'name':_0x97f2('0x6f'),'value':_0x97f2('0x70')},{'name':_0x97f2('0x71'),'value':_0x97f2('0x72')}]:[]};})};}})[_0x97f2('0x23')](respondWithResult(_0x13f9c4,null))[_0x97f2('0x47')](function(_0x465dc4){var _0x52308d=_0x5b82ea[_0x97f2('0x2f')]['test']?0x1f4:_0x465dc4[_0x97f2('0x73')]||0x1f4;logger[_0x97f2('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x97f2('0x52'),_0x52308d,JSON[_0x97f2('0x74')](_0x465dc4));delete _0x465dc4[_0x97f2('0x26')];if(_0x52308d===0x191){_0x52308d=0x190;}_0x13f9c4['status'](_0x52308d)[_0x97f2('0x27')](_0x5b82ea[_0x97f2('0x2f')][_0x97f2('0x75')]?{'message':_0x97f2('0x76'),'statusCode':_0x465dc4['statusCode']}:_0x465dc4);});};
\ No newline at end of file
+var _0xeeb1=['attributes','length','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','options','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','channel','Descriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','phone','remove','includes','label','picklistValues','true','False','false','test','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','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','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','SalesforceAccount','rawAttributes','type','key','query','keys','filters','intersection','model','fields'];(function(_0x58791f,_0x368df3){var _0x1255d6=function(_0x1bc5cf){while(--_0x1bc5cf){_0x58791f['push'](_0x58791f['shift']());}};_0x1255d6(++_0x368df3);}(_0xeeb1,0x1b4));var _0x1eeb=function(_0x3b5e9f,_0x29601e){_0x3b5e9f=_0x3b5e9f-0x0;var _0x1e9a49=_0xeeb1[_0x3b5e9f];return _0x1e9a49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1eeb('0x0'));var zipdir=require(_0x1eeb('0x1'));var jsonpatch=require(_0x1eeb('0x2'));var rp=require(_0x1eeb('0x3'));var moment=require(_0x1eeb('0x4'));var BPromise=require(_0x1eeb('0x5'));var Mustache=require(_0x1eeb('0x6'));var util=require(_0x1eeb('0x7'));var path=require(_0x1eeb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1eeb('0x9'));var fs=require('fs');var fs_extra=require(_0x1eeb('0xa'));var _=require(_0x1eeb('0xb'));var squel=require(_0x1eeb('0xc'));var crypto=require(_0x1eeb('0xd'));var jsforce=require(_0x1eeb('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1eeb('0xf'));var Papa=require(_0x1eeb('0x10'));var Redis=require('ioredis');var authService=require(_0x1eeb('0x11'));var qs=require(_0x1eeb('0x12'));var as=require(_0x1eeb('0x13'));var hardwareService=require(_0x1eeb('0x14'));var logger=require(_0x1eeb('0x15'))(_0x1eeb('0x16'));var utils=require(_0x1eeb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1eeb('0x18'));var db=require(_0x1eeb('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5614a9,_0x5c5ad1){_0x5c5ad1=_0x5c5ad1||0xcc;return function(_0xd74329){if(_0xd74329){return _0x5614a9[_0x1eeb('0x1a')](_0x5c5ad1);}return _0x5614a9['status'](_0x5c5ad1)[_0x1eeb('0x1b')]();};}function respondWithResult(_0x2ea45c,_0x299234){_0x299234=_0x299234||0xc8;return function(_0x220b9b){if(_0x220b9b){return _0x2ea45c[_0x1eeb('0x1c')](_0x299234)[_0x1eeb('0x1d')](_0x220b9b);}};}function respondWithFilteredResult(_0x55f88e,_0x484562){return function(_0x23136a){if(_0x23136a){var _0x4cdba1=typeof _0x484562[_0x1eeb('0x1e')]==='undefined'&&typeof _0x484562[_0x1eeb('0x1f')]===_0x1eeb('0x20');var _0x2b05eb=_0x23136a[_0x1eeb('0x21')];var _0x46a40e=_0x4cdba1?0x0:_0x484562[_0x1eeb('0x1e')];var _0x14a1fa=_0x4cdba1?_0x23136a['count']:_0x484562['offset']+_0x484562['limit'];var _0x35970b;if(_0x14a1fa>=_0x2b05eb){_0x14a1fa=_0x2b05eb;_0x35970b=0xc8;}else{_0x35970b=0xce;}_0x55f88e[_0x1eeb('0x1c')](_0x35970b);return _0x55f88e[_0x1eeb('0x22')](_0x1eeb('0x23'),_0x46a40e+'-'+_0x14a1fa+'/'+_0x2b05eb)[_0x1eeb('0x1d')](_0x23136a);}return null;};}function patchUpdates(_0x40d38b){return function(_0x5286e9){try{jsonpatch[_0x1eeb('0x24')](_0x5286e9,_0x40d38b,!![]);}catch(_0x139dfa){return BPromise['reject'](_0x139dfa);}return _0x5286e9[_0x1eeb('0x25')]();};}function saveUpdates(_0x3fa5f9,_0x27ff21){return function(_0x1e4aea){if(_0x1e4aea){return _0x1e4aea[_0x1eeb('0x26')](_0x3fa5f9)[_0x1eeb('0x27')](function(_0x5dd50c){return _0x5dd50c;});}return null;};}function removeEntity(_0x48c033,_0x104b7e){return function(_0xaa2a21){if(_0xaa2a21){return _0xaa2a21[_0x1eeb('0x28')]()[_0x1eeb('0x27')](function(){_0x48c033[_0x1eeb('0x1c')](0xcc)[_0x1eeb('0x1b')]();});}};}function handleEntityNotFound(_0x18b420,_0x282401){return function(_0x4e56ec){if(!_0x4e56ec){_0x18b420['sendStatus'](0x194);}return _0x4e56ec;};}function handleError(_0x384bac,_0x4ba4fc){_0x4ba4fc=_0x4ba4fc||0x1f4;return function(_0x2d1281){logger[_0x1eeb('0x29')](_0x2d1281['stack']);if(_0x2d1281[_0x1eeb('0x2a')]){delete _0x2d1281[_0x1eeb('0x2a')];}_0x384bac[_0x1eeb('0x1c')](_0x4ba4fc)[_0x1eeb('0x2b')](_0x2d1281);};}exports[_0x1eeb('0x2c')]=function(_0x5ae815,_0x51bff1){var _0x3362b3={},_0x3fcba6={},_0x18fb34={'count':0x0,'rows':[]};var _0x503798=_[_0x1eeb('0x2d')](db[_0x1eeb('0x2e')][_0x1eeb('0x2f')],function(_0x5567b1){return{'name':_0x5567b1['fieldName'],'type':_0x5567b1[_0x1eeb('0x30')][_0x1eeb('0x31')]};});_0x3fcba6['model']=_[_0x1eeb('0x2d')](_0x503798,_0x1eeb('0x2a'));_0x3fcba6[_0x1eeb('0x32')]=_[_0x1eeb('0x33')](_0x5ae815[_0x1eeb('0x32')]);_0x3fcba6[_0x1eeb('0x34')]=_[_0x1eeb('0x35')](_0x3fcba6['model'],_0x3fcba6['query']);_0x3362b3['attributes']=_[_0x1eeb('0x35')](_0x3fcba6[_0x1eeb('0x36')],qs[_0x1eeb('0x37')](_0x5ae815[_0x1eeb('0x32')][_0x1eeb('0x37')]));_0x3362b3[_0x1eeb('0x38')]=_0x3362b3[_0x1eeb('0x38')][_0x1eeb('0x39')]?_0x3362b3['attributes']:_0x3fcba6['model'];if(!_0x5ae815[_0x1eeb('0x32')]['hasOwnProperty']('nolimit')){_0x3362b3[_0x1eeb('0x1f')]=qs[_0x1eeb('0x1f')](_0x5ae815[_0x1eeb('0x32')][_0x1eeb('0x1f')]);_0x3362b3[_0x1eeb('0x1e')]=qs[_0x1eeb('0x1e')](_0x5ae815['query']['offset']);}_0x3362b3[_0x1eeb('0x3a')]=qs[_0x1eeb('0x3b')](_0x5ae815['query']['sort']);_0x3362b3[_0x1eeb('0x3c')]=qs['filters'](_['pick'](_0x5ae815['query'],_0x3fcba6[_0x1eeb('0x34')]),_0x503798);if(_0x5ae815[_0x1eeb('0x32')][_0x1eeb('0x3d')]){_0x3362b3[_0x1eeb('0x3c')]=_['merge'](_0x3362b3[_0x1eeb('0x3c')],{'$or':_['map'](_0x503798,function(_0x5a35f5){if(_0x5a35f5[_0x1eeb('0x30')]!=='VIRTUAL'){var _0x58e1f5={};_0x58e1f5[_0x5a35f5[_0x1eeb('0x2a')]]={'$like':'%'+_0x5ae815[_0x1eeb('0x32')][_0x1eeb('0x3d')]+'%'};return _0x58e1f5;}})});}_0x3362b3=_[_0x1eeb('0x3e')]({},_0x3362b3,_0x5ae815['options']);var _0x587c04={'where':_0x3362b3['where']};return db['SalesforceAccount'][_0x1eeb('0x21')](_0x587c04)[_0x1eeb('0x27')](function(_0x51ab8e){_0x18fb34[_0x1eeb('0x21')]=_0x51ab8e;if(_0x5ae815['query'][_0x1eeb('0x3f')]){_0x3362b3[_0x1eeb('0x40')]=[{'all':!![]}];}return db[_0x1eeb('0x2e')][_0x1eeb('0x41')](_0x3362b3);})[_0x1eeb('0x27')](function(_0x5314f1){_0x18fb34[_0x1eeb('0x42')]=_0x5314f1;return _0x18fb34;})[_0x1eeb('0x27')](respondWithFilteredResult(_0x51bff1,_0x3362b3))[_0x1eeb('0x43')](handleError(_0x51bff1,null));};exports[_0x1eeb('0x44')]=function(_0x3aafd0,_0x3dc7f2){var _0x38b4d4={'raw':![],'where':{'id':_0x3aafd0[_0x1eeb('0x45')]['id']}},_0x4b5078={};_0x4b5078[_0x1eeb('0x36')]=_[_0x1eeb('0x33')](db['SalesforceAccount'][_0x1eeb('0x2f')]);_0x4b5078[_0x1eeb('0x32')]=_[_0x1eeb('0x33')](_0x3aafd0[_0x1eeb('0x32')]);_0x4b5078['filters']=_[_0x1eeb('0x35')](_0x4b5078[_0x1eeb('0x36')],_0x4b5078[_0x1eeb('0x32')]);_0x38b4d4[_0x1eeb('0x38')]=_[_0x1eeb('0x35')](_0x4b5078['model'],qs[_0x1eeb('0x37')](_0x3aafd0['query'][_0x1eeb('0x37')]));_0x38b4d4[_0x1eeb('0x38')]=_0x38b4d4[_0x1eeb('0x38')][_0x1eeb('0x39')]?_0x38b4d4['attributes']:_0x4b5078[_0x1eeb('0x36')];if(_0x3aafd0[_0x1eeb('0x32')][_0x1eeb('0x3f')]){_0x38b4d4[_0x1eeb('0x40')]=[{'all':!![]}];}_0x38b4d4=_[_0x1eeb('0x3e')]({},_0x38b4d4,_0x3aafd0['options']);return db[_0x1eeb('0x2e')][_0x1eeb('0x46')](_0x38b4d4)[_0x1eeb('0x27')](handleEntityNotFound(_0x3dc7f2,null))[_0x1eeb('0x27')](respondWithResult(_0x3dc7f2,null))[_0x1eeb('0x43')](handleError(_0x3dc7f2,null));};exports[_0x1eeb('0x47')]=function(_0x1a683d,_0x103a1c){return db['SalesforceAccount'][_0x1eeb('0x47')](_0x1a683d[_0x1eeb('0x48')],{})[_0x1eeb('0x27')](respondWithResult(_0x103a1c,0xc9))[_0x1eeb('0x43')](handleError(_0x103a1c,null));};exports[_0x1eeb('0x26')]=function(_0x3da10c,_0x3243bf){if(_0x3da10c['body']['id']){delete _0x3da10c[_0x1eeb('0x48')]['id'];}return db[_0x1eeb('0x2e')][_0x1eeb('0x46')]({'where':{'id':_0x3da10c[_0x1eeb('0x45')]['id']}})[_0x1eeb('0x27')](handleEntityNotFound(_0x3243bf,null))[_0x1eeb('0x27')](saveUpdates(_0x3da10c['body'],null))[_0x1eeb('0x27')](respondWithResult(_0x3243bf,null))[_0x1eeb('0x43')](handleError(_0x3243bf,null));};exports['destroy']=function(_0x5ac642,_0x399ae0){return db['SalesforceAccount'][_0x1eeb('0x46')]({'where':{'id':_0x5ac642['params']['id']}})[_0x1eeb('0x27')](handleEntityNotFound(_0x399ae0,null))['then'](removeEntity(_0x399ae0,null))[_0x1eeb('0x43')](handleError(_0x399ae0,null));};exports[_0x1eeb('0x49')]=function(_0x5a07cd,_0x52a986,_0x209e5a){var _0x3ab9fb={};var _0x41f668={};var _0xd49610;var _0x89e6bd;return db[_0x1eeb('0x2e')]['findOne']({'where':{'id':_0x5a07cd[_0x1eeb('0x45')]['id']}})[_0x1eeb('0x27')](handleEntityNotFound(_0x52a986,null))[_0x1eeb('0x27')](function(_0x57bdd9){if(_0x57bdd9){_0xd49610=_0x57bdd9;_0x41f668[_0x1eeb('0x36')]=_[_0x1eeb('0x33')](db['SalesforceConfiguration']['rawAttributes']);_0x41f668[_0x1eeb('0x32')]=_[_0x1eeb('0x33')](_0x5a07cd[_0x1eeb('0x32')]);_0x41f668[_0x1eeb('0x34')]=_['intersection'](_0x41f668['model'],_0x41f668[_0x1eeb('0x32')]);_0x3ab9fb[_0x1eeb('0x38')]=_[_0x1eeb('0x35')](_0x41f668[_0x1eeb('0x36')],qs[_0x1eeb('0x37')](_0x5a07cd[_0x1eeb('0x32')][_0x1eeb('0x37')]));_0x3ab9fb[_0x1eeb('0x38')]=_0x3ab9fb[_0x1eeb('0x38')][_0x1eeb('0x39')]?_0x3ab9fb[_0x1eeb('0x38')]:_0x41f668[_0x1eeb('0x36')];_0x3ab9fb[_0x1eeb('0x3a')]=qs['sort'](_0x5a07cd[_0x1eeb('0x32')][_0x1eeb('0x3b')]);_0x3ab9fb[_0x1eeb('0x3c')]=qs[_0x1eeb('0x34')](_['pick'](_0x5a07cd['query'],_0x41f668[_0x1eeb('0x34')]));if(_0x5a07cd[_0x1eeb('0x32')][_0x1eeb('0x3d')]){_0x3ab9fb[_0x1eeb('0x3c')]=_[_0x1eeb('0x3e')](_0x3ab9fb['where'],{'$or':_['map'](_0x3ab9fb['attributes'],function(_0x53cf45){var _0x32119d={};_0x32119d[_0x53cf45]={'$like':'%'+_0x5a07cd[_0x1eeb('0x32')][_0x1eeb('0x3d')]+'%'};return _0x32119d;})});}_0x3ab9fb=_['merge']({},_0x3ab9fb,_0x5a07cd[_0x1eeb('0x4a')]);return _0xd49610[_0x1eeb('0x49')](_0x3ab9fb);}})[_0x1eeb('0x27')](function(_0x2154d5){if(_0x2154d5){_0x89e6bd=_0x2154d5[_0x1eeb('0x39')];if(!_0x5a07cd['query'][_0x1eeb('0x4b')](_0x1eeb('0x4c'))){_0x3ab9fb[_0x1eeb('0x1f')]=qs[_0x1eeb('0x1f')](_0x5a07cd['query'][_0x1eeb('0x1f')]);_0x3ab9fb['offset']=qs[_0x1eeb('0x1e')](_0x5a07cd[_0x1eeb('0x32')][_0x1eeb('0x1e')]);}return _0xd49610[_0x1eeb('0x49')](_0x3ab9fb);}})[_0x1eeb('0x27')](function(_0x3e17c7){if(_0x3e17c7){return _0x3e17c7?{'count':_0x89e6bd,'rows':_0x3e17c7}:null;}})[_0x1eeb('0x27')](respondWithResult(_0x52a986,null))[_0x1eeb('0x43')](handleError(_0x52a986,null));};exports[_0x1eeb('0x4d')]=function(_0x2ec502,_0x4f1421,_0x54959c){if(_0x2ec502[_0x1eeb('0x48')]['id']){delete _0x2ec502[_0x1eeb('0x48')]['id'];}return db[_0x1eeb('0x2e')][_0x1eeb('0x4e')]({'where':{'id':_0x2ec502[_0x1eeb('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f1421,null))[_0x1eeb('0x27')](function(_0x54309){if(_0x54309){_0x2ec502[_0x1eeb('0x48')][_0x1eeb('0x4f')]=_0x54309['id'];_0x2ec502[_0x1eeb('0x48')]['Subjects']=integrations['getSubjects'](_0x2ec502[_0x1eeb('0x48')][_0x1eeb('0x50')],_0x2ec502['body']['type']);_0x2ec502['body'][_0x1eeb('0x51')]=integrations['getDescriptions'](_0x2ec502['body'][_0x1eeb('0x50')],_0x2ec502[_0x1eeb('0x48')][_0x1eeb('0x30')]);return db['SalesforceConfiguration'][_0x1eeb('0x47')](_0x2ec502[_0x1eeb('0x48')],{'include':[{'model':db[_0x1eeb('0x52')],'as':_0x1eeb('0x53')},{'model':db[_0x1eeb('0x52')],'as':'Descriptions'}]});}return null;})[_0x1eeb('0x27')](respondWithResult(_0x4f1421,null))[_0x1eeb('0x43')](handleError(_0x4f1421,null));};exports[_0x1eeb('0x54')]=function(_0x3f2d5f,_0x20c43f,_0x62cc1){var _0x212582;var _0x363045='';var _0x3f3a85=_0x1eeb('0x55');return db[_0x1eeb('0x2e')][_0x1eeb('0x4e')]({'where':{'id':_0x3f2d5f['params']['id']},'attributes':['id',_0x1eeb('0x56'),_0x1eeb('0x57'),_0x1eeb('0x58'),_0x1eeb('0x59'),_0x1eeb('0x5a'),_0x1eeb('0x5b')]})[_0x1eeb('0x27')](handleEntityNotFound(_0x20c43f,null))['then'](function(_0x291c50){if(_0x291c50){_0x363045=_0x291c50[_0x1eeb('0x56')];var _0x594eb1=_0x363045[_0x1eeb('0x5c')](-0x1);if(_0x594eb1==='/'){_0x363045=_0x363045[_0x1eeb('0x5d')](0x0,_0x363045[_0x1eeb('0x5e')](_0x594eb1));}_0x212582=new jsforce[(_0x1eeb('0x5f'))]({'oauth2':{'loginUrl':_0x363045,'clientId':_0x291c50[_0x1eeb('0x57')],'clientSecret':_0x291c50[_0x1eeb('0x58')]}});return _0x212582[_0x1eeb('0x60')](_0x291c50[_0x1eeb('0x59')],_0x291c50[_0x1eeb('0x5a')][_0x1eeb('0x61')](_0x291c50[_0x1eeb('0x5b')]));}})[_0x1eeb('0x27')](function(_0x4f50d1){if(_0x4f50d1){if(!_[_0x1eeb('0x62')](_0x3f2d5f['query'][_0x1eeb('0x63')])){_0x3f3a85=_0x3f2d5f[_0x1eeb('0x32')]['ticketType'];}return _0x212582[_0x1eeb('0x64')](_0x3f3a85)[_0x1eeb('0x65')]();}})['then'](function(_0xdd8322){var _0x4bfcf9=[_0x1eeb('0x66'),_0x1eeb('0x67'),'IsReminderSet',_0x1eeb('0x68'),_0x1eeb('0x69'),_0x1eeb('0x6a')];var _0x43d031=[_0x1eeb('0x6b'),_0x1eeb('0x6c'),_0x1eeb('0x6d'),_0x1eeb('0x6e'),_0x1eeb('0x6f'),'textarea',_0x1eeb('0x70')];if(_0xdd8322){_[_0x1eeb('0x71')](_0xdd8322['fields'],function(_0x48ef7b){return _0x4bfcf9[_0x1eeb('0x72')](_0x48ef7b[_0x1eeb('0x2a')])||!_0x43d031[_0x1eeb('0x72')](_0x48ef7b[_0x1eeb('0x30')]);});return{'count':_0xdd8322[_0x1eeb('0x37')][_0x1eeb('0x39')],'rows':_[_0x1eeb('0x2d')](_0xdd8322[_0x1eeb('0x37')],function(_0x481b60){return{'id':_0x481b60[_0x1eeb('0x2a')],'name':_0x481b60[_0x1eeb('0x73')],'custom':_0x481b60['custom'],'options':_0x481b60[_0x1eeb('0x74')][_0x1eeb('0x39')]>0x0?_[_0x1eeb('0x2d')](_0x481b60[_0x1eeb('0x74')],function(_0x5ef273){return{'name':_0x5ef273[_0x1eeb('0x73')],'value':_0x5ef273['value']};}):_0x481b60[_0x1eeb('0x30')]==_0x1eeb('0x6e')?[{'name':'True','value':_0x1eeb('0x75')},{'name':_0x1eeb('0x76'),'value':_0x1eeb('0x77')}]:[]};})};}})[_0x1eeb('0x27')](respondWithResult(_0x20c43f,null))[_0x1eeb('0x43')](function(_0x51c186){var _0x11fbbf=_0x3f2d5f[_0x1eeb('0x32')][_0x1eeb('0x78')]?0x1f4:_0x51c186[_0x1eeb('0x79')]||0x1f4;logger[_0x1eeb('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x1eeb('0x54'),_0x11fbbf,JSON['stringify'](_0x51c186));delete _0x51c186['name'];if(_0x11fbbf===0x191){_0x11fbbf=0x190;}_0x20c43f['status'](_0x11fbbf)[_0x1eeb('0x2b')](_0x3f2d5f['query']['test']?{'message':_0x1eeb('0x7a'),'statusCode':_0x51c186['statusCode']}:_0x51c186);});};
\ No newline at end of file
index 56f1146..143c81e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3893=['moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3893,0x169));var _0x3389=function(_0x2ce9d,_0x4ff962){_0x2ce9d=_0x2ce9d-0x0;var _0x578428=_0x3893[_0x2ce9d];return _0x578428;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3389('0x0'))(_0x3389('0x1'));var moment=require(_0x3389('0x2'));var BPromise=require(_0x3389('0x3'));var rp=require(_0x3389('0x4'));var fs=require('fs');var path=require(_0x3389('0x5'));var rimraf=require('rimraf');var config=require(_0x3389('0x6'));var attributes=require(_0x3389('0x7'));var integrations=require(_0x3389('0x8'));module[_0x3389('0x9')]=function(_0x28865f,_0x4946b5){return _0x28865f[_0x3389('0xa')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x32d1=['bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api'];(function(_0x267f9b,_0x22441c){var _0x3ea5a6=function(_0x1e0361){while(--_0x1e0361){_0x267f9b['push'](_0x267f9b['shift']());}};_0x3ea5a6(++_0x22441c);}(_0x32d1,0x1ae));var _0x132d=function(_0x2d7827,_0x5afb3d){_0x2d7827=_0x2d7827-0x0;var _0x2ef080=_0x32d1[_0x2d7827];return _0x2ef080;};'use strict';var _=require(_0x132d('0x0'));var util=require(_0x132d('0x1'));var logger=require(_0x132d('0x2'))(_0x132d('0x3'));var moment=require('moment');var BPromise=require(_0x132d('0x4'));var rp=require(_0x132d('0x5'));var fs=require('fs');var path=require(_0x132d('0x6'));var rimraf=require(_0x132d('0x7'));var config=require('../../config/environment');var attributes=require(_0x132d('0x8'));var integrations=require(_0x132d('0x9'));module[_0x132d('0xa')]=function(_0x1937bf,_0x1085ff){return _0x1937bf[_0x132d('0xb')](_0x132d('0xc'),attributes,{'tableName':_0x132d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 514ce91..a7eb802 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1db2=['GetSalesforceAccount','ShowSalesforceAccount','SalesforceAccount','find','where','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','attributes','limit','include','model','map','then','debug'];(function(_0x48d798,_0x4c668c){var _0x466a5b=function(_0x4fa53e){while(--_0x4fa53e){_0x48d798['push'](_0x48d798['shift']());}};_0x466a5b(++_0x4c668c);}(_0x1db2,0x6b));var _0x21db=function(_0x5653dd,_0x5a3961){_0x5653dd=_0x5653dd-0x0;var _0x160362=_0x1db2[_0x5653dd];return _0x160362;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x21db('0x0'));var rs=require(_0x21db('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x21db('0x2'))['db'];var utils=require(_0x21db('0x3'));var logger=require(_0x21db('0x4'))(_0x21db('0x5'));var config=require(_0x21db('0x6'));var jayson=require(_0x21db('0x7'));var client=jayson[_0x21db('0x8')][_0x21db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4419f5,_0x181844,_0xb81d82){return new BPromise(function(_0x38a739,_0x1e0f9c){return client['request'](_0x4419f5,_0xb81d82)['then'](function(_0x4656b8){logger[_0x21db('0xa')](_0x21db('0xb'),_0x181844,_0x21db('0xc'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x181844,'request\x20sent',JSON[_0x21db('0xd')](_0x4656b8));if(_0x4656b8[_0x21db('0xe')]){if(_0x4656b8[_0x21db('0xe')][_0x21db('0xf')]===0x1f4){logger[_0x21db('0xe')](_0x21db('0xb'),_0x181844,_0x4656b8['error'][_0x21db('0x10')]);return _0x1e0f9c(_0x4656b8['error'][_0x21db('0x10')]);}logger[_0x21db('0xe')](_0x21db('0xb'),_0x181844,_0x4656b8[_0x21db('0xe')]['message']);return _0x38a739(_0x4656b8['error']['message']);}else{logger[_0x21db('0xa')](_0x21db('0xb'),_0x181844,_0x21db('0xc'));_0x38a739(_0x4656b8[_0x21db('0x11')][_0x21db('0x10')]);}})[_0x21db('0x12')](function(_0x39a692){logger['error'](_0x21db('0xb'),_0x181844,_0x39a692);_0x1e0f9c(_0x39a692);});});}exports['GetSalesforceAccount']=function(_0x35d674){var _0x4b32b4=this;return new Promise(function(_0x5e5270,_0x472fc7){return db['SalesforceAccount'][_0x21db('0x13')]({'raw':_0x35d674[_0x21db('0x14')]?_0x35d674['options'][_0x21db('0x15')]===undefined?!![]:![]:!![],'where':_0x35d674[_0x21db('0x14')]?_0x35d674[_0x21db('0x14')]['where']||null:null,'attributes':_0x35d674['options']?_0x35d674[_0x21db('0x14')][_0x21db('0x16')]||null:null,'limit':_0x35d674[_0x21db('0x14')]?_0x35d674[_0x21db('0x14')][_0x21db('0x17')]||null:null,'include':_0x35d674[_0x21db('0x14')]?_0x35d674[_0x21db('0x14')][_0x21db('0x18')]?_['map'](_0x35d674[_0x21db('0x14')]['include'],function(_0x36fff5){return{'model':db[_0x36fff5[_0x21db('0x19')]],'as':_0x36fff5['as'],'attributes':_0x36fff5[_0x21db('0x16')],'include':_0x36fff5[_0x21db('0x18')]?_[_0x21db('0x1a')](_0x36fff5[_0x21db('0x18')],function(_0x56fb2e){return{'model':db[_0x56fb2e[_0x21db('0x19')]],'as':_0x56fb2e['as'],'attributes':_0x56fb2e[_0x21db('0x16')],'include':_0x56fb2e[_0x21db('0x18')]?_[_0x21db('0x1a')](_0x56fb2e[_0x21db('0x18')],function(_0x3f8acb){return{'model':db[_0x3f8acb['model']],'as':_0x3f8acb['as'],'attributes':_0x3f8acb[_0x21db('0x16')]};}):[]};}):[]};}):[]:[]})[_0x21db('0x1b')](function(_0x5092b5){logger['info']('GetSalesforceAccount',_0x35d674);logger[_0x21db('0x1c')]('GetSalesforceAccount',_0x35d674,JSON[_0x21db('0xd')](_0x5092b5));_0x5e5270(_0x5092b5);})[_0x21db('0x12')](function(_0x110e7d){logger['error'](_0x21db('0x1d'),_0x110e7d[_0x21db('0x10')],_0x35d674);_0x472fc7(_0x4b32b4[_0x21db('0xe')](0x1f4,_0x110e7d[_0x21db('0x10')]));});});};exports[_0x21db('0x1e')]=function(_0x4e373d){var _0x8294b5=this;return new Promise(function(_0x4080a0,_0x21a0fa){return db[_0x21db('0x1f')][_0x21db('0x20')]({'raw':_0x4e373d[_0x21db('0x14')]?_0x4e373d['options'][_0x21db('0x15')]===undefined?!![]:![]:!![],'where':_0x4e373d['options']?_0x4e373d[_0x21db('0x14')][_0x21db('0x21')]||null:null,'attributes':_0x4e373d[_0x21db('0x14')]?_0x4e373d['options'][_0x21db('0x16')]||null:null,'include':_0x4e373d[_0x21db('0x14')]?_0x4e373d[_0x21db('0x14')][_0x21db('0x18')]?_[_0x21db('0x1a')](_0x4e373d['options']['include'],function(_0x2a2b40){return{'model':db[_0x2a2b40[_0x21db('0x19')]],'as':_0x2a2b40['as'],'attributes':_0x2a2b40[_0x21db('0x16')],'include':_0x2a2b40[_0x21db('0x18')]?_['map'](_0x2a2b40[_0x21db('0x18')],function(_0x2fb21f){return{'model':db[_0x2fb21f[_0x21db('0x19')]],'as':_0x2fb21f['as'],'attributes':_0x2fb21f[_0x21db('0x16')],'include':_0x2fb21f[_0x21db('0x18')]?_[_0x21db('0x1a')](_0x2fb21f[_0x21db('0x18')],function(_0x10d532){return{'model':db[_0x10d532[_0x21db('0x19')]],'as':_0x10d532['as'],'attributes':_0x10d532['attributes']};}):[]};}):[]};}):[]:[]})[_0x21db('0x1b')](function(_0x5ebf67){logger[_0x21db('0xa')](_0x21db('0x1e'),_0x4e373d);logger['debug']('ShowSalesforceAccount',_0x4e373d,JSON[_0x21db('0xd')](_0x5ebf67));_0x4080a0(_0x5ebf67);})['catch'](function(_0x474119){logger[_0x21db('0xe')](_0x21db('0x1e'),_0x474119[_0x21db('0x10')],_0x4e373d);_0x21a0fa(_0x8294b5[_0x21db('0xe')](0x1f4,_0x474119[_0x21db('0x10')]));});});};
\ No newline at end of file
+var _0xccad=['options','where','limit','include','attributes','map','model','debug','find','raw','ShowSalesforceAccount','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSalesforceAccount'];(function(_0x141fce,_0xbb33ff){var _0x569f4a=function(_0x3b21ef){while(--_0x3b21ef){_0x141fce['push'](_0x141fce['shift']());}};_0x569f4a(++_0xbb33ff);}(_0xccad,0x10b));var _0xdcca=function(_0x2906e6,_0x5ccd59){_0x2906e6=_0x2906e6-0x0;var _0x12517a=_0xccad[_0x2906e6];return _0x12517a;};'use strict';var _=require(_0xdcca('0x0'));var util=require(_0xdcca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcca('0x2'));var db=require(_0xdcca('0x3'))['db'];var utils=require(_0xdcca('0x4'));var logger=require(_0xdcca('0x5'))('rpc');var config=require(_0xdcca('0x6'));var jayson=require(_0xdcca('0x7'));var client=jayson['client'][_0xdcca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c6ed4,_0x4713d8,_0x4ba009){return new BPromise(function(_0x15ffb1,_0x3f1c64){return client[_0xdcca('0x9')](_0x5c6ed4,_0x4ba009)[_0xdcca('0xa')](function(_0x2ec45b){logger[_0xdcca('0xb')](_0xdcca('0xc'),_0x4713d8,_0xdcca('0xd'));logger['debug'](_0xdcca('0xe'),_0x4713d8,'request\x20sent',JSON[_0xdcca('0xf')](_0x2ec45b));if(_0x2ec45b[_0xdcca('0x10')]){if(_0x2ec45b[_0xdcca('0x10')][_0xdcca('0x11')]===0x1f4){logger[_0xdcca('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x4713d8,_0x2ec45b[_0xdcca('0x10')][_0xdcca('0x12')]);return _0x3f1c64(_0x2ec45b[_0xdcca('0x10')][_0xdcca('0x12')]);}logger[_0xdcca('0x10')](_0xdcca('0xc'),_0x4713d8,_0x2ec45b[_0xdcca('0x10')][_0xdcca('0x12')]);return _0x15ffb1(_0x2ec45b['error'][_0xdcca('0x12')]);}else{logger[_0xdcca('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x4713d8,_0xdcca('0xd'));_0x15ffb1(_0x2ec45b['result']['message']);}})[_0xdcca('0x13')](function(_0x18ceb6){logger[_0xdcca('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x4713d8,_0x18ceb6);_0x3f1c64(_0x18ceb6);});});}exports[_0xdcca('0x14')]=function(_0xe0942a){var _0xb755c1=this;return new Promise(function(_0x5a7285,_0x44dcae){return db['SalesforceAccount']['findAll']({'raw':_0xe0942a[_0xdcca('0x15')]?_0xe0942a['options']['raw']===undefined?!![]:![]:!![],'where':_0xe0942a['options']?_0xe0942a[_0xdcca('0x15')][_0xdcca('0x16')]||null:null,'attributes':_0xe0942a[_0xdcca('0x15')]?_0xe0942a[_0xdcca('0x15')]['attributes']||null:null,'limit':_0xe0942a[_0xdcca('0x15')]?_0xe0942a[_0xdcca('0x15')][_0xdcca('0x17')]||null:null,'include':_0xe0942a[_0xdcca('0x15')]?_0xe0942a[_0xdcca('0x15')]['include']?_['map'](_0xe0942a['options'][_0xdcca('0x18')],function(_0x2d2092){return{'model':db[_0x2d2092['model']],'as':_0x2d2092['as'],'attributes':_0x2d2092[_0xdcca('0x19')],'include':_0x2d2092['include']?_[_0xdcca('0x1a')](_0x2d2092[_0xdcca('0x18')],function(_0x59ad27){return{'model':db[_0x59ad27[_0xdcca('0x1b')]],'as':_0x59ad27['as'],'attributes':_0x59ad27[_0xdcca('0x19')],'include':_0x59ad27['include']?_['map'](_0x59ad27[_0xdcca('0x18')],function(_0x503dd3){return{'model':db[_0x503dd3[_0xdcca('0x1b')]],'as':_0x503dd3['as'],'attributes':_0x503dd3[_0xdcca('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f6b32){logger[_0xdcca('0xb')](_0xdcca('0x14'),_0xe0942a);logger[_0xdcca('0x1c')]('GetSalesforceAccount',_0xe0942a,JSON[_0xdcca('0xf')](_0x4f6b32));_0x5a7285(_0x4f6b32);})[_0xdcca('0x13')](function(_0x697975){logger['error']('GetSalesforceAccount',_0x697975['message'],_0xe0942a);_0x44dcae(_0xb755c1['error'](0x1f4,_0x697975[_0xdcca('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0xef4d49){var _0x3f082e=this;return new Promise(function(_0x9150e7,_0x2646ab){return db['SalesforceAccount'][_0xdcca('0x1d')]({'raw':_0xef4d49[_0xdcca('0x15')]?_0xef4d49[_0xdcca('0x15')][_0xdcca('0x1e')]===undefined?!![]:![]:!![],'where':_0xef4d49['options']?_0xef4d49[_0xdcca('0x15')]['where']||null:null,'attributes':_0xef4d49[_0xdcca('0x15')]?_0xef4d49['options']['attributes']||null:null,'include':_0xef4d49[_0xdcca('0x15')]?_0xef4d49[_0xdcca('0x15')][_0xdcca('0x18')]?_[_0xdcca('0x1a')](_0xef4d49[_0xdcca('0x15')][_0xdcca('0x18')],function(_0xb1df5e){return{'model':db[_0xb1df5e[_0xdcca('0x1b')]],'as':_0xb1df5e['as'],'attributes':_0xb1df5e[_0xdcca('0x19')],'include':_0xb1df5e[_0xdcca('0x18')]?_[_0xdcca('0x1a')](_0xb1df5e[_0xdcca('0x18')],function(_0xa736c7){return{'model':db[_0xa736c7['model']],'as':_0xa736c7['as'],'attributes':_0xa736c7[_0xdcca('0x19')],'include':_0xa736c7[_0xdcca('0x18')]?_[_0xdcca('0x1a')](_0xa736c7[_0xdcca('0x18')],function(_0x1be3fd){return{'model':db[_0x1be3fd[_0xdcca('0x1b')]],'as':_0x1be3fd['as'],'attributes':_0x1be3fd['attributes']};}):[]};}):[]};}):[]:[]})[_0xdcca('0xa')](function(_0x514f07){logger[_0xdcca('0xb')](_0xdcca('0x1f'),_0xef4d49);logger[_0xdcca('0x1c')]('ShowSalesforceAccount',_0xef4d49,JSON[_0xdcca('0xf')](_0x514f07));_0x9150e7(_0x514f07);})['catch'](function(_0x3740d5){logger[_0xdcca('0x10')](_0xdcca('0x1f'),_0x3740d5[_0xdcca('0x12')],_0xef4d49);_0x2646ab(_0x3f082e[_0xdcca('0x10')](0x1f4,_0x3740d5[_0xdcca('0x12')]));});});};
\ No newline at end of file
index 59e95a1..d4fb3de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x355d8c,_0x2de949){var _0xd527fa=function(_0x49ca82){while(--_0x49ca82){_0x355d8c['push'](_0x355d8c['shift']());}};_0xd527fa(++_0x2de949);}(_0x5f2f,0x73));var _0xf5f2=function(_0x304a82,_0xd30762){_0x304a82=_0x304a82-0x0;var _0x3b6602=_0x5f2f[_0x304a82];return _0x3b6602;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xdb28,0x106));var _0x8db2=function(_0x4b8d76,_0x50a2ce){_0x4b8d76=_0x4b8d76-0x0;var _0x579903=_0xdb28[_0x4b8d76];return _0x579903;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router;
\ No newline at end of file
index a582d00..44f78d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa521=['account_contact_lead','account','nothing','STRING','sequelize','exports','ENUM','Task','contact_lead','contact','lead'];(function(_0x358e9e,_0x4fcd24){var _0xdc796a=function(_0x3d738d){while(--_0x3d738d){_0x358e9e['push'](_0x358e9e['shift']());}};_0xdc796a(++_0x4fcd24);}(_0xa521,0xeb));var _0x1a52=function(_0x27ec69,_0x4baae5){_0x27ec69=_0x27ec69-0x0;var _0x2d3599=_0xa521[_0x27ec69];return _0x2d3599;};'use strict';var Sequelize=require(_0x1a52('0x0'));module[_0x1a52('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x1a52('0x2')](_0x1a52('0x3'),'Case'),'defaultValue':_0x1a52('0x3')},'moduleSearch':{'type':Sequelize[_0x1a52('0x2')](_0x1a52('0x4'),_0x1a52('0x5'),_0x1a52('0x6'),_0x1a52('0x7'),_0x1a52('0x8')),'defaultValue':_0x1a52('0x4')},'moduleCreate':{'type':Sequelize[_0x1a52('0x2')](_0x1a52('0x9'),'contact','lead','account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x1a52('0xa')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x1a52('0xa')]},'additionalSearchLead':{'type':Sequelize[_0x1a52('0xa')]}};
\ No newline at end of file
+var _0xb1f8=['account_contact_lead','account','nothing','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead'];(function(_0x4742d7,_0x356348){var _0x3c7599=function(_0x4de742){while(--_0x4de742){_0x4742d7['push'](_0x4742d7['shift']());}};_0x3c7599(++_0x356348);}(_0xb1f8,0x1a5));var _0x8b1f=function(_0x53d855,_0x94e72a){_0x53d855=_0x53d855-0x0;var _0x41ea0a=_0xb1f8[_0x53d855];return _0x41ea0a;};'use strict';var Sequelize=require('sequelize');module[_0x8b1f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b1f('0x1')]},'ticketType':{'type':Sequelize[_0x8b1f('0x2')](_0x8b1f('0x3'),_0x8b1f('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x8b1f('0x2')](_0x8b1f('0x5'),_0x8b1f('0x6'),_0x8b1f('0x7'),_0x8b1f('0x8'),_0x8b1f('0x9')),'defaultValue':_0x8b1f('0x5')},'moduleCreate':{'type':Sequelize[_0x8b1f('0x2')](_0x8b1f('0xa'),'contact',_0x8b1f('0x7'),_0x8b1f('0x9')),'defaultValue':_0x8b1f('0x7')},'leadId':{'type':Sequelize[_0x8b1f('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x8b1f('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x8b1f('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x8b1f('0x1')]}};
\ No newline at end of file
index 03c080b..ef6e073 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f10=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','rows','catch','show','params','create','body','getFields','findOne','SalesforceField','getSubjects','pick','getDescriptions','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3a359c,_0x3c3921){var _0x4542fe=function(_0x3ef65b){while(--_0x3ef65b){_0x3a359c['push'](_0x3a359c['shift']());}};_0x4542fe(++_0x3c3921);}(_0x5f10,0xd5));var _0x05f1=function(_0x3891e8,_0x3b6b95){_0x3891e8=_0x3891e8-0x0;var _0xc34c60=_0x5f10[_0x3891e8];return _0xc34c60;};'use strict';var emlformat=require(_0x05f1('0x0'));var rimraf=require(_0x05f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x05f1('0x2'));var BPromise=require(_0x05f1('0x3'));var Mustache=require(_0x05f1('0x4'));var util=require(_0x05f1('0x5'));var path=require(_0x05f1('0x6'));var sox=require(_0x05f1('0x7'));var csv=require('to-csv');var ejs=require(_0x05f1('0x8'));var fs=require('fs');var fs_extra=require(_0x05f1('0x9'));var _=require(_0x05f1('0xa'));var squel=require('squel');var crypto=require(_0x05f1('0xb'));var jsforce=require(_0x05f1('0xc'));var deskjs=require(_0x05f1('0xd'));var toCsv=require(_0x05f1('0xe'));var querystring=require(_0x05f1('0xf'));var Papa=require(_0x05f1('0x10'));var Redis=require('ioredis');var authService=require(_0x05f1('0x11'));var qs=require(_0x05f1('0x12'));var as=require(_0x05f1('0x13'));var hardwareService=require(_0x05f1('0x14'));var logger=require(_0x05f1('0x15'))(_0x05f1('0x16'));var utils=require('../../config/utils');var config=require(_0x05f1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x05f1('0x18'))['db'];function respondWithStatusCode(_0x180257,_0x2e1ade){_0x2e1ade=_0x2e1ade||0xcc;return function(_0x150ba4){if(_0x150ba4){return _0x180257[_0x05f1('0x19')](_0x2e1ade);}return _0x180257[_0x05f1('0x1a')](_0x2e1ade)[_0x05f1('0x1b')]();};}function respondWithResult(_0x1fae83,_0x407c6d){_0x407c6d=_0x407c6d||0xc8;return function(_0x5b47c7){if(_0x5b47c7){return _0x1fae83[_0x05f1('0x1a')](_0x407c6d)[_0x05f1('0x1c')](_0x5b47c7);}};}function respondWithFilteredResult(_0x12c403,_0x238e75){return function(_0x4a8489){if(_0x4a8489){var _0x3d1cd6=typeof _0x238e75[_0x05f1('0x1d')]===_0x05f1('0x1e')&&typeof _0x238e75[_0x05f1('0x1f')]===_0x05f1('0x1e');var _0x11afed=_0x4a8489[_0x05f1('0x20')];var _0x38979b=_0x3d1cd6?0x0:_0x238e75[_0x05f1('0x1d')];var _0x44f1e6=_0x3d1cd6?_0x4a8489[_0x05f1('0x20')]:_0x238e75[_0x05f1('0x1d')]+_0x238e75[_0x05f1('0x1f')];var _0x367a58;if(_0x44f1e6>=_0x11afed){_0x44f1e6=_0x11afed;_0x367a58=0xc8;}else{_0x367a58=0xce;}_0x12c403['status'](_0x367a58);return _0x12c403[_0x05f1('0x21')](_0x05f1('0x22'),_0x38979b+'-'+_0x44f1e6+'/'+_0x11afed)[_0x05f1('0x1c')](_0x4a8489);}return null;};}function patchUpdates(_0x2d3e4a){return function(_0x27ac9b){try{jsonpatch['apply'](_0x27ac9b,_0x2d3e4a,!![]);}catch(_0x45c7ab){return BPromise[_0x05f1('0x23')](_0x45c7ab);}return _0x27ac9b['save']();};}function saveUpdates(_0xaf9903,_0x2ea146){return function(_0x15abec){if(_0x15abec){return _0x15abec[_0x05f1('0x24')](_0xaf9903)['then'](function(_0x52ef80){return _0x52ef80;});}return null;};}function removeEntity(_0x2ea7ba,_0x46eb59){return function(_0x11e4e5){if(_0x11e4e5){return _0x11e4e5[_0x05f1('0x25')]()[_0x05f1('0x26')](function(){_0x2ea7ba['status'](0xcc)[_0x05f1('0x1b')]();});}};}function handleEntityNotFound(_0x61148c,_0x5b7602){return function(_0x213b18){if(!_0x213b18){_0x61148c['sendStatus'](0x194);}return _0x213b18;};}function handleError(_0x54e497,_0x2ba26d){_0x2ba26d=_0x2ba26d||0x1f4;return function(_0x3bce89){logger[_0x05f1('0x27')](_0x3bce89[_0x05f1('0x28')]);if(_0x3bce89[_0x05f1('0x29')]){delete _0x3bce89[_0x05f1('0x29')];}_0x54e497['status'](_0x2ba26d)[_0x05f1('0x2a')](_0x3bce89);};}exports[_0x05f1('0x2b')]=function(_0x95336e,_0x4a151e){var _0x4e02e8={},_0x56e1c9={},_0xcda2b={'count':0x0,'rows':[]};var _0x1d0ac6=_[_0x05f1('0x2c')](db[_0x05f1('0x2d')][_0x05f1('0x2e')],function(_0x481b4c){return{'name':_0x481b4c['fieldName'],'type':_0x481b4c['type'][_0x05f1('0x2f')]};});_0x56e1c9[_0x05f1('0x30')]=_[_0x05f1('0x2c')](_0x1d0ac6,_0x05f1('0x29'));_0x56e1c9[_0x05f1('0x31')]=_[_0x05f1('0x32')](_0x95336e['query']);_0x56e1c9[_0x05f1('0x33')]=_[_0x05f1('0x34')](_0x56e1c9['model'],_0x56e1c9[_0x05f1('0x31')]);_0x4e02e8[_0x05f1('0x35')]=_['intersection'](_0x56e1c9[_0x05f1('0x30')],qs[_0x05f1('0x36')](_0x95336e['query'][_0x05f1('0x36')]));_0x4e02e8['attributes']=_0x4e02e8['attributes'][_0x05f1('0x37')]?_0x4e02e8[_0x05f1('0x35')]:_0x56e1c9[_0x05f1('0x30')];if(!_0x95336e[_0x05f1('0x31')][_0x05f1('0x38')](_0x05f1('0x39'))){_0x4e02e8[_0x05f1('0x1f')]=qs[_0x05f1('0x1f')](_0x95336e[_0x05f1('0x31')][_0x05f1('0x1f')]);_0x4e02e8[_0x05f1('0x1d')]=qs['offset'](_0x95336e[_0x05f1('0x31')][_0x05f1('0x1d')]);}_0x4e02e8[_0x05f1('0x3a')]=qs[_0x05f1('0x3b')](_0x95336e[_0x05f1('0x31')][_0x05f1('0x3b')]);_0x4e02e8[_0x05f1('0x3c')]=qs['filters'](_['pick'](_0x95336e['query'],_0x56e1c9[_0x05f1('0x33')]),_0x1d0ac6);if(_0x95336e[_0x05f1('0x31')][_0x05f1('0x3d')]){_0x4e02e8[_0x05f1('0x3c')]=_[_0x05f1('0x3e')](_0x4e02e8[_0x05f1('0x3c')],{'$or':_[_0x05f1('0x2c')](_0x1d0ac6,function(_0x499ff2){if(_0x499ff2[_0x05f1('0x3f')]!==_0x05f1('0x40')){var _0x3f4d0a={};_0x3f4d0a[_0x499ff2[_0x05f1('0x29')]]={'$like':'%'+_0x95336e['query'][_0x05f1('0x3d')]+'%'};return _0x3f4d0a;}})});}_0x4e02e8=_[_0x05f1('0x3e')]({},_0x4e02e8,_0x95336e[_0x05f1('0x41')]);var _0x25cc6f={'where':_0x4e02e8[_0x05f1('0x3c')]};return db[_0x05f1('0x2d')][_0x05f1('0x20')](_0x25cc6f)[_0x05f1('0x26')](function(_0x502c22){_0xcda2b[_0x05f1('0x20')]=_0x502c22;if(_0x95336e['query']['includeAll']){_0x4e02e8['include']=[{'all':!![]}];}return db[_0x05f1('0x2d')]['findAll'](_0x4e02e8);})[_0x05f1('0x26')](function(_0x193d6c){_0xcda2b[_0x05f1('0x42')]=_0x193d6c;return _0xcda2b;})[_0x05f1('0x26')](respondWithFilteredResult(_0x4a151e,_0x4e02e8))[_0x05f1('0x43')](handleError(_0x4a151e,null));};exports[_0x05f1('0x44')]=function(_0x2f2998,_0x268975){var _0x213923={'raw':![],'where':{'id':_0x2f2998[_0x05f1('0x45')]['id']}},_0x9c0e45={};_0x9c0e45[_0x05f1('0x30')]=_['keys'](db[_0x05f1('0x2d')][_0x05f1('0x2e')]);_0x9c0e45[_0x05f1('0x31')]=_[_0x05f1('0x32')](_0x2f2998['query']);_0x9c0e45['filters']=_[_0x05f1('0x34')](_0x9c0e45['model'],_0x9c0e45['query']);_0x213923[_0x05f1('0x35')]=_[_0x05f1('0x34')](_0x9c0e45['model'],qs[_0x05f1('0x36')](_0x2f2998[_0x05f1('0x31')][_0x05f1('0x36')]));_0x213923['attributes']=_0x213923['attributes'][_0x05f1('0x37')]?_0x213923[_0x05f1('0x35')]:_0x9c0e45[_0x05f1('0x30')];if(_0x2f2998['query']['includeAll']){_0x213923['include']=[{'all':!![]}];}_0x213923=_[_0x05f1('0x3e')]({},_0x213923,_0x2f2998[_0x05f1('0x41')]);return db[_0x05f1('0x2d')]['find'](_0x213923)[_0x05f1('0x26')](handleEntityNotFound(_0x268975,null))['then'](respondWithResult(_0x268975,null))[_0x05f1('0x43')](handleError(_0x268975,null));};exports[_0x05f1('0x46')]=function(_0x4b2413,_0x586f5a){return db[_0x05f1('0x2d')][_0x05f1('0x46')](_0x4b2413[_0x05f1('0x47')],{})['then'](respondWithResult(_0x586f5a,0xc9))[_0x05f1('0x43')](handleError(_0x586f5a,null));};exports[_0x05f1('0x24')]=function(_0x42c428,_0x23a951){if(_0x42c428[_0x05f1('0x47')]['id']){delete _0x42c428[_0x05f1('0x47')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x42c428[_0x05f1('0x45')]['id']}})[_0x05f1('0x26')](handleEntityNotFound(_0x23a951,null))['then'](saveUpdates(_0x42c428[_0x05f1('0x47')],null))['then'](respondWithResult(_0x23a951,null))[_0x05f1('0x43')](handleError(_0x23a951,null));};exports[_0x05f1('0x25')]=function(_0x5cb203,_0x426ec1){return db['SalesforceConfiguration']['find']({'where':{'id':_0x5cb203['params']['id']}})[_0x05f1('0x26')](handleEntityNotFound(_0x426ec1,null))[_0x05f1('0x26')](removeEntity(_0x426ec1,null))['catch'](handleError(_0x426ec1,null));};exports[_0x05f1('0x48')]=function(_0x67e444,_0x346dbb,_0x337f9b){var _0x2395ad={};var _0x2ab4b3={};var _0x446b01;var _0x192141;return db[_0x05f1('0x2d')][_0x05f1('0x49')]({'where':{'id':_0x67e444['params']['id']}})[_0x05f1('0x26')](handleEntityNotFound(_0x346dbb,null))['then'](function(_0x5b36aa){if(_0x5b36aa){_0x446b01=_0x5b36aa;_0x2ab4b3[_0x05f1('0x30')]=_[_0x05f1('0x32')](db[_0x05f1('0x4a')][_0x05f1('0x2e')]);_0x2ab4b3['query']=_['keys'](_0x67e444[_0x05f1('0x31')]);_0x2ab4b3[_0x05f1('0x33')]=_[_0x05f1('0x34')](_0x2ab4b3[_0x05f1('0x30')],_0x2ab4b3[_0x05f1('0x31')]);_0x2395ad[_0x05f1('0x35')]=_['intersection'](_0x2ab4b3[_0x05f1('0x30')],qs[_0x05f1('0x36')](_0x67e444[_0x05f1('0x31')]['fields']));_0x2395ad[_0x05f1('0x35')]=_0x2395ad[_0x05f1('0x35')]['length']?_0x2395ad[_0x05f1('0x35')]:_0x2ab4b3[_0x05f1('0x30')];_0x2395ad[_0x05f1('0x3a')]=qs[_0x05f1('0x3b')](_0x67e444[_0x05f1('0x31')]['sort']);_0x2395ad[_0x05f1('0x3c')]=qs[_0x05f1('0x33')](_['pick'](_0x67e444[_0x05f1('0x31')],_0x2ab4b3['filters']));if(_0x67e444[_0x05f1('0x31')][_0x05f1('0x3d')]){_0x2395ad[_0x05f1('0x3c')]=_['merge'](_0x2395ad[_0x05f1('0x3c')],{'$or':_[_0x05f1('0x2c')](_0x2395ad['attributes'],function(_0xe4322f){var _0x2ffbf6={};_0x2ffbf6[_0xe4322f]={'$like':'%'+_0x67e444[_0x05f1('0x31')][_0x05f1('0x3d')]+'%'};return _0x2ffbf6;})});}_0x2395ad=_[_0x05f1('0x3e')]({},_0x2395ad,_0x67e444['options']);return _0x446b01[_0x05f1('0x48')](_0x2395ad);}})[_0x05f1('0x26')](function(_0x20aaa2){if(_0x20aaa2){_0x192141=_0x20aaa2[_0x05f1('0x37')];if(!_0x67e444[_0x05f1('0x31')]['hasOwnProperty'](_0x05f1('0x39'))){_0x2395ad[_0x05f1('0x1f')]=qs['limit'](_0x67e444[_0x05f1('0x31')][_0x05f1('0x1f')]);_0x2395ad['offset']=qs['offset'](_0x67e444[_0x05f1('0x31')][_0x05f1('0x1d')]);}return _0x446b01[_0x05f1('0x48')](_0x2395ad);}})[_0x05f1('0x26')](function(_0x78dcdf){if(_0x78dcdf){return _0x78dcdf?{'count':_0x192141,'rows':_0x78dcdf}:null;}})[_0x05f1('0x26')](respondWithResult(_0x346dbb,null))[_0x05f1('0x43')](handleError(_0x346dbb,null));};exports[_0x05f1('0x4b')]=function(_0x138086,_0xd169e6,_0x11e444){var _0x81cdeb={};var _0x4f124c={};var _0x3eee41;var _0x2956c2;return db[_0x05f1('0x2d')][_0x05f1('0x49')]({'where':{'id':_0x138086['params']['id']}})[_0x05f1('0x26')](handleEntityNotFound(_0xd169e6,null))[_0x05f1('0x26')](function(_0x1d562a){if(_0x1d562a){_0x3eee41=_0x1d562a;_0x4f124c[_0x05f1('0x30')]=_[_0x05f1('0x32')](db[_0x05f1('0x4a')][_0x05f1('0x2e')]);_0x4f124c['query']=_['keys'](_0x138086[_0x05f1('0x31')]);_0x4f124c['filters']=_[_0x05f1('0x34')](_0x4f124c['model'],_0x4f124c['query']);_0x81cdeb['attributes']=_['intersection'](_0x4f124c['model'],qs[_0x05f1('0x36')](_0x138086[_0x05f1('0x31')][_0x05f1('0x36')]));_0x81cdeb['attributes']=_0x81cdeb[_0x05f1('0x35')][_0x05f1('0x37')]?_0x81cdeb[_0x05f1('0x35')]:_0x4f124c[_0x05f1('0x30')];_0x81cdeb[_0x05f1('0x3a')]=qs[_0x05f1('0x3b')](_0x138086['query'][_0x05f1('0x3b')]);_0x81cdeb[_0x05f1('0x3c')]=qs[_0x05f1('0x33')](_[_0x05f1('0x4c')](_0x138086[_0x05f1('0x31')],_0x4f124c[_0x05f1('0x33')]));if(_0x138086['query']['filter']){_0x81cdeb[_0x05f1('0x3c')]=_[_0x05f1('0x3e')](_0x81cdeb[_0x05f1('0x3c')],{'$or':_['map'](_0x81cdeb[_0x05f1('0x35')],function(_0x44cacb){var _0x113da8={};_0x113da8[_0x44cacb]={'$like':'%'+_0x138086['query'][_0x05f1('0x3d')]+'%'};return _0x113da8;})});}_0x81cdeb=_[_0x05f1('0x3e')]({},_0x81cdeb,_0x138086[_0x05f1('0x41')]);return _0x3eee41[_0x05f1('0x4b')](_0x81cdeb);}})[_0x05f1('0x26')](function(_0x23d7ab){if(_0x23d7ab){_0x2956c2=_0x23d7ab[_0x05f1('0x37')];if(!_0x138086['query'][_0x05f1('0x38')](_0x05f1('0x39'))){_0x81cdeb[_0x05f1('0x1f')]=qs[_0x05f1('0x1f')](_0x138086['query'][_0x05f1('0x1f')]);_0x81cdeb[_0x05f1('0x1d')]=qs[_0x05f1('0x1d')](_0x138086[_0x05f1('0x31')][_0x05f1('0x1d')]);}return _0x3eee41[_0x05f1('0x4b')](_0x81cdeb);}})[_0x05f1('0x26')](function(_0xfbe10e){if(_0xfbe10e){return _0xfbe10e?{'count':_0x2956c2,'rows':_0xfbe10e}:null;}})[_0x05f1('0x26')](respondWithResult(_0xd169e6,null))[_0x05f1('0x43')](handleError(_0xd169e6,null));};exports['getDescriptions']=function(_0x494e7c,_0xcbbcb7,_0x13053d){var _0x1b1814={};var _0x46bc31={};var _0x311179;var _0x442b52;return db[_0x05f1('0x2d')][_0x05f1('0x49')]({'where':{'id':_0x494e7c[_0x05f1('0x45')]['id']}})[_0x05f1('0x26')](handleEntityNotFound(_0xcbbcb7,null))[_0x05f1('0x26')](function(_0x3c20ac){if(_0x3c20ac){_0x311179=_0x3c20ac;_0x46bc31[_0x05f1('0x30')]=_['keys'](db[_0x05f1('0x4a')]['rawAttributes']);_0x46bc31[_0x05f1('0x31')]=_[_0x05f1('0x32')](_0x494e7c[_0x05f1('0x31')]);_0x46bc31[_0x05f1('0x33')]=_[_0x05f1('0x34')](_0x46bc31[_0x05f1('0x30')],_0x46bc31['query']);_0x1b1814[_0x05f1('0x35')]=_[_0x05f1('0x34')](_0x46bc31[_0x05f1('0x30')],qs[_0x05f1('0x36')](_0x494e7c[_0x05f1('0x31')]['fields']));_0x1b1814[_0x05f1('0x35')]=_0x1b1814['attributes'][_0x05f1('0x37')]?_0x1b1814[_0x05f1('0x35')]:_0x46bc31[_0x05f1('0x30')];_0x1b1814[_0x05f1('0x3a')]=qs[_0x05f1('0x3b')](_0x494e7c[_0x05f1('0x31')]['sort']);_0x1b1814[_0x05f1('0x3c')]=qs[_0x05f1('0x33')](_[_0x05f1('0x4c')](_0x494e7c['query'],_0x46bc31[_0x05f1('0x33')]));if(_0x494e7c[_0x05f1('0x31')][_0x05f1('0x3d')]){_0x1b1814[_0x05f1('0x3c')]=_[_0x05f1('0x3e')](_0x1b1814[_0x05f1('0x3c')],{'$or':_[_0x05f1('0x2c')](_0x1b1814['attributes'],function(_0x3b2a2c){var _0x44a495={};_0x44a495[_0x3b2a2c]={'$like':'%'+_0x494e7c[_0x05f1('0x31')][_0x05f1('0x3d')]+'%'};return _0x44a495;})});}_0x1b1814=_[_0x05f1('0x3e')]({},_0x1b1814,_0x494e7c['options']);return _0x311179[_0x05f1('0x4d')](_0x1b1814);}})[_0x05f1('0x26')](function(_0x2739e0){if(_0x2739e0){_0x442b52=_0x2739e0['length'];if(!_0x494e7c[_0x05f1('0x31')][_0x05f1('0x38')]('nolimit')){_0x1b1814[_0x05f1('0x1f')]=qs[_0x05f1('0x1f')](_0x494e7c[_0x05f1('0x31')][_0x05f1('0x1f')]);_0x1b1814[_0x05f1('0x1d')]=qs[_0x05f1('0x1d')](_0x494e7c[_0x05f1('0x31')][_0x05f1('0x1d')]);}return _0x311179[_0x05f1('0x4d')](_0x1b1814);}})[_0x05f1('0x26')](function(_0x147a7c){if(_0x147a7c){return _0x147a7c?{'count':_0x442b52,'rows':_0x147a7c}:null;}})[_0x05f1('0x26')](respondWithResult(_0xcbbcb7,null))['catch'](handleError(_0xcbbcb7,null));};
\ No newline at end of file
+var _0x15b6=['type','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','getFields','SalesforceField','order','hasOwnProperty','getSubjects','getDescriptions','options','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge'];(function(_0x46e570,_0x42f992){var _0x1bd1ab=function(_0x4cbcaf){while(--_0x4cbcaf){_0x46e570['push'](_0x46e570['shift']());}};_0x1bd1ab(++_0x42f992);}(_0x15b6,0x1a9));var _0x615b=function(_0x3bbc1e,_0x2dfc0e){_0x3bbc1e=_0x3bbc1e-0x0;var _0x373bc2=_0x15b6[_0x3bbc1e];return _0x373bc2;};'use strict';var emlformat=require(_0x615b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x615b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x615b('0x2'));var moment=require(_0x615b('0x3'));var BPromise=require(_0x615b('0x4'));var Mustache=require('mustache');var util=require(_0x615b('0x5'));var path=require(_0x615b('0x6'));var sox=require(_0x615b('0x7'));var csv=require(_0x615b('0x8'));var ejs=require(_0x615b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x615b('0xa'));var squel=require('squel');var crypto=require(_0x615b('0xb'));var jsforce=require(_0x615b('0xc'));var deskjs=require(_0x615b('0xd'));var toCsv=require(_0x615b('0x8'));var querystring=require(_0x615b('0xe'));var Papa=require('papaparse');var Redis=require(_0x615b('0xf'));var authService=require(_0x615b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x615b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x615b('0x12'))(_0x615b('0x13'));var utils=require(_0x615b('0x14'));var config=require(_0x615b('0x15'));var licenseUtil=require(_0x615b('0x16'));var db=require(_0x615b('0x17'))['db'];function respondWithStatusCode(_0x1c842c,_0x582371){_0x582371=_0x582371||0xcc;return function(_0x742072){if(_0x742072){return _0x1c842c[_0x615b('0x18')](_0x582371);}return _0x1c842c[_0x615b('0x19')](_0x582371)[_0x615b('0x1a')]();};}function respondWithResult(_0x170f14,_0x29a888){_0x29a888=_0x29a888||0xc8;return function(_0x2065a4){if(_0x2065a4){return _0x170f14[_0x615b('0x19')](_0x29a888)[_0x615b('0x1b')](_0x2065a4);}};}function respondWithFilteredResult(_0xb9539e,_0x2f6ba1){return function(_0x2a6b24){if(_0x2a6b24){var _0x7c25df=typeof _0x2f6ba1[_0x615b('0x1c')]===_0x615b('0x1d')&&typeof _0x2f6ba1[_0x615b('0x1e')]===_0x615b('0x1d');var _0x50609a=_0x2a6b24[_0x615b('0x1f')];var _0x1e93ae=_0x7c25df?0x0:_0x2f6ba1[_0x615b('0x1c')];var _0x319949=_0x7c25df?_0x2a6b24[_0x615b('0x1f')]:_0x2f6ba1['offset']+_0x2f6ba1[_0x615b('0x1e')];var _0x39d175;if(_0x319949>=_0x50609a){_0x319949=_0x50609a;_0x39d175=0xc8;}else{_0x39d175=0xce;}_0xb9539e[_0x615b('0x19')](_0x39d175);return _0xb9539e[_0x615b('0x20')]('Content-Range',_0x1e93ae+'-'+_0x319949+'/'+_0x50609a)['json'](_0x2a6b24);}return null;};}function patchUpdates(_0x51cf57){return function(_0x293df8){try{jsonpatch[_0x615b('0x21')](_0x293df8,_0x51cf57,!![]);}catch(_0x562daa){return BPromise[_0x615b('0x22')](_0x562daa);}return _0x293df8[_0x615b('0x23')]();};}function saveUpdates(_0x280136,_0x1f5fb0){return function(_0x51c4c9){if(_0x51c4c9){return _0x51c4c9[_0x615b('0x24')](_0x280136)[_0x615b('0x25')](function(_0x49a4a3){return _0x49a4a3;});}return null;};}function removeEntity(_0xb82355,_0x26d258){return function(_0x586d74){if(_0x586d74){return _0x586d74[_0x615b('0x26')]()[_0x615b('0x25')](function(){_0xb82355[_0x615b('0x19')](0xcc)[_0x615b('0x1a')]();});}};}function handleEntityNotFound(_0x34faa2,_0x92ec32){return function(_0x39c126){if(!_0x39c126){_0x34faa2[_0x615b('0x18')](0x194);}return _0x39c126;};}function handleError(_0x1f0c62,_0x27b066){_0x27b066=_0x27b066||0x1f4;return function(_0x1a5b69){logger[_0x615b('0x27')](_0x1a5b69['stack']);if(_0x1a5b69[_0x615b('0x28')]){delete _0x1a5b69[_0x615b('0x28')];}_0x1f0c62['status'](_0x27b066)[_0x615b('0x29')](_0x1a5b69);};}exports[_0x615b('0x2a')]=function(_0x499e94,_0x2d5fe9){var _0x307c99={},_0xfff2f4={},_0xb67d5c={'count':0x0,'rows':[]};var _0x488f55=_[_0x615b('0x2b')](db[_0x615b('0x2c')][_0x615b('0x2d')],function(_0x3c6f0c){return{'name':_0x3c6f0c[_0x615b('0x2e')],'type':_0x3c6f0c['type'][_0x615b('0x2f')]};});_0xfff2f4[_0x615b('0x30')]=_[_0x615b('0x2b')](_0x488f55,_0x615b('0x28'));_0xfff2f4[_0x615b('0x31')]=_['keys'](_0x499e94[_0x615b('0x31')]);_0xfff2f4[_0x615b('0x32')]=_[_0x615b('0x33')](_0xfff2f4[_0x615b('0x30')],_0xfff2f4[_0x615b('0x31')]);_0x307c99[_0x615b('0x34')]=_[_0x615b('0x33')](_0xfff2f4[_0x615b('0x30')],qs[_0x615b('0x35')](_0x499e94[_0x615b('0x31')][_0x615b('0x35')]));_0x307c99[_0x615b('0x34')]=_0x307c99['attributes'][_0x615b('0x36')]?_0x307c99['attributes']:_0xfff2f4['model'];if(!_0x499e94['query']['hasOwnProperty'](_0x615b('0x37'))){_0x307c99[_0x615b('0x1e')]=qs[_0x615b('0x1e')](_0x499e94[_0x615b('0x31')][_0x615b('0x1e')]);_0x307c99[_0x615b('0x1c')]=qs['offset'](_0x499e94[_0x615b('0x31')][_0x615b('0x1c')]);}_0x307c99['order']=qs['sort'](_0x499e94['query'][_0x615b('0x38')]);_0x307c99[_0x615b('0x39')]=qs[_0x615b('0x32')](_[_0x615b('0x3a')](_0x499e94[_0x615b('0x31')],_0xfff2f4[_0x615b('0x32')]),_0x488f55);if(_0x499e94[_0x615b('0x31')][_0x615b('0x3b')]){_0x307c99[_0x615b('0x39')]=_[_0x615b('0x3c')](_0x307c99['where'],{'$or':_[_0x615b('0x2b')](_0x488f55,function(_0x46e28d){if(_0x46e28d[_0x615b('0x3d')]!==_0x615b('0x3e')){var _0x146008={};_0x146008[_0x46e28d[_0x615b('0x28')]]={'$like':'%'+_0x499e94[_0x615b('0x31')]['filter']+'%'};return _0x146008;}})});}_0x307c99=_[_0x615b('0x3c')]({},_0x307c99,_0x499e94['options']);var _0x3e50fe={'where':_0x307c99[_0x615b('0x39')]};return db[_0x615b('0x2c')][_0x615b('0x1f')](_0x3e50fe)['then'](function(_0x42d5d5){_0xb67d5c[_0x615b('0x1f')]=_0x42d5d5;if(_0x499e94['query'][_0x615b('0x3f')]){_0x307c99[_0x615b('0x40')]=[{'all':!![]}];}return db[_0x615b('0x2c')][_0x615b('0x41')](_0x307c99);})[_0x615b('0x25')](function(_0x490f5e){_0xb67d5c[_0x615b('0x42')]=_0x490f5e;return _0xb67d5c;})[_0x615b('0x25')](respondWithFilteredResult(_0x2d5fe9,_0x307c99))['catch'](handleError(_0x2d5fe9,null));};exports[_0x615b('0x43')]=function(_0x29482b,_0x48ed54){var _0x3ff478={'raw':![],'where':{'id':_0x29482b[_0x615b('0x44')]['id']}},_0x59d3ba={};_0x59d3ba[_0x615b('0x30')]=_[_0x615b('0x45')](db['SalesforceConfiguration'][_0x615b('0x2d')]);_0x59d3ba[_0x615b('0x31')]=_['keys'](_0x29482b[_0x615b('0x31')]);_0x59d3ba[_0x615b('0x32')]=_[_0x615b('0x33')](_0x59d3ba[_0x615b('0x30')],_0x59d3ba['query']);_0x3ff478['attributes']=_['intersection'](_0x59d3ba[_0x615b('0x30')],qs[_0x615b('0x35')](_0x29482b[_0x615b('0x31')][_0x615b('0x35')]));_0x3ff478['attributes']=_0x3ff478[_0x615b('0x34')][_0x615b('0x36')]?_0x3ff478[_0x615b('0x34')]:_0x59d3ba[_0x615b('0x30')];if(_0x29482b[_0x615b('0x31')][_0x615b('0x3f')]){_0x3ff478['include']=[{'all':!![]}];}_0x3ff478=_[_0x615b('0x3c')]({},_0x3ff478,_0x29482b['options']);return db[_0x615b('0x2c')]['find'](_0x3ff478)['then'](handleEntityNotFound(_0x48ed54,null))[_0x615b('0x25')](respondWithResult(_0x48ed54,null))[_0x615b('0x46')](handleError(_0x48ed54,null));};exports[_0x615b('0x47')]=function(_0x1d98ec,_0xb67051){return db[_0x615b('0x2c')][_0x615b('0x47')](_0x1d98ec['body'],{})[_0x615b('0x25')](respondWithResult(_0xb67051,0xc9))['catch'](handleError(_0xb67051,null));};exports[_0x615b('0x24')]=function(_0x56a2d5,_0x409907){if(_0x56a2d5['body']['id']){delete _0x56a2d5[_0x615b('0x48')]['id'];}return db[_0x615b('0x2c')][_0x615b('0x49')]({'where':{'id':_0x56a2d5[_0x615b('0x44')]['id']}})['then'](handleEntityNotFound(_0x409907,null))[_0x615b('0x25')](saveUpdates(_0x56a2d5[_0x615b('0x48')],null))[_0x615b('0x25')](respondWithResult(_0x409907,null))[_0x615b('0x46')](handleError(_0x409907,null));};exports[_0x615b('0x26')]=function(_0x40d168,_0x58e861){return db[_0x615b('0x2c')]['find']({'where':{'id':_0x40d168[_0x615b('0x44')]['id']}})[_0x615b('0x25')](handleEntityNotFound(_0x58e861,null))[_0x615b('0x25')](removeEntity(_0x58e861,null))[_0x615b('0x46')](handleError(_0x58e861,null));};exports[_0x615b('0x4a')]=function(_0x3a2330,_0xdd6873,_0x3490f2){var _0x459739={};var _0x46291e={};var _0x33f461;var _0x5deca8;return db[_0x615b('0x2c')]['findOne']({'where':{'id':_0x3a2330['params']['id']}})['then'](handleEntityNotFound(_0xdd6873,null))[_0x615b('0x25')](function(_0x46b0a0){if(_0x46b0a0){_0x33f461=_0x46b0a0;_0x46291e[_0x615b('0x30')]=_[_0x615b('0x45')](db[_0x615b('0x4b')]['rawAttributes']);_0x46291e[_0x615b('0x31')]=_[_0x615b('0x45')](_0x3a2330['query']);_0x46291e[_0x615b('0x32')]=_[_0x615b('0x33')](_0x46291e['model'],_0x46291e['query']);_0x459739[_0x615b('0x34')]=_[_0x615b('0x33')](_0x46291e[_0x615b('0x30')],qs[_0x615b('0x35')](_0x3a2330[_0x615b('0x31')][_0x615b('0x35')]));_0x459739[_0x615b('0x34')]=_0x459739['attributes']['length']?_0x459739[_0x615b('0x34')]:_0x46291e[_0x615b('0x30')];_0x459739[_0x615b('0x4c')]=qs['sort'](_0x3a2330[_0x615b('0x31')][_0x615b('0x38')]);_0x459739['where']=qs[_0x615b('0x32')](_[_0x615b('0x3a')](_0x3a2330[_0x615b('0x31')],_0x46291e[_0x615b('0x32')]));if(_0x3a2330[_0x615b('0x31')]['filter']){_0x459739['where']=_[_0x615b('0x3c')](_0x459739[_0x615b('0x39')],{'$or':_[_0x615b('0x2b')](_0x459739[_0x615b('0x34')],function(_0x4ef576){var _0x13849c={};_0x13849c[_0x4ef576]={'$like':'%'+_0x3a2330['query'][_0x615b('0x3b')]+'%'};return _0x13849c;})});}_0x459739=_[_0x615b('0x3c')]({},_0x459739,_0x3a2330['options']);return _0x33f461[_0x615b('0x4a')](_0x459739);}})[_0x615b('0x25')](function(_0x249532){if(_0x249532){_0x5deca8=_0x249532[_0x615b('0x36')];if(!_0x3a2330['query'][_0x615b('0x4d')](_0x615b('0x37'))){_0x459739[_0x615b('0x1e')]=qs[_0x615b('0x1e')](_0x3a2330[_0x615b('0x31')][_0x615b('0x1e')]);_0x459739[_0x615b('0x1c')]=qs[_0x615b('0x1c')](_0x3a2330['query'][_0x615b('0x1c')]);}return _0x33f461[_0x615b('0x4a')](_0x459739);}})[_0x615b('0x25')](function(_0xe60d12){if(_0xe60d12){return _0xe60d12?{'count':_0x5deca8,'rows':_0xe60d12}:null;}})[_0x615b('0x25')](respondWithResult(_0xdd6873,null))[_0x615b('0x46')](handleError(_0xdd6873,null));};exports['getSubjects']=function(_0x505d34,_0x4fc1f4,_0x57dd01){var _0x1f6ff3={};var _0x558808={};var _0x2f8125;var _0x3c710e;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x505d34[_0x615b('0x44')]['id']}})[_0x615b('0x25')](handleEntityNotFound(_0x4fc1f4,null))[_0x615b('0x25')](function(_0x199188){if(_0x199188){_0x2f8125=_0x199188;_0x558808[_0x615b('0x30')]=_['keys'](db[_0x615b('0x4b')][_0x615b('0x2d')]);_0x558808[_0x615b('0x31')]=_[_0x615b('0x45')](_0x505d34[_0x615b('0x31')]);_0x558808[_0x615b('0x32')]=_['intersection'](_0x558808[_0x615b('0x30')],_0x558808[_0x615b('0x31')]);_0x1f6ff3[_0x615b('0x34')]=_[_0x615b('0x33')](_0x558808[_0x615b('0x30')],qs[_0x615b('0x35')](_0x505d34[_0x615b('0x31')][_0x615b('0x35')]));_0x1f6ff3[_0x615b('0x34')]=_0x1f6ff3[_0x615b('0x34')][_0x615b('0x36')]?_0x1f6ff3[_0x615b('0x34')]:_0x558808[_0x615b('0x30')];_0x1f6ff3['order']=qs[_0x615b('0x38')](_0x505d34[_0x615b('0x31')]['sort']);_0x1f6ff3['where']=qs['filters'](_[_0x615b('0x3a')](_0x505d34[_0x615b('0x31')],_0x558808['filters']));if(_0x505d34[_0x615b('0x31')][_0x615b('0x3b')]){_0x1f6ff3[_0x615b('0x39')]=_[_0x615b('0x3c')](_0x1f6ff3[_0x615b('0x39')],{'$or':_['map'](_0x1f6ff3['attributes'],function(_0x5851d9){var _0xc5f01f={};_0xc5f01f[_0x5851d9]={'$like':'%'+_0x505d34[_0x615b('0x31')][_0x615b('0x3b')]+'%'};return _0xc5f01f;})});}_0x1f6ff3=_[_0x615b('0x3c')]({},_0x1f6ff3,_0x505d34['options']);return _0x2f8125[_0x615b('0x4e')](_0x1f6ff3);}})[_0x615b('0x25')](function(_0x32ceff){if(_0x32ceff){_0x3c710e=_0x32ceff[_0x615b('0x36')];if(!_0x505d34['query'][_0x615b('0x4d')]('nolimit')){_0x1f6ff3[_0x615b('0x1e')]=qs[_0x615b('0x1e')](_0x505d34[_0x615b('0x31')][_0x615b('0x1e')]);_0x1f6ff3[_0x615b('0x1c')]=qs[_0x615b('0x1c')](_0x505d34[_0x615b('0x31')][_0x615b('0x1c')]);}return _0x2f8125[_0x615b('0x4e')](_0x1f6ff3);}})[_0x615b('0x25')](function(_0x72cbb8){if(_0x72cbb8){return _0x72cbb8?{'count':_0x3c710e,'rows':_0x72cbb8}:null;}})['then'](respondWithResult(_0x4fc1f4,null))[_0x615b('0x46')](handleError(_0x4fc1f4,null));};exports[_0x615b('0x4f')]=function(_0x5f29ff,_0xb32b2b,_0x483114){var _0x3af3b4={};var _0x29a94a={};var _0x2ac8ef;var _0x55ed3f;return db[_0x615b('0x2c')]['findOne']({'where':{'id':_0x5f29ff[_0x615b('0x44')]['id']}})[_0x615b('0x25')](handleEntityNotFound(_0xb32b2b,null))[_0x615b('0x25')](function(_0x5d0e80){if(_0x5d0e80){_0x2ac8ef=_0x5d0e80;_0x29a94a[_0x615b('0x30')]=_['keys'](db['SalesforceField'][_0x615b('0x2d')]);_0x29a94a['query']=_['keys'](_0x5f29ff[_0x615b('0x31')]);_0x29a94a['filters']=_[_0x615b('0x33')](_0x29a94a[_0x615b('0x30')],_0x29a94a['query']);_0x3af3b4[_0x615b('0x34')]=_[_0x615b('0x33')](_0x29a94a[_0x615b('0x30')],qs[_0x615b('0x35')](_0x5f29ff[_0x615b('0x31')]['fields']));_0x3af3b4[_0x615b('0x34')]=_0x3af3b4['attributes'][_0x615b('0x36')]?_0x3af3b4[_0x615b('0x34')]:_0x29a94a[_0x615b('0x30')];_0x3af3b4['order']=qs[_0x615b('0x38')](_0x5f29ff['query'][_0x615b('0x38')]);_0x3af3b4[_0x615b('0x39')]=qs['filters'](_['pick'](_0x5f29ff['query'],_0x29a94a[_0x615b('0x32')]));if(_0x5f29ff[_0x615b('0x31')][_0x615b('0x3b')]){_0x3af3b4[_0x615b('0x39')]=_['merge'](_0x3af3b4[_0x615b('0x39')],{'$or':_[_0x615b('0x2b')](_0x3af3b4['attributes'],function(_0x4a1785){var _0x16a56b={};_0x16a56b[_0x4a1785]={'$like':'%'+_0x5f29ff['query']['filter']+'%'};return _0x16a56b;})});}_0x3af3b4=_['merge']({},_0x3af3b4,_0x5f29ff[_0x615b('0x50')]);return _0x2ac8ef[_0x615b('0x4f')](_0x3af3b4);}})[_0x615b('0x25')](function(_0x3c8e81){if(_0x3c8e81){_0x55ed3f=_0x3c8e81[_0x615b('0x36')];if(!_0x5f29ff[_0x615b('0x31')][_0x615b('0x4d')](_0x615b('0x37'))){_0x3af3b4[_0x615b('0x1e')]=qs[_0x615b('0x1e')](_0x5f29ff['query']['limit']);_0x3af3b4['offset']=qs['offset'](_0x5f29ff[_0x615b('0x31')][_0x615b('0x1c')]);}return _0x2ac8ef[_0x615b('0x4f')](_0x3af3b4);}})[_0x615b('0x25')](function(_0x3ce046){if(_0x3ce046){return _0x3ce046?{'count':_0x55ed3f,'rows':_0x3ce046}:null;}})['then'](respondWithResult(_0xb32b2b,null))[_0x615b('0x46')](handleError(_0xb32b2b,null));};
\ No newline at end of file
index 8502f22..120a530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ee4=['int_salesforce_configurations','lodash','util','api','moment','request-promise','path','../../config/environment','exports','define','SalesforceConfiguration'];(function(_0x580b31,_0x5b87d6){var _0x265dbd=function(_0x1c6aab){while(--_0x1c6aab){_0x580b31['push'](_0x580b31['shift']());}};_0x265dbd(++_0x5b87d6);}(_0x7ee4,0xbc));var _0x47ee=function(_0x1c1fba,_0xd5872d){_0x1c1fba=_0x1c1fba-0x0;var _0x37e346=_0x7ee4[_0x1c1fba];return _0x37e346;};'use strict';var _=require(_0x47ee('0x0'));var util=require(_0x47ee('0x1'));var logger=require('../../config/logger')(_0x47ee('0x2'));var moment=require(_0x47ee('0x3'));var BPromise=require('bluebird');var rp=require(_0x47ee('0x4'));var fs=require('fs');var path=require(_0x47ee('0x5'));var rimraf=require('rimraf');var config=require(_0x47ee('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x47ee('0x7')]=function(_0x9054da,_0x25d96e){return _0x9054da[_0x47ee('0x8')](_0x47ee('0x9'),attributes,{'tableName':_0x47ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0cb4=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x38ea0a,_0x1dfb4d){var _0x43375a=function(_0x289a9c){while(--_0x289a9c){_0x38ea0a['push'](_0x38ea0a['shift']());}};_0x43375a(++_0x1dfb4d);}(_0x0cb4,0x196));var _0x40cb=function(_0x4dd7d7,_0x3eab2e){_0x4dd7d7=_0x4dd7d7-0x0;var _0x1abd98=_0x0cb4[_0x4dd7d7];return _0x1abd98;};'use strict';var _=require(_0x40cb('0x0'));var util=require(_0x40cb('0x1'));var logger=require(_0x40cb('0x2'))(_0x40cb('0x3'));var moment=require(_0x40cb('0x4'));var BPromise=require('bluebird');var rp=require(_0x40cb('0x5'));var fs=require('fs');var path=require(_0x40cb('0x6'));var rimraf=require(_0x40cb('0x7'));var config=require(_0x40cb('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x40cb('0x9')]=function(_0x19ae69,_0x2a7857){return _0x19ae69[_0x40cb('0xa')](_0x40cb('0xb'),attributes,{'tableName':_0x40cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 752100d..29d4d46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86cb=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0x86cb,0x1b7));var _0xb86c=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x86cb[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xb86c('0x0'));var util=require('util');var moment=require(_0xb86c('0x1'));var BPromise=require(_0xb86c('0x2'));var rs=require(_0xb86c('0x3'));var fs=require('fs');var Redis=require(_0xb86c('0x4'));var db=require(_0xb86c('0x5'))['db'];var utils=require(_0xb86c('0x6'));var logger=require(_0xb86c('0x7'))('rpc');var config=require(_0xb86c('0x8'));var jayson=require(_0xb86c('0x9'));var client=jayson['client'][_0xb86c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3a17,_0x53fcee,_0x183cd8){return new BPromise(function(_0x58bb8c,_0x27a925){return client[_0xb86c('0xb')](_0x1c3a17,_0x183cd8)[_0xb86c('0xc')](function(_0x520c9a){logger[_0xb86c('0xd')](_0xb86c('0xe'),_0x53fcee,_0xb86c('0xf'));logger[_0xb86c('0x10')](_0xb86c('0x11'),_0x53fcee,'request\x20sent',JSON[_0xb86c('0x12')](_0x520c9a));if(_0x520c9a[_0xb86c('0x13')]){if(_0x520c9a[_0xb86c('0x13')]['code']===0x1f4){logger[_0xb86c('0x13')](_0xb86c('0xe'),_0x53fcee,_0x520c9a[_0xb86c('0x13')][_0xb86c('0x14')]);return _0x27a925(_0x520c9a[_0xb86c('0x13')][_0xb86c('0x14')]);}logger['error'](_0xb86c('0xe'),_0x53fcee,_0x520c9a[_0xb86c('0x13')][_0xb86c('0x14')]);return _0x58bb8c(_0x520c9a[_0xb86c('0x13')]['message']);}else{logger[_0xb86c('0xd')](_0xb86c('0xe'),_0x53fcee,_0xb86c('0xf'));_0x58bb8c(_0x520c9a[_0xb86c('0x15')]['message']);}})[_0xb86c('0x16')](function(_0x4b5fe6){logger[_0xb86c('0x13')](_0xb86c('0xe'),_0x53fcee,_0x4b5fe6);_0x27a925(_0x4b5fe6);});});}
\ No newline at end of file
+var _0x39cd=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4e8c93,_0x1c3c74){var _0xc35342=function(_0x29599b){while(--_0x29599b){_0x4e8c93['push'](_0x4e8c93['shift']());}};_0xc35342(++_0x1c3c74);}(_0x39cd,0xc0));var _0xd39c=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x39cd[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xd39c('0x0'));var util=require(_0xd39c('0x1'));var moment=require(_0xd39c('0x2'));var BPromise=require('bluebird');var rs=require(_0xd39c('0x3'));var fs=require('fs');var Redis=require(_0xd39c('0x4'));var db=require(_0xd39c('0x5'))['db'];var utils=require(_0xd39c('0x6'));var logger=require(_0xd39c('0x7'))(_0xd39c('0x8'));var config=require(_0xd39c('0x9'));var jayson=require(_0xd39c('0xa'));var client=jayson['client'][_0xd39c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30f837,_0x1202e7,_0x359820){return new BPromise(function(_0x33cf8a,_0xcdcbe5){return client[_0xd39c('0xc')](_0x30f837,_0x359820)[_0xd39c('0xd')](function(_0x4b2a9e){logger[_0xd39c('0xe')](_0xd39c('0xf'),_0x1202e7,_0xd39c('0x10'));logger[_0xd39c('0x11')](_0xd39c('0x12'),_0x1202e7,_0xd39c('0x10'),JSON[_0xd39c('0x13')](_0x4b2a9e));if(_0x4b2a9e['error']){if(_0x4b2a9e[_0xd39c('0x14')][_0xd39c('0x15')]===0x1f4){logger[_0xd39c('0x14')](_0xd39c('0xf'),_0x1202e7,_0x4b2a9e[_0xd39c('0x14')][_0xd39c('0x16')]);return _0xcdcbe5(_0x4b2a9e[_0xd39c('0x14')][_0xd39c('0x16')]);}logger[_0xd39c('0x14')](_0xd39c('0xf'),_0x1202e7,_0x4b2a9e['error'][_0xd39c('0x16')]);return _0x33cf8a(_0x4b2a9e[_0xd39c('0x14')][_0xd39c('0x16')]);}else{logger[_0xd39c('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1202e7,_0xd39c('0x10'));_0x33cf8a(_0x4b2a9e['result'][_0xd39c('0x16')]);}})[_0xd39c('0x17')](function(_0x558fc9){logger[_0xd39c('0x14')](_0xd39c('0xf'),_0x1202e7,_0x558fc9);_0xcdcbe5(_0x558fc9);});});}
\ No newline at end of file
index d7de665..0826b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x912f=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x912f,0x1b1));var _0xf912=function(_0x953ae7,_0x42042f){_0x953ae7=_0x953ae7-0x0;var _0x146404=_0x912f[_0x953ae7];return _0x146404;};'use strict';var multer=require(_0xf912('0x0'));var util=require(_0xf912('0x1'));var path=require(_0xf912('0x2'));var timeout=require('connect-timeout');var express=require(_0xf912('0x3'));var router=express[_0xf912('0x4')]();var fs_extra=require(_0xf912('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf912('0x6'));var config=require(_0xf912('0x7'));var controller=require('./intSalesforceField.controller');router[_0xf912('0x8')]('/',auth['isAuthenticated'](),controller[_0xf912('0x9')]);router['get'](_0xf912('0xa'),auth[_0xf912('0xb')](),controller[_0xf912('0xc')]);router[_0xf912('0xd')]('/',auth[_0xf912('0xb')](),controller['create']);router[_0xf912('0xe')](_0xf912('0xa'),auth[_0xf912('0xb')](),controller[_0xf912('0xf')]);router[_0xf912('0x10')](_0xf912('0xa'),auth['isAuthenticated'](),controller[_0xf912('0x11')]);module[_0xf912('0x12')]=router;
\ No newline at end of file
+var _0x301c=['../../config/environment','index','get','/:id','show','post','put','update','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x301c,0x83));var _0xc301=function(_0x56be45,_0x10cd0e){_0x56be45=_0x56be45-0x0;var _0x1b75d3=_0x301c[_0x56be45];return _0x1b75d3;};'use strict';var multer=require(_0xc301('0x0'));var util=require(_0xc301('0x1'));var path=require(_0xc301('0x2'));var timeout=require(_0xc301('0x3'));var express=require(_0xc301('0x4'));var router=express[_0xc301('0x5')]();var fs_extra=require(_0xc301('0x6'));var auth=require(_0xc301('0x7'));var interaction=require(_0xc301('0x8'));var config=require(_0xc301('0x9'));var controller=require('./intSalesforceField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc301('0xa')]);router[_0xc301('0xb')](_0xc301('0xc'),auth['isAuthenticated'](),controller[_0xc301('0xd')]);router[_0xc301('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc301('0xf')](_0xc301('0xc'),auth['isAuthenticated'](),controller[_0xc301('0x10')]);router['delete'](_0xc301('0xc'),auth[_0xc301('0x11')](),controller[_0xc301('0x12')]);module[_0xc301('0x13')]=router;
\ No newline at end of file
index 9b68118..dd91ff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7fd=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x325e46,_0x2570fe){var _0x4b3436=function(_0xe06913){while(--_0xe06913){_0x325e46['push'](_0x325e46['shift']());}};_0x4b3436(++_0x2570fe);}(_0xe7fd,0x14b));var _0xde7f=function(_0x4f3bbe,_0x3c268d){_0x4f3bbe=_0x4f3bbe-0x0;var _0x3addf8=_0xe7fd[_0x4f3bbe];return _0x3addf8;};'use strict';var Sequelize=require(_0xde7f('0x0'));module[_0xde7f('0x1')]={'type':{'type':Sequelize[_0xde7f('0x2')](_0xde7f('0x3'),_0xde7f('0x4'),_0xde7f('0x5'),_0xde7f('0x6'),_0xde7f('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xde7f('0x8')]},'key':{'type':Sequelize[_0xde7f('0x8')]},'keyType':{'type':Sequelize[_0xde7f('0x2')](_0xde7f('0x3'),_0xde7f('0x4'),_0xde7f('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xde7f('0x8')]},'variableName':{'type':Sequelize[_0xde7f('0x8')]}};
\ No newline at end of file
+var _0x86e9=['picklist','variable','customVariable','STRING','ENUM','string','keyValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86e9,0xcf));var _0x986e=function(_0x33654f,_0x1313a8){_0x33654f=_0x33654f-0x0;var _0x1e01b4=_0x86e9[_0x33654f];return _0x1e01b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x986e('0x0')](_0x986e('0x1'),'variable','customVariable',_0x986e('0x2'),_0x986e('0x3')),'defaultValue':_0x986e('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x986e('0x1'),_0x986e('0x4'),_0x986e('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x986e('0x6')]},'variableName':{'type':Sequelize[_0x986e('0x6')]}};
\ No newline at end of file
index 2ca24a8..b913d97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0665=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','reject','save','update','then','destroy','error','name','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','filters','attributes','intersection'];(function(_0x2ae70f,_0x535775){var _0xacfd06=function(_0x51d341){while(--_0x51d341){_0x2ae70f['push'](_0x2ae70f['shift']());}};_0xacfd06(++_0x535775);}(_0x0665,0xb0));var _0x5066=function(_0x4adf06,_0x23beb5){_0x4adf06=_0x4adf06-0x0;var _0x42d1eb=_0x0665[_0x4adf06];return _0x42d1eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5066('0x0'));var zipdir=require(_0x5066('0x1'));var jsonpatch=require(_0x5066('0x2'));var rp=require(_0x5066('0x3'));var moment=require(_0x5066('0x4'));var BPromise=require(_0x5066('0x5'));var Mustache=require(_0x5066('0x6'));var util=require(_0x5066('0x7'));var path=require(_0x5066('0x8'));var sox=require(_0x5066('0x9'));var csv=require('to-csv');var ejs=require(_0x5066('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5066('0xb'));var crypto=require(_0x5066('0xc'));var jsforce=require(_0x5066('0xd'));var deskjs=require(_0x5066('0xe'));var toCsv=require(_0x5066('0xf'));var querystring=require(_0x5066('0x10'));var Papa=require(_0x5066('0x11'));var Redis=require(_0x5066('0x12'));var authService=require(_0x5066('0x13'));var qs=require(_0x5066('0x14'));var as=require(_0x5066('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5066('0x16'));var utils=require('../../config/utils');var config=require(_0x5066('0x17'));var licenseUtil=require(_0x5066('0x18'));var db=require(_0x5066('0x19'))['db'];function respondWithStatusCode(_0x595561,_0x3024b4){_0x3024b4=_0x3024b4||0xcc;return function(_0x29bd6c){if(_0x29bd6c){return _0x595561['sendStatus'](_0x3024b4);}return _0x595561[_0x5066('0x1a')](_0x3024b4)[_0x5066('0x1b')]();};}function respondWithResult(_0x52f737,_0x5df991){_0x5df991=_0x5df991||0xc8;return function(_0x1cfd16){if(_0x1cfd16){return _0x52f737[_0x5066('0x1a')](_0x5df991)['json'](_0x1cfd16);}};}function respondWithFilteredResult(_0x32d126,_0xce7867){return function(_0x5682ae){if(_0x5682ae){var _0x32567a=typeof _0xce7867[_0x5066('0x1c')]===_0x5066('0x1d')&&typeof _0xce7867['limit']==='undefined';var _0x4e6772=_0x5682ae['count'];var _0x159e41=_0x32567a?0x0:_0xce7867[_0x5066('0x1c')];var _0x6f84d8=_0x32567a?_0x5682ae['count']:_0xce7867[_0x5066('0x1c')]+_0xce7867[_0x5066('0x1e')];var _0x1607d3;if(_0x6f84d8>=_0x4e6772){_0x6f84d8=_0x4e6772;_0x1607d3=0xc8;}else{_0x1607d3=0xce;}_0x32d126[_0x5066('0x1a')](_0x1607d3);return _0x32d126[_0x5066('0x1f')](_0x5066('0x20'),_0x159e41+'-'+_0x6f84d8+'/'+_0x4e6772)[_0x5066('0x21')](_0x5682ae);}return null;};}function patchUpdates(_0x4169a5){return function(_0x2e93d0){try{jsonpatch['apply'](_0x2e93d0,_0x4169a5,!![]);}catch(_0x1bd34f){return BPromise[_0x5066('0x22')](_0x1bd34f);}return _0x2e93d0[_0x5066('0x23')]();};}function saveUpdates(_0x3b0ff6,_0x3e5945){return function(_0x52416f){if(_0x52416f){return _0x52416f[_0x5066('0x24')](_0x3b0ff6)[_0x5066('0x25')](function(_0x587b0e){return _0x587b0e;});}return null;};}function removeEntity(_0x393fc0,_0x262b59){return function(_0x45a97f){if(_0x45a97f){return _0x45a97f[_0x5066('0x26')]()[_0x5066('0x25')](function(){_0x393fc0[_0x5066('0x1a')](0xcc)[_0x5066('0x1b')]();});}};}function handleEntityNotFound(_0x4e1028,_0x596b1a){return function(_0xeb0234){if(!_0xeb0234){_0x4e1028['sendStatus'](0x194);}return _0xeb0234;};}function handleError(_0x54cc84,_0x39f9ad){_0x39f9ad=_0x39f9ad||0x1f4;return function(_0x4cdda2){logger[_0x5066('0x27')](_0x4cdda2['stack']);if(_0x4cdda2[_0x5066('0x28')]){delete _0x4cdda2['name'];}_0x54cc84[_0x5066('0x1a')](_0x39f9ad)['send'](_0x4cdda2);};}exports[_0x5066('0x29')]=function(_0x189286,_0x423726){var _0x50d57a={},_0x137c0a={},_0x29d598={'count':0x0,'rows':[]};var _0xdb8eaa=_[_0x5066('0x2a')](db[_0x5066('0x2b')][_0x5066('0x2c')],function(_0x300341){return{'name':_0x300341[_0x5066('0x2d')],'type':_0x300341['type'][_0x5066('0x2e')]};});_0x137c0a[_0x5066('0x2f')]=_[_0x5066('0x2a')](_0xdb8eaa,_0x5066('0x28'));_0x137c0a[_0x5066('0x30')]=_['keys'](_0x189286['query']);_0x137c0a[_0x5066('0x31')]=_['intersection'](_0x137c0a[_0x5066('0x2f')],_0x137c0a['query']);_0x50d57a[_0x5066('0x32')]=_[_0x5066('0x33')](_0x137c0a[_0x5066('0x2f')],qs['fields'](_0x189286[_0x5066('0x30')][_0x5066('0x34')]));_0x50d57a[_0x5066('0x32')]=_0x50d57a[_0x5066('0x32')][_0x5066('0x35')]?_0x50d57a[_0x5066('0x32')]:_0x137c0a[_0x5066('0x2f')];if(!_0x189286[_0x5066('0x30')][_0x5066('0x36')](_0x5066('0x37'))){_0x50d57a[_0x5066('0x1e')]=qs[_0x5066('0x1e')](_0x189286[_0x5066('0x30')]['limit']);_0x50d57a[_0x5066('0x1c')]=qs['offset'](_0x189286[_0x5066('0x30')][_0x5066('0x1c')]);}_0x50d57a[_0x5066('0x38')]=qs[_0x5066('0x39')](_0x189286[_0x5066('0x30')]['sort']);_0x50d57a[_0x5066('0x3a')]=qs['filters'](_[_0x5066('0x3b')](_0x189286[_0x5066('0x30')],_0x137c0a[_0x5066('0x31')]),_0xdb8eaa);if(_0x189286[_0x5066('0x30')][_0x5066('0x3c')]){_0x50d57a[_0x5066('0x3a')]=_[_0x5066('0x3d')](_0x50d57a[_0x5066('0x3a')],{'$or':_[_0x5066('0x2a')](_0xdb8eaa,function(_0x10b0db){if(_0x10b0db[_0x5066('0x3e')]!==_0x5066('0x3f')){var _0xa404c2={};_0xa404c2[_0x10b0db[_0x5066('0x28')]]={'$like':'%'+_0x189286['query'][_0x5066('0x3c')]+'%'};return _0xa404c2;}})});}_0x50d57a=_['merge']({},_0x50d57a,_0x189286['options']);var _0x25b17a={'where':_0x50d57a[_0x5066('0x3a')]};return db['SalesforceField'][_0x5066('0x40')](_0x25b17a)['then'](function(_0x393c81){_0x29d598[_0x5066('0x40')]=_0x393c81;if(_0x189286[_0x5066('0x30')][_0x5066('0x41')]){_0x50d57a[_0x5066('0x42')]=[{'all':!![]}];}return db[_0x5066('0x2b')][_0x5066('0x43')](_0x50d57a);})[_0x5066('0x25')](function(_0x18231b){_0x29d598['rows']=_0x18231b;return _0x29d598;})[_0x5066('0x25')](respondWithFilteredResult(_0x423726,_0x50d57a))[_0x5066('0x44')](handleError(_0x423726,null));};exports[_0x5066('0x45')]=function(_0x254624,_0x2650a2){var _0x5c2ae1={'raw':!![],'where':{'id':_0x254624[_0x5066('0x46')]['id']}},_0x36dc8f={};_0x36dc8f[_0x5066('0x2f')]=_[_0x5066('0x47')](db['SalesforceField'][_0x5066('0x2c')]);_0x36dc8f[_0x5066('0x30')]=_['keys'](_0x254624[_0x5066('0x30')]);_0x36dc8f[_0x5066('0x31')]=_[_0x5066('0x33')](_0x36dc8f[_0x5066('0x2f')],_0x36dc8f[_0x5066('0x30')]);_0x5c2ae1[_0x5066('0x32')]=_[_0x5066('0x33')](_0x36dc8f[_0x5066('0x2f')],qs[_0x5066('0x34')](_0x254624['query'][_0x5066('0x34')]));_0x5c2ae1[_0x5066('0x32')]=_0x5c2ae1['attributes']['length']?_0x5c2ae1['attributes']:_0x36dc8f[_0x5066('0x2f')];if(_0x254624['query'][_0x5066('0x41')]){_0x5c2ae1[_0x5066('0x42')]=[{'all':!![]}];}_0x5c2ae1=_[_0x5066('0x3d')]({},_0x5c2ae1,_0x254624[_0x5066('0x48')]);return db[_0x5066('0x2b')][_0x5066('0x49')](_0x5c2ae1)[_0x5066('0x25')](handleEntityNotFound(_0x2650a2,null))['then'](respondWithResult(_0x2650a2,null))[_0x5066('0x44')](handleError(_0x2650a2,null));};exports[_0x5066('0x4a')]=function(_0x168263,_0x4b664a){return db[_0x5066('0x2b')][_0x5066('0x4a')](_0x168263[_0x5066('0x4b')],{})[_0x5066('0x25')](respondWithResult(_0x4b664a,0xc9))[_0x5066('0x44')](handleError(_0x4b664a,null));};exports[_0x5066('0x24')]=function(_0xdbbfd6,_0x2d87c1){if(_0xdbbfd6[_0x5066('0x4b')]['id']){delete _0xdbbfd6[_0x5066('0x4b')]['id'];}return db[_0x5066('0x2b')]['find']({'where':{'id':_0xdbbfd6[_0x5066('0x46')]['id']}})[_0x5066('0x25')](handleEntityNotFound(_0x2d87c1,null))['then'](saveUpdates(_0xdbbfd6[_0x5066('0x4b')],null))[_0x5066('0x25')](respondWithResult(_0x2d87c1,null))[_0x5066('0x44')](handleError(_0x2d87c1,null));};exports[_0x5066('0x26')]=function(_0x5e2e1a,_0x15b395){return db[_0x5066('0x2b')][_0x5066('0x49')]({'where':{'id':_0x5e2e1a[_0x5066('0x46')]['id']}})[_0x5066('0x25')](handleEntityNotFound(_0x15b395,null))[_0x5066('0x25')](removeEntity(_0x15b395,null))[_0x5066('0x44')](handleError(_0x15b395,null));};
\ No newline at end of file
+var _0x9e6e=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','SalesforceField','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel'];(function(_0x4db1ba,_0x235fad){var _0x2b3548=function(_0x3f19ca){while(--_0x3f19ca){_0x4db1ba['push'](_0x4db1ba['shift']());}};_0x2b3548(++_0x235fad);}(_0x9e6e,0x160));var _0xe9e6=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x9e6e[_0x58afd5];return _0x3e503b;};'use strict';var emlformat=require(_0xe9e6('0x0'));var rimraf=require(_0xe9e6('0x1'));var zipdir=require(_0xe9e6('0x2'));var jsonpatch=require(_0xe9e6('0x3'));var rp=require('request-promise');var moment=require(_0xe9e6('0x4'));var BPromise=require(_0xe9e6('0x5'));var Mustache=require(_0xe9e6('0x6'));var util=require(_0xe9e6('0x7'));var path=require(_0xe9e6('0x8'));var sox=require(_0xe9e6('0x9'));var csv=require('to-csv');var ejs=require(_0xe9e6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9e6('0xb'));var squel=require(_0xe9e6('0xc'));var crypto=require('crypto');var jsforce=require(_0xe9e6('0xd'));var deskjs=require(_0xe9e6('0xe'));var toCsv=require(_0xe9e6('0xf'));var querystring=require(_0xe9e6('0x10'));var Papa=require(_0xe9e6('0x11'));var Redis=require(_0xe9e6('0x12'));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(_0xe9e6('0x13'))(_0xe9e6('0x14'));var utils=require(_0xe9e6('0x15'));var config=require(_0xe9e6('0x16'));var licenseUtil=require(_0xe9e6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fca79,_0x3327f7){_0x3327f7=_0x3327f7||0xcc;return function(_0x34661f){if(_0x34661f){return _0x4fca79[_0xe9e6('0x18')](_0x3327f7);}return _0x4fca79[_0xe9e6('0x19')](_0x3327f7)[_0xe9e6('0x1a')]();};}function respondWithResult(_0x3af3eb,_0x20d538){_0x20d538=_0x20d538||0xc8;return function(_0x2dced1){if(_0x2dced1){return _0x3af3eb[_0xe9e6('0x19')](_0x20d538)[_0xe9e6('0x1b')](_0x2dced1);}};}function respondWithFilteredResult(_0x5ae331,_0x4b5ffe){return function(_0x3422dc){if(_0x3422dc){var _0x24b251=typeof _0x4b5ffe[_0xe9e6('0x1c')]===_0xe9e6('0x1d')&&typeof _0x4b5ffe[_0xe9e6('0x1e')]==='undefined';var _0x2042d3=_0x3422dc[_0xe9e6('0x1f')];var _0x14f35a=_0x24b251?0x0:_0x4b5ffe[_0xe9e6('0x1c')];var _0x5f29c1=_0x24b251?_0x3422dc['count']:_0x4b5ffe['offset']+_0x4b5ffe['limit'];var _0x1846e8;if(_0x5f29c1>=_0x2042d3){_0x5f29c1=_0x2042d3;_0x1846e8=0xc8;}else{_0x1846e8=0xce;}_0x5ae331[_0xe9e6('0x19')](_0x1846e8);return _0x5ae331[_0xe9e6('0x20')]('Content-Range',_0x14f35a+'-'+_0x5f29c1+'/'+_0x2042d3)[_0xe9e6('0x1b')](_0x3422dc);}return null;};}function patchUpdates(_0x480c11){return function(_0x402275){try{jsonpatch[_0xe9e6('0x21')](_0x402275,_0x480c11,!![]);}catch(_0x34c522){return BPromise[_0xe9e6('0x22')](_0x34c522);}return _0x402275[_0xe9e6('0x23')]();};}function saveUpdates(_0x1397b8,_0x2cebac){return function(_0x53be66){if(_0x53be66){return _0x53be66[_0xe9e6('0x24')](_0x1397b8)['then'](function(_0x4bb502){return _0x4bb502;});}return null;};}function removeEntity(_0x212fb8,_0xd6209e){return function(_0x2b1230){if(_0x2b1230){return _0x2b1230[_0xe9e6('0x25')]()[_0xe9e6('0x26')](function(){_0x212fb8['status'](0xcc)[_0xe9e6('0x1a')]();});}};}function handleEntityNotFound(_0x2d45a0,_0x148f56){return function(_0x3cba18){if(!_0x3cba18){_0x2d45a0[_0xe9e6('0x18')](0x194);}return _0x3cba18;};}function handleError(_0x594939,_0x1ef867){_0x1ef867=_0x1ef867||0x1f4;return function(_0x1f3b3e){logger[_0xe9e6('0x27')](_0x1f3b3e[_0xe9e6('0x28')]);if(_0x1f3b3e['name']){delete _0x1f3b3e[_0xe9e6('0x29')];}_0x594939['status'](_0x1ef867)[_0xe9e6('0x2a')](_0x1f3b3e);};}exports['index']=function(_0xc04c3a,_0x59931a){var _0x26d055={},_0x3f7753={},_0x18cdce={'count':0x0,'rows':[]};var _0x22ae6c=_['map'](db[_0xe9e6('0x2b')][_0xe9e6('0x2c')],function(_0x201fc6){return{'name':_0x201fc6[_0xe9e6('0x2d')],'type':_0x201fc6['type'][_0xe9e6('0x2e')]};});_0x3f7753[_0xe9e6('0x2f')]=_[_0xe9e6('0x30')](_0x22ae6c,_0xe9e6('0x29'));_0x3f7753['query']=_[_0xe9e6('0x31')](_0xc04c3a[_0xe9e6('0x32')]);_0x3f7753[_0xe9e6('0x33')]=_[_0xe9e6('0x34')](_0x3f7753[_0xe9e6('0x2f')],_0x3f7753['query']);_0x26d055[_0xe9e6('0x35')]=_[_0xe9e6('0x34')](_0x3f7753[_0xe9e6('0x2f')],qs[_0xe9e6('0x36')](_0xc04c3a[_0xe9e6('0x32')][_0xe9e6('0x36')]));_0x26d055[_0xe9e6('0x35')]=_0x26d055['attributes'][_0xe9e6('0x37')]?_0x26d055[_0xe9e6('0x35')]:_0x3f7753[_0xe9e6('0x2f')];if(!_0xc04c3a[_0xe9e6('0x32')][_0xe9e6('0x38')]('nolimit')){_0x26d055[_0xe9e6('0x1e')]=qs[_0xe9e6('0x1e')](_0xc04c3a['query'][_0xe9e6('0x1e')]);_0x26d055[_0xe9e6('0x1c')]=qs['offset'](_0xc04c3a[_0xe9e6('0x32')][_0xe9e6('0x1c')]);}_0x26d055[_0xe9e6('0x39')]=qs[_0xe9e6('0x3a')](_0xc04c3a[_0xe9e6('0x32')]['sort']);_0x26d055[_0xe9e6('0x3b')]=qs[_0xe9e6('0x33')](_[_0xe9e6('0x3c')](_0xc04c3a[_0xe9e6('0x32')],_0x3f7753[_0xe9e6('0x33')]),_0x22ae6c);if(_0xc04c3a[_0xe9e6('0x32')][_0xe9e6('0x3d')]){_0x26d055[_0xe9e6('0x3b')]=_[_0xe9e6('0x3e')](_0x26d055['where'],{'$or':_[_0xe9e6('0x30')](_0x22ae6c,function(_0xdea38d){if(_0xdea38d[_0xe9e6('0x3f')]!=='VIRTUAL'){var _0x50f4f7={};_0x50f4f7[_0xdea38d['name']]={'$like':'%'+_0xc04c3a[_0xe9e6('0x32')][_0xe9e6('0x3d')]+'%'};return _0x50f4f7;}})});}_0x26d055=_['merge']({},_0x26d055,_0xc04c3a[_0xe9e6('0x40')]);var _0x21bc24={'where':_0x26d055['where']};return db['SalesforceField'][_0xe9e6('0x1f')](_0x21bc24)['then'](function(_0x444e45){_0x18cdce[_0xe9e6('0x1f')]=_0x444e45;if(_0xc04c3a['query'][_0xe9e6('0x41')]){_0x26d055['include']=[{'all':!![]}];}return db[_0xe9e6('0x2b')]['findAll'](_0x26d055);})[_0xe9e6('0x26')](function(_0x171b46){_0x18cdce[_0xe9e6('0x42')]=_0x171b46;return _0x18cdce;})[_0xe9e6('0x26')](respondWithFilteredResult(_0x59931a,_0x26d055))[_0xe9e6('0x43')](handleError(_0x59931a,null));};exports[_0xe9e6('0x44')]=function(_0x3e73e3,_0x47a5d7){var _0xd75bd5={'raw':!![],'where':{'id':_0x3e73e3[_0xe9e6('0x45')]['id']}},_0x5008c9={};_0x5008c9['model']=_[_0xe9e6('0x31')](db['SalesforceField'][_0xe9e6('0x2c')]);_0x5008c9[_0xe9e6('0x32')]=_['keys'](_0x3e73e3[_0xe9e6('0x32')]);_0x5008c9['filters']=_[_0xe9e6('0x34')](_0x5008c9[_0xe9e6('0x2f')],_0x5008c9['query']);_0xd75bd5[_0xe9e6('0x35')]=_[_0xe9e6('0x34')](_0x5008c9[_0xe9e6('0x2f')],qs['fields'](_0x3e73e3[_0xe9e6('0x32')][_0xe9e6('0x36')]));_0xd75bd5[_0xe9e6('0x35')]=_0xd75bd5[_0xe9e6('0x35')][_0xe9e6('0x37')]?_0xd75bd5['attributes']:_0x5008c9[_0xe9e6('0x2f')];if(_0x3e73e3[_0xe9e6('0x32')]['includeAll']){_0xd75bd5['include']=[{'all':!![]}];}_0xd75bd5=_['merge']({},_0xd75bd5,_0x3e73e3[_0xe9e6('0x40')]);return db['SalesforceField'][_0xe9e6('0x46')](_0xd75bd5)[_0xe9e6('0x26')](handleEntityNotFound(_0x47a5d7,null))[_0xe9e6('0x26')](respondWithResult(_0x47a5d7,null))[_0xe9e6('0x43')](handleError(_0x47a5d7,null));};exports[_0xe9e6('0x47')]=function(_0x18cdca,_0x5cab66){return db['SalesforceField'][_0xe9e6('0x47')](_0x18cdca[_0xe9e6('0x48')],{})[_0xe9e6('0x26')](respondWithResult(_0x5cab66,0xc9))[_0xe9e6('0x43')](handleError(_0x5cab66,null));};exports['update']=function(_0x47ede9,_0x11c304){if(_0x47ede9[_0xe9e6('0x48')]['id']){delete _0x47ede9[_0xe9e6('0x48')]['id'];}return db[_0xe9e6('0x2b')][_0xe9e6('0x46')]({'where':{'id':_0x47ede9[_0xe9e6('0x45')]['id']}})[_0xe9e6('0x26')](handleEntityNotFound(_0x11c304,null))[_0xe9e6('0x26')](saveUpdates(_0x47ede9[_0xe9e6('0x48')],null))[_0xe9e6('0x26')](respondWithResult(_0x11c304,null))[_0xe9e6('0x43')](handleError(_0x11c304,null));};exports[_0xe9e6('0x25')]=function(_0x708b8a,_0x2c1860){return db[_0xe9e6('0x2b')][_0xe9e6('0x46')]({'where':{'id':_0x708b8a[_0xe9e6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c1860,null))[_0xe9e6('0x26')](removeEntity(_0x2c1860,null))['catch'](handleError(_0x2c1860,null));};
\ No newline at end of file
index 3c29270..446573a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ad=['../../config/logger','api','bluebird','request-promise','../../config/environment','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','util'];(function(_0x541254,_0x380227){var _0x46a269=function(_0x4d6e37){while(--_0x4d6e37){_0x541254['push'](_0x541254['shift']());}};_0x46a269(++_0x380227);}(_0x36ad,0x9a));var _0xd36a=function(_0x410d59,_0x56f125){_0x410d59=_0x410d59-0x0;var _0x3d92cf=_0x36ad[_0x410d59];return _0x3d92cf;};'use strict';var _=require(_0xd36a('0x0'));var util=require(_0xd36a('0x1'));var logger=require(_0xd36a('0x2'))(_0xd36a('0x3'));var moment=require('moment');var BPromise=require(_0xd36a('0x4'));var rp=require(_0xd36a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd36a('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0xd36a('0x7')]=function(_0x5ea73a,_0x5d8e83){return _0x5ea73a['define'](_0xd36a('0x8'),attributes,{'tableName':_0xd36a('0x9'),'paranoid':![],'indexes':[{'name':_0xd36a('0xa'),'fields':[_0xd36a('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc00f=['path','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','request-promise'];(function(_0x3c9920,_0x6abc8c){var _0x487e20=function(_0x5dbfad){while(--_0x5dbfad){_0x3c9920['push'](_0x3c9920['shift']());}};_0x487e20(++_0x6abc8c);}(_0xc00f,0xfa));var _0xfc00=function(_0x2ecf03,_0x2adccf){_0x2ecf03=_0x2ecf03-0x0;var _0x4418ab=_0xc00f[_0x2ecf03];return _0x4418ab;};'use strict';var _=require(_0xfc00('0x0'));var util=require('util');var logger=require(_0xfc00('0x1'))(_0xfc00('0x2'));var moment=require(_0xfc00('0x3'));var BPromise=require('bluebird');var rp=require(_0xfc00('0x4'));var fs=require('fs');var path=require(_0xfc00('0x5'));var rimraf=require(_0xfc00('0x6'));var config=require(_0xfc00('0x7'));var attributes=require(_0xfc00('0x8'));module['exports']=function(_0x548069,_0x3aabdc){return _0x548069[_0xfc00('0x9')](_0xfc00('0xa'),attributes,{'tableName':_0xfc00('0xb'),'paranoid':![],'indexes':[{'name':_0xfc00('0xc'),'fields':[_0xfc00('0xd'),_0xfc00('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index f764175..ea71752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17f1=['client','request','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x201b93,_0x583272){var _0x2abffe=function(_0x202933){while(--_0x202933){_0x201b93['push'](_0x201b93['shift']());}};_0x2abffe(++_0x583272);}(_0x17f1,0xbc));var _0x117f=function(_0xe93ddd,_0x2504dc){_0xe93ddd=_0xe93ddd-0x0;var _0x30c73b=_0x17f1[_0xe93ddd];return _0x30c73b;};'use strict';var _=require(_0x117f('0x0'));var util=require(_0x117f('0x1'));var moment=require(_0x117f('0x2'));var BPromise=require(_0x117f('0x3'));var rs=require(_0x117f('0x4'));var fs=require('fs');var Redis=require(_0x117f('0x5'));var db=require(_0x117f('0x6'))['db'];var utils=require(_0x117f('0x7'));var logger=require('../../config/logger')(_0x117f('0x8'));var config=require('../../config/environment');var jayson=require(_0x117f('0x9'));var client=jayson[_0x117f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e15d1,_0x5b2312,_0x23bc82){return new BPromise(function(_0xb2d69f,_0x2f3118){return client[_0x117f('0xb')](_0x3e15d1,_0x23bc82)['then'](function(_0x2344d6){logger[_0x117f('0xc')]('SalesforceField,\x20%s,\x20%s',_0x5b2312,_0x117f('0xd'));logger[_0x117f('0xe')](_0x117f('0xf'),_0x5b2312,_0x117f('0xd'),JSON[_0x117f('0x10')](_0x2344d6));if(_0x2344d6[_0x117f('0x11')]){if(_0x2344d6['error']['code']===0x1f4){logger[_0x117f('0x11')]('SalesforceField,\x20%s,\x20%s',_0x5b2312,_0x2344d6[_0x117f('0x11')][_0x117f('0x12')]);return _0x2f3118(_0x2344d6[_0x117f('0x11')][_0x117f('0x12')]);}logger[_0x117f('0x11')](_0x117f('0x13'),_0x5b2312,_0x2344d6[_0x117f('0x11')][_0x117f('0x12')]);return _0xb2d69f(_0x2344d6['error'][_0x117f('0x12')]);}else{logger[_0x117f('0xc')]('SalesforceField,\x20%s,\x20%s',_0x5b2312,'request\x20sent');_0xb2d69f(_0x2344d6[_0x117f('0x14')][_0x117f('0x12')]);}})[_0x117f('0x15')](function(_0x2ef80a){logger['error'](_0x117f('0x13'),_0x5b2312,_0x2ef80a);_0x2f3118(_0x2ef80a);});});}
\ No newline at end of file
+var _0xef05=['request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0xef05,0x1d8));var _0x5ef0=function(_0x397b1b,_0x1af983){_0x397b1b=_0x397b1b-0x0;var _0x11bcd4=_0xef05[_0x397b1b];return _0x11bcd4;};'use strict';var _=require(_0x5ef0('0x0'));var util=require(_0x5ef0('0x1'));var moment=require(_0x5ef0('0x2'));var BPromise=require(_0x5ef0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ef0('0x4'));var db=require(_0x5ef0('0x5'))['db'];var utils=require(_0x5ef0('0x6'));var logger=require(_0x5ef0('0x7'))(_0x5ef0('0x8'));var config=require(_0x5ef0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5ef0('0xa')][_0x5ef0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x74657a,_0x4f1833,_0x71eeb3){return new BPromise(function(_0x34ca94,_0x36aa2b){return client[_0x5ef0('0xc')](_0x74657a,_0x71eeb3)[_0x5ef0('0xd')](function(_0x28d9df){logger['info'](_0x5ef0('0xe'),_0x4f1833,_0x5ef0('0xf'));logger[_0x5ef0('0x10')](_0x5ef0('0x11'),_0x4f1833,_0x5ef0('0xf'),JSON['stringify'](_0x28d9df));if(_0x28d9df[_0x5ef0('0x12')]){if(_0x28d9df[_0x5ef0('0x12')][_0x5ef0('0x13')]===0x1f4){logger[_0x5ef0('0x12')](_0x5ef0('0xe'),_0x4f1833,_0x28d9df['error'][_0x5ef0('0x14')]);return _0x36aa2b(_0x28d9df[_0x5ef0('0x12')][_0x5ef0('0x14')]);}logger[_0x5ef0('0x12')](_0x5ef0('0xe'),_0x4f1833,_0x28d9df['error'][_0x5ef0('0x14')]);return _0x34ca94(_0x28d9df[_0x5ef0('0x12')][_0x5ef0('0x14')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x4f1833,'request\x20sent');_0x34ca94(_0x28d9df['result'][_0x5ef0('0x14')]);}})[_0x5ef0('0x15')](function(_0x4fdc62){logger[_0x5ef0('0x12')](_0x5ef0('0xe'),_0x4f1833,_0x4fdc62);_0x36aa2b(_0x4fdc62);});});}
\ No newline at end of file
index 9d0a049..d450b9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9eb4=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x8bdf80,_0x401dfc){var _0x375c92=function(_0x1a78a2){while(--_0x1a78a2){_0x8bdf80['push'](_0x8bdf80['shift']());}};_0x375c92(++_0x401dfc);}(_0x9eb4,0x126));var _0x49eb=function(_0x36f797,_0x351603){_0x36f797=_0x36f797-0x0;var _0x44ba30=_0x9eb4[_0x36f797];return _0x44ba30;};'use strict';var multer=require('multer');var util=require(_0x49eb('0x0'));var path=require(_0x49eb('0x1'));var timeout=require(_0x49eb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x49eb('0x3'));var auth=require(_0x49eb('0x4'));var interaction=require(_0x49eb('0x5'));var config=require(_0x49eb('0x6'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x49eb('0x7')](),controller['index']);router[_0x49eb('0x8')](_0x49eb('0x9'),auth[_0x49eb('0x7')](),controller[_0x49eb('0xa')]);router[_0x49eb('0x8')]('/:id/configurations',auth[_0x49eb('0x7')](),controller[_0x49eb('0xb')]);router[_0x49eb('0x8')](_0x49eb('0xc'),auth[_0x49eb('0x7')](),controller[_0x49eb('0xd')]);router[_0x49eb('0xe')]('/',auth[_0x49eb('0x7')](),controller[_0x49eb('0xf')]);router[_0x49eb('0xe')](_0x49eb('0x10'),auth[_0x49eb('0x7')](),controller[_0x49eb('0x11')]);router[_0x49eb('0x12')](_0x49eb('0x9'),auth[_0x49eb('0x7')](),controller[_0x49eb('0x13')]);router[_0x49eb('0x14')]('/:id',auth[_0x49eb('0x7')](),controller[_0x49eb('0x15')]);module[_0x49eb('0x16')]=router;
\ No newline at end of file
+var _0x3b59=['/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id'];(function(_0x100823,_0x18a17f){var _0x391ab2=function(_0xebc441){while(--_0xebc441){_0x100823['push'](_0x100823['shift']());}};_0x391ab2(++_0x18a17f);}(_0x3b59,0x9c));var _0x93b5=function(_0x46733d,_0x28cc9a){_0x46733d=_0x46733d-0x0;var _0xb37111=_0x3b59[_0x46733d];return _0xb37111;};'use strict';var multer=require(_0x93b5('0x0'));var util=require(_0x93b5('0x1'));var path=require(_0x93b5('0x2'));var timeout=require(_0x93b5('0x3'));var express=require(_0x93b5('0x4'));var router=express[_0x93b5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x93b5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x93b5('0x7'));var controller=require(_0x93b5('0x8'));router[_0x93b5('0x9')]('/',auth[_0x93b5('0xa')](),controller['index']);router[_0x93b5('0x9')](_0x93b5('0xb'),auth[_0x93b5('0xa')](),controller['show']);router[_0x93b5('0x9')](_0x93b5('0xc'),auth[_0x93b5('0xa')](),controller[_0x93b5('0xd')]);router[_0x93b5('0x9')]('/:id/fields',auth[_0x93b5('0xa')](),controller[_0x93b5('0xe')]);router[_0x93b5('0xf')]('/',auth[_0x93b5('0xa')](),controller[_0x93b5('0x10')]);router['post'](_0x93b5('0xc'),auth[_0x93b5('0xa')](),controller['addConfiguration']);router[_0x93b5('0x11')](_0x93b5('0xb'),auth[_0x93b5('0xa')](),controller[_0x93b5('0x12')]);router[_0x93b5('0x13')]('/:id',auth[_0x93b5('0xa')](),controller[_0x93b5('0x14')]);module['exports']=router;
\ No newline at end of file
index f815590..9a02f3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9a9=['remoteUri','sequelize','exports','STRING','username'];(function(_0x2c5e04,_0x1b22f){var _0x40d748=function(_0x4b5183){while(--_0x4b5183){_0x2c5e04['push'](_0x2c5e04['shift']());}};_0x40d748(++_0x1b22f);}(_0xf9a9,0x79));var _0x9f9a=function(_0x3c6515,_0x20b943){_0x3c6515=_0x3c6515-0x0;var _0x3ce555=_0xf9a9[_0x3c6515];return _0x3ce555;};'use strict';var Sequelize=require(_0x9f9a('0x0'));module[_0x9f9a('0x1')]={'name':{'type':Sequelize[_0x9f9a('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9f9a('0x2')],'unique':_0x9f9a('0x3')},'password':{'type':Sequelize[_0x9f9a('0x2')]},'email':{'type':Sequelize[_0x9f9a('0x2')]},'remoteUri':{'type':Sequelize[_0x9f9a('0x2')],'unique':_0x9f9a('0x4')},'serverUrl':{'type':Sequelize[_0x9f9a('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xdba0=['STRING','username','remoteUri','sequelize'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xdba0,0xcb));var _0x0dba=function(_0x962fc5,_0x58f074){_0x962fc5=_0x962fc5-0x0;var _0x43667c=_0xdba0[_0x962fc5];return _0x43667c;};'use strict';var Sequelize=require(_0x0dba('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0dba('0x1')]},'username':{'type':Sequelize[_0x0dba('0x1')],'unique':_0x0dba('0x2')},'password':{'type':Sequelize[_0x0dba('0x1')]},'email':{'type':Sequelize[_0x0dba('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0dba('0x3')},'serverUrl':{'type':Sequelize[_0x0dba('0x1')],'allowNull':![]}};
\ No newline at end of file
index e3b643f..a51e18a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23b9=['comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','includes','internalType','push','all','assign','log','TCL:\x20_object','remove','label','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','forEach','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','map','VIRTUAL','options','ServicenowAccount','catch','params','keys','includeAll','include','find','create','body','getConfigurations','ServicenowConfiguration','rawAttributes','sort','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','knowledge','calendar_stc','closed_at','cmdb_ci','impact','priority','rfc','time_worked','expected_start','work_end','reopened_time','caller_id','approval_set','short_description','work_start','assignment_group','additional_assignee_list','description','sys_class_name','close_notes','closed_by','sys_id','contact_type','reopened_by','problem_id','company','activity_due','assigned_to'];(function(_0xddb4c0,_0x2c7811){var _0xc01a1f=function(_0x371505){while(--_0x371505){_0xddb4c0['push'](_0xddb4c0['shift']());}};_0xc01a1f(++_0x2c7811);}(_0x23b9,0xdd));var _0x923b=function(_0x370a50,_0x2adbfe){_0x370a50=_0x370a50-0x0;var _0x5b8ffb=_0x23b9[_0x370a50];return _0x5b8ffb;};'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(_0x923b('0x8'));var path=require(_0x923b('0x9'));var sox=require(_0x923b('0xa'));var csv=require(_0x923b('0xb'));var ejs=require(_0x923b('0xc'));var fs=require('fs');var fs_extra=require(_0x923b('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x923b('0xe'));var toCsv=require(_0x923b('0xb'));var querystring=require('querystring');var Papa=require(_0x923b('0xf'));var Redis=require(_0x923b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x923b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x923b('0x12'));var licenseUtil=require(_0x923b('0x13'));var db=require(_0x923b('0x14'))['db'];var integrations=require(_0x923b('0x15'));function respondWithStatusCode(_0x298692,_0x8e9faf){_0x8e9faf=_0x8e9faf||0xcc;return function(_0x2a1a7a){if(_0x2a1a7a){return _0x298692[_0x923b('0x16')](_0x8e9faf);}return _0x298692[_0x923b('0x17')](_0x8e9faf)['end']();};}function respondWithResult(_0x3218c8,_0x241f03){_0x241f03=_0x241f03||0xc8;return function(_0x18e45f){if(_0x18e45f){return _0x3218c8['status'](_0x241f03)[_0x923b('0x18')](_0x18e45f);}};}function respondWithFilteredResult(_0x5b6520,_0x36d0f1){return function(_0x33fb74){if(_0x33fb74){var _0x215766=typeof _0x36d0f1[_0x923b('0x19')]===_0x923b('0x1a')&&typeof _0x36d0f1[_0x923b('0x1b')]===_0x923b('0x1a');var _0x237bb9=_0x33fb74[_0x923b('0x1c')];var _0x1d7c92=_0x215766?0x0:_0x36d0f1[_0x923b('0x19')];var _0xfba4a5=_0x215766?_0x33fb74[_0x923b('0x1c')]:_0x36d0f1[_0x923b('0x19')]+_0x36d0f1[_0x923b('0x1b')];var _0x5aca91;if(_0xfba4a5>=_0x237bb9){_0xfba4a5=_0x237bb9;_0x5aca91=0xc8;}else{_0x5aca91=0xce;}_0x5b6520[_0x923b('0x17')](_0x5aca91);return _0x5b6520[_0x923b('0x1d')](_0x923b('0x1e'),_0x1d7c92+'-'+_0xfba4a5+'/'+_0x237bb9)[_0x923b('0x18')](_0x33fb74);}return null;};}function patchUpdates(_0x21e204){return function(_0x24b6ac){try{jsonpatch[_0x923b('0x1f')](_0x24b6ac,_0x21e204,!![]);}catch(_0x4a91dd){return BPromise['reject'](_0x4a91dd);}return _0x24b6ac[_0x923b('0x20')]();};}function saveUpdates(_0x137c45,_0x56cbea){return function(_0x454a66){if(_0x454a66){return _0x454a66[_0x923b('0x21')](_0x137c45)[_0x923b('0x22')](function(_0x328b3c){return _0x328b3c;});}return null;};}function removeEntity(_0x2a9790,_0x103078){return function(_0xb69700){if(_0xb69700){return _0xb69700[_0x923b('0x23')]()['then'](function(){_0x2a9790[_0x923b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9f2afd,_0x256954){return function(_0x1f40e7){if(!_0x1f40e7){_0x9f2afd[_0x923b('0x16')](0x194);}return _0x1f40e7;};}function handleError(_0x418dd3,_0x2d40b9){_0x2d40b9=_0x2d40b9||0x1f4;return function(_0x37a208){logger[_0x923b('0x24')](_0x37a208[_0x923b('0x25')]);if(_0x37a208[_0x923b('0x26')]){delete _0x37a208[_0x923b('0x26')];}_0x418dd3[_0x923b('0x17')](_0x2d40b9)[_0x923b('0x27')](_0x37a208);};}exports[_0x923b('0x28')]=function(_0x264f50,_0x46ead2){var _0x1acb4c={},_0x56e954={},_0x1fd6ec={'count':0x0,'rows':[]};var _0x3a0a89=_['map'](db['ServicenowAccount']['rawAttributes'],function(_0x1218b5){return{'name':_0x1218b5[_0x923b('0x29')],'type':_0x1218b5[_0x923b('0x2a')]['key']};});_0x56e954[_0x923b('0x2b')]=_['map'](_0x3a0a89,_0x923b('0x26'));_0x56e954[_0x923b('0x2c')]=_['keys'](_0x264f50[_0x923b('0x2c')]);_0x56e954['filters']=_[_0x923b('0x2d')](_0x56e954['model'],_0x56e954['query']);_0x1acb4c[_0x923b('0x2e')]=_[_0x923b('0x2d')](_0x56e954[_0x923b('0x2b')],qs[_0x923b('0x2f')](_0x264f50['query'][_0x923b('0x2f')]));_0x1acb4c[_0x923b('0x2e')]=_0x1acb4c[_0x923b('0x2e')][_0x923b('0x30')]?_0x1acb4c[_0x923b('0x2e')]:_0x56e954[_0x923b('0x2b')];if(!_0x264f50['query'][_0x923b('0x31')](_0x923b('0x32'))){_0x1acb4c[_0x923b('0x1b')]=qs[_0x923b('0x1b')](_0x264f50[_0x923b('0x2c')][_0x923b('0x1b')]);_0x1acb4c[_0x923b('0x19')]=qs[_0x923b('0x19')](_0x264f50[_0x923b('0x2c')][_0x923b('0x19')]);}_0x1acb4c[_0x923b('0x33')]=qs['sort'](_0x264f50[_0x923b('0x2c')]['sort']);_0x1acb4c[_0x923b('0x34')]=qs[_0x923b('0x35')](_[_0x923b('0x36')](_0x264f50[_0x923b('0x2c')],_0x56e954['filters']),_0x3a0a89);if(_0x264f50[_0x923b('0x2c')][_0x923b('0x37')]){_0x1acb4c[_0x923b('0x34')]=_[_0x923b('0x38')](_0x1acb4c[_0x923b('0x34')],{'$or':_[_0x923b('0x39')](_0x3a0a89,function(_0x5a8c9b){if(_0x5a8c9b['type']!==_0x923b('0x3a')){var _0x4c4f73={};_0x4c4f73[_0x5a8c9b['name']]={'$like':'%'+_0x264f50[_0x923b('0x2c')]['filter']+'%'};return _0x4c4f73;}})});}_0x1acb4c=_[_0x923b('0x38')]({},_0x1acb4c,_0x264f50[_0x923b('0x3b')]);var _0x45680a={'where':_0x1acb4c[_0x923b('0x34')]};return db['ServicenowAccount'][_0x923b('0x1c')](_0x45680a)['then'](function(_0x77ca0c){_0x1fd6ec[_0x923b('0x1c')]=_0x77ca0c;if(_0x264f50[_0x923b('0x2c')]['includeAll']){_0x1acb4c['include']=[{'all':!![]}];}return db[_0x923b('0x3c')]['findAll'](_0x1acb4c);})[_0x923b('0x22')](function(_0x291f28){_0x1fd6ec['rows']=_0x291f28;return _0x1fd6ec;})[_0x923b('0x22')](respondWithFilteredResult(_0x46ead2,_0x1acb4c))[_0x923b('0x3d')](handleError(_0x46ead2,null));};exports['show']=function(_0x37d0bc,_0x22a0cb){var _0x517c68={'raw':![],'where':{'id':_0x37d0bc[_0x923b('0x3e')]['id']}},_0xaa4210={};_0xaa4210[_0x923b('0x2b')]=_[_0x923b('0x3f')](db[_0x923b('0x3c')]['rawAttributes']);_0xaa4210['query']=_['keys'](_0x37d0bc[_0x923b('0x2c')]);_0xaa4210[_0x923b('0x35')]=_[_0x923b('0x2d')](_0xaa4210[_0x923b('0x2b')],_0xaa4210[_0x923b('0x2c')]);_0x517c68[_0x923b('0x2e')]=_[_0x923b('0x2d')](_0xaa4210[_0x923b('0x2b')],qs[_0x923b('0x2f')](_0x37d0bc[_0x923b('0x2c')]['fields']));_0x517c68[_0x923b('0x2e')]=_0x517c68['attributes'][_0x923b('0x30')]?_0x517c68[_0x923b('0x2e')]:_0xaa4210[_0x923b('0x2b')];if(_0x37d0bc[_0x923b('0x2c')][_0x923b('0x40')]){_0x517c68[_0x923b('0x41')]=[{'all':!![]}];}_0x517c68=_[_0x923b('0x38')]({},_0x517c68,_0x37d0bc[_0x923b('0x3b')]);return db[_0x923b('0x3c')][_0x923b('0x42')](_0x517c68)[_0x923b('0x22')](handleEntityNotFound(_0x22a0cb,null))[_0x923b('0x22')](respondWithResult(_0x22a0cb,null))['catch'](handleError(_0x22a0cb,null));};exports[_0x923b('0x43')]=function(_0x4a92c7,_0x431400){return db[_0x923b('0x3c')]['create'](_0x4a92c7['body'],{})[_0x923b('0x22')](respondWithResult(_0x431400,0xc9))[_0x923b('0x3d')](handleError(_0x431400,null));};exports[_0x923b('0x21')]=function(_0x2d9d89,_0x25b6bd){if(_0x2d9d89[_0x923b('0x44')]['id']){delete _0x2d9d89[_0x923b('0x44')]['id'];}return db[_0x923b('0x3c')]['find']({'where':{'id':_0x2d9d89[_0x923b('0x3e')]['id']}})[_0x923b('0x22')](handleEntityNotFound(_0x25b6bd,null))[_0x923b('0x22')](saveUpdates(_0x2d9d89['body'],null))[_0x923b('0x22')](respondWithResult(_0x25b6bd,null))[_0x923b('0x3d')](handleError(_0x25b6bd,null));};exports[_0x923b('0x23')]=function(_0x301bf0,_0x453802){return db['ServicenowAccount'][_0x923b('0x42')]({'where':{'id':_0x301bf0[_0x923b('0x3e')]['id']}})[_0x923b('0x22')](handleEntityNotFound(_0x453802,null))['then'](removeEntity(_0x453802,null))[_0x923b('0x3d')](handleError(_0x453802,null));};exports[_0x923b('0x45')]=function(_0x54df3c,_0x2ed934,_0x482dee){var _0x363dbe={};var _0x7585c2={};var _0x30a32f;var _0x457074;return db['ServicenowAccount']['findOne']({'where':{'id':_0x54df3c['params']['id']}})['then'](handleEntityNotFound(_0x2ed934,null))[_0x923b('0x22')](function(_0x5638b2){if(_0x5638b2){_0x30a32f=_0x5638b2;_0x7585c2[_0x923b('0x2b')]=_[_0x923b('0x3f')](db[_0x923b('0x46')][_0x923b('0x47')]);_0x7585c2['query']=_[_0x923b('0x3f')](_0x54df3c['query']);_0x7585c2['filters']=_[_0x923b('0x2d')](_0x7585c2['model'],_0x7585c2[_0x923b('0x2c')]);_0x363dbe[_0x923b('0x2e')]=_[_0x923b('0x2d')](_0x7585c2[_0x923b('0x2b')],qs['fields'](_0x54df3c[_0x923b('0x2c')]['fields']));_0x363dbe[_0x923b('0x2e')]=_0x363dbe[_0x923b('0x2e')][_0x923b('0x30')]?_0x363dbe['attributes']:_0x7585c2[_0x923b('0x2b')];_0x363dbe['order']=qs[_0x923b('0x48')](_0x54df3c[_0x923b('0x2c')][_0x923b('0x48')]);_0x363dbe[_0x923b('0x34')]=qs[_0x923b('0x35')](_[_0x923b('0x36')](_0x54df3c['query'],_0x7585c2[_0x923b('0x35')]));if(_0x54df3c[_0x923b('0x2c')][_0x923b('0x37')]){_0x363dbe[_0x923b('0x34')]=_[_0x923b('0x38')](_0x363dbe[_0x923b('0x34')],{'$or':_[_0x923b('0x39')](_0x363dbe[_0x923b('0x2e')],function(_0x72a983){var _0x597b68={};_0x597b68[_0x72a983]={'$like':'%'+_0x54df3c[_0x923b('0x2c')]['filter']+'%'};return _0x597b68;})});}_0x363dbe=_[_0x923b('0x38')]({},_0x363dbe,_0x54df3c[_0x923b('0x3b')]);return _0x30a32f[_0x923b('0x45')](_0x363dbe);}})[_0x923b('0x22')](function(_0x320da3){if(_0x320da3){_0x457074=_0x320da3['length'];if(!_0x54df3c['query'][_0x923b('0x31')]('nolimit')){_0x363dbe[_0x923b('0x1b')]=qs[_0x923b('0x1b')](_0x54df3c[_0x923b('0x2c')][_0x923b('0x1b')]);_0x363dbe['offset']=qs[_0x923b('0x19')](_0x54df3c[_0x923b('0x2c')][_0x923b('0x19')]);}return _0x30a32f['getConfigurations'](_0x363dbe);}})[_0x923b('0x22')](function(_0x2a0485){if(_0x2a0485){return _0x2a0485?{'count':_0x457074,'rows':_0x2a0485}:null;}})['then'](respondWithResult(_0x2ed934,null))[_0x923b('0x3d')](handleError(_0x2ed934,null));};exports[_0x923b('0x49')]=function(_0x2a3a06,_0x51c34f,_0x4d77a5){if(_0x2a3a06[_0x923b('0x44')]['id']){delete _0x2a3a06[_0x923b('0x44')]['id'];}return db[_0x923b('0x3c')][_0x923b('0x4a')]({'where':{'id':_0x2a3a06[_0x923b('0x3e')]['id']}})[_0x923b('0x22')](handleEntityNotFound(_0x51c34f,null))['then'](function(_0x27b89b){if(_0x27b89b){_0x2a3a06[_0x923b('0x44')]['AccountId']=_0x27b89b['id'];_0x2a3a06[_0x923b('0x44')][_0x923b('0x4b')]=integrations[_0x923b('0x4c')](_0x2a3a06[_0x923b('0x44')][_0x923b('0x4d')],_0x2a3a06[_0x923b('0x44')][_0x923b('0x2a')]);_0x2a3a06[_0x923b('0x44')][_0x923b('0x4e')]=integrations[_0x923b('0x4f')](_0x2a3a06[_0x923b('0x44')][_0x923b('0x4d')],_0x2a3a06['body'][_0x923b('0x2a')]);return db[_0x923b('0x46')][_0x923b('0x43')](_0x2a3a06[_0x923b('0x44')],{'include':[{'model':db[_0x923b('0x50')],'as':'Subjects'},{'model':db[_0x923b('0x50')],'as':'Descriptions'}]});}return null;})[_0x923b('0x22')](respondWithResult(_0x51c34f,null))[_0x923b('0x3d')](handleError(_0x51c34f,null));};exports[_0x923b('0x51')]=function(_0x2fd010,_0x2ac5de,_0x4b63e4){var _0x3cd1ec=[_0x923b('0x52'),_0x923b('0x53'),'knowledge',_0x923b('0x54'),_0x923b('0x55'),_0x923b('0x56'),_0x923b('0x57'),_0x923b('0x58'),_0x923b('0x59')];var _0x550dff=['parent','made_sla',_0x923b('0x5a'),_0x923b('0x5b'),_0x923b('0x5c'),_0x923b('0x5d'),_0x923b('0x5e'),_0x923b('0x53'),_0x923b('0x5f'),_0x923b('0x60'),_0x923b('0x61'),_0x923b('0x62'),'opened_by',_0x923b('0x63'),_0x923b('0x64'),_0x923b('0x65'),_0x923b('0x66'),'sys_created_by',_0x923b('0x67'),_0x923b('0x33'),_0x923b('0x68'),_0x923b('0x69'),_0x923b('0x6a'),'delivery_plan',_0x923b('0x6b'),'active','work_notes_list','business_service',_0x923b('0x6c'),'sys_domain_path',_0x923b('0x6d'),_0x923b('0x6e'),_0x923b('0x6f'),'opened_at','business_duration','group_list',_0x923b('0x70'),_0x923b('0x71'),'resolved_at',_0x923b('0x72'),_0x923b('0x73'),'subcategory','work_notes',_0x923b('0x74'),_0x923b('0x55'),'correlation_display','delivery_task',_0x923b('0x75'),_0x923b('0x76'),'business_stc',_0x923b('0x77'),_0x923b('0x78'),'calendar_duration',_0x923b('0x56'),_0x923b('0x79'),_0x923b('0x7a'),_0x923b('0x7b'),'follow_up','parent_incident',_0x923b('0x7c'),_0x923b('0x7d'),_0x923b('0x7e'),_0x923b('0x57'),'urgency',_0x923b('0x7f'),_0x923b('0x80'),'reassignment_count',_0x923b('0x81'),_0x923b('0x82'),_0x923b('0x58'),_0x923b('0x83'),'sla_due',_0x923b('0x84'),_0x923b('0x85'),_0x923b('0x86'),_0x923b('0x87'),_0x923b('0x88'),_0x923b('0x89'),_0x923b('0x8a'),_0x923b('0x8b'),_0x923b('0x8c'),'location',_0x923b('0x59')];var _0x4ae429='';var _0x1432a6='';var _0x319263=[];var _0x136d94='';var _0x593a2e='';var _0x3278c4=[];var _0x325ee1='';var _0x462702='';var _0x1ca382={};var _0x551e55='';return db['ServicenowAccount'][_0x923b('0x4a')]({'where':{'id':_0x2fd010[_0x923b('0x3e')]['id']},'attributes':['id',_0x923b('0x8d'),_0x923b('0x8e'),_0x923b('0x8f'),_0x923b('0x90'),_0x923b('0x91')]})[_0x923b('0x22')](handleEntityNotFound(_0x2ac5de,null))['then'](function(_0x32b644){if(_0x32b644){_0x551e55=_0x32b644['remoteUri'];var _0x118f0d=_0x551e55[_0x923b('0x92')](-0x1);if(_0x118f0d==='/'){_0x551e55=_0x551e55['substring'](0x0,_0x551e55[_0x923b('0x93')](_0x118f0d));}_0x462702=util[_0x923b('0x94')]('%s/api/now/doc/table/schema/',_0x551e55);_0x325ee1=util[_0x923b('0x94')](_0x923b('0x95'),_0x551e55);_0x1ca382={'user':_0x32b644[_0x923b('0x8d')],'pass':_0x32b644[_0x923b('0x8e')]};var _0x543d06={'method':_0x923b('0x96'),'uri':_0x462702+_0x923b('0x97'),'auth':_0x1ca382,'json':!![]};return rp(_0x543d06);}})['then'](function(_0xa68263){if(_0xa68263[_0x923b('0x98')]['length']>0x0){_0x4ae429=_0xa68263['result'];}console['log'](_0x923b('0x99'),_0x4ae429);_0x3278c4=[];_0x1432a6=Object['assign']([],_0x4ae429);_['remove'](_0x1432a6,function(_0x1e8db1){return!_0x3cd1ec[_0x923b('0x9a')](_0x1e8db1['name']);});_0x1432a6['forEach'](function(_0x2a267c){var _0x241cd0=createFieldObject(_0x325ee1,_0x1ca382,_0x2a267c[_0x923b('0x9b')],_0x2a267c['name'],_0x2a267c['label'],![]);_0x3278c4[_0x923b('0x9c')](_0x241cd0);});return Promise[_0x923b('0x9d')](_0x3278c4);})[_0x923b('0x22')](function(_0x54622d){_0x319263=_0x54622d;_0x136d94=Object[_0x923b('0x9e')]([],_0x4ae429);console[_0x923b('0x9f')](_0x923b('0xa0'),_0x4ae429);_[_0x923b('0xa1')](_0x136d94,function(_0x59c535){return _0x550dff[_0x923b('0x9a')](_0x59c535['name']);});console[_0x923b('0x9f')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x136d94);_0x3278c4=[];_0x136d94['forEach'](function(_0x30e55e){var _0x104643=createFieldObject(_0x325ee1,_0x1ca382,_0x30e55e[_0x923b('0x9b')],_0x30e55e[_0x923b('0x26')],_0x30e55e[_0x923b('0xa2')],!![]);_0x3278c4[_0x923b('0x9c')](_0x104643);});return Promise[_0x923b('0x9d')](_0x3278c4);})[_0x923b('0x22')](function(_0x123a6d){_0x593a2e=_0x123a6d;var _0x502a3a=_0x319263[_0x923b('0xa3')](_0x593a2e);return{'count':_0x502a3a['length'],'rows':_0x502a3a};})[_0x923b('0x22')](respondWithResult(_0x2ac5de,null))['catch'](function(_0x3c0967){console[_0x923b('0x9f')](_0x923b('0xa4')+_0x3c0967);var _0x131c84=_0x2fd010[_0x923b('0x2c')][_0x923b('0xa5')]?0x1f4:_0x3c0967['statusCode']||0x1f4;logger['error'](_0x3c0967[_0x923b('0x25')]);delete _0x3c0967[_0x923b('0x26')];if(_0x131c84===0x191){_0x131c84=0x190;}_0x2ac5de[_0x923b('0x17')](_0x131c84)['send'](_0x2fd010[_0x923b('0x2c')][_0x923b('0xa5')]?{'message':_0x923b('0xa6'),'statusCode':_0x3c0967[_0x923b('0xa7')]}:_0x3c0967);});};function createFieldObject(_0x12de80,_0x3f7496,_0x33e91e,_0x20fbe4,_0x43ba76,_0x552572){return new Promise(function(_0x334284,_0x3f20a6){var _0x4bd283={'id':_0x20fbe4,'name':_0x43ba76,'custom':_0x552572};if(_0x33e91e==='boolean'){_0x4bd283[_0x923b('0x3b')]=[{'name':_0x923b('0xa8'),'value':_0x923b('0xa9')},{'name':_0x923b('0xaa'),'value':_0x923b('0xab')}];_0x334284(_0x4bd283);}else{var _0x4021ca={'method':'GET','uri':_0x12de80+_0x923b('0xac')+_0x20fbe4,'auth':_0x3f7496,'json':!![]};return rp(_0x4021ca)[_0x923b('0x22')](function(_0x1f01f){var _0x3529b2=[];if(_0x1f01f[_0x923b('0x98')][_0x923b('0x30')]>0x0){_0x1f01f[_0x923b('0x98')][_0x923b('0xad')](function(_0x2da9a8){if(_0x2da9a8[_0x923b('0xae')]===_0x923b('0xab')){var _0x35c008={'name':_0x2da9a8[_0x923b('0xa2')],'value':_0x2da9a8[_0x923b('0xaf')]};_0x3529b2[_0x923b('0x9c')](_0x35c008);}});}_0x4bd283[_0x923b('0x3b')]=_0x3529b2;if(_0x4bd283['options'][_0x923b('0x30')]>0x0){_0x334284(_0x4bd283);}else{if(_0x552572==![]){_0x334284();}else{_0x334284(_0x4bd283);}}});}});}
\ No newline at end of file
+var _0xed44=['all','test','statusCode','error','Wrong\x20credentials','boolean','true','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','push','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','child_incidents','approval_history','sys_updated_by','user_input','state','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','due_date','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','substring','%s/api/now/doc/table/schema/','format','%s/api/now/table/','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label'];(function(_0x2e6dbf,_0x57dd06){var _0x2680e5=function(_0x4018f4){while(--_0x4018f4){_0x2e6dbf['push'](_0x2e6dbf['shift']());}};_0x2680e5(++_0x57dd06);}(_0xed44,0xc5));var _0x4ed4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xed44[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x4ed4('0x0'));var rimraf=require(_0x4ed4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ed4('0x2'));var rp=require(_0x4ed4('0x3'));var moment=require(_0x4ed4('0x4'));var BPromise=require(_0x4ed4('0x5'));var Mustache=require('mustache');var util=require(_0x4ed4('0x6'));var path=require('path');var sox=require(_0x4ed4('0x7'));var csv=require(_0x4ed4('0x8'));var ejs=require(_0x4ed4('0x9'));var fs=require('fs');var fs_extra=require(_0x4ed4('0xa'));var _=require(_0x4ed4('0xb'));var squel=require(_0x4ed4('0xc'));var crypto=require(_0x4ed4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4ed4('0xe'));var toCsv=require(_0x4ed4('0x8'));var querystring=require(_0x4ed4('0xf'));var Papa=require(_0x4ed4('0x10'));var Redis=require(_0x4ed4('0x11'));var authService=require(_0x4ed4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4ed4('0x13'));var hardwareService=require(_0x4ed4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4ed4('0x15'));var config=require(_0x4ed4('0x16'));var licenseUtil=require(_0x4ed4('0x17'));var db=require(_0x4ed4('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xe4a50d,_0x31a446){_0x31a446=_0x31a446||0xcc;return function(_0x14d2d8){if(_0x14d2d8){return _0xe4a50d[_0x4ed4('0x19')](_0x31a446);}return _0xe4a50d[_0x4ed4('0x1a')](_0x31a446)[_0x4ed4('0x1b')]();};}function respondWithResult(_0xe2222a,_0x14ab36){_0x14ab36=_0x14ab36||0xc8;return function(_0x54c078){if(_0x54c078){return _0xe2222a['status'](_0x14ab36)[_0x4ed4('0x1c')](_0x54c078);}};}function respondWithFilteredResult(_0x5eacc5,_0x15e233){return function(_0x28224c){if(_0x28224c){var _0x3b277e=typeof _0x15e233[_0x4ed4('0x1d')]===_0x4ed4('0x1e')&&typeof _0x15e233[_0x4ed4('0x1f')]===_0x4ed4('0x1e');var _0x1ba018=_0x28224c[_0x4ed4('0x20')];var _0x12202a=_0x3b277e?0x0:_0x15e233[_0x4ed4('0x1d')];var _0x5aba19=_0x3b277e?_0x28224c[_0x4ed4('0x20')]:_0x15e233[_0x4ed4('0x1d')]+_0x15e233[_0x4ed4('0x1f')];var _0x59bf14;if(_0x5aba19>=_0x1ba018){_0x5aba19=_0x1ba018;_0x59bf14=0xc8;}else{_0x59bf14=0xce;}_0x5eacc5['status'](_0x59bf14);return _0x5eacc5[_0x4ed4('0x21')]('Content-Range',_0x12202a+'-'+_0x5aba19+'/'+_0x1ba018)[_0x4ed4('0x1c')](_0x28224c);}return null;};}function patchUpdates(_0x331612){return function(_0x480584){try{jsonpatch[_0x4ed4('0x22')](_0x480584,_0x331612,!![]);}catch(_0x8a20fa){return BPromise[_0x4ed4('0x23')](_0x8a20fa);}return _0x480584[_0x4ed4('0x24')]();};}function saveUpdates(_0x5f1dbf,_0x1fc131){return function(_0x2cffca){if(_0x2cffca){return _0x2cffca[_0x4ed4('0x25')](_0x5f1dbf)[_0x4ed4('0x26')](function(_0x16229f){return _0x16229f;});}return null;};}function removeEntity(_0x3243c1,_0x48eeef){return function(_0x252ab9){if(_0x252ab9){return _0x252ab9[_0x4ed4('0x27')]()[_0x4ed4('0x26')](function(){_0x3243c1[_0x4ed4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31cca1,_0x3bef6a){return function(_0x364f5e){if(!_0x364f5e){_0x31cca1['sendStatus'](0x194);}return _0x364f5e;};}function handleError(_0x107ec0,_0x6c2dc){_0x6c2dc=_0x6c2dc||0x1f4;return function(_0x48cd0a){logger['error'](_0x48cd0a[_0x4ed4('0x28')]);if(_0x48cd0a[_0x4ed4('0x29')]){delete _0x48cd0a['name'];}_0x107ec0['status'](_0x6c2dc)[_0x4ed4('0x2a')](_0x48cd0a);};}exports[_0x4ed4('0x2b')]=function(_0x24dee0,_0x1f25a5){var _0xe9b17={},_0x121803={},_0x47c10b={'count':0x0,'rows':[]};var _0x556e3a=_[_0x4ed4('0x2c')](db[_0x4ed4('0x2d')]['rawAttributes'],function(_0x174d9){return{'name':_0x174d9[_0x4ed4('0x2e')],'type':_0x174d9[_0x4ed4('0x2f')][_0x4ed4('0x30')]};});_0x121803['model']=_[_0x4ed4('0x2c')](_0x556e3a,'name');_0x121803[_0x4ed4('0x31')]=_['keys'](_0x24dee0[_0x4ed4('0x31')]);_0x121803[_0x4ed4('0x32')]=_[_0x4ed4('0x33')](_0x121803[_0x4ed4('0x34')],_0x121803[_0x4ed4('0x31')]);_0xe9b17['attributes']=_[_0x4ed4('0x33')](_0x121803['model'],qs[_0x4ed4('0x35')](_0x24dee0['query'][_0x4ed4('0x35')]));_0xe9b17[_0x4ed4('0x36')]=_0xe9b17[_0x4ed4('0x36')]['length']?_0xe9b17['attributes']:_0x121803[_0x4ed4('0x34')];if(!_0x24dee0[_0x4ed4('0x31')][_0x4ed4('0x37')](_0x4ed4('0x38'))){_0xe9b17['limit']=qs[_0x4ed4('0x1f')](_0x24dee0[_0x4ed4('0x31')][_0x4ed4('0x1f')]);_0xe9b17[_0x4ed4('0x1d')]=qs[_0x4ed4('0x1d')](_0x24dee0[_0x4ed4('0x31')][_0x4ed4('0x1d')]);}_0xe9b17[_0x4ed4('0x39')]=qs[_0x4ed4('0x3a')](_0x24dee0[_0x4ed4('0x31')][_0x4ed4('0x3a')]);_0xe9b17[_0x4ed4('0x3b')]=qs['filters'](_[_0x4ed4('0x3c')](_0x24dee0[_0x4ed4('0x31')],_0x121803[_0x4ed4('0x32')]),_0x556e3a);if(_0x24dee0[_0x4ed4('0x31')][_0x4ed4('0x3d')]){_0xe9b17[_0x4ed4('0x3b')]=_[_0x4ed4('0x3e')](_0xe9b17[_0x4ed4('0x3b')],{'$or':_[_0x4ed4('0x2c')](_0x556e3a,function(_0x5d345a){if(_0x5d345a[_0x4ed4('0x2f')]!==_0x4ed4('0x3f')){var _0xc7e6f4={};_0xc7e6f4[_0x5d345a['name']]={'$like':'%'+_0x24dee0['query'][_0x4ed4('0x3d')]+'%'};return _0xc7e6f4;}})});}_0xe9b17=_[_0x4ed4('0x3e')]({},_0xe9b17,_0x24dee0[_0x4ed4('0x40')]);var _0x5b3ca5={'where':_0xe9b17[_0x4ed4('0x3b')]};return db[_0x4ed4('0x2d')][_0x4ed4('0x20')](_0x5b3ca5)[_0x4ed4('0x26')](function(_0x13adca){_0x47c10b[_0x4ed4('0x20')]=_0x13adca;if(_0x24dee0[_0x4ed4('0x31')][_0x4ed4('0x41')]){_0xe9b17[_0x4ed4('0x42')]=[{'all':!![]}];}return db[_0x4ed4('0x2d')][_0x4ed4('0x43')](_0xe9b17);})[_0x4ed4('0x26')](function(_0xf6a2de){_0x47c10b[_0x4ed4('0x44')]=_0xf6a2de;return _0x47c10b;})[_0x4ed4('0x26')](respondWithFilteredResult(_0x1f25a5,_0xe9b17))[_0x4ed4('0x45')](handleError(_0x1f25a5,null));};exports[_0x4ed4('0x46')]=function(_0x439e0d,_0x180ffb){var _0x29571d={'raw':![],'where':{'id':_0x439e0d[_0x4ed4('0x47')]['id']}},_0x4ec447={};_0x4ec447[_0x4ed4('0x34')]=_[_0x4ed4('0x48')](db[_0x4ed4('0x2d')][_0x4ed4('0x49')]);_0x4ec447[_0x4ed4('0x31')]=_[_0x4ed4('0x48')](_0x439e0d[_0x4ed4('0x31')]);_0x4ec447[_0x4ed4('0x32')]=_[_0x4ed4('0x33')](_0x4ec447[_0x4ed4('0x34')],_0x4ec447[_0x4ed4('0x31')]);_0x29571d[_0x4ed4('0x36')]=_['intersection'](_0x4ec447['model'],qs['fields'](_0x439e0d[_0x4ed4('0x31')][_0x4ed4('0x35')]));_0x29571d[_0x4ed4('0x36')]=_0x29571d['attributes'][_0x4ed4('0x4a')]?_0x29571d[_0x4ed4('0x36')]:_0x4ec447[_0x4ed4('0x34')];if(_0x439e0d[_0x4ed4('0x31')][_0x4ed4('0x41')]){_0x29571d[_0x4ed4('0x42')]=[{'all':!![]}];}_0x29571d=_[_0x4ed4('0x3e')]({},_0x29571d,_0x439e0d[_0x4ed4('0x40')]);return db['ServicenowAccount'][_0x4ed4('0x4b')](_0x29571d)[_0x4ed4('0x26')](handleEntityNotFound(_0x180ffb,null))[_0x4ed4('0x26')](respondWithResult(_0x180ffb,null))[_0x4ed4('0x45')](handleError(_0x180ffb,null));};exports[_0x4ed4('0x4c')]=function(_0x4bfbdf,_0x31532b){return db['ServicenowAccount'][_0x4ed4('0x4c')](_0x4bfbdf['body'],{})[_0x4ed4('0x26')](respondWithResult(_0x31532b,0xc9))[_0x4ed4('0x45')](handleError(_0x31532b,null));};exports[_0x4ed4('0x25')]=function(_0x3e9596,_0x522a60){if(_0x3e9596[_0x4ed4('0x4d')]['id']){delete _0x3e9596[_0x4ed4('0x4d')]['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x3e9596['params']['id']}})['then'](handleEntityNotFound(_0x522a60,null))[_0x4ed4('0x26')](saveUpdates(_0x3e9596[_0x4ed4('0x4d')],null))[_0x4ed4('0x26')](respondWithResult(_0x522a60,null))['catch'](handleError(_0x522a60,null));};exports[_0x4ed4('0x27')]=function(_0x4db12d,_0x18013e){return db[_0x4ed4('0x2d')][_0x4ed4('0x4b')]({'where':{'id':_0x4db12d['params']['id']}})[_0x4ed4('0x26')](handleEntityNotFound(_0x18013e,null))['then'](removeEntity(_0x18013e,null))['catch'](handleError(_0x18013e,null));};exports['getConfigurations']=function(_0xe89d0e,_0x3dcec3,_0x1c4279){var _0x19a388={};var _0x5c59bf={};var _0x17cea4;var _0x1c9207;return db['ServicenowAccount'][_0x4ed4('0x4e')]({'where':{'id':_0xe89d0e['params']['id']}})[_0x4ed4('0x26')](handleEntityNotFound(_0x3dcec3,null))[_0x4ed4('0x26')](function(_0xc8a3d8){if(_0xc8a3d8){_0x17cea4=_0xc8a3d8;_0x5c59bf[_0x4ed4('0x34')]=_[_0x4ed4('0x48')](db[_0x4ed4('0x4f')]['rawAttributes']);_0x5c59bf[_0x4ed4('0x31')]=_[_0x4ed4('0x48')](_0xe89d0e['query']);_0x5c59bf[_0x4ed4('0x32')]=_['intersection'](_0x5c59bf['model'],_0x5c59bf[_0x4ed4('0x31')]);_0x19a388[_0x4ed4('0x36')]=_[_0x4ed4('0x33')](_0x5c59bf[_0x4ed4('0x34')],qs[_0x4ed4('0x35')](_0xe89d0e[_0x4ed4('0x31')]['fields']));_0x19a388[_0x4ed4('0x36')]=_0x19a388['attributes']['length']?_0x19a388[_0x4ed4('0x36')]:_0x5c59bf['model'];_0x19a388[_0x4ed4('0x39')]=qs[_0x4ed4('0x3a')](_0xe89d0e[_0x4ed4('0x31')][_0x4ed4('0x3a')]);_0x19a388[_0x4ed4('0x3b')]=qs[_0x4ed4('0x32')](_[_0x4ed4('0x3c')](_0xe89d0e[_0x4ed4('0x31')],_0x5c59bf[_0x4ed4('0x32')]));if(_0xe89d0e[_0x4ed4('0x31')][_0x4ed4('0x3d')]){_0x19a388[_0x4ed4('0x3b')]=_[_0x4ed4('0x3e')](_0x19a388[_0x4ed4('0x3b')],{'$or':_[_0x4ed4('0x2c')](_0x19a388[_0x4ed4('0x36')],function(_0x43209b){var _0x1ba103={};_0x1ba103[_0x43209b]={'$like':'%'+_0xe89d0e[_0x4ed4('0x31')]['filter']+'%'};return _0x1ba103;})});}_0x19a388=_[_0x4ed4('0x3e')]({},_0x19a388,_0xe89d0e[_0x4ed4('0x40')]);return _0x17cea4[_0x4ed4('0x50')](_0x19a388);}})[_0x4ed4('0x26')](function(_0x22d06e){if(_0x22d06e){_0x1c9207=_0x22d06e[_0x4ed4('0x4a')];if(!_0xe89d0e[_0x4ed4('0x31')][_0x4ed4('0x37')]('nolimit')){_0x19a388['limit']=qs[_0x4ed4('0x1f')](_0xe89d0e[_0x4ed4('0x31')]['limit']);_0x19a388[_0x4ed4('0x1d')]=qs[_0x4ed4('0x1d')](_0xe89d0e[_0x4ed4('0x31')][_0x4ed4('0x1d')]);}return _0x17cea4['getConfigurations'](_0x19a388);}})[_0x4ed4('0x26')](function(_0x37ce59){if(_0x37ce59){return _0x37ce59?{'count':_0x1c9207,'rows':_0x37ce59}:null;}})[_0x4ed4('0x26')](respondWithResult(_0x3dcec3,null))[_0x4ed4('0x45')](handleError(_0x3dcec3,null));};exports[_0x4ed4('0x51')]=function(_0xf8969e,_0x390cdd,_0x2622ec){if(_0xf8969e['body']['id']){delete _0xf8969e['body']['id'];}return db[_0x4ed4('0x2d')][_0x4ed4('0x4e')]({'where':{'id':_0xf8969e['params']['id']}})[_0x4ed4('0x26')](handleEntityNotFound(_0x390cdd,null))[_0x4ed4('0x26')](function(_0x35b320){if(_0x35b320){_0xf8969e[_0x4ed4('0x4d')][_0x4ed4('0x52')]=_0x35b320['id'];_0xf8969e[_0x4ed4('0x4d')]['Subjects']=integrations[_0x4ed4('0x53')](_0xf8969e[_0x4ed4('0x4d')][_0x4ed4('0x54')],_0xf8969e[_0x4ed4('0x4d')]['type']);_0xf8969e[_0x4ed4('0x4d')][_0x4ed4('0x55')]=integrations['getDescriptions'](_0xf8969e[_0x4ed4('0x4d')][_0x4ed4('0x54')],_0xf8969e[_0x4ed4('0x4d')][_0x4ed4('0x2f')]);return db[_0x4ed4('0x4f')]['create'](_0xf8969e[_0x4ed4('0x4d')],{'include':[{'model':db[_0x4ed4('0x56')],'as':_0x4ed4('0x57')},{'model':db[_0x4ed4('0x56')],'as':_0x4ed4('0x55')}]});}return null;})[_0x4ed4('0x26')](respondWithResult(_0x390cdd,null))[_0x4ed4('0x45')](handleError(_0x390cdd,null));};exports[_0x4ed4('0x58')]=function(_0x3ff1dd,_0x2aa5ae,_0x24a0e5){var _0x2d95f0=[_0x4ed4('0x59'),_0x4ed4('0x5a'),_0x4ed4('0x5b'),_0x4ed4('0x5c'),_0x4ed4('0x5d'),_0x4ed4('0x5e'),_0x4ed4('0x5f'),_0x4ed4('0x60'),_0x4ed4('0x61')];var _0x2d84c9=[_0x4ed4('0x62'),'made_sla',_0x4ed4('0x63'),_0x4ed4('0x64'),'upon_reject','sys_updated_on',_0x4ed4('0x65'),_0x4ed4('0x5a'),_0x4ed4('0x66'),'number','resolved_by',_0x4ed4('0x67'),'opened_by',_0x4ed4('0x68'),'sys_created_on','sys_domain',_0x4ed4('0x69'),'sys_created_by',_0x4ed4('0x5b'),_0x4ed4('0x39'),_0x4ed4('0x6a'),_0x4ed4('0x6b'),_0x4ed4('0x6c'),'delivery_plan',_0x4ed4('0x6d'),_0x4ed4('0x6e'),_0x4ed4('0x6f'),_0x4ed4('0x70'),_0x4ed4('0x71'),_0x4ed4('0x72'),'rfc',_0x4ed4('0x73'),_0x4ed4('0x74'),_0x4ed4('0x75'),_0x4ed4('0x76'),_0x4ed4('0x77'),'work_end',_0x4ed4('0x78'),_0x4ed4('0x79'),_0x4ed4('0x7a'),_0x4ed4('0x7b'),_0x4ed4('0x5c'),_0x4ed4('0x7c'),_0x4ed4('0x7d'),'close_code',_0x4ed4('0x7e'),_0x4ed4('0x7f'),_0x4ed4('0x80'),_0x4ed4('0x81'),_0x4ed4('0x82'),_0x4ed4('0x83'),'description',_0x4ed4('0x84'),_0x4ed4('0x5e'),_0x4ed4('0x85'),_0x4ed4('0x86'),_0x4ed4('0x87'),_0x4ed4('0x88'),_0x4ed4('0x89'),_0x4ed4('0x8a'),_0x4ed4('0x8b'),_0x4ed4('0x8c'),_0x4ed4('0x5f'),'urgency',_0x4ed4('0x8d'),_0x4ed4('0x8e'),_0x4ed4('0x8f'),_0x4ed4('0x90'),'assigned_to',_0x4ed4('0x60'),_0x4ed4('0x91'),_0x4ed4('0x92'),_0x4ed4('0x93'),'comments_and_work_notes',_0x4ed4('0x94'),'sys_mod_count','reopen_count','sys_tags','escalation',_0x4ed4('0x95'),_0x4ed4('0x96'),_0x4ed4('0x97'),_0x4ed4('0x61')];var _0x298551='';var _0x349dbc='';var _0x2b1760=[];var _0x75059e='';var _0xf55e46='';var _0x4d3591=[];var _0x4992f8='';var _0x5c9c48='';var _0x4d698b={};var _0x515158='';return db[_0x4ed4('0x2d')][_0x4ed4('0x4e')]({'where':{'id':_0x3ff1dd['params']['id']},'attributes':['id',_0x4ed4('0x98'),_0x4ed4('0x99'),'email',_0x4ed4('0x9a'),_0x4ed4('0x9b')]})[_0x4ed4('0x26')](handleEntityNotFound(_0x2aa5ae,null))[_0x4ed4('0x26')](function(_0x56cacf){if(_0x56cacf){_0x515158=_0x56cacf[_0x4ed4('0x9a')];var _0x4bf7e9=_0x515158['slice'](-0x1);if(_0x4bf7e9==='/'){_0x515158=_0x515158[_0x4ed4('0x9c')](0x0,_0x515158['lastIndexOf'](_0x4bf7e9));}_0x5c9c48=util['format'](_0x4ed4('0x9d'),_0x515158);_0x4992f8=util[_0x4ed4('0x9e')](_0x4ed4('0x9f'),_0x515158);_0x4d698b={'user':_0x56cacf[_0x4ed4('0x98')],'pass':_0x56cacf[_0x4ed4('0x99')]};var _0x5b3d22={'method':'GET','uri':_0x5c9c48+_0x4ed4('0xa0'),'auth':_0x4d698b,'json':!![]};return rp(_0x5b3d22);}})['then'](function(_0x45702e){if(_0x45702e[_0x4ed4('0xa1')]['length']>0x0){_0x298551=_0x45702e[_0x4ed4('0xa1')];}console['log'](_0x4ed4('0xa2'),_0x298551);_0x4d3591=[];_0x349dbc=Object[_0x4ed4('0xa3')]([],_0x298551);_[_0x4ed4('0xa4')](_0x349dbc,function(_0x72ea34){return!_0x2d95f0[_0x4ed4('0xa5')](_0x72ea34[_0x4ed4('0x29')]);});_0x349dbc[_0x4ed4('0xa6')](function(_0x598760){var _0x2b7d69=createFieldObject(_0x4992f8,_0x4d698b,_0x598760[_0x4ed4('0xa7')],_0x598760[_0x4ed4('0x29')],_0x598760['label'],![]);_0x4d3591['push'](_0x2b7d69);});return Promise['all'](_0x4d3591);})[_0x4ed4('0x26')](function(_0xead7e4){_0x2b1760=_0xead7e4;_0x75059e=Object[_0x4ed4('0xa3')]([],_0x298551);console[_0x4ed4('0xa8')]('TCL:\x20_object',_0x298551);_[_0x4ed4('0xa4')](_0x75059e,function(_0x45b96b){return _0x2d84c9[_0x4ed4('0xa5')](_0x45b96b[_0x4ed4('0x29')]);});console['log'](_0x4ed4('0xa9'),_0x75059e);_0x4d3591=[];_0x75059e[_0x4ed4('0xa6')](function(_0x5b63af){var _0x1eee0f=createFieldObject(_0x4992f8,_0x4d698b,_0x5b63af['internalType'],_0x5b63af['name'],_0x5b63af[_0x4ed4('0xaa')],!![]);_0x4d3591['push'](_0x1eee0f);});return Promise[_0x4ed4('0xab')](_0x4d3591);})[_0x4ed4('0x26')](function(_0x1a65a3){_0xf55e46=_0x1a65a3;var _0x828d74=_0x2b1760['concat'](_0xf55e46);return{'count':_0x828d74[_0x4ed4('0x4a')],'rows':_0x828d74};})[_0x4ed4('0x26')](respondWithResult(_0x2aa5ae,null))[_0x4ed4('0x45')](function(_0x516f40){console[_0x4ed4('0xa8')]('ServiceNow\x20error:\x20'+_0x516f40);var _0x4a5f10=_0x3ff1dd[_0x4ed4('0x31')][_0x4ed4('0xac')]?0x1f4:_0x516f40[_0x4ed4('0xad')]||0x1f4;logger[_0x4ed4('0xae')](_0x516f40['stack']);delete _0x516f40['name'];if(_0x4a5f10===0x191){_0x4a5f10=0x190;}_0x2aa5ae[_0x4ed4('0x1a')](_0x4a5f10)[_0x4ed4('0x2a')](_0x3ff1dd[_0x4ed4('0x31')][_0x4ed4('0xac')]?{'message':_0x4ed4('0xaf'),'statusCode':_0x516f40['statusCode']}:_0x516f40);});};function createFieldObject(_0x34cc8a,_0x5d766b,_0x5b65ea,_0x3c37b4,_0x3bfc4a,_0x2209bc){return new Promise(function(_0x28474d,_0x487eac){var _0x4dd542={'id':_0x3c37b4,'name':_0x3bfc4a,'custom':_0x2209bc};if(_0x5b65ea===_0x4ed4('0xb0')){_0x4dd542[_0x4ed4('0x40')]=[{'name':'True','value':_0x4ed4('0xb1')},{'name':'False','value':_0x4ed4('0xb2')}];_0x28474d(_0x4dd542);}else{var _0x207181={'method':_0x4ed4('0xb3'),'uri':_0x34cc8a+_0x4ed4('0xb4')+_0x3c37b4,'auth':_0x5d766b,'json':!![]};return rp(_0x207181)[_0x4ed4('0x26')](function(_0x3478e4){var _0x47dd7f=[];if(_0x3478e4[_0x4ed4('0xa1')][_0x4ed4('0x4a')]>0x0){_0x3478e4[_0x4ed4('0xa1')]['forEach'](function(_0x522c7b){if(_0x522c7b[_0x4ed4('0xb5')]===_0x4ed4('0xb2')){var _0x2e94b1={'name':_0x522c7b['label'],'value':_0x522c7b[_0x4ed4('0xb6')]};_0x47dd7f[_0x4ed4('0xb7')](_0x2e94b1);}});}_0x4dd542[_0x4ed4('0x40')]=_0x47dd7f;if(_0x4dd542[_0x4ed4('0x40')][_0x4ed4('0x4a')]>0x0){_0x28474d(_0x4dd542);}else{if(_0x2209bc==![]){_0x28474d();}else{_0x28474d(_0x4dd542);}}});}});}
\ No newline at end of file
index 8917adb..7377785 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x160877,_0x3c3a3d){var _0x3b6fca=function(_0x3c6e46){while(--_0x3c6e46){_0x160877['push'](_0x160877['shift']());}};_0x3b6fca(++_0x3c3a3d);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1aa37a,_0x5a3459){_0x1aa37a=_0x1aa37a-0x0;var _0x3ebcc0=_0xbd51[_0x1aa37a];return _0x3ebcc0;};'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'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger'];(function(_0x46d964,_0x504922){var _0x17b43f=function(_0x5d9e35){while(--_0x5d9e35){_0x46d964['push'](_0x46d964['shift']());}};_0x17b43f(++_0x504922);}(_0x7217,0x19e));var _0x7721=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7217[_0x4baae2];return _0x1a2285;};'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'));var integrations=require(_0x7721('0x8'));module[_0x7721('0x9')]=function(_0xb239e0,_0xf7ff37){return _0xb239e0[_0x7721('0xa')](_0x7721('0xb'),attributes,{'tableName':_0x7721('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1233fa6..bc29178 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfab0=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','GetServicenowAccount','ServicenowAccount','options','where','attributes','limit','include','model','map','stringify','raw','ShowServicenowAccount','lodash'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xfab0,0x1df));var _0x0fab=function(_0x362046,_0x5cf93f){_0x362046=_0x362046-0x0;var _0x419ffe=_0xfab0[_0x362046];return _0x419ffe;};'use strict';var _=require(_0x0fab('0x0'));var util=require(_0x0fab('0x1'));var moment=require(_0x0fab('0x2'));var BPromise=require(_0x0fab('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fab('0x4'));var db=require(_0x0fab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fab('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0fab('0x7')][_0x0fab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5819af,_0x1c133c,_0x4bb6c5){return new BPromise(function(_0x56da66,_0x22aef6){return client[_0x0fab('0x9')](_0x5819af,_0x4bb6c5)[_0x0fab('0xa')](function(_0x1e1f18){logger[_0x0fab('0xb')](_0x0fab('0xc'),_0x1c133c,_0x0fab('0xd'));logger[_0x0fab('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1c133c,'request\x20sent',JSON['stringify'](_0x1e1f18));if(_0x1e1f18['error']){if(_0x1e1f18['error'][_0x0fab('0xf')]===0x1f4){logger[_0x0fab('0x10')](_0x0fab('0xc'),_0x1c133c,_0x1e1f18['error'][_0x0fab('0x11')]);return _0x22aef6(_0x1e1f18[_0x0fab('0x10')]['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1c133c,_0x1e1f18[_0x0fab('0x10')][_0x0fab('0x11')]);return _0x56da66(_0x1e1f18[_0x0fab('0x10')]['message']);}else{logger[_0x0fab('0xb')](_0x0fab('0xc'),_0x1c133c,_0x0fab('0xd'));_0x56da66(_0x1e1f18[_0x0fab('0x12')][_0x0fab('0x11')]);}})[_0x0fab('0x13')](function(_0x32096f){logger[_0x0fab('0x10')](_0x0fab('0xc'),_0x1c133c,_0x32096f);_0x22aef6(_0x32096f);});});}exports[_0x0fab('0x14')]=function(_0x1b5749){var _0x25a382=this;return new Promise(function(_0xc802d5,_0x2d6e41){return db[_0x0fab('0x15')]['findAll']({'raw':_0x1b5749[_0x0fab('0x16')]?_0x1b5749[_0x0fab('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1b5749[_0x0fab('0x16')]?_0x1b5749[_0x0fab('0x16')][_0x0fab('0x17')]||null:null,'attributes':_0x1b5749[_0x0fab('0x16')]?_0x1b5749['options'][_0x0fab('0x18')]||null:null,'limit':_0x1b5749[_0x0fab('0x16')]?_0x1b5749['options'][_0x0fab('0x19')]||null:null,'include':_0x1b5749[_0x0fab('0x16')]?_0x1b5749['options'][_0x0fab('0x1a')]?_['map'](_0x1b5749[_0x0fab('0x16')][_0x0fab('0x1a')],function(_0x5275de){return{'model':db[_0x5275de[_0x0fab('0x1b')]],'as':_0x5275de['as'],'attributes':_0x5275de[_0x0fab('0x18')],'include':_0x5275de[_0x0fab('0x1a')]?_[_0x0fab('0x1c')](_0x5275de['include'],function(_0x727a73){return{'model':db[_0x727a73[_0x0fab('0x1b')]],'as':_0x727a73['as'],'attributes':_0x727a73[_0x0fab('0x18')],'include':_0x727a73['include']?_['map'](_0x727a73[_0x0fab('0x1a')],function(_0x346271){return{'model':db[_0x346271['model']],'as':_0x346271['as'],'attributes':_0x346271[_0x0fab('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0fab('0xa')](function(_0x2fd4d1){logger[_0x0fab('0xb')](_0x0fab('0x14'),_0x1b5749);logger[_0x0fab('0xe')](_0x0fab('0x14'),_0x1b5749,JSON[_0x0fab('0x1d')](_0x2fd4d1));_0xc802d5(_0x2fd4d1);})[_0x0fab('0x13')](function(_0x4943d0){logger['error'](_0x0fab('0x14'),_0x4943d0['message'],_0x1b5749);_0x2d6e41(_0x25a382['error'](0x1f4,_0x4943d0['message']));});});};exports['ShowServicenowAccount']=function(_0x2109ee){var _0x4aadc9=this;return new Promise(function(_0x48bd7b,_0x50eff5){return db[_0x0fab('0x15')]['find']({'raw':_0x2109ee[_0x0fab('0x16')]?_0x2109ee['options'][_0x0fab('0x1e')]===undefined?!![]:![]:!![],'where':_0x2109ee['options']?_0x2109ee[_0x0fab('0x16')][_0x0fab('0x17')]||null:null,'attributes':_0x2109ee[_0x0fab('0x16')]?_0x2109ee[_0x0fab('0x16')][_0x0fab('0x18')]||null:null,'include':_0x2109ee[_0x0fab('0x16')]?_0x2109ee[_0x0fab('0x16')][_0x0fab('0x1a')]?_['map'](_0x2109ee[_0x0fab('0x16')][_0x0fab('0x1a')],function(_0x58b0a6){return{'model':db[_0x58b0a6['model']],'as':_0x58b0a6['as'],'attributes':_0x58b0a6[_0x0fab('0x18')],'include':_0x58b0a6[_0x0fab('0x1a')]?_['map'](_0x58b0a6[_0x0fab('0x1a')],function(_0x2f431c){return{'model':db[_0x2f431c[_0x0fab('0x1b')]],'as':_0x2f431c['as'],'attributes':_0x2f431c['attributes'],'include':_0x2f431c[_0x0fab('0x1a')]?_['map'](_0x2f431c[_0x0fab('0x1a')],function(_0x2dfb21){return{'model':db[_0x2dfb21[_0x0fab('0x1b')]],'as':_0x2dfb21['as'],'attributes':_0x2dfb21['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x37c3c3){logger['info']('ShowServicenowAccount',_0x2109ee);logger['debug'](_0x0fab('0x1f'),_0x2109ee,JSON[_0x0fab('0x1d')](_0x37c3c3));_0x48bd7b(_0x37c3c3);})['catch'](function(_0x12908c){logger[_0x0fab('0x10')](_0x0fab('0x1f'),_0x12908c[_0x0fab('0x11')],_0x2109ee);_0x50eff5(_0x4aadc9[_0x0fab('0x10')](0x1f4,_0x12908c[_0x0fab('0x11')]));});});};
\ No newline at end of file
+var _0x9341=['catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','model','map','ShowServicenowAccount','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0xa0389d,_0x31c0f4){var _0x5d30d9=function(_0x47b181){while(--_0x47b181){_0xa0389d['push'](_0xa0389d['shift']());}};_0x5d30d9(++_0x31c0f4);}(_0x9341,0x16b));var _0x1934=function(_0x380253,_0x1dfbec){_0x380253=_0x380253-0x0;var _0x233bd3=_0x9341[_0x380253];return _0x233bd3;};'use strict';var _=require(_0x1934('0x0'));var util=require('util');var moment=require(_0x1934('0x1'));var BPromise=require(_0x1934('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1934('0x3'));var db=require(_0x1934('0x4'))['db'];var utils=require(_0x1934('0x5'));var logger=require('../../config/logger')(_0x1934('0x6'));var config=require(_0x1934('0x7'));var jayson=require(_0x1934('0x8'));var client=jayson[_0x1934('0x9')][_0x1934('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x440c85,_0x178fc6,_0x391b37){return new BPromise(function(_0x366805,_0x4e69c3){return client[_0x1934('0xb')](_0x440c85,_0x391b37)[_0x1934('0xc')](function(_0x27309c){logger['info'](_0x1934('0xd'),_0x178fc6,_0x1934('0xe'));logger[_0x1934('0xf')](_0x1934('0x10'),_0x178fc6,'request\x20sent',JSON['stringify'](_0x27309c));if(_0x27309c[_0x1934('0x11')]){if(_0x27309c[_0x1934('0x11')][_0x1934('0x12')]===0x1f4){logger[_0x1934('0x11')](_0x1934('0xd'),_0x178fc6,_0x27309c[_0x1934('0x11')][_0x1934('0x13')]);return _0x4e69c3(_0x27309c[_0x1934('0x11')][_0x1934('0x13')]);}logger[_0x1934('0x11')](_0x1934('0xd'),_0x178fc6,_0x27309c[_0x1934('0x11')]['message']);return _0x366805(_0x27309c[_0x1934('0x11')][_0x1934('0x13')]);}else{logger[_0x1934('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x178fc6,_0x1934('0xe'));_0x366805(_0x27309c[_0x1934('0x15')][_0x1934('0x13')]);}})[_0x1934('0x16')](function(_0x1bbad0){logger['error'](_0x1934('0xd'),_0x178fc6,_0x1bbad0);_0x4e69c3(_0x1bbad0);});});}exports[_0x1934('0x17')]=function(_0xcd6d58){var _0x1a9e68=this;return new Promise(function(_0x2b23d3,_0x11c5e6){return db[_0x1934('0x18')]['findAll']({'raw':_0xcd6d58[_0x1934('0x19')]?_0xcd6d58[_0x1934('0x19')][_0x1934('0x1a')]===undefined?!![]:![]:!![],'where':_0xcd6d58[_0x1934('0x19')]?_0xcd6d58[_0x1934('0x19')][_0x1934('0x1b')]||null:null,'attributes':_0xcd6d58['options']?_0xcd6d58[_0x1934('0x19')][_0x1934('0x1c')]||null:null,'limit':_0xcd6d58['options']?_0xcd6d58[_0x1934('0x19')][_0x1934('0x1d')]||null:null,'include':_0xcd6d58['options']?_0xcd6d58[_0x1934('0x19')][_0x1934('0x1e')]?_['map'](_0xcd6d58['options'][_0x1934('0x1e')],function(_0x178cec){return{'model':db[_0x178cec[_0x1934('0x1f')]],'as':_0x178cec['as'],'attributes':_0x178cec[_0x1934('0x1c')],'include':_0x178cec[_0x1934('0x1e')]?_[_0x1934('0x20')](_0x178cec[_0x1934('0x1e')],function(_0x5270c2){return{'model':db[_0x5270c2[_0x1934('0x1f')]],'as':_0x5270c2['as'],'attributes':_0x5270c2['attributes'],'include':_0x5270c2[_0x1934('0x1e')]?_[_0x1934('0x20')](_0x5270c2[_0x1934('0x1e')],function(_0x2f0fad){return{'model':db[_0x2f0fad[_0x1934('0x1f')]],'as':_0x2f0fad['as'],'attributes':_0x2f0fad[_0x1934('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1934('0xc')](function(_0x984904){logger[_0x1934('0x14')](_0x1934('0x17'),_0xcd6d58);logger[_0x1934('0xf')]('GetServicenowAccount',_0xcd6d58,JSON['stringify'](_0x984904));_0x2b23d3(_0x984904);})[_0x1934('0x16')](function(_0x425b0d){logger[_0x1934('0x11')](_0x1934('0x17'),_0x425b0d['message'],_0xcd6d58);_0x11c5e6(_0x1a9e68[_0x1934('0x11')](0x1f4,_0x425b0d[_0x1934('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x20cf5e){var _0x40b457=this;return new Promise(function(_0x3fe181,_0x18e578){return db[_0x1934('0x18')]['find']({'raw':_0x20cf5e['options']?_0x20cf5e['options'][_0x1934('0x1a')]===undefined?!![]:![]:!![],'where':_0x20cf5e['options']?_0x20cf5e[_0x1934('0x19')][_0x1934('0x1b')]||null:null,'attributes':_0x20cf5e[_0x1934('0x19')]?_0x20cf5e[_0x1934('0x19')][_0x1934('0x1c')]||null:null,'include':_0x20cf5e[_0x1934('0x19')]?_0x20cf5e[_0x1934('0x19')][_0x1934('0x1e')]?_['map'](_0x20cf5e[_0x1934('0x19')][_0x1934('0x1e')],function(_0x10a7a4){return{'model':db[_0x10a7a4[_0x1934('0x1f')]],'as':_0x10a7a4['as'],'attributes':_0x10a7a4[_0x1934('0x1c')],'include':_0x10a7a4[_0x1934('0x1e')]?_[_0x1934('0x20')](_0x10a7a4[_0x1934('0x1e')],function(_0x375068){return{'model':db[_0x375068['model']],'as':_0x375068['as'],'attributes':_0x375068[_0x1934('0x1c')],'include':_0x375068['include']?_[_0x1934('0x20')](_0x375068['include'],function(_0xf8a66){return{'model':db[_0xf8a66[_0x1934('0x1f')]],'as':_0xf8a66['as'],'attributes':_0xf8a66[_0x1934('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc686e6){logger['info'](_0x1934('0x21'),_0x20cf5e);logger['debug'](_0x1934('0x21'),_0x20cf5e,JSON[_0x1934('0x22')](_0xc686e6));_0x3fe181(_0xc686e6);})[_0x1934('0x16')](function(_0x14e41a){logger[_0x1934('0x11')](_0x1934('0x21'),_0x14e41a['message'],_0x20cf5e);_0x18e578(_0x40b457[_0x1934('0x11')](0x1f4,_0x14e41a['message']));});});};
\ No newline at end of file
index bca9214..45d60b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3b3=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xd3b3,0x70));var _0x3d3b=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0xd3b3[_0x15cdcb];return _0x37b069;};'use strict';var multer=require(_0x3d3b('0x0'));var util=require(_0x3d3b('0x1'));var path=require(_0x3d3b('0x2'));var timeout=require(_0x3d3b('0x3'));var express=require(_0x3d3b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3d3b('0x5'));var interaction=require(_0x3d3b('0x6'));var config=require(_0x3d3b('0x7'));var controller=require(_0x3d3b('0x8'));router['get']('/',auth[_0x3d3b('0x9')](),controller[_0x3d3b('0xa')]);router[_0x3d3b('0xb')](_0x3d3b('0xc'),auth[_0x3d3b('0x9')](),controller[_0x3d3b('0xd')]);router[_0x3d3b('0xb')](_0x3d3b('0xe'),auth[_0x3d3b('0x9')](),controller['getFields']);router[_0x3d3b('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x3d3b('0xf')]);router[_0x3d3b('0xb')](_0x3d3b('0x10'),auth[_0x3d3b('0x9')](),controller['getDescriptions']);router[_0x3d3b('0x11')]('/',auth[_0x3d3b('0x9')](),controller[_0x3d3b('0x12')]);router['put'](_0x3d3b('0xc'),auth['isAuthenticated'](),controller[_0x3d3b('0x13')]);router[_0x3d3b('0x14')]('/:id',auth[_0x3d3b('0x9')](),controller[_0x3d3b('0x15')]);module[_0x3d3b('0x16')]=router;
\ No newline at end of file
+var _0x5e74=['update','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x5dcde3,_0x274c46){var _0x41b8f0=function(_0x2c1f53){while(--_0x2c1f53){_0x5dcde3['push'](_0x5dcde3['shift']());}};_0x41b8f0(++_0x274c46);}(_0x5e74,0x158));var _0x45e7=function(_0x237fd7,_0x28850b){_0x237fd7=_0x237fd7-0x0;var _0x25bc63=_0x5e74[_0x237fd7];return _0x25bc63;};'use strict';var multer=require(_0x45e7('0x0'));var util=require('util');var path=require(_0x45e7('0x1'));var timeout=require(_0x45e7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x45e7('0x3'));var interaction=require(_0x45e7('0x4'));var config=require(_0x45e7('0x5'));var controller=require('./intServicenowConfiguration.controller');router[_0x45e7('0x6')]('/',auth[_0x45e7('0x7')](),controller['index']);router[_0x45e7('0x6')](_0x45e7('0x8'),auth['isAuthenticated'](),controller[_0x45e7('0x9')]);router[_0x45e7('0x6')](_0x45e7('0xa'),auth['isAuthenticated'](),controller[_0x45e7('0xb')]);router[_0x45e7('0x6')]('/:id/subjects',auth[_0x45e7('0x7')](),controller['getSubjects']);router[_0x45e7('0x6')](_0x45e7('0xc'),auth[_0x45e7('0x7')](),controller[_0x45e7('0xd')]);router[_0x45e7('0xe')]('/',auth[_0x45e7('0x7')](),controller[_0x45e7('0xf')]);router[_0x45e7('0x10')](_0x45e7('0x8'),auth[_0x45e7('0x7')](),controller[_0x45e7('0x11')]);router['delete'](_0x45e7('0x8'),auth[_0x45e7('0x7')](),controller[_0x45e7('0x12')]);module['exports']=router;
\ No newline at end of file
index 92d1fe7..05a85fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d59=['STRING','sequelize','exports'];(function(_0x96909d,_0x2dc0fe){var _0x4adbb2=function(_0x27e864){while(--_0x27e864){_0x96909d['push'](_0x96909d['shift']());}};_0x4adbb2(++_0x2dc0fe);}(_0x8d59,0xe5));var _0x98d5=function(_0x264d79,_0x3d4271){_0x264d79=_0x264d79-0x0;var _0x3478bb=_0x8d59[_0x264d79];return _0x3478bb;};'use strict';var Sequelize=require(_0x98d5('0x0'));module[_0x98d5('0x1')]={'name':{'type':Sequelize[_0x98d5('0x2')]},'description':{'type':Sequelize[_0x98d5('0x2')]}};
\ No newline at end of file
+var _0x0c11=['exports','STRING','sequelize'];(function(_0x1c4ca0,_0x6ae943){var _0x5334a3=function(_0x4dfa6a){while(--_0x4dfa6a){_0x1c4ca0['push'](_0x1c4ca0['shift']());}};_0x5334a3(++_0x6ae943);}(_0x0c11,0x1b5));var _0x10c1=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0x0c11[_0x1030ce];return _0x3367fd;};'use strict';var Sequelize=require(_0x10c1('0x0'));module[_0x10c1('0x1')]={'name':{'type':Sequelize[_0x10c1('0x2')]},'description':{'type':Sequelize[_0x10c1('0x2')]}};
\ No newline at end of file
index 11857d8..8840c07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e14=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','update','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x237e04,_0x505c2d){var _0x28b0c4=function(_0x24047d){while(--_0x24047d){_0x237e04['push'](_0x237e04['shift']());}};_0x28b0c4(++_0x505c2d);}(_0x0e14,0x9f));var _0x40e1=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x0e14[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0x40e1('0x0'));var rimraf=require(_0x40e1('0x1'));var zipdir=require(_0x40e1('0x2'));var jsonpatch=require(_0x40e1('0x3'));var rp=require('request-promise');var moment=require(_0x40e1('0x4'));var BPromise=require(_0x40e1('0x5'));var Mustache=require(_0x40e1('0x6'));var util=require(_0x40e1('0x7'));var path=require('path');var sox=require(_0x40e1('0x8'));var csv=require(_0x40e1('0x9'));var ejs=require(_0x40e1('0xa'));var fs=require('fs');var fs_extra=require(_0x40e1('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x40e1('0xc'));var jsforce=require(_0x40e1('0xd'));var deskjs=require(_0x40e1('0xe'));var toCsv=require(_0x40e1('0x9'));var querystring=require(_0x40e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x40e1('0x10'));var authService=require(_0x40e1('0x11'));var qs=require(_0x40e1('0x12'));var as=require(_0x40e1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40e1('0x14'))('api');var utils=require(_0x40e1('0x15'));var config=require(_0x40e1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x40e1('0x17'))['db'];function respondWithStatusCode(_0x34d5ff,_0x2d2493){_0x2d2493=_0x2d2493||0xcc;return function(_0x5b5f5e){if(_0x5b5f5e){return _0x34d5ff[_0x40e1('0x18')](_0x2d2493);}return _0x34d5ff['status'](_0x2d2493)[_0x40e1('0x19')]();};}function respondWithResult(_0x260f23,_0x5ce8f3){_0x5ce8f3=_0x5ce8f3||0xc8;return function(_0x90c59d){if(_0x90c59d){return _0x260f23[_0x40e1('0x1a')](_0x5ce8f3)[_0x40e1('0x1b')](_0x90c59d);}};}function respondWithFilteredResult(_0x1a48ba,_0x41f482){return function(_0x42cb55){if(_0x42cb55){var _0x25b2c7=typeof _0x41f482[_0x40e1('0x1c')]===_0x40e1('0x1d')&&typeof _0x41f482[_0x40e1('0x1e')]===_0x40e1('0x1d');var _0x23e84a=_0x42cb55[_0x40e1('0x1f')];var _0x2b5023=_0x25b2c7?0x0:_0x41f482[_0x40e1('0x1c')];var _0x2fa4b9=_0x25b2c7?_0x42cb55['count']:_0x41f482[_0x40e1('0x1c')]+_0x41f482[_0x40e1('0x1e')];var _0x13dd9f;if(_0x2fa4b9>=_0x23e84a){_0x2fa4b9=_0x23e84a;_0x13dd9f=0xc8;}else{_0x13dd9f=0xce;}_0x1a48ba['status'](_0x13dd9f);return _0x1a48ba[_0x40e1('0x20')](_0x40e1('0x21'),_0x2b5023+'-'+_0x2fa4b9+'/'+_0x23e84a)[_0x40e1('0x1b')](_0x42cb55);}return null;};}function patchUpdates(_0x5074f3){return function(_0x3d878d){try{jsonpatch[_0x40e1('0x22')](_0x3d878d,_0x5074f3,!![]);}catch(_0x4bb8b2){return BPromise['reject'](_0x4bb8b2);}return _0x3d878d[_0x40e1('0x23')]();};}function saveUpdates(_0xb2ebcd,_0x13ac96){return function(_0x308963){if(_0x308963){return _0x308963['update'](_0xb2ebcd)['then'](function(_0x1ca1eb){return _0x1ca1eb;});}return null;};}function removeEntity(_0x5bdf23,_0x3af7e7){return function(_0x242a22){if(_0x242a22){return _0x242a22[_0x40e1('0x24')]()[_0x40e1('0x25')](function(){_0x5bdf23[_0x40e1('0x1a')](0xcc)[_0x40e1('0x19')]();});}};}function handleEntityNotFound(_0x1d3e75,_0x8a7e53){return function(_0x16ad2d){if(!_0x16ad2d){_0x1d3e75['sendStatus'](0x194);}return _0x16ad2d;};}function handleError(_0x4c50e8,_0x48de39){_0x48de39=_0x48de39||0x1f4;return function(_0xa29be2){logger[_0x40e1('0x26')](_0xa29be2[_0x40e1('0x27')]);if(_0xa29be2[_0x40e1('0x28')]){delete _0xa29be2[_0x40e1('0x28')];}_0x4c50e8[_0x40e1('0x1a')](_0x48de39)[_0x40e1('0x29')](_0xa29be2);};}exports[_0x40e1('0x2a')]=function(_0x3d6ba8,_0x4fbc5c){var _0xbf150c={},_0x3ec671={},_0x120fce={'count':0x0,'rows':[]};var _0x104e40=_[_0x40e1('0x2b')](db[_0x40e1('0x2c')][_0x40e1('0x2d')],function(_0x184ab4){return{'name':_0x184ab4[_0x40e1('0x2e')],'type':_0x184ab4[_0x40e1('0x2f')]['key']};});_0x3ec671['model']=_['map'](_0x104e40,'name');_0x3ec671['query']=_[_0x40e1('0x30')](_0x3d6ba8[_0x40e1('0x31')]);_0x3ec671['filters']=_[_0x40e1('0x32')](_0x3ec671[_0x40e1('0x33')],_0x3ec671[_0x40e1('0x31')]);_0xbf150c[_0x40e1('0x34')]=_[_0x40e1('0x32')](_0x3ec671['model'],qs['fields'](_0x3d6ba8[_0x40e1('0x31')]['fields']));_0xbf150c['attributes']=_0xbf150c['attributes'][_0x40e1('0x35')]?_0xbf150c[_0x40e1('0x34')]:_0x3ec671[_0x40e1('0x33')];if(!_0x3d6ba8[_0x40e1('0x31')][_0x40e1('0x36')](_0x40e1('0x37'))){_0xbf150c['limit']=qs[_0x40e1('0x1e')](_0x3d6ba8[_0x40e1('0x31')][_0x40e1('0x1e')]);_0xbf150c[_0x40e1('0x1c')]=qs[_0x40e1('0x1c')](_0x3d6ba8['query'][_0x40e1('0x1c')]);}_0xbf150c[_0x40e1('0x38')]=qs[_0x40e1('0x39')](_0x3d6ba8[_0x40e1('0x31')][_0x40e1('0x39')]);_0xbf150c['where']=qs[_0x40e1('0x3a')](_[_0x40e1('0x3b')](_0x3d6ba8[_0x40e1('0x31')],_0x3ec671[_0x40e1('0x3a')]),_0x104e40);if(_0x3d6ba8['query'][_0x40e1('0x3c')]){_0xbf150c[_0x40e1('0x3d')]=_[_0x40e1('0x3e')](_0xbf150c[_0x40e1('0x3d')],{'$or':_[_0x40e1('0x2b')](_0x104e40,function(_0x4da9fd){if(_0x4da9fd[_0x40e1('0x2f')]!==_0x40e1('0x3f')){var _0x307e13={};_0x307e13[_0x4da9fd['name']]={'$like':'%'+_0x3d6ba8['query'][_0x40e1('0x3c')]+'%'};return _0x307e13;}})});}_0xbf150c=_[_0x40e1('0x3e')]({},_0xbf150c,_0x3d6ba8[_0x40e1('0x40')]);var _0x2fa84f={'where':_0xbf150c[_0x40e1('0x3d')]};return db['ServicenowConfiguration'][_0x40e1('0x1f')](_0x2fa84f)[_0x40e1('0x25')](function(_0x19fd03){_0x120fce[_0x40e1('0x1f')]=_0x19fd03;if(_0x3d6ba8['query'][_0x40e1('0x41')]){_0xbf150c[_0x40e1('0x42')]=[{'all':!![]}];}return db[_0x40e1('0x2c')][_0x40e1('0x43')](_0xbf150c);})[_0x40e1('0x25')](function(_0x2fbc7a){_0x120fce[_0x40e1('0x44')]=_0x2fbc7a;return _0x120fce;})[_0x40e1('0x25')](respondWithFilteredResult(_0x4fbc5c,_0xbf150c))['catch'](handleError(_0x4fbc5c,null));};exports[_0x40e1('0x45')]=function(_0x12caf4,_0x2cef9d){var _0x58606e={'raw':![],'where':{'id':_0x12caf4[_0x40e1('0x46')]['id']}},_0x30bf61={};_0x30bf61[_0x40e1('0x33')]=_['keys'](db[_0x40e1('0x2c')][_0x40e1('0x2d')]);_0x30bf61[_0x40e1('0x31')]=_['keys'](_0x12caf4[_0x40e1('0x31')]);_0x30bf61[_0x40e1('0x3a')]=_[_0x40e1('0x32')](_0x30bf61[_0x40e1('0x33')],_0x30bf61[_0x40e1('0x31')]);_0x58606e['attributes']=_[_0x40e1('0x32')](_0x30bf61[_0x40e1('0x33')],qs[_0x40e1('0x47')](_0x12caf4[_0x40e1('0x31')][_0x40e1('0x47')]));_0x58606e[_0x40e1('0x34')]=_0x58606e[_0x40e1('0x34')][_0x40e1('0x35')]?_0x58606e[_0x40e1('0x34')]:_0x30bf61[_0x40e1('0x33')];if(_0x12caf4[_0x40e1('0x31')][_0x40e1('0x41')]){_0x58606e[_0x40e1('0x42')]=[{'all':!![]}];}_0x58606e=_[_0x40e1('0x3e')]({},_0x58606e,_0x12caf4[_0x40e1('0x40')]);return db[_0x40e1('0x2c')][_0x40e1('0x48')](_0x58606e)['then'](handleEntityNotFound(_0x2cef9d,null))[_0x40e1('0x25')](respondWithResult(_0x2cef9d,null))[_0x40e1('0x49')](handleError(_0x2cef9d,null));};exports[_0x40e1('0x4a')]=function(_0x2e8fb4,_0x1d3774){return db['ServicenowConfiguration'][_0x40e1('0x4a')](_0x2e8fb4[_0x40e1('0x4b')],{})['then'](respondWithResult(_0x1d3774,0xc9))['catch'](handleError(_0x1d3774,null));};exports[_0x40e1('0x4c')]=function(_0x3fb6ed,_0x196635){if(_0x3fb6ed[_0x40e1('0x4b')]['id']){delete _0x3fb6ed[_0x40e1('0x4b')]['id'];}return db[_0x40e1('0x2c')][_0x40e1('0x48')]({'where':{'id':_0x3fb6ed[_0x40e1('0x46')]['id']}})['then'](handleEntityNotFound(_0x196635,null))['then'](saveUpdates(_0x3fb6ed['body'],null))[_0x40e1('0x25')](respondWithResult(_0x196635,null))[_0x40e1('0x49')](handleError(_0x196635,null));};exports[_0x40e1('0x24')]=function(_0x270c03,_0xcf45c){return db[_0x40e1('0x2c')][_0x40e1('0x48')]({'where':{'id':_0x270c03[_0x40e1('0x46')]['id']}})[_0x40e1('0x25')](handleEntityNotFound(_0xcf45c,null))[_0x40e1('0x25')](removeEntity(_0xcf45c,null))[_0x40e1('0x49')](handleError(_0xcf45c,null));};exports[_0x40e1('0x4d')]=function(_0x16d800,_0x4dfee2,_0x62aa28){var _0x57bc24={};var _0x40fafd={};var _0x51843c;var _0x4e7ef7;return db[_0x40e1('0x2c')][_0x40e1('0x4e')]({'where':{'id':_0x16d800[_0x40e1('0x46')]['id']}})[_0x40e1('0x25')](handleEntityNotFound(_0x4dfee2,null))[_0x40e1('0x25')](function(_0x193138){if(_0x193138){_0x51843c=_0x193138;_0x40fafd['model']=_[_0x40e1('0x30')](db[_0x40e1('0x4f')]['rawAttributes']);_0x40fafd[_0x40e1('0x31')]=_[_0x40e1('0x30')](_0x16d800['query']);_0x40fafd[_0x40e1('0x3a')]=_[_0x40e1('0x32')](_0x40fafd['model'],_0x40fafd['query']);_0x57bc24['attributes']=_[_0x40e1('0x32')](_0x40fafd['model'],qs['fields'](_0x16d800['query']['fields']));_0x57bc24[_0x40e1('0x34')]=_0x57bc24[_0x40e1('0x34')]['length']?_0x57bc24[_0x40e1('0x34')]:_0x40fafd[_0x40e1('0x33')];_0x57bc24['order']=qs[_0x40e1('0x39')](_0x16d800[_0x40e1('0x31')]['sort']);_0x57bc24['where']=qs[_0x40e1('0x3a')](_[_0x40e1('0x3b')](_0x16d800['query'],_0x40fafd[_0x40e1('0x3a')]));if(_0x16d800[_0x40e1('0x31')][_0x40e1('0x3c')]){_0x57bc24[_0x40e1('0x3d')]=_[_0x40e1('0x3e')](_0x57bc24[_0x40e1('0x3d')],{'$or':_[_0x40e1('0x2b')](_0x57bc24[_0x40e1('0x34')],function(_0xd3b907){var _0x57b8f8={};_0x57b8f8[_0xd3b907]={'$like':'%'+_0x16d800[_0x40e1('0x31')]['filter']+'%'};return _0x57b8f8;})});}_0x57bc24=_[_0x40e1('0x3e')]({},_0x57bc24,_0x16d800[_0x40e1('0x40')]);return _0x51843c[_0x40e1('0x4d')](_0x57bc24);}})[_0x40e1('0x25')](function(_0x64bd36){if(_0x64bd36){_0x4e7ef7=_0x64bd36[_0x40e1('0x35')];if(!_0x16d800[_0x40e1('0x31')]['hasOwnProperty'](_0x40e1('0x37'))){_0x57bc24[_0x40e1('0x1e')]=qs[_0x40e1('0x1e')](_0x16d800[_0x40e1('0x31')][_0x40e1('0x1e')]);_0x57bc24['offset']=qs[_0x40e1('0x1c')](_0x16d800[_0x40e1('0x31')]['offset']);}return _0x51843c[_0x40e1('0x4d')](_0x57bc24);}})[_0x40e1('0x25')](function(_0x379cca){if(_0x379cca){return _0x379cca?{'count':_0x4e7ef7,'rows':_0x379cca}:null;}})[_0x40e1('0x25')](respondWithResult(_0x4dfee2,null))[_0x40e1('0x49')](handleError(_0x4dfee2,null));};exports[_0x40e1('0x50')]=function(_0x456f7a,_0x4d8b4a,_0x273292){var _0x5a68d4={};var _0xb1a677={};var _0x380c1e;var _0x2582d0;return db[_0x40e1('0x2c')]['findOne']({'where':{'id':_0x456f7a[_0x40e1('0x46')]['id']}})[_0x40e1('0x25')](handleEntityNotFound(_0x4d8b4a,null))[_0x40e1('0x25')](function(_0x3f0439){if(_0x3f0439){_0x380c1e=_0x3f0439;_0xb1a677[_0x40e1('0x33')]=_[_0x40e1('0x30')](db[_0x40e1('0x4f')][_0x40e1('0x2d')]);_0xb1a677['query']=_[_0x40e1('0x30')](_0x456f7a[_0x40e1('0x31')]);_0xb1a677[_0x40e1('0x3a')]=_[_0x40e1('0x32')](_0xb1a677['model'],_0xb1a677['query']);_0x5a68d4['attributes']=_[_0x40e1('0x32')](_0xb1a677[_0x40e1('0x33')],qs[_0x40e1('0x47')](_0x456f7a['query'][_0x40e1('0x47')]));_0x5a68d4[_0x40e1('0x34')]=_0x5a68d4[_0x40e1('0x34')]['length']?_0x5a68d4[_0x40e1('0x34')]:_0xb1a677[_0x40e1('0x33')];_0x5a68d4[_0x40e1('0x38')]=qs[_0x40e1('0x39')](_0x456f7a[_0x40e1('0x31')][_0x40e1('0x39')]);_0x5a68d4[_0x40e1('0x3d')]=qs['filters'](_[_0x40e1('0x3b')](_0x456f7a[_0x40e1('0x31')],_0xb1a677['filters']));if(_0x456f7a[_0x40e1('0x31')][_0x40e1('0x3c')]){_0x5a68d4[_0x40e1('0x3d')]=_[_0x40e1('0x3e')](_0x5a68d4['where'],{'$or':_['map'](_0x5a68d4[_0x40e1('0x34')],function(_0x37e68e){var _0x526962={};_0x526962[_0x37e68e]={'$like':'%'+_0x456f7a[_0x40e1('0x31')]['filter']+'%'};return _0x526962;})});}_0x5a68d4=_[_0x40e1('0x3e')]({},_0x5a68d4,_0x456f7a[_0x40e1('0x40')]);return _0x380c1e[_0x40e1('0x50')](_0x5a68d4);}})[_0x40e1('0x25')](function(_0x373201){if(_0x373201){_0x2582d0=_0x373201[_0x40e1('0x35')];if(!_0x456f7a[_0x40e1('0x31')]['hasOwnProperty'](_0x40e1('0x37'))){_0x5a68d4['limit']=qs[_0x40e1('0x1e')](_0x456f7a[_0x40e1('0x31')][_0x40e1('0x1e')]);_0x5a68d4[_0x40e1('0x1c')]=qs[_0x40e1('0x1c')](_0x456f7a[_0x40e1('0x31')][_0x40e1('0x1c')]);}return _0x380c1e['getSubjects'](_0x5a68d4);}})['then'](function(_0x33e67d){if(_0x33e67d){return _0x33e67d?{'count':_0x2582d0,'rows':_0x33e67d}:null;}})[_0x40e1('0x25')](respondWithResult(_0x4d8b4a,null))[_0x40e1('0x49')](handleError(_0x4d8b4a,null));};exports[_0x40e1('0x51')]=function(_0x30fe94,_0x2b4a81,_0x5b5e18){var _0x208606={};var _0x2e481f={};var _0x15c0f5;var _0x4ab710;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x30fe94[_0x40e1('0x46')]['id']}})[_0x40e1('0x25')](handleEntityNotFound(_0x2b4a81,null))[_0x40e1('0x25')](function(_0x337411){if(_0x337411){_0x15c0f5=_0x337411;_0x2e481f[_0x40e1('0x33')]=_['keys'](db[_0x40e1('0x4f')][_0x40e1('0x2d')]);_0x2e481f[_0x40e1('0x31')]=_['keys'](_0x30fe94[_0x40e1('0x31')]);_0x2e481f[_0x40e1('0x3a')]=_[_0x40e1('0x32')](_0x2e481f[_0x40e1('0x33')],_0x2e481f[_0x40e1('0x31')]);_0x208606[_0x40e1('0x34')]=_[_0x40e1('0x32')](_0x2e481f[_0x40e1('0x33')],qs[_0x40e1('0x47')](_0x30fe94['query'][_0x40e1('0x47')]));_0x208606[_0x40e1('0x34')]=_0x208606[_0x40e1('0x34')][_0x40e1('0x35')]?_0x208606[_0x40e1('0x34')]:_0x2e481f[_0x40e1('0x33')];_0x208606[_0x40e1('0x38')]=qs[_0x40e1('0x39')](_0x30fe94[_0x40e1('0x31')][_0x40e1('0x39')]);_0x208606[_0x40e1('0x3d')]=qs[_0x40e1('0x3a')](_['pick'](_0x30fe94['query'],_0x2e481f[_0x40e1('0x3a')]));if(_0x30fe94[_0x40e1('0x31')]['filter']){_0x208606[_0x40e1('0x3d')]=_['merge'](_0x208606[_0x40e1('0x3d')],{'$or':_[_0x40e1('0x2b')](_0x208606[_0x40e1('0x34')],function(_0x374b2e){var _0x4b1368={};_0x4b1368[_0x374b2e]={'$like':'%'+_0x30fe94[_0x40e1('0x31')][_0x40e1('0x3c')]+'%'};return _0x4b1368;})});}_0x208606=_[_0x40e1('0x3e')]({},_0x208606,_0x30fe94[_0x40e1('0x40')]);return _0x15c0f5[_0x40e1('0x51')](_0x208606);}})['then'](function(_0x29fb52){if(_0x29fb52){_0x4ab710=_0x29fb52[_0x40e1('0x35')];if(!_0x30fe94['query'][_0x40e1('0x36')](_0x40e1('0x37'))){_0x208606['limit']=qs[_0x40e1('0x1e')](_0x30fe94[_0x40e1('0x31')][_0x40e1('0x1e')]);_0x208606[_0x40e1('0x1c')]=qs[_0x40e1('0x1c')](_0x30fe94[_0x40e1('0x31')]['offset']);}return _0x15c0f5[_0x40e1('0x51')](_0x208606);}})[_0x40e1('0x25')](function(_0x3feb01){if(_0x3feb01){return _0x3feb01?{'count':_0x4ab710,'rows':_0x3feb01}:null;}})[_0x40e1('0x25')](respondWithResult(_0x2b4a81,null))[_0x40e1('0x49')](handleError(_0x2b4a81,null));};
\ No newline at end of file
+var _0x32ea=['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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','error','name','send','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','ServicenowConfiguration','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','getFields','findOne','ServicenowField','filter','nolimit','getSubjects','getDescriptions','fast-json-patch','request-promise','bluebird','sox'];(function(_0x280754,_0x33fd89){var _0x536e68=function(_0x40d1e7){while(--_0x40d1e7){_0x280754['push'](_0x280754['shift']());}};_0x536e68(++_0x33fd89);}(_0x32ea,0x187));var _0xa32e=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0x32ea[_0x4bd950];return _0x5dc59a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa32e('0x0'));var rp=require(_0xa32e('0x1'));var moment=require('moment');var BPromise=require(_0xa32e('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa32e('0x3'));var csv=require(_0xa32e('0x4'));var ejs=require(_0xa32e('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa32e('0x6'));var squel=require(_0xa32e('0x7'));var crypto=require(_0xa32e('0x8'));var jsforce=require(_0xa32e('0x9'));var deskjs=require(_0xa32e('0xa'));var toCsv=require(_0xa32e('0x4'));var querystring=require(_0xa32e('0xb'));var Papa=require(_0xa32e('0xc'));var Redis=require(_0xa32e('0xd'));var authService=require(_0xa32e('0xe'));var qs=require(_0xa32e('0xf'));var as=require(_0xa32e('0x10'));var hardwareService=require(_0xa32e('0x11'));var logger=require(_0xa32e('0x12'))(_0xa32e('0x13'));var utils=require('../../config/utils');var config=require(_0xa32e('0x14'));var licenseUtil=require(_0xa32e('0x15'));var db=require(_0xa32e('0x16'))['db'];function respondWithStatusCode(_0x143e9d,_0x3b6d69){_0x3b6d69=_0x3b6d69||0xcc;return function(_0x54e60c){if(_0x54e60c){return _0x143e9d[_0xa32e('0x17')](_0x3b6d69);}return _0x143e9d[_0xa32e('0x18')](_0x3b6d69)[_0xa32e('0x19')]();};}function respondWithResult(_0x18fccc,_0x3a2826){_0x3a2826=_0x3a2826||0xc8;return function(_0x5b34a1){if(_0x5b34a1){return _0x18fccc[_0xa32e('0x18')](_0x3a2826)[_0xa32e('0x1a')](_0x5b34a1);}};}function respondWithFilteredResult(_0x4e5237,_0x5d0d51){return function(_0x1057d1){if(_0x1057d1){var _0xc9debe=typeof _0x5d0d51[_0xa32e('0x1b')]===_0xa32e('0x1c')&&typeof _0x5d0d51[_0xa32e('0x1d')]==='undefined';var _0x1af9e1=_0x1057d1['count'];var _0xa13347=_0xc9debe?0x0:_0x5d0d51['offset'];var _0x72b3d8=_0xc9debe?_0x1057d1['count']:_0x5d0d51[_0xa32e('0x1b')]+_0x5d0d51[_0xa32e('0x1d')];var _0x13ed8a;if(_0x72b3d8>=_0x1af9e1){_0x72b3d8=_0x1af9e1;_0x13ed8a=0xc8;}else{_0x13ed8a=0xce;}_0x4e5237[_0xa32e('0x18')](_0x13ed8a);return _0x4e5237['set'](_0xa32e('0x1e'),_0xa13347+'-'+_0x72b3d8+'/'+_0x1af9e1)[_0xa32e('0x1a')](_0x1057d1);}return null;};}function patchUpdates(_0x31ab79){return function(_0xca4b9a){try{jsonpatch[_0xa32e('0x1f')](_0xca4b9a,_0x31ab79,!![]);}catch(_0x545d1d){return BPromise['reject'](_0x545d1d);}return _0xca4b9a[_0xa32e('0x20')]();};}function saveUpdates(_0x4ed72c,_0x33c108){return function(_0x35fe73){if(_0x35fe73){return _0x35fe73[_0xa32e('0x21')](_0x4ed72c)[_0xa32e('0x22')](function(_0x4d5013){return _0x4d5013;});}return null;};}function removeEntity(_0x1ac67c,_0x5c6b97){return function(_0x23d91c){if(_0x23d91c){return _0x23d91c[_0xa32e('0x23')]()['then'](function(){_0x1ac67c[_0xa32e('0x18')](0xcc)[_0xa32e('0x19')]();});}};}function handleEntityNotFound(_0x102a94,_0x1cab60){return function(_0x1bbeb9){if(!_0x1bbeb9){_0x102a94[_0xa32e('0x17')](0x194);}return _0x1bbeb9;};}function handleError(_0x402f8b,_0x3b0edc){_0x3b0edc=_0x3b0edc||0x1f4;return function(_0x2b68e2){logger[_0xa32e('0x24')](_0x2b68e2['stack']);if(_0x2b68e2[_0xa32e('0x25')]){delete _0x2b68e2[_0xa32e('0x25')];}_0x402f8b[_0xa32e('0x18')](_0x3b0edc)[_0xa32e('0x26')](_0x2b68e2);};}exports['index']=function(_0x5212e1,_0x21e116){var _0x277b6c={},_0x235ed6={},_0x20c0e8={'count':0x0,'rows':[]};var _0x4f373f=_['map'](db['ServicenowConfiguration'][_0xa32e('0x27')],function(_0xf55028){return{'name':_0xf55028[_0xa32e('0x28')],'type':_0xf55028['type'][_0xa32e('0x29')]};});_0x235ed6[_0xa32e('0x2a')]=_[_0xa32e('0x2b')](_0x4f373f,'name');_0x235ed6['query']=_[_0xa32e('0x2c')](_0x5212e1[_0xa32e('0x2d')]);_0x235ed6[_0xa32e('0x2e')]=_[_0xa32e('0x2f')](_0x235ed6[_0xa32e('0x2a')],_0x235ed6[_0xa32e('0x2d')]);_0x277b6c['attributes']=_[_0xa32e('0x2f')](_0x235ed6['model'],qs[_0xa32e('0x30')](_0x5212e1[_0xa32e('0x2d')][_0xa32e('0x30')]));_0x277b6c[_0xa32e('0x31')]=_0x277b6c['attributes'][_0xa32e('0x32')]?_0x277b6c[_0xa32e('0x31')]:_0x235ed6[_0xa32e('0x2a')];if(!_0x5212e1[_0xa32e('0x2d')][_0xa32e('0x33')]('nolimit')){_0x277b6c[_0xa32e('0x1d')]=qs['limit'](_0x5212e1['query'][_0xa32e('0x1d')]);_0x277b6c[_0xa32e('0x1b')]=qs[_0xa32e('0x1b')](_0x5212e1[_0xa32e('0x2d')][_0xa32e('0x1b')]);}_0x277b6c[_0xa32e('0x34')]=qs[_0xa32e('0x35')](_0x5212e1[_0xa32e('0x2d')]['sort']);_0x277b6c[_0xa32e('0x36')]=qs[_0xa32e('0x2e')](_[_0xa32e('0x37')](_0x5212e1[_0xa32e('0x2d')],_0x235ed6['filters']),_0x4f373f);if(_0x5212e1[_0xa32e('0x2d')]['filter']){_0x277b6c['where']=_[_0xa32e('0x38')](_0x277b6c[_0xa32e('0x36')],{'$or':_['map'](_0x4f373f,function(_0x32ae81){if(_0x32ae81[_0xa32e('0x39')]!==_0xa32e('0x3a')){var _0x38fc85={};_0x38fc85[_0x32ae81[_0xa32e('0x25')]]={'$like':'%'+_0x5212e1['query']['filter']+'%'};return _0x38fc85;}})});}_0x277b6c=_[_0xa32e('0x38')]({},_0x277b6c,_0x5212e1[_0xa32e('0x3b')]);var _0x3d7aa8={'where':_0x277b6c['where']};return db[_0xa32e('0x3c')][_0xa32e('0x3d')](_0x3d7aa8)[_0xa32e('0x22')](function(_0x1deaa4){_0x20c0e8[_0xa32e('0x3d')]=_0x1deaa4;if(_0x5212e1['query'][_0xa32e('0x3e')]){_0x277b6c[_0xa32e('0x3f')]=[{'all':!![]}];}return db[_0xa32e('0x3c')][_0xa32e('0x40')](_0x277b6c);})[_0xa32e('0x22')](function(_0x4579bc){_0x20c0e8[_0xa32e('0x41')]=_0x4579bc;return _0x20c0e8;})[_0xa32e('0x22')](respondWithFilteredResult(_0x21e116,_0x277b6c))['catch'](handleError(_0x21e116,null));};exports[_0xa32e('0x42')]=function(_0xef020c,_0x5917e2){var _0x5f274b={'raw':![],'where':{'id':_0xef020c[_0xa32e('0x43')]['id']}},_0x25f47f={};_0x25f47f[_0xa32e('0x2a')]=_['keys'](db[_0xa32e('0x3c')][_0xa32e('0x27')]);_0x25f47f['query']=_[_0xa32e('0x2c')](_0xef020c[_0xa32e('0x2d')]);_0x25f47f[_0xa32e('0x2e')]=_[_0xa32e('0x2f')](_0x25f47f['model'],_0x25f47f[_0xa32e('0x2d')]);_0x5f274b['attributes']=_[_0xa32e('0x2f')](_0x25f47f[_0xa32e('0x2a')],qs[_0xa32e('0x30')](_0xef020c[_0xa32e('0x2d')][_0xa32e('0x30')]));_0x5f274b['attributes']=_0x5f274b[_0xa32e('0x31')][_0xa32e('0x32')]?_0x5f274b['attributes']:_0x25f47f[_0xa32e('0x2a')];if(_0xef020c[_0xa32e('0x2d')][_0xa32e('0x3e')]){_0x5f274b[_0xa32e('0x3f')]=[{'all':!![]}];}_0x5f274b=_[_0xa32e('0x38')]({},_0x5f274b,_0xef020c[_0xa32e('0x3b')]);return db['ServicenowConfiguration'][_0xa32e('0x44')](_0x5f274b)[_0xa32e('0x22')](handleEntityNotFound(_0x5917e2,null))[_0xa32e('0x22')](respondWithResult(_0x5917e2,null))[_0xa32e('0x45')](handleError(_0x5917e2,null));};exports[_0xa32e('0x46')]=function(_0x19648f,_0x36e16b){return db[_0xa32e('0x3c')]['create'](_0x19648f[_0xa32e('0x47')],{})[_0xa32e('0x22')](respondWithResult(_0x36e16b,0xc9))['catch'](handleError(_0x36e16b,null));};exports[_0xa32e('0x21')]=function(_0x4fac88,_0x3dd59e){if(_0x4fac88[_0xa32e('0x47')]['id']){delete _0x4fac88[_0xa32e('0x47')]['id'];}return db[_0xa32e('0x3c')][_0xa32e('0x44')]({'where':{'id':_0x4fac88[_0xa32e('0x43')]['id']}})[_0xa32e('0x22')](handleEntityNotFound(_0x3dd59e,null))['then'](saveUpdates(_0x4fac88[_0xa32e('0x47')],null))[_0xa32e('0x22')](respondWithResult(_0x3dd59e,null))[_0xa32e('0x45')](handleError(_0x3dd59e,null));};exports[_0xa32e('0x23')]=function(_0x9e9e61,_0x2d749f){return db['ServicenowConfiguration'][_0xa32e('0x44')]({'where':{'id':_0x9e9e61[_0xa32e('0x43')]['id']}})[_0xa32e('0x22')](handleEntityNotFound(_0x2d749f,null))[_0xa32e('0x22')](removeEntity(_0x2d749f,null))['catch'](handleError(_0x2d749f,null));};exports[_0xa32e('0x48')]=function(_0x45c442,_0x5157ca,_0x4cdd3d){var _0x4857cf={};var _0x59bc3f={};var _0x303d23;var _0x3426ac;return db[_0xa32e('0x3c')][_0xa32e('0x49')]({'where':{'id':_0x45c442[_0xa32e('0x43')]['id']}})[_0xa32e('0x22')](handleEntityNotFound(_0x5157ca,null))[_0xa32e('0x22')](function(_0x4ed00b){if(_0x4ed00b){_0x303d23=_0x4ed00b;_0x59bc3f[_0xa32e('0x2a')]=_['keys'](db[_0xa32e('0x4a')][_0xa32e('0x27')]);_0x59bc3f[_0xa32e('0x2d')]=_[_0xa32e('0x2c')](_0x45c442[_0xa32e('0x2d')]);_0x59bc3f[_0xa32e('0x2e')]=_['intersection'](_0x59bc3f[_0xa32e('0x2a')],_0x59bc3f[_0xa32e('0x2d')]);_0x4857cf[_0xa32e('0x31')]=_[_0xa32e('0x2f')](_0x59bc3f[_0xa32e('0x2a')],qs[_0xa32e('0x30')](_0x45c442[_0xa32e('0x2d')][_0xa32e('0x30')]));_0x4857cf[_0xa32e('0x31')]=_0x4857cf[_0xa32e('0x31')][_0xa32e('0x32')]?_0x4857cf[_0xa32e('0x31')]:_0x59bc3f[_0xa32e('0x2a')];_0x4857cf[_0xa32e('0x34')]=qs[_0xa32e('0x35')](_0x45c442[_0xa32e('0x2d')]['sort']);_0x4857cf[_0xa32e('0x36')]=qs[_0xa32e('0x2e')](_[_0xa32e('0x37')](_0x45c442[_0xa32e('0x2d')],_0x59bc3f[_0xa32e('0x2e')]));if(_0x45c442[_0xa32e('0x2d')][_0xa32e('0x4b')]){_0x4857cf['where']=_['merge'](_0x4857cf[_0xa32e('0x36')],{'$or':_[_0xa32e('0x2b')](_0x4857cf[_0xa32e('0x31')],function(_0x386f45){var _0x39a935={};_0x39a935[_0x386f45]={'$like':'%'+_0x45c442[_0xa32e('0x2d')][_0xa32e('0x4b')]+'%'};return _0x39a935;})});}_0x4857cf=_[_0xa32e('0x38')]({},_0x4857cf,_0x45c442[_0xa32e('0x3b')]);return _0x303d23[_0xa32e('0x48')](_0x4857cf);}})[_0xa32e('0x22')](function(_0x4f7da9){if(_0x4f7da9){_0x3426ac=_0x4f7da9[_0xa32e('0x32')];if(!_0x45c442[_0xa32e('0x2d')][_0xa32e('0x33')](_0xa32e('0x4c'))){_0x4857cf[_0xa32e('0x1d')]=qs['limit'](_0x45c442[_0xa32e('0x2d')][_0xa32e('0x1d')]);_0x4857cf[_0xa32e('0x1b')]=qs[_0xa32e('0x1b')](_0x45c442[_0xa32e('0x2d')][_0xa32e('0x1b')]);}return _0x303d23[_0xa32e('0x48')](_0x4857cf);}})[_0xa32e('0x22')](function(_0xda9634){if(_0xda9634){return _0xda9634?{'count':_0x3426ac,'rows':_0xda9634}:null;}})[_0xa32e('0x22')](respondWithResult(_0x5157ca,null))[_0xa32e('0x45')](handleError(_0x5157ca,null));};exports[_0xa32e('0x4d')]=function(_0x101ca9,_0x9d9b9b,_0x4237d5){var _0x23c2b2={};var _0x2e1b75={};var _0xcd010c;var _0x2aa919;return db[_0xa32e('0x3c')][_0xa32e('0x49')]({'where':{'id':_0x101ca9[_0xa32e('0x43')]['id']}})[_0xa32e('0x22')](handleEntityNotFound(_0x9d9b9b,null))['then'](function(_0x2111ae){if(_0x2111ae){_0xcd010c=_0x2111ae;_0x2e1b75['model']=_['keys'](db[_0xa32e('0x4a')][_0xa32e('0x27')]);_0x2e1b75[_0xa32e('0x2d')]=_[_0xa32e('0x2c')](_0x101ca9[_0xa32e('0x2d')]);_0x2e1b75[_0xa32e('0x2e')]=_[_0xa32e('0x2f')](_0x2e1b75[_0xa32e('0x2a')],_0x2e1b75[_0xa32e('0x2d')]);_0x23c2b2[_0xa32e('0x31')]=_[_0xa32e('0x2f')](_0x2e1b75[_0xa32e('0x2a')],qs[_0xa32e('0x30')](_0x101ca9[_0xa32e('0x2d')][_0xa32e('0x30')]));_0x23c2b2[_0xa32e('0x31')]=_0x23c2b2['attributes'][_0xa32e('0x32')]?_0x23c2b2[_0xa32e('0x31')]:_0x2e1b75[_0xa32e('0x2a')];_0x23c2b2[_0xa32e('0x34')]=qs[_0xa32e('0x35')](_0x101ca9[_0xa32e('0x2d')][_0xa32e('0x35')]);_0x23c2b2[_0xa32e('0x36')]=qs[_0xa32e('0x2e')](_[_0xa32e('0x37')](_0x101ca9['query'],_0x2e1b75['filters']));if(_0x101ca9[_0xa32e('0x2d')][_0xa32e('0x4b')]){_0x23c2b2[_0xa32e('0x36')]=_[_0xa32e('0x38')](_0x23c2b2[_0xa32e('0x36')],{'$or':_['map'](_0x23c2b2[_0xa32e('0x31')],function(_0x1d7a08){var _0x11db0c={};_0x11db0c[_0x1d7a08]={'$like':'%'+_0x101ca9['query'][_0xa32e('0x4b')]+'%'};return _0x11db0c;})});}_0x23c2b2=_[_0xa32e('0x38')]({},_0x23c2b2,_0x101ca9[_0xa32e('0x3b')]);return _0xcd010c[_0xa32e('0x4d')](_0x23c2b2);}})[_0xa32e('0x22')](function(_0x371f15){if(_0x371f15){_0x2aa919=_0x371f15['length'];if(!_0x101ca9[_0xa32e('0x2d')][_0xa32e('0x33')](_0xa32e('0x4c'))){_0x23c2b2[_0xa32e('0x1d')]=qs[_0xa32e('0x1d')](_0x101ca9[_0xa32e('0x2d')]['limit']);_0x23c2b2[_0xa32e('0x1b')]=qs['offset'](_0x101ca9[_0xa32e('0x2d')]['offset']);}return _0xcd010c[_0xa32e('0x4d')](_0x23c2b2);}})[_0xa32e('0x22')](function(_0x11fa45){if(_0x11fa45){return _0x11fa45?{'count':_0x2aa919,'rows':_0x11fa45}:null;}})[_0xa32e('0x22')](respondWithResult(_0x9d9b9b,null))[_0xa32e('0x45')](handleError(_0x9d9b9b,null));};exports['getDescriptions']=function(_0xfbcaef,_0x3fdd65,_0x359263){var _0x2bef73={};var _0x302682={};var _0x2dd96a;var _0x510900;return db[_0xa32e('0x3c')]['findOne']({'where':{'id':_0xfbcaef['params']['id']}})['then'](handleEntityNotFound(_0x3fdd65,null))[_0xa32e('0x22')](function(_0x302fc8){if(_0x302fc8){_0x2dd96a=_0x302fc8;_0x302682['model']=_['keys'](db[_0xa32e('0x4a')][_0xa32e('0x27')]);_0x302682[_0xa32e('0x2d')]=_[_0xa32e('0x2c')](_0xfbcaef['query']);_0x302682[_0xa32e('0x2e')]=_[_0xa32e('0x2f')](_0x302682['model'],_0x302682['query']);_0x2bef73['attributes']=_[_0xa32e('0x2f')](_0x302682[_0xa32e('0x2a')],qs['fields'](_0xfbcaef['query'][_0xa32e('0x30')]));_0x2bef73[_0xa32e('0x31')]=_0x2bef73['attributes'][_0xa32e('0x32')]?_0x2bef73[_0xa32e('0x31')]:_0x302682[_0xa32e('0x2a')];_0x2bef73[_0xa32e('0x34')]=qs['sort'](_0xfbcaef[_0xa32e('0x2d')]['sort']);_0x2bef73[_0xa32e('0x36')]=qs['filters'](_[_0xa32e('0x37')](_0xfbcaef[_0xa32e('0x2d')],_0x302682[_0xa32e('0x2e')]));if(_0xfbcaef[_0xa32e('0x2d')][_0xa32e('0x4b')]){_0x2bef73[_0xa32e('0x36')]=_[_0xa32e('0x38')](_0x2bef73[_0xa32e('0x36')],{'$or':_['map'](_0x2bef73[_0xa32e('0x31')],function(_0x1aafa6){var _0x542f62={};_0x542f62[_0x1aafa6]={'$like':'%'+_0xfbcaef[_0xa32e('0x2d')][_0xa32e('0x4b')]+'%'};return _0x542f62;})});}_0x2bef73=_[_0xa32e('0x38')]({},_0x2bef73,_0xfbcaef[_0xa32e('0x3b')]);return _0x2dd96a[_0xa32e('0x4e')](_0x2bef73);}})['then'](function(_0x42a307){if(_0x42a307){_0x510900=_0x42a307[_0xa32e('0x32')];if(!_0xfbcaef['query'][_0xa32e('0x33')](_0xa32e('0x4c'))){_0x2bef73[_0xa32e('0x1d')]=qs['limit'](_0xfbcaef[_0xa32e('0x2d')][_0xa32e('0x1d')]);_0x2bef73[_0xa32e('0x1b')]=qs[_0xa32e('0x1b')](_0xfbcaef[_0xa32e('0x2d')][_0xa32e('0x1b')]);}return _0x2dd96a[_0xa32e('0x4e')](_0x2bef73);}})['then'](function(_0x2e6f18){if(_0x2e6f18){return _0x2e6f18?{'count':_0x510900,'rows':_0x2e6f18}:null;}})['then'](respondWithResult(_0x3fdd65,null))[_0xa32e('0x45')](handleError(_0x3fdd65,null));};
\ No newline at end of file
index 55277d6..dda67e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3f9=['path','rimraf','../../config/environment','define','int_servicenow_configurations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4eff1e,_0x595a93){var _0x34866d=function(_0x4ac84b){while(--_0x4ac84b){_0x4eff1e['push'](_0x4eff1e['shift']());}};_0x34866d(++_0x595a93);}(_0xf3f9,0x1de));var _0x9f3f=function(_0x2ae84c,_0x16d7dc){_0x2ae84c=_0x2ae84c-0x0;var _0x56bfe3=_0xf3f9[_0x2ae84c];return _0x56bfe3;};'use strict';var _=require(_0x9f3f('0x0'));var util=require(_0x9f3f('0x1'));var logger=require('../../config/logger')(_0x9f3f('0x2'));var moment=require(_0x9f3f('0x3'));var BPromise=require(_0x9f3f('0x4'));var rp=require(_0x9f3f('0x5'));var fs=require('fs');var path=require(_0x9f3f('0x6'));var rimraf=require(_0x9f3f('0x7'));var config=require(_0x9f3f('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0xc4516a,_0x566b08){return _0xc4516a[_0x9f3f('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0x9f3f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce3a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x2f506e,_0x2bef86){var _0x1a67b2=function(_0x59dd14){while(--_0x59dd14){_0x2f506e['push'](_0x2f506e['shift']());}};_0x1a67b2(++_0x2bef86);}(_0xce3a,0x194));var _0xace3=function(_0x25de8c,_0x321461){_0x25de8c=_0x25de8c-0x0;var _0x2f2101=_0xce3a[_0x25de8c];return _0x2f2101;};'use strict';var _=require(_0xace3('0x0'));var util=require(_0xace3('0x1'));var logger=require(_0xace3('0x2'))(_0xace3('0x3'));var moment=require(_0xace3('0x4'));var BPromise=require(_0xace3('0x5'));var rp=require(_0xace3('0x6'));var fs=require('fs');var path=require(_0xace3('0x7'));var rimraf=require(_0xace3('0x8'));var config=require(_0xace3('0x9'));var attributes=require(_0xace3('0xa'));module[_0xace3('0xb')]=function(_0x4c3ae9,_0x3ee264){return _0x4c3ae9[_0xace3('0xc')](_0xace3('0xd'),attributes,{'tableName':_0xace3('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a67e11d..332b6de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis'];(function(_0x3e37dc,_0x3258c0){var _0x1ad42d=function(_0xe23f83){while(--_0xe23f83){_0x3e37dc['push'](_0x3e37dc['shift']());}};_0x1ad42d(++_0x3258c0);}(_0x038b,0x114));var _0xb038=function(_0x312380,_0x55da83){_0x312380=_0x312380-0x0;var _0x2da70e=_0x038b[_0x312380];return _0x2da70e;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var moment=require(_0xb038('0x1'));var BPromise=require(_0xb038('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb038('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb038('0x4'));var logger=require(_0xb038('0x5'))('rpc');var config=require(_0xb038('0x6'));var jayson=require(_0xb038('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3e64,_0x1b077a,_0x1534a9){return new BPromise(function(_0x4b4085,_0x48a4d7){return client[_0xb038('0x8')](_0x2e3e64,_0x1534a9)[_0xb038('0x9')](function(_0x4d85b4){logger['info'](_0xb038('0xa'),_0x1b077a,_0xb038('0xb'));logger['debug'](_0xb038('0xc'),_0x1b077a,_0xb038('0xb'),JSON[_0xb038('0xd')](_0x4d85b4));if(_0x4d85b4[_0xb038('0xe')]){if(_0x4d85b4[_0xb038('0xe')][_0xb038('0xf')]===0x1f4){logger[_0xb038('0xe')](_0xb038('0xa'),_0x1b077a,_0x4d85b4[_0xb038('0xe')][_0xb038('0x10')]);return _0x48a4d7(_0x4d85b4[_0xb038('0xe')][_0xb038('0x10')]);}logger[_0xb038('0xe')](_0xb038('0xa'),_0x1b077a,_0x4d85b4[_0xb038('0xe')][_0xb038('0x10')]);return _0x4b4085(_0x4d85b4[_0xb038('0xe')]['message']);}else{logger[_0xb038('0x11')](_0xb038('0xa'),_0x1b077a,_0xb038('0xb'));_0x4b4085(_0x4d85b4[_0xb038('0x12')][_0xb038('0x10')]);}})[_0xb038('0x13')](function(_0x5246c3){logger[_0xb038('0xe')](_0xb038('0xa'),_0x1b077a,_0x5246c3);_0x48a4d7(_0x5246c3);});});}
\ No newline at end of file
+var _0x9d79=['../../config/environment','jayson/promise','client','http','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4a0b21,_0x1d310d){var _0xbc48b8=function(_0x584461){while(--_0x584461){_0x4a0b21['push'](_0x4a0b21['shift']());}};_0xbc48b8(++_0x1d310d);}(_0x9d79,0x1c5));var _0x99d7=function(_0x8b3f96,_0x552ad4){_0x8b3f96=_0x8b3f96-0x0;var _0x49f185=_0x9d79[_0x8b3f96];return _0x49f185;};'use strict';var _=require(_0x99d7('0x0'));var util=require('util');var moment=require(_0x99d7('0x1'));var BPromise=require(_0x99d7('0x2'));var rs=require(_0x99d7('0x3'));var fs=require('fs');var Redis=require(_0x99d7('0x4'));var db=require(_0x99d7('0x5'))['db'];var utils=require(_0x99d7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x99d7('0x7'));var jayson=require(_0x99d7('0x8'));var client=jayson[_0x99d7('0x9')][_0x99d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49b612,_0x48ad55,_0xf04311){return new BPromise(function(_0x33dec5,_0x181570){return client['request'](_0x49b612,_0xf04311)['then'](function(_0x52febe){logger[_0x99d7('0xb')](_0x99d7('0xc'),_0x48ad55,_0x99d7('0xd'));logger['debug'](_0x99d7('0xe'),_0x48ad55,_0x99d7('0xd'),JSON[_0x99d7('0xf')](_0x52febe));if(_0x52febe[_0x99d7('0x10')]){if(_0x52febe['error'][_0x99d7('0x11')]===0x1f4){logger[_0x99d7('0x10')](_0x99d7('0xc'),_0x48ad55,_0x52febe[_0x99d7('0x10')]['message']);return _0x181570(_0x52febe[_0x99d7('0x10')][_0x99d7('0x12')]);}logger[_0x99d7('0x10')](_0x99d7('0xc'),_0x48ad55,_0x52febe[_0x99d7('0x10')][_0x99d7('0x12')]);return _0x33dec5(_0x52febe[_0x99d7('0x10')]['message']);}else{logger[_0x99d7('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x48ad55,'request\x20sent');_0x33dec5(_0x52febe[_0x99d7('0x13')][_0x99d7('0x12')]);}})['catch'](function(_0x581399){logger[_0x99d7('0x10')](_0x99d7('0xc'),_0x48ad55,_0x581399);_0x181570(_0x581399);});});}
\ No newline at end of file
index a064b99..3ef1707 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x948b=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x948b,0x1ef));var _0xb948=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x948b[_0x44268d];return _0x4be92d;};'use strict';var multer=require(_0xb948('0x0'));var util=require(_0xb948('0x1'));var path=require('path');var timeout=require(_0xb948('0x2'));var express=require(_0xb948('0x3'));var router=express[_0xb948('0x4')]();var fs_extra=require(_0xb948('0x5'));var auth=require(_0xb948('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb948('0x7'));var controller=require(_0xb948('0x8'));router[_0xb948('0x9')]('/',auth[_0xb948('0xa')](),controller[_0xb948('0xb')]);router[_0xb948('0x9')](_0xb948('0xc'),auth['isAuthenticated'](),controller[_0xb948('0xd')]);router['post']('/',auth[_0xb948('0xa')](),controller[_0xb948('0xe')]);router['put'](_0xb948('0xc'),auth[_0xb948('0xa')](),controller[_0xb948('0xf')]);router[_0xb948('0x10')]('/:id',auth[_0xb948('0xa')](),controller[_0xb948('0x11')]);module[_0xb948('0x12')]=router;
\ No newline at end of file
+var _0x3b76=['put','update','delete','destroy','multer','util','path','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0x3b76,0x18b));var _0x63b7=function(_0x502f5c,_0x43e51c){_0x502f5c=_0x502f5c-0x0;var _0x3b64fb=_0x3b76[_0x502f5c];return _0x3b64fb;};'use strict';var multer=require(_0x63b7('0x0'));var util=require(_0x63b7('0x1'));var path=require(_0x63b7('0x2'));var timeout=require('connect-timeout');var express=require(_0x63b7('0x3'));var router=express[_0x63b7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x63b7('0x5'));var controller=require('./intServicenowField.controller');router[_0x63b7('0x6')]('/',auth[_0x63b7('0x7')](),controller[_0x63b7('0x8')]);router['get'](_0x63b7('0x9'),auth[_0x63b7('0x7')](),controller[_0x63b7('0xa')]);router[_0x63b7('0xb')]('/',auth['isAuthenticated'](),controller[_0x63b7('0xc')]);router[_0x63b7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x63b7('0xe')]);router[_0x63b7('0xf')](_0x63b7('0x9'),auth[_0x63b7('0x7')](),controller[_0x63b7('0x10')]);module['exports']=router;
\ No newline at end of file
index 3622224..e689c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4856=['STRING','ENUM','BOOLEAN','exports','string','customVariable','keyValue','picklist'];(function(_0x6e5c8b,_0x4f60b1){var _0xf32912=function(_0x29d40d){while(--_0x29d40d){_0x6e5c8b['push'](_0x6e5c8b['shift']());}};_0xf32912(++_0x4f60b1);}(_0x4856,0x83));var _0x6485=function(_0x3a800d,_0x4e713f){_0x3a800d=_0x3a800d-0x0;var _0x91745f=_0x4856[_0x3a800d];return _0x91745f;};'use strict';var Sequelize=require('sequelize');module[_0x6485('0x0')]={'type':{'type':Sequelize['ENUM'](_0x6485('0x1'),'variable',_0x6485('0x2'),_0x6485('0x3'),_0x6485('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6485('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6485('0x6')](_0x6485('0x1'),'variable',_0x6485('0x2'))},'keyContent':{'type':Sequelize[_0x6485('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6485('0x5')]},'customField':{'type':Sequelize[_0x6485('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe9aa=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x4ad6ca,_0x490434){var _0x89eaf3=function(_0x43c7c1){while(--_0x43c7c1){_0x4ad6ca['push'](_0x4ad6ca['shift']());}};_0x89eaf3(++_0x490434);}(_0xe9aa,0x177));var _0xae9a=function(_0x524ec3,_0x3a047d){_0x524ec3=_0x524ec3-0x0;var _0x322635=_0xe9aa[_0x524ec3];return _0x322635;};'use strict';var Sequelize=require(_0xae9a('0x0'));module[_0xae9a('0x1')]={'type':{'type':Sequelize[_0xae9a('0x2')](_0xae9a('0x3'),_0xae9a('0x4'),_0xae9a('0x5'),_0xae9a('0x6'),_0xae9a('0x7')),'defaultValue':_0xae9a('0x3')},'content':{'type':Sequelize[_0xae9a('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xae9a('0x3'),_0xae9a('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xae9a('0x8')]},'idField':{'type':Sequelize[_0xae9a('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xae9a('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xae9a('0x8')]}};
\ No newline at end of file
index 6938951..18f0913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0035=['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','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','ServicenowField','include','findAll','rows','catch','params','length','includeAll','options','create','body','update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x367cba,_0x597c6){var _0x143e44=function(_0x49e1d8){while(--_0x49e1d8){_0x367cba['push'](_0x367cba['shift']());}};_0x143e44(++_0x597c6);}(_0x0035,0xdb));var _0x5003=function(_0x1190c2,_0x2c078b){_0x1190c2=_0x1190c2-0x0;var _0x6ec988=_0x0035[_0x1190c2];return _0x6ec988;};'use strict';var emlformat=require(_0x5003('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5003('0x1'));var jsonpatch=require(_0x5003('0x2'));var rp=require(_0x5003('0x3'));var moment=require(_0x5003('0x4'));var BPromise=require(_0x5003('0x5'));var Mustache=require(_0x5003('0x6'));var util=require(_0x5003('0x7'));var path=require(_0x5003('0x8'));var sox=require('sox');var csv=require(_0x5003('0x9'));var ejs=require(_0x5003('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5003('0xb'));var squel=require(_0x5003('0xc'));var crypto=require('crypto');var jsforce=require(_0x5003('0xd'));var deskjs=require(_0x5003('0xe'));var toCsv=require(_0x5003('0x9'));var querystring=require(_0x5003('0xf'));var Papa=require(_0x5003('0x10'));var Redis=require(_0x5003('0x11'));var authService=require(_0x5003('0x12'));var qs=require(_0x5003('0x13'));var as=require(_0x5003('0x14'));var hardwareService=require(_0x5003('0x15'));var logger=require(_0x5003('0x16'))(_0x5003('0x17'));var utils=require(_0x5003('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5003('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e7450,_0x1de6a6){_0x1de6a6=_0x1de6a6||0xcc;return function(_0x412428){if(_0x412428){return _0x4e7450[_0x5003('0x1a')](_0x1de6a6);}return _0x4e7450[_0x5003('0x1b')](_0x1de6a6)[_0x5003('0x1c')]();};}function respondWithResult(_0x4c7e72,_0x17edb5){_0x17edb5=_0x17edb5||0xc8;return function(_0x3720a2){if(_0x3720a2){return _0x4c7e72[_0x5003('0x1b')](_0x17edb5)[_0x5003('0x1d')](_0x3720a2);}};}function respondWithFilteredResult(_0x2e5e7d,_0x5f4d10){return function(_0x56ea1f){if(_0x56ea1f){var _0x2052d8=typeof _0x5f4d10[_0x5003('0x1e')]==='undefined'&&typeof _0x5f4d10[_0x5003('0x1f')]===_0x5003('0x20');var _0x3bd77f=_0x56ea1f[_0x5003('0x21')];var _0x3e493b=_0x2052d8?0x0:_0x5f4d10[_0x5003('0x1e')];var _0x16abab=_0x2052d8?_0x56ea1f[_0x5003('0x21')]:_0x5f4d10[_0x5003('0x1e')]+_0x5f4d10[_0x5003('0x1f')];var _0x2f7e53;if(_0x16abab>=_0x3bd77f){_0x16abab=_0x3bd77f;_0x2f7e53=0xc8;}else{_0x2f7e53=0xce;}_0x2e5e7d['status'](_0x2f7e53);return _0x2e5e7d[_0x5003('0x22')](_0x5003('0x23'),_0x3e493b+'-'+_0x16abab+'/'+_0x3bd77f)[_0x5003('0x1d')](_0x56ea1f);}return null;};}function patchUpdates(_0x4c194a){return function(_0x481e17){try{jsonpatch[_0x5003('0x24')](_0x481e17,_0x4c194a,!![]);}catch(_0x57afba){return BPromise[_0x5003('0x25')](_0x57afba);}return _0x481e17[_0x5003('0x26')]();};}function saveUpdates(_0x2f9068,_0x32aeae){return function(_0x364080){if(_0x364080){return _0x364080['update'](_0x2f9068)[_0x5003('0x27')](function(_0x51fc87){return _0x51fc87;});}return null;};}function removeEntity(_0x4e4057,_0x259194){return function(_0x3f816b){if(_0x3f816b){return _0x3f816b[_0x5003('0x28')]()['then'](function(){_0x4e4057[_0x5003('0x1b')](0xcc)[_0x5003('0x1c')]();});}};}function handleEntityNotFound(_0x441547,_0x4120b5){return function(_0xa1cfa4){if(!_0xa1cfa4){_0x441547[_0x5003('0x1a')](0x194);}return _0xa1cfa4;};}function handleError(_0x4cab7e,_0x475b0){_0x475b0=_0x475b0||0x1f4;return function(_0x560fe0){logger[_0x5003('0x29')](_0x560fe0[_0x5003('0x2a')]);if(_0x560fe0['name']){delete _0x560fe0['name'];}_0x4cab7e[_0x5003('0x1b')](_0x475b0)[_0x5003('0x2b')](_0x560fe0);};}exports[_0x5003('0x2c')]=function(_0x3c1725,_0x589d28){var _0x39f894={},_0x548d38={},_0xb3824={'count':0x0,'rows':[]};var _0x41637b=_[_0x5003('0x2d')](db['ServicenowField'][_0x5003('0x2e')],function(_0x26e9d7){return{'name':_0x26e9d7[_0x5003('0x2f')],'type':_0x26e9d7['type']['key']};});_0x548d38[_0x5003('0x30')]=_['map'](_0x41637b,_0x5003('0x31'));_0x548d38[_0x5003('0x32')]=_[_0x5003('0x33')](_0x3c1725['query']);_0x548d38['filters']=_[_0x5003('0x34')](_0x548d38['model'],_0x548d38['query']);_0x39f894[_0x5003('0x35')]=_[_0x5003('0x34')](_0x548d38[_0x5003('0x30')],qs['fields'](_0x3c1725[_0x5003('0x32')][_0x5003('0x36')]));_0x39f894['attributes']=_0x39f894[_0x5003('0x35')]['length']?_0x39f894['attributes']:_0x548d38['model'];if(!_0x3c1725[_0x5003('0x32')][_0x5003('0x37')](_0x5003('0x38'))){_0x39f894['limit']=qs['limit'](_0x3c1725[_0x5003('0x32')][_0x5003('0x1f')]);_0x39f894['offset']=qs[_0x5003('0x1e')](_0x3c1725['query'][_0x5003('0x1e')]);}_0x39f894['order']=qs[_0x5003('0x39')](_0x3c1725['query'][_0x5003('0x39')]);_0x39f894[_0x5003('0x3a')]=qs['filters'](_['pick'](_0x3c1725[_0x5003('0x32')],_0x548d38[_0x5003('0x3b')]),_0x41637b);if(_0x3c1725['query'][_0x5003('0x3c')]){_0x39f894['where']=_[_0x5003('0x3d')](_0x39f894[_0x5003('0x3a')],{'$or':_['map'](_0x41637b,function(_0x13b261){if(_0x13b261['type']!==_0x5003('0x3e')){var _0x5afa71={};_0x5afa71[_0x13b261[_0x5003('0x31')]]={'$like':'%'+_0x3c1725['query'][_0x5003('0x3c')]+'%'};return _0x5afa71;}})});}_0x39f894=_[_0x5003('0x3d')]({},_0x39f894,_0x3c1725['options']);var _0x257758={'where':_0x39f894[_0x5003('0x3a')]};return db[_0x5003('0x3f')]['count'](_0x257758)['then'](function(_0x3c52c0){_0xb3824[_0x5003('0x21')]=_0x3c52c0;if(_0x3c1725[_0x5003('0x32')]['includeAll']){_0x39f894[_0x5003('0x40')]=[{'all':!![]}];}return db[_0x5003('0x3f')][_0x5003('0x41')](_0x39f894);})[_0x5003('0x27')](function(_0x19d90d){_0xb3824[_0x5003('0x42')]=_0x19d90d;return _0xb3824;})['then'](respondWithFilteredResult(_0x589d28,_0x39f894))[_0x5003('0x43')](handleError(_0x589d28,null));};exports['show']=function(_0x1a229d,_0x41ef3e){var _0x1c0d1a={'raw':!![],'where':{'id':_0x1a229d[_0x5003('0x44')]['id']}},_0x3d08b5={};_0x3d08b5[_0x5003('0x30')]=_['keys'](db[_0x5003('0x3f')][_0x5003('0x2e')]);_0x3d08b5[_0x5003('0x32')]=_[_0x5003('0x33')](_0x1a229d[_0x5003('0x32')]);_0x3d08b5[_0x5003('0x3b')]=_[_0x5003('0x34')](_0x3d08b5[_0x5003('0x30')],_0x3d08b5[_0x5003('0x32')]);_0x1c0d1a['attributes']=_[_0x5003('0x34')](_0x3d08b5[_0x5003('0x30')],qs['fields'](_0x1a229d['query'][_0x5003('0x36')]));_0x1c0d1a[_0x5003('0x35')]=_0x1c0d1a['attributes'][_0x5003('0x45')]?_0x1c0d1a[_0x5003('0x35')]:_0x3d08b5[_0x5003('0x30')];if(_0x1a229d[_0x5003('0x32')][_0x5003('0x46')]){_0x1c0d1a[_0x5003('0x40')]=[{'all':!![]}];}_0x1c0d1a=_[_0x5003('0x3d')]({},_0x1c0d1a,_0x1a229d[_0x5003('0x47')]);return db[_0x5003('0x3f')]['find'](_0x1c0d1a)[_0x5003('0x27')](handleEntityNotFound(_0x41ef3e,null))[_0x5003('0x27')](respondWithResult(_0x41ef3e,null))[_0x5003('0x43')](handleError(_0x41ef3e,null));};exports[_0x5003('0x48')]=function(_0x176693,_0x3bf793){return db['ServicenowField'][_0x5003('0x48')](_0x176693[_0x5003('0x49')],{})[_0x5003('0x27')](respondWithResult(_0x3bf793,0xc9))['catch'](handleError(_0x3bf793,null));};exports[_0x5003('0x4a')]=function(_0x20923f,_0x5c13b1){if(_0x20923f[_0x5003('0x49')]['id']){delete _0x20923f[_0x5003('0x49')]['id'];}return db[_0x5003('0x3f')]['find']({'where':{'id':_0x20923f[_0x5003('0x44')]['id']}})[_0x5003('0x27')](handleEntityNotFound(_0x5c13b1,null))['then'](saveUpdates(_0x20923f[_0x5003('0x49')],null))[_0x5003('0x27')](respondWithResult(_0x5c13b1,null))[_0x5003('0x43')](handleError(_0x5c13b1,null));};exports[_0x5003('0x28')]=function(_0x15d181,_0x4e552c){return db[_0x5003('0x3f')][_0x5003('0x4b')]({'where':{'id':_0x15d181[_0x5003('0x44')]['id']}})[_0x5003('0x27')](handleEntityNotFound(_0x4e552c,null))['then'](removeEntity(_0x4e552c,null))[_0x5003('0x43')](handleError(_0x4e552c,null));};
\ No newline at end of file
+var _0x1136=['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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','ServicenowField','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1136,0x1d9));var _0x6113=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1136[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6113('0x0'));var rimraf=require(_0x6113('0x1'));var zipdir=require(_0x6113('0x2'));var jsonpatch=require(_0x6113('0x3'));var rp=require(_0x6113('0x4'));var moment=require('moment');var BPromise=require(_0x6113('0x5'));var Mustache=require(_0x6113('0x6'));var util=require(_0x6113('0x7'));var path=require(_0x6113('0x8'));var sox=require(_0x6113('0x9'));var csv=require(_0x6113('0xa'));var ejs=require(_0x6113('0xb'));var fs=require('fs');var fs_extra=require(_0x6113('0xc'));var _=require(_0x6113('0xd'));var squel=require(_0x6113('0xe'));var crypto=require(_0x6113('0xf'));var jsforce=require(_0x6113('0x10'));var deskjs=require(_0x6113('0x11'));var toCsv=require(_0x6113('0xa'));var querystring=require(_0x6113('0x12'));var Papa=require(_0x6113('0x13'));var Redis=require(_0x6113('0x14'));var authService=require(_0x6113('0x15'));var qs=require(_0x6113('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6113('0x17'));var logger=require(_0x6113('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x6113('0x19'));var licenseUtil=require(_0x6113('0x1a'));var db=require(_0x6113('0x1b'))['db'];function respondWithStatusCode(_0xde6b44,_0x39d46d){_0x39d46d=_0x39d46d||0xcc;return function(_0x2ecc9b){if(_0x2ecc9b){return _0xde6b44[_0x6113('0x1c')](_0x39d46d);}return _0xde6b44[_0x6113('0x1d')](_0x39d46d)['end']();};}function respondWithResult(_0x227a4f,_0x30d4f7){_0x30d4f7=_0x30d4f7||0xc8;return function(_0x4cfaa9){if(_0x4cfaa9){return _0x227a4f['status'](_0x30d4f7)['json'](_0x4cfaa9);}};}function respondWithFilteredResult(_0x2f81e4,_0x7de3cd){return function(_0x4fff0a){if(_0x4fff0a){var _0x32871a=typeof _0x7de3cd[_0x6113('0x1e')]===_0x6113('0x1f')&&typeof _0x7de3cd['limit']===_0x6113('0x1f');var _0x492a0c=_0x4fff0a[_0x6113('0x20')];var _0x452fec=_0x32871a?0x0:_0x7de3cd[_0x6113('0x1e')];var _0x567629=_0x32871a?_0x4fff0a['count']:_0x7de3cd['offset']+_0x7de3cd['limit'];var _0x306ff3;if(_0x567629>=_0x492a0c){_0x567629=_0x492a0c;_0x306ff3=0xc8;}else{_0x306ff3=0xce;}_0x2f81e4[_0x6113('0x1d')](_0x306ff3);return _0x2f81e4['set'](_0x6113('0x21'),_0x452fec+'-'+_0x567629+'/'+_0x492a0c)[_0x6113('0x22')](_0x4fff0a);}return null;};}function patchUpdates(_0x48f5a1){return function(_0x9d9877){try{jsonpatch[_0x6113('0x23')](_0x9d9877,_0x48f5a1,!![]);}catch(_0x2f2cdb){return BPromise[_0x6113('0x24')](_0x2f2cdb);}return _0x9d9877[_0x6113('0x25')]();};}function saveUpdates(_0x5933a0,_0x4f08f6){return function(_0x1f5a32){if(_0x1f5a32){return _0x1f5a32[_0x6113('0x26')](_0x5933a0)[_0x6113('0x27')](function(_0x1c1040){return _0x1c1040;});}return null;};}function removeEntity(_0x5d3834,_0x30230f){return function(_0x53d7d4){if(_0x53d7d4){return _0x53d7d4[_0x6113('0x28')]()[_0x6113('0x27')](function(){_0x5d3834[_0x6113('0x1d')](0xcc)[_0x6113('0x29')]();});}};}function handleEntityNotFound(_0x3daf05,_0xb62322){return function(_0x3ad0e0){if(!_0x3ad0e0){_0x3daf05[_0x6113('0x1c')](0x194);}return _0x3ad0e0;};}function handleError(_0x2dcf93,_0x56a774){_0x56a774=_0x56a774||0x1f4;return function(_0x1d982e){logger[_0x6113('0x2a')](_0x1d982e[_0x6113('0x2b')]);if(_0x1d982e['name']){delete _0x1d982e[_0x6113('0x2c')];}_0x2dcf93[_0x6113('0x1d')](_0x56a774)[_0x6113('0x2d')](_0x1d982e);};}exports[_0x6113('0x2e')]=function(_0x1f983b,_0x45409b){var _0x5db708={},_0xcb9119={},_0x1acf7a={'count':0x0,'rows':[]};var _0x52009b=_['map'](db[_0x6113('0x2f')][_0x6113('0x30')],function(_0x43c2ce){return{'name':_0x43c2ce[_0x6113('0x31')],'type':_0x43c2ce[_0x6113('0x32')]['key']};});_0xcb9119['model']=_[_0x6113('0x33')](_0x52009b,_0x6113('0x2c'));_0xcb9119[_0x6113('0x34')]=_['keys'](_0x1f983b[_0x6113('0x34')]);_0xcb9119[_0x6113('0x35')]=_[_0x6113('0x36')](_0xcb9119[_0x6113('0x37')],_0xcb9119[_0x6113('0x34')]);_0x5db708[_0x6113('0x38')]=_['intersection'](_0xcb9119[_0x6113('0x37')],qs[_0x6113('0x39')](_0x1f983b[_0x6113('0x34')]['fields']));_0x5db708['attributes']=_0x5db708[_0x6113('0x38')][_0x6113('0x3a')]?_0x5db708[_0x6113('0x38')]:_0xcb9119[_0x6113('0x37')];if(!_0x1f983b[_0x6113('0x34')][_0x6113('0x3b')](_0x6113('0x3c'))){_0x5db708['limit']=qs['limit'](_0x1f983b[_0x6113('0x34')][_0x6113('0x3d')]);_0x5db708[_0x6113('0x1e')]=qs[_0x6113('0x1e')](_0x1f983b[_0x6113('0x34')][_0x6113('0x1e')]);}_0x5db708[_0x6113('0x3e')]=qs[_0x6113('0x3f')](_0x1f983b[_0x6113('0x34')][_0x6113('0x3f')]);_0x5db708[_0x6113('0x40')]=qs[_0x6113('0x35')](_[_0x6113('0x41')](_0x1f983b['query'],_0xcb9119[_0x6113('0x35')]),_0x52009b);if(_0x1f983b[_0x6113('0x34')][_0x6113('0x42')]){_0x5db708[_0x6113('0x40')]=_[_0x6113('0x43')](_0x5db708[_0x6113('0x40')],{'$or':_[_0x6113('0x33')](_0x52009b,function(_0x132288){if(_0x132288[_0x6113('0x32')]!==_0x6113('0x44')){var _0x3a8f8b={};_0x3a8f8b[_0x132288['name']]={'$like':'%'+_0x1f983b[_0x6113('0x34')][_0x6113('0x42')]+'%'};return _0x3a8f8b;}})});}_0x5db708=_[_0x6113('0x43')]({},_0x5db708,_0x1f983b['options']);var _0x555b5b={'where':_0x5db708['where']};return db[_0x6113('0x2f')]['count'](_0x555b5b)[_0x6113('0x27')](function(_0x4da3c6){_0x1acf7a[_0x6113('0x20')]=_0x4da3c6;if(_0x1f983b[_0x6113('0x34')][_0x6113('0x45')]){_0x5db708[_0x6113('0x46')]=[{'all':!![]}];}return db[_0x6113('0x2f')][_0x6113('0x47')](_0x5db708);})[_0x6113('0x27')](function(_0x488dbe){_0x1acf7a[_0x6113('0x48')]=_0x488dbe;return _0x1acf7a;})[_0x6113('0x27')](respondWithFilteredResult(_0x45409b,_0x5db708))[_0x6113('0x49')](handleError(_0x45409b,null));};exports[_0x6113('0x4a')]=function(_0x1b2d6c,_0x1c3d48){var _0x4cb7c0={'raw':!![],'where':{'id':_0x1b2d6c[_0x6113('0x4b')]['id']}},_0x1c394f={};_0x1c394f['model']=_[_0x6113('0x4c')](db[_0x6113('0x2f')][_0x6113('0x30')]);_0x1c394f[_0x6113('0x34')]=_[_0x6113('0x4c')](_0x1b2d6c['query']);_0x1c394f['filters']=_[_0x6113('0x36')](_0x1c394f[_0x6113('0x37')],_0x1c394f['query']);_0x4cb7c0[_0x6113('0x38')]=_['intersection'](_0x1c394f[_0x6113('0x37')],qs['fields'](_0x1b2d6c[_0x6113('0x34')][_0x6113('0x39')]));_0x4cb7c0[_0x6113('0x38')]=_0x4cb7c0['attributes'][_0x6113('0x3a')]?_0x4cb7c0[_0x6113('0x38')]:_0x1c394f[_0x6113('0x37')];if(_0x1b2d6c[_0x6113('0x34')]['includeAll']){_0x4cb7c0['include']=[{'all':!![]}];}_0x4cb7c0=_['merge']({},_0x4cb7c0,_0x1b2d6c['options']);return db['ServicenowField'][_0x6113('0x4d')](_0x4cb7c0)[_0x6113('0x27')](handleEntityNotFound(_0x1c3d48,null))[_0x6113('0x27')](respondWithResult(_0x1c3d48,null))[_0x6113('0x49')](handleError(_0x1c3d48,null));};exports[_0x6113('0x4e')]=function(_0x5a6e6d,_0x1ee30a){return db[_0x6113('0x2f')][_0x6113('0x4e')](_0x5a6e6d[_0x6113('0x4f')],{})[_0x6113('0x27')](respondWithResult(_0x1ee30a,0xc9))[_0x6113('0x49')](handleError(_0x1ee30a,null));};exports[_0x6113('0x26')]=function(_0x125a08,_0x3e5467){if(_0x125a08[_0x6113('0x4f')]['id']){delete _0x125a08['body']['id'];}return db[_0x6113('0x2f')][_0x6113('0x4d')]({'where':{'id':_0x125a08[_0x6113('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e5467,null))[_0x6113('0x27')](saveUpdates(_0x125a08['body'],null))[_0x6113('0x27')](respondWithResult(_0x3e5467,null))[_0x6113('0x49')](handleError(_0x3e5467,null));};exports[_0x6113('0x28')]=function(_0x3c1a04,_0x300537){return db[_0x6113('0x2f')]['find']({'where':{'id':_0x3c1a04[_0x6113('0x4b')]['id']}})[_0x6113('0x27')](handleEntityNotFound(_0x300537,null))[_0x6113('0x27')](removeEntity(_0x300537,null))['catch'](handleError(_0x300537,null));};
\ No newline at end of file
index 4f3b781..f144cb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd508=['FieldId','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField'];(function(_0x4f62c7,_0x56f630){var _0x9a0c5d=function(_0x1454a9){while(--_0x1454a9){_0x4f62c7['push'](_0x4f62c7['shift']());}};_0x9a0c5d(++_0x56f630);}(_0xd508,0x151));var _0x8d50=function(_0x410f2c,_0x3b546a){_0x410f2c=_0x410f2c-0x0;var _0x359c88=_0xd508[_0x410f2c];return _0x359c88;};'use strict';var _=require('lodash');var util=require(_0x8d50('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8d50('0x1'));var BPromise=require(_0x8d50('0x2'));var rp=require(_0x8d50('0x3'));var fs=require('fs');var path=require(_0x8d50('0x4'));var rimraf=require(_0x8d50('0x5'));var config=require(_0x8d50('0x6'));var attributes=require(_0x8d50('0x7'));module[_0x8d50('0x8')]=function(_0x1b6474,_0xa6fbde){return _0x1b6474[_0x8d50('0x9')](_0x8d50('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x8d50('0xb'),'fields':[_0x8d50('0xc'),_0x8d50('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x612b=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define','ServicenowField'];(function(_0x27431c,_0x5d28a1){var _0x4bd29b=function(_0x3c1685){while(--_0x3c1685){_0x27431c['push'](_0x27431c['shift']());}};_0x4bd29b(++_0x5d28a1);}(_0x612b,0x1d2));var _0xb612=function(_0x40e347,_0x235371){_0x40e347=_0x40e347-0x0;var _0x1ef408=_0x612b[_0x40e347];return _0x1ef408;};'use strict';var _=require(_0xb612('0x0'));var util=require(_0xb612('0x1'));var logger=require(_0xb612('0x2'))(_0xb612('0x3'));var moment=require(_0xb612('0x4'));var BPromise=require('bluebird');var rp=require(_0xb612('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb612('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xb612('0x7')]=function(_0x3397fb,_0x174e60){return _0x3397fb[_0xb612('0x8')](_0xb612('0x9'),attributes,{'tableName':_0xb612('0xa'),'paranoid':![],'indexes':[{'name':_0xb612('0xb'),'fields':[_0xb612('0xc'),_0xb612('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5b88789..92ac55e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x7ec317,_0x4178ab){var _0x2678e2=function(_0x33d754){while(--_0x33d754){_0x7ec317['push'](_0x7ec317['shift']());}};_0x2678e2(++_0x4178ab);}(_0xe706,0xa3));var _0x6e70=function(_0x13d9ac,_0x193a78){_0x13d9ac=_0x13d9ac-0x0;var _0x348a17=_0xe706[_0x13d9ac];return _0x348a17;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
+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(_0x2e6c4c,_0x215202){var _0x1bdc56=function(_0x2aaa2a){while(--_0x2aaa2a){_0x2e6c4c['push'](_0x2e6c4c['shift']());}};_0x1bdc56(++_0x215202);}(_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 3b09e1f..dd4363e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4d874f,_0xfc871d){var _0x4872bb=function(_0x25102e){while(--_0x25102e){_0x4d874f['push'](_0x4d874f['shift']());}};_0x4872bb(++_0xfc871d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x338eb3,_0x18cff6){var _0x2ff2c5=function(_0x518e7d){while(--_0x518e7d){_0x338eb3['push'](_0x338eb3['shift']());}};_0x2ff2c5(++_0x18cff6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 a5dcc84..e6d5cc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x41d5cd,_0x5c74a9){var _0x40eb0c=function(_0x11ffb4){while(--_0x11ffb4){_0x41d5cd['push'](_0x41d5cd['shift']());}};_0x40eb0c(++_0x5c74a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0xe54d9d,_0x1bced4){var _0x415b6a=function(_0x24fbc8){while(--_0x24fbc8){_0xe54d9d['push'](_0xe54d9d['shift']());}};_0x415b6a(++_0x1bced4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 78a8a96..4aff197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c0a=['SugarcrmConfiguration','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','created_by','description','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','%s%s','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','POST','format','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','options','value','statusCode','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SugarcrmAccount','includeAll','include','rows','catch','show','params','find','body'];(function(_0x33be9b,_0x1b58f6){var _0xaa4554=function(_0x38e17e){while(--_0x38e17e){_0x33be9b['push'](_0x33be9b['shift']());}};_0xaa4554(++_0x1b58f6);}(_0x2c0a,0x1a6));var _0xa2c0=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x2c0a[_0x11155f];return _0xd07e48;};'use strict';var emlformat=require(_0xa2c0('0x0'));var rimraf=require(_0xa2c0('0x1'));var zipdir=require(_0xa2c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa2c0('0x3'));var moment=require(_0xa2c0('0x4'));var BPromise=require(_0xa2c0('0x5'));var Mustache=require(_0xa2c0('0x6'));var util=require(_0xa2c0('0x7'));var path=require(_0xa2c0('0x8'));var sox=require(_0xa2c0('0x9'));var csv=require('to-csv');var ejs=require(_0xa2c0('0xa'));var fs=require('fs');var fs_extra=require(_0xa2c0('0xb'));var _=require(_0xa2c0('0xc'));var squel=require(_0xa2c0('0xd'));var crypto=require(_0xa2c0('0xe'));var jsforce=require(_0xa2c0('0xf'));var deskjs=require(_0xa2c0('0x10'));var toCsv=require(_0xa2c0('0x11'));var querystring=require(_0xa2c0('0x12'));var Papa=require('papaparse');var Redis=require(_0xa2c0('0x13'));var authService=require(_0xa2c0('0x14'));var qs=require(_0xa2c0('0x15'));var as=require(_0xa2c0('0x16'));var hardwareService=require(_0xa2c0('0x17'));var logger=require('../../config/logger')(_0xa2c0('0x18'));var utils=require(_0xa2c0('0x19'));var config=require(_0xa2c0('0x1a'));var licenseUtil=require(_0xa2c0('0x1b'));var db=require(_0xa2c0('0x1c'))['db'];var integrations=require(_0xa2c0('0x1d'));function respondWithStatusCode(_0x15a8c8,_0x22c657){_0x22c657=_0x22c657||0xcc;return function(_0x4e378f){if(_0x4e378f){return _0x15a8c8[_0xa2c0('0x1e')](_0x22c657);}return _0x15a8c8[_0xa2c0('0x1f')](_0x22c657)[_0xa2c0('0x20')]();};}function respondWithResult(_0x4f59e8,_0x395716){_0x395716=_0x395716||0xc8;return function(_0x2a6f87){if(_0x2a6f87){return _0x4f59e8[_0xa2c0('0x1f')](_0x395716)['json'](_0x2a6f87);}};}function respondWithFilteredResult(_0x251c13,_0x104c8b){return function(_0x1e59d4){if(_0x1e59d4){var _0x2753cc=typeof _0x104c8b['offset']===_0xa2c0('0x21')&&typeof _0x104c8b[_0xa2c0('0x22')]==='undefined';var _0x4c1c69=_0x1e59d4['count'];var _0x27360c=_0x2753cc?0x0:_0x104c8b[_0xa2c0('0x23')];var _0x3337d6=_0x2753cc?_0x1e59d4[_0xa2c0('0x24')]:_0x104c8b[_0xa2c0('0x23')]+_0x104c8b['limit'];var _0x508227;if(_0x3337d6>=_0x4c1c69){_0x3337d6=_0x4c1c69;_0x508227=0xc8;}else{_0x508227=0xce;}_0x251c13[_0xa2c0('0x1f')](_0x508227);return _0x251c13[_0xa2c0('0x25')](_0xa2c0('0x26'),_0x27360c+'-'+_0x3337d6+'/'+_0x4c1c69)[_0xa2c0('0x27')](_0x1e59d4);}return null;};}function patchUpdates(_0x168bbf){return function(_0x34fc08){try{jsonpatch['apply'](_0x34fc08,_0x168bbf,!![]);}catch(_0x1583e3){return BPromise[_0xa2c0('0x28')](_0x1583e3);}return _0x34fc08['save']();};}function saveUpdates(_0x9a2db9,_0x25a449){return function(_0x1776c4){if(_0x1776c4){return _0x1776c4[_0xa2c0('0x29')](_0x9a2db9)[_0xa2c0('0x2a')](function(_0x157286){return _0x157286;});}return null;};}function removeEntity(_0x79d44b,_0x492702){return function(_0x37e3b9){if(_0x37e3b9){return _0x37e3b9[_0xa2c0('0x2b')]()[_0xa2c0('0x2a')](function(){_0x79d44b[_0xa2c0('0x1f')](0xcc)[_0xa2c0('0x20')]();});}};}function handleEntityNotFound(_0x1e7064,_0x1a2136){return function(_0x50875e){if(!_0x50875e){_0x1e7064[_0xa2c0('0x1e')](0x194);}return _0x50875e;};}function handleError(_0x4952cd,_0x35227a){_0x35227a=_0x35227a||0x1f4;return function(_0x5ba7f4){logger[_0xa2c0('0x2c')](_0x5ba7f4[_0xa2c0('0x2d')]);if(_0x5ba7f4[_0xa2c0('0x2e')]){delete _0x5ba7f4[_0xa2c0('0x2e')];}_0x4952cd[_0xa2c0('0x1f')](_0x35227a)[_0xa2c0('0x2f')](_0x5ba7f4);};}exports[_0xa2c0('0x30')]=function(_0x3d7380,_0x413338){var _0x4c5310={},_0x52a40e={},_0x1a238a={'count':0x0,'rows':[]};var _0x7fca6b=_[_0xa2c0('0x31')](db['SugarcrmAccount'][_0xa2c0('0x32')],function(_0x2ab69c){return{'name':_0x2ab69c[_0xa2c0('0x33')],'type':_0x2ab69c[_0xa2c0('0x34')]['key']};});_0x52a40e[_0xa2c0('0x35')]=_[_0xa2c0('0x31')](_0x7fca6b,_0xa2c0('0x2e'));_0x52a40e[_0xa2c0('0x36')]=_[_0xa2c0('0x37')](_0x3d7380[_0xa2c0('0x36')]);_0x52a40e[_0xa2c0('0x38')]=_[_0xa2c0('0x39')](_0x52a40e[_0xa2c0('0x35')],_0x52a40e['query']);_0x4c5310[_0xa2c0('0x3a')]=_[_0xa2c0('0x39')](_0x52a40e[_0xa2c0('0x35')],qs[_0xa2c0('0x3b')](_0x3d7380[_0xa2c0('0x36')][_0xa2c0('0x3b')]));_0x4c5310[_0xa2c0('0x3a')]=_0x4c5310[_0xa2c0('0x3a')][_0xa2c0('0x3c')]?_0x4c5310['attributes']:_0x52a40e[_0xa2c0('0x35')];if(!_0x3d7380[_0xa2c0('0x36')]['hasOwnProperty'](_0xa2c0('0x3d'))){_0x4c5310[_0xa2c0('0x22')]=qs[_0xa2c0('0x22')](_0x3d7380[_0xa2c0('0x36')][_0xa2c0('0x22')]);_0x4c5310['offset']=qs[_0xa2c0('0x23')](_0x3d7380[_0xa2c0('0x36')][_0xa2c0('0x23')]);}_0x4c5310[_0xa2c0('0x3e')]=qs[_0xa2c0('0x3f')](_0x3d7380['query']['sort']);_0x4c5310[_0xa2c0('0x40')]=qs[_0xa2c0('0x38')](_[_0xa2c0('0x41')](_0x3d7380['query'],_0x52a40e['filters']),_0x7fca6b);if(_0x3d7380[_0xa2c0('0x36')][_0xa2c0('0x42')]){_0x4c5310[_0xa2c0('0x40')]=_[_0xa2c0('0x43')](_0x4c5310['where'],{'$or':_[_0xa2c0('0x31')](_0x7fca6b,function(_0x4d5a5c){if(_0x4d5a5c[_0xa2c0('0x34')]!==_0xa2c0('0x44')){var _0x5575ca={};_0x5575ca[_0x4d5a5c[_0xa2c0('0x2e')]]={'$like':'%'+_0x3d7380['query'][_0xa2c0('0x42')]+'%'};return _0x5575ca;}})});}_0x4c5310=_[_0xa2c0('0x43')]({},_0x4c5310,_0x3d7380['options']);var _0x25d974={'where':_0x4c5310[_0xa2c0('0x40')]};return db[_0xa2c0('0x45')][_0xa2c0('0x24')](_0x25d974)[_0xa2c0('0x2a')](function(_0x21b5d8){_0x1a238a['count']=_0x21b5d8;if(_0x3d7380[_0xa2c0('0x36')][_0xa2c0('0x46')]){_0x4c5310[_0xa2c0('0x47')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x4c5310);})[_0xa2c0('0x2a')](function(_0x349060){_0x1a238a[_0xa2c0('0x48')]=_0x349060;return _0x1a238a;})[_0xa2c0('0x2a')](respondWithFilteredResult(_0x413338,_0x4c5310))[_0xa2c0('0x49')](handleError(_0x413338,null));};exports[_0xa2c0('0x4a')]=function(_0xc9d975,_0x32778e){var _0xe4720a={'raw':![],'where':{'id':_0xc9d975[_0xa2c0('0x4b')]['id']}},_0x189ebc={};_0x189ebc[_0xa2c0('0x35')]=_[_0xa2c0('0x37')](db[_0xa2c0('0x45')]['rawAttributes']);_0x189ebc[_0xa2c0('0x36')]=_[_0xa2c0('0x37')](_0xc9d975[_0xa2c0('0x36')]);_0x189ebc['filters']=_[_0xa2c0('0x39')](_0x189ebc['model'],_0x189ebc[_0xa2c0('0x36')]);_0xe4720a[_0xa2c0('0x3a')]=_['intersection'](_0x189ebc[_0xa2c0('0x35')],qs[_0xa2c0('0x3b')](_0xc9d975[_0xa2c0('0x36')][_0xa2c0('0x3b')]));_0xe4720a[_0xa2c0('0x3a')]=_0xe4720a[_0xa2c0('0x3a')][_0xa2c0('0x3c')]?_0xe4720a['attributes']:_0x189ebc[_0xa2c0('0x35')];if(_0xc9d975[_0xa2c0('0x36')][_0xa2c0('0x46')]){_0xe4720a[_0xa2c0('0x47')]=[{'all':!![]}];}_0xe4720a=_[_0xa2c0('0x43')]({},_0xe4720a,_0xc9d975['options']);return db['SugarcrmAccount'][_0xa2c0('0x4c')](_0xe4720a)[_0xa2c0('0x2a')](handleEntityNotFound(_0x32778e,null))['then'](respondWithResult(_0x32778e,null))[_0xa2c0('0x49')](handleError(_0x32778e,null));};exports['create']=function(_0x4dc358,_0x5b1e63){return db[_0xa2c0('0x45')]['create'](_0x4dc358['body'],{})[_0xa2c0('0x2a')](respondWithResult(_0x5b1e63,0xc9))[_0xa2c0('0x49')](handleError(_0x5b1e63,null));};exports['update']=function(_0x3c21f6,_0x10890c){if(_0x3c21f6[_0xa2c0('0x4d')]['id']){delete _0x3c21f6[_0xa2c0('0x4d')]['id'];}return db['SugarcrmAccount'][_0xa2c0('0x4c')]({'where':{'id':_0x3c21f6[_0xa2c0('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10890c,null))['then'](saveUpdates(_0x3c21f6['body'],null))['then'](respondWithResult(_0x10890c,null))[_0xa2c0('0x49')](handleError(_0x10890c,null));};exports[_0xa2c0('0x2b')]=function(_0x583346,_0x29ce9a){return db[_0xa2c0('0x45')][_0xa2c0('0x4c')]({'where':{'id':_0x583346[_0xa2c0('0x4b')]['id']}})[_0xa2c0('0x2a')](handleEntityNotFound(_0x29ce9a,null))[_0xa2c0('0x2a')](removeEntity(_0x29ce9a,null))[_0xa2c0('0x49')](handleError(_0x29ce9a,null));};exports['getConfigurations']=function(_0x1bab1a,_0x2b61fe,_0x4a161d){var _0x5c5561={};var _0x12587c={};var _0x52c36e;var _0x2e1e1e;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x1bab1a[_0xa2c0('0x4b')]['id']}})[_0xa2c0('0x2a')](handleEntityNotFound(_0x2b61fe,null))[_0xa2c0('0x2a')](function(_0xb2accc){if(_0xb2accc){_0x52c36e=_0xb2accc;_0x12587c[_0xa2c0('0x35')]=_[_0xa2c0('0x37')](db[_0xa2c0('0x4e')][_0xa2c0('0x32')]);_0x12587c[_0xa2c0('0x36')]=_[_0xa2c0('0x37')](_0x1bab1a[_0xa2c0('0x36')]);_0x12587c[_0xa2c0('0x38')]=_[_0xa2c0('0x39')](_0x12587c[_0xa2c0('0x35')],_0x12587c[_0xa2c0('0x36')]);_0x5c5561[_0xa2c0('0x3a')]=_[_0xa2c0('0x39')](_0x12587c['model'],qs[_0xa2c0('0x3b')](_0x1bab1a[_0xa2c0('0x36')][_0xa2c0('0x3b')]));_0x5c5561[_0xa2c0('0x3a')]=_0x5c5561['attributes']['length']?_0x5c5561['attributes']:_0x12587c[_0xa2c0('0x35')];_0x5c5561[_0xa2c0('0x3e')]=qs[_0xa2c0('0x3f')](_0x1bab1a['query'][_0xa2c0('0x3f')]);_0x5c5561[_0xa2c0('0x40')]=qs['filters'](_[_0xa2c0('0x41')](_0x1bab1a[_0xa2c0('0x36')],_0x12587c[_0xa2c0('0x38')]));if(_0x1bab1a[_0xa2c0('0x36')]['filter']){_0x5c5561[_0xa2c0('0x40')]=_[_0xa2c0('0x43')](_0x5c5561[_0xa2c0('0x40')],{'$or':_[_0xa2c0('0x31')](_0x5c5561[_0xa2c0('0x3a')],function(_0x407841){var _0x184d13={};_0x184d13[_0x407841]={'$like':'%'+_0x1bab1a[_0xa2c0('0x36')][_0xa2c0('0x42')]+'%'};return _0x184d13;})});}_0x5c5561=_[_0xa2c0('0x43')]({},_0x5c5561,_0x1bab1a['options']);return _0x52c36e[_0xa2c0('0x4f')](_0x5c5561);}})[_0xa2c0('0x2a')](function(_0x5caa56){if(_0x5caa56){_0x2e1e1e=_0x5caa56[_0xa2c0('0x3c')];if(!_0x1bab1a[_0xa2c0('0x36')][_0xa2c0('0x50')](_0xa2c0('0x3d'))){_0x5c5561['limit']=qs['limit'](_0x1bab1a['query']['limit']);_0x5c5561[_0xa2c0('0x23')]=qs[_0xa2c0('0x23')](_0x1bab1a[_0xa2c0('0x36')][_0xa2c0('0x23')]);}return _0x52c36e[_0xa2c0('0x4f')](_0x5c5561);}})[_0xa2c0('0x2a')](function(_0x4e7702){if(_0x4e7702){return _0x4e7702?{'count':_0x2e1e1e,'rows':_0x4e7702}:null;}})['then'](respondWithResult(_0x2b61fe,null))[_0xa2c0('0x49')](handleError(_0x2b61fe,null));};exports[_0xa2c0('0x51')]=function(_0x209e35,_0x4868f8,_0x207654){if(_0x209e35['body']['id']){delete _0x209e35[_0xa2c0('0x4d')]['id'];}return db[_0xa2c0('0x45')][_0xa2c0('0x52')]({'where':{'id':_0x209e35[_0xa2c0('0x4b')]['id']}})[_0xa2c0('0x2a')](handleEntityNotFound(_0x4868f8,null))[_0xa2c0('0x2a')](function(_0x548a2b){if(_0x548a2b){_0x209e35['body'][_0xa2c0('0x53')]=_0x548a2b['id'];_0x209e35[_0xa2c0('0x4d')]['Subjects']=integrations[_0xa2c0('0x54')](_0x209e35[_0xa2c0('0x4d')][_0xa2c0('0x55')],_0x209e35[_0xa2c0('0x4d')]['type']);_0x209e35['body'][_0xa2c0('0x56')]=integrations[_0xa2c0('0x57')](_0x209e35[_0xa2c0('0x4d')][_0xa2c0('0x55')],_0x209e35['body'][_0xa2c0('0x34')]);return db[_0xa2c0('0x4e')]['create'](_0x209e35[_0xa2c0('0x4d')],{'include':[{'model':db[_0xa2c0('0x58')],'as':_0xa2c0('0x59')},{'model':db[_0xa2c0('0x58')],'as':'Descriptions'}]});}return null;})[_0xa2c0('0x2a')](respondWithResult(_0x4868f8,null))[_0xa2c0('0x49')](handleError(_0x4868f8,null));};exports[_0xa2c0('0x5a')]=function(_0x29f2d4,_0xe84484,_0x19136){var _0x2b7483='';var _0x23dc08=['id',_0xa2c0('0x2e'),'assigned_user_id',_0xa2c0('0x5b'),_0xa2c0('0x5c'),'date_start','duration_hours',_0xa2c0('0x5d'),_0xa2c0('0x5e'),_0xa2c0('0x5f'),_0xa2c0('0x60'),_0xa2c0('0x61')];return db[_0xa2c0('0x45')][_0xa2c0('0x52')]({'where':{'id':_0x29f2d4[_0xa2c0('0x4b')]['id']},'attributes':['id',_0xa2c0('0x62'),_0xa2c0('0x63'),_0xa2c0('0x64')]})[_0xa2c0('0x2a')](handleEntityNotFound(_0xe84484,null))[_0xa2c0('0x2a')](function(_0x1edcfa){if(_0x1edcfa){_0x2b7483=_0x1edcfa[_0xa2c0('0x64')];var _0x4f440c=_0x2b7483[_0xa2c0('0x65')](-0x1);if(_0x4f440c==='/'){_0x2b7483=_0x2b7483[_0xa2c0('0x66')](0x0,_0x2b7483[_0xa2c0('0x67')](_0x4f440c));}return rp({'method':'POST','uri':util['format'](_0xa2c0('0x68'),_0x2b7483,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0xa2c0('0x69'),'response_type':_0xa2c0('0x69'),'rest_data':JSON[_0xa2c0('0x6a')]({'user_auth':{'user_name':_0x1edcfa['username'],'password':_0x1edcfa[_0xa2c0('0x63')],'encryption':'PLAIN'},'application':_0xa2c0('0x6b')})}});}})[_0xa2c0('0x2a')](function(_0x1298cd){if(_0x1298cd&&_0x1298cd[_0xa2c0('0x2e')]!==_0xa2c0('0x6c')&&_0x1298cd[_0xa2c0('0x2e')]!=='Password\x20Expired'){return rp({'method':_0xa2c0('0x6d'),'uri':util[_0xa2c0('0x6e')](_0xa2c0('0x68'),_0x2b7483,_0xa2c0('0x6f')),'json':!![],'form':{'method':_0xa2c0('0x70'),'input_type':_0xa2c0('0x69'),'response_type':'JSON','rest_data':JSON[_0xa2c0('0x6a')]({'session':_0x1298cd['id'],'module_name':_0xa2c0('0x71')})}})['then'](function(_0x5cc0c1){if(_0x5cc0c1){var _0x376777=_[_0xa2c0('0x72')](_0x5cc0c1[_0xa2c0('0x73')]);_[_0xa2c0('0x74')](_0x376777,function(_0x2f20a2){return _0x23dc08[_0xa2c0('0x75')](_0x2f20a2[_0xa2c0('0x2e')]);});return{'count':_0x376777[_0xa2c0('0x3c')],'rows':_[_0xa2c0('0x31')](_0x376777,function(_0x4a50ac){return{'id':_0x4a50ac[_0xa2c0('0x2e')],'name':_0x4a50ac[_0xa2c0('0x76')],'custom':_[_0xa2c0('0x77')](_0x4a50ac['name'],'_c')?!![]:![],'options':_0x4a50ac[_0xa2c0('0x78')]?_[_0xa2c0('0x31')](_['values'](_0x4a50ac['options']),function(_0x20f0ef){return{'name':_0x20f0ef[_0xa2c0('0x79')],'value':_0x20f0ef['name']};}):[]};})};}})[_0xa2c0('0x2a')](respondWithResult(_0xe84484,null))['catch'](function(_0x3ca334){var _0x43136a=_0x29f2d4[_0xa2c0('0x36')]['test']?0x1f4:_0x3ca334[_0xa2c0('0x7a')]||0x1f4;logger[_0xa2c0('0x2c')]('getFields,\x20%s,\x20%s,\x20%s',_0xa2c0('0x5a'),_0x43136a,JSON[_0xa2c0('0x6a')](_0x3ca334));delete _0x3ca334[_0xa2c0('0x2e')];if(_0x43136a===0x191){_0x43136a=0x190;}_0xe84484[_0xa2c0('0x1f')](_0x43136a)[_0xa2c0('0x2f')](_0x29f2d4[_0xa2c0('0x36')][_0xa2c0('0x7b')]?{'message':_0xa2c0('0x7c'),'statusCode':_0x3ca334[_0xa2c0('0x7a')]}:_0x3ca334);});}else{var _0x588909=0x1f4;_0xe84484[_0xa2c0('0x1f')](_0x588909)[_0xa2c0('0x2f')]({'message':_0xa2c0('0x7c'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xc860=['moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','end','error','stack','name','send','index','SugarcrmAccount','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','create','body','find','params','findOne','SugarcrmConfiguration','rawAttributes','order','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','remove','includes','label','endsWith','values','value','test','statusCode','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0xc860,0x78));var _0x0c86=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0xc860[_0x25248b];return _0x509939;};'use strict';var emlformat=require(_0x0c86('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c86('0x1'));var jsonpatch=require(_0x0c86('0x2'));var rp=require('request-promise');var moment=require(_0x0c86('0x3'));var BPromise=require(_0x0c86('0x4'));var Mustache=require(_0x0c86('0x5'));var util=require(_0x0c86('0x6'));var path=require(_0x0c86('0x7'));var sox=require(_0x0c86('0x8'));var csv=require('to-csv');var ejs=require(_0x0c86('0x9'));var fs=require('fs');var fs_extra=require(_0x0c86('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0c86('0xb'));var jsforce=require(_0x0c86('0xc'));var deskjs=require(_0x0c86('0xd'));var toCsv=require(_0x0c86('0xe'));var querystring=require(_0x0c86('0xf'));var Papa=require(_0x0c86('0x10'));var Redis=require(_0x0c86('0x11'));var authService=require(_0x0c86('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0c86('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c86('0x14'))(_0x0c86('0x15'));var utils=require(_0x0c86('0x16'));var config=require(_0x0c86('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c86('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x285563,_0x103693){_0x103693=_0x103693||0xcc;return function(_0x53c2d7){if(_0x53c2d7){return _0x285563[_0x0c86('0x19')](_0x103693);}return _0x285563['status'](_0x103693)['end']();};}function respondWithResult(_0x346e1f,_0x2b84e5){_0x2b84e5=_0x2b84e5||0xc8;return function(_0x388353){if(_0x388353){return _0x346e1f[_0x0c86('0x1a')](_0x2b84e5)[_0x0c86('0x1b')](_0x388353);}};}function respondWithFilteredResult(_0x1b3fbf,_0x355f68){return function(_0x56f668){if(_0x56f668){var _0x591512=typeof _0x355f68[_0x0c86('0x1c')]===_0x0c86('0x1d')&&typeof _0x355f68[_0x0c86('0x1e')]===_0x0c86('0x1d');var _0xc6b054=_0x56f668[_0x0c86('0x1f')];var _0x429bc6=_0x591512?0x0:_0x355f68['offset'];var _0x1b72e3=_0x591512?_0x56f668[_0x0c86('0x1f')]:_0x355f68['offset']+_0x355f68[_0x0c86('0x1e')];var _0x96e24b;if(_0x1b72e3>=_0xc6b054){_0x1b72e3=_0xc6b054;_0x96e24b=0xc8;}else{_0x96e24b=0xce;}_0x1b3fbf[_0x0c86('0x1a')](_0x96e24b);return _0x1b3fbf[_0x0c86('0x20')](_0x0c86('0x21'),_0x429bc6+'-'+_0x1b72e3+'/'+_0xc6b054)['json'](_0x56f668);}return null;};}function patchUpdates(_0x5f365d){return function(_0x4d9fd3){try{jsonpatch['apply'](_0x4d9fd3,_0x5f365d,!![]);}catch(_0x541abe){return BPromise[_0x0c86('0x22')](_0x541abe);}return _0x4d9fd3[_0x0c86('0x23')]();};}function saveUpdates(_0x2047c2,_0x18807d){return function(_0x410c51){if(_0x410c51){return _0x410c51['update'](_0x2047c2)['then'](function(_0x532dac){return _0x532dac;});}return null;};}function removeEntity(_0x5d2fb4,_0x55ae28){return function(_0x20ac6a){if(_0x20ac6a){return _0x20ac6a[_0x0c86('0x24')]()[_0x0c86('0x25')](function(){_0x5d2fb4[_0x0c86('0x1a')](0xcc)[_0x0c86('0x26')]();});}};}function handleEntityNotFound(_0x429f97,_0x25e1c7){return function(_0x2ee4f5){if(!_0x2ee4f5){_0x429f97[_0x0c86('0x19')](0x194);}return _0x2ee4f5;};}function handleError(_0x5c57ad,_0x3fc77a){_0x3fc77a=_0x3fc77a||0x1f4;return function(_0x26f6b9){logger[_0x0c86('0x27')](_0x26f6b9[_0x0c86('0x28')]);if(_0x26f6b9[_0x0c86('0x29')]){delete _0x26f6b9[_0x0c86('0x29')];}_0x5c57ad['status'](_0x3fc77a)[_0x0c86('0x2a')](_0x26f6b9);};}exports[_0x0c86('0x2b')]=function(_0x5f9f48,_0x54e8c8){var _0x94c162={},_0x4b9d0d={},_0x1bc9d7={'count':0x0,'rows':[]};var _0x1cb3a5=_['map'](db[_0x0c86('0x2c')]['rawAttributes'],function(_0x59f025){return{'name':_0x59f025['fieldName'],'type':_0x59f025[_0x0c86('0x2d')][_0x0c86('0x2e')]};});_0x4b9d0d[_0x0c86('0x2f')]=_[_0x0c86('0x30')](_0x1cb3a5,_0x0c86('0x29'));_0x4b9d0d[_0x0c86('0x31')]=_['keys'](_0x5f9f48['query']);_0x4b9d0d[_0x0c86('0x32')]=_[_0x0c86('0x33')](_0x4b9d0d['model'],_0x4b9d0d[_0x0c86('0x31')]);_0x94c162[_0x0c86('0x34')]=_[_0x0c86('0x33')](_0x4b9d0d[_0x0c86('0x2f')],qs[_0x0c86('0x35')](_0x5f9f48[_0x0c86('0x31')]['fields']));_0x94c162['attributes']=_0x94c162[_0x0c86('0x34')][_0x0c86('0x36')]?_0x94c162[_0x0c86('0x34')]:_0x4b9d0d['model'];if(!_0x5f9f48['query'][_0x0c86('0x37')](_0x0c86('0x38'))){_0x94c162[_0x0c86('0x1e')]=qs['limit'](_0x5f9f48[_0x0c86('0x31')][_0x0c86('0x1e')]);_0x94c162[_0x0c86('0x1c')]=qs[_0x0c86('0x1c')](_0x5f9f48[_0x0c86('0x31')][_0x0c86('0x1c')]);}_0x94c162['order']=qs[_0x0c86('0x39')](_0x5f9f48[_0x0c86('0x31')]['sort']);_0x94c162[_0x0c86('0x3a')]=qs[_0x0c86('0x32')](_[_0x0c86('0x3b')](_0x5f9f48[_0x0c86('0x31')],_0x4b9d0d[_0x0c86('0x32')]),_0x1cb3a5);if(_0x5f9f48[_0x0c86('0x31')][_0x0c86('0x3c')]){_0x94c162[_0x0c86('0x3a')]=_[_0x0c86('0x3d')](_0x94c162['where'],{'$or':_[_0x0c86('0x30')](_0x1cb3a5,function(_0x562ab8){if(_0x562ab8['type']!==_0x0c86('0x3e')){var _0x25ceba={};_0x25ceba[_0x562ab8['name']]={'$like':'%'+_0x5f9f48[_0x0c86('0x31')][_0x0c86('0x3c')]+'%'};return _0x25ceba;}})});}_0x94c162=_['merge']({},_0x94c162,_0x5f9f48['options']);var _0x5bc190={'where':_0x94c162[_0x0c86('0x3a')]};return db[_0x0c86('0x2c')][_0x0c86('0x1f')](_0x5bc190)[_0x0c86('0x25')](function(_0x1f2eef){_0x1bc9d7[_0x0c86('0x1f')]=_0x1f2eef;if(_0x5f9f48[_0x0c86('0x31')][_0x0c86('0x3f')]){_0x94c162[_0x0c86('0x40')]=[{'all':!![]}];}return db[_0x0c86('0x2c')][_0x0c86('0x41')](_0x94c162);})[_0x0c86('0x25')](function(_0xa6f3b0){_0x1bc9d7[_0x0c86('0x42')]=_0xa6f3b0;return _0x1bc9d7;})[_0x0c86('0x25')](respondWithFilteredResult(_0x54e8c8,_0x94c162))[_0x0c86('0x43')](handleError(_0x54e8c8,null));};exports[_0x0c86('0x44')]=function(_0x24bd2d,_0x213404){var _0x37c82f={'raw':![],'where':{'id':_0x24bd2d['params']['id']}},_0x2c8245={};_0x2c8245['model']=_[_0x0c86('0x45')](db['SugarcrmAccount']['rawAttributes']);_0x2c8245[_0x0c86('0x31')]=_[_0x0c86('0x45')](_0x24bd2d['query']);_0x2c8245[_0x0c86('0x32')]=_['intersection'](_0x2c8245[_0x0c86('0x2f')],_0x2c8245[_0x0c86('0x31')]);_0x37c82f[_0x0c86('0x34')]=_['intersection'](_0x2c8245[_0x0c86('0x2f')],qs[_0x0c86('0x35')](_0x24bd2d['query'][_0x0c86('0x35')]));_0x37c82f[_0x0c86('0x34')]=_0x37c82f[_0x0c86('0x34')][_0x0c86('0x36')]?_0x37c82f[_0x0c86('0x34')]:_0x2c8245[_0x0c86('0x2f')];if(_0x24bd2d[_0x0c86('0x31')][_0x0c86('0x3f')]){_0x37c82f['include']=[{'all':!![]}];}_0x37c82f=_[_0x0c86('0x3d')]({},_0x37c82f,_0x24bd2d[_0x0c86('0x46')]);return db[_0x0c86('0x2c')]['find'](_0x37c82f)['then'](handleEntityNotFound(_0x213404,null))[_0x0c86('0x25')](respondWithResult(_0x213404,null))[_0x0c86('0x43')](handleError(_0x213404,null));};exports[_0x0c86('0x47')]=function(_0x27ba7d,_0x5e9ae0){return db['SugarcrmAccount']['create'](_0x27ba7d['body'],{})['then'](respondWithResult(_0x5e9ae0,0xc9))[_0x0c86('0x43')](handleError(_0x5e9ae0,null));};exports['update']=function(_0x21499c,_0x58af95){if(_0x21499c[_0x0c86('0x48')]['id']){delete _0x21499c[_0x0c86('0x48')]['id'];}return db[_0x0c86('0x2c')][_0x0c86('0x49')]({'where':{'id':_0x21499c[_0x0c86('0x4a')]['id']}})[_0x0c86('0x25')](handleEntityNotFound(_0x58af95,null))[_0x0c86('0x25')](saveUpdates(_0x21499c[_0x0c86('0x48')],null))[_0x0c86('0x25')](respondWithResult(_0x58af95,null))[_0x0c86('0x43')](handleError(_0x58af95,null));};exports[_0x0c86('0x24')]=function(_0x474735,_0x218e44){return db[_0x0c86('0x2c')][_0x0c86('0x49')]({'where':{'id':_0x474735[_0x0c86('0x4a')]['id']}})['then'](handleEntityNotFound(_0x218e44,null))['then'](removeEntity(_0x218e44,null))['catch'](handleError(_0x218e44,null));};exports['getConfigurations']=function(_0x43ba85,_0x4207d7,_0x2c8cb2){var _0x505304={};var _0x4e644b={};var _0x3cca14;var _0xabc0a7;return db[_0x0c86('0x2c')][_0x0c86('0x4b')]({'where':{'id':_0x43ba85['params']['id']}})[_0x0c86('0x25')](handleEntityNotFound(_0x4207d7,null))[_0x0c86('0x25')](function(_0x422c92){if(_0x422c92){_0x3cca14=_0x422c92;_0x4e644b[_0x0c86('0x2f')]=_['keys'](db[_0x0c86('0x4c')][_0x0c86('0x4d')]);_0x4e644b['query']=_[_0x0c86('0x45')](_0x43ba85[_0x0c86('0x31')]);_0x4e644b[_0x0c86('0x32')]=_[_0x0c86('0x33')](_0x4e644b[_0x0c86('0x2f')],_0x4e644b[_0x0c86('0x31')]);_0x505304[_0x0c86('0x34')]=_[_0x0c86('0x33')](_0x4e644b['model'],qs[_0x0c86('0x35')](_0x43ba85['query']['fields']));_0x505304[_0x0c86('0x34')]=_0x505304[_0x0c86('0x34')][_0x0c86('0x36')]?_0x505304['attributes']:_0x4e644b[_0x0c86('0x2f')];_0x505304[_0x0c86('0x4e')]=qs['sort'](_0x43ba85[_0x0c86('0x31')][_0x0c86('0x39')]);_0x505304[_0x0c86('0x3a')]=qs[_0x0c86('0x32')](_['pick'](_0x43ba85[_0x0c86('0x31')],_0x4e644b[_0x0c86('0x32')]));if(_0x43ba85['query'][_0x0c86('0x3c')]){_0x505304[_0x0c86('0x3a')]=_[_0x0c86('0x3d')](_0x505304[_0x0c86('0x3a')],{'$or':_['map'](_0x505304[_0x0c86('0x34')],function(_0x4addf4){var _0x29fb40={};_0x29fb40[_0x4addf4]={'$like':'%'+_0x43ba85['query'][_0x0c86('0x3c')]+'%'};return _0x29fb40;})});}_0x505304=_[_0x0c86('0x3d')]({},_0x505304,_0x43ba85[_0x0c86('0x46')]);return _0x3cca14[_0x0c86('0x4f')](_0x505304);}})[_0x0c86('0x25')](function(_0x24a971){if(_0x24a971){_0xabc0a7=_0x24a971[_0x0c86('0x36')];if(!_0x43ba85[_0x0c86('0x31')][_0x0c86('0x37')](_0x0c86('0x38'))){_0x505304[_0x0c86('0x1e')]=qs[_0x0c86('0x1e')](_0x43ba85[_0x0c86('0x31')]['limit']);_0x505304['offset']=qs[_0x0c86('0x1c')](_0x43ba85[_0x0c86('0x31')][_0x0c86('0x1c')]);}return _0x3cca14[_0x0c86('0x4f')](_0x505304);}})[_0x0c86('0x25')](function(_0x57c9f3){if(_0x57c9f3){return _0x57c9f3?{'count':_0xabc0a7,'rows':_0x57c9f3}:null;}})[_0x0c86('0x25')](respondWithResult(_0x4207d7,null))['catch'](handleError(_0x4207d7,null));};exports['addConfiguration']=function(_0x418bcd,_0x2bb407,_0x5dae4a){if(_0x418bcd[_0x0c86('0x48')]['id']){delete _0x418bcd[_0x0c86('0x48')]['id'];}return db['SugarcrmAccount'][_0x0c86('0x4b')]({'where':{'id':_0x418bcd[_0x0c86('0x4a')]['id']}})[_0x0c86('0x25')](handleEntityNotFound(_0x2bb407,null))[_0x0c86('0x25')](function(_0x2f8702){if(_0x2f8702){_0x418bcd[_0x0c86('0x48')][_0x0c86('0x50')]=_0x2f8702['id'];_0x418bcd[_0x0c86('0x48')][_0x0c86('0x51')]=integrations[_0x0c86('0x52')](_0x418bcd[_0x0c86('0x48')][_0x0c86('0x53')],_0x418bcd[_0x0c86('0x48')][_0x0c86('0x2d')]);_0x418bcd[_0x0c86('0x48')][_0x0c86('0x54')]=integrations[_0x0c86('0x55')](_0x418bcd[_0x0c86('0x48')][_0x0c86('0x53')],_0x418bcd[_0x0c86('0x48')][_0x0c86('0x2d')]);return db[_0x0c86('0x4c')]['create'](_0x418bcd[_0x0c86('0x48')],{'include':[{'model':db[_0x0c86('0x56')],'as':_0x0c86('0x51')},{'model':db[_0x0c86('0x56')],'as':_0x0c86('0x54')}]});}return null;})[_0x0c86('0x25')](respondWithResult(_0x2bb407,null))[_0x0c86('0x43')](handleError(_0x2bb407,null));};exports['getFields']=function(_0x3ec610,_0x13933f,_0x1786e0){var _0x241091='';var _0x2b7536=['id',_0x0c86('0x29'),_0x0c86('0x57'),_0x0c86('0x58'),_0x0c86('0x59'),_0x0c86('0x5a'),'duration_hours','duration_minutes',_0x0c86('0x5b'),'parent_type',_0x0c86('0x5c'),_0x0c86('0x5d')];return db[_0x0c86('0x2c')][_0x0c86('0x4b')]({'where':{'id':_0x3ec610['params']['id']},'attributes':['id',_0x0c86('0x5e'),_0x0c86('0x5f'),_0x0c86('0x60')]})[_0x0c86('0x25')](handleEntityNotFound(_0x13933f,null))[_0x0c86('0x25')](function(_0x253a20){if(_0x253a20){_0x241091=_0x253a20[_0x0c86('0x60')];var _0x3bff02=_0x241091[_0x0c86('0x61')](-0x1);if(_0x3bff02==='/'){_0x241091=_0x241091[_0x0c86('0x62')](0x0,_0x241091[_0x0c86('0x63')](_0x3bff02));}return rp({'method':_0x0c86('0x64'),'uri':util[_0x0c86('0x65')]('%s%s',_0x241091,_0x0c86('0x66')),'json':!![],'form':{'method':_0x0c86('0x67'),'input_type':_0x0c86('0x68'),'response_type':_0x0c86('0x68'),'rest_data':JSON[_0x0c86('0x69')]({'user_auth':{'user_name':_0x253a20[_0x0c86('0x5e')],'password':_0x253a20[_0x0c86('0x5f')],'encryption':_0x0c86('0x6a')},'application':_0x0c86('0x6b')})}});}})[_0x0c86('0x25')](function(_0x2336a0){if(_0x2336a0&&_0x2336a0['name']!==_0x0c86('0x6c')&&_0x2336a0['name']!==_0x0c86('0x6d')){return rp({'method':'POST','uri':util[_0x0c86('0x65')](_0x0c86('0x6e'),_0x241091,_0x0c86('0x66')),'json':!![],'form':{'method':_0x0c86('0x6f'),'input_type':'JSON','response_type':_0x0c86('0x68'),'rest_data':JSON[_0x0c86('0x69')]({'session':_0x2336a0['id'],'module_name':_0x0c86('0x70')})}})['then'](function(_0x3f7ea9){if(_0x3f7ea9){var _0x47fd49=_['values'](_0x3f7ea9['module_fields']);_[_0x0c86('0x71')](_0x47fd49,function(_0x16e693){return _0x2b7536[_0x0c86('0x72')](_0x16e693[_0x0c86('0x29')]);});return{'count':_0x47fd49['length'],'rows':_['map'](_0x47fd49,function(_0x23a147){return{'id':_0x23a147['name'],'name':_0x23a147[_0x0c86('0x73')],'custom':_[_0x0c86('0x74')](_0x23a147['name'],'_c')?!![]:![],'options':_0x23a147[_0x0c86('0x46')]?_['map'](_[_0x0c86('0x75')](_0x23a147[_0x0c86('0x46')]),function(_0xae4fee){return{'name':_0xae4fee[_0x0c86('0x76')],'value':_0xae4fee[_0x0c86('0x29')]};}):[]};})};}})[_0x0c86('0x25')](respondWithResult(_0x13933f,null))[_0x0c86('0x43')](function(_0x2eb39a){var _0x4ee15d=_0x3ec610['query'][_0x0c86('0x77')]?0x1f4:_0x2eb39a[_0x0c86('0x78')]||0x1f4;logger[_0x0c86('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x0c86('0x79'),_0x4ee15d,JSON[_0x0c86('0x69')](_0x2eb39a));delete _0x2eb39a[_0x0c86('0x29')];if(_0x4ee15d===0x191){_0x4ee15d=0x190;}_0x13933f[_0x0c86('0x1a')](_0x4ee15d)[_0x0c86('0x2a')](_0x3ec610[_0x0c86('0x31')][_0x0c86('0x77')]?{'message':_0x0c86('0x7a'),'statusCode':_0x2eb39a[_0x0c86('0x78')]}:_0x2eb39a);});}else{var _0x1ea2b3=0x1f4;_0x13933f['status'](_0x1ea2b3)['send']({'message':_0x0c86('0x7a'),'statusCode':0x190});}});};
\ No newline at end of file
index 6a8aad3..ad166a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcead=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define'];(function(_0x527c26,_0x239dd8){var _0x27a4f8=function(_0x2771a7){while(--_0x2771a7){_0x527c26['push'](_0x527c26['shift']());}};_0x27a4f8(++_0x239dd8);}(_0xcead,0x160));var _0xdcea=function(_0x5c2831,_0xb936cc){_0x5c2831=_0x5c2831-0x0;var _0x3fc79d=_0xcead[_0x5c2831];return _0x3fc79d;};'use strict';var _=require(_0xdcea('0x0'));var util=require(_0xdcea('0x1'));var logger=require(_0xdcea('0x2'))('api');var moment=require(_0xdcea('0x3'));var BPromise=require(_0xdcea('0x4'));var rp=require(_0xdcea('0x5'));var fs=require('fs');var path=require(_0xdcea('0x6'));var rimraf=require(_0xdcea('0x7'));var config=require(_0xdcea('0x8'));var attributes=require(_0xdcea('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xdcea('0xa')]=function(_0x513295,_0x4913fa){return _0x513295[_0xdcea('0xb')](_0xdcea('0xc'),attributes,{'tableName':_0xdcea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeeaf=['path','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3de90a,_0x1771b4){var _0x5af411=function(_0x2d768a){while(--_0x2d768a){_0x3de90a['push'](_0x3de90a['shift']());}};_0x5af411(++_0x1771b4);}(_0xeeaf,0x159));var _0xfeea=function(_0x568c2a,_0x40066e){_0x568c2a=_0x568c2a-0x0;var _0x286cfa=_0xeeaf[_0x568c2a];return _0x286cfa;};'use strict';var _=require(_0xfeea('0x0'));var util=require(_0xfeea('0x1'));var logger=require(_0xfeea('0x2'))(_0xfeea('0x3'));var moment=require('moment');var BPromise=require(_0xfeea('0x4'));var rp=require(_0xfeea('0x5'));var fs=require('fs');var path=require(_0xfeea('0x6'));var rimraf=require('rimraf');var config=require(_0xfeea('0x7'));var attributes=require(_0xfeea('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xfeea('0x9')]=function(_0x1d9b94,_0x3f4f5b){return _0x1d9b94[_0xfeea('0xa')](_0xfeea('0xb'),attributes,{'tableName':_0xfeea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 999586b..e851697 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7651=['code','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','limit','map','include','model','attributes','ShowSugarcrmAccount','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0x7651,0x14a));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1765('0x0'));var util=require(_0x1765('0x1'));var moment=require(_0x1765('0x2'));var BPromise=require(_0x1765('0x3'));var rs=require(_0x1765('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1765('0x5'))['db'];var utils=require(_0x1765('0x6'));var logger=require(_0x1765('0x7'))(_0x1765('0x8'));var config=require(_0x1765('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1765('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4366fb,_0x54537f,_0x3b08ca){return new BPromise(function(_0x10f297,_0x1d0b45){return client[_0x1765('0xb')](_0x4366fb,_0x3b08ca)[_0x1765('0xc')](function(_0x56b893){logger[_0x1765('0xd')](_0x1765('0xe'),_0x54537f,_0x1765('0xf'));logger[_0x1765('0x10')](_0x1765('0x11'),_0x54537f,_0x1765('0xf'),JSON[_0x1765('0x12')](_0x56b893));if(_0x56b893[_0x1765('0x13')]){if(_0x56b893[_0x1765('0x13')][_0x1765('0x14')]===0x1f4){logger[_0x1765('0x13')](_0x1765('0xe'),_0x54537f,_0x56b893[_0x1765('0x13')][_0x1765('0x15')]);return _0x1d0b45(_0x56b893[_0x1765('0x13')][_0x1765('0x15')]);}logger[_0x1765('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x54537f,_0x56b893['error'][_0x1765('0x15')]);return _0x10f297(_0x56b893[_0x1765('0x13')]['message']);}else{logger['info'](_0x1765('0xe'),_0x54537f,_0x1765('0xf'));_0x10f297(_0x56b893['result'][_0x1765('0x15')]);}})[_0x1765('0x16')](function(_0x4628b3){logger[_0x1765('0x13')](_0x1765('0xe'),_0x54537f,_0x4628b3);_0x1d0b45(_0x4628b3);});});}exports[_0x1765('0x17')]=function(_0x5cf0e3){var _0x12a49f=this;return new Promise(function(_0x45a2ae,_0x4136aa){return db[_0x1765('0x18')][_0x1765('0x19')]({'raw':_0x5cf0e3[_0x1765('0x1a')]?_0x5cf0e3['options'][_0x1765('0x1b')]===undefined?!![]:![]:!![],'where':_0x5cf0e3[_0x1765('0x1a')]?_0x5cf0e3[_0x1765('0x1a')]['where']||null:null,'attributes':_0x5cf0e3['options']?_0x5cf0e3[_0x1765('0x1a')]['attributes']||null:null,'limit':_0x5cf0e3['options']?_0x5cf0e3[_0x1765('0x1a')][_0x1765('0x1c')]||null:null,'include':_0x5cf0e3[_0x1765('0x1a')]?_0x5cf0e3[_0x1765('0x1a')]['include']?_[_0x1765('0x1d')](_0x5cf0e3[_0x1765('0x1a')][_0x1765('0x1e')],function(_0x51522a){return{'model':db[_0x51522a[_0x1765('0x1f')]],'as':_0x51522a['as'],'attributes':_0x51522a[_0x1765('0x20')],'include':_0x51522a['include']?_[_0x1765('0x1d')](_0x51522a[_0x1765('0x1e')],function(_0x3df00c){return{'model':db[_0x3df00c[_0x1765('0x1f')]],'as':_0x3df00c['as'],'attributes':_0x3df00c[_0x1765('0x20')],'include':_0x3df00c[_0x1765('0x1e')]?_[_0x1765('0x1d')](_0x3df00c[_0x1765('0x1e')],function(_0x292b58){return{'model':db[_0x292b58[_0x1765('0x1f')]],'as':_0x292b58['as'],'attributes':_0x292b58[_0x1765('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1765('0xc')](function(_0x42744b){logger[_0x1765('0xd')]('GetSugarcrmAccount',_0x5cf0e3);logger['debug'](_0x1765('0x17'),_0x5cf0e3,JSON['stringify'](_0x42744b));_0x45a2ae(_0x42744b);})['catch'](function(_0x111745){logger['error']('GetSugarcrmAccount',_0x111745[_0x1765('0x15')],_0x5cf0e3);_0x4136aa(_0x12a49f[_0x1765('0x13')](0x1f4,_0x111745['message']));});});};exports[_0x1765('0x21')]=function(_0x50585e){var _0x4bb958=this;return new Promise(function(_0x4d287d,_0x1ba5b9){return db[_0x1765('0x18')]['find']({'raw':_0x50585e['options']?_0x50585e['options'][_0x1765('0x1b')]===undefined?!![]:![]:!![],'where':_0x50585e[_0x1765('0x1a')]?_0x50585e[_0x1765('0x1a')][_0x1765('0x22')]||null:null,'attributes':_0x50585e[_0x1765('0x1a')]?_0x50585e['options'][_0x1765('0x20')]||null:null,'include':_0x50585e[_0x1765('0x1a')]?_0x50585e[_0x1765('0x1a')]['include']?_[_0x1765('0x1d')](_0x50585e[_0x1765('0x1a')]['include'],function(_0xa0c3c7){return{'model':db[_0xa0c3c7[_0x1765('0x1f')]],'as':_0xa0c3c7['as'],'attributes':_0xa0c3c7['attributes'],'include':_0xa0c3c7[_0x1765('0x1e')]?_['map'](_0xa0c3c7[_0x1765('0x1e')],function(_0x395f7e){return{'model':db[_0x395f7e[_0x1765('0x1f')]],'as':_0x395f7e['as'],'attributes':_0x395f7e[_0x1765('0x20')],'include':_0x395f7e[_0x1765('0x1e')]?_[_0x1765('0x1d')](_0x395f7e[_0x1765('0x1e')],function(_0x548c6e){return{'model':db[_0x548c6e[_0x1765('0x1f')]],'as':_0x548c6e['as'],'attributes':_0x548c6e[_0x1765('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1765('0xc')](function(_0x3e69f8){logger[_0x1765('0xd')](_0x1765('0x21'),_0x50585e);logger[_0x1765('0x10')]('ShowSugarcrmAccount',_0x50585e,JSON['stringify'](_0x3e69f8));_0x4d287d(_0x3e69f8);})[_0x1765('0x16')](function(_0x329983){logger[_0x1765('0x13')](_0x1765('0x21'),_0x329983[_0x1765('0x15')],_0x50585e);_0x1ba5b9(_0x4bb958[_0x1765('0x13')](0x1f4,_0x329983['message']));});});};
\ No newline at end of file
+var _0xf1ae=['catch','GetSugarcrmAccount','findAll','options','raw','where','limit','include','attributes','model','map','info','ShowSugarcrmAccount','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x15449d,_0x537b1d){var _0x55cf8c=function(_0x4fc014){while(--_0x4fc014){_0x15449d['push'](_0x15449d['shift']());}};_0x55cf8c(++_0x537b1d);}(_0xf1ae,0xc8));var _0xef1a=function(_0x545e39,_0xb32a2){_0x545e39=_0x545e39-0x0;var _0x2e1417=_0xf1ae[_0x545e39];return _0x2e1417;};'use strict';var _=require(_0xef1a('0x0'));var util=require(_0xef1a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xef1a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef1a('0x3'))['db'];var utils=require(_0xef1a('0x4'));var logger=require(_0xef1a('0x5'))(_0xef1a('0x6'));var config=require(_0xef1a('0x7'));var jayson=require(_0xef1a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x94b6ed,_0x417d8f,_0x2b42f4){return new BPromise(function(_0x13153b,_0x3c211a){return client['request'](_0x94b6ed,_0x2b42f4)[_0xef1a('0x9')](function(_0x1c32fb){logger['info'](_0xef1a('0xa'),_0x417d8f,_0xef1a('0xb'));logger[_0xef1a('0xc')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x417d8f,'request\x20sent',JSON[_0xef1a('0xd')](_0x1c32fb));if(_0x1c32fb[_0xef1a('0xe')]){if(_0x1c32fb[_0xef1a('0xe')]['code']===0x1f4){logger[_0xef1a('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x417d8f,_0x1c32fb[_0xef1a('0xe')][_0xef1a('0xf')]);return _0x3c211a(_0x1c32fb[_0xef1a('0xe')][_0xef1a('0xf')]);}logger[_0xef1a('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x417d8f,_0x1c32fb['error'][_0xef1a('0xf')]);return _0x13153b(_0x1c32fb[_0xef1a('0xe')][_0xef1a('0xf')]);}else{logger['info'](_0xef1a('0xa'),_0x417d8f,_0xef1a('0xb'));_0x13153b(_0x1c32fb[_0xef1a('0x10')]['message']);}})[_0xef1a('0x11')](function(_0xad699){logger[_0xef1a('0xe')](_0xef1a('0xa'),_0x417d8f,_0xad699);_0x3c211a(_0xad699);});});}exports[_0xef1a('0x12')]=function(_0x4e927b){var _0x3c189b=this;return new Promise(function(_0x110a9f,_0x1cceb7){return db['SugarcrmAccount'][_0xef1a('0x13')]({'raw':_0x4e927b[_0xef1a('0x14')]?_0x4e927b[_0xef1a('0x14')][_0xef1a('0x15')]===undefined?!![]:![]:!![],'where':_0x4e927b['options']?_0x4e927b[_0xef1a('0x14')][_0xef1a('0x16')]||null:null,'attributes':_0x4e927b[_0xef1a('0x14')]?_0x4e927b['options']['attributes']||null:null,'limit':_0x4e927b[_0xef1a('0x14')]?_0x4e927b[_0xef1a('0x14')][_0xef1a('0x17')]||null:null,'include':_0x4e927b['options']?_0x4e927b['options'][_0xef1a('0x18')]?_['map'](_0x4e927b[_0xef1a('0x14')][_0xef1a('0x18')],function(_0x31e5a9){return{'model':db[_0x31e5a9['model']],'as':_0x31e5a9['as'],'attributes':_0x31e5a9[_0xef1a('0x19')],'include':_0x31e5a9[_0xef1a('0x18')]?_['map'](_0x31e5a9['include'],function(_0x2cdbbf){return{'model':db[_0x2cdbbf[_0xef1a('0x1a')]],'as':_0x2cdbbf['as'],'attributes':_0x2cdbbf['attributes'],'include':_0x2cdbbf[_0xef1a('0x18')]?_[_0xef1a('0x1b')](_0x2cdbbf['include'],function(_0x1f9c7f){return{'model':db[_0x1f9c7f[_0xef1a('0x1a')]],'as':_0x1f9c7f['as'],'attributes':_0x1f9c7f[_0xef1a('0x19')]};}):[]};}):[]};}):[]:[]})[_0xef1a('0x9')](function(_0xe3bd4){logger[_0xef1a('0x1c')]('GetSugarcrmAccount',_0x4e927b);logger[_0xef1a('0xc')](_0xef1a('0x12'),_0x4e927b,JSON['stringify'](_0xe3bd4));_0x110a9f(_0xe3bd4);})[_0xef1a('0x11')](function(_0x5adbc2){logger[_0xef1a('0xe')](_0xef1a('0x12'),_0x5adbc2['message'],_0x4e927b);_0x1cceb7(_0x3c189b[_0xef1a('0xe')](0x1f4,_0x5adbc2['message']));});});};exports[_0xef1a('0x1d')]=function(_0x1510c0){var _0x46cfd2=this;return new Promise(function(_0x3c2487,_0xa83471){return db['SugarcrmAccount'][_0xef1a('0x1e')]({'raw':_0x1510c0['options']?_0x1510c0[_0xef1a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x1510c0[_0xef1a('0x14')]?_0x1510c0[_0xef1a('0x14')][_0xef1a('0x16')]||null:null,'attributes':_0x1510c0[_0xef1a('0x14')]?_0x1510c0[_0xef1a('0x14')][_0xef1a('0x19')]||null:null,'include':_0x1510c0[_0xef1a('0x14')]?_0x1510c0[_0xef1a('0x14')][_0xef1a('0x18')]?_[_0xef1a('0x1b')](_0x1510c0[_0xef1a('0x14')][_0xef1a('0x18')],function(_0x3359eb){return{'model':db[_0x3359eb[_0xef1a('0x1a')]],'as':_0x3359eb['as'],'attributes':_0x3359eb[_0xef1a('0x19')],'include':_0x3359eb[_0xef1a('0x18')]?_[_0xef1a('0x1b')](_0x3359eb[_0xef1a('0x18')],function(_0x26e63f){return{'model':db[_0x26e63f[_0xef1a('0x1a')]],'as':_0x26e63f['as'],'attributes':_0x26e63f[_0xef1a('0x19')],'include':_0x26e63f['include']?_['map'](_0x26e63f[_0xef1a('0x18')],function(_0x1819d9){return{'model':db[_0x1819d9[_0xef1a('0x1a')]],'as':_0x1819d9['as'],'attributes':_0x1819d9[_0xef1a('0x19')]};}):[]};}):[]};}):[]:[]})[_0xef1a('0x9')](function(_0x550c65){logger[_0xef1a('0x1c')](_0xef1a('0x1d'),_0x1510c0);logger[_0xef1a('0xc')](_0xef1a('0x1d'),_0x1510c0,JSON[_0xef1a('0xd')](_0x550c65));_0x3c2487(_0x550c65);})['catch'](function(_0x29cb6){logger[_0xef1a('0xe')](_0xef1a('0x1d'),_0x29cb6[_0xef1a('0xf')],_0x1510c0);_0xa83471(_0x46cfd2[_0xef1a('0xe')](0x1f4,_0x29cb6[_0xef1a('0xf')]));});});};
\ No newline at end of file
index 1d62aaa..0304e16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed68=['getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','/:id','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/fields','getFields'];(function(_0x18032f,_0x4f4e45){var _0xb0b2b8=function(_0x563262){while(--_0x563262){_0x18032f['push'](_0x18032f['shift']());}};_0xb0b2b8(++_0x4f4e45);}(_0xed68,0x199));var _0x8ed6=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xed68[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0x8ed6('0x0'));var util=require('util');var path=require(_0x8ed6('0x1'));var timeout=require('connect-timeout');var express=require(_0x8ed6('0x2'));var router=express[_0x8ed6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8ed6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8ed6('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x8ed6('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8ed6('0x6')]('/:id',auth[_0x8ed6('0x7')](),controller[_0x8ed6('0x8')]);router[_0x8ed6('0x6')](_0x8ed6('0x9'),auth[_0x8ed6('0x7')](),controller[_0x8ed6('0xa')]);router[_0x8ed6('0x6')]('/:id/subjects',auth[_0x8ed6('0x7')](),controller[_0x8ed6('0xb')]);router[_0x8ed6('0x6')](_0x8ed6('0xc'),auth[_0x8ed6('0x7')](),controller[_0x8ed6('0xd')]);router[_0x8ed6('0xe')]('/',auth[_0x8ed6('0x7')](),controller[_0x8ed6('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8ed6('0x10')]);router[_0x8ed6('0x11')](_0x8ed6('0x12'),auth[_0x8ed6('0x7')](),controller['destroy']);module[_0x8ed6('0x13')]=router;
\ No newline at end of file
+var _0x1209=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index'];(function(_0x2eab2b,_0x2b09c0){var _0x4f9aad=function(_0x22f349){while(--_0x22f349){_0x2eab2b['push'](_0x2eab2b['shift']());}};_0x4f9aad(++_0x2b09c0);}(_0x1209,0x15f));var _0x9120=function(_0x3b71a9,_0x3baa89){_0x3b71a9=_0x3b71a9-0x0;var _0x2bfea9=_0x1209[_0x3b71a9];return _0x2bfea9;};'use strict';var multer=require(_0x9120('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9120('0x1'));var express=require(_0x9120('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9120('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9120('0x4'));var controller=require(_0x9120('0x5'));router[_0x9120('0x6')]('/',auth[_0x9120('0x7')](),controller[_0x9120('0x8')]);router['get'](_0x9120('0x9'),auth[_0x9120('0x7')](),controller[_0x9120('0xa')]);router['get'](_0x9120('0xb'),auth[_0x9120('0x7')](),controller[_0x9120('0xc')]);router[_0x9120('0x6')](_0x9120('0xd'),auth[_0x9120('0x7')](),controller[_0x9120('0xe')]);router[_0x9120('0x6')](_0x9120('0xf'),auth['isAuthenticated'](),controller[_0x9120('0x10')]);router[_0x9120('0x11')]('/',auth[_0x9120('0x7')](),controller[_0x9120('0x12')]);router[_0x9120('0x13')]('/:id',auth[_0x9120('0x7')](),controller[_0x9120('0x14')]);router[_0x9120('0x15')](_0x9120('0x9'),auth['isAuthenticated'](),controller[_0x9120('0x16')]);module[_0x9120('0x17')]=router;
\ No newline at end of file
index d26d626..f23262b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbd1=['exports','STRING'];(function(_0x269422,_0x170198){var _0x73206a=function(_0x1cd79a){while(--_0x1cd79a){_0x269422['push'](_0x269422['shift']());}};_0x73206a(++_0x170198);}(_0xbbd1,0x1a8));var _0x1bbd=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0xbbd1[_0x149a9b];return _0x2c2bf6;};'use strict';var Sequelize=require('sequelize');module[_0x1bbd('0x0')]={'name':{'type':Sequelize[_0x1bbd('0x1')]},'description':{'type':Sequelize[_0x1bbd('0x1')]}};
\ No newline at end of file
+var _0x6a1f=['sequelize','STRING'];(function(_0x2b2f88,_0x3a3639){var _0x464c0a=function(_0x38d7ff){while(--_0x38d7ff){_0x2b2f88['push'](_0x2b2f88['shift']());}};_0x464c0a(++_0x3a3639);}(_0x6a1f,0x16e));var _0xf6a1=function(_0x5d61a7,_0x12738f){_0x5d61a7=_0x5d61a7-0x0;var _0x51bc1d=_0x6a1f[_0x5d61a7];return _0x51bc1d;};'use strict';var Sequelize=require(_0xf6a1('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6a1('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 10487fd..a1f0666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc980=['mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','save','update','then','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','limit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','fields','includeAll','create','body','find','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','order','eml-format','fast-json-patch','request-promise'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xc980,0x95));var _0x0c98=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0xc980[_0x27beea];return _0x122645;};'use strict';var emlformat=require(_0x0c98('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0c98('0x1'));var rp=require(_0x0c98('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0c98('0x3'));var util=require(_0x0c98('0x4'));var path=require(_0x0c98('0x5'));var sox=require(_0x0c98('0x6'));var csv=require(_0x0c98('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c98('0x8'));var _=require(_0x0c98('0x9'));var squel=require(_0x0c98('0xa'));var crypto=require(_0x0c98('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0c98('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c98('0xd'));var Redis=require('ioredis');var authService=require(_0x0c98('0xe'));var qs=require(_0x0c98('0xf'));var as=require(_0x0c98('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c98('0x11'))(_0x0c98('0x12'));var utils=require(_0x0c98('0x13'));var config=require(_0x0c98('0x14'));var licenseUtil=require(_0x0c98('0x15'));var db=require(_0x0c98('0x16'))['db'];function respondWithStatusCode(_0x38ee68,_0x512a75){_0x512a75=_0x512a75||0xcc;return function(_0x49b89f){if(_0x49b89f){return _0x38ee68[_0x0c98('0x17')](_0x512a75);}return _0x38ee68[_0x0c98('0x18')](_0x512a75)[_0x0c98('0x19')]();};}function respondWithResult(_0x4a4a89,_0x1de3d8){_0x1de3d8=_0x1de3d8||0xc8;return function(_0x14c185){if(_0x14c185){return _0x4a4a89[_0x0c98('0x18')](_0x1de3d8)[_0x0c98('0x1a')](_0x14c185);}};}function respondWithFilteredResult(_0xc2a6b7,_0x11aa30){return function(_0x27acbb){if(_0x27acbb){var _0x4f2f5d=typeof _0x11aa30[_0x0c98('0x1b')]===_0x0c98('0x1c')&&typeof _0x11aa30['limit']===_0x0c98('0x1c');var _0x145920=_0x27acbb[_0x0c98('0x1d')];var _0x1c341e=_0x4f2f5d?0x0:_0x11aa30[_0x0c98('0x1b')];var _0x3bd0d9=_0x4f2f5d?_0x27acbb[_0x0c98('0x1d')]:_0x11aa30[_0x0c98('0x1b')]+_0x11aa30['limit'];var _0x2079ff;if(_0x3bd0d9>=_0x145920){_0x3bd0d9=_0x145920;_0x2079ff=0xc8;}else{_0x2079ff=0xce;}_0xc2a6b7[_0x0c98('0x18')](_0x2079ff);return _0xc2a6b7[_0x0c98('0x1e')](_0x0c98('0x1f'),_0x1c341e+'-'+_0x3bd0d9+'/'+_0x145920)[_0x0c98('0x1a')](_0x27acbb);}return null;};}function patchUpdates(_0x43cf2e){return function(_0x297e7c){try{jsonpatch['apply'](_0x297e7c,_0x43cf2e,!![]);}catch(_0x3c568d){return BPromise['reject'](_0x3c568d);}return _0x297e7c[_0x0c98('0x20')]();};}function saveUpdates(_0x13c2b5,_0xcc4f08){return function(_0x4d2682){if(_0x4d2682){return _0x4d2682[_0x0c98('0x21')](_0x13c2b5)[_0x0c98('0x22')](function(_0x57e430){return _0x57e430;});}return null;};}function removeEntity(_0x10910d,_0x33943b){return function(_0x2ac43e){if(_0x2ac43e){return _0x2ac43e['destroy']()[_0x0c98('0x22')](function(){_0x10910d['status'](0xcc)[_0x0c98('0x19')]();});}};}function handleEntityNotFound(_0x2caa68,_0x98083a){return function(_0x3a3e86){if(!_0x3a3e86){_0x2caa68[_0x0c98('0x17')](0x194);}return _0x3a3e86;};}function handleError(_0xb0d4ac,_0x4054a7){_0x4054a7=_0x4054a7||0x1f4;return function(_0x39a01a){logger['error'](_0x39a01a[_0x0c98('0x23')]);if(_0x39a01a[_0x0c98('0x24')]){delete _0x39a01a['name'];}_0xb0d4ac[_0x0c98('0x18')](_0x4054a7)[_0x0c98('0x25')](_0x39a01a);};}exports[_0x0c98('0x26')]=function(_0x5e75db,_0x14b71a){var _0x396abd={},_0x245900={},_0x304a18={'count':0x0,'rows':[]};var _0x1819b9=_[_0x0c98('0x27')](db[_0x0c98('0x28')][_0x0c98('0x29')],function(_0x3dc8f2){return{'name':_0x3dc8f2[_0x0c98('0x2a')],'type':_0x3dc8f2[_0x0c98('0x2b')]['key']};});_0x245900[_0x0c98('0x2c')]=_[_0x0c98('0x27')](_0x1819b9,_0x0c98('0x24'));_0x245900[_0x0c98('0x2d')]=_['keys'](_0x5e75db[_0x0c98('0x2d')]);_0x245900[_0x0c98('0x2e')]=_[_0x0c98('0x2f')](_0x245900[_0x0c98('0x2c')],_0x245900[_0x0c98('0x2d')]);_0x396abd[_0x0c98('0x30')]=_[_0x0c98('0x2f')](_0x245900[_0x0c98('0x2c')],qs['fields'](_0x5e75db[_0x0c98('0x2d')]['fields']));_0x396abd[_0x0c98('0x30')]=_0x396abd[_0x0c98('0x30')][_0x0c98('0x31')]?_0x396abd[_0x0c98('0x30')]:_0x245900[_0x0c98('0x2c')];if(!_0x5e75db[_0x0c98('0x2d')]['hasOwnProperty']('nolimit')){_0x396abd[_0x0c98('0x32')]=qs[_0x0c98('0x32')](_0x5e75db['query'][_0x0c98('0x32')]);_0x396abd[_0x0c98('0x1b')]=qs[_0x0c98('0x1b')](_0x5e75db[_0x0c98('0x2d')][_0x0c98('0x1b')]);}_0x396abd['order']=qs[_0x0c98('0x33')](_0x5e75db[_0x0c98('0x2d')][_0x0c98('0x33')]);_0x396abd['where']=qs[_0x0c98('0x2e')](_[_0x0c98('0x34')](_0x5e75db[_0x0c98('0x2d')],_0x245900[_0x0c98('0x2e')]),_0x1819b9);if(_0x5e75db[_0x0c98('0x2d')][_0x0c98('0x35')]){_0x396abd[_0x0c98('0x36')]=_[_0x0c98('0x37')](_0x396abd[_0x0c98('0x36')],{'$or':_['map'](_0x1819b9,function(_0x77eae1){if(_0x77eae1[_0x0c98('0x2b')]!==_0x0c98('0x38')){var _0x378853={};_0x378853[_0x77eae1[_0x0c98('0x24')]]={'$like':'%'+_0x5e75db['query'][_0x0c98('0x35')]+'%'};return _0x378853;}})});}_0x396abd=_[_0x0c98('0x37')]({},_0x396abd,_0x5e75db[_0x0c98('0x39')]);var _0x3055a0={'where':_0x396abd['where']};return db[_0x0c98('0x28')][_0x0c98('0x1d')](_0x3055a0)[_0x0c98('0x22')](function(_0x5dba0d){_0x304a18[_0x0c98('0x1d')]=_0x5dba0d;if(_0x5e75db[_0x0c98('0x2d')]['includeAll']){_0x396abd[_0x0c98('0x3a')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x0c98('0x3b')](_0x396abd);})[_0x0c98('0x22')](function(_0x3b40ae){_0x304a18[_0x0c98('0x3c')]=_0x3b40ae;return _0x304a18;})[_0x0c98('0x22')](respondWithFilteredResult(_0x14b71a,_0x396abd))[_0x0c98('0x3d')](handleError(_0x14b71a,null));};exports['show']=function(_0x5711fc,_0x5f4309){var _0x3470cb={'raw':![],'where':{'id':_0x5711fc[_0x0c98('0x3e')]['id']}},_0x3a3fea={};_0x3a3fea[_0x0c98('0x2c')]=_[_0x0c98('0x3f')](db[_0x0c98('0x28')][_0x0c98('0x29')]);_0x3a3fea[_0x0c98('0x2d')]=_['keys'](_0x5711fc['query']);_0x3a3fea[_0x0c98('0x2e')]=_[_0x0c98('0x2f')](_0x3a3fea[_0x0c98('0x2c')],_0x3a3fea[_0x0c98('0x2d')]);_0x3470cb['attributes']=_['intersection'](_0x3a3fea[_0x0c98('0x2c')],qs[_0x0c98('0x40')](_0x5711fc[_0x0c98('0x2d')][_0x0c98('0x40')]));_0x3470cb[_0x0c98('0x30')]=_0x3470cb[_0x0c98('0x30')][_0x0c98('0x31')]?_0x3470cb[_0x0c98('0x30')]:_0x3a3fea[_0x0c98('0x2c')];if(_0x5711fc[_0x0c98('0x2d')][_0x0c98('0x41')]){_0x3470cb[_0x0c98('0x3a')]=[{'all':!![]}];}_0x3470cb=_[_0x0c98('0x37')]({},_0x3470cb,_0x5711fc[_0x0c98('0x39')]);return db[_0x0c98('0x28')]['find'](_0x3470cb)[_0x0c98('0x22')](handleEntityNotFound(_0x5f4309,null))['then'](respondWithResult(_0x5f4309,null))[_0x0c98('0x3d')](handleError(_0x5f4309,null));};exports['create']=function(_0x3a034a,_0x5eb509){return db[_0x0c98('0x28')][_0x0c98('0x42')](_0x3a034a[_0x0c98('0x43')],{})[_0x0c98('0x22')](respondWithResult(_0x5eb509,0xc9))[_0x0c98('0x3d')](handleError(_0x5eb509,null));};exports[_0x0c98('0x21')]=function(_0x5a6ac3,_0x59b7ac){if(_0x5a6ac3[_0x0c98('0x43')]['id']){delete _0x5a6ac3['body']['id'];}return db['SugarcrmConfiguration'][_0x0c98('0x44')]({'where':{'id':_0x5a6ac3[_0x0c98('0x3e')]['id']}})[_0x0c98('0x22')](handleEntityNotFound(_0x59b7ac,null))['then'](saveUpdates(_0x5a6ac3['body'],null))[_0x0c98('0x22')](respondWithResult(_0x59b7ac,null))['catch'](handleError(_0x59b7ac,null));};exports['destroy']=function(_0x38d997,_0x5c1076){return db['SugarcrmConfiguration'][_0x0c98('0x44')]({'where':{'id':_0x38d997['params']['id']}})[_0x0c98('0x22')](handleEntityNotFound(_0x5c1076,null))[_0x0c98('0x22')](removeEntity(_0x5c1076,null))[_0x0c98('0x3d')](handleError(_0x5c1076,null));};exports[_0x0c98('0x45')]=function(_0x272761,_0x40760c,_0x215143){var _0x54ba81={};var _0x2a5ab2={};var _0x1a5cbb;var _0x5504e7;return db['SugarcrmConfiguration'][_0x0c98('0x46')]({'where':{'id':_0x272761[_0x0c98('0x3e')]['id']}})[_0x0c98('0x22')](handleEntityNotFound(_0x40760c,null))['then'](function(_0x2865c2){if(_0x2865c2){_0x1a5cbb=_0x2865c2;_0x2a5ab2['model']=_[_0x0c98('0x3f')](db[_0x0c98('0x47')][_0x0c98('0x29')]);_0x2a5ab2[_0x0c98('0x2d')]=_['keys'](_0x272761[_0x0c98('0x2d')]);_0x2a5ab2[_0x0c98('0x2e')]=_[_0x0c98('0x2f')](_0x2a5ab2[_0x0c98('0x2c')],_0x2a5ab2['query']);_0x54ba81['attributes']=_[_0x0c98('0x2f')](_0x2a5ab2[_0x0c98('0x2c')],qs[_0x0c98('0x40')](_0x272761[_0x0c98('0x2d')][_0x0c98('0x40')]));_0x54ba81[_0x0c98('0x30')]=_0x54ba81['attributes']['length']?_0x54ba81['attributes']:_0x2a5ab2[_0x0c98('0x2c')];_0x54ba81['order']=qs[_0x0c98('0x33')](_0x272761[_0x0c98('0x2d')][_0x0c98('0x33')]);_0x54ba81['where']=qs[_0x0c98('0x2e')](_[_0x0c98('0x34')](_0x272761[_0x0c98('0x2d')],_0x2a5ab2[_0x0c98('0x2e')]));if(_0x272761['query'][_0x0c98('0x35')]){_0x54ba81['where']=_[_0x0c98('0x37')](_0x54ba81['where'],{'$or':_['map'](_0x54ba81[_0x0c98('0x30')],function(_0x190157){var _0x343996={};_0x343996[_0x190157]={'$like':'%'+_0x272761[_0x0c98('0x2d')][_0x0c98('0x35')]+'%'};return _0x343996;})});}_0x54ba81=_[_0x0c98('0x37')]({},_0x54ba81,_0x272761[_0x0c98('0x39')]);return _0x1a5cbb[_0x0c98('0x45')](_0x54ba81);}})[_0x0c98('0x22')](function(_0x35aefb){if(_0x35aefb){_0x5504e7=_0x35aefb[_0x0c98('0x31')];if(!_0x272761[_0x0c98('0x2d')]['hasOwnProperty'](_0x0c98('0x48'))){_0x54ba81[_0x0c98('0x32')]=qs[_0x0c98('0x32')](_0x272761[_0x0c98('0x2d')][_0x0c98('0x32')]);_0x54ba81[_0x0c98('0x1b')]=qs[_0x0c98('0x1b')](_0x272761[_0x0c98('0x2d')]['offset']);}return _0x1a5cbb[_0x0c98('0x45')](_0x54ba81);}})[_0x0c98('0x22')](function(_0x11490f){if(_0x11490f){return _0x11490f?{'count':_0x5504e7,'rows':_0x11490f}:null;}})[_0x0c98('0x22')](respondWithResult(_0x40760c,null))[_0x0c98('0x3d')](handleError(_0x40760c,null));};exports[_0x0c98('0x49')]=function(_0x56b718,_0x450801,_0x5c1ccd){var _0x1bd836={};var _0x3e4470={};var _0x2d542f;var _0x3a72dd;return db[_0x0c98('0x28')][_0x0c98('0x46')]({'where':{'id':_0x56b718[_0x0c98('0x3e')]['id']}})[_0x0c98('0x22')](handleEntityNotFound(_0x450801,null))[_0x0c98('0x22')](function(_0x152805){if(_0x152805){_0x2d542f=_0x152805;_0x3e4470[_0x0c98('0x2c')]=_[_0x0c98('0x3f')](db[_0x0c98('0x47')]['rawAttributes']);_0x3e4470['query']=_[_0x0c98('0x3f')](_0x56b718['query']);_0x3e4470[_0x0c98('0x2e')]=_[_0x0c98('0x2f')](_0x3e4470[_0x0c98('0x2c')],_0x3e4470[_0x0c98('0x2d')]);_0x1bd836[_0x0c98('0x30')]=_[_0x0c98('0x2f')](_0x3e4470[_0x0c98('0x2c')],qs[_0x0c98('0x40')](_0x56b718['query'][_0x0c98('0x40')]));_0x1bd836[_0x0c98('0x30')]=_0x1bd836[_0x0c98('0x30')]['length']?_0x1bd836[_0x0c98('0x30')]:_0x3e4470[_0x0c98('0x2c')];_0x1bd836['order']=qs['sort'](_0x56b718['query'][_0x0c98('0x33')]);_0x1bd836['where']=qs[_0x0c98('0x2e')](_['pick'](_0x56b718[_0x0c98('0x2d')],_0x3e4470[_0x0c98('0x2e')]));if(_0x56b718[_0x0c98('0x2d')][_0x0c98('0x35')]){_0x1bd836[_0x0c98('0x36')]=_[_0x0c98('0x37')](_0x1bd836[_0x0c98('0x36')],{'$or':_['map'](_0x1bd836[_0x0c98('0x30')],function(_0x18afec){var _0x5666ab={};_0x5666ab[_0x18afec]={'$like':'%'+_0x56b718[_0x0c98('0x2d')]['filter']+'%'};return _0x5666ab;})});}_0x1bd836=_[_0x0c98('0x37')]({},_0x1bd836,_0x56b718[_0x0c98('0x39')]);return _0x2d542f[_0x0c98('0x49')](_0x1bd836);}})[_0x0c98('0x22')](function(_0x2917bf){if(_0x2917bf){_0x3a72dd=_0x2917bf[_0x0c98('0x31')];if(!_0x56b718[_0x0c98('0x2d')]['hasOwnProperty'](_0x0c98('0x48'))){_0x1bd836[_0x0c98('0x32')]=qs[_0x0c98('0x32')](_0x56b718[_0x0c98('0x2d')][_0x0c98('0x32')]);_0x1bd836[_0x0c98('0x1b')]=qs[_0x0c98('0x1b')](_0x56b718[_0x0c98('0x2d')][_0x0c98('0x1b')]);}return _0x2d542f[_0x0c98('0x49')](_0x1bd836);}})[_0x0c98('0x22')](function(_0x29372f){if(_0x29372f){return _0x29372f?{'count':_0x3a72dd,'rows':_0x29372f}:null;}})['then'](respondWithResult(_0x450801,null))['catch'](handleError(_0x450801,null));};exports[_0x0c98('0x4a')]=function(_0x5755de,_0x2daf98,_0x3070ab){var _0x13d04e={};var _0x856ff6={};var _0x52b22a;var _0x10e078;return db[_0x0c98('0x28')][_0x0c98('0x46')]({'where':{'id':_0x5755de[_0x0c98('0x3e')]['id']}})[_0x0c98('0x22')](handleEntityNotFound(_0x2daf98,null))[_0x0c98('0x22')](function(_0x186ae2){if(_0x186ae2){_0x52b22a=_0x186ae2;_0x856ff6[_0x0c98('0x2c')]=_[_0x0c98('0x3f')](db[_0x0c98('0x47')][_0x0c98('0x29')]);_0x856ff6[_0x0c98('0x2d')]=_[_0x0c98('0x3f')](_0x5755de['query']);_0x856ff6['filters']=_[_0x0c98('0x2f')](_0x856ff6[_0x0c98('0x2c')],_0x856ff6[_0x0c98('0x2d')]);_0x13d04e[_0x0c98('0x30')]=_[_0x0c98('0x2f')](_0x856ff6[_0x0c98('0x2c')],qs[_0x0c98('0x40')](_0x5755de[_0x0c98('0x2d')][_0x0c98('0x40')]));_0x13d04e[_0x0c98('0x30')]=_0x13d04e[_0x0c98('0x30')]['length']?_0x13d04e[_0x0c98('0x30')]:_0x856ff6[_0x0c98('0x2c')];_0x13d04e[_0x0c98('0x4b')]=qs['sort'](_0x5755de[_0x0c98('0x2d')][_0x0c98('0x33')]);_0x13d04e[_0x0c98('0x36')]=qs['filters'](_[_0x0c98('0x34')](_0x5755de['query'],_0x856ff6[_0x0c98('0x2e')]));if(_0x5755de[_0x0c98('0x2d')][_0x0c98('0x35')]){_0x13d04e[_0x0c98('0x36')]=_[_0x0c98('0x37')](_0x13d04e[_0x0c98('0x36')],{'$or':_[_0x0c98('0x27')](_0x13d04e[_0x0c98('0x30')],function(_0x4283f4){var _0x14e467={};_0x14e467[_0x4283f4]={'$like':'%'+_0x5755de[_0x0c98('0x2d')]['filter']+'%'};return _0x14e467;})});}_0x13d04e=_['merge']({},_0x13d04e,_0x5755de[_0x0c98('0x39')]);return _0x52b22a['getDescriptions'](_0x13d04e);}})['then'](function(_0x239b61){if(_0x239b61){_0x10e078=_0x239b61[_0x0c98('0x31')];if(!_0x5755de[_0x0c98('0x2d')]['hasOwnProperty'](_0x0c98('0x48'))){_0x13d04e['limit']=qs[_0x0c98('0x32')](_0x5755de[_0x0c98('0x2d')][_0x0c98('0x32')]);_0x13d04e['offset']=qs[_0x0c98('0x1b')](_0x5755de[_0x0c98('0x2d')][_0x0c98('0x1b')]);}return _0x52b22a['getDescriptions'](_0x13d04e);}})[_0x0c98('0x22')](function(_0x33f3fe){if(_0x33f3fe){return _0x33f3fe?{'count':_0x10e078,'rows':_0x33f3fe}:null;}})[_0x0c98('0x22')](respondWithResult(_0x2daf98,null))[_0x0c98('0x3d')](handleError(_0x2daf98,null));};
\ No newline at end of file
+var _0xf828=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SugarcrmConfiguration','count','includeAll','include','findAll','catch','show','params','keys','length','options','find','create','body','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','set','Content-Range','json','apply','reject','save','then','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x1aef24,_0x1f1c07){var _0xe2626d=function(_0x43a953){while(--_0x43a953){_0x1aef24['push'](_0x1aef24['shift']());}};_0xe2626d(++_0x1f1c07);}(_0xf828,0x6a));var _0x8f82=function(_0x3dba3a,_0x72e6e8){_0x3dba3a=_0x3dba3a-0x0;var _0x2981f0=_0xf828[_0x3dba3a];return _0x2981f0;};'use strict';var emlformat=require(_0x8f82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f82('0x1'));var jsonpatch=require(_0x8f82('0x2'));var rp=require(_0x8f82('0x3'));var moment=require(_0x8f82('0x4'));var BPromise=require(_0x8f82('0x5'));var Mustache=require('mustache');var util=require(_0x8f82('0x6'));var path=require('path');var sox=require(_0x8f82('0x7'));var csv=require('to-csv');var ejs=require(_0x8f82('0x8'));var fs=require('fs');var fs_extra=require(_0x8f82('0x9'));var _=require(_0x8f82('0xa'));var squel=require(_0x8f82('0xb'));var crypto=require('crypto');var jsforce=require(_0x8f82('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8f82('0xd'));var querystring=require('querystring');var Papa=require(_0x8f82('0xe'));var Redis=require(_0x8f82('0xf'));var authService=require(_0x8f82('0x10'));var qs=require(_0x8f82('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f82('0x12'));var logger=require(_0x8f82('0x13'))('api');var utils=require(_0x8f82('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8f82('0x15'));var db=require(_0x8f82('0x16'))['db'];function respondWithStatusCode(_0x185383,_0x4dbaf2){_0x4dbaf2=_0x4dbaf2||0xcc;return function(_0x49bcc1){if(_0x49bcc1){return _0x185383[_0x8f82('0x17')](_0x4dbaf2);}return _0x185383[_0x8f82('0x18')](_0x4dbaf2)[_0x8f82('0x19')]();};}function respondWithResult(_0x1a42a7,_0x1c54ad){_0x1c54ad=_0x1c54ad||0xc8;return function(_0x3cf02d){if(_0x3cf02d){return _0x1a42a7['status'](_0x1c54ad)['json'](_0x3cf02d);}};}function respondWithFilteredResult(_0x373557,_0x68926b){return function(_0x4e6e8b){if(_0x4e6e8b){var _0x1d84b1=typeof _0x68926b[_0x8f82('0x1a')]==='undefined'&&typeof _0x68926b[_0x8f82('0x1b')]===_0x8f82('0x1c');var _0x5e8a82=_0x4e6e8b['count'];var _0x4de308=_0x1d84b1?0x0:_0x68926b[_0x8f82('0x1a')];var _0x246dd0=_0x1d84b1?_0x4e6e8b['count']:_0x68926b[_0x8f82('0x1a')]+_0x68926b[_0x8f82('0x1b')];var _0x5c9f70;if(_0x246dd0>=_0x5e8a82){_0x246dd0=_0x5e8a82;_0x5c9f70=0xc8;}else{_0x5c9f70=0xce;}_0x373557[_0x8f82('0x18')](_0x5c9f70);return _0x373557[_0x8f82('0x1d')](_0x8f82('0x1e'),_0x4de308+'-'+_0x246dd0+'/'+_0x5e8a82)[_0x8f82('0x1f')](_0x4e6e8b);}return null;};}function patchUpdates(_0x202778){return function(_0x2c0587){try{jsonpatch[_0x8f82('0x20')](_0x2c0587,_0x202778,!![]);}catch(_0x4aec7d){return BPromise[_0x8f82('0x21')](_0x4aec7d);}return _0x2c0587[_0x8f82('0x22')]();};}function saveUpdates(_0x4edfcf,_0x428215){return function(_0x271180){if(_0x271180){return _0x271180['update'](_0x4edfcf)['then'](function(_0x450d0e){return _0x450d0e;});}return null;};}function removeEntity(_0x14543b,_0x455c2e){return function(_0x4407af){if(_0x4407af){return _0x4407af['destroy']()[_0x8f82('0x23')](function(){_0x14543b[_0x8f82('0x18')](0xcc)[_0x8f82('0x19')]();});}};}function handleEntityNotFound(_0x2757c8,_0x4a0d05){return function(_0x342c48){if(!_0x342c48){_0x2757c8[_0x8f82('0x17')](0x194);}return _0x342c48;};}function handleError(_0x9fac87,_0x2171ee){_0x2171ee=_0x2171ee||0x1f4;return function(_0x59c088){logger['error'](_0x59c088[_0x8f82('0x24')]);if(_0x59c088[_0x8f82('0x25')]){delete _0x59c088[_0x8f82('0x25')];}_0x9fac87[_0x8f82('0x18')](_0x2171ee)[_0x8f82('0x26')](_0x59c088);};}exports['index']=function(_0x326c84,_0x172d8f){var _0x3c7eb3={},_0x3ffe8c={},_0x5e64ea={'count':0x0,'rows':[]};var _0x4d6a5a=_[_0x8f82('0x27')](db['SugarcrmConfiguration'][_0x8f82('0x28')],function(_0x162c1c){return{'name':_0x162c1c[_0x8f82('0x29')],'type':_0x162c1c[_0x8f82('0x2a')]['key']};});_0x3ffe8c[_0x8f82('0x2b')]=_[_0x8f82('0x27')](_0x4d6a5a,_0x8f82('0x25'));_0x3ffe8c[_0x8f82('0x2c')]=_['keys'](_0x326c84['query']);_0x3ffe8c[_0x8f82('0x2d')]=_[_0x8f82('0x2e')](_0x3ffe8c[_0x8f82('0x2b')],_0x3ffe8c[_0x8f82('0x2c')]);_0x3c7eb3['attributes']=_[_0x8f82('0x2e')](_0x3ffe8c['model'],qs[_0x8f82('0x2f')](_0x326c84[_0x8f82('0x2c')][_0x8f82('0x2f')]));_0x3c7eb3[_0x8f82('0x30')]=_0x3c7eb3[_0x8f82('0x30')]['length']?_0x3c7eb3[_0x8f82('0x30')]:_0x3ffe8c[_0x8f82('0x2b')];if(!_0x326c84[_0x8f82('0x2c')][_0x8f82('0x31')](_0x8f82('0x32'))){_0x3c7eb3[_0x8f82('0x1b')]=qs['limit'](_0x326c84[_0x8f82('0x2c')][_0x8f82('0x1b')]);_0x3c7eb3[_0x8f82('0x1a')]=qs[_0x8f82('0x1a')](_0x326c84[_0x8f82('0x2c')]['offset']);}_0x3c7eb3[_0x8f82('0x33')]=qs['sort'](_0x326c84['query'][_0x8f82('0x34')]);_0x3c7eb3[_0x8f82('0x35')]=qs[_0x8f82('0x2d')](_[_0x8f82('0x36')](_0x326c84['query'],_0x3ffe8c[_0x8f82('0x2d')]),_0x4d6a5a);if(_0x326c84['query'][_0x8f82('0x37')]){_0x3c7eb3[_0x8f82('0x35')]=_[_0x8f82('0x38')](_0x3c7eb3[_0x8f82('0x35')],{'$or':_[_0x8f82('0x27')](_0x4d6a5a,function(_0x266f04){if(_0x266f04[_0x8f82('0x2a')]!==_0x8f82('0x39')){var _0x4b62a5={};_0x4b62a5[_0x266f04[_0x8f82('0x25')]]={'$like':'%'+_0x326c84['query'][_0x8f82('0x37')]+'%'};return _0x4b62a5;}})});}_0x3c7eb3=_[_0x8f82('0x38')]({},_0x3c7eb3,_0x326c84['options']);var _0x1c385d={'where':_0x3c7eb3['where']};return db[_0x8f82('0x3a')][_0x8f82('0x3b')](_0x1c385d)[_0x8f82('0x23')](function(_0x4324d6){_0x5e64ea[_0x8f82('0x3b')]=_0x4324d6;if(_0x326c84[_0x8f82('0x2c')][_0x8f82('0x3c')]){_0x3c7eb3[_0x8f82('0x3d')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x8f82('0x3e')](_0x3c7eb3);})['then'](function(_0x2d9fc0){_0x5e64ea['rows']=_0x2d9fc0;return _0x5e64ea;})[_0x8f82('0x23')](respondWithFilteredResult(_0x172d8f,_0x3c7eb3))[_0x8f82('0x3f')](handleError(_0x172d8f,null));};exports[_0x8f82('0x40')]=function(_0x5ddb81,_0x86fbb3){var _0x3f2f67={'raw':![],'where':{'id':_0x5ddb81[_0x8f82('0x41')]['id']}},_0x3cac15={};_0x3cac15[_0x8f82('0x2b')]=_[_0x8f82('0x42')](db['SugarcrmConfiguration'][_0x8f82('0x28')]);_0x3cac15[_0x8f82('0x2c')]=_['keys'](_0x5ddb81[_0x8f82('0x2c')]);_0x3cac15['filters']=_[_0x8f82('0x2e')](_0x3cac15[_0x8f82('0x2b')],_0x3cac15[_0x8f82('0x2c')]);_0x3f2f67['attributes']=_[_0x8f82('0x2e')](_0x3cac15[_0x8f82('0x2b')],qs[_0x8f82('0x2f')](_0x5ddb81[_0x8f82('0x2c')]['fields']));_0x3f2f67[_0x8f82('0x30')]=_0x3f2f67['attributes'][_0x8f82('0x43')]?_0x3f2f67['attributes']:_0x3cac15['model'];if(_0x5ddb81[_0x8f82('0x2c')][_0x8f82('0x3c')]){_0x3f2f67[_0x8f82('0x3d')]=[{'all':!![]}];}_0x3f2f67=_[_0x8f82('0x38')]({},_0x3f2f67,_0x5ddb81[_0x8f82('0x44')]);return db[_0x8f82('0x3a')][_0x8f82('0x45')](_0x3f2f67)[_0x8f82('0x23')](handleEntityNotFound(_0x86fbb3,null))['then'](respondWithResult(_0x86fbb3,null))[_0x8f82('0x3f')](handleError(_0x86fbb3,null));};exports[_0x8f82('0x46')]=function(_0x29c51b,_0x5a136f){return db[_0x8f82('0x3a')][_0x8f82('0x46')](_0x29c51b[_0x8f82('0x47')],{})[_0x8f82('0x23')](respondWithResult(_0x5a136f,0xc9))[_0x8f82('0x3f')](handleError(_0x5a136f,null));};exports['update']=function(_0x1c8cda,_0x22210d){if(_0x1c8cda[_0x8f82('0x47')]['id']){delete _0x1c8cda[_0x8f82('0x47')]['id'];}return db[_0x8f82('0x3a')][_0x8f82('0x45')]({'where':{'id':_0x1c8cda[_0x8f82('0x41')]['id']}})[_0x8f82('0x23')](handleEntityNotFound(_0x22210d,null))[_0x8f82('0x23')](saveUpdates(_0x1c8cda['body'],null))['then'](respondWithResult(_0x22210d,null))[_0x8f82('0x3f')](handleError(_0x22210d,null));};exports[_0x8f82('0x48')]=function(_0x57c0b7,_0x31583c){return db[_0x8f82('0x3a')][_0x8f82('0x45')]({'where':{'id':_0x57c0b7['params']['id']}})[_0x8f82('0x23')](handleEntityNotFound(_0x31583c,null))[_0x8f82('0x23')](removeEntity(_0x31583c,null))['catch'](handleError(_0x31583c,null));};exports[_0x8f82('0x49')]=function(_0x374cdf,_0xf8e557,_0x10b6f0){var _0x55a87a={};var _0x232135={};var _0x78b29f;var _0x49c7d9;return db['SugarcrmConfiguration'][_0x8f82('0x4a')]({'where':{'id':_0x374cdf['params']['id']}})['then'](handleEntityNotFound(_0xf8e557,null))['then'](function(_0x55d3cf){if(_0x55d3cf){_0x78b29f=_0x55d3cf;_0x232135[_0x8f82('0x2b')]=_[_0x8f82('0x42')](db[_0x8f82('0x4b')][_0x8f82('0x28')]);_0x232135[_0x8f82('0x2c')]=_['keys'](_0x374cdf['query']);_0x232135[_0x8f82('0x2d')]=_[_0x8f82('0x2e')](_0x232135['model'],_0x232135['query']);_0x55a87a['attributes']=_[_0x8f82('0x2e')](_0x232135['model'],qs[_0x8f82('0x2f')](_0x374cdf[_0x8f82('0x2c')]['fields']));_0x55a87a[_0x8f82('0x30')]=_0x55a87a['attributes'][_0x8f82('0x43')]?_0x55a87a['attributes']:_0x232135[_0x8f82('0x2b')];_0x55a87a[_0x8f82('0x33')]=qs[_0x8f82('0x34')](_0x374cdf['query']['sort']);_0x55a87a[_0x8f82('0x35')]=qs[_0x8f82('0x2d')](_['pick'](_0x374cdf[_0x8f82('0x2c')],_0x232135['filters']));if(_0x374cdf[_0x8f82('0x2c')][_0x8f82('0x37')]){_0x55a87a[_0x8f82('0x35')]=_[_0x8f82('0x38')](_0x55a87a[_0x8f82('0x35')],{'$or':_['map'](_0x55a87a['attributes'],function(_0x289db0){var _0x5a87e9={};_0x5a87e9[_0x289db0]={'$like':'%'+_0x374cdf[_0x8f82('0x2c')][_0x8f82('0x37')]+'%'};return _0x5a87e9;})});}_0x55a87a=_[_0x8f82('0x38')]({},_0x55a87a,_0x374cdf[_0x8f82('0x44')]);return _0x78b29f['getFields'](_0x55a87a);}})['then'](function(_0x4bb49e){if(_0x4bb49e){_0x49c7d9=_0x4bb49e[_0x8f82('0x43')];if(!_0x374cdf['query']['hasOwnProperty'](_0x8f82('0x32'))){_0x55a87a[_0x8f82('0x1b')]=qs[_0x8f82('0x1b')](_0x374cdf[_0x8f82('0x2c')][_0x8f82('0x1b')]);_0x55a87a['offset']=qs[_0x8f82('0x1a')](_0x374cdf[_0x8f82('0x2c')][_0x8f82('0x1a')]);}return _0x78b29f[_0x8f82('0x49')](_0x55a87a);}})[_0x8f82('0x23')](function(_0x3e3bf1){if(_0x3e3bf1){return _0x3e3bf1?{'count':_0x49c7d9,'rows':_0x3e3bf1}:null;}})[_0x8f82('0x23')](respondWithResult(_0xf8e557,null))[_0x8f82('0x3f')](handleError(_0xf8e557,null));};exports[_0x8f82('0x4c')]=function(_0x2a0788,_0x2d8251,_0x35cb73){var _0x47ab98={};var _0x2131e9={};var _0x480102;var _0x14c053;return db[_0x8f82('0x3a')][_0x8f82('0x4a')]({'where':{'id':_0x2a0788['params']['id']}})[_0x8f82('0x23')](handleEntityNotFound(_0x2d8251,null))['then'](function(_0x44c4c7){if(_0x44c4c7){_0x480102=_0x44c4c7;_0x2131e9['model']=_[_0x8f82('0x42')](db['SugarcrmField'][_0x8f82('0x28')]);_0x2131e9[_0x8f82('0x2c')]=_['keys'](_0x2a0788['query']);_0x2131e9['filters']=_['intersection'](_0x2131e9[_0x8f82('0x2b')],_0x2131e9[_0x8f82('0x2c')]);_0x47ab98[_0x8f82('0x30')]=_['intersection'](_0x2131e9[_0x8f82('0x2b')],qs['fields'](_0x2a0788[_0x8f82('0x2c')][_0x8f82('0x2f')]));_0x47ab98[_0x8f82('0x30')]=_0x47ab98[_0x8f82('0x30')][_0x8f82('0x43')]?_0x47ab98[_0x8f82('0x30')]:_0x2131e9[_0x8f82('0x2b')];_0x47ab98[_0x8f82('0x33')]=qs[_0x8f82('0x34')](_0x2a0788[_0x8f82('0x2c')][_0x8f82('0x34')]);_0x47ab98['where']=qs[_0x8f82('0x2d')](_[_0x8f82('0x36')](_0x2a0788[_0x8f82('0x2c')],_0x2131e9[_0x8f82('0x2d')]));if(_0x2a0788[_0x8f82('0x2c')]['filter']){_0x47ab98['where']=_[_0x8f82('0x38')](_0x47ab98[_0x8f82('0x35')],{'$or':_[_0x8f82('0x27')](_0x47ab98['attributes'],function(_0x35048d){var _0x54fad0={};_0x54fad0[_0x35048d]={'$like':'%'+_0x2a0788[_0x8f82('0x2c')][_0x8f82('0x37')]+'%'};return _0x54fad0;})});}_0x47ab98=_[_0x8f82('0x38')]({},_0x47ab98,_0x2a0788[_0x8f82('0x44')]);return _0x480102[_0x8f82('0x4c')](_0x47ab98);}})[_0x8f82('0x23')](function(_0x185aaf){if(_0x185aaf){_0x14c053=_0x185aaf[_0x8f82('0x43')];if(!_0x2a0788[_0x8f82('0x2c')][_0x8f82('0x31')]('nolimit')){_0x47ab98[_0x8f82('0x1b')]=qs['limit'](_0x2a0788[_0x8f82('0x2c')][_0x8f82('0x1b')]);_0x47ab98[_0x8f82('0x1a')]=qs[_0x8f82('0x1a')](_0x2a0788[_0x8f82('0x2c')]['offset']);}return _0x480102[_0x8f82('0x4c')](_0x47ab98);}})[_0x8f82('0x23')](function(_0x5d1868){if(_0x5d1868){return _0x5d1868?{'count':_0x14c053,'rows':_0x5d1868}:null;}})['then'](respondWithResult(_0x2d8251,null))['catch'](handleError(_0x2d8251,null));};exports[_0x8f82('0x4d')]=function(_0xf0a09c,_0x31e1be,_0x1de8cd){var _0x4484ff={};var _0x5d8457={};var _0x155dac;var _0x4277cb;return db[_0x8f82('0x3a')]['findOne']({'where':{'id':_0xf0a09c[_0x8f82('0x41')]['id']}})[_0x8f82('0x23')](handleEntityNotFound(_0x31e1be,null))[_0x8f82('0x23')](function(_0x215fe7){if(_0x215fe7){_0x155dac=_0x215fe7;_0x5d8457[_0x8f82('0x2b')]=_[_0x8f82('0x42')](db['SugarcrmField'][_0x8f82('0x28')]);_0x5d8457['query']=_[_0x8f82('0x42')](_0xf0a09c['query']);_0x5d8457[_0x8f82('0x2d')]=_[_0x8f82('0x2e')](_0x5d8457[_0x8f82('0x2b')],_0x5d8457[_0x8f82('0x2c')]);_0x4484ff[_0x8f82('0x30')]=_[_0x8f82('0x2e')](_0x5d8457[_0x8f82('0x2b')],qs[_0x8f82('0x2f')](_0xf0a09c[_0x8f82('0x2c')][_0x8f82('0x2f')]));_0x4484ff[_0x8f82('0x30')]=_0x4484ff[_0x8f82('0x30')][_0x8f82('0x43')]?_0x4484ff[_0x8f82('0x30')]:_0x5d8457['model'];_0x4484ff['order']=qs['sort'](_0xf0a09c['query'][_0x8f82('0x34')]);_0x4484ff[_0x8f82('0x35')]=qs[_0x8f82('0x2d')](_[_0x8f82('0x36')](_0xf0a09c[_0x8f82('0x2c')],_0x5d8457['filters']));if(_0xf0a09c['query']['filter']){_0x4484ff[_0x8f82('0x35')]=_[_0x8f82('0x38')](_0x4484ff[_0x8f82('0x35')],{'$or':_[_0x8f82('0x27')](_0x4484ff[_0x8f82('0x30')],function(_0x1ae064){var _0x1bdfdb={};_0x1bdfdb[_0x1ae064]={'$like':'%'+_0xf0a09c[_0x8f82('0x2c')][_0x8f82('0x37')]+'%'};return _0x1bdfdb;})});}_0x4484ff=_[_0x8f82('0x38')]({},_0x4484ff,_0xf0a09c[_0x8f82('0x44')]);return _0x155dac[_0x8f82('0x4d')](_0x4484ff);}})[_0x8f82('0x23')](function(_0x138af7){if(_0x138af7){_0x4277cb=_0x138af7[_0x8f82('0x43')];if(!_0xf0a09c['query']['hasOwnProperty'](_0x8f82('0x32'))){_0x4484ff[_0x8f82('0x1b')]=qs[_0x8f82('0x1b')](_0xf0a09c['query'][_0x8f82('0x1b')]);_0x4484ff[_0x8f82('0x1a')]=qs[_0x8f82('0x1a')](_0xf0a09c['query'][_0x8f82('0x1a')]);}return _0x155dac['getDescriptions'](_0x4484ff);}})[_0x8f82('0x23')](function(_0x54e1e1){if(_0x54e1e1){return _0x54e1e1?{'count':_0x4277cb,'rows':_0x54e1e1}:null;}})[_0x8f82('0x23')](respondWithResult(_0x31e1be,null))['catch'](handleError(_0x31e1be,null));};
\ No newline at end of file
index 2949602..f5284be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0de4=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0de4,0xea));var _0x40de=function(_0x5e42fd,_0x2cd04a){_0x5e42fd=_0x5e42fd-0x0;var _0x53cd8e=_0x0de4[_0x5e42fd];return _0x53cd8e;};'use strict';var _=require(_0x40de('0x0'));var util=require(_0x40de('0x1'));var logger=require(_0x40de('0x2'))(_0x40de('0x3'));var moment=require(_0x40de('0x4'));var BPromise=require(_0x40de('0x5'));var rp=require(_0x40de('0x6'));var fs=require('fs');var path=require(_0x40de('0x7'));var rimraf=require(_0x40de('0x8'));var config=require(_0x40de('0x9'));var attributes=require(_0x40de('0xa'));module[_0x40de('0xb')]=function(_0x1c8d48,_0xa8564){return _0x1c8d48[_0x40de('0xc')](_0x40de('0xd'),attributes,{'tableName':_0x40de('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8323=['bluebird','request-promise','path','exports','define','SugarcrmConfiguration','lodash','util','api','moment'];(function(_0x2b66ed,_0x3ece7f){var _0x860fe6=function(_0x5a2ff7){while(--_0x5a2ff7){_0x2b66ed['push'](_0x2b66ed['shift']());}};_0x860fe6(++_0x3ece7f);}(_0x8323,0x150));var _0x3832=function(_0x40979f,_0x4a2427){_0x40979f=_0x40979f-0x0;var _0x31db53=_0x8323[_0x40979f];return _0x31db53;};'use strict';var _=require(_0x3832('0x0'));var util=require(_0x3832('0x1'));var logger=require('../../config/logger')(_0x3832('0x2'));var moment=require(_0x3832('0x3'));var BPromise=require(_0x3832('0x4'));var rp=require(_0x3832('0x5'));var fs=require('fs');var path=require(_0x3832('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x3832('0x7')]=function(_0x4370cb,_0xa2ec8a){return _0x4370cb[_0x3832('0x8')](_0x3832('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 164e068..f7123f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb109=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5c6210,_0x1310b7){var _0xe4c7a1=function(_0x1fa4c9){while(--_0x1fa4c9){_0x5c6210['push'](_0x5c6210['shift']());}};_0xe4c7a1(++_0x1310b7);}(_0xb109,0xc4));var _0x9b10=function(_0x5b323e,_0x137407){_0x5b323e=_0x5b323e-0x0;var _0x4fa5df=_0xb109[_0x5b323e];return _0x4fa5df;};'use strict';var _=require(_0x9b10('0x0'));var util=require(_0x9b10('0x1'));var moment=require('moment');var BPromise=require(_0x9b10('0x2'));var rs=require(_0x9b10('0x3'));var fs=require('fs');var Redis=require(_0x9b10('0x4'));var db=require(_0x9b10('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b10('0x6'))(_0x9b10('0x7'));var config=require(_0x9b10('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9b10('0x9')][_0x9b10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x990f7b,_0x298de0,_0xb4d7e5){return new BPromise(function(_0x386554,_0x3e3d35){return client['request'](_0x990f7b,_0xb4d7e5)[_0x9b10('0xb')](function(_0xa1105c){logger[_0x9b10('0xc')](_0x9b10('0xd'),_0x298de0,_0x9b10('0xe'));logger[_0x9b10('0xf')](_0x9b10('0x10'),_0x298de0,_0x9b10('0xe'),JSON[_0x9b10('0x11')](_0xa1105c));if(_0xa1105c[_0x9b10('0x12')]){if(_0xa1105c['error'][_0x9b10('0x13')]===0x1f4){logger[_0x9b10('0x12')](_0x9b10('0xd'),_0x298de0,_0xa1105c[_0x9b10('0x12')][_0x9b10('0x14')]);return _0x3e3d35(_0xa1105c[_0x9b10('0x12')][_0x9b10('0x14')]);}logger['error'](_0x9b10('0xd'),_0x298de0,_0xa1105c[_0x9b10('0x12')]['message']);return _0x386554(_0xa1105c[_0x9b10('0x12')][_0x9b10('0x14')]);}else{logger['info'](_0x9b10('0xd'),_0x298de0,_0x9b10('0xe'));_0x386554(_0xa1105c[_0x9b10('0x15')][_0x9b10('0x14')]);}})[_0x9b10('0x16')](function(_0x37aa60){logger[_0x9b10('0x12')](_0x9b10('0xd'),_0x298de0,_0x37aa60);_0x3e3d35(_0x37aa60);});});}
\ No newline at end of file
+var _0x893c=['../../config/environment','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x333d25,_0x248bbc){var _0x5d084f=function(_0x28175f){while(--_0x28175f){_0x333d25['push'](_0x333d25['shift']());}};_0x5d084f(++_0x248bbc);}(_0x893c,0xc6));var _0xc893=function(_0x27dc6f,_0x5dbea8){_0x27dc6f=_0x27dc6f-0x0;var _0x461137=_0x893c[_0x27dc6f];return _0x461137;};'use strict';var _=require(_0xc893('0x0'));var util=require(_0xc893('0x1'));var moment=require(_0xc893('0x2'));var BPromise=require(_0xc893('0x3'));var rs=require(_0xc893('0x4'));var fs=require('fs');var Redis=require(_0xc893('0x5'));var db=require(_0xc893('0x6'))['db'];var utils=require(_0xc893('0x7'));var logger=require(_0xc893('0x8'))('rpc');var config=require(_0xc893('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc893('0xa')][_0xc893('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe0ccc2,_0x1d2e27,_0x4c69cb){return new BPromise(function(_0x2429db,_0x329bc5){return client['request'](_0xe0ccc2,_0x4c69cb)[_0xc893('0xc')](function(_0x5784c1){logger[_0xc893('0xd')](_0xc893('0xe'),_0x1d2e27,_0xc893('0xf'));logger[_0xc893('0x10')](_0xc893('0x11'),_0x1d2e27,_0xc893('0xf'),JSON[_0xc893('0x12')](_0x5784c1));if(_0x5784c1[_0xc893('0x13')]){if(_0x5784c1[_0xc893('0x13')][_0xc893('0x14')]===0x1f4){logger['error'](_0xc893('0xe'),_0x1d2e27,_0x5784c1[_0xc893('0x13')][_0xc893('0x15')]);return _0x329bc5(_0x5784c1[_0xc893('0x13')][_0xc893('0x15')]);}logger[_0xc893('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1d2e27,_0x5784c1[_0xc893('0x13')][_0xc893('0x15')]);return _0x2429db(_0x5784c1['error'][_0xc893('0x15')]);}else{logger[_0xc893('0xd')](_0xc893('0xe'),_0x1d2e27,'request\x20sent');_0x2429db(_0x5784c1['result'][_0xc893('0x15')]);}})[_0xc893('0x16')](function(_0x552e27){logger['error'](_0xc893('0xe'),_0x1d2e27,_0x552e27);_0x329bc5(_0x552e27);});});}
\ No newline at end of file
index 379cfb0..32f92d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb32=['put','delete','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','show','post','isAuthenticated','create'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xeb32,0xc2));var _0x2eb3=function(_0x34917c,_0x5801f6){_0x34917c=_0x34917c-0x0;var _0x2d5d32=_0xeb32[_0x34917c];return _0x2d5d32;};'use strict';var multer=require(_0x2eb3('0x0'));var util=require(_0x2eb3('0x1'));var path=require('path');var timeout=require(_0x2eb3('0x2'));var express=require('express');var router=express[_0x2eb3('0x3')]();var fs_extra=require(_0x2eb3('0x4'));var auth=require(_0x2eb3('0x5'));var interaction=require(_0x2eb3('0x6'));var config=require(_0x2eb3('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2eb3('0x8')]);router['get'](_0x2eb3('0x9'),auth['isAuthenticated'](),controller[_0x2eb3('0xa')]);router[_0x2eb3('0xb')]('/',auth[_0x2eb3('0xc')](),controller[_0x2eb3('0xd')]);router[_0x2eb3('0xe')](_0x2eb3('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x2eb3('0xf')](_0x2eb3('0x9'),auth[_0x2eb3('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x101f=['/:id','create','put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index'];(function(_0xf7e6d9,_0xd2d728){var _0x2fed24=function(_0x2123d2){while(--_0x2123d2){_0xf7e6d9['push'](_0xf7e6d9['shift']());}};_0x2fed24(++_0xd2d728);}(_0x101f,0x180));var _0xf101=function(_0xefc793,_0x5a5199){_0xefc793=_0xefc793-0x0;var _0x37e31b=_0x101f[_0xefc793];return _0x37e31b;};'use strict';var multer=require(_0xf101('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf101('0x1'));var express=require(_0xf101('0x2'));var router=express[_0xf101('0x3')]();var fs_extra=require(_0xf101('0x4'));var auth=require(_0xf101('0x5'));var interaction=require(_0xf101('0x6'));var config=require(_0xf101('0x7'));var controller=require(_0xf101('0x8'));router[_0xf101('0x9')]('/',auth[_0xf101('0xa')](),controller[_0xf101('0xb')]);router[_0xf101('0x9')](_0xf101('0xc'),auth[_0xf101('0xa')](),controller['show']);router['post']('/',auth[_0xf101('0xa')](),controller[_0xf101('0xd')]);router[_0xf101('0xe')](_0xf101('0xc'),auth[_0xf101('0xa')](),controller[_0xf101('0xf')]);router[_0xf101('0x10')](_0xf101('0xc'),auth[_0xf101('0xa')](),controller[_0xf101('0x11')]);module['exports']=router;
\ No newline at end of file
index 52639e6..8138df8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9125=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x55c1e2,_0x49314a){var _0x47548c=function(_0xb0415d){while(--_0xb0415d){_0x55c1e2['push'](_0x55c1e2['shift']());}};_0x47548c(++_0x49314a);}(_0x9125,0xba));var _0x5912=function(_0x375efe,_0x27df2d){_0x375efe=_0x375efe-0x0;var _0x1d5db6=_0x9125[_0x375efe];return _0x1d5db6;};'use strict';var Sequelize=require(_0x5912('0x0'));module[_0x5912('0x1')]={'type':{'type':Sequelize[_0x5912('0x2')](_0x5912('0x3'),_0x5912('0x4'),_0x5912('0x5'),_0x5912('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5912('0x7')]},'keyType':{'type':Sequelize[_0x5912('0x2')](_0x5912('0x3'),_0x5912('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x5912('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5912('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5912('0x7')]}};
\ No newline at end of file
+var _0x5f74=['ENUM','string','variable','customVariable','STRING','sequelize','exports'];(function(_0x5d631e,_0x328c72){var _0x1d2650=function(_0x3aba0b){while(--_0x3aba0b){_0x5d631e['push'](_0x5d631e['shift']());}};_0x1d2650(++_0x328c72);}(_0x5f74,0xec));var _0x45f7=function(_0x4263d9,_0x1675ea){_0x4263d9=_0x4263d9-0x0;var _0x9807f5=_0x5f74[_0x4263d9];return _0x9807f5;};'use strict';var Sequelize=require(_0x45f7('0x0'));module[_0x45f7('0x1')]={'type':{'type':Sequelize[_0x45f7('0x2')](_0x45f7('0x3'),_0x45f7('0x4'),_0x45f7('0x5'),'keyValue','picklist'),'defaultValue':_0x45f7('0x3')},'content':{'type':Sequelize[_0x45f7('0x6')]},'key':{'type':Sequelize[_0x45f7('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x45f7('0x3'),'variable',_0x45f7('0x5'))},'keyContent':{'type':Sequelize[_0x45f7('0x6')]},'idField':{'type':Sequelize[_0x45f7('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x45f7('0x6')]}};
\ No newline at end of file
index 628cb9d..e0b1c00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bc2=['status','set','Content-Range','save','update','then','error','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','fields','include','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit'];(function(_0x5097f1,_0x635010){var _0x31f89e=function(_0x19a587){while(--_0x19a587){_0x5097f1['push'](_0x5097f1['shift']());}};_0x31f89e(++_0x635010);}(_0x5bc2,0xc7));var _0x25bc=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x5bc2[_0x10004e];return _0x5af990;};'use strict';var emlformat=require(_0x25bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x25bc('0x1'));var jsonpatch=require(_0x25bc('0x2'));var rp=require('request-promise');var moment=require(_0x25bc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x25bc('0x4'));var util=require(_0x25bc('0x5'));var path=require(_0x25bc('0x6'));var sox=require(_0x25bc('0x7'));var csv=require(_0x25bc('0x8'));var ejs=require(_0x25bc('0x9'));var fs=require('fs');var fs_extra=require(_0x25bc('0xa'));var _=require(_0x25bc('0xb'));var squel=require(_0x25bc('0xc'));var crypto=require(_0x25bc('0xd'));var jsforce=require(_0x25bc('0xe'));var deskjs=require(_0x25bc('0xf'));var toCsv=require(_0x25bc('0x8'));var querystring=require('querystring');var Papa=require(_0x25bc('0x10'));var Redis=require(_0x25bc('0x11'));var authService=require(_0x25bc('0x12'));var qs=require(_0x25bc('0x13'));var as=require(_0x25bc('0x14'));var hardwareService=require(_0x25bc('0x15'));var logger=require(_0x25bc('0x16'))(_0x25bc('0x17'));var utils=require(_0x25bc('0x18'));var config=require(_0x25bc('0x19'));var licenseUtil=require(_0x25bc('0x1a'));var db=require(_0x25bc('0x1b'))['db'];function respondWithStatusCode(_0x38b9da,_0x3ca386){_0x3ca386=_0x3ca386||0xcc;return function(_0x1e8001){if(_0x1e8001){return _0x38b9da[_0x25bc('0x1c')](_0x3ca386);}return _0x38b9da['status'](_0x3ca386)[_0x25bc('0x1d')]();};}function respondWithResult(_0x21a602,_0x3f42c2){_0x3f42c2=_0x3f42c2||0xc8;return function(_0x11cc48){if(_0x11cc48){return _0x21a602['status'](_0x3f42c2)[_0x25bc('0x1e')](_0x11cc48);}};}function respondWithFilteredResult(_0x2a71a7,_0x49ff24){return function(_0x33cbae){if(_0x33cbae){var _0x1c7a00=typeof _0x49ff24[_0x25bc('0x1f')]===_0x25bc('0x20')&&typeof _0x49ff24['limit']===_0x25bc('0x20');var _0x3f56b8=_0x33cbae[_0x25bc('0x21')];var _0x21a60c=_0x1c7a00?0x0:_0x49ff24[_0x25bc('0x1f')];var _0x3c5a7f=_0x1c7a00?_0x33cbae[_0x25bc('0x21')]:_0x49ff24[_0x25bc('0x1f')]+_0x49ff24[_0x25bc('0x22')];var _0x5a8d98;if(_0x3c5a7f>=_0x3f56b8){_0x3c5a7f=_0x3f56b8;_0x5a8d98=0xc8;}else{_0x5a8d98=0xce;}_0x2a71a7[_0x25bc('0x23')](_0x5a8d98);return _0x2a71a7[_0x25bc('0x24')](_0x25bc('0x25'),_0x21a60c+'-'+_0x3c5a7f+'/'+_0x3f56b8)[_0x25bc('0x1e')](_0x33cbae);}return null;};}function patchUpdates(_0x2203d3){return function(_0x203580){try{jsonpatch['apply'](_0x203580,_0x2203d3,!![]);}catch(_0x3046fd){return BPromise['reject'](_0x3046fd);}return _0x203580[_0x25bc('0x26')]();};}function saveUpdates(_0x340bb0,_0x493b5a){return function(_0x42303d){if(_0x42303d){return _0x42303d[_0x25bc('0x27')](_0x340bb0)[_0x25bc('0x28')](function(_0x3135d1){return _0x3135d1;});}return null;};}function removeEntity(_0x55de69,_0x373856){return function(_0xa4cc93){if(_0xa4cc93){return _0xa4cc93['destroy']()[_0x25bc('0x28')](function(){_0x55de69[_0x25bc('0x23')](0xcc)[_0x25bc('0x1d')]();});}};}function handleEntityNotFound(_0x11d515,_0x23d8d5){return function(_0x14b96b){if(!_0x14b96b){_0x11d515[_0x25bc('0x1c')](0x194);}return _0x14b96b;};}function handleError(_0x291a74,_0x132d95){_0x132d95=_0x132d95||0x1f4;return function(_0x4d04bf){logger[_0x25bc('0x29')](_0x4d04bf['stack']);if(_0x4d04bf[_0x25bc('0x2a')]){delete _0x4d04bf['name'];}_0x291a74['status'](_0x132d95)[_0x25bc('0x2b')](_0x4d04bf);};}exports[_0x25bc('0x2c')]=function(_0x3dd76e,_0x277297){var _0x4bd107={},_0x24f4df={},_0x403778={'count':0x0,'rows':[]};var _0x2494eb=_[_0x25bc('0x2d')](db[_0x25bc('0x2e')][_0x25bc('0x2f')],function(_0x1a2e6d){return{'name':_0x1a2e6d[_0x25bc('0x30')],'type':_0x1a2e6d[_0x25bc('0x31')][_0x25bc('0x32')]};});_0x24f4df['model']=_['map'](_0x2494eb,'name');_0x24f4df[_0x25bc('0x33')]=_[_0x25bc('0x34')](_0x3dd76e['query']);_0x24f4df[_0x25bc('0x35')]=_['intersection'](_0x24f4df[_0x25bc('0x36')],_0x24f4df[_0x25bc('0x33')]);_0x4bd107[_0x25bc('0x37')]=_[_0x25bc('0x38')](_0x24f4df[_0x25bc('0x36')],qs['fields'](_0x3dd76e[_0x25bc('0x33')]['fields']));_0x4bd107['attributes']=_0x4bd107[_0x25bc('0x37')][_0x25bc('0x39')]?_0x4bd107[_0x25bc('0x37')]:_0x24f4df[_0x25bc('0x36')];if(!_0x3dd76e[_0x25bc('0x33')][_0x25bc('0x3a')](_0x25bc('0x3b'))){_0x4bd107[_0x25bc('0x22')]=qs['limit'](_0x3dd76e[_0x25bc('0x33')]['limit']);_0x4bd107[_0x25bc('0x1f')]=qs[_0x25bc('0x1f')](_0x3dd76e[_0x25bc('0x33')][_0x25bc('0x1f')]);}_0x4bd107[_0x25bc('0x3c')]=qs[_0x25bc('0x3d')](_0x3dd76e[_0x25bc('0x33')][_0x25bc('0x3d')]);_0x4bd107[_0x25bc('0x3e')]=qs['filters'](_[_0x25bc('0x3f')](_0x3dd76e[_0x25bc('0x33')],_0x24f4df[_0x25bc('0x35')]),_0x2494eb);if(_0x3dd76e[_0x25bc('0x33')][_0x25bc('0x40')]){_0x4bd107[_0x25bc('0x3e')]=_[_0x25bc('0x41')](_0x4bd107[_0x25bc('0x3e')],{'$or':_[_0x25bc('0x2d')](_0x2494eb,function(_0x246036){if(_0x246036[_0x25bc('0x31')]!==_0x25bc('0x42')){var _0x249987={};_0x249987[_0x246036[_0x25bc('0x2a')]]={'$like':'%'+_0x3dd76e[_0x25bc('0x33')][_0x25bc('0x40')]+'%'};return _0x249987;}})});}_0x4bd107=_[_0x25bc('0x41')]({},_0x4bd107,_0x3dd76e[_0x25bc('0x43')]);var _0x481862={'where':_0x4bd107[_0x25bc('0x3e')]};return db['SugarcrmField'][_0x25bc('0x21')](_0x481862)[_0x25bc('0x28')](function(_0x3f5b6c){_0x403778[_0x25bc('0x21')]=_0x3f5b6c;if(_0x3dd76e[_0x25bc('0x33')]['includeAll']){_0x4bd107['include']=[{'all':!![]}];}return db[_0x25bc('0x2e')][_0x25bc('0x44')](_0x4bd107);})[_0x25bc('0x28')](function(_0x493ff4){_0x403778['rows']=_0x493ff4;return _0x403778;})[_0x25bc('0x28')](respondWithFilteredResult(_0x277297,_0x4bd107))[_0x25bc('0x45')](handleError(_0x277297,null));};exports[_0x25bc('0x46')]=function(_0x17627c,_0x26e83e){var _0x5e9cc7={'raw':!![],'where':{'id':_0x17627c[_0x25bc('0x47')]['id']}},_0x308ea3={};_0x308ea3[_0x25bc('0x36')]=_[_0x25bc('0x34')](db[_0x25bc('0x2e')][_0x25bc('0x2f')]);_0x308ea3['query']=_[_0x25bc('0x34')](_0x17627c[_0x25bc('0x33')]);_0x308ea3['filters']=_[_0x25bc('0x38')](_0x308ea3[_0x25bc('0x36')],_0x308ea3[_0x25bc('0x33')]);_0x5e9cc7[_0x25bc('0x37')]=_[_0x25bc('0x38')](_0x308ea3[_0x25bc('0x36')],qs[_0x25bc('0x48')](_0x17627c['query'][_0x25bc('0x48')]));_0x5e9cc7[_0x25bc('0x37')]=_0x5e9cc7[_0x25bc('0x37')][_0x25bc('0x39')]?_0x5e9cc7[_0x25bc('0x37')]:_0x308ea3['model'];if(_0x17627c[_0x25bc('0x33')]['includeAll']){_0x5e9cc7[_0x25bc('0x49')]=[{'all':!![]}];}_0x5e9cc7=_['merge']({},_0x5e9cc7,_0x17627c[_0x25bc('0x43')]);return db[_0x25bc('0x2e')][_0x25bc('0x4a')](_0x5e9cc7)[_0x25bc('0x28')](handleEntityNotFound(_0x26e83e,null))[_0x25bc('0x28')](respondWithResult(_0x26e83e,null))[_0x25bc('0x45')](handleError(_0x26e83e,null));};exports['create']=function(_0x31e497,_0x2da7eb){return db[_0x25bc('0x2e')][_0x25bc('0x4b')](_0x31e497[_0x25bc('0x4c')],{})[_0x25bc('0x28')](respondWithResult(_0x2da7eb,0xc9))[_0x25bc('0x45')](handleError(_0x2da7eb,null));};exports[_0x25bc('0x27')]=function(_0x73ee3e,_0x47b307){if(_0x73ee3e[_0x25bc('0x4c')]['id']){delete _0x73ee3e[_0x25bc('0x4c')]['id'];}return db[_0x25bc('0x2e')]['find']({'where':{'id':_0x73ee3e['params']['id']}})[_0x25bc('0x28')](handleEntityNotFound(_0x47b307,null))['then'](saveUpdates(_0x73ee3e[_0x25bc('0x4c')],null))[_0x25bc('0x28')](respondWithResult(_0x47b307,null))[_0x25bc('0x45')](handleError(_0x47b307,null));};exports[_0x25bc('0x4d')]=function(_0x3ce9cb,_0x4a8a8b){return db['SugarcrmField']['find']({'where':{'id':_0x3ce9cb[_0x25bc('0x47')]['id']}})[_0x25bc('0x28')](handleEntityNotFound(_0x4a8a8b,null))['then'](removeEntity(_0x4a8a8b,null))[_0x25bc('0x45')](handleError(_0x4a8a8b,null));};
\ No newline at end of file
+var _0x431f=['util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SugarcrmField','includeAll','findAll','rows','catch','show','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x4e68f8,_0x4592f8){var _0x253218=function(_0x35d12f){while(--_0x35d12f){_0x4e68f8['push'](_0x4e68f8['shift']());}};_0x253218(++_0x4592f8);}(_0x431f,0xde));var _0xf431=function(_0x586d12,_0x44383c){_0x586d12=_0x586d12-0x0;var _0x217a33=_0x431f[_0x586d12];return _0x217a33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf431('0x0'));var zipdir=require(_0xf431('0x1'));var jsonpatch=require(_0xf431('0x2'));var rp=require(_0xf431('0x3'));var moment=require(_0xf431('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf431('0x5'));var util=require(_0xf431('0x6'));var path=require(_0xf431('0x7'));var sox=require('sox');var csv=require(_0xf431('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf431('0x9'));var _=require('lodash');var squel=require(_0xf431('0xa'));var crypto=require(_0xf431('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf431('0xc'));var toCsv=require(_0xf431('0x8'));var querystring=require('querystring');var Papa=require(_0xf431('0xd'));var Redis=require(_0xf431('0xe'));var authService=require(_0xf431('0xf'));var qs=require(_0xf431('0x10'));var as=require(_0xf431('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf431('0x12'));var utils=require(_0xf431('0x13'));var config=require(_0xf431('0x14'));var licenseUtil=require(_0xf431('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25cb4d,_0x137835){_0x137835=_0x137835||0xcc;return function(_0x2233e1){if(_0x2233e1){return _0x25cb4d[_0xf431('0x16')](_0x137835);}return _0x25cb4d[_0xf431('0x17')](_0x137835)[_0xf431('0x18')]();};}function respondWithResult(_0x27bb8f,_0x26d5d2){_0x26d5d2=_0x26d5d2||0xc8;return function(_0x4f1910){if(_0x4f1910){return _0x27bb8f[_0xf431('0x17')](_0x26d5d2)[_0xf431('0x19')](_0x4f1910);}};}function respondWithFilteredResult(_0x260ec5,_0x412237){return function(_0x2a4e7d){if(_0x2a4e7d){var _0x42eb21=typeof _0x412237[_0xf431('0x1a')]===_0xf431('0x1b')&&typeof _0x412237[_0xf431('0x1c')]==='undefined';var _0x51b8c7=_0x2a4e7d['count'];var _0x370602=_0x42eb21?0x0:_0x412237['offset'];var _0x3fd7a2=_0x42eb21?_0x2a4e7d[_0xf431('0x1d')]:_0x412237[_0xf431('0x1a')]+_0x412237[_0xf431('0x1c')];var _0x42f1ef;if(_0x3fd7a2>=_0x51b8c7){_0x3fd7a2=_0x51b8c7;_0x42f1ef=0xc8;}else{_0x42f1ef=0xce;}_0x260ec5[_0xf431('0x17')](_0x42f1ef);return _0x260ec5[_0xf431('0x1e')]('Content-Range',_0x370602+'-'+_0x3fd7a2+'/'+_0x51b8c7)[_0xf431('0x19')](_0x2a4e7d);}return null;};}function patchUpdates(_0xa194b8){return function(_0x5ec6c0){try{jsonpatch[_0xf431('0x1f')](_0x5ec6c0,_0xa194b8,!![]);}catch(_0x468556){return BPromise[_0xf431('0x20')](_0x468556);}return _0x5ec6c0[_0xf431('0x21')]();};}function saveUpdates(_0x555681,_0x5a81b9){return function(_0x160bdf){if(_0x160bdf){return _0x160bdf[_0xf431('0x22')](_0x555681)[_0xf431('0x23')](function(_0x3d4dfa){return _0x3d4dfa;});}return null;};}function removeEntity(_0x4efb26,_0x2f881a){return function(_0x5c530f){if(_0x5c530f){return _0x5c530f[_0xf431('0x24')]()[_0xf431('0x23')](function(){_0x4efb26[_0xf431('0x17')](0xcc)[_0xf431('0x18')]();});}};}function handleEntityNotFound(_0x4feaa2,_0x55caa9){return function(_0x1f8b82){if(!_0x1f8b82){_0x4feaa2[_0xf431('0x16')](0x194);}return _0x1f8b82;};}function handleError(_0x440531,_0x24331c){_0x24331c=_0x24331c||0x1f4;return function(_0x6f8b98){logger[_0xf431('0x25')](_0x6f8b98[_0xf431('0x26')]);if(_0x6f8b98[_0xf431('0x27')]){delete _0x6f8b98[_0xf431('0x27')];}_0x440531['status'](_0x24331c)[_0xf431('0x28')](_0x6f8b98);};}exports[_0xf431('0x29')]=function(_0x596984,_0x5dfc06){var _0xef1a5c={},_0x49e16b={},_0x504b4c={'count':0x0,'rows':[]};var _0x580cf3=_[_0xf431('0x2a')](db['SugarcrmField'][_0xf431('0x2b')],function(_0x379452){return{'name':_0x379452[_0xf431('0x2c')],'type':_0x379452[_0xf431('0x2d')][_0xf431('0x2e')]};});_0x49e16b[_0xf431('0x2f')]=_['map'](_0x580cf3,_0xf431('0x27'));_0x49e16b[_0xf431('0x30')]=_[_0xf431('0x31')](_0x596984[_0xf431('0x30')]);_0x49e16b[_0xf431('0x32')]=_[_0xf431('0x33')](_0x49e16b[_0xf431('0x2f')],_0x49e16b['query']);_0xef1a5c[_0xf431('0x34')]=_[_0xf431('0x33')](_0x49e16b[_0xf431('0x2f')],qs[_0xf431('0x35')](_0x596984[_0xf431('0x30')]['fields']));_0xef1a5c[_0xf431('0x34')]=_0xef1a5c[_0xf431('0x34')][_0xf431('0x36')]?_0xef1a5c[_0xf431('0x34')]:_0x49e16b[_0xf431('0x2f')];if(!_0x596984[_0xf431('0x30')][_0xf431('0x37')](_0xf431('0x38'))){_0xef1a5c['limit']=qs[_0xf431('0x1c')](_0x596984[_0xf431('0x30')][_0xf431('0x1c')]);_0xef1a5c['offset']=qs[_0xf431('0x1a')](_0x596984[_0xf431('0x30')][_0xf431('0x1a')]);}_0xef1a5c[_0xf431('0x39')]=qs[_0xf431('0x3a')](_0x596984['query'][_0xf431('0x3a')]);_0xef1a5c[_0xf431('0x3b')]=qs[_0xf431('0x32')](_[_0xf431('0x3c')](_0x596984['query'],_0x49e16b[_0xf431('0x32')]),_0x580cf3);if(_0x596984[_0xf431('0x30')][_0xf431('0x3d')]){_0xef1a5c[_0xf431('0x3b')]=_['merge'](_0xef1a5c[_0xf431('0x3b')],{'$or':_['map'](_0x580cf3,function(_0x4c6cdc){if(_0x4c6cdc[_0xf431('0x2d')]!==_0xf431('0x3e')){var _0x114942={};_0x114942[_0x4c6cdc[_0xf431('0x27')]]={'$like':'%'+_0x596984[_0xf431('0x30')]['filter']+'%'};return _0x114942;}})});}_0xef1a5c=_[_0xf431('0x3f')]({},_0xef1a5c,_0x596984[_0xf431('0x40')]);var _0x3a41ac={'where':_0xef1a5c['where']};return db[_0xf431('0x41')][_0xf431('0x1d')](_0x3a41ac)[_0xf431('0x23')](function(_0x44f5a1){_0x504b4c[_0xf431('0x1d')]=_0x44f5a1;if(_0x596984['query'][_0xf431('0x42')]){_0xef1a5c['include']=[{'all':!![]}];}return db[_0xf431('0x41')][_0xf431('0x43')](_0xef1a5c);})[_0xf431('0x23')](function(_0x472b29){_0x504b4c[_0xf431('0x44')]=_0x472b29;return _0x504b4c;})[_0xf431('0x23')](respondWithFilteredResult(_0x5dfc06,_0xef1a5c))[_0xf431('0x45')](handleError(_0x5dfc06,null));};exports[_0xf431('0x46')]=function(_0x423215,_0x12903d){var _0x4b2daf={'raw':!![],'where':{'id':_0x423215['params']['id']}},_0x4b34b6={};_0x4b34b6[_0xf431('0x2f')]=_[_0xf431('0x31')](db['SugarcrmField'][_0xf431('0x2b')]);_0x4b34b6['query']=_[_0xf431('0x31')](_0x423215['query']);_0x4b34b6[_0xf431('0x32')]=_['intersection'](_0x4b34b6[_0xf431('0x2f')],_0x4b34b6[_0xf431('0x30')]);_0x4b2daf['attributes']=_[_0xf431('0x33')](_0x4b34b6[_0xf431('0x2f')],qs[_0xf431('0x35')](_0x423215[_0xf431('0x30')][_0xf431('0x35')]));_0x4b2daf[_0xf431('0x34')]=_0x4b2daf['attributes'][_0xf431('0x36')]?_0x4b2daf['attributes']:_0x4b34b6[_0xf431('0x2f')];if(_0x423215[_0xf431('0x30')][_0xf431('0x42')]){_0x4b2daf[_0xf431('0x47')]=[{'all':!![]}];}_0x4b2daf=_[_0xf431('0x3f')]({},_0x4b2daf,_0x423215[_0xf431('0x40')]);return db[_0xf431('0x41')][_0xf431('0x48')](_0x4b2daf)[_0xf431('0x23')](handleEntityNotFound(_0x12903d,null))[_0xf431('0x23')](respondWithResult(_0x12903d,null))[_0xf431('0x45')](handleError(_0x12903d,null));};exports[_0xf431('0x49')]=function(_0x30d606,_0x272e36){return db[_0xf431('0x41')][_0xf431('0x49')](_0x30d606[_0xf431('0x4a')],{})[_0xf431('0x23')](respondWithResult(_0x272e36,0xc9))[_0xf431('0x45')](handleError(_0x272e36,null));};exports[_0xf431('0x22')]=function(_0x329cc1,_0x2ba8f1){if(_0x329cc1[_0xf431('0x4a')]['id']){delete _0x329cc1[_0xf431('0x4a')]['id'];}return db[_0xf431('0x41')][_0xf431('0x48')]({'where':{'id':_0x329cc1[_0xf431('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ba8f1,null))[_0xf431('0x23')](saveUpdates(_0x329cc1[_0xf431('0x4a')],null))[_0xf431('0x23')](respondWithResult(_0x2ba8f1,null))[_0xf431('0x45')](handleError(_0x2ba8f1,null));};exports[_0xf431('0x24')]=function(_0x21f723,_0xfe3f32){return db[_0xf431('0x41')]['find']({'where':{'id':_0x21f723[_0xf431('0x4b')]['id']}})[_0xf431('0x23')](handleEntityNotFound(_0xfe3f32,null))['then'](removeEntity(_0xfe3f32,null))[_0xf431('0x45')](handleError(_0xfe3f32,null));};
\ No newline at end of file
index ee51f8d..a33fc6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x068e=['rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x068e,0x180));var _0xe068=function(_0x58e557,_0x2d24e7){_0x58e557=_0x58e557-0x0;var _0x432212=_0x068e[_0x58e557];return _0x432212;};'use strict';var _=require(_0xe068('0x0'));var util=require(_0xe068('0x1'));var logger=require(_0xe068('0x2'))(_0xe068('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe068('0x4'));var fs=require('fs');var path=require(_0xe068('0x5'));var rimraf=require(_0xe068('0x6'));var config=require(_0xe068('0x7'));var attributes=require(_0xe068('0x8'));module[_0xe068('0x9')]=function(_0x3ad1df,_0x3ea57f){return _0x3ad1df['define'](_0xe068('0xa'),attributes,{'tableName':_0xe068('0xb'),'paranoid':![],'indexes':[{'name':_0xe068('0xc'),'fields':[_0xe068('0xd'),_0xe068('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc368=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','lodash','util','../../config/logger','api','bluebird'];(function(_0x3aec8e,_0x5dd749){var _0x598313=function(_0x3c3ac4){while(--_0x3c3ac4){_0x3aec8e['push'](_0x3aec8e['shift']());}};_0x598313(++_0x5dd749);}(_0xc368,0x18e));var _0x8c36=function(_0x50d89f,_0x43bcc6){_0x50d89f=_0x50d89f-0x0;var _0x228769=_0xc368[_0x50d89f];return _0x228769;};'use strict';var _=require(_0x8c36('0x0'));var util=require(_0x8c36('0x1'));var logger=require(_0x8c36('0x2'))(_0x8c36('0x3'));var moment=require('moment');var BPromise=require(_0x8c36('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c36('0x5'));var rimraf=require(_0x8c36('0x6'));var config=require(_0x8c36('0x7'));var attributes=require(_0x8c36('0x8'));module[_0x8c36('0x9')]=function(_0x368583,_0xc059ed){return _0x368583[_0x8c36('0xa')](_0x8c36('0xb'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x8c36('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ce61b40..46109f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x998b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x998b,0x11d));var _0xb998=function(_0x35be2f,_0x672853){_0x35be2f=_0x35be2f-0x0;var _0x489cd5=_0x998b[_0x35be2f];return _0x489cd5;};'use strict';var _=require(_0xb998('0x0'));var util=require('util');var moment=require(_0xb998('0x1'));var BPromise=require(_0xb998('0x2'));var rs=require(_0xb998('0x3'));var fs=require('fs');var Redis=require(_0xb998('0x4'));var db=require(_0xb998('0x5'))['db'];var utils=require(_0xb998('0x6'));var logger=require(_0xb998('0x7'))(_0xb998('0x8'));var config=require(_0xb998('0x9'));var jayson=require(_0xb998('0xa'));var client=jayson[_0xb998('0xb')][_0xb998('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x423d9a,_0x41c433,_0xa60f5b){return new BPromise(function(_0x4806bd,_0x5887e9){return client[_0xb998('0xd')](_0x423d9a,_0xa60f5b)[_0xb998('0xe')](function(_0x56de46){logger[_0xb998('0xf')](_0xb998('0x10'),_0x41c433,_0xb998('0x11'));logger[_0xb998('0x12')](_0xb998('0x13'),_0x41c433,_0xb998('0x11'),JSON['stringify'](_0x56de46));if(_0x56de46[_0xb998('0x14')]){if(_0x56de46[_0xb998('0x14')]['code']===0x1f4){logger['error'](_0xb998('0x10'),_0x41c433,_0x56de46[_0xb998('0x14')]['message']);return _0x5887e9(_0x56de46[_0xb998('0x14')][_0xb998('0x15')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x41c433,_0x56de46[_0xb998('0x14')][_0xb998('0x15')]);return _0x4806bd(_0x56de46[_0xb998('0x14')][_0xb998('0x15')]);}else{logger[_0xb998('0xf')](_0xb998('0x10'),_0x41c433,_0xb998('0x11'));_0x4806bd(_0x56de46[_0xb998('0x16')]['message']);}})[_0xb998('0x17')](function(_0x56ade6){logger['error'](_0xb998('0x10'),_0x41c433,_0x56ade6);_0x5887e9(_0x56ade6);});});}
\ No newline at end of file
+var _0xa2da=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','SugarcrmField,\x20%s,\x20%s','request\x20sent'];(function(_0xdb4955,_0x145b00){var _0x39daf9=function(_0x183327){while(--_0x183327){_0xdb4955['push'](_0xdb4955['shift']());}};_0x39daf9(++_0x145b00);}(_0xa2da,0x70));var _0xaa2d=function(_0x1ff2ec,_0x386e86){_0x1ff2ec=_0x1ff2ec-0x0;var _0x405683=_0xa2da[_0x1ff2ec];return _0x405683;};'use strict';var _=require('lodash');var util=require(_0xaa2d('0x0'));var moment=require(_0xaa2d('0x1'));var BPromise=require(_0xaa2d('0x2'));var rs=require(_0xaa2d('0x3'));var fs=require('fs');var Redis=require(_0xaa2d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa2d('0x5'));var logger=require(_0xaa2d('0x6'))(_0xaa2d('0x7'));var config=require(_0xaa2d('0x8'));var jayson=require(_0xaa2d('0x9'));var client=jayson[_0xaa2d('0xa')][_0xaa2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x433103,_0x4c9020,_0x443d32){return new BPromise(function(_0x41530d,_0x466e77){return client['request'](_0x433103,_0x443d32)['then'](function(_0x470c35){logger['info'](_0xaa2d('0xc'),_0x4c9020,_0xaa2d('0xd'));logger['debug'](_0xaa2d('0xe'),_0x4c9020,'request\x20sent',JSON[_0xaa2d('0xf')](_0x470c35));if(_0x470c35[_0xaa2d('0x10')]){if(_0x470c35[_0xaa2d('0x10')][_0xaa2d('0x11')]===0x1f4){logger[_0xaa2d('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x4c9020,_0x470c35[_0xaa2d('0x10')]['message']);return _0x466e77(_0x470c35[_0xaa2d('0x10')][_0xaa2d('0x12')]);}logger[_0xaa2d('0x10')](_0xaa2d('0xc'),_0x4c9020,_0x470c35[_0xaa2d('0x10')][_0xaa2d('0x12')]);return _0x41530d(_0x470c35[_0xaa2d('0x10')]['message']);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x4c9020,_0xaa2d('0xd'));_0x41530d(_0x470c35[_0xaa2d('0x13')][_0xaa2d('0x12')]);}})[_0xaa2d('0x14')](function(_0x1e78dd){logger[_0xaa2d('0x10')](_0xaa2d('0xc'),_0x4c9020,_0x1e78dd);_0x466e77(_0x1e78dd);});});}
\ No newline at end of file
index 1b5fbb5..83695eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85c2=['get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index'];(function(_0x328d95,_0x1382e9){var _0x121796=function(_0x19a90d){while(--_0x19a90d){_0x328d95['push'](_0x328d95['shift']());}};_0x121796(++_0x1382e9);}(_0x85c2,0x1f0));var _0x285c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x85c2[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x285c('0x0'));var util=require('util');var path=require(_0x285c('0x1'));var timeout=require('connect-timeout');var express=require(_0x285c('0x2'));var router=express['Router']();var fs_extra=require(_0x285c('0x3'));var auth=require(_0x285c('0x4'));var interaction=require(_0x285c('0x5'));var config=require(_0x285c('0x6'));var controller=require(_0x285c('0x7'));router['get']('/',auth[_0x285c('0x8')](),controller[_0x285c('0x9')]);router[_0x285c('0xa')](_0x285c('0xb'),auth['isAuthenticated'](),controller[_0x285c('0xc')]);router[_0x285c('0xa')](_0x285c('0xd'),auth[_0x285c('0x8')](),controller[_0x285c('0xe')]);router[_0x285c('0xa')]('/:id/fields',auth[_0x285c('0x8')](),controller[_0x285c('0xf')]);router[_0x285c('0x10')]('/',auth[_0x285c('0x8')](),controller[_0x285c('0x11')]);router[_0x285c('0x10')](_0x285c('0xd'),auth[_0x285c('0x8')](),controller['addConfiguration']);router[_0x285c('0x12')](_0x285c('0xb'),auth['isAuthenticated'](),controller[_0x285c('0x13')]);router[_0x285c('0x14')](_0x285c('0xb'),auth[_0x285c('0x8')](),controller[_0x285c('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x594d=['isAuthenticated','show','getConfigurations','/:id/fields','post','create','addConfiguration','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','/:id'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x594d,0x172));var _0xd594=function(_0x38036b,_0x540584){_0x38036b=_0x38036b-0x0;var _0x3f8528=_0x594d[_0x38036b];return _0x3f8528;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd594('0x0'));var timeout=require(_0xd594('0x1'));var express=require(_0xd594('0x2'));var router=express[_0xd594('0x3')]();var fs_extra=require(_0xd594('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd594('0x5'));var config=require(_0xd594('0x6'));var controller=require(_0xd594('0x7'));router[_0xd594('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd594('0x9'),auth[_0xd594('0xa')](),controller[_0xd594('0xb')]);router[_0xd594('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd594('0xc')]);router[_0xd594('0x8')](_0xd594('0xd'),auth[_0xd594('0xa')](),controller['getFields']);router[_0xd594('0xe')]('/',auth[_0xd594('0xa')](),controller[_0xd594('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xd594('0x10')]);router['put'](_0xd594('0x9'),auth[_0xd594('0xa')](),controller[_0xd594('0x11')]);router['delete'](_0xd594('0x9'),auth['isAuthenticated'](),controller[_0xd594('0x12')]);module[_0xd594('0x13')]=router;
\ No newline at end of file
index e574ab5..aaf88fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedf9=['STRING','HelpDesk','sequelize','exports'];(function(_0x2ba136,_0x100663){var _0x57400c=function(_0x5e1637){while(--_0x5e1637){_0x2ba136['push'](_0x2ba136['shift']());}};_0x57400c(++_0x100663);}(_0xedf9,0x14a));var _0x9edf=function(_0x5bde88,_0x2a5f6d){_0x5bde88=_0x5bde88-0x0;var _0x1a6aff=_0xedf9[_0x5bde88];return _0x1a6aff;};'use strict';var Sequelize=require(_0x9edf('0x0'));module[_0x9edf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9edf('0x2')]},'username':{'type':Sequelize[_0x9edf('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x9edf('0x2')],'allowNull':![],'defaultValue':_0x9edf('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x9edf('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x9edf('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x44d8=['STRING','HelpDesk','exports'];(function(_0xa14d8c,_0x14759b){var _0x3facda=function(_0x13c866){while(--_0x13c866){_0xa14d8c['push'](_0xa14d8c['shift']());}};_0x3facda(++_0x14759b);}(_0x44d8,0x1ee));var _0x844d=function(_0x21aba4,_0x9665b8){_0x21aba4=_0x21aba4-0x0;var _0x4757bd=_0x44d8[_0x21aba4];return _0x4757bd;};'use strict';var Sequelize=require('sequelize');module[_0x844d('0x0')]={'name':{'type':Sequelize[_0x844d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x844d('0x1')]},'username':{'type':Sequelize[_0x844d('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x844d('0x1')],'allowNull':![],'defaultValue':_0x844d('0x2')},'remoteUri':{'type':Sequelize[_0x844d('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x844d('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x844d('0x1')],'allowNull':![]}};
\ No newline at end of file
index 99721c2..647cb75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb433=['label','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','end','name','send','rawAttributes','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','VtigerAccount','then','includeAll','include','findAll','rows','catch','show','find','create','body','params','findOne','VtigerConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','serverUrl','accessKey','moduleName','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','result','sessionName','reference','owner','remove','includes','editable','false','startsWith','cf_','picklistValues'];(function(_0x1c7cef,_0x1744ae){var _0x39c783=function(_0x58b908){while(--_0x58b908){_0x1c7cef['push'](_0x1c7cef['shift']());}};_0x39c783(++_0x1744ae);}(_0xb433,0x176));var _0x3b43=function(_0x2f9026,_0x3b954b){_0x2f9026=_0x2f9026-0x0;var _0x2dec99=_0xb433[_0x2f9026];return _0x2dec99;};'use strict';var emlformat=require(_0x3b43('0x0'));var rimraf=require(_0x3b43('0x1'));var zipdir=require(_0x3b43('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3b43('0x3'));var BPromise=require(_0x3b43('0x4'));var Mustache=require(_0x3b43('0x5'));var util=require(_0x3b43('0x6'));var path=require(_0x3b43('0x7'));var sox=require(_0x3b43('0x8'));var csv=require(_0x3b43('0x9'));var ejs=require(_0x3b43('0xa'));var fs=require('fs');var fs_extra=require(_0x3b43('0xb'));var _=require(_0x3b43('0xc'));var squel=require(_0x3b43('0xd'));var crypto=require(_0x3b43('0xe'));var jsforce=require(_0x3b43('0xf'));var deskjs=require(_0x3b43('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3b43('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3b43('0x12'));var as=require(_0x3b43('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b43('0x14'))(_0x3b43('0x15'));var utils=require(_0x3b43('0x16'));var config=require(_0x3b43('0x17'));var licenseUtil=require(_0x3b43('0x18'));var db=require(_0x3b43('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x10049d,_0x2671cb){_0x2671cb=_0x2671cb||0xcc;return function(_0x286829){if(_0x286829){return _0x10049d[_0x3b43('0x1a')](_0x2671cb);}return _0x10049d[_0x3b43('0x1b')](_0x2671cb)['end']();};}function respondWithResult(_0x49445f,_0xdd6681){_0xdd6681=_0xdd6681||0xc8;return function(_0x2d4a9d){if(_0x2d4a9d){return _0x49445f[_0x3b43('0x1b')](_0xdd6681)[_0x3b43('0x1c')](_0x2d4a9d);}};}function respondWithFilteredResult(_0xd13cbe,_0x267189){return function(_0x353ec1){if(_0x353ec1){var _0x35f4bc=typeof _0x267189[_0x3b43('0x1d')]===_0x3b43('0x1e')&&typeof _0x267189['limit']===_0x3b43('0x1e');var _0x76a046=_0x353ec1[_0x3b43('0x1f')];var _0x1a0e9c=_0x35f4bc?0x0:_0x267189[_0x3b43('0x1d')];var _0x103c17=_0x35f4bc?_0x353ec1['count']:_0x267189[_0x3b43('0x1d')]+_0x267189[_0x3b43('0x20')];var _0x4fb0ac;if(_0x103c17>=_0x76a046){_0x103c17=_0x76a046;_0x4fb0ac=0xc8;}else{_0x4fb0ac=0xce;}_0xd13cbe['status'](_0x4fb0ac);return _0xd13cbe[_0x3b43('0x21')](_0x3b43('0x22'),_0x1a0e9c+'-'+_0x103c17+'/'+_0x76a046)[_0x3b43('0x1c')](_0x353ec1);}return null;};}function patchUpdates(_0x5b0b78){return function(_0x4e2204){try{jsonpatch[_0x3b43('0x23')](_0x4e2204,_0x5b0b78,!![]);}catch(_0x49f0e1){return BPromise['reject'](_0x49f0e1);}return _0x4e2204[_0x3b43('0x24')]();};}function saveUpdates(_0x2f6229,_0x28002b){return function(_0x16c465){if(_0x16c465){return _0x16c465[_0x3b43('0x25')](_0x2f6229)['then'](function(_0x5a9f63){return _0x5a9f63;});}return null;};}function removeEntity(_0x2dff01,_0x171e94){return function(_0x202516){if(_0x202516){return _0x202516['destroy']()['then'](function(){_0x2dff01[_0x3b43('0x1b')](0xcc)[_0x3b43('0x26')]();});}};}function handleEntityNotFound(_0x14e6cc,_0x37b681){return function(_0x3f16f7){if(!_0x3f16f7){_0x14e6cc[_0x3b43('0x1a')](0x194);}return _0x3f16f7;};}function handleError(_0x439a7a,_0x34cb7b){_0x34cb7b=_0x34cb7b||0x1f4;return function(_0x5f978f){logger['error'](_0x5f978f['stack']);if(_0x5f978f[_0x3b43('0x27')]){delete _0x5f978f[_0x3b43('0x27')];}_0x439a7a[_0x3b43('0x1b')](_0x34cb7b)[_0x3b43('0x28')](_0x5f978f);};}exports['index']=function(_0x157310,_0x12f827){var _0x18895c={},_0xc9a59a={},_0x6faef1={'count':0x0,'rows':[]};var _0x1daa55=_['map'](db['VtigerAccount'][_0x3b43('0x29')],function(_0x176d9c){return{'name':_0x176d9c[_0x3b43('0x2a')],'type':_0x176d9c[_0x3b43('0x2b')]['key']};});_0xc9a59a['model']=_[_0x3b43('0x2c')](_0x1daa55,'name');_0xc9a59a[_0x3b43('0x2d')]=_[_0x3b43('0x2e')](_0x157310[_0x3b43('0x2d')]);_0xc9a59a[_0x3b43('0x2f')]=_[_0x3b43('0x30')](_0xc9a59a['model'],_0xc9a59a['query']);_0x18895c[_0x3b43('0x31')]=_[_0x3b43('0x30')](_0xc9a59a[_0x3b43('0x32')],qs[_0x3b43('0x33')](_0x157310[_0x3b43('0x2d')][_0x3b43('0x33')]));_0x18895c['attributes']=_0x18895c['attributes'][_0x3b43('0x34')]?_0x18895c[_0x3b43('0x31')]:_0xc9a59a[_0x3b43('0x32')];if(!_0x157310[_0x3b43('0x2d')][_0x3b43('0x35')](_0x3b43('0x36'))){_0x18895c[_0x3b43('0x20')]=qs['limit'](_0x157310['query']['limit']);_0x18895c[_0x3b43('0x1d')]=qs[_0x3b43('0x1d')](_0x157310[_0x3b43('0x2d')][_0x3b43('0x1d')]);}_0x18895c[_0x3b43('0x37')]=qs[_0x3b43('0x38')](_0x157310[_0x3b43('0x2d')][_0x3b43('0x38')]);_0x18895c['where']=qs[_0x3b43('0x2f')](_[_0x3b43('0x39')](_0x157310[_0x3b43('0x2d')],_0xc9a59a[_0x3b43('0x2f')]),_0x1daa55);if(_0x157310[_0x3b43('0x2d')][_0x3b43('0x3a')]){_0x18895c['where']=_[_0x3b43('0x3b')](_0x18895c[_0x3b43('0x3c')],{'$or':_[_0x3b43('0x2c')](_0x1daa55,function(_0x2a53d3){if(_0x2a53d3[_0x3b43('0x2b')]!==_0x3b43('0x3d')){var _0xe40688={};_0xe40688[_0x2a53d3[_0x3b43('0x27')]]={'$like':'%'+_0x157310[_0x3b43('0x2d')][_0x3b43('0x3a')]+'%'};return _0xe40688;}})});}_0x18895c=_[_0x3b43('0x3b')]({},_0x18895c,_0x157310[_0x3b43('0x3e')]);var _0x56a30e={'where':_0x18895c[_0x3b43('0x3c')]};return db[_0x3b43('0x3f')][_0x3b43('0x1f')](_0x56a30e)[_0x3b43('0x40')](function(_0x3cda7c){_0x6faef1['count']=_0x3cda7c;if(_0x157310[_0x3b43('0x2d')][_0x3b43('0x41')]){_0x18895c[_0x3b43('0x42')]=[{'all':!![]}];}return db[_0x3b43('0x3f')][_0x3b43('0x43')](_0x18895c);})[_0x3b43('0x40')](function(_0x3effcd){_0x6faef1[_0x3b43('0x44')]=_0x3effcd;return _0x6faef1;})['then'](respondWithFilteredResult(_0x12f827,_0x18895c))[_0x3b43('0x45')](handleError(_0x12f827,null));};exports[_0x3b43('0x46')]=function(_0xc7803f,_0x46ed3f){var _0x36d208={'raw':![],'where':{'id':_0xc7803f['params']['id']}},_0x290f27={};_0x290f27[_0x3b43('0x32')]=_[_0x3b43('0x2e')](db[_0x3b43('0x3f')]['rawAttributes']);_0x290f27[_0x3b43('0x2d')]=_[_0x3b43('0x2e')](_0xc7803f['query']);_0x290f27[_0x3b43('0x2f')]=_[_0x3b43('0x30')](_0x290f27[_0x3b43('0x32')],_0x290f27['query']);_0x36d208[_0x3b43('0x31')]=_[_0x3b43('0x30')](_0x290f27[_0x3b43('0x32')],qs['fields'](_0xc7803f['query']['fields']));_0x36d208['attributes']=_0x36d208[_0x3b43('0x31')][_0x3b43('0x34')]?_0x36d208[_0x3b43('0x31')]:_0x290f27['model'];if(_0xc7803f['query'][_0x3b43('0x41')]){_0x36d208[_0x3b43('0x42')]=[{'all':!![]}];}_0x36d208=_['merge']({},_0x36d208,_0xc7803f[_0x3b43('0x3e')]);return db['VtigerAccount'][_0x3b43('0x47')](_0x36d208)['then'](handleEntityNotFound(_0x46ed3f,null))['then'](respondWithResult(_0x46ed3f,null))[_0x3b43('0x45')](handleError(_0x46ed3f,null));};exports[_0x3b43('0x48')]=function(_0x1d37e4,_0x5b88ee){return db['VtigerAccount'][_0x3b43('0x48')](_0x1d37e4[_0x3b43('0x49')],{})[_0x3b43('0x40')](respondWithResult(_0x5b88ee,0xc9))[_0x3b43('0x45')](handleError(_0x5b88ee,null));};exports[_0x3b43('0x25')]=function(_0x47c141,_0x4782cc){if(_0x47c141[_0x3b43('0x49')]['id']){delete _0x47c141[_0x3b43('0x49')]['id'];}return db[_0x3b43('0x3f')][_0x3b43('0x47')]({'where':{'id':_0x47c141[_0x3b43('0x4a')]['id']}})[_0x3b43('0x40')](handleEntityNotFound(_0x4782cc,null))[_0x3b43('0x40')](saveUpdates(_0x47c141[_0x3b43('0x49')],null))[_0x3b43('0x40')](respondWithResult(_0x4782cc,null))[_0x3b43('0x45')](handleError(_0x4782cc,null));};exports['destroy']=function(_0x1b8a89,_0x21fd92){return db['VtigerAccount'][_0x3b43('0x47')]({'where':{'id':_0x1b8a89['params']['id']}})[_0x3b43('0x40')](handleEntityNotFound(_0x21fd92,null))[_0x3b43('0x40')](removeEntity(_0x21fd92,null))[_0x3b43('0x45')](handleError(_0x21fd92,null));};exports['getConfigurations']=function(_0x52bf61,_0xb89ca5,_0x221e5d){var _0x42a7ff={};var _0x24ebae={};var _0x4595a5;var _0x49d5f7;return db[_0x3b43('0x3f')][_0x3b43('0x4b')]({'where':{'id':_0x52bf61[_0x3b43('0x4a')]['id']}})[_0x3b43('0x40')](handleEntityNotFound(_0xb89ca5,null))[_0x3b43('0x40')](function(_0x85668){if(_0x85668){_0x4595a5=_0x85668;_0x24ebae[_0x3b43('0x32')]=_[_0x3b43('0x2e')](db[_0x3b43('0x4c')][_0x3b43('0x29')]);_0x24ebae[_0x3b43('0x2d')]=_[_0x3b43('0x2e')](_0x52bf61[_0x3b43('0x2d')]);_0x24ebae[_0x3b43('0x2f')]=_[_0x3b43('0x30')](_0x24ebae[_0x3b43('0x32')],_0x24ebae[_0x3b43('0x2d')]);_0x42a7ff[_0x3b43('0x31')]=_[_0x3b43('0x30')](_0x24ebae[_0x3b43('0x32')],qs[_0x3b43('0x33')](_0x52bf61[_0x3b43('0x2d')][_0x3b43('0x33')]));_0x42a7ff[_0x3b43('0x31')]=_0x42a7ff[_0x3b43('0x31')][_0x3b43('0x34')]?_0x42a7ff[_0x3b43('0x31')]:_0x24ebae[_0x3b43('0x32')];_0x42a7ff[_0x3b43('0x37')]=qs[_0x3b43('0x38')](_0x52bf61[_0x3b43('0x2d')][_0x3b43('0x38')]);_0x42a7ff[_0x3b43('0x3c')]=qs['filters'](_[_0x3b43('0x39')](_0x52bf61[_0x3b43('0x2d')],_0x24ebae[_0x3b43('0x2f')]));if(_0x52bf61[_0x3b43('0x2d')]['filter']){_0x42a7ff[_0x3b43('0x3c')]=_['merge'](_0x42a7ff[_0x3b43('0x3c')],{'$or':_['map'](_0x42a7ff[_0x3b43('0x31')],function(_0x50f1f6){var _0x8a361d={};_0x8a361d[_0x50f1f6]={'$like':'%'+_0x52bf61['query'][_0x3b43('0x3a')]+'%'};return _0x8a361d;})});}_0x42a7ff=_['merge']({},_0x42a7ff,_0x52bf61[_0x3b43('0x3e')]);return _0x4595a5['getConfigurations'](_0x42a7ff);}})[_0x3b43('0x40')](function(_0x553c1d){if(_0x553c1d){_0x49d5f7=_0x553c1d[_0x3b43('0x34')];if(!_0x52bf61[_0x3b43('0x2d')][_0x3b43('0x35')]('nolimit')){_0x42a7ff['limit']=qs['limit'](_0x52bf61[_0x3b43('0x2d')]['limit']);_0x42a7ff[_0x3b43('0x1d')]=qs[_0x3b43('0x1d')](_0x52bf61[_0x3b43('0x2d')]['offset']);}return _0x4595a5[_0x3b43('0x4d')](_0x42a7ff);}})[_0x3b43('0x40')](function(_0x2c7955){if(_0x2c7955){return _0x2c7955?{'count':_0x49d5f7,'rows':_0x2c7955}:null;}})[_0x3b43('0x40')](respondWithResult(_0xb89ca5,null))[_0x3b43('0x45')](handleError(_0xb89ca5,null));};exports[_0x3b43('0x4e')]=function(_0x140873,_0x190be9,_0x13b07f){if(_0x140873['body']['id']){delete _0x140873[_0x3b43('0x49')]['id'];}return db[_0x3b43('0x3f')]['findOne']({'where':{'id':_0x140873[_0x3b43('0x4a')]['id']}})[_0x3b43('0x40')](handleEntityNotFound(_0x190be9,null))[_0x3b43('0x40')](function(_0x4b4da9){if(_0x4b4da9){_0x140873[_0x3b43('0x49')][_0x3b43('0x4f')]=_0x4b4da9['id'];_0x140873['body'][_0x3b43('0x50')]=integrations[_0x3b43('0x51')](_0x140873[_0x3b43('0x49')][_0x3b43('0x52')],_0x140873[_0x3b43('0x49')][_0x3b43('0x2b')]);_0x140873['body'][_0x3b43('0x53')]=integrations[_0x3b43('0x54')](_0x140873['body'][_0x3b43('0x52')],_0x140873[_0x3b43('0x49')][_0x3b43('0x2b')]);return db[_0x3b43('0x4c')][_0x3b43('0x48')](_0x140873['body'],{'include':[{'model':db['VtigerField'],'as':_0x3b43('0x50')},{'model':db[_0x3b43('0x55')],'as':_0x3b43('0x53')}]});}return null;})['then'](respondWithResult(_0x190be9,null))['catch'](handleError(_0x190be9,null));};var md5=require(_0x3b43('0x56'));exports[_0x3b43('0x57')]=function(_0x3c9b05,_0x762db8,_0x56642c){var _0x1ac6ab=null;var _0x7e03eb=null;var _0x3c7839=null;var _0x2626f4=null;var _0x445c1f='';return db[_0x3b43('0x3f')][_0x3b43('0x4b')]({'where':{'id':_0x3c9b05[_0x3b43('0x4a')]['id']},'attributes':['id',_0x3b43('0x27'),_0x3b43('0x58'),_0x3b43('0x59'),'moduleName','remoteUri',_0x3b43('0x5a'),_0x3b43('0x5b')]})[_0x3b43('0x40')](handleEntityNotFound(_0x762db8,null))[_0x3b43('0x40')](function(_0x636810){if(_0x636810){_0x1ac6ab=_0x636810[_0x3b43('0x58')];_0x7e03eb=_0x636810[_0x3b43('0x5b')];_0x3c7839=_0x636810[_0x3b43('0x5c')];_0x445c1f=_0x636810['remoteUri'];var _0x513327=_0x445c1f['slice'](-0x1);if(_0x513327==='/'){_0x445c1f=_0x445c1f[_0x3b43('0x5d')](0x0,_0x445c1f[_0x3b43('0x5e')](_0x513327));}_0x2626f4=util[_0x3b43('0x5f')](_0x3b43('0x60'),_0x445c1f);var _0x59638f={'method':_0x3b43('0x61'),'uri':_0x2626f4,'qs':{'operation':_0x3b43('0x62'),'username':_0x636810['username']},'json':!![]};return rp(_0x59638f);}})['then'](function(_0x3c1d52){if(_0x3c1d52[_0x3b43('0x63')]){var _0x1d0323={'method':_0x3b43('0x64'),'uri':_0x2626f4,'form':{'operation':_0x3b43('0x65'),'username':_0x1ac6ab,'accessKey':md5(_0x3c1d52['result'][_0x3b43('0x66')]+_0x7e03eb)},'json':!![]};return rp(_0x1d0323);}})[_0x3b43('0x40')](function(_0x4115fc){if(_0x4115fc[_0x3b43('0x63')]){var _0x135b37={'method':_0x3b43('0x61'),'uri':_0x2626f4,'qs':{'operation':'describe','username':_0x1ac6ab,'sessionName':_0x4115fc[_0x3b43('0x67')][_0x3b43('0x68')],'elementType':_0x3c7839},'json':!![]};return rp(_0x135b37);}})[_0x3b43('0x40')](function(_0xfe2af){if(_0xfe2af[_0x3b43('0x63')]){var _0x57f56b=['autogenerated',_0x3b43('0x69'),_0x3b43('0x6a')];_[_0x3b43('0x6b')](_0xfe2af[_0x3b43('0x67')][_0x3b43('0x33')],function(_0x3d4070){return _0x57f56b[_0x3b43('0x6c')](_0x3d4070[_0x3b43('0x2b')][_0x3b43('0x27')]);});_[_0x3b43('0x6b')](_0xfe2af['result']['fields'],function(_0x52ff8c){return _0x52ff8c[_0x3b43('0x6d')]===_0x3b43('0x6e');});return{'count':_0xfe2af['result'][_0x3b43('0x33')][_0x3b43('0x34')],'rows':_[_0x3b43('0x2c')](_0xfe2af[_0x3b43('0x67')]['fields'],function(_0x493688){return{'id':_0x493688[_0x3b43('0x27')],'name':_0x493688['label'],'custom':_[_0x3b43('0x6f')](_0x493688['name'],_0x3b43('0x70'))?!![]:![],'options':_0x493688[_0x3b43('0x2b')][_0x3b43('0x27')]==='picklist'&&_0x493688[_0x3b43('0x2b')]['picklistValues'][_0x3b43('0x34')]>0x0?_['map'](_0x493688[_0x3b43('0x2b')][_0x3b43('0x71')],function(_0x4b54fa){return{'name':_0x4b54fa[_0x3b43('0x72')],'value':_0x4b54fa[_0x3b43('0x73')]};}):[]};})};}})[_0x3b43('0x40')](respondWithResult(_0x762db8,null))[_0x3b43('0x45')](function(_0x48a8bf){console[_0x3b43('0x74')](_0x3b43('0x75')+_0x48a8bf);var _0x452e4c=_0x3c9b05[_0x3b43('0x2d')]['test']?0x1f4:_0x48a8bf[_0x3b43('0x76')]||0x1f4;logger['error'](_0x3b43('0x77'),'getFields',_0x452e4c,JSON[_0x3b43('0x78')](_0x48a8bf));delete _0x48a8bf[_0x3b43('0x27')];if(_0x452e4c===0x191){_0x452e4c=0x190;}_0x762db8['status'](_0x452e4c)[_0x3b43('0x28')](_0x3c9b05[_0x3b43('0x2d')][_0x3b43('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x48a8bf['statusCode']}:_0x48a8bf);});};
\ No newline at end of file
+var _0x1610=['path','sox','to-csv','ejs','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','sendStatus','error','name','send','map','VtigerAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','catch','show','params','length','include','find','create','body','destroy','VtigerConfiguration','pick','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','describe','sessionName','autogenerated','reference','remove','includes','false','label','startsWith','cf_','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1610,0x157));var _0x0161=function(_0x11038a,_0x12aca0){_0x11038a=_0x11038a-0x0;var _0x16d770=_0x1610[_0x11038a];return _0x16d770;};'use strict';var emlformat=require(_0x0161('0x0'));var rimraf=require(_0x0161('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0161('0x2'));var rp=require(_0x0161('0x3'));var moment=require(_0x0161('0x4'));var BPromise=require(_0x0161('0x5'));var Mustache=require(_0x0161('0x6'));var util=require(_0x0161('0x7'));var path=require(_0x0161('0x8'));var sox=require(_0x0161('0x9'));var csv=require(_0x0161('0xa'));var ejs=require(_0x0161('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0161('0xc'));var squel=require('squel');var crypto=require(_0x0161('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0161('0xa'));var querystring=require('querystring');var Papa=require(_0x0161('0xe'));var Redis=require(_0x0161('0xf'));var authService=require(_0x0161('0x10'));var qs=require(_0x0161('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0161('0x12'));var logger=require(_0x0161('0x13'))('api');var utils=require(_0x0161('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0161('0x15'));var db=require(_0x0161('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5dfbc8,_0x4a5e77){_0x4a5e77=_0x4a5e77||0xcc;return function(_0x4f7450){if(_0x4f7450){return _0x5dfbc8['sendStatus'](_0x4a5e77);}return _0x5dfbc8['status'](_0x4a5e77)[_0x0161('0x17')]();};}function respondWithResult(_0x35f03c,_0x13f907){_0x13f907=_0x13f907||0xc8;return function(_0x362f77){if(_0x362f77){return _0x35f03c[_0x0161('0x18')](_0x13f907)['json'](_0x362f77);}};}function respondWithFilteredResult(_0x11136b,_0x126268){return function(_0x500a43){if(_0x500a43){var _0xd8ee18=typeof _0x126268[_0x0161('0x19')]==='undefined'&&typeof _0x126268['limit']===_0x0161('0x1a');var _0x15c7bf=_0x500a43['count'];var _0x45c904=_0xd8ee18?0x0:_0x126268['offset'];var _0x12f1a2=_0xd8ee18?_0x500a43[_0x0161('0x1b')]:_0x126268[_0x0161('0x19')]+_0x126268[_0x0161('0x1c')];var _0x161d86;if(_0x12f1a2>=_0x15c7bf){_0x12f1a2=_0x15c7bf;_0x161d86=0xc8;}else{_0x161d86=0xce;}_0x11136b[_0x0161('0x18')](_0x161d86);return _0x11136b[_0x0161('0x1d')](_0x0161('0x1e'),_0x45c904+'-'+_0x12f1a2+'/'+_0x15c7bf)[_0x0161('0x1f')](_0x500a43);}return null;};}function patchUpdates(_0x124db7){return function(_0x41aeb0){try{jsonpatch[_0x0161('0x20')](_0x41aeb0,_0x124db7,!![]);}catch(_0x17c88a){return BPromise['reject'](_0x17c88a);}return _0x41aeb0[_0x0161('0x21')]();};}function saveUpdates(_0xdcca85,_0x357c7b){return function(_0x3a0679){if(_0x3a0679){return _0x3a0679[_0x0161('0x22')](_0xdcca85)['then'](function(_0x3f78a9){return _0x3f78a9;});}return null;};}function removeEntity(_0x44f608,_0x579b74){return function(_0x5e0bc7){if(_0x5e0bc7){return _0x5e0bc7['destroy']()[_0x0161('0x23')](function(){_0x44f608[_0x0161('0x18')](0xcc)[_0x0161('0x17')]();});}};}function handleEntityNotFound(_0x1a3d56,_0x26b5d4){return function(_0x2409ee){if(!_0x2409ee){_0x1a3d56[_0x0161('0x24')](0x194);}return _0x2409ee;};}function handleError(_0x5780c1,_0x447f7b){_0x447f7b=_0x447f7b||0x1f4;return function(_0x417a33){logger[_0x0161('0x25')](_0x417a33['stack']);if(_0x417a33[_0x0161('0x26')]){delete _0x417a33[_0x0161('0x26')];}_0x5780c1[_0x0161('0x18')](_0x447f7b)[_0x0161('0x27')](_0x417a33);};}exports['index']=function(_0x1a6d7b,_0x55582f){var _0x16b64c={},_0x434fcb={},_0x28a2c3={'count':0x0,'rows':[]};var _0x16d486=_[_0x0161('0x28')](db[_0x0161('0x29')][_0x0161('0x2a')],function(_0x207009){return{'name':_0x207009[_0x0161('0x2b')],'type':_0x207009[_0x0161('0x2c')]['key']};});_0x434fcb[_0x0161('0x2d')]=_[_0x0161('0x28')](_0x16d486,'name');_0x434fcb[_0x0161('0x2e')]=_[_0x0161('0x2f')](_0x1a6d7b[_0x0161('0x2e')]);_0x434fcb[_0x0161('0x30')]=_[_0x0161('0x31')](_0x434fcb[_0x0161('0x2d')],_0x434fcb[_0x0161('0x2e')]);_0x16b64c['attributes']=_['intersection'](_0x434fcb[_0x0161('0x2d')],qs[_0x0161('0x32')](_0x1a6d7b[_0x0161('0x2e')]['fields']));_0x16b64c[_0x0161('0x33')]=_0x16b64c[_0x0161('0x33')]['length']?_0x16b64c['attributes']:_0x434fcb[_0x0161('0x2d')];if(!_0x1a6d7b[_0x0161('0x2e')][_0x0161('0x34')](_0x0161('0x35'))){_0x16b64c['limit']=qs['limit'](_0x1a6d7b[_0x0161('0x2e')][_0x0161('0x1c')]);_0x16b64c[_0x0161('0x19')]=qs[_0x0161('0x19')](_0x1a6d7b[_0x0161('0x2e')][_0x0161('0x19')]);}_0x16b64c[_0x0161('0x36')]=qs[_0x0161('0x37')](_0x1a6d7b[_0x0161('0x2e')][_0x0161('0x37')]);_0x16b64c[_0x0161('0x38')]=qs[_0x0161('0x30')](_['pick'](_0x1a6d7b[_0x0161('0x2e')],_0x434fcb['filters']),_0x16d486);if(_0x1a6d7b['query'][_0x0161('0x39')]){_0x16b64c[_0x0161('0x38')]=_[_0x0161('0x3a')](_0x16b64c[_0x0161('0x38')],{'$or':_[_0x0161('0x28')](_0x16d486,function(_0x1449c0){if(_0x1449c0[_0x0161('0x2c')]!==_0x0161('0x3b')){var _0xc25695={};_0xc25695[_0x1449c0[_0x0161('0x26')]]={'$like':'%'+_0x1a6d7b[_0x0161('0x2e')][_0x0161('0x39')]+'%'};return _0xc25695;}})});}_0x16b64c=_[_0x0161('0x3a')]({},_0x16b64c,_0x1a6d7b[_0x0161('0x3c')]);var _0x194325={'where':_0x16b64c[_0x0161('0x38')]};return db[_0x0161('0x29')]['count'](_0x194325)['then'](function(_0x53e024){_0x28a2c3[_0x0161('0x1b')]=_0x53e024;if(_0x1a6d7b[_0x0161('0x2e')][_0x0161('0x3d')]){_0x16b64c['include']=[{'all':!![]}];}return db[_0x0161('0x29')]['findAll'](_0x16b64c);})[_0x0161('0x23')](function(_0x3f0cd6){_0x28a2c3['rows']=_0x3f0cd6;return _0x28a2c3;})[_0x0161('0x23')](respondWithFilteredResult(_0x55582f,_0x16b64c))[_0x0161('0x3e')](handleError(_0x55582f,null));};exports[_0x0161('0x3f')]=function(_0x3c461e,_0x4c39f9){var _0x381876={'raw':![],'where':{'id':_0x3c461e[_0x0161('0x40')]['id']}},_0x527d7e={};_0x527d7e[_0x0161('0x2d')]=_[_0x0161('0x2f')](db[_0x0161('0x29')]['rawAttributes']);_0x527d7e['query']=_[_0x0161('0x2f')](_0x3c461e[_0x0161('0x2e')]);_0x527d7e['filters']=_[_0x0161('0x31')](_0x527d7e[_0x0161('0x2d')],_0x527d7e[_0x0161('0x2e')]);_0x381876[_0x0161('0x33')]=_[_0x0161('0x31')](_0x527d7e[_0x0161('0x2d')],qs[_0x0161('0x32')](_0x3c461e['query'][_0x0161('0x32')]));_0x381876[_0x0161('0x33')]=_0x381876[_0x0161('0x33')][_0x0161('0x41')]?_0x381876[_0x0161('0x33')]:_0x527d7e[_0x0161('0x2d')];if(_0x3c461e['query'][_0x0161('0x3d')]){_0x381876[_0x0161('0x42')]=[{'all':!![]}];}_0x381876=_[_0x0161('0x3a')]({},_0x381876,_0x3c461e['options']);return db[_0x0161('0x29')][_0x0161('0x43')](_0x381876)[_0x0161('0x23')](handleEntityNotFound(_0x4c39f9,null))['then'](respondWithResult(_0x4c39f9,null))[_0x0161('0x3e')](handleError(_0x4c39f9,null));};exports[_0x0161('0x44')]=function(_0x2ce9c8,_0xc5431){return db[_0x0161('0x29')][_0x0161('0x44')](_0x2ce9c8[_0x0161('0x45')],{})[_0x0161('0x23')](respondWithResult(_0xc5431,0xc9))[_0x0161('0x3e')](handleError(_0xc5431,null));};exports[_0x0161('0x22')]=function(_0x2639d4,_0x2ecd){if(_0x2639d4[_0x0161('0x45')]['id']){delete _0x2639d4[_0x0161('0x45')]['id'];}return db[_0x0161('0x29')][_0x0161('0x43')]({'where':{'id':_0x2639d4[_0x0161('0x40')]['id']}})['then'](handleEntityNotFound(_0x2ecd,null))[_0x0161('0x23')](saveUpdates(_0x2639d4[_0x0161('0x45')],null))[_0x0161('0x23')](respondWithResult(_0x2ecd,null))[_0x0161('0x3e')](handleError(_0x2ecd,null));};exports[_0x0161('0x46')]=function(_0x4e79d3,_0xa90749){return db['VtigerAccount'][_0x0161('0x43')]({'where':{'id':_0x4e79d3[_0x0161('0x40')]['id']}})[_0x0161('0x23')](handleEntityNotFound(_0xa90749,null))[_0x0161('0x23')](removeEntity(_0xa90749,null))[_0x0161('0x3e')](handleError(_0xa90749,null));};exports['getConfigurations']=function(_0x40fbdb,_0x3e2f5c,_0x587835){var _0x425f8a={};var _0x25af4c={};var _0x4e4ad6;var _0x2b4b64;return db[_0x0161('0x29')]['findOne']({'where':{'id':_0x40fbdb[_0x0161('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e2f5c,null))['then'](function(_0x3905f0){if(_0x3905f0){_0x4e4ad6=_0x3905f0;_0x25af4c[_0x0161('0x2d')]=_[_0x0161('0x2f')](db[_0x0161('0x47')][_0x0161('0x2a')]);_0x25af4c[_0x0161('0x2e')]=_['keys'](_0x40fbdb[_0x0161('0x2e')]);_0x25af4c[_0x0161('0x30')]=_[_0x0161('0x31')](_0x25af4c['model'],_0x25af4c['query']);_0x425f8a[_0x0161('0x33')]=_['intersection'](_0x25af4c[_0x0161('0x2d')],qs[_0x0161('0x32')](_0x40fbdb[_0x0161('0x2e')]['fields']));_0x425f8a['attributes']=_0x425f8a[_0x0161('0x33')][_0x0161('0x41')]?_0x425f8a[_0x0161('0x33')]:_0x25af4c[_0x0161('0x2d')];_0x425f8a['order']=qs[_0x0161('0x37')](_0x40fbdb['query'][_0x0161('0x37')]);_0x425f8a[_0x0161('0x38')]=qs[_0x0161('0x30')](_[_0x0161('0x48')](_0x40fbdb[_0x0161('0x2e')],_0x25af4c[_0x0161('0x30')]));if(_0x40fbdb['query'][_0x0161('0x39')]){_0x425f8a[_0x0161('0x38')]=_['merge'](_0x425f8a[_0x0161('0x38')],{'$or':_['map'](_0x425f8a['attributes'],function(_0x114d0a){var _0x20348d={};_0x20348d[_0x114d0a]={'$like':'%'+_0x40fbdb[_0x0161('0x2e')][_0x0161('0x39')]+'%'};return _0x20348d;})});}_0x425f8a=_['merge']({},_0x425f8a,_0x40fbdb[_0x0161('0x3c')]);return _0x4e4ad6['getConfigurations'](_0x425f8a);}})[_0x0161('0x23')](function(_0x10b84c){if(_0x10b84c){_0x2b4b64=_0x10b84c[_0x0161('0x41')];if(!_0x40fbdb['query'][_0x0161('0x34')](_0x0161('0x35'))){_0x425f8a[_0x0161('0x1c')]=qs[_0x0161('0x1c')](_0x40fbdb[_0x0161('0x2e')]['limit']);_0x425f8a[_0x0161('0x19')]=qs[_0x0161('0x19')](_0x40fbdb['query'][_0x0161('0x19')]);}return _0x4e4ad6[_0x0161('0x49')](_0x425f8a);}})['then'](function(_0x4a9a9e){if(_0x4a9a9e){return _0x4a9a9e?{'count':_0x2b4b64,'rows':_0x4a9a9e}:null;}})['then'](respondWithResult(_0x3e2f5c,null))[_0x0161('0x3e')](handleError(_0x3e2f5c,null));};exports[_0x0161('0x4a')]=function(_0xf453fc,_0x2972ae,_0xa62215){if(_0xf453fc[_0x0161('0x45')]['id']){delete _0xf453fc[_0x0161('0x45')]['id'];}return db[_0x0161('0x29')][_0x0161('0x4b')]({'where':{'id':_0xf453fc['params']['id']}})[_0x0161('0x23')](handleEntityNotFound(_0x2972ae,null))['then'](function(_0x42ff99){if(_0x42ff99){_0xf453fc[_0x0161('0x45')][_0x0161('0x4c')]=_0x42ff99['id'];_0xf453fc[_0x0161('0x45')][_0x0161('0x4d')]=integrations[_0x0161('0x4e')](_0xf453fc[_0x0161('0x45')][_0x0161('0x4f')],_0xf453fc[_0x0161('0x45')][_0x0161('0x2c')]);_0xf453fc[_0x0161('0x45')][_0x0161('0x50')]=integrations[_0x0161('0x51')](_0xf453fc[_0x0161('0x45')]['channel'],_0xf453fc[_0x0161('0x45')][_0x0161('0x2c')]);return db[_0x0161('0x47')]['create'](_0xf453fc[_0x0161('0x45')],{'include':[{'model':db[_0x0161('0x52')],'as':_0x0161('0x4d')},{'model':db[_0x0161('0x52')],'as':_0x0161('0x50')}]});}return null;})[_0x0161('0x23')](respondWithResult(_0x2972ae,null))[_0x0161('0x3e')](handleError(_0x2972ae,null));};var md5=require(_0x0161('0x53'));exports[_0x0161('0x54')]=function(_0x525d50,_0x4bc825,_0x8914b4){var _0x599b0f=null;var _0x9e3b6f=null;var _0x55fa5c=null;var _0x4760bd=null;var _0x568ef8='';return db[_0x0161('0x29')]['findOne']({'where':{'id':_0x525d50[_0x0161('0x40')]['id']},'attributes':['id',_0x0161('0x26'),_0x0161('0x55'),'description',_0x0161('0x56'),_0x0161('0x57'),_0x0161('0x58'),_0x0161('0x59')]})[_0x0161('0x23')](handleEntityNotFound(_0x4bc825,null))[_0x0161('0x23')](function(_0x383f5a){if(_0x383f5a){_0x599b0f=_0x383f5a[_0x0161('0x55')];_0x9e3b6f=_0x383f5a[_0x0161('0x59')];_0x55fa5c=_0x383f5a[_0x0161('0x56')];_0x568ef8=_0x383f5a['remoteUri'];var _0x2706d2=_0x568ef8[_0x0161('0x5a')](-0x1);if(_0x2706d2==='/'){_0x568ef8=_0x568ef8[_0x0161('0x5b')](0x0,_0x568ef8[_0x0161('0x5c')](_0x2706d2));}_0x4760bd=util[_0x0161('0x5d')](_0x0161('0x5e'),_0x568ef8);var _0x33329c={'method':_0x0161('0x5f'),'uri':_0x4760bd,'qs':{'operation':'getchallenge','username':_0x383f5a[_0x0161('0x55')]},'json':!![]};return rp(_0x33329c);}})[_0x0161('0x23')](function(_0x5a61d9){if(_0x5a61d9[_0x0161('0x60')]){var _0x4d7d72={'method':_0x0161('0x61'),'uri':_0x4760bd,'form':{'operation':_0x0161('0x62'),'username':_0x599b0f,'accessKey':md5(_0x5a61d9[_0x0161('0x63')][_0x0161('0x64')]+_0x9e3b6f)},'json':!![]};return rp(_0x4d7d72);}})[_0x0161('0x23')](function(_0x45a8a7){if(_0x45a8a7[_0x0161('0x60')]){var _0x11125a={'method':'GET','uri':_0x4760bd,'qs':{'operation':_0x0161('0x65'),'username':_0x599b0f,'sessionName':_0x45a8a7[_0x0161('0x63')][_0x0161('0x66')],'elementType':_0x55fa5c},'json':!![]};return rp(_0x11125a);}})[_0x0161('0x23')](function(_0x37b3ce){if(_0x37b3ce['success']){var _0x1166b9=[_0x0161('0x67'),_0x0161('0x68'),'owner'];_[_0x0161('0x69')](_0x37b3ce[_0x0161('0x63')][_0x0161('0x32')],function(_0x4d3c43){return _0x1166b9[_0x0161('0x6a')](_0x4d3c43['type']['name']);});_['remove'](_0x37b3ce[_0x0161('0x63')][_0x0161('0x32')],function(_0x42b48c){return _0x42b48c['editable']===_0x0161('0x6b');});return{'count':_0x37b3ce[_0x0161('0x63')]['fields']['length'],'rows':_[_0x0161('0x28')](_0x37b3ce[_0x0161('0x63')][_0x0161('0x32')],function(_0x3c573d){return{'id':_0x3c573d[_0x0161('0x26')],'name':_0x3c573d[_0x0161('0x6c')],'custom':_[_0x0161('0x6d')](_0x3c573d[_0x0161('0x26')],_0x0161('0x6e'))?!![]:![],'options':_0x3c573d[_0x0161('0x2c')]['name']==='picklist'&&_0x3c573d[_0x0161('0x2c')]['picklistValues'][_0x0161('0x41')]>0x0?_[_0x0161('0x28')](_0x3c573d[_0x0161('0x2c')]['picklistValues'],function(_0x236783){return{'name':_0x236783['label'],'value':_0x236783['value']};}):[]};})};}})['then'](respondWithResult(_0x4bc825,null))['catch'](function(_0x29da2b){console[_0x0161('0x6f')](_0x0161('0x70')+_0x29da2b);var _0xfaa22e=_0x525d50[_0x0161('0x2e')][_0x0161('0x71')]?0x1f4:_0x29da2b[_0x0161('0x72')]||0x1f4;logger['error'](_0x0161('0x73'),_0x0161('0x54'),_0xfaa22e,JSON['stringify'](_0x29da2b));delete _0x29da2b['name'];if(_0xfaa22e===0x191){_0xfaa22e=0x190;}_0x4bc825[_0x0161('0x18')](_0xfaa22e)['send'](_0x525d50[_0x0161('0x2e')][_0x0161('0x71')]?{'message':_0x0161('0x74'),'statusCode':_0x29da2b[_0x0161('0x72')]}:_0x29da2b);});};
\ No newline at end of file
index 26900bb..711a535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x779d=['lodash','util','api','moment','bluebird','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts'];(function(_0x24ebae,_0x27c6be){var _0x1c84e8=function(_0x53557b){while(--_0x53557b){_0x24ebae['push'](_0x24ebae['shift']());}};_0x1c84e8(++_0x27c6be);}(_0x779d,0x120));var _0xd779=function(_0x3e9000,_0x43f2bc){_0x3e9000=_0x3e9000-0x0;var _0x3a0dfa=_0x779d[_0x3e9000];return _0x3a0dfa;};'use strict';var _=require(_0xd779('0x0'));var util=require(_0xd779('0x1'));var logger=require('../../config/logger')(_0xd779('0x2'));var moment=require(_0xd779('0x3'));var BPromise=require(_0xd779('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd779('0x5'));var rimraf=require('rimraf');var config=require(_0xd779('0x6'));var attributes=require(_0xd779('0x7'));var integrations=require(_0xd779('0x8'));module['exports']=function(_0x4c398f,_0x1471bf){return _0x4c398f[_0xd779('0x9')](_0xd779('0xa'),attributes,{'tableName':_0xd779('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4656=['int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4656,0x1e2));var _0x6465=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x4656[_0xf16b1];return _0x26f94d;};'use strict';var _=require('lodash');var util=require(_0x6465('0x0'));var logger=require(_0x6465('0x1'))(_0x6465('0x2'));var moment=require(_0x6465('0x3'));var BPromise=require(_0x6465('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6465('0x5'));var rimraf=require('rimraf');var config=require(_0x6465('0x6'));var attributes=require(_0x6465('0x7'));var integrations=require(_0x6465('0x8'));module[_0x6465('0x9')]=function(_0x53ec10,_0x383b47){return _0x53ec10[_0x6465('0xa')](_0x6465('0xb'),attributes,{'tableName':_0x6465('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f2e6f96..4f2c713 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ee=['message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','include','map','model','find','ShowVtigerAccount','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x553d82,_0x50a99d){var _0x47a510=function(_0x5d4b46){while(--_0x5d4b46){_0x553d82['push'](_0x553d82['shift']());}};_0x47a510(++_0x50a99d);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'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')]('VtigerAccount,\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')]('VtigerAccount,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}exports[_0xe36e('0x18')]=function(_0x2184ae){var _0x56c019=this;return new Promise(function(_0x21d9a3,_0x533c06){return db[_0xe36e('0x19')][_0xe36e('0x1a')]({'raw':_0x2184ae['options']?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'where':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae['options'][_0xe36e('0x1d')]||null:null,'attributes':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1e')]||null:null,'limit':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')]['limit']||null:null,'include':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x2184ae[_0xe36e('0x1b')]['include'],function(_0x598a7a){return{'model':db[_0x598a7a[_0xe36e('0x21')]],'as':_0x598a7a['as'],'attributes':_0x598a7a[_0xe36e('0x1e')],'include':_0x598a7a[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x598a7a[_0xe36e('0x1f')],function(_0x1507f9){return{'model':db[_0x1507f9[_0xe36e('0x21')]],'as':_0x1507f9['as'],'attributes':_0x1507f9['attributes'],'include':_0x1507f9[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x1507f9[_0xe36e('0x1f')],function(_0x262caa){return{'model':db[_0x262caa['model']],'as':_0x262caa['as'],'attributes':_0x262caa[_0xe36e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf7b02e){logger['info'](_0xe36e('0x18'),_0x2184ae);logger['debug'](_0xe36e('0x18'),_0x2184ae,JSON['stringify'](_0xf7b02e));_0x21d9a3(_0xf7b02e);})[_0xe36e('0x17')](function(_0x59548b){logger['error']('GetVtigerAccount',_0x59548b['message'],_0x2184ae);_0x533c06(_0x56c019[_0xe36e('0x12')](0x1f4,_0x59548b[_0xe36e('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x4ac819){var _0x1fa1ec=this;return new Promise(function(_0xb8d44e,_0x259e19){return db[_0xe36e('0x19')][_0xe36e('0x22')]({'raw':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819['options'][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'where':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819['options'][_0xe36e('0x1d')]||null:null,'attributes':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1e')]||null:null,'include':_0x4ac819[_0xe36e('0x1b')]?_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x4ac819[_0xe36e('0x1b')][_0xe36e('0x1f')],function(_0xf808f5){return{'model':db[_0xf808f5['model']],'as':_0xf808f5['as'],'attributes':_0xf808f5[_0xe36e('0x1e')],'include':_0xf808f5['include']?_['map'](_0xf808f5[_0xe36e('0x1f')],function(_0x4f620d){return{'model':db[_0x4f620d[_0xe36e('0x21')]],'as':_0x4f620d['as'],'attributes':_0x4f620d[_0xe36e('0x1e')],'include':_0x4f620d[_0xe36e('0x1f')]?_[_0xe36e('0x20')](_0x4f620d['include'],function(_0x56135c){return{'model':db[_0x56135c[_0xe36e('0x21')]],'as':_0x56135c['as'],'attributes':_0x56135c[_0xe36e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe36e('0xc')](function(_0x243338){logger['info'](_0xe36e('0x23'),_0x4ac819);logger[_0xe36e('0xe')](_0xe36e('0x23'),_0x4ac819,JSON['stringify'](_0x243338));_0xb8d44e(_0x243338);})[_0xe36e('0x17')](function(_0x2ff8f4){logger['error'](_0xe36e('0x23'),_0x2ff8f4[_0xe36e('0x14')],_0x4ac819);_0x259e19(_0x1fa1ec[_0xe36e('0x12')](0x1f4,_0x2ff8f4[_0xe36e('0x14')]));});});};
\ No newline at end of file
+var _0x1775=['stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','attributes','limit','map','include','model','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xf9b042,_0x452962){var _0x4a5894=function(_0x47a0e1){while(--_0x47a0e1){_0xf9b042['push'](_0xf9b042['shift']());}};_0x4a5894(++_0x452962);}(_0x1775,0x1db));var _0x5177=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1775[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});}exports[_0x5177('0x1a')]=function(_0x1b4102){var _0x5f5bd4=this;return new Promise(function(_0x3e6944,_0x2ebf91){return db[_0x5177('0x1b')]['findAll']({'raw':_0x1b4102[_0x5177('0x1c')]?_0x1b4102['options'][_0x5177('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x1e')]||null:null,'attributes':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x1f')]||null:null,'limit':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')][_0x5177('0x20')]||null:null,'include':_0x1b4102[_0x5177('0x1c')]?_0x1b4102[_0x5177('0x1c')]['include']?_[_0x5177('0x21')](_0x1b4102['options'][_0x5177('0x22')],function(_0x2c68d8){return{'model':db[_0x2c68d8[_0x5177('0x23')]],'as':_0x2c68d8['as'],'attributes':_0x2c68d8[_0x5177('0x1f')],'include':_0x2c68d8['include']?_[_0x5177('0x21')](_0x2c68d8['include'],function(_0x564139){return{'model':db[_0x564139[_0x5177('0x23')]],'as':_0x564139['as'],'attributes':_0x564139[_0x5177('0x1f')],'include':_0x564139['include']?_[_0x5177('0x21')](_0x564139['include'],function(_0x231d35){return{'model':db[_0x231d35[_0x5177('0x23')]],'as':_0x231d35['as'],'attributes':_0x231d35['attributes']};}):[]};}):[]};}):[]:[]})[_0x5177('0xe')](function(_0x2554ec){logger[_0x5177('0xf')](_0x5177('0x1a'),_0x1b4102);logger[_0x5177('0x10')](_0x5177('0x1a'),_0x1b4102,JSON['stringify'](_0x2554ec));_0x3e6944(_0x2554ec);})['catch'](function(_0x45cf20){logger[_0x5177('0x14')](_0x5177('0x1a'),_0x45cf20[_0x5177('0x17')],_0x1b4102);_0x2ebf91(_0x5f5bd4[_0x5177('0x14')](0x1f4,_0x45cf20[_0x5177('0x17')]));});});};exports[_0x5177('0x24')]=function(_0x72dced){var _0x49f6f1=this;return new Promise(function(_0x42e1db,_0x2233a2){return db['VtigerAccount'][_0x5177('0x25')]({'raw':_0x72dced['options']?_0x72dced[_0x5177('0x1c')][_0x5177('0x1d')]===undefined?!![]:![]:!![],'where':_0x72dced[_0x5177('0x1c')]?_0x72dced['options']['where']||null:null,'attributes':_0x72dced[_0x5177('0x1c')]?_0x72dced[_0x5177('0x1c')][_0x5177('0x1f')]||null:null,'include':_0x72dced[_0x5177('0x1c')]?_0x72dced[_0x5177('0x1c')][_0x5177('0x22')]?_[_0x5177('0x21')](_0x72dced[_0x5177('0x1c')]['include'],function(_0x459ac6){return{'model':db[_0x459ac6[_0x5177('0x23')]],'as':_0x459ac6['as'],'attributes':_0x459ac6['attributes'],'include':_0x459ac6[_0x5177('0x22')]?_[_0x5177('0x21')](_0x459ac6[_0x5177('0x22')],function(_0x8727c6){return{'model':db[_0x8727c6[_0x5177('0x23')]],'as':_0x8727c6['as'],'attributes':_0x8727c6[_0x5177('0x1f')],'include':_0x8727c6['include']?_[_0x5177('0x21')](_0x8727c6[_0x5177('0x22')],function(_0x28b1d5){return{'model':db[_0x28b1d5[_0x5177('0x23')]],'as':_0x28b1d5['as'],'attributes':_0x28b1d5[_0x5177('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5177('0xe')](function(_0x1bb1e3){logger['info'](_0x5177('0x24'),_0x72dced);logger[_0x5177('0x10')]('ShowVtigerAccount',_0x72dced,JSON['stringify'](_0x1bb1e3));_0x42e1db(_0x1bb1e3);})[_0x5177('0x19')](function(_0x188cec){logger[_0x5177('0x14')](_0x5177('0x24'),_0x188cec[_0x5177('0x17')],_0x72dced);_0x2233a2(_0x49f6f1[_0x5177('0x14')](0x1f4,_0x188cec[_0x5177('0x17')]));});});};
\ No newline at end of file
index 6825a32..3c8086d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe488=['post','create','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions'];(function(_0x21090b,_0x39dd3b){var _0x3c68d7=function(_0x28ecd4){while(--_0x28ecd4){_0x21090b['push'](_0x21090b['shift']());}};_0x3c68d7(++_0x39dd3b);}(_0xe488,0x17e));var _0x8e48=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0xe488[_0x4b4f24];return _0x1c13d4;};'use strict';var multer=require(_0x8e48('0x0'));var util=require(_0x8e48('0x1'));var path=require(_0x8e48('0x2'));var timeout=require(_0x8e48('0x3'));var express=require(_0x8e48('0x4'));var router=express[_0x8e48('0x5')]();var fs_extra=require(_0x8e48('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e48('0x7'));var controller=require(_0x8e48('0x8'));router[_0x8e48('0x9')]('/',auth[_0x8e48('0xa')](),controller[_0x8e48('0xb')]);router[_0x8e48('0x9')](_0x8e48('0xc'),auth['isAuthenticated'](),controller[_0x8e48('0xd')]);router[_0x8e48('0x9')]('/:id/fields',auth[_0x8e48('0xa')](),controller[_0x8e48('0xe')]);router[_0x8e48('0x9')]('/:id/subjects',auth[_0x8e48('0xa')](),controller[_0x8e48('0xf')]);router[_0x8e48('0x9')](_0x8e48('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x8e48('0x11')]('/',auth['isAuthenticated'](),controller[_0x8e48('0x12')]);router[_0x8e48('0x13')](_0x8e48('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8e48('0xc'),auth[_0x8e48('0xa')](),controller['destroy']);module[_0x8e48('0x14')]=router;
\ No newline at end of file
+var _0xf6bd=['index','show','/:id/fields','getFields','getSubjects','isAuthenticated','getDescriptions','create','put','update','delete','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf6bd,0xb8));var _0xdf6b=function(_0x2e5405,_0x42ec09){_0x2e5405=_0x2e5405-0x0;var _0x2f0270=_0xf6bd[_0x2e5405];return _0x2f0270;};'use strict';var multer=require('multer');var util=require(_0xdf6b('0x0'));var path=require(_0xdf6b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdf6b('0x2'));var interaction=require(_0xdf6b('0x3'));var config=require(_0xdf6b('0x4'));var controller=require('./intVtigerConfiguration.controller');router[_0xdf6b('0x5')]('/',auth['isAuthenticated'](),controller[_0xdf6b('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdf6b('0x7')]);router[_0xdf6b('0x5')](_0xdf6b('0x8'),auth['isAuthenticated'](),controller[_0xdf6b('0x9')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xdf6b('0xa')]);router[_0xdf6b('0x5')]('/:id/descriptions',auth[_0xdf6b('0xb')](),controller[_0xdf6b('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdf6b('0xd')]);router[_0xdf6b('0xe')]('/:id',auth[_0xdf6b('0xb')](),controller[_0xdf6b('0xf')]);router[_0xdf6b('0x10')]('/:id',auth[_0xdf6b('0xb')](),controller[_0xdf6b('0x11')]);module[_0xdf6b('0x12')]=router;
\ No newline at end of file
index ea9415d..2162a71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9e8=['exports','STRING','sequelize'];(function(_0x4300e8,_0x1a0645){var _0x22de97=function(_0x374d5d){while(--_0x374d5d){_0x4300e8['push'](_0x4300e8['shift']());}};_0x22de97(++_0x1a0645);}(_0xe9e8,0x12b));var _0x8e9e=function(_0x549f3a,_0x361b88){_0x549f3a=_0x549f3a-0x0;var _0x2f7276=_0xe9e8[_0x549f3a];return _0x2f7276;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'name':{'type':Sequelize[_0x8e9e('0x2')]},'description':{'type':Sequelize[_0x8e9e('0x2')]}};
\ No newline at end of file
+var _0xee52=['exports','STRING','sequelize'];(function(_0x1aa936,_0x5da2b8){var _0x616742=function(_0x2f1fb8){while(--_0x2f1fb8){_0x1aa936['push'](_0x1aa936['shift']());}};_0x616742(++_0x5da2b8);}(_0xee52,0x80));var _0x2ee5=function(_0x3d782c,_0x58b420){_0x3d782c=_0x3d782c-0x0;var _0x170b98=_0xee52[_0x3d782c];return _0x170b98;};'use strict';var Sequelize=require(_0x2ee5('0x0'));module[_0x2ee5('0x1')]={'name':{'type':Sequelize[_0x2ee5('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index a7a5ead..d0b1a7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x105b=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','VtigerField','order','getSubjects','getDescriptions'];(function(_0x54bc67,_0x370cef){var _0x11efe1=function(_0x46873b){while(--_0x46873b){_0x54bc67['push'](_0x54bc67['shift']());}};_0x11efe1(++_0x370cef);}(_0x105b,0x1a9));var _0xb105=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x105b[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0xb105('0x0'));var rimraf=require(_0xb105('0x1'));var zipdir=require(_0xb105('0x2'));var jsonpatch=require(_0xb105('0x3'));var rp=require('request-promise');var moment=require(_0xb105('0x4'));var BPromise=require(_0xb105('0x5'));var Mustache=require(_0xb105('0x6'));var util=require(_0xb105('0x7'));var path=require(_0xb105('0x8'));var sox=require(_0xb105('0x9'));var csv=require(_0xb105('0xa'));var ejs=require(_0xb105('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb105('0xc'));var squel=require(_0xb105('0xd'));var crypto=require(_0xb105('0xe'));var jsforce=require(_0xb105('0xf'));var deskjs=require(_0xb105('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb105('0x11'));var Papa=require(_0xb105('0x12'));var Redis=require('ioredis');var authService=require(_0xb105('0x13'));var qs=require(_0xb105('0x14'));var as=require(_0xb105('0x15'));var hardwareService=require(_0xb105('0x16'));var logger=require(_0xb105('0x17'))(_0xb105('0x18'));var utils=require(_0xb105('0x19'));var config=require(_0xb105('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xb105('0x1b'))['db'];function respondWithStatusCode(_0x12cabd,_0x653ba2){_0x653ba2=_0x653ba2||0xcc;return function(_0x58ab7e){if(_0x58ab7e){return _0x12cabd['sendStatus'](_0x653ba2);}return _0x12cabd[_0xb105('0x1c')](_0x653ba2)[_0xb105('0x1d')]();};}function respondWithResult(_0x1faa49,_0x28c5f0){_0x28c5f0=_0x28c5f0||0xc8;return function(_0x7097e6){if(_0x7097e6){return _0x1faa49[_0xb105('0x1c')](_0x28c5f0)['json'](_0x7097e6);}};}function respondWithFilteredResult(_0x488280,_0x7c4304){return function(_0x7fe855){if(_0x7fe855){var _0x52b5d4=typeof _0x7c4304[_0xb105('0x1e')]===_0xb105('0x1f')&&typeof _0x7c4304[_0xb105('0x20')]===_0xb105('0x1f');var _0x163610=_0x7fe855['count'];var _0x31ad6b=_0x52b5d4?0x0:_0x7c4304[_0xb105('0x1e')];var _0x3046a5=_0x52b5d4?_0x7fe855[_0xb105('0x21')]:_0x7c4304['offset']+_0x7c4304[_0xb105('0x20')];var _0x2d1da9;if(_0x3046a5>=_0x163610){_0x3046a5=_0x163610;_0x2d1da9=0xc8;}else{_0x2d1da9=0xce;}_0x488280['status'](_0x2d1da9);return _0x488280[_0xb105('0x22')](_0xb105('0x23'),_0x31ad6b+'-'+_0x3046a5+'/'+_0x163610)[_0xb105('0x24')](_0x7fe855);}return null;};}function patchUpdates(_0x24820f){return function(_0x121ced){try{jsonpatch[_0xb105('0x25')](_0x121ced,_0x24820f,!![]);}catch(_0x1cd24c){return BPromise['reject'](_0x1cd24c);}return _0x121ced[_0xb105('0x26')]();};}function saveUpdates(_0x26f9e8,_0x1e01b3){return function(_0x18f54c){if(_0x18f54c){return _0x18f54c[_0xb105('0x27')](_0x26f9e8)[_0xb105('0x28')](function(_0x39f089){return _0x39f089;});}return null;};}function removeEntity(_0x5d9303,_0x471003){return function(_0x113168){if(_0x113168){return _0x113168[_0xb105('0x29')]()[_0xb105('0x28')](function(){_0x5d9303['status'](0xcc)[_0xb105('0x1d')]();});}};}function handleEntityNotFound(_0xf518c4,_0x641a90){return function(_0x4d5532){if(!_0x4d5532){_0xf518c4[_0xb105('0x2a')](0x194);}return _0x4d5532;};}function handleError(_0x27811e,_0x166679){_0x166679=_0x166679||0x1f4;return function(_0x5c9ab7){logger['error'](_0x5c9ab7[_0xb105('0x2b')]);if(_0x5c9ab7['name']){delete _0x5c9ab7[_0xb105('0x2c')];}_0x27811e['status'](_0x166679)[_0xb105('0x2d')](_0x5c9ab7);};}exports[_0xb105('0x2e')]=function(_0x5d024d,_0x58c152){var _0xede6e={},_0x2b29b7={},_0x44f7b1={'count':0x0,'rows':[]};var _0x357498=_[_0xb105('0x2f')](db[_0xb105('0x30')][_0xb105('0x31')],function(_0x5b704e){return{'name':_0x5b704e[_0xb105('0x32')],'type':_0x5b704e[_0xb105('0x33')][_0xb105('0x34')]};});_0x2b29b7[_0xb105('0x35')]=_['map'](_0x357498,_0xb105('0x2c'));_0x2b29b7[_0xb105('0x36')]=_[_0xb105('0x37')](_0x5d024d['query']);_0x2b29b7[_0xb105('0x38')]=_['intersection'](_0x2b29b7[_0xb105('0x35')],_0x2b29b7[_0xb105('0x36')]);_0xede6e[_0xb105('0x39')]=_[_0xb105('0x3a')](_0x2b29b7[_0xb105('0x35')],qs['fields'](_0x5d024d[_0xb105('0x36')][_0xb105('0x3b')]));_0xede6e['attributes']=_0xede6e[_0xb105('0x39')][_0xb105('0x3c')]?_0xede6e[_0xb105('0x39')]:_0x2b29b7[_0xb105('0x35')];if(!_0x5d024d[_0xb105('0x36')][_0xb105('0x3d')](_0xb105('0x3e'))){_0xede6e['limit']=qs[_0xb105('0x20')](_0x5d024d[_0xb105('0x36')]['limit']);_0xede6e[_0xb105('0x1e')]=qs[_0xb105('0x1e')](_0x5d024d[_0xb105('0x36')][_0xb105('0x1e')]);}_0xede6e['order']=qs[_0xb105('0x3f')](_0x5d024d[_0xb105('0x36')]['sort']);_0xede6e[_0xb105('0x40')]=qs[_0xb105('0x38')](_[_0xb105('0x41')](_0x5d024d[_0xb105('0x36')],_0x2b29b7[_0xb105('0x38')]),_0x357498);if(_0x5d024d['query'][_0xb105('0x42')]){_0xede6e[_0xb105('0x40')]=_[_0xb105('0x43')](_0xede6e['where'],{'$or':_['map'](_0x357498,function(_0x59f1d6){if(_0x59f1d6[_0xb105('0x33')]!==_0xb105('0x44')){var _0x1f42f1={};_0x1f42f1[_0x59f1d6['name']]={'$like':'%'+_0x5d024d[_0xb105('0x36')][_0xb105('0x42')]+'%'};return _0x1f42f1;}})});}_0xede6e=_[_0xb105('0x43')]({},_0xede6e,_0x5d024d[_0xb105('0x45')]);var _0x43369a={'where':_0xede6e[_0xb105('0x40')]};return db[_0xb105('0x30')][_0xb105('0x21')](_0x43369a)['then'](function(_0x52b5d7){_0x44f7b1[_0xb105('0x21')]=_0x52b5d7;if(_0x5d024d[_0xb105('0x36')][_0xb105('0x46')]){_0xede6e[_0xb105('0x47')]=[{'all':!![]}];}return db[_0xb105('0x30')][_0xb105('0x48')](_0xede6e);})['then'](function(_0x512b37){_0x44f7b1['rows']=_0x512b37;return _0x44f7b1;})[_0xb105('0x28')](respondWithFilteredResult(_0x58c152,_0xede6e))[_0xb105('0x49')](handleError(_0x58c152,null));};exports[_0xb105('0x4a')]=function(_0x4edd6c,_0x36d6bb){var _0x54887c={'raw':![],'where':{'id':_0x4edd6c[_0xb105('0x4b')]['id']}},_0x30944b={};_0x30944b[_0xb105('0x35')]=_['keys'](db['VtigerConfiguration'][_0xb105('0x31')]);_0x30944b[_0xb105('0x36')]=_[_0xb105('0x37')](_0x4edd6c['query']);_0x30944b['filters']=_[_0xb105('0x3a')](_0x30944b[_0xb105('0x35')],_0x30944b['query']);_0x54887c[_0xb105('0x39')]=_['intersection'](_0x30944b[_0xb105('0x35')],qs[_0xb105('0x3b')](_0x4edd6c[_0xb105('0x36')][_0xb105('0x3b')]));_0x54887c['attributes']=_0x54887c[_0xb105('0x39')][_0xb105('0x3c')]?_0x54887c[_0xb105('0x39')]:_0x30944b[_0xb105('0x35')];if(_0x4edd6c[_0xb105('0x36')][_0xb105('0x46')]){_0x54887c[_0xb105('0x47')]=[{'all':!![]}];}_0x54887c=_[_0xb105('0x43')]({},_0x54887c,_0x4edd6c[_0xb105('0x45')]);return db[_0xb105('0x30')][_0xb105('0x4c')](_0x54887c)[_0xb105('0x28')](handleEntityNotFound(_0x36d6bb,null))[_0xb105('0x28')](respondWithResult(_0x36d6bb,null))['catch'](handleError(_0x36d6bb,null));};exports[_0xb105('0x4d')]=function(_0x5b9bab,_0x1028b5){return db[_0xb105('0x30')][_0xb105('0x4d')](_0x5b9bab[_0xb105('0x4e')],{})[_0xb105('0x28')](respondWithResult(_0x1028b5,0xc9))[_0xb105('0x49')](handleError(_0x1028b5,null));};exports[_0xb105('0x27')]=function(_0x497f01,_0x344d64){if(_0x497f01[_0xb105('0x4e')]['id']){delete _0x497f01[_0xb105('0x4e')]['id'];}return db['VtigerConfiguration'][_0xb105('0x4c')]({'where':{'id':_0x497f01['params']['id']}})[_0xb105('0x28')](handleEntityNotFound(_0x344d64,null))[_0xb105('0x28')](saveUpdates(_0x497f01[_0xb105('0x4e')],null))[_0xb105('0x28')](respondWithResult(_0x344d64,null))[_0xb105('0x49')](handleError(_0x344d64,null));};exports[_0xb105('0x29')]=function(_0x26bebf,_0x17594e){return db[_0xb105('0x30')][_0xb105('0x4c')]({'where':{'id':_0x26bebf['params']['id']}})[_0xb105('0x28')](handleEntityNotFound(_0x17594e,null))['then'](removeEntity(_0x17594e,null))[_0xb105('0x49')](handleError(_0x17594e,null));};exports[_0xb105('0x4f')]=function(_0x12f04c,_0x4f0eef,_0x3fb23e){var _0x226674={};var _0x2e44e7={};var _0x115767;var _0x8b14eb;return db[_0xb105('0x30')][_0xb105('0x50')]({'where':{'id':_0x12f04c[_0xb105('0x4b')]['id']}})[_0xb105('0x28')](handleEntityNotFound(_0x4f0eef,null))[_0xb105('0x28')](function(_0x5d50fb){if(_0x5d50fb){_0x115767=_0x5d50fb;_0x2e44e7[_0xb105('0x35')]=_[_0xb105('0x37')](db[_0xb105('0x51')]['rawAttributes']);_0x2e44e7['query']=_[_0xb105('0x37')](_0x12f04c[_0xb105('0x36')]);_0x2e44e7[_0xb105('0x38')]=_[_0xb105('0x3a')](_0x2e44e7[_0xb105('0x35')],_0x2e44e7[_0xb105('0x36')]);_0x226674[_0xb105('0x39')]=_['intersection'](_0x2e44e7[_0xb105('0x35')],qs['fields'](_0x12f04c[_0xb105('0x36')][_0xb105('0x3b')]));_0x226674[_0xb105('0x39')]=_0x226674[_0xb105('0x39')][_0xb105('0x3c')]?_0x226674[_0xb105('0x39')]:_0x2e44e7[_0xb105('0x35')];_0x226674['order']=qs['sort'](_0x12f04c[_0xb105('0x36')]['sort']);_0x226674[_0xb105('0x40')]=qs[_0xb105('0x38')](_[_0xb105('0x41')](_0x12f04c[_0xb105('0x36')],_0x2e44e7[_0xb105('0x38')]));if(_0x12f04c[_0xb105('0x36')][_0xb105('0x42')]){_0x226674[_0xb105('0x40')]=_[_0xb105('0x43')](_0x226674[_0xb105('0x40')],{'$or':_['map'](_0x226674[_0xb105('0x39')],function(_0x4f0bdf){var _0x24021f={};_0x24021f[_0x4f0bdf]={'$like':'%'+_0x12f04c[_0xb105('0x36')][_0xb105('0x42')]+'%'};return _0x24021f;})});}_0x226674=_[_0xb105('0x43')]({},_0x226674,_0x12f04c[_0xb105('0x45')]);return _0x115767[_0xb105('0x4f')](_0x226674);}})[_0xb105('0x28')](function(_0xd5035c){if(_0xd5035c){_0x8b14eb=_0xd5035c['length'];if(!_0x12f04c[_0xb105('0x36')][_0xb105('0x3d')]('nolimit')){_0x226674[_0xb105('0x20')]=qs['limit'](_0x12f04c[_0xb105('0x36')][_0xb105('0x20')]);_0x226674[_0xb105('0x1e')]=qs[_0xb105('0x1e')](_0x12f04c[_0xb105('0x36')]['offset']);}return _0x115767[_0xb105('0x4f')](_0x226674);}})[_0xb105('0x28')](function(_0x18c700){if(_0x18c700){return _0x18c700?{'count':_0x8b14eb,'rows':_0x18c700}:null;}})['then'](respondWithResult(_0x4f0eef,null))[_0xb105('0x49')](handleError(_0x4f0eef,null));};exports['getSubjects']=function(_0x25542a,_0x75a517,_0x18c247){var _0x54e0ff={};var _0x5bcfe1={};var _0x1708fe;var _0x38eefe;return db[_0xb105('0x30')][_0xb105('0x50')]({'where':{'id':_0x25542a[_0xb105('0x4b')]['id']}})['then'](handleEntityNotFound(_0x75a517,null))[_0xb105('0x28')](function(_0x447990){if(_0x447990){_0x1708fe=_0x447990;_0x5bcfe1[_0xb105('0x35')]=_[_0xb105('0x37')](db[_0xb105('0x51')]['rawAttributes']);_0x5bcfe1[_0xb105('0x36')]=_['keys'](_0x25542a[_0xb105('0x36')]);_0x5bcfe1[_0xb105('0x38')]=_[_0xb105('0x3a')](_0x5bcfe1[_0xb105('0x35')],_0x5bcfe1[_0xb105('0x36')]);_0x54e0ff[_0xb105('0x39')]=_['intersection'](_0x5bcfe1['model'],qs[_0xb105('0x3b')](_0x25542a[_0xb105('0x36')]['fields']));_0x54e0ff['attributes']=_0x54e0ff[_0xb105('0x39')][_0xb105('0x3c')]?_0x54e0ff[_0xb105('0x39')]:_0x5bcfe1[_0xb105('0x35')];_0x54e0ff[_0xb105('0x52')]=qs[_0xb105('0x3f')](_0x25542a[_0xb105('0x36')][_0xb105('0x3f')]);_0x54e0ff[_0xb105('0x40')]=qs[_0xb105('0x38')](_[_0xb105('0x41')](_0x25542a[_0xb105('0x36')],_0x5bcfe1[_0xb105('0x38')]));if(_0x25542a[_0xb105('0x36')][_0xb105('0x42')]){_0x54e0ff[_0xb105('0x40')]=_[_0xb105('0x43')](_0x54e0ff['where'],{'$or':_[_0xb105('0x2f')](_0x54e0ff[_0xb105('0x39')],function(_0x2579d5){var _0x5ed2a0={};_0x5ed2a0[_0x2579d5]={'$like':'%'+_0x25542a[_0xb105('0x36')][_0xb105('0x42')]+'%'};return _0x5ed2a0;})});}_0x54e0ff=_[_0xb105('0x43')]({},_0x54e0ff,_0x25542a['options']);return _0x1708fe[_0xb105('0x53')](_0x54e0ff);}})['then'](function(_0x367988){if(_0x367988){_0x38eefe=_0x367988['length'];if(!_0x25542a[_0xb105('0x36')]['hasOwnProperty'](_0xb105('0x3e'))){_0x54e0ff[_0xb105('0x20')]=qs[_0xb105('0x20')](_0x25542a[_0xb105('0x36')][_0xb105('0x20')]);_0x54e0ff[_0xb105('0x1e')]=qs[_0xb105('0x1e')](_0x25542a[_0xb105('0x36')]['offset']);}return _0x1708fe[_0xb105('0x53')](_0x54e0ff);}})['then'](function(_0x1f45ee){if(_0x1f45ee){return _0x1f45ee?{'count':_0x38eefe,'rows':_0x1f45ee}:null;}})['then'](respondWithResult(_0x75a517,null))[_0xb105('0x49')](handleError(_0x75a517,null));};exports[_0xb105('0x54')]=function(_0x38c55f,_0x4d97b6,_0x4e9748){var _0x5e7ae8={};var _0x290128={};var _0x23fcf2;var _0x29a285;return db['VtigerConfiguration'][_0xb105('0x50')]({'where':{'id':_0x38c55f[_0xb105('0x4b')]['id']}})[_0xb105('0x28')](handleEntityNotFound(_0x4d97b6,null))[_0xb105('0x28')](function(_0x174f8f){if(_0x174f8f){_0x23fcf2=_0x174f8f;_0x290128[_0xb105('0x35')]=_[_0xb105('0x37')](db[_0xb105('0x51')][_0xb105('0x31')]);_0x290128['query']=_['keys'](_0x38c55f['query']);_0x290128[_0xb105('0x38')]=_[_0xb105('0x3a')](_0x290128[_0xb105('0x35')],_0x290128[_0xb105('0x36')]);_0x5e7ae8[_0xb105('0x39')]=_[_0xb105('0x3a')](_0x290128[_0xb105('0x35')],qs[_0xb105('0x3b')](_0x38c55f[_0xb105('0x36')][_0xb105('0x3b')]));_0x5e7ae8[_0xb105('0x39')]=_0x5e7ae8['attributes'][_0xb105('0x3c')]?_0x5e7ae8[_0xb105('0x39')]:_0x290128['model'];_0x5e7ae8[_0xb105('0x52')]=qs[_0xb105('0x3f')](_0x38c55f[_0xb105('0x36')][_0xb105('0x3f')]);_0x5e7ae8[_0xb105('0x40')]=qs[_0xb105('0x38')](_[_0xb105('0x41')](_0x38c55f[_0xb105('0x36')],_0x290128['filters']));if(_0x38c55f['query'][_0xb105('0x42')]){_0x5e7ae8['where']=_[_0xb105('0x43')](_0x5e7ae8[_0xb105('0x40')],{'$or':_[_0xb105('0x2f')](_0x5e7ae8[_0xb105('0x39')],function(_0x5092dc){var _0x27380d={};_0x27380d[_0x5092dc]={'$like':'%'+_0x38c55f[_0xb105('0x36')][_0xb105('0x42')]+'%'};return _0x27380d;})});}_0x5e7ae8=_[_0xb105('0x43')]({},_0x5e7ae8,_0x38c55f[_0xb105('0x45')]);return _0x23fcf2[_0xb105('0x54')](_0x5e7ae8);}})[_0xb105('0x28')](function(_0x1ecb28){if(_0x1ecb28){_0x29a285=_0x1ecb28[_0xb105('0x3c')];if(!_0x38c55f['query'][_0xb105('0x3d')](_0xb105('0x3e'))){_0x5e7ae8[_0xb105('0x20')]=qs[_0xb105('0x20')](_0x38c55f[_0xb105('0x36')][_0xb105('0x20')]);_0x5e7ae8[_0xb105('0x1e')]=qs[_0xb105('0x1e')](_0x38c55f[_0xb105('0x36')][_0xb105('0x1e')]);}return _0x23fcf2['getDescriptions'](_0x5e7ae8);}})[_0xb105('0x28')](function(_0x14334b){if(_0x14334b){return _0x14334b?{'count':_0x29a285,'rows':_0x14334b}:null;}})[_0xb105('0x28')](respondWithResult(_0x4d97b6,null))['catch'](handleError(_0x4d97b6,null));};
\ No newline at end of file
+var _0xd19f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','apply','save','update','then','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getFields','findOne','VtigerField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xd19f,0x1e4));var _0xfd19=function(_0x228ac9,_0x42f065){_0x228ac9=_0x228ac9-0x0;var _0x69fe02=_0xd19f[_0x228ac9];return _0x69fe02;};'use strict';var emlformat=require(_0xfd19('0x0'));var rimraf=require(_0xfd19('0x1'));var zipdir=require(_0xfd19('0x2'));var jsonpatch=require(_0xfd19('0x3'));var rp=require(_0xfd19('0x4'));var moment=require(_0xfd19('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfd19('0x6'));var util=require(_0xfd19('0x7'));var path=require(_0xfd19('0x8'));var sox=require('sox');var csv=require(_0xfd19('0x9'));var ejs=require(_0xfd19('0xa'));var fs=require('fs');var fs_extra=require(_0xfd19('0xb'));var _=require(_0xfd19('0xc'));var squel=require(_0xfd19('0xd'));var crypto=require('crypto');var jsforce=require(_0xfd19('0xe'));var deskjs=require(_0xfd19('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfd19('0x10'));var Papa=require(_0xfd19('0x11'));var Redis=require(_0xfd19('0x12'));var authService=require(_0xfd19('0x13'));var qs=require(_0xfd19('0x14'));var as=require(_0xfd19('0x15'));var hardwareService=require(_0xfd19('0x16'));var logger=require(_0xfd19('0x17'))('api');var utils=require(_0xfd19('0x18'));var config=require(_0xfd19('0x19'));var licenseUtil=require(_0xfd19('0x1a'));var db=require(_0xfd19('0x1b'))['db'];function respondWithStatusCode(_0x5f2f3d,_0x27a2d5){_0x27a2d5=_0x27a2d5||0xcc;return function(_0x4e7469){if(_0x4e7469){return _0x5f2f3d[_0xfd19('0x1c')](_0x27a2d5);}return _0x5f2f3d[_0xfd19('0x1d')](_0x27a2d5)[_0xfd19('0x1e')]();};}function respondWithResult(_0x53b92f,_0x3ae489){_0x3ae489=_0x3ae489||0xc8;return function(_0x52ab7b){if(_0x52ab7b){return _0x53b92f[_0xfd19('0x1d')](_0x3ae489)[_0xfd19('0x1f')](_0x52ab7b);}};}function respondWithFilteredResult(_0x34c13d,_0x3f15b8){return function(_0x5c7575){if(_0x5c7575){var _0x54e50e=typeof _0x3f15b8['offset']===_0xfd19('0x20')&&typeof _0x3f15b8['limit']===_0xfd19('0x20');var _0x3bdc0d=_0x5c7575[_0xfd19('0x21')];var _0x3cb6e9=_0x54e50e?0x0:_0x3f15b8[_0xfd19('0x22')];var _0x6ebde7=_0x54e50e?_0x5c7575[_0xfd19('0x21')]:_0x3f15b8['offset']+_0x3f15b8['limit'];var _0x13b126;if(_0x6ebde7>=_0x3bdc0d){_0x6ebde7=_0x3bdc0d;_0x13b126=0xc8;}else{_0x13b126=0xce;}_0x34c13d[_0xfd19('0x1d')](_0x13b126);return _0x34c13d['set']('Content-Range',_0x3cb6e9+'-'+_0x6ebde7+'/'+_0x3bdc0d)['json'](_0x5c7575);}return null;};}function patchUpdates(_0x54e703){return function(_0x5084bc){try{jsonpatch[_0xfd19('0x23')](_0x5084bc,_0x54e703,!![]);}catch(_0x7f854a){return BPromise['reject'](_0x7f854a);}return _0x5084bc[_0xfd19('0x24')]();};}function saveUpdates(_0x50e94e,_0x1e0543){return function(_0x219e0d){if(_0x219e0d){return _0x219e0d[_0xfd19('0x25')](_0x50e94e)[_0xfd19('0x26')](function(_0x35d424){return _0x35d424;});}return null;};}function removeEntity(_0x1e8be0,_0x2bcc68){return function(_0x5116f9){if(_0x5116f9){return _0x5116f9['destroy']()[_0xfd19('0x26')](function(){_0x1e8be0[_0xfd19('0x1d')](0xcc)[_0xfd19('0x1e')]();});}};}function handleEntityNotFound(_0x4e535d,_0x32151e){return function(_0x5e5711){if(!_0x5e5711){_0x4e535d['sendStatus'](0x194);}return _0x5e5711;};}function handleError(_0x56278,_0x1ef3a5){_0x1ef3a5=_0x1ef3a5||0x1f4;return function(_0x435e39){logger[_0xfd19('0x27')](_0x435e39[_0xfd19('0x28')]);if(_0x435e39[_0xfd19('0x29')]){delete _0x435e39['name'];}_0x56278[_0xfd19('0x1d')](_0x1ef3a5)[_0xfd19('0x2a')](_0x435e39);};}exports[_0xfd19('0x2b')]=function(_0x295c7b,_0x54c48f){var _0x2b2f4b={},_0x4b260c={},_0x188f92={'count':0x0,'rows':[]};var _0x14b8ab=_[_0xfd19('0x2c')](db[_0xfd19('0x2d')][_0xfd19('0x2e')],function(_0x41632d){return{'name':_0x41632d['fieldName'],'type':_0x41632d['type'][_0xfd19('0x2f')]};});_0x4b260c['model']=_[_0xfd19('0x2c')](_0x14b8ab,_0xfd19('0x29'));_0x4b260c[_0xfd19('0x30')]=_[_0xfd19('0x31')](_0x295c7b[_0xfd19('0x30')]);_0x4b260c[_0xfd19('0x32')]=_[_0xfd19('0x33')](_0x4b260c[_0xfd19('0x34')],_0x4b260c[_0xfd19('0x30')]);_0x2b2f4b[_0xfd19('0x35')]=_[_0xfd19('0x33')](_0x4b260c[_0xfd19('0x34')],qs['fields'](_0x295c7b[_0xfd19('0x30')][_0xfd19('0x36')]));_0x2b2f4b[_0xfd19('0x35')]=_0x2b2f4b[_0xfd19('0x35')][_0xfd19('0x37')]?_0x2b2f4b[_0xfd19('0x35')]:_0x4b260c[_0xfd19('0x34')];if(!_0x295c7b[_0xfd19('0x30')]['hasOwnProperty'](_0xfd19('0x38'))){_0x2b2f4b[_0xfd19('0x39')]=qs[_0xfd19('0x39')](_0x295c7b[_0xfd19('0x30')]['limit']);_0x2b2f4b[_0xfd19('0x22')]=qs[_0xfd19('0x22')](_0x295c7b['query']['offset']);}_0x2b2f4b['order']=qs[_0xfd19('0x3a')](_0x295c7b['query'][_0xfd19('0x3a')]);_0x2b2f4b[_0xfd19('0x3b')]=qs[_0xfd19('0x32')](_[_0xfd19('0x3c')](_0x295c7b[_0xfd19('0x30')],_0x4b260c['filters']),_0x14b8ab);if(_0x295c7b[_0xfd19('0x30')][_0xfd19('0x3d')]){_0x2b2f4b[_0xfd19('0x3b')]=_[_0xfd19('0x3e')](_0x2b2f4b[_0xfd19('0x3b')],{'$or':_[_0xfd19('0x2c')](_0x14b8ab,function(_0x29f69f){if(_0x29f69f[_0xfd19('0x3f')]!==_0xfd19('0x40')){var _0x4fa9cf={};_0x4fa9cf[_0x29f69f[_0xfd19('0x29')]]={'$like':'%'+_0x295c7b['query'][_0xfd19('0x3d')]+'%'};return _0x4fa9cf;}})});}_0x2b2f4b=_[_0xfd19('0x3e')]({},_0x2b2f4b,_0x295c7b['options']);var _0x1d4845={'where':_0x2b2f4b[_0xfd19('0x3b')]};return db['VtigerConfiguration'][_0xfd19('0x21')](_0x1d4845)[_0xfd19('0x26')](function(_0x5bebb9){_0x188f92[_0xfd19('0x21')]=_0x5bebb9;if(_0x295c7b[_0xfd19('0x30')][_0xfd19('0x41')]){_0x2b2f4b[_0xfd19('0x42')]=[{'all':!![]}];}return db[_0xfd19('0x2d')][_0xfd19('0x43')](_0x2b2f4b);})['then'](function(_0x72f606){_0x188f92[_0xfd19('0x44')]=_0x72f606;return _0x188f92;})[_0xfd19('0x26')](respondWithFilteredResult(_0x54c48f,_0x2b2f4b))[_0xfd19('0x45')](handleError(_0x54c48f,null));};exports[_0xfd19('0x46')]=function(_0x31d68c,_0x5797cd){var _0x49af18={'raw':![],'where':{'id':_0x31d68c[_0xfd19('0x47')]['id']}},_0x395780={};_0x395780[_0xfd19('0x34')]=_['keys'](db['VtigerConfiguration'][_0xfd19('0x2e')]);_0x395780[_0xfd19('0x30')]=_['keys'](_0x31d68c[_0xfd19('0x30')]);_0x395780[_0xfd19('0x32')]=_[_0xfd19('0x33')](_0x395780[_0xfd19('0x34')],_0x395780[_0xfd19('0x30')]);_0x49af18[_0xfd19('0x35')]=_[_0xfd19('0x33')](_0x395780[_0xfd19('0x34')],qs[_0xfd19('0x36')](_0x31d68c['query'][_0xfd19('0x36')]));_0x49af18['attributes']=_0x49af18['attributes'][_0xfd19('0x37')]?_0x49af18[_0xfd19('0x35')]:_0x395780[_0xfd19('0x34')];if(_0x31d68c[_0xfd19('0x30')][_0xfd19('0x41')]){_0x49af18[_0xfd19('0x42')]=[{'all':!![]}];}_0x49af18=_['merge']({},_0x49af18,_0x31d68c[_0xfd19('0x48')]);return db[_0xfd19('0x2d')][_0xfd19('0x49')](_0x49af18)['then'](handleEntityNotFound(_0x5797cd,null))[_0xfd19('0x26')](respondWithResult(_0x5797cd,null))[_0xfd19('0x45')](handleError(_0x5797cd,null));};exports[_0xfd19('0x4a')]=function(_0xb13b1d,_0x32e5b6){return db['VtigerConfiguration'][_0xfd19('0x4a')](_0xb13b1d[_0xfd19('0x4b')],{})['then'](respondWithResult(_0x32e5b6,0xc9))[_0xfd19('0x45')](handleError(_0x32e5b6,null));};exports[_0xfd19('0x25')]=function(_0xee7132,_0x54357d){if(_0xee7132[_0xfd19('0x4b')]['id']){delete _0xee7132['body']['id'];}return db[_0xfd19('0x2d')][_0xfd19('0x49')]({'where':{'id':_0xee7132['params']['id']}})['then'](handleEntityNotFound(_0x54357d,null))[_0xfd19('0x26')](saveUpdates(_0xee7132['body'],null))[_0xfd19('0x26')](respondWithResult(_0x54357d,null))[_0xfd19('0x45')](handleError(_0x54357d,null));};exports[_0xfd19('0x4c')]=function(_0x5359d7,_0x7bff66){return db['VtigerConfiguration'][_0xfd19('0x49')]({'where':{'id':_0x5359d7[_0xfd19('0x47')]['id']}})['then'](handleEntityNotFound(_0x7bff66,null))[_0xfd19('0x26')](removeEntity(_0x7bff66,null))[_0xfd19('0x45')](handleError(_0x7bff66,null));};exports[_0xfd19('0x4d')]=function(_0x3ccf8d,_0x149fee,_0x1ba037){var _0x1ffba1={};var _0x5bf6c3={};var _0xa873cc;var _0xaa19c3;return db['VtigerConfiguration'][_0xfd19('0x4e')]({'where':{'id':_0x3ccf8d['params']['id']}})[_0xfd19('0x26')](handleEntityNotFound(_0x149fee,null))[_0xfd19('0x26')](function(_0x500978){if(_0x500978){_0xa873cc=_0x500978;_0x5bf6c3['model']=_[_0xfd19('0x31')](db[_0xfd19('0x4f')]['rawAttributes']);_0x5bf6c3['query']=_[_0xfd19('0x31')](_0x3ccf8d[_0xfd19('0x30')]);_0x5bf6c3[_0xfd19('0x32')]=_['intersection'](_0x5bf6c3[_0xfd19('0x34')],_0x5bf6c3[_0xfd19('0x30')]);_0x1ffba1[_0xfd19('0x35')]=_[_0xfd19('0x33')](_0x5bf6c3[_0xfd19('0x34')],qs['fields'](_0x3ccf8d[_0xfd19('0x30')][_0xfd19('0x36')]));_0x1ffba1[_0xfd19('0x35')]=_0x1ffba1[_0xfd19('0x35')][_0xfd19('0x37')]?_0x1ffba1[_0xfd19('0x35')]:_0x5bf6c3[_0xfd19('0x34')];_0x1ffba1[_0xfd19('0x50')]=qs['sort'](_0x3ccf8d[_0xfd19('0x30')][_0xfd19('0x3a')]);_0x1ffba1[_0xfd19('0x3b')]=qs['filters'](_[_0xfd19('0x3c')](_0x3ccf8d[_0xfd19('0x30')],_0x5bf6c3[_0xfd19('0x32')]));if(_0x3ccf8d[_0xfd19('0x30')][_0xfd19('0x3d')]){_0x1ffba1[_0xfd19('0x3b')]=_[_0xfd19('0x3e')](_0x1ffba1[_0xfd19('0x3b')],{'$or':_[_0xfd19('0x2c')](_0x1ffba1[_0xfd19('0x35')],function(_0x34ee2e){var _0x698010={};_0x698010[_0x34ee2e]={'$like':'%'+_0x3ccf8d[_0xfd19('0x30')][_0xfd19('0x3d')]+'%'};return _0x698010;})});}_0x1ffba1=_[_0xfd19('0x3e')]({},_0x1ffba1,_0x3ccf8d[_0xfd19('0x48')]);return _0xa873cc[_0xfd19('0x4d')](_0x1ffba1);}})['then'](function(_0x49aa63){if(_0x49aa63){_0xaa19c3=_0x49aa63[_0xfd19('0x37')];if(!_0x3ccf8d[_0xfd19('0x30')][_0xfd19('0x51')]('nolimit')){_0x1ffba1[_0xfd19('0x39')]=qs['limit'](_0x3ccf8d[_0xfd19('0x30')][_0xfd19('0x39')]);_0x1ffba1[_0xfd19('0x22')]=qs[_0xfd19('0x22')](_0x3ccf8d[_0xfd19('0x30')][_0xfd19('0x22')]);}return _0xa873cc[_0xfd19('0x4d')](_0x1ffba1);}})[_0xfd19('0x26')](function(_0x37cbed){if(_0x37cbed){return _0x37cbed?{'count':_0xaa19c3,'rows':_0x37cbed}:null;}})[_0xfd19('0x26')](respondWithResult(_0x149fee,null))[_0xfd19('0x45')](handleError(_0x149fee,null));};exports[_0xfd19('0x52')]=function(_0x27d256,_0x1dd88e,_0x2c499d){var _0x30ac06={};var _0x158bcc={};var _0x52f0d0;var _0x43c332;return db[_0xfd19('0x2d')][_0xfd19('0x4e')]({'where':{'id':_0x27d256[_0xfd19('0x47')]['id']}})['then'](handleEntityNotFound(_0x1dd88e,null))['then'](function(_0x98dd9f){if(_0x98dd9f){_0x52f0d0=_0x98dd9f;_0x158bcc[_0xfd19('0x34')]=_[_0xfd19('0x31')](db['VtigerField'][_0xfd19('0x2e')]);_0x158bcc[_0xfd19('0x30')]=_[_0xfd19('0x31')](_0x27d256['query']);_0x158bcc[_0xfd19('0x32')]=_['intersection'](_0x158bcc[_0xfd19('0x34')],_0x158bcc[_0xfd19('0x30')]);_0x30ac06['attributes']=_[_0xfd19('0x33')](_0x158bcc[_0xfd19('0x34')],qs[_0xfd19('0x36')](_0x27d256[_0xfd19('0x30')][_0xfd19('0x36')]));_0x30ac06[_0xfd19('0x35')]=_0x30ac06[_0xfd19('0x35')]['length']?_0x30ac06[_0xfd19('0x35')]:_0x158bcc[_0xfd19('0x34')];_0x30ac06['order']=qs[_0xfd19('0x3a')](_0x27d256[_0xfd19('0x30')]['sort']);_0x30ac06[_0xfd19('0x3b')]=qs[_0xfd19('0x32')](_[_0xfd19('0x3c')](_0x27d256['query'],_0x158bcc[_0xfd19('0x32')]));if(_0x27d256[_0xfd19('0x30')]['filter']){_0x30ac06[_0xfd19('0x3b')]=_[_0xfd19('0x3e')](_0x30ac06[_0xfd19('0x3b')],{'$or':_['map'](_0x30ac06['attributes'],function(_0x4a2e0c){var _0x4ebfa0={};_0x4ebfa0[_0x4a2e0c]={'$like':'%'+_0x27d256['query'][_0xfd19('0x3d')]+'%'};return _0x4ebfa0;})});}_0x30ac06=_['merge']({},_0x30ac06,_0x27d256[_0xfd19('0x48')]);return _0x52f0d0['getSubjects'](_0x30ac06);}})[_0xfd19('0x26')](function(_0x47d598){if(_0x47d598){_0x43c332=_0x47d598[_0xfd19('0x37')];if(!_0x27d256[_0xfd19('0x30')]['hasOwnProperty']('nolimit')){_0x30ac06[_0xfd19('0x39')]=qs['limit'](_0x27d256[_0xfd19('0x30')]['limit']);_0x30ac06[_0xfd19('0x22')]=qs['offset'](_0x27d256[_0xfd19('0x30')][_0xfd19('0x22')]);}return _0x52f0d0['getSubjects'](_0x30ac06);}})[_0xfd19('0x26')](function(_0x3d934a){if(_0x3d934a){return _0x3d934a?{'count':_0x43c332,'rows':_0x3d934a}:null;}})['then'](respondWithResult(_0x1dd88e,null))[_0xfd19('0x45')](handleError(_0x1dd88e,null));};exports['getDescriptions']=function(_0x4e2e19,_0x156a05,_0x46f625){var _0x395442={};var _0x1f4313={};var _0x26a212;var _0x3d2e03;return db[_0xfd19('0x2d')][_0xfd19('0x4e')]({'where':{'id':_0x4e2e19['params']['id']}})[_0xfd19('0x26')](handleEntityNotFound(_0x156a05,null))[_0xfd19('0x26')](function(_0xaaef6d){if(_0xaaef6d){_0x26a212=_0xaaef6d;_0x1f4313['model']=_[_0xfd19('0x31')](db[_0xfd19('0x4f')][_0xfd19('0x2e')]);_0x1f4313[_0xfd19('0x30')]=_['keys'](_0x4e2e19[_0xfd19('0x30')]);_0x1f4313[_0xfd19('0x32')]=_[_0xfd19('0x33')](_0x1f4313['model'],_0x1f4313['query']);_0x395442[_0xfd19('0x35')]=_[_0xfd19('0x33')](_0x1f4313[_0xfd19('0x34')],qs[_0xfd19('0x36')](_0x4e2e19[_0xfd19('0x30')]['fields']));_0x395442[_0xfd19('0x35')]=_0x395442[_0xfd19('0x35')]['length']?_0x395442['attributes']:_0x1f4313[_0xfd19('0x34')];_0x395442[_0xfd19('0x50')]=qs['sort'](_0x4e2e19[_0xfd19('0x30')]['sort']);_0x395442[_0xfd19('0x3b')]=qs[_0xfd19('0x32')](_[_0xfd19('0x3c')](_0x4e2e19[_0xfd19('0x30')],_0x1f4313[_0xfd19('0x32')]));if(_0x4e2e19[_0xfd19('0x30')][_0xfd19('0x3d')]){_0x395442[_0xfd19('0x3b')]=_['merge'](_0x395442[_0xfd19('0x3b')],{'$or':_[_0xfd19('0x2c')](_0x395442[_0xfd19('0x35')],function(_0x5f57ad){var _0x4c00dc={};_0x4c00dc[_0x5f57ad]={'$like':'%'+_0x4e2e19[_0xfd19('0x30')][_0xfd19('0x3d')]+'%'};return _0x4c00dc;})});}_0x395442=_[_0xfd19('0x3e')]({},_0x395442,_0x4e2e19['options']);return _0x26a212[_0xfd19('0x53')](_0x395442);}})[_0xfd19('0x26')](function(_0x4736f1){if(_0x4736f1){_0x3d2e03=_0x4736f1[_0xfd19('0x37')];if(!_0x4e2e19[_0xfd19('0x30')]['hasOwnProperty']('nolimit')){_0x395442[_0xfd19('0x39')]=qs[_0xfd19('0x39')](_0x4e2e19['query'][_0xfd19('0x39')]);_0x395442['offset']=qs[_0xfd19('0x22')](_0x4e2e19[_0xfd19('0x30')]['offset']);}return _0x26a212[_0xfd19('0x53')](_0x395442);}})[_0xfd19('0x26')](function(_0x367db3){if(_0x367db3){return _0x367db3?{'count':_0x3d2e03,'rows':_0x367db3}:null;}})[_0xfd19('0x26')](respondWithResult(_0x156a05,null))[_0xfd19('0x45')](handleError(_0x156a05,null));};
\ No newline at end of file
index 0a0f440..39f97e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x525e=['api','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util'];(function(_0x4e9045,_0x1c56f2){var _0x333e11=function(_0x39e3ab){while(--_0x39e3ab){_0x4e9045['push'](_0x4e9045['shift']());}};_0x333e11(++_0x1c56f2);}(_0x525e,0x9e));var _0xe525=function(_0x542c16,_0x288274){_0x542c16=_0x542c16-0x0;var _0x1d812f=_0x525e[_0x542c16];return _0x1d812f;};'use strict';var _=require(_0xe525('0x0'));var util=require(_0xe525('0x1'));var logger=require('../../config/logger')(_0xe525('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe525('0x3'));var fs=require('fs');var path=require(_0xe525('0x4'));var rimraf=require(_0xe525('0x5'));var config=require('../../config/environment');var attributes=require(_0xe525('0x6'));module[_0xe525('0x7')]=function(_0x3f0d9f,_0x3dc3f7){return _0x3f0d9f[_0xe525('0x8')](_0xe525('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c72=['moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','util','../../config/logger'];(function(_0x40401b,_0x52964f){var _0x12a63a=function(_0x1784a6){while(--_0x1784a6){_0x40401b['push'](_0x40401b['shift']());}};_0x12a63a(++_0x52964f);}(_0x5c72,0x120));var _0x25c7=function(_0x412e5c,_0x54b121){_0x412e5c=_0x412e5c-0x0;var _0x24f9a2=_0x5c72[_0x412e5c];return _0x24f9a2;};'use strict';var _=require('lodash');var util=require(_0x25c7('0x0'));var logger=require(_0x25c7('0x1'))('api');var moment=require(_0x25c7('0x2'));var BPromise=require(_0x25c7('0x3'));var rp=require(_0x25c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25c7('0x5'));var config=require(_0x25c7('0x6'));var attributes=require(_0x25c7('0x7'));module['exports']=function(_0x49013c,_0x65b6c9){return _0x49013c[_0x25c7('0x8')](_0x25c7('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0871003..10acf02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3431=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash'];(function(_0x184d5a,_0x1343a4){var _0x2d3793=function(_0x18970b){while(--_0x18970b){_0x184d5a['push'](_0x184d5a['shift']());}};_0x2d3793(++_0x1343a4);}(_0x3431,0x125));var _0x1343=function(_0x4fe19c,_0x45d0fe){_0x4fe19c=_0x4fe19c-0x0;var _0x952ac7=_0x3431[_0x4fe19c];return _0x952ac7;};'use strict';var _=require(_0x1343('0x0'));var util=require(_0x1343('0x1'));var moment=require(_0x1343('0x2'));var BPromise=require(_0x1343('0x3'));var rs=require(_0x1343('0x4'));var fs=require('fs');var Redis=require(_0x1343('0x5'));var db=require(_0x1343('0x6'))['db'];var utils=require(_0x1343('0x7'));var logger=require(_0x1343('0x8'))(_0x1343('0x9'));var config=require(_0x1343('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1343('0xb')][_0x1343('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x310aaa,_0x4ed4d0,_0x5aa200){return new BPromise(function(_0x2de4e1,_0xf80fcd){return client[_0x1343('0xd')](_0x310aaa,_0x5aa200)['then'](function(_0x490c3c){logger['info'](_0x1343('0xe'),_0x4ed4d0,_0x1343('0xf'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x4ed4d0,_0x1343('0xf'),JSON[_0x1343('0x10')](_0x490c3c));if(_0x490c3c[_0x1343('0x11')]){if(_0x490c3c['error'][_0x1343('0x12')]===0x1f4){logger[_0x1343('0x11')](_0x1343('0xe'),_0x4ed4d0,_0x490c3c[_0x1343('0x11')]['message']);return _0xf80fcd(_0x490c3c['error'][_0x1343('0x13')]);}logger[_0x1343('0x11')](_0x1343('0xe'),_0x4ed4d0,_0x490c3c[_0x1343('0x11')][_0x1343('0x13')]);return _0x2de4e1(_0x490c3c[_0x1343('0x11')][_0x1343('0x13')]);}else{logger[_0x1343('0x14')](_0x1343('0xe'),_0x4ed4d0,_0x1343('0xf'));_0x2de4e1(_0x490c3c['result'][_0x1343('0x13')]);}})['catch'](function(_0x24d735){logger['error'](_0x1343('0xe'),_0x4ed4d0,_0x24d735);_0xf80fcd(_0x24d735);});});}
\ No newline at end of file
+var _0x2551=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2490ad,_0x33836e){var _0x38262d=function(_0x159a42){while(--_0x159a42){_0x2490ad['push'](_0x2490ad['shift']());}};_0x38262d(++_0x33836e);}(_0x2551,0xd7));var _0x1255=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x2551[_0x441563];return _0x2369ec;};'use strict';var _=require(_0x1255('0x0'));var util=require(_0x1255('0x1'));var moment=require(_0x1255('0x2'));var BPromise=require(_0x1255('0x3'));var rs=require(_0x1255('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1255('0x5'))['db'];var utils=require(_0x1255('0x6'));var logger=require(_0x1255('0x7'))(_0x1255('0x8'));var config=require(_0x1255('0x9'));var jayson=require(_0x1255('0xa'));var client=jayson['client'][_0x1255('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x515040,_0x28fe85,_0x41c4e6){return new BPromise(function(_0x47eb82,_0x2d7783){return client['request'](_0x515040,_0x41c4e6)[_0x1255('0xc')](function(_0xaad351){logger[_0x1255('0xd')](_0x1255('0xe'),_0x28fe85,_0x1255('0xf'));logger[_0x1255('0x10')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x28fe85,_0x1255('0xf'),JSON['stringify'](_0xaad351));if(_0xaad351[_0x1255('0x11')]){if(_0xaad351[_0x1255('0x11')][_0x1255('0x12')]===0x1f4){logger[_0x1255('0x11')](_0x1255('0xe'),_0x28fe85,_0xaad351[_0x1255('0x11')][_0x1255('0x13')]);return _0x2d7783(_0xaad351[_0x1255('0x11')][_0x1255('0x13')]);}logger[_0x1255('0x11')](_0x1255('0xe'),_0x28fe85,_0xaad351[_0x1255('0x11')][_0x1255('0x13')]);return _0x47eb82(_0xaad351['error']['message']);}else{logger[_0x1255('0xd')](_0x1255('0xe'),_0x28fe85,_0x1255('0xf'));_0x47eb82(_0xaad351[_0x1255('0x14')][_0x1255('0x13')]);}})[_0x1255('0x15')](function(_0x2f34da){logger[_0x1255('0x11')](_0x1255('0xe'),_0x28fe85,_0x2f34da);_0x2d7783(_0x2f34da);});});}
\ No newline at end of file
index 82e0b7a..c6f40ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb66=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','index','get','/:id','isAuthenticated','show','post','create','delete','destroy'];(function(_0x5a58af,_0x2fd0e0){var _0x40b593=function(_0x354331){while(--_0x354331){_0x5a58af['push'](_0x5a58af['shift']());}};_0x40b593(++_0x2fd0e0);}(_0xbb66,0xac));var _0x6bb6=function(_0x3b7261,_0x740aa4){_0x3b7261=_0x3b7261-0x0;var _0x4ed949=_0xbb66[_0x3b7261];return _0x4ed949;};'use strict';var multer=require(_0x6bb6('0x0'));var util=require(_0x6bb6('0x1'));var path=require(_0x6bb6('0x2'));var timeout=require(_0x6bb6('0x3'));var express=require(_0x6bb6('0x4'));var router=express['Router']();var fs_extra=require(_0x6bb6('0x5'));var auth=require(_0x6bb6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6bb6('0x7'));var controller=require(_0x6bb6('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6bb6('0x9')]);router[_0x6bb6('0xa')](_0x6bb6('0xb'),auth[_0x6bb6('0xc')](),controller[_0x6bb6('0xd')]);router[_0x6bb6('0xe')]('/',auth['isAuthenticated'](),controller[_0x6bb6('0xf')]);router['put'](_0x6bb6('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6bb6('0x10')](_0x6bb6('0xb'),auth[_0x6bb6('0xc')](),controller[_0x6bb6('0x11')]);module[_0x6bb6('0x12')]=router;
\ No newline at end of file
+var _0xb330=['./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5178fb,_0x121e19){var _0x348183=function(_0x52c2ec){while(--_0x52c2ec){_0x5178fb['push'](_0x5178fb['shift']());}};_0x348183(++_0x121e19);}(_0xb330,0x175));var _0x0b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb330[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0b33('0x0'));var util=require(_0x0b33('0x1'));var path=require(_0x0b33('0x2'));var timeout=require('connect-timeout');var express=require(_0x0b33('0x3'));var router=express[_0x0b33('0x4')]();var fs_extra=require(_0x0b33('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0b33('0x6'));var config=require('../../config/environment');var controller=require(_0x0b33('0x7'));router[_0x0b33('0x8')]('/',auth[_0x0b33('0x9')](),controller['index']);router[_0x0b33('0x8')](_0x0b33('0xa'),auth[_0x0b33('0x9')](),controller[_0x0b33('0xb')]);router[_0x0b33('0xc')]('/',auth[_0x0b33('0x9')](),controller[_0x0b33('0xd')]);router[_0x0b33('0xe')](_0x0b33('0xa'),auth['isAuthenticated'](),controller[_0x0b33('0xf')]);router[_0x0b33('0x10')]('/:id',auth[_0x0b33('0x9')](),controller[_0x0b33('0x11')]);module[_0x0b33('0x12')]=router;
\ No newline at end of file
index 9fd4da9..bcba91e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7baf=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1182e1,_0x1e4488){var _0x512acb=function(_0x5c2501){while(--_0x5c2501){_0x1182e1['push'](_0x1182e1['shift']());}};_0x512acb(++_0x1e4488);}(_0x7baf,0x1ad));var _0xf7ba=function(_0x4adff1,_0x4a8cbe){_0x4adff1=_0x4adff1-0x0;var _0x318759=_0x7baf[_0x4adff1];return _0x318759;};'use strict';var Sequelize=require(_0xf7ba('0x0'));module[_0xf7ba('0x1')]={'type':{'type':Sequelize[_0xf7ba('0x2')](_0xf7ba('0x3'),_0xf7ba('0x4'),_0xf7ba('0x5'),'keyValue',_0xf7ba('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf7ba('0x7')]},'key':{'type':Sequelize[_0xf7ba('0x7')]},'keyType':{'type':Sequelize[_0xf7ba('0x2')](_0xf7ba('0x3'),_0xf7ba('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf7ba('0x7')]},'nameField':{'type':Sequelize[_0xf7ba('0x7')]},'customField':{'type':Sequelize[_0xf7ba('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6bbd=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x9dfc30,_0x5b5fbf){var _0x299e3a=function(_0x3bf3ee){while(--_0x3bf3ee){_0x9dfc30['push'](_0x9dfc30['shift']());}};_0x299e3a(++_0x5b5fbf);}(_0x6bbd,0x17f));var _0xd6bb=function(_0x30f272,_0x401f2d){_0x30f272=_0x30f272-0x0;var _0x1969ce=_0x6bbd[_0x30f272];return _0x1969ce;};'use strict';var Sequelize=require(_0xd6bb('0x0'));module[_0xd6bb('0x1')]={'type':{'type':Sequelize[_0xd6bb('0x2')](_0xd6bb('0x3'),_0xd6bb('0x4'),_0xd6bb('0x5'),'keyValue',_0xd6bb('0x6')),'defaultValue':_0xd6bb('0x3')},'content':{'type':Sequelize[_0xd6bb('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd6bb('0x2')]('string',_0xd6bb('0x4'),_0xd6bb('0x5'))},'keyContent':{'type':Sequelize[_0xd6bb('0x7')]},'idField':{'type':Sequelize[_0xd6bb('0x7')]},'nameField':{'type':Sequelize[_0xd6bb('0x7')]},'customField':{'type':Sequelize[_0xd6bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd6bb('0x7')]}};
\ No newline at end of file
index f60ece2..860f88a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaea9=['sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','VtigerField','rows','catch','params','fields','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0xaea9,0xda));var _0x9aea=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xaea9[_0x4baae2];return _0x1a2285;};'use strict';var emlformat=require(_0x9aea('0x0'));var rimraf=require(_0x9aea('0x1'));var zipdir=require(_0x9aea('0x2'));var jsonpatch=require(_0x9aea('0x3'));var rp=require(_0x9aea('0x4'));var moment=require(_0x9aea('0x5'));var BPromise=require(_0x9aea('0x6'));var Mustache=require(_0x9aea('0x7'));var util=require(_0x9aea('0x8'));var path=require(_0x9aea('0x9'));var sox=require(_0x9aea('0xa'));var csv=require('to-csv');var ejs=require(_0x9aea('0xb'));var fs=require('fs');var fs_extra=require(_0x9aea('0xc'));var _=require(_0x9aea('0xd'));var squel=require('squel');var crypto=require(_0x9aea('0xe'));var jsforce=require(_0x9aea('0xf'));var deskjs=require(_0x9aea('0x10'));var toCsv=require(_0x9aea('0x11'));var querystring=require(_0x9aea('0x12'));var Papa=require(_0x9aea('0x13'));var Redis=require(_0x9aea('0x14'));var authService=require(_0x9aea('0x15'));var qs=require(_0x9aea('0x16'));var as=require(_0x9aea('0x17'));var hardwareService=require(_0x9aea('0x18'));var logger=require(_0x9aea('0x19'))('api');var utils=require(_0x9aea('0x1a'));var config=require(_0x9aea('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x9aea('0x1c'))['db'];function respondWithStatusCode(_0x3d3f9e,_0xc7eee){_0xc7eee=_0xc7eee||0xcc;return function(_0x173481){if(_0x173481){return _0x3d3f9e[_0x9aea('0x1d')](_0xc7eee);}return _0x3d3f9e[_0x9aea('0x1e')](_0xc7eee)[_0x9aea('0x1f')]();};}function respondWithResult(_0x194f05,_0x4c225f){_0x4c225f=_0x4c225f||0xc8;return function(_0xd3485d){if(_0xd3485d){return _0x194f05['status'](_0x4c225f)['json'](_0xd3485d);}};}function respondWithFilteredResult(_0x592cdf,_0x212e4f){return function(_0x31797f){if(_0x31797f){var _0x484ea3=typeof _0x212e4f[_0x9aea('0x20')]===_0x9aea('0x21')&&typeof _0x212e4f[_0x9aea('0x22')]===_0x9aea('0x21');var _0x9a8eb9=_0x31797f['count'];var _0x5cae15=_0x484ea3?0x0:_0x212e4f[_0x9aea('0x20')];var _0x40d97f=_0x484ea3?_0x31797f[_0x9aea('0x23')]:_0x212e4f[_0x9aea('0x20')]+_0x212e4f[_0x9aea('0x22')];var _0x42bdce;if(_0x40d97f>=_0x9a8eb9){_0x40d97f=_0x9a8eb9;_0x42bdce=0xc8;}else{_0x42bdce=0xce;}_0x592cdf[_0x9aea('0x1e')](_0x42bdce);return _0x592cdf[_0x9aea('0x24')](_0x9aea('0x25'),_0x5cae15+'-'+_0x40d97f+'/'+_0x9a8eb9)[_0x9aea('0x26')](_0x31797f);}return null;};}function patchUpdates(_0x399ebf){return function(_0x584fd0){try{jsonpatch[_0x9aea('0x27')](_0x584fd0,_0x399ebf,!![]);}catch(_0x3d4293){return BPromise[_0x9aea('0x28')](_0x3d4293);}return _0x584fd0[_0x9aea('0x29')]();};}function saveUpdates(_0x87b169,_0x2dc639){return function(_0x2fd631){if(_0x2fd631){return _0x2fd631[_0x9aea('0x2a')](_0x87b169)[_0x9aea('0x2b')](function(_0x3f56d2){return _0x3f56d2;});}return null;};}function removeEntity(_0x8cd7b7,_0x5a47d0){return function(_0x41be6a){if(_0x41be6a){return _0x41be6a['destroy']()[_0x9aea('0x2b')](function(){_0x8cd7b7[_0x9aea('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20dd2d,_0xe489fd){return function(_0x2c7ebe){if(!_0x2c7ebe){_0x20dd2d['sendStatus'](0x194);}return _0x2c7ebe;};}function handleError(_0x4c102e,_0x79a646){_0x79a646=_0x79a646||0x1f4;return function(_0x72d1ef){logger[_0x9aea('0x2c')](_0x72d1ef[_0x9aea('0x2d')]);if(_0x72d1ef[_0x9aea('0x2e')]){delete _0x72d1ef[_0x9aea('0x2e')];}_0x4c102e[_0x9aea('0x1e')](_0x79a646)[_0x9aea('0x2f')](_0x72d1ef);};}exports[_0x9aea('0x30')]=function(_0x1d17c7,_0x49f96c){var _0x11311b={},_0x5464ac={},_0x2852b5={'count':0x0,'rows':[]};var _0xc9428f=_[_0x9aea('0x31')](db['VtigerField'][_0x9aea('0x32')],function(_0x21855c){return{'name':_0x21855c['fieldName'],'type':_0x21855c[_0x9aea('0x33')][_0x9aea('0x34')]};});_0x5464ac[_0x9aea('0x35')]=_[_0x9aea('0x31')](_0xc9428f,_0x9aea('0x2e'));_0x5464ac['query']=_[_0x9aea('0x36')](_0x1d17c7['query']);_0x5464ac[_0x9aea('0x37')]=_[_0x9aea('0x38')](_0x5464ac[_0x9aea('0x35')],_0x5464ac[_0x9aea('0x39')]);_0x11311b[_0x9aea('0x3a')]=_['intersection'](_0x5464ac[_0x9aea('0x35')],qs['fields'](_0x1d17c7[_0x9aea('0x39')]['fields']));_0x11311b['attributes']=_0x11311b[_0x9aea('0x3a')]['length']?_0x11311b[_0x9aea('0x3a')]:_0x5464ac['model'];if(!_0x1d17c7[_0x9aea('0x39')][_0x9aea('0x3b')]('nolimit')){_0x11311b['limit']=qs[_0x9aea('0x22')](_0x1d17c7['query']['limit']);_0x11311b[_0x9aea('0x20')]=qs['offset'](_0x1d17c7['query'][_0x9aea('0x20')]);}_0x11311b[_0x9aea('0x3c')]=qs[_0x9aea('0x3d')](_0x1d17c7[_0x9aea('0x39')][_0x9aea('0x3d')]);_0x11311b[_0x9aea('0x3e')]=qs[_0x9aea('0x37')](_[_0x9aea('0x3f')](_0x1d17c7['query'],_0x5464ac['filters']),_0xc9428f);if(_0x1d17c7[_0x9aea('0x39')]['filter']){_0x11311b[_0x9aea('0x3e')]=_['merge'](_0x11311b['where'],{'$or':_['map'](_0xc9428f,function(_0x1dbaeb){if(_0x1dbaeb['type']!=='VIRTUAL'){var _0x312faf={};_0x312faf[_0x1dbaeb['name']]={'$like':'%'+_0x1d17c7[_0x9aea('0x39')]['filter']+'%'};return _0x312faf;}})});}_0x11311b=_[_0x9aea('0x40')]({},_0x11311b,_0x1d17c7[_0x9aea('0x41')]);var _0x3d9ed0={'where':_0x11311b[_0x9aea('0x3e')]};return db['VtigerField'][_0x9aea('0x23')](_0x3d9ed0)[_0x9aea('0x2b')](function(_0x2b833d){_0x2852b5['count']=_0x2b833d;if(_0x1d17c7[_0x9aea('0x39')][_0x9aea('0x42')]){_0x11311b['include']=[{'all':!![]}];}return db[_0x9aea('0x43')]['findAll'](_0x11311b);})[_0x9aea('0x2b')](function(_0x20efaf){_0x2852b5[_0x9aea('0x44')]=_0x20efaf;return _0x2852b5;})[_0x9aea('0x2b')](respondWithFilteredResult(_0x49f96c,_0x11311b))[_0x9aea('0x45')](handleError(_0x49f96c,null));};exports['show']=function(_0x162d4b,_0xc52ee2){var _0x1a9fa1={'raw':!![],'where':{'id':_0x162d4b[_0x9aea('0x46')]['id']}},_0x553586={};_0x553586[_0x9aea('0x35')]=_[_0x9aea('0x36')](db[_0x9aea('0x43')][_0x9aea('0x32')]);_0x553586['query']=_[_0x9aea('0x36')](_0x162d4b[_0x9aea('0x39')]);_0x553586[_0x9aea('0x37')]=_['intersection'](_0x553586[_0x9aea('0x35')],_0x553586[_0x9aea('0x39')]);_0x1a9fa1[_0x9aea('0x3a')]=_[_0x9aea('0x38')](_0x553586[_0x9aea('0x35')],qs[_0x9aea('0x47')](_0x162d4b[_0x9aea('0x39')][_0x9aea('0x47')]));_0x1a9fa1[_0x9aea('0x3a')]=_0x1a9fa1[_0x9aea('0x3a')]['length']?_0x1a9fa1['attributes']:_0x553586['model'];if(_0x162d4b[_0x9aea('0x39')][_0x9aea('0x42')]){_0x1a9fa1['include']=[{'all':!![]}];}_0x1a9fa1=_[_0x9aea('0x40')]({},_0x1a9fa1,_0x162d4b[_0x9aea('0x41')]);return db['VtigerField'][_0x9aea('0x48')](_0x1a9fa1)[_0x9aea('0x2b')](handleEntityNotFound(_0xc52ee2,null))['then'](respondWithResult(_0xc52ee2,null))[_0x9aea('0x45')](handleError(_0xc52ee2,null));};exports[_0x9aea('0x49')]=function(_0x579e02,_0x1ca2b3){return db['VtigerField'][_0x9aea('0x49')](_0x579e02[_0x9aea('0x4a')],{})[_0x9aea('0x2b')](respondWithResult(_0x1ca2b3,0xc9))[_0x9aea('0x45')](handleError(_0x1ca2b3,null));};exports[_0x9aea('0x2a')]=function(_0x2dde24,_0x2aabed){if(_0x2dde24[_0x9aea('0x4a')]['id']){delete _0x2dde24[_0x9aea('0x4a')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x2dde24[_0x9aea('0x46')]['id']}})[_0x9aea('0x2b')](handleEntityNotFound(_0x2aabed,null))[_0x9aea('0x2b')](saveUpdates(_0x2dde24[_0x9aea('0x4a')],null))[_0x9aea('0x2b')](respondWithResult(_0x2aabed,null))[_0x9aea('0x45')](handleError(_0x2aabed,null));};exports[_0x9aea('0x4b')]=function(_0x51742c,_0x2ea4e7){return db[_0x9aea('0x43')][_0x9aea('0x48')]({'where':{'id':_0x51742c[_0x9aea('0x46')]['id']}})[_0x9aea('0x2b')](handleEntityNotFound(_0x2ea4e7,null))[_0x9aea('0x2b')](removeEntity(_0x2ea4e7,null))[_0x9aea('0x45')](handleError(_0x2ea4e7,null));};
\ No newline at end of file
+var _0xd414=['model','query','filters','intersection','fields','attributes','nolimit','sort','where','filter','merge','VIRTUAL','options','VtigerField','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key'];(function(_0x4991d6,_0x348deb){var _0x50faf7=function(_0x14c7f8){while(--_0x14c7f8){_0x4991d6['push'](_0x4991d6['shift']());}};_0x50faf7(++_0x348deb);}(_0xd414,0x1cf));var _0x4d41=function(_0x59c0a8,_0x5b5428){_0x59c0a8=_0x59c0a8-0x0;var _0x30e308=_0xd414[_0x59c0a8];return _0x30e308;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d41('0x1'));var moment=require('moment');var BPromise=require(_0x4d41('0x2'));var Mustache=require(_0x4d41('0x3'));var util=require(_0x4d41('0x4'));var path=require(_0x4d41('0x5'));var sox=require('sox');var csv=require(_0x4d41('0x6'));var ejs=require(_0x4d41('0x7'));var fs=require('fs');var fs_extra=require(_0x4d41('0x8'));var _=require(_0x4d41('0x9'));var squel=require('squel');var crypto=require(_0x4d41('0xa'));var jsforce=require(_0x4d41('0xb'));var deskjs=require(_0x4d41('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4d41('0xd'));var Papa=require(_0x4d41('0xe'));var Redis=require(_0x4d41('0xf'));var authService=require(_0x4d41('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4d41('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d41('0x12'))(_0x4d41('0x13'));var utils=require(_0x4d41('0x14'));var config=require(_0x4d41('0x15'));var licenseUtil=require(_0x4d41('0x16'));var db=require(_0x4d41('0x17'))['db'];function respondWithStatusCode(_0x3391df,_0x761ee5){_0x761ee5=_0x761ee5||0xcc;return function(_0x178cd2){if(_0x178cd2){return _0x3391df[_0x4d41('0x18')](_0x761ee5);}return _0x3391df[_0x4d41('0x19')](_0x761ee5)[_0x4d41('0x1a')]();};}function respondWithResult(_0x131128,_0x539d34){_0x539d34=_0x539d34||0xc8;return function(_0x4b66d2){if(_0x4b66d2){return _0x131128['status'](_0x539d34)[_0x4d41('0x1b')](_0x4b66d2);}};}function respondWithFilteredResult(_0x296587,_0x4a0e47){return function(_0x551d1f){if(_0x551d1f){var _0x2dfd4a=typeof _0x4a0e47[_0x4d41('0x1c')]===_0x4d41('0x1d')&&typeof _0x4a0e47[_0x4d41('0x1e')]==='undefined';var _0x3d68b3=_0x551d1f[_0x4d41('0x1f')];var _0x2739b9=_0x2dfd4a?0x0:_0x4a0e47[_0x4d41('0x1c')];var _0x548c47=_0x2dfd4a?_0x551d1f['count']:_0x4a0e47[_0x4d41('0x1c')]+_0x4a0e47['limit'];var _0x1f2d45;if(_0x548c47>=_0x3d68b3){_0x548c47=_0x3d68b3;_0x1f2d45=0xc8;}else{_0x1f2d45=0xce;}_0x296587[_0x4d41('0x19')](_0x1f2d45);return _0x296587[_0x4d41('0x20')](_0x4d41('0x21'),_0x2739b9+'-'+_0x548c47+'/'+_0x3d68b3)[_0x4d41('0x1b')](_0x551d1f);}return null;};}function patchUpdates(_0x2ea09b){return function(_0x497b5e){try{jsonpatch[_0x4d41('0x22')](_0x497b5e,_0x2ea09b,!![]);}catch(_0x14f713){return BPromise[_0x4d41('0x23')](_0x14f713);}return _0x497b5e[_0x4d41('0x24')]();};}function saveUpdates(_0x1a6257,_0x69bf2b){return function(_0x27eb90){if(_0x27eb90){return _0x27eb90[_0x4d41('0x25')](_0x1a6257)[_0x4d41('0x26')](function(_0x422012){return _0x422012;});}return null;};}function removeEntity(_0x43d67e,_0x2697ba){return function(_0x3b62bf){if(_0x3b62bf){return _0x3b62bf[_0x4d41('0x27')]()[_0x4d41('0x26')](function(){_0x43d67e[_0x4d41('0x19')](0xcc)[_0x4d41('0x1a')]();});}};}function handleEntityNotFound(_0x5ce6a7,_0x2497f2){return function(_0x238e11){if(!_0x238e11){_0x5ce6a7[_0x4d41('0x18')](0x194);}return _0x238e11;};}function handleError(_0x29105a,_0x2d1b14){_0x2d1b14=_0x2d1b14||0x1f4;return function(_0x54c4bb){logger[_0x4d41('0x28')](_0x54c4bb['stack']);if(_0x54c4bb[_0x4d41('0x29')]){delete _0x54c4bb[_0x4d41('0x29')];}_0x29105a[_0x4d41('0x19')](_0x2d1b14)['send'](_0x54c4bb);};}exports[_0x4d41('0x2a')]=function(_0x53509c,_0x15c724){var _0x1c45a4={},_0x46d810={},_0x2bf628={'count':0x0,'rows':[]};var _0x21dad5=_[_0x4d41('0x2b')](db['VtigerField'][_0x4d41('0x2c')],function(_0x16c6e5){return{'name':_0x16c6e5[_0x4d41('0x2d')],'type':_0x16c6e5[_0x4d41('0x2e')][_0x4d41('0x2f')]};});_0x46d810[_0x4d41('0x30')]=_['map'](_0x21dad5,_0x4d41('0x29'));_0x46d810[_0x4d41('0x31')]=_['keys'](_0x53509c['query']);_0x46d810[_0x4d41('0x32')]=_[_0x4d41('0x33')](_0x46d810['model'],_0x46d810[_0x4d41('0x31')]);_0x1c45a4['attributes']=_[_0x4d41('0x33')](_0x46d810[_0x4d41('0x30')],qs[_0x4d41('0x34')](_0x53509c[_0x4d41('0x31')][_0x4d41('0x34')]));_0x1c45a4[_0x4d41('0x35')]=_0x1c45a4[_0x4d41('0x35')]['length']?_0x1c45a4[_0x4d41('0x35')]:_0x46d810['model'];if(!_0x53509c[_0x4d41('0x31')]['hasOwnProperty'](_0x4d41('0x36'))){_0x1c45a4[_0x4d41('0x1e')]=qs[_0x4d41('0x1e')](_0x53509c[_0x4d41('0x31')][_0x4d41('0x1e')]);_0x1c45a4[_0x4d41('0x1c')]=qs[_0x4d41('0x1c')](_0x53509c[_0x4d41('0x31')]['offset']);}_0x1c45a4['order']=qs[_0x4d41('0x37')](_0x53509c['query'][_0x4d41('0x37')]);_0x1c45a4[_0x4d41('0x38')]=qs[_0x4d41('0x32')](_['pick'](_0x53509c[_0x4d41('0x31')],_0x46d810[_0x4d41('0x32')]),_0x21dad5);if(_0x53509c[_0x4d41('0x31')][_0x4d41('0x39')]){_0x1c45a4[_0x4d41('0x38')]=_[_0x4d41('0x3a')](_0x1c45a4[_0x4d41('0x38')],{'$or':_['map'](_0x21dad5,function(_0x2d616b){if(_0x2d616b[_0x4d41('0x2e')]!==_0x4d41('0x3b')){var _0x5409da={};_0x5409da[_0x2d616b[_0x4d41('0x29')]]={'$like':'%'+_0x53509c[_0x4d41('0x31')][_0x4d41('0x39')]+'%'};return _0x5409da;}})});}_0x1c45a4=_[_0x4d41('0x3a')]({},_0x1c45a4,_0x53509c[_0x4d41('0x3c')]);var _0x28a55d={'where':_0x1c45a4[_0x4d41('0x38')]};return db[_0x4d41('0x3d')]['count'](_0x28a55d)[_0x4d41('0x26')](function(_0x11dd16){_0x2bf628[_0x4d41('0x1f')]=_0x11dd16;if(_0x53509c['query'][_0x4d41('0x3e')]){_0x1c45a4[_0x4d41('0x3f')]=[{'all':!![]}];}return db[_0x4d41('0x3d')][_0x4d41('0x40')](_0x1c45a4);})[_0x4d41('0x26')](function(_0x5486d0){_0x2bf628[_0x4d41('0x41')]=_0x5486d0;return _0x2bf628;})[_0x4d41('0x26')](respondWithFilteredResult(_0x15c724,_0x1c45a4))[_0x4d41('0x42')](handleError(_0x15c724,null));};exports['show']=function(_0x11a83c,_0x14a8dc){var _0x35ab57={'raw':!![],'where':{'id':_0x11a83c[_0x4d41('0x43')]['id']}},_0x13e398={};_0x13e398[_0x4d41('0x30')]=_[_0x4d41('0x44')](db[_0x4d41('0x3d')][_0x4d41('0x2c')]);_0x13e398[_0x4d41('0x31')]=_['keys'](_0x11a83c[_0x4d41('0x31')]);_0x13e398[_0x4d41('0x32')]=_[_0x4d41('0x33')](_0x13e398[_0x4d41('0x30')],_0x13e398[_0x4d41('0x31')]);_0x35ab57[_0x4d41('0x35')]=_[_0x4d41('0x33')](_0x13e398[_0x4d41('0x30')],qs['fields'](_0x11a83c['query'][_0x4d41('0x34')]));_0x35ab57[_0x4d41('0x35')]=_0x35ab57[_0x4d41('0x35')][_0x4d41('0x45')]?_0x35ab57[_0x4d41('0x35')]:_0x13e398[_0x4d41('0x30')];if(_0x11a83c['query']['includeAll']){_0x35ab57[_0x4d41('0x3f')]=[{'all':!![]}];}_0x35ab57=_[_0x4d41('0x3a')]({},_0x35ab57,_0x11a83c['options']);return db[_0x4d41('0x3d')][_0x4d41('0x46')](_0x35ab57)['then'](handleEntityNotFound(_0x14a8dc,null))[_0x4d41('0x26')](respondWithResult(_0x14a8dc,null))[_0x4d41('0x42')](handleError(_0x14a8dc,null));};exports[_0x4d41('0x47')]=function(_0x3bf3c8,_0x217c54){return db[_0x4d41('0x3d')][_0x4d41('0x47')](_0x3bf3c8[_0x4d41('0x48')],{})[_0x4d41('0x26')](respondWithResult(_0x217c54,0xc9))['catch'](handleError(_0x217c54,null));};exports[_0x4d41('0x25')]=function(_0x28f58a,_0x430ae5){if(_0x28f58a['body']['id']){delete _0x28f58a['body']['id'];}return db[_0x4d41('0x3d')]['find']({'where':{'id':_0x28f58a[_0x4d41('0x43')]['id']}})[_0x4d41('0x26')](handleEntityNotFound(_0x430ae5,null))[_0x4d41('0x26')](saveUpdates(_0x28f58a[_0x4d41('0x48')],null))[_0x4d41('0x26')](respondWithResult(_0x430ae5,null))[_0x4d41('0x42')](handleError(_0x430ae5,null));};exports[_0x4d41('0x27')]=function(_0x15608c,_0x14cad0){return db[_0x4d41('0x3d')][_0x4d41('0x46')]({'where':{'id':_0x15608c[_0x4d41('0x43')]['id']}})[_0x4d41('0x26')](handleEntityNotFound(_0x14cad0,null))[_0x4d41('0x26')](removeEntity(_0x14cad0,null))['catch'](handleError(_0x14cad0,null));};
\ No newline at end of file
index e25af5a..07e077b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba03=['define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x3b12fb,_0x20bea9){var _0x3a4b41=function(_0x597c64){while(--_0x597c64){_0x3b12fb['push'](_0x3b12fb['shift']());}};_0x3a4b41(++_0x20bea9);}(_0xba03,0x116));var _0x3ba0=function(_0x257b36,_0x5d890d){_0x257b36=_0x257b36-0x0;var _0x2ac171=_0xba03[_0x257b36];return _0x2ac171;};'use strict';var _=require(_0x3ba0('0x0'));var util=require('util');var logger=require(_0x3ba0('0x1'))(_0x3ba0('0x2'));var moment=require(_0x3ba0('0x3'));var BPromise=require(_0x3ba0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3ba0('0x5'));var attributes=require(_0x3ba0('0x6'));module[_0x3ba0('0x7')]=function(_0x1e92e3,_0x2d2d28){return _0x1e92e3[_0x3ba0('0x8')]('VtigerField',attributes,{'tableName':_0x3ba0('0x9'),'paranoid':![],'indexes':[{'name':_0x3ba0('0xa'),'fields':[_0x3ba0('0xb'),_0x3ba0('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9433=['../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util'];(function(_0xc7b4e2,_0xe6145a){var _0x1f01c7=function(_0x9427a7){while(--_0x9427a7){_0xc7b4e2['push'](_0xc7b4e2['shift']());}};_0x1f01c7(++_0xe6145a);}(_0x9433,0x193));var _0x3943=function(_0x396474,_0x58ec28){_0x396474=_0x396474-0x0;var _0x59542d=_0x9433[_0x396474];return _0x59542d;};'use strict';var _=require(_0x3943('0x0'));var util=require(_0x3943('0x1'));var logger=require(_0x3943('0x2'))(_0x3943('0x3'));var moment=require(_0x3943('0x4'));var BPromise=require(_0x3943('0x5'));var rp=require(_0x3943('0x6'));var fs=require('fs');var path=require(_0x3943('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3943('0x8'));module[_0x3943('0x9')]=function(_0x1b6f02,_0x437d3e){return _0x1b6f02[_0x3943('0xa')](_0x3943('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x3943('0xc'),'fields':[_0x3943('0xd'),_0x3943('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index a5ed2e8..e99274a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe33a=['VtigerField,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5504f9,_0x117bdb){var _0xeb827e=function(_0x40ea31){while(--_0x40ea31){_0x5504f9['push'](_0x5504f9['shift']());}};_0xeb827e(++_0x117bdb);}(_0xe33a,0x1e8));var _0xae33=function(_0x1c3ac6,_0x2cafef){_0x1c3ac6=_0x1c3ac6-0x0;var _0x162a3e=_0xe33a[_0x1c3ac6];return _0x162a3e;};'use strict';var _=require('lodash');var util=require(_0xae33('0x0'));var moment=require(_0xae33('0x1'));var BPromise=require(_0xae33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae33('0x3'));var db=require(_0xae33('0x4'))['db'];var utils=require(_0xae33('0x5'));var logger=require(_0xae33('0x6'))('rpc');var config=require(_0xae33('0x7'));var jayson=require(_0xae33('0x8'));var client=jayson[_0xae33('0x9')][_0xae33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33d62e,_0x2b23a5,_0xe60bd7){return new BPromise(function(_0x978df2,_0x147914){return client['request'](_0x33d62e,_0xe60bd7)[_0xae33('0xb')](function(_0x4a36a6){logger[_0xae33('0xc')]('VtigerField,\x20%s,\x20%s',_0x2b23a5,_0xae33('0xd'));logger[_0xae33('0xe')](_0xae33('0xf'),_0x2b23a5,_0xae33('0xd'),JSON['stringify'](_0x4a36a6));if(_0x4a36a6['error']){if(_0x4a36a6[_0xae33('0x10')][_0xae33('0x11')]===0x1f4){logger[_0xae33('0x10')](_0xae33('0x12'),_0x2b23a5,_0x4a36a6[_0xae33('0x10')][_0xae33('0x13')]);return _0x147914(_0x4a36a6['error'][_0xae33('0x13')]);}logger[_0xae33('0x10')](_0xae33('0x12'),_0x2b23a5,_0x4a36a6['error'][_0xae33('0x13')]);return _0x978df2(_0x4a36a6['error'][_0xae33('0x13')]);}else{logger[_0xae33('0xc')]('VtigerField,\x20%s,\x20%s',_0x2b23a5,_0xae33('0xd'));_0x978df2(_0x4a36a6[_0xae33('0x14')]['message']);}})[_0xae33('0x15')](function(_0xc98527){logger[_0xae33('0x10')](_0xae33('0x12'),_0x2b23a5,_0xc98527);_0x147914(_0xc98527);});});}
\ No newline at end of file
+var _0xc5c2=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch'];(function(_0x228a28,_0x33a4c2){var _0x57b41a=function(_0x4ed298){while(--_0x4ed298){_0x228a28['push'](_0x228a28['shift']());}};_0x57b41a(++_0x33a4c2);}(_0xc5c2,0x73));var _0x2c5c=function(_0x2df8c7,_0x101d49){_0x2df8c7=_0x2df8c7-0x0;var _0x54a823=_0xc5c2[_0x2df8c7];return _0x54a823;};'use strict';var _=require(_0x2c5c('0x0'));var util=require(_0x2c5c('0x1'));var moment=require(_0x2c5c('0x2'));var BPromise=require('bluebird');var rs=require(_0x2c5c('0x3'));var fs=require('fs');var Redis=require(_0x2c5c('0x4'));var db=require(_0x2c5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2c5c('0x6'))(_0x2c5c('0x7'));var config=require(_0x2c5c('0x8'));var jayson=require(_0x2c5c('0x9'));var client=jayson[_0x2c5c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b1134,_0x3d7304,_0x662a41){return new BPromise(function(_0x27f729,_0x43533a){return client['request'](_0x5b1134,_0x662a41)[_0x2c5c('0xb')](function(_0x4688aa){logger[_0x2c5c('0xc')]('VtigerField,\x20%s,\x20%s',_0x3d7304,_0x2c5c('0xd'));logger[_0x2c5c('0xe')](_0x2c5c('0xf'),_0x3d7304,_0x2c5c('0xd'),JSON[_0x2c5c('0x10')](_0x4688aa));if(_0x4688aa['error']){if(_0x4688aa[_0x2c5c('0x11')][_0x2c5c('0x12')]===0x1f4){logger[_0x2c5c('0x11')](_0x2c5c('0x13'),_0x3d7304,_0x4688aa[_0x2c5c('0x11')][_0x2c5c('0x14')]);return _0x43533a(_0x4688aa[_0x2c5c('0x11')][_0x2c5c('0x14')]);}logger[_0x2c5c('0x11')]('VtigerField,\x20%s,\x20%s',_0x3d7304,_0x4688aa[_0x2c5c('0x11')][_0x2c5c('0x14')]);return _0x27f729(_0x4688aa[_0x2c5c('0x11')][_0x2c5c('0x14')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x3d7304,_0x2c5c('0xd'));_0x27f729(_0x4688aa[_0x2c5c('0x15')]['message']);}})[_0x2c5c('0x16')](function(_0x24f904){logger['error'](_0x2c5c('0x13'),_0x3d7304,_0x24f904);_0x43533a(_0x24f904);});});}
\ No newline at end of file
index 2c0b5bf..70ad775 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffbd=['show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','/:id','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intZendeskAccount.controller','get','isAuthenticated','index'];(function(_0x159097,_0x22fdeb){var _0x386da4=function(_0x3b8b60){while(--_0x3b8b60){_0x159097['push'](_0x159097['shift']());}};_0x386da4(++_0x22fdeb);}(_0xffbd,0x170));var _0xdffb=function(_0x2113d8,_0x5a3232){_0x2113d8=_0x2113d8-0x0;var _0x1c8538=_0xffbd[_0x2113d8];return _0x1c8538;};'use strict';var multer=require('multer');var util=require(_0xdffb('0x0'));var path=require(_0xdffb('0x1'));var timeout=require(_0xdffb('0x2'));var express=require(_0xdffb('0x3'));var router=express['Router']();var fs_extra=require(_0xdffb('0x4'));var auth=require(_0xdffb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdffb('0x6'));router[_0xdffb('0x7')]('/',auth[_0xdffb('0x8')](),controller[_0xdffb('0x9')]);router[_0xdffb('0x7')]('/:id',auth[_0xdffb('0x8')](),controller[_0xdffb('0xa')]);router[_0xdffb('0x7')](_0xdffb('0xb'),auth[_0xdffb('0x8')](),controller[_0xdffb('0xc')]);router[_0xdffb('0x7')](_0xdffb('0xd'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdffb('0xe')](_0xdffb('0xb'),auth['isAuthenticated'](),controller[_0xdffb('0xf')]);router[_0xdffb('0x10')](_0xdffb('0x11'),auth[_0xdffb('0x8')](),controller[_0xdffb('0x12')]);router[_0xdffb('0x13')]('/:id',auth[_0xdffb('0x8')](),controller[_0xdffb('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x8406=['getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0x8406,0x1b9));var _0x6840=function(_0x1f41bd,_0x26aafe){_0x1f41bd=_0x1f41bd-0x0;var _0x2718ef=_0x8406[_0x1f41bd];return _0x2718ef;};'use strict';var multer=require(_0x6840('0x0'));var util=require(_0x6840('0x1'));var path=require(_0x6840('0x2'));var timeout=require('connect-timeout');var express=require(_0x6840('0x3'));var router=express[_0x6840('0x4')]();var fs_extra=require(_0x6840('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6840('0x6'));var config=require(_0x6840('0x7'));var controller=require(_0x6840('0x8'));router[_0x6840('0x9')]('/',auth['isAuthenticated'](),controller[_0x6840('0xa')]);router[_0x6840('0x9')](_0x6840('0xb'),auth[_0x6840('0xc')](),controller[_0x6840('0xd')]);router[_0x6840('0x9')](_0x6840('0xe'),auth['isAuthenticated'](),controller[_0x6840('0xf')]);router[_0x6840('0x9')](_0x6840('0x10'),auth[_0x6840('0xc')](),controller[_0x6840('0x11')]);router[_0x6840('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6840('0x12')]('/:id/configurations',auth[_0x6840('0xc')](),controller[_0x6840('0x13')]);router[_0x6840('0x14')](_0x6840('0xb'),auth[_0x6840('0xc')](),controller['update']);router[_0x6840('0x15')]('/:id',auth[_0x6840('0xc')](),controller[_0x6840('0x16')]);module[_0x6840('0x17')]=router;
\ No newline at end of file
index 56e81f5..b902df5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd0a=['newTab','sequelize','STRING','remoteUri','ENUM','password','token','integrationTab'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x12c799,_0x437740){_0x12c799=_0x12c799-0x0;var _0x3bcb97=_0xbd0a[_0x12c799];return _0x3bcb97;};'use strict';var Sequelize=require(_0xabd0('0x0'));module['exports']={'name':{'type':Sequelize[_0xabd0('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xabd0('0x1')]},'token':{'type':Sequelize[_0xabd0('0x1')]},'remoteUri':{'type':Sequelize[_0xabd0('0x1')],'unique':_0xabd0('0x2')},'authType':{'type':Sequelize[_0xabd0('0x3')](_0xabd0('0x4'),_0xabd0('0x5')),'defaultValue':_0xabd0('0x4')},'serverUrl':{'type':Sequelize[_0xabd0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xabd0('0x6'),_0xabd0('0x7')),'defaultValue':_0xabd0('0x6')}};
\ No newline at end of file
+var _0x0120=['password','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x1162f9,_0x35f87c){var _0x75257c=function(_0x11ac6b){while(--_0x11ac6b){_0x1162f9['push'](_0x1162f9['shift']());}};_0x75257c(++_0x35f87c);}(_0x0120,0x6f));var _0x0012=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0120[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'name':{'type':Sequelize[_0x0012('0x2')]},'description':{'type':Sequelize[_0x0012('0x2')]},'username':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x3')},'password':{'type':Sequelize[_0x0012('0x2')]},'token':{'type':Sequelize[_0x0012('0x2')]},'remoteUri':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x4')},'authType':{'type':Sequelize[_0x0012('0x5')](_0x0012('0x6'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0012('0x5')](_0x0012('0x7'),_0x0012('0x8')),'defaultValue':_0x0012('0x7')}};
\ No newline at end of file
index 77b13aa..3b85716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a5=['username','password','token','remoteUri','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType','headers','format','toString','base64','Basic\x20%s','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','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','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','ZendeskAccount','count','includeAll','rows','params','length','include','find','catch','create','body','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','getFields'];(function(_0x5e6d63,_0x303390){var _0x2b9b45=function(_0x1ac2ee){while(--_0x1ac2ee){_0x5e6d63['push'](_0x5e6d63['shift']());}};_0x2b9b45(++_0x303390);}(_0x63a5,0x18e));var _0x563a=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x63a5[_0x403c20];return _0x2b271a;};'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'];var integrations=require(_0x563a('0x19'));function respondWithStatusCode(_0x214f42,_0x10de2e){_0x10de2e=_0x10de2e||0xcc;return function(_0x27034c){if(_0x27034c){return _0x214f42[_0x563a('0x1a')](_0x10de2e);}return _0x214f42[_0x563a('0x1b')](_0x10de2e)['end']();};}function respondWithResult(_0x2cf052,_0x3045ac){_0x3045ac=_0x3045ac||0xc8;return function(_0x8c3727){if(_0x8c3727){return _0x2cf052[_0x563a('0x1b')](_0x3045ac)['json'](_0x8c3727);}};}function respondWithFilteredResult(_0x504cb7,_0x414535){return function(_0x2ad667){if(_0x2ad667){var _0x5b291f=typeof _0x414535[_0x563a('0x1c')]===_0x563a('0x1d')&&typeof _0x414535[_0x563a('0x1e')]===_0x563a('0x1d');var _0x4f947d=_0x2ad667['count'];var _0xe3d2bd=_0x5b291f?0x0:_0x414535[_0x563a('0x1c')];var _0x54a3b4=_0x5b291f?_0x2ad667['count']:_0x414535['offset']+_0x414535['limit'];var _0x4c15c1;if(_0x54a3b4>=_0x4f947d){_0x54a3b4=_0x4f947d;_0x4c15c1=0xc8;}else{_0x4c15c1=0xce;}_0x504cb7[_0x563a('0x1b')](_0x4c15c1);return _0x504cb7[_0x563a('0x1f')](_0x563a('0x20'),_0xe3d2bd+'-'+_0x54a3b4+'/'+_0x4f947d)[_0x563a('0x21')](_0x2ad667);}return null;};}function patchUpdates(_0x562fce){return function(_0x4e3b67){try{jsonpatch[_0x563a('0x22')](_0x4e3b67,_0x562fce,!![]);}catch(_0x9f8b29){return BPromise[_0x563a('0x23')](_0x9f8b29);}return _0x4e3b67[_0x563a('0x24')]();};}function saveUpdates(_0x1bf502,_0x2dc7e2){return function(_0x44b460){if(_0x44b460){return _0x44b460[_0x563a('0x25')](_0x1bf502)['then'](function(_0xd59ba8){return _0xd59ba8;});}return null;};}function removeEntity(_0x5422f6,_0x44e2c1){return function(_0xd3e0ae){if(_0xd3e0ae){return _0xd3e0ae[_0x563a('0x26')]()[_0x563a('0x27')](function(){_0x5422f6[_0x563a('0x1b')](0xcc)[_0x563a('0x28')]();});}};}function handleEntityNotFound(_0x3642b3,_0x173990){return function(_0x4de4c3){if(!_0x4de4c3){_0x3642b3[_0x563a('0x1a')](0x194);}return _0x4de4c3;};}function handleError(_0x2b688e,_0x2311f2){_0x2311f2=_0x2311f2||0x1f4;return function(_0x3d79ac){logger[_0x563a('0x29')](_0x3d79ac[_0x563a('0x2a')]);if(_0x3d79ac[_0x563a('0x2b')]){delete _0x3d79ac[_0x563a('0x2b')];}_0x2b688e[_0x563a('0x1b')](_0x2311f2)[_0x563a('0x2c')](_0x3d79ac);};}exports[_0x563a('0x2d')]=function(_0x24d1a8,_0x1bdfb0){var _0x7696c2={},_0x579cb5={},_0x43379c={'count':0x0,'rows':[]};var _0x3c16d0=_[_0x563a('0x2e')](db['ZendeskAccount'][_0x563a('0x2f')],function(_0x2e5c4b){return{'name':_0x2e5c4b[_0x563a('0x30')],'type':_0x2e5c4b[_0x563a('0x31')][_0x563a('0x32')]};});_0x579cb5[_0x563a('0x33')]=_[_0x563a('0x2e')](_0x3c16d0,'name');_0x579cb5[_0x563a('0x34')]=_[_0x563a('0x35')](_0x24d1a8[_0x563a('0x34')]);_0x579cb5[_0x563a('0x36')]=_[_0x563a('0x37')](_0x579cb5['model'],_0x579cb5['query']);_0x7696c2['attributes']=_['intersection'](_0x579cb5[_0x563a('0x33')],qs[_0x563a('0x38')](_0x24d1a8[_0x563a('0x34')][_0x563a('0x38')]));_0x7696c2[_0x563a('0x39')]=_0x7696c2[_0x563a('0x39')]['length']?_0x7696c2['attributes']:_0x579cb5[_0x563a('0x33')];if(!_0x24d1a8[_0x563a('0x34')][_0x563a('0x3a')](_0x563a('0x3b'))){_0x7696c2[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x24d1a8[_0x563a('0x34')][_0x563a('0x1e')]);_0x7696c2[_0x563a('0x1c')]=qs[_0x563a('0x1c')](_0x24d1a8[_0x563a('0x34')][_0x563a('0x1c')]);}_0x7696c2[_0x563a('0x3c')]=qs[_0x563a('0x3d')](_0x24d1a8[_0x563a('0x34')][_0x563a('0x3d')]);_0x7696c2['where']=qs[_0x563a('0x36')](_[_0x563a('0x3e')](_0x24d1a8[_0x563a('0x34')],_0x579cb5['filters']),_0x3c16d0);if(_0x24d1a8[_0x563a('0x34')]['filter']){_0x7696c2[_0x563a('0x3f')]=_[_0x563a('0x40')](_0x7696c2['where'],{'$or':_['map'](_0x3c16d0,function(_0x1b48f1){if(_0x1b48f1['type']!==_0x563a('0x41')){var _0x92bd6={};_0x92bd6[_0x1b48f1[_0x563a('0x2b')]]={'$like':'%'+_0x24d1a8[_0x563a('0x34')]['filter']+'%'};return _0x92bd6;}})});}_0x7696c2=_['merge']({},_0x7696c2,_0x24d1a8[_0x563a('0x42')]);var _0x598ee3={'where':_0x7696c2[_0x563a('0x3f')]};return db[_0x563a('0x43')][_0x563a('0x44')](_0x598ee3)[_0x563a('0x27')](function(_0x3a2eb0){_0x43379c[_0x563a('0x44')]=_0x3a2eb0;if(_0x24d1a8[_0x563a('0x34')][_0x563a('0x45')]){_0x7696c2['include']=[{'all':!![]}];}return db[_0x563a('0x43')]['findAll'](_0x7696c2);})[_0x563a('0x27')](function(_0x3de697){_0x43379c[_0x563a('0x46')]=_0x3de697;return _0x43379c;})[_0x563a('0x27')](respondWithFilteredResult(_0x1bdfb0,_0x7696c2))['catch'](handleError(_0x1bdfb0,null));};exports['show']=function(_0x54ac1e,_0x2221d4){var _0x1255da={'raw':![],'where':{'id':_0x54ac1e[_0x563a('0x47')]['id']}},_0x19b18f={};_0x19b18f[_0x563a('0x33')]=_[_0x563a('0x35')](db[_0x563a('0x43')][_0x563a('0x2f')]);_0x19b18f[_0x563a('0x34')]=_[_0x563a('0x35')](_0x54ac1e[_0x563a('0x34')]);_0x19b18f[_0x563a('0x36')]=_[_0x563a('0x37')](_0x19b18f[_0x563a('0x33')],_0x19b18f[_0x563a('0x34')]);_0x1255da[_0x563a('0x39')]=_[_0x563a('0x37')](_0x19b18f[_0x563a('0x33')],qs[_0x563a('0x38')](_0x54ac1e['query']['fields']));_0x1255da[_0x563a('0x39')]=_0x1255da[_0x563a('0x39')][_0x563a('0x48')]?_0x1255da[_0x563a('0x39')]:_0x19b18f[_0x563a('0x33')];if(_0x54ac1e[_0x563a('0x34')][_0x563a('0x45')]){_0x1255da[_0x563a('0x49')]=[{'all':!![]}];}_0x1255da=_['merge']({},_0x1255da,_0x54ac1e['options']);return db[_0x563a('0x43')][_0x563a('0x4a')](_0x1255da)[_0x563a('0x27')](handleEntityNotFound(_0x2221d4,null))[_0x563a('0x27')](respondWithResult(_0x2221d4,null))[_0x563a('0x4b')](handleError(_0x2221d4,null));};exports[_0x563a('0x4c')]=function(_0x2689b5,_0x276642){return db['ZendeskAccount'][_0x563a('0x4c')](_0x2689b5[_0x563a('0x4d')],{})['then'](respondWithResult(_0x276642,0xc9))[_0x563a('0x4b')](handleError(_0x276642,null));};exports['update']=function(_0x3ea787,_0xab7b16){if(_0x3ea787[_0x563a('0x4d')]['id']){delete _0x3ea787['body']['id'];}return db[_0x563a('0x43')][_0x563a('0x4a')]({'where':{'id':_0x3ea787[_0x563a('0x47')]['id']}})[_0x563a('0x27')](handleEntityNotFound(_0xab7b16,null))[_0x563a('0x27')](saveUpdates(_0x3ea787[_0x563a('0x4d')],null))[_0x563a('0x27')](respondWithResult(_0xab7b16,null))[_0x563a('0x4b')](handleError(_0xab7b16,null));};exports[_0x563a('0x26')]=function(_0x2008d4,_0x3c98d5){return db[_0x563a('0x43')][_0x563a('0x4a')]({'where':{'id':_0x2008d4['params']['id']}})['then'](handleEntityNotFound(_0x3c98d5,null))[_0x563a('0x27')](removeEntity(_0x3c98d5,null))[_0x563a('0x4b')](handleError(_0x3c98d5,null));};exports[_0x563a('0x4e')]=function(_0x4a807f,_0x5ae08f,_0x13530f){var _0x1fc4d2={};var _0x50ebde={};var _0x4b6ba9;var _0x51e142;return db[_0x563a('0x43')][_0x563a('0x4f')]({'where':{'id':_0x4a807f[_0x563a('0x47')]['id']}})[_0x563a('0x27')](handleEntityNotFound(_0x5ae08f,null))[_0x563a('0x27')](function(_0x2805eb){if(_0x2805eb){_0x4b6ba9=_0x2805eb;_0x50ebde['model']=_['keys'](db[_0x563a('0x50')]['rawAttributes']);_0x50ebde[_0x563a('0x34')]=_[_0x563a('0x35')](_0x4a807f[_0x563a('0x34')]);_0x50ebde[_0x563a('0x36')]=_[_0x563a('0x37')](_0x50ebde[_0x563a('0x33')],_0x50ebde[_0x563a('0x34')]);_0x1fc4d2['attributes']=_[_0x563a('0x37')](_0x50ebde[_0x563a('0x33')],qs['fields'](_0x4a807f[_0x563a('0x34')][_0x563a('0x38')]));_0x1fc4d2[_0x563a('0x39')]=_0x1fc4d2[_0x563a('0x39')][_0x563a('0x48')]?_0x1fc4d2[_0x563a('0x39')]:_0x50ebde[_0x563a('0x33')];_0x1fc4d2[_0x563a('0x3c')]=qs[_0x563a('0x3d')](_0x4a807f[_0x563a('0x34')]['sort']);_0x1fc4d2[_0x563a('0x3f')]=qs[_0x563a('0x36')](_['pick'](_0x4a807f['query'],_0x50ebde[_0x563a('0x36')]));if(_0x4a807f[_0x563a('0x34')]['filter']){_0x1fc4d2[_0x563a('0x3f')]=_['merge'](_0x1fc4d2[_0x563a('0x3f')],{'$or':_[_0x563a('0x2e')](_0x1fc4d2[_0x563a('0x39')],function(_0xbe9fff){var _0x7fa423={};_0x7fa423[_0xbe9fff]={'$like':'%'+_0x4a807f['query']['filter']+'%'};return _0x7fa423;})});}_0x1fc4d2=_['merge']({},_0x1fc4d2,_0x4a807f['options']);return _0x4b6ba9[_0x563a('0x4e')](_0x1fc4d2);}})['then'](function(_0x111444){if(_0x111444){_0x51e142=_0x111444['length'];if(!_0x4a807f[_0x563a('0x34')][_0x563a('0x3a')](_0x563a('0x3b'))){_0x1fc4d2[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x4a807f['query'][_0x563a('0x1e')]);_0x1fc4d2['offset']=qs['offset'](_0x4a807f[_0x563a('0x34')][_0x563a('0x1c')]);}return _0x4b6ba9[_0x563a('0x4e')](_0x1fc4d2);}})[_0x563a('0x27')](function(_0x1c8ad7){if(_0x1c8ad7){return _0x1c8ad7?{'count':_0x51e142,'rows':_0x1c8ad7}:null;}})['then'](respondWithResult(_0x5ae08f,null))[_0x563a('0x4b')](handleError(_0x5ae08f,null));};exports[_0x563a('0x51')]=function(_0x20bd36,_0x3bbe7c,_0x36d40c){if(_0x20bd36['body']['id']){delete _0x20bd36[_0x563a('0x4d')]['id'];}return db['ZendeskAccount'][_0x563a('0x4f')]({'where':{'id':_0x20bd36[_0x563a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bbe7c,null))[_0x563a('0x27')](function(_0x30bf2b){if(_0x30bf2b){_0x20bd36[_0x563a('0x4d')][_0x563a('0x52')]=_0x30bf2b['id'];_0x20bd36[_0x563a('0x4d')][_0x563a('0x53')]=integrations[_0x563a('0x54')](_0x20bd36[_0x563a('0x4d')]['channel'],_0x20bd36[_0x563a('0x4d')][_0x563a('0x31')]);_0x20bd36[_0x563a('0x4d')][_0x563a('0x55')]=integrations[_0x563a('0x56')](_0x20bd36[_0x563a('0x4d')][_0x563a('0x57')],_0x20bd36['body'][_0x563a('0x31')]);return db['ZendeskConfiguration']['create'](_0x20bd36['body'],{'include':[{'model':db[_0x563a('0x58')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x563a('0x55')}]});}return null;})[_0x563a('0x27')](respondWithResult(_0x3bbe7c,null))[_0x563a('0x4b')](handleError(_0x3bbe7c,null));};exports[_0x563a('0x59')]=function(_0x2e442f,_0x51220c,_0x4814b3){var _0x4c9ad7='';return db[_0x563a('0x43')][_0x563a('0x4f')]({'where':{'id':_0x2e442f[_0x563a('0x47')]['id']},'attributes':['id',_0x563a('0x5a'),_0x563a('0x5b'),_0x563a('0x5c'),'authType',_0x563a('0x5d')]})[_0x563a('0x27')](handleEntityNotFound(_0x51220c,null))['then'](function(_0x1983e5){if(_0x1983e5){_0x4c9ad7=_0x1983e5[_0x563a('0x5d')];var _0x15e9ce=_0x4c9ad7['slice'](-0x1);if(_0x15e9ce==='/'){_0x4c9ad7=_0x4c9ad7[_0x563a('0x5e')](0x0,_0x4c9ad7[_0x563a('0x5f')](_0x15e9ce));}var _0x332428={'method':_0x563a('0x60'),'uri':util['format'](_0x563a('0x61'),_0x4c9ad7,_0x563a('0x62')),'json':!![]};switch(_0x1983e5[_0x563a('0x63')]){case _0x563a('0x5b'):_0x332428[_0x563a('0x64')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x563a('0x65')]('%s:%s',_0x1983e5[_0x563a('0x5a')],_0x1983e5[_0x563a('0x5b')]))[_0x563a('0x66')](_0x563a('0x67')))};break;case _0x563a('0x5c'):_0x332428[_0x563a('0x64')]={'Authorization':util[_0x563a('0x65')](_0x563a('0x68'),new Buffer(util[_0x563a('0x65')](_0x563a('0x69'),_0x1983e5['username'],_0x1983e5[_0x563a('0x5c')]))['toString'](_0x563a('0x67')))};break;default:throw new db[(_0x563a('0x6a'))]['ValidationError'](_0x563a('0x6b'));}return rp(_0x332428);}})['then'](function(_0x41f530){if(_0x41f530){var _0x42c448=['subject',_0x563a('0x6c'),_0x563a('0x6d'),_0x563a('0x6e')];_[_0x563a('0x6f')](_0x41f530['ticket_fields'],function(_0x418646){return _0x42c448[_0x563a('0x70')](_0x418646[_0x563a('0x31')]);});return{'count':_0x41f530[_0x563a('0x62')][_0x563a('0x48')],'rows':_[_0x563a('0x2e')](_0x41f530[_0x563a('0x62')],function(_0x137d52){return{'id':_0x137d52['id'],'name':_0x137d52[_0x563a('0x71')]>0x7?_0x137d52[_0x563a('0x72')]:_0x137d52['type'],'custom':_0x137d52[_0x563a('0x71')]>0x7?!![]:![],'options':_0x137d52[_0x563a('0x73')]?_0x137d52[_0x563a('0x73')]:_0x137d52['custom_field_options']?_0x137d52[_0x563a('0x74')]:[]};})};}})[_0x563a('0x27')](respondWithResult(_0x51220c,null))[_0x563a('0x4b')](function(_0xe27e02){var _0x2cca62=_0x2e442f[_0x563a('0x34')][_0x563a('0x75')]?0x1f4:_0xe27e02[_0x563a('0x76')]||0x1f4;logger[_0x563a('0x29')](_0x563a('0x77'),_0x563a('0x59'),_0x2cca62,JSON[_0x563a('0x78')](_0xe27e02));delete _0xe27e02[_0x563a('0x2b')];if(_0x2cca62===0x191){_0x2cca62=0x190;}_0x51220c['status'](_0x2cca62)[_0x563a('0x2c')](_0x2e442f[_0x563a('0x34')]['test']?{'message':_0x563a('0x79'),'statusCode':_0xe27e02[_0x563a('0x76')]}:_0xe27e02);});};
\ No newline at end of file
+var _0x750a=['crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','destroy','then','error','name','index','map','ZendeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','merge','options','includeAll','include','rows','catch','show','params','find','create','body','ZendeskConfiguration','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','substring','lastIndexOf','GET','ticket_fields','password','headers','format','Basic\x20%s','%s:%s','token','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','includes','title','position','system_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x750a,0x140));var _0xa750=function(_0x480e9a,_0xd5afa0){_0x480e9a=_0x480e9a-0x0;var _0x22f890=_0x750a[_0x480e9a];return _0x22f890;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa750('0x15'));function respondWithStatusCode(_0x1c5657,_0x344c67){_0x344c67=_0x344c67||0xcc;return function(_0x567c51){if(_0x567c51){return _0x1c5657[_0xa750('0x16')](_0x344c67);}return _0x1c5657[_0xa750('0x17')](_0x344c67)[_0xa750('0x18')]();};}function respondWithResult(_0x24e48a,_0xa66181){_0xa66181=_0xa66181||0xc8;return function(_0x339329){if(_0x339329){return _0x24e48a['status'](_0xa66181)[_0xa750('0x19')](_0x339329);}};}function respondWithFilteredResult(_0x8488ea,_0x290d46){return function(_0x49fe3b){if(_0x49fe3b){var _0x337095=typeof _0x290d46[_0xa750('0x1a')]==='undefined'&&typeof _0x290d46['limit']===_0xa750('0x1b');var _0x5b1e6b=_0x49fe3b[_0xa750('0x1c')];var _0x1bde87=_0x337095?0x0:_0x290d46['offset'];var _0x36dcca=_0x337095?_0x49fe3b['count']:_0x290d46['offset']+_0x290d46[_0xa750('0x1d')];var _0x5d0935;if(_0x36dcca>=_0x5b1e6b){_0x36dcca=_0x5b1e6b;_0x5d0935=0xc8;}else{_0x5d0935=0xce;}_0x8488ea[_0xa750('0x17')](_0x5d0935);return _0x8488ea['set'](_0xa750('0x1e'),_0x1bde87+'-'+_0x36dcca+'/'+_0x5b1e6b)['json'](_0x49fe3b);}return null;};}function patchUpdates(_0x3dc7f1){return function(_0x500922){try{jsonpatch[_0xa750('0x1f')](_0x500922,_0x3dc7f1,!![]);}catch(_0x4d1939){return BPromise['reject'](_0x4d1939);}return _0x500922[_0xa750('0x20')]();};}function saveUpdates(_0x52da84,_0x216fbf){return function(_0x5a9d96){if(_0x5a9d96){return _0x5a9d96['update'](_0x52da84)['then'](function(_0x5d758e){return _0x5d758e;});}return null;};}function removeEntity(_0x15d72f,_0x2ec6c4){return function(_0x2c43ef){if(_0x2c43ef){return _0x2c43ef[_0xa750('0x21')]()[_0xa750('0x22')](function(){_0x15d72f[_0xa750('0x17')](0xcc)[_0xa750('0x18')]();});}};}function handleEntityNotFound(_0x7e22ad,_0x3d52b3){return function(_0x94697a){if(!_0x94697a){_0x7e22ad[_0xa750('0x16')](0x194);}return _0x94697a;};}function handleError(_0x27a5eb,_0x31ea63){_0x31ea63=_0x31ea63||0x1f4;return function(_0x3f7d6d){logger[_0xa750('0x23')](_0x3f7d6d['stack']);if(_0x3f7d6d[_0xa750('0x24')]){delete _0x3f7d6d[_0xa750('0x24')];}_0x27a5eb[_0xa750('0x17')](_0x31ea63)['send'](_0x3f7d6d);};}exports[_0xa750('0x25')]=function(_0x6ade2b,_0x3270e3){var _0x1223d2={},_0x579f1c={},_0x297eef={'count':0x0,'rows':[]};var _0x34d5e9=_[_0xa750('0x26')](db[_0xa750('0x27')][_0xa750('0x28')],function(_0x59ab33){return{'name':_0x59ab33[_0xa750('0x29')],'type':_0x59ab33['type'][_0xa750('0x2a')]};});_0x579f1c[_0xa750('0x2b')]=_['map'](_0x34d5e9,_0xa750('0x24'));_0x579f1c[_0xa750('0x2c')]=_[_0xa750('0x2d')](_0x6ade2b[_0xa750('0x2c')]);_0x579f1c[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x579f1c[_0xa750('0x2b')],_0x579f1c[_0xa750('0x2c')]);_0x1223d2['attributes']=_[_0xa750('0x2f')](_0x579f1c['model'],qs[_0xa750('0x30')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x30')]));_0x1223d2[_0xa750('0x31')]=_0x1223d2['attributes'][_0xa750('0x32')]?_0x1223d2[_0xa750('0x31')]:_0x579f1c['model'];if(!_0x6ade2b[_0xa750('0x2c')][_0xa750('0x33')](_0xa750('0x34'))){_0x1223d2[_0xa750('0x1d')]=qs['limit'](_0x6ade2b[_0xa750('0x2c')]['limit']);_0x1223d2['offset']=qs[_0xa750('0x1a')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x1a')]);}_0x1223d2['order']=qs[_0xa750('0x35')](_0x6ade2b[_0xa750('0x2c')][_0xa750('0x35')]);_0x1223d2['where']=qs[_0xa750('0x2e')](_[_0xa750('0x36')](_0x6ade2b[_0xa750('0x2c')],_0x579f1c['filters']),_0x34d5e9);if(_0x6ade2b[_0xa750('0x2c')][_0xa750('0x37')]){_0x1223d2[_0xa750('0x38')]=_['merge'](_0x1223d2[_0xa750('0x38')],{'$or':_[_0xa750('0x26')](_0x34d5e9,function(_0x1e579b){if(_0x1e579b[_0xa750('0x39')]!=='VIRTUAL'){var _0x4dc0b8={};_0x4dc0b8[_0x1e579b[_0xa750('0x24')]]={'$like':'%'+_0x6ade2b[_0xa750('0x2c')]['filter']+'%'};return _0x4dc0b8;}})});}_0x1223d2=_[_0xa750('0x3a')]({},_0x1223d2,_0x6ade2b[_0xa750('0x3b')]);var _0x15d35a={'where':_0x1223d2[_0xa750('0x38')]};return db[_0xa750('0x27')]['count'](_0x15d35a)[_0xa750('0x22')](function(_0x2b33e0){_0x297eef[_0xa750('0x1c')]=_0x2b33e0;if(_0x6ade2b[_0xa750('0x2c')][_0xa750('0x3c')]){_0x1223d2[_0xa750('0x3d')]=[{'all':!![]}];}return db[_0xa750('0x27')]['findAll'](_0x1223d2);})[_0xa750('0x22')](function(_0x5e9ffb){_0x297eef[_0xa750('0x3e')]=_0x5e9ffb;return _0x297eef;})['then'](respondWithFilteredResult(_0x3270e3,_0x1223d2))[_0xa750('0x3f')](handleError(_0x3270e3,null));};exports[_0xa750('0x40')]=function(_0xf9fd5f,_0x1be24e){var _0x430d60={'raw':![],'where':{'id':_0xf9fd5f[_0xa750('0x41')]['id']}},_0xe27272={};_0xe27272[_0xa750('0x2b')]=_[_0xa750('0x2d')](db[_0xa750('0x27')][_0xa750('0x28')]);_0xe27272[_0xa750('0x2c')]=_[_0xa750('0x2d')](_0xf9fd5f[_0xa750('0x2c')]);_0xe27272[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0xe27272[_0xa750('0x2b')],_0xe27272[_0xa750('0x2c')]);_0x430d60[_0xa750('0x31')]=_[_0xa750('0x2f')](_0xe27272['model'],qs[_0xa750('0x30')](_0xf9fd5f[_0xa750('0x2c')][_0xa750('0x30')]));_0x430d60[_0xa750('0x31')]=_0x430d60[_0xa750('0x31')][_0xa750('0x32')]?_0x430d60[_0xa750('0x31')]:_0xe27272[_0xa750('0x2b')];if(_0xf9fd5f[_0xa750('0x2c')]['includeAll']){_0x430d60[_0xa750('0x3d')]=[{'all':!![]}];}_0x430d60=_[_0xa750('0x3a')]({},_0x430d60,_0xf9fd5f['options']);return db[_0xa750('0x27')][_0xa750('0x42')](_0x430d60)[_0xa750('0x22')](handleEntityNotFound(_0x1be24e,null))[_0xa750('0x22')](respondWithResult(_0x1be24e,null))[_0xa750('0x3f')](handleError(_0x1be24e,null));};exports[_0xa750('0x43')]=function(_0x5e7a95,_0x278c22){return db[_0xa750('0x27')][_0xa750('0x43')](_0x5e7a95['body'],{})[_0xa750('0x22')](respondWithResult(_0x278c22,0xc9))[_0xa750('0x3f')](handleError(_0x278c22,null));};exports['update']=function(_0x93e49f,_0x2397e1){if(_0x93e49f[_0xa750('0x44')]['id']){delete _0x93e49f['body']['id'];}return db[_0xa750('0x27')][_0xa750('0x42')]({'where':{'id':_0x93e49f[_0xa750('0x41')]['id']}})[_0xa750('0x22')](handleEntityNotFound(_0x2397e1,null))['then'](saveUpdates(_0x93e49f[_0xa750('0x44')],null))[_0xa750('0x22')](respondWithResult(_0x2397e1,null))[_0xa750('0x3f')](handleError(_0x2397e1,null));};exports[_0xa750('0x21')]=function(_0x4ce363,_0x203f2a){return db[_0xa750('0x27')]['find']({'where':{'id':_0x4ce363[_0xa750('0x41')]['id']}})['then'](handleEntityNotFound(_0x203f2a,null))[_0xa750('0x22')](removeEntity(_0x203f2a,null))[_0xa750('0x3f')](handleError(_0x203f2a,null));};exports['getConfigurations']=function(_0x47e93c,_0x58eba1,_0x232da4){var _0x401125={};var _0x4ea12b={};var _0xe88dc;var _0x1a79a9;return db[_0xa750('0x27')]['findOne']({'where':{'id':_0x47e93c['params']['id']}})['then'](handleEntityNotFound(_0x58eba1,null))['then'](function(_0x3c34d4){if(_0x3c34d4){_0xe88dc=_0x3c34d4;_0x4ea12b['model']=_[_0xa750('0x2d')](db[_0xa750('0x45')]['rawAttributes']);_0x4ea12b[_0xa750('0x2c')]=_['keys'](_0x47e93c[_0xa750('0x2c')]);_0x4ea12b['filters']=_['intersection'](_0x4ea12b['model'],_0x4ea12b['query']);_0x401125[_0xa750('0x31')]=_[_0xa750('0x2f')](_0x4ea12b['model'],qs['fields'](_0x47e93c['query'][_0xa750('0x30')]));_0x401125[_0xa750('0x31')]=_0x401125[_0xa750('0x31')][_0xa750('0x32')]?_0x401125[_0xa750('0x31')]:_0x4ea12b[_0xa750('0x2b')];_0x401125['order']=qs['sort'](_0x47e93c[_0xa750('0x2c')][_0xa750('0x35')]);_0x401125[_0xa750('0x38')]=qs[_0xa750('0x2e')](_[_0xa750('0x36')](_0x47e93c['query'],_0x4ea12b[_0xa750('0x2e')]));if(_0x47e93c[_0xa750('0x2c')][_0xa750('0x37')]){_0x401125[_0xa750('0x38')]=_[_0xa750('0x3a')](_0x401125[_0xa750('0x38')],{'$or':_[_0xa750('0x26')](_0x401125[_0xa750('0x31')],function(_0x5e78f1){var _0x2aa1d6={};_0x2aa1d6[_0x5e78f1]={'$like':'%'+_0x47e93c[_0xa750('0x2c')][_0xa750('0x37')]+'%'};return _0x2aa1d6;})});}_0x401125=_[_0xa750('0x3a')]({},_0x401125,_0x47e93c[_0xa750('0x3b')]);return _0xe88dc['getConfigurations'](_0x401125);}})[_0xa750('0x22')](function(_0x25248f){if(_0x25248f){_0x1a79a9=_0x25248f[_0xa750('0x32')];if(!_0x47e93c[_0xa750('0x2c')][_0xa750('0x33')](_0xa750('0x34'))){_0x401125[_0xa750('0x1d')]=qs[_0xa750('0x1d')](_0x47e93c[_0xa750('0x2c')][_0xa750('0x1d')]);_0x401125[_0xa750('0x1a')]=qs[_0xa750('0x1a')](_0x47e93c[_0xa750('0x2c')][_0xa750('0x1a')]);}return _0xe88dc[_0xa750('0x46')](_0x401125);}})[_0xa750('0x22')](function(_0x49e132){if(_0x49e132){return _0x49e132?{'count':_0x1a79a9,'rows':_0x49e132}:null;}})[_0xa750('0x22')](respondWithResult(_0x58eba1,null))['catch'](handleError(_0x58eba1,null));};exports[_0xa750('0x47')]=function(_0x2d488d,_0xbe7451,_0x5845c5){if(_0x2d488d[_0xa750('0x44')]['id']){delete _0x2d488d[_0xa750('0x44')]['id'];}return db[_0xa750('0x27')][_0xa750('0x48')]({'where':{'id':_0x2d488d[_0xa750('0x41')]['id']}})[_0xa750('0x22')](handleEntityNotFound(_0xbe7451,null))['then'](function(_0x3001d7){if(_0x3001d7){_0x2d488d[_0xa750('0x44')]['AccountId']=_0x3001d7['id'];_0x2d488d[_0xa750('0x44')][_0xa750('0x49')]=integrations[_0xa750('0x4a')](_0x2d488d[_0xa750('0x44')][_0xa750('0x4b')],_0x2d488d[_0xa750('0x44')][_0xa750('0x39')]);_0x2d488d[_0xa750('0x44')][_0xa750('0x4c')]=integrations[_0xa750('0x4d')](_0x2d488d[_0xa750('0x44')]['channel'],_0x2d488d['body'][_0xa750('0x39')]);return db[_0xa750('0x45')][_0xa750('0x43')](_0x2d488d[_0xa750('0x44')],{'include':[{'model':db['ZendeskField'],'as':_0xa750('0x49')},{'model':db[_0xa750('0x4e')],'as':_0xa750('0x4c')}]});}return null;})[_0xa750('0x22')](respondWithResult(_0xbe7451,null))[_0xa750('0x3f')](handleError(_0xbe7451,null));};exports[_0xa750('0x4f')]=function(_0x17b25e,_0x5d883d,_0x1dcc15){var _0x2783b9='';return db[_0xa750('0x27')]['findOne']({'where':{'id':_0x17b25e['params']['id']},'attributes':['id',_0xa750('0x50'),'password','token',_0xa750('0x51'),_0xa750('0x52')]})[_0xa750('0x22')](handleEntityNotFound(_0x5d883d,null))[_0xa750('0x22')](function(_0x292dab){if(_0x292dab){_0x2783b9=_0x292dab['remoteUri'];var _0x3ac9a2=_0x2783b9[_0xa750('0x53')](-0x1);if(_0x3ac9a2==='/'){_0x2783b9=_0x2783b9[_0xa750('0x54')](0x0,_0x2783b9[_0xa750('0x55')](_0x3ac9a2));}var _0x439dce={'method':_0xa750('0x56'),'uri':util['format']('%s/%s',_0x2783b9,_0xa750('0x57')),'json':!![]};switch(_0x292dab[_0xa750('0x51')]){case _0xa750('0x58'):_0x439dce[_0xa750('0x59')]={'Authorization':util[_0xa750('0x5a')](_0xa750('0x5b'),new Buffer(util[_0xa750('0x5a')](_0xa750('0x5c'),_0x292dab['username'],_0x292dab[_0xa750('0x58')]))['toString']('base64'))};break;case _0xa750('0x5d'):_0x439dce[_0xa750('0x59')]={'Authorization':util[_0xa750('0x5a')](_0xa750('0x5b'),new Buffer(util['format'](_0xa750('0x5e'),_0x292dab[_0xa750('0x50')],_0x292dab[_0xa750('0x5d')]))[_0xa750('0x5f')]('base64'))};break;default:throw new db[(_0xa750('0x60'))][(_0xa750('0x61'))](_0xa750('0x62'));}return rp(_0x439dce);}})[_0xa750('0x22')](function(_0x332862){if(_0x332862){var _0x14de1b=[_0xa750('0x63'),_0xa750('0x64'),'group','assignee'];_[_0xa750('0x65')](_0x332862['ticket_fields'],function(_0x2c4114){return _0x14de1b[_0xa750('0x66')](_0x2c4114['type']);});return{'count':_0x332862[_0xa750('0x57')]['length'],'rows':_[_0xa750('0x26')](_0x332862[_0xa750('0x57')],function(_0x77110){return{'id':_0x77110['id'],'name':_0x77110['position']>0x7?_0x77110[_0xa750('0x67')]:_0x77110[_0xa750('0x39')],'custom':_0x77110[_0xa750('0x68')]>0x7?!![]:![],'options':_0x77110[_0xa750('0x69')]?_0x77110['system_field_options']:_0x77110['custom_field_options']?_0x77110['custom_field_options']:[]};})};}})[_0xa750('0x22')](respondWithResult(_0x5d883d,null))[_0xa750('0x3f')](function(_0x5387dc){var _0x12cae9=_0x17b25e[_0xa750('0x2c')][_0xa750('0x6a')]?0x1f4:_0x5387dc[_0xa750('0x6b')]||0x1f4;logger[_0xa750('0x23')](_0xa750('0x6c'),'getFields',_0x12cae9,JSON[_0xa750('0x6d')](_0x5387dc));delete _0x5387dc[_0xa750('0x24')];if(_0x12cae9===0x191){_0x12cae9=0x190;}_0x5d883d[_0xa750('0x17')](_0x12cae9)['send'](_0x17b25e[_0xa750('0x2c')][_0xa750('0x6a')]?{'message':_0xa750('0x6e'),'statusCode':_0x5387dc[_0xa750('0x6b')]}:_0x5387dc);});};
\ No newline at end of file
index a446f8c..34f4d38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa11e=['define','ZendeskAccount','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0xa11e,0x120));var _0xea11=function(_0x5a1791,_0xacd4ca){_0x5a1791=_0x5a1791-0x0;var _0x22163e=_0xa11e[_0x5a1791];return _0x22163e;};'use strict';var _=require(_0xea11('0x0'));var util=require('util');var logger=require(_0xea11('0x1'))('api');var moment=require(_0xea11('0x2'));var BPromise=require(_0xea11('0x3'));var rp=require(_0xea11('0x4'));var fs=require('fs');var path=require(_0xea11('0x5'));var rimraf=require(_0xea11('0x6'));var config=require(_0xea11('0x7'));var attributes=require(_0xea11('0x8'));var integrations=require(_0xea11('0x9'));module[_0xea11('0xa')]=function(_0x198bfc,_0x13dbd8){return _0x198bfc[_0xea11('0xb')](_0xea11('0xc'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe037=['path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xe037,0x166));var _0x7e03=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xe037[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require(_0x7e03('0x0'));var logger=require(_0x7e03('0x1'))(_0x7e03('0x2'));var moment=require(_0x7e03('0x3'));var BPromise=require(_0x7e03('0x4'));var rp=require(_0x7e03('0x5'));var fs=require('fs');var path=require(_0x7e03('0x6'));var rimraf=require('rimraf');var config=require(_0x7e03('0x7'));var attributes=require(_0x7e03('0x8'));var integrations=require(_0x7e03('0x9'));module[_0x7e03('0xa')]=function(_0x53d21a,_0x1b24ba){return _0x53d21a[_0x7e03('0xb')](_0x7e03('0xc'),attributes,{'tableName':_0x7e03('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7842e7f..477a22a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x243b=['find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetZendeskAccount','findAll','options','where','limit','include','map','attributes','model','ShowZendeskAccount','ZendeskAccount'];(function(_0xd6ca7,_0xf8aca2){var _0x5f269f=function(_0x1c58b9){while(--_0x1c58b9){_0xd6ca7['push'](_0xd6ca7['shift']());}};_0x5f269f(++_0xf8aca2);}(_0x243b,0xb1));var _0xb243=function(_0x283596,_0x2a33ce){_0x283596=_0x283596-0x0;var _0x21b223=_0x243b[_0x283596];return _0x21b223;};'use strict';var _=require('lodash');var util=require(_0xb243('0x0'));var moment=require(_0xb243('0x1'));var BPromise=require(_0xb243('0x2'));var rs=require(_0xb243('0x3'));var fs=require('fs');var Redis=require(_0xb243('0x4'));var db=require(_0xb243('0x5'))['db'];var utils=require(_0xb243('0x6'));var logger=require(_0xb243('0x7'))('rpc');var config=require(_0xb243('0x8'));var jayson=require(_0xb243('0x9'));var client=jayson['client'][_0xb243('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x262638,_0x1b6c0f,_0x12cffd){return new BPromise(function(_0x5476e6,_0x4a5a7d){return client['request'](_0x262638,_0x12cffd)[_0xb243('0xb')](function(_0x589210){logger['info'](_0xb243('0xc'),_0x1b6c0f,_0xb243('0xd'));logger[_0xb243('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1b6c0f,_0xb243('0xd'),JSON[_0xb243('0xf')](_0x589210));if(_0x589210['error']){if(_0x589210[_0xb243('0x10')][_0xb243('0x11')]===0x1f4){logger['error'](_0xb243('0xc'),_0x1b6c0f,_0x589210[_0xb243('0x10')][_0xb243('0x12')]);return _0x4a5a7d(_0x589210[_0xb243('0x10')]['message']);}logger[_0xb243('0x10')](_0xb243('0xc'),_0x1b6c0f,_0x589210[_0xb243('0x10')]['message']);return _0x5476e6(_0x589210[_0xb243('0x10')][_0xb243('0x12')]);}else{logger[_0xb243('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x1b6c0f,_0xb243('0xd'));_0x5476e6(_0x589210[_0xb243('0x14')]['message']);}})[_0xb243('0x15')](function(_0xc9c91c){logger[_0xb243('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x1b6c0f,_0xc9c91c);_0x4a5a7d(_0xc9c91c);});});}exports[_0xb243('0x16')]=function(_0x4e0d57){var _0x6f18dd=this;return new Promise(function(_0x4587f5,_0x328170){return db['ZendeskAccount'][_0xb243('0x17')]({'raw':_0x4e0d57[_0xb243('0x18')]?_0x4e0d57[_0xb243('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4e0d57[_0xb243('0x18')]?_0x4e0d57[_0xb243('0x18')][_0xb243('0x19')]||null:null,'attributes':_0x4e0d57[_0xb243('0x18')]?_0x4e0d57[_0xb243('0x18')]['attributes']||null:null,'limit':_0x4e0d57[_0xb243('0x18')]?_0x4e0d57[_0xb243('0x18')][_0xb243('0x1a')]||null:null,'include':_0x4e0d57[_0xb243('0x18')]?_0x4e0d57[_0xb243('0x18')][_0xb243('0x1b')]?_[_0xb243('0x1c')](_0x4e0d57[_0xb243('0x18')]['include'],function(_0x877835){return{'model':db[_0x877835['model']],'as':_0x877835['as'],'attributes':_0x877835[_0xb243('0x1d')],'include':_0x877835['include']?_[_0xb243('0x1c')](_0x877835[_0xb243('0x1b')],function(_0x2460fc){return{'model':db[_0x2460fc[_0xb243('0x1e')]],'as':_0x2460fc['as'],'attributes':_0x2460fc[_0xb243('0x1d')],'include':_0x2460fc[_0xb243('0x1b')]?_[_0xb243('0x1c')](_0x2460fc[_0xb243('0x1b')],function(_0x485ed3){return{'model':db[_0x485ed3['model']],'as':_0x485ed3['as'],'attributes':_0x485ed3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x12cd3e){logger[_0xb243('0x13')](_0xb243('0x16'),_0x4e0d57);logger[_0xb243('0xe')](_0xb243('0x16'),_0x4e0d57,JSON[_0xb243('0xf')](_0x12cd3e));_0x4587f5(_0x12cd3e);})[_0xb243('0x15')](function(_0x31f4b7){logger['error'](_0xb243('0x16'),_0x31f4b7[_0xb243('0x12')],_0x4e0d57);_0x328170(_0x6f18dd[_0xb243('0x10')](0x1f4,_0x31f4b7[_0xb243('0x12')]));});});};exports[_0xb243('0x1f')]=function(_0x3889b3){var _0x7eef1a=this;return new Promise(function(_0x37fa77,_0x535e36){return db[_0xb243('0x20')][_0xb243('0x21')]({'raw':_0x3889b3[_0xb243('0x18')]?_0x3889b3[_0xb243('0x18')][_0xb243('0x22')]===undefined?!![]:![]:!![],'where':_0x3889b3[_0xb243('0x18')]?_0x3889b3['options'][_0xb243('0x19')]||null:null,'attributes':_0x3889b3[_0xb243('0x18')]?_0x3889b3[_0xb243('0x18')][_0xb243('0x1d')]||null:null,'include':_0x3889b3['options']?_0x3889b3['options']['include']?_[_0xb243('0x1c')](_0x3889b3['options']['include'],function(_0x58cb21){return{'model':db[_0x58cb21['model']],'as':_0x58cb21['as'],'attributes':_0x58cb21[_0xb243('0x1d')],'include':_0x58cb21[_0xb243('0x1b')]?_['map'](_0x58cb21[_0xb243('0x1b')],function(_0x1f9e61){return{'model':db[_0x1f9e61[_0xb243('0x1e')]],'as':_0x1f9e61['as'],'attributes':_0x1f9e61['attributes'],'include':_0x1f9e61[_0xb243('0x1b')]?_[_0xb243('0x1c')](_0x1f9e61[_0xb243('0x1b')],function(_0x3cbbbe){return{'model':db[_0x3cbbbe[_0xb243('0x1e')]],'as':_0x3cbbbe['as'],'attributes':_0x3cbbbe[_0xb243('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb243('0xb')](function(_0x5de60e){logger['info'](_0xb243('0x1f'),_0x3889b3);logger[_0xb243('0xe')]('ShowZendeskAccount',_0x3889b3,JSON[_0xb243('0xf')](_0x5de60e));_0x37fa77(_0x5de60e);})[_0xb243('0x15')](function(_0x51759d){logger[_0xb243('0x10')]('ShowZendeskAccount',_0x51759d['message'],_0x3889b3);_0x535e36(_0x7eef1a['error'](0x1f4,_0x51759d['message']));});});};
\ No newline at end of file
+var _0xe163=['error','message','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','ZendeskAccount','info','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x3041ce,_0x382f98){var _0x68a7f9=function(_0x3acbfa){while(--_0x3acbfa){_0x3041ce['push'](_0x3041ce['shift']());}};_0x68a7f9(++_0x382f98);}(_0xe163,0xcb));var _0x3e16=function(_0x106b42,_0x44ff5e){_0x106b42=_0x106b42-0x0;var _0x110207=_0xe163[_0x106b42];return _0x110207;};'use strict';var _=require('lodash');var util=require(_0x3e16('0x0'));var moment=require('moment');var BPromise=require(_0x3e16('0x1'));var rs=require(_0x3e16('0x2'));var fs=require('fs');var Redis=require(_0x3e16('0x3'));var db=require(_0x3e16('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3e16('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3e16('0x6')][_0x3e16('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a5cdb,_0x4ad2f7,_0x590efb){return new BPromise(function(_0x3c4539,_0x548b64){return client[_0x3e16('0x8')](_0x2a5cdb,_0x590efb)[_0x3e16('0x9')](function(_0x2ca47a){logger['info'](_0x3e16('0xa'),_0x4ad2f7,'request\x20sent');logger[_0x3e16('0xb')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x4ad2f7,_0x3e16('0xc'),JSON[_0x3e16('0xd')](_0x2ca47a));if(_0x2ca47a[_0x3e16('0xe')]){if(_0x2ca47a[_0x3e16('0xe')]['code']===0x1f4){logger[_0x3e16('0xe')](_0x3e16('0xa'),_0x4ad2f7,_0x2ca47a[_0x3e16('0xe')]['message']);return _0x548b64(_0x2ca47a['error']['message']);}logger[_0x3e16('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x4ad2f7,_0x2ca47a[_0x3e16('0xe')]['message']);return _0x3c4539(_0x2ca47a[_0x3e16('0xe')][_0x3e16('0xf')]);}else{logger['info'](_0x3e16('0xa'),_0x4ad2f7,_0x3e16('0xc'));_0x3c4539(_0x2ca47a[_0x3e16('0x10')]['message']);}})[_0x3e16('0x11')](function(_0x55efe3){logger[_0x3e16('0xe')](_0x3e16('0xa'),_0x4ad2f7,_0x55efe3);_0x548b64(_0x55efe3);});});}exports[_0x3e16('0x12')]=function(_0x4b5529){var _0x9268c3=this;return new Promise(function(_0x34a2ee,_0x56ef18){return db['ZendeskAccount'][_0x3e16('0x13')]({'raw':_0x4b5529[_0x3e16('0x14')]?_0x4b5529[_0x3e16('0x14')][_0x3e16('0x15')]===undefined?!![]:![]:!![],'where':_0x4b5529[_0x3e16('0x14')]?_0x4b5529[_0x3e16('0x14')][_0x3e16('0x16')]||null:null,'attributes':_0x4b5529[_0x3e16('0x14')]?_0x4b5529[_0x3e16('0x14')][_0x3e16('0x17')]||null:null,'limit':_0x4b5529['options']?_0x4b5529[_0x3e16('0x14')][_0x3e16('0x18')]||null:null,'include':_0x4b5529[_0x3e16('0x14')]?_0x4b5529[_0x3e16('0x14')][_0x3e16('0x19')]?_[_0x3e16('0x1a')](_0x4b5529[_0x3e16('0x14')][_0x3e16('0x19')],function(_0x52899a){return{'model':db[_0x52899a[_0x3e16('0x1b')]],'as':_0x52899a['as'],'attributes':_0x52899a[_0x3e16('0x17')],'include':_0x52899a['include']?_[_0x3e16('0x1a')](_0x52899a[_0x3e16('0x19')],function(_0x105663){return{'model':db[_0x105663[_0x3e16('0x1b')]],'as':_0x105663['as'],'attributes':_0x105663[_0x3e16('0x17')],'include':_0x105663[_0x3e16('0x19')]?_['map'](_0x105663[_0x3e16('0x19')],function(_0xe127b2){return{'model':db[_0xe127b2[_0x3e16('0x1b')]],'as':_0xe127b2['as'],'attributes':_0xe127b2[_0x3e16('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x399af3){logger['info'](_0x3e16('0x12'),_0x4b5529);logger[_0x3e16('0xb')](_0x3e16('0x12'),_0x4b5529,JSON[_0x3e16('0xd')](_0x399af3));_0x34a2ee(_0x399af3);})[_0x3e16('0x11')](function(_0x3b6f5a){logger[_0x3e16('0xe')](_0x3e16('0x12'),_0x3b6f5a[_0x3e16('0xf')],_0x4b5529);_0x56ef18(_0x9268c3[_0x3e16('0xe')](0x1f4,_0x3b6f5a[_0x3e16('0xf')]));});});};exports[_0x3e16('0x1c')]=function(_0x1c8f1b){var _0x25ccd6=this;return new Promise(function(_0x661186,_0x422bf5){return db[_0x3e16('0x1d')]['find']({'raw':_0x1c8f1b[_0x3e16('0x14')]?_0x1c8f1b[_0x3e16('0x14')][_0x3e16('0x15')]===undefined?!![]:![]:!![],'where':_0x1c8f1b['options']?_0x1c8f1b[_0x3e16('0x14')]['where']||null:null,'attributes':_0x1c8f1b['options']?_0x1c8f1b[_0x3e16('0x14')]['attributes']||null:null,'include':_0x1c8f1b[_0x3e16('0x14')]?_0x1c8f1b[_0x3e16('0x14')][_0x3e16('0x19')]?_[_0x3e16('0x1a')](_0x1c8f1b['options']['include'],function(_0x4dfafe){return{'model':db[_0x4dfafe[_0x3e16('0x1b')]],'as':_0x4dfafe['as'],'attributes':_0x4dfafe[_0x3e16('0x17')],'include':_0x4dfafe[_0x3e16('0x19')]?_[_0x3e16('0x1a')](_0x4dfafe[_0x3e16('0x19')],function(_0x23978f){return{'model':db[_0x23978f['model']],'as':_0x23978f['as'],'attributes':_0x23978f[_0x3e16('0x17')],'include':_0x23978f[_0x3e16('0x19')]?_['map'](_0x23978f[_0x3e16('0x19')],function(_0x2f9bcd){return{'model':db[_0x2f9bcd[_0x3e16('0x1b')]],'as':_0x2f9bcd['as'],'attributes':_0x2f9bcd[_0x3e16('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3e16('0x9')](function(_0xf7fb8c){logger[_0x3e16('0x1e')](_0x3e16('0x1c'),_0x1c8f1b);logger[_0x3e16('0xb')](_0x3e16('0x1c'),_0x1c8f1b,JSON[_0x3e16('0xd')](_0xf7fb8c));_0x661186(_0xf7fb8c);})[_0x3e16('0x11')](function(_0x57b254){logger[_0x3e16('0xe')](_0x3e16('0x1c'),_0x57b254[_0x3e16('0xf')],_0x1c8f1b);_0x422bf5(_0x25ccd6[_0x3e16('0xe')](0x1f4,_0x57b254[_0x3e16('0xf')]));});});};
\ No newline at end of file
index a16ba4c..097b8ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x13bea0,_0x210a0c){var _0x3f12df=function(_0x11ef1c){while(--_0x11ef1c){_0x13bea0['push'](_0x13bea0['shift']());}};_0x3f12df(++_0x210a0c);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3ebff4,_0x5efe9a){_0x3ebff4=_0x3ebff4-0x0;var _0x6331b7=_0xbdb7[_0x3ebff4];return _0x6331b7;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router;
\ No newline at end of file
+var _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x931e05,_0x1ab7ff){var _0x26fdfa=function(_0x54aeb2){while(--_0x54aeb2){_0x931e05['push'](_0x931e05['shift']());}};_0x26fdfa(++_0x1ab7ff);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router;
\ No newline at end of file
index 2571dbb..488b67e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x724f=['exports','STRING','sequelize'];(function(_0x147b23,_0x1d1eec){var _0x318261=function(_0xab05d3){while(--_0xab05d3){_0x147b23['push'](_0x147b23['shift']());}};_0x318261(++_0x1d1eec);}(_0x724f,0x8f));var _0xf724=function(_0x8745e5,_0x16ca68){_0x8745e5=_0x8745e5-0x0;var _0x53a321=_0x724f[_0x8745e5];return _0x53a321;};'use strict';var Sequelize=require(_0xf724('0x0'));module[_0xf724('0x1')]={'name':{'type':Sequelize[_0xf724('0x2')]},'description':{'type':Sequelize[_0xf724('0x2')]}};
\ No newline at end of file
+var _0xf020=['exports','STRING','sequelize'];(function(_0x347f98,_0x23b964){var _0x5c8bfc=function(_0x2c997f){while(--_0x2c997f){_0x347f98['push'](_0x347f98['shift']());}};_0x5c8bfc(++_0x23b964);}(_0xf020,0x185));var _0x0f02=function(_0xffab8f,_0x33847a){_0xffab8f=_0xffab8f-0x0;var _0x4ada85=_0xf020[_0xffab8f];return _0x4ada85;};'use strict';var Sequelize=require(_0x0f02('0x0'));module[_0x0f02('0x1')]={'name':{'type':Sequelize[_0x0f02('0x2')]},'description':{'type':Sequelize[_0x0f02('0x2')]}};
\ No newline at end of file
index fc13e0c..d6f27a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x494d=['getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','map','ZendeskConfiguration','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','findAll','catch','params','rawAttributes','include','find','body','getFields','findOne','ZendeskField','filter'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x494d,0xad));var _0xd494=function(_0x101d94,_0x2ae365){_0x101d94=_0x101d94-0x0;var _0x5ab29b=_0x494d[_0x101d94];return _0x5ab29b;};'use strict';var emlformat=require(_0xd494('0x0'));var rimraf=require(_0xd494('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd494('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd494('0x3'));var Mustache=require(_0xd494('0x4'));var util=require(_0xd494('0x5'));var path=require(_0xd494('0x6'));var sox=require(_0xd494('0x7'));var csv=require('to-csv');var ejs=require(_0xd494('0x8'));var fs=require('fs');var fs_extra=require(_0xd494('0x9'));var _=require(_0xd494('0xa'));var squel=require(_0xd494('0xb'));var crypto=require(_0xd494('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd494('0xd'));var toCsv=require(_0xd494('0xe'));var querystring=require(_0xd494('0xf'));var Papa=require(_0xd494('0x10'));var Redis=require(_0xd494('0x11'));var authService=require(_0xd494('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd494('0x13'));var hardwareService=require(_0xd494('0x14'));var logger=require(_0xd494('0x15'))(_0xd494('0x16'));var utils=require(_0xd494('0x17'));var config=require(_0xd494('0x18'));var licenseUtil=require(_0xd494('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442975,_0x5188ad){_0x5188ad=_0x5188ad||0xcc;return function(_0x1f812d){if(_0x1f812d){return _0x442975[_0xd494('0x1a')](_0x5188ad);}return _0x442975[_0xd494('0x1b')](_0x5188ad)[_0xd494('0x1c')]();};}function respondWithResult(_0xcd3c9d,_0xfe9287){_0xfe9287=_0xfe9287||0xc8;return function(_0x45b4d3){if(_0x45b4d3){return _0xcd3c9d[_0xd494('0x1b')](_0xfe9287)[_0xd494('0x1d')](_0x45b4d3);}};}function respondWithFilteredResult(_0x532044,_0x5b29e7){return function(_0x559833){if(_0x559833){var _0xaea2a7=typeof _0x5b29e7['offset']===_0xd494('0x1e')&&typeof _0x5b29e7[_0xd494('0x1f')]===_0xd494('0x1e');var _0x22c506=_0x559833['count'];var _0x540960=_0xaea2a7?0x0:_0x5b29e7['offset'];var _0x80b3bb=_0xaea2a7?_0x559833[_0xd494('0x20')]:_0x5b29e7['offset']+_0x5b29e7[_0xd494('0x1f')];var _0x285cc9;if(_0x80b3bb>=_0x22c506){_0x80b3bb=_0x22c506;_0x285cc9=0xc8;}else{_0x285cc9=0xce;}_0x532044[_0xd494('0x1b')](_0x285cc9);return _0x532044[_0xd494('0x21')]('Content-Range',_0x540960+'-'+_0x80b3bb+'/'+_0x22c506)[_0xd494('0x1d')](_0x559833);}return null;};}function patchUpdates(_0x48c2b4){return function(_0xb34962){try{jsonpatch[_0xd494('0x22')](_0xb34962,_0x48c2b4,!![]);}catch(_0x2908c7){return BPromise[_0xd494('0x23')](_0x2908c7);}return _0xb34962[_0xd494('0x24')]();};}function saveUpdates(_0x2e8295,_0x33ff40){return function(_0x2329c1){if(_0x2329c1){return _0x2329c1[_0xd494('0x25')](_0x2e8295)[_0xd494('0x26')](function(_0x401bcd){return _0x401bcd;});}return null;};}function removeEntity(_0x3b8f8d,_0x236dab){return function(_0x12a2f0){if(_0x12a2f0){return _0x12a2f0[_0xd494('0x27')]()[_0xd494('0x26')](function(){_0x3b8f8d[_0xd494('0x1b')](0xcc)[_0xd494('0x1c')]();});}};}function handleEntityNotFound(_0x3451df,_0x151ae2){return function(_0x4ead01){if(!_0x4ead01){_0x3451df['sendStatus'](0x194);}return _0x4ead01;};}function handleError(_0x1c4256,_0x48966f){_0x48966f=_0x48966f||0x1f4;return function(_0x1d2700){logger['error'](_0x1d2700[_0xd494('0x28')]);if(_0x1d2700[_0xd494('0x29')]){delete _0x1d2700['name'];}_0x1c4256[_0xd494('0x1b')](_0x48966f)['send'](_0x1d2700);};}exports['index']=function(_0x535d44,_0x5c6495){var _0x3b1c62={},_0x2818ce={},_0x437519={'count':0x0,'rows':[]};var _0x59f64e=_[_0xd494('0x2a')](db[_0xd494('0x2b')]['rawAttributes'],function(_0x71c0d3){return{'name':_0x71c0d3[_0xd494('0x2c')],'type':_0x71c0d3[_0xd494('0x2d')][_0xd494('0x2e')]};});_0x2818ce[_0xd494('0x2f')]=_[_0xd494('0x2a')](_0x59f64e,_0xd494('0x29'));_0x2818ce['query']=_[_0xd494('0x30')](_0x535d44[_0xd494('0x31')]);_0x2818ce['filters']=_[_0xd494('0x32')](_0x2818ce[_0xd494('0x2f')],_0x2818ce['query']);_0x3b1c62['attributes']=_[_0xd494('0x32')](_0x2818ce[_0xd494('0x2f')],qs[_0xd494('0x33')](_0x535d44['query'][_0xd494('0x33')]));_0x3b1c62[_0xd494('0x34')]=_0x3b1c62['attributes'][_0xd494('0x35')]?_0x3b1c62['attributes']:_0x2818ce[_0xd494('0x2f')];if(!_0x535d44[_0xd494('0x31')][_0xd494('0x36')]('nolimit')){_0x3b1c62['limit']=qs['limit'](_0x535d44[_0xd494('0x31')][_0xd494('0x1f')]);_0x3b1c62[_0xd494('0x37')]=qs['offset'](_0x535d44['query'][_0xd494('0x37')]);}_0x3b1c62[_0xd494('0x38')]=qs[_0xd494('0x39')](_0x535d44[_0xd494('0x31')][_0xd494('0x39')]);_0x3b1c62[_0xd494('0x3a')]=qs['filters'](_[_0xd494('0x3b')](_0x535d44[_0xd494('0x31')],_0x2818ce[_0xd494('0x3c')]),_0x59f64e);if(_0x535d44['query']['filter']){_0x3b1c62[_0xd494('0x3a')]=_[_0xd494('0x3d')](_0x3b1c62[_0xd494('0x3a')],{'$or':_['map'](_0x59f64e,function(_0x564bba){if(_0x564bba[_0xd494('0x2d')]!==_0xd494('0x3e')){var _0x3e35b3={};_0x3e35b3[_0x564bba['name']]={'$like':'%'+_0x535d44[_0xd494('0x31')]['filter']+'%'};return _0x3e35b3;}})});}_0x3b1c62=_[_0xd494('0x3d')]({},_0x3b1c62,_0x535d44[_0xd494('0x3f')]);var _0x10997c={'where':_0x3b1c62[_0xd494('0x3a')]};return db[_0xd494('0x2b')]['count'](_0x10997c)['then'](function(_0x87076c){_0x437519['count']=_0x87076c;if(_0x535d44[_0xd494('0x31')][_0xd494('0x40')]){_0x3b1c62['include']=[{'all':!![]}];}return db[_0xd494('0x2b')][_0xd494('0x41')](_0x3b1c62);})[_0xd494('0x26')](function(_0x2e075c){_0x437519['rows']=_0x2e075c;return _0x437519;})['then'](respondWithFilteredResult(_0x5c6495,_0x3b1c62))[_0xd494('0x42')](handleError(_0x5c6495,null));};exports['show']=function(_0x421684,_0xbfd24){var _0x2fb1f6={'raw':![],'where':{'id':_0x421684[_0xd494('0x43')]['id']}},_0x5ac290={};_0x5ac290['model']=_[_0xd494('0x30')](db[_0xd494('0x2b')][_0xd494('0x44')]);_0x5ac290['query']=_[_0xd494('0x30')](_0x421684['query']);_0x5ac290[_0xd494('0x3c')]=_[_0xd494('0x32')](_0x5ac290['model'],_0x5ac290[_0xd494('0x31')]);_0x2fb1f6[_0xd494('0x34')]=_[_0xd494('0x32')](_0x5ac290[_0xd494('0x2f')],qs[_0xd494('0x33')](_0x421684[_0xd494('0x31')][_0xd494('0x33')]));_0x2fb1f6[_0xd494('0x34')]=_0x2fb1f6['attributes'][_0xd494('0x35')]?_0x2fb1f6[_0xd494('0x34')]:_0x5ac290[_0xd494('0x2f')];if(_0x421684[_0xd494('0x31')][_0xd494('0x40')]){_0x2fb1f6[_0xd494('0x45')]=[{'all':!![]}];}_0x2fb1f6=_[_0xd494('0x3d')]({},_0x2fb1f6,_0x421684[_0xd494('0x3f')]);return db[_0xd494('0x2b')][_0xd494('0x46')](_0x2fb1f6)[_0xd494('0x26')](handleEntityNotFound(_0xbfd24,null))[_0xd494('0x26')](respondWithResult(_0xbfd24,null))[_0xd494('0x42')](handleError(_0xbfd24,null));};exports['create']=function(_0x4ffe32,_0x13aafb){return db['ZendeskConfiguration']['create'](_0x4ffe32[_0xd494('0x47')],{})[_0xd494('0x26')](respondWithResult(_0x13aafb,0xc9))[_0xd494('0x42')](handleError(_0x13aafb,null));};exports[_0xd494('0x25')]=function(_0x1ff898,_0x18a593){if(_0x1ff898[_0xd494('0x47')]['id']){delete _0x1ff898[_0xd494('0x47')]['id'];}return db[_0xd494('0x2b')][_0xd494('0x46')]({'where':{'id':_0x1ff898[_0xd494('0x43')]['id']}})[_0xd494('0x26')](handleEntityNotFound(_0x18a593,null))['then'](saveUpdates(_0x1ff898[_0xd494('0x47')],null))[_0xd494('0x26')](respondWithResult(_0x18a593,null))[_0xd494('0x42')](handleError(_0x18a593,null));};exports[_0xd494('0x27')]=function(_0x32a66d,_0x2c05c7){return db['ZendeskConfiguration'][_0xd494('0x46')]({'where':{'id':_0x32a66d[_0xd494('0x43')]['id']}})[_0xd494('0x26')](handleEntityNotFound(_0x2c05c7,null))[_0xd494('0x26')](removeEntity(_0x2c05c7,null))[_0xd494('0x42')](handleError(_0x2c05c7,null));};exports[_0xd494('0x48')]=function(_0x281f9f,_0x387750,_0x4f9680){var _0x852d45={};var _0x30de71={};var _0x32c683;var _0x40338d;return db['ZendeskConfiguration'][_0xd494('0x49')]({'where':{'id':_0x281f9f['params']['id']}})[_0xd494('0x26')](handleEntityNotFound(_0x387750,null))[_0xd494('0x26')](function(_0x1efbf6){if(_0x1efbf6){_0x32c683=_0x1efbf6;_0x30de71[_0xd494('0x2f')]=_[_0xd494('0x30')](db[_0xd494('0x4a')][_0xd494('0x44')]);_0x30de71[_0xd494('0x31')]=_[_0xd494('0x30')](_0x281f9f[_0xd494('0x31')]);_0x30de71[_0xd494('0x3c')]=_['intersection'](_0x30de71[_0xd494('0x2f')],_0x30de71[_0xd494('0x31')]);_0x852d45[_0xd494('0x34')]=_['intersection'](_0x30de71[_0xd494('0x2f')],qs[_0xd494('0x33')](_0x281f9f['query'][_0xd494('0x33')]));_0x852d45[_0xd494('0x34')]=_0x852d45[_0xd494('0x34')][_0xd494('0x35')]?_0x852d45[_0xd494('0x34')]:_0x30de71[_0xd494('0x2f')];_0x852d45[_0xd494('0x38')]=qs['sort'](_0x281f9f[_0xd494('0x31')]['sort']);_0x852d45[_0xd494('0x3a')]=qs['filters'](_[_0xd494('0x3b')](_0x281f9f[_0xd494('0x31')],_0x30de71[_0xd494('0x3c')]));if(_0x281f9f['query'][_0xd494('0x4b')]){_0x852d45[_0xd494('0x3a')]=_[_0xd494('0x3d')](_0x852d45[_0xd494('0x3a')],{'$or':_[_0xd494('0x2a')](_0x852d45[_0xd494('0x34')],function(_0x8182cd){var _0x16538f={};_0x16538f[_0x8182cd]={'$like':'%'+_0x281f9f[_0xd494('0x31')][_0xd494('0x4b')]+'%'};return _0x16538f;})});}_0x852d45=_['merge']({},_0x852d45,_0x281f9f['options']);return _0x32c683[_0xd494('0x48')](_0x852d45);}})[_0xd494('0x26')](function(_0x5e3bdd){if(_0x5e3bdd){_0x40338d=_0x5e3bdd[_0xd494('0x35')];if(!_0x281f9f[_0xd494('0x31')][_0xd494('0x36')]('nolimit')){_0x852d45['limit']=qs[_0xd494('0x1f')](_0x281f9f['query'][_0xd494('0x1f')]);_0x852d45['offset']=qs['offset'](_0x281f9f[_0xd494('0x31')][_0xd494('0x37')]);}return _0x32c683[_0xd494('0x48')](_0x852d45);}})[_0xd494('0x26')](function(_0x35c990){if(_0x35c990){return _0x35c990?{'count':_0x40338d,'rows':_0x35c990}:null;}})[_0xd494('0x26')](respondWithResult(_0x387750,null))[_0xd494('0x42')](handleError(_0x387750,null));};exports[_0xd494('0x4c')]=function(_0xcedac9,_0x19e4b9,_0x4c4611){var _0x619cfc={};var _0x1df6ce={};var _0x5738a8;var _0x556f98;return db[_0xd494('0x2b')][_0xd494('0x49')]({'where':{'id':_0xcedac9['params']['id']}})[_0xd494('0x26')](handleEntityNotFound(_0x19e4b9,null))['then'](function(_0x39bd78){if(_0x39bd78){_0x5738a8=_0x39bd78;_0x1df6ce[_0xd494('0x2f')]=_[_0xd494('0x30')](db['ZendeskField'][_0xd494('0x44')]);_0x1df6ce[_0xd494('0x31')]=_[_0xd494('0x30')](_0xcedac9[_0xd494('0x31')]);_0x1df6ce[_0xd494('0x3c')]=_[_0xd494('0x32')](_0x1df6ce[_0xd494('0x2f')],_0x1df6ce[_0xd494('0x31')]);_0x619cfc[_0xd494('0x34')]=_[_0xd494('0x32')](_0x1df6ce[_0xd494('0x2f')],qs[_0xd494('0x33')](_0xcedac9[_0xd494('0x31')][_0xd494('0x33')]));_0x619cfc[_0xd494('0x34')]=_0x619cfc[_0xd494('0x34')][_0xd494('0x35')]?_0x619cfc[_0xd494('0x34')]:_0x1df6ce[_0xd494('0x2f')];_0x619cfc[_0xd494('0x38')]=qs[_0xd494('0x39')](_0xcedac9[_0xd494('0x31')][_0xd494('0x39')]);_0x619cfc[_0xd494('0x3a')]=qs[_0xd494('0x3c')](_['pick'](_0xcedac9[_0xd494('0x31')],_0x1df6ce[_0xd494('0x3c')]));if(_0xcedac9[_0xd494('0x31')][_0xd494('0x4b')]){_0x619cfc[_0xd494('0x3a')]=_[_0xd494('0x3d')](_0x619cfc[_0xd494('0x3a')],{'$or':_['map'](_0x619cfc[_0xd494('0x34')],function(_0x56016e){var _0x4cd6ff={};_0x4cd6ff[_0x56016e]={'$like':'%'+_0xcedac9[_0xd494('0x31')][_0xd494('0x4b')]+'%'};return _0x4cd6ff;})});}_0x619cfc=_[_0xd494('0x3d')]({},_0x619cfc,_0xcedac9['options']);return _0x5738a8[_0xd494('0x4c')](_0x619cfc);}})[_0xd494('0x26')](function(_0x25d653){if(_0x25d653){_0x556f98=_0x25d653['length'];if(!_0xcedac9[_0xd494('0x31')]['hasOwnProperty'](_0xd494('0x4d'))){_0x619cfc[_0xd494('0x1f')]=qs[_0xd494('0x1f')](_0xcedac9[_0xd494('0x31')][_0xd494('0x1f')]);_0x619cfc[_0xd494('0x37')]=qs[_0xd494('0x37')](_0xcedac9[_0xd494('0x31')][_0xd494('0x37')]);}return _0x5738a8['getSubjects'](_0x619cfc);}})[_0xd494('0x26')](function(_0x2659a0){if(_0x2659a0){return _0x2659a0?{'count':_0x556f98,'rows':_0x2659a0}:null;}})[_0xd494('0x26')](respondWithResult(_0x19e4b9,null))[_0xd494('0x42')](handleError(_0x19e4b9,null));};exports[_0xd494('0x4e')]=function(_0x4a1b0a,_0x5540d3,_0x2bebff){var _0x463c1a={};var _0x16fe10={};var _0x29d808;var _0x2e5987;return db[_0xd494('0x2b')][_0xd494('0x49')]({'where':{'id':_0x4a1b0a[_0xd494('0x43')]['id']}})[_0xd494('0x26')](handleEntityNotFound(_0x5540d3,null))[_0xd494('0x26')](function(_0xdd2d51){if(_0xdd2d51){_0x29d808=_0xdd2d51;_0x16fe10[_0xd494('0x2f')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x16fe10[_0xd494('0x31')]=_[_0xd494('0x30')](_0x4a1b0a[_0xd494('0x31')]);_0x16fe10[_0xd494('0x3c')]=_[_0xd494('0x32')](_0x16fe10[_0xd494('0x2f')],_0x16fe10[_0xd494('0x31')]);_0x463c1a[_0xd494('0x34')]=_[_0xd494('0x32')](_0x16fe10[_0xd494('0x2f')],qs[_0xd494('0x33')](_0x4a1b0a[_0xd494('0x31')]['fields']));_0x463c1a[_0xd494('0x34')]=_0x463c1a['attributes'][_0xd494('0x35')]?_0x463c1a['attributes']:_0x16fe10[_0xd494('0x2f')];_0x463c1a['order']=qs[_0xd494('0x39')](_0x4a1b0a[_0xd494('0x31')][_0xd494('0x39')]);_0x463c1a['where']=qs[_0xd494('0x3c')](_[_0xd494('0x3b')](_0x4a1b0a[_0xd494('0x31')],_0x16fe10[_0xd494('0x3c')]));if(_0x4a1b0a[_0xd494('0x31')][_0xd494('0x4b')]){_0x463c1a['where']=_[_0xd494('0x3d')](_0x463c1a[_0xd494('0x3a')],{'$or':_[_0xd494('0x2a')](_0x463c1a[_0xd494('0x34')],function(_0xea9473){var _0xa934e0={};_0xa934e0[_0xea9473]={'$like':'%'+_0x4a1b0a[_0xd494('0x31')][_0xd494('0x4b')]+'%'};return _0xa934e0;})});}_0x463c1a=_[_0xd494('0x3d')]({},_0x463c1a,_0x4a1b0a['options']);return _0x29d808[_0xd494('0x4e')](_0x463c1a);}})[_0xd494('0x26')](function(_0x4fcb17){if(_0x4fcb17){_0x2e5987=_0x4fcb17[_0xd494('0x35')];if(!_0x4a1b0a['query'][_0xd494('0x36')](_0xd494('0x4d'))){_0x463c1a['limit']=qs[_0xd494('0x1f')](_0x4a1b0a['query'][_0xd494('0x1f')]);_0x463c1a[_0xd494('0x37')]=qs[_0xd494('0x37')](_0x4a1b0a[_0xd494('0x31')][_0xd494('0x37')]);}return _0x29d808[_0xd494('0x4e')](_0x463c1a);}})[_0xd494('0x26')](function(_0x28069b){if(_0x28069b){return _0x28069b?{'count':_0x2e5987,'rows':_0x28069b}:null;}})[_0xd494('0x26')](respondWithResult(_0x5540d3,null))[_0xd494('0x42')](handleError(_0x5540d3,null));};exports[_0xd494('0x4f')]=function(_0x273499,_0x28b119,_0x4f7a14){var _0x2a1e10={};var _0x9f625={};var _0x32e387;var _0x18704f;return db[_0xd494('0x2b')][_0xd494('0x49')]({'where':{'id':_0x273499[_0xd494('0x43')]['id']}})[_0xd494('0x26')](handleEntityNotFound(_0x28b119,null))[_0xd494('0x26')](function(_0x591cd8){if(_0x591cd8){_0x32e387=_0x591cd8;_0x9f625[_0xd494('0x2f')]=_[_0xd494('0x30')](db[_0xd494('0x50')]['rawAttributes']);_0x9f625[_0xd494('0x31')]=_[_0xd494('0x30')](_0x273499[_0xd494('0x31')]);_0x9f625[_0xd494('0x3c')]=_[_0xd494('0x32')](_0x9f625[_0xd494('0x2f')],_0x9f625[_0xd494('0x31')]);_0x2a1e10['attributes']=_['intersection'](_0x9f625[_0xd494('0x2f')],qs[_0xd494('0x33')](_0x273499['query'][_0xd494('0x33')]));_0x2a1e10[_0xd494('0x34')]=_0x2a1e10['attributes'][_0xd494('0x35')]?_0x2a1e10['attributes']:_0x9f625[_0xd494('0x2f')];_0x2a1e10['order']=qs[_0xd494('0x39')](_0x273499[_0xd494('0x31')]['sort']);_0x2a1e10[_0xd494('0x3a')]=qs[_0xd494('0x3c')](_['pick'](_0x273499[_0xd494('0x31')],_0x9f625['filters']));if(_0x273499[_0xd494('0x31')][_0xd494('0x4b')]){_0x2a1e10[_0xd494('0x3a')]=_[_0xd494('0x3d')](_0x2a1e10['where'],{'$or':_[_0xd494('0x2a')](_0x2a1e10[_0xd494('0x34')],function(_0x462bcd){var _0x599803={};_0x599803[_0x462bcd]={'$like':'%'+_0x273499[_0xd494('0x31')][_0xd494('0x4b')]+'%'};return _0x599803;})});}_0x2a1e10=_[_0xd494('0x3d')]({},_0x2a1e10,_0x273499[_0xd494('0x3f')]);return _0x32e387['getTags'](_0x2a1e10);}})['then'](function(_0x4128c3){if(_0x4128c3){_0x18704f=_0x4128c3[_0xd494('0x35')];if(!_0x273499[_0xd494('0x31')][_0xd494('0x36')](_0xd494('0x4d'))){_0x2a1e10[_0xd494('0x1f')]=qs[_0xd494('0x1f')](_0x273499['query'][_0xd494('0x1f')]);_0x2a1e10[_0xd494('0x37')]=qs[_0xd494('0x37')](_0x273499[_0xd494('0x31')][_0xd494('0x37')]);}return _0x32e387[_0xd494('0x4f')](_0x2a1e10);}})['then'](function(_0x263639){if(_0x263639){return _0x263639?{'count':_0x18704f,'rows':_0x263639}:null;}})[_0xd494('0x26')](respondWithResult(_0x28b119,null))[_0xd494('0x42')](handleError(_0x28b119,null));};exports[_0xd494('0x51')]=function(_0x1d5b2b,_0x86d9bc,_0x1c59b8){if(_0x1d5b2b[_0xd494('0x47')]['id']){delete _0x1d5b2b[_0xd494('0x47')]['id'];}return db[_0xd494('0x2b')][_0xd494('0x49')]({'where':{'id':_0x1d5b2b[_0xd494('0x43')]['id']}})[_0xd494('0x26')](handleEntityNotFound(_0x86d9bc,null))[_0xd494('0x26')](function(_0x5bffd7){if(_0x5bffd7){return _0x5bffd7[_0xd494('0x51')](_0x1d5b2b['body'][_0xd494('0x52')]||[]);}return null;})[_0xd494('0x26')](respondWithResult(_0x86d9bc,null))[_0xd494('0x42')](handleError(_0x86d9bc,null));};
\ No newline at end of file
+var _0x706a=['jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','key','name','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','options','ZendeskConfiguration','includeAll','findAll','rows','catch','params','find','create','body','update','findOne','sort','filter','getFields','length','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x166d02,_0x44d70b){var _0x21d635=function(_0x22bdec){while(--_0x22bdec){_0x166d02['push'](_0x166d02['shift']());}};_0x21d635(++_0x44d70b);}(_0x706a,0x9d));var _0xa706=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x706a[_0x30b0d8];return _0x459c09;};'use strict';var emlformat=require(_0xa706('0x0'));var rimraf=require(_0xa706('0x1'));var zipdir=require(_0xa706('0x2'));var jsonpatch=require(_0xa706('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa706('0x4'));var csv=require(_0xa706('0x5'));var ejs=require(_0xa706('0x6'));var fs=require('fs');var fs_extra=require(_0xa706('0x7'));var _=require(_0xa706('0x8'));var squel=require(_0xa706('0x9'));var crypto=require(_0xa706('0xa'));var jsforce=require(_0xa706('0xb'));var deskjs=require(_0xa706('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa706('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa706('0xe'));var qs=require(_0xa706('0xf'));var as=require(_0xa706('0x10'));var hardwareService=require(_0xa706('0x11'));var logger=require(_0xa706('0x12'))(_0xa706('0x13'));var utils=require(_0xa706('0x14'));var config=require(_0xa706('0x15'));var licenseUtil=require(_0xa706('0x16'));var db=require(_0xa706('0x17'))['db'];function respondWithStatusCode(_0x31030e,_0x160924){_0x160924=_0x160924||0xcc;return function(_0x243cfc){if(_0x243cfc){return _0x31030e['sendStatus'](_0x160924);}return _0x31030e[_0xa706('0x18')](_0x160924)[_0xa706('0x19')]();};}function respondWithResult(_0x8b1f8d,_0x241e15){_0x241e15=_0x241e15||0xc8;return function(_0x380181){if(_0x380181){return _0x8b1f8d[_0xa706('0x18')](_0x241e15)[_0xa706('0x1a')](_0x380181);}};}function respondWithFilteredResult(_0xa306ac,_0x3b5527){return function(_0x3178c1){if(_0x3178c1){var _0x39944c=typeof _0x3b5527[_0xa706('0x1b')]===_0xa706('0x1c')&&typeof _0x3b5527[_0xa706('0x1d')]===_0xa706('0x1c');var _0x3a3bf4=_0x3178c1[_0xa706('0x1e')];var _0x2ecbbc=_0x39944c?0x0:_0x3b5527[_0xa706('0x1b')];var _0x191846=_0x39944c?_0x3178c1[_0xa706('0x1e')]:_0x3b5527[_0xa706('0x1b')]+_0x3b5527[_0xa706('0x1d')];var _0x36c738;if(_0x191846>=_0x3a3bf4){_0x191846=_0x3a3bf4;_0x36c738=0xc8;}else{_0x36c738=0xce;}_0xa306ac[_0xa706('0x18')](_0x36c738);return _0xa306ac[_0xa706('0x1f')](_0xa706('0x20'),_0x2ecbbc+'-'+_0x191846+'/'+_0x3a3bf4)[_0xa706('0x1a')](_0x3178c1);}return null;};}function patchUpdates(_0x127d44){return function(_0xed8051){try{jsonpatch[_0xa706('0x21')](_0xed8051,_0x127d44,!![]);}catch(_0x32d8bb){return BPromise[_0xa706('0x22')](_0x32d8bb);}return _0xed8051['save']();};}function saveUpdates(_0xce50b4,_0x57e37d){return function(_0x341040){if(_0x341040){return _0x341040['update'](_0xce50b4)[_0xa706('0x23')](function(_0x4f3b82){return _0x4f3b82;});}return null;};}function removeEntity(_0x476c58,_0x1ba169){return function(_0x4f062e){if(_0x4f062e){return _0x4f062e[_0xa706('0x24')]()[_0xa706('0x23')](function(){_0x476c58[_0xa706('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdd6,_0x365a7b){return function(_0x515eb1){if(!_0x515eb1){_0x18bdd6[_0xa706('0x25')](0x194);}return _0x515eb1;};}function handleError(_0xa3b08d,_0x3c4d68){_0x3c4d68=_0x3c4d68||0x1f4;return function(_0x412f81){logger[_0xa706('0x26')](_0x412f81[_0xa706('0x27')]);if(_0x412f81['name']){delete _0x412f81['name'];}_0xa3b08d['status'](_0x3c4d68)[_0xa706('0x28')](_0x412f81);};}exports[_0xa706('0x29')]=function(_0x2ab81c,_0x4c1280){var _0x3eda26={},_0x5094eb={},_0x5cac22={'count':0x0,'rows':[]};var _0x1e636c=_[_0xa706('0x2a')](db['ZendeskConfiguration'][_0xa706('0x2b')],function(_0x425def){return{'name':_0x425def[_0xa706('0x2c')],'type':_0x425def['type'][_0xa706('0x2d')]};});_0x5094eb['model']=_[_0xa706('0x2a')](_0x1e636c,_0xa706('0x2e'));_0x5094eb[_0xa706('0x2f')]=_[_0xa706('0x30')](_0x2ab81c[_0xa706('0x2f')]);_0x5094eb[_0xa706('0x31')]=_['intersection'](_0x5094eb['model'],_0x5094eb[_0xa706('0x2f')]);_0x3eda26[_0xa706('0x32')]=_[_0xa706('0x33')](_0x5094eb['model'],qs[_0xa706('0x34')](_0x2ab81c['query'][_0xa706('0x34')]));_0x3eda26[_0xa706('0x32')]=_0x3eda26['attributes']['length']?_0x3eda26['attributes']:_0x5094eb[_0xa706('0x35')];if(!_0x2ab81c[_0xa706('0x2f')][_0xa706('0x36')](_0xa706('0x37'))){_0x3eda26['limit']=qs[_0xa706('0x1d')](_0x2ab81c[_0xa706('0x2f')][_0xa706('0x1d')]);_0x3eda26[_0xa706('0x1b')]=qs[_0xa706('0x1b')](_0x2ab81c[_0xa706('0x2f')][_0xa706('0x1b')]);}_0x3eda26[_0xa706('0x38')]=qs['sort'](_0x2ab81c[_0xa706('0x2f')]['sort']);_0x3eda26[_0xa706('0x39')]=qs[_0xa706('0x31')](_[_0xa706('0x3a')](_0x2ab81c['query'],_0x5094eb[_0xa706('0x31')]),_0x1e636c);if(_0x2ab81c[_0xa706('0x2f')]['filter']){_0x3eda26[_0xa706('0x39')]=_[_0xa706('0x3b')](_0x3eda26[_0xa706('0x39')],{'$or':_[_0xa706('0x2a')](_0x1e636c,function(_0x3fb1c5){if(_0x3fb1c5[_0xa706('0x3c')]!==_0xa706('0x3d')){var _0x72af16={};_0x72af16[_0x3fb1c5['name']]={'$like':'%'+_0x2ab81c[_0xa706('0x2f')]['filter']+'%'};return _0x72af16;}})});}_0x3eda26=_[_0xa706('0x3b')]({},_0x3eda26,_0x2ab81c[_0xa706('0x3e')]);var _0xb92242={'where':_0x3eda26[_0xa706('0x39')]};return db[_0xa706('0x3f')][_0xa706('0x1e')](_0xb92242)['then'](function(_0x331716){_0x5cac22[_0xa706('0x1e')]=_0x331716;if(_0x2ab81c['query'][_0xa706('0x40')]){_0x3eda26['include']=[{'all':!![]}];}return db[_0xa706('0x3f')][_0xa706('0x41')](_0x3eda26);})[_0xa706('0x23')](function(_0x49955b){_0x5cac22[_0xa706('0x42')]=_0x49955b;return _0x5cac22;})['then'](respondWithFilteredResult(_0x4c1280,_0x3eda26))[_0xa706('0x43')](handleError(_0x4c1280,null));};exports['show']=function(_0x5da8a5,_0xb5f179){var _0xcc4421={'raw':![],'where':{'id':_0x5da8a5[_0xa706('0x44')]['id']}},_0x158efe={};_0x158efe[_0xa706('0x35')]=_[_0xa706('0x30')](db[_0xa706('0x3f')]['rawAttributes']);_0x158efe[_0xa706('0x2f')]=_[_0xa706('0x30')](_0x5da8a5['query']);_0x158efe['filters']=_[_0xa706('0x33')](_0x158efe[_0xa706('0x35')],_0x158efe[_0xa706('0x2f')]);_0xcc4421[_0xa706('0x32')]=_[_0xa706('0x33')](_0x158efe[_0xa706('0x35')],qs['fields'](_0x5da8a5['query'][_0xa706('0x34')]));_0xcc4421[_0xa706('0x32')]=_0xcc4421[_0xa706('0x32')]['length']?_0xcc4421[_0xa706('0x32')]:_0x158efe[_0xa706('0x35')];if(_0x5da8a5[_0xa706('0x2f')][_0xa706('0x40')]){_0xcc4421['include']=[{'all':!![]}];}_0xcc4421=_[_0xa706('0x3b')]({},_0xcc4421,_0x5da8a5[_0xa706('0x3e')]);return db[_0xa706('0x3f')][_0xa706('0x45')](_0xcc4421)[_0xa706('0x23')](handleEntityNotFound(_0xb5f179,null))[_0xa706('0x23')](respondWithResult(_0xb5f179,null))[_0xa706('0x43')](handleError(_0xb5f179,null));};exports[_0xa706('0x46')]=function(_0xd1181d,_0x58a198){return db[_0xa706('0x3f')][_0xa706('0x46')](_0xd1181d[_0xa706('0x47')],{})[_0xa706('0x23')](respondWithResult(_0x58a198,0xc9))['catch'](handleError(_0x58a198,null));};exports[_0xa706('0x48')]=function(_0x5e3b27,_0xe2d10a){if(_0x5e3b27[_0xa706('0x47')]['id']){delete _0x5e3b27[_0xa706('0x47')]['id'];}return db[_0xa706('0x3f')][_0xa706('0x45')]({'where':{'id':_0x5e3b27[_0xa706('0x44')]['id']}})[_0xa706('0x23')](handleEntityNotFound(_0xe2d10a,null))[_0xa706('0x23')](saveUpdates(_0x5e3b27[_0xa706('0x47')],null))[_0xa706('0x23')](respondWithResult(_0xe2d10a,null))[_0xa706('0x43')](handleError(_0xe2d10a,null));};exports[_0xa706('0x24')]=function(_0x14d551,_0x130e3d){return db['ZendeskConfiguration'][_0xa706('0x45')]({'where':{'id':_0x14d551[_0xa706('0x44')]['id']}})[_0xa706('0x23')](handleEntityNotFound(_0x130e3d,null))[_0xa706('0x23')](removeEntity(_0x130e3d,null))[_0xa706('0x43')](handleError(_0x130e3d,null));};exports['getFields']=function(_0x227f45,_0x4017d4,_0x1aaf9a){var _0x58b1ee={};var _0x443bbd={};var _0x5a9432;var _0x6cb4d4;return db[_0xa706('0x3f')][_0xa706('0x49')]({'where':{'id':_0x227f45[_0xa706('0x44')]['id']}})[_0xa706('0x23')](handleEntityNotFound(_0x4017d4,null))['then'](function(_0x634e16){if(_0x634e16){_0x5a9432=_0x634e16;_0x443bbd[_0xa706('0x35')]=_[_0xa706('0x30')](db['ZendeskField'][_0xa706('0x2b')]);_0x443bbd['query']=_['keys'](_0x227f45[_0xa706('0x2f')]);_0x443bbd[_0xa706('0x31')]=_[_0xa706('0x33')](_0x443bbd[_0xa706('0x35')],_0x443bbd[_0xa706('0x2f')]);_0x58b1ee[_0xa706('0x32')]=_[_0xa706('0x33')](_0x443bbd[_0xa706('0x35')],qs[_0xa706('0x34')](_0x227f45[_0xa706('0x2f')][_0xa706('0x34')]));_0x58b1ee[_0xa706('0x32')]=_0x58b1ee['attributes']['length']?_0x58b1ee[_0xa706('0x32')]:_0x443bbd[_0xa706('0x35')];_0x58b1ee[_0xa706('0x38')]=qs[_0xa706('0x4a')](_0x227f45[_0xa706('0x2f')][_0xa706('0x4a')]);_0x58b1ee[_0xa706('0x39')]=qs[_0xa706('0x31')](_[_0xa706('0x3a')](_0x227f45[_0xa706('0x2f')],_0x443bbd['filters']));if(_0x227f45['query'][_0xa706('0x4b')]){_0x58b1ee[_0xa706('0x39')]=_[_0xa706('0x3b')](_0x58b1ee['where'],{'$or':_[_0xa706('0x2a')](_0x58b1ee[_0xa706('0x32')],function(_0x540429){var _0xe9c49f={};_0xe9c49f[_0x540429]={'$like':'%'+_0x227f45['query'][_0xa706('0x4b')]+'%'};return _0xe9c49f;})});}_0x58b1ee=_['merge']({},_0x58b1ee,_0x227f45[_0xa706('0x3e')]);return _0x5a9432[_0xa706('0x4c')](_0x58b1ee);}})['then'](function(_0x4bd7ac){if(_0x4bd7ac){_0x6cb4d4=_0x4bd7ac[_0xa706('0x4d')];if(!_0x227f45[_0xa706('0x2f')]['hasOwnProperty'](_0xa706('0x37'))){_0x58b1ee[_0xa706('0x1d')]=qs['limit'](_0x227f45['query'][_0xa706('0x1d')]);_0x58b1ee['offset']=qs[_0xa706('0x1b')](_0x227f45[_0xa706('0x2f')]['offset']);}return _0x5a9432[_0xa706('0x4c')](_0x58b1ee);}})[_0xa706('0x23')](function(_0x1c220c){if(_0x1c220c){return _0x1c220c?{'count':_0x6cb4d4,'rows':_0x1c220c}:null;}})[_0xa706('0x23')](respondWithResult(_0x4017d4,null))[_0xa706('0x43')](handleError(_0x4017d4,null));};exports[_0xa706('0x4e')]=function(_0x1f0c7e,_0x82a034,_0x51d555){var _0x568caf={};var _0xc50481={};var _0x500d8f;var _0x123083;return db[_0xa706('0x3f')][_0xa706('0x49')]({'where':{'id':_0x1f0c7e['params']['id']}})['then'](handleEntityNotFound(_0x82a034,null))[_0xa706('0x23')](function(_0x5bcc52){if(_0x5bcc52){_0x500d8f=_0x5bcc52;_0xc50481[_0xa706('0x35')]=_[_0xa706('0x30')](db[_0xa706('0x4f')][_0xa706('0x2b')]);_0xc50481[_0xa706('0x2f')]=_['keys'](_0x1f0c7e[_0xa706('0x2f')]);_0xc50481['filters']=_[_0xa706('0x33')](_0xc50481[_0xa706('0x35')],_0xc50481['query']);_0x568caf['attributes']=_[_0xa706('0x33')](_0xc50481[_0xa706('0x35')],qs[_0xa706('0x34')](_0x1f0c7e['query'][_0xa706('0x34')]));_0x568caf[_0xa706('0x32')]=_0x568caf['attributes'][_0xa706('0x4d')]?_0x568caf['attributes']:_0xc50481[_0xa706('0x35')];_0x568caf['order']=qs[_0xa706('0x4a')](_0x1f0c7e[_0xa706('0x2f')][_0xa706('0x4a')]);_0x568caf[_0xa706('0x39')]=qs[_0xa706('0x31')](_['pick'](_0x1f0c7e[_0xa706('0x2f')],_0xc50481['filters']));if(_0x1f0c7e['query'][_0xa706('0x4b')]){_0x568caf['where']=_[_0xa706('0x3b')](_0x568caf[_0xa706('0x39')],{'$or':_[_0xa706('0x2a')](_0x568caf[_0xa706('0x32')],function(_0x3edae9){var _0x3a4339={};_0x3a4339[_0x3edae9]={'$like':'%'+_0x1f0c7e[_0xa706('0x2f')][_0xa706('0x4b')]+'%'};return _0x3a4339;})});}_0x568caf=_[_0xa706('0x3b')]({},_0x568caf,_0x1f0c7e[_0xa706('0x3e')]);return _0x500d8f[_0xa706('0x4e')](_0x568caf);}})[_0xa706('0x23')](function(_0x521f5b){if(_0x521f5b){_0x123083=_0x521f5b[_0xa706('0x4d')];if(!_0x1f0c7e[_0xa706('0x2f')][_0xa706('0x36')](_0xa706('0x37'))){_0x568caf[_0xa706('0x1d')]=qs[_0xa706('0x1d')](_0x1f0c7e[_0xa706('0x2f')]['limit']);_0x568caf[_0xa706('0x1b')]=qs[_0xa706('0x1b')](_0x1f0c7e['query'][_0xa706('0x1b')]);}return _0x500d8f[_0xa706('0x4e')](_0x568caf);}})['then'](function(_0x3f4fb5){if(_0x3f4fb5){return _0x3f4fb5?{'count':_0x123083,'rows':_0x3f4fb5}:null;}})[_0xa706('0x23')](respondWithResult(_0x82a034,null))[_0xa706('0x43')](handleError(_0x82a034,null));};exports[_0xa706('0x50')]=function(_0x570afd,_0xe0c8f3,_0x5f42dd){var _0x10a3d8={};var _0x59800a={};var _0xd0a2b6;var _0x3f79d5;return db[_0xa706('0x3f')][_0xa706('0x49')]({'where':{'id':_0x570afd['params']['id']}})['then'](handleEntityNotFound(_0xe0c8f3,null))[_0xa706('0x23')](function(_0x22d4b8){if(_0x22d4b8){_0xd0a2b6=_0x22d4b8;_0x59800a[_0xa706('0x35')]=_['keys'](db[_0xa706('0x4f')][_0xa706('0x2b')]);_0x59800a[_0xa706('0x2f')]=_[_0xa706('0x30')](_0x570afd['query']);_0x59800a[_0xa706('0x31')]=_[_0xa706('0x33')](_0x59800a['model'],_0x59800a[_0xa706('0x2f')]);_0x10a3d8[_0xa706('0x32')]=_[_0xa706('0x33')](_0x59800a[_0xa706('0x35')],qs[_0xa706('0x34')](_0x570afd[_0xa706('0x2f')][_0xa706('0x34')]));_0x10a3d8[_0xa706('0x32')]=_0x10a3d8['attributes']['length']?_0x10a3d8[_0xa706('0x32')]:_0x59800a[_0xa706('0x35')];_0x10a3d8['order']=qs[_0xa706('0x4a')](_0x570afd[_0xa706('0x2f')][_0xa706('0x4a')]);_0x10a3d8[_0xa706('0x39')]=qs[_0xa706('0x31')](_[_0xa706('0x3a')](_0x570afd[_0xa706('0x2f')],_0x59800a['filters']));if(_0x570afd[_0xa706('0x2f')][_0xa706('0x4b')]){_0x10a3d8[_0xa706('0x39')]=_[_0xa706('0x3b')](_0x10a3d8[_0xa706('0x39')],{'$or':_['map'](_0x10a3d8['attributes'],function(_0x55b420){var _0xa3f19a={};_0xa3f19a[_0x55b420]={'$like':'%'+_0x570afd['query']['filter']+'%'};return _0xa3f19a;})});}_0x10a3d8=_[_0xa706('0x3b')]({},_0x10a3d8,_0x570afd[_0xa706('0x3e')]);return _0xd0a2b6[_0xa706('0x50')](_0x10a3d8);}})[_0xa706('0x23')](function(_0x4b85c0){if(_0x4b85c0){_0x3f79d5=_0x4b85c0[_0xa706('0x4d')];if(!_0x570afd[_0xa706('0x2f')][_0xa706('0x36')](_0xa706('0x37'))){_0x10a3d8['limit']=qs[_0xa706('0x1d')](_0x570afd[_0xa706('0x2f')][_0xa706('0x1d')]);_0x10a3d8[_0xa706('0x1b')]=qs[_0xa706('0x1b')](_0x570afd[_0xa706('0x2f')][_0xa706('0x1b')]);}return _0xd0a2b6[_0xa706('0x50')](_0x10a3d8);}})[_0xa706('0x23')](function(_0x5df798){if(_0x5df798){return _0x5df798?{'count':_0x3f79d5,'rows':_0x5df798}:null;}})['then'](respondWithResult(_0xe0c8f3,null))['catch'](handleError(_0xe0c8f3,null));};exports[_0xa706('0x51')]=function(_0x54663c,_0x12c6bc,_0x4f87e6){var _0x17cbfa={};var _0x5b0ada={};var _0x40431a;var _0x1d3a77;return db[_0xa706('0x3f')][_0xa706('0x49')]({'where':{'id':_0x54663c['params']['id']}})[_0xa706('0x23')](handleEntityNotFound(_0x12c6bc,null))[_0xa706('0x23')](function(_0x42aaf1){if(_0x42aaf1){_0x40431a=_0x42aaf1;_0x5b0ada[_0xa706('0x35')]=_[_0xa706('0x30')](db[_0xa706('0x52')][_0xa706('0x2b')]);_0x5b0ada['query']=_[_0xa706('0x30')](_0x54663c[_0xa706('0x2f')]);_0x5b0ada['filters']=_[_0xa706('0x33')](_0x5b0ada['model'],_0x5b0ada[_0xa706('0x2f')]);_0x17cbfa[_0xa706('0x32')]=_[_0xa706('0x33')](_0x5b0ada[_0xa706('0x35')],qs['fields'](_0x54663c[_0xa706('0x2f')][_0xa706('0x34')]));_0x17cbfa[_0xa706('0x32')]=_0x17cbfa[_0xa706('0x32')]['length']?_0x17cbfa[_0xa706('0x32')]:_0x5b0ada[_0xa706('0x35')];_0x17cbfa[_0xa706('0x38')]=qs[_0xa706('0x4a')](_0x54663c[_0xa706('0x2f')]['sort']);_0x17cbfa[_0xa706('0x39')]=qs[_0xa706('0x31')](_[_0xa706('0x3a')](_0x54663c['query'],_0x5b0ada[_0xa706('0x31')]));if(_0x54663c[_0xa706('0x2f')][_0xa706('0x4b')]){_0x17cbfa['where']=_[_0xa706('0x3b')](_0x17cbfa[_0xa706('0x39')],{'$or':_[_0xa706('0x2a')](_0x17cbfa[_0xa706('0x32')],function(_0x371046){var _0x5a949e={};_0x5a949e[_0x371046]={'$like':'%'+_0x54663c[_0xa706('0x2f')][_0xa706('0x4b')]+'%'};return _0x5a949e;})});}_0x17cbfa=_['merge']({},_0x17cbfa,_0x54663c[_0xa706('0x3e')]);return _0x40431a[_0xa706('0x51')](_0x17cbfa);}})[_0xa706('0x23')](function(_0x4209e5){if(_0x4209e5){_0x1d3a77=_0x4209e5[_0xa706('0x4d')];if(!_0x54663c[_0xa706('0x2f')][_0xa706('0x36')](_0xa706('0x37'))){_0x17cbfa[_0xa706('0x1d')]=qs['limit'](_0x54663c['query']['limit']);_0x17cbfa['offset']=qs[_0xa706('0x1b')](_0x54663c[_0xa706('0x2f')][_0xa706('0x1b')]);}return _0x40431a[_0xa706('0x51')](_0x17cbfa);}})[_0xa706('0x23')](function(_0x23a9c5){if(_0x23a9c5){return _0x23a9c5?{'count':_0x1d3a77,'rows':_0x23a9c5}:null;}})[_0xa706('0x23')](respondWithResult(_0x12c6bc,null))[_0xa706('0x43')](handleError(_0x12c6bc,null));};exports[_0xa706('0x53')]=function(_0x926409,_0x145145,_0x48ad3e){if(_0x926409['body']['id']){delete _0x926409[_0xa706('0x47')]['id'];}return db[_0xa706('0x3f')][_0xa706('0x49')]({'where':{'id':_0x926409[_0xa706('0x44')]['id']}})[_0xa706('0x23')](handleEntityNotFound(_0x145145,null))['then'](function(_0x12240c){if(_0x12240c){return _0x12240c['setTags'](_0x926409[_0xa706('0x47')]['ids']||[]);}return null;})[_0xa706('0x23')](respondWithResult(_0x145145,null))['catch'](handleError(_0x145145,null));};
\ No newline at end of file
index 3ef1e1b..54a37c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff0=['./intZendeskConfiguration.attributes','define','int_zendesk_configurations','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xfff0,0x139));var _0x0fff=function(_0x337e0e,_0x4f71d8){_0x337e0e=_0x337e0e-0x0;var _0x2f723c=_0xfff0[_0x337e0e];return _0x2f723c;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var logger=require(_0x0fff('0x1'))(_0x0fff('0x2'));var moment=require('moment');var BPromise=require(_0x0fff('0x3'));var rp=require(_0x0fff('0x4'));var fs=require('fs');var path=require(_0x0fff('0x5'));var rimraf=require('rimraf');var config=require(_0x0fff('0x6'));var attributes=require(_0x0fff('0x7'));module['exports']=function(_0x33c813,_0x4c2221){return _0x33c813[_0x0fff('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x0fff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['ZendeskConfiguration','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x5b7aa4,_0x4a2bc7){var _0x58a3b3=function(_0x1d31b2){while(--_0x1d31b2){_0x5b7aa4['push'](_0x5b7aa4['shift']());}};_0x58a3b3(++_0x4a2bc7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eb82e93..742a962 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02e7=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2700cd,_0x30d1ff){var _0x44b852=function(_0x201d38){while(--_0x201d38){_0x2700cd['push'](_0x2700cd['shift']());}};_0x44b852(++_0x30d1ff);}(_0x02e7,0xe8));var _0x702e=function(_0x3526a0,_0x1173d7){_0x3526a0=_0x3526a0-0x0;var _0x3d9860=_0x02e7[_0x3526a0];return _0x3d9860;};'use strict';var _=require(_0x702e('0x0'));var util=require(_0x702e('0x1'));var moment=require('moment');var BPromise=require(_0x702e('0x2'));var rs=require(_0x702e('0x3'));var fs=require('fs');var Redis=require(_0x702e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x702e('0x5'));var logger=require(_0x702e('0x6'))(_0x702e('0x7'));var config=require(_0x702e('0x8'));var jayson=require(_0x702e('0x9'));var client=jayson[_0x702e('0xa')][_0x702e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45a6a5,_0x520c54,_0x75c3d5){return new BPromise(function(_0x22ce66,_0x23e357){return client['request'](_0x45a6a5,_0x75c3d5)[_0x702e('0xc')](function(_0x2825c3){logger[_0x702e('0xd')](_0x702e('0xe'),_0x520c54,_0x702e('0xf'));logger[_0x702e('0x10')](_0x702e('0x11'),_0x520c54,_0x702e('0xf'),JSON[_0x702e('0x12')](_0x2825c3));if(_0x2825c3[_0x702e('0x13')]){if(_0x2825c3[_0x702e('0x13')][_0x702e('0x14')]===0x1f4){logger[_0x702e('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x520c54,_0x2825c3[_0x702e('0x13')][_0x702e('0x15')]);return _0x23e357(_0x2825c3[_0x702e('0x13')][_0x702e('0x15')]);}logger['error'](_0x702e('0xe'),_0x520c54,_0x2825c3[_0x702e('0x13')][_0x702e('0x15')]);return _0x22ce66(_0x2825c3['error'][_0x702e('0x15')]);}else{logger[_0x702e('0xd')](_0x702e('0xe'),_0x520c54,_0x702e('0xf'));_0x22ce66(_0x2825c3['result'][_0x702e('0x15')]);}})[_0x702e('0x16')](function(_0x1e8c6a){logger[_0x702e('0x13')](_0x702e('0xe'),_0x520c54,_0x1e8c6a);_0x23e357(_0x1e8c6a);});});}
\ No newline at end of file
+var _0x6afa=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0xfb813,_0x1634cb){var _0x1266eb=function(_0xb3bf9e){while(--_0xb3bf9e){_0xfb813['push'](_0xfb813['shift']());}};_0x1266eb(++_0x1634cb);}(_0x6afa,0x76));var _0xa6af=function(_0x54a3bb,_0x4c0c34){_0x54a3bb=_0x54a3bb-0x0;var _0x1e8288=_0x6afa[_0x54a3bb];return _0x1e8288;};'use strict';var _=require(_0xa6af('0x0'));var util=require(_0xa6af('0x1'));var moment=require(_0xa6af('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6af('0x4'))['db'];var utils=require(_0xa6af('0x5'));var logger=require(_0xa6af('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa6af('0x7'));var client=jayson[_0xa6af('0x8')][_0xa6af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52bc93,_0xc2c260,_0x359381){return new BPromise(function(_0xac091e,_0x21be67){return client[_0xa6af('0xa')](_0x52bc93,_0x359381)[_0xa6af('0xb')](function(_0xbdd92c){logger[_0xa6af('0xc')](_0xa6af('0xd'),_0xc2c260,_0xa6af('0xe'));logger[_0xa6af('0xf')](_0xa6af('0x10'),_0xc2c260,_0xa6af('0xe'),JSON['stringify'](_0xbdd92c));if(_0xbdd92c[_0xa6af('0x11')]){if(_0xbdd92c['error'][_0xa6af('0x12')]===0x1f4){logger[_0xa6af('0x11')](_0xa6af('0xd'),_0xc2c260,_0xbdd92c[_0xa6af('0x11')]['message']);return _0x21be67(_0xbdd92c[_0xa6af('0x11')]['message']);}logger['error'](_0xa6af('0xd'),_0xc2c260,_0xbdd92c[_0xa6af('0x11')][_0xa6af('0x13')]);return _0xac091e(_0xbdd92c[_0xa6af('0x11')]['message']);}else{logger[_0xa6af('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0xc2c260,_0xa6af('0xe'));_0xac091e(_0xbdd92c[_0xa6af('0x14')]['message']);}})[_0xa6af('0x15')](function(_0xfdb97b){logger[_0xa6af('0x11')](_0xa6af('0xd'),_0xc2c260,_0xfdb97b);_0x21be67(_0xfdb97b);});});}
\ No newline at end of file
index 5a466c0..2640e09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaef9=['put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2923d0,_0x3956b0){var _0x21d645=function(_0xb59716){while(--_0xb59716){_0x2923d0['push'](_0x2923d0['shift']());}};_0x21d645(++_0x3956b0);}(_0xaef9,0xff));var _0x9aef=function(_0x2a0aab,_0x49b7ae){_0x2a0aab=_0x2a0aab-0x0;var _0x368320=_0xaef9[_0x2a0aab];return _0x368320;};'use strict';var multer=require(_0x9aef('0x0'));var util=require(_0x9aef('0x1'));var path=require(_0x9aef('0x2'));var timeout=require('connect-timeout');var express=require(_0x9aef('0x3'));var router=express[_0x9aef('0x4')]();var fs_extra=require(_0x9aef('0x5'));var auth=require(_0x9aef('0x6'));var interaction=require(_0x9aef('0x7'));var config=require('../../config/environment');var controller=require(_0x9aef('0x8'));router[_0x9aef('0x9')]('/',auth[_0x9aef('0xa')](),controller[_0x9aef('0xb')]);router[_0x9aef('0x9')](_0x9aef('0xc'),auth[_0x9aef('0xa')](),controller[_0x9aef('0xd')]);router[_0x9aef('0xe')]('/',auth[_0x9aef('0xa')](),controller['create']);router[_0x9aef('0xf')](_0x9aef('0xc'),auth[_0x9aef('0xa')](),controller[_0x9aef('0x10')]);router['delete'](_0x9aef('0xc'),auth[_0x9aef('0xa')](),controller[_0x9aef('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x5e53=['Router','fs-extra','./intZendeskField.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x2ff022,_0x183a9c){var _0x1cbaa5=function(_0x342bd9){while(--_0x342bd9){_0x2ff022['push'](_0x2ff022['shift']());}};_0x1cbaa5(++_0x183a9c);}(_0x5e53,0x199));var _0x35e5=function(_0x323677,_0x2e7962){_0x323677=_0x323677-0x0;var _0x2566c7=_0x5e53[_0x323677];return _0x2566c7;};'use strict';var multer=require(_0x35e5('0x0'));var util=require(_0x35e5('0x1'));var path=require(_0x35e5('0x2'));var timeout=require(_0x35e5('0x3'));var express=require(_0x35e5('0x4'));var router=express[_0x35e5('0x5')]();var fs_extra=require(_0x35e5('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x35e5('0x7'));router[_0x35e5('0x8')]('/',auth[_0x35e5('0x9')](),controller[_0x35e5('0xa')]);router[_0x35e5('0x8')]('/:id',auth[_0x35e5('0x9')](),controller['show']);router[_0x35e5('0xb')]('/',auth[_0x35e5('0x9')](),controller[_0x35e5('0xc')]);router[_0x35e5('0xd')](_0x35e5('0xe'),auth['isAuthenticated'](),controller[_0x35e5('0xf')]);router[_0x35e5('0x10')](_0x35e5('0xe'),auth[_0x35e5('0x9')](),controller['destroy']);module[_0x35e5('0x11')]=router;
\ No newline at end of file
index f518bcc..5e86570 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fdf=['variable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x2a167c,_0x4d05c0){var _0x4c5b63=function(_0x3a68b5){while(--_0x3a68b5){_0x2a167c['push'](_0x2a167c['shift']());}};_0x4c5b63(++_0x4d05c0);}(_0x6fdf,0x1c7));var _0xf6fd=function(_0x5b3b3c,_0x28c075){_0x5b3b3c=_0x5b3b3c-0x0;var _0x3d5702=_0x6fdf[_0x5b3b3c];return _0x3d5702;};'use strict';var Sequelize=require(_0xf6fd('0x0'));module[_0xf6fd('0x1')]={'type':{'type':Sequelize[_0xf6fd('0x2')](_0xf6fd('0x3'),_0xf6fd('0x4'),'customVariable',_0xf6fd('0x5'),_0xf6fd('0x6')),'defaultValue':_0xf6fd('0x3')},'content':{'type':Sequelize[_0xf6fd('0x7')]},'key':{'type':Sequelize[_0xf6fd('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xf6fd('0x3'),_0xf6fd('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xf6fd('0x7')]},'idField':{'type':Sequelize[_0xf6fd('0x7')]},'nameField':{'type':Sequelize[_0xf6fd('0x7')]},'customField':{'type':Sequelize[_0xf6fd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf6fd('0x7')]}};
\ No newline at end of file
+var _0xb5a5=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x4af108,_0x3c29d5){var _0x2e7ea1=function(_0x4ddd10){while(--_0x4ddd10){_0x4af108['push'](_0x4af108['shift']());}};_0x2e7ea1(++_0x3c29d5);}(_0xb5a5,0x125));var _0x5b5a=function(_0x54aef5,_0x55600f){_0x54aef5=_0x54aef5-0x0;var _0x50cf31=_0xb5a5[_0x54aef5];return _0x50cf31;};'use strict';var Sequelize=require('sequelize');module[_0x5b5a('0x0')]={'type':{'type':Sequelize[_0x5b5a('0x1')](_0x5b5a('0x2'),_0x5b5a('0x3'),_0x5b5a('0x4'),_0x5b5a('0x5'),_0x5b5a('0x6')),'defaultValue':_0x5b5a('0x2')},'content':{'type':Sequelize[_0x5b5a('0x7')]},'key':{'type':Sequelize[_0x5b5a('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x5b5a('0x3'),_0x5b5a('0x4'))},'keyContent':{'type':Sequelize[_0x5b5a('0x7')]},'idField':{'type':Sequelize[_0x5b5a('0x7')]},'nameField':{'type':Sequelize[_0x5b5a('0x7')]},'customField':{'type':Sequelize[_0x5b5a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 909f2d6..d29a480 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe773=['apply','reject','save','update','then','error','stack','name','ZendeskField','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x30b4d8,_0x5ec997){var _0x3b94c9=function(_0x3d7cfb){while(--_0x3d7cfb){_0x30b4d8['push'](_0x30b4d8['shift']());}};_0x3b94c9(++_0x5ec997);}(_0xe773,0x19a));var _0x3e77=function(_0x44f45a,_0x25305e){_0x44f45a=_0x44f45a-0x0;var _0x22814d=_0xe773[_0x44f45a];return _0x22814d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e77('0x0'));var zipdir=require(_0x3e77('0x1'));var jsonpatch=require(_0x3e77('0x2'));var rp=require('request-promise');var moment=require(_0x3e77('0x3'));var BPromise=require(_0x3e77('0x4'));var Mustache=require(_0x3e77('0x5'));var util=require(_0x3e77('0x6'));var path=require(_0x3e77('0x7'));var sox=require('sox');var csv=require(_0x3e77('0x8'));var ejs=require(_0x3e77('0x9'));var fs=require('fs');var fs_extra=require(_0x3e77('0xa'));var _=require(_0x3e77('0xb'));var squel=require(_0x3e77('0xc'));var crypto=require(_0x3e77('0xd'));var jsforce=require(_0x3e77('0xe'));var deskjs=require(_0x3e77('0xf'));var toCsv=require(_0x3e77('0x8'));var querystring=require(_0x3e77('0x10'));var Papa=require(_0x3e77('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e77('0x12'));var as=require(_0x3e77('0x13'));var hardwareService=require(_0x3e77('0x14'));var logger=require(_0x3e77('0x15'))(_0x3e77('0x16'));var utils=require('../../config/utils');var config=require(_0x3e77('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aa8a5,_0x4a1d09){_0x4a1d09=_0x4a1d09||0xcc;return function(_0x5b0f11){if(_0x5b0f11){return _0x1aa8a5[_0x3e77('0x18')](_0x4a1d09);}return _0x1aa8a5[_0x3e77('0x19')](_0x4a1d09)[_0x3e77('0x1a')]();};}function respondWithResult(_0x53188b,_0xb9208c){_0xb9208c=_0xb9208c||0xc8;return function(_0x55610c){if(_0x55610c){return _0x53188b[_0x3e77('0x19')](_0xb9208c)[_0x3e77('0x1b')](_0x55610c);}};}function respondWithFilteredResult(_0x4a48c8,_0x3fc41f){return function(_0x11d14b){if(_0x11d14b){var _0x39ec03=typeof _0x3fc41f[_0x3e77('0x1c')]===_0x3e77('0x1d')&&typeof _0x3fc41f[_0x3e77('0x1e')]==='undefined';var _0x1c2260=_0x11d14b[_0x3e77('0x1f')];var _0x35d890=_0x39ec03?0x0:_0x3fc41f[_0x3e77('0x1c')];var _0x58b8ee=_0x39ec03?_0x11d14b['count']:_0x3fc41f[_0x3e77('0x1c')]+_0x3fc41f['limit'];var _0x1eb346;if(_0x58b8ee>=_0x1c2260){_0x58b8ee=_0x1c2260;_0x1eb346=0xc8;}else{_0x1eb346=0xce;}_0x4a48c8[_0x3e77('0x19')](_0x1eb346);return _0x4a48c8[_0x3e77('0x20')](_0x3e77('0x21'),_0x35d890+'-'+_0x58b8ee+'/'+_0x1c2260)[_0x3e77('0x1b')](_0x11d14b);}return null;};}function patchUpdates(_0x19c4e1){return function(_0x4b2101){try{jsonpatch[_0x3e77('0x22')](_0x4b2101,_0x19c4e1,!![]);}catch(_0x96b07){return BPromise[_0x3e77('0x23')](_0x96b07);}return _0x4b2101[_0x3e77('0x24')]();};}function saveUpdates(_0x2a384a,_0x289c3d){return function(_0x2e027a){if(_0x2e027a){return _0x2e027a[_0x3e77('0x25')](_0x2a384a)['then'](function(_0x45762f){return _0x45762f;});}return null;};}function removeEntity(_0x317f32,_0x3ef7cf){return function(_0x1b2ce6){if(_0x1b2ce6){return _0x1b2ce6['destroy']()[_0x3e77('0x26')](function(){_0x317f32[_0x3e77('0x19')](0xcc)[_0x3e77('0x1a')]();});}};}function handleEntityNotFound(_0x1efc1a,_0x8e153a){return function(_0x17c859){if(!_0x17c859){_0x1efc1a[_0x3e77('0x18')](0x194);}return _0x17c859;};}function handleError(_0x2456f9,_0x3fccd2){_0x3fccd2=_0x3fccd2||0x1f4;return function(_0x7ab4d1){logger[_0x3e77('0x27')](_0x7ab4d1[_0x3e77('0x28')]);if(_0x7ab4d1['name']){delete _0x7ab4d1[_0x3e77('0x29')];}_0x2456f9[_0x3e77('0x19')](_0x3fccd2)['send'](_0x7ab4d1);};}exports['index']=function(_0x3c4f6a,_0x362fa5){var _0x118d72={},_0x453385={},_0x563870={'count':0x0,'rows':[]};var _0x36cb10=_['map'](db[_0x3e77('0x2a')][_0x3e77('0x2b')],function(_0x27cce5){return{'name':_0x27cce5['fieldName'],'type':_0x27cce5['type'][_0x3e77('0x2c')]};});_0x453385[_0x3e77('0x2d')]=_[_0x3e77('0x2e')](_0x36cb10,_0x3e77('0x29'));_0x453385[_0x3e77('0x2f')]=_[_0x3e77('0x30')](_0x3c4f6a[_0x3e77('0x2f')]);_0x453385['filters']=_[_0x3e77('0x31')](_0x453385[_0x3e77('0x2d')],_0x453385['query']);_0x118d72[_0x3e77('0x32')]=_[_0x3e77('0x31')](_0x453385[_0x3e77('0x2d')],qs['fields'](_0x3c4f6a[_0x3e77('0x2f')][_0x3e77('0x33')]));_0x118d72[_0x3e77('0x32')]=_0x118d72[_0x3e77('0x32')][_0x3e77('0x34')]?_0x118d72[_0x3e77('0x32')]:_0x453385[_0x3e77('0x2d')];if(!_0x3c4f6a['query'][_0x3e77('0x35')](_0x3e77('0x36'))){_0x118d72[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x3c4f6a['query'][_0x3e77('0x1e')]);_0x118d72[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x3c4f6a[_0x3e77('0x2f')][_0x3e77('0x1c')]);}_0x118d72['order']=qs[_0x3e77('0x37')](_0x3c4f6a[_0x3e77('0x2f')]['sort']);_0x118d72[_0x3e77('0x38')]=qs[_0x3e77('0x39')](_[_0x3e77('0x3a')](_0x3c4f6a[_0x3e77('0x2f')],_0x453385[_0x3e77('0x39')]),_0x36cb10);if(_0x3c4f6a[_0x3e77('0x2f')][_0x3e77('0x3b')]){_0x118d72[_0x3e77('0x38')]=_[_0x3e77('0x3c')](_0x118d72[_0x3e77('0x38')],{'$or':_[_0x3e77('0x2e')](_0x36cb10,function(_0x4935c5){if(_0x4935c5[_0x3e77('0x3d')]!==_0x3e77('0x3e')){var _0x2eb896={};_0x2eb896[_0x4935c5['name']]={'$like':'%'+_0x3c4f6a[_0x3e77('0x2f')][_0x3e77('0x3b')]+'%'};return _0x2eb896;}})});}_0x118d72=_[_0x3e77('0x3c')]({},_0x118d72,_0x3c4f6a[_0x3e77('0x3f')]);var _0x19facc={'where':_0x118d72[_0x3e77('0x38')]};return db[_0x3e77('0x2a')]['count'](_0x19facc)[_0x3e77('0x26')](function(_0x10ba95){_0x563870[_0x3e77('0x1f')]=_0x10ba95;if(_0x3c4f6a[_0x3e77('0x2f')][_0x3e77('0x40')]){_0x118d72[_0x3e77('0x41')]=[{'all':!![]}];}return db[_0x3e77('0x2a')]['findAll'](_0x118d72);})[_0x3e77('0x26')](function(_0x48396b){_0x563870[_0x3e77('0x42')]=_0x48396b;return _0x563870;})[_0x3e77('0x26')](respondWithFilteredResult(_0x362fa5,_0x118d72))[_0x3e77('0x43')](handleError(_0x362fa5,null));};exports[_0x3e77('0x44')]=function(_0x986ab3,_0x49e794){var _0x133ef5={'raw':!![],'where':{'id':_0x986ab3[_0x3e77('0x45')]['id']}},_0x58cfe4={};_0x58cfe4[_0x3e77('0x2d')]=_[_0x3e77('0x30')](db[_0x3e77('0x2a')][_0x3e77('0x2b')]);_0x58cfe4[_0x3e77('0x2f')]=_['keys'](_0x986ab3['query']);_0x58cfe4[_0x3e77('0x39')]=_[_0x3e77('0x31')](_0x58cfe4[_0x3e77('0x2d')],_0x58cfe4[_0x3e77('0x2f')]);_0x133ef5[_0x3e77('0x32')]=_[_0x3e77('0x31')](_0x58cfe4['model'],qs['fields'](_0x986ab3[_0x3e77('0x2f')][_0x3e77('0x33')]));_0x133ef5[_0x3e77('0x32')]=_0x133ef5[_0x3e77('0x32')][_0x3e77('0x34')]?_0x133ef5[_0x3e77('0x32')]:_0x58cfe4[_0x3e77('0x2d')];if(_0x986ab3[_0x3e77('0x2f')][_0x3e77('0x40')]){_0x133ef5['include']=[{'all':!![]}];}_0x133ef5=_[_0x3e77('0x3c')]({},_0x133ef5,_0x986ab3[_0x3e77('0x3f')]);return db[_0x3e77('0x2a')][_0x3e77('0x46')](_0x133ef5)[_0x3e77('0x26')](handleEntityNotFound(_0x49e794,null))['then'](respondWithResult(_0x49e794,null))[_0x3e77('0x43')](handleError(_0x49e794,null));};exports[_0x3e77('0x47')]=function(_0x333852,_0xb9d250){return db[_0x3e77('0x2a')][_0x3e77('0x47')](_0x333852[_0x3e77('0x48')],{})[_0x3e77('0x26')](respondWithResult(_0xb9d250,0xc9))[_0x3e77('0x43')](handleError(_0xb9d250,null));};exports[_0x3e77('0x25')]=function(_0x598971,_0x2e28f7){if(_0x598971[_0x3e77('0x48')]['id']){delete _0x598971[_0x3e77('0x48')]['id'];}return db[_0x3e77('0x2a')]['find']({'where':{'id':_0x598971[_0x3e77('0x45')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x2e28f7,null))[_0x3e77('0x26')](saveUpdates(_0x598971['body'],null))[_0x3e77('0x26')](respondWithResult(_0x2e28f7,null))[_0x3e77('0x43')](handleError(_0x2e28f7,null));};exports[_0x3e77('0x49')]=function(_0x1b6046,_0xface77){return db['ZendeskField'][_0x3e77('0x46')]({'where':{'id':_0x1b6046[_0x3e77('0x45')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0xface77,null))[_0x3e77('0x26')](removeEntity(_0xface77,null))[_0x3e77('0x43')](handleError(_0xface77,null));};
\ No newline at end of file
+var _0xb74e=['where','filters','pick','filter','VIRTUAL','merge','options','ZendeskField','includeAll','include','findAll','catch','length','find','create','body','params','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x42c835,_0x11aed3){var _0x2e9638=function(_0x243a61){while(--_0x243a61){_0x42c835['push'](_0x42c835['shift']());}};_0x2e9638(++_0x11aed3);}(_0xb74e,0xe9));var _0xeb74=function(_0x1b0679,_0x44e7b2){_0x1b0679=_0x1b0679-0x0;var _0x5d6c3d=_0xb74e[_0x1b0679];return _0x5d6c3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb74('0x0'));var zipdir=require(_0xeb74('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeb74('0x2'));var Mustache=require(_0xeb74('0x3'));var util=require(_0xeb74('0x4'));var path=require('path');var sox=require(_0xeb74('0x5'));var csv=require(_0xeb74('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb74('0x7'));var _=require(_0xeb74('0x8'));var squel=require(_0xeb74('0x9'));var crypto=require(_0xeb74('0xa'));var jsforce=require(_0xeb74('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xeb74('0x6'));var querystring=require(_0xeb74('0xc'));var Papa=require(_0xeb74('0xd'));var Redis=require(_0xeb74('0xe'));var authService=require(_0xeb74('0xf'));var qs=require(_0xeb74('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb74('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xeb74('0x12'));var config=require(_0xeb74('0x13'));var licenseUtil=require(_0xeb74('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e4650,_0x1da2b8){_0x1da2b8=_0x1da2b8||0xcc;return function(_0x30711c){if(_0x30711c){return _0x1e4650[_0xeb74('0x15')](_0x1da2b8);}return _0x1e4650[_0xeb74('0x16')](_0x1da2b8)[_0xeb74('0x17')]();};}function respondWithResult(_0x403d99,_0x5d88ca){_0x5d88ca=_0x5d88ca||0xc8;return function(_0x44cda0){if(_0x44cda0){return _0x403d99[_0xeb74('0x16')](_0x5d88ca)[_0xeb74('0x18')](_0x44cda0);}};}function respondWithFilteredResult(_0x504021,_0x134817){return function(_0x4f8212){if(_0x4f8212){var _0x30d5c1=typeof _0x134817[_0xeb74('0x19')]==='undefined'&&typeof _0x134817[_0xeb74('0x1a')]===_0xeb74('0x1b');var _0x30cf30=_0x4f8212[_0xeb74('0x1c')];var _0x34b468=_0x30d5c1?0x0:_0x134817[_0xeb74('0x19')];var _0x2e246c=_0x30d5c1?_0x4f8212[_0xeb74('0x1c')]:_0x134817[_0xeb74('0x19')]+_0x134817['limit'];var _0x48e505;if(_0x2e246c>=_0x30cf30){_0x2e246c=_0x30cf30;_0x48e505=0xc8;}else{_0x48e505=0xce;}_0x504021['status'](_0x48e505);return _0x504021['set'](_0xeb74('0x1d'),_0x34b468+'-'+_0x2e246c+'/'+_0x30cf30)[_0xeb74('0x18')](_0x4f8212);}return null;};}function patchUpdates(_0x1e7ab6){return function(_0x869f45){try{jsonpatch[_0xeb74('0x1e')](_0x869f45,_0x1e7ab6,!![]);}catch(_0x21cab1){return BPromise['reject'](_0x21cab1);}return _0x869f45[_0xeb74('0x1f')]();};}function saveUpdates(_0x30950a,_0x1db0de){return function(_0x53aa27){if(_0x53aa27){return _0x53aa27[_0xeb74('0x20')](_0x30950a)[_0xeb74('0x21')](function(_0x2399ea){return _0x2399ea;});}return null;};}function removeEntity(_0x6ae784,_0x77b207){return function(_0x3d4e1e){if(_0x3d4e1e){return _0x3d4e1e[_0xeb74('0x22')]()[_0xeb74('0x21')](function(){_0x6ae784[_0xeb74('0x16')](0xcc)[_0xeb74('0x17')]();});}};}function handleEntityNotFound(_0x14ee82,_0x21ff21){return function(_0x95855a){if(!_0x95855a){_0x14ee82[_0xeb74('0x15')](0x194);}return _0x95855a;};}function handleError(_0x54112a,_0x26d0e1){_0x26d0e1=_0x26d0e1||0x1f4;return function(_0x5baa7b){logger[_0xeb74('0x23')](_0x5baa7b[_0xeb74('0x24')]);if(_0x5baa7b[_0xeb74('0x25')]){delete _0x5baa7b[_0xeb74('0x25')];}_0x54112a[_0xeb74('0x16')](_0x26d0e1)[_0xeb74('0x26')](_0x5baa7b);};}exports[_0xeb74('0x27')]=function(_0x44478e,_0x3b3eb1){var _0x2c912e={},_0x2b1857={},_0x4cbb41={'count':0x0,'rows':[]};var _0x33e9d1=_[_0xeb74('0x28')](db['ZendeskField'][_0xeb74('0x29')],function(_0x5bf1a8){return{'name':_0x5bf1a8[_0xeb74('0x2a')],'type':_0x5bf1a8[_0xeb74('0x2b')][_0xeb74('0x2c')]};});_0x2b1857['model']=_[_0xeb74('0x28')](_0x33e9d1,_0xeb74('0x25'));_0x2b1857['query']=_[_0xeb74('0x2d')](_0x44478e['query']);_0x2b1857['filters']=_[_0xeb74('0x2e')](_0x2b1857[_0xeb74('0x2f')],_0x2b1857[_0xeb74('0x30')]);_0x2c912e[_0xeb74('0x31')]=_[_0xeb74('0x2e')](_0x2b1857['model'],qs[_0xeb74('0x32')](_0x44478e['query']['fields']));_0x2c912e[_0xeb74('0x31')]=_0x2c912e[_0xeb74('0x31')]['length']?_0x2c912e[_0xeb74('0x31')]:_0x2b1857[_0xeb74('0x2f')];if(!_0x44478e['query'][_0xeb74('0x33')](_0xeb74('0x34'))){_0x2c912e[_0xeb74('0x1a')]=qs[_0xeb74('0x1a')](_0x44478e[_0xeb74('0x30')]['limit']);_0x2c912e[_0xeb74('0x19')]=qs[_0xeb74('0x19')](_0x44478e['query'][_0xeb74('0x19')]);}_0x2c912e[_0xeb74('0x35')]=qs[_0xeb74('0x36')](_0x44478e['query'][_0xeb74('0x36')]);_0x2c912e[_0xeb74('0x37')]=qs[_0xeb74('0x38')](_[_0xeb74('0x39')](_0x44478e[_0xeb74('0x30')],_0x2b1857[_0xeb74('0x38')]),_0x33e9d1);if(_0x44478e[_0xeb74('0x30')][_0xeb74('0x3a')]){_0x2c912e[_0xeb74('0x37')]=_['merge'](_0x2c912e[_0xeb74('0x37')],{'$or':_[_0xeb74('0x28')](_0x33e9d1,function(_0x2f0efb){if(_0x2f0efb[_0xeb74('0x2b')]!==_0xeb74('0x3b')){var _0x428f61={};_0x428f61[_0x2f0efb['name']]={'$like':'%'+_0x44478e[_0xeb74('0x30')][_0xeb74('0x3a')]+'%'};return _0x428f61;}})});}_0x2c912e=_[_0xeb74('0x3c')]({},_0x2c912e,_0x44478e[_0xeb74('0x3d')]);var _0x24e595={'where':_0x2c912e[_0xeb74('0x37')]};return db[_0xeb74('0x3e')][_0xeb74('0x1c')](_0x24e595)[_0xeb74('0x21')](function(_0x14186f){_0x4cbb41[_0xeb74('0x1c')]=_0x14186f;if(_0x44478e['query'][_0xeb74('0x3f')]){_0x2c912e[_0xeb74('0x40')]=[{'all':!![]}];}return db[_0xeb74('0x3e')][_0xeb74('0x41')](_0x2c912e);})[_0xeb74('0x21')](function(_0x3c8479){_0x4cbb41['rows']=_0x3c8479;return _0x4cbb41;})['then'](respondWithFilteredResult(_0x3b3eb1,_0x2c912e))[_0xeb74('0x42')](handleError(_0x3b3eb1,null));};exports['show']=function(_0x272e1d,_0x3a83bc){var _0x5f1f61={'raw':!![],'where':{'id':_0x272e1d['params']['id']}},_0x53eb75={};_0x53eb75[_0xeb74('0x2f')]=_['keys'](db[_0xeb74('0x3e')]['rawAttributes']);_0x53eb75[_0xeb74('0x30')]=_[_0xeb74('0x2d')](_0x272e1d[_0xeb74('0x30')]);_0x53eb75['filters']=_[_0xeb74('0x2e')](_0x53eb75[_0xeb74('0x2f')],_0x53eb75[_0xeb74('0x30')]);_0x5f1f61[_0xeb74('0x31')]=_[_0xeb74('0x2e')](_0x53eb75[_0xeb74('0x2f')],qs[_0xeb74('0x32')](_0x272e1d[_0xeb74('0x30')][_0xeb74('0x32')]));_0x5f1f61[_0xeb74('0x31')]=_0x5f1f61[_0xeb74('0x31')][_0xeb74('0x43')]?_0x5f1f61[_0xeb74('0x31')]:_0x53eb75[_0xeb74('0x2f')];if(_0x272e1d[_0xeb74('0x30')][_0xeb74('0x3f')]){_0x5f1f61[_0xeb74('0x40')]=[{'all':!![]}];}_0x5f1f61=_[_0xeb74('0x3c')]({},_0x5f1f61,_0x272e1d[_0xeb74('0x3d')]);return db['ZendeskField'][_0xeb74('0x44')](_0x5f1f61)[_0xeb74('0x21')](handleEntityNotFound(_0x3a83bc,null))[_0xeb74('0x21')](respondWithResult(_0x3a83bc,null))[_0xeb74('0x42')](handleError(_0x3a83bc,null));};exports[_0xeb74('0x45')]=function(_0x552cc6,_0x43d1ea){return db[_0xeb74('0x3e')][_0xeb74('0x45')](_0x552cc6[_0xeb74('0x46')],{})['then'](respondWithResult(_0x43d1ea,0xc9))[_0xeb74('0x42')](handleError(_0x43d1ea,null));};exports[_0xeb74('0x20')]=function(_0xe1c0f3,_0x325686){if(_0xe1c0f3[_0xeb74('0x46')]['id']){delete _0xe1c0f3['body']['id'];}return db[_0xeb74('0x3e')][_0xeb74('0x44')]({'where':{'id':_0xe1c0f3[_0xeb74('0x47')]['id']}})[_0xeb74('0x21')](handleEntityNotFound(_0x325686,null))['then'](saveUpdates(_0xe1c0f3[_0xeb74('0x46')],null))[_0xeb74('0x21')](respondWithResult(_0x325686,null))['catch'](handleError(_0x325686,null));};exports[_0xeb74('0x22')]=function(_0x520a26,_0xb0d949){return db[_0xeb74('0x3e')][_0xeb74('0x44')]({'where':{'id':_0x520a26['params']['id']}})[_0xeb74('0x21')](handleEntityNotFound(_0xb0d949,null))[_0xeb74('0x21')](removeEntity(_0xb0d949,null))[_0xeb74('0x42')](handleError(_0xb0d949,null));};
\ No newline at end of file
index 789ddba..d0ff87a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1b9=['rimraf','../../config/environment','./intZendeskField.attributes','ZendeskField','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x3566f6,_0x4951d6){var _0x55d6a9=function(_0x34de5c){while(--_0x34de5c){_0x3566f6['push'](_0x3566f6['shift']());}};_0x55d6a9(++_0x4951d6);}(_0xf1b9,0x162));var _0x9f1b=function(_0x295939,_0x415c63){_0x295939=_0x295939-0x0;var _0x5015af=_0xf1b9[_0x295939];return _0x5015af;};'use strict';var _=require(_0x9f1b('0x0'));var util=require(_0x9f1b('0x1'));var logger=require(_0x9f1b('0x2'))('api');var moment=require(_0x9f1b('0x3'));var BPromise=require('bluebird');var rp=require(_0x9f1b('0x4'));var fs=require('fs');var path=require(_0x9f1b('0x5'));var rimraf=require(_0x9f1b('0x6'));var config=require(_0x9f1b('0x7'));var attributes=require(_0x9f1b('0x8'));module['exports']=function(_0x162224,_0x36ee4c){return _0x162224['define'](_0x9f1b('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x9f1b('0xa'),_0x9f1b('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d2e=['int_zendesk_fields','idField','util','api','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes','define','ZendeskField'];(function(_0x219c8b,_0x4f7ba2){var _0x405093=function(_0x352495){while(--_0x352495){_0x219c8b['push'](_0x219c8b['shift']());}};_0x405093(++_0x4f7ba2);}(_0x4d2e,0x136));var _0xe4d2=function(_0x365900,_0x5d7fb5){_0x365900=_0x365900-0x0;var _0x9e23d3=_0x4d2e[_0x365900];return _0x9e23d3;};'use strict';var _=require('lodash');var util=require(_0xe4d2('0x0'));var logger=require('../../config/logger')(_0xe4d2('0x1'));var moment=require(_0xe4d2('0x2'));var BPromise=require(_0xe4d2('0x3'));var rp=require(_0xe4d2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe4d2('0x5'));var attributes=require(_0xe4d2('0x6'));module['exports']=function(_0x218ff2,_0xcdaef1){return _0x218ff2[_0xe4d2('0x7')](_0xe4d2('0x8'),attributes,{'tableName':_0xe4d2('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xe4d2('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 0a3ef6f..85ca989 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5510=['request\x20sent','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x18641e,_0x36aa7f){var _0x5743af=function(_0x5a1587){while(--_0x5a1587){_0x18641e['push'](_0x18641e['shift']());}};_0x5743af(++_0x36aa7f);}(_0x5510,0x7e));var _0x0551=function(_0x4c9f70,_0x53990b){_0x4c9f70=_0x4c9f70-0x0;var _0x3b1dd9=_0x5510[_0x4c9f70];return _0x3b1dd9;};'use strict';var _=require(_0x0551('0x0'));var util=require(_0x0551('0x1'));var moment=require('moment');var BPromise=require(_0x0551('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0551('0x3'));var db=require(_0x0551('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0551('0x5'))('rpc');var config=require(_0x0551('0x6'));var jayson=require(_0x0551('0x7'));var client=jayson['client'][_0x0551('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2acb46,_0x36b669,_0x106d04){return new BPromise(function(_0x201b3d,_0x813364){return client[_0x0551('0x9')](_0x2acb46,_0x106d04)[_0x0551('0xa')](function(_0x15d4eb){logger[_0x0551('0xb')](_0x0551('0xc'),_0x36b669,'request\x20sent');logger['debug'](_0x0551('0xd'),_0x36b669,_0x0551('0xe'),JSON['stringify'](_0x15d4eb));if(_0x15d4eb[_0x0551('0xf')]){if(_0x15d4eb['error'][_0x0551('0x10')]===0x1f4){logger[_0x0551('0xf')]('ZendeskField,\x20%s,\x20%s',_0x36b669,_0x15d4eb[_0x0551('0xf')][_0x0551('0x11')]);return _0x813364(_0x15d4eb[_0x0551('0xf')][_0x0551('0x11')]);}logger['error'](_0x0551('0xc'),_0x36b669,_0x15d4eb['error'][_0x0551('0x11')]);return _0x201b3d(_0x15d4eb[_0x0551('0xf')][_0x0551('0x11')]);}else{logger[_0x0551('0xb')]('ZendeskField,\x20%s,\x20%s',_0x36b669,_0x0551('0xe'));_0x201b3d(_0x15d4eb[_0x0551('0x12')][_0x0551('0x11')]);}})[_0x0551('0x13')](function(_0x498e08){logger[_0x0551('0xf')](_0x0551('0xc'),_0x36b669,_0x498e08);_0x813364(_0x498e08);});});}
\ No newline at end of file
+var _0xfc6b=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZendeskField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x245855,_0x1506f0){var _0x3548bf=function(_0x9d4949){while(--_0x9d4949){_0x245855['push'](_0x245855['shift']());}};_0x3548bf(++_0x1506f0);}(_0xfc6b,0x14b));var _0xbfc6=function(_0x1a6fee,_0x2d6eaf){_0x1a6fee=_0x1a6fee-0x0;var _0x177943=_0xfc6b[_0x1a6fee];return _0x177943;};'use strict';var _=require(_0xbfc6('0x0'));var util=require(_0xbfc6('0x1'));var moment=require(_0xbfc6('0x2'));var BPromise=require(_0xbfc6('0x3'));var rs=require(_0xbfc6('0x4'));var fs=require('fs');var Redis=require(_0xbfc6('0x5'));var db=require(_0xbfc6('0x6'))['db'];var utils=require(_0xbfc6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xbfc6('0x8'));var jayson=require(_0xbfc6('0x9'));var client=jayson[_0xbfc6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x313958,_0x216eef,_0x5034bd){return new BPromise(function(_0x38fe04,_0x25cfaf){return client[_0xbfc6('0xb')](_0x313958,_0x5034bd)['then'](function(_0x22989c){logger[_0xbfc6('0xc')]('ZendeskField,\x20%s,\x20%s',_0x216eef,'request\x20sent');logger[_0xbfc6('0xd')](_0xbfc6('0xe'),_0x216eef,_0xbfc6('0xf'),JSON[_0xbfc6('0x10')](_0x22989c));if(_0x22989c[_0xbfc6('0x11')]){if(_0x22989c['error']['code']===0x1f4){logger['error'](_0xbfc6('0x12'),_0x216eef,_0x22989c[_0xbfc6('0x11')][_0xbfc6('0x13')]);return _0x25cfaf(_0x22989c[_0xbfc6('0x11')]['message']);}logger[_0xbfc6('0x11')](_0xbfc6('0x12'),_0x216eef,_0x22989c[_0xbfc6('0x11')]['message']);return _0x38fe04(_0x22989c[_0xbfc6('0x11')]['message']);}else{logger[_0xbfc6('0xc')]('ZendeskField,\x20%s,\x20%s',_0x216eef,_0xbfc6('0xf'));_0x38fe04(_0x22989c['result'][_0xbfc6('0x13')]);}})[_0xbfc6('0x14')](function(_0x40fb4a){logger[_0xbfc6('0x11')](_0xbfc6('0x12'),_0x216eef,_0x40fb4a);_0x25cfaf(_0x40fb4a);});});}
\ No newline at end of file
index 9209370..da01a91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ffe=['/:id/fields','post','create','/:id/configurations','addConfiguration','put','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','getConfigurations'];(function(_0x221c07,_0x471eed){var _0x3a00d4=function(_0x5c9240){while(--_0x5c9240){_0x221c07['push'](_0x221c07['shift']());}};_0x3a00d4(++_0x471eed);}(_0x4ffe,0x110));var _0xe4ff=function(_0x2634a7,_0x118508){_0x2634a7=_0x2634a7-0x0;var _0xa52e2c=_0x4ffe[_0x2634a7];return _0xa52e2c;};'use strict';var multer=require('multer');var util=require(_0xe4ff('0x0'));var path=require(_0xe4ff('0x1'));var timeout=require(_0xe4ff('0x2'));var express=require(_0xe4ff('0x3'));var router=express[_0xe4ff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe4ff('0x5'));var interaction=require(_0xe4ff('0x6'));var config=require(_0xe4ff('0x7'));var controller=require(_0xe4ff('0x8'));router[_0xe4ff('0x9')]('/',auth[_0xe4ff('0xa')](),controller[_0xe4ff('0xb')]);router['get'](_0xe4ff('0xc'),auth[_0xe4ff('0xa')](),controller['show']);router[_0xe4ff('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe4ff('0xd')]);router[_0xe4ff('0x9')](_0xe4ff('0xe'),auth[_0xe4ff('0xa')](),controller['getFields']);router[_0xe4ff('0xf')]('/',auth['isAuthenticated'](),controller[_0xe4ff('0x10')]);router[_0xe4ff('0xf')](_0xe4ff('0x11'),auth['isAuthenticated'](),controller[_0xe4ff('0x12')]);router[_0xe4ff('0x13')](_0xe4ff('0xc'),auth[_0xe4ff('0xa')](),controller['update']);router[_0xe4ff('0x14')](_0xe4ff('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xe4ff('0x15')]=router;
\ No newline at end of file
+var _0xbdb9=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration'];(function(_0x3121f8,_0x125a1b){var _0x553d2c=function(_0x3b9634){while(--_0x3b9634){_0x3121f8['push'](_0x3121f8['shift']());}};_0x553d2c(++_0x125a1b);}(_0xbdb9,0xac));var _0x9bdb=function(_0x48c17a,_0x57489c){_0x48c17a=_0x48c17a-0x0;var _0x4a91bc=_0xbdb9[_0x48c17a];return _0x4a91bc;};'use strict';var multer=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var path=require(_0x9bdb('0x2'));var timeout=require(_0x9bdb('0x3'));var express=require(_0x9bdb('0x4'));var router=express['Router']();var fs_extra=require(_0x9bdb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x9bdb('0x6')]('/',auth['isAuthenticated'](),controller[_0x9bdb('0x7')]);router['get'](_0x9bdb('0x8'),auth[_0x9bdb('0x9')](),controller[_0x9bdb('0xa')]);router[_0x9bdb('0x6')](_0x9bdb('0xb'),auth[_0x9bdb('0x9')](),controller[_0x9bdb('0xc')]);router['get'](_0x9bdb('0xd'),auth[_0x9bdb('0x9')](),controller[_0x9bdb('0xe')]);router[_0x9bdb('0xf')]('/',auth[_0x9bdb('0x9')](),controller['create']);router['post'](_0x9bdb('0xb'),auth[_0x9bdb('0x9')](),controller[_0x9bdb('0x10')]);router[_0x9bdb('0x11')](_0x9bdb('0x8'),auth[_0x9bdb('0x9')](),controller['update']);router[_0x9bdb('0x12')](_0x9bdb('0x8'),auth[_0x9bdb('0x9')](),controller[_0x9bdb('0x13')]);module[_0x9bdb('0x14')]=router;
\ No newline at end of file
index d180425..579911d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ea=['sequelize','exports','STRING'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xd2ea,0x15f));var _0xad2e=function(_0x37f841,_0x4148b7){_0x37f841=_0x37f841-0x0;var _0x25ddc0=_0xd2ea[_0x37f841];return _0x25ddc0;};'use strict';var Sequelize=require(_0xad2e('0x0'));module[_0xad2e('0x1')]={'name':{'type':Sequelize[_0xad2e('0x2')]},'description':{'type':Sequelize[_0xad2e('0x2')]},'host':{'type':Sequelize[_0xad2e('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xad2e('0x2')]},'clientSecret':{'type':Sequelize[_0xad2e('0x2')]},'serverUrl':{'type':Sequelize[_0xad2e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xad2e('0x2')]},'refreshToken':{'type':Sequelize[_0xad2e('0x2')]}};
\ No newline at end of file
+var _0x4c4e=['sequelize','STRING'];(function(_0x4b737f,_0x88441f){var _0x880889=function(_0x53b64e){while(--_0x53b64e){_0x4b737f['push'](_0x4b737f['shift']());}};_0x880889(++_0x88441f);}(_0x4c4e,0x152));var _0xe4c4=function(_0x18a8c2,_0x164f72){_0x18a8c2=_0x18a8c2-0x0;var _0x5624c9=_0x4c4e[_0x18a8c2];return _0x5624c9;};'use strict';var Sequelize=require(_0xe4c4('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4c4('0x1')]},'description':{'type':Sequelize[_0xe4c4('0x1')]},'host':{'type':Sequelize[_0xe4c4('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe4c4('0x1')]},'clientSecret':{'type':Sequelize[_0xe4c4('0x1')]},'serverUrl':{'type':Sequelize[_0xe4c4('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xe4c4('0x1')]}};
\ No newline at end of file
index 8e6c569..bf10509 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4754=['response','error','message','Owner','Call_Duration','Call_Start_Time','Call_Type','remove','api_name','display_label','custom_field','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','status','end','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','zoho.eu','com','substring','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20'];(function(_0x42e98c,_0x1c6bb9){var _0x59803e=function(_0x3a587e){while(--_0x3a587e){_0x42e98c['push'](_0x42e98c['shift']());}};_0x59803e(++_0x1c6bb9);}(_0x4754,0x18a));var _0x4475=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4754[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4475('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4475('0x1'));var jsonpatch=require(_0x4475('0x2'));var rp=require(_0x4475('0x3'));var moment=require(_0x4475('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4475('0x5'));var util=require(_0x4475('0x6'));var path=require(_0x4475('0x7'));var sox=require(_0x4475('0x8'));var csv=require('to-csv');var ejs=require(_0x4475('0x9'));var fs=require('fs');var fs_extra=require(_0x4475('0xa'));var _=require(_0x4475('0xb'));var squel=require(_0x4475('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4475('0xd'));var toCsv=require(_0x4475('0xe'));var querystring=require(_0x4475('0xf'));var Papa=require(_0x4475('0x10'));var Redis=require(_0x4475('0x11'));var authService=require(_0x4475('0x12'));var qs=require(_0x4475('0x13'));var as=require(_0x4475('0x14'));var hardwareService=require(_0x4475('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4475('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4475('0x17'));var db=require(_0x4475('0x18'))['db'];var integrations=require(_0x4475('0x19'));function respondWithStatusCode(_0x1e8b23,_0x4dead2){_0x4dead2=_0x4dead2||0xcc;return function(_0x340026){if(_0x340026){return _0x1e8b23[_0x4475('0x1a')](_0x4dead2);}return _0x1e8b23['status'](_0x4dead2)['end']();};}function respondWithResult(_0x56aecb,_0x4eb331){_0x4eb331=_0x4eb331||0xc8;return function(_0x2fb581){if(_0x2fb581){return _0x56aecb['status'](_0x4eb331)[_0x4475('0x1b')](_0x2fb581);}};}function respondWithFilteredResult(_0x427070,_0x262139){return function(_0xbb2cae){if(_0xbb2cae){var _0xbd459b=typeof _0x262139['offset']===_0x4475('0x1c')&&typeof _0x262139['limit']===_0x4475('0x1c');var _0x5bd2de=_0xbb2cae[_0x4475('0x1d')];var _0x2a5999=_0xbd459b?0x0:_0x262139[_0x4475('0x1e')];var _0x34685d=_0xbd459b?_0xbb2cae[_0x4475('0x1d')]:_0x262139[_0x4475('0x1e')]+_0x262139['limit'];var _0x17638f;if(_0x34685d>=_0x5bd2de){_0x34685d=_0x5bd2de;_0x17638f=0xc8;}else{_0x17638f=0xce;}_0x427070['status'](_0x17638f);return _0x427070[_0x4475('0x1f')](_0x4475('0x20'),_0x2a5999+'-'+_0x34685d+'/'+_0x5bd2de)[_0x4475('0x1b')](_0xbb2cae);}return null;};}function patchUpdates(_0x1dfc05){return function(_0x429e11){try{jsonpatch[_0x4475('0x21')](_0x429e11,_0x1dfc05,!![]);}catch(_0x50604f){return BPromise[_0x4475('0x22')](_0x50604f);}return _0x429e11[_0x4475('0x23')]();};}function saveUpdates(_0xde1654,_0xe04f7d){return function(_0x17b70c){if(_0x17b70c){return _0x17b70c[_0x4475('0x24')](_0xde1654)[_0x4475('0x25')](function(_0x29d377){return _0x29d377;});}return null;};}function removeEntity(_0x3b5159,_0x160ab9){return function(_0x19e9ed){if(_0x19e9ed){return _0x19e9ed[_0x4475('0x26')]()['then'](function(){_0x3b5159[_0x4475('0x27')](0xcc)[_0x4475('0x28')]();});}};}function handleEntityNotFound(_0x150503,_0x17cecd){return function(_0x2481dd){if(!_0x2481dd){_0x150503[_0x4475('0x1a')](0x194);}return _0x2481dd;};}function handleError(_0x2c0044,_0x13a0a6){_0x13a0a6=_0x13a0a6||0x1f4;return function(_0x14f8af){logger['error'](_0x14f8af[_0x4475('0x29')]);if(_0x14f8af[_0x4475('0x2a')]){delete _0x14f8af[_0x4475('0x2a')];}_0x2c0044[_0x4475('0x27')](_0x13a0a6)[_0x4475('0x2b')](_0x14f8af);};}exports[_0x4475('0x2c')]=function(_0x432fff,_0x234ba9){var _0x17d172={},_0x12be14={},_0xffcf56={'count':0x0,'rows':[]};var _0x3f8abb=_[_0x4475('0x2d')](db[_0x4475('0x2e')][_0x4475('0x2f')],function(_0x32a1ff){return{'name':_0x32a1ff[_0x4475('0x30')],'type':_0x32a1ff['type']['key']};});_0x12be14[_0x4475('0x31')]=_[_0x4475('0x2d')](_0x3f8abb,_0x4475('0x2a'));_0x12be14[_0x4475('0x32')]=_[_0x4475('0x33')](_0x432fff['query']);_0x12be14[_0x4475('0x34')]=_[_0x4475('0x35')](_0x12be14['model'],_0x12be14[_0x4475('0x32')]);_0x17d172[_0x4475('0x36')]=_['intersection'](_0x12be14['model'],qs[_0x4475('0x37')](_0x432fff['query'][_0x4475('0x37')]));_0x17d172[_0x4475('0x36')]=_0x17d172[_0x4475('0x36')][_0x4475('0x38')]?_0x17d172[_0x4475('0x36')]:_0x12be14[_0x4475('0x31')];if(!_0x432fff['query'][_0x4475('0x39')](_0x4475('0x3a'))){_0x17d172['limit']=qs[_0x4475('0x3b')](_0x432fff[_0x4475('0x32')][_0x4475('0x3b')]);_0x17d172['offset']=qs[_0x4475('0x1e')](_0x432fff[_0x4475('0x32')][_0x4475('0x1e')]);}_0x17d172[_0x4475('0x3c')]=qs[_0x4475('0x3d')](_0x432fff[_0x4475('0x32')][_0x4475('0x3d')]);_0x17d172[_0x4475('0x3e')]=qs['filters'](_['pick'](_0x432fff[_0x4475('0x32')],_0x12be14['filters']),_0x3f8abb);if(_0x432fff[_0x4475('0x32')][_0x4475('0x3f')]){_0x17d172[_0x4475('0x3e')]=_[_0x4475('0x40')](_0x17d172[_0x4475('0x3e')],{'$or':_[_0x4475('0x2d')](_0x3f8abb,function(_0x1b5ed1){if(_0x1b5ed1[_0x4475('0x41')]!==_0x4475('0x42')){var _0x3f9922={};_0x3f9922[_0x1b5ed1[_0x4475('0x2a')]]={'$like':'%'+_0x432fff['query'][_0x4475('0x3f')]+'%'};return _0x3f9922;}})});}_0x17d172=_[_0x4475('0x40')]({},_0x17d172,_0x432fff[_0x4475('0x43')]);var _0xf4518b={'where':_0x17d172['where']};return db['ZohoAccount'][_0x4475('0x1d')](_0xf4518b)[_0x4475('0x25')](function(_0x3c9281){_0xffcf56['count']=_0x3c9281;if(_0x432fff[_0x4475('0x32')][_0x4475('0x44')]){_0x17d172['include']=[{'all':!![]}];}return db[_0x4475('0x2e')]['findAll'](_0x17d172);})[_0x4475('0x25')](function(_0x53222e){_0xffcf56[_0x4475('0x45')]=_0x53222e;return _0xffcf56;})['then'](respondWithFilteredResult(_0x234ba9,_0x17d172))[_0x4475('0x46')](handleError(_0x234ba9,null));};exports[_0x4475('0x47')]=function(_0x388f79,_0x484bb4){var _0x286fd4={'raw':![],'where':{'id':_0x388f79[_0x4475('0x48')]['id']}},_0x2daf8c={};_0x2daf8c['model']=_[_0x4475('0x33')](db[_0x4475('0x2e')]['rawAttributes']);_0x2daf8c['query']=_['keys'](_0x388f79[_0x4475('0x32')]);_0x2daf8c[_0x4475('0x34')]=_[_0x4475('0x35')](_0x2daf8c[_0x4475('0x31')],_0x2daf8c[_0x4475('0x32')]);_0x286fd4['attributes']=_[_0x4475('0x35')](_0x2daf8c[_0x4475('0x31')],qs['fields'](_0x388f79[_0x4475('0x32')][_0x4475('0x37')]));_0x286fd4[_0x4475('0x36')]=_0x286fd4['attributes']['length']?_0x286fd4[_0x4475('0x36')]:_0x2daf8c[_0x4475('0x31')];if(_0x388f79['query'][_0x4475('0x44')]){_0x286fd4[_0x4475('0x49')]=[{'all':!![]}];}_0x286fd4=_[_0x4475('0x40')]({},_0x286fd4,_0x388f79[_0x4475('0x43')]);return db[_0x4475('0x2e')][_0x4475('0x4a')](_0x286fd4)['then'](handleEntityNotFound(_0x484bb4,null))[_0x4475('0x25')](respondWithResult(_0x484bb4,null))[_0x4475('0x46')](handleError(_0x484bb4,null));};exports['create']=function(_0x580ad3,_0x1f5880){return db[_0x4475('0x2e')][_0x4475('0x4b')](_0x580ad3[_0x4475('0x4c')],{})['then'](respondWithResult(_0x1f5880,0xc9))['catch'](handleError(_0x1f5880,null));};exports['update']=function(_0x5baf29,_0x440379){if(_0x5baf29[_0x4475('0x4c')]['id']){delete _0x5baf29[_0x4475('0x4c')]['id'];}return db[_0x4475('0x2e')]['find']({'where':{'id':_0x5baf29[_0x4475('0x48')]['id']}})[_0x4475('0x25')](handleEntityNotFound(_0x440379,null))[_0x4475('0x25')](saveUpdates(_0x5baf29['body'],null))['then'](respondWithResult(_0x440379,null))[_0x4475('0x46')](handleError(_0x440379,null));};exports[_0x4475('0x26')]=function(_0x4593f2,_0xd2d4c5){return db[_0x4475('0x2e')][_0x4475('0x4a')]({'where':{'id':_0x4593f2[_0x4475('0x48')]['id']}})[_0x4475('0x25')](handleEntityNotFound(_0xd2d4c5,null))[_0x4475('0x25')](removeEntity(_0xd2d4c5,null))[_0x4475('0x46')](handleError(_0xd2d4c5,null));};exports[_0x4475('0x4d')]=function(_0x1b2761,_0x2610ff,_0x2305b7){var _0x381dcf={};var _0x3e995b={};var _0x4cc183;var _0xe78a60;return db[_0x4475('0x2e')][_0x4475('0x4e')]({'where':{'id':_0x1b2761['params']['id']}})[_0x4475('0x25')](handleEntityNotFound(_0x2610ff,null))[_0x4475('0x25')](function(_0x221508){if(_0x221508){_0x4cc183=_0x221508;_0x3e995b['model']=_[_0x4475('0x33')](db[_0x4475('0x4f')]['rawAttributes']);_0x3e995b[_0x4475('0x32')]=_['keys'](_0x1b2761[_0x4475('0x32')]);_0x3e995b[_0x4475('0x34')]=_[_0x4475('0x35')](_0x3e995b['model'],_0x3e995b[_0x4475('0x32')]);_0x381dcf['attributes']=_[_0x4475('0x35')](_0x3e995b[_0x4475('0x31')],qs[_0x4475('0x37')](_0x1b2761['query']['fields']));_0x381dcf[_0x4475('0x36')]=_0x381dcf[_0x4475('0x36')]['length']?_0x381dcf[_0x4475('0x36')]:_0x3e995b[_0x4475('0x31')];_0x381dcf[_0x4475('0x3c')]=qs[_0x4475('0x3d')](_0x1b2761['query'][_0x4475('0x3d')]);_0x381dcf[_0x4475('0x3e')]=qs['filters'](_['pick'](_0x1b2761['query'],_0x3e995b['filters']));if(_0x1b2761[_0x4475('0x32')]['filter']){_0x381dcf['where']=_['merge'](_0x381dcf['where'],{'$or':_[_0x4475('0x2d')](_0x381dcf[_0x4475('0x36')],function(_0x3218c3){var _0x70b932={};_0x70b932[_0x3218c3]={'$like':'%'+_0x1b2761[_0x4475('0x32')][_0x4475('0x3f')]+'%'};return _0x70b932;})});}_0x381dcf=_[_0x4475('0x40')]({},_0x381dcf,_0x1b2761[_0x4475('0x43')]);return _0x4cc183[_0x4475('0x4d')](_0x381dcf);}})[_0x4475('0x25')](function(_0x1244f1){if(_0x1244f1){_0xe78a60=_0x1244f1[_0x4475('0x38')];if(!_0x1b2761[_0x4475('0x32')][_0x4475('0x39')](_0x4475('0x3a'))){_0x381dcf[_0x4475('0x3b')]=qs[_0x4475('0x3b')](_0x1b2761[_0x4475('0x32')][_0x4475('0x3b')]);_0x381dcf[_0x4475('0x1e')]=qs[_0x4475('0x1e')](_0x1b2761['query']['offset']);}return _0x4cc183[_0x4475('0x4d')](_0x381dcf);}})[_0x4475('0x25')](function(_0x1189c7){if(_0x1189c7){return _0x1189c7?{'count':_0xe78a60,'rows':_0x1189c7}:null;}})[_0x4475('0x25')](respondWithResult(_0x2610ff,null))[_0x4475('0x46')](handleError(_0x2610ff,null));};exports[_0x4475('0x50')]=function(_0x4c456d,_0x102325,_0x1309f1){if(_0x4c456d[_0x4475('0x4c')]['id']){delete _0x4c456d[_0x4475('0x4c')]['id'];}return db[_0x4475('0x2e')][_0x4475('0x4e')]({'where':{'id':_0x4c456d[_0x4475('0x48')]['id']}})['then'](handleEntityNotFound(_0x102325,null))['then'](function(_0x259542){if(_0x259542){_0x4c456d[_0x4475('0x4c')][_0x4475('0x51')]=_0x259542['id'];_0x4c456d[_0x4475('0x4c')][_0x4475('0x52')]=integrations[_0x4475('0x53')](_0x4c456d[_0x4475('0x4c')]['channel'],_0x4c456d[_0x4475('0x4c')][_0x4475('0x41')]);_0x4c456d[_0x4475('0x4c')][_0x4475('0x54')]=integrations[_0x4475('0x55')](_0x4c456d[_0x4475('0x4c')][_0x4475('0x56')],_0x4c456d[_0x4475('0x4c')][_0x4475('0x41')]);return db['ZohoConfiguration'][_0x4475('0x4b')](_0x4c456d[_0x4475('0x4c')],{'include':[{'model':db[_0x4475('0x57')],'as':_0x4475('0x52')},{'model':db[_0x4475('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x102325,null))[_0x4475('0x46')](handleError(_0x102325,null));};function getAccessToken(_0x39607b){return new Promise(function(_0x31dd36,_0x17bb0a){var _0x1fb96e;switch(_0x39607b['zone']){case'US':_0x1fb96e=_0x4475('0x58');break;case'AU':_0x1fb96e=_0x4475('0x59');break;case'EU':_0x1fb96e=_0x4475('0x5a');break;case'IN':_0x1fb96e=_0x4475('0x5b');break;case'CN':_0x1fb96e='https://accounts.zoho.com.cn';break;default:_0x1fb96e=_0x4475('0x5a');break;}var _0x28c7d4={'method':_0x4475('0x5c'),'uri':_0x1fb96e+'/oauth/v2/token','qs':{'refresh_token':_0x39607b[_0x4475('0x5d')],'client_id':_0x39607b['clientId'],'client_secret':_0x39607b[_0x4475('0x5e')],'grant_type':_0x4475('0x5f')},'json':!![]};return rp(_0x28c7d4)[_0x4475('0x25')](function(_0x9b4141){if(_0x9b4141[_0x4475('0x60')]){_0x31dd36(_0x9b4141[_0x4475('0x60')]);}else{_0x17bb0a(_0x4475('0x61'));}})[_0x4475('0x46')](function(_0x4e4bc7){_0x17bb0a(_0x4e4bc7);});});}exports[_0x4475('0x62')]=function(_0x151858,_0x3f54b9,_0x555cec){var _0x4cb019,_0x3c2ac2,_0x4666d1,_0x7d0f6d,_0x3332b7;return db[_0x4475('0x2e')]['findOne']({'where':{'id':_0x151858[_0x4475('0x48')]['id']},'attributes':['id',_0x4475('0x63'),'zone',_0x4475('0x64'),_0x4475('0x5e'),_0x4475('0x65'),_0x4475('0x66'),'refreshToken']})[_0x4475('0x25')](handleEntityNotFound(_0x3f54b9,null))[_0x4475('0x25')](function(_0x1614cd){_0x3332b7=_0x1614cd;_0x4cb019=_0x3332b7[_0x4475('0x63')];_0x3c2ac2=_0x4cb019===_0x4475('0x67')?'eu':_0x4475('0x68');_0x4666d1=_0x3332b7[_0x4475('0x65')];var _0x1dcae1=_0x4666d1['slice'](-0x1);if(_0x1dcae1==='/'||_0x1dcae1==='\x5c'||_0x1dcae1===':'){_0x4666d1=_0x4666d1[_0x4475('0x69')](0x0,_0x4666d1['lastIndexOf'](_0x1dcae1));}if(!_0x3332b7['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x3332b7);})['then'](function(_0xca2d72){if(_0xca2d72){return rp({'method':_0x4475('0x6a'),'uri':util['format'](_0x4475('0x6b'),_0x3c2ac2),'qs':{'module':_0x4475('0x6c')},'headers':{'Authorization':_0x4475('0x6d')+_0xca2d72},'json':!![]});}})[_0x4475('0x25')](function(_0xee7539){if(_0xee7539){if(_0xee7539[_0x4475('0x6e')]&&_0xee7539[_0x4475('0x6e')][_0x4475('0x6f')]){throw new Error(_0xee7539[_0x4475('0x6e')][_0x4475('0x6f')][_0x4475('0x70')]);}var _0x14e25a=[];var _0x35ba31=[];var _0x2a14f8=[_0x4475('0x71'),'Subject','Description','WhoId',_0x4475('0x72'),'Call_Result',_0x4475('0x73'),_0x4475('0x74')];_0x35ba31=_[_0x4475('0x75')](_0xee7539['fields'],function(_0x28b599){return _0x2a14f8['includes'](_0x28b599[_0x4475('0x76')]);});for(var _0x419d25=0x0;_0x419d25<_0x35ba31['length'];_0x419d25++){if(_0x35ba31[_0x419d25]['system_mandatory']===![]){_0x14e25a['push']({'id':_0x35ba31[_0x419d25]['id'],'name':_0x35ba31[_0x419d25][_0x4475('0x77')],'custom':_0x35ba31[_0x419d25][_0x4475('0x78')],'options':_0x35ba31[_0x419d25]['data_type']===_0x4475('0x79')&&_0x35ba31[_0x419d25][_0x4475('0x7a')][_0x4475('0x38')]>-0x1?_[_0x4475('0x2d')](_0x35ba31[_0x419d25]['pick_list_values'],function(_0x376173){return{'name':_0x376173,'value':_0x376173};}):[]});}}return{'count':_0x14e25a['length'],'rows':_0x14e25a};}else{return{'count':0x0,'rows':[]};}})[_0x4475('0x25')](respondWithResult(_0x3f54b9,null))[_0x4475('0x46')](function(_0x283bb5){var _0x4b6bbb=_0x151858[_0x4475('0x32')]['test']?0x1f4:_0x283bb5['statusCode']||0x1f4;logger[_0x4475('0x6f')](_0x4475('0x7b'),_0x4475('0x62'),_0x4b6bbb,JSON[_0x4475('0x7c')](_0x283bb5));delete _0x283bb5[_0x4475('0x2a')];if(_0x4b6bbb===0x191){_0x4b6bbb=0x190;}_0x3f54b9[_0x4475('0x27')](_0x4b6bbb)[_0x4475('0x2b')](_0x151858['query']['test']?{'message':_0x4475('0x7d'),'statusCode':_0x283bb5['statusCode']}:_0x283bb5);});};
\ No newline at end of file
+var _0xaacf=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','status','name','send','index','ZohoAccount','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','filter','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','code','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','stringify','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaacf,0x1f0));var _0xfaac=function(_0x29bafc,_0x519f84){_0x29bafc=_0x29bafc-0x0;var _0x17d8fa=_0xaacf[_0x29bafc];return _0x17d8fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfaac('0x0'));var zipdir=require(_0xfaac('0x1'));var jsonpatch=require(_0xfaac('0x2'));var rp=require('request-promise');var moment=require(_0xfaac('0x3'));var BPromise=require(_0xfaac('0x4'));var Mustache=require('mustache');var util=require(_0xfaac('0x5'));var path=require('path');var sox=require(_0xfaac('0x6'));var csv=require(_0xfaac('0x7'));var ejs=require(_0xfaac('0x8'));var fs=require('fs');var fs_extra=require(_0xfaac('0x9'));var _=require(_0xfaac('0xa'));var squel=require(_0xfaac('0xb'));var crypto=require(_0xfaac('0xc'));var jsforce=require(_0xfaac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfaac('0x7'));var querystring=require(_0xfaac('0xe'));var Papa=require(_0xfaac('0xf'));var Redis=require(_0xfaac('0x10'));var authService=require(_0xfaac('0x11'));var qs=require(_0xfaac('0x12'));var as=require(_0xfaac('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfaac('0x14'));var utils=require('../../config/utils');var config=require(_0xfaac('0x15'));var licenseUtil=require(_0xfaac('0x16'));var db=require(_0xfaac('0x17'))['db'];var integrations=require(_0xfaac('0x18'));function respondWithStatusCode(_0xedbe1b,_0x697bfc){_0x697bfc=_0x697bfc||0xcc;return function(_0xb9fb71){if(_0xb9fb71){return _0xedbe1b[_0xfaac('0x19')](_0x697bfc);}return _0xedbe1b['status'](_0x697bfc)[_0xfaac('0x1a')]();};}function respondWithResult(_0x113bed,_0x2fd9ab){_0x2fd9ab=_0x2fd9ab||0xc8;return function(_0x258f54){if(_0x258f54){return _0x113bed['status'](_0x2fd9ab)[_0xfaac('0x1b')](_0x258f54);}};}function respondWithFilteredResult(_0x3fef7e,_0x24e121){return function(_0x2f0e79){if(_0x2f0e79){var _0x508759=typeof _0x24e121[_0xfaac('0x1c')]===_0xfaac('0x1d')&&typeof _0x24e121[_0xfaac('0x1e')]===_0xfaac('0x1d');var _0x3b05a7=_0x2f0e79[_0xfaac('0x1f')];var _0x50be82=_0x508759?0x0:_0x24e121['offset'];var _0x49761f=_0x508759?_0x2f0e79[_0xfaac('0x1f')]:_0x24e121[_0xfaac('0x1c')]+_0x24e121[_0xfaac('0x1e')];var _0x33b51e;if(_0x49761f>=_0x3b05a7){_0x49761f=_0x3b05a7;_0x33b51e=0xc8;}else{_0x33b51e=0xce;}_0x3fef7e['status'](_0x33b51e);return _0x3fef7e[_0xfaac('0x20')](_0xfaac('0x21'),_0x50be82+'-'+_0x49761f+'/'+_0x3b05a7)[_0xfaac('0x1b')](_0x2f0e79);}return null;};}function patchUpdates(_0x313996){return function(_0x3be2bd){try{jsonpatch[_0xfaac('0x22')](_0x3be2bd,_0x313996,!![]);}catch(_0x3c2898){return BPromise['reject'](_0x3c2898);}return _0x3be2bd[_0xfaac('0x23')]();};}function saveUpdates(_0x32982d,_0x287eef){return function(_0x3c9195){if(_0x3c9195){return _0x3c9195[_0xfaac('0x24')](_0x32982d)[_0xfaac('0x25')](function(_0x5a081c){return _0x5a081c;});}return null;};}function removeEntity(_0x1c96d7,_0x9ae790){return function(_0x1d6350){if(_0x1d6350){return _0x1d6350[_0xfaac('0x26')]()['then'](function(){_0x1c96d7[_0xfaac('0x27')](0xcc)[_0xfaac('0x1a')]();});}};}function handleEntityNotFound(_0x3fbff1,_0x49448d){return function(_0x365b9e){if(!_0x365b9e){_0x3fbff1['sendStatus'](0x194);}return _0x365b9e;};}function handleError(_0x407434,_0x291f92){_0x291f92=_0x291f92||0x1f4;return function(_0x13af40){logger['error'](_0x13af40['stack']);if(_0x13af40[_0xfaac('0x28')]){delete _0x13af40['name'];}_0x407434[_0xfaac('0x27')](_0x291f92)[_0xfaac('0x29')](_0x13af40);};}exports[_0xfaac('0x2a')]=function(_0xc72396,_0x245106){var _0x5d84b3={},_0x167f2b={},_0x40c23c={'count':0x0,'rows':[]};var _0x2d96b9=_['map'](db[_0xfaac('0x2b')][_0xfaac('0x2c')],function(_0x40024e){return{'name':_0x40024e[_0xfaac('0x2d')],'type':_0x40024e[_0xfaac('0x2e')]['key']};});_0x167f2b['model']=_['map'](_0x2d96b9,_0xfaac('0x28'));_0x167f2b['query']=_[_0xfaac('0x2f')](_0xc72396[_0xfaac('0x30')]);_0x167f2b[_0xfaac('0x31')]=_[_0xfaac('0x32')](_0x167f2b[_0xfaac('0x33')],_0x167f2b['query']);_0x5d84b3[_0xfaac('0x34')]=_[_0xfaac('0x32')](_0x167f2b[_0xfaac('0x33')],qs[_0xfaac('0x35')](_0xc72396[_0xfaac('0x30')][_0xfaac('0x35')]));_0x5d84b3['attributes']=_0x5d84b3[_0xfaac('0x34')][_0xfaac('0x36')]?_0x5d84b3[_0xfaac('0x34')]:_0x167f2b[_0xfaac('0x33')];if(!_0xc72396[_0xfaac('0x30')]['hasOwnProperty'](_0xfaac('0x37'))){_0x5d84b3[_0xfaac('0x1e')]=qs[_0xfaac('0x1e')](_0xc72396[_0xfaac('0x30')][_0xfaac('0x1e')]);_0x5d84b3[_0xfaac('0x1c')]=qs[_0xfaac('0x1c')](_0xc72396[_0xfaac('0x30')][_0xfaac('0x1c')]);}_0x5d84b3[_0xfaac('0x38')]=qs['sort'](_0xc72396[_0xfaac('0x30')][_0xfaac('0x39')]);_0x5d84b3[_0xfaac('0x3a')]=qs[_0xfaac('0x31')](_[_0xfaac('0x3b')](_0xc72396[_0xfaac('0x30')],_0x167f2b['filters']),_0x2d96b9);if(_0xc72396['query']['filter']){_0x5d84b3[_0xfaac('0x3a')]=_[_0xfaac('0x3c')](_0x5d84b3[_0xfaac('0x3a')],{'$or':_[_0xfaac('0x3d')](_0x2d96b9,function(_0x5a3c7a){if(_0x5a3c7a[_0xfaac('0x2e')]!==_0xfaac('0x3e')){var _0x53c64b={};_0x53c64b[_0x5a3c7a[_0xfaac('0x28')]]={'$like':'%'+_0xc72396[_0xfaac('0x30')]['filter']+'%'};return _0x53c64b;}})});}_0x5d84b3=_[_0xfaac('0x3c')]({},_0x5d84b3,_0xc72396[_0xfaac('0x3f')]);var _0x4229cf={'where':_0x5d84b3[_0xfaac('0x3a')]};return db[_0xfaac('0x2b')]['count'](_0x4229cf)[_0xfaac('0x25')](function(_0x56e35f){_0x40c23c['count']=_0x56e35f;if(_0xc72396[_0xfaac('0x30')][_0xfaac('0x40')]){_0x5d84b3['include']=[{'all':!![]}];}return db['ZohoAccount'][_0xfaac('0x41')](_0x5d84b3);})['then'](function(_0x45ee75){_0x40c23c['rows']=_0x45ee75;return _0x40c23c;})[_0xfaac('0x25')](respondWithFilteredResult(_0x245106,_0x5d84b3))[_0xfaac('0x42')](handleError(_0x245106,null));};exports[_0xfaac('0x43')]=function(_0x198694,_0x561098){var _0x5a14d1={'raw':![],'where':{'id':_0x198694['params']['id']}},_0x177eab={};_0x177eab['model']=_[_0xfaac('0x2f')](db[_0xfaac('0x2b')][_0xfaac('0x2c')]);_0x177eab['query']=_[_0xfaac('0x2f')](_0x198694[_0xfaac('0x30')]);_0x177eab[_0xfaac('0x31')]=_[_0xfaac('0x32')](_0x177eab[_0xfaac('0x33')],_0x177eab['query']);_0x5a14d1['attributes']=_['intersection'](_0x177eab[_0xfaac('0x33')],qs[_0xfaac('0x35')](_0x198694[_0xfaac('0x30')][_0xfaac('0x35')]));_0x5a14d1['attributes']=_0x5a14d1['attributes'][_0xfaac('0x36')]?_0x5a14d1[_0xfaac('0x34')]:_0x177eab[_0xfaac('0x33')];if(_0x198694[_0xfaac('0x30')][_0xfaac('0x40')]){_0x5a14d1[_0xfaac('0x44')]=[{'all':!![]}];}_0x5a14d1=_[_0xfaac('0x3c')]({},_0x5a14d1,_0x198694[_0xfaac('0x3f')]);return db[_0xfaac('0x2b')][_0xfaac('0x45')](_0x5a14d1)['then'](handleEntityNotFound(_0x561098,null))['then'](respondWithResult(_0x561098,null))[_0xfaac('0x42')](handleError(_0x561098,null));};exports['create']=function(_0x5a3d99,_0x40e9b9){return db['ZohoAccount'][_0xfaac('0x46')](_0x5a3d99[_0xfaac('0x47')],{})[_0xfaac('0x25')](respondWithResult(_0x40e9b9,0xc9))[_0xfaac('0x42')](handleError(_0x40e9b9,null));};exports[_0xfaac('0x24')]=function(_0x32c651,_0x41c071){if(_0x32c651[_0xfaac('0x47')]['id']){delete _0x32c651['body']['id'];}return db[_0xfaac('0x2b')][_0xfaac('0x45')]({'where':{'id':_0x32c651[_0xfaac('0x48')]['id']}})[_0xfaac('0x25')](handleEntityNotFound(_0x41c071,null))[_0xfaac('0x25')](saveUpdates(_0x32c651['body'],null))[_0xfaac('0x25')](respondWithResult(_0x41c071,null))['catch'](handleError(_0x41c071,null));};exports[_0xfaac('0x26')]=function(_0x27d645,_0x5359a0){return db[_0xfaac('0x2b')][_0xfaac('0x45')]({'where':{'id':_0x27d645['params']['id']}})[_0xfaac('0x25')](handleEntityNotFound(_0x5359a0,null))[_0xfaac('0x25')](removeEntity(_0x5359a0,null))[_0xfaac('0x42')](handleError(_0x5359a0,null));};exports[_0xfaac('0x49')]=function(_0x4fe665,_0x300005,_0x7dce62){var _0x13e60c={};var _0x10b946={};var _0x3c6490;var _0x3c0bd5;return db[_0xfaac('0x2b')][_0xfaac('0x4a')]({'where':{'id':_0x4fe665[_0xfaac('0x48')]['id']}})[_0xfaac('0x25')](handleEntityNotFound(_0x300005,null))[_0xfaac('0x25')](function(_0x467125){if(_0x467125){_0x3c6490=_0x467125;_0x10b946[_0xfaac('0x33')]=_[_0xfaac('0x2f')](db[_0xfaac('0x4b')][_0xfaac('0x2c')]);_0x10b946[_0xfaac('0x30')]=_['keys'](_0x4fe665[_0xfaac('0x30')]);_0x10b946[_0xfaac('0x31')]=_[_0xfaac('0x32')](_0x10b946[_0xfaac('0x33')],_0x10b946[_0xfaac('0x30')]);_0x13e60c['attributes']=_['intersection'](_0x10b946['model'],qs[_0xfaac('0x35')](_0x4fe665[_0xfaac('0x30')][_0xfaac('0x35')]));_0x13e60c['attributes']=_0x13e60c['attributes'][_0xfaac('0x36')]?_0x13e60c[_0xfaac('0x34')]:_0x10b946[_0xfaac('0x33')];_0x13e60c[_0xfaac('0x38')]=qs[_0xfaac('0x39')](_0x4fe665[_0xfaac('0x30')][_0xfaac('0x39')]);_0x13e60c[_0xfaac('0x3a')]=qs[_0xfaac('0x31')](_[_0xfaac('0x3b')](_0x4fe665['query'],_0x10b946[_0xfaac('0x31')]));if(_0x4fe665['query']['filter']){_0x13e60c[_0xfaac('0x3a')]=_[_0xfaac('0x3c')](_0x13e60c[_0xfaac('0x3a')],{'$or':_[_0xfaac('0x3d')](_0x13e60c[_0xfaac('0x34')],function(_0x4c6f67){var _0xc957ed={};_0xc957ed[_0x4c6f67]={'$like':'%'+_0x4fe665[_0xfaac('0x30')][_0xfaac('0x4c')]+'%'};return _0xc957ed;})});}_0x13e60c=_[_0xfaac('0x3c')]({},_0x13e60c,_0x4fe665[_0xfaac('0x3f')]);return _0x3c6490[_0xfaac('0x49')](_0x13e60c);}})[_0xfaac('0x25')](function(_0x23407c){if(_0x23407c){_0x3c0bd5=_0x23407c[_0xfaac('0x36')];if(!_0x4fe665[_0xfaac('0x30')][_0xfaac('0x4d')](_0xfaac('0x37'))){_0x13e60c['limit']=qs['limit'](_0x4fe665[_0xfaac('0x30')][_0xfaac('0x1e')]);_0x13e60c['offset']=qs[_0xfaac('0x1c')](_0x4fe665[_0xfaac('0x30')][_0xfaac('0x1c')]);}return _0x3c6490[_0xfaac('0x49')](_0x13e60c);}})[_0xfaac('0x25')](function(_0x3991ba){if(_0x3991ba){return _0x3991ba?{'count':_0x3c0bd5,'rows':_0x3991ba}:null;}})['then'](respondWithResult(_0x300005,null))[_0xfaac('0x42')](handleError(_0x300005,null));};exports[_0xfaac('0x4e')]=function(_0x2922cd,_0x7ae79a,_0x4374d3){if(_0x2922cd['body']['id']){delete _0x2922cd['body']['id'];}return db[_0xfaac('0x2b')][_0xfaac('0x4a')]({'where':{'id':_0x2922cd['params']['id']}})[_0xfaac('0x25')](handleEntityNotFound(_0x7ae79a,null))[_0xfaac('0x25')](function(_0x224109){if(_0x224109){_0x2922cd[_0xfaac('0x47')][_0xfaac('0x4f')]=_0x224109['id'];_0x2922cd['body'][_0xfaac('0x50')]=integrations[_0xfaac('0x51')](_0x2922cd[_0xfaac('0x47')][_0xfaac('0x52')],_0x2922cd[_0xfaac('0x47')][_0xfaac('0x2e')]);_0x2922cd[_0xfaac('0x47')][_0xfaac('0x53')]=integrations[_0xfaac('0x54')](_0x2922cd[_0xfaac('0x47')][_0xfaac('0x52')],_0x2922cd['body'][_0xfaac('0x2e')]);return db[_0xfaac('0x4b')][_0xfaac('0x46')](_0x2922cd['body'],{'include':[{'model':db[_0xfaac('0x55')],'as':_0xfaac('0x50')},{'model':db['ZohoField'],'as':_0xfaac('0x53')}]});}return null;})[_0xfaac('0x25')](respondWithResult(_0x7ae79a,null))['catch'](handleError(_0x7ae79a,null));};function getAccessToken(_0x5cbcb0){return new Promise(function(_0x626ba2,_0x727342){var _0x8633e;switch(_0x5cbcb0[_0xfaac('0x56')]){case'US':_0x8633e=_0xfaac('0x57');break;case'AU':_0x8633e=_0xfaac('0x58');break;case'EU':_0x8633e='https://accounts.zoho.eu';break;case'IN':_0x8633e=_0xfaac('0x59');break;case'CN':_0x8633e='https://accounts.zoho.com.cn';break;default:_0x8633e=_0xfaac('0x5a');break;}var _0x1b0061={'method':'POST','uri':_0x8633e+_0xfaac('0x5b'),'qs':{'refresh_token':_0x5cbcb0[_0xfaac('0x5c')],'client_id':_0x5cbcb0[_0xfaac('0x5d')],'client_secret':_0x5cbcb0[_0xfaac('0x5e')],'grant_type':_0xfaac('0x5f')},'json':!![]};return rp(_0x1b0061)[_0xfaac('0x25')](function(_0x4b8807){if(_0x4b8807[_0xfaac('0x60')]){_0x626ba2(_0x4b8807[_0xfaac('0x60')]);}else{_0x727342('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x2ff9b0){_0x727342(_0x2ff9b0);});});}exports[_0xfaac('0x61')]=function(_0x1ce876,_0x2b0132,_0x545518){var _0x1f22bc,_0x50a752,_0x28df8d,_0x4ca90e,_0xc9ebe9;return db[_0xfaac('0x2b')][_0xfaac('0x4a')]({'where':{'id':_0x1ce876[_0xfaac('0x48')]['id']},'attributes':['id',_0xfaac('0x62'),_0xfaac('0x56'),_0xfaac('0x5d'),_0xfaac('0x5e'),'serverUrl',_0xfaac('0x63'),_0xfaac('0x5c')]})[_0xfaac('0x25')](handleEntityNotFound(_0x2b0132,null))[_0xfaac('0x25')](function(_0x12fb87){_0xc9ebe9=_0x12fb87;_0x1f22bc=_0xc9ebe9['host'];_0x50a752=_0x1f22bc==='zoho.eu'?'eu':_0xfaac('0x64');_0x28df8d=_0xc9ebe9[_0xfaac('0x65')];var _0x3af424=_0x28df8d[_0xfaac('0x66')](-0x1);if(_0x3af424==='/'||_0x3af424==='\x5c'||_0x3af424===':'){_0x28df8d=_0x28df8d[_0xfaac('0x67')](0x0,_0x28df8d[_0xfaac('0x68')](_0x3af424));}if(!_0xc9ebe9['refreshToken']){throw new Error(_0xfaac('0x69'));}return getAccessToken(_0xc9ebe9);})['then'](function(_0x3253d3){if(_0x3253d3){return rp({'method':_0xfaac('0x6a'),'uri':util[_0xfaac('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x50a752),'qs':{'module':_0xfaac('0x6c')},'headers':{'Authorization':_0xfaac('0x6d')+_0x3253d3},'json':!![]});}})[_0xfaac('0x25')](function(_0x3def29){if(_0x3def29){if(_0x3def29[_0xfaac('0x6e')]&&_0x3def29[_0xfaac('0x6e')][_0xfaac('0x6f')]){throw new Error(_0x3def29[_0xfaac('0x6e')][_0xfaac('0x6f')][_0xfaac('0x70')]);}var _0x3b818e=[];var _0x257ec2=[];var _0x2e2d3a=[_0xfaac('0x71'),_0xfaac('0x72'),_0xfaac('0x73'),_0xfaac('0x74'),_0xfaac('0x75'),_0xfaac('0x76'),_0xfaac('0x77'),_0xfaac('0x78')];_0x257ec2=_['remove'](_0x3def29[_0xfaac('0x35')],function(_0x4c0690){return _0x2e2d3a[_0xfaac('0x79')](_0x4c0690[_0xfaac('0x7a')]);});for(var _0x4dc3cb=0x0;_0x4dc3cb<_0x257ec2[_0xfaac('0x36')];_0x4dc3cb++){if(_0x257ec2[_0x4dc3cb]['system_mandatory']===![]){_0x3b818e[_0xfaac('0x7b')]({'id':_0x257ec2[_0x4dc3cb]['id'],'name':_0x257ec2[_0x4dc3cb][_0xfaac('0x7c')],'custom':_0x257ec2[_0x4dc3cb][_0xfaac('0x7d')],'options':_0x257ec2[_0x4dc3cb][_0xfaac('0x7e')]===_0xfaac('0x7f')&&_0x257ec2[_0x4dc3cb][_0xfaac('0x80')][_0xfaac('0x36')]>-0x1?_[_0xfaac('0x3d')](_0x257ec2[_0x4dc3cb][_0xfaac('0x80')],function(_0x43ec1a){return{'name':_0x43ec1a,'value':_0x43ec1a};}):[]});}}return{'count':_0x3b818e[_0xfaac('0x36')],'rows':_0x3b818e};}else{return{'count':0x0,'rows':[]};}})[_0xfaac('0x25')](respondWithResult(_0x2b0132,null))[_0xfaac('0x42')](function(_0x2444ee){var _0x53890b=_0x1ce876[_0xfaac('0x30')][_0xfaac('0x81')]?0x1f4:_0x2444ee['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xfaac('0x61'),_0x53890b,JSON[_0xfaac('0x82')](_0x2444ee));delete _0x2444ee[_0xfaac('0x28')];if(_0x53890b===0x191){_0x53890b=0x190;}_0x2b0132[_0xfaac('0x27')](_0x53890b)[_0xfaac('0x29')](_0x1ce876[_0xfaac('0x30')][_0xfaac('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x2444ee['statusCode']}:_0x2444ee);});};
\ No newline at end of file
index f2d0b4a..0ddeb6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73bd=['define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','clientSecret','code','serverUrl','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.cn','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x31eb98,_0x592fa2){var _0x20cf3e=function(_0x5e30b1){while(--_0x5e30b1){_0x31eb98['push'](_0x31eb98['shift']());}};_0x20cf3e(++_0x592fa2);}(_0x73bd,0x1c5));var _0xd73b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x73bd[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xd73b('0x0'));var logger=require(_0xd73b('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd73b('0x2'));var rp=require(_0xd73b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd73b('0x4'));var config=require(_0xd73b('0x5'));var attributes=require(_0xd73b('0x6'));var integrations=require(_0xd73b('0x7'));module[_0xd73b('0x8')]=function(_0x397d94,_0x5c069b){return _0x397d94[_0xd73b('0x9')](_0xd73b('0xa'),attributes,{'tableName':_0xd73b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x374965,_0x5cfab2,_0x27a8c0){if(_0x374965['changed'](_0xd73b('0xc'))||_0x374965[_0xd73b('0xd')]('serverUrl')||_0x374965['changed'](_0xd73b('0xe'))||_0x374965[_0xd73b('0xd')](_0xd73b('0xf'))||_0x374965[_0xd73b('0xd')](_0xd73b('0x10'))||_0x374965[_0xd73b('0xd')]('host')){var _0x193c60,_0x474a24;_0x193c60=_0x374965[_0xd73b('0x11')];var _0x10b8e7=_0x193c60[_0xd73b('0x12')](-0x1);if(_0x10b8e7==='/'||_0x10b8e7==='\x5c'||_0x10b8e7===':'){_0x193c60=_0x193c60[_0xd73b('0x13')](0x0,_0x193c60['lastIndexOf'](_0x10b8e7));}switch(_0x374965[_0xd73b('0xc')]){case'US':_0x474a24='https://accounts.zoho.com';break;case'AU':_0x474a24=_0xd73b('0x14');break;case'IN':_0x474a24=_0xd73b('0x15');break;case'CN':_0x474a24='https://accounts.zoho.com.cn';break;default:_0x474a24=_0xd73b('0x16');break;}var _0x2df5bb={'method':_0xd73b('0x17'),'uri':_0x474a24+_0xd73b('0x18'),'form':{'grant_type':_0xd73b('0x19'),'client_id':_0x374965[_0xd73b('0xe')],'client_secret':_0x374965[_0xd73b('0xf')],'redirect_uri':_0x374965['serverUrl'],'code':_0x374965['code']},'headers':{'Content-Type':_0xd73b('0x1a')}};return rp(_0x2df5bb)['then'](function(_0x5db673){var _0x2e780f=JSON[_0xd73b('0x1b')](_0x5db673);if(_0x2e780f[_0xd73b('0x1c')]){_0x374965[_0xd73b('0x1d')]=_0x2e780f['refresh_token'];logger[_0xd73b('0x1e')](util['format'](_0xd73b('0x1f'),_0x374965['name'],_0x374965['id']));}else{logger[_0xd73b('0x20')](util[_0xd73b('0x21')](_0xd73b('0x22'),_0x374965[_0xd73b('0x23')],_0x374965['id']),util[_0xd73b('0x24')](_0x2e780f,{'showHidden':![],'depth':null}));}return _0x27a8c0(null,_0x5cfab2);})[_0xd73b('0x25')](function(_0x2bf25f){logger[_0xd73b('0x20')](util[_0xd73b('0x21')](_0xd73b('0x22'),_0x374965[_0xd73b('0x23')],_0x374965['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x27a8c0(_0x2bf25f);});}else{return _0x27a8c0(null,_0x5cfab2);}},'beforeUpdate':function(_0x39c453,_0x146428,_0xe7b629){if(_0x39c453[_0xd73b('0xd')](_0xd73b('0xc'))||_0x39c453[_0xd73b('0xd')](_0xd73b('0x11'))||_0x39c453[_0xd73b('0xd')](_0xd73b('0xe'))||_0x39c453[_0xd73b('0xd')]('clientSecret')||_0x39c453[_0xd73b('0xd')](_0xd73b('0x10'))||_0x39c453['changed'](_0xd73b('0x26'))){var _0x482656,_0x447522;_0x482656=_0x39c453[_0xd73b('0x11')];var _0x17ac3d=_0x482656[_0xd73b('0x12')](-0x1);if(_0x17ac3d==='/'||_0x17ac3d==='\x5c'||_0x17ac3d===':'){_0x482656=_0x482656['substring'](0x0,_0x482656[_0xd73b('0x27')](_0x17ac3d));}switch(_0x39c453[_0xd73b('0xc')]){case'US':_0x447522=_0xd73b('0x28');break;case'AU':_0x447522=_0xd73b('0x14');break;case'IN':_0x447522='https://accounts.zoho.in';break;case'CN':_0x447522=_0xd73b('0x29');break;default:_0x447522=_0xd73b('0x16');break;}var _0x28ba98={'method':'POST','uri':_0x447522+_0xd73b('0x18'),'form':{'grant_type':_0xd73b('0x19'),'client_id':_0x39c453[_0xd73b('0xe')],'client_secret':_0x39c453[_0xd73b('0xf')],'redirect_uri':_0x39c453[_0xd73b('0x11')],'code':_0x39c453[_0xd73b('0x10')]},'headers':{'Content-Type':_0xd73b('0x1a')}};return rp(_0x28ba98)['then'](function(_0x3c70c5){var _0x270e09=JSON[_0xd73b('0x1b')](_0x3c70c5);if(_0x270e09['refresh_token']){_0x39c453[_0xd73b('0x1d')]=_0x270e09[_0xd73b('0x1c')];logger[_0xd73b('0x1e')](util[_0xd73b('0x21')](_0xd73b('0x1f'),_0x39c453[_0xd73b('0x23')],_0x39c453['id']));}else{logger[_0xd73b('0x20')](util[_0xd73b('0x21')](_0xd73b('0x22'),_0x39c453[_0xd73b('0x23')],_0x39c453['id']),util[_0xd73b('0x24')](_0x270e09,{'showHidden':![],'depth':null}));}return _0xe7b629(null,_0x146428);})[_0xd73b('0x25')](function(_0x326892){logger[_0xd73b('0x20')](util[_0xd73b('0x21')](_0xd73b('0x22'),_0x39c453[_0xd73b('0x23')],_0x39c453['id']),util[_0xd73b('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0xe7b629(_0x326892);});}else{return _0xe7b629(null,_0x146428);}}}});};
\ No newline at end of file
+var _0xf688=['ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','code','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','api','moment','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','name','format'];(function(_0x4f321c,_0x27505a){var _0x27f506=function(_0x17d3c5){while(--_0x17d3c5){_0x4f321c['push'](_0x4f321c['shift']());}};_0x27f506(++_0x27505a);}(_0xf688,0x1b6));var _0x8f68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf688[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8f68('0x0'));var util=require(_0x8f68('0x1'));var logger=require('../../config/logger')(_0x8f68('0x2'));var moment=require(_0x8f68('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f68('0x4'));var fs=require('fs');var path=require(_0x8f68('0x5'));var rimraf=require('rimraf');var config=require(_0x8f68('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x8f68('0x7'));module[_0x8f68('0x8')]=function(_0x45c47b,_0x255a6e){return _0x45c47b['define'](_0x8f68('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3470a9,_0x1c399e,_0xe0b2e7){if(_0x3470a9[_0x8f68('0xa')](_0x8f68('0xb'))||_0x3470a9[_0x8f68('0xa')](_0x8f68('0xc'))||_0x3470a9[_0x8f68('0xa')](_0x8f68('0xd'))||_0x3470a9['changed'](_0x8f68('0xe'))||_0x3470a9[_0x8f68('0xa')]('code')||_0x3470a9[_0x8f68('0xa')](_0x8f68('0xf'))){var _0x37f262,_0x232bec;_0x37f262=_0x3470a9[_0x8f68('0xc')];var _0x14344a=_0x37f262[_0x8f68('0x10')](-0x1);if(_0x14344a==='/'||_0x14344a==='\x5c'||_0x14344a===':'){_0x37f262=_0x37f262[_0x8f68('0x11')](0x0,_0x37f262[_0x8f68('0x12')](_0x14344a));}switch(_0x3470a9[_0x8f68('0xb')]){case'US':_0x232bec='https://accounts.zoho.com';break;case'AU':_0x232bec='https://accounts.zoho.com.au';break;case'IN':_0x232bec=_0x8f68('0x13');break;case'CN':_0x232bec=_0x8f68('0x14');break;default:_0x232bec='https://accounts.zoho.eu';break;}var _0x23cb3e={'method':'POST','uri':_0x232bec+_0x8f68('0x15'),'form':{'grant_type':_0x8f68('0x16'),'client_id':_0x3470a9[_0x8f68('0xd')],'client_secret':_0x3470a9[_0x8f68('0xe')],'redirect_uri':_0x3470a9[_0x8f68('0xc')],'code':_0x3470a9['code']},'headers':{'Content-Type':_0x8f68('0x17')}};return rp(_0x23cb3e)[_0x8f68('0x18')](function(_0x4d7005){var _0x558927=JSON['parse'](_0x4d7005);if(_0x558927[_0x8f68('0x19')]){_0x3470a9[_0x8f68('0x1a')]=_0x558927['refresh_token'];logger[_0x8f68('0x1b')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3470a9[_0x8f68('0x1c')],_0x3470a9['id']));}else{logger['error'](util[_0x8f68('0x1d')](_0x8f68('0x1e'),_0x3470a9[_0x8f68('0x1c')],_0x3470a9['id']),util[_0x8f68('0x1f')](_0x558927,{'showHidden':![],'depth':null}));}return _0xe0b2e7(null,_0x1c399e);})[_0x8f68('0x20')](function(_0x676ae6){logger[_0x8f68('0x21')](util[_0x8f68('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3470a9['name'],_0x3470a9['id']),util[_0x8f68('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0xe0b2e7(_0x676ae6);});}else{return _0xe0b2e7(null,_0x1c399e);}},'beforeUpdate':function(_0x61cbf0,_0x265c2c,_0x38cca0){if(_0x61cbf0[_0x8f68('0xa')](_0x8f68('0xb'))||_0x61cbf0[_0x8f68('0xa')](_0x8f68('0xc'))||_0x61cbf0[_0x8f68('0xa')](_0x8f68('0xd'))||_0x61cbf0[_0x8f68('0xa')](_0x8f68('0xe'))||_0x61cbf0[_0x8f68('0xa')](_0x8f68('0x22'))||_0x61cbf0[_0x8f68('0xa')](_0x8f68('0xf'))){var _0xb78e84,_0x1f8715;_0xb78e84=_0x61cbf0['serverUrl'];var _0x53c1f3=_0xb78e84[_0x8f68('0x10')](-0x1);if(_0x53c1f3==='/'||_0x53c1f3==='\x5c'||_0x53c1f3===':'){_0xb78e84=_0xb78e84[_0x8f68('0x11')](0x0,_0xb78e84[_0x8f68('0x12')](_0x53c1f3));}switch(_0x61cbf0[_0x8f68('0xb')]){case'US':_0x1f8715=_0x8f68('0x23');break;case'AU':_0x1f8715=_0x8f68('0x24');break;case'IN':_0x1f8715=_0x8f68('0x13');break;case'CN':_0x1f8715=_0x8f68('0x14');break;default:_0x1f8715=_0x8f68('0x25');break;}var _0x3a1c45={'method':'POST','uri':_0x1f8715+_0x8f68('0x15'),'form':{'grant_type':_0x8f68('0x16'),'client_id':_0x61cbf0[_0x8f68('0xd')],'client_secret':_0x61cbf0['clientSecret'],'redirect_uri':_0x61cbf0[_0x8f68('0xc')],'code':_0x61cbf0[_0x8f68('0x22')]},'headers':{'Content-Type':_0x8f68('0x17')}};return rp(_0x3a1c45)[_0x8f68('0x18')](function(_0x22ba68){var _0xaad476=JSON['parse'](_0x22ba68);if(_0xaad476['refresh_token']){_0x61cbf0['refreshToken']=_0xaad476[_0x8f68('0x19')];logger['info'](util['format'](_0x8f68('0x26'),_0x61cbf0[_0x8f68('0x1c')],_0x61cbf0['id']));}else{logger['error'](util[_0x8f68('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x61cbf0[_0x8f68('0x1c')],_0x61cbf0['id']),util['inspect'](_0xaad476,{'showHidden':![],'depth':null}));}return _0x38cca0(null,_0x265c2c);})[_0x8f68('0x20')](function(_0x3548bf){logger['error'](util[_0x8f68('0x1d')](_0x8f68('0x1e'),_0x61cbf0[_0x8f68('0x1c')],_0x61cbf0['id']),util[_0x8f68('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x38cca0(_0x3548bf);});}else{return _0x38cca0(null,_0x265c2c);}}}});};
\ No newline at end of file
index 55ae1a4..0c03edf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4efb=['ShowZohoAccount','map','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','model'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4efb,0xfa));var _0xb4ef=function(_0x3f2771,_0x28e61d){_0x3f2771=_0x3f2771-0x0;var _0x30f930=_0x4efb[_0x3f2771];return _0x30f930;};'use strict';var _=require('lodash');var util=require(_0xb4ef('0x0'));var moment=require(_0xb4ef('0x1'));var BPromise=require(_0xb4ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4ef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4ef('0x4'));var logger=require(_0xb4ef('0x5'))('rpc');var config=require(_0xb4ef('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb4ef('0x7')][_0xb4ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x446019,_0x32bf0e,_0x863531){return new BPromise(function(_0x4cbb88,_0x1a1a33){return client[_0xb4ef('0x9')](_0x446019,_0x863531)[_0xb4ef('0xa')](function(_0x19d132){logger[_0xb4ef('0xb')](_0xb4ef('0xc'),_0x32bf0e,'request\x20sent');logger[_0xb4ef('0xd')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x32bf0e,_0xb4ef('0xe'),JSON[_0xb4ef('0xf')](_0x19d132));if(_0x19d132[_0xb4ef('0x10')]){if(_0x19d132['error'][_0xb4ef('0x11')]===0x1f4){logger[_0xb4ef('0x10')](_0xb4ef('0xc'),_0x32bf0e,_0x19d132[_0xb4ef('0x10')][_0xb4ef('0x12')]);return _0x1a1a33(_0x19d132[_0xb4ef('0x10')]['message']);}logger[_0xb4ef('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x32bf0e,_0x19d132[_0xb4ef('0x10')][_0xb4ef('0x12')]);return _0x4cbb88(_0x19d132[_0xb4ef('0x10')][_0xb4ef('0x12')]);}else{logger[_0xb4ef('0xb')](_0xb4ef('0xc'),_0x32bf0e,_0xb4ef('0xe'));_0x4cbb88(_0x19d132['result'][_0xb4ef('0x12')]);}})[_0xb4ef('0x13')](function(_0x3cb21e){logger[_0xb4ef('0x10')](_0xb4ef('0xc'),_0x32bf0e,_0x3cb21e);_0x1a1a33(_0x3cb21e);});});}exports[_0xb4ef('0x14')]=function(_0x560347){var _0x1d8bca=this;return new Promise(function(_0x21e34e,_0x3806b7){return db[_0xb4ef('0x15')][_0xb4ef('0x16')]({'raw':_0x560347[_0xb4ef('0x17')]?_0x560347[_0xb4ef('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x560347[_0xb4ef('0x17')]?_0x560347['options'][_0xb4ef('0x18')]||null:null,'attributes':_0x560347[_0xb4ef('0x17')]?_0x560347[_0xb4ef('0x17')][_0xb4ef('0x19')]||null:null,'limit':_0x560347[_0xb4ef('0x17')]?_0x560347[_0xb4ef('0x17')][_0xb4ef('0x1a')]||null:null,'include':_0x560347[_0xb4ef('0x17')]?_0x560347[_0xb4ef('0x17')][_0xb4ef('0x1b')]?_['map'](_0x560347[_0xb4ef('0x17')][_0xb4ef('0x1b')],function(_0x4eb797){return{'model':db[_0x4eb797[_0xb4ef('0x1c')]],'as':_0x4eb797['as'],'attributes':_0x4eb797['attributes'],'include':_0x4eb797[_0xb4ef('0x1b')]?_['map'](_0x4eb797[_0xb4ef('0x1b')],function(_0x4b702d){return{'model':db[_0x4b702d[_0xb4ef('0x1c')]],'as':_0x4b702d['as'],'attributes':_0x4b702d[_0xb4ef('0x19')],'include':_0x4b702d['include']?_['map'](_0x4b702d[_0xb4ef('0x1b')],function(_0x20931f){return{'model':db[_0x20931f[_0xb4ef('0x1c')]],'as':_0x20931f['as'],'attributes':_0x20931f[_0xb4ef('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb4ef('0xa')](function(_0x594747){logger[_0xb4ef('0xb')]('GetZohoAccount',_0x560347);logger[_0xb4ef('0xd')](_0xb4ef('0x14'),_0x560347,JSON['stringify'](_0x594747));_0x21e34e(_0x594747);})[_0xb4ef('0x13')](function(_0x2a5f05){logger[_0xb4ef('0x10')]('GetZohoAccount',_0x2a5f05['message'],_0x560347);_0x3806b7(_0x1d8bca[_0xb4ef('0x10')](0x1f4,_0x2a5f05[_0xb4ef('0x12')]));});});};exports[_0xb4ef('0x1d')]=function(_0x4db567){var _0x36e27c=this;return new Promise(function(_0x465f91,_0x31c331){return db[_0xb4ef('0x15')]['find']({'raw':_0x4db567[_0xb4ef('0x17')]?_0x4db567[_0xb4ef('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4db567[_0xb4ef('0x17')]?_0x4db567['options'][_0xb4ef('0x18')]||null:null,'attributes':_0x4db567[_0xb4ef('0x17')]?_0x4db567[_0xb4ef('0x17')][_0xb4ef('0x19')]||null:null,'include':_0x4db567[_0xb4ef('0x17')]?_0x4db567[_0xb4ef('0x17')]['include']?_[_0xb4ef('0x1e')](_0x4db567[_0xb4ef('0x17')][_0xb4ef('0x1b')],function(_0x3de3b7){return{'model':db[_0x3de3b7['model']],'as':_0x3de3b7['as'],'attributes':_0x3de3b7[_0xb4ef('0x19')],'include':_0x3de3b7['include']?_[_0xb4ef('0x1e')](_0x3de3b7[_0xb4ef('0x1b')],function(_0x248f8e){return{'model':db[_0x248f8e['model']],'as':_0x248f8e['as'],'attributes':_0x248f8e[_0xb4ef('0x19')],'include':_0x248f8e[_0xb4ef('0x1b')]?_[_0xb4ef('0x1e')](_0x248f8e[_0xb4ef('0x1b')],function(_0x598819){return{'model':db[_0x598819[_0xb4ef('0x1c')]],'as':_0x598819['as'],'attributes':_0x598819[_0xb4ef('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb4ef('0xa')](function(_0x33299a){logger[_0xb4ef('0xb')]('ShowZohoAccount',_0x4db567);logger[_0xb4ef('0xd')](_0xb4ef('0x1d'),_0x4db567,JSON[_0xb4ef('0xf')](_0x33299a));_0x465f91(_0x33299a);})[_0xb4ef('0x13')](function(_0x3e02e4){logger['error']('ShowZohoAccount',_0x3e02e4['message'],_0x4db567);_0x31c331(_0x36e27c[_0xb4ef('0x10')](0x1f4,_0x3e02e4['message']));});});};
\ No newline at end of file
+var _0x4910=['attributes','include','model','map','ShowZohoAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','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','findAll','raw','options','where'];(function(_0x118da4,_0x2e192e){var _0x40dfbb=function(_0x43b165){while(--_0x43b165){_0x118da4['push'](_0x118da4['shift']());}};_0x40dfbb(++_0x2e192e);}(_0x4910,0x1d9));var _0x0491=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4910[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27e7d5,_0x4ba9e5,_0x3b7b10){return new BPromise(function(_0x29c0d0,_0xf50a53){return client[_0x0491('0xc')](_0x27e7d5,_0x3b7b10)[_0x0491('0xd')](function(_0x4822d5){logger[_0x0491('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4ba9e5,_0x0491('0xf'));logger[_0x0491('0x10')](_0x0491('0x11'),_0x4ba9e5,_0x0491('0xf'),JSON[_0x0491('0x12')](_0x4822d5));if(_0x4822d5[_0x0491('0x13')]){if(_0x4822d5[_0x0491('0x13')][_0x0491('0x14')]===0x1f4){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x4822d5['error'][_0x0491('0x16')]);return _0xf50a53(_0x4822d5['error'][_0x0491('0x16')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4ba9e5,_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);return _0x29c0d0(_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);}else{logger[_0x0491('0xe')](_0x0491('0x15'),_0x4ba9e5,_0x0491('0xf'));_0x29c0d0(_0x4822d5[_0x0491('0x17')][_0x0491('0x16')]);}})[_0x0491('0x18')](function(_0x527415){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x527415);_0xf50a53(_0x527415);});});}exports[_0x0491('0x19')]=function(_0x31bc2c){var _0x3b536e=this;return new Promise(function(_0xc02328,_0x4ba009){return db[_0x0491('0x1a')][_0x0491('0x1b')]({'raw':_0x31bc2c['options']?_0x31bc2c['options'][_0x0491('0x1c')]===undefined?!![]:![]:!![],'where':_0x31bc2c['options']?_0x31bc2c[_0x0491('0x1d')][_0x0491('0x1e')]||null:null,'attributes':_0x31bc2c['options']?_0x31bc2c[_0x0491('0x1d')][_0x0491('0x1f')]||null:null,'limit':_0x31bc2c[_0x0491('0x1d')]?_0x31bc2c[_0x0491('0x1d')]['limit']||null:null,'include':_0x31bc2c[_0x0491('0x1d')]?_0x31bc2c[_0x0491('0x1d')][_0x0491('0x20')]?_['map'](_0x31bc2c[_0x0491('0x1d')][_0x0491('0x20')],function(_0x31c4ba){return{'model':db[_0x31c4ba[_0x0491('0x21')]],'as':_0x31c4ba['as'],'attributes':_0x31c4ba[_0x0491('0x1f')],'include':_0x31c4ba[_0x0491('0x20')]?_[_0x0491('0x22')](_0x31c4ba['include'],function(_0x7c03ef){return{'model':db[_0x7c03ef[_0x0491('0x21')]],'as':_0x7c03ef['as'],'attributes':_0x7c03ef[_0x0491('0x1f')],'include':_0x7c03ef[_0x0491('0x20')]?_[_0x0491('0x22')](_0x7c03ef['include'],function(_0x12ebdb){return{'model':db[_0x12ebdb[_0x0491('0x21')]],'as':_0x12ebdb['as'],'attributes':_0x12ebdb[_0x0491('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0491('0xd')](function(_0xe0e31e){logger[_0x0491('0xe')](_0x0491('0x19'),_0x31bc2c);logger[_0x0491('0x10')](_0x0491('0x19'),_0x31bc2c,JSON[_0x0491('0x12')](_0xe0e31e));_0xc02328(_0xe0e31e);})['catch'](function(_0x4fbeb8){logger['error']('GetZohoAccount',_0x4fbeb8[_0x0491('0x16')],_0x31bc2c);_0x4ba009(_0x3b536e['error'](0x1f4,_0x4fbeb8[_0x0491('0x16')]));});});};exports[_0x0491('0x23')]=function(_0x3b66d0){var _0x7d4feb=this;return new Promise(function(_0x2e3223,_0x18278b){return db[_0x0491('0x1a')]['find']({'raw':_0x3b66d0[_0x0491('0x1d')]?_0x3b66d0[_0x0491('0x1d')][_0x0491('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b66d0[_0x0491('0x1d')]?_0x3b66d0['options']['where']||null:null,'attributes':_0x3b66d0['options']?_0x3b66d0[_0x0491('0x1d')]['attributes']||null:null,'include':_0x3b66d0[_0x0491('0x1d')]?_0x3b66d0[_0x0491('0x1d')][_0x0491('0x20')]?_[_0x0491('0x22')](_0x3b66d0[_0x0491('0x1d')][_0x0491('0x20')],function(_0x17b4ee){return{'model':db[_0x17b4ee[_0x0491('0x21')]],'as':_0x17b4ee['as'],'attributes':_0x17b4ee['attributes'],'include':_0x17b4ee[_0x0491('0x20')]?_['map'](_0x17b4ee[_0x0491('0x20')],function(_0x16ef85){return{'model':db[_0x16ef85['model']],'as':_0x16ef85['as'],'attributes':_0x16ef85[_0x0491('0x1f')],'include':_0x16ef85['include']?_[_0x0491('0x22')](_0x16ef85[_0x0491('0x20')],function(_0x404b74){return{'model':db[_0x404b74[_0x0491('0x21')]],'as':_0x404b74['as'],'attributes':_0x404b74['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bff9c){logger[_0x0491('0xe')](_0x0491('0x23'),_0x3b66d0);logger['debug'](_0x0491('0x23'),_0x3b66d0,JSON['stringify'](_0x2bff9c));_0x2e3223(_0x2bff9c);})[_0x0491('0x18')](function(_0x524387){logger[_0x0491('0x13')](_0x0491('0x23'),_0x524387[_0x0491('0x16')],_0x3b66d0);_0x18278b(_0x7d4feb['error'](0x1f4,_0x524387['message']));});});};
\ No newline at end of file
index 814af06..0609c3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x297b=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/descriptions','post','create','put','update','delete','/:id','destroy','path'];(function(_0x3cfaa7,_0xf5a4c6){var _0x2501fb=function(_0x2b4017){while(--_0x2b4017){_0x3cfaa7['push'](_0x3cfaa7['shift']());}};_0x2501fb(++_0xf5a4c6);}(_0x297b,0x7d));var _0xb297=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x297b[_0x119d5a];return _0x15bff4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb297('0x0'));var timeout=require(_0xb297('0x1'));var express=require(_0xb297('0x2'));var router=express['Router']();var fs_extra=require(_0xb297('0x3'));var auth=require(_0xb297('0x4'));var interaction=require(_0xb297('0x5'));var config=require('../../config/environment');var controller=require(_0xb297('0x6'));router[_0xb297('0x7')]('/',auth[_0xb297('0x8')](),controller[_0xb297('0x9')]);router['get']('/:id',auth[_0xb297('0x8')](),controller[_0xb297('0xa')]);router[_0xb297('0x7')](_0xb297('0xb'),auth['isAuthenticated'](),controller[_0xb297('0xc')]);router[_0xb297('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xb297('0x7')](_0xb297('0xd'),auth[_0xb297('0x8')](),controller['getDescriptions']);router[_0xb297('0xe')]('/',auth[_0xb297('0x8')](),controller[_0xb297('0xf')]);router[_0xb297('0x10')]('/:id',auth[_0xb297('0x8')](),controller[_0xb297('0x11')]);router[_0xb297('0x12')](_0xb297('0x13'),auth[_0xb297('0x8')](),controller[_0xb297('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x360e=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4e9e4b,_0x9e3236){var _0x2eb8f3=function(_0x49683e){while(--_0x49683e){_0x4e9e4b['push'](_0x4e9e4b['shift']());}};_0x2eb8f3(++_0x9e3236);}(_0x360e,0x1c5));var _0xe360=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x360e[_0x5a5395];return _0x4da43d;};'use strict';var multer=require(_0xe360('0x0'));var util=require(_0xe360('0x1'));var path=require(_0xe360('0x2'));var timeout=require(_0xe360('0x3'));var express=require(_0xe360('0x4'));var router=express[_0xe360('0x5')]();var fs_extra=require(_0xe360('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe360('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0xe360('0x8')]('/',auth[_0xe360('0x9')](),controller[_0xe360('0xa')]);router['get'](_0xe360('0xb'),auth['isAuthenticated'](),controller[_0xe360('0xc')]);router[_0xe360('0x8')](_0xe360('0xd'),auth[_0xe360('0x9')](),controller[_0xe360('0xe')]);router[_0xe360('0x8')]('/:id/subjects',auth[_0xe360('0x9')](),controller[_0xe360('0xf')]);router['get'](_0xe360('0x10'),auth[_0xe360('0x9')](),controller['getDescriptions']);router[_0xe360('0x11')]('/',auth[_0xe360('0x9')](),controller['create']);router[_0xe360('0x12')](_0xe360('0xb'),auth[_0xe360('0x9')](),controller[_0xe360('0x13')]);router[_0xe360('0x14')]('/:id',auth[_0xe360('0x9')](),controller[_0xe360('0x15')]);module[_0xe360('0x16')]=router;
\ No newline at end of file
index 8bf68c4..6249c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe613=['STRING','lead','contact','nothing','ENUM','contact_lead','exports'];(function(_0x275ce1,_0x48bf66){var _0x3bcd4d=function(_0x1c7ff6){while(--_0x1c7ff6){_0x275ce1['push'](_0x275ce1['shift']());}};_0x3bcd4d(++_0x48bf66);}(_0xe613,0x7d));var _0x3e61=function(_0x5b93fa,_0x440a8f){_0x5b93fa=_0x5b93fa-0x0;var _0x97f5f4=_0xe613[_0x5b93fa];return _0x97f5f4;};'use strict';var Sequelize=require('sequelize');module[_0x3e61('0x0')]={'name':{'type':Sequelize[_0x3e61('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x3e61('0x2'),_0x3e61('0x3'),_0x3e61('0x4')),'defaultValue':_0x3e61('0x2')},'moduleSearch':{'type':Sequelize[_0x3e61('0x5')](_0x3e61('0x6'),'contact',_0x3e61('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x3e61('0x1')]}};
\ No newline at end of file
+var _0x7d2f=['exports','STRING','ENUM','contact_lead','contact','lead'];(function(_0x2402f7,_0x4feadf){var _0x4ab190=function(_0x35e9de){while(--_0x35e9de){_0x2402f7['push'](_0x2402f7['shift']());}};_0x4ab190(++_0x4feadf);}(_0x7d2f,0xba));var _0xf7d2=function(_0x550434,_0x54c359){_0x550434=_0x550434-0x0;var _0x4efa3a=_0x7d2f[_0x550434];return _0x4efa3a;};'use strict';var Sequelize=require('sequelize');module[_0xf7d2('0x0')]={'name':{'type':Sequelize[_0xf7d2('0x1')]},'moduleCreate':{'type':Sequelize[_0xf7d2('0x2')]('lead','contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xf7d2('0x2')](_0xf7d2('0x3'),_0xf7d2('0x4'),_0xf7d2('0x5')),'defaultValue':_0xf7d2('0x3')},'description':{'type':Sequelize[_0xf7d2('0x1')]}};
\ No newline at end of file
index 8de434f..d0bccb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf46e=['limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','findOne','ZohoField','order','pick','filter','getFields','getSubjects','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xf46e,0xdc));var _0xef46=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xf46e[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0xef46('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef46('0x1'));var jsonpatch=require(_0xef46('0x2'));var rp=require(_0xef46('0x3'));var moment=require(_0xef46('0x4'));var BPromise=require(_0xef46('0x5'));var Mustache=require(_0xef46('0x6'));var util=require('util');var path=require('path');var sox=require(_0xef46('0x7'));var csv=require('to-csv');var ejs=require(_0xef46('0x8'));var fs=require('fs');var fs_extra=require(_0xef46('0x9'));var _=require(_0xef46('0xa'));var squel=require('squel');var crypto=require(_0xef46('0xb'));var jsforce=require(_0xef46('0xc'));var deskjs=require(_0xef46('0xd'));var toCsv=require(_0xef46('0xe'));var querystring=require(_0xef46('0xf'));var Papa=require(_0xef46('0x10'));var Redis=require(_0xef46('0x11'));var authService=require(_0xef46('0x12'));var qs=require(_0xef46('0x13'));var as=require(_0xef46('0x14'));var hardwareService=require(_0xef46('0x15'));var logger=require(_0xef46('0x16'))(_0xef46('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xef46('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d547d,_0x5445db){_0x5445db=_0x5445db||0xcc;return function(_0xcf60a6){if(_0xcf60a6){return _0x4d547d[_0xef46('0x19')](_0x5445db);}return _0x4d547d[_0xef46('0x1a')](_0x5445db)[_0xef46('0x1b')]();};}function respondWithResult(_0x1f5926,_0xe3c44c){_0xe3c44c=_0xe3c44c||0xc8;return function(_0x165f0e){if(_0x165f0e){return _0x1f5926[_0xef46('0x1a')](_0xe3c44c)[_0xef46('0x1c')](_0x165f0e);}};}function respondWithFilteredResult(_0xb16214,_0x33e276){return function(_0x43e165){if(_0x43e165){var _0x47908f=typeof _0x33e276['offset']==='undefined'&&typeof _0x33e276[_0xef46('0x1d')]===_0xef46('0x1e');var _0xf47ed3=_0x43e165[_0xef46('0x1f')];var _0x492e18=_0x47908f?0x0:_0x33e276[_0xef46('0x20')];var _0x578b6c=_0x47908f?_0x43e165[_0xef46('0x1f')]:_0x33e276[_0xef46('0x20')]+_0x33e276[_0xef46('0x1d')];var _0x1b9a5c;if(_0x578b6c>=_0xf47ed3){_0x578b6c=_0xf47ed3;_0x1b9a5c=0xc8;}else{_0x1b9a5c=0xce;}_0xb16214[_0xef46('0x1a')](_0x1b9a5c);return _0xb16214[_0xef46('0x21')](_0xef46('0x22'),_0x492e18+'-'+_0x578b6c+'/'+_0xf47ed3)[_0xef46('0x1c')](_0x43e165);}return null;};}function patchUpdates(_0x16c45b){return function(_0x361857){try{jsonpatch['apply'](_0x361857,_0x16c45b,!![]);}catch(_0x4a2f9f){return BPromise[_0xef46('0x23')](_0x4a2f9f);}return _0x361857[_0xef46('0x24')]();};}function saveUpdates(_0x5c452b,_0x218c51){return function(_0x5a9242){if(_0x5a9242){return _0x5a9242[_0xef46('0x25')](_0x5c452b)[_0xef46('0x26')](function(_0x1ad083){return _0x1ad083;});}return null;};}function removeEntity(_0x12a21c,_0x2327c1){return function(_0x23635c){if(_0x23635c){return _0x23635c[_0xef46('0x27')]()['then'](function(){_0x12a21c[_0xef46('0x1a')](0xcc)[_0xef46('0x1b')]();});}};}function handleEntityNotFound(_0x388d7f,_0x451aac){return function(_0x3494c2){if(!_0x3494c2){_0x388d7f[_0xef46('0x19')](0x194);}return _0x3494c2;};}function handleError(_0xf51a8f,_0x5248eb){_0x5248eb=_0x5248eb||0x1f4;return function(_0x4ef09e){logger[_0xef46('0x28')](_0x4ef09e[_0xef46('0x29')]);if(_0x4ef09e['name']){delete _0x4ef09e[_0xef46('0x2a')];}_0xf51a8f[_0xef46('0x1a')](_0x5248eb)[_0xef46('0x2b')](_0x4ef09e);};}exports[_0xef46('0x2c')]=function(_0x2150b5,_0x4dab97){var _0x43943e={},_0x326c61={},_0x168780={'count':0x0,'rows':[]};var _0xd6abb5=_[_0xef46('0x2d')](db[_0xef46('0x2e')]['rawAttributes'],function(_0x35d445){return{'name':_0x35d445[_0xef46('0x2f')],'type':_0x35d445[_0xef46('0x30')][_0xef46('0x31')]};});_0x326c61[_0xef46('0x32')]=_[_0xef46('0x2d')](_0xd6abb5,_0xef46('0x2a'));_0x326c61[_0xef46('0x33')]=_[_0xef46('0x34')](_0x2150b5[_0xef46('0x33')]);_0x326c61[_0xef46('0x35')]=_[_0xef46('0x36')](_0x326c61[_0xef46('0x32')],_0x326c61[_0xef46('0x33')]);_0x43943e[_0xef46('0x37')]=_[_0xef46('0x36')](_0x326c61[_0xef46('0x32')],qs[_0xef46('0x38')](_0x2150b5['query']['fields']));_0x43943e[_0xef46('0x37')]=_0x43943e[_0xef46('0x37')][_0xef46('0x39')]?_0x43943e[_0xef46('0x37')]:_0x326c61[_0xef46('0x32')];if(!_0x2150b5[_0xef46('0x33')]['hasOwnProperty'](_0xef46('0x3a'))){_0x43943e[_0xef46('0x1d')]=qs[_0xef46('0x1d')](_0x2150b5[_0xef46('0x33')][_0xef46('0x1d')]);_0x43943e['offset']=qs[_0xef46('0x20')](_0x2150b5[_0xef46('0x33')][_0xef46('0x20')]);}_0x43943e['order']=qs[_0xef46('0x3b')](_0x2150b5[_0xef46('0x33')]['sort']);_0x43943e[_0xef46('0x3c')]=qs[_0xef46('0x35')](_['pick'](_0x2150b5[_0xef46('0x33')],_0x326c61['filters']),_0xd6abb5);if(_0x2150b5[_0xef46('0x33')]['filter']){_0x43943e[_0xef46('0x3c')]=_['merge'](_0x43943e[_0xef46('0x3c')],{'$or':_[_0xef46('0x2d')](_0xd6abb5,function(_0x4899a3){if(_0x4899a3[_0xef46('0x30')]!==_0xef46('0x3d')){var _0x57603b={};_0x57603b[_0x4899a3['name']]={'$like':'%'+_0x2150b5[_0xef46('0x33')]['filter']+'%'};return _0x57603b;}})});}_0x43943e=_[_0xef46('0x3e')]({},_0x43943e,_0x2150b5[_0xef46('0x3f')]);var _0x1de0da={'where':_0x43943e[_0xef46('0x3c')]};return db[_0xef46('0x2e')][_0xef46('0x1f')](_0x1de0da)['then'](function(_0x4dafaf){_0x168780[_0xef46('0x1f')]=_0x4dafaf;if(_0x2150b5[_0xef46('0x33')]['includeAll']){_0x43943e[_0xef46('0x40')]=[{'all':!![]}];}return db[_0xef46('0x2e')]['findAll'](_0x43943e);})[_0xef46('0x26')](function(_0xa31c1b){_0x168780[_0xef46('0x41')]=_0xa31c1b;return _0x168780;})[_0xef46('0x26')](respondWithFilteredResult(_0x4dab97,_0x43943e))[_0xef46('0x42')](handleError(_0x4dab97,null));};exports[_0xef46('0x43')]=function(_0x3279c1,_0x72fea9){var _0x1aded8={'raw':![],'where':{'id':_0x3279c1[_0xef46('0x44')]['id']}},_0x2fe297={};_0x2fe297[_0xef46('0x32')]=_[_0xef46('0x34')](db['ZohoConfiguration'][_0xef46('0x45')]);_0x2fe297[_0xef46('0x33')]=_[_0xef46('0x34')](_0x3279c1[_0xef46('0x33')]);_0x2fe297[_0xef46('0x35')]=_['intersection'](_0x2fe297[_0xef46('0x32')],_0x2fe297[_0xef46('0x33')]);_0x1aded8[_0xef46('0x37')]=_[_0xef46('0x36')](_0x2fe297[_0xef46('0x32')],qs[_0xef46('0x38')](_0x3279c1[_0xef46('0x33')][_0xef46('0x38')]));_0x1aded8[_0xef46('0x37')]=_0x1aded8[_0xef46('0x37')][_0xef46('0x39')]?_0x1aded8['attributes']:_0x2fe297['model'];if(_0x3279c1['query'][_0xef46('0x46')]){_0x1aded8[_0xef46('0x40')]=[{'all':!![]}];}_0x1aded8=_[_0xef46('0x3e')]({},_0x1aded8,_0x3279c1[_0xef46('0x3f')]);return db[_0xef46('0x2e')][_0xef46('0x47')](_0x1aded8)[_0xef46('0x26')](handleEntityNotFound(_0x72fea9,null))[_0xef46('0x26')](respondWithResult(_0x72fea9,null))['catch'](handleError(_0x72fea9,null));};exports[_0xef46('0x48')]=function(_0x2a8bbd,_0x52a439){return db['ZohoConfiguration'][_0xef46('0x48')](_0x2a8bbd[_0xef46('0x49')],{})[_0xef46('0x26')](respondWithResult(_0x52a439,0xc9))[_0xef46('0x42')](handleError(_0x52a439,null));};exports[_0xef46('0x25')]=function(_0x4b4e31,_0x2cd401){if(_0x4b4e31[_0xef46('0x49')]['id']){delete _0x4b4e31[_0xef46('0x49')]['id'];}return db[_0xef46('0x2e')][_0xef46('0x47')]({'where':{'id':_0x4b4e31[_0xef46('0x44')]['id']}})[_0xef46('0x26')](handleEntityNotFound(_0x2cd401,null))[_0xef46('0x26')](saveUpdates(_0x4b4e31[_0xef46('0x49')],null))[_0xef46('0x26')](respondWithResult(_0x2cd401,null))['catch'](handleError(_0x2cd401,null));};exports[_0xef46('0x27')]=function(_0x524c95,_0x25848d){return db['ZohoConfiguration'][_0xef46('0x47')]({'where':{'id':_0x524c95['params']['id']}})['then'](handleEntityNotFound(_0x25848d,null))[_0xef46('0x26')](removeEntity(_0x25848d,null))[_0xef46('0x42')](handleError(_0x25848d,null));};exports['getFields']=function(_0x4383e6,_0x52c769,_0x40f4c8){var _0x4e979d={};var _0x4af115={};var _0x47fda2;var _0x4c3d83;return db[_0xef46('0x2e')][_0xef46('0x4a')]({'where':{'id':_0x4383e6[_0xef46('0x44')]['id']}})[_0xef46('0x26')](handleEntityNotFound(_0x52c769,null))[_0xef46('0x26')](function(_0x44a779){if(_0x44a779){_0x47fda2=_0x44a779;_0x4af115[_0xef46('0x32')]=_[_0xef46('0x34')](db[_0xef46('0x4b')]['rawAttributes']);_0x4af115['query']=_[_0xef46('0x34')](_0x4383e6['query']);_0x4af115['filters']=_['intersection'](_0x4af115[_0xef46('0x32')],_0x4af115[_0xef46('0x33')]);_0x4e979d[_0xef46('0x37')]=_[_0xef46('0x36')](_0x4af115[_0xef46('0x32')],qs[_0xef46('0x38')](_0x4383e6[_0xef46('0x33')][_0xef46('0x38')]));_0x4e979d[_0xef46('0x37')]=_0x4e979d[_0xef46('0x37')][_0xef46('0x39')]?_0x4e979d['attributes']:_0x4af115[_0xef46('0x32')];_0x4e979d[_0xef46('0x4c')]=qs[_0xef46('0x3b')](_0x4383e6[_0xef46('0x33')][_0xef46('0x3b')]);_0x4e979d[_0xef46('0x3c')]=qs['filters'](_[_0xef46('0x4d')](_0x4383e6[_0xef46('0x33')],_0x4af115[_0xef46('0x35')]));if(_0x4383e6[_0xef46('0x33')][_0xef46('0x4e')]){_0x4e979d['where']=_[_0xef46('0x3e')](_0x4e979d[_0xef46('0x3c')],{'$or':_[_0xef46('0x2d')](_0x4e979d[_0xef46('0x37')],function(_0x468864){var _0x375fe8={};_0x375fe8[_0x468864]={'$like':'%'+_0x4383e6['query'][_0xef46('0x4e')]+'%'};return _0x375fe8;})});}_0x4e979d=_[_0xef46('0x3e')]({},_0x4e979d,_0x4383e6[_0xef46('0x3f')]);return _0x47fda2['getFields'](_0x4e979d);}})[_0xef46('0x26')](function(_0x362d1a){if(_0x362d1a){_0x4c3d83=_0x362d1a[_0xef46('0x39')];if(!_0x4383e6[_0xef46('0x33')]['hasOwnProperty'](_0xef46('0x3a'))){_0x4e979d[_0xef46('0x1d')]=qs[_0xef46('0x1d')](_0x4383e6[_0xef46('0x33')][_0xef46('0x1d')]);_0x4e979d[_0xef46('0x20')]=qs[_0xef46('0x20')](_0x4383e6['query'][_0xef46('0x20')]);}return _0x47fda2[_0xef46('0x4f')](_0x4e979d);}})[_0xef46('0x26')](function(_0x1f4421){if(_0x1f4421){return _0x1f4421?{'count':_0x4c3d83,'rows':_0x1f4421}:null;}})[_0xef46('0x26')](respondWithResult(_0x52c769,null))[_0xef46('0x42')](handleError(_0x52c769,null));};exports[_0xef46('0x50')]=function(_0x36efd3,_0x47b785,_0x138954){var _0x3b7648={};var _0x34b762={};var _0x21bae0;var _0x3026ce;return db[_0xef46('0x2e')]['findOne']({'where':{'id':_0x36efd3[_0xef46('0x44')]['id']}})['then'](handleEntityNotFound(_0x47b785,null))[_0xef46('0x26')](function(_0x2bb4c7){if(_0x2bb4c7){_0x21bae0=_0x2bb4c7;_0x34b762[_0xef46('0x32')]=_[_0xef46('0x34')](db[_0xef46('0x4b')][_0xef46('0x45')]);_0x34b762[_0xef46('0x33')]=_[_0xef46('0x34')](_0x36efd3['query']);_0x34b762[_0xef46('0x35')]=_[_0xef46('0x36')](_0x34b762[_0xef46('0x32')],_0x34b762[_0xef46('0x33')]);_0x3b7648[_0xef46('0x37')]=_[_0xef46('0x36')](_0x34b762['model'],qs[_0xef46('0x38')](_0x36efd3[_0xef46('0x33')][_0xef46('0x38')]));_0x3b7648['attributes']=_0x3b7648[_0xef46('0x37')][_0xef46('0x39')]?_0x3b7648[_0xef46('0x37')]:_0x34b762[_0xef46('0x32')];_0x3b7648[_0xef46('0x4c')]=qs['sort'](_0x36efd3[_0xef46('0x33')][_0xef46('0x3b')]);_0x3b7648[_0xef46('0x3c')]=qs[_0xef46('0x35')](_[_0xef46('0x4d')](_0x36efd3[_0xef46('0x33')],_0x34b762[_0xef46('0x35')]));if(_0x36efd3['query'][_0xef46('0x4e')]){_0x3b7648[_0xef46('0x3c')]=_[_0xef46('0x3e')](_0x3b7648[_0xef46('0x3c')],{'$or':_['map'](_0x3b7648[_0xef46('0x37')],function(_0x1b60e6){var _0x393753={};_0x393753[_0x1b60e6]={'$like':'%'+_0x36efd3[_0xef46('0x33')][_0xef46('0x4e')]+'%'};return _0x393753;})});}_0x3b7648=_[_0xef46('0x3e')]({},_0x3b7648,_0x36efd3[_0xef46('0x3f')]);return _0x21bae0['getSubjects'](_0x3b7648);}})['then'](function(_0x3bb046){if(_0x3bb046){_0x3026ce=_0x3bb046[_0xef46('0x39')];if(!_0x36efd3[_0xef46('0x33')][_0xef46('0x51')]('nolimit')){_0x3b7648[_0xef46('0x1d')]=qs[_0xef46('0x1d')](_0x36efd3[_0xef46('0x33')]['limit']);_0x3b7648[_0xef46('0x20')]=qs[_0xef46('0x20')](_0x36efd3[_0xef46('0x33')]['offset']);}return _0x21bae0[_0xef46('0x50')](_0x3b7648);}})[_0xef46('0x26')](function(_0x3a43ed){if(_0x3a43ed){return _0x3a43ed?{'count':_0x3026ce,'rows':_0x3a43ed}:null;}})['then'](respondWithResult(_0x47b785,null))[_0xef46('0x42')](handleError(_0x47b785,null));};exports[_0xef46('0x52')]=function(_0x380758,_0x76e564,_0x38f4e5){var _0x4ca5cc={};var _0x2e0dd3={};var _0x1b6517;var _0x2c85b4;return db['ZohoConfiguration'][_0xef46('0x4a')]({'where':{'id':_0x380758[_0xef46('0x44')]['id']}})[_0xef46('0x26')](handleEntityNotFound(_0x76e564,null))[_0xef46('0x26')](function(_0x550421){if(_0x550421){_0x1b6517=_0x550421;_0x2e0dd3[_0xef46('0x32')]=_[_0xef46('0x34')](db[_0xef46('0x4b')][_0xef46('0x45')]);_0x2e0dd3[_0xef46('0x33')]=_[_0xef46('0x34')](_0x380758[_0xef46('0x33')]);_0x2e0dd3['filters']=_[_0xef46('0x36')](_0x2e0dd3[_0xef46('0x32')],_0x2e0dd3[_0xef46('0x33')]);_0x4ca5cc['attributes']=_[_0xef46('0x36')](_0x2e0dd3[_0xef46('0x32')],qs[_0xef46('0x38')](_0x380758[_0xef46('0x33')]['fields']));_0x4ca5cc['attributes']=_0x4ca5cc['attributes']['length']?_0x4ca5cc[_0xef46('0x37')]:_0x2e0dd3['model'];_0x4ca5cc[_0xef46('0x4c')]=qs[_0xef46('0x3b')](_0x380758[_0xef46('0x33')][_0xef46('0x3b')]);_0x4ca5cc['where']=qs[_0xef46('0x35')](_[_0xef46('0x4d')](_0x380758[_0xef46('0x33')],_0x2e0dd3[_0xef46('0x35')]));if(_0x380758['query'][_0xef46('0x4e')]){_0x4ca5cc[_0xef46('0x3c')]=_[_0xef46('0x3e')](_0x4ca5cc['where'],{'$or':_[_0xef46('0x2d')](_0x4ca5cc[_0xef46('0x37')],function(_0xae6d26){var _0x5ce768={};_0x5ce768[_0xae6d26]={'$like':'%'+_0x380758[_0xef46('0x33')]['filter']+'%'};return _0x5ce768;})});}_0x4ca5cc=_[_0xef46('0x3e')]({},_0x4ca5cc,_0x380758[_0xef46('0x3f')]);return _0x1b6517[_0xef46('0x52')](_0x4ca5cc);}})['then'](function(_0x501406){if(_0x501406){_0x2c85b4=_0x501406[_0xef46('0x39')];if(!_0x380758[_0xef46('0x33')][_0xef46('0x51')](_0xef46('0x3a'))){_0x4ca5cc['limit']=qs[_0xef46('0x1d')](_0x380758[_0xef46('0x33')]['limit']);_0x4ca5cc[_0xef46('0x20')]=qs[_0xef46('0x20')](_0x380758[_0xef46('0x33')]['offset']);}return _0x1b6517[_0xef46('0x52')](_0x4ca5cc);}})[_0xef46('0x26')](function(_0x1a9f38){if(_0x1a9f38){return _0x1a9f38?{'count':_0x2c85b4,'rows':_0x1a9f38}:null;}})[_0xef46('0x26')](respondWithResult(_0x76e564,null))[_0xef46('0x42')](handleError(_0x76e564,null));};
\ No newline at end of file
+var _0x63dd=['where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','getFields','ZohoField','hasOwnProperty','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','name','send','index','map','ZohoConfiguration','rawAttributes','type','key','keys','query','intersection','model','attributes','length','nolimit','order','sort','filters','pick'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x63dd,0x1a1));var _0xd63d=function(_0x3d1545,_0x32d043){_0x3d1545=_0x3d1545-0x0;var _0x24b9c4=_0x63dd[_0x3d1545];return _0x24b9c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd63d('0x0'));var zipdir=require(_0xd63d('0x1'));var jsonpatch=require(_0xd63d('0x2'));var rp=require(_0xd63d('0x3'));var moment=require(_0xd63d('0x4'));var BPromise=require(_0xd63d('0x5'));var Mustache=require(_0xd63d('0x6'));var util=require(_0xd63d('0x7'));var path=require(_0xd63d('0x8'));var sox=require(_0xd63d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd63d('0xa'));var squel=require(_0xd63d('0xb'));var crypto=require('crypto');var jsforce=require(_0xd63d('0xc'));var deskjs=require(_0xd63d('0xd'));var toCsv=require(_0xd63d('0xe'));var querystring=require(_0xd63d('0xf'));var Papa=require('papaparse');var Redis=require(_0xd63d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd63d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd63d('0x12'))(_0xd63d('0x13'));var utils=require(_0xd63d('0x14'));var config=require(_0xd63d('0x15'));var licenseUtil=require(_0xd63d('0x16'));var db=require(_0xd63d('0x17'))['db'];function respondWithStatusCode(_0x39aecf,_0x2b78e6){_0x2b78e6=_0x2b78e6||0xcc;return function(_0x4a6f1c){if(_0x4a6f1c){return _0x39aecf['sendStatus'](_0x2b78e6);}return _0x39aecf[_0xd63d('0x18')](_0x2b78e6)[_0xd63d('0x19')]();};}function respondWithResult(_0x5a6944,_0x173fc9){_0x173fc9=_0x173fc9||0xc8;return function(_0x32f1f5){if(_0x32f1f5){return _0x5a6944['status'](_0x173fc9)[_0xd63d('0x1a')](_0x32f1f5);}};}function respondWithFilteredResult(_0xe0bc1d,_0xbcb204){return function(_0x5d10dc){if(_0x5d10dc){var _0x23e502=typeof _0xbcb204[_0xd63d('0x1b')]===_0xd63d('0x1c')&&typeof _0xbcb204[_0xd63d('0x1d')]===_0xd63d('0x1c');var _0x2c1daa=_0x5d10dc['count'];var _0x28d529=_0x23e502?0x0:_0xbcb204[_0xd63d('0x1b')];var _0x17c568=_0x23e502?_0x5d10dc[_0xd63d('0x1e')]:_0xbcb204[_0xd63d('0x1b')]+_0xbcb204[_0xd63d('0x1d')];var _0x147b11;if(_0x17c568>=_0x2c1daa){_0x17c568=_0x2c1daa;_0x147b11=0xc8;}else{_0x147b11=0xce;}_0xe0bc1d[_0xd63d('0x18')](_0x147b11);return _0xe0bc1d[_0xd63d('0x1f')]('Content-Range',_0x28d529+'-'+_0x17c568+'/'+_0x2c1daa)[_0xd63d('0x1a')](_0x5d10dc);}return null;};}function patchUpdates(_0x1e34ed){return function(_0xffefe6){try{jsonpatch['apply'](_0xffefe6,_0x1e34ed,!![]);}catch(_0x5246e2){return BPromise[_0xd63d('0x20')](_0x5246e2);}return _0xffefe6[_0xd63d('0x21')]();};}function saveUpdates(_0x587b1f,_0x4cc314){return function(_0x3b2939){if(_0x3b2939){return _0x3b2939[_0xd63d('0x22')](_0x587b1f)[_0xd63d('0x23')](function(_0x25a2a1){return _0x25a2a1;});}return null;};}function removeEntity(_0x57f368,_0x35ea5e){return function(_0x112079){if(_0x112079){return _0x112079[_0xd63d('0x24')]()[_0xd63d('0x23')](function(){_0x57f368[_0xd63d('0x18')](0xcc)[_0xd63d('0x19')]();});}};}function handleEntityNotFound(_0x32961d,_0x165654){return function(_0x32dbc4){if(!_0x32dbc4){_0x32961d[_0xd63d('0x25')](0x194);}return _0x32dbc4;};}function handleError(_0x2b7f9a,_0x2c3e59){_0x2c3e59=_0x2c3e59||0x1f4;return function(_0x4c3cf2){logger['error'](_0x4c3cf2['stack']);if(_0x4c3cf2[_0xd63d('0x26')]){delete _0x4c3cf2[_0xd63d('0x26')];}_0x2b7f9a['status'](_0x2c3e59)[_0xd63d('0x27')](_0x4c3cf2);};}exports[_0xd63d('0x28')]=function(_0x4287e6,_0x39007e){var _0x142a5a={},_0x2b088c={},_0x590b2c={'count':0x0,'rows':[]};var _0x4f9b9b=_[_0xd63d('0x29')](db[_0xd63d('0x2a')][_0xd63d('0x2b')],function(_0x7580e9){return{'name':_0x7580e9['fieldName'],'type':_0x7580e9[_0xd63d('0x2c')][_0xd63d('0x2d')]};});_0x2b088c['model']=_['map'](_0x4f9b9b,_0xd63d('0x26'));_0x2b088c['query']=_[_0xd63d('0x2e')](_0x4287e6[_0xd63d('0x2f')]);_0x2b088c['filters']=_[_0xd63d('0x30')](_0x2b088c[_0xd63d('0x31')],_0x2b088c[_0xd63d('0x2f')]);_0x142a5a['attributes']=_['intersection'](_0x2b088c['model'],qs['fields'](_0x4287e6[_0xd63d('0x2f')]['fields']));_0x142a5a['attributes']=_0x142a5a[_0xd63d('0x32')][_0xd63d('0x33')]?_0x142a5a[_0xd63d('0x32')]:_0x2b088c['model'];if(!_0x4287e6[_0xd63d('0x2f')]['hasOwnProperty'](_0xd63d('0x34'))){_0x142a5a[_0xd63d('0x1d')]=qs[_0xd63d('0x1d')](_0x4287e6['query']['limit']);_0x142a5a[_0xd63d('0x1b')]=qs[_0xd63d('0x1b')](_0x4287e6['query'][_0xd63d('0x1b')]);}_0x142a5a[_0xd63d('0x35')]=qs[_0xd63d('0x36')](_0x4287e6['query'][_0xd63d('0x36')]);_0x142a5a['where']=qs[_0xd63d('0x37')](_[_0xd63d('0x38')](_0x4287e6['query'],_0x2b088c[_0xd63d('0x37')]),_0x4f9b9b);if(_0x4287e6[_0xd63d('0x2f')]['filter']){_0x142a5a[_0xd63d('0x39')]=_[_0xd63d('0x3a')](_0x142a5a['where'],{'$or':_[_0xd63d('0x29')](_0x4f9b9b,function(_0x57b4d6){if(_0x57b4d6[_0xd63d('0x2c')]!==_0xd63d('0x3b')){var _0x4fb9b5={};_0x4fb9b5[_0x57b4d6[_0xd63d('0x26')]]={'$like':'%'+_0x4287e6['query'][_0xd63d('0x3c')]+'%'};return _0x4fb9b5;}})});}_0x142a5a=_[_0xd63d('0x3a')]({},_0x142a5a,_0x4287e6[_0xd63d('0x3d')]);var _0x32beb9={'where':_0x142a5a[_0xd63d('0x39')]};return db[_0xd63d('0x2a')]['count'](_0x32beb9)[_0xd63d('0x23')](function(_0x48f0c3){_0x590b2c['count']=_0x48f0c3;if(_0x4287e6[_0xd63d('0x2f')][_0xd63d('0x3e')]){_0x142a5a[_0xd63d('0x3f')]=[{'all':!![]}];}return db[_0xd63d('0x2a')][_0xd63d('0x40')](_0x142a5a);})[_0xd63d('0x23')](function(_0x6462b9){_0x590b2c[_0xd63d('0x41')]=_0x6462b9;return _0x590b2c;})[_0xd63d('0x23')](respondWithFilteredResult(_0x39007e,_0x142a5a))[_0xd63d('0x42')](handleError(_0x39007e,null));};exports[_0xd63d('0x43')]=function(_0x4b9403,_0x25f49f){var _0x1d3169={'raw':![],'where':{'id':_0x4b9403[_0xd63d('0x44')]['id']}},_0x57a2ac={};_0x57a2ac['model']=_[_0xd63d('0x2e')](db[_0xd63d('0x2a')]['rawAttributes']);_0x57a2ac[_0xd63d('0x2f')]=_['keys'](_0x4b9403[_0xd63d('0x2f')]);_0x57a2ac[_0xd63d('0x37')]=_[_0xd63d('0x30')](_0x57a2ac['model'],_0x57a2ac[_0xd63d('0x2f')]);_0x1d3169['attributes']=_[_0xd63d('0x30')](_0x57a2ac[_0xd63d('0x31')],qs[_0xd63d('0x45')](_0x4b9403[_0xd63d('0x2f')]['fields']));_0x1d3169[_0xd63d('0x32')]=_0x1d3169[_0xd63d('0x32')][_0xd63d('0x33')]?_0x1d3169[_0xd63d('0x32')]:_0x57a2ac['model'];if(_0x4b9403[_0xd63d('0x2f')]['includeAll']){_0x1d3169[_0xd63d('0x3f')]=[{'all':!![]}];}_0x1d3169=_[_0xd63d('0x3a')]({},_0x1d3169,_0x4b9403[_0xd63d('0x3d')]);return db[_0xd63d('0x2a')][_0xd63d('0x46')](_0x1d3169)[_0xd63d('0x23')](handleEntityNotFound(_0x25f49f,null))[_0xd63d('0x23')](respondWithResult(_0x25f49f,null))[_0xd63d('0x42')](handleError(_0x25f49f,null));};exports[_0xd63d('0x47')]=function(_0xbaa62c,_0x2c77fb){return db[_0xd63d('0x2a')][_0xd63d('0x47')](_0xbaa62c[_0xd63d('0x48')],{})[_0xd63d('0x23')](respondWithResult(_0x2c77fb,0xc9))[_0xd63d('0x42')](handleError(_0x2c77fb,null));};exports[_0xd63d('0x22')]=function(_0x32273,_0x1d7416){if(_0x32273[_0xd63d('0x48')]['id']){delete _0x32273[_0xd63d('0x48')]['id'];}return db[_0xd63d('0x2a')]['find']({'where':{'id':_0x32273[_0xd63d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d7416,null))['then'](saveUpdates(_0x32273['body'],null))[_0xd63d('0x23')](respondWithResult(_0x1d7416,null))[_0xd63d('0x42')](handleError(_0x1d7416,null));};exports['destroy']=function(_0x29a697,_0x33deec){return db[_0xd63d('0x2a')][_0xd63d('0x46')]({'where':{'id':_0x29a697[_0xd63d('0x44')]['id']}})['then'](handleEntityNotFound(_0x33deec,null))[_0xd63d('0x23')](removeEntity(_0x33deec,null))[_0xd63d('0x42')](handleError(_0x33deec,null));};exports[_0xd63d('0x49')]=function(_0x49abb7,_0x5b0f1c,_0x376add){var _0x42cd7e={};var _0x581df2={};var _0x567cca;var _0x50b965;return db[_0xd63d('0x2a')]['findOne']({'where':{'id':_0x49abb7[_0xd63d('0x44')]['id']}})[_0xd63d('0x23')](handleEntityNotFound(_0x5b0f1c,null))[_0xd63d('0x23')](function(_0x1c2552){if(_0x1c2552){_0x567cca=_0x1c2552;_0x581df2[_0xd63d('0x31')]=_[_0xd63d('0x2e')](db[_0xd63d('0x4a')][_0xd63d('0x2b')]);_0x581df2[_0xd63d('0x2f')]=_[_0xd63d('0x2e')](_0x49abb7[_0xd63d('0x2f')]);_0x581df2['filters']=_[_0xd63d('0x30')](_0x581df2[_0xd63d('0x31')],_0x581df2['query']);_0x42cd7e[_0xd63d('0x32')]=_[_0xd63d('0x30')](_0x581df2[_0xd63d('0x31')],qs['fields'](_0x49abb7[_0xd63d('0x2f')][_0xd63d('0x45')]));_0x42cd7e[_0xd63d('0x32')]=_0x42cd7e[_0xd63d('0x32')][_0xd63d('0x33')]?_0x42cd7e[_0xd63d('0x32')]:_0x581df2['model'];_0x42cd7e['order']=qs['sort'](_0x49abb7[_0xd63d('0x2f')][_0xd63d('0x36')]);_0x42cd7e[_0xd63d('0x39')]=qs[_0xd63d('0x37')](_[_0xd63d('0x38')](_0x49abb7[_0xd63d('0x2f')],_0x581df2['filters']));if(_0x49abb7['query'][_0xd63d('0x3c')]){_0x42cd7e[_0xd63d('0x39')]=_[_0xd63d('0x3a')](_0x42cd7e[_0xd63d('0x39')],{'$or':_[_0xd63d('0x29')](_0x42cd7e[_0xd63d('0x32')],function(_0x2801d1){var _0x28dee3={};_0x28dee3[_0x2801d1]={'$like':'%'+_0x49abb7[_0xd63d('0x2f')][_0xd63d('0x3c')]+'%'};return _0x28dee3;})});}_0x42cd7e=_[_0xd63d('0x3a')]({},_0x42cd7e,_0x49abb7[_0xd63d('0x3d')]);return _0x567cca[_0xd63d('0x49')](_0x42cd7e);}})[_0xd63d('0x23')](function(_0x235ba3){if(_0x235ba3){_0x50b965=_0x235ba3[_0xd63d('0x33')];if(!_0x49abb7['query'][_0xd63d('0x4b')](_0xd63d('0x34'))){_0x42cd7e[_0xd63d('0x1d')]=qs[_0xd63d('0x1d')](_0x49abb7[_0xd63d('0x2f')][_0xd63d('0x1d')]);_0x42cd7e[_0xd63d('0x1b')]=qs[_0xd63d('0x1b')](_0x49abb7[_0xd63d('0x2f')][_0xd63d('0x1b')]);}return _0x567cca['getFields'](_0x42cd7e);}})['then'](function(_0xdcb3e1){if(_0xdcb3e1){return _0xdcb3e1?{'count':_0x50b965,'rows':_0xdcb3e1}:null;}})[_0xd63d('0x23')](respondWithResult(_0x5b0f1c,null))['catch'](handleError(_0x5b0f1c,null));};exports[_0xd63d('0x4c')]=function(_0x4a1a33,_0xd4da60,_0x47b71f){var _0x54207d={};var _0x4be12f={};var _0x43f1f2;var _0x2b8886;return db['ZohoConfiguration'][_0xd63d('0x4d')]({'where':{'id':_0x4a1a33[_0xd63d('0x44')]['id']}})[_0xd63d('0x23')](handleEntityNotFound(_0xd4da60,null))[_0xd63d('0x23')](function(_0x3a7d7f){if(_0x3a7d7f){_0x43f1f2=_0x3a7d7f;_0x4be12f[_0xd63d('0x31')]=_[_0xd63d('0x2e')](db[_0xd63d('0x4a')]['rawAttributes']);_0x4be12f['query']=_['keys'](_0x4a1a33[_0xd63d('0x2f')]);_0x4be12f[_0xd63d('0x37')]=_[_0xd63d('0x30')](_0x4be12f[_0xd63d('0x31')],_0x4be12f[_0xd63d('0x2f')]);_0x54207d['attributes']=_[_0xd63d('0x30')](_0x4be12f[_0xd63d('0x31')],qs[_0xd63d('0x45')](_0x4a1a33['query'][_0xd63d('0x45')]));_0x54207d['attributes']=_0x54207d[_0xd63d('0x32')][_0xd63d('0x33')]?_0x54207d[_0xd63d('0x32')]:_0x4be12f[_0xd63d('0x31')];_0x54207d[_0xd63d('0x35')]=qs[_0xd63d('0x36')](_0x4a1a33[_0xd63d('0x2f')]['sort']);_0x54207d[_0xd63d('0x39')]=qs[_0xd63d('0x37')](_[_0xd63d('0x38')](_0x4a1a33['query'],_0x4be12f[_0xd63d('0x37')]));if(_0x4a1a33[_0xd63d('0x2f')][_0xd63d('0x3c')]){_0x54207d[_0xd63d('0x39')]=_[_0xd63d('0x3a')](_0x54207d[_0xd63d('0x39')],{'$or':_[_0xd63d('0x29')](_0x54207d[_0xd63d('0x32')],function(_0x53619f){var _0x97872f={};_0x97872f[_0x53619f]={'$like':'%'+_0x4a1a33[_0xd63d('0x2f')]['filter']+'%'};return _0x97872f;})});}_0x54207d=_[_0xd63d('0x3a')]({},_0x54207d,_0x4a1a33[_0xd63d('0x3d')]);return _0x43f1f2['getSubjects'](_0x54207d);}})['then'](function(_0x50a01a){if(_0x50a01a){_0x2b8886=_0x50a01a[_0xd63d('0x33')];if(!_0x4a1a33[_0xd63d('0x2f')]['hasOwnProperty'](_0xd63d('0x34'))){_0x54207d['limit']=qs[_0xd63d('0x1d')](_0x4a1a33[_0xd63d('0x2f')][_0xd63d('0x1d')]);_0x54207d['offset']=qs[_0xd63d('0x1b')](_0x4a1a33['query'][_0xd63d('0x1b')]);}return _0x43f1f2[_0xd63d('0x4c')](_0x54207d);}})['then'](function(_0x1fda82){if(_0x1fda82){return _0x1fda82?{'count':_0x2b8886,'rows':_0x1fda82}:null;}})[_0xd63d('0x23')](respondWithResult(_0xd4da60,null))[_0xd63d('0x42')](handleError(_0xd4da60,null));};exports[_0xd63d('0x4e')]=function(_0x16b43c,_0x581057,_0x5db672){var _0x1f00f5={};var _0x73f507={};var _0x3eb9c0;var _0x406b4e;return db['ZohoConfiguration'][_0xd63d('0x4d')]({'where':{'id':_0x16b43c['params']['id']}})[_0xd63d('0x23')](handleEntityNotFound(_0x581057,null))[_0xd63d('0x23')](function(_0x251f22){if(_0x251f22){_0x3eb9c0=_0x251f22;_0x73f507[_0xd63d('0x31')]=_[_0xd63d('0x2e')](db[_0xd63d('0x4a')][_0xd63d('0x2b')]);_0x73f507[_0xd63d('0x2f')]=_[_0xd63d('0x2e')](_0x16b43c[_0xd63d('0x2f')]);_0x73f507[_0xd63d('0x37')]=_[_0xd63d('0x30')](_0x73f507['model'],_0x73f507['query']);_0x1f00f5[_0xd63d('0x32')]=_[_0xd63d('0x30')](_0x73f507['model'],qs[_0xd63d('0x45')](_0x16b43c[_0xd63d('0x2f')][_0xd63d('0x45')]));_0x1f00f5['attributes']=_0x1f00f5[_0xd63d('0x32')][_0xd63d('0x33')]?_0x1f00f5['attributes']:_0x73f507['model'];_0x1f00f5['order']=qs[_0xd63d('0x36')](_0x16b43c[_0xd63d('0x2f')]['sort']);_0x1f00f5[_0xd63d('0x39')]=qs[_0xd63d('0x37')](_['pick'](_0x16b43c[_0xd63d('0x2f')],_0x73f507[_0xd63d('0x37')]));if(_0x16b43c[_0xd63d('0x2f')][_0xd63d('0x3c')]){_0x1f00f5[_0xd63d('0x39')]=_[_0xd63d('0x3a')](_0x1f00f5['where'],{'$or':_[_0xd63d('0x29')](_0x1f00f5[_0xd63d('0x32')],function(_0x46fc4b){var _0x161097={};_0x161097[_0x46fc4b]={'$like':'%'+_0x16b43c['query'][_0xd63d('0x3c')]+'%'};return _0x161097;})});}_0x1f00f5=_[_0xd63d('0x3a')]({},_0x1f00f5,_0x16b43c['options']);return _0x3eb9c0['getDescriptions'](_0x1f00f5);}})[_0xd63d('0x23')](function(_0x2038e4){if(_0x2038e4){_0x406b4e=_0x2038e4[_0xd63d('0x33')];if(!_0x16b43c[_0xd63d('0x2f')][_0xd63d('0x4b')](_0xd63d('0x34'))){_0x1f00f5[_0xd63d('0x1d')]=qs['limit'](_0x16b43c[_0xd63d('0x2f')][_0xd63d('0x1d')]);_0x1f00f5[_0xd63d('0x1b')]=qs[_0xd63d('0x1b')](_0x16b43c[_0xd63d('0x2f')]['offset']);}return _0x3eb9c0[_0xd63d('0x4e')](_0x1f00f5);}})[_0xd63d('0x23')](function(_0x6677f8){if(_0x6677f8){return _0x6677f8?{'count':_0x406b4e,'rows':_0x6677f8}:null;}})[_0xd63d('0x23')](respondWithResult(_0x581057,null))[_0xd63d('0x42')](handleError(_0x581057,null));};
\ No newline at end of file
index 13b6cd6..ae6cdef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbda0=['ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x2cbfe4,_0x375ac2){var _0x34ffd1=function(_0x2da79b){while(--_0x2da79b){_0x2cbfe4['push'](_0x2cbfe4['shift']());}};_0x34ffd1(++_0x375ac2);}(_0xbda0,0x80));var _0x0bda=function(_0x563d25,_0x15230a){_0x563d25=_0x563d25-0x0;var _0x111ba3=_0xbda0[_0x563d25];return _0x111ba3;};'use strict';var _=require(_0x0bda('0x0'));var util=require(_0x0bda('0x1'));var logger=require(_0x0bda('0x2'))(_0x0bda('0x3'));var moment=require(_0x0bda('0x4'));var BPromise=require('bluebird');var rp=require(_0x0bda('0x5'));var fs=require('fs');var path=require(_0x0bda('0x6'));var rimraf=require(_0x0bda('0x7'));var config=require(_0x0bda('0x8'));var attributes=require(_0x0bda('0x9'));module[_0x0bda('0xa')]=function(_0xae9580,_0x23e493){return _0xae9580[_0x0bda('0xb')](_0x0bda('0xc'),attributes,{'tableName':_0x0bda('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x419c=['./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x208b04,_0x875510){var _0x49151d=function(_0x18af9b){while(--_0x18af9b){_0x208b04['push'](_0x208b04['shift']());}};_0x49151d(++_0x875510);}(_0x419c,0x79));var _0xc419=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0x419c[_0x2d8434];return _0x26b9e4;};'use strict';var _=require(_0xc419('0x0'));var util=require(_0xc419('0x1'));var logger=require(_0xc419('0x2'))(_0xc419('0x3'));var moment=require(_0xc419('0x4'));var BPromise=require(_0xc419('0x5'));var rp=require(_0xc419('0x6'));var fs=require('fs');var path=require(_0xc419('0x7'));var rimraf=require(_0xc419('0x8'));var config=require('../../config/environment');var attributes=require(_0xc419('0x9'));module[_0xc419('0xa')]=function(_0xf058fe,_0x20290d){return _0xf058fe[_0xc419('0xb')]('ZohoConfiguration',attributes,{'tableName':_0xc419('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d4e9df9..d5a1c66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8b6=['info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xf8b6,0x1ba));var _0x6f8b=function(_0x4affbe,_0x26e027){_0x4affbe=_0x4affbe-0x0;var _0x3e8189=_0xf8b6[_0x4affbe];return _0x3e8189;};'use strict';var _=require(_0x6f8b('0x0'));var util=require(_0x6f8b('0x1'));var moment=require(_0x6f8b('0x2'));var BPromise=require(_0x6f8b('0x3'));var rs=require(_0x6f8b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f8b('0x5'))['db'];var utils=require(_0x6f8b('0x6'));var logger=require(_0x6f8b('0x7'))(_0x6f8b('0x8'));var config=require(_0x6f8b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2906b1,_0x54a5d8,_0x40cbed){return new BPromise(function(_0x3ce850,_0x549fbe){return client['request'](_0x2906b1,_0x40cbed)[_0x6f8b('0xb')](function(_0x4d64bf){logger['info'](_0x6f8b('0xc'),_0x54a5d8,_0x6f8b('0xd'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x54a5d8,_0x6f8b('0xd'),JSON[_0x6f8b('0xe')](_0x4d64bf));if(_0x4d64bf[_0x6f8b('0xf')]){if(_0x4d64bf[_0x6f8b('0xf')][_0x6f8b('0x10')]===0x1f4){logger['error'](_0x6f8b('0xc'),_0x54a5d8,_0x4d64bf[_0x6f8b('0xf')][_0x6f8b('0x11')]);return _0x549fbe(_0x4d64bf[_0x6f8b('0xf')]['message']);}logger[_0x6f8b('0xf')](_0x6f8b('0xc'),_0x54a5d8,_0x4d64bf[_0x6f8b('0xf')]['message']);return _0x3ce850(_0x4d64bf[_0x6f8b('0xf')][_0x6f8b('0x11')]);}else{logger[_0x6f8b('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x54a5d8,_0x6f8b('0xd'));_0x3ce850(_0x4d64bf['result']['message']);}})[_0x6f8b('0x13')](function(_0x2aed38){logger[_0x6f8b('0xf')](_0x6f8b('0xc'),_0x54a5d8,_0x2aed38);_0x549fbe(_0x2aed38);});});}
\ No newline at end of file
+var _0xe1dc=['stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0xe1dc,0x17d));var _0xce1d=function(_0x37f51b,_0x1ff25b){_0x37f51b=_0x37f51b-0x0;var _0x52a199=_0xe1dc[_0x37f51b];return _0x52a199;};'use strict';var _=require(_0xce1d('0x0'));var util=require(_0xce1d('0x1'));var moment=require(_0xce1d('0x2'));var BPromise=require('bluebird');var rs=require(_0xce1d('0x3'));var fs=require('fs');var Redis=require(_0xce1d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xce1d('0x5'));var config=require(_0xce1d('0x6'));var jayson=require(_0xce1d('0x7'));var client=jayson[_0xce1d('0x8')][_0xce1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a26a9,_0xe91a8c,_0xcf86a8){return new BPromise(function(_0x1ed672,_0x825862){return client[_0xce1d('0xa')](_0x4a26a9,_0xcf86a8)['then'](function(_0x5576d7){logger['info'](_0xce1d('0xb'),_0xe91a8c,_0xce1d('0xc'));logger[_0xce1d('0xd')](_0xce1d('0xe'),_0xe91a8c,_0xce1d('0xc'),JSON[_0xce1d('0xf')](_0x5576d7));if(_0x5576d7[_0xce1d('0x10')]){if(_0x5576d7['error'][_0xce1d('0x11')]===0x1f4){logger[_0xce1d('0x10')](_0xce1d('0xb'),_0xe91a8c,_0x5576d7[_0xce1d('0x10')][_0xce1d('0x12')]);return _0x825862(_0x5576d7[_0xce1d('0x10')][_0xce1d('0x12')]);}logger[_0xce1d('0x10')](_0xce1d('0xb'),_0xe91a8c,_0x5576d7[_0xce1d('0x10')][_0xce1d('0x12')]);return _0x1ed672(_0x5576d7['error'][_0xce1d('0x12')]);}else{logger[_0xce1d('0x13')](_0xce1d('0xb'),_0xe91a8c,_0xce1d('0xc'));_0x1ed672(_0x5576d7[_0xce1d('0x14')][_0xce1d('0x12')]);}})[_0xce1d('0x15')](function(_0xc1f007){logger[_0xce1d('0x10')](_0xce1d('0xb'),_0xe91a8c,_0xc1f007);_0x825862(_0xc1f007);});});}
\ No newline at end of file
index 79c75e8..b03436a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa353=['../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1c6037,_0x4f4580){var _0x306523=function(_0x1dc143){while(--_0x1dc143){_0x1c6037['push'](_0x1c6037['shift']());}};_0x306523(++_0x4f4580);}(_0xa353,0xdc));var _0x3a35=function(_0x5b6ceb,_0x36fc5e){_0x5b6ceb=_0x5b6ceb-0x0;var _0x39c5c7=_0xa353[_0x5b6ceb];return _0x39c5c7;};'use strict';var multer=require(_0x3a35('0x0'));var util=require(_0x3a35('0x1'));var path=require(_0x3a35('0x2'));var timeout=require(_0x3a35('0x3'));var express=require(_0x3a35('0x4'));var router=express[_0x3a35('0x5')]();var fs_extra=require(_0x3a35('0x6'));var auth=require(_0x3a35('0x7'));var interaction=require(_0x3a35('0x8'));var config=require(_0x3a35('0x9'));var controller=require(_0x3a35('0xa'));router[_0x3a35('0xb')]('/',auth[_0x3a35('0xc')](),controller[_0x3a35('0xd')]);router['get'](_0x3a35('0xe'),auth[_0x3a35('0xc')](),controller['show']);router[_0x3a35('0xf')]('/',auth[_0x3a35('0xc')](),controller['create']);router[_0x3a35('0x10')](_0x3a35('0xe'),auth[_0x3a35('0xc')](),controller[_0x3a35('0x11')]);router[_0x3a35('0x12')]('/:id',auth[_0x3a35('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd901=['isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x48831f,_0x1d9a71){var _0x329fcd=function(_0x1bc8e9){while(--_0x1bc8e9){_0x48831f['push'](_0x48831f['shift']());}};_0x329fcd(++_0x1d9a71);}(_0xd901,0x14c));var _0x1d90=function(_0x3358c9,_0x38dd5b){_0x3358c9=_0x3358c9-0x0;var _0x4cfbc1=_0xd901[_0x3358c9];return _0x4cfbc1;};'use strict';var multer=require(_0x1d90('0x0'));var util=require(_0x1d90('0x1'));var path=require(_0x1d90('0x2'));var timeout=require(_0x1d90('0x3'));var express=require(_0x1d90('0x4'));var router=express[_0x1d90('0x5')]();var fs_extra=require(_0x1d90('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1d90('0x7'));var config=require(_0x1d90('0x8'));var controller=require('./intZohoField.controller');router[_0x1d90('0x9')]('/',auth[_0x1d90('0xa')](),controller['index']);router['get'](_0x1d90('0xb'),auth[_0x1d90('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x1d90('0xc')]);router[_0x1d90('0xd')](_0x1d90('0xb'),auth['isAuthenticated'](),controller[_0x1d90('0xe')]);router[_0x1d90('0xf')](_0x1d90('0xb'),auth[_0x1d90('0xa')](),controller[_0x1d90('0x10')]);module[_0x1d90('0x11')]=router;
\ No newline at end of file
index 237e8c6..d665b85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3fe=['ENUM','variable','BOOLEAN','sequelize','string','customVariable','keyValue','picklist','STRING'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0xb3fe,0x1f2));var _0xeb3f=function(_0x58e46c,_0x19d248){_0x58e46c=_0x58e46c-0x0;var _0xd7b374=_0xb3fe[_0x58e46c];return _0xd7b374;};'use strict';var Sequelize=require(_0xeb3f('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xeb3f('0x1'),'variable',_0xeb3f('0x2'),_0xeb3f('0x3'),_0xeb3f('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xeb3f('0x5')]},'key':{'type':Sequelize[_0xeb3f('0x5')]},'keyType':{'type':Sequelize[_0xeb3f('0x6')](_0xeb3f('0x1'),_0xeb3f('0x7'),_0xeb3f('0x2'))},'keyContent':{'type':Sequelize[_0xeb3f('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xeb3f('0x5')]},'customField':{'type':Sequelize[_0xeb3f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeb3f('0x5')]}};
\ No newline at end of file
+var _0xe16d=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x37d0ab,_0x100eba){var _0x695b57=function(_0x4bc09e){while(--_0x4bc09e){_0x37d0ab['push'](_0x37d0ab['shift']());}};_0x695b57(++_0x100eba);}(_0xe16d,0x72));var _0xde16=function(_0x372d83,_0x50419e){_0x372d83=_0x372d83-0x0;var _0x4a8227=_0xe16d[_0x372d83];return _0x4a8227;};'use strict';var Sequelize=require(_0xde16('0x0'));module[_0xde16('0x1')]={'type':{'type':Sequelize[_0xde16('0x2')](_0xde16('0x3'),_0xde16('0x4'),_0xde16('0x5'),_0xde16('0x6'),_0xde16('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xde16('0x8')]},'keyType':{'type':Sequelize[_0xde16('0x2')](_0xde16('0x3'),_0xde16('0x4'),_0xde16('0x5'))},'keyContent':{'type':Sequelize[_0xde16('0x8')]},'idField':{'type':Sequelize[_0xde16('0x8')]},'nameField':{'type':Sequelize[_0xde16('0x8')]},'customField':{'type':Sequelize[_0xde16('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xde16('0x8')]}};
\ No newline at end of file
index 85671e0..8c93019 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5354=['fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','VIRTUAL','merge','options','ZohoField','includeAll','rows','catch','params','keys','include','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','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','destroy','error','stack','name','send','index','rawAttributes'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0x5354,0x199));var _0x4535=function(_0x58e7e9,_0x274621){_0x58e7e9=_0x58e7e9-0x0;var _0x52a6dd=_0x5354[_0x58e7e9];return _0x52a6dd;};'use strict';var emlformat=require(_0x4535('0x0'));var rimraf=require(_0x4535('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4535('0x2'));var BPromise=require(_0x4535('0x3'));var Mustache=require(_0x4535('0x4'));var util=require(_0x4535('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4535('0x6'));var ejs=require(_0x4535('0x7'));var fs=require('fs');var fs_extra=require(_0x4535('0x8'));var _=require(_0x4535('0x9'));var squel=require(_0x4535('0xa'));var crypto=require(_0x4535('0xb'));var jsforce=require(_0x4535('0xc'));var deskjs=require(_0x4535('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4535('0xe'));var Redis=require(_0x4535('0xf'));var authService=require(_0x4535('0x10'));var qs=require(_0x4535('0x11'));var as=require(_0x4535('0x12'));var hardwareService=require(_0x4535('0x13'));var logger=require('../../config/logger')(_0x4535('0x14'));var utils=require(_0x4535('0x15'));var config=require(_0x4535('0x16'));var licenseUtil=require(_0x4535('0x17'));var db=require(_0x4535('0x18'))['db'];function respondWithStatusCode(_0x31c7c3,_0x22aa3e){_0x22aa3e=_0x22aa3e||0xcc;return function(_0xa453a3){if(_0xa453a3){return _0x31c7c3[_0x4535('0x19')](_0x22aa3e);}return _0x31c7c3[_0x4535('0x1a')](_0x22aa3e)[_0x4535('0x1b')]();};}function respondWithResult(_0x53b15f,_0x2a4471){_0x2a4471=_0x2a4471||0xc8;return function(_0x5c43e2){if(_0x5c43e2){return _0x53b15f[_0x4535('0x1a')](_0x2a4471)[_0x4535('0x1c')](_0x5c43e2);}};}function respondWithFilteredResult(_0x1a4d54,_0x4c2b44){return function(_0x3a6e8d){if(_0x3a6e8d){var _0x167f50=typeof _0x4c2b44[_0x4535('0x1d')]===_0x4535('0x1e')&&typeof _0x4c2b44[_0x4535('0x1f')]===_0x4535('0x1e');var _0x1e2823=_0x3a6e8d[_0x4535('0x20')];var _0xce7cdc=_0x167f50?0x0:_0x4c2b44[_0x4535('0x1d')];var _0x3af59b=_0x167f50?_0x3a6e8d[_0x4535('0x20')]:_0x4c2b44[_0x4535('0x1d')]+_0x4c2b44[_0x4535('0x1f')];var _0x3434ef;if(_0x3af59b>=_0x1e2823){_0x3af59b=_0x1e2823;_0x3434ef=0xc8;}else{_0x3434ef=0xce;}_0x1a4d54[_0x4535('0x1a')](_0x3434ef);return _0x1a4d54[_0x4535('0x21')](_0x4535('0x22'),_0xce7cdc+'-'+_0x3af59b+'/'+_0x1e2823)[_0x4535('0x1c')](_0x3a6e8d);}return null;};}function patchUpdates(_0x3277f5){return function(_0x3f7d93){try{jsonpatch[_0x4535('0x23')](_0x3f7d93,_0x3277f5,!![]);}catch(_0x5b3fcd){return BPromise[_0x4535('0x24')](_0x5b3fcd);}return _0x3f7d93[_0x4535('0x25')]();};}function saveUpdates(_0x2069e0,_0x3643f3){return function(_0x4dd86d){if(_0x4dd86d){return _0x4dd86d[_0x4535('0x26')](_0x2069e0)[_0x4535('0x27')](function(_0x412c33){return _0x412c33;});}return null;};}function removeEntity(_0x152c4f,_0x811e5a){return function(_0x241968){if(_0x241968){return _0x241968[_0x4535('0x28')]()['then'](function(){_0x152c4f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18d7d5,_0x1a9025){return function(_0x207ef8){if(!_0x207ef8){_0x18d7d5[_0x4535('0x19')](0x194);}return _0x207ef8;};}function handleError(_0x4f1ae6,_0x417304){_0x417304=_0x417304||0x1f4;return function(_0x32791b){logger[_0x4535('0x29')](_0x32791b[_0x4535('0x2a')]);if(_0x32791b[_0x4535('0x2b')]){delete _0x32791b[_0x4535('0x2b')];}_0x4f1ae6['status'](_0x417304)[_0x4535('0x2c')](_0x32791b);};}exports[_0x4535('0x2d')]=function(_0x19a74b,_0x497633){var _0x769d16={},_0x3c7138={},_0x37dfd3={'count':0x0,'rows':[]};var _0x391a96=_['map'](db['ZohoField'][_0x4535('0x2e')],function(_0x259e30){return{'name':_0x259e30[_0x4535('0x2f')],'type':_0x259e30[_0x4535('0x30')][_0x4535('0x31')]};});_0x3c7138[_0x4535('0x32')]=_[_0x4535('0x33')](_0x391a96,'name');_0x3c7138[_0x4535('0x34')]=_['keys'](_0x19a74b[_0x4535('0x34')]);_0x3c7138[_0x4535('0x35')]=_[_0x4535('0x36')](_0x3c7138[_0x4535('0x32')],_0x3c7138['query']);_0x769d16[_0x4535('0x37')]=_[_0x4535('0x36')](_0x3c7138[_0x4535('0x32')],qs[_0x4535('0x38')](_0x19a74b[_0x4535('0x34')][_0x4535('0x38')]));_0x769d16['attributes']=_0x769d16[_0x4535('0x37')][_0x4535('0x39')]?_0x769d16[_0x4535('0x37')]:_0x3c7138['model'];if(!_0x19a74b[_0x4535('0x34')]['hasOwnProperty']('nolimit')){_0x769d16['limit']=qs[_0x4535('0x1f')](_0x19a74b['query'][_0x4535('0x1f')]);_0x769d16['offset']=qs[_0x4535('0x1d')](_0x19a74b[_0x4535('0x34')][_0x4535('0x1d')]);}_0x769d16[_0x4535('0x3a')]=qs['sort'](_0x19a74b[_0x4535('0x34')][_0x4535('0x3b')]);_0x769d16['where']=qs[_0x4535('0x35')](_[_0x4535('0x3c')](_0x19a74b[_0x4535('0x34')],_0x3c7138[_0x4535('0x35')]),_0x391a96);if(_0x19a74b[_0x4535('0x34')][_0x4535('0x3d')]){_0x769d16['where']=_['merge'](_0x769d16[_0x4535('0x3e')],{'$or':_[_0x4535('0x33')](_0x391a96,function(_0x48fe1a){if(_0x48fe1a['type']!==_0x4535('0x3f')){var _0x565796={};_0x565796[_0x48fe1a[_0x4535('0x2b')]]={'$like':'%'+_0x19a74b[_0x4535('0x34')][_0x4535('0x3d')]+'%'};return _0x565796;}})});}_0x769d16=_[_0x4535('0x40')]({},_0x769d16,_0x19a74b[_0x4535('0x41')]);var _0xdc241f={'where':_0x769d16[_0x4535('0x3e')]};return db[_0x4535('0x42')][_0x4535('0x20')](_0xdc241f)[_0x4535('0x27')](function(_0x551fd0){_0x37dfd3[_0x4535('0x20')]=_0x551fd0;if(_0x19a74b[_0x4535('0x34')][_0x4535('0x43')]){_0x769d16['include']=[{'all':!![]}];}return db[_0x4535('0x42')]['findAll'](_0x769d16);})[_0x4535('0x27')](function(_0x31c265){_0x37dfd3[_0x4535('0x44')]=_0x31c265;return _0x37dfd3;})['then'](respondWithFilteredResult(_0x497633,_0x769d16))[_0x4535('0x45')](handleError(_0x497633,null));};exports['show']=function(_0x31e4a5,_0x49a30f){var _0x25537b={'raw':!![],'where':{'id':_0x31e4a5[_0x4535('0x46')]['id']}},_0x71c10e={};_0x71c10e[_0x4535('0x32')]=_[_0x4535('0x47')](db['ZohoField'][_0x4535('0x2e')]);_0x71c10e[_0x4535('0x34')]=_[_0x4535('0x47')](_0x31e4a5[_0x4535('0x34')]);_0x71c10e['filters']=_['intersection'](_0x71c10e[_0x4535('0x32')],_0x71c10e['query']);_0x25537b[_0x4535('0x37')]=_[_0x4535('0x36')](_0x71c10e['model'],qs[_0x4535('0x38')](_0x31e4a5[_0x4535('0x34')][_0x4535('0x38')]));_0x25537b[_0x4535('0x37')]=_0x25537b[_0x4535('0x37')][_0x4535('0x39')]?_0x25537b['attributes']:_0x71c10e[_0x4535('0x32')];if(_0x31e4a5[_0x4535('0x34')][_0x4535('0x43')]){_0x25537b[_0x4535('0x48')]=[{'all':!![]}];}_0x25537b=_[_0x4535('0x40')]({},_0x25537b,_0x31e4a5[_0x4535('0x41')]);return db[_0x4535('0x42')][_0x4535('0x49')](_0x25537b)[_0x4535('0x27')](handleEntityNotFound(_0x49a30f,null))[_0x4535('0x27')](respondWithResult(_0x49a30f,null))[_0x4535('0x45')](handleError(_0x49a30f,null));};exports[_0x4535('0x4a')]=function(_0x5a7ee7,_0x4e516a){return db[_0x4535('0x42')]['create'](_0x5a7ee7['body'],{})[_0x4535('0x27')](respondWithResult(_0x4e516a,0xc9))[_0x4535('0x45')](handleError(_0x4e516a,null));};exports[_0x4535('0x26')]=function(_0x1e4930,_0x508a51){if(_0x1e4930[_0x4535('0x4b')]['id']){delete _0x1e4930[_0x4535('0x4b')]['id'];}return db[_0x4535('0x42')][_0x4535('0x49')]({'where':{'id':_0x1e4930['params']['id']}})['then'](handleEntityNotFound(_0x508a51,null))[_0x4535('0x27')](saveUpdates(_0x1e4930[_0x4535('0x4b')],null))['then'](respondWithResult(_0x508a51,null))[_0x4535('0x45')](handleError(_0x508a51,null));};exports[_0x4535('0x28')]=function(_0x5e8dd2,_0x423dba){return db[_0x4535('0x42')][_0x4535('0x49')]({'where':{'id':_0x5e8dd2['params']['id']}})['then'](handleEntityNotFound(_0x423dba,null))[_0x4535('0x27')](removeEntity(_0x423dba,null))[_0x4535('0x45')](handleError(_0x423dba,null));};
\ No newline at end of file
+var _0xccfe=['keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','type','key','query'];(function(_0x3c9974,_0x1c35fe){var _0x47100a=function(_0x3233cb){while(--_0x3233cb){_0x3c9974['push'](_0x3c9974['shift']());}};_0x47100a(++_0x1c35fe);}(_0xccfe,0x186));var _0xeccf=function(_0x4b9d1f,_0x2f1b05){_0x4b9d1f=_0x4b9d1f-0x0;var _0x3d9b0b=_0xccfe[_0x4b9d1f];return _0x3d9b0b;};'use strict';var emlformat=require(_0xeccf('0x0'));var rimraf=require(_0xeccf('0x1'));var zipdir=require(_0xeccf('0x2'));var jsonpatch=require(_0xeccf('0x3'));var rp=require(_0xeccf('0x4'));var moment=require(_0xeccf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xeccf('0x6'));var util=require(_0xeccf('0x7'));var path=require('path');var sox=require(_0xeccf('0x8'));var csv=require(_0xeccf('0x9'));var ejs=require(_0xeccf('0xa'));var fs=require('fs');var fs_extra=require(_0xeccf('0xb'));var _=require(_0xeccf('0xc'));var squel=require('squel');var crypto=require(_0xeccf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeccf('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeccf('0xf'));var Redis=require('ioredis');var authService=require(_0xeccf('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xeccf('0x11'));var hardwareService=require(_0xeccf('0x12'));var logger=require(_0xeccf('0x13'))(_0xeccf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeccf('0x15'));var db=require(_0xeccf('0x16'))['db'];function respondWithStatusCode(_0x5575c6,_0x327eab){_0x327eab=_0x327eab||0xcc;return function(_0x1d7de4){if(_0x1d7de4){return _0x5575c6[_0xeccf('0x17')](_0x327eab);}return _0x5575c6[_0xeccf('0x18')](_0x327eab)[_0xeccf('0x19')]();};}function respondWithResult(_0x3675fc,_0x55c7da){_0x55c7da=_0x55c7da||0xc8;return function(_0x4fa1d1){if(_0x4fa1d1){return _0x3675fc[_0xeccf('0x18')](_0x55c7da)[_0xeccf('0x1a')](_0x4fa1d1);}};}function respondWithFilteredResult(_0x5a6ce2,_0x30a026){return function(_0x2f1444){if(_0x2f1444){var _0x5b44d7=typeof _0x30a026[_0xeccf('0x1b')]===_0xeccf('0x1c')&&typeof _0x30a026[_0xeccf('0x1d')]===_0xeccf('0x1c');var _0x16f2fb=_0x2f1444[_0xeccf('0x1e')];var _0x30faa5=_0x5b44d7?0x0:_0x30a026[_0xeccf('0x1b')];var _0x2d33b1=_0x5b44d7?_0x2f1444[_0xeccf('0x1e')]:_0x30a026[_0xeccf('0x1b')]+_0x30a026[_0xeccf('0x1d')];var _0x1ced73;if(_0x2d33b1>=_0x16f2fb){_0x2d33b1=_0x16f2fb;_0x1ced73=0xc8;}else{_0x1ced73=0xce;}_0x5a6ce2[_0xeccf('0x18')](_0x1ced73);return _0x5a6ce2['set'](_0xeccf('0x1f'),_0x30faa5+'-'+_0x2d33b1+'/'+_0x16f2fb)[_0xeccf('0x1a')](_0x2f1444);}return null;};}function patchUpdates(_0x3e6ae2){return function(_0x3423fa){try{jsonpatch[_0xeccf('0x20')](_0x3423fa,_0x3e6ae2,!![]);}catch(_0x25e144){return BPromise[_0xeccf('0x21')](_0x25e144);}return _0x3423fa['save']();};}function saveUpdates(_0x13378f,_0x326957){return function(_0x546739){if(_0x546739){return _0x546739[_0xeccf('0x22')](_0x13378f)[_0xeccf('0x23')](function(_0x419c3b){return _0x419c3b;});}return null;};}function removeEntity(_0x2243f8,_0x73fd95){return function(_0x38b35f){if(_0x38b35f){return _0x38b35f[_0xeccf('0x24')]()[_0xeccf('0x23')](function(){_0x2243f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bb217,_0x3e101e){return function(_0x760376){if(!_0x760376){_0x2bb217[_0xeccf('0x17')](0x194);}return _0x760376;};}function handleError(_0x517b38,_0x1406e1){_0x1406e1=_0x1406e1||0x1f4;return function(_0x3b2fd7){logger[_0xeccf('0x25')](_0x3b2fd7[_0xeccf('0x26')]);if(_0x3b2fd7[_0xeccf('0x27')]){delete _0x3b2fd7['name'];}_0x517b38[_0xeccf('0x18')](_0x1406e1)[_0xeccf('0x28')](_0x3b2fd7);};}exports[_0xeccf('0x29')]=function(_0x2157ba,_0x45274c){var _0xf8f14={},_0x3fa7e0={},_0x5a76e6={'count':0x0,'rows':[]};var _0x59cc6d=_[_0xeccf('0x2a')](db[_0xeccf('0x2b')][_0xeccf('0x2c')],function(_0x510975){return{'name':_0x510975['fieldName'],'type':_0x510975[_0xeccf('0x2d')][_0xeccf('0x2e')]};});_0x3fa7e0['model']=_[_0xeccf('0x2a')](_0x59cc6d,_0xeccf('0x27'));_0x3fa7e0[_0xeccf('0x2f')]=_[_0xeccf('0x30')](_0x2157ba[_0xeccf('0x2f')]);_0x3fa7e0[_0xeccf('0x31')]=_['intersection'](_0x3fa7e0[_0xeccf('0x32')],_0x3fa7e0['query']);_0xf8f14[_0xeccf('0x33')]=_[_0xeccf('0x34')](_0x3fa7e0['model'],qs['fields'](_0x2157ba[_0xeccf('0x2f')][_0xeccf('0x35')]));_0xf8f14[_0xeccf('0x33')]=_0xf8f14['attributes'][_0xeccf('0x36')]?_0xf8f14[_0xeccf('0x33')]:_0x3fa7e0['model'];if(!_0x2157ba['query'][_0xeccf('0x37')]('nolimit')){_0xf8f14['limit']=qs[_0xeccf('0x1d')](_0x2157ba['query'][_0xeccf('0x1d')]);_0xf8f14['offset']=qs['offset'](_0x2157ba['query'][_0xeccf('0x1b')]);}_0xf8f14[_0xeccf('0x38')]=qs['sort'](_0x2157ba['query'][_0xeccf('0x39')]);_0xf8f14[_0xeccf('0x3a')]=qs[_0xeccf('0x31')](_[_0xeccf('0x3b')](_0x2157ba[_0xeccf('0x2f')],_0x3fa7e0[_0xeccf('0x31')]),_0x59cc6d);if(_0x2157ba['query'][_0xeccf('0x3c')]){_0xf8f14[_0xeccf('0x3a')]=_[_0xeccf('0x3d')](_0xf8f14[_0xeccf('0x3a')],{'$or':_[_0xeccf('0x2a')](_0x59cc6d,function(_0x4f7fca){if(_0x4f7fca[_0xeccf('0x2d')]!==_0xeccf('0x3e')){var _0x51da0e={};_0x51da0e[_0x4f7fca['name']]={'$like':'%'+_0x2157ba[_0xeccf('0x2f')][_0xeccf('0x3c')]+'%'};return _0x51da0e;}})});}_0xf8f14=_[_0xeccf('0x3d')]({},_0xf8f14,_0x2157ba[_0xeccf('0x3f')]);var _0x164bf={'where':_0xf8f14[_0xeccf('0x3a')]};return db[_0xeccf('0x2b')][_0xeccf('0x1e')](_0x164bf)[_0xeccf('0x23')](function(_0x2af792){_0x5a76e6[_0xeccf('0x1e')]=_0x2af792;if(_0x2157ba[_0xeccf('0x2f')][_0xeccf('0x40')]){_0xf8f14[_0xeccf('0x41')]=[{'all':!![]}];}return db[_0xeccf('0x2b')][_0xeccf('0x42')](_0xf8f14);})[_0xeccf('0x23')](function(_0x1b9c02){_0x5a76e6['rows']=_0x1b9c02;return _0x5a76e6;})[_0xeccf('0x23')](respondWithFilteredResult(_0x45274c,_0xf8f14))[_0xeccf('0x43')](handleError(_0x45274c,null));};exports[_0xeccf('0x44')]=function(_0x111cbb,_0x987f43){var _0x4667b8={'raw':!![],'where':{'id':_0x111cbb[_0xeccf('0x45')]['id']}},_0x576131={};_0x576131[_0xeccf('0x32')]=_[_0xeccf('0x30')](db[_0xeccf('0x2b')][_0xeccf('0x2c')]);_0x576131[_0xeccf('0x2f')]=_[_0xeccf('0x30')](_0x111cbb['query']);_0x576131[_0xeccf('0x31')]=_[_0xeccf('0x34')](_0x576131[_0xeccf('0x32')],_0x576131[_0xeccf('0x2f')]);_0x4667b8[_0xeccf('0x33')]=_[_0xeccf('0x34')](_0x576131[_0xeccf('0x32')],qs['fields'](_0x111cbb[_0xeccf('0x2f')]['fields']));_0x4667b8['attributes']=_0x4667b8[_0xeccf('0x33')][_0xeccf('0x36')]?_0x4667b8[_0xeccf('0x33')]:_0x576131[_0xeccf('0x32')];if(_0x111cbb[_0xeccf('0x2f')][_0xeccf('0x40')]){_0x4667b8[_0xeccf('0x41')]=[{'all':!![]}];}_0x4667b8=_[_0xeccf('0x3d')]({},_0x4667b8,_0x111cbb[_0xeccf('0x3f')]);return db[_0xeccf('0x2b')][_0xeccf('0x46')](_0x4667b8)[_0xeccf('0x23')](handleEntityNotFound(_0x987f43,null))[_0xeccf('0x23')](respondWithResult(_0x987f43,null))['catch'](handleError(_0x987f43,null));};exports[_0xeccf('0x47')]=function(_0x167fac,_0x34f427){return db['ZohoField']['create'](_0x167fac['body'],{})[_0xeccf('0x23')](respondWithResult(_0x34f427,0xc9))[_0xeccf('0x43')](handleError(_0x34f427,null));};exports[_0xeccf('0x22')]=function(_0x4391a5,_0x2cf3f3){if(_0x4391a5[_0xeccf('0x48')]['id']){delete _0x4391a5[_0xeccf('0x48')]['id'];}return db[_0xeccf('0x2b')][_0xeccf('0x46')]({'where':{'id':_0x4391a5[_0xeccf('0x45')]['id']}})[_0xeccf('0x23')](handleEntityNotFound(_0x2cf3f3,null))['then'](saveUpdates(_0x4391a5[_0xeccf('0x48')],null))[_0xeccf('0x23')](respondWithResult(_0x2cf3f3,null))[_0xeccf('0x43')](handleError(_0x2cf3f3,null));};exports['destroy']=function(_0x5c3405,_0x46d339){return db[_0xeccf('0x2b')][_0xeccf('0x46')]({'where':{'id':_0x5c3405[_0xeccf('0x45')]['id']}})[_0xeccf('0x23')](handleEntityNotFound(_0x46d339,null))[_0xeccf('0x23')](removeEntity(_0x46d339,null))[_0xeccf('0x43')](handleError(_0x46d339,null));};
\ No newline at end of file
index 9a195a0..325a441 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3da=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','lodash','util','../../config/logger'];(function(_0x4191b2,_0xed89f7){var _0x292fba=function(_0x2625b8){while(--_0x2625b8){_0x4191b2['push'](_0x4191b2['shift']());}};_0x292fba(++_0xed89f7);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d11=['exports','define','ZohoField','int_zoho_fields','lodash','util','../../config/logger','moment','request-promise','path','./intZohoField.attributes'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6d11,0xbf));var _0x16d1=function(_0x23c025,_0x2cf181){_0x23c025=_0x23c025-0x0;var _0x2c21f5=_0x6d11[_0x23c025];return _0x2c21f5;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));module[_0x16d1('0x7')]=function(_0x3eb9e2,_0x38626d){return _0x3eb9e2[_0x16d1('0x8')](_0x16d1('0x9'),attributes,{'tableName':_0x16d1('0xa'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 28af9d9..149980c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94b9=['../../config/utils','../../config/environment','jayson/promise','client','http','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2f3898,_0x2d8ecd){var _0x261f41=function(_0x134e07){while(--_0x134e07){_0x2f3898['push'](_0x2f3898['shift']());}};_0x261f41(++_0x2d8ecd);}(_0x94b9,0xcc));var _0x994b=function(_0x45e536,_0x29e52e){_0x45e536=_0x45e536-0x0;var _0x1c4260=_0x94b9[_0x45e536];return _0x1c4260;};'use strict';var _=require(_0x994b('0x0'));var util=require(_0x994b('0x1'));var moment=require(_0x994b('0x2'));var BPromise=require(_0x994b('0x3'));var rs=require(_0x994b('0x4'));var fs=require('fs');var Redis=require(_0x994b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x994b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x994b('0x7'));var jayson=require(_0x994b('0x8'));var client=jayson[_0x994b('0x9')][_0x994b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49ad92,_0x59b49d,_0x5792c0){return new BPromise(function(_0x4558ee,_0x1c2730){return client['request'](_0x49ad92,_0x5792c0)['then'](function(_0x1d1e03){logger['info'](_0x994b('0xb'),_0x59b49d,_0x994b('0xc'));logger[_0x994b('0xd')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x59b49d,_0x994b('0xc'),JSON[_0x994b('0xe')](_0x1d1e03));if(_0x1d1e03[_0x994b('0xf')]){if(_0x1d1e03['error'][_0x994b('0x10')]===0x1f4){logger['error'](_0x994b('0xb'),_0x59b49d,_0x1d1e03[_0x994b('0xf')][_0x994b('0x11')]);return _0x1c2730(_0x1d1e03[_0x994b('0xf')][_0x994b('0x11')]);}logger[_0x994b('0xf')](_0x994b('0xb'),_0x59b49d,_0x1d1e03['error'][_0x994b('0x11')]);return _0x4558ee(_0x1d1e03[_0x994b('0xf')]['message']);}else{logger[_0x994b('0x12')](_0x994b('0xb'),_0x59b49d,_0x994b('0xc'));_0x4558ee(_0x1d1e03[_0x994b('0x13')][_0x994b('0x11')]);}})[_0x994b('0x14')](function(_0x10379f){logger[_0x994b('0xf')](_0x994b('0xb'),_0x59b49d,_0x10379f);_0x1c2730(_0x10379f);});});}
\ No newline at end of file
+var _0xb37d=['then','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0xf5d2af,_0x512c78){var _0x30ec40=function(_0x32de0f){while(--_0x32de0f){_0xf5d2af['push'](_0xf5d2af['shift']());}};_0x30ec40(++_0x512c78);}(_0xb37d,0x1e4));var _0xdb37=function(_0x91eec6,_0xc46f10){_0x91eec6=_0x91eec6-0x0;var _0x4d38de=_0xb37d[_0x91eec6];return _0x4d38de;};'use strict';var _=require('lodash');var util=require(_0xdb37('0x0'));var moment=require('moment');var BPromise=require(_0xdb37('0x1'));var rs=require(_0xdb37('0x2'));var fs=require('fs');var Redis=require(_0xdb37('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdb37('0x4'))('rpc');var config=require(_0xdb37('0x5'));var jayson=require(_0xdb37('0x6'));var client=jayson[_0xdb37('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3535b8,_0x29724c,_0x22f4a0){return new BPromise(function(_0x38530d,_0x3d0602){return client[_0xdb37('0x8')](_0x3535b8,_0x22f4a0)[_0xdb37('0x9')](function(_0x37b877){logger['info'](_0xdb37('0xa'),_0x29724c,_0xdb37('0xb'));logger['debug'](_0xdb37('0xc'),_0x29724c,_0xdb37('0xb'),JSON[_0xdb37('0xd')](_0x37b877));if(_0x37b877[_0xdb37('0xe')]){if(_0x37b877['error']['code']===0x1f4){logger['error'](_0xdb37('0xa'),_0x29724c,_0x37b877[_0xdb37('0xe')][_0xdb37('0xf')]);return _0x3d0602(_0x37b877[_0xdb37('0xe')][_0xdb37('0xf')]);}logger[_0xdb37('0xe')](_0xdb37('0xa'),_0x29724c,_0x37b877[_0xdb37('0xe')][_0xdb37('0xf')]);return _0x38530d(_0x37b877[_0xdb37('0xe')][_0xdb37('0xf')]);}else{logger['info'](_0xdb37('0xa'),_0x29724c,_0xdb37('0xb'));_0x38530d(_0x37b877[_0xdb37('0x10')][_0xdb37('0xf')]);}})['catch'](function(_0x497fa1){logger[_0xdb37('0xe')](_0xdb37('0xa'),_0x29724c,_0x497fa1);_0x3d0602(_0x497fa1);});});}
\ No newline at end of file
index c59c117..26676bc 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(_0x106f1d,_0x27fe06){var _0x254b9b=function(_0xdf3737){while(--_0xdf3737){_0x106f1d['push'](_0x106f1d['shift']());}};_0x254b9b(++_0x27fe06);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3cf673,_0x12e347){var _0x45a5b8=function(_0x346cec){while(--_0x346cec){_0x3cf673['push'](_0x3cf673['shift']());}};_0x45a5b8(++_0x12e347);}(_0xedd9,0xfc));var _0x9edd=function(_0x19ad68,_0x4d61e8){_0x19ad68=_0x19ad68-0x0;var _0x27cc30=_0xedd9[_0x19ad68];return _0x27cc30;};'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 63b91a0..ede49f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c4c=['unique_name_and_version','STRING','INTEGER','BOOLEAN','state','exports'];(function(_0x1de48c,_0xe35a61){var _0x4349ee=function(_0x50b794){while(--_0x50b794){_0x1de48c['push'](_0x1de48c['shift']());}};_0x4349ee(++_0xe35a61);}(_0x5c4c,0x95));var _0xc5c4=function(_0x2ba000,_0x3b84c0){_0x2ba000=_0x2ba000-0x0;var _0x5e28dd=_0x5c4c[_0x2ba000];return _0x5e28dd;};'use strict';var Sequelize=require('sequelize');module[_0xc5c4('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc5c4('0x1')},'version':{'type':Sequelize[_0xc5c4('0x2')],'allowNull':![],'unique':_0xc5c4('0x1')},'main':{'type':Sequelize[_0xc5c4('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xc5c4('0x2')]},'path':{'type':Sequelize[_0xc5c4('0x2')]},'type':{'type':Sequelize[_0xc5c4('0x2')]},'size':{'type':Sequelize[_0xc5c4('0x3')]},'active':{'type':Sequelize[_0xc5c4('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xc5c4('0x2')]},'state':{'type':Sequelize[_0xc5c4('0x2')],'unique':_0xc5c4('0x5')},'description':{'type':Sequelize[_0xc5c4('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc5c4('0x2')]},'link':{'type':Sequelize[_0xc5c4('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xb627=['sequelize','unique_name_and_version','STRING','app.js','INTEGER','state'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0xb627,0x144));var _0x7b62=function(_0x9e65a3,_0x3fbfda){_0x9e65a3=_0x9e65a3-0x0;var _0x149f6c=_0xb627[_0x9e65a3];return _0x149f6c;};'use strict';var Sequelize=require(_0x7b62('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7b62('0x1')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7b62('0x1')},'main':{'type':Sequelize[_0x7b62('0x2')],'defaultValue':_0x7b62('0x3')},'filename':{'type':Sequelize[_0x7b62('0x2')]},'path':{'type':Sequelize[_0x7b62('0x2')]},'type':{'type':Sequelize[_0x7b62('0x2')]},'size':{'type':Sequelize[_0x7b62('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x7b62('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x7b62('0x2')],'unique':_0x7b62('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x7b62('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x7b62('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index 7233ff2..f099b1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x161f59,_0x42e9ff){var _0x3ffa0e=function(_0x3aef14){while(--_0x3aef14){_0x161f59['push'](_0x161f59['shift']());}};_0x3ffa0e(++_0x42e9ff);}(_0x2542,0x169));var _0x2254=function(_0x2a7d3e,_0x33f9bc){_0x2a7d3e=_0x2a7d3e-0x0;var _0x563e53=_0x2542[_0x2a7d3e];return _0x563e53;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['Integration'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));};
\ No newline at end of file
+var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','Integration','fieldName','type','key'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xadb5,0xad));var _0x5adb=function(_0x4d81cf,_0xf09d85){_0x4d81cf=_0x4d81cf-0x0;var _0x2606ad=_0xadb5[_0x4d81cf];return _0x2606ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
index 1d345fd..0587f37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc18=['rimraf','../../config/environment','./integration.attributes','Integration','integrations','lodash','util','bluebird','path'];(function(_0x1f6feb,_0x49d07f){var _0x5c2053=function(_0x99e452){while(--_0x99e452){_0x1f6feb['push'](_0x1f6feb['shift']());}};_0x5c2053(++_0x49d07f);}(_0xfc18,0x11c));var _0x8fc1=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xfc18[_0x19159a];return _0xa677f4;};'use strict';var _=require(_0x8fc1('0x0'));var util=require(_0x8fc1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8fc1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fc1('0x3'));var rimraf=require(_0x8fc1('0x4'));var config=require(_0x8fc1('0x5'));var attributes=require(_0x8fc1('0x6'));module['exports']=function(_0x3a2226,_0x141c30){return _0x3a2226['define'](_0x8fc1('0x7'),attributes,{'tableName':_0x8fc1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6030=['util','../../config/logger','api','moment','request-promise','path','rimraf','./integration.attributes','exports','Integration','integrations'];(function(_0x593bce,_0x484075){var _0x4f56c9=function(_0x583a02){while(--_0x583a02){_0x593bce['push'](_0x593bce['shift']());}};_0x4f56c9(++_0x484075);}(_0x6030,0x197));var _0x0603=function(_0x3221a4,_0xedb080){_0x3221a4=_0x3221a4-0x0;var _0x221ada=_0x6030[_0x3221a4];return _0x221ada;};'use strict';var _=require('lodash');var util=require(_0x0603('0x0'));var logger=require(_0x0603('0x1'))(_0x0603('0x2'));var moment=require(_0x0603('0x3'));var BPromise=require('bluebird');var rp=require(_0x0603('0x4'));var fs=require('fs');var path=require(_0x0603('0x5'));var rimraf=require(_0x0603('0x6'));var config=require('../../config/environment');var attributes=require(_0x0603('0x7'));module[_0x0603('0x8')]=function(_0x419785,_0x16eccb){return _0x419785['define'](_0x0603('0x9'),attributes,{'tableName':_0x0603('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd88de5..1602b5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4f=['lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x343b18,_0x26eba1){var _0x5d59b2=function(_0x2d1d44){while(--_0x2d1d44){_0x343b18['push'](_0x343b18['shift']());}};_0x5d59b2(++_0x26eba1);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xc197eb,_0x35dc61){_0xc197eb=_0xc197eb-0x0;var _0x4be264=_0xdd4f[_0xc197eb];return _0x4be264;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});}
\ No newline at end of file
+var _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x5a0c7b,_0x1c383a){var _0x32c174=function(_0x21fbb4){while(--_0x21fbb4){_0x5a0c7b['push'](_0x5a0c7b['shift']());}};_0x32c174(++_0x1c383a);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}
\ No newline at end of file
index 7be1b13..9015c73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x552571,_0x3f41d5){var _0x4a6831=function(_0x27fcae){while(--_0x27fcae){_0x552571['push'](_0x552571['shift']());}};_0x4a6831(++_0x3f41d5);}(_0x2542,0x169));var _0x2254=function(_0x22ae59,_0x2f59c7){_0x22ae59=_0x22ae59-0x0;var _0x551b67=_0x2542[_0x22ae59];return _0x551b67;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router;
\ No newline at end of file
+var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x312ba6,_0x584157){var _0xfe3882=function(_0x5a6deb){while(--_0x5a6deb){_0x312ba6['push'](_0x312ba6['shift']());}};_0xfe3882(++_0x584157);}(_0x2542,0x169));var _0x2254=function(_0x452edb,_0x16dba6){_0x452edb=_0x452edb-0x0;var _0x182554=_0x2542[_0x452edb];return _0x182554;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router;
\ No newline at end of file
index 95d0eea..f644244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff2a=['SENDING','RECEIVED','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x2153c9,_0x49dad4){var _0x1bbb2a=function(_0x5e240e){while(--_0x5e240e){_0x2153c9['push'](_0x2153c9['shift']());}};_0x1bbb2a(++_0x49dad4);}(_0xff2a,0x121));var _0xaff2=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xff2a[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0xaff2('0x0'));module['exports']={'integration':{'type':Sequelize[_0xaff2('0x1')]},'eventChannel':{'type':Sequelize[_0xaff2('0x1')]},'exitStatus':{'type':Sequelize[_0xaff2('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xaff2('0x2')]},'contacts':{'type':Sequelize[_0xaff2('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaff2('0x1')]},'queue':{'type':Sequelize[_0xaff2('0x1')]},'interface':{'type':Sequelize[_0xaff2('0x1')]},'membername':{'type':Sequelize[_0xaff2('0x1')]},'agentcalledAt':{'type':Sequelize[_0xaff2('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xaff2('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xaff2('0x2')]},'agentacw':{'type':Sequelize[_0xaff2('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xaff2('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xaff2('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xaff2('0x3')]},'agentdump':{'type':Sequelize[_0xaff2('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xaff2('0x1')]},'channel':{'type':Sequelize[_0xaff2('0x1')]},'channelstate':{'type':Sequelize[_0xaff2('0x2')]},'channelstatedesc':{'type':Sequelize[_0xaff2('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xaff2('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaff2('0x1')]},'context':{'type':Sequelize[_0xaff2('0x1')]},'exten':{'type':Sequelize[_0xaff2('0x1')]},'priority':{'type':Sequelize[_0xaff2('0x1')]},'destchannel':{'type':Sequelize[_0xaff2('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaff2('0x1')]},'destcalleridnum':{'type':Sequelize[_0xaff2('0x1')]},'destcalleridname':{'type':Sequelize[_0xaff2('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xaff2('0x1')]},'destlanguage':{'type':Sequelize[_0xaff2('0x1')]},'destaccountcode':{'type':Sequelize[_0xaff2('0x1')]},'destcontext':{'type':Sequelize[_0xaff2('0x1')]},'destexten':{'type':Sequelize[_0xaff2('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xaff2('0x1')]},'messageId':{'type':Sequelize[_0xaff2('0x1')]},'inReplyTo':{'type':Sequelize[_0xaff2('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xaff2('0x1')]},'attachment':{'type':Sequelize[_0xaff2('0x5')]},'html':{'type':Sequelize[_0xaff2('0x5')]},'text':{'type':Sequelize[_0xaff2('0x5')]},'status':{'type':Sequelize[_0xaff2('0x6')](_0xaff2('0x7'),_0xaff2('0x8'),_0xaff2('0x9'),_0xaff2('0xa'))},'url':{'type':Sequelize[_0xaff2('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xaff2('0x2')]}};
\ No newline at end of file
+var _0xe618=['INTEGER','TEXT','SENT','SENDING','FAILED','sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe618,0x1ef));var _0x8e61=function(_0x5e31f3,_0x26086d){_0x5e31f3=_0x5e31f3-0x0;var _0xe8f38b=_0xe618[_0x5e31f3];return _0xe8f38b;};'use strict';var Sequelize=require(_0x8e61('0x0'));module[_0x8e61('0x1')]={'integration':{'type':Sequelize[_0x8e61('0x2')]},'eventChannel':{'type':Sequelize[_0x8e61('0x2')]},'exitStatus':{'type':Sequelize[_0x8e61('0x2')]},'ticketId':{'type':Sequelize[_0x8e61('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x8e61('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8e61('0x2')]},'calleridname':{'type':Sequelize[_0x8e61('0x2')]},'queue':{'type':Sequelize[_0x8e61('0x2')]},'interface':{'type':Sequelize[_0x8e61('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x8e61('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8e61('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8e61('0x3')]},'talktime':{'type':Sequelize[_0x8e61('0x5')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8e61('0x5')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8e61('0x3')]},'agentdump':{'type':Sequelize[_0x8e61('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8e61('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8e61('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x8e61('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8e61('0x2')]},'connectedlinename':{'type':Sequelize[_0x8e61('0x2')]},'language':{'type':Sequelize[_0x8e61('0x2')]},'accountcode':{'type':Sequelize[_0x8e61('0x2')]},'context':{'type':Sequelize[_0x8e61('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x8e61('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8e61('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8e61('0x2')]},'destcalleridname':{'type':Sequelize[_0x8e61('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8e61('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8e61('0x2')]},'destaccountcode':{'type':Sequelize[_0x8e61('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x8e61('0x2')]},'destuniqueid':{'type':Sequelize[_0x8e61('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8e61('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8e61('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x8e61('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x8e61('0x6')]},'status':{'type':Sequelize['ENUM'](_0x8e61('0x7'),_0x8e61('0x8'),'RECEIVED',_0x8e61('0x9'))},'url':{'type':Sequelize[_0x8e61('0x2')]},'app':{'type':Sequelize[_0x8e61('0x2')]},'appdata':{'type':Sequelize[_0x8e61('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index c8201d0..b3d7f40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bbc=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','create','catch','body','describe','eml-format','rimraf'];(function(_0x2fd092,_0x264098){var _0xb5f073=function(_0x333985){while(--_0x333985){_0x2fd092['push'](_0x2fd092['shift']());}};_0xb5f073(++_0x264098);}(_0x0bbc,0x1cc));var _0xc0bb=function(_0x3f39ae,_0x15be25){_0x3f39ae=_0x3f39ae-0x0;var _0x225fa6=_0x0bbc[_0x3f39ae];return _0x225fa6;};'use strict';var emlformat=require(_0xc0bb('0x0'));var rimraf=require(_0xc0bb('0x1'));var zipdir=require(_0xc0bb('0x2'));var jsonpatch=require(_0xc0bb('0x3'));var rp=require(_0xc0bb('0x4'));var moment=require('moment');var BPromise=require(_0xc0bb('0x5'));var Mustache=require(_0xc0bb('0x6'));var util=require(_0xc0bb('0x7'));var path=require(_0xc0bb('0x8'));var sox=require('sox');var csv=require(_0xc0bb('0x9'));var ejs=require(_0xc0bb('0xa'));var fs=require('fs');var fs_extra=require(_0xc0bb('0xb'));var _=require(_0xc0bb('0xc'));var squel=require('squel');var crypto=require(_0xc0bb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc0bb('0xe'));var toCsv=require(_0xc0bb('0x9'));var querystring=require(_0xc0bb('0xf'));var Papa=require('papaparse');var Redis=require(_0xc0bb('0x10'));var authService=require(_0xc0bb('0x11'));var qs=require(_0xc0bb('0x12'));var as=require(_0xc0bb('0x13'));var hardwareService=require(_0xc0bb('0x14'));var logger=require(_0xc0bb('0x15'))('api');var utils=require(_0xc0bb('0x16'));var config=require(_0xc0bb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0bb('0x18'))['db'];function respondWithStatusCode(_0x55a4f8,_0x3de2fc){_0x3de2fc=_0x3de2fc||0xcc;return function(_0x36705b){if(_0x36705b){return _0x55a4f8['sendStatus'](_0x3de2fc);}return _0x55a4f8[_0xc0bb('0x19')](_0x3de2fc)['end']();};}function respondWithResult(_0x351a7f,_0x29c8e8){_0x29c8e8=_0x29c8e8||0xc8;return function(_0x3d43bb){if(_0x3d43bb){return _0x351a7f[_0xc0bb('0x19')](_0x29c8e8)[_0xc0bb('0x1a')](_0x3d43bb);}};}function respondWithFilteredResult(_0x135faa,_0x487482){return function(_0x203a9f){if(_0x203a9f){var _0x2c342c=typeof _0x487482[_0xc0bb('0x1b')]===_0xc0bb('0x1c')&&typeof _0x487482[_0xc0bb('0x1d')]==='undefined';var _0x45777d=_0x203a9f[_0xc0bb('0x1e')];var _0x19e07c=_0x2c342c?0x0:_0x487482[_0xc0bb('0x1b')];var _0x5f8bae=_0x2c342c?_0x203a9f[_0xc0bb('0x1e')]:_0x487482['offset']+_0x487482['limit'];var _0x4d653a;if(_0x5f8bae>=_0x45777d){_0x5f8bae=_0x45777d;_0x4d653a=0xc8;}else{_0x4d653a=0xce;}_0x135faa[_0xc0bb('0x19')](_0x4d653a);return _0x135faa[_0xc0bb('0x1f')](_0xc0bb('0x20'),_0x19e07c+'-'+_0x5f8bae+'/'+_0x45777d)[_0xc0bb('0x1a')](_0x203a9f);}return null;};}function patchUpdates(_0x414773){return function(_0x5440aa){try{jsonpatch[_0xc0bb('0x21')](_0x5440aa,_0x414773,!![]);}catch(_0x165a0e){return BPromise[_0xc0bb('0x22')](_0x165a0e);}return _0x5440aa[_0xc0bb('0x23')]();};}function saveUpdates(_0x4fe72e,_0x25c739){return function(_0x4f2ff2){if(_0x4f2ff2){return _0x4f2ff2[_0xc0bb('0x24')](_0x4fe72e)[_0xc0bb('0x25')](function(_0xe1290b){return _0xe1290b;});}return null;};}function removeEntity(_0x47d6a2,_0x3e16ed){return function(_0x41ac37){if(_0x41ac37){return _0x41ac37[_0xc0bb('0x26')]()['then'](function(){_0x47d6a2[_0xc0bb('0x19')](0xcc)[_0xc0bb('0x27')]();});}};}function handleEntityNotFound(_0x62a31d,_0x31ac6d){return function(_0x23cb4b){if(!_0x23cb4b){_0x62a31d[_0xc0bb('0x28')](0x194);}return _0x23cb4b;};}function handleError(_0x49a065,_0x33636d){_0x33636d=_0x33636d||0x1f4;return function(_0x46e773){logger['error'](_0x46e773[_0xc0bb('0x29')]);if(_0x46e773[_0xc0bb('0x2a')]){delete _0x46e773[_0xc0bb('0x2a')];}_0x49a065[_0xc0bb('0x19')](_0x33636d)[_0xc0bb('0x2b')](_0x46e773);};}exports['index']=function(_0x55fe11,_0x3a8828){var _0x382557={},_0x399571={},_0x166c2f={'count':0x0,'rows':[]};var _0x575bac=_[_0xc0bb('0x2c')](db[_0xc0bb('0x2d')][_0xc0bb('0x2e')],function(_0x502f9c){return{'name':_0x502f9c[_0xc0bb('0x2f')],'type':_0x502f9c[_0xc0bb('0x30')]['key']};});_0x399571[_0xc0bb('0x31')]=_[_0xc0bb('0x2c')](_0x575bac,_0xc0bb('0x2a'));_0x399571[_0xc0bb('0x32')]=_[_0xc0bb('0x33')](_0x55fe11[_0xc0bb('0x32')]);_0x399571[_0xc0bb('0x34')]=_[_0xc0bb('0x35')](_0x399571['model'],_0x399571[_0xc0bb('0x32')]);_0x382557[_0xc0bb('0x36')]=_['intersection'](_0x399571[_0xc0bb('0x31')],qs[_0xc0bb('0x37')](_0x55fe11[_0xc0bb('0x32')]['fields']));_0x382557[_0xc0bb('0x36')]=_0x382557[_0xc0bb('0x36')][_0xc0bb('0x38')]?_0x382557[_0xc0bb('0x36')]:_0x399571[_0xc0bb('0x31')];if(!_0x55fe11[_0xc0bb('0x32')][_0xc0bb('0x39')](_0xc0bb('0x3a'))){_0x382557[_0xc0bb('0x1d')]=qs[_0xc0bb('0x1d')](_0x55fe11[_0xc0bb('0x32')][_0xc0bb('0x1d')]);_0x382557['offset']=qs[_0xc0bb('0x1b')](_0x55fe11[_0xc0bb('0x32')]['offset']);}_0x382557[_0xc0bb('0x3b')]=qs[_0xc0bb('0x3c')](_0x55fe11[_0xc0bb('0x32')]['sort']);_0x382557[_0xc0bb('0x3d')]=qs[_0xc0bb('0x34')](_[_0xc0bb('0x3e')](_0x55fe11['query'],_0x399571[_0xc0bb('0x34')]),_0x575bac);if(_0x55fe11[_0xc0bb('0x32')]['filter']){_0x382557[_0xc0bb('0x3d')]=_[_0xc0bb('0x3f')](_0x382557[_0xc0bb('0x3d')],{'$or':_[_0xc0bb('0x2c')](_0x575bac,function(_0x36c575){if(_0x36c575[_0xc0bb('0x30')]!==_0xc0bb('0x40')){var _0x3fcf40={};_0x3fcf40[_0x36c575[_0xc0bb('0x2a')]]={'$like':'%'+_0x55fe11[_0xc0bb('0x32')][_0xc0bb('0x41')]+'%'};return _0x3fcf40;}})});}_0x382557=_[_0xc0bb('0x3f')]({},_0x382557,_0x55fe11[_0xc0bb('0x42')]);var _0x231b0f={'where':_0x382557[_0xc0bb('0x3d')]};return db[_0xc0bb('0x2d')][_0xc0bb('0x1e')](_0x231b0f)[_0xc0bb('0x25')](function(_0x24e7fd){_0x166c2f[_0xc0bb('0x1e')]=_0x24e7fd;if(_0x55fe11[_0xc0bb('0x32')][_0xc0bb('0x43')]){_0x382557[_0xc0bb('0x44')]=[{'all':!![]}];}return db[_0xc0bb('0x2d')][_0xc0bb('0x45')](_0x382557);})[_0xc0bb('0x25')](function(_0x494475){_0x166c2f['rows']=_0x494475;return _0x166c2f;})[_0xc0bb('0x25')](respondWithFilteredResult(_0x3a8828,_0x382557))['catch'](handleError(_0x3a8828,null));};exports[_0xc0bb('0x46')]=function(_0x4dcf66,_0x39c3af){var _0x2b5519={'raw':![],'where':{'id':_0x4dcf66[_0xc0bb('0x47')]['id']}},_0x4b25d6={};_0x4b25d6[_0xc0bb('0x31')]=_['keys'](db[_0xc0bb('0x2d')][_0xc0bb('0x2e')]);_0x4b25d6[_0xc0bb('0x32')]=_['keys'](_0x4dcf66['query']);_0x4b25d6['filters']=_[_0xc0bb('0x35')](_0x4b25d6[_0xc0bb('0x31')],_0x4b25d6[_0xc0bb('0x32')]);_0x2b5519[_0xc0bb('0x36')]=_['intersection'](_0x4b25d6[_0xc0bb('0x31')],qs[_0xc0bb('0x37')](_0x4dcf66[_0xc0bb('0x32')][_0xc0bb('0x37')]));_0x2b5519[_0xc0bb('0x36')]=_0x2b5519[_0xc0bb('0x36')]['length']?_0x2b5519[_0xc0bb('0x36')]:_0x4b25d6[_0xc0bb('0x31')];if(_0x4dcf66[_0xc0bb('0x32')][_0xc0bb('0x43')]){_0x2b5519['include']=[{'all':!![]}];}_0x2b5519=_['merge']({},_0x2b5519,_0x4dcf66[_0xc0bb('0x42')]);return db[_0xc0bb('0x2d')][_0xc0bb('0x48')](_0x2b5519)['then'](handleEntityNotFound(_0x39c3af,null))[_0xc0bb('0x25')](respondWithResult(_0x39c3af,null))['catch'](handleError(_0x39c3af,null));};exports[_0xc0bb('0x49')]=function(_0x1f0c39,_0xfa951b){return db[_0xc0bb('0x2d')]['create'](_0x1f0c39['body'],{})[_0xc0bb('0x25')](respondWithResult(_0xfa951b,0xc9))[_0xc0bb('0x4a')](handleError(_0xfa951b,null));};exports['update']=function(_0x2012a5,_0x576f9c){if(_0x2012a5[_0xc0bb('0x4b')]['id']){delete _0x2012a5[_0xc0bb('0x4b')]['id'];}return db[_0xc0bb('0x2d')][_0xc0bb('0x48')]({'where':{'id':_0x2012a5[_0xc0bb('0x47')]['id']}})['then'](handleEntityNotFound(_0x576f9c,null))[_0xc0bb('0x25')](saveUpdates(_0x2012a5[_0xc0bb('0x4b')],null))['then'](respondWithResult(_0x576f9c,null))[_0xc0bb('0x4a')](handleError(_0x576f9c,null));};exports['destroy']=function(_0x3eadbf,_0x47400f){return db[_0xc0bb('0x2d')][_0xc0bb('0x48')]({'where':{'id':_0x3eadbf[_0xc0bb('0x47')]['id']}})['then'](handleEntityNotFound(_0x47400f,null))[_0xc0bb('0x25')](removeEntity(_0x47400f,null))['catch'](handleError(_0x47400f,null));};exports[_0xc0bb('0x4c')]=function(_0x499bf3,_0x2c6382){return db['IntegrationReport'][_0xc0bb('0x4c')]()[_0xc0bb('0x25')](respondWithResult(_0x2c6382,null))[_0xc0bb('0x4a')](handleError(_0x2c6382,null));};
\ No newline at end of file
+var _0x967e=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','error','name','send','index','IntegrationReport','rawAttributes','fieldName','key','model','map','keys'];(function(_0x1058f9,_0x11212f){var _0x11f40a=function(_0x1b1f19){while(--_0x1b1f19){_0x1058f9['push'](_0x1058f9['shift']());}};_0x11f40a(++_0x11212f);}(_0x967e,0x14a));var _0xe967=function(_0x13f577,_0x5ea2cb){_0x13f577=_0x13f577-0x0;var _0xde1b7d=_0x967e[_0x13f577];return _0xde1b7d;};'use strict';var emlformat=require(_0xe967('0x0'));var rimraf=require(_0xe967('0x1'));var zipdir=require(_0xe967('0x2'));var jsonpatch=require(_0xe967('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe967('0x4'));var util=require(_0xe967('0x5'));var path=require(_0xe967('0x6'));var sox=require(_0xe967('0x7'));var csv=require(_0xe967('0x8'));var ejs=require(_0xe967('0x9'));var fs=require('fs');var fs_extra=require(_0xe967('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe967('0xb'));var jsforce=require(_0xe967('0xc'));var deskjs=require(_0xe967('0xd'));var toCsv=require(_0xe967('0x8'));var querystring=require(_0xe967('0xe'));var Papa=require(_0xe967('0xf'));var Redis=require(_0xe967('0x10'));var authService=require(_0xe967('0x11'));var qs=require(_0xe967('0x12'));var as=require(_0xe967('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe967('0x14'))(_0xe967('0x15'));var utils=require(_0xe967('0x16'));var config=require(_0xe967('0x17'));var licenseUtil=require(_0xe967('0x18'));var db=require(_0xe967('0x19'))['db'];function respondWithStatusCode(_0x515eae,_0x48709d){_0x48709d=_0x48709d||0xcc;return function(_0x10950f){if(_0x10950f){return _0x515eae[_0xe967('0x1a')](_0x48709d);}return _0x515eae['status'](_0x48709d)[_0xe967('0x1b')]();};}function respondWithResult(_0x52edb6,_0x14b9ad){_0x14b9ad=_0x14b9ad||0xc8;return function(_0x149f5a){if(_0x149f5a){return _0x52edb6[_0xe967('0x1c')](_0x14b9ad)[_0xe967('0x1d')](_0x149f5a);}};}function respondWithFilteredResult(_0x133c00,_0x596d15){return function(_0x144bc1){if(_0x144bc1){var _0x425096=typeof _0x596d15['offset']===_0xe967('0x1e')&&typeof _0x596d15[_0xe967('0x1f')]===_0xe967('0x1e');var _0x45fe1a=_0x144bc1[_0xe967('0x20')];var _0x2292e1=_0x425096?0x0:_0x596d15['offset'];var _0xbe9152=_0x425096?_0x144bc1['count']:_0x596d15[_0xe967('0x21')]+_0x596d15[_0xe967('0x1f')];var _0x4a17f1;if(_0xbe9152>=_0x45fe1a){_0xbe9152=_0x45fe1a;_0x4a17f1=0xc8;}else{_0x4a17f1=0xce;}_0x133c00[_0xe967('0x1c')](_0x4a17f1);return _0x133c00[_0xe967('0x22')](_0xe967('0x23'),_0x2292e1+'-'+_0xbe9152+'/'+_0x45fe1a)[_0xe967('0x1d')](_0x144bc1);}return null;};}function patchUpdates(_0x577d37){return function(_0x4c0a26){try{jsonpatch['apply'](_0x4c0a26,_0x577d37,!![]);}catch(_0x5b78ee){return BPromise[_0xe967('0x24')](_0x5b78ee);}return _0x4c0a26[_0xe967('0x25')]();};}function saveUpdates(_0x5b21fd,_0x3ff4a3){return function(_0x5b6c50){if(_0x5b6c50){return _0x5b6c50['update'](_0x5b21fd)[_0xe967('0x26')](function(_0x39ec67){return _0x39ec67;});}return null;};}function removeEntity(_0x1c7b92,_0x24e2f8){return function(_0x29cfea){if(_0x29cfea){return _0x29cfea['destroy']()['then'](function(){_0x1c7b92[_0xe967('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c9749,_0x40712a){return function(_0x5734c5){if(!_0x5734c5){_0x2c9749[_0xe967('0x1a')](0x194);}return _0x5734c5;};}function handleError(_0x10e43d,_0x3b4e6e){_0x3b4e6e=_0x3b4e6e||0x1f4;return function(_0x2da55e){logger[_0xe967('0x27')](_0x2da55e['stack']);if(_0x2da55e[_0xe967('0x28')]){delete _0x2da55e[_0xe967('0x28')];}_0x10e43d['status'](_0x3b4e6e)[_0xe967('0x29')](_0x2da55e);};}exports[_0xe967('0x2a')]=function(_0x6ddf4d,_0x39f79c){var _0xd3895a={},_0x12fa62={},_0x3266e8={'count':0x0,'rows':[]};var _0x420349=_['map'](db[_0xe967('0x2b')][_0xe967('0x2c')],function(_0x46f0bc){return{'name':_0x46f0bc[_0xe967('0x2d')],'type':_0x46f0bc['type'][_0xe967('0x2e')]};});_0x12fa62[_0xe967('0x2f')]=_[_0xe967('0x30')](_0x420349,_0xe967('0x28'));_0x12fa62['query']=_[_0xe967('0x31')](_0x6ddf4d[_0xe967('0x32')]);_0x12fa62[_0xe967('0x33')]=_[_0xe967('0x34')](_0x12fa62['model'],_0x12fa62[_0xe967('0x32')]);_0xd3895a[_0xe967('0x35')]=_[_0xe967('0x34')](_0x12fa62[_0xe967('0x2f')],qs[_0xe967('0x36')](_0x6ddf4d[_0xe967('0x32')][_0xe967('0x36')]));_0xd3895a['attributes']=_0xd3895a['attributes'][_0xe967('0x37')]?_0xd3895a[_0xe967('0x35')]:_0x12fa62[_0xe967('0x2f')];if(!_0x6ddf4d[_0xe967('0x32')][_0xe967('0x38')](_0xe967('0x39'))){_0xd3895a[_0xe967('0x1f')]=qs[_0xe967('0x1f')](_0x6ddf4d[_0xe967('0x32')][_0xe967('0x1f')]);_0xd3895a[_0xe967('0x21')]=qs[_0xe967('0x21')](_0x6ddf4d[_0xe967('0x32')][_0xe967('0x21')]);}_0xd3895a[_0xe967('0x3a')]=qs['sort'](_0x6ddf4d[_0xe967('0x32')][_0xe967('0x3b')]);_0xd3895a[_0xe967('0x3c')]=qs[_0xe967('0x33')](_[_0xe967('0x3d')](_0x6ddf4d['query'],_0x12fa62['filters']),_0x420349);if(_0x6ddf4d[_0xe967('0x32')]['filter']){_0xd3895a['where']=_['merge'](_0xd3895a[_0xe967('0x3c')],{'$or':_[_0xe967('0x30')](_0x420349,function(_0xb5d77e){if(_0xb5d77e[_0xe967('0x3e')]!=='VIRTUAL'){var _0x49673a={};_0x49673a[_0xb5d77e['name']]={'$like':'%'+_0x6ddf4d[_0xe967('0x32')][_0xe967('0x3f')]+'%'};return _0x49673a;}})});}_0xd3895a=_[_0xe967('0x40')]({},_0xd3895a,_0x6ddf4d[_0xe967('0x41')]);var _0x3da51e={'where':_0xd3895a[_0xe967('0x3c')]};return db[_0xe967('0x2b')][_0xe967('0x20')](_0x3da51e)[_0xe967('0x26')](function(_0x4b7991){_0x3266e8[_0xe967('0x20')]=_0x4b7991;if(_0x6ddf4d['query'][_0xe967('0x42')]){_0xd3895a[_0xe967('0x43')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0xd3895a);})[_0xe967('0x26')](function(_0x330c34){_0x3266e8[_0xe967('0x44')]=_0x330c34;return _0x3266e8;})['then'](respondWithFilteredResult(_0x39f79c,_0xd3895a))[_0xe967('0x45')](handleError(_0x39f79c,null));};exports[_0xe967('0x46')]=function(_0x1437d9,_0x396a0e){var _0x3d3436={'raw':![],'where':{'id':_0x1437d9[_0xe967('0x47')]['id']}},_0x3cbbd1={};_0x3cbbd1[_0xe967('0x2f')]=_['keys'](db[_0xe967('0x2b')][_0xe967('0x2c')]);_0x3cbbd1[_0xe967('0x32')]=_[_0xe967('0x31')](_0x1437d9[_0xe967('0x32')]);_0x3cbbd1[_0xe967('0x33')]=_[_0xe967('0x34')](_0x3cbbd1['model'],_0x3cbbd1[_0xe967('0x32')]);_0x3d3436[_0xe967('0x35')]=_[_0xe967('0x34')](_0x3cbbd1[_0xe967('0x2f')],qs[_0xe967('0x36')](_0x1437d9[_0xe967('0x32')]['fields']));_0x3d3436[_0xe967('0x35')]=_0x3d3436['attributes']['length']?_0x3d3436[_0xe967('0x35')]:_0x3cbbd1[_0xe967('0x2f')];if(_0x1437d9[_0xe967('0x32')][_0xe967('0x42')]){_0x3d3436[_0xe967('0x43')]=[{'all':!![]}];}_0x3d3436=_[_0xe967('0x40')]({},_0x3d3436,_0x1437d9[_0xe967('0x41')]);return db[_0xe967('0x2b')][_0xe967('0x48')](_0x3d3436)[_0xe967('0x26')](handleEntityNotFound(_0x396a0e,null))[_0xe967('0x26')](respondWithResult(_0x396a0e,null))[_0xe967('0x45')](handleError(_0x396a0e,null));};exports[_0xe967('0x49')]=function(_0x4b09a2,_0x17a82d){return db[_0xe967('0x2b')]['create'](_0x4b09a2[_0xe967('0x4a')],{})[_0xe967('0x26')](respondWithResult(_0x17a82d,0xc9))[_0xe967('0x45')](handleError(_0x17a82d,null));};exports['update']=function(_0x2ddcb7,_0x34cd76){if(_0x2ddcb7['body']['id']){delete _0x2ddcb7['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x2ddcb7[_0xe967('0x47')]['id']}})[_0xe967('0x26')](handleEntityNotFound(_0x34cd76,null))['then'](saveUpdates(_0x2ddcb7[_0xe967('0x4a')],null))[_0xe967('0x26')](respondWithResult(_0x34cd76,null))[_0xe967('0x45')](handleError(_0x34cd76,null));};exports['destroy']=function(_0x2388f1,_0x20171a){return db['IntegrationReport']['find']({'where':{'id':_0x2388f1[_0xe967('0x47')]['id']}})['then'](handleEntityNotFound(_0x20171a,null))['then'](removeEntity(_0x20171a,null))[_0xe967('0x45')](handleError(_0x20171a,null));};exports[_0xe967('0x4b')]=function(_0x48612e,_0x54f157){return db[_0xe967('0x2b')]['describe']()[_0xe967('0x26')](respondWithResult(_0x54f157,null))[_0xe967('0x45')](handleError(_0x54f157,null));};
\ No newline at end of file
index 1304b9f..ab5a4a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7af0=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./integrationReport.attributes'];(function(_0x4fbbff,_0x599525){var _0x1ae435=function(_0x56fd6e){while(--_0x56fd6e){_0x4fbbff['push'](_0x4fbbff['shift']());}};_0x1ae435(++_0x599525);}(_0x7af0,0x8e));var _0x07af=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x7af0[_0x1b1a3b];return _0x385347;};'use strict';var _=require(_0x07af('0x0'));var util=require(_0x07af('0x1'));var logger=require(_0x07af('0x2'))(_0x07af('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x07af('0x4'));var fs=require('fs');var path=require(_0x07af('0x5'));var rimraf=require('rimraf');var config=require(_0x07af('0x6'));var attributes=require(_0x07af('0x7'));module['exports']=function(_0x246a24,_0x55a788){return _0x246a24['define'](_0x07af('0x8'),attributes,{'tableName':_0x07af('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc56e=['define','IntegrationReport','report_integration','util','../../config/logger','api','bluebird','path','rimraf','./integrationReport.attributes','exports'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xc56e,0x158));var _0xec56=function(_0xeb63b,_0x1403f5){_0xeb63b=_0xeb63b-0x0;var _0x1f2722=_0xc56e[_0xeb63b];return _0x1f2722;};'use strict';var _=require('lodash');var util=require(_0xec56('0x0'));var logger=require(_0xec56('0x1'))(_0xec56('0x2'));var moment=require('moment');var BPromise=require(_0xec56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec56('0x4'));var rimraf=require(_0xec56('0x5'));var config=require('../../config/environment');var attributes=require(_0xec56('0x6'));module[_0xec56('0x7')]=function(_0x1e77c2,_0x3af276){return _0x1e77c2[_0xec56('0x8')](_0xec56('0x9'),attributes,{'tableName':_0xec56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e2c2d5e..8e07b34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['client','http','then','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','IntegrationReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x31fb0f,_0x3ddc79){var _0x6b4852=function(_0x226cfb){while(--_0x226cfb){_0x31fb0f['push'](_0x31fb0f['shift']());}};_0x6b4852(++_0x3ddc79);}(_0x0295,0x1f0));var _0x5029=function(_0x180a34,_0x2bd0cf){_0x180a34=_0x180a34-0x0;var _0x42edda=_0x0295[_0x180a34];return _0x42edda;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}
\ No newline at end of file
+var _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(_0x105c6a,_0x48c736){var _0x5b844d=function(_0x181f09){while(--_0x181f09){_0x105c6a['push'](_0x105c6a['shift']());}};_0x5b844d(++_0x48c736);}(_0x5fab,0x177));var _0xb5fa=function(_0x294b7a,_0x51b167){_0x294b7a=_0x294b7a-0x0;var _0x30d2a3=_0x5fab[_0x294b7a];return _0x30d2a3;};'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
index f2037ef..91b7734 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbe=['index','isAuthenticated','get','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x25a136,_0x57320e){var _0x5b7159=function(_0x32c8f9){while(--_0x32c8f9){_0x25a136['push'](_0x25a136['shift']());}};_0x5b7159(++_0x57320e);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x55852f,_0x4ddbcc){_0x55852f=_0x55852f-0x0;var _0x32b86b=_0xfcbe[_0x55852f];return _0x32b86b;};'use strict';var multer=require('multer');var util=require(_0xefcb('0x0'));var path=require(_0xefcb('0x1'));var timeout=require(_0xefcb('0x2'));var express=require(_0xefcb('0x3'));var router=express[_0xefcb('0x4')]();var fs_extra=require(_0xefcb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xefcb('0x6'));var config=require(_0xefcb('0x7'));var controller=require('./interval.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xefcb('0x8')]);router['get']('/:id',auth[_0xefcb('0x9')](),controller['show']);router[_0xefcb('0xa')](_0xefcb('0xb'),auth[_0xefcb('0x9')](),controller['getIntervals']);router[_0xefcb('0xc')]('/',auth[_0xefcb('0x9')](),controller['create']);router['post'](_0xefcb('0xb'),auth[_0xefcb('0x9')](),controller[_0xefcb('0xd')]);router[_0xefcb('0xc')](_0xefcb('0xe'),auth[_0xefcb('0x9')](),controller['addIntervals']);router[_0xefcb('0xf')](_0xefcb('0x10'),auth[_0xefcb('0x9')](),controller[_0xefcb('0x11')]);router[_0xefcb('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xefcb('0x13')]);module[_0xefcb('0x14')]=router;
\ No newline at end of file
+var _0xdca7=['isAuthenticated','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','put','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./interval.controller','get','show','/:id/sub_intervals'];(function(_0x256422,_0x2cdf18){var _0x41d8b3=function(_0x1f20ac){while(--_0x1f20ac){_0x256422['push'](_0x256422['shift']());}};_0x41d8b3(++_0x2cdf18);}(_0xdca7,0xe6));var _0x7dca=function(_0x32a4c3,_0x5396f9){_0x32a4c3=_0x32a4c3-0x0;var _0x47979f=_0xdca7[_0x32a4c3];return _0x47979f;};'use strict';var multer=require(_0x7dca('0x0'));var util=require('util');var path=require(_0x7dca('0x1'));var timeout=require(_0x7dca('0x2'));var express=require(_0x7dca('0x3'));var router=express['Router']();var fs_extra=require(_0x7dca('0x4'));var auth=require(_0x7dca('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7dca('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7dca('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7dca('0x8')]);router[_0x7dca('0x7')](_0x7dca('0x9'),auth[_0x7dca('0xa')](),controller[_0x7dca('0xb')]);router[_0x7dca('0xc')]('/',auth[_0x7dca('0xa')](),controller[_0x7dca('0xd')]);router[_0x7dca('0xc')](_0x7dca('0x9'),auth[_0x7dca('0xa')](),controller[_0x7dca('0xe')]);router['post'](_0x7dca('0xf'),auth[_0x7dca('0xa')](),controller['addIntervals']);router[_0x7dca('0x10')](_0x7dca('0x11'),auth[_0x7dca('0xa')](),controller['update']);router['delete'](_0x7dca('0x11'),auth[_0x7dca('0xa')](),controller[_0x7dca('0x12')]);module[_0x7dca('0x13')]=router;
\ No newline at end of file
index 3678cf3..33c918c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa6d=['exports','STRING'];(function(_0x13f83f,_0x44e4b6){var _0x5648f5=function(_0x2611bb){while(--_0x2611bb){_0x13f83f['push'](_0x13f83f['shift']());}};_0x5648f5(++_0x44e4b6);}(_0xfa6d,0x1c4));var _0xdfa6=function(_0x11a94f,_0x2de42a){_0x11a94f=_0x11a94f-0x0;var _0x54e2ed=_0xfa6d[_0x11a94f];return _0x54e2ed;};'use strict';var Sequelize=require('sequelize');module[_0xdfa6('0x0')]={'name':{'type':Sequelize[_0xdfa6('0x1')]},'description':{'type':Sequelize[_0xdfa6('0x1')]},'interval':{'type':Sequelize[_0xdfa6('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0xdc69=['exports','STRING','sequelize'];(function(_0x5154fa,_0x3667fe){var _0x488ad9=function(_0x343d56){while(--_0x343d56){_0x5154fa['push'](_0x5154fa['shift']());}};_0x488ad9(++_0x3667fe);}(_0xdc69,0x122));var _0x9dc6=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xdc69[_0x2555d0];return _0x3bb486;};'use strict';var Sequelize=require(_0x9dc6('0x0'));module[_0x9dc6('0x1')]={'name':{'type':Sequelize[_0x9dc6('0x2')]},'description':{'type':Sequelize[_0x9dc6('0x2')]},'interval':{'type':Sequelize[_0x9dc6('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 2e9aa0d..1ffca4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6094=['catch','show','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','IntervalId','getIntervals','order','pick','addIntervals','sequelize','transaction','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','limit','count','set','apply','save','then','destroy','get','UserProfileResource','name','index','map','Interval','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll'];(function(_0x4a6cb7,_0x48a3d5){var _0x3cc689=function(_0x1b96dc){while(--_0x1b96dc){_0x4a6cb7['push'](_0x4a6cb7['shift']());}};_0x3cc689(++_0x48a3d5);}(_0x6094,0x1c9));var _0x4609=function(_0x1d6d98,_0x127032){_0x1d6d98=_0x1d6d98-0x0;var _0x2a527a=_0x6094[_0x1d6d98];return _0x2a527a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4609('0x0'));var zipdir=require(_0x4609('0x1'));var jsonpatch=require(_0x4609('0x2'));var rp=require(_0x4609('0x3'));var moment=require(_0x4609('0x4'));var BPromise=require(_0x4609('0x5'));var Mustache=require(_0x4609('0x6'));var util=require(_0x4609('0x7'));var path=require(_0x4609('0x8'));var sox=require(_0x4609('0x9'));var csv=require(_0x4609('0xa'));var ejs=require(_0x4609('0xb'));var fs=require('fs');var fs_extra=require(_0x4609('0xc'));var _=require(_0x4609('0xd'));var squel=require(_0x4609('0xe'));var crypto=require(_0x4609('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x4609('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4609('0x11'));var Papa=require(_0x4609('0x12'));var Redis=require(_0x4609('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4609('0x14'));var as=require(_0x4609('0x15'));var hardwareService=require(_0x4609('0x16'));var logger=require(_0x4609('0x17'))(_0x4609('0x18'));var utils=require(_0x4609('0x19'));var config=require(_0x4609('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4609('0x1b'))['db'];var extensions=require(_0x4609('0x1c'));function respondWithStatusCode(_0x499b6f,_0x17feec){_0x17feec=_0x17feec||0xcc;return function(_0x4120ad){if(_0x4120ad){return _0x499b6f[_0x4609('0x1d')](_0x17feec);}return _0x499b6f[_0x4609('0x1e')](_0x17feec)[_0x4609('0x1f')]();};}function respondWithResult(_0x33c31f,_0x2ad926){_0x2ad926=_0x2ad926||0xc8;return function(_0x58eb38){if(_0x58eb38){return _0x33c31f['status'](_0x2ad926)[_0x4609('0x20')](_0x58eb38);}};}function respondWithFilteredResult(_0x111bea,_0x5963c9){return function(_0x220374){if(_0x220374){var _0x95bfc8=typeof _0x5963c9[_0x4609('0x21')]==='undefined'&&typeof _0x5963c9[_0x4609('0x22')]==='undefined';var _0x3523a8=_0x220374[_0x4609('0x23')];var _0x5ab44c=_0x95bfc8?0x0:_0x5963c9[_0x4609('0x21')];var _0x20ffd3=_0x95bfc8?_0x220374[_0x4609('0x23')]:_0x5963c9[_0x4609('0x21')]+_0x5963c9[_0x4609('0x22')];var _0x1f75a4;if(_0x20ffd3>=_0x3523a8){_0x20ffd3=_0x3523a8;_0x1f75a4=0xc8;}else{_0x1f75a4=0xce;}_0x111bea[_0x4609('0x1e')](_0x1f75a4);return _0x111bea[_0x4609('0x24')]('Content-Range',_0x5ab44c+'-'+_0x20ffd3+'/'+_0x3523a8)[_0x4609('0x20')](_0x220374);}return null;};}function patchUpdates(_0x3d820c){return function(_0x4335cb){try{jsonpatch[_0x4609('0x25')](_0x4335cb,_0x3d820c,!![]);}catch(_0x584bf7){return BPromise['reject'](_0x584bf7);}return _0x4335cb[_0x4609('0x26')]();};}function saveUpdates(_0x23fc8b,_0x2d2820){return function(_0x20a9b0){if(_0x20a9b0){return _0x20a9b0['update'](_0x23fc8b)[_0x4609('0x27')](function(_0x56d841){return _0x56d841;});}return null;};}function removeEntity(_0x1b8baf,_0x334ffa){return function(_0x41a472){if(_0x41a472){return _0x41a472[_0x4609('0x28')]()[_0x4609('0x27')](function(){var _0x48b90c=_0x41a472[_0x4609('0x29')]({'plain':!![]});var _0x46e47e='Intervals';return db[_0x4609('0x2a')]['destroy']({'where':{'type':_0x46e47e,'resourceId':_0x48b90c['id']}})['then'](function(){return _0x41a472;});})[_0x4609('0x27')](function(){_0x1b8baf[_0x4609('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35e104,_0xd05594){return function(_0x53f400){if(!_0x53f400){_0x35e104[_0x4609('0x1d')](0x194);}return _0x53f400;};}function handleError(_0x31534e,_0x485fc7){_0x485fc7=_0x485fc7||0x1f4;return function(_0x133c81){logger['error'](_0x133c81['stack']);if(_0x133c81[_0x4609('0x2b')]){delete _0x133c81[_0x4609('0x2b')];}_0x31534e[_0x4609('0x1e')](_0x485fc7)['send'](_0x133c81);};}exports[_0x4609('0x2c')]=function(_0xb57bc1,_0xb842a6){var _0x30eb1f={},_0x4d3d07={},_0x5d17fa={'count':0x0,'rows':[]};var _0x1808fa=_[_0x4609('0x2d')](db[_0x4609('0x2e')]['rawAttributes'],function(_0x3b089c){return{'name':_0x3b089c[_0x4609('0x2f')],'type':_0x3b089c[_0x4609('0x30')][_0x4609('0x31')]};});_0x4d3d07[_0x4609('0x32')]=_['map'](_0x1808fa,_0x4609('0x2b'));_0x4d3d07[_0x4609('0x33')]=_[_0x4609('0x34')](_0xb57bc1['query']);_0x4d3d07['filters']=_[_0x4609('0x35')](_0x4d3d07[_0x4609('0x32')],_0x4d3d07['query']);_0x30eb1f['attributes']=_['intersection'](_0x4d3d07[_0x4609('0x32')],qs[_0x4609('0x36')](_0xb57bc1['query'][_0x4609('0x36')]));_0x30eb1f['attributes']=_0x30eb1f[_0x4609('0x37')]['length']?_0x30eb1f['attributes']:_0x4d3d07['model'];if(!_0xb57bc1[_0x4609('0x33')][_0x4609('0x38')](_0x4609('0x39'))){_0x30eb1f['limit']=qs[_0x4609('0x22')](_0xb57bc1[_0x4609('0x33')][_0x4609('0x22')]);_0x30eb1f[_0x4609('0x21')]=qs[_0x4609('0x21')](_0xb57bc1[_0x4609('0x33')][_0x4609('0x21')]);}_0x30eb1f['order']=qs[_0x4609('0x3a')](_0xb57bc1['query'][_0x4609('0x3a')]);_0x30eb1f[_0x4609('0x3b')]=qs[_0x4609('0x3c')](_['pick'](_0xb57bc1[_0x4609('0x33')],_0x4d3d07[_0x4609('0x3c')]),_0x1808fa);if(_0xb57bc1[_0x4609('0x33')][_0x4609('0x3d')]){_0x30eb1f[_0x4609('0x3b')]=_[_0x4609('0x3e')](_0x30eb1f[_0x4609('0x3b')],{'$or':_[_0x4609('0x2d')](_0x1808fa,function(_0x9e150){if(_0x9e150[_0x4609('0x30')]!=='VIRTUAL'){var _0x3690a3={};_0x3690a3[_0x9e150[_0x4609('0x2b')]]={'$like':'%'+_0xb57bc1[_0x4609('0x33')][_0x4609('0x3d')]+'%'};return _0x3690a3;}})});}_0x30eb1f=_[_0x4609('0x3e')]({},_0x30eb1f,_0xb57bc1[_0x4609('0x3f')]);var _0x480b8d={'where':_0x30eb1f[_0x4609('0x3b')]};return db[_0x4609('0x2e')][_0x4609('0x23')](_0x480b8d)[_0x4609('0x27')](function(_0x5327c0){_0x5d17fa[_0x4609('0x23')]=_0x5327c0;if(_0xb57bc1[_0x4609('0x33')][_0x4609('0x40')]){_0x30eb1f['include']=[{'all':!![]}];}return db[_0x4609('0x2e')]['findAll'](_0x30eb1f);})[_0x4609('0x27')](function(_0x31f37b){_0x5d17fa['rows']=_0x31f37b;return _0x5d17fa;})[_0x4609('0x27')](respondWithFilteredResult(_0xb842a6,_0x30eb1f))[_0x4609('0x41')](handleError(_0xb842a6,null));};exports[_0x4609('0x42')]=function(_0x5bf48a,_0x223d9e){var _0x1a5310={'raw':!![],'where':{'id':_0x5bf48a['params']['id']}},_0x45dbc6={};_0x45dbc6[_0x4609('0x32')]=_[_0x4609('0x34')](db[_0x4609('0x2e')][_0x4609('0x43')]);_0x45dbc6[_0x4609('0x33')]=_[_0x4609('0x34')](_0x5bf48a[_0x4609('0x33')]);_0x45dbc6[_0x4609('0x3c')]=_[_0x4609('0x35')](_0x45dbc6[_0x4609('0x32')],_0x45dbc6[_0x4609('0x33')]);_0x1a5310[_0x4609('0x37')]=_[_0x4609('0x35')](_0x45dbc6[_0x4609('0x32')],qs[_0x4609('0x36')](_0x5bf48a[_0x4609('0x33')][_0x4609('0x36')]));_0x1a5310[_0x4609('0x37')]=_0x1a5310['attributes'][_0x4609('0x44')]?_0x1a5310[_0x4609('0x37')]:_0x45dbc6[_0x4609('0x32')];if(_0x5bf48a['query']['includeAll']){_0x1a5310['include']=[{'all':!![]}];}_0x1a5310=_['merge']({},_0x1a5310,_0x5bf48a['options']);return db[_0x4609('0x2e')]['find'](_0x1a5310)['then'](handleEntityNotFound(_0x223d9e,null))[_0x4609('0x27')](respondWithResult(_0x223d9e,null))[_0x4609('0x41')](handleError(_0x223d9e,null));};exports[_0x4609('0x45')]=function(_0x289149,_0x29d59c){return db[_0x4609('0x2e')]['create'](_0x289149[_0x4609('0x46')],{})['then'](function(_0x1798b5){var _0x1b9c7c=_0x289149[_0x4609('0x47')][_0x4609('0x29')]({'plain':!![]});if(!_0x1b9c7c)throw new Error(_0x4609('0x48'));if(_0x1b9c7c[_0x4609('0x49')]===_0x4609('0x47')){var _0x14382e=_0x1798b5['get']({'plain':!![]});var _0xa05de3='Intervals';return db[_0x4609('0x4a')]['find']({'where':{'name':_0xa05de3,'userProfileId':_0x1b9c7c['userProfileId']},'raw':!![]})[_0x4609('0x27')](function(_0x473d90){if(_0x473d90&&_0x473d90['autoAssociation']===0x0){return db[_0x4609('0x2a')]['create']({'name':_0x14382e[_0x4609('0x2b')],'resourceId':_0x14382e['id'],'type':_0x473d90[_0x4609('0x2b')],'sectionId':_0x473d90['id']},{})['then'](function(){return _0x1798b5;});}else{return _0x1798b5;}})['catch'](function(_0x32442e){logger[_0x4609('0x4b')](_0x4609('0x4c'),_0x32442e);throw _0x32442e;});}return _0x1798b5;})[_0x4609('0x27')](respondWithResult(_0x29d59c,0xc9))[_0x4609('0x41')](handleError(_0x29d59c,null));};exports[_0x4609('0x4d')]=function(_0x497082,_0x69280e){if(_0x497082[_0x4609('0x46')]['id']){delete _0x497082['body']['id'];}return db['Interval']['find']({'where':{'id':_0x497082['params']['id']}})[_0x4609('0x27')](handleEntityNotFound(_0x69280e,null))['then'](saveUpdates(_0x497082[_0x4609('0x46')],null))['then'](respondWithResult(_0x69280e,null))[_0x4609('0x41')](handleError(_0x69280e,null));};exports[_0x4609('0x28')]=function(_0x5c7f69,_0x1cc2ae){return db['Interval']['find']({'where':{'id':_0x5c7f69[_0x4609('0x4e')]['id']}})[_0x4609('0x27')](handleEntityNotFound(_0x1cc2ae,null))['then'](removeEntity(_0x1cc2ae,null))[_0x4609('0x41')](handleError(_0x1cc2ae,null));};exports['addInterval']=function(_0xa5a7bf,_0x13ce2a,_0x31414f){if(_0xa5a7bf[_0x4609('0x46')]['id']){delete _0xa5a7bf['body']['id'];}return db[_0x4609('0x2e')]['find']({'where':{'id':_0xa5a7bf[_0x4609('0x4e')]['id']}})[_0x4609('0x27')](handleEntityNotFound(_0x13ce2a,null))[_0x4609('0x27')](function(_0x214f2c){if(_0x214f2c){_0xa5a7bf[_0x4609('0x46')][_0x4609('0x4f')]=_0x214f2c['id'];return db[_0x4609('0x2e')]['create'](_0xa5a7bf[_0x4609('0x46')]);}})['then'](respondWithResult(_0x13ce2a,null))[_0x4609('0x41')](handleError(_0x13ce2a,null));};exports[_0x4609('0x50')]=function(_0x16be5b,_0x4783b7,_0x5edebf){var _0x108e97={};var _0x1b9ab9={};var _0x545a87;var _0xdcc8e4;return db[_0x4609('0x2e')]['findOne']({'where':{'id':_0x16be5b['params']['id']}})['then'](handleEntityNotFound(_0x4783b7,null))[_0x4609('0x27')](function(_0x3b7ba7){if(_0x3b7ba7){_0x545a87=_0x3b7ba7;_0x1b9ab9[_0x4609('0x32')]=_[_0x4609('0x34')](db[_0x4609('0x2e')][_0x4609('0x43')]);_0x1b9ab9[_0x4609('0x33')]=_[_0x4609('0x34')](_0x16be5b[_0x4609('0x33')]);_0x1b9ab9[_0x4609('0x3c')]=_[_0x4609('0x35')](_0x1b9ab9[_0x4609('0x32')],_0x1b9ab9['query']);_0x108e97['attributes']=_[_0x4609('0x35')](_0x1b9ab9['model'],qs[_0x4609('0x36')](_0x16be5b[_0x4609('0x33')][_0x4609('0x36')]));_0x108e97[_0x4609('0x37')]=_0x108e97[_0x4609('0x37')][_0x4609('0x44')]?_0x108e97[_0x4609('0x37')]:_0x1b9ab9[_0x4609('0x32')];_0x108e97[_0x4609('0x51')]=qs[_0x4609('0x3a')](_0x16be5b[_0x4609('0x33')][_0x4609('0x3a')]);_0x108e97['where']=qs[_0x4609('0x3c')](_[_0x4609('0x52')](_0x16be5b[_0x4609('0x33')],_0x1b9ab9['filters']));if(_0x16be5b['query']['filter']){_0x108e97[_0x4609('0x3b')]=_[_0x4609('0x3e')](_0x108e97[_0x4609('0x3b')],{'$or':_[_0x4609('0x2d')](_0x108e97[_0x4609('0x37')],function(_0x41397d){var _0x30b95b={};_0x30b95b[_0x41397d]={'$like':'%'+_0x16be5b['query'][_0x4609('0x3d')]+'%'};return _0x30b95b;})});}_0x108e97=_['merge']({},_0x108e97,_0x16be5b[_0x4609('0x3f')]);return _0x545a87[_0x4609('0x50')](_0x108e97);}})['then'](function(_0x443fc3){if(_0x443fc3){_0xdcc8e4=_0x443fc3[_0x4609('0x44')];if(!_0x16be5b[_0x4609('0x33')]['hasOwnProperty'](_0x4609('0x39'))){_0x108e97[_0x4609('0x22')]=qs['limit'](_0x16be5b[_0x4609('0x33')][_0x4609('0x22')]);_0x108e97['offset']=qs[_0x4609('0x21')](_0x16be5b[_0x4609('0x33')][_0x4609('0x21')]);}return _0x545a87[_0x4609('0x50')](_0x108e97);}})[_0x4609('0x27')](function(_0x7a1711){if(_0x7a1711){return _0x7a1711?{'count':_0xdcc8e4,'rows':_0x7a1711}:null;}})['then'](respondWithResult(_0x4783b7,null))[_0x4609('0x41')](handleError(_0x4783b7,null));};exports[_0x4609('0x53')]=function(_0x23aeeb,_0x278d16,_0x457f51){return db[_0x4609('0x2e')]['findOne']({'where':{'id':_0x23aeeb[_0x4609('0x4e')]['id']}})[_0x4609('0x27')](handleEntityNotFound(_0x278d16,null))[_0x4609('0x27')](function(_0x13e451){if(_0x13e451){return db[_0x4609('0x54')][_0x4609('0x55')](function(_0x38abd9){return db['Interval'][_0x4609('0x28')]({'where':{'IntervalId':_0x23aeeb[_0x4609('0x4e')]['id']},'transaction':_0x38abd9})['then'](function(_0x39158e){var _0x14f453=_[_0x4609('0x2d')](_0x23aeeb[_0x4609('0x46')],function(_0x35e752){delete _0x35e752['id'];_0x35e752['IntervalId']=_0x23aeeb[_0x4609('0x4e')]['id'];return _0x35e752;});return db['Interval']['bulkCreate'](_0x14f453,{'transaction':_0x38abd9});});})[_0x4609('0x27')](function(){return db[_0x4609('0x2e')][_0x4609('0x56')]({'where':{'IntervalId':_0x23aeeb[_0x4609('0x4e')]['id']}});});}})['then'](respondWithResult(_0x278d16,null))[_0x4609('0x41')](handleError(_0x278d16,null));};
\ No newline at end of file
+var _0xb53d=['fieldName','type','key','model','map','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','intersection','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','addInterval','IntervalId','findOne','order','pick','getIntervals','addIntervals','transaction','findAll','rimraf','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','squel','jsforce','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','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','get','Intervals','UserProfileResource','error','name','index','Interval','rawAttributes'];(function(_0x1880ad,_0x47cb55){var _0x3c8b35=function(_0x525a7d){while(--_0x525a7d){_0x1880ad['push'](_0x1880ad['shift']());}};_0x3c8b35(++_0x47cb55);}(_0xb53d,0x88));var _0xdb53=function(_0xfc01a3,_0x1376a5){_0xfc01a3=_0xfc01a3-0x0;var _0x1983a5=_0xb53d[_0xfc01a3];return _0x1983a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb53('0x0'));var zipdir=require(_0xdb53('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb53('0x2'));var moment=require(_0xdb53('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdb53('0x4'));var sox=require(_0xdb53('0x5'));var csv=require('to-csv');var ejs=require(_0xdb53('0x6'));var fs=require('fs');var fs_extra=require(_0xdb53('0x7'));var _=require('lodash');var squel=require(_0xdb53('0x8'));var crypto=require('crypto');var jsforce=require(_0xdb53('0x9'));var deskjs=require(_0xdb53('0xa'));var toCsv=require(_0xdb53('0xb'));var querystring=require(_0xdb53('0xc'));var Papa=require(_0xdb53('0xd'));var Redis=require(_0xdb53('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdb53('0xf'));var as=require(_0xdb53('0x10'));var hardwareService=require(_0xdb53('0x11'));var logger=require(_0xdb53('0x12'))(_0xdb53('0x13'));var utils=require(_0xdb53('0x14'));var config=require(_0xdb53('0x15'));var licenseUtil=require(_0xdb53('0x16'));var db=require(_0xdb53('0x17'))['db'];var extensions=require(_0xdb53('0x18'));function respondWithStatusCode(_0x49b62,_0x403954){_0x403954=_0x403954||0xcc;return function(_0xfbdbf0){if(_0xfbdbf0){return _0x49b62[_0xdb53('0x19')](_0x403954);}return _0x49b62[_0xdb53('0x1a')](_0x403954)[_0xdb53('0x1b')]();};}function respondWithResult(_0x4fd16a,_0x562d45){_0x562d45=_0x562d45||0xc8;return function(_0x7b2b82){if(_0x7b2b82){return _0x4fd16a[_0xdb53('0x1a')](_0x562d45)[_0xdb53('0x1c')](_0x7b2b82);}};}function respondWithFilteredResult(_0x1ac0fc,_0x4a3b70){return function(_0x8ab050){if(_0x8ab050){var _0x1d706=typeof _0x4a3b70[_0xdb53('0x1d')]===_0xdb53('0x1e')&&typeof _0x4a3b70['limit']===_0xdb53('0x1e');var _0x252f57=_0x8ab050[_0xdb53('0x1f')];var _0x31185a=_0x1d706?0x0:_0x4a3b70['offset'];var _0x4dac27=_0x1d706?_0x8ab050[_0xdb53('0x1f')]:_0x4a3b70[_0xdb53('0x1d')]+_0x4a3b70[_0xdb53('0x20')];var _0x1178db;if(_0x4dac27>=_0x252f57){_0x4dac27=_0x252f57;_0x1178db=0xc8;}else{_0x1178db=0xce;}_0x1ac0fc[_0xdb53('0x1a')](_0x1178db);return _0x1ac0fc[_0xdb53('0x21')](_0xdb53('0x22'),_0x31185a+'-'+_0x4dac27+'/'+_0x252f57)[_0xdb53('0x1c')](_0x8ab050);}return null;};}function patchUpdates(_0x158655){return function(_0x22e876){try{jsonpatch['apply'](_0x22e876,_0x158655,!![]);}catch(_0x3da73f){return BPromise['reject'](_0x3da73f);}return _0x22e876[_0xdb53('0x23')]();};}function saveUpdates(_0x15059c,_0xba99c2){return function(_0x28f78f){if(_0x28f78f){return _0x28f78f[_0xdb53('0x24')](_0x15059c)[_0xdb53('0x25')](function(_0x1083de){return _0x1083de;});}return null;};}function removeEntity(_0x2ba12d,_0x1bfef7){return function(_0x464f5f){if(_0x464f5f){return _0x464f5f['destroy']()[_0xdb53('0x25')](function(){var _0x10ef5f=_0x464f5f[_0xdb53('0x26')]({'plain':!![]});var _0x571066=_0xdb53('0x27');return db[_0xdb53('0x28')]['destroy']({'where':{'type':_0x571066,'resourceId':_0x10ef5f['id']}})[_0xdb53('0x25')](function(){return _0x464f5f;});})[_0xdb53('0x25')](function(){_0x2ba12d['status'](0xcc)[_0xdb53('0x1b')]();});}};}function handleEntityNotFound(_0x4738cf,_0x1a43e3){return function(_0x3db9d2){if(!_0x3db9d2){_0x4738cf['sendStatus'](0x194);}return _0x3db9d2;};}function handleError(_0x3caf76,_0x4ac54e){_0x4ac54e=_0x4ac54e||0x1f4;return function(_0x5af183){logger[_0xdb53('0x29')](_0x5af183['stack']);if(_0x5af183[_0xdb53('0x2a')]){delete _0x5af183[_0xdb53('0x2a')];}_0x3caf76['status'](_0x4ac54e)['send'](_0x5af183);};}exports[_0xdb53('0x2b')]=function(_0x5b85e0,_0x424277){var _0x3d9643={},_0x1d1790={},_0x198729={'count':0x0,'rows':[]};var _0x523ead=_['map'](db[_0xdb53('0x2c')][_0xdb53('0x2d')],function(_0x37cba0){return{'name':_0x37cba0[_0xdb53('0x2e')],'type':_0x37cba0[_0xdb53('0x2f')][_0xdb53('0x30')]};});_0x1d1790[_0xdb53('0x31')]=_[_0xdb53('0x32')](_0x523ead,_0xdb53('0x2a'));_0x1d1790['query']=_['keys'](_0x5b85e0[_0xdb53('0x33')]);_0x1d1790[_0xdb53('0x34')]=_['intersection'](_0x1d1790[_0xdb53('0x31')],_0x1d1790[_0xdb53('0x33')]);_0x3d9643['attributes']=_['intersection'](_0x1d1790['model'],qs[_0xdb53('0x35')](_0x5b85e0[_0xdb53('0x33')]['fields']));_0x3d9643[_0xdb53('0x36')]=_0x3d9643[_0xdb53('0x36')][_0xdb53('0x37')]?_0x3d9643[_0xdb53('0x36')]:_0x1d1790['model'];if(!_0x5b85e0['query'][_0xdb53('0x38')](_0xdb53('0x39'))){_0x3d9643[_0xdb53('0x20')]=qs[_0xdb53('0x20')](_0x5b85e0[_0xdb53('0x33')]['limit']);_0x3d9643['offset']=qs['offset'](_0x5b85e0[_0xdb53('0x33')]['offset']);}_0x3d9643['order']=qs[_0xdb53('0x3a')](_0x5b85e0[_0xdb53('0x33')]['sort']);_0x3d9643[_0xdb53('0x3b')]=qs[_0xdb53('0x34')](_['pick'](_0x5b85e0['query'],_0x1d1790[_0xdb53('0x34')]),_0x523ead);if(_0x5b85e0[_0xdb53('0x33')][_0xdb53('0x3c')]){_0x3d9643['where']=_['merge'](_0x3d9643[_0xdb53('0x3b')],{'$or':_[_0xdb53('0x32')](_0x523ead,function(_0x209172){if(_0x209172[_0xdb53('0x2f')]!==_0xdb53('0x3d')){var _0x18a70f={};_0x18a70f[_0x209172[_0xdb53('0x2a')]]={'$like':'%'+_0x5b85e0[_0xdb53('0x33')][_0xdb53('0x3c')]+'%'};return _0x18a70f;}})});}_0x3d9643=_['merge']({},_0x3d9643,_0x5b85e0[_0xdb53('0x3e')]);var _0x1124c5={'where':_0x3d9643[_0xdb53('0x3b')]};return db[_0xdb53('0x2c')][_0xdb53('0x1f')](_0x1124c5)[_0xdb53('0x25')](function(_0x59032e){_0x198729[_0xdb53('0x1f')]=_0x59032e;if(_0x5b85e0[_0xdb53('0x33')][_0xdb53('0x3f')]){_0x3d9643[_0xdb53('0x40')]=[{'all':!![]}];}return db[_0xdb53('0x2c')]['findAll'](_0x3d9643);})['then'](function(_0x6417d4){_0x198729[_0xdb53('0x41')]=_0x6417d4;return _0x198729;})[_0xdb53('0x25')](respondWithFilteredResult(_0x424277,_0x3d9643))[_0xdb53('0x42')](handleError(_0x424277,null));};exports[_0xdb53('0x43')]=function(_0x3cdcf3,_0x557019){var _0x739213={'raw':!![],'where':{'id':_0x3cdcf3[_0xdb53('0x44')]['id']}},_0x355f00={};_0x355f00[_0xdb53('0x31')]=_[_0xdb53('0x45')](db[_0xdb53('0x2c')][_0xdb53('0x2d')]);_0x355f00[_0xdb53('0x33')]=_[_0xdb53('0x45')](_0x3cdcf3[_0xdb53('0x33')]);_0x355f00[_0xdb53('0x34')]=_[_0xdb53('0x46')](_0x355f00['model'],_0x355f00['query']);_0x739213[_0xdb53('0x36')]=_[_0xdb53('0x46')](_0x355f00[_0xdb53('0x31')],qs[_0xdb53('0x35')](_0x3cdcf3[_0xdb53('0x33')][_0xdb53('0x35')]));_0x739213['attributes']=_0x739213[_0xdb53('0x36')]['length']?_0x739213[_0xdb53('0x36')]:_0x355f00[_0xdb53('0x31')];if(_0x3cdcf3['query'][_0xdb53('0x3f')]){_0x739213[_0xdb53('0x40')]=[{'all':!![]}];}_0x739213=_[_0xdb53('0x47')]({},_0x739213,_0x3cdcf3[_0xdb53('0x3e')]);return db[_0xdb53('0x2c')]['find'](_0x739213)[_0xdb53('0x25')](handleEntityNotFound(_0x557019,null))['then'](respondWithResult(_0x557019,null))['catch'](handleError(_0x557019,null));};exports[_0xdb53('0x48')]=function(_0xbabacc,_0x4edbf1){return db[_0xdb53('0x2c')]['create'](_0xbabacc['body'],{})['then'](function(_0x4775f3){var _0xddddcf=_0xbabacc[_0xdb53('0x49')][_0xdb53('0x26')]({'plain':!![]});if(!_0xddddcf)throw new Error(_0xdb53('0x4a'));if(_0xddddcf[_0xdb53('0x4b')]===_0xdb53('0x49')){var _0x129b59=_0x4775f3[_0xdb53('0x26')]({'plain':!![]});var _0x35d55d='Intervals';return db[_0xdb53('0x4c')][_0xdb53('0x4d')]({'where':{'name':_0x35d55d,'userProfileId':_0xddddcf['userProfileId']},'raw':!![]})['then'](function(_0x149ef3){if(_0x149ef3&&_0x149ef3[_0xdb53('0x4e')]===0x0){return db[_0xdb53('0x28')]['create']({'name':_0x129b59['name'],'resourceId':_0x129b59['id'],'type':_0x149ef3[_0xdb53('0x2a')],'sectionId':_0x149ef3['id']},{})[_0xdb53('0x25')](function(){return _0x4775f3;});}else{return _0x4775f3;}})['catch'](function(_0x2d4f23){logger[_0xdb53('0x29')](_0xdb53('0x4f'),_0x2d4f23);throw _0x2d4f23;});}return _0x4775f3;})[_0xdb53('0x25')](respondWithResult(_0x4edbf1,0xc9))[_0xdb53('0x42')](handleError(_0x4edbf1,null));};exports['update']=function(_0x3350b6,_0x2448f3){if(_0x3350b6['body']['id']){delete _0x3350b6['body']['id'];}return db[_0xdb53('0x2c')][_0xdb53('0x4d')]({'where':{'id':_0x3350b6[_0xdb53('0x44')]['id']}})[_0xdb53('0x25')](handleEntityNotFound(_0x2448f3,null))[_0xdb53('0x25')](saveUpdates(_0x3350b6[_0xdb53('0x50')],null))[_0xdb53('0x25')](respondWithResult(_0x2448f3,null))[_0xdb53('0x42')](handleError(_0x2448f3,null));};exports[_0xdb53('0x51')]=function(_0x3465c9,_0x1e55e1){return db[_0xdb53('0x2c')]['find']({'where':{'id':_0x3465c9['params']['id']}})['then'](handleEntityNotFound(_0x1e55e1,null))['then'](removeEntity(_0x1e55e1,null))['catch'](handleError(_0x1e55e1,null));};exports[_0xdb53('0x52')]=function(_0xeab7c2,_0x4d5436,_0x1a5a61){if(_0xeab7c2[_0xdb53('0x50')]['id']){delete _0xeab7c2[_0xdb53('0x50')]['id'];}return db[_0xdb53('0x2c')][_0xdb53('0x4d')]({'where':{'id':_0xeab7c2[_0xdb53('0x44')]['id']}})[_0xdb53('0x25')](handleEntityNotFound(_0x4d5436,null))[_0xdb53('0x25')](function(_0x1bbd45){if(_0x1bbd45){_0xeab7c2[_0xdb53('0x50')][_0xdb53('0x53')]=_0x1bbd45['id'];return db[_0xdb53('0x2c')][_0xdb53('0x48')](_0xeab7c2[_0xdb53('0x50')]);}})['then'](respondWithResult(_0x4d5436,null))[_0xdb53('0x42')](handleError(_0x4d5436,null));};exports['getIntervals']=function(_0x1c2e56,_0x3f4449,_0x9ee393){var _0x2070c4={};var _0x3ea66b={};var _0x2c56fe;var _0x964b10;return db[_0xdb53('0x2c')][_0xdb53('0x54')]({'where':{'id':_0x1c2e56[_0xdb53('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f4449,null))[_0xdb53('0x25')](function(_0x28658b){if(_0x28658b){_0x2c56fe=_0x28658b;_0x3ea66b['model']=_[_0xdb53('0x45')](db[_0xdb53('0x2c')]['rawAttributes']);_0x3ea66b[_0xdb53('0x33')]=_[_0xdb53('0x45')](_0x1c2e56[_0xdb53('0x33')]);_0x3ea66b[_0xdb53('0x34')]=_[_0xdb53('0x46')](_0x3ea66b[_0xdb53('0x31')],_0x3ea66b[_0xdb53('0x33')]);_0x2070c4[_0xdb53('0x36')]=_[_0xdb53('0x46')](_0x3ea66b[_0xdb53('0x31')],qs['fields'](_0x1c2e56[_0xdb53('0x33')][_0xdb53('0x35')]));_0x2070c4[_0xdb53('0x36')]=_0x2070c4[_0xdb53('0x36')][_0xdb53('0x37')]?_0x2070c4[_0xdb53('0x36')]:_0x3ea66b['model'];_0x2070c4[_0xdb53('0x55')]=qs[_0xdb53('0x3a')](_0x1c2e56['query'][_0xdb53('0x3a')]);_0x2070c4[_0xdb53('0x3b')]=qs['filters'](_[_0xdb53('0x56')](_0x1c2e56[_0xdb53('0x33')],_0x3ea66b[_0xdb53('0x34')]));if(_0x1c2e56[_0xdb53('0x33')][_0xdb53('0x3c')]){_0x2070c4[_0xdb53('0x3b')]=_[_0xdb53('0x47')](_0x2070c4[_0xdb53('0x3b')],{'$or':_[_0xdb53('0x32')](_0x2070c4[_0xdb53('0x36')],function(_0x2cd2a2){var _0x29eab4={};_0x29eab4[_0x2cd2a2]={'$like':'%'+_0x1c2e56[_0xdb53('0x33')]['filter']+'%'};return _0x29eab4;})});}_0x2070c4=_['merge']({},_0x2070c4,_0x1c2e56[_0xdb53('0x3e')]);return _0x2c56fe[_0xdb53('0x57')](_0x2070c4);}})[_0xdb53('0x25')](function(_0x1e5c2b){if(_0x1e5c2b){_0x964b10=_0x1e5c2b[_0xdb53('0x37')];if(!_0x1c2e56[_0xdb53('0x33')][_0xdb53('0x38')]('nolimit')){_0x2070c4[_0xdb53('0x20')]=qs[_0xdb53('0x20')](_0x1c2e56[_0xdb53('0x33')][_0xdb53('0x20')]);_0x2070c4[_0xdb53('0x1d')]=qs['offset'](_0x1c2e56[_0xdb53('0x33')][_0xdb53('0x1d')]);}return _0x2c56fe[_0xdb53('0x57')](_0x2070c4);}})[_0xdb53('0x25')](function(_0x96fa16){if(_0x96fa16){return _0x96fa16?{'count':_0x964b10,'rows':_0x96fa16}:null;}})[_0xdb53('0x25')](respondWithResult(_0x3f4449,null))['catch'](handleError(_0x3f4449,null));};exports[_0xdb53('0x58')]=function(_0x1a7919,_0x109960,_0x471a35){return db[_0xdb53('0x2c')][_0xdb53('0x54')]({'where':{'id':_0x1a7919[_0xdb53('0x44')]['id']}})[_0xdb53('0x25')](handleEntityNotFound(_0x109960,null))['then'](function(_0x354cb4){if(_0x354cb4){return db['sequelize'][_0xdb53('0x59')](function(_0x40d248){return db[_0xdb53('0x2c')][_0xdb53('0x51')]({'where':{'IntervalId':_0x1a7919[_0xdb53('0x44')]['id']},'transaction':_0x40d248})[_0xdb53('0x25')](function(_0x247b3d){var _0x34bb38=_[_0xdb53('0x32')](_0x1a7919[_0xdb53('0x50')],function(_0x338e9d){delete _0x338e9d['id'];_0x338e9d[_0xdb53('0x53')]=_0x1a7919[_0xdb53('0x44')]['id'];return _0x338e9d;});return db[_0xdb53('0x2c')]['bulkCreate'](_0x34bb38,{'transaction':_0x40d248});});})[_0xdb53('0x25')](function(){return db[_0xdb53('0x2c')][_0xdb53('0x5a')]({'where':{'IntervalId':_0x1a7919[_0xdb53('0x44')]['id']}});});}})['then'](respondWithResult(_0x109960,null))[_0xdb53('0x42')](handleError(_0x109960,null));};
\ No newline at end of file
index 064e005..7f32f3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa343=['bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger'];(function(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0xa343,0x1a1));var _0x3a34=function(_0x12e4fc,_0xf01a75){_0x12e4fc=_0x12e4fc-0x0;var _0x197c91=_0xa343[_0x12e4fc];return _0x197c91;};'use strict';var _=require(_0x3a34('0x0'));var util=require(_0x3a34('0x1'));var logger=require(_0x3a34('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3a34('0x3'));var rp=require(_0x3a34('0x4'));var fs=require('fs');var path=require(_0x3a34('0x5'));var rimraf=require(_0x3a34('0x6'));var config=require(_0x3a34('0x7'));var attributes=require(_0x3a34('0x8'));var extensions=require(_0x3a34('0x9'));module[_0x3a34('0xa')]=function(_0xbb8daf,_0x1f9885){return _0xbb8daf[_0x3a34('0xb')](_0x3a34('0xc'),attributes,{'tableName':_0x3a34('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x272245,_0x29d0eb){extensions[_0x3a34('0xe')](_0xbb8daf,_0x272245);},'afterBulkCreate':function(_0x244b2a,_0x8a453,_0x5c6e29){_0x5c6e29();extensions[_0x3a34('0xe')](_0xbb8daf,_0x244b2a[0x0]);},'afterUpdate':function(_0x334906,_0x392bb1){extensions['rewrite'](_0xbb8daf,_0x334906);},'afterDestroy':function(_0x3b63f0,_0x4a6880){extensions[_0x3a34('0xe')](_0xbb8daf,_0x3b63f0);}}});};
\ No newline at end of file
+var _0xc405=['Interval','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xc405,0x1f2));var _0x5c40=function(_0x852450,_0xd2456e){_0x852450=_0x852450-0x0;var _0x329404=_0xc405[_0x852450];return _0x329404;};'use strict';var _=require(_0x5c40('0x0'));var util=require(_0x5c40('0x1'));var logger=require(_0x5c40('0x2'))(_0x5c40('0x3'));var moment=require(_0x5c40('0x4'));var BPromise=require(_0x5c40('0x5'));var rp=require(_0x5c40('0x6'));var fs=require('fs');var path=require(_0x5c40('0x7'));var rimraf=require(_0x5c40('0x8'));var config=require(_0x5c40('0x9'));var attributes=require(_0x5c40('0xa'));var extensions=require(_0x5c40('0xb'));module[_0x5c40('0xc')]=function(_0x59446b,_0x2f02f4){return _0x59446b[_0x5c40('0xd')](_0x5c40('0xe'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x447f7c,_0x345544){extensions[_0x5c40('0xf')](_0x59446b,_0x447f7c);},'afterBulkCreate':function(_0x4956d6,_0x55aaff,_0x394d17){_0x394d17();extensions['rewrite'](_0x59446b,_0x4956d6[0x0]);},'afterUpdate':function(_0x3eb534,_0x48c529){extensions[_0x5c40('0xf')](_0x59446b,_0x3eb534);},'afterDestroy':function(_0x6c8767,_0x75e01c){extensions[_0x5c40('0xf')](_0x59446b,_0x6c8767);}}});};
\ No newline at end of file
index fcb21d5..e561fa4 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(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_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
+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(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 6d89d8a..d7ecce3 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(_0x264846,_0x2cc496){var _0x3334ef=function(_0x27a59e){while(--_0x27a59e){_0x264846['push'](_0x264846['shift']());}};_0x3334ef(++_0x2cc496);}(_0xdb28,0x106));var _0x8db2=function(_0xc446ad,_0x36ec88){_0xc446ad=_0xc446ad-0x0;var _0x9f6ab8=_0xdb28[_0xc446ad];return _0x9f6ab8;};'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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x52e3ac,_0x2e77f9){var _0x418e8c=function(_0x25cfcc){while(--_0x25cfcc){_0x52e3ac['push'](_0x52e3ac['shift']());}};_0x418e8c(++_0x2e77f9);}(_0xdb28,0x106));var _0x8db2=function(_0xbd14e,_0x556d1f){_0xbd14e=_0xbd14e-0x0;var _0xf040ba=_0xdb28[_0xbd14e];return _0xf040ba;};'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
index 3420f98..e5ce716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a36=['socket','body','bluebird','../../config/logger','api','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','customfield_11500','email','customfield_11501','fields','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','stringify','request','setEncoding','utf8','end','statusCode','json','parse','error','status','api.jira','write','openIssue','send','x-forwarded-for','connection','remoteAddress'];(function(_0x20f9a9,_0x1536e6){var _0x273941=function(_0xe4a5c7){while(--_0xe4a5c7){_0x20f9a9['push'](_0x20f9a9['shift']());}};_0x273941(++_0x1536e6);}(_0x9a36,0x185));var _0x69a3=function(_0x5cd7d9,_0x2bbc16){_0x5cd7d9=_0x5cd7d9-0x0;var _0x2d8109=_0x9a36[_0x5cd7d9];return _0x2d8109;};'use strict';var BPromise=require(_0x69a3('0x0'));var https=require('https');var logger=require(_0x69a3('0x1'))(_0x69a3('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x33dfd3,_0x4a5d2f){var _0x1cbc76={'fields':{'project':{'key':_0x33dfd3['key']||_0x69a3('0x3')},'summary':(_0x33dfd3[_0x69a3('0x4')]||_0x69a3('0x5'))+_0x69a3('0x6')+_0x33dfd3['ip'],'description':_0x33dfd3[_0x69a3('0x7')]||JSON['stringify'](_0x33dfd3),'issuetype':{'name':_0x33dfd3[_0x69a3('0x8')]||_0x69a3('0x9')}}};_0x1cbc76['fields'][_0x69a3('0xa')]=_0x33dfd3[_0x69a3('0xb')];_0x1cbc76['fields'][_0x69a3('0xc')]=_0x33dfd3['oldToken'];_0x1cbc76[_0x69a3('0xd')]['customfield_11502']=_0x33dfd3[_0x69a3('0xe')];_0x1cbc76['fields'][_0x69a3('0xf')]=_0x33dfd3[_0x69a3('0x10')];_0x1cbc76['fields']['customfield_11504']=_0x33dfd3[_0x69a3('0x11')];_0x1cbc76[_0x69a3('0xd')][_0x69a3('0x12')]=_0x33dfd3['ip'];var _0xf6ae3d={'host':_0x69a3('0x13'),'port':0x1bb,'path':_0x69a3('0x14'),'method':_0x69a3('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x69a3('0x16'),'Authorization':_0x69a3('0x17')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x4e33f5=JSON[_0x69a3('0x18')](_0x1cbc76);var _0x32784c=https[_0x69a3('0x19')](_0xf6ae3d,function(_0x314921){_0x314921[_0x69a3('0x1a')](_0x69a3('0x1b'));var _0x505693='';_0x314921['on']('data',function(_0x47de17){_0x505693+=_0x47de17;});_0x314921['on'](_0x69a3('0x1c'),function(){if(_0x4a5d2f){return _0x4a5d2f['status'](_0x314921[_0x69a3('0x1d')])[_0x69a3('0x1e')](JSON[_0x69a3('0x1f')](_0x505693));}});});_0x32784c['on'](_0x69a3('0x20'),function(_0xc8b7a0){if(_0x4a5d2f){return _0x4a5d2f[_0x69a3('0x21')](0x1f4)[_0x69a3('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x69a3('0x22')}]});}});_0x32784c[_0x69a3('0x23')](_0x4e33f5);_0x32784c[_0x69a3('0x1c')]();}exports[_0x69a3('0x24')]=openIssue;exports[_0x69a3('0x25')]=function(_0x34dbbc,_0x189615){_0x34dbbc['body']['ip']=_0x34dbbc['headers'][_0x69a3('0x26')]||_0x34dbbc[_0x69a3('0x27')][_0x69a3('0x28')]||_0x34dbbc[_0x69a3('0x29')][_0x69a3('0x28')]||_0x34dbbc[_0x69a3('0x27')]['socket'][_0x69a3('0x28')];return openIssue(_0x34dbbc[_0x69a3('0x2a')],_0x189615);};
\ No newline at end of file
+var _0x929a=['issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','toString','setEncoding','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','connection','socket','remoteAddress','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','stringify'];(function(_0x506532,_0x505786){var _0x20892a=function(_0x1cd555){while(--_0x1cd555){_0x506532['push'](_0x506532['shift']());}};_0x20892a(++_0x505786);}(_0x929a,0x155));var _0xa929=function(_0x191d5c,_0xdc7b24){_0x191d5c=_0x191d5c-0x0;var _0x5ca940=_0x929a[_0x191d5c];return _0x5ca940;};'use strict';var BPromise=require('bluebird');var https=require(_0xa929('0x0'));var logger=require(_0xa929('0x1'))(_0xa929('0x2'));var USERNAME=_0xa929('0x3');var PASSWORD=_0xa929('0x4');function openIssue(_0x5a5a1e,_0x259171){var _0x35d6c7={'fields':{'project':{'key':_0x5a5a1e['key']||_0xa929('0x5')},'summary':(_0x5a5a1e[_0xa929('0x6')]||_0xa929('0x7'))+_0xa929('0x8')+_0x5a5a1e['ip'],'description':_0x5a5a1e[_0xa929('0x9')]||JSON[_0xa929('0xa')](_0x5a5a1e),'issuetype':{'name':_0x5a5a1e[_0xa929('0xb')]||_0xa929('0xc')}}};_0x35d6c7[_0xa929('0xd')][_0xa929('0xe')]=_0x5a5a1e[_0xa929('0xf')];_0x35d6c7[_0xa929('0xd')][_0xa929('0x10')]=_0x5a5a1e['oldToken'];_0x35d6c7['fields'][_0xa929('0x11')]=_0x5a5a1e[_0xa929('0x12')];_0x35d6c7['fields'][_0xa929('0x13')]=_0x5a5a1e['name'];_0x35d6c7[_0xa929('0xd')][_0xa929('0x14')]=_0x5a5a1e[_0xa929('0x15')];_0x35d6c7['fields'][_0xa929('0x16')]=_0x5a5a1e['ip'];var _0x364f3c={'host':_0xa929('0x17'),'port':0x1bb,'path':_0xa929('0x18'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xa929('0x19'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xa929('0x1a')]('base64')}};var _0x5bc1fb=JSON[_0xa929('0xa')](_0x35d6c7);var _0x2fccad=https['request'](_0x364f3c,function(_0x4902be){_0x4902be[_0xa929('0x1b')]('utf8');var _0x1e3cdb='';_0x4902be['on'](_0xa929('0x1c'),function(_0x4448ff){_0x1e3cdb+=_0x4448ff;});_0x4902be['on'](_0xa929('0x1d'),function(){if(_0x259171){return _0x259171[_0xa929('0x1e')](_0x4902be['statusCode'])[_0xa929('0x1f')](JSON[_0xa929('0x20')](_0x1e3cdb));}});});_0x2fccad['on'](_0xa929('0x21'),function(_0x1e065d){if(_0x259171){return _0x259171[_0xa929('0x1e')](0x1f4)[_0xa929('0x1f')]({'errors':[{'message':_0xa929('0x22'),'type':_0xa929('0x23')}]});}});_0x2fccad[_0xa929('0x24')](_0x5bc1fb);_0x2fccad[_0xa929('0x1d')]();}exports[_0xa929('0x25')]=openIssue;exports[_0xa929('0x26')]=function(_0x36c586,_0x581fcb){_0x36c586[_0xa929('0x27')]['ip']=_0x36c586['headers'][_0xa929('0x28')]||_0x36c586[_0xa929('0x29')]['remoteAddress']||_0x36c586[_0xa929('0x2a')]['remoteAddress']||_0x36c586['connection'][_0xa929('0x2a')][_0xa929('0x2b')];return openIssue(_0x36c586[_0xa929('0x27')],_0x581fcb);};
\ No newline at end of file
index f70470f..409e93e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x4b44ac,_0x84990a){var _0x1f3c0a=function(_0x2a098a){while(--_0x2a098a){_0x4b44ac['push'](_0x4b44ac['shift']());}};_0x1f3c0a(++_0x84990a);}(_0x91a7,0xe7));var _0x791a=function(_0x25a756,_0x5d4dab){_0x25a756=_0x25a756-0x0;var _0x4494a0=_0x91a7[_0x25a756];return _0x4494a0;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x153f=['Router','fs-extra','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x20a47c,_0x576c02){var _0x16b31f=function(_0x54f04c){while(--_0x54f04c){_0x20a47c['push'](_0x20a47c['shift']());}};_0x16b31f(++_0x576c02);}(_0x153f,0x15b));var _0xf153=function(_0x33803b,_0x80f585){_0x33803b=_0x33803b-0x0;var _0x17a484=_0x153f[_0x33803b];return _0x17a484;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/describe',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0xf')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router[_0xf153('0x11')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router[_0xf153('0x13')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);module[_0xf153('0x15')]=router;
\ No newline at end of file
index 553d9b5..22fb2c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x4396f5,_0x345fdd){_0x4396f5=_0x4396f5-0x0;var _0x2bf3e0=_0x7a54[_0x4396f5];return _0x2bf3e0;};'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(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x7a54,0x106));var _0x47a5=function(_0x4b05be,_0x42c04f){_0x4b05be=_0x4b05be-0x0;var _0xcf0c08=_0x7a54[_0x4b05be];return _0xcf0c08;};'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 8808898..6593530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6011=['ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','then','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','update','find','describe','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x6eb62,_0x1bc7b8){var _0x2e9a3c=function(_0x1b5861){while(--_0x1b5861){_0x6eb62['push'](_0x6eb62['shift']());}};_0x2e9a3c(++_0x1bc7b8);}(_0x6011,0x196));var _0x1601=function(_0x169282,_0x3599f4){_0x169282=_0x169282-0x0;var _0x5c2564=_0x6011[_0x169282];return _0x5c2564;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1601('0x0'));var BPromise=require(_0x1601('0x1'));var Mustache=require('mustache');var util=require(_0x1601('0x2'));var path=require(_0x1601('0x3'));var sox=require(_0x1601('0x4'));var csv=require(_0x1601('0x5'));var ejs=require(_0x1601('0x6'));var fs=require('fs');var fs_extra=require(_0x1601('0x7'));var _=require(_0x1601('0x8'));var squel=require(_0x1601('0x9'));var crypto=require(_0x1601('0xa'));var jsforce=require(_0x1601('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1601('0x5'));var querystring=require(_0x1601('0xc'));var Papa=require(_0x1601('0xd'));var Redis=require(_0x1601('0xe'));var authService=require(_0x1601('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1601('0x10'))('api');var utils=require(_0x1601('0x11'));var config=require(_0x1601('0x12'));var licenseUtil=require(_0x1601('0x13'));var db=require(_0x1601('0x14'))['db'];function respondWithStatusCode(_0x263bef,_0x322025){_0x322025=_0x322025||0xcc;return function(_0x3ac50b){if(_0x3ac50b){return _0x263bef[_0x1601('0x15')](_0x322025);}return _0x263bef['status'](_0x322025)[_0x1601('0x16')]();};}function respondWithResult(_0x555d4f,_0x4705f0){_0x4705f0=_0x4705f0||0xc8;return function(_0x5d642d){if(_0x5d642d){return _0x555d4f[_0x1601('0x17')](_0x4705f0)[_0x1601('0x18')](_0x5d642d);}};}function respondWithFilteredResult(_0x4bb5c1,_0x1b40be){return function(_0x39873a){if(_0x39873a){var _0x12ddb0=typeof _0x1b40be['offset']==='undefined'&&typeof _0x1b40be[_0x1601('0x19')]===_0x1601('0x1a');var _0x3621e2=_0x39873a[_0x1601('0x1b')];var _0x1d8563=_0x12ddb0?0x0:_0x1b40be[_0x1601('0x1c')];var _0x23b992=_0x12ddb0?_0x39873a[_0x1601('0x1b')]:_0x1b40be[_0x1601('0x1c')]+_0x1b40be['limit'];var _0x4d077e;if(_0x23b992>=_0x3621e2){_0x23b992=_0x3621e2;_0x4d077e=0xc8;}else{_0x4d077e=0xce;}_0x4bb5c1[_0x1601('0x17')](_0x4d077e);return _0x4bb5c1[_0x1601('0x1d')](_0x1601('0x1e'),_0x1d8563+'-'+_0x23b992+'/'+_0x3621e2)['json'](_0x39873a);}return null;};}function patchUpdates(_0x2c3b5d){return function(_0x380157){try{jsonpatch[_0x1601('0x1f')](_0x380157,_0x2c3b5d,!![]);}catch(_0x2e2e0d){return BPromise[_0x1601('0x20')](_0x2e2e0d);}return _0x380157['save']();};}function saveUpdates(_0x1b8314,_0x296023){return function(_0x220313){if(_0x220313){return _0x220313['update'](_0x1b8314)[_0x1601('0x21')](function(_0x330033){return _0x330033;});}return null;};}function removeEntity(_0x4f918b,_0x2b01da){return function(_0xa8e856){if(_0xa8e856){return _0xa8e856['destroy']()['then'](function(){_0x4f918b[_0x1601('0x17')](0xcc)[_0x1601('0x16')]();});}};}function handleEntityNotFound(_0x34d021,_0x4919f2){return function(_0x362f51){if(!_0x362f51){_0x34d021[_0x1601('0x15')](0x194);}return _0x362f51;};}function handleError(_0x23a6a9,_0x250fcc){_0x250fcc=_0x250fcc||0x1f4;return function(_0x296c34){logger['error'](_0x296c34['stack']);if(_0x296c34[_0x1601('0x22')]){delete _0x296c34[_0x1601('0x22')];}_0x23a6a9[_0x1601('0x17')](_0x250fcc)['send'](_0x296c34);};}exports[_0x1601('0x23')]=function(_0x57eb42,_0x2dcbc9){var _0x3c6bc1={},_0x389f0f={},_0x4d4d0b={'count':0x0,'rows':[]};var _0x388530=_[_0x1601('0x24')](db[_0x1601('0x25')][_0x1601('0x26')],function(_0x5cdcfb){return{'name':_0x5cdcfb[_0x1601('0x27')],'type':_0x5cdcfb[_0x1601('0x28')][_0x1601('0x29')]};});_0x389f0f[_0x1601('0x2a')]=_[_0x1601('0x24')](_0x388530,_0x1601('0x22'));_0x389f0f[_0x1601('0x2b')]=_[_0x1601('0x2c')](_0x57eb42[_0x1601('0x2b')]);_0x389f0f[_0x1601('0x2d')]=_[_0x1601('0x2e')](_0x389f0f[_0x1601('0x2a')],_0x389f0f[_0x1601('0x2b')]);_0x3c6bc1['attributes']=_[_0x1601('0x2e')](_0x389f0f[_0x1601('0x2a')],qs[_0x1601('0x2f')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x2f')]));_0x3c6bc1['attributes']=_0x3c6bc1[_0x1601('0x30')][_0x1601('0x31')]?_0x3c6bc1['attributes']:_0x389f0f[_0x1601('0x2a')];if(!_0x57eb42['query'][_0x1601('0x32')](_0x1601('0x33'))){_0x3c6bc1['limit']=qs[_0x1601('0x19')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x19')]);_0x3c6bc1[_0x1601('0x1c')]=qs[_0x1601('0x1c')](_0x57eb42[_0x1601('0x2b')][_0x1601('0x1c')]);}_0x3c6bc1['order']=qs[_0x1601('0x34')](_0x57eb42[_0x1601('0x2b')]['sort']);_0x3c6bc1['where']=qs[_0x1601('0x2d')](_[_0x1601('0x35')](_0x57eb42[_0x1601('0x2b')],_0x389f0f[_0x1601('0x2d')]),_0x388530);if(_0x57eb42[_0x1601('0x2b')][_0x1601('0x36')]){_0x3c6bc1[_0x1601('0x37')]=_['merge'](_0x3c6bc1[_0x1601('0x37')],{'$or':_[_0x1601('0x24')](_0x388530,function(_0x482379){if(_0x482379['type']!==_0x1601('0x38')){var _0x52034d={};_0x52034d[_0x482379['name']]={'$like':'%'+_0x57eb42['query'][_0x1601('0x36')]+'%'};return _0x52034d;}})});}_0x3c6bc1=_[_0x1601('0x39')]({},_0x3c6bc1,_0x57eb42[_0x1601('0x3a')]);var _0xb8146e={'where':_0x3c6bc1[_0x1601('0x37')]};return db[_0x1601('0x25')][_0x1601('0x1b')](_0xb8146e)[_0x1601('0x21')](function(_0x388f3b){_0x4d4d0b[_0x1601('0x1b')]=_0x388f3b;if(_0x57eb42[_0x1601('0x2b')][_0x1601('0x3b')]){_0x3c6bc1[_0x1601('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x1601('0x3d')](_0x3c6bc1);})['then'](function(_0x5acf66){_0x4d4d0b['rows']=_0x5acf66;return _0x4d4d0b;})[_0x1601('0x21')](respondWithFilteredResult(_0x2dcbc9,_0x3c6bc1))[_0x1601('0x3e')](handleError(_0x2dcbc9,null));};exports[_0x1601('0x3f')]=function(_0x5a06dc,_0x581941){var _0x3aef1a={'raw':!![],'where':{'id':_0x5a06dc[_0x1601('0x40')]['id']}},_0x3ce65d={};_0x3ce65d['model']=_[_0x1601('0x2c')](db['JscriptyAnswerReport'][_0x1601('0x26')]);_0x3ce65d[_0x1601('0x2b')]=_[_0x1601('0x2c')](_0x5a06dc[_0x1601('0x2b')]);_0x3ce65d['filters']=_[_0x1601('0x2e')](_0x3ce65d['model'],_0x3ce65d[_0x1601('0x2b')]);_0x3aef1a[_0x1601('0x30')]=_['intersection'](_0x3ce65d[_0x1601('0x2a')],qs[_0x1601('0x2f')](_0x5a06dc[_0x1601('0x2b')]['fields']));_0x3aef1a[_0x1601('0x30')]=_0x3aef1a['attributes'][_0x1601('0x31')]?_0x3aef1a[_0x1601('0x30')]:_0x3ce65d[_0x1601('0x2a')];if(_0x5a06dc[_0x1601('0x2b')][_0x1601('0x3b')]){_0x3aef1a[_0x1601('0x3c')]=[{'all':!![]}];}_0x3aef1a=_[_0x1601('0x39')]({},_0x3aef1a,_0x5a06dc[_0x1601('0x3a')]);return db[_0x1601('0x25')]['find'](_0x3aef1a)[_0x1601('0x21')](handleEntityNotFound(_0x581941,null))['then'](respondWithResult(_0x581941,null))[_0x1601('0x3e')](handleError(_0x581941,null));};exports[_0x1601('0x41')]=function(_0x4a8039,_0xbaeefc){return db[_0x1601('0x25')]['create'](_0x4a8039[_0x1601('0x42')],{})[_0x1601('0x21')](respondWithResult(_0xbaeefc,0xc9))[_0x1601('0x3e')](handleError(_0xbaeefc,null));};exports[_0x1601('0x43')]=function(_0x30f2bf,_0xf14c98){if(_0x30f2bf[_0x1601('0x42')]['id']){delete _0x30f2bf[_0x1601('0x42')]['id'];}return db[_0x1601('0x25')][_0x1601('0x44')]({'where':{'id':_0x30f2bf['params']['id']}})[_0x1601('0x21')](handleEntityNotFound(_0xf14c98,null))['then'](saveUpdates(_0x30f2bf[_0x1601('0x42')],null))[_0x1601('0x21')](respondWithResult(_0xf14c98,null))[_0x1601('0x3e')](handleError(_0xf14c98,null));};exports['destroy']=function(_0x56b904,_0x26ba09){return db[_0x1601('0x25')]['find']({'where':{'id':_0x56b904['params']['id']}})['then'](handleEntityNotFound(_0x26ba09,null))[_0x1601('0x21')](removeEntity(_0x26ba09,null))['catch'](handleError(_0x26ba09,null));};exports[_0x1601('0x45')]=function(_0x174eee,_0x50edf3){return db[_0x1601('0x25')]['describe']()['then'](respondWithResult(_0x50edf3,null))[_0x1601('0x3e')](handleError(_0x50edf3,null));};
\ No newline at end of file
+var _0x6aa7=['includeAll','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','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','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','length','attributes','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x6aa7,0x178));var _0x76aa=function(_0x549761,_0x2b78cd){_0x549761=_0x549761-0x0;var _0x4eb4c3=_0x6aa7[_0x549761];return _0x4eb4c3;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x26b75e,_0x3599a9){return function(_0x4ef9b0){if(!_0x4ef9b0){_0x26b75e[_0x76aa('0x19')](0x194);}return _0x4ef9b0;};}function handleError(_0x1d6d15,_0x25c614){_0x25c614=_0x25c614||0x1f4;return function(_0x2e7ab4){logger[_0x76aa('0x29')](_0x2e7ab4[_0x76aa('0x2a')]);if(_0x2e7ab4[_0x76aa('0x2b')]){delete _0x2e7ab4[_0x76aa('0x2b')];}_0x1d6d15[_0x76aa('0x1a')](_0x25c614)[_0x76aa('0x2c')](_0x2e7ab4);};}exports['index']=function(_0x3fcb7f,_0x5a8030){var _0x994550={},_0x365ff8={},_0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x2d')](db[_0x76aa('0x2e')][_0x76aa('0x2f')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x30')],'type':_0x3827ec[_0x76aa('0x31')]['key']};});_0x365ff8[_0x76aa('0x32')]=_[_0x76aa('0x2d')](_0x1e90b9,_0x76aa('0x2b'));_0x365ff8[_0x76aa('0x33')]=_[_0x76aa('0x34')](_0x3fcb7f[_0x76aa('0x33')]);_0x365ff8[_0x76aa('0x35')]=_['intersection'](_0x365ff8[_0x76aa('0x32')],_0x365ff8[_0x76aa('0x33')]);_0x994550['attributes']=_[_0x76aa('0x36')](_0x365ff8['model'],qs[_0x76aa('0x37')](_0x3fcb7f['query'][_0x76aa('0x37')]));_0x994550['attributes']=_0x994550['attributes'][_0x76aa('0x38')]?_0x994550[_0x76aa('0x39')]:_0x365ff8[_0x76aa('0x32')];if(!_0x3fcb7f[_0x76aa('0x33')]['hasOwnProperty']('nolimit')){_0x994550[_0x76aa('0x1f')]=qs[_0x76aa('0x1f')](_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x1f')]);_0x994550[_0x76aa('0x1e')]=qs['offset'](_0x3fcb7f[_0x76aa('0x33')]['offset']);}_0x994550['order']=qs[_0x76aa('0x3a')](_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x3a')]);_0x994550[_0x76aa('0x3b')]=qs['filters'](_[_0x76aa('0x3c')](_0x3fcb7f[_0x76aa('0x33')],_0x365ff8[_0x76aa('0x35')]),_0x1e90b9);if(_0x3fcb7f['query'][_0x76aa('0x3d')]){_0x994550[_0x76aa('0x3b')]=_[_0x76aa('0x3e')](_0x994550[_0x76aa('0x3b')],{'$or':_[_0x76aa('0x2d')](_0x1e90b9,function(_0x982e62){if(_0x982e62[_0x76aa('0x31')]!==_0x76aa('0x3f')){var _0x283179={};_0x283179[_0x982e62['name']]={'$like':'%'+_0x3fcb7f[_0x76aa('0x33')][_0x76aa('0x3d')]+'%'};return _0x283179;}})});}_0x994550=_[_0x76aa('0x3e')]({},_0x994550,_0x3fcb7f[_0x76aa('0x40')]);var _0x64612e={'where':_0x994550[_0x76aa('0x3b')]};return db['JscriptyAnswerReport']['count'](_0x64612e)[_0x76aa('0x27')](function(_0x262906){_0x2dec94[_0x76aa('0x1d')]=_0x262906;if(_0x3fcb7f[_0x76aa('0x33')]['includeAll']){_0x994550[_0x76aa('0x41')]=[{'all':!![]}];}return db[_0x76aa('0x2e')][_0x76aa('0x42')](_0x994550);})[_0x76aa('0x27')](function(_0x1138b5){_0x2dec94['rows']=_0x1138b5;return _0x2dec94;})[_0x76aa('0x27')](respondWithFilteredResult(_0x5a8030,_0x994550))['catch'](handleError(_0x5a8030,null));};exports[_0x76aa('0x43')]=function(_0x54b8fd,_0x496304){var _0x4f7f3a={'raw':!![],'where':{'id':_0x54b8fd['params']['id']}},_0x144f0a={};_0x144f0a['model']=_['keys'](db[_0x76aa('0x2e')][_0x76aa('0x2f')]);_0x144f0a[_0x76aa('0x33')]=_[_0x76aa('0x34')](_0x54b8fd[_0x76aa('0x33')]);_0x144f0a['filters']=_[_0x76aa('0x36')](_0x144f0a[_0x76aa('0x32')],_0x144f0a[_0x76aa('0x33')]);_0x4f7f3a[_0x76aa('0x39')]=_[_0x76aa('0x36')](_0x144f0a['model'],qs[_0x76aa('0x37')](_0x54b8fd[_0x76aa('0x33')]['fields']));_0x4f7f3a[_0x76aa('0x39')]=_0x4f7f3a['attributes'][_0x76aa('0x38')]?_0x4f7f3a[_0x76aa('0x39')]:_0x144f0a[_0x76aa('0x32')];if(_0x54b8fd[_0x76aa('0x33')][_0x76aa('0x44')]){_0x4f7f3a[_0x76aa('0x41')]=[{'all':!![]}];}_0x4f7f3a=_[_0x76aa('0x3e')]({},_0x4f7f3a,_0x54b8fd[_0x76aa('0x40')]);return db[_0x76aa('0x2e')][_0x76aa('0x45')](_0x4f7f3a)['then'](handleEntityNotFound(_0x496304,null))[_0x76aa('0x27')](respondWithResult(_0x496304,null))['catch'](handleError(_0x496304,null));};exports[_0x76aa('0x46')]=function(_0x3d3332,_0x5e95f5){return db[_0x76aa('0x2e')]['create'](_0x3d3332['body'],{})[_0x76aa('0x27')](respondWithResult(_0x5e95f5,0xc9))['catch'](handleError(_0x5e95f5,null));};exports[_0x76aa('0x26')]=function(_0x302a0c,_0x4315b3){if(_0x302a0c[_0x76aa('0x47')]['id']){delete _0x302a0c[_0x76aa('0x47')]['id'];}return db[_0x76aa('0x2e')]['find']({'where':{'id':_0x302a0c['params']['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x4315b3,null))[_0x76aa('0x27')](saveUpdates(_0x302a0c[_0x76aa('0x47')],null))[_0x76aa('0x27')](respondWithResult(_0x4315b3,null))[_0x76aa('0x48')](handleError(_0x4315b3,null));};exports[_0x76aa('0x28')]=function(_0x4c52d5,_0x95b7c5){return db[_0x76aa('0x2e')][_0x76aa('0x45')]({'where':{'id':_0x4c52d5['params']['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x95b7c5,null))['then'](removeEntity(_0x95b7c5,null))[_0x76aa('0x48')](handleError(_0x95b7c5,null));};exports['describe']=function(_0x339b0d,_0x4449c1){return db[_0x76aa('0x2e')][_0x76aa('0x49')]()[_0x76aa('0x27')](respondWithResult(_0x4449c1,null))[_0x76aa('0x48')](handleError(_0x4449c1,null));};
\ No newline at end of file
index 8a487a1..f43afa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb277=['exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyAnswerReport.attributes'];(function(_0x2c8718,_0x2b52da){var _0x1af3c1=function(_0x5ef389){while(--_0x5ef389){_0x2c8718['push'](_0x2c8718['shift']());}};_0x1af3c1(++_0x2b52da);}(_0xb277,0x184));var _0x7b27=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xb277[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x7b27('0x0'));var logger=require(_0x7b27('0x1'))(_0x7b27('0x2'));var moment=require(_0x7b27('0x3'));var BPromise=require(_0x7b27('0x4'));var rp=require(_0x7b27('0x5'));var fs=require('fs');var path=require(_0x7b27('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7b27('0x7'));module[_0x7b27('0x8')]=function(_0x548ddb,_0xd6dc75){return _0x548ddb[_0x7b27('0x9')](_0x7b27('0xa'),attributes,{'tableName':_0x7b27('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c33=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3d46a0,_0xb42b0d){var _0x4a5c0e=function(_0x4c2c49){while(--_0x4c2c49){_0x3d46a0['push'](_0x3d46a0['shift']());}};_0x4a5c0e(++_0xb42b0d);}(_0x0c33,0xfd));var _0x30c3=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0x0c33[_0x132558];return _0x34f138;};'use strict';var _=require(_0x30c3('0x0'));var util=require('util');var logger=require(_0x30c3('0x1'))(_0x30c3('0x2'));var moment=require(_0x30c3('0x3'));var BPromise=require(_0x30c3('0x4'));var rp=require(_0x30c3('0x5'));var fs=require('fs');var path=require(_0x30c3('0x6'));var rimraf=require('rimraf');var config=require(_0x30c3('0x7'));var attributes=require(_0x30c3('0x8'));module[_0x30c3('0x9')]=function(_0x4dbeac,_0x4e1b70){return _0x4dbeac[_0x30c3('0xa')](_0x30c3('0xb'),attributes,{'tableName':_0x30c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 84cf06c..3908aba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bd6=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info'];(function(_0x5f0ecc,_0x51c82e){var _0x5e0cbe=function(_0x8dbc7){while(--_0x8dbc7){_0x5f0ecc['push'](_0x5f0ecc['shift']());}};_0x5e0cbe(++_0x51c82e);}(_0x5bd6,0x112));var _0x65bd=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x5bd6[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x65bd('0x0'));var util=require('util');var moment=require(_0x65bd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65bd('0x2'));var db=require(_0x65bd('0x3'))['db'];var utils=require(_0x65bd('0x4'));var logger=require(_0x65bd('0x5'))(_0x65bd('0x6'));var config=require(_0x65bd('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x65bd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e417d,_0x3e74f,_0x1af00f){return new BPromise(function(_0x25fac4,_0x2ac8d8){return client['request'](_0x2e417d,_0x1af00f)[_0x65bd('0x9')](function(_0xf66c79){logger[_0x65bd('0xa')](_0x65bd('0xb'),_0x3e74f,_0x65bd('0xc'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3e74f,_0x65bd('0xc'),JSON[_0x65bd('0xd')](_0xf66c79));if(_0xf66c79[_0x65bd('0xe')]){if(_0xf66c79[_0x65bd('0xe')][_0x65bd('0xf')]===0x1f4){logger[_0x65bd('0xe')](_0x65bd('0xb'),_0x3e74f,_0xf66c79[_0x65bd('0xe')]['message']);return _0x2ac8d8(_0xf66c79[_0x65bd('0xe')][_0x65bd('0x10')]);}logger[_0x65bd('0xe')](_0x65bd('0xb'),_0x3e74f,_0xf66c79['error'][_0x65bd('0x10')]);return _0x25fac4(_0xf66c79[_0x65bd('0xe')][_0x65bd('0x10')]);}else{logger['info'](_0x65bd('0xb'),_0x3e74f,_0x65bd('0xc'));_0x25fac4(_0xf66c79[_0x65bd('0x11')][_0x65bd('0x10')]);}})[_0x65bd('0x12')](function(_0x5d545d){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3e74f,_0x5d545d);_0x2ac8d8(_0x5d545d);});});}
\ No newline at end of file
+var _0x0c66=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x5088df,_0x7dcab5){var _0x47316d=function(_0x170b65){while(--_0x170b65){_0x5088df['push'](_0x5088df['shift']());}};_0x47316d(++_0x7dcab5);}(_0x0c66,0x1d4));var _0x60c6=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x0c66[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x60c6('0x0'));var util=require(_0x60c6('0x1'));var moment=require(_0x60c6('0x2'));var BPromise=require(_0x60c6('0x3'));var rs=require(_0x60c6('0x4'));var fs=require('fs');var Redis=require(_0x60c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x60c6('0x6'));var logger=require(_0x60c6('0x7'))(_0x60c6('0x8'));var config=require(_0x60c6('0x9'));var jayson=require(_0x60c6('0xa'));var client=jayson[_0x60c6('0xb')][_0x60c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f0335,_0xa0a40a,_0x1642e7){return new BPromise(function(_0x583da6,_0x4c9958){return client[_0x60c6('0xd')](_0x5f0335,_0x1642e7)[_0x60c6('0xe')](function(_0x624724){logger[_0x60c6('0xf')](_0x60c6('0x10'),_0xa0a40a,_0x60c6('0x11'));logger[_0x60c6('0x12')](_0x60c6('0x13'),_0xa0a40a,_0x60c6('0x11'),JSON['stringify'](_0x624724));if(_0x624724['error']){if(_0x624724['error'][_0x60c6('0x14')]===0x1f4){logger[_0x60c6('0x15')](_0x60c6('0x10'),_0xa0a40a,_0x624724[_0x60c6('0x15')][_0x60c6('0x16')]);return _0x4c9958(_0x624724[_0x60c6('0x15')][_0x60c6('0x16')]);}logger[_0x60c6('0x15')](_0x60c6('0x10'),_0xa0a40a,_0x624724[_0x60c6('0x15')][_0x60c6('0x16')]);return _0x583da6(_0x624724[_0x60c6('0x15')][_0x60c6('0x16')]);}else{logger[_0x60c6('0xf')](_0x60c6('0x10'),_0xa0a40a,_0x60c6('0x11'));_0x583da6(_0x624724[_0x60c6('0x17')][_0x60c6('0x16')]);}})[_0x60c6('0x18')](function(_0x10741b){logger[_0x60c6('0x15')](_0x60c6('0x10'),_0xa0a40a,_0x10741b);_0x4c9958(_0x10741b);});});}
\ No newline at end of file
index c65a25c..bd9c2d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b02=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','update'];(function(_0x1a23ea,_0x2772fd){var _0x1f642d=function(_0x2700f0){while(--_0x2700f0){_0x1a23ea['push'](_0x1a23ea['shift']());}};_0x1f642d(++_0x2772fd);}(_0x6b02,0xb9));var _0x26b0=function(_0x5e5c67,_0x4ef04f){_0x5e5c67=_0x5e5c67-0x0;var _0xe5f654=_0x6b02[_0x5e5c67];return _0xe5f654;};'use strict';var multer=require(_0x26b0('0x0'));var util=require(_0x26b0('0x1'));var path=require('path');var timeout=require(_0x26b0('0x2'));var express=require(_0x26b0('0x3'));var router=express[_0x26b0('0x4')]();var fs_extra=require(_0x26b0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x26b0('0x6'));var config=require(_0x26b0('0x7'));var controller=require('./jscriptyProject.controller');router[_0x26b0('0x8')]('/',auth[_0x26b0('0x9')](),controller[_0x26b0('0xa')]);router[_0x26b0('0x8')](_0x26b0('0xb'),auth[_0x26b0('0x9')](),controller[_0x26b0('0xc')]);router[_0x26b0('0x8')](_0x26b0('0xd'),auth[_0x26b0('0x9')](),controller[_0x26b0('0xe')]);router['get'](_0x26b0('0xf'),auth[_0x26b0('0x9')](),controller[_0x26b0('0x10')]);router[_0x26b0('0x8')](_0x26b0('0x11'),auth[_0x26b0('0x9')](),timeout(_0x26b0('0x12')),controller['getSummary']);router[_0x26b0('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x26b0('0x14'),auth[_0x26b0('0x9')](),controller[_0x26b0('0x15')]);router['put'](_0x26b0('0xb'),auth[_0x26b0('0x9')](),controller[_0x26b0('0x16')]);router[_0x26b0('0x17')](_0x26b0('0xb'),auth[_0x26b0('0x9')](),controller[_0x26b0('0x18')]);module[_0x26b0('0x19')]=router;
\ No newline at end of file
+var _0x2224=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x43979,_0x5d527a){var _0x2fada3=function(_0x54f13c){while(--_0x54f13c){_0x43979['push'](_0x43979['shift']());}};_0x2fada3(++_0x5d527a);}(_0x2224,0x176));var _0x4222=function(_0x575b72,_0x1a7eb1){_0x575b72=_0x575b72-0x0;var _0x561c57=_0x2224[_0x575b72];return _0x561c57;};'use strict';var multer=require('multer');var util=require(_0x4222('0x0'));var path=require(_0x4222('0x1'));var timeout=require(_0x4222('0x2'));var express=require(_0x4222('0x3'));var router=express[_0x4222('0x4')]();var fs_extra=require(_0x4222('0x5'));var auth=require(_0x4222('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4222('0x7'));var controller=require(_0x4222('0x8'));router['get']('/',auth[_0x4222('0x9')](),controller[_0x4222('0xa')]);router[_0x4222('0xb')](_0x4222('0xc'),auth[_0x4222('0x9')](),controller[_0x4222('0xd')]);router[_0x4222('0xb')](_0x4222('0xe'),auth[_0x4222('0x9')](),controller[_0x4222('0xf')]);router[_0x4222('0xb')](_0x4222('0x10'),auth['isAuthenticated'](),controller[_0x4222('0x11')]);router[_0x4222('0xb')](_0x4222('0x12'),auth[_0x4222('0x9')](),timeout('30s'),controller[_0x4222('0x13')]);router[_0x4222('0x14')]('/',auth['isAuthenticated'](),controller[_0x4222('0x15')]);router['post'](_0x4222('0x16'),auth[_0x4222('0x9')](),controller[_0x4222('0x17')]);router[_0x4222('0x18')](_0x4222('0xc'),auth[_0x4222('0x9')](),controller[_0x4222('0x19')]);router[_0x4222('0x1a')](_0x4222('0xc'),auth[_0x4222('0x9')](),controller[_0x4222('0x1b')]);module[_0x4222('0x1c')]=router;
\ No newline at end of file
index 908c58b..da78c9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1221=['stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','name','STRING','TEXT','isObjectLike','setDataValue'];(function(_0x30ce07,_0x30a402){var _0x4449e9=function(_0x17e7bc){while(--_0x17e7bc){_0x30ce07['push'](_0x30ce07['shift']());}};_0x4449e9(++_0x30a402);}(_0x1221,0x151));var _0x1122=function(_0x5c2aaa,_0x44d237){_0x5c2aaa=_0x5c2aaa-0x0;var _0x351e08=_0x1221[_0x5c2aaa];return _0x351e08;};'use strict';var Sequelize=require(_0x1122('0x0'));var _=require(_0x1122('0x1'));var util=require(_0x1122('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1122('0x3')},'description':{'type':Sequelize[_0x1122('0x4')]},'formData':{'type':Sequelize[_0x1122('0x5')]('long'),'set':function(_0x242ee0){if(_[_0x1122('0x6')](_0x242ee0)){this[_0x1122('0x7')]('formData',JSON[_0x1122('0x8')](_0x242ee0));}else if(_[_0x1122('0x9')](_0x242ee0)){this[_0x1122('0x7')](_0x1122('0xa'),_0x242ee0);}else{this['setDataValue'](_0x1122('0xa'),util[_0x1122('0xb')](_0x1122('0xc'),this[_0x1122('0xd')](_0x1122('0x3'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x1122('0xe')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1cb5=['setDataValue','stringify','isString','formData','getDataValue','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','isObjectLike'];(function(_0x5c4e05,_0x6eb642){var _0x241132=function(_0x258a15){while(--_0x258a15){_0x5c4e05['push'](_0x5c4e05['shift']());}};_0x241132(++_0x6eb642);}(_0x1cb5,0x1aa));var _0x51cb=function(_0x551c03,_0x270696){_0x551c03=_0x551c03-0x0;var _0x58ddab=_0x1cb5[_0x551c03];return _0x58ddab;};'use strict';var Sequelize=require(_0x51cb('0x0'));var _=require(_0x51cb('0x1'));var util=require(_0x51cb('0x2'));module[_0x51cb('0x3')]={'name':{'type':Sequelize[_0x51cb('0x4')],'unique':_0x51cb('0x5')},'description':{'type':Sequelize[_0x51cb('0x4')]},'formData':{'type':Sequelize[_0x51cb('0x6')]('long'),'set':function(_0x50f54a){if(_[_0x51cb('0x7')](_0x50f54a)){this[_0x51cb('0x8')]('formData',JSON[_0x51cb('0x9')](_0x50f54a));}else if(_[_0x51cb('0xa')](_0x50f54a)){this[_0x51cb('0x8')](_0x51cb('0xb'),_0x50f54a);}else{this[_0x51cb('0x8')](_0x51cb('0xb'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x51cb('0xc')](_0x51cb('0x5'))||'',this[_0x51cb('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x51cb('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x51cb('0xd')],'defaultValue':![]}};
\ No newline at end of file
index 70306b2..0356bde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e2e=['findAll','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','hasOwnProperty','questionId','question','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Projects','UserProfileResource','error','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','order','pick','ProjectId','getAnswers','JscriptyAnswerReport'];(function(_0x527b3c,_0x2036bf){var _0x3f89eb=function(_0x25a337){while(--_0x25a337){_0x527b3c['push'](_0x527b3c['shift']());}};_0x3f89eb(++_0x2036bf);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x3166e4,_0x178edb){_0x3166e4=_0x3166e4-0x0;var _0x30e728=_0x4e2e[_0x3166e4];return _0x30e728;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require(_0xe4e2('0x5'));var Mustache=require('mustache');var util=require(_0xe4e2('0x6'));var path=require(_0xe4e2('0x7'));var sox=require(_0xe4e2('0x8'));var csv=require(_0xe4e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4e2('0xa'));var _=require(_0xe4e2('0xb'));var squel=require(_0xe4e2('0xc'));var crypto=require(_0xe4e2('0xd'));var jsforce=require(_0xe4e2('0xe'));var deskjs=require(_0xe4e2('0xf'));var toCsv=require(_0xe4e2('0x9'));var querystring=require(_0xe4e2('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4e2('0x11'));var authService=require(_0xe4e2('0x12'));var qs=require(_0xe4e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e2('0x14'));var logger=require(_0xe4e2('0x15'))(_0xe4e2('0x16'));var utils=require(_0xe4e2('0x17'));var config=require(_0xe4e2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e2('0x19'))['db'];function respondWithStatusCode(_0x20d34e,_0x19c6ef){_0x19c6ef=_0x19c6ef||0xcc;return function(_0x13657c){if(_0x13657c){return _0x20d34e['sendStatus'](_0x19c6ef);}return _0x20d34e[_0xe4e2('0x1a')](_0x19c6ef)[_0xe4e2('0x1b')]();};}function respondWithResult(_0xb45217,_0x4e0bc2){_0x4e0bc2=_0x4e0bc2||0xc8;return function(_0x202486){if(_0x202486){return _0xb45217['status'](_0x4e0bc2)['json'](_0x202486);}};}function respondWithFilteredResult(_0x117a2a,_0x2d2018){return function(_0x1f9b2d){if(_0x1f9b2d){var _0x28ee12=typeof _0x2d2018[_0xe4e2('0x1c')]==='undefined'&&typeof _0x2d2018[_0xe4e2('0x1d')]===_0xe4e2('0x1e');var _0x340935=_0x1f9b2d['count'];var _0x196f16=_0x28ee12?0x0:_0x2d2018['offset'];var _0x1d5e9d=_0x28ee12?_0x1f9b2d[_0xe4e2('0x1f')]:_0x2d2018[_0xe4e2('0x1c')]+_0x2d2018[_0xe4e2('0x1d')];var _0x3dfbdf;if(_0x1d5e9d>=_0x340935){_0x1d5e9d=_0x340935;_0x3dfbdf=0xc8;}else{_0x3dfbdf=0xce;}_0x117a2a[_0xe4e2('0x1a')](_0x3dfbdf);return _0x117a2a[_0xe4e2('0x20')](_0xe4e2('0x21'),_0x196f16+'-'+_0x1d5e9d+'/'+_0x340935)[_0xe4e2('0x22')](_0x1f9b2d);}return null;};}function patchUpdates(_0x362741){return function(_0x5a84c5){try{jsonpatch[_0xe4e2('0x23')](_0x5a84c5,_0x362741,!![]);}catch(_0x2e7ecd){return BPromise[_0xe4e2('0x24')](_0x2e7ecd);}return _0x5a84c5[_0xe4e2('0x25')]();};}function saveUpdates(_0xbdf1ad,_0x23b466){return function(_0x16f14b){if(_0x16f14b){return _0x16f14b['update'](_0xbdf1ad)[_0xe4e2('0x26')](function(_0x2ab435){return _0x2ab435;});}return null;};}function removeEntity(_0x2088b9,_0x5373c0){return function(_0x353030){if(_0x353030){return _0x353030[_0xe4e2('0x27')]()['then'](function(){var _0xcba85a=_0x353030[_0xe4e2('0x28')]({'plain':!![]});var _0x29143c=_0xe4e2('0x29');return db[_0xe4e2('0x2a')]['destroy']({'where':{'type':_0x29143c,'resourceId':_0xcba85a['id']}})[_0xe4e2('0x26')](function(){return _0x353030;});})[_0xe4e2('0x26')](function(){_0x2088b9[_0xe4e2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a31b8,_0x41cfd9){return function(_0x31f651){if(!_0x31f651){_0x3a31b8['sendStatus'](0x194);}return _0x31f651;};}function handleError(_0x2e5a65,_0x50b4d9){_0x50b4d9=_0x50b4d9||0x1f4;return function(_0x477b5c){logger[_0xe4e2('0x2b')](_0x477b5c['stack']);if(_0x477b5c[_0xe4e2('0x2c')]){delete _0x477b5c[_0xe4e2('0x2c')];}_0x2e5a65[_0xe4e2('0x1a')](_0x50b4d9)[_0xe4e2('0x2d')](_0x477b5c);};}exports[_0xe4e2('0x2e')]=function(_0x4d33de,_0x5f30dc){var _0x2cb235={},_0x2fe075={},_0x12848d={'count':0x0,'rows':[]};var _0x26fb97=_[_0xe4e2('0x2f')](db[_0xe4e2('0x30')][_0xe4e2('0x31')],function(_0x40569e){return{'name':_0x40569e[_0xe4e2('0x32')],'type':_0x40569e[_0xe4e2('0x33')][_0xe4e2('0x34')]};});_0x2fe075[_0xe4e2('0x35')]=_['map'](_0x26fb97,_0xe4e2('0x2c'));_0x2fe075[_0xe4e2('0x36')]=_[_0xe4e2('0x37')](_0x4d33de[_0xe4e2('0x36')]);_0x2fe075[_0xe4e2('0x38')]=_[_0xe4e2('0x39')](_0x2fe075['model'],_0x2fe075[_0xe4e2('0x36')]);_0x2cb235[_0xe4e2('0x3a')]=_[_0xe4e2('0x39')](_0x2fe075[_0xe4e2('0x35')],qs[_0xe4e2('0x3b')](_0x4d33de[_0xe4e2('0x36')][_0xe4e2('0x3b')]));_0x2cb235[_0xe4e2('0x3a')]=_0x2cb235[_0xe4e2('0x3a')][_0xe4e2('0x3c')]?_0x2cb235[_0xe4e2('0x3a')]:_0x2fe075['model'];if(!_0x4d33de[_0xe4e2('0x36')]['hasOwnProperty'](_0xe4e2('0x3d'))){_0x2cb235[_0xe4e2('0x1d')]=qs['limit'](_0x4d33de[_0xe4e2('0x36')][_0xe4e2('0x1d')]);_0x2cb235[_0xe4e2('0x1c')]=qs[_0xe4e2('0x1c')](_0x4d33de['query'][_0xe4e2('0x1c')]);}_0x2cb235['order']=qs[_0xe4e2('0x3e')](_0x4d33de['query'][_0xe4e2('0x3e')]);_0x2cb235[_0xe4e2('0x3f')]=qs[_0xe4e2('0x38')](_['pick'](_0x4d33de[_0xe4e2('0x36')],_0x2fe075[_0xe4e2('0x38')]),_0x26fb97);if(_0x4d33de['query'][_0xe4e2('0x40')]){_0x2cb235[_0xe4e2('0x3f')]=_[_0xe4e2('0x41')](_0x2cb235[_0xe4e2('0x3f')],{'$or':_[_0xe4e2('0x2f')](_0x26fb97,function(_0x242435){if(_0x242435[_0xe4e2('0x33')]!==_0xe4e2('0x42')){var _0xc07ff5={};_0xc07ff5[_0x242435['name']]={'$like':'%'+_0x4d33de['query'][_0xe4e2('0x40')]+'%'};return _0xc07ff5;}})});}_0x2cb235=_[_0xe4e2('0x41')]({},_0x2cb235,_0x4d33de[_0xe4e2('0x43')]);var _0x3e1ae5={'where':_0x2cb235['where']};return db['JscriptyProject'][_0xe4e2('0x1f')](_0x3e1ae5)[_0xe4e2('0x26')](function(_0x3080d5){_0x12848d[_0xe4e2('0x1f')]=_0x3080d5;if(_0x4d33de['query'][_0xe4e2('0x44')]){_0x2cb235[_0xe4e2('0x45')]=[{'all':!![]}];}return db[_0xe4e2('0x30')]['findAll'](_0x2cb235);})[_0xe4e2('0x26')](function(_0x4789cf){_0x12848d[_0xe4e2('0x46')]=_0x4789cf;return _0x12848d;})[_0xe4e2('0x26')](respondWithFilteredResult(_0x5f30dc,_0x2cb235))['catch'](handleError(_0x5f30dc,null));};exports['show']=function(_0x41f16c,_0x87eb2d){var _0x39fff5={'raw':![],'where':{'id':_0x41f16c[_0xe4e2('0x47')]['id']}},_0x5c29c3={};_0x5c29c3[_0xe4e2('0x35')]=_['keys'](db[_0xe4e2('0x30')][_0xe4e2('0x31')]);_0x5c29c3[_0xe4e2('0x36')]=_[_0xe4e2('0x37')](_0x41f16c[_0xe4e2('0x36')]);_0x5c29c3[_0xe4e2('0x38')]=_[_0xe4e2('0x39')](_0x5c29c3[_0xe4e2('0x35')],_0x5c29c3['query']);_0x39fff5[_0xe4e2('0x3a')]=_[_0xe4e2('0x39')](_0x5c29c3['model'],qs['fields'](_0x41f16c[_0xe4e2('0x36')][_0xe4e2('0x3b')]));_0x39fff5[_0xe4e2('0x3a')]=_0x39fff5['attributes'][_0xe4e2('0x3c')]?_0x39fff5[_0xe4e2('0x3a')]:_0x5c29c3[_0xe4e2('0x35')];if(_0x41f16c[_0xe4e2('0x36')]['includeAll']){_0x39fff5[_0xe4e2('0x45')]=[{'all':!![]}];}_0x39fff5=_[_0xe4e2('0x41')]({},_0x39fff5,_0x41f16c[_0xe4e2('0x43')]);return db[_0xe4e2('0x30')]['find'](_0x39fff5)[_0xe4e2('0x26')](handleEntityNotFound(_0x87eb2d,null))[_0xe4e2('0x26')](respondWithResult(_0x87eb2d,null))['catch'](handleError(_0x87eb2d,null));};exports[_0xe4e2('0x48')]=function(_0xedcd86,_0x21e5d7){return db['JscriptyProject'][_0xe4e2('0x48')](_0xedcd86[_0xe4e2('0x49')],{})[_0xe4e2('0x26')](function(_0x599978){var _0x5edd7e=_0xedcd86[_0xe4e2('0x4a')]['get']({'plain':!![]});if(!_0x5edd7e)throw new Error(_0xe4e2('0x4b'));if(_0x5edd7e['role']===_0xe4e2('0x4a')){var _0x2125df=_0x599978[_0xe4e2('0x28')]({'plain':!![]});var _0x553817=_0xe4e2('0x29');return db['UserProfileSection'][_0xe4e2('0x4c')]({'where':{'name':_0x553817,'userProfileId':_0x5edd7e[_0xe4e2('0x4d')]},'raw':!![]})['then'](function(_0x9d00fb){if(_0x9d00fb&&_0x9d00fb['autoAssociation']===0x0){return db[_0xe4e2('0x2a')][_0xe4e2('0x48')]({'name':_0x2125df['name'],'resourceId':_0x2125df['id'],'type':_0x9d00fb[_0xe4e2('0x2c')],'sectionId':_0x9d00fb['id']},{})[_0xe4e2('0x26')](function(){return _0x599978;});}else{return _0x599978;}})[_0xe4e2('0x4e')](function(_0x3e540d){logger[_0xe4e2('0x2b')](_0xe4e2('0x4f'),_0x3e540d);throw _0x3e540d;});}return _0x599978;})[_0xe4e2('0x26')](respondWithResult(_0x21e5d7,0xc9))[_0xe4e2('0x4e')](handleError(_0x21e5d7,null));};exports[_0xe4e2('0x50')]=function(_0x503b77,_0x3e65df){var _0x172747={'where':{'id':_0x503b77[_0xe4e2('0x47')]['id']}},_0x2c1b83={};_0x2c1b83[_0xe4e2('0x35')]=_[_0xe4e2('0x37')](db[_0xe4e2('0x30')][_0xe4e2('0x31')]);_0x172747[_0xe4e2('0x3a')]=_[_0xe4e2('0x39')](_0x2c1b83[_0xe4e2('0x35')],qs['fields'](_0x503b77[_0xe4e2('0x36')][_0xe4e2('0x3b')]));_0x172747[_0xe4e2('0x3a')]=_0x172747[_0xe4e2('0x3a')]['length']?_0x172747[_0xe4e2('0x3a')]:_0x2c1b83[_0xe4e2('0x35')];if(_0x503b77['query'][_0xe4e2('0x44')]){_0x172747[_0xe4e2('0x45')]=[{'all':!![]}];}_0x172747=_[_0xe4e2('0x41')]({},_0x172747,_0x503b77[_0xe4e2('0x43')]);return db['JscriptyProject'][_0xe4e2('0x4c')](_0x172747)['then'](handleEntityNotFound(_0x3e65df,null))[_0xe4e2('0x26')](function(_0x26847){if(_0x26847){var _0x1f22fb=_0x26847[_0xe4e2('0x28')]({'plain':!![]});_0x1f22fb=qs[_0xe4e2('0x51')](_0x1f22fb,['id',_0xe4e2('0x52'),_0xe4e2('0x53')]);_0x503b77[_0xe4e2('0x49')]=_[_0xe4e2('0x51')](_0x503b77[_0xe4e2('0x49')],['id',_0xe4e2('0x52'),_0xe4e2('0x53')]);return db['JscriptyProject'][_0xe4e2('0x48')](_['merge'](_0x1f22fb,_0x503b77['body']),{'include':_0x503b77[_0xe4e2('0x36')][_0xe4e2('0x44')]?[{'all':!![]}]:undefined})[_0xe4e2('0x26')](function(_0x5e4e16){var _0x477acd=_0x503b77['user'][_0xe4e2('0x28')]({'plain':!![]});if(!_0x477acd)throw new Error(_0xe4e2('0x4b'));if(_0x477acd['role']===_0xe4e2('0x4a')){var _0x14f7da=_0x5e4e16['get']({'plain':!![]});var _0x3f2b39=_0xe4e2('0x29');return db['UserProfileSection'][_0xe4e2('0x4c')]({'where':{'name':_0x3f2b39,'userProfileId':_0x477acd[_0xe4e2('0x4d')]},'raw':!![]})[_0xe4e2('0x26')](function(_0x3f7be9){if(_0x3f7be9&&_0x3f7be9['autoAssociation']===0x0){return db[_0xe4e2('0x2a')][_0xe4e2('0x48')]({'name':_0x14f7da[_0xe4e2('0x2c')],'resourceId':_0x14f7da['id'],'type':_0x3f7be9[_0xe4e2('0x2c')],'sectionId':_0x3f7be9['id']},{})[_0xe4e2('0x26')](function(){return _0x5e4e16;});}else{return _0x5e4e16;}})[_0xe4e2('0x4e')](function(_0x1ef7f8){logger[_0xe4e2('0x2b')](_0xe4e2('0x4f'),_0x1ef7f8);throw _0x1ef7f8;});}return _0x5e4e16;});}})['then'](respondWithResult(_0x3e65df,0xc9))['catch'](handleError(_0x3e65df,null));};exports['update']=function(_0x39f59c,_0x17d904){if(_0x39f59c[_0xe4e2('0x49')]['id']){delete _0x39f59c[_0xe4e2('0x49')]['id'];}return db[_0xe4e2('0x30')][_0xe4e2('0x4c')]({'where':{'id':_0x39f59c[_0xe4e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x17d904,null))[_0xe4e2('0x26')](saveUpdates(_0x39f59c[_0xe4e2('0x49')],null))[_0xe4e2('0x26')](respondWithResult(_0x17d904,null))[_0xe4e2('0x4e')](handleError(_0x17d904,null));};exports[_0xe4e2('0x27')]=function(_0x3ec540,_0x272d13){return db[_0xe4e2('0x30')][_0xe4e2('0x4c')]({'where':{'id':_0x3ec540[_0xe4e2('0x47')]['id']}})[_0xe4e2('0x26')](handleEntityNotFound(_0x272d13,null))[_0xe4e2('0x26')](removeEntity(_0x272d13,null))[_0xe4e2('0x4e')](handleError(_0x272d13,null));};exports[_0xe4e2('0x54')]=function(_0x3dde87,_0x51d58d,_0x4434c9){var _0xdeb76a={'raw':!![],'where':{}};var _0x32185b={};var _0x46d17a={'count':0x0,'rows':[]};return db[_0xe4e2('0x30')][_0xe4e2('0x55')]({'where':{'id':_0x3dde87[_0xe4e2('0x47')]['id']}})[_0xe4e2('0x26')](handleEntityNotFound(_0x51d58d,null))[_0xe4e2('0x26')](function(_0x23e014){if(_0x23e014){_0x32185b['model']=_[_0xe4e2('0x37')](db[_0xe4e2('0x56')][_0xe4e2('0x31')]);_0x32185b[_0xe4e2('0x36')]=_[_0xe4e2('0x37')](_0x3dde87[_0xe4e2('0x36')]);_0x32185b[_0xe4e2('0x38')]=_[_0xe4e2('0x39')](_0x32185b['model'],_0x32185b[_0xe4e2('0x36')]);_0xdeb76a[_0xe4e2('0x3a')]=_[_0xe4e2('0x39')](_0x32185b[_0xe4e2('0x35')],qs[_0xe4e2('0x3b')](_0x3dde87[_0xe4e2('0x36')][_0xe4e2('0x3b')]));_0xdeb76a[_0xe4e2('0x3a')]=_0xdeb76a[_0xe4e2('0x3a')][_0xe4e2('0x3c')]?_0xdeb76a['attributes']:_0x32185b[_0xe4e2('0x35')];if(!_0x3dde87[_0xe4e2('0x36')]['hasOwnProperty'](_0xe4e2('0x3d'))){_0xdeb76a[_0xe4e2('0x1d')]=qs[_0xe4e2('0x1d')](_0x3dde87[_0xe4e2('0x36')][_0xe4e2('0x1d')]);_0xdeb76a['offset']=qs[_0xe4e2('0x1c')](_0x3dde87[_0xe4e2('0x36')][_0xe4e2('0x1c')]);}_0xdeb76a[_0xe4e2('0x57')]=qs[_0xe4e2('0x3e')](_0x3dde87[_0xe4e2('0x36')][_0xe4e2('0x3e')]);_0xdeb76a[_0xe4e2('0x3f')]=qs['filters'](_[_0xe4e2('0x58')](_0x3dde87[_0xe4e2('0x36')],_0x32185b[_0xe4e2('0x38')]));_0xdeb76a[_0xe4e2('0x3f')][_0xe4e2('0x59')]=_0x23e014['id'];if(_0x3dde87[_0xe4e2('0x36')][_0xe4e2('0x40')]){_0xdeb76a[_0xe4e2('0x3f')]=_[_0xe4e2('0x41')](_0xdeb76a['where'],{'$or':_[_0xe4e2('0x2f')](_0xdeb76a[_0xe4e2('0x3a')],function(_0x3244d6){var _0x40fa3c={};_0x40fa3c[_0x3244d6]={'$like':'%'+_0x3dde87[_0xe4e2('0x36')][_0xe4e2('0x40')]+'%'};return _0x40fa3c;})});}_0xdeb76a=_[_0xe4e2('0x41')]({},_0xdeb76a,_0x3dde87[_0xe4e2('0x43')]);return db[_0xe4e2('0x56')][_0xe4e2('0x1f')]({'where':_0xdeb76a[_0xe4e2('0x3f')]})[_0xe4e2('0x26')](function(_0x3fe76c){_0x46d17a['count']=_0x3fe76c;if(_0x3dde87[_0xe4e2('0x36')]['includeAll']){_0xdeb76a[_0xe4e2('0x45')]=[{'all':!![]}];}return db[_0xe4e2('0x56')]['findAll'](_0xdeb76a);})[_0xe4e2('0x26')](function(_0xd829a8){_0x46d17a[_0xe4e2('0x46')]=_0xd829a8;return _0x46d17a;});}})[_0xe4e2('0x26')](respondWithFilteredResult(_0x51d58d,_0xdeb76a))[_0xe4e2('0x4e')](handleError(_0x51d58d,null));};exports[_0xe4e2('0x5a')]=function(_0x20d12,_0x536057,_0x181d9e){var _0x355953={'raw':!![],'where':{}};var _0x5b0168={};var _0x4a8f87={'count':0x0,'rows':[]};return db[_0xe4e2('0x30')][_0xe4e2('0x55')]({'where':{'id':_0x20d12[_0xe4e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x536057,null))[_0xe4e2('0x26')](function(_0x5b0948){if(_0x5b0948){_0x5b0168[_0xe4e2('0x35')]=_[_0xe4e2('0x37')](db['JscriptyAnswerReport'][_0xe4e2('0x31')]);_0x5b0168[_0xe4e2('0x36')]=_[_0xe4e2('0x37')](_0x20d12[_0xe4e2('0x36')]);_0x5b0168[_0xe4e2('0x38')]=_[_0xe4e2('0x39')](_0x5b0168[_0xe4e2('0x35')],_0x5b0168[_0xe4e2('0x36')]);_0x355953[_0xe4e2('0x3a')]=_[_0xe4e2('0x39')](_0x5b0168['model'],qs[_0xe4e2('0x3b')](_0x20d12[_0xe4e2('0x36')]['fields']));_0x355953[_0xe4e2('0x3a')]=_0x355953['attributes'][_0xe4e2('0x3c')]?_0x355953[_0xe4e2('0x3a')]:_0x5b0168[_0xe4e2('0x35')];if(!_0x20d12[_0xe4e2('0x36')]['hasOwnProperty'](_0xe4e2('0x3d'))){_0x355953[_0xe4e2('0x1d')]=qs[_0xe4e2('0x1d')](_0x20d12[_0xe4e2('0x36')][_0xe4e2('0x1d')]);_0x355953[_0xe4e2('0x1c')]=qs[_0xe4e2('0x1c')](_0x20d12['query']['offset']);}_0x355953[_0xe4e2('0x57')]=qs[_0xe4e2('0x3e')](_0x20d12[_0xe4e2('0x36')][_0xe4e2('0x3e')]);_0x355953[_0xe4e2('0x3f')]=qs[_0xe4e2('0x38')](_[_0xe4e2('0x58')](_0x20d12[_0xe4e2('0x36')],_0x5b0168[_0xe4e2('0x38')]));_0x355953[_0xe4e2('0x3f')][_0xe4e2('0x59')]=_0x5b0948['id'];if(_0x20d12[_0xe4e2('0x36')][_0xe4e2('0x40')]){_0x355953[_0xe4e2('0x3f')]=_[_0xe4e2('0x41')](_0x355953[_0xe4e2('0x3f')],{'$or':_[_0xe4e2('0x2f')](_0x355953[_0xe4e2('0x3a')],function(_0x1930b9){var _0x536922={};_0x536922[_0x1930b9]={'$like':'%'+_0x20d12[_0xe4e2('0x36')][_0xe4e2('0x40')]+'%'};return _0x536922;})});}_0x355953=_[_0xe4e2('0x41')]({},_0x355953,_0x20d12['options']);return db['JscriptyAnswerReport'][_0xe4e2('0x1f')]({'where':_0x355953['where']})[_0xe4e2('0x26')](function(_0x30bbb5){_0x4a8f87[_0xe4e2('0x1f')]=_0x30bbb5;if(_0x20d12[_0xe4e2('0x36')][_0xe4e2('0x44')]){_0x355953[_0xe4e2('0x45')]=[{'all':!![]}];}return db[_0xe4e2('0x5b')][_0xe4e2('0x5c')](_0x355953);})[_0xe4e2('0x26')](function(_0x4a53fb){_0x4a8f87[_0xe4e2('0x46')]=_0x4a53fb;return _0x4a8f87;});}})[_0xe4e2('0x26')](respondWithFilteredResult(_0x536057,_0x355953))['catch'](handleError(_0x536057,null));};function char(_0x4ab01e){return _0xe4e2('0x5d')===typeof _0x4ab01e?String[_0xe4e2('0x5e')][_0xe4e2('0x23')](null,arguments):_0x4ab01e;}function needsEncapsulation(_0x10c166){return!!_0x10c166&&(_0x10c166[_0xe4e2('0x5f')]()[_0xe4e2('0x60')](char(0xd))>=0x0||_0x10c166[_0xe4e2('0x5f')]()[_0xe4e2('0x60')](char(0xa))>=0x0||_0x10c166[_0xe4e2('0x5f')]()[_0xe4e2('0x60')](char(0x2c))>=0x0||_0x10c166['toString']()[_0xe4e2('0x60')](char(0x22))>=0x0);}function encapsulate(_0x466aa2){var _0x174994=char(0x22),_0xb4355d='\x5c'+char(0x22),_0x46d566=_0x466aa2[_0xe4e2('0x5f')]()[_0xe4e2('0x61')](new RegExp(_0x174994,'g'),_0xb4355d);return _0x174994+_0x46d566+_0x174994;}exports['getSummary']=function(_0xceeaed,_0x3f329e,_0x256b6d){var _0x7d7592,_0x2a6e25;var _0x108f5a={'where':{'ProjectId':_0xceeaed[_0xe4e2('0x47')]['id']}};if(_0xceeaed[_0xe4e2('0x36')][_0xe4e2('0x62')]){_0x108f5a['where'][_0xe4e2('0x63')]=JSON[_0xe4e2('0x64')](_0xceeaed[_0xe4e2('0x36')]['startTime']);}return db[_0xe4e2('0x56')][_0xe4e2('0x5c')](_0x108f5a)[_0xe4e2('0x26')](handleEntityNotFound(_0x3f329e,null))[_0xe4e2('0x26')](function(_0x12d8e5){if(_0x12d8e5){_0x7d7592=_0x12d8e5;return db[_0xe4e2('0x65')]['findAll']({'where':{'SessionId':{'$in':_[_0xe4e2('0x2f')](_0x7d7592,'id')},'ProjectId':_0xceeaed[_0xe4e2('0x47')]['id']},'order':_0xe4e2('0x66')});}})['then'](handleEntityNotFound(_0x3f329e,null))[_0xe4e2('0x26')](function(_0x2b0b25){if(_0x2b0b25){_0x2a6e25=_0x2b0b25;var _0xeed072={};for(var _0x2c0751=0x0,_0x39c8f4=_0x2a6e25[_0xe4e2('0x3c')];_0x2c0751<_0x39c8f4;_0x2c0751++){if(!_0xeed072[_0xe4e2('0x67')](_0x2a6e25[_0x2c0751][_0xe4e2('0x68')])){_0xeed072[_0x2a6e25[_0x2c0751][_0xe4e2('0x68')]]=needsEncapsulation(_0x2a6e25[_0x2c0751][_0xe4e2('0x69')])?encapsulate(_0x2a6e25[_0x2c0751][_0xe4e2('0x69')]):_0x2a6e25[_0x2c0751][_0xe4e2('0x69')];}}var _0x321658=[],_0x46437f={};for(var _0x31bd18=0x0,_0x52cb24=_0x7d7592['length'];_0x31bd18<_0x52cb24;_0x31bd18++){_0x46437f={'ProjectId':_0xceeaed[_0xe4e2('0x47')]['id'],'SessionId':_0x7d7592[_0x31bd18]['id'],'StartTime':moment(_0x7d7592[_0x31bd18]['starttime'])['format'](_0xe4e2('0x6a'))};for(var _0x203fbc=0x0,_0x41c3a1=_0x2a6e25[_0xe4e2('0x3c')];_0x203fbc<_0x41c3a1;_0x203fbc++){if(_0x2a6e25[_0x203fbc]['SessionId']==_0x7d7592[_0x31bd18]['id']&&_0xeed072[_0xe4e2('0x67')](_0x2a6e25[_0x203fbc]['questionId'])){_0x46437f[_0xeed072[_0x2a6e25[_0x203fbc]['questionId']]]=_0x2a6e25[_0x203fbc][_0xe4e2('0x6b')];}}for(var _0x527d24 in _0xeed072){if(!_0x46437f[_0xe4e2('0x67')](_0xeed072[_0x527d24])){_0x46437f[_0xeed072[_0x527d24]]=null;}}_0x321658[_0xe4e2('0x6c')](_0x46437f);}return _0x321658;}})[_0xe4e2('0x26')](function(_0x4e6552){if(!_[_0xe4e2('0x6d')](_0x4e6552)){var _0x3c5048=toCsv(_0x4e6552);var _0x305988=Date['now']();fs[_0xe4e2('0x6e')](util[_0xe4e2('0x6f')](_0xe4e2('0x70'),_0xceeaed[_0xe4e2('0x47')]['id'],_0x305988),_0x3c5048);_0x3f329e['setHeader'](_0xe4e2('0x71'),_0xe4e2('0x72')+util[_0xe4e2('0x6f')]('Jscripty_Project_%d_Summary_%s.csv',_0xceeaed['params']['id'],_0x305988));_0x3f329e[_0xe4e2('0x73')](_0xe4e2('0x74'),'text/csv');return _0x3f329e[_0xe4e2('0x75')](util['format'](_0xe4e2('0x70'),_0xceeaed[_0xe4e2('0x47')]['id'],_0x305988));}else{return _0x3f329e['sendStatus'](0xcc);}})[_0xe4e2('0x4e')](handleError(_0x3f329e,null));};
\ No newline at end of file
+var _0xe605=['indexOf','replace','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','Projects','UserProfileResource','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','JscriptyProject','findAll','rows','show','params','intersection','find','catch','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','error','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString'];(function(_0x4d6ba5,_0x28b811){var _0x4ed42a=function(_0x55f219){while(--_0x55f219){_0x4d6ba5['push'](_0x4d6ba5['shift']());}};_0x4ed42a(++_0x28b811);}(_0xe605,0x92));var _0x5e60=function(_0x64894e,_0x37f494){_0x64894e=_0x64894e-0x0;var _0x54ebaf=_0xe605[_0x64894e];return _0x54ebaf;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371df7,_0x178782){_0x178782=_0x178782||0xcc;return function(_0x1f4e14){if(_0x1f4e14){return _0x371df7[_0x5e60('0x19')](_0x178782);}return _0x371df7[_0x5e60('0x1a')](_0x178782)[_0x5e60('0x1b')]();};}function respondWithResult(_0x4fd10e,_0x209adb){_0x209adb=_0x209adb||0xc8;return function(_0x45304f){if(_0x45304f){return _0x4fd10e[_0x5e60('0x1a')](_0x209adb)[_0x5e60('0x1c')](_0x45304f);}};}function respondWithFilteredResult(_0x5b028f,_0x20af5f){return function(_0x529ffe){if(_0x529ffe){var _0x1ffd77=typeof _0x20af5f[_0x5e60('0x1d')]==='undefined'&&typeof _0x20af5f[_0x5e60('0x1e')]===_0x5e60('0x1f');var _0xaa7d05=_0x529ffe[_0x5e60('0x20')];var _0x5c485d=_0x1ffd77?0x0:_0x20af5f[_0x5e60('0x1d')];var _0x22d718=_0x1ffd77?_0x529ffe['count']:_0x20af5f[_0x5e60('0x1d')]+_0x20af5f[_0x5e60('0x1e')];var _0x17c630;if(_0x22d718>=_0xaa7d05){_0x22d718=_0xaa7d05;_0x17c630=0xc8;}else{_0x17c630=0xce;}_0x5b028f[_0x5e60('0x1a')](_0x17c630);return _0x5b028f[_0x5e60('0x21')](_0x5e60('0x22'),_0x5c485d+'-'+_0x22d718+'/'+_0xaa7d05)[_0x5e60('0x1c')](_0x529ffe);}return null;};}function patchUpdates(_0x524c93){return function(_0x3282e4){try{jsonpatch[_0x5e60('0x23')](_0x3282e4,_0x524c93,!![]);}catch(_0x228f13){return BPromise['reject'](_0x228f13);}return _0x3282e4[_0x5e60('0x24')]();};}function saveUpdates(_0x5d77dd,_0x376069){return function(_0x1a44e5){if(_0x1a44e5){return _0x1a44e5[_0x5e60('0x25')](_0x5d77dd)[_0x5e60('0x26')](function(_0x34e98d){return _0x34e98d;});}return null;};}function removeEntity(_0x2a499e,_0x2636f1){return function(_0x5d2c03){if(_0x5d2c03){return _0x5d2c03[_0x5e60('0x27')]()[_0x5e60('0x26')](function(){var _0x19f37b=_0x5d2c03['get']({'plain':!![]});var _0x45cb62=_0x5e60('0x28');return db[_0x5e60('0x29')][_0x5e60('0x27')]({'where':{'type':_0x45cb62,'resourceId':_0x19f37b['id']}})['then'](function(){return _0x5d2c03;});})[_0x5e60('0x26')](function(){_0x2a499e['status'](0xcc)[_0x5e60('0x1b')]();});}};}function handleEntityNotFound(_0x221322,_0x4ba727){return function(_0x46691f){if(!_0x46691f){_0x221322[_0x5e60('0x19')](0x194);}return _0x46691f;};}function handleError(_0x5b1b46,_0x1ee931){_0x1ee931=_0x1ee931||0x1f4;return function(_0xac9c7a){logger['error'](_0xac9c7a['stack']);if(_0xac9c7a['name']){delete _0xac9c7a[_0x5e60('0x2a')];}_0x5b1b46[_0x5e60('0x1a')](_0x1ee931)[_0x5e60('0x2b')](_0xac9c7a);};}exports[_0x5e60('0x2c')]=function(_0x3ccfee,_0x558197){var _0x168ce6={},_0x405461={},_0x4d4b55={'count':0x0,'rows':[]};var _0x11fc87=_['map'](db['JscriptyProject'][_0x5e60('0x2d')],function(_0x3c4340){return{'name':_0x3c4340[_0x5e60('0x2e')],'type':_0x3c4340[_0x5e60('0x2f')][_0x5e60('0x30')]};});_0x405461[_0x5e60('0x31')]=_[_0x5e60('0x32')](_0x11fc87,_0x5e60('0x2a'));_0x405461[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x3ccfee['query']);_0x405461[_0x5e60('0x35')]=_['intersection'](_0x405461['model'],_0x405461[_0x5e60('0x33')]);_0x168ce6[_0x5e60('0x36')]=_['intersection'](_0x405461[_0x5e60('0x31')],qs['fields'](_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x37')]));_0x168ce6[_0x5e60('0x36')]=_0x168ce6[_0x5e60('0x36')][_0x5e60('0x38')]?_0x168ce6[_0x5e60('0x36')]:_0x405461[_0x5e60('0x31')];if(!_0x3ccfee[_0x5e60('0x33')]['hasOwnProperty'](_0x5e60('0x39'))){_0x168ce6[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x1e')]);_0x168ce6[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x3ccfee['query'][_0x5e60('0x1d')]);}_0x168ce6[_0x5e60('0x3a')]=qs['sort'](_0x3ccfee['query'][_0x5e60('0x3b')]);_0x168ce6[_0x5e60('0x3c')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3d')](_0x3ccfee[_0x5e60('0x33')],_0x405461['filters']),_0x11fc87);if(_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x3e')]){_0x168ce6[_0x5e60('0x3c')]=_[_0x5e60('0x3f')](_0x168ce6[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x32')](_0x11fc87,function(_0x2b635a){if(_0x2b635a['type']!==_0x5e60('0x40')){var _0x1f95b2={};_0x1f95b2[_0x2b635a['name']]={'$like':'%'+_0x3ccfee['query']['filter']+'%'};return _0x1f95b2;}})});}_0x168ce6=_[_0x5e60('0x3f')]({},_0x168ce6,_0x3ccfee[_0x5e60('0x41')]);var _0x2c6d5b={'where':_0x168ce6[_0x5e60('0x3c')]};return db['JscriptyProject'][_0x5e60('0x20')](_0x2c6d5b)[_0x5e60('0x26')](function(_0x4b6192){_0x4d4b55['count']=_0x4b6192;if(_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x42')]){_0x168ce6[_0x5e60('0x43')]=[{'all':!![]}];}return db[_0x5e60('0x44')][_0x5e60('0x45')](_0x168ce6);})[_0x5e60('0x26')](function(_0x2522d2){_0x4d4b55[_0x5e60('0x46')]=_0x2522d2;return _0x4d4b55;})[_0x5e60('0x26')](respondWithFilteredResult(_0x558197,_0x168ce6))['catch'](handleError(_0x558197,null));};exports[_0x5e60('0x47')]=function(_0x2bb154,_0x59a2eb){var _0x1b1567={'raw':![],'where':{'id':_0x2bb154[_0x5e60('0x48')]['id']}},_0x4aac07={};_0x4aac07[_0x5e60('0x31')]=_[_0x5e60('0x34')](db['JscriptyProject'][_0x5e60('0x2d')]);_0x4aac07[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x2bb154[_0x5e60('0x33')]);_0x4aac07['filters']=_['intersection'](_0x4aac07['model'],_0x4aac07[_0x5e60('0x33')]);_0x1b1567[_0x5e60('0x36')]=_[_0x5e60('0x49')](_0x4aac07[_0x5e60('0x31')],qs[_0x5e60('0x37')](_0x2bb154[_0x5e60('0x33')]['fields']));_0x1b1567[_0x5e60('0x36')]=_0x1b1567[_0x5e60('0x36')][_0x5e60('0x38')]?_0x1b1567[_0x5e60('0x36')]:_0x4aac07[_0x5e60('0x31')];if(_0x2bb154[_0x5e60('0x33')][_0x5e60('0x42')]){_0x1b1567['include']=[{'all':!![]}];}_0x1b1567=_[_0x5e60('0x3f')]({},_0x1b1567,_0x2bb154[_0x5e60('0x41')]);return db[_0x5e60('0x44')][_0x5e60('0x4a')](_0x1b1567)[_0x5e60('0x26')](handleEntityNotFound(_0x59a2eb,null))[_0x5e60('0x26')](respondWithResult(_0x59a2eb,null))[_0x5e60('0x4b')](handleError(_0x59a2eb,null));};exports[_0x5e60('0x4c')]=function(_0x1518bd,_0x350d6d){return db[_0x5e60('0x44')][_0x5e60('0x4c')](_0x1518bd[_0x5e60('0x4d')],{})[_0x5e60('0x26')](function(_0x1aa381){var _0x176ef3=_0x1518bd[_0x5e60('0x4e')][_0x5e60('0x4f')]({'plain':!![]});if(!_0x176ef3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x176ef3['role']===_0x5e60('0x4e')){var _0x4d3588=_0x1aa381[_0x5e60('0x4f')]({'plain':!![]});var _0x1d247e=_0x5e60('0x28');return db[_0x5e60('0x50')][_0x5e60('0x4a')]({'where':{'name':_0x1d247e,'userProfileId':_0x176ef3[_0x5e60('0x51')]},'raw':!![]})['then'](function(_0x48bea6){if(_0x48bea6&&_0x48bea6[_0x5e60('0x52')]===0x0){return db[_0x5e60('0x29')][_0x5e60('0x4c')]({'name':_0x4d3588['name'],'resourceId':_0x4d3588['id'],'type':_0x48bea6['name'],'sectionId':_0x48bea6['id']},{})[_0x5e60('0x26')](function(){return _0x1aa381;});}else{return _0x1aa381;}})[_0x5e60('0x4b')](function(_0x179cc6){logger['error'](_0x5e60('0x53'),_0x179cc6);throw _0x179cc6;});}return _0x1aa381;})[_0x5e60('0x26')](respondWithResult(_0x350d6d,0xc9))[_0x5e60('0x4b')](handleError(_0x350d6d,null));};exports[_0x5e60('0x54')]=function(_0x17d002,_0x148204){var _0x4ae313={'where':{'id':_0x17d002[_0x5e60('0x48')]['id']}},_0x412be1={};_0x412be1['model']=_[_0x5e60('0x34')](db[_0x5e60('0x44')][_0x5e60('0x2d')]);_0x4ae313['attributes']=_[_0x5e60('0x49')](_0x412be1[_0x5e60('0x31')],qs['fields'](_0x17d002[_0x5e60('0x33')][_0x5e60('0x37')]));_0x4ae313[_0x5e60('0x36')]=_0x4ae313[_0x5e60('0x36')]['length']?_0x4ae313[_0x5e60('0x36')]:_0x412be1[_0x5e60('0x31')];if(_0x17d002['query'][_0x5e60('0x42')]){_0x4ae313['include']=[{'all':!![]}];}_0x4ae313=_[_0x5e60('0x3f')]({},_0x4ae313,_0x17d002['options']);return db[_0x5e60('0x44')][_0x5e60('0x4a')](_0x4ae313)['then'](handleEntityNotFound(_0x148204,null))[_0x5e60('0x26')](function(_0x4b52d1){if(_0x4b52d1){var _0x1a2094=_0x4b52d1['get']({'plain':!![]});_0x1a2094=qs[_0x5e60('0x55')](_0x1a2094,['id','createdAt',_0x5e60('0x56')]);_0x17d002[_0x5e60('0x4d')]=_[_0x5e60('0x55')](_0x17d002[_0x5e60('0x4d')],['id',_0x5e60('0x57'),_0x5e60('0x56')]);return db[_0x5e60('0x44')]['create'](_[_0x5e60('0x3f')](_0x1a2094,_0x17d002[_0x5e60('0x4d')]),{'include':_0x17d002[_0x5e60('0x33')][_0x5e60('0x42')]?[{'all':!![]}]:undefined})[_0x5e60('0x26')](function(_0x35aad7){var _0x4a59bd=_0x17d002['user']['get']({'plain':!![]});if(!_0x4a59bd)throw new Error(_0x5e60('0x58'));if(_0x4a59bd[_0x5e60('0x59')]==='user'){var _0x15bb11=_0x35aad7[_0x5e60('0x4f')]({'plain':!![]});var _0x557f74=_0x5e60('0x28');return db[_0x5e60('0x50')][_0x5e60('0x4a')]({'where':{'name':_0x557f74,'userProfileId':_0x4a59bd[_0x5e60('0x51')]},'raw':!![]})[_0x5e60('0x26')](function(_0xcd2232){if(_0xcd2232&&_0xcd2232[_0x5e60('0x52')]===0x0){return db[_0x5e60('0x29')][_0x5e60('0x4c')]({'name':_0x15bb11[_0x5e60('0x2a')],'resourceId':_0x15bb11['id'],'type':_0xcd2232[_0x5e60('0x2a')],'sectionId':_0xcd2232['id']},{})[_0x5e60('0x26')](function(){return _0x35aad7;});}else{return _0x35aad7;}})[_0x5e60('0x4b')](function(_0x2826f7){logger[_0x5e60('0x5a')](_0x5e60('0x53'),_0x2826f7);throw _0x2826f7;});}return _0x35aad7;});}})[_0x5e60('0x26')](respondWithResult(_0x148204,0xc9))['catch'](handleError(_0x148204,null));};exports[_0x5e60('0x25')]=function(_0x1706d6,_0x16e7e9){if(_0x1706d6['body']['id']){delete _0x1706d6[_0x5e60('0x4d')]['id'];}return db[_0x5e60('0x44')]['find']({'where':{'id':_0x1706d6[_0x5e60('0x48')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x16e7e9,null))['then'](saveUpdates(_0x1706d6[_0x5e60('0x4d')],null))[_0x5e60('0x26')](respondWithResult(_0x16e7e9,null))[_0x5e60('0x4b')](handleError(_0x16e7e9,null));};exports[_0x5e60('0x27')]=function(_0x1db659,_0x711888){return db[_0x5e60('0x44')][_0x5e60('0x4a')]({'where':{'id':_0x1db659[_0x5e60('0x48')]['id']}})['then'](handleEntityNotFound(_0x711888,null))[_0x5e60('0x26')](removeEntity(_0x711888,null))[_0x5e60('0x4b')](handleError(_0x711888,null));};exports[_0x5e60('0x5b')]=function(_0x4d79e2,_0x27065d,_0x39fa74){var _0x155db0={'raw':!![],'where':{}};var _0x15d975={};var _0x3e85fe={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x5e60('0x5c')]({'where':{'id':_0x4d79e2[_0x5e60('0x48')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x27065d,null))['then'](function(_0x565d53){if(_0x565d53){_0x15d975[_0x5e60('0x31')]=_[_0x5e60('0x34')](db[_0x5e60('0x5d')][_0x5e60('0x2d')]);_0x15d975[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x4d79e2[_0x5e60('0x33')]);_0x15d975['filters']=_[_0x5e60('0x49')](_0x15d975[_0x5e60('0x31')],_0x15d975[_0x5e60('0x33')]);_0x155db0['attributes']=_['intersection'](_0x15d975[_0x5e60('0x31')],qs[_0x5e60('0x37')](_0x4d79e2[_0x5e60('0x33')]['fields']));_0x155db0['attributes']=_0x155db0[_0x5e60('0x36')][_0x5e60('0x38')]?_0x155db0[_0x5e60('0x36')]:_0x15d975[_0x5e60('0x31')];if(!_0x4d79e2[_0x5e60('0x33')][_0x5e60('0x5e')]('nolimit')){_0x155db0[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0x4d79e2[_0x5e60('0x33')][_0x5e60('0x1e')]);_0x155db0[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x4d79e2[_0x5e60('0x33')][_0x5e60('0x1d')]);}_0x155db0[_0x5e60('0x3a')]=qs['sort'](_0x4d79e2[_0x5e60('0x33')][_0x5e60('0x3b')]);_0x155db0['where']=qs[_0x5e60('0x35')](_[_0x5e60('0x3d')](_0x4d79e2['query'],_0x15d975[_0x5e60('0x35')]));_0x155db0[_0x5e60('0x3c')][_0x5e60('0x5f')]=_0x565d53['id'];if(_0x4d79e2[_0x5e60('0x33')][_0x5e60('0x3e')]){_0x155db0[_0x5e60('0x3c')]=_['merge'](_0x155db0[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x32')](_0x155db0[_0x5e60('0x36')],function(_0x222d94){var _0x95d1c5={};_0x95d1c5[_0x222d94]={'$like':'%'+_0x4d79e2[_0x5e60('0x33')][_0x5e60('0x3e')]+'%'};return _0x95d1c5;})});}_0x155db0=_[_0x5e60('0x3f')]({},_0x155db0,_0x4d79e2[_0x5e60('0x41')]);return db['JscriptySessionReport'][_0x5e60('0x20')]({'where':_0x155db0[_0x5e60('0x3c')]})[_0x5e60('0x26')](function(_0x3fae7f){_0x3e85fe[_0x5e60('0x20')]=_0x3fae7f;if(_0x4d79e2[_0x5e60('0x33')][_0x5e60('0x42')]){_0x155db0[_0x5e60('0x43')]=[{'all':!![]}];}return db[_0x5e60('0x5d')][_0x5e60('0x45')](_0x155db0);})['then'](function(_0x5ab78f){_0x3e85fe['rows']=_0x5ab78f;return _0x3e85fe;});}})[_0x5e60('0x26')](respondWithFilteredResult(_0x27065d,_0x155db0))[_0x5e60('0x4b')](handleError(_0x27065d,null));};exports[_0x5e60('0x60')]=function(_0x1a911a,_0x4744b7,_0x462875){var _0x3ea45e={'raw':!![],'where':{}};var _0x58640c={};var _0x120fab={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x5e60('0x5c')]({'where':{'id':_0x1a911a[_0x5e60('0x48')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x4744b7,null))['then'](function(_0x1976f2){if(_0x1976f2){_0x58640c['model']=_['keys'](db['JscriptyAnswerReport'][_0x5e60('0x2d')]);_0x58640c[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x1a911a[_0x5e60('0x33')]);_0x58640c[_0x5e60('0x35')]=_[_0x5e60('0x49')](_0x58640c[_0x5e60('0x31')],_0x58640c[_0x5e60('0x33')]);_0x3ea45e[_0x5e60('0x36')]=_['intersection'](_0x58640c[_0x5e60('0x31')],qs[_0x5e60('0x37')](_0x1a911a[_0x5e60('0x33')][_0x5e60('0x37')]));_0x3ea45e[_0x5e60('0x36')]=_0x3ea45e[_0x5e60('0x36')][_0x5e60('0x38')]?_0x3ea45e[_0x5e60('0x36')]:_0x58640c[_0x5e60('0x31')];if(!_0x1a911a[_0x5e60('0x33')][_0x5e60('0x5e')](_0x5e60('0x39'))){_0x3ea45e['limit']=qs[_0x5e60('0x1e')](_0x1a911a[_0x5e60('0x33')][_0x5e60('0x1e')]);_0x3ea45e[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x1a911a[_0x5e60('0x33')][_0x5e60('0x1d')]);}_0x3ea45e[_0x5e60('0x3a')]=qs[_0x5e60('0x3b')](_0x1a911a[_0x5e60('0x33')][_0x5e60('0x3b')]);_0x3ea45e[_0x5e60('0x3c')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3d')](_0x1a911a[_0x5e60('0x33')],_0x58640c[_0x5e60('0x35')]));_0x3ea45e[_0x5e60('0x3c')][_0x5e60('0x5f')]=_0x1976f2['id'];if(_0x1a911a[_0x5e60('0x33')][_0x5e60('0x3e')]){_0x3ea45e['where']=_[_0x5e60('0x3f')](_0x3ea45e[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x32')](_0x3ea45e['attributes'],function(_0x4a4417){var _0x1b5e2c={};_0x1b5e2c[_0x4a4417]={'$like':'%'+_0x1a911a[_0x5e60('0x33')][_0x5e60('0x3e')]+'%'};return _0x1b5e2c;})});}_0x3ea45e=_[_0x5e60('0x3f')]({},_0x3ea45e,_0x1a911a[_0x5e60('0x41')]);return db[_0x5e60('0x61')][_0x5e60('0x20')]({'where':_0x3ea45e[_0x5e60('0x3c')]})[_0x5e60('0x26')](function(_0x668dbd){_0x120fab[_0x5e60('0x20')]=_0x668dbd;if(_0x1a911a[_0x5e60('0x33')][_0x5e60('0x42')]){_0x3ea45e[_0x5e60('0x43')]=[{'all':!![]}];}return db[_0x5e60('0x61')][_0x5e60('0x45')](_0x3ea45e);})[_0x5e60('0x26')](function(_0x4cbbe4){_0x120fab[_0x5e60('0x46')]=_0x4cbbe4;return _0x120fab;});}})[_0x5e60('0x26')](respondWithFilteredResult(_0x4744b7,_0x3ea45e))[_0x5e60('0x4b')](handleError(_0x4744b7,null));};function char(_0x2ba733){return'number'===typeof _0x2ba733?String[_0x5e60('0x62')][_0x5e60('0x23')](null,arguments):_0x2ba733;}function needsEncapsulation(_0x3799de){return!!_0x3799de&&(_0x3799de['toString']()['indexOf'](char(0xd))>=0x0||_0x3799de[_0x5e60('0x63')]()[_0x5e60('0x64')](char(0xa))>=0x0||_0x3799de[_0x5e60('0x63')]()[_0x5e60('0x64')](char(0x2c))>=0x0||_0x3799de['toString']()[_0x5e60('0x64')](char(0x22))>=0x0);}function encapsulate(_0xe367b1){var _0x4f5f9c=char(0x22),_0x47d623='\x5c'+char(0x22),_0x69e5b5=_0xe367b1[_0x5e60('0x63')]()[_0x5e60('0x65')](new RegExp(_0x4f5f9c,'g'),_0x47d623);return _0x4f5f9c+_0x69e5b5+_0x4f5f9c;}exports['getSummary']=function(_0x5cf999,_0x551802,_0x34d0bf){var _0x45d19d,_0x2a0841;var _0x9f7ad8={'where':{'ProjectId':_0x5cf999['params']['id']}};if(_0x5cf999[_0x5e60('0x33')][_0x5e60('0x66')]){_0x9f7ad8[_0x5e60('0x3c')][_0x5e60('0x67')]=JSON[_0x5e60('0x68')](_0x5cf999[_0x5e60('0x33')]['startTime']);}return db[_0x5e60('0x5d')]['findAll'](_0x9f7ad8)[_0x5e60('0x26')](handleEntityNotFound(_0x551802,null))['then'](function(_0x33af24){if(_0x33af24){_0x45d19d=_0x33af24;return db['JscriptyQuestionReport'][_0x5e60('0x45')]({'where':{'SessionId':{'$in':_[_0x5e60('0x32')](_0x45d19d,'id')},'ProjectId':_0x5cf999[_0x5e60('0x48')]['id']},'order':_0x5e60('0x69')});}})[_0x5e60('0x26')](handleEntityNotFound(_0x551802,null))[_0x5e60('0x26')](function(_0x2a0571){if(_0x2a0571){_0x2a0841=_0x2a0571;var _0x297981={};for(var _0x3cb824=0x0,_0x59cdb7=_0x2a0841['length'];_0x3cb824<_0x59cdb7;_0x3cb824++){if(!_0x297981[_0x5e60('0x5e')](_0x2a0841[_0x3cb824]['questionId'])){_0x297981[_0x2a0841[_0x3cb824][_0x5e60('0x6a')]]=needsEncapsulation(_0x2a0841[_0x3cb824][_0x5e60('0x6b')])?encapsulate(_0x2a0841[_0x3cb824]['question']):_0x2a0841[_0x3cb824]['question'];}}var _0x34bf41=[],_0x29ab78={};for(var _0x37c9c3=0x0,_0x5428c4=_0x45d19d[_0x5e60('0x38')];_0x37c9c3<_0x5428c4;_0x37c9c3++){_0x29ab78={'ProjectId':_0x5cf999[_0x5e60('0x48')]['id'],'SessionId':_0x45d19d[_0x37c9c3]['id'],'StartTime':moment(_0x45d19d[_0x37c9c3][_0x5e60('0x67')])[_0x5e60('0x6c')](_0x5e60('0x6d'))};for(var _0x220a31=0x0,_0x110527=_0x2a0841[_0x5e60('0x38')];_0x220a31<_0x110527;_0x220a31++){if(_0x2a0841[_0x220a31][_0x5e60('0x6e')]==_0x45d19d[_0x37c9c3]['id']&&_0x297981[_0x5e60('0x5e')](_0x2a0841[_0x220a31]['questionId'])){_0x29ab78[_0x297981[_0x2a0841[_0x220a31][_0x5e60('0x6a')]]]=_0x2a0841[_0x220a31][_0x5e60('0x6f')];}}for(var _0x320035 in _0x297981){if(!_0x29ab78[_0x5e60('0x5e')](_0x297981[_0x320035])){_0x29ab78[_0x297981[_0x320035]]=null;}}_0x34bf41[_0x5e60('0x70')](_0x29ab78);}return _0x34bf41;}})[_0x5e60('0x26')](function(_0x27a4f5){if(!_[_0x5e60('0x71')](_0x27a4f5)){var _0x15b6c5=toCsv(_0x27a4f5);var _0x2f84f3=Date['now']();fs[_0x5e60('0x72')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5cf999[_0x5e60('0x48')]['id'],_0x2f84f3),_0x15b6c5);_0x551802['setHeader'](_0x5e60('0x73'),_0x5e60('0x74')+util[_0x5e60('0x6c')](_0x5e60('0x75'),_0x5cf999[_0x5e60('0x48')]['id'],_0x2f84f3));_0x551802[_0x5e60('0x76')](_0x5e60('0x77'),_0x5e60('0x78'));return _0x551802[_0x5e60('0x79')](util['format'](_0x5e60('0x7a'),_0x5cf999[_0x5e60('0x48')]['id'],_0x2f84f3));}else{return _0x551802[_0x5e60('0x19')](0xcc);}})['catch'](handleError(_0x551802,null));};
\ No newline at end of file
index 856158b..8dd3ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b6d=['request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird'];(function(_0x23309c,_0x56b191){var _0x1f220a=function(_0x267d74){while(--_0x267d74){_0x23309c['push'](_0x23309c['shift']());}};_0x1f220a(++_0x56b191);}(_0x9b6d,0x105));var _0xd9b6=function(_0x5e23fc,_0x319e53){_0x5e23fc=_0x5e23fc-0x0;var _0x571fa7=_0x9b6d[_0x5e23fc];return _0x571fa7;};'use strict';var _=require('lodash');var util=require(_0xd9b6('0x0'));var logger=require(_0xd9b6('0x1'))(_0xd9b6('0x2'));var moment=require(_0xd9b6('0x3'));var BPromise=require(_0xd9b6('0x4'));var rp=require(_0xd9b6('0x5'));var fs=require('fs');var path=require(_0xd9b6('0x6'));var rimraf=require(_0xd9b6('0x7'));var config=require(_0xd9b6('0x8'));var attributes=require(_0xd9b6('0x9'));module[_0xd9b6('0xa')]=function(_0x5724e3,_0x2d38ce){return _0x5724e3[_0xd9b6('0xb')](_0xd9b6('0xc'),attributes,{'tableName':_0xd9b6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c5a=['define','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x5ca49a,_0x1cd1f6){var _0xc08b66=function(_0x41d215){while(--_0x41d215){_0x5ca49a['push'](_0x5ca49a['shift']());}};_0xc08b66(++_0x1cd1f6);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3a182c,_0x295c76){_0x3a182c=_0x3a182c-0x0;var _0x4cc967=_0x9c5a[_0x3a182c];return _0x4cc967;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./jscriptyProject.attributes');module[_0xa9c5('0x8')]=function(_0x4d9c7a,_0x394d84){return _0x4d9c7a[_0xa9c5('0x9')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 31b4a0a..44f5b1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0xbf5e16,_0x146ce3){var _0x5975a5=function(_0x2387a7){while(--_0x2387a7){_0xbf5e16['push'](_0xbf5e16['shift']());}};_0x5975a5(++_0x146ce3);}(_0xda3f,0xec));var _0xfda3=function(_0x3a7156,_0x2a21b0){_0x3a7156=_0x3a7156-0x0;var _0x287411=_0xda3f[_0x3a7156];return _0x287411;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
+var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5e5bf2,_0x540d21){var _0x4fc118=function(_0x2565fa){while(--_0x2565fa){_0x5e5bf2['push'](_0x5e5bf2['shift']());}};_0x4fc118(++_0x540d21);}(_0xb43b,0x1b2));var _0xbb43=function(_0xc1d0c1,_0x412e54){_0xc1d0c1=_0xc1d0c1-0x0;var _0x1a6c17=_0xb43b[_0xc1d0c1];return _0x1a6c17;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
index 4daaf21..faa4000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33a9=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2e41ea,_0x1dfcd1){var _0x3410a9=function(_0xd9bc03){while(--_0xd9bc03){_0x2e41ea['push'](_0x2e41ea['shift']());}};_0x3410a9(++_0x1dfcd1);}(_0x33a9,0xe2));var _0x933a=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x33a9[_0x15b399];return _0x199f2d;};'use strict';var multer=require(_0x933a('0x0'));var util=require(_0x933a('0x1'));var path=require('path');var timeout=require(_0x933a('0x2'));var express=require(_0x933a('0x3'));var router=express[_0x933a('0x4')]();var fs_extra=require(_0x933a('0x5'));var auth=require(_0x933a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x933a('0x7'));router[_0x933a('0x8')]('/',auth[_0x933a('0x9')](),controller[_0x933a('0xa')]);router[_0x933a('0x8')](_0x933a('0xb'),auth[_0x933a('0x9')](),controller[_0x933a('0xc')]);router[_0x933a('0x8')](_0x933a('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x933a('0x9')](),controller[_0x933a('0xe')]);router[_0x933a('0xf')]('/:id',auth[_0x933a('0x9')](),controller[_0x933a('0x10')]);router[_0x933a('0x11')](_0x933a('0xd'),auth['isAuthenticated'](),controller[_0x933a('0x12')]);module[_0x933a('0x13')]=router;
\ No newline at end of file
+var _0x08fb=['multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','post','put','/:id','delete','destroy','exports'];(function(_0x319268,_0x19626a){var _0x413da1=function(_0xb9aa37){while(--_0xb9aa37){_0x319268['push'](_0x319268['shift']());}};_0x413da1(++_0x19626a);}(_0x08fb,0x176));var _0xb08f=function(_0x3d4c28,_0x46e815){_0x3d4c28=_0x3d4c28-0x0;var _0x76b68d=_0x08fb[_0x3d4c28];return _0x76b68d;};'use strict';var multer=require(_0xb08f('0x0'));var util=require(_0xb08f('0x1'));var path=require(_0xb08f('0x2'));var timeout=require('connect-timeout');var express=require(_0xb08f('0x3'));var router=express['Router']();var fs_extra=require(_0xb08f('0x4'));var auth=require(_0xb08f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb08f('0x6'));var controller=require(_0xb08f('0x7'));router[_0xb08f('0x8')]('/',auth[_0xb08f('0x9')](),controller['index']);router[_0xb08f('0x8')](_0xb08f('0xa'),auth[_0xb08f('0x9')](),controller['describe']);router[_0xb08f('0x8')]('/:id',auth[_0xb08f('0x9')](),controller['show']);router[_0xb08f('0xb')]('/',auth[_0xb08f('0x9')](),controller['create']);router[_0xb08f('0xc')](_0xb08f('0xd'),auth[_0xb08f('0x9')](),controller['update']);router[_0xb08f('0xe')](_0xb08f('0xd'),auth[_0xb08f('0x9')](),controller[_0xb08f('0xf')]);module[_0xb08f('0x10')]=router;
\ No newline at end of file
index 9e34eb4..d7443bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x45af15,_0x2047af){_0x45af15=_0x45af15-0x0;var _0x1af588=_0x7a54[_0x45af15];return _0x1af588;};'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(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x49e58f,_0x5d5ffa){_0x49e58f=_0x49e58f-0x0;var _0x316106=_0x7a54[_0x49e58f];return _0x316106;};'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 8385635..c388ed3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc46b=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','merge','find','create','body','params','eml-format','rimraf','zip-dir'];(function(_0x126e72,_0x317b55){var _0x5518cb=function(_0x13a3e8){while(--_0x13a3e8){_0x126e72['push'](_0x126e72['shift']());}};_0x5518cb(++_0x317b55);}(_0xc46b,0x97));var _0xbc46=function(_0x33c5f3,_0x3a21c6){_0x33c5f3=_0x33c5f3-0x0;var _0x34741e=_0xc46b[_0x33c5f3];return _0x34741e;};'use strict';var emlformat=require(_0xbc46('0x0'));var rimraf=require(_0xbc46('0x1'));var zipdir=require(_0xbc46('0x2'));var jsonpatch=require(_0xbc46('0x3'));var rp=require('request-promise');var moment=require(_0xbc46('0x4'));var BPromise=require(_0xbc46('0x5'));var Mustache=require(_0xbc46('0x6'));var util=require(_0xbc46('0x7'));var path=require(_0xbc46('0x8'));var sox=require(_0xbc46('0x9'));var csv=require(_0xbc46('0xa'));var ejs=require(_0xbc46('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc46('0xc'));var squel=require(_0xbc46('0xd'));var crypto=require(_0xbc46('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbc46('0xa'));var querystring=require(_0xbc46('0xf'));var Papa=require(_0xbc46('0x10'));var Redis=require(_0xbc46('0x11'));var authService=require(_0xbc46('0x12'));var qs=require(_0xbc46('0x13'));var as=require(_0xbc46('0x14'));var hardwareService=require(_0xbc46('0x15'));var logger=require(_0xbc46('0x16'))(_0xbc46('0x17'));var utils=require(_0xbc46('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbc46('0x19'))['db'];function respondWithStatusCode(_0x26713a,_0x601c4e){_0x601c4e=_0x601c4e||0xcc;return function(_0x25c9ec){if(_0x25c9ec){return _0x26713a[_0xbc46('0x1a')](_0x601c4e);}return _0x26713a['status'](_0x601c4e)[_0xbc46('0x1b')]();};}function respondWithResult(_0x54954d,_0xf5cf92){_0xf5cf92=_0xf5cf92||0xc8;return function(_0x172009){if(_0x172009){return _0x54954d[_0xbc46('0x1c')](_0xf5cf92)[_0xbc46('0x1d')](_0x172009);}};}function respondWithFilteredResult(_0x37e185,_0x5a81db){return function(_0x18f95f){if(_0x18f95f){var _0x8f4079=typeof _0x5a81db['offset']===_0xbc46('0x1e')&&typeof _0x5a81db['limit']===_0xbc46('0x1e');var _0x59cbff=_0x18f95f[_0xbc46('0x1f')];var _0x287985=_0x8f4079?0x0:_0x5a81db['offset'];var _0x1eecd0=_0x8f4079?_0x18f95f[_0xbc46('0x1f')]:_0x5a81db['offset']+_0x5a81db[_0xbc46('0x20')];var _0x2e3e12;if(_0x1eecd0>=_0x59cbff){_0x1eecd0=_0x59cbff;_0x2e3e12=0xc8;}else{_0x2e3e12=0xce;}_0x37e185[_0xbc46('0x1c')](_0x2e3e12);return _0x37e185[_0xbc46('0x21')](_0xbc46('0x22'),_0x287985+'-'+_0x1eecd0+'/'+_0x59cbff)[_0xbc46('0x1d')](_0x18f95f);}return null;};}function patchUpdates(_0x14cac0){return function(_0x5a9138){try{jsonpatch[_0xbc46('0x23')](_0x5a9138,_0x14cac0,!![]);}catch(_0x238ee7){return BPromise[_0xbc46('0x24')](_0x238ee7);}return _0x5a9138[_0xbc46('0x25')]();};}function saveUpdates(_0x4ec4d0,_0x556798){return function(_0x156a5f){if(_0x156a5f){return _0x156a5f['update'](_0x4ec4d0)[_0xbc46('0x26')](function(_0x507743){return _0x507743;});}return null;};}function removeEntity(_0xcb56ea,_0x1e9bbe){return function(_0x2bac2e){if(_0x2bac2e){return _0x2bac2e[_0xbc46('0x27')]()[_0xbc46('0x26')](function(){_0xcb56ea[_0xbc46('0x1c')](0xcc)[_0xbc46('0x1b')]();});}};}function handleEntityNotFound(_0x31c023,_0x33632e){return function(_0x41fb38){if(!_0x41fb38){_0x31c023[_0xbc46('0x1a')](0x194);}return _0x41fb38;};}function handleError(_0x10939b,_0x5a4a80){_0x5a4a80=_0x5a4a80||0x1f4;return function(_0x215719){logger[_0xbc46('0x28')](_0x215719[_0xbc46('0x29')]);if(_0x215719[_0xbc46('0x2a')]){delete _0x215719['name'];}_0x10939b[_0xbc46('0x1c')](_0x5a4a80)[_0xbc46('0x2b')](_0x215719);};}exports[_0xbc46('0x2c')]=function(_0x273b54,_0x587b8e){var _0x62f714={},_0xb7c6a1={},_0xba433b={'count':0x0,'rows':[]};var _0x58c7b9=_[_0xbc46('0x2d')](db[_0xbc46('0x2e')]['rawAttributes'],function(_0x1ed112){return{'name':_0x1ed112[_0xbc46('0x2f')],'type':_0x1ed112[_0xbc46('0x30')][_0xbc46('0x31')]};});_0xb7c6a1[_0xbc46('0x32')]=_[_0xbc46('0x2d')](_0x58c7b9,_0xbc46('0x2a'));_0xb7c6a1['query']=_[_0xbc46('0x33')](_0x273b54[_0xbc46('0x34')]);_0xb7c6a1[_0xbc46('0x35')]=_[_0xbc46('0x36')](_0xb7c6a1[_0xbc46('0x32')],_0xb7c6a1[_0xbc46('0x34')]);_0x62f714[_0xbc46('0x37')]=_['intersection'](_0xb7c6a1['model'],qs[_0xbc46('0x38')](_0x273b54[_0xbc46('0x34')]['fields']));_0x62f714[_0xbc46('0x37')]=_0x62f714[_0xbc46('0x37')][_0xbc46('0x39')]?_0x62f714['attributes']:_0xb7c6a1[_0xbc46('0x32')];if(!_0x273b54[_0xbc46('0x34')][_0xbc46('0x3a')](_0xbc46('0x3b'))){_0x62f714[_0xbc46('0x20')]=qs['limit'](_0x273b54['query'][_0xbc46('0x20')]);_0x62f714[_0xbc46('0x3c')]=qs[_0xbc46('0x3c')](_0x273b54['query']['offset']);}_0x62f714['order']=qs[_0xbc46('0x3d')](_0x273b54['query'][_0xbc46('0x3d')]);_0x62f714[_0xbc46('0x3e')]=qs['filters'](_['pick'](_0x273b54[_0xbc46('0x34')],_0xb7c6a1[_0xbc46('0x35')]),_0x58c7b9);if(_0x273b54[_0xbc46('0x34')][_0xbc46('0x3f')]){_0x62f714['where']=_['merge'](_0x62f714[_0xbc46('0x3e')],{'$or':_['map'](_0x58c7b9,function(_0x2970fe){if(_0x2970fe[_0xbc46('0x30')]!==_0xbc46('0x40')){var _0x214175={};_0x214175[_0x2970fe['name']]={'$like':'%'+_0x273b54[_0xbc46('0x34')][_0xbc46('0x3f')]+'%'};return _0x214175;}})});}_0x62f714=_['merge']({},_0x62f714,_0x273b54[_0xbc46('0x41')]);var _0x3b355b={'where':_0x62f714[_0xbc46('0x3e')]};return db[_0xbc46('0x2e')][_0xbc46('0x1f')](_0x3b355b)['then'](function(_0x5dfe2b){_0xba433b[_0xbc46('0x1f')]=_0x5dfe2b;if(_0x273b54[_0xbc46('0x34')]['includeAll']){_0x62f714[_0xbc46('0x42')]=[{'all':!![]}];}return db[_0xbc46('0x2e')][_0xbc46('0x43')](_0x62f714);})[_0xbc46('0x26')](function(_0x2c2276){_0xba433b[_0xbc46('0x44')]=_0x2c2276;return _0xba433b;})['then'](respondWithFilteredResult(_0x587b8e,_0x62f714))[_0xbc46('0x45')](handleError(_0x587b8e,null));};exports[_0xbc46('0x46')]=function(_0x3c8736,_0x137d5d){var _0x2e8bf3={'raw':!![],'where':{'id':_0x3c8736['params']['id']}},_0x4e5a05={};_0x4e5a05['model']=_[_0xbc46('0x33')](db[_0xbc46('0x2e')]['rawAttributes']);_0x4e5a05['query']=_[_0xbc46('0x33')](_0x3c8736['query']);_0x4e5a05[_0xbc46('0x35')]=_[_0xbc46('0x36')](_0x4e5a05[_0xbc46('0x32')],_0x4e5a05[_0xbc46('0x34')]);_0x2e8bf3[_0xbc46('0x37')]=_[_0xbc46('0x36')](_0x4e5a05['model'],qs[_0xbc46('0x38')](_0x3c8736[_0xbc46('0x34')][_0xbc46('0x38')]));_0x2e8bf3[_0xbc46('0x37')]=_0x2e8bf3[_0xbc46('0x37')]['length']?_0x2e8bf3['attributes']:_0x4e5a05[_0xbc46('0x32')];if(_0x3c8736[_0xbc46('0x34')][_0xbc46('0x47')]){_0x2e8bf3['include']=[{'all':!![]}];}_0x2e8bf3=_[_0xbc46('0x48')]({},_0x2e8bf3,_0x3c8736[_0xbc46('0x41')]);return db[_0xbc46('0x2e')][_0xbc46('0x49')](_0x2e8bf3)[_0xbc46('0x26')](handleEntityNotFound(_0x137d5d,null))[_0xbc46('0x26')](respondWithResult(_0x137d5d,null))['catch'](handleError(_0x137d5d,null));};exports[_0xbc46('0x4a')]=function(_0x6e21fd,_0x148c54){return db[_0xbc46('0x2e')][_0xbc46('0x4a')](_0x6e21fd[_0xbc46('0x4b')],{})[_0xbc46('0x26')](respondWithResult(_0x148c54,0xc9))[_0xbc46('0x45')](handleError(_0x148c54,null));};exports['update']=function(_0x29b52e,_0x5c77d6){if(_0x29b52e[_0xbc46('0x4b')]['id']){delete _0x29b52e[_0xbc46('0x4b')]['id'];}return db[_0xbc46('0x2e')][_0xbc46('0x49')]({'where':{'id':_0x29b52e[_0xbc46('0x4c')]['id']}})[_0xbc46('0x26')](handleEntityNotFound(_0x5c77d6,null))['then'](saveUpdates(_0x29b52e[_0xbc46('0x4b')],null))[_0xbc46('0x26')](respondWithResult(_0x5c77d6,null))['catch'](handleError(_0x5c77d6,null));};exports[_0xbc46('0x27')]=function(_0xd1acb8,_0x41706a){return db['JscriptyQuestionReport'][_0xbc46('0x49')]({'where':{'id':_0xd1acb8[_0xbc46('0x4c')]['id']}})[_0xbc46('0x26')](handleEntityNotFound(_0x41706a,null))['then'](removeEntity(_0x41706a,null))[_0xbc46('0x45')](handleError(_0x41706a,null));};exports['describe']=function(_0x21e2a0,_0x2d92a6){return db[_0xbc46('0x2e')]['describe']()['then'](respondWithResult(_0x2d92a6,null))[_0xbc46('0x45')](handleError(_0x2d92a6,null));};
\ No newline at end of file
+var _0x3ed8=['findAll','catch','show','params','intersection','options','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','includeAll','include'];(function(_0x530e30,_0x3a6fd8){var _0x3fbcd9=function(_0x3e7b8a){while(--_0x3e7b8a){_0x530e30['push'](_0x530e30['shift']());}};_0x3fbcd9(++_0x3a6fd8);}(_0x3ed8,0x191));var _0x83ed=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x3ed8[_0x307d86];return _0x361745;};'use strict';var emlformat=require(_0x83ed('0x0'));var rimraf=require(_0x83ed('0x1'));var zipdir=require(_0x83ed('0x2'));var jsonpatch=require(_0x83ed('0x3'));var rp=require(_0x83ed('0x4'));var moment=require(_0x83ed('0x5'));var BPromise=require(_0x83ed('0x6'));var Mustache=require(_0x83ed('0x7'));var util=require(_0x83ed('0x8'));var path=require('path');var sox=require(_0x83ed('0x9'));var csv=require('to-csv');var ejs=require(_0x83ed('0xa'));var fs=require('fs');var fs_extra=require(_0x83ed('0xb'));var _=require(_0x83ed('0xc'));var squel=require(_0x83ed('0xd'));var crypto=require(_0x83ed('0xe'));var jsforce=require(_0x83ed('0xf'));var deskjs=require(_0x83ed('0x10'));var toCsv=require(_0x83ed('0x11'));var querystring=require('querystring');var Papa=require(_0x83ed('0x12'));var Redis=require(_0x83ed('0x13'));var authService=require(_0x83ed('0x14'));var qs=require(_0x83ed('0x15'));var as=require(_0x83ed('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x83ed('0x17'))(_0x83ed('0x18'));var utils=require(_0x83ed('0x19'));var config=require(_0x83ed('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e104a,_0x342e27){_0x342e27=_0x342e27||0xcc;return function(_0x1b12d9){if(_0x1b12d9){return _0x2e104a['sendStatus'](_0x342e27);}return _0x2e104a[_0x83ed('0x1b')](_0x342e27)[_0x83ed('0x1c')]();};}function respondWithResult(_0x281ca6,_0x2b29bd){_0x2b29bd=_0x2b29bd||0xc8;return function(_0x346c28){if(_0x346c28){return _0x281ca6[_0x83ed('0x1b')](_0x2b29bd)[_0x83ed('0x1d')](_0x346c28);}};}function respondWithFilteredResult(_0x345471,_0x512e0c){return function(_0x53f6bd){if(_0x53f6bd){var _0x5bfc0b=typeof _0x512e0c[_0x83ed('0x1e')]===_0x83ed('0x1f')&&typeof _0x512e0c[_0x83ed('0x20')]===_0x83ed('0x1f');var _0x574049=_0x53f6bd[_0x83ed('0x21')];var _0x1cb073=_0x5bfc0b?0x0:_0x512e0c[_0x83ed('0x1e')];var _0x5441af=_0x5bfc0b?_0x53f6bd[_0x83ed('0x21')]:_0x512e0c[_0x83ed('0x1e')]+_0x512e0c[_0x83ed('0x20')];var _0x11308b;if(_0x5441af>=_0x574049){_0x5441af=_0x574049;_0x11308b=0xc8;}else{_0x11308b=0xce;}_0x345471['status'](_0x11308b);return _0x345471[_0x83ed('0x22')](_0x83ed('0x23'),_0x1cb073+'-'+_0x5441af+'/'+_0x574049)[_0x83ed('0x1d')](_0x53f6bd);}return null;};}function patchUpdates(_0x23487d){return function(_0x1308de){try{jsonpatch[_0x83ed('0x24')](_0x1308de,_0x23487d,!![]);}catch(_0x498b11){return BPromise[_0x83ed('0x25')](_0x498b11);}return _0x1308de['save']();};}function saveUpdates(_0x2b2658,_0x593e03){return function(_0x3ad803){if(_0x3ad803){return _0x3ad803['update'](_0x2b2658)[_0x83ed('0x26')](function(_0x42f89e){return _0x42f89e;});}return null;};}function removeEntity(_0x50b48c,_0x56c1da){return function(_0x25b1cd){if(_0x25b1cd){return _0x25b1cd[_0x83ed('0x27')]()[_0x83ed('0x26')](function(){_0x50b48c[_0x83ed('0x1b')](0xcc)[_0x83ed('0x1c')]();});}};}function handleEntityNotFound(_0xce2d59,_0x7077a6){return function(_0x1662df){if(!_0x1662df){_0xce2d59[_0x83ed('0x28')](0x194);}return _0x1662df;};}function handleError(_0x4655e3,_0x35156d){_0x35156d=_0x35156d||0x1f4;return function(_0x58f75a){logger['error'](_0x58f75a[_0x83ed('0x29')]);if(_0x58f75a[_0x83ed('0x2a')]){delete _0x58f75a['name'];}_0x4655e3['status'](_0x35156d)[_0x83ed('0x2b')](_0x58f75a);};}exports[_0x83ed('0x2c')]=function(_0x4cbadf,_0x44d9f5){var _0x38a74a={},_0x5bd536={},_0x58be7c={'count':0x0,'rows':[]};var _0x5182ab=_[_0x83ed('0x2d')](db[_0x83ed('0x2e')][_0x83ed('0x2f')],function(_0x317bcf){return{'name':_0x317bcf[_0x83ed('0x30')],'type':_0x317bcf['type'][_0x83ed('0x31')]};});_0x5bd536[_0x83ed('0x32')]=_[_0x83ed('0x2d')](_0x5182ab,'name');_0x5bd536[_0x83ed('0x33')]=_[_0x83ed('0x34')](_0x4cbadf['query']);_0x5bd536[_0x83ed('0x35')]=_['intersection'](_0x5bd536['model'],_0x5bd536[_0x83ed('0x33')]);_0x38a74a[_0x83ed('0x36')]=_['intersection'](_0x5bd536[_0x83ed('0x32')],qs[_0x83ed('0x37')](_0x4cbadf['query'][_0x83ed('0x37')]));_0x38a74a[_0x83ed('0x36')]=_0x38a74a['attributes'][_0x83ed('0x38')]?_0x38a74a[_0x83ed('0x36')]:_0x5bd536['model'];if(!_0x4cbadf[_0x83ed('0x33')]['hasOwnProperty'](_0x83ed('0x39'))){_0x38a74a[_0x83ed('0x20')]=qs['limit'](_0x4cbadf[_0x83ed('0x33')][_0x83ed('0x20')]);_0x38a74a['offset']=qs[_0x83ed('0x1e')](_0x4cbadf['query'][_0x83ed('0x1e')]);}_0x38a74a[_0x83ed('0x3a')]=qs[_0x83ed('0x3b')](_0x4cbadf[_0x83ed('0x33')]['sort']);_0x38a74a['where']=qs['filters'](_[_0x83ed('0x3c')](_0x4cbadf[_0x83ed('0x33')],_0x5bd536['filters']),_0x5182ab);if(_0x4cbadf[_0x83ed('0x33')][_0x83ed('0x3d')]){_0x38a74a[_0x83ed('0x3e')]=_[_0x83ed('0x3f')](_0x38a74a[_0x83ed('0x3e')],{'$or':_[_0x83ed('0x2d')](_0x5182ab,function(_0x474139){if(_0x474139[_0x83ed('0x40')]!=='VIRTUAL'){var _0x54e56c={};_0x54e56c[_0x474139[_0x83ed('0x2a')]]={'$like':'%'+_0x4cbadf[_0x83ed('0x33')][_0x83ed('0x3d')]+'%'};return _0x54e56c;}})});}_0x38a74a=_['merge']({},_0x38a74a,_0x4cbadf['options']);var _0x3479c8={'where':_0x38a74a['where']};return db[_0x83ed('0x2e')]['count'](_0x3479c8)[_0x83ed('0x26')](function(_0x166b93){_0x58be7c[_0x83ed('0x21')]=_0x166b93;if(_0x4cbadf[_0x83ed('0x33')][_0x83ed('0x41')]){_0x38a74a[_0x83ed('0x42')]=[{'all':!![]}];}return db[_0x83ed('0x2e')][_0x83ed('0x43')](_0x38a74a);})[_0x83ed('0x26')](function(_0x29269f){_0x58be7c['rows']=_0x29269f;return _0x58be7c;})[_0x83ed('0x26')](respondWithFilteredResult(_0x44d9f5,_0x38a74a))[_0x83ed('0x44')](handleError(_0x44d9f5,null));};exports[_0x83ed('0x45')]=function(_0x59bb7d,_0x50a29d){var _0x3da622={'raw':!![],'where':{'id':_0x59bb7d[_0x83ed('0x46')]['id']}},_0x540908={};_0x540908[_0x83ed('0x32')]=_['keys'](db[_0x83ed('0x2e')][_0x83ed('0x2f')]);_0x540908[_0x83ed('0x33')]=_[_0x83ed('0x34')](_0x59bb7d[_0x83ed('0x33')]);_0x540908[_0x83ed('0x35')]=_['intersection'](_0x540908[_0x83ed('0x32')],_0x540908[_0x83ed('0x33')]);_0x3da622[_0x83ed('0x36')]=_[_0x83ed('0x47')](_0x540908[_0x83ed('0x32')],qs[_0x83ed('0x37')](_0x59bb7d[_0x83ed('0x33')]['fields']));_0x3da622[_0x83ed('0x36')]=_0x3da622[_0x83ed('0x36')][_0x83ed('0x38')]?_0x3da622[_0x83ed('0x36')]:_0x540908[_0x83ed('0x32')];if(_0x59bb7d[_0x83ed('0x33')][_0x83ed('0x41')]){_0x3da622['include']=[{'all':!![]}];}_0x3da622=_[_0x83ed('0x3f')]({},_0x3da622,_0x59bb7d[_0x83ed('0x48')]);return db[_0x83ed('0x2e')]['find'](_0x3da622)[_0x83ed('0x26')](handleEntityNotFound(_0x50a29d,null))[_0x83ed('0x26')](respondWithResult(_0x50a29d,null))[_0x83ed('0x44')](handleError(_0x50a29d,null));};exports[_0x83ed('0x49')]=function(_0x566ce0,_0x19c3a8){return db[_0x83ed('0x2e')][_0x83ed('0x49')](_0x566ce0[_0x83ed('0x4a')],{})[_0x83ed('0x26')](respondWithResult(_0x19c3a8,0xc9))[_0x83ed('0x44')](handleError(_0x19c3a8,null));};exports[_0x83ed('0x4b')]=function(_0x204062,_0x5a0d49){if(_0x204062[_0x83ed('0x4a')]['id']){delete _0x204062[_0x83ed('0x4a')]['id'];}return db[_0x83ed('0x2e')][_0x83ed('0x4c')]({'where':{'id':_0x204062['params']['id']}})[_0x83ed('0x26')](handleEntityNotFound(_0x5a0d49,null))['then'](saveUpdates(_0x204062[_0x83ed('0x4a')],null))['then'](respondWithResult(_0x5a0d49,null))[_0x83ed('0x44')](handleError(_0x5a0d49,null));};exports[_0x83ed('0x27')]=function(_0x3ae805,_0x280ef6){return db['JscriptyQuestionReport'][_0x83ed('0x4c')]({'where':{'id':_0x3ae805[_0x83ed('0x46')]['id']}})[_0x83ed('0x26')](handleEntityNotFound(_0x280ef6,null))[_0x83ed('0x26')](removeEntity(_0x280ef6,null))['catch'](handleError(_0x280ef6,null));};exports[_0x83ed('0x4d')]=function(_0x5310d3,_0x123a48){return db[_0x83ed('0x2e')][_0x83ed('0x4d')]()[_0x83ed('0x26')](respondWithResult(_0x123a48,null))['catch'](handleError(_0x123a48,null));};
\ No newline at end of file
index 8ff89fa..1bebaca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5876=['rimraf','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','path'];(function(_0x381931,_0x1bbe42){var _0x580a6a=function(_0x25f22a){while(--_0x25f22a){_0x381931['push'](_0x381931['shift']());}};_0x580a6a(++_0x1bbe42);}(_0x5876,0xb8));var _0x6587=function(_0x59db0f,_0x466ec8){_0x59db0f=_0x59db0f-0x0;var _0x2d3a0c=_0x5876[_0x59db0f];return _0x2d3a0c;};'use strict';var _=require('lodash');var util=require(_0x6587('0x0'));var logger=require(_0x6587('0x1'))(_0x6587('0x2'));var moment=require(_0x6587('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6587('0x4'));var rimraf=require(_0x6587('0x5'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x309886,_0x2e6e7c){return _0x309886[_0x6587('0x6')](_0x6587('0x7'),attributes,{'tableName':_0x6587('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc034=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x1ae9e4,_0x38d3dd){var _0x5521f5=function(_0x2b98d7){while(--_0x2b98d7){_0x1ae9e4['push'](_0x1ae9e4['shift']());}};_0x5521f5(++_0x38d3dd);}(_0xc034,0x1b0));var _0x4c03=function(_0x5a7d81,_0x5c14c5){_0x5a7d81=_0x5a7d81-0x0;var _0x3dca70=_0xc034[_0x5a7d81];return _0x3dca70;};'use strict';var _=require('lodash');var util=require(_0x4c03('0x0'));var logger=require(_0x4c03('0x1'))(_0x4c03('0x2'));var moment=require(_0x4c03('0x3'));var BPromise=require(_0x4c03('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c03('0x5'));var rimraf=require(_0x4c03('0x6'));var config=require(_0x4c03('0x7'));var attributes=require(_0x4c03('0x8'));module[_0x4c03('0x9')]=function(_0x3dab83,_0x55301f){return _0x3dab83[_0x4c03('0xa')](_0x4c03('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bd1d4dd..bd46729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ede=['stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent'];(function(_0x5ae1c9,_0x3e312b){var _0x1c0f87=function(_0x131c23){while(--_0x131c23){_0x5ae1c9['push'](_0x5ae1c9['shift']());}};_0x1c0f87(++_0x3e312b);}(_0x4ede,0x18d));var _0xe4ed=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4ede[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xe4ed('0x0'));var util=require('util');var moment=require(_0xe4ed('0x1'));var BPromise=require(_0xe4ed('0x2'));var rs=require(_0xe4ed('0x3'));var fs=require('fs');var Redis=require(_0xe4ed('0x4'));var db=require(_0xe4ed('0x5'))['db'];var utils=require(_0xe4ed('0x6'));var logger=require('../../config/logger')(_0xe4ed('0x7'));var config=require(_0xe4ed('0x8'));var jayson=require(_0xe4ed('0x9'));var client=jayson[_0xe4ed('0xa')][_0xe4ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24de0a,_0x5119a3,_0x2d5ee){return new BPromise(function(_0x361b39,_0xb544a6){return client[_0xe4ed('0xc')](_0x24de0a,_0x2d5ee)[_0xe4ed('0xd')](function(_0x10c1a4){logger[_0xe4ed('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5119a3,'request\x20sent');logger[_0xe4ed('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x5119a3,_0xe4ed('0x10'),JSON[_0xe4ed('0x11')](_0x10c1a4));if(_0x10c1a4[_0xe4ed('0x12')]){if(_0x10c1a4[_0xe4ed('0x12')][_0xe4ed('0x13')]===0x1f4){logger[_0xe4ed('0x12')](_0xe4ed('0x14'),_0x5119a3,_0x10c1a4[_0xe4ed('0x12')][_0xe4ed('0x15')]);return _0xb544a6(_0x10c1a4[_0xe4ed('0x12')][_0xe4ed('0x15')]);}logger[_0xe4ed('0x12')](_0xe4ed('0x14'),_0x5119a3,_0x10c1a4['error'][_0xe4ed('0x15')]);return _0x361b39(_0x10c1a4[_0xe4ed('0x12')]['message']);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x5119a3,_0xe4ed('0x10'));_0x361b39(_0x10c1a4['result'][_0xe4ed('0x15')]);}})[_0xe4ed('0x16')](function(_0x2e20b4){logger[_0xe4ed('0x12')](_0xe4ed('0x14'),_0x5119a3,_0x2e20b4);_0xb544a6(_0x2e20b4);});});}
\ No newline at end of file
+var _0xbde6=['then','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request'];(function(_0x19ee23,_0x341ac){var _0x1b9578=function(_0x40365f){while(--_0x40365f){_0x19ee23['push'](_0x19ee23['shift']());}};_0x1b9578(++_0x341ac);}(_0xbde6,0x107));var _0x6bde=function(_0x14fa12,_0x47582e){_0x14fa12=_0x14fa12-0x0;var _0x3cbdb0=_0xbde6[_0x14fa12];return _0x3cbdb0;};'use strict';var _=require(_0x6bde('0x0'));var util=require(_0x6bde('0x1'));var moment=require(_0x6bde('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6bde('0x3'));var db=require(_0x6bde('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bde('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6bde('0x6'));var client=jayson[_0x6bde('0x7')][_0x6bde('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x386f5c,_0x5de823,_0x4feede){return new BPromise(function(_0x3c5ec7,_0x1ed396){return client[_0x6bde('0x9')](_0x386f5c,_0x4feede)[_0x6bde('0xa')](function(_0x12c126){logger['info'](_0x6bde('0xb'),_0x5de823,'request\x20sent');logger['debug'](_0x6bde('0xc'),_0x5de823,_0x6bde('0xd'),JSON[_0x6bde('0xe')](_0x12c126));if(_0x12c126[_0x6bde('0xf')]){if(_0x12c126[_0x6bde('0xf')][_0x6bde('0x10')]===0x1f4){logger[_0x6bde('0xf')](_0x6bde('0xb'),_0x5de823,_0x12c126[_0x6bde('0xf')]['message']);return _0x1ed396(_0x12c126['error']['message']);}logger[_0x6bde('0xf')](_0x6bde('0xb'),_0x5de823,_0x12c126[_0x6bde('0xf')]['message']);return _0x3c5ec7(_0x12c126[_0x6bde('0xf')][_0x6bde('0x11')]);}else{logger[_0x6bde('0x12')](_0x6bde('0xb'),_0x5de823,'request\x20sent');_0x3c5ec7(_0x12c126[_0x6bde('0x13')]['message']);}})[_0x6bde('0x14')](function(_0x4cf4d3){logger[_0x6bde('0xf')](_0x6bde('0xb'),_0x5de823,_0x4cf4d3);_0x1ed396(_0x4cf4d3);});});}
\ No newline at end of file
index 35155b4..f7d326f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c1b=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','show','/:id/questions','getQuestions','create','put'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0x5c1b,0x1d2));var _0xb5c1=function(_0x1439f5,_0x1aea76){_0x1439f5=_0x1439f5-0x0;var _0x3a4c36=_0x5c1b[_0x1439f5];return _0x3a4c36;};'use strict';var multer=require(_0xb5c1('0x0'));var util=require(_0xb5c1('0x1'));var path=require(_0xb5c1('0x2'));var timeout=require(_0xb5c1('0x3'));var express=require(_0xb5c1('0x4'));var router=express[_0xb5c1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb5c1('0x6'));var interaction=require(_0xb5c1('0x7'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0xb5c1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb5c1('0x9'),auth[_0xb5c1('0xa')](),controller[_0xb5c1('0xb')]);router[_0xb5c1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb5c1('0xc')]);router['get'](_0xb5c1('0xd'),auth['isAuthenticated'](),controller[_0xb5c1('0xe')]);router['post']('/',auth[_0xb5c1('0xa')](),controller[_0xb5c1('0xf')]);router[_0xb5c1('0x10')](_0xb5c1('0x11'),auth[_0xb5c1('0xa')](),controller['update']);router[_0xb5c1('0x12')](_0xb5c1('0x11'),auth[_0xb5c1('0xa')](),controller[_0xb5c1('0x13')]);module[_0xb5c1('0x14')]=router;
\ No newline at end of file
+var _0x482d=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getQuestions','destroy','multer','util','path'];(function(_0x38de33,_0x4361bb){var _0x40f16d=function(_0x25975c){while(--_0x25975c){_0x38de33['push'](_0x38de33['shift']());}};_0x40f16d(++_0x4361bb);}(_0x482d,0x140));var _0xd482=function(_0x49d3db,_0x3aaf58){_0x49d3db=_0x49d3db-0x0;var _0xa57f2c=_0x482d[_0x49d3db];return _0xa57f2c;};'use strict';var multer=require(_0xd482('0x0'));var util=require(_0xd482('0x1'));var path=require(_0xd482('0x2'));var timeout=require(_0xd482('0x3'));var express=require(_0xd482('0x4'));var router=express[_0xd482('0x5')]();var fs_extra=require(_0xd482('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd482('0x7'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0xd482('0x8')]('/',auth[_0xd482('0x9')](),controller[_0xd482('0xa')]);router[_0xd482('0x8')](_0xd482('0xb'),auth[_0xd482('0x9')](),controller[_0xd482('0xc')]);router[_0xd482('0x8')](_0xd482('0xd'),auth[_0xd482('0x9')](),controller[_0xd482('0xe')]);router[_0xd482('0x8')]('/:id/questions',auth[_0xd482('0x9')](),controller[_0xd482('0xf')]);router['post']('/',auth[_0xd482('0x9')](),controller['create']);router['put']('/:id',auth[_0xd482('0x9')](),controller['update']);router['delete'](_0xd482('0xd'),auth[_0xd482('0x9')](),controller[_0xd482('0x10')]);module['exports']=router;
\ No newline at end of file
index 26e80bf..309c88c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22b5=['STRING','BOOLEAN','exports','DATE','setDataValue','format'];(function(_0x3a04df,_0x1b55f3){var _0x5621cb=function(_0x16aa84){while(--_0x16aa84){_0x3a04df['push'](_0x3a04df['shift']());}};_0x5621cb(++_0x1b55f3);}(_0x22b5,0x170));var _0x522b=function(_0x2276fb,_0x5eaae6){_0x2276fb=_0x2276fb-0x0;var _0x7ebc67=_0x22b5[_0x2276fb];return _0x7ebc67;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x522b('0x0')]={'starttime':{'type':Sequelize[_0x522b('0x1')],'set':function(_0x510c18){this[_0x522b('0x2')]('starttime',_0x510c18);this[_0x522b('0x2')]('endtime',moment()[_0x522b('0x3')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x522b('0x1')]},'membername':{'type':Sequelize[_0x522b('0x4')]},'projectname':{'type':Sequelize[_0x522b('0x4')]},'queue':{'type':Sequelize[_0x522b('0x4')]},'uniqueid':{'type':Sequelize[_0x522b('0x4')]},'calleridname':{'type':Sequelize[_0x522b('0x4')]},'calleridnum':{'type':Sequelize[_0x522b('0x4')]},'completed':{'type':Sequelize[_0x522b('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc65a=['YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','DATE','setDataValue','endtime','format'];(function(_0x546c68,_0x5c0116){var _0x4a2389=function(_0x5aa205){while(--_0x5aa205){_0x546c68['push'](_0x546c68['shift']());}};_0x4a2389(++_0x5c0116);}(_0xc65a,0x1ca));var _0xac65=function(_0x561b3b,_0x171372){_0x561b3b=_0x561b3b-0x0;var _0x5752f4=_0xc65a[_0x561b3b];return _0x5752f4;};'use strict';var moment=require(_0xac65('0x0'));var Sequelize=require(_0xac65('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xac65('0x2')],'set':function(_0x53048e){this[_0xac65('0x3')]('starttime',_0x53048e);this['setDataValue'](_0xac65('0x4'),moment()[_0xac65('0x5')](_0xac65('0x6')));}},'endtime':{'type':Sequelize[_0xac65('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xac65('0x7')]},'uniqueid':{'type':Sequelize[_0xac65('0x7')]},'calleridname':{'type':Sequelize[_0xac65('0x7')]},'calleridnum':{'type':Sequelize[_0xac65('0x7')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 47068f3..e09b4b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf60e=['include','findAll','rows','catch','params','keys','create','body','find','destroy','describe','getQuestions','findOne','hasOwnProperty','SessionId','JscriptyQuestionReport','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll'];(function(_0x17e24b,_0x7f92a8){var _0xba22cb=function(_0x59c055){while(--_0x59c055){_0x17e24b['push'](_0x17e24b['shift']());}};_0xba22cb(++_0x7f92a8);}(_0xf60e,0x1a0));var _0xef60=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xf60e[_0x1d24eb];return _0x1dc576;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef60('0x0'));var zipdir=require(_0xef60('0x1'));var jsonpatch=require(_0xef60('0x2'));var rp=require('request-promise');var moment=require(_0xef60('0x3'));var BPromise=require(_0xef60('0x4'));var Mustache=require(_0xef60('0x5'));var util=require('util');var path=require('path');var sox=require(_0xef60('0x6'));var csv=require(_0xef60('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef60('0x8'));var _=require(_0xef60('0x9'));var squel=require(_0xef60('0xa'));var crypto=require(_0xef60('0xb'));var jsforce=require(_0xef60('0xc'));var deskjs=require(_0xef60('0xd'));var toCsv=require(_0xef60('0x7'));var querystring=require(_0xef60('0xe'));var Papa=require(_0xef60('0xf'));var Redis=require(_0xef60('0x10'));var authService=require(_0xef60('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xef60('0x12'));var hardwareService=require(_0xef60('0x13'));var logger=require(_0xef60('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xef60('0x15'));var licenseUtil=require(_0xef60('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x415823,_0x5eb5df){_0x5eb5df=_0x5eb5df||0xcc;return function(_0x2e78ea){if(_0x2e78ea){return _0x415823[_0xef60('0x17')](_0x5eb5df);}return _0x415823[_0xef60('0x18')](_0x5eb5df)[_0xef60('0x19')]();};}function respondWithResult(_0x1b7866,_0x40e8d4){_0x40e8d4=_0x40e8d4||0xc8;return function(_0x1bbaa6){if(_0x1bbaa6){return _0x1b7866[_0xef60('0x18')](_0x40e8d4)[_0xef60('0x1a')](_0x1bbaa6);}};}function respondWithFilteredResult(_0x1cf88e,_0x48b1f6){return function(_0x39f083){if(_0x39f083){var _0x4736ba=typeof _0x48b1f6[_0xef60('0x1b')]===_0xef60('0x1c')&&typeof _0x48b1f6['limit']==='undefined';var _0x1d091d=_0x39f083[_0xef60('0x1d')];var _0x294d25=_0x4736ba?0x0:_0x48b1f6[_0xef60('0x1b')];var _0x2aec7c=_0x4736ba?_0x39f083[_0xef60('0x1d')]:_0x48b1f6[_0xef60('0x1b')]+_0x48b1f6[_0xef60('0x1e')];var _0x5c4b5;if(_0x2aec7c>=_0x1d091d){_0x2aec7c=_0x1d091d;_0x5c4b5=0xc8;}else{_0x5c4b5=0xce;}_0x1cf88e[_0xef60('0x18')](_0x5c4b5);return _0x1cf88e['set'](_0xef60('0x1f'),_0x294d25+'-'+_0x2aec7c+'/'+_0x1d091d)['json'](_0x39f083);}return null;};}function patchUpdates(_0x423f54){return function(_0x3856a9){try{jsonpatch[_0xef60('0x20')](_0x3856a9,_0x423f54,!![]);}catch(_0x4ed94d){return BPromise[_0xef60('0x21')](_0x4ed94d);}return _0x3856a9['save']();};}function saveUpdates(_0xc775cc,_0x31b464){return function(_0x5861aa){if(_0x5861aa){return _0x5861aa[_0xef60('0x22')](_0xc775cc)[_0xef60('0x23')](function(_0x4f7a14){return _0x4f7a14;});}return null;};}function removeEntity(_0x928981,_0xaacde){return function(_0x530f57){if(_0x530f57){return _0x530f57['destroy']()[_0xef60('0x23')](function(){_0x928981['status'](0xcc)[_0xef60('0x19')]();});}};}function handleEntityNotFound(_0x112ef3,_0x320313){return function(_0xb6f1b1){if(!_0xb6f1b1){_0x112ef3[_0xef60('0x17')](0x194);}return _0xb6f1b1;};}function handleError(_0x51f585,_0x5eec99){_0x5eec99=_0x5eec99||0x1f4;return function(_0x5b0c0b){logger[_0xef60('0x24')](_0x5b0c0b[_0xef60('0x25')]);if(_0x5b0c0b[_0xef60('0x26')]){delete _0x5b0c0b['name'];}_0x51f585[_0xef60('0x18')](_0x5eec99)[_0xef60('0x27')](_0x5b0c0b);};}exports[_0xef60('0x28')]=function(_0x2dfb4c,_0x235d2d){var _0x26df93={},_0x5502b8={},_0x47ba2b={'count':0x0,'rows':[]};var _0x245d92=_[_0xef60('0x29')](db[_0xef60('0x2a')][_0xef60('0x2b')],function(_0xd84735){return{'name':_0xd84735[_0xef60('0x2c')],'type':_0xd84735['type'][_0xef60('0x2d')]};});_0x5502b8[_0xef60('0x2e')]=_[_0xef60('0x29')](_0x245d92,'name');_0x5502b8[_0xef60('0x2f')]=_['keys'](_0x2dfb4c['query']);_0x5502b8[_0xef60('0x30')]=_[_0xef60('0x31')](_0x5502b8[_0xef60('0x2e')],_0x5502b8[_0xef60('0x2f')]);_0x26df93['attributes']=_['intersection'](_0x5502b8[_0xef60('0x2e')],qs[_0xef60('0x32')](_0x2dfb4c[_0xef60('0x2f')][_0xef60('0x32')]));_0x26df93[_0xef60('0x33')]=_0x26df93[_0xef60('0x33')][_0xef60('0x34')]?_0x26df93[_0xef60('0x33')]:_0x5502b8['model'];if(!_0x2dfb4c[_0xef60('0x2f')]['hasOwnProperty'](_0xef60('0x35'))){_0x26df93[_0xef60('0x1e')]=qs['limit'](_0x2dfb4c[_0xef60('0x2f')][_0xef60('0x1e')]);_0x26df93[_0xef60('0x1b')]=qs[_0xef60('0x1b')](_0x2dfb4c[_0xef60('0x2f')][_0xef60('0x1b')]);}_0x26df93[_0xef60('0x36')]=qs[_0xef60('0x37')](_0x2dfb4c[_0xef60('0x2f')][_0xef60('0x37')]);_0x26df93[_0xef60('0x38')]=qs['filters'](_[_0xef60('0x39')](_0x2dfb4c['query'],_0x5502b8[_0xef60('0x30')]),_0x245d92);if(_0x2dfb4c['query']['filter']){_0x26df93[_0xef60('0x38')]=_['merge'](_0x26df93[_0xef60('0x38')],{'$or':_['map'](_0x245d92,function(_0x3f62ca){if(_0x3f62ca[_0xef60('0x3a')]!==_0xef60('0x3b')){var _0x4f8ca7={};_0x4f8ca7[_0x3f62ca[_0xef60('0x26')]]={'$like':'%'+_0x2dfb4c[_0xef60('0x2f')][_0xef60('0x3c')]+'%'};return _0x4f8ca7;}})});}_0x26df93=_[_0xef60('0x3d')]({},_0x26df93,_0x2dfb4c[_0xef60('0x3e')]);var _0x4581a2={'where':_0x26df93[_0xef60('0x38')]};return db['JscriptySessionReport']['count'](_0x4581a2)[_0xef60('0x23')](function(_0x5a69b4){_0x47ba2b[_0xef60('0x1d')]=_0x5a69b4;if(_0x2dfb4c[_0xef60('0x2f')][_0xef60('0x3f')]){_0x26df93[_0xef60('0x40')]=[{'all':!![]}];}return db[_0xef60('0x2a')][_0xef60('0x41')](_0x26df93);})[_0xef60('0x23')](function(_0x478ca3){_0x47ba2b[_0xef60('0x42')]=_0x478ca3;return _0x47ba2b;})[_0xef60('0x23')](respondWithFilteredResult(_0x235d2d,_0x26df93))[_0xef60('0x43')](handleError(_0x235d2d,null));};exports['show']=function(_0x302fba,_0x5d19a2){var _0x203449={'raw':!![],'where':{'id':_0x302fba[_0xef60('0x44')]['id']}},_0x56cdd5={};_0x56cdd5[_0xef60('0x2e')]=_[_0xef60('0x45')](db[_0xef60('0x2a')][_0xef60('0x2b')]);_0x56cdd5[_0xef60('0x2f')]=_[_0xef60('0x45')](_0x302fba['query']);_0x56cdd5[_0xef60('0x30')]=_[_0xef60('0x31')](_0x56cdd5[_0xef60('0x2e')],_0x56cdd5[_0xef60('0x2f')]);_0x203449[_0xef60('0x33')]=_[_0xef60('0x31')](_0x56cdd5[_0xef60('0x2e')],qs['fields'](_0x302fba['query'][_0xef60('0x32')]));_0x203449[_0xef60('0x33')]=_0x203449[_0xef60('0x33')][_0xef60('0x34')]?_0x203449[_0xef60('0x33')]:_0x56cdd5[_0xef60('0x2e')];if(_0x302fba[_0xef60('0x2f')][_0xef60('0x3f')]){_0x203449[_0xef60('0x40')]=[{'all':!![]}];}_0x203449=_[_0xef60('0x3d')]({},_0x203449,_0x302fba[_0xef60('0x3e')]);return db[_0xef60('0x2a')]['find'](_0x203449)[_0xef60('0x23')](handleEntityNotFound(_0x5d19a2,null))[_0xef60('0x23')](respondWithResult(_0x5d19a2,null))[_0xef60('0x43')](handleError(_0x5d19a2,null));};exports[_0xef60('0x46')]=function(_0x1d3a5d,_0x3aefd3){return db['JscriptySessionReport']['create'](_0x1d3a5d['body'],{})[_0xef60('0x23')](respondWithResult(_0x3aefd3,0xc9))[_0xef60('0x43')](handleError(_0x3aefd3,null));};exports[_0xef60('0x22')]=function(_0x345cf9,_0x483d78){if(_0x345cf9[_0xef60('0x47')]['id']){delete _0x345cf9[_0xef60('0x47')]['id'];}return db[_0xef60('0x2a')][_0xef60('0x48')]({'where':{'id':_0x345cf9[_0xef60('0x44')]['id']}})[_0xef60('0x23')](handleEntityNotFound(_0x483d78,null))['then'](saveUpdates(_0x345cf9[_0xef60('0x47')],null))[_0xef60('0x23')](respondWithResult(_0x483d78,null))[_0xef60('0x43')](handleError(_0x483d78,null));};exports[_0xef60('0x49')]=function(_0x76a553,_0x504e55){return db[_0xef60('0x2a')][_0xef60('0x48')]({'where':{'id':_0x76a553[_0xef60('0x44')]['id']}})[_0xef60('0x23')](handleEntityNotFound(_0x504e55,null))[_0xef60('0x23')](removeEntity(_0x504e55,null))[_0xef60('0x43')](handleError(_0x504e55,null));};exports[_0xef60('0x4a')]=function(_0x1c6207,_0x5919cc){return db['JscriptySessionReport'][_0xef60('0x4a')]()['then'](respondWithResult(_0x5919cc,null))[_0xef60('0x43')](handleError(_0x5919cc,null));};exports[_0xef60('0x4b')]=function(_0x32f62f,_0x447f02,_0x3f1949){var _0x13ae34={'raw':!![],'where':{}};var _0x2a4ad5={};var _0x571c80={'count':0x0,'rows':[]};return db[_0xef60('0x2a')][_0xef60('0x4c')]({'where':{'id':_0x32f62f[_0xef60('0x44')]['id']}})[_0xef60('0x23')](handleEntityNotFound(_0x447f02,null))['then'](function(_0x33da4b){if(_0x33da4b){_0x2a4ad5[_0xef60('0x2e')]=_[_0xef60('0x45')](db['JscriptyQuestionReport'][_0xef60('0x2b')]);_0x2a4ad5[_0xef60('0x2f')]=_[_0xef60('0x45')](_0x32f62f[_0xef60('0x2f')]);_0x2a4ad5[_0xef60('0x30')]=_['intersection'](_0x2a4ad5[_0xef60('0x2e')],_0x2a4ad5[_0xef60('0x2f')]);_0x13ae34['attributes']=_[_0xef60('0x31')](_0x2a4ad5['model'],qs[_0xef60('0x32')](_0x32f62f[_0xef60('0x2f')][_0xef60('0x32')]));_0x13ae34[_0xef60('0x33')]=_0x13ae34[_0xef60('0x33')][_0xef60('0x34')]?_0x13ae34[_0xef60('0x33')]:_0x2a4ad5['model'];if(!_0x32f62f[_0xef60('0x2f')][_0xef60('0x4d')]('nolimit')){_0x13ae34[_0xef60('0x1e')]=qs[_0xef60('0x1e')](_0x32f62f[_0xef60('0x2f')][_0xef60('0x1e')]);_0x13ae34[_0xef60('0x1b')]=qs['offset'](_0x32f62f[_0xef60('0x2f')][_0xef60('0x1b')]);}_0x13ae34[_0xef60('0x36')]=qs[_0xef60('0x37')](_0x32f62f[_0xef60('0x2f')][_0xef60('0x37')]);_0x13ae34['where']=qs[_0xef60('0x30')](_[_0xef60('0x39')](_0x32f62f[_0xef60('0x2f')],_0x2a4ad5[_0xef60('0x30')]));_0x13ae34[_0xef60('0x38')][_0xef60('0x4e')]=_0x33da4b['id'];if(_0x32f62f[_0xef60('0x2f')]['filter']){_0x13ae34[_0xef60('0x38')]=_[_0xef60('0x3d')](_0x13ae34[_0xef60('0x38')],{'$or':_[_0xef60('0x29')](_0x13ae34['attributes'],function(_0x5a35a1){var _0x3e44aa={};_0x3e44aa[_0x5a35a1]={'$like':'%'+_0x32f62f[_0xef60('0x2f')]['filter']+'%'};return _0x3e44aa;})});}_0x13ae34=_[_0xef60('0x3d')]({},_0x13ae34,_0x32f62f[_0xef60('0x3e')]);return db['JscriptyQuestionReport'][_0xef60('0x1d')]({'where':_0x13ae34[_0xef60('0x38')]})[_0xef60('0x23')](function(_0x415d34){_0x571c80[_0xef60('0x1d')]=_0x415d34;if(_0x32f62f[_0xef60('0x2f')][_0xef60('0x3f')]){_0x13ae34[_0xef60('0x40')]=[{'all':!![]}];}return db[_0xef60('0x4f')][_0xef60('0x41')](_0x13ae34);})[_0xef60('0x23')](function(_0x5f36ec){_0x571c80['rows']=_0x5f36ec;return _0x571c80;});}})[_0xef60('0x23')](respondWithFilteredResult(_0x447f02,_0x13ae34))[_0xef60('0x43')](handleError(_0x447f02,null));};
\ No newline at end of file
+var _0x6ee8=['util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','describe','nolimit','SessionId','JscriptyQuestionReport','eml-format','zip-dir','request-promise','bluebird','mustache'];(function(_0x3ccdb2,_0x593f2f){var _0x1369f8=function(_0x5627e9){while(--_0x5627e9){_0x3ccdb2['push'](_0x3ccdb2['shift']());}};_0x1369f8(++_0x593f2f);}(_0x6ee8,0x1cf));var _0x86ee=function(_0x50fd3c,_0x1e44ff){_0x50fd3c=_0x50fd3c-0x0;var _0x57fe9e=_0x6ee8[_0x50fd3c];return _0x57fe9e;};'use strict';var emlformat=require(_0x86ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86ee('0x2'));var moment=require('moment');var BPromise=require(_0x86ee('0x3'));var Mustache=require(_0x86ee('0x4'));var util=require(_0x86ee('0x5'));var path=require(_0x86ee('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x86ee('0x7'));var fs=require('fs');var fs_extra=require(_0x86ee('0x8'));var _=require(_0x86ee('0x9'));var squel=require(_0x86ee('0xa'));var crypto=require('crypto');var jsforce=require(_0x86ee('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x86ee('0xc'));var querystring=require(_0x86ee('0xd'));var Papa=require(_0x86ee('0xe'));var Redis=require(_0x86ee('0xf'));var authService=require(_0x86ee('0x10'));var qs=require(_0x86ee('0x11'));var as=require(_0x86ee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x86ee('0x13'))('api');var utils=require(_0x86ee('0x14'));var config=require(_0x86ee('0x15'));var licenseUtil=require(_0x86ee('0x16'));var db=require(_0x86ee('0x17'))['db'];function respondWithStatusCode(_0x189fc0,_0x361a0f){_0x361a0f=_0x361a0f||0xcc;return function(_0x434042){if(_0x434042){return _0x189fc0[_0x86ee('0x18')](_0x361a0f);}return _0x189fc0[_0x86ee('0x19')](_0x361a0f)[_0x86ee('0x1a')]();};}function respondWithResult(_0x3ffbd3,_0x149125){_0x149125=_0x149125||0xc8;return function(_0x37d6ac){if(_0x37d6ac){return _0x3ffbd3[_0x86ee('0x19')](_0x149125)[_0x86ee('0x1b')](_0x37d6ac);}};}function respondWithFilteredResult(_0x2882eb,_0x529e89){return function(_0x2cffb8){if(_0x2cffb8){var _0x4e792b=typeof _0x529e89[_0x86ee('0x1c')]==='undefined'&&typeof _0x529e89[_0x86ee('0x1d')]==='undefined';var _0x1a7f5b=_0x2cffb8[_0x86ee('0x1e')];var _0x38c477=_0x4e792b?0x0:_0x529e89[_0x86ee('0x1c')];var _0x23e4cc=_0x4e792b?_0x2cffb8['count']:_0x529e89[_0x86ee('0x1c')]+_0x529e89[_0x86ee('0x1d')];var _0x54dcd3;if(_0x23e4cc>=_0x1a7f5b){_0x23e4cc=_0x1a7f5b;_0x54dcd3=0xc8;}else{_0x54dcd3=0xce;}_0x2882eb[_0x86ee('0x19')](_0x54dcd3);return _0x2882eb[_0x86ee('0x1f')](_0x86ee('0x20'),_0x38c477+'-'+_0x23e4cc+'/'+_0x1a7f5b)['json'](_0x2cffb8);}return null;};}function patchUpdates(_0x199de0){return function(_0x46cf1e){try{jsonpatch['apply'](_0x46cf1e,_0x199de0,!![]);}catch(_0x6bbad){return BPromise[_0x86ee('0x21')](_0x6bbad);}return _0x46cf1e[_0x86ee('0x22')]();};}function saveUpdates(_0x21adb3,_0x526295){return function(_0x208bc0){if(_0x208bc0){return _0x208bc0[_0x86ee('0x23')](_0x21adb3)[_0x86ee('0x24')](function(_0x1094f3){return _0x1094f3;});}return null;};}function removeEntity(_0x18bc04,_0xc009bb){return function(_0x13cf3e){if(_0x13cf3e){return _0x13cf3e[_0x86ee('0x25')]()[_0x86ee('0x24')](function(){_0x18bc04[_0x86ee('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc0df,_0xccc9c9){return function(_0x11fa93){if(!_0x11fa93){_0x3cc0df[_0x86ee('0x18')](0x194);}return _0x11fa93;};}function handleError(_0x2adadb,_0x279abf){_0x279abf=_0x279abf||0x1f4;return function(_0x3d352e){logger['error'](_0x3d352e[_0x86ee('0x26')]);if(_0x3d352e[_0x86ee('0x27')]){delete _0x3d352e[_0x86ee('0x27')];}_0x2adadb['status'](_0x279abf)[_0x86ee('0x28')](_0x3d352e);};}exports[_0x86ee('0x29')]=function(_0x3078fe,_0x30cdbe){var _0x4d0183={},_0x2f2e26={},_0x2fdefa={'count':0x0,'rows':[]};var _0x5925c8=_[_0x86ee('0x2a')](db[_0x86ee('0x2b')]['rawAttributes'],function(_0x2b55dd){return{'name':_0x2b55dd[_0x86ee('0x2c')],'type':_0x2b55dd[_0x86ee('0x2d')][_0x86ee('0x2e')]};});_0x2f2e26[_0x86ee('0x2f')]=_[_0x86ee('0x2a')](_0x5925c8,'name');_0x2f2e26[_0x86ee('0x30')]=_[_0x86ee('0x31')](_0x3078fe[_0x86ee('0x30')]);_0x2f2e26['filters']=_[_0x86ee('0x32')](_0x2f2e26[_0x86ee('0x2f')],_0x2f2e26[_0x86ee('0x30')]);_0x4d0183[_0x86ee('0x33')]=_[_0x86ee('0x32')](_0x2f2e26[_0x86ee('0x2f')],qs[_0x86ee('0x34')](_0x3078fe[_0x86ee('0x30')][_0x86ee('0x34')]));_0x4d0183[_0x86ee('0x33')]=_0x4d0183[_0x86ee('0x33')][_0x86ee('0x35')]?_0x4d0183[_0x86ee('0x33')]:_0x2f2e26[_0x86ee('0x2f')];if(!_0x3078fe[_0x86ee('0x30')][_0x86ee('0x36')]('nolimit')){_0x4d0183[_0x86ee('0x1d')]=qs[_0x86ee('0x1d')](_0x3078fe[_0x86ee('0x30')][_0x86ee('0x1d')]);_0x4d0183[_0x86ee('0x1c')]=qs[_0x86ee('0x1c')](_0x3078fe[_0x86ee('0x30')][_0x86ee('0x1c')]);}_0x4d0183[_0x86ee('0x37')]=qs[_0x86ee('0x38')](_0x3078fe[_0x86ee('0x30')][_0x86ee('0x38')]);_0x4d0183[_0x86ee('0x39')]=qs[_0x86ee('0x3a')](_[_0x86ee('0x3b')](_0x3078fe[_0x86ee('0x30')],_0x2f2e26[_0x86ee('0x3a')]),_0x5925c8);if(_0x3078fe[_0x86ee('0x30')]['filter']){_0x4d0183['where']=_[_0x86ee('0x3c')](_0x4d0183[_0x86ee('0x39')],{'$or':_[_0x86ee('0x2a')](_0x5925c8,function(_0x1ff64a){if(_0x1ff64a[_0x86ee('0x2d')]!==_0x86ee('0x3d')){var _0x4c3b3d={};_0x4c3b3d[_0x1ff64a[_0x86ee('0x27')]]={'$like':'%'+_0x3078fe[_0x86ee('0x30')][_0x86ee('0x3e')]+'%'};return _0x4c3b3d;}})});}_0x4d0183=_[_0x86ee('0x3c')]({},_0x4d0183,_0x3078fe[_0x86ee('0x3f')]);var _0x3da6e0={'where':_0x4d0183[_0x86ee('0x39')]};return db['JscriptySessionReport'][_0x86ee('0x1e')](_0x3da6e0)[_0x86ee('0x24')](function(_0x32365c){_0x2fdefa[_0x86ee('0x1e')]=_0x32365c;if(_0x3078fe['query'][_0x86ee('0x40')]){_0x4d0183[_0x86ee('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x86ee('0x42')](_0x4d0183);})['then'](function(_0x23a8fd){_0x2fdefa['rows']=_0x23a8fd;return _0x2fdefa;})['then'](respondWithFilteredResult(_0x30cdbe,_0x4d0183))[_0x86ee('0x43')](handleError(_0x30cdbe,null));};exports[_0x86ee('0x44')]=function(_0x1a9ae1,_0x5d7da9){var _0x2b9949={'raw':!![],'where':{'id':_0x1a9ae1['params']['id']}},_0x28486f={};_0x28486f['model']=_[_0x86ee('0x31')](db[_0x86ee('0x2b')][_0x86ee('0x45')]);_0x28486f['query']=_[_0x86ee('0x31')](_0x1a9ae1[_0x86ee('0x30')]);_0x28486f['filters']=_['intersection'](_0x28486f[_0x86ee('0x2f')],_0x28486f[_0x86ee('0x30')]);_0x2b9949[_0x86ee('0x33')]=_['intersection'](_0x28486f[_0x86ee('0x2f')],qs[_0x86ee('0x34')](_0x1a9ae1[_0x86ee('0x30')][_0x86ee('0x34')]));_0x2b9949[_0x86ee('0x33')]=_0x2b9949[_0x86ee('0x33')]['length']?_0x2b9949['attributes']:_0x28486f['model'];if(_0x1a9ae1['query'][_0x86ee('0x40')]){_0x2b9949[_0x86ee('0x41')]=[{'all':!![]}];}_0x2b9949=_['merge']({},_0x2b9949,_0x1a9ae1[_0x86ee('0x3f')]);return db[_0x86ee('0x2b')][_0x86ee('0x46')](_0x2b9949)[_0x86ee('0x24')](handleEntityNotFound(_0x5d7da9,null))[_0x86ee('0x24')](respondWithResult(_0x5d7da9,null))[_0x86ee('0x43')](handleError(_0x5d7da9,null));};exports[_0x86ee('0x47')]=function(_0x8d1f66,_0x6de673){return db[_0x86ee('0x2b')][_0x86ee('0x47')](_0x8d1f66[_0x86ee('0x48')],{})[_0x86ee('0x24')](respondWithResult(_0x6de673,0xc9))[_0x86ee('0x43')](handleError(_0x6de673,null));};exports[_0x86ee('0x23')]=function(_0x93d470,_0x198b5c){if(_0x93d470[_0x86ee('0x48')]['id']){delete _0x93d470[_0x86ee('0x48')]['id'];}return db[_0x86ee('0x2b')][_0x86ee('0x46')]({'where':{'id':_0x93d470[_0x86ee('0x49')]['id']}})[_0x86ee('0x24')](handleEntityNotFound(_0x198b5c,null))[_0x86ee('0x24')](saveUpdates(_0x93d470[_0x86ee('0x48')],null))['then'](respondWithResult(_0x198b5c,null))[_0x86ee('0x43')](handleError(_0x198b5c,null));};exports[_0x86ee('0x25')]=function(_0xbdd811,_0x46e43f){return db[_0x86ee('0x2b')][_0x86ee('0x46')]({'where':{'id':_0xbdd811[_0x86ee('0x49')]['id']}})[_0x86ee('0x24')](handleEntityNotFound(_0x46e43f,null))[_0x86ee('0x24')](removeEntity(_0x46e43f,null))[_0x86ee('0x43')](handleError(_0x46e43f,null));};exports[_0x86ee('0x4a')]=function(_0x32f096,_0x4e954b){return db[_0x86ee('0x2b')][_0x86ee('0x4a')]()['then'](respondWithResult(_0x4e954b,null))[_0x86ee('0x43')](handleError(_0x4e954b,null));};exports['getQuestions']=function(_0x4b3832,_0x2f13e8,_0x1ba6f5){var _0x142ada={'raw':!![],'where':{}};var _0x37c22f={};var _0xba03d4={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x4b3832['params']['id']}})['then'](handleEntityNotFound(_0x2f13e8,null))[_0x86ee('0x24')](function(_0x3c6a44){if(_0x3c6a44){_0x37c22f['model']=_['keys'](db['JscriptyQuestionReport'][_0x86ee('0x45')]);_0x37c22f[_0x86ee('0x30')]=_[_0x86ee('0x31')](_0x4b3832['query']);_0x37c22f['filters']=_[_0x86ee('0x32')](_0x37c22f['model'],_0x37c22f[_0x86ee('0x30')]);_0x142ada[_0x86ee('0x33')]=_[_0x86ee('0x32')](_0x37c22f['model'],qs['fields'](_0x4b3832['query']['fields']));_0x142ada[_0x86ee('0x33')]=_0x142ada['attributes'][_0x86ee('0x35')]?_0x142ada[_0x86ee('0x33')]:_0x37c22f[_0x86ee('0x2f')];if(!_0x4b3832[_0x86ee('0x30')]['hasOwnProperty'](_0x86ee('0x4b'))){_0x142ada[_0x86ee('0x1d')]=qs[_0x86ee('0x1d')](_0x4b3832[_0x86ee('0x30')][_0x86ee('0x1d')]);_0x142ada[_0x86ee('0x1c')]=qs[_0x86ee('0x1c')](_0x4b3832[_0x86ee('0x30')][_0x86ee('0x1c')]);}_0x142ada[_0x86ee('0x37')]=qs[_0x86ee('0x38')](_0x4b3832['query'][_0x86ee('0x38')]);_0x142ada[_0x86ee('0x39')]=qs[_0x86ee('0x3a')](_[_0x86ee('0x3b')](_0x4b3832[_0x86ee('0x30')],_0x37c22f[_0x86ee('0x3a')]));_0x142ada[_0x86ee('0x39')][_0x86ee('0x4c')]=_0x3c6a44['id'];if(_0x4b3832[_0x86ee('0x30')][_0x86ee('0x3e')]){_0x142ada[_0x86ee('0x39')]=_[_0x86ee('0x3c')](_0x142ada[_0x86ee('0x39')],{'$or':_[_0x86ee('0x2a')](_0x142ada['attributes'],function(_0x2782fe){var _0x4481a7={};_0x4481a7[_0x2782fe]={'$like':'%'+_0x4b3832['query']['filter']+'%'};return _0x4481a7;})});}_0x142ada=_[_0x86ee('0x3c')]({},_0x142ada,_0x4b3832[_0x86ee('0x3f')]);return db['JscriptyQuestionReport'][_0x86ee('0x1e')]({'where':_0x142ada['where']})[_0x86ee('0x24')](function(_0x86adfb){_0xba03d4[_0x86ee('0x1e')]=_0x86adfb;if(_0x4b3832[_0x86ee('0x30')][_0x86ee('0x40')]){_0x142ada[_0x86ee('0x41')]=[{'all':!![]}];}return db[_0x86ee('0x4d')][_0x86ee('0x42')](_0x142ada);})['then'](function(_0x4768cc){_0xba03d4['rows']=_0x4768cc;return _0xba03d4;});}})[_0x86ee('0x24')](respondWithFilteredResult(_0x2f13e8,_0x142ada))[_0x86ee('0x43')](handleError(_0x2f13e8,null));};
\ No newline at end of file
index ef5830d..abfa24d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafb9=['request-promise','path','rimraf','exports','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2b85f8,_0x5a4a56){var _0xfe0eb4=function(_0x3643b5){while(--_0x3643b5){_0x2b85f8['push'](_0x2b85f8['shift']());}};_0xfe0eb4(++_0x5a4a56);}(_0xafb9,0x68));var _0x9afb=function(_0x3f00c6,_0x2c81a1){_0x3f00c6=_0x3f00c6-0x0;var _0x39c4ec=_0xafb9[_0x3f00c6];return _0x39c4ec;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x9afb('0x9')]=function(_0x56a139,_0x1ccf93){return _0x56a139['define']('JscriptySessionReport',attributes,{'tableName':_0x9afb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x038b=['report_jscripty_sessions','util','../../config/logger','api','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x11d4e0,_0x57d757){var _0x6e4dd2=function(_0x2f6c57){while(--_0x2f6c57){_0x11d4e0['push'](_0x11d4e0['shift']());}};_0x6e4dd2(++_0x57d757);}(_0x038b,0x114));var _0xb038=function(_0x50c166,_0x1e4089){_0x50c166=_0x50c166-0x0;var _0xa7b8b5=_0x038b[_0x50c166];return _0xa7b8b5;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6566fe0..d643ec5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0xb53a56,_0x3cfbe1){var _0x4c6296=function(_0xeabb74){while(--_0xeabb74){_0xb53a56['push'](_0xb53a56['shift']());}};_0x4c6296(++_0x3cfbe1);}(_0xba34,0x119));var _0x4ba3=function(_0x4a690b,_0x28d2a7){_0x4a690b=_0x4a690b-0x0;var _0x2fa9fd=_0xba34[_0x4a690b];return _0x2fa9fd;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});}
\ No newline at end of file
+var _0x47c5=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x47c5,0x165));var _0x547c=function(_0x16d3f8,_0x3f5dd3){_0x16d3f8=_0x16d3f8-0x0;var _0x49a172=_0x47c5[_0x16d3f8];return _0x49a172;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}
\ No newline at end of file
index ad70a87..d6aee72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95f4=['exports','multer','util','path','Router','fs-extra','../../config/environment','./license.controller','get','put','/:id','isAuthenticated'];(function(_0x1e172c,_0x3021f5){var _0x437c37=function(_0x326810){while(--_0x326810){_0x1e172c['push'](_0x1e172c['shift']());}};_0x437c37(++_0x3021f5);}(_0x95f4,0xf1));var _0x495f=function(_0x3f76b6,_0xd0fb27){_0x3f76b6=_0x3f76b6-0x0;var _0x93b97a=_0x95f4[_0x3f76b6];return _0x93b97a;};'use strict';var multer=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var path=require(_0x495f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x495f('0x3')]();var fs_extra=require(_0x495f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x495f('0x5'));var controller=require(_0x495f('0x6'));router[_0x495f('0x7')]('/',controller['index']);router[_0x495f('0x8')](_0x495f('0x9'),auth[_0x495f('0xa')](),controller['update']);module[_0x495f('0xb')]=router;
\ No newline at end of file
+var _0xa87e=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','update','exports','multer'];(function(_0x4a2a23,_0x49f5ee){var _0x38c0f9=function(_0x29cb62){while(--_0x29cb62){_0x4a2a23['push'](_0x4a2a23['shift']());}};_0x38c0f9(++_0x49f5ee);}(_0xa87e,0x185));var _0xea87=function(_0x58dc2b,_0x5808f0){_0x58dc2b=_0x58dc2b-0x0;var _0x4f04d7=_0xa87e[_0x58dc2b];return _0x4f04d7;};'use strict';var multer=require(_0xea87('0x0'));var util=require(_0xea87('0x1'));var path=require(_0xea87('0x2'));var timeout=require('connect-timeout');var express=require(_0xea87('0x3'));var router=express[_0xea87('0x4')]();var fs_extra=require(_0xea87('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xea87('0x6'));var config=require(_0xea87('0x7'));var controller=require(_0xea87('0x8'));router[_0xea87('0x9')]('/',controller[_0xea87('0xa')]);router['put'](_0xea87('0xb'),auth[_0xea87('0xc')](),controller[_0xea87('0xd')]);module[_0xea87('0xe')]=router;
\ No newline at end of file
index 0e948f6..15d63f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30fd=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x30fd,0xcd));var _0xd30f=function(_0x5be25a,_0x2b8353){_0x5be25a=_0x5be25a-0x0;var _0x5bc4e4=_0x30fd[_0x5be25a];return _0x5bc4e4;};'use strict';var Sequelize=require(_0xd30f('0x0'));module[_0xd30f('0x1')]={'license':{'type':Sequelize[_0xd30f('0x2')]},'data1':{'type':Sequelize[_0xd30f('0x3')]},'data2':{'type':Sequelize[_0xd30f('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xd30f('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x28d9=['sequelize','TEXT','STRING','INTEGER'];(function(_0x4fb570,_0x21803a){var _0x2d0958=function(_0x54ee71){while(--_0x54ee71){_0x4fb570['push'](_0x4fb570['shift']());}};_0x2d0958(++_0x21803a);}(_0x28d9,0x94));var _0x928d=function(_0x403dfa,_0xcd979){_0x403dfa=_0x403dfa-0x0;var _0x467cc7=_0x28d9[_0x403dfa];return _0x467cc7;};'use strict';var Sequelize=require(_0x928d('0x0'));module['exports']={'license':{'type':Sequelize[_0x928d('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x928d('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x928d('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 0a74180..e7177b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['params','checkLicense','key','demo','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','index','model','keys','rawAttributes','query','intersection','attributes','fields','merge','getLicense','body','find'];(function(_0x15e86f,_0x2f47ee){var _0x48b9ce=function(_0x25b53b){while(--_0x25b53b){_0x15e86f['push'](_0x15e86f['shift']());}};_0x48b9ce(++_0x2f47ee);}(_0x1967,0x173));var _0x7196=function(_0x16165a,_0x1ecbba){_0x16165a=_0x16165a-0x0;var _0x3cf22e=_0x1967[_0x16165a];return _0x3cf22e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}var utilLicense=require('../../config/license/util');exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={'raw':!![],'where':{'id':0x1}},_0x30151f={};_0x30151f[_0x7196('0x2d')]=_[_0x7196('0x2e')](db['License'][_0x7196('0x2f')]);_0x30151f[_0x7196('0x30')]=_[_0x7196('0x2e')](_0x4ecea1[_0x7196('0x30')]);_0x30151f['filters']=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],_0x30151f[_0x7196('0x30')]);_0x59d79d[_0x7196('0x32')]=_[_0x7196('0x31')](_0x30151f[_0x7196('0x2d')],qs[_0x7196('0x33')](_0x4ecea1[_0x7196('0x30')][_0x7196('0x33')]));_0x59d79d[_0x7196('0x32')]=_0x59d79d[_0x7196('0x32')]['length']?_0x59d79d[_0x7196('0x32')]:_0x30151f['model'];_0x59d79d=_[_0x7196('0x34')]({},_0x59d79d,_0x4ecea1['options']);return utilLicense[_0x7196('0x35')](_0x59d79d)[_0x7196('0x27')](respondWithResult(_0x4fd339,null))['catch'](handleError(_0x4fd339,null));};exports[_0x7196('0x26')]=function(_0x2bcadd,_0x4531d7){if(_0x2bcadd[_0x7196('0x36')]['id']){delete _0x2bcadd[_0x7196('0x36')]['id'];}return db['License'][_0x7196('0x37')]({'where':{'id':_0x2bcadd[_0x7196('0x38')]['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x4531d7,null))[_0x7196('0x27')](function(_0x3e8f98){var _0x123cad=_0x3e8f98['get']({'plain':!![]});return utilLicense[_0x7196('0x39')](_0x123cad,_0x2bcadd[_0x7196('0x36')][_0x7196('0x3a')]);})['then'](function(_0x33831a){if(!_0x33831a[_0x7196('0x3b')]){return saveUpdates(_0x2bcadd[_0x7196('0x36')],null);}return _0x33831a;})[_0x7196('0x27')](respondWithResult(_0x4531d7,null))[_0x7196('0x3c')](handleError(_0x4531d7,null));};
\ No newline at end of file
+var _0xadb5=['query','filters','intersection','attributes','merge','getLicense','body','find','params','key','catch','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','model','keys','License'];(function(_0xf6173e,_0xcad580){var _0x472867=function(_0x18bfd4){while(--_0x18bfd4){_0xf6173e['push'](_0xf6173e['shift']());}};_0x472867(++_0xcad580);}(_0xadb5,0xad));var _0x5adb=function(_0x2a579b,_0x392111){_0x2a579b=_0x2a579b-0x0;var _0x5929c8=_0xadb5[_0x2a579b];return _0x5929c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}var utilLicense=require(_0x5adb('0x17'));exports['index']=function(_0x49992e,_0x5d457e){var _0x39bddd={'raw':!![],'where':{'id':0x1}},_0x1eac55={};_0x1eac55[_0x5adb('0x28')]=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes']);_0x1eac55[_0x5adb('0x2b')]=_[_0x5adb('0x29')](_0x49992e[_0x5adb('0x2b')]);_0x1eac55[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](_0x1eac55[_0x5adb('0x28')],_0x1eac55[_0x5adb('0x2b')]);_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x2d')](_0x1eac55[_0x5adb('0x28')],qs['fields'](_0x49992e[_0x5adb('0x2b')]['fields']));_0x39bddd[_0x5adb('0x2e')]=_0x39bddd[_0x5adb('0x2e')]['length']?_0x39bddd[_0x5adb('0x2e')]:_0x1eac55[_0x5adb('0x28')];_0x39bddd=_[_0x5adb('0x2f')]({},_0x39bddd,_0x49992e['options']);return utilLicense[_0x5adb('0x30')](_0x39bddd)[_0x5adb('0x22')](respondWithResult(_0x5d457e,null))['catch'](handleError(_0x5d457e,null));};exports['update']=function(_0x1ed9ea,_0x49dd03){if(_0x1ed9ea[_0x5adb('0x31')]['id']){delete _0x1ed9ea[_0x5adb('0x31')]['id'];}return db[_0x5adb('0x2a')][_0x5adb('0x32')]({'where':{'id':_0x1ed9ea[_0x5adb('0x33')]['id']}})['then'](handleEntityNotFound(_0x49dd03,null))[_0x5adb('0x22')](function(_0x215b88){var _0x1c3a5c=_0x215b88['get']({'plain':!![]});return utilLicense['checkLicense'](_0x1c3a5c,_0x1ed9ea[_0x5adb('0x31')][_0x5adb('0x34')]);})['then'](function(_0x2355bc){if(!_0x2355bc['demo']){return saveUpdates(_0x1ed9ea[_0x5adb('0x31')],null);}return _0x2355bc;})['then'](respondWithResult(_0x49dd03,null))[_0x5adb('0x35')](handleError(_0x49dd03,null));};
\ No newline at end of file
index 3eb38a5..93d7c0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae3e=['api','moment','../../config/environment','./license.attributes','exports','define','License','license','lodash'];(function(_0x68b2e0,_0x5205c6){var _0x57d734=function(_0x4ea521){while(--_0x4ea521){_0x68b2e0['push'](_0x68b2e0['shift']());}};_0x57d734(++_0x5205c6);}(_0xae3e,0xe9));var _0xeae3=function(_0x2ff5aa,_0x4d251f){_0x2ff5aa=_0x2ff5aa-0x0;var _0x366c91=_0xae3e[_0x2ff5aa];return _0x366c91;};'use strict';var _=require(_0xeae3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeae3('0x1'));var moment=require(_0xeae3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeae3('0x3'));var attributes=require(_0xeae3('0x4'));module[_0xeae3('0x5')]=function(_0x219128,_0x50ce66){return _0x219128[_0xeae3('0x6')](_0xeae3('0x7'),attributes,{'tableName':_0xeae3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8fd=['bluebird','path','rimraf','../../config/environment','./license.attributes','define','License','license','lodash','../../config/logger','moment'];(function(_0x33d838,_0x2dc01f){var _0x13b35e=function(_0x5bbd36){while(--_0x5bbd36){_0x33d838['push'](_0x33d838['shift']());}};_0x13b35e(++_0x2dc01f);}(_0xd8fd,0xe4));var _0xdd8f=function(_0x97435b,_0x3972c7){_0x97435b=_0x97435b-0x0;var _0x30feb9=_0xd8fd[_0x97435b];return _0x30feb9;};'use strict';var _=require(_0xdd8f('0x0'));var util=require('util');var logger=require(_0xdd8f('0x1'))('api');var moment=require(_0xdd8f('0x2'));var BPromise=require(_0xdd8f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd8f('0x4'));var rimraf=require(_0xdd8f('0x5'));var config=require(_0xdd8f('0x6'));var attributes=require(_0xdd8f('0x7'));module['exports']=function(_0x5c3212,_0x7371bb){return _0x5c3212[_0xdd8f('0x8')](_0xdd8f('0x9'),attributes,{'tableName':_0xdd8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0dd2dc0..441f8a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaa7=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch'];(function(_0x36f891,_0x5414d1){var _0x32d63c=function(_0x3c3955){while(--_0x3c3955){_0x36f891['push'](_0x36f891['shift']());}};_0x32d63c(++_0x5414d1);}(_0xcaa7,0x176));var _0x7caa=function(_0x5014c3,_0x146868){_0x5014c3=_0x5014c3-0x0;var _0x44a5c1=_0xcaa7[_0x5014c3];return _0x44a5c1;};'use strict';var _=require(_0x7caa('0x0'));var util=require(_0x7caa('0x1'));var moment=require('moment');var BPromise=require(_0x7caa('0x2'));var rs=require(_0x7caa('0x3'));var fs=require('fs');var Redis=require(_0x7caa('0x4'));var db=require(_0x7caa('0x5'))['db'];var utils=require(_0x7caa('0x6'));var logger=require(_0x7caa('0x7'))(_0x7caa('0x8'));var config=require(_0x7caa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7caa('0xa')][_0x7caa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d8eef,_0x51ac98,_0x5bcccd){return new BPromise(function(_0x3ba839,_0x54d7cd){return client['request'](_0x5d8eef,_0x5bcccd)[_0x7caa('0xc')](function(_0x532c23){logger['info'](_0x7caa('0xd'),_0x51ac98,'request\x20sent');logger[_0x7caa('0xe')](_0x7caa('0xf'),_0x51ac98,_0x7caa('0x10'),JSON['stringify'](_0x532c23));if(_0x532c23[_0x7caa('0x11')]){if(_0x532c23[_0x7caa('0x11')]['code']===0x1f4){logger['error'](_0x7caa('0xd'),_0x51ac98,_0x532c23[_0x7caa('0x11')][_0x7caa('0x12')]);return _0x54d7cd(_0x532c23[_0x7caa('0x11')][_0x7caa('0x12')]);}logger[_0x7caa('0x11')](_0x7caa('0xd'),_0x51ac98,_0x532c23['error'][_0x7caa('0x12')]);return _0x3ba839(_0x532c23[_0x7caa('0x11')][_0x7caa('0x12')]);}else{logger[_0x7caa('0x13')](_0x7caa('0xd'),_0x51ac98,'request\x20sent');_0x3ba839(_0x532c23[_0x7caa('0x14')][_0x7caa('0x12')]);}})[_0x7caa('0x15')](function(_0x87d1d8){logger['error']('License,\x20%s,\x20%s',_0x51ac98,_0x87d1d8);_0x54d7cd(_0x87d1d8);});});}
\ No newline at end of file
+var _0xe30e=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0xe30e,0x78));var _0xee30=function(_0x37d4ac,_0x4e47d6){_0x37d4ac=_0x37d4ac-0x0;var _0x5e727a=_0xe30e[_0x37d4ac];return _0x5e727a;};'use strict';var _=require('lodash');var util=require(_0xee30('0x0'));var moment=require(_0xee30('0x1'));var BPromise=require(_0xee30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee30('0x3'));var db=require(_0xee30('0x4'))['db'];var utils=require(_0xee30('0x5'));var logger=require(_0xee30('0x6'))(_0xee30('0x7'));var config=require(_0xee30('0x8'));var jayson=require(_0xee30('0x9'));var client=jayson[_0xee30('0xa')][_0xee30('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492aca,_0x5479aa,_0x43d875){return new BPromise(function(_0x3b1aab,_0x39c564){return client[_0xee30('0xc')](_0x492aca,_0x43d875)['then'](function(_0x538452){logger[_0xee30('0xd')](_0xee30('0xe'),_0x5479aa,_0xee30('0xf'));logger['debug'](_0xee30('0x10'),_0x5479aa,_0xee30('0xf'),JSON[_0xee30('0x11')](_0x538452));if(_0x538452[_0xee30('0x12')]){if(_0x538452['error'][_0xee30('0x13')]===0x1f4){logger[_0xee30('0x12')]('License,\x20%s,\x20%s',_0x5479aa,_0x538452[_0xee30('0x12')][_0xee30('0x14')]);return _0x39c564(_0x538452['error']['message']);}logger[_0xee30('0x12')](_0xee30('0xe'),_0x5479aa,_0x538452[_0xee30('0x12')]['message']);return _0x3b1aab(_0x538452[_0xee30('0x12')]['message']);}else{logger['info']('License,\x20%s,\x20%s',_0x5479aa,_0xee30('0xf'));_0x3b1aab(_0x538452[_0xee30('0x15')][_0xee30('0x14')]);}})[_0xee30('0x16')](function(_0xa302b3){logger[_0xee30('0x12')]('License,\x20%s,\x20%s',_0x5479aa,_0xa302b3);_0x39c564(_0xa302b3);});});}
\ No newline at end of file
index 0c5e149..9f9ec53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9551=['/:id','update','delete','removeImap','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','create','addImap','addSmtp','addInteraction','addApplications','send','addAgents'];(function(_0x24aeb1,_0x45ce69){var _0x591032=function(_0x3f2120){while(--_0x3f2120){_0x24aeb1['push'](_0x24aeb1['shift']());}};_0x591032(++_0x45ce69);}(_0x9551,0x1a4));var _0x1955=function(_0x15f455,_0x1ec373){_0x15f455=_0x15f455-0x0;var _0x45f542=_0x9551[_0x15f455];return _0x45f542;};'use strict';var multer=require('multer');var util=require(_0x1955('0x0'));var path=require(_0x1955('0x1'));var timeout=require(_0x1955('0x2'));var express=require(_0x1955('0x3'));var router=express[_0x1955('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1955('0x5'));var interaction=require(_0x1955('0x6'));var config=require(_0x1955('0x7'));var controller=require(_0x1955('0x8'));router[_0x1955('0x9')]('/',auth['isAuthenticated'](),controller[_0x1955('0xa')]);router[_0x1955('0x9')](_0x1955('0xb'),auth[_0x1955('0xc')](),controller[_0x1955('0xd')]);router[_0x1955('0x9')]('/:id',auth[_0x1955('0xc')](),controller[_0x1955('0xe')]);router[_0x1955('0x9')](_0x1955('0xf'),auth['isAuthenticated'](),controller[_0x1955('0x10')]);router[_0x1955('0x9')](_0x1955('0x11'),auth['isAuthenticated'](),controller[_0x1955('0x12')]);router[_0x1955('0x9')](_0x1955('0x13'),auth[_0x1955('0xc')](),controller[_0x1955('0x14')]);router['get'](_0x1955('0x15'),auth[_0x1955('0xc')](),controller[_0x1955('0x16')]);router[_0x1955('0x9')](_0x1955('0x17'),auth[_0x1955('0xc')](),controller[_0x1955('0x18')]);router[_0x1955('0x9')](_0x1955('0x19'),auth[_0x1955('0xc')](),controller['getApplications']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x1955('0x1a')]);router[_0x1955('0x9')](_0x1955('0x1b'),auth[_0x1955('0xc')](),controller[_0x1955('0x1c')]);router[_0x1955('0x9')](_0x1955('0x1d'),auth[_0x1955('0xc')](),controller[_0x1955('0x1e')]);router[_0x1955('0x1f')](_0x1955('0xf'),auth[_0x1955('0xc')](),controller[_0x1955('0x20')]);router[_0x1955('0x1f')](_0x1955('0x11'),auth[_0x1955('0xc')](),controller['addAnswer']);router[_0x1955('0x1f')]('/',auth[_0x1955('0xc')](),controller[_0x1955('0x21')]);router['post'](_0x1955('0x13'),auth[_0x1955('0xc')](),controller[_0x1955('0x22')]);router[_0x1955('0x1f')](_0x1955('0x15'),auth[_0x1955('0xc')](),controller[_0x1955('0x23')]);router[_0x1955('0x1f')](_0x1955('0x17'),auth['isAuthenticated'](),controller[_0x1955('0x24')]);router['post'](_0x1955('0x19'),auth['isAuthenticated'](),controller[_0x1955('0x25')]);router[_0x1955('0x1f')]('/:id/send',auth[_0x1955('0xc')](),controller[_0x1955('0x26')]);router[_0x1955('0x1f')]('/:id/users',auth[_0x1955('0xc')](),controller[_0x1955('0x27')]);router['put'](_0x1955('0x28'),auth[_0x1955('0xc')](),controller[_0x1955('0x29')]);router[_0x1955('0x2a')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x1955('0xc')](),controller['removeAnswers']);router[_0x1955('0x2a')](_0x1955('0x13'),auth[_0x1955('0xc')](),controller[_0x1955('0x2b')]);router[_0x1955('0x2a')](_0x1955('0x15'),auth[_0x1955('0xc')](),controller['removeSmtp']);router['delete'](_0x1955('0x28'),auth[_0x1955('0xc')](),controller[_0x1955('0x2c')]);router[_0x1955('0x2a')](_0x1955('0x1d'),auth[_0x1955('0xc')](),controller['removeAgents']);module[_0x1955('0x2d')]=router;
\ No newline at end of file
+var _0x9d71=['verifySmtp','/:id/users','getAgents','post','addAnswer','create','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','addAgents','/:id','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify'];(function(_0x3c5735,_0x1f4f53){var _0x2cd61d=function(_0x183e55){while(--_0x183e55){_0x3c5735['push'](_0x3c5735['shift']());}};_0x2cd61d(++_0x1f4f53);}(_0x9d71,0x9b));var _0x19d7=function(_0x22797e,_0x4d58db){_0x22797e=_0x22797e-0x0;var _0x3daee4=_0x9d71[_0x22797e];return _0x3daee4;};'use strict';var multer=require(_0x19d7('0x0'));var util=require(_0x19d7('0x1'));var path=require(_0x19d7('0x2'));var timeout=require(_0x19d7('0x3'));var express=require('express');var router=express[_0x19d7('0x4')]();var fs_extra=require(_0x19d7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x19d7('0x6'));var controller=require('./mailAccount.controller');router[_0x19d7('0x7')]('/',auth[_0x19d7('0x8')](),controller[_0x19d7('0x9')]);router[_0x19d7('0x7')](_0x19d7('0xa'),auth[_0x19d7('0x8')](),controller[_0x19d7('0xb')]);router[_0x19d7('0x7')]('/:id',auth[_0x19d7('0x8')](),controller['show']);router['get'](_0x19d7('0xc'),auth[_0x19d7('0x8')](),controller[_0x19d7('0xd')]);router[_0x19d7('0x7')](_0x19d7('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x19d7('0x7')](_0x19d7('0xf'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x10')]);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x19d7('0x11')]);router[_0x19d7('0x7')](_0x19d7('0x12'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x13')]);router[_0x19d7('0x7')](_0x19d7('0x14'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x15')]);router[_0x19d7('0x7')](_0x19d7('0x16'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x17')]);router[_0x19d7('0x7')](_0x19d7('0x18'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x19')]);router['get'](_0x19d7('0x1a'),auth['isAuthenticated'](),controller[_0x19d7('0x1b')]);router['post'](_0x19d7('0xc'),auth[_0x19d7('0x8')](),controller['addDisposition']);router[_0x19d7('0x1c')](_0x19d7('0xe'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x1d')]);router[_0x19d7('0x1c')]('/',auth['isAuthenticated'](),controller[_0x19d7('0x1e')]);router[_0x19d7('0x1c')](_0x19d7('0xf'),auth['isAuthenticated'](),controller['addImap']);router[_0x19d7('0x1c')](_0x19d7('0x1f'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x20')]);router[_0x19d7('0x1c')](_0x19d7('0x12'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x21')]);router[_0x19d7('0x1c')](_0x19d7('0x14'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x22')]);router[_0x19d7('0x1c')](_0x19d7('0x23'),auth['isAuthenticated'](),controller['send']);router[_0x19d7('0x1c')](_0x19d7('0x1a'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x24')]);router['put'](_0x19d7('0x25'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x26')]);router[_0x19d7('0x27')](_0x19d7('0xc'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x28')]);router[_0x19d7('0x27')](_0x19d7('0xe'),auth[_0x19d7('0x8')](),controller[_0x19d7('0x29')]);router[_0x19d7('0x27')]('/:id/in_servers',auth[_0x19d7('0x8')](),controller['removeImap']);router[_0x19d7('0x27')](_0x19d7('0x1f'),auth['isAuthenticated'](),controller[_0x19d7('0x2a')]);router[_0x19d7('0x27')](_0x19d7('0x25'),auth['isAuthenticated'](),controller[_0x19d7('0x2b')]);router['delete']('/:id/users',auth[_0x19d7('0x8')](),controller['removeAgents']);module[_0x19d7('0x2c')]=router;
\ No newline at end of file
index b53a1cc..adbecb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x294b=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb294('0x0'));module['exports']={'description':{'type':Sequelize[_0xb294('0x1')]},'name':{'type':Sequelize[_0xb294('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xb294('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xb294('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb294('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xb294('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb294('0x1')],'allowNull':![],'defaultValue':_0xb294('0x3')},'fontSize':{'type':Sequelize[_0xb294('0x4')](0x2)[_0xb294('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xb294('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xb294('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb294('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb294('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb294('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb294('0x7'),'set':function(_0x424e5f){if(!_0x424e5f)this[_0xb294('0x8')](_0xb294('0x9'),null);this[_0xb294('0x8')](_0xb294('0xa'),_0x424e5f);}}};
\ No newline at end of file
+var _0x50a6=['exports','BOOLEAN','STRING','TEXT','UNSIGNED','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','sequelize'];(function(_0x16781e,_0x4b3d74){var _0x5b11af=function(_0x2a7081){while(--_0x2a7081){_0x16781e['push'](_0x16781e['shift']());}};_0x5b11af(++_0x4b3d74);}(_0x50a6,0xa4));var _0x650a=function(_0x1b6ae1,_0x7265ae){_0x1b6ae1=_0x1b6ae1-0x0;var _0x5843a2=_0x50a6[_0x1b6ae1];return _0x5843a2;};'use strict';var Sequelize=require(_0x650a('0x0'));module[_0x650a('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x650a('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x650a('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x650a('0x3')],'allowNull':![]},'template':{'type':Sequelize[_0x650a('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x650a('0x3')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x650a('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x650a('0x4')],'defaultValue':function(){return _0x650a('0x6');}},'notificationSound':{'type':Sequelize[_0x650a('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x650a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x650a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x650a('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x650a('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x650a('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x650a('0x9'),'set':function(_0x526881){if(!_0x526881)this[_0x650a('0xa')]('mandatoryDispositionPauseId',null);this[_0x650a('0xa')]('mandatoryDisposition',_0x526881);}}};
\ No newline at end of file
index 3b4adef..35f19e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48ef=['message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','map','MailAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','include','find','body','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','email','ListId','active','description','isNil','cservice','cauthentication','user','cuser','password','pass','authentication','port','host','service','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','MailApplication','findAndCountAll','priority','getApplications','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','List','updatedAt','DESC','from','attachments','join','root','server/files/attachments','basename','auth','SendMail','sendMail','List\x20not\x20found','Contacts','defaults','messageId','subject','out','Interaction','Messages','verifySmtp','secure','VerifySmtp','Sequelize','addAgents','omit','spread','emit','userMailAccount:save','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48ef,0x9d));var _0xf48e=function(_0x2ddf2d,_0x272b8a){_0x2ddf2d=_0x2ddf2d-0x0;var _0x53dd02=_0x48ef[_0x2ddf2d];return _0x53dd02;};'use strict';var emlformat=require(_0xf48e('0x0'));var rimraf=require(_0xf48e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf48e('0x2'));var rp=require(_0xf48e('0x3'));var moment=require('moment');var BPromise=require(_0xf48e('0x4'));var Mustache=require(_0xf48e('0x5'));var util=require(_0xf48e('0x6'));var path=require(_0xf48e('0x7'));var sox=require('sox');var csv=require(_0xf48e('0x8'));var ejs=require(_0xf48e('0x9'));var fs=require('fs');var fs_extra=require(_0xf48e('0xa'));var _=require(_0xf48e('0xb'));var squel=require(_0xf48e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf48e('0xd'));var deskjs=require(_0xf48e('0xe'));var toCsv=require(_0xf48e('0x8'));var querystring=require(_0xf48e('0xf'));var Papa=require(_0xf48e('0x10'));var htmlToText=require(_0xf48e('0x11'));var juice=require(_0xf48e('0x12'));var Redis=require(_0xf48e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf48e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf48e('0x15'));var logger=require(_0xf48e('0x16'))(_0xf48e('0x17'));var utils=require(_0xf48e('0x18'));var config=require(_0xf48e('0x19'));var licenseUtil=require(_0xf48e('0x1a'));var db=require(_0xf48e('0x1b'))['db'];config[_0xf48e('0x1c')]=_['defaults'](config[_0xf48e('0x1c')],{'host':_0xf48e('0x1d'),'port':0x18eb});var socket=require(_0xf48e('0x1e'))(new Redis(config[_0xf48e('0x1c')]));require('./mailAccount.socket')[_0xf48e('0x1f')](socket);var jayson=require(_0xf48e('0x20'));var client=jayson[_0xf48e('0x21')][_0xf48e('0x22')]({'port':0x232b});function respondWithRpcPromise(_0x2f2843,_0xcac067,_0xaff2ef,_0x49bc60){return new BPromise(function(_0x4eb6ef,_0x4c6cda){var _0x180a87=_0x49bc60||client;return _0x180a87[_0xf48e('0x23')](_0x2f2843,_0xaff2ef)[_0xf48e('0x24')](function(_0x51f169){logger[_0xf48e('0x25')](_0xf48e('0x26'),_0xcac067,_0xf48e('0x27'));logger[_0xf48e('0x28')](_0xf48e('0x29'),_0xcac067,_0xf48e('0x27'),JSON[_0xf48e('0x2a')](_0x51f169));if(_0x51f169[_0xf48e('0x2b')]){if(_0x51f169[_0xf48e('0x2b')][_0xf48e('0x2c')]===0x1f4){logger[_0xf48e('0x2b')](_0xf48e('0x26'),_0xcac067,_0x51f169[_0xf48e('0x2b')][_0xf48e('0x2d')]);return _0x4c6cda(_0x51f169['error']['message']);}logger[_0xf48e('0x2b')](_0xf48e('0x26'),_0xcac067,_0x51f169[_0xf48e('0x2b')][_0xf48e('0x2d')]);return _0x4eb6ef(_0x51f169['error'][_0xf48e('0x2d')]);}else{logger[_0xf48e('0x25')](_0xf48e('0x26'),_0xcac067,'request\x20sent');_0x4eb6ef(_0x51f169[_0xf48e('0x2e')][_0xf48e('0x2d')]);}})[_0xf48e('0x2f')](function(_0x36c9fe){logger[_0xf48e('0x2b')](_0xf48e('0x26'),_0xcac067,_0x36c9fe);_0x4c6cda(_0x36c9fe);});});}function respondWithStatusCode(_0x20a964,_0xea533b){_0xea533b=_0xea533b||0xcc;return function(_0x26ee87){if(_0x26ee87){return _0x20a964[_0xf48e('0x30')](_0xea533b);}return _0x20a964['status'](_0xea533b)['end']();};}function respondWithResult(_0x397a3d,_0x386831){_0x386831=_0x386831||0xc8;return function(_0x1e2752){if(_0x1e2752){return _0x397a3d[_0xf48e('0x31')](_0x386831)['json'](_0x1e2752);}};}function respondWithFilteredResult(_0x114bf2,_0x29bad1){return function(_0x1f24e6){if(_0x1f24e6){var _0x51327e=typeof _0x29bad1['offset']===_0xf48e('0x32')&&typeof _0x29bad1[_0xf48e('0x33')]===_0xf48e('0x32');var _0x42ee1d=_0x1f24e6['count'];var _0x279bdc=_0x51327e?0x0:_0x29bad1['offset'];var _0x53d7de=_0x51327e?_0x1f24e6[_0xf48e('0x34')]:_0x29bad1[_0xf48e('0x35')]+_0x29bad1[_0xf48e('0x33')];var _0x51b84c;if(_0x53d7de>=_0x42ee1d){_0x53d7de=_0x42ee1d;_0x51b84c=0xc8;}else{_0x51b84c=0xce;}_0x114bf2[_0xf48e('0x31')](_0x51b84c);return _0x114bf2[_0xf48e('0x36')](_0xf48e('0x37'),_0x279bdc+'-'+_0x53d7de+'/'+_0x42ee1d)['json'](_0x1f24e6);}return null;};}function patchUpdates(_0x533d59){return function(_0x230055){try{jsonpatch[_0xf48e('0x38')](_0x230055,_0x533d59,!![]);}catch(_0x3edfe7){return BPromise[_0xf48e('0x39')](_0x3edfe7);}return _0x230055['save']();};}function saveUpdates(_0x2ea1d5,_0x2d7e16){return function(_0xfec3e2){if(_0xfec3e2){return _0xfec3e2[_0xf48e('0x3a')](_0x2ea1d5)[_0xf48e('0x24')](function(_0xc9b3a){return _0xc9b3a;});}return null;};}function removeEntity(_0x3d29cb,_0x5820ca){return function(_0x541165){if(_0x541165){return _0x541165[_0xf48e('0x3b')]()[_0xf48e('0x24')](function(){var _0x1169a6=_0x541165['get']({'plain':!![]});var _0x543b51=_0xf48e('0x3c');return db[_0xf48e('0x3d')][_0xf48e('0x3b')]({'where':{'type':_0x543b51,'resourceId':_0x1169a6['id']}})[_0xf48e('0x24')](function(){return _0x541165;});})[_0xf48e('0x24')](function(){_0x3d29cb[_0xf48e('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ba3d,_0x1473fd){return function(_0x2d7ada){if(!_0x2d7ada){_0x15ba3d['sendStatus'](0x194);}return _0x2d7ada;};}function handleError(_0xcaa7d6,_0x4b5f14){_0x4b5f14=_0x4b5f14||0x1f4;return function(_0x345936){logger[_0xf48e('0x2b')](_0x345936[_0xf48e('0x3e')]);if(_0x345936[_0xf48e('0x3f')]){delete _0x345936[_0xf48e('0x3f')];}_0xcaa7d6['status'](_0x4b5f14)[_0xf48e('0x40')](_0x345936);};}exports[_0xf48e('0x41')]=function(_0x5d2249,_0x2fb4c9){var _0x57fcb8={'include':[{'model':db[_0xf48e('0x42')],'as':_0xf48e('0x43')},{'model':db[_0xf48e('0x44')],'as':_0xf48e('0x45')},{'model':db[_0xf48e('0x46')],'as':'mandatoryDispositionPause'}]},_0xec4b3f={},_0x52b25b={'count':0x0,'rows':[]};var _0x1fb4dd=_[_0xf48e('0x47')](db[_0xf48e('0x48')][_0xf48e('0x49')],function(_0x40c379){return{'name':_0x40c379[_0xf48e('0x4a')],'type':_0x40c379[_0xf48e('0x4b')]['key']};});_0xec4b3f[_0xf48e('0x4c')]=_[_0xf48e('0x47')](_0x1fb4dd,_0xf48e('0x3f'));_0xec4b3f['query']=_[_0xf48e('0x4d')](_0x5d2249[_0xf48e('0x4e')]);_0xec4b3f[_0xf48e('0x4f')]=_[_0xf48e('0x50')](_0xec4b3f[_0xf48e('0x4c')],_0xec4b3f['query']);_0x57fcb8[_0xf48e('0x51')]=_[_0xf48e('0x50')](_0xec4b3f[_0xf48e('0x4c')],qs[_0xf48e('0x52')](_0x5d2249['query']['fields']));_0x57fcb8[_0xf48e('0x51')]=_0x57fcb8[_0xf48e('0x51')][_0xf48e('0x53')]?_0x57fcb8['attributes']:_0xec4b3f[_0xf48e('0x4c')];if(!_0x5d2249[_0xf48e('0x4e')][_0xf48e('0x54')](_0xf48e('0x55'))){_0x57fcb8['limit']=qs[_0xf48e('0x33')](_0x5d2249[_0xf48e('0x4e')][_0xf48e('0x33')]);_0x57fcb8[_0xf48e('0x35')]=qs[_0xf48e('0x35')](_0x5d2249[_0xf48e('0x4e')]['offset']);}_0x57fcb8[_0xf48e('0x56')]=qs[_0xf48e('0x57')](_0x5d2249[_0xf48e('0x4e')]['sort']);_0x57fcb8[_0xf48e('0x58')]=qs[_0xf48e('0x4f')](_['pick'](_0x5d2249['query'],_0xec4b3f['filters']),_0x1fb4dd);if(_0x5d2249[_0xf48e('0x4e')][_0xf48e('0x59')]){_0x57fcb8[_0xf48e('0x58')]=_[_0xf48e('0x5a')](_0x57fcb8[_0xf48e('0x58')],{'$or':_[_0xf48e('0x47')](_0x1fb4dd,function(_0x4e36cb){if(_0x4e36cb[_0xf48e('0x4b')]!==_0xf48e('0x5b')){var _0x52cafb={};_0x52cafb[_0x4e36cb[_0xf48e('0x3f')]]={'$like':'%'+_0x5d2249[_0xf48e('0x4e')][_0xf48e('0x59')]+'%'};return _0x52cafb;}})});}_0x57fcb8=_[_0xf48e('0x5a')]({},_0x57fcb8,_0x5d2249[_0xf48e('0x5c')]);var _0x242817={'where':_0x57fcb8[_0xf48e('0x58')]};return db[_0xf48e('0x48')]['count'](_0x242817)[_0xf48e('0x24')](function(_0x9aa680){_0x52b25b[_0xf48e('0x34')]=_0x9aa680;if(_0x5d2249[_0xf48e('0x4e')][_0xf48e('0x5d')]){_0x57fcb8['include']=[{'all':!![]}];}return db[_0xf48e('0x48')][_0xf48e('0x5e')](_0x57fcb8);})[_0xf48e('0x24')](function(_0x40ffe9){_0x52b25b[_0xf48e('0x5f')]=_0x40ffe9;return _0x52b25b;})[_0xf48e('0x24')](respondWithFilteredResult(_0x2fb4c9,_0x57fcb8))[_0xf48e('0x2f')](handleError(_0x2fb4c9,null));};exports[_0xf48e('0x60')]=function(_0x4e794a,_0x245d9d){var _0x33cd47={'raw':![],'where':{'id':_0x4e794a[_0xf48e('0x61')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xf48e('0x45')},{'model':db[_0xf48e('0x46')],'as':_0xf48e('0x62')}]},_0x258e28={};_0x258e28[_0xf48e('0x4c')]=_[_0xf48e('0x4d')](db[_0xf48e('0x48')][_0xf48e('0x49')]);_0x258e28[_0xf48e('0x4e')]=_['keys'](_0x4e794a[_0xf48e('0x4e')]);_0x258e28[_0xf48e('0x4f')]=_['intersection'](_0x258e28[_0xf48e('0x4c')],_0x258e28[_0xf48e('0x4e')]);_0x33cd47[_0xf48e('0x51')]=_[_0xf48e('0x50')](_0x258e28[_0xf48e('0x4c')],qs['fields'](_0x4e794a[_0xf48e('0x4e')][_0xf48e('0x52')]));_0x33cd47[_0xf48e('0x51')]=_0x33cd47['attributes'][_0xf48e('0x53')]?_0x33cd47[_0xf48e('0x51')]:_0x258e28[_0xf48e('0x4c')];if(_0x4e794a['query'][_0xf48e('0x5d')]){_0x33cd47[_0xf48e('0x63')]=[{'all':!![]}];}_0x33cd47=_[_0xf48e('0x5a')]({},_0x33cd47,_0x4e794a[_0xf48e('0x5c')]);return db[_0xf48e('0x48')][_0xf48e('0x64')](_0x33cd47)['then'](handleEntityNotFound(_0x245d9d,null))[_0xf48e('0x24')](respondWithResult(_0x245d9d,null))[_0xf48e('0x2f')](handleError(_0x245d9d,null));};exports[_0xf48e('0x3a')]=function(_0x421cef,_0x5b3849){if(_0x421cef[_0xf48e('0x65')]['id']){delete _0x421cef['body']['id'];}return db[_0xf48e('0x48')][_0xf48e('0x64')]({'where':{'id':_0x421cef['params']['id']},'include':[{'model':db[_0xf48e('0x42')],'as':_0xf48e('0x43')},{'model':db[_0xf48e('0x44')],'as':_0xf48e('0x45')},{'model':db[_0xf48e('0x46')],'as':_0xf48e('0x62')}]})[_0xf48e('0x24')](handleEntityNotFound(_0x5b3849,null))[_0xf48e('0x24')](saveUpdates(_0x421cef['body'],null))['then'](function(_0x12d0ab){if(_0x12d0ab&&_0x421cef[_0xf48e('0x65')][_0xf48e('0x43')]){return db[_0xf48e('0x42')][_0xf48e('0x3a')](_0x421cef[_0xf48e('0x65')][_0xf48e('0x43')],{'where':{'MailAccountId':_0x12d0ab['id']}})[_0xf48e('0x24')](function(){return _0x12d0ab;});}return _0x12d0ab;})[_0xf48e('0x24')](function(_0x2e910b){if(_0x2e910b&&_0x421cef[_0xf48e('0x65')]['Smtp']){return db[_0xf48e('0x44')][_0xf48e('0x3a')](_0x421cef[_0xf48e('0x65')][_0xf48e('0x45')],{'where':{'MailAccountId':_0x2e910b['id']}})[_0xf48e('0x24')](function(){return _0x2e910b;});}return _0x2e910b;})[_0xf48e('0x24')](respondWithResult(_0x5b3849,null))[_0xf48e('0x2f')](handleError(_0x5b3849,null));};exports['describe']=function(_0x587207,_0x1e50aa){return db[_0xf48e('0x48')]['describe']()[_0xf48e('0x24')](respondWithResult(_0x1e50aa,null))[_0xf48e('0x2f')](handleError(_0x1e50aa,null));};exports[_0xf48e('0x66')]=function(_0x1e7fdc,_0x1991c9,_0x24cb91){if(_0x1e7fdc[_0xf48e('0x65')]['id']){delete _0x1e7fdc[_0xf48e('0x65')]['id'];}return db[_0xf48e('0x48')]['find']({'where':{'id':_0x1e7fdc[_0xf48e('0x61')]['id']}})['then'](handleEntityNotFound(_0x1991c9,null))[_0xf48e('0x24')](function(_0x4e59d3){if(_0x4e59d3){_0x1e7fdc[_0xf48e('0x65')][_0xf48e('0x67')]=_0x4e59d3['id'];return db[_0xf48e('0x68')][_0xf48e('0x69')](_0x1e7fdc[_0xf48e('0x65')]);}})[_0xf48e('0x24')](respondWithResult(_0x1991c9,null))[_0xf48e('0x2f')](handleError(_0x1991c9,null));};exports[_0xf48e('0x6a')]=function(_0x430d95,_0x515b17,_0x9cc023){var _0x3a4490={'raw':![],'where':{}};var _0x9b2f91={};var _0x26d1a5={'count':0x0,'rows':[]};return db[_0xf48e('0x48')][_0xf48e('0x6b')]({'where':{'id':_0x430d95[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x515b17,null))[_0xf48e('0x24')](function(_0x5c5467){if(_0x5c5467){_0x9b2f91['model']=_[_0xf48e('0x4d')](db[_0xf48e('0x68')]['rawAttributes']);_0x9b2f91[_0xf48e('0x4e')]=_[_0xf48e('0x4d')](_0x430d95[_0xf48e('0x4e')]);_0x9b2f91[_0xf48e('0x4f')]=_[_0xf48e('0x50')](_0x9b2f91['model'],_0x9b2f91['query']);_0x3a4490['attributes']=_[_0xf48e('0x50')](_0x9b2f91[_0xf48e('0x4c')],qs[_0xf48e('0x52')](_0x430d95[_0xf48e('0x4e')][_0xf48e('0x52')]));_0x3a4490['attributes']=_0x3a4490[_0xf48e('0x51')][_0xf48e('0x53')]?_0x3a4490[_0xf48e('0x51')]:_0x9b2f91[_0xf48e('0x4c')];if(!_0x430d95['query'][_0xf48e('0x54')](_0xf48e('0x55'))){_0x3a4490[_0xf48e('0x33')]=qs[_0xf48e('0x33')](_0x430d95[_0xf48e('0x4e')][_0xf48e('0x33')]);_0x3a4490['offset']=qs[_0xf48e('0x35')](_0x430d95[_0xf48e('0x4e')][_0xf48e('0x35')]);}_0x3a4490[_0xf48e('0x56')]=qs['sort'](_0x430d95[_0xf48e('0x4e')][_0xf48e('0x57')]);_0x3a4490[_0xf48e('0x58')]=qs[_0xf48e('0x4f')](_[_0xf48e('0x6c')](_0x430d95['query'],_0x9b2f91['filters']));_0x3a4490['where'][_0xf48e('0x67')]=_0x5c5467['id'];if(_0x430d95[_0xf48e('0x4e')]['filter']){_0x3a4490[_0xf48e('0x58')]=_[_0xf48e('0x5a')](_0x3a4490[_0xf48e('0x58')],{'$or':_[_0xf48e('0x47')](_0x3a4490[_0xf48e('0x51')],function(_0x333ba5){var _0x270af2={};_0x270af2[_0x333ba5]={'$like':'%'+_0x430d95[_0xf48e('0x4e')][_0xf48e('0x59')]+'%'};return _0x270af2;})});}_0x3a4490=_[_0xf48e('0x5a')]({},_0x3a4490,_0x430d95[_0xf48e('0x5c')]);return db[_0xf48e('0x68')][_0xf48e('0x34')]({'where':_0x3a4490['where']})['then'](function(_0x4cc5f1){_0x26d1a5[_0xf48e('0x34')]=_0x4cc5f1;if(_0x430d95[_0xf48e('0x4e')][_0xf48e('0x5d')]){_0x3a4490[_0xf48e('0x63')]=[{'all':!![]}];}return db[_0xf48e('0x68')]['findAll'](_0x3a4490);})[_0xf48e('0x24')](function(_0xb931f3){_0x26d1a5[_0xf48e('0x5f')]=_0xb931f3;return _0x26d1a5;});}})[_0xf48e('0x24')](respondWithFilteredResult(_0x515b17,_0x3a4490))[_0xf48e('0x2f')](handleError(_0x515b17,null));};exports[_0xf48e('0x6d')]=function(_0x58dfe9,_0x137395,_0x3e394c){return db['MailAccount'][_0xf48e('0x64')]({'where':{'id':_0x58dfe9['params']['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x137395,null))[_0xf48e('0x24')](function(_0x50fbbc){if(_0x50fbbc){return _0x50fbbc[_0xf48e('0x6d')](_0x58dfe9['query'][_0xf48e('0x6e')]);}})[_0xf48e('0x24')](respondWithStatusCode(_0x137395,null))['catch'](handleError(_0x137395,null));};exports[_0xf48e('0x6f')]=function(_0x34637c,_0xd35aac,_0x1d56f1){if(_0x34637c[_0xf48e('0x65')]['id']){delete _0x34637c[_0xf48e('0x65')]['id'];}return db['MailAccount'][_0xf48e('0x64')]({'where':{'id':_0x34637c[_0xf48e('0x61')]['id']}})['then'](handleEntityNotFound(_0xd35aac,null))['then'](function(_0x16cd67){if(_0x16cd67){_0x34637c[_0xf48e('0x65')][_0xf48e('0x67')]=_0x16cd67['id'];return db[_0xf48e('0x70')][_0xf48e('0x69')](_0x34637c[_0xf48e('0x65')]);}})[_0xf48e('0x24')](respondWithResult(_0xd35aac,null))['catch'](handleError(_0xd35aac,null));};exports[_0xf48e('0x71')]=function(_0x381440,_0x4edc05,_0x5c1b50){var _0xe2a7b8={'raw':![],'where':{}};var _0x378b91={};var _0x18ebef={'count':0x0,'rows':[]};return db[_0xf48e('0x48')][_0xf48e('0x6b')]({'where':{'id':_0x381440[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x4edc05,null))['then'](function(_0x58277b){if(_0x58277b){_0x378b91[_0xf48e('0x4c')]=_[_0xf48e('0x4d')](db['CannedAnswer'][_0xf48e('0x49')]);_0x378b91[_0xf48e('0x4e')]=_['keys'](_0x381440[_0xf48e('0x4e')]);_0x378b91[_0xf48e('0x4f')]=_[_0xf48e('0x50')](_0x378b91['model'],_0x378b91[_0xf48e('0x4e')]);_0xe2a7b8['attributes']=_[_0xf48e('0x50')](_0x378b91['model'],qs[_0xf48e('0x52')](_0x381440[_0xf48e('0x4e')][_0xf48e('0x52')]));_0xe2a7b8[_0xf48e('0x51')]=_0xe2a7b8[_0xf48e('0x51')][_0xf48e('0x53')]?_0xe2a7b8['attributes']:_0x378b91[_0xf48e('0x4c')];if(!_0x381440['query'][_0xf48e('0x54')]('nolimit')){_0xe2a7b8[_0xf48e('0x33')]=qs['limit'](_0x381440['query'][_0xf48e('0x33')]);_0xe2a7b8[_0xf48e('0x35')]=qs[_0xf48e('0x35')](_0x381440[_0xf48e('0x4e')][_0xf48e('0x35')]);}_0xe2a7b8[_0xf48e('0x56')]=qs[_0xf48e('0x57')](_0x381440[_0xf48e('0x4e')]['sort']);_0xe2a7b8[_0xf48e('0x58')]=qs[_0xf48e('0x4f')](_['pick'](_0x381440[_0xf48e('0x4e')],_0x378b91['filters']));_0xe2a7b8['where'][_0xf48e('0x67')]=_0x58277b['id'];if(_0x381440[_0xf48e('0x4e')]['filter']){_0xe2a7b8['where']=_[_0xf48e('0x5a')](_0xe2a7b8[_0xf48e('0x58')],{'$or':_[_0xf48e('0x47')](_0xe2a7b8[_0xf48e('0x51')],function(_0x4c4508){var _0x5ebd65={};_0x5ebd65[_0x4c4508]={'$like':'%'+_0x381440[_0xf48e('0x4e')][_0xf48e('0x59')]+'%'};return _0x5ebd65;})});}_0xe2a7b8=_[_0xf48e('0x5a')]({},_0xe2a7b8,_0x381440[_0xf48e('0x5c')]);return db[_0xf48e('0x70')][_0xf48e('0x34')]({'where':_0xe2a7b8[_0xf48e('0x58')]})[_0xf48e('0x24')](function(_0x46fe29){_0x18ebef[_0xf48e('0x34')]=_0x46fe29;if(_0x381440['query'][_0xf48e('0x5d')]){_0xe2a7b8['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0xe2a7b8);})[_0xf48e('0x24')](function(_0x1a91ce){_0x18ebef[_0xf48e('0x5f')]=_0x1a91ce;return _0x18ebef;});}})[_0xf48e('0x24')](respondWithFilteredResult(_0x4edc05,_0xe2a7b8))[_0xf48e('0x2f')](handleError(_0x4edc05,null));};exports['removeAnswers']=function(_0x310eba,_0x522af7,_0x9c089f){return db[_0xf48e('0x48')][_0xf48e('0x64')]({'where':{'id':_0x310eba[_0xf48e('0x61')]['id']}})['then'](handleEntityNotFound(_0x522af7,null))[_0xf48e('0x24')](function(_0x3dfe7e){if(_0x3dfe7e){return _0x3dfe7e[_0xf48e('0x72')](_0x310eba[_0xf48e('0x4e')]['ids']);}})[_0xf48e('0x24')](respondWithStatusCode(_0x522af7,null))[_0xf48e('0x2f')](handleError(_0x522af7,null));};exports['create']=function(_0x516e69,_0x24e209){var _0x2c6ece={'name':_0x516e69[_0xf48e('0x65')][_0xf48e('0x3f')],'key':_0x516e69[_0xf48e('0x65')][_0xf48e('0x73')],'email':_0x516e69['body'][_0xf48e('0x74')],'ListId':_0x516e69[_0xf48e('0x65')][_0xf48e('0x75')],'active':!_['isNil'](_0x516e69['body'][_0xf48e('0x76')])?_0x516e69[_0xf48e('0x65')][_0xf48e('0x76')]:!![],'description':_0x516e69[_0xf48e('0x65')][_0xf48e('0x77')]||null,'Imap':{},'Smtp':{}};if(_[_0xf48e('0x78')](_0x516e69[_0xf48e('0x65')][_0xf48e('0x79')])){if(_0x516e69[_0xf48e('0x65')][_0xf48e('0x7a')]){_0x2c6ece[_0xf48e('0x43')][_0xf48e('0x7b')]=_0x2c6ece[_0xf48e('0x45')][_0xf48e('0x7b')]=_0x516e69[_0xf48e('0x65')][_0xf48e('0x7c')];_0x2c6ece[_0xf48e('0x43')][_0xf48e('0x7d')]=_0x2c6ece[_0xf48e('0x45')][_0xf48e('0x7e')]=_0x516e69[_0xf48e('0x65')]['cpassword'];}else{_0x2c6ece['Imap'][_0xf48e('0x7f')]=_0x2c6ece[_0xf48e('0x45')]['authentication']=![];}_0x2c6ece[_0xf48e('0x43')]['host']=_0x516e69[_0xf48e('0x65')][_0xf48e('0x43')]['host'];_0x2c6ece['Imap'][_0xf48e('0x80')]=_0x516e69['body'][_0xf48e('0x43')][_0xf48e('0x80')];_0x2c6ece[_0xf48e('0x45')][_0xf48e('0x81')]=_0x516e69[_0xf48e('0x65')][_0xf48e('0x45')][_0xf48e('0x81')];_0x2c6ece['Smtp']['port']=_0x516e69[_0xf48e('0x65')]['Smtp'][_0xf48e('0x80')];}else{_0x2c6ece[_0xf48e('0x43')][_0xf48e('0x82')]=_0x2c6ece['Smtp']['service']=_0x516e69['body'][_0xf48e('0x79')];_0x2c6ece['Imap'][_0xf48e('0x7b')]=_0x2c6ece[_0xf48e('0x45')][_0xf48e('0x7b')]=_0x516e69[_0xf48e('0x65')][_0xf48e('0x7c')];_0x2c6ece['Imap']['password']=_0x2c6ece[_0xf48e('0x45')][_0xf48e('0x7e')]=_0x516e69[_0xf48e('0x65')][_0xf48e('0x83')];}return db['MailAccount']['create'](_0x2c6ece,{'include':[{'model':db[_0xf48e('0x44')],'as':_0xf48e('0x45')},{'model':db['MailServerIn'],'as':'Imap'}]})['then'](function(_0x280167){var _0x39a8c2=_0x516e69[_0xf48e('0x7b')][_0xf48e('0x84')]({'plain':!![]});if(!_0x39a8c2)throw new Error(_0xf48e('0x85'));if(_0x39a8c2[_0xf48e('0x86')]==='user'){var _0x251867=_0x280167[_0xf48e('0x84')]({'plain':!![]});return db['UserProfileSection'][_0xf48e('0x64')]({'where':{'name':_0xf48e('0x3c'),'userProfileId':_0x39a8c2[_0xf48e('0x87')]},'raw':!![]})[_0xf48e('0x24')](function(_0x2f0284){if(_0x2f0284&&_0x2f0284[_0xf48e('0x88')]===0x0){return db['UserProfileResource']['create']({'name':_0x251867[_0xf48e('0x3f')],'resourceId':_0x251867['id'],'type':_0x2f0284[_0xf48e('0x3f')],'sectionId':_0x2f0284['id']},{})[_0xf48e('0x24')](function(){return _0x280167;});}else{return _0x280167;}})[_0xf48e('0x2f')](function(_0x5830ef){logger[_0xf48e('0x2b')](_0xf48e('0x89'),_0x5830ef);throw _0x5830ef;});}return _0x280167;})[_0xf48e('0x24')](respondWithResult(_0x24e209,0xc9))['catch'](handleError(_0x24e209,null));};exports[_0xf48e('0x8a')]=function(_0x2acb6a,_0x19d713,_0x4b0945){return db['MailAccount'][_0xf48e('0x6b')]({'where':{'id':_0x2acb6a[_0xf48e('0x61')]['id']}})['then'](handleEntityNotFound(_0x19d713,null))[_0xf48e('0x24')](function(_0x52c4b9){if(_0x52c4b9){return _0x52c4b9['getImap']();}return null;})['then'](respondWithResult(_0x19d713,null))['catch'](handleError(_0x19d713,null));};exports[_0xf48e('0x8b')]=function(_0x462058,_0x138bc2,_0x42f52a){if(_0x462058['body']['id']){delete _0x462058['body']['id'];}return db['MailAccount'][_0xf48e('0x64')]({'where':{'id':_0x462058[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x138bc2,null))[_0xf48e('0x24')](function(_0x2f4263){if(_0x2f4263){_0x462058[_0xf48e('0x65')][_0xf48e('0x67')]=_0x2f4263['id'];return db[_0xf48e('0x42')][_0xf48e('0x69')](_0x462058['body']);}})['then'](respondWithResult(_0x138bc2,null))[_0xf48e('0x2f')](handleError(_0x138bc2,null));};exports[_0xf48e('0x8c')]=function(_0x12966c,_0x1c0a75,_0xbe7369){return db[_0xf48e('0x48')][_0xf48e('0x6b')]({'where':{'id':_0x12966c['params']['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x1c0a75,null))[_0xf48e('0x24')](function(_0x5c9739){if(_0x5c9739){return _0x5c9739[_0xf48e('0x8d')](null);}return null;})['then'](respondWithStatusCode(_0x1c0a75,null))['catch'](handleError(_0x1c0a75,null));};exports['getSmtp']=function(_0x10c39e,_0x21f398,_0x37433f){return db[_0xf48e('0x48')]['findOne']({'where':{'id':_0x10c39e[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x21f398,null))[_0xf48e('0x24')](function(_0x28c984){if(_0x28c984){return _0x28c984[_0xf48e('0x8e')]();}return null;})[_0xf48e('0x24')](respondWithResult(_0x21f398,null))[_0xf48e('0x2f')](handleError(_0x21f398,null));};exports[_0xf48e('0x8f')]=function(_0x29c3ad,_0x123805,_0x2c5e6b){if(_0x29c3ad[_0xf48e('0x65')]['id']){delete _0x29c3ad['body']['id'];}return db['MailAccount'][_0xf48e('0x64')]({'where':{'id':_0x29c3ad[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x123805,null))['then'](function(_0x3ecd69){if(_0x3ecd69){_0x29c3ad[_0xf48e('0x65')][_0xf48e('0x67')]=_0x3ecd69['id'];return db[_0xf48e('0x44')][_0xf48e('0x69')](_0x29c3ad[_0xf48e('0x65')]);}})[_0xf48e('0x24')](respondWithResult(_0x123805,null))['catch'](handleError(_0x123805,null));};exports[_0xf48e('0x90')]=function(_0x518413,_0x2e77ab,_0x23f79f){return db[_0xf48e('0x48')][_0xf48e('0x6b')]({'where':{'id':_0x518413[_0xf48e('0x61')]['id']}})['then'](handleEntityNotFound(_0x2e77ab,null))[_0xf48e('0x24')](function(_0x509fb9){if(_0x509fb9){return _0x509fb9[_0xf48e('0x91')](null);}return null;})['then'](respondWithStatusCode(_0x2e77ab,null))[_0xf48e('0x2f')](handleError(_0x2e77ab,null));};exports[_0xf48e('0x92')]=function(_0x1a4b35,_0x15f4bd,_0xbdcb31){return db[_0xf48e('0x93')][_0xf48e('0x64')]({'where':{'id':_0x1a4b35[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x15f4bd,null))[_0xf48e('0x24')](function(_0x43ce54){if(_0x43ce54){return _0x43ce54[_0xf48e('0x92')](_0x1a4b35[_0xf48e('0x65')][_0xf48e('0x6e')],_['omit'](_0x1a4b35[_0xf48e('0x65')],['ids','id'])||{});}})['then'](respondWithResult(_0x15f4bd,null))['catch'](handleError(_0x15f4bd,null));};exports[_0xf48e('0x94')]=function(_0x55d0f4,_0x206432,_0x33aecc){var _0x5d4cfd={'raw':![],'where':{}};var _0x54cd6f={};var _0x104d15={'count':0x0,'rows':[]};return db[_0xf48e('0x48')][_0xf48e('0x6b')]({'where':{'id':_0x55d0f4[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x206432,null))[_0xf48e('0x24')](function(_0x169f44){if(_0x169f44){_0x54cd6f[_0xf48e('0x4c')]=_[_0xf48e('0x4d')](db[_0xf48e('0x93')][_0xf48e('0x49')]);_0x54cd6f[_0xf48e('0x4e')]=_['keys'](_0x55d0f4['query']);_0x54cd6f[_0xf48e('0x4f')]=_[_0xf48e('0x50')](_0x54cd6f[_0xf48e('0x4c')],_0x54cd6f[_0xf48e('0x4e')]);_0x5d4cfd[_0xf48e('0x51')]=_[_0xf48e('0x50')](_0x54cd6f[_0xf48e('0x4c')],qs['fields'](_0x55d0f4[_0xf48e('0x4e')][_0xf48e('0x52')]));_0x5d4cfd[_0xf48e('0x51')]=_0x5d4cfd[_0xf48e('0x51')][_0xf48e('0x53')]?_0x5d4cfd[_0xf48e('0x51')]:_0x54cd6f['model'];if(!_0x55d0f4['query'][_0xf48e('0x54')](_0xf48e('0x55'))){_0x5d4cfd[_0xf48e('0x33')]=qs['limit'](_0x55d0f4[_0xf48e('0x4e')]['limit']);_0x5d4cfd[_0xf48e('0x35')]=qs[_0xf48e('0x35')](_0x55d0f4['query'][_0xf48e('0x35')]);}_0x5d4cfd[_0xf48e('0x56')]=qs[_0xf48e('0x57')](_0x55d0f4[_0xf48e('0x4e')][_0xf48e('0x57')]);_0x5d4cfd[_0xf48e('0x58')]=qs[_0xf48e('0x4f')](_['pick'](_0x55d0f4[_0xf48e('0x4e')],_0x54cd6f['filters']));_0x5d4cfd[_0xf48e('0x58')][_0xf48e('0x67')]=_0x169f44['id'];if(_0x55d0f4[_0xf48e('0x4e')][_0xf48e('0x59')]){_0x5d4cfd[_0xf48e('0x58')]=_['merge'](_0x5d4cfd[_0xf48e('0x58')],{'$or':_[_0xf48e('0x47')](_0x5d4cfd[_0xf48e('0x51')],function(_0x1774e4){var _0x437582={};_0x437582[_0x1774e4]={'$like':'%'+_0x55d0f4[_0xf48e('0x4e')][_0xf48e('0x59')]+'%'};return _0x437582;})});}_0x5d4cfd=_['merge']({},_0x5d4cfd,_0x55d0f4[_0xf48e('0x5c')]);return db['MailInteraction'][_0xf48e('0x34')]({'where':_0x5d4cfd['where']})[_0xf48e('0x24')](function(_0x1293e1){_0x104d15[_0xf48e('0x34')]=_0x1293e1;if(_0x55d0f4['query'][_0xf48e('0x5d')]){_0x5d4cfd[_0xf48e('0x63')]=[{'model':db[_0xf48e('0x95')],'as':_0xf48e('0x96'),'required':![]},{'model':db[_0xf48e('0x97')],'as':_0xf48e('0x98'),'attributes':[_0xf48e('0x3f'),_0xf48e('0x99'),_0xf48e('0x9a')],'required':![]},{'model':db['Tag'],'as':_0xf48e('0x9b'),'attributes':['id',_0xf48e('0x3f'),_0xf48e('0x9c')],'where':_0x55d0f4['query'][_0xf48e('0x9d')]?{'id':_0x55d0f4['query'][_0xf48e('0x9d')]}:undefined,'required':_0x55d0f4[_0xf48e('0x4e')][_0xf48e('0x9d')]?!![]:![]}];}return db[_0xf48e('0x93')]['findAll'](_0x5d4cfd);})[_0xf48e('0x24')](function(_0x4f2fb2){_0x104d15['rows']=_0x4f2fb2;return _0x104d15;});}})[_0xf48e('0x24')](respondWithFilteredResult(_0x206432,_0x5d4cfd))[_0xf48e('0x2f')](handleError(_0x206432,null));};exports[_0xf48e('0x9e')]=function(_0xd93e07,_0x19f3b2,_0x41dfb7){return db[_0xf48e('0x48')][_0xf48e('0x6b')]({'where':{'id':_0xd93e07[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x19f3b2,null))['then'](function(_0x308516){if(_0x308516){return db['sequelize']['transaction'](function(_0x28a280){return db[_0xf48e('0x9f')][_0xf48e('0x3b')]({'where':{'MailAccountId':_0xd93e07[_0xf48e('0x61')]['id']},'transaction':_0x28a280})[_0xf48e('0x24')](function(_0x281c25){var _0x1567d4=_['map'](_0xd93e07[_0xf48e('0x65')],function(_0x2c84ce){_0x2c84ce[_0xf48e('0x67')]=_0xd93e07[_0xf48e('0x61')]['id'];return _0x2c84ce;});return db['MailApplication']['bulkCreate'](_0x1567d4,{'transaction':_0x28a280});});})['then'](function(){return db[_0xf48e('0x9f')][_0xf48e('0xa0')]({'where':{'MailAccountId':_0xd93e07[_0xf48e('0x61')]['id']},'order':_0xf48e('0xa1')});});}})[_0xf48e('0x24')](respondWithResult(_0x19f3b2,null))['catch'](handleError(_0x19f3b2,null));};exports[_0xf48e('0xa2')]=function(_0x267f1b,_0xda6ffc,_0x5168fc){var _0x433820={};var _0xac4d3c={};var _0x519135;var _0xaab459;return db['MailAccount']['findOne']({'where':{'id':_0x267f1b['params']['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0xda6ffc,null))[_0xf48e('0x24')](function(_0x1199b4){if(_0x1199b4){_0x519135=_0x1199b4;_0xac4d3c[_0xf48e('0x4c')]=_[_0xf48e('0x4d')](db[_0xf48e('0x9f')][_0xf48e('0x49')]);_0xac4d3c[_0xf48e('0x4e')]=_['keys'](_0x267f1b['query']);_0xac4d3c[_0xf48e('0x4f')]=_[_0xf48e('0x50')](_0xac4d3c[_0xf48e('0x4c')],_0xac4d3c['query']);_0x433820[_0xf48e('0x51')]=_[_0xf48e('0x50')](_0xac4d3c[_0xf48e('0x4c')],qs[_0xf48e('0x52')](_0x267f1b[_0xf48e('0x4e')][_0xf48e('0x52')]));_0x433820['attributes']=_0x433820['attributes'][_0xf48e('0x53')]?_0x433820[_0xf48e('0x51')]:_0xac4d3c[_0xf48e('0x4c')];_0x433820[_0xf48e('0x56')]=qs[_0xf48e('0x57')](_0x267f1b['query'][_0xf48e('0x57')]);_0x433820[_0xf48e('0x58')]=qs[_0xf48e('0x4f')](_[_0xf48e('0x6c')](_0x267f1b[_0xf48e('0x4e')],_0xac4d3c[_0xf48e('0x4f')]));if(_0x267f1b[_0xf48e('0x4e')][_0xf48e('0x59')]){_0x433820['where']=_['merge'](_0x433820[_0xf48e('0x58')],{'$or':_[_0xf48e('0x47')](_0x433820['attributes'],function(_0x3e092d){var _0x30a24a={};_0x30a24a[_0x3e092d]={'$like':'%'+_0x267f1b[_0xf48e('0x4e')][_0xf48e('0x59')]+'%'};return _0x30a24a;})});}_0x433820=_[_0xf48e('0x5a')]({},_0x433820,_0x267f1b['options']);return _0x519135[_0xf48e('0xa2')](_0x433820);}})[_0xf48e('0x24')](function(_0xa204ce){if(_0xa204ce){_0xaab459=_0xa204ce['length'];if(!_0x267f1b[_0xf48e('0x4e')][_0xf48e('0x54')](_0xf48e('0x55'))){_0x433820['limit']=qs['limit'](_0x267f1b[_0xf48e('0x4e')][_0xf48e('0x33')]);_0x433820['offset']=qs['offset'](_0x267f1b['query'][_0xf48e('0x35')]);}return _0x519135[_0xf48e('0xa2')](_0x433820);}})[_0xf48e('0x24')](function(_0x3a6f5c){if(_0x3a6f5c){return _0x3a6f5c?{'count':_0xaab459,'rows':_0x3a6f5c}:null;}})[_0xf48e('0x24')](respondWithResult(_0xda6ffc,null))[_0xf48e('0x2f')](handleError(_0xda6ffc,null));};exports['getMessages']=function(_0x32ff16,_0x1bd2b6,_0x28009d){var _0x283c41={'raw':!![],'where':{}};var _0x577864={};var _0x1b7248={'count':0x0,'rows':[]};return db[_0xf48e('0x48')][_0xf48e('0x6b')]({'where':{'id':_0x32ff16[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x1bd2b6,null))[_0xf48e('0x24')](function(_0x3aff1b){if(_0x3aff1b){_0x577864[_0xf48e('0x4c')]=_['keys'](db['MailMessage']['rawAttributes']);_0x577864[_0xf48e('0x4e')]=_[_0xf48e('0x4d')](_0x32ff16[_0xf48e('0x4e')]);_0x577864[_0xf48e('0x4f')]=_[_0xf48e('0x50')](_0x577864[_0xf48e('0x4c')],_0x577864['query']);_0x283c41['attributes']=_['intersection'](_0x577864['model'],qs[_0xf48e('0x52')](_0x32ff16[_0xf48e('0x4e')][_0xf48e('0x52')]));_0x283c41['attributes']=_0x283c41[_0xf48e('0x51')]['length']?_0x283c41[_0xf48e('0x51')]:_0x577864[_0xf48e('0x4c')];if(!_0x32ff16[_0xf48e('0x4e')][_0xf48e('0x54')](_0xf48e('0x55'))){_0x283c41[_0xf48e('0x33')]=qs[_0xf48e('0x33')](_0x32ff16[_0xf48e('0x4e')][_0xf48e('0x33')]);_0x283c41[_0xf48e('0x35')]=qs[_0xf48e('0x35')](_0x32ff16['query'][_0xf48e('0x35')]);}_0x283c41[_0xf48e('0x56')]=qs['sort'](_0x32ff16['query'][_0xf48e('0x57')]);_0x283c41[_0xf48e('0x58')]=qs[_0xf48e('0x4f')](_[_0xf48e('0x6c')](_0x32ff16[_0xf48e('0x4e')],_0x577864['filters']));_0x283c41[_0xf48e('0x58')]['MailAccountId']=_0x3aff1b['id'];if(_0x32ff16[_0xf48e('0x4e')][_0xf48e('0x59')]){_0x283c41[_0xf48e('0x58')]=_['merge'](_0x283c41[_0xf48e('0x58')],{'$or':_['map'](_0x283c41[_0xf48e('0x51')],function(_0x194b1c){var _0x252785={};_0x252785[_0x194b1c]={'$like':'%'+_0x32ff16[_0xf48e('0x4e')][_0xf48e('0x59')]+'%'};return _0x252785;})});}if(_0x32ff16[_0xf48e('0x4e')][_0xf48e('0xa3')]){var _0x5b74cf=_0x32ff16[_0xf48e('0x4e')][_0xf48e('0xa3')][_0xf48e('0xa4')](',');var _0xff6b76={};_0xff6b76[_0x5b74cf[0x0]]={'$gte':moment(_0x5b74cf[0x1])[_0xf48e('0xa5')](_0xf48e('0xa6'))};_0x283c41[_0xf48e('0x58')]=_[_0xf48e('0x5a')](_0x283c41['where'],_0xff6b76);}_0x283c41=_[_0xf48e('0x5a')]({},_0x283c41,_0x32ff16[_0xf48e('0x5c')]);return db[_0xf48e('0xa7')][_0xf48e('0x34')]({'where':_0x283c41['where']})[_0xf48e('0x24')](function(_0x331f66){_0x1b7248[_0xf48e('0x34')]=_0x331f66;if(_0x32ff16[_0xf48e('0x4e')][_0xf48e('0x5d')]){_0x283c41['include']=[{'all':!![]}];}return db[_0xf48e('0xa7')][_0xf48e('0x5e')](_0x283c41);})[_0xf48e('0x24')](function(_0x5aac36){if(_0x32ff16['query'][_0xf48e('0xa8')]==='true'){for(var _0x243b72=0x0;_0x243b72<_0x5aac36[_0xf48e('0x53')];_0x243b72++){_0x5aac36[_0x243b72]['body']=juice(_0x5aac36[_0x243b72][_0xf48e('0x65')]);}}_0x1b7248['rows']=_0x5aac36;return _0x1b7248;});}})[_0xf48e('0x24')](respondWithFilteredResult(_0x1bd2b6,_0x283c41))['catch'](handleError(_0x1bd2b6,null));};exports[_0xf48e('0x40')]=function(_0x2fb06f,_0x5403a0,_0x47bbf8){var _0x4b8fb6,_0x27ccf9={},_0x313f58;if(_0x2fb06f[_0xf48e('0x65')]['to']){_0x313f58=_0x2fb06f['body']['to'][_0xf48e('0xa4')](',')[0x0];}return db['MailAccount'][_0xf48e('0x64')]({'where':{'id':_0x2fb06f[_0xf48e('0x61')]['id']},'include':[{'model':db[_0xf48e('0xa9')],'as':_0xf48e('0xaa'),'include':[{'model':db[_0xf48e('0x95')],'as':'Contacts','where':{'email':_0x313f58},'limit':0x1,'order':[[_0xf48e('0xab'),_0xf48e('0xac')]]}]},{'model':db[_0xf48e('0x44')],'as':_0xf48e('0x45'),'raw':!![]}]})[_0xf48e('0x24')](handleEntityNotFound(_0x5403a0,null))[_0xf48e('0x24')](function(_0x19da6c){if(_0x19da6c){_0x4b8fb6=_0x19da6c;if(_0x19da6c[_0xf48e('0x45')]){if(_[_0xf48e('0x78')](_0x2fb06f[_0xf48e('0x65')][_0xf48e('0xad')])){_0x2fb06f['body']['from']=util[_0xf48e('0xa5')]('%s\x20<%s>',_0x19da6c[_0xf48e('0x3f')],_0x19da6c[_0xf48e('0x74')]||_0x19da6c[_0xf48e('0x45')][_0xf48e('0x7b')]);}if(_0x2fb06f[_0xf48e('0x65')][_0xf48e('0xae')]&&_0x2fb06f[_0xf48e('0x65')][_0xf48e('0xae')][_0xf48e('0x53')]){for(var _0x46978a=0x0;_0x46978a<_0x2fb06f['body']['attachments'][_0xf48e('0x53')];_0x46978a+=0x1){_0x2fb06f[_0xf48e('0x65')][_0xf48e('0xae')][_0x46978a]={'filename':_0x2fb06f[_0xf48e('0x65')][_0xf48e('0xae')][_0x46978a][_0xf48e('0x3f')],'path':path[_0xf48e('0xaf')](config[_0xf48e('0xb0')],_0xf48e('0xb1'),_0x2fb06f[_0xf48e('0x65')]['attachments'][_0x46978a][_0xf48e('0xb2')])};}}var _0x2381f2={'tls':{'rejectUnauthorized':![]}};if(_[_0xf48e('0x78')](_0x19da6c[_0xf48e('0x45')][_0xf48e('0x82')])){if(_0x19da6c['Smtp']['authentication']){_0x2381f2['auth']={'user':_0x19da6c[_0xf48e('0x45')][_0xf48e('0x7b')],'pass':_0x19da6c[_0xf48e('0x45')][_0xf48e('0x7e')]};}_0x2381f2[_0xf48e('0x81')]=_0x19da6c[_0xf48e('0x45')][_0xf48e('0x81')];_0x2381f2[_0xf48e('0x80')]=_0x19da6c[_0xf48e('0x45')][_0xf48e('0x80')];_0x2381f2['secure']=_0x19da6c[_0xf48e('0x45')]['secure'];}else{_0x2381f2[_0xf48e('0x82')]=_0x19da6c['Smtp']['service'];_0x2381f2[_0xf48e('0xb3')]={'user':_0x19da6c['Smtp'][_0xf48e('0x7b')],'pass':_0x19da6c[_0xf48e('0x45')][_0xf48e('0x7e')]};}return respondWithRpcPromise(_0xf48e('0xb4'),_0xf48e('0xb5'),{'account':_0x2381f2,'message':_0x2fb06f[_0xf48e('0x65')]});}else{throw new Error(_0xf48e('0xb6'));}}})[_0xf48e('0x24')](function(_0x1149d4){if(_0x1149d4){_0x27ccf9=_0x1149d4;if(_0x4b8fb6[_0xf48e('0xaa')]){if(_0x4b8fb6[_0xf48e('0xaa')][_0xf48e('0xb7')][_0xf48e('0x53')]){return _0x4b8fb6['List'][_0xf48e('0xb7')][0x0];}else{return db[_0xf48e('0x95')][_0xf48e('0x69')](_[_0xf48e('0xb8')](_0x2fb06f[_0xf48e('0x65')],{'firstName':_0x2fb06f[_0xf48e('0x65')]['to'],'email':_0x2fb06f[_0xf48e('0x65')]['to'],'phone':_0x2fb06f[_0xf48e('0x65')]['to'],'ListId':_0x4b8fb6[_0xf48e('0x75')]}));}}else{throw new Error(_0xf48e('0xb6'));}}})[_0xf48e('0x24')](function(_0x591f9d){if(_0x591f9d){var _0x2dc0dc={'UserId':_0x2fb06f[_0xf48e('0x7b')]['id'],'ContactId':_0x591f9d['id'],'MailAccountId':_0x4b8fb6['id'],'inReplyTo':_0x27ccf9[_0xf48e('0xb9')],'to':_0x2fb06f[_0xf48e('0x65')]['from'],'cc':_0x2fb06f[_0xf48e('0x65')]['cc'],'subject':_0x2fb06f['body'][_0xf48e('0xba')],'attach':_0x2fb06f[_0xf48e('0x65')]['attach'],'firstMsgDirection':_0xf48e('0xbb'),'lastMsgAt':moment()[_0xf48e('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xf48e('0xbb'),'Messages':[_['merge'](_0x2fb06f['body'],{'messageId':_0x27ccf9['messageId'],'sentAt':moment()[_0xf48e('0xa5')](_0xf48e('0xa6')),'read':!![],'MailAccountId':_0x4b8fb6['id'],'UserId':_0x2fb06f['user']['id'],'ContactId':_0x591f9d['id']})]};if(_0x2fb06f['body']['Interaction']){_0x2dc0dc=_[_0xf48e('0x5a')](_0x2dc0dc,_0x2fb06f[_0xf48e('0x65')][_0xf48e('0xbc')]);}return db['MailInteraction'][_0xf48e('0x69')](_0x2dc0dc,{'include':[{'model':db[_0xf48e('0xa7')],'as':_0xf48e('0xbd')}]});}})[_0xf48e('0x24')](respondWithResult(_0x5403a0,null))[_0xf48e('0x2f')](handleError(_0x5403a0,null));};exports[_0xf48e('0xbe')]=function(_0x2f9b22,_0x1b3ee3,_0x4d96f9){return db[_0xf48e('0x48')]['find']({'where':{'id':_0x2f9b22[_0xf48e('0x61')]['id']},'include':[{'model':db[_0xf48e('0x44')],'as':'Smtp','raw':!![]}]})[_0xf48e('0x24')](handleEntityNotFound(_0x1b3ee3,null))[_0xf48e('0x24')](function(_0x564458){if(_0x564458&&_0x564458[_0xf48e('0x45')]){var _0x1dd82a={'id':_0x564458['id'],'tls':{'rejectUnauthorized':![]}};if(_0x564458[_0xf48e('0x45')][_0xf48e('0x82')]){_0x1dd82a['service']=_0x564458['Smtp'][_0xf48e('0x82')];}else{_0x1dd82a[_0xf48e('0x81')]=_0x564458[_0xf48e('0x45')][_0xf48e('0x81')];_0x1dd82a[_0xf48e('0x80')]=_0x564458[_0xf48e('0x45')][_0xf48e('0x80')];_0x1dd82a[_0xf48e('0xbf')]=_0x564458[_0xf48e('0x45')]['secure'];}if(_0x564458[_0xf48e('0x45')]['authentication']){_0x1dd82a[_0xf48e('0xb3')]={'user':_0x564458['Smtp'][_0xf48e('0x7b')],'pass':_0x564458['Smtp'][_0xf48e('0x7e')]};}return respondWithRpcPromise(_0xf48e('0xc0'),_0xf48e('0xbe'),{'account':_0x1dd82a});}})['then'](respondWithResult(_0x1b3ee3,null))[_0xf48e('0x2f')](handleError(_0x1b3ee3,null));};exports['destroy']=function(_0x1abcf1,_0x12e25e){return db[_0xf48e('0x48')][_0xf48e('0x64')]({'where':{'id':_0x1abcf1[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x12e25e,null))[_0xf48e('0x24')](function(_0x509f5a){if(_0x509f5a&&_0x509f5a['service']){throw new db[(_0xf48e('0xc1'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x509f5a;})[_0xf48e('0x24')](removeEntity(_0x12e25e,null))[_0xf48e('0x2f')](handleError(_0x12e25e,null));};exports[_0xf48e('0xc2')]=function(_0x397400,_0x4085ff,_0x1139a4){return db['MailAccount']['find']({'where':{'id':_0x397400[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x4085ff,null))[_0xf48e('0x24')](function(_0x3460fe){if(_0x3460fe){return _0x3460fe['addAgents'](_0x397400[_0xf48e('0x65')][_0xf48e('0x6e')],_[_0xf48e('0xc3')](_0x397400[_0xf48e('0x65')],[_0xf48e('0x6e'),'id'])||{})[_0xf48e('0xc4')](function(_0x2572ec){for(var _0x1dfe73=0x0;_0x1dfe73<_0x397400[_0xf48e('0x65')][_0xf48e('0x6e')][_0xf48e('0x53')];_0x1dfe73+=0x1){socket[_0xf48e('0xc5')](_0xf48e('0xc6'),{'UserId':Number(_0x397400[_0xf48e('0x65')][_0xf48e('0x6e')][_0x1dfe73]),'MailAccountId':Number(_0x397400[_0xf48e('0x61')]['id'])});}return _0x2572ec;});}})[_0xf48e('0x24')](respondWithResult(_0x4085ff,null))[_0xf48e('0x2f')](handleError(_0x4085ff,null));};exports['removeAgents']=function(_0x55d122,_0x5b471d,_0x565840){return db[_0xf48e('0x48')]['find']({'where':{'id':_0x55d122[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x5b471d,null))[_0xf48e('0x24')](function(_0x291568){if(_0x291568){return _0x291568['removeAgents'](_0x55d122['query'][_0xf48e('0x6e')])[_0xf48e('0x24')](function(){if(_[_0xf48e('0xc7')](_0x55d122[_0xf48e('0x4e')][_0xf48e('0x6e')])){for(var _0x4590a6=0x0;_0x4590a6<_0x55d122[_0xf48e('0x4e')][_0xf48e('0x6e')][_0xf48e('0x53')];_0x4590a6+=0x1){socket['emit'](_0xf48e('0xc8'),{'UserId':Number(_0x55d122[_0xf48e('0x4e')]['ids'][_0x4590a6]),'MailAccountId':Number(_0x55d122[_0xf48e('0x61')]['id'])});}}else{socket[_0xf48e('0xc5')]('userMailAccount:remove',{'UserId':Number(_0x55d122[_0xf48e('0x4e')][_0xf48e('0x6e')]),'MailAccountId':Number(_0x55d122['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5b471d,null))['catch'](handleError(_0x5b471d,null));};exports[_0xf48e('0xc9')]=function(_0x2ac10a,_0x405481,_0x6432e5){var _0x7fe515={};var _0x592b17={};var _0x16f5bf;var _0x54f5fc;return db[_0xf48e('0x48')][_0xf48e('0x6b')]({'where':{'id':_0x2ac10a[_0xf48e('0x61')]['id']}})[_0xf48e('0x24')](handleEntityNotFound(_0x405481,null))[_0xf48e('0x24')](function(_0xaa3ad0){if(_0xaa3ad0){_0x16f5bf=_0xaa3ad0;_0x592b17[_0xf48e('0x4c')]=_['keys'](db[_0xf48e('0x97')][_0xf48e('0x49')]);_0x592b17[_0xf48e('0x4e')]=_['keys'](_0x2ac10a['query']);_0x592b17[_0xf48e('0x4f')]=_['intersection'](_0x592b17[_0xf48e('0x4c')],_0x592b17[_0xf48e('0x4e')]);_0x7fe515[_0xf48e('0x51')]=_[_0xf48e('0x50')](_0x592b17['model'],qs[_0xf48e('0x52')](_0x2ac10a[_0xf48e('0x4e')]['fields']));_0x7fe515[_0xf48e('0x51')]=_0x7fe515[_0xf48e('0x51')][_0xf48e('0x53')]?_0x7fe515['attributes']:_0x592b17[_0xf48e('0x4c')];_0x7fe515[_0xf48e('0x56')]=qs[_0xf48e('0x57')](_0x2ac10a[_0xf48e('0x4e')][_0xf48e('0x57')]);_0x7fe515[_0xf48e('0x58')]=qs['filters'](_[_0xf48e('0x6c')](_0x2ac10a['query'],_0x592b17[_0xf48e('0x4f')]));if(_0x2ac10a[_0xf48e('0x4e')]['filter']){_0x7fe515[_0xf48e('0x58')]=_[_0xf48e('0x5a')](_0x7fe515[_0xf48e('0x58')],{'$or':_[_0xf48e('0x47')](_0x7fe515[_0xf48e('0x51')],function(_0x542eec){var _0x3c67bd={};_0x3c67bd[_0x542eec]={'$like':'%'+_0x2ac10a[_0xf48e('0x4e')]['filter']+'%'};return _0x3c67bd;})});}_0x7fe515=_[_0xf48e('0x5a')]({},_0x7fe515,_0x2ac10a[_0xf48e('0x5c')]);return _0x16f5bf[_0xf48e('0xc9')](_0x7fe515);}})[_0xf48e('0x24')](function(_0x2cced3){if(_0x2cced3){_0x54f5fc=_0x2cced3[_0xf48e('0x53')];if(!_0x2ac10a[_0xf48e('0x4e')][_0xf48e('0x54')](_0xf48e('0x55'))){_0x7fe515['limit']=qs[_0xf48e('0x33')](_0x2ac10a[_0xf48e('0x4e')][_0xf48e('0x33')]);_0x7fe515[_0xf48e('0x35')]=qs[_0xf48e('0x35')](_0x2ac10a[_0xf48e('0x4e')][_0xf48e('0x35')]);}return _0x16f5bf[_0xf48e('0xc9')](_0x7fe515);}})[_0xf48e('0x24')](function(_0x2b145a){if(_0x2b145a){return _0x2b145a?{'count':_0x54f5fc,'rows':_0x2b145a}:null;}})[_0xf48e('0x24')](respondWithResult(_0x405481,null))[_0xf48e('0x2f')](handleError(_0x405481,null));};
\ No newline at end of file
+var _0xd879=['index','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','MailAccount','includeAll','findAll','rows','MailServerOut','intersection','include','find','body','params','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','attributes','removeDispositions','ids','CannedAnswer','getAnswers','email','ListId','isNil','active','description','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','cservice','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','$gte','split','format','MailMessage','send','CmList','List','Contacts','DESC','from','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','messageId','Interaction','Messages','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','zip-dir','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','html-to-text','juice','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','update','destroy','then','get','name'];(function(_0xb912db,_0x5dfdcb){var _0x2aebc2=function(_0x3e2af7){while(--_0x3e2af7){_0xb912db['push'](_0xb912db['shift']());}};_0x2aebc2(++_0x5dfdcb);}(_0xd879,0x14a));var _0x9d87=function(_0x562005,_0x265854){_0x562005=_0x562005-0x0;var _0x49ae99=_0xd879[_0x562005];return _0x49ae99;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9d87('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9d87('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9d87('0x2'));var util=require(_0x9d87('0x3'));var path=require(_0x9d87('0x4'));var sox=require('sox');var csv=require(_0x9d87('0x5'));var ejs=require(_0x9d87('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d87('0x7'));var squel=require(_0x9d87('0x8'));var crypto=require(_0x9d87('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9d87('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d87('0xb'));var htmlToText=require(_0x9d87('0xc'));var juice=require(_0x9d87('0xd'));var Redis=require('ioredis');var authService=require(_0x9d87('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9d87('0xf'));var hardwareService=require(_0x9d87('0x10'));var logger=require(_0x9d87('0x11'))(_0x9d87('0x12'));var utils=require(_0x9d87('0x13'));var config=require(_0x9d87('0x14'));var licenseUtil=require(_0x9d87('0x15'));var db=require('../../mysqldb')['db'];config[_0x9d87('0x16')]=_[_0x9d87('0x17')](config[_0x9d87('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x9d87('0x18'))(new Redis(config['redis']));require(_0x9d87('0x19'))['register'](socket);var jayson=require(_0x9d87('0x1a'));var client=jayson[_0x9d87('0x1b')][_0x9d87('0x1c')]({'port':0x232b});function respondWithRpcPromise(_0x42e891,_0x4a18f2,_0x249282,_0x247f3b){return new BPromise(function(_0x2c57c2,_0x33b527){var _0x21c20c=_0x247f3b||client;return _0x21c20c['request'](_0x42e891,_0x249282)['then'](function(_0x150aac){logger[_0x9d87('0x1d')](_0x9d87('0x1e'),_0x4a18f2,_0x9d87('0x1f'));logger['debug'](_0x9d87('0x20'),_0x4a18f2,_0x9d87('0x1f'),JSON[_0x9d87('0x21')](_0x150aac));if(_0x150aac[_0x9d87('0x22')]){if(_0x150aac['error']['code']===0x1f4){logger['error'](_0x9d87('0x1e'),_0x4a18f2,_0x150aac[_0x9d87('0x22')][_0x9d87('0x23')]);return _0x33b527(_0x150aac[_0x9d87('0x22')][_0x9d87('0x23')]);}logger[_0x9d87('0x22')](_0x9d87('0x1e'),_0x4a18f2,_0x150aac['error'][_0x9d87('0x23')]);return _0x2c57c2(_0x150aac[_0x9d87('0x22')]['message']);}else{logger[_0x9d87('0x1d')]('MailAccount,\x20%s,\x20%s',_0x4a18f2,'request\x20sent');_0x2c57c2(_0x150aac[_0x9d87('0x24')][_0x9d87('0x23')]);}})[_0x9d87('0x25')](function(_0x520652){logger[_0x9d87('0x22')]('MailAccount,\x20%s,\x20%s',_0x4a18f2,_0x520652);_0x33b527(_0x520652);});});}function respondWithStatusCode(_0x1eab35,_0x1379ec){_0x1379ec=_0x1379ec||0xcc;return function(_0x2271fc){if(_0x2271fc){return _0x1eab35[_0x9d87('0x26')](_0x1379ec);}return _0x1eab35['status'](_0x1379ec)[_0x9d87('0x27')]();};}function respondWithResult(_0x9254d3,_0x433bc0){_0x433bc0=_0x433bc0||0xc8;return function(_0x65cd4d){if(_0x65cd4d){return _0x9254d3[_0x9d87('0x28')](_0x433bc0)['json'](_0x65cd4d);}};}function respondWithFilteredResult(_0x1d27a3,_0x3bdb6a){return function(_0x102d57){if(_0x102d57){var _0x4d1bc5=typeof _0x3bdb6a[_0x9d87('0x29')]===_0x9d87('0x2a')&&typeof _0x3bdb6a[_0x9d87('0x2b')]===_0x9d87('0x2a');var _0x5de196=_0x102d57[_0x9d87('0x2c')];var _0x5cf9ca=_0x4d1bc5?0x0:_0x3bdb6a[_0x9d87('0x29')];var _0x4387a9=_0x4d1bc5?_0x102d57[_0x9d87('0x2c')]:_0x3bdb6a[_0x9d87('0x29')]+_0x3bdb6a['limit'];var _0x6baae9;if(_0x4387a9>=_0x5de196){_0x4387a9=_0x5de196;_0x6baae9=0xc8;}else{_0x6baae9=0xce;}_0x1d27a3[_0x9d87('0x28')](_0x6baae9);return _0x1d27a3[_0x9d87('0x2d')]('Content-Range',_0x5cf9ca+'-'+_0x4387a9+'/'+_0x5de196)[_0x9d87('0x2e')](_0x102d57);}return null;};}function patchUpdates(_0x3e90f3){return function(_0x1b4f66){try{jsonpatch['apply'](_0x1b4f66,_0x3e90f3,!![]);}catch(_0xa1698){return BPromise[_0x9d87('0x2f')](_0xa1698);}return _0x1b4f66[_0x9d87('0x30')]();};}function saveUpdates(_0x552537,_0x51badf){return function(_0x22a3c0){if(_0x22a3c0){return _0x22a3c0[_0x9d87('0x31')](_0x552537)['then'](function(_0x51f4bb){return _0x51f4bb;});}return null;};}function removeEntity(_0x5bf400,_0x46d39d){return function(_0x2a3874){if(_0x2a3874){return _0x2a3874[_0x9d87('0x32')]()[_0x9d87('0x33')](function(){var _0x1cd6b0=_0x2a3874[_0x9d87('0x34')]({'plain':!![]});var _0x59aeb5='MailAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x59aeb5,'resourceId':_0x1cd6b0['id']}})[_0x9d87('0x33')](function(){return _0x2a3874;});})[_0x9d87('0x33')](function(){_0x5bf400['status'](0xcc)[_0x9d87('0x27')]();});}};}function handleEntityNotFound(_0x5154e7,_0x910b39){return function(_0x1dadfa){if(!_0x1dadfa){_0x5154e7['sendStatus'](0x194);}return _0x1dadfa;};}function handleError(_0x128b93,_0x3979a7){_0x3979a7=_0x3979a7||0x1f4;return function(_0x425b57){logger[_0x9d87('0x22')](_0x425b57['stack']);if(_0x425b57['name']){delete _0x425b57[_0x9d87('0x35')];}_0x128b93[_0x9d87('0x28')](_0x3979a7)['send'](_0x425b57);};}exports[_0x9d87('0x36')]=function(_0x1715ef,_0x1c773d){var _0x58fbbe={'include':[{'model':db[_0x9d87('0x37')],'as':_0x9d87('0x38')},{'model':db['MailServerOut'],'as':_0x9d87('0x39')},{'model':db[_0x9d87('0x3a')],'as':_0x9d87('0x3b')}]},_0x403d08={},_0x39ef82={'count':0x0,'rows':[]};var _0x2f287e=_[_0x9d87('0x3c')](db['MailAccount'][_0x9d87('0x3d')],function(_0x21c759){return{'name':_0x21c759[_0x9d87('0x3e')],'type':_0x21c759[_0x9d87('0x3f')][_0x9d87('0x40')]};});_0x403d08['model']=_['map'](_0x2f287e,_0x9d87('0x35'));_0x403d08[_0x9d87('0x41')]=_[_0x9d87('0x42')](_0x1715ef[_0x9d87('0x41')]);_0x403d08[_0x9d87('0x43')]=_['intersection'](_0x403d08[_0x9d87('0x44')],_0x403d08[_0x9d87('0x41')]);_0x58fbbe['attributes']=_['intersection'](_0x403d08[_0x9d87('0x44')],qs[_0x9d87('0x45')](_0x1715ef[_0x9d87('0x41')][_0x9d87('0x45')]));_0x58fbbe['attributes']=_0x58fbbe['attributes'][_0x9d87('0x46')]?_0x58fbbe['attributes']:_0x403d08[_0x9d87('0x44')];if(!_0x1715ef[_0x9d87('0x41')][_0x9d87('0x47')](_0x9d87('0x48'))){_0x58fbbe[_0x9d87('0x2b')]=qs[_0x9d87('0x2b')](_0x1715ef[_0x9d87('0x41')]['limit']);_0x58fbbe[_0x9d87('0x29')]=qs['offset'](_0x1715ef['query'][_0x9d87('0x29')]);}_0x58fbbe[_0x9d87('0x49')]=qs[_0x9d87('0x4a')](_0x1715ef['query'][_0x9d87('0x4a')]);_0x58fbbe[_0x9d87('0x4b')]=qs['filters'](_[_0x9d87('0x4c')](_0x1715ef[_0x9d87('0x41')],_0x403d08['filters']),_0x2f287e);if(_0x1715ef[_0x9d87('0x41')]['filter']){_0x58fbbe[_0x9d87('0x4b')]=_['merge'](_0x58fbbe[_0x9d87('0x4b')],{'$or':_['map'](_0x2f287e,function(_0x2fcf88){if(_0x2fcf88['type']!==_0x9d87('0x4d')){var _0x11c8a3={};_0x11c8a3[_0x2fcf88['name']]={'$like':'%'+_0x1715ef[_0x9d87('0x41')][_0x9d87('0x4e')]+'%'};return _0x11c8a3;}})});}_0x58fbbe=_[_0x9d87('0x4f')]({},_0x58fbbe,_0x1715ef[_0x9d87('0x50')]);var _0x4ca658={'where':_0x58fbbe['where']};return db[_0x9d87('0x51')]['count'](_0x4ca658)['then'](function(_0x477452){_0x39ef82['count']=_0x477452;if(_0x1715ef[_0x9d87('0x41')][_0x9d87('0x52')]){_0x58fbbe['include']=[{'all':!![]}];}return db[_0x9d87('0x51')][_0x9d87('0x53')](_0x58fbbe);})[_0x9d87('0x33')](function(_0x1028c2){_0x39ef82[_0x9d87('0x54')]=_0x1028c2;return _0x39ef82;})['then'](respondWithFilteredResult(_0x1c773d,_0x58fbbe))[_0x9d87('0x25')](handleError(_0x1c773d,null));};exports['show']=function(_0x39def5,_0x164f7b){var _0x1a8d43={'raw':![],'where':{'id':_0x39def5['params']['id']},'include':[{'model':db[_0x9d87('0x37')],'as':'Imap'},{'model':db[_0x9d87('0x55')],'as':'Smtp'},{'model':db[_0x9d87('0x3a')],'as':_0x9d87('0x3b')}]},_0x5810cc={};_0x5810cc['model']=_[_0x9d87('0x42')](db[_0x9d87('0x51')][_0x9d87('0x3d')]);_0x5810cc[_0x9d87('0x41')]=_[_0x9d87('0x42')](_0x39def5[_0x9d87('0x41')]);_0x5810cc[_0x9d87('0x43')]=_['intersection'](_0x5810cc['model'],_0x5810cc[_0x9d87('0x41')]);_0x1a8d43['attributes']=_[_0x9d87('0x56')](_0x5810cc[_0x9d87('0x44')],qs[_0x9d87('0x45')](_0x39def5['query'][_0x9d87('0x45')]));_0x1a8d43['attributes']=_0x1a8d43['attributes'][_0x9d87('0x46')]?_0x1a8d43['attributes']:_0x5810cc[_0x9d87('0x44')];if(_0x39def5['query']['includeAll']){_0x1a8d43[_0x9d87('0x57')]=[{'all':!![]}];}_0x1a8d43=_['merge']({},_0x1a8d43,_0x39def5[_0x9d87('0x50')]);return db[_0x9d87('0x51')][_0x9d87('0x58')](_0x1a8d43)[_0x9d87('0x33')](handleEntityNotFound(_0x164f7b,null))[_0x9d87('0x33')](respondWithResult(_0x164f7b,null))[_0x9d87('0x25')](handleError(_0x164f7b,null));};exports[_0x9d87('0x31')]=function(_0x47f963,_0x423114){if(_0x47f963[_0x9d87('0x59')]['id']){delete _0x47f963[_0x9d87('0x59')]['id'];}return db[_0x9d87('0x51')]['find']({'where':{'id':_0x47f963[_0x9d87('0x5a')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x9d87('0x38')},{'model':db[_0x9d87('0x55')],'as':_0x9d87('0x39')},{'model':db[_0x9d87('0x3a')],'as':'mandatoryDispositionPause'}]})[_0x9d87('0x33')](handleEntityNotFound(_0x423114,null))[_0x9d87('0x33')](saveUpdates(_0x47f963[_0x9d87('0x59')],null))[_0x9d87('0x33')](function(_0x1cb257){if(_0x1cb257&&_0x47f963[_0x9d87('0x59')][_0x9d87('0x38')]){return db['MailServerIn']['update'](_0x47f963[_0x9d87('0x59')][_0x9d87('0x38')],{'where':{'MailAccountId':_0x1cb257['id']}})['then'](function(){return _0x1cb257;});}return _0x1cb257;})[_0x9d87('0x33')](function(_0x2d8f85){if(_0x2d8f85&&_0x47f963[_0x9d87('0x59')]['Smtp']){return db['MailServerOut'][_0x9d87('0x31')](_0x47f963[_0x9d87('0x59')]['Smtp'],{'where':{'MailAccountId':_0x2d8f85['id']}})[_0x9d87('0x33')](function(){return _0x2d8f85;});}return _0x2d8f85;})['then'](respondWithResult(_0x423114,null))[_0x9d87('0x25')](handleError(_0x423114,null));};exports[_0x9d87('0x5b')]=function(_0x3d9390,_0x58c326){return db[_0x9d87('0x51')][_0x9d87('0x5b')]()[_0x9d87('0x33')](respondWithResult(_0x58c326,null))[_0x9d87('0x25')](handleError(_0x58c326,null));};exports[_0x9d87('0x5c')]=function(_0x2375ed,_0x46818c,_0x4f6b0c){if(_0x2375ed[_0x9d87('0x59')]['id']){delete _0x2375ed[_0x9d87('0x59')]['id'];}return db['MailAccount'][_0x9d87('0x58')]({'where':{'id':_0x2375ed[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x46818c,null))[_0x9d87('0x33')](function(_0x21bdbb){if(_0x21bdbb){_0x2375ed[_0x9d87('0x59')][_0x9d87('0x5d')]=_0x21bdbb['id'];return db[_0x9d87('0x5e')][_0x9d87('0x5f')](_0x2375ed[_0x9d87('0x59')]);}})[_0x9d87('0x33')](respondWithResult(_0x46818c,null))[_0x9d87('0x25')](handleError(_0x46818c,null));};exports[_0x9d87('0x60')]=function(_0x31faf8,_0x2bb1ff,_0x2af785){var _0x2c67c8={'raw':![],'where':{}};var _0x5ce857={};var _0x573811={'count':0x0,'rows':[]};return db[_0x9d87('0x51')][_0x9d87('0x61')]({'where':{'id':_0x31faf8['params']['id']}})['then'](handleEntityNotFound(_0x2bb1ff,null))[_0x9d87('0x33')](function(_0x1481e8){if(_0x1481e8){_0x5ce857['model']=_[_0x9d87('0x42')](db[_0x9d87('0x5e')][_0x9d87('0x3d')]);_0x5ce857[_0x9d87('0x41')]=_[_0x9d87('0x42')](_0x31faf8[_0x9d87('0x41')]);_0x5ce857[_0x9d87('0x43')]=_[_0x9d87('0x56')](_0x5ce857[_0x9d87('0x44')],_0x5ce857[_0x9d87('0x41')]);_0x2c67c8['attributes']=_[_0x9d87('0x56')](_0x5ce857[_0x9d87('0x44')],qs[_0x9d87('0x45')](_0x31faf8[_0x9d87('0x41')][_0x9d87('0x45')]));_0x2c67c8[_0x9d87('0x62')]=_0x2c67c8[_0x9d87('0x62')]['length']?_0x2c67c8[_0x9d87('0x62')]:_0x5ce857['model'];if(!_0x31faf8[_0x9d87('0x41')][_0x9d87('0x47')](_0x9d87('0x48'))){_0x2c67c8['limit']=qs['limit'](_0x31faf8['query'][_0x9d87('0x2b')]);_0x2c67c8[_0x9d87('0x29')]=qs[_0x9d87('0x29')](_0x31faf8[_0x9d87('0x41')][_0x9d87('0x29')]);}_0x2c67c8['order']=qs[_0x9d87('0x4a')](_0x31faf8[_0x9d87('0x41')]['sort']);_0x2c67c8[_0x9d87('0x4b')]=qs[_0x9d87('0x43')](_['pick'](_0x31faf8['query'],_0x5ce857[_0x9d87('0x43')]));_0x2c67c8['where']['MailAccountId']=_0x1481e8['id'];if(_0x31faf8['query'][_0x9d87('0x4e')]){_0x2c67c8['where']=_[_0x9d87('0x4f')](_0x2c67c8[_0x9d87('0x4b')],{'$or':_[_0x9d87('0x3c')](_0x2c67c8[_0x9d87('0x62')],function(_0x1beba5){var _0x3daeb0={};_0x3daeb0[_0x1beba5]={'$like':'%'+_0x31faf8['query']['filter']+'%'};return _0x3daeb0;})});}_0x2c67c8=_['merge']({},_0x2c67c8,_0x31faf8[_0x9d87('0x50')]);return db[_0x9d87('0x5e')]['count']({'where':_0x2c67c8[_0x9d87('0x4b')]})['then'](function(_0x43f952){_0x573811[_0x9d87('0x2c')]=_0x43f952;if(_0x31faf8['query'][_0x9d87('0x52')]){_0x2c67c8[_0x9d87('0x57')]=[{'all':!![]}];}return db[_0x9d87('0x5e')][_0x9d87('0x53')](_0x2c67c8);})[_0x9d87('0x33')](function(_0x147789){_0x573811['rows']=_0x147789;return _0x573811;});}})[_0x9d87('0x33')](respondWithFilteredResult(_0x2bb1ff,_0x2c67c8))[_0x9d87('0x25')](handleError(_0x2bb1ff,null));};exports[_0x9d87('0x63')]=function(_0x426e7,_0x4d8ad4,_0x52e79a){return db[_0x9d87('0x51')][_0x9d87('0x58')]({'where':{'id':_0x426e7[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x4d8ad4,null))['then'](function(_0x44c491){if(_0x44c491){return _0x44c491[_0x9d87('0x63')](_0x426e7['query'][_0x9d87('0x64')]);}})[_0x9d87('0x33')](respondWithStatusCode(_0x4d8ad4,null))[_0x9d87('0x25')](handleError(_0x4d8ad4,null));};exports['addAnswer']=function(_0xbcf950,_0x9eff64,_0x32f5b6){if(_0xbcf950[_0x9d87('0x59')]['id']){delete _0xbcf950[_0x9d87('0x59')]['id'];}return db['MailAccount'][_0x9d87('0x58')]({'where':{'id':_0xbcf950['params']['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x9eff64,null))[_0x9d87('0x33')](function(_0x583702){if(_0x583702){_0xbcf950[_0x9d87('0x59')]['MailAccountId']=_0x583702['id'];return db[_0x9d87('0x65')][_0x9d87('0x5f')](_0xbcf950['body']);}})[_0x9d87('0x33')](respondWithResult(_0x9eff64,null))[_0x9d87('0x25')](handleError(_0x9eff64,null));};exports[_0x9d87('0x66')]=function(_0x60368c,_0x14cf52,_0x34f70f){var _0x3512f2={'raw':![],'where':{}};var _0x574a29={};var _0x36228f={'count':0x0,'rows':[]};return db[_0x9d87('0x51')][_0x9d87('0x61')]({'where':{'id':_0x60368c[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x14cf52,null))['then'](function(_0xcb3f51){if(_0xcb3f51){_0x574a29[_0x9d87('0x44')]=_[_0x9d87('0x42')](db['CannedAnswer'][_0x9d87('0x3d')]);_0x574a29[_0x9d87('0x41')]=_[_0x9d87('0x42')](_0x60368c[_0x9d87('0x41')]);_0x574a29[_0x9d87('0x43')]=_[_0x9d87('0x56')](_0x574a29[_0x9d87('0x44')],_0x574a29[_0x9d87('0x41')]);_0x3512f2[_0x9d87('0x62')]=_[_0x9d87('0x56')](_0x574a29[_0x9d87('0x44')],qs[_0x9d87('0x45')](_0x60368c[_0x9d87('0x41')]['fields']));_0x3512f2[_0x9d87('0x62')]=_0x3512f2[_0x9d87('0x62')][_0x9d87('0x46')]?_0x3512f2[_0x9d87('0x62')]:_0x574a29[_0x9d87('0x44')];if(!_0x60368c[_0x9d87('0x41')][_0x9d87('0x47')]('nolimit')){_0x3512f2[_0x9d87('0x2b')]=qs[_0x9d87('0x2b')](_0x60368c[_0x9d87('0x41')][_0x9d87('0x2b')]);_0x3512f2[_0x9d87('0x29')]=qs[_0x9d87('0x29')](_0x60368c['query'][_0x9d87('0x29')]);}_0x3512f2[_0x9d87('0x49')]=qs[_0x9d87('0x4a')](_0x60368c[_0x9d87('0x41')][_0x9d87('0x4a')]);_0x3512f2['where']=qs['filters'](_['pick'](_0x60368c[_0x9d87('0x41')],_0x574a29[_0x9d87('0x43')]));_0x3512f2[_0x9d87('0x4b')][_0x9d87('0x5d')]=_0xcb3f51['id'];if(_0x60368c['query'][_0x9d87('0x4e')]){_0x3512f2[_0x9d87('0x4b')]=_['merge'](_0x3512f2[_0x9d87('0x4b')],{'$or':_[_0x9d87('0x3c')](_0x3512f2[_0x9d87('0x62')],function(_0x7bf1a0){var _0x46a939={};_0x46a939[_0x7bf1a0]={'$like':'%'+_0x60368c[_0x9d87('0x41')][_0x9d87('0x4e')]+'%'};return _0x46a939;})});}_0x3512f2=_['merge']({},_0x3512f2,_0x60368c[_0x9d87('0x50')]);return db[_0x9d87('0x65')]['count']({'where':_0x3512f2[_0x9d87('0x4b')]})[_0x9d87('0x33')](function(_0x41ec20){_0x36228f[_0x9d87('0x2c')]=_0x41ec20;if(_0x60368c[_0x9d87('0x41')]['includeAll']){_0x3512f2[_0x9d87('0x57')]=[{'all':!![]}];}return db[_0x9d87('0x65')][_0x9d87('0x53')](_0x3512f2);})[_0x9d87('0x33')](function(_0x4779d2){_0x36228f['rows']=_0x4779d2;return _0x36228f;});}})[_0x9d87('0x33')](respondWithFilteredResult(_0x14cf52,_0x3512f2))[_0x9d87('0x25')](handleError(_0x14cf52,null));};exports['removeAnswers']=function(_0x2473ea,_0x4541aa,_0x7eac12){return db[_0x9d87('0x51')]['find']({'where':{'id':_0x2473ea[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x4541aa,null))['then'](function(_0x134382){if(_0x134382){return _0x134382['removeAnswers'](_0x2473ea['query'][_0x9d87('0x64')]);}})[_0x9d87('0x33')](respondWithStatusCode(_0x4541aa,null))[_0x9d87('0x25')](handleError(_0x4541aa,null));};exports['create']=function(_0x288773,_0x7e931a){var _0x5e6f1d={'name':_0x288773[_0x9d87('0x59')][_0x9d87('0x35')],'key':_0x288773[_0x9d87('0x59')][_0x9d87('0x40')],'email':_0x288773[_0x9d87('0x59')][_0x9d87('0x67')],'ListId':_0x288773['body'][_0x9d87('0x68')],'active':!_[_0x9d87('0x69')](_0x288773['body'][_0x9d87('0x6a')])?_0x288773['body']['active']:!![],'description':_0x288773['body'][_0x9d87('0x6b')]||null,'Imap':{},'Smtp':{}};if(_[_0x9d87('0x69')](_0x288773[_0x9d87('0x59')]['cservice'])){if(_0x288773[_0x9d87('0x59')][_0x9d87('0x6c')]){_0x5e6f1d[_0x9d87('0x38')][_0x9d87('0x6d')]=_0x5e6f1d[_0x9d87('0x39')][_0x9d87('0x6d')]=_0x288773[_0x9d87('0x59')][_0x9d87('0x6e')];_0x5e6f1d['Imap'][_0x9d87('0x6f')]=_0x5e6f1d[_0x9d87('0x39')][_0x9d87('0x70')]=_0x288773[_0x9d87('0x59')][_0x9d87('0x71')];}else{_0x5e6f1d[_0x9d87('0x38')][_0x9d87('0x72')]=_0x5e6f1d['Smtp'][_0x9d87('0x72')]=![];}_0x5e6f1d[_0x9d87('0x38')]['host']=_0x288773[_0x9d87('0x59')][_0x9d87('0x38')][_0x9d87('0x73')];_0x5e6f1d[_0x9d87('0x38')][_0x9d87('0x74')]=_0x288773['body'][_0x9d87('0x38')]['port'];_0x5e6f1d[_0x9d87('0x39')][_0x9d87('0x73')]=_0x288773[_0x9d87('0x59')]['Smtp'][_0x9d87('0x73')];_0x5e6f1d[_0x9d87('0x39')]['port']=_0x288773[_0x9d87('0x59')][_0x9d87('0x39')][_0x9d87('0x74')];}else{_0x5e6f1d[_0x9d87('0x38')]['service']=_0x5e6f1d[_0x9d87('0x39')][_0x9d87('0x75')]=_0x288773[_0x9d87('0x59')][_0x9d87('0x76')];_0x5e6f1d[_0x9d87('0x38')][_0x9d87('0x6d')]=_0x5e6f1d[_0x9d87('0x39')][_0x9d87('0x6d')]=_0x288773[_0x9d87('0x59')][_0x9d87('0x6e')];_0x5e6f1d[_0x9d87('0x38')][_0x9d87('0x6f')]=_0x5e6f1d[_0x9d87('0x39')][_0x9d87('0x70')]=_0x288773[_0x9d87('0x59')][_0x9d87('0x71')];}return db[_0x9d87('0x51')][_0x9d87('0x5f')](_0x5e6f1d,{'include':[{'model':db[_0x9d87('0x55')],'as':_0x9d87('0x39')},{'model':db[_0x9d87('0x37')],'as':_0x9d87('0x38')}]})[_0x9d87('0x33')](function(_0x7a65a4){var _0x2dbdbe=_0x288773[_0x9d87('0x6d')][_0x9d87('0x34')]({'plain':!![]});if(!_0x2dbdbe)throw new Error(_0x9d87('0x77'));if(_0x2dbdbe[_0x9d87('0x78')]==='user'){var _0x5babc5=_0x7a65a4[_0x9d87('0x34')]({'plain':!![]});return db[_0x9d87('0x79')][_0x9d87('0x58')]({'where':{'name':_0x9d87('0x7a'),'userProfileId':_0x2dbdbe[_0x9d87('0x7b')]},'raw':!![]})['then'](function(_0x350048){if(_0x350048&&_0x350048[_0x9d87('0x7c')]===0x0){return db['UserProfileResource']['create']({'name':_0x5babc5[_0x9d87('0x35')],'resourceId':_0x5babc5['id'],'type':_0x350048[_0x9d87('0x35')],'sectionId':_0x350048['id']},{})[_0x9d87('0x33')](function(){return _0x7a65a4;});}else{return _0x7a65a4;}})[_0x9d87('0x25')](function(_0x25bf28){logger[_0x9d87('0x22')](_0x9d87('0x7d'),_0x25bf28);throw _0x25bf28;});}return _0x7a65a4;})[_0x9d87('0x33')](respondWithResult(_0x7e931a,0xc9))[_0x9d87('0x25')](handleError(_0x7e931a,null));};exports[_0x9d87('0x7e')]=function(_0x472599,_0x200929,_0x48bf34){return db[_0x9d87('0x51')][_0x9d87('0x61')]({'where':{'id':_0x472599[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x200929,null))[_0x9d87('0x33')](function(_0x1923e3){if(_0x1923e3){return _0x1923e3['getImap']();}return null;})[_0x9d87('0x33')](respondWithResult(_0x200929,null))[_0x9d87('0x25')](handleError(_0x200929,null));};exports[_0x9d87('0x7f')]=function(_0x41bbe0,_0x3ddab8,_0x262e84){if(_0x41bbe0['body']['id']){delete _0x41bbe0[_0x9d87('0x59')]['id'];}return db[_0x9d87('0x51')]['find']({'where':{'id':_0x41bbe0[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x3ddab8,null))['then'](function(_0x9e1e89){if(_0x9e1e89){_0x41bbe0['body']['MailAccountId']=_0x9e1e89['id'];return db[_0x9d87('0x37')][_0x9d87('0x5f')](_0x41bbe0[_0x9d87('0x59')]);}})['then'](respondWithResult(_0x3ddab8,null))[_0x9d87('0x25')](handleError(_0x3ddab8,null));};exports[_0x9d87('0x80')]=function(_0x4a4b63,_0x19d9b1,_0x2125e3){return db[_0x9d87('0x51')][_0x9d87('0x61')]({'where':{'id':_0x4a4b63[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x19d9b1,null))[_0x9d87('0x33')](function(_0x3d1cfb){if(_0x3d1cfb){return _0x3d1cfb['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x19d9b1,null))[_0x9d87('0x25')](handleError(_0x19d9b1,null));};exports[_0x9d87('0x81')]=function(_0x40486f,_0x5aa82b,_0x345f68){return db[_0x9d87('0x51')][_0x9d87('0x61')]({'where':{'id':_0x40486f['params']['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x5aa82b,null))[_0x9d87('0x33')](function(_0x17e0b1){if(_0x17e0b1){return _0x17e0b1['getSmtp']();}return null;})[_0x9d87('0x33')](respondWithResult(_0x5aa82b,null))[_0x9d87('0x25')](handleError(_0x5aa82b,null));};exports[_0x9d87('0x82')]=function(_0x159529,_0x25a030,_0x5b6937){if(_0x159529['body']['id']){delete _0x159529[_0x9d87('0x59')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x159529[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x25a030,null))['then'](function(_0x47be07){if(_0x47be07){_0x159529[_0x9d87('0x59')][_0x9d87('0x5d')]=_0x47be07['id'];return db[_0x9d87('0x55')]['create'](_0x159529['body']);}})[_0x9d87('0x33')](respondWithResult(_0x25a030,null))[_0x9d87('0x25')](handleError(_0x25a030,null));};exports[_0x9d87('0x83')]=function(_0x2b4cd0,_0x513922,_0x3caee8){return db[_0x9d87('0x51')]['findOne']({'where':{'id':_0x2b4cd0[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x513922,null))[_0x9d87('0x33')](function(_0x361af3){if(_0x361af3){return _0x361af3[_0x9d87('0x84')](null);}return null;})[_0x9d87('0x33')](respondWithStatusCode(_0x513922,null))[_0x9d87('0x25')](handleError(_0x513922,null));};exports[_0x9d87('0x85')]=function(_0x3d1881,_0x4786a1,_0x440211){return db[_0x9d87('0x86')][_0x9d87('0x58')]({'where':{'id':_0x3d1881['params']['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x4786a1,null))[_0x9d87('0x33')](function(_0x21594b){if(_0x21594b){return _0x21594b['addInteraction'](_0x3d1881['body'][_0x9d87('0x64')],_[_0x9d87('0x87')](_0x3d1881[_0x9d87('0x59')],[_0x9d87('0x64'),'id'])||{});}})[_0x9d87('0x33')](respondWithResult(_0x4786a1,null))['catch'](handleError(_0x4786a1,null));};exports[_0x9d87('0x88')]=function(_0x1c8e1f,_0x4ada22,_0x15d724){var _0x17bf52={'raw':![],'where':{}};var _0x225af5={};var _0x24374b={'count':0x0,'rows':[]};return db[_0x9d87('0x51')]['findOne']({'where':{'id':_0x1c8e1f['params']['id']}})['then'](handleEntityNotFound(_0x4ada22,null))['then'](function(_0x2cb022){if(_0x2cb022){_0x225af5['model']=_[_0x9d87('0x42')](db['MailInteraction']['rawAttributes']);_0x225af5[_0x9d87('0x41')]=_[_0x9d87('0x42')](_0x1c8e1f[_0x9d87('0x41')]);_0x225af5[_0x9d87('0x43')]=_[_0x9d87('0x56')](_0x225af5[_0x9d87('0x44')],_0x225af5[_0x9d87('0x41')]);_0x17bf52[_0x9d87('0x62')]=_[_0x9d87('0x56')](_0x225af5[_0x9d87('0x44')],qs[_0x9d87('0x45')](_0x1c8e1f['query'][_0x9d87('0x45')]));_0x17bf52[_0x9d87('0x62')]=_0x17bf52[_0x9d87('0x62')][_0x9d87('0x46')]?_0x17bf52['attributes']:_0x225af5[_0x9d87('0x44')];if(!_0x1c8e1f[_0x9d87('0x41')][_0x9d87('0x47')]('nolimit')){_0x17bf52[_0x9d87('0x2b')]=qs[_0x9d87('0x2b')](_0x1c8e1f['query'][_0x9d87('0x2b')]);_0x17bf52[_0x9d87('0x29')]=qs['offset'](_0x1c8e1f[_0x9d87('0x41')]['offset']);}_0x17bf52[_0x9d87('0x49')]=qs[_0x9d87('0x4a')](_0x1c8e1f[_0x9d87('0x41')][_0x9d87('0x4a')]);_0x17bf52[_0x9d87('0x4b')]=qs[_0x9d87('0x43')](_[_0x9d87('0x4c')](_0x1c8e1f['query'],_0x225af5[_0x9d87('0x43')]));_0x17bf52['where'][_0x9d87('0x5d')]=_0x2cb022['id'];if(_0x1c8e1f['query']['filter']){_0x17bf52[_0x9d87('0x4b')]=_['merge'](_0x17bf52['where'],{'$or':_[_0x9d87('0x3c')](_0x17bf52[_0x9d87('0x62')],function(_0x249157){var _0x4f8235={};_0x4f8235[_0x249157]={'$like':'%'+_0x1c8e1f[_0x9d87('0x41')]['filter']+'%'};return _0x4f8235;})});}_0x17bf52=_[_0x9d87('0x4f')]({},_0x17bf52,_0x1c8e1f[_0x9d87('0x50')]);return db['MailInteraction']['count']({'where':_0x17bf52[_0x9d87('0x4b')]})[_0x9d87('0x33')](function(_0x1298a2){_0x24374b[_0x9d87('0x2c')]=_0x1298a2;if(_0x1c8e1f[_0x9d87('0x41')][_0x9d87('0x52')]){_0x17bf52[_0x9d87('0x57')]=[{'model':db[_0x9d87('0x89')],'as':_0x9d87('0x8a'),'required':![]},{'model':db[_0x9d87('0x8b')],'as':_0x9d87('0x8c'),'attributes':[_0x9d87('0x35'),_0x9d87('0x8d'),_0x9d87('0x8e')],'required':![]},{'model':db[_0x9d87('0x8f')],'as':_0x9d87('0x90'),'attributes':['id',_0x9d87('0x35'),_0x9d87('0x91')],'where':_0x1c8e1f[_0x9d87('0x41')][_0x9d87('0x92')]?{'id':_0x1c8e1f[_0x9d87('0x41')]['tag']}:undefined,'required':_0x1c8e1f[_0x9d87('0x41')][_0x9d87('0x92')]?!![]:![]}];}return db[_0x9d87('0x86')][_0x9d87('0x53')](_0x17bf52);})['then'](function(_0x41ab6a){_0x24374b['rows']=_0x41ab6a;return _0x24374b;});}})[_0x9d87('0x33')](respondWithFilteredResult(_0x4ada22,_0x17bf52))[_0x9d87('0x25')](handleError(_0x4ada22,null));};exports[_0x9d87('0x93')]=function(_0x4a11ba,_0x1dd6e3,_0x12a429){return db[_0x9d87('0x51')]['findOne']({'where':{'id':_0x4a11ba[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x1dd6e3,null))[_0x9d87('0x33')](function(_0x3b0861){if(_0x3b0861){return db[_0x9d87('0x94')][_0x9d87('0x95')](function(_0x232824){return db[_0x9d87('0x96')][_0x9d87('0x32')]({'where':{'MailAccountId':_0x4a11ba['params']['id']},'transaction':_0x232824})[_0x9d87('0x33')](function(_0x582c82){var _0x5d0e28=_[_0x9d87('0x3c')](_0x4a11ba[_0x9d87('0x59')],function(_0x435933){_0x435933[_0x9d87('0x5d')]=_0x4a11ba[_0x9d87('0x5a')]['id'];return _0x435933;});return db[_0x9d87('0x96')][_0x9d87('0x97')](_0x5d0e28,{'transaction':_0x232824});});})[_0x9d87('0x33')](function(){return db[_0x9d87('0x96')][_0x9d87('0x98')]({'where':{'MailAccountId':_0x4a11ba[_0x9d87('0x5a')]['id']},'order':_0x9d87('0x99')});});}})[_0x9d87('0x33')](respondWithResult(_0x1dd6e3,null))[_0x9d87('0x25')](handleError(_0x1dd6e3,null));};exports[_0x9d87('0x9a')]=function(_0x353a46,_0x123a1d,_0x8bdcf2){var _0x442520={};var _0x475412={};var _0x344db6;var _0x39d081;return db[_0x9d87('0x51')][_0x9d87('0x61')]({'where':{'id':_0x353a46[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x123a1d,null))['then'](function(_0x18beca){if(_0x18beca){_0x344db6=_0x18beca;_0x475412[_0x9d87('0x44')]=_[_0x9d87('0x42')](db['MailApplication']['rawAttributes']);_0x475412['query']=_[_0x9d87('0x42')](_0x353a46['query']);_0x475412['filters']=_[_0x9d87('0x56')](_0x475412[_0x9d87('0x44')],_0x475412[_0x9d87('0x41')]);_0x442520['attributes']=_[_0x9d87('0x56')](_0x475412[_0x9d87('0x44')],qs['fields'](_0x353a46[_0x9d87('0x41')][_0x9d87('0x45')]));_0x442520[_0x9d87('0x62')]=_0x442520[_0x9d87('0x62')][_0x9d87('0x46')]?_0x442520['attributes']:_0x475412[_0x9d87('0x44')];_0x442520['order']=qs['sort'](_0x353a46[_0x9d87('0x41')]['sort']);_0x442520[_0x9d87('0x4b')]=qs[_0x9d87('0x43')](_['pick'](_0x353a46['query'],_0x475412['filters']));if(_0x353a46[_0x9d87('0x41')][_0x9d87('0x4e')]){_0x442520[_0x9d87('0x4b')]=_['merge'](_0x442520['where'],{'$or':_['map'](_0x442520[_0x9d87('0x62')],function(_0x2326d1){var _0x33bad5={};_0x33bad5[_0x2326d1]={'$like':'%'+_0x353a46[_0x9d87('0x41')][_0x9d87('0x4e')]+'%'};return _0x33bad5;})});}_0x442520=_[_0x9d87('0x4f')]({},_0x442520,_0x353a46['options']);return _0x344db6[_0x9d87('0x9a')](_0x442520);}})[_0x9d87('0x33')](function(_0x22ef7b){if(_0x22ef7b){_0x39d081=_0x22ef7b[_0x9d87('0x46')];if(!_0x353a46[_0x9d87('0x41')][_0x9d87('0x47')](_0x9d87('0x48'))){_0x442520[_0x9d87('0x2b')]=qs[_0x9d87('0x2b')](_0x353a46[_0x9d87('0x41')][_0x9d87('0x2b')]);_0x442520[_0x9d87('0x29')]=qs[_0x9d87('0x29')](_0x353a46[_0x9d87('0x41')][_0x9d87('0x29')]);}return _0x344db6[_0x9d87('0x9a')](_0x442520);}})[_0x9d87('0x33')](function(_0x1d6bc1){if(_0x1d6bc1){return _0x1d6bc1?{'count':_0x39d081,'rows':_0x1d6bc1}:null;}})[_0x9d87('0x33')](respondWithResult(_0x123a1d,null))[_0x9d87('0x25')](handleError(_0x123a1d,null));};exports['getMessages']=function(_0x14b159,_0x4aff30,_0x59d310){var _0x321599={'raw':!![],'where':{}};var _0x490f7c={};var _0x22657e={'count':0x0,'rows':[]};return db[_0x9d87('0x51')]['findOne']({'where':{'id':_0x14b159[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x4aff30,null))[_0x9d87('0x33')](function(_0x14ea7c){if(_0x14ea7c){_0x490f7c['model']=_[_0x9d87('0x42')](db['MailMessage'][_0x9d87('0x3d')]);_0x490f7c[_0x9d87('0x41')]=_[_0x9d87('0x42')](_0x14b159['query']);_0x490f7c[_0x9d87('0x43')]=_[_0x9d87('0x56')](_0x490f7c[_0x9d87('0x44')],_0x490f7c[_0x9d87('0x41')]);_0x321599[_0x9d87('0x62')]=_[_0x9d87('0x56')](_0x490f7c[_0x9d87('0x44')],qs[_0x9d87('0x45')](_0x14b159['query'][_0x9d87('0x45')]));_0x321599['attributes']=_0x321599[_0x9d87('0x62')][_0x9d87('0x46')]?_0x321599[_0x9d87('0x62')]:_0x490f7c[_0x9d87('0x44')];if(!_0x14b159['query'][_0x9d87('0x47')](_0x9d87('0x48'))){_0x321599[_0x9d87('0x2b')]=qs[_0x9d87('0x2b')](_0x14b159[_0x9d87('0x41')][_0x9d87('0x2b')]);_0x321599[_0x9d87('0x29')]=qs['offset'](_0x14b159[_0x9d87('0x41')][_0x9d87('0x29')]);}_0x321599[_0x9d87('0x49')]=qs[_0x9d87('0x4a')](_0x14b159[_0x9d87('0x41')][_0x9d87('0x4a')]);_0x321599[_0x9d87('0x4b')]=qs['filters'](_[_0x9d87('0x4c')](_0x14b159[_0x9d87('0x41')],_0x490f7c[_0x9d87('0x43')]));_0x321599[_0x9d87('0x4b')][_0x9d87('0x5d')]=_0x14ea7c['id'];if(_0x14b159[_0x9d87('0x41')]['filter']){_0x321599['where']=_[_0x9d87('0x4f')](_0x321599['where'],{'$or':_[_0x9d87('0x3c')](_0x321599[_0x9d87('0x62')],function(_0x2cdb2d){var _0x4737fe={};_0x4737fe[_0x2cdb2d]={'$like':'%'+_0x14b159['query'][_0x9d87('0x4e')]+'%'};return _0x4737fe;})});}if(_0x14b159[_0x9d87('0x41')][_0x9d87('0x9b')]){var _0x3d79df=_0x14b159[_0x9d87('0x41')][_0x9d87('0x9b')][_0x9d87('0x9c')](',');var _0x4cbae0={};_0x4cbae0[_0x3d79df[0x0]]={'$gte':moment(_0x3d79df[0x1])[_0x9d87('0x9d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x321599['where']=_[_0x9d87('0x4f')](_0x321599[_0x9d87('0x4b')],_0x4cbae0);}_0x321599=_['merge']({},_0x321599,_0x14b159[_0x9d87('0x50')]);return db[_0x9d87('0x9e')]['count']({'where':_0x321599[_0x9d87('0x4b')]})[_0x9d87('0x33')](function(_0x1b4b7b){_0x22657e[_0x9d87('0x2c')]=_0x1b4b7b;if(_0x14b159[_0x9d87('0x41')][_0x9d87('0x52')]){_0x321599[_0x9d87('0x57')]=[{'all':!![]}];}return db[_0x9d87('0x9e')]['findAll'](_0x321599);})[_0x9d87('0x33')](function(_0x161270){if(_0x14b159[_0x9d87('0x41')]['inlineCss']==='true'){for(var _0x53ffe5=0x0;_0x53ffe5<_0x161270[_0x9d87('0x46')];_0x53ffe5++){_0x161270[_0x53ffe5][_0x9d87('0x59')]=juice(_0x161270[_0x53ffe5][_0x9d87('0x59')]);}}_0x22657e[_0x9d87('0x54')]=_0x161270;return _0x22657e;});}})[_0x9d87('0x33')](respondWithFilteredResult(_0x4aff30,_0x321599))[_0x9d87('0x25')](handleError(_0x4aff30,null));};exports[_0x9d87('0x9f')]=function(_0x167f7e,_0x4a1acc,_0x2eb58a){var _0x355e58,_0x3b2b18={},_0x3ad3a4;if(_0x167f7e['body']['to']){_0x3ad3a4=_0x167f7e[_0x9d87('0x59')]['to'][_0x9d87('0x9c')](',')[0x0];}return db['MailAccount'][_0x9d87('0x58')]({'where':{'id':_0x167f7e[_0x9d87('0x5a')]['id']},'include':[{'model':db[_0x9d87('0xa0')],'as':_0x9d87('0xa1'),'include':[{'model':db[_0x9d87('0x89')],'as':_0x9d87('0xa2'),'where':{'email':_0x3ad3a4},'limit':0x1,'order':[['updatedAt',_0x9d87('0xa3')]]}]},{'model':db[_0x9d87('0x55')],'as':_0x9d87('0x39'),'raw':!![]}]})[_0x9d87('0x33')](handleEntityNotFound(_0x4a1acc,null))[_0x9d87('0x33')](function(_0x168e5c){if(_0x168e5c){_0x355e58=_0x168e5c;if(_0x168e5c['Smtp']){if(_['isNil'](_0x167f7e['body'][_0x9d87('0xa4')])){_0x167f7e['body'][_0x9d87('0xa4')]=util[_0x9d87('0x9d')]('%s\x20<%s>',_0x168e5c[_0x9d87('0x35')],_0x168e5c[_0x9d87('0x67')]||_0x168e5c[_0x9d87('0x39')]['user']);}if(_0x167f7e[_0x9d87('0x59')]['attachments']&&_0x167f7e['body'][_0x9d87('0xa5')]['length']){for(var _0x319747=0x0;_0x319747<_0x167f7e[_0x9d87('0x59')][_0x9d87('0xa5')][_0x9d87('0x46')];_0x319747+=0x1){_0x167f7e[_0x9d87('0x59')][_0x9d87('0xa5')][_0x319747]={'filename':_0x167f7e[_0x9d87('0x59')]['attachments'][_0x319747]['name'],'path':path[_0x9d87('0xa6')](config[_0x9d87('0xa7')],_0x9d87('0xa8'),_0x167f7e[_0x9d87('0x59')][_0x9d87('0xa5')][_0x319747][_0x9d87('0xa9')])};}}var _0x5f25bb={'tls':{'rejectUnauthorized':![]}};if(_[_0x9d87('0x69')](_0x168e5c['Smtp'][_0x9d87('0x75')])){if(_0x168e5c[_0x9d87('0x39')][_0x9d87('0x72')]){_0x5f25bb[_0x9d87('0xaa')]={'user':_0x168e5c['Smtp'][_0x9d87('0x6d')],'pass':_0x168e5c[_0x9d87('0x39')][_0x9d87('0x70')]};}_0x5f25bb[_0x9d87('0x73')]=_0x168e5c['Smtp']['host'];_0x5f25bb[_0x9d87('0x74')]=_0x168e5c[_0x9d87('0x39')]['port'];_0x5f25bb['secure']=_0x168e5c[_0x9d87('0x39')][_0x9d87('0xab')];}else{_0x5f25bb['service']=_0x168e5c[_0x9d87('0x39')][_0x9d87('0x75')];_0x5f25bb[_0x9d87('0xaa')]={'user':_0x168e5c[_0x9d87('0x39')]['user'],'pass':_0x168e5c['Smtp'][_0x9d87('0x70')]};}return respondWithRpcPromise('SendMail',_0x9d87('0xac'),{'account':_0x5f25bb,'message':_0x167f7e[_0x9d87('0x59')]});}else{throw new Error(_0x9d87('0xad'));}}})[_0x9d87('0x33')](function(_0x4e33ff){if(_0x4e33ff){_0x3b2b18=_0x4e33ff;if(_0x355e58[_0x9d87('0xa1')]){if(_0x355e58['List'][_0x9d87('0xa2')][_0x9d87('0x46')]){return _0x355e58[_0x9d87('0xa1')][_0x9d87('0xa2')][0x0];}else{return db['CmContact'][_0x9d87('0x5f')](_[_0x9d87('0x17')](_0x167f7e[_0x9d87('0x59')],{'firstName':_0x167f7e[_0x9d87('0x59')]['to'],'email':_0x167f7e[_0x9d87('0x59')]['to'],'phone':_0x167f7e[_0x9d87('0x59')]['to'],'ListId':_0x355e58[_0x9d87('0x68')]}));}}else{throw new Error(_0x9d87('0xad'));}}})[_0x9d87('0x33')](function(_0x5e9519){if(_0x5e9519){var _0xfe35a0={'UserId':_0x167f7e[_0x9d87('0x6d')]['id'],'ContactId':_0x5e9519['id'],'MailAccountId':_0x355e58['id'],'inReplyTo':_0x3b2b18['messageId'],'to':_0x167f7e[_0x9d87('0x59')][_0x9d87('0xa4')],'cc':_0x167f7e['body']['cc'],'subject':_0x167f7e['body'][_0x9d87('0xae')],'attach':_0x167f7e[_0x9d87('0x59')][_0x9d87('0xaf')],'firstMsgDirection':_0x9d87('0xb0'),'lastMsgAt':moment()['format'](_0x9d87('0xb1')),'lastMsgDirection':_0x9d87('0xb0'),'Messages':[_[_0x9d87('0x4f')](_0x167f7e['body'],{'messageId':_0x3b2b18[_0x9d87('0xb2')],'sentAt':moment()[_0x9d87('0x9d')](_0x9d87('0xb1')),'read':!![],'MailAccountId':_0x355e58['id'],'UserId':_0x167f7e[_0x9d87('0x6d')]['id'],'ContactId':_0x5e9519['id']})]};if(_0x167f7e[_0x9d87('0x59')][_0x9d87('0xb3')]){_0xfe35a0=_[_0x9d87('0x4f')](_0xfe35a0,_0x167f7e[_0x9d87('0x59')][_0x9d87('0xb3')]);}return db[_0x9d87('0x86')][_0x9d87('0x5f')](_0xfe35a0,{'include':[{'model':db['MailMessage'],'as':_0x9d87('0xb4')}]});}})['then'](respondWithResult(_0x4a1acc,null))[_0x9d87('0x25')](handleError(_0x4a1acc,null));};exports['verifySmtp']=function(_0x3349f2,_0x1eab6e,_0x5b204a){return db['MailAccount'][_0x9d87('0x58')]({'where':{'id':_0x3349f2[_0x9d87('0x5a')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x9d87('0x39'),'raw':!![]}]})[_0x9d87('0x33')](handleEntityNotFound(_0x1eab6e,null))[_0x9d87('0x33')](function(_0x31790d){if(_0x31790d&&_0x31790d[_0x9d87('0x39')]){var _0x2d913e={'id':_0x31790d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x31790d['Smtp'][_0x9d87('0x75')]){_0x2d913e[_0x9d87('0x75')]=_0x31790d[_0x9d87('0x39')][_0x9d87('0x75')];}else{_0x2d913e[_0x9d87('0x73')]=_0x31790d['Smtp'][_0x9d87('0x73')];_0x2d913e[_0x9d87('0x74')]=_0x31790d[_0x9d87('0x39')][_0x9d87('0x74')];_0x2d913e[_0x9d87('0xab')]=_0x31790d[_0x9d87('0x39')]['secure'];}if(_0x31790d[_0x9d87('0x39')]['authentication']){_0x2d913e[_0x9d87('0xaa')]={'user':_0x31790d[_0x9d87('0x39')][_0x9d87('0x6d')],'pass':_0x31790d[_0x9d87('0x39')][_0x9d87('0x70')]};}return respondWithRpcPromise(_0x9d87('0xb5'),'verifySmtp',{'account':_0x2d913e});}})[_0x9d87('0x33')](respondWithResult(_0x1eab6e,null))[_0x9d87('0x25')](handleError(_0x1eab6e,null));};exports[_0x9d87('0x32')]=function(_0xa90907,_0x2c9e1d){return db[_0x9d87('0x51')]['find']({'where':{'id':_0xa90907[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x2c9e1d,null))[_0x9d87('0x33')](function(_0x4c574e){if(_0x4c574e&&_0x4c574e['service']){throw new db[(_0x9d87('0xb6'))][(_0x9d87('0xb7'))](_0x9d87('0xb8'));}return _0x4c574e;})[_0x9d87('0x33')](removeEntity(_0x2c9e1d,null))[_0x9d87('0x25')](handleError(_0x2c9e1d,null));};exports['addAgents']=function(_0x49c081,_0x918bef,_0x2764a3){return db['MailAccount'][_0x9d87('0x58')]({'where':{'id':_0x49c081[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x918bef,null))[_0x9d87('0x33')](function(_0x11893b){if(_0x11893b){return _0x11893b[_0x9d87('0xb9')](_0x49c081['body'][_0x9d87('0x64')],_[_0x9d87('0x87')](_0x49c081[_0x9d87('0x59')],['ids','id'])||{})[_0x9d87('0xba')](function(_0x387b9f){for(var _0x1691c7=0x0;_0x1691c7<_0x49c081[_0x9d87('0x59')][_0x9d87('0x64')][_0x9d87('0x46')];_0x1691c7+=0x1){socket['emit'](_0x9d87('0xbb'),{'UserId':Number(_0x49c081['body'][_0x9d87('0x64')][_0x1691c7]),'MailAccountId':Number(_0x49c081[_0x9d87('0x5a')]['id'])});}return _0x387b9f;});}})[_0x9d87('0x33')](respondWithResult(_0x918bef,null))['catch'](handleError(_0x918bef,null));};exports[_0x9d87('0xbc')]=function(_0x1d7e87,_0x3d45f4,_0x17b34a){return db['MailAccount'][_0x9d87('0x58')]({'where':{'id':_0x1d7e87[_0x9d87('0x5a')]['id']}})[_0x9d87('0x33')](handleEntityNotFound(_0x3d45f4,null))[_0x9d87('0x33')](function(_0x4034ac){if(_0x4034ac){return _0x4034ac[_0x9d87('0xbc')](_0x1d7e87[_0x9d87('0x41')][_0x9d87('0x64')])[_0x9d87('0x33')](function(){if(_['isArray'](_0x1d7e87[_0x9d87('0x41')][_0x9d87('0x64')])){for(var _0x2001a4=0x0;_0x2001a4<_0x1d7e87[_0x9d87('0x41')][_0x9d87('0x64')][_0x9d87('0x46')];_0x2001a4+=0x1){socket[_0x9d87('0xbd')](_0x9d87('0xbe'),{'UserId':Number(_0x1d7e87[_0x9d87('0x41')][_0x9d87('0x64')][_0x2001a4]),'MailAccountId':Number(_0x1d7e87['params']['id'])});}}else{socket[_0x9d87('0xbd')](_0x9d87('0xbe'),{'UserId':Number(_0x1d7e87['query']['ids']),'MailAccountId':Number(_0x1d7e87[_0x9d87('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d45f4,null))[_0x9d87('0x25')](handleError(_0x3d45f4,null));};exports[_0x9d87('0xbf')]=function(_0x55bfb1,_0x440f66,_0x59a75c){var _0x2a9779={};var _0x4ea800={};var _0x2587a0;var _0x18bd24;return db[_0x9d87('0x51')]['findOne']({'where':{'id':_0x55bfb1[_0x9d87('0x5a')]['id']}})['then'](handleEntityNotFound(_0x440f66,null))[_0x9d87('0x33')](function(_0x36c073){if(_0x36c073){_0x2587a0=_0x36c073;_0x4ea800[_0x9d87('0x44')]=_['keys'](db['User'][_0x9d87('0x3d')]);_0x4ea800[_0x9d87('0x41')]=_[_0x9d87('0x42')](_0x55bfb1['query']);_0x4ea800[_0x9d87('0x43')]=_[_0x9d87('0x56')](_0x4ea800['model'],_0x4ea800[_0x9d87('0x41')]);_0x2a9779[_0x9d87('0x62')]=_[_0x9d87('0x56')](_0x4ea800[_0x9d87('0x44')],qs[_0x9d87('0x45')](_0x55bfb1[_0x9d87('0x41')][_0x9d87('0x45')]));_0x2a9779[_0x9d87('0x62')]=_0x2a9779[_0x9d87('0x62')][_0x9d87('0x46')]?_0x2a9779[_0x9d87('0x62')]:_0x4ea800[_0x9d87('0x44')];_0x2a9779[_0x9d87('0x49')]=qs['sort'](_0x55bfb1[_0x9d87('0x41')][_0x9d87('0x4a')]);_0x2a9779[_0x9d87('0x4b')]=qs[_0x9d87('0x43')](_[_0x9d87('0x4c')](_0x55bfb1[_0x9d87('0x41')],_0x4ea800['filters']));if(_0x55bfb1[_0x9d87('0x41')][_0x9d87('0x4e')]){_0x2a9779[_0x9d87('0x4b')]=_[_0x9d87('0x4f')](_0x2a9779['where'],{'$or':_['map'](_0x2a9779['attributes'],function(_0x210c2c){var _0x3c0597={};_0x3c0597[_0x210c2c]={'$like':'%'+_0x55bfb1[_0x9d87('0x41')][_0x9d87('0x4e')]+'%'};return _0x3c0597;})});}_0x2a9779=_['merge']({},_0x2a9779,_0x55bfb1[_0x9d87('0x50')]);return _0x2587a0['getAgents'](_0x2a9779);}})[_0x9d87('0x33')](function(_0x5269ed){if(_0x5269ed){_0x18bd24=_0x5269ed['length'];if(!_0x55bfb1[_0x9d87('0x41')][_0x9d87('0x47')](_0x9d87('0x48'))){_0x2a9779['limit']=qs[_0x9d87('0x2b')](_0x55bfb1[_0x9d87('0x41')][_0x9d87('0x2b')]);_0x2a9779[_0x9d87('0x29')]=qs[_0x9d87('0x29')](_0x55bfb1[_0x9d87('0x41')][_0x9d87('0x29')]);}return _0x2587a0[_0x9d87('0xbf')](_0x2a9779);}})[_0x9d87('0x33')](function(_0x49d064){if(_0x49d064){return _0x49d064?{'count':_0x18bd24,'rows':_0x49d064}:null;}})[_0x9d87('0x33')](respondWithResult(_0x440f66,null))[_0x9d87('0x25')](handleError(_0x440f66,null));};
\ No newline at end of file
index 2ce308b..6d1d637 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b77=['../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x15f603,_0x19466a){var _0x26fd2e=function(_0x57f840){while(--_0x57f840){_0x15f603['push'](_0x15f603['shift']());}};_0x26fd2e(++_0x19466a);}(_0x7b77,0x179));var _0x77b7=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x7b77[_0x2eb5bc];return _0x51c7b1;};'use strict';var EventEmitter=require(_0x77b7('0x0'));var MailAccount=require(_0x77b7('0x1'))['db'][_0x77b7('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x77b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x77b7('0x4'),'afterDestroy':_0x77b7('0x5')};function emitEvent(_0x3dbd97){return function(_0x5cfb6f,_0x4716a1,_0x139f98){MailAccountEvents[_0x77b7('0x6')](_0x3dbd97+':'+_0x5cfb6f['id'],_0x5cfb6f);MailAccountEvents[_0x77b7('0x6')](_0x3dbd97,_0x5cfb6f);_0x139f98(null);};}for(var e in events){if(events[_0x77b7('0x7')](e)){var event=events[e];MailAccount[_0x77b7('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
+var _0xb89c=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','update','remove'];(function(_0x176259,_0x30e46f){var _0x48dc40=function(_0x3aa524){while(--_0x3aa524){_0x176259['push'](_0x176259['shift']());}};_0x48dc40(++_0x30e46f);}(_0xb89c,0x198));var _0xcb89=function(_0x531007,_0x31ec8b){_0x531007=_0x531007-0x0;var _0x1938c5=_0xb89c[_0x531007];return _0x1938c5;};'use strict';var EventEmitter=require(_0xcb89('0x0'));var MailAccount=require(_0xcb89('0x1'))['db'][_0xcb89('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xcb89('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcb89('0x4'),'afterDestroy':_0xcb89('0x5')};function emitEvent(_0x57c08c){return function(_0x387b27,_0x777f33,_0x49bdbe){MailAccountEvents['emit'](_0x57c08c+':'+_0x387b27['id'],_0x387b27);MailAccountEvents['emit'](_0x57c08c,_0x387b27);_0x49bdbe(null);};}for(var e in events){if(events[_0xcb89('0x6')](e)){var event=events[e];MailAccount[_0xcb89('0x7')](e,emitEvent(event));}}module[_0xcb89('0x8')]=MailAccountEvents;
\ No newline at end of file
index 7052e21..60ce36a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88f9=['util','../../config/logger','api','moment','bluebird','path','./mailAccount.attributes','define','lodash'];(function(_0x195577,_0x5de53a){var _0x13c367=function(_0x583022){while(--_0x583022){_0x195577['push'](_0x195577['shift']());}};_0x13c367(++_0x5de53a);}(_0x88f9,0x19d));var _0x988f=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x88f9[_0x3474ac];return _0x5345ec;};'use strict';var _=require(_0x988f('0x0'));var util=require(_0x988f('0x1'));var logger=require(_0x988f('0x2'))(_0x988f('0x3'));var moment=require(_0x988f('0x4'));var BPromise=require(_0x988f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x988f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x988f('0x7'));module['exports']=function(_0x2570b2,_0x4ecb0f){return _0x2570b2[_0x988f('0x8')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x20d0=['MailAccount','lodash','../../config/logger','bluebird','rimraf','exports','define'];(function(_0x2e0108,_0x569adf){var _0xf66b41=function(_0x4caf19){while(--_0x4caf19){_0x2e0108['push'](_0x2e0108['shift']());}};_0xf66b41(++_0x569adf);}(_0x20d0,0x10b));var _0x020d=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x20d0[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require(_0x020d('0x0'));var util=require('util');var logger=require(_0x020d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x020d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x020d('0x3'));var config=require('../../config/environment');var attributes=require('./mailAccount.attributes');module[_0x020d('0x4')]=function(_0x47fa72,_0x772d06){return _0x47fa72[_0x020d('0x5')](_0x020d('0x6'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7b1a5b1..2cde9e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x763d=['originCc','originChannel','Email','Attachments','UserId','User','name','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','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','error','code','message','result','catch','GetMailAccount','MailAccount','options','raw','where','attributes','limit','include','model','map','ShowMailAccount','find','NotifyMailAccount','body','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','CmList','List','CmContact','Contacts','MailApplication','Applications','MailServerOut','Smtp','omit','applications','orderBy','priority','asc','push','length','close','autoclose','*,*,*,*','List\x20not\x20found','contact','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','create','Contact\x20not\x20found','spread','subject','interaction','get','created','MailMessage','attachments','originTo'];(function(_0x4c836f,_0x27e6bb){var _0x53d519=function(_0x1a5a80){while(--_0x1a5a80){_0x4c836f['push'](_0x4c836f['shift']());}};_0x53d519(++_0x27e6bb);}(_0x763d,0x6f));var _0xd763=function(_0x4ce15a,_0x105a9d){_0x4ce15a=_0x4ce15a-0x0;var _0x4bd614=_0x763d[_0x4ce15a];return _0x4bd614;};'use strict';var _=require(_0xd763('0x0'));var util=require(_0xd763('0x1'));var moment=require(_0xd763('0x2'));var BPromise=require(_0xd763('0x3'));var rs=require(_0xd763('0x4'));var fs=require('fs');var Redis=require(_0xd763('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd763('0x6'));var logger=require(_0xd763('0x7'))(_0xd763('0x8'));var config=require(_0xd763('0x9'));var jayson=require(_0xd763('0xa'));var client=jayson[_0xd763('0xb')]['http']({'port':0x232c});config['redis']=_[_0xd763('0xc')](config[_0xd763('0xd')],{'host':_0xd763('0xe'),'port':0x18eb});var socket=require(_0xd763('0xf'))(new Redis(config[_0xd763('0xd')]));require(_0xd763('0x10'))[_0xd763('0x11')](socket);function respondWithRpcPromise(_0x46f6d4,_0x214204,_0x4455f2){return new BPromise(function(_0x860baa,_0x45961d){return client[_0xd763('0x12')](_0x46f6d4,_0x4455f2)[_0xd763('0x13')](function(_0x31ca36){logger[_0xd763('0x14')](_0xd763('0x15'),_0x214204,_0xd763('0x16'));logger[_0xd763('0x17')](_0xd763('0x18'),_0x214204,_0xd763('0x16'),JSON[_0xd763('0x19')](_0x31ca36));if(_0x31ca36[_0xd763('0x1a')]){if(_0x31ca36[_0xd763('0x1a')][_0xd763('0x1b')]===0x1f4){logger[_0xd763('0x1a')](_0xd763('0x15'),_0x214204,_0x31ca36[_0xd763('0x1a')][_0xd763('0x1c')]);return _0x45961d(_0x31ca36['error']['message']);}logger['error'](_0xd763('0x15'),_0x214204,_0x31ca36['error']['message']);return _0x860baa(_0x31ca36[_0xd763('0x1a')]['message']);}else{logger[_0xd763('0x14')](_0xd763('0x15'),_0x214204,'request\x20sent');_0x860baa(_0x31ca36[_0xd763('0x1d')]['message']);}})[_0xd763('0x1e')](function(_0x5c5208){logger[_0xd763('0x1a')](_0xd763('0x15'),_0x214204,_0x5c5208);_0x45961d(_0x5c5208);});});}exports[_0xd763('0x1f')]=function(_0x54370a){var _0xf4d2e7=this;return new Promise(function(_0x215b82,_0x10fa47){return db[_0xd763('0x20')]['findAll']({'raw':_0x54370a['options']?_0x54370a[_0xd763('0x21')][_0xd763('0x22')]===undefined?!![]:![]:!![],'where':_0x54370a[_0xd763('0x21')]?_0x54370a[_0xd763('0x21')][_0xd763('0x23')]||null:null,'attributes':_0x54370a[_0xd763('0x21')]?_0x54370a['options'][_0xd763('0x24')]||null:null,'limit':_0x54370a['options']?_0x54370a[_0xd763('0x21')][_0xd763('0x25')]||null:null,'include':_0x54370a[_0xd763('0x21')]?_0x54370a[_0xd763('0x21')][_0xd763('0x26')]?_['map'](_0x54370a['options'][_0xd763('0x26')],function(_0x3c46d6){return{'model':db[_0x3c46d6[_0xd763('0x27')]],'as':_0x3c46d6['as'],'attributes':_0x3c46d6[_0xd763('0x24')],'include':_0x3c46d6[_0xd763('0x26')]?_[_0xd763('0x28')](_0x3c46d6['include'],function(_0x56c190){return{'model':db[_0x56c190[_0xd763('0x27')]],'as':_0x56c190['as'],'attributes':_0x56c190[_0xd763('0x24')],'include':_0x56c190[_0xd763('0x26')]?_['map'](_0x56c190[_0xd763('0x26')],function(_0x419023){return{'model':db[_0x419023[_0xd763('0x27')]],'as':_0x419023['as'],'attributes':_0x419023[_0xd763('0x24')]};}):[]};}):[]};}):[]:[]})[_0xd763('0x13')](function(_0x2611af){logger[_0xd763('0x14')](_0xd763('0x1f'),_0x54370a);logger[_0xd763('0x17')]('GetMailAccount',_0x54370a,JSON[_0xd763('0x19')](_0x2611af));_0x215b82(_0x2611af);})[_0xd763('0x1e')](function(_0x2f34c3){logger[_0xd763('0x1a')](_0xd763('0x1f'),_0x2f34c3[_0xd763('0x1c')],_0x54370a);_0x10fa47(_0xf4d2e7[_0xd763('0x1a')](0x1f4,_0x2f34c3[_0xd763('0x1c')]));});});};exports[_0xd763('0x29')]=function(_0x32b0b4){var _0x22148b=this;return new Promise(function(_0x35dc46,_0x32bcda){return db['MailAccount'][_0xd763('0x2a')]({'raw':_0x32b0b4[_0xd763('0x21')]?_0x32b0b4[_0xd763('0x21')][_0xd763('0x22')]===undefined?!![]:![]:!![],'where':_0x32b0b4[_0xd763('0x21')]?_0x32b0b4['options'][_0xd763('0x23')]||null:null,'attributes':_0x32b0b4['options']?_0x32b0b4[_0xd763('0x21')]['attributes']||null:null,'include':_0x32b0b4[_0xd763('0x21')]?_0x32b0b4[_0xd763('0x21')]['include']?_[_0xd763('0x28')](_0x32b0b4[_0xd763('0x21')][_0xd763('0x26')],function(_0x2224c7){return{'model':db[_0x2224c7[_0xd763('0x27')]],'as':_0x2224c7['as'],'attributes':_0x2224c7[_0xd763('0x24')],'include':_0x2224c7['include']?_[_0xd763('0x28')](_0x2224c7['include'],function(_0x19dbc2){return{'model':db[_0x19dbc2[_0xd763('0x27')]],'as':_0x19dbc2['as'],'attributes':_0x19dbc2[_0xd763('0x24')],'include':_0x19dbc2[_0xd763('0x26')]?_[_0xd763('0x28')](_0x19dbc2[_0xd763('0x26')],function(_0xe4360d){return{'model':db[_0xe4360d['model']],'as':_0xe4360d['as'],'attributes':_0xe4360d['attributes']};}):[]};}):[]};}):[]:[]})[_0xd763('0x13')](function(_0x21fffe){logger[_0xd763('0x14')](_0xd763('0x29'),_0x32b0b4);logger['debug'](_0xd763('0x29'),_0x32b0b4,JSON[_0xd763('0x19')](_0x21fffe));_0x35dc46(_0x21fffe);})['catch'](function(_0x23aea4){logger[_0xd763('0x1a')](_0xd763('0x29'),_0x23aea4[_0xd763('0x1c')],_0x32b0b4);_0x32bcda(_0x22148b[_0xd763('0x1a')](0x1f4,_0x23aea4[_0xd763('0x1c')]));});});};exports[_0xd763('0x2b')]=function(_0x43de7c){var _0xd4eebb=this;return new Promise(function(_0x4b9ac9,_0x35bb78){var _0x36324b={'body':_0x43de7c[_0xd763('0x2c')],'channel':'mail'};var _0x2d1944=_[_0xd763('0x2d')](_[_0xd763('0x2e')](db['CmContact']['rawAttributes']),[_0xd763('0x2f'),_0xd763('0x30'),_0xd763('0x31'),_0xd763('0x32')]);var _0x19f3ef=![];if(_0x43de7c['body']['id']){delete _0x43de7c[_0xd763('0x2c')]['id'];}if(_[_0xd763('0x33')](_0x43de7c[_0xd763('0x2c')][_0xd763('0x34')])){return _0x35bb78(_0xd4eebb[_0xd763('0x1a')](0x1f4,_0xd763('0x35')));}if(_[_0xd763('0x33')](_0x43de7c[_0xd763('0x2c')][_0xd763('0x2c')])||_0x43de7c[_0xd763('0x2c')]['body']===''){return _0x35bb78(_0xd4eebb['error'](0x1f4,_0xd763('0x36')));}if(_[_0xd763('0x33')](_0x43de7c[_0xd763('0x2c')][_0xd763('0x37')])){return _0x35bb78(_0xd4eebb[_0xd763('0x1a')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d1944));}if(!_[_0xd763('0x38')](_0x2d1944,_0x43de7c[_0xd763('0x2c')]['mapKey'])){return _0x35bb78(_0xd4eebb[_0xd763('0x1a')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d1944));}var _0x266de0={};_0x266de0[_0x43de7c['body']['mapKey']]=_0x43de7c[_0xd763('0x2c')][_0xd763('0x34')];return db[_0xd763('0x20')][_0xd763('0x2a')]({'where':{'id':_0x43de7c[_0xd763('0x39')]['id']},'include':[{'model':db[_0xd763('0x3a')],'as':_0xd763('0x3b'),'include':[{'model':db[_0xd763('0x3c')],'as':_0xd763('0x3d'),'where':_0x266de0,'limit':0x1,'order':[[_0xd763('0x30'),'DESC']]}]},{'model':db[_0xd763('0x3e')],'as':_0xd763('0x3f')},{'model':db[_0xd763('0x40')],'as':_0xd763('0x41')}]})['then'](function(_0x46c9b9){if(_0x46c9b9&&_0x46c9b9['List']){var _0x3e2bb1=_0x46c9b9['get']({'plain':!![]});_0x36324b[_0xd763('0x39')]=_[_0xd763('0x42')](_0x3e2bb1,[_0xd763('0x3f'),'List']);_0x36324b[_0xd763('0x43')]=_0x3e2bb1[_0xd763('0x3f')];_0x36324b['list']=_0x3e2bb1[_0xd763('0x3b')];_0x36324b[_0xd763('0x43')]=_[_0xd763('0x44')](_0x36324b[_0xd763('0x43')],[_0xd763('0x45')],[_0xd763('0x46')]);if(_0x36324b[_0xd763('0x39')]&&_0x36324b['account']['autoclose']){_0x36324b[_0xd763('0x43')][_0xd763('0x47')]({'id':0x0,'priority':_0x36324b[_0xd763('0x43')][_0xd763('0x48')]+0x1,'app':_0xd763('0x49'),'appdata':_0xd763('0x4a'),'interval':_0xd763('0x4b')});}if(_0x36324b['account'][_0xd763('0x3f')]){delete _0x36324b['account']['Applications'];}if(_0x36324b[_0xd763('0x39')][_0xd763('0x3b')]){delete _0x36324b['account'][_0xd763('0x3b')];}if(_0x3e2bb1['List'][_0xd763('0x3d')][_0xd763('0x48')]){return _0x3e2bb1['List'][_0xd763('0x3d')][0x0];}var _0x48bb37=_[_0xd763('0xc')](_0x43de7c[_0xd763('0x2c')],{'firstName':_0x43de7c[_0xd763('0x2c')][_0xd763('0x34')],'ListId':_0x3e2bb1[_0xd763('0x32')]});_0x48bb37[_0x43de7c[_0xd763('0x2c')][_0xd763('0x37')]]=_0x43de7c[_0xd763('0x2c')]['from'];return db[_0xd763('0x3c')]['create'](_0x48bb37);}else{throw new Error(_0xd763('0x4c'));}})['then'](function(_0x5b3acd){_0x36324b[_0xd763('0x4d')]=_0x5b3acd;if(_0x5b3acd){if(!_0x43de7c['body'][_0xd763('0x1c')][_0xd763('0x4e')]){_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['messageId']=rs[_0xd763('0x4f')]()+'\x20'+_0x43de7c['body'][_0xd763('0x1c')][_0xd763('0x34')];}var _0xc21d30={'ContactId':_0x5b3acd['id'],'MailAccountId':_0x43de7c[_0xd763('0x39')]['id'],'inReplyTo':_0x43de7c['body'][_0xd763('0x1c')][_0xd763('0x4e')],'to':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')][_0xd763('0x34')],'cc':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['cc'],'subject':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['subject'],'attach':_0x43de7c['body'][_0xd763('0x1c')][_0xd763('0x50')],'lastMsgAt':moment()[_0xd763('0x51')](_0xd763('0x52')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x43de7c[_0xd763('0x39')]['id']},'include':[{'model':db['MailMessage'],'as':_0xd763('0x53'),'attributes':['messageId'],'where':{'messageId':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')][_0xd763('0x54')]}}]})[_0xd763('0x13')](function(_0x548600){if(_0x548600){return[_0x548600,![]];}return db['MailInteraction'][_0xd763('0x55')](_0xc21d30)[_0xd763('0x13')](function(_0x3173d7){return[_0x3173d7,!![]];});});}else{throw new Error(_0xd763('0x56'));}})[_0xd763('0x57')](function(_0x469146,_0x1b5d4d){if(_0x469146){_0x19f3ef=_0x1b5d4d;if(!_0x1b5d4d){return _0x469146['update']({'inReplyTo':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['messageId'],'to':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['from'],'cc':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['cc'],'subject':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')][_0xd763('0x58')],'attach':_0x469146[_0xd763('0x50')]?_0x469146[_0xd763('0x50')]:_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')][_0xd763('0x50')],'substatus':null,'substatusAt':moment()[_0xd763('0x51')](_0xd763('0x52')),'lastMsgAt':moment()[_0xd763('0x51')](_0xd763('0x52')),'lastMsgDirection':'in'});}else{return _0x469146;}}})[_0xd763('0x13')](function(_0x5527b4){_0x36324b[_0xd763('0x59')]=_0x5527b4[_0xd763('0x5a')]({'plain':!![]});_0x36324b[_0xd763('0x59')][_0xd763('0x5b')]=_0x19f3ef;return db[_0xd763('0x5c')][_0xd763('0x55')]({'body':_0x43de7c[_0xd763('0x2c')][_0xd763('0x2c')],'MailAccountId':_0x43de7c[_0xd763('0x39')]['id'],'MailInteractionId':_0x5527b4['id'],'direction':'in','ContactId':_0x36324b['contact']['id'],'messageId':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')][_0xd763('0x4e')],'from':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['from'],'to':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['to'],'cc':_0x43de7c['body']['message']['cc'],'subject':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')][_0xd763('0x58')],'attach':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')][_0xd763('0x50')],'Attachments':_0x43de7c['body']['message'][_0xd763('0x5d')],'originTo':_0x43de7c[_0xd763('0x2c')]['message'][_0xd763('0x5e')],'originCc':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')][_0xd763('0x5f')],'bcc':_0x43de7c[_0xd763('0x2c')]['message']['bcc'],'ChatWebsiteId':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['ChatWebsiteId']||null,'originChannel':_0x43de7c[_0xd763('0x2c')]['message'][_0xd763('0x60')]||_0xd763('0x61'),'ChatOfflineMessageId':_0x43de7c[_0xd763('0x2c')][_0xd763('0x1c')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xd763('0x62')}]});})['then'](function(_0x413c8e){_0x36324b[_0xd763('0x1c')]=_0x413c8e;if(_0x36324b[_0xd763('0x59')][_0xd763('0x63')]){return db[_0xd763('0x64')][_0xd763('0x2a')]({'attributes':['id',_0xd763('0x65')],'where':{'id':_0x36324b[_0xd763('0x59')]['UserId']}})['then'](function(_0x4b6afc){if(_0x4b6afc){_0x36324b[_0xd763('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4b6afc[_0xd763('0x65')]+','+(_0x36324b['account']['waitForTheAssignedAgent']||0xa),'interval':_0xd763('0x4b')});}return respondWithRpcPromise('Start',_0xd763('0x66'),_0x36324b);});}return respondWithRpcPromise('Start',_0xd763('0x66'),_0x36324b);})[_0xd763('0x13')](function(_0x3a77b1){_0x4b9ac9(_0x3a77b1);})[_0xd763('0x1e')](function(_0x26a8aa){_0x35bb78(_0xd4eebb['error'](0x1f4,_0x26a8aa[_0xd763('0x1c')]));});});};
\ No newline at end of file
+var _0x5845=['priority','asc','length','autoclose','*,*,*,*','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','create','update','interaction','created','attachments','bcc','ChatWebsiteId','originChannel','Email','Attachment','UserId','User','find','name','Start','startRouting','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','ShowMailAccount','NotifyMailAccount','body','mail','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','omit','applications','list','orderBy'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x5845,0x7b));var _0x5584=function(_0x2ba0f6,_0x4f0200){_0x2ba0f6=_0x2ba0f6-0x0;var _0x48ac6b=_0x5845[_0x2ba0f6];return _0x48ac6b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5584('0x0'));var BPromise=require(_0x5584('0x1'));var rs=require(_0x5584('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5584('0x3'))['db'];var utils=require(_0x5584('0x4'));var logger=require('../../config/logger')(_0x5584('0x5'));var config=require('../../config/environment');var jayson=require(_0x5584('0x6'));var client=jayson[_0x5584('0x7')][_0x5584('0x8')]({'port':0x232c});config[_0x5584('0x9')]=_['defaults'](config[_0x5584('0x9')],{'host':_0x5584('0xa'),'port':0x18eb});var socket=require(_0x5584('0xb'))(new Redis(config[_0x5584('0x9')]));require(_0x5584('0xc'))['register'](socket);function respondWithRpcPromise(_0x1875f7,_0x487c6a,_0x53e5fb){return new BPromise(function(_0x5f52fd,_0x17f725){return client[_0x5584('0xd')](_0x1875f7,_0x53e5fb)[_0x5584('0xe')](function(_0x2c703c){logger['info'](_0x5584('0xf'),_0x487c6a,_0x5584('0x10'));logger['debug'](_0x5584('0x11'),_0x487c6a,_0x5584('0x10'),JSON['stringify'](_0x2c703c));if(_0x2c703c[_0x5584('0x12')]){if(_0x2c703c[_0x5584('0x12')]['code']===0x1f4){logger[_0x5584('0x12')](_0x5584('0xf'),_0x487c6a,_0x2c703c[_0x5584('0x12')]['message']);return _0x17f725(_0x2c703c['error'][_0x5584('0x13')]);}logger[_0x5584('0x12')](_0x5584('0xf'),_0x487c6a,_0x2c703c[_0x5584('0x12')][_0x5584('0x13')]);return _0x5f52fd(_0x2c703c['error'][_0x5584('0x13')]);}else{logger[_0x5584('0x14')](_0x5584('0xf'),_0x487c6a,_0x5584('0x10'));_0x5f52fd(_0x2c703c['result']['message']);}})[_0x5584('0x15')](function(_0x19e4d6){logger[_0x5584('0x12')](_0x5584('0xf'),_0x487c6a,_0x19e4d6);_0x17f725(_0x19e4d6);});});}exports[_0x5584('0x16')]=function(_0x2c5731){var _0xa445c4=this;return new Promise(function(_0x187e5f,_0x2c6a26){return db[_0x5584('0x17')][_0x5584('0x18')]({'raw':_0x2c5731[_0x5584('0x19')]?_0x2c5731[_0x5584('0x19')][_0x5584('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c5731[_0x5584('0x19')]?_0x2c5731[_0x5584('0x19')]['where']||null:null,'attributes':_0x2c5731[_0x5584('0x19')]?_0x2c5731['options'][_0x5584('0x1b')]||null:null,'limit':_0x2c5731['options']?_0x2c5731[_0x5584('0x19')][_0x5584('0x1c')]||null:null,'include':_0x2c5731[_0x5584('0x19')]?_0x2c5731[_0x5584('0x19')][_0x5584('0x1d')]?_[_0x5584('0x1e')](_0x2c5731[_0x5584('0x19')][_0x5584('0x1d')],function(_0x5e71b5){return{'model':db[_0x5e71b5['model']],'as':_0x5e71b5['as'],'attributes':_0x5e71b5[_0x5584('0x1b')],'include':_0x5e71b5[_0x5584('0x1d')]?_['map'](_0x5e71b5[_0x5584('0x1d')],function(_0x255035){return{'model':db[_0x255035[_0x5584('0x1f')]],'as':_0x255035['as'],'attributes':_0x255035[_0x5584('0x1b')],'include':_0x255035[_0x5584('0x1d')]?_[_0x5584('0x1e')](_0x255035[_0x5584('0x1d')],function(_0x17753e){return{'model':db[_0x17753e[_0x5584('0x1f')]],'as':_0x17753e['as'],'attributes':_0x17753e[_0x5584('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5584('0xe')](function(_0x4ed60d){logger[_0x5584('0x14')](_0x5584('0x16'),_0x2c5731);logger[_0x5584('0x20')]('GetMailAccount',_0x2c5731,JSON[_0x5584('0x21')](_0x4ed60d));_0x187e5f(_0x4ed60d);})[_0x5584('0x15')](function(_0x22a668){logger['error']('GetMailAccount',_0x22a668[_0x5584('0x13')],_0x2c5731);_0x2c6a26(_0xa445c4[_0x5584('0x12')](0x1f4,_0x22a668[_0x5584('0x13')]));});});};exports[_0x5584('0x22')]=function(_0x1816a4){var _0xb74ead=this;return new Promise(function(_0x5bf8c6,_0x9cad88){return db[_0x5584('0x17')]['find']({'raw':_0x1816a4[_0x5584('0x19')]?_0x1816a4[_0x5584('0x19')][_0x5584('0x1a')]===undefined?!![]:![]:!![],'where':_0x1816a4[_0x5584('0x19')]?_0x1816a4[_0x5584('0x19')]['where']||null:null,'attributes':_0x1816a4[_0x5584('0x19')]?_0x1816a4[_0x5584('0x19')][_0x5584('0x1b')]||null:null,'include':_0x1816a4[_0x5584('0x19')]?_0x1816a4[_0x5584('0x19')]['include']?_[_0x5584('0x1e')](_0x1816a4[_0x5584('0x19')][_0x5584('0x1d')],function(_0x19b0a1){return{'model':db[_0x19b0a1['model']],'as':_0x19b0a1['as'],'attributes':_0x19b0a1[_0x5584('0x1b')],'include':_0x19b0a1[_0x5584('0x1d')]?_[_0x5584('0x1e')](_0x19b0a1[_0x5584('0x1d')],function(_0x42d7e5){return{'model':db[_0x42d7e5[_0x5584('0x1f')]],'as':_0x42d7e5['as'],'attributes':_0x42d7e5[_0x5584('0x1b')],'include':_0x42d7e5['include']?_[_0x5584('0x1e')](_0x42d7e5[_0x5584('0x1d')],function(_0x4fe8e4){return{'model':db[_0x4fe8e4['model']],'as':_0x4fe8e4['as'],'attributes':_0x4fe8e4[_0x5584('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5584('0xe')](function(_0x4d5b78){logger[_0x5584('0x14')](_0x5584('0x22'),_0x1816a4);logger[_0x5584('0x20')]('ShowMailAccount',_0x1816a4,JSON[_0x5584('0x21')](_0x4d5b78));_0x5bf8c6(_0x4d5b78);})[_0x5584('0x15')](function(_0xf3f850){logger[_0x5584('0x12')](_0x5584('0x22'),_0xf3f850[_0x5584('0x13')],_0x1816a4);_0x9cad88(_0xb74ead['error'](0x1f4,_0xf3f850[_0x5584('0x13')]));});});};exports[_0x5584('0x23')]=function(_0x260c48){var _0x201640=this;return new Promise(function(_0x23eb8c,_0x1e9b41){var _0x4b7c02={'body':_0x260c48[_0x5584('0x24')],'channel':_0x5584('0x25')};var _0x518321=_['difference'](_['keys'](db[_0x5584('0x26')][_0x5584('0x27')]),['createdAt',_0x5584('0x28'),_0x5584('0x29'),_0x5584('0x2a')]);var _0x3c0990=![];if(_0x260c48[_0x5584('0x24')]['id']){delete _0x260c48['body']['id'];}if(_[_0x5584('0x2b')](_0x260c48['body']['from'])){return _0x1e9b41(_0x201640[_0x5584('0x12')](0x1f4,_0x5584('0x2c')));}if(_[_0x5584('0x2b')](_0x260c48[_0x5584('0x24')][_0x5584('0x24')])||_0x260c48[_0x5584('0x24')]['body']===''){return _0x1e9b41(_0x201640['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5584('0x2b')](_0x260c48[_0x5584('0x24')][_0x5584('0x2d')])){return _0x1e9b41(_0x201640[_0x5584('0x12')](0x1f4,_0x5584('0x2e')+_0x518321));}if(!_[_0x5584('0x2f')](_0x518321,_0x260c48['body'][_0x5584('0x2d')])){return _0x1e9b41(_0x201640['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x518321));}var _0x52783b={};_0x52783b[_0x260c48['body'][_0x5584('0x2d')]]=_0x260c48['body'][_0x5584('0x30')];return db[_0x5584('0x17')]['find']({'where':{'id':_0x260c48[_0x5584('0x31')]['id']},'include':[{'model':db[_0x5584('0x32')],'as':_0x5584('0x33'),'include':[{'model':db[_0x5584('0x26')],'as':_0x5584('0x34'),'where':_0x52783b,'limit':0x1,'order':[[_0x5584('0x28'),_0x5584('0x35')]]}]},{'model':db[_0x5584('0x36')],'as':_0x5584('0x37')},{'model':db['MailServerOut'],'as':_0x5584('0x38')}]})[_0x5584('0xe')](function(_0x3a22b3){if(_0x3a22b3&&_0x3a22b3[_0x5584('0x33')]){var _0x5dcdfb=_0x3a22b3['get']({'plain':!![]});_0x4b7c02['account']=_[_0x5584('0x39')](_0x5dcdfb,[_0x5584('0x37'),_0x5584('0x33')]);_0x4b7c02[_0x5584('0x3a')]=_0x5dcdfb[_0x5584('0x37')];_0x4b7c02[_0x5584('0x3b')]=_0x5dcdfb[_0x5584('0x33')];_0x4b7c02[_0x5584('0x3a')]=_[_0x5584('0x3c')](_0x4b7c02[_0x5584('0x3a')],[_0x5584('0x3d')],[_0x5584('0x3e')]);if(_0x4b7c02[_0x5584('0x31')]&&_0x4b7c02['account']['autoclose']){_0x4b7c02[_0x5584('0x3a')]['push']({'id':0x0,'priority':_0x4b7c02[_0x5584('0x3a')][_0x5584('0x3f')]+0x1,'app':'close','appdata':_0x5584('0x40'),'interval':_0x5584('0x41')});}if(_0x4b7c02[_0x5584('0x31')][_0x5584('0x37')]){delete _0x4b7c02['account']['Applications'];}if(_0x4b7c02[_0x5584('0x31')][_0x5584('0x33')]){delete _0x4b7c02['account'][_0x5584('0x33')];}if(_0x5dcdfb[_0x5584('0x33')]['Contacts'][_0x5584('0x3f')]){return _0x5dcdfb[_0x5584('0x33')][_0x5584('0x34')][0x0];}var _0x1cafad=_['defaults'](_0x260c48[_0x5584('0x24')],{'firstName':_0x260c48[_0x5584('0x24')][_0x5584('0x30')],'ListId':_0x5dcdfb[_0x5584('0x2a')]});_0x1cafad[_0x260c48[_0x5584('0x24')][_0x5584('0x2d')]]=_0x260c48['body'][_0x5584('0x30')];return db[_0x5584('0x26')]['create'](_0x1cafad);}else{throw new Error(_0x5584('0x42'));}})[_0x5584('0xe')](function(_0x5685e3){_0x4b7c02[_0x5584('0x43')]=_0x5685e3;if(_0x5685e3){if(!_0x260c48[_0x5584('0x24')]['message'][_0x5584('0x44')]){_0x260c48[_0x5584('0x24')][_0x5584('0x13')][_0x5584('0x44')]=rs['generate']()+'\x20'+_0x260c48[_0x5584('0x24')][_0x5584('0x13')]['from'];}var _0x4456b6={'ContactId':_0x5685e3['id'],'MailAccountId':_0x260c48[_0x5584('0x31')]['id'],'inReplyTo':_0x260c48[_0x5584('0x24')][_0x5584('0x13')][_0x5584('0x44')],'to':_0x260c48['body'][_0x5584('0x13')]['from'],'cc':_0x260c48[_0x5584('0x24')][_0x5584('0x13')]['cc'],'subject':_0x260c48['body'][_0x5584('0x13')][_0x5584('0x45')],'attach':_0x260c48[_0x5584('0x24')][_0x5584('0x13')][_0x5584('0x46')],'lastMsgAt':moment()[_0x5584('0x47')](_0x5584('0x48')),'lastMsgDirection':'in'};return db[_0x5584('0x49')]['find']({'where':{'closed':![],'MailAccountId':_0x260c48[_0x5584('0x31')]['id']},'include':[{'model':db['MailMessage'],'as':_0x5584('0x4a'),'attributes':[_0x5584('0x44')],'where':{'messageId':_0x260c48['body'][_0x5584('0x13')][_0x5584('0x4b')]}}]})[_0x5584('0xe')](function(_0xb6dd2c){if(_0xb6dd2c){return[_0xb6dd2c,![]];}return db[_0x5584('0x49')][_0x5584('0x4c')](_0x4456b6)['then'](function(_0x261487){return[_0x261487,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x27483f,_0x32ce73){if(_0x27483f){_0x3c0990=_0x32ce73;if(!_0x32ce73){return _0x27483f[_0x5584('0x4d')]({'inReplyTo':_0x260c48[_0x5584('0x24')][_0x5584('0x13')][_0x5584('0x44')],'to':_0x260c48[_0x5584('0x24')][_0x5584('0x13')][_0x5584('0x30')],'cc':_0x260c48[_0x5584('0x24')][_0x5584('0x13')]['cc'],'subject':_0x260c48['body'][_0x5584('0x13')][_0x5584('0x45')],'attach':_0x27483f[_0x5584('0x46')]?_0x27483f[_0x5584('0x46')]:_0x260c48[_0x5584('0x24')][_0x5584('0x13')]['attach'],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x5584('0x48')),'lastMsgDirection':'in'});}else{return _0x27483f;}}})['then'](function(_0x27c70){_0x4b7c02[_0x5584('0x4e')]=_0x27c70['get']({'plain':!![]});_0x4b7c02[_0x5584('0x4e')][_0x5584('0x4f')]=_0x3c0990;return db['MailMessage'][_0x5584('0x4c')]({'body':_0x260c48['body'][_0x5584('0x24')],'MailAccountId':_0x260c48['account']['id'],'MailInteractionId':_0x27c70['id'],'direction':'in','ContactId':_0x4b7c02[_0x5584('0x43')]['id'],'messageId':_0x260c48['body'][_0x5584('0x13')]['messageId'],'from':_0x260c48['body'][_0x5584('0x13')][_0x5584('0x30')],'to':_0x260c48[_0x5584('0x24')][_0x5584('0x13')]['to'],'cc':_0x260c48[_0x5584('0x24')]['message']['cc'],'subject':_0x260c48['body'][_0x5584('0x13')]['subject'],'attach':_0x260c48[_0x5584('0x24')][_0x5584('0x13')][_0x5584('0x46')],'Attachments':_0x260c48[_0x5584('0x24')][_0x5584('0x13')][_0x5584('0x50')],'originTo':_0x260c48[_0x5584('0x24')]['message']['originTo'],'originCc':_0x260c48['body'][_0x5584('0x13')]['originCc'],'bcc':_0x260c48[_0x5584('0x24')][_0x5584('0x13')][_0x5584('0x51')],'ChatWebsiteId':_0x260c48['body'][_0x5584('0x13')][_0x5584('0x52')]||null,'originChannel':_0x260c48[_0x5584('0x24')][_0x5584('0x13')][_0x5584('0x53')]||_0x5584('0x54'),'ChatOfflineMessageId':_0x260c48[_0x5584('0x24')][_0x5584('0x13')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x5584('0x55')],'as':'Attachments'}]});})[_0x5584('0xe')](function(_0x37037c){_0x4b7c02[_0x5584('0x13')]=_0x37037c;if(_0x4b7c02[_0x5584('0x4e')][_0x5584('0x56')]){return db[_0x5584('0x57')][_0x5584('0x58')]({'attributes':['id','name'],'where':{'id':_0x4b7c02[_0x5584('0x4e')]['UserId']}})[_0x5584('0xe')](function(_0x5cbafe){if(_0x5cbafe){_0x4b7c02[_0x5584('0x3a')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5cbafe[_0x5584('0x59')]+','+(_0x4b7c02[_0x5584('0x31')]['waitForTheAssignedAgent']||0xa),'interval':_0x5584('0x41')});}return respondWithRpcPromise(_0x5584('0x5a'),_0x5584('0x5b'),_0x4b7c02);});}return respondWithRpcPromise('Start',_0x5584('0x5b'),_0x4b7c02);})[_0x5584('0xe')](function(_0x39633d){_0x23eb8c(_0x39633d);})[_0x5584('0x15')](function(_0x21a0b1){_0x1e9b41(_0x201640['error'](0x1f4,_0x21a0b1[_0x5584('0x13')]));});});};
\ No newline at end of file
index c7686a1..e9ec861 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9173=['length','mailAccount:','./mailAccount.events','save','remove','emit','removeListener','register'];(function(_0x336052,_0x477a0a){var _0x483c5f=function(_0x434f77){while(--_0x434f77){_0x336052['push'](_0x336052['shift']());}};_0x483c5f(++_0x477a0a);}(_0x9173,0xc2));var _0x3917=function(_0x19cc1b,_0x3e3121){_0x19cc1b=_0x19cc1b-0x0;var _0x57bf13=_0x9173[_0x19cc1b];return _0x57bf13;};'use strict';var MailAccountEvents=require(_0x3917('0x0'));var events=[_0x3917('0x1'),_0x3917('0x2'),'update'];function createListener(_0x230c19,_0x2d2d30){return function(_0x2b4003){_0x2d2d30[_0x3917('0x3')](_0x230c19,_0x2b4003);};}function removeListener(_0x33b166,_0x59d7b7){return function(){MailAccountEvents[_0x3917('0x4')](_0x33b166,_0x59d7b7);};}exports[_0x3917('0x5')]=function(_0x23f6c6){for(var _0x1df23f=0x0,_0x1ca665=events[_0x3917('0x6')];_0x1df23f<_0x1ca665;_0x1df23f++){var _0x560f0f=events[_0x1df23f];var _0x3bc970=createListener(_0x3917('0x7')+_0x560f0f,_0x23f6c6);MailAccountEvents['on'](_0x560f0f,_0x3bc970);}};
\ No newline at end of file
+var _0xd350=['update','emit','register','./mailAccount.events','remove'];(function(_0x41373c,_0x41cbb6){var _0x256db0=function(_0x50a681){while(--_0x50a681){_0x41373c['push'](_0x41373c['shift']());}};_0x256db0(++_0x41cbb6);}(_0xd350,0x7b));var _0x0d35=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0xd350[_0x2f57b2];return _0x5ace77;};'use strict';var MailAccountEvents=require(_0x0d35('0x0'));var events=['save',_0x0d35('0x1'),_0x0d35('0x2')];function createListener(_0x4d44a8,_0x22eee7){return function(_0x1b6a18){_0x22eee7[_0x0d35('0x3')](_0x4d44a8,_0x1b6a18);};}function removeListener(_0x58dddb,_0x8866a2){return function(){MailAccountEvents['removeListener'](_0x58dddb,_0x8866a2);};}exports[_0x0d35('0x4')]=function(_0x5d342c){for(var _0x2b5df5=0x0,_0x344975=events['length'];_0x2b5df5<_0x344975;_0x2b5df5++){var _0x93dcf0=events[_0x2b5df5];var _0x22b862=createListener('mailAccount:'+_0x93dcf0,_0x5d342c);MailAccountEvents['on'](_0x93dcf0,_0x22b862);}};
\ No newline at end of file
index a6f9624..83bd5d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f7a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer'];(function(_0x5ed2c0,_0x3e7592){var _0x51caec=function(_0x32bac2){while(--_0x32bac2){_0x5ed2c0['push'](_0x5ed2c0['shift']());}};_0x51caec(++_0x3e7592);}(_0x3f7a,0x65));var _0xa3f7=function(_0x2dca80,_0x1be43e){_0x2dca80=_0x2dca80-0x0;var _0x219d55=_0x3f7a[_0x2dca80];return _0x219d55;};'use strict';var multer=require(_0xa3f7('0x0'));var util=require('util');var path=require(_0xa3f7('0x1'));var timeout=require(_0xa3f7('0x2'));var express=require(_0xa3f7('0x3'));var router=express[_0xa3f7('0x4')]();var fs_extra=require(_0xa3f7('0x5'));var auth=require(_0xa3f7('0x6'));var interaction=require(_0xa3f7('0x7'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0xa3f7('0x8')](_0xa3f7('0x9'),auth[_0xa3f7('0xa')](),controller[_0xa3f7('0xb')]);router[_0xa3f7('0xc')](_0xa3f7('0x9'),auth['isAuthenticated'](),controller[_0xa3f7('0xd')]);router[_0xa3f7('0xe')](_0xa3f7('0x9'),auth[_0xa3f7('0xa')](),controller[_0xa3f7('0xf')]);module[_0xa3f7('0x10')]=router;
\ No newline at end of file
+var _0xf8c0=['../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x5a056b,_0x554372){var _0x310109=function(_0x127549){while(--_0x127549){_0x5a056b['push'](_0x5a056b['shift']());}};_0x310109(++_0x554372);}(_0xf8c0,0x81));var _0x0f8c=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0xf8c0[_0x29d6e6];return _0xc75ff0;};'use strict';var multer=require(_0x0f8c('0x0'));var util=require(_0x0f8c('0x1'));var path=require('path');var timeout=require(_0x0f8c('0x2'));var express=require(_0x0f8c('0x3'));var router=express[_0x0f8c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0f8c('0x5'));var config=require(_0x0f8c('0x6'));var controller=require(_0x0f8c('0x7'));router['get'](_0x0f8c('0x8'),auth[_0x0f8c('0x9')](),controller[_0x0f8c('0xa')]);router[_0x0f8c('0xb')]('/:id',auth[_0x0f8c('0x9')](),controller[_0x0f8c('0xc')]);router['delete'](_0x0f8c('0x8'),auth[_0x0f8c('0x9')](),controller[_0x0f8c('0xd')]);module[_0x0f8c('0xe')]=router;
\ No newline at end of file
index 1e60372..856ee94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa87c=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x2a83af,_0x4fa9ed){var _0x2e1648=function(_0x59c429){while(--_0x59c429){_0x2a83af['push'](_0x2a83af['shift']());}};_0x2e1648(++_0x4fa9ed);}(_0xa87c,0x15a));var _0xca87=function(_0x2f3d29,_0x150e7b){_0x2f3d29=_0x2f3d29-0x0;var _0x53d69d=_0xa87c[_0x2f3d29];return _0x53d69d;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xca87('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xca87('0x1')],'allowNull':![],'defaultValue':_0xca87('0x2')},'appdata':{'type':Sequelize[_0xca87('0x3')]()},'description':{'type':Sequelize[_0xca87('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xca87('0x4')}};
\ No newline at end of file
+var _0xb2bb=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x153619,_0x1db1c8){var _0x21fdb3=function(_0x5a35d7){while(--_0x5a35d7){_0x153619['push'](_0x153619['shift']());}};_0x21fdb3(++_0x1db1c8);}(_0xb2bb,0xa5));var _0xbb2b=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0xb2bb[_0x4fc421];return _0x8c6d63;};'use strict';var Sequelize=require(_0xbb2b('0x0'));module[_0xbb2b('0x1')]={'priority':{'type':Sequelize[_0xbb2b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbb2b('0x3')],'allowNull':![],'defaultValue':_0xbb2b('0x4')},'appdata':{'type':Sequelize[_0xbb2b('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbb2b('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index c3df568..6f4ae9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x16719d,_0x29c5b3){var _0x38557b=function(_0x4047ed){while(--_0x4047ed){_0x16719d['push'](_0x16719d['shift']());}};_0x38557b(++_0x29c5b3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x26eb74,_0x43e13d){_0x26eb74=_0x26eb74-0x0;var _0x495622=_0xf4eb[_0x26eb74];return _0x495622;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));};
\ No newline at end of file
+var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x2179e3,_0x3f7767){_0x2179e3=_0x2179e3-0x0;var _0x3a350b=_0xbdb7[_0x2179e3];return _0x3a350b;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));};
\ No newline at end of file
index 6db6419..a82ecf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac2d=['exports','define','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x425241,_0x121b13){var _0x34bdb1=function(_0x1b3600){while(--_0x1b3600){_0x425241['push'](_0x425241['shift']());}};_0x34bdb1(++_0x121b13);}(_0xac2d,0x16a));var _0xdac2=function(_0x4ac5d4,_0x35dbae){_0x4ac5d4=_0x4ac5d4-0x0;var _0x21bc8c=_0xac2d[_0x4ac5d4];return _0x21bc8c;};'use strict';var _=require(_0xdac2('0x0'));var util=require(_0xdac2('0x1'));var logger=require('../../config/logger')(_0xdac2('0x2'));var moment=require(_0xdac2('0x3'));var BPromise=require(_0xdac2('0x4'));var rp=require(_0xdac2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdac2('0x6'));var config=require(_0xdac2('0x7'));var attributes=require('./mailApplication.attributes');module[_0xdac2('0x8')]=function(_0x30cf13,_0x35a943){return _0x30cf13[_0xdac2('0x9')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x47ec=['util','api','bluebird','request-promise','path','rimraf','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x47ec,0x178));var _0xc47e=function(_0x18f4c4,_0x3dabc6){_0x18f4c4=_0x18f4c4-0x0;var _0x492816=_0x47ec[_0x18f4c4];return _0x492816;};'use strict';var _=require(_0xc47e('0x0'));var util=require(_0xc47e('0x1'));var logger=require('../../config/logger')(_0xc47e('0x2'));var moment=require('moment');var BPromise=require(_0xc47e('0x3'));var rp=require(_0xc47e('0x4'));var fs=require('fs');var path=require(_0xc47e('0x5'));var rimraf=require(_0xc47e('0x6'));var config=require('../../config/environment');var attributes=require(_0xc47e('0x7'));module[_0xc47e('0x8')]=function(_0x234a0e,_0x3f7354){return _0x234a0e['define'](_0xc47e('0x9'),attributes,{'tableName':_0xc47e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc47e('0xb'),'collate':_0xc47e('0xc')});};
\ No newline at end of file
index e03de30..7e9a8d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a5f=['request\x20sent','debug','stringify','error','message','result','catch','UpdateMailApplication','MailApplication','options','raw','attributes','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x0a5f,0x192));var _0xf0a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a5f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf0a5('0x0'));var util=require(_0xf0a5('0x1'));var moment=require(_0xf0a5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0a5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0a5('0x4'));var logger=require(_0xf0a5('0x5'))(_0xf0a5('0x6'));var config=require('../../config/environment');var jayson=require(_0xf0a5('0x7'));var client=jayson[_0xf0a5('0x8')][_0xf0a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57d682,_0x1cff3e,_0x2a8fdc){return new BPromise(function(_0x7fae30,_0x14dc37){return client[_0xf0a5('0xa')](_0x57d682,_0x2a8fdc)[_0xf0a5('0xb')](function(_0x42e708){logger[_0xf0a5('0xc')](_0xf0a5('0xd'),_0x1cff3e,_0xf0a5('0xe'));logger[_0xf0a5('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x1cff3e,'request\x20sent',JSON[_0xf0a5('0x10')](_0x42e708));if(_0x42e708[_0xf0a5('0x11')]){if(_0x42e708[_0xf0a5('0x11')]['code']===0x1f4){logger['error'](_0xf0a5('0xd'),_0x1cff3e,_0x42e708['error'][_0xf0a5('0x12')]);return _0x14dc37(_0x42e708[_0xf0a5('0x11')]['message']);}logger['error'](_0xf0a5('0xd'),_0x1cff3e,_0x42e708[_0xf0a5('0x11')][_0xf0a5('0x12')]);return _0x7fae30(_0x42e708[_0xf0a5('0x11')]['message']);}else{logger[_0xf0a5('0xc')](_0xf0a5('0xd'),_0x1cff3e,_0xf0a5('0xe'));_0x7fae30(_0x42e708[_0xf0a5('0x13')][_0xf0a5('0x12')]);}})[_0xf0a5('0x14')](function(_0x2f9364){logger[_0xf0a5('0x11')](_0xf0a5('0xd'),_0x1cff3e,_0x2f9364);_0x14dc37(_0x2f9364);});});}exports[_0xf0a5('0x15')]=function(_0x1e4b8e){var _0x63004=this;return new Promise(function(_0x51d9af,_0x2357d0){return db[_0xf0a5('0x16')]['update'](_0x1e4b8e['body'],{'raw':_0x1e4b8e[_0xf0a5('0x17')]?_0x1e4b8e['options'][_0xf0a5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e4b8e[_0xf0a5('0x17')]?_0x1e4b8e[_0xf0a5('0x17')]['where']||null:null,'attributes':_0x1e4b8e['options']?_0x1e4b8e['options'][_0xf0a5('0x19')]||null:null,'limit':_0x1e4b8e[_0xf0a5('0x17')]?_0x1e4b8e[_0xf0a5('0x17')]['limit']||null:null})['then'](function(_0x2f0980){logger[_0xf0a5('0xc')](_0xf0a5('0x15'),_0x1e4b8e);logger[_0xf0a5('0xf')](_0xf0a5('0x15'),_0x1e4b8e,JSON[_0xf0a5('0x10')](_0x2f0980));_0x51d9af(_0x2f0980);})[_0xf0a5('0x14')](function(_0x39aaac){logger[_0xf0a5('0x11')](_0xf0a5('0x15'),_0x39aaac[_0xf0a5('0x12')],_0x1e4b8e);_0x2357d0(_0x63004['error'](0x1f4,_0x39aaac['message']));});});};
\ No newline at end of file
+var _0xb8d7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','UpdateMailApplication','body','options','raw','where','attributes','debug','lodash','util','moment'];(function(_0x2c36c5,_0x5e95e9){var _0x148d84=function(_0x1d99b4){while(--_0x1d99b4){_0x2c36c5['push'](_0x2c36c5['shift']());}};_0x148d84(++_0x5e95e9);}(_0xb8d7,0x135));var _0x7b8d=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0xb8d7[_0xcd0918];return _0x250704;};'use strict';var _=require(_0x7b8d('0x0'));var util=require(_0x7b8d('0x1'));var moment=require(_0x7b8d('0x2'));var BPromise=require('bluebird');var rs=require(_0x7b8d('0x3'));var fs=require('fs');var Redis=require(_0x7b8d('0x4'));var db=require(_0x7b8d('0x5'))['db'];var utils=require(_0x7b8d('0x6'));var logger=require(_0x7b8d('0x7'))('rpc');var config=require(_0x7b8d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b8d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48e601,_0x728834,_0x38af55){return new BPromise(function(_0x368ef9,_0x409e91){return client[_0x7b8d('0xa')](_0x48e601,_0x38af55)[_0x7b8d('0xb')](function(_0x30c2b8){logger[_0x7b8d('0xc')](_0x7b8d('0xd'),_0x728834,'request\x20sent');logger['debug'](_0x7b8d('0xe'),_0x728834,_0x7b8d('0xf'),JSON[_0x7b8d('0x10')](_0x30c2b8));if(_0x30c2b8[_0x7b8d('0x11')]){if(_0x30c2b8[_0x7b8d('0x11')]['code']===0x1f4){logger[_0x7b8d('0x11')](_0x7b8d('0xd'),_0x728834,_0x30c2b8[_0x7b8d('0x11')][_0x7b8d('0x12')]);return _0x409e91(_0x30c2b8[_0x7b8d('0x11')][_0x7b8d('0x12')]);}logger[_0x7b8d('0x11')](_0x7b8d('0xd'),_0x728834,_0x30c2b8['error']['message']);return _0x368ef9(_0x30c2b8[_0x7b8d('0x11')][_0x7b8d('0x12')]);}else{logger[_0x7b8d('0xc')](_0x7b8d('0xd'),_0x728834,_0x7b8d('0xf'));_0x368ef9(_0x30c2b8['result']['message']);}})['catch'](function(_0x31b3ec){logger[_0x7b8d('0x11')](_0x7b8d('0xd'),_0x728834,_0x31b3ec);_0x409e91(_0x31b3ec);});});}exports[_0x7b8d('0x13')]=function(_0x5e537b){var _0x236acd=this;return new Promise(function(_0x55a623,_0x2caff9){return db['MailApplication']['update'](_0x5e537b[_0x7b8d('0x14')],{'raw':_0x5e537b[_0x7b8d('0x15')]?_0x5e537b[_0x7b8d('0x15')][_0x7b8d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e537b[_0x7b8d('0x15')]?_0x5e537b[_0x7b8d('0x15')][_0x7b8d('0x17')]||null:null,'attributes':_0x5e537b[_0x7b8d('0x15')]?_0x5e537b[_0x7b8d('0x15')][_0x7b8d('0x18')]||null:null,'limit':_0x5e537b[_0x7b8d('0x15')]?_0x5e537b['options']['limit']||null:null})[_0x7b8d('0xb')](function(_0x143694){logger[_0x7b8d('0xc')](_0x7b8d('0x13'),_0x5e537b);logger[_0x7b8d('0x19')](_0x7b8d('0x13'),_0x5e537b,JSON[_0x7b8d('0x10')](_0x143694));_0x55a623(_0x143694);})['catch'](function(_0x3aefd7){logger['error'](_0x7b8d('0x13'),_0x3aefd7[_0x7b8d('0x12')],_0x5e537b);_0x2caff9(_0x236acd['error'](0x1f4,_0x3aefd7[_0x7b8d('0x12')]));});});};
\ No newline at end of file
index a892de1..d29f360 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45a7=['mailinteraction:addtags','put','/:id','tracked','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','removeTags','exports','express','./mailInteraction.controller','isAuthenticated','get','/describe','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','mail'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x45a7,0x19b));var _0x745a=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0x45a7[_0x3de4f8];return _0x3d81fc;};'use strict';var express=require(_0x745a('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0x745a('0x1'));router['get']('/',auth[_0x745a('0x2')](),controller['index']);router[_0x745a('0x3')](_0x745a('0x4'),auth[_0x745a('0x2')](),controller[_0x745a('0x5')]);router['get']('/:id',auth[_0x745a('0x2')](),controller[_0x745a('0x6')]);router[_0x745a('0x3')](_0x745a('0x7'),auth[_0x745a('0x2')](),controller[_0x745a('0x8')]);router[_0x745a('0x3')]('/:id/download',auth[_0x745a('0x2')](),controller['download']);router[_0x745a('0x9')]('/',auth[_0x745a('0x2')](),controller[_0x745a('0xa')]);router[_0x745a('0x9')](_0x745a('0x7'),auth[_0x745a('0x2')](),controller[_0x745a('0xb')]);router[_0x745a('0x9')](_0x745a('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x745a('0xd'),_0x745a('0xe')),controller['addTags']);router[_0x745a('0xf')](_0x745a('0x10'),auth[_0x745a('0x2')](),interaction[_0x745a('0x11')](_0x745a('0xd'),_0x745a('0x12')),controller[_0x745a('0x13')]);router['delete'](_0x745a('0x10'),auth[_0x745a('0x2')](),interaction[_0x745a('0x11')]('mail',_0x745a('0x14')),controller[_0x745a('0x15')]);router[_0x745a('0x16')](_0x745a('0xc'),auth[_0x745a('0x2')](),controller[_0x745a('0x17')]);module[_0x745a('0x18')]=router;
\ No newline at end of file
+var _0xd222=['/:id','isAuthenticated','/:id/messages','getMessages','download','post','create','mailinteraction:addtags','addTags','mail','mailinteraction:update','delete','tracked','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','index','describe'];(function(_0x5ff505,_0x53e2bd){var _0x97e96=function(_0x34cf7b){while(--_0x34cf7b){_0x5ff505['push'](_0x5ff505['shift']());}};_0x97e96(++_0x53e2bd);}(_0xd222,0xa1));var _0x2d22=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0xd222[_0x48d6a3];return _0x38bfa0;};'use strict';var express=require(_0x2d22('0x0'));var router=express[_0x2d22('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x2d22('0x2'));var controller=require(_0x2d22('0x3'));router[_0x2d22('0x4')]('/',auth['isAuthenticated'](),controller[_0x2d22('0x5')]);router[_0x2d22('0x4')]('/describe',auth['isAuthenticated'](),controller[_0x2d22('0x6')]);router[_0x2d22('0x4')](_0x2d22('0x7'),auth[_0x2d22('0x8')](),controller['show']);router[_0x2d22('0x4')](_0x2d22('0x9'),auth['isAuthenticated'](),controller[_0x2d22('0xa')]);router[_0x2d22('0x4')]('/:id/download',auth[_0x2d22('0x8')](),controller[_0x2d22('0xb')]);router[_0x2d22('0xc')]('/',auth[_0x2d22('0x8')](),controller[_0x2d22('0xd')]);router[_0x2d22('0xc')](_0x2d22('0x9'),auth[_0x2d22('0x8')](),controller['addMessage']);router[_0x2d22('0xc')]('/:id/tags',auth[_0x2d22('0x8')](),interaction['tracked']('mail',_0x2d22('0xe')),controller[_0x2d22('0xf')]);router['put'](_0x2d22('0x7'),auth[_0x2d22('0x8')](),interaction['tracked'](_0x2d22('0x10'),_0x2d22('0x11')),controller['update']);router[_0x2d22('0x12')](_0x2d22('0x7'),auth[_0x2d22('0x8')](),interaction[_0x2d22('0x13')](_0x2d22('0x10'),_0x2d22('0x14')),controller[_0x2d22('0x15')]);router[_0x2d22('0x12')]('/:id/tags',auth[_0x2d22('0x8')](),controller[_0x2d22('0x16')]);module[_0x2d22('0x17')]=router;
\ No newline at end of file
index 6aa952a..0b69441 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9270=['out','sequelize','iconv','exports','DATE','STRING','long','BOOLEAN'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9270,0x149));var _0x0927=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x9270[_0x519756];return _0x37047e;};'use strict';var Sequelize=require(_0x0927('0x0'));var iconv=require(_0x0927('0x1'));module[_0x0927('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0927('0x3')]},'disposition':{'type':Sequelize[_0x0927('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0927('0x4')]},'note':{'type':Sequelize[_0x0927('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x0927('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x0927('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0927('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x0927('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x0927('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0927('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0927('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0927('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x62f8=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv'];(function(_0x5a9770,_0x3d961f){var _0x24fc92=function(_0x239eff){while(--_0x239eff){_0x5a9770['push'](_0x5a9770['shift']());}};_0x24fc92(++_0x3d961f);}(_0x62f8,0x116));var _0x862f=function(_0x7d1554,_0x5d78da){_0x7d1554=_0x7d1554-0x0;var _0x14dbb7=_0x62f8[_0x7d1554];return _0x14dbb7;};'use strict';var Sequelize=require(_0x862f('0x0'));var iconv=require(_0x862f('0x1'));module[_0x862f('0x2')]={'closed':{'type':Sequelize[_0x862f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x862f('0x4')]},'disposition':{'type':Sequelize[_0x862f('0x5')]},'secondDisposition':{'type':Sequelize[_0x862f('0x5')]},'thirdDisposition':{'type':Sequelize[_0x862f('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x862f('0x5')]},'cc':{'type':Sequelize[_0x862f('0x6')](_0x862f('0x7'))},'subject':{'type':Sequelize[_0x862f('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x862f('0x4')]},'substatus':{'type':Sequelize[_0x862f('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x862f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x862f('0x8')]('in',_0x862f('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x862f('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x862f('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 560cc2c..03b6a67 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(_0x58c09c,_0xcdbf5c){var _0x402ca9=function(_0x474751){while(--_0x474751){_0x58c09c['push'](_0x58c09c['shift']());}};_0x402ca9(++_0xcdbf5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 _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(_0xe78356,_0x73106){var _0x418421=function(_0xb19901){while(--_0xb19901){_0xe78356['push'](_0xe78356['shift']());}};_0x418421(++_0x73106);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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
index 0523f6d..2ab4dd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88c7=['save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','MailInteraction','setMaxListeners'];(function(_0x5d869e,_0x1731bd){var _0x13a90b=function(_0x21719e){while(--_0x21719e){_0x5d869e['push'](_0x5d869e['shift']());}};_0x13a90b(++_0x1731bd);}(_0x88c7,0x1ae));var _0x788c=function(_0x3ceebc,_0x38ba57){_0x3ceebc=_0x3ceebc-0x0;var _0x55eeef=_0x88c7[_0x3ceebc];return _0x55eeef;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x788c('0x0')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x788c('0x1')](0x0);var events={'afterCreate':_0x788c('0x2'),'afterUpdate':_0x788c('0x3'),'afterDestroy':_0x788c('0x4')};function emitEvent(_0xf1dc14){return function(_0x284a68,_0x12e5e1,_0x1a3a1b){_0x284a68[_0x788c('0x5')]({'attributes':['id'],'raw':!![]})[_0x788c('0x6')](function(_0x43e1f8){_0x284a68[_0x788c('0x7')](_0x788c('0x8'),_0x43e1f8['map'](function(_0x488284){return{'id':_0x488284['id']};}));return MailMessage[_0x788c('0x9')]({'where':{'MailInteractionId':_0x284a68['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x13bca9){_0x284a68[_0x788c('0x7')](_0x788c('0xa'),_0x13bca9['length']);MailInteractionEvents['emit'](_0xf1dc14+':'+_0x284a68['id'],_0x284a68);MailInteractionEvents[_0x788c('0xb')](_0xf1dc14,_0x284a68);_0x1a3a1b(null);})[_0x788c('0xc')](_0x1a3a1b(null));};}for(var e in events){if(events[_0x788c('0xd')](e)){var event=events[e];MailInteraction[_0x788c('0xe')](e,emitEvent(event));}}module[_0x788c('0xf')]=MailInteractionEvents;
\ No newline at end of file
+var _0x30ad=['exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','hasOwnProperty','hook'];(function(_0x59af6f,_0x5d0248){var _0x3a04e1=function(_0x563bc8){while(--_0x563bc8){_0x59af6f['push'](_0x59af6f['shift']());}};_0x3a04e1(++_0x5d0248);}(_0x30ad,0x6d));var _0xd30a=function(_0x53a689,_0x370316){_0x53a689=_0x53a689-0x0;var _0x12dd35=_0x30ad[_0x53a689];return _0x12dd35;};'use strict';var EventEmitter=require(_0xd30a('0x0'));var MailInteraction=require(_0xd30a('0x1'))['db'][_0xd30a('0x2')];var MailMessage=require('../../mysqldb')['db'][_0xd30a('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xd30a('0x4')](0x0);var events={'afterCreate':_0xd30a('0x5'),'afterUpdate':_0xd30a('0x6'),'afterDestroy':_0xd30a('0x7')};function emitEvent(_0xa2db84){return function(_0x33f64d,_0x5de215,_0x37faac){_0x33f64d[_0xd30a('0x8')]({'attributes':['id'],'raw':!![]})[_0xd30a('0x9')](function(_0x32192d){_0x33f64d[_0xd30a('0xa')](_0xd30a('0xb'),_0x32192d[_0xd30a('0xc')](function(_0x240398){return{'id':_0x240398['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x33f64d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd30a('0x9')](function(_0x52b0b1){_0x33f64d[_0xd30a('0xa')](_0xd30a('0xd'),_0x52b0b1['length']);MailInteractionEvents[_0xd30a('0xe')](_0xa2db84+':'+_0x33f64d['id'],_0x33f64d);MailInteractionEvents['emit'](_0xa2db84,_0x33f64d);_0x37faac(null);})['catch'](_0x37faac(null));};}for(var e in events){if(events[_0xd30a('0xf')](e)){var event=events[e];MailInteraction[_0xd30a('0x10')](e,emitEvent(event));}}module[_0xd30a('0x11')]=MailInteractionEvents;
\ No newline at end of file
index a702c63..387a4e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2956=['format','substatus','changed','models','get','update','then','catch','utf8mb4','lodash','util','api','moment','path','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0x17d8ae,_0x49c361){var _0xf31b6d=function(_0x1e9ddc){while(--_0x1e9ddc){_0x17d8ae['push'](_0x17d8ae['shift']());}};_0xf31b6d(++_0x49c361);}(_0x2956,0x1c3));var _0x6295=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0x2956[_0x2d344f];return _0x2e796b;};'use strict';var _=require(_0x6295('0x0'));var util=require(_0x6295('0x1'));var logger=require('../../config/logger')(_0x6295('0x2'));var moment=require(_0x6295('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6295('0x4'));var rimraf=require('rimraf');var config=require(_0x6295('0x5'));var attributes=require(_0x6295('0x6'));module['exports']=function(_0x5af8c3,_0x80f650){return _0x5af8c3[_0x6295('0x7')](_0x6295('0x8'),attributes,{'tableName':_0x6295('0x9'),'paranoid':![],'indexes':[{'name':_0x6295('0xa'),'fields':[_0x6295('0xb'),'to'],'type':_0x6295('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4163a4,_0x5e95db,_0x280d6b){if(_0x4163a4['substatus']){_0x4163a4[_0x6295('0xd')]=moment()['format'](_0x6295('0xe'));}if(_0x4163a4[_0x6295('0xf')]){_0x4163a4[_0x6295('0x10')]=moment()[_0x6295('0x11')](_0x6295('0xe'));}_0x280d6b(null,_0x5e95db);},'beforeUpdate':function(_0x4fbd9f,_0x2a926b,_0x303553){if(_0x4fbd9f['changed'](_0x6295('0x12'))){_0x4fbd9f[_0x6295('0xd')]=_0x4fbd9f['substatus']?moment()[_0x6295('0x11')](_0x6295('0xe')):null;}if(_0x4fbd9f[_0x6295('0x13')](_0x6295('0xf'))){_0x4fbd9f[_0x6295('0x10')]=moment()['format'](_0x6295('0xe'));_0x4fbd9f[_0x6295('0x12')]=null;_0x4fbd9f['substatusAt']=null;}_0x303553(null,_0x4fbd9f);},'afterUpdate':function(_0x5acd39,_0x26bc51,_0x4850f7){var _0x327218=_0x5af8c3[_0x6295('0x14')];var _0x266a0c=_0x5acd39[_0x6295('0x15')]({'plain':!![]});if(_0x266a0c[_0x6295('0xf')]){return _0x327218['MailMessage'][_0x6295('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x266a0c['id']}})[_0x6295('0x17')](function(){_0x4850f7();})[_0x6295('0x18')](function(_0x291101){_0x4850f7(_0x291101);});}else{_0x4850f7();}}},'charset':_0x6295('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6a45=['fti_mail_interactions','subject','substatus','substatusAt','format','closed','closedAt','changed','YYYY-MM-DD\x20HH:mm:ss','models','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions'];(function(_0x53e842,_0x2b0346){var _0x3b41bf=function(_0x1d4e61){while(--_0x1d4e61){_0x53e842['push'](_0x53e842['shift']());}};_0x3b41bf(++_0x2b0346);}(_0x6a45,0xcc));var _0x56a4=function(_0x4d8f6f,_0x2f52d3){_0x4d8f6f=_0x4d8f6f-0x0;var _0x12d8f8=_0x6a45[_0x4d8f6f];return _0x12d8f8;};'use strict';var _=require(_0x56a4('0x0'));var util=require('util');var logger=require(_0x56a4('0x1'))(_0x56a4('0x2'));var moment=require(_0x56a4('0x3'));var BPromise=require('bluebird');var rp=require(_0x56a4('0x4'));var fs=require('fs');var path=require(_0x56a4('0x5'));var rimraf=require(_0x56a4('0x6'));var config=require(_0x56a4('0x7'));var attributes=require(_0x56a4('0x8'));module['exports']=function(_0x178555,_0x309422){return _0x178555[_0x56a4('0x9')](_0x56a4('0xa'),attributes,{'tableName':_0x56a4('0xb'),'paranoid':![],'indexes':[{'name':_0x56a4('0xc'),'fields':[_0x56a4('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2515c4,_0x486a4a,_0x17bb08){if(_0x2515c4[_0x56a4('0xe')]){_0x2515c4[_0x56a4('0xf')]=moment()[_0x56a4('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2515c4[_0x56a4('0x11')]){_0x2515c4[_0x56a4('0x12')]=moment()[_0x56a4('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x17bb08(null,_0x486a4a);},'beforeUpdate':function(_0x12e0a2,_0x197d01,_0x5debf3){if(_0x12e0a2[_0x56a4('0x13')]('substatus')){_0x12e0a2[_0x56a4('0xf')]=_0x12e0a2[_0x56a4('0xe')]?moment()['format'](_0x56a4('0x14')):null;}if(_0x12e0a2['changed'](_0x56a4('0x11'))){_0x12e0a2[_0x56a4('0x12')]=moment()[_0x56a4('0x10')](_0x56a4('0x14'));_0x12e0a2[_0x56a4('0xe')]=null;_0x12e0a2['substatusAt']=null;}_0x5debf3(null,_0x12e0a2);},'afterUpdate':function(_0x4ba635,_0x342c43,_0x5f4f04){var _0xaa0f91=_0x178555[_0x56a4('0x15')];var _0xe93b3e=_0x4ba635['get']({'plain':!![]});if(_0xe93b3e['closed']){return _0xaa0f91[_0x56a4('0x16')][_0x56a4('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0xe93b3e['id']}})['then'](function(){_0x5f4f04();})[_0x56a4('0x18')](function(_0x3fd6f7){_0x5f4f04(_0x3fd6f7);});}else{_0x5f4f04();}}},'charset':_0x56a4('0x19'),'collate':_0x56a4('0x1a')});};
\ No newline at end of file
index 6aae48a..552d936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3837=['then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','where','attributes','limit','AddTagsToMailInteraction','find','omit','body','ids','spread','AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3837,0x1d1));var _0x7383=function(_0x389ac6,_0x361611){_0x389ac6=_0x389ac6-0x0;var _0x48443e=_0x3837[_0x389ac6];return _0x48443e;};'use strict';var _=require('lodash');var util=require(_0x7383('0x0'));var moment=require('moment');var BPromise=require(_0x7383('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7383('0x2'));var db=require(_0x7383('0x3'))['db'];var utils=require(_0x7383('0x4'));var logger=require(_0x7383('0x5'))(_0x7383('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7383('0x7')][_0x7383('0x8')]({'port':0x232a});config[_0x7383('0x9')]=_[_0x7383('0xa')](config[_0x7383('0x9')],{'host':_0x7383('0xb'),'port':0x18eb});var socket=require(_0x7383('0xc'))(new Redis(config['redis']));require(_0x7383('0xd'))[_0x7383('0xe')](socket);function respondWithRpcPromise(_0x257254,_0x1316ec,_0x3d2d47){return new BPromise(function(_0x2dcdc9,_0x19f134){return client['request'](_0x257254,_0x3d2d47)[_0x7383('0xf')](function(_0x5ba02f){logger[_0x7383('0x10')](_0x7383('0x11'),_0x1316ec,_0x7383('0x12'));logger[_0x7383('0x13')](_0x7383('0x14'),_0x1316ec,_0x7383('0x12'),JSON[_0x7383('0x15')](_0x5ba02f));if(_0x5ba02f[_0x7383('0x16')]){if(_0x5ba02f[_0x7383('0x16')]['code']===0x1f4){logger[_0x7383('0x16')](_0x7383('0x11'),_0x1316ec,_0x5ba02f[_0x7383('0x16')][_0x7383('0x17')]);return _0x19f134(_0x5ba02f['error']['message']);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x1316ec,_0x5ba02f[_0x7383('0x16')][_0x7383('0x17')]);return _0x2dcdc9(_0x5ba02f[_0x7383('0x16')][_0x7383('0x17')]);}else{logger[_0x7383('0x10')]('MailInteraction,\x20%s,\x20%s',_0x1316ec,_0x7383('0x12'));_0x2dcdc9(_0x5ba02f[_0x7383('0x18')][_0x7383('0x17')]);}})[_0x7383('0x19')](function(_0x251702){logger[_0x7383('0x16')](_0x7383('0x11'),_0x1316ec,_0x251702);_0x19f134(_0x251702);});});}exports[_0x7383('0x1a')]=function(_0x9d2b6a){var _0x7c71a5=this;return new Promise(function(_0x4a6b3d,_0x42d970){return db[_0x7383('0x1b')][_0x7383('0x1c')](_0x9d2b6a['body'],{'raw':_0x9d2b6a[_0x7383('0x1d')]?_0x9d2b6a[_0x7383('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9d2b6a[_0x7383('0x1d')]?_0x9d2b6a['options'][_0x7383('0x1e')]||null:null,'attributes':_0x9d2b6a[_0x7383('0x1d')]?_0x9d2b6a['options'][_0x7383('0x1f')]||null:null,'limit':_0x9d2b6a[_0x7383('0x1d')]?_0x9d2b6a[_0x7383('0x1d')][_0x7383('0x20')]||null:null})[_0x7383('0xf')](function(_0x523525){logger[_0x7383('0x10')]('UpdateMailInteraction',_0x9d2b6a);logger['debug'](_0x7383('0x1a'),_0x9d2b6a,JSON[_0x7383('0x15')](_0x523525));_0x4a6b3d(_0x523525);})[_0x7383('0x19')](function(_0x208ef9){logger[_0x7383('0x16')](_0x7383('0x1a'),_0x208ef9['message'],_0x9d2b6a);_0x42d970(_0x7c71a5[_0x7383('0x16')](0x1f4,_0x208ef9[_0x7383('0x17')]));});});};exports[_0x7383('0x21')]=function(_0x409bd0){return new Promise(function(_0x2dd0f7,_0x439d09){return db[_0x7383('0x1b')][_0x7383('0x22')]({'where':_0x409bd0[_0x7383('0x1d')]?_0x409bd0[_0x7383('0x1d')]['where']||null:null})[_0x7383('0xf')](function(_0x2d0631){if(_0x2d0631){return _0x2d0631['addTags'](_0x409bd0['body']['ids'],_[_0x7383('0x23')](_0x409bd0[_0x7383('0x24')],[_0x7383('0x25'),'id'])||{});}})[_0x7383('0x26')](function(_0x2a61d7){logger[_0x7383('0x10')](_0x7383('0x27'),_0x409bd0);logger[_0x7383('0x13')](_0x7383('0x27'),_0x409bd0,JSON[_0x7383('0x15')](_0x2a61d7));_0x2dd0f7(_0x2a61d7);})[_0x7383('0x19')](function(_0x350425){logger[_0x7383('0x16')](_0x7383('0x27'),_0x350425[_0x7383('0x17')],_0x409bd0);_0x439d09(_this[_0x7383('0x16')](0x1f4,_0x350425[_0x7383('0x17')]));});});};
\ No newline at end of file
+var _0x4cad=['UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','request','then','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch'];(function(_0x583033,_0x37f452){var _0x4f94da=function(_0x14fd08){while(--_0x14fd08){_0x583033['push'](_0x583033['shift']());}};_0x4f94da(++_0x37f452);}(_0x4cad,0x179));var _0xd4ca=function(_0x213e82,_0x1ea3af){_0x213e82=_0x213e82-0x0;var _0x2150e3=_0x4cad[_0x213e82];return _0x2150e3;};'use strict';var _=require(_0xd4ca('0x0'));var util=require(_0xd4ca('0x1'));var moment=require(_0xd4ca('0x2'));var BPromise=require(_0xd4ca('0x3'));var rs=require(_0xd4ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4ca('0x5'))['db'];var utils=require(_0xd4ca('0x6'));var logger=require(_0xd4ca('0x7'))(_0xd4ca('0x8'));var config=require(_0xd4ca('0x9'));var jayson=require(_0xd4ca('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xd4ca('0xb'),'port':0x18eb});var socket=require(_0xd4ca('0xc'))(new Redis(config[_0xd4ca('0xd')]));require(_0xd4ca('0xe'))[_0xd4ca('0xf')](socket);function respondWithRpcPromise(_0x385132,_0x4e1655,_0x11d8b3){return new BPromise(function(_0x382bb4,_0x4cccee){return client[_0xd4ca('0x10')](_0x385132,_0x11d8b3)[_0xd4ca('0x11')](function(_0x487082){logger[_0xd4ca('0x12')]('MailInteraction,\x20%s,\x20%s',_0x4e1655,_0xd4ca('0x13'));logger['debug'](_0xd4ca('0x14'),_0x4e1655,_0xd4ca('0x13'),JSON[_0xd4ca('0x15')](_0x487082));if(_0x487082[_0xd4ca('0x16')]){if(_0x487082['error'][_0xd4ca('0x17')]===0x1f4){logger[_0xd4ca('0x16')](_0xd4ca('0x18'),_0x4e1655,_0x487082[_0xd4ca('0x16')][_0xd4ca('0x19')]);return _0x4cccee(_0x487082[_0xd4ca('0x16')][_0xd4ca('0x19')]);}logger[_0xd4ca('0x16')](_0xd4ca('0x18'),_0x4e1655,_0x487082['error'][_0xd4ca('0x19')]);return _0x382bb4(_0x487082[_0xd4ca('0x16')][_0xd4ca('0x19')]);}else{logger[_0xd4ca('0x12')](_0xd4ca('0x18'),_0x4e1655,_0xd4ca('0x13'));_0x382bb4(_0x487082[_0xd4ca('0x1a')][_0xd4ca('0x19')]);}})[_0xd4ca('0x1b')](function(_0x4b83c2){logger[_0xd4ca('0x16')](_0xd4ca('0x18'),_0x4e1655,_0x4b83c2);_0x4cccee(_0x4b83c2);});});}exports[_0xd4ca('0x1c')]=function(_0x3661db){var _0x12e211=this;return new Promise(function(_0x5433e9,_0x2b8c16){return db[_0xd4ca('0x1d')][_0xd4ca('0x1e')](_0x3661db[_0xd4ca('0x1f')],{'raw':_0x3661db[_0xd4ca('0x20')]?_0x3661db[_0xd4ca('0x20')][_0xd4ca('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3661db[_0xd4ca('0x20')]?_0x3661db[_0xd4ca('0x20')][_0xd4ca('0x22')]||null:null,'attributes':_0x3661db[_0xd4ca('0x20')]?_0x3661db[_0xd4ca('0x20')][_0xd4ca('0x23')]||null:null,'limit':_0x3661db['options']?_0x3661db[_0xd4ca('0x20')][_0xd4ca('0x24')]||null:null})[_0xd4ca('0x11')](function(_0x3cc6b0){logger['info'](_0xd4ca('0x1c'),_0x3661db);logger[_0xd4ca('0x25')](_0xd4ca('0x1c'),_0x3661db,JSON[_0xd4ca('0x15')](_0x3cc6b0));_0x5433e9(_0x3cc6b0);})[_0xd4ca('0x1b')](function(_0x1135b3){logger[_0xd4ca('0x16')]('UpdateMailInteraction',_0x1135b3[_0xd4ca('0x19')],_0x3661db);_0x2b8c16(_0x12e211[_0xd4ca('0x16')](0x1f4,_0x1135b3[_0xd4ca('0x19')]));});});};exports[_0xd4ca('0x26')]=function(_0x393071){return new Promise(function(_0x51a094,_0x560a44){return db[_0xd4ca('0x1d')][_0xd4ca('0x27')]({'where':_0x393071[_0xd4ca('0x20')]?_0x393071[_0xd4ca('0x20')][_0xd4ca('0x22')]||null:null})[_0xd4ca('0x11')](function(_0x2f4483){if(_0x2f4483){return _0x2f4483[_0xd4ca('0x28')](_0x393071['body'][_0xd4ca('0x29')],_[_0xd4ca('0x2a')](_0x393071[_0xd4ca('0x1f')],[_0xd4ca('0x29'),'id'])||{});}})[_0xd4ca('0x2b')](function(_0x9b0add){logger['info']('AddTags',_0x393071);logger[_0xd4ca('0x25')](_0xd4ca('0x2c'),_0x393071,JSON['stringify'](_0x9b0add));_0x51a094(_0x9b0add);})[_0xd4ca('0x1b')](function(_0x1c9f36){logger['error'](_0xd4ca('0x2c'),_0x1c9f36['message'],_0x393071);_0x560a44(_this[_0xd4ca('0x16')](0x1f4,_0x1c9f36[_0xd4ca('0x19')]));});});};
\ No newline at end of file
index 8f0eb3a..b54342b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07fe=['mailInteraction:','save','remove','update','emit','removeListener','register','length'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x07fe,0xd1));var _0xe07f=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x07fe[_0x3511d3];return _0x5d6321;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xe07f('0x0'),_0xe07f('0x1'),_0xe07f('0x2')];function createListener(_0xac6c97,_0x16a378){return function(_0x2f529d){_0x16a378[_0xe07f('0x3')](_0xac6c97,_0x2f529d);};}function removeListener(_0x488f17,_0x4f8045){return function(){MailInteractionEvents[_0xe07f('0x4')](_0x488f17,_0x4f8045);};}exports[_0xe07f('0x5')]=function(_0x2037f6){for(var _0x5c4e46=0x0,_0x114c3b=events[_0xe07f('0x6')];_0x5c4e46<_0x114c3b;_0x5c4e46++){var _0x4c57fe=events[_0x5c4e46];var _0x640098=createListener(_0xe07f('0x7')+_0x4c57fe,_0x2037f6);MailInteractionEvents['on'](_0x4c57fe,_0x640098);}};
\ No newline at end of file
+var _0x810a=['removeListener','register','length','./mailInteraction.events','save','remove'];(function(_0x435b89,_0x55243b){var _0x26ccd3=function(_0x1263f9){while(--_0x1263f9){_0x435b89['push'](_0x435b89['shift']());}};_0x26ccd3(++_0x55243b);}(_0x810a,0x1a1));var _0xa810=function(_0x5496b3,_0x5bed84){_0x5496b3=_0x5496b3-0x0;var _0xc9c8f7=_0x810a[_0x5496b3];return _0xc9c8f7;};'use strict';var MailInteractionEvents=require(_0xa810('0x0'));var events=[_0xa810('0x1'),_0xa810('0x2'),'update'];function createListener(_0x48207c,_0x208b58){return function(_0x40aae0){_0x208b58['emit'](_0x48207c,_0x40aae0);};}function removeListener(_0x46bc18,_0x5b6cd1){return function(){MailInteractionEvents[_0xa810('0x3')](_0x46bc18,_0x5b6cd1);};}exports[_0xa810('0x4')]=function(_0x3ccd17){for(var _0x4502b2=0x0,_0x28995e=events[_0xa810('0x5')];_0x4502b2<_0x28995e;_0x4502b2++){var _0x3c2df3=events[_0x4502b2];var _0x307d5b=createListener('mailInteraction:'+_0x3c2df3,_0x3ccd17);MailInteractionEvents['on'](_0x3c2df3,_0x307d5b);}};
\ No newline at end of file
index d54921c..dc94cf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0abe=['reject','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','describe','get','/:id','show','/:id/download','download','tracked','mailmessage:create','create','update','put','/:id/accept','accept'];(function(_0x4d9b0c,_0x27a6a3){var _0x49ef50=function(_0x38fef7){while(--_0x38fef7){_0x4d9b0c['push'](_0x4d9b0c['shift']());}};_0x49ef50(++_0x27a6a3);}(_0x0abe,0x188));var _0xe0ab=function(_0x142ab6,_0x12718b){_0x142ab6=_0x142ab6-0x0;var _0x5083da=_0x0abe[_0x142ab6];return _0x5083da;};'use strict';var multer=require(_0xe0ab('0x0'));var util=require('util');var path=require(_0xe0ab('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0ab('0x2'));var router=express[_0xe0ab('0x3')]();var fs_extra=require(_0xe0ab('0x4'));var auth=require(_0xe0ab('0x5'));var interaction=require(_0xe0ab('0x6'));var config=require(_0xe0ab('0x7'));var controller=require(_0xe0ab('0x8'));router['get']('/',auth[_0xe0ab('0x9')](),controller[_0xe0ab('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe0ab('0xb')]);router[_0xe0ab('0xc')](_0xe0ab('0xd'),auth['isAuthenticated'](),controller[_0xe0ab('0xe')]);router[_0xe0ab('0xc')](_0xe0ab('0xf'),auth[_0xe0ab('0x9')](),controller[_0xe0ab('0x10')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xe0ab('0x11')]('mail',_0xe0ab('0x12')),controller[_0xe0ab('0x13')]);router['put'](_0xe0ab('0xd'),auth['isAuthenticated'](),controller[_0xe0ab('0x14')]);router[_0xe0ab('0x15')](_0xe0ab('0x16'),auth[_0xe0ab('0x9')](),controller[_0xe0ab('0x17')]);router['put']('/:id/reject',auth[_0xe0ab('0x9')](),controller[_0xe0ab('0x18')]);router['delete'](_0xe0ab('0xd'),auth[_0xe0ab('0x9')](),controller['destroy']);module[_0xe0ab('0x19')]=router;
\ No newline at end of file
+var _0x565c=['describe','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./mailMessage.controller','get','isAuthenticated'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x565c,0x73));var _0xc565=function(_0x2d22aa,_0x3e0d7d){_0x2d22aa=_0x2d22aa-0x0;var _0x51965b=_0x565c[_0x2d22aa];return _0x51965b;};'use strict';var multer=require(_0xc565('0x0'));var util=require(_0xc565('0x1'));var path=require(_0xc565('0x2'));var timeout=require(_0xc565('0x3'));var express=require(_0xc565('0x4'));var router=express[_0xc565('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc565('0x6'));var controller=require(_0xc565('0x7'));router[_0xc565('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc565('0x8')]('/describe',auth[_0xc565('0x9')](),controller[_0xc565('0xa')]);router[_0xc565('0x8')](_0xc565('0xb'),auth[_0xc565('0x9')](),controller[_0xc565('0xc')]);router['get'](_0xc565('0xd'),auth[_0xc565('0x9')](),controller['download']);router[_0xc565('0xe')]('/',auth[_0xc565('0x9')](),interaction[_0xc565('0xf')](_0xc565('0x10'),_0xc565('0x11')),controller[_0xc565('0x12')]);router[_0xc565('0x13')](_0xc565('0xb'),auth[_0xc565('0x9')](),controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xc565('0x14')]);router[_0xc565('0x13')]('/:id/reject',auth[_0xc565('0x9')](),controller[_0xc565('0x15')]);router[_0xc565('0x16')](_0xc565('0xb'),auth[_0xc565('0x9')](),controller[_0xc565('0x17')]);module[_0xc565('0x18')]=router;
\ No newline at end of file
index bb9374f..9a763e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6640=['TEXT','long','medium','BOOLEAN','ENUM','out','STRING','Email','sequelize','lodash','exports'];(function(_0x1dc47a,_0x381539){var _0x218de5=function(_0x3e0e39){while(--_0x3e0e39){_0x1dc47a['push'](_0x1dc47a['shift']());}};_0x218de5(++_0x381539);}(_0x6640,0x97));var _0x0664=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x6640[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0x0664('0x0'));var _=require(_0x0664('0x1'));module[_0x0664('0x2')]={'body':{'type':Sequelize[_0x0664('0x3')](_0x0664('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0664('0x3')](_0x0664('0x5'))},'read':{'type':Sequelize[_0x0664('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0664('0x7')]('in',_0x0664('0x8')),'defaultValue':_0x0664('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0664('0x9')](0x1fe)},'from':{'type':Sequelize[_0x0664('0x9')]},'to':{'type':Sequelize[_0x0664('0x3')](_0x0664('0x4'))},'cc':{'type':Sequelize[_0x0664('0x3')](_0x0664('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0x0664('0x4'))},'subject':{'type':Sequelize[_0x0664('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0664('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize['TEXT'](_0x0664('0x4'))},'originChannel':{'type':Sequelize[_0x0664('0x7')]('Email','Chat'),'defaultValue':_0x0664('0xa'),'allowNull':![]}};
\ No newline at end of file
+var _0xbe45=['exports','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','sequelize','lodash'];(function(_0x34d771,_0x1e6460){var _0x139935=function(_0x51e783){while(--_0x51e783){_0x34d771['push'](_0x34d771['shift']());}};_0x139935(++_0x1e6460);}(_0xbe45,0x1ae));var _0x5be4=function(_0xa8708,_0x5487ae){_0xa8708=_0xa8708-0x0;var _0x4a2789=_0xbe45[_0xa8708];return _0x4a2789;};'use strict';var Sequelize=require(_0x5be4('0x0'));var _=require(_0x5be4('0x1'));module[_0x5be4('0x2')]={'body':{'type':Sequelize[_0x5be4('0x3')](_0x5be4('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5be4('0x3')]('medium')},'read':{'type':Sequelize[_0x5be4('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5be4('0x6')]('in',_0x5be4('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x5be4('0x8')]},'to':{'type':Sequelize[_0x5be4('0x3')]('long')},'cc':{'type':Sequelize[_0x5be4('0x3')](_0x5be4('0x4'))},'bcc':{'type':Sequelize[_0x5be4('0x3')]('long')},'subject':{'type':Sequelize[_0x5be4('0x3')]},'sentAt':{'type':Sequelize[_0x5be4('0x9')]},'attach':{'type':Sequelize[_0x5be4('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5be4('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5be4('0x9')]},'originTo':{'type':Sequelize[_0x5be4('0x3')](_0x5be4('0x4'))},'originCc':{'type':Sequelize[_0x5be4('0x3')]('long')},'originChannel':{'type':Sequelize[_0x5be4('0x6')](_0x5be4('0xb'),'Chat'),'defaultValue':_0x5be4('0xb'),'allowNull':![]}};
\ No newline at end of file
index ee3b476..0ebb666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['message','info','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','length','include','find','body','create','direction','out','secret','MailAccount','findOne','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','ListId','sendMail','update','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','agent','get','MailInteraction','MailInteractionId','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','SIP/%s','channel','fromString','EventManager','acceptmessage','reject','mail','RejectMessage','rejectMessage','email','interface','event','rejectmessage','download','unix','toString','files','tmp','server','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x34e8,0x12c));var _0x834e=function(_0x33321,_0x812767){_0x33321=_0x33321-0x0;var _0x40bf75=_0x34e8[_0x33321];return _0x40bf75;};'use strict';var emlformat=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var util=require(_0x834e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x834e('0x4'));var Redis=require(_0x834e('0x5'));var htmlToText=require(_0x834e('0x6'));var qs=require(_0x834e('0x7'));var logger=require(_0x834e('0x8'))(_0x834e('0x9'));var interaction_log=require(_0x834e('0x8'))('mail-interactions');var config=require(_0x834e('0xa'));var db=require('../../mysqldb')['db'];config[_0x834e('0xb')]=_[_0x834e('0xc')](config[_0x834e('0xb')],{'host':_0x834e('0xd'),'port':0x18eb});var socket=require(_0x834e('0xe'))(new Redis(config[_0x834e('0xb')]));require(_0x834e('0xf'))[_0x834e('0x10')](socket);var jayson=require(_0x834e('0x11'));var client=jayson[_0x834e('0x12')][_0x834e('0x13')]({'port':0x232c});var client9003=jayson[_0x834e('0x12')][_0x834e('0x13')]({'port':0x232b});var client9002=jayson[_0x834e('0x12')][_0x834e('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x1e00de,_0x2fd95c,_0x538bb3,_0x5e5b6d){return new BPromise(function(_0x6cd9b9,_0x58a27e){var _0x23848e=_0x5e5b6d||client;return _0x23848e[_0x834e('0x14')](_0x1e00de,_0x538bb3)[_0x834e('0x15')](function(_0x21cc0a){logger['info'](_0x834e('0x16'),_0x2fd95c,_0x834e('0x17'));logger['debug'](_0x834e('0x18'),_0x2fd95c,'request\x20sent',JSON[_0x834e('0x19')](_0x21cc0a));if(_0x21cc0a[_0x834e('0x1a')]){if(_0x21cc0a['error'][_0x834e('0x1b')]===0x1f4){logger[_0x834e('0x1a')](_0x834e('0x16'),_0x2fd95c,_0x21cc0a['error'][_0x834e('0x1c')]);return _0x58a27e(_0x21cc0a[_0x834e('0x1a')][_0x834e('0x1c')]);}logger[_0x834e('0x1a')](_0x834e('0x16'),_0x2fd95c,_0x21cc0a[_0x834e('0x1a')][_0x834e('0x1c')]);return _0x6cd9b9(_0x21cc0a['error'][_0x834e('0x1c')]);}else{logger[_0x834e('0x1d')](_0x834e('0x16'),_0x2fd95c,_0x834e('0x17'));_0x6cd9b9(_0x21cc0a['result'][_0x834e('0x1c')]);}})[_0x834e('0x1e')](function(_0x5a05c0){logger[_0x834e('0x1a')](_0x834e('0x16'),_0x2fd95c,_0x5a05c0);_0x58a27e(_0x5a05c0);});});}function respondWithResult(_0x8d406e,_0x5c55ca){_0x5c55ca=_0x5c55ca||0xc8;return function(_0x4e3f48){if(_0x4e3f48){return _0x8d406e[_0x834e('0x1f')](_0x5c55ca)[_0x834e('0x20')](_0x4e3f48);}};}function respondWithFilteredResult(_0x589dde,_0x25ee1d){return function(_0x1dc1e0){if(_0x1dc1e0){var _0x58f4fd=typeof _0x25ee1d[_0x834e('0x21')]===_0x834e('0x22')&&typeof _0x25ee1d[_0x834e('0x23')]==='undefined';var _0x24fcf7=_0x1dc1e0[_0x834e('0x24')];var _0x5e1cc5=_0x58f4fd?0x0:_0x25ee1d['offset'];var _0x1e713a=_0x58f4fd?_0x1dc1e0['count']:_0x25ee1d[_0x834e('0x21')]+_0x25ee1d[_0x834e('0x23')];var _0x3db026;if(_0x1e713a>=_0x24fcf7){_0x1e713a=_0x24fcf7;_0x3db026=0xc8;}else{_0x3db026=0xce;}_0x589dde[_0x834e('0x1f')](_0x3db026);return _0x589dde[_0x834e('0x25')](_0x834e('0x26'),_0x5e1cc5+'-'+_0x1e713a+'/'+_0x24fcf7)['json'](_0x1dc1e0);}return null;};}function saveUpdates(_0x510780){return function(_0x4dc64a){if(_0x4dc64a){return _0x4dc64a['update'](_0x510780)[_0x834e('0x15')](function(_0x567cea){return _0x567cea;});}return null;};}function removeEntity(_0x106d6a){return function(_0x5dacc1){if(_0x5dacc1){return _0x5dacc1[_0x834e('0x27')]()[_0x834e('0x15')](function(){_0x106d6a[_0x834e('0x1f')](0xcc)[_0x834e('0x28')]();});}};}function handleEntityNotFound(_0x4551f5){return function(_0x390119){if(!_0x390119){_0x4551f5[_0x834e('0x29')](0x194);}return _0x390119;};}function handleError(_0xfaf716,_0x278db3){_0x278db3=_0x278db3||0x1f4;return function(_0x493289){logger[_0x834e('0x1a')](_0x493289['stack']);if(_0x493289[_0x834e('0x2a')]){delete _0x493289[_0x834e('0x2a')];}_0xfaf716[_0x834e('0x1f')](_0x278db3)[_0x834e('0x2b')](_0x493289);};}exports[_0x834e('0x2c')]=function(_0x4689c2,_0x4696a1){var _0x38cd29={},_0x358c31={},_0x12b2bc={'count':0x0,'rows':[]};var _0x5bd232=_[_0x834e('0x2d')](db[_0x834e('0x2e')][_0x834e('0x2f')],function(_0xaf01f4){return{'name':_0xaf01f4['fieldName'],'type':_0xaf01f4[_0x834e('0x30')][_0x834e('0x31')]};});_0x358c31['model']=_['map'](_0x5bd232,'name');_0x358c31[_0x834e('0x32')]=_[_0x834e('0x33')](_0x4689c2[_0x834e('0x32')]);_0x358c31[_0x834e('0x34')]=_[_0x834e('0x35')](_0x358c31[_0x834e('0x36')],_0x358c31['query']);_0x38cd29[_0x834e('0x37')]=_['intersection'](_0x358c31[_0x834e('0x36')],qs[_0x834e('0x38')](_0x4689c2['query'][_0x834e('0x38')]));_0x38cd29[_0x834e('0x37')]=_0x38cd29['attributes']['length']?_0x38cd29[_0x834e('0x37')]:_0x358c31[_0x834e('0x36')];if(!_0x4689c2[_0x834e('0x32')][_0x834e('0x39')](_0x834e('0x3a'))){_0x38cd29['limit']=qs[_0x834e('0x23')](_0x4689c2['query']['limit']);_0x38cd29[_0x834e('0x21')]=qs['offset'](_0x4689c2[_0x834e('0x32')][_0x834e('0x21')]);}_0x38cd29[_0x834e('0x3b')]=qs[_0x834e('0x3c')](_0x4689c2[_0x834e('0x32')]['sort']);_0x38cd29[_0x834e('0x3d')]=qs[_0x834e('0x34')](_[_0x834e('0x3e')](_0x4689c2['query'],_0x358c31[_0x834e('0x34')]),_0x5bd232);if(_0x4689c2[_0x834e('0x32')]['filter']){_0x38cd29[_0x834e('0x3d')]=_['merge'](_0x38cd29[_0x834e('0x3d')],{'$or':_[_0x834e('0x2d')](_0x5bd232,function(_0x4a18bb){if(_0x4a18bb['type']!==_0x834e('0x3f')){var _0x16969b={};_0x16969b[_0x4a18bb[_0x834e('0x2a')]]={'$like':'%'+_0x4689c2[_0x834e('0x32')][_0x834e('0x40')]+'%'};return _0x16969b;}})});}_0x38cd29=_[_0x834e('0x41')]({},_0x38cd29,_0x4689c2[_0x834e('0x42')]);var _0x4a3381={'where':_0x38cd29[_0x834e('0x3d')]};return db['MailMessage'][_0x834e('0x24')](_0x4a3381)['then'](function(_0x1df5b0){_0x12b2bc['count']=_0x1df5b0;if(_0x4689c2[_0x834e('0x32')][_0x834e('0x43')]){_0x38cd29['include']=[{'all':!![]}];}return db[_0x834e('0x2e')][_0x834e('0x44')](_0x38cd29);})[_0x834e('0x15')](function(_0xd55cc3){_0x12b2bc[_0x834e('0x45')]=_0xd55cc3;return _0x12b2bc;})[_0x834e('0x15')](respondWithFilteredResult(_0x4696a1,_0x38cd29))[_0x834e('0x1e')](handleError(_0x4696a1,null));};exports[_0x834e('0x46')]=function(_0x5dc63b,_0x279ea1){var _0x5f3943={'raw':!![],'where':{'id':_0x5dc63b[_0x834e('0x47')]['id']}},_0x3124be={};_0x3124be['model']=_[_0x834e('0x33')](db[_0x834e('0x2e')][_0x834e('0x2f')]);_0x3124be[_0x834e('0x32')]=_[_0x834e('0x33')](_0x5dc63b[_0x834e('0x32')]);_0x3124be['filters']=_['intersection'](_0x3124be[_0x834e('0x36')],_0x3124be[_0x834e('0x32')]);_0x5f3943[_0x834e('0x37')]=_[_0x834e('0x35')](_0x3124be[_0x834e('0x36')],qs[_0x834e('0x38')](_0x5dc63b[_0x834e('0x32')][_0x834e('0x38')]));_0x5f3943[_0x834e('0x37')]=_0x5f3943[_0x834e('0x37')][_0x834e('0x48')]?_0x5f3943[_0x834e('0x37')]:_0x3124be[_0x834e('0x36')];if(_0x5dc63b[_0x834e('0x32')][_0x834e('0x43')]){_0x5f3943[_0x834e('0x49')]=[{'all':!![]}];}_0x5f3943=_[_0x834e('0x41')]({},_0x5f3943,_0x5dc63b[_0x834e('0x42')]);return db[_0x834e('0x2e')][_0x834e('0x4a')](_0x5f3943)['then'](handleEntityNotFound(_0x279ea1,null))[_0x834e('0x15')](respondWithResult(_0x279ea1,null))[_0x834e('0x1e')](handleError(_0x279ea1,null));};exports['update']=function(_0x3c00a3,_0x3b0988){if(_0x3c00a3['body']['id']){delete _0x3c00a3[_0x834e('0x4b')]['id'];}return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x3c00a3[_0x834e('0x47')]['id']}})[_0x834e('0x15')](handleEntityNotFound(_0x3b0988,null))[_0x834e('0x15')](saveUpdates(_0x3c00a3[_0x834e('0x4b')],null))['then'](respondWithResult(_0x3b0988,null))[_0x834e('0x1e')](handleError(_0x3b0988,null));};exports[_0x834e('0x27')]=function(_0x3e0550,_0x363675){return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x3e0550[_0x834e('0x47')]['id']}})[_0x834e('0x15')](handleEntityNotFound(_0x363675,null))['then'](removeEntity(_0x363675,null))[_0x834e('0x1e')](handleError(_0x363675,null));};exports['describe']=function(_0x2f4bde,_0x53a9ee){return db[_0x834e('0x2e')]['describe']()['then'](respondWithResult(_0x53a9ee,null))[_0x834e('0x1e')](handleError(_0x53a9ee,null));};exports[_0x834e('0x4c')]=function(_0x5291ae,_0x5be43d){return db[_0x834e('0x2e')][_0x834e('0x4c')](_0x5291ae[_0x834e('0x4b')])[_0x834e('0x15')](function(_0x21c417){if(_0x21c417){if(_0x21c417[_0x834e('0x4d')]===_0x834e('0x4e')&&!_0x21c417[_0x834e('0x4f')]){var _0x528e66,_0x142334,_0x3c70bf;if(_0x5291ae['body']['to']){_0x142334=_0x5291ae[_0x834e('0x4b')]['to']['split'](',')[0x0];}return db[_0x834e('0x50')][_0x834e('0x51')]({'where':{'id':_0x21c417['MailAccountId']},'include':[{'model':db[_0x834e('0x52')],'as':_0x834e('0x53'),'include':[{'model':db[_0x834e('0x54')],'as':_0x834e('0x55'),'where':{'email':_0x142334},'limit':0x1,'order':[['updatedAt',_0x834e('0x56')]]}]},{'model':db[_0x834e('0x57')],'as':_0x834e('0x58'),'raw':!![]}]})['then'](function(_0x246b8e){_0x528e66=_0x246b8e;if(_0x528e66&&_0x528e66[_0x834e('0x58')]){var _0x3a7683={'tls':{'rejectUnauthorized':![]}};if(_[_0x834e('0x59')](_0x528e66[_0x834e('0x58')][_0x834e('0x5a')])){_0x3a7683[_0x834e('0x5b')]=_0x528e66[_0x834e('0x58')][_0x834e('0x5b')];_0x3a7683[_0x834e('0x5c')]=_0x528e66[_0x834e('0x58')][_0x834e('0x5c')];_0x3a7683[_0x834e('0x5d')]=_0x528e66[_0x834e('0x58')][_0x834e('0x5d')];if(_0x528e66[_0x834e('0x58')][_0x834e('0x5e')]){_0x3a7683[_0x834e('0x5f')]={'user':_0x528e66[_0x834e('0x58')][_0x834e('0x60')],'pass':_0x528e66[_0x834e('0x58')][_0x834e('0x61')]};}}else{_0x3a7683['service']=_0x528e66[_0x834e('0x58')][_0x834e('0x5a')];_0x3a7683[_0x834e('0x5f')]={'user':_0x528e66[_0x834e('0x58')]['user'],'pass':_0x528e66[_0x834e('0x58')]['pass']};_0x3a7683['secure']=_0x528e66[_0x834e('0x58')][_0x834e('0x5d')];}if(_0x5291ae[_0x834e('0x4b')][_0x834e('0x62')]&&_0x5291ae[_0x834e('0x4b')][_0x834e('0x62')][_0x834e('0x48')]){for(var _0xe5c8f6=0x0;_0xe5c8f6<_0x5291ae['body'][_0x834e('0x62')]['length'];_0xe5c8f6+=0x1){_0x5291ae[_0x834e('0x4b')][_0x834e('0x62')][_0xe5c8f6]={'filename':_0x5291ae['body']['attachments'][_0xe5c8f6][_0x834e('0x2a')],'path':path[_0x834e('0x63')](config[_0x834e('0x64')],_0x834e('0x65'),_0x5291ae[_0x834e('0x4b')]['attachments'][_0xe5c8f6][_0x834e('0x66')])};}}_0x3c70bf={'account':_0x3a7683,'message':_0x5291ae[_0x834e('0x4b')]};return;}})[_0x834e('0x15')](function(){if(_0x528e66[_0x834e('0x53')]){if(_0x528e66[_0x834e('0x53')][_0x834e('0x55')][_0x834e('0x48')]){return _0x528e66[_0x834e('0x53')][_0x834e('0x55')][0x0];}else{return db[_0x834e('0x54')]['create'](_[_0x834e('0xc')](_0x5291ae[_0x834e('0x4b')],{'firstName':_0x5291ae[_0x834e('0x4b')]['to'],'email':_0x5291ae[_0x834e('0x4b')]['to'],'phone':_0x5291ae['body']['to'],'ListId':_0x528e66[_0x834e('0x67')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x3c70bf){return respondWithRpcPromise('SendMail',_0x834e('0x68'),_0x3c70bf,client9003)[_0x834e('0x15')](function(_0x514aac){return _0x21c417[_0x834e('0x69')]({'read':!![],'messageId':_0x514aac[_0x834e('0x6a')],'sentAt':moment()['format'](_0x834e('0x6b'))});})[_0x834e('0x1e')](function(_0x4b88e7){logger['error']('%s',JSON[_0x834e('0x19')](_0x4b88e7));return _0x21c417;});}return _0x21c417;});}return _0x21c417;}})[_0x834e('0x15')](respondWithResult(_0x5be43d,0xc9))[_0x834e('0x1e')](handleError(_0x5be43d,null));};exports[_0x834e('0x6c')]=function(_0x1d8e7,_0x493239){var _0x264a6f={'agent':{},'channel':'mail'};if(_0x1d8e7[_0x834e('0x4b')]['id']){delete _0x1d8e7[_0x834e('0x4b')]['id'];}_0x1d8e7[_0x834e('0x4b')]['read']=!![];_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6d')]=moment()['format'](_0x834e('0x6b'));_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')]=_0x1d8e7['body'][_0x834e('0x6e')]||_0x1d8e7[_0x834e('0x60')]['id'];_0x264a6f[_0x834e('0x6f')]['id']=_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')];return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x1d8e7[_0x834e('0x47')]['id'],'UserId':null}})[_0x834e('0x15')](handleEntityNotFound(_0x493239,null))[_0x834e('0x15')](saveUpdates(_0x1d8e7['body'],null))['then'](function(_0x4e466e){if(_0x4e466e){_0x264a6f[_0x834e('0x1c')]=_0x4e466e[_0x834e('0x70')]({'plain':!![]});return db[_0x834e('0x71')][_0x834e('0x4a')]({'where':{'id':_0x4e466e[_0x834e('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x493239,null))['then'](function(_0x4520fc){if(_0x4520fc){return _0x4520fc[_0x834e('0x69')]({'UserId':_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')],'read1stAt':_[_0x834e('0x59')](_0x4520fc['read1stAt'])?moment()[_0x834e('0x73')](_0x834e('0x6b')):undefined});}return null;})[_0x834e('0x15')](function(_0x4e1735){if(_0x4e1735){_0x264a6f[_0x834e('0x74')]=_0x4e1735[_0x834e('0x70')]({'plain':!![]});interaction_log[_0x834e('0x1d')](_0x834e('0x75'),_0x1d8e7[_0x834e('0x60')]['id'],_0x1d8e7['user']['name'],_0x1d8e7[_0x834e('0x60')][_0x834e('0x76')],_0x264a6f['interaction']['id'],_0x1d8e7[_0x834e('0x4b')]?JSON['stringify'](_0x1d8e7[_0x834e('0x4b')]):_0x834e('0x77'));return respondWithRpcPromise(_0x834e('0x78'),'acceptMessage',_0x264a6f);}return null;})[_0x834e('0x15')](function(_0x49e721){var _0x5b2621='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49e721[_0x834e('0x1c')][_0x834e('0x79')];return db[_0x834e('0x7a')][_0x834e('0x32')](_0x5b2621,{'type':db[_0x834e('0x7b')][_0x834e('0x7c')][_0x834e('0x7d')],'raw':!![]})[_0x834e('0x15')](function(_0x17e61a){return _0x17e61a;});})['then'](function(_0x2f775a){if(_0x2f775a){_0x264a6f['message'][_0x834e('0x7e')]=_0x2f775a[0x0];if(!_0x1d8e7[_0x834e('0x4b')][_0x834e('0x6e')])return;return db[_0x834e('0x7f')][_0x834e('0x4a')]({'where':{'id':_0x1d8e7[_0x834e('0x4b')]['UserId'],'role':'agent'},'attributes':['id',_0x834e('0x2a'),_0x834e('0x80'),'email',_0x834e('0x81')],'raw':!![]});}return null;})[_0x834e('0x15')](function(_0x1bc5d1){if(!_0x1bc5d1)return null;_0x264a6f[_0x834e('0x1c')][_0x834e('0x6f')]=_0x1bc5d1;return _0x264a6f;})['then'](function(_0x29839d){if(_0x29839d){if(_0x1d8e7[_0x834e('0x4b')]['manual']){_0x264a6f['message']['interface']=util[_0x834e('0x73')](_0x834e('0x82'),_0x1d8e7['user'][_0x834e('0x2a')]);_0x264a6f[_0x834e('0x1c')]['channel']=_0x264a6f[_0x834e('0x83')];_0x264a6f['message']['event']=_0x834e('0x6c');_0x264a6f[_0x834e('0x1c')][_0x834e('0x4b')]=htmlToText[_0x834e('0x84')](_0x264a6f['message'][_0x834e('0x4b')]);return respondWithRpcPromise(_0x834e('0x85'),_0x834e('0x85'),{'event':_0x834e('0x86'),'message':_0x264a6f[_0x834e('0x1c')]},client9002)[_0x834e('0x15')](function(){return _0x264a6f;});}return _0x264a6f;}return null;})[_0x834e('0x15')](respondWithResult(_0x493239,null))[_0x834e('0x1e')](handleError(_0x493239,null));};exports[_0x834e('0x87')]=function(_0x2821fe,_0x2fa64c){var _0x261e3d={'agent':{},'channel':_0x834e('0x88')};if(_0x2821fe[_0x834e('0x4b')]['id']){delete _0x2821fe[_0x834e('0x4b')]['id'];}_0x2821fe[_0x834e('0x4b')][_0x834e('0x6e')]=_0x2821fe[_0x834e('0x4b')][_0x834e('0x6e')]||_0x2821fe[_0x834e('0x60')]['id'];_0x261e3d[_0x834e('0x6f')]['id']=_0x2821fe[_0x834e('0x4b')]['UserId'];return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x2821fe[_0x834e('0x47')]['id'],'UserId':null}})[_0x834e('0x15')](handleEntityNotFound(_0x2fa64c,null))[_0x834e('0x15')](function(_0x3bcdcd){if(_0x3bcdcd){_0x261e3d[_0x834e('0x1c')]=_0x3bcdcd[_0x834e('0x70')]({'plain':!![]});return db[_0x834e('0x71')]['find']({'where':{'id':_0x3bcdcd['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2fa64c,null))[_0x834e('0x15')](function(_0x493e1f){if(_0x493e1f){_0x261e3d[_0x834e('0x74')]=_0x493e1f[_0x834e('0x70')]({'plain':!![]});interaction_log[_0x834e('0x1d')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2821fe[_0x834e('0x60')]['id'],_0x2821fe[_0x834e('0x60')][_0x834e('0x2a')],_0x2821fe[_0x834e('0x60')][_0x834e('0x76')],_0x261e3d[_0x834e('0x74')]['id'],_0x2821fe['body']?JSON[_0x834e('0x19')](_0x2821fe[_0x834e('0x4b')]):_0x834e('0x77'));return respondWithRpcPromise(_0x834e('0x89'),_0x834e('0x8a'),_0x261e3d);}return null;})['then'](function(_0x4ebeba){var _0x508b3e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4ebeba[_0x834e('0x1c')][_0x834e('0x79')];return db['sequelize'][_0x834e('0x32')](_0x508b3e,{'type':db[_0x834e('0x7b')]['QueryTypes'][_0x834e('0x7d')],'raw':!![]})[_0x834e('0x15')](function(_0xbf7693){return _0xbf7693;});})[_0x834e('0x15')](function(_0x1d1075){if(_0x1d1075){_0x261e3d[_0x834e('0x1c')]['contact']=_0x1d1075[0x0];if(!_0x2821fe['body'][_0x834e('0x6e')])return;return db[_0x834e('0x7f')][_0x834e('0x4a')]({'where':{'id':_0x2821fe['body'][_0x834e('0x6e')],'role':_0x834e('0x6f')},'attributes':['id','name',_0x834e('0x80'),_0x834e('0x8b'),_0x834e('0x81')],'raw':!![]});}return null;})[_0x834e('0x15')](function(_0x4cb802){if(!_0x4cb802)return null;_0x261e3d[_0x834e('0x1c')]['agent']=_0x4cb802;return _0x261e3d;})['then'](function(_0xc64958){if(_0xc64958){_0xc64958[_0x834e('0x1c')][_0x834e('0x8c')]=util[_0x834e('0x73')](_0x834e('0x82'),_0x2821fe[_0x834e('0x60')]['name']);_0xc64958['message'][_0x834e('0x83')]=_0x261e3d[_0x834e('0x83')];_0xc64958[_0x834e('0x1c')][_0x834e('0x8d')]=_0x834e('0x87');_0xc64958[_0x834e('0x1c')][_0x834e('0x4b')]=htmlToText['fromString'](_0x261e3d[_0x834e('0x1c')][_0x834e('0x4b')]);respondWithRpcPromise('EventManager',_0x834e('0x85'),{'event':_0x834e('0x8e'),'message':_0xc64958[_0x834e('0x1c')]},client9002);return _0x261e3d;}return null;})[_0x834e('0x15')](respondWithResult(_0x2fa64c,null))[_0x834e('0x1e')](handleError(_0x2fa64c,null));};exports[_0x834e('0x8f')]=function(_0x231f0b,_0x3b44f3){var _0x14e794=moment()[_0x834e('0x90')]()[_0x834e('0x91')]();var _0x152372=path[_0x834e('0x63')](config[_0x834e('0x64')],'server',_0x834e('0x92'),_0x834e('0x93'));var _0x522eab=path[_0x834e('0x63')](config['root'],_0x834e('0x94'),'files',_0x834e('0x62'));var _0x560d10=util[_0x834e('0x73')](_0x834e('0x95'),_0x14e794);return db[_0x834e('0x2e')][_0x834e('0x4a')]({'where':{'id':_0x231f0b['params']['id']},'attributes':['id',_0x834e('0x4b'),_0x834e('0x96'),'to','cc',_0x834e('0x97'),_0x834e('0x98'),_0x834e('0x99')],'include':_0x231f0b[_0x834e('0x32')][_0x834e('0x62')]?[{'model':db[_0x834e('0x9a')],'as':_0x834e('0x9b')}]:undefined})[_0x834e('0x15')](handleEntityNotFound(_0x3b44f3,null))[_0x834e('0x15')](function(_0x1cb4d0){if(_0x1cb4d0){var _0x3a6546=_0x1cb4d0;var _0x246f01={'from':_0x3a6546[_0x834e('0x96')],'to':_0x3a6546['to'],'subject':_0x3a6546[_0x834e('0x98')],'html':_0x3a6546[_0x834e('0x4b')],'headers':{'Date':moment(_0x3a6546['createdAt'])['format'](_0x834e('0x9c'))},'attachments':[]};if(_0x1cb4d0['cc']){_0x246f01[_0x834e('0x9d')]['Cc']=_0x1cb4d0['cc'];}if(_0x1cb4d0[_0x834e('0x97')]){_0x246f01[_0x834e('0x9d')][_0x834e('0x9e')]=_0x1cb4d0[_0x834e('0x97')];}return new BPromise(function(_0x22f90d,_0x40fd40){if(_0x1cb4d0[_0x834e('0x9b')]){for(var _0x58cd3b=0x0;_0x58cd3b<_0x1cb4d0[_0x834e('0x9b')][_0x834e('0x48')];_0x58cd3b++){var _0x513d9e=_0x1cb4d0[_0x834e('0x9b')][_0x58cd3b];var _0x54c129=path[_0x834e('0x63')](_0x522eab,_0x513d9e[_0x834e('0x66')]);if(fs[_0x834e('0x9f')](_0x54c129)){_0x246f01['attachments'][_0x834e('0xa0')]({'name':_0x513d9e[_0x834e('0x2a')],'contentType':_0x513d9e['type'],'data':fs['readFileSync'](_0x54c129)});}}}emlformat[_0x834e('0xa1')](_0x246f01,function(_0x3b7b1a,_0x4e0f4d){if(_0x3b7b1a)return _0x40fd40(_0x3b7b1a);fs[_0x834e('0xa2')](path[_0x834e('0x63')](_0x152372,_0x560d10),_0x4e0f4d);return _0x22f90d(_0x4e0f4d);});});}})[_0x834e('0x15')](function(_0x135219){if(_0x135219){return _0x3b44f3[_0x834e('0x8f')](path['join'](_0x152372,_0x560d10),_0x560d10,function(_0x4e7545){if(!_0x4e7545)fs[_0x834e('0xa3')](path['join'](_0x152372,_0x560d10));});}})['catch'](handleError(_0x3b44f3,null));};
\ No newline at end of file
+var _0xedd9=['params','describe','create','secret','split','MailAccount','MailAccountId','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','port','secure','authentication','auth','service','user','pass','attachments','join','server/files/attachments','defaults','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','agent','UserId','MailInteraction','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','reject','fromString','rejectmessage','unix','toString','root','server','files','tmp','message-%s.eml','from','subject','createdAt','headers','bcc','Bcc','Attachments','basename','existsSync','readFileSync','build','download','unlinkSync','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','register','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','json','undefined','limit','count','offset','Content-Range','update','then','destroy','status','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','filters','find','body'];(function(_0x3e91c0,_0x49260e){var _0x1eb8db=function(_0x2f192b){while(--_0x2f192b){_0x3e91c0['push'](_0x3e91c0['shift']());}};_0x1eb8db(++_0x49260e);}(_0xedd9,0xfc));var _0x9edd=function(_0x431cc1,_0x1d104d){_0x431cc1=_0x431cc1-0x0;var _0x155efb=_0xedd9[_0x431cc1];return _0x155efb;};'use strict';var emlformat=require('eml-format');var moment=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var util=require(_0x9edd('0x2'));var path=require(_0x9edd('0x3'));var fs=require('fs');var _=require(_0x9edd('0x4'));var Redis=require(_0x9edd('0x5'));var htmlToText=require(_0x9edd('0x6'));var qs=require(_0x9edd('0x7'));var logger=require('../../config/logger')(_0x9edd('0x8'));var interaction_log=require(_0x9edd('0x9'))(_0x9edd('0xa'));var config=require(_0x9edd('0xb'));var db=require('../../mysqldb')['db'];config[_0x9edd('0xc')]=_['defaults'](config[_0x9edd('0xc')],{'host':_0x9edd('0xd'),'port':0x18eb});var socket=require(_0x9edd('0xe'))(new Redis(config[_0x9edd('0xc')]));require('./mailMessage.socket')[_0x9edd('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9edd('0x10')][_0x9edd('0x11')]({'port':0x232c});var client9003=jayson['client'][_0x9edd('0x11')]({'port':0x232b});var client9002=jayson[_0x9edd('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c0d7,_0x1b73d1,_0x25e64c,_0xfd544a){return new BPromise(function(_0x287ddd,_0x3a7b84){var _0xfca576=_0xfd544a||client;return _0xfca576[_0x9edd('0x12')](_0x30c0d7,_0x25e64c)['then'](function(_0x176bfa){logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x1b73d1,_0x9edd('0x15'));logger[_0x9edd('0x16')](_0x9edd('0x17'),_0x1b73d1,_0x9edd('0x15'),JSON[_0x9edd('0x18')](_0x176bfa));if(_0x176bfa['error']){if(_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1a')]===0x1f4){logger[_0x9edd('0x19')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x3a7b84(_0x176bfa[_0x9edd('0x19')]['message']);}logger[_0x9edd('0x19')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x287ddd(_0x176bfa['error']['message']);}else{logger[_0x9edd('0x13')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x9edd('0x15'));_0x287ddd(_0x176bfa['result']['message']);}})[_0x9edd('0x1c')](function(_0x1c46a8){logger['error']('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x1c46a8);_0x3a7b84(_0x1c46a8);});});}function respondWithResult(_0x341d67,_0x186186){_0x186186=_0x186186||0xc8;return function(_0x477878){if(_0x477878){return _0x341d67['status'](_0x186186)[_0x9edd('0x1d')](_0x477878);}};}function respondWithFilteredResult(_0x1dca43,_0x44a6c1){return function(_0x2ca65f){if(_0x2ca65f){var _0x339a0d=typeof _0x44a6c1['offset']===_0x9edd('0x1e')&&typeof _0x44a6c1[_0x9edd('0x1f')]===_0x9edd('0x1e');var _0x2f9f86=_0x2ca65f[_0x9edd('0x20')];var _0x4d507f=_0x339a0d?0x0:_0x44a6c1['offset'];var _0x3276ee=_0x339a0d?_0x2ca65f[_0x9edd('0x20')]:_0x44a6c1[_0x9edd('0x21')]+_0x44a6c1[_0x9edd('0x1f')];var _0x3c2227;if(_0x3276ee>=_0x2f9f86){_0x3276ee=_0x2f9f86;_0x3c2227=0xc8;}else{_0x3c2227=0xce;}_0x1dca43['status'](_0x3c2227);return _0x1dca43['set'](_0x9edd('0x22'),_0x4d507f+'-'+_0x3276ee+'/'+_0x2f9f86)[_0x9edd('0x1d')](_0x2ca65f);}return null;};}function saveUpdates(_0x1c762c){return function(_0x52746a){if(_0x52746a){return _0x52746a[_0x9edd('0x23')](_0x1c762c)[_0x9edd('0x24')](function(_0x2ae8dd){return _0x2ae8dd;});}return null;};}function removeEntity(_0x41af53){return function(_0x5eccfb){if(_0x5eccfb){return _0x5eccfb[_0x9edd('0x25')]()[_0x9edd('0x24')](function(){_0x41af53[_0x9edd('0x26')](0xcc)[_0x9edd('0x27')]();});}};}function handleEntityNotFound(_0xbbf08f){return function(_0x42e664){if(!_0x42e664){_0xbbf08f[_0x9edd('0x28')](0x194);}return _0x42e664;};}function handleError(_0x1fba7b,_0x19b6c1){_0x19b6c1=_0x19b6c1||0x1f4;return function(_0x1c2e2b){logger[_0x9edd('0x19')](_0x1c2e2b[_0x9edd('0x29')]);if(_0x1c2e2b[_0x9edd('0x2a')]){delete _0x1c2e2b[_0x9edd('0x2a')];}_0x1fba7b[_0x9edd('0x26')](_0x19b6c1)['send'](_0x1c2e2b);};}exports[_0x9edd('0x2b')]=function(_0x259259,_0x267c74){var _0x5d1707={},_0x2d2f88={},_0x3990fb={'count':0x0,'rows':[]};var _0xde9b13=_[_0x9edd('0x2c')](db[_0x9edd('0x2d')][_0x9edd('0x2e')],function(_0x473068){return{'name':_0x473068[_0x9edd('0x2f')],'type':_0x473068[_0x9edd('0x30')][_0x9edd('0x31')]};});_0x2d2f88[_0x9edd('0x32')]=_[_0x9edd('0x2c')](_0xde9b13,_0x9edd('0x2a'));_0x2d2f88[_0x9edd('0x33')]=_['keys'](_0x259259[_0x9edd('0x33')]);_0x2d2f88['filters']=_[_0x9edd('0x34')](_0x2d2f88[_0x9edd('0x32')],_0x2d2f88[_0x9edd('0x33')]);_0x5d1707[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x2d2f88['model'],qs[_0x9edd('0x36')](_0x259259[_0x9edd('0x33')][_0x9edd('0x36')]));_0x5d1707[_0x9edd('0x35')]=_0x5d1707[_0x9edd('0x35')][_0x9edd('0x37')]?_0x5d1707[_0x9edd('0x35')]:_0x2d2f88[_0x9edd('0x32')];if(!_0x259259[_0x9edd('0x33')][_0x9edd('0x38')]('nolimit')){_0x5d1707[_0x9edd('0x1f')]=qs['limit'](_0x259259[_0x9edd('0x33')]['limit']);_0x5d1707[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x259259[_0x9edd('0x33')]['offset']);}_0x5d1707[_0x9edd('0x39')]=qs[_0x9edd('0x3a')](_0x259259[_0x9edd('0x33')]['sort']);_0x5d1707[_0x9edd('0x3b')]=qs['filters'](_[_0x9edd('0x3c')](_0x259259[_0x9edd('0x33')],_0x2d2f88['filters']),_0xde9b13);if(_0x259259[_0x9edd('0x33')][_0x9edd('0x3d')]){_0x5d1707[_0x9edd('0x3b')]=_[_0x9edd('0x3e')](_0x5d1707['where'],{'$or':_[_0x9edd('0x2c')](_0xde9b13,function(_0x5bbdf8){if(_0x5bbdf8[_0x9edd('0x30')]!==_0x9edd('0x3f')){var _0x587d74={};_0x587d74[_0x5bbdf8[_0x9edd('0x2a')]]={'$like':'%'+_0x259259['query']['filter']+'%'};return _0x587d74;}})});}_0x5d1707=_[_0x9edd('0x3e')]({},_0x5d1707,_0x259259[_0x9edd('0x40')]);var _0x1f276b={'where':_0x5d1707[_0x9edd('0x3b')]};return db[_0x9edd('0x2d')][_0x9edd('0x20')](_0x1f276b)[_0x9edd('0x24')](function(_0x75efbe){_0x3990fb[_0x9edd('0x20')]=_0x75efbe;if(_0x259259[_0x9edd('0x33')][_0x9edd('0x41')]){_0x5d1707[_0x9edd('0x42')]=[{'all':!![]}];}return db[_0x9edd('0x2d')][_0x9edd('0x43')](_0x5d1707);})[_0x9edd('0x24')](function(_0x5416f8){_0x3990fb[_0x9edd('0x44')]=_0x5416f8;return _0x3990fb;})[_0x9edd('0x24')](respondWithFilteredResult(_0x267c74,_0x5d1707))[_0x9edd('0x1c')](handleError(_0x267c74,null));};exports[_0x9edd('0x45')]=function(_0x241929,_0x3ecdfd){var _0x10d41e={'raw':!![],'where':{'id':_0x241929['params']['id']}},_0x4e9ad1={};_0x4e9ad1['model']=_[_0x9edd('0x46')](db['MailMessage'][_0x9edd('0x2e')]);_0x4e9ad1[_0x9edd('0x33')]=_[_0x9edd('0x46')](_0x241929[_0x9edd('0x33')]);_0x4e9ad1[_0x9edd('0x47')]=_['intersection'](_0x4e9ad1[_0x9edd('0x32')],_0x4e9ad1[_0x9edd('0x33')]);_0x10d41e[_0x9edd('0x35')]=_['intersection'](_0x4e9ad1[_0x9edd('0x32')],qs[_0x9edd('0x36')](_0x241929[_0x9edd('0x33')][_0x9edd('0x36')]));_0x10d41e[_0x9edd('0x35')]=_0x10d41e[_0x9edd('0x35')]['length']?_0x10d41e[_0x9edd('0x35')]:_0x4e9ad1[_0x9edd('0x32')];if(_0x241929['query'][_0x9edd('0x41')]){_0x10d41e[_0x9edd('0x42')]=[{'all':!![]}];}_0x10d41e=_['merge']({},_0x10d41e,_0x241929[_0x9edd('0x40')]);return db[_0x9edd('0x2d')][_0x9edd('0x48')](_0x10d41e)['then'](handleEntityNotFound(_0x3ecdfd,null))[_0x9edd('0x24')](respondWithResult(_0x3ecdfd,null))[_0x9edd('0x1c')](handleError(_0x3ecdfd,null));};exports[_0x9edd('0x23')]=function(_0x28c7bd,_0x53f6e3){if(_0x28c7bd[_0x9edd('0x49')]['id']){delete _0x28c7bd[_0x9edd('0x49')]['id'];}return db[_0x9edd('0x2d')]['find']({'where':{'id':_0x28c7bd[_0x9edd('0x4a')]['id']}})[_0x9edd('0x24')](handleEntityNotFound(_0x53f6e3,null))['then'](saveUpdates(_0x28c7bd[_0x9edd('0x49')],null))['then'](respondWithResult(_0x53f6e3,null))[_0x9edd('0x1c')](handleError(_0x53f6e3,null));};exports[_0x9edd('0x25')]=function(_0x24245f,_0x3fcdf5){return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0x24245f[_0x9edd('0x4a')]['id']}})[_0x9edd('0x24')](handleEntityNotFound(_0x3fcdf5,null))[_0x9edd('0x24')](removeEntity(_0x3fcdf5,null))[_0x9edd('0x1c')](handleError(_0x3fcdf5,null));};exports[_0x9edd('0x4b')]=function(_0x5a3b1d,_0x161bea){return db[_0x9edd('0x2d')][_0x9edd('0x4b')]()['then'](respondWithResult(_0x161bea,null))[_0x9edd('0x1c')](handleError(_0x161bea,null));};exports['create']=function(_0x54d83d,_0x54ecfa){return db[_0x9edd('0x2d')][_0x9edd('0x4c')](_0x54d83d[_0x9edd('0x49')])[_0x9edd('0x24')](function(_0x48a900){if(_0x48a900){if(_0x48a900['direction']==='out'&&!_0x48a900[_0x9edd('0x4d')]){var _0x5f666b,_0xd5090a,_0x1091ff;if(_0x54d83d[_0x9edd('0x49')]['to']){_0xd5090a=_0x54d83d[_0x9edd('0x49')]['to'][_0x9edd('0x4e')](',')[0x0];}return db[_0x9edd('0x4f')]['findOne']({'where':{'id':_0x48a900[_0x9edd('0x50')]},'include':[{'model':db['CmList'],'as':_0x9edd('0x51'),'include':[{'model':db[_0x9edd('0x52')],'as':'Contacts','where':{'email':_0xd5090a},'limit':0x1,'order':[[_0x9edd('0x53'),_0x9edd('0x54')]]}]},{'model':db[_0x9edd('0x55')],'as':'Smtp','raw':!![]}]})[_0x9edd('0x24')](function(_0x2e1ce3){_0x5f666b=_0x2e1ce3;if(_0x5f666b&&_0x5f666b[_0x9edd('0x56')]){var _0x15ebfa={'tls':{'rejectUnauthorized':![]}};if(_[_0x9edd('0x57')](_0x5f666b[_0x9edd('0x56')]['service'])){_0x15ebfa['host']=_0x5f666b[_0x9edd('0x56')]['host'];_0x15ebfa[_0x9edd('0x58')]=_0x5f666b[_0x9edd('0x56')][_0x9edd('0x58')];_0x15ebfa[_0x9edd('0x59')]=_0x5f666b['Smtp'][_0x9edd('0x59')];if(_0x5f666b['Smtp'][_0x9edd('0x5a')]){_0x15ebfa[_0x9edd('0x5b')]={'user':_0x5f666b[_0x9edd('0x56')]['user'],'pass':_0x5f666b[_0x9edd('0x56')]['pass']};}}else{_0x15ebfa[_0x9edd('0x5c')]=_0x5f666b[_0x9edd('0x56')]['service'];_0x15ebfa[_0x9edd('0x5b')]={'user':_0x5f666b['Smtp'][_0x9edd('0x5d')],'pass':_0x5f666b[_0x9edd('0x56')][_0x9edd('0x5e')]};_0x15ebfa['secure']=_0x5f666b[_0x9edd('0x56')][_0x9edd('0x59')];}if(_0x54d83d[_0x9edd('0x49')][_0x9edd('0x5f')]&&_0x54d83d[_0x9edd('0x49')]['attachments']['length']){for(var _0x2e1a96=0x0;_0x2e1a96<_0x54d83d[_0x9edd('0x49')]['attachments']['length'];_0x2e1a96+=0x1){_0x54d83d['body'][_0x9edd('0x5f')][_0x2e1a96]={'filename':_0x54d83d['body']['attachments'][_0x2e1a96][_0x9edd('0x2a')],'path':path[_0x9edd('0x60')](config['root'],_0x9edd('0x61'),_0x54d83d[_0x9edd('0x49')][_0x9edd('0x5f')][_0x2e1a96]['basename'])};}}_0x1091ff={'account':_0x15ebfa,'message':_0x54d83d[_0x9edd('0x49')]};return;}})['then'](function(){if(_0x5f666b[_0x9edd('0x51')]){if(_0x5f666b[_0x9edd('0x51')]['Contacts'][_0x9edd('0x37')]){return _0x5f666b[_0x9edd('0x51')]['Contacts'][0x0];}else{return db[_0x9edd('0x52')][_0x9edd('0x4c')](_[_0x9edd('0x62')](_0x54d83d[_0x9edd('0x49')],{'firstName':_0x54d83d['body']['to'],'email':_0x54d83d[_0x9edd('0x49')]['to'],'phone':_0x54d83d['body']['to'],'ListId':_0x5f666b[_0x9edd('0x63')]}));}}else{throw new Error(_0x9edd('0x64'));}})[_0x9edd('0x24')](function(){if(_0x1091ff){return respondWithRpcPromise('SendMail',_0x9edd('0x65'),_0x1091ff,client9003)[_0x9edd('0x24')](function(_0x130dba){return _0x48a900[_0x9edd('0x23')]({'read':!![],'messageId':_0x130dba[_0x9edd('0x66')],'sentAt':moment()[_0x9edd('0x67')](_0x9edd('0x68'))});})['catch'](function(_0x5e29d0){logger[_0x9edd('0x19')]('%s',JSON[_0x9edd('0x18')](_0x5e29d0));return _0x48a900;});}return _0x48a900;});}return _0x48a900;}})[_0x9edd('0x24')](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x1c')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x69')]=function(_0x52f6f3,_0x2e40c8){var _0x5d56a={'agent':{},'channel':_0x9edd('0x6a')};if(_0x52f6f3['body']['id']){delete _0x52f6f3[_0x9edd('0x49')]['id'];}_0x52f6f3[_0x9edd('0x49')]['read']=!![];_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6b')]=moment()['format'](_0x9edd('0x68'));_0x52f6f3[_0x9edd('0x49')]['UserId']=_0x52f6f3[_0x9edd('0x49')]['UserId']||_0x52f6f3['user']['id'];_0x5d56a[_0x9edd('0x6c')]['id']=_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')];return db['MailMessage'][_0x9edd('0x48')]({'where':{'id':_0x52f6f3[_0x9edd('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e40c8,null))[_0x9edd('0x24')](saveUpdates(_0x52f6f3[_0x9edd('0x49')],null))[_0x9edd('0x24')](function(_0x1ad198){if(_0x1ad198){_0x5d56a['message']=_0x1ad198['get']({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'id':_0x1ad198[_0x9edd('0x6f')]}});}return null;})[_0x9edd('0x24')](handleEntityNotFound(_0x2e40c8,null))[_0x9edd('0x24')](function(_0x3cfd35){if(_0x3cfd35){return _0x3cfd35[_0x9edd('0x23')]({'UserId':_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')],'read1stAt':_[_0x9edd('0x57')](_0x3cfd35[_0x9edd('0x70')])?moment()['format'](_0x9edd('0x68')):undefined});}return null;})[_0x9edd('0x24')](function(_0x2c7562){if(_0x2c7562){_0x5d56a[_0x9edd('0x71')]=_0x2c7562[_0x9edd('0x72')]({'plain':!![]});interaction_log[_0x9edd('0x13')](_0x9edd('0x73'),_0x52f6f3['user']['id'],_0x52f6f3[_0x9edd('0x5d')][_0x9edd('0x2a')],_0x52f6f3['user'][_0x9edd('0x74')],_0x5d56a[_0x9edd('0x71')]['id'],_0x52f6f3['body']?JSON[_0x9edd('0x18')](_0x52f6f3[_0x9edd('0x49')]):_0x9edd('0x75'));return respondWithRpcPromise('AcceptMessage',_0x9edd('0x76'),_0x5d56a);}return null;})[_0x9edd('0x24')](function(_0x3f04d3){var _0x5a7de3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f04d3['message']['ContactId'];return db[_0x9edd('0x77')][_0x9edd('0x33')](_0x5a7de3,{'type':db[_0x9edd('0x78')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x56d794){return _0x56d794;});})[_0x9edd('0x24')](function(_0x20762d){if(_0x20762d){_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x79')]=_0x20762d[0x0];if(!_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')])return;return db[_0x9edd('0x7a')][_0x9edd('0x48')]({'where':{'id':_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')],'role':_0x9edd('0x6c')},'attributes':['id','name',_0x9edd('0x7b'),_0x9edd('0x7c'),_0x9edd('0x7d')],'raw':!![]});}return null;})[_0x9edd('0x24')](function(_0x104afc){if(!_0x104afc)return null;_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x6c')]=_0x104afc;return _0x5d56a;})[_0x9edd('0x24')](function(_0x4a7889){if(_0x4a7889){if(_0x52f6f3['body'][_0x9edd('0x7e')]){_0x5d56a['message'][_0x9edd('0x7f')]=util['format'](_0x9edd('0x80'),_0x52f6f3[_0x9edd('0x5d')]['name']);_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x81')]=_0x5d56a['channel'];_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x82')]=_0x9edd('0x69');_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x49')]=htmlToText['fromString'](_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x49')]);return respondWithRpcPromise(_0x9edd('0x83'),_0x9edd('0x83'),{'event':_0x9edd('0x84'),'message':_0x5d56a['message']},client9002)['then'](function(){return _0x5d56a;});}return _0x5d56a;}return null;})['then'](respondWithResult(_0x2e40c8,null))['catch'](handleError(_0x2e40c8,null));};exports['reject']=function(_0x2da088,_0x5d566e){var _0x58cb3f={'agent':{},'channel':_0x9edd('0x6a')};if(_0x2da088[_0x9edd('0x49')]['id']){delete _0x2da088[_0x9edd('0x49')]['id'];}_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')]=_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')]||_0x2da088[_0x9edd('0x5d')]['id'];_0x58cb3f[_0x9edd('0x6c')]['id']=_0x2da088[_0x9edd('0x49')]['UserId'];return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0x2da088[_0x9edd('0x4a')]['id'],'UserId':null}})[_0x9edd('0x24')](handleEntityNotFound(_0x5d566e,null))[_0x9edd('0x24')](function(_0x23e925){if(_0x23e925){_0x58cb3f[_0x9edd('0x1b')]=_0x23e925[_0x9edd('0x72')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x23e925[_0x9edd('0x6f')]}});}return null;})[_0x9edd('0x24')](handleEntityNotFound(_0x5d566e,null))[_0x9edd('0x24')](function(_0x120d0f){if(_0x120d0f){_0x58cb3f[_0x9edd('0x71')]=_0x120d0f[_0x9edd('0x72')]({'plain':!![]});interaction_log[_0x9edd('0x13')](_0x9edd('0x85'),_0x2da088[_0x9edd('0x5d')]['id'],_0x2da088[_0x9edd('0x5d')][_0x9edd('0x2a')],_0x2da088[_0x9edd('0x5d')][_0x9edd('0x74')],_0x58cb3f[_0x9edd('0x71')]['id'],_0x2da088['body']?JSON[_0x9edd('0x18')](_0x2da088[_0x9edd('0x49')]):'null');return respondWithRpcPromise(_0x9edd('0x86'),_0x9edd('0x87'),_0x58cb3f);}return null;})[_0x9edd('0x24')](function(_0x2b4d4c){var _0x559503=_0x9edd('0x88')+_0x2b4d4c[_0x9edd('0x1b')][_0x9edd('0x89')];return db[_0x9edd('0x77')][_0x9edd('0x33')](_0x559503,{'type':db['Sequelize'][_0x9edd('0x8a')][_0x9edd('0x8b')],'raw':!![]})[_0x9edd('0x24')](function(_0x4633eb){return _0x4633eb;});})[_0x9edd('0x24')](function(_0x59927d){if(_0x59927d){_0x58cb3f['message'][_0x9edd('0x79')]=_0x59927d[0x0];if(!_0x2da088['body'][_0x9edd('0x6d')])return;return db['User'][_0x9edd('0x48')]({'where':{'id':_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')],'role':_0x9edd('0x6c')},'attributes':['id',_0x9edd('0x2a'),_0x9edd('0x7b'),'email',_0x9edd('0x7d')],'raw':!![]});}return null;})[_0x9edd('0x24')](function(_0x3aae72){if(!_0x3aae72)return null;_0x58cb3f[_0x9edd('0x1b')][_0x9edd('0x6c')]=_0x3aae72;return _0x58cb3f;})[_0x9edd('0x24')](function(_0x2f8fb6){if(_0x2f8fb6){_0x2f8fb6[_0x9edd('0x1b')]['interface']=util[_0x9edd('0x67')](_0x9edd('0x80'),_0x2da088[_0x9edd('0x5d')][_0x9edd('0x2a')]);_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x81')]=_0x58cb3f[_0x9edd('0x81')];_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x82')]=_0x9edd('0x8c');_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x49')]=htmlToText[_0x9edd('0x8d')](_0x58cb3f[_0x9edd('0x1b')][_0x9edd('0x49')]);respondWithRpcPromise(_0x9edd('0x83'),_0x9edd('0x83'),{'event':_0x9edd('0x8e'),'message':_0x2f8fb6[_0x9edd('0x1b')]},client9002);return _0x58cb3f;}return null;})[_0x9edd('0x24')](respondWithResult(_0x5d566e,null))[_0x9edd('0x1c')](handleError(_0x5d566e,null));};exports['download']=function(_0xa704eb,_0x553018){var _0x4ca7e4=moment()[_0x9edd('0x8f')]()[_0x9edd('0x90')]();var _0x220c00=path[_0x9edd('0x60')](config[_0x9edd('0x91')],_0x9edd('0x92'),_0x9edd('0x93'),_0x9edd('0x94'));var _0x3e5a45=path[_0x9edd('0x60')](config['root'],_0x9edd('0x92'),_0x9edd('0x93'),'attachments');var _0x568067=util[_0x9edd('0x67')](_0x9edd('0x95'),_0x4ca7e4);return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0xa704eb['params']['id']},'attributes':['id','body',_0x9edd('0x96'),'to','cc','bcc',_0x9edd('0x97'),_0x9edd('0x98')],'include':_0xa704eb[_0x9edd('0x33')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x9edd('0x24')](handleEntityNotFound(_0x553018,null))[_0x9edd('0x24')](function(_0x7b0fc8){if(_0x7b0fc8){var _0x5bfbfd=_0x7b0fc8;var _0xb2e72={'from':_0x5bfbfd[_0x9edd('0x96')],'to':_0x5bfbfd['to'],'subject':_0x5bfbfd['subject'],'html':_0x5bfbfd[_0x9edd('0x49')],'headers':{'Date':moment(_0x5bfbfd[_0x9edd('0x98')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x7b0fc8['cc']){_0xb2e72[_0x9edd('0x99')]['Cc']=_0x7b0fc8['cc'];}if(_0x7b0fc8[_0x9edd('0x9a')]){_0xb2e72['headers'][_0x9edd('0x9b')]=_0x7b0fc8[_0x9edd('0x9a')];}return new BPromise(function(_0x54c6a0,_0x201d76){if(_0x7b0fc8['Attachments']){for(var _0x308a0f=0x0;_0x308a0f<_0x7b0fc8[_0x9edd('0x9c')][_0x9edd('0x37')];_0x308a0f++){var _0x742e13=_0x7b0fc8[_0x9edd('0x9c')][_0x308a0f];var _0x3e6426=path['join'](_0x3e5a45,_0x742e13[_0x9edd('0x9d')]);if(fs[_0x9edd('0x9e')](_0x3e6426)){_0xb2e72[_0x9edd('0x5f')]['push']({'name':_0x742e13[_0x9edd('0x2a')],'contentType':_0x742e13['type'],'data':fs[_0x9edd('0x9f')](_0x3e6426)});}}}emlformat[_0x9edd('0xa0')](_0xb2e72,function(_0x25da04,_0x41b0ea){if(_0x25da04)return _0x201d76(_0x25da04);fs['writeFileSync'](path['join'](_0x220c00,_0x568067),_0x41b0ea);return _0x54c6a0(_0x41b0ea);});});}})['then'](function(_0x12dcfa){if(_0x12dcfa){return _0x553018[_0x9edd('0xa1')](path[_0x9edd('0x60')](_0x220c00,_0x568067),_0x568067,function(_0x50af78){if(!_0x50af78)fs[_0x9edd('0xa2')](path[_0x9edd('0x60')](_0x220c00,_0x568067));});}})[_0x9edd('0x1c')](handleError(_0x553018,null));};
\ No newline at end of file
index 2b65f05..c8b441e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7251=['hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x11cf19,_0x549192){var _0x2cb81e=function(_0x268639){while(--_0x268639){_0x11cf19['push'](_0x11cf19['shift']());}};_0x2cb81e(++_0x549192);}(_0x7251,0xd2));var _0x1725=function(_0x58e862,_0x2e3830){_0x58e862=_0x58e862-0x0;var _0x537d16=_0x7251[_0x58e862];return _0x537d16;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x1725('0x0'))['db'][_0x1725('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1725('0x2')](0x0);var events={'afterCreate':_0x1725('0x3'),'afterUpdate':_0x1725('0x4'),'afterDestroy':_0x1725('0x5')};function emitEvent(_0x57d3bd){return function(_0x4401e4,_0x486489,_0x194b6d){MailMessageEvents['emit'](_0x57d3bd+':'+_0x4401e4['id'],_0x4401e4);MailMessageEvents['emit'](_0x57d3bd,_0x4401e4);_0x194b6d(null);};}for(var e in events){if(events[_0x1725('0x6')](e)){var event=events[e];MailMessage[_0x1725('0x7')](e,emitEvent(event));}}module[_0x1725('0x8')]=MailMessageEvents;
\ No newline at end of file
+var _0x7019=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x7019,0x18d));var _0x9701=function(_0x12f08e,_0x21d4e3){_0x12f08e=_0x12f08e-0x0;var _0x5a41c2=_0x7019[_0x12f08e];return _0x5a41c2;};'use strict';var EventEmitter=require(_0x9701('0x0'));var MailMessage=require(_0x9701('0x1'))['db'][_0x9701('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9701('0x3'),'afterUpdate':'update','afterDestroy':_0x9701('0x4')};function emitEvent(_0x5f5197){return function(_0xeef677,_0x358c34,_0x2d6211){MailMessageEvents['emit'](_0x5f5197+':'+_0xeef677['id'],_0xeef677);MailMessageEvents[_0x9701('0x5')](_0x5f5197,_0xeef677);_0x2d6211(null);};}for(var e in events){if(events[_0x9701('0x6')](e)){var event=events[e];MailMessage[_0x9701('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
index 024c28a..9040eef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x933f=['moment','bluebird','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteractionId','then','update','createdAt','error','utf8mb4','util','../../config/logger','api'];(function(_0x5cf2e2,_0x3ba099){var _0x2abbe7=function(_0x269f34){while(--_0x269f34){_0x5cf2e2['push'](_0x5cf2e2['shift']());}};_0x2abbe7(++_0x3ba099);}(_0x933f,0x7d));var _0xf933=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x933f[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xf933('0x0'));var logger=require(_0xf933('0x1'))(_0xf933('0x2'));var moment=require(_0xf933('0x3'));var BPromise=require(_0xf933('0x4'));var rp=require('request-promise');var htmlToText=require(_0xf933('0x5'));var fs=require('fs');var path=require(_0xf933('0x6'));var rimraf=require(_0xf933('0x7'));var config=require('../../config/environment');var attributes=require(_0xf933('0x8'));module[_0xf933('0x9')]=function(_0x2becea,_0x28c0b6){return _0x2becea[_0xf933('0xa')](_0xf933('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xf933('0xc'),'fields':[_0xf933('0xc')]},{'name':_0xf933('0xd'),'fields':[_0xf933('0xe'),'subject'],'type':_0xf933('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x43204c,_0x5809eb,_0x2860a5){if(_0x43204c[_0xf933('0x10')]){_0x43204c[_0xf933('0xe')]=htmlToText[_0xf933('0x11')](_0x43204c[_0xf933('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2860a5(null,_0x5809eb);},'afterCreate':function(_0x2a446d,_0x5ae217,_0xda6afe){var _0x1af84b=_0x2becea[_0xf933('0x12')];var _0x5450a0=_0x2a446d[_0xf933('0x13')]({'plain':!![]});if(_0x5450a0[_0xf933('0x14')][_0xf933('0x15')]()==='in'||_0x5450a0[_0xf933('0x14')][_0xf933('0x15')]()===_0xf933('0x16')&&!_0x5450a0[_0xf933('0x17')]&&!_[_0xf933('0x18')](_0x5450a0[_0xf933('0x19')])){_0x1af84b['MailInteraction']['findOne']({'where':{'id':_0x5450a0[_0xf933('0x1a')]}})[_0xf933('0x1b')](function(_0x45a36e){if(_0x45a36e){_0x45a36e[_0xf933('0x1c')]({'lastMsgAt':_0x5450a0[_0xf933('0x1d')],'lastMsgDirection':_0x5450a0[_0xf933('0x14')][_0xf933('0x15')]()});}})['catch'](function(_0x4daab3){console[_0xf933('0x1e')](_0x4daab3);});}_0xda6afe();}},'charset':_0xf933('0x1f'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x52a9=['util','../../config/logger','bluebird','request-promise','html-to-text','path','rimraf','exports','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','models','toLowerCase','direction','out','isNil','MailInteraction','findOne','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0x52a9,0x15b));var _0x952a=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x52a9[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x952a('0x0'));var util=require(_0x952a('0x1'));var logger=require(_0x952a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x952a('0x3'));var rp=require(_0x952a('0x4'));var htmlToText=require(_0x952a('0x5'));var fs=require('fs');var path=require(_0x952a('0x6'));var rimraf=require(_0x952a('0x7'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x952a('0x8')]=function(_0x50660b,_0x2dd2cf){return _0x50660b['define'](_0x952a('0x9'),attributes,{'tableName':_0x952a('0xa'),'paranoid':![],'indexes':[{'name':_0x952a('0xb'),'fields':[_0x952a('0xb')]},{'name':'fti_mail_messages','fields':[_0x952a('0xc'),_0x952a('0xd')],'type':_0x952a('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b6970,_0x14be78,_0x3ed5af){if(_0x2b6970[_0x952a('0xf')]){_0x2b6970[_0x952a('0xc')]=htmlToText[_0x952a('0x10')](_0x2b6970[_0x952a('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3ed5af(null,_0x14be78);},'afterCreate':function(_0xc541b3,_0x58d018,_0x410830){var _0x4dc876=_0x50660b[_0x952a('0x11')];var _0x49f91b=_0xc541b3['get']({'plain':!![]});if(_0x49f91b['direction'][_0x952a('0x12')]()==='in'||_0x49f91b[_0x952a('0x13')][_0x952a('0x12')]()===_0x952a('0x14')&&!_0x49f91b['secret']&&!_[_0x952a('0x15')](_0x49f91b['UserId'])){_0x4dc876[_0x952a('0x16')][_0x952a('0x17')]({'where':{'id':_0x49f91b['MailInteractionId']}})['then'](function(_0x354a5c){if(_0x354a5c){_0x354a5c['update']({'lastMsgAt':_0x49f91b[_0x952a('0x18')],'lastMsgDirection':_0x49f91b[_0x952a('0x13')][_0x952a('0x12')]()});}})[_0x952a('0x19')](function(_0x1f5a29){console[_0x952a('0x1a')](_0x1f5a29);});}_0x410830();}},'charset':_0x952a('0x1b'),'collate':_0x952a('0x1c')});};
\ No newline at end of file
index 7328f3b..dfda7a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e3f=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});config[_0xf8e3('0xb')]=_['defaults'](config[_0xf8e3('0xb')],{'host':_0xf8e3('0xc'),'port':0x18eb});var socket=require(_0xf8e3('0xd'))(new Redis(config[_0xf8e3('0xb')]));require(_0xf8e3('0xe'))[_0xf8e3('0xf')](socket);function respondWithRpcPromise(_0x299a7e,_0x2a3b59,_0x2d914d){return new BPromise(function(_0x2bc3cd,_0x28f5f0){return client[_0xf8e3('0x10')](_0x299a7e,_0x2d914d)['then'](function(_0xb7d14f){logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,'request\x20sent');logger[_0xf8e3('0x13')](_0xf8e3('0x14'),_0x2a3b59,_0xf8e3('0x15'),JSON[_0xf8e3('0x16')](_0xb7d14f));if(_0xb7d14f['error']){if(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x18')]===0x1f4){logger[_0xf8e3('0x17')]('MailMessage,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f[_0xf8e3('0x17')]['message']);return _0x28f5f0(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}logger[_0xf8e3('0x17')]('MailMessage,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f['error'][_0xf8e3('0x19')]);return _0x2bc3cd(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}else{logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,_0xf8e3('0x15'));_0x2bc3cd(_0xb7d14f[_0xf8e3('0x1a')][_0xf8e3('0x19')]);}})[_0xf8e3('0x1b')](function(_0x13fb31){logger['error'](_0xf8e3('0x12'),_0x2a3b59,_0x13fb31);_0x28f5f0(_0x13fb31);});});}exports[_0xf8e3('0x1c')]=function(_0x24e8d6){var _0x31f55d=this;return new Promise(function(_0x3128ad,_0x11c58e){return db[_0xf8e3('0x1d')][_0xf8e3('0x1e')](_0x24e8d6['body'],{'raw':_0x24e8d6[_0xf8e3('0x1f')]?_0x24e8d6[_0xf8e3('0x1f')][_0xf8e3('0x20')]===undefined?!![]:![]:!![]})[_0xf8e3('0x21')](function(_0x4a1e5f){logger[_0xf8e3('0x11')]('CreateMailMessage',_0x24e8d6);logger[_0xf8e3('0x13')](_0xf8e3('0x1c'),_0x24e8d6,JSON[_0xf8e3('0x16')](_0x4a1e5f));_0x3128ad(_0x4a1e5f);})[_0xf8e3('0x1b')](function(_0x1f4b68){logger[_0xf8e3('0x17')]('CreateMailMessage',_0x1f4b68[_0xf8e3('0x19')],_0x24e8d6);_0x11c58e(_0x31f55d[_0xf8e3('0x17')](0x1f4,_0x1f4b68[_0xf8e3('0x19')]));});});};
\ No newline at end of file
+var _0xaebd=['MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage','create','body','options','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailMessage.socket','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x32b5a9,_0x4f1a6e){_0x32b5a9=_0x32b5a9-0x0;var _0x2d49f7=_0xaebd[_0x32b5a9];return _0x2d49f7;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});config[_0xdaeb('0xb')]=_[_0xdaeb('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdaeb('0xd'))(new Redis(config[_0xdaeb('0xb')]));require(_0xdaeb('0xe'))['register'](socket);function respondWithRpcPromise(_0xbb4b72,_0x494d42,_0x3e83f3){return new BPromise(function(_0x4ba89d,_0x2218d6){return client['request'](_0xbb4b72,_0x3e83f3)[_0xdaeb('0xf')](function(_0x3f0e95){logger['info']('MailMessage,\x20%s,\x20%s',_0x494d42,_0xdaeb('0x10'));logger['debug'](_0xdaeb('0x11'),_0x494d42,_0xdaeb('0x10'),JSON[_0xdaeb('0x12')](_0x3f0e95));if(_0x3f0e95[_0xdaeb('0x13')]){if(_0x3f0e95[_0xdaeb('0x13')][_0xdaeb('0x14')]===0x1f4){logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x3f0e95['error'][_0xdaeb('0x15')]);return _0x2218d6(_0x3f0e95[_0xdaeb('0x13')][_0xdaeb('0x15')]);}logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x3f0e95['error'][_0xdaeb('0x15')]);return _0x4ba89d(_0x3f0e95['error']['message']);}else{logger[_0xdaeb('0x16')](_0xdaeb('0x17'),_0x494d42,_0xdaeb('0x10'));_0x4ba89d(_0x3f0e95[_0xdaeb('0x18')][_0xdaeb('0x15')]);}})[_0xdaeb('0x19')](function(_0x501f77){logger[_0xdaeb('0x13')]('MailMessage,\x20%s,\x20%s',_0x494d42,_0x501f77);_0x2218d6(_0x501f77);});});}exports[_0xdaeb('0x1a')]=function(_0x13b3f2){var _0x18bd81=this;return new Promise(function(_0x5360ce,_0x4e97e0){return db[_0xdaeb('0x1b')][_0xdaeb('0x1c')](_0x13b3f2[_0xdaeb('0x1d')],{'raw':_0x13b3f2[_0xdaeb('0x1e')]?_0x13b3f2[_0xdaeb('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2c969d){logger[_0xdaeb('0x16')](_0xdaeb('0x1a'),_0x13b3f2);logger[_0xdaeb('0x1f')](_0xdaeb('0x1a'),_0x13b3f2,JSON['stringify'](_0x2c969d));_0x5360ce(_0x2c969d);})[_0xdaeb('0x19')](function(_0x4dc25f){logger[_0xdaeb('0x13')](_0xdaeb('0x1a'),_0x4dc25f[_0xdaeb('0x15')],_0x13b3f2);_0x4e97e0(_0x18bd81[_0xdaeb('0x13')](0x1f4,_0x4dc25f[_0xdaeb('0x15')]));});});};
\ No newline at end of file
index 1f8935e..b69bff6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x720e=['removeListener','length','mailMessage:','./mailMessage.events','save','remove','update','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x720e,0x1b3));var _0xe720=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x720e[_0x36a469];return _0x3347fc;};'use strict';var MailMessageEvents=require(_0xe720('0x0'));var events=[_0xe720('0x1'),_0xe720('0x2'),_0xe720('0x3')];function createListener(_0x2ff61d,_0x218585){return function(_0xef251){_0x218585[_0xe720('0x4')](_0x2ff61d,_0xef251);};}function removeListener(_0x126fb0,_0x354f6e){return function(){MailMessageEvents[_0xe720('0x5')](_0x126fb0,_0x354f6e);};}exports['register']=function(_0x4e2d78){for(var _0x551a0b=0x0,_0xf33e68=events[_0xe720('0x6')];_0x551a0b<_0xf33e68;_0x551a0b++){var _0x53b85f=events[_0x551a0b];var _0x19c0eb=createListener(_0xe720('0x7')+_0x53b85f,_0x4e2d78);MailMessageEvents['on'](_0x53b85f,_0x19c0eb);}};
\ No newline at end of file
+var _0xed01=['removeListener','register','length','./mailMessage.events','save','update'];(function(_0x336280,_0x10a45c){var _0x2a1b5b=function(_0x3c99ea){while(--_0x3c99ea){_0x336280['push'](_0x336280['shift']());}};_0x2a1b5b(++_0x10a45c);}(_0xed01,0x111));var _0x1ed0=function(_0x5207a2,_0x316913){_0x5207a2=_0x5207a2-0x0;var _0x314716=_0xed01[_0x5207a2];return _0x314716;};'use strict';var MailMessageEvents=require(_0x1ed0('0x0'));var events=[_0x1ed0('0x1'),'remove',_0x1ed0('0x2')];function createListener(_0x1ab7c1,_0x24595d){return function(_0x549d38){_0x24595d['emit'](_0x1ab7c1,_0x549d38);};}function removeListener(_0x223187,_0x3a5046){return function(){MailMessageEvents[_0x1ed0('0x3')](_0x223187,_0x3a5046);};}exports[_0x1ed0('0x4')]=function(_0x2f9ab4){for(var _0x71de73=0x0,_0x3edc97=events[_0x1ed0('0x5')];_0x71de73<_0x3edc97;_0x71de73++){var _0x1f0bef=events[_0x71de73];var _0x109e31=createListener('mailMessage:'+_0x1f0bef,_0x2f9ab4);MailMessageEvents['on'](_0x1f0bef,_0x109e31);}};
\ No newline at end of file
index e4cdfa2..9f3342f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64f7=['getAgents','post','create','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','/:id','show','getTeams','/:id/users'];(function(_0x21f131,_0x4c5079){var _0xb5b83f=function(_0x32c2fd){while(--_0x32c2fd){_0x21f131['push'](_0x21f131['shift']());}};_0xb5b83f(++_0x4c5079);}(_0x64f7,0x12e));var _0x764f=function(_0x3eb508,_0x58565a){_0x3eb508=_0x3eb508-0x0;var _0x462647=_0x64f7[_0x3eb508];return _0x462647;};'use strict';var multer=require(_0x764f('0x0'));var util=require(_0x764f('0x1'));var path=require(_0x764f('0x2'));var timeout=require(_0x764f('0x3'));var express=require(_0x764f('0x4'));var router=express[_0x764f('0x5')]();var fs_extra=require(_0x764f('0x6'));var auth=require(_0x764f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x764f('0x8'));var controller=require(_0x764f('0x9'));router[_0x764f('0xa')]('/',auth[_0x764f('0xb')](),controller['index']);router['get'](_0x764f('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x764f('0xa')](_0x764f('0xd'),auth['isAuthenticated'](),controller[_0x764f('0xe')]);router[_0x764f('0xa')]('/:id/members',auth[_0x764f('0xb')](),controller['getMembers']);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x764f('0xf')]);router[_0x764f('0xa')](_0x764f('0x10'),auth['isAuthenticated'](),controller[_0x764f('0x11')]);router[_0x764f('0x12')]('/',auth[_0x764f('0xb')](),controller[_0x764f('0x13')]);router[_0x764f('0x12')](_0x764f('0x14'),auth[_0x764f('0xb')](),controller[_0x764f('0x15')]);router[_0x764f('0x12')](_0x764f('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0x764f('0x16')](_0x764f('0xd'),auth[_0x764f('0xb')](),controller[_0x764f('0x17')]);router[_0x764f('0x18')]('/:id',auth[_0x764f('0xb')](),controller[_0x764f('0x19')]);router[_0x764f('0x18')]('/:id/teams',auth[_0x764f('0xb')](),controller[_0x764f('0x1a')]);router[_0x764f('0x18')](_0x764f('0x10'),auth[_0x764f('0xb')](),controller[_0x764f('0x1b')]);module[_0x764f('0x1c')]=router;
\ No newline at end of file
+var _0x21aa=['describe','/:id','show','/:id/members','getAgents','post','create','/:id/teams','addTeams','/:id/users','addAgents','put','update','delete','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x339c87,_0x3ae7be){var _0x9ca4fc=function(_0x21d89e){while(--_0x21d89e){_0x339c87['push'](_0x339c87['shift']());}};_0x9ca4fc(++_0x3ae7be);}(_0x21aa,0x148));var _0xa21a=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x21aa[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require('multer');var util=require(_0xa21a('0x0'));var path=require('path');var timeout=require(_0xa21a('0x1'));var express=require(_0xa21a('0x2'));var router=express[_0xa21a('0x3')]();var fs_extra=require(_0xa21a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa21a('0x5'));var config=require(_0xa21a('0x6'));var controller=require('./mailQueue.controller');router[_0xa21a('0x7')]('/',auth[_0xa21a('0x8')](),controller['index']);router[_0xa21a('0x7')](_0xa21a('0x9'),auth['isAuthenticated'](),controller[_0xa21a('0xa')]);router[_0xa21a('0x7')](_0xa21a('0xb'),auth['isAuthenticated'](),controller[_0xa21a('0xc')]);router[_0xa21a('0x7')](_0xa21a('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0xa21a('0x7')]('/:id/teams',auth[_0xa21a('0x8')](),controller['getTeams']);router['get']('/:id/users',auth[_0xa21a('0x8')](),controller[_0xa21a('0xe')]);router[_0xa21a('0xf')]('/',auth['isAuthenticated'](),controller[_0xa21a('0x10')]);router['post'](_0xa21a('0x11'),auth[_0xa21a('0x8')](),controller[_0xa21a('0x12')]);router[_0xa21a('0xf')](_0xa21a('0x13'),auth[_0xa21a('0x8')](),controller[_0xa21a('0x14')]);router[_0xa21a('0x15')]('/:id',auth[_0xa21a('0x8')](),controller[_0xa21a('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xa21a('0x17')](_0xa21a('0x11'),auth[_0xa21a('0x8')](),controller['removeTeams']);router[_0xa21a('0x17')]('/:id/users',auth[_0xa21a('0x8')](),controller[_0xa21a('0x18')]);module[_0xa21a('0x19')]=router;
\ No newline at end of file
index 92476d9..2d32dc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb607=['STRING','rrmemory','roundrobin','sequelize','exports'];(function(_0x4cbbb4,_0x4b6650){var _0x67302f=function(_0x4202d2){while(--_0x4202d2){_0x4cbbb4['push'](_0x4cbbb4['shift']());}};_0x67302f(++_0x4b6650);}(_0xb607,0x11b));var _0x7b60=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xb607[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x7b60('0x0'));module[_0x7b60('0x1')]={'name':{'type':Sequelize[_0x7b60('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7b60('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7b60('0x3'),'beepall',_0x7b60('0x4'))}};
\ No newline at end of file
+var _0x3ae7=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x10e92e,_0x2be3f4){var _0x149fb4=function(_0x7f5759){while(--_0x7f5759){_0x10e92e['push'](_0x10e92e['shift']());}};_0x149fb4(++_0x2be3f4);}(_0x3ae7,0x16e));var _0x73ae=function(_0x1c62b6,_0x4fb41f){_0x1c62b6=_0x1c62b6-0x0;var _0x507594=_0x3ae7[_0x1c62b6];return _0x507594;};'use strict';var Sequelize=require(_0x73ae('0x0'));module[_0x73ae('0x1')]={'name':{'type':Sequelize[_0x73ae('0x2')],'unique':_0x73ae('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x73ae('0x2')]},'timeout':{'type':Sequelize[_0x73ae('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x73ae('0x5')](_0x73ae('0x6'),_0x73ae('0x7'),_0x73ae('0x8'))}};
\ No newline at end of file
index 142952b..a486549 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e6e=['role','user','UserProfileSection','userProfileId','autoAssociation','catch','error','params','describe','UserMailQueue','nolimit','MailQueueId','filter','findAll','User','findAndCountAll','UserId','updatedAt','rows','format','%s/%s','SIP','findOne','getTeams','addTeams','ids','Team','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','value','removeTeams','isEmpty','emit','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./mailQueue.socket','sendStatus','status','end','json','undefined','offset','count','Content-Range','apply','update','then','get','MailQueues','destroy','stack','name','send','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filters','merge','type','VIRTUAL','options','includeAll','include','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x405c6b,_0xb9d18a){var _0x29a4c3=function(_0xc5d97f){while(--_0xc5d97f){_0x405c6b['push'](_0x405c6b['shift']());}};_0x29a4c3(++_0xb9d18a);}(_0x4e6e,0x1c5));var _0xe4e6=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x4e6e[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0xe4e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4e6('0x1'));var jsonpatch=require(_0xe4e6('0x2'));var rp=require(_0xe4e6('0x3'));var moment=require(_0xe4e6('0x4'));var BPromise=require(_0xe4e6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe4e6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe4e6('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4e6('0x8'));var authService=require(_0xe4e6('0x9'));var qs=require('../../components/parsers/qs');var as=require(_0xe4e6('0xa'));var hardwareService=require(_0xe4e6('0xb'));var logger=require(_0xe4e6('0xc'))(_0xe4e6('0xd'));var utils=require('../../config/utils');var config=require(_0xe4e6('0xe'));var licenseUtil=require(_0xe4e6('0xf'));var db=require('../../mysqldb')['db'];config[_0xe4e6('0x10')]=_[_0xe4e6('0x11')](config[_0xe4e6('0x10')],{'host':_0xe4e6('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe4e6('0x10')]));require(_0xe4e6('0x13'))['register'](socket);function respondWithStatusCode(_0x2adef4,_0x59991e){_0x59991e=_0x59991e||0xcc;return function(_0x1da86c){if(_0x1da86c){return _0x2adef4[_0xe4e6('0x14')](_0x59991e);}return _0x2adef4[_0xe4e6('0x15')](_0x59991e)[_0xe4e6('0x16')]();};}function respondWithResult(_0x44b854,_0x37e543){_0x37e543=_0x37e543||0xc8;return function(_0x3b1f5a){if(_0x3b1f5a){return _0x44b854['status'](_0x37e543)[_0xe4e6('0x17')](_0x3b1f5a);}};}function respondWithFilteredResult(_0x97fb76,_0x65bfe6){return function(_0x346445){if(_0x346445){var _0x580cd9=typeof _0x65bfe6['offset']===_0xe4e6('0x18')&&typeof _0x65bfe6['limit']===_0xe4e6('0x18');var _0x588470=_0x346445['count'];var _0x303a7d=_0x580cd9?0x0:_0x65bfe6[_0xe4e6('0x19')];var _0x40de33=_0x580cd9?_0x346445[_0xe4e6('0x1a')]:_0x65bfe6['offset']+_0x65bfe6['limit'];var _0x1afc08;if(_0x40de33>=_0x588470){_0x40de33=_0x588470;_0x1afc08=0xc8;}else{_0x1afc08=0xce;}_0x97fb76['status'](_0x1afc08);return _0x97fb76['set'](_0xe4e6('0x1b'),_0x303a7d+'-'+_0x40de33+'/'+_0x588470)['json'](_0x346445);}return null;};}function patchUpdates(_0x409e0a){return function(_0xe0d3e8){try{jsonpatch[_0xe4e6('0x1c')](_0xe0d3e8,_0x409e0a,!![]);}catch(_0x4a558f){return BPromise['reject'](_0x4a558f);}return _0xe0d3e8['save']();};}function saveUpdates(_0x19ea0d,_0x1d39f7){return function(_0x42e9a0){if(_0x42e9a0){return _0x42e9a0[_0xe4e6('0x1d')](_0x19ea0d)[_0xe4e6('0x1e')](function(_0x17ad9d){return _0x17ad9d;});}return null;};}function removeEntity(_0x413d2e,_0x1c856e){return function(_0x1baeee){if(_0x1baeee){return _0x1baeee['destroy']()[_0xe4e6('0x1e')](function(){var _0x23da59=_0x1baeee[_0xe4e6('0x1f')]({'plain':!![]});var _0x4a017a=_0xe4e6('0x20');return db['UserProfileResource'][_0xe4e6('0x21')]({'where':{'type':_0x4a017a,'resourceId':_0x23da59['id']}})[_0xe4e6('0x1e')](function(){return _0x1baeee;});})[_0xe4e6('0x1e')](function(){_0x413d2e['status'](0xcc)[_0xe4e6('0x16')]();});}};}function handleEntityNotFound(_0x343b08,_0x1d2675){return function(_0x4c6da0){if(!_0x4c6da0){_0x343b08[_0xe4e6('0x14')](0x194);}return _0x4c6da0;};}function handleError(_0x520267,_0x1cc514){_0x1cc514=_0x1cc514||0x1f4;return function(_0x27d65f){logger['error'](_0x27d65f[_0xe4e6('0x22')]);if(_0x27d65f[_0xe4e6('0x23')]){delete _0x27d65f[_0xe4e6('0x23')];}_0x520267[_0xe4e6('0x15')](_0x1cc514)[_0xe4e6('0x24')](_0x27d65f);};}exports['index']=function(_0x513bf5,_0xcc6770){var _0x168f79={},_0x163acb={},_0x12e1c2={'count':0x0,'rows':[]};var _0x443a4d=_[_0xe4e6('0x25')](db[_0xe4e6('0x26')][_0xe4e6('0x27')],function(_0x494777){return{'name':_0x494777[_0xe4e6('0x28')],'type':_0x494777['type'][_0xe4e6('0x29')]};});_0x163acb[_0xe4e6('0x2a')]=_[_0xe4e6('0x25')](_0x443a4d,'name');_0x163acb[_0xe4e6('0x2b')]=_[_0xe4e6('0x2c')](_0x513bf5['query']);_0x163acb['filters']=_[_0xe4e6('0x2d')](_0x163acb[_0xe4e6('0x2a')],_0x163acb[_0xe4e6('0x2b')]);_0x168f79[_0xe4e6('0x2e')]=_[_0xe4e6('0x2d')](_0x163acb[_0xe4e6('0x2a')],qs[_0xe4e6('0x2f')](_0x513bf5['query']['fields']));_0x168f79[_0xe4e6('0x2e')]=_0x168f79[_0xe4e6('0x2e')][_0xe4e6('0x30')]?_0x168f79[_0xe4e6('0x2e')]:_0x163acb[_0xe4e6('0x2a')];if(!_0x513bf5[_0xe4e6('0x2b')][_0xe4e6('0x31')]('nolimit')){_0x168f79[_0xe4e6('0x32')]=qs[_0xe4e6('0x32')](_0x513bf5['query'][_0xe4e6('0x32')]);_0x168f79['offset']=qs[_0xe4e6('0x19')](_0x513bf5[_0xe4e6('0x2b')][_0xe4e6('0x19')]);}_0x168f79[_0xe4e6('0x33')]=qs[_0xe4e6('0x34')](_0x513bf5[_0xe4e6('0x2b')][_0xe4e6('0x34')]);_0x168f79[_0xe4e6('0x35')]=qs['filters'](_[_0xe4e6('0x36')](_0x513bf5[_0xe4e6('0x2b')],_0x163acb[_0xe4e6('0x37')]),_0x443a4d);if(_0x513bf5[_0xe4e6('0x2b')]['filter']){_0x168f79[_0xe4e6('0x35')]=_[_0xe4e6('0x38')](_0x168f79[_0xe4e6('0x35')],{'$or':_[_0xe4e6('0x25')](_0x443a4d,function(_0x96c7c4){if(_0x96c7c4[_0xe4e6('0x39')]!==_0xe4e6('0x3a')){var _0xeea7a0={};_0xeea7a0[_0x96c7c4['name']]={'$like':'%'+_0x513bf5[_0xe4e6('0x2b')]['filter']+'%'};return _0xeea7a0;}})});}_0x168f79=_['merge']({},_0x168f79,_0x513bf5[_0xe4e6('0x3b')]);var _0xdef002={'where':_0x168f79[_0xe4e6('0x35')]};return db['MailQueue'][_0xe4e6('0x1a')](_0xdef002)[_0xe4e6('0x1e')](function(_0x1b6968){_0x12e1c2[_0xe4e6('0x1a')]=_0x1b6968;if(_0x513bf5[_0xe4e6('0x2b')][_0xe4e6('0x3c')]){_0x168f79[_0xe4e6('0x3d')]=[{'all':!![]}];}return db[_0xe4e6('0x26')]['findAll'](_0x168f79);})[_0xe4e6('0x1e')](function(_0x1c2aeb){_0x12e1c2['rows']=_0x1c2aeb;return _0x12e1c2;})[_0xe4e6('0x1e')](respondWithFilteredResult(_0xcc6770,_0x168f79))['catch'](handleError(_0xcc6770,null));};exports[_0xe4e6('0x3e')]=function(_0x17e28a,_0x47293d){var _0xee1b2b={'raw':!![],'where':{'id':_0x17e28a['params']['id']}},_0x4e5284={};_0x4e5284[_0xe4e6('0x2a')]=_[_0xe4e6('0x2c')](db[_0xe4e6('0x26')]['rawAttributes']);_0x4e5284[_0xe4e6('0x2b')]=_[_0xe4e6('0x2c')](_0x17e28a['query']);_0x4e5284[_0xe4e6('0x37')]=_[_0xe4e6('0x2d')](_0x4e5284[_0xe4e6('0x2a')],_0x4e5284[_0xe4e6('0x2b')]);_0xee1b2b[_0xe4e6('0x2e')]=_[_0xe4e6('0x2d')](_0x4e5284[_0xe4e6('0x2a')],qs[_0xe4e6('0x2f')](_0x17e28a['query']['fields']));_0xee1b2b['attributes']=_0xee1b2b[_0xe4e6('0x2e')][_0xe4e6('0x30')]?_0xee1b2b[_0xe4e6('0x2e')]:_0x4e5284[_0xe4e6('0x2a')];if(_0x17e28a[_0xe4e6('0x2b')][_0xe4e6('0x3c')]){_0xee1b2b[_0xe4e6('0x3d')]=[{'all':!![]}];}_0xee1b2b=_[_0xe4e6('0x38')]({},_0xee1b2b,_0x17e28a[_0xe4e6('0x3b')]);return db[_0xe4e6('0x26')][_0xe4e6('0x3f')](_0xee1b2b)[_0xe4e6('0x1e')](handleEntityNotFound(_0x47293d,null))[_0xe4e6('0x1e')](respondWithResult(_0x47293d,null))['catch'](handleError(_0x47293d,null));};exports[_0xe4e6('0x40')]=function(_0x14d13f,_0x26f9ea){return db[_0xe4e6('0x26')][_0xe4e6('0x40')](_0x14d13f[_0xe4e6('0x41')],{})['then'](function(_0x269ba1){var _0x205074=_0x14d13f['user'][_0xe4e6('0x1f')]({'plain':!![]});if(!_0x205074)throw new Error(_0xe4e6('0x42'));if(_0x205074[_0xe4e6('0x43')]===_0xe4e6('0x44')){var _0x2ff3e4=_0x269ba1[_0xe4e6('0x1f')]({'plain':!![]});var _0x189516='MailQueues';return db[_0xe4e6('0x45')][_0xe4e6('0x3f')]({'where':{'name':_0x189516,'userProfileId':_0x205074[_0xe4e6('0x46')]},'raw':!![]})[_0xe4e6('0x1e')](function(_0x308deb){if(_0x308deb&&_0x308deb[_0xe4e6('0x47')]===0x0){return db['UserProfileResource'][_0xe4e6('0x40')]({'name':_0x2ff3e4[_0xe4e6('0x23')],'resourceId':_0x2ff3e4['id'],'type':_0x308deb[_0xe4e6('0x23')],'sectionId':_0x308deb['id']},{})[_0xe4e6('0x1e')](function(){return _0x269ba1;});}else{return _0x269ba1;}})[_0xe4e6('0x48')](function(_0x457479){logger[_0xe4e6('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x457479);throw _0x457479;});}return _0x269ba1;})[_0xe4e6('0x1e')](respondWithResult(_0x26f9ea,0xc9))['catch'](handleError(_0x26f9ea,null));};exports[_0xe4e6('0x1d')]=function(_0x3cfbe9,_0x4e3aa4){if(_0x3cfbe9['body']['id']){delete _0x3cfbe9[_0xe4e6('0x41')]['id'];}return db[_0xe4e6('0x26')][_0xe4e6('0x3f')]({'where':{'id':_0x3cfbe9[_0xe4e6('0x4a')]['id']}})[_0xe4e6('0x1e')](handleEntityNotFound(_0x4e3aa4,null))[_0xe4e6('0x1e')](saveUpdates(_0x3cfbe9['body'],null))[_0xe4e6('0x1e')](respondWithResult(_0x4e3aa4,null))[_0xe4e6('0x48')](handleError(_0x4e3aa4,null));};exports[_0xe4e6('0x21')]=function(_0xe9665b,_0xa7f6bc){return db[_0xe4e6('0x26')][_0xe4e6('0x3f')]({'where':{'id':_0xe9665b[_0xe4e6('0x4a')]['id']}})[_0xe4e6('0x1e')](handleEntityNotFound(_0xa7f6bc,null))['then'](removeEntity(_0xa7f6bc,null))[_0xe4e6('0x48')](handleError(_0xa7f6bc,null));};exports[_0xe4e6('0x4b')]=function(_0xe15118,_0x13df65){return db['MailQueue']['describe']()['then'](respondWithResult(_0x13df65,null))[_0xe4e6('0x48')](handleError(_0x13df65,null));};exports['getMembers']=function(_0x2150d8,_0x36c5df,_0xb21697){var _0x25ebad={'raw':!![],'where':{}},_0x19cc36={},_0x26bf06;return db[_0xe4e6('0x26')]['findOne']({'where':{'id':_0x2150d8[_0xe4e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x36c5df,null))[_0xe4e6('0x1e')](function(_0x197485){if(_0x197485){_0x26bf06=_0x197485[_0xe4e6('0x1f')]({'plain':!![]});_0x19cc36['model']=_[_0xe4e6('0x2c')](db[_0xe4e6('0x4c')]['rawAttributes']);_0x19cc36[_0xe4e6('0x2b')]=_[_0xe4e6('0x2c')](_0x2150d8['query']);_0x19cc36[_0xe4e6('0x37')]=_[_0xe4e6('0x2d')](_0x19cc36['model'],_0x19cc36['query']);_0x25ebad[_0xe4e6('0x2e')]=_[_0xe4e6('0x2d')](_0x19cc36[_0xe4e6('0x2a')],qs['fields'](_0x2150d8[_0xe4e6('0x2b')]['fields']));_0x25ebad[_0xe4e6('0x2e')]=_0x25ebad['attributes'][_0xe4e6('0x30')]?_0x25ebad[_0xe4e6('0x2e')]:_0x19cc36[_0xe4e6('0x2a')];if(!_0x2150d8[_0xe4e6('0x2b')][_0xe4e6('0x31')](_0xe4e6('0x4d'))){_0x25ebad[_0xe4e6('0x32')]=qs['limit'](_0x2150d8[_0xe4e6('0x2b')][_0xe4e6('0x32')]);_0x25ebad[_0xe4e6('0x19')]=qs[_0xe4e6('0x19')](_0x2150d8[_0xe4e6('0x2b')][_0xe4e6('0x19')]);}_0x25ebad[_0xe4e6('0x33')]=qs[_0xe4e6('0x34')](_0x2150d8[_0xe4e6('0x2b')][_0xe4e6('0x34')]);_0x25ebad[_0xe4e6('0x35')]=qs[_0xe4e6('0x37')](_['pick'](_0x2150d8[_0xe4e6('0x2b')],_0x19cc36['filters']));_0x25ebad[_0xe4e6('0x35')][_0xe4e6('0x4e')]=_0x197485['id'];if(_0x2150d8[_0xe4e6('0x2b')][_0xe4e6('0x4f')]){_0x25ebad[_0xe4e6('0x35')]=_['merge'](_0x25ebad[_0xe4e6('0x35')],{'$or':_[_0xe4e6('0x25')](_0x25ebad[_0xe4e6('0x2e')],function(_0x5aebea){var _0x22d71e={};_0x22d71e[_0x5aebea]={'$like':'%'+_0x2150d8[_0xe4e6('0x2b')][_0xe4e6('0x4f')]+'%'};return _0x22d71e;})});}_0x25ebad=_['merge']({},_0x25ebad,_0x2150d8[_0xe4e6('0x3b')]);return db[_0xe4e6('0x4c')][_0xe4e6('0x50')](_0x25ebad);}})['then'](function(_0x59bbb5){if(_0x59bbb5){return db[_0xe4e6('0x51')][_0xe4e6('0x52')]({'where':{'id':_[_0xe4e6('0x25')](_0x59bbb5,_0xe4e6('0x53')),'role':'agent'},'attributes':['id',_0xe4e6('0x23'),'mailPause',_0xe4e6('0x54'),'createdAt']});}})[_0xe4e6('0x1e')](function(_0xbe888b){if(_0xbe888b){return{'count':_0xbe888b[_0xe4e6('0x1a')],'rows':_[_0xe4e6('0x25')](_0xbe888b[_0xe4e6('0x55')],function(_0x4c0257){return{'membername':_0x4c0257[_0xe4e6('0x23')],'UserId':_0x4c0257['id'],'queue_name':_0x26bf06[_0xe4e6('0x23')],'MailQueueId':_0x26bf06['id'],'interface':util[_0xe4e6('0x56')](_0xe4e6('0x57'),_0xe4e6('0x58'),_0x4c0257['name']),'penalty':0x0,'paused':_0x4c0257['mailPause'],'createdAt':_0x4c0257['createdAt'],'updatedAt':_0x4c0257[_0xe4e6('0x54')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x36c5df,_0x25ebad))['catch'](handleError(_0x36c5df,null));};exports['getTeams']=function(_0x261883,_0x38fa2e,_0x489991){var _0x48bb7c={};var _0x387344={};var _0x3547d1;var _0x4f52d7;return db[_0xe4e6('0x26')][_0xe4e6('0x59')]({'where':{'id':_0x261883[_0xe4e6('0x4a')]['id']}})[_0xe4e6('0x1e')](handleEntityNotFound(_0x38fa2e,null))[_0xe4e6('0x1e')](function(_0x5c5eba){if(_0x5c5eba){_0x3547d1=_0x5c5eba;_0x387344['model']=_[_0xe4e6('0x2c')](db['Team'][_0xe4e6('0x27')]);_0x387344['query']=_[_0xe4e6('0x2c')](_0x261883['query']);_0x387344['filters']=_[_0xe4e6('0x2d')](_0x387344[_0xe4e6('0x2a')],_0x387344['query']);_0x48bb7c['attributes']=_[_0xe4e6('0x2d')](_0x387344[_0xe4e6('0x2a')],qs['fields'](_0x261883[_0xe4e6('0x2b')][_0xe4e6('0x2f')]));_0x48bb7c[_0xe4e6('0x2e')]=_0x48bb7c['attributes'][_0xe4e6('0x30')]?_0x48bb7c[_0xe4e6('0x2e')]:_0x387344[_0xe4e6('0x2a')];_0x48bb7c[_0xe4e6('0x33')]=qs[_0xe4e6('0x34')](_0x261883['query'][_0xe4e6('0x34')]);_0x48bb7c[_0xe4e6('0x35')]=qs[_0xe4e6('0x37')](_[_0xe4e6('0x36')](_0x261883[_0xe4e6('0x2b')],_0x387344['filters']));if(_0x261883[_0xe4e6('0x2b')][_0xe4e6('0x4f')]){_0x48bb7c[_0xe4e6('0x35')]=_[_0xe4e6('0x38')](_0x48bb7c[_0xe4e6('0x35')],{'$or':_['map'](_0x48bb7c[_0xe4e6('0x2e')],function(_0x3a9d0a){var _0x4eddc6={};_0x4eddc6[_0x3a9d0a]={'$like':'%'+_0x261883[_0xe4e6('0x2b')]['filter']+'%'};return _0x4eddc6;})});}_0x48bb7c=_[_0xe4e6('0x38')]({},_0x48bb7c,_0x261883['options']);return _0x3547d1['getTeams'](_0x48bb7c);}})[_0xe4e6('0x1e')](function(_0x1cb558){if(_0x1cb558){_0x4f52d7=_0x1cb558[_0xe4e6('0x30')];if(!_0x261883['query']['hasOwnProperty'](_0xe4e6('0x4d'))){_0x48bb7c[_0xe4e6('0x32')]=qs['limit'](_0x261883[_0xe4e6('0x2b')][_0xe4e6('0x32')]);_0x48bb7c[_0xe4e6('0x19')]=qs['offset'](_0x261883[_0xe4e6('0x2b')][_0xe4e6('0x19')]);}return _0x3547d1[_0xe4e6('0x5a')](_0x48bb7c);}})[_0xe4e6('0x1e')](function(_0x252473){if(_0x252473){return _0x252473?{'count':_0x4f52d7,'rows':_0x252473}:null;}})[_0xe4e6('0x1e')](respondWithResult(_0x38fa2e,null))['catch'](handleError(_0x38fa2e,null));};exports[_0xe4e6('0x5b')]=function(_0x4df073,_0x4725aa,_0x99e526){var _0x577376=_0x4df073[_0xe4e6('0x41')][_0xe4e6('0x5c')];return db[_0xe4e6('0x5d')]['findAll']({'where':{'id':_0x577376},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe4e6('0x23'),_0xe4e6('0x5e'),_0xe4e6('0x5f'),_0xe4e6('0x60')],'raw':!![]}]})[_0xe4e6('0x1e')](function(_0x20661e){if(_0x20661e){var _0x406372=_[_0xe4e6('0x61')](_0x20661e,function(_0x562404){var _0x4b3db7=_0x562404[_0xe4e6('0x1f')]({'plain':!![]});return _0x4b3db7[_0xe4e6('0x62')];});return db[_0xe4e6('0x26')][_0xe4e6('0x3f')]({'where':{'id':_0x4df073[_0xe4e6('0x4a')]['id']}})[_0xe4e6('0x1e')](function(_0x241cdd){return db[_0xe4e6('0x63')][_0xe4e6('0x64')](function(_0x3c0d1e){return _0x241cdd[_0xe4e6('0x5b')](_0x577376,{'transaction':_0x3c0d1e})['then'](function(){return BPromise['each'](_0x406372,function(_0x4c7ad5){return db['UserMailQueue'][_0xe4e6('0x65')]({'where':{'UserId':_0x4c7ad5['id'],'MailQueueId':_0x4df073[_0xe4e6('0x4a')]['id']},'transaction':_0x3c0d1e});});})[_0xe4e6('0x1e')](function(){_0x406372[_0xe4e6('0x66')](function(_0x1ce4ac){socket['emit'](_0xe4e6('0x67'),{'UserId':_0x1ce4ac['id'],'MailQueueId':_0x241cdd['id']});});});});});}})[_0xe4e6('0x1e')](respondWithStatusCode(_0x4725aa,null))[_0xe4e6('0x48')](handleError(_0x4725aa,null));};exports['removeTeams']=function(_0x112979,_0x3969c5,_0x16cbb7){return db[_0xe4e6('0x5d')][_0xe4e6('0x50')]({'where':{'id':_0x112979['query'][_0xe4e6('0x5c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe4e6('0x62'),'attributes':['id'],'raw':!![]}]})[_0xe4e6('0x1e')](handleEntityNotFound(_0x3969c5,null))[_0xe4e6('0x1e')](function(_0x84c808){var _0x39932c=_[_0xe4e6('0x25')](_0x84c808,'id');var _0xce3083=[];var _0x21c775=[];var _0x499169=squel[_0xe4e6('0x68')]();_0x499169[_0xe4e6('0x69')](_0xe4e6('0x6a'))[_0xe4e6('0x6b')](_0xe4e6('0x6c'),'tq')[_0xe4e6('0x6d')]('user_has_teams','ut',_0xe4e6('0x6e'))['where']('MailQueueId\x20=\x20?',_0x112979[_0xe4e6('0x4a')]['id']);for(var _0x1baa8a=0x0;_0x1baa8a<_0x84c808[_0xe4e6('0x30')];_0x1baa8a+=0x1){let _0x33cc5b=_0x84c808[_0x1baa8a];for(var _0x26f3ff=0x0;_0x26f3ff<_0x33cc5b[_0xe4e6('0x62')]['length'];_0x26f3ff+=0x1){let _0x1f6cf8=_0x33cc5b['Agents'][_0x26f3ff];var _0x257eee=_0x499169[_0xe4e6('0x6f')]();_0x257eee[_0xe4e6('0x35')](_0xe4e6('0x70'),_0x1f6cf8['id']);_0x21c775['push'](db[_0xe4e6('0x63')][_0xe4e6('0x2b')](_0x257eee[_0xe4e6('0x71')](),{'type':db[_0xe4e6('0x63')][_0xe4e6('0x72')]['SELECT']})[_0xe4e6('0x1e')](function(_0x336c14){if(_0x336c14['length']===0x1){return _0x1f6cf8['id'];}else{var _0x53610d=_[_0xe4e6('0x73')](_['map'](_0x336c14,_0xe4e6('0x74')),function(_0x346737){return _[_0xe4e6('0x75')](_0x39932c,_0x346737);});if(_0x53610d){return _0x1f6cf8['id'];}}}));}}return BPromise[_0xe4e6('0x76')](_0x21c775)[_0xe4e6('0x1e')](function(_0x32587d){_0xce3083=_(_0xce3083)['union'](_0x32587d)['compact']()[_0xe4e6('0x77')]();return db[_0xe4e6('0x26')][_0xe4e6('0x3f')]({'where':{'id':_0x112979[_0xe4e6('0x4a')]['id']}})[_0xe4e6('0x1e')](function(_0x46647e){return db[_0xe4e6('0x63')][_0xe4e6('0x64')](function(_0x286b64){return _0x46647e[_0xe4e6('0x78')](_0x112979['query'][_0xe4e6('0x5c')],{'transaction':_0x286b64})['then'](function(){if(!_[_0xe4e6('0x79')](_0xce3083)){return _0x46647e['removeAgents'](_0xce3083,{'transaction':_0x286b64});}})[_0xe4e6('0x1e')](function(){_0xce3083['forEach'](function(_0x1b0921){socket[_0xe4e6('0x7a')](_0xe4e6('0x7b'),{'UserId':_0x1b0921,'MailQueueId':_0x46647e['id']});});});});});});})[_0xe4e6('0x1e')](respondWithStatusCode(_0x3969c5,null))[_0xe4e6('0x48')](handleError(_0x3969c5,null));};exports[_0xe4e6('0x7c')]=function(_0x205b3f,_0x1f109e,_0x5862a1){return db['MailQueue'][_0xe4e6('0x3f')]({'where':{'id':_0x205b3f[_0xe4e6('0x4a')]['id']}})[_0xe4e6('0x1e')](handleEntityNotFound(_0x1f109e,null))['then'](function(_0x48c1cb){if(_0x48c1cb){return _0x48c1cb[_0xe4e6('0x7c')](_0x205b3f['body']['ids'],_[_0xe4e6('0x7d')](_0x205b3f[_0xe4e6('0x41')],[_0xe4e6('0x5c'),'id'])||{})[_0xe4e6('0x7e')](function(_0xada430){for(var _0x162ec3=0x0;_0x162ec3<_0x205b3f[_0xe4e6('0x41')][_0xe4e6('0x5c')]['length'];_0x162ec3+=0x1){socket[_0xe4e6('0x7a')](_0xe4e6('0x67'),{'UserId':Number(_0x205b3f[_0xe4e6('0x41')][_0xe4e6('0x5c')][_0x162ec3]),'MailQueueId':Number(_0x205b3f[_0xe4e6('0x4a')]['id'])});}return _0xada430;});}})['then'](respondWithResult(_0x1f109e,null))[_0xe4e6('0x48')](handleError(_0x1f109e,null));};exports[_0xe4e6('0x7f')]=function(_0x57baea,_0x31af4a,_0x347b4e){return db[_0xe4e6('0x26')][_0xe4e6('0x3f')]({'where':{'id':_0x57baea[_0xe4e6('0x4a')]['id']}})[_0xe4e6('0x1e')](handleEntityNotFound(_0x31af4a,null))[_0xe4e6('0x1e')](function(_0x2e70aa){if(_0x2e70aa){return _0x2e70aa[_0xe4e6('0x7f')](_0x57baea['query'][_0xe4e6('0x5c')])[_0xe4e6('0x1e')](function(){if(_[_0xe4e6('0x80')](_0x57baea[_0xe4e6('0x2b')][_0xe4e6('0x5c')])){for(var _0x389277=0x0;_0x389277<_0x57baea[_0xe4e6('0x2b')][_0xe4e6('0x5c')][_0xe4e6('0x30')];_0x389277+=0x1){socket[_0xe4e6('0x7a')](_0xe4e6('0x7b'),{'UserId':Number(_0x57baea[_0xe4e6('0x2b')][_0xe4e6('0x5c')][_0x389277]),'MailQueueId':Number(_0x57baea[_0xe4e6('0x4a')]['id'])});}}else{socket[_0xe4e6('0x7a')](_0xe4e6('0x7b'),{'UserId':Number(_0x57baea[_0xe4e6('0x2b')][_0xe4e6('0x5c')]),'MailQueueId':Number(_0x57baea[_0xe4e6('0x4a')]['id'])});}});}})[_0xe4e6('0x1e')](respondWithStatusCode(_0x31af4a,null))[_0xe4e6('0x48')](handleError(_0x31af4a,null));};exports[_0xe4e6('0x81')]=function(_0x338e4e,_0x43fa21,_0x16728f){var _0x3b4893={};var _0x5bb99b={};var _0x64f078;var _0x39ae80;return db[_0xe4e6('0x26')]['findOne']({'where':{'id':_0x338e4e[_0xe4e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x43fa21,null))[_0xe4e6('0x1e')](function(_0x21c1bb){if(_0x21c1bb){_0x64f078=_0x21c1bb;_0x5bb99b[_0xe4e6('0x2a')]=_['keys'](db['User'][_0xe4e6('0x27')]);_0x5bb99b[_0xe4e6('0x2b')]=_[_0xe4e6('0x2c')](_0x338e4e[_0xe4e6('0x2b')]);_0x5bb99b['filters']=_[_0xe4e6('0x2d')](_0x5bb99b[_0xe4e6('0x2a')],_0x5bb99b[_0xe4e6('0x2b')]);_0x3b4893[_0xe4e6('0x2e')]=_[_0xe4e6('0x2d')](_0x5bb99b[_0xe4e6('0x2a')],qs[_0xe4e6('0x2f')](_0x338e4e[_0xe4e6('0x2b')]['fields']));_0x3b4893[_0xe4e6('0x2e')]=_0x3b4893[_0xe4e6('0x2e')]['length']?_0x3b4893['attributes']:_0x5bb99b['model'];_0x3b4893[_0xe4e6('0x33')]=qs[_0xe4e6('0x34')](_0x338e4e['query'][_0xe4e6('0x34')]);_0x3b4893['where']=qs['filters'](_[_0xe4e6('0x36')](_0x338e4e['query'],_0x5bb99b[_0xe4e6('0x37')]));if(_0x338e4e[_0xe4e6('0x2b')][_0xe4e6('0x4f')]){_0x3b4893['where']=_['merge'](_0x3b4893['where'],{'$or':_[_0xe4e6('0x25')](_0x3b4893[_0xe4e6('0x2e')],function(_0x12e4ae){var _0x1799ce={};_0x1799ce[_0x12e4ae]={'$like':'%'+_0x338e4e[_0xe4e6('0x2b')][_0xe4e6('0x4f')]+'%'};return _0x1799ce;})});}_0x3b4893=_[_0xe4e6('0x38')]({},_0x3b4893,_0x338e4e['options']);return _0x64f078[_0xe4e6('0x81')](_0x3b4893);}})[_0xe4e6('0x1e')](function(_0x2d5a7a){if(_0x2d5a7a){_0x39ae80=_0x2d5a7a[_0xe4e6('0x30')];if(!_0x338e4e[_0xe4e6('0x2b')][_0xe4e6('0x31')](_0xe4e6('0x4d'))){_0x3b4893[_0xe4e6('0x32')]=qs[_0xe4e6('0x32')](_0x338e4e[_0xe4e6('0x2b')][_0xe4e6('0x32')]);_0x3b4893[_0xe4e6('0x19')]=qs[_0xe4e6('0x19')](_0x338e4e[_0xe4e6('0x2b')][_0xe4e6('0x19')]);}return _0x64f078[_0xe4e6('0x81')](_0x3b4893);}})['then'](function(_0x44bcc2){if(_0x44bcc2){return _0x44bcc2?{'count':_0x39ae80,'rows':_0x44bcc2}:null;}})[_0xe4e6('0x1e')](respondWithResult(_0x43fa21,null))[_0xe4e6('0x48')](handleError(_0x43fa21,null));};
\ No newline at end of file
+var _0x851f=['findOne','rawAttributes','MailQueueId','User','UserId','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','UserMailQueue','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','MailQueues','stack','name','send','index','map','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','MailQueue','findAll','rows','catch','show','params','keys','intersection','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers'];(function(_0x83420c,_0x50fd91){var _0x1057d7=function(_0x80befc){while(--_0x80befc){_0x83420c['push'](_0x83420c['shift']());}};_0x1057d7(++_0x50fd91);}(_0x851f,0xbb));var _0xf851=function(_0x1dad92,_0x2f948c){_0x1dad92=_0x1dad92-0x0;var _0x90a9f6=_0x851f[_0x1dad92];return _0x90a9f6;};'use strict';var emlformat=require(_0xf851('0x0'));var rimraf=require(_0xf851('0x1'));var zipdir=require(_0xf851('0x2'));var jsonpatch=require(_0xf851('0x3'));var rp=require('request-promise');var moment=require(_0xf851('0x4'));var BPromise=require(_0xf851('0x5'));var Mustache=require(_0xf851('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf851('0x7'));var csv=require('to-csv');var ejs=require(_0xf851('0x8'));var fs=require('fs');var fs_extra=require(_0xf851('0x9'));var _=require(_0xf851('0xa'));var squel=require('squel');var crypto=require(_0xf851('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf851('0xc'));var toCsv=require(_0xf851('0xd'));var querystring=require(_0xf851('0xe'));var Papa=require(_0xf851('0xf'));var Redis=require('ioredis');var authService=require(_0xf851('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf851('0x11'));var logger=require('../../config/logger')(_0xf851('0x12'));var utils=require(_0xf851('0x13'));var config=require(_0xf851('0x14'));var licenseUtil=require(_0xf851('0x15'));var db=require(_0xf851('0x16'))['db'];config[_0xf851('0x17')]=_['defaults'](config['redis'],{'host':_0xf851('0x18'),'port':0x18eb});var socket=require(_0xf851('0x19'))(new Redis(config['redis']));require(_0xf851('0x1a'))[_0xf851('0x1b')](socket);function respondWithStatusCode(_0x1a3dd6,_0x528984){_0x528984=_0x528984||0xcc;return function(_0x436b22){if(_0x436b22){return _0x1a3dd6[_0xf851('0x1c')](_0x528984);}return _0x1a3dd6[_0xf851('0x1d')](_0x528984)['end']();};}function respondWithResult(_0x311aad,_0x2e6514){_0x2e6514=_0x2e6514||0xc8;return function(_0x49f623){if(_0x49f623){return _0x311aad[_0xf851('0x1d')](_0x2e6514)[_0xf851('0x1e')](_0x49f623);}};}function respondWithFilteredResult(_0x5a3290,_0x59d3a5){return function(_0x5b7b09){if(_0x5b7b09){var _0x112431=typeof _0x59d3a5[_0xf851('0x1f')]===_0xf851('0x20')&&typeof _0x59d3a5[_0xf851('0x21')]===_0xf851('0x20');var _0x56cc50=_0x5b7b09[_0xf851('0x22')];var _0x3b4969=_0x112431?0x0:_0x59d3a5[_0xf851('0x1f')];var _0x35520f=_0x112431?_0x5b7b09[_0xf851('0x22')]:_0x59d3a5[_0xf851('0x1f')]+_0x59d3a5[_0xf851('0x21')];var _0x217a4c;if(_0x35520f>=_0x56cc50){_0x35520f=_0x56cc50;_0x217a4c=0xc8;}else{_0x217a4c=0xce;}_0x5a3290[_0xf851('0x1d')](_0x217a4c);return _0x5a3290['set'](_0xf851('0x23'),_0x3b4969+'-'+_0x35520f+'/'+_0x56cc50)[_0xf851('0x1e')](_0x5b7b09);}return null;};}function patchUpdates(_0x4ac1ae){return function(_0xa5100c){try{jsonpatch[_0xf851('0x24')](_0xa5100c,_0x4ac1ae,!![]);}catch(_0x10b1b9){return BPromise['reject'](_0x10b1b9);}return _0xa5100c[_0xf851('0x25')]();};}function saveUpdates(_0x501acb,_0x541d90){return function(_0xe8e011){if(_0xe8e011){return _0xe8e011['update'](_0x501acb)[_0xf851('0x26')](function(_0x2d26cc){return _0x2d26cc;});}return null;};}function removeEntity(_0x1c43ad,_0x3e7b74){return function(_0x53c200){if(_0x53c200){return _0x53c200[_0xf851('0x27')]()['then'](function(){var _0x23f06b=_0x53c200[_0xf851('0x28')]({'plain':!![]});var _0x61c09=_0xf851('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x61c09,'resourceId':_0x23f06b['id']}})[_0xf851('0x26')](function(){return _0x53c200;});})[_0xf851('0x26')](function(){_0x1c43ad[_0xf851('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5edfeb,_0x776fa8){return function(_0x21664f){if(!_0x21664f){_0x5edfeb[_0xf851('0x1c')](0x194);}return _0x21664f;};}function handleError(_0xc56115,_0x533dc7){_0x533dc7=_0x533dc7||0x1f4;return function(_0xceaf80){logger['error'](_0xceaf80[_0xf851('0x2a')]);if(_0xceaf80['name']){delete _0xceaf80[_0xf851('0x2b')];}_0xc56115['status'](_0x533dc7)[_0xf851('0x2c')](_0xceaf80);};}exports[_0xf851('0x2d')]=function(_0x5f498e,_0x5a86b1){var _0x5bbd63={},_0xae6012={},_0x4dddaa={'count':0x0,'rows':[]};var _0x357be0=_[_0xf851('0x2e')](db['MailQueue']['rawAttributes'],function(_0x1b45ef){return{'name':_0x1b45ef['fieldName'],'type':_0x1b45ef[_0xf851('0x2f')]['key']};});_0xae6012[_0xf851('0x30')]=_[_0xf851('0x2e')](_0x357be0,_0xf851('0x2b'));_0xae6012['query']=_['keys'](_0x5f498e[_0xf851('0x31')]);_0xae6012[_0xf851('0x32')]=_['intersection'](_0xae6012[_0xf851('0x30')],_0xae6012[_0xf851('0x31')]);_0x5bbd63[_0xf851('0x33')]=_['intersection'](_0xae6012[_0xf851('0x30')],qs['fields'](_0x5f498e[_0xf851('0x31')][_0xf851('0x34')]));_0x5bbd63['attributes']=_0x5bbd63[_0xf851('0x33')][_0xf851('0x35')]?_0x5bbd63[_0xf851('0x33')]:_0xae6012[_0xf851('0x30')];if(!_0x5f498e['query'][_0xf851('0x36')](_0xf851('0x37'))){_0x5bbd63['limit']=qs[_0xf851('0x21')](_0x5f498e[_0xf851('0x31')][_0xf851('0x21')]);_0x5bbd63[_0xf851('0x1f')]=qs['offset'](_0x5f498e['query']['offset']);}_0x5bbd63[_0xf851('0x38')]=qs[_0xf851('0x39')](_0x5f498e[_0xf851('0x31')][_0xf851('0x39')]);_0x5bbd63[_0xf851('0x3a')]=qs[_0xf851('0x32')](_[_0xf851('0x3b')](_0x5f498e['query'],_0xae6012[_0xf851('0x32')]),_0x357be0);if(_0x5f498e[_0xf851('0x31')][_0xf851('0x3c')]){_0x5bbd63[_0xf851('0x3a')]=_['merge'](_0x5bbd63['where'],{'$or':_[_0xf851('0x2e')](_0x357be0,function(_0x475de0){if(_0x475de0[_0xf851('0x2f')]!==_0xf851('0x3d')){var _0x352301={};_0x352301[_0x475de0['name']]={'$like':'%'+_0x5f498e[_0xf851('0x31')][_0xf851('0x3c')]+'%'};return _0x352301;}})});}_0x5bbd63=_['merge']({},_0x5bbd63,_0x5f498e[_0xf851('0x3e')]);var _0x5089df={'where':_0x5bbd63[_0xf851('0x3a')]};return db['MailQueue'][_0xf851('0x22')](_0x5089df)['then'](function(_0x287173){_0x4dddaa[_0xf851('0x22')]=_0x287173;if(_0x5f498e[_0xf851('0x31')]['includeAll']){_0x5bbd63[_0xf851('0x3f')]=[{'all':!![]}];}return db[_0xf851('0x40')][_0xf851('0x41')](_0x5bbd63);})[_0xf851('0x26')](function(_0x23da4c){_0x4dddaa[_0xf851('0x42')]=_0x23da4c;return _0x4dddaa;})['then'](respondWithFilteredResult(_0x5a86b1,_0x5bbd63))[_0xf851('0x43')](handleError(_0x5a86b1,null));};exports[_0xf851('0x44')]=function(_0x492cf9,_0x125ce4){var _0x4850e2={'raw':!![],'where':{'id':_0x492cf9[_0xf851('0x45')]['id']}},_0x39b530={};_0x39b530[_0xf851('0x30')]=_[_0xf851('0x46')](db[_0xf851('0x40')]['rawAttributes']);_0x39b530[_0xf851('0x31')]=_[_0xf851('0x46')](_0x492cf9[_0xf851('0x31')]);_0x39b530[_0xf851('0x32')]=_['intersection'](_0x39b530[_0xf851('0x30')],_0x39b530[_0xf851('0x31')]);_0x4850e2[_0xf851('0x33')]=_[_0xf851('0x47')](_0x39b530[_0xf851('0x30')],qs['fields'](_0x492cf9[_0xf851('0x31')][_0xf851('0x34')]));_0x4850e2[_0xf851('0x33')]=_0x4850e2[_0xf851('0x33')][_0xf851('0x35')]?_0x4850e2[_0xf851('0x33')]:_0x39b530[_0xf851('0x30')];if(_0x492cf9[_0xf851('0x31')][_0xf851('0x48')]){_0x4850e2[_0xf851('0x3f')]=[{'all':!![]}];}_0x4850e2=_[_0xf851('0x49')]({},_0x4850e2,_0x492cf9['options']);return db[_0xf851('0x40')]['find'](_0x4850e2)[_0xf851('0x26')](handleEntityNotFound(_0x125ce4,null))[_0xf851('0x26')](respondWithResult(_0x125ce4,null))[_0xf851('0x43')](handleError(_0x125ce4,null));};exports[_0xf851('0x4a')]=function(_0x1ad82e,_0x591a38){return db[_0xf851('0x40')]['create'](_0x1ad82e[_0xf851('0x4b')],{})[_0xf851('0x26')](function(_0x53a9da){var _0x68be30=_0x1ad82e[_0xf851('0x4c')][_0xf851('0x28')]({'plain':!![]});if(!_0x68be30)throw new Error(_0xf851('0x4d'));if(_0x68be30[_0xf851('0x4e')]===_0xf851('0x4c')){var _0x29909e=_0x53a9da['get']({'plain':!![]});var _0x353b00='MailQueues';return db[_0xf851('0x4f')]['find']({'where':{'name':_0x353b00,'userProfileId':_0x68be30[_0xf851('0x50')]},'raw':!![]})[_0xf851('0x26')](function(_0x1dc12){if(_0x1dc12&&_0x1dc12[_0xf851('0x51')]===0x0){return db['UserProfileResource'][_0xf851('0x4a')]({'name':_0x29909e['name'],'resourceId':_0x29909e['id'],'type':_0x1dc12[_0xf851('0x2b')],'sectionId':_0x1dc12['id']},{})[_0xf851('0x26')](function(){return _0x53a9da;});}else{return _0x53a9da;}})[_0xf851('0x43')](function(_0x7e59cc){logger[_0xf851('0x52')](_0xf851('0x53'),_0x7e59cc);throw _0x7e59cc;});}return _0x53a9da;})[_0xf851('0x26')](respondWithResult(_0x591a38,0xc9))['catch'](handleError(_0x591a38,null));};exports['update']=function(_0x588da6,_0x42b807){if(_0x588da6[_0xf851('0x4b')]['id']){delete _0x588da6['body']['id'];}return db['MailQueue'][_0xf851('0x54')]({'where':{'id':_0x588da6[_0xf851('0x45')]['id']}})[_0xf851('0x26')](handleEntityNotFound(_0x42b807,null))['then'](saveUpdates(_0x588da6[_0xf851('0x4b')],null))[_0xf851('0x26')](respondWithResult(_0x42b807,null))['catch'](handleError(_0x42b807,null));};exports[_0xf851('0x27')]=function(_0x537d86,_0x13760b){return db[_0xf851('0x40')][_0xf851('0x54')]({'where':{'id':_0x537d86['params']['id']}})[_0xf851('0x26')](handleEntityNotFound(_0x13760b,null))[_0xf851('0x26')](removeEntity(_0x13760b,null))[_0xf851('0x43')](handleError(_0x13760b,null));};exports[_0xf851('0x55')]=function(_0x23b27a,_0x58f62a){return db['MailQueue'][_0xf851('0x55')]()['then'](respondWithResult(_0x58f62a,null))[_0xf851('0x43')](handleError(_0x58f62a,null));};exports[_0xf851('0x56')]=function(_0x2e6251,_0x2e6a3c,_0x129d50){var _0x7d1b1c={'raw':!![],'where':{}},_0x172c48={},_0x535d53;return db[_0xf851('0x40')][_0xf851('0x57')]({'where':{'id':_0x2e6251[_0xf851('0x45')]['id']}})[_0xf851('0x26')](handleEntityNotFound(_0x2e6a3c,null))[_0xf851('0x26')](function(_0xc2d513){if(_0xc2d513){_0x535d53=_0xc2d513[_0xf851('0x28')]({'plain':!![]});_0x172c48[_0xf851('0x30')]=_[_0xf851('0x46')](db['UserMailQueue'][_0xf851('0x58')]);_0x172c48[_0xf851('0x31')]=_[_0xf851('0x46')](_0x2e6251['query']);_0x172c48[_0xf851('0x32')]=_[_0xf851('0x47')](_0x172c48[_0xf851('0x30')],_0x172c48[_0xf851('0x31')]);_0x7d1b1c[_0xf851('0x33')]=_[_0xf851('0x47')](_0x172c48['model'],qs['fields'](_0x2e6251[_0xf851('0x31')]['fields']));_0x7d1b1c['attributes']=_0x7d1b1c[_0xf851('0x33')]['length']?_0x7d1b1c[_0xf851('0x33')]:_0x172c48[_0xf851('0x30')];if(!_0x2e6251[_0xf851('0x31')][_0xf851('0x36')](_0xf851('0x37'))){_0x7d1b1c[_0xf851('0x21')]=qs['limit'](_0x2e6251[_0xf851('0x31')][_0xf851('0x21')]);_0x7d1b1c[_0xf851('0x1f')]=qs['offset'](_0x2e6251[_0xf851('0x31')][_0xf851('0x1f')]);}_0x7d1b1c['order']=qs['sort'](_0x2e6251[_0xf851('0x31')][_0xf851('0x39')]);_0x7d1b1c[_0xf851('0x3a')]=qs[_0xf851('0x32')](_[_0xf851('0x3b')](_0x2e6251[_0xf851('0x31')],_0x172c48[_0xf851('0x32')]));_0x7d1b1c['where'][_0xf851('0x59')]=_0xc2d513['id'];if(_0x2e6251[_0xf851('0x31')][_0xf851('0x3c')]){_0x7d1b1c[_0xf851('0x3a')]=_[_0xf851('0x49')](_0x7d1b1c[_0xf851('0x3a')],{'$or':_[_0xf851('0x2e')](_0x7d1b1c['attributes'],function(_0x38f4f0){var _0x574a5d={};_0x574a5d[_0x38f4f0]={'$like':'%'+_0x2e6251[_0xf851('0x31')][_0xf851('0x3c')]+'%'};return _0x574a5d;})});}_0x7d1b1c=_[_0xf851('0x49')]({},_0x7d1b1c,_0x2e6251[_0xf851('0x3e')]);return db['UserMailQueue'][_0xf851('0x41')](_0x7d1b1c);}})[_0xf851('0x26')](function(_0x36e0e7){if(_0x36e0e7){return db[_0xf851('0x5a')]['findAndCountAll']({'where':{'id':_['map'](_0x36e0e7,_0xf851('0x5b')),'role':'agent'},'attributes':['id',_0xf851('0x2b'),_0xf851('0x5c'),_0xf851('0x5d'),_0xf851('0x5e')]});}})[_0xf851('0x26')](function(_0x848ce5){if(_0x848ce5){return{'count':_0x848ce5['count'],'rows':_[_0xf851('0x2e')](_0x848ce5[_0xf851('0x42')],function(_0x262a66){return{'membername':_0x262a66[_0xf851('0x2b')],'UserId':_0x262a66['id'],'queue_name':_0x535d53[_0xf851('0x2b')],'MailQueueId':_0x535d53['id'],'interface':util[_0xf851('0x5f')](_0xf851('0x60'),'SIP',_0x262a66[_0xf851('0x2b')]),'penalty':0x0,'paused':_0x262a66[_0xf851('0x5c')],'createdAt':_0x262a66[_0xf851('0x5e')],'updatedAt':_0x262a66[_0xf851('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf851('0x26')](respondWithFilteredResult(_0x2e6a3c,_0x7d1b1c))[_0xf851('0x43')](handleError(_0x2e6a3c,null));};exports[_0xf851('0x61')]=function(_0x32de26,_0x5a886e,_0x119512){var _0x52ce5e={};var _0x100726={};var _0x32425b;var _0xe9a3f0;return db[_0xf851('0x40')][_0xf851('0x57')]({'where':{'id':_0x32de26[_0xf851('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a886e,null))[_0xf851('0x26')](function(_0x28fa25){if(_0x28fa25){_0x32425b=_0x28fa25;_0x100726[_0xf851('0x30')]=_[_0xf851('0x46')](db[_0xf851('0x62')][_0xf851('0x58')]);_0x100726[_0xf851('0x31')]=_[_0xf851('0x46')](_0x32de26[_0xf851('0x31')]);_0x100726[_0xf851('0x32')]=_[_0xf851('0x47')](_0x100726['model'],_0x100726['query']);_0x52ce5e[_0xf851('0x33')]=_[_0xf851('0x47')](_0x100726['model'],qs[_0xf851('0x34')](_0x32de26[_0xf851('0x31')]['fields']));_0x52ce5e['attributes']=_0x52ce5e['attributes']['length']?_0x52ce5e[_0xf851('0x33')]:_0x100726[_0xf851('0x30')];_0x52ce5e[_0xf851('0x38')]=qs[_0xf851('0x39')](_0x32de26[_0xf851('0x31')]['sort']);_0x52ce5e[_0xf851('0x3a')]=qs[_0xf851('0x32')](_[_0xf851('0x3b')](_0x32de26[_0xf851('0x31')],_0x100726[_0xf851('0x32')]));if(_0x32de26[_0xf851('0x31')]['filter']){_0x52ce5e['where']=_[_0xf851('0x49')](_0x52ce5e['where'],{'$or':_['map'](_0x52ce5e[_0xf851('0x33')],function(_0x1783fc){var _0x142ceb={};_0x142ceb[_0x1783fc]={'$like':'%'+_0x32de26[_0xf851('0x31')][_0xf851('0x3c')]+'%'};return _0x142ceb;})});}_0x52ce5e=_[_0xf851('0x49')]({},_0x52ce5e,_0x32de26[_0xf851('0x3e')]);return _0x32425b[_0xf851('0x61')](_0x52ce5e);}})[_0xf851('0x26')](function(_0x301e68){if(_0x301e68){_0xe9a3f0=_0x301e68[_0xf851('0x35')];if(!_0x32de26['query']['hasOwnProperty'](_0xf851('0x37'))){_0x52ce5e['limit']=qs[_0xf851('0x21')](_0x32de26[_0xf851('0x31')][_0xf851('0x21')]);_0x52ce5e['offset']=qs['offset'](_0x32de26[_0xf851('0x31')]['offset']);}return _0x32425b['getTeams'](_0x52ce5e);}})[_0xf851('0x26')](function(_0x535262){if(_0x535262){return _0x535262?{'count':_0xe9a3f0,'rows':_0x535262}:null;}})[_0xf851('0x26')](respondWithResult(_0x5a886e,null))[_0xf851('0x43')](handleError(_0x5a886e,null));};exports[_0xf851('0x63')]=function(_0x10ea6d,_0x25b7c1,_0x2f8800){var _0x2bc851=_0x10ea6d['body'][_0xf851('0x64')];return db[_0xf851('0x62')][_0xf851('0x41')]({'where':{'id':_0x2bc851},'attributes':['id'],'include':[{'model':db[_0xf851('0x5a')],'as':_0xf851('0x65'),'attributes':['id',_0xf851('0x2b'),_0xf851('0x66'),_0xf851('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x5cd78a){if(_0x5cd78a){var _0x9b696f=_[_0xf851('0x68')](_0x5cd78a,function(_0x4e89fe){var _0x3d69fc=_0x4e89fe['get']({'plain':!![]});return _0x3d69fc[_0xf851('0x65')];});return db['MailQueue'][_0xf851('0x54')]({'where':{'id':_0x10ea6d[_0xf851('0x45')]['id']}})[_0xf851('0x26')](function(_0x3d9e7c){return db[_0xf851('0x69')][_0xf851('0x6a')](function(_0x4b66fe){return _0x3d9e7c[_0xf851('0x63')](_0x2bc851,{'transaction':_0x4b66fe})[_0xf851('0x26')](function(){return BPromise[_0xf851('0x6b')](_0x9b696f,function(_0x47017c){return db[_0xf851('0x6c')][_0xf851('0x6d')]({'where':{'UserId':_0x47017c['id'],'MailQueueId':_0x10ea6d[_0xf851('0x45')]['id']},'transaction':_0x4b66fe});});})[_0xf851('0x26')](function(){_0x9b696f[_0xf851('0x6e')](function(_0x5c02e0){socket['emit'](_0xf851('0x6f'),{'UserId':_0x5c02e0['id'],'MailQueueId':_0x3d9e7c['id']});});});});});}})['then'](respondWithStatusCode(_0x25b7c1,null))[_0xf851('0x43')](handleError(_0x25b7c1,null));};exports[_0xf851('0x70')]=function(_0x138a9b,_0x5563f6,_0x1b54ee){return db['Team'][_0xf851('0x41')]({'where':{'id':_0x138a9b[_0xf851('0x31')][_0xf851('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf851('0x65'),'attributes':['id'],'raw':!![]}]})[_0xf851('0x26')](handleEntityNotFound(_0x5563f6,null))['then'](function(_0x3f8157){var _0x6fed8b=_[_0xf851('0x2e')](_0x3f8157,'id');var _0x4bf006=[];var _0x351ba7=[];var _0x108940=squel[_0xf851('0x71')]();_0x108940[_0xf851('0x72')](_0xf851('0x73'))[_0xf851('0x74')]('team_has_mail_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf851('0x3a')]('MailQueueId\x20=\x20?',_0x138a9b[_0xf851('0x45')]['id']);for(var _0xcd8cd6=0x0;_0xcd8cd6<_0x3f8157[_0xf851('0x35')];_0xcd8cd6+=0x1){let _0x4f5d3e=_0x3f8157[_0xcd8cd6];for(var _0x2ae14c=0x0;_0x2ae14c<_0x4f5d3e[_0xf851('0x65')][_0xf851('0x35')];_0x2ae14c+=0x1){let _0x237326=_0x4f5d3e[_0xf851('0x65')][_0x2ae14c];var _0x5adbc8=_0x108940['clone']();_0x5adbc8[_0xf851('0x3a')](_0xf851('0x75'),_0x237326['id']);_0x351ba7[_0xf851('0x76')](db[_0xf851('0x69')][_0xf851('0x31')](_0x5adbc8[_0xf851('0x77')](),{'type':db[_0xf851('0x69')][_0xf851('0x78')]['SELECT']})['then'](function(_0x538ab8){if(_0x538ab8[_0xf851('0x35')]===0x1){return _0x237326['id'];}else{var _0x3e456b=_[_0xf851('0x79')](_[_0xf851('0x2e')](_0x538ab8,_0xf851('0x7a')),function(_0x30236b){return _[_0xf851('0x7b')](_0x6fed8b,_0x30236b);});if(_0x3e456b){return _0x237326['id'];}}}));}}return BPromise[_0xf851('0x7c')](_0x351ba7)[_0xf851('0x26')](function(_0x6ae4){_0x4bf006=_(_0x4bf006)[_0xf851('0x7d')](_0x6ae4)[_0xf851('0x7e')]()[_0xf851('0x7f')]();return db[_0xf851('0x40')][_0xf851('0x54')]({'where':{'id':_0x138a9b[_0xf851('0x45')]['id']}})[_0xf851('0x26')](function(_0x5d606b){return db[_0xf851('0x69')]['transaction'](function(_0x1602a9){return _0x5d606b[_0xf851('0x70')](_0x138a9b['query']['ids'],{'transaction':_0x1602a9})[_0xf851('0x26')](function(){if(!_[_0xf851('0x80')](_0x4bf006)){return _0x5d606b[_0xf851('0x81')](_0x4bf006,{'transaction':_0x1602a9});}})[_0xf851('0x26')](function(){_0x4bf006[_0xf851('0x6e')](function(_0x4939e6){socket[_0xf851('0x82')](_0xf851('0x83'),{'UserId':_0x4939e6,'MailQueueId':_0x5d606b['id']});});});});});});})['then'](respondWithStatusCode(_0x5563f6,null))['catch'](handleError(_0x5563f6,null));};exports[_0xf851('0x84')]=function(_0x409c2e,_0x78164e,_0x456788){return db[_0xf851('0x40')]['find']({'where':{'id':_0x409c2e[_0xf851('0x45')]['id']}})[_0xf851('0x26')](handleEntityNotFound(_0x78164e,null))[_0xf851('0x26')](function(_0x50fe17){if(_0x50fe17){return _0x50fe17[_0xf851('0x84')](_0x409c2e[_0xf851('0x4b')][_0xf851('0x64')],_[_0xf851('0x85')](_0x409c2e['body'],[_0xf851('0x64'),'id'])||{})[_0xf851('0x86')](function(_0x58cf0e){for(var _0x2f8671=0x0;_0x2f8671<_0x409c2e[_0xf851('0x4b')][_0xf851('0x64')][_0xf851('0x35')];_0x2f8671+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x409c2e[_0xf851('0x4b')][_0xf851('0x64')][_0x2f8671]),'MailQueueId':Number(_0x409c2e[_0xf851('0x45')]['id'])});}return _0x58cf0e;});}})['then'](respondWithResult(_0x78164e,null))[_0xf851('0x43')](handleError(_0x78164e,null));};exports[_0xf851('0x81')]=function(_0x12affe,_0x2c6d43,_0x244de9){return db['MailQueue'][_0xf851('0x54')]({'where':{'id':_0x12affe['params']['id']}})[_0xf851('0x26')](handleEntityNotFound(_0x2c6d43,null))[_0xf851('0x26')](function(_0x33dd2b){if(_0x33dd2b){return _0x33dd2b['removeAgents'](_0x12affe[_0xf851('0x31')][_0xf851('0x64')])[_0xf851('0x26')](function(){if(_[_0xf851('0x87')](_0x12affe['query']['ids'])){for(var _0x6c0e89=0x0;_0x6c0e89<_0x12affe['query'][_0xf851('0x64')][_0xf851('0x35')];_0x6c0e89+=0x1){socket['emit'](_0xf851('0x83'),{'UserId':Number(_0x12affe[_0xf851('0x31')][_0xf851('0x64')][_0x6c0e89]),'MailQueueId':Number(_0x12affe[_0xf851('0x45')]['id'])});}}else{socket[_0xf851('0x82')](_0xf851('0x83'),{'UserId':Number(_0x12affe[_0xf851('0x31')][_0xf851('0x64')]),'MailQueueId':Number(_0x12affe[_0xf851('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x2c6d43,null))[_0xf851('0x43')](handleError(_0x2c6d43,null));};exports[_0xf851('0x88')]=function(_0x2ca11c,_0x20ceb7,_0xd2e90a){var _0x54e3e0={};var _0x1dcef4={};var _0x408777;var _0x1fef98;return db[_0xf851('0x40')]['findOne']({'where':{'id':_0x2ca11c[_0xf851('0x45')]['id']}})[_0xf851('0x26')](handleEntityNotFound(_0x20ceb7,null))[_0xf851('0x26')](function(_0x412c9d){if(_0x412c9d){_0x408777=_0x412c9d;_0x1dcef4[_0xf851('0x30')]=_[_0xf851('0x46')](db[_0xf851('0x5a')][_0xf851('0x58')]);_0x1dcef4[_0xf851('0x31')]=_['keys'](_0x2ca11c[_0xf851('0x31')]);_0x1dcef4['filters']=_[_0xf851('0x47')](_0x1dcef4[_0xf851('0x30')],_0x1dcef4[_0xf851('0x31')]);_0x54e3e0[_0xf851('0x33')]=_[_0xf851('0x47')](_0x1dcef4[_0xf851('0x30')],qs['fields'](_0x2ca11c[_0xf851('0x31')][_0xf851('0x34')]));_0x54e3e0['attributes']=_0x54e3e0[_0xf851('0x33')][_0xf851('0x35')]?_0x54e3e0[_0xf851('0x33')]:_0x1dcef4[_0xf851('0x30')];_0x54e3e0['order']=qs[_0xf851('0x39')](_0x2ca11c[_0xf851('0x31')][_0xf851('0x39')]);_0x54e3e0[_0xf851('0x3a')]=qs[_0xf851('0x32')](_[_0xf851('0x3b')](_0x2ca11c['query'],_0x1dcef4['filters']));if(_0x2ca11c[_0xf851('0x31')][_0xf851('0x3c')]){_0x54e3e0[_0xf851('0x3a')]=_[_0xf851('0x49')](_0x54e3e0[_0xf851('0x3a')],{'$or':_[_0xf851('0x2e')](_0x54e3e0[_0xf851('0x33')],function(_0xe0df8f){var _0xf8b5d={};_0xf8b5d[_0xe0df8f]={'$like':'%'+_0x2ca11c['query']['filter']+'%'};return _0xf8b5d;})});}_0x54e3e0=_[_0xf851('0x49')]({},_0x54e3e0,_0x2ca11c['options']);return _0x408777[_0xf851('0x88')](_0x54e3e0);}})[_0xf851('0x26')](function(_0x3adcae){if(_0x3adcae){_0x1fef98=_0x3adcae[_0xf851('0x35')];if(!_0x2ca11c[_0xf851('0x31')][_0xf851('0x36')](_0xf851('0x37'))){_0x54e3e0[_0xf851('0x21')]=qs['limit'](_0x2ca11c[_0xf851('0x31')][_0xf851('0x21')]);_0x54e3e0['offset']=qs[_0xf851('0x1f')](_0x2ca11c[_0xf851('0x31')][_0xf851('0x1f')]);}return _0x408777[_0xf851('0x88')](_0x54e3e0);}})[_0xf851('0x26')](function(_0x4dbc55){if(_0x4dbc55){return _0x4dbc55?{'count':_0x1fef98,'rows':_0x4dbc55}:null;}})[_0xf851('0x26')](respondWithResult(_0x20ceb7,null))[_0xf851('0x43')](handleError(_0x20ceb7,null));};
\ No newline at end of file
index 42ebf46..05b71e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61e0=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','exports'];(function(_0x14f9ad,_0x3521df){var _0x49ebb5=function(_0x1e0308){while(--_0x1e0308){_0x14f9ad['push'](_0x14f9ad['shift']());}};_0x49ebb5(++_0x3521df);}(_0x61e0,0x1b8));var _0x061e=function(_0x158957,_0x5991ae){_0x158957=_0x158957-0x0;var _0x4e5ffe=_0x61e0[_0x158957];return _0x4e5ffe;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x061e('0x0'))['db'][_0x061e('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x061e('0x2')](0x0);var events={'afterCreate':_0x061e('0x3'),'afterUpdate':_0x061e('0x4'),'afterDestroy':_0x061e('0x5')};function emitEvent(_0xa13453){return function(_0x210f6c,_0x13bac3,_0x3f4df9){MailQueueEvents[_0x061e('0x6')](_0xa13453+':'+_0x210f6c['id'],_0x210f6c);MailQueueEvents['emit'](_0xa13453,_0x210f6c);_0x3f4df9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x061e('0x7')]=MailQueueEvents;
\ No newline at end of file
+var _0x1aab=['update','remove','emit','exports','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x1705ae,_0x1b8f8c){var _0x5f3ce0=function(_0x1d88d6){while(--_0x1d88d6){_0x1705ae['push'](_0x1705ae['shift']());}};_0x5f3ce0(++_0x1b8f8c);}(_0x1aab,0x187));var _0xb1aa=function(_0x22119e,_0x16f6fc){_0x22119e=_0x22119e-0x0;var _0x1f7c75=_0x1aab[_0x22119e];return _0x1f7c75;};'use strict';var EventEmitter=require(_0xb1aa('0x0'));var MailQueue=require(_0xb1aa('0x1'))['db'][_0xb1aa('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xb1aa('0x3')](0x0);var events={'afterCreate':_0xb1aa('0x4'),'afterUpdate':_0xb1aa('0x5'),'afterDestroy':_0xb1aa('0x6')};function emitEvent(_0x37844e){return function(_0x2a5c4d,_0x3630cd,_0x433de3){MailQueueEvents[_0xb1aa('0x7')](_0x37844e+':'+_0x2a5c4d['id'],_0x2a5c4d);MailQueueEvents['emit'](_0x37844e,_0x2a5c4d);_0x433de3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xb1aa('0x8')]=MailQueueEvents;
\ No newline at end of file
index c6bc82d..bed0961 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d81=['moment','bluebird','request-promise','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger','api'];(function(_0x5b4a94,_0x39e9ae){var _0x97d164=function(_0x490f24){while(--_0x490f24){_0x5b4a94['push'](_0x5b4a94['shift']());}};_0x97d164(++_0x39e9ae);}(_0x5d81,0x170));var _0x15d8=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x5d81[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x15d8('0x0'));var util=require(_0x15d8('0x1'));var logger=require(_0x15d8('0x2'))(_0x15d8('0x3'));var moment=require(_0x15d8('0x4'));var BPromise=require(_0x15d8('0x5'));var rp=require(_0x15d8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15d8('0x7'));var attributes=require(_0x15d8('0x8'));module['exports']=function(_0x1e9f1a,_0x4b8640){return _0x1e9f1a[_0x15d8('0x9')](_0x15d8('0xa'),attributes,{'tableName':_0x15d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f25=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./mailQueue.attributes'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x4f25,0x19e));var _0x54f2=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x4f25[_0xccf869];return _0x21a9db;};'use strict';var _=require(_0x54f2('0x0'));var util=require(_0x54f2('0x1'));var logger=require(_0x54f2('0x2'))(_0x54f2('0x3'));var moment=require(_0x54f2('0x4'));var BPromise=require(_0x54f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x54f2('0x6'));var rimraf=require(_0x54f2('0x7'));var config=require('../../config/environment');var attributes=require(_0x54f2('0x8'));module['exports']=function(_0x1d1f2b,_0xa78ccd){return _0x1d1f2b['define']('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 68eb377..3a452ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd246=['localhost','socket.io-emitter','redis','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','error','message','result','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','map','model','stringify','find','ShowMailQueue','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','defaults'];(function(_0xd4f3c8,_0x3f6169){var _0xe629aa=function(_0x24f792){while(--_0x24f792){_0xd4f3c8['push'](_0xd4f3c8['shift']());}};_0xe629aa(++_0x3f6169);}(_0xd246,0x11e));var _0x6d24=function(_0x2b81db,_0xe9c3cb){_0x2b81db=_0x2b81db-0x0;var _0x1e0f1d=_0xd246[_0x2b81db];return _0x1e0f1d;};'use strict';var _=require(_0x6d24('0x0'));var util=require('util');var moment=require(_0x6d24('0x1'));var BPromise=require(_0x6d24('0x2'));var rs=require(_0x6d24('0x3'));var fs=require('fs');var Redis=require(_0x6d24('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d24('0x5'));var logger=require(_0x6d24('0x6'))(_0x6d24('0x7'));var config=require(_0x6d24('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x6d24('0x9')](config['redis'],{'host':_0x6d24('0xa'),'port':0x18eb});var socket=require(_0x6d24('0xb'))(new Redis(config[_0x6d24('0xc')]));require(_0x6d24('0xd'))[_0x6d24('0xe')](socket);function respondWithRpcPromise(_0x3307e8,_0x1b9462,_0x2da101){return new BPromise(function(_0x36780a,_0x5d0097){return client[_0x6d24('0xf')](_0x3307e8,_0x2da101)[_0x6d24('0x10')](function(_0x5eac92){logger[_0x6d24('0x11')](_0x6d24('0x12'),_0x1b9462,'request\x20sent');logger[_0x6d24('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x1b9462,'request\x20sent',JSON['stringify'](_0x5eac92));if(_0x5eac92[_0x6d24('0x14')]){if(_0x5eac92[_0x6d24('0x14')]['code']===0x1f4){logger[_0x6d24('0x14')](_0x6d24('0x12'),_0x1b9462,_0x5eac92['error'][_0x6d24('0x15')]);return _0x5d0097(_0x5eac92['error'][_0x6d24('0x15')]);}logger['error'](_0x6d24('0x12'),_0x1b9462,_0x5eac92[_0x6d24('0x14')][_0x6d24('0x15')]);return _0x36780a(_0x5eac92[_0x6d24('0x14')][_0x6d24('0x15')]);}else{logger[_0x6d24('0x11')]('MailQueue,\x20%s,\x20%s',_0x1b9462,'request\x20sent');_0x36780a(_0x5eac92[_0x6d24('0x16')]['message']);}})['catch'](function(_0x244483){logger[_0x6d24('0x14')](_0x6d24('0x12'),_0x1b9462,_0x244483);_0x5d0097(_0x244483);});});}exports[_0x6d24('0x17')]=function(_0x2e29c0){var _0x121a05=this;return new Promise(function(_0x38f3da,_0x16434c){return db[_0x6d24('0x18')][_0x6d24('0x19')]({'raw':_0x2e29c0['options']?_0x2e29c0[_0x6d24('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2e29c0[_0x6d24('0x1a')]?_0x2e29c0[_0x6d24('0x1a')][_0x6d24('0x1b')]||null:null,'attributes':_0x2e29c0[_0x6d24('0x1a')]?_0x2e29c0[_0x6d24('0x1a')][_0x6d24('0x1c')]||null:null,'limit':_0x2e29c0[_0x6d24('0x1a')]?_0x2e29c0['options'][_0x6d24('0x1d')]||null:null,'include':_0x2e29c0[_0x6d24('0x1a')]?_0x2e29c0[_0x6d24('0x1a')][_0x6d24('0x1e')]?_[_0x6d24('0x1f')](_0x2e29c0[_0x6d24('0x1a')]['include'],function(_0x56dc64){return{'model':db[_0x56dc64[_0x6d24('0x20')]],'as':_0x56dc64['as'],'attributes':_0x56dc64[_0x6d24('0x1c')],'include':_0x56dc64[_0x6d24('0x1e')]?_['map'](_0x56dc64[_0x6d24('0x1e')],function(_0x3fcab7){return{'model':db[_0x3fcab7['model']],'as':_0x3fcab7['as'],'attributes':_0x3fcab7[_0x6d24('0x1c')],'include':_0x3fcab7['include']?_[_0x6d24('0x1f')](_0x3fcab7[_0x6d24('0x1e')],function(_0x42629){return{'model':db[_0x42629['model']],'as':_0x42629['as'],'attributes':_0x42629[_0x6d24('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6d24('0x10')](function(_0x3fd313){logger['info'](_0x6d24('0x17'),_0x2e29c0);logger[_0x6d24('0x13')]('GetMailQueue',_0x2e29c0,JSON[_0x6d24('0x21')](_0x3fd313));_0x38f3da(_0x3fd313);})['catch'](function(_0x393284){logger['error'](_0x6d24('0x17'),_0x393284[_0x6d24('0x15')],_0x2e29c0);_0x16434c(_0x121a05[_0x6d24('0x14')](0x1f4,_0x393284[_0x6d24('0x15')]));});});};exports['ShowMailQueue']=function(_0x4b4405){var _0x28a8b=this;return new Promise(function(_0x3fad39,_0x1baeb4){return db[_0x6d24('0x18')][_0x6d24('0x22')]({'raw':_0x4b4405[_0x6d24('0x1a')]?_0x4b4405[_0x6d24('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4b4405[_0x6d24('0x1a')]?_0x4b4405['options']['where']||null:null,'attributes':_0x4b4405[_0x6d24('0x1a')]?_0x4b4405['options'][_0x6d24('0x1c')]||null:null,'include':_0x4b4405[_0x6d24('0x1a')]?_0x4b4405['options'][_0x6d24('0x1e')]?_[_0x6d24('0x1f')](_0x4b4405[_0x6d24('0x1a')][_0x6d24('0x1e')],function(_0x3902ae){return{'model':db[_0x3902ae[_0x6d24('0x20')]],'as':_0x3902ae['as'],'attributes':_0x3902ae[_0x6d24('0x1c')],'include':_0x3902ae['include']?_[_0x6d24('0x1f')](_0x3902ae[_0x6d24('0x1e')],function(_0x2402f3){return{'model':db[_0x2402f3[_0x6d24('0x20')]],'as':_0x2402f3['as'],'attributes':_0x2402f3['attributes'],'include':_0x2402f3['include']?_[_0x6d24('0x1f')](_0x2402f3['include'],function(_0x2a59c8){return{'model':db[_0x2a59c8[_0x6d24('0x20')]],'as':_0x2a59c8['as'],'attributes':_0x2a59c8[_0x6d24('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x114b94){logger['info'](_0x6d24('0x23'),_0x4b4405);logger['debug'](_0x6d24('0x23'),_0x4b4405,JSON[_0x6d24('0x21')](_0x114b94));_0x3fad39(_0x114b94);})[_0x6d24('0x24')](function(_0x569cca){logger[_0x6d24('0x14')](_0x6d24('0x23'),_0x569cca[_0x6d24('0x15')],_0x4b4405);_0x1baeb4(_0x28a8b[_0x6d24('0x14')](0x1f4,_0x569cca['message']));});});};
\ No newline at end of file
+var _0x83d5=['GetMailQueue','ShowMailQueue','MailQueue','find','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./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','findAll','options','raw','where','attributes','include','map'];(function(_0x3c0127,_0x2c0d2a){var _0x5c32ec=function(_0x42e29c){while(--_0x42e29c){_0x3c0127['push'](_0x3c0127['shift']());}};_0x5c32ec(++_0x2c0d2a);}(_0x83d5,0xb1));var _0x583d=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0x83d5[_0x2cc8bb];return _0x140e40;};'use strict';var _=require(_0x583d('0x0'));var util=require(_0x583d('0x1'));var moment=require(_0x583d('0x2'));var BPromise=require(_0x583d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x583d('0x4'));var db=require(_0x583d('0x5'))['db'];var utils=require(_0x583d('0x6'));var logger=require(_0x583d('0x7'))('rpc');var config=require(_0x583d('0x8'));var jayson=require(_0x583d('0x9'));var client=jayson[_0x583d('0xa')][_0x583d('0xb')]({'port':0x232a});config[_0x583d('0xc')]=_[_0x583d('0xd')](config['redis'],{'host':_0x583d('0xe'),'port':0x18eb});var socket=require(_0x583d('0xf'))(new Redis(config['redis']));require(_0x583d('0x10'))[_0x583d('0x11')](socket);function respondWithRpcPromise(_0x46c63a,_0x45d6af,_0xf92ed2){return new BPromise(function(_0x274071,_0x51c4d6){return client[_0x583d('0x12')](_0x46c63a,_0xf92ed2)[_0x583d('0x13')](function(_0x4b3da0){logger[_0x583d('0x14')](_0x583d('0x15'),_0x45d6af,_0x583d('0x16'));logger[_0x583d('0x17')](_0x583d('0x18'),_0x45d6af,'request\x20sent',JSON[_0x583d('0x19')](_0x4b3da0));if(_0x4b3da0[_0x583d('0x1a')]){if(_0x4b3da0['error'][_0x583d('0x1b')]===0x1f4){logger[_0x583d('0x1a')](_0x583d('0x15'),_0x45d6af,_0x4b3da0[_0x583d('0x1a')][_0x583d('0x1c')]);return _0x51c4d6(_0x4b3da0[_0x583d('0x1a')][_0x583d('0x1c')]);}logger[_0x583d('0x1a')](_0x583d('0x15'),_0x45d6af,_0x4b3da0[_0x583d('0x1a')][_0x583d('0x1c')]);return _0x274071(_0x4b3da0[_0x583d('0x1a')]['message']);}else{logger[_0x583d('0x14')](_0x583d('0x15'),_0x45d6af,'request\x20sent');_0x274071(_0x4b3da0[_0x583d('0x1d')][_0x583d('0x1c')]);}})[_0x583d('0x1e')](function(_0x4eda63){logger[_0x583d('0x1a')]('MailQueue,\x20%s,\x20%s',_0x45d6af,_0x4eda63);_0x51c4d6(_0x4eda63);});});}exports['GetMailQueue']=function(_0x5b6e29){var _0x576634=this;return new Promise(function(_0x2939d2,_0x4d49fb){return db['MailQueue'][_0x583d('0x1f')]({'raw':_0x5b6e29[_0x583d('0x20')]?_0x5b6e29[_0x583d('0x20')][_0x583d('0x21')]===undefined?!![]:![]:!![],'where':_0x5b6e29[_0x583d('0x20')]?_0x5b6e29[_0x583d('0x20')][_0x583d('0x22')]||null:null,'attributes':_0x5b6e29['options']?_0x5b6e29[_0x583d('0x20')][_0x583d('0x23')]||null:null,'limit':_0x5b6e29['options']?_0x5b6e29[_0x583d('0x20')]['limit']||null:null,'include':_0x5b6e29[_0x583d('0x20')]?_0x5b6e29[_0x583d('0x20')][_0x583d('0x24')]?_[_0x583d('0x25')](_0x5b6e29['options'][_0x583d('0x24')],function(_0x17ec6f){return{'model':db[_0x17ec6f['model']],'as':_0x17ec6f['as'],'attributes':_0x17ec6f['attributes'],'include':_0x17ec6f[_0x583d('0x24')]?_[_0x583d('0x25')](_0x17ec6f[_0x583d('0x24')],function(_0x49c880){return{'model':db[_0x49c880['model']],'as':_0x49c880['as'],'attributes':_0x49c880[_0x583d('0x23')],'include':_0x49c880['include']?_[_0x583d('0x25')](_0x49c880['include'],function(_0x3e9eb8){return{'model':db[_0x3e9eb8['model']],'as':_0x3e9eb8['as'],'attributes':_0x3e9eb8[_0x583d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x583d('0x13')](function(_0x5667e5){logger[_0x583d('0x14')](_0x583d('0x26'),_0x5b6e29);logger[_0x583d('0x17')]('GetMailQueue',_0x5b6e29,JSON[_0x583d('0x19')](_0x5667e5));_0x2939d2(_0x5667e5);})[_0x583d('0x1e')](function(_0x34e411){logger[_0x583d('0x1a')](_0x583d('0x26'),_0x34e411[_0x583d('0x1c')],_0x5b6e29);_0x4d49fb(_0x576634['error'](0x1f4,_0x34e411[_0x583d('0x1c')]));});});};exports[_0x583d('0x27')]=function(_0x4cb7ce){var _0x11faf1=this;return new Promise(function(_0x2568f3,_0x5e3ee5){return db[_0x583d('0x28')][_0x583d('0x29')]({'raw':_0x4cb7ce[_0x583d('0x20')]?_0x4cb7ce[_0x583d('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4cb7ce[_0x583d('0x20')]?_0x4cb7ce[_0x583d('0x20')][_0x583d('0x22')]||null:null,'attributes':_0x4cb7ce[_0x583d('0x20')]?_0x4cb7ce[_0x583d('0x20')][_0x583d('0x23')]||null:null,'include':_0x4cb7ce[_0x583d('0x20')]?_0x4cb7ce[_0x583d('0x20')][_0x583d('0x24')]?_[_0x583d('0x25')](_0x4cb7ce[_0x583d('0x20')][_0x583d('0x24')],function(_0x5e052f){return{'model':db[_0x5e052f[_0x583d('0x2a')]],'as':_0x5e052f['as'],'attributes':_0x5e052f[_0x583d('0x23')],'include':_0x5e052f[_0x583d('0x24')]?_[_0x583d('0x25')](_0x5e052f['include'],function(_0x571f2d){return{'model':db[_0x571f2d['model']],'as':_0x571f2d['as'],'attributes':_0x571f2d['attributes'],'include':_0x571f2d[_0x583d('0x24')]?_['map'](_0x571f2d[_0x583d('0x24')],function(_0x324fe2){return{'model':db[_0x324fe2[_0x583d('0x2a')]],'as':_0x324fe2['as'],'attributes':_0x324fe2['attributes']};}):[]};}):[]};}):[]:[]})[_0x583d('0x13')](function(_0x3c4f63){logger['info'](_0x583d('0x27'),_0x4cb7ce);logger[_0x583d('0x17')](_0x583d('0x27'),_0x4cb7ce,JSON[_0x583d('0x19')](_0x3c4f63));_0x2568f3(_0x3c4f63);})[_0x583d('0x1e')](function(_0x275545){logger[_0x583d('0x1a')]('ShowMailQueue',_0x275545[_0x583d('0x1c')],_0x4cb7ce);_0x5e3ee5(_0x11faf1[_0x583d('0x1a')](0x1f4,_0x275545['message']));});});};
\ No newline at end of file
index 168a27a..1019bfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe34f=['removeListener','length','emit'];(function(_0x2d64b3,_0x54c434){var _0x22368e=function(_0x133166){while(--_0x133166){_0x2d64b3['push'](_0x2d64b3['shift']());}};_0x22368e(++_0x54c434);}(_0xe34f,0xbc));var _0xfe34=function(_0xb0b21b,_0x228799){_0xb0b21b=_0xb0b21b-0x0;var _0x35f9a0=_0xe34f[_0xb0b21b];return _0x35f9a0;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save','remove','update'];function createListener(_0x3e42b5,_0x43eb44){return function(_0x3378ed){_0x43eb44[_0xfe34('0x0')](_0x3e42b5,_0x3378ed);};}function removeListener(_0x344149,_0x123f0e){return function(){MailQueueEvents[_0xfe34('0x1')](_0x344149,_0x123f0e);};}exports['register']=function(_0x1a3c2b){for(var _0x24e8cb=0x0,_0x195bcd=events[_0xfe34('0x2')];_0x24e8cb<_0x195bcd;_0x24e8cb++){var _0x25f17a=events[_0x24e8cb];var _0x4fa1cd=createListener('mailQueue:'+_0x25f17a,_0x1a3c2b);MailQueueEvents['on'](_0x25f17a,_0x4fa1cd);}};
\ No newline at end of file
+var _0x53e6=['remove','update','removeListener','register','./mailQueue.events','save'];(function(_0x1d628c,_0x37f75a){var _0x215a4d=function(_0x19d81e){while(--_0x19d81e){_0x1d628c['push'](_0x1d628c['shift']());}};_0x215a4d(++_0x37f75a);}(_0x53e6,0x178));var _0x653e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x53e6[_0x3ab51d];return _0x29a04e;};'use strict';var MailQueueEvents=require(_0x653e('0x0'));var events=[_0x653e('0x1'),_0x653e('0x2'),_0x653e('0x3')];function createListener(_0x3981f4,_0x5a562a){return function(_0x3e7e15){_0x5a562a['emit'](_0x3981f4,_0x3e7e15);};}function removeListener(_0x58e08b,_0x4d50fd){return function(){MailQueueEvents[_0x653e('0x4')](_0x58e08b,_0x4d50fd);};}exports[_0x653e('0x5')]=function(_0x12022c){for(var _0xe94957=0x0,_0x7df625=events['length'];_0xe94957<_0x7df625;_0xe94957++){var _0x8c8dc5=events[_0xe94957];var _0xedcdcc=createListener('mailQueue:'+_0x8c8dc5,_0x12022c);MailQueueEvents['on'](_0x8c8dc5,_0xedcdcc);}};
\ No newline at end of file
index 648cab8..59181a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeacf=['multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','/:id','isAuthenticated','show','post','update','delete','exports'];(function(_0x191cee,_0x50fd3a){var _0x24ef98=function(_0x415fd4){while(--_0x415fd4){_0x191cee['push'](_0x191cee['shift']());}};_0x24ef98(++_0x50fd3a);}(_0xeacf,0x1c2));var _0xfeac=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xeacf[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0xfeac('0x0'));var util=require(_0xfeac('0x1'));var path=require(_0xfeac('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfeac('0x3')]();var fs_extra=require(_0xfeac('0x4'));var auth=require(_0xfeac('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfeac('0x6'));var controller=require(_0xfeac('0x7'));router[_0xfeac('0x8')]('/',auth['isAuthenticated'](),controller[_0xfeac('0x9')]);router[_0xfeac('0x8')](_0xfeac('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xfeac('0x8')](_0xfeac('0xb'),auth[_0xfeac('0xc')](),controller[_0xfeac('0xd')]);router[_0xfeac('0xe')]('/',auth[_0xfeac('0xc')](),controller['create']);router['put'](_0xfeac('0xb'),auth[_0xfeac('0xc')](),controller[_0xfeac('0xf')]);router[_0xfeac('0x10')]('/:id',auth[_0xfeac('0xc')](),controller['destroy']);module[_0xfeac('0x11')]=router;
\ No newline at end of file
+var _0x80b3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x4e52b9,_0x3b39b2){var _0xca4e2a=function(_0x11515d){while(--_0x11515d){_0x4e52b9['push'](_0x4e52b9['shift']());}};_0xca4e2a(++_0x3b39b2);}(_0x80b3,0x19d));var _0x380b=function(_0x4fd1e6,_0xfaa3ff){_0x4fd1e6=_0x4fd1e6-0x0;var _0x2f5995=_0x80b3[_0x4fd1e6];return _0x2f5995;};'use strict';var multer=require('multer');var util=require(_0x380b('0x0'));var path=require('path');var timeout=require(_0x380b('0x1'));var express=require(_0x380b('0x2'));var router=express[_0x380b('0x3')]();var fs_extra=require(_0x380b('0x4'));var auth=require(_0x380b('0x5'));var interaction=require(_0x380b('0x6'));var config=require(_0x380b('0x7'));var controller=require(_0x380b('0x8'));router[_0x380b('0x9')]('/',auth[_0x380b('0xa')](),controller[_0x380b('0xb')]);router[_0x380b('0x9')](_0x380b('0xc'),auth[_0x380b('0xa')](),controller[_0x380b('0xd')]);router[_0x380b('0x9')](_0x380b('0xe'),auth['isAuthenticated'](),controller[_0x380b('0xf')]);router[_0x380b('0x10')]('/',auth['isAuthenticated'](),controller[_0x380b('0x11')]);router[_0x380b('0x12')](_0x380b('0xe'),auth['isAuthenticated'](),controller[_0x380b('0x13')]);router[_0x380b('0x14')]('/:id',auth[_0x380b('0xa')](),controller[_0x380b('0x15')]);module[_0x380b('0x16')]=router;
\ No newline at end of file
index b5d7b61..03e8b86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d6b=['DATE','moment','exports','STRING'];(function(_0x3cefdf,_0x5d2192){var _0x5f3cb3=function(_0x3a2607){while(--_0x3a2607){_0x3cefdf['push'](_0x3cefdf['shift']());}};_0x5f3cb3(++_0x5d2192);}(_0x6d6b,0x7d));var _0xb6d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d6b[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xb6d6('0x0'));var Sequelize=require('sequelize');module[_0xb6d6('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb6d6('0x2')]},'joinAt':{'type':Sequelize[_0xb6d6('0x3')]},'leaveAt':{'type':Sequelize[_0xb6d6('0x3')]},'acceptAt':{'type':Sequelize[_0xb6d6('0x3')]},'exitAt':{'type':Sequelize[_0xb6d6('0x3')]},'reason':{'type':Sequelize[_0xb6d6('0x2')]}};
\ No newline at end of file
+var _0x1da9=['DATE','moment','sequelize','exports','STRING'];(function(_0x2512a5,_0x40f56c){var _0x418afd=function(_0x1baea5){while(--_0x1baea5){_0x2512a5['push'](_0x2512a5['shift']());}};_0x418afd(++_0x40f56c);}(_0x1da9,0x141));var _0x91da=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1da9[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x91da('0x0'));var Sequelize=require(_0x91da('0x1'));module[_0x91da('0x2')]={'uniqueid':{'type':Sequelize[_0x91da('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x91da('0x3')]},'joinAt':{'type':Sequelize[_0x91da('0x4')]},'leaveAt':{'type':Sequelize[_0x91da('0x4')]},'acceptAt':{'type':Sequelize[_0x91da('0x4')]},'exitAt':{'type':Sequelize[_0x91da('0x4')]},'reason':{'type':Sequelize[_0x91da('0x3')]}};
\ No newline at end of file
index 7d9a57c..c4998af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','MailQueueReport','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x29c828,_0x4979c1){var _0x1916b4=function(_0x41dd00){while(--_0x41dd00){_0x29c828['push'](_0x29c828['shift']());}};_0x1916b4(++_0x4979c1);}(_0x4975,0x86));var _0x5497=function(_0x5cf36a,_0x427aa9){_0x5cf36a=_0x5cf36a-0x0;var _0x5d0c6e=_0x4975[_0x5cf36a];return _0x5d0c6e;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['MailQueueReport']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['MailQueueReport'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['MailQueueReport'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));};
\ No newline at end of file
+var _0x93e9=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','MailQueueReport','includeAll','include','findAll','catch','show','params','keys','fields','length','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x44e9ea,_0x3a10a4){var _0x3b4fd7=function(_0xa0de55){while(--_0xa0de55){_0x44e9ea['push'](_0x44e9ea['shift']());}};_0x3b4fd7(++_0x3a10a4);}(_0x93e9,0xcc));var _0x993e=function(_0x3c5fbe,_0x1b05c7){_0x3c5fbe=_0x3c5fbe-0x0;var _0xb5c0ac=_0x93e9[_0x3c5fbe];return _0xb5c0ac;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];function respondWithStatusCode(_0x5d5c0d,_0x4c2707){_0x4c2707=_0x4c2707||0xcc;return function(_0x31ece2){if(_0x31ece2){return _0x5d5c0d[_0x993e('0x19')](_0x4c2707);}return _0x5d5c0d[_0x993e('0x1a')](_0x4c2707)[_0x993e('0x1b')]();};}function respondWithResult(_0x3e082b,_0x397b42){_0x397b42=_0x397b42||0xc8;return function(_0x34ddda){if(_0x34ddda){return _0x3e082b[_0x993e('0x1a')](_0x397b42)[_0x993e('0x1c')](_0x34ddda);}};}function respondWithFilteredResult(_0xa43a4e,_0x1a7726){return function(_0x135771){if(_0x135771){var _0x3df0e7=typeof _0x1a7726[_0x993e('0x1d')]===_0x993e('0x1e')&&typeof _0x1a7726[_0x993e('0x1f')]===_0x993e('0x1e');var _0x526e06=_0x135771[_0x993e('0x20')];var _0x1acd21=_0x3df0e7?0x0:_0x1a7726[_0x993e('0x1d')];var _0x3d6109=_0x3df0e7?_0x135771[_0x993e('0x20')]:_0x1a7726[_0x993e('0x1d')]+_0x1a7726['limit'];var _0x11cd41;if(_0x3d6109>=_0x526e06){_0x3d6109=_0x526e06;_0x11cd41=0xc8;}else{_0x11cd41=0xce;}_0xa43a4e[_0x993e('0x1a')](_0x11cd41);return _0xa43a4e[_0x993e('0x21')](_0x993e('0x22'),_0x1acd21+'-'+_0x3d6109+'/'+_0x526e06)[_0x993e('0x1c')](_0x135771);}return null;};}function patchUpdates(_0x425ab4){return function(_0x29e48d){try{jsonpatch[_0x993e('0x23')](_0x29e48d,_0x425ab4,!![]);}catch(_0x4bbe9c){return BPromise[_0x993e('0x24')](_0x4bbe9c);}return _0x29e48d['save']();};}function saveUpdates(_0x11f6f4,_0x37ff57){return function(_0x32b09e){if(_0x32b09e){return _0x32b09e['update'](_0x11f6f4)[_0x993e('0x25')](function(_0x13db4e){return _0x13db4e;});}return null;};}function removeEntity(_0xfba00f,_0x1c52fd){return function(_0x3b45ef){if(_0x3b45ef){return _0x3b45ef[_0x993e('0x26')]()[_0x993e('0x25')](function(){_0xfba00f[_0x993e('0x1a')](0xcc)[_0x993e('0x1b')]();});}};}function handleEntityNotFound(_0x18f6ac,_0x3fe099){return function(_0x3603fa){if(!_0x3603fa){_0x18f6ac['sendStatus'](0x194);}return _0x3603fa;};}function handleError(_0x2756a7,_0x279bb8){_0x279bb8=_0x279bb8||0x1f4;return function(_0x52b727){logger[_0x993e('0x27')](_0x52b727['stack']);if(_0x52b727[_0x993e('0x28')]){delete _0x52b727[_0x993e('0x28')];}_0x2756a7[_0x993e('0x1a')](_0x279bb8)[_0x993e('0x29')](_0x52b727);};}exports['index']=function(_0x48d457,_0x32e332){var _0x466d63={},_0x4a4f00={},_0x223af0={'count':0x0,'rows':[]};var _0x46670a=_[_0x993e('0x2a')](db['MailQueueReport'][_0x993e('0x2b')],function(_0x9e0309){return{'name':_0x9e0309[_0x993e('0x2c')],'type':_0x9e0309[_0x993e('0x2d')][_0x993e('0x2e')]};});_0x4a4f00['model']=_[_0x993e('0x2a')](_0x46670a,'name');_0x4a4f00[_0x993e('0x2f')]=_['keys'](_0x48d457[_0x993e('0x2f')]);_0x4a4f00['filters']=_[_0x993e('0x30')](_0x4a4f00[_0x993e('0x31')],_0x4a4f00[_0x993e('0x2f')]);_0x466d63[_0x993e('0x32')]=_[_0x993e('0x30')](_0x4a4f00[_0x993e('0x31')],qs['fields'](_0x48d457[_0x993e('0x2f')]['fields']));_0x466d63['attributes']=_0x466d63[_0x993e('0x32')]['length']?_0x466d63[_0x993e('0x32')]:_0x4a4f00[_0x993e('0x31')];if(!_0x48d457[_0x993e('0x2f')][_0x993e('0x33')](_0x993e('0x34'))){_0x466d63[_0x993e('0x1f')]=qs[_0x993e('0x1f')](_0x48d457[_0x993e('0x2f')][_0x993e('0x1f')]);_0x466d63[_0x993e('0x1d')]=qs[_0x993e('0x1d')](_0x48d457[_0x993e('0x2f')][_0x993e('0x1d')]);}_0x466d63[_0x993e('0x35')]=qs[_0x993e('0x36')](_0x48d457['query'][_0x993e('0x36')]);_0x466d63[_0x993e('0x37')]=qs[_0x993e('0x38')](_[_0x993e('0x39')](_0x48d457[_0x993e('0x2f')],_0x4a4f00[_0x993e('0x38')]),_0x46670a);if(_0x48d457[_0x993e('0x2f')][_0x993e('0x3a')]){_0x466d63[_0x993e('0x37')]=_['merge'](_0x466d63[_0x993e('0x37')],{'$or':_['map'](_0x46670a,function(_0xf79f29){if(_0xf79f29[_0x993e('0x2d')]!==_0x993e('0x3b')){var _0x406f14={};_0x406f14[_0xf79f29[_0x993e('0x28')]]={'$like':'%'+_0x48d457[_0x993e('0x2f')][_0x993e('0x3a')]+'%'};return _0x406f14;}})});}_0x466d63=_[_0x993e('0x3c')]({},_0x466d63,_0x48d457['options']);var _0x186d55={'where':_0x466d63['where']};return db[_0x993e('0x3d')]['count'](_0x186d55)[_0x993e('0x25')](function(_0xbd9983){_0x223af0[_0x993e('0x20')]=_0xbd9983;if(_0x48d457[_0x993e('0x2f')][_0x993e('0x3e')]){_0x466d63[_0x993e('0x3f')]=[{'all':!![]}];}return db[_0x993e('0x3d')][_0x993e('0x40')](_0x466d63);})['then'](function(_0xe64c){_0x223af0['rows']=_0xe64c;return _0x223af0;})['then'](respondWithFilteredResult(_0x32e332,_0x466d63))[_0x993e('0x41')](handleError(_0x32e332,null));};exports[_0x993e('0x42')]=function(_0x1f058f,_0x5ed497){var _0x620b26={'raw':!![],'where':{'id':_0x1f058f[_0x993e('0x43')]['id']}},_0x40719d={};_0x40719d['model']=_['keys'](db['MailQueueReport'][_0x993e('0x2b')]);_0x40719d[_0x993e('0x2f')]=_[_0x993e('0x44')](_0x1f058f['query']);_0x40719d[_0x993e('0x38')]=_[_0x993e('0x30')](_0x40719d['model'],_0x40719d[_0x993e('0x2f')]);_0x620b26[_0x993e('0x32')]=_['intersection'](_0x40719d[_0x993e('0x31')],qs[_0x993e('0x45')](_0x1f058f[_0x993e('0x2f')]['fields']));_0x620b26['attributes']=_0x620b26['attributes'][_0x993e('0x46')]?_0x620b26[_0x993e('0x32')]:_0x40719d[_0x993e('0x31')];if(_0x1f058f[_0x993e('0x2f')]['includeAll']){_0x620b26[_0x993e('0x3f')]=[{'all':!![]}];}_0x620b26=_[_0x993e('0x3c')]({},_0x620b26,_0x1f058f[_0x993e('0x47')]);return db[_0x993e('0x3d')][_0x993e('0x48')](_0x620b26)[_0x993e('0x25')](handleEntityNotFound(_0x5ed497,null))['then'](respondWithResult(_0x5ed497,null))['catch'](handleError(_0x5ed497,null));};exports[_0x993e('0x49')]=function(_0x416f9f,_0x4d560d){return db['MailQueueReport'][_0x993e('0x49')](_0x416f9f[_0x993e('0x4a')],{})[_0x993e('0x25')](respondWithResult(_0x4d560d,0xc9))[_0x993e('0x41')](handleError(_0x4d560d,null));};exports[_0x993e('0x4b')]=function(_0x256ce3,_0x5b18e3){if(_0x256ce3[_0x993e('0x4a')]['id']){delete _0x256ce3['body']['id'];}return db[_0x993e('0x3d')][_0x993e('0x48')]({'where':{'id':_0x256ce3[_0x993e('0x43')]['id']}})[_0x993e('0x25')](handleEntityNotFound(_0x5b18e3,null))[_0x993e('0x25')](saveUpdates(_0x256ce3[_0x993e('0x4a')],null))[_0x993e('0x25')](respondWithResult(_0x5b18e3,null))[_0x993e('0x41')](handleError(_0x5b18e3,null));};exports['destroy']=function(_0x23f09c,_0x66ee65){return db[_0x993e('0x3d')]['find']({'where':{'id':_0x23f09c[_0x993e('0x43')]['id']}})['then'](handleEntityNotFound(_0x66ee65,null))[_0x993e('0x25')](removeEntity(_0x66ee65,null))[_0x993e('0x41')](handleError(_0x66ee65,null));};exports['describe']=function(_0xb2508b,_0xef78a1){return db['MailQueueReport'][_0x993e('0x4c')]()[_0x993e('0x25')](respondWithResult(_0xef78a1,null))[_0x993e('0x41')](handleError(_0xef78a1,null));};
\ No newline at end of file
index 1b560bc..968c6ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b8a=['api','moment','request-promise','path','rimraf','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0x6b8a,0x1b7));var _0xa6b8=function(_0x591a9d,_0x59b0f5){_0x591a9d=_0x591a9d-0x0;var _0x5d2017=_0x6b8a[_0x591a9d];return _0x5d2017;};'use strict';var _=require(_0xa6b8('0x0'));var util=require(_0xa6b8('0x1'));var logger=require(_0xa6b8('0x2'))(_0xa6b8('0x3'));var moment=require(_0xa6b8('0x4'));var BPromise=require('bluebird');var rp=require(_0xa6b8('0x5'));var fs=require('fs');var path=require(_0xa6b8('0x6'));var rimraf=require(_0xa6b8('0x7'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0xa6b8('0x8')]=function(_0x560c5e,_0x5bb28a){return _0x560c5e[_0xa6b8('0x9')](_0xa6b8('0xa'),attributes,{'tableName':_0xa6b8('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa6b8('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3249=['rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3249,0xdf));var _0x9324=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x3249[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0x9324('0x0'));var util=require(_0x9324('0x1'));var logger=require(_0x9324('0x2'))('api');var moment=require(_0x9324('0x3'));var BPromise=require('bluebird');var rp=require(_0x9324('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9324('0x5'));var config=require(_0x9324('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x9324('0x7')]=function(_0x3bb701,_0x2fea77){return _0x3bb701[_0x9324('0x8')](_0x9324('0x9'),attributes,{'tableName':_0x9324('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9324('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 8751642..7ef7223 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(_0x53e1ee,_0x508e5f){var _0x5399d8=function(_0x4910f1){while(--_0x4910f1){_0x53e1ee['push'](_0x53e1ee['shift']());}};_0x5399d8(++_0x508e5f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'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 _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(_0x1a9cab,_0x43ecaa){var _0x33a4b9=function(_0x22c47d){while(--_0x22c47d){_0x1a9cab['push'](_0x1a9cab['shift']());}};_0x33a4b9(++_0x43ecaa);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'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
index 43a2d04..655c640 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(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x13c1ec,_0x31fe45){var _0x3df630=function(_0x2ec0ee){while(--_0x2ec0ee){_0x13c1ec['push'](_0x13c1ec['shift']());}};_0x3df630(++_0x31fe45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 6deb882..47e3aa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8130=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x291259,_0x38b0a3){var _0x3d5aba=function(_0x2185bf){while(--_0x2185bf){_0x291259['push'](_0x291259['shift']());}};_0x3d5aba(++_0x38b0a3);}(_0x8130,0x146));var _0x0813=function(_0x301a1a,_0x323d83){_0x301a1a=_0x301a1a-0x0;var _0x4342de=_0x8130[_0x301a1a];return _0x4342de;};'use strict';var Sequelize=require(_0x0813('0x0'));module[_0x0813('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0813('0x2')]},'authentication':{'type':Sequelize[_0x0813('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0813('0x2')]},'password':{'type':Sequelize[_0x0813('0x2')]},'port':{'type':Sequelize[_0x0813('0x4')]},'tls':{'type':Sequelize[_0x0813('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x0813('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x0813('0x2')]}};
\ No newline at end of file
+var _0xbfcc=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x3ccd5c,_0x4837e1){var _0x208d59=function(_0x5afb40){while(--_0x5afb40){_0x3ccd5c['push'](_0x3ccd5c['shift']());}};_0x208d59(++_0x4837e1);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0xbfcc[_0x47b15f];return _0x55bf25;};'use strict';var Sequelize=require(_0xcbfc('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xcbfc('0x1')]},'authentication':{'type':Sequelize[_0xcbfc('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xcbfc('0x1')]},'password':{'type':Sequelize[_0xcbfc('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xcbfc('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xcbfc('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}};
\ No newline at end of file
index edcd37b..993ff89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43a0=['define','MailServerIn','mail_servers_in','lodash','api','moment','bluebird','request-promise','rimraf','./mailServerIn.attributes'];(function(_0x45093b,_0x2597c8){var _0x4cdf3d=function(_0x32e472){while(--_0x32e472){_0x45093b['push'](_0x45093b['shift']());}};_0x4cdf3d(++_0x2597c8);}(_0x43a0,0xcb));var _0x043a=function(_0x225a10,_0x4e6cda){_0x225a10=_0x225a10-0x0;var _0x3fede5=_0x43a0[_0x225a10];return _0x3fede5;};'use strict';var _=require(_0x043a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x043a('0x1'));var moment=require(_0x043a('0x2'));var BPromise=require(_0x043a('0x3'));var rp=require(_0x043a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x043a('0x5'));var config=require('../../config/environment');var attributes=require(_0x043a('0x6'));module['exports']=function(_0x858b3c,_0x22907e){return _0x858b3c[_0x043a('0x7')](_0x043a('0x8'),attributes,{'tableName':_0x043a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x633e=['MailServerIn','mail_servers_in','moment','request-promise','path','rimraf','./mailServerIn.attributes','exports','define'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x633e,0x18e));var _0xe633=function(_0x24a7c9,_0x157c78){_0x24a7c9=_0x24a7c9-0x0;var _0x451a81=_0x633e[_0x24a7c9];return _0x451a81;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe633('0x0'));var BPromise=require('bluebird');var rp=require(_0xe633('0x1'));var fs=require('fs');var path=require(_0xe633('0x2'));var rimraf=require(_0xe633('0x3'));var config=require('../../config/environment');var attributes=require(_0xe633('0x4'));module[_0xe633('0x5')]=function(_0x4440ed,_0x557594){return _0x4440ed[_0xe633('0x6')](_0xe633('0x7'),attributes,{'tableName':_0xe633('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 02ba819..0d40dee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2e5=['GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','map','include','attributes','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','MailServerIn,\x20%s,\x20%s','message','result'];(function(_0x112198,_0x52c556){var _0x21b4b3=function(_0x24b17f){while(--_0x24b17f){_0x112198['push'](_0x112198['shift']());}};_0x21b4b3(++_0x52c556);}(_0xc2e5,0x87));var _0x5c2e=function(_0x166acc,_0x111e4e){_0x166acc=_0x166acc-0x0;var _0x209f4d=_0xc2e5[_0x166acc];return _0x209f4d;};'use strict';var _=require(_0x5c2e('0x0'));var util=require(_0x5c2e('0x1'));var moment=require(_0x5c2e('0x2'));var BPromise=require(_0x5c2e('0x3'));var rs=require(_0x5c2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c2e('0x5'))['db'];var utils=require(_0x5c2e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5c2e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5c2e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x65371e,_0x1046a3,_0x22781f){return new BPromise(function(_0x1a3d16,_0x2d8cb6){return client[_0x5c2e('0x9')](_0x65371e,_0x22781f)[_0x5c2e('0xa')](function(_0x13a949){logger[_0x5c2e('0xb')]('MailServerIn,\x20%s,\x20%s',_0x1046a3,_0x5c2e('0xc'));logger[_0x5c2e('0xd')](_0x5c2e('0xe'),_0x1046a3,_0x5c2e('0xc'),JSON[_0x5c2e('0xf')](_0x13a949));if(_0x13a949[_0x5c2e('0x10')]){if(_0x13a949[_0x5c2e('0x10')]['code']===0x1f4){logger[_0x5c2e('0x10')](_0x5c2e('0x11'),_0x1046a3,_0x13a949['error']['message']);return _0x2d8cb6(_0x13a949[_0x5c2e('0x10')][_0x5c2e('0x12')]);}logger[_0x5c2e('0x10')](_0x5c2e('0x11'),_0x1046a3,_0x13a949[_0x5c2e('0x10')][_0x5c2e('0x12')]);return _0x1a3d16(_0x13a949[_0x5c2e('0x10')][_0x5c2e('0x12')]);}else{logger[_0x5c2e('0xb')](_0x5c2e('0x11'),_0x1046a3,'request\x20sent');_0x1a3d16(_0x13a949[_0x5c2e('0x13')][_0x5c2e('0x12')]);}})['catch'](function(_0x54925b){logger[_0x5c2e('0x10')]('MailServerIn,\x20%s,\x20%s',_0x1046a3,_0x54925b);_0x2d8cb6(_0x54925b);});});}exports[_0x5c2e('0x14')]=function(_0x1b1f67){var _0x5237e3=this;return new Promise(function(_0x3f4d44,_0x1aafdc){return db[_0x5c2e('0x15')][_0x5c2e('0x16')]({'raw':_0x1b1f67['options']?_0x1b1f67[_0x5c2e('0x17')][_0x5c2e('0x18')]===undefined?!![]:![]:!![],'where':_0x1b1f67[_0x5c2e('0x17')]?_0x1b1f67[_0x5c2e('0x17')][_0x5c2e('0x19')]||null:null,'attributes':_0x1b1f67[_0x5c2e('0x17')]?_0x1b1f67['options']['attributes']||null:null,'limit':_0x1b1f67[_0x5c2e('0x17')]?_0x1b1f67['options'][_0x5c2e('0x1a')]||null:null,'include':_0x1b1f67['options']?_0x1b1f67['options']['include']?_[_0x5c2e('0x1b')](_0x1b1f67[_0x5c2e('0x17')][_0x5c2e('0x1c')],function(_0x1660f3){return{'model':db[_0x1660f3['model']],'as':_0x1660f3['as'],'attributes':_0x1660f3[_0x5c2e('0x1d')],'include':_0x1660f3[_0x5c2e('0x1c')]?_[_0x5c2e('0x1b')](_0x1660f3[_0x5c2e('0x1c')],function(_0x317e3e){return{'model':db[_0x317e3e['model']],'as':_0x317e3e['as'],'attributes':_0x317e3e[_0x5c2e('0x1d')],'include':_0x317e3e[_0x5c2e('0x1c')]?_[_0x5c2e('0x1b')](_0x317e3e['include'],function(_0x475c4d){return{'model':db[_0x475c4d['model']],'as':_0x475c4d['as'],'attributes':_0x475c4d[_0x5c2e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5c2e('0xa')](function(_0x28aa56){logger[_0x5c2e('0xb')]('GetMailServerIn',_0x1b1f67);logger[_0x5c2e('0xd')](_0x5c2e('0x14'),_0x1b1f67,JSON[_0x5c2e('0xf')](_0x28aa56));_0x3f4d44(_0x28aa56);})[_0x5c2e('0x1e')](function(_0x2de061){logger['error']('GetMailServerIn',_0x2de061[_0x5c2e('0x12')],_0x1b1f67);_0x1aafdc(_0x5237e3[_0x5c2e('0x10')](0x1f4,_0x2de061[_0x5c2e('0x12')]));});});};
\ No newline at end of file
+var _0x736b=['debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','limit','include','model','attributes','map','then'];(function(_0x5e2c46,_0x20f500){var _0x5acf56=function(_0x594bbb){while(--_0x594bbb){_0x5e2c46['push'](_0x5e2c46['shift']());}};_0x5acf56(++_0x20f500);}(_0x736b,0x8a));var _0xb736=function(_0x3f6cf7,_0x56735e){_0x3f6cf7=_0x3f6cf7-0x0;var _0xb90b33=_0x736b[_0x3f6cf7];return _0xb90b33;};'use strict';var _=require(_0xb736('0x0'));var util=require(_0xb736('0x1'));var moment=require(_0xb736('0x2'));var BPromise=require(_0xb736('0x3'));var rs=require(_0xb736('0x4'));var fs=require('fs');var Redis=require(_0xb736('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb736('0x6'));var logger=require(_0xb736('0x7'))(_0xb736('0x8'));var config=require(_0xb736('0x9'));var jayson=require(_0xb736('0xa'));var client=jayson[_0xb736('0xb')][_0xb736('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26644f,_0x57f6dd,_0x4fbfc0){return new BPromise(function(_0x206418,_0x2c63f4){return client[_0xb736('0xd')](_0x26644f,_0x4fbfc0)['then'](function(_0x59ec11){logger[_0xb736('0xe')](_0xb736('0xf'),_0x57f6dd,_0xb736('0x10'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x57f6dd,_0xb736('0x10'),JSON['stringify'](_0x59ec11));if(_0x59ec11[_0xb736('0x11')]){if(_0x59ec11['error'][_0xb736('0x12')]===0x1f4){logger[_0xb736('0x11')](_0xb736('0xf'),_0x57f6dd,_0x59ec11[_0xb736('0x11')][_0xb736('0x13')]);return _0x2c63f4(_0x59ec11[_0xb736('0x11')][_0xb736('0x13')]);}logger[_0xb736('0x11')](_0xb736('0xf'),_0x57f6dd,_0x59ec11[_0xb736('0x11')][_0xb736('0x13')]);return _0x206418(_0x59ec11[_0xb736('0x11')]['message']);}else{logger['info'](_0xb736('0xf'),_0x57f6dd,'request\x20sent');_0x206418(_0x59ec11[_0xb736('0x14')][_0xb736('0x13')]);}})['catch'](function(_0x1a315f){logger['error'](_0xb736('0xf'),_0x57f6dd,_0x1a315f);_0x2c63f4(_0x1a315f);});});}exports[_0xb736('0x15')]=function(_0x48d62a){var _0x229fa7=this;return new Promise(function(_0x882901,_0xe83e6e){return db[_0xb736('0x16')][_0xb736('0x17')]({'raw':_0x48d62a[_0xb736('0x18')]?_0x48d62a['options'][_0xb736('0x19')]===undefined?!![]:![]:!![],'where':_0x48d62a['options']?_0x48d62a[_0xb736('0x18')]['where']||null:null,'attributes':_0x48d62a[_0xb736('0x18')]?_0x48d62a['options']['attributes']||null:null,'limit':_0x48d62a['options']?_0x48d62a['options'][_0xb736('0x1a')]||null:null,'include':_0x48d62a[_0xb736('0x18')]?_0x48d62a[_0xb736('0x18')][_0xb736('0x1b')]?_['map'](_0x48d62a[_0xb736('0x18')][_0xb736('0x1b')],function(_0x1d76dd){return{'model':db[_0x1d76dd[_0xb736('0x1c')]],'as':_0x1d76dd['as'],'attributes':_0x1d76dd[_0xb736('0x1d')],'include':_0x1d76dd[_0xb736('0x1b')]?_[_0xb736('0x1e')](_0x1d76dd[_0xb736('0x1b')],function(_0x4eca54){return{'model':db[_0x4eca54[_0xb736('0x1c')]],'as':_0x4eca54['as'],'attributes':_0x4eca54['attributes'],'include':_0x4eca54['include']?_['map'](_0x4eca54['include'],function(_0x3a7f60){return{'model':db[_0x3a7f60['model']],'as':_0x3a7f60['as'],'attributes':_0x3a7f60[_0xb736('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb736('0x1f')](function(_0x13d767){logger[_0xb736('0xe')](_0xb736('0x15'),_0x48d62a);logger[_0xb736('0x20')](_0xb736('0x15'),_0x48d62a,JSON['stringify'](_0x13d767));_0x882901(_0x13d767);})[_0xb736('0x21')](function(_0x419288){logger[_0xb736('0x11')](_0xb736('0x15'),_0x419288[_0xb736('0x13')],_0x48d62a);_0xe83e6e(_0x229fa7[_0xb736('0x11')](0x1f4,_0x419288['message']));});});};
\ No newline at end of file
index 01c162c..12e5cf8 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(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7a54,0x106));var _0x47a5=function(_0x255a95,_0x3dc979){_0x255a95=_0x255a95-0x0;var _0x291ba5=_0x7a54[_0x255a95];return _0x291ba5;};'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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
index 0f430a0..29d80da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3054=['BOOLEAN','STRING','INTEGER'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x3054,0xac));var _0x4305=function(_0x449b7c,_0x6b8ea9){_0x449b7c=_0x449b7c-0x0;var _0xaa0871=_0x3054[_0x449b7c];return _0xaa0871;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x4305('0x0')]},'host':{'type':Sequelize[_0x4305('0x0')]},'user':{'type':Sequelize[_0x4305('0x0')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4305('0x1')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x4305('0x0')]},'authentication':{'type':Sequelize[_0x4305('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe53c=['sequelize','STRING'];(function(_0x3550d4,_0xa10bca){var _0x1c8ba1=function(_0x141ac5){while(--_0x141ac5){_0x3550d4['push'](_0x3550d4['shift']());}};_0x1c8ba1(++_0xa10bca);}(_0xe53c,0x184));var _0xce53=function(_0x4e33c0,_0x555fda){_0x4e33c0=_0x4e33c0-0x0;var _0x1f7aa3=_0xe53c[_0x4e33c0];return _0x1f7aa3;};'use strict';var Sequelize=require(_0xce53('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xce53('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xce53('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 19e1172..d0ed1f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f0b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','name','map','MailServerOut','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x495734,_0x10ebb6){var _0x243751=function(_0x5c49c7){while(--_0x5c49c7){_0x495734['push'](_0x495734['shift']());}};_0x243751(++_0x10ebb6);}(_0x3f0b,0x1d5));var _0xb3f0=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3f0b[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb3f0('0x0'));var jsonpatch=require(_0xb3f0('0x1'));var rp=require(_0xb3f0('0x2'));var moment=require(_0xb3f0('0x3'));var BPromise=require(_0xb3f0('0x4'));var Mustache=require(_0xb3f0('0x5'));var util=require(_0xb3f0('0x6'));var path=require(_0xb3f0('0x7'));var sox=require(_0xb3f0('0x8'));var csv=require(_0xb3f0('0x9'));var ejs=require(_0xb3f0('0xa'));var fs=require('fs');var fs_extra=require(_0xb3f0('0xb'));var _=require(_0xb3f0('0xc'));var squel=require(_0xb3f0('0xd'));var crypto=require(_0xb3f0('0xe'));var jsforce=require(_0xb3f0('0xf'));var deskjs=require(_0xb3f0('0x10'));var toCsv=require(_0xb3f0('0x9'));var querystring=require(_0xb3f0('0x11'));var Papa=require(_0xb3f0('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb3f0('0x13'));var as=require(_0xb3f0('0x14'));var hardwareService=require(_0xb3f0('0x15'));var logger=require(_0xb3f0('0x16'))(_0xb3f0('0x17'));var utils=require(_0xb3f0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb3f0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4060a7,_0x57283f){_0x57283f=_0x57283f||0xcc;return function(_0x5ed089){if(_0x5ed089){return _0x4060a7[_0xb3f0('0x1a')](_0x57283f);}return _0x4060a7[_0xb3f0('0x1b')](_0x57283f)[_0xb3f0('0x1c')]();};}function respondWithResult(_0x32c897,_0x3c965b){_0x3c965b=_0x3c965b||0xc8;return function(_0xfdcfd1){if(_0xfdcfd1){return _0x32c897['status'](_0x3c965b)[_0xb3f0('0x1d')](_0xfdcfd1);}};}function respondWithFilteredResult(_0x5eb711,_0x2e59d5){return function(_0xbc2ccd){if(_0xbc2ccd){var _0x5b2892=typeof _0x2e59d5[_0xb3f0('0x1e')]===_0xb3f0('0x1f')&&typeof _0x2e59d5[_0xb3f0('0x20')]===_0xb3f0('0x1f');var _0x1cbcf0=_0xbc2ccd[_0xb3f0('0x21')];var _0x564ece=_0x5b2892?0x0:_0x2e59d5[_0xb3f0('0x1e')];var _0x20c8a9=_0x5b2892?_0xbc2ccd[_0xb3f0('0x21')]:_0x2e59d5[_0xb3f0('0x1e')]+_0x2e59d5[_0xb3f0('0x20')];var _0x4dfdb5;if(_0x20c8a9>=_0x1cbcf0){_0x20c8a9=_0x1cbcf0;_0x4dfdb5=0xc8;}else{_0x4dfdb5=0xce;}_0x5eb711[_0xb3f0('0x1b')](_0x4dfdb5);return _0x5eb711[_0xb3f0('0x22')](_0xb3f0('0x23'),_0x564ece+'-'+_0x20c8a9+'/'+_0x1cbcf0)[_0xb3f0('0x1d')](_0xbc2ccd);}return null;};}function patchUpdates(_0x35b18f){return function(_0x5b00b4){try{jsonpatch['apply'](_0x5b00b4,_0x35b18f,!![]);}catch(_0x297224){return BPromise[_0xb3f0('0x24')](_0x297224);}return _0x5b00b4['save']();};}function saveUpdates(_0x404066,_0x28475b){return function(_0x40cb72){if(_0x40cb72){return _0x40cb72[_0xb3f0('0x25')](_0x404066)[_0xb3f0('0x26')](function(_0x4635e3){return _0x4635e3;});}return null;};}function removeEntity(_0x5aff02,_0x26b6d3){return function(_0xbaef15){if(_0xbaef15){return _0xbaef15['destroy']()['then'](function(){_0x5aff02[_0xb3f0('0x1b')](0xcc)[_0xb3f0('0x1c')]();});}};}function handleEntityNotFound(_0x376a00,_0x5a329c){return function(_0x38370d){if(!_0x38370d){_0x376a00[_0xb3f0('0x1a')](0x194);}return _0x38370d;};}function handleError(_0x194754,_0x2d6343){_0x2d6343=_0x2d6343||0x1f4;return function(_0x458faa){logger['error'](_0x458faa['stack']);if(_0x458faa[_0xb3f0('0x27')]){delete _0x458faa[_0xb3f0('0x27')];}_0x194754[_0xb3f0('0x1b')](_0x2d6343)['send'](_0x458faa);};}exports['index']=function(_0x8e6908,_0x32a1fb){var _0x33cd29={},_0x199230={},_0x593ca2={'count':0x0,'rows':[]};var _0x58230d=_[_0xb3f0('0x28')](db[_0xb3f0('0x29')][_0xb3f0('0x2a')],function(_0x1a9890){return{'name':_0x1a9890['fieldName'],'type':_0x1a9890[_0xb3f0('0x2b')]['key']};});_0x199230[_0xb3f0('0x2c')]=_[_0xb3f0('0x28')](_0x58230d,_0xb3f0('0x27'));_0x199230[_0xb3f0('0x2d')]=_[_0xb3f0('0x2e')](_0x8e6908[_0xb3f0('0x2d')]);_0x199230[_0xb3f0('0x2f')]=_[_0xb3f0('0x30')](_0x199230[_0xb3f0('0x2c')],_0x199230[_0xb3f0('0x2d')]);_0x33cd29['attributes']=_[_0xb3f0('0x30')](_0x199230['model'],qs[_0xb3f0('0x31')](_0x8e6908[_0xb3f0('0x2d')][_0xb3f0('0x31')]));_0x33cd29[_0xb3f0('0x32')]=_0x33cd29[_0xb3f0('0x32')]['length']?_0x33cd29['attributes']:_0x199230[_0xb3f0('0x2c')];if(!_0x8e6908[_0xb3f0('0x2d')]['hasOwnProperty'](_0xb3f0('0x33'))){_0x33cd29[_0xb3f0('0x20')]=qs['limit'](_0x8e6908[_0xb3f0('0x2d')][_0xb3f0('0x20')]);_0x33cd29['offset']=qs[_0xb3f0('0x1e')](_0x8e6908[_0xb3f0('0x2d')]['offset']);}_0x33cd29['order']=qs[_0xb3f0('0x34')](_0x8e6908['query'][_0xb3f0('0x34')]);_0x33cd29[_0xb3f0('0x35')]=qs[_0xb3f0('0x2f')](_[_0xb3f0('0x36')](_0x8e6908[_0xb3f0('0x2d')],_0x199230[_0xb3f0('0x2f')]),_0x58230d);if(_0x8e6908[_0xb3f0('0x2d')][_0xb3f0('0x37')]){_0x33cd29[_0xb3f0('0x35')]=_['merge'](_0x33cd29[_0xb3f0('0x35')],{'$or':_[_0xb3f0('0x28')](_0x58230d,function(_0x536579){if(_0x536579['type']!=='VIRTUAL'){var _0x570fb4={};_0x570fb4[_0x536579[_0xb3f0('0x27')]]={'$like':'%'+_0x8e6908[_0xb3f0('0x2d')]['filter']+'%'};return _0x570fb4;}})});}_0x33cd29=_[_0xb3f0('0x38')]({},_0x33cd29,_0x8e6908['options']);var _0x24b888={'where':_0x33cd29['where']};return db[_0xb3f0('0x29')]['count'](_0x24b888)[_0xb3f0('0x26')](function(_0x3b3a3a){_0x593ca2[_0xb3f0('0x21')]=_0x3b3a3a;if(_0x8e6908[_0xb3f0('0x2d')][_0xb3f0('0x39')]){_0x33cd29[_0xb3f0('0x3a')]=[{'all':!![]}];}return db[_0xb3f0('0x29')][_0xb3f0('0x3b')](_0x33cd29);})['then'](function(_0x14115e){_0x593ca2[_0xb3f0('0x3c')]=_0x14115e;return _0x593ca2;})[_0xb3f0('0x26')](respondWithFilteredResult(_0x32a1fb,_0x33cd29))[_0xb3f0('0x3d')](handleError(_0x32a1fb,null));};exports[_0xb3f0('0x3e')]=function(_0x482088,_0x81d417){var _0x4ad30b={'raw':!![],'where':{'id':_0x482088[_0xb3f0('0x3f')]['id']}},_0x5af180={};_0x5af180['model']=_[_0xb3f0('0x2e')](db[_0xb3f0('0x29')][_0xb3f0('0x2a')]);_0x5af180['query']=_[_0xb3f0('0x2e')](_0x482088[_0xb3f0('0x2d')]);_0x5af180['filters']=_[_0xb3f0('0x30')](_0x5af180['model'],_0x5af180[_0xb3f0('0x2d')]);_0x4ad30b['attributes']=_[_0xb3f0('0x30')](_0x5af180[_0xb3f0('0x2c')],qs[_0xb3f0('0x31')](_0x482088['query'][_0xb3f0('0x31')]));_0x4ad30b['attributes']=_0x4ad30b['attributes'][_0xb3f0('0x40')]?_0x4ad30b[_0xb3f0('0x32')]:_0x5af180[_0xb3f0('0x2c')];if(_0x482088[_0xb3f0('0x2d')][_0xb3f0('0x39')]){_0x4ad30b[_0xb3f0('0x3a')]=[{'all':!![]}];}_0x4ad30b=_[_0xb3f0('0x38')]({},_0x4ad30b,_0x482088[_0xb3f0('0x41')]);return db[_0xb3f0('0x29')][_0xb3f0('0x42')](_0x4ad30b)[_0xb3f0('0x26')](handleEntityNotFound(_0x81d417,null))[_0xb3f0('0x26')](respondWithResult(_0x81d417,null))[_0xb3f0('0x3d')](handleError(_0x81d417,null));};exports[_0xb3f0('0x43')]=function(_0x563e27,_0xec260c){return db[_0xb3f0('0x29')][_0xb3f0('0x43')](_0x563e27[_0xb3f0('0x44')],{})[_0xb3f0('0x26')](respondWithResult(_0xec260c,0xc9))[_0xb3f0('0x3d')](handleError(_0xec260c,null));};exports[_0xb3f0('0x25')]=function(_0x39cb34,_0x3fcbac){if(_0x39cb34['body']['id']){delete _0x39cb34[_0xb3f0('0x44')]['id'];}return db[_0xb3f0('0x29')][_0xb3f0('0x42')]({'where':{'id':_0x39cb34[_0xb3f0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3fcbac,null))[_0xb3f0('0x26')](saveUpdates(_0x39cb34[_0xb3f0('0x44')],null))[_0xb3f0('0x26')](respondWithResult(_0x3fcbac,null))['catch'](handleError(_0x3fcbac,null));};exports[_0xb3f0('0x45')]=function(_0x3ed977,_0x2e258d){return db[_0xb3f0('0x29')][_0xb3f0('0x42')]({'where':{'id':_0x3ed977['params']['id']}})[_0xb3f0('0x26')](handleEntityNotFound(_0x2e258d,null))[_0xb3f0('0x26')](removeEntity(_0x2e258d,null))[_0xb3f0('0x3d')](handleError(_0x2e258d,null));};
\ No newline at end of file
+var _0x0887=['options','include','findAll','rows','catch','params','keys','rawAttributes','length','includeAll','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','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','then','destroy','error','stack','name','send','index','map','MailServerOut','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter'];(function(_0x122e42,_0x222609){var _0x4c019e=function(_0x3036dd){while(--_0x3036dd){_0x122e42['push'](_0x122e42['shift']());}};_0x4c019e(++_0x222609);}(_0x0887,0x17a));var _0x7088=function(_0x4d7c86,_0x9b62a6){_0x4d7c86=_0x4d7c86-0x0;var _0x59443d=_0x0887[_0x4d7c86];return _0x59443d;};'use strict';var emlformat=require(_0x7088('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7088('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7088('0x2'));var moment=require(_0x7088('0x3'));var BPromise=require(_0x7088('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7088('0x5'));var sox=require(_0x7088('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7088('0x7'));var _=require(_0x7088('0x8'));var squel=require(_0x7088('0x9'));var crypto=require(_0x7088('0xa'));var jsforce=require(_0x7088('0xb'));var deskjs=require(_0x7088('0xc'));var toCsv=require(_0x7088('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7088('0xe'));var authService=require(_0x7088('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7088('0x10'))(_0x7088('0x11'));var utils=require(_0x7088('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7088('0x13'));var db=require(_0x7088('0x14'))['db'];function respondWithStatusCode(_0x189cc4,_0x10cefa){_0x10cefa=_0x10cefa||0xcc;return function(_0x3dffb6){if(_0x3dffb6){return _0x189cc4[_0x7088('0x15')](_0x10cefa);}return _0x189cc4[_0x7088('0x16')](_0x10cefa)[_0x7088('0x17')]();};}function respondWithResult(_0x30cdc0,_0x43bd1e){_0x43bd1e=_0x43bd1e||0xc8;return function(_0x4988ee){if(_0x4988ee){return _0x30cdc0[_0x7088('0x16')](_0x43bd1e)[_0x7088('0x18')](_0x4988ee);}};}function respondWithFilteredResult(_0xef0549,_0x297b47){return function(_0x56ffa8){if(_0x56ffa8){var _0x59708a=typeof _0x297b47[_0x7088('0x19')]===_0x7088('0x1a')&&typeof _0x297b47[_0x7088('0x1b')]==='undefined';var _0x481d2b=_0x56ffa8[_0x7088('0x1c')];var _0x5a9fd3=_0x59708a?0x0:_0x297b47[_0x7088('0x19')];var _0x203ebb=_0x59708a?_0x56ffa8['count']:_0x297b47[_0x7088('0x19')]+_0x297b47[_0x7088('0x1b')];var _0x417627;if(_0x203ebb>=_0x481d2b){_0x203ebb=_0x481d2b;_0x417627=0xc8;}else{_0x417627=0xce;}_0xef0549[_0x7088('0x16')](_0x417627);return _0xef0549[_0x7088('0x1d')](_0x7088('0x1e'),_0x5a9fd3+'-'+_0x203ebb+'/'+_0x481d2b)['json'](_0x56ffa8);}return null;};}function patchUpdates(_0x4594da){return function(_0x27cb49){try{jsonpatch[_0x7088('0x1f')](_0x27cb49,_0x4594da,!![]);}catch(_0x4985e0){return BPromise[_0x7088('0x20')](_0x4985e0);}return _0x27cb49['save']();};}function saveUpdates(_0x50d40a,_0x3ed0f6){return function(_0x155cd1){if(_0x155cd1){return _0x155cd1[_0x7088('0x21')](_0x50d40a)[_0x7088('0x22')](function(_0x1e1d7f){return _0x1e1d7f;});}return null;};}function removeEntity(_0x1b8b08,_0x20c4e3){return function(_0xed648e){if(_0xed648e){return _0xed648e[_0x7088('0x23')]()[_0x7088('0x22')](function(){_0x1b8b08['status'](0xcc)[_0x7088('0x17')]();});}};}function handleEntityNotFound(_0x3d3d51,_0x31e566){return function(_0x2f717d){if(!_0x2f717d){_0x3d3d51[_0x7088('0x15')](0x194);}return _0x2f717d;};}function handleError(_0x4803a5,_0x548e33){_0x548e33=_0x548e33||0x1f4;return function(_0x47a58f){logger[_0x7088('0x24')](_0x47a58f[_0x7088('0x25')]);if(_0x47a58f[_0x7088('0x26')]){delete _0x47a58f[_0x7088('0x26')];}_0x4803a5[_0x7088('0x16')](_0x548e33)[_0x7088('0x27')](_0x47a58f);};}exports[_0x7088('0x28')]=function(_0x51f606,_0x129dea){var _0x1ea5d7={},_0x1cb476={},_0x26e3fd={'count':0x0,'rows':[]};var _0xa70cef=_[_0x7088('0x29')](db[_0x7088('0x2a')]['rawAttributes'],function(_0x43e32b){return{'name':_0x43e32b['fieldName'],'type':_0x43e32b[_0x7088('0x2b')][_0x7088('0x2c')]};});_0x1cb476[_0x7088('0x2d')]=_[_0x7088('0x29')](_0xa70cef,_0x7088('0x26'));_0x1cb476[_0x7088('0x2e')]=_['keys'](_0x51f606['query']);_0x1cb476['filters']=_[_0x7088('0x2f')](_0x1cb476[_0x7088('0x2d')],_0x1cb476[_0x7088('0x2e')]);_0x1ea5d7[_0x7088('0x30')]=_['intersection'](_0x1cb476[_0x7088('0x2d')],qs[_0x7088('0x31')](_0x51f606[_0x7088('0x2e')][_0x7088('0x31')]));_0x1ea5d7[_0x7088('0x30')]=_0x1ea5d7[_0x7088('0x30')]['length']?_0x1ea5d7[_0x7088('0x30')]:_0x1cb476[_0x7088('0x2d')];if(!_0x51f606[_0x7088('0x2e')][_0x7088('0x32')](_0x7088('0x33'))){_0x1ea5d7[_0x7088('0x1b')]=qs[_0x7088('0x1b')](_0x51f606[_0x7088('0x2e')]['limit']);_0x1ea5d7[_0x7088('0x19')]=qs[_0x7088('0x19')](_0x51f606[_0x7088('0x2e')]['offset']);}_0x1ea5d7[_0x7088('0x34')]=qs['sort'](_0x51f606[_0x7088('0x2e')][_0x7088('0x35')]);_0x1ea5d7['where']=qs[_0x7088('0x36')](_[_0x7088('0x37')](_0x51f606[_0x7088('0x2e')],_0x1cb476[_0x7088('0x36')]),_0xa70cef);if(_0x51f606[_0x7088('0x2e')]['filter']){_0x1ea5d7['where']=_[_0x7088('0x38')](_0x1ea5d7[_0x7088('0x39')],{'$or':_[_0x7088('0x29')](_0xa70cef,function(_0x23d6be){if(_0x23d6be[_0x7088('0x2b')]!==_0x7088('0x3a')){var _0x3f5826={};_0x3f5826[_0x23d6be[_0x7088('0x26')]]={'$like':'%'+_0x51f606[_0x7088('0x2e')][_0x7088('0x3b')]+'%'};return _0x3f5826;}})});}_0x1ea5d7=_[_0x7088('0x38')]({},_0x1ea5d7,_0x51f606[_0x7088('0x3c')]);var _0x361a8c={'where':_0x1ea5d7['where']};return db['MailServerOut'][_0x7088('0x1c')](_0x361a8c)[_0x7088('0x22')](function(_0x12f60e){_0x26e3fd[_0x7088('0x1c')]=_0x12f60e;if(_0x51f606[_0x7088('0x2e')]['includeAll']){_0x1ea5d7[_0x7088('0x3d')]=[{'all':!![]}];}return db[_0x7088('0x2a')][_0x7088('0x3e')](_0x1ea5d7);})[_0x7088('0x22')](function(_0x504196){_0x26e3fd[_0x7088('0x3f')]=_0x504196;return _0x26e3fd;})[_0x7088('0x22')](respondWithFilteredResult(_0x129dea,_0x1ea5d7))[_0x7088('0x40')](handleError(_0x129dea,null));};exports['show']=function(_0x476cec,_0x5bfc59){var _0x1353b7={'raw':!![],'where':{'id':_0x476cec[_0x7088('0x41')]['id']}},_0x4bf0be={};_0x4bf0be['model']=_[_0x7088('0x42')](db['MailServerOut'][_0x7088('0x43')]);_0x4bf0be[_0x7088('0x2e')]=_[_0x7088('0x42')](_0x476cec[_0x7088('0x2e')]);_0x4bf0be['filters']=_[_0x7088('0x2f')](_0x4bf0be[_0x7088('0x2d')],_0x4bf0be[_0x7088('0x2e')]);_0x1353b7['attributes']=_[_0x7088('0x2f')](_0x4bf0be[_0x7088('0x2d')],qs[_0x7088('0x31')](_0x476cec['query'][_0x7088('0x31')]));_0x1353b7['attributes']=_0x1353b7['attributes'][_0x7088('0x44')]?_0x1353b7[_0x7088('0x30')]:_0x4bf0be[_0x7088('0x2d')];if(_0x476cec[_0x7088('0x2e')][_0x7088('0x45')]){_0x1353b7[_0x7088('0x3d')]=[{'all':!![]}];}_0x1353b7=_[_0x7088('0x38')]({},_0x1353b7,_0x476cec[_0x7088('0x3c')]);return db[_0x7088('0x2a')][_0x7088('0x46')](_0x1353b7)['then'](handleEntityNotFound(_0x5bfc59,null))[_0x7088('0x22')](respondWithResult(_0x5bfc59,null))['catch'](handleError(_0x5bfc59,null));};exports[_0x7088('0x47')]=function(_0x58b38d,_0x2dc669){return db[_0x7088('0x2a')][_0x7088('0x47')](_0x58b38d['body'],{})[_0x7088('0x22')](respondWithResult(_0x2dc669,0xc9))['catch'](handleError(_0x2dc669,null));};exports[_0x7088('0x21')]=function(_0x4827a6,_0xa11ecf){if(_0x4827a6['body']['id']){delete _0x4827a6['body']['id'];}return db['MailServerOut']['find']({'where':{'id':_0x4827a6[_0x7088('0x41')]['id']}})['then'](handleEntityNotFound(_0xa11ecf,null))[_0x7088('0x22')](saveUpdates(_0x4827a6[_0x7088('0x48')],null))[_0x7088('0x22')](respondWithResult(_0xa11ecf,null))[_0x7088('0x40')](handleError(_0xa11ecf,null));};exports[_0x7088('0x23')]=function(_0x3d5396,_0x35420b){return db['MailServerOut']['find']({'where':{'id':_0x3d5396[_0x7088('0x41')]['id']}})[_0x7088('0x22')](handleEntityNotFound(_0x35420b,null))[_0x7088('0x22')](removeEntity(_0x35420b,null))[_0x7088('0x40')](handleError(_0x35420b,null));};
\ No newline at end of file
index f0ddcaa..3d25eb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4b6=['./mailServerOut.attributes','exports','mail_servers_out','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x2b3a98,_0x3796c6){var _0xdf53c0=function(_0x2aac80){while(--_0x2aac80){_0x2b3a98['push'](_0x2b3a98['shift']());}};_0xdf53c0(++_0x3796c6);}(_0xf4b6,0x12f));var _0x6f4b=function(_0x371663,_0x128d92){_0x371663=_0x371663-0x0;var _0x5a3187=_0xf4b6[_0x371663];return _0x5a3187;};'use strict';var _=require(_0x6f4b('0x0'));var util=require(_0x6f4b('0x1'));var logger=require('../../config/logger')(_0x6f4b('0x2'));var moment=require(_0x6f4b('0x3'));var BPromise=require(_0x6f4b('0x4'));var rp=require(_0x6f4b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f4b('0x6'));var config=require('../../config/environment');var attributes=require(_0x6f4b('0x7'));module[_0x6f4b('0x8')]=function(_0x11c3dc,_0x5a9ea8){return _0x11c3dc['define']('MailServerOut',attributes,{'tableName':_0x6f4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x90f2=['mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut'];(function(_0x3d0d25,_0x108611){var _0x3973d1=function(_0x2231f3){while(--_0x2231f3){_0x3d0d25['push'](_0x3d0d25['shift']());}};_0x3973d1(++_0x108611);}(_0x90f2,0x9b));var _0x290f=function(_0x4a0434,_0x52c3d1){_0x4a0434=_0x4a0434-0x0;var _0x52dccb=_0x90f2[_0x4a0434];return _0x52dccb;};'use strict';var _=require(_0x290f('0x0'));var util=require('util');var logger=require(_0x290f('0x1'))(_0x290f('0x2'));var moment=require(_0x290f('0x3'));var BPromise=require(_0x290f('0x4'));var rp=require(_0x290f('0x5'));var fs=require('fs');var path=require(_0x290f('0x6'));var rimraf=require(_0x290f('0x7'));var config=require(_0x290f('0x8'));var attributes=require(_0x290f('0x9'));module[_0x290f('0xa')]=function(_0x1dfc97,_0x17546c){return _0x1dfc97[_0x290f('0xb')](_0x290f('0xc'),attributes,{'tableName':_0x290f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3f7d213..0485115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x59b236,_0x237e88){_0x59b236=_0x59b236-0x0;var _0x3d8a5e=_0x7a54[_0x59b236];return _0x3d8a5e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x1dde4d,_0xf1b0f){var _0x52b658=function(_0x1b2669){while(--_0x1b2669){_0x1dde4d['push'](_0x1dde4d['shift']());}};_0x52b658(++_0xf1b0f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'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});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
index 34adf49..dfdf431 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbded=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete'];(function(_0x20e7e9,_0x257630){var _0x23f422=function(_0x152b7a){while(--_0x152b7a){_0x20e7e9['push'](_0x20e7e9['shift']());}};_0x23f422(++_0x257630);}(_0xbded,0x190));var _0xdbde=function(_0x4e2655,_0x9bf64c){_0x4e2655=_0x4e2655-0x0;var _0x46f614=_0xbded[_0x4e2655];return _0x46f614;};'use strict';var multer=require(_0xdbde('0x0'));var util=require(_0xdbde('0x1'));var path=require(_0xdbde('0x2'));var timeout=require(_0xdbde('0x3'));var express=require(_0xdbde('0x4'));var router=express[_0xdbde('0x5')]();var fs_extra=require(_0xdbde('0x6'));var auth=require(_0xdbde('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdbde('0x8'));var controller=require(_0xdbde('0x9'));router[_0xdbde('0xa')]('/',auth['isAuthenticated'](),controller[_0xdbde('0xb')]);router[_0xdbde('0xa')](_0xdbde('0xc'),auth[_0xdbde('0xd')](),controller[_0xdbde('0xe')]);router[_0xdbde('0xa')](_0xdbde('0xf'),auth[_0xdbde('0xd')](),controller[_0xdbde('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdbde('0x11')](_0xdbde('0xf'),auth[_0xdbde('0xd')](),controller[_0xdbde('0x12')]);router[_0xdbde('0x13')]('/:id',auth[_0xdbde('0xd')](),controller[_0xdbde('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x4a05=['index','/describe','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get'];(function(_0x5d683e,_0x386a3b){var _0x52805f=function(_0x490930){while(--_0x490930){_0x5d683e['push'](_0x5d683e['shift']());}};_0x52805f(++_0x386a3b);}(_0x4a05,0x15e));var _0x54a0=function(_0x1a64f3,_0x4b2b6b){_0x1a64f3=_0x1a64f3-0x0;var _0x37d68f=_0x4a05[_0x1a64f3];return _0x37d68f;};'use strict';var multer=require(_0x54a0('0x0'));var util=require('util');var path=require(_0x54a0('0x1'));var timeout=require(_0x54a0('0x2'));var express=require(_0x54a0('0x3'));var router=express[_0x54a0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x54a0('0x5'));var interaction=require(_0x54a0('0x6'));var config=require(_0x54a0('0x7'));var controller=require(_0x54a0('0x8'));router[_0x54a0('0x9')]('/',auth['isAuthenticated'](),controller[_0x54a0('0xa')]);router[_0x54a0('0x9')](_0x54a0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x54a0('0x9')](_0x54a0('0xc'),auth[_0x54a0('0xd')](),controller[_0x54a0('0xe')]);router[_0x54a0('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x54a0('0x10')](_0x54a0('0xc'),auth[_0x54a0('0xd')](),controller['update']);router[_0x54a0('0x11')](_0x54a0('0xc'),auth[_0x54a0('0xd')](),controller[_0x54a0('0x12')]);module[_0x54a0('0x13')]=router;
\ No newline at end of file
index 53f05b4..e588911 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31c2=['name','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31c2,0x1e1));var _0x231c=function(_0x5a1efb,_0x375ad8){_0x5a1efb=_0x5a1efb-0x0;var _0x1eae1a=_0x31c2[_0x5a1efb];return _0x1eae1a;};'use strict';var Sequelize=require(_0x231c('0x0'));module[_0x231c('0x1')]={'name':{'type':Sequelize[_0x231c('0x2')],'unique':_0x231c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x231c('0x2')]}};
\ No newline at end of file
+var _0xa46e=['name','STRING','sequelize','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa46e,0x8a));var _0xea46=function(_0x122d9f,_0x2c9e5b){_0x122d9f=_0x122d9f-0x0;var _0x41a09e=_0xa46e[_0x122d9f];return _0x41a09e;};'use strict';var Sequelize=require(_0xea46('0x0'));module[_0xea46('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xea46('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xea46('0x3')]}};
\ No newline at end of file
index a4cede4..052329d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf35e=['status','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','MailSubstatus','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','where','options','findAll','catch','params','includeAll','include','merge','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0xf35e,0x6b));var _0xef35=function(_0x3acd08,_0x40e4e4){_0x3acd08=_0x3acd08-0x0;var _0x312622=_0xf35e[_0x3acd08];return _0x312622;};'use strict';var emlformat=require(_0xef35('0x0'));var rimraf=require(_0xef35('0x1'));var zipdir=require(_0xef35('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef35('0x3'));var moment=require(_0xef35('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xef35('0x5'));var util=require(_0xef35('0x6'));var path=require(_0xef35('0x7'));var sox=require(_0xef35('0x8'));var csv=require(_0xef35('0x9'));var ejs=require(_0xef35('0xa'));var fs=require('fs');var fs_extra=require(_0xef35('0xb'));var _=require(_0xef35('0xc'));var squel=require('squel');var crypto=require(_0xef35('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xef35('0xe'));var toCsv=require(_0xef35('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xef35('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xef35('0x10'));var hardwareService=require(_0xef35('0x11'));var logger=require(_0xef35('0x12'))('api');var utils=require(_0xef35('0x13'));var config=require(_0xef35('0x14'));var licenseUtil=require(_0xef35('0x15'));var db=require(_0xef35('0x16'))['db'];function respondWithStatusCode(_0x254231,_0x577682){_0x577682=_0x577682||0xcc;return function(_0x51dbf2){if(_0x51dbf2){return _0x254231[_0xef35('0x17')](_0x577682);}return _0x254231['status'](_0x577682)[_0xef35('0x18')]();};}function respondWithResult(_0x50a752,_0x47d8c9){_0x47d8c9=_0x47d8c9||0xc8;return function(_0x75e34c){if(_0x75e34c){return _0x50a752[_0xef35('0x19')](_0x47d8c9)[_0xef35('0x1a')](_0x75e34c);}};}function respondWithFilteredResult(_0xf78de2,_0x4489fc){return function(_0x5e414e){if(_0x5e414e){var _0x4c5747=typeof _0x4489fc[_0xef35('0x1b')]===_0xef35('0x1c')&&typeof _0x4489fc[_0xef35('0x1d')]===_0xef35('0x1c');var _0x275b1b=_0x5e414e[_0xef35('0x1e')];var _0x4bcb69=_0x4c5747?0x0:_0x4489fc['offset'];var _0x46fc15=_0x4c5747?_0x5e414e[_0xef35('0x1e')]:_0x4489fc[_0xef35('0x1b')]+_0x4489fc[_0xef35('0x1d')];var _0x130c8e;if(_0x46fc15>=_0x275b1b){_0x46fc15=_0x275b1b;_0x130c8e=0xc8;}else{_0x130c8e=0xce;}_0xf78de2['status'](_0x130c8e);return _0xf78de2[_0xef35('0x1f')]('Content-Range',_0x4bcb69+'-'+_0x46fc15+'/'+_0x275b1b)[_0xef35('0x1a')](_0x5e414e);}return null;};}function patchUpdates(_0x18308a){return function(_0x4c1b22){try{jsonpatch[_0xef35('0x20')](_0x4c1b22,_0x18308a,!![]);}catch(_0x370cbb){return BPromise[_0xef35('0x21')](_0x370cbb);}return _0x4c1b22['save']();};}function saveUpdates(_0x49a807,_0x3874b9){return function(_0x21969f){if(_0x21969f){return _0x21969f[_0xef35('0x22')](_0x49a807)[_0xef35('0x23')](function(_0xa3e87d){return _0xa3e87d;});}return null;};}function removeEntity(_0x16b468,_0x421666){return function(_0x5df98b){if(_0x5df98b){return _0x5df98b['destroy']()[_0xef35('0x23')](function(){_0x16b468['status'](0xcc)[_0xef35('0x18')]();});}};}function handleEntityNotFound(_0x37ce2c,_0x5d5582){return function(_0x52d07e){if(!_0x52d07e){_0x37ce2c[_0xef35('0x17')](0x194);}return _0x52d07e;};}function handleError(_0x562476,_0x422606){_0x422606=_0x422606||0x1f4;return function(_0x1ba95d){logger[_0xef35('0x24')](_0x1ba95d[_0xef35('0x25')]);if(_0x1ba95d[_0xef35('0x26')]){delete _0x1ba95d[_0xef35('0x26')];}_0x562476[_0xef35('0x19')](_0x422606)['send'](_0x1ba95d);};}exports['index']=function(_0x101b4b,_0x5ef129){var _0x359dfc={},_0x573ed3={},_0x2b0c4d={'count':0x0,'rows':[]};var _0x4b2926=_['map'](db[_0xef35('0x27')][_0xef35('0x28')],function(_0x22ebe3){return{'name':_0x22ebe3[_0xef35('0x29')],'type':_0x22ebe3['type']['key']};});_0x573ed3[_0xef35('0x2a')]=_['map'](_0x4b2926,_0xef35('0x26'));_0x573ed3[_0xef35('0x2b')]=_[_0xef35('0x2c')](_0x101b4b[_0xef35('0x2b')]);_0x573ed3[_0xef35('0x2d')]=_['intersection'](_0x573ed3[_0xef35('0x2a')],_0x573ed3['query']);_0x359dfc[_0xef35('0x2e')]=_[_0xef35('0x2f')](_0x573ed3[_0xef35('0x2a')],qs[_0xef35('0x30')](_0x101b4b[_0xef35('0x2b')][_0xef35('0x30')]));_0x359dfc[_0xef35('0x2e')]=_0x359dfc[_0xef35('0x2e')][_0xef35('0x31')]?_0x359dfc[_0xef35('0x2e')]:_0x573ed3[_0xef35('0x2a')];if(!_0x101b4b[_0xef35('0x2b')]['hasOwnProperty'](_0xef35('0x32'))){_0x359dfc['limit']=qs[_0xef35('0x1d')](_0x101b4b[_0xef35('0x2b')]['limit']);_0x359dfc[_0xef35('0x1b')]=qs[_0xef35('0x1b')](_0x101b4b[_0xef35('0x2b')]['offset']);}_0x359dfc[_0xef35('0x33')]=qs['sort'](_0x101b4b[_0xef35('0x2b')][_0xef35('0x34')]);_0x359dfc['where']=qs[_0xef35('0x2d')](_['pick'](_0x101b4b[_0xef35('0x2b')],_0x573ed3[_0xef35('0x2d')]),_0x4b2926);if(_0x101b4b[_0xef35('0x2b')][_0xef35('0x35')]){_0x359dfc[_0xef35('0x36')]=_['merge'](_0x359dfc[_0xef35('0x36')],{'$or':_['map'](_0x4b2926,function(_0x3ae626){if(_0x3ae626['type']!=='VIRTUAL'){var _0x3c930d={};_0x3c930d[_0x3ae626[_0xef35('0x26')]]={'$like':'%'+_0x101b4b['query']['filter']+'%'};return _0x3c930d;}})});}_0x359dfc=_['merge']({},_0x359dfc,_0x101b4b[_0xef35('0x37')]);var _0x1b7039={'where':_0x359dfc[_0xef35('0x36')]};return db[_0xef35('0x27')][_0xef35('0x1e')](_0x1b7039)['then'](function(_0x4da829){_0x2b0c4d[_0xef35('0x1e')]=_0x4da829;if(_0x101b4b[_0xef35('0x2b')]['includeAll']){_0x359dfc['include']=[{'all':!![]}];}return db[_0xef35('0x27')][_0xef35('0x38')](_0x359dfc);})[_0xef35('0x23')](function(_0x4454a4){_0x2b0c4d['rows']=_0x4454a4;return _0x2b0c4d;})['then'](respondWithFilteredResult(_0x5ef129,_0x359dfc))[_0xef35('0x39')](handleError(_0x5ef129,null));};exports['show']=function(_0x517bf8,_0x1bea22){var _0x281dbb={'raw':!![],'where':{'id':_0x517bf8[_0xef35('0x3a')]['id']}},_0x7668c7={};_0x7668c7[_0xef35('0x2a')]=_[_0xef35('0x2c')](db['MailSubstatus']['rawAttributes']);_0x7668c7[_0xef35('0x2b')]=_[_0xef35('0x2c')](_0x517bf8[_0xef35('0x2b')]);_0x7668c7['filters']=_[_0xef35('0x2f')](_0x7668c7[_0xef35('0x2a')],_0x7668c7[_0xef35('0x2b')]);_0x281dbb[_0xef35('0x2e')]=_[_0xef35('0x2f')](_0x7668c7[_0xef35('0x2a')],qs[_0xef35('0x30')](_0x517bf8[_0xef35('0x2b')]['fields']));_0x281dbb[_0xef35('0x2e')]=_0x281dbb[_0xef35('0x2e')][_0xef35('0x31')]?_0x281dbb['attributes']:_0x7668c7['model'];if(_0x517bf8[_0xef35('0x2b')][_0xef35('0x3b')]){_0x281dbb[_0xef35('0x3c')]=[{'all':!![]}];}_0x281dbb=_[_0xef35('0x3d')]({},_0x281dbb,_0x517bf8['options']);return db[_0xef35('0x27')][_0xef35('0x3e')](_0x281dbb)[_0xef35('0x23')](handleEntityNotFound(_0x1bea22,null))[_0xef35('0x23')](respondWithResult(_0x1bea22,null))[_0xef35('0x39')](handleError(_0x1bea22,null));};exports[_0xef35('0x3f')]=function(_0x1f4f39,_0x53ca50){return db[_0xef35('0x27')][_0xef35('0x3f')](_0x1f4f39['body'],{})[_0xef35('0x23')](respondWithResult(_0x53ca50,0xc9))[_0xef35('0x39')](handleError(_0x53ca50,null));};exports[_0xef35('0x22')]=function(_0x35b210,_0x53fa8a){if(_0x35b210[_0xef35('0x40')]['id']){delete _0x35b210[_0xef35('0x40')]['id'];}return db[_0xef35('0x27')][_0xef35('0x3e')]({'where':{'id':_0x35b210['params']['id']}})[_0xef35('0x23')](handleEntityNotFound(_0x53fa8a,null))[_0xef35('0x23')](saveUpdates(_0x35b210[_0xef35('0x40')],null))['then'](respondWithResult(_0x53fa8a,null))[_0xef35('0x39')](handleError(_0x53fa8a,null));};exports['destroy']=function(_0x327863,_0x3cc229){return db[_0xef35('0x27')][_0xef35('0x3e')]({'where':{'id':_0x327863[_0xef35('0x3a')]['id']}})[_0xef35('0x23')](handleEntityNotFound(_0x3cc229,null))['then'](removeEntity(_0x3cc229,null))[_0xef35('0x39')](handleError(_0x3cc229,null));};exports['describe']=function(_0x36155a,_0x22be2b){return db[_0xef35('0x27')][_0xef35('0x41')]()[_0xef35('0x23')](respondWithResult(_0x22be2b,null))[_0xef35('0x39')](handleError(_0x22be2b,null));};
\ No newline at end of file
+var _0x76d4=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x331fb4,_0x41fff7){var _0x4c3eab=function(_0x1126ae){while(--_0x1126ae){_0x331fb4['push'](_0x331fb4['shift']());}};_0x4c3eab(++_0x41fff7);}(_0x76d4,0x16a));var _0x476d=function(_0x127ddf,_0x166f90){_0x127ddf=_0x127ddf-0x0;var _0x520c50=_0x76d4[_0x127ddf];return _0x520c50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x476d('0x0'));var zipdir=require(_0x476d('0x1'));var jsonpatch=require(_0x476d('0x2'));var rp=require(_0x476d('0x3'));var moment=require(_0x476d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x476d('0x5'));var path=require(_0x476d('0x6'));var sox=require('sox');var csv=require(_0x476d('0x7'));var ejs=require(_0x476d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x476d('0x9'));var crypto=require(_0x476d('0xa'));var jsforce=require(_0x476d('0xb'));var deskjs=require(_0x476d('0xc'));var toCsv=require(_0x476d('0x7'));var querystring=require('querystring');var Papa=require(_0x476d('0xd'));var Redis=require('ioredis');var authService=require(_0x476d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x476d('0xf'));var hardwareService=require(_0x476d('0x10'));var logger=require(_0x476d('0x11'))(_0x476d('0x12'));var utils=require(_0x476d('0x13'));var config=require(_0x476d('0x14'));var licenseUtil=require(_0x476d('0x15'));var db=require(_0x476d('0x16'))['db'];function respondWithStatusCode(_0x1c838a,_0x3cfe23){_0x3cfe23=_0x3cfe23||0xcc;return function(_0x335a29){if(_0x335a29){return _0x1c838a[_0x476d('0x17')](_0x3cfe23);}return _0x1c838a['status'](_0x3cfe23)[_0x476d('0x18')]();};}function respondWithResult(_0x87a74,_0xf24e1d){_0xf24e1d=_0xf24e1d||0xc8;return function(_0x301a2f){if(_0x301a2f){return _0x87a74[_0x476d('0x19')](_0xf24e1d)[_0x476d('0x1a')](_0x301a2f);}};}function respondWithFilteredResult(_0x573a2e,_0x522f6c){return function(_0x369140){if(_0x369140){var _0x4c34f4=typeof _0x522f6c[_0x476d('0x1b')]===_0x476d('0x1c')&&typeof _0x522f6c[_0x476d('0x1d')]===_0x476d('0x1c');var _0xf081c5=_0x369140[_0x476d('0x1e')];var _0x1bfecf=_0x4c34f4?0x0:_0x522f6c['offset'];var _0x333a4f=_0x4c34f4?_0x369140['count']:_0x522f6c[_0x476d('0x1b')]+_0x522f6c[_0x476d('0x1d')];var _0x385838;if(_0x333a4f>=_0xf081c5){_0x333a4f=_0xf081c5;_0x385838=0xc8;}else{_0x385838=0xce;}_0x573a2e['status'](_0x385838);return _0x573a2e['set'](_0x476d('0x1f'),_0x1bfecf+'-'+_0x333a4f+'/'+_0xf081c5)[_0x476d('0x1a')](_0x369140);}return null;};}function patchUpdates(_0x352756){return function(_0x3be103){try{jsonpatch[_0x476d('0x20')](_0x3be103,_0x352756,!![]);}catch(_0xc150d){return BPromise[_0x476d('0x21')](_0xc150d);}return _0x3be103[_0x476d('0x22')]();};}function saveUpdates(_0x11ab3b,_0x52f652){return function(_0x502d59){if(_0x502d59){return _0x502d59[_0x476d('0x23')](_0x11ab3b)[_0x476d('0x24')](function(_0x25c8d7){return _0x25c8d7;});}return null;};}function removeEntity(_0x28243f,_0x474902){return function(_0x340175){if(_0x340175){return _0x340175['destroy']()[_0x476d('0x24')](function(){_0x28243f[_0x476d('0x19')](0xcc)[_0x476d('0x18')]();});}};}function handleEntityNotFound(_0x2ef09f,_0x12c053){return function(_0x47754c){if(!_0x47754c){_0x2ef09f[_0x476d('0x17')](0x194);}return _0x47754c;};}function handleError(_0x4caa6a,_0x4b1e60){_0x4b1e60=_0x4b1e60||0x1f4;return function(_0x46ea6e){logger['error'](_0x46ea6e[_0x476d('0x25')]);if(_0x46ea6e[_0x476d('0x26')]){delete _0x46ea6e[_0x476d('0x26')];}_0x4caa6a[_0x476d('0x19')](_0x4b1e60)[_0x476d('0x27')](_0x46ea6e);};}exports[_0x476d('0x28')]=function(_0x5bd2c6,_0x5453e7){var _0x2dc69b={},_0x4b956b={},_0x1bd7b0={'count':0x0,'rows':[]};var _0xded95b=_['map'](db[_0x476d('0x29')][_0x476d('0x2a')],function(_0xec6dfd){return{'name':_0xec6dfd[_0x476d('0x2b')],'type':_0xec6dfd[_0x476d('0x2c')]['key']};});_0x4b956b[_0x476d('0x2d')]=_[_0x476d('0x2e')](_0xded95b,_0x476d('0x26'));_0x4b956b[_0x476d('0x2f')]=_['keys'](_0x5bd2c6[_0x476d('0x2f')]);_0x4b956b['filters']=_['intersection'](_0x4b956b[_0x476d('0x2d')],_0x4b956b[_0x476d('0x2f')]);_0x2dc69b[_0x476d('0x30')]=_[_0x476d('0x31')](_0x4b956b[_0x476d('0x2d')],qs[_0x476d('0x32')](_0x5bd2c6[_0x476d('0x2f')][_0x476d('0x32')]));_0x2dc69b[_0x476d('0x30')]=_0x2dc69b['attributes']['length']?_0x2dc69b[_0x476d('0x30')]:_0x4b956b[_0x476d('0x2d')];if(!_0x5bd2c6[_0x476d('0x2f')][_0x476d('0x33')](_0x476d('0x34'))){_0x2dc69b[_0x476d('0x1d')]=qs[_0x476d('0x1d')](_0x5bd2c6[_0x476d('0x2f')][_0x476d('0x1d')]);_0x2dc69b[_0x476d('0x1b')]=qs[_0x476d('0x1b')](_0x5bd2c6['query'][_0x476d('0x1b')]);}_0x2dc69b[_0x476d('0x35')]=qs[_0x476d('0x36')](_0x5bd2c6['query'][_0x476d('0x36')]);_0x2dc69b[_0x476d('0x37')]=qs[_0x476d('0x38')](_[_0x476d('0x39')](_0x5bd2c6['query'],_0x4b956b[_0x476d('0x38')]),_0xded95b);if(_0x5bd2c6[_0x476d('0x2f')][_0x476d('0x3a')]){_0x2dc69b['where']=_[_0x476d('0x3b')](_0x2dc69b[_0x476d('0x37')],{'$or':_['map'](_0xded95b,function(_0x5326ae){if(_0x5326ae[_0x476d('0x2c')]!==_0x476d('0x3c')){var _0x3e4686={};_0x3e4686[_0x5326ae[_0x476d('0x26')]]={'$like':'%'+_0x5bd2c6['query'][_0x476d('0x3a')]+'%'};return _0x3e4686;}})});}_0x2dc69b=_[_0x476d('0x3b')]({},_0x2dc69b,_0x5bd2c6[_0x476d('0x3d')]);var _0x3aef3f={'where':_0x2dc69b[_0x476d('0x37')]};return db[_0x476d('0x29')][_0x476d('0x1e')](_0x3aef3f)[_0x476d('0x24')](function(_0x432550){_0x1bd7b0[_0x476d('0x1e')]=_0x432550;if(_0x5bd2c6[_0x476d('0x2f')][_0x476d('0x3e')]){_0x2dc69b[_0x476d('0x3f')]=[{'all':!![]}];}return db[_0x476d('0x29')][_0x476d('0x40')](_0x2dc69b);})[_0x476d('0x24')](function(_0x535ea0){_0x1bd7b0[_0x476d('0x41')]=_0x535ea0;return _0x1bd7b0;})[_0x476d('0x24')](respondWithFilteredResult(_0x5453e7,_0x2dc69b))[_0x476d('0x42')](handleError(_0x5453e7,null));};exports[_0x476d('0x43')]=function(_0xdb6457,_0x5c9be3){var _0x1163ab={'raw':!![],'where':{'id':_0xdb6457[_0x476d('0x44')]['id']}},_0x41a4f1={};_0x41a4f1[_0x476d('0x2d')]=_[_0x476d('0x45')](db[_0x476d('0x29')][_0x476d('0x2a')]);_0x41a4f1['query']=_['keys'](_0xdb6457['query']);_0x41a4f1[_0x476d('0x38')]=_['intersection'](_0x41a4f1[_0x476d('0x2d')],_0x41a4f1[_0x476d('0x2f')]);_0x1163ab[_0x476d('0x30')]=_[_0x476d('0x31')](_0x41a4f1[_0x476d('0x2d')],qs[_0x476d('0x32')](_0xdb6457[_0x476d('0x2f')][_0x476d('0x32')]));_0x1163ab[_0x476d('0x30')]=_0x1163ab[_0x476d('0x30')][_0x476d('0x46')]?_0x1163ab['attributes']:_0x41a4f1[_0x476d('0x2d')];if(_0xdb6457[_0x476d('0x2f')][_0x476d('0x3e')]){_0x1163ab[_0x476d('0x3f')]=[{'all':!![]}];}_0x1163ab=_[_0x476d('0x3b')]({},_0x1163ab,_0xdb6457[_0x476d('0x3d')]);return db[_0x476d('0x29')][_0x476d('0x47')](_0x1163ab)[_0x476d('0x24')](handleEntityNotFound(_0x5c9be3,null))[_0x476d('0x24')](respondWithResult(_0x5c9be3,null))['catch'](handleError(_0x5c9be3,null));};exports[_0x476d('0x48')]=function(_0x1a84af,_0x32a82a){return db[_0x476d('0x29')][_0x476d('0x48')](_0x1a84af[_0x476d('0x49')],{})[_0x476d('0x24')](respondWithResult(_0x32a82a,0xc9))['catch'](handleError(_0x32a82a,null));};exports[_0x476d('0x23')]=function(_0x51cc85,_0x5061ea){if(_0x51cc85[_0x476d('0x49')]['id']){delete _0x51cc85[_0x476d('0x49')]['id'];}return db[_0x476d('0x29')][_0x476d('0x47')]({'where':{'id':_0x51cc85[_0x476d('0x44')]['id']}})[_0x476d('0x24')](handleEntityNotFound(_0x5061ea,null))[_0x476d('0x24')](saveUpdates(_0x51cc85['body'],null))[_0x476d('0x24')](respondWithResult(_0x5061ea,null))[_0x476d('0x42')](handleError(_0x5061ea,null));};exports[_0x476d('0x4a')]=function(_0x2a66a1,_0x3ad5d6){return db['MailSubstatus'][_0x476d('0x47')]({'where':{'id':_0x2a66a1['params']['id']}})['then'](handleEntityNotFound(_0x3ad5d6,null))[_0x476d('0x24')](removeEntity(_0x3ad5d6,null))['catch'](handleError(_0x3ad5d6,null));};exports['describe']=function(_0x587547,_0xf62dd6){return db[_0x476d('0x29')][_0x476d('0x4b')]()[_0x476d('0x24')](respondWithResult(_0xf62dd6,null))[_0x476d('0x42')](handleError(_0xf62dd6,null));};
\ No newline at end of file
index 9a365ec..d968c26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf641=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailSubstatus','mail_substatuses'];(function(_0x117c9b,_0x114c98){var _0x38afbb=function(_0x278487){while(--_0x278487){_0x117c9b['push'](_0x117c9b['shift']());}};_0x38afbb(++_0x114c98);}(_0xf641,0x1ba));var _0x1f64=function(_0x19b895,_0x16e49a){_0x19b895=_0x19b895-0x0;var _0x1b2de8=_0xf641[_0x19b895];return _0x1b2de8;};'use strict';var _=require('lodash');var util=require(_0x1f64('0x0'));var logger=require(_0x1f64('0x1'))(_0x1f64('0x2'));var moment=require(_0x1f64('0x3'));var BPromise=require(_0x1f64('0x4'));var rp=require(_0x1f64('0x5'));var fs=require('fs');var path=require(_0x1f64('0x6'));var rimraf=require(_0x1f64('0x7'));var config=require(_0x1f64('0x8'));var attributes=require('./mailSubstatus.attributes');module[_0x1f64('0x9')]=function(_0x5af73a,_0x159168){return _0x5af73a[_0x1f64('0xa')](_0x1f64('0xb'),attributes,{'tableName':_0x1f64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9ba=['path','../../config/environment','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3416e2,_0x5dc708){var _0x449d73=function(_0x1ab5ff){while(--_0x1ab5ff){_0x3416e2['push'](_0x3416e2['shift']());}};_0x449d73(++_0x5dc708);}(_0xa9ba,0x72));var _0xaa9b=function(_0x58d0b6,_0x109f8e){_0x58d0b6=_0x58d0b6-0x0;var _0x5f1a56=_0xa9ba[_0x58d0b6];return _0x5f1a56;};'use strict';var _=require(_0xaa9b('0x0'));var util=require(_0xaa9b('0x1'));var logger=require(_0xaa9b('0x2'))(_0xaa9b('0x3'));var moment=require('moment');var BPromise=require(_0xaa9b('0x4'));var rp=require(_0xaa9b('0x5'));var fs=require('fs');var path=require(_0xaa9b('0x6'));var rimraf=require('rimraf');var config=require(_0xaa9b('0x7'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x21b283,_0x52f336){return _0x21b283['define'](_0xaa9b('0x8'),attributes,{'tableName':_0xaa9b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 31dd343..55abde4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4556=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4556,0x8f));var _0x6455=function(_0x1df814,_0x5d8fba){_0x1df814=_0x1df814-0x0;var _0x4749a1=_0x4556[_0x1df814];return _0x4749a1;};'use strict';var _=require(_0x6455('0x0'));var util=require('util');var moment=require(_0x6455('0x1'));var BPromise=require(_0x6455('0x2'));var rs=require(_0x6455('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6455('0x4'))(_0x6455('0x5'));var config=require(_0x6455('0x6'));var jayson=require(_0x6455('0x7'));var client=jayson[_0x6455('0x8')][_0x6455('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x329b63,_0x429495,_0x37f5c5){return new BPromise(function(_0x296fc4,_0x214633){return client[_0x6455('0xa')](_0x329b63,_0x37f5c5)['then'](function(_0x21f5e7){logger[_0x6455('0xb')](_0x6455('0xc'),_0x429495,'request\x20sent');logger['debug'](_0x6455('0xd'),_0x429495,_0x6455('0xe'),JSON[_0x6455('0xf')](_0x21f5e7));if(_0x21f5e7[_0x6455('0x10')]){if(_0x21f5e7[_0x6455('0x10')][_0x6455('0x11')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x429495,_0x21f5e7['error']['message']);return _0x214633(_0x21f5e7['error']['message']);}logger['error'](_0x6455('0xc'),_0x429495,_0x21f5e7[_0x6455('0x10')][_0x6455('0x12')]);return _0x296fc4(_0x21f5e7[_0x6455('0x10')][_0x6455('0x12')]);}else{logger[_0x6455('0xb')](_0x6455('0xc'),_0x429495,_0x6455('0xe'));_0x296fc4(_0x21f5e7[_0x6455('0x13')][_0x6455('0x12')]);}})[_0x6455('0x14')](function(_0x45db9a){logger['error'](_0x6455('0xc'),_0x429495,_0x45db9a);_0x214633(_0x45db9a);});});}
\ No newline at end of file
+var _0x5eb6=['request','then','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http'];(function(_0x3dc5e5,_0x3fa983){var _0x363b4b=function(_0x13e27a){while(--_0x13e27a){_0x3dc5e5['push'](_0x3dc5e5['shift']());}};_0x363b4b(++_0x3fa983);}(_0x5eb6,0x11e));var _0x65eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5eb6[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x65eb('0x0'));var util=require(_0x65eb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x65eb('0x2'));var fs=require('fs');var Redis=require(_0x65eb('0x3'));var db=require(_0x65eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x65eb('0x5'));var config=require(_0x65eb('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x65eb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x330d6a,_0x2de1b0,_0x2e7c5d){return new BPromise(function(_0x151bdb,_0x42dab6){return client[_0x65eb('0x8')](_0x330d6a,_0x2e7c5d)[_0x65eb('0x9')](function(_0x47cdf8){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x2de1b0,_0x65eb('0xa'));logger[_0x65eb('0xb')](_0x65eb('0xc'),_0x2de1b0,_0x65eb('0xa'),JSON[_0x65eb('0xd')](_0x47cdf8));if(_0x47cdf8[_0x65eb('0xe')]){if(_0x47cdf8[_0x65eb('0xe')][_0x65eb('0xf')]===0x1f4){logger[_0x65eb('0xe')](_0x65eb('0x10'),_0x2de1b0,_0x47cdf8[_0x65eb('0xe')][_0x65eb('0x11')]);return _0x42dab6(_0x47cdf8[_0x65eb('0xe')][_0x65eb('0x11')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2de1b0,_0x47cdf8[_0x65eb('0xe')][_0x65eb('0x11')]);return _0x151bdb(_0x47cdf8[_0x65eb('0xe')]['message']);}else{logger[_0x65eb('0x12')](_0x65eb('0x10'),_0x2de1b0,_0x65eb('0xa'));_0x151bdb(_0x47cdf8[_0x65eb('0x13')]['message']);}})[_0x65eb('0x14')](function(_0x28955c){logger[_0x65eb('0xe')](_0x65eb('0x10'),_0x2de1b0,_0x28955c);_0x42dab6(_0x28955c);});});}
\ No newline at end of file
index 74b66b7..de58136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42e3=['index','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x3003b9,_0x55b172){var _0x173eaf=function(_0x4502ba){while(--_0x4502ba){_0x3003b9['push'](_0x3003b9['shift']());}};_0x173eaf(++_0x55b172);}(_0x42e3,0xb2));var _0x342e=function(_0x333b4b,_0x1d12af){_0x333b4b=_0x333b4b-0x0;var _0x29a73a=_0x42e3[_0x333b4b];return _0x29a73a;};'use strict';var multer=require(_0x342e('0x0'));var util=require('util');var path=require(_0x342e('0x1'));var timeout=require(_0x342e('0x2'));var express=require(_0x342e('0x3'));var router=express[_0x342e('0x4')]();var fs_extra=require(_0x342e('0x5'));var auth=require(_0x342e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x342e('0x7'));var controller=require(_0x342e('0x8'));router[_0x342e('0x9')]('/',auth[_0x342e('0xa')](),controller[_0x342e('0xb')]);router[_0x342e('0x9')](_0x342e('0xc'),auth[_0x342e('0xa')](),controller['describe']);router[_0x342e('0x9')](_0x342e('0xd'),auth[_0x342e('0xa')](),controller[_0x342e('0xe')]);router[_0x342e('0xf')]('/',auth[_0x342e('0xa')](),controller[_0x342e('0x10')]);router['put'](_0x342e('0xd'),auth[_0x342e('0xa')](),controller[_0x342e('0x11')]);router[_0x342e('0x12')](_0x342e('0xd'),auth['isAuthenticated'](),controller[_0x342e('0x13')]);module[_0x342e('0x14')]=router;
\ No newline at end of file
+var _0x7627=['/describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x538e2e,_0x2a24a5){var _0x3837dd=function(_0x30e061){while(--_0x30e061){_0x538e2e['push'](_0x538e2e['shift']());}};_0x3837dd(++_0x2a24a5);}(_0x7627,0x68));var _0x7762=function(_0x14e54a,_0x11c82b){_0x14e54a=_0x14e54a-0x0;var _0x3af15c=_0x7627[_0x14e54a];return _0x3af15c;};'use strict';var multer=require('multer');var util=require(_0x7762('0x0'));var path=require(_0x7762('0x1'));var timeout=require(_0x7762('0x2'));var express=require('express');var router=express[_0x7762('0x3')]();var fs_extra=require(_0x7762('0x4'));var auth=require(_0x7762('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7762('0x6'));var controller=require(_0x7762('0x7'));router[_0x7762('0x8')]('/',auth[_0x7762('0x9')](),controller['index']);router[_0x7762('0x8')](_0x7762('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7762('0x8')](_0x7762('0xb'),auth[_0x7762('0x9')](),controller[_0x7762('0xc')]);router[_0x7762('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7762('0xe')](_0x7762('0xb'),auth[_0x7762('0x9')](),controller[_0x7762('0xf')]);router[_0x7762('0x10')](_0x7762('0xb'),auth[_0x7762('0x9')](),controller[_0x7762('0x11')]);module[_0x7762('0x12')]=router;
\ No newline at end of file
index d348f14..9939b08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x32fab5,_0x1c3ea6){var _0x1983ea=function(_0x2c2289){while(--_0x2c2289){_0x32fab5['push'](_0x32fab5['shift']());}};_0x1983ea(++_0x1c3ea6);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x19e013,_0x5c74e0){var _0x58c128=function(_0x26aaf1){while(--_0x26aaf1){_0x19e013['push'](_0x19e013['shift']());}};_0x58c128(++_0x5c74e0);}(_0x4b84,0x1cc));var _0x44b8=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0x4b84[_0x43fdf8];return _0x1160c6;};'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 2abb771..84aaa6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x040a=['show','keys','length','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x169450,_0x4078e6){var _0xa6be39=function(_0xb91fc1){while(--_0xb91fc1){_0x169450['push'](_0x169450['shift']());}};_0xa6be39(++_0x4078e6);}(_0x040a,0x18f));var _0xa040=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0x040a[_0x46428c];return _0x16a677;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa040('0x0'));var zipdir=require(_0xa040('0x1'));var jsonpatch=require(_0xa040('0x2'));var rp=require(_0xa040('0x3'));var moment=require(_0xa040('0x4'));var BPromise=require(_0xa040('0x5'));var Mustache=require(_0xa040('0x6'));var util=require(_0xa040('0x7'));var path=require(_0xa040('0x8'));var sox=require(_0xa040('0x9'));var csv=require(_0xa040('0xa'));var ejs=require(_0xa040('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa040('0xc'));var squel=require('squel');var crypto=require(_0xa040('0xd'));var jsforce=require(_0xa040('0xe'));var deskjs=require(_0xa040('0xf'));var toCsv=require(_0xa040('0xa'));var querystring=require(_0xa040('0x10'));var Papa=require(_0xa040('0x11'));var Redis=require(_0xa040('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa040('0x13'));var as=require(_0xa040('0x14'));var hardwareService=require(_0xa040('0x15'));var logger=require(_0xa040('0x16'))('api');var utils=require(_0xa040('0x17'));var config=require(_0xa040('0x18'));var licenseUtil=require(_0xa040('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33c67d,_0x1250d0){_0x1250d0=_0x1250d0||0xcc;return function(_0x2c970e){if(_0x2c970e){return _0x33c67d[_0xa040('0x1a')](_0x1250d0);}return _0x33c67d[_0xa040('0x1b')](_0x1250d0)[_0xa040('0x1c')]();};}function respondWithResult(_0x56aa27,_0x3d8958){_0x3d8958=_0x3d8958||0xc8;return function(_0x36de01){if(_0x36de01){return _0x56aa27['status'](_0x3d8958)[_0xa040('0x1d')](_0x36de01);}};}function respondWithFilteredResult(_0x478727,_0x5965e9){return function(_0x23e400){if(_0x23e400){var _0x3d8b33=typeof _0x5965e9[_0xa040('0x1e')]===_0xa040('0x1f')&&typeof _0x5965e9[_0xa040('0x20')]===_0xa040('0x1f');var _0x1a7499=_0x23e400[_0xa040('0x21')];var _0x51d063=_0x3d8b33?0x0:_0x5965e9[_0xa040('0x1e')];var _0x3c4972=_0x3d8b33?_0x23e400[_0xa040('0x21')]:_0x5965e9[_0xa040('0x1e')]+_0x5965e9[_0xa040('0x20')];var _0x4cf7cc;if(_0x3c4972>=_0x1a7499){_0x3c4972=_0x1a7499;_0x4cf7cc=0xc8;}else{_0x4cf7cc=0xce;}_0x478727[_0xa040('0x1b')](_0x4cf7cc);return _0x478727[_0xa040('0x22')](_0xa040('0x23'),_0x51d063+'-'+_0x3c4972+'/'+_0x1a7499)[_0xa040('0x1d')](_0x23e400);}return null;};}function patchUpdates(_0x332667){return function(_0x3df1ea){try{jsonpatch[_0xa040('0x24')](_0x3df1ea,_0x332667,!![]);}catch(_0x52c34f){return BPromise['reject'](_0x52c34f);}return _0x3df1ea['save']();};}function saveUpdates(_0x4c87a4,_0x3d798f){return function(_0x48e3bd){if(_0x48e3bd){return _0x48e3bd[_0xa040('0x25')](_0x4c87a4)[_0xa040('0x26')](function(_0x580ec3){return _0x580ec3;});}return null;};}function removeEntity(_0x4398b5,_0x5b8732){return function(_0x29a658){if(_0x29a658){return _0x29a658[_0xa040('0x27')]()['then'](function(){_0x4398b5['status'](0xcc)[_0xa040('0x1c')]();});}};}function handleEntityNotFound(_0x5ce912,_0x367251){return function(_0x3fb723){if(!_0x3fb723){_0x5ce912[_0xa040('0x1a')](0x194);}return _0x3fb723;};}function handleError(_0x2dbb87,_0x5ec5db){_0x5ec5db=_0x5ec5db||0x1f4;return function(_0x2b7c38){logger[_0xa040('0x28')](_0x2b7c38[_0xa040('0x29')]);if(_0x2b7c38['name']){delete _0x2b7c38[_0xa040('0x2a')];}_0x2dbb87[_0xa040('0x1b')](_0x5ec5db)[_0xa040('0x2b')](_0x2b7c38);};}exports['index']=function(_0x1337ac,_0x14d29a){var _0x564cbb={},_0x25aed5={},_0x39f626={'count':0x0,'rows':[]};var _0x1e0c25=_[_0xa040('0x2c')](db[_0xa040('0x2d')][_0xa040('0x2e')],function(_0x8677b8){return{'name':_0x8677b8[_0xa040('0x2f')],'type':_0x8677b8['type'][_0xa040('0x30')]};});_0x25aed5[_0xa040('0x31')]=_[_0xa040('0x2c')](_0x1e0c25,_0xa040('0x2a'));_0x25aed5[_0xa040('0x32')]=_['keys'](_0x1337ac[_0xa040('0x32')]);_0x25aed5[_0xa040('0x33')]=_[_0xa040('0x34')](_0x25aed5[_0xa040('0x31')],_0x25aed5[_0xa040('0x32')]);_0x564cbb[_0xa040('0x35')]=_['intersection'](_0x25aed5[_0xa040('0x31')],qs[_0xa040('0x36')](_0x1337ac[_0xa040('0x32')][_0xa040('0x36')]));_0x564cbb['attributes']=_0x564cbb[_0xa040('0x35')]['length']?_0x564cbb[_0xa040('0x35')]:_0x25aed5[_0xa040('0x31')];if(!_0x1337ac['query']['hasOwnProperty'](_0xa040('0x37'))){_0x564cbb[_0xa040('0x20')]=qs['limit'](_0x1337ac[_0xa040('0x32')]['limit']);_0x564cbb[_0xa040('0x1e')]=qs[_0xa040('0x1e')](_0x1337ac[_0xa040('0x32')]['offset']);}_0x564cbb[_0xa040('0x38')]=qs[_0xa040('0x39')](_0x1337ac[_0xa040('0x32')][_0xa040('0x39')]);_0x564cbb[_0xa040('0x3a')]=qs['filters'](_[_0xa040('0x3b')](_0x1337ac['query'],_0x25aed5[_0xa040('0x33')]),_0x1e0c25);if(_0x1337ac[_0xa040('0x32')][_0xa040('0x3c')]){_0x564cbb[_0xa040('0x3a')]=_[_0xa040('0x3d')](_0x564cbb['where'],{'$or':_[_0xa040('0x2c')](_0x1e0c25,function(_0x1f087e){if(_0x1f087e[_0xa040('0x3e')]!==_0xa040('0x3f')){var _0x295c5e={};_0x295c5e[_0x1f087e['name']]={'$like':'%'+_0x1337ac[_0xa040('0x32')]['filter']+'%'};return _0x295c5e;}})});}_0x564cbb=_[_0xa040('0x3d')]({},_0x564cbb,_0x1337ac[_0xa040('0x40')]);var _0x227bab={'where':_0x564cbb[_0xa040('0x3a')]};return db[_0xa040('0x2d')][_0xa040('0x21')](_0x227bab)['then'](function(_0x1b5503){_0x39f626['count']=_0x1b5503;if(_0x1337ac[_0xa040('0x32')][_0xa040('0x41')]){_0x564cbb[_0xa040('0x42')]=[{'all':!![]}];}return db[_0xa040('0x2d')][_0xa040('0x43')](_0x564cbb);})[_0xa040('0x26')](function(_0x2c95b8){_0x39f626[_0xa040('0x44')]=_0x2c95b8;return _0x39f626;})[_0xa040('0x26')](respondWithFilteredResult(_0x14d29a,_0x564cbb))['catch'](handleError(_0x14d29a,null));};exports[_0xa040('0x45')]=function(_0x2966f7,_0x5a713f){var _0x29ed5a={'raw':!![],'where':{'id':_0x2966f7['params']['id']}},_0x1dedc4={};_0x1dedc4[_0xa040('0x31')]=_[_0xa040('0x46')](db[_0xa040('0x2d')][_0xa040('0x2e')]);_0x1dedc4[_0xa040('0x32')]=_[_0xa040('0x46')](_0x2966f7['query']);_0x1dedc4[_0xa040('0x33')]=_['intersection'](_0x1dedc4['model'],_0x1dedc4[_0xa040('0x32')]);_0x29ed5a[_0xa040('0x35')]=_['intersection'](_0x1dedc4['model'],qs[_0xa040('0x36')](_0x2966f7[_0xa040('0x32')][_0xa040('0x36')]));_0x29ed5a[_0xa040('0x35')]=_0x29ed5a['attributes'][_0xa040('0x47')]?_0x29ed5a[_0xa040('0x35')]:_0x1dedc4[_0xa040('0x31')];if(_0x2966f7['query'][_0xa040('0x41')]){_0x29ed5a[_0xa040('0x42')]=[{'all':!![]}];}_0x29ed5a=_[_0xa040('0x3d')]({},_0x29ed5a,_0x2966f7[_0xa040('0x40')]);return db['MailTransferReport'][_0xa040('0x48')](_0x29ed5a)['then'](handleEntityNotFound(_0x5a713f,null))[_0xa040('0x26')](respondWithResult(_0x5a713f,null))[_0xa040('0x49')](handleError(_0x5a713f,null));};exports[_0xa040('0x4a')]=function(_0xf4eebd,_0x7e5a4e){return db[_0xa040('0x2d')][_0xa040('0x4a')](_0xf4eebd[_0xa040('0x4b')],{})['then'](respondWithResult(_0x7e5a4e,0xc9))[_0xa040('0x49')](handleError(_0x7e5a4e,null));};exports[_0xa040('0x25')]=function(_0x5e69e7,_0x5a0656){if(_0x5e69e7['body']['id']){delete _0x5e69e7['body']['id'];}return db[_0xa040('0x2d')]['find']({'where':{'id':_0x5e69e7[_0xa040('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a0656,null))[_0xa040('0x26')](saveUpdates(_0x5e69e7[_0xa040('0x4b')],null))[_0xa040('0x26')](respondWithResult(_0x5a0656,null))[_0xa040('0x49')](handleError(_0x5a0656,null));};exports['destroy']=function(_0x592a92,_0x49591c){return db[_0xa040('0x2d')][_0xa040('0x48')]({'where':{'id':_0x592a92[_0xa040('0x4c')]['id']}})[_0xa040('0x26')](handleEntityNotFound(_0x49591c,null))[_0xa040('0x26')](removeEntity(_0x49591c,null))[_0xa040('0x49')](handleError(_0x49591c,null));};exports['describe']=function(_0x331dc3,_0x50e686){return db[_0xa040('0x2d')][_0xa040('0x4d')]()[_0xa040('0x26')](respondWithResult(_0x50e686,null))[_0xa040('0x49')](handleError(_0x50e686,null));};
\ No newline at end of file
+var _0xd5f0=['rows','catch','filters','intersection','length','include','merge','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','hasOwnProperty','order','sort','pick','where','VIRTUAL','options','includeAll','findAll'];(function(_0x202c9e,_0xea7c2d){var _0x22c4bd=function(_0x59615a){while(--_0x59615a){_0x202c9e['push'](_0x202c9e['shift']());}};_0x22c4bd(++_0xea7c2d);}(_0xd5f0,0xa5));var _0x0d5f=function(_0xfdbe81,_0x2f134c){_0xfdbe81=_0xfdbe81-0x0;var _0x245271=_0xd5f0[_0xfdbe81];return _0x245271;};'use strict';var emlformat=require(_0x0d5f('0x0'));var rimraf=require(_0x0d5f('0x1'));var zipdir=require(_0x0d5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d5f('0x3'));var moment=require(_0x0d5f('0x4'));var BPromise=require(_0x0d5f('0x5'));var Mustache=require(_0x0d5f('0x6'));var util=require(_0x0d5f('0x7'));var path=require(_0x0d5f('0x8'));var sox=require(_0x0d5f('0x9'));var csv=require(_0x0d5f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d5f('0xb'));var _=require(_0x0d5f('0xc'));var squel=require('squel');var crypto=require(_0x0d5f('0xd'));var jsforce=require(_0x0d5f('0xe'));var deskjs=require(_0x0d5f('0xf'));var toCsv=require(_0x0d5f('0xa'));var querystring=require(_0x0d5f('0x10'));var Papa=require(_0x0d5f('0x11'));var Redis=require(_0x0d5f('0x12'));var authService=require(_0x0d5f('0x13'));var qs=require(_0x0d5f('0x14'));var as=require(_0x0d5f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0d5f('0x16'));var utils=require(_0x0d5f('0x17'));var config=require(_0x0d5f('0x18'));var licenseUtil=require(_0x0d5f('0x19'));var db=require(_0x0d5f('0x1a'))['db'];function respondWithStatusCode(_0x8c4a6c,_0x1f1a49){_0x1f1a49=_0x1f1a49||0xcc;return function(_0x19249e){if(_0x19249e){return _0x8c4a6c[_0x0d5f('0x1b')](_0x1f1a49);}return _0x8c4a6c['status'](_0x1f1a49)['end']();};}function respondWithResult(_0x1544d3,_0x40fcda){_0x40fcda=_0x40fcda||0xc8;return function(_0x35eead){if(_0x35eead){return _0x1544d3[_0x0d5f('0x1c')](_0x40fcda)[_0x0d5f('0x1d')](_0x35eead);}};}function respondWithFilteredResult(_0xcbf1ee,_0x21dbd0){return function(_0x55b4a7){if(_0x55b4a7){var _0x3f094f=typeof _0x21dbd0[_0x0d5f('0x1e')]===_0x0d5f('0x1f')&&typeof _0x21dbd0[_0x0d5f('0x20')]===_0x0d5f('0x1f');var _0x27004a=_0x55b4a7['count'];var _0x57e7a9=_0x3f094f?0x0:_0x21dbd0['offset'];var _0xf1afce=_0x3f094f?_0x55b4a7[_0x0d5f('0x21')]:_0x21dbd0['offset']+_0x21dbd0['limit'];var _0x1a674a;if(_0xf1afce>=_0x27004a){_0xf1afce=_0x27004a;_0x1a674a=0xc8;}else{_0x1a674a=0xce;}_0xcbf1ee[_0x0d5f('0x1c')](_0x1a674a);return _0xcbf1ee[_0x0d5f('0x22')](_0x0d5f('0x23'),_0x57e7a9+'-'+_0xf1afce+'/'+_0x27004a)[_0x0d5f('0x1d')](_0x55b4a7);}return null;};}function patchUpdates(_0x5a0ceb){return function(_0x19d836){try{jsonpatch['apply'](_0x19d836,_0x5a0ceb,!![]);}catch(_0x5effc9){return BPromise[_0x0d5f('0x24')](_0x5effc9);}return _0x19d836['save']();};}function saveUpdates(_0x1c7b49,_0x20d180){return function(_0x5247e3){if(_0x5247e3){return _0x5247e3[_0x0d5f('0x25')](_0x1c7b49)[_0x0d5f('0x26')](function(_0x463c7c){return _0x463c7c;});}return null;};}function removeEntity(_0xf5ba91,_0x4c327b){return function(_0x58337e){if(_0x58337e){return _0x58337e[_0x0d5f('0x27')]()[_0x0d5f('0x26')](function(){_0xf5ba91[_0x0d5f('0x1c')](0xcc)[_0x0d5f('0x28')]();});}};}function handleEntityNotFound(_0x12bc6b,_0x579177){return function(_0x3ba752){if(!_0x3ba752){_0x12bc6b[_0x0d5f('0x1b')](0x194);}return _0x3ba752;};}function handleError(_0x509cf9,_0x4cd357){_0x4cd357=_0x4cd357||0x1f4;return function(_0x2468c5){logger[_0x0d5f('0x29')](_0x2468c5[_0x0d5f('0x2a')]);if(_0x2468c5[_0x0d5f('0x2b')]){delete _0x2468c5['name'];}_0x509cf9[_0x0d5f('0x1c')](_0x4cd357)[_0x0d5f('0x2c')](_0x2468c5);};}exports[_0x0d5f('0x2d')]=function(_0x42e1fb,_0x45b374){var _0x274cd2={},_0x2fd9c9={},_0x2e39a0={'count':0x0,'rows':[]};var _0x2042ef=_[_0x0d5f('0x2e')](db[_0x0d5f('0x2f')][_0x0d5f('0x30')],function(_0x4a60bc){return{'name':_0x4a60bc[_0x0d5f('0x31')],'type':_0x4a60bc[_0x0d5f('0x32')][_0x0d5f('0x33')]};});_0x2fd9c9[_0x0d5f('0x34')]=_[_0x0d5f('0x2e')](_0x2042ef,_0x0d5f('0x2b'));_0x2fd9c9[_0x0d5f('0x35')]=_[_0x0d5f('0x36')](_0x42e1fb[_0x0d5f('0x35')]);_0x2fd9c9['filters']=_['intersection'](_0x2fd9c9[_0x0d5f('0x34')],_0x2fd9c9['query']);_0x274cd2[_0x0d5f('0x37')]=_['intersection'](_0x2fd9c9[_0x0d5f('0x34')],qs[_0x0d5f('0x38')](_0x42e1fb[_0x0d5f('0x35')][_0x0d5f('0x38')]));_0x274cd2[_0x0d5f('0x37')]=_0x274cd2['attributes']['length']?_0x274cd2['attributes']:_0x2fd9c9[_0x0d5f('0x34')];if(!_0x42e1fb[_0x0d5f('0x35')][_0x0d5f('0x39')]('nolimit')){_0x274cd2['limit']=qs[_0x0d5f('0x20')](_0x42e1fb[_0x0d5f('0x35')][_0x0d5f('0x20')]);_0x274cd2[_0x0d5f('0x1e')]=qs[_0x0d5f('0x1e')](_0x42e1fb[_0x0d5f('0x35')][_0x0d5f('0x1e')]);}_0x274cd2[_0x0d5f('0x3a')]=qs[_0x0d5f('0x3b')](_0x42e1fb[_0x0d5f('0x35')][_0x0d5f('0x3b')]);_0x274cd2['where']=qs['filters'](_[_0x0d5f('0x3c')](_0x42e1fb[_0x0d5f('0x35')],_0x2fd9c9['filters']),_0x2042ef);if(_0x42e1fb[_0x0d5f('0x35')]['filter']){_0x274cd2[_0x0d5f('0x3d')]=_['merge'](_0x274cd2['where'],{'$or':_[_0x0d5f('0x2e')](_0x2042ef,function(_0x2b0143){if(_0x2b0143[_0x0d5f('0x32')]!==_0x0d5f('0x3e')){var _0x2396d5={};_0x2396d5[_0x2b0143[_0x0d5f('0x2b')]]={'$like':'%'+_0x42e1fb[_0x0d5f('0x35')]['filter']+'%'};return _0x2396d5;}})});}_0x274cd2=_['merge']({},_0x274cd2,_0x42e1fb[_0x0d5f('0x3f')]);var _0xfe5dbd={'where':_0x274cd2[_0x0d5f('0x3d')]};return db[_0x0d5f('0x2f')]['count'](_0xfe5dbd)[_0x0d5f('0x26')](function(_0x4d30f1){_0x2e39a0[_0x0d5f('0x21')]=_0x4d30f1;if(_0x42e1fb[_0x0d5f('0x35')][_0x0d5f('0x40')]){_0x274cd2['include']=[{'all':!![]}];}return db[_0x0d5f('0x2f')][_0x0d5f('0x41')](_0x274cd2);})['then'](function(_0x1fa2fd){_0x2e39a0[_0x0d5f('0x42')]=_0x1fa2fd;return _0x2e39a0;})[_0x0d5f('0x26')](respondWithFilteredResult(_0x45b374,_0x274cd2))[_0x0d5f('0x43')](handleError(_0x45b374,null));};exports['show']=function(_0x449927,_0x1ca95e){var _0x5530dd={'raw':!![],'where':{'id':_0x449927['params']['id']}},_0x4cd4fe={};_0x4cd4fe[_0x0d5f('0x34')]=_[_0x0d5f('0x36')](db[_0x0d5f('0x2f')][_0x0d5f('0x30')]);_0x4cd4fe[_0x0d5f('0x35')]=_['keys'](_0x449927['query']);_0x4cd4fe[_0x0d5f('0x44')]=_[_0x0d5f('0x45')](_0x4cd4fe[_0x0d5f('0x34')],_0x4cd4fe[_0x0d5f('0x35')]);_0x5530dd[_0x0d5f('0x37')]=_[_0x0d5f('0x45')](_0x4cd4fe[_0x0d5f('0x34')],qs[_0x0d5f('0x38')](_0x449927['query']['fields']));_0x5530dd[_0x0d5f('0x37')]=_0x5530dd[_0x0d5f('0x37')][_0x0d5f('0x46')]?_0x5530dd[_0x0d5f('0x37')]:_0x4cd4fe['model'];if(_0x449927[_0x0d5f('0x35')]['includeAll']){_0x5530dd[_0x0d5f('0x47')]=[{'all':!![]}];}_0x5530dd=_[_0x0d5f('0x48')]({},_0x5530dd,_0x449927[_0x0d5f('0x3f')]);return db[_0x0d5f('0x2f')]['find'](_0x5530dd)['then'](handleEntityNotFound(_0x1ca95e,null))[_0x0d5f('0x26')](respondWithResult(_0x1ca95e,null))[_0x0d5f('0x43')](handleError(_0x1ca95e,null));};exports[_0x0d5f('0x49')]=function(_0x16de8f,_0x19b878){return db[_0x0d5f('0x2f')][_0x0d5f('0x49')](_0x16de8f[_0x0d5f('0x4a')],{})[_0x0d5f('0x26')](respondWithResult(_0x19b878,0xc9))['catch'](handleError(_0x19b878,null));};exports[_0x0d5f('0x25')]=function(_0x3aa17f,_0x4d2b2d){if(_0x3aa17f[_0x0d5f('0x4a')]['id']){delete _0x3aa17f[_0x0d5f('0x4a')]['id'];}return db['MailTransferReport'][_0x0d5f('0x4b')]({'where':{'id':_0x3aa17f[_0x0d5f('0x4c')]['id']}})[_0x0d5f('0x26')](handleEntityNotFound(_0x4d2b2d,null))[_0x0d5f('0x26')](saveUpdates(_0x3aa17f['body'],null))[_0x0d5f('0x26')](respondWithResult(_0x4d2b2d,null))[_0x0d5f('0x43')](handleError(_0x4d2b2d,null));};exports[_0x0d5f('0x27')]=function(_0x2109e9,_0x3532c7){return db[_0x0d5f('0x2f')][_0x0d5f('0x4b')]({'where':{'id':_0x2109e9[_0x0d5f('0x4c')]['id']}})[_0x0d5f('0x26')](handleEntityNotFound(_0x3532c7,null))[_0x0d5f('0x26')](removeEntity(_0x3532c7,null))['catch'](handleError(_0x3532c7,null));};exports['describe']=function(_0xecf815,_0x3365be){return db[_0x0d5f('0x2f')]['describe']()['then'](respondWithResult(_0x3365be,null))[_0x0d5f('0x43')](handleError(_0x3365be,null));};
\ No newline at end of file
index a150d9c..9b2430f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6732=['rimraf','../../config/environment','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_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('./mailTransferReport.attributes');module['exports']=function(_0x90d6e5,_0x2ec408){return _0x90d6e5[_0x2673('0x8')](_0x2673('0x9'),attributes,{'tableName':_0x2673('0xa'),'paranoid':![],'indexes':[{'name':_0x2673('0xb'),'fields':[_0x2673('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x943c=['path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise'];(function(_0x2c8e77,_0x2dc145){var _0x31b69a=function(_0x243a9b){while(--_0x243a9b){_0x2c8e77['push'](_0x2c8e77['shift']());}};_0x31b69a(++_0x2dc145);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc943('0x0'));var util=require(_0xc943('0x1'));var logger=require(_0xc943('0x2'))(_0xc943('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc943('0x4'));var fs=require('fs');var path=require(_0xc943('0x5'));var rimraf=require(_0xc943('0x6'));var config=require('../../config/environment');var attributes=require(_0xc943('0x7'));module[_0xc943('0x8')]=function(_0x3307ef,_0xaff37f){return _0x3307ef[_0xc943('0x9')](_0xc943('0xa'),attributes,{'tableName':_0xc943('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc943('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 17feb98..188488f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b1a=['stringify','error','message','info','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x1c7386,_0x298a93){var _0x2b6b71=function(_0x3dfaf0){while(--_0x3dfaf0){_0x1c7386['push'](_0x1c7386['shift']());}};_0x2b6b71(++_0x298a93);}(_0x1b1a,0x1d3));var _0xa1b1=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0x1b1a[_0x24cc72];return _0xd49f1e;};'use strict';var _=require(_0xa1b1('0x0'));var util=require(_0xa1b1('0x1'));var moment=require('moment');var BPromise=require(_0xa1b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1b1('0x3'));var db=require(_0xa1b1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1b1('0x5'))(_0xa1b1('0x6'));var config=require(_0xa1b1('0x7'));var jayson=require(_0xa1b1('0x8'));var client=jayson[_0xa1b1('0x9')][_0xa1b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f9cc8,_0x2dad56,_0x1492a1){return new BPromise(function(_0x25d3f1,_0x1618ee){return client[_0xa1b1('0xb')](_0x4f9cc8,_0x1492a1)[_0xa1b1('0xc')](function(_0x20d81f){logger['info'](_0xa1b1('0xd'),_0x2dad56,_0xa1b1('0xe'));logger[_0xa1b1('0xf')](_0xa1b1('0x10'),_0x2dad56,'request\x20sent',JSON[_0xa1b1('0x11')](_0x20d81f));if(_0x20d81f[_0xa1b1('0x12')]){if(_0x20d81f[_0xa1b1('0x12')]['code']===0x1f4){logger['error'](_0xa1b1('0xd'),_0x2dad56,_0x20d81f[_0xa1b1('0x12')][_0xa1b1('0x13')]);return _0x1618ee(_0x20d81f[_0xa1b1('0x12')][_0xa1b1('0x13')]);}logger[_0xa1b1('0x12')](_0xa1b1('0xd'),_0x2dad56,_0x20d81f[_0xa1b1('0x12')][_0xa1b1('0x13')]);return _0x25d3f1(_0x20d81f[_0xa1b1('0x12')][_0xa1b1('0x13')]);}else{logger[_0xa1b1('0x14')](_0xa1b1('0xd'),_0x2dad56,_0xa1b1('0xe'));_0x25d3f1(_0x20d81f['result'][_0xa1b1('0x13')]);}})[_0xa1b1('0x15')](function(_0x2e5a84){logger[_0xa1b1('0x12')](_0xa1b1('0xd'),_0x2dad56,_0x2e5a84);_0x1618ee(_0x2e5a84);});});}
\ No newline at end of file
+var _0x9491=['client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x9491,0x7b));var _0x1949=function(_0x3096d9,_0x23d5fb){_0x3096d9=_0x3096d9-0x0;var _0x3dc623=_0x9491[_0x3096d9];return _0x3dc623;};'use strict';var _=require(_0x1949('0x0'));var util=require(_0x1949('0x1'));var moment=require(_0x1949('0x2'));var BPromise=require(_0x1949('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1949('0x4'))['db'];var utils=require(_0x1949('0x5'));var logger=require('../../config/logger')(_0x1949('0x6'));var config=require(_0x1949('0x7'));var jayson=require(_0x1949('0x8'));var client=jayson[_0x1949('0x9')][_0x1949('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265f65,_0x481bd9,_0x7441f6){return new BPromise(function(_0x27a7d5,_0x229f04){return client[_0x1949('0xb')](_0x265f65,_0x7441f6)[_0x1949('0xc')](function(_0x4727ec){logger[_0x1949('0xd')](_0x1949('0xe'),_0x481bd9,_0x1949('0xf'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x481bd9,_0x1949('0xf'),JSON[_0x1949('0x10')](_0x4727ec));if(_0x4727ec[_0x1949('0x11')]){if(_0x4727ec[_0x1949('0x11')][_0x1949('0x12')]===0x1f4){logger[_0x1949('0x11')](_0x1949('0xe'),_0x481bd9,_0x4727ec[_0x1949('0x11')][_0x1949('0x13')]);return _0x229f04(_0x4727ec[_0x1949('0x11')][_0x1949('0x13')]);}logger[_0x1949('0x11')](_0x1949('0xe'),_0x481bd9,_0x4727ec[_0x1949('0x11')][_0x1949('0x13')]);return _0x27a7d5(_0x4727ec[_0x1949('0x11')][_0x1949('0x13')]);}else{logger[_0x1949('0xd')](_0x1949('0xe'),_0x481bd9,_0x1949('0xf'));_0x27a7d5(_0x4727ec[_0x1949('0x14')][_0x1949('0x13')]);}})[_0x1949('0x15')](function(_0x33acf9){logger[_0x1949('0x11')](_0x1949('0xe'),_0x481bd9,_0x33acf9);_0x229f04(_0x33acf9);});});}
\ No newline at end of file
index ee31339..f41dea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x103c=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x45e868,_0x18d8e7){var _0x29a77b=function(_0x28ae22){while(--_0x28ae22){_0x45e868['push'](_0x45e868['shift']());}};_0x29a77b(++_0x18d8e7);}(_0x103c,0x102));var _0xc103=function(_0x587e1b,_0x42620e){_0x587e1b=_0x587e1b-0x0;var _0x31d757=_0x103c[_0x587e1b];return _0x31d757;};'use strict';var multer=require(_0xc103('0x0'));var util=require(_0xc103('0x1'));var path=require(_0xc103('0x2'));var timeout=require('connect-timeout');var express=require(_0xc103('0x3'));var router=express[_0xc103('0x4')]();var fs_extra=require(_0xc103('0x5'));var auth=require(_0xc103('0x6'));var interaction=require(_0xc103('0x7'));var config=require(_0xc103('0x8'));var controller=require('./memberReport.controller');router[_0xc103('0x9')]('/',auth[_0xc103('0xa')](),controller['index']);router[_0xc103('0x9')](_0xc103('0xb'),auth[_0xc103('0xa')](),controller[_0xc103('0xc')]);router[_0xc103('0x9')](_0xc103('0xd'),auth[_0xc103('0xa')](),controller[_0xc103('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc103('0xf')](_0xc103('0xd'),auth[_0xc103('0xa')](),controller['update']);router[_0xc103('0x10')](_0xc103('0xd'),auth[_0xc103('0xa')](),controller[_0xc103('0x11')]);module[_0xc103('0x12')]=router;
\ No newline at end of file
+var _0x416f=['./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0x416f,0x12b));var _0xf416=function(_0x57d239,_0x45fdb9){_0x57d239=_0x57d239-0x0;var _0x2a4e5d=_0x416f[_0x57d239];return _0x2a4e5d;};'use strict';var multer=require(_0xf416('0x0'));var util=require(_0xf416('0x1'));var path=require(_0xf416('0x2'));var timeout=require(_0xf416('0x3'));var express=require('express');var router=express[_0xf416('0x4')]();var fs_extra=require(_0xf416('0x5'));var auth=require(_0xf416('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf416('0x7'));router[_0xf416('0x8')]('/',auth[_0xf416('0x9')](),controller[_0xf416('0xa')]);router['get'](_0xf416('0xb'),auth['isAuthenticated'](),controller[_0xf416('0xc')]);router[_0xf416('0x8')](_0xf416('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf416('0xe')]('/',auth[_0xf416('0x9')](),controller['create']);router[_0xf416('0xf')](_0xf416('0xd'),auth[_0xf416('0x9')](),controller[_0xf416('0x10')]);router[_0xf416('0x11')](_0xf416('0xd'),auth[_0xf416('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4c91380..f3f08fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5309=['exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','seconds','setDataValue'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0x5309,0x1aa));var _0x9530=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x5309[_0x1cd674];return _0x27928f;};'use strict';var Sequelize=require(_0x9530('0x0'));var moment=require(_0x9530('0x1'));module[_0x9530('0x2')]={'channel':{'type':Sequelize[_0x9530('0x3')]},'membername':{'type':Sequelize[_0x9530('0x3')]},'interface':{'type':Sequelize[_0x9530('0x3')]},'type':{'type':Sequelize[_0x9530('0x3')],'defaultValue':_0x9530('0x4'),'comment':_0x9530('0x5')},'duration':{'type':Sequelize[_0x9530('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x1cb512){var _0x187678=moment(_0x1cb512);var _0x1259cc=moment(this['getDataValue']('enterAt'));var _0x24f66b=_0x187678['diff'](_0x1259cc,_0x9530('0x7'));this[_0x9530('0x8')](_0x9530('0x9'),_0x1cb512);this[_0x9530('0x8')](_0x9530('0xa'),_0x24f66b||null);}},'data1':{'type':Sequelize[_0x9530('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x9530('0xb')},'data3':{'type':Sequelize[_0x9530('0x3')],'comment':_0x9530('0xc')},'data4':{'type':Sequelize[_0x9530('0x3')],'comment':_0x9530('0xd')},'data5':{'type':Sequelize[_0x9530('0x3')],'comment':_0x9530('0xe')},'role':{'type':Sequelize[_0x9530('0x3')]},'internal':{'type':Sequelize[_0x9530('0x6')]},'uniqueid':{'type':Sequelize[_0x9530('0x3')]}};
\ No newline at end of file
+var _0xfc4c=['diff','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x19fa95,_0x1cca0a){var _0x58a835=function(_0x3e1957){while(--_0x3e1957){_0x19fa95['push'](_0x19fa95['shift']());}};_0x58a835(++_0x1cca0a);}(_0xfc4c,0xca));var _0xcfc4=function(_0x4c5bc6,_0x31390a){_0x4c5bc6=_0x4c5bc6-0x0;var _0x4e5a64=_0xfc4c[_0x4c5bc6];return _0x4e5a64;};'use strict';var Sequelize=require(_0xcfc4('0x0'));var moment=require(_0xcfc4('0x1'));module[_0xcfc4('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xcfc4('0x3')]},'interface':{'type':Sequelize[_0xcfc4('0x3')]},'type':{'type':Sequelize[_0xcfc4('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xcfc4('0x4')]},'enterAt':{'type':Sequelize[_0xcfc4('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x4a4db3){var _0x30b6d4=moment(_0x4a4db3);var _0x53486d=moment(this[_0xcfc4('0x6')](_0xcfc4('0x7')));var _0x520566=_0x30b6d4[_0xcfc4('0x8')](_0x53486d,'seconds');this['setDataValue']('exitAt',_0x4a4db3);this[_0xcfc4('0x9')](_0xcfc4('0xa'),_0x520566||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xcfc4('0xb')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xcfc4('0x3')],'comment':_0xcfc4('0xc')},'data4':{'type':Sequelize[_0xcfc4('0x3')],'comment':_0xcfc4('0xd')},'data5':{'type':Sequelize[_0xcfc4('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xcfc4('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xcfc4('0x3')]}};
\ No newline at end of file
index a247832..e29260c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x8cb31b,_0x509016){var _0x2ce32e=function(_0x1e6f4a){while(--_0x1e6f4a){_0x8cb31b['push'](_0x8cb31b['shift']());}};_0x2ce32e(++_0x509016);}(_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['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));};
\ No newline at end of file
+var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x4768ce,_0x1565ce){var _0x31e30b=function(_0x71e32d){while(--_0x71e32d){_0x4768ce['push'](_0x4768ce['shift']());}};_0x31e30b(++_0x1565ce);}(_0x7217,0x19e));var _0x7721=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x7217[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));};
\ No newline at end of file
index b9783f0..da2143f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d95=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./memberReport.attributes','exports','define','report_member','membername','interface','lodash','util'];(function(_0x32b3d8,_0x505fce){var _0x1f1ba9=function(_0x1697b4){while(--_0x1697b4){_0x32b3d8['push'](_0x32b3d8['shift']());}};_0x1f1ba9(++_0x505fce);}(_0x7d95,0x1ec));var _0x57d9=function(_0x5ba2c8,_0x5826ef){_0x5ba2c8=_0x5ba2c8-0x0;var _0x6c177f=_0x7d95[_0x5ba2c8];return _0x6c177f;};'use strict';var _=require(_0x57d9('0x0'));var util=require(_0x57d9('0x1'));var logger=require(_0x57d9('0x2'))('api');var moment=require(_0x57d9('0x3'));var BPromise=require(_0x57d9('0x4'));var rp=require(_0x57d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x57d9('0x6'));var attributes=require(_0x57d9('0x7'));module[_0x57d9('0x8')]=function(_0x181c62,_0x331bbc){return _0x181c62[_0x57d9('0x9')]('MemberReport',attributes,{'tableName':_0x57d9('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x57d9('0xb'),_0x57d9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb6e=['exports','report_member','membername','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./memberReport.attributes'];(function(_0x556442,_0x206e57){var _0x3fa1f3=function(_0x316ec2){while(--_0x316ec2){_0x556442['push'](_0x556442['shift']());}};_0x3fa1f3(++_0x206e57);}(_0xfb6e,0x177));var _0xefb6=function(_0x1d541f,_0x1c3c26){_0x1d541f=_0x1d541f-0x0;var _0x571873=_0xfb6e[_0x1d541f];return _0x571873;};'use strict';var _=require('lodash');var util=require(_0xefb6('0x0'));var logger=require(_0xefb6('0x1'))(_0xefb6('0x2'));var moment=require(_0xefb6('0x3'));var BPromise=require(_0xefb6('0x4'));var rp=require(_0xefb6('0x5'));var fs=require('fs');var path=require(_0xefb6('0x6'));var rimraf=require(_0xefb6('0x7'));var config=require('../../config/environment');var attributes=require(_0xefb6('0x8'));module[_0xefb6('0x9')]=function(_0x5ccd16,_0x125a0d){return _0x5ccd16['define']('MemberReport',attributes,{'tableName':_0xefb6('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xefb6('0xb'),'interface']}],'timestamps':!![]});};
\ No newline at end of file
index 3a67862..48162ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ed=['MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit','include','map','model','then','debug','CreateMemberReport','update','body','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x196dc5,_0x50be9d){var _0x56458e=function(_0x5bd98b){while(--_0x5bd98b){_0x196dc5['push'](_0x196dc5['shift']());}};_0x56458e(++_0x50be9d);}(_0x22ed,0x1a9));var _0xd22e=function(_0x4113e2,_0x52dfb9){_0x4113e2=_0x4113e2-0x0;var _0xaca944=_0x22ed[_0x4113e2];return _0xaca944;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var moment=require(_0xd22e('0x2'));var BPromise=require(_0xd22e('0x3'));var rs=require(_0xd22e('0x4'));var fs=require('fs');var Redis=require(_0xd22e('0x5'));var db=require(_0xd22e('0x6'))['db'];var utils=require(_0xd22e('0x7'));var logger=require(_0xd22e('0x8'))(_0xd22e('0x9'));var config=require(_0xd22e('0xa'));var jayson=require(_0xd22e('0xb'));var client=jayson['client'][_0xd22e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3185f2,_0x5d99d5,_0x405361){return new BPromise(function(_0x3378a3,_0x5dd614){return client[_0xd22e('0xd')](_0x3185f2,_0x405361)['then'](function(_0x5444e8){logger[_0xd22e('0xe')]('MemberReport,\x20%s,\x20%s',_0x5d99d5,'request\x20sent');logger['debug'](_0xd22e('0xf'),_0x5d99d5,_0xd22e('0x10'),JSON[_0xd22e('0x11')](_0x5444e8));if(_0x5444e8[_0xd22e('0x12')]){if(_0x5444e8['error'][_0xd22e('0x13')]===0x1f4){logger[_0xd22e('0x12')](_0xd22e('0x14'),_0x5d99d5,_0x5444e8[_0xd22e('0x12')][_0xd22e('0x15')]);return _0x5dd614(_0x5444e8[_0xd22e('0x12')]['message']);}logger[_0xd22e('0x12')](_0xd22e('0x14'),_0x5d99d5,_0x5444e8[_0xd22e('0x12')]['message']);return _0x3378a3(_0x5444e8[_0xd22e('0x12')]['message']);}else{logger[_0xd22e('0xe')](_0xd22e('0x14'),_0x5d99d5,_0xd22e('0x10'));_0x3378a3(_0x5444e8[_0xd22e('0x16')][_0xd22e('0x15')]);}})[_0xd22e('0x17')](function(_0x3cbd14){logger[_0xd22e('0x12')]('MemberReport,\x20%s,\x20%s',_0x5d99d5,_0x3cbd14);_0x5dd614(_0x3cbd14);});});}exports[_0xd22e('0x18')]=function(_0x288345){var _0x2ee456=this;return new Promise(function(_0x1a35bb,_0x11d356){return db[_0xd22e('0x19')]['findAll']({'raw':_0x288345[_0xd22e('0x1a')]?_0x288345['options'][_0xd22e('0x1b')]===undefined?!![]:![]:!![],'where':_0x288345['options']?_0x288345['options'][_0xd22e('0x1c')]||null:null,'attributes':_0x288345['options']?_0x288345['options'][_0xd22e('0x1d')]||null:null,'limit':_0x288345[_0xd22e('0x1a')]?_0x288345[_0xd22e('0x1a')][_0xd22e('0x1e')]||null:null,'include':_0x288345['options']?_0x288345[_0xd22e('0x1a')][_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x288345['options'][_0xd22e('0x1f')],function(_0x41b668){return{'model':db[_0x41b668[_0xd22e('0x21')]],'as':_0x41b668['as'],'attributes':_0x41b668[_0xd22e('0x1d')],'include':_0x41b668['include']?_[_0xd22e('0x20')](_0x41b668[_0xd22e('0x1f')],function(_0x11ec41){return{'model':db[_0x11ec41[_0xd22e('0x21')]],'as':_0x11ec41['as'],'attributes':_0x11ec41[_0xd22e('0x1d')],'include':_0x11ec41[_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x11ec41['include'],function(_0xc57b5b){return{'model':db[_0xc57b5b[_0xd22e('0x21')]],'as':_0xc57b5b['as'],'attributes':_0xc57b5b[_0xd22e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd22e('0x22')](function(_0x36d7ef){logger[_0xd22e('0xe')](_0xd22e('0x18'),_0x288345);logger[_0xd22e('0x23')]('GetMemberReport',_0x288345,JSON[_0xd22e('0x11')](_0x36d7ef));_0x1a35bb(_0x36d7ef);})[_0xd22e('0x17')](function(_0x3be9cc){logger[_0xd22e('0x12')]('GetMemberReport',_0x3be9cc['message'],_0x288345);_0x11d356(_0x2ee456[_0xd22e('0x12')](0x1f4,_0x3be9cc[_0xd22e('0x15')]));});});};exports[_0xd22e('0x24')]=function(_0x2183c0){var _0x3296b3=this;return new Promise(function(_0xeb7fe3,_0x4b6fea){return db[_0xd22e('0x19')]['create'](_0x2183c0['body'],{'raw':_0x2183c0['options']?_0x2183c0[_0xd22e('0x1a')][_0xd22e('0x1b')]===undefined?!![]:![]:!![]})[_0xd22e('0x22')](function(_0x267c6f){logger[_0xd22e('0xe')](_0xd22e('0x24'),_0x2183c0);logger['debug']('CreateMemberReport',_0x2183c0,JSON[_0xd22e('0x11')](_0x267c6f));_0xeb7fe3(_0x267c6f);})[_0xd22e('0x17')](function(_0x123268){logger[_0xd22e('0x12')](_0xd22e('0x24'),_0x123268[_0xd22e('0x15')],_0x2183c0);_0x4b6fea(_0x3296b3[_0xd22e('0x12')](0x1f4,_0x123268[_0xd22e('0x15')]));});});};exports['UpdateMemberReport']=function(_0x1b95e){var _0x5de5d7=this;return new Promise(function(_0x24c07a,_0x126382){return db[_0xd22e('0x19')][_0xd22e('0x25')](_0x1b95e[_0xd22e('0x26')],{'raw':_0x1b95e[_0xd22e('0x1a')]?_0x1b95e[_0xd22e('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b95e['options']?_0x1b95e[_0xd22e('0x1a')][_0xd22e('0x1c')]||null:null,'attributes':_0x1b95e[_0xd22e('0x1a')]?_0x1b95e[_0xd22e('0x1a')][_0xd22e('0x1d')]||null:null,'limit':_0x1b95e[_0xd22e('0x1a')]?_0x1b95e[_0xd22e('0x1a')][_0xd22e('0x1e')]||null:null})[_0xd22e('0x22')](function(_0xb6889f){logger[_0xd22e('0xe')](_0xd22e('0x27'),_0x1b95e);logger[_0xd22e('0x23')](_0xd22e('0x27'),_0x1b95e,JSON[_0xd22e('0x11')](_0xb6889f));_0x24c07a(_0xb6889f);})[_0xd22e('0x17')](function(_0x19c8ab){logger[_0xd22e('0x12')](_0xd22e('0x27'),_0x19c8ab['message'],_0x1b95e);_0x126382(_0x5de5d7[_0xd22e('0x12')](0x1f4,_0x19c8ab[_0xd22e('0x15')]));});});};
\ No newline at end of file
+var _0x02ca=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','MemberReport','options','raw','where','limit','map','include','attributes','model','GetMemberReport','debug','CreateMemberReport','create','body','UpdateMemberReport','update','lodash'];(function(_0x2e6118,_0x311be2){var _0x1616a2=function(_0x5a9d7f){while(--_0x5a9d7f){_0x2e6118['push'](_0x2e6118['shift']());}};_0x1616a2(++_0x311be2);}(_0x02ca,0x97));var _0xa02c=function(_0x195914,_0x4eac4f){_0x195914=_0x195914-0x0;var _0x22fb9e=_0x02ca[_0x195914];return _0x22fb9e;};'use strict';var _=require(_0xa02c('0x0'));var util=require('util');var moment=require(_0xa02c('0x1'));var BPromise=require(_0xa02c('0x2'));var rs=require(_0xa02c('0x3'));var fs=require('fs');var Redis=require(_0xa02c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa02c('0x5'));var logger=require(_0xa02c('0x6'))(_0xa02c('0x7'));var config=require(_0xa02c('0x8'));var jayson=require(_0xa02c('0x9'));var client=jayson[_0xa02c('0xa')][_0xa02c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c64a,_0x2c87ec,_0x2b96c5){return new BPromise(function(_0x4033b9,_0x4dd173){return client[_0xa02c('0xc')](_0x29c64a,_0x2b96c5)[_0xa02c('0xd')](function(_0x203db6){logger[_0xa02c('0xe')](_0xa02c('0xf'),_0x2c87ec,'request\x20sent');logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x2c87ec,'request\x20sent',JSON[_0xa02c('0x10')](_0x203db6));if(_0x203db6[_0xa02c('0x11')]){if(_0x203db6[_0xa02c('0x11')][_0xa02c('0x12')]===0x1f4){logger['error'](_0xa02c('0xf'),_0x2c87ec,_0x203db6[_0xa02c('0x11')][_0xa02c('0x13')]);return _0x4dd173(_0x203db6[_0xa02c('0x11')]['message']);}logger[_0xa02c('0x11')](_0xa02c('0xf'),_0x2c87ec,_0x203db6[_0xa02c('0x11')]['message']);return _0x4033b9(_0x203db6[_0xa02c('0x11')][_0xa02c('0x13')]);}else{logger['info'](_0xa02c('0xf'),_0x2c87ec,_0xa02c('0x14'));_0x4033b9(_0x203db6['result'][_0xa02c('0x13')]);}})[_0xa02c('0x15')](function(_0x2db206){logger['error'](_0xa02c('0xf'),_0x2c87ec,_0x2db206);_0x4dd173(_0x2db206);});});}exports['GetMemberReport']=function(_0x4d7cb5){var _0x592de1=this;return new Promise(function(_0x3fcc66,_0x10df83){return db[_0xa02c('0x16')]['findAll']({'raw':_0x4d7cb5[_0xa02c('0x17')]?_0x4d7cb5['options'][_0xa02c('0x18')]===undefined?!![]:![]:!![],'where':_0x4d7cb5[_0xa02c('0x17')]?_0x4d7cb5[_0xa02c('0x17')][_0xa02c('0x19')]||null:null,'attributes':_0x4d7cb5['options']?_0x4d7cb5[_0xa02c('0x17')]['attributes']||null:null,'limit':_0x4d7cb5[_0xa02c('0x17')]?_0x4d7cb5[_0xa02c('0x17')][_0xa02c('0x1a')]||null:null,'include':_0x4d7cb5['options']?_0x4d7cb5['options']['include']?_[_0xa02c('0x1b')](_0x4d7cb5[_0xa02c('0x17')][_0xa02c('0x1c')],function(_0x514ef1){return{'model':db[_0x514ef1['model']],'as':_0x514ef1['as'],'attributes':_0x514ef1[_0xa02c('0x1d')],'include':_0x514ef1[_0xa02c('0x1c')]?_[_0xa02c('0x1b')](_0x514ef1[_0xa02c('0x1c')],function(_0x437308){return{'model':db[_0x437308['model']],'as':_0x437308['as'],'attributes':_0x437308['attributes'],'include':_0x437308[_0xa02c('0x1c')]?_[_0xa02c('0x1b')](_0x437308[_0xa02c('0x1c')],function(_0x39124e){return{'model':db[_0x39124e[_0xa02c('0x1e')]],'as':_0x39124e['as'],'attributes':_0x39124e[_0xa02c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa02c('0xd')](function(_0x419037){logger['info'](_0xa02c('0x1f'),_0x4d7cb5);logger[_0xa02c('0x20')](_0xa02c('0x1f'),_0x4d7cb5,JSON[_0xa02c('0x10')](_0x419037));_0x3fcc66(_0x419037);})[_0xa02c('0x15')](function(_0x402f72){logger[_0xa02c('0x11')](_0xa02c('0x1f'),_0x402f72[_0xa02c('0x13')],_0x4d7cb5);_0x10df83(_0x592de1['error'](0x1f4,_0x402f72[_0xa02c('0x13')]));});});};exports[_0xa02c('0x21')]=function(_0x279410){var _0x4de1ac=this;return new Promise(function(_0x58542a,_0x186fe9){return db[_0xa02c('0x16')][_0xa02c('0x22')](_0x279410[_0xa02c('0x23')],{'raw':_0x279410[_0xa02c('0x17')]?_0x279410[_0xa02c('0x17')][_0xa02c('0x18')]===undefined?!![]:![]:!![]})[_0xa02c('0xd')](function(_0x254124){logger[_0xa02c('0xe')]('CreateMemberReport',_0x279410);logger['debug'](_0xa02c('0x21'),_0x279410,JSON[_0xa02c('0x10')](_0x254124));_0x58542a(_0x254124);})[_0xa02c('0x15')](function(_0x3b93fb){logger[_0xa02c('0x11')](_0xa02c('0x21'),_0x3b93fb[_0xa02c('0x13')],_0x279410);_0x186fe9(_0x4de1ac[_0xa02c('0x11')](0x1f4,_0x3b93fb[_0xa02c('0x13')]));});});};exports[_0xa02c('0x24')]=function(_0x2ec390){var _0x4abc4d=this;return new Promise(function(_0x356095,_0x42f238){return db[_0xa02c('0x16')][_0xa02c('0x25')](_0x2ec390['body'],{'raw':_0x2ec390['options']?_0x2ec390[_0xa02c('0x17')][_0xa02c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ec390['options']?_0x2ec390['options']['where']||null:null,'attributes':_0x2ec390['options']?_0x2ec390[_0xa02c('0x17')][_0xa02c('0x1d')]||null:null,'limit':_0x2ec390[_0xa02c('0x17')]?_0x2ec390[_0xa02c('0x17')]['limit']||null:null})[_0xa02c('0xd')](function(_0x281455){logger[_0xa02c('0xe')](_0xa02c('0x24'),_0x2ec390);logger[_0xa02c('0x20')](_0xa02c('0x24'),_0x2ec390,JSON[_0xa02c('0x10')](_0x281455));_0x356095(_0x281455);})[_0xa02c('0x15')](function(_0x520764){logger['error'](_0xa02c('0x24'),_0x520764[_0xa02c('0x13')],_0x2ec390);_0x42f238(_0x4abc4d[_0xa02c('0x11')](0x1f4,_0x520764[_0xa02c('0x13')]));});});};
\ No newline at end of file
index f047777..7c5975a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x660a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','index','multer'];(function(_0x473199,_0x17bb65){var _0xf740c4=function(_0x259a1b){while(--_0x259a1b){_0x473199['push'](_0x473199['shift']());}};_0xf740c4(++_0x17bb65);}(_0x660a,0xba));var _0xa660=function(_0x190cfe,_0x16f92e){_0x190cfe=_0x190cfe-0x0;var _0x22716e=_0x660a[_0x190cfe];return _0x22716e;};'use strict';var multer=require(_0xa660('0x0'));var util=require('util');var path=require(_0xa660('0x1'));var timeout=require(_0xa660('0x2'));var express=require(_0xa660('0x3'));var router=express[_0xa660('0x4')]();var fs_extra=require(_0xa660('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa660('0x6'));var config=require(_0xa660('0x7'));var controller=require(_0xa660('0x8'));router[_0xa660('0x9')]('/',controller[_0xa660('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0xbd03=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0xfd183f,_0x21bbde){var _0x40b42e=function(_0x5dfbf3){while(--_0x5dfbf3){_0xfd183f['push'](_0xfd183f['shift']());}};_0x40b42e(++_0x21bbde);}(_0xbd03,0xcf));var _0x3bd0=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xbd03[_0x126fb9];return _0xc8a3b1;};'use strict';var multer=require(_0x3bd0('0x0'));var util=require(_0x3bd0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3bd0('0x2'));var router=express[_0x3bd0('0x3')]();var fs_extra=require(_0x3bd0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3bd0('0x5'));var config=require(_0x3bd0('0x6'));var controller=require(_0x3bd0('0x7'));router[_0x3bd0('0x8')]('/',controller[_0x3bd0('0x9')]);module[_0x3bd0('0xa')]=router;
\ No newline at end of file
index 6298499..9abed9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56a1=['exports','STRING','sequelize'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x56a1,0xaa));var _0x156a=function(_0x14691c,_0xe1c878){_0x14691c=_0x14691c-0x0;var _0xbec98=_0x56a1[_0x14691c];return _0xbec98;};'use strict';var Sequelize=require(_0x156a('0x0'));module[_0x156a('0x1')]={'version':{'type':Sequelize[_0x156a('0x2')],'unique':'version'}};
\ No newline at end of file
+var _0xb69a=['exports','STRING','version'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xb69a,0x69));var _0xab69=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb69a[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0xab69('0x0')]={'version':{'type':Sequelize[_0xab69('0x1')],'unique':_0xab69('0x2')}};
\ No newline at end of file
index 33c4387..00e9683 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe65d=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','Migration','findAll','rows','catch','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xe65d,0x7c));var _0xde65=function(_0x538b6f,_0x2887f5){_0x538b6f=_0x538b6f-0x0;var _0x313eb4=_0xe65d[_0x538b6f];return _0x313eb4;};'use strict';var emlformat=require(_0xde65('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xde65('0x1'));var rp=require('request-promise');var moment=require(_0xde65('0x2'));var BPromise=require(_0xde65('0x3'));var Mustache=require(_0xde65('0x4'));var util=require(_0xde65('0x5'));var path=require(_0xde65('0x6'));var sox=require(_0xde65('0x7'));var csv=require(_0xde65('0x8'));var ejs=require(_0xde65('0x9'));var fs=require('fs');var fs_extra=require(_0xde65('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde65('0xb'));var jsforce=require(_0xde65('0xc'));var deskjs=require(_0xde65('0xd'));var toCsv=require(_0xde65('0x8'));var querystring=require(_0xde65('0xe'));var Papa=require('papaparse');var Redis=require(_0xde65('0xf'));var authService=require(_0xde65('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde65('0x11'));var logger=require(_0xde65('0x12'))(_0xde65('0x13'));var utils=require(_0xde65('0x14'));var config=require(_0xde65('0x15'));var licenseUtil=require(_0xde65('0x16'));var db=require(_0xde65('0x17'))['db'];function respondWithStatusCode(_0x37254e,_0x13d415){_0x13d415=_0x13d415||0xcc;return function(_0x1df3b8){if(_0x1df3b8){return _0x37254e['sendStatus'](_0x13d415);}return _0x37254e['status'](_0x13d415)[_0xde65('0x18')]();};}function respondWithResult(_0x33d4ec,_0x5e0395){_0x5e0395=_0x5e0395||0xc8;return function(_0x221ec9){if(_0x221ec9){return _0x33d4ec[_0xde65('0x19')](_0x5e0395)[_0xde65('0x1a')](_0x221ec9);}};}function respondWithFilteredResult(_0x530072,_0x29f345){return function(_0x1384fc){if(_0x1384fc){var _0x33cc17=typeof _0x29f345[_0xde65('0x1b')]===_0xde65('0x1c')&&typeof _0x29f345[_0xde65('0x1d')]==='undefined';var _0x298c5c=_0x1384fc[_0xde65('0x1e')];var _0x14fd7a=_0x33cc17?0x0:_0x29f345[_0xde65('0x1b')];var _0x426ba8=_0x33cc17?_0x1384fc[_0xde65('0x1e')]:_0x29f345[_0xde65('0x1b')]+_0x29f345[_0xde65('0x1d')];var _0x173cfb;if(_0x426ba8>=_0x298c5c){_0x426ba8=_0x298c5c;_0x173cfb=0xc8;}else{_0x173cfb=0xce;}_0x530072[_0xde65('0x19')](_0x173cfb);return _0x530072[_0xde65('0x1f')](_0xde65('0x20'),_0x14fd7a+'-'+_0x426ba8+'/'+_0x298c5c)[_0xde65('0x1a')](_0x1384fc);}return null;};}function patchUpdates(_0x558011){return function(_0x2ed197){try{jsonpatch[_0xde65('0x21')](_0x2ed197,_0x558011,!![]);}catch(_0x60ecc4){return BPromise[_0xde65('0x22')](_0x60ecc4);}return _0x2ed197[_0xde65('0x23')]();};}function saveUpdates(_0x322e10,_0x4efec7){return function(_0x28cb10){if(_0x28cb10){return _0x28cb10['update'](_0x322e10)[_0xde65('0x24')](function(_0x7f6981){return _0x7f6981;});}return null;};}function removeEntity(_0x2eab42,_0x3c8085){return function(_0xf66de7){if(_0xf66de7){return _0xf66de7[_0xde65('0x25')]()[_0xde65('0x24')](function(){_0x2eab42[_0xde65('0x19')](0xcc)[_0xde65('0x18')]();});}};}function handleEntityNotFound(_0x52e691,_0x21e843){return function(_0x25d686){if(!_0x25d686){_0x52e691[_0xde65('0x26')](0x194);}return _0x25d686;};}function handleError(_0x14212a,_0x2b45e5){_0x2b45e5=_0x2b45e5||0x1f4;return function(_0x219a17){logger[_0xde65('0x27')](_0x219a17[_0xde65('0x28')]);if(_0x219a17[_0xde65('0x29')]){delete _0x219a17[_0xde65('0x29')];}_0x14212a[_0xde65('0x19')](_0x2b45e5)[_0xde65('0x2a')](_0x219a17);};}exports[_0xde65('0x2b')]=function(_0x41b37e,_0x2abfa4){var _0x429e1f={},_0x33dd82={},_0x26348b={'count':0x0,'rows':[]};var _0x26b39d=_[_0xde65('0x2c')](db['Migration'][_0xde65('0x2d')],function(_0x319ba6){return{'name':_0x319ba6[_0xde65('0x2e')],'type':_0x319ba6[_0xde65('0x2f')][_0xde65('0x30')]};});_0x33dd82[_0xde65('0x31')]=_[_0xde65('0x2c')](_0x26b39d,'name');_0x33dd82['query']=_[_0xde65('0x32')](_0x41b37e['query']);_0x33dd82[_0xde65('0x33')]=_['intersection'](_0x33dd82[_0xde65('0x31')],_0x33dd82[_0xde65('0x34')]);_0x429e1f[_0xde65('0x35')]=_[_0xde65('0x36')](_0x33dd82[_0xde65('0x31')],qs[_0xde65('0x37')](_0x41b37e[_0xde65('0x34')]['fields']));_0x429e1f[_0xde65('0x35')]=_0x429e1f[_0xde65('0x35')][_0xde65('0x38')]?_0x429e1f[_0xde65('0x35')]:_0x33dd82[_0xde65('0x31')];if(!_0x41b37e[_0xde65('0x34')][_0xde65('0x39')](_0xde65('0x3a'))){_0x429e1f['limit']=qs[_0xde65('0x1d')](_0x41b37e[_0xde65('0x34')][_0xde65('0x1d')]);_0x429e1f['offset']=qs['offset'](_0x41b37e[_0xde65('0x34')][_0xde65('0x1b')]);}_0x429e1f[_0xde65('0x3b')]=qs['sort'](_0x41b37e[_0xde65('0x34')][_0xde65('0x3c')]);_0x429e1f[_0xde65('0x3d')]=qs[_0xde65('0x33')](_['pick'](_0x41b37e[_0xde65('0x34')],_0x33dd82[_0xde65('0x33')]),_0x26b39d);if(_0x41b37e[_0xde65('0x34')]['filter']){_0x429e1f[_0xde65('0x3d')]=_[_0xde65('0x3e')](_0x429e1f[_0xde65('0x3d')],{'$or':_['map'](_0x26b39d,function(_0x2accf1){if(_0x2accf1[_0xde65('0x2f')]!==_0xde65('0x3f')){var _0x2cbdd8={};_0x2cbdd8[_0x2accf1['name']]={'$like':'%'+_0x41b37e['query'][_0xde65('0x40')]+'%'};return _0x2cbdd8;}})});}_0x429e1f=_[_0xde65('0x3e')]({},_0x429e1f,_0x41b37e['options']);var _0x34f990={'where':_0x429e1f[_0xde65('0x3d')]};return db['Migration'][_0xde65('0x1e')](_0x34f990)[_0xde65('0x24')](function(_0x231689){_0x26348b['count']=_0x231689;if(_0x41b37e[_0xde65('0x34')][_0xde65('0x41')]){_0x429e1f[_0xde65('0x42')]=[{'all':!![]}];}return db[_0xde65('0x43')][_0xde65('0x44')](_0x429e1f);})['then'](function(_0x576092){_0x26348b[_0xde65('0x45')]=_0x576092;return _0x26348b;})[_0xde65('0x24')](respondWithFilteredResult(_0x2abfa4,_0x429e1f))[_0xde65('0x46')](handleError(_0x2abfa4,null));};
\ No newline at end of file
+var _0x42ab=['type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','Migration','findAll','rows','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','apply','save','update','then','error','stack','name','index','map','fieldName'];(function(_0x3ce6c1,_0x3ab7a7){var _0xecc97d=function(_0x4d06d7){while(--_0x4d06d7){_0x3ce6c1['push'](_0x3ce6c1['shift']());}};_0xecc97d(++_0x3ab7a7);}(_0x42ab,0x97));var _0xb42a=function(_0x5bb1e9,_0x15f025){_0x5bb1e9=_0x5bb1e9-0x0;var _0x262c24=_0x42ab[_0x5bb1e9];return _0x262c24;};'use strict';var emlformat=require(_0xb42a('0x0'));var rimraf=require(_0xb42a('0x1'));var zipdir=require(_0xb42a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb42a('0x3'));var moment=require('moment');var BPromise=require(_0xb42a('0x4'));var Mustache=require(_0xb42a('0x5'));var util=require(_0xb42a('0x6'));var path=require('path');var sox=require(_0xb42a('0x7'));var csv=require('to-csv');var ejs=require(_0xb42a('0x8'));var fs=require('fs');var fs_extra=require(_0xb42a('0x9'));var _=require(_0xb42a('0xa'));var squel=require(_0xb42a('0xb'));var crypto=require(_0xb42a('0xc'));var jsforce=require(_0xb42a('0xd'));var deskjs=require(_0xb42a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb42a('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb42a('0x10'));var qs=require(_0xb42a('0x11'));var as=require(_0xb42a('0x12'));var hardwareService=require(_0xb42a('0x13'));var logger=require('../../config/logger')(_0xb42a('0x14'));var utils=require('../../config/utils');var config=require(_0xb42a('0x15'));var licenseUtil=require(_0xb42a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57f0f9,_0x78b75d){_0x78b75d=_0x78b75d||0xcc;return function(_0x3f6333){if(_0x3f6333){return _0x57f0f9[_0xb42a('0x17')](_0x78b75d);}return _0x57f0f9[_0xb42a('0x18')](_0x78b75d)[_0xb42a('0x19')]();};}function respondWithResult(_0x19f4ee,_0x1a6603){_0x1a6603=_0x1a6603||0xc8;return function(_0x1fb61f){if(_0x1fb61f){return _0x19f4ee[_0xb42a('0x18')](_0x1a6603)[_0xb42a('0x1a')](_0x1fb61f);}};}function respondWithFilteredResult(_0x56f2b2,_0x109fd2){return function(_0x17aad5){if(_0x17aad5){var _0x12f326=typeof _0x109fd2['offset']==='undefined'&&typeof _0x109fd2[_0xb42a('0x1b')]==='undefined';var _0x11c13e=_0x17aad5[_0xb42a('0x1c')];var _0xacc707=_0x12f326?0x0:_0x109fd2['offset'];var _0x3d5981=_0x12f326?_0x17aad5[_0xb42a('0x1c')]:_0x109fd2[_0xb42a('0x1d')]+_0x109fd2[_0xb42a('0x1b')];var _0x5b626d;if(_0x3d5981>=_0x11c13e){_0x3d5981=_0x11c13e;_0x5b626d=0xc8;}else{_0x5b626d=0xce;}_0x56f2b2[_0xb42a('0x18')](_0x5b626d);return _0x56f2b2[_0xb42a('0x1e')]('Content-Range',_0xacc707+'-'+_0x3d5981+'/'+_0x11c13e)[_0xb42a('0x1a')](_0x17aad5);}return null;};}function patchUpdates(_0x3e8e1a){return function(_0x256d94){try{jsonpatch[_0xb42a('0x1f')](_0x256d94,_0x3e8e1a,!![]);}catch(_0x41e824){return BPromise['reject'](_0x41e824);}return _0x256d94[_0xb42a('0x20')]();};}function saveUpdates(_0x5818a2,_0x19c69b){return function(_0x366e8c){if(_0x366e8c){return _0x366e8c[_0xb42a('0x21')](_0x5818a2)[_0xb42a('0x22')](function(_0x294bd2){return _0x294bd2;});}return null;};}function removeEntity(_0x19a674,_0x2543d2){return function(_0x5cf0a3){if(_0x5cf0a3){return _0x5cf0a3['destroy']()[_0xb42a('0x22')](function(){_0x19a674['status'](0xcc)[_0xb42a('0x19')]();});}};}function handleEntityNotFound(_0x1a1748,_0x1b9905){return function(_0x58219a){if(!_0x58219a){_0x1a1748['sendStatus'](0x194);}return _0x58219a;};}function handleError(_0x1caa2c,_0x5462d5){_0x5462d5=_0x5462d5||0x1f4;return function(_0x4cddb0){logger[_0xb42a('0x23')](_0x4cddb0[_0xb42a('0x24')]);if(_0x4cddb0[_0xb42a('0x25')]){delete _0x4cddb0[_0xb42a('0x25')];}_0x1caa2c[_0xb42a('0x18')](_0x5462d5)['send'](_0x4cddb0);};}exports[_0xb42a('0x26')]=function(_0x3e5b48,_0x311030){var _0x2ade47={},_0x15082e={},_0xeff21a={'count':0x0,'rows':[]};var _0x13f777=_[_0xb42a('0x27')](db['Migration']['rawAttributes'],function(_0x40f440){return{'name':_0x40f440[_0xb42a('0x28')],'type':_0x40f440[_0xb42a('0x29')]['key']};});_0x15082e[_0xb42a('0x2a')]=_[_0xb42a('0x27')](_0x13f777,_0xb42a('0x25'));_0x15082e[_0xb42a('0x2b')]=_[_0xb42a('0x2c')](_0x3e5b48[_0xb42a('0x2b')]);_0x15082e[_0xb42a('0x2d')]=_[_0xb42a('0x2e')](_0x15082e[_0xb42a('0x2a')],_0x15082e['query']);_0x2ade47['attributes']=_['intersection'](_0x15082e[_0xb42a('0x2a')],qs['fields'](_0x3e5b48[_0xb42a('0x2b')][_0xb42a('0x2f')]));_0x2ade47[_0xb42a('0x30')]=_0x2ade47['attributes'][_0xb42a('0x31')]?_0x2ade47['attributes']:_0x15082e['model'];if(!_0x3e5b48[_0xb42a('0x2b')][_0xb42a('0x32')](_0xb42a('0x33'))){_0x2ade47[_0xb42a('0x1b')]=qs['limit'](_0x3e5b48[_0xb42a('0x2b')][_0xb42a('0x1b')]);_0x2ade47['offset']=qs[_0xb42a('0x1d')](_0x3e5b48[_0xb42a('0x2b')][_0xb42a('0x1d')]);}_0x2ade47[_0xb42a('0x34')]=qs[_0xb42a('0x35')](_0x3e5b48[_0xb42a('0x2b')][_0xb42a('0x35')]);_0x2ade47[_0xb42a('0x36')]=qs[_0xb42a('0x2d')](_['pick'](_0x3e5b48['query'],_0x15082e['filters']),_0x13f777);if(_0x3e5b48[_0xb42a('0x2b')][_0xb42a('0x37')]){_0x2ade47[_0xb42a('0x36')]=_['merge'](_0x2ade47[_0xb42a('0x36')],{'$or':_[_0xb42a('0x27')](_0x13f777,function(_0x10f597){if(_0x10f597['type']!==_0xb42a('0x38')){var _0x1099c2={};_0x1099c2[_0x10f597[_0xb42a('0x25')]]={'$like':'%'+_0x3e5b48['query'][_0xb42a('0x37')]+'%'};return _0x1099c2;}})});}_0x2ade47=_['merge']({},_0x2ade47,_0x3e5b48[_0xb42a('0x39')]);var _0x30d0a2={'where':_0x2ade47[_0xb42a('0x36')]};return db['Migration'][_0xb42a('0x1c')](_0x30d0a2)[_0xb42a('0x22')](function(_0x4649d8){_0xeff21a['count']=_0x4649d8;if(_0x3e5b48[_0xb42a('0x2b')][_0xb42a('0x3a')]){_0x2ade47[_0xb42a('0x3b')]=[{'all':!![]}];}return db[_0xb42a('0x3c')][_0xb42a('0x3d')](_0x2ade47);})[_0xb42a('0x22')](function(_0xaa39b1){_0xeff21a[_0xb42a('0x3e')]=_0xaa39b1;return _0xeff21a;})[_0xb42a('0x22')](respondWithFilteredResult(_0x311030,_0x2ade47))[_0xb42a('0x3f')](handleError(_0x311030,null));};
\ No newline at end of file
index 5293403..2211273 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72a5=['migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0xfea6e6,_0x3991aa){var _0x5889ac=function(_0x43cb83){while(--_0x43cb83){_0xfea6e6['push'](_0xfea6e6['shift']());}};_0x5889ac(++_0x3991aa);}(_0x72a5,0x1d2));var _0x572a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72a5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x572a('0x0'));var util=require(_0x572a('0x1'));var logger=require(_0x572a('0x2'))(_0x572a('0x3'));var moment=require(_0x572a('0x4'));var BPromise=require(_0x572a('0x5'));var rp=require(_0x572a('0x6'));var fs=require('fs');var path=require(_0x572a('0x7'));var rimraf=require(_0x572a('0x8'));var config=require(_0x572a('0x9'));var attributes=require(_0x572a('0xa'));module[_0x572a('0xb')]=function(_0x3771b8,_0x4e62ad){return _0x3771b8[_0x572a('0xc')](_0x572a('0xd'),attributes,{'tableName':_0x572a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa506=['rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1390d5,_0x237f99){var _0x4d87da=function(_0x1cb6ef){while(--_0x1cb6ef){_0x1390d5['push'](_0x1390d5['shift']());}};_0x4d87da(++_0x237f99);}(_0xa506,0xca));var _0x6a50=function(_0x40c6c1,_0x2579c0){_0x40c6c1=_0x40c6c1-0x0;var _0x158988=_0xa506[_0x40c6c1];return _0x158988;};'use strict';var _=require(_0x6a50('0x0'));var util=require(_0x6a50('0x1'));var logger=require(_0x6a50('0x2'))(_0x6a50('0x3'));var moment=require(_0x6a50('0x4'));var BPromise=require(_0x6a50('0x5'));var rp=require(_0x6a50('0x6'));var fs=require('fs');var path=require(_0x6a50('0x7'));var rimraf=require(_0x6a50('0x8'));var config=require(_0x6a50('0x9'));var attributes=require(_0x6a50('0xa'));module[_0x6a50('0xb')]=function(_0x179ef1,_0x265bc3){return _0x179ef1[_0x6a50('0xc')](_0x6a50('0xd'),attributes,{'tableName':_0x6a50('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9703f12..8793c8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc9d=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x2e80b3,_0x1f73e2){_0x2e80b3=_0x2e80b3-0x0;var _0x1269b5=_0xbc9d[_0x2e80b3];return _0x1269b5;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require(_0xdbc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var config=require(_0xdbc9('0x7'));var jayson=require(_0xdbc9('0x8'));var client=jayson[_0xdbc9('0x9')][_0xdbc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381a0e,_0x4a9246,_0x2dbd23){return new BPromise(function(_0x181f8a,_0x3d4918){return client['request'](_0x381a0e,_0x2dbd23)[_0xdbc9('0xb')](function(_0x53cff1){logger['info'](_0xdbc9('0xc'),_0x4a9246,_0xdbc9('0xd'));logger[_0xdbc9('0xe')](_0xdbc9('0xf'),_0x4a9246,'request\x20sent',JSON[_0xdbc9('0x10')](_0x53cff1));if(_0x53cff1[_0xdbc9('0x11')]){if(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x12')]===0x1f4){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1['error']['message']);return _0x3d4918(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1[_0xdbc9('0x11')]['message']);return _0x181f8a(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}else{logger[_0xdbc9('0x14')]('Migration,\x20%s,\x20%s',_0x4a9246,_0xdbc9('0xd'));_0x181f8a(_0x53cff1[_0xdbc9('0x15')]['message']);}})[_0xdbc9('0x16')](function(_0x37856d){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x37856d);_0x3d4918(_0x37856d);});});}
\ No newline at end of file
+var _0x453b=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd86c1f,_0x155733){var _0x2ec664=function(_0x36b76e){while(--_0x36b76e){_0xd86c1f['push'](_0xd86c1f['shift']());}};_0x2ec664(++_0x155733);}(_0x453b,0x164));var _0xb453=function(_0x5a488c,_0x4cc470){_0x5a488c=_0x5a488c-0x0;var _0x53a7d6=_0x453b[_0x5a488c];return _0x53a7d6;};'use strict';var _=require(_0xb453('0x0'));var util=require(_0xb453('0x1'));var moment=require(_0xb453('0x2'));var BPromise=require(_0xb453('0x3'));var rs=require(_0xb453('0x4'));var fs=require('fs');var Redis=require(_0xb453('0x5'));var db=require(_0xb453('0x6'))['db'];var utils=require(_0xb453('0x7'));var logger=require(_0xb453('0x8'))(_0xb453('0x9'));var config=require(_0xb453('0xa'));var jayson=require(_0xb453('0xb'));var client=jayson[_0xb453('0xc')][_0xb453('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1ab841,_0x2436a7,_0x4fdd93){return new BPromise(function(_0x12c490,_0x3486a8){return client['request'](_0x1ab841,_0x4fdd93)[_0xb453('0xe')](function(_0x51337f){logger[_0xb453('0xf')](_0xb453('0x10'),_0x2436a7,_0xb453('0x11'));logger[_0xb453('0x12')]('Migration,\x20%s,\x20%s,\x20%s',_0x2436a7,_0xb453('0x11'),JSON[_0xb453('0x13')](_0x51337f));if(_0x51337f[_0xb453('0x14')]){if(_0x51337f[_0xb453('0x14')][_0xb453('0x15')]===0x1f4){logger[_0xb453('0x14')](_0xb453('0x10'),_0x2436a7,_0x51337f[_0xb453('0x14')][_0xb453('0x16')]);return _0x3486a8(_0x51337f['error']['message']);}logger['error'](_0xb453('0x10'),_0x2436a7,_0x51337f['error'][_0xb453('0x16')]);return _0x12c490(_0x51337f[_0xb453('0x14')][_0xb453('0x16')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x2436a7,_0xb453('0x11'));_0x12c490(_0x51337f[_0xb453('0x17')][_0xb453('0x16')]);}})[_0xb453('0x18')](function(_0x139ed2){logger[_0xb453('0x14')](_0xb453('0x10'),_0x2436a7,_0x139ed2);_0x3486a8(_0x139ed2);});});}
\ No newline at end of file
index 676ea81..ac1e5df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4137=['index','/:id','isAuthenticated','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0x154c22,_0x4430b3){var _0x33f7ed=function(_0xa638bd){while(--_0xa638bd){_0x154c22['push'](_0x154c22['shift']());}};_0x33f7ed(++_0x4430b3);}(_0x4137,0xf8));var _0x7413=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4137[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['show']);router[_0x7413('0xf')]('/',auth[_0x7413('0xe')](),controller['create']);router[_0x7413('0x10')](_0x7413('0xd'),auth['isAuthenticated'](),controller[_0x7413('0x11')]);router[_0x7413('0x12')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller[_0x7413('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x5388=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','post','put','update','delete','destroy','exports'];(function(_0x5084a5,_0x431fa2){var _0x16f480=function(_0x287bc3){while(--_0x287bc3){_0x5084a5['push'](_0x5084a5['shift']());}};_0x16f480(++_0x431fa2);}(_0x5388,0xee));var _0x8538=function(_0x13357f,_0x210dc8){_0x13357f=_0x13357f-0x0;var _0x1fbbf1=_0x5388[_0x13357f];return _0x1fbbf1;};'use strict';var multer=require(_0x8538('0x0'));var util=require(_0x8538('0x1'));var path=require(_0x8538('0x2'));var timeout=require(_0x8538('0x3'));var express=require(_0x8538('0x4'));var router=express[_0x8538('0x5')]();var fs_extra=require(_0x8538('0x6'));var auth=require(_0x8538('0x7'));var interaction=require(_0x8538('0x8'));var config=require('../../config/environment');var controller=require('./network.controller');router['get']('/',auth[_0x8538('0x9')](),controller['index']);router['get'](_0x8538('0xa'),auth[_0x8538('0x9')](),controller['show']);router[_0x8538('0xb')]('/',auth[_0x8538('0x9')](),controller['create']);router[_0x8538('0xc')](_0x8538('0xa'),auth[_0x8538('0x9')](),controller[_0x8538('0xd')]);router[_0x8538('0xe')](_0x8538('0xa'),auth[_0x8538('0x9')](),controller[_0x8538('0xf')]);module[_0x8538('0x10')]=router;
\ No newline at end of file
index 07e3fc5..d000e4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8187=['exports','ENUM','localnet','stun','turn','STRING'];(function(_0x49bb28,_0x5aa095){var _0x383a0a=function(_0x4f9ac5){while(--_0x4f9ac5){_0x49bb28['push'](_0x49bb28['shift']());}};_0x383a0a(++_0x5aa095);}(_0x8187,0x102));var _0x7818=function(_0x408b46,_0x41e2ae){_0x408b46=_0x408b46-0x0;var _0x57f8ca=_0x8187[_0x408b46];return _0x57f8ca;};'use strict';var Sequelize=require('sequelize');module[_0x7818('0x0')]={'type':{'type':Sequelize[_0x7818('0x1')](_0x7818('0x2'),'externip',_0x7818('0x3'),_0x7818('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7818('0x5')]},'password':{'type':Sequelize[_0x7818('0x5')]}};
\ No newline at end of file
+var _0x792e=['ENUM','externip','stun','turn','STRING','sequelize','exports'];(function(_0x499b6f,_0x1f1a6d){var _0x5b3b0a=function(_0xf51b1){while(--_0xf51b1){_0x499b6f['push'](_0x499b6f['shift']());}};_0x5b3b0a(++_0x1f1a6d);}(_0x792e,0x139));var _0xe792=function(_0x3c7999,_0x36868d){_0x3c7999=_0x3c7999-0x0;var _0x4723b4=_0x792e[_0x3c7999];return _0x4723b4;};'use strict';var Sequelize=require(_0xe792('0x0'));module[_0xe792('0x1')]={'type':{'type':Sequelize[_0xe792('0x2')]('localnet',_0xe792('0x3'),_0xe792('0x4'),_0xe792('0x5'))},'value':{'type':Sequelize[_0xe792('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xe792('0x6')]}};
\ No newline at end of file
index 073c40a..6ea748d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['message','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','save','update','destroy','end','index','Network','rawAttributes','fieldName','type','key','map','name','query','attributes','intersection','model','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','fields','find','create','sequelize','body','toUpperCase','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','toLowerCase','server/files/templates/network.ejs','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x251626,_0x4e8982){var _0x4502ab=function(_0x59e9e1){while(--_0x59e9e1){_0x251626['push'](_0x251626['shift']());}};_0x4502ab(++_0x4e8982);}(_0x7da7,0x10d));var _0x77da=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x7da7[_0x43a37c];return _0x5d1d40;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];var jayson=require(_0x77da('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26e3ff,_0x4263d9,_0x589aa1,_0x3b0ff2){return new BPromise(function(_0x369df0,_0x355719){var _0x3c87c2=_0x3b0ff2||client;return _0x3c87c2['request'](_0x26e3ff,_0x589aa1)[_0x77da('0x18')](function(_0x4e130c){logger[_0x77da('0x19')](_0x77da('0x1a'),_0x4263d9,_0x77da('0x1b'));logger[_0x77da('0x1c')]('Network,\x20%s,\x20%s,\x20%s',_0x4263d9,'request\x20sent',JSON['stringify'](_0x4e130c));if(_0x4e130c['error']){if(_0x4e130c[_0x77da('0x1d')][_0x77da('0x1e')]===0x1f4){logger[_0x77da('0x1d')](_0x77da('0x1a'),_0x4263d9,_0x4e130c[_0x77da('0x1d')][_0x77da('0x1f')]);return _0x355719(_0x4e130c[_0x77da('0x1d')][_0x77da('0x1f')]);}logger['error']('Network,\x20%s,\x20%s',_0x4263d9,_0x4e130c[_0x77da('0x1d')][_0x77da('0x1f')]);return _0x369df0(_0x4e130c['error'][_0x77da('0x1f')]);}else{logger[_0x77da('0x19')](_0x77da('0x1a'),_0x4263d9,'request\x20sent');_0x369df0(_0x4e130c['result'][_0x77da('0x1f')]);}})['catch'](function(_0x175ac4){logger[_0x77da('0x1d')](_0x77da('0x1a'),_0x4263d9,_0x175ac4);_0x355719(_0x175ac4);});});}function respondWithStatusCode(_0x27b6c7,_0x10399a){_0x10399a=_0x10399a||0xcc;return function(_0x270318){if(_0x270318){return _0x27b6c7[_0x77da('0x20')](_0x10399a);}return _0x27b6c7['status'](_0x10399a)['end']();};}function respondWithResult(_0xfd160,_0x2d009f){_0x2d009f=_0x2d009f||0xc8;return function(_0x835167){if(_0x835167){return _0xfd160[_0x77da('0x21')](_0x2d009f)['json'](_0x835167);}};}function respondWithFilteredResult(_0x42240b,_0x167240){return function(_0x470c9f){if(_0x470c9f){var _0x36115b=typeof _0x167240[_0x77da('0x22')]==='undefined'&&typeof _0x167240[_0x77da('0x23')]===_0x77da('0x24');var _0x1f2279=_0x470c9f[_0x77da('0x25')];var _0x496ecd=_0x36115b?0x0:_0x167240['offset'];var _0x4d395a=_0x36115b?_0x470c9f[_0x77da('0x25')]:_0x167240[_0x77da('0x22')]+_0x167240[_0x77da('0x23')];var _0x3394d6;if(_0x4d395a>=_0x1f2279){_0x4d395a=_0x1f2279;_0x3394d6=0xc8;}else{_0x3394d6=0xce;}_0x42240b[_0x77da('0x21')](_0x3394d6);return _0x42240b['set'](_0x77da('0x26'),_0x496ecd+'-'+_0x4d395a+'/'+_0x1f2279)[_0x77da('0x27')](_0x470c9f);}return null;};}function patchUpdates(_0x356bfb){return function(_0x1d381b){try{jsonpatch[_0x77da('0x28')](_0x1d381b,_0x356bfb,!![]);}catch(_0x46e6b4){return BPromise['reject'](_0x46e6b4);}return _0x1d381b[_0x77da('0x29')]();};}function saveUpdates(_0x228851,_0x1e1fae){return function(_0x38643a){if(_0x38643a){return _0x38643a[_0x77da('0x2a')](_0x228851)[_0x77da('0x18')](function(_0x3343b4){return _0x3343b4;});}return null;};}function removeEntity(_0x2c790d,_0x5b9b05){return function(_0x5e8d1e){if(_0x5e8d1e){return _0x5e8d1e[_0x77da('0x2b')]()[_0x77da('0x18')](function(){_0x2c790d['status'](0xcc)[_0x77da('0x2c')]();});}};}function handleEntityNotFound(_0x390399,_0x1f7993){return function(_0x10540a){if(!_0x10540a){_0x390399[_0x77da('0x20')](0x194);}return _0x10540a;};}function handleError(_0x161d8c,_0x20d1cc){_0x20d1cc=_0x20d1cc||0x1f4;return function(_0x5c4a03){logger[_0x77da('0x1d')](_0x5c4a03['stack']);if(_0x5c4a03['name']){delete _0x5c4a03['name'];}_0x161d8c[_0x77da('0x21')](_0x20d1cc)['send'](_0x5c4a03);};}exports[_0x77da('0x2d')]=function(_0xdac1a4,_0xce9df2){var _0x3cc78b={},_0x3c46d2={},_0x3f0593={'count':0x0,'rows':[]};var _0x43c20a=_['map'](db[_0x77da('0x2e')][_0x77da('0x2f')],function(_0x1ca53a){return{'name':_0x1ca53a[_0x77da('0x30')],'type':_0x1ca53a[_0x77da('0x31')][_0x77da('0x32')]};});_0x3c46d2['model']=_[_0x77da('0x33')](_0x43c20a,_0x77da('0x34'));_0x3c46d2[_0x77da('0x35')]=_['keys'](_0xdac1a4[_0x77da('0x35')]);_0x3c46d2['filters']=_['intersection'](_0x3c46d2['model'],_0x3c46d2['query']);_0x3cc78b[_0x77da('0x36')]=_[_0x77da('0x37')](_0x3c46d2[_0x77da('0x38')],qs['fields'](_0xdac1a4[_0x77da('0x35')]['fields']));_0x3cc78b[_0x77da('0x36')]=_0x3cc78b['attributes'][_0x77da('0x39')]?_0x3cc78b[_0x77da('0x36')]:_0x3c46d2[_0x77da('0x38')];if(!_0xdac1a4[_0x77da('0x35')][_0x77da('0x3a')]('nolimit')){_0x3cc78b[_0x77da('0x23')]=qs[_0x77da('0x23')](_0xdac1a4[_0x77da('0x35')][_0x77da('0x23')]);_0x3cc78b[_0x77da('0x22')]=qs[_0x77da('0x22')](_0xdac1a4['query'][_0x77da('0x22')]);}_0x3cc78b[_0x77da('0x3b')]=qs[_0x77da('0x3c')](_0xdac1a4[_0x77da('0x35')][_0x77da('0x3c')]);_0x3cc78b[_0x77da('0x3d')]=qs['filters'](_[_0x77da('0x3e')](_0xdac1a4['query'],_0x3c46d2[_0x77da('0x3f')]),_0x43c20a);if(_0xdac1a4[_0x77da('0x35')][_0x77da('0x40')]){_0x3cc78b['where']=_[_0x77da('0x41')](_0x3cc78b[_0x77da('0x3d')],{'$or':_[_0x77da('0x33')](_0x43c20a,function(_0x3cb2dd){if(_0x3cb2dd[_0x77da('0x31')]!==_0x77da('0x42')){var _0x203caa={};_0x203caa[_0x3cb2dd[_0x77da('0x34')]]={'$like':'%'+_0xdac1a4[_0x77da('0x35')]['filter']+'%'};return _0x203caa;}})});}_0x3cc78b=_[_0x77da('0x41')]({},_0x3cc78b,_0xdac1a4[_0x77da('0x43')]);var _0x46f289={'where':_0x3cc78b[_0x77da('0x3d')]};return db[_0x77da('0x2e')][_0x77da('0x25')](_0x46f289)['then'](function(_0x54f88c){_0x3f0593[_0x77da('0x25')]=_0x54f88c;if(_0xdac1a4[_0x77da('0x35')][_0x77da('0x44')]){_0x3cc78b[_0x77da('0x45')]=[{'all':!![]}];}return db[_0x77da('0x2e')][_0x77da('0x46')](_0x3cc78b);})['then'](function(_0x6ccb8f){_0x3f0593[_0x77da('0x47')]=_0x6ccb8f;return _0x3f0593;})[_0x77da('0x18')](respondWithFilteredResult(_0xce9df2,_0x3cc78b))[_0x77da('0x48')](handleError(_0xce9df2,null));};exports['show']=function(_0x1c4f43,_0x5d2d3e){var _0x518fd5={'raw':!![],'where':{'id':_0x1c4f43[_0x77da('0x49')]['id']}},_0x36263b={};_0x36263b[_0x77da('0x38')]=_[_0x77da('0x4a')](db['Network'][_0x77da('0x2f')]);_0x36263b[_0x77da('0x35')]=_['keys'](_0x1c4f43[_0x77da('0x35')]);_0x36263b[_0x77da('0x3f')]=_['intersection'](_0x36263b[_0x77da('0x38')],_0x36263b[_0x77da('0x35')]);_0x518fd5[_0x77da('0x36')]=_[_0x77da('0x37')](_0x36263b[_0x77da('0x38')],qs[_0x77da('0x4b')](_0x1c4f43[_0x77da('0x35')][_0x77da('0x4b')]));_0x518fd5[_0x77da('0x36')]=_0x518fd5[_0x77da('0x36')]['length']?_0x518fd5[_0x77da('0x36')]:_0x36263b['model'];if(_0x1c4f43[_0x77da('0x35')][_0x77da('0x44')]){_0x518fd5[_0x77da('0x45')]=[{'all':!![]}];}_0x518fd5=_[_0x77da('0x41')]({},_0x518fd5,_0x1c4f43[_0x77da('0x43')]);return db[_0x77da('0x2e')][_0x77da('0x4c')](_0x518fd5)['then'](handleEntityNotFound(_0x5d2d3e,null))[_0x77da('0x18')](respondWithResult(_0x5d2d3e,null))[_0x77da('0x48')](handleError(_0x5d2d3e,null));};exports[_0x77da('0x4d')]=function(_0x353be9,_0x4f30a1,_0x2c4f68){var _0x3637e5;return db[_0x77da('0x4e')]['transaction'](function(_0x5a7ba7){return db[_0x77da('0x2e')][_0x77da('0x4d')](_0x353be9[_0x77da('0x4f')],{'raw':!![]})[_0x77da('0x18')](function(_0x451897){_0x3637e5=_0x451897;return db['Network']['findAll']({'where':{'type':_0x353be9[_0x77da('0x4f')][_0x77da('0x31')]},'raw':!![]});})['then'](function(_0xf385e8){if(_0x3637e5[_0x77da('0x31')][_0x77da('0x50')]()=='STUN'){var _0x1d665d=fs[_0x77da('0x51')](path['join'](config[_0x77da('0x52')],_0x77da('0x53')),_0x77da('0x54'));var _0x1a4bab=ejs[_0x77da('0x55')](_0x1d665d,{'networks':_0xf385e8||[]});fs[_0x77da('0x56')](_0x77da('0x57'),_0x1a4bab);return respondWithRpcPromise(_0x77da('0x58'),_0x77da('0x4d'),{'module':'res_stun_monitor.so'});}else if(_0x3637e5[_0x77da('0x31')][_0x77da('0x50')]()==_0x77da('0x59')){var _0x2e92f4=fs[_0x77da('0x51')](path[_0x77da('0x5a')](config['root'],_0x77da('0x5b')),_0x77da('0x54'));var _0x20fa62=ejs['render'](_0x2e92f4,{'networks':_0xf385e8||[]});fs[_0x77da('0x56')](_0x77da('0x5c'),_0x20fa62);return respondWithRpcPromise(_0x77da('0x58'),_0x77da('0x4d'),{'module':_0x77da('0x5d')});}else{var _0x43c6fa=fs[_0x77da('0x51')](path['join'](config[_0x77da('0x52')],'server/files/templates/network.ejs'),_0x77da('0x54'));var _0x1922ab=ejs[_0x77da('0x55')](_0x43c6fa,{'networks':_0xf385e8||[]});fs['writeFileSync'](util[_0x77da('0x5e')](_0x77da('0x5f'),_0x353be9[_0x77da('0x4f')][_0x77da('0x31')]['toLowerCase']()),_0x1922ab);return respondWithRpcPromise('Reload','create',{'module':_0x77da('0x60')});}return null;})[_0x77da('0x18')](function(){return _0x3637e5;});})[_0x77da('0x18')](respondWithResult(_0x4f30a1,0xc9))[_0x77da('0x48')](handleError(_0x4f30a1,null));};exports[_0x77da('0x2a')]=function(_0x454f35,_0x2c30f5,_0x225d88){var _0x4399d3;return db[_0x77da('0x4e')]['transaction'](function(_0x3028ca){return db[_0x77da('0x2e')]['find']({'where':{'id':_0x454f35['params']['id']}})[_0x77da('0x18')](handleEntityNotFound(_0x2c30f5,null))['then'](saveUpdates(_0x454f35[_0x77da('0x4f')],null))[_0x77da('0x18')](function(_0x1ff554){if(_0x1ff554){_0x4399d3=_0x1ff554;return db['Network'][_0x77da('0x46')]({'where':{'type':_0x4399d3[_0x77da('0x31')]},'raw':!![]});}return null;})[_0x77da('0x18')](function(_0x3bc8b1){if(_0x4399d3[_0x77da('0x31')]['toUpperCase']()==_0x77da('0x61')){var _0x20a636=fs['readFileSync'](path[_0x77da('0x5a')](config[_0x77da('0x52')],_0x77da('0x53')),_0x77da('0x54'));var _0x14496e=ejs[_0x77da('0x55')](_0x20a636,{'networks':_0x3bc8b1||[]});fs[_0x77da('0x56')]('/etc/asterisk/stun_xcally.conf',_0x14496e);return respondWithRpcPromise(_0x77da('0x58'),'update',{'module':_0x77da('0x5d')});}else if(_0x4399d3[_0x77da('0x31')][_0x77da('0x50')]()==_0x77da('0x59')){var _0x470619=fs[_0x77da('0x51')](path[_0x77da('0x5a')](config[_0x77da('0x52')],_0x77da('0x5b')),_0x77da('0x54'));var _0x3c9ca7=ejs[_0x77da('0x55')](_0x470619,{'networks':_0x3bc8b1||[]});fs['writeFileSync'](_0x77da('0x5c'),_0x3c9ca7);return respondWithRpcPromise(_0x77da('0x58'),_0x77da('0x2a'),{'module':_0x77da('0x5d')});}else{var _0x57b710=fs[_0x77da('0x51')](path[_0x77da('0x5a')](config[_0x77da('0x52')],'server/files/templates/network.ejs'),_0x77da('0x54'));var _0x4912d6=ejs['render'](_0x57b710,{'networks':_0x3bc8b1||[]});fs[_0x77da('0x56')](util[_0x77da('0x5e')](_0x77da('0x5f'),_0x454f35[_0x77da('0x4f')][_0x77da('0x31')][_0x77da('0x62')]()),_0x4912d6);return respondWithRpcPromise(_0x77da('0x58'),_0x77da('0x2a'),{'module':_0x77da('0x60')});}return null;})['then'](function(_0x35a390){if(_0x35a390){return _0x4399d3;}return null;});})[_0x77da('0x18')](respondWithResult(_0x2c30f5,null))[_0x77da('0x48')](handleError(_0x2c30f5,null));};exports[_0x77da('0x2b')]=function(_0x17175,_0x502249,_0x22eb45){var _0x3eb081;return db[_0x77da('0x2e')][_0x77da('0x4c')]({'where':{'id':_0x17175[_0x77da('0x49')]['id']}})[_0x77da('0x18')](function(_0x16cd9b){_0x3eb081=_0x16cd9b;return _0x16cd9b;})[_0x77da('0x18')](handleEntityNotFound(_0x502249,null))[_0x77da('0x18')](removeEntity(_0x502249,null))[_0x77da('0x18')](function(){if(_0x3eb081){return db['Network']['findAll']({'where':{'type':_0x3eb081['type']},'raw':!![]});}})[_0x77da('0x18')](function(_0x275eeb){if(_0x3eb081[_0x77da('0x31')]['toUpperCase']()=='STUN'){var _0x30b803=fs[_0x77da('0x51')](path[_0x77da('0x5a')](config[_0x77da('0x52')],_0x77da('0x53')),_0x77da('0x54'));var _0x3fca4b=ejs[_0x77da('0x55')](_0x30b803,{'networks':_0x275eeb||[]});fs[_0x77da('0x56')](_0x77da('0x57'),_0x3fca4b);return respondWithRpcPromise(_0x77da('0x58'),_0x77da('0x2b'),{'module':_0x77da('0x5d')});}else if(_0x3eb081['type']['toUpperCase']()==_0x77da('0x59')){var _0x5c8859=fs['readFileSync'](path[_0x77da('0x5a')](config[_0x77da('0x52')],_0x77da('0x5b')),'utf8');var _0x479ec5=ejs[_0x77da('0x55')](_0x5c8859,{'networks':_0x275eeb||[]});fs['writeFileSync'](_0x77da('0x5c'),_0x479ec5);return respondWithRpcPromise(_0x77da('0x58'),'destroy',{'module':_0x77da('0x5d')});}else{var _0x505520=fs[_0x77da('0x51')](path[_0x77da('0x5a')](config[_0x77da('0x52')],_0x77da('0x63')),'utf8');var _0x429eb7=ejs[_0x77da('0x55')](_0x505520,{'networks':_0x275eeb||[]});fs[_0x77da('0x56')](util[_0x77da('0x5e')](_0x77da('0x5f'),_0x17175[_0x77da('0x4f')][_0x77da('0x31')]['toLowerCase']()),_0x429eb7);return respondWithRpcPromise('Reload',_0x77da('0x2b'),{'module':_0x77da('0x60')});}return null;})[_0x77da('0x48')](handleError(_0x502249,null));};
\ No newline at end of file
+var _0x5885=['catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','Network','includeAll','include','findAll','show','params','length','find','transaction','create','body','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x1c1b99,_0x2fa392){var _0x2a06b3=function(_0x1c20ad){while(--_0x1c20ad){_0x1c1b99['push'](_0x1c1b99['shift']());}};_0x2a06b3(++_0x2fa392);}(_0x5885,0x1f1));var _0x5588=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5885[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5588('0x0'));var rimraf=require(_0x5588('0x1'));var zipdir=require(_0x5588('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5588('0x3'));var moment=require(_0x5588('0x4'));var BPromise=require(_0x5588('0x5'));var Mustache=require(_0x5588('0x6'));var util=require(_0x5588('0x7'));var path=require('path');var sox=require(_0x5588('0x8'));var csv=require(_0x5588('0x9'));var ejs=require(_0x5588('0xa'));var fs=require('fs');var fs_extra=require(_0x5588('0xb'));var _=require('lodash');var squel=require(_0x5588('0xc'));var crypto=require(_0x5588('0xd'));var jsforce=require(_0x5588('0xe'));var deskjs=require(_0x5588('0xf'));var toCsv=require(_0x5588('0x9'));var querystring=require(_0x5588('0x10'));var Papa=require('papaparse');var Redis=require(_0x5588('0x11'));var authService=require(_0x5588('0x12'));var qs=require(_0x5588('0x13'));var as=require(_0x5588('0x14'));var hardwareService=require(_0x5588('0x15'));var logger=require('../../config/logger')(_0x5588('0x16'));var utils=require('../../config/utils');var config=require(_0x5588('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5588('0x18'))['db'];var jayson=require(_0x5588('0x19'));var client=jayson['client'][_0x5588('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2d1c3a,_0x27502a,_0x2b852a,_0x5a87f0){return new BPromise(function(_0x579845,_0x2ced27){var _0x1ce62d=_0x5a87f0||client;return _0x1ce62d[_0x5588('0x1b')](_0x2d1c3a,_0x2b852a)[_0x5588('0x1c')](function(_0x1e85a6){logger['info'](_0x5588('0x1d'),_0x27502a,_0x5588('0x1e'));logger[_0x5588('0x1f')](_0x5588('0x20'),_0x27502a,_0x5588('0x1e'),JSON[_0x5588('0x21')](_0x1e85a6));if(_0x1e85a6[_0x5588('0x22')]){if(_0x1e85a6[_0x5588('0x22')]['code']===0x1f4){logger[_0x5588('0x22')]('Network,\x20%s,\x20%s',_0x27502a,_0x1e85a6[_0x5588('0x22')][_0x5588('0x23')]);return _0x2ced27(_0x1e85a6[_0x5588('0x22')]['message']);}logger[_0x5588('0x22')]('Network,\x20%s,\x20%s',_0x27502a,_0x1e85a6['error']['message']);return _0x579845(_0x1e85a6[_0x5588('0x22')][_0x5588('0x23')]);}else{logger[_0x5588('0x24')](_0x5588('0x1d'),_0x27502a,_0x5588('0x1e'));_0x579845(_0x1e85a6[_0x5588('0x25')][_0x5588('0x23')]);}})[_0x5588('0x26')](function(_0x25f960){logger['error'](_0x5588('0x1d'),_0x27502a,_0x25f960);_0x2ced27(_0x25f960);});});}function respondWithStatusCode(_0x4c765d,_0x1fa110){_0x1fa110=_0x1fa110||0xcc;return function(_0x9bc391){if(_0x9bc391){return _0x4c765d[_0x5588('0x27')](_0x1fa110);}return _0x4c765d['status'](_0x1fa110)[_0x5588('0x28')]();};}function respondWithResult(_0x5af3ac,_0x519b05){_0x519b05=_0x519b05||0xc8;return function(_0x4ed417){if(_0x4ed417){return _0x5af3ac[_0x5588('0x29')](_0x519b05)[_0x5588('0x2a')](_0x4ed417);}};}function respondWithFilteredResult(_0x298399,_0x11c2ce){return function(_0xbd0c8f){if(_0xbd0c8f){var _0x4021c8=typeof _0x11c2ce[_0x5588('0x2b')]===_0x5588('0x2c')&&typeof _0x11c2ce[_0x5588('0x2d')]===_0x5588('0x2c');var _0x76ca66=_0xbd0c8f[_0x5588('0x2e')];var _0x379ae8=_0x4021c8?0x0:_0x11c2ce[_0x5588('0x2b')];var _0x22b011=_0x4021c8?_0xbd0c8f['count']:_0x11c2ce[_0x5588('0x2b')]+_0x11c2ce['limit'];var _0x34fd0d;if(_0x22b011>=_0x76ca66){_0x22b011=_0x76ca66;_0x34fd0d=0xc8;}else{_0x34fd0d=0xce;}_0x298399[_0x5588('0x29')](_0x34fd0d);return _0x298399[_0x5588('0x2f')](_0x5588('0x30'),_0x379ae8+'-'+_0x22b011+'/'+_0x76ca66)[_0x5588('0x2a')](_0xbd0c8f);}return null;};}function patchUpdates(_0x3a4bac){return function(_0x43add5){try{jsonpatch[_0x5588('0x31')](_0x43add5,_0x3a4bac,!![]);}catch(_0x263a81){return BPromise[_0x5588('0x32')](_0x263a81);}return _0x43add5[_0x5588('0x33')]();};}function saveUpdates(_0x5ca9d2,_0x1617a2){return function(_0xb6a6a){if(_0xb6a6a){return _0xb6a6a['update'](_0x5ca9d2)[_0x5588('0x1c')](function(_0x3dbe0c){return _0x3dbe0c;});}return null;};}function removeEntity(_0x387762,_0x1440c1){return function(_0x36c4d1){if(_0x36c4d1){return _0x36c4d1[_0x5588('0x34')]()[_0x5588('0x1c')](function(){_0x387762[_0x5588('0x29')](0xcc)[_0x5588('0x28')]();});}};}function handleEntityNotFound(_0x3303ba,_0xaa575d){return function(_0xc001c6){if(!_0xc001c6){_0x3303ba['sendStatus'](0x194);}return _0xc001c6;};}function handleError(_0x5daf69,_0x11a7de){_0x11a7de=_0x11a7de||0x1f4;return function(_0x1053a2){logger[_0x5588('0x22')](_0x1053a2[_0x5588('0x35')]);if(_0x1053a2[_0x5588('0x36')]){delete _0x1053a2[_0x5588('0x36')];}_0x5daf69['status'](_0x11a7de)[_0x5588('0x37')](_0x1053a2);};}exports[_0x5588('0x38')]=function(_0x524eac,_0xdafdac){var _0x438d45={},_0x1fd2f8={},_0x5a9782={'count':0x0,'rows':[]};var _0x1cc3c3=_[_0x5588('0x39')](db['Network'][_0x5588('0x3a')],function(_0x5bdb77){return{'name':_0x5bdb77[_0x5588('0x3b')],'type':_0x5bdb77[_0x5588('0x3c')][_0x5588('0x3d')]};});_0x1fd2f8[_0x5588('0x3e')]=_[_0x5588('0x39')](_0x1cc3c3,'name');_0x1fd2f8[_0x5588('0x3f')]=_[_0x5588('0x40')](_0x524eac[_0x5588('0x3f')]);_0x1fd2f8['filters']=_['intersection'](_0x1fd2f8[_0x5588('0x3e')],_0x1fd2f8[_0x5588('0x3f')]);_0x438d45[_0x5588('0x41')]=_[_0x5588('0x42')](_0x1fd2f8['model'],qs[_0x5588('0x43')](_0x524eac['query']['fields']));_0x438d45[_0x5588('0x41')]=_0x438d45[_0x5588('0x41')]['length']?_0x438d45[_0x5588('0x41')]:_0x1fd2f8[_0x5588('0x3e')];if(!_0x524eac[_0x5588('0x3f')]['hasOwnProperty'](_0x5588('0x44'))){_0x438d45['limit']=qs['limit'](_0x524eac[_0x5588('0x3f')][_0x5588('0x2d')]);_0x438d45[_0x5588('0x2b')]=qs[_0x5588('0x2b')](_0x524eac['query'][_0x5588('0x2b')]);}_0x438d45['order']=qs[_0x5588('0x45')](_0x524eac['query'][_0x5588('0x45')]);_0x438d45[_0x5588('0x46')]=qs[_0x5588('0x47')](_['pick'](_0x524eac[_0x5588('0x3f')],_0x1fd2f8[_0x5588('0x47')]),_0x1cc3c3);if(_0x524eac['query'][_0x5588('0x48')]){_0x438d45[_0x5588('0x46')]=_[_0x5588('0x49')](_0x438d45[_0x5588('0x46')],{'$or':_[_0x5588('0x39')](_0x1cc3c3,function(_0x1ef0ea){if(_0x1ef0ea[_0x5588('0x3c')]!==_0x5588('0x4a')){var _0x481751={};_0x481751[_0x1ef0ea[_0x5588('0x36')]]={'$like':'%'+_0x524eac[_0x5588('0x3f')][_0x5588('0x48')]+'%'};return _0x481751;}})});}_0x438d45=_['merge']({},_0x438d45,_0x524eac[_0x5588('0x4b')]);var _0x623534={'where':_0x438d45[_0x5588('0x46')]};return db[_0x5588('0x4c')][_0x5588('0x2e')](_0x623534)[_0x5588('0x1c')](function(_0x2082d0){_0x5a9782['count']=_0x2082d0;if(_0x524eac[_0x5588('0x3f')][_0x5588('0x4d')]){_0x438d45[_0x5588('0x4e')]=[{'all':!![]}];}return db[_0x5588('0x4c')][_0x5588('0x4f')](_0x438d45);})[_0x5588('0x1c')](function(_0x1abfac){_0x5a9782['rows']=_0x1abfac;return _0x5a9782;})[_0x5588('0x1c')](respondWithFilteredResult(_0xdafdac,_0x438d45))['catch'](handleError(_0xdafdac,null));};exports[_0x5588('0x50')]=function(_0x154138,_0x1cd1df){var _0x546043={'raw':!![],'where':{'id':_0x154138[_0x5588('0x51')]['id']}},_0x3927bb={};_0x3927bb['model']=_[_0x5588('0x40')](db[_0x5588('0x4c')][_0x5588('0x3a')]);_0x3927bb[_0x5588('0x3f')]=_[_0x5588('0x40')](_0x154138[_0x5588('0x3f')]);_0x3927bb[_0x5588('0x47')]=_[_0x5588('0x42')](_0x3927bb['model'],_0x3927bb[_0x5588('0x3f')]);_0x546043[_0x5588('0x41')]=_[_0x5588('0x42')](_0x3927bb[_0x5588('0x3e')],qs['fields'](_0x154138[_0x5588('0x3f')]['fields']));_0x546043['attributes']=_0x546043['attributes'][_0x5588('0x52')]?_0x546043[_0x5588('0x41')]:_0x3927bb[_0x5588('0x3e')];if(_0x154138[_0x5588('0x3f')][_0x5588('0x4d')]){_0x546043[_0x5588('0x4e')]=[{'all':!![]}];}_0x546043=_[_0x5588('0x49')]({},_0x546043,_0x154138[_0x5588('0x4b')]);return db[_0x5588('0x4c')][_0x5588('0x53')](_0x546043)[_0x5588('0x1c')](handleEntityNotFound(_0x1cd1df,null))[_0x5588('0x1c')](respondWithResult(_0x1cd1df,null))['catch'](handleError(_0x1cd1df,null));};exports['create']=function(_0x1d4683,_0x2d187c,_0x29f8ce){var _0x5cf4a6;return db['sequelize'][_0x5588('0x54')](function(_0x5243a8){return db[_0x5588('0x4c')][_0x5588('0x55')](_0x1d4683[_0x5588('0x56')],{'raw':!![]})['then'](function(_0x20b92b){_0x5cf4a6=_0x20b92b;return db[_0x5588('0x4c')][_0x5588('0x4f')]({'where':{'type':_0x1d4683[_0x5588('0x56')][_0x5588('0x3c')]},'raw':!![]});})['then'](function(_0x3600a9){if(_0x5cf4a6[_0x5588('0x3c')]['toUpperCase']()=='STUN'){var _0x383a21=fs['readFileSync'](path[_0x5588('0x57')](config[_0x5588('0x58')],_0x5588('0x59')),_0x5588('0x5a'));var _0x3237d1=ejs[_0x5588('0x5b')](_0x383a21,{'networks':_0x3600a9||[]});fs[_0x5588('0x5c')](_0x5588('0x5d'),_0x3237d1);return respondWithRpcPromise(_0x5588('0x5e'),_0x5588('0x55'),{'module':_0x5588('0x5f')});}else if(_0x5cf4a6['type'][_0x5588('0x60')]()==_0x5588('0x61')){var _0x1afbaa=fs[_0x5588('0x62')](path[_0x5588('0x57')](config[_0x5588('0x58')],_0x5588('0x63')),_0x5588('0x5a'));var _0x1d2cfb=ejs[_0x5588('0x5b')](_0x1afbaa,{'networks':_0x3600a9||[]});fs['writeFileSync'](_0x5588('0x64'),_0x1d2cfb);return respondWithRpcPromise('Reload',_0x5588('0x55'),{'module':_0x5588('0x5f')});}else{var _0x905c0a=fs[_0x5588('0x62')](path[_0x5588('0x57')](config[_0x5588('0x58')],_0x5588('0x65')),'utf8');var _0x56d9c0=ejs[_0x5588('0x5b')](_0x905c0a,{'networks':_0x3600a9||[]});fs[_0x5588('0x5c')](util[_0x5588('0x66')](_0x5588('0x67'),_0x1d4683['body'][_0x5588('0x3c')][_0x5588('0x68')]()),_0x56d9c0);return respondWithRpcPromise(_0x5588('0x5e'),'create',{'module':_0x5588('0x69')});}return null;})['then'](function(){return _0x5cf4a6;});})[_0x5588('0x1c')](respondWithResult(_0x2d187c,0xc9))[_0x5588('0x26')](handleError(_0x2d187c,null));};exports[_0x5588('0x6a')]=function(_0x758909,_0x31ac5b,_0x43e073){var _0x55c4f0;return db['sequelize'][_0x5588('0x54')](function(_0x42691e){return db[_0x5588('0x4c')][_0x5588('0x53')]({'where':{'id':_0x758909[_0x5588('0x51')]['id']}})['then'](handleEntityNotFound(_0x31ac5b,null))['then'](saveUpdates(_0x758909[_0x5588('0x56')],null))['then'](function(_0x4bef84){if(_0x4bef84){_0x55c4f0=_0x4bef84;return db['Network'][_0x5588('0x4f')]({'where':{'type':_0x55c4f0['type']},'raw':!![]});}return null;})[_0x5588('0x1c')](function(_0x429f16){if(_0x55c4f0[_0x5588('0x3c')]['toUpperCase']()=='STUN'){var _0x522888=fs[_0x5588('0x62')](path[_0x5588('0x57')](config[_0x5588('0x58')],_0x5588('0x59')),_0x5588('0x5a'));var _0x11de63=ejs[_0x5588('0x5b')](_0x522888,{'networks':_0x429f16||[]});fs[_0x5588('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x11de63);return respondWithRpcPromise(_0x5588('0x5e'),_0x5588('0x6a'),{'module':_0x5588('0x5f')});}else if(_0x55c4f0[_0x5588('0x3c')][_0x5588('0x60')]()==_0x5588('0x61')){var _0x4f5884=fs[_0x5588('0x62')](path['join'](config['root'],_0x5588('0x63')),_0x5588('0x5a'));var _0x3ffe77=ejs[_0x5588('0x5b')](_0x4f5884,{'networks':_0x429f16||[]});fs[_0x5588('0x5c')](_0x5588('0x64'),_0x3ffe77);return respondWithRpcPromise(_0x5588('0x5e'),_0x5588('0x6a'),{'module':_0x5588('0x5f')});}else{var _0x2b9ddc=fs['readFileSync'](path[_0x5588('0x57')](config[_0x5588('0x58')],_0x5588('0x65')),'utf8');var _0x7e551f=ejs[_0x5588('0x5b')](_0x2b9ddc,{'networks':_0x429f16||[]});fs[_0x5588('0x5c')](util[_0x5588('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x758909[_0x5588('0x56')][_0x5588('0x3c')][_0x5588('0x68')]()),_0x7e551f);return respondWithRpcPromise(_0x5588('0x5e'),_0x5588('0x6a'),{'module':_0x5588('0x69')});}return null;})[_0x5588('0x1c')](function(_0x415477){if(_0x415477){return _0x55c4f0;}return null;});})['then'](respondWithResult(_0x31ac5b,null))[_0x5588('0x26')](handleError(_0x31ac5b,null));};exports[_0x5588('0x34')]=function(_0x53ca78,_0x44149c,_0x47586a){var _0x228670;return db['Network'][_0x5588('0x53')]({'where':{'id':_0x53ca78['params']['id']}})[_0x5588('0x1c')](function(_0x52dda3){_0x228670=_0x52dda3;return _0x52dda3;})[_0x5588('0x1c')](handleEntityNotFound(_0x44149c,null))[_0x5588('0x1c')](removeEntity(_0x44149c,null))[_0x5588('0x1c')](function(){if(_0x228670){return db[_0x5588('0x4c')][_0x5588('0x4f')]({'where':{'type':_0x228670['type']},'raw':!![]});}})[_0x5588('0x1c')](function(_0xdca32e){if(_0x228670[_0x5588('0x3c')][_0x5588('0x60')]()=='STUN'){var _0x43ed56=fs[_0x5588('0x62')](path[_0x5588('0x57')](config[_0x5588('0x58')],'server/files/templates/stun_multiple.ejs'),_0x5588('0x5a'));var _0x515627=ejs[_0x5588('0x5b')](_0x43ed56,{'networks':_0xdca32e||[]});fs[_0x5588('0x5c')](_0x5588('0x5d'),_0x515627);return respondWithRpcPromise('Reload','destroy',{'module':_0x5588('0x5f')});}else if(_0x228670[_0x5588('0x3c')][_0x5588('0x60')]()==_0x5588('0x61')){var _0x48da8b=fs[_0x5588('0x62')](path['join'](config[_0x5588('0x58')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x2da7f1=ejs[_0x5588('0x5b')](_0x48da8b,{'networks':_0xdca32e||[]});fs[_0x5588('0x5c')](_0x5588('0x64'),_0x2da7f1);return respondWithRpcPromise('Reload',_0x5588('0x34'),{'module':'res_stun_monitor.so'});}else{var _0x34d823=fs[_0x5588('0x62')](path[_0x5588('0x57')](config[_0x5588('0x58')],_0x5588('0x65')),_0x5588('0x5a'));var _0x1c147a=ejs[_0x5588('0x5b')](_0x34d823,{'networks':_0xdca32e||[]});fs[_0x5588('0x5c')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x53ca78[_0x5588('0x56')]['type'][_0x5588('0x68')]()),_0x1c147a);return respondWithRpcPromise(_0x5588('0x5e'),'destroy',{'module':'chan_sip.so'});}return null;})[_0x5588('0x26')](handleError(_0x44149c,null));};
\ No newline at end of file
index 0aa2ff2..7ec2864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49e9=['bluebird','rimraf','./network.attributes','exports','define','Network','network','lodash','util','api','moment'];(function(_0x544673,_0x432e04){var _0x25999c=function(_0x2fd28f){while(--_0x2fd28f){_0x544673['push'](_0x544673['shift']());}};_0x25999c(++_0x432e04);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var logger=require('../../config/logger')(_0x949e('0x2'));var moment=require(_0x949e('0x3'));var BPromise=require(_0x949e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x949e('0x5'));var config=require('../../config/environment');var attributes=require(_0x949e('0x6'));module[_0x949e('0x7')]=function(_0x360308,_0x56c7b2){return _0x360308[_0x949e('0x8')](_0x949e('0x9'),attributes,{'tableName':_0x949e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb469=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xb469,0x13b));var _0x9b46=function(_0x52d02b,_0x5577be){_0x52d02b=_0x52d02b-0x0;var _0x45aeae=_0xb469[_0x52d02b];return _0x45aeae;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var logger=require(_0x9b46('0x2'))(_0x9b46('0x3'));var moment=require(_0x9b46('0x4'));var BPromise=require(_0x9b46('0x5'));var rp=require(_0x9b46('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b46('0x7'));var config=require(_0x9b46('0x8'));var attributes=require('./network.attributes');module[_0x9b46('0x9')]=function(_0x405d1c,_0x50b49e){return _0x405d1c[_0x9b46('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c8dcaee..3d7c21a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x58957d,_0x5ca7ea){_0x58957d=_0x58957d-0x0;var _0x475810=_0x7a54[_0x58957d];return _0x475810;};'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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x42236b,_0x379e7e){_0x42236b=_0x42236b-0x0;var _0x2be3e4=_0x7a54[_0x42236b];return _0x2be3e4;};'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 1cc4952..79c19ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x712d=['removeDispositions','delete','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id/dispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addApplications','/:id/users','addAgents','/:id/send','/:id','destroy'];(function(_0x5b5429,_0x5a4dc7){var _0x5ca95c=function(_0x258817){while(--_0x258817){_0x5b5429['push'](_0x5b5429['shift']());}};_0x5ca95c(++_0x5a4dc7);}(_0x712d,0x19c));var _0xd712=function(_0x3dea9d,_0x3a2929){_0x3dea9d=_0x3dea9d-0x0;var _0x302082=_0x712d[_0x3dea9d];return _0x302082;};'use strict';var multer=require(_0xd712('0x0'));var util=require(_0xd712('0x1'));var path=require(_0xd712('0x2'));var timeout=require(_0xd712('0x3'));var express=require(_0xd712('0x4'));var router=express[_0xd712('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd712('0x6'));var config=require(_0xd712('0x7'));var controller=require('./openchannelAccount.controller');router[_0xd712('0x8')]('/',auth[_0xd712('0x9')](),controller[_0xd712('0xa')]);router[_0xd712('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xd712('0xb')]);router[_0xd712('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd712('0x8')](_0xd712('0xc'),auth[_0xd712('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd712('0xd')]);router[_0xd712('0x8')](_0xd712('0xe'),auth[_0xd712('0x9')](),controller[_0xd712('0xf')]);router['get'](_0xd712('0x10'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xd712('0x8')]('/:id/users',auth[_0xd712('0x9')](),controller[_0xd712('0x11')]);router['post']('/',auth[_0xd712('0x9')](),controller[_0xd712('0x12')]);router[_0xd712('0x13')](_0xd712('0xc'),auth[_0xd712('0x9')](),controller[_0xd712('0x14')]);router['post'](_0xd712('0x15'),auth[_0xd712('0x9')](),controller[_0xd712('0x16')]);router[_0xd712('0x13')](_0xd712('0x17'),controller['notify']);router[_0xd712('0x13')](_0xd712('0xe'),auth[_0xd712('0x9')](),controller[_0xd712('0x18')]);router['post'](_0xd712('0x19'),auth[_0xd712('0x9')](),controller[_0xd712('0x1a')]);router['post'](_0xd712('0x1b'),auth[_0xd712('0x9')](),controller['send']);router['put'](_0xd712('0x1c'),auth[_0xd712('0x9')](),controller['update']);router['delete'](_0xd712('0x1c'),auth[_0xd712('0x9')](),controller[_0xd712('0x1d')]);router['delete'](_0xd712('0xc'),auth['isAuthenticated'](),controller[_0xd712('0x1e')]);router[_0xd712('0x1f')](_0xd712('0x15'),auth[_0xd712('0x9')](),controller[_0xd712('0x20')]);router['delete'](_0xd712('0x19'),auth[_0xd712('0x9')](),controller['removeAgents']);module[_0xd712('0x21')]=router;
\ No newline at end of file
+var _0xbb2c=['/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','/:id/applications','addAgents','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb2c,0x15e));var _0xcbb2=function(_0x267907,_0x59c53d){_0x267907=_0x267907-0x0;var _0x4cf2b0=_0xbb2c[_0x267907];return _0x4cf2b0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbb2('0x0'));var router=express[_0xcbb2('0x1')]();var fs_extra=require(_0xcbb2('0x2'));var auth=require(_0xcbb2('0x3'));var interaction=require(_0xcbb2('0x4'));var config=require(_0xcbb2('0x5'));var controller=require(_0xcbb2('0x6'));router[_0xcbb2('0x7')]('/',auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x9')]);router[_0xcbb2('0x7')](_0xcbb2('0xa'),auth[_0xcbb2('0x8')](),controller['describe']);router[_0xcbb2('0x7')]('/:id',auth[_0xcbb2('0x8')](),controller[_0xcbb2('0xb')]);router['get'](_0xcbb2('0xc'),auth[_0xcbb2('0x8')](),controller[_0xcbb2('0xd')]);router[_0xcbb2('0x7')](_0xcbb2('0xe'),auth[_0xcbb2('0x8')](),controller[_0xcbb2('0xf')]);router[_0xcbb2('0x7')]('/:id/applications',auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x10')]);router[_0xcbb2('0x7')]('/:id/interactions',auth[_0xcbb2('0x8')](),controller['getInteractions']);router['get'](_0xcbb2('0x11'),auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x12')]);router[_0xcbb2('0x13')]('/',auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x14')]);router[_0xcbb2('0x13')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xcbb2('0x13')](_0xcbb2('0xe'),auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x15')]);router['post'](_0xcbb2('0x16'),controller[_0xcbb2('0x17')]);router[_0xcbb2('0x13')](_0xcbb2('0x18'),auth[_0xcbb2('0x8')](),controller['addApplications']);router[_0xcbb2('0x13')]('/:id/users',auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x19')]);router[_0xcbb2('0x13')](_0xcbb2('0x1a'),auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x1b')]);router[_0xcbb2('0x1c')](_0xcbb2('0x1d'),auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x1e')]);router[_0xcbb2('0x1f')](_0xcbb2('0x1d'),auth['isAuthenticated'](),controller[_0xcbb2('0x20')]);router['delete'](_0xcbb2('0xc'),auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x21')]);router[_0xcbb2('0x1f')]('/:id/canned_answers',auth[_0xcbb2('0x8')](),controller['removeAnswers']);router['delete'](_0xcbb2('0x11'),auth[_0xcbb2('0x8')](),controller[_0xcbb2('0x22')]);module[_0xcbb2('0x23')]=router;
\ No newline at end of file
index 7387b56..58d184e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10fb=['exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x10fb,0xce));var _0xb10f=function(_0x1bbe6c,_0x56d18a){_0x1bbe6c=_0x1bbe6c-0x0;var _0x76ab07=_0x10fb[_0x1bbe6c];return _0x76ab07;};'use strict';var Sequelize=require(_0xb10f('0x0'));var rs=require(_0xb10f('0x1'));module[_0xb10f('0x2')]={'name':{'type':Sequelize[_0xb10f('0x3')],'unique':_0xb10f('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb10f('0x3')]},'token':{'type':Sequelize[_0xb10f('0x3')],'defaultValue':function(){return rs[_0xb10f('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb10f('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb10f('0x6')],'defaultValue':function(){return _0xb10f('0x7');}},'notificationSound':{'type':Sequelize[_0xb10f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb10f('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb10f('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb10f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb10f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb10f('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xb10f('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xb10f('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4a7996){if(!_0x4a7996)this[_0xb10f('0xb')](_0xb10f('0xc'),null);this[_0xb10f('0xb')]('mandatoryDisposition',_0x4a7996);}}};
\ No newline at end of file
+var _0x07f3=['mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId'];(function(_0x29da7f,_0x7316ca){var _0x593d5a=function(_0x197eed){while(--_0x197eed){_0x29da7f['push'](_0x29da7f['shift']());}};_0x593d5a(++_0x7316ca);}(_0x07f3,0x1e2));var _0x307f=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x07f3[_0x46a38b];return _0x346e75;};'use strict';var Sequelize=require(_0x307f('0x0'));var rs=require(_0x307f('0x1'));module[_0x307f('0x2')]={'name':{'type':Sequelize[_0x307f('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x307f('0x3')]},'token':{'type':Sequelize[_0x307f('0x3')],'defaultValue':function(){return rs[_0x307f('0x4')]();}},'replyUri':{'type':Sequelize[_0x307f('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x307f('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x307f('0x5')],'defaultValue':function(){return _0x307f('0x6');}},'notificationSound':{'type':Sequelize[_0x307f('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x307f('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x307f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x307f('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x307f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x307f('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x307f('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x307f('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x27e7d2){if(!_0x27e7d2)this[_0x307f('0xa')](_0x307f('0xb'),null);this[_0x307f('0xa')](_0x307f('0xc'),_0x27e7d2);}}};
\ No newline at end of file
index 90a4e03..512f2d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0b2=['info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','get','OpenchannelAccounts','UserProfileResource','end','name','send','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','findAll','params','Pause','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','destroy','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','includeAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','order','include','removeAnswers','ids','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','orderBy','priority','asc','CmContact','contact','firstName','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','messageId','interaction','created','close','*,*,*,*','OpenchannelMessage','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','ListId','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','client','http','request','then'];(function(_0x1aa049,_0x9ae13c){var _0x357f29=function(_0xfd2f83){while(--_0xfd2f83){_0x1aa049['push'](_0x1aa049['shift']());}};_0x357f29(++_0x9ae13c);}(_0xf0b2,0x99));var _0x2f0b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf0b2[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x2f0b('0x0'));var rimraf=require(_0x2f0b('0x1'));var zipdir=require(_0x2f0b('0x2'));var jsonpatch=require(_0x2f0b('0x3'));var rp=require(_0x2f0b('0x4'));var moment=require('moment');var BPromise=require(_0x2f0b('0x5'));var Mustache=require(_0x2f0b('0x6'));var util=require('util');var path=require(_0x2f0b('0x7'));var sox=require(_0x2f0b('0x8'));var csv=require('to-csv');var ejs=require(_0x2f0b('0x9'));var fs=require('fs');var fs_extra=require(_0x2f0b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2f0b('0xb'));var jsforce=require(_0x2f0b('0xc'));var deskjs=require(_0x2f0b('0xd'));var toCsv=require(_0x2f0b('0xe'));var querystring=require(_0x2f0b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2f0b('0x10'));var qs=require(_0x2f0b('0x11'));var as=require(_0x2f0b('0x12'));var hardwareService=require(_0x2f0b('0x13'));var logger=require(_0x2f0b('0x14'))('api');var utils=require(_0x2f0b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2f0b('0x16'));var db=require(_0x2f0b('0x17'))['db'];config['redis']=_[_0x2f0b('0x18')](config[_0x2f0b('0x19')],{'host':_0x2f0b('0x1a'),'port':0x18eb});var socket=require(_0x2f0b('0x1b'))(new Redis(config[_0x2f0b('0x19')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x2f0b('0x1c')][_0x2f0b('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x2f0b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1e56cf,_0x4ea0fc,_0xc3686e,_0x14548a){return new BPromise(function(_0x2f5c95,_0x5d479c){var _0x166cfb=_0x14548a||client;return _0x166cfb[_0x2f0b('0x1e')](_0x1e56cf,_0xc3686e)[_0x2f0b('0x1f')](function(_0x2ad375){logger[_0x2f0b('0x20')](_0x2f0b('0x21'),_0x4ea0fc,_0x2f0b('0x22'));logger[_0x2f0b('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x4ea0fc,_0x2f0b('0x22'),JSON[_0x2f0b('0x24')](_0x2ad375));if(_0x2ad375['error']){if(_0x2ad375[_0x2f0b('0x25')][_0x2f0b('0x26')]===0x1f4){logger['error'](_0x2f0b('0x21'),_0x4ea0fc,_0x2ad375[_0x2f0b('0x25')][_0x2f0b('0x27')]);return _0x5d479c(_0x2ad375[_0x2f0b('0x25')][_0x2f0b('0x27')]);}logger[_0x2f0b('0x25')](_0x2f0b('0x21'),_0x4ea0fc,_0x2ad375[_0x2f0b('0x25')][_0x2f0b('0x27')]);return _0x2f5c95(_0x2ad375['error'][_0x2f0b('0x27')]);}else{logger['info'](_0x2f0b('0x21'),_0x4ea0fc,_0x2f0b('0x22'));_0x2f5c95(_0x2ad375['result'][_0x2f0b('0x27')]);}})[_0x2f0b('0x28')](function(_0x3f75b3){logger[_0x2f0b('0x25')](_0x2f0b('0x21'),_0x4ea0fc,_0x3f75b3);_0x5d479c(_0x3f75b3);});});}function respondWithStatusCode(_0x3ae5bd,_0x3235ba){_0x3235ba=_0x3235ba||0xcc;return function(_0x1b4e52){if(_0x1b4e52){return _0x3ae5bd[_0x2f0b('0x29')](_0x3235ba);}return _0x3ae5bd[_0x2f0b('0x2a')](_0x3235ba)['end']();};}function respondWithResult(_0x77c1db,_0x5c6802){_0x5c6802=_0x5c6802||0xc8;return function(_0x59decb){if(_0x59decb){return _0x77c1db[_0x2f0b('0x2a')](_0x5c6802)[_0x2f0b('0x2b')](_0x59decb);}};}function respondWithFilteredResult(_0xe1d892,_0x360a88){return function(_0x3848c5){if(_0x3848c5){var _0x4186e2=typeof _0x360a88[_0x2f0b('0x2c')]===_0x2f0b('0x2d')&&typeof _0x360a88[_0x2f0b('0x2e')]===_0x2f0b('0x2d');var _0x678601=_0x3848c5[_0x2f0b('0x2f')];var _0x5b6997=_0x4186e2?0x0:_0x360a88[_0x2f0b('0x2c')];var _0x2ee226=_0x4186e2?_0x3848c5['count']:_0x360a88[_0x2f0b('0x2c')]+_0x360a88[_0x2f0b('0x2e')];var _0x17e880;if(_0x2ee226>=_0x678601){_0x2ee226=_0x678601;_0x17e880=0xc8;}else{_0x17e880=0xce;}_0xe1d892[_0x2f0b('0x2a')](_0x17e880);return _0xe1d892[_0x2f0b('0x30')]('Content-Range',_0x5b6997+'-'+_0x2ee226+'/'+_0x678601)[_0x2f0b('0x2b')](_0x3848c5);}return null;};}function patchUpdates(_0x3babe7){return function(_0x3009c9){try{jsonpatch[_0x2f0b('0x31')](_0x3009c9,_0x3babe7,!![]);}catch(_0x292a4b){return BPromise[_0x2f0b('0x32')](_0x292a4b);}return _0x3009c9[_0x2f0b('0x33')]();};}function saveUpdates(_0xd5dac2,_0x5f4e13){return function(_0xec1551){if(_0xec1551){return _0xec1551[_0x2f0b('0x34')](_0xd5dac2)[_0x2f0b('0x1f')](function(_0x707e08){return _0x707e08;});}return null;};}function removeEntity(_0x269220,_0x497d5a){return function(_0xc1f811){if(_0xc1f811){return _0xc1f811['destroy']()[_0x2f0b('0x1f')](function(){var _0x3fcfc3=_0xc1f811[_0x2f0b('0x35')]({'plain':!![]});var _0x3f4e3d=_0x2f0b('0x36');return db[_0x2f0b('0x37')]['destroy']({'where':{'type':_0x3f4e3d,'resourceId':_0x3fcfc3['id']}})[_0x2f0b('0x1f')](function(){return _0xc1f811;});})[_0x2f0b('0x1f')](function(){_0x269220[_0x2f0b('0x2a')](0xcc)[_0x2f0b('0x38')]();});}};}function handleEntityNotFound(_0x1c4a0c,_0x5efdad){return function(_0x3a2281){if(!_0x3a2281){_0x1c4a0c[_0x2f0b('0x29')](0x194);}return _0x3a2281;};}function handleError(_0x564e62,_0x1a70f3){_0x1a70f3=_0x1a70f3||0x1f4;return function(_0xa23782){logger['error'](_0xa23782['stack']);if(_0xa23782[_0x2f0b('0x39')]){delete _0xa23782[_0x2f0b('0x39')];}_0x564e62['status'](_0x1a70f3)[_0x2f0b('0x3a')](_0xa23782);};}exports['index']=function(_0x27955d,_0x2408a1){var _0x2991b5={'include':[{'model':db['Pause'],'as':_0x2f0b('0x3b')}]},_0x4a8565={},_0x5171c8={'count':0x0,'rows':[]};var _0x3f0acd=_['map'](db[_0x2f0b('0x3c')][_0x2f0b('0x3d')],function(_0x2dd440){return{'name':_0x2dd440[_0x2f0b('0x3e')],'type':_0x2dd440[_0x2f0b('0x3f')][_0x2f0b('0x40')]};});_0x4a8565[_0x2f0b('0x41')]=_[_0x2f0b('0x42')](_0x3f0acd,_0x2f0b('0x39'));_0x4a8565[_0x2f0b('0x43')]=_['keys'](_0x27955d[_0x2f0b('0x43')]);_0x4a8565[_0x2f0b('0x44')]=_[_0x2f0b('0x45')](_0x4a8565['model'],_0x4a8565[_0x2f0b('0x43')]);_0x2991b5['attributes']=_[_0x2f0b('0x45')](_0x4a8565[_0x2f0b('0x41')],qs[_0x2f0b('0x46')](_0x27955d[_0x2f0b('0x43')][_0x2f0b('0x46')]));_0x2991b5['attributes']=_0x2991b5[_0x2f0b('0x47')][_0x2f0b('0x48')]?_0x2991b5['attributes']:_0x4a8565[_0x2f0b('0x41')];if(!_0x27955d[_0x2f0b('0x43')][_0x2f0b('0x49')](_0x2f0b('0x4a'))){_0x2991b5[_0x2f0b('0x2e')]=qs['limit'](_0x27955d[_0x2f0b('0x43')][_0x2f0b('0x2e')]);_0x2991b5['offset']=qs[_0x2f0b('0x2c')](_0x27955d[_0x2f0b('0x43')][_0x2f0b('0x2c')]);}_0x2991b5['order']=qs[_0x2f0b('0x4b')](_0x27955d[_0x2f0b('0x43')][_0x2f0b('0x4b')]);_0x2991b5['where']=qs[_0x2f0b('0x44')](_[_0x2f0b('0x4c')](_0x27955d[_0x2f0b('0x43')],_0x4a8565[_0x2f0b('0x44')]),_0x3f0acd);if(_0x27955d['query'][_0x2f0b('0x4d')]){_0x2991b5[_0x2f0b('0x4e')]=_['merge'](_0x2991b5['where'],{'$or':_[_0x2f0b('0x42')](_0x3f0acd,function(_0x40ad95){if(_0x40ad95[_0x2f0b('0x3f')]!==_0x2f0b('0x4f')){var _0x5a5647={};_0x5a5647[_0x40ad95[_0x2f0b('0x39')]]={'$like':'%'+_0x27955d['query']['filter']+'%'};return _0x5a5647;}})});}_0x2991b5=_[_0x2f0b('0x50')]({},_0x2991b5,_0x27955d[_0x2f0b('0x51')]);var _0x37cb27={'where':_0x2991b5[_0x2f0b('0x4e')]};return db['OpenchannelAccount']['count'](_0x37cb27)['then'](function(_0x4a7fa0){_0x5171c8[_0x2f0b('0x2f')]=_0x4a7fa0;if(_0x27955d[_0x2f0b('0x43')]['includeAll']){_0x2991b5['include']=[{'all':!![]}];}return db[_0x2f0b('0x3c')][_0x2f0b('0x52')](_0x2991b5);})[_0x2f0b('0x1f')](function(_0x25bd92){_0x5171c8['rows']=_0x25bd92;return _0x5171c8;})[_0x2f0b('0x1f')](respondWithFilteredResult(_0x2408a1,_0x2991b5))[_0x2f0b('0x28')](handleError(_0x2408a1,null));};exports['show']=function(_0x7852c2,_0x1a663c){var _0xb8ada={'raw':![],'where':{'id':_0x7852c2[_0x2f0b('0x53')]['id']},'include':[{'model':db[_0x2f0b('0x54')],'as':_0x2f0b('0x3b')}]},_0x206ae2={};_0x206ae2['model']=_[_0x2f0b('0x55')](db['OpenchannelAccount'][_0x2f0b('0x3d')]);_0x206ae2['query']=_[_0x2f0b('0x55')](_0x7852c2[_0x2f0b('0x43')]);_0x206ae2[_0x2f0b('0x44')]=_[_0x2f0b('0x45')](_0x206ae2[_0x2f0b('0x41')],_0x206ae2[_0x2f0b('0x43')]);_0xb8ada[_0x2f0b('0x47')]=_[_0x2f0b('0x45')](_0x206ae2[_0x2f0b('0x41')],qs[_0x2f0b('0x46')](_0x7852c2[_0x2f0b('0x43')][_0x2f0b('0x46')]));_0xb8ada['attributes']=_0xb8ada[_0x2f0b('0x47')][_0x2f0b('0x48')]?_0xb8ada['attributes']:_0x206ae2[_0x2f0b('0x41')];if(_0x7852c2['query']['includeAll']){_0xb8ada['include']=[{'all':!![]}];}_0xb8ada=_[_0x2f0b('0x50')]({},_0xb8ada,_0x7852c2[_0x2f0b('0x51')]);return db[_0x2f0b('0x3c')][_0x2f0b('0x56')](_0xb8ada)[_0x2f0b('0x1f')](handleEntityNotFound(_0x1a663c,null))[_0x2f0b('0x1f')](respondWithResult(_0x1a663c,null))['catch'](handleError(_0x1a663c,null));};exports[_0x2f0b('0x57')]=function(_0x16e840,_0x18c3d1){return db[_0x2f0b('0x3c')]['create'](_0x16e840[_0x2f0b('0x58')],{})[_0x2f0b('0x1f')](function(_0x1d390b){var _0xa2ef32=_0x16e840['user'][_0x2f0b('0x35')]({'plain':!![]});if(!_0xa2ef32)throw new Error(_0x2f0b('0x59'));if(_0xa2ef32[_0x2f0b('0x5a')]===_0x2f0b('0x5b')){var _0x270ae0=_0x1d390b['get']({'plain':!![]});var _0x14e429=_0x2f0b('0x36');return db[_0x2f0b('0x5c')][_0x2f0b('0x56')]({'where':{'name':_0x14e429,'userProfileId':_0xa2ef32[_0x2f0b('0x5d')]},'raw':!![]})[_0x2f0b('0x1f')](function(_0x466461){if(_0x466461&&_0x466461[_0x2f0b('0x5e')]===0x0){return db[_0x2f0b('0x37')][_0x2f0b('0x57')]({'name':_0x270ae0['name'],'resourceId':_0x270ae0['id'],'type':_0x466461['name'],'sectionId':_0x466461['id']},{})[_0x2f0b('0x1f')](function(){return _0x1d390b;});}else{return _0x1d390b;}})[_0x2f0b('0x28')](function(_0x29a221){logger[_0x2f0b('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29a221);throw _0x29a221;});}return _0x1d390b;})[_0x2f0b('0x1f')](respondWithResult(_0x18c3d1,0xc9))['catch'](handleError(_0x18c3d1,null));};exports[_0x2f0b('0x34')]=function(_0x31c79a,_0x36035e){if(_0x31c79a[_0x2f0b('0x58')]['id']){delete _0x31c79a[_0x2f0b('0x58')]['id'];}return db[_0x2f0b('0x3c')][_0x2f0b('0x56')]({'where':{'id':_0x31c79a[_0x2f0b('0x53')]['id']},'include':[{'model':db[_0x2f0b('0x54')],'as':_0x2f0b('0x3b')}]})[_0x2f0b('0x1f')](handleEntityNotFound(_0x36035e,null))[_0x2f0b('0x1f')](saveUpdates(_0x31c79a['body'],null))[_0x2f0b('0x1f')](respondWithResult(_0x36035e,null))['catch'](handleError(_0x36035e,null));};exports[_0x2f0b('0x5f')]=function(_0x1b7790,_0x33f9ff){return db[_0x2f0b('0x3c')][_0x2f0b('0x56')]({'where':{'id':_0x1b7790[_0x2f0b('0x53')]['id']}})['then'](handleEntityNotFound(_0x33f9ff,null))['then'](removeEntity(_0x33f9ff,null))[_0x2f0b('0x28')](handleError(_0x33f9ff,null));};exports[_0x2f0b('0x60')]=function(_0x1ddc57,_0x4603fb){return db[_0x2f0b('0x3c')][_0x2f0b('0x60')]()[_0x2f0b('0x1f')](respondWithResult(_0x4603fb,null))[_0x2f0b('0x28')](handleError(_0x4603fb,null));};exports['addDisposition']=function(_0x494414,_0x45d91e,_0x1689aa){if(_0x494414[_0x2f0b('0x58')]['id']){delete _0x494414[_0x2f0b('0x58')]['id'];}return db[_0x2f0b('0x3c')]['find']({'where':{'id':_0x494414[_0x2f0b('0x53')]['id']}})['then'](handleEntityNotFound(_0x45d91e,null))['then'](function(_0x5c0899){if(_0x5c0899){_0x494414[_0x2f0b('0x58')][_0x2f0b('0x61')]=_0x5c0899['id'];return db[_0x2f0b('0x62')][_0x2f0b('0x57')](_0x494414['body']);}})['then'](respondWithResult(_0x45d91e,null))[_0x2f0b('0x28')](handleError(_0x45d91e,null));};exports[_0x2f0b('0x63')]=function(_0x21185c,_0x7de14f,_0x486001){var _0x1391a6={'raw':![],'where':{}};var _0xc27b0c={};var _0x4d1a9c={'count':0x0,'rows':[]};return db[_0x2f0b('0x3c')][_0x2f0b('0x64')]({'where':{'id':_0x21185c[_0x2f0b('0x53')]['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x7de14f,null))['then'](function(_0x54e439){if(_0x54e439){_0xc27b0c['model']=_[_0x2f0b('0x55')](db[_0x2f0b('0x62')][_0x2f0b('0x3d')]);_0xc27b0c['query']=_['keys'](_0x21185c['query']);_0xc27b0c[_0x2f0b('0x44')]=_[_0x2f0b('0x45')](_0xc27b0c['model'],_0xc27b0c[_0x2f0b('0x43')]);_0x1391a6[_0x2f0b('0x47')]=_[_0x2f0b('0x45')](_0xc27b0c[_0x2f0b('0x41')],qs[_0x2f0b('0x46')](_0x21185c['query'][_0x2f0b('0x46')]));_0x1391a6[_0x2f0b('0x47')]=_0x1391a6[_0x2f0b('0x47')][_0x2f0b('0x48')]?_0x1391a6[_0x2f0b('0x47')]:_0xc27b0c[_0x2f0b('0x41')];if(!_0x21185c[_0x2f0b('0x43')][_0x2f0b('0x49')]('nolimit')){_0x1391a6[_0x2f0b('0x2e')]=qs['limit'](_0x21185c[_0x2f0b('0x43')][_0x2f0b('0x2e')]);_0x1391a6[_0x2f0b('0x2c')]=qs[_0x2f0b('0x2c')](_0x21185c[_0x2f0b('0x43')][_0x2f0b('0x2c')]);}_0x1391a6['order']=qs[_0x2f0b('0x4b')](_0x21185c[_0x2f0b('0x43')][_0x2f0b('0x4b')]);_0x1391a6[_0x2f0b('0x4e')]=qs[_0x2f0b('0x44')](_[_0x2f0b('0x4c')](_0x21185c[_0x2f0b('0x43')],_0xc27b0c[_0x2f0b('0x44')]));_0x1391a6[_0x2f0b('0x4e')][_0x2f0b('0x61')]=_0x54e439['id'];if(_0x21185c[_0x2f0b('0x43')][_0x2f0b('0x4d')]){_0x1391a6[_0x2f0b('0x4e')]=_[_0x2f0b('0x50')](_0x1391a6[_0x2f0b('0x4e')],{'$or':_['map'](_0x1391a6[_0x2f0b('0x47')],function(_0x109160){var _0x3e92fd={};_0x3e92fd[_0x109160]={'$like':'%'+_0x21185c[_0x2f0b('0x43')][_0x2f0b('0x4d')]+'%'};return _0x3e92fd;})});}_0x1391a6=_[_0x2f0b('0x50')]({},_0x1391a6,_0x21185c[_0x2f0b('0x51')]);return db['Disposition'][_0x2f0b('0x2f')]({'where':_0x1391a6[_0x2f0b('0x4e')]})[_0x2f0b('0x1f')](function(_0x31b426){_0x4d1a9c['count']=_0x31b426;if(_0x21185c[_0x2f0b('0x43')][_0x2f0b('0x65')]){_0x1391a6['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1391a6);})[_0x2f0b('0x1f')](function(_0x235a19){_0x4d1a9c[_0x2f0b('0x66')]=_0x235a19;return _0x4d1a9c;});}})['then'](respondWithFilteredResult(_0x7de14f,_0x1391a6))[_0x2f0b('0x28')](handleError(_0x7de14f,null));};exports[_0x2f0b('0x67')]=function(_0x9cf6f4,_0x501e22,_0x152626){return db[_0x2f0b('0x3c')]['find']({'where':{'id':_0x9cf6f4[_0x2f0b('0x53')]['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x501e22,null))[_0x2f0b('0x1f')](function(_0x1e7baa){if(_0x1e7baa){return _0x1e7baa['removeDispositions'](_0x9cf6f4[_0x2f0b('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x501e22,null))[_0x2f0b('0x28')](handleError(_0x501e22,null));};exports[_0x2f0b('0x68')]=function(_0x2d1d29,_0x479ac0,_0x2fab2d){if(_0x2d1d29[_0x2f0b('0x58')]['id']){delete _0x2d1d29[_0x2f0b('0x58')]['id'];}return db['OpenchannelAccount'][_0x2f0b('0x56')]({'where':{'id':_0x2d1d29[_0x2f0b('0x53')]['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x479ac0,null))[_0x2f0b('0x1f')](function(_0x2c4e2d){if(_0x2c4e2d){_0x2d1d29[_0x2f0b('0x58')][_0x2f0b('0x61')]=_0x2c4e2d['id'];return db[_0x2f0b('0x69')][_0x2f0b('0x57')](_0x2d1d29[_0x2f0b('0x58')]);}})[_0x2f0b('0x1f')](respondWithResult(_0x479ac0,null))['catch'](handleError(_0x479ac0,null));};exports[_0x2f0b('0x6a')]=function(_0x1db3d9,_0x142123,_0xaa4d5e){var _0x2473b3={'raw':![],'where':{}};var _0x3e00c7={};var _0x18f598={'count':0x0,'rows':[]};return db[_0x2f0b('0x3c')][_0x2f0b('0x64')]({'where':{'id':_0x1db3d9[_0x2f0b('0x53')]['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x142123,null))[_0x2f0b('0x1f')](function(_0x279f1a){if(_0x279f1a){_0x3e00c7[_0x2f0b('0x41')]=_[_0x2f0b('0x55')](db[_0x2f0b('0x69')][_0x2f0b('0x3d')]);_0x3e00c7['query']=_[_0x2f0b('0x55')](_0x1db3d9[_0x2f0b('0x43')]);_0x3e00c7['filters']=_[_0x2f0b('0x45')](_0x3e00c7[_0x2f0b('0x41')],_0x3e00c7[_0x2f0b('0x43')]);_0x2473b3[_0x2f0b('0x47')]=_[_0x2f0b('0x45')](_0x3e00c7[_0x2f0b('0x41')],qs[_0x2f0b('0x46')](_0x1db3d9[_0x2f0b('0x43')][_0x2f0b('0x46')]));_0x2473b3['attributes']=_0x2473b3['attributes'][_0x2f0b('0x48')]?_0x2473b3['attributes']:_0x3e00c7[_0x2f0b('0x41')];if(!_0x1db3d9[_0x2f0b('0x43')][_0x2f0b('0x49')](_0x2f0b('0x4a'))){_0x2473b3['limit']=qs[_0x2f0b('0x2e')](_0x1db3d9[_0x2f0b('0x43')][_0x2f0b('0x2e')]);_0x2473b3[_0x2f0b('0x2c')]=qs[_0x2f0b('0x2c')](_0x1db3d9['query'][_0x2f0b('0x2c')]);}_0x2473b3[_0x2f0b('0x6b')]=qs[_0x2f0b('0x4b')](_0x1db3d9[_0x2f0b('0x43')]['sort']);_0x2473b3[_0x2f0b('0x4e')]=qs[_0x2f0b('0x44')](_['pick'](_0x1db3d9['query'],_0x3e00c7[_0x2f0b('0x44')]));_0x2473b3[_0x2f0b('0x4e')]['OpenchannelAccountId']=_0x279f1a['id'];if(_0x1db3d9[_0x2f0b('0x43')][_0x2f0b('0x4d')]){_0x2473b3[_0x2f0b('0x4e')]=_[_0x2f0b('0x50')](_0x2473b3[_0x2f0b('0x4e')],{'$or':_[_0x2f0b('0x42')](_0x2473b3[_0x2f0b('0x47')],function(_0x1b81ee){var _0xa1b50={};_0xa1b50[_0x1b81ee]={'$like':'%'+_0x1db3d9[_0x2f0b('0x43')][_0x2f0b('0x4d')]+'%'};return _0xa1b50;})});}_0x2473b3=_[_0x2f0b('0x50')]({},_0x2473b3,_0x1db3d9[_0x2f0b('0x51')]);return db['CannedAnswer']['count']({'where':_0x2473b3[_0x2f0b('0x4e')]})['then'](function(_0x4cbeb3){_0x18f598['count']=_0x4cbeb3;if(_0x1db3d9[_0x2f0b('0x43')][_0x2f0b('0x65')]){_0x2473b3[_0x2f0b('0x6c')]=[{'all':!![]}];}return db[_0x2f0b('0x69')][_0x2f0b('0x52')](_0x2473b3);})['then'](function(_0x21539c){_0x18f598[_0x2f0b('0x66')]=_0x21539c;return _0x18f598;});}})[_0x2f0b('0x1f')](respondWithFilteredResult(_0x142123,_0x2473b3))[_0x2f0b('0x28')](handleError(_0x142123,null));};exports[_0x2f0b('0x6d')]=function(_0x5be5da,_0x532e9c,_0x2f7444){return db[_0x2f0b('0x3c')][_0x2f0b('0x56')]({'where':{'id':_0x5be5da[_0x2f0b('0x53')]['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x532e9c,null))[_0x2f0b('0x1f')](function(_0x41b858){if(_0x41b858){return _0x41b858[_0x2f0b('0x6d')](_0x5be5da[_0x2f0b('0x43')][_0x2f0b('0x6e')]);}})[_0x2f0b('0x1f')](respondWithStatusCode(_0x532e9c,null))[_0x2f0b('0x28')](handleError(_0x532e9c,null));};exports['notify']=function(_0x34b5f2,_0x8d3961,_0x33e3d4){var _0x2d1f45={'body':_0x34b5f2['body'],'channel':'openchannel'};var _0x968061=[];var _0x473ce3=[];var _0x369031={};var _0x265991=![];return db['CmContact'][_0x2f0b('0x60')]()[_0x2f0b('0x1f')](function(_0x1ded89){if(!_0x1ded89){throw new db[(_0x2f0b('0x6f'))][(_0x2f0b('0x70'))]('no\x20available\x20attributes');}_0x968061=_[_0x2f0b('0x71')](_[_0x2f0b('0x55')](_0x1ded89),[_0x2f0b('0x72'),_0x2f0b('0x73')]);_0x473ce3=_[_0x2f0b('0x71')](_[_0x2f0b('0x55')](_0x1ded89),[_0x2f0b('0x72'),_0x2f0b('0x73'),_0x2f0b('0x74'),'ListId']);if(_0x34b5f2[_0x2f0b('0x58')]['id']){delete _0x34b5f2[_0x2f0b('0x58')]['id'];}if(_[_0x2f0b('0x75')](_0x34b5f2['body'][_0x2f0b('0x76')])){throw new db['Sequelize'][(_0x2f0b('0x70'))](_0x2f0b('0x77'));}if(_[_0x2f0b('0x75')](_0x34b5f2[_0x2f0b('0x58')][_0x2f0b('0x58')])||_0x34b5f2['body']['body']===''){throw new db['Sequelize'][(_0x2f0b('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2f0b('0x75')](_0x34b5f2['body'][_0x2f0b('0x78')])){throw new db[(_0x2f0b('0x6f'))][(_0x2f0b('0x70'))](_0x2f0b('0x79')+_0x473ce3);}if(!_['includes'](_0x473ce3,_0x34b5f2[_0x2f0b('0x58')][_0x2f0b('0x78')])){throw new db[(_0x2f0b('0x6f'))][(_0x2f0b('0x70'))](_0x2f0b('0x7a')+_0x473ce3);}_0x369031[_0x34b5f2['body']['mapKey']]=_0x34b5f2[_0x2f0b('0x58')][_0x2f0b('0x76')];})[_0x2f0b('0x1f')](function(){return db[_0x2f0b('0x3c')][_0x2f0b('0x56')]({'where':{'id':_0x34b5f2[_0x2f0b('0x53')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x2f0b('0x7b'),'where':_0x369031,'limit':0x1,'order':[[_0x2f0b('0x73'),_0x2f0b('0x7c')]]}]},{'model':db[_0x2f0b('0x7d')],'as':_0x2f0b('0x7e')}]});})[_0x2f0b('0x1f')](handleEntityNotFound(_0x8d3961,null))['then'](function(_0x52e0d0){if(_0x52e0d0&&_0x52e0d0[_0x2f0b('0x7f')]){_0x2d1f45[_0x2f0b('0x80')]=_0x52e0d0;_0x2d1f45[_0x2f0b('0x81')]=_0x52e0d0['Applications'];_0x2d1f45['list']=_0x52e0d0[_0x2f0b('0x7f')];_0x2d1f45['applications']=_[_0x2f0b('0x82')](_0x2d1f45[_0x2f0b('0x81')],[_0x2f0b('0x83')],[_0x2f0b('0x84')]);if(_0x2d1f45['account'][_0x2f0b('0x7e')]){delete _0x2d1f45[_0x2f0b('0x80')]['Applications'];}if(_0x2d1f45[_0x2f0b('0x80')]['List']&&_0x2d1f45[_0x2f0b('0x80')][_0x2f0b('0x7f')]['Contacts']['length']){return _0x2d1f45['account'][_0x2f0b('0x7f')][_0x2f0b('0x7b')][0x0];}var _0xfd7b61=_[_0x2f0b('0x18')](_0x34b5f2[_0x2f0b('0x58')],{'firstName':_0x34b5f2[_0x2f0b('0x58')][_0x2f0b('0x76')],'ListId':_0x52e0d0['ListId']});_0xfd7b61[_0x34b5f2['body']['mapKey']]=_0x34b5f2[_0x2f0b('0x58')]['from'];return db[_0x2f0b('0x85')][_0x2f0b('0x57')](_0xfd7b61,{'fields':_0x968061,'raw':!![]});}})['then'](handleEntityNotFound(_0x8d3961,null))[_0x2f0b('0x1f')](function(_0x23233d){_0x2d1f45[_0x2f0b('0x86')]=_0x23233d;if(_0x23233d){var _0x3e9e7b={'ContactId':_0x23233d['id'],'OpenchannelAccountId':_0x34b5f2[_0x2f0b('0x53')]['id'],'from':(_0x23233d[_0x2f0b('0x87')]||'')+'\x20'+(_0x23233d[_0x2f0b('0x88')]||'')};var _0xfff5c4={'OpenchannelAccountId':_0x34b5f2[_0x2f0b('0x53')]['id'],'closed':![]};if(_0x34b5f2[_0x2f0b('0x58')]['threadId']){_0xfff5c4[_0x2f0b('0x89')]=_0x34b5f2[_0x2f0b('0x58')][_0x2f0b('0x89')];return db['OpenchannelInteraction'][_0x2f0b('0x56')]({'where':_0xfff5c4})['then'](function(_0x21b425){if(_0x21b425){return[_0x21b425,![]];}_0x3e9e7b[_0x2f0b('0x89')]=_0x34b5f2[_0x2f0b('0x58')]['threadId'];_0x3e9e7b[_0x2f0b('0x8a')]=_0x34b5f2['body'][_0x2f0b('0x8a')];return db['OpenchannelInteraction'][_0x2f0b('0x57')](_0x3e9e7b)[_0x2f0b('0x1f')](function(_0x192458){return[_0x192458,!![]];});});}else{_0xfff5c4['threadId']=null;}_0xfff5c4[_0x2f0b('0x8b')]=_0x23233d['id'];return db[_0x2f0b('0x8c')][_0x2f0b('0x56')]({'where':_0xfff5c4})[_0x2f0b('0x1f')](function(_0x542059){if(_0x542059){return[_0x542059,![]];}return db[_0x2f0b('0x8c')][_0x2f0b('0x57')](_0x3e9e7b)[_0x2f0b('0x1f')](function(_0x360811){return[_0x360811,!![]];});});}})[_0x2f0b('0x8d')](function(_0x3e036e,_0xd4fd0b){if(_0x3e036e){_0x265991=_0xd4fd0b;if(!_0xd4fd0b){var _0x3b4a66={'from':(_0x2d1f45[_0x2f0b('0x86')][_0x2f0b('0x87')]||'')+'\x20'+(_0x2d1f45['contact']['lastName']||'')};if(_0x34b5f2[_0x2f0b('0x58')]['threadId']&&_0x34b5f2[_0x2f0b('0x58')][_0x2f0b('0x8e')]&&_0x34b5f2[_0x2f0b('0x58')][_0x2f0b('0x89')]!=_0x34b5f2[_0x2f0b('0x58')]['messageId']){_0x3b4a66[_0x2f0b('0x89')]=_0x34b5f2[_0x2f0b('0x58')][_0x2f0b('0x8e')];}return _0x3e036e[_0x2f0b('0x34')](_0x3b4a66);}else{return _0x3e036e;}}})['then'](function(_0x5d47e5){_0x2d1f45['interaction']=_0x5d47e5[_0x2f0b('0x35')]({'plain':!![]});_0x2d1f45[_0x2f0b('0x8f')][_0x2f0b('0x90')]=_0x265991;if(_0x2d1f45['interaction']['created']){if(_0x2d1f45['account']['autoclose']){_0x2d1f45['applications']['push']({'id':0x0,'priority':_0x2d1f45[_0x2f0b('0x81')]['length']+0x1,'app':_0x2f0b('0x91'),'appdata':'unmanaged','interval':_0x2f0b('0x92')});}}return db[_0x2f0b('0x93')]['create']({'body':_0x34b5f2[_0x2f0b('0x58')][_0x2f0b('0x58')],'OpenchannelAccountId':_0x34b5f2[_0x2f0b('0x53')]['id'],'OpenchannelInteractionId':_0x5d47e5['id'],'direction':'in','ContactId':_0x2d1f45[_0x2f0b('0x86')]['id'],'AttachmentId':_0x34b5f2[_0x2f0b('0x58')]['AttachmentId']});})[_0x2f0b('0x1f')](function(_0x4d787a){_0x2d1f45[_0x2f0b('0x27')]=_0x4d787a;if(_0x2d1f45['interaction']['UserId']){return db[_0x2f0b('0x94')][_0x2f0b('0x56')]({'attributes':['id',_0x2f0b('0x39')],'where':{'id':_0x2d1f45[_0x2f0b('0x8f')][_0x2f0b('0x95')]}})[_0x2f0b('0x1f')](function(_0x9fff68){if(_0x9fff68){_0x2d1f45[_0x2f0b('0x81')][_0x2f0b('0x96')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x9fff68[_0x2f0b('0x39')]+','+(_0x2d1f45[_0x2f0b('0x80')][_0x2f0b('0x97')]||0xa),'interval':_0x2f0b('0x92')});_0x2d1f45[_0x2f0b('0x98')]=![];}return respondWithRpcPromise(_0x2f0b('0x99'),_0x2f0b('0x9a'),_0x2d1f45);});}return respondWithRpcPromise(_0x2f0b('0x99'),_0x2f0b('0x9a'),_0x2d1f45);})[_0x2f0b('0x1f')](function(_0x30c425){respondWithRpcPromise('EventManager',_0x2f0b('0x9b'),{'event':_0x2f0b('0x9c'),'message':_0x30c425},client9002);return _0x30c425;})[_0x2f0b('0x1f')](respondWithResult(_0x8d3961,null))[_0x2f0b('0x28')](handleError(_0x8d3961,null));};exports[_0x2f0b('0x9d')]=function(_0x22a48f,_0x826f6b,_0x5ac290){return db[_0x2f0b('0x3c')][_0x2f0b('0x64')]({'where':{'id':_0x22a48f[_0x2f0b('0x53')]['id']}})['then'](handleEntityNotFound(_0x826f6b,null))['then'](function(_0x4ee5f3){if(_0x4ee5f3){return db[_0x2f0b('0x9e')]['transaction'](function(_0x4215b9){return db[_0x2f0b('0x7d')][_0x2f0b('0x5f')]({'where':{'OpenchannelAccountId':_0x22a48f[_0x2f0b('0x53')]['id']},'transaction':_0x4215b9})[_0x2f0b('0x1f')](function(_0x5bf2c2){var _0x1b166a=_[_0x2f0b('0x42')](_0x22a48f[_0x2f0b('0x58')],function(_0x242e2e){_0x242e2e[_0x2f0b('0x61')]=_0x22a48f[_0x2f0b('0x53')]['id'];return _0x242e2e;});return db[_0x2f0b('0x7d')][_0x2f0b('0x9f')](_0x1b166a,{'transaction':_0x4215b9});});})[_0x2f0b('0x1f')](function(){return db[_0x2f0b('0x7d')][_0x2f0b('0xa0')]({'where':{'OpenchannelAccountId':_0x22a48f['params']['id']},'order':_0x2f0b('0x83')});});}})['then'](respondWithResult(_0x826f6b,null))[_0x2f0b('0x28')](handleError(_0x826f6b,null));};exports['getApplications']=function(_0x4fd95f,_0x5cf244,_0x2d394e){var _0x308f98={};var _0xf4fe66={};var _0x2f6ea0;var _0x151f42;return db[_0x2f0b('0x3c')]['findOne']({'where':{'id':_0x4fd95f['params']['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x5cf244,null))['then'](function(_0x251caf){if(_0x251caf){_0x2f6ea0=_0x251caf;_0xf4fe66['model']=_[_0x2f0b('0x55')](db[_0x2f0b('0x7d')][_0x2f0b('0x3d')]);_0xf4fe66[_0x2f0b('0x43')]=_['keys'](_0x4fd95f[_0x2f0b('0x43')]);_0xf4fe66['filters']=_[_0x2f0b('0x45')](_0xf4fe66[_0x2f0b('0x41')],_0xf4fe66[_0x2f0b('0x43')]);_0x308f98['attributes']=_[_0x2f0b('0x45')](_0xf4fe66[_0x2f0b('0x41')],qs['fields'](_0x4fd95f['query']['fields']));_0x308f98[_0x2f0b('0x47')]=_0x308f98[_0x2f0b('0x47')][_0x2f0b('0x48')]?_0x308f98['attributes']:_0xf4fe66['model'];_0x308f98[_0x2f0b('0x6b')]=qs['sort'](_0x4fd95f['query'][_0x2f0b('0x4b')]);_0x308f98[_0x2f0b('0x4e')]=qs[_0x2f0b('0x44')](_[_0x2f0b('0x4c')](_0x4fd95f[_0x2f0b('0x43')],_0xf4fe66[_0x2f0b('0x44')]));if(_0x4fd95f[_0x2f0b('0x43')][_0x2f0b('0x4d')]){_0x308f98[_0x2f0b('0x4e')]=_[_0x2f0b('0x50')](_0x308f98[_0x2f0b('0x4e')],{'$or':_['map'](_0x308f98[_0x2f0b('0x47')],function(_0x3a1dda){var _0x4b5b53={};_0x4b5b53[_0x3a1dda]={'$like':'%'+_0x4fd95f[_0x2f0b('0x43')][_0x2f0b('0x4d')]+'%'};return _0x4b5b53;})});}_0x308f98=_[_0x2f0b('0x50')]({},_0x308f98,_0x4fd95f[_0x2f0b('0x51')]);return _0x2f6ea0[_0x2f0b('0xa1')](_0x308f98);}})[_0x2f0b('0x1f')](function(_0x5e9ec0){if(_0x5e9ec0){_0x151f42=_0x5e9ec0[_0x2f0b('0x48')];if(!_0x4fd95f[_0x2f0b('0x43')]['hasOwnProperty'](_0x2f0b('0x4a'))){_0x308f98[_0x2f0b('0x2e')]=qs[_0x2f0b('0x2e')](_0x4fd95f[_0x2f0b('0x43')]['limit']);_0x308f98[_0x2f0b('0x2c')]=qs['offset'](_0x4fd95f[_0x2f0b('0x43')][_0x2f0b('0x2c')]);}return _0x2f6ea0['getApplications'](_0x308f98);}})[_0x2f0b('0x1f')](function(_0x4c0e81){if(_0x4c0e81){return _0x4c0e81?{'count':_0x151f42,'rows':_0x4c0e81}:null;}})['then'](respondWithResult(_0x5cf244,null))['catch'](handleError(_0x5cf244,null));};exports[_0x2f0b('0xa2')]=function(_0x2f4c82,_0x229df7,_0x3b8769){var _0x3ea199={'raw':![],'where':{}};var _0x404b66={};var _0x5157a9={'count':0x0,'rows':[]};return db[_0x2f0b('0x3c')][_0x2f0b('0x64')]({'where':{'id':_0x2f4c82['params']['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x229df7,null))['then'](function(_0x310c00){if(_0x310c00){_0x404b66[_0x2f0b('0x41')]=_[_0x2f0b('0x55')](db[_0x2f0b('0x8c')][_0x2f0b('0x3d')]);_0x404b66[_0x2f0b('0x43')]=_[_0x2f0b('0x55')](_0x2f4c82[_0x2f0b('0x43')]);_0x404b66[_0x2f0b('0x44')]=_[_0x2f0b('0x45')](_0x404b66['model'],_0x404b66['query']);_0x3ea199[_0x2f0b('0x47')]=_[_0x2f0b('0x45')](_0x404b66[_0x2f0b('0x41')],qs[_0x2f0b('0x46')](_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0x46')]));_0x3ea199[_0x2f0b('0x47')]=_0x3ea199[_0x2f0b('0x47')][_0x2f0b('0x48')]?_0x3ea199[_0x2f0b('0x47')]:_0x404b66[_0x2f0b('0x41')];if(!_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0x49')](_0x2f0b('0x4a'))){_0x3ea199[_0x2f0b('0x2e')]=qs[_0x2f0b('0x2e')](_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0x2e')]);_0x3ea199[_0x2f0b('0x2c')]=qs[_0x2f0b('0x2c')](_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0x2c')]);}_0x3ea199[_0x2f0b('0x6b')]=qs[_0x2f0b('0x4b')](_0x2f4c82['query'][_0x2f0b('0x4b')]);_0x3ea199[_0x2f0b('0x4e')]=qs[_0x2f0b('0x44')](_[_0x2f0b('0x4c')](_0x2f4c82[_0x2f0b('0x43')],_0x404b66['filters']));_0x3ea199[_0x2f0b('0x4e')][_0x2f0b('0x61')]=_0x310c00['id'];if(_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0x4d')]){_0x3ea199[_0x2f0b('0x4e')]=_[_0x2f0b('0x50')](_0x3ea199[_0x2f0b('0x4e')],{'$or':_[_0x2f0b('0x42')](_0x3ea199[_0x2f0b('0x47')],function(_0x19a127){var _0x4eb9bc={};_0x4eb9bc[_0x19a127]={'$like':'%'+_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0x4d')]+'%'};return _0x4eb9bc;})});}_0x3ea199=_['merge']({},_0x3ea199,_0x2f4c82[_0x2f0b('0x51')]);return db[_0x2f0b('0x8c')][_0x2f0b('0x2f')]({'where':_0x3ea199[_0x2f0b('0x4e')]})[_0x2f0b('0x1f')](function(_0x14ef38){_0x5157a9[_0x2f0b('0x2f')]=_0x14ef38;if(_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0x65')]){_0x3ea199[_0x2f0b('0x6c')]=[{'model':db[_0x2f0b('0x85')],'as':_0x2f0b('0xa3'),'required':![]},{'model':db[_0x2f0b('0x94')],'as':_0x2f0b('0xa4'),'attributes':['name',_0x2f0b('0xa5'),_0x2f0b('0xa6')],'required':![]},{'model':db['Tag'],'as':_0x2f0b('0xa7'),'attributes':['id',_0x2f0b('0x39'),_0x2f0b('0xa8')],'where':_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0xa9')]?{'id':_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0xa9')]}:undefined,'required':_0x2f4c82[_0x2f0b('0x43')][_0x2f0b('0xa9')]?!![]:![]}];}return db[_0x2f0b('0x8c')][_0x2f0b('0x52')](_0x3ea199);})['then'](function(_0x57ae8d){_0x5157a9['rows']=_0x57ae8d;return _0x5157a9;});}})['then'](respondWithFilteredResult(_0x229df7,_0x3ea199))[_0x2f0b('0x28')](handleError(_0x229df7,null));};exports[_0x2f0b('0xaa')]=function(_0x3acf06,_0x3794c5,_0x2b50c4){return db[_0x2f0b('0x3c')][_0x2f0b('0x56')]({'where':{'id':_0x3acf06[_0x2f0b('0x53')]['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x3794c5,null))[_0x2f0b('0x1f')](function(_0x8c3ce0){if(_0x8c3ce0){return _0x8c3ce0['addAgents'](_0x3acf06[_0x2f0b('0x58')]['ids'],_[_0x2f0b('0xab')](_0x3acf06[_0x2f0b('0x58')],['ids','id'])||{})[_0x2f0b('0x8d')](function(_0x40c94d){for(var _0x323757=0x0;_0x323757<_0x3acf06['body'][_0x2f0b('0x6e')][_0x2f0b('0x48')];_0x323757+=0x1){socket[_0x2f0b('0xac')](_0x2f0b('0xad'),{'UserId':Number(_0x3acf06[_0x2f0b('0x58')][_0x2f0b('0x6e')][_0x323757]),'OpenchannelAccountId':Number(_0x3acf06[_0x2f0b('0x53')]['id'])});}return _0x40c94d;});}})['then'](respondWithResult(_0x3794c5,null))[_0x2f0b('0x28')](handleError(_0x3794c5,null));};exports[_0x2f0b('0xae')]=function(_0x2be854,_0x582321,_0x83584d){return db['OpenchannelAccount'][_0x2f0b('0x56')]({'where':{'id':_0x2be854[_0x2f0b('0x53')]['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x582321,null))['then'](function(_0x5b5b71){if(_0x5b5b71){return _0x5b5b71['removeAgents'](_0x2be854[_0x2f0b('0x43')][_0x2f0b('0x6e')])[_0x2f0b('0x1f')](function(){if(_[_0x2f0b('0xaf')](_0x2be854[_0x2f0b('0x43')][_0x2f0b('0x6e')])){for(var _0x5d8bf8=0x0;_0x5d8bf8<_0x2be854[_0x2f0b('0x43')][_0x2f0b('0x6e')]['length'];_0x5d8bf8+=0x1){socket[_0x2f0b('0xac')](_0x2f0b('0xb0'),{'UserId':Number(_0x2be854[_0x2f0b('0x43')][_0x2f0b('0x6e')][_0x5d8bf8]),'OpenchannelAccountId':Number(_0x2be854[_0x2f0b('0x53')]['id'])});}}else{socket[_0x2f0b('0xac')](_0x2f0b('0xb0'),{'UserId':Number(_0x2be854[_0x2f0b('0x43')][_0x2f0b('0x6e')]),'OpenchannelAccountId':Number(_0x2be854[_0x2f0b('0x53')]['id'])});}});}})[_0x2f0b('0x1f')](respondWithStatusCode(_0x582321,null))[_0x2f0b('0x28')](handleError(_0x582321,null));};exports[_0x2f0b('0xb1')]=function(_0x11bb3e,_0x4718b6,_0x2f1324){var _0x16d17e={};var _0xfb0d81={};var _0x5b39a6;var _0x118d24;return db[_0x2f0b('0x3c')][_0x2f0b('0x64')]({'where':{'id':_0x11bb3e[_0x2f0b('0x53')]['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x4718b6,null))[_0x2f0b('0x1f')](function(_0x57ec61){if(_0x57ec61){_0x5b39a6=_0x57ec61;_0xfb0d81['model']=_[_0x2f0b('0x55')](db[_0x2f0b('0x94')][_0x2f0b('0x3d')]);_0xfb0d81['query']=_[_0x2f0b('0x55')](_0x11bb3e[_0x2f0b('0x43')]);_0xfb0d81[_0x2f0b('0x44')]=_[_0x2f0b('0x45')](_0xfb0d81[_0x2f0b('0x41')],_0xfb0d81['query']);_0x16d17e['attributes']=_[_0x2f0b('0x45')](_0xfb0d81[_0x2f0b('0x41')],qs[_0x2f0b('0x46')](_0x11bb3e[_0x2f0b('0x43')][_0x2f0b('0x46')]));_0x16d17e[_0x2f0b('0x47')]=_0x16d17e[_0x2f0b('0x47')]['length']?_0x16d17e[_0x2f0b('0x47')]:_0xfb0d81['model'];_0x16d17e['order']=qs['sort'](_0x11bb3e[_0x2f0b('0x43')][_0x2f0b('0x4b')]);_0x16d17e[_0x2f0b('0x4e')]=qs[_0x2f0b('0x44')](_['pick'](_0x11bb3e['query'],_0xfb0d81[_0x2f0b('0x44')]));if(_0x11bb3e[_0x2f0b('0x43')][_0x2f0b('0x4d')]){_0x16d17e[_0x2f0b('0x4e')]=_[_0x2f0b('0x50')](_0x16d17e[_0x2f0b('0x4e')],{'$or':_[_0x2f0b('0x42')](_0x16d17e[_0x2f0b('0x47')],function(_0x3d1c19){var _0x109632={};_0x109632[_0x3d1c19]={'$like':'%'+_0x11bb3e[_0x2f0b('0x43')][_0x2f0b('0x4d')]+'%'};return _0x109632;})});}_0x16d17e=_['merge']({},_0x16d17e,_0x11bb3e[_0x2f0b('0x51')]);return _0x5b39a6[_0x2f0b('0xb1')](_0x16d17e);}})['then'](function(_0x33d586){if(_0x33d586){_0x118d24=_0x33d586['length'];if(!_0x11bb3e[_0x2f0b('0x43')]['hasOwnProperty'](_0x2f0b('0x4a'))){_0x16d17e['limit']=qs['limit'](_0x11bb3e[_0x2f0b('0x43')]['limit']);_0x16d17e[_0x2f0b('0x2c')]=qs[_0x2f0b('0x2c')](_0x11bb3e[_0x2f0b('0x43')][_0x2f0b('0x2c')]);}return _0x5b39a6[_0x2f0b('0xb1')](_0x16d17e);}})[_0x2f0b('0x1f')](function(_0x2d918){if(_0x2d918){return _0x2d918?{'count':_0x118d24,'rows':_0x2d918}:null;}})[_0x2f0b('0x1f')](respondWithResult(_0x4718b6,null))[_0x2f0b('0x28')](handleError(_0x4718b6,null));};exports[_0x2f0b('0x3a')]=function(_0x1399bf,_0x54fdab,_0x5f26d7){var _0x4e6456,_0x329544,_0x36dae7;if(_[_0x2f0b('0x75')](_0x1399bf[_0x2f0b('0x58')][_0x2f0b('0x58')])||_0x1399bf[_0x2f0b('0x58')][_0x2f0b('0x58')]===''){throw new db[(_0x2f0b('0x6f'))][(_0x2f0b('0x70'))](_0x2f0b('0xb2'));}if(_[_0x2f0b('0x75')](_0x1399bf[_0x2f0b('0x58')]['to'])){}_0x4e6456=_0x1399bf[_0x2f0b('0x58')]['to'];return db[_0x2f0b('0x3c')][_0x2f0b('0x64')]({'where':{'id':_0x1399bf[_0x2f0b('0x53')]['id']}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x54fdab,null))[_0x2f0b('0x1f')](function(_0x368556){if(_0x368556){return db[_0x2f0b('0x3c')][_0x2f0b('0x56')]({'where':{'id':_0x368556['id']},'include':[{'model':db[_0x2f0b('0xb3')],'as':'List','include':[{'model':db[_0x2f0b('0x85')],'as':_0x2f0b('0x7b'),'where':{[_0x368556[_0x2f0b('0x78')]]:_0x4e6456},'limit':0x1,'order':[[_0x2f0b('0x73'),_0x2f0b('0x7c')]]}]}]})[_0x2f0b('0x1f')](handleEntityNotFound(_0x54fdab,null))[_0x2f0b('0x1f')](function(_0x1dfc2d){if(_0x1dfc2d&&_0x1dfc2d[_0x2f0b('0x7f')]){_0x329544=_0x1dfc2d['get']({'plain':!![]});if(_0x329544[_0x2f0b('0x7f')]&&_0x329544[_0x2f0b('0x7f')]['Contacts'][_0x2f0b('0x48')]){return _0x329544[_0x2f0b('0x7f')][_0x2f0b('0x7b')][0x0];}return db[_0x2f0b('0x85')][_0x2f0b('0x57')](_[_0x2f0b('0x18')](_0x1399bf[_0x2f0b('0x58')],{'firstName':_0x4e6456,[_0x1dfc2d[_0x2f0b('0x78')]]:_0x4e6456,'phone':_0x4e6456,'ListId':_0x329544[_0x2f0b('0xb4')]}));}})[_0x2f0b('0x1f')](handleEntityNotFound(_0x54fdab,null))['then'](function(_0x13724a){if(_0x13724a){_0x36dae7=_0x13724a;return db[_0x2f0b('0x8c')][_0x2f0b('0x56')]({'where':{'ContactId':_0x36dae7['id'],'closed':![],'OpenchannelAccountId':_0x329544['id']}})[_0x2f0b('0x1f')](function(_0x28feac){if(_0x28feac){return[_0x28feac,![]];}return db[_0x2f0b('0x8c')][_0x2f0b('0x57')]({'UserId':_0x1399bf[_0x2f0b('0x5b')]['id'],'ContactId':_0x36dae7['id'],'OpenchannelAccountId':_0x329544['id'],'lastMsgDirection':_0x2f0b('0xb5'),'Messages':[_[_0x2f0b('0x50')](_0x1399bf[_0x2f0b('0x58')],{'read':![],'body':_0x1399bf[_0x2f0b('0x58')][_0x2f0b('0x58')],'OpenchannelAccountId':_0x329544['id'],'UserId':_0x1399bf[_0x2f0b('0x5b')]['id'],'ContactId':_0x36dae7['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x2f0b('0xb6')}]})[_0x2f0b('0x1f')](function(_0x165519){return[_0x165519,!![]];});});}})[_0x2f0b('0x8d')](function(_0x50a84b,_0xa9ac0d){if(_0xa9ac0d){return _0x50a84b;}return db[_0x2f0b('0x93')][_0x2f0b('0x57')](_[_0x2f0b('0x50')](_0x1399bf[_0x2f0b('0x58')],{'read':![],'body':_0x1399bf[_0x2f0b('0x58')][_0x2f0b('0x58')],'OpenchannelAccountId':_0x329544['id'],'OpenchannelInteractionId':_0x50a84b['id'],'UserId':_0x1399bf[_0x2f0b('0x5b')]['id'],'ContactId':_0x36dae7['id']}))[_0x2f0b('0x1f')](function(_0x1f59bf){_0x50a84b[_0x2f0b('0xb7')][_0x2f0b('0xb6')]=[];_0x50a84b[_0x2f0b('0xb7')]['Messages'][_0x2f0b('0xb8')](_0x1f59bf[_0x2f0b('0xb7')]);return _0x50a84b;});});}})[_0x2f0b('0x1f')](respondWithResult(_0x54fdab,null))[_0x2f0b('0x28')](handleError(_0x54fdab,null));};
\ No newline at end of file
+var _0x901c=['order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','userProfileId','autoAssociation','body','describe','addDisposition','Disposition','findOne','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','OpenchannelApplication','account','applications','Applications','List','orderBy','priority','asc','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','lastName','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','DESC','ListId','out','Messages','user','dataValues','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','register','jayson/promise','client','http','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x49a60f,_0x518c48){var _0x38c29c=function(_0x42b9cb){while(--_0x42b9cb){_0x49a60f['push'](_0x49a60f['shift']());}};_0x38c29c(++_0x518c48);}(_0x901c,0x123));var _0xc901=function(_0x46c504,_0xb3b6cb){_0x46c504=_0x46c504-0x0;var _0x926202=_0x901c[_0x46c504];return _0x926202;};'use strict';var emlformat=require(_0xc901('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc901('0x1'));var moment=require(_0xc901('0x2'));var BPromise=require(_0xc901('0x3'));var Mustache=require(_0xc901('0x4'));var util=require(_0xc901('0x5'));var path=require(_0xc901('0x6'));var sox=require('sox');var csv=require(_0xc901('0x7'));var ejs=require(_0xc901('0x8'));var fs=require('fs');var fs_extra=require(_0xc901('0x9'));var _=require(_0xc901('0xa'));var squel=require(_0xc901('0xb'));var crypto=require('crypto');var jsforce=require(_0xc901('0xc'));var deskjs=require(_0xc901('0xd'));var toCsv=require(_0xc901('0x7'));var querystring=require('querystring');var Papa=require(_0xc901('0xe'));var Redis=require(_0xc901('0xf'));var authService=require(_0xc901('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc901('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc901('0x12'))('api');var utils=require(_0xc901('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc901('0x14'));var db=require(_0xc901('0x15'))['db'];config[_0xc901('0x16')]=_[_0xc901('0x17')](config[_0xc901('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc901('0x16')]));require('./openchannelAccount.socket')[_0xc901('0x18')](socket);var jayson=require(_0xc901('0x19'));var client=jayson[_0xc901('0x1a')][_0xc901('0x1b')]({'port':0x232c});var client9002=jayson[_0xc901('0x1a')][_0xc901('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4eb2fe,_0x52c91b,_0x2365dc,_0x1a0b48){return new BPromise(function(_0xcb3d7b,_0x4fc7be){var _0x2e4438=_0x1a0b48||client;return _0x2e4438[_0xc901('0x1c')](_0x4eb2fe,_0x2365dc)[_0xc901('0x1d')](function(_0x55d795){logger[_0xc901('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x52c91b,'request\x20sent');logger[_0xc901('0x1f')](_0xc901('0x20'),_0x52c91b,_0xc901('0x21'),JSON[_0xc901('0x22')](_0x55d795));if(_0x55d795[_0xc901('0x23')]){if(_0x55d795[_0xc901('0x23')][_0xc901('0x24')]===0x1f4){logger[_0xc901('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x52c91b,_0x55d795[_0xc901('0x23')][_0xc901('0x25')]);return _0x4fc7be(_0x55d795[_0xc901('0x23')]['message']);}logger['error'](_0xc901('0x26'),_0x52c91b,_0x55d795[_0xc901('0x23')]['message']);return _0xcb3d7b(_0x55d795[_0xc901('0x23')][_0xc901('0x25')]);}else{logger['info'](_0xc901('0x26'),_0x52c91b,_0xc901('0x21'));_0xcb3d7b(_0x55d795[_0xc901('0x27')]['message']);}})[_0xc901('0x28')](function(_0x40d512){logger[_0xc901('0x23')](_0xc901('0x26'),_0x52c91b,_0x40d512);_0x4fc7be(_0x40d512);});});}function respondWithStatusCode(_0x5a8d0b,_0x4b4fc0){_0x4b4fc0=_0x4b4fc0||0xcc;return function(_0x2ff915){if(_0x2ff915){return _0x5a8d0b['sendStatus'](_0x4b4fc0);}return _0x5a8d0b[_0xc901('0x29')](_0x4b4fc0)[_0xc901('0x2a')]();};}function respondWithResult(_0x1774d1,_0x530700){_0x530700=_0x530700||0xc8;return function(_0x3f60de){if(_0x3f60de){return _0x1774d1[_0xc901('0x29')](_0x530700)[_0xc901('0x2b')](_0x3f60de);}};}function respondWithFilteredResult(_0x522a58,_0x2b37dd){return function(_0x742a5d){if(_0x742a5d){var _0x161847=typeof _0x2b37dd[_0xc901('0x2c')]==='undefined'&&typeof _0x2b37dd[_0xc901('0x2d')]==='undefined';var _0x228ab3=_0x742a5d['count'];var _0x4b1f5f=_0x161847?0x0:_0x2b37dd[_0xc901('0x2c')];var _0x5da7e9=_0x161847?_0x742a5d[_0xc901('0x2e')]:_0x2b37dd[_0xc901('0x2c')]+_0x2b37dd[_0xc901('0x2d')];var _0x335b1b;if(_0x5da7e9>=_0x228ab3){_0x5da7e9=_0x228ab3;_0x335b1b=0xc8;}else{_0x335b1b=0xce;}_0x522a58[_0xc901('0x29')](_0x335b1b);return _0x522a58[_0xc901('0x2f')](_0xc901('0x30'),_0x4b1f5f+'-'+_0x5da7e9+'/'+_0x228ab3)[_0xc901('0x2b')](_0x742a5d);}return null;};}function patchUpdates(_0x23cfb6){return function(_0x25b390){try{jsonpatch[_0xc901('0x31')](_0x25b390,_0x23cfb6,!![]);}catch(_0x542d46){return BPromise['reject'](_0x542d46);}return _0x25b390['save']();};}function saveUpdates(_0x4b2f6e,_0x38d14c){return function(_0x3cd0df){if(_0x3cd0df){return _0x3cd0df['update'](_0x4b2f6e)[_0xc901('0x1d')](function(_0x58c1d9){return _0x58c1d9;});}return null;};}function removeEntity(_0x5187c8,_0x1660f1){return function(_0x405fb7){if(_0x405fb7){return _0x405fb7[_0xc901('0x32')]()[_0xc901('0x1d')](function(){var _0x25ff2c=_0x405fb7[_0xc901('0x33')]({'plain':!![]});var _0x11cedd='OpenchannelAccounts';return db[_0xc901('0x34')][_0xc901('0x32')]({'where':{'type':_0x11cedd,'resourceId':_0x25ff2c['id']}})[_0xc901('0x1d')](function(){return _0x405fb7;});})[_0xc901('0x1d')](function(){_0x5187c8[_0xc901('0x29')](0xcc)[_0xc901('0x2a')]();});}};}function handleEntityNotFound(_0x3eef4a,_0x5226f1){return function(_0x4545bb){if(!_0x4545bb){_0x3eef4a['sendStatus'](0x194);}return _0x4545bb;};}function handleError(_0x1f43b9,_0x5340d5){_0x5340d5=_0x5340d5||0x1f4;return function(_0x451a10){logger[_0xc901('0x23')](_0x451a10[_0xc901('0x35')]);if(_0x451a10[_0xc901('0x36')]){delete _0x451a10[_0xc901('0x36')];}_0x1f43b9[_0xc901('0x29')](_0x5340d5)[_0xc901('0x37')](_0x451a10);};}exports[_0xc901('0x38')]=function(_0x288e41,_0x7d332f){var _0x5b6152={'include':[{'model':db[_0xc901('0x39')],'as':_0xc901('0x3a')}]},_0x3c605d={},_0x4260ac={'count':0x0,'rows':[]};var _0x1a6513=_[_0xc901('0x3b')](db[_0xc901('0x3c')][_0xc901('0x3d')],function(_0x56291b){return{'name':_0x56291b['fieldName'],'type':_0x56291b['type']['key']};});_0x3c605d[_0xc901('0x3e')]=_[_0xc901('0x3b')](_0x1a6513,'name');_0x3c605d[_0xc901('0x3f')]=_[_0xc901('0x40')](_0x288e41[_0xc901('0x3f')]);_0x3c605d['filters']=_[_0xc901('0x41')](_0x3c605d['model'],_0x3c605d['query']);_0x5b6152[_0xc901('0x42')]=_['intersection'](_0x3c605d[_0xc901('0x3e')],qs[_0xc901('0x43')](_0x288e41[_0xc901('0x3f')]['fields']));_0x5b6152['attributes']=_0x5b6152[_0xc901('0x42')][_0xc901('0x44')]?_0x5b6152[_0xc901('0x42')]:_0x3c605d[_0xc901('0x3e')];if(!_0x288e41['query'][_0xc901('0x45')](_0xc901('0x46'))){_0x5b6152[_0xc901('0x2d')]=qs[_0xc901('0x2d')](_0x288e41['query']['limit']);_0x5b6152[_0xc901('0x2c')]=qs['offset'](_0x288e41[_0xc901('0x3f')][_0xc901('0x2c')]);}_0x5b6152[_0xc901('0x47')]=qs[_0xc901('0x48')](_0x288e41[_0xc901('0x3f')][_0xc901('0x48')]);_0x5b6152[_0xc901('0x49')]=qs[_0xc901('0x4a')](_[_0xc901('0x4b')](_0x288e41[_0xc901('0x3f')],_0x3c605d['filters']),_0x1a6513);if(_0x288e41[_0xc901('0x3f')][_0xc901('0x4c')]){_0x5b6152['where']=_[_0xc901('0x4d')](_0x5b6152[_0xc901('0x49')],{'$or':_[_0xc901('0x3b')](_0x1a6513,function(_0x3d7e7f){if(_0x3d7e7f[_0xc901('0x4e')]!==_0xc901('0x4f')){var _0x2e5de8={};_0x2e5de8[_0x3d7e7f[_0xc901('0x36')]]={'$like':'%'+_0x288e41[_0xc901('0x3f')][_0xc901('0x4c')]+'%'};return _0x2e5de8;}})});}_0x5b6152=_[_0xc901('0x4d')]({},_0x5b6152,_0x288e41[_0xc901('0x50')]);var _0x187725={'where':_0x5b6152[_0xc901('0x49')]};return db[_0xc901('0x3c')][_0xc901('0x2e')](_0x187725)[_0xc901('0x1d')](function(_0x73c52d){_0x4260ac[_0xc901('0x2e')]=_0x73c52d;if(_0x288e41[_0xc901('0x3f')][_0xc901('0x51')]){_0x5b6152[_0xc901('0x52')]=[{'all':!![]}];}return db[_0xc901('0x3c')][_0xc901('0x53')](_0x5b6152);})[_0xc901('0x1d')](function(_0x25e978){_0x4260ac['rows']=_0x25e978;return _0x4260ac;})[_0xc901('0x1d')](respondWithFilteredResult(_0x7d332f,_0x5b6152))[_0xc901('0x28')](handleError(_0x7d332f,null));};exports[_0xc901('0x54')]=function(_0x5634d6,_0x87977b){var _0x21b523={'raw':![],'where':{'id':_0x5634d6[_0xc901('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xc901('0x3a')}]},_0x45b5a6={};_0x45b5a6[_0xc901('0x3e')]=_[_0xc901('0x40')](db[_0xc901('0x3c')][_0xc901('0x3d')]);_0x45b5a6[_0xc901('0x3f')]=_[_0xc901('0x40')](_0x5634d6[_0xc901('0x3f')]);_0x45b5a6[_0xc901('0x4a')]=_[_0xc901('0x41')](_0x45b5a6['model'],_0x45b5a6[_0xc901('0x3f')]);_0x21b523[_0xc901('0x42')]=_[_0xc901('0x41')](_0x45b5a6['model'],qs[_0xc901('0x43')](_0x5634d6['query'][_0xc901('0x43')]));_0x21b523[_0xc901('0x42')]=_0x21b523[_0xc901('0x42')][_0xc901('0x44')]?_0x21b523[_0xc901('0x42')]:_0x45b5a6['model'];if(_0x5634d6[_0xc901('0x3f')]['includeAll']){_0x21b523['include']=[{'all':!![]}];}_0x21b523=_[_0xc901('0x4d')]({},_0x21b523,_0x5634d6['options']);return db[_0xc901('0x3c')][_0xc901('0x56')](_0x21b523)[_0xc901('0x1d')](handleEntityNotFound(_0x87977b,null))['then'](respondWithResult(_0x87977b,null))[_0xc901('0x28')](handleError(_0x87977b,null));};exports[_0xc901('0x57')]=function(_0x3748c8,_0x3a1c98){return db[_0xc901('0x3c')][_0xc901('0x57')](_0x3748c8['body'],{})['then'](function(_0x264bd8){var _0x3caeb7=_0x3748c8['user'][_0xc901('0x33')]({'plain':!![]});if(!_0x3caeb7)throw new Error(_0xc901('0x58'));if(_0x3caeb7[_0xc901('0x59')]==='user'){var _0xe5687f=_0x264bd8[_0xc901('0x33')]({'plain':!![]});var _0x108546=_0xc901('0x5a');return db['UserProfileSection']['find']({'where':{'name':_0x108546,'userProfileId':_0x3caeb7[_0xc901('0x5b')]},'raw':!![]})[_0xc901('0x1d')](function(_0x4539e1){if(_0x4539e1&&_0x4539e1[_0xc901('0x5c')]===0x0){return db[_0xc901('0x34')][_0xc901('0x57')]({'name':_0xe5687f[_0xc901('0x36')],'resourceId':_0xe5687f['id'],'type':_0x4539e1['name'],'sectionId':_0x4539e1['id']},{})['then'](function(){return _0x264bd8;});}else{return _0x264bd8;}})['catch'](function(_0x360477){logger[_0xc901('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x360477);throw _0x360477;});}return _0x264bd8;})[_0xc901('0x1d')](respondWithResult(_0x3a1c98,0xc9))['catch'](handleError(_0x3a1c98,null));};exports['update']=function(_0x4133d3,_0x17f8bf){if(_0x4133d3[_0xc901('0x5d')]['id']){delete _0x4133d3[_0xc901('0x5d')]['id'];}return db[_0xc901('0x3c')][_0xc901('0x56')]({'where':{'id':_0x4133d3[_0xc901('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xc901('0x3a')}]})[_0xc901('0x1d')](handleEntityNotFound(_0x17f8bf,null))['then'](saveUpdates(_0x4133d3[_0xc901('0x5d')],null))[_0xc901('0x1d')](respondWithResult(_0x17f8bf,null))['catch'](handleError(_0x17f8bf,null));};exports[_0xc901('0x32')]=function(_0x48571b,_0x5801c4){return db[_0xc901('0x3c')][_0xc901('0x56')]({'where':{'id':_0x48571b[_0xc901('0x55')]['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0x5801c4,null))['then'](removeEntity(_0x5801c4,null))[_0xc901('0x28')](handleError(_0x5801c4,null));};exports['describe']=function(_0x8960f3,_0x1a2dab){return db[_0xc901('0x3c')][_0xc901('0x5e')]()[_0xc901('0x1d')](respondWithResult(_0x1a2dab,null))['catch'](handleError(_0x1a2dab,null));};exports[_0xc901('0x5f')]=function(_0x3ec5db,_0x3dfc58,_0x37f2c1){if(_0x3ec5db[_0xc901('0x5d')]['id']){delete _0x3ec5db[_0xc901('0x5d')]['id'];}return db['OpenchannelAccount'][_0xc901('0x56')]({'where':{'id':_0x3ec5db[_0xc901('0x55')]['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0x3dfc58,null))[_0xc901('0x1d')](function(_0x408f3f){if(_0x408f3f){_0x3ec5db[_0xc901('0x5d')]['OpenchannelAccountId']=_0x408f3f['id'];return db[_0xc901('0x60')][_0xc901('0x57')](_0x3ec5db['body']);}})[_0xc901('0x1d')](respondWithResult(_0x3dfc58,null))[_0xc901('0x28')](handleError(_0x3dfc58,null));};exports['getDispositions']=function(_0x451a8e,_0x4ef388,_0x3b673c){var _0x5d8b41={'raw':![],'where':{}};var _0x2d7931={};var _0x41173d={'count':0x0,'rows':[]};return db[_0xc901('0x3c')][_0xc901('0x61')]({'where':{'id':_0x451a8e[_0xc901('0x55')]['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0x4ef388,null))['then'](function(_0x5bfa30){if(_0x5bfa30){_0x2d7931['model']=_[_0xc901('0x40')](db[_0xc901('0x60')][_0xc901('0x3d')]);_0x2d7931[_0xc901('0x3f')]=_[_0xc901('0x40')](_0x451a8e['query']);_0x2d7931['filters']=_[_0xc901('0x41')](_0x2d7931[_0xc901('0x3e')],_0x2d7931[_0xc901('0x3f')]);_0x5d8b41[_0xc901('0x42')]=_['intersection'](_0x2d7931[_0xc901('0x3e')],qs[_0xc901('0x43')](_0x451a8e[_0xc901('0x3f')][_0xc901('0x43')]));_0x5d8b41['attributes']=_0x5d8b41[_0xc901('0x42')][_0xc901('0x44')]?_0x5d8b41[_0xc901('0x42')]:_0x2d7931['model'];if(!_0x451a8e[_0xc901('0x3f')][_0xc901('0x45')]('nolimit')){_0x5d8b41[_0xc901('0x2d')]=qs[_0xc901('0x2d')](_0x451a8e['query'][_0xc901('0x2d')]);_0x5d8b41[_0xc901('0x2c')]=qs[_0xc901('0x2c')](_0x451a8e['query'][_0xc901('0x2c')]);}_0x5d8b41[_0xc901('0x47')]=qs[_0xc901('0x48')](_0x451a8e[_0xc901('0x3f')]['sort']);_0x5d8b41['where']=qs[_0xc901('0x4a')](_[_0xc901('0x4b')](_0x451a8e[_0xc901('0x3f')],_0x2d7931[_0xc901('0x4a')]));_0x5d8b41[_0xc901('0x49')][_0xc901('0x62')]=_0x5bfa30['id'];if(_0x451a8e[_0xc901('0x3f')]['filter']){_0x5d8b41[_0xc901('0x49')]=_['merge'](_0x5d8b41[_0xc901('0x49')],{'$or':_[_0xc901('0x3b')](_0x5d8b41[_0xc901('0x42')],function(_0x58daa1){var _0x3e18ba={};_0x3e18ba[_0x58daa1]={'$like':'%'+_0x451a8e[_0xc901('0x3f')][_0xc901('0x4c')]+'%'};return _0x3e18ba;})});}_0x5d8b41=_['merge']({},_0x5d8b41,_0x451a8e['options']);return db[_0xc901('0x60')]['count']({'where':_0x5d8b41[_0xc901('0x49')]})['then'](function(_0x3f9d18){_0x41173d[_0xc901('0x2e')]=_0x3f9d18;if(_0x451a8e[_0xc901('0x3f')][_0xc901('0x51')]){_0x5d8b41[_0xc901('0x52')]=[{'all':!![]}];}return db[_0xc901('0x60')][_0xc901('0x53')](_0x5d8b41);})[_0xc901('0x1d')](function(_0x1f7988){_0x41173d[_0xc901('0x63')]=_0x1f7988;return _0x41173d;});}})[_0xc901('0x1d')](respondWithFilteredResult(_0x4ef388,_0x5d8b41))[_0xc901('0x28')](handleError(_0x4ef388,null));};exports['removeDispositions']=function(_0x46fed4,_0xce894e,_0xdebc73){return db[_0xc901('0x3c')][_0xc901('0x56')]({'where':{'id':_0x46fed4[_0xc901('0x55')]['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0xce894e,null))['then'](function(_0xa70196){if(_0xa70196){return _0xa70196[_0xc901('0x64')](_0x46fed4[_0xc901('0x3f')][_0xc901('0x65')]);}})[_0xc901('0x1d')](respondWithStatusCode(_0xce894e,null))[_0xc901('0x28')](handleError(_0xce894e,null));};exports[_0xc901('0x66')]=function(_0x26c1bd,_0x246860,_0x11a86d){if(_0x26c1bd[_0xc901('0x5d')]['id']){delete _0x26c1bd['body']['id'];}return db[_0xc901('0x3c')][_0xc901('0x56')]({'where':{'id':_0x26c1bd['params']['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0x246860,null))[_0xc901('0x1d')](function(_0x31a5e1){if(_0x31a5e1){_0x26c1bd[_0xc901('0x5d')]['OpenchannelAccountId']=_0x31a5e1['id'];return db['CannedAnswer'][_0xc901('0x57')](_0x26c1bd['body']);}})[_0xc901('0x1d')](respondWithResult(_0x246860,null))[_0xc901('0x28')](handleError(_0x246860,null));};exports[_0xc901('0x67')]=function(_0x4c398b,_0x117760,_0x2f2ecf){var _0x26c98c={'raw':![],'where':{}};var _0x37a243={};var _0x584b5a={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc901('0x61')]({'where':{'id':_0x4c398b[_0xc901('0x55')]['id']}})['then'](handleEntityNotFound(_0x117760,null))['then'](function(_0x44dc2e){if(_0x44dc2e){_0x37a243[_0xc901('0x3e')]=_[_0xc901('0x40')](db[_0xc901('0x68')][_0xc901('0x3d')]);_0x37a243[_0xc901('0x3f')]=_[_0xc901('0x40')](_0x4c398b[_0xc901('0x3f')]);_0x37a243['filters']=_[_0xc901('0x41')](_0x37a243[_0xc901('0x3e')],_0x37a243['query']);_0x26c98c[_0xc901('0x42')]=_['intersection'](_0x37a243[_0xc901('0x3e')],qs[_0xc901('0x43')](_0x4c398b['query']['fields']));_0x26c98c['attributes']=_0x26c98c['attributes'][_0xc901('0x44')]?_0x26c98c[_0xc901('0x42')]:_0x37a243[_0xc901('0x3e')];if(!_0x4c398b['query'][_0xc901('0x45')]('nolimit')){_0x26c98c[_0xc901('0x2d')]=qs[_0xc901('0x2d')](_0x4c398b[_0xc901('0x3f')]['limit']);_0x26c98c['offset']=qs[_0xc901('0x2c')](_0x4c398b['query'][_0xc901('0x2c')]);}_0x26c98c['order']=qs[_0xc901('0x48')](_0x4c398b[_0xc901('0x3f')][_0xc901('0x48')]);_0x26c98c['where']=qs[_0xc901('0x4a')](_[_0xc901('0x4b')](_0x4c398b[_0xc901('0x3f')],_0x37a243[_0xc901('0x4a')]));_0x26c98c[_0xc901('0x49')][_0xc901('0x62')]=_0x44dc2e['id'];if(_0x4c398b[_0xc901('0x3f')][_0xc901('0x4c')]){_0x26c98c[_0xc901('0x49')]=_[_0xc901('0x4d')](_0x26c98c[_0xc901('0x49')],{'$or':_['map'](_0x26c98c[_0xc901('0x42')],function(_0x4056dc){var _0x254e22={};_0x254e22[_0x4056dc]={'$like':'%'+_0x4c398b['query'][_0xc901('0x4c')]+'%'};return _0x254e22;})});}_0x26c98c=_[_0xc901('0x4d')]({},_0x26c98c,_0x4c398b[_0xc901('0x50')]);return db[_0xc901('0x68')][_0xc901('0x2e')]({'where':_0x26c98c['where']})['then'](function(_0x30aa97){_0x584b5a[_0xc901('0x2e')]=_0x30aa97;if(_0x4c398b[_0xc901('0x3f')][_0xc901('0x51')]){_0x26c98c[_0xc901('0x52')]=[{'all':!![]}];}return db[_0xc901('0x68')][_0xc901('0x53')](_0x26c98c);})[_0xc901('0x1d')](function(_0x27797a){_0x584b5a[_0xc901('0x63')]=_0x27797a;return _0x584b5a;});}})[_0xc901('0x1d')](respondWithFilteredResult(_0x117760,_0x26c98c))[_0xc901('0x28')](handleError(_0x117760,null));};exports[_0xc901('0x69')]=function(_0x37eb0e,_0x43f3b8,_0x2be99c){return db[_0xc901('0x3c')][_0xc901('0x56')]({'where':{'id':_0x37eb0e[_0xc901('0x55')]['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0x43f3b8,null))['then'](function(_0x201b27){if(_0x201b27){return _0x201b27[_0xc901('0x69')](_0x37eb0e[_0xc901('0x3f')][_0xc901('0x65')]);}})[_0xc901('0x1d')](respondWithStatusCode(_0x43f3b8,null))[_0xc901('0x28')](handleError(_0x43f3b8,null));};exports[_0xc901('0x6a')]=function(_0x417702,_0x281889,_0xf5de02){var _0x4dc9c5={'body':_0x417702[_0xc901('0x5d')],'channel':_0xc901('0x6b')};var _0x2f68ad=[];var _0x37c3e8=[];var _0x4865fb={};var _0x540747=![];return db[_0xc901('0x6c')][_0xc901('0x5e')]()[_0xc901('0x1d')](function(_0x310813){if(!_0x310813){throw new db['Sequelize'][(_0xc901('0x6d'))](_0xc901('0x6e'));}_0x2f68ad=_['difference'](_[_0xc901('0x40')](_0x310813),['createdAt','updatedAt']);_0x37c3e8=_[_0xc901('0x6f')](_['keys'](_0x310813),[_0xc901('0x70'),_0xc901('0x71'),'CompanyId','ListId']);if(_0x417702['body']['id']){delete _0x417702[_0xc901('0x5d')]['id'];}if(_['isNil'](_0x417702[_0xc901('0x5d')][_0xc901('0x72')])){throw new db[(_0xc901('0x73'))][(_0xc901('0x6d'))](_0xc901('0x74'));}if(_[_0xc901('0x75')](_0x417702['body'][_0xc901('0x5d')])||_0x417702[_0xc901('0x5d')][_0xc901('0x5d')]===''){throw new db[(_0xc901('0x73'))][(_0xc901('0x6d'))](_0xc901('0x76'));}if(_[_0xc901('0x75')](_0x417702['body'][_0xc901('0x77')])){throw new db[(_0xc901('0x73'))][(_0xc901('0x6d'))](_0xc901('0x78')+_0x37c3e8);}if(!_[_0xc901('0x79')](_0x37c3e8,_0x417702[_0xc901('0x5d')][_0xc901('0x77')])){throw new db[(_0xc901('0x73'))][(_0xc901('0x6d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x37c3e8);}_0x4865fb[_0x417702['body']['mapKey']]=_0x417702[_0xc901('0x5d')][_0xc901('0x72')];})[_0xc901('0x1d')](function(){return db['OpenchannelAccount'][_0xc901('0x56')]({'where':{'id':_0x417702['params']['id']},'include':[{'model':db[_0xc901('0x7a')],'as':'List','include':[{'model':db[_0xc901('0x6c')],'as':_0xc901('0x7b'),'where':_0x4865fb,'limit':0x1,'order':[[_0xc901('0x71'),'DESC']]}]},{'model':db[_0xc901('0x7c')],'as':'Applications'}]});})[_0xc901('0x1d')](handleEntityNotFound(_0x281889,null))[_0xc901('0x1d')](function(_0xc8da){if(_0xc8da&&_0xc8da['List']){_0x4dc9c5[_0xc901('0x7d')]=_0xc8da;_0x4dc9c5[_0xc901('0x7e')]=_0xc8da[_0xc901('0x7f')];_0x4dc9c5['list']=_0xc8da[_0xc901('0x80')];_0x4dc9c5[_0xc901('0x7e')]=_[_0xc901('0x81')](_0x4dc9c5[_0xc901('0x7e')],[_0xc901('0x82')],[_0xc901('0x83')]);if(_0x4dc9c5[_0xc901('0x7d')][_0xc901('0x7f')]){delete _0x4dc9c5[_0xc901('0x7d')]['Applications'];}if(_0x4dc9c5[_0xc901('0x7d')][_0xc901('0x80')]&&_0x4dc9c5[_0xc901('0x7d')][_0xc901('0x80')]['Contacts'][_0xc901('0x44')]){return _0x4dc9c5['account'][_0xc901('0x80')][_0xc901('0x7b')][0x0];}var _0xf83cb4=_[_0xc901('0x17')](_0x417702[_0xc901('0x5d')],{'firstName':_0x417702['body'][_0xc901('0x72')],'ListId':_0xc8da['ListId']});_0xf83cb4[_0x417702[_0xc901('0x5d')]['mapKey']]=_0x417702[_0xc901('0x5d')][_0xc901('0x72')];return db[_0xc901('0x6c')]['create'](_0xf83cb4,{'fields':_0x2f68ad,'raw':!![]});}})['then'](handleEntityNotFound(_0x281889,null))[_0xc901('0x1d')](function(_0x3e5d6c){_0x4dc9c5['contact']=_0x3e5d6c;if(_0x3e5d6c){var _0x31a45f={'ContactId':_0x3e5d6c['id'],'OpenchannelAccountId':_0x417702[_0xc901('0x55')]['id'],'from':(_0x3e5d6c[_0xc901('0x84')]||'')+'\x20'+(_0x3e5d6c['lastName']||'')};var _0x34a574={'OpenchannelAccountId':_0x417702[_0xc901('0x55')]['id'],'closed':![]};if(_0x417702[_0xc901('0x5d')][_0xc901('0x85')]){_0x34a574[_0xc901('0x85')]=_0x417702[_0xc901('0x5d')]['threadId'];return db[_0xc901('0x86')][_0xc901('0x56')]({'where':_0x34a574})[_0xc901('0x1d')](function(_0x1e49b1){if(_0x1e49b1){return[_0x1e49b1,![]];}_0x31a45f[_0xc901('0x85')]=_0x417702[_0xc901('0x5d')][_0xc901('0x85')];_0x31a45f[_0xc901('0x87')]=_0x417702[_0xc901('0x5d')]['externalUrl'];return db[_0xc901('0x86')]['create'](_0x31a45f)['then'](function(_0x3ff005){return[_0x3ff005,!![]];});});}else{_0x34a574[_0xc901('0x85')]=null;}_0x34a574[_0xc901('0x88')]=_0x3e5d6c['id'];return db['OpenchannelInteraction'][_0xc901('0x56')]({'where':_0x34a574})[_0xc901('0x1d')](function(_0x43aed5){if(_0x43aed5){return[_0x43aed5,![]];}return db[_0xc901('0x86')]['create'](_0x31a45f)[_0xc901('0x1d')](function(_0x12fd50){return[_0x12fd50,!![]];});});}})[_0xc901('0x89')](function(_0x51e143,_0x52a789){if(_0x51e143){_0x540747=_0x52a789;if(!_0x52a789){var _0x6368f4={'from':(_0x4dc9c5['contact']['firstName']||'')+'\x20'+(_0x4dc9c5[_0xc901('0x8a')][_0xc901('0x8b')]||'')};if(_0x417702[_0xc901('0x5d')][_0xc901('0x85')]&&_0x417702[_0xc901('0x5d')]['messageId']&&_0x417702['body'][_0xc901('0x85')]!=_0x417702[_0xc901('0x5d')][_0xc901('0x8c')]){_0x6368f4[_0xc901('0x85')]=_0x417702[_0xc901('0x5d')][_0xc901('0x8c')];}return _0x51e143['update'](_0x6368f4);}else{return _0x51e143;}}})[_0xc901('0x1d')](function(_0x41c0df){_0x4dc9c5['interaction']=_0x41c0df[_0xc901('0x33')]({'plain':!![]});_0x4dc9c5[_0xc901('0x8d')]['created']=_0x540747;if(_0x4dc9c5['interaction'][_0xc901('0x8e')]){if(_0x4dc9c5[_0xc901('0x7d')][_0xc901('0x8f')]){_0x4dc9c5[_0xc901('0x7e')][_0xc901('0x90')]({'id':0x0,'priority':_0x4dc9c5['applications']['length']+0x1,'app':'close','appdata':_0xc901('0x91'),'interval':_0xc901('0x92')});}}return db[_0xc901('0x93')][_0xc901('0x57')]({'body':_0x417702[_0xc901('0x5d')][_0xc901('0x5d')],'OpenchannelAccountId':_0x417702['params']['id'],'OpenchannelInteractionId':_0x41c0df['id'],'direction':'in','ContactId':_0x4dc9c5[_0xc901('0x8a')]['id'],'AttachmentId':_0x417702['body'][_0xc901('0x94')]});})['then'](function(_0x2a6840){_0x4dc9c5[_0xc901('0x25')]=_0x2a6840;if(_0x4dc9c5['interaction'][_0xc901('0x95')]){return db[_0xc901('0x96')][_0xc901('0x56')]({'attributes':['id','name'],'where':{'id':_0x4dc9c5[_0xc901('0x8d')][_0xc901('0x95')]}})[_0xc901('0x1d')](function(_0x4e2ca9){if(_0x4e2ca9){_0x4dc9c5[_0xc901('0x7e')][_0xc901('0x97')]({'id':0x0,'priority':0x0,'app':_0xc901('0x98'),'appdata':_0x4e2ca9['name']+','+(_0x4dc9c5[_0xc901('0x7d')]['waitForTheAssignedAgent']||0xa),'interval':_0xc901('0x92')});_0x4dc9c5[_0xc901('0x99')]=![];}return respondWithRpcPromise('Start',_0xc901('0x9a'),_0x4dc9c5);});}return respondWithRpcPromise('Start',_0xc901('0x9a'),_0x4dc9c5);})[_0xc901('0x1d')](function(_0x43b18e){respondWithRpcPromise(_0xc901('0x9b'),_0xc901('0x9b'),{'event':_0xc901('0x6a'),'message':_0x43b18e},client9002);return _0x43b18e;})[_0xc901('0x1d')](respondWithResult(_0x281889,null))[_0xc901('0x28')](handleError(_0x281889,null));};exports[_0xc901('0x9c')]=function(_0x151256,_0x55f5aa,_0x289760){return db[_0xc901('0x3c')]['findOne']({'where':{'id':_0x151256['params']['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0x55f5aa,null))[_0xc901('0x1d')](function(_0x2c25df){if(_0x2c25df){return db[_0xc901('0x9d')]['transaction'](function(_0x1af8a5){return db[_0xc901('0x7c')][_0xc901('0x32')]({'where':{'OpenchannelAccountId':_0x151256[_0xc901('0x55')]['id']},'transaction':_0x1af8a5})['then'](function(_0x5c4e7b){var _0x5c3817=_['map'](_0x151256[_0xc901('0x5d')],function(_0x225e47){_0x225e47[_0xc901('0x62')]=_0x151256[_0xc901('0x55')]['id'];return _0x225e47;});return db[_0xc901('0x7c')]['bulkCreate'](_0x5c3817,{'transaction':_0x1af8a5});});})[_0xc901('0x1d')](function(){return db[_0xc901('0x7c')][_0xc901('0x9e')]({'where':{'OpenchannelAccountId':_0x151256[_0xc901('0x55')]['id']},'order':_0xc901('0x82')});});}})['then'](respondWithResult(_0x55f5aa,null))[_0xc901('0x28')](handleError(_0x55f5aa,null));};exports[_0xc901('0x9f')]=function(_0x3bdc55,_0x4e3a69,_0x383cdd){var _0x389c72={};var _0x1c054d={};var _0x213614;var _0x34b6ee;return db[_0xc901('0x3c')][_0xc901('0x61')]({'where':{'id':_0x3bdc55['params']['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0x4e3a69,null))['then'](function(_0xe2e106){if(_0xe2e106){_0x213614=_0xe2e106;_0x1c054d[_0xc901('0x3e')]=_['keys'](db['OpenchannelApplication'][_0xc901('0x3d')]);_0x1c054d['query']=_[_0xc901('0x40')](_0x3bdc55[_0xc901('0x3f')]);_0x1c054d[_0xc901('0x4a')]=_[_0xc901('0x41')](_0x1c054d[_0xc901('0x3e')],_0x1c054d[_0xc901('0x3f')]);_0x389c72[_0xc901('0x42')]=_[_0xc901('0x41')](_0x1c054d[_0xc901('0x3e')],qs[_0xc901('0x43')](_0x3bdc55[_0xc901('0x3f')][_0xc901('0x43')]));_0x389c72[_0xc901('0x42')]=_0x389c72[_0xc901('0x42')][_0xc901('0x44')]?_0x389c72[_0xc901('0x42')]:_0x1c054d[_0xc901('0x3e')];_0x389c72['order']=qs[_0xc901('0x48')](_0x3bdc55['query'][_0xc901('0x48')]);_0x389c72[_0xc901('0x49')]=qs[_0xc901('0x4a')](_[_0xc901('0x4b')](_0x3bdc55[_0xc901('0x3f')],_0x1c054d[_0xc901('0x4a')]));if(_0x3bdc55[_0xc901('0x3f')]['filter']){_0x389c72[_0xc901('0x49')]=_[_0xc901('0x4d')](_0x389c72[_0xc901('0x49')],{'$or':_[_0xc901('0x3b')](_0x389c72[_0xc901('0x42')],function(_0x5ae335){var _0x97fe12={};_0x97fe12[_0x5ae335]={'$like':'%'+_0x3bdc55[_0xc901('0x3f')][_0xc901('0x4c')]+'%'};return _0x97fe12;})});}_0x389c72=_[_0xc901('0x4d')]({},_0x389c72,_0x3bdc55[_0xc901('0x50')]);return _0x213614[_0xc901('0x9f')](_0x389c72);}})[_0xc901('0x1d')](function(_0x5db996){if(_0x5db996){_0x34b6ee=_0x5db996[_0xc901('0x44')];if(!_0x3bdc55[_0xc901('0x3f')][_0xc901('0x45')](_0xc901('0x46'))){_0x389c72['limit']=qs['limit'](_0x3bdc55['query'][_0xc901('0x2d')]);_0x389c72[_0xc901('0x2c')]=qs[_0xc901('0x2c')](_0x3bdc55[_0xc901('0x3f')][_0xc901('0x2c')]);}return _0x213614[_0xc901('0x9f')](_0x389c72);}})['then'](function(_0x163ed9){if(_0x163ed9){return _0x163ed9?{'count':_0x34b6ee,'rows':_0x163ed9}:null;}})['then'](respondWithResult(_0x4e3a69,null))[_0xc901('0x28')](handleError(_0x4e3a69,null));};exports['getInteractions']=function(_0x4f7ac2,_0x1fd107,_0x598cbb){var _0x58ce66={'raw':![],'where':{}};var _0x1468db={};var _0x39eca1={'count':0x0,'rows':[]};return db[_0xc901('0x3c')]['findOne']({'where':{'id':_0x4f7ac2[_0xc901('0x55')]['id']}})['then'](handleEntityNotFound(_0x1fd107,null))[_0xc901('0x1d')](function(_0x2593a0){if(_0x2593a0){_0x1468db['model']=_[_0xc901('0x40')](db[_0xc901('0x86')][_0xc901('0x3d')]);_0x1468db['query']=_[_0xc901('0x40')](_0x4f7ac2['query']);_0x1468db[_0xc901('0x4a')]=_[_0xc901('0x41')](_0x1468db[_0xc901('0x3e')],_0x1468db['query']);_0x58ce66[_0xc901('0x42')]=_[_0xc901('0x41')](_0x1468db[_0xc901('0x3e')],qs[_0xc901('0x43')](_0x4f7ac2['query'][_0xc901('0x43')]));_0x58ce66[_0xc901('0x42')]=_0x58ce66['attributes']['length']?_0x58ce66[_0xc901('0x42')]:_0x1468db[_0xc901('0x3e')];if(!_0x4f7ac2[_0xc901('0x3f')][_0xc901('0x45')](_0xc901('0x46'))){_0x58ce66[_0xc901('0x2d')]=qs[_0xc901('0x2d')](_0x4f7ac2['query']['limit']);_0x58ce66[_0xc901('0x2c')]=qs['offset'](_0x4f7ac2[_0xc901('0x3f')]['offset']);}_0x58ce66[_0xc901('0x47')]=qs[_0xc901('0x48')](_0x4f7ac2[_0xc901('0x3f')][_0xc901('0x48')]);_0x58ce66['where']=qs[_0xc901('0x4a')](_[_0xc901('0x4b')](_0x4f7ac2[_0xc901('0x3f')],_0x1468db[_0xc901('0x4a')]));_0x58ce66[_0xc901('0x49')][_0xc901('0x62')]=_0x2593a0['id'];if(_0x4f7ac2[_0xc901('0x3f')][_0xc901('0x4c')]){_0x58ce66['where']=_['merge'](_0x58ce66[_0xc901('0x49')],{'$or':_['map'](_0x58ce66[_0xc901('0x42')],function(_0x3bfb21){var _0x8656e4={};_0x8656e4[_0x3bfb21]={'$like':'%'+_0x4f7ac2['query']['filter']+'%'};return _0x8656e4;})});}_0x58ce66=_[_0xc901('0x4d')]({},_0x58ce66,_0x4f7ac2[_0xc901('0x50')]);return db['OpenchannelInteraction'][_0xc901('0x2e')]({'where':_0x58ce66[_0xc901('0x49')]})['then'](function(_0x3fdd57){_0x39eca1[_0xc901('0x2e')]=_0x3fdd57;if(_0x4f7ac2['query'][_0xc901('0x51')]){_0x58ce66[_0xc901('0x52')]=[{'model':db['CmContact'],'as':_0xc901('0xa0'),'required':![]},{'model':db[_0xc901('0x96')],'as':_0xc901('0xa1'),'attributes':[_0xc901('0x36'),_0xc901('0xa2'),_0xc901('0xa3')],'required':![]},{'model':db[_0xc901('0xa4')],'as':_0xc901('0xa5'),'attributes':['id',_0xc901('0x36'),_0xc901('0xa6')],'where':_0x4f7ac2[_0xc901('0x3f')][_0xc901('0xa7')]?{'id':_0x4f7ac2[_0xc901('0x3f')][_0xc901('0xa7')]}:undefined,'required':_0x4f7ac2['query']['tag']?!![]:![]}];}return db[_0xc901('0x86')][_0xc901('0x53')](_0x58ce66);})[_0xc901('0x1d')](function(_0x37d01f){_0x39eca1[_0xc901('0x63')]=_0x37d01f;return _0x39eca1;});}})[_0xc901('0x1d')](respondWithFilteredResult(_0x1fd107,_0x58ce66))['catch'](handleError(_0x1fd107,null));};exports[_0xc901('0xa8')]=function(_0x365eac,_0x51339e,_0x564a5c){return db[_0xc901('0x3c')]['find']({'where':{'id':_0x365eac[_0xc901('0x55')]['id']}})['then'](handleEntityNotFound(_0x51339e,null))[_0xc901('0x1d')](function(_0x22e49a){if(_0x22e49a){return _0x22e49a[_0xc901('0xa8')](_0x365eac[_0xc901('0x5d')][_0xc901('0x65')],_[_0xc901('0xa9')](_0x365eac['body'],[_0xc901('0x65'),'id'])||{})[_0xc901('0x89')](function(_0x492958){for(var _0x3b8791=0x0;_0x3b8791<_0x365eac[_0xc901('0x5d')]['ids']['length'];_0x3b8791+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x365eac[_0xc901('0x5d')][_0xc901('0x65')][_0x3b8791]),'OpenchannelAccountId':Number(_0x365eac['params']['id'])});}return _0x492958;});}})[_0xc901('0x1d')](respondWithResult(_0x51339e,null))[_0xc901('0x28')](handleError(_0x51339e,null));};exports[_0xc901('0xaa')]=function(_0x27aaf0,_0x3475f2,_0x462fd9){return db[_0xc901('0x3c')][_0xc901('0x56')]({'where':{'id':_0x27aaf0[_0xc901('0x55')]['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0x3475f2,null))[_0xc901('0x1d')](function(_0x4cb514){if(_0x4cb514){return _0x4cb514[_0xc901('0xaa')](_0x27aaf0[_0xc901('0x3f')][_0xc901('0x65')])['then'](function(){if(_[_0xc901('0xab')](_0x27aaf0[_0xc901('0x3f')]['ids'])){for(var _0x4a56e7=0x0;_0x4a56e7<_0x27aaf0[_0xc901('0x3f')]['ids'][_0xc901('0x44')];_0x4a56e7+=0x1){socket['emit'](_0xc901('0xac'),{'UserId':Number(_0x27aaf0['query'][_0xc901('0x65')][_0x4a56e7]),'OpenchannelAccountId':Number(_0x27aaf0[_0xc901('0x55')]['id'])});}}else{socket[_0xc901('0xad')](_0xc901('0xac'),{'UserId':Number(_0x27aaf0[_0xc901('0x3f')][_0xc901('0x65')]),'OpenchannelAccountId':Number(_0x27aaf0['params']['id'])});}});}})[_0xc901('0x1d')](respondWithStatusCode(_0x3475f2,null))[_0xc901('0x28')](handleError(_0x3475f2,null));};exports['getAgents']=function(_0x602bce,_0x248e68,_0x3dc3a9){var _0x5a5857={};var _0x37d6f1={};var _0x4eafb1;var _0x7d0523;return db[_0xc901('0x3c')]['findOne']({'where':{'id':_0x602bce['params']['id']}})['then'](handleEntityNotFound(_0x248e68,null))[_0xc901('0x1d')](function(_0x38b3c6){if(_0x38b3c6){_0x4eafb1=_0x38b3c6;_0x37d6f1[_0xc901('0x3e')]=_[_0xc901('0x40')](db[_0xc901('0x96')][_0xc901('0x3d')]);_0x37d6f1[_0xc901('0x3f')]=_[_0xc901('0x40')](_0x602bce[_0xc901('0x3f')]);_0x37d6f1['filters']=_[_0xc901('0x41')](_0x37d6f1[_0xc901('0x3e')],_0x37d6f1[_0xc901('0x3f')]);_0x5a5857['attributes']=_[_0xc901('0x41')](_0x37d6f1[_0xc901('0x3e')],qs[_0xc901('0x43')](_0x602bce[_0xc901('0x3f')][_0xc901('0x43')]));_0x5a5857['attributes']=_0x5a5857[_0xc901('0x42')]['length']?_0x5a5857['attributes']:_0x37d6f1[_0xc901('0x3e')];_0x5a5857['order']=qs[_0xc901('0x48')](_0x602bce['query'][_0xc901('0x48')]);_0x5a5857['where']=qs[_0xc901('0x4a')](_[_0xc901('0x4b')](_0x602bce[_0xc901('0x3f')],_0x37d6f1[_0xc901('0x4a')]));if(_0x602bce['query'][_0xc901('0x4c')]){_0x5a5857['where']=_[_0xc901('0x4d')](_0x5a5857['where'],{'$or':_[_0xc901('0x3b')](_0x5a5857[_0xc901('0x42')],function(_0x2f9b41){var _0x1fffe3={};_0x1fffe3[_0x2f9b41]={'$like':'%'+_0x602bce['query'][_0xc901('0x4c')]+'%'};return _0x1fffe3;})});}_0x5a5857=_[_0xc901('0x4d')]({},_0x5a5857,_0x602bce[_0xc901('0x50')]);return _0x4eafb1[_0xc901('0xae')](_0x5a5857);}})[_0xc901('0x1d')](function(_0x46fec6){if(_0x46fec6){_0x7d0523=_0x46fec6['length'];if(!_0x602bce[_0xc901('0x3f')][_0xc901('0x45')](_0xc901('0x46'))){_0x5a5857[_0xc901('0x2d')]=qs[_0xc901('0x2d')](_0x602bce['query'][_0xc901('0x2d')]);_0x5a5857['offset']=qs[_0xc901('0x2c')](_0x602bce[_0xc901('0x3f')][_0xc901('0x2c')]);}return _0x4eafb1[_0xc901('0xae')](_0x5a5857);}})[_0xc901('0x1d')](function(_0x457ea1){if(_0x457ea1){return _0x457ea1?{'count':_0x7d0523,'rows':_0x457ea1}:null;}})[_0xc901('0x1d')](respondWithResult(_0x248e68,null))[_0xc901('0x28')](handleError(_0x248e68,null));};exports[_0xc901('0x37')]=function(_0x48b2aa,_0x37b192,_0x560abc){var _0x5b6823,_0x4400ef,_0x1eca58;if(_[_0xc901('0x75')](_0x48b2aa[_0xc901('0x5d')]['body'])||_0x48b2aa[_0xc901('0x5d')]['body']===''){throw new db['Sequelize'][(_0xc901('0x6d'))](_0xc901('0x76'));}if(_['isNil'](_0x48b2aa[_0xc901('0x5d')]['to'])){}_0x5b6823=_0x48b2aa['body']['to'];return db[_0xc901('0x3c')][_0xc901('0x61')]({'where':{'id':_0x48b2aa[_0xc901('0x55')]['id']}})[_0xc901('0x1d')](handleEntityNotFound(_0x37b192,null))[_0xc901('0x1d')](function(_0x3f4378){if(_0x3f4378){return db[_0xc901('0x3c')][_0xc901('0x56')]({'where':{'id':_0x3f4378['id']},'include':[{'model':db[_0xc901('0x7a')],'as':_0xc901('0x80'),'include':[{'model':db[_0xc901('0x6c')],'as':'Contacts','where':{[_0x3f4378['mapKey']]:_0x5b6823},'limit':0x1,'order':[[_0xc901('0x71'),_0xc901('0xaf')]]}]}]})['then'](handleEntityNotFound(_0x37b192,null))['then'](function(_0x290218){if(_0x290218&&_0x290218[_0xc901('0x80')]){_0x4400ef=_0x290218[_0xc901('0x33')]({'plain':!![]});if(_0x4400ef['List']&&_0x4400ef['List']['Contacts']['length']){return _0x4400ef[_0xc901('0x80')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0xc901('0x17')](_0x48b2aa[_0xc901('0x5d')],{'firstName':_0x5b6823,[_0x290218[_0xc901('0x77')]]:_0x5b6823,'phone':_0x5b6823,'ListId':_0x4400ef[_0xc901('0xb0')]}));}})['then'](handleEntityNotFound(_0x37b192,null))['then'](function(_0x251ac6){if(_0x251ac6){_0x1eca58=_0x251ac6;return db[_0xc901('0x86')]['find']({'where':{'ContactId':_0x1eca58['id'],'closed':![],'OpenchannelAccountId':_0x4400ef['id']}})['then'](function(_0x659752){if(_0x659752){return[_0x659752,![]];}return db['OpenchannelInteraction'][_0xc901('0x57')]({'UserId':_0x48b2aa['user']['id'],'ContactId':_0x1eca58['id'],'OpenchannelAccountId':_0x4400ef['id'],'lastMsgDirection':_0xc901('0xb1'),'Messages':[_[_0xc901('0x4d')](_0x48b2aa['body'],{'read':![],'body':_0x48b2aa[_0xc901('0x5d')][_0xc901('0x5d')],'OpenchannelAccountId':_0x4400ef['id'],'UserId':_0x48b2aa['user']['id'],'ContactId':_0x1eca58['id']})]},{'include':[{'model':db[_0xc901('0x93')],'as':_0xc901('0xb2')}]})[_0xc901('0x1d')](function(_0x3be65c){return[_0x3be65c,!![]];});});}})[_0xc901('0x89')](function(_0x32d7a7,_0x5dd1c4){if(_0x5dd1c4){return _0x32d7a7;}return db[_0xc901('0x93')][_0xc901('0x57')](_['merge'](_0x48b2aa[_0xc901('0x5d')],{'read':![],'body':_0x48b2aa[_0xc901('0x5d')]['body'],'OpenchannelAccountId':_0x4400ef['id'],'OpenchannelInteractionId':_0x32d7a7['id'],'UserId':_0x48b2aa[_0xc901('0xb3')]['id'],'ContactId':_0x1eca58['id']}))['then'](function(_0xb167e3){_0x32d7a7[_0xc901('0xb4')]['Messages']=[];_0x32d7a7[_0xc901('0xb4')][_0xc901('0xb2')][_0xc901('0x90')](_0xb167e3[_0xc901('0xb4')]);return _0x32d7a7;});});}})[_0xc901('0x1d')](respondWithResult(_0x37b192,null))[_0xc901('0x28')](handleError(_0x37b192,null));};
\ No newline at end of file
index 6cddc0a..b234efa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x1f0724,_0x3a58bf){var _0x253ffb=function(_0x3b4c72){while(--_0x3b4c72){_0x1f0724['push'](_0x1f0724['shift']());}};_0x253ffb(++_0x3a58bf);}(_0x668b,0x140));var _0xb668=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x668b[_0x17406e];return _0x2bfc5a;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x1be1=['OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0xbd80e7,_0x26022a){var _0x216a04=function(_0x54460d){while(--_0x54460d){_0xbd80e7['push'](_0xbd80e7['shift']());}};_0x216a04(++_0x26022a);}(_0x1be1,0x192));var _0x11be=function(_0x5032cb,_0x1dfadf){_0x5032cb=_0x5032cb-0x0;var _0x4e3ad0=_0x1be1[_0x5032cb];return _0x4e3ad0;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x11be('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x11be('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x11be('0x2'),'afterDestroy':_0x11be('0x3')};function emitEvent(_0x200b2a){return function(_0x318d41,_0x504d3a,_0x3ce56d){OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a+':'+_0x318d41['id'],_0x318d41);OpenchannelAccountEvents[_0x11be('0x4')](_0x200b2a,_0x318d41);_0x3ce56d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x11be('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
index e546192..f9c8797 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(_0x522162,_0x25cef5){var _0x393446=function(_0x582225){while(--_0x582225){_0x522162['push'](_0x522162['shift']());}};_0x393446(++_0x25cef5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1705cc,_0x39f742){var _0x3b1532=function(_0x6ac78){while(--_0x6ac78){_0x1705cc['push'](_0x1705cc['shift']());}};_0x3b1532(++_0x39f742);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 4422997..eec76e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7980=['OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','./openchannelAccount.socket','register','request','then','info'];(function(_0x17ccad,_0x145a45){var _0x26dc25=function(_0x4153b0){while(--_0x4153b0){_0x17ccad['push'](_0x17ccad['shift']());}};_0x26dc25(++_0x145a45);}(_0x7980,0xab));var _0x0798=function(_0xb4e583,_0x44dd1e){_0xb4e583=_0xb4e583-0x0;var _0x5393b0=_0x7980[_0xb4e583];return _0x5393b0;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});config[_0x0798('0xb')]=_[_0x0798('0xc')](config[_0x0798('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0798('0xb')]));require(_0x0798('0xd'))[_0x0798('0xe')](socket);function respondWithRpcPromise(_0x1601f2,_0x53e9a1,_0x181c33){return new BPromise(function(_0x44e8df,_0xc9b741){return client[_0x0798('0xf')](_0x1601f2,_0x181c33)[_0x0798('0x10')](function(_0x597e45){logger[_0x0798('0x11')](_0x0798('0x12'),_0x53e9a1,'request\x20sent');logger['debug'](_0x0798('0x13'),_0x53e9a1,_0x0798('0x14'),JSON[_0x0798('0x15')](_0x597e45));if(_0x597e45[_0x0798('0x16')]){if(_0x597e45[_0x0798('0x16')][_0x0798('0x17')]===0x1f4){logger[_0x0798('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x53e9a1,_0x597e45['error'][_0x0798('0x18')]);return _0xc9b741(_0x597e45[_0x0798('0x16')]['message']);}logger['error'](_0x0798('0x12'),_0x53e9a1,_0x597e45[_0x0798('0x16')][_0x0798('0x18')]);return _0x44e8df(_0x597e45['error']['message']);}else{logger[_0x0798('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x53e9a1,_0x0798('0x14'));_0x44e8df(_0x597e45[_0x0798('0x19')][_0x0798('0x18')]);}})[_0x0798('0x1a')](function(_0x4d1545){logger[_0x0798('0x16')](_0x0798('0x12'),_0x53e9a1,_0x4d1545);_0xc9b741(_0x4d1545);});});}
\ No newline at end of file
+var _0xeffd=['redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xeffd,0x6b));var _0xdeff=function(_0x3900e2,_0x48b331){_0x3900e2=_0x3900e2-0x0;var _0x5f3986=_0xeffd[_0x3900e2];return _0x5f3986;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});config[_0xdeff('0xd')]=_[_0xdeff('0xe')](config[_0xdeff('0xd')],{'host':_0xdeff('0xf'),'port':0x18eb});var socket=require(_0xdeff('0x10'))(new Redis(config['redis']));require(_0xdeff('0x11'))[_0xdeff('0x12')](socket);function respondWithRpcPromise(_0xf6d58d,_0x51fcb7,_0x1ff265){return new BPromise(function(_0x4423e9,_0x3c1482){return client[_0xdeff('0x13')](_0xf6d58d,_0x1ff265)[_0xdeff('0x14')](function(_0x256b73){logger[_0xdeff('0x15')](_0xdeff('0x16'),_0x51fcb7,'request\x20sent');logger[_0xdeff('0x17')](_0xdeff('0x18'),_0x51fcb7,'request\x20sent',JSON[_0xdeff('0x19')](_0x256b73));if(_0x256b73['error']){if(_0x256b73['error'][_0xdeff('0x1a')]===0x1f4){logger[_0xdeff('0x1b')](_0xdeff('0x16'),_0x51fcb7,_0x256b73[_0xdeff('0x1b')]['message']);return _0x3c1482(_0x256b73[_0xdeff('0x1b')][_0xdeff('0x1c')]);}logger[_0xdeff('0x1b')](_0xdeff('0x16'),_0x51fcb7,_0x256b73[_0xdeff('0x1b')][_0xdeff('0x1c')]);return _0x4423e9(_0x256b73['error']['message']);}else{logger[_0xdeff('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x51fcb7,'request\x20sent');_0x4423e9(_0x256b73[_0xdeff('0x1d')][_0xdeff('0x1c')]);}})['catch'](function(_0x2de203){logger[_0xdeff('0x1b')](_0xdeff('0x16'),_0x51fcb7,_0x2de203);_0x3c1482(_0x2de203);});});}
\ No newline at end of file
index 7c3749f..5b1bc25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eaa=['emit','removeListener','register','./openchannelAccount.events','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x3e01c8,_0x30ec78){_0x3e01c8=_0x3e01c8-0x0;var _0x2a6804=_0x0eaa[_0x3e01c8];return _0x2a6804;};'use strict';var OpenchannelAccountEvents=require(_0xa0ea('0x0'));var events=[_0xa0ea('0x1'),'remove','update'];function createListener(_0x17efb8,_0x1fe195){return function(_0x5800e9){_0x1fe195[_0xa0ea('0x2')](_0x17efb8,_0x5800e9);};}function removeListener(_0x1c74b8,_0x30dd52){return function(){OpenchannelAccountEvents[_0xa0ea('0x3')](_0x1c74b8,_0x30dd52);};}exports[_0xa0ea('0x4')]=function(_0x5636ed){for(var _0x3c6586=0x0,_0x521881=events['length'];_0x3c6586<_0x521881;_0x3c6586++){var _0x361178=events[_0x3c6586];var _0x8632a1=createListener('openchannelAccount:'+_0x361178,_0x5636ed);OpenchannelAccountEvents['on'](_0x361178,_0x8632a1);}};
\ No newline at end of file
+var _0x3715=['removeListener','register','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit'];(function(_0x959a2d,_0x1685de){var _0x1b5d0e=function(_0x588de9){while(--_0x588de9){_0x959a2d['push'](_0x959a2d['shift']());}};_0x1b5d0e(++_0x1685de);}(_0x3715,0xc3));var _0x5371=function(_0xa1d719,_0x5a6598){_0xa1d719=_0xa1d719-0x0;var _0x6329c3=_0x3715[_0xa1d719];return _0x6329c3;};'use strict';var OpenchannelAccountEvents=require(_0x5371('0x0'));var events=[_0x5371('0x1'),_0x5371('0x2'),_0x5371('0x3')];function createListener(_0x7304fb,_0x2f9a2c){return function(_0x132ef3){_0x2f9a2c[_0x5371('0x4')](_0x7304fb,_0x132ef3);};}function removeListener(_0x3ff067,_0x355d6a){return function(){OpenchannelAccountEvents[_0x5371('0x5')](_0x3ff067,_0x355d6a);};}exports[_0x5371('0x6')]=function(_0x50a759){for(var _0x1ffdcb=0x0,_0x340e44=events['length'];_0x1ffdcb<_0x340e44;_0x1ffdcb++){var _0x426a2a=events[_0x1ffdcb];var _0x16c64a=createListener(_0x5371('0x7')+_0x426a2a,_0x50a759);OpenchannelAccountEvents['on'](_0x426a2a,_0x16c64a);}};
\ No newline at end of file
index 8c8ee94..6cc9c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x125c=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x47c038,_0x1f7096){var _0x1e0f88=function(_0x6dd838){while(--_0x6dd838){_0x47c038['push'](_0x47c038['shift']());}};_0x1e0f88(++_0x1f7096);}(_0x125c,0x9e));var _0xc125=function(_0x24a890,_0xa4e24b){_0x24a890=_0x24a890-0x0;var _0xb4e8a0=_0x125c[_0x24a890];return _0xb4e8a0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc125('0x0'));var timeout=require(_0xc125('0x1'));var express=require(_0xc125('0x2'));var router=express[_0xc125('0x3')]();var fs_extra=require(_0xc125('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc125('0x5'));var config=require(_0xc125('0x6'));var controller=require(_0xc125('0x7'));router[_0xc125('0x8')]('/',auth[_0xc125('0x9')](),controller[_0xc125('0xa')]);router[_0xc125('0x8')](_0xc125('0xb'),auth[_0xc125('0x9')](),controller[_0xc125('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc125('0xd')](_0xc125('0xb'),auth[_0xc125('0x9')](),controller[_0xc125('0xe')]);router[_0xc125('0xf')](_0xc125('0xb'),auth['isAuthenticated'](),controller[_0xc125('0x10')]);module[_0xc125('0x11')]=router;
\ No newline at end of file
+var _0x84ba=['../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3df1f3,_0x2d6859){var _0x593b6e=function(_0x12f5ef){while(--_0x12f5ef){_0x3df1f3['push'](_0x3df1f3['shift']());}};_0x593b6e(++_0x2d6859);}(_0x84ba,0x162));var _0xa84b=function(_0x5c2d24,_0x3e324f){_0x5c2d24=_0x5c2d24-0x0;var _0xd0c701=_0x84ba[_0x5c2d24];return _0xd0c701;};'use strict';var multer=require('multer');var util=require(_0xa84b('0x0'));var path=require(_0xa84b('0x1'));var timeout=require('connect-timeout');var express=require(_0xa84b('0x2'));var router=express[_0xa84b('0x3')]();var fs_extra=require(_0xa84b('0x4'));var auth=require(_0xa84b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa84b('0x6'));var controller=require(_0xa84b('0x7'));router[_0xa84b('0x8')]('/',auth[_0xa84b('0x9')](),controller['index']);router[_0xa84b('0x8')](_0xa84b('0xa'),auth[_0xa84b('0x9')](),controller[_0xa84b('0xb')]);router[_0xa84b('0xc')]('/',auth[_0xa84b('0x9')](),controller[_0xa84b('0xd')]);router[_0xa84b('0xe')]('/:id',auth[_0xa84b('0x9')](),controller[_0xa84b('0xf')]);router[_0xa84b('0x10')](_0xa84b('0xa'),auth['isAuthenticated'](),controller[_0xa84b('0x11')]);module['exports']=router;
\ No newline at end of file
index cbd0054..2ec5d8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3165=['sequelize','STRING','noop','*,*,*,*'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3165,0xf4));var _0x5316=function(_0x28f158,_0x4a6347){_0x28f158=_0x28f158-0x0;var _0x17af55=_0x3165[_0x28f158];return _0x17af55;};'use strict';var Sequelize=require(_0x5316('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5316('0x1')],'allowNull':![],'defaultValue':_0x5316('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5316('0x1')]},'interval':{'type':Sequelize[_0x5316('0x1')],'defaultValue':_0x5316('0x3')}};
\ No newline at end of file
+var _0x7d5f=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x1549c1,_0xeb4f1a){var _0x23434e=function(_0xac4e01){while(--_0xac4e01){_0x1549c1['push'](_0x1549c1['shift']());}};_0x23434e(++_0xeb4f1a);}(_0x7d5f,0x1b5));var _0xf7d5=function(_0x56b499,_0x12b187){_0x56b499=_0x56b499-0x0;var _0xbfc95=_0x7d5f[_0x56b499];return _0xbfc95;};'use strict';var Sequelize=require('sequelize');module[_0xf7d5('0x0')]={'priority':{'type':Sequelize[_0xf7d5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf7d5('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf7d5('0x3')]()},'description':{'type':Sequelize[_0xf7d5('0x2')]},'interval':{'type':Sequelize[_0xf7d5('0x2')],'defaultValue':_0xf7d5('0x4')}};
\ No newline at end of file
index 257e52c..c1cdcf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd2b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','catch','create','body','update','destroy','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x45af79,_0x480fe3){var _0x301161=function(_0x10ef27){while(--_0x10ef27){_0x45af79['push'](_0x45af79['shift']());}};_0x301161(++_0x480fe3);}(_0xfd2b,0x12c));var _0xbfd2=function(_0x48d79d,_0x505a3a){_0x48d79d=_0x48d79d-0x0;var _0x501e86=_0xfd2b[_0x48d79d];return _0x501e86;};'use strict';var emlformat=require(_0xbfd2('0x0'));var rimraf=require(_0xbfd2('0x1'));var zipdir=require(_0xbfd2('0x2'));var jsonpatch=require(_0xbfd2('0x3'));var rp=require('request-promise');var moment=require(_0xbfd2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbfd2('0x5'));var util=require('util');var path=require(_0xbfd2('0x6'));var sox=require(_0xbfd2('0x7'));var csv=require('to-csv');var ejs=require(_0xbfd2('0x8'));var fs=require('fs');var fs_extra=require(_0xbfd2('0x9'));var _=require(_0xbfd2('0xa'));var squel=require(_0xbfd2('0xb'));var crypto=require(_0xbfd2('0xc'));var jsforce=require(_0xbfd2('0xd'));var deskjs=require(_0xbfd2('0xe'));var toCsv=require(_0xbfd2('0xf'));var querystring=require(_0xbfd2('0x10'));var Papa=require(_0xbfd2('0x11'));var Redis=require(_0xbfd2('0x12'));var authService=require(_0xbfd2('0x13'));var qs=require(_0xbfd2('0x14'));var as=require(_0xbfd2('0x15'));var hardwareService=require(_0xbfd2('0x16'));var logger=require(_0xbfd2('0x17'))(_0xbfd2('0x18'));var utils=require(_0xbfd2('0x19'));var config=require(_0xbfd2('0x1a'));var licenseUtil=require(_0xbfd2('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12d8bb,_0x958106){_0x958106=_0x958106||0xcc;return function(_0x617121){if(_0x617121){return _0x12d8bb[_0xbfd2('0x1c')](_0x958106);}return _0x12d8bb['status'](_0x958106)[_0xbfd2('0x1d')]();};}function respondWithResult(_0x8e7790,_0x2ca0bd){_0x2ca0bd=_0x2ca0bd||0xc8;return function(_0x5abb53){if(_0x5abb53){return _0x8e7790[_0xbfd2('0x1e')](_0x2ca0bd)[_0xbfd2('0x1f')](_0x5abb53);}};}function respondWithFilteredResult(_0x111834,_0x332317){return function(_0x1b1812){if(_0x1b1812){var _0x545adf=typeof _0x332317[_0xbfd2('0x20')]==='undefined'&&typeof _0x332317[_0xbfd2('0x21')]===_0xbfd2('0x22');var _0x1c0cc7=_0x1b1812['count'];var _0x2448d5=_0x545adf?0x0:_0x332317[_0xbfd2('0x20')];var _0x1fa4a0=_0x545adf?_0x1b1812[_0xbfd2('0x23')]:_0x332317[_0xbfd2('0x20')]+_0x332317[_0xbfd2('0x21')];var _0xe60e7d;if(_0x1fa4a0>=_0x1c0cc7){_0x1fa4a0=_0x1c0cc7;_0xe60e7d=0xc8;}else{_0xe60e7d=0xce;}_0x111834[_0xbfd2('0x1e')](_0xe60e7d);return _0x111834['set'](_0xbfd2('0x24'),_0x2448d5+'-'+_0x1fa4a0+'/'+_0x1c0cc7)[_0xbfd2('0x1f')](_0x1b1812);}return null;};}function patchUpdates(_0x4d409a){return function(_0x5c00b2){try{jsonpatch[_0xbfd2('0x25')](_0x5c00b2,_0x4d409a,!![]);}catch(_0x238af5){return BPromise[_0xbfd2('0x26')](_0x238af5);}return _0x5c00b2[_0xbfd2('0x27')]();};}function saveUpdates(_0x5028a3,_0x23f1dc){return function(_0x2b2287){if(_0x2b2287){return _0x2b2287['update'](_0x5028a3)['then'](function(_0x22628c){return _0x22628c;});}return null;};}function removeEntity(_0x40b48a,_0x4da14d){return function(_0xe6dea7){if(_0xe6dea7){return _0xe6dea7['destroy']()[_0xbfd2('0x28')](function(){_0x40b48a[_0xbfd2('0x1e')](0xcc)[_0xbfd2('0x1d')]();});}};}function handleEntityNotFound(_0x4c3551,_0x4601ff){return function(_0x4d612c){if(!_0x4d612c){_0x4c3551[_0xbfd2('0x1c')](0x194);}return _0x4d612c;};}function handleError(_0x4085a6,_0x532414){_0x532414=_0x532414||0x1f4;return function(_0x3f2008){logger[_0xbfd2('0x29')](_0x3f2008[_0xbfd2('0x2a')]);if(_0x3f2008[_0xbfd2('0x2b')]){delete _0x3f2008[_0xbfd2('0x2b')];}_0x4085a6[_0xbfd2('0x1e')](_0x532414)[_0xbfd2('0x2c')](_0x3f2008);};}exports[_0xbfd2('0x2d')]=function(_0x4bd5db,_0xe1a9a3){var _0x8c0ef0={},_0x39f34d={},_0x484230={'count':0x0,'rows':[]};var _0x41d22f=_[_0xbfd2('0x2e')](db[_0xbfd2('0x2f')][_0xbfd2('0x30')],function(_0x30c483){return{'name':_0x30c483['fieldName'],'type':_0x30c483['type'][_0xbfd2('0x31')]};});_0x39f34d[_0xbfd2('0x32')]=_[_0xbfd2('0x2e')](_0x41d22f,_0xbfd2('0x2b'));_0x39f34d[_0xbfd2('0x33')]=_[_0xbfd2('0x34')](_0x4bd5db[_0xbfd2('0x33')]);_0x39f34d[_0xbfd2('0x35')]=_[_0xbfd2('0x36')](_0x39f34d[_0xbfd2('0x32')],_0x39f34d['query']);_0x8c0ef0[_0xbfd2('0x37')]=_[_0xbfd2('0x36')](_0x39f34d[_0xbfd2('0x32')],qs[_0xbfd2('0x38')](_0x4bd5db[_0xbfd2('0x33')][_0xbfd2('0x38')]));_0x8c0ef0[_0xbfd2('0x37')]=_0x8c0ef0['attributes']['length']?_0x8c0ef0[_0xbfd2('0x37')]:_0x39f34d['model'];if(!_0x4bd5db[_0xbfd2('0x33')][_0xbfd2('0x39')](_0xbfd2('0x3a'))){_0x8c0ef0[_0xbfd2('0x21')]=qs[_0xbfd2('0x21')](_0x4bd5db[_0xbfd2('0x33')][_0xbfd2('0x21')]);_0x8c0ef0[_0xbfd2('0x20')]=qs[_0xbfd2('0x20')](_0x4bd5db[_0xbfd2('0x33')][_0xbfd2('0x20')]);}_0x8c0ef0[_0xbfd2('0x3b')]=qs['sort'](_0x4bd5db[_0xbfd2('0x33')][_0xbfd2('0x3c')]);_0x8c0ef0['where']=qs[_0xbfd2('0x35')](_[_0xbfd2('0x3d')](_0x4bd5db[_0xbfd2('0x33')],_0x39f34d[_0xbfd2('0x35')]),_0x41d22f);if(_0x4bd5db['query']['filter']){_0x8c0ef0[_0xbfd2('0x3e')]=_[_0xbfd2('0x3f')](_0x8c0ef0[_0xbfd2('0x3e')],{'$or':_[_0xbfd2('0x2e')](_0x41d22f,function(_0x3ab9d0){if(_0x3ab9d0[_0xbfd2('0x40')]!==_0xbfd2('0x41')){var _0x16d742={};_0x16d742[_0x3ab9d0['name']]={'$like':'%'+_0x4bd5db[_0xbfd2('0x33')]['filter']+'%'};return _0x16d742;}})});}_0x8c0ef0=_[_0xbfd2('0x3f')]({},_0x8c0ef0,_0x4bd5db[_0xbfd2('0x42')]);var _0x331bc7={'where':_0x8c0ef0[_0xbfd2('0x3e')]};return db[_0xbfd2('0x2f')][_0xbfd2('0x23')](_0x331bc7)[_0xbfd2('0x28')](function(_0x11e2cd){_0x484230[_0xbfd2('0x23')]=_0x11e2cd;if(_0x4bd5db[_0xbfd2('0x33')][_0xbfd2('0x43')]){_0x8c0ef0[_0xbfd2('0x44')]=[{'all':!![]}];}return db[_0xbfd2('0x2f')][_0xbfd2('0x45')](_0x8c0ef0);})[_0xbfd2('0x28')](function(_0x140925){_0x484230[_0xbfd2('0x46')]=_0x140925;return _0x484230;})[_0xbfd2('0x28')](respondWithFilteredResult(_0xe1a9a3,_0x8c0ef0))['catch'](handleError(_0xe1a9a3,null));};exports[_0xbfd2('0x47')]=function(_0x3b47fd,_0x272016){var _0x4c3de4={'raw':!![],'where':{'id':_0x3b47fd['params']['id']}},_0xaae7f7={};_0xaae7f7[_0xbfd2('0x32')]=_[_0xbfd2('0x34')](db[_0xbfd2('0x2f')]['rawAttributes']);_0xaae7f7[_0xbfd2('0x33')]=_[_0xbfd2('0x34')](_0x3b47fd[_0xbfd2('0x33')]);_0xaae7f7[_0xbfd2('0x35')]=_[_0xbfd2('0x36')](_0xaae7f7[_0xbfd2('0x32')],_0xaae7f7[_0xbfd2('0x33')]);_0x4c3de4['attributes']=_['intersection'](_0xaae7f7['model'],qs[_0xbfd2('0x38')](_0x3b47fd[_0xbfd2('0x33')]['fields']));_0x4c3de4[_0xbfd2('0x37')]=_0x4c3de4[_0xbfd2('0x37')]['length']?_0x4c3de4[_0xbfd2('0x37')]:_0xaae7f7[_0xbfd2('0x32')];if(_0x3b47fd[_0xbfd2('0x33')][_0xbfd2('0x43')]){_0x4c3de4[_0xbfd2('0x44')]=[{'all':!![]}];}_0x4c3de4=_['merge']({},_0x4c3de4,_0x3b47fd[_0xbfd2('0x42')]);return db[_0xbfd2('0x2f')]['find'](_0x4c3de4)[_0xbfd2('0x28')](handleEntityNotFound(_0x272016,null))[_0xbfd2('0x28')](respondWithResult(_0x272016,null))[_0xbfd2('0x48')](handleError(_0x272016,null));};exports[_0xbfd2('0x49')]=function(_0x5d7775,_0x512c76){return db[_0xbfd2('0x2f')][_0xbfd2('0x49')](_0x5d7775[_0xbfd2('0x4a')],{})[_0xbfd2('0x28')](respondWithResult(_0x512c76,0xc9))['catch'](handleError(_0x512c76,null));};exports[_0xbfd2('0x4b')]=function(_0x45b2f2,_0x3c7cc6){if(_0x45b2f2[_0xbfd2('0x4a')]['id']){delete _0x45b2f2[_0xbfd2('0x4a')]['id'];}return db[_0xbfd2('0x2f')]['find']({'where':{'id':_0x45b2f2['params']['id']}})[_0xbfd2('0x28')](handleEntityNotFound(_0x3c7cc6,null))[_0xbfd2('0x28')](saveUpdates(_0x45b2f2[_0xbfd2('0x4a')],null))[_0xbfd2('0x28')](respondWithResult(_0x3c7cc6,null))[_0xbfd2('0x48')](handleError(_0x3c7cc6,null));};exports[_0xbfd2('0x4c')]=function(_0x2b81e8,_0x3a402e){return db[_0xbfd2('0x2f')][_0xbfd2('0x4d')]({'where':{'id':_0x2b81e8[_0xbfd2('0x4e')]['id']}})[_0xbfd2('0x28')](handleEntityNotFound(_0x3a402e,null))[_0xbfd2('0x28')](removeEntity(_0x3a402e,null))[_0xbfd2('0x48')](handleError(_0x3a402e,null));};
\ No newline at end of file
+var _0x734c=['filter','merge','VIRTUAL','includeAll','catch','params','keys','include','options','find','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','error','stack','name','send','OpenchannelApplication','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1eaf5e,_0x333d16){var _0x409fa2=function(_0x57f633){while(--_0x57f633){_0x1eaf5e['push'](_0x1eaf5e['shift']());}};_0x409fa2(++_0x333d16);}(_0x734c,0xe8));var _0xc734=function(_0x16b71e,_0x20353d){_0x16b71e=_0x16b71e-0x0;var _0x298c74=_0x734c[_0x16b71e];return _0x298c74;};'use strict';var emlformat=require(_0xc734('0x0'));var rimraf=require(_0xc734('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc734('0x2'));var rp=require('request-promise');var moment=require(_0xc734('0x3'));var BPromise=require(_0xc734('0x4'));var Mustache=require(_0xc734('0x5'));var util=require(_0xc734('0x6'));var path=require(_0xc734('0x7'));var sox=require(_0xc734('0x8'));var csv=require(_0xc734('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc734('0xa'));var _=require(_0xc734('0xb'));var squel=require(_0xc734('0xc'));var crypto=require(_0xc734('0xd'));var jsforce=require(_0xc734('0xe'));var deskjs=require(_0xc734('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc734('0x10'));var Papa=require(_0xc734('0x11'));var Redis=require(_0xc734('0x12'));var authService=require(_0xc734('0x13'));var qs=require(_0xc734('0x14'));var as=require(_0xc734('0x15'));var hardwareService=require(_0xc734('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xc734('0x17'));var config=require(_0xc734('0x18'));var licenseUtil=require(_0xc734('0x19'));var db=require(_0xc734('0x1a'))['db'];function respondWithStatusCode(_0x2147d9,_0x132ece){_0x132ece=_0x132ece||0xcc;return function(_0x72e574){if(_0x72e574){return _0x2147d9[_0xc734('0x1b')](_0x132ece);}return _0x2147d9[_0xc734('0x1c')](_0x132ece)[_0xc734('0x1d')]();};}function respondWithResult(_0x56c0ea,_0x104da9){_0x104da9=_0x104da9||0xc8;return function(_0x3dfa22){if(_0x3dfa22){return _0x56c0ea[_0xc734('0x1c')](_0x104da9)['json'](_0x3dfa22);}};}function respondWithFilteredResult(_0x322c67,_0x13266){return function(_0x372ae1){if(_0x372ae1){var _0xecf4cc=typeof _0x13266['offset']===_0xc734('0x1e')&&typeof _0x13266[_0xc734('0x1f')]==='undefined';var _0x25d372=_0x372ae1[_0xc734('0x20')];var _0x5f54a0=_0xecf4cc?0x0:_0x13266[_0xc734('0x21')];var _0x1f689=_0xecf4cc?_0x372ae1[_0xc734('0x20')]:_0x13266[_0xc734('0x21')]+_0x13266[_0xc734('0x1f')];var _0x24ef96;if(_0x1f689>=_0x25d372){_0x1f689=_0x25d372;_0x24ef96=0xc8;}else{_0x24ef96=0xce;}_0x322c67[_0xc734('0x1c')](_0x24ef96);return _0x322c67['set']('Content-Range',_0x5f54a0+'-'+_0x1f689+'/'+_0x25d372)[_0xc734('0x22')](_0x372ae1);}return null;};}function patchUpdates(_0x5ed84f){return function(_0x16568b){try{jsonpatch[_0xc734('0x23')](_0x16568b,_0x5ed84f,!![]);}catch(_0x43a49e){return BPromise[_0xc734('0x24')](_0x43a49e);}return _0x16568b[_0xc734('0x25')]();};}function saveUpdates(_0x465141,_0x2d4546){return function(_0x2ed856){if(_0x2ed856){return _0x2ed856[_0xc734('0x26')](_0x465141)[_0xc734('0x27')](function(_0x93ef89){return _0x93ef89;});}return null;};}function removeEntity(_0x49445e,_0x5606c3){return function(_0x1735f6){if(_0x1735f6){return _0x1735f6['destroy']()[_0xc734('0x27')](function(){_0x49445e[_0xc734('0x1c')](0xcc)[_0xc734('0x1d')]();});}};}function handleEntityNotFound(_0x493253,_0x56c9b7){return function(_0x385173){if(!_0x385173){_0x493253[_0xc734('0x1b')](0x194);}return _0x385173;};}function handleError(_0x329248,_0x1b3a91){_0x1b3a91=_0x1b3a91||0x1f4;return function(_0x2e0801){logger[_0xc734('0x28')](_0x2e0801[_0xc734('0x29')]);if(_0x2e0801[_0xc734('0x2a')]){delete _0x2e0801[_0xc734('0x2a')];}_0x329248['status'](_0x1b3a91)[_0xc734('0x2b')](_0x2e0801);};}exports['index']=function(_0x15edd0,_0x381a5d){var _0x45d06f={},_0x3e6adf={},_0x3a6402={'count':0x0,'rows':[]};var _0x1d99ec=_['map'](db[_0xc734('0x2c')][_0xc734('0x2d')],function(_0x418245){return{'name':_0x418245['fieldName'],'type':_0x418245[_0xc734('0x2e')]['key']};});_0x3e6adf[_0xc734('0x2f')]=_['map'](_0x1d99ec,_0xc734('0x2a'));_0x3e6adf[_0xc734('0x30')]=_['keys'](_0x15edd0['query']);_0x3e6adf[_0xc734('0x31')]=_['intersection'](_0x3e6adf[_0xc734('0x2f')],_0x3e6adf[_0xc734('0x30')]);_0x45d06f[_0xc734('0x32')]=_[_0xc734('0x33')](_0x3e6adf[_0xc734('0x2f')],qs[_0xc734('0x34')](_0x15edd0[_0xc734('0x30')][_0xc734('0x34')]));_0x45d06f['attributes']=_0x45d06f['attributes'][_0xc734('0x35')]?_0x45d06f[_0xc734('0x32')]:_0x3e6adf[_0xc734('0x2f')];if(!_0x15edd0[_0xc734('0x30')][_0xc734('0x36')](_0xc734('0x37'))){_0x45d06f[_0xc734('0x1f')]=qs['limit'](_0x15edd0[_0xc734('0x30')][_0xc734('0x1f')]);_0x45d06f[_0xc734('0x21')]=qs[_0xc734('0x21')](_0x15edd0[_0xc734('0x30')][_0xc734('0x21')]);}_0x45d06f[_0xc734('0x38')]=qs[_0xc734('0x39')](_0x15edd0[_0xc734('0x30')][_0xc734('0x39')]);_0x45d06f[_0xc734('0x3a')]=qs['filters'](_[_0xc734('0x3b')](_0x15edd0[_0xc734('0x30')],_0x3e6adf[_0xc734('0x31')]),_0x1d99ec);if(_0x15edd0[_0xc734('0x30')][_0xc734('0x3c')]){_0x45d06f[_0xc734('0x3a')]=_[_0xc734('0x3d')](_0x45d06f['where'],{'$or':_['map'](_0x1d99ec,function(_0x5f0cb9){if(_0x5f0cb9[_0xc734('0x2e')]!==_0xc734('0x3e')){var _0x205fcf={};_0x205fcf[_0x5f0cb9[_0xc734('0x2a')]]={'$like':'%'+_0x15edd0['query']['filter']+'%'};return _0x205fcf;}})});}_0x45d06f=_[_0xc734('0x3d')]({},_0x45d06f,_0x15edd0['options']);var _0x20fc45={'where':_0x45d06f[_0xc734('0x3a')]};return db['OpenchannelApplication'][_0xc734('0x20')](_0x20fc45)[_0xc734('0x27')](function(_0x1d58ca){_0x3a6402[_0xc734('0x20')]=_0x1d58ca;if(_0x15edd0[_0xc734('0x30')][_0xc734('0x3f')]){_0x45d06f['include']=[{'all':!![]}];}return db[_0xc734('0x2c')]['findAll'](_0x45d06f);})[_0xc734('0x27')](function(_0x55af66){_0x3a6402['rows']=_0x55af66;return _0x3a6402;})[_0xc734('0x27')](respondWithFilteredResult(_0x381a5d,_0x45d06f))[_0xc734('0x40')](handleError(_0x381a5d,null));};exports['show']=function(_0x52d617,_0x2910b9){var _0x288201={'raw':!![],'where':{'id':_0x52d617[_0xc734('0x41')]['id']}},_0x335be3={};_0x335be3['model']=_[_0xc734('0x42')](db[_0xc734('0x2c')]['rawAttributes']);_0x335be3['query']=_[_0xc734('0x42')](_0x52d617[_0xc734('0x30')]);_0x335be3['filters']=_[_0xc734('0x33')](_0x335be3[_0xc734('0x2f')],_0x335be3['query']);_0x288201[_0xc734('0x32')]=_[_0xc734('0x33')](_0x335be3[_0xc734('0x2f')],qs['fields'](_0x52d617['query'][_0xc734('0x34')]));_0x288201[_0xc734('0x32')]=_0x288201[_0xc734('0x32')]['length']?_0x288201[_0xc734('0x32')]:_0x335be3[_0xc734('0x2f')];if(_0x52d617[_0xc734('0x30')][_0xc734('0x3f')]){_0x288201[_0xc734('0x43')]=[{'all':!![]}];}_0x288201=_[_0xc734('0x3d')]({},_0x288201,_0x52d617[_0xc734('0x44')]);return db[_0xc734('0x2c')][_0xc734('0x45')](_0x288201)[_0xc734('0x27')](handleEntityNotFound(_0x2910b9,null))['then'](respondWithResult(_0x2910b9,null))[_0xc734('0x40')](handleError(_0x2910b9,null));};exports[_0xc734('0x46')]=function(_0x23df53,_0x537062){return db[_0xc734('0x2c')][_0xc734('0x46')](_0x23df53[_0xc734('0x47')],{})['then'](respondWithResult(_0x537062,0xc9))[_0xc734('0x40')](handleError(_0x537062,null));};exports['update']=function(_0x3a0361,_0x23deef){if(_0x3a0361[_0xc734('0x47')]['id']){delete _0x3a0361[_0xc734('0x47')]['id'];}return db[_0xc734('0x2c')][_0xc734('0x45')]({'where':{'id':_0x3a0361['params']['id']}})['then'](handleEntityNotFound(_0x23deef,null))['then'](saveUpdates(_0x3a0361['body'],null))['then'](respondWithResult(_0x23deef,null))[_0xc734('0x40')](handleError(_0x23deef,null));};exports[_0xc734('0x48')]=function(_0x5f0f77,_0xe5d7ca){return db[_0xc734('0x2c')][_0xc734('0x45')]({'where':{'id':_0x5f0f77[_0xc734('0x41')]['id']}})[_0xc734('0x27')](handleEntityNotFound(_0xe5d7ca,null))[_0xc734('0x27')](removeEntity(_0xe5d7ca,null))[_0xc734('0x40')](handleError(_0xe5d7ca,null));};
\ No newline at end of file
index 4156a09..ff5a833 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c9a=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x241423,_0x1f3697){var _0x497ad7=function(_0x1f449c){while(--_0x1f449c){_0x241423['push'](_0x241423['shift']());}};_0x497ad7(++_0x1f3697);}(_0x9c9a,0x80));var _0xa9c9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9c9a[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xa9c9('0x0'));var util=require('util');var logger=require(_0xa9c9('0x1'))(_0xa9c9('0x2'));var moment=require(_0xa9c9('0x3'));var BPromise=require(_0xa9c9('0x4'));var rp=require(_0xa9c9('0x5'));var fs=require('fs');var path=require(_0xa9c9('0x6'));var rimraf=require('rimraf');var config=require(_0xa9c9('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0xa9c9('0x8')]=function(_0x17f0fe,_0x4a1e40){return _0x17f0fe[_0xa9c9('0x9')](_0xa9c9('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa9c9('0xb'),'collate':_0xa9c9('0xc')});};
\ No newline at end of file
+var _0x6dc4=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x6dc4,0x197));var _0x46dc=function(_0x3e02c5,_0x3c1007){_0x3e02c5=_0x3e02c5-0x0;var _0x4f64f5=_0x6dc4[_0x3e02c5];return _0x4f64f5;};'use strict';var _=require(_0x46dc('0x0'));var util=require(_0x46dc('0x1'));var logger=require(_0x46dc('0x2'))('api');var moment=require(_0x46dc('0x3'));var BPromise=require(_0x46dc('0x4'));var rp=require(_0x46dc('0x5'));var fs=require('fs');var path=require(_0x46dc('0x6'));var rimraf=require(_0x46dc('0x7'));var config=require(_0x46dc('0x8'));var attributes=require(_0x46dc('0x9'));module[_0x46dc('0xa')]=function(_0x4ee795,_0x47274e){return _0x4ee795[_0x46dc('0xb')](_0x46dc('0xc'),attributes,{'tableName':_0x46dc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46dc('0xe'),'collate':_0x46dc('0xf')});};
\ No newline at end of file
index 75387b8..4c5f695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4514=['OpenchannelApplication','update','body','options','raw','where','attributes','then','UpdateOpenchannelApplication','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','client','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4514,0x105));var _0x4451=function(_0x47a9a3,_0x4bf569){_0x47a9a3=_0x47a9a3-0x0;var _0x260976=_0x4514[_0x47a9a3];return _0x260976;};'use strict';var _=require(_0x4451('0x0'));var util=require(_0x4451('0x1'));var moment=require(_0x4451('0x2'));var BPromise=require(_0x4451('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4451('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4451('0x5'));var logger=require(_0x4451('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4451('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x299d9b,_0x2761e9,_0x25e05d){return new BPromise(function(_0x419b45,_0x5e6c3c){return client['request'](_0x299d9b,_0x25e05d)['then'](function(_0x21101a){logger[_0x4451('0x8')]('OpenchannelApplication,\x20%s,\x20%s',_0x2761e9,_0x4451('0x9'));logger[_0x4451('0xa')](_0x4451('0xb'),_0x2761e9,_0x4451('0x9'),JSON[_0x4451('0xc')](_0x21101a));if(_0x21101a[_0x4451('0xd')]){if(_0x21101a[_0x4451('0xd')][_0x4451('0xe')]===0x1f4){logger['error'](_0x4451('0xf'),_0x2761e9,_0x21101a[_0x4451('0xd')][_0x4451('0x10')]);return _0x5e6c3c(_0x21101a[_0x4451('0xd')]['message']);}logger[_0x4451('0xd')](_0x4451('0xf'),_0x2761e9,_0x21101a[_0x4451('0xd')][_0x4451('0x10')]);return _0x419b45(_0x21101a[_0x4451('0xd')][_0x4451('0x10')]);}else{logger['info'](_0x4451('0xf'),_0x2761e9,_0x4451('0x9'));_0x419b45(_0x21101a[_0x4451('0x11')][_0x4451('0x10')]);}})[_0x4451('0x12')](function(_0x315c87){logger['error'](_0x4451('0xf'),_0x2761e9,_0x315c87);_0x5e6c3c(_0x315c87);});});}exports['UpdateOpenchannelApplication']=function(_0x4d988b){var _0x42e745=this;return new Promise(function(_0x5993ce,_0x10d8a3){return db[_0x4451('0x13')][_0x4451('0x14')](_0x4d988b[_0x4451('0x15')],{'raw':_0x4d988b[_0x4451('0x16')]?_0x4d988b['options'][_0x4451('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d988b['options']?_0x4d988b[_0x4451('0x16')][_0x4451('0x18')]||null:null,'attributes':_0x4d988b[_0x4451('0x16')]?_0x4d988b[_0x4451('0x16')][_0x4451('0x19')]||null:null,'limit':_0x4d988b['options']?_0x4d988b[_0x4451('0x16')]['limit']||null:null})[_0x4451('0x1a')](function(_0x47e58e){logger[_0x4451('0x8')](_0x4451('0x1b'),_0x4d988b);logger[_0x4451('0xa')](_0x4451('0x1b'),_0x4d988b,JSON[_0x4451('0xc')](_0x47e58e));_0x5993ce(_0x47e58e);})['catch'](function(_0x184cdf){logger[_0x4451('0xd')](_0x4451('0x1b'),_0x184cdf[_0x4451('0x10')],_0x4d988b);_0x10d8a3(_0x42e745[_0x4451('0xd')](0x1f4,_0x184cdf[_0x4451('0x10')]));});});};
\ No newline at end of file
+var _0xff46=['body','options','attributes','limit','then','debug','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','OpenchannelApplication,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','update'];(function(_0x2f10e3,_0x5018fe){var _0x37264=function(_0x6e2ce1){while(--_0x6e2ce1){_0x2f10e3['push'](_0x2f10e3['shift']());}};_0x37264(++_0x5018fe);}(_0xff46,0xd6));var _0x6ff4=function(_0x41094d,_0x4ca21d){_0x41094d=_0x41094d-0x0;var _0x503ee1=_0xff46[_0x41094d];return _0x503ee1;};'use strict';var _=require(_0x6ff4('0x0'));var util=require(_0x6ff4('0x1'));var moment=require('moment');var BPromise=require(_0x6ff4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6ff4('0x3'));var logger=require(_0x6ff4('0x4'))(_0x6ff4('0x5'));var config=require('../../config/environment');var jayson=require(_0x6ff4('0x6'));var client=jayson[_0x6ff4('0x7')][_0x6ff4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f0827,_0x58548b,_0x465d65){return new BPromise(function(_0x4eceb4,_0x282028){return client['request'](_0x2f0827,_0x465d65)['then'](function(_0x1218dd){logger[_0x6ff4('0x9')](_0x6ff4('0xa'),_0x58548b,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x58548b,'request\x20sent',JSON[_0x6ff4('0xb')](_0x1218dd));if(_0x1218dd[_0x6ff4('0xc')]){if(_0x1218dd['error'][_0x6ff4('0xd')]===0x1f4){logger['error'](_0x6ff4('0xa'),_0x58548b,_0x1218dd[_0x6ff4('0xc')][_0x6ff4('0xe')]);return _0x282028(_0x1218dd['error'][_0x6ff4('0xe')]);}logger['error'](_0x6ff4('0xa'),_0x58548b,_0x1218dd[_0x6ff4('0xc')][_0x6ff4('0xe')]);return _0x4eceb4(_0x1218dd[_0x6ff4('0xc')][_0x6ff4('0xe')]);}else{logger[_0x6ff4('0x9')](_0x6ff4('0xa'),_0x58548b,_0x6ff4('0xf'));_0x4eceb4(_0x1218dd[_0x6ff4('0x10')][_0x6ff4('0xe')]);}})[_0x6ff4('0x11')](function(_0x592876){logger[_0x6ff4('0xc')](_0x6ff4('0xa'),_0x58548b,_0x592876);_0x282028(_0x592876);});});}exports[_0x6ff4('0x12')]=function(_0x495290){var _0x2ed3fa=this;return new Promise(function(_0x37a12a,_0x1e0c22){return db['OpenchannelApplication'][_0x6ff4('0x13')](_0x495290[_0x6ff4('0x14')],{'raw':_0x495290[_0x6ff4('0x15')]?_0x495290[_0x6ff4('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495290['options']?_0x495290[_0x6ff4('0x15')]['where']||null:null,'attributes':_0x495290['options']?_0x495290[_0x6ff4('0x15')][_0x6ff4('0x16')]||null:null,'limit':_0x495290[_0x6ff4('0x15')]?_0x495290[_0x6ff4('0x15')][_0x6ff4('0x17')]||null:null})[_0x6ff4('0x18')](function(_0xa9befd){logger[_0x6ff4('0x9')](_0x6ff4('0x12'),_0x495290);logger[_0x6ff4('0x19')](_0x6ff4('0x12'),_0x495290,JSON['stringify'](_0xa9befd));_0x37a12a(_0xa9befd);})[_0x6ff4('0x11')](function(_0x34b9cf){logger[_0x6ff4('0xc')](_0x6ff4('0x12'),_0x34b9cf['message'],_0x495290);_0x1e0c22(_0x2ed3fa[_0x6ff4('0xc')](0x1f4,_0x34b9cf['message']));});});};
\ No newline at end of file
index abdc41e..85c1553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb018=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','tracked','addTags','put','openchannelinteraction:update','update','delete','openchannel','destroy','/:id/tags','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb018,0x125));var _0x8b01=function(_0x2f8903,_0x4cdb83){_0x2f8903=_0x2f8903-0x0;var _0x42826a=_0xb018[_0x2f8903];return _0x42826a;};'use strict';var multer=require(_0x8b01('0x0'));var util=require('util');var path=require(_0x8b01('0x1'));var timeout=require(_0x8b01('0x2'));var express=require(_0x8b01('0x3'));var router=express['Router']();var fs_extra=require(_0x8b01('0x4'));var auth=require(_0x8b01('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b01('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x8b01('0x7')]('/',auth['isAuthenticated'](),controller[_0x8b01('0x8')]);router['get'](_0x8b01('0x9'),auth[_0x8b01('0xa')](),controller[_0x8b01('0xb')]);router[_0x8b01('0x7')](_0x8b01('0xc'),auth[_0x8b01('0xa')](),controller[_0x8b01('0xd')]);router['get'](_0x8b01('0xe'),auth[_0x8b01('0xa')](),controller[_0x8b01('0xf')]);router['get']('/:id/download',auth[_0x8b01('0xa')](),controller[_0x8b01('0x10')]);router[_0x8b01('0x11')]('/',auth[_0x8b01('0xa')](),controller[_0x8b01('0x12')]);router[_0x8b01('0x11')](_0x8b01('0xe'),auth[_0x8b01('0xa')](),controller[_0x8b01('0x13')]);router[_0x8b01('0x11')]('/:id/tags',auth[_0x8b01('0xa')](),interaction[_0x8b01('0x14')]('openchannel','openchannelinteraction:addtags'),controller[_0x8b01('0x15')]);router[_0x8b01('0x16')]('/:id',auth[_0x8b01('0xa')](),interaction[_0x8b01('0x14')]('openchannel',_0x8b01('0x17')),controller[_0x8b01('0x18')]);router[_0x8b01('0x19')](_0x8b01('0xc'),auth['isAuthenticated'](),interaction[_0x8b01('0x14')](_0x8b01('0x1a'),'openchannelinteraction:destroy'),controller[_0x8b01('0x1b')]);router['delete'](_0x8b01('0x1c'),auth['isAuthenticated'](),controller['removeTags']);module[_0x8b01('0x1d')]=router;
\ No newline at end of file
+var _0xacdd=['openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','openchannel','put','update'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0xacdd,0x18b));var _0xdacd=function(_0x2e1387,_0x2fd52a){_0x2e1387=_0x2e1387-0x0;var _0xda65a6=_0xacdd[_0x2e1387];return _0xda65a6;};'use strict';var multer=require(_0xdacd('0x0'));var util=require(_0xdacd('0x1'));var path=require(_0xdacd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xdacd('0x3'));var auth=require(_0xdacd('0x4'));var interaction=require(_0xdacd('0x5'));var config=require('../../config/environment');var controller=require(_0xdacd('0x6'));router[_0xdacd('0x7')]('/',auth[_0xdacd('0x8')](),controller['index']);router[_0xdacd('0x7')](_0xdacd('0x9'),auth[_0xdacd('0x8')](),controller[_0xdacd('0xa')]);router['get'](_0xdacd('0xb'),auth[_0xdacd('0x8')](),controller[_0xdacd('0xc')]);router[_0xdacd('0x7')](_0xdacd('0xd'),auth[_0xdacd('0x8')](),controller[_0xdacd('0xe')]);router['get'](_0xdacd('0xf'),auth[_0xdacd('0x8')](),controller[_0xdacd('0x10')]);router['post']('/',auth[_0xdacd('0x8')](),controller[_0xdacd('0x11')]);router[_0xdacd('0x12')]('/:id/messages',auth[_0xdacd('0x8')](),controller[_0xdacd('0x13')]);router[_0xdacd('0x12')](_0xdacd('0x14'),auth[_0xdacd('0x8')](),interaction[_0xdacd('0x15')](_0xdacd('0x16'),'openchannelinteraction:addtags'),controller['addTags']);router[_0xdacd('0x17')]('/:id',auth[_0xdacd('0x8')](),interaction[_0xdacd('0x15')](_0xdacd('0x16'),'openchannelinteraction:update'),controller[_0xdacd('0x18')]);router['delete'](_0xdacd('0xb'),auth[_0xdacd('0x8')](),interaction[_0xdacd('0x15')](_0xdacd('0x16'),_0xdacd('0x19')),controller[_0xdacd('0x1a')]);router[_0xdacd('0x1b')](_0xdacd('0x14'),auth[_0xdacd('0x8')](),controller[_0xdacd('0x1c')]);module[_0xdacd('0x1d')]=router;
\ No newline at end of file
index d9d79cb..c21268e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd1b=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2170e4,_0x5b969e){var _0xec86f5=function(_0x44e53e){while(--_0x44e53e){_0x2170e4['push'](_0x2170e4['shift']());}};_0xec86f5(++_0x5b969e);}(_0xdd1b,0x11f));var _0xbdd1=function(_0xc2c3c8,_0x3acde7){_0xc2c3c8=_0xc2c3c8-0x0;var _0x4aa805=_0xdd1b[_0xc2c3c8];return _0x4aa805;};'use strict';var Sequelize=require(_0xbdd1('0x0'));module[_0xbdd1('0x1')]={'closed':{'type':Sequelize[_0xbdd1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbdd1('0x3')]},'disposition':{'type':Sequelize[_0xbdd1('0x4')]},'secondDisposition':{'type':Sequelize[_0xbdd1('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbdd1('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xbdd1('0x4')]},'lastMsgAt':{'type':Sequelize[_0xbdd1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbdd1('0x5')]('in',_0xbdd1('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbdd1('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xbdd1('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xcb3c=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xcb3c,0x150));var _0xccb3=function(_0x28237e,_0x2a7f11){_0x28237e=_0x28237e-0x0;var _0x1c014b=_0xcb3c[_0x28237e];return _0x1c014b;};'use strict';var Sequelize=require(_0xccb3('0x0'));module[_0xccb3('0x1')]={'closed':{'type':Sequelize[_0xccb3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xccb3('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xccb3('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xccb3('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xccb3('0x4')]},'externalUrl':{'type':Sequelize[_0xccb3('0x4')]},'lastMsgAt':{'type':Sequelize[_0xccb3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xccb3('0x5')]('in',_0xccb3('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xccb3('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xccb3('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 8ea047f..423f4bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1048=['filters','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','having','`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)','i.from\x20LIKE\x20?','group','Sequelize','QueryTypes','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','merge','a.key','a.mandatoryDisposition','i.*','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','catch','params','rawAttributes','includeAll','include','options','create','body','describe','addMessage','omit','getMessages','findOne','OpenchannelMessage','filter','$gte','format','findAll','rows','addTags','setTags','ids','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','join','files','tmp','server','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','Messages','secret','Account','fullname','Openchannel','Owner','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','views','transcript-','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','Users','map','TagIds','Tags','split','forEach','push','index','OpenchannelInteraction','fieldName','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x5f02f7,_0x112ca2){var _0x4ed3d3=function(_0x19e6ab){while(--_0x19e6ab){_0x5f02f7['push'](_0x5f02f7['shift']());}};_0x4ed3d3(++_0x112ca2);}(_0x1048,0x195));var _0x8104=function(_0x577c79,_0x30a8d6){_0x577c79=_0x577c79-0x0;var _0x2f81b7=_0x1048[_0x577c79];return _0x2f81b7;};'use strict';var emlformat=require(_0x8104('0x0'));var rimraf=require(_0x8104('0x1'));var zipdir=require(_0x8104('0x2'));var jsonpatch=require(_0x8104('0x3'));var rp=require(_0x8104('0x4'));var moment=require(_0x8104('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8104('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8104('0x7'));var csv=require(_0x8104('0x8'));var ejs=require(_0x8104('0x9'));var fs=require('fs');var fs_extra=require(_0x8104('0xa'));var _=require(_0x8104('0xb'));var squel=require(_0x8104('0xc'));var crypto=require(_0x8104('0xd'));var jsforce=require(_0x8104('0xe'));var deskjs=require(_0x8104('0xf'));var toCsv=require(_0x8104('0x8'));var querystring=require('querystring');var Papa=require(_0x8104('0x10'));var Redis=require(_0x8104('0x11'));var authService=require(_0x8104('0x12'));var qs=require(_0x8104('0x13'));var as=require(_0x8104('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8104('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x8104('0x16'));var config=require(_0x8104('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8104('0x18')]=_['defaults'](config[_0x8104('0x18')],{'host':_0x8104('0x19'),'port':0x18eb});var socket=require(_0x8104('0x1a'))(new Redis(config[_0x8104('0x18')]));require(_0x8104('0x1b'))[_0x8104('0x1c')](socket);function respondWithStatusCode(_0x93fdfe,_0x4c8f1d){_0x4c8f1d=_0x4c8f1d||0xcc;return function(_0x4da076){if(_0x4da076){return _0x93fdfe[_0x8104('0x1d')](_0x4c8f1d);}return _0x93fdfe['status'](_0x4c8f1d)[_0x8104('0x1e')]();};}function respondWithResult(_0x286bcd,_0x35df99){_0x35df99=_0x35df99||0xc8;return function(_0x289c48){if(_0x289c48){return _0x286bcd[_0x8104('0x1f')](_0x35df99)['json'](_0x289c48);}};}function respondWithFilteredResult(_0x14c5a7,_0x19ac3d){return function(_0x42bc8e){if(_0x42bc8e){var _0x2ce2ad=typeof _0x19ac3d['offset']===_0x8104('0x20')&&typeof _0x19ac3d[_0x8104('0x21')]===_0x8104('0x20');var _0x9f0aee=_0x42bc8e['count'];var _0xf5bdbe=_0x2ce2ad?0x0:_0x19ac3d[_0x8104('0x22')];var _0x1bf197=_0x2ce2ad?_0x42bc8e[_0x8104('0x23')]:_0x19ac3d[_0x8104('0x22')]+_0x19ac3d[_0x8104('0x21')];var _0x4350c4;if(_0x1bf197>=_0x9f0aee){_0x1bf197=_0x9f0aee;_0x4350c4=0xc8;}else{_0x4350c4=0xce;}_0x14c5a7[_0x8104('0x1f')](_0x4350c4);return _0x14c5a7[_0x8104('0x24')](_0x8104('0x25'),_0xf5bdbe+'-'+_0x1bf197+'/'+_0x9f0aee)[_0x8104('0x26')](_0x42bc8e);}return null;};}function patchUpdates(_0x3f92b4){return function(_0x1b7114){try{jsonpatch[_0x8104('0x27')](_0x1b7114,_0x3f92b4,!![]);}catch(_0x2205b0){return BPromise[_0x8104('0x28')](_0x2205b0);}return _0x1b7114['save']();};}function saveUpdates(_0x5e6f4b,_0x423604){return function(_0x19754e){if(_0x19754e){return _0x19754e[_0x8104('0x29')](_0x5e6f4b)[_0x8104('0x2a')](function(_0x5527c8){return _0x5527c8;});}return null;};}function removeEntity(_0x5a7665,_0x2f2fa6){return function(_0x3856ce){if(_0x3856ce){return _0x3856ce[_0x8104('0x2b')]()[_0x8104('0x2a')](function(){_0x5a7665[_0x8104('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d75c9,_0x2c2d5f){return function(_0x4b9281){if(!_0x4b9281){_0x5d75c9['sendStatus'](0x194);}return _0x4b9281;};}function handleError(_0x2d5754,_0x5e2728){_0x5e2728=_0x5e2728||0x1f4;return function(_0xca5903){logger[_0x8104('0x2c')](_0xca5903['stack']);if(_0xca5903[_0x8104('0x2d')]){delete _0xca5903[_0x8104('0x2d')];}_0x2d5754[_0x8104('0x1f')](_0x5e2728)[_0x8104('0x2e')](_0xca5903);};}function getInteractionUsers(_0x309a58,_0x5449bd){return new BPromise(function(_0x5b63c9,_0x5b9644){try{if(_0x5449bd[_0x309a58['id']]){_0x309a58[_0x8104('0x2f')]=_[_0x8104('0x30')](_0x5449bd[_0x309a58['id']],function(_0x279a8e){return{'id':_0x279a8e['id'],'fullname':_0x279a8e['fullname']};});}}catch(_0x255359){_0x5b9644(_0x255359);}_0x5b63c9(_0x309a58);});}function getInteractionTags(_0x2bbdfe,_0x97659a){return new BPromise(function(_0x2674d2,_0x408414){try{if(_0x2bbdfe[_0x8104('0x31')]){_0x2bbdfe[_0x8104('0x32')]=[];_0x2bbdfe[_0x8104('0x31')][_0x8104('0x33')](',')[_0x8104('0x34')](function(_0x1ce48a){_0x2bbdfe[_0x8104('0x32')][_0x8104('0x35')](_0x97659a[_0x1ce48a]);});}delete _0x2bbdfe['TagIds'];}catch(_0x32faa3){_0x408414(_0x32faa3);}_0x2674d2(_0x2bbdfe);});}function updateOpenchannelInteraction(_0x58a0e1,_0x1d5fdf,_0x29a26b){return new BPromise(function(_0x24df0c,_0x3021c0){return getInteractionUsers(_0x58a0e1,_0x29a26b)[_0x8104('0x2a')](function(_0x3cb6b0){return getInteractionTags(_0x3cb6b0,_0x1d5fdf);})[_0x8104('0x2a')](function(_0x8b967){_0x24df0c(_0x8b967);})['catch'](function(_0x3f0713){_0x3021c0(_0x3f0713);});});}exports[_0x8104('0x36')]=function(_0x511dff,_0x2ce502){var _0x5e50ea={},_0x7e0212={},_0x53fd2b={'count':0x0,'rows':[]};var _0x59cc8c=_[_0x8104('0x30')](db[_0x8104('0x37')]['rawAttributes'],function(_0x48dbcc){return{'name':_0x48dbcc[_0x8104('0x38')],'type':_0x48dbcc['type'][_0x8104('0x39')]};});_0x7e0212[_0x8104('0x3a')]=_['map'](_0x59cc8c,_0x8104('0x2d'));_0x7e0212['query']=_[_0x8104('0x3b')](_0x511dff[_0x8104('0x3c')]);_0x7e0212['filters']=_[_0x8104('0x3d')](_0x7e0212[_0x8104('0x3a')],_0x7e0212['query']);_0x5e50ea[_0x8104('0x3e')]=_[_0x8104('0x3d')](_0x7e0212[_0x8104('0x3a')],qs[_0x8104('0x3f')](_0x511dff[_0x8104('0x3c')]['fields']));_0x5e50ea['attributes']=_0x5e50ea[_0x8104('0x3e')]['length']?_0x5e50ea[_0x8104('0x3e')]:_0x7e0212[_0x8104('0x3a')];if(!_0x511dff[_0x8104('0x3c')][_0x8104('0x40')](_0x8104('0x41'))){_0x5e50ea[_0x8104('0x21')]=qs[_0x8104('0x21')](_0x511dff[_0x8104('0x3c')][_0x8104('0x21')]);_0x5e50ea[_0x8104('0x22')]=qs['offset'](_0x511dff['query'][_0x8104('0x22')]);}_0x5e50ea[_0x8104('0x42')]=qs[_0x8104('0x43')](_0x511dff[_0x8104('0x3c')]['sort']);_0x5e50ea['where']=qs['filters'](_[_0x8104('0x44')](_0x511dff[_0x8104('0x3c')],_0x7e0212[_0x8104('0x45')]),_0x59cc8c);var _0x240726=[];var _0x39f434=squel[_0x8104('0x46')]()[_0x8104('0x47')]('id')[_0x8104('0x47')](_0x8104('0x2d'))['field']('color')[_0x8104('0x48')](_0x8104('0x49'));var _0x5450ac=squel[_0x8104('0x46')]()['field'](_0x8104('0x4a'))['field'](_0x8104('0x4b'))[_0x8104('0x47')](_0x8104('0x4c'))[_0x8104('0x48')](_0x8104('0x4d'),'ui')['left_join'](_0x8104('0x4e'),'u',_0x8104('0x4f'));var _0x1f6dbd=squel[_0x8104('0x46')]()[_0x8104('0x48')](_0x8104('0x50'),'i')['left_join'](_0x8104('0x51'),'c',_0x8104('0x52'))[_0x8104('0x53')](_0x8104('0x4e'),'o',_0x8104('0x54'))[_0x8104('0x53')](_0x8104('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x8104('0x53')]('openchannel_messages','me',_0x8104('0x56'))['left_join']('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x8104('0x53')](_0x8104('0x49'),'t',_0x8104('0x57'));var _0x4a9dcf=squel['expr']();var _0x54fb49=[];var _0x56a9dd=squel[_0x8104('0x58')]();var _0x1eb6fc;if(_0x511dff[_0x8104('0x3c')][_0x8104('0x59')]){_0x1eb6fc=as[_0x8104('0x5a')](_0x511dff[_0x8104('0x3c')]['search']);var _0x3f0a5b=_0x1eb6fc[_0x8104('0x5b')];for(var _0x56018b=0x0;_0x56018b<_0x1eb6fc['conditions'][_0x8104('0x5c')];_0x56018b++){var _0x3e0cbe=_0x1eb6fc[_0x8104('0x5d')][_0x56018b];var _0x32e859='i';var _0x1598fd=_[_0x8104('0x5e')](_0x59cc8c,[_0x8104('0x2d'),_0x3e0cbe['field']]);if(!_0x1598fd){switch(_0x3e0cbe[_0x8104('0x47')]){case _0x8104('0x5f'):if(_0x3e0cbe[_0x8104('0x60')]==0x1){_0x1f6dbd['having']('`'+_0x3e0cbe[_0x8104('0x47')]+_0x8104('0x61'));}else{_0x1f6dbd['having']('`'+_0x3e0cbe[_0x8104('0x47')]+_0x8104('0x62'));}break;case'Contact':if(_0x3e0cbe['operator']==='$substring'){if(_0x3e0cbe[_0x8104('0x60')][_0x8104('0x33')]('\x20')[_0x8104('0x5c')]>0x1){_0x4a9dcf[_0x3f0a5b](_0x8104('0x63'),qs[_0x8104('0x64')](_0x3e0cbe[_0x8104('0x60')]),null);}else{var _0x38f2ec='%'+_0x3e0cbe['value']+'%';_0x4a9dcf[_0x3f0a5b](_0x8104('0x65'),_0x38f2ec,_0x38f2ec,_0x38f2ec);}}else{_0x1598fd=_[_0x8104('0x5e')](_0x59cc8c,[_0x8104('0x2d'),_0x8104('0x66')]);_0x3e0cbe[_0x8104('0x47')]=_0x8104('0x66');_0x13e953=as[_0x8104('0x67')](_0x32e859,_0x1598fd[_0x8104('0x68')],_0x3e0cbe);_0x4a9dcf[_0x3f0a5b](_0x13e953[_0x8104('0x69')],_0x13e953[_0x8104('0x60')][_0x8104('0x6a')],_0x13e953[_0x8104('0x60')]['end']);}break;case'Tag':var _0x47bfee=_0x3e0cbe[_0x8104('0x60')]['split'](',')[_0x8104('0x30')](function(_0xb313ac){return Number(_0xb313ac);});_0x47bfee['forEach'](function(_0x156d13){_0x56a9dd['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x156d13+',%');});_0x54fb49=_['union'](_0x54fb49,_0x47bfee);break;case _0x8104('0x6b'):if(_0x3e0cbe[_0x8104('0x6c')]===_0x8104('0x6d')){_0x4a9dcf[_0x3f0a5b](_0x8104('0x6e'),'%'+_0x3e0cbe[_0x8104('0x60')]+'%',null);}else{_0x1598fd=_[_0x8104('0x5e')](_0x59cc8c,[_0x8104('0x2d'),_0x8104('0x6f')]);_0x3e0cbe[_0x8104('0x47')]='UserId';_0x13e953=as[_0x8104('0x67')](_0x32e859,_0x1598fd[_0x8104('0x68')],_0x3e0cbe);_0x4a9dcf[_0x3f0a5b](_0x13e953[_0x8104('0x69')],_0x13e953[_0x8104('0x60')][_0x8104('0x6a')],_0x13e953[_0x8104('0x60')][_0x8104('0x1e')]);}break;case'body':_0x13e953=as[_0x8104('0x67')]('me',null,_0x3e0cbe);_0x4a9dcf[_0x3f0a5b](_0x13e953[_0x8104('0x69')],_0x13e953[_0x8104('0x60')][_0x8104('0x6a')],_0x13e953[_0x8104('0x60')][_0x8104('0x1e')]);break;}}else{var _0x13e953=as[_0x8104('0x67')](_0x32e859,_0x1598fd['type'],_0x3e0cbe);_0x4a9dcf[_0x3f0a5b](_0x13e953[_0x8104('0x69')],_0x13e953[_0x8104('0x60')][_0x8104('0x6a')],_0x13e953[_0x8104('0x60')][_0x8104('0x1e')]);}}}else{var _0x2579a8=_(_0x511dff[_0x8104('0x3c')])[_0x8104('0x3b')]()[_0x8104('0x30')](function(_0x18cd97){return _[_0x8104('0x70')](_0x59cc8c,[_0x8104('0x2d'),_0x18cd97])?_0x18cd97:undefined;})[_0x8104('0x71')]()['value']();if(!_[_0x8104('0x72')](_0x2579a8)){_0x2579a8['forEach'](function(_0x2cd50b){if(_0x2cd50b===_0x8104('0x73')){_0x1f6dbd['where'](_0x8104('0x74'),[]['concat'](_0x511dff[_0x8104('0x3c')][_0x2cd50b]));}else if(_0x2cd50b==='createdAt'){var _0x7f69c1=JSON['parse'](_0x511dff[_0x8104('0x3c')][_0x2cd50b])['$gte'];var _0x49f508=JSON['parse'](_0x511dff['query'][_0x2cd50b])[_0x8104('0x75')];_0x1f6dbd[_0x8104('0x76')](_0x8104('0x77'),_0x7f69c1,_0x49f508);}else{if(_0x511dff[_0x8104('0x3c')][_0x2cd50b]==='null'){_0x1f6dbd['where']('i.'+_0x2cd50b+_0x8104('0x78'));}else{_0x1f6dbd[_0x8104('0x76')]('i.'+_0x2cd50b+_0x8104('0x79'),_0x511dff['query'][_0x2cd50b]);}}});}if(_0x511dff[_0x8104('0x3c')][_0x8104('0x7a')]){if(_0x511dff[_0x8104('0x3c')][_0x8104('0x7a')]==0x1){_0x1f6dbd['having'](_0x8104('0x7b'));}else{_0x1f6dbd[_0x8104('0x7c')](_0x8104('0x7d'));}}if(_0x511dff[_0x8104('0x3c')][_0x8104('0x7e')]){_0x54fb49=_[_0x8104('0x7f')](_0x511dff[_0x8104('0x3c')][_0x8104('0x7e')])?_0x511dff['query'][_0x8104('0x7e')]:new Array(_0x511dff[_0x8104('0x3c')][_0x8104('0x7e')]);_0x54fb49[_0x8104('0x34')](function(_0x1eddb9){_0x56a9dd['or'](_0x8104('0x80'),'%,'+_0x1eddb9+',%');});}if(_0x511dff[_0x8104('0x3c')]['filter']){var _0x219648=_0x511dff[_0x8104('0x3c')]['filter'][_0x8104('0x81')]('\x5c','\x5c\x5c')[_0x8104('0x81')](/'/g,'\x27\x27');if(qs[_0x8104('0x82')](_0x219648)){_0x4a9dcf['or'](_0x8104('0x83'),_0x219648+'%');}else{_0x4a9dcf['or'](_0x8104('0x84'),qs[_0x8104('0x64')](_0x219648))['or'](_0x8104('0x85'),_0x219648+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x219648+'%');}}}_0x1f6dbd[_0x8104('0x76')](_0x4a9dcf);_0x1f6dbd[_0x8104('0x86')]('i.id');var _0x109b96={'type':db[_0x8104('0x87')][_0x8104('0x88')]['SELECT'],'raw':!![]};var _0x592661=_0x1f6dbd[_0x8104('0x89')]();_0x592661['field'](_0x8104('0x8a'));_0x592661[_0x8104('0x47')](_0x8104('0x8b'),_0x8104('0x5f'));if(_0x5e50ea[_0x8104('0x42')]){_0x5e50ea[_0x8104('0x42')]['forEach'](function(_0x23f74f){var _0x5c2828=_0x23f74f[0x0]===_0x8104('0x8c')?_0x23f74f[0x0]:'i.'+_0x23f74f[0x0];_0x1f6dbd[_0x8104('0x42')](_0x5c2828,_0x23f74f[0x1]===_0x8104('0x8d')?![]:!![]);});}if(!_[_0x8104('0x72')](_0x54fb49)){_0x1f6dbd[_0x8104('0x7c')](_0x56a9dd);_0x592661[_0x8104('0x76')](_0x8104('0x8e'),_0x54fb49);}BPromise[_0x8104('0x8f')]()[_0x8104('0x2a')](function(){if(!_0x1eb6fc){if(_0x511dff[_0x8104('0x3c')][_0x8104('0x73')])return;_0x592661[_0x8104('0x76')](_0x8104('0x90'));_0x1f6dbd[_0x8104('0x76')](_0x8104('0x90'));return;}if(_0x511dff[_0x8104('0x91')][_0x8104('0x92')]!==_0x8104('0x93'))return;return _0x511dff[_0x8104('0x91')][_0x8104('0x94')]({'attributes':['id'],'raw':!![]})[_0x8104('0x2a')](function(_0x2d141b){if(_[_0x8104('0x72')](_0x2d141b)){_0x592661['where'](_0x8104('0x95'));_0x1f6dbd[_0x8104('0x76')](_0x8104('0x95'));}else{_0x592661[_0x8104('0x76')](_0x8104('0x74'),_[_0x8104('0x30')](_0x2d141b,'id'));_0x1f6dbd[_0x8104('0x76')](_0x8104('0x74'),_[_0x8104('0x30')](_0x2d141b,'id'));}});})[_0x8104('0x2a')](function(){if(_0x511dff[_0x8104('0x91')]['role']===_0x8104('0x93')&&!_0x1eb6fc&&!_0x511dff['query']['OpenchannelAccountId'])return[];return db[_0x8104('0x96')][_0x8104('0x3c')](_0x592661[_0x8104('0x97')](),_0x109b96);})[_0x8104('0x2a')](function(_0x5ad48f){_0x53fd2b['count']=_0x5ad48f[_0x8104('0x5c')];if(_0x53fd2b[_0x8104('0x23')]===0x0)return[];return db[_0x8104('0x96')][_0x8104('0x3c')](_0x39f434[_0x8104('0x97')](),_0x109b96)[_0x8104('0x2a')](function(_0x352fd0){_0x240726=_[_0x8104('0x98')](_0x352fd0,'id');_0x109b96=_[_0x8104('0x99')](_0x109b96,{'model':db[_0x8104('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x511dff[_0x8104('0x3c')]['fields']){_0x5e50ea[_0x8104('0x3e')]['forEach'](function(_0x3b0e37){_0x1f6dbd['field']('i.'+_0x3b0e37);});}else{_0x1f6dbd[_0x8104('0x47')](_0x8104('0x8b'),'unreadMessages');_0x1f6dbd[_0x8104('0x47')](_0x8104('0x9a'),'Account.key');_0x1f6dbd[_0x8104('0x47')](_0x8104('0x9b'),'Account.mandatoryDisposition');_0x1f6dbd[_0x8104('0x47')]('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','contactName');_0x1f6dbd[_0x8104('0x47')](_0x8104('0x9c'));_0x1f6dbd['field']('c.firstName','Contact.firstName');_0x1f6dbd[_0x8104('0x47')](_0x8104('0x9d'),_0x8104('0x9e'));_0x1f6dbd[_0x8104('0x47')]('c.email',_0x8104('0x9f'));_0x1f6dbd[_0x8104('0x47')](_0x8104('0xa0'),_0x8104('0xa1'));_0x1f6dbd[_0x8104('0x47')](_0x8104('0xa2'),_0x8104('0xa3'));_0x1f6dbd['field'](_0x8104('0xa4'),'Contact.fax');_0x1f6dbd[_0x8104('0x47')]('o.fullname',_0x8104('0xa5'));_0x1f6dbd['field'](_0x8104('0xa6'),_0x8104('0xa7'));_0x1f6dbd['field'](_0x8104('0xa8'),_0x8104('0x31'));}if(_0x5e50ea[_0x8104('0x21')])_0x1f6dbd[_0x8104('0x21')](_0x5e50ea[_0x8104('0x21')]);if(_0x5e50ea[_0x8104('0x22')])_0x1f6dbd[_0x8104('0x22')](_0x5e50ea[_0x8104('0x22')]);return db[_0x8104('0x96')][_0x8104('0x3c')](_0x1f6dbd[_0x8104('0x97')](),_0x109b96);})['then'](function(_0x4b6492){if(_0x4b6492['length']>0x0)_0x5450ac['where'](_0x8104('0xa9'),_[_0x8104('0x30')](_0x4b6492,'id'));return db[_0x8104('0x96')][_0x8104('0x3c')](_0x5450ac['toString'](),_0x109b96)[_0x8104('0x2a')](function(_0x140baa){var _0x25065f=_[_0x8104('0xaa')](_0x140baa,_0x8104('0xab'));var _0x434add=[];_0x4b6492[_0x8104('0x34')](function(_0x52d44a){_0x434add[_0x8104('0x35')](updateOpenchannelInteraction(_0x52d44a,_0x240726,_0x25065f));});return BPromise['all'](_0x434add);});});})['then'](function(_0x22871c){_0x53fd2b['rows']=_0x22871c;return _0x53fd2b;})[_0x8104('0x2a')](respondWithFilteredResult(_0x2ce502,_0x5e50ea))[_0x8104('0xac')](handleError(_0x2ce502,null));};exports['show']=function(_0x409bf3,_0x3a66c6){var _0x1ce026={};if(_0x409bf3[_0x8104('0x3c')][_0x8104('0x68')]&&_0x409bf3['query']['type']==='from'){_0x1ce026[_0x8104('0x48')]=_0x409bf3['params']['id'];}else{_0x1ce026['id']=_0x409bf3[_0x8104('0xad')]['id'];}var _0x475d6a={'raw':![],'where':_0x1ce026},_0x3af6c2={};_0x3af6c2['model']=_[_0x8104('0x3b')](db[_0x8104('0x37')][_0x8104('0xae')]);_0x3af6c2[_0x8104('0x3c')]=_[_0x8104('0x3b')](_0x409bf3['query']);_0x3af6c2[_0x8104('0x45')]=_[_0x8104('0x3d')](_0x3af6c2[_0x8104('0x3a')],_0x3af6c2[_0x8104('0x3c')]);_0x475d6a[_0x8104('0x3e')]=_[_0x8104('0x3d')](_0x3af6c2['model'],qs[_0x8104('0x3f')](_0x409bf3[_0x8104('0x3c')]['fields']));_0x475d6a[_0x8104('0x3e')]=_0x475d6a[_0x8104('0x3e')][_0x8104('0x5c')]?_0x475d6a[_0x8104('0x3e')]:_0x3af6c2['model'];if(_0x409bf3['query'][_0x8104('0xaf')]){_0x475d6a[_0x8104('0xb0')]=[{'all':!![]}];}_0x475d6a=_[_0x8104('0x99')]({},_0x475d6a,_0x409bf3[_0x8104('0xb1')]);return db['OpenchannelInteraction'][_0x8104('0x5e')](_0x475d6a)[_0x8104('0x2a')](handleEntityNotFound(_0x3a66c6,null))['then'](respondWithResult(_0x3a66c6,null))[_0x8104('0xac')](handleError(_0x3a66c6,null));};exports['create']=function(_0x5302b0,_0x3e99b5){return db['OpenchannelInteraction'][_0x8104('0xb2')](_0x5302b0[_0x8104('0xb3')],{})[_0x8104('0x2a')](respondWithResult(_0x3e99b5,0xc9))['catch'](handleError(_0x3e99b5,null));};exports[_0x8104('0x29')]=function(_0x498b95,_0xaa889){if(_0x498b95[_0x8104('0xb3')]['id']){delete _0x498b95['body']['id'];}return db[_0x8104('0x37')][_0x8104('0x5e')]({'where':{'id':_0x498b95[_0x8104('0xad')]['id']}})[_0x8104('0x2a')](handleEntityNotFound(_0xaa889,null))[_0x8104('0x2a')](saveUpdates(_0x498b95[_0x8104('0xb3')],null))[_0x8104('0x2a')](respondWithResult(_0xaa889,null))[_0x8104('0xac')](handleError(_0xaa889,null));};exports[_0x8104('0x2b')]=function(_0x48b4c6,_0x340e2b){return db[_0x8104('0x37')][_0x8104('0x5e')]({'where':{'id':_0x48b4c6[_0x8104('0xad')]['id']}})[_0x8104('0x2a')](handleEntityNotFound(_0x340e2b,null))[_0x8104('0x2a')](removeEntity(_0x340e2b,null))['catch'](handleError(_0x340e2b,null));};exports[_0x8104('0xb4')]=function(_0x47fb89,_0x43b943){return db[_0x8104('0x37')][_0x8104('0xb4')]()[_0x8104('0x2a')](respondWithResult(_0x43b943,null))['catch'](handleError(_0x43b943,null));};exports[_0x8104('0xb5')]=function(_0x31f44e,_0x20defc,_0x5be80b){return db['OpenchannelMessage'][_0x8104('0x5e')]({'where':{'id':_0x31f44e['params']['id']}})[_0x8104('0x2a')](handleEntityNotFound(_0x20defc,null))[_0x8104('0x2a')](function(_0x1fa189){if(_0x1fa189){return _0x1fa189[_0x8104('0xb5')](_0x31f44e[_0x8104('0xb3')]['ids'],_[_0x8104('0xb6')](_0x31f44e[_0x8104('0xb3')],['ids','id'])||{});}})[_0x8104('0x2a')](respondWithResult(_0x20defc,null))[_0x8104('0xac')](handleError(_0x20defc,null));};exports[_0x8104('0xb7')]=function(_0x41230c,_0x1b928c,_0x7e2916){var _0x56811f={'raw':![],'where':{}};var _0x473683={};var _0x1ad632={'count':0x0,'rows':[]};return db[_0x8104('0x37')][_0x8104('0xb8')]({'where':{'id':_0x41230c[_0x8104('0xad')]['id']}})['then'](handleEntityNotFound(_0x1b928c,null))[_0x8104('0x2a')](function(_0x2607a2){if(_0x2607a2){_0x473683[_0x8104('0x3a')]=_['keys'](db[_0x8104('0xb9')][_0x8104('0xae')]);_0x473683[_0x8104('0x3c')]=_[_0x8104('0x3b')](_0x41230c[_0x8104('0x3c')]);_0x473683[_0x8104('0x45')]=_[_0x8104('0x3d')](_0x473683['model'],_0x473683[_0x8104('0x3c')]);_0x56811f['attributes']=_['intersection'](_0x473683[_0x8104('0x3a')],qs[_0x8104('0x3f')](_0x41230c[_0x8104('0x3c')][_0x8104('0x3f')]));_0x56811f[_0x8104('0x3e')]=_0x56811f[_0x8104('0x3e')][_0x8104('0x5c')]?_0x56811f[_0x8104('0x3e')]:_0x473683[_0x8104('0x3a')];if(!_0x41230c[_0x8104('0x3c')][_0x8104('0x40')](_0x8104('0x41'))){_0x56811f[_0x8104('0x21')]=qs[_0x8104('0x21')](_0x41230c['query'][_0x8104('0x21')]);_0x56811f[_0x8104('0x22')]=qs[_0x8104('0x22')](_0x41230c[_0x8104('0x3c')][_0x8104('0x22')]);}_0x56811f[_0x8104('0x42')]=qs[_0x8104('0x43')](_0x41230c['query'][_0x8104('0x43')]);_0x56811f[_0x8104('0x76')]=qs[_0x8104('0x45')](_[_0x8104('0x44')](_0x41230c[_0x8104('0x3c')],_0x473683[_0x8104('0x45')]));_0x56811f[_0x8104('0x76')][_0x8104('0xab')]=_0x2607a2['id'];if(_0x41230c[_0x8104('0x3c')][_0x8104('0xba')]){_0x56811f[_0x8104('0x76')]=_[_0x8104('0x99')](_0x56811f[_0x8104('0x76')],{'$or':_['map'](_0x56811f[_0x8104('0x3e')],function(_0x6fcc24){var _0x5a0c1c={};_0x5a0c1c[_0x6fcc24]={'$like':'%'+_0x41230c[_0x8104('0x3c')][_0x8104('0xba')]+'%'};return _0x5a0c1c;})});}if(_0x41230c[_0x8104('0x3c')][_0x8104('0xbb')]){var _0x2889ed=_0x41230c[_0x8104('0x3c')][_0x8104('0xbb')]['split'](',');var _0x4a1534={};_0x4a1534[_0x2889ed[0x0]]={'$gte':moment(_0x2889ed[0x1])[_0x8104('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x56811f[_0x8104('0x76')]=_['merge'](_0x56811f[_0x8104('0x76')],_0x4a1534);}_0x56811f=_[_0x8104('0x99')]({},_0x56811f,_0x41230c[_0x8104('0xb1')]);return db[_0x8104('0xb9')][_0x8104('0x23')]({'where':_0x56811f[_0x8104('0x76')]})['then'](function(_0x2068d5){_0x1ad632['count']=_0x2068d5;if(_0x41230c['query'][_0x8104('0xaf')]){_0x56811f[_0x8104('0xb0')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x8104('0xbd')](_0x56811f);})[_0x8104('0x2a')](function(_0x3caa49){_0x1ad632[_0x8104('0xbe')]=_0x3caa49;return _0x1ad632;});}})[_0x8104('0x2a')](respondWithFilteredResult(_0x1b928c,_0x56811f))[_0x8104('0xac')](handleError(_0x1b928c,null));};exports[_0x8104('0xbf')]=function(_0x171ef5,_0x123bed,_0x4c980a){return db[_0x8104('0x37')][_0x8104('0x5e')]({'where':{'id':_0x171ef5[_0x8104('0xad')]['id']}})[_0x8104('0x2a')](handleEntityNotFound(_0x123bed,null))['then'](function(_0x4aa4df){if(_0x4aa4df){return _0x4aa4df[_0x8104('0xc0')](_0x171ef5['body'][_0x8104('0xc1')],_[_0x8104('0xb6')](_0x171ef5['body'],[_0x8104('0xc1'),'id'])||{})[_0x8104('0xc2')](function(){return db[_0x8104('0xc3')][_0x8104('0xbd')]({'attributes':['id',_0x8104('0x2d'),_0x8104('0xc4')],'where':{'id':_0x171ef5[_0x8104('0xb3')][_0x8104('0xc1')]}});})[_0x8104('0x2a')](function(_0x27298b){socket[_0x8104('0xc5')](_0x8104('0xc6'),{'id':Number(_0x171ef5[_0x8104('0xad')]['id']),'tags':_0x27298b||[]});return{'id':Number(_0x171ef5[_0x8104('0xad')]['id']),'tags':_0x27298b||[]};});}})[_0x8104('0x2a')](respondWithResult(_0x123bed,null))[_0x8104('0xac')](handleError(_0x123bed,null));};exports[_0x8104('0xc7')]=function(_0x4aa2ab,_0x336a68,_0x4725d3){return db[_0x8104('0x37')][_0x8104('0x5e')]({'where':{'id':_0x4aa2ab[_0x8104('0xad')]['id']}})[_0x8104('0x2a')](handleEntityNotFound(_0x336a68,null))[_0x8104('0x2a')](function(_0x848b9f){if(_0x848b9f){return _0x848b9f[_0x8104('0xc7')](_0x4aa2ab[_0x8104('0x3c')][_0x8104('0xc1')]);}})[_0x8104('0x2a')](respondWithStatusCode(_0x336a68,null))['catch'](handleError(_0x336a68,null));};exports[_0x8104('0xc8')]=function(_0x22e65f,_0x20695d){var _0xf6fc12=moment()[_0x8104('0xc9')]()[_0x8104('0x97')]();var _0x21cad8=path[_0x8104('0xca')](config['root'],'server',_0x8104('0xcb'),_0x8104('0xcc'));var _0x416ab6=path[_0x8104('0xca')](config['root'],_0x8104('0xcd'),_0x8104('0xcb'),_0x8104('0xce'));var _0x20291a=path[_0x8104('0xca')](_0x21cad8,_0xf6fc12);var _0x5937e6=util[_0x8104('0xbc')](_0x8104('0xcf'),_0x22e65f[_0x8104('0xad')]['id'],_0xf6fc12);var _0xcae314=path[_0x8104('0xca')](_0x21cad8,_0x5937e6);var _0x175b61=[];_0x175b61[_0x8104('0x35')]({'model':db[_0x8104('0x6b')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x175b61[_0x8104('0x35')]({'model':db['CmContact'],'as':_0x8104('0xd0'),'attributes':['id',_0x8104('0xd1'),_0x8104('0xd2')],'raw':!![]});if(_0x22e65f['query']['attachments']){_0x175b61[_0x8104('0x35')]({'model':db['Attachment'],'as':_0x8104('0xd3'),'raw':!![]});}var _0x52984d=[{'model':db['OpenchannelMessage'],'as':_0x8104('0xd4'),'attributes':['id','body','createdAt','direction',_0x8104('0xd5'),_0x8104('0x7a')],'include':_0x175b61}];_0x52984d[_0x8104('0x35')]({'model':db['OpenchannelAccount'],'as':_0x8104('0xd6'),'attributes':['id',_0x8104('0x2d')]});_0x52984d[_0x8104('0x35')]({'model':db[_0x8104('0x6b')],'as':'Owner','attributes':['id',_0x8104('0xd7')]});return db[_0x8104('0x37')]['find']({'where':{'id':_0x22e65f[_0x8104('0xad')]['id']},'include':_0x52984d})['then'](handleEntityNotFound(_0x20695d,null))[_0x8104('0x2a')](function(_0x271b2e){if(_0x271b2e){var _0x389c88=_0x271b2e['get']({'plain':!![]});fs['mkdirSync'](_0x20291a);var _0x507d91={'channel':_0x8104('0xd8'),'account':_0x389c88[_0x8104('0xd6')][_0x8104('0x2d')],'agent':_0x389c88[_0x8104('0xd9')]?_0x389c88[_0x8104('0xd9')][_0x8104('0xd7')]:'N.A.','createdAt':moment(_0x389c88[_0x8104('0xda')])['format'](_0x8104('0xdb'))['toString'](),'closedAt':_0x389c88[_0x8104('0xdc')]?moment(_0x389c88['closedAt'])['format'](_0x8104('0xdb'))[_0x8104('0x97')]():'','disposition':_0x389c88[_0x8104('0xdd')],'visibility':_0x389c88[_0x8104('0xde')]?_0x8104('0xdf'):_0x8104('0xe0'),'messages':_(_0x389c88[_0x8104('0xd4')])[_0x8104('0xba')]({'secret':![]})[_0x8104('0x30')](function(_0x353817){if(_0x353817[_0x8104('0xd3')]){var _0x1f3f78=path[_0x8104('0xca')](_0x416ab6,_0x353817['Attachment']['basename']);if(fs[_0x8104('0xe1')](_0x1f3f78)){fs[_0x8104('0xe2')](_0x1f3f78)[_0x8104('0xe3')](fs[_0x8104('0xe4')](path[_0x8104('0xca')](_0x20291a,_0x353817[_0x8104('0xd3')][_0x8104('0xe5')])));}}return{'date':moment(_0x353817['createdAt'])[_0x8104('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8104('0x97')](),'sender':_0x353817[_0x8104('0xe6')]===_0x8104('0xe7')?_0x353817[_0x8104('0x6b')]?_0x353817['User'][_0x8104('0xd7')]:'System':_0x353817[_0x8104('0xd0')]['firstName']+(_0x353817[_0x8104('0xd0')][_0x8104('0xd2')]?'\x20'+_0x353817[_0x8104('0xd0')][_0x8104('0xd2')]:''),'body':_0x353817[_0x8104('0xd3')]?_0x353817[_0x8104('0xd3')][_0x8104('0xe5')]:_0x353817['body'],'direction':_0x353817[_0x8104('0xe6')]==='out'?'A':'C','secret':_0x353817[_0x8104('0xd5')],'read':_0x353817[_0x8104('0x7a')],'attachment':_0x353817['Attachment']};})[_0x8104('0x60')]()};return ejs['renderFile'](path['join'](config['root'],_0x8104('0xcd'),_0x8104('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x507d91})['then'](function(_0x2191a7){var _0x46148c=path[_0x8104('0xca')](_0x20291a,_0x8104('0xe9')+_0x389c88['id']+'-'+_0xf6fc12+'.pdf');var _0x1348f3={'path':_0x46148c,'channel':'Openchannel','interactionId':_0x389c88['id']};return pdf[_0x8104('0xea')](_0x2191a7,_0x1348f3);})[_0x8104('0x2a')](function(){return new BPromise(function(_0x43f3af,_0x4f4135){zipdir(_0x20291a,{'saveTo':_0xcae314},function(_0x3711f1,_0xd661ad){if(_0x3711f1)return _0x4f4135(_0x3711f1);return _0x43f3af(_0xd661ad);});})[_0x8104('0x2a')](function(){return new BPromise(function(_0x46fee0,_0x57f02c){rimraf(_0x20291a,function(_0x5c78a7){if(_0x5c78a7)_0x57f02c(_0x5c78a7);return _0x46fee0();});});})[_0x8104('0x2a')](function(){return _0x20695d['download'](_0xcae314,_0x5937e6,function(_0x7524e2){if(_0x7524e2){console['log'](_0x8104('0xeb'),_0x7524e2);}else{fs[_0x8104('0xec')](_0xcae314);}});});});}else{return _0x20695d[_0x8104('0x1d')](0xc8);}})[_0x8104('0xac')](handleError(_0x20695d,null));};
\ No newline at end of file
+var _0xe3c7=['c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','catch','params','include','merge','options','create','update','describe','addMessage','OpenchannelMessage','ids','findOne','findAll','setTags','omit','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','tmp','server','files','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Private','Messages','basename','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelInteraction.socket','status','json','undefined','count','offset','limit','set','apply','reject','then','destroy','end','sendStatus','error','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','order','contactName','DESC','t.id\x20IN\x20?','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','c.email','Contact.email'];(function(_0x14bf63,_0xdbd373){var _0x410d22=function(_0x2e5e3a){while(--_0x2e5e3a){_0x14bf63['push'](_0x14bf63['shift']());}};_0x410d22(++_0xdbd373);}(_0xe3c7,0x138));var _0x7e3c=function(_0xecb7da,_0x1bcc50){_0xecb7da=_0xecb7da-0x0;var _0x571c35=_0xe3c7[_0xecb7da];return _0x571c35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e3c('0x0'));var zipdir=require(_0x7e3c('0x1'));var jsonpatch=require(_0x7e3c('0x2'));var rp=require(_0x7e3c('0x3'));var moment=require(_0x7e3c('0x4'));var BPromise=require(_0x7e3c('0x5'));var Mustache=require(_0x7e3c('0x6'));var util=require(_0x7e3c('0x7'));var path=require(_0x7e3c('0x8'));var sox=require(_0x7e3c('0x9'));var csv=require('to-csv');var ejs=require(_0x7e3c('0xa'));var fs=require('fs');var fs_extra=require(_0x7e3c('0xb'));var _=require('lodash');var squel=require(_0x7e3c('0xc'));var crypto=require('crypto');var jsforce=require(_0x7e3c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7e3c('0xe'));var querystring=require(_0x7e3c('0xf'));var Papa=require(_0x7e3c('0x10'));var Redis=require(_0x7e3c('0x11'));var authService=require(_0x7e3c('0x12'));var qs=require(_0x7e3c('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x7e3c('0x14'));var hardwareService=require(_0x7e3c('0x15'));var logger=require(_0x7e3c('0x16'))(_0x7e3c('0x17'));var utils=require('../../config/utils');var config=require(_0x7e3c('0x18'));var licenseUtil=require(_0x7e3c('0x19'));var db=require(_0x7e3c('0x1a'))['db'];config['redis']=_[_0x7e3c('0x1b')](config[_0x7e3c('0x1c')],{'host':_0x7e3c('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e3c('0x1c')]));require(_0x7e3c('0x1e'))['register'](socket);function respondWithStatusCode(_0x5ae93d,_0x2f248f){_0x2f248f=_0x2f248f||0xcc;return function(_0x18114e){if(_0x18114e){return _0x5ae93d['sendStatus'](_0x2f248f);}return _0x5ae93d[_0x7e3c('0x1f')](_0x2f248f)['end']();};}function respondWithResult(_0x1e5296,_0xcc3c2a){_0xcc3c2a=_0xcc3c2a||0xc8;return function(_0x3a9a0d){if(_0x3a9a0d){return _0x1e5296[_0x7e3c('0x1f')](_0xcc3c2a)[_0x7e3c('0x20')](_0x3a9a0d);}};}function respondWithFilteredResult(_0xf9d744,_0x68baf){return function(_0x3b4afa){if(_0x3b4afa){var _0x5f14ce=typeof _0x68baf['offset']===_0x7e3c('0x21')&&typeof _0x68baf['limit']==='undefined';var _0x45482a=_0x3b4afa[_0x7e3c('0x22')];var _0x1acbf8=_0x5f14ce?0x0:_0x68baf['offset'];var _0x55024c=_0x5f14ce?_0x3b4afa[_0x7e3c('0x22')]:_0x68baf[_0x7e3c('0x23')]+_0x68baf[_0x7e3c('0x24')];var _0x5eecef;if(_0x55024c>=_0x45482a){_0x55024c=_0x45482a;_0x5eecef=0xc8;}else{_0x5eecef=0xce;}_0xf9d744[_0x7e3c('0x1f')](_0x5eecef);return _0xf9d744[_0x7e3c('0x25')]('Content-Range',_0x1acbf8+'-'+_0x55024c+'/'+_0x45482a)['json'](_0x3b4afa);}return null;};}function patchUpdates(_0x27717f){return function(_0x256280){try{jsonpatch[_0x7e3c('0x26')](_0x256280,_0x27717f,!![]);}catch(_0x10f084){return BPromise[_0x7e3c('0x27')](_0x10f084);}return _0x256280['save']();};}function saveUpdates(_0xcd018a,_0x3fc776){return function(_0x54cfb7){if(_0x54cfb7){return _0x54cfb7['update'](_0xcd018a)[_0x7e3c('0x28')](function(_0x33ed12){return _0x33ed12;});}return null;};}function removeEntity(_0x52e657,_0x43c1b5){return function(_0x4d696a){if(_0x4d696a){return _0x4d696a[_0x7e3c('0x29')]()['then'](function(){_0x52e657['status'](0xcc)[_0x7e3c('0x2a')]();});}};}function handleEntityNotFound(_0x37076e,_0x38aa31){return function(_0xce6568){if(!_0xce6568){_0x37076e[_0x7e3c('0x2b')](0x194);}return _0xce6568;};}function handleError(_0x2894a8,_0x4910c5){_0x4910c5=_0x4910c5||0x1f4;return function(_0x8625be){logger[_0x7e3c('0x2c')](_0x8625be['stack']);if(_0x8625be[_0x7e3c('0x2d')]){delete _0x8625be[_0x7e3c('0x2d')];}_0x2894a8[_0x7e3c('0x1f')](_0x4910c5)[_0x7e3c('0x2e')](_0x8625be);};}function getInteractionUsers(_0x2f2a83,_0x319cdf){return new BPromise(function(_0x15f30b,_0x532133){try{if(_0x319cdf[_0x2f2a83['id']]){_0x2f2a83[_0x7e3c('0x2f')]=_[_0x7e3c('0x30')](_0x319cdf[_0x2f2a83['id']],function(_0x166207){return{'id':_0x166207['id'],'fullname':_0x166207[_0x7e3c('0x31')]};});}}catch(_0x686129){_0x532133(_0x686129);}_0x15f30b(_0x2f2a83);});}function getInteractionTags(_0x32b761,_0x3b6131){return new BPromise(function(_0x25ee4b,_0x2dcb14){try{if(_0x32b761[_0x7e3c('0x32')]){_0x32b761['Tags']=[];_0x32b761[_0x7e3c('0x32')][_0x7e3c('0x33')](',')[_0x7e3c('0x34')](function(_0x58d1b1){_0x32b761[_0x7e3c('0x35')][_0x7e3c('0x36')](_0x3b6131[_0x58d1b1]);});}delete _0x32b761['TagIds'];}catch(_0x3942dc){_0x2dcb14(_0x3942dc);}_0x25ee4b(_0x32b761);});}function updateOpenchannelInteraction(_0x3912ad,_0x3df6f8,_0x288e0d){return new BPromise(function(_0xb9c630,_0x4266d4){return getInteractionUsers(_0x3912ad,_0x288e0d)[_0x7e3c('0x28')](function(_0x2e11df){return getInteractionTags(_0x2e11df,_0x3df6f8);})[_0x7e3c('0x28')](function(_0x1c732d){_0xb9c630(_0x1c732d);})['catch'](function(_0x410834){_0x4266d4(_0x410834);});});}exports[_0x7e3c('0x37')]=function(_0xae46cb,_0x46c27a){var _0x37de6d={},_0x543755={},_0x102eb1={'count':0x0,'rows':[]};var _0x838faf=_[_0x7e3c('0x30')](db[_0x7e3c('0x38')][_0x7e3c('0x39')],function(_0x4b3797){return{'name':_0x4b3797[_0x7e3c('0x3a')],'type':_0x4b3797[_0x7e3c('0x3b')][_0x7e3c('0x3c')]};});_0x543755[_0x7e3c('0x3d')]=_['map'](_0x838faf,_0x7e3c('0x2d'));_0x543755[_0x7e3c('0x3e')]=_[_0x7e3c('0x3f')](_0xae46cb['query']);_0x543755[_0x7e3c('0x40')]=_[_0x7e3c('0x41')](_0x543755[_0x7e3c('0x3d')],_0x543755['query']);_0x37de6d[_0x7e3c('0x42')]=_[_0x7e3c('0x41')](_0x543755['model'],qs[_0x7e3c('0x43')](_0xae46cb[_0x7e3c('0x3e')]['fields']));_0x37de6d[_0x7e3c('0x42')]=_0x37de6d['attributes'][_0x7e3c('0x44')]?_0x37de6d[_0x7e3c('0x42')]:_0x543755['model'];if(!_0xae46cb['query'][_0x7e3c('0x45')](_0x7e3c('0x46'))){_0x37de6d[_0x7e3c('0x24')]=qs['limit'](_0xae46cb[_0x7e3c('0x3e')]['limit']);_0x37de6d[_0x7e3c('0x23')]=qs[_0x7e3c('0x23')](_0xae46cb['query'][_0x7e3c('0x23')]);}_0x37de6d['order']=qs[_0x7e3c('0x47')](_0xae46cb[_0x7e3c('0x3e')][_0x7e3c('0x47')]);_0x37de6d[_0x7e3c('0x48')]=qs['filters'](_[_0x7e3c('0x49')](_0xae46cb[_0x7e3c('0x3e')],_0x543755[_0x7e3c('0x40')]),_0x838faf);var _0x2a2351=[];var _0x48bdfd=squel[_0x7e3c('0x4a')]()[_0x7e3c('0x4b')]('id')[_0x7e3c('0x4b')](_0x7e3c('0x2d'))[_0x7e3c('0x4b')](_0x7e3c('0x4c'))[_0x7e3c('0x4d')](_0x7e3c('0x4e'));var _0x2d0cb5=squel['select']()[_0x7e3c('0x4b')](_0x7e3c('0x4f'))[_0x7e3c('0x4b')](_0x7e3c('0x50'))[_0x7e3c('0x4b')]('ui.OpenchannelInteractionId')[_0x7e3c('0x4d')]('user_has_openchannel_interactions','ui')[_0x7e3c('0x51')](_0x7e3c('0x52'),'u',_0x7e3c('0x53'));var _0x41f67c=squel[_0x7e3c('0x4a')]()[_0x7e3c('0x4d')]('openchannel_interactions','i')[_0x7e3c('0x51')]('cm_contacts','c',_0x7e3c('0x54'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x7e3c('0x51')](_0x7e3c('0x55'),'a',_0x7e3c('0x56'))[_0x7e3c('0x51')]('openchannel_messages','me',_0x7e3c('0x57'))[_0x7e3c('0x51')](_0x7e3c('0x58'),'it',_0x7e3c('0x59'))['left_join'](_0x7e3c('0x4e'),'t','t.id\x20=\x20it.TagId');var _0x3bcc14=squel[_0x7e3c('0x5a')]();var _0x25bd87=[];var _0x501896=squel[_0x7e3c('0x5a')]();var _0x3a2fe0;if(_0xae46cb[_0x7e3c('0x3e')][_0x7e3c('0x5b')]){_0x3a2fe0=as['parseSearch'](_0xae46cb['query'][_0x7e3c('0x5b')]);var _0x479144=_0x3a2fe0[_0x7e3c('0x5c')];for(var _0xf9e1c3=0x0;_0xf9e1c3<_0x3a2fe0[_0x7e3c('0x5d')]['length'];_0xf9e1c3++){var _0x2556c5=_0x3a2fe0[_0x7e3c('0x5d')][_0xf9e1c3];var _0x782a5b='i';var _0x4c4812=_[_0x7e3c('0x5e')](_0x838faf,['name',_0x2556c5[_0x7e3c('0x4b')]]);if(!_0x4c4812){switch(_0x2556c5['field']){case _0x7e3c('0x5f'):if(_0x2556c5[_0x7e3c('0x60')]==0x1){_0x41f67c[_0x7e3c('0x61')]('`'+_0x2556c5[_0x7e3c('0x4b')]+_0x7e3c('0x62'));}else{_0x41f67c[_0x7e3c('0x61')]('`'+_0x2556c5[_0x7e3c('0x4b')]+_0x7e3c('0x63'));}break;case _0x7e3c('0x64'):if(_0x2556c5[_0x7e3c('0x65')]===_0x7e3c('0x66')){if(_0x2556c5[_0x7e3c('0x60')]['split']('\x20')['length']>0x1){_0x3bcc14[_0x479144](_0x7e3c('0x67'),qs[_0x7e3c('0x68')](_0x2556c5['value']),null);}else{var _0x2b58d3='%'+_0x2556c5[_0x7e3c('0x60')]+'%';_0x3bcc14[_0x479144](_0x7e3c('0x69'),_0x2b58d3,_0x2b58d3,_0x2b58d3);}}else{_0x4c4812=_['find'](_0x838faf,['name',_0x7e3c('0x6a')]);_0x2556c5[_0x7e3c('0x4b')]=_0x7e3c('0x6a');_0x4a34de=as[_0x7e3c('0x6b')](_0x782a5b,_0x4c4812[_0x7e3c('0x3b')],_0x2556c5);_0x3bcc14[_0x479144](_0x4a34de[_0x7e3c('0x6c')],_0x4a34de[_0x7e3c('0x60')][_0x7e3c('0x6d')],_0x4a34de[_0x7e3c('0x60')][_0x7e3c('0x2a')]);}break;case _0x7e3c('0x6e'):var _0x1e15be=_0x2556c5['value'][_0x7e3c('0x33')](',')['map'](function(_0x5ad043){return Number(_0x5ad043);});_0x1e15be[_0x7e3c('0x34')](function(_0x397e20){_0x501896['or'](_0x7e3c('0x6f'),'%,'+_0x397e20+',%');});_0x25bd87=_[_0x7e3c('0x70')](_0x25bd87,_0x1e15be);break;case _0x7e3c('0x71'):if(_0x2556c5[_0x7e3c('0x65')]==='$substring'){_0x3bcc14[_0x479144](_0x7e3c('0x72'),'%'+_0x2556c5['value']+'%',null);}else{_0x4c4812=_[_0x7e3c('0x5e')](_0x838faf,[_0x7e3c('0x2d'),_0x7e3c('0x73')]);_0x2556c5[_0x7e3c('0x4b')]=_0x7e3c('0x73');_0x4a34de=as[_0x7e3c('0x6b')](_0x782a5b,_0x4c4812[_0x7e3c('0x3b')],_0x2556c5);_0x3bcc14[_0x479144](_0x4a34de[_0x7e3c('0x6c')],_0x4a34de[_0x7e3c('0x60')][_0x7e3c('0x6d')],_0x4a34de['value'][_0x7e3c('0x2a')]);}break;case _0x7e3c('0x74'):_0x4a34de=as[_0x7e3c('0x6b')]('me',null,_0x2556c5);_0x3bcc14[_0x479144](_0x4a34de[_0x7e3c('0x6c')],_0x4a34de[_0x7e3c('0x60')][_0x7e3c('0x6d')],_0x4a34de['value']['end']);break;}}else{var _0x4a34de=as['buildExpression'](_0x782a5b,_0x4c4812['type'],_0x2556c5);_0x3bcc14[_0x479144](_0x4a34de[_0x7e3c('0x6c')],_0x4a34de[_0x7e3c('0x60')][_0x7e3c('0x6d')],_0x4a34de[_0x7e3c('0x60')][_0x7e3c('0x2a')]);}}}else{var _0x55a390=_(_0xae46cb['query'])[_0x7e3c('0x3f')]()[_0x7e3c('0x30')](function(_0xb41749){return _[_0x7e3c('0x75')](_0x838faf,[_0x7e3c('0x2d'),_0xb41749])?_0xb41749:undefined;})[_0x7e3c('0x76')]()[_0x7e3c('0x60')]();if(!_[_0x7e3c('0x77')](_0x55a390)){_0x55a390['forEach'](function(_0x2f13f9){if(_0x2f13f9==='OpenchannelAccountId'){_0x41f67c['where'](_0x7e3c('0x78'),[][_0x7e3c('0x79')](_0xae46cb[_0x7e3c('0x3e')][_0x2f13f9]));}else if(_0x2f13f9===_0x7e3c('0x7a')){var _0x5bb555=JSON[_0x7e3c('0x7b')](_0xae46cb[_0x7e3c('0x3e')][_0x2f13f9])[_0x7e3c('0x7c')];var _0x2d8d8b=JSON['parse'](_0xae46cb[_0x7e3c('0x3e')][_0x2f13f9])['$lte'];_0x41f67c[_0x7e3c('0x48')](_0x7e3c('0x7d'),_0x5bb555,_0x2d8d8b);}else{if(_0xae46cb['query'][_0x2f13f9]==='null'){_0x41f67c[_0x7e3c('0x48')]('i.'+_0x2f13f9+_0x7e3c('0x7e'));}else{_0x41f67c[_0x7e3c('0x48')]('i.'+_0x2f13f9+_0x7e3c('0x7f'),_0xae46cb[_0x7e3c('0x3e')][_0x2f13f9]);}}});}if(_0xae46cb[_0x7e3c('0x3e')][_0x7e3c('0x80')]){if(_0xae46cb[_0x7e3c('0x3e')][_0x7e3c('0x80')]==0x1){_0x41f67c['having']('`unreadMessages`\x20=\x200');}else{_0x41f67c[_0x7e3c('0x61')](_0x7e3c('0x81'));}}if(_0xae46cb['query'][_0x7e3c('0x82')]){_0x25bd87=_['isArray'](_0xae46cb[_0x7e3c('0x3e')][_0x7e3c('0x82')])?_0xae46cb[_0x7e3c('0x3e')][_0x7e3c('0x82')]:new Array(_0xae46cb['query']['tag']);_0x25bd87[_0x7e3c('0x34')](function(_0x29bff0){_0x501896['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29bff0+',%');});}if(_0xae46cb[_0x7e3c('0x3e')]['filter']){var _0x59c3d1=_0xae46cb[_0x7e3c('0x3e')][_0x7e3c('0x83')]['replace']('\x5c','\x5c\x5c')[_0x7e3c('0x84')](/'/g,'\x27\x27');if(qs[_0x7e3c('0x85')](_0x59c3d1)){_0x3bcc14['or']('i.id\x20LIKE\x20?',_0x59c3d1+'%');}else{_0x3bcc14['or'](_0x7e3c('0x86'),qs['getFullTextValue'](_0x59c3d1))['or']('i.from\x20LIKE\x20?',_0x59c3d1+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x59c3d1+'%');}}}_0x41f67c[_0x7e3c('0x48')](_0x3bcc14);_0x41f67c['group'](_0x7e3c('0x87'));var _0x1acb58={'type':db[_0x7e3c('0x88')][_0x7e3c('0x89')]['SELECT'],'raw':!![]};var _0x30111f=_0x41f67c['clone']();_0x30111f[_0x7e3c('0x4b')](_0x7e3c('0x87'));_0x30111f[_0x7e3c('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7e3c('0x5f'));if(_0x37de6d[_0x7e3c('0x8a')]){_0x37de6d[_0x7e3c('0x8a')][_0x7e3c('0x34')](function(_0x43f0c9){var _0x453adf=_0x43f0c9[0x0]===_0x7e3c('0x8b')?_0x43f0c9[0x0]:'i.'+_0x43f0c9[0x0];_0x41f67c[_0x7e3c('0x8a')](_0x453adf,_0x43f0c9[0x1]===_0x7e3c('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x25bd87)){_0x41f67c[_0x7e3c('0x61')](_0x501896);_0x30111f['where'](_0x7e3c('0x8d'),_0x25bd87);}BPromise['resolve']()['then'](function(){if(!_0x3a2fe0){if(_0xae46cb['query'][_0x7e3c('0x8e')])return;_0x30111f[_0x7e3c('0x48')](_0x7e3c('0x8f'));_0x41f67c[_0x7e3c('0x48')](_0x7e3c('0x8f'));return;}if(_0xae46cb[_0x7e3c('0x90')][_0x7e3c('0x91')]!=='agent')return;return _0xae46cb[_0x7e3c('0x90')][_0x7e3c('0x92')]({'attributes':['id'],'raw':!![]})[_0x7e3c('0x28')](function(_0x48b620){if(_['isEmpty'](_0x48b620)){_0x30111f[_0x7e3c('0x48')](_0x7e3c('0x93'));_0x41f67c[_0x7e3c('0x48')](_0x7e3c('0x93'));}else{_0x30111f['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0x7e3c('0x30')](_0x48b620,'id'));_0x41f67c[_0x7e3c('0x48')](_0x7e3c('0x78'),_[_0x7e3c('0x30')](_0x48b620,'id'));}});})[_0x7e3c('0x28')](function(){if(_0xae46cb[_0x7e3c('0x90')][_0x7e3c('0x91')]==='agent'&&!_0x3a2fe0&&!_0xae46cb[_0x7e3c('0x3e')][_0x7e3c('0x8e')])return[];return db[_0x7e3c('0x94')]['query'](_0x30111f[_0x7e3c('0x95')](),_0x1acb58);})[_0x7e3c('0x28')](function(_0x2a398){_0x102eb1[_0x7e3c('0x22')]=_0x2a398[_0x7e3c('0x44')];if(_0x102eb1[_0x7e3c('0x22')]===0x0)return[];return db[_0x7e3c('0x94')][_0x7e3c('0x3e')](_0x48bdfd[_0x7e3c('0x95')](),_0x1acb58)[_0x7e3c('0x28')](function(_0x1287d4){_0x2a2351=_['keyBy'](_0x1287d4,'id');_0x1acb58=_['merge'](_0x1acb58,{'model':db[_0x7e3c('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xae46cb[_0x7e3c('0x3e')][_0x7e3c('0x43')]){_0x37de6d[_0x7e3c('0x42')][_0x7e3c('0x34')](function(_0x4fc041){_0x41f67c[_0x7e3c('0x4b')]('i.'+_0x4fc041);});}else{_0x41f67c[_0x7e3c('0x4b')](_0x7e3c('0x96'),_0x7e3c('0x5f'));_0x41f67c['field'](_0x7e3c('0x97'),_0x7e3c('0x98'));_0x41f67c[_0x7e3c('0x4b')](_0x7e3c('0x99'),_0x7e3c('0x9a'));_0x41f67c[_0x7e3c('0x4b')]('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','contactName');_0x41f67c['field'](_0x7e3c('0x9b'));_0x41f67c['field'](_0x7e3c('0x9c'),'Contact.firstName');_0x41f67c[_0x7e3c('0x4b')](_0x7e3c('0x9d'),'Contact.lastName');_0x41f67c[_0x7e3c('0x4b')](_0x7e3c('0x9e'),_0x7e3c('0x9f'));_0x41f67c[_0x7e3c('0x4b')](_0x7e3c('0xa0'),'Contact.phone');_0x41f67c[_0x7e3c('0x4b')](_0x7e3c('0xa1'),_0x7e3c('0xa2'));_0x41f67c['field'](_0x7e3c('0xa3'),'Contact.fax');_0x41f67c[_0x7e3c('0x4b')](_0x7e3c('0xa4'),_0x7e3c('0xa5'));_0x41f67c[_0x7e3c('0x4b')](_0x7e3c('0xa6'),'Owner.internal');_0x41f67c['field'](_0x7e3c('0xa7'),_0x7e3c('0x32'));}if(_0x37de6d[_0x7e3c('0x24')])_0x41f67c[_0x7e3c('0x24')](_0x37de6d[_0x7e3c('0x24')]);if(_0x37de6d[_0x7e3c('0x23')])_0x41f67c[_0x7e3c('0x23')](_0x37de6d[_0x7e3c('0x23')]);return db['sequelize']['query'](_0x41f67c[_0x7e3c('0x95')](),_0x1acb58);})[_0x7e3c('0x28')](function(_0x2cbbbb){if(_0x2cbbbb[_0x7e3c('0x44')]>0x0)_0x2d0cb5['where'](_0x7e3c('0xa8'),_[_0x7e3c('0x30')](_0x2cbbbb,'id'));return db[_0x7e3c('0x94')]['query'](_0x2d0cb5[_0x7e3c('0x95')](),_0x1acb58)[_0x7e3c('0x28')](function(_0x137d7c){var _0x2a08e6=_[_0x7e3c('0xa9')](_0x137d7c,_0x7e3c('0xaa'));var _0x4b2f33=[];_0x2cbbbb[_0x7e3c('0x34')](function(_0x55f2d6){_0x4b2f33['push'](updateOpenchannelInteraction(_0x55f2d6,_0x2a2351,_0x2a08e6));});return BPromise[_0x7e3c('0xab')](_0x4b2f33);});});})[_0x7e3c('0x28')](function(_0x21ebc8){_0x102eb1[_0x7e3c('0xac')]=_0x21ebc8;return _0x102eb1;})['then'](respondWithFilteredResult(_0x46c27a,_0x37de6d))[_0x7e3c('0xad')](handleError(_0x46c27a,null));};exports['show']=function(_0xc95ac2,_0x3790b1){var _0x589a70={};if(_0xc95ac2[_0x7e3c('0x3e')][_0x7e3c('0x3b')]&&_0xc95ac2[_0x7e3c('0x3e')]['type']===_0x7e3c('0x4d')){_0x589a70[_0x7e3c('0x4d')]=_0xc95ac2[_0x7e3c('0xae')]['id'];}else{_0x589a70['id']=_0xc95ac2[_0x7e3c('0xae')]['id'];}var _0x38fb97={'raw':![],'where':_0x589a70},_0x2d0efe={};_0x2d0efe[_0x7e3c('0x3d')]=_[_0x7e3c('0x3f')](db[_0x7e3c('0x38')][_0x7e3c('0x39')]);_0x2d0efe[_0x7e3c('0x3e')]=_['keys'](_0xc95ac2[_0x7e3c('0x3e')]);_0x2d0efe[_0x7e3c('0x40')]=_[_0x7e3c('0x41')](_0x2d0efe[_0x7e3c('0x3d')],_0x2d0efe['query']);_0x38fb97[_0x7e3c('0x42')]=_[_0x7e3c('0x41')](_0x2d0efe['model'],qs['fields'](_0xc95ac2[_0x7e3c('0x3e')][_0x7e3c('0x43')]));_0x38fb97[_0x7e3c('0x42')]=_0x38fb97[_0x7e3c('0x42')][_0x7e3c('0x44')]?_0x38fb97['attributes']:_0x2d0efe[_0x7e3c('0x3d')];if(_0xc95ac2['query']['includeAll']){_0x38fb97[_0x7e3c('0xaf')]=[{'all':!![]}];}_0x38fb97=_[_0x7e3c('0xb0')]({},_0x38fb97,_0xc95ac2[_0x7e3c('0xb1')]);return db[_0x7e3c('0x38')][_0x7e3c('0x5e')](_0x38fb97)[_0x7e3c('0x28')](handleEntityNotFound(_0x3790b1,null))[_0x7e3c('0x28')](respondWithResult(_0x3790b1,null))[_0x7e3c('0xad')](handleError(_0x3790b1,null));};exports[_0x7e3c('0xb2')]=function(_0xcdc5a5,_0x37c7b7){return db['OpenchannelInteraction']['create'](_0xcdc5a5[_0x7e3c('0x74')],{})[_0x7e3c('0x28')](respondWithResult(_0x37c7b7,0xc9))[_0x7e3c('0xad')](handleError(_0x37c7b7,null));};exports[_0x7e3c('0xb3')]=function(_0x3f4570,_0x199968){if(_0x3f4570[_0x7e3c('0x74')]['id']){delete _0x3f4570['body']['id'];}return db['OpenchannelInteraction'][_0x7e3c('0x5e')]({'where':{'id':_0x3f4570['params']['id']}})[_0x7e3c('0x28')](handleEntityNotFound(_0x199968,null))[_0x7e3c('0x28')](saveUpdates(_0x3f4570[_0x7e3c('0x74')],null))[_0x7e3c('0x28')](respondWithResult(_0x199968,null))[_0x7e3c('0xad')](handleError(_0x199968,null));};exports[_0x7e3c('0x29')]=function(_0xe5826c,_0x4dbaa5){return db[_0x7e3c('0x38')][_0x7e3c('0x5e')]({'where':{'id':_0xe5826c['params']['id']}})[_0x7e3c('0x28')](handleEntityNotFound(_0x4dbaa5,null))[_0x7e3c('0x28')](removeEntity(_0x4dbaa5,null))[_0x7e3c('0xad')](handleError(_0x4dbaa5,null));};exports['describe']=function(_0x2e633a,_0x237f4e){return db['OpenchannelInteraction'][_0x7e3c('0xb4')]()[_0x7e3c('0x28')](respondWithResult(_0x237f4e,null))[_0x7e3c('0xad')](handleError(_0x237f4e,null));};exports[_0x7e3c('0xb5')]=function(_0x415fc3,_0x1fe424,_0x276fd1){return db[_0x7e3c('0xb6')][_0x7e3c('0x5e')]({'where':{'id':_0x415fc3['params']['id']}})['then'](handleEntityNotFound(_0x1fe424,null))[_0x7e3c('0x28')](function(_0x467764){if(_0x467764){return _0x467764[_0x7e3c('0xb5')](_0x415fc3[_0x7e3c('0x74')][_0x7e3c('0xb7')],_['omit'](_0x415fc3[_0x7e3c('0x74')],[_0x7e3c('0xb7'),'id'])||{});}})[_0x7e3c('0x28')](respondWithResult(_0x1fe424,null))[_0x7e3c('0xad')](handleError(_0x1fe424,null));};exports['getMessages']=function(_0x71551c,_0x5dc7a2,_0x5187ae){var _0x344537={'raw':![],'where':{}};var _0x22b235={};var _0x358fb2={'count':0x0,'rows':[]};return db[_0x7e3c('0x38')][_0x7e3c('0xb8')]({'where':{'id':_0x71551c[_0x7e3c('0xae')]['id']}})[_0x7e3c('0x28')](handleEntityNotFound(_0x5dc7a2,null))[_0x7e3c('0x28')](function(_0x1e87ed){if(_0x1e87ed){_0x22b235[_0x7e3c('0x3d')]=_[_0x7e3c('0x3f')](db[_0x7e3c('0xb6')][_0x7e3c('0x39')]);_0x22b235[_0x7e3c('0x3e')]=_[_0x7e3c('0x3f')](_0x71551c[_0x7e3c('0x3e')]);_0x22b235[_0x7e3c('0x40')]=_[_0x7e3c('0x41')](_0x22b235[_0x7e3c('0x3d')],_0x22b235[_0x7e3c('0x3e')]);_0x344537[_0x7e3c('0x42')]=_[_0x7e3c('0x41')](_0x22b235[_0x7e3c('0x3d')],qs[_0x7e3c('0x43')](_0x71551c[_0x7e3c('0x3e')][_0x7e3c('0x43')]));_0x344537[_0x7e3c('0x42')]=_0x344537[_0x7e3c('0x42')][_0x7e3c('0x44')]?_0x344537[_0x7e3c('0x42')]:_0x22b235['model'];if(!_0x71551c['query']['hasOwnProperty'](_0x7e3c('0x46'))){_0x344537[_0x7e3c('0x24')]=qs[_0x7e3c('0x24')](_0x71551c['query'][_0x7e3c('0x24')]);_0x344537[_0x7e3c('0x23')]=qs[_0x7e3c('0x23')](_0x71551c[_0x7e3c('0x3e')][_0x7e3c('0x23')]);}_0x344537[_0x7e3c('0x8a')]=qs['sort'](_0x71551c['query'][_0x7e3c('0x47')]);_0x344537[_0x7e3c('0x48')]=qs['filters'](_['pick'](_0x71551c[_0x7e3c('0x3e')],_0x22b235['filters']));_0x344537[_0x7e3c('0x48')][_0x7e3c('0xaa')]=_0x1e87ed['id'];if(_0x71551c['query'][_0x7e3c('0x83')]){_0x344537['where']=_[_0x7e3c('0xb0')](_0x344537[_0x7e3c('0x48')],{'$or':_[_0x7e3c('0x30')](_0x344537[_0x7e3c('0x42')],function(_0x3fa4c7){var _0x3d3de9={};_0x3d3de9[_0x3fa4c7]={'$like':'%'+_0x71551c[_0x7e3c('0x3e')][_0x7e3c('0x83')]+'%'};return _0x3d3de9;})});}if(_0x71551c[_0x7e3c('0x3e')][_0x7e3c('0x7c')]){var _0xfb9b3a=_0x71551c[_0x7e3c('0x3e')]['$gte'][_0x7e3c('0x33')](',');var _0x4d9172={};_0x4d9172[_0xfb9b3a[0x0]]={'$gte':moment(_0xfb9b3a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x344537['where']=_[_0x7e3c('0xb0')](_0x344537['where'],_0x4d9172);}_0x344537=_['merge']({},_0x344537,_0x71551c[_0x7e3c('0xb1')]);return db[_0x7e3c('0xb6')][_0x7e3c('0x22')]({'where':_0x344537['where']})['then'](function(_0x523e4c){_0x358fb2['count']=_0x523e4c;if(_0x71551c[_0x7e3c('0x3e')]['includeAll']){_0x344537[_0x7e3c('0xaf')]=[{'all':!![]}];}return db[_0x7e3c('0xb6')][_0x7e3c('0xb9')](_0x344537);})[_0x7e3c('0x28')](function(_0x568d8b){_0x358fb2[_0x7e3c('0xac')]=_0x568d8b;return _0x358fb2;});}})['then'](respondWithFilteredResult(_0x5dc7a2,_0x344537))[_0x7e3c('0xad')](handleError(_0x5dc7a2,null));};exports['addTags']=function(_0x1a2284,_0x581c69,_0x5addf6){return db[_0x7e3c('0x38')][_0x7e3c('0x5e')]({'where':{'id':_0x1a2284[_0x7e3c('0xae')]['id']}})[_0x7e3c('0x28')](handleEntityNotFound(_0x581c69,null))['then'](function(_0x46fa1b){if(_0x46fa1b){return _0x46fa1b[_0x7e3c('0xba')](_0x1a2284[_0x7e3c('0x74')][_0x7e3c('0xb7')],_[_0x7e3c('0xbb')](_0x1a2284[_0x7e3c('0x74')],[_0x7e3c('0xb7'),'id'])||{})[_0x7e3c('0xbc')](function(){return db[_0x7e3c('0x6e')][_0x7e3c('0xb9')]({'attributes':['id',_0x7e3c('0x2d'),_0x7e3c('0x4c')],'where':{'id':_0x1a2284[_0x7e3c('0x74')][_0x7e3c('0xb7')]}});})[_0x7e3c('0x28')](function(_0x583d71){socket[_0x7e3c('0xbd')](_0x7e3c('0xbe'),{'id':Number(_0x1a2284[_0x7e3c('0xae')]['id']),'tags':_0x583d71||[]});return{'id':Number(_0x1a2284['params']['id']),'tags':_0x583d71||[]};});}})['then'](respondWithResult(_0x581c69,null))[_0x7e3c('0xad')](handleError(_0x581c69,null));};exports[_0x7e3c('0xbf')]=function(_0x2b6990,_0x41ca15,_0x134739){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2b6990[_0x7e3c('0xae')]['id']}})[_0x7e3c('0x28')](handleEntityNotFound(_0x41ca15,null))[_0x7e3c('0x28')](function(_0x51a5f5){if(_0x51a5f5){return _0x51a5f5[_0x7e3c('0xbf')](_0x2b6990[_0x7e3c('0x3e')][_0x7e3c('0xb7')]);}})[_0x7e3c('0x28')](respondWithStatusCode(_0x41ca15,null))[_0x7e3c('0xad')](handleError(_0x41ca15,null));};exports[_0x7e3c('0xc0')]=function(_0x1a0188,_0x4cd6c7){var _0x5a0f13=moment()[_0x7e3c('0xc1')]()['toString']();var _0x5e9389=path[_0x7e3c('0xc2')](config[_0x7e3c('0xc3')],'server','files',_0x7e3c('0xc4'));var _0xf25b11=path['join'](config[_0x7e3c('0xc3')],_0x7e3c('0xc5'),_0x7e3c('0xc6'),_0x7e3c('0xc7'));var _0x53f6f0=path['join'](_0x5e9389,_0x5a0f13);var _0xb33420=util[_0x7e3c('0xc8')](_0x7e3c('0xc9'),_0x1a0188[_0x7e3c('0xae')]['id'],_0x5a0f13);var _0x441331=path[_0x7e3c('0xc2')](_0x5e9389,_0xb33420);var _0x229dca=[];_0x229dca['push']({'model':db[_0x7e3c('0x71')],'as':_0x7e3c('0x71'),'attributes':['id','fullname'],'raw':!![]});_0x229dca[_0x7e3c('0x36')]({'model':db[_0x7e3c('0xca')],'as':_0x7e3c('0x64'),'attributes':['id',_0x7e3c('0xcb'),_0x7e3c('0xcc')],'raw':!![]});if(_0x1a0188[_0x7e3c('0x3e')][_0x7e3c('0xc7')]){_0x229dca['push']({'model':db[_0x7e3c('0xcd')],'as':'Attachment','raw':!![]});}var _0x4a2532=[{'model':db[_0x7e3c('0xb6')],'as':'Messages','attributes':['id','body',_0x7e3c('0x7a'),_0x7e3c('0xce'),_0x7e3c('0xcf'),_0x7e3c('0x80')],'include':_0x229dca}];_0x4a2532['push']({'model':db[_0x7e3c('0xd0')],'as':_0x7e3c('0xd1'),'attributes':['id','name']});_0x4a2532['push']({'model':db[_0x7e3c('0x71')],'as':_0x7e3c('0xd2'),'attributes':['id','fullname']});return db[_0x7e3c('0x38')][_0x7e3c('0x5e')]({'where':{'id':_0x1a0188['params']['id']},'include':_0x4a2532})[_0x7e3c('0x28')](handleEntityNotFound(_0x4cd6c7,null))[_0x7e3c('0x28')](function(_0x58fdec){if(_0x58fdec){var _0x2f8096=_0x58fdec[_0x7e3c('0xd3')]({'plain':!![]});fs[_0x7e3c('0xd4')](_0x53f6f0);var _0x3b4caa={'channel':_0x7e3c('0xd5'),'account':_0x2f8096[_0x7e3c('0xd1')][_0x7e3c('0x2d')],'agent':_0x2f8096[_0x7e3c('0xd2')]?_0x2f8096[_0x7e3c('0xd2')][_0x7e3c('0x31')]:_0x7e3c('0xd6'),'createdAt':moment(_0x2f8096[_0x7e3c('0x7a')])[_0x7e3c('0xc8')](_0x7e3c('0xd7'))[_0x7e3c('0x95')](),'closedAt':_0x2f8096['closed']?moment(_0x2f8096[_0x7e3c('0xd8')])['format'](_0x7e3c('0xd7'))[_0x7e3c('0x95')]():'','disposition':_0x2f8096[_0x7e3c('0xd9')],'visibility':_0x2f8096[_0x7e3c('0xda')]?_0x7e3c('0xdb'):_0x7e3c('0xdc'),'messages':_(_0x2f8096[_0x7e3c('0xdd')])['filter']({'secret':![]})[_0x7e3c('0x30')](function(_0x553546){if(_0x553546[_0x7e3c('0xcd')]){var _0x25c0d9=path['join'](_0xf25b11,_0x553546[_0x7e3c('0xcd')][_0x7e3c('0xde')]);if(fs['existsSync'](_0x25c0d9)){fs[_0x7e3c('0xdf')](_0x25c0d9)[_0x7e3c('0xe0')](fs['createWriteStream'](path[_0x7e3c('0xc2')](_0x53f6f0,_0x553546['Attachment'][_0x7e3c('0xde')])));}}return{'date':moment(_0x553546[_0x7e3c('0x7a')])['format'](_0x7e3c('0xd7'))[_0x7e3c('0x95')](),'sender':_0x553546[_0x7e3c('0xce')]===_0x7e3c('0xe1')?_0x553546['User']?_0x553546[_0x7e3c('0x71')][_0x7e3c('0x31')]:_0x7e3c('0xe2'):_0x553546['Contact'][_0x7e3c('0xcb')]+(_0x553546[_0x7e3c('0x64')][_0x7e3c('0xcc')]?'\x20'+_0x553546[_0x7e3c('0x64')][_0x7e3c('0xcc')]:''),'body':_0x553546['Attachment']?_0x553546[_0x7e3c('0xcd')][_0x7e3c('0xde')]:_0x553546['body'],'direction':_0x553546[_0x7e3c('0xce')]===_0x7e3c('0xe1')?'A':'C','secret':_0x553546[_0x7e3c('0xcf')],'read':_0x553546[_0x7e3c('0x80')],'attachment':_0x553546['Attachment']};})[_0x7e3c('0x60')]()};return ejs[_0x7e3c('0xe3')](path[_0x7e3c('0xc2')](config['root'],_0x7e3c('0xc5'),_0x7e3c('0xe4'),_0x7e3c('0xe5')),{'interaction':_0x3b4caa})[_0x7e3c('0x28')](function(_0x3341f6){var _0x53d042=path[_0x7e3c('0xc2')](_0x53f6f0,_0x7e3c('0xe6')+_0x2f8096['id']+'-'+_0x5a0f13+_0x7e3c('0xe7'));var _0x2e2324={'path':_0x53d042,'channel':_0x7e3c('0xd5'),'interactionId':_0x2f8096['id']};return pdf[_0x7e3c('0xe8')](_0x3341f6,_0x2e2324);})[_0x7e3c('0x28')](function(){return new BPromise(function(_0x26d15a,_0x112547){zipdir(_0x53f6f0,{'saveTo':_0x441331},function(_0x41a3b0,_0x5ad23b){if(_0x41a3b0)return _0x112547(_0x41a3b0);return _0x26d15a(_0x5ad23b);});})[_0x7e3c('0x28')](function(){return new BPromise(function(_0x2c1014,_0x383d15){rimraf(_0x53f6f0,function(_0x542394){if(_0x542394)_0x383d15(_0x542394);return _0x2c1014();});});})[_0x7e3c('0x28')](function(){return _0x4cd6c7[_0x7e3c('0xc0')](_0x441331,_0xb33420,function(_0x5e0a8a){if(_0x5e0a8a){console[_0x7e3c('0xe9')](_0x7e3c('0xea'),_0x5e0a8a);}else{fs[_0x7e3c('0xeb')](_0x441331);}});});});}else{return _0x4cd6c7[_0x7e3c('0x2b')](0xc8);}})[_0x7e3c('0xad')](handleError(_0x4cd6c7,null));};
\ No newline at end of file
index 6814fcd..630197d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdec0=['hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit','catch'];(function(_0x1dc24a,_0x241c42){var _0x344d57=function(_0x130be9){while(--_0x130be9){_0x1dc24a['push'](_0x1dc24a['shift']());}};_0x344d57(++_0x241c42);}(_0xdec0,0x69));var _0x0dec=function(_0x5a4b42,_0x2b9c18){_0x5a4b42=_0x5a4b42-0x0;var _0x5e81d6=_0xdec0[_0x5a4b42];return _0x5e81d6;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x0dec('0x0'))['db'][_0x0dec('0x1')];var OpenchannelMessage=require(_0x0dec('0x0'))['db'][_0x0dec('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0dec('0x3'),'afterUpdate':'update','afterDestroy':_0x0dec('0x4')};function emitEvent(_0x3c02d5){return function(_0x18b029,_0x2437ce,_0x51811d){_0x18b029[_0x0dec('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x46d919){_0x18b029['setDataValue'](_0x0dec('0x6'),_0x46d919[_0x0dec('0x7')](function(_0x25ded4){return{'id':_0x25ded4['id']};}));return OpenchannelMessage[_0x0dec('0x8')]({'where':{'OpenchannelInteractionId':_0x18b029['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0dec('0x9')](function(_0x85e740){_0x18b029[_0x0dec('0xa')](_0x0dec('0xb'),_0x85e740['length']);OpenchannelInteractionEvents['emit'](_0x3c02d5+':'+_0x18b029['id'],_0x18b029);OpenchannelInteractionEvents[_0x0dec('0xc')](_0x3c02d5,_0x18b029);_0x51811d(null);})[_0x0dec('0xd')](_0x51811d(null));};}for(var e in events){if(events[_0x0dec('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x0dec('0xf')](e,emitEvent(event));}}module[_0x0dec('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xcf34=['remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update'];(function(_0x17fbf0,_0x414860){var _0x352a30=function(_0x2d9795){while(--_0x2d9795){_0x17fbf0['push'](_0x17fbf0['shift']());}};_0x352a30(++_0x414860);}(_0xcf34,0xc6));var _0x4cf3=function(_0x5de818,_0x7c4485){_0x5de818=_0x5de818-0x0;var _0x345670=_0xcf34[_0x5de818];return _0x345670;};'use strict';var EventEmitter=require(_0x4cf3('0x0'));var OpenchannelInteraction=require(_0x4cf3('0x1'))['db'][_0x4cf3('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x4cf3('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x4cf3('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4cf3('0x5'),'afterDestroy':_0x4cf3('0x6')};function emitEvent(_0x548398){return function(_0x33a644,_0x4660b3,_0x289a02){_0x33a644[_0x4cf3('0x7')]({'attributes':['id'],'raw':!![]})[_0x4cf3('0x8')](function(_0x3c0222){_0x33a644[_0x4cf3('0x9')]('Users',_0x3c0222[_0x4cf3('0xa')](function(_0x11800b){return{'id':_0x11800b['id']};}));return OpenchannelMessage[_0x4cf3('0xb')]({'where':{'OpenchannelInteractionId':_0x33a644['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4e1e04){_0x33a644['setDataValue'](_0x4cf3('0xc'),_0x4e1e04['length']);OpenchannelInteractionEvents[_0x4cf3('0xd')](_0x548398+':'+_0x33a644['id'],_0x33a644);OpenchannelInteractionEvents[_0x4cf3('0xd')](_0x548398,_0x33a644);_0x289a02(null);})[_0x4cf3('0xe')](_0x289a02(null));};}for(var e in events){if(events[_0x4cf3('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x4cf3('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 8451a74..20a67e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb0e=['rimraf','exports','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x48ac17,_0x1147b5){var _0x12c118=function(_0x1b9bdc){while(--_0x1b9bdc){_0x48ac17['push'](_0x48ac17['shift']());}};_0x12c118(++_0x1147b5);}(_0xbb0e,0x1e9));var _0xebb0=function(_0xc13b59,_0x19c7ca){_0xc13b59=_0xc13b59-0x0;var _0x1d6d4a=_0xbb0e[_0xc13b59];return _0x1d6d4a;};'use strict';var _=require('lodash');var util=require(_0xebb0('0x0'));var logger=require(_0xebb0('0x1'))(_0xebb0('0x2'));var moment=require(_0xebb0('0x3'));var BPromise=require(_0xebb0('0x4'));var rp=require(_0xebb0('0x5'));var fs=require('fs');var path=require(_0xebb0('0x6'));var rimraf=require(_0xebb0('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xebb0('0x8')]=function(_0xebb6a2,_0x83dff7){return _0xebb6a2['define']('OpenchannelInteraction',attributes,{'tableName':_0xebb0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xebb0('0xa'),'collate':_0xebb0('0xb'),'hooks':{'beforeUpdate':function(_0x35466d,_0x2b192b,_0x33efbc){if(_0x35466d['changed'](_0xebb0('0xc'))){_0x35466d[_0xebb0('0xd')]=moment()[_0xebb0('0xe')](_0xebb0('0xf'));}_0x33efbc(null,_0x35466d);}}});};
\ No newline at end of file
+var _0xaf37=['../../config/logger','api','bluebird','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xaf37,0xa1));var _0x7af3=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0xaf37[_0x383356];return _0x32ee5a;};'use strict';var _=require('lodash');var util=require(_0x7af3('0x0'));var logger=require(_0x7af3('0x1'))(_0x7af3('0x2'));var moment=require('moment');var BPromise=require(_0x7af3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7af3('0x4'));var rimraf=require('rimraf');var config=require(_0x7af3('0x5'));var attributes=require(_0x7af3('0x6'));module[_0x7af3('0x7')]=function(_0x50af37,_0x466dd2){return _0x50af37[_0x7af3('0x8')](_0x7af3('0x9'),attributes,{'tableName':_0x7af3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7af3('0xb'),'collate':_0x7af3('0xc'),'hooks':{'beforeUpdate':function(_0x39a2ca,_0x1131de,_0x12f388){if(_0x39a2ca[_0x7af3('0xd')](_0x7af3('0xe'))){_0x39a2ca[_0x7af3('0xf')]=moment()[_0x7af3('0x10')](_0x7af3('0x11'));}_0x12f388(null,_0x39a2ca);}}});};
\ No newline at end of file
index af37176..14b0aff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28dd=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','update','body','options','raw','where','attributes','limit','then','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','util'];(function(_0x317847,_0x444ab6){var _0x2ef1f4=function(_0x19f5ab){while(--_0x19f5ab){_0x317847['push'](_0x317847['shift']());}};_0x2ef1f4(++_0x444ab6);}(_0x28dd,0x125));var _0xd28d=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0x28dd[_0xfb42e6];return _0x27265b;};'use strict';var _=require('lodash');var util=require(_0xd28d('0x0'));var moment=require(_0xd28d('0x1'));var BPromise=require(_0xd28d('0x2'));var rs=require(_0xd28d('0x3'));var fs=require('fs');var Redis=require(_0xd28d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd28d('0x5'));var logger=require(_0xd28d('0x6'))('rpc');var config=require(_0xd28d('0x7'));var jayson=require(_0xd28d('0x8'));var client=jayson[_0xd28d('0x9')][_0xd28d('0xa')]({'port':0x232a});config[_0xd28d('0xb')]=_[_0xd28d('0xc')](config[_0xd28d('0xb')],{'host':_0xd28d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd28d('0xb')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x98098d,_0x2386ba,_0x32b426){return new BPromise(function(_0x555549,_0x5ae686){return client[_0xd28d('0xe')](_0x98098d,_0x32b426)['then'](function(_0x29c7e6){logger[_0xd28d('0xf')](_0xd28d('0x10'),_0x2386ba,_0xd28d('0x11'));logger[_0xd28d('0x12')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x2386ba,_0xd28d('0x11'),JSON[_0xd28d('0x13')](_0x29c7e6));if(_0x29c7e6[_0xd28d('0x14')]){if(_0x29c7e6[_0xd28d('0x14')][_0xd28d('0x15')]===0x1f4){logger['error'](_0xd28d('0x10'),_0x2386ba,_0x29c7e6['error'][_0xd28d('0x16')]);return _0x5ae686(_0x29c7e6[_0xd28d('0x14')]['message']);}logger[_0xd28d('0x14')](_0xd28d('0x10'),_0x2386ba,_0x29c7e6['error'][_0xd28d('0x16')]);return _0x555549(_0x29c7e6['error'][_0xd28d('0x16')]);}else{logger[_0xd28d('0xf')](_0xd28d('0x10'),_0x2386ba,_0xd28d('0x11'));_0x555549(_0x29c7e6[_0xd28d('0x17')][_0xd28d('0x16')]);}})[_0xd28d('0x18')](function(_0x36d6aa){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x2386ba,_0x36d6aa);_0x5ae686(_0x36d6aa);});});}exports['UpdateOpenchannelInteraction']=function(_0x4d0544){var _0x152411=this;return new Promise(function(_0x1e3c3d,_0x31e612){return db['OpenchannelInteraction'][_0xd28d('0x19')](_0x4d0544[_0xd28d('0x1a')],{'raw':_0x4d0544[_0xd28d('0x1b')]?_0x4d0544[_0xd28d('0x1b')][_0xd28d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d0544[_0xd28d('0x1b')]?_0x4d0544[_0xd28d('0x1b')][_0xd28d('0x1d')]||null:null,'attributes':_0x4d0544[_0xd28d('0x1b')]?_0x4d0544['options'][_0xd28d('0x1e')]||null:null,'limit':_0x4d0544[_0xd28d('0x1b')]?_0x4d0544[_0xd28d('0x1b')][_0xd28d('0x1f')]||null:null})[_0xd28d('0x20')](function(_0x4c8f46){logger['info'](_0xd28d('0x21'),_0x4d0544);logger[_0xd28d('0x12')](_0xd28d('0x21'),_0x4d0544,JSON[_0xd28d('0x13')](_0x4c8f46));_0x1e3c3d(_0x4c8f46);})[_0xd28d('0x18')](function(_0x10a718){logger[_0xd28d('0x14')](_0xd28d('0x21'),_0x10a718[_0xd28d('0x16')],_0x4d0544);_0x31e612(_0x152411[_0xd28d('0x14')](0x1f4,_0x10a718[_0xd28d('0x16')]));});});};exports[_0xd28d('0x22')]=function(_0x52c0b3){return new Promise(function(_0x5e8b1c,_0x5ead1c){return db[_0xd28d('0x23')][_0xd28d('0x24')]({'where':_0x52c0b3[_0xd28d('0x1b')]?_0x52c0b3[_0xd28d('0x1b')][_0xd28d('0x1d')]||null:null})[_0xd28d('0x20')](function(_0x59c9da){if(_0x59c9da){return _0x59c9da[_0xd28d('0x25')](_0x52c0b3['body'][_0xd28d('0x26')],_[_0xd28d('0x27')](_0x52c0b3[_0xd28d('0x1a')],[_0xd28d('0x26'),'id'])||{});}})[_0xd28d('0x28')](function(_0x28800a){logger[_0xd28d('0xf')](_0xd28d('0x29'),_0x52c0b3);logger['debug'](_0xd28d('0x29'),_0x52c0b3,JSON[_0xd28d('0x13')](_0x28800a));_0x5e8b1c(_0x28800a);})[_0xd28d('0x18')](function(_0x556e49){logger[_0xd28d('0x14')](_0xd28d('0x29'),_0x556e49[_0xd28d('0x16')],_0x52c0b3);_0x5ead1c(_this[_0xd28d('0x14')](0x1f4,_0x556e49['message']));});});};
\ No newline at end of file
+var _0xb859=['../../config/logger','rpc','../../config/environment','http','redis','localhost','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','stringify','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','AddTags','lodash','bluebird','ioredis','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb859,0x16e));var _0x9b85=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0xb859[_0xd73d53];return _0x560148;};'use strict';var _=require(_0x9b85('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b85('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b85('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b85('0x3'));var logger=require(_0x9b85('0x4'))(_0x9b85('0x5'));var config=require(_0x9b85('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9b85('0x7')]({'port':0x232a});config[_0x9b85('0x8')]=_['defaults'](config[_0x9b85('0x8')],{'host':_0x9b85('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b85('0x8')]));require(_0x9b85('0xa'))[_0x9b85('0xb')](socket);function respondWithRpcPromise(_0x132a0f,_0x342ec6,_0x2d873a){return new BPromise(function(_0x15d029,_0x4de979){return client[_0x9b85('0xc')](_0x132a0f,_0x2d873a)[_0x9b85('0xd')](function(_0x211ae9){logger['info'](_0x9b85('0xe'),_0x342ec6,_0x9b85('0xf'));logger['debug'](_0x9b85('0x10'),_0x342ec6,'request\x20sent',JSON['stringify'](_0x211ae9));if(_0x211ae9[_0x9b85('0x11')]){if(_0x211ae9[_0x9b85('0x11')][_0x9b85('0x12')]===0x1f4){logger[_0x9b85('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x342ec6,_0x211ae9[_0x9b85('0x11')][_0x9b85('0x13')]);return _0x4de979(_0x211ae9[_0x9b85('0x11')]['message']);}logger['error'](_0x9b85('0xe'),_0x342ec6,_0x211ae9['error']['message']);return _0x15d029(_0x211ae9[_0x9b85('0x11')]['message']);}else{logger[_0x9b85('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x342ec6,_0x9b85('0xf'));_0x15d029(_0x211ae9[_0x9b85('0x15')][_0x9b85('0x13')]);}})['catch'](function(_0x50ac45){logger[_0x9b85('0x11')](_0x9b85('0xe'),_0x342ec6,_0x50ac45);_0x4de979(_0x50ac45);});});}exports[_0x9b85('0x16')]=function(_0x2ac0f4){var _0x182fca=this;return new Promise(function(_0x3c0e1b,_0x1bb7f4){return db[_0x9b85('0x17')]['update'](_0x2ac0f4[_0x9b85('0x18')],{'raw':_0x2ac0f4['options']?_0x2ac0f4[_0x9b85('0x19')][_0x9b85('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ac0f4[_0x9b85('0x19')]?_0x2ac0f4[_0x9b85('0x19')][_0x9b85('0x1b')]||null:null,'attributes':_0x2ac0f4['options']?_0x2ac0f4[_0x9b85('0x19')][_0x9b85('0x1c')]||null:null,'limit':_0x2ac0f4[_0x9b85('0x19')]?_0x2ac0f4[_0x9b85('0x19')]['limit']||null:null})['then'](function(_0x446e3c){logger[_0x9b85('0x14')]('UpdateOpenchannelInteraction',_0x2ac0f4);logger['debug']('UpdateOpenchannelInteraction',_0x2ac0f4,JSON[_0x9b85('0x1d')](_0x446e3c));_0x3c0e1b(_0x446e3c);})[_0x9b85('0x1e')](function(_0x2c64f0){logger[_0x9b85('0x11')](_0x9b85('0x16'),_0x2c64f0['message'],_0x2ac0f4);_0x1bb7f4(_0x182fca[_0x9b85('0x11')](0x1f4,_0x2c64f0[_0x9b85('0x13')]));});});};exports[_0x9b85('0x1f')]=function(_0x4832a6){return new Promise(function(_0x2edc08,_0xcb7300){return db['OpenchannelInteraction'][_0x9b85('0x20')]({'where':_0x4832a6[_0x9b85('0x19')]?_0x4832a6[_0x9b85('0x19')][_0x9b85('0x1b')]||null:null})[_0x9b85('0xd')](function(_0x5a3359){if(_0x5a3359){return _0x5a3359[_0x9b85('0x21')](_0x4832a6[_0x9b85('0x18')][_0x9b85('0x22')],_[_0x9b85('0x23')](_0x4832a6[_0x9b85('0x18')],[_0x9b85('0x22'),'id'])||{});}})['spread'](function(_0x3fba66){logger['info'](_0x9b85('0x24'),_0x4832a6);logger['debug'](_0x9b85('0x24'),_0x4832a6,JSON[_0x9b85('0x1d')](_0x3fba66));_0x2edc08(_0x3fba66);})['catch'](function(_0x2fe974){logger[_0x9b85('0x11')](_0x9b85('0x24'),_0x2fe974[_0x9b85('0x13')],_0x4832a6);_0xcb7300(_this[_0x9b85('0x11')](0x1f4,_0x2fe974[_0x9b85('0x13')]));});});};
\ No newline at end of file
index 12a3a22..927e533 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d85=['length','./openchannelInteraction.events','emit','removeListener'];(function(_0x5e2f6f,_0x5f3a14){var _0x58881f=function(_0x40bedd){while(--_0x40bedd){_0x5e2f6f['push'](_0x5e2f6f['shift']());}};_0x58881f(++_0x5f3a14);}(_0x6d85,0x181));var _0x56d8=function(_0x2aa64f,_0x473331){_0x2aa64f=_0x2aa64f-0x0;var _0x2bb671=_0x6d85[_0x2aa64f];return _0x2bb671;};'use strict';var OpenchannelInteractionEvents=require(_0x56d8('0x0'));var events=['save','remove','update'];function createListener(_0x2f5bcf,_0x28888c){return function(_0x4c813b){_0x28888c[_0x56d8('0x1')](_0x2f5bcf,_0x4c813b);};}function removeListener(_0x1d8fdc,_0x3e71d3){return function(){OpenchannelInteractionEvents[_0x56d8('0x2')](_0x1d8fdc,_0x3e71d3);};}exports['register']=function(_0x200041){for(var _0x1c9bf8=0x0,_0xdf0f9d=events[_0x56d8('0x3')];_0x1c9bf8<_0xdf0f9d;_0x1c9bf8++){var _0x46fd64=events[_0x1c9bf8];var _0xe1efcc=createListener('openchannelInteraction:'+_0x46fd64,_0x200041);OpenchannelInteractionEvents['on'](_0x46fd64,_0xe1efcc);}};
\ No newline at end of file
+var _0x69e7=['emit','removeListener','length','openchannelInteraction:','save','update'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x69e7,0x124));var _0x769e=function(_0x1f2461,_0xefc187){_0x1f2461=_0x1f2461-0x0;var _0x38ad6a=_0x69e7[_0x1f2461];return _0x38ad6a;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x769e('0x0'),'remove',_0x769e('0x1')];function createListener(_0x569521,_0x47dc97){return function(_0x27b089){_0x47dc97[_0x769e('0x2')](_0x569521,_0x27b089);};}function removeListener(_0x1216d7,_0x29e5ab){return function(){OpenchannelInteractionEvents[_0x769e('0x3')](_0x1216d7,_0x29e5ab);};}exports['register']=function(_0x10566b){for(var _0x147c09=0x0,_0x57764d=events[_0x769e('0x4')];_0x147c09<_0x57764d;_0x147c09++){var _0x420ebf=events[_0x147c09];var _0x368ee5=createListener(_0x769e('0x5')+_0x420ebf,_0x10566b);OpenchannelInteractionEvents['on'](_0x420ebf,_0x368ee5);}};
\ No newline at end of file
index 79901de..b7d5e9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x2ab95b,_0x185905){var _0x3d3458=function(_0x244de5){while(--_0x244de5){_0x2ab95b['push'](_0x2ab95b['shift']());}};_0x3d3458(++_0x185905);}(_0xedd9,0xfc));var _0x9edd=function(_0x2678ab,_0x1a3c31){_0x2678ab=_0x2678ab-0x0;var _0x4c3ca0=_0xedd9[_0x2678ab];return _0x4c3ca0;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router;
\ No newline at end of file
index a0a0203..3c38a27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa45c=['TEXT','sequelize','exports','BOOLEAN','ENUM','out'];(function(_0x26f89a,_0x18dda0){var _0x11b07a=function(_0x552aeb){while(--_0x552aeb){_0x26f89a['push'](_0x26f89a['shift']());}};_0x11b07a(++_0x18dda0);}(_0xa45c,0x6d));var _0xca45=function(_0xb0fd4b,_0x163e4c){_0xb0fd4b=_0xb0fd4b-0x0;var _0x5ca7eb=_0xa45c[_0xb0fd4b];return _0x5ca7eb;};'use strict';var Sequelize=require(_0xca45('0x0'));module[_0xca45('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xca45('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xca45('0x3')]('in','out'),'defaultValue':_0xca45('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xca45('0x5')]}};
\ No newline at end of file
+var _0x34b7=['BOOLEAN','ENUM','out','STRING','TEXT','medium'];(function(_0x33efb8,_0x329950){var _0x8c14be=function(_0x4bc89e){while(--_0x4bc89e){_0x33efb8['push'](_0x33efb8['shift']());}};_0x8c14be(++_0x329950);}(_0x34b7,0x196));var _0x734b=function(_0x3c8d6c,_0x51ae3a){_0x3c8d6c=_0x3c8d6c-0x0;var _0x146521=_0x34b7[_0x3c8d6c];return _0x146521;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x734b('0x0')](_0x734b('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x734b('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x734b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x734b('0x3')]('in',_0x734b('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x734b('0x5')]},'providerResponse':{'type':Sequelize[_0x734b('0x0')]}};
\ No newline at end of file
index d4b1065..36e6ecf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5652=['UserId','user','agent','get','OpenchannelInteractionId','isNil','interaction','role','null','acceptMessage','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','rejectmessage','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','OpenchannelMessage','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x132d12,_0x2c9799){var _0x1c3163=function(_0x7d9136){while(--_0x7d9136){_0x132d12['push'](_0x132d12['shift']());}};_0x1c3163(++_0x2c9799);}(_0x5652,0x123));var _0x2565=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x5652[_0x462999];return _0x4b1366;};'use strict';var emlformat=require(_0x2565('0x0'));var rimraf=require(_0x2565('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2565('0x2'));var moment=require(_0x2565('0x3'));var BPromise=require(_0x2565('0x4'));var Mustache=require(_0x2565('0x5'));var util=require('util');var path=require(_0x2565('0x6'));var sox=require(_0x2565('0x7'));var csv=require(_0x2565('0x8'));var ejs=require(_0x2565('0x9'));var fs=require('fs');var fs_extra=require(_0x2565('0xa'));var _=require(_0x2565('0xb'));var squel=require(_0x2565('0xc'));var crypto=require(_0x2565('0xd'));var jsforce=require(_0x2565('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2565('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2565('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2565('0x10'));var hardwareService=require(_0x2565('0x11'));var logger=require(_0x2565('0x12'))('api');var utils=require(_0x2565('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2565('0x14'));var db=require('../../mysqldb')['db'];config[_0x2565('0x15')]=_['defaults'](config[_0x2565('0x15')],{'host':_0x2565('0x16'),'port':0x18eb});var socket=require(_0x2565('0x17'))(new Redis(config['redis']));require(_0x2565('0x18'))[_0x2565('0x19')](socket);var jayson=require(_0x2565('0x1a'));var client=jayson['client'][_0x2565('0x1b')]({'port':0x232c});var client9002=jayson[_0x2565('0x1c')][_0x2565('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x80813d,_0x5a9068,_0x142617,_0x5a4549){return new BPromise(function(_0x34ecfd,_0x34b126){var _0x6dd161=_0x5a4549||client;return _0x6dd161[_0x2565('0x1d')](_0x80813d,_0x142617)['then'](function(_0x57d307){logger[_0x2565('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0x5a9068,_0x2565('0x1f'));logger[_0x2565('0x20')](_0x2565('0x21'),_0x5a9068,_0x2565('0x1f'),JSON[_0x2565('0x22')](_0x57d307));if(_0x57d307[_0x2565('0x23')]){if(_0x57d307[_0x2565('0x23')][_0x2565('0x24')]===0x1f4){logger[_0x2565('0x23')](_0x2565('0x25'),_0x5a9068,_0x57d307[_0x2565('0x23')][_0x2565('0x26')]);return _0x34b126(_0x57d307[_0x2565('0x23')]['message']);}logger['error'](_0x2565('0x25'),_0x5a9068,_0x57d307[_0x2565('0x23')][_0x2565('0x26')]);return _0x34ecfd(_0x57d307[_0x2565('0x23')]['message']);}else{logger['info'](_0x2565('0x25'),_0x5a9068,_0x2565('0x1f'));_0x34ecfd(_0x57d307[_0x2565('0x27')][_0x2565('0x26')]);}})['catch'](function(_0x4b4885){logger[_0x2565('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x5a9068,_0x4b4885);_0x34b126(_0x4b4885);});});}function respondWithStatusCode(_0xf8e428,_0x28a722){_0x28a722=_0x28a722||0xcc;return function(_0x2ac14d){if(_0x2ac14d){return _0xf8e428[_0x2565('0x28')](_0x28a722);}return _0xf8e428[_0x2565('0x29')](_0x28a722)[_0x2565('0x2a')]();};}function respondWithResult(_0x9b1dee,_0x55cc5e){_0x55cc5e=_0x55cc5e||0xc8;return function(_0x23d069){if(_0x23d069){return _0x9b1dee[_0x2565('0x29')](_0x55cc5e)[_0x2565('0x2b')](_0x23d069);}};}function respondWithFilteredResult(_0x247203,_0x32e683){return function(_0x55e999){if(_0x55e999){var _0x4c3334=typeof _0x32e683[_0x2565('0x2c')]===_0x2565('0x2d')&&typeof _0x32e683[_0x2565('0x2e')]===_0x2565('0x2d');var _0x489577=_0x55e999[_0x2565('0x2f')];var _0x5a187b=_0x4c3334?0x0:_0x32e683[_0x2565('0x2c')];var _0x434392=_0x4c3334?_0x55e999[_0x2565('0x2f')]:_0x32e683[_0x2565('0x2c')]+_0x32e683[_0x2565('0x2e')];var _0x22ff31;if(_0x434392>=_0x489577){_0x434392=_0x489577;_0x22ff31=0xc8;}else{_0x22ff31=0xce;}_0x247203['status'](_0x22ff31);return _0x247203[_0x2565('0x30')](_0x2565('0x31'),_0x5a187b+'-'+_0x434392+'/'+_0x489577)[_0x2565('0x2b')](_0x55e999);}return null;};}function patchUpdates(_0x11d3cf){return function(_0x2d3337){try{jsonpatch[_0x2565('0x32')](_0x2d3337,_0x11d3cf,!![]);}catch(_0x548d5c){return BPromise['reject'](_0x548d5c);}return _0x2d3337[_0x2565('0x33')]();};}function saveUpdates(_0x3caa17,_0x4e9836){return function(_0x494532){if(_0x494532){return _0x494532[_0x2565('0x34')](_0x3caa17)[_0x2565('0x35')](function(_0x506e75){return _0x506e75;});}return null;};}function removeEntity(_0x503a00,_0x55d4ac){return function(_0x3ce080){if(_0x3ce080){return _0x3ce080[_0x2565('0x36')]()['then'](function(){_0x503a00[_0x2565('0x29')](0xcc)[_0x2565('0x2a')]();});}};}function handleEntityNotFound(_0x1a988f,_0x2d6a9a){return function(_0x40b5ac){if(!_0x40b5ac){_0x1a988f[_0x2565('0x28')](0x194);}return _0x40b5ac;};}function handleError(_0x1d686e,_0x3f3888){_0x3f3888=_0x3f3888||0x1f4;return function(_0x3487f2){logger[_0x2565('0x23')](_0x3487f2['stack']);if(_0x3487f2[_0x2565('0x37')]){delete _0x3487f2[_0x2565('0x37')];}_0x1d686e['status'](_0x3f3888)['send'](_0x3487f2);};}exports['index']=function(_0x1d1350,_0x44ae74){var _0x39f1d5={},_0x3a5248={},_0x40e2be={'count':0x0,'rows':[]};var _0x1fb58c=_[_0x2565('0x38')](db['OpenchannelMessage'][_0x2565('0x39')],function(_0x15526a){return{'name':_0x15526a[_0x2565('0x3a')],'type':_0x15526a[_0x2565('0x3b')][_0x2565('0x3c')]};});_0x3a5248[_0x2565('0x3d')]=_[_0x2565('0x38')](_0x1fb58c,_0x2565('0x37'));_0x3a5248[_0x2565('0x3e')]=_[_0x2565('0x3f')](_0x1d1350[_0x2565('0x3e')]);_0x3a5248[_0x2565('0x40')]=_[_0x2565('0x41')](_0x3a5248['model'],_0x3a5248[_0x2565('0x3e')]);_0x39f1d5[_0x2565('0x42')]=_[_0x2565('0x41')](_0x3a5248[_0x2565('0x3d')],qs['fields'](_0x1d1350['query'][_0x2565('0x43')]));_0x39f1d5[_0x2565('0x42')]=_0x39f1d5['attributes'][_0x2565('0x44')]?_0x39f1d5[_0x2565('0x42')]:_0x3a5248[_0x2565('0x3d')];if(!_0x1d1350[_0x2565('0x3e')][_0x2565('0x45')]('nolimit')){_0x39f1d5[_0x2565('0x2e')]=qs[_0x2565('0x2e')](_0x1d1350['query']['limit']);_0x39f1d5[_0x2565('0x2c')]=qs[_0x2565('0x2c')](_0x1d1350[_0x2565('0x3e')][_0x2565('0x2c')]);}_0x39f1d5[_0x2565('0x46')]=qs['sort'](_0x1d1350[_0x2565('0x3e')][_0x2565('0x47')]);_0x39f1d5[_0x2565('0x48')]=qs[_0x2565('0x40')](_[_0x2565('0x49')](_0x1d1350['query'],_0x3a5248[_0x2565('0x40')]),_0x1fb58c);if(_0x1d1350['query'][_0x2565('0x4a')]){_0x39f1d5[_0x2565('0x48')]=_['merge'](_0x39f1d5['where'],{'$or':_['map'](_0x1fb58c,function(_0x2c7f8f){if(_0x2c7f8f[_0x2565('0x3b')]!==_0x2565('0x4b')){var _0x46442d={};_0x46442d[_0x2c7f8f[_0x2565('0x37')]]={'$like':'%'+_0x1d1350[_0x2565('0x3e')][_0x2565('0x4a')]+'%'};return _0x46442d;}})});}_0x39f1d5=_[_0x2565('0x4c')]({},_0x39f1d5,_0x1d1350['options']);var _0x332856={'where':_0x39f1d5[_0x2565('0x48')]};return db[_0x2565('0x4d')][_0x2565('0x2f')](_0x332856)['then'](function(_0x13ac90){_0x40e2be[_0x2565('0x2f')]=_0x13ac90;if(_0x1d1350[_0x2565('0x3e')][_0x2565('0x4e')]){_0x39f1d5[_0x2565('0x4f')]=[{'all':!![]}];}return db[_0x2565('0x4d')][_0x2565('0x50')](_0x39f1d5);})[_0x2565('0x35')](function(_0x189cc2){_0x40e2be[_0x2565('0x51')]=_0x189cc2;return _0x40e2be;})['then'](respondWithFilteredResult(_0x44ae74,_0x39f1d5))[_0x2565('0x52')](handleError(_0x44ae74,null));};exports['show']=function(_0x2e8ae7,_0x356bda){var _0xb37fa0={'raw':!![],'where':{'id':_0x2e8ae7[_0x2565('0x53')]['id']}},_0x12c803={};_0x12c803[_0x2565('0x3d')]=_['keys'](db[_0x2565('0x4d')][_0x2565('0x39')]);_0x12c803[_0x2565('0x3e')]=_[_0x2565('0x3f')](_0x2e8ae7['query']);_0x12c803[_0x2565('0x40')]=_[_0x2565('0x41')](_0x12c803[_0x2565('0x3d')],_0x12c803[_0x2565('0x3e')]);_0xb37fa0[_0x2565('0x42')]=_[_0x2565('0x41')](_0x12c803[_0x2565('0x3d')],qs[_0x2565('0x43')](_0x2e8ae7['query']['fields']));_0xb37fa0[_0x2565('0x42')]=_0xb37fa0['attributes'][_0x2565('0x44')]?_0xb37fa0['attributes']:_0x12c803[_0x2565('0x3d')];if(_0x2e8ae7[_0x2565('0x3e')][_0x2565('0x4e')]){_0xb37fa0[_0x2565('0x4f')]=[{'all':!![]}];}_0xb37fa0=_[_0x2565('0x4c')]({},_0xb37fa0,_0x2e8ae7[_0x2565('0x54')]);return db[_0x2565('0x4d')][_0x2565('0x55')](_0xb37fa0)[_0x2565('0x35')](handleEntityNotFound(_0x356bda,null))[_0x2565('0x35')](respondWithResult(_0x356bda,null))[_0x2565('0x52')](handleError(_0x356bda,null));};exports[_0x2565('0x56')]=function(_0x36c1f5,_0x27de4b){return db['OpenchannelMessage'][_0x2565('0x56')](_0x36c1f5[_0x2565('0x57')],{})[_0x2565('0x35')](respondWithResult(_0x27de4b,0xc9))['catch'](handleError(_0x27de4b,null));};exports['update']=function(_0x37d11b,_0x27436c){if(_0x37d11b[_0x2565('0x57')]['id']){delete _0x37d11b[_0x2565('0x57')]['id'];}return db['OpenchannelMessage'][_0x2565('0x55')]({'where':{'id':_0x37d11b[_0x2565('0x53')]['id']}})[_0x2565('0x35')](handleEntityNotFound(_0x27436c,null))[_0x2565('0x35')](saveUpdates(_0x37d11b['body'],null))[_0x2565('0x35')](respondWithResult(_0x27436c,null))[_0x2565('0x52')](handleError(_0x27436c,null));};exports[_0x2565('0x36')]=function(_0x47b0b3,_0x54d9c2){return db[_0x2565('0x4d')][_0x2565('0x55')]({'where':{'id':_0x47b0b3[_0x2565('0x53')]['id']}})[_0x2565('0x35')](handleEntityNotFound(_0x54d9c2,null))[_0x2565('0x35')](removeEntity(_0x54d9c2,null))[_0x2565('0x52')](handleError(_0x54d9c2,null));};exports[_0x2565('0x58')]=function(_0x25d9fe,_0x5aa860){return db[_0x2565('0x4d')][_0x2565('0x58')]()[_0x2565('0x35')](respondWithResult(_0x5aa860,null))[_0x2565('0x52')](handleError(_0x5aa860,null));};var interaction_log=require('../../config/logger')(_0x2565('0x59'));exports[_0x2565('0x5a')]=function(_0x19267b,_0x30c7f8,_0xdaf8a7){var _0x4a8edb={'agent':{},'channel':_0x2565('0x5b')};if(_0x19267b['body']['id']){delete _0x19267b[_0x2565('0x57')]['id'];}_0x19267b[_0x2565('0x57')][_0x2565('0x5c')]=!![];_0x19267b[_0x2565('0x57')][_0x2565('0x5d')]=moment()[_0x2565('0x5e')](_0x2565('0x5f'));_0x19267b[_0x2565('0x57')][_0x2565('0x60')]=_0x19267b[_0x2565('0x57')][_0x2565('0x60')]||_0x19267b[_0x2565('0x61')]['id'];_0x4a8edb[_0x2565('0x62')]['id']=_0x19267b[_0x2565('0x57')]['UserId'];return db['OpenchannelMessage'][_0x2565('0x55')]({'where':{'id':_0x19267b[_0x2565('0x53')]['id'],'UserId':null}})[_0x2565('0x35')](handleEntityNotFound(_0x30c7f8,null))[_0x2565('0x35')](saveUpdates(_0x19267b[_0x2565('0x57')],null))['then'](function(_0x5ae718){if(_0x5ae718){_0x4a8edb[_0x2565('0x26')]=_0x5ae718[_0x2565('0x63')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x5ae718[_0x2565('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x30c7f8,null))[_0x2565('0x35')](function(_0x53aa3d){if(_0x53aa3d){return _0x53aa3d[_0x2565('0x34')]({'UserId':_0x19267b[_0x2565('0x57')][_0x2565('0x60')],'read1stAt':_[_0x2565('0x65')](_0x53aa3d['read1stAt'])?moment()[_0x2565('0x5e')](_0x2565('0x5f')):undefined});}return null;})[_0x2565('0x35')](function(_0x150c16){if(_0x150c16){_0x4a8edb[_0x2565('0x66')]=_0x150c16[_0x2565('0x63')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x19267b[_0x2565('0x61')]['id'],_0x19267b[_0x2565('0x61')]['name'],_0x19267b[_0x2565('0x61')][_0x2565('0x67')],_0x4a8edb[_0x2565('0x66')]['id'],_0x19267b[_0x2565('0x57')]?JSON[_0x2565('0x22')](_0x19267b[_0x2565('0x57')]):_0x2565('0x68'));return respondWithRpcPromise('AcceptMessage',_0x2565('0x69'),_0x4a8edb);}return null;})[_0x2565('0x35')](function(_0x5cb7a4){var _0x107c58='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5cb7a4['message']['ContactId'];return db['sequelize'][_0x2565('0x3e')](_0x107c58,{'type':db[_0x2565('0x6a')]['QueryTypes'][_0x2565('0x6b')],'raw':!![]})[_0x2565('0x35')](function(_0x3b2748){return _0x3b2748;});})[_0x2565('0x35')](function(_0x522d26){if(_0x522d26){_0x4a8edb['message'][_0x2565('0x6c')]=_0x522d26[0x0];if(!_0x19267b[_0x2565('0x57')][_0x2565('0x60')])return;return db[_0x2565('0x6d')][_0x2565('0x55')]({'where':{'id':_0x19267b[_0x2565('0x57')][_0x2565('0x60')],'role':_0x2565('0x62')},'attributes':['id',_0x2565('0x37'),_0x2565('0x6e'),_0x2565('0x6f'),_0x2565('0x70')],'raw':!![]});}return null;})['then'](function(_0x51295c){if(!_0x51295c)return null;_0x4a8edb[_0x2565('0x26')][_0x2565('0x62')]=_0x51295c;return _0x4a8edb;})[_0x2565('0x35')](function(_0x2f989e){if(_0x2f989e){if(_0x19267b[_0x2565('0x57')][_0x2565('0x71')]){_0x4a8edb[_0x2565('0x26')][_0x2565('0x72')]=util[_0x2565('0x5e')](_0x2565('0x73'),_0x19267b[_0x2565('0x61')]['name']);_0x4a8edb[_0x2565('0x26')][_0x2565('0x74')]=_0x4a8edb[_0x2565('0x74')];_0x4a8edb[_0x2565('0x26')][_0x2565('0x75')]=_0x2565('0x5a');return respondWithRpcPromise(_0x2565('0x76'),_0x2565('0x76'),{'event':_0x2565('0x77'),'message':_0x4a8edb[_0x2565('0x26')]},client9002)[_0x2565('0x35')](function(){return _0x4a8edb;});}return _0x4a8edb;}return null;})[_0x2565('0x35')](respondWithResult(_0x30c7f8,null))['catch'](handleError(_0x30c7f8,null));};var interaction_log=require(_0x2565('0x12'))(_0x2565('0x59'));exports[_0x2565('0x78')]=function(_0xf49220,_0x1c274d,_0x1b3fc0){var _0xc6c249={'agent':{},'channel':'openchannel'};if(_0xf49220[_0x2565('0x57')]['id']){delete _0xf49220[_0x2565('0x57')]['id'];}_0xf49220[_0x2565('0x57')][_0x2565('0x60')]=_0xf49220[_0x2565('0x57')]['UserId']||_0xf49220['user']['id'];_0xc6c249[_0x2565('0x62')]['id']=_0xf49220[_0x2565('0x57')][_0x2565('0x60')];return db[_0x2565('0x4d')]['find']({'where':{'id':_0xf49220[_0x2565('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1c274d,null))[_0x2565('0x35')](function(_0x376dad){if(_0x376dad){_0xc6c249[_0x2565('0x26')]=_0x376dad[_0x2565('0x63')]({'plain':!![]});return db[_0x2565('0x79')]['find']({'where':{'id':_0x376dad[_0x2565('0x64')]}});}return null;})[_0x2565('0x35')](handleEntityNotFound(_0x1c274d,null))[_0x2565('0x35')](function(_0x4dfc14){if(_0x4dfc14){_0xc6c249[_0x2565('0x66')]=_0x4dfc14['get']({'plain':!![]});interaction_log[_0x2565('0x1e')](_0x2565('0x7a'),_0xf49220[_0x2565('0x61')]['id'],_0xf49220[_0x2565('0x61')][_0x2565('0x37')],_0xf49220[_0x2565('0x61')][_0x2565('0x67')],_0xc6c249[_0x2565('0x66')]['id'],_0xf49220['body']?JSON[_0x2565('0x22')](_0xf49220[_0x2565('0x57')]):_0x2565('0x68'));return respondWithRpcPromise(_0x2565('0x7b'),_0x2565('0x7c'),_0xc6c249);}return null;})[_0x2565('0x35')](function(_0x29519a){var _0x3bc53d=_0x2565('0x7d')+_0x29519a['message']['ContactId'];return db[_0x2565('0x7e')][_0x2565('0x3e')](_0x3bc53d,{'type':db[_0x2565('0x6a')][_0x2565('0x7f')][_0x2565('0x6b')],'raw':!![]})[_0x2565('0x35')](function(_0x900c03){return _0x900c03;});})[_0x2565('0x35')](function(_0x50bf24){if(_0x50bf24){_0xc6c249[_0x2565('0x26')]['contact']=_0x50bf24[0x0];if(!_0xf49220['body'][_0x2565('0x60')])return;return db[_0x2565('0x6d')]['find']({'where':{'id':_0xf49220[_0x2565('0x57')][_0x2565('0x60')],'role':_0x2565('0x62')},'attributes':['id',_0x2565('0x37'),_0x2565('0x6e'),_0x2565('0x6f'),_0x2565('0x70')],'raw':!![]});}return null;})[_0x2565('0x35')](function(_0x279063){if(!_0x279063)return null;_0xc6c249[_0x2565('0x26')][_0x2565('0x62')]=_0x279063;return _0xc6c249;})['then'](function(_0x1d14c4){if(_0x1d14c4){_0x1d14c4[_0x2565('0x26')]['interface']=util[_0x2565('0x5e')](_0x2565('0x73'),_0xf49220[_0x2565('0x61')][_0x2565('0x37')]);_0x1d14c4['message'][_0x2565('0x74')]=_0xc6c249[_0x2565('0x74')];_0x1d14c4[_0x2565('0x26')]['event']=_0x2565('0x78');respondWithRpcPromise(_0x2565('0x76'),_0x2565('0x76'),{'event':_0x2565('0x80'),'message':_0x1d14c4[_0x2565('0x26')]},client9002);return _0xc6c249;}return null;})[_0x2565('0x35')](respondWithResult(_0x1c274d,null))['catch'](handleError(_0x1c274d,null));};
\ No newline at end of file
+var _0x9b2c=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','sendStatus','name','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','options','then','includeAll','include','rows','catch','show','params','merge','find','create','body','describe','openchannel-interactions','accept','read','readAt','UserId','user','get','OpenchannelInteractionId','update','isNil','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','interface','channel','event','EventManager','acceptmessage','reject','openchannel','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','SIP/%s','rejectmessage','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x4fe29f,_0x47eb82){var _0x5503b1=function(_0x27dd29){while(--_0x27dd29){_0x4fe29f['push'](_0x4fe29f['shift']());}};_0x5503b1(++_0x47eb82);}(_0x9b2c,0x189));var _0xc9b2=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x9b2c[_0x151381];return _0x2afab6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9b2('0x0'));var zipdir=require(_0xc9b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9b2('0x2'));var moment=require('moment');var BPromise=require(_0xc9b2('0x3'));var Mustache=require('mustache');var util=require(_0xc9b2('0x4'));var path=require(_0xc9b2('0x5'));var sox=require(_0xc9b2('0x6'));var csv=require(_0xc9b2('0x7'));var ejs=require(_0xc9b2('0x8'));var fs=require('fs');var fs_extra=require(_0xc9b2('0x9'));var _=require(_0xc9b2('0xa'));var squel=require(_0xc9b2('0xb'));var crypto=require(_0xc9b2('0xc'));var jsforce=require(_0xc9b2('0xd'));var deskjs=require(_0xc9b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc9b2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc9b2('0x10'));var qs=require(_0xc9b2('0x11'));var as=require(_0xc9b2('0x12'));var hardwareService=require(_0xc9b2('0x13'));var logger=require(_0xc9b2('0x14'))(_0xc9b2('0x15'));var utils=require(_0xc9b2('0x16'));var config=require(_0xc9b2('0x17'));var licenseUtil=require(_0xc9b2('0x18'));var db=require(_0xc9b2('0x19'))['db'];config[_0xc9b2('0x1a')]=_[_0xc9b2('0x1b')](config['redis'],{'host':_0xc9b2('0x1c'),'port':0x18eb});var socket=require(_0xc9b2('0x1d'))(new Redis(config[_0xc9b2('0x1a')]));require(_0xc9b2('0x1e'))['register'](socket);var jayson=require(_0xc9b2('0x1f'));var client=jayson[_0xc9b2('0x20')][_0xc9b2('0x21')]({'port':0x232c});var client9002=jayson[_0xc9b2('0x20')][_0xc9b2('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xc37dd,_0x302c1a,_0x2167f5,_0x59fb0f){return new BPromise(function(_0x351c79,_0x266823){var _0xe224aa=_0x59fb0f||client;return _0xe224aa[_0xc9b2('0x22')](_0xc37dd,_0x2167f5)['then'](function(_0x10aca7){logger[_0xc9b2('0x23')](_0xc9b2('0x24'),_0x302c1a,_0xc9b2('0x25'));logger[_0xc9b2('0x26')](_0xc9b2('0x27'),_0x302c1a,_0xc9b2('0x25'),JSON['stringify'](_0x10aca7));if(_0x10aca7[_0xc9b2('0x28')]){if(_0x10aca7['error'][_0xc9b2('0x29')]===0x1f4){logger[_0xc9b2('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x302c1a,_0x10aca7[_0xc9b2('0x28')][_0xc9b2('0x2a')]);return _0x266823(_0x10aca7['error'][_0xc9b2('0x2a')]);}logger['error'](_0xc9b2('0x24'),_0x302c1a,_0x10aca7[_0xc9b2('0x28')][_0xc9b2('0x2a')]);return _0x351c79(_0x10aca7[_0xc9b2('0x28')][_0xc9b2('0x2a')]);}else{logger[_0xc9b2('0x23')](_0xc9b2('0x24'),_0x302c1a,_0xc9b2('0x25'));_0x351c79(_0x10aca7[_0xc9b2('0x2b')][_0xc9b2('0x2a')]);}})['catch'](function(_0x15dc60){logger[_0xc9b2('0x28')](_0xc9b2('0x24'),_0x302c1a,_0x15dc60);_0x266823(_0x15dc60);});});}function respondWithStatusCode(_0x8e5dfa,_0x5a2c79){_0x5a2c79=_0x5a2c79||0xcc;return function(_0x349943){if(_0x349943){return _0x8e5dfa['sendStatus'](_0x5a2c79);}return _0x8e5dfa[_0xc9b2('0x2c')](_0x5a2c79)[_0xc9b2('0x2d')]();};}function respondWithResult(_0x38b3ff,_0x245385){_0x245385=_0x245385||0xc8;return function(_0x39a186){if(_0x39a186){return _0x38b3ff[_0xc9b2('0x2c')](_0x245385)[_0xc9b2('0x2e')](_0x39a186);}};}function respondWithFilteredResult(_0x3d735a,_0x46ab9b){return function(_0x37f4f0){if(_0x37f4f0){var _0x16936f=typeof _0x46ab9b[_0xc9b2('0x2f')]===_0xc9b2('0x30')&&typeof _0x46ab9b[_0xc9b2('0x31')]===_0xc9b2('0x30');var _0x2eebd3=_0x37f4f0['count'];var _0x5c2277=_0x16936f?0x0:_0x46ab9b[_0xc9b2('0x2f')];var _0x34533a=_0x16936f?_0x37f4f0[_0xc9b2('0x32')]:_0x46ab9b['offset']+_0x46ab9b[_0xc9b2('0x31')];var _0x493e09;if(_0x34533a>=_0x2eebd3){_0x34533a=_0x2eebd3;_0x493e09=0xc8;}else{_0x493e09=0xce;}_0x3d735a[_0xc9b2('0x2c')](_0x493e09);return _0x3d735a[_0xc9b2('0x33')](_0xc9b2('0x34'),_0x5c2277+'-'+_0x34533a+'/'+_0x2eebd3)[_0xc9b2('0x2e')](_0x37f4f0);}return null;};}function patchUpdates(_0x3f7e5d){return function(_0x1d9f19){try{jsonpatch[_0xc9b2('0x35')](_0x1d9f19,_0x3f7e5d,!![]);}catch(_0x23de79){return BPromise['reject'](_0x23de79);}return _0x1d9f19[_0xc9b2('0x36')]();};}function saveUpdates(_0x61ad5b,_0x1eb98d){return function(_0x26f69e){if(_0x26f69e){return _0x26f69e['update'](_0x61ad5b)['then'](function(_0x2c0ca3){return _0x2c0ca3;});}return null;};}function removeEntity(_0x11ce38,_0x53155b){return function(_0x5c894d){if(_0x5c894d){return _0x5c894d[_0xc9b2('0x37')]()['then'](function(){_0x11ce38[_0xc9b2('0x2c')](0xcc)[_0xc9b2('0x2d')]();});}};}function handleEntityNotFound(_0x488835,_0x457b88){return function(_0x33baf3){if(!_0x33baf3){_0x488835[_0xc9b2('0x38')](0x194);}return _0x33baf3;};}function handleError(_0x4bc980,_0x3092d3){_0x3092d3=_0x3092d3||0x1f4;return function(_0xd8ee42){logger[_0xc9b2('0x28')](_0xd8ee42['stack']);if(_0xd8ee42['name']){delete _0xd8ee42[_0xc9b2('0x39')];}_0x4bc980['status'](_0x3092d3)[_0xc9b2('0x3a')](_0xd8ee42);};}exports[_0xc9b2('0x3b')]=function(_0x5b08a5,_0x2503ce){var _0x3fba82={},_0x3b7b90={},_0x4ff33e={'count':0x0,'rows':[]};var _0x2e2976=_[_0xc9b2('0x3c')](db[_0xc9b2('0x3d')][_0xc9b2('0x3e')],function(_0x3f31ae){return{'name':_0x3f31ae['fieldName'],'type':_0x3f31ae[_0xc9b2('0x3f')][_0xc9b2('0x40')]};});_0x3b7b90[_0xc9b2('0x41')]=_[_0xc9b2('0x3c')](_0x2e2976,_0xc9b2('0x39'));_0x3b7b90[_0xc9b2('0x42')]=_[_0xc9b2('0x43')](_0x5b08a5[_0xc9b2('0x42')]);_0x3b7b90[_0xc9b2('0x44')]=_[_0xc9b2('0x45')](_0x3b7b90[_0xc9b2('0x41')],_0x3b7b90[_0xc9b2('0x42')]);_0x3fba82[_0xc9b2('0x46')]=_[_0xc9b2('0x45')](_0x3b7b90['model'],qs[_0xc9b2('0x47')](_0x5b08a5[_0xc9b2('0x42')][_0xc9b2('0x47')]));_0x3fba82[_0xc9b2('0x46')]=_0x3fba82['attributes'][_0xc9b2('0x48')]?_0x3fba82[_0xc9b2('0x46')]:_0x3b7b90['model'];if(!_0x5b08a5[_0xc9b2('0x42')][_0xc9b2('0x49')]('nolimit')){_0x3fba82[_0xc9b2('0x31')]=qs['limit'](_0x5b08a5['query'][_0xc9b2('0x31')]);_0x3fba82[_0xc9b2('0x2f')]=qs[_0xc9b2('0x2f')](_0x5b08a5[_0xc9b2('0x42')][_0xc9b2('0x2f')]);}_0x3fba82[_0xc9b2('0x4a')]=qs[_0xc9b2('0x4b')](_0x5b08a5[_0xc9b2('0x42')][_0xc9b2('0x4b')]);_0x3fba82['where']=qs[_0xc9b2('0x44')](_[_0xc9b2('0x4c')](_0x5b08a5[_0xc9b2('0x42')],_0x3b7b90[_0xc9b2('0x44')]),_0x2e2976);if(_0x5b08a5[_0xc9b2('0x42')][_0xc9b2('0x4d')]){_0x3fba82[_0xc9b2('0x4e')]=_['merge'](_0x3fba82[_0xc9b2('0x4e')],{'$or':_['map'](_0x2e2976,function(_0x1c77ee){if(_0x1c77ee[_0xc9b2('0x3f')]!=='VIRTUAL'){var _0x2fca43={};_0x2fca43[_0x1c77ee['name']]={'$like':'%'+_0x5b08a5[_0xc9b2('0x42')][_0xc9b2('0x4d')]+'%'};return _0x2fca43;}})});}_0x3fba82=_['merge']({},_0x3fba82,_0x5b08a5[_0xc9b2('0x4f')]);var _0x4d492e={'where':_0x3fba82[_0xc9b2('0x4e')]};return db[_0xc9b2('0x3d')]['count'](_0x4d492e)[_0xc9b2('0x50')](function(_0x16f109){_0x4ff33e[_0xc9b2('0x32')]=_0x16f109;if(_0x5b08a5[_0xc9b2('0x42')][_0xc9b2('0x51')]){_0x3fba82[_0xc9b2('0x52')]=[{'all':!![]}];}return db[_0xc9b2('0x3d')]['findAll'](_0x3fba82);})['then'](function(_0xd14d77){_0x4ff33e[_0xc9b2('0x53')]=_0xd14d77;return _0x4ff33e;})['then'](respondWithFilteredResult(_0x2503ce,_0x3fba82))[_0xc9b2('0x54')](handleError(_0x2503ce,null));};exports[_0xc9b2('0x55')]=function(_0x314292,_0x2af138){var _0x5c6d57={'raw':!![],'where':{'id':_0x314292[_0xc9b2('0x56')]['id']}},_0x29628c={};_0x29628c[_0xc9b2('0x41')]=_[_0xc9b2('0x43')](db['OpenchannelMessage']['rawAttributes']);_0x29628c[_0xc9b2('0x42')]=_[_0xc9b2('0x43')](_0x314292[_0xc9b2('0x42')]);_0x29628c['filters']=_[_0xc9b2('0x45')](_0x29628c[_0xc9b2('0x41')],_0x29628c[_0xc9b2('0x42')]);_0x5c6d57[_0xc9b2('0x46')]=_[_0xc9b2('0x45')](_0x29628c[_0xc9b2('0x41')],qs['fields'](_0x314292[_0xc9b2('0x42')][_0xc9b2('0x47')]));_0x5c6d57[_0xc9b2('0x46')]=_0x5c6d57[_0xc9b2('0x46')][_0xc9b2('0x48')]?_0x5c6d57['attributes']:_0x29628c[_0xc9b2('0x41')];if(_0x314292[_0xc9b2('0x42')][_0xc9b2('0x51')]){_0x5c6d57['include']=[{'all':!![]}];}_0x5c6d57=_[_0xc9b2('0x57')]({},_0x5c6d57,_0x314292[_0xc9b2('0x4f')]);return db['OpenchannelMessage'][_0xc9b2('0x58')](_0x5c6d57)[_0xc9b2('0x50')](handleEntityNotFound(_0x2af138,null))['then'](respondWithResult(_0x2af138,null))[_0xc9b2('0x54')](handleError(_0x2af138,null));};exports[_0xc9b2('0x59')]=function(_0xd000f9,_0x54181b){return db[_0xc9b2('0x3d')][_0xc9b2('0x59')](_0xd000f9[_0xc9b2('0x5a')],{})[_0xc9b2('0x50')](respondWithResult(_0x54181b,0xc9))[_0xc9b2('0x54')](handleError(_0x54181b,null));};exports['update']=function(_0x379890,_0x1cec91){if(_0x379890[_0xc9b2('0x5a')]['id']){delete _0x379890[_0xc9b2('0x5a')]['id'];}return db[_0xc9b2('0x3d')][_0xc9b2('0x58')]({'where':{'id':_0x379890[_0xc9b2('0x56')]['id']}})['then'](handleEntityNotFound(_0x1cec91,null))[_0xc9b2('0x50')](saveUpdates(_0x379890[_0xc9b2('0x5a')],null))[_0xc9b2('0x50')](respondWithResult(_0x1cec91,null))[_0xc9b2('0x54')](handleError(_0x1cec91,null));};exports[_0xc9b2('0x37')]=function(_0x42f91e,_0x2ce887){return db[_0xc9b2('0x3d')]['find']({'where':{'id':_0x42f91e[_0xc9b2('0x56')]['id']}})[_0xc9b2('0x50')](handleEntityNotFound(_0x2ce887,null))[_0xc9b2('0x50')](removeEntity(_0x2ce887,null))['catch'](handleError(_0x2ce887,null));};exports[_0xc9b2('0x5b')]=function(_0x423b58,_0x57cba5){return db[_0xc9b2('0x3d')][_0xc9b2('0x5b')]()[_0xc9b2('0x50')](respondWithResult(_0x57cba5,null))['catch'](handleError(_0x57cba5,null));};var interaction_log=require(_0xc9b2('0x14'))(_0xc9b2('0x5c'));exports[_0xc9b2('0x5d')]=function(_0x40ddd0,_0x4a4e32,_0x31cf1d){var _0x28e07={'agent':{},'channel':'openchannel'};if(_0x40ddd0[_0xc9b2('0x5a')]['id']){delete _0x40ddd0[_0xc9b2('0x5a')]['id'];}_0x40ddd0[_0xc9b2('0x5a')][_0xc9b2('0x5e')]=!![];_0x40ddd0[_0xc9b2('0x5a')][_0xc9b2('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x40ddd0[_0xc9b2('0x5a')]['UserId']=_0x40ddd0[_0xc9b2('0x5a')][_0xc9b2('0x60')]||_0x40ddd0[_0xc9b2('0x61')]['id'];_0x28e07['agent']['id']=_0x40ddd0[_0xc9b2('0x5a')][_0xc9b2('0x60')];return db[_0xc9b2('0x3d')]['find']({'where':{'id':_0x40ddd0['params']['id'],'UserId':null}})[_0xc9b2('0x50')](handleEntityNotFound(_0x4a4e32,null))[_0xc9b2('0x50')](saveUpdates(_0x40ddd0[_0xc9b2('0x5a')],null))[_0xc9b2('0x50')](function(_0x3baaee){if(_0x3baaee){_0x28e07[_0xc9b2('0x2a')]=_0x3baaee[_0xc9b2('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0xc9b2('0x58')]({'where':{'id':_0x3baaee[_0xc9b2('0x63')]}});}return null;})[_0xc9b2('0x50')](handleEntityNotFound(_0x4a4e32,null))['then'](function(_0x67481a){if(_0x67481a){return _0x67481a[_0xc9b2('0x64')]({'UserId':_0x40ddd0['body'][_0xc9b2('0x60')],'read1stAt':_[_0xc9b2('0x65')](_0x67481a['read1stAt'])?moment()[_0xc9b2('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x13989e){if(_0x13989e){_0x28e07[_0xc9b2('0x67')]=_0x13989e[_0xc9b2('0x62')]({'plain':!![]});interaction_log[_0xc9b2('0x23')](_0xc9b2('0x68'),_0x40ddd0[_0xc9b2('0x61')]['id'],_0x40ddd0[_0xc9b2('0x61')][_0xc9b2('0x39')],_0x40ddd0[_0xc9b2('0x61')][_0xc9b2('0x69')],_0x28e07[_0xc9b2('0x67')]['id'],_0x40ddd0['body']?JSON['stringify'](_0x40ddd0[_0xc9b2('0x5a')]):_0xc9b2('0x6a'));return respondWithRpcPromise(_0xc9b2('0x6b'),_0xc9b2('0x6c'),_0x28e07);}return null;})[_0xc9b2('0x50')](function(_0x535bb3){var _0x33a848=_0xc9b2('0x6d')+_0x535bb3[_0xc9b2('0x2a')][_0xc9b2('0x6e')];return db[_0xc9b2('0x6f')][_0xc9b2('0x42')](_0x33a848,{'type':db[_0xc9b2('0x70')][_0xc9b2('0x71')][_0xc9b2('0x72')],'raw':!![]})[_0xc9b2('0x50')](function(_0x491c1b){return _0x491c1b;});})[_0xc9b2('0x50')](function(_0xdc923a){if(_0xdc923a){_0x28e07[_0xc9b2('0x2a')][_0xc9b2('0x73')]=_0xdc923a[0x0];if(!_0x40ddd0[_0xc9b2('0x5a')][_0xc9b2('0x60')])return;return db[_0xc9b2('0x74')][_0xc9b2('0x58')]({'where':{'id':_0x40ddd0[_0xc9b2('0x5a')]['UserId'],'role':_0xc9b2('0x75')},'attributes':['id',_0xc9b2('0x39'),'fullname',_0xc9b2('0x76'),_0xc9b2('0x77')],'raw':!![]});}return null;})[_0xc9b2('0x50')](function(_0x4895b1){if(!_0x4895b1)return null;_0x28e07['message'][_0xc9b2('0x75')]=_0x4895b1;return _0x28e07;})[_0xc9b2('0x50')](function(_0x4c4d81){if(_0x4c4d81){if(_0x40ddd0[_0xc9b2('0x5a')][_0xc9b2('0x78')]){_0x28e07[_0xc9b2('0x2a')][_0xc9b2('0x79')]=util[_0xc9b2('0x66')]('SIP/%s',_0x40ddd0['user'][_0xc9b2('0x39')]);_0x28e07['message']['channel']=_0x28e07[_0xc9b2('0x7a')];_0x28e07[_0xc9b2('0x2a')][_0xc9b2('0x7b')]='accept';return respondWithRpcPromise('EventManager',_0xc9b2('0x7c'),{'event':_0xc9b2('0x7d'),'message':_0x28e07['message']},client9002)[_0xc9b2('0x50')](function(){return _0x28e07;});}return _0x28e07;}return null;})['then'](respondWithResult(_0x4a4e32,null))[_0xc9b2('0x54')](handleError(_0x4a4e32,null));};var interaction_log=require(_0xc9b2('0x14'))(_0xc9b2('0x5c'));exports[_0xc9b2('0x7e')]=function(_0x3aa152,_0x4893bf,_0x3f309e){var _0x3c361e={'agent':{},'channel':_0xc9b2('0x7f')};if(_0x3aa152[_0xc9b2('0x5a')]['id']){delete _0x3aa152[_0xc9b2('0x5a')]['id'];}_0x3aa152['body']['UserId']=_0x3aa152['body'][_0xc9b2('0x60')]||_0x3aa152['user']['id'];_0x3c361e[_0xc9b2('0x75')]['id']=_0x3aa152[_0xc9b2('0x5a')][_0xc9b2('0x60')];return db[_0xc9b2('0x3d')][_0xc9b2('0x58')]({'where':{'id':_0x3aa152[_0xc9b2('0x56')]['id'],'UserId':null}})[_0xc9b2('0x50')](handleEntityNotFound(_0x4893bf,null))[_0xc9b2('0x50')](function(_0x5e80f2){if(_0x5e80f2){_0x3c361e['message']=_0x5e80f2['get']({'plain':!![]});return db[_0xc9b2('0x80')][_0xc9b2('0x58')]({'where':{'id':_0x5e80f2['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4893bf,null))[_0xc9b2('0x50')](function(_0x64c235){if(_0x64c235){_0x3c361e['interaction']=_0x64c235[_0xc9b2('0x62')]({'plain':!![]});interaction_log[_0xc9b2('0x23')](_0xc9b2('0x81'),_0x3aa152[_0xc9b2('0x61')]['id'],_0x3aa152[_0xc9b2('0x61')][_0xc9b2('0x39')],_0x3aa152[_0xc9b2('0x61')][_0xc9b2('0x69')],_0x3c361e[_0xc9b2('0x67')]['id'],_0x3aa152[_0xc9b2('0x5a')]?JSON[_0xc9b2('0x82')](_0x3aa152[_0xc9b2('0x5a')]):'null');return respondWithRpcPromise(_0xc9b2('0x83'),_0xc9b2('0x84'),_0x3c361e);}return null;})[_0xc9b2('0x50')](function(_0x48a967){var _0x34edec=_0xc9b2('0x6d')+_0x48a967[_0xc9b2('0x2a')][_0xc9b2('0x6e')];return db[_0xc9b2('0x6f')]['query'](_0x34edec,{'type':db[_0xc9b2('0x70')][_0xc9b2('0x71')]['SELECT'],'raw':!![]})[_0xc9b2('0x50')](function(_0x6918b1){return _0x6918b1;});})[_0xc9b2('0x50')](function(_0x55da71){if(_0x55da71){_0x3c361e['message']['contact']=_0x55da71[0x0];if(!_0x3aa152[_0xc9b2('0x5a')][_0xc9b2('0x60')])return;return db['User'][_0xc9b2('0x58')]({'where':{'id':_0x3aa152[_0xc9b2('0x5a')][_0xc9b2('0x60')],'role':'agent'},'attributes':['id',_0xc9b2('0x39'),'fullname',_0xc9b2('0x76'),_0xc9b2('0x77')],'raw':!![]});}return null;})['then'](function(_0xda3fa9){if(!_0xda3fa9)return null;_0x3c361e[_0xc9b2('0x2a')]['agent']=_0xda3fa9;return _0x3c361e;})['then'](function(_0x1bcb6a){if(_0x1bcb6a){_0x1bcb6a[_0xc9b2('0x2a')]['interface']=util[_0xc9b2('0x66')](_0xc9b2('0x85'),_0x3aa152[_0xc9b2('0x61')][_0xc9b2('0x39')]);_0x1bcb6a[_0xc9b2('0x2a')]['channel']=_0x3c361e[_0xc9b2('0x7a')];_0x1bcb6a[_0xc9b2('0x2a')]['event']=_0xc9b2('0x7e');respondWithRpcPromise('EventManager',_0xc9b2('0x7c'),{'event':_0xc9b2('0x86'),'message':_0x1bcb6a[_0xc9b2('0x2a')]},client9002);return _0x3c361e;}return null;})[_0xc9b2('0x50')](respondWithResult(_0x4893bf,null))[_0xc9b2('0x54')](handleError(_0x4893bf,null));};
\ No newline at end of file
index 18a07f6..031ce8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3902=['events','../../mysqldb','OpenchannelMessage','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3902,0xdc));var _0x2390=function(_0x269a0c,_0x54cf10){_0x269a0c=_0x269a0c-0x0;var _0x1f6fa2=_0x3902[_0x269a0c];return _0x1f6fa2;};'use strict';var EventEmitter=require(_0x2390('0x0'));var OpenchannelMessage=require(_0x2390('0x1'))['db'][_0x2390('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2390('0x3'),'afterUpdate':_0x2390('0x4'),'afterDestroy':_0x2390('0x5')};function emitEvent(_0x5c5695){return function(_0x480608,_0x3cac6f,_0x308b5a){OpenchannelMessageEvents[_0x2390('0x6')](_0x5c5695+':'+_0x480608['id'],_0x480608);OpenchannelMessageEvents[_0x2390('0x6')](_0x5c5695,_0x480608);_0x308b5a(null);};}for(var e in events){if(events[_0x2390('0x7')](e)){var event=events[e];OpenchannelMessage[_0x2390('0x8')](e,emitEvent(event));}}module[_0x2390('0x9')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xf2d5=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','update'];(function(_0x39b053,_0x4506cb){var _0xc4bdbf=function(_0x23d86e){while(--_0x23d86e){_0x39b053['push'](_0x39b053['shift']());}};_0xc4bdbf(++_0x4506cb);}(_0xf2d5,0xcc));var _0x5f2d=function(_0x5f8306,_0x2f883a){_0x5f8306=_0x5f8306-0x0;var _0x3379a4=_0xf2d5[_0x5f8306];return _0x3379a4;};'use strict';var EventEmitter=require(_0x5f2d('0x0'));var OpenchannelMessage=require(_0x5f2d('0x1'))['db'][_0x5f2d('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5f2d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3466b7){return function(_0x517e96,_0x24d050,_0x52fd18){OpenchannelMessageEvents[_0x5f2d('0x4')](_0x3466b7+':'+_0x517e96['id'],_0x517e96);OpenchannelMessageEvents[_0x5f2d('0x4')](_0x3466b7,_0x517e96);_0x52fd18(null);};}for(var e in events){if(events[_0x5f2d('0x5')](e)){var event=events[e];OpenchannelMessage[_0x5f2d('0x6')](e,emitEvent(event));}}module[_0x5f2d('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
index eb3628c..f1bf464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c3c=['Forwarding\x20message\x20%d\x20to\x20%s','omit','Contact','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','describe','OpenchannelAccount','find','Interactions','CmContact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0x374ac2,_0x824f0){var _0x4c6543=function(_0x505324){while(--_0x505324){_0x374ac2['push'](_0x374ac2['shift']());}};_0x4c6543(++_0x824f0);}(_0x5c3c,0x132));var _0xc5c3=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x5c3c[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x110b89,_0x46e2c1,_0x52f3eb){var _0x14140f=_0x23a6b5[_0xc5c3('0xd')];var _0x4e329f=_0x110b89[_0xc5c3('0xe')]({'plain':!![]});if(_0x4e329f[_0xc5c3('0xf')][_0xc5c3('0x10')]()==='in'||_0x4e329f['direction'][_0xc5c3('0x10')]()===_0xc5c3('0x11')&&!_0x4e329f['secret']&&!_[_0xc5c3('0x12')](_0x4e329f[_0xc5c3('0x13')])){_0x14140f[_0xc5c3('0x14')]['findOne']({'where':{'id':_0x4e329f[_0xc5c3('0x15')]}})[_0xc5c3('0x16')](function(_0x1488ab){if(_0x1488ab){_0x1488ab[_0xc5c3('0x17')]({'lastMsgAt':_0x4e329f[_0xc5c3('0x18')],'lastMsgDirection':_0x4e329f['direction']['toLowerCase']()});}})[_0xc5c3('0x19')](function(_0x577e1a){console[_0xc5c3('0x1a')](_0x577e1a);});}if(_0x4e329f[_0xc5c3('0xf')]==='out'&&!_0x4e329f['secret']){var _0x467ba9;_0x14140f['CmContact'][_0xc5c3('0x1b')]()[_0xc5c3('0x16')](function(_0x2ff158){return _0x14140f[_0xc5c3('0x1c')][_0xc5c3('0x1d')]({'where':{'id':_0x4e329f['OpenchannelAccountId']},'include':[{'model':_0x14140f[_0xc5c3('0x14')],'as':_0xc5c3('0x1e'),'where':{'id':_0x4e329f[_0xc5c3('0x15')]},'limit':0x1,'include':[{'model':_0x14140f[_0xc5c3('0x1f')],'as':'Contact','attributes':_[_0xc5c3('0x20')](_0x2ff158)}]}]});})[_0xc5c3('0x16')](function(_0x3cc612){_0x467ba9=_0x3cc612[_0xc5c3('0xe')]({'plain':!![]});if(_0x467ba9&&_0x467ba9[_0xc5c3('0x21')]){logger['info'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x467ba9[_0xc5c3('0x1e')]&&_0x467ba9[_0xc5c3('0x1e')]['length']){_0x4e329f['Interaction']=_[_0xc5c3('0x26')](_0x467ba9[_0xc5c3('0x1e')][0x0],'Contact');_0x4e329f['Contact']=_0x467ba9[_0xc5c3('0x1e')][0x0][_0xc5c3('0x27')];}var _0x46e2c1={'method':'POST','uri':encodeURI(_0x467ba9['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x46e2c1[_0xc5c3('0x28')]){case _0xc5c3('0x29'):_0x46e2c1['qs']=_0x4e329f;break;case _0xc5c3('0x2a'):_0x46e2c1[_0xc5c3('0xc')]=_0x4e329f;break;}return rp(_0x46e2c1)['then'](function(_0x21efd6){logger['info'](_0xc5c3('0x22'),'afterCreate',util[_0xc5c3('0x24')](_0xc5c3('0x2b'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]&&_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]!=_0x4e329f['Interaction'][_0xc5c3('0x2c')]){return _0x14140f['OpenchannelInteraction'][_0xc5c3('0x17')]({'threadId':_0x21efd6[_0xc5c3('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x4e329f['Interaction']['id']}});}else{return;}})[_0xc5c3('0x16')](function(){return _0x110b89[_0xc5c3('0x17')]({'read':!![]});})[_0xc5c3('0x19')](function(_0x19e482){logger['error'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x2d')](_0x19e482,{'showHidden':![],'depth':null}));_0x52f3eb();});}else{_0x52f3eb();}})[_0xc5c3('0x2e')](function(){_0x52f3eb();});}else{_0x52f3eb();}}},'charset':_0xc5c3('0x2f'),'collate':_0xc5c3('0x30')});};
\ No newline at end of file
+var _0xda2d=['OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','replyUri','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','util','../../config/logger','api','moment','bluebird','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','UserId'];(function(_0x275cb5,_0x17abf2){var _0xbf1764=function(_0x30f784){while(--_0x30f784){_0x275cb5['push'](_0x275cb5['shift']());}};_0xbf1764(++_0x17abf2);}(_0xda2d,0x102));var _0xdda2=function(_0x526d43,_0x58c7c2){_0x526d43=_0x526d43-0x0;var _0x5f1f31=_0xda2d[_0x526d43];return _0x5f1f31;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[{'name':_0xdda2('0xb'),'fields':[_0xdda2('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a774e,_0x22c6e5,_0x4df6b8){var _0x1c11b2=_0x39f6c9[_0xdda2('0xd')];var _0x42d990=_0x1a774e[_0xdda2('0xe')]({'plain':!![]});if(_0x42d990[_0xdda2('0xf')][_0xdda2('0x10')]()==='in'||_0x42d990[_0xdda2('0xf')][_0xdda2('0x10')]()==='out'&&!_0x42d990['secret']&&!_['isNil'](_0x42d990[_0xdda2('0x11')])){_0x1c11b2[_0xdda2('0x12')][_0xdda2('0x13')]({'where':{'id':_0x42d990[_0xdda2('0x14')]}})[_0xdda2('0x15')](function(_0x475222){if(_0x475222){_0x475222[_0xdda2('0x16')]({'lastMsgAt':_0x42d990['createdAt'],'lastMsgDirection':_0x42d990[_0xdda2('0xf')]['toLowerCase']()});}})[_0xdda2('0x17')](function(_0xb6b01e){console[_0xdda2('0x18')](_0xb6b01e);});}if(_0x42d990[_0xdda2('0xf')]===_0xdda2('0x19')&&!_0x42d990['secret']){var _0x55d674;_0x1c11b2[_0xdda2('0x1a')]['describe']()[_0xdda2('0x15')](function(_0x1a3b35){return _0x1c11b2[_0xdda2('0x1b')][_0xdda2('0x1c')]({'where':{'id':_0x42d990[_0xdda2('0x1d')]},'include':[{'model':_0x1c11b2[_0xdda2('0x12')],'as':_0xdda2('0x1e'),'where':{'id':_0x42d990[_0xdda2('0x14')]},'limit':0x1,'include':[{'model':_0x1c11b2[_0xdda2('0x1a')],'as':_0xdda2('0x1f'),'attributes':_[_0xdda2('0x20')](_0x1a3b35)}]}]});})[_0xdda2('0x15')](function(_0x4eed30){_0x55d674=_0x4eed30[_0xdda2('0xe')]({'plain':!![]});if(_0x55d674&&_0x55d674['replyUri']){logger[_0xdda2('0x21')](_0xdda2('0x22'),_0xdda2('0x23'),util['format'](_0xdda2('0x24'),_0x42d990['id'],_0x55d674['replyUri']));if(_0x55d674[_0xdda2('0x1e')]&&_0x55d674[_0xdda2('0x1e')]['length']){_0x42d990[_0xdda2('0x25')]=_[_0xdda2('0x26')](_0x55d674[_0xdda2('0x1e')][0x0],_0xdda2('0x1f'));_0x42d990[_0xdda2('0x1f')]=_0x55d674['Interactions'][0x0][_0xdda2('0x1f')];}var _0x22c6e5={'method':_0xdda2('0x27'),'uri':encodeURI(_0x55d674[_0xdda2('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x22c6e5['method']){case'GET':_0x22c6e5['qs']=_0x42d990;break;case _0xdda2('0x27'):_0x22c6e5[_0xdda2('0xc')]=_0x42d990;break;}return rp(_0x22c6e5)[_0xdda2('0x15')](function(_0x5e9e74){logger[_0xdda2('0x21')](_0xdda2('0x22'),_0xdda2('0x23'),util[_0xdda2('0x29')](_0xdda2('0x2a'),_0x42d990['id'],_0x55d674[_0xdda2('0x28')]));if(_0x5e9e74['body'][_0xdda2('0x2b')]&&_0x5e9e74[_0xdda2('0xc')]['threadId']!=_0x42d990[_0xdda2('0x25')][_0xdda2('0x2b')]){return _0x1c11b2[_0xdda2('0x12')][_0xdda2('0x16')]({'threadId':_0x5e9e74['body'][_0xdda2('0x2b')]},{'logging':!![],'where':{'id':_0x42d990[_0xdda2('0x25')]['id']}});}else{return;}})['then'](function(){return _0x1a774e[_0xdda2('0x16')]({'read':!![]});})['catch'](function(_0x2b8cd6){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xdda2('0x2c')](_0x2b8cd6,{'showHidden':![],'depth':null}));_0x4df6b8();});}else{_0x4df6b8();}})['finally'](function(){_0x4df6b8();});}else{_0x4df6b8();}}},'charset':_0xdda2('0x2d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 203e0a4..c628c9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x4633f9,_0x91b9a9){var _0x2404ee=function(_0xd8347e){while(--_0xd8347e){_0x4633f9['push'](_0x4633f9['shift']());}};_0x2404ee(++_0x91b9a9);}(_0xdb28,0x106));var _0x8db2=function(_0x27c8d3,_0x49e804){_0x27c8d3=_0x27c8d3-0x0;var _0x11bee8=_0xdb28[_0x27c8d3];return _0x11bee8;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});};
\ No newline at end of file
+var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3fddb5,_0x5ed4b1){var _0x3393ad=function(_0x3cdadc){while(--_0x3cdadc){_0x3fddb5['push'](_0x3fddb5['shift']());}};_0x3393ad(++_0x5ed4b1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4fbfbb,_0x567728){_0x4fbfbb=_0x4fbfbb-0x0;var _0x1e4828=_0x5f2f[_0x4fbfbb];return _0x1e4828;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});};
\ No newline at end of file
index 0222a66..0a89a09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fdc=['./openchannelMessage.events','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x2a994d,_0x43a79e){var _0x2b6251=function(_0x224677){while(--_0x224677){_0x2a994d['push'](_0x2a994d['shift']());}};_0x2b6251(++_0x43a79e);}(_0x5fdc,0xcb));var _0xc5fd=function(_0x18ead3,_0x410a3b){_0x18ead3=_0x18ead3-0x0;var _0x40c555=_0x5fdc[_0x18ead3];return _0x40c555;};'use strict';var OpenchannelMessageEvents=require(_0xc5fd('0x0'));var events=['save','remove',_0xc5fd('0x1')];function createListener(_0x3dc4c0,_0x1e042a){return function(_0x517c4c){_0x1e042a[_0xc5fd('0x2')](_0x3dc4c0,_0x517c4c);};}function removeListener(_0x2a36a4,_0x3d4575){return function(){OpenchannelMessageEvents[_0xc5fd('0x3')](_0x2a36a4,_0x3d4575);};}exports[_0xc5fd('0x4')]=function(_0x2a2f9c){for(var _0x34d4d5=0x0,_0x2146df=events[_0xc5fd('0x5')];_0x34d4d5<_0x2146df;_0x34d4d5++){var _0x13d010=events[_0x34d4d5];var _0x494fb3=createListener(_0xc5fd('0x6')+_0x13d010,_0x2a2f9c);OpenchannelMessageEvents['on'](_0x13d010,_0x494fb3);}};
\ No newline at end of file
+var _0x0882=['./openchannelMessage.events','remove','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x4a92ff,_0x215eea){var _0x3cd15=function(_0x9f7a44){while(--_0x9f7a44){_0x4a92ff['push'](_0x4a92ff['shift']());}};_0x3cd15(++_0x215eea);}(_0x0882,0x1f0));var _0x2088=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0x0882[_0x4ca288];return _0x2362c1;};'use strict';var OpenchannelMessageEvents=require(_0x2088('0x0'));var events=['save',_0x2088('0x1'),_0x2088('0x2')];function createListener(_0x233b2d,_0x14861d){return function(_0x432c7d){_0x14861d[_0x2088('0x3')](_0x233b2d,_0x432c7d);};}function removeListener(_0x2e5cc3,_0x384899){return function(){OpenchannelMessageEvents[_0x2088('0x4')](_0x2e5cc3,_0x384899);};}exports[_0x2088('0x5')]=function(_0x49b9c0){for(var _0x24f4cd=0x0,_0x3b9bce=events[_0x2088('0x6')];_0x24f4cd<_0x3b9bce;_0x24f4cd++){var _0x2d99b2=events[_0x24f4cd];var _0xc93bdd=createListener(_0x2088('0x7')+_0x2d99b2,_0x49b9c0);OpenchannelMessageEvents['on'](_0x2d99b2,_0xc93bdd);}};
\ No newline at end of file
index da87742..765e0cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5359=['get','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','isAuthenticated'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x5359,0x6a));var _0x9535=function(_0x46d1ec,_0x3f4675){_0x46d1ec=_0x46d1ec-0x0;var _0x36740c=_0x5359[_0x46d1ec];return _0x36740c;};'use strict';var multer=require(_0x9535('0x0'));var util=require(_0x9535('0x1'));var path=require(_0x9535('0x2'));var timeout=require('connect-timeout');var express=require(_0x9535('0x3'));var router=express[_0x9535('0x4')]();var fs_extra=require(_0x9535('0x5'));var auth=require(_0x9535('0x6'));var interaction=require(_0x9535('0x7'));var config=require('../../config/environment');var controller=require(_0x9535('0x8'));router['get']('/',auth[_0x9535('0x9')](),controller['index']);router[_0x9535('0xa')](_0x9535('0xb'),auth[_0x9535('0x9')](),controller[_0x9535('0xc')]);router[_0x9535('0xa')](_0x9535('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9535('0xe'),auth[_0x9535('0x9')](),controller[_0x9535('0xf')]);router['get'](_0x9535('0x10'),auth[_0x9535('0x9')](),controller[_0x9535('0x11')]);router[_0x9535('0xa')](_0x9535('0x12'),auth['isAuthenticated'](),controller[_0x9535('0x13')]);router[_0x9535('0x14')]('/',auth['isAuthenticated'](),controller[_0x9535('0x15')]);router['post'](_0x9535('0x10'),auth[_0x9535('0x9')](),controller[_0x9535('0x16')]);router[_0x9535('0x14')](_0x9535('0x12'),auth['isAuthenticated'](),controller[_0x9535('0x17')]);router['put'](_0x9535('0xd'),auth[_0x9535('0x9')](),controller['update']);router[_0x9535('0x18')](_0x9535('0xd'),auth['isAuthenticated'](),controller[_0x9535('0x19')]);router[_0x9535('0x18')]('/:id/teams',auth[_0x9535('0x9')](),controller[_0x9535('0x1a')]);router['delete'](_0x9535('0x12'),auth[_0x9535('0x9')](),controller[_0x9535('0x1b')]);module[_0x9535('0x1c')]=router;
\ No newline at end of file
+var _0xec6e=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','/describe','isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','exports','multer','util','path'];(function(_0x18e89d,_0x4814fe){var _0x1aea52=function(_0x23e9fd){while(--_0x23e9fd){_0x18e89d['push'](_0x18e89d['shift']());}};_0x1aea52(++_0x4814fe);}(_0xec6e,0x185));var _0xeec6=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xec6e[_0x23b655];return _0x364b32;};'use strict';var multer=require(_0xeec6('0x0'));var util=require(_0xeec6('0x1'));var path=require(_0xeec6('0x2'));var timeout=require('connect-timeout');var express=require(_0xeec6('0x3'));var router=express['Router']();var fs_extra=require(_0xeec6('0x4'));var auth=require(_0xeec6('0x5'));var interaction=require(_0xeec6('0x6'));var config=require(_0xeec6('0x7'));var controller=require(_0xeec6('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xeec6('0x9')](_0xeec6('0xa'),auth[_0xeec6('0xb')](),controller[_0xeec6('0xc')]);router[_0xeec6('0x9')](_0xeec6('0xd'),auth[_0xeec6('0xb')](),controller['show']);router['get'](_0xeec6('0xe'),auth[_0xeec6('0xb')](),controller['getMembers']);router['get'](_0xeec6('0xf'),auth[_0xeec6('0xb')](),controller[_0xeec6('0x10')]);router['get'](_0xeec6('0x11'),auth[_0xeec6('0xb')](),controller[_0xeec6('0x12')]);router[_0xeec6('0x13')]('/',auth[_0xeec6('0xb')](),controller[_0xeec6('0x14')]);router['post'](_0xeec6('0xf'),auth['isAuthenticated'](),controller[_0xeec6('0x15')]);router[_0xeec6('0x13')](_0xeec6('0x11'),auth[_0xeec6('0xb')](),controller[_0xeec6('0x16')]);router[_0xeec6('0x17')](_0xeec6('0xd'),auth[_0xeec6('0xb')](),controller[_0xeec6('0x18')]);router[_0xeec6('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xeec6('0x1a')]);router['delete']('/:id/teams',auth[_0xeec6('0xb')](),controller['removeTeams']);router[_0xeec6('0x19')]('/:id/users',auth[_0xeec6('0xb')](),controller['removeAgents']);module[_0xeec6('0x1b')]=router;
\ No newline at end of file
index 5812b9a..ad48bd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x809e=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x809e,0x17f));var _0xe809=function(_0x21afad,_0x25b1c0){_0x21afad=_0x21afad-0x0;var _0x2fc2bb=_0x809e[_0x21afad];return _0x2fc2bb;};'use strict';var Sequelize=require(_0xe809('0x0'));module[_0xe809('0x1')]={'name':{'type':Sequelize[_0xe809('0x2')],'unique':_0xe809('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe809('0x2')]},'timeout':{'type':Sequelize[_0xe809('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe809('0x5')](_0xe809('0x6'),_0xe809('0x7'),_0xe809('0x8'))}};
\ No newline at end of file
+var _0x2436=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0x2a68ae,_0x19baec){var _0x6fabd3=function(_0x163b72){while(--_0x163b72){_0x2a68ae['push'](_0x2a68ae['shift']());}};_0x6fabd3(++_0x19baec);}(_0x2436,0x1f4));var _0x6243=function(_0x45716d,_0xb51d6d){_0x45716d=_0x45716d-0x0;var _0x1714ab=_0x2436[_0x45716d];return _0x1714ab;};'use strict';var Sequelize=require(_0x6243('0x0'));module[_0x6243('0x1')]={'name':{'type':Sequelize[_0x6243('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6243('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6243('0x3')](_0x6243('0x4'),_0x6243('0x5'),_0x6243('0x6'))}};
\ No newline at end of file
index a9d0a3e..43cca13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e56=['join','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','transaction','isEmpty','userOpenchannelQueue:remove','addAgents','omit','removeAgents','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','pick','OpenchannelQueueId','UserId','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','User','online','interface','Agents','sequelize','each','UserOpenchannelQueue','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8e56,0x9d));var _0x68e5=function(_0xdd2ebf,_0x27b44e){_0xdd2ebf=_0xdd2ebf-0x0;var _0x345958=_0x8e56[_0xdd2ebf];return _0x345958;};'use strict';var emlformat=require(_0x68e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68e5('0x1'));var jsonpatch=require(_0x68e5('0x2'));var rp=require(_0x68e5('0x3'));var moment=require(_0x68e5('0x4'));var BPromise=require(_0x68e5('0x5'));var Mustache=require(_0x68e5('0x6'));var util=require('util');var path=require(_0x68e5('0x7'));var sox=require('sox');var csv=require(_0x68e5('0x8'));var ejs=require(_0x68e5('0x9'));var fs=require('fs');var fs_extra=require(_0x68e5('0xa'));var _=require(_0x68e5('0xb'));var squel=require(_0x68e5('0xc'));var crypto=require(_0x68e5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68e5('0xe'));var toCsv=require(_0x68e5('0x8'));var querystring=require('querystring');var Papa=require(_0x68e5('0xf'));var Redis=require(_0x68e5('0x10'));var authService=require(_0x68e5('0x11'));var qs=require(_0x68e5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68e5('0x13'));var logger=require('../../config/logger')(_0x68e5('0x14'));var utils=require(_0x68e5('0x15'));var config=require(_0x68e5('0x16'));var licenseUtil=require(_0x68e5('0x17'));var db=require('../../mysqldb')['db'];config[_0x68e5('0x18')]=_[_0x68e5('0x19')](config[_0x68e5('0x18')],{'host':_0x68e5('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68e5('0x18')]));require(_0x68e5('0x1b'))[_0x68e5('0x1c')](socket);function respondWithStatusCode(_0xe14b52,_0x573bb9){_0x573bb9=_0x573bb9||0xcc;return function(_0x4d0a5b){if(_0x4d0a5b){return _0xe14b52[_0x68e5('0x1d')](_0x573bb9);}return _0xe14b52['status'](_0x573bb9)[_0x68e5('0x1e')]();};}function respondWithResult(_0x1fd937,_0x31c80b){_0x31c80b=_0x31c80b||0xc8;return function(_0x391f6a){if(_0x391f6a){return _0x1fd937[_0x68e5('0x1f')](_0x31c80b)[_0x68e5('0x20')](_0x391f6a);}};}function respondWithFilteredResult(_0x26c405,_0x3b83d7){return function(_0x23e63b){if(_0x23e63b){var _0x57d514=typeof _0x3b83d7[_0x68e5('0x21')]===_0x68e5('0x22')&&typeof _0x3b83d7[_0x68e5('0x23')]==='undefined';var _0x20cee1=_0x23e63b[_0x68e5('0x24')];var _0xf47af8=_0x57d514?0x0:_0x3b83d7[_0x68e5('0x21')];var _0x338fff=_0x57d514?_0x23e63b[_0x68e5('0x24')]:_0x3b83d7[_0x68e5('0x21')]+_0x3b83d7[_0x68e5('0x23')];var _0xdf9225;if(_0x338fff>=_0x20cee1){_0x338fff=_0x20cee1;_0xdf9225=0xc8;}else{_0xdf9225=0xce;}_0x26c405[_0x68e5('0x1f')](_0xdf9225);return _0x26c405['set']('Content-Range',_0xf47af8+'-'+_0x338fff+'/'+_0x20cee1)[_0x68e5('0x20')](_0x23e63b);}return null;};}function patchUpdates(_0x388505){return function(_0xe4c0e3){try{jsonpatch[_0x68e5('0x25')](_0xe4c0e3,_0x388505,!![]);}catch(_0x2c6049){return BPromise[_0x68e5('0x26')](_0x2c6049);}return _0xe4c0e3[_0x68e5('0x27')]();};}function saveUpdates(_0x4b739f,_0x3c4729){return function(_0x21c6b8){if(_0x21c6b8){return _0x21c6b8[_0x68e5('0x28')](_0x4b739f)['then'](function(_0x3873f3){return _0x3873f3;});}return null;};}function removeEntity(_0x31034e,_0x33b366){return function(_0x4e3f3a){if(_0x4e3f3a){return _0x4e3f3a[_0x68e5('0x29')]()[_0x68e5('0x2a')](function(){var _0x2d2ef2=_0x4e3f3a['get']({'plain':!![]});var _0x158f29=_0x68e5('0x2b');return db[_0x68e5('0x2c')][_0x68e5('0x29')]({'where':{'type':_0x158f29,'resourceId':_0x2d2ef2['id']}})[_0x68e5('0x2a')](function(){return _0x4e3f3a;});})[_0x68e5('0x2a')](function(){_0x31034e[_0x68e5('0x1f')](0xcc)[_0x68e5('0x1e')]();});}};}function handleEntityNotFound(_0x1c3ee6,_0x196d95){return function(_0x5962d2){if(!_0x5962d2){_0x1c3ee6[_0x68e5('0x1d')](0x194);}return _0x5962d2;};}function handleError(_0x46354d,_0x4c1308){_0x4c1308=_0x4c1308||0x1f4;return function(_0xa065f4){logger[_0x68e5('0x2d')](_0xa065f4[_0x68e5('0x2e')]);if(_0xa065f4[_0x68e5('0x2f')]){delete _0xa065f4['name'];}_0x46354d[_0x68e5('0x1f')](_0x4c1308)[_0x68e5('0x30')](_0xa065f4);};}exports[_0x68e5('0x31')]=function(_0x500ecf,_0xb1d1b4){var _0x2ad0ce={},_0x30506e={},_0x55ce78={'count':0x0,'rows':[]};var _0x225f9d=_[_0x68e5('0x32')](db[_0x68e5('0x33')][_0x68e5('0x34')],function(_0x1acc5a){return{'name':_0x1acc5a[_0x68e5('0x35')],'type':_0x1acc5a[_0x68e5('0x36')]['key']};});_0x30506e[_0x68e5('0x37')]=_['map'](_0x225f9d,_0x68e5('0x2f'));_0x30506e[_0x68e5('0x38')]=_[_0x68e5('0x39')](_0x500ecf[_0x68e5('0x38')]);_0x30506e[_0x68e5('0x3a')]=_[_0x68e5('0x3b')](_0x30506e[_0x68e5('0x37')],_0x30506e[_0x68e5('0x38')]);_0x2ad0ce[_0x68e5('0x3c')]=_['intersection'](_0x30506e['model'],qs[_0x68e5('0x3d')](_0x500ecf[_0x68e5('0x38')][_0x68e5('0x3d')]));_0x2ad0ce[_0x68e5('0x3c')]=_0x2ad0ce[_0x68e5('0x3c')][_0x68e5('0x3e')]?_0x2ad0ce[_0x68e5('0x3c')]:_0x30506e[_0x68e5('0x37')];if(!_0x500ecf['query'][_0x68e5('0x3f')](_0x68e5('0x40'))){_0x2ad0ce[_0x68e5('0x23')]=qs[_0x68e5('0x23')](_0x500ecf[_0x68e5('0x38')][_0x68e5('0x23')]);_0x2ad0ce['offset']=qs[_0x68e5('0x21')](_0x500ecf['query'][_0x68e5('0x21')]);}_0x2ad0ce[_0x68e5('0x41')]=qs[_0x68e5('0x42')](_0x500ecf['query'][_0x68e5('0x42')]);_0x2ad0ce[_0x68e5('0x43')]=qs[_0x68e5('0x3a')](_['pick'](_0x500ecf['query'],_0x30506e[_0x68e5('0x3a')]),_0x225f9d);if(_0x500ecf[_0x68e5('0x38')][_0x68e5('0x44')]){_0x2ad0ce['where']=_['merge'](_0x2ad0ce['where'],{'$or':_['map'](_0x225f9d,function(_0x58a1e8){if(_0x58a1e8[_0x68e5('0x36')]!==_0x68e5('0x45')){var _0x22e8a0={};_0x22e8a0[_0x58a1e8[_0x68e5('0x2f')]]={'$like':'%'+_0x500ecf[_0x68e5('0x38')]['filter']+'%'};return _0x22e8a0;}})});}_0x2ad0ce=_[_0x68e5('0x46')]({},_0x2ad0ce,_0x500ecf[_0x68e5('0x47')]);var _0x201e10={'where':_0x2ad0ce[_0x68e5('0x43')]};return db[_0x68e5('0x33')][_0x68e5('0x24')](_0x201e10)['then'](function(_0xa4677){_0x55ce78[_0x68e5('0x24')]=_0xa4677;if(_0x500ecf[_0x68e5('0x38')]['includeAll']){_0x2ad0ce[_0x68e5('0x48')]=[{'all':!![]}];}return db[_0x68e5('0x33')][_0x68e5('0x49')](_0x2ad0ce);})['then'](function(_0x5b5c79){_0x55ce78['rows']=_0x5b5c79;return _0x55ce78;})[_0x68e5('0x2a')](respondWithFilteredResult(_0xb1d1b4,_0x2ad0ce))[_0x68e5('0x4a')](handleError(_0xb1d1b4,null));};exports[_0x68e5('0x4b')]=function(_0xbf1fb2,_0x2fb14b){var _0x2632c1={'raw':!![],'where':{'id':_0xbf1fb2[_0x68e5('0x4c')]['id']}},_0x48ddd3={};_0x48ddd3[_0x68e5('0x37')]=_[_0x68e5('0x39')](db[_0x68e5('0x33')][_0x68e5('0x34')]);_0x48ddd3[_0x68e5('0x38')]=_['keys'](_0xbf1fb2[_0x68e5('0x38')]);_0x48ddd3[_0x68e5('0x3a')]=_[_0x68e5('0x3b')](_0x48ddd3[_0x68e5('0x37')],_0x48ddd3['query']);_0x2632c1[_0x68e5('0x3c')]=_['intersection'](_0x48ddd3['model'],qs[_0x68e5('0x3d')](_0xbf1fb2[_0x68e5('0x38')]['fields']));_0x2632c1[_0x68e5('0x3c')]=_0x2632c1['attributes'][_0x68e5('0x3e')]?_0x2632c1[_0x68e5('0x3c')]:_0x48ddd3[_0x68e5('0x37')];if(_0xbf1fb2['query']['includeAll']){_0x2632c1['include']=[{'all':!![]}];}_0x2632c1=_[_0x68e5('0x46')]({},_0x2632c1,_0xbf1fb2[_0x68e5('0x47')]);return db['OpenchannelQueue'][_0x68e5('0x4d')](_0x2632c1)[_0x68e5('0x2a')](handleEntityNotFound(_0x2fb14b,null))[_0x68e5('0x2a')](respondWithResult(_0x2fb14b,null))['catch'](handleError(_0x2fb14b,null));};exports['create']=function(_0x105379,_0x2fc714){return db['OpenchannelQueue']['create'](_0x105379['body'],{})[_0x68e5('0x2a')](function(_0x3cf875){var _0x26330c=_0x105379['user'][_0x68e5('0x4e')]({'plain':!![]});if(!_0x26330c)throw new Error(_0x68e5('0x4f'));if(_0x26330c[_0x68e5('0x50')]==='user'){var _0x51e9c5=_0x3cf875[_0x68e5('0x4e')]({'plain':!![]});var _0x54b24b=_0x68e5('0x2b');return db[_0x68e5('0x51')][_0x68e5('0x4d')]({'where':{'name':_0x54b24b,'userProfileId':_0x26330c[_0x68e5('0x52')]},'raw':!![]})[_0x68e5('0x2a')](function(_0x3099d6){if(_0x3099d6&&_0x3099d6[_0x68e5('0x53')]===0x0){return db[_0x68e5('0x2c')]['create']({'name':_0x51e9c5['name'],'resourceId':_0x51e9c5['id'],'type':_0x3099d6[_0x68e5('0x2f')],'sectionId':_0x3099d6['id']},{})[_0x68e5('0x2a')](function(){return _0x3cf875;});}else{return _0x3cf875;}})[_0x68e5('0x4a')](function(_0x1850b6){logger[_0x68e5('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1850b6);throw _0x1850b6;});}return _0x3cf875;})[_0x68e5('0x2a')](respondWithResult(_0x2fc714,0xc9))[_0x68e5('0x4a')](handleError(_0x2fc714,null));};exports['update']=function(_0x2b4419,_0x27335e){if(_0x2b4419['body']['id']){delete _0x2b4419[_0x68e5('0x54')]['id'];}return db[_0x68e5('0x33')][_0x68e5('0x4d')]({'where':{'id':_0x2b4419[_0x68e5('0x4c')]['id']}})[_0x68e5('0x2a')](handleEntityNotFound(_0x27335e,null))[_0x68e5('0x2a')](saveUpdates(_0x2b4419[_0x68e5('0x54')],null))[_0x68e5('0x2a')](respondWithResult(_0x27335e,null))[_0x68e5('0x4a')](handleError(_0x27335e,null));};exports[_0x68e5('0x29')]=function(_0x1e00b4,_0x3c9731){return db[_0x68e5('0x33')]['find']({'where':{'id':_0x1e00b4[_0x68e5('0x4c')]['id']}})[_0x68e5('0x2a')](handleEntityNotFound(_0x3c9731,null))[_0x68e5('0x2a')](removeEntity(_0x3c9731,null))['catch'](handleError(_0x3c9731,null));};exports[_0x68e5('0x55')]=function(_0x166ab6,_0x17ec31){return db['OpenchannelQueue'][_0x68e5('0x55')]()[_0x68e5('0x2a')](respondWithResult(_0x17ec31,null))['catch'](handleError(_0x17ec31,null));};exports[_0x68e5('0x56')]=function(_0x4f563c,_0x1a1b9f,_0x47c052){var _0x52b300={'raw':!![],'where':{}},_0x57af62={},_0xecf4f6;return db[_0x68e5('0x33')][_0x68e5('0x57')]({'where':{'id':_0x4f563c[_0x68e5('0x4c')]['id']}})[_0x68e5('0x2a')](handleEntityNotFound(_0x1a1b9f,null))[_0x68e5('0x2a')](function(_0xeee2ee){if(_0xeee2ee){_0xecf4f6=_0xeee2ee['get']({'plain':!![]});_0x57af62[_0x68e5('0x37')]=_[_0x68e5('0x39')](db['UserOpenchannelQueue']['rawAttributes']);_0x57af62['query']=_[_0x68e5('0x39')](_0x4f563c[_0x68e5('0x38')]);_0x57af62['filters']=_[_0x68e5('0x3b')](_0x57af62[_0x68e5('0x37')],_0x57af62[_0x68e5('0x38')]);_0x52b300['attributes']=_[_0x68e5('0x3b')](_0x57af62[_0x68e5('0x37')],qs[_0x68e5('0x3d')](_0x4f563c[_0x68e5('0x38')][_0x68e5('0x3d')]));_0x52b300[_0x68e5('0x3c')]=_0x52b300[_0x68e5('0x3c')]['length']?_0x52b300['attributes']:_0x57af62[_0x68e5('0x37')];if(!_0x4f563c[_0x68e5('0x38')]['hasOwnProperty']('nolimit')){_0x52b300[_0x68e5('0x23')]=qs[_0x68e5('0x23')](_0x4f563c[_0x68e5('0x38')][_0x68e5('0x23')]);_0x52b300[_0x68e5('0x21')]=qs[_0x68e5('0x21')](_0x4f563c['query'][_0x68e5('0x21')]);}_0x52b300[_0x68e5('0x41')]=qs[_0x68e5('0x42')](_0x4f563c[_0x68e5('0x38')][_0x68e5('0x42')]);_0x52b300[_0x68e5('0x43')]=qs[_0x68e5('0x3a')](_[_0x68e5('0x58')](_0x4f563c[_0x68e5('0x38')],_0x57af62['filters']));_0x52b300[_0x68e5('0x43')][_0x68e5('0x59')]=_0xeee2ee['id'];if(_0x4f563c[_0x68e5('0x38')]['filter']){_0x52b300[_0x68e5('0x43')]=_[_0x68e5('0x46')](_0x52b300['where'],{'$or':_[_0x68e5('0x32')](_0x52b300[_0x68e5('0x3c')],function(_0x4ff912){var _0x3b24cc={};_0x3b24cc[_0x4ff912]={'$like':'%'+_0x4f563c[_0x68e5('0x38')][_0x68e5('0x44')]+'%'};return _0x3b24cc;})});}_0x52b300=_['merge']({},_0x52b300,_0x4f563c[_0x68e5('0x47')]);return db['UserOpenchannelQueue']['findAll'](_0x52b300);}})[_0x68e5('0x2a')](function(_0x2c9308){if(_0x2c9308){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x2c9308,_0x68e5('0x5a')),'role':'agent'},'attributes':['id',_0x68e5('0x2f'),_0x68e5('0x5b'),'updatedAt',_0x68e5('0x5c')]});}})['then'](function(_0x2593ac){if(_0x2593ac){return{'count':_0x2593ac[_0x68e5('0x24')],'rows':_[_0x68e5('0x32')](_0x2593ac['rows'],function(_0x3426a7){return{'membername':_0x3426a7[_0x68e5('0x2f')],'UserId':_0x3426a7['id'],'queue_name':_0xecf4f6[_0x68e5('0x2f')],'OpenchannelQueueId':_0xecf4f6['id'],'interface':util[_0x68e5('0x5d')](_0x68e5('0x5e'),_0x68e5('0x5f'),_0x3426a7[_0x68e5('0x2f')]),'penalty':0x0,'paused':_0x3426a7['openchannelPause'],'createdAt':_0x3426a7['createdAt'],'updatedAt':_0x3426a7[_0x68e5('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x68e5('0x2a')](respondWithFilteredResult(_0x1a1b9f,_0x52b300))[_0x68e5('0x4a')](handleError(_0x1a1b9f,null));};exports[_0x68e5('0x61')]=function(_0x2cfb55,_0xd9273b,_0xf25a4f){var _0x271c0d={};var _0x217ed1={};var _0x74cff5;var _0x3ab0f5;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x2cfb55[_0x68e5('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd9273b,null))['then'](function(_0x5b9535){if(_0x5b9535){_0x74cff5=_0x5b9535;_0x217ed1['model']=_[_0x68e5('0x39')](db[_0x68e5('0x62')]['rawAttributes']);_0x217ed1[_0x68e5('0x38')]=_[_0x68e5('0x39')](_0x2cfb55[_0x68e5('0x38')]);_0x217ed1[_0x68e5('0x3a')]=_[_0x68e5('0x3b')](_0x217ed1[_0x68e5('0x37')],_0x217ed1['query']);_0x271c0d[_0x68e5('0x3c')]=_['intersection'](_0x217ed1[_0x68e5('0x37')],qs[_0x68e5('0x3d')](_0x2cfb55[_0x68e5('0x38')][_0x68e5('0x3d')]));_0x271c0d['attributes']=_0x271c0d['attributes'][_0x68e5('0x3e')]?_0x271c0d['attributes']:_0x217ed1[_0x68e5('0x37')];_0x271c0d[_0x68e5('0x41')]=qs[_0x68e5('0x42')](_0x2cfb55[_0x68e5('0x38')]['sort']);_0x271c0d[_0x68e5('0x43')]=qs[_0x68e5('0x3a')](_[_0x68e5('0x58')](_0x2cfb55[_0x68e5('0x38')],_0x217ed1['filters']));if(_0x2cfb55[_0x68e5('0x38')]['filter']){_0x271c0d['where']=_[_0x68e5('0x46')](_0x271c0d[_0x68e5('0x43')],{'$or':_[_0x68e5('0x32')](_0x271c0d[_0x68e5('0x3c')],function(_0x193eeb){var _0x4c5e0b={};_0x4c5e0b[_0x193eeb]={'$like':'%'+_0x2cfb55['query'][_0x68e5('0x44')]+'%'};return _0x4c5e0b;})});}_0x271c0d=_[_0x68e5('0x46')]({},_0x271c0d,_0x2cfb55[_0x68e5('0x47')]);return _0x74cff5[_0x68e5('0x61')](_0x271c0d);}})[_0x68e5('0x2a')](function(_0x5cbd9c){if(_0x5cbd9c){_0x3ab0f5=_0x5cbd9c[_0x68e5('0x3e')];if(!_0x2cfb55[_0x68e5('0x38')][_0x68e5('0x3f')](_0x68e5('0x40'))){_0x271c0d['limit']=qs[_0x68e5('0x23')](_0x2cfb55[_0x68e5('0x38')][_0x68e5('0x23')]);_0x271c0d[_0x68e5('0x21')]=qs[_0x68e5('0x21')](_0x2cfb55['query']['offset']);}return _0x74cff5['getTeams'](_0x271c0d);}})[_0x68e5('0x2a')](function(_0x507a12){if(_0x507a12){return _0x507a12?{'count':_0x3ab0f5,'rows':_0x507a12}:null;}})[_0x68e5('0x2a')](respondWithResult(_0xd9273b,null))[_0x68e5('0x4a')](handleError(_0xd9273b,null));};exports[_0x68e5('0x63')]=function(_0x2e7e7c,_0x15e12b,_0x288375){var _0x2d18c2=_0x2e7e7c[_0x68e5('0x54')][_0x68e5('0x64')];return db[_0x68e5('0x62')]['findAll']({'where':{'id':_0x2d18c2},'attributes':['id'],'include':[{'model':db[_0x68e5('0x65')],'as':'Agents','attributes':['id',_0x68e5('0x2f'),_0x68e5('0x66'),'voicePause',_0x68e5('0x67')],'raw':!![]}]})[_0x68e5('0x2a')](function(_0x11f354){if(_0x11f354){var _0x4376a1=_['flatMap'](_0x11f354,function(_0x2b2ade){var _0x1cdb7b=_0x2b2ade[_0x68e5('0x4e')]({'plain':!![]});return _0x1cdb7b[_0x68e5('0x68')];});return db[_0x68e5('0x33')][_0x68e5('0x4d')]({'where':{'id':_0x2e7e7c[_0x68e5('0x4c')]['id']}})[_0x68e5('0x2a')](function(_0x2dd713){return db[_0x68e5('0x69')]['transaction'](function(_0x202eb1){return _0x2dd713[_0x68e5('0x63')](_0x2d18c2,{'transaction':_0x202eb1})['then'](function(){return BPromise[_0x68e5('0x6a')](_0x4376a1,function(_0x31597f){return db[_0x68e5('0x6b')][_0x68e5('0x6c')]({'where':{'UserId':_0x31597f['id'],'OpenchannelQueueId':_0x2e7e7c[_0x68e5('0x4c')]['id']},'transaction':_0x202eb1});});})[_0x68e5('0x2a')](function(){_0x4376a1[_0x68e5('0x6d')](function(_0x10588d){socket[_0x68e5('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x10588d['id'],'OpenchannelQueueId':_0x2dd713['id']});});});});});}})[_0x68e5('0x2a')](respondWithStatusCode(_0x15e12b,null))[_0x68e5('0x4a')](handleError(_0x15e12b,null));};exports[_0x68e5('0x6f')]=function(_0x34518a,_0x409f1a,_0x19e85c){return db['Team'][_0x68e5('0x49')]({'where':{'id':_0x34518a[_0x68e5('0x38')][_0x68e5('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x68e5('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x409f1a,null))['then'](function(_0x57d734){var _0x598442=_[_0x68e5('0x32')](_0x57d734,'id');var _0x106aac=[];var _0x995e3=[];var _0x54ab29=squel[_0x68e5('0x70')]();_0x54ab29[_0x68e5('0x71')](_0x68e5('0x72'))[_0x68e5('0x73')](_0x68e5('0x74'),'tq')[_0x68e5('0x75')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x68e5('0x43')](_0x68e5('0x76'),_0x34518a[_0x68e5('0x4c')]['id']);for(var _0x2b8f4d=0x0;_0x2b8f4d<_0x57d734[_0x68e5('0x3e')];_0x2b8f4d+=0x1){let _0x614de8=_0x57d734[_0x2b8f4d];for(var _0x25c2fd=0x0;_0x25c2fd<_0x614de8['Agents']['length'];_0x25c2fd+=0x1){let _0x22c1ca=_0x614de8[_0x68e5('0x68')][_0x25c2fd];var _0x38e465=_0x54ab29[_0x68e5('0x77')]();_0x38e465[_0x68e5('0x43')](_0x68e5('0x78'),_0x22c1ca['id']);_0x995e3[_0x68e5('0x79')](db[_0x68e5('0x69')][_0x68e5('0x38')](_0x38e465[_0x68e5('0x7a')](),{'type':db['sequelize'][_0x68e5('0x7b')][_0x68e5('0x7c')]})['then'](function(_0x23fcdb){if(_0x23fcdb[_0x68e5('0x3e')]===0x1){return _0x22c1ca['id'];}else{var _0x26b6cb=_[_0x68e5('0x7d')](_[_0x68e5('0x32')](_0x23fcdb,'TeamId'),function(_0x4704e5){return _[_0x68e5('0x7e')](_0x598442,_0x4704e5);});if(_0x26b6cb){return _0x22c1ca['id'];}}}));}}return BPromise[_0x68e5('0x7f')](_0x995e3)['then'](function(_0x36543b){_0x106aac=_(_0x106aac)['union'](_0x36543b)[_0x68e5('0x80')]()[_0x68e5('0x81')]();return db[_0x68e5('0x33')][_0x68e5('0x4d')]({'where':{'id':_0x34518a[_0x68e5('0x4c')]['id']}})['then'](function(_0x2cb687){return db[_0x68e5('0x69')][_0x68e5('0x82')](function(_0x435f60){return _0x2cb687[_0x68e5('0x6f')](_0x34518a[_0x68e5('0x38')]['ids'],{'transaction':_0x435f60})['then'](function(){if(!_[_0x68e5('0x83')](_0x106aac)){return _0x2cb687['removeAgents'](_0x106aac,{'transaction':_0x435f60});}})[_0x68e5('0x2a')](function(){_0x106aac[_0x68e5('0x6d')](function(_0x368f7b){socket[_0x68e5('0x6e')](_0x68e5('0x84'),{'UserId':_0x368f7b,'OpenchannelQueueId':_0x2cb687['id']});});});});});});})[_0x68e5('0x2a')](respondWithStatusCode(_0x409f1a,null))[_0x68e5('0x4a')](handleError(_0x409f1a,null));};exports['addAgents']=function(_0x3ac6ca,_0x310402,_0x3ba36d){return db['OpenchannelQueue'][_0x68e5('0x4d')]({'where':{'id':_0x3ac6ca[_0x68e5('0x4c')]['id']}})[_0x68e5('0x2a')](handleEntityNotFound(_0x310402,null))[_0x68e5('0x2a')](function(_0x53792b){if(_0x53792b){return _0x53792b[_0x68e5('0x85')](_0x3ac6ca['body'][_0x68e5('0x64')],_[_0x68e5('0x86')](_0x3ac6ca['body'],[_0x68e5('0x64'),'id'])||{})['spread'](function(_0x2693f2){for(var _0xf7debf=0x0;_0xf7debf<_0x3ac6ca[_0x68e5('0x54')][_0x68e5('0x64')][_0x68e5('0x3e')];_0xf7debf+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x3ac6ca[_0x68e5('0x54')][_0x68e5('0x64')][_0xf7debf]),'OpenchannelQueueId':Number(_0x3ac6ca[_0x68e5('0x4c')]['id'])});}return _0x2693f2;});}})[_0x68e5('0x2a')](respondWithResult(_0x310402,null))['catch'](handleError(_0x310402,null));};exports[_0x68e5('0x87')]=function(_0x42f508,_0x3026c8,_0x106265){return db[_0x68e5('0x33')][_0x68e5('0x4d')]({'where':{'id':_0x42f508['params']['id']}})[_0x68e5('0x2a')](handleEntityNotFound(_0x3026c8,null))['then'](function(_0x51abb1){if(_0x51abb1){return _0x51abb1[_0x68e5('0x87')](_0x42f508[_0x68e5('0x38')]['ids'])['then'](function(){if(_['isArray'](_0x42f508[_0x68e5('0x38')][_0x68e5('0x64')])){for(var _0x14b125=0x0;_0x14b125<_0x42f508['query'][_0x68e5('0x64')]['length'];_0x14b125+=0x1){socket['emit'](_0x68e5('0x84'),{'UserId':Number(_0x42f508[_0x68e5('0x38')][_0x68e5('0x64')][_0x14b125]),'OpenchannelQueueId':Number(_0x42f508['params']['id'])});}}else{socket[_0x68e5('0x6e')](_0x68e5('0x84'),{'UserId':Number(_0x42f508['query'][_0x68e5('0x64')]),'OpenchannelQueueId':Number(_0x42f508['params']['id'])});}});}})[_0x68e5('0x2a')](respondWithStatusCode(_0x3026c8,null))['catch'](handleError(_0x3026c8,null));};exports[_0x68e5('0x88')]=function(_0x1a467c,_0x1bd2c7,_0x3a42ea){var _0x289325={};var _0x4988e9={};var _0x405850;var _0x9efa5a;return db[_0x68e5('0x33')][_0x68e5('0x57')]({'where':{'id':_0x1a467c['params']['id']}})['then'](handleEntityNotFound(_0x1bd2c7,null))[_0x68e5('0x2a')](function(_0x19207b){if(_0x19207b){_0x405850=_0x19207b;_0x4988e9[_0x68e5('0x37')]=_[_0x68e5('0x39')](db[_0x68e5('0x65')][_0x68e5('0x34')]);_0x4988e9['query']=_[_0x68e5('0x39')](_0x1a467c[_0x68e5('0x38')]);_0x4988e9[_0x68e5('0x3a')]=_[_0x68e5('0x3b')](_0x4988e9[_0x68e5('0x37')],_0x4988e9[_0x68e5('0x38')]);_0x289325['attributes']=_['intersection'](_0x4988e9[_0x68e5('0x37')],qs[_0x68e5('0x3d')](_0x1a467c[_0x68e5('0x38')][_0x68e5('0x3d')]));_0x289325[_0x68e5('0x3c')]=_0x289325[_0x68e5('0x3c')][_0x68e5('0x3e')]?_0x289325[_0x68e5('0x3c')]:_0x4988e9[_0x68e5('0x37')];_0x289325[_0x68e5('0x41')]=qs['sort'](_0x1a467c[_0x68e5('0x38')][_0x68e5('0x42')]);_0x289325[_0x68e5('0x43')]=qs[_0x68e5('0x3a')](_[_0x68e5('0x58')](_0x1a467c[_0x68e5('0x38')],_0x4988e9[_0x68e5('0x3a')]));if(_0x1a467c[_0x68e5('0x38')][_0x68e5('0x44')]){_0x289325['where']=_['merge'](_0x289325['where'],{'$or':_[_0x68e5('0x32')](_0x289325[_0x68e5('0x3c')],function(_0x249de5){var _0x4e3fef={};_0x4e3fef[_0x249de5]={'$like':'%'+_0x1a467c[_0x68e5('0x38')][_0x68e5('0x44')]+'%'};return _0x4e3fef;})});}_0x289325=_[_0x68e5('0x46')]({},_0x289325,_0x1a467c[_0x68e5('0x47')]);return _0x405850['getAgents'](_0x289325);}})[_0x68e5('0x2a')](function(_0x222c83){if(_0x222c83){_0x9efa5a=_0x222c83['length'];if(!_0x1a467c[_0x68e5('0x38')][_0x68e5('0x3f')]('nolimit')){_0x289325[_0x68e5('0x23')]=qs[_0x68e5('0x23')](_0x1a467c[_0x68e5('0x38')][_0x68e5('0x23')]);_0x289325[_0x68e5('0x21')]=qs[_0x68e5('0x21')](_0x1a467c[_0x68e5('0x38')][_0x68e5('0x21')]);}return _0x405850['getAgents'](_0x289325);}})[_0x68e5('0x2a')](function(_0x42aa1a){if(_0x42aa1a){return _0x42aa1a?{'count':_0x9efa5a,'rows':_0x42aa1a}:null;}})[_0x68e5('0x2a')](respondWithResult(_0x1bd2c7,null))[_0x68e5('0x4a')](handleError(_0x1bd2c7,null));};
\ No newline at end of file
+var _0x4f9f=['length','hasOwnProperty','order','sort','where','merge','filter','OpenchannelQueue','catch','show','params','includeAll','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','pick','OpenchannelQueueId','findAll','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f9f,0x172));var _0xf4f9=function(_0x454ea3,_0xc74a1c){_0x454ea3=_0x454ea3-0x0;var _0x5ad18a=_0x4f9f[_0x454ea3];return _0x5ad18a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf4f9('0x0'));var jsonpatch=require(_0xf4f9('0x1'));var rp=require('request-promise');var moment=require(_0xf4f9('0x2'));var BPromise=require(_0xf4f9('0x3'));var Mustache=require(_0xf4f9('0x4'));var util=require(_0xf4f9('0x5'));var path=require(_0xf4f9('0x6'));var sox=require(_0xf4f9('0x7'));var csv=require(_0xf4f9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4f9('0x9'));var _=require('lodash');var squel=require(_0xf4f9('0xa'));var crypto=require(_0xf4f9('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf4f9('0x8'));var querystring=require(_0xf4f9('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf4f9('0xd'));var qs=require(_0xf4f9('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4f9('0xf'));var logger=require(_0xf4f9('0x10'))(_0xf4f9('0x11'));var utils=require('../../config/utils');var config=require(_0xf4f9('0x12'));var licenseUtil=require(_0xf4f9('0x13'));var db=require(_0xf4f9('0x14'))['db'];config['redis']=_[_0xf4f9('0x15')](config[_0xf4f9('0x16')],{'host':_0xf4f9('0x17'),'port':0x18eb});var socket=require(_0xf4f9('0x18'))(new Redis(config[_0xf4f9('0x16')]));require(_0xf4f9('0x19'))[_0xf4f9('0x1a')](socket);function respondWithStatusCode(_0xab3555,_0x5a9914){_0x5a9914=_0x5a9914||0xcc;return function(_0x378725){if(_0x378725){return _0xab3555[_0xf4f9('0x1b')](_0x5a9914);}return _0xab3555[_0xf4f9('0x1c')](_0x5a9914)[_0xf4f9('0x1d')]();};}function respondWithResult(_0x683753,_0x470ebd){_0x470ebd=_0x470ebd||0xc8;return function(_0x5a762b){if(_0x5a762b){return _0x683753[_0xf4f9('0x1c')](_0x470ebd)[_0xf4f9('0x1e')](_0x5a762b);}};}function respondWithFilteredResult(_0xc446a6,_0x2820d1){return function(_0x2d42f1){if(_0x2d42f1){var _0x5ad89c=typeof _0x2820d1[_0xf4f9('0x1f')]==='undefined'&&typeof _0x2820d1[_0xf4f9('0x20')]===_0xf4f9('0x21');var _0x22f5ab=_0x2d42f1[_0xf4f9('0x22')];var _0x4d650d=_0x5ad89c?0x0:_0x2820d1[_0xf4f9('0x1f')];var _0x3bb946=_0x5ad89c?_0x2d42f1[_0xf4f9('0x22')]:_0x2820d1['offset']+_0x2820d1[_0xf4f9('0x20')];var _0x2cf745;if(_0x3bb946>=_0x22f5ab){_0x3bb946=_0x22f5ab;_0x2cf745=0xc8;}else{_0x2cf745=0xce;}_0xc446a6[_0xf4f9('0x1c')](_0x2cf745);return _0xc446a6[_0xf4f9('0x23')](_0xf4f9('0x24'),_0x4d650d+'-'+_0x3bb946+'/'+_0x22f5ab)[_0xf4f9('0x1e')](_0x2d42f1);}return null;};}function patchUpdates(_0x579e0a){return function(_0x25390a){try{jsonpatch[_0xf4f9('0x25')](_0x25390a,_0x579e0a,!![]);}catch(_0xe6e6e){return BPromise[_0xf4f9('0x26')](_0xe6e6e);}return _0x25390a['save']();};}function saveUpdates(_0xc59c6f,_0x2476be){return function(_0x25dd78){if(_0x25dd78){return _0x25dd78[_0xf4f9('0x27')](_0xc59c6f)[_0xf4f9('0x28')](function(_0x1e0f2a){return _0x1e0f2a;});}return null;};}function removeEntity(_0x7cf2e2,_0x26afdd){return function(_0x373d79){if(_0x373d79){return _0x373d79['destroy']()[_0xf4f9('0x28')](function(){var _0x10a6bb=_0x373d79['get']({'plain':!![]});var _0x5b003d=_0xf4f9('0x29');return db[_0xf4f9('0x2a')][_0xf4f9('0x2b')]({'where':{'type':_0x5b003d,'resourceId':_0x10a6bb['id']}})[_0xf4f9('0x28')](function(){return _0x373d79;});})[_0xf4f9('0x28')](function(){_0x7cf2e2['status'](0xcc)[_0xf4f9('0x1d')]();});}};}function handleEntityNotFound(_0x2bf153,_0x1176c1){return function(_0x2b1fd4){if(!_0x2b1fd4){_0x2bf153[_0xf4f9('0x1b')](0x194);}return _0x2b1fd4;};}function handleError(_0x47ccfc,_0x20147d){_0x20147d=_0x20147d||0x1f4;return function(_0x1d1224){logger[_0xf4f9('0x2c')](_0x1d1224[_0xf4f9('0x2d')]);if(_0x1d1224['name']){delete _0x1d1224[_0xf4f9('0x2e')];}_0x47ccfc[_0xf4f9('0x1c')](_0x20147d)[_0xf4f9('0x2f')](_0x1d1224);};}exports['index']=function(_0x74ac21,_0x3090ff){var _0x4d8544={},_0x525651={},_0x2aedda={'count':0x0,'rows':[]};var _0x525de2=_['map'](db['OpenchannelQueue'][_0xf4f9('0x30')],function(_0x354bd7){return{'name':_0x354bd7[_0xf4f9('0x31')],'type':_0x354bd7[_0xf4f9('0x32')]['key']};});_0x525651[_0xf4f9('0x33')]=_[_0xf4f9('0x34')](_0x525de2,_0xf4f9('0x2e'));_0x525651[_0xf4f9('0x35')]=_[_0xf4f9('0x36')](_0x74ac21['query']);_0x525651[_0xf4f9('0x37')]=_[_0xf4f9('0x38')](_0x525651['model'],_0x525651[_0xf4f9('0x35')]);_0x4d8544[_0xf4f9('0x39')]=_[_0xf4f9('0x38')](_0x525651[_0xf4f9('0x33')],qs[_0xf4f9('0x3a')](_0x74ac21[_0xf4f9('0x35')][_0xf4f9('0x3a')]));_0x4d8544[_0xf4f9('0x39')]=_0x4d8544[_0xf4f9('0x39')][_0xf4f9('0x3b')]?_0x4d8544[_0xf4f9('0x39')]:_0x525651['model'];if(!_0x74ac21[_0xf4f9('0x35')][_0xf4f9('0x3c')]('nolimit')){_0x4d8544['limit']=qs[_0xf4f9('0x20')](_0x74ac21['query'][_0xf4f9('0x20')]);_0x4d8544['offset']=qs['offset'](_0x74ac21[_0xf4f9('0x35')][_0xf4f9('0x1f')]);}_0x4d8544[_0xf4f9('0x3d')]=qs[_0xf4f9('0x3e')](_0x74ac21[_0xf4f9('0x35')][_0xf4f9('0x3e')]);_0x4d8544[_0xf4f9('0x3f')]=qs[_0xf4f9('0x37')](_['pick'](_0x74ac21[_0xf4f9('0x35')],_0x525651['filters']),_0x525de2);if(_0x74ac21[_0xf4f9('0x35')]['filter']){_0x4d8544[_0xf4f9('0x3f')]=_[_0xf4f9('0x40')](_0x4d8544[_0xf4f9('0x3f')],{'$or':_[_0xf4f9('0x34')](_0x525de2,function(_0x59e7fe){if(_0x59e7fe[_0xf4f9('0x32')]!=='VIRTUAL'){var _0x255d65={};_0x255d65[_0x59e7fe[_0xf4f9('0x2e')]]={'$like':'%'+_0x74ac21[_0xf4f9('0x35')][_0xf4f9('0x41')]+'%'};return _0x255d65;}})});}_0x4d8544=_[_0xf4f9('0x40')]({},_0x4d8544,_0x74ac21['options']);var _0x246a12={'where':_0x4d8544[_0xf4f9('0x3f')]};return db[_0xf4f9('0x42')][_0xf4f9('0x22')](_0x246a12)['then'](function(_0x48264b){_0x2aedda[_0xf4f9('0x22')]=_0x48264b;if(_0x74ac21['query']['includeAll']){_0x4d8544['include']=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x4d8544);})[_0xf4f9('0x28')](function(_0x2cbcbd){_0x2aedda['rows']=_0x2cbcbd;return _0x2aedda;})[_0xf4f9('0x28')](respondWithFilteredResult(_0x3090ff,_0x4d8544))[_0xf4f9('0x43')](handleError(_0x3090ff,null));};exports[_0xf4f9('0x44')]=function(_0x4a08d6,_0x2fc05a){var _0x54be72={'raw':!![],'where':{'id':_0x4a08d6[_0xf4f9('0x45')]['id']}},_0x1a1527={};_0x1a1527[_0xf4f9('0x33')]=_[_0xf4f9('0x36')](db['OpenchannelQueue'][_0xf4f9('0x30')]);_0x1a1527[_0xf4f9('0x35')]=_[_0xf4f9('0x36')](_0x4a08d6[_0xf4f9('0x35')]);_0x1a1527[_0xf4f9('0x37')]=_['intersection'](_0x1a1527[_0xf4f9('0x33')],_0x1a1527['query']);_0x54be72[_0xf4f9('0x39')]=_[_0xf4f9('0x38')](_0x1a1527[_0xf4f9('0x33')],qs[_0xf4f9('0x3a')](_0x4a08d6[_0xf4f9('0x35')][_0xf4f9('0x3a')]));_0x54be72[_0xf4f9('0x39')]=_0x54be72['attributes']['length']?_0x54be72[_0xf4f9('0x39')]:_0x1a1527['model'];if(_0x4a08d6[_0xf4f9('0x35')][_0xf4f9('0x46')]){_0x54be72[_0xf4f9('0x47')]=[{'all':!![]}];}_0x54be72=_['merge']({},_0x54be72,_0x4a08d6[_0xf4f9('0x48')]);return db['OpenchannelQueue'][_0xf4f9('0x49')](_0x54be72)[_0xf4f9('0x28')](handleEntityNotFound(_0x2fc05a,null))[_0xf4f9('0x28')](respondWithResult(_0x2fc05a,null))[_0xf4f9('0x43')](handleError(_0x2fc05a,null));};exports['create']=function(_0x22179d,_0x171c3e){return db[_0xf4f9('0x42')][_0xf4f9('0x4a')](_0x22179d[_0xf4f9('0x4b')],{})['then'](function(_0x4122fc){var _0x28ebff=_0x22179d['user']['get']({'plain':!![]});if(!_0x28ebff)throw new Error(_0xf4f9('0x4c'));if(_0x28ebff['role']===_0xf4f9('0x4d')){var _0x2c35ce=_0x4122fc[_0xf4f9('0x4e')]({'plain':!![]});var _0x2389e0=_0xf4f9('0x29');return db[_0xf4f9('0x4f')][_0xf4f9('0x49')]({'where':{'name':_0x2389e0,'userProfileId':_0x28ebff[_0xf4f9('0x50')]},'raw':!![]})['then'](function(_0x104004){if(_0x104004&&_0x104004['autoAssociation']===0x0){return db[_0xf4f9('0x2a')][_0xf4f9('0x4a')]({'name':_0x2c35ce[_0xf4f9('0x2e')],'resourceId':_0x2c35ce['id'],'type':_0x104004[_0xf4f9('0x2e')],'sectionId':_0x104004['id']},{})[_0xf4f9('0x28')](function(){return _0x4122fc;});}else{return _0x4122fc;}})[_0xf4f9('0x43')](function(_0x4ef15d){logger[_0xf4f9('0x2c')](_0xf4f9('0x51'),_0x4ef15d);throw _0x4ef15d;});}return _0x4122fc;})['then'](respondWithResult(_0x171c3e,0xc9))['catch'](handleError(_0x171c3e,null));};exports[_0xf4f9('0x27')]=function(_0xef2a3a,_0x43201d){if(_0xef2a3a['body']['id']){delete _0xef2a3a[_0xf4f9('0x4b')]['id'];}return db[_0xf4f9('0x42')][_0xf4f9('0x49')]({'where':{'id':_0xef2a3a[_0xf4f9('0x45')]['id']}})['then'](handleEntityNotFound(_0x43201d,null))[_0xf4f9('0x28')](saveUpdates(_0xef2a3a[_0xf4f9('0x4b')],null))['then'](respondWithResult(_0x43201d,null))[_0xf4f9('0x43')](handleError(_0x43201d,null));};exports[_0xf4f9('0x2b')]=function(_0x536ad2,_0x55a9c4){return db[_0xf4f9('0x42')][_0xf4f9('0x49')]({'where':{'id':_0x536ad2[_0xf4f9('0x45')]['id']}})[_0xf4f9('0x28')](handleEntityNotFound(_0x55a9c4,null))[_0xf4f9('0x28')](removeEntity(_0x55a9c4,null))[_0xf4f9('0x43')](handleError(_0x55a9c4,null));};exports[_0xf4f9('0x52')]=function(_0x53e4c3,_0x17e979){return db[_0xf4f9('0x42')]['describe']()['then'](respondWithResult(_0x17e979,null))['catch'](handleError(_0x17e979,null));};exports[_0xf4f9('0x53')]=function(_0x1a437a,_0x3d4176,_0x59e96a){var _0x28b991={'raw':!![],'where':{}},_0x36c275={},_0x56f12d;return db[_0xf4f9('0x42')][_0xf4f9('0x54')]({'where':{'id':_0x1a437a[_0xf4f9('0x45')]['id']}})[_0xf4f9('0x28')](handleEntityNotFound(_0x3d4176,null))[_0xf4f9('0x28')](function(_0x35dcec){if(_0x35dcec){_0x56f12d=_0x35dcec['get']({'plain':!![]});_0x36c275[_0xf4f9('0x33')]=_[_0xf4f9('0x36')](db[_0xf4f9('0x55')][_0xf4f9('0x30')]);_0x36c275[_0xf4f9('0x35')]=_[_0xf4f9('0x36')](_0x1a437a[_0xf4f9('0x35')]);_0x36c275['filters']=_[_0xf4f9('0x38')](_0x36c275[_0xf4f9('0x33')],_0x36c275[_0xf4f9('0x35')]);_0x28b991[_0xf4f9('0x39')]=_[_0xf4f9('0x38')](_0x36c275[_0xf4f9('0x33')],qs[_0xf4f9('0x3a')](_0x1a437a[_0xf4f9('0x35')][_0xf4f9('0x3a')]));_0x28b991[_0xf4f9('0x39')]=_0x28b991['attributes']['length']?_0x28b991['attributes']:_0x36c275['model'];if(!_0x1a437a[_0xf4f9('0x35')]['hasOwnProperty'](_0xf4f9('0x56'))){_0x28b991[_0xf4f9('0x20')]=qs['limit'](_0x1a437a['query'][_0xf4f9('0x20')]);_0x28b991['offset']=qs[_0xf4f9('0x1f')](_0x1a437a[_0xf4f9('0x35')][_0xf4f9('0x1f')]);}_0x28b991[_0xf4f9('0x3d')]=qs['sort'](_0x1a437a[_0xf4f9('0x35')][_0xf4f9('0x3e')]);_0x28b991[_0xf4f9('0x3f')]=qs['filters'](_[_0xf4f9('0x57')](_0x1a437a[_0xf4f9('0x35')],_0x36c275[_0xf4f9('0x37')]));_0x28b991['where'][_0xf4f9('0x58')]=_0x35dcec['id'];if(_0x1a437a[_0xf4f9('0x35')][_0xf4f9('0x41')]){_0x28b991[_0xf4f9('0x3f')]=_[_0xf4f9('0x40')](_0x28b991[_0xf4f9('0x3f')],{'$or':_[_0xf4f9('0x34')](_0x28b991[_0xf4f9('0x39')],function(_0x4fb67e){var _0x27e7a7={};_0x27e7a7[_0x4fb67e]={'$like':'%'+_0x1a437a['query']['filter']+'%'};return _0x27e7a7;})});}_0x28b991=_['merge']({},_0x28b991,_0x1a437a[_0xf4f9('0x48')]);return db[_0xf4f9('0x55')][_0xf4f9('0x59')](_0x28b991);}})[_0xf4f9('0x28')](function(_0x4c469f){if(_0x4c469f){return db['User'][_0xf4f9('0x5a')]({'where':{'id':_['map'](_0x4c469f,_0xf4f9('0x5b')),'role':_0xf4f9('0x5c')},'attributes':['id',_0xf4f9('0x2e'),_0xf4f9('0x5d'),_0xf4f9('0x5e'),_0xf4f9('0x5f')]});}})['then'](function(_0xff223a){if(_0xff223a){return{'count':_0xff223a[_0xf4f9('0x22')],'rows':_[_0xf4f9('0x34')](_0xff223a[_0xf4f9('0x60')],function(_0x56a671){return{'membername':_0x56a671['name'],'UserId':_0x56a671['id'],'queue_name':_0x56f12d[_0xf4f9('0x2e')],'OpenchannelQueueId':_0x56f12d['id'],'interface':util[_0xf4f9('0x61')](_0xf4f9('0x62'),_0xf4f9('0x63'),_0x56a671['name']),'penalty':0x0,'paused':_0x56a671[_0xf4f9('0x5d')],'createdAt':_0x56a671['createdAt'],'updatedAt':_0x56a671[_0xf4f9('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf4f9('0x28')](respondWithFilteredResult(_0x3d4176,_0x28b991))[_0xf4f9('0x43')](handleError(_0x3d4176,null));};exports[_0xf4f9('0x64')]=function(_0x3b4fc3,_0x30fe41,_0x26115a){var _0x3c219b={};var _0x2c82dc={};var _0x4740cd;var _0x52e4c6;return db[_0xf4f9('0x42')][_0xf4f9('0x54')]({'where':{'id':_0x3b4fc3[_0xf4f9('0x45')]['id']}})[_0xf4f9('0x28')](handleEntityNotFound(_0x30fe41,null))[_0xf4f9('0x28')](function(_0x22b609){if(_0x22b609){_0x4740cd=_0x22b609;_0x2c82dc[_0xf4f9('0x33')]=_[_0xf4f9('0x36')](db['Team']['rawAttributes']);_0x2c82dc[_0xf4f9('0x35')]=_[_0xf4f9('0x36')](_0x3b4fc3[_0xf4f9('0x35')]);_0x2c82dc['filters']=_['intersection'](_0x2c82dc['model'],_0x2c82dc[_0xf4f9('0x35')]);_0x3c219b[_0xf4f9('0x39')]=_['intersection'](_0x2c82dc[_0xf4f9('0x33')],qs[_0xf4f9('0x3a')](_0x3b4fc3['query'][_0xf4f9('0x3a')]));_0x3c219b['attributes']=_0x3c219b[_0xf4f9('0x39')][_0xf4f9('0x3b')]?_0x3c219b['attributes']:_0x2c82dc[_0xf4f9('0x33')];_0x3c219b[_0xf4f9('0x3d')]=qs[_0xf4f9('0x3e')](_0x3b4fc3[_0xf4f9('0x35')]['sort']);_0x3c219b[_0xf4f9('0x3f')]=qs[_0xf4f9('0x37')](_['pick'](_0x3b4fc3[_0xf4f9('0x35')],_0x2c82dc['filters']));if(_0x3b4fc3[_0xf4f9('0x35')][_0xf4f9('0x41')]){_0x3c219b['where']=_['merge'](_0x3c219b[_0xf4f9('0x3f')],{'$or':_[_0xf4f9('0x34')](_0x3c219b['attributes'],function(_0x3dfa79){var _0x5e785e={};_0x5e785e[_0x3dfa79]={'$like':'%'+_0x3b4fc3[_0xf4f9('0x35')][_0xf4f9('0x41')]+'%'};return _0x5e785e;})});}_0x3c219b=_[_0xf4f9('0x40')]({},_0x3c219b,_0x3b4fc3[_0xf4f9('0x48')]);return _0x4740cd['getTeams'](_0x3c219b);}})[_0xf4f9('0x28')](function(_0x27ea0f){if(_0x27ea0f){_0x52e4c6=_0x27ea0f[_0xf4f9('0x3b')];if(!_0x3b4fc3['query']['hasOwnProperty'](_0xf4f9('0x56'))){_0x3c219b[_0xf4f9('0x20')]=qs[_0xf4f9('0x20')](_0x3b4fc3[_0xf4f9('0x35')][_0xf4f9('0x20')]);_0x3c219b[_0xf4f9('0x1f')]=qs[_0xf4f9('0x1f')](_0x3b4fc3[_0xf4f9('0x35')][_0xf4f9('0x1f')]);}return _0x4740cd[_0xf4f9('0x64')](_0x3c219b);}})['then'](function(_0x5f4c0d){if(_0x5f4c0d){return _0x5f4c0d?{'count':_0x52e4c6,'rows':_0x5f4c0d}:null;}})[_0xf4f9('0x28')](respondWithResult(_0x30fe41,null))['catch'](handleError(_0x30fe41,null));};exports[_0xf4f9('0x65')]=function(_0x4225bb,_0x43760c,_0x58ee01){var _0x356ac9=_0x4225bb['body'][_0xf4f9('0x66')];return db['Team'][_0xf4f9('0x59')]({'where':{'id':_0x356ac9},'attributes':['id'],'include':[{'model':db[_0xf4f9('0x67')],'as':'Agents','attributes':['id','name',_0xf4f9('0x68'),_0xf4f9('0x69'),_0xf4f9('0x6a')],'raw':!![]}]})[_0xf4f9('0x28')](function(_0x3f1d46){if(_0x3f1d46){var _0x37bd14=_[_0xf4f9('0x6b')](_0x3f1d46,function(_0x44765a){var _0x5bc7e9=_0x44765a[_0xf4f9('0x4e')]({'plain':!![]});return _0x5bc7e9[_0xf4f9('0x6c')];});return db[_0xf4f9('0x42')][_0xf4f9('0x49')]({'where':{'id':_0x4225bb[_0xf4f9('0x45')]['id']}})[_0xf4f9('0x28')](function(_0x5d0bd7){return db[_0xf4f9('0x6d')][_0xf4f9('0x6e')](function(_0x5f361e){return _0x5d0bd7[_0xf4f9('0x65')](_0x356ac9,{'transaction':_0x5f361e})[_0xf4f9('0x28')](function(){return BPromise[_0xf4f9('0x6f')](_0x37bd14,function(_0x52cad6){return db[_0xf4f9('0x55')]['findOrCreate']({'where':{'UserId':_0x52cad6['id'],'OpenchannelQueueId':_0x4225bb[_0xf4f9('0x45')]['id']},'transaction':_0x5f361e});});})[_0xf4f9('0x28')](function(){_0x37bd14[_0xf4f9('0x70')](function(_0x580355){socket[_0xf4f9('0x71')](_0xf4f9('0x72'),{'UserId':_0x580355['id'],'OpenchannelQueueId':_0x5d0bd7['id']});});});});});}})[_0xf4f9('0x28')](respondWithStatusCode(_0x43760c,null))[_0xf4f9('0x43')](handleError(_0x43760c,null));};exports[_0xf4f9('0x73')]=function(_0x1ff8c3,_0x3e687e,_0x16fe3c){return db[_0xf4f9('0x74')][_0xf4f9('0x59')]({'where':{'id':_0x1ff8c3[_0xf4f9('0x35')][_0xf4f9('0x66')]},'attributes':['id'],'include':[{'model':db[_0xf4f9('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf4f9('0x28')](handleEntityNotFound(_0x3e687e,null))[_0xf4f9('0x28')](function(_0x6e6487){var _0x38c5f0=_[_0xf4f9('0x34')](_0x6e6487,'id');var _0x49a90d=[];var _0x51583a=[];var _0x5d334c=squel[_0xf4f9('0x75')]();_0x5d334c[_0xf4f9('0x76')](_0xf4f9('0x77'))[_0xf4f9('0x78')](_0xf4f9('0x79'),'tq')['join'](_0xf4f9('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf4f9('0x3f')](_0xf4f9('0x7b'),_0x1ff8c3['params']['id']);for(var _0x2756a1=0x0;_0x2756a1<_0x6e6487[_0xf4f9('0x3b')];_0x2756a1+=0x1){let _0x595f49=_0x6e6487[_0x2756a1];for(var _0x2b9063=0x0;_0x2b9063<_0x595f49['Agents'][_0xf4f9('0x3b')];_0x2b9063+=0x1){let _0xbb28f0=_0x595f49['Agents'][_0x2b9063];var _0x994687=_0x5d334c[_0xf4f9('0x7c')]();_0x994687[_0xf4f9('0x3f')](_0xf4f9('0x7d'),_0xbb28f0['id']);_0x51583a[_0xf4f9('0x7e')](db[_0xf4f9('0x6d')][_0xf4f9('0x35')](_0x994687[_0xf4f9('0x7f')](),{'type':db['sequelize']['QueryTypes'][_0xf4f9('0x80')]})[_0xf4f9('0x28')](function(_0x4c2ca6){if(_0x4c2ca6[_0xf4f9('0x3b')]===0x1){return _0xbb28f0['id'];}else{var _0x574e4b=_[_0xf4f9('0x81')](_[_0xf4f9('0x34')](_0x4c2ca6,_0xf4f9('0x82')),function(_0x490ba2){return _[_0xf4f9('0x83')](_0x38c5f0,_0x490ba2);});if(_0x574e4b){return _0xbb28f0['id'];}}}));}}return BPromise[_0xf4f9('0x84')](_0x51583a)['then'](function(_0x52d09c){_0x49a90d=_(_0x49a90d)[_0xf4f9('0x85')](_0x52d09c)[_0xf4f9('0x86')]()[_0xf4f9('0x87')]();return db[_0xf4f9('0x42')][_0xf4f9('0x49')]({'where':{'id':_0x1ff8c3[_0xf4f9('0x45')]['id']}})[_0xf4f9('0x28')](function(_0x11da09){return db['sequelize'][_0xf4f9('0x6e')](function(_0x129415){return _0x11da09['removeTeams'](_0x1ff8c3[_0xf4f9('0x35')][_0xf4f9('0x66')],{'transaction':_0x129415})[_0xf4f9('0x28')](function(){if(!_[_0xf4f9('0x88')](_0x49a90d)){return _0x11da09['removeAgents'](_0x49a90d,{'transaction':_0x129415});}})[_0xf4f9('0x28')](function(){_0x49a90d[_0xf4f9('0x70')](function(_0x5d875c){socket['emit'](_0xf4f9('0x89'),{'UserId':_0x5d875c,'OpenchannelQueueId':_0x11da09['id']});});});});});});})['then'](respondWithStatusCode(_0x3e687e,null))['catch'](handleError(_0x3e687e,null));};exports['addAgents']=function(_0x33ee0e,_0x2d832c,_0x148036){return db[_0xf4f9('0x42')]['find']({'where':{'id':_0x33ee0e[_0xf4f9('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d832c,null))[_0xf4f9('0x28')](function(_0x55b035){if(_0x55b035){return _0x55b035[_0xf4f9('0x8a')](_0x33ee0e['body'][_0xf4f9('0x66')],_['omit'](_0x33ee0e[_0xf4f9('0x4b')],[_0xf4f9('0x66'),'id'])||{})[_0xf4f9('0x8b')](function(_0x4dc028){for(var _0x561cc9=0x0;_0x561cc9<_0x33ee0e[_0xf4f9('0x4b')][_0xf4f9('0x66')][_0xf4f9('0x3b')];_0x561cc9+=0x1){socket[_0xf4f9('0x71')](_0xf4f9('0x72'),{'UserId':Number(_0x33ee0e[_0xf4f9('0x4b')][_0xf4f9('0x66')][_0x561cc9]),'OpenchannelQueueId':Number(_0x33ee0e['params']['id'])});}return _0x4dc028;});}})[_0xf4f9('0x28')](respondWithResult(_0x2d832c,null))['catch'](handleError(_0x2d832c,null));};exports[_0xf4f9('0x8c')]=function(_0x549b1d,_0x3e3977,_0x581fc3){return db[_0xf4f9('0x42')][_0xf4f9('0x49')]({'where':{'id':_0x549b1d[_0xf4f9('0x45')]['id']}})[_0xf4f9('0x28')](handleEntityNotFound(_0x3e3977,null))['then'](function(_0x24ed06){if(_0x24ed06){return _0x24ed06[_0xf4f9('0x8c')](_0x549b1d[_0xf4f9('0x35')][_0xf4f9('0x66')])['then'](function(){if(_[_0xf4f9('0x8d')](_0x549b1d['query'][_0xf4f9('0x66')])){for(var _0x4db4ce=0x0;_0x4db4ce<_0x549b1d[_0xf4f9('0x35')][_0xf4f9('0x66')][_0xf4f9('0x3b')];_0x4db4ce+=0x1){socket[_0xf4f9('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x549b1d[_0xf4f9('0x35')]['ids'][_0x4db4ce]),'OpenchannelQueueId':Number(_0x549b1d['params']['id'])});}}else{socket['emit'](_0xf4f9('0x89'),{'UserId':Number(_0x549b1d['query'][_0xf4f9('0x66')]),'OpenchannelQueueId':Number(_0x549b1d[_0xf4f9('0x45')]['id'])});}});}})[_0xf4f9('0x28')](respondWithStatusCode(_0x3e3977,null))[_0xf4f9('0x43')](handleError(_0x3e3977,null));};exports[_0xf4f9('0x8e')]=function(_0x1b4bfe,_0x212b40,_0x2e7f91){var _0x87c6ce={};var _0x4f6ab1={};var _0x44ea19;var _0x140a50;return db[_0xf4f9('0x42')][_0xf4f9('0x54')]({'where':{'id':_0x1b4bfe[_0xf4f9('0x45')]['id']}})['then'](handleEntityNotFound(_0x212b40,null))[_0xf4f9('0x28')](function(_0x591e5c){if(_0x591e5c){_0x44ea19=_0x591e5c;_0x4f6ab1[_0xf4f9('0x33')]=_[_0xf4f9('0x36')](db['User'][_0xf4f9('0x30')]);_0x4f6ab1[_0xf4f9('0x35')]=_[_0xf4f9('0x36')](_0x1b4bfe[_0xf4f9('0x35')]);_0x4f6ab1[_0xf4f9('0x37')]=_[_0xf4f9('0x38')](_0x4f6ab1['model'],_0x4f6ab1[_0xf4f9('0x35')]);_0x87c6ce['attributes']=_[_0xf4f9('0x38')](_0x4f6ab1[_0xf4f9('0x33')],qs[_0xf4f9('0x3a')](_0x1b4bfe[_0xf4f9('0x35')][_0xf4f9('0x3a')]));_0x87c6ce[_0xf4f9('0x39')]=_0x87c6ce[_0xf4f9('0x39')]['length']?_0x87c6ce['attributes']:_0x4f6ab1[_0xf4f9('0x33')];_0x87c6ce['order']=qs[_0xf4f9('0x3e')](_0x1b4bfe[_0xf4f9('0x35')]['sort']);_0x87c6ce[_0xf4f9('0x3f')]=qs[_0xf4f9('0x37')](_[_0xf4f9('0x57')](_0x1b4bfe['query'],_0x4f6ab1[_0xf4f9('0x37')]));if(_0x1b4bfe[_0xf4f9('0x35')]['filter']){_0x87c6ce[_0xf4f9('0x3f')]=_[_0xf4f9('0x40')](_0x87c6ce['where'],{'$or':_['map'](_0x87c6ce[_0xf4f9('0x39')],function(_0x1e689b){var _0x1d5aa6={};_0x1d5aa6[_0x1e689b]={'$like':'%'+_0x1b4bfe['query'][_0xf4f9('0x41')]+'%'};return _0x1d5aa6;})});}_0x87c6ce=_[_0xf4f9('0x40')]({},_0x87c6ce,_0x1b4bfe['options']);return _0x44ea19[_0xf4f9('0x8e')](_0x87c6ce);}})[_0xf4f9('0x28')](function(_0x5c57bd){if(_0x5c57bd){_0x140a50=_0x5c57bd[_0xf4f9('0x3b')];if(!_0x1b4bfe[_0xf4f9('0x35')][_0xf4f9('0x3c')](_0xf4f9('0x56'))){_0x87c6ce[_0xf4f9('0x20')]=qs['limit'](_0x1b4bfe[_0xf4f9('0x35')]['limit']);_0x87c6ce['offset']=qs[_0xf4f9('0x1f')](_0x1b4bfe['query'][_0xf4f9('0x1f')]);}return _0x44ea19['getAgents'](_0x87c6ce);}})[_0xf4f9('0x28')](function(_0x2ae68a){if(_0x2ae68a){return _0x2ae68a?{'count':_0x140a50,'rows':_0x2ae68a}:null;}})[_0xf4f9('0x28')](respondWithResult(_0x212b40,null))[_0xf4f9('0x43')](handleError(_0x212b40,null));};
\ No newline at end of file
index 6eea6b5..a82b254 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc354=['update','remove','emit','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x3a13cf,_0x478c62){var _0x4817c=function(_0x3a2e75){while(--_0x3a2e75){_0x3a13cf['push'](_0x3a13cf['shift']());}};_0x4817c(++_0x478c62);}(_0xc354,0x19d));var _0x4c35=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc354[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x4c35('0x0'))['db'][_0x4c35('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4c35('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4c35('0x3'),'afterDestroy':_0x4c35('0x4')};function emitEvent(_0x3c8f2c){return function(_0x4dcb5b,_0x51a7f4,_0x53df4e){OpenchannelQueueEvents[_0x4c35('0x5')](_0x3c8f2c+':'+_0x4dcb5b['id'],_0x4dcb5b);OpenchannelQueueEvents[_0x4c35('0x5')](_0x3c8f2c,_0x4dcb5b);_0x53df4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x4c35('0x6')](e,emitEvent(event));}}module[_0x4c35('0x7')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xa496=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','save','update'];(function(_0x5a1a5b,_0x1c8fb9){var _0x36eccd=function(_0x55f735){while(--_0x55f735){_0x5a1a5b['push'](_0x5a1a5b['shift']());}};_0x36eccd(++_0x1c8fb9);}(_0xa496,0x131));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6a49('0x0'));var OpenchannelQueue=require(_0x6a49('0x1'))['db'][_0x6a49('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6a49('0x3'),'afterUpdate':_0x6a49('0x4'),'afterDestroy':_0x6a49('0x5')};function emitEvent(_0x5232c3){return function(_0xa97ba1,_0x5921d4,_0x123c12){OpenchannelQueueEvents[_0x6a49('0x6')](_0x5232c3+':'+_0xa97ba1['id'],_0xa97ba1);OpenchannelQueueEvents['emit'](_0x5232c3,_0xa97ba1);_0x123c12(null);};}for(var e in events){if(events[_0x6a49('0x7')](e)){var event=events[e];OpenchannelQueue[_0x6a49('0x8')](e,emitEvent(event));}}module[_0x6a49('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
index 925a087..7d993c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde9b=['exports','OpenchannelQueue','openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x1976e6,_0x4bba88){var _0x3558e7=function(_0x18d4bf){while(--_0x18d4bf){_0x1976e6['push'](_0x1976e6['shift']());}};_0x3558e7(++_0x4bba88);}(_0xde9b,0xe9));var _0xbde9=function(_0x42b9be,_0x33357d){_0x42b9be=_0x42b9be-0x0;var _0x4ff1ab=_0xde9b[_0x42b9be];return _0x4ff1ab;};'use strict';var _=require('lodash');var util=require(_0xbde9('0x0'));var logger=require(_0xbde9('0x1'))(_0xbde9('0x2'));var moment=require(_0xbde9('0x3'));var BPromise=require(_0xbde9('0x4'));var rp=require(_0xbde9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbde9('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0xbde9('0x7')]=function(_0x152647,_0x13ad40){return _0x152647['define'](_0xbde9('0x8'),attributes,{'tableName':_0xbde9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4868=['openchannel_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0x4868,0x90));var _0x8486=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4868[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8486('0x0'));var util=require(_0x8486('0x1'));var logger=require('../../config/logger')(_0x8486('0x2'));var moment=require(_0x8486('0x3'));var BPromise=require(_0x8486('0x4'));var rp=require(_0x8486('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8486('0x6'));var config=require(_0x8486('0x7'));var attributes=require(_0x8486('0x8'));module[_0x8486('0x9')]=function(_0x12531b,_0x47e809){return _0x12531b[_0x8486('0xa')](_0x8486('0xb'),attributes,{'tableName':_0x8486('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 60e92e7..6249c36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x740c=['model','attributes','map','debug','stringify','ShowOpenchannelQueue','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','limit','include'];(function(_0x1482da,_0x5db2b1){var _0x546a96=function(_0x231910){while(--_0x231910){_0x1482da['push'](_0x1482da['shift']());}};_0x546a96(++_0x5db2b1);}(_0x740c,0x12e));var _0xc740=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x740c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc740('0x0'));var util=require(_0xc740('0x1'));var moment=require(_0xc740('0x2'));var BPromise=require(_0xc740('0x3'));var rs=require(_0xc740('0x4'));var fs=require('fs');var Redis=require(_0xc740('0x5'));var db=require(_0xc740('0x6'))['db'];var utils=require(_0xc740('0x7'));var logger=require('../../config/logger')(_0xc740('0x8'));var config=require('../../config/environment');var jayson=require(_0xc740('0x9'));var client=jayson[_0xc740('0xa')]['http']({'port':0x232a});config[_0xc740('0xb')]=_[_0xc740('0xc')](config['redis'],{'host':_0xc740('0xd'),'port':0x18eb});var socket=require(_0xc740('0xe'))(new Redis(config[_0xc740('0xb')]));require(_0xc740('0xf'))[_0xc740('0x10')](socket);function respondWithRpcPromise(_0x573484,_0x4d4e88,_0x1c3a93){return new BPromise(function(_0x1f3b70,_0x1d4a62){return client[_0xc740('0x11')](_0x573484,_0x1c3a93)['then'](function(_0x13f4af){logger[_0xc740('0x12')](_0xc740('0x13'),_0x4d4e88,'request\x20sent');logger['debug'](_0xc740('0x14'),_0x4d4e88,_0xc740('0x15'),JSON['stringify'](_0x13f4af));if(_0x13f4af[_0xc740('0x16')]){if(_0x13f4af[_0xc740('0x16')][_0xc740('0x17')]===0x1f4){logger[_0xc740('0x16')](_0xc740('0x13'),_0x4d4e88,_0x13f4af['error'][_0xc740('0x18')]);return _0x1d4a62(_0x13f4af[_0xc740('0x16')][_0xc740('0x18')]);}logger['error'](_0xc740('0x13'),_0x4d4e88,_0x13f4af[_0xc740('0x16')]['message']);return _0x1f3b70(_0x13f4af[_0xc740('0x16')]['message']);}else{logger[_0xc740('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x4d4e88,_0xc740('0x15'));_0x1f3b70(_0x13f4af[_0xc740('0x19')][_0xc740('0x18')]);}})[_0xc740('0x1a')](function(_0x49123e){logger[_0xc740('0x16')](_0xc740('0x13'),_0x4d4e88,_0x49123e);_0x1d4a62(_0x49123e);});});}exports[_0xc740('0x1b')]=function(_0x4180fa){var _0x5adf22=this;return new Promise(function(_0x350ae1,_0x117bc7){return db[_0xc740('0x1c')][_0xc740('0x1d')]({'raw':_0x4180fa[_0xc740('0x1e')]?_0x4180fa[_0xc740('0x1e')][_0xc740('0x1f')]===undefined?!![]:![]:!![],'where':_0x4180fa[_0xc740('0x1e')]?_0x4180fa[_0xc740('0x1e')]['where']||null:null,'attributes':_0x4180fa[_0xc740('0x1e')]?_0x4180fa[_0xc740('0x1e')]['attributes']||null:null,'limit':_0x4180fa['options']?_0x4180fa[_0xc740('0x1e')][_0xc740('0x20')]||null:null,'include':_0x4180fa['options']?_0x4180fa[_0xc740('0x1e')][_0xc740('0x21')]?_['map'](_0x4180fa[_0xc740('0x1e')][_0xc740('0x21')],function(_0x41a5a4){return{'model':db[_0x41a5a4[_0xc740('0x22')]],'as':_0x41a5a4['as'],'attributes':_0x41a5a4[_0xc740('0x23')],'include':_0x41a5a4['include']?_[_0xc740('0x24')](_0x41a5a4[_0xc740('0x21')],function(_0x3e1085){return{'model':db[_0x3e1085[_0xc740('0x22')]],'as':_0x3e1085['as'],'attributes':_0x3e1085[_0xc740('0x23')],'include':_0x3e1085[_0xc740('0x21')]?_[_0xc740('0x24')](_0x3e1085[_0xc740('0x21')],function(_0x5e7d61){return{'model':db[_0x5e7d61['model']],'as':_0x5e7d61['as'],'attributes':_0x5e7d61['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fda7f){logger[_0xc740('0x12')]('GetOpenchannelQueue',_0x4180fa);logger[_0xc740('0x25')](_0xc740('0x1b'),_0x4180fa,JSON[_0xc740('0x26')](_0x3fda7f));_0x350ae1(_0x3fda7f);})[_0xc740('0x1a')](function(_0x5f052d){logger['error']('GetOpenchannelQueue',_0x5f052d[_0xc740('0x18')],_0x4180fa);_0x117bc7(_0x5adf22['error'](0x1f4,_0x5f052d[_0xc740('0x18')]));});});};exports[_0xc740('0x27')]=function(_0x3628a1){var _0x32a546=this;return new Promise(function(_0x4c739e,_0x55ab44){return db[_0xc740('0x1c')][_0xc740('0x28')]({'raw':_0x3628a1[_0xc740('0x1e')]?_0x3628a1[_0xc740('0x1e')][_0xc740('0x1f')]===undefined?!![]:![]:!![],'where':_0x3628a1[_0xc740('0x1e')]?_0x3628a1[_0xc740('0x1e')]['where']||null:null,'attributes':_0x3628a1[_0xc740('0x1e')]?_0x3628a1[_0xc740('0x1e')][_0xc740('0x23')]||null:null,'include':_0x3628a1[_0xc740('0x1e')]?_0x3628a1[_0xc740('0x1e')][_0xc740('0x21')]?_[_0xc740('0x24')](_0x3628a1['options']['include'],function(_0x6d1963){return{'model':db[_0x6d1963[_0xc740('0x22')]],'as':_0x6d1963['as'],'attributes':_0x6d1963[_0xc740('0x23')],'include':_0x6d1963[_0xc740('0x21')]?_[_0xc740('0x24')](_0x6d1963[_0xc740('0x21')],function(_0x36c745){return{'model':db[_0x36c745[_0xc740('0x22')]],'as':_0x36c745['as'],'attributes':_0x36c745[_0xc740('0x23')],'include':_0x36c745[_0xc740('0x21')]?_['map'](_0x36c745[_0xc740('0x21')],function(_0x3728df){return{'model':db[_0x3728df[_0xc740('0x22')]],'as':_0x3728df['as'],'attributes':_0x3728df['attributes']};}):[]};}):[]};}):[]:[]})[_0xc740('0x29')](function(_0xee91a8){logger['info'](_0xc740('0x27'),_0x3628a1);logger[_0xc740('0x25')](_0xc740('0x27'),_0x3628a1,JSON[_0xc740('0x26')](_0xee91a8));_0x4c739e(_0xee91a8);})[_0xc740('0x1a')](function(_0x4001f4){logger['error'](_0xc740('0x27'),_0x4001f4[_0xc740('0x18')],_0x3628a1);_0x55ab44(_0x32a546['error'](0x1f4,_0x4001f4[_0xc740('0x18')]));});});};
\ No newline at end of file
+var _0x2071=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','limit','include','attributes','map','model','debug','ShowOpenchannelQueue','find','where','stringify'];(function(_0x3630f9,_0x47f4f8){var _0x41804d=function(_0x2ae2a8){while(--_0x2ae2a8){_0x3630f9['push'](_0x3630f9['shift']());}};_0x41804d(++_0x47f4f8);}(_0x2071,0xa0));var _0x1207=function(_0x55ff21,_0x1540f0){_0x55ff21=_0x55ff21-0x0;var _0x4baf37=_0x2071[_0x55ff21];return _0x4baf37;};'use strict';var _=require(_0x1207('0x0'));var util=require(_0x1207('0x1'));var moment=require(_0x1207('0x2'));var BPromise=require(_0x1207('0x3'));var rs=require(_0x1207('0x4'));var fs=require('fs');var Redis=require(_0x1207('0x5'));var db=require(_0x1207('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1207('0x7'));var config=require(_0x1207('0x8'));var jayson=require(_0x1207('0x9'));var client=jayson[_0x1207('0xa')][_0x1207('0xb')]({'port':0x232a});config['redis']=_[_0x1207('0xc')](config[_0x1207('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x1207('0xe'))(new Redis(config[_0x1207('0xd')]));require(_0x1207('0xf'))[_0x1207('0x10')](socket);function respondWithRpcPromise(_0x2d44fe,_0x54f9b9,_0x13aa18){return new BPromise(function(_0x1ba9db,_0x39db0a){return client['request'](_0x2d44fe,_0x13aa18)[_0x1207('0x11')](function(_0x349dfe){logger[_0x1207('0x12')](_0x1207('0x13'),_0x54f9b9,_0x1207('0x14'));logger['debug'](_0x1207('0x15'),_0x54f9b9,_0x1207('0x14'),JSON['stringify'](_0x349dfe));if(_0x349dfe['error']){if(_0x349dfe['error']['code']===0x1f4){logger[_0x1207('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x54f9b9,_0x349dfe[_0x1207('0x16')][_0x1207('0x17')]);return _0x39db0a(_0x349dfe[_0x1207('0x16')][_0x1207('0x17')]);}logger['error'](_0x1207('0x13'),_0x54f9b9,_0x349dfe[_0x1207('0x16')][_0x1207('0x17')]);return _0x1ba9db(_0x349dfe[_0x1207('0x16')]['message']);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x54f9b9,_0x1207('0x14'));_0x1ba9db(_0x349dfe['result'][_0x1207('0x17')]);}})[_0x1207('0x18')](function(_0x52794a){logger[_0x1207('0x16')](_0x1207('0x13'),_0x54f9b9,_0x52794a);_0x39db0a(_0x52794a);});});}exports[_0x1207('0x19')]=function(_0x448b92){var _0x1e817c=this;return new Promise(function(_0x413539,_0x360e6a){return db[_0x1207('0x1a')][_0x1207('0x1b')]({'raw':_0x448b92['options']?_0x448b92[_0x1207('0x1c')][_0x1207('0x1d')]===undefined?!![]:![]:!![],'where':_0x448b92[_0x1207('0x1c')]?_0x448b92[_0x1207('0x1c')]['where']||null:null,'attributes':_0x448b92[_0x1207('0x1c')]?_0x448b92['options']['attributes']||null:null,'limit':_0x448b92[_0x1207('0x1c')]?_0x448b92[_0x1207('0x1c')][_0x1207('0x1e')]||null:null,'include':_0x448b92['options']?_0x448b92[_0x1207('0x1c')]['include']?_['map'](_0x448b92[_0x1207('0x1c')][_0x1207('0x1f')],function(_0x2f6ab3){return{'model':db[_0x2f6ab3['model']],'as':_0x2f6ab3['as'],'attributes':_0x2f6ab3[_0x1207('0x20')],'include':_0x2f6ab3[_0x1207('0x1f')]?_[_0x1207('0x21')](_0x2f6ab3['include'],function(_0x16ff44){return{'model':db[_0x16ff44[_0x1207('0x22')]],'as':_0x16ff44['as'],'attributes':_0x16ff44['attributes'],'include':_0x16ff44['include']?_[_0x1207('0x21')](_0x16ff44[_0x1207('0x1f')],function(_0x4535ff){return{'model':db[_0x4535ff[_0x1207('0x22')]],'as':_0x4535ff['as'],'attributes':_0x4535ff[_0x1207('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1207('0x11')](function(_0xf99000){logger[_0x1207('0x12')]('GetOpenchannelQueue',_0x448b92);logger[_0x1207('0x23')](_0x1207('0x19'),_0x448b92,JSON['stringify'](_0xf99000));_0x413539(_0xf99000);})[_0x1207('0x18')](function(_0x6f3bc2){logger[_0x1207('0x16')](_0x1207('0x19'),_0x6f3bc2[_0x1207('0x17')],_0x448b92);_0x360e6a(_0x1e817c[_0x1207('0x16')](0x1f4,_0x6f3bc2['message']));});});};exports[_0x1207('0x24')]=function(_0x3efe44){var _0x168bb4=this;return new Promise(function(_0x1c9787,_0x156b76){return db[_0x1207('0x1a')][_0x1207('0x25')]({'raw':_0x3efe44[_0x1207('0x1c')]?_0x3efe44[_0x1207('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3efe44[_0x1207('0x1c')]?_0x3efe44[_0x1207('0x1c')][_0x1207('0x26')]||null:null,'attributes':_0x3efe44[_0x1207('0x1c')]?_0x3efe44[_0x1207('0x1c')]['attributes']||null:null,'include':_0x3efe44['options']?_0x3efe44[_0x1207('0x1c')][_0x1207('0x1f')]?_[_0x1207('0x21')](_0x3efe44[_0x1207('0x1c')]['include'],function(_0x311c24){return{'model':db[_0x311c24['model']],'as':_0x311c24['as'],'attributes':_0x311c24[_0x1207('0x20')],'include':_0x311c24[_0x1207('0x1f')]?_['map'](_0x311c24[_0x1207('0x1f')],function(_0x2bc2db){return{'model':db[_0x2bc2db[_0x1207('0x22')]],'as':_0x2bc2db['as'],'attributes':_0x2bc2db[_0x1207('0x20')],'include':_0x2bc2db['include']?_[_0x1207('0x21')](_0x2bc2db[_0x1207('0x1f')],function(_0x5d3e28){return{'model':db[_0x5d3e28[_0x1207('0x22')]],'as':_0x5d3e28['as'],'attributes':_0x5d3e28[_0x1207('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1207('0x11')](function(_0x236fda){logger[_0x1207('0x12')](_0x1207('0x24'),_0x3efe44);logger[_0x1207('0x23')](_0x1207('0x24'),_0x3efe44,JSON[_0x1207('0x27')](_0x236fda));_0x1c9787(_0x236fda);})[_0x1207('0x18')](function(_0x3d816b){logger[_0x1207('0x16')](_0x1207('0x24'),_0x3d816b[_0x1207('0x17')],_0x3efe44);_0x156b76(_0x168bb4['error'](0x1f4,_0x3d816b[_0x1207('0x17')]));});});};
\ No newline at end of file
index 0b6eef2..552af47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48ef=['remove','update','emit','removeListener','register','openchannelQueue:','save'];(function(_0x2a7ce2,_0x382753){var _0x1e18c3=function(_0x382146){while(--_0x382146){_0x2a7ce2['push'](_0x2a7ce2['shift']());}};_0x1e18c3(++_0x382753);}(_0x48ef,0x1d4));var _0xf48e=function(_0x3a51f0,_0x84e1c7){_0x3a51f0=_0x3a51f0-0x0;var _0x11c7c8=_0x48ef[_0x3a51f0];return _0x11c7c8;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xf48e('0x0'),_0xf48e('0x1'),_0xf48e('0x2')];function createListener(_0x238dcd,_0x158781){return function(_0x13827f){_0x158781[_0xf48e('0x3')](_0x238dcd,_0x13827f);};}function removeListener(_0x8f1403,_0x19b353){return function(){OpenchannelQueueEvents[_0xf48e('0x4')](_0x8f1403,_0x19b353);};}exports[_0xf48e('0x5')]=function(_0x1e3522){for(var _0xb2127c=0x0,_0x124224=events['length'];_0xb2127c<_0x124224;_0xb2127c++){var _0x327d2a=events[_0xb2127c];var _0x3501de=createListener(_0xf48e('0x6')+_0x327d2a,_0x1e3522);OpenchannelQueueEvents['on'](_0x327d2a,_0x3501de);}};
\ No newline at end of file
+var _0x3029=['./openchannelQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0xb76aa,_0x5b09f4){var _0x5c02d0=function(_0x224c48){while(--_0x224c48){_0xb76aa['push'](_0xb76aa['shift']());}};_0x5c02d0(++_0x5b09f4);}(_0x3029,0x130));var _0x9302=function(_0x26cf90,_0x50702d){_0x26cf90=_0x26cf90-0x0;var _0x3e13f6=_0x3029[_0x26cf90];return _0x3e13f6;};'use strict';var OpenchannelQueueEvents=require(_0x9302('0x0'));var events=[_0x9302('0x1'),_0x9302('0x2'),_0x9302('0x3')];function createListener(_0x752ffa,_0x158978){return function(_0x35f470){_0x158978[_0x9302('0x4')](_0x752ffa,_0x35f470);};}function removeListener(_0x2291b2,_0x2ac106){return function(){OpenchannelQueueEvents[_0x9302('0x5')](_0x2291b2,_0x2ac106);};}exports[_0x9302('0x6')]=function(_0x29947a){for(var _0x5cac7d=0x0,_0x46691f=events[_0x9302('0x7')];_0x5cac7d<_0x46691f;_0x5cac7d++){var _0x2474e9=events[_0x5cac7d];var _0x19f064=createListener('openchannelQueue:'+_0x2474e9,_0x29947a);OpenchannelQueueEvents['on'](_0x2474e9,_0x19f064);}};
\ No newline at end of file
index 0a9bdd9..a942000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','show','put','update','delete','destroy','multer','util','path'];(function(_0x52876f,_0x3fc425){var _0x4f1ad1=function(_0x4e0d29){while(--_0x4e0d29){_0x52876f['push'](_0x52876f['shift']());}};_0x4f1ad1(++_0x3fc425);}(_0x9c5d,0x179));var _0xd9c5=function(_0x475d32,_0x45102b){_0x475d32=_0x475d32-0x0;var _0x3adbd3=_0x9c5d[_0x475d32];return _0x3adbd3;};'use strict';var multer=require(_0xd9c5('0x0'));var util=require(_0xd9c5('0x1'));var path=require(_0xd9c5('0x2'));var timeout=require(_0xd9c5('0x3'));var express=require('express');var router=express[_0xd9c5('0x4')]();var fs_extra=require(_0xd9c5('0x5'));var auth=require(_0xd9c5('0x6'));var interaction=require(_0xd9c5('0x7'));var config=require(_0xd9c5('0x8'));var controller=require(_0xd9c5('0x9'));router[_0xd9c5('0xa')]('/',auth[_0xd9c5('0xb')](),controller['index']);router[_0xd9c5('0xa')](_0xd9c5('0xc'),auth[_0xd9c5('0xb')](),controller['describe']);router[_0xd9c5('0xa')](_0xd9c5('0xd'),auth[_0xd9c5('0xb')](),controller[_0xd9c5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd9c5('0xf')](_0xd9c5('0xd'),auth['isAuthenticated'](),controller[_0xd9c5('0x10')]);router[_0xd9c5('0x11')](_0xd9c5('0xd'),auth[_0xd9c5('0xb')](),controller[_0xd9c5('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x63a6=['update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put'];(function(_0x51f0f3,_0x1bba2d){var _0x276e8d=function(_0x6554d9){while(--_0x6554d9){_0x51f0f3['push'](_0x51f0f3['shift']());}};_0x276e8d(++_0x1bba2d);}(_0x63a6,0xf3));var _0x663a=function(_0x1ff085,_0xa5d361){_0x1ff085=_0x1ff085-0x0;var _0x229856=_0x63a6[_0x1ff085];return _0x229856;};'use strict';var multer=require(_0x663a('0x0'));var util=require(_0x663a('0x1'));var path=require(_0x663a('0x2'));var timeout=require('connect-timeout');var express=require(_0x663a('0x3'));var router=express[_0x663a('0x4')]();var fs_extra=require(_0x663a('0x5'));var auth=require(_0x663a('0x6'));var interaction=require(_0x663a('0x7'));var config=require(_0x663a('0x8'));var controller=require('./openchannelQueueReport.controller');router[_0x663a('0x9')]('/',auth[_0x663a('0xa')](),controller[_0x663a('0xb')]);router['get'](_0x663a('0xc'),auth[_0x663a('0xa')](),controller['describe']);router[_0x663a('0x9')](_0x663a('0xd'),auth['isAuthenticated'](),controller[_0x663a('0xe')]);router[_0x663a('0xf')]('/',auth[_0x663a('0xa')](),controller['create']);router[_0x663a('0x10')](_0x663a('0xd'),auth[_0x663a('0xa')](),controller[_0x663a('0x11')]);router['delete'](_0x663a('0xd'),auth['isAuthenticated'](),controller[_0x663a('0x12')]);module[_0x663a('0x13')]=router;
\ No newline at end of file
index d6ed239..f5d8188 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3141=['DATE','moment','exports','STRING'];(function(_0x4aff38,_0x532d4f){var _0x300a0b=function(_0x2721d4){while(--_0x2721d4){_0x4aff38['push'](_0x4aff38['shift']());}};_0x300a0b(++_0x532d4f);}(_0x3141,0x6d));var _0x1314=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3141[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0x1314('0x0'));var Sequelize=require('sequelize');module[_0x1314('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1314('0x2')]},'joinAt':{'type':Sequelize[_0x1314('0x3')]},'leaveAt':{'type':Sequelize[_0x1314('0x3')]},'acceptAt':{'type':Sequelize[_0x1314('0x3')]},'exitAt':{'type':Sequelize[_0x1314('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x15a8=['sequelize','exports','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15a8,0x6d));var _0x815a=function(_0x370572,_0x3aa200){_0x370572=_0x370572-0x0;var _0x5c5390=_0x15a8[_0x370572];return _0x5c5390;};'use strict';var moment=require(_0x815a('0x0'));var Sequelize=require(_0x815a('0x1'));module[_0x815a('0x2')]={'uniqueid':{'type':Sequelize[_0x815a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x815a('0x3')]},'joinAt':{'type':Sequelize[_0x815a('0x4')]},'leaveAt':{'type':Sequelize[_0x815a('0x4')]},'acceptAt':{'type':Sequelize[_0x815a('0x4')]},'exitAt':{'type':Sequelize[_0x815a('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fd7d393..9ad5a64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f4a=['then','destroy','end','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','set','Content-Range','apply','reject','save','update'];(function(_0x485363,_0x321944){var _0x48edd4=function(_0x4cb573){while(--_0x4cb573){_0x485363['push'](_0x485363['shift']());}};_0x48edd4(++_0x321944);}(_0x2f4a,0x160));var _0xa2f4=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2f4a[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0xa2f4('0x0'));var rimraf=require(_0xa2f4('0x1'));var zipdir=require(_0xa2f4('0x2'));var jsonpatch=require(_0xa2f4('0x3'));var rp=require('request-promise');var moment=require(_0xa2f4('0x4'));var BPromise=require(_0xa2f4('0x5'));var Mustache=require(_0xa2f4('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa2f4('0x7'));var csv=require(_0xa2f4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa2f4('0x9'));var _=require(_0xa2f4('0xa'));var squel=require(_0xa2f4('0xb'));var crypto=require(_0xa2f4('0xc'));var jsforce=require(_0xa2f4('0xd'));var deskjs=require(_0xa2f4('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa2f4('0xf'));var Papa=require(_0xa2f4('0x10'));var Redis=require(_0xa2f4('0x11'));var authService=require(_0xa2f4('0x12'));var qs=require(_0xa2f4('0x13'));var as=require(_0xa2f4('0x14'));var hardwareService=require(_0xa2f4('0x15'));var logger=require(_0xa2f4('0x16'))(_0xa2f4('0x17'));var utils=require(_0xa2f4('0x18'));var config=require(_0xa2f4('0x19'));var licenseUtil=require(_0xa2f4('0x1a'));var db=require(_0xa2f4('0x1b'))['db'];function respondWithStatusCode(_0x5aba7a,_0x384dd4){_0x384dd4=_0x384dd4||0xcc;return function(_0x130147){if(_0x130147){return _0x5aba7a['sendStatus'](_0x384dd4);}return _0x5aba7a[_0xa2f4('0x1c')](_0x384dd4)['end']();};}function respondWithResult(_0x786a0d,_0xff1e62){_0xff1e62=_0xff1e62||0xc8;return function(_0x11d08){if(_0x11d08){return _0x786a0d['status'](_0xff1e62)[_0xa2f4('0x1d')](_0x11d08);}};}function respondWithFilteredResult(_0x598b01,_0x470291){return function(_0x5a43f1){if(_0x5a43f1){var _0x25dc14=typeof _0x470291[_0xa2f4('0x1e')]==='undefined'&&typeof _0x470291['limit']==='undefined';var _0x221aa9=_0x5a43f1[_0xa2f4('0x1f')];var _0xf4cd31=_0x25dc14?0x0:_0x470291['offset'];var _0x505d72=_0x25dc14?_0x5a43f1[_0xa2f4('0x1f')]:_0x470291['offset']+_0x470291['limit'];var _0xc65dd3;if(_0x505d72>=_0x221aa9){_0x505d72=_0x221aa9;_0xc65dd3=0xc8;}else{_0xc65dd3=0xce;}_0x598b01[_0xa2f4('0x1c')](_0xc65dd3);return _0x598b01[_0xa2f4('0x20')](_0xa2f4('0x21'),_0xf4cd31+'-'+_0x505d72+'/'+_0x221aa9)['json'](_0x5a43f1);}return null;};}function patchUpdates(_0x584dfd){return function(_0x3161b2){try{jsonpatch[_0xa2f4('0x22')](_0x3161b2,_0x584dfd,!![]);}catch(_0x247261){return BPromise[_0xa2f4('0x23')](_0x247261);}return _0x3161b2[_0xa2f4('0x24')]();};}function saveUpdates(_0x4ee642,_0x3e15cf){return function(_0x5f417b){if(_0x5f417b){return _0x5f417b[_0xa2f4('0x25')](_0x4ee642)[_0xa2f4('0x26')](function(_0x19dbbc){return _0x19dbbc;});}return null;};}function removeEntity(_0x23620c,_0x117840){return function(_0x410dd2){if(_0x410dd2){return _0x410dd2[_0xa2f4('0x27')]()['then'](function(){_0x23620c[_0xa2f4('0x1c')](0xcc)[_0xa2f4('0x28')]();});}};}function handleEntityNotFound(_0x35480c,_0x2ff7c){return function(_0x2833e3){if(!_0x2833e3){_0x35480c['sendStatus'](0x194);}return _0x2833e3;};}function handleError(_0x520eed,_0x5c9903){_0x5c9903=_0x5c9903||0x1f4;return function(_0x1f03db){logger[_0xa2f4('0x29')](_0x1f03db['stack']);if(_0x1f03db[_0xa2f4('0x2a')]){delete _0x1f03db[_0xa2f4('0x2a')];}_0x520eed[_0xa2f4('0x1c')](_0x5c9903)[_0xa2f4('0x2b')](_0x1f03db);};}exports[_0xa2f4('0x2c')]=function(_0xdb7694,_0x121452){var _0x22cbcb={},_0x4426bf={},_0xd5bd3c={'count':0x0,'rows':[]};var _0x2ace52=_[_0xa2f4('0x2d')](db[_0xa2f4('0x2e')][_0xa2f4('0x2f')],function(_0x5cdcb8){return{'name':_0x5cdcb8[_0xa2f4('0x30')],'type':_0x5cdcb8[_0xa2f4('0x31')][_0xa2f4('0x32')]};});_0x4426bf[_0xa2f4('0x33')]=_[_0xa2f4('0x2d')](_0x2ace52,_0xa2f4('0x2a'));_0x4426bf[_0xa2f4('0x34')]=_[_0xa2f4('0x35')](_0xdb7694['query']);_0x4426bf[_0xa2f4('0x36')]=_[_0xa2f4('0x37')](_0x4426bf['model'],_0x4426bf['query']);_0x22cbcb[_0xa2f4('0x38')]=_[_0xa2f4('0x37')](_0x4426bf[_0xa2f4('0x33')],qs[_0xa2f4('0x39')](_0xdb7694[_0xa2f4('0x34')][_0xa2f4('0x39')]));_0x22cbcb['attributes']=_0x22cbcb[_0xa2f4('0x38')][_0xa2f4('0x3a')]?_0x22cbcb[_0xa2f4('0x38')]:_0x4426bf['model'];if(!_0xdb7694[_0xa2f4('0x34')][_0xa2f4('0x3b')]('nolimit')){_0x22cbcb['limit']=qs[_0xa2f4('0x3c')](_0xdb7694[_0xa2f4('0x34')][_0xa2f4('0x3c')]);_0x22cbcb[_0xa2f4('0x1e')]=qs[_0xa2f4('0x1e')](_0xdb7694['query'][_0xa2f4('0x1e')]);}_0x22cbcb['order']=qs['sort'](_0xdb7694[_0xa2f4('0x34')][_0xa2f4('0x3d')]);_0x22cbcb[_0xa2f4('0x3e')]=qs[_0xa2f4('0x36')](_[_0xa2f4('0x3f')](_0xdb7694[_0xa2f4('0x34')],_0x4426bf[_0xa2f4('0x36')]),_0x2ace52);if(_0xdb7694[_0xa2f4('0x34')][_0xa2f4('0x40')]){_0x22cbcb[_0xa2f4('0x3e')]=_[_0xa2f4('0x41')](_0x22cbcb[_0xa2f4('0x3e')],{'$or':_[_0xa2f4('0x2d')](_0x2ace52,function(_0x32ac62){if(_0x32ac62[_0xa2f4('0x31')]!=='VIRTUAL'){var _0x279fe4={};_0x279fe4[_0x32ac62[_0xa2f4('0x2a')]]={'$like':'%'+_0xdb7694[_0xa2f4('0x34')][_0xa2f4('0x40')]+'%'};return _0x279fe4;}})});}_0x22cbcb=_[_0xa2f4('0x41')]({},_0x22cbcb,_0xdb7694[_0xa2f4('0x42')]);var _0x992250={'where':_0x22cbcb[_0xa2f4('0x3e')]};return db['OpenchannelQueueReport'][_0xa2f4('0x1f')](_0x992250)[_0xa2f4('0x26')](function(_0x1d9f53){_0xd5bd3c[_0xa2f4('0x1f')]=_0x1d9f53;if(_0xdb7694[_0xa2f4('0x34')][_0xa2f4('0x43')]){_0x22cbcb[_0xa2f4('0x44')]=[{'all':!![]}];}return db[_0xa2f4('0x2e')][_0xa2f4('0x45')](_0x22cbcb);})['then'](function(_0x475a02){_0xd5bd3c[_0xa2f4('0x46')]=_0x475a02;return _0xd5bd3c;})[_0xa2f4('0x26')](respondWithFilteredResult(_0x121452,_0x22cbcb))[_0xa2f4('0x47')](handleError(_0x121452,null));};exports[_0xa2f4('0x48')]=function(_0x3b59d3,_0x15bc89){var _0x567703={'raw':!![],'where':{'id':_0x3b59d3[_0xa2f4('0x49')]['id']}},_0x3fe126={};_0x3fe126[_0xa2f4('0x33')]=_[_0xa2f4('0x35')](db['OpenchannelQueueReport'][_0xa2f4('0x2f')]);_0x3fe126[_0xa2f4('0x34')]=_[_0xa2f4('0x35')](_0x3b59d3[_0xa2f4('0x34')]);_0x3fe126['filters']=_[_0xa2f4('0x37')](_0x3fe126['model'],_0x3fe126['query']);_0x567703[_0xa2f4('0x38')]=_[_0xa2f4('0x37')](_0x3fe126[_0xa2f4('0x33')],qs['fields'](_0x3b59d3['query']['fields']));_0x567703[_0xa2f4('0x38')]=_0x567703[_0xa2f4('0x38')][_0xa2f4('0x3a')]?_0x567703[_0xa2f4('0x38')]:_0x3fe126[_0xa2f4('0x33')];if(_0x3b59d3[_0xa2f4('0x34')][_0xa2f4('0x43')]){_0x567703['include']=[{'all':!![]}];}_0x567703=_[_0xa2f4('0x41')]({},_0x567703,_0x3b59d3['options']);return db[_0xa2f4('0x2e')][_0xa2f4('0x4a')](_0x567703)[_0xa2f4('0x26')](handleEntityNotFound(_0x15bc89,null))[_0xa2f4('0x26')](respondWithResult(_0x15bc89,null))[_0xa2f4('0x47')](handleError(_0x15bc89,null));};exports[_0xa2f4('0x4b')]=function(_0x1a0869,_0x1a7923){return db[_0xa2f4('0x2e')][_0xa2f4('0x4b')](_0x1a0869[_0xa2f4('0x4c')],{})[_0xa2f4('0x26')](respondWithResult(_0x1a7923,0xc9))[_0xa2f4('0x47')](handleError(_0x1a7923,null));};exports[_0xa2f4('0x25')]=function(_0x3d26dc,_0x1403b2){if(_0x3d26dc['body']['id']){delete _0x3d26dc[_0xa2f4('0x4c')]['id'];}return db[_0xa2f4('0x2e')][_0xa2f4('0x4a')]({'where':{'id':_0x3d26dc['params']['id']}})[_0xa2f4('0x26')](handleEntityNotFound(_0x1403b2,null))[_0xa2f4('0x26')](saveUpdates(_0x3d26dc[_0xa2f4('0x4c')],null))['then'](respondWithResult(_0x1403b2,null))[_0xa2f4('0x47')](handleError(_0x1403b2,null));};exports[_0xa2f4('0x27')]=function(_0x40c208,_0x41b78f){return db[_0xa2f4('0x2e')][_0xa2f4('0x4a')]({'where':{'id':_0x40c208[_0xa2f4('0x49')]['id']}})[_0xa2f4('0x26')](handleEntityNotFound(_0x41b78f,null))[_0xa2f4('0x26')](removeEntity(_0x41b78f,null))[_0xa2f4('0x47')](handleError(_0x41b78f,null));};exports[_0xa2f4('0x4d')]=function(_0x3093e6,_0x203ca7){return db[_0xa2f4('0x2e')][_0xa2f4('0x4d')]()[_0xa2f4('0x26')](respondWithResult(_0x203ca7,null))[_0xa2f4('0x47')](handleError(_0x203ca7,null));};
\ No newline at end of file
+var _0xd025=['count','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','rows','catch','show','params','includeAll','include','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit'];(function(_0x594439,_0x606806){var _0x580141=function(_0x38c8de){while(--_0x38c8de){_0x594439['push'](_0x594439['shift']());}};_0x580141(++_0x606806);}(_0xd025,0x6b));var _0x5d02=function(_0x273b37,_0x1c9138){_0x273b37=_0x273b37-0x0;var _0x10737e=_0xd025[_0x273b37];return _0x10737e;};'use strict';var emlformat=require(_0x5d02('0x0'));var rimraf=require(_0x5d02('0x1'));var zipdir=require(_0x5d02('0x2'));var jsonpatch=require(_0x5d02('0x3'));var rp=require('request-promise');var moment=require(_0x5d02('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d02('0x5'));var path=require(_0x5d02('0x6'));var sox=require(_0x5d02('0x7'));var csv=require(_0x5d02('0x8'));var ejs=require(_0x5d02('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5d02('0xa'));var deskjs=require(_0x5d02('0xb'));var toCsv=require(_0x5d02('0x8'));var querystring=require('querystring');var Papa=require(_0x5d02('0xc'));var Redis=require('ioredis');var authService=require(_0x5d02('0xd'));var qs=require(_0x5d02('0xe'));var as=require(_0x5d02('0xf'));var hardwareService=require(_0x5d02('0x10'));var logger=require(_0x5d02('0x11'))('api');var utils=require(_0x5d02('0x12'));var config=require(_0x5d02('0x13'));var licenseUtil=require(_0x5d02('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x63a0ad,_0x4ed938){_0x4ed938=_0x4ed938||0xcc;return function(_0x4c26a0){if(_0x4c26a0){return _0x63a0ad[_0x5d02('0x15')](_0x4ed938);}return _0x63a0ad[_0x5d02('0x16')](_0x4ed938)[_0x5d02('0x17')]();};}function respondWithResult(_0x2fabc9,_0x3f1dac){_0x3f1dac=_0x3f1dac||0xc8;return function(_0x2956b8){if(_0x2956b8){return _0x2fabc9[_0x5d02('0x16')](_0x3f1dac)['json'](_0x2956b8);}};}function respondWithFilteredResult(_0x36c51b,_0x350c3a){return function(_0x4fe4ac){if(_0x4fe4ac){var _0x372b42=typeof _0x350c3a[_0x5d02('0x18')]===_0x5d02('0x19')&&typeof _0x350c3a[_0x5d02('0x1a')]===_0x5d02('0x19');var _0x495d18=_0x4fe4ac[_0x5d02('0x1b')];var _0x3e0619=_0x372b42?0x0:_0x350c3a['offset'];var _0xaf10a=_0x372b42?_0x4fe4ac[_0x5d02('0x1b')]:_0x350c3a[_0x5d02('0x18')]+_0x350c3a[_0x5d02('0x1a')];var _0x37ba59;if(_0xaf10a>=_0x495d18){_0xaf10a=_0x495d18;_0x37ba59=0xc8;}else{_0x37ba59=0xce;}_0x36c51b[_0x5d02('0x16')](_0x37ba59);return _0x36c51b[_0x5d02('0x1c')](_0x5d02('0x1d'),_0x3e0619+'-'+_0xaf10a+'/'+_0x495d18)[_0x5d02('0x1e')](_0x4fe4ac);}return null;};}function patchUpdates(_0x25d756){return function(_0x5cbc7c){try{jsonpatch['apply'](_0x5cbc7c,_0x25d756,!![]);}catch(_0x36294f){return BPromise['reject'](_0x36294f);}return _0x5cbc7c[_0x5d02('0x1f')]();};}function saveUpdates(_0x2993cd,_0x1341f4){return function(_0x3cb0b3){if(_0x3cb0b3){return _0x3cb0b3[_0x5d02('0x20')](_0x2993cd)[_0x5d02('0x21')](function(_0x36bac9){return _0x36bac9;});}return null;};}function removeEntity(_0x5b0416,_0x29e2b2){return function(_0x2cb684){if(_0x2cb684){return _0x2cb684[_0x5d02('0x22')]()[_0x5d02('0x21')](function(){_0x5b0416[_0x5d02('0x16')](0xcc)[_0x5d02('0x17')]();});}};}function handleEntityNotFound(_0x1fff29,_0x1a94ed){return function(_0x10c481){if(!_0x10c481){_0x1fff29[_0x5d02('0x15')](0x194);}return _0x10c481;};}function handleError(_0x221acf,_0x22b4bf){_0x22b4bf=_0x22b4bf||0x1f4;return function(_0x5451a){logger[_0x5d02('0x23')](_0x5451a[_0x5d02('0x24')]);if(_0x5451a[_0x5d02('0x25')]){delete _0x5451a[_0x5d02('0x25')];}_0x221acf['status'](_0x22b4bf)[_0x5d02('0x26')](_0x5451a);};}exports[_0x5d02('0x27')]=function(_0x5d4ced,_0x38d136){var _0x345e91={},_0x172fbb={},_0x1b13f7={'count':0x0,'rows':[]};var _0x174e79=_[_0x5d02('0x28')](db[_0x5d02('0x29')]['rawAttributes'],function(_0x4a0582){return{'name':_0x4a0582[_0x5d02('0x2a')],'type':_0x4a0582['type'][_0x5d02('0x2b')]};});_0x172fbb[_0x5d02('0x2c')]=_['map'](_0x174e79,_0x5d02('0x25'));_0x172fbb[_0x5d02('0x2d')]=_[_0x5d02('0x2e')](_0x5d4ced['query']);_0x172fbb[_0x5d02('0x2f')]=_[_0x5d02('0x30')](_0x172fbb[_0x5d02('0x2c')],_0x172fbb[_0x5d02('0x2d')]);_0x345e91[_0x5d02('0x31')]=_['intersection'](_0x172fbb[_0x5d02('0x2c')],qs[_0x5d02('0x32')](_0x5d4ced['query'][_0x5d02('0x32')]));_0x345e91['attributes']=_0x345e91[_0x5d02('0x31')][_0x5d02('0x33')]?_0x345e91['attributes']:_0x172fbb[_0x5d02('0x2c')];if(!_0x5d4ced[_0x5d02('0x2d')][_0x5d02('0x34')]('nolimit')){_0x345e91[_0x5d02('0x1a')]=qs[_0x5d02('0x1a')](_0x5d4ced['query'][_0x5d02('0x1a')]);_0x345e91[_0x5d02('0x18')]=qs[_0x5d02('0x18')](_0x5d4ced['query'][_0x5d02('0x18')]);}_0x345e91['order']=qs[_0x5d02('0x35')](_0x5d4ced[_0x5d02('0x2d')][_0x5d02('0x35')]);_0x345e91['where']=qs[_0x5d02('0x2f')](_[_0x5d02('0x36')](_0x5d4ced[_0x5d02('0x2d')],_0x172fbb['filters']),_0x174e79);if(_0x5d4ced[_0x5d02('0x2d')][_0x5d02('0x37')]){_0x345e91[_0x5d02('0x38')]=_[_0x5d02('0x39')](_0x345e91[_0x5d02('0x38')],{'$or':_[_0x5d02('0x28')](_0x174e79,function(_0x74bf74){if(_0x74bf74['type']!=='VIRTUAL'){var _0x248f27={};_0x248f27[_0x74bf74[_0x5d02('0x25')]]={'$like':'%'+_0x5d4ced[_0x5d02('0x2d')][_0x5d02('0x37')]+'%'};return _0x248f27;}})});}_0x345e91=_[_0x5d02('0x39')]({},_0x345e91,_0x5d4ced['options']);var _0x2a6e5f={'where':_0x345e91[_0x5d02('0x38')]};return db['OpenchannelQueueReport'][_0x5d02('0x1b')](_0x2a6e5f)[_0x5d02('0x21')](function(_0x3f441e){_0x1b13f7[_0x5d02('0x1b')]=_0x3f441e;if(_0x5d4ced[_0x5d02('0x2d')]['includeAll']){_0x345e91['include']=[{'all':!![]}];}return db[_0x5d02('0x29')]['findAll'](_0x345e91);})[_0x5d02('0x21')](function(_0x227a08){_0x1b13f7[_0x5d02('0x3a')]=_0x227a08;return _0x1b13f7;})[_0x5d02('0x21')](respondWithFilteredResult(_0x38d136,_0x345e91))[_0x5d02('0x3b')](handleError(_0x38d136,null));};exports[_0x5d02('0x3c')]=function(_0x1b2e92,_0x4afef4){var _0xe00a32={'raw':!![],'where':{'id':_0x1b2e92[_0x5d02('0x3d')]['id']}},_0x78f465={};_0x78f465[_0x5d02('0x2c')]=_[_0x5d02('0x2e')](db[_0x5d02('0x29')]['rawAttributes']);_0x78f465[_0x5d02('0x2d')]=_[_0x5d02('0x2e')](_0x1b2e92[_0x5d02('0x2d')]);_0x78f465[_0x5d02('0x2f')]=_[_0x5d02('0x30')](_0x78f465['model'],_0x78f465[_0x5d02('0x2d')]);_0xe00a32[_0x5d02('0x31')]=_[_0x5d02('0x30')](_0x78f465[_0x5d02('0x2c')],qs['fields'](_0x1b2e92[_0x5d02('0x2d')][_0x5d02('0x32')]));_0xe00a32[_0x5d02('0x31')]=_0xe00a32[_0x5d02('0x31')][_0x5d02('0x33')]?_0xe00a32['attributes']:_0x78f465[_0x5d02('0x2c')];if(_0x1b2e92[_0x5d02('0x2d')][_0x5d02('0x3e')]){_0xe00a32[_0x5d02('0x3f')]=[{'all':!![]}];}_0xe00a32=_[_0x5d02('0x39')]({},_0xe00a32,_0x1b2e92['options']);return db[_0x5d02('0x29')]['find'](_0xe00a32)[_0x5d02('0x21')](handleEntityNotFound(_0x4afef4,null))[_0x5d02('0x21')](respondWithResult(_0x4afef4,null))[_0x5d02('0x3b')](handleError(_0x4afef4,null));};exports[_0x5d02('0x40')]=function(_0x516c2c,_0x46e9db){return db[_0x5d02('0x29')][_0x5d02('0x40')](_0x516c2c[_0x5d02('0x41')],{})[_0x5d02('0x21')](respondWithResult(_0x46e9db,0xc9))['catch'](handleError(_0x46e9db,null));};exports['update']=function(_0x328dca,_0x1c2a2e){if(_0x328dca['body']['id']){delete _0x328dca[_0x5d02('0x41')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x328dca[_0x5d02('0x3d')]['id']}})[_0x5d02('0x21')](handleEntityNotFound(_0x1c2a2e,null))[_0x5d02('0x21')](saveUpdates(_0x328dca[_0x5d02('0x41')],null))[_0x5d02('0x21')](respondWithResult(_0x1c2a2e,null))[_0x5d02('0x3b')](handleError(_0x1c2a2e,null));};exports[_0x5d02('0x22')]=function(_0x2f1301,_0x38286e){return db[_0x5d02('0x29')]['find']({'where':{'id':_0x2f1301[_0x5d02('0x3d')]['id']}})[_0x5d02('0x21')](handleEntityNotFound(_0x38286e,null))[_0x5d02('0x21')](removeEntity(_0x38286e,null))[_0x5d02('0x3b')](handleError(_0x38286e,null));};exports[_0x5d02('0x42')]=function(_0x3f1101,_0x2fcf5f){return db[_0x5d02('0x29')][_0x5d02('0x42')]()[_0x5d02('0x21')](respondWithResult(_0x2fcf5f,null))[_0x5d02('0x3b')](handleError(_0x2fcf5f,null));};
\ No newline at end of file
index 8976409..aa674b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x15b527,_0x56105e){var _0x2e8b46=function(_0x45d54b){while(--_0x45d54b){_0x15b527['push'](_0x15b527['shift']());}};_0x2e8b46(++_0x56105e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x5fc3[_0x597484];return _0x218e64;};'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')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x356a31,_0x3e195b){var _0x385b6f=function(_0x44ee52){while(--_0x44ee52){_0x356a31['push'](_0x356a31['shift']());}};_0x385b6f(++_0x3e195b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index cf82140..e5b63c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eba=['jayson/promise','client','http','then','info','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','debug','catch','UpdateOpenchannelQueueReport','update','where','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x31b8f1,_0x28f2c8){var _0x159b53=function(_0x16b60e){while(--_0x16b60e){_0x31b8f1['push'](_0x31b8f1['shift']());}};_0x159b53(++_0x28f2c8);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x1eba[_0x368bba];return _0x409f8f;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));var BPromise=require(_0xa1eb('0x3'));var rs=require(_0xa1eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa1eb('0x5'));var logger=require(_0xa1eb('0x6'))(_0xa1eb('0x7'));var config=require(_0xa1eb('0x8'));var jayson=require(_0xa1eb('0x9'));var client=jayson[_0xa1eb('0xa')][_0xa1eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bfbb0,_0x39a5a3,_0x7d2982){return new BPromise(function(_0x2aebb6,_0x9d7113){return client['request'](_0x2bfbb0,_0x7d2982)[_0xa1eb('0xc')](function(_0x4d4aaf){logger[_0xa1eb('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x39a5a3,_0xa1eb('0xe'));logger['debug'](_0xa1eb('0xf'),_0x39a5a3,'request\x20sent',JSON[_0xa1eb('0x10')](_0x4d4aaf));if(_0x4d4aaf[_0xa1eb('0x11')]){if(_0x4d4aaf[_0xa1eb('0x11')]['code']===0x1f4){logger[_0xa1eb('0x11')](_0xa1eb('0x12'),_0x39a5a3,_0x4d4aaf['error'][_0xa1eb('0x13')]);return _0x9d7113(_0x4d4aaf['error']['message']);}logger[_0xa1eb('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x39a5a3,_0x4d4aaf[_0xa1eb('0x11')][_0xa1eb('0x13')]);return _0x2aebb6(_0x4d4aaf[_0xa1eb('0x11')][_0xa1eb('0x13')]);}else{logger[_0xa1eb('0xd')](_0xa1eb('0x12'),_0x39a5a3,_0xa1eb('0xe'));_0x2aebb6(_0x4d4aaf[_0xa1eb('0x14')][_0xa1eb('0x13')]);}})['catch'](function(_0xbd6a6b){logger['error'](_0xa1eb('0x12'),_0x39a5a3,_0xbd6a6b);_0x9d7113(_0xbd6a6b);});});}exports[_0xa1eb('0x15')]=function(_0x33c4e3){var _0x1a5d2c=this;return new Promise(function(_0x49bfaa,_0x1dd621){return db[_0xa1eb('0x16')][_0xa1eb('0x17')](_0x33c4e3[_0xa1eb('0x18')],{'raw':_0x33c4e3[_0xa1eb('0x19')]?_0x33c4e3[_0xa1eb('0x19')][_0xa1eb('0x1a')]===undefined?!![]:![]:!![]})[_0xa1eb('0xc')](function(_0x4fc14a){logger[_0xa1eb('0xd')]('CreateOpenchannelQueueReport',_0x33c4e3);logger[_0xa1eb('0x1b')](_0xa1eb('0x15'),_0x33c4e3,JSON[_0xa1eb('0x10')](_0x4fc14a));_0x49bfaa(_0x4fc14a);})[_0xa1eb('0x1c')](function(_0x5e7a34){logger['error'](_0xa1eb('0x15'),_0x5e7a34[_0xa1eb('0x13')],_0x33c4e3);_0x1dd621(_0x1a5d2c['error'](0x1f4,_0x5e7a34[_0xa1eb('0x13')]));});});};exports[_0xa1eb('0x1d')]=function(_0x258d3a){var _0xa6b20c=this;return new Promise(function(_0x23b49e,_0x1c59e1){return db[_0xa1eb('0x16')][_0xa1eb('0x1e')](_0x258d3a[_0xa1eb('0x18')],{'raw':_0x258d3a[_0xa1eb('0x19')]?_0x258d3a[_0xa1eb('0x19')][_0xa1eb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x258d3a['options']?_0x258d3a[_0xa1eb('0x19')][_0xa1eb('0x1f')]||null:null,'attributes':_0x258d3a['options']?_0x258d3a[_0xa1eb('0x19')]['attributes']||null:null,'limit':_0x258d3a[_0xa1eb('0x19')]?_0x258d3a[_0xa1eb('0x19')]['limit']||null:null})[_0xa1eb('0xc')](function(_0x1581ee){logger[_0xa1eb('0xd')]('UpdateOpenchannelQueueReport',_0x258d3a);logger[_0xa1eb('0x1b')](_0xa1eb('0x1d'),_0x258d3a,JSON['stringify'](_0x1581ee));_0x23b49e(_0x1581ee);})[_0xa1eb('0x1c')](function(_0xb27bf9){logger[_0xa1eb('0x11')](_0xa1eb('0x1d'),_0xb27bf9[_0xa1eb('0x13')],_0x258d3a);_0x1c59e1(_0xa6b20c['error'](0x1f4,_0xb27bf9[_0xa1eb('0x13')]));});});};
\ No newline at end of file
+var _0x8f4c=['request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x2bd559,_0x14f665){var _0x450220=function(_0x19680e){while(--_0x19680e){_0x2bd559['push'](_0x2bd559['shift']());}};_0x450220(++_0x14f665);}(_0x8f4c,0x113));var _0xc8f4=function(_0xd4dfdd,_0x1118ff){_0xd4dfdd=_0xd4dfdd-0x0;var _0x37264f=_0x8f4c[_0xd4dfdd];return _0x37264f;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x520063,_0x373506,_0x48c39d){return new BPromise(function(_0x3ea9a2,_0x3a9ab1){return client[_0xc8f4('0xa')](_0x520063,_0x48c39d)[_0xc8f4('0xb')](function(_0x34f05f){logger['info'](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));logger[_0xc8f4('0xe')](_0xc8f4('0xf'),_0x373506,'request\x20sent',JSON[_0xc8f4('0x10')](_0x34f05f));if(_0x34f05f['error']){if(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x12')]===0x1f4){logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')]['message']);return _0x3a9ab1(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);}logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);return _0x3ea9a2(_0x34f05f['error'][_0xc8f4('0x13')]);}else{logger[_0xc8f4('0x14')](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));_0x3ea9a2(_0x34f05f[_0xc8f4('0x15')]['message']);}})[_0xc8f4('0x16')](function(_0x4d2b77){logger['error'](_0xc8f4('0xc'),_0x373506,_0x4d2b77);_0x3a9ab1(_0x4d2b77);});});}exports[_0xc8f4('0x17')]=function(_0x108076){var _0x7bb973=this;return new Promise(function(_0x4763c1,_0x374761){return db[_0xc8f4('0x18')][_0xc8f4('0x19')](_0x108076[_0xc8f4('0x1a')],{'raw':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1c')]===undefined?!![]:![]:!![]})[_0xc8f4('0xb')](function(_0x5f3264){logger[_0xc8f4('0x14')](_0xc8f4('0x17'),_0x108076);logger[_0xc8f4('0xe')](_0xc8f4('0x17'),_0x108076,JSON[_0xc8f4('0x10')](_0x5f3264));_0x4763c1(_0x5f3264);})[_0xc8f4('0x16')](function(_0xaeee7d){logger[_0xc8f4('0x11')]('CreateOpenchannelQueueReport',_0xaeee7d[_0xc8f4('0x13')],_0x108076);_0x374761(_0x7bb973[_0xc8f4('0x11')](0x1f4,_0xaeee7d[_0xc8f4('0x13')]));});});};exports[_0xc8f4('0x1d')]=function(_0x5d54a9){var _0x39174f=this;return new Promise(function(_0x4a44e0,_0x3782fd){return db['OpenchannelQueueReport'][_0xc8f4('0x1e')](_0x5d54a9[_0xc8f4('0x1a')],{'raw':_0x5d54a9['options']?_0x5d54a9[_0xc8f4('0x1b')][_0xc8f4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d54a9[_0xc8f4('0x1b')]?_0x5d54a9[_0xc8f4('0x1b')]['where']||null:null,'attributes':_0x5d54a9[_0xc8f4('0x1b')]?_0x5d54a9[_0xc8f4('0x1b')]['attributes']||null:null,'limit':_0x5d54a9[_0xc8f4('0x1b')]?_0x5d54a9[_0xc8f4('0x1b')][_0xc8f4('0x1f')]||null:null})[_0xc8f4('0xb')](function(_0x24bef0){logger[_0xc8f4('0x14')]('UpdateOpenchannelQueueReport',_0x5d54a9);logger[_0xc8f4('0xe')](_0xc8f4('0x1d'),_0x5d54a9,JSON[_0xc8f4('0x10')](_0x24bef0));_0x4a44e0(_0x24bef0);})['catch'](function(_0xf4a556){logger[_0xc8f4('0x11')]('UpdateOpenchannelQueueReport',_0xf4a556['message'],_0x5d54a9);_0x3782fd(_0x39174f['error'](0x1f4,_0xf4a556[_0xc8f4('0x13')]));});});};
\ No newline at end of file
index ec2417f..7142521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79fb=['index','get','/describe','describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x79fb,0x1ae));var _0xb79f=function(_0x383371,_0x31658c){_0x383371=_0x383371-0x0;var _0x1e8d08=_0x79fb[_0x383371];return _0x1e8d08;};'use strict';var multer=require(_0xb79f('0x0'));var util=require(_0xb79f('0x1'));var path=require(_0xb79f('0x2'));var timeout=require(_0xb79f('0x3'));var express=require(_0xb79f('0x4'));var router=express[_0xb79f('0x5')]();var fs_extra=require(_0xb79f('0x6'));var auth=require(_0xb79f('0x7'));var interaction=require(_0xb79f('0x8'));var config=require(_0xb79f('0x9'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0xb79f('0xa')](),controller[_0xb79f('0xb')]);router[_0xb79f('0xc')](_0xb79f('0xd'),auth['isAuthenticated'](),controller[_0xb79f('0xe')]);router[_0xb79f('0xc')](_0xb79f('0xf'),auth[_0xb79f('0xa')](),controller[_0xb79f('0x10')]);router['post']('/',auth[_0xb79f('0xa')](),controller[_0xb79f('0x11')]);router[_0xb79f('0x12')]('/:id',auth[_0xb79f('0xa')](),controller[_0xb79f('0x13')]);router['delete'](_0xb79f('0xf'),auth[_0xb79f('0xa')](),controller['destroy']);module[_0xb79f('0x14')]=router;
\ No newline at end of file
+var _0xfe52=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','destroy','util','path','connect-timeout','express','fs-extra'];(function(_0x4538a8,_0x500228){var _0x1fc73c=function(_0x5e9556){while(--_0x5e9556){_0x4538a8['push'](_0x4538a8['shift']());}};_0x1fc73c(++_0x500228);}(_0xfe52,0x113));var _0x2fe5=function(_0x1f7120,_0x53456a){_0x1f7120=_0x1f7120-0x0;var _0x512142=_0xfe52[_0x1f7120];return _0x512142;};'use strict';var multer=require('multer');var util=require(_0x2fe5('0x0'));var path=require(_0x2fe5('0x1'));var timeout=require(_0x2fe5('0x2'));var express=require(_0x2fe5('0x3'));var router=express['Router']();var fs_extra=require(_0x2fe5('0x4'));var auth=require(_0x2fe5('0x5'));var interaction=require(_0x2fe5('0x6'));var config=require(_0x2fe5('0x7'));var controller=require(_0x2fe5('0x8'));router[_0x2fe5('0x9')]('/',auth[_0x2fe5('0xa')](),controller[_0x2fe5('0xb')]);router[_0x2fe5('0x9')](_0x2fe5('0xc'),auth['isAuthenticated'](),controller[_0x2fe5('0xd')]);router[_0x2fe5('0x9')]('/:id',auth[_0x2fe5('0xa')](),controller[_0x2fe5('0xe')]);router['post']('/',auth[_0x2fe5('0xa')](),controller[_0x2fe5('0xf')]);router[_0x2fe5('0x10')](_0x2fe5('0x11'),auth[_0x2fe5('0xa')](),controller[_0x2fe5('0x12')]);router['delete'](_0x2fe5('0x11'),auth['isAuthenticated'](),controller[_0x2fe5('0x13')]);module['exports']=router;
\ No newline at end of file
index 608536b..5f48afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x49d6f3,_0x4d1b18){var _0x2827d7=function(_0x24e087){while(--_0x24e087){_0x49d6f3['push'](_0x49d6f3['shift']());}};_0x2827d7(++_0x4d1b18);}(_0x70e0,0x17b));var _0x070e=function(_0x2009af,_0x3ac2f9){_0x2009af=_0x2009af-0x0;var _0x3f1dd=_0x70e0[_0x2009af];return _0x3f1dd;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x2e7f1e,_0x32f286){var _0x3dffa5=function(_0x920dc5){while(--_0x920dc5){_0x2e7f1e['push'](_0x2e7f1e['shift']());}};_0x3dffa5(++_0x32f286);}(_0x54ef,0x112));var _0xf54e=function(_0x58e92d,_0x3ce2d6){_0x58e92d=_0x58e92d-0x0;var _0x41263e=_0x54ef[_0x58e92d];return _0x41263e;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
index fb9a4f2..81b1d05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd119=['rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','end','stack','name','index','map','OpenchannelTransferReport'];(function(_0x85d56d,_0x37f5c1){var _0x51f613=function(_0x4927df){while(--_0x4927df){_0x85d56d['push'](_0x85d56d['shift']());}};_0x51f613(++_0x37f5c1);}(_0xd119,0xb0));var _0x9d11=function(_0x41b0a8,_0x1b05cc){_0x41b0a8=_0x41b0a8-0x0;var _0x3a83d4=_0xd119[_0x41b0a8];return _0x3a83d4;};'use strict';var emlformat=require(_0x9d11('0x0'));var rimraf=require(_0x9d11('0x1'));var zipdir=require(_0x9d11('0x2'));var jsonpatch=require(_0x9d11('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9d11('0x4'));var Mustache=require('mustache');var util=require(_0x9d11('0x5'));var path=require('path');var sox=require(_0x9d11('0x6'));var csv=require(_0x9d11('0x7'));var ejs=require(_0x9d11('0x8'));var fs=require('fs');var fs_extra=require(_0x9d11('0x9'));var _=require(_0x9d11('0xa'));var squel=require(_0x9d11('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d11('0xc'));var deskjs=require(_0x9d11('0xd'));var toCsv=require(_0x9d11('0x7'));var querystring=require(_0x9d11('0xe'));var Papa=require(_0x9d11('0xf'));var Redis=require('ioredis');var authService=require(_0x9d11('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9d11('0x11'));var hardwareService=require(_0x9d11('0x12'));var logger=require(_0x9d11('0x13'))('api');var utils=require(_0x9d11('0x14'));var config=require(_0x9d11('0x15'));var licenseUtil=require(_0x9d11('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f13e2,_0x19f116){_0x19f116=_0x19f116||0xcc;return function(_0x506a93){if(_0x506a93){return _0x1f13e2[_0x9d11('0x17')](_0x19f116);}return _0x1f13e2[_0x9d11('0x18')](_0x19f116)['end']();};}function respondWithResult(_0x134a44,_0x57082c){_0x57082c=_0x57082c||0xc8;return function(_0x1687ca){if(_0x1687ca){return _0x134a44[_0x9d11('0x18')](_0x57082c)['json'](_0x1687ca);}};}function respondWithFilteredResult(_0x54be24,_0x3c678b){return function(_0x35f8cc){if(_0x35f8cc){var _0x1ab390=typeof _0x3c678b[_0x9d11('0x19')]===_0x9d11('0x1a')&&typeof _0x3c678b[_0x9d11('0x1b')]===_0x9d11('0x1a');var _0x232a3d=_0x35f8cc[_0x9d11('0x1c')];var _0x5cebaf=_0x1ab390?0x0:_0x3c678b['offset'];var _0x1370aa=_0x1ab390?_0x35f8cc[_0x9d11('0x1c')]:_0x3c678b[_0x9d11('0x19')]+_0x3c678b['limit'];var _0x365fdb;if(_0x1370aa>=_0x232a3d){_0x1370aa=_0x232a3d;_0x365fdb=0xc8;}else{_0x365fdb=0xce;}_0x54be24[_0x9d11('0x18')](_0x365fdb);return _0x54be24['set'](_0x9d11('0x1d'),_0x5cebaf+'-'+_0x1370aa+'/'+_0x232a3d)[_0x9d11('0x1e')](_0x35f8cc);}return null;};}function patchUpdates(_0x429ff1){return function(_0x4d9ba9){try{jsonpatch[_0x9d11('0x1f')](_0x4d9ba9,_0x429ff1,!![]);}catch(_0x4ba908){return BPromise[_0x9d11('0x20')](_0x4ba908);}return _0x4d9ba9[_0x9d11('0x21')]();};}function saveUpdates(_0x20d574,_0x245709){return function(_0x45f3d4){if(_0x45f3d4){return _0x45f3d4[_0x9d11('0x22')](_0x20d574)['then'](function(_0x4fd7bb){return _0x4fd7bb;});}return null;};}function removeEntity(_0x2af6f0,_0xca7bbc){return function(_0x4cb5f3){if(_0x4cb5f3){return _0x4cb5f3[_0x9d11('0x23')]()[_0x9d11('0x24')](function(){_0x2af6f0[_0x9d11('0x18')](0xcc)[_0x9d11('0x25')]();});}};}function handleEntityNotFound(_0x49f427,_0x53a348){return function(_0x138138){if(!_0x138138){_0x49f427[_0x9d11('0x17')](0x194);}return _0x138138;};}function handleError(_0x4e298a,_0x2afddc){_0x2afddc=_0x2afddc||0x1f4;return function(_0xbd4ea6){logger['error'](_0xbd4ea6[_0x9d11('0x26')]);if(_0xbd4ea6[_0x9d11('0x27')]){delete _0xbd4ea6[_0x9d11('0x27')];}_0x4e298a[_0x9d11('0x18')](_0x2afddc)['send'](_0xbd4ea6);};}exports[_0x9d11('0x28')]=function(_0x40f419,_0x3968ed){var _0x3fcdf3={},_0x3a896f={},_0x541798={'count':0x0,'rows':[]};var _0x2282c4=_[_0x9d11('0x29')](db[_0x9d11('0x2a')][_0x9d11('0x2b')],function(_0x5b1e7d){return{'name':_0x5b1e7d[_0x9d11('0x2c')],'type':_0x5b1e7d[_0x9d11('0x2d')]['key']};});_0x3a896f['model']=_[_0x9d11('0x29')](_0x2282c4,'name');_0x3a896f[_0x9d11('0x2e')]=_[_0x9d11('0x2f')](_0x40f419[_0x9d11('0x2e')]);_0x3a896f[_0x9d11('0x30')]=_[_0x9d11('0x31')](_0x3a896f[_0x9d11('0x32')],_0x3a896f[_0x9d11('0x2e')]);_0x3fcdf3[_0x9d11('0x33')]=_[_0x9d11('0x31')](_0x3a896f[_0x9d11('0x32')],qs['fields'](_0x40f419[_0x9d11('0x2e')][_0x9d11('0x34')]));_0x3fcdf3[_0x9d11('0x33')]=_0x3fcdf3['attributes'][_0x9d11('0x35')]?_0x3fcdf3[_0x9d11('0x33')]:_0x3a896f['model'];if(!_0x40f419['query']['hasOwnProperty'](_0x9d11('0x36'))){_0x3fcdf3[_0x9d11('0x1b')]=qs[_0x9d11('0x1b')](_0x40f419[_0x9d11('0x2e')]['limit']);_0x3fcdf3[_0x9d11('0x19')]=qs[_0x9d11('0x19')](_0x40f419['query'][_0x9d11('0x19')]);}_0x3fcdf3['order']=qs[_0x9d11('0x37')](_0x40f419[_0x9d11('0x2e')][_0x9d11('0x37')]);_0x3fcdf3[_0x9d11('0x38')]=qs['filters'](_[_0x9d11('0x39')](_0x40f419['query'],_0x3a896f[_0x9d11('0x30')]),_0x2282c4);if(_0x40f419[_0x9d11('0x2e')]['filter']){_0x3fcdf3['where']=_[_0x9d11('0x3a')](_0x3fcdf3[_0x9d11('0x38')],{'$or':_[_0x9d11('0x29')](_0x2282c4,function(_0x3d921c){if(_0x3d921c[_0x9d11('0x2d')]!==_0x9d11('0x3b')){var _0x522a7f={};_0x522a7f[_0x3d921c[_0x9d11('0x27')]]={'$like':'%'+_0x40f419[_0x9d11('0x2e')][_0x9d11('0x3c')]+'%'};return _0x522a7f;}})});}_0x3fcdf3=_[_0x9d11('0x3a')]({},_0x3fcdf3,_0x40f419[_0x9d11('0x3d')]);var _0x28d78c={'where':_0x3fcdf3[_0x9d11('0x38')]};return db[_0x9d11('0x2a')][_0x9d11('0x1c')](_0x28d78c)[_0x9d11('0x24')](function(_0x518c9d){_0x541798['count']=_0x518c9d;if(_0x40f419['query'][_0x9d11('0x3e')]){_0x3fcdf3['include']=[{'all':!![]}];}return db[_0x9d11('0x2a')][_0x9d11('0x3f')](_0x3fcdf3);})[_0x9d11('0x24')](function(_0x3e6334){_0x541798[_0x9d11('0x40')]=_0x3e6334;return _0x541798;})[_0x9d11('0x24')](respondWithFilteredResult(_0x3968ed,_0x3fcdf3))['catch'](handleError(_0x3968ed,null));};exports[_0x9d11('0x41')]=function(_0xd9289,_0x5fe1b8){var _0x531cec={'raw':!![],'where':{'id':_0xd9289[_0x9d11('0x42')]['id']}},_0x5cdbf4={};_0x5cdbf4[_0x9d11('0x32')]=_['keys'](db[_0x9d11('0x2a')][_0x9d11('0x2b')]);_0x5cdbf4['query']=_[_0x9d11('0x2f')](_0xd9289[_0x9d11('0x2e')]);_0x5cdbf4['filters']=_[_0x9d11('0x31')](_0x5cdbf4['model'],_0x5cdbf4['query']);_0x531cec['attributes']=_[_0x9d11('0x31')](_0x5cdbf4[_0x9d11('0x32')],qs[_0x9d11('0x34')](_0xd9289[_0x9d11('0x2e')]['fields']));_0x531cec[_0x9d11('0x33')]=_0x531cec[_0x9d11('0x33')]['length']?_0x531cec[_0x9d11('0x33')]:_0x5cdbf4[_0x9d11('0x32')];if(_0xd9289['query']['includeAll']){_0x531cec[_0x9d11('0x43')]=[{'all':!![]}];}_0x531cec=_[_0x9d11('0x3a')]({},_0x531cec,_0xd9289[_0x9d11('0x3d')]);return db[_0x9d11('0x2a')][_0x9d11('0x44')](_0x531cec)[_0x9d11('0x24')](handleEntityNotFound(_0x5fe1b8,null))['then'](respondWithResult(_0x5fe1b8,null))[_0x9d11('0x45')](handleError(_0x5fe1b8,null));};exports['create']=function(_0x488eaa,_0x6b5cb6){return db['OpenchannelTransferReport'][_0x9d11('0x46')](_0x488eaa['body'],{})['then'](respondWithResult(_0x6b5cb6,0xc9))[_0x9d11('0x45')](handleError(_0x6b5cb6,null));};exports[_0x9d11('0x22')]=function(_0x1065e5,_0x35843c){if(_0x1065e5[_0x9d11('0x47')]['id']){delete _0x1065e5[_0x9d11('0x47')]['id'];}return db[_0x9d11('0x2a')][_0x9d11('0x44')]({'where':{'id':_0x1065e5['params']['id']}})['then'](handleEntityNotFound(_0x35843c,null))['then'](saveUpdates(_0x1065e5[_0x9d11('0x47')],null))[_0x9d11('0x24')](respondWithResult(_0x35843c,null))[_0x9d11('0x45')](handleError(_0x35843c,null));};exports[_0x9d11('0x23')]=function(_0x4ed2a5,_0x5c257c){return db['OpenchannelTransferReport'][_0x9d11('0x44')]({'where':{'id':_0x4ed2a5['params']['id']}})['then'](handleEntityNotFound(_0x5c257c,null))[_0x9d11('0x24')](removeEntity(_0x5c257c,null))[_0x9d11('0x45')](handleError(_0x5c257c,null));};exports[_0x9d11('0x48')]=function(_0x3603fe,_0x498484){return db[_0x9d11('0x2a')][_0x9d11('0x48')]()['then'](respondWithResult(_0x498484,null))['catch'](handleError(_0x498484,null));};
\ No newline at end of file
+var _0xe290=['count','offset','status','set','Content-Range','reject','save','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','OpenchannelTransferReport','then','includeAll','include','rows','show','params','options','catch','create','body','update','find','describe','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','end','json','undefined','limit'];(function(_0x1427cf,_0x21c9e2){var _0x3a36cc=function(_0x6c74f9){while(--_0x6c74f9){_0x1427cf['push'](_0x1427cf['shift']());}};_0x3a36cc(++_0x21c9e2);}(_0xe290,0x10f));var _0x0e29=function(_0x1e5755,_0x5e0d48){_0x1e5755=_0x1e5755-0x0;var _0x38975b=_0xe290[_0x1e5755];return _0x38975b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e29('0x1'));var rp=require(_0x0e29('0x2'));var moment=require(_0x0e29('0x3'));var BPromise=require(_0x0e29('0x4'));var Mustache=require(_0x0e29('0x5'));var util=require(_0x0e29('0x6'));var path=require(_0x0e29('0x7'));var sox=require(_0x0e29('0x8'));var csv=require(_0x0e29('0x9'));var ejs=require(_0x0e29('0xa'));var fs=require('fs');var fs_extra=require(_0x0e29('0xb'));var _=require(_0x0e29('0xc'));var squel=require(_0x0e29('0xd'));var crypto=require(_0x0e29('0xe'));var jsforce=require(_0x0e29('0xf'));var deskjs=require(_0x0e29('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0e29('0x11'));var Papa=require(_0x0e29('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e29('0x13'));var as=require(_0x0e29('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e29('0x15'))(_0x0e29('0x16'));var utils=require(_0x0e29('0x17'));var config=require(_0x0e29('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15d370,_0x1ddd43){_0x1ddd43=_0x1ddd43||0xcc;return function(_0x448613){if(_0x448613){return _0x15d370['sendStatus'](_0x1ddd43);}return _0x15d370['status'](_0x1ddd43)[_0x0e29('0x19')]();};}function respondWithResult(_0x33f3ce,_0x97213b){_0x97213b=_0x97213b||0xc8;return function(_0x84e8c5){if(_0x84e8c5){return _0x33f3ce['status'](_0x97213b)[_0x0e29('0x1a')](_0x84e8c5);}};}function respondWithFilteredResult(_0x13e85d,_0x51a4d5){return function(_0x1f7f47){if(_0x1f7f47){var _0x544c12=typeof _0x51a4d5['offset']===_0x0e29('0x1b')&&typeof _0x51a4d5[_0x0e29('0x1c')]===_0x0e29('0x1b');var _0x4be748=_0x1f7f47[_0x0e29('0x1d')];var _0x3a1beb=_0x544c12?0x0:_0x51a4d5['offset'];var _0x437f0e=_0x544c12?_0x1f7f47[_0x0e29('0x1d')]:_0x51a4d5[_0x0e29('0x1e')]+_0x51a4d5[_0x0e29('0x1c')];var _0x35e2bd;if(_0x437f0e>=_0x4be748){_0x437f0e=_0x4be748;_0x35e2bd=0xc8;}else{_0x35e2bd=0xce;}_0x13e85d[_0x0e29('0x1f')](_0x35e2bd);return _0x13e85d[_0x0e29('0x20')](_0x0e29('0x21'),_0x3a1beb+'-'+_0x437f0e+'/'+_0x4be748)['json'](_0x1f7f47);}return null;};}function patchUpdates(_0x48a153){return function(_0x18eec6){try{jsonpatch['apply'](_0x18eec6,_0x48a153,!![]);}catch(_0x3193ea){return BPromise[_0x0e29('0x22')](_0x3193ea);}return _0x18eec6[_0x0e29('0x23')]();};}function saveUpdates(_0x50e579,_0x5984ea){return function(_0x2ae8ec){if(_0x2ae8ec){return _0x2ae8ec['update'](_0x50e579)['then'](function(_0x2b8661){return _0x2b8661;});}return null;};}function removeEntity(_0xc96c5b,_0x253ae1){return function(_0x496053){if(_0x496053){return _0x496053[_0x0e29('0x24')]()['then'](function(){_0xc96c5b[_0x0e29('0x1f')](0xcc)[_0x0e29('0x19')]();});}};}function handleEntityNotFound(_0x2f4b12,_0x4c53bc){return function(_0x352e88){if(!_0x352e88){_0x2f4b12[_0x0e29('0x25')](0x194);}return _0x352e88;};}function handleError(_0x2f9199,_0x1c0a07){_0x1c0a07=_0x1c0a07||0x1f4;return function(_0x2a7e70){logger['error'](_0x2a7e70[_0x0e29('0x26')]);if(_0x2a7e70[_0x0e29('0x27')]){delete _0x2a7e70['name'];}_0x2f9199[_0x0e29('0x1f')](_0x1c0a07)[_0x0e29('0x28')](_0x2a7e70);};}exports[_0x0e29('0x29')]=function(_0x48f50a,_0x2e39cb){var _0x1a017e={},_0x28eee5={},_0x41d191={'count':0x0,'rows':[]};var _0x5135f8=_[_0x0e29('0x2a')](db['OpenchannelTransferReport'][_0x0e29('0x2b')],function(_0x540c0e){return{'name':_0x540c0e[_0x0e29('0x2c')],'type':_0x540c0e[_0x0e29('0x2d')][_0x0e29('0x2e')]};});_0x28eee5[_0x0e29('0x2f')]=_[_0x0e29('0x2a')](_0x5135f8,'name');_0x28eee5[_0x0e29('0x30')]=_['keys'](_0x48f50a[_0x0e29('0x30')]);_0x28eee5[_0x0e29('0x31')]=_[_0x0e29('0x32')](_0x28eee5['model'],_0x28eee5['query']);_0x1a017e[_0x0e29('0x33')]=_['intersection'](_0x28eee5[_0x0e29('0x2f')],qs['fields'](_0x48f50a[_0x0e29('0x30')][_0x0e29('0x34')]));_0x1a017e[_0x0e29('0x33')]=_0x1a017e[_0x0e29('0x33')][_0x0e29('0x35')]?_0x1a017e[_0x0e29('0x33')]:_0x28eee5['model'];if(!_0x48f50a[_0x0e29('0x30')]['hasOwnProperty'](_0x0e29('0x36'))){_0x1a017e[_0x0e29('0x1c')]=qs[_0x0e29('0x1c')](_0x48f50a['query'][_0x0e29('0x1c')]);_0x1a017e[_0x0e29('0x1e')]=qs['offset'](_0x48f50a[_0x0e29('0x30')][_0x0e29('0x1e')]);}_0x1a017e[_0x0e29('0x37')]=qs[_0x0e29('0x38')](_0x48f50a[_0x0e29('0x30')][_0x0e29('0x38')]);_0x1a017e[_0x0e29('0x39')]=qs[_0x0e29('0x31')](_['pick'](_0x48f50a[_0x0e29('0x30')],_0x28eee5[_0x0e29('0x31')]),_0x5135f8);if(_0x48f50a[_0x0e29('0x30')][_0x0e29('0x3a')]){_0x1a017e[_0x0e29('0x39')]=_[_0x0e29('0x3b')](_0x1a017e['where'],{'$or':_[_0x0e29('0x2a')](_0x5135f8,function(_0x13a066){if(_0x13a066['type']!==_0x0e29('0x3c')){var _0x51eb39={};_0x51eb39[_0x13a066['name']]={'$like':'%'+_0x48f50a[_0x0e29('0x30')][_0x0e29('0x3a')]+'%'};return _0x51eb39;}})});}_0x1a017e=_[_0x0e29('0x3b')]({},_0x1a017e,_0x48f50a['options']);var _0x287e50={'where':_0x1a017e[_0x0e29('0x39')]};return db[_0x0e29('0x3d')]['count'](_0x287e50)[_0x0e29('0x3e')](function(_0xa620ff){_0x41d191[_0x0e29('0x1d')]=_0xa620ff;if(_0x48f50a[_0x0e29('0x30')][_0x0e29('0x3f')]){_0x1a017e[_0x0e29('0x40')]=[{'all':!![]}];}return db[_0x0e29('0x3d')]['findAll'](_0x1a017e);})[_0x0e29('0x3e')](function(_0x37cfa9){_0x41d191[_0x0e29('0x41')]=_0x37cfa9;return _0x41d191;})[_0x0e29('0x3e')](respondWithFilteredResult(_0x2e39cb,_0x1a017e))['catch'](handleError(_0x2e39cb,null));};exports[_0x0e29('0x42')]=function(_0x5761c8,_0x2778c3){var _0x35fa5e={'raw':!![],'where':{'id':_0x5761c8[_0x0e29('0x43')]['id']}},_0x290eb3={};_0x290eb3[_0x0e29('0x2f')]=_['keys'](db[_0x0e29('0x3d')][_0x0e29('0x2b')]);_0x290eb3[_0x0e29('0x30')]=_['keys'](_0x5761c8[_0x0e29('0x30')]);_0x290eb3[_0x0e29('0x31')]=_[_0x0e29('0x32')](_0x290eb3['model'],_0x290eb3[_0x0e29('0x30')]);_0x35fa5e['attributes']=_[_0x0e29('0x32')](_0x290eb3[_0x0e29('0x2f')],qs[_0x0e29('0x34')](_0x5761c8[_0x0e29('0x30')][_0x0e29('0x34')]));_0x35fa5e[_0x0e29('0x33')]=_0x35fa5e[_0x0e29('0x33')][_0x0e29('0x35')]?_0x35fa5e[_0x0e29('0x33')]:_0x290eb3[_0x0e29('0x2f')];if(_0x5761c8[_0x0e29('0x30')][_0x0e29('0x3f')]){_0x35fa5e[_0x0e29('0x40')]=[{'all':!![]}];}_0x35fa5e=_[_0x0e29('0x3b')]({},_0x35fa5e,_0x5761c8[_0x0e29('0x44')]);return db[_0x0e29('0x3d')]['find'](_0x35fa5e)['then'](handleEntityNotFound(_0x2778c3,null))[_0x0e29('0x3e')](respondWithResult(_0x2778c3,null))[_0x0e29('0x45')](handleError(_0x2778c3,null));};exports[_0x0e29('0x46')]=function(_0x3b5e4c,_0x5dbaa9){return db[_0x0e29('0x3d')]['create'](_0x3b5e4c[_0x0e29('0x47')],{})[_0x0e29('0x3e')](respondWithResult(_0x5dbaa9,0xc9))['catch'](handleError(_0x5dbaa9,null));};exports[_0x0e29('0x48')]=function(_0x5820ad,_0xa84bf9){if(_0x5820ad['body']['id']){delete _0x5820ad[_0x0e29('0x47')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x5820ad[_0x0e29('0x43')]['id']}})[_0x0e29('0x3e')](handleEntityNotFound(_0xa84bf9,null))[_0x0e29('0x3e')](saveUpdates(_0x5820ad[_0x0e29('0x47')],null))[_0x0e29('0x3e')](respondWithResult(_0xa84bf9,null))[_0x0e29('0x45')](handleError(_0xa84bf9,null));};exports[_0x0e29('0x24')]=function(_0x3e63b0,_0x437027){return db[_0x0e29('0x3d')][_0x0e29('0x49')]({'where':{'id':_0x3e63b0['params']['id']}})[_0x0e29('0x3e')](handleEntityNotFound(_0x437027,null))[_0x0e29('0x3e')](removeEntity(_0x437027,null))['catch'](handleError(_0x437027,null));};exports[_0x0e29('0x4a')]=function(_0x3a1622,_0x553b73){return db[_0x0e29('0x3d')][_0x0e29('0x4a')]()[_0x0e29('0x3e')](respondWithResult(_0x553b73,null))['catch'](handleError(_0x553b73,null));};
\ No newline at end of file
index 0071e89..0e8b989 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3738=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x126dc9,_0x4f0746){var _0x374312=function(_0x569aaa){while(--_0x569aaa){_0x126dc9['push'](_0x126dc9['shift']());}};_0x374312(++_0x4f0746);}(_0x3738,0xa1));var _0x8373=function(_0x196dc5,_0x50be9d){_0x196dc5=_0x196dc5-0x0;var _0x56458e=_0x3738[_0x196dc5];return _0x56458e;};'use strict';var _=require(_0x8373('0x0'));var util=require(_0x8373('0x1'));var logger=require(_0x8373('0x2'))(_0x8373('0x3'));var moment=require(_0x8373('0x4'));var BPromise=require(_0x8373('0x5'));var rp=require(_0x8373('0x6'));var fs=require('fs');var path=require(_0x8373('0x7'));var rimraf=require(_0x8373('0x8'));var config=require(_0x8373('0x9'));var attributes=require(_0x8373('0xa'));module[_0x8373('0xb')]=function(_0x10cdf9,_0x3f3ebe){return _0x10cdf9['define'](_0x8373('0xc'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x8373('0xd'),'fields':[_0x8373('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x815b=['request-promise','path','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x1a3222,_0x49f79c){var _0x34617b=function(_0x14facb){while(--_0x14facb){_0x1a3222['push'](_0x1a3222['shift']());}};_0x34617b(++_0x49f79c);}(_0x815b,0x14c));var _0xb815=function(_0x1917bd,_0x29c28e){_0x1917bd=_0x1917bd-0x0;var _0x59c62a=_0x815b[_0x1917bd];return _0x59c62a;};'use strict';var _=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var logger=require(_0xb815('0x2'))('api');var moment=require(_0xb815('0x3'));var BPromise=require('bluebird');var rp=require(_0xb815('0x4'));var fs=require('fs');var path=require(_0xb815('0x5'));var rimraf=require('rimraf');var config=require(_0xb815('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0xb815('0x7')]=function(_0x5e38ac,_0x340459){return _0x5e38ac[_0xb815('0x8')](_0xb815('0x9'),attributes,{'tableName':_0xb815('0xa'),'paranoid':![],'indexes':[{'name':_0xb815('0xb'),'fields':[_0xb815('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 3de668e..8d3b00e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b19=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x2f3feb,_0x10fd36){var _0x1434a2=function(_0x30ab26){while(--_0x30ab26){_0x2f3feb['push'](_0x2f3feb['shift']());}};_0x1434a2(++_0x10fd36);}(_0x4b19,0x195));var _0x94b1=function(_0x1971f1,_0x48e960){_0x1971f1=_0x1971f1-0x0;var _0x2c3a90=_0x4b19[_0x1971f1];return _0x2c3a90;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var moment=require(_0x94b1('0x1'));var BPromise=require(_0x94b1('0x2'));var rs=require(_0x94b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94b1('0x4'))['db'];var utils=require(_0x94b1('0x5'));var logger=require(_0x94b1('0x6'))('rpc');var config=require(_0x94b1('0x7'));var jayson=require(_0x94b1('0x8'));var client=jayson['client'][_0x94b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x110a52,_0x4ea1f9,_0x40c69c){return new BPromise(function(_0x201a02,_0xad0a85){return client['request'](_0x110a52,_0x40c69c)[_0x94b1('0xa')](function(_0x4f948b){logger['info'](_0x94b1('0xb'),_0x4ea1f9,_0x94b1('0xc'));logger[_0x94b1('0xd')](_0x94b1('0xe'),_0x4ea1f9,_0x94b1('0xc'),JSON[_0x94b1('0xf')](_0x4f948b));if(_0x4f948b['error']){if(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x11')]===0x1f4){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x4f948b['error']['message']);return _0xad0a85(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4ea1f9,_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);return _0x201a02(_0x4f948b['error'][_0x94b1('0x12')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4ea1f9,_0x94b1('0xc'));_0x201a02(_0x4f948b[_0x94b1('0x13')][_0x94b1('0x12')]);}})[_0x94b1('0x14')](function(_0x494138){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x494138);_0xad0a85(_0x494138);});});}
\ No newline at end of file
+var _0x45d1=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','lodash','util','bluebird'];(function(_0x45915d,_0x352c5b){var _0x25f073=function(_0x324517){while(--_0x324517){_0x45915d['push'](_0x45915d['shift']());}};_0x25f073(++_0x352c5b);}(_0x45d1,0x1cb));var _0x145d=function(_0xfd5f37,_0x24a79c){_0xfd5f37=_0xfd5f37-0x0;var _0x11bd01=_0x45d1[_0xfd5f37];return _0x11bd01;};'use strict';var _=require(_0x145d('0x0'));var util=require(_0x145d('0x1'));var moment=require('moment');var BPromise=require(_0x145d('0x2'));var rs=require(_0x145d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x145d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x145d('0x5'))(_0x145d('0x6'));var config=require(_0x145d('0x7'));var jayson=require(_0x145d('0x8'));var client=jayson[_0x145d('0x9')][_0x145d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbc4161,_0x45ff66,_0x46a729){return new BPromise(function(_0x47eadc,_0x4ef552){return client['request'](_0xbc4161,_0x46a729)[_0x145d('0xb')](function(_0x183afe){logger[_0x145d('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x45ff66,_0x145d('0xd'));logger['debug'](_0x145d('0xe'),_0x45ff66,_0x145d('0xd'),JSON[_0x145d('0xf')](_0x183afe));if(_0x183afe[_0x145d('0x10')]){if(_0x183afe['error'][_0x145d('0x11')]===0x1f4){logger[_0x145d('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x45ff66,_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);return _0x4ef552(_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x45ff66,_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);return _0x47eadc(_0x183afe[_0x145d('0x10')]['message']);}else{logger[_0x145d('0xc')](_0x145d('0x13'),_0x45ff66,_0x145d('0xd'));_0x47eadc(_0x183afe[_0x145d('0x14')][_0x145d('0x12')]);}})['catch'](function(_0x1c9ee2){logger[_0x145d('0x10')](_0x145d('0x13'),_0x45ff66,_0x1c9ee2);_0x4ef552(_0x1c9ee2);});});}
\ No newline at end of file
index 3f0f7fb..b603222 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8757=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x5ca5d1,_0x2c27f1){var _0x89feb8=function(_0x4d9eed){while(--_0x4d9eed){_0x5ca5d1['push'](_0x5ca5d1['shift']());}};_0x89feb8(++_0x2c27f1);}(_0x8757,0x157));var _0x7875=function(_0x2a9fd2,_0x48fd38){_0x2a9fd2=_0x2a9fd2-0x0;var _0x23092c=_0x8757[_0x2a9fd2];return _0x23092c;};'use strict';var multer=require(_0x7875('0x0'));var util=require('util');var path=require(_0x7875('0x1'));var timeout=require(_0x7875('0x2'));var express=require(_0x7875('0x3'));var router=express[_0x7875('0x4')]();var fs_extra=require(_0x7875('0x5'));var auth=require(_0x7875('0x6'));var interaction=require(_0x7875('0x7'));var config=require('../../config/environment');var controller=require(_0x7875('0x8'));router[_0x7875('0x9')]('/',auth[_0x7875('0xa')](),controller[_0x7875('0xb')]);router[_0x7875('0x9')](_0x7875('0xc'),auth[_0x7875('0xa')](),controller[_0x7875('0xd')]);router[_0x7875('0xe')]('/',auth[_0x7875('0xa')](),controller[_0x7875('0xf')]);router[_0x7875('0x10')]('/:id',auth[_0x7875('0xa')](),controller[_0x7875('0x11')]);router[_0x7875('0x12')]('/:id',auth[_0x7875('0xa')](),controller[_0x7875('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7c0b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','show','post','create','put','/:id','isAuthenticated','update','exports','util','path','express','Router'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0x7c0b,0x178));var _0xb7c0=function(_0x22b713,_0x5ac526){_0x22b713=_0x22b713-0x0;var _0x33b438=_0x7c0b[_0x22b713];return _0x33b438;};'use strict';var multer=require('multer');var util=require(_0xb7c0('0x0'));var path=require(_0xb7c0('0x1'));var timeout=require('connect-timeout');var express=require(_0xb7c0('0x2'));var router=express[_0xb7c0('0x3')]();var fs_extra=require(_0xb7c0('0x4'));var auth=require(_0xb7c0('0x5'));var interaction=require(_0xb7c0('0x6'));var config=require(_0xb7c0('0x7'));var controller=require(_0xb7c0('0x8'));router[_0xb7c0('0x9')]('/',auth['isAuthenticated'](),controller[_0xb7c0('0xa')]);router[_0xb7c0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb7c0('0xb')]);router[_0xb7c0('0xc')]('/',auth['isAuthenticated'](),controller[_0xb7c0('0xd')]);router[_0xb7c0('0xe')](_0xb7c0('0xf'),auth[_0xb7c0('0x10')](),controller[_0xb7c0('0x11')]);router['delete'](_0xb7c0('0xf'),auth[_0xb7c0('0x10')](),controller['destroy']);module[_0xb7c0('0x12')]=router;
\ No newline at end of file
index 223d194..c21babc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c42=['sequelize','exports','name'];(function(_0x3ae25d,_0x52abd1){var _0xa7d6ad=function(_0x576e8a){while(--_0x576e8a){_0x3ae25d['push'](_0x3ae25d['shift']());}};_0xa7d6ad(++_0x52abd1);}(_0x2c42,0xf3));var _0x22c4=function(_0x1986aa,_0x3f5cc1){_0x1986aa=_0x1986aa-0x0;var _0x401b10=_0x2c42[_0x1986aa];return _0x401b10;};'use strict';var Sequelize=require(_0x22c4('0x0'));module[_0x22c4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x22c4('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe19b=['name','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe19b,0x16d));var _0xbe19=function(_0x15b568,_0x4019f2){_0x15b568=_0x15b568-0x0;var _0x5c8e0c=_0xe19b[_0x15b568];return _0x5c8e0c;};'use strict';var Sequelize=require(_0xbe19('0x0'));module[_0xbe19('0x1')]={'name':{'type':Sequelize[_0xbe19('0x2')],'unique':_0xbe19('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xbe19('0x2')]}};
\ No newline at end of file
index 1aca80a..f35746d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68ac=['intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','catch','error','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','undefined','count','set','apply','save','then','destroy','get','Pauses','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','filters','attributes'];(function(_0x52610d,_0x52d1a2){var _0x4c4918=function(_0x52da82){while(--_0x52da82){_0x52610d['push'](_0x52610d['shift']());}};_0x4c4918(++_0x52d1a2);}(_0x68ac,0x73));var _0xc68a=function(_0x243402,_0x45051f){_0x243402=_0x243402-0x0;var _0x5daa28=_0x68ac[_0x243402];return _0x5daa28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc68a('0x0'));var zipdir=require(_0xc68a('0x1'));var jsonpatch=require(_0xc68a('0x2'));var rp=require(_0xc68a('0x3'));var moment=require(_0xc68a('0x4'));var BPromise=require(_0xc68a('0x5'));var Mustache=require('mustache');var util=require(_0xc68a('0x6'));var path=require(_0xc68a('0x7'));var sox=require(_0xc68a('0x8'));var csv=require(_0xc68a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc68a('0xa'));var _=require(_0xc68a('0xb'));var squel=require(_0xc68a('0xc'));var crypto=require(_0xc68a('0xd'));var jsforce=require(_0xc68a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc68a('0x9'));var querystring=require(_0xc68a('0xf'));var Papa=require(_0xc68a('0x10'));var Redis=require(_0xc68a('0x11'));var authService=require(_0xc68a('0x12'));var qs=require(_0xc68a('0x13'));var as=require(_0xc68a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc68a('0x15'))(_0xc68a('0x16'));var utils=require(_0xc68a('0x17'));var config=require(_0xc68a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc68a('0x19'))['db'];function respondWithStatusCode(_0x5e25e6,_0x45362e){_0x45362e=_0x45362e||0xcc;return function(_0xe110b){if(_0xe110b){return _0x5e25e6['sendStatus'](_0x45362e);}return _0x5e25e6['status'](_0x45362e)[_0xc68a('0x1a')]();};}function respondWithResult(_0x50998b,_0x4de939){_0x4de939=_0x4de939||0xc8;return function(_0x5c2a01){if(_0x5c2a01){return _0x50998b[_0xc68a('0x1b')](_0x4de939)[_0xc68a('0x1c')](_0x5c2a01);}};}function respondWithFilteredResult(_0x2bf5e4,_0x5254ea){return function(_0x32e78b){if(_0x32e78b){var _0x315b00=typeof _0x5254ea[_0xc68a('0x1d')]==='undefined'&&typeof _0x5254ea[_0xc68a('0x1e')]===_0xc68a('0x1f');var _0x330032=_0x32e78b[_0xc68a('0x20')];var _0x49d414=_0x315b00?0x0:_0x5254ea[_0xc68a('0x1d')];var _0x56631c=_0x315b00?_0x32e78b[_0xc68a('0x20')]:_0x5254ea[_0xc68a('0x1d')]+_0x5254ea[_0xc68a('0x1e')];var _0x49a315;if(_0x56631c>=_0x330032){_0x56631c=_0x330032;_0x49a315=0xc8;}else{_0x49a315=0xce;}_0x2bf5e4['status'](_0x49a315);return _0x2bf5e4[_0xc68a('0x21')]('Content-Range',_0x49d414+'-'+_0x56631c+'/'+_0x330032)[_0xc68a('0x1c')](_0x32e78b);}return null;};}function patchUpdates(_0x1e60b3){return function(_0x11f430){try{jsonpatch[_0xc68a('0x22')](_0x11f430,_0x1e60b3,!![]);}catch(_0x141ab8){return BPromise['reject'](_0x141ab8);}return _0x11f430[_0xc68a('0x23')]();};}function saveUpdates(_0x485fa2,_0x196afc){return function(_0x295800){if(_0x295800){return _0x295800['update'](_0x485fa2)[_0xc68a('0x24')](function(_0x10bd0e){return _0x10bd0e;});}return null;};}function removeEntity(_0x3a3bf4,_0xef7b77){return function(_0x535d1f){if(_0x535d1f){return _0x535d1f[_0xc68a('0x25')]()[_0xc68a('0x24')](function(){var _0x35d86d=_0x535d1f[_0xc68a('0x26')]({'plain':!![]});var _0x18837c=_0xc68a('0x27');return db['UserProfileResource'][_0xc68a('0x25')]({'where':{'type':_0x18837c,'resourceId':_0x35d86d['id']}})[_0xc68a('0x24')](function(){return _0x535d1f;});})[_0xc68a('0x24')](function(){_0x3a3bf4['status'](0xcc)[_0xc68a('0x1a')]();});}};}function handleEntityNotFound(_0x420723,_0x8700bc){return function(_0x403bf1){if(!_0x403bf1){_0x420723[_0xc68a('0x28')](0x194);}return _0x403bf1;};}function handleError(_0x319736,_0x35ac72){_0x35ac72=_0x35ac72||0x1f4;return function(_0x5917bd){logger['error'](_0x5917bd[_0xc68a('0x29')]);if(_0x5917bd['name']){delete _0x5917bd[_0xc68a('0x2a')];}_0x319736[_0xc68a('0x1b')](_0x35ac72)[_0xc68a('0x2b')](_0x5917bd);};}exports[_0xc68a('0x2c')]=function(_0x30d8cb,_0x3d2a81){var _0x11bbfc={},_0x492529={},_0x1bdcca={'count':0x0,'rows':[]};var _0xf561a9=_[_0xc68a('0x2d')](db[_0xc68a('0x2e')][_0xc68a('0x2f')],function(_0x26254a){return{'name':_0x26254a[_0xc68a('0x30')],'type':_0x26254a[_0xc68a('0x31')][_0xc68a('0x32')]};});_0x492529[_0xc68a('0x33')]=_['map'](_0xf561a9,_0xc68a('0x2a'));_0x492529[_0xc68a('0x34')]=_['keys'](_0x30d8cb['query']);_0x492529[_0xc68a('0x35')]=_['intersection'](_0x492529[_0xc68a('0x33')],_0x492529[_0xc68a('0x34')]);_0x11bbfc[_0xc68a('0x36')]=_[_0xc68a('0x37')](_0x492529[_0xc68a('0x33')],qs['fields'](_0x30d8cb[_0xc68a('0x34')][_0xc68a('0x38')]));_0x11bbfc['attributes']=_0x11bbfc[_0xc68a('0x36')]['length']?_0x11bbfc[_0xc68a('0x36')]:_0x492529[_0xc68a('0x33')];if(!_0x30d8cb[_0xc68a('0x34')][_0xc68a('0x39')](_0xc68a('0x3a'))){_0x11bbfc[_0xc68a('0x1e')]=qs['limit'](_0x30d8cb[_0xc68a('0x34')][_0xc68a('0x1e')]);_0x11bbfc[_0xc68a('0x1d')]=qs[_0xc68a('0x1d')](_0x30d8cb[_0xc68a('0x34')]['offset']);}_0x11bbfc[_0xc68a('0x3b')]=qs[_0xc68a('0x3c')](_0x30d8cb[_0xc68a('0x34')]['sort']);_0x11bbfc[_0xc68a('0x3d')]=qs[_0xc68a('0x35')](_[_0xc68a('0x3e')](_0x30d8cb[_0xc68a('0x34')],_0x492529[_0xc68a('0x35')]),_0xf561a9);if(_0x30d8cb[_0xc68a('0x34')][_0xc68a('0x3f')]){_0x11bbfc[_0xc68a('0x3d')]=_[_0xc68a('0x40')](_0x11bbfc[_0xc68a('0x3d')],{'$or':_[_0xc68a('0x2d')](_0xf561a9,function(_0x1feaed){if(_0x1feaed[_0xc68a('0x31')]!==_0xc68a('0x41')){var _0x46fa84={};_0x46fa84[_0x1feaed[_0xc68a('0x2a')]]={'$like':'%'+_0x30d8cb[_0xc68a('0x34')]['filter']+'%'};return _0x46fa84;}})});}_0x11bbfc=_[_0xc68a('0x40')]({},_0x11bbfc,_0x30d8cb[_0xc68a('0x42')]);var _0x1685b2={'where':_0x11bbfc[_0xc68a('0x3d')]};return db['Pause']['count'](_0x1685b2)[_0xc68a('0x24')](function(_0xf1c18){_0x1bdcca[_0xc68a('0x20')]=_0xf1c18;if(_0x30d8cb['query'][_0xc68a('0x43')]){_0x11bbfc[_0xc68a('0x44')]=[{'all':!![]}];}return db[_0xc68a('0x2e')][_0xc68a('0x45')](_0x11bbfc);})[_0xc68a('0x24')](function(_0x18119b){_0x1bdcca[_0xc68a('0x46')]=_0x18119b;return _0x1bdcca;})[_0xc68a('0x24')](respondWithFilteredResult(_0x3d2a81,_0x11bbfc))['catch'](handleError(_0x3d2a81,null));};exports[_0xc68a('0x47')]=function(_0x5719b3,_0x81e3ce){var _0x3bc3d2={'raw':!![],'where':{'id':_0x5719b3[_0xc68a('0x48')]['id']}},_0x2fe645={};_0x2fe645[_0xc68a('0x33')]=_[_0xc68a('0x49')](db[_0xc68a('0x2e')][_0xc68a('0x2f')]);_0x2fe645[_0xc68a('0x34')]=_['keys'](_0x5719b3[_0xc68a('0x34')]);_0x2fe645[_0xc68a('0x35')]=_[_0xc68a('0x37')](_0x2fe645[_0xc68a('0x33')],_0x2fe645['query']);_0x3bc3d2[_0xc68a('0x36')]=_[_0xc68a('0x37')](_0x2fe645[_0xc68a('0x33')],qs[_0xc68a('0x38')](_0x5719b3[_0xc68a('0x34')][_0xc68a('0x38')]));_0x3bc3d2[_0xc68a('0x36')]=_0x3bc3d2[_0xc68a('0x36')]['length']?_0x3bc3d2[_0xc68a('0x36')]:_0x2fe645[_0xc68a('0x33')];if(_0x5719b3['query'][_0xc68a('0x43')]){_0x3bc3d2[_0xc68a('0x44')]=[{'all':!![]}];}_0x3bc3d2=_[_0xc68a('0x40')]({},_0x3bc3d2,_0x5719b3[_0xc68a('0x42')]);return db[_0xc68a('0x2e')][_0xc68a('0x4a')](_0x3bc3d2)[_0xc68a('0x24')](handleEntityNotFound(_0x81e3ce,null))[_0xc68a('0x24')](respondWithResult(_0x81e3ce,null))['catch'](handleError(_0x81e3ce,null));};exports[_0xc68a('0x4b')]=function(_0x3ddbee,_0xa72534){return db[_0xc68a('0x2e')]['create'](_0x3ddbee[_0xc68a('0x4c')],{})[_0xc68a('0x24')](function(_0x100a89){var _0x11c4dd=_0x3ddbee[_0xc68a('0x4d')][_0xc68a('0x26')]({'plain':!![]});if(!_0x11c4dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11c4dd[_0xc68a('0x4e')]===_0xc68a('0x4d')){var _0x5b0b66=_0x100a89[_0xc68a('0x26')]({'plain':!![]});var _0x4db261=_0xc68a('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x4db261,'userProfileId':_0x11c4dd[_0xc68a('0x4f')]},'raw':!![]})[_0xc68a('0x24')](function(_0xb95dbe){if(_0xb95dbe&&_0xb95dbe[_0xc68a('0x50')]===0x0){return db[_0xc68a('0x51')]['create']({'name':_0x5b0b66['name'],'resourceId':_0x5b0b66['id'],'type':_0xb95dbe['name'],'sectionId':_0xb95dbe['id']},{})['then'](function(){return _0x100a89;});}else{return _0x100a89;}})[_0xc68a('0x52')](function(_0x5ed191){logger[_0xc68a('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ed191);throw _0x5ed191;});}return _0x100a89;})[_0xc68a('0x24')](respondWithResult(_0xa72534,0xc9))['catch'](handleError(_0xa72534,null));};exports[_0xc68a('0x54')]=function(_0x5104c6,_0xa32bea){if(_0x5104c6[_0xc68a('0x4c')]['id']){delete _0x5104c6[_0xc68a('0x4c')]['id'];}return db['Pause']['find']({'where':{'id':_0x5104c6[_0xc68a('0x48')]['id']}})[_0xc68a('0x24')](handleEntityNotFound(_0xa32bea,null))[_0xc68a('0x24')](saveUpdates(_0x5104c6[_0xc68a('0x4c')],null))['then'](respondWithResult(_0xa32bea,null))[_0xc68a('0x52')](handleError(_0xa32bea,null));};exports[_0xc68a('0x25')]=function(_0x168fcd,_0x28175d){return db['Pause'][_0xc68a('0x4a')]({'where':{'id':_0x168fcd[_0xc68a('0x48')]['id']}})[_0xc68a('0x24')](handleEntityNotFound(_0x28175d,null))[_0xc68a('0x24')](removeEntity(_0x28175d,null))['catch'](handleError(_0x28175d,null));};
\ No newline at end of file
+var _0x3fd3=['index','map','Pause','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','destroy','then','Pauses','end','error','stack','name','send'];(function(_0x667c6a,_0x2155cd){var _0x36396a=function(_0x29d602){while(--_0x29d602){_0x667c6a['push'](_0x667c6a['shift']());}};_0x36396a(++_0x2155cd);}(_0x3fd3,0x1c9));var _0x33fd=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x3fd3[_0x599e60];return _0x468e19;};'use strict';var emlformat=require(_0x33fd('0x0'));var rimraf=require(_0x33fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33fd('0x2'));var rp=require('request-promise');var moment=require(_0x33fd('0x3'));var BPromise=require(_0x33fd('0x4'));var Mustache=require(_0x33fd('0x5'));var util=require(_0x33fd('0x6'));var path=require(_0x33fd('0x7'));var sox=require(_0x33fd('0x8'));var csv=require(_0x33fd('0x9'));var ejs=require(_0x33fd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33fd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x33fd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x33fd('0x9'));var querystring=require('querystring');var Papa=require(_0x33fd('0xd'));var Redis=require(_0x33fd('0xe'));var authService=require(_0x33fd('0xf'));var qs=require(_0x33fd('0x10'));var as=require(_0x33fd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33fd('0x12'))('api');var utils=require(_0x33fd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x33fd('0x14'));var db=require(_0x33fd('0x15'))['db'];function respondWithStatusCode(_0x4619e2,_0x18a2d8){_0x18a2d8=_0x18a2d8||0xcc;return function(_0x3b211a){if(_0x3b211a){return _0x4619e2[_0x33fd('0x16')](_0x18a2d8);}return _0x4619e2[_0x33fd('0x17')](_0x18a2d8)['end']();};}function respondWithResult(_0x26bd9f,_0x3f9585){_0x3f9585=_0x3f9585||0xc8;return function(_0x46c5a1){if(_0x46c5a1){return _0x26bd9f[_0x33fd('0x17')](_0x3f9585)[_0x33fd('0x18')](_0x46c5a1);}};}function respondWithFilteredResult(_0x27b6de,_0x9e752a){return function(_0x12b144){if(_0x12b144){var _0x474d40=typeof _0x9e752a['offset']===_0x33fd('0x19')&&typeof _0x9e752a[_0x33fd('0x1a')]===_0x33fd('0x19');var _0x11d6cb=_0x12b144[_0x33fd('0x1b')];var _0x535a23=_0x474d40?0x0:_0x9e752a[_0x33fd('0x1c')];var _0x17889f=_0x474d40?_0x12b144[_0x33fd('0x1b')]:_0x9e752a[_0x33fd('0x1c')]+_0x9e752a[_0x33fd('0x1a')];var _0x1f1bcf;if(_0x17889f>=_0x11d6cb){_0x17889f=_0x11d6cb;_0x1f1bcf=0xc8;}else{_0x1f1bcf=0xce;}_0x27b6de[_0x33fd('0x17')](_0x1f1bcf);return _0x27b6de[_0x33fd('0x1d')]('Content-Range',_0x535a23+'-'+_0x17889f+'/'+_0x11d6cb)[_0x33fd('0x18')](_0x12b144);}return null;};}function patchUpdates(_0x15163b){return function(_0x7a36c9){try{jsonpatch[_0x33fd('0x1e')](_0x7a36c9,_0x15163b,!![]);}catch(_0x3c49e7){return BPromise[_0x33fd('0x1f')](_0x3c49e7);}return _0x7a36c9[_0x33fd('0x20')]();};}function saveUpdates(_0x31a41b,_0x52bb64){return function(_0x58a0da){if(_0x58a0da){return _0x58a0da['update'](_0x31a41b)['then'](function(_0x46cee0){return _0x46cee0;});}return null;};}function removeEntity(_0x393cd7,_0x37a7cd){return function(_0x5b6d4d){if(_0x5b6d4d){return _0x5b6d4d[_0x33fd('0x21')]()[_0x33fd('0x22')](function(){var _0x1b1d9b=_0x5b6d4d['get']({'plain':!![]});var _0x45b446=_0x33fd('0x23');return db['UserProfileResource'][_0x33fd('0x21')]({'where':{'type':_0x45b446,'resourceId':_0x1b1d9b['id']}})[_0x33fd('0x22')](function(){return _0x5b6d4d;});})[_0x33fd('0x22')](function(){_0x393cd7[_0x33fd('0x17')](0xcc)[_0x33fd('0x24')]();});}};}function handleEntityNotFound(_0x340f9c,_0x3f8944){return function(_0x4f8fc0){if(!_0x4f8fc0){_0x340f9c[_0x33fd('0x16')](0x194);}return _0x4f8fc0;};}function handleError(_0x30d5d2,_0x345cf7){_0x345cf7=_0x345cf7||0x1f4;return function(_0x227794){logger[_0x33fd('0x25')](_0x227794[_0x33fd('0x26')]);if(_0x227794['name']){delete _0x227794[_0x33fd('0x27')];}_0x30d5d2['status'](_0x345cf7)[_0x33fd('0x28')](_0x227794);};}exports[_0x33fd('0x29')]=function(_0xd64224,_0x4bd877){var _0x16a3fe={},_0x53c557={},_0x1a83f6={'count':0x0,'rows':[]};var _0x5b607f=_[_0x33fd('0x2a')](db[_0x33fd('0x2b')][_0x33fd('0x2c')],function(_0x1a6a29){return{'name':_0x1a6a29[_0x33fd('0x2d')],'type':_0x1a6a29['type'][_0x33fd('0x2e')]};});_0x53c557[_0x33fd('0x2f')]=_[_0x33fd('0x2a')](_0x5b607f,'name');_0x53c557[_0x33fd('0x30')]=_[_0x33fd('0x31')](_0xd64224[_0x33fd('0x30')]);_0x53c557[_0x33fd('0x32')]=_[_0x33fd('0x33')](_0x53c557[_0x33fd('0x2f')],_0x53c557['query']);_0x16a3fe[_0x33fd('0x34')]=_[_0x33fd('0x33')](_0x53c557['model'],qs[_0x33fd('0x35')](_0xd64224[_0x33fd('0x30')]['fields']));_0x16a3fe[_0x33fd('0x34')]=_0x16a3fe[_0x33fd('0x34')]['length']?_0x16a3fe['attributes']:_0x53c557[_0x33fd('0x2f')];if(!_0xd64224[_0x33fd('0x30')][_0x33fd('0x36')](_0x33fd('0x37'))){_0x16a3fe[_0x33fd('0x1a')]=qs['limit'](_0xd64224['query']['limit']);_0x16a3fe[_0x33fd('0x1c')]=qs[_0x33fd('0x1c')](_0xd64224[_0x33fd('0x30')][_0x33fd('0x1c')]);}_0x16a3fe[_0x33fd('0x38')]=qs[_0x33fd('0x39')](_0xd64224[_0x33fd('0x30')][_0x33fd('0x39')]);_0x16a3fe['where']=qs[_0x33fd('0x32')](_[_0x33fd('0x3a')](_0xd64224[_0x33fd('0x30')],_0x53c557[_0x33fd('0x32')]),_0x5b607f);if(_0xd64224[_0x33fd('0x30')][_0x33fd('0x3b')]){_0x16a3fe['where']=_['merge'](_0x16a3fe[_0x33fd('0x3c')],{'$or':_[_0x33fd('0x2a')](_0x5b607f,function(_0x1740a6){if(_0x1740a6[_0x33fd('0x3d')]!==_0x33fd('0x3e')){var _0x169c7a={};_0x169c7a[_0x1740a6[_0x33fd('0x27')]]={'$like':'%'+_0xd64224[_0x33fd('0x30')]['filter']+'%'};return _0x169c7a;}})});}_0x16a3fe=_[_0x33fd('0x3f')]({},_0x16a3fe,_0xd64224[_0x33fd('0x40')]);var _0x431ed0={'where':_0x16a3fe[_0x33fd('0x3c')]};return db[_0x33fd('0x2b')][_0x33fd('0x1b')](_0x431ed0)[_0x33fd('0x22')](function(_0x1853ef){_0x1a83f6[_0x33fd('0x1b')]=_0x1853ef;if(_0xd64224['query'][_0x33fd('0x41')]){_0x16a3fe[_0x33fd('0x42')]=[{'all':!![]}];}return db[_0x33fd('0x2b')]['findAll'](_0x16a3fe);})[_0x33fd('0x22')](function(_0x1664af){_0x1a83f6[_0x33fd('0x43')]=_0x1664af;return _0x1a83f6;})[_0x33fd('0x22')](respondWithFilteredResult(_0x4bd877,_0x16a3fe))[_0x33fd('0x44')](handleError(_0x4bd877,null));};exports[_0x33fd('0x45')]=function(_0x757118,_0x3d2104){var _0x4bd53c={'raw':!![],'where':{'id':_0x757118[_0x33fd('0x46')]['id']}},_0x3f95cb={};_0x3f95cb[_0x33fd('0x2f')]=_[_0x33fd('0x31')](db[_0x33fd('0x2b')]['rawAttributes']);_0x3f95cb['query']=_['keys'](_0x757118[_0x33fd('0x30')]);_0x3f95cb[_0x33fd('0x32')]=_[_0x33fd('0x33')](_0x3f95cb[_0x33fd('0x2f')],_0x3f95cb[_0x33fd('0x30')]);_0x4bd53c[_0x33fd('0x34')]=_[_0x33fd('0x33')](_0x3f95cb[_0x33fd('0x2f')],qs[_0x33fd('0x35')](_0x757118[_0x33fd('0x30')]['fields']));_0x4bd53c[_0x33fd('0x34')]=_0x4bd53c[_0x33fd('0x34')][_0x33fd('0x47')]?_0x4bd53c[_0x33fd('0x34')]:_0x3f95cb[_0x33fd('0x2f')];if(_0x757118[_0x33fd('0x30')][_0x33fd('0x41')]){_0x4bd53c[_0x33fd('0x42')]=[{'all':!![]}];}_0x4bd53c=_[_0x33fd('0x3f')]({},_0x4bd53c,_0x757118[_0x33fd('0x40')]);return db[_0x33fd('0x2b')]['find'](_0x4bd53c)[_0x33fd('0x22')](handleEntityNotFound(_0x3d2104,null))[_0x33fd('0x22')](respondWithResult(_0x3d2104,null))['catch'](handleError(_0x3d2104,null));};exports[_0x33fd('0x48')]=function(_0x341fc9,_0x28a3b9){return db[_0x33fd('0x2b')][_0x33fd('0x48')](_0x341fc9[_0x33fd('0x49')],{})[_0x33fd('0x22')](function(_0x7462b4){var _0x41a82b=_0x341fc9[_0x33fd('0x4a')][_0x33fd('0x4b')]({'plain':!![]});if(!_0x41a82b)throw new Error(_0x33fd('0x4c'));if(_0x41a82b['role']===_0x33fd('0x4a')){var _0x2ede80=_0x7462b4[_0x33fd('0x4b')]({'plain':!![]});var _0x3bae33=_0x33fd('0x23');return db[_0x33fd('0x4d')][_0x33fd('0x4e')]({'where':{'name':_0x3bae33,'userProfileId':_0x41a82b[_0x33fd('0x4f')]},'raw':!![]})[_0x33fd('0x22')](function(_0x34a0b0){if(_0x34a0b0&&_0x34a0b0[_0x33fd('0x50')]===0x0){return db['UserProfileResource'][_0x33fd('0x48')]({'name':_0x2ede80[_0x33fd('0x27')],'resourceId':_0x2ede80['id'],'type':_0x34a0b0[_0x33fd('0x27')],'sectionId':_0x34a0b0['id']},{})[_0x33fd('0x22')](function(){return _0x7462b4;});}else{return _0x7462b4;}})[_0x33fd('0x44')](function(_0x1cfb31){logger['error'](_0x33fd('0x51'),_0x1cfb31);throw _0x1cfb31;});}return _0x7462b4;})['then'](respondWithResult(_0x28a3b9,0xc9))[_0x33fd('0x44')](handleError(_0x28a3b9,null));};exports[_0x33fd('0x52')]=function(_0x300314,_0x1bc98b){if(_0x300314['body']['id']){delete _0x300314['body']['id'];}return db[_0x33fd('0x2b')][_0x33fd('0x4e')]({'where':{'id':_0x300314[_0x33fd('0x46')]['id']}})[_0x33fd('0x22')](handleEntityNotFound(_0x1bc98b,null))[_0x33fd('0x22')](saveUpdates(_0x300314[_0x33fd('0x49')],null))[_0x33fd('0x22')](respondWithResult(_0x1bc98b,null))[_0x33fd('0x44')](handleError(_0x1bc98b,null));};exports['destroy']=function(_0x1036a8,_0x12bb05){return db['Pause'][_0x33fd('0x4e')]({'where':{'id':_0x1036a8[_0x33fd('0x46')]['id']}})['then'](handleEntityNotFound(_0x12bb05,null))[_0x33fd('0x22')](removeEntity(_0x12bb05,null))[_0x33fd('0x44')](handleError(_0x12bb05,null));};
\ No newline at end of file
index 933897c..322f6ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x55406d,_0x1e908e){var _0x109cf1=function(_0x250622){while(--_0x250622){_0x55406d['push'](_0x55406d['shift']());}};_0x109cf1(++_0x1e908e);}(_0xe14b,0x93));var _0xbe14=function(_0x3a325b,_0x4cd55d){_0x3a325b=_0x3a325b-0x0;var _0x326b12=_0xe14b[_0x3a325b];return _0x326b12;};'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':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x7217,0x19e));var _0x7721=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x7217[_0x5e3b04];return _0x1fc44d;};'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 f2e4254..b18b250 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(_0x984021,_0x55f4e0){var _0x16fe96=function(_0x5b7133){while(--_0x5b7133){_0x984021['push'](_0x984021['shift']());}};_0x16fe96(++_0x55f4e0);}(_0x7a54,0x106));var _0x47a5=function(_0x43a01a,_0x33e774){_0x43a01a=_0x43a01a-0x0;var _0x4a85f5=_0x7a54[_0x43a01a];return _0x4a85f5;};'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(_0x54b221,_0x2dfb60){var _0xb01066=function(_0x5e4a63){while(--_0x5e4a63){_0x54b221['push'](_0x54b221['shift']());}};_0xb01066(++_0x2dfb60);}(_0xb10b,0x12a));var _0xbb10=function(_0x31cae7,_0x297087){_0x31cae7=_0x31cae7-0x0;var _0x3f8521=_0xb10b[_0x31cae7];return _0x3f8521;};'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 04f3d2f..088c6a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ba=['single','upload','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','post'];(function(_0x2a0fcd,_0x2fb656){var _0x3d843c=function(_0x24ed30){while(--_0x24ed30){_0x2a0fcd['push'](_0x2a0fcd['shift']());}};_0x3d843c(++_0x2fb656);}(_0x17ba,0xab));var _0xa17b=function(_0x397185,_0x47ab3d){_0x397185=_0x397185-0x0;var _0x5a4e1f=_0x17ba[_0x397185];return _0x5a4e1f;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router[_0xa17b('0xa')]('/:id/download',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);var upload=multer({'storage':multer[_0xa17b('0x12')]({'destination':function(_0x1e799a,_0x140943,_0x4382df){_0x4382df(null,path[_0xa17b('0x13')](config['root'],_0xa17b('0x14')));},'filename':function(_0x3e92e4,_0x3c3a8a,_0x52b7aa){_0x3c3a8a[_0xa17b('0x15')]=_0x3c3a8a[_0xa17b('0x15')][_0xa17b('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52b7aa(null,util[_0xa17b('0x17')]('%s-%s%s',path[_0xa17b('0x18')](_0x3c3a8a['originalname'],path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])),Date['now'](),path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])));}})});router[_0xa17b('0x1a')]('/',upload[_0xa17b('0x1b')]('file'),controller[_0xa17b('0x1c')]);router['post']('/webhook',controller['webhookPost']);router[_0xa17b('0x1d')](_0xa17b('0xf'),auth['isAuthenticated'](),controller[_0xa17b('0x1e')]);router[_0xa17b('0x1f')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x1f')]);module[_0xa17b('0x20')]=router;
\ No newline at end of file
+var _0xcb99=['originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','show','download','diskStorage','join'];(function(_0x1e2caa,_0x5d0c19){var _0x16f101=function(_0x1c4bdb){while(--_0x1c4bdb){_0x1e2caa['push'](_0x1e2caa['shift']());}};_0x16f101(++_0x5d0c19);}(_0xcb99,0x8b));var _0x9cb9=function(_0x5d92c2,_0x26d815){_0x5d92c2=_0x5d92c2-0x0;var _0x415601=_0xcb99[_0x5d92c2];return _0x415601;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router[_0x9cb9('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);var upload=multer({'storage':multer[_0x9cb9('0xe')]({'destination':function(_0x1b4fa6,_0x5a0ac7,_0x3be02c){_0x3be02c(null,path[_0x9cb9('0xf')](config['root'],'server/files/plugins'));},'filename':function(_0x227d49,_0x2e687e,_0x3382c8){_0x2e687e[_0x9cb9('0x10')]=_0x2e687e['originalname'][_0x9cb9('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3382c8(null,util[_0x9cb9('0x12')](_0x9cb9('0x13'),path[_0x9cb9('0x14')](_0x2e687e[_0x9cb9('0x10')],path[_0x9cb9('0x15')](_0x2e687e[_0x9cb9('0x10')])),Date[_0x9cb9('0x16')](),path[_0x9cb9('0x15')](_0x2e687e[_0x9cb9('0x10')])));}})});router[_0x9cb9('0x17')]('/',upload[_0x9cb9('0x18')](_0x9cb9('0x19')),controller[_0x9cb9('0x1a')]);router[_0x9cb9('0x17')](_0x9cb9('0x9'),controller[_0x9cb9('0x1b')]);router[_0x9cb9('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x1d')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x1e')]);module['exports']=router;
\ No newline at end of file
index ab6ccce..0ecf8c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdc6=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','STRING','exports','ENUM','script','TEXT'];(function(_0x377192,_0xf5a6d0){var _0x33f9a2=function(_0x3d36e1){while(--_0x3d36e1){_0x377192['push'](_0x377192['shift']());}};_0x33f9a2(++_0xf5a6d0);}(_0xbdc6,0x178));var _0x6bdc=function(_0x2de78f,_0x3d518c){_0x2de78f=_0x2de78f-0x0;var _0x448894=_0xbdc6[_0x2de78f];return _0x448894;};'use strict';var Sequelize=require('sequelize');module[_0x6bdc('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6bdc('0x1')]('html',_0x6bdc('0x2'))},'description':{'type':Sequelize[_0x6bdc('0x3')]},'version':{'type':Sequelize[_0x6bdc('0x3')]},'path':{'type':Sequelize['STRING'],'comment':_0x6bdc('0x4')},'active':{'type':Sequelize[_0x6bdc('0x5')],'defaultValue':0x0,'comment':_0x6bdc('0x6')},'sidebar':{'type':Sequelize[_0x6bdc('0x1')]('adminOnly',_0x6bdc('0x7'),_0x6bdc('0x8'),'never'),'defaultValue':_0x6bdc('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x6bdc('0x9')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x6bdc('0x9')]},'scriptPath':{'type':Sequelize[_0x6bdc('0x9')]}};
\ No newline at end of file
+var _0x1d01=['STRING','sequelize','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','always','never'];(function(_0x5a3531,_0x1e589a){var _0x44f7a8=function(_0x57b7b4){while(--_0x57b7b4){_0x5a3531['push'](_0x5a3531['shift']());}};_0x44f7a8(++_0x1e589a);}(_0x1d01,0x19b));var _0x11d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d01[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x11d0('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x11d0('0x1')]('html',_0x11d0('0x2'))},'description':{'type':Sequelize[_0x11d0('0x3')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0x11d0('0x4')},'active':{'type':Sequelize[_0x11d0('0x5')],'defaultValue':0x0,'comment':_0x11d0('0x6')},'sidebar':{'type':Sequelize[_0x11d0('0x1')]('adminOnly','agentOnly',_0x11d0('0x7'),_0x11d0('0x8')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x11d0('0x9')]},'agentUrl':{'type':Sequelize[_0x11d0('0x9')]},'scriptName':{'type':Sequelize[_0x11d0('0x9')]},'scriptPath':{'type':Sequelize[_0x11d0('0x9')]}};
\ No newline at end of file
index 8f0c46f..8e88ab6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fea=['fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','params','keys','options','find','download','path','join','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','root','dirname','attachments/**/*','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','info','upload','file','filename','extname','server/files/plugins','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','html','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','content-type','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','get','Plugins','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0x6fea,0x11b));var _0xa6fe=function(_0x26489a,_0x10290d){_0x26489a=_0x26489a-0x0;var _0x2c789c=_0x6fea[_0x26489a];return _0x2c789c;};'use strict';var emlformat=require(_0xa6fe('0x0'));var rimraf=require(_0xa6fe('0x1'));var zipdir=require(_0xa6fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6fe('0x3'));var moment=require(_0xa6fe('0x4'));var BPromise=require(_0xa6fe('0x5'));var Mustache=require(_0xa6fe('0x6'));var util=require(_0xa6fe('0x7'));var path=require('path');var sox=require(_0xa6fe('0x8'));var csv=require('to-csv');var ejs=require(_0xa6fe('0x9'));var fs=require('fs');var fs_extra=require(_0xa6fe('0xa'));var _=require(_0xa6fe('0xb'));var squel=require(_0xa6fe('0xc'));var crypto=require(_0xa6fe('0xd'));var jsforce=require(_0xa6fe('0xe'));var deskjs=require(_0xa6fe('0xf'));var toCsv=require(_0xa6fe('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0xa6fe('0x11'));var rimraf=require(_0xa6fe('0x1'));var archiver=require(_0xa6fe('0x12'));var Redis=require(_0xa6fe('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa6fe('0x14'));var as=require(_0xa6fe('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6fe('0x16'))(_0xa6fe('0x17'));var utils=require(_0xa6fe('0x18'));var config=require(_0xa6fe('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa6fe('0x1a'))['db'];config[_0xa6fe('0x1b')]=_[_0xa6fe('0x1c')](config[_0xa6fe('0x1b')],{'host':_0xa6fe('0x1d'),'port':0x18eb});var socket=require(_0xa6fe('0x1e'))(new Redis(config[_0xa6fe('0x1b')]));require(_0xa6fe('0x1f'))[_0xa6fe('0x20')](socket);function respondWithStatusCode(_0x441225,_0x268aa5){_0x268aa5=_0x268aa5||0xcc;return function(_0x43f599){if(_0x43f599){return _0x441225[_0xa6fe('0x21')](_0x268aa5);}return _0x441225[_0xa6fe('0x22')](_0x268aa5)[_0xa6fe('0x23')]();};}function respondWithResult(_0x534f28,_0x368bf1){_0x368bf1=_0x368bf1||0xc8;return function(_0x5ecef4){if(_0x5ecef4){return _0x534f28[_0xa6fe('0x22')](_0x368bf1)[_0xa6fe('0x24')](_0x5ecef4);}};}function respondWithFilteredResult(_0x40567a,_0x577053){return function(_0x5a9182){if(_0x5a9182){var _0x1bfc86=typeof _0x577053[_0xa6fe('0x25')]==='undefined'&&typeof _0x577053['limit']===_0xa6fe('0x26');var _0x5aeb42=_0x5a9182[_0xa6fe('0x27')];var _0x1a1f39=_0x1bfc86?0x0:_0x577053[_0xa6fe('0x25')];var _0x4f6f1e=_0x1bfc86?_0x5a9182[_0xa6fe('0x27')]:_0x577053[_0xa6fe('0x25')]+_0x577053[_0xa6fe('0x28')];var _0x2dfa92;if(_0x4f6f1e>=_0x5aeb42){_0x4f6f1e=_0x5aeb42;_0x2dfa92=0xc8;}else{_0x2dfa92=0xce;}_0x40567a[_0xa6fe('0x22')](_0x2dfa92);return _0x40567a[_0xa6fe('0x29')]('Content-Range',_0x1a1f39+'-'+_0x4f6f1e+'/'+_0x5aeb42)[_0xa6fe('0x24')](_0x5a9182);}return null;};}function patchUpdates(_0x418b08){return function(_0x18b87a){try{jsonpatch[_0xa6fe('0x2a')](_0x18b87a,_0x418b08,!![]);}catch(_0x239c52){return BPromise[_0xa6fe('0x2b')](_0x239c52);}return _0x18b87a[_0xa6fe('0x2c')]();};}function saveUpdates(_0x15aa67,_0x1262b6){return function(_0x15a4eb){if(_0x15a4eb){return _0x15a4eb[_0xa6fe('0x2d')](_0x15aa67)[_0xa6fe('0x2e')](function(_0x103449){return _0x103449;});}return null;};}function removeEntity(_0x5bf074,_0x11a72a){return function(_0xbb2ce3){if(_0xbb2ce3){return _0xbb2ce3['destroy']()[_0xa6fe('0x2e')](function(){var _0x22cb8d=_0xbb2ce3[_0xa6fe('0x2f')]({'plain':!![]});var _0x41c7e6=_0xa6fe('0x30');return db[_0xa6fe('0x31')]['destroy']({'where':{'type':_0x41c7e6,'resourceId':_0x22cb8d['id']}})[_0xa6fe('0x2e')](function(){return _0xbb2ce3;});})[_0xa6fe('0x2e')](function(){_0x5bf074['status'](0xcc)[_0xa6fe('0x23')]();});}};}function handleEntityNotFound(_0x21c25b,_0x3acc46){return function(_0xfe2d0d){if(!_0xfe2d0d){_0x21c25b[_0xa6fe('0x21')](0x194);}return _0xfe2d0d;};}function handleError(_0x60b5d5,_0x4cac63){_0x4cac63=_0x4cac63||0x1f4;return function(_0x3df168){logger[_0xa6fe('0x32')](_0x3df168[_0xa6fe('0x33')]);if(_0x3df168[_0xa6fe('0x34')]){delete _0x3df168[_0xa6fe('0x34')];}_0x60b5d5['status'](_0x4cac63)[_0xa6fe('0x35')](_0x3df168);};}exports[_0xa6fe('0x36')]=function(_0x38e0af,_0x3dfdb7){var _0x23dc53={},_0x3a9092={},_0x1dffe5={'count':0x0,'rows':[]};var _0x4fb1fb=_['map'](db[_0xa6fe('0x37')][_0xa6fe('0x38')],function(_0x23f7f7){return{'name':_0x23f7f7[_0xa6fe('0x39')],'type':_0x23f7f7[_0xa6fe('0x3a')]['key']};});_0x3a9092[_0xa6fe('0x3b')]=_[_0xa6fe('0x3c')](_0x4fb1fb,_0xa6fe('0x34'));_0x3a9092[_0xa6fe('0x3d')]=_['keys'](_0x38e0af[_0xa6fe('0x3d')]);_0x3a9092[_0xa6fe('0x3e')]=_[_0xa6fe('0x3f')](_0x3a9092['model'],_0x3a9092[_0xa6fe('0x3d')]);_0x23dc53[_0xa6fe('0x40')]=_[_0xa6fe('0x3f')](_0x3a9092[_0xa6fe('0x3b')],qs[_0xa6fe('0x41')](_0x38e0af['query'][_0xa6fe('0x41')]));_0x23dc53['attributes']=_0x23dc53[_0xa6fe('0x40')][_0xa6fe('0x42')]?_0x23dc53[_0xa6fe('0x40')]:_0x3a9092[_0xa6fe('0x3b')];if(!_0x38e0af[_0xa6fe('0x3d')][_0xa6fe('0x43')](_0xa6fe('0x44'))){_0x23dc53[_0xa6fe('0x28')]=qs['limit'](_0x38e0af['query'][_0xa6fe('0x28')]);_0x23dc53['offset']=qs[_0xa6fe('0x25')](_0x38e0af[_0xa6fe('0x3d')][_0xa6fe('0x25')]);}_0x23dc53[_0xa6fe('0x45')]=qs[_0xa6fe('0x46')](_0x38e0af[_0xa6fe('0x3d')][_0xa6fe('0x46')]);_0x23dc53[_0xa6fe('0x47')]=qs[_0xa6fe('0x3e')](_['pick'](_0x38e0af[_0xa6fe('0x3d')],_0x3a9092[_0xa6fe('0x3e')]),_0x4fb1fb);if(_0x38e0af['query'][_0xa6fe('0x48')]){_0x23dc53[_0xa6fe('0x47')]=_[_0xa6fe('0x49')](_0x23dc53['where'],{'$or':_[_0xa6fe('0x3c')](_0x4fb1fb,function(_0xac32ba){if(_0xac32ba[_0xa6fe('0x3a')]!==_0xa6fe('0x4a')){var _0x2613da={};_0x2613da[_0xac32ba[_0xa6fe('0x34')]]={'$like':'%'+_0x38e0af[_0xa6fe('0x3d')][_0xa6fe('0x48')]+'%'};return _0x2613da;}})});}_0x23dc53=_[_0xa6fe('0x49')]({},_0x23dc53,_0x38e0af['options']);var _0xcf5f5={'where':_0x23dc53['where']};return db[_0xa6fe('0x37')][_0xa6fe('0x27')](_0xcf5f5)['then'](function(_0x2de27b){_0x1dffe5[_0xa6fe('0x27')]=_0x2de27b;if(_0x38e0af[_0xa6fe('0x3d')]['includeAll']){_0x23dc53[_0xa6fe('0x4b')]=[{'all':!![]}];}return db[_0xa6fe('0x37')][_0xa6fe('0x4c')](_0x23dc53);})[_0xa6fe('0x2e')](function(_0x272e9e){_0x1dffe5[_0xa6fe('0x4d')]=_0x272e9e;return _0x1dffe5;})[_0xa6fe('0x2e')](respondWithFilteredResult(_0x3dfdb7,_0x23dc53))[_0xa6fe('0x4e')](handleError(_0x3dfdb7,null));};exports['show']=function(_0x41234d,_0x1d0d60){var _0x29b3bb={'raw':!![],'where':{'id':_0x41234d[_0xa6fe('0x4f')]['id']}},_0x29b34e={};_0x29b34e['model']=_[_0xa6fe('0x50')](db[_0xa6fe('0x37')]['rawAttributes']);_0x29b34e[_0xa6fe('0x3d')]=_[_0xa6fe('0x50')](_0x41234d['query']);_0x29b34e[_0xa6fe('0x3e')]=_[_0xa6fe('0x3f')](_0x29b34e[_0xa6fe('0x3b')],_0x29b34e[_0xa6fe('0x3d')]);_0x29b3bb[_0xa6fe('0x40')]=_['intersection'](_0x29b34e[_0xa6fe('0x3b')],qs['fields'](_0x41234d[_0xa6fe('0x3d')][_0xa6fe('0x41')]));_0x29b3bb[_0xa6fe('0x40')]=_0x29b3bb[_0xa6fe('0x40')][_0xa6fe('0x42')]?_0x29b3bb[_0xa6fe('0x40')]:_0x29b34e[_0xa6fe('0x3b')];if(_0x41234d[_0xa6fe('0x3d')]['includeAll']){_0x29b3bb[_0xa6fe('0x4b')]=[{'all':!![]}];}_0x29b3bb=_[_0xa6fe('0x49')]({},_0x29b3bb,_0x41234d[_0xa6fe('0x51')]);return db[_0xa6fe('0x37')][_0xa6fe('0x52')](_0x29b3bb)['then'](handleEntityNotFound(_0x1d0d60,null))['then'](respondWithResult(_0x1d0d60,null))[_0xa6fe('0x4e')](handleError(_0x1d0d60,null));};exports[_0xa6fe('0x53')]=function(_0x24e46a,_0x3a3156,_0x2e8471){return db[_0xa6fe('0x37')][_0xa6fe('0x52')]({'where':{'id':_0x24e46a[_0xa6fe('0x4f')]['id']},'attributes':[_0xa6fe('0x34'),_0xa6fe('0x54')],'raw':!![]})[_0xa6fe('0x2e')](handleEntityNotFound(_0x3a3156,null))[_0xa6fe('0x2e')](function(_0x24ab2b){if(_0x24ab2b){var _0x136618=path[_0xa6fe('0x55')](config['root'],'server/files/plugins',util[_0xa6fe('0x56')](_0xa6fe('0x57'),path[_0xa6fe('0x58')](_0x24ab2b[_0xa6fe('0x54')])));var _0x5a8f7b=fs[_0xa6fe('0x59')](_0x136618);var _0x467a8c=archiver(_0xa6fe('0x5a'),{'zlib':{'level':0x9}});_0x467a8c['on'](_0xa6fe('0x5b'),function(_0x4ce1dd){if(_0x4ce1dd[_0xa6fe('0x5c')]===_0xa6fe('0x5d')){logger[_0xa6fe('0x32')](_0x4ce1dd);}else{throw new db[(_0xa6fe('0x5e'))][(_0xa6fe('0x5f'))](_0xa6fe('0x60'));}});_0x467a8c['on'](_0xa6fe('0x32'),function(_0x264f88){throw new db[(_0xa6fe('0x5e'))][(_0xa6fe('0x5f'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x467a8c['pipe'](_0x5a8f7b);_0x467a8c[_0xa6fe('0x61')](_0xa6fe('0x62'),{'cwd':path[_0xa6fe('0x55')](config[_0xa6fe('0x63')],'server/files/plugins',path[_0xa6fe('0x64')](_0x24ab2b[_0xa6fe('0x54')])),'ignore':[path[_0xa6fe('0x55')](path['basename'](_0x24ab2b[_0xa6fe('0x54')]),'node_modules/**/*'),path['join'](path[_0xa6fe('0x58')](_0x24ab2b[_0xa6fe('0x54')]),_0xa6fe('0x65'))],'nodir':!![]})['finalize']();_0x5a8f7b['on'](_0xa6fe('0x66'),function(){if(!fs[_0xa6fe('0x67')](_0x136618)){throw new db[(_0xa6fe('0x5e'))][(_0xa6fe('0x5f'))]('Plugin\x20not\x20found');}return _0x3a3156['download'](_0x136618,util[_0xa6fe('0x56')](_0xa6fe('0x57'),path[_0xa6fe('0x58')](_0x24ab2b[_0xa6fe('0x54')])),function(_0x4e9155){if(_0x4e9155){throw new db['Sequelize']['Error'](_0xa6fe('0x68'));}fs['unlinkSync'](_0x136618);logger['info'](_0xa6fe('0x69'));logger[_0xa6fe('0x6a')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x3a3156,null));};exports[_0xa6fe('0x6b')]=function(_0x584f23,_0x376b43,_0x201e44){var _0x4ba19b=path[_0xa6fe('0x58')](_0x584f23[_0xa6fe('0x6c')][_0xa6fe('0x6d')],path[_0xa6fe('0x6e')](_0x584f23['file'][_0xa6fe('0x6d')]));var _0x343895=path[_0xa6fe('0x55')](config[_0xa6fe('0x63')],_0xa6fe('0x6f'),_0x584f23[_0xa6fe('0x6c')][_0xa6fe('0x6d')]);var _0x1607cc=path['join'](config[_0xa6fe('0x63')],_0xa6fe('0x6f'),_0x4ba19b);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x343895);logger['info'](_0xa6fe('0x70'),_0x1607cc);try{fs['chmodSync'](_0x343895,parseInt('0777',0x8));extract(_0x343895,{'dir':_0x1607cc},function(_0x355ada){if(_0x355ada){logger[_0xa6fe('0x32')](_0x355ada);handleError(_0x355ada,!![]);};var _0xacbbc=fs[_0xa6fe('0x71')](_0x1607cc);if(_0xacbbc[_0xa6fe('0x42')]>0x1){removeReferences(_0x343895,_0x1607cc);logger[_0xa6fe('0x32')]('Invalid\x20plugin\x20structure');return _0x201e44(new Error(_0xa6fe('0x72')));}var _0x340709=fs[_0xa6fe('0x73')](path[_0xa6fe('0x55')](_0x1607cc,_0xacbbc[0x0]));if(_0x340709['isFile']()){removeReferences(_0x343895,_0x1607cc);logger['error']('Invalid\x20plugin\x20structure');return _0x201e44(new Error(_0xa6fe('0x72')));}if(_0x340709[_0xa6fe('0x74')]()){var _0x2df6d5=fs[_0xa6fe('0x71')](path['join'](_0x1607cc,_0xacbbc[0x0]));if(_0x2df6d5['length']===0x0){removeReferences(_0x343895,_0x1607cc);logger['error'](_0xa6fe('0x72'));return _0x201e44(new Error('Invalid\x20plugin\x20structure'));}var _0x4e15f3=_0x2df6d5[_0xa6fe('0x75')](function(_0x121f75){return _0x121f75==='manifest.json';});if(!_0x4e15f3){return _0x201e44(new Error(_0xa6fe('0x76')));}var _0x32219a=fs[_0xa6fe('0x77')](path[_0xa6fe('0x55')](_0x1607cc,_0xacbbc[0x0],'manifest.json'));var _0x379e55=JSON[_0xa6fe('0x78')](_0x32219a);if(_0xa6fe('0x26')==typeof _0x379e55[_0xa6fe('0x34')]){return _0x201e44(new Error(_0xa6fe('0x79')));}if(_0xa6fe('0x26')==typeof _0x379e55[_0xa6fe('0x3a')]){return _0x201e44(new Error(_0xa6fe('0x7a')));}if('undefined'==typeof _0x379e55[_0xa6fe('0x7b')]){return _0x201e44(new Error(_0xa6fe('0x7c')));}if(_0xa6fe('0x26')==typeof _0x379e55[_0xa6fe('0x7d')]){return _0x201e44(new Error(_0xa6fe('0x7e')));}if(_0x379e55[_0xa6fe('0x3a')]==='html'){if(_0xa6fe('0x26')==typeof _0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x7f')]){return _0x201e44(new Error(_0xa6fe('0x80')));}if(_0xa6fe('0x26')==typeof _0x379e55[_0xa6fe('0x7d')]['views'][_0xa6fe('0x81')]&&'undefined'==typeof _0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x7f')]['agent']){return _0x201e44(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x379e55[_0xa6fe('0x3a')]===_0xa6fe('0x82')){if(_0xa6fe('0x26')==typeof _0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x83')]){return _0x201e44(new Error(_0xa6fe('0x84')));}if(_0xa6fe('0x26')==typeof _0x379e55['parameters']['scriptPath']){return _0x201e44(new Error(_0xa6fe('0x85')));}}else{return _0x201e44(new Error(_0xa6fe('0x86')));}var _0x1a4c13=_0x379e55[_0xa6fe('0x34')];var _0x1d097b=_0x379e55[_0xa6fe('0x87')];var _0x51bbb3=_0x379e55[_0xa6fe('0x3a')];var _0x3577e3=_0x379e55[_0xa6fe('0x88')]?_0x379e55[_0xa6fe('0x88')]:_0xa6fe('0x89');var _0x31326c=_0x379e55[_0xa6fe('0x8a')]?_0x379e55[_0xa6fe('0x8a')]:'icon-apps';var _0x4802cb='';var _0x206ba3='';var _0x18d7b6='';var _0x51f73d='';var _0x114da3=_0x379e55[_0xa6fe('0x7b')];if(_0x51bbb3===_0xa6fe('0x8b')){if(_0xa6fe('0x26')!=typeof _0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x7f')][_0xa6fe('0x81')]){var _0x4c6cd9=_0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x7f')][_0xa6fe('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4c6cd9)){_0x4802cb=path[_0xa6fe('0x55')](_0xa6fe('0x8c'),_0x4ba19b,_0xacbbc[0x0],_0x4c6cd9);}else{_0x4802cb=_0x4c6cd9;}}else{logger[_0xa6fe('0x6a')](_0xa6fe('0x8d'));}if('undefined'!=typeof _0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x7f')][_0xa6fe('0x8e')]){var _0x5b9aae=_0x379e55[_0xa6fe('0x7d')]['views'][_0xa6fe('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0xa6fe('0x8f')](_0x5b9aae)){_0x206ba3=path[_0xa6fe('0x55')](_0xa6fe('0x8c'),_0x4ba19b,_0xacbbc[0x0],_0x5b9aae);}else{_0x206ba3=_0x5b9aae;}}else{logger['info'](_0xa6fe('0x90'));}}else if(_0x51bbb3===_0xa6fe('0x82')){_0x18d7b6=_0x379e55['parameters']['scriptName'];_0x51f73d=_0x379e55['parameters'][_0xa6fe('0x91')];if(_0xa6fe('0x26')!=typeof _0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x7f')]){if(_0xa6fe('0x26')!=typeof _0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x7f')][_0xa6fe('0x81')]){var _0x4c6cd9=_0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x7f')][_0xa6fe('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4c6cd9)){_0x4802cb=path[_0xa6fe('0x55')]('plugins',_0x4ba19b,_0xacbbc[0x0],_0x4c6cd9);}else{_0x4802cb=_0x4c6cd9;}}if(_0xa6fe('0x26')!=typeof _0x379e55[_0xa6fe('0x7d')][_0xa6fe('0x7f')]['agent']){var _0x5b9aae=_0x379e55[_0xa6fe('0x7d')]['views'][_0xa6fe('0x8e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5b9aae)){_0x206ba3=path[_0xa6fe('0x55')](_0xa6fe('0x8c'),_0x4ba19b,_0xacbbc[0x0],_0x5b9aae);}else{_0x206ba3=_0x5b9aae;}}}}var _0xd46064={'name':_0x1a4c13,'description':_0x1d097b,'path':path['join'](_0x4ba19b,_0xacbbc[0x0]),'type':_0x51bbb3,'sidebar':_0x3577e3,'icon':_0x31326c,'adminUrl':_0x4802cb,'agentUrl':_0x206ba3,'scriptName':_0x18d7b6,'scriptPath':_0x51f73d,'version':_0x114da3};removeReferences(_0x343895,null);return db['Plugin'][_0xa6fe('0x92')](_0xd46064)[_0xa6fe('0x2e')](function(_0x1bfc2c){var _0x5b6fc0={'role':_0x584f23[_0xa6fe('0x93')][_0xa6fe('0x94')],'userProfileId':_0x584f23[_0xa6fe('0x93')]['userProfileId']};if(!_0x5b6fc0)throw new Error(_0xa6fe('0x95'));if(_0x5b6fc0[_0xa6fe('0x94')]===_0xa6fe('0x96')){var _0x4f3f96=_0x1bfc2c[_0xa6fe('0x2f')]({'plain':!![]});return db[_0xa6fe('0x97')]['find']({'where':{'name':_0xa6fe('0x30'),'userProfileId':_0x5b6fc0[_0xa6fe('0x98')]},'raw':!![]})[_0xa6fe('0x2e')](function(_0x584e58){if(_0x584e58&&_0x584e58['autoAssociation']===0x0){return db[_0xa6fe('0x31')]['create']({'name':_0x4f3f96[_0xa6fe('0x34')],'resourceId':_0x4f3f96['id'],'type':_0x584e58[_0xa6fe('0x34')],'sectionId':_0x584e58['id']},{})[_0xa6fe('0x2e')](function(){return _0x1bfc2c;});}else{return _0x1bfc2c;}})['catch'](function(_0x2191e4){logger[_0xa6fe('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2191e4);throw _0x2191e4;});}return _0x1bfc2c;})[_0xa6fe('0x2e')](respondWithResult(_0x376b43,null))[_0xa6fe('0x4e')](handleError(_0x376b43,null));}});}catch(_0x184c73){_0x376b43[_0xa6fe('0x22')](0x1f4)[_0xa6fe('0x35')](_0x184c73);}};function removeReferences(_0x3012e1,_0x10264f){try{if(_0x3012e1){fs['unlinkSync'](_0x3012e1);logger[_0xa6fe('0x6a')](_0xa6fe('0x99'));}if(_0x10264f){rimraf(_0x10264f,function(){});logger[_0xa6fe('0x6a')](_0xa6fe('0x9a'));}}catch(_0xa731d9){logger[_0xa6fe('0x32')](_0xa731d9);}}exports['update']=function(_0x20516a,_0x3d9102,_0x1e5f5c){return db['Plugin'][_0xa6fe('0x52')]({'where':{'id':_0x20516a[_0xa6fe('0x4f')]['id']}})[_0xa6fe('0x2e')](handleEntityNotFound(_0x3d9102,null))[_0xa6fe('0x2e')](saveUpdates(_0x20516a[_0xa6fe('0x93')],null))[_0xa6fe('0x2e')](respondWithResult(_0x3d9102,null))['catch'](handleError(_0x3d9102,null));};exports[_0xa6fe('0x9b')]=function(_0x18714d,_0x400b02,_0x32f95b){return db[_0xa6fe('0x37')][_0xa6fe('0x52')]({'where':{'id':_0x18714d[_0xa6fe('0x4f')]['id']}})[_0xa6fe('0x2e')](function(_0x3e50ab){if(_0x3e50ab){return _0x3e50ab['destroy']();}})[_0xa6fe('0x2e')](function(_0x37625c){rimraf(path['join'](config[_0xa6fe('0x63')],_0xa6fe('0x6f'),path[_0xa6fe('0x64')](_0x37625c['path'])),function(){});return _0x37625c;})[_0xa6fe('0x2e')](handleEntityNotFound(_0x400b02,null))['then'](respondWithStatusCode(_0x400b02,null))[_0xa6fe('0x4e')](handleError(_0x400b02,null));};exports['webhookGet']=function(_0x49c2d4,_0x4ff4cf,_0x3a9840){return BPromise[_0xa6fe('0x9c')]()[_0xa6fe('0x2e')](function(){if(!_0x49c2d4['query'][_0xa6fe('0x54')]){throw new Error(_0xa6fe('0x9d'));}if(!_0x49c2d4['query'][_0xa6fe('0x9e')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x42edbf=_0x49c2d4[_0xa6fe('0x3d')][_0xa6fe('0x9f')]?_0x49c2d4[_0xa6fe('0x3d')][_0xa6fe('0x9f')]+':'+_0x49c2d4['query'][_0xa6fe('0x9e')]:_0xa6fe('0xa0')+_0x49c2d4['query'][_0xa6fe('0x9e')];var _0xa76858=_0x49c2d4['query'][_0xa6fe('0x24')]?_0x49c2d4[_0xa6fe('0x3d')][_0xa6fe('0x24')]:!![];var _0xaf677=_0x49c2d4[_0xa6fe('0x3d')][_0xa6fe('0xa1')]?_0x49c2d4['query'][_0xa6fe('0xa1')]:null;var _0x19b1e5={'method':_0x49c2d4[_0xa6fe('0xa2')],'uri':util[_0xa6fe('0x56')](_0xa6fe('0xa3'),_0x42edbf,_0x49c2d4[_0xa6fe('0x3d')][_0xa6fe('0x54')]),'json':_0xa76858,'resolveWithFullResponse':!![],'encoding':_0xaf677,'qs':_0x49c2d4[_0xa6fe('0x3d')]};if(_0x49c2d4[_0xa6fe('0xa4')]){_0x19b1e5['headers']=_0x49c2d4[_0xa6fe('0xa4')];if(_0x19b1e5[_0xa6fe('0xa4')][_0xa6fe('0xa5')]){delete _0x19b1e5[_0xa6fe('0xa4')][_0xa6fe('0xa5')];}}if(_0x19b1e5[_0xa6fe('0xa4')]['content-type']){delete _0x19b1e5[_0xa6fe('0xa4')]['content-type'];}return rp(_0x19b1e5);})[_0xa6fe('0x2e')](function(_0x4774e0){if(_0x4774e0){_0x4ff4cf[_0xa6fe('0x29')](_0x4774e0['headers']);logger[_0xa6fe('0x6a')](_0x4774e0[_0xa6fe('0x93')]);if(_[_0xa6fe('0xa6')](_0x49c2d4['query'][_0xa6fe('0x54')],_0xa6fe('0x53'))&&_0x4774e0[_0xa6fe('0xa7')]==0x1f4){return _0x4ff4cf[_0xa6fe('0x21')](_0x4774e0[_0xa6fe('0xa7')]);}else{return _0x4ff4cf[_0xa6fe('0x22')](_0x4774e0[_0xa6fe('0xa7')])[_0xa6fe('0x35')](_0x4774e0[_0xa6fe('0x93')]);}}else{return _0x4ff4cf[_0xa6fe('0x21')](0xc8);}})['catch'](handleError(_0x4ff4cf,null));};exports[_0xa6fe('0xa8')]=function(_0xad8537,_0x333264,_0x59f68b){return BPromise[_0xa6fe('0x9c')]()[_0xa6fe('0x2e')](function(){if(!_0xad8537[_0xa6fe('0x3d')][_0xa6fe('0x54')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xad8537[_0xa6fe('0x3d')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2f9f05=_0xad8537[_0xa6fe('0x3d')][_0xa6fe('0x9f')]?_0xad8537['query'][_0xa6fe('0x9f')]+':'+_0xad8537[_0xa6fe('0x3d')][_0xa6fe('0x9e')]:_0xa6fe('0xa0')+_0xad8537[_0xa6fe('0x3d')][_0xa6fe('0x9e')];var _0x221594=_0xad8537[_0xa6fe('0x3d')][_0xa6fe('0x24')]?_0xad8537[_0xa6fe('0x3d')][_0xa6fe('0x24')]:!![];var _0x552eb8=_0xad8537[_0xa6fe('0x3d')]['encoding']?_0xad8537[_0xa6fe('0x3d')]['encoding']:null;var _0x1f29e7={'method':_0xad8537[_0xa6fe('0xa2')],'uri':util[_0xa6fe('0x56')](_0xa6fe('0xa3'),_0x2f9f05,_0xad8537['query'][_0xa6fe('0x54')]),'json':_0x221594,'resolveWithFullResponse':!![],'encoding':_0x552eb8,'body':_0xad8537[_0xa6fe('0x93')]};if(_0xad8537[_0xa6fe('0xa4')]){_0x1f29e7[_0xa6fe('0xa4')]=_0xad8537[_0xa6fe('0xa4')];if(_0x1f29e7['headers']['content-length']){delete _0x1f29e7['headers'][_0xa6fe('0xa5')];}}if(_0x1f29e7[_0xa6fe('0xa4')][_0xa6fe('0xa9')]){delete _0x1f29e7[_0xa6fe('0xa4')]['content-type'];}return rp(_0x1f29e7);})[_0xa6fe('0x2e')](function(_0x1e701d){if(_0x1e701d){_0x333264[_0xa6fe('0x29')](_0x1e701d[_0xa6fe('0xa4')]);logger['info'](_0x1e701d['body']);return _0x333264[_0xa6fe('0x22')](_0x1e701d[_0xa6fe('0xa7')])[_0xa6fe('0x35')](_0x1e701d[_0xa6fe('0x93')]);}else{return _0x333264['sendStatus'](0xc8);}})[_0xa6fe('0x4e')](handleError(_0x333264,null));};
\ No newline at end of file
+var _0x6cd3=['error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Plugin','include','findAll','catch','params','length','options','find','download','path','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','join','dirname','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','views','Invalid\x20manifest:\x20views\x20missing','parameters','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','version','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','defaults','redis','./plugin.socket','register','end','status','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','get','Plugins','sendStatus'];(function(_0x14fddd,_0x220fe5){var _0x2e03a2=function(_0x6d54d9){while(--_0x6d54d9){_0x14fddd['push'](_0x14fddd['shift']());}};_0x2e03a2(++_0x220fe5);}(_0x6cd3,0x118));var _0x36cd=function(_0x2baca1,_0x2f3557){_0x2baca1=_0x2baca1-0x0;var _0x9aa62a=_0x6cd3[_0x2baca1];return _0x9aa62a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36cd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x36cd('0x1'));var moment=require('moment');var BPromise=require(_0x36cd('0x2'));var Mustache=require('mustache');var util=require(_0x36cd('0x3'));var path=require('path');var sox=require(_0x36cd('0x4'));var csv=require(_0x36cd('0x5'));var ejs=require(_0x36cd('0x6'));var fs=require('fs');var fs_extra=require(_0x36cd('0x7'));var _=require('lodash');var squel=require(_0x36cd('0x8'));var crypto=require(_0x36cd('0x9'));var jsforce=require(_0x36cd('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x36cd('0x5'));var querystring=require(_0x36cd('0xb'));var Papa=require(_0x36cd('0xc'));var extract=require(_0x36cd('0xd'));var rimraf=require(_0x36cd('0x0'));var archiver=require(_0x36cd('0xe'));var Redis=require(_0x36cd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x36cd('0x10'));var hardwareService=require(_0x36cd('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x36cd('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x36cd('0x13'))['db'];config['redis']=_[_0x36cd('0x14')](config[_0x36cd('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x36cd('0x15')]));require(_0x36cd('0x16'))[_0x36cd('0x17')](socket);function respondWithStatusCode(_0xc2fc39,_0x145585){_0x145585=_0x145585||0xcc;return function(_0x20dd2e){if(_0x20dd2e){return _0xc2fc39['sendStatus'](_0x145585);}return _0xc2fc39['status'](_0x145585)[_0x36cd('0x18')]();};}function respondWithResult(_0x5c7cdb,_0x540b50){_0x540b50=_0x540b50||0xc8;return function(_0x5a0c8d){if(_0x5a0c8d){return _0x5c7cdb[_0x36cd('0x19')](_0x540b50)['json'](_0x5a0c8d);}};}function respondWithFilteredResult(_0x151ea2,_0x4ec2fd){return function(_0x9ad7c1){if(_0x9ad7c1){var _0xa07a4a=typeof _0x4ec2fd[_0x36cd('0x1a')]===_0x36cd('0x1b')&&typeof _0x4ec2fd[_0x36cd('0x1c')]==='undefined';var _0x5f10df=_0x9ad7c1['count'];var _0xfe2a49=_0xa07a4a?0x0:_0x4ec2fd[_0x36cd('0x1a')];var _0x2bafc9=_0xa07a4a?_0x9ad7c1[_0x36cd('0x1d')]:_0x4ec2fd[_0x36cd('0x1a')]+_0x4ec2fd[_0x36cd('0x1c')];var _0x355d69;if(_0x2bafc9>=_0x5f10df){_0x2bafc9=_0x5f10df;_0x355d69=0xc8;}else{_0x355d69=0xce;}_0x151ea2[_0x36cd('0x19')](_0x355d69);return _0x151ea2[_0x36cd('0x1e')]('Content-Range',_0xfe2a49+'-'+_0x2bafc9+'/'+_0x5f10df)[_0x36cd('0x1f')](_0x9ad7c1);}return null;};}function patchUpdates(_0x1e01f6){return function(_0x478143){try{jsonpatch[_0x36cd('0x20')](_0x478143,_0x1e01f6,!![]);}catch(_0x2fa379){return BPromise[_0x36cd('0x21')](_0x2fa379);}return _0x478143['save']();};}function saveUpdates(_0x4c249c,_0x1c2bc2){return function(_0x376e3b){if(_0x376e3b){return _0x376e3b[_0x36cd('0x22')](_0x4c249c)[_0x36cd('0x23')](function(_0x5b93c7){return _0x5b93c7;});}return null;};}function removeEntity(_0x3d3852,_0x437191){return function(_0x2f2dc1){if(_0x2f2dc1){return _0x2f2dc1[_0x36cd('0x24')]()[_0x36cd('0x23')](function(){var _0x59d6ca=_0x2f2dc1[_0x36cd('0x25')]({'plain':!![]});var _0x554ad4=_0x36cd('0x26');return db['UserProfileResource'][_0x36cd('0x24')]({'where':{'type':_0x554ad4,'resourceId':_0x59d6ca['id']}})[_0x36cd('0x23')](function(){return _0x2f2dc1;});})[_0x36cd('0x23')](function(){_0x3d3852[_0x36cd('0x19')](0xcc)[_0x36cd('0x18')]();});}};}function handleEntityNotFound(_0x5511f4,_0x20f9d0){return function(_0x2d1e34){if(!_0x2d1e34){_0x5511f4[_0x36cd('0x27')](0x194);}return _0x2d1e34;};}function handleError(_0x187962,_0x5d5f54){_0x5d5f54=_0x5d5f54||0x1f4;return function(_0x3f34c9){logger[_0x36cd('0x28')](_0x3f34c9['stack']);if(_0x3f34c9['name']){delete _0x3f34c9[_0x36cd('0x29')];}_0x187962[_0x36cd('0x19')](_0x5d5f54)[_0x36cd('0x2a')](_0x3f34c9);};}exports['index']=function(_0xf8b8c,_0x70ecb1){var _0x3fdccb={},_0x10fc41={},_0x31bab7={'count':0x0,'rows':[]};var _0x40ec3c=_[_0x36cd('0x2b')](db['Plugin'][_0x36cd('0x2c')],function(_0x46767c){return{'name':_0x46767c[_0x36cd('0x2d')],'type':_0x46767c[_0x36cd('0x2e')][_0x36cd('0x2f')]};});_0x10fc41[_0x36cd('0x30')]=_[_0x36cd('0x2b')](_0x40ec3c,'name');_0x10fc41[_0x36cd('0x31')]=_[_0x36cd('0x32')](_0xf8b8c[_0x36cd('0x31')]);_0x10fc41[_0x36cd('0x33')]=_[_0x36cd('0x34')](_0x10fc41[_0x36cd('0x30')],_0x10fc41[_0x36cd('0x31')]);_0x3fdccb[_0x36cd('0x35')]=_['intersection'](_0x10fc41[_0x36cd('0x30')],qs[_0x36cd('0x36')](_0xf8b8c[_0x36cd('0x31')][_0x36cd('0x36')]));_0x3fdccb[_0x36cd('0x35')]=_0x3fdccb[_0x36cd('0x35')]['length']?_0x3fdccb[_0x36cd('0x35')]:_0x10fc41[_0x36cd('0x30')];if(!_0xf8b8c[_0x36cd('0x31')][_0x36cd('0x37')](_0x36cd('0x38'))){_0x3fdccb[_0x36cd('0x1c')]=qs[_0x36cd('0x1c')](_0xf8b8c['query'][_0x36cd('0x1c')]);_0x3fdccb[_0x36cd('0x1a')]=qs[_0x36cd('0x1a')](_0xf8b8c[_0x36cd('0x31')][_0x36cd('0x1a')]);}_0x3fdccb[_0x36cd('0x39')]=qs[_0x36cd('0x3a')](_0xf8b8c[_0x36cd('0x31')][_0x36cd('0x3a')]);_0x3fdccb[_0x36cd('0x3b')]=qs[_0x36cd('0x33')](_[_0x36cd('0x3c')](_0xf8b8c['query'],_0x10fc41[_0x36cd('0x33')]),_0x40ec3c);if(_0xf8b8c['query'][_0x36cd('0x3d')]){_0x3fdccb['where']=_[_0x36cd('0x3e')](_0x3fdccb[_0x36cd('0x3b')],{'$or':_[_0x36cd('0x2b')](_0x40ec3c,function(_0x2e42c3){if(_0x2e42c3[_0x36cd('0x2e')]!==_0x36cd('0x3f')){var _0x10e94a={};_0x10e94a[_0x2e42c3[_0x36cd('0x29')]]={'$like':'%'+_0xf8b8c[_0x36cd('0x31')][_0x36cd('0x3d')]+'%'};return _0x10e94a;}})});}_0x3fdccb=_['merge']({},_0x3fdccb,_0xf8b8c['options']);var _0x29d167={'where':_0x3fdccb[_0x36cd('0x3b')]};return db[_0x36cd('0x40')][_0x36cd('0x1d')](_0x29d167)['then'](function(_0x3844b4){_0x31bab7[_0x36cd('0x1d')]=_0x3844b4;if(_0xf8b8c[_0x36cd('0x31')]['includeAll']){_0x3fdccb[_0x36cd('0x41')]=[{'all':!![]}];}return db['Plugin'][_0x36cd('0x42')](_0x3fdccb);})[_0x36cd('0x23')](function(_0x28927b){_0x31bab7['rows']=_0x28927b;return _0x31bab7;})[_0x36cd('0x23')](respondWithFilteredResult(_0x70ecb1,_0x3fdccb))[_0x36cd('0x43')](handleError(_0x70ecb1,null));};exports['show']=function(_0x21a5d1,_0x5369f4){var _0x4a1f6b={'raw':!![],'where':{'id':_0x21a5d1[_0x36cd('0x44')]['id']}},_0x2986a0={};_0x2986a0[_0x36cd('0x30')]=_[_0x36cd('0x32')](db['Plugin'][_0x36cd('0x2c')]);_0x2986a0[_0x36cd('0x31')]=_[_0x36cd('0x32')](_0x21a5d1[_0x36cd('0x31')]);_0x2986a0[_0x36cd('0x33')]=_[_0x36cd('0x34')](_0x2986a0[_0x36cd('0x30')],_0x2986a0[_0x36cd('0x31')]);_0x4a1f6b['attributes']=_[_0x36cd('0x34')](_0x2986a0['model'],qs['fields'](_0x21a5d1['query'][_0x36cd('0x36')]));_0x4a1f6b['attributes']=_0x4a1f6b[_0x36cd('0x35')][_0x36cd('0x45')]?_0x4a1f6b[_0x36cd('0x35')]:_0x2986a0[_0x36cd('0x30')];if(_0x21a5d1[_0x36cd('0x31')]['includeAll']){_0x4a1f6b[_0x36cd('0x41')]=[{'all':!![]}];}_0x4a1f6b=_[_0x36cd('0x3e')]({},_0x4a1f6b,_0x21a5d1[_0x36cd('0x46')]);return db['Plugin'][_0x36cd('0x47')](_0x4a1f6b)[_0x36cd('0x23')](handleEntityNotFound(_0x5369f4,null))['then'](respondWithResult(_0x5369f4,null))[_0x36cd('0x43')](handleError(_0x5369f4,null));};exports[_0x36cd('0x48')]=function(_0x110abd,_0x381f2a,_0x411ee3){return db['Plugin'][_0x36cd('0x47')]({'where':{'id':_0x110abd[_0x36cd('0x44')]['id']},'attributes':['name',_0x36cd('0x49')],'raw':!![]})[_0x36cd('0x23')](handleEntityNotFound(_0x381f2a,null))[_0x36cd('0x23')](function(_0x1f23b1){if(_0x1f23b1){var _0x4f7afa=path['join'](config[_0x36cd('0x4a')],_0x36cd('0x4b'),util[_0x36cd('0x4c')](_0x36cd('0x4d'),path[_0x36cd('0x4e')](_0x1f23b1[_0x36cd('0x49')])));var _0x6ed6f1=fs[_0x36cd('0x4f')](_0x4f7afa);var _0xd3523d=archiver(_0x36cd('0x50'),{'zlib':{'level':0x9}});_0xd3523d['on']('warning',function(_0x2189bc){if(_0x2189bc[_0x36cd('0x51')]===_0x36cd('0x52')){logger['error'](_0x2189bc);}else{throw new db[(_0x36cd('0x53'))][(_0x36cd('0x54'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0xd3523d['on']('error',function(_0x3664e8){throw new db[(_0x36cd('0x53'))][(_0x36cd('0x54'))](_0x36cd('0x55'));});_0xd3523d[_0x36cd('0x56')](_0x6ed6f1);_0xd3523d['glob'](_0x36cd('0x57'),{'cwd':path[_0x36cd('0x58')](config[_0x36cd('0x4a')],_0x36cd('0x4b'),path[_0x36cd('0x59')](_0x1f23b1[_0x36cd('0x49')])),'ignore':[path[_0x36cd('0x58')](path['basename'](_0x1f23b1[_0x36cd('0x49')]),'node_modules/**/*'),path[_0x36cd('0x58')](path[_0x36cd('0x4e')](_0x1f23b1[_0x36cd('0x49')]),'attachments/**/*')],'nodir':!![]})[_0x36cd('0x5a')]();_0x6ed6f1['on'](_0x36cd('0x5b'),function(){if(!fs[_0x36cd('0x5c')](_0x4f7afa)){throw new db[(_0x36cd('0x53'))]['Error'](_0x36cd('0x5d'));}return _0x381f2a['download'](_0x4f7afa,util[_0x36cd('0x4c')](_0x36cd('0x4d'),path[_0x36cd('0x4e')](_0x1f23b1[_0x36cd('0x49')])),function(_0x88fdf7){if(_0x88fdf7){throw new db[(_0x36cd('0x53'))][(_0x36cd('0x54'))](_0x36cd('0x5e'));}fs['unlinkSync'](_0x4f7afa);logger[_0x36cd('0x5f')](_0x36cd('0x60'));logger[_0x36cd('0x5f')](_0x36cd('0x61'));});});}return null;})['catch'](handleError(_0x381f2a,null));};exports[_0x36cd('0x62')]=function(_0x5e0712,_0x56365f,_0x33bf82){var _0x211d3a=path[_0x36cd('0x4e')](_0x5e0712['file']['filename'],path[_0x36cd('0x63')](_0x5e0712['file'][_0x36cd('0x64')]));var _0x32f547=path['join'](config[_0x36cd('0x4a')],_0x36cd('0x4b'),_0x5e0712['file']['filename']);var _0x53d5f8=path[_0x36cd('0x58')](config[_0x36cd('0x4a')],_0x36cd('0x4b'),_0x211d3a);logger['info'](_0x36cd('0x65'),_0x32f547);logger['info'](_0x36cd('0x66'),_0x53d5f8);try{fs['chmodSync'](_0x32f547,parseInt(_0x36cd('0x67'),0x8));extract(_0x32f547,{'dir':_0x53d5f8},function(_0x159c35){if(_0x159c35){logger[_0x36cd('0x28')](_0x159c35);handleError(_0x159c35,!![]);};var _0xfcbf52=fs[_0x36cd('0x68')](_0x53d5f8);if(_0xfcbf52['length']>0x1){removeReferences(_0x32f547,_0x53d5f8);logger[_0x36cd('0x28')](_0x36cd('0x69'));return _0x33bf82(new Error(_0x36cd('0x69')));}var _0x2142e0=fs['lstatSync'](path[_0x36cd('0x58')](_0x53d5f8,_0xfcbf52[0x0]));if(_0x2142e0[_0x36cd('0x6a')]()){removeReferences(_0x32f547,_0x53d5f8);logger[_0x36cd('0x28')](_0x36cd('0x69'));return _0x33bf82(new Error(_0x36cd('0x69')));}if(_0x2142e0['isDirectory']()){var _0x3f9434=fs[_0x36cd('0x68')](path[_0x36cd('0x58')](_0x53d5f8,_0xfcbf52[0x0]));if(_0x3f9434[_0x36cd('0x45')]===0x0){removeReferences(_0x32f547,_0x53d5f8);logger[_0x36cd('0x28')](_0x36cd('0x69'));return _0x33bf82(new Error(_0x36cd('0x69')));}var _0x3c631b=_0x3f9434['some'](function(_0x2b1c53){return _0x2b1c53===_0x36cd('0x6b');});if(!_0x3c631b){return _0x33bf82(new Error('Plugin\x20manifest\x20missing'));}var _0x4873c2=fs[_0x36cd('0x6c')](path['join'](_0x53d5f8,_0xfcbf52[0x0],_0x36cd('0x6b')));var _0x1a9cce=JSON[_0x36cd('0x6d')](_0x4873c2);if(_0x36cd('0x1b')==typeof _0x1a9cce[_0x36cd('0x29')]){return _0x33bf82(new Error(_0x36cd('0x6e')));}if(_0x36cd('0x1b')==typeof _0x1a9cce[_0x36cd('0x2e')]){return _0x33bf82(new Error(_0x36cd('0x6f')));}if(_0x36cd('0x1b')==typeof _0x1a9cce['version']){return _0x33bf82(new Error(_0x36cd('0x70')));}if(_0x36cd('0x1b')==typeof _0x1a9cce['parameters']){return _0x33bf82(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1a9cce['type']==='html'){if(_0x36cd('0x1b')==typeof _0x1a9cce['parameters'][_0x36cd('0x71')]){return _0x33bf82(new Error(_0x36cd('0x72')));}if(_0x36cd('0x1b')==typeof _0x1a9cce[_0x36cd('0x73')][_0x36cd('0x71')][_0x36cd('0x74')]&&_0x36cd('0x1b')==typeof _0x1a9cce['parameters'][_0x36cd('0x71')][_0x36cd('0x75')]){return _0x33bf82(new Error(_0x36cd('0x76')));}}else if(_0x1a9cce[_0x36cd('0x2e')]==='script'){if('undefined'==typeof _0x1a9cce[_0x36cd('0x73')][_0x36cd('0x77')]){return _0x33bf82(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x36cd('0x1b')==typeof _0x1a9cce[_0x36cd('0x73')][_0x36cd('0x78')]){return _0x33bf82(new Error(_0x36cd('0x79')));}}else{return _0x33bf82(new Error(_0x36cd('0x7a')));}var _0x3cadba=_0x1a9cce[_0x36cd('0x29')];var _0x52c420=_0x1a9cce[_0x36cd('0x7b')];var _0x4ff264=_0x1a9cce[_0x36cd('0x2e')];var _0x125823=_0x1a9cce[_0x36cd('0x7c')]?_0x1a9cce['sidebar']:'always';var _0x306fd4=_0x1a9cce[_0x36cd('0x7d')]?_0x1a9cce['icon']:_0x36cd('0x7e');var _0x58f98b='';var _0x3007fa='';var _0x2a2cab='';var _0x409d39='';var _0x201e98=_0x1a9cce[_0x36cd('0x7f')];if(_0x4ff264===_0x36cd('0x80')){if(_0x36cd('0x1b')!=typeof _0x1a9cce[_0x36cd('0x73')][_0x36cd('0x71')][_0x36cd('0x74')]){var _0x3a7203=_0x1a9cce[_0x36cd('0x73')]['views'][_0x36cd('0x74')];if(!/^(f|ht)tps?:\/\//i[_0x36cd('0x81')](_0x3a7203)){_0x58f98b=path[_0x36cd('0x58')](_0x36cd('0x82'),_0x211d3a,_0xfcbf52[0x0],_0x3a7203);}else{_0x58f98b=_0x3a7203;}}else{logger[_0x36cd('0x5f')](_0x36cd('0x83'));}if('undefined'!=typeof _0x1a9cce[_0x36cd('0x73')][_0x36cd('0x71')][_0x36cd('0x75')]){var _0x6ccdc=_0x1a9cce[_0x36cd('0x73')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x36cd('0x81')](_0x6ccdc)){_0x3007fa=path[_0x36cd('0x58')](_0x36cd('0x82'),_0x211d3a,_0xfcbf52[0x0],_0x6ccdc);}else{_0x3007fa=_0x6ccdc;}}else{logger[_0x36cd('0x5f')](_0x36cd('0x84'));}}else if(_0x4ff264==='script'){_0x2a2cab=_0x1a9cce[_0x36cd('0x73')][_0x36cd('0x77')];_0x409d39=_0x1a9cce[_0x36cd('0x73')][_0x36cd('0x78')];if('undefined'!=typeof _0x1a9cce[_0x36cd('0x73')]['views']){if('undefined'!=typeof _0x1a9cce[_0x36cd('0x73')][_0x36cd('0x71')][_0x36cd('0x74')]){var _0x3a7203=_0x1a9cce['parameters'][_0x36cd('0x71')][_0x36cd('0x74')];if(!/^(f|ht)tps?:\/\//i[_0x36cd('0x81')](_0x3a7203)){_0x58f98b=path[_0x36cd('0x58')](_0x36cd('0x82'),_0x211d3a,_0xfcbf52[0x0],_0x3a7203);}else{_0x58f98b=_0x3a7203;}}if(_0x36cd('0x1b')!=typeof _0x1a9cce['parameters']['views']['agent']){var _0x6ccdc=_0x1a9cce['parameters'][_0x36cd('0x71')][_0x36cd('0x75')];if(!/^(f|ht)tps?:\/\//i['test'](_0x6ccdc)){_0x3007fa=path[_0x36cd('0x58')]('plugins',_0x211d3a,_0xfcbf52[0x0],_0x6ccdc);}else{_0x3007fa=_0x6ccdc;}}}}var _0x596396={'name':_0x3cadba,'description':_0x52c420,'path':path['join'](_0x211d3a,_0xfcbf52[0x0]),'type':_0x4ff264,'sidebar':_0x125823,'icon':_0x306fd4,'adminUrl':_0x58f98b,'agentUrl':_0x3007fa,'scriptName':_0x2a2cab,'scriptPath':_0x409d39,'version':_0x201e98};removeReferences(_0x32f547,null);return db[_0x36cd('0x40')][_0x36cd('0x85')](_0x596396)[_0x36cd('0x23')](function(_0x3a367a){var _0x2ab5a1={'role':_0x5e0712[_0x36cd('0x86')]['role'],'userProfileId':_0x5e0712[_0x36cd('0x86')][_0x36cd('0x87')]};if(!_0x2ab5a1)throw new Error(_0x36cd('0x88'));if(_0x2ab5a1[_0x36cd('0x89')]===_0x36cd('0x8a')){var _0x56923d=_0x3a367a[_0x36cd('0x25')]({'plain':!![]});return db[_0x36cd('0x8b')]['find']({'where':{'name':_0x36cd('0x26'),'userProfileId':_0x2ab5a1['userProfileId']},'raw':!![]})[_0x36cd('0x23')](function(_0x250a17){if(_0x250a17&&_0x250a17[_0x36cd('0x8c')]===0x0){return db[_0x36cd('0x8d')]['create']({'name':_0x56923d[_0x36cd('0x29')],'resourceId':_0x56923d['id'],'type':_0x250a17['name'],'sectionId':_0x250a17['id']},{})[_0x36cd('0x23')](function(){return _0x3a367a;});}else{return _0x3a367a;}})['catch'](function(_0x2da8a3){logger[_0x36cd('0x28')](_0x36cd('0x8e'),_0x2da8a3);throw _0x2da8a3;});}return _0x3a367a;})['then'](respondWithResult(_0x56365f,null))[_0x36cd('0x43')](handleError(_0x56365f,null));}});}catch(_0x1d0535){_0x56365f['status'](0x1f4)[_0x36cd('0x2a')](_0x1d0535);}};function removeReferences(_0x1381d2,_0x2b9084){try{if(_0x1381d2){fs['unlinkSync'](_0x1381d2);logger[_0x36cd('0x5f')]('Zip\x20archive\x20removed');}if(_0x2b9084){rimraf(_0x2b9084,function(){});logger[_0x36cd('0x5f')](_0x36cd('0x8f'));}}catch(_0x37c1a9){logger[_0x36cd('0x28')](_0x37c1a9);}}exports['update']=function(_0x4385ed,_0x38f911,_0x1b50a6){return db['Plugin']['find']({'where':{'id':_0x4385ed['params']['id']}})[_0x36cd('0x23')](handleEntityNotFound(_0x38f911,null))[_0x36cd('0x23')](saveUpdates(_0x4385ed[_0x36cd('0x86')],null))[_0x36cd('0x23')](respondWithResult(_0x38f911,null))[_0x36cd('0x43')](handleError(_0x38f911,null));};exports[_0x36cd('0x90')]=function(_0x3c8f51,_0x5be06f,_0x3d0288){return db[_0x36cd('0x40')][_0x36cd('0x47')]({'where':{'id':_0x3c8f51[_0x36cd('0x44')]['id']}})[_0x36cd('0x23')](function(_0x5e3f6b){if(_0x5e3f6b){return _0x5e3f6b[_0x36cd('0x24')]();}})[_0x36cd('0x23')](function(_0x4c60a8){rimraf(path[_0x36cd('0x58')](config[_0x36cd('0x4a')],_0x36cd('0x4b'),path[_0x36cd('0x59')](_0x4c60a8[_0x36cd('0x49')])),function(){});return _0x4c60a8;})[_0x36cd('0x23')](handleEntityNotFound(_0x5be06f,null))[_0x36cd('0x23')](respondWithStatusCode(_0x5be06f,null))['catch'](handleError(_0x5be06f,null));};exports['webhookGet']=function(_0x1ac9f0,_0x2da68d,_0xbbda3c){return BPromise[_0x36cd('0x91')]()[_0x36cd('0x23')](function(){if(!_0x1ac9f0[_0x36cd('0x31')]['path']){throw new Error(_0x36cd('0x92'));}if(!_0x1ac9f0[_0x36cd('0x31')][_0x36cd('0x93')]){throw new Error(_0x36cd('0x94'));}var _0x350a99=_0x1ac9f0[_0x36cd('0x31')][_0x36cd('0x95')]?_0x1ac9f0[_0x36cd('0x31')][_0x36cd('0x95')]+':'+_0x1ac9f0[_0x36cd('0x31')]['port']:_0x36cd('0x96')+_0x1ac9f0[_0x36cd('0x31')][_0x36cd('0x93')];var _0x48c2a3=_0x1ac9f0[_0x36cd('0x31')]['json']?_0x1ac9f0['query']['json']:!![];var _0x2921f3=_0x1ac9f0[_0x36cd('0x31')][_0x36cd('0x97')]?_0x1ac9f0[_0x36cd('0x31')][_0x36cd('0x97')]:null;var _0xaae00c={'method':_0x1ac9f0[_0x36cd('0x98')],'uri':util['format'](_0x36cd('0x99'),_0x350a99,_0x1ac9f0[_0x36cd('0x31')][_0x36cd('0x49')]),'json':_0x48c2a3,'resolveWithFullResponse':!![],'encoding':_0x2921f3,'qs':_0x1ac9f0[_0x36cd('0x31')]};if(_0x1ac9f0[_0x36cd('0x9a')]){_0xaae00c[_0x36cd('0x9a')]=_0x1ac9f0[_0x36cd('0x9a')];if(_0xaae00c['headers'][_0x36cd('0x9b')]){delete _0xaae00c[_0x36cd('0x9a')][_0x36cd('0x9b')];}}if(_0xaae00c[_0x36cd('0x9a')][_0x36cd('0x9c')]){delete _0xaae00c[_0x36cd('0x9a')][_0x36cd('0x9c')];}return rp(_0xaae00c);})[_0x36cd('0x23')](function(_0x136d5c){if(_0x136d5c){_0x2da68d[_0x36cd('0x1e')](_0x136d5c['headers']);logger['info'](_0x136d5c[_0x36cd('0x86')]);if(_[_0x36cd('0x9d')](_0x1ac9f0[_0x36cd('0x31')][_0x36cd('0x49')],'download')&&_0x136d5c[_0x36cd('0x9e')]==0x1f4){return _0x2da68d[_0x36cd('0x27')](_0x136d5c[_0x36cd('0x9e')]);}else{return _0x2da68d[_0x36cd('0x19')](_0x136d5c[_0x36cd('0x9e')])[_0x36cd('0x2a')](_0x136d5c[_0x36cd('0x86')]);}}else{return _0x2da68d['sendStatus'](0xc8);}})[_0x36cd('0x43')](handleError(_0x2da68d,null));};exports[_0x36cd('0x9f')]=function(_0x5d012a,_0x514305,_0x457cbe){return BPromise[_0x36cd('0x91')]()['then'](function(){if(!_0x5d012a[_0x36cd('0x31')]['path']){throw new Error(_0x36cd('0x92'));}if(!_0x5d012a[_0x36cd('0x31')][_0x36cd('0x93')]){throw new Error(_0x36cd('0x94'));}var _0x5c6811=_0x5d012a[_0x36cd('0x31')][_0x36cd('0x95')]?_0x5d012a[_0x36cd('0x31')][_0x36cd('0x95')]+':'+_0x5d012a[_0x36cd('0x31')]['port']:_0x36cd('0x96')+_0x5d012a[_0x36cd('0x31')][_0x36cd('0x93')];var _0x3fae14=_0x5d012a[_0x36cd('0x31')][_0x36cd('0x1f')]?_0x5d012a[_0x36cd('0x31')][_0x36cd('0x1f')]:!![];var _0x2847bd=_0x5d012a[_0x36cd('0x31')][_0x36cd('0x97')]?_0x5d012a[_0x36cd('0x31')][_0x36cd('0x97')]:null;var _0x5c4feb={'method':_0x5d012a['method'],'uri':util[_0x36cd('0x4c')](_0x36cd('0x99'),_0x5c6811,_0x5d012a[_0x36cd('0x31')][_0x36cd('0x49')]),'json':_0x3fae14,'resolveWithFullResponse':!![],'encoding':_0x2847bd,'body':_0x5d012a[_0x36cd('0x86')]};if(_0x5d012a[_0x36cd('0x9a')]){_0x5c4feb[_0x36cd('0x9a')]=_0x5d012a[_0x36cd('0x9a')];if(_0x5c4feb['headers'][_0x36cd('0x9b')]){delete _0x5c4feb[_0x36cd('0x9a')][_0x36cd('0x9b')];}}if(_0x5c4feb['headers'][_0x36cd('0x9c')]){delete _0x5c4feb['headers']['content-type'];}return rp(_0x5c4feb);})[_0x36cd('0x23')](function(_0x471e32){if(_0x471e32){_0x514305[_0x36cd('0x1e')](_0x471e32[_0x36cd('0x9a')]);logger[_0x36cd('0x5f')](_0x471e32[_0x36cd('0x86')]);return _0x514305[_0x36cd('0x19')](_0x471e32['statusCode'])['send'](_0x471e32[_0x36cd('0x86')]);}else{return _0x514305['sendStatus'](0xc8);}})[_0x36cd('0x43')](handleError(_0x514305,null));};
\ No newline at end of file
index a69154a..cc58efe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6011=['emit','hasOwnProperty','hook','exports','update','remove'];(function(_0x451735,_0x391a76){var _0x41d1e2=function(_0x3566d7){while(--_0x3566d7){_0x451735['push'](_0x451735['shift']());}};_0x41d1e2(++_0x391a76);}(_0x6011,0x196));var _0x1601=function(_0x5af81b,_0x4569f6){_0x5af81b=_0x5af81b-0x0;var _0x14a775=_0x6011[_0x5af81b];return _0x14a775;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1601('0x0'),'afterDestroy':_0x1601('0x1')};function emitEvent(_0x56c468){return function(_0x23ed9e,_0x2ede55,_0x2503c4){PluginEvents[_0x1601('0x2')](_0x56c468+':'+_0x23ed9e['id'],_0x23ed9e);PluginEvents[_0x1601('0x2')](_0x56c468,_0x23ed9e);_0x2503c4(null);};}for(var e in events){if(events[_0x1601('0x3')](e)){var event=events[e];Plugin[_0x1601('0x4')](e,emitEvent(event));}}module[_0x1601('0x5')]=PluginEvents;
\ No newline at end of file
+var _0x565f=['Plugin','setMaxListeners','update','remove','hasOwnProperty','exports','../../mysqldb'];(function(_0x21e79a,_0x5a7990){var _0x506c02=function(_0x566c95){while(--_0x566c95){_0x21e79a['push'](_0x21e79a['shift']());}};_0x506c02(++_0x5a7990);}(_0x565f,0x68));var _0xf565=function(_0x52e74e,_0x50c3b3){_0x52e74e=_0x52e74e-0x0;var _0x55c576=_0x565f[_0x52e74e];return _0x55c576;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xf565('0x0'))['db'][_0xf565('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xf565('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf565('0x3'),'afterDestroy':_0xf565('0x4')};function emitEvent(_0x42d01c){return function(_0x44400f,_0x35e885,_0x5da33f){PluginEvents['emit'](_0x42d01c+':'+_0x44400f['id'],_0x44400f);PluginEvents['emit'](_0x42d01c,_0x44400f);_0x5da33f(null);};}for(var e in events){if(events[_0xf565('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xf565('0x6')]=PluginEvents;
\ No newline at end of file
index 38e8f2a..5ee757f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x494a=['path','../../config/environment','./plugin.attributes','define','Plugin','plugins','lodash','util','../../config/logger','api','moment'];(function(_0xe429f8,_0xb5ddb4){var _0x439723=function(_0x3e20ab){while(--_0x3e20ab){_0xe429f8['push'](_0xe429f8['shift']());}};_0x439723(++_0xb5ddb4);}(_0x494a,0x17c));var _0xa494=function(_0x387498,_0x322bb7){_0x387498=_0x387498-0x0;var _0x543b17=_0x494a[_0x387498];return _0x543b17;};'use strict';var _=require(_0xa494('0x0'));var util=require(_0xa494('0x1'));var logger=require(_0xa494('0x2'))(_0xa494('0x3'));var moment=require(_0xa494('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa494('0x5'));var rimraf=require('rimraf');var config=require(_0xa494('0x6'));var attributes=require(_0xa494('0x7'));module['exports']=function(_0x460a9c,_0x40b8c1){return _0x460a9c[_0xa494('0x8')](_0xa494('0x9'),attributes,{'tableName':_0xa494('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins','lodash'];(function(_0x5509f5,_0x4e6972){var _0xd9581c=function(_0x5cb864){while(--_0x5cb864){_0x5509f5['push'](_0x5509f5['shift']());}};_0xd9581c(++_0x4e6972);}(_0xb2f4,0x14f));var _0x4b2f=function(_0x1082ee,_0x18607a){_0x1082ee=_0x1082ee-0x0;var _0x88187e=_0xb2f4[_0x1082ee];return _0x88187e;};'use strict';var _=require(_0x4b2f('0x0'));var util=require(_0x4b2f('0x1'));var logger=require(_0x4b2f('0x2'))(_0x4b2f('0x3'));var moment=require(_0x4b2f('0x4'));var BPromise=require(_0x4b2f('0x5'));var rp=require(_0x4b2f('0x6'));var fs=require('fs');var path=require(_0x4b2f('0x7'));var rimraf=require(_0x4b2f('0x8'));var config=require(_0x4b2f('0x9'));var attributes=require(_0x4b2f('0xa'));module[_0x4b2f('0xb')]=function(_0x316ad4,_0x24ea9d){return _0x316ad4[_0x4b2f('0xc')]('Plugin',attributes,{'tableName':_0x4b2f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26732b0..c06fbfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d89=['Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin','options','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./plugin.socket','register','then','info','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2d8fdb,_0x30e70c){var _0x3bc1c2=function(_0x592716){while(--_0x592716){_0x2d8fdb['push'](_0x2d8fdb['shift']());}};_0x3bc1c2(++_0x30e70c);}(_0x1d89,0x156));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91d8('0x0'));var util=require(_0x91d8('0x1'));var moment=require('moment');var BPromise=require(_0x91d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91d8('0x3'))['db'];var utils=require(_0x91d8('0x4'));var logger=require(_0x91d8('0x5'))(_0x91d8('0x6'));var config=require(_0x91d8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x91d8('0x8')]['http']({'port':0x232a});config[_0x91d8('0x9')]=_['defaults'](config['redis'],{'host':_0x91d8('0xa'),'port':0x18eb});var socket=require(_0x91d8('0xb'))(new Redis(config[_0x91d8('0x9')]));require(_0x91d8('0xc'))[_0x91d8('0xd')](socket);function respondWithRpcPromise(_0x11f21c,_0x4de469,_0x35eb5e){return new BPromise(function(_0x4dbd68,_0x572c08){return client['request'](_0x11f21c,_0x35eb5e)[_0x91d8('0xe')](function(_0x22290a){logger[_0x91d8('0xf')]('Plugin,\x20%s,\x20%s',_0x4de469,'request\x20sent');logger[_0x91d8('0x10')](_0x91d8('0x11'),_0x4de469,_0x91d8('0x12'),JSON[_0x91d8('0x13')](_0x22290a));if(_0x22290a[_0x91d8('0x14')]){if(_0x22290a[_0x91d8('0x14')][_0x91d8('0x15')]===0x1f4){logger[_0x91d8('0x14')](_0x91d8('0x16'),_0x4de469,_0x22290a[_0x91d8('0x14')][_0x91d8('0x17')]);return _0x572c08(_0x22290a[_0x91d8('0x14')][_0x91d8('0x17')]);}logger['error'](_0x91d8('0x16'),_0x4de469,_0x22290a[_0x91d8('0x14')][_0x91d8('0x17')]);return _0x4dbd68(_0x22290a['error']['message']);}else{logger[_0x91d8('0xf')](_0x91d8('0x16'),_0x4de469,_0x91d8('0x12'));_0x4dbd68(_0x22290a['result']['message']);}})[_0x91d8('0x18')](function(_0x1e0ec7){logger['error']('Plugin,\x20%s,\x20%s',_0x4de469,_0x1e0ec7);_0x572c08(_0x1e0ec7);});});}exports[_0x91d8('0x19')]=function(_0x4ad1d8){var _0xa824a2=this;return new Promise(function(_0x553070,_0x40a5be){return db[_0x91d8('0x1a')]['create'](_0x4ad1d8['body'],{'raw':_0x4ad1d8[_0x91d8('0x1b')]?_0x4ad1d8[_0x91d8('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x91d8('0xe')](function(_0x2cd3ee){logger[_0x91d8('0xf')](_0x91d8('0x19'),_0x4ad1d8);logger[_0x91d8('0x10')]('CreatePlugin',_0x4ad1d8,JSON['stringify'](_0x2cd3ee));_0x553070(_0x2cd3ee);})[_0x91d8('0x18')](function(_0x1cdc73){logger[_0x91d8('0x14')](_0x91d8('0x19'),_0x1cdc73[_0x91d8('0x17')],_0x4ad1d8);_0x40a5be(_0xa824a2['error'](0x1f4,_0x1cdc73[_0x91d8('0x17')]));});});};
\ No newline at end of file
+var _0x6777=['Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Plugin,\x20%s,\x20%s','info','result','catch','Plugin','create','body','options','then','CreatePlugin','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','request\x20sent','debug'];(function(_0x5c99d9,_0x4b96b7){var _0x43d23a=function(_0xa9949a){while(--_0xa9949a){_0x5c99d9['push'](_0x5c99d9['shift']());}};_0x43d23a(++_0x4b96b7);}(_0x6777,0xb9));var _0x7677=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0x6777[_0x576d8a];return _0x3dc3ef;};'use strict';var _=require(_0x7677('0x0'));var util=require(_0x7677('0x1'));var moment=require(_0x7677('0x2'));var BPromise=require('bluebird');var rs=require(_0x7677('0x3'));var fs=require('fs');var Redis=require(_0x7677('0x4'));var db=require(_0x7677('0x5'))['db'];var utils=require(_0x7677('0x6'));var logger=require(_0x7677('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7677('0x8'));var client=jayson[_0x7677('0x9')][_0x7677('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7677('0xb')],{'host':_0x7677('0xc'),'port':0x18eb});var socket=require(_0x7677('0xd'))(new Redis(config['redis']));require(_0x7677('0xe'))[_0x7677('0xf')](socket);function respondWithRpcPromise(_0xe5e745,_0x22d440,_0x4e916d){return new BPromise(function(_0x66edf7,_0x2097a1){return client[_0x7677('0x10')](_0xe5e745,_0x4e916d)['then'](function(_0x56f016){logger['info']('Plugin,\x20%s,\x20%s',_0x22d440,_0x7677('0x11'));logger[_0x7677('0x12')](_0x7677('0x13'),_0x22d440,_0x7677('0x11'),JSON[_0x7677('0x14')](_0x56f016));if(_0x56f016['error']){if(_0x56f016[_0x7677('0x15')][_0x7677('0x16')]===0x1f4){logger[_0x7677('0x15')]('Plugin,\x20%s,\x20%s',_0x22d440,_0x56f016[_0x7677('0x15')]['message']);return _0x2097a1(_0x56f016[_0x7677('0x15')][_0x7677('0x17')]);}logger['error'](_0x7677('0x18'),_0x22d440,_0x56f016[_0x7677('0x15')][_0x7677('0x17')]);return _0x66edf7(_0x56f016['error'][_0x7677('0x17')]);}else{logger[_0x7677('0x19')](_0x7677('0x18'),_0x22d440,'request\x20sent');_0x66edf7(_0x56f016[_0x7677('0x1a')][_0x7677('0x17')]);}})[_0x7677('0x1b')](function(_0x325fe9){logger[_0x7677('0x15')]('Plugin,\x20%s,\x20%s',_0x22d440,_0x325fe9);_0x2097a1(_0x325fe9);});});}exports['CreatePlugin']=function(_0x4be51c){var _0x27fa56=this;return new Promise(function(_0x383404,_0x5dd74d){return db[_0x7677('0x1c')][_0x7677('0x1d')](_0x4be51c[_0x7677('0x1e')],{'raw':_0x4be51c[_0x7677('0x1f')]?_0x4be51c[_0x7677('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x7677('0x20')](function(_0x293d0f){logger['info']('CreatePlugin',_0x4be51c);logger[_0x7677('0x12')](_0x7677('0x21'),_0x4be51c,JSON[_0x7677('0x14')](_0x293d0f));_0x383404(_0x293d0f);})['catch'](function(_0x1ef4aa){logger['error'](_0x7677('0x21'),_0x1ef4aa['message'],_0x4be51c);_0x5dd74d(_0x27fa56[_0x7677('0x15')](0x1f4,_0x1ef4aa[_0x7677('0x17')]));});});};
\ No newline at end of file
index bac69fb..d2b5aad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd29=['update','register','length','plugin:','./plugin.events','save','remove'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xdd29,0x1af));var _0x9dd2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdd29[_0x14add3];return _0x4a174f;};'use strict';var PluginEvents=require(_0x9dd2('0x0'));var events=[_0x9dd2('0x1'),_0x9dd2('0x2'),_0x9dd2('0x3')];function createListener(_0x202a32,_0x1bb518){return function(_0x57ae29){_0x1bb518['emit'](_0x202a32,_0x57ae29);};}function removeListener(_0x4c809a,_0x1ccc24){return function(){PluginEvents['removeListener'](_0x4c809a,_0x1ccc24);};}exports[_0x9dd2('0x4')]=function(_0x18992e){for(var _0x1cc5e8=0x0,_0x967233=events[_0x9dd2('0x5')];_0x1cc5e8<_0x967233;_0x1cc5e8++){var _0x3cac0b=events[_0x1cc5e8];var _0x492e5e=createListener(_0x9dd2('0x6')+_0x3cac0b,_0x18992e);PluginEvents['on'](_0x3cac0b,_0x492e5e);}};
\ No newline at end of file
+var _0x4e61=['./plugin.events','save','remove','removeListener','plugin:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e61,0x186));var _0x14e6=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0x4e61[_0x448f8];return _0xa73126;};'use strict';var PluginEvents=require(_0x14e6('0x0'));var events=[_0x14e6('0x1'),_0x14e6('0x2'),'update'];function createListener(_0x46d7d4,_0x195894){return function(_0x5c7517){_0x195894['emit'](_0x46d7d4,_0x5c7517);};}function removeListener(_0x42fcd4,_0x11a895){return function(){PluginEvents[_0x14e6('0x3')](_0x42fcd4,_0x11a895);};}exports['register']=function(_0x4d2cc0){for(var _0x224145=0x0,_0x54f709=events['length'];_0x224145<_0x54f709;_0x224145++){var _0x7a44c9=events[_0x224145];var _0x1937f7=createListener(_0x14e6('0x4')+_0x7a44c9,_0x4d2cc0);PluginEvents['on'](_0x7a44c9,_0x1937f7);}};
\ No newline at end of file
index 9aac52b..9dd21e5 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(_0x4386d6,_0x5cdbac){var _0x22dea9=function(_0x3f664e){while(--_0x3f664e){_0x4386d6['push'](_0x4386d6['shift']());}};_0x22dea9(++_0x5cdbac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x558050,_0x174ec4){var _0x3ee149=function(_0x22be0f){while(--_0x22be0f){_0x558050['push'](_0x558050['shift']());}};_0x3ee149(++_0x174ec4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 4ad4d9f..47735b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d2=['cwd','chdir','start','dump','update','stop','send','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','list','express','motion2','length','then','catch','show','params','create','body','script','join'];(function(_0x599d6f,_0x45dbed){var _0x2b0c87=function(_0x4b14b0){while(--_0x4b14b0){_0x599d6f['push'](_0x599d6f['shift']());}};_0x2b0c87(++_0x45dbed);}(_0x16d2,0x123));var _0x216d=function(_0x1b6a20,_0x496b74){_0x1b6a20=_0x1b6a20-0x0;var _0x193f7c=_0x16d2[_0x1b6a20];return _0x193f7c;};'use strict';var _=require(_0x216d('0x0'));var pm2=require(_0x216d('0x1'));var logger=require(_0x216d('0x2'))(_0x216d('0x3'));var path=require(_0x216d('0x4'));var exec=require(_0x216d('0x5'))[_0x216d('0x6')];var BPromise=require(_0x216d('0x7'));function handleEntityNotFound(_0xfd7306,_0x593bb0){return function(_0x2c662d){if(!_0x2c662d){_0xfd7306[_0x216d('0x8')](0x194);;}return _0x2c662d;};}function respondWithResult(_0xef687c,_0x205101){_0x205101=_0x205101||0xc8;return function(_0x1dd8e2){if(_0x1dd8e2){return _0xef687c[_0x216d('0x9')](_0x205101)[_0x216d('0xa')](_0x1dd8e2);}return null;};}function handleError(_0x28da14,_0x57accc){_0x57accc=_0x57accc||0x1f4;return function(_0x22c7b3){logger[_0x216d('0xb')](_0x22c7b3[_0x216d('0xc')]);if(_0x22c7b3[_0x216d('0xd')]){delete _0x22c7b3[_0x216d('0xd')];}_0x28da14[_0x216d('0x9')](_0x57accc)['send'](_0x22c7b3);};}function execChildProcess(){return new BPromise(function(_0x7ca9c9,_0x50db30){exec(_0x216d('0xe'),function(_0x2e02ce,_0x332e30,_0x398970){logger[_0x216d('0xf')](_0x332e30);logger[_0x216d('0xf')](_0x398970);if(_0x2e02ce){logger['error'](_0x2e02ce);return _0x50db30(_0x2e02ce);}return _0x7ca9c9(_0x332e30);});});}exports[_0x216d('0x10')]=function(_0x4c07d0,_0x271bb1){return pm2[_0x216d('0x11')]()['then'](function(_0x165c19){if(_0x165c19){var _0x322e4b=_['reject'](_0x165c19,function(_0x1b3215){return _0x1b3215['name']===_0x216d('0x12')||_0x1b3215[_0x216d('0xd')]===_0x216d('0x13');});return{'rows':_0x322e4b,'count':_0x322e4b[_0x216d('0x14')]};}return null;})[_0x216d('0x15')](respondWithResult(_0x271bb1,null))[_0x216d('0x16')](handleError(_0x271bb1,null));};exports[_0x216d('0x17')]=function(_0x1496fe,_0x19fdac){return pm2['describe'](_0x1496fe[_0x216d('0x18')]['id'])['then'](respondWithResult(_0x19fdac,null))['then'](handleEntityNotFound(_0x19fdac,null))[_0x216d('0x16')](handleError(_0x19fdac,null));};exports[_0x216d('0x19')]=function(_0x574758,_0x3f32e0){if(_0x574758[_0x216d('0x1a')]['name']&&_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]){var _0x430e81=path[_0x216d('0x1c')](__dirname,'../../files/plugins',_0x574758[_0x216d('0x1a')][_0x216d('0x1b')]);var _0x10f299=process[_0x216d('0x1d')]();process[_0x216d('0x1e')](path['dirname'](_0x430e81));return execChildProcess()[_0x216d('0x15')](function(_0x1bd4db){process[_0x216d('0x1e')](_0x10f299);return pm2[_0x216d('0x1f')]({'name':_0x574758[_0x216d('0x1a')]['name'],'script':_0x430e81});})[_0x216d('0x15')](function(_0xab672){pm2[_0x216d('0x20')]();return _0xab672[0x0];})['then'](respondWithResult(_0x3f32e0,0xc9))['catch'](handleError(_0x3f32e0,null));}else{return _0x3f32e0['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x216d('0x21')]=function(_0x470d8a,_0x189413){if(_0x470d8a[_0x216d('0x1a')]['id']){delete _0x470d8a[_0x216d('0x1a')]['id'];}var _0x47fa6d={'online':'restart','stopped':_0x216d('0x22')};if(_0x47fa6d['hasOwnProperty'](_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')])){return pm2[_0x47fa6d[_0x470d8a[_0x216d('0x1a')][_0x216d('0x9')]]](_0x470d8a[_0x216d('0x18')]['id'])[_0x216d('0x15')](respondWithResult(_0x189413,0xc8))[_0x216d('0x16')](handleError(_0x189413,null));}else{return _0x189413[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x24')});}};exports[_0x216d('0x25')]=function(_0x260134,_0x4537fd){if(_0x260134['body']['id']){delete _0x260134[_0x216d('0x1a')]['id'];}if(_0x260134[_0x216d('0x18')]['id']){return pm2[_0x216d('0x26')](_0x260134['params']['id'])[_0x216d('0x15')](function(_0x1743ee){pm2[_0x216d('0x20')]();return _0x1743ee[0x0];})[_0x216d('0x15')](respondWithResult(_0x4537fd,null))['catch'](handleError(_0x4537fd,null));}else{return _0x4537fd[_0x216d('0x9')](0x1f4)[_0x216d('0x23')]({'message':_0x216d('0x27')});}};
\ No newline at end of file
+var _0xc788=['body','script','join','../../files/plugins','chdir','dirname','start','dump','send','update','stop','hasOwnProperty','Unknown\x20status','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','sendStatus','status','error','stack','name','info','index','list','then','reject','motion2','catch','show','describe'];(function(_0x2b4cd0,_0x457878){var _0x474616=function(_0x435315){while(--_0x435315){_0x2b4cd0['push'](_0x2b4cd0['shift']());}};_0x474616(++_0x457878);}(_0xc788,0xc4));var _0x8c78=function(_0x4de3ae,_0x4c2d83){_0x4de3ae=_0x4de3ae-0x0;var _0x264e7c=_0xc788[_0x4de3ae];return _0x264e7c;};'use strict';var _=require(_0x8c78('0x0'));var pm2=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var path=require('path');var exec=require(_0x8c78('0x3'))[_0x8c78('0x4')];var BPromise=require(_0x8c78('0x5'));function handleEntityNotFound(_0x1d0670,_0x386f0a){return function(_0x5498f9){if(!_0x5498f9){_0x1d0670[_0x8c78('0x6')](0x194);;}return _0x5498f9;};}function respondWithResult(_0x4555da,_0x329152){_0x329152=_0x329152||0xc8;return function(_0x1ac27f){if(_0x1ac27f){return _0x4555da[_0x8c78('0x7')](_0x329152)['json'](_0x1ac27f);}return null;};}function handleError(_0x247188,_0x299d9d){_0x299d9d=_0x299d9d||0x1f4;return function(_0x9bc075){logger[_0x8c78('0x8')](_0x9bc075[_0x8c78('0x9')]);if(_0x9bc075[_0x8c78('0xa')]){delete _0x9bc075['name'];}_0x247188[_0x8c78('0x7')](_0x299d9d)['send'](_0x9bc075);};}function execChildProcess(){return new BPromise(function(_0x3d55f0,_0x45935a){exec('npm\x20install',function(_0x1a05a7,_0x95e78e,_0x5ee642){logger[_0x8c78('0xb')](_0x95e78e);logger['info'](_0x5ee642);if(_0x1a05a7){logger['error'](_0x1a05a7);return _0x45935a(_0x1a05a7);}return _0x3d55f0(_0x95e78e);});});}exports[_0x8c78('0xc')]=function(_0x1b1d0e,_0x26178c){return pm2[_0x8c78('0xd')]()[_0x8c78('0xe')](function(_0x3d1306){if(_0x3d1306){var _0xe5f8ae=_[_0x8c78('0xf')](_0x3d1306,function(_0x2f44af){return _0x2f44af[_0x8c78('0xa')]==='express'||_0x2f44af[_0x8c78('0xa')]===_0x8c78('0x10');});return{'rows':_0xe5f8ae,'count':_0xe5f8ae['length']};}return null;})[_0x8c78('0xe')](respondWithResult(_0x26178c,null))[_0x8c78('0x11')](handleError(_0x26178c,null));};exports[_0x8c78('0x12')]=function(_0x23824e,_0x2a982c){return pm2[_0x8c78('0x13')](_0x23824e['params']['id'])['then'](respondWithResult(_0x2a982c,null))[_0x8c78('0xe')](handleEntityNotFound(_0x2a982c,null))['catch'](handleError(_0x2a982c,null));};exports['create']=function(_0xece4f0,_0x56c191){if(_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')]&&_0xece4f0['body'][_0x8c78('0x15')]){var _0x5b111b=path[_0x8c78('0x16')](__dirname,_0x8c78('0x17'),_0xece4f0['body'][_0x8c78('0x15')]);var _0x188cc3=process['cwd']();process[_0x8c78('0x18')](path[_0x8c78('0x19')](_0x5b111b));return execChildProcess()[_0x8c78('0xe')](function(_0x9581c6){process[_0x8c78('0x18')](_0x188cc3);return pm2[_0x8c78('0x1a')]({'name':_0xece4f0[_0x8c78('0x14')][_0x8c78('0xa')],'script':_0x5b111b});})[_0x8c78('0xe')](function(_0x4a7d20){pm2[_0x8c78('0x1b')]();return _0x4a7d20[0x0];})[_0x8c78('0xe')](respondWithResult(_0x56c191,0xc9))[_0x8c78('0x11')](handleError(_0x56c191,null));}else{return _0x56c191['status'](0x1f4)[_0x8c78('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8c78('0x1d')]=function(_0x24f9a7,_0x8d9ff9){if(_0x24f9a7['body']['id']){delete _0x24f9a7[_0x8c78('0x14')]['id'];}var _0x2568d5={'online':'restart','stopped':_0x8c78('0x1e')};if(_0x2568d5[_0x8c78('0x1f')](_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')])){return pm2[_0x2568d5[_0x24f9a7[_0x8c78('0x14')][_0x8c78('0x7')]]](_0x24f9a7['params']['id'])[_0x8c78('0xe')](respondWithResult(_0x8d9ff9,0xc8))['catch'](handleError(_0x8d9ff9,null));}else{return _0x8d9ff9[_0x8c78('0x7')](0x1f4)[_0x8c78('0x1c')]({'message':_0x8c78('0x20')});}};exports['destroy']=function(_0x1f1a0c,_0x3816d2){if(_0x1f1a0c['body']['id']){delete _0x1f1a0c[_0x8c78('0x14')]['id'];}if(_0x1f1a0c[_0x8c78('0x21')]['id']){return pm2[_0x8c78('0x22')](_0x1f1a0c['params']['id'])[_0x8c78('0xe')](function(_0x63307e){pm2[_0x8c78('0x1b')]();return _0x63307e[0x0];})['then'](respondWithResult(_0x3816d2,null))[_0x8c78('0x11')](handleError(_0x3816d2,null));}else{return _0x3816d2[_0x8c78('0x7')](0x1f4)['send']({'message':_0x8c78('0x23')});}};
\ No newline at end of file
index 07bc932..d471215 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfecd=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','./realtime.controller','get','/queues','getQueues','exports','multer'];(function(_0x3f9d57,_0x4c161a){var _0x21c906=function(_0x5bee1f){while(--_0x5bee1f){_0x3f9d57['push'](_0x3f9d57['shift']());}};_0x21c906(++_0x4c161a);}(_0xfecd,0x107));var _0xdfec=function(_0x33e45b,_0x52f494){_0x33e45b=_0x33e45b-0x0;var _0x4e7ff4=_0xfecd[_0x33e45b];return _0x4e7ff4;};'use strict';var multer=require(_0xdfec('0x0'));var util=require('util');var path=require(_0xdfec('0x1'));var timeout=require(_0xdfec('0x2'));var express=require('express');var router=express[_0xdfec('0x3')]();var fs_extra=require(_0xdfec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdfec('0x5'));var config=require('../../config/environment');var controller=require(_0xdfec('0x6'));router[_0xdfec('0x7')](_0xdfec('0x8'),auth['isAuthenticated'](),controller[_0xdfec('0x9')]);module[_0xdfec('0xa')]=router;
\ No newline at end of file
+var _0x6a18=['/queues','getQueues','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./realtime.controller','get'];(function(_0x50c447,_0xa1a0a5){var _0x191721=function(_0x52323e){while(--_0x52323e){_0x50c447['push'](_0x50c447['shift']());}};_0x191721(++_0xa1a0a5);}(_0x6a18,0x114));var _0x86a1=function(_0x421c22,_0x138abb){_0x421c22=_0x421c22-0x0;var _0x82b03b=_0x6a18[_0x421c22];return _0x82b03b;};'use strict';var multer=require(_0x86a1('0x0'));var util=require(_0x86a1('0x1'));var path=require(_0x86a1('0x2'));var timeout=require(_0x86a1('0x3'));var express=require(_0x86a1('0x4'));var router=express[_0x86a1('0x5')]();var fs_extra=require(_0x86a1('0x6'));var auth=require(_0x86a1('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x86a1('0x8'));router[_0x86a1('0x9')](_0x86a1('0xa'),auth['isAuthenticated'](),controller[_0x86a1('0xb')]);module[_0x86a1('0xc')]=router;
\ No newline at end of file
index 128261d..ebadbf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe93b=['Realtime,\x20%s,\x20%s','request\x20sent','debug','Realtime,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','undefined','limit','count','set','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','mail','sms','openchannel','fax','whatsapp','voice','resolve','channel','includes','query','toLowerCase','Invalid\x20channel','Queue','map','rawAttributes','fieldName','key','getOptions','role','user','userProfileId','type','outbound','QueueCampaigns','startCase','Queues','filter','getResources','findAndCountAll','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','waiting','talking','paused','push','pTalking','dialActive','dialMethod','startPredictive','erlangCalls','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','rows','get','loggedInDb','agents','find','merge','getAgents','online','getMembers','length','UserId','User','QueueId','Pause','agent','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','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','http','request'];(function(_0x34c8ff,_0x674110){var _0x42601c=function(_0x3e2ce5){while(--_0x3e2ce5){_0x34c8ff['push'](_0x34c8ff['shift']());}};_0x42601c(++_0x674110);}(_0xe93b,0x1da));var _0xbe93=function(_0x7fa764,_0x276eae){_0x7fa764=_0x7fa764-0x0;var _0x5c88ba=_0xe93b[_0x7fa764];return _0x5c88ba;};'use strict';var emlformat=require(_0xbe93('0x0'));var rimraf=require(_0xbe93('0x1'));var zipdir=require(_0xbe93('0x2'));var jsonpatch=require(_0xbe93('0x3'));var rp=require(_0xbe93('0x4'));var moment=require(_0xbe93('0x5'));var BPromise=require(_0xbe93('0x6'));var Mustache=require(_0xbe93('0x7'));var util=require('util');var path=require(_0xbe93('0x8'));var sox=require(_0xbe93('0x9'));var csv=require(_0xbe93('0xa'));var ejs=require(_0xbe93('0xb'));var fs=require('fs');var fs_extra=require(_0xbe93('0xc'));var _=require(_0xbe93('0xd'));var squel=require(_0xbe93('0xe'));var crypto=require(_0xbe93('0xf'));var jsforce=require(_0xbe93('0x10'));var deskjs=require(_0xbe93('0x11'));var toCsv=require('to-csv');var querystring=require(_0xbe93('0x12'));var Papa=require(_0xbe93('0x13'));var Redis=require(_0xbe93('0x14'));var authService=require(_0xbe93('0x15'));var qs=require(_0xbe93('0x16'));var as=require(_0xbe93('0x17'));var hardwareService=require(_0xbe93('0x18'));var logger=require(_0xbe93('0x19'))(_0xbe93('0x1a'));var utils=require(_0xbe93('0x1b'));var config=require(_0xbe93('0x1c'));var licenseUtil=require(_0xbe93('0x1d'));var db=require(_0xbe93('0x1e'))['db'];var jayson=require(_0xbe93('0x1f'));var client=jayson['client'][_0xbe93('0x20')]({'port':0x232a});var routingClient=jayson['client'][_0xbe93('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x15ed29,_0x1a0b84,_0x3a9d57,_0xee0a17){return new BPromise(function(_0x404e1d,_0x820157){var _0x53f863=_0xee0a17||client;return _0x53f863[_0xbe93('0x21')](_0x15ed29,_0x3a9d57)['then'](function(_0x25bd11){logger['info'](_0xbe93('0x22'),_0x1a0b84,_0xbe93('0x23'));logger[_0xbe93('0x24')](_0xbe93('0x25'),_0x1a0b84,_0xbe93('0x23'),JSON[_0xbe93('0x26')](_0x25bd11));if(_0x25bd11[_0xbe93('0x27')]){if(_0x25bd11[_0xbe93('0x27')][_0xbe93('0x28')]===0x1f4){logger[_0xbe93('0x27')](_0xbe93('0x22'),_0x1a0b84,_0x25bd11[_0xbe93('0x27')][_0xbe93('0x29')]);return _0x820157(_0x25bd11[_0xbe93('0x27')][_0xbe93('0x29')]);}logger[_0xbe93('0x27')](_0xbe93('0x22'),_0x1a0b84,_0x25bd11[_0xbe93('0x27')][_0xbe93('0x29')]);return _0x404e1d(_0x25bd11['error'][_0xbe93('0x29')]);}else{logger[_0xbe93('0x2a')](_0xbe93('0x22'),_0x1a0b84,_0xbe93('0x23'));_0x404e1d(_0x25bd11[_0xbe93('0x2b')][_0xbe93('0x29')]);}})[_0xbe93('0x2c')](function(_0x26e83c){logger[_0xbe93('0x27')](_0xbe93('0x22'),_0x1a0b84,_0x26e83c);_0x820157(_0x26e83c);});});}function respondWithStatusCode(_0x21d55e,_0x56cffd){_0x56cffd=_0x56cffd||0xcc;return function(_0xf7a13a){if(_0xf7a13a){return _0x21d55e['sendStatus'](_0x56cffd);}return _0x21d55e[_0xbe93('0x2d')](_0x56cffd)['end']();};}function respondWithResult(_0x614925,_0x4fd322){_0x4fd322=_0x4fd322||0xc8;return function(_0x2bad36){if(_0x2bad36){return _0x614925[_0xbe93('0x2d')](_0x4fd322)[_0xbe93('0x2e')](_0x2bad36);}};}function respondWithFilteredResult(_0x35a6c3,_0x141aa4){return function(_0x34f6ca){if(_0x34f6ca){var _0x10cea5=typeof _0x141aa4['offset']===_0xbe93('0x2f')&&typeof _0x141aa4[_0xbe93('0x30')]===_0xbe93('0x2f');var _0x484834=_0x34f6ca['count'];var _0x4e25eb=_0x10cea5?0x0:_0x141aa4['offset'];var _0x22c8a8=_0x10cea5?_0x34f6ca[_0xbe93('0x31')]:_0x141aa4['offset']+_0x141aa4['limit'];var _0xcdb532;if(_0x22c8a8>=_0x484834){_0x22c8a8=_0x484834;_0xcdb532=0xc8;}else{_0xcdb532=0xce;}_0x35a6c3[_0xbe93('0x2d')](_0xcdb532);return _0x35a6c3[_0xbe93('0x32')]('Content-Range',_0x4e25eb+'-'+_0x22c8a8+'/'+_0x484834)[_0xbe93('0x2e')](_0x34f6ca);}return null;};}function patchUpdates(_0x2c2198){return function(_0x57b743){try{jsonpatch[_0xbe93('0x33')](_0x57b743,_0x2c2198,!![]);}catch(_0x31c8f9){return BPromise[_0xbe93('0x34')](_0x31c8f9);}return _0x57b743[_0xbe93('0x35')]();};}function saveUpdates(_0x519174,_0x3ff9a4){return function(_0xc08503){if(_0xc08503){return _0xc08503['update'](_0x519174)[_0xbe93('0x36')](function(_0x8652d3){return _0x8652d3;});}return null;};}function removeEntity(_0x361c97,_0x1fedb0){return function(_0x1180e8){if(_0x1180e8){return _0x1180e8[_0xbe93('0x37')]()[_0xbe93('0x36')](function(){_0x361c97[_0xbe93('0x2d')](0xcc)[_0xbe93('0x38')]();});}};}function handleEntityNotFound(_0x86a442,_0x206fee){return function(_0x28cc17){if(!_0x28cc17){_0x86a442[_0xbe93('0x39')](0x194);}return _0x28cc17;};}function handleError(_0xd5886e,_0x2d4bad){_0x2d4bad=_0x2d4bad||0x1f4;return function(_0x836943){logger[_0xbe93('0x27')](_0x836943[_0xbe93('0x3a')]);if(_0x836943[_0xbe93('0x3b')]){delete _0x836943[_0xbe93('0x3b')];}_0xd5886e[_0xbe93('0x2d')](_0x2d4bad)[_0xbe93('0x3c')](_0x836943);};}exports['getQueues']=function(_0x11a628,_0x22039b){var _0x2f2a70=[_0xbe93('0x3d'),'chat',_0xbe93('0x3e'),_0xbe93('0x3f'),_0xbe93('0x40'),_0xbe93('0x41'),_0xbe93('0x42')];var _0x5bbb96={'count':0x0,'rows':[]},_0x594bdb={},_0x13660a;Promise[_0xbe93('0x43')]()[_0xbe93('0x36')](function(){if(_0x11a628['query'][_0xbe93('0x44')]){if(!_[_0xbe93('0x45')](_0x2f2a70,_0x11a628[_0xbe93('0x46')]['channel'][_0xbe93('0x47')]()))throw new Error(_0xbe93('0x48'));_0x13660a=_0x11a628[_0xbe93('0x46')][_0xbe93('0x44')][_0xbe93('0x47')]();}var _0x3be083=_['startCase'](_0x13660a)+_0xbe93('0x49');var _0x65769f=_[_0xbe93('0x4a')](db[_0x3be083][_0xbe93('0x4b')],function(_0x481901){return{'name':_0x481901[_0xbe93('0x4c')],'type':_0x481901['type'][_0xbe93('0x4d')]};});_0x594bdb=qs[_0xbe93('0x4e')](_0x65769f,_0x11a628);if(_0x11a628['user'][_0xbe93('0x4f')]===_0xbe93('0x50')){var _0x4ae135={'params':{'id':_0x11a628[_0xbe93('0x50')][_0xbe93('0x51')]},'query':{'section':_0x13660a===_0xbe93('0x42')&&_0x11a628[_0xbe93('0x46')][_0xbe93('0x52')]===_0xbe93('0x53')?_0xbe93('0x54'):_[_0xbe93('0x55')](_0x13660a)+_0xbe93('0x56'),'type':_0x11a628[_0xbe93('0x46')][_0xbe93('0x52')],'nolimit':!![],'sort':_0xbe93('0x3b'),'filter':_0x11a628['query'][_0xbe93('0x57')]}};return db['UserProfile'][_0xbe93('0x58')](_0x4ae135);}return db[_0x3be083][_0xbe93('0x59')](_0x594bdb);})['then'](function(_0x35315a){_0x5bbb96['count']=_0x35315a[_0xbe93('0x31')];var _0x50a94d=_0x13660a===_0xbe93('0x42')?client:routingClient;return _0x50a94d[_0xbe93('0x21')](_['startCase'](_0x13660a)+_0xbe93('0x56'),_0x11a628)[_0xbe93('0x36')](function(_0x46a9fb){if(_0x46a9fb[_0xbe93('0x27')])throw new Error(util[_0xbe93('0x5a')](_0xbe93('0x5b'),_0x13660a));var _0x3566d2=_0x46a9fb[_0xbe93('0x2b')];var _0x4dd6aa=[_0xbe93('0x5c'),'available',_0xbe93('0x5d'),_0xbe93('0x5e'),_0xbe93('0x5f')];if(_0x13660a===_0xbe93('0x42')&&_0x11a628[_0xbe93('0x46')][_0xbe93('0x52')]===_0xbe93('0x53')){_0x4dd6aa[_0xbe93('0x60')](_0xbe93('0x61'),'originated',_0xbe93('0x29'),_0xbe93('0x62'),_0xbe93('0x63'),'Trunk',_0xbe93('0x64'),'startProgressive',_0xbe93('0x65'),'erlangCallToSecond',_0xbe93('0x66'),'erlangBusyFactor',_0xbe93('0x67'),'dialPredictiveIntervalMaxThreshold',_0xbe93('0x68'),_0xbe93('0x69'),_0xbe93('0x6a'),_0xbe93('0x6b'),_0xbe93('0x6c'),_0xbe93('0x6d'),_0xbe93('0x6e'),'predictiveIntervalAvgTalktime');}var _0x1b488c=_0x35315a[_0xbe93('0x6f')]['map'](function(_0x367a68){var _0x2a8d71=_0x367a68[_0xbe93('0x70')]({'plain':!![]});_0x2a8d71[_0xbe93('0x5f')]=0x0;_0x2a8d71[_0xbe93('0x71')]=0x0;_0x2a8d71[_0xbe93('0x5c')]=0x0;_0x2a8d71['available']=0x0;_0x2a8d71[_0xbe93('0x5f')]=0x0;_0x2a8d71[_0xbe93('0x5d')]=0x0;if(_0x13660a===_0xbe93('0x42')){_0x2a8d71['talking']=0x0;if(_0x11a628['query'][_0xbe93('0x52')]===_0xbe93('0x53')){_0x2a8d71[_0xbe93('0x61')]=0x0;_0x2a8d71['originated']=0x0;}}_0x2a8d71[_0xbe93('0x72')]=[];var _0x2939fe=_[_0xbe93('0x73')](_0x3566d2[_0xbe93('0x6f')],['id',_0x2a8d71['id']]);if(_0x2939fe)_[_0xbe93('0x74')](_0x2a8d71,_['pick'](_0x2939fe,_0x4dd6aa));if(_0x13660a==='voice'){return _0x367a68[_0xbe93('0x75')]({'attributes':['id',_0xbe93('0x3b'),_0xbe93('0x76')],'joinTableAttributes':[],'raw':!![]})[_0xbe93('0x36')](function(_0x2e15d8){return _0x367a68[_0xbe93('0x77')]({'raw':!![]})[_0xbe93('0x36')](function(_0x391506){for(var _0x3628a8=0x0;_0x3628a8<_0x2e15d8[_0xbe93('0x78')];_0x3628a8++){var _0x435f5a=_['find'](_0x391506,[_0xbe93('0x79'),_0x2e15d8[_0x3628a8]['id']]);var _0xe95366={'id':_0x2e15d8[_0x3628a8]['id'],'name':_0x2e15d8[_0x3628a8][_0xbe93('0x3b')],'online':Boolean(_0x2e15d8[_0x3628a8][_0xbe93('0x76')]),'paused':_0x435f5a?Boolean(_0x435f5a['paused']):![]};if(_0xe95366[_0xbe93('0x76')])_0x2a8d71[_0xbe93('0x71')]++;if(_0xe95366[_0xbe93('0x5f')])_0x2a8d71['paused']++;_0x2a8d71[_0xbe93('0x72')]['push'](_0xe95366);}return _0x2a8d71;});});}else{var _0x567538=_0xbe93('0x7a')+_[_0xbe93('0x55')](_0x13660a)+_0xbe93('0x49');var _0x2f7196=_['startCase'](_0x13660a)+_0xbe93('0x7b');var _0x9f4521=_0x13660a+_0xbe93('0x7c');return db[_0x567538]['findAll']({'where':{['userQueueKey']:_0x367a68['id']},'raw':!![]})[_0xbe93('0x36')](function(_0x42962d){return db[_0xbe93('0x7a')]['findAll']({'attributes':['id','name',_0xbe93('0x76'),_0x9f4521],'where':{'id':_[_0xbe93('0x4a')](_0x42962d,_0xbe93('0x79')),'role':_0xbe93('0x7d')},'raw':!![]});})['then'](function(_0x141b10){for(var _0x17d4e9=0x0;_0x17d4e9<_0x141b10[_0xbe93('0x78')];_0x17d4e9++){var _0x859f50={'id':_0x141b10[_0x17d4e9]['id'],'name':_0x141b10[_0x17d4e9][_0xbe93('0x3b')],'online':Boolean(_0x141b10[_0x17d4e9][_0xbe93('0x76')]),'paused':Boolean(_0x141b10[_0x17d4e9][_0x9f4521])};if(_0x859f50[_0xbe93('0x76')])_0x2a8d71[_0xbe93('0x71')]++;if(_0x859f50[_0xbe93('0x5f')])_0x2a8d71['paused']++;_0x2a8d71[_0xbe93('0x72')][_0xbe93('0x60')](_0x859f50);}return _0x2a8d71;});}});return Promise[_0xbe93('0x7e')](_0x1b488c);});})[_0xbe93('0x36')](function(_0x3f1bc3){_0x5bbb96[_0xbe93('0x6f')]=_0x3f1bc3;return _0x5bbb96;})['then'](respondWithFilteredResult(_0x22039b,_0x594bdb))[_0xbe93('0x2c')](handleError(_0x22039b,null));};
\ No newline at end of file
+var _0xa1d1=['client','http','request','then','request\x20sent','debug','stringify','error','code','Realtime,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','getQueues','mail','chat','sms','openchannel','fax','whatsapp','voice','resolve','query','channel','includes','toLowerCase','startCase','Queue','map','rawAttributes','fieldName','key','user','type','outbound','QueueCampaigns','Queues','findAndCountAll','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','waiting','talking','paused','push','pTalking','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','loggedInDb','agents','find','merge','pick','getAgents','online','length','UserId','QueueId','Pause','findAll','agent','all','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','jayson/promise'];(function(_0x20d6f0,_0x33e54c){var _0x105ceb=function(_0x4927e9){while(--_0x4927e9){_0x20d6f0['push'](_0x20d6f0['shift']());}};_0x105ceb(++_0x33e54c);}(_0xa1d1,0x1aa));var _0x1a1d=function(_0x1e6a71,_0x37927c){_0x1e6a71=_0x1e6a71-0x0;var _0x144d85=_0xa1d1[_0x1e6a71];return _0x144d85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a1d('0x0'));var zipdir=require(_0x1a1d('0x1'));var jsonpatch=require(_0x1a1d('0x2'));var rp=require(_0x1a1d('0x3'));var moment=require(_0x1a1d('0x4'));var BPromise=require(_0x1a1d('0x5'));var Mustache=require(_0x1a1d('0x6'));var util=require(_0x1a1d('0x7'));var path=require('path');var sox=require(_0x1a1d('0x8'));var csv=require(_0x1a1d('0x9'));var ejs=require(_0x1a1d('0xa'));var fs=require('fs');var fs_extra=require(_0x1a1d('0xb'));var _=require(_0x1a1d('0xc'));var squel=require(_0x1a1d('0xd'));var crypto=require(_0x1a1d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1a1d('0x9'));var querystring=require('querystring');var Papa=require(_0x1a1d('0xf'));var Redis=require('ioredis');var authService=require(_0x1a1d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1a1d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1a1d('0x12'));var utils=require('../../config/utils');var config=require(_0x1a1d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a1d('0x14'))['db'];var jayson=require(_0x1a1d('0x15'));var client=jayson[_0x1a1d('0x16')]['http']({'port':0x232a});var routingClient=jayson[_0x1a1d('0x16')][_0x1a1d('0x17')]({'port':0x232c});function respondWithRpcPromise(_0xa7c36b,_0x1664be,_0xd8585f,_0x16e857){return new BPromise(function(_0x2897b7,_0x37b88d){var _0x49814e=_0x16e857||client;return _0x49814e[_0x1a1d('0x18')](_0xa7c36b,_0xd8585f)[_0x1a1d('0x19')](function(_0x18ae93){logger['info']('Realtime,\x20%s,\x20%s',_0x1664be,_0x1a1d('0x1a'));logger[_0x1a1d('0x1b')]('Realtime,\x20%s,\x20%s,\x20%s',_0x1664be,_0x1a1d('0x1a'),JSON[_0x1a1d('0x1c')](_0x18ae93));if(_0x18ae93[_0x1a1d('0x1d')]){if(_0x18ae93['error'][_0x1a1d('0x1e')]===0x1f4){logger['error'](_0x1a1d('0x1f'),_0x1664be,_0x18ae93[_0x1a1d('0x1d')]['message']);return _0x37b88d(_0x18ae93['error'][_0x1a1d('0x20')]);}logger['error'](_0x1a1d('0x1f'),_0x1664be,_0x18ae93['error']['message']);return _0x2897b7(_0x18ae93[_0x1a1d('0x1d')]['message']);}else{logger['info'](_0x1a1d('0x1f'),_0x1664be,_0x1a1d('0x1a'));_0x2897b7(_0x18ae93[_0x1a1d('0x21')][_0x1a1d('0x20')]);}})['catch'](function(_0x48d136){logger[_0x1a1d('0x1d')]('Realtime,\x20%s,\x20%s',_0x1664be,_0x48d136);_0x37b88d(_0x48d136);});});}function respondWithStatusCode(_0x2efedc,_0x28c041){_0x28c041=_0x28c041||0xcc;return function(_0x2dc18a){if(_0x2dc18a){return _0x2efedc[_0x1a1d('0x22')](_0x28c041);}return _0x2efedc['status'](_0x28c041)[_0x1a1d('0x23')]();};}function respondWithResult(_0x115a9c,_0x4f4d72){_0x4f4d72=_0x4f4d72||0xc8;return function(_0x3ad294){if(_0x3ad294){return _0x115a9c[_0x1a1d('0x24')](_0x4f4d72)[_0x1a1d('0x25')](_0x3ad294);}};}function respondWithFilteredResult(_0x1e791c,_0x114af6){return function(_0x45d083){if(_0x45d083){var _0x368afa=typeof _0x114af6[_0x1a1d('0x26')]===_0x1a1d('0x27')&&typeof _0x114af6[_0x1a1d('0x28')]==='undefined';var _0x20638c=_0x45d083[_0x1a1d('0x29')];var _0xdb68d8=_0x368afa?0x0:_0x114af6[_0x1a1d('0x26')];var _0x193924=_0x368afa?_0x45d083[_0x1a1d('0x29')]:_0x114af6['offset']+_0x114af6['limit'];var _0x2e00f4;if(_0x193924>=_0x20638c){_0x193924=_0x20638c;_0x2e00f4=0xc8;}else{_0x2e00f4=0xce;}_0x1e791c[_0x1a1d('0x24')](_0x2e00f4);return _0x1e791c[_0x1a1d('0x2a')](_0x1a1d('0x2b'),_0xdb68d8+'-'+_0x193924+'/'+_0x20638c)[_0x1a1d('0x25')](_0x45d083);}return null;};}function patchUpdates(_0x33db5e){return function(_0x4688d2){try{jsonpatch[_0x1a1d('0x2c')](_0x4688d2,_0x33db5e,!![]);}catch(_0x32540d){return BPromise[_0x1a1d('0x2d')](_0x32540d);}return _0x4688d2[_0x1a1d('0x2e')]();};}function saveUpdates(_0x7ec22d,_0x1ecb00){return function(_0x44bfdf){if(_0x44bfdf){return _0x44bfdf['update'](_0x7ec22d)[_0x1a1d('0x19')](function(_0x2f7473){return _0x2f7473;});}return null;};}function removeEntity(_0x3ca3f0,_0x505def){return function(_0x3534b3){if(_0x3534b3){return _0x3534b3[_0x1a1d('0x2f')]()[_0x1a1d('0x19')](function(){_0x3ca3f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ab8bf,_0x3b45b5){return function(_0x53640a){if(!_0x53640a){_0x1ab8bf[_0x1a1d('0x22')](0x194);}return _0x53640a;};}function handleError(_0x15b5aa,_0x4fcf3d){_0x4fcf3d=_0x4fcf3d||0x1f4;return function(_0x2c70b1){logger[_0x1a1d('0x1d')](_0x2c70b1[_0x1a1d('0x30')]);if(_0x2c70b1['name']){delete _0x2c70b1[_0x1a1d('0x31')];}_0x15b5aa[_0x1a1d('0x24')](_0x4fcf3d)['send'](_0x2c70b1);};}exports[_0x1a1d('0x32')]=function(_0x46a8f5,_0x3c1b60){var _0x5c7e61=[_0x1a1d('0x33'),_0x1a1d('0x34'),_0x1a1d('0x35'),_0x1a1d('0x36'),_0x1a1d('0x37'),_0x1a1d('0x38'),_0x1a1d('0x39')];var _0x5a50bc={'count':0x0,'rows':[]},_0x2483ff={},_0x2f297b;Promise[_0x1a1d('0x3a')]()[_0x1a1d('0x19')](function(){if(_0x46a8f5[_0x1a1d('0x3b')][_0x1a1d('0x3c')]){if(!_[_0x1a1d('0x3d')](_0x5c7e61,_0x46a8f5[_0x1a1d('0x3b')][_0x1a1d('0x3c')][_0x1a1d('0x3e')]()))throw new Error('Invalid\x20channel');_0x2f297b=_0x46a8f5[_0x1a1d('0x3b')][_0x1a1d('0x3c')][_0x1a1d('0x3e')]();}var _0x4ce89a=_[_0x1a1d('0x3f')](_0x2f297b)+_0x1a1d('0x40');var _0xd7a2fb=_[_0x1a1d('0x41')](db[_0x4ce89a][_0x1a1d('0x42')],function(_0x57d17f){return{'name':_0x57d17f[_0x1a1d('0x43')],'type':_0x57d17f['type'][_0x1a1d('0x44')]};});_0x2483ff=qs['getOptions'](_0xd7a2fb,_0x46a8f5);if(_0x46a8f5['user']['role']==='user'){var _0xe7d244={'params':{'id':_0x46a8f5[_0x1a1d('0x45')]['userProfileId']},'query':{'section':_0x2f297b===_0x1a1d('0x39')&&_0x46a8f5['query'][_0x1a1d('0x46')]===_0x1a1d('0x47')?_0x1a1d('0x48'):_[_0x1a1d('0x3f')](_0x2f297b)+_0x1a1d('0x49'),'type':_0x46a8f5['query']['type'],'nolimit':!![],'sort':'name','filter':_0x46a8f5['query']['filter']}};return db['UserProfile']['getResources'](_0xe7d244);}return db[_0x4ce89a][_0x1a1d('0x4a')](_0x2483ff);})[_0x1a1d('0x19')](function(_0x48fc2c){_0x5a50bc[_0x1a1d('0x29')]=_0x48fc2c[_0x1a1d('0x29')];var _0x2d03b4=_0x2f297b===_0x1a1d('0x39')?client:routingClient;return _0x2d03b4[_0x1a1d('0x18')](_[_0x1a1d('0x3f')](_0x2f297b)+_0x1a1d('0x49'),_0x46a8f5)['then'](function(_0x5bdd55){if(_0x5bdd55[_0x1a1d('0x1d')])throw new Error(util[_0x1a1d('0x4b')](_0x1a1d('0x4c'),_0x2f297b));var _0x13f914=_0x5bdd55[_0x1a1d('0x21')];var _0x52a92c=[_0x1a1d('0x4d'),_0x1a1d('0x4e'),_0x1a1d('0x4f'),_0x1a1d('0x50'),_0x1a1d('0x51')];if(_0x2f297b===_0x1a1d('0x39')&&_0x46a8f5[_0x1a1d('0x3b')]['type']===_0x1a1d('0x47')){_0x52a92c[_0x1a1d('0x52')](_0x1a1d('0x53'),'originated',_0x1a1d('0x20'),'dialActive',_0x1a1d('0x54'),_0x1a1d('0x55'),_0x1a1d('0x56'),_0x1a1d('0x57'),_0x1a1d('0x58'),_0x1a1d('0x59'),'erlangAbandonmentRate','erlangBusyFactor',_0x1a1d('0x5a'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x1a1d('0x5b'),'predictiveIntervalTotalCalls',_0x1a1d('0x5c'),'predictiveIntervalDroppedCallsTimeout',_0x1a1d('0x5d'),_0x1a1d('0x5e'),_0x1a1d('0x5f'));}var _0x5ba94f=_0x48fc2c[_0x1a1d('0x60')][_0x1a1d('0x41')](function(_0x5d47e2){var _0x58a11f=_0x5d47e2['get']({'plain':!![]});_0x58a11f['paused']=0x0;_0x58a11f[_0x1a1d('0x61')]=0x0;_0x58a11f['loggedIn']=0x0;_0x58a11f['available']=0x0;_0x58a11f['paused']=0x0;_0x58a11f['waiting']=0x0;if(_0x2f297b===_0x1a1d('0x39')){_0x58a11f[_0x1a1d('0x50')]=0x0;if(_0x46a8f5[_0x1a1d('0x3b')]['type']===_0x1a1d('0x47')){_0x58a11f[_0x1a1d('0x53')]=0x0;_0x58a11f['originated']=0x0;}}_0x58a11f[_0x1a1d('0x62')]=[];var _0x14dfbb=_[_0x1a1d('0x63')](_0x13f914[_0x1a1d('0x60')],['id',_0x58a11f['id']]);if(_0x14dfbb)_[_0x1a1d('0x64')](_0x58a11f,_[_0x1a1d('0x65')](_0x14dfbb,_0x52a92c));if(_0x2f297b==='voice'){return _0x5d47e2[_0x1a1d('0x66')]({'attributes':['id',_0x1a1d('0x31'),_0x1a1d('0x67')],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x3746f8){return _0x5d47e2['getMembers']({'raw':!![]})[_0x1a1d('0x19')](function(_0xc672b){for(var _0x2a19ae=0x0;_0x2a19ae<_0x3746f8[_0x1a1d('0x68')];_0x2a19ae++){var _0x28bb3e=_['find'](_0xc672b,[_0x1a1d('0x69'),_0x3746f8[_0x2a19ae]['id']]);var _0x20d8da={'id':_0x3746f8[_0x2a19ae]['id'],'name':_0x3746f8[_0x2a19ae]['name'],'online':Boolean(_0x3746f8[_0x2a19ae][_0x1a1d('0x67')]),'paused':_0x28bb3e?Boolean(_0x28bb3e[_0x1a1d('0x51')]):![]};if(_0x20d8da[_0x1a1d('0x67')])_0x58a11f[_0x1a1d('0x61')]++;if(_0x20d8da[_0x1a1d('0x51')])_0x58a11f[_0x1a1d('0x51')]++;_0x58a11f['agents']['push'](_0x20d8da);}return _0x58a11f;});});}else{var _0x224126='User'+_[_0x1a1d('0x3f')](_0x2f297b)+_0x1a1d('0x40');var _0x498c39=_[_0x1a1d('0x3f')](_0x2f297b)+_0x1a1d('0x6a');var _0x53375f=_0x2f297b+_0x1a1d('0x6b');return db[_0x224126]['findAll']({'where':{['userQueueKey']:_0x5d47e2['id']},'raw':!![]})[_0x1a1d('0x19')](function(_0x7cc89){return db['User'][_0x1a1d('0x6c')]({'attributes':['id',_0x1a1d('0x31'),'online',_0x53375f],'where':{'id':_['map'](_0x7cc89,'UserId'),'role':_0x1a1d('0x6d')},'raw':!![]});})['then'](function(_0x2f89fb){for(var _0x171ee2=0x0;_0x171ee2<_0x2f89fb[_0x1a1d('0x68')];_0x171ee2++){var _0x475cdd={'id':_0x2f89fb[_0x171ee2]['id'],'name':_0x2f89fb[_0x171ee2][_0x1a1d('0x31')],'online':Boolean(_0x2f89fb[_0x171ee2]['online']),'paused':Boolean(_0x2f89fb[_0x171ee2][_0x53375f])};if(_0x475cdd[_0x1a1d('0x67')])_0x58a11f[_0x1a1d('0x61')]++;if(_0x475cdd[_0x1a1d('0x51')])_0x58a11f[_0x1a1d('0x51')]++;_0x58a11f['agents'][_0x1a1d('0x52')](_0x475cdd);}return _0x58a11f;});}});return Promise[_0x1a1d('0x6e')](_0x5ba94f);});})[_0x1a1d('0x19')](function(_0x5661c0){_0x5a50bc[_0x1a1d('0x60')]=_0x5661c0;return _0x5a50bc;})[_0x1a1d('0x19')](respondWithFilteredResult(_0x3c1b60,_0x2483ff))[_0x1a1d('0x6f')](handleError(_0x3c1b60,null));};
\ No newline at end of file
index 05d7d69..71a99cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x270b=['rimraf','exports','define','Realtime','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x44b8db,_0x1eaa76){var _0x187dad=function(_0x290925){while(--_0x290925){_0x44b8db['push'](_0x44b8db['shift']());}};_0x187dad(++_0x1eaa76);}(_0x270b,0x185));var _0xb270=function(_0x2a2477,_0x30c80b){_0x2a2477=_0x2a2477-0x0;var _0x114c9f=_0x270b[_0x2a2477];return _0x114c9f;};'use strict';var _=require(_0xb270('0x0'));var util=require(_0xb270('0x1'));var logger=require(_0xb270('0x2'))('api');var moment=require(_0xb270('0x3'));var BPromise=require(_0xb270('0x4'));var rp=require(_0xb270('0x5'));var fs=require('fs');var path=require(_0xb270('0x6'));var rimraf=require(_0xb270('0x7'));var config=require('../../config/environment');;module[_0xb270('0x8')]=function(_0x4992f8,_0x8b6ea4){return _0x4992f8[_0xb270('0x9')](_0xb270('0xa'),[],{});};
\ No newline at end of file
+var _0x7e06=['exports','define','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7e06,0xec));var _0x67e0=function(_0x15022c,_0x44daae){_0x15022c=_0x15022c-0x0;var _0x81623a=_0x7e06[_0x15022c];return _0x81623a;};'use strict';var _=require(_0x67e0('0x0'));var util=require(_0x67e0('0x1'));var logger=require('../../config/logger')(_0x67e0('0x2'));var moment=require(_0x67e0('0x3'));var BPromise=require(_0x67e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67e0('0x5'));var rimraf=require(_0x67e0('0x6'));var config=require('../../config/environment');;module[_0x67e0('0x7')]=function(_0xdd536d,_0x2b5370){return _0xdd536d[_0x67e0('0x8')]('Realtime',[],{});};
\ No newline at end of file
index 7ba4ce8..485e5b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x20966e,_0xba47eb){var _0x54d4de=function(_0x179593){while(--_0x179593){_0x20966e['push'](_0x20966e['shift']());}};_0x54d4de(++_0xba47eb);}(_0xedd9,0xfc));var _0x9edd=function(_0xd506b6,_0x2617ad){_0xd506b6=_0xd506b6-0x0;var _0x4a89db=_0xedd9[_0xd506b6];return _0x4a89db;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xf598c3,_0x4a943f){var _0x265335=function(_0x303c11){while(--_0x303c11){_0xf598c3['push'](_0xf598c3['shift']());}};_0x265335(++_0x4a943f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 10c3cfe..3cbc020 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b94=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x176eea,_0x471a7e){var _0x160b59=function(_0x3d6bb7){while(--_0x3d6bb7){_0x176eea['push'](_0x176eea['shift']());}};_0x160b59(++_0x471a7e);}(_0x1b94,0x1f2));var _0x41b9=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x1b94[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require(_0x41b9('0x0'));module[_0x41b9('0x1')]={'state':{'type':Sequelize[_0x41b9('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x41b9('0x3')]},'scheduledat':{'type':Sequelize[_0x41b9('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x41b9('0x4')]},'responsetime':{'type':Sequelize[_0x41b9('0x4')]},'ringtime':{'type':Sequelize[_0x41b9('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x41b9('0x3')]},'membername':{'type':Sequelize[_0x41b9('0x3')]}};
\ No newline at end of file
+var _0x304b=['INTEGER','STRING','DATE','exports'];(function(_0x3a90c5,_0xb5d6e6){var _0x64feba=function(_0x383109){while(--_0x383109){_0x3a90c5['push'](_0x3a90c5['shift']());}};_0x64feba(++_0xb5d6e6);}(_0x304b,0xfb));var _0xb304=function(_0x4aa18f,_0xbdb520){_0x4aa18f=_0x4aa18f-0x0;var _0x593b49=_0x304b[_0x4aa18f];return _0x593b49;};'use strict';var Sequelize=require('sequelize');module[_0xb304('0x0')]={'state':{'type':Sequelize[_0xb304('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb304('0x2')]},'scheduledat':{'type':Sequelize[_0xb304('0x3')]},'uniqueid':{'type':Sequelize[_0xb304('0x2')]},'starttime':{'type':Sequelize[_0xb304('0x3')]},'responsetime':{'type':Sequelize[_0xb304('0x3')]},'ringtime':{'type':Sequelize[_0xb304('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb304('0x2')]}};
\ No newline at end of file
index c062696..7fbe5c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07d2=['exports','define','ReportAgentPreview','report_agent_preview','lodash','util','api','bluebird','path','rimraf','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x07d2,0x10c));var _0x207d=function(_0x25de0f,_0x3d8462){_0x25de0f=_0x25de0f-0x0;var _0x2eb041=_0x07d2[_0x25de0f];return _0x2eb041;};'use strict';var _=require(_0x207d('0x0'));var util=require(_0x207d('0x1'));var logger=require('../../config/logger')(_0x207d('0x2'));var moment=require('moment');var BPromise=require(_0x207d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x207d('0x4'));var rimraf=require(_0x207d('0x5'));var config=require(_0x207d('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0x207d('0x7')]=function(_0x4ac2af,_0x4dd80e){return _0x4ac2af[_0x207d('0x8')](_0x207d('0x9'),attributes,{'tableName':_0x207d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x913a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','ReportAgentPreview','report_agent_preview','util'];(function(_0x446a9b,_0x48468a){var _0x371972=function(_0x473733){while(--_0x473733){_0x446a9b['push'](_0x446a9b['shift']());}};_0x371972(++_0x48468a);}(_0x913a,0x175));var _0xa913=function(_0x232b3e,_0x5f368d){_0x232b3e=_0x232b3e-0x0;var _0x3dc3cf=_0x913a[_0x232b3e];return _0x3dc3cf;};'use strict';var _=require('lodash');var util=require(_0xa913('0x0'));var logger=require(_0xa913('0x1'))(_0xa913('0x2'));var moment=require(_0xa913('0x3'));var BPromise=require(_0xa913('0x4'));var rp=require(_0xa913('0x5'));var fs=require('fs');var path=require(_0xa913('0x6'));var rimraf=require(_0xa913('0x7'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x3a6742,_0x5362e3){return _0x3a6742[_0xa913('0x8')](_0xa913('0x9'),attributes,{'tableName':_0xa913('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fb839d3..996694d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x428b=['ReportAgentPreview','create','options','raw','debug','CreateReportAgentPreview','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x5339f7,_0x10fe11){var _0x10fd9d=function(_0x1d043f){while(--_0x1d043f){_0x5339f7['push'](_0x5339f7['shift']());}};_0x10fd9d(++_0x10fe11);}(_0x428b,0x180));var _0xb428=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x428b[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require(_0xb428('0x0'));var moment=require(_0xb428('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb428('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb428('0x3'));var logger=require(_0xb428('0x4'))(_0xb428('0x5'));var config=require(_0xb428('0x6'));var jayson=require(_0xb428('0x7'));var client=jayson[_0xb428('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27bfe6,_0x358233,_0x2ad2da){return new BPromise(function(_0x1c4138,_0x1f4a4e){return client[_0xb428('0x9')](_0x27bfe6,_0x2ad2da)[_0xb428('0xa')](function(_0x5b1194){logger['info'](_0xb428('0xb'),_0x358233,_0xb428('0xc'));logger['debug'](_0xb428('0xd'),_0x358233,'request\x20sent',JSON[_0xb428('0xe')](_0x5b1194));if(_0x5b1194[_0xb428('0xf')]){if(_0x5b1194['error'][_0xb428('0x10')]===0x1f4){logger[_0xb428('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x358233,_0x5b1194['error'][_0xb428('0x11')]);return _0x1f4a4e(_0x5b1194[_0xb428('0xf')]['message']);}logger[_0xb428('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x358233,_0x5b1194['error']['message']);return _0x1c4138(_0x5b1194[_0xb428('0xf')][_0xb428('0x11')]);}else{logger[_0xb428('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x358233,_0xb428('0xc'));_0x1c4138(_0x5b1194[_0xb428('0x13')][_0xb428('0x11')]);}})[_0xb428('0x14')](function(_0x1c263b){logger[_0xb428('0xf')](_0xb428('0xb'),_0x358233,_0x1c263b);_0x1f4a4e(_0x1c263b);});});}exports['CreateReportAgentPreview']=function(_0x2989da){var _0x25a9a0=this;return new Promise(function(_0x2f2d64,_0x41e2a6){return db[_0xb428('0x15')][_0xb428('0x16')](_0x2989da['body'],{'raw':_0x2989da[_0xb428('0x17')]?_0x2989da['options'][_0xb428('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x33cf9d){logger['info']('CreateReportAgentPreview',_0x2989da);logger[_0xb428('0x19')](_0xb428('0x1a'),_0x2989da,JSON[_0xb428('0xe')](_0x33cf9d));_0x2f2d64(_0x33cf9d);})['catch'](function(_0x2bc21e){logger[_0xb428('0xf')](_0xb428('0x1a'),_0x2bc21e[_0xb428('0x11')],_0x2989da);_0x41e2a6(_0x25a9a0[_0xb428('0xf')](0x1f4,_0x2bc21e['message']));});});};
\ No newline at end of file
+var _0xb4ea=['error','code','message','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s'];(function(_0xa87486,_0x5ff890){var _0x4fc6d5=function(_0x1c85c8){while(--_0x1c85c8){_0xa87486['push'](_0xa87486['shift']());}};_0x4fc6d5(++_0x5ff890);}(_0xb4ea,0x14f));var _0xab4e=function(_0x379a9c,_0xaf3980){_0x379a9c=_0x379a9c-0x0;var _0x286e88=_0xb4ea[_0x379a9c];return _0x286e88;};'use strict';var _=require('lodash');var util=require(_0xab4e('0x0'));var moment=require(_0xab4e('0x1'));var BPromise=require(_0xab4e('0x2'));var rs=require(_0xab4e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab4e('0x4'))['db'];var utils=require(_0xab4e('0x5'));var logger=require(_0xab4e('0x6'))('rpc');var config=require(_0xab4e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xab4e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4de392,_0x34ad06,_0x3eb643){return new BPromise(function(_0x540a60,_0x3e5cae){return client[_0xab4e('0x9')](_0x4de392,_0x3eb643)[_0xab4e('0xa')](function(_0x4156d0){logger[_0xab4e('0xb')](_0xab4e('0xc'),_0x34ad06,_0xab4e('0xd'));logger[_0xab4e('0xe')](_0xab4e('0xf'),_0x34ad06,_0xab4e('0xd'),JSON['stringify'](_0x4156d0));if(_0x4156d0[_0xab4e('0x10')]){if(_0x4156d0[_0xab4e('0x10')][_0xab4e('0x11')]===0x1f4){logger['error'](_0xab4e('0xc'),_0x34ad06,_0x4156d0[_0xab4e('0x10')][_0xab4e('0x12')]);return _0x3e5cae(_0x4156d0[_0xab4e('0x10')][_0xab4e('0x12')]);}logger[_0xab4e('0x10')](_0xab4e('0xc'),_0x34ad06,_0x4156d0['error']['message']);return _0x540a60(_0x4156d0['error']['message']);}else{logger['info'](_0xab4e('0xc'),_0x34ad06,_0xab4e('0xd'));_0x540a60(_0x4156d0['result'][_0xab4e('0x12')]);}})[_0xab4e('0x13')](function(_0x36c887){logger[_0xab4e('0x10')](_0xab4e('0xc'),_0x34ad06,_0x36c887);_0x3e5cae(_0x36c887);});});}exports['CreateReportAgentPreview']=function(_0x1b226e){var _0x38fe9e=this;return new Promise(function(_0x7cd664,_0x1cbd6c){return db[_0xab4e('0x14')][_0xab4e('0x15')](_0x1b226e[_0xab4e('0x16')],{'raw':_0x1b226e[_0xab4e('0x17')]?_0x1b226e[_0xab4e('0x17')][_0xab4e('0x18')]===undefined?!![]:![]:!![]})[_0xab4e('0xa')](function(_0x4a7f32){logger[_0xab4e('0xb')](_0xab4e('0x19'),_0x1b226e);logger[_0xab4e('0xe')](_0xab4e('0x19'),_0x1b226e,JSON[_0xab4e('0x1a')](_0x4a7f32));_0x7cd664(_0x4a7f32);})['catch'](function(_0x515767){logger[_0xab4e('0x10')](_0xab4e('0x19'),_0x515767[_0xab4e('0x12')],_0x1b226e);_0x1cbd6c(_0x38fe9e[_0xab4e('0x10')](0x1f4,_0x515767[_0xab4e('0x12')]));});});};
\ No newline at end of file
index 65b3935..1dd2950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c01=['/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','put','agentCapacity','/telephones','telephones','campaigns','/fax/accounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues'];(function(_0x1be07e,_0x8e9930){var _0x52b7e5=function(_0x48289d){while(--_0x48289d){_0x1be07e['push'](_0x1be07e['shift']());}};_0x52b7e5(++_0x8e9930);}(_0x5c01,0x83));var _0x15c0=function(_0x41c877,_0x1c5299){_0x41c877=_0x41c877-0x0;var _0x254e1a=_0x5c01[_0x41c877];return _0x254e1a;};'use strict';var multer=require(_0x15c0('0x0'));var util=require(_0x15c0('0x1'));var path=require(_0x15c0('0x2'));var express=require(_0x15c0('0x3'));var router=express[_0x15c0('0x4')]();var auth=require(_0x15c0('0x5'));var controller=require('./rpc.controller');router['get'](_0x15c0('0x6'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x8')]);router[_0x15c0('0x9')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x15c0('0x7')](),controller['voiceChannelMixMonitor']);router['get'](_0x15c0('0xa'),auth[_0x15c0('0x7')](),controller[_0x15c0('0xb')]);router[_0x15c0('0x9')]('/voice/queues',auth[_0x15c0('0x7')](),controller[_0x15c0('0xc')]);router['get'](_0x15c0('0xd'),auth[_0x15c0('0x7')](),controller[_0x15c0('0xe')]);router[_0x15c0('0x9')](_0x15c0('0xf'),auth['isAuthenticated'](),controller['mailQueues']);router[_0x15c0('0x9')](_0x15c0('0x10'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x11')]);router[_0x15c0('0x9')](_0x15c0('0x12'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x13')]);router[_0x15c0('0x9')]('/sms/queues',auth[_0x15c0('0x7')](),controller[_0x15c0('0x14')]);router[_0x15c0('0x9')](_0x15c0('0x15'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x16')]);router[_0x15c0('0x9')](_0x15c0('0x17'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x18')]);router[_0x15c0('0x9')]('/voice/queues/preview/:id',auth[_0x15c0('0x7')](),controller[_0x15c0('0x19')]);router[_0x15c0('0x9')](_0x15c0('0x1a'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x1b')]);router['get'](_0x15c0('0x1c'),auth['isAuthenticated'](),controller[_0x15c0('0x1d')]);router[_0x15c0('0x9')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x15c0('0x9')](_0x15c0('0x1e'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x1f')]);router['get'](_0x15c0('0x20'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x21')]);router['put'](_0x15c0('0x20'),auth['isAuthenticated'](),controller[_0x15c0('0x22')]);router[_0x15c0('0x9')](_0x15c0('0x23'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x24')]);router[_0x15c0('0x9')](_0x15c0('0x25'),auth['isAuthenticated'](),controller['outboundChannels']);router['get'](_0x15c0('0x26'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x27')]);router[_0x15c0('0x28')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x15c0('0x29')]);router[_0x15c0('0x9')](_0x15c0('0x2a'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x2b')]);router['get']('/trunks',auth[_0x15c0('0x7')](),controller['trunks']);router[_0x15c0('0x9')]('/campaigns',auth[_0x15c0('0x7')](),controller[_0x15c0('0x2c')]);router[_0x15c0('0x9')](_0x15c0('0x2d'),auth[_0x15c0('0x7')](),controller['faxAccounts']);router[_0x15c0('0x9')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x15c0('0x2e')]);router[_0x15c0('0x9')](_0x15c0('0x2f'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x30')]);router[_0x15c0('0x9')](_0x15c0('0x31'),auth[_0x15c0('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0x15c0('0x9')](_0x15c0('0x32'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x33')]);router[_0x15c0('0x9')]('/sms/queues/waitinginteractions',auth[_0x15c0('0x7')](),controller[_0x15c0('0x34')]);router[_0x15c0('0x9')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x15c0('0x9')](_0x15c0('0x35'),auth[_0x15c0('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0x15c0('0x36')]('/mail/queues/:id/notify',auth[_0x15c0('0x7')](),controller[_0x15c0('0x37')](_0x15c0('0x38')));router['get'](_0x15c0('0x39'),auth['isAuthenticated'](),controller[_0x15c0('0x3a')]);router[_0x15c0('0x36')](_0x15c0('0x3b'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x37')](_0x15c0('0x3c')));router[_0x15c0('0x9')](_0x15c0('0x3d'),auth['isAuthenticated'](),controller[_0x15c0('0x3e')]);router[_0x15c0('0x36')]('/fax/queues/:id/notify',auth[_0x15c0('0x7')](),controller['queueNotify']('fax'));router[_0x15c0('0x9')](_0x15c0('0x3f'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x40')]);router[_0x15c0('0x36')](_0x15c0('0x41'),auth[_0x15c0('0x7')](),controller['queueNotify'](_0x15c0('0x42')));router[_0x15c0('0x9')]('/openchannel/queues/:id',auth[_0x15c0('0x7')](),controller[_0x15c0('0x43')]);router[_0x15c0('0x36')](_0x15c0('0x44'),auth['isAuthenticated'](),controller[_0x15c0('0x37')](_0x15c0('0x45')));router[_0x15c0('0x36')](_0x15c0('0x46'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x37')](_0x15c0('0x47')));router[_0x15c0('0x9')]('/sms/queues/:id',auth[_0x15c0('0x7')](),controller[_0x15c0('0x48')]);router['get'](_0x15c0('0x49'),auth[_0x15c0('0x7')](),controller['showWhatsappQueues']);router['post']('/agents/:id/notify',auth[_0x15c0('0x7')](),controller[_0x15c0('0x4a')]);module[_0x15c0('0x4b')]=router;
\ No newline at end of file
+var _0x3c6e=['showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','whatsappQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3c6e,0x194));var _0xe3c6=function(_0xea74ea,_0x49c7d2){_0xea74ea=_0xea74ea-0x0;var _0x3dddc5=_0x3c6e[_0xea74ea];return _0x3dddc5;};'use strict';var multer=require(_0xe3c6('0x0'));var util=require(_0xe3c6('0x1'));var path=require(_0xe3c6('0x2'));var express=require('express');var router=express[_0xe3c6('0x3')]();var auth=require(_0xe3c6('0x4'));var controller=require(_0xe3c6('0x5'));router[_0xe3c6('0x6')]('/voice/channels',auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x8')]);router[_0xe3c6('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0xe3c6('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xe3c6('0x7')](),controller['voiceChannelStopMixMonitor']);router['get'](_0xe3c6('0x9'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0xa')]);router[_0xe3c6('0x6')](_0xe3c6('0xb'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0xc')]);router[_0xe3c6('0x6')](_0xe3c6('0xd'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0xe')]);router['get'](_0xe3c6('0xf'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x10')]);router['get'](_0xe3c6('0x11'),auth[_0xe3c6('0x7')](),controller['openchannelQueues']);router[_0xe3c6('0x6')](_0xe3c6('0x12'),auth['isAuthenticated'](),controller[_0xe3c6('0x13')]);router['get']('/whatsapp/queues',auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x14')]);router[_0xe3c6('0x6')]('/fax/queues',auth[_0xe3c6('0x7')](),controller['faxQueues']);router[_0xe3c6('0x6')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0xe3c6('0x15')]);router[_0xe3c6('0x6')](_0xe3c6('0x16'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x17')]);router['get'](_0xe3c6('0x18'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x19')]);router[_0xe3c6('0x6')](_0xe3c6('0x1a'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x1b')]);router[_0xe3c6('0x6')](_0xe3c6('0x1c'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x1d')]);router[_0xe3c6('0x6')](_0xe3c6('0x1e'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x1f')]);router[_0xe3c6('0x20')](_0xe3c6('0x1e'),auth[_0xe3c6('0x7')](),controller['updateVoiceQueue']);router[_0xe3c6('0x6')](_0xe3c6('0x21'),auth['isAuthenticated'](),controller[_0xe3c6('0x22')]);router[_0xe3c6('0x6')](_0xe3c6('0x23'),auth[_0xe3c6('0x7')](),controller['outboundChannels']);router[_0xe3c6('0x6')]('/agents',auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x24')]);router[_0xe3c6('0x20')](_0xe3c6('0x25'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x26')]);router[_0xe3c6('0x6')](_0xe3c6('0x27'),auth[_0xe3c6('0x7')](),controller['telephones']);router[_0xe3c6('0x6')](_0xe3c6('0x28'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x29')]);router[_0xe3c6('0x6')](_0xe3c6('0x2a'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x2b')]);router[_0xe3c6('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller[_0xe3c6('0x2c')]);router[_0xe3c6('0x6')]('/chat/queues/waitinginteractions',auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x2d')]);router[_0xe3c6('0x6')](_0xe3c6('0x2e'),auth[_0xe3c6('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0xe3c6('0x6')]('/openchannel/queues/waitinginteractions',auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x2f')]);router[_0xe3c6('0x6')](_0xe3c6('0x30'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x31')]);router[_0xe3c6('0x6')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xe3c6('0x32')]);router[_0xe3c6('0x6')](_0xe3c6('0x33'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x34')]);router[_0xe3c6('0x6')]('/fax/queues/waitinginteractions',auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x35')]);router['post'](_0xe3c6('0x36'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x37')](_0xe3c6('0x38')));router[_0xe3c6('0x6')](_0xe3c6('0x39'),auth['isAuthenticated'](),controller[_0xe3c6('0x3a')]);router[_0xe3c6('0x3b')](_0xe3c6('0x3c'),auth[_0xe3c6('0x7')](),controller['queueNotify'](_0xe3c6('0x3d')));router[_0xe3c6('0x6')](_0xe3c6('0x3e'),auth[_0xe3c6('0x7')](),controller['showChatQueues']);router[_0xe3c6('0x3b')](_0xe3c6('0x3f'),auth['isAuthenticated'](),controller[_0xe3c6('0x37')]('fax'));router[_0xe3c6('0x6')](_0xe3c6('0x40'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x41')]);router[_0xe3c6('0x3b')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xe3c6('0x42')));router[_0xe3c6('0x6')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0xe3c6('0x43')]);router[_0xe3c6('0x3b')](_0xe3c6('0x44'),auth[_0xe3c6('0x7')](),controller['queueNotify'](_0xe3c6('0x45')));router['post']('/whatsapp/queues/:id/notify',auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x37')](_0xe3c6('0x46')));router['get'](_0xe3c6('0x47'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x48')]);router[_0xe3c6('0x6')]('/whatsapp/queues/:id',auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x49')]);router[_0xe3c6('0x3b')](_0xe3c6('0x4a'),auth[_0xe3c6('0x7')](),controller[_0xe3c6('0x4b')]);module[_0xe3c6('0x4c')]=router;
\ No newline at end of file
index f88dc5c..8d1c058 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['queueNotify','capitalize','chat','Website','Account','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','QueueId','TransferReport','Start','queue','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','agent','Agent\x20not\x20found','From','create','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','catch','status','json','stack','name','send','isNil','rows','find','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','format','interface','internal','AgentCapacity','telephones','Telephones','trunks','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions'];(function(_0x4c3953,_0x571b3a){var _0x28362e=function(_0xda2772){while(--_0xda2772){_0x4c3953['push'](_0x4c3953['shift']());}};_0x28362e(++_0x571b3a);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require(_0x7995('0x0'));var moment=require(_0x7995('0x1'));var _=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x7995('0x4'))(_0x7995('0x5'));var jayson=require(_0x7995('0x6'));var amiClient=jayson[_0x7995('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0x7995('0x7')][_0x7995('0x8')]({'port':0x232b});var routingClient=jayson[_0x7995('0x7')][_0x7995('0x8')]({'port':0x232c});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){var _0x4a64f7=_0x4996ca?_0x4996ca:amiClient;return _0x4a64f7[_0x7995('0x9')](_0xbda126,_0x326741)[_0x7995('0xa')](function(_0x18c8a3){if(_0x18c8a3[_0x7995('0xb')]){if(_0x18c8a3[_0x7995('0xb')][_0x7995('0xc')]===0x1f4){return _0x1cad37(_0x18c8a3[_0x7995('0xb')]['message']);}return _0x465276(_0x18c8a3[_0x7995('0xb')][_0x7995('0xd')]);}else{_0x465276(_0x18c8a3['result']);}})[_0x7995('0xe')](function(_0x2cb37a){_0x1cad37(_0x2cb37a);});});}function respondWithResult(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xc8;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0xf')](_0x385f00)[_0x7995('0x10')](_0x281576);}return _0x19a27e['sendStatus'](0x194);};}function handleError(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0x1f4;return function(_0x2233dd){logger[_0x7995('0xb')](_0x2233dd[_0x7995('0x11')]);if(_0x2233dd[_0x7995('0x12')]){delete _0x2233dd[_0x7995('0x12')];}_0x58f5ad[_0x7995('0xf')](_0x2b4e94)[_0x7995('0x13')](_0x2233dd);};}function findById(_0x5377e5){return function(_0x2eeacc){if(!_['isNil'](_0x5377e5)&&!_[_0x7995('0x14')](_0x2eeacc)&&!_[_0x7995('0x14')](_0x2eeacc[_0x7995('0x15')])){return _[_0x7995('0x16')](_0x2eeacc[_0x7995('0x15')],function(_0x37a7d4){return _0x37a7d4['id']==_0x5377e5;});}return null;};}exports['voiceChannels']=function(_0x54c9ae,_0x2536c8){return respondWithRpcPromise('VoiceChannels',_0x54c9ae['query'])[_0x7995('0xa')](respondWithResult(_0x2536c8,null))[_0x7995('0xe')](handleError(_0x2536c8,null));};exports['voiceChannelMixMonitor']=function(_0x3a9b54,_0x51f276){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x7995('0x17')](_0x3a9b54[_0x7995('0x18')],_0x3a9b54[_0x7995('0x19')]))[_0x7995('0xa')](respondWithResult(_0x51f276,null))[_0x7995('0xe')](handleError(_0x51f276,null));};exports[_0x7995('0x1a')]=function(_0x5d40ae,_0x32a09a){return respondWithRpcPromise(_0x7995('0x1b'),_[_0x7995('0x17')](_0x5d40ae[_0x7995('0x18')],_0x5d40ae[_0x7995('0x19')]))[_0x7995('0xa')](respondWithResult(_0x32a09a,null))[_0x7995('0xe')](handleError(_0x32a09a,null));};exports[_0x7995('0x1c')]=function(_0x59405a,_0x39df42){return respondWithRpcPromise(_0x7995('0x1d'),_0x59405a[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x39df42,null))[_0x7995('0xe')](handleError(_0x39df42,null));};exports[_0x7995('0x1e')]=function(_0x56691a,_0x47625f){return respondWithRpcPromise('VoiceQueues',_0x56691a[_0x7995('0x18')])[_0x7995('0xa')](findById(_0x56691a[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x47625f,null))[_0x7995('0xe')](handleError(_0x47625f,null));};exports['updateVoiceQueue']=function(_0x9b2a15,_0x514445){return respondWithRpcPromise(_0x7995('0x1f'),_[_0x7995('0x17')](_0x9b2a15[_0x7995('0x20')],_0x9b2a15['params']))['then'](respondWithResult(_0x514445,null))['catch'](handleError(_0x514445,null));};exports[_0x7995('0x21')]=function(_0xe6b0b3,_0x327a81){return respondWithRpcPromise(_0x7995('0x22'),_[_0x7995('0x17')](_0xe6b0b3[_0x7995('0x18')],_0xe6b0b3['params']))['then'](respondWithResult(_0x327a81,null))[_0x7995('0xe')](handleError(_0x327a81,null));};exports['voiceQueuesChannels']=function(_0x553671,_0x3eb566){return respondWithRpcPromise(_0x7995('0x23'),_0x553671[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x3eb566,null))['catch'](handleError(_0x3eb566,null));};exports[_0x7995('0x24')]=function(_0x33e24e,_0x5dd802){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x33e24e[_0x7995('0x18')],_0x33e24e[_0x7995('0x19')]))['then'](respondWithResult(_0x5dd802,null))[_0x7995('0xe')](handleError(_0x5dd802,null));};exports['voiceQueuesChannelHangup']=function(_0x37917b,_0x1cb058){return respondWithRpcPromise(_0x7995('0x25'),_['merge'](_0x37917b['query'],_0x37917b[_0x7995('0x19')]))['then'](respondWithResult(_0x1cb058,null))['catch'](handleError(_0x1cb058,null));};exports[_0x7995('0x26')]=function(_0xe328b1,_0x5212ff){return respondWithRpcPromise(_0x7995('0x27'),_[_0x7995('0x17')](_0xe328b1[_0x7995('0x18')],_0xe328b1[_0x7995('0x19')]))[_0x7995('0xa')](respondWithResult(_0x5212ff,null))['catch'](handleError(_0x5212ff,null));};exports[_0x7995('0x28')]=function(_0x242713,_0xf612e6){return respondWithRpcPromise(_0x7995('0x29'),_0x242713['query'])[_0x7995('0xa')](respondWithResult(_0xf612e6,null))[_0x7995('0xe')](handleError(_0xf612e6,null));};exports[_0x7995('0x2a')]=function(_0xe5ea43,_0x1f5bee){return respondWithRpcPromise(_0x7995('0x2b'),_0xe5ea43['query'])[_0x7995('0xa')](respondWithResult(_0x1f5bee,null))[_0x7995('0xe')](handleError(_0x1f5bee,null));};exports[_0x7995('0x2c')]=function(_0x2ea47f,_0x2e04cd){var _0x298fc2;return respondWithRpcPromise(_0x7995('0x2d'),_0x2ea47f[_0x7995('0x18')])[_0x7995('0xa')](function(_0x447981){_0x298fc2=_0x447981;return respondWithRpcPromise(_0x7995('0x2d'),_0x2ea47f[_0x7995('0x18')],routingClient);})[_0x7995('0xa')](function(_0x53cda2){return _['merge']({},_0x53cda2,_0x298fc2);})[_0x7995('0xa')](respondWithResult(_0x2e04cd,null))[_0x7995('0xe')](handleError(_0x2e04cd,null));};exports['agentCapacity']=function(_0x4b0855,_0x3f8522){if(_0x4b0855['body']&&_0x4b0855['body'][_0x7995('0x2e')]&&_0x4b0855[_0x7995('0x2f')]&&_0x4b0855[_0x7995('0x2f')]['name']){for(var _0x46ac4f in _0x4b0855['body'][_0x7995('0x2e')]){if(_0x4b0855['body']['interaction'][_0x7995('0x30')](_0x46ac4f)){db[_0x7995('0x31')][_0x7995('0x32')]({'where':{'channel':_0x46ac4f,'membername':_0x4b0855[_0x7995('0x2f')]['name'],'type':_0x7995('0x33'),'exitAt':null,'uniqueid':_0x4b0855[_0x7995('0x20')][_0x7995('0x2e')][_0x46ac4f]&&_0x4b0855[_0x7995('0x20')]['interaction'][_0x46ac4f]['length']?{'$notIn':_0x4b0855[_0x7995('0x20')]['interaction'][_0x46ac4f]}:{'$ne':null}}})[_0x7995('0xa')](function(_0x59c153){var _0x2f435e=moment()['format'](_0x7995('0x34'));for(var _0x1b0373=0x0,_0x4d9245=_0x59c153[_0x7995('0x35')];_0x1b0373<_0x4d9245;_0x1b0373+=0x1){_0x59c153[_0x1b0373][_0x7995('0x36')]({'exitAt':_0x2f435e});}});for(var _0x314145=0x0;_0x314145<_0x4b0855[_0x7995('0x20')]['interaction'][_0x46ac4f][_0x7995('0x35')];_0x314145+=0x1){db[_0x7995('0x31')][_0x7995('0x37')]({'where':{'channel':_0x46ac4f,'membername':_0x4b0855['user'][_0x7995('0x12')],'type':_0x7995('0x33'),'uniqueid':_0x4b0855[_0x7995('0x20')][_0x7995('0x2e')][_0x46ac4f][_0x314145],'exitAt':null},'defaults':{'channel':_0x46ac4f,'membername':_0x4b0855[_0x7995('0x2f')]['name'],'interface':_[_0x7995('0x14')](_0x4b0855[_0x7995('0x2f')]['interface'])?util[_0x7995('0x38')]('SIP/%s',_0x4b0855[_0x7995('0x2f')][_0x7995('0x12')]):_0x4b0855[_0x7995('0x2f')][_0x7995('0x39')],'type':_0x7995('0x33'),'enterAt':moment()[_0x7995('0x38')](_0x7995('0x34')),'role':'agent','internal':_0x4b0855[_0x7995('0x2f')][_0x7995('0x3a')],'uniqueid':_0x4b0855[_0x7995('0x20')]['interaction'][_0x46ac4f][_0x314145]}});}}}}return respondWithRpcPromise(_0x7995('0x3b'),{'id':_0x4b0855[_0x7995('0x19')]['id'],'capacity':_0x4b0855[_0x7995('0x20')]['capacity']},routingClient)['then'](respondWithResult(_0x3f8522,null))['catch'](handleError(_0x3f8522,null));};exports[_0x7995('0x3c')]=function(_0x1fd1ca,_0x4cf5db){return respondWithRpcPromise(_0x7995('0x3d'),_0x1fd1ca[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x4cf5db,null))[_0x7995('0xe')](handleError(_0x4cf5db,null));};exports[_0x7995('0x3e')]=function(_0x528c8e,_0x29ee32){return respondWithRpcPromise('Trunks',_0x528c8e[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x29ee32,null))[_0x7995('0xe')](handleError(_0x29ee32,null));};exports['campaigns']=function(_0x5e1f34,_0x54e2b1){return respondWithRpcPromise('Campaigns',_0x5e1f34[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x54e2b1,null))[_0x7995('0xe')](handleError(_0x54e2b1,null));};exports[_0x7995('0x3f')]=function(_0x1d957e,_0x357e60){return respondWithRpcPromise(_0x7995('0x40'),_0x1d957e[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0x357e60,null))[_0x7995('0xe')](handleError(_0x357e60,null));};exports[_0x7995('0x41')]=function(_0x133c63,_0x3da72b){return respondWithRpcPromise(_0x7995('0x40'),_0x133c63[_0x7995('0x18')],routingClient)[_0x7995('0xa')](findById(_0x133c63[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x3da72b,null))[_0x7995('0xe')](handleError(_0x3da72b,null));};exports['mailQueues']=function(_0x56a374,_0x630737){return respondWithRpcPromise(_0x7995('0x42'),_0x56a374[_0x7995('0x18')],routingClient)['then'](respondWithResult(_0x630737,null))['catch'](handleError(_0x630737,null));};exports[_0x7995('0x43')]=function(_0x197b52,_0x5b9467){return respondWithRpcPromise(_0x7995('0x42'),_0x197b52['query'],routingClient)[_0x7995('0xa')](findById(_0x197b52[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x5b9467,null))[_0x7995('0xe')](handleError(_0x5b9467,null));};exports['mailAccounts']=function(_0x5e2d97,_0x40e5fc){return respondWithRpcPromise(_0x7995('0x44'),_0x5e2d97[_0x7995('0x18')],mailClient)[_0x7995('0xa')](respondWithResult(_0x40e5fc,null))[_0x7995('0xe')](handleError(_0x40e5fc,null));};exports[_0x7995('0x45')]=function(_0x1d4689,_0x1e2206){return respondWithRpcPromise(_0x7995('0x46'),_0x1d4689['query'],routingClient)[_0x7995('0xa')](respondWithResult(_0x1e2206,null))[_0x7995('0xe')](handleError(_0x1e2206,null));};exports[_0x7995('0x47')]=function(_0x1ecfdb,_0x59c5aa){return respondWithRpcPromise('OpenchannelQueues',_0x1ecfdb[_0x7995('0x18')],routingClient)[_0x7995('0xa')](findById(_0x1ecfdb['params']['id']))[_0x7995('0xa')](respondWithResult(_0x59c5aa,null))[_0x7995('0xe')](handleError(_0x59c5aa,null));};exports[_0x7995('0x48')]=function(_0x57727e,_0x32cb04){return respondWithRpcPromise('SmsQueues',_0x57727e[_0x7995('0x18')],routingClient)['then'](respondWithResult(_0x32cb04,null))[_0x7995('0xe')](handleError(_0x32cb04,null));};exports[_0x7995('0x49')]=function(_0x1722e2,_0x25b534){return respondWithRpcPromise(_0x7995('0x4a'),_0x1722e2[_0x7995('0x18')],routingClient)[_0x7995('0xa')](findById(_0x1722e2[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x25b534,null))[_0x7995('0xe')](handleError(_0x25b534,null));};exports[_0x7995('0x4b')]=function(_0x234d8d,_0x56eb85){return respondWithRpcPromise(_0x7995('0x4c'),_0x234d8d[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0x56eb85,null))[_0x7995('0xe')](handleError(_0x56eb85,null));};exports[_0x7995('0x4d')]=function(_0x54a2e0,_0x4b54f2){return respondWithRpcPromise(_0x7995('0x4c'),_0x54a2e0[_0x7995('0x18')],routingClient)[_0x7995('0xa')](findById(_0x54a2e0[_0x7995('0x19')]['id']))['then'](respondWithResult(_0x4b54f2,null))[_0x7995('0xe')](handleError(_0x4b54f2,null));};exports['faxQueues']=function(_0x5df621,_0xca8238){return respondWithRpcPromise(_0x7995('0x4e'),_0x5df621[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0xca8238,null))[_0x7995('0xe')](handleError(_0xca8238,null));};exports[_0x7995('0x4f')]=function(_0x32a52f,_0x13dc73){return respondWithRpcPromise(_0x7995('0x4e'),_0x32a52f[_0x7995('0x18')],routingClient)['then'](findById(_0x32a52f[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x13dc73,null))[_0x7995('0xe')](handleError(_0x13dc73,null));};exports['faxAccounts']=function(_0x1fe1cb,_0x1d2f9d){return respondWithRpcPromise(_0x7995('0x50'),_0x1fe1cb[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x1d2f9d,null))[_0x7995('0xe')](handleError(_0x1d2f9d,null));};exports[_0x7995('0x51')]=function(_0x3adfd2,_0x2f94c4){return respondWithRpcPromise(_0x7995('0x52'),_0x3adfd2[_0x7995('0x18')],routingClient)['then'](respondWithResult(_0x2f94c4,null))['catch'](handleError(_0x2f94c4,null));};exports[_0x7995('0x53')]=function(_0xfe1105,_0x39ebb6){return respondWithRpcPromise(_0x7995('0x54'),_0xfe1105['query'],routingClient)[_0x7995('0xa')](respondWithResult(_0x39ebb6,null))[_0x7995('0xe')](handleError(_0x39ebb6,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x480fdb,_0x3253b5){return respondWithRpcPromise(_0x7995('0x55'),_0x480fdb['query'],routingClient)[_0x7995('0xa')](respondWithResult(_0x3253b5,null))['catch'](handleError(_0x3253b5,null));};exports[_0x7995('0x56')]=function(_0xea9aba,_0x4ff9ff){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0xea9aba[_0x7995('0x18')],routingClient)['then'](function(_0x31b9e6){if(_0xea9aba[_0x7995('0x18')][_0x7995('0x57')]!==undefined){var _0x45bd8a=_(_0x31b9e6[_0x7995('0x15')])[_0x7995('0x58')]([_0xea9aba[_0x7995('0x18')][_0x7995('0x57')],_0xea9aba[_0x7995('0x19')]['id']])[_0x7995('0x59')](_0x7995('0x5a'))[_0x7995('0x5b')]()[_0x7995('0x5c')]();return _0x31b9e6[_0x7995('0x15')][_0x7995('0x58')](function(_0x3773de){return _0x45bd8a[_0x7995('0x5d')](_0x3773de[_0x7995('0x5a')])>-0x1;});}else{return _0x31b9e6[_0x7995('0x15')][_0x7995('0x58')](function(_0x306fa9){return _0x306fa9[_0x7995('0x5a')]===parseInt(_0xea9aba[_0x7995('0x19')]['id']);});}})[_0x7995('0xa')](respondWithResult(_0x4ff9ff,null))[_0x7995('0xe')](handleError(_0x4ff9ff,null));};exports[_0x7995('0x5e')]=function(_0x2f7f51,_0x34724d){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2f7f51[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0x34724d,null))['catch'](handleError(_0x34724d,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x15e8d1,_0x3fe8fc){return respondWithRpcPromise(_0x7995('0x5f'),_0x15e8d1[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0x3fe8fc,null))[_0x7995('0xe')](handleError(_0x3fe8fc,null));};exports['faxQueuesWaitingInteractions']=function(_0x2f8a2d,_0xb68962){return respondWithRpcPromise(_0x7995('0x60'),_0x2f8a2d[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0xb68962,null))[_0x7995('0xe')](handleError(_0xb68962,null));};exports[_0x7995('0x61')]=function(_0xc93dcb){return function(_0x560095,_0x1c8e7d){var _0x2b8217,_0x5c04c9;var _0x479271=_[_0x7995('0x62')](_0xc93dcb);var _0xf8c2ed=_0xc93dcb===_0x7995('0x63')?_0x7995('0x64'):_0x7995('0x65');return db[_0x479271+'Queue'][_0x7995('0x66')]({'raw':!![],'where':{'id':_0x560095[_0x7995('0x19')]['id']}})['then'](function(_0x209977){if(_[_0x7995('0x14')](_0x209977)){throw new Error(_0x479271+'\x20Queue\x20not\x20found');}_0x2b8217=_0x209977;return db[_0x479271+_0x7995('0x67')]['findOne']({'where':{'id':_0x560095[_0x7995('0x20')][_0x7995('0x68')]},'include':[{'model':db[_0x479271+_0x7995('0x69')],'as':_0x7995('0x69')},{'model':db[_0x479271+_0xf8c2ed],'as':_0x7995('0x65')}]});})['then'](function(_0x1f0506){if(_[_0x7995('0x14')](_0x1f0506)){throw new Error(_0x479271+_0x7995('0x6a'));}_0x5c04c9=_0x1f0506;return _0x1f0506['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x7995('0xa')](function(){var _0x3f3434={'uniqueid':_0xc93dcb+'.'+_0x5c04c9['id']+'.'+_0x5c04c9[_0x7995('0x69')]['id'],'FromUserId':_0x560095[_0x7995('0x2f')]['id'],'type':'queue'};_0x3f3434[_0x479271+_0x7995('0x6b')]=_0x5c04c9['id'];_0x3f3434[_0x479271+_0x7995('0x6c')]=_0x5c04c9[_0x7995('0x69')]['id'];_0x3f3434['From'+_0x479271+_0xf8c2ed+'Id']=_0x5c04c9['Account']['id'];_0x3f3434['To'+_0x479271+_0x7995('0x6d')]=_0x2b8217['id'];return db[_0x479271+_0x7995('0x6e')]['create'](_0x3f3434);})['then'](function(){return respondWithRpcPromise(_0x7995('0x6f'),{'channel':_0xc93dcb,'interaction':_0x5c04c9[_0x7995('0x69')],'message':_0x5c04c9,'account':_0x5c04c9[_0x7995('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7995('0x70'),'appdata':_0x2b8217[_0x7995('0x12')]+','+(_0x5c04c9['Account']['queueTransferTimeout']||0x12c),'interval':_0x7995('0x71')}]},routingClient);})['then'](respondWithResult(_0x1c8e7d,null))['catch'](handleError(_0x1c8e7d,null));};};exports[_0x7995('0x72')]=function(_0x3b731e,_0x3192b8){var _0x5eb360,_0x3b1309;if(_[_0x7995('0x14')](_0x3b731e[_0x7995('0x20')][_0x7995('0x73')])){throw new Error(_0x7995('0x74'));}var _0x5799d1=_0x3b731e[_0x7995('0x20')][_0x7995('0x73')];var _0x1a2d6a=_[_0x7995('0x62')](_0x5799d1);var _0x50bf9a=_0x5799d1===_0x7995('0x63')?_0x7995('0x64'):'Account';return db[_0x7995('0x75')][_0x7995('0x66')]({'raw':!![],'where':{'id':_0x3b731e['params']['id'],'role':_0x7995('0x76')}})['then'](function(_0x1b4b34){if(_['isNil'](_0x1b4b34)){throw new Error(_0x7995('0x77'));}_0x5eb360=_0x1b4b34;return db[_0x1a2d6a+'Message'][_0x7995('0x66')]({'where':{'id':_0x3b731e[_0x7995('0x20')]['messageId']},'include':[{'model':db[_0x1a2d6a+_0x7995('0x69')],'as':'Interaction'},{'model':db[_0x1a2d6a+_0x50bf9a],'as':'Account'}]});})[_0x7995('0xa')](function(_0x14812d){if(_[_0x7995('0x14')](_0x14812d)){throw new Error(_0x1a2d6a+_0x7995('0x6a'));}_0x3b1309=_0x14812d;return _0x14812d['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x7995('0xa')](function(){var _0x35044a={'uniqueid':_0x5799d1+'.'+_0x3b1309['id']+'.'+_0x3b1309['Interaction']['id'],'FromUserId':_0x3b731e['user']['id'],'type':_0x7995('0x70'),'ToUserId':_0x5eb360['id']};_0x35044a[_0x1a2d6a+'MessageId']=_0x3b1309['id'];_0x35044a[_0x1a2d6a+_0x7995('0x6c')]=_0x3b1309[_0x7995('0x69')]['id'];_0x35044a[_0x7995('0x78')+_0x1a2d6a+_0x50bf9a+'Id']=_0x3b1309['Account']['id'];return db[_0x1a2d6a+'TransferReport'][_0x7995('0x79')](_0x35044a);})['then'](function(){return respondWithRpcPromise(_0x7995('0x6f'),{'channel':_0x5799d1,'interaction':_0x3b1309[_0x7995('0x69')],'message':_0x3b1309,'account':_0x3b1309[_0x7995('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7995('0x76'),'appdata':_0x5eb360['name']+','+(_0x3b1309['Account']['agentTransferTimeout']||0x12c),'interval':_0x7995('0x71')}]},routingClient);})[_0x7995('0xa')](respondWithResult(_0x3192b8,null))[_0x7995('0xe')](handleError(_0x3192b8,null));};
\ No newline at end of file
+var _0x8ef6=['name','send','isNil','find','rows','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','INTERACTION','agent','internal','AgentCapacity','telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','queue_id','value','filter','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','TransferReport','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','catch','status','sendStatus','stack'];(function(_0x3a61f1,_0x2b7f2d){var _0x141b0e=function(_0x2c031c){while(--_0x2c031c){_0x3a61f1['push'](_0x3a61f1['shift']());}};_0x141b0e(++_0x2b7f2d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x40444c,_0x2f347c){_0x40444c=_0x40444c-0x0;var _0x5eab5f=_0x8ef6[_0x40444c];return _0x5eab5f;};'use strict';var BPromise=require(_0x68ef('0x0'));var moment=require(_0x68ef('0x1'));var _=require(_0x68ef('0x2'));var util=require(_0x68ef('0x3'));var db=require(_0x68ef('0x4'))['db'];var logger=require(_0x68ef('0x5'))(_0x68ef('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x68ef('0x7')][_0x68ef('0x8')]({'port':0x232a});var mailClient=jayson[_0x68ef('0x7')][_0x68ef('0x8')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){var _0x31007e=_0x2de776?_0x2de776:amiClient;return _0x31007e[_0x68ef('0x9')](_0x3c2ff3,_0x4740e8)[_0x68ef('0xa')](function(_0x112b18){if(_0x112b18[_0x68ef('0xb')]){if(_0x112b18[_0x68ef('0xb')][_0x68ef('0xc')]===0x1f4){return _0x228967(_0x112b18[_0x68ef('0xb')][_0x68ef('0xd')]);}return _0x4eb5eb(_0x112b18[_0x68ef('0xb')][_0x68ef('0xd')]);}else{_0x4eb5eb(_0x112b18['result']);}})[_0x68ef('0xe')](function(_0x46356f){_0x228967(_0x46356f);});});}function respondWithResult(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xc8;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0xf')](_0x454ef4)['json'](_0x40f253);}return _0x1e117a[_0x68ef('0x10')](0x194);};}function handleError(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0x1f4;return function(_0x47fbb5){logger[_0x68ef('0xb')](_0x47fbb5[_0x68ef('0x11')]);if(_0x47fbb5[_0x68ef('0x12')]){delete _0x47fbb5['name'];}_0xc50cce[_0x68ef('0xf')](_0x2657c5)[_0x68ef('0x13')](_0x47fbb5);};}function findById(_0x3d1e90){return function(_0x3780a4){if(!_['isNil'](_0x3d1e90)&&!_[_0x68ef('0x14')](_0x3780a4)&&!_['isNil'](_0x3780a4['rows'])){return _[_0x68ef('0x15')](_0x3780a4[_0x68ef('0x16')],function(_0x4ade0d){return _0x4ade0d['id']==_0x3d1e90;});}return null;};}exports['voiceChannels']=function(_0x3c4c1f,_0x2cd92c){return respondWithRpcPromise(_0x68ef('0x17'),_0x3c4c1f['query'])[_0x68ef('0xa')](respondWithResult(_0x2cd92c,null))[_0x68ef('0xe')](handleError(_0x2cd92c,null));};exports[_0x68ef('0x18')]=function(_0x5b246b,_0x3c46d4){return respondWithRpcPromise(_0x68ef('0x19'),_['merge'](_0x5b246b[_0x68ef('0x1a')],_0x5b246b[_0x68ef('0x1b')]))[_0x68ef('0xa')](respondWithResult(_0x3c46d4,null))['catch'](handleError(_0x3c46d4,null));};exports['voiceChannelStopMixMonitor']=function(_0x59bebc,_0x26018d){return respondWithRpcPromise(_0x68ef('0x1c'),_[_0x68ef('0x1d')](_0x59bebc[_0x68ef('0x1a')],_0x59bebc[_0x68ef('0x1b')]))[_0x68ef('0xa')](respondWithResult(_0x26018d,null))[_0x68ef('0xe')](handleError(_0x26018d,null));};exports[_0x68ef('0x1e')]=function(_0x65fd09,_0x13280b){return respondWithRpcPromise('VoiceQueues',_0x65fd09[_0x68ef('0x1a')])['then'](respondWithResult(_0x13280b,null))['catch'](handleError(_0x13280b,null));};exports['showVoiceQueues']=function(_0x1a7ce1,_0x268f32){return respondWithRpcPromise(_0x68ef('0x1f'),_0x1a7ce1[_0x68ef('0x1a')])['then'](findById(_0x1a7ce1['params']['id']))[_0x68ef('0xa')](respondWithResult(_0x268f32,null))[_0x68ef('0xe')](handleError(_0x268f32,null));};exports[_0x68ef('0x20')]=function(_0x263b30,_0x22ef25){return respondWithRpcPromise(_0x68ef('0x21'),_[_0x68ef('0x1d')](_0x263b30[_0x68ef('0x22')],_0x263b30['params']))[_0x68ef('0xa')](respondWithResult(_0x22ef25,null))[_0x68ef('0xe')](handleError(_0x22ef25,null));};exports[_0x68ef('0x23')]=function(_0x4c25aa,_0x370a8f){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x68ef('0x1d')](_0x4c25aa[_0x68ef('0x1a')],_0x4c25aa['params']))['then'](respondWithResult(_0x370a8f,null))[_0x68ef('0xe')](handleError(_0x370a8f,null));};exports[_0x68ef('0x24')]=function(_0x4b8fc8,_0xf58fa1){return respondWithRpcPromise(_0x68ef('0x25'),_0x4b8fc8[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0xf58fa1,null))['catch'](handleError(_0xf58fa1,null));};exports[_0x68ef('0x26')]=function(_0x1d69ac,_0x5f137b){return respondWithRpcPromise(_0x68ef('0x27'),_['merge'](_0x1d69ac[_0x68ef('0x1a')],_0x1d69ac[_0x68ef('0x1b')]))['then'](respondWithResult(_0x5f137b,null))[_0x68ef('0xe')](handleError(_0x5f137b,null));};exports['voiceQueuesChannelHangup']=function(_0x38c2f8,_0x575f43){return respondWithRpcPromise(_0x68ef('0x28'),_[_0x68ef('0x1d')](_0x38c2f8[_0x68ef('0x1a')],_0x38c2f8['params']))[_0x68ef('0xa')](respondWithResult(_0x575f43,null))['catch'](handleError(_0x575f43,null));};exports[_0x68ef('0x29')]=function(_0x4c9506,_0x474ffa){return respondWithRpcPromise(_0x68ef('0x2a'),_[_0x68ef('0x1d')](_0x4c9506[_0x68ef('0x1a')],_0x4c9506[_0x68ef('0x1b')]))[_0x68ef('0xa')](respondWithResult(_0x474ffa,null))['catch'](handleError(_0x474ffa,null));};exports[_0x68ef('0x2b')]=function(_0x15a6ab,_0x32074a){return respondWithRpcPromise('Outbound',_0x15a6ab[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0x32074a,null))[_0x68ef('0xe')](handleError(_0x32074a,null));};exports['outboundChannels']=function(_0x49f260,_0x14f0fc){return respondWithRpcPromise(_0x68ef('0x2c'),_0x49f260[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0x14f0fc,null))[_0x68ef('0xe')](handleError(_0x14f0fc,null));};exports[_0x68ef('0x2d')]=function(_0x41ffe0,_0x5b1246){var _0xaf7df1;return respondWithRpcPromise(_0x68ef('0x2e'),_0x41ffe0[_0x68ef('0x1a')])[_0x68ef('0xa')](function(_0x492b74){_0xaf7df1=_0x492b74;return respondWithRpcPromise(_0x68ef('0x2e'),_0x41ffe0[_0x68ef('0x1a')],routingClient);})[_0x68ef('0xa')](function(_0x410c10){return _[_0x68ef('0x1d')]({},_0x410c10,_0xaf7df1);})[_0x68ef('0xa')](respondWithResult(_0x5b1246,null))['catch'](handleError(_0x5b1246,null));};exports[_0x68ef('0x2f')]=function(_0x3f7699,_0xf5010c){if(_0x3f7699[_0x68ef('0x22')]&&_0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')]&&_0x3f7699[_0x68ef('0x31')]&&_0x3f7699[_0x68ef('0x31')][_0x68ef('0x12')]){for(var _0x531096 in _0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')]){if(_0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')][_0x68ef('0x32')](_0x531096)){db[_0x68ef('0x33')][_0x68ef('0x34')]({'where':{'channel':_0x531096,'membername':_0x3f7699['user'][_0x68ef('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')][_0x531096]&&_0x3f7699[_0x68ef('0x22')][_0x68ef('0x30')][_0x531096]['length']?{'$notIn':_0x3f7699[_0x68ef('0x22')]['interaction'][_0x531096]}:{'$ne':null}}})[_0x68ef('0xa')](function(_0x499423){var _0x227e36=moment()[_0x68ef('0x35')](_0x68ef('0x36'));for(var _0x5c4a66=0x0,_0x59b148=_0x499423[_0x68ef('0x37')];_0x5c4a66<_0x59b148;_0x5c4a66+=0x1){_0x499423[_0x5c4a66][_0x68ef('0x38')]({'exitAt':_0x227e36});}});for(var _0x58d72a=0x0;_0x58d72a<_0x3f7699['body']['interaction'][_0x531096][_0x68ef('0x37')];_0x58d72a+=0x1){db[_0x68ef('0x33')][_0x68ef('0x39')]({'where':{'channel':_0x531096,'membername':_0x3f7699[_0x68ef('0x31')][_0x68ef('0x12')],'type':'INTERACTION','uniqueid':_0x3f7699['body'][_0x68ef('0x30')][_0x531096][_0x58d72a],'exitAt':null},'defaults':{'channel':_0x531096,'membername':_0x3f7699[_0x68ef('0x31')][_0x68ef('0x12')],'interface':_[_0x68ef('0x14')](_0x3f7699['user'][_0x68ef('0x3a')])?util[_0x68ef('0x35')](_0x68ef('0x3b'),_0x3f7699[_0x68ef('0x31')]['name']):_0x3f7699['user'][_0x68ef('0x3a')],'type':_0x68ef('0x3c'),'enterAt':moment()['format'](_0x68ef('0x36')),'role':_0x68ef('0x3d'),'internal':_0x3f7699[_0x68ef('0x31')][_0x68ef('0x3e')],'uniqueid':_0x3f7699[_0x68ef('0x22')]['interaction'][_0x531096][_0x58d72a]}});}}}}return respondWithRpcPromise(_0x68ef('0x3f'),{'id':_0x3f7699[_0x68ef('0x1b')]['id'],'capacity':_0x3f7699[_0x68ef('0x22')]['capacity']},routingClient)[_0x68ef('0xa')](respondWithResult(_0xf5010c,null))[_0x68ef('0xe')](handleError(_0xf5010c,null));};exports[_0x68ef('0x40')]=function(_0x50ef1f,_0x7dce90){return respondWithRpcPromise('Telephones',_0x50ef1f['query'])[_0x68ef('0xa')](respondWithResult(_0x7dce90,null))['catch'](handleError(_0x7dce90,null));};exports[_0x68ef('0x41')]=function(_0xb33afd,_0x53ebd){return respondWithRpcPromise(_0x68ef('0x42'),_0xb33afd[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0x53ebd,null))[_0x68ef('0xe')](handleError(_0x53ebd,null));};exports[_0x68ef('0x43')]=function(_0x2b35f4,_0x247915){return respondWithRpcPromise('Campaigns',_0x2b35f4['query'])[_0x68ef('0xa')](respondWithResult(_0x247915,null))[_0x68ef('0xe')](handleError(_0x247915,null));};exports[_0x68ef('0x44')]=function(_0xdc83f4,_0x82df12){return respondWithRpcPromise(_0x68ef('0x45'),_0xdc83f4[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x82df12,null))[_0x68ef('0xe')](handleError(_0x82df12,null));};exports['showChatQueues']=function(_0x5685bb,_0x42a4b2){return respondWithRpcPromise('ChatQueues',_0x5685bb[_0x68ef('0x1a')],routingClient)['then'](findById(_0x5685bb[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x42a4b2,null))['catch'](handleError(_0x42a4b2,null));};exports[_0x68ef('0x46')]=function(_0x4e097e,_0x407c6d){return respondWithRpcPromise(_0x68ef('0x47'),_0x4e097e[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x407c6d,null))[_0x68ef('0xe')](handleError(_0x407c6d,null));};exports[_0x68ef('0x48')]=function(_0x5c347c,_0x1cdaef){return respondWithRpcPromise(_0x68ef('0x47'),_0x5c347c[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](findById(_0x5c347c[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x1cdaef,null))['catch'](handleError(_0x1cdaef,null));};exports[_0x68ef('0x49')]=function(_0x42d2a3,_0x4886af){return respondWithRpcPromise(_0x68ef('0x4a'),_0x42d2a3[_0x68ef('0x1a')],mailClient)[_0x68ef('0xa')](respondWithResult(_0x4886af,null))['catch'](handleError(_0x4886af,null));};exports[_0x68ef('0x4b')]=function(_0x49d197,_0x5412ea){return respondWithRpcPromise(_0x68ef('0x4c'),_0x49d197['query'],routingClient)[_0x68ef('0xa')](respondWithResult(_0x5412ea,null))['catch'](handleError(_0x5412ea,null));};exports[_0x68ef('0x4d')]=function(_0x9e8554,_0x304405){return respondWithRpcPromise(_0x68ef('0x4c'),_0x9e8554[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](findById(_0x9e8554['params']['id']))[_0x68ef('0xa')](respondWithResult(_0x304405,null))['catch'](handleError(_0x304405,null));};exports[_0x68ef('0x4e')]=function(_0x4b0c3e,_0x2f97c5){return respondWithRpcPromise(_0x68ef('0x4f'),_0x4b0c3e[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x2f97c5,null))[_0x68ef('0xe')](handleError(_0x2f97c5,null));};exports[_0x68ef('0x50')]=function(_0x1be626,_0x52d29a){return respondWithRpcPromise(_0x68ef('0x4f'),_0x1be626[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](findById(_0x1be626[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x52d29a,null))['catch'](handleError(_0x52d29a,null));};exports[_0x68ef('0x51')]=function(_0x561e8d,_0x1ed172){return respondWithRpcPromise('WhatsappQueues',_0x561e8d['query'],routingClient)[_0x68ef('0xa')](respondWithResult(_0x1ed172,null))[_0x68ef('0xe')](handleError(_0x1ed172,null));};exports[_0x68ef('0x52')]=function(_0x21b2ce,_0x51f905){return respondWithRpcPromise(_0x68ef('0x53'),_0x21b2ce['query'],routingClient)[_0x68ef('0xa')](findById(_0x21b2ce[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x51f905,null))['catch'](handleError(_0x51f905,null));};exports['faxQueues']=function(_0x3e74d2,_0x1092f8){return respondWithRpcPromise(_0x68ef('0x54'),_0x3e74d2[_0x68ef('0x1a')],routingClient)['then'](respondWithResult(_0x1092f8,null))[_0x68ef('0xe')](handleError(_0x1092f8,null));};exports[_0x68ef('0x55')]=function(_0x19c20f,_0x21b104){return respondWithRpcPromise('FaxQueues',_0x19c20f[_0x68ef('0x1a')],routingClient)['then'](findById(_0x19c20f[_0x68ef('0x1b')]['id']))[_0x68ef('0xa')](respondWithResult(_0x21b104,null))[_0x68ef('0xe')](handleError(_0x21b104,null));};exports[_0x68ef('0x56')]=function(_0xed16d1,_0x52cb2a){return respondWithRpcPromise(_0x68ef('0x57'),_0xed16d1[_0x68ef('0x1a')])[_0x68ef('0xa')](respondWithResult(_0x52cb2a,null))['catch'](handleError(_0x52cb2a,null));};exports[_0x68ef('0x58')]=function(_0x4de108,_0x69b1c){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4de108['query'],routingClient)[_0x68ef('0xa')](respondWithResult(_0x69b1c,null))[_0x68ef('0xe')](handleError(_0x69b1c,null));};exports[_0x68ef('0x59')]=function(_0x405971,_0x501004){return respondWithRpcPromise(_0x68ef('0x5a'),_0x405971[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x501004,null))['catch'](handleError(_0x501004,null));};exports[_0x68ef('0x5b')]=function(_0x2db826,_0xea2a81){return respondWithRpcPromise(_0x68ef('0x5c'),_0x2db826[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0xea2a81,null))[_0x68ef('0xe')](handleError(_0xea2a81,null));};exports[_0x68ef('0x5d')]=function(_0x156ce3,_0x11feff){return respondWithRpcPromise(_0x68ef('0x5c'),_0x156ce3[_0x68ef('0x1a')],routingClient)['then'](function(_0x15378c){if(_0x156ce3[_0x68ef('0x1a')]['type']!==undefined){var _0x513c69=_(_0x15378c[_0x68ef('0x16')])['filter']([_0x156ce3[_0x68ef('0x1a')][_0x68ef('0x5e')],_0x156ce3['params']['id']])['map'](_0x68ef('0x5f'))['uniq']()[_0x68ef('0x60')]();return _0x15378c['rows'][_0x68ef('0x61')](function(_0x4f425f){return _0x513c69[_0x68ef('0x62')](_0x4f425f[_0x68ef('0x5f')])>-0x1;});}else{return _0x15378c['rows'][_0x68ef('0x61')](function(_0x357be7){return _0x357be7[_0x68ef('0x5f')]===parseInt(_0x156ce3[_0x68ef('0x1b')]['id']);});}})['then'](respondWithResult(_0x11feff,null))[_0x68ef('0xe')](handleError(_0x11feff,null));};exports[_0x68ef('0x63')]=function(_0x5b2e89,_0x3bb3b6){return respondWithRpcPromise(_0x68ef('0x64'),_0x5b2e89[_0x68ef('0x1a')],routingClient)['then'](respondWithResult(_0x3bb3b6,null))[_0x68ef('0xe')](handleError(_0x3bb3b6,null));};exports['whatsappQueuesWaitingInteractions']=function(_0xe6bf05,_0x36c109){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0xe6bf05['query'],routingClient)['then'](respondWithResult(_0x36c109,null))['catch'](handleError(_0x36c109,null));};exports[_0x68ef('0x65')]=function(_0x28ad22,_0x1217f9){return respondWithRpcPromise(_0x68ef('0x66'),_0x28ad22[_0x68ef('0x1a')],routingClient)[_0x68ef('0xa')](respondWithResult(_0x1217f9,null))[_0x68ef('0xe')](handleError(_0x1217f9,null));};exports[_0x68ef('0x67')]=function(_0x24ba34){return function(_0x3ae3e9,_0x17892c){var _0x108223,_0x717d7b;var _0x4bd5c3=_[_0x68ef('0x68')](_0x24ba34);var _0x556dfc=_0x24ba34===_0x68ef('0x69')?'Website':'Account';return db[_0x4bd5c3+_0x68ef('0x6a')][_0x68ef('0x6b')]({'raw':!![],'where':{'id':_0x3ae3e9[_0x68ef('0x1b')]['id']}})[_0x68ef('0xa')](function(_0x518c9a){if(_['isNil'](_0x518c9a)){throw new Error(_0x4bd5c3+_0x68ef('0x6c'));}_0x108223=_0x518c9a;return db[_0x4bd5c3+_0x68ef('0x6d')][_0x68ef('0x6b')]({'where':{'id':_0x3ae3e9['body'][_0x68ef('0x6e')]},'include':[{'model':db[_0x4bd5c3+_0x68ef('0x6f')],'as':_0x68ef('0x6f')},{'model':db[_0x4bd5c3+_0x556dfc],'as':_0x68ef('0x70')}]});})['then'](function(_0x214e89){if(_[_0x68ef('0x14')](_0x214e89)){throw new Error(_0x4bd5c3+_0x68ef('0x71'));}_0x717d7b=_0x214e89;return _0x214e89[_0x68ef('0x72')]({'read':0x0,'readAt':null,'UserId':null});})[_0x68ef('0xa')](function(){var _0x346049={'uniqueid':_0x24ba34+'.'+_0x717d7b['id']+'.'+_0x717d7b['Interaction']['id'],'FromUserId':_0x3ae3e9[_0x68ef('0x31')]['id'],'type':'queue'};_0x346049[_0x4bd5c3+_0x68ef('0x73')]=_0x717d7b['id'];_0x346049[_0x4bd5c3+_0x68ef('0x74')]=_0x717d7b[_0x68ef('0x6f')]['id'];_0x346049[_0x68ef('0x75')+_0x4bd5c3+_0x556dfc+'Id']=_0x717d7b['Account']['id'];_0x346049['To'+_0x4bd5c3+_0x68ef('0x76')]=_0x108223['id'];return db[_0x4bd5c3+'TransferReport'][_0x68ef('0x77')](_0x346049);})[_0x68ef('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x24ba34,'interaction':_0x717d7b['Interaction'],'message':_0x717d7b,'account':_0x717d7b[_0x68ef('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x108223[_0x68ef('0x12')]+','+(_0x717d7b['Account'][_0x68ef('0x78')]||0x12c),'interval':_0x68ef('0x79')}]},routingClient);})[_0x68ef('0xa')](respondWithResult(_0x17892c,null))[_0x68ef('0xe')](handleError(_0x17892c,null));};};exports[_0x68ef('0x7a')]=function(_0x66a7a8,_0x51b8db){var _0x17d014,_0x463356;if(_[_0x68ef('0x14')](_0x66a7a8[_0x68ef('0x22')][_0x68ef('0x7b')])){throw new Error(_0x68ef('0x7c'));}var _0x303add=_0x66a7a8['body'][_0x68ef('0x7b')];var _0x373ab4=_[_0x68ef('0x68')](_0x303add);var _0x2e20aa=_0x303add===_0x68ef('0x69')?_0x68ef('0x7d'):_0x68ef('0x70');return db[_0x68ef('0x7e')][_0x68ef('0x6b')]({'raw':!![],'where':{'id':_0x66a7a8['params']['id'],'role':_0x68ef('0x3d')}})['then'](function(_0x5f3b79){if(_['isNil'](_0x5f3b79)){throw new Error(_0x68ef('0x7f'));}_0x17d014=_0x5f3b79;return db[_0x373ab4+_0x68ef('0x6d')][_0x68ef('0x6b')]({'where':{'id':_0x66a7a8['body']['messageId']},'include':[{'model':db[_0x373ab4+'Interaction'],'as':_0x68ef('0x6f')},{'model':db[_0x373ab4+_0x2e20aa],'as':_0x68ef('0x70')}]});})[_0x68ef('0xa')](function(_0x40996e){if(_[_0x68ef('0x14')](_0x40996e)){throw new Error(_0x373ab4+_0x68ef('0x71'));}_0x463356=_0x40996e;return _0x40996e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x68ef('0xa')](function(){var _0x2c7f18={'uniqueid':_0x303add+'.'+_0x463356['id']+'.'+_0x463356[_0x68ef('0x6f')]['id'],'FromUserId':_0x66a7a8[_0x68ef('0x31')]['id'],'type':'queue','ToUserId':_0x17d014['id']};_0x2c7f18[_0x373ab4+_0x68ef('0x73')]=_0x463356['id'];_0x2c7f18[_0x373ab4+_0x68ef('0x74')]=_0x463356[_0x68ef('0x6f')]['id'];_0x2c7f18[_0x68ef('0x75')+_0x373ab4+_0x2e20aa+'Id']=_0x463356[_0x68ef('0x70')]['id'];return db[_0x373ab4+_0x68ef('0x80')][_0x68ef('0x77')](_0x2c7f18);})[_0x68ef('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x303add,'interaction':_0x463356[_0x68ef('0x6f')],'message':_0x463356,'account':_0x463356[_0x68ef('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x17d014[_0x68ef('0x12')]+','+(_0x463356[_0x68ef('0x70')][_0x68ef('0x81')]||0x12c),'interval':_0x68ef('0x79')}]},routingClient);})[_0x68ef('0xa')](respondWithResult(_0x51b8db,null))[_0x68ef('0xe')](handleError(_0x51b8db,null));};
\ No newline at end of file
index b8dbe28..49ada6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b49=['../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','run','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x563354,_0x3cf745){var _0x460d5e=function(_0x14d3fc){while(--_0x14d3fc){_0x563354['push'](_0x563354['shift']());}};_0x460d5e(++_0x3cf745);}(_0x2b49,0x1f2));var _0x92b4=function(_0x5817a2,_0x1057ba){_0x5817a2=_0x5817a2-0x0;var _0x45fbe5=_0x2b49[_0x5817a2];return _0x45fbe5;};'use strict';var multer=require(_0x92b4('0x0'));var util=require(_0x92b4('0x1'));var path=require(_0x92b4('0x2'));var timeout=require(_0x92b4('0x3'));var express=require(_0x92b4('0x4'));var router=express[_0x92b4('0x5')]();var fs_extra=require(_0x92b4('0x6'));var auth=require(_0x92b4('0x7'));var interaction=require(_0x92b4('0x8'));var config=require(_0x92b4('0x9'));var controller=require(_0x92b4('0xa'));router['get']('/',auth[_0x92b4('0xb')](),controller[_0x92b4('0xc')]);router[_0x92b4('0xd')](_0x92b4('0xe'),auth[_0x92b4('0xb')](),controller[_0x92b4('0xf')]);router[_0x92b4('0xd')]('/:id/run',auth[_0x92b4('0xb')](),controller[_0x92b4('0x10')]);router[_0x92b4('0x11')]('/',auth[_0x92b4('0xb')](),controller['create']);router[_0x92b4('0x12')](_0x92b4('0xe'),auth[_0x92b4('0xb')](),controller[_0x92b4('0x13')]);router['delete']('/:id',auth[_0x92b4('0xb')](),controller[_0x92b4('0x14')]);module[_0x92b4('0x15')]=router;
\ No newline at end of file
+var _0xa018=['/:id','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','/:id/run','run','create'];(function(_0xbd4254,_0x31c08b){var _0x46c0f3=function(_0xd0dce7){while(--_0xd0dce7){_0xbd4254['push'](_0xbd4254['shift']());}};_0x46c0f3(++_0x31c08b);}(_0xa018,0x180));var _0x8a01=function(_0x2c7949,_0x14eeb9){_0x2c7949=_0x2c7949-0x0;var _0x4fad70=_0xa018[_0x2c7949];return _0x4fad70;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8a01('0x0'));var timeout=require(_0x8a01('0x1'));var express=require(_0x8a01('0x2'));var router=express[_0x8a01('0x3')]();var fs_extra=require(_0x8a01('0x4'));var auth=require(_0x8a01('0x5'));var interaction=require(_0x8a01('0x6'));var config=require(_0x8a01('0x7'));var controller=require(_0x8a01('0x8'));router[_0x8a01('0x9')]('/',auth[_0x8a01('0xa')](),controller[_0x8a01('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8a01('0xc')]);router[_0x8a01('0x9')](_0x8a01('0xd'),auth[_0x8a01('0xa')](),controller[_0x8a01('0xe')]);router['post']('/',auth[_0x8a01('0xa')](),controller[_0x8a01('0xf')]);router['put'](_0x8a01('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x8a01('0x11')]('/:id',auth[_0x8a01('0xa')](),controller[_0x8a01('0x12')]);module[_0x8a01('0x13')]=router;
\ No newline at end of file
index 0055a2c..c69c47c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb89=['STRING','TEXT','BOOLEAN','DATE','ENUM','years','quarters','months','weeks','days','hours','minutes','pdf','xlsx','csv','custom'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xfb89,0x1c3));var _0x9fb8=function(_0x7b484,_0x195ad4){_0x7b484=_0x7b484-0x0;var _0x2ae1cf=_0xfb89[_0x7b484];return _0x2ae1cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x9fb8('0x0')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9fb8('0x0')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9fb8('0x1')](_0x9fb8('0x2'),_0x9fb8('0x3'),_0x9fb8('0x4'),_0x9fb8('0x5'),_0x9fb8('0x6'),_0x9fb8('0x7'),_0x9fb8('0x8')),'allowNull':![],'defaultValue':_0x9fb8('0x6')},'output':{'type':Sequelize[_0x9fb8('0x1')]('csv',_0x9fb8('0x9'),_0x9fb8('0xa')),'allowNull':![],'defaultValue':_0x9fb8('0xb')},'type':{'type':Sequelize['ENUM'](_0x9fb8('0xc'),'default'),'allowNull':![],'defaultValue':_0x9fb8('0xc')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x9fb8('0xd')]},'cc':{'type':Sequelize[_0x9fb8('0xe')]},'bcc':{'type':Sequelize[_0x9fb8('0xe')]},'sendIfEmpty':{'type':Sequelize[_0x9fb8('0xf')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3d47=['INTEGER','ENUM','months','weeks','days','minutes','csv','pdf','default','TEXT','exports','STRING','BOOLEAN'];(function(_0x35e7f5,_0x505458){var _0x21327e=function(_0x24ee98){while(--_0x24ee98){_0x35e7f5['push'](_0x35e7f5['shift']());}};_0x21327e(++_0x505458);}(_0x3d47,0x135));var _0x73d4=function(_0x4b297c,_0x540bfa){_0x4b297c=_0x4b297c-0x0;var _0x159ae5=_0x3d47[_0x4b297c];return _0x159ae5;};'use strict';var Sequelize=require('sequelize');module[_0x73d4('0x0')]={'name':{'type':Sequelize[_0x73d4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x73d4('0x1')]},'active':{'type':Sequelize[_0x73d4('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x73d4('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x73d4('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x73d4('0x4')]('years','quarters',_0x73d4('0x5'),_0x73d4('0x6'),_0x73d4('0x7'),'hours',_0x73d4('0x8')),'allowNull':![],'defaultValue':_0x73d4('0x7')},'output':{'type':Sequelize[_0x73d4('0x4')](_0x73d4('0x9'),_0x73d4('0xa'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x73d4('0x4')]('custom',_0x73d4('0xb')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x73d4('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x73d4('0x1')]},'cc':{'type':Sequelize[_0x73d4('0xc')]},'bcc':{'type':Sequelize[_0x73d4('0xc')]},'sendIfEmpty':{'type':Sequelize[_0x73d4('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 6bf5822..bf5af69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a4d=['rawAttributes','fieldName','key','intersection','model','attributes','fields','length','query','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','Schedule','findAll','rows','keys','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','save','update','get','Scheduler','UserProfileResource','destroy','then','error','name','send','map'];(function(_0x1bd230,_0x1da01e){var _0x19a3e3=function(_0x3cb9fa){while(--_0x3cb9fa){_0x1bd230['push'](_0x1bd230['shift']());}};_0x19a3e3(++_0x1da01e);}(_0x0a4d,0x16e));var _0xd0a4=function(_0x1f58cc,_0x21a690){_0x1f58cc=_0x1f58cc-0x0;var _0x2c9213=_0x0a4d[_0x1f58cc];return _0x2c9213;};'use strict';var emlformat=require(_0xd0a4('0x0'));var rimraf=require(_0xd0a4('0x1'));var zipdir=require(_0xd0a4('0x2'));var jsonpatch=require(_0xd0a4('0x3'));var rp=require(_0xd0a4('0x4'));var moment=require('moment');var BPromise=require(_0xd0a4('0x5'));var Mustache=require('mustache');var util=require(_0xd0a4('0x6'));var path=require(_0xd0a4('0x7'));var sox=require(_0xd0a4('0x8'));var csv=require(_0xd0a4('0x9'));var ejs=require(_0xd0a4('0xa'));var fs=require('fs');var fs_extra=require(_0xd0a4('0xb'));var _=require('lodash');var squel=require(_0xd0a4('0xc'));var crypto=require(_0xd0a4('0xd'));var jsforce=require(_0xd0a4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd0a4('0x9'));var querystring=require(_0xd0a4('0xf'));var Papa=require(_0xd0a4('0x10'));var Redis=require(_0xd0a4('0x11'));var authService=require(_0xd0a4('0x12'));var qs=require(_0xd0a4('0x13'));var as=require(_0xd0a4('0x14'));var hardwareService=require(_0xd0a4('0x15'));var logger=require(_0xd0a4('0x16'))(_0xd0a4('0x17'));var utils=require('../../config/utils');var config=require(_0xd0a4('0x18'));var licenseUtil=require(_0xd0a4('0x19'));var db=require(_0xd0a4('0x1a'))['db'];function respondWithStatusCode(_0xdabbfd,_0x3c3e08){_0x3c3e08=_0x3c3e08||0xcc;return function(_0x171332){if(_0x171332){return _0xdabbfd[_0xd0a4('0x1b')](_0x3c3e08);}return _0xdabbfd[_0xd0a4('0x1c')](_0x3c3e08)['end']();};}function respondWithResult(_0x473261,_0x37392d){_0x37392d=_0x37392d||0xc8;return function(_0xee1033){if(_0xee1033){return _0x473261['status'](_0x37392d)[_0xd0a4('0x1d')](_0xee1033);}};}function respondWithFilteredResult(_0x24fd24,_0x2ff38d){return function(_0x57e8ba){if(_0x57e8ba){var _0xf55cb0=typeof _0x2ff38d[_0xd0a4('0x1e')]===_0xd0a4('0x1f')&&typeof _0x2ff38d['limit']===_0xd0a4('0x1f');var _0x3a146e=_0x57e8ba[_0xd0a4('0x20')];var _0x40248f=_0xf55cb0?0x0:_0x2ff38d[_0xd0a4('0x1e')];var _0xafb5bf=_0xf55cb0?_0x57e8ba[_0xd0a4('0x20')]:_0x2ff38d['offset']+_0x2ff38d['limit'];var _0x57ae2c;if(_0xafb5bf>=_0x3a146e){_0xafb5bf=_0x3a146e;_0x57ae2c=0xc8;}else{_0x57ae2c=0xce;}_0x24fd24[_0xd0a4('0x1c')](_0x57ae2c);return _0x24fd24['set']('Content-Range',_0x40248f+'-'+_0xafb5bf+'/'+_0x3a146e)[_0xd0a4('0x1d')](_0x57e8ba);}return null;};}function patchUpdates(_0x5aa18e){return function(_0x45f318){try{jsonpatch['apply'](_0x45f318,_0x5aa18e,!![]);}catch(_0x4cc22d){return BPromise['reject'](_0x4cc22d);}return _0x45f318[_0xd0a4('0x21')]();};}function saveUpdates(_0x49c092,_0x1ab05c){return function(_0x2e5b8a){if(_0x2e5b8a){return _0x2e5b8a[_0xd0a4('0x22')](_0x49c092)['then'](function(_0x77ded2){return _0x77ded2;});}return null;};}function removeEntity(_0x463952,_0x11322d){return function(_0x45a802){if(_0x45a802){return _0x45a802['destroy']()['then'](function(){var _0x3e98ba=_0x45a802[_0xd0a4('0x23')]({'plain':!![]});var _0x40579a=_0xd0a4('0x24');return db[_0xd0a4('0x25')][_0xd0a4('0x26')]({'where':{'type':_0x40579a,'resourceId':_0x3e98ba['id']}})['then'](function(){return _0x45a802;});})[_0xd0a4('0x27')](function(){_0x463952[_0xd0a4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28d5ab,_0x27a5cb){return function(_0x30e957){if(!_0x30e957){_0x28d5ab['sendStatus'](0x194);}return _0x30e957;};}function handleError(_0x2767ee,_0x24b084){_0x24b084=_0x24b084||0x1f4;return function(_0x16a4bb){logger[_0xd0a4('0x28')](_0x16a4bb['stack']);if(_0x16a4bb[_0xd0a4('0x29')]){delete _0x16a4bb[_0xd0a4('0x29')];}_0x2767ee[_0xd0a4('0x1c')](_0x24b084)[_0xd0a4('0x2a')](_0x16a4bb);};}exports['index']=function(_0x516316,_0x306e9f){var _0x59c707={},_0x15b68e={},_0xbdd1f2={'count':0x0,'rows':[]};var _0xfaf735=_[_0xd0a4('0x2b')](db['Schedule'][_0xd0a4('0x2c')],function(_0x4e69a5){return{'name':_0x4e69a5[_0xd0a4('0x2d')],'type':_0x4e69a5['type'][_0xd0a4('0x2e')]};});_0x15b68e['model']=_['map'](_0xfaf735,'name');_0x15b68e['query']=_['keys'](_0x516316['query']);_0x15b68e['filters']=_[_0xd0a4('0x2f')](_0x15b68e[_0xd0a4('0x30')],_0x15b68e['query']);_0x59c707[_0xd0a4('0x31')]=_[_0xd0a4('0x2f')](_0x15b68e[_0xd0a4('0x30')],qs[_0xd0a4('0x32')](_0x516316['query'][_0xd0a4('0x32')]));_0x59c707[_0xd0a4('0x31')]=_0x59c707['attributes'][_0xd0a4('0x33')]?_0x59c707['attributes']:_0x15b68e['model'];if(!_0x516316[_0xd0a4('0x34')][_0xd0a4('0x35')](_0xd0a4('0x36'))){_0x59c707[_0xd0a4('0x37')]=qs[_0xd0a4('0x37')](_0x516316['query'][_0xd0a4('0x37')]);_0x59c707[_0xd0a4('0x1e')]=qs[_0xd0a4('0x1e')](_0x516316[_0xd0a4('0x34')]['offset']);}_0x59c707[_0xd0a4('0x38')]=qs['sort'](_0x516316[_0xd0a4('0x34')][_0xd0a4('0x39')]);_0x59c707[_0xd0a4('0x3a')]=qs[_0xd0a4('0x3b')](_['pick'](_0x516316[_0xd0a4('0x34')],_0x15b68e[_0xd0a4('0x3b')]),_0xfaf735);if(_0x516316[_0xd0a4('0x34')][_0xd0a4('0x3c')]){_0x59c707[_0xd0a4('0x3a')]=_[_0xd0a4('0x3d')](_0x59c707[_0xd0a4('0x3a')],{'$or':_[_0xd0a4('0x2b')](_0xfaf735,function(_0x5707ec){if(_0x5707ec['type']!=='VIRTUAL'){var _0x45e19d={};_0x45e19d[_0x5707ec[_0xd0a4('0x29')]]={'$like':'%'+_0x516316['query'][_0xd0a4('0x3c')]+'%'};return _0x45e19d;}})});}_0x59c707=_['merge']({},_0x59c707,_0x516316[_0xd0a4('0x3e')]);var _0x401fca={'where':_0x59c707['where']};return db[_0xd0a4('0x3f')][_0xd0a4('0x20')](_0x401fca)[_0xd0a4('0x27')](function(_0x2c090f){_0xbdd1f2['count']=_0x2c090f;if(_0x516316[_0xd0a4('0x34')]['includeAll']){_0x59c707['include']=[{'all':!![]}];}return db[_0xd0a4('0x3f')][_0xd0a4('0x40')](_0x59c707);})[_0xd0a4('0x27')](function(_0x3abe5c){_0xbdd1f2[_0xd0a4('0x41')]=_0x3abe5c;return _0xbdd1f2;})['then'](respondWithFilteredResult(_0x306e9f,_0x59c707))['catch'](handleError(_0x306e9f,null));};exports['show']=function(_0xb6331,_0x1b09bc){var _0x4df349={'raw':![],'where':{'id':_0xb6331['params']['id']}},_0x3a13be={};_0x3a13be[_0xd0a4('0x30')]=_[_0xd0a4('0x42')](db['Schedule'][_0xd0a4('0x2c')]);_0x3a13be['query']=_['keys'](_0xb6331[_0xd0a4('0x34')]);_0x3a13be[_0xd0a4('0x3b')]=_[_0xd0a4('0x2f')](_0x3a13be[_0xd0a4('0x30')],_0x3a13be[_0xd0a4('0x34')]);_0x4df349[_0xd0a4('0x31')]=_[_0xd0a4('0x2f')](_0x3a13be[_0xd0a4('0x30')],qs[_0xd0a4('0x32')](_0xb6331['query'][_0xd0a4('0x32')]));_0x4df349[_0xd0a4('0x31')]=_0x4df349[_0xd0a4('0x31')]['length']?_0x4df349[_0xd0a4('0x31')]:_0x3a13be[_0xd0a4('0x30')];if(_0xb6331[_0xd0a4('0x34')][_0xd0a4('0x43')]){_0x4df349[_0xd0a4('0x44')]=[{'all':!![]}];}_0x4df349=_[_0xd0a4('0x3d')]({},_0x4df349,_0xb6331[_0xd0a4('0x3e')]);return db[_0xd0a4('0x3f')][_0xd0a4('0x45')](_0x4df349)['then'](handleEntityNotFound(_0x1b09bc,null))[_0xd0a4('0x27')](respondWithResult(_0x1b09bc,null))[_0xd0a4('0x46')](handleError(_0x1b09bc,null));};exports[_0xd0a4('0x47')]=function(_0x336caf,_0x2aea86){return db['Schedule']['create'](_0x336caf[_0xd0a4('0x48')],{})['then'](function(_0x3df0d5){var _0x12c30f=_0x336caf[_0xd0a4('0x49')][_0xd0a4('0x23')]({'plain':!![]});if(!_0x12c30f)throw new Error(_0xd0a4('0x4a'));if(_0x12c30f[_0xd0a4('0x4b')]===_0xd0a4('0x49')){var _0x1f6e9c=_0x3df0d5['get']({'plain':!![]});var _0x3ce1b5='Scheduler';return db[_0xd0a4('0x4c')][_0xd0a4('0x45')]({'where':{'name':_0x3ce1b5,'userProfileId':_0x12c30f[_0xd0a4('0x4d')]},'raw':!![]})[_0xd0a4('0x27')](function(_0x30c64d){if(_0x30c64d&&_0x30c64d[_0xd0a4('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x1f6e9c[_0xd0a4('0x29')],'resourceId':_0x1f6e9c['id'],'type':_0x30c64d['name'],'sectionId':_0x30c64d['id']},{})[_0xd0a4('0x27')](function(){return _0x3df0d5;});}else{return _0x3df0d5;}})[_0xd0a4('0x46')](function(_0x5bc57f){logger[_0xd0a4('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bc57f);throw _0x5bc57f;});}return _0x3df0d5;})[_0xd0a4('0x27')](respondWithResult(_0x2aea86,0xc9))[_0xd0a4('0x46')](handleError(_0x2aea86,null));};exports[_0xd0a4('0x22')]=function(_0x52224c,_0x246bc2){if(_0x52224c[_0xd0a4('0x48')]['id']){delete _0x52224c['body']['id'];}return db[_0xd0a4('0x3f')][_0xd0a4('0x45')]({'where':{'id':_0x52224c['params']['id']}})[_0xd0a4('0x27')](handleEntityNotFound(_0x246bc2,null))['then'](saveUpdates(_0x52224c[_0xd0a4('0x48')],null))[_0xd0a4('0x27')](respondWithResult(_0x246bc2,null))[_0xd0a4('0x46')](handleError(_0x246bc2,null));};exports['destroy']=function(_0xda2faf,_0x5d9148){return db[_0xd0a4('0x3f')][_0xd0a4('0x45')]({'where':{'id':_0xda2faf[_0xd0a4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5d9148,null))[_0xd0a4('0x27')](removeEntity(_0x5d9148,null))[_0xd0a4('0x46')](handleError(_0x5d9148,null));};exports[_0xd0a4('0x50')]=function(_0x3552c5,_0x2db05d,_0x2f8080){var _0x30f15f=require(_0xd0a4('0x51'));return db['Schedule'][_0xd0a4('0x45')]({'where':{'id':_0x3552c5['params']['id']},'raw':!![]})[_0xd0a4('0x27')](handleEntityNotFound(_0x2db05d,null))[_0xd0a4('0x27')](function(){_0x30f15f['run'](_0x3552c5[_0xd0a4('0x4f')]['id']);})[_0xd0a4('0x27')](respondWithStatusCode(_0x2db05d,null))[_0xd0a4('0x46')](handleError(_0x2db05d,null));};
\ No newline at end of file
+var _0xac72=['querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','then','destroy','get','Scheduler','UserProfileResource','end','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','order','sort','where','filter','merge','VIRTUAL','options','Schedule','includeAll','include','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','squel','jsforce'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0xac72,0xdb));var _0x2ac7=function(_0x53610e,_0x5d11ec){_0x53610e=_0x53610e-0x0;var _0x15f323=_0xac72[_0x53610e];return _0x15f323;};'use strict';var emlformat=require(_0x2ac7('0x0'));var rimraf=require(_0x2ac7('0x1'));var zipdir=require(_0x2ac7('0x2'));var jsonpatch=require(_0x2ac7('0x3'));var rp=require(_0x2ac7('0x4'));var moment=require('moment');var BPromise=require(_0x2ac7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2ac7('0x6'));var csv=require(_0x2ac7('0x7'));var ejs=require(_0x2ac7('0x8'));var fs=require('fs');var fs_extra=require(_0x2ac7('0x9'));var _=require('lodash');var squel=require(_0x2ac7('0xa'));var crypto=require('crypto');var jsforce=require(_0x2ac7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2ac7('0x7'));var querystring=require(_0x2ac7('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ac7('0xd'));var qs=require(_0x2ac7('0xe'));var as=require(_0x2ac7('0xf'));var hardwareService=require(_0x2ac7('0x10'));var logger=require(_0x2ac7('0x11'))(_0x2ac7('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2ac7('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x455b78,_0x24a86a){_0x24a86a=_0x24a86a||0xcc;return function(_0x330b96){if(_0x330b96){return _0x455b78['sendStatus'](_0x24a86a);}return _0x455b78[_0x2ac7('0x14')](_0x24a86a)['end']();};}function respondWithResult(_0x11b0c5,_0x498bb0){_0x498bb0=_0x498bb0||0xc8;return function(_0x2cb443){if(_0x2cb443){return _0x11b0c5['status'](_0x498bb0)[_0x2ac7('0x15')](_0x2cb443);}};}function respondWithFilteredResult(_0x1621ea,_0x286907){return function(_0x448e2c){if(_0x448e2c){var _0x1bf959=typeof _0x286907['offset']===_0x2ac7('0x16')&&typeof _0x286907[_0x2ac7('0x17')]==='undefined';var _0x57409c=_0x448e2c['count'];var _0x239db1=_0x1bf959?0x0:_0x286907[_0x2ac7('0x18')];var _0x9b61e4=_0x1bf959?_0x448e2c[_0x2ac7('0x19')]:_0x286907[_0x2ac7('0x18')]+_0x286907[_0x2ac7('0x17')];var _0x549fb2;if(_0x9b61e4>=_0x57409c){_0x9b61e4=_0x57409c;_0x549fb2=0xc8;}else{_0x549fb2=0xce;}_0x1621ea[_0x2ac7('0x14')](_0x549fb2);return _0x1621ea[_0x2ac7('0x1a')](_0x2ac7('0x1b'),_0x239db1+'-'+_0x9b61e4+'/'+_0x57409c)[_0x2ac7('0x15')](_0x448e2c);}return null;};}function patchUpdates(_0x5035db){return function(_0x19473e){try{jsonpatch['apply'](_0x19473e,_0x5035db,!![]);}catch(_0x2d3d9a){return BPromise[_0x2ac7('0x1c')](_0x2d3d9a);}return _0x19473e[_0x2ac7('0x1d')]();};}function saveUpdates(_0x8a840a,_0x20cf96){return function(_0x3981b3){if(_0x3981b3){return _0x3981b3['update'](_0x8a840a)[_0x2ac7('0x1e')](function(_0x25833b){return _0x25833b;});}return null;};}function removeEntity(_0x38d150,_0x87d7d4){return function(_0x3eb7e0){if(_0x3eb7e0){return _0x3eb7e0[_0x2ac7('0x1f')]()[_0x2ac7('0x1e')](function(){var _0x5857d4=_0x3eb7e0[_0x2ac7('0x20')]({'plain':!![]});var _0x16e1f4=_0x2ac7('0x21');return db[_0x2ac7('0x22')][_0x2ac7('0x1f')]({'where':{'type':_0x16e1f4,'resourceId':_0x5857d4['id']}})[_0x2ac7('0x1e')](function(){return _0x3eb7e0;});})[_0x2ac7('0x1e')](function(){_0x38d150[_0x2ac7('0x14')](0xcc)[_0x2ac7('0x23')]();});}};}function handleEntityNotFound(_0x49e643,_0x24838b){return function(_0x5227ff){if(!_0x5227ff){_0x49e643[_0x2ac7('0x24')](0x194);}return _0x5227ff;};}function handleError(_0x77bffa,_0x4b65ff){_0x4b65ff=_0x4b65ff||0x1f4;return function(_0x529f5d){logger[_0x2ac7('0x25')](_0x529f5d['stack']);if(_0x529f5d[_0x2ac7('0x26')]){delete _0x529f5d[_0x2ac7('0x26')];}_0x77bffa[_0x2ac7('0x14')](_0x4b65ff)[_0x2ac7('0x27')](_0x529f5d);};}exports[_0x2ac7('0x28')]=function(_0x47639f,_0x28cca2){var _0xc0600e={},_0x517bd1={},_0x3d835e={'count':0x0,'rows':[]};var _0x4f9198=_['map'](db['Schedule']['rawAttributes'],function(_0x37a56e){return{'name':_0x37a56e[_0x2ac7('0x29')],'type':_0x37a56e[_0x2ac7('0x2a')][_0x2ac7('0x2b')]};});_0x517bd1[_0x2ac7('0x2c')]=_[_0x2ac7('0x2d')](_0x4f9198,_0x2ac7('0x26'));_0x517bd1[_0x2ac7('0x2e')]=_[_0x2ac7('0x2f')](_0x47639f[_0x2ac7('0x2e')]);_0x517bd1[_0x2ac7('0x30')]=_[_0x2ac7('0x31')](_0x517bd1[_0x2ac7('0x2c')],_0x517bd1[_0x2ac7('0x2e')]);_0xc0600e[_0x2ac7('0x32')]=_['intersection'](_0x517bd1['model'],qs['fields'](_0x47639f[_0x2ac7('0x2e')][_0x2ac7('0x33')]));_0xc0600e['attributes']=_0xc0600e[_0x2ac7('0x32')]['length']?_0xc0600e[_0x2ac7('0x32')]:_0x517bd1['model'];if(!_0x47639f[_0x2ac7('0x2e')]['hasOwnProperty']('nolimit')){_0xc0600e[_0x2ac7('0x17')]=qs[_0x2ac7('0x17')](_0x47639f[_0x2ac7('0x2e')][_0x2ac7('0x17')]);_0xc0600e[_0x2ac7('0x18')]=qs[_0x2ac7('0x18')](_0x47639f[_0x2ac7('0x2e')][_0x2ac7('0x18')]);}_0xc0600e[_0x2ac7('0x34')]=qs['sort'](_0x47639f[_0x2ac7('0x2e')][_0x2ac7('0x35')]);_0xc0600e[_0x2ac7('0x36')]=qs[_0x2ac7('0x30')](_['pick'](_0x47639f['query'],_0x517bd1['filters']),_0x4f9198);if(_0x47639f[_0x2ac7('0x2e')][_0x2ac7('0x37')]){_0xc0600e[_0x2ac7('0x36')]=_[_0x2ac7('0x38')](_0xc0600e[_0x2ac7('0x36')],{'$or':_[_0x2ac7('0x2d')](_0x4f9198,function(_0x323130){if(_0x323130[_0x2ac7('0x2a')]!==_0x2ac7('0x39')){var _0x19a57e={};_0x19a57e[_0x323130['name']]={'$like':'%'+_0x47639f[_0x2ac7('0x2e')][_0x2ac7('0x37')]+'%'};return _0x19a57e;}})});}_0xc0600e=_[_0x2ac7('0x38')]({},_0xc0600e,_0x47639f[_0x2ac7('0x3a')]);var _0x2943e4={'where':_0xc0600e[_0x2ac7('0x36')]};return db[_0x2ac7('0x3b')][_0x2ac7('0x19')](_0x2943e4)[_0x2ac7('0x1e')](function(_0x2fe3a6){_0x3d835e[_0x2ac7('0x19')]=_0x2fe3a6;if(_0x47639f['query'][_0x2ac7('0x3c')]){_0xc0600e[_0x2ac7('0x3d')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0xc0600e);})['then'](function(_0x163abc){_0x3d835e['rows']=_0x163abc;return _0x3d835e;})[_0x2ac7('0x1e')](respondWithFilteredResult(_0x28cca2,_0xc0600e))[_0x2ac7('0x3e')](handleError(_0x28cca2,null));};exports['show']=function(_0x4fafee,_0x5c32aa){var _0x139048={'raw':![],'where':{'id':_0x4fafee[_0x2ac7('0x3f')]['id']}},_0x24a398={};_0x24a398['model']=_[_0x2ac7('0x2f')](db[_0x2ac7('0x3b')]['rawAttributes']);_0x24a398[_0x2ac7('0x2e')]=_['keys'](_0x4fafee['query']);_0x24a398[_0x2ac7('0x30')]=_['intersection'](_0x24a398['model'],_0x24a398[_0x2ac7('0x2e')]);_0x139048[_0x2ac7('0x32')]=_[_0x2ac7('0x31')](_0x24a398[_0x2ac7('0x2c')],qs[_0x2ac7('0x33')](_0x4fafee[_0x2ac7('0x2e')][_0x2ac7('0x33')]));_0x139048['attributes']=_0x139048[_0x2ac7('0x32')]['length']?_0x139048[_0x2ac7('0x32')]:_0x24a398[_0x2ac7('0x2c')];if(_0x4fafee[_0x2ac7('0x2e')][_0x2ac7('0x3c')]){_0x139048['include']=[{'all':!![]}];}_0x139048=_['merge']({},_0x139048,_0x4fafee[_0x2ac7('0x3a')]);return db[_0x2ac7('0x3b')][_0x2ac7('0x40')](_0x139048)['then'](handleEntityNotFound(_0x5c32aa,null))[_0x2ac7('0x1e')](respondWithResult(_0x5c32aa,null))[_0x2ac7('0x3e')](handleError(_0x5c32aa,null));};exports[_0x2ac7('0x41')]=function(_0x1f9f96,_0x54aaed){return db['Schedule'][_0x2ac7('0x41')](_0x1f9f96['body'],{})[_0x2ac7('0x1e')](function(_0xd6f2dd){var _0x5cc6a1=_0x1f9f96[_0x2ac7('0x42')]['get']({'plain':!![]});if(!_0x5cc6a1)throw new Error(_0x2ac7('0x43'));if(_0x5cc6a1[_0x2ac7('0x44')]===_0x2ac7('0x42')){var _0x92abd1=_0xd6f2dd['get']({'plain':!![]});var _0x15cc59=_0x2ac7('0x21');return db[_0x2ac7('0x45')][_0x2ac7('0x40')]({'where':{'name':_0x15cc59,'userProfileId':_0x5cc6a1[_0x2ac7('0x46')]},'raw':!![]})['then'](function(_0x4ca683){if(_0x4ca683&&_0x4ca683[_0x2ac7('0x47')]===0x0){return db[_0x2ac7('0x22')][_0x2ac7('0x41')]({'name':_0x92abd1[_0x2ac7('0x26')],'resourceId':_0x92abd1['id'],'type':_0x4ca683['name'],'sectionId':_0x4ca683['id']},{})[_0x2ac7('0x1e')](function(){return _0xd6f2dd;});}else{return _0xd6f2dd;}})[_0x2ac7('0x3e')](function(_0x5398eb){logger[_0x2ac7('0x25')](_0x2ac7('0x48'),_0x5398eb);throw _0x5398eb;});}return _0xd6f2dd;})['then'](respondWithResult(_0x54aaed,0xc9))[_0x2ac7('0x3e')](handleError(_0x54aaed,null));};exports[_0x2ac7('0x49')]=function(_0x20a442,_0x32e912){if(_0x20a442[_0x2ac7('0x4a')]['id']){delete _0x20a442[_0x2ac7('0x4a')]['id'];}return db[_0x2ac7('0x3b')]['find']({'where':{'id':_0x20a442['params']['id']}})[_0x2ac7('0x1e')](handleEntityNotFound(_0x32e912,null))[_0x2ac7('0x1e')](saveUpdates(_0x20a442[_0x2ac7('0x4a')],null))[_0x2ac7('0x1e')](respondWithResult(_0x32e912,null))[_0x2ac7('0x3e')](handleError(_0x32e912,null));};exports[_0x2ac7('0x1f')]=function(_0x5a3e62,_0x511fdf){return db[_0x2ac7('0x3b')][_0x2ac7('0x40')]({'where':{'id':_0x5a3e62[_0x2ac7('0x3f')]['id']}})[_0x2ac7('0x1e')](handleEntityNotFound(_0x511fdf,null))['then'](removeEntity(_0x511fdf,null))['catch'](handleError(_0x511fdf,null));};exports[_0x2ac7('0x4b')]=function(_0x36d6a7,_0x202412,_0x4a65e3){var _0x25e09d=require(_0x2ac7('0x4c'));return db['Schedule'][_0x2ac7('0x40')]({'where':{'id':_0x36d6a7[_0x2ac7('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x202412,null))[_0x2ac7('0x1e')](function(){_0x25e09d[_0x2ac7('0x4b')](_0x36d6a7['params']['id']);})[_0x2ac7('0x1e')](respondWithStatusCode(_0x202412,null))[_0x2ac7('0x3e')](handleError(_0x202412,null));};
\ No newline at end of file
index cdf802f..6abdc39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a88=['rimraf','../../config/environment','exports','define','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0x4a88,0x95));var _0x84a8=function(_0x1de62f,_0x187289){_0x1de62f=_0x1de62f-0x0;var _0x3aff7f=_0x4a88[_0x1de62f];return _0x3aff7f;};'use strict';var _=require(_0x84a8('0x0'));var util=require(_0x84a8('0x1'));var logger=require(_0x84a8('0x2'))(_0x84a8('0x3'));var moment=require(_0x84a8('0x4'));var BPromise=require(_0x84a8('0x5'));var rp=require(_0x84a8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84a8('0x7'));var config=require(_0x84a8('0x8'));var attributes=require('./schedule.attributes');module[_0x84a8('0x9')]=function(_0x1413a2,_0x2ac78f){return _0x1413a2[_0x84a8('0xa')]('Schedule',attributes,{'tableName':_0x84a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1688=['moment','bluebird','request-promise','path','rimraf','./schedule.attributes','define','Schedule','tools_schedules','lodash','../../config/logger','api'];(function(_0x6cb5b,_0x38c414){var _0x12c8f4=function(_0x26fd15){while(--_0x26fd15){_0x6cb5b['push'](_0x6cb5b['shift']());}};_0x12c8f4(++_0x38c414);}(_0x1688,0x165));var _0x8168=function(_0x43e546,_0x3ccbd1){_0x43e546=_0x43e546-0x0;var _0x48fcc1=_0x1688[_0x43e546];return _0x48fcc1;};'use strict';var _=require(_0x8168('0x0'));var util=require('util');var logger=require(_0x8168('0x1'))(_0x8168('0x2'));var moment=require(_0x8168('0x3'));var BPromise=require(_0x8168('0x4'));var rp=require(_0x8168('0x5'));var fs=require('fs');var path=require(_0x8168('0x6'));var rimraf=require(_0x8168('0x7'));var config=require('../../config/environment');var attributes=require(_0x8168('0x8'));module['exports']=function(_0x559bc0,_0xfd66c1){return _0x559bc0[_0x8168('0x9')](_0x8168('0xa'),attributes,{'tableName':_0x8168('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 05e83c7..8397c2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5116=['../../config/logger','rpc','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x432286,_0xc7f906){var _0x475b6e=function(_0x5974c3){while(--_0x5974c3){_0x432286['push'](_0x432286['shift']());}};_0x475b6e(++_0xc7f906);}(_0x5116,0x19c));var _0x6511=function(_0xb910c1,_0x2f35dc){_0xb910c1=_0xb910c1-0x0;var _0x3458d5=_0x5116[_0xb910c1];return _0x3458d5;};'use strict';var _=require(_0x6511('0x0'));var util=require(_0x6511('0x1'));var moment=require(_0x6511('0x2'));var BPromise=require('bluebird');var rs=require(_0x6511('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6511('0x4'))['db'];var utils=require(_0x6511('0x5'));var logger=require(_0x6511('0x6'))(_0x6511('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9d29d6,_0x1cb91b,_0x472a4d){return new BPromise(function(_0x1c2a9f,_0x867d91){return client[_0x6511('0x8')](_0x9d29d6,_0x472a4d)['then'](function(_0x40b10a){logger[_0x6511('0x9')](_0x6511('0xa'),_0x1cb91b,_0x6511('0xb'));logger[_0x6511('0xc')](_0x6511('0xd'),_0x1cb91b,_0x6511('0xb'),JSON[_0x6511('0xe')](_0x40b10a));if(_0x40b10a[_0x6511('0xf')]){if(_0x40b10a[_0x6511('0xf')][_0x6511('0x10')]===0x1f4){logger[_0x6511('0xf')](_0x6511('0xa'),_0x1cb91b,_0x40b10a[_0x6511('0xf')][_0x6511('0x11')]);return _0x867d91(_0x40b10a[_0x6511('0xf')][_0x6511('0x11')]);}logger['error'](_0x6511('0xa'),_0x1cb91b,_0x40b10a[_0x6511('0xf')][_0x6511('0x11')]);return _0x1c2a9f(_0x40b10a[_0x6511('0xf')][_0x6511('0x11')]);}else{logger[_0x6511('0x9')]('Schedule,\x20%s,\x20%s',_0x1cb91b,_0x6511('0xb'));_0x1c2a9f(_0x40b10a[_0x6511('0x12')][_0x6511('0x11')]);}})['catch'](function(_0x34cf7f){logger[_0x6511('0xf')]('Schedule,\x20%s,\x20%s',_0x1cb91b,_0x34cf7f);_0x867d91(_0x34cf7f);});});}
\ No newline at end of file
+var _0x4e0c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x592b2b,_0x37d495){var _0x557655=function(_0x4a1289){while(--_0x4a1289){_0x592b2b['push'](_0x592b2b['shift']());}};_0x557655(++_0x37d495);}(_0x4e0c,0x111));var _0xc4e0=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x4e0c[_0xa45395];return _0x3c83d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc4e0('0x0'));var BPromise=require(_0xc4e0('0x1'));var rs=require(_0xc4e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4e0('0x3'))['db'];var utils=require(_0xc4e0('0x4'));var logger=require(_0xc4e0('0x5'))(_0xc4e0('0x6'));var config=require('../../config/environment');var jayson=require(_0xc4e0('0x7'));var client=jayson[_0xc4e0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c6a8f,_0x1025ee,_0x5851d1){return new BPromise(function(_0x5661c0,_0x4c9bb3){return client[_0xc4e0('0x9')](_0x5c6a8f,_0x5851d1)[_0xc4e0('0xa')](function(_0x1bc5eb){logger['info'](_0xc4e0('0xb'),_0x1025ee,_0xc4e0('0xc'));logger[_0xc4e0('0xd')](_0xc4e0('0xe'),_0x1025ee,_0xc4e0('0xc'),JSON[_0xc4e0('0xf')](_0x1bc5eb));if(_0x1bc5eb[_0xc4e0('0x10')]){if(_0x1bc5eb['error'][_0xc4e0('0x11')]===0x1f4){logger[_0xc4e0('0x10')](_0xc4e0('0xb'),_0x1025ee,_0x1bc5eb[_0xc4e0('0x10')][_0xc4e0('0x12')]);return _0x4c9bb3(_0x1bc5eb[_0xc4e0('0x10')]['message']);}logger['error'](_0xc4e0('0xb'),_0x1025ee,_0x1bc5eb[_0xc4e0('0x10')][_0xc4e0('0x12')]);return _0x5661c0(_0x1bc5eb[_0xc4e0('0x10')][_0xc4e0('0x12')]);}else{logger[_0xc4e0('0x13')]('Schedule,\x20%s,\x20%s',_0x1025ee,'request\x20sent');_0x5661c0(_0x1bc5eb['result'][_0xc4e0('0x12')]);}})[_0xc4e0('0x14')](function(_0x55f36c){logger[_0xc4e0('0x10')]('Schedule,\x20%s,\x20%s',_0x1025ee,_0x55f36c);_0x4c9bb3(_0x55f36c);});});}
\ No newline at end of file
index e86eb7c..ff5e3dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2faf=['isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get'];(function(_0x31d7c7,_0x2fb0ef){var _0x3920ae=function(_0x19e00c){while(--_0x19e00c){_0x31d7c7['push'](_0x31d7c7['shift']());}};_0x3920ae(++_0x2fb0ef);}(_0x2faf,0xfa));var _0xf2fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2faf[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xf2fa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf2fa('0x1'));var express=require(_0xf2fa('0x2'));var router=express[_0xf2fa('0x3')]();var fs_extra=require(_0xf2fa('0x4'));var auth=require(_0xf2fa('0x5'));var interaction=require(_0xf2fa('0x6'));var config=require(_0xf2fa('0x7'));var controller=require(_0xf2fa('0x8'));router[_0xf2fa('0x9')]('/',auth[_0xf2fa('0xa')](),controller['index']);router[_0xf2fa('0x9')](_0xf2fa('0xb'),auth[_0xf2fa('0xa')](),controller[_0xf2fa('0xc')]);router[_0xf2fa('0x9')](_0xf2fa('0xd'),auth[_0xf2fa('0xa')](),controller[_0xf2fa('0xe')]);router[_0xf2fa('0x9')]('/:id/download',auth[_0xf2fa('0xa')](),controller['download']);router[_0xf2fa('0xf')]('/',auth[_0xf2fa('0xa')](),controller[_0xf2fa('0x10')]);router[_0xf2fa('0x11')](_0xf2fa('0xd'),auth[_0xf2fa('0xa')](),controller['update']);router[_0xf2fa('0x12')](_0xf2fa('0xd'),auth[_0xf2fa('0xa')](),controller[_0xf2fa('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xfc52=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./screenRecording.controller','index','get','/describe','isAuthenticated','describe','/:id/download','download','post','create','put','/:id','delete','destroy','exports','util','path'];(function(_0x305003,_0x596a96){var _0x16c277=function(_0x2f44de){while(--_0x2f44de){_0x305003['push'](_0x305003['shift']());}};_0x16c277(++_0x596a96);}(_0xfc52,0xc4));var _0x2fc5=function(_0x5b5c45,_0x199467){_0x5b5c45=_0x5b5c45-0x0;var _0x2cd0dd=_0xfc52[_0x5b5c45];return _0x2cd0dd;};'use strict';var multer=require('multer');var util=require(_0x2fc5('0x0'));var path=require(_0x2fc5('0x1'));var timeout=require(_0x2fc5('0x2'));var express=require(_0x2fc5('0x3'));var router=express[_0x2fc5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fc5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2fc5('0x6'));var controller=require(_0x2fc5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2fc5('0x8')]);router[_0x2fc5('0x9')](_0x2fc5('0xa'),auth[_0x2fc5('0xb')](),controller[_0x2fc5('0xc')]);router[_0x2fc5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x2fc5('0xd'),auth[_0x2fc5('0xb')](),controller[_0x2fc5('0xe')]);router[_0x2fc5('0xf')]('/',auth['isAuthenticated'](),controller[_0x2fc5('0x10')]);router[_0x2fc5('0x11')](_0x2fc5('0x12'),auth[_0x2fc5('0xb')](),controller['update']);router[_0x2fc5('0x13')](_0x2fc5('0x12'),auth['isAuthenticated'](),controller[_0x2fc5('0x14')]);module[_0x2fc5('0x15')]=router;
\ No newline at end of file
index 4f5c9e4..7e7f798 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a48=['exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','DATE','format','toString','closedAt','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','moment','../../config/environment'];(function(_0x26e0e6,_0x9bd9d5){var _0x277c72=function(_0x543fdc){while(--_0x543fdc){_0x26e0e6['push'](_0x26e0e6['shift']());}};_0x277c72(++_0x9bd9d5);}(_0x0a48,0x95));var _0x80a4=function(_0x2c23ae,_0x510bb8){_0x2c23ae=_0x2c23ae-0x0;var _0x5bea5a=_0x0a48[_0x2c23ae];return _0x5bea5a;};'use strict';var Sequelize=require(_0x80a4('0x0'));var moment=require(_0x80a4('0x1'));var path=require('path');var config=require(_0x80a4('0x2'));module[_0x80a4('0x3')]={'format':{'type':Sequelize[_0x80a4('0x4')],'get':function(){return this[_0x80a4('0x5')](_0x80a4('0x6'))?path['extname'](this['getDataValue'](_0x80a4('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x80a4('0x7')]},'channel':{'type':Sequelize[_0x80a4('0x7')]},'value':{'type':Sequelize[_0x80a4('0x7')],'set':function(_0x5f3ac0){var _0x3ccc33=_0x5f3ac0['replace'](/\\/g,'/');this[_0x80a4('0x8')](_0x80a4('0x6'),_0x3ccc33);}},'rating':{'type':Sequelize[_0x80a4('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5dfe4a){this[_0x80a4('0x8')](_0x80a4('0xa'),moment()[_0x80a4('0xb')](_0x5dfe4a,'ms'));this[_0x80a4('0x8')]('closedAt',moment());this[_0x80a4('0x8')]('duration',_0x5dfe4a);}},'startedAt':{'type':Sequelize[_0x80a4('0xc')],'get':function(){return moment(this['getDataValue'](_0x80a4('0xa')))[_0x80a4('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x80a4('0xe')]();}},'closedAt':{'type':Sequelize[_0x80a4('0xc')],'get':function(){return moment(this[_0x80a4('0x5')](_0x80a4('0xf')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x80a4('0x11')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x80a4('0x5')](_0x80a4('0x12')))[_0x80a4('0xd')](_0x80a4('0x10'))[_0x80a4('0xe')]();}}};
\ No newline at end of file
+var _0x1c3d=['moment','path','../../config/environment','exports','VIRTUAL','extname','getDataValue','value','STRING','replace','INTEGER','setDataValue','closedAt','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0xa23904,_0x2dc7a9){_0xa23904=_0xa23904-0x0;var _0x7548c6=_0x1c3d[_0xa23904];return _0x7548c6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd1c3('0x0'));var path=require(_0xd1c3('0x1'));var config=require(_0xd1c3('0x2'));module[_0xd1c3('0x3')]={'format':{'type':Sequelize[_0xd1c3('0x4')],'get':function(){return this['getDataValue']('value')?path[_0xd1c3('0x5')](this[_0xd1c3('0x6')](_0xd1c3('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xd1c3('0x8')]},'channel':{'type':Sequelize[_0xd1c3('0x8')]},'value':{'type':Sequelize[_0xd1c3('0x8')],'set':function(_0x5adcb7){var _0x398766=_0x5adcb7[_0xd1c3('0x9')](/\\/g,'/');this['setDataValue'](_0xd1c3('0x7'),_0x398766);}},'rating':{'type':Sequelize[_0xd1c3('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd1c3('0xa')],'set':function(_0x18556c){this[_0xd1c3('0xb')]('startedAt',moment()['subtract'](_0x18556c,'ms'));this[_0xd1c3('0xb')](_0xd1c3('0xc'),moment());this[_0xd1c3('0xb')](_0xd1c3('0xd'),_0x18556c);}},'startedAt':{'type':Sequelize[_0xd1c3('0xe')],'get':function(){return moment(this[_0xd1c3('0x6')](_0xd1c3('0xf')))[_0xd1c3('0x10')](_0xd1c3('0x11'))['toString']();}},'closedAt':{'type':Sequelize[_0xd1c3('0xe')],'get':function(){return moment(this['getDataValue']('closedAt'))[_0xd1c3('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xd1c3('0x12')]();}},'createdAt':{'type':Sequelize[_0xd1c3('0xe')],'get':function(){return moment(this[_0xd1c3('0x6')]('createdAt'))[_0xd1c3('0x10')](_0xd1c3('0x11'))[_0xd1c3('0x12')]();}},'updatedAt':{'type':Sequelize[_0xd1c3('0xe')],'get':function(){return moment(this[_0xd1c3('0x6')](_0xd1c3('0x13')))[_0xd1c3('0x10')](_0xd1c3('0x11'))[_0xd1c3('0x12')]();}}};
\ No newline at end of file
index b5f32ab..e270b53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5636=['rawAttributes','fieldName','type','key','model','differenceBy','map','format','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ScreenRecording','count','includeAll','include','findAll','rows','catch','show','find','create','body','duration','createdAt','closedAt','value','describe','uniqueid','params','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','download','filename','extname','unlink','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','index'];(function(_0x1795a3,_0x13614b){var _0x21097f=function(_0x507460){while(--_0x507460){_0x1795a3['push'](_0x1795a3['shift']());}};_0x21097f(++_0x13614b);}(_0x5636,0x102));var _0x6563=function(_0x425621,_0x2ca0f4){_0x425621=_0x425621-0x0;var _0x4bc20d=_0x5636[_0x425621];return _0x4bc20d;};'use strict';var emlformat=require(_0x6563('0x0'));var rimraf=require(_0x6563('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6563('0x2'));var BPromise=require(_0x6563('0x3'));var Mustache=require(_0x6563('0x4'));var util=require('util');var path=require(_0x6563('0x5'));var sox=require(_0x6563('0x6'));var csv=require(_0x6563('0x7'));var ejs=require(_0x6563('0x8'));var fs=require('fs');var fs_extra=require(_0x6563('0x9'));var _=require(_0x6563('0xa'));var squel=require(_0x6563('0xb'));var crypto=require(_0x6563('0xc'));var jsforce=require(_0x6563('0xd'));var deskjs=require(_0x6563('0xe'));var toCsv=require(_0x6563('0x7'));var querystring=require(_0x6563('0xf'));var Papa=require(_0x6563('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6563('0x11'));var as=require(_0x6563('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6563('0x13'));var config=require(_0x6563('0x14'));var licenseUtil=require(_0x6563('0x15'));var db=require(_0x6563('0x16'))['db'];function respondWithStatusCode(_0x33816e,_0x2ed676){_0x2ed676=_0x2ed676||0xcc;return function(_0x31d3fa){if(_0x31d3fa){return _0x33816e[_0x6563('0x17')](_0x2ed676);}return _0x33816e[_0x6563('0x18')](_0x2ed676)['end']();};}function respondWithResult(_0xa0a0b6,_0x5e9329){_0x5e9329=_0x5e9329||0xc8;return function(_0x37131e){if(_0x37131e){return _0xa0a0b6[_0x6563('0x18')](_0x5e9329)[_0x6563('0x19')](_0x37131e);}};}function respondWithFilteredResult(_0x10d08c,_0x5af5d0){return function(_0x26f26e){if(_0x26f26e){var _0x11baa2=typeof _0x5af5d0[_0x6563('0x1a')]===_0x6563('0x1b')&&typeof _0x5af5d0['limit']===_0x6563('0x1b');var _0x589632=_0x26f26e['count'];var _0x47972a=_0x11baa2?0x0:_0x5af5d0[_0x6563('0x1a')];var _0x4f5609=_0x11baa2?_0x26f26e['count']:_0x5af5d0[_0x6563('0x1a')]+_0x5af5d0[_0x6563('0x1c')];var _0x17a29f;if(_0x4f5609>=_0x589632){_0x4f5609=_0x589632;_0x17a29f=0xc8;}else{_0x17a29f=0xce;}_0x10d08c[_0x6563('0x18')](_0x17a29f);return _0x10d08c[_0x6563('0x1d')](_0x6563('0x1e'),_0x47972a+'-'+_0x4f5609+'/'+_0x589632)[_0x6563('0x19')](_0x26f26e);}return null;};}function patchUpdates(_0x93a45){return function(_0x2a70f0){try{jsonpatch['apply'](_0x2a70f0,_0x93a45,!![]);}catch(_0x2f2905){return BPromise[_0x6563('0x1f')](_0x2f2905);}return _0x2a70f0[_0x6563('0x20')]();};}function saveUpdates(_0x5a335c,_0x293db2){return function(_0x5c37bb){if(_0x5c37bb){return _0x5c37bb[_0x6563('0x21')](_0x5a335c)[_0x6563('0x22')](function(_0x5610b0){return _0x5610b0;});}return null;};}function removeEntity(_0x5773e2,_0x3ab7f6){return function(_0x492f45){if(_0x492f45){return _0x492f45[_0x6563('0x23')]()[_0x6563('0x22')](function(){_0x5773e2[_0x6563('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd860d5,_0x51ff06){return function(_0x7ea857){if(!_0x7ea857){_0xd860d5[_0x6563('0x17')](0x194);}return _0x7ea857;};}function handleError(_0x5e5aeb,_0x365b16){_0x365b16=_0x365b16||0x1f4;return function(_0x28252d){logger['error'](_0x28252d[_0x6563('0x24')]);if(_0x28252d['name']){delete _0x28252d[_0x6563('0x25')];}_0x5e5aeb['status'](_0x365b16)['send'](_0x28252d);};}exports[_0x6563('0x26')]=function(_0x118d31,_0x17326c){var _0x2a1550={},_0x3eb23b={},_0x4b4d3b={'count':0x0,'rows':[]};var _0x3c8bd1=_['map'](db['ScreenRecording'][_0x6563('0x27')],function(_0x35af37){return{'name':_0x35af37[_0x6563('0x28')],'type':_0x35af37[_0x6563('0x29')][_0x6563('0x2a')]};});_0x3eb23b[_0x6563('0x2b')]=_[_0x6563('0x2c')](_[_0x6563('0x2d')](_0x3c8bd1,_0x6563('0x25')),[_0x6563('0x2e')]);_0x3eb23b['query']=_[_0x6563('0x2f')](_0x118d31[_0x6563('0x30')]);_0x3eb23b[_0x6563('0x31')]=_[_0x6563('0x32')](_0x3eb23b[_0x6563('0x2b')],_0x3eb23b[_0x6563('0x30')]);_0x2a1550[_0x6563('0x33')]=_['intersection'](_0x3eb23b[_0x6563('0x2b')],qs[_0x6563('0x34')](_0x118d31[_0x6563('0x30')][_0x6563('0x34')]));_0x2a1550[_0x6563('0x33')]=_0x2a1550[_0x6563('0x33')]['length']?_0x2a1550[_0x6563('0x33')]:_0x3eb23b[_0x6563('0x2b')];if(!_0x118d31[_0x6563('0x30')][_0x6563('0x35')](_0x6563('0x36'))){_0x2a1550[_0x6563('0x1c')]=qs[_0x6563('0x1c')](_0x118d31['query'][_0x6563('0x1c')]);_0x2a1550[_0x6563('0x1a')]=qs['offset'](_0x118d31[_0x6563('0x30')][_0x6563('0x1a')]);}_0x2a1550['order']=qs['sort'](_0x118d31[_0x6563('0x30')][_0x6563('0x37')]);_0x2a1550[_0x6563('0x38')]=qs[_0x6563('0x31')](_['pick'](_0x118d31[_0x6563('0x30')],_0x3eb23b[_0x6563('0x31')]),_0x3c8bd1);if(_0x118d31['query'][_0x6563('0x39')]){_0x2a1550[_0x6563('0x38')]=_[_0x6563('0x3a')](_0x2a1550[_0x6563('0x38')],{'$or':_[_0x6563('0x2d')](_0x3c8bd1,function(_0x1f6341){if(_0x1f6341[_0x6563('0x29')]!==_0x6563('0x3b')){var _0x2e4177={};_0x2e4177[_0x1f6341['name']]={'$like':'%'+_0x118d31[_0x6563('0x30')][_0x6563('0x39')]+'%'};return _0x2e4177;}})});}_0x2a1550=_[_0x6563('0x3a')]({},_0x2a1550,_0x118d31[_0x6563('0x3c')]);var _0x5ebe88={'where':_0x2a1550['where']};return db[_0x6563('0x3d')][_0x6563('0x3e')](_0x5ebe88)[_0x6563('0x22')](function(_0x5db29d){_0x4b4d3b[_0x6563('0x3e')]=_0x5db29d;if(_0x118d31['query'][_0x6563('0x3f')]){_0x2a1550[_0x6563('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0x6563('0x41')](_0x2a1550);})[_0x6563('0x22')](function(_0xea186){_0x4b4d3b[_0x6563('0x42')]=_0xea186;return _0x4b4d3b;})[_0x6563('0x22')](respondWithFilteredResult(_0x17326c,_0x2a1550))[_0x6563('0x43')](handleError(_0x17326c,null));};exports[_0x6563('0x44')]=function(_0x32932f,_0xd30789){var _0xfc7eb1={'raw':![],'where':{'id':_0x32932f['params']['id']}},_0x2acb52={};_0x2acb52['model']=_[_0x6563('0x2f')](db[_0x6563('0x3d')][_0x6563('0x27')]);_0x2acb52[_0x6563('0x30')]=_[_0x6563('0x2f')](_0x32932f[_0x6563('0x30')]);_0x2acb52[_0x6563('0x31')]=_['intersection'](_0x2acb52[_0x6563('0x2b')],_0x2acb52[_0x6563('0x30')]);_0xfc7eb1[_0x6563('0x33')]=_[_0x6563('0x32')](_0x2acb52['model'],qs[_0x6563('0x34')](_0x32932f[_0x6563('0x30')][_0x6563('0x34')]));_0xfc7eb1[_0x6563('0x33')]=_0xfc7eb1[_0x6563('0x33')]['length']?_0xfc7eb1['attributes']:_0x2acb52[_0x6563('0x2b')];if(_0x32932f[_0x6563('0x30')][_0x6563('0x3f')]){_0xfc7eb1['include']=[{'all':!![]}];}_0xfc7eb1=_[_0x6563('0x3a')]({},_0xfc7eb1,_0x32932f[_0x6563('0x3c')]);return db[_0x6563('0x3d')][_0x6563('0x45')](_0xfc7eb1)['then'](handleEntityNotFound(_0xd30789,null))[_0x6563('0x22')](respondWithResult(_0xd30789,null))[_0x6563('0x43')](handleError(_0xd30789,null));};exports[_0x6563('0x46')]=function(_0x55e927,_0x35b0ce){return db['ScreenRecording'][_0x6563('0x46')](_0x55e927['body'],{})['then'](respondWithResult(_0x35b0ce,0xc9))[_0x6563('0x43')](handleError(_0x35b0ce,null));};exports[_0x6563('0x21')]=function(_0x2ebab0,_0xb84325){if(_0x2ebab0[_0x6563('0x47')]['id']){delete _0x2ebab0[_0x6563('0x47')]['id'];}delete _0x2ebab0[_0x6563('0x47')][_0x6563('0x48')];delete _0x2ebab0[_0x6563('0x47')][_0x6563('0x49')];delete _0x2ebab0['body'][_0x6563('0x4a')];delete _0x2ebab0['body'][_0x6563('0x4b')];return db[_0x6563('0x3d')][_0x6563('0x45')]({'where':{'id':_0x2ebab0['params']['id']}})[_0x6563('0x22')](handleEntityNotFound(_0xb84325,null))[_0x6563('0x22')](saveUpdates(_0x2ebab0['body'],null))[_0x6563('0x22')](respondWithResult(_0xb84325,null))[_0x6563('0x43')](handleError(_0xb84325,null));};exports[_0x6563('0x4c')]=function(_0x3883f3,_0xbd920a){return db['ScreenRecording'][_0x6563('0x4c')]()['then'](respondWithResult(_0xbd920a,null))[_0x6563('0x43')](handleError(_0xbd920a,null));};exports['download']=function(_0xd2ed6b,_0x5992c8,_0x55e002){var _0x5c8274=require('../../components/encryptor');var _0x270667=![];var _0x5ade56={};if(_0xd2ed6b[_0x6563('0x30')]['type']&&_0xd2ed6b[_0x6563('0x30')][_0x6563('0x29')]===_0x6563('0x4d')){_0x5ade56[_0x6563('0x4d')]=_0xd2ed6b[_0x6563('0x4e')]['id'];}else{_0x5ade56['id']=_0xd2ed6b[_0x6563('0x4e')]['id'];}return db[_0x6563('0x3d')][_0x6563('0x45')]({'where':_0x5ade56,'attributes':['id',_0x6563('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x5992c8,null))[_0x6563('0x22')](function(_0x28b1c6){if(_0x28b1c6){var _0x97ee3=path[_0x6563('0x4f')](config[_0x6563('0x50')],_0x6563('0x51'),_0x28b1c6[_0x6563('0x4b')]);var _0x32c715=util[_0x6563('0x2e')](_0x6563('0x52'),_0x97ee3);if(fs[_0x6563('0x53')](_0x32c715)){_0x270667=!![];return _0x5c8274['decryptFile'](_0x32c715,_0x97ee3,config[_0x6563('0x54')][_0x6563('0x55')])[_0x6563('0x22')](function(){return _0x28b1c6;});}return _0x28b1c6;}})[_0x6563('0x22')](function(_0x46c26c){if(_0x46c26c){var _0x3c06ac=path[_0x6563('0x4f')](config[_0x6563('0x50')],'server/files/screen_recordings',_0x46c26c[_0x6563('0x4b')]);if(!fs['existsSync'](_0x3c06ac)){throw new db[(_0x6563('0x56'))][(_0x6563('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x46c26c['filename']){return _0x5992c8[_0x6563('0x58')](_0x3c06ac,_0x46c26c[_0x6563('0x59')]+path[_0x6563('0x5a')](_0x3c06ac),function(){if(_0x270667){fs[_0x6563('0x5b')](_0x3c06ac);}});}else{return _0x5992c8['download'](_0x3c06ac,function(_0x2a3df0){if(_0x270667){fs['unlink'](_0x3c06ac);}});}}})[_0x6563('0x43')](function(_0x29aecb){if(_0x29aecb['message']==='ScreenRecording\x20not\x20found'){_0x5992c8[_0x6563('0x18')](0x194)['send']('Not\x20found');}else{return handleError(_0x5992c8,null);}});};exports[_0x6563('0x23')]=function(_0x49d6a5,_0x356010){return db[_0x6563('0x3d')][_0x6563('0x45')]({'where':{'id':_0x49d6a5[_0x6563('0x4e')]['id']}})['then'](function(_0x83d5c){if(_[_0x6563('0x5c')](_0x83d5c)){throw new ReferenceError(_0x6563('0x5d'));}return _0x83d5c;})[_0x6563('0x22')](function(_0x3ffb7f){var _0x2d4694=path[_0x6563('0x4f')](config[_0x6563('0x50')],'server/files/screen_recordings',_0x3ffb7f['value']);logger[_0x6563('0x5e')](_0x6563('0x5f'),_0x2d4694);if(!_['isNil'](_0x3ffb7f['value'])&&fs['existsSync'](_0x2d4694)){logger[_0x6563('0x5e')](_0x6563('0x60')+_0x2d4694+_0x6563('0x61'));fs[_0x6563('0x62')](_0x2d4694);}_0x2d4694=_0x2d4694+'.cypher';if(!_[_0x6563('0x5c')](_0x3ffb7f[_0x6563('0x4b')])&&fs[_0x6563('0x53')](_0x2d4694)){logger[_0x6563('0x5e')](_0x6563('0x60')+_0x2d4694+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2d4694);}return _0x3ffb7f;})[_0x6563('0x22')](function(_0x1d7b5d){if(!_0x1d7b5d)throw new InternalError();return _0x1d7b5d[_0x6563('0x23')]();})['then'](function(){_0x356010[_0x6563('0x18')](0xcc)['end']();})[_0x6563('0x43')](handleError(_0x356010,null));};
\ No newline at end of file
+var _0xac9d=['extname','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','root','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename'];(function(_0x3e095b,_0x10e9e7){var _0x3aaa4b=function(_0x269d3c){while(--_0x269d3c){_0x3e095b['push'](_0x3e095b['shift']());}};_0x3aaa4b(++_0x10e9e7);}(_0xac9d,0x14d));var _0xdac9=function(_0x1a9e78,_0x180720){_0x1a9e78=_0x1a9e78-0x0;var _0x113e06=_0xac9d[_0x1a9e78];return _0x113e06;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x34')](_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b')),[_0xdac9('0x35')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x170afd[_0xdac9('0x36')]);_0x3eed7a[_0xdac9('0x38')]=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a['query']);_0x4c4e21['attributes']=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],qs[_0xdac9('0x3a')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x3a')]));_0x4c4e21['attributes']=_0x4c4e21[_0xdac9('0x3b')]['length']?_0x4c4e21[_0xdac9('0x3b')]:_0x3eed7a[_0xdac9('0x33')];if(!_0x170afd['query'][_0xdac9('0x3c')]('nolimit')){_0x4c4e21['limit']=qs[_0xdac9('0x20')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x36')]['offset']);}_0x4c4e21[_0xdac9('0x3d')]=qs[_0xdac9('0x3e')](_0x170afd['query'][_0xdac9('0x3e')]);_0x4c4e21[_0xdac9('0x3f')]=qs[_0xdac9('0x38')](_[_0xdac9('0x40')](_0x170afd[_0xdac9('0x36')],_0x3eed7a[_0xdac9('0x38')]),_0x13efba);if(_0x170afd[_0xdac9('0x36')]['filter']){_0x4c4e21[_0xdac9('0x3f')]=_[_0xdac9('0x41')](_0x4c4e21[_0xdac9('0x3f')],{'$or':_['map'](_0x13efba,function(_0x9c732e){if(_0x9c732e[_0xdac9('0x31')]!==_0xdac9('0x42')){var _0x1d6f88={};_0x1d6f88[_0x9c732e['name']]={'$like':'%'+_0x170afd['query'][_0xdac9('0x43')]+'%'};return _0x1d6f88;}})});}_0x4c4e21=_[_0xdac9('0x41')]({},_0x4c4e21,_0x170afd[_0xdac9('0x44')]);var _0x260f0e={'where':_0x4c4e21[_0xdac9('0x3f')]};return db['ScreenRecording'][_0xdac9('0x21')](_0x260f0e)['then'](function(_0xd74baf){_0x3505c5[_0xdac9('0x21')]=_0xd74baf;if(_0x170afd[_0xdac9('0x36')][_0xdac9('0x45')]){_0x4c4e21[_0xdac9('0x46')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x47')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x11362d){_0x3505c5[_0xdac9('0x48')]=_0x11362d;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x49')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x4a')]=function(_0x441676,_0x5335ae){var _0x3857cf={'raw':![],'where':{'id':_0x441676['params']['id']}},_0x272b52={};_0x272b52[_0xdac9('0x33')]=_[_0xdac9('0x37')](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x272b52[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x441676['query']);_0x272b52[_0xdac9('0x38')]=_['intersection'](_0x272b52[_0xdac9('0x33')],_0x272b52[_0xdac9('0x36')]);_0x3857cf[_0xdac9('0x3b')]=_[_0xdac9('0x39')](_0x272b52['model'],qs['fields'](_0x441676['query'][_0xdac9('0x3a')]));_0x3857cf['attributes']=_0x3857cf['attributes'][_0xdac9('0x4b')]?_0x3857cf[_0xdac9('0x3b')]:_0x272b52['model'];if(_0x441676['query'][_0xdac9('0x45')]){_0x3857cf[_0xdac9('0x46')]=[{'all':!![]}];}_0x3857cf=_[_0xdac9('0x41')]({},_0x3857cf,_0x441676[_0xdac9('0x44')]);return db[_0xdac9('0x2e')][_0xdac9('0x4c')](_0x3857cf)[_0xdac9('0x26')](handleEntityNotFound(_0x5335ae,null))[_0xdac9('0x26')](respondWithResult(_0x5335ae,null))['catch'](handleError(_0x5335ae,null));};exports[_0xdac9('0x4d')]=function(_0x3bd946,_0xfa104f){return db[_0xdac9('0x2e')][_0xdac9('0x4d')](_0x3bd946[_0xdac9('0x4e')],{})[_0xdac9('0x26')](respondWithResult(_0xfa104f,0xc9))[_0xdac9('0x49')](handleError(_0xfa104f,null));};exports[_0xdac9('0x25')]=function(_0x242c24,_0x257e48){if(_0x242c24[_0xdac9('0x4e')]['id']){delete _0x242c24[_0xdac9('0x4e')]['id'];}delete _0x242c24[_0xdac9('0x4e')]['duration'];delete _0x242c24['body']['createdAt'];delete _0x242c24[_0xdac9('0x4e')][_0xdac9('0x4f')];delete _0x242c24['body'][_0xdac9('0x50')];return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':{'id':_0x242c24['params']['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x257e48,null))[_0xdac9('0x26')](saveUpdates(_0x242c24['body'],null))['then'](respondWithResult(_0x257e48,null))[_0xdac9('0x49')](handleError(_0x257e48,null));};exports[_0xdac9('0x51')]=function(_0x222de9,_0x370532){return db[_0xdac9('0x2e')][_0xdac9('0x51')]()[_0xdac9('0x26')](respondWithResult(_0x370532,null))[_0xdac9('0x49')](handleError(_0x370532,null));};exports[_0xdac9('0x52')]=function(_0x41579a,_0x10a2cc,_0x32b5f5){var _0xecb50a=require(_0xdac9('0x53'));var _0x35a378=![];var _0x5d0b43={};if(_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]&&_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]===_0xdac9('0x54')){_0x5d0b43[_0xdac9('0x54')]=_0x41579a['params']['id'];}else{_0x5d0b43['id']=_0x41579a[_0xdac9('0x55')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':_0x5d0b43,'attributes':['id',_0xdac9('0x50')],'raw':!![]})[_0xdac9('0x26')](handleEntityNotFound(_0x10a2cc,null))[_0xdac9('0x26')](function(_0x1eec39){if(_0x1eec39){var _0x243862=path[_0xdac9('0x56')](config['root'],_0xdac9('0x57'),_0x1eec39[_0xdac9('0x50')]);var _0x3cab26=util[_0xdac9('0x35')](_0xdac9('0x58'),_0x243862);if(fs[_0xdac9('0x59')](_0x3cab26)){_0x35a378=!![];return _0xecb50a['decryptFile'](_0x3cab26,_0x243862,config['secrets'][_0xdac9('0x5a')])[_0xdac9('0x26')](function(){return _0x1eec39;});}return _0x1eec39;}})[_0xdac9('0x26')](function(_0x46017d){if(_0x46017d){var _0x1c1f5f=path[_0xdac9('0x56')](config['root'],'server/files/screen_recordings',_0x46017d['value']);if(!fs[_0xdac9('0x59')](_0x1c1f5f)){throw new db[(_0xdac9('0x5b'))][(_0xdac9('0x5c'))](_0xdac9('0x5d'));}if(_0x46017d['filename']){return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,_0x46017d[_0xdac9('0x5e')]+path[_0xdac9('0x5f')](_0x1c1f5f),function(){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}else{return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,function(_0x496d9c){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}}})['catch'](function(_0x60b64e){if(_0x60b64e['message']===_0xdac9('0x5d')){_0x10a2cc[_0xdac9('0x1b')](0x194)[_0xdac9('0x61')](_0xdac9('0x62'));}else{return handleError(_0x10a2cc,null);}});};exports[_0xdac9('0x27')]=function(_0x40dec7,_0x232440){return db['ScreenRecording']['find']({'where':{'id':_0x40dec7['params']['id']}})[_0xdac9('0x26')](function(_0x42ba53){if(_[_0xdac9('0x63')](_0x42ba53)){throw new ReferenceError(_0xdac9('0x64'));}return _0x42ba53;})[_0xdac9('0x26')](function(_0x29df1d){var _0x288e7e=path['join'](config[_0xdac9('0x65')],'server/files/screen_recordings',_0x29df1d['value']);logger[_0xdac9('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x288e7e);if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')]('File:\x20\x22'+_0x288e7e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdac9('0x67')](_0x288e7e);}_0x288e7e=_0x288e7e+_0xdac9('0x68');if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')](_0xdac9('0x69')+_0x288e7e+_0xdac9('0x6a'));fs[_0xdac9('0x67')](_0x288e7e);}return _0x29df1d;})[_0xdac9('0x26')](function(_0xef4531){if(!_0xef4531)throw new InternalError();return _0xef4531[_0xdac9('0x27')]();})[_0xdac9('0x26')](function(){_0x232440[_0xdac9('0x1b')](0xcc)[_0xdac9('0x1c')]();})['catch'](handleError(_0x232440,null));};
\ No newline at end of file
index 17fc80c..3718ce7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc310=['../../config/environment','./screenRecording.attributes','define','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xc310,0xef));var _0x0c31=function(_0x356066,_0x40f2f8){_0x356066=_0x356066-0x0;var _0x59b0f1=_0xc310[_0x356066];return _0x59b0f1;};'use strict';var _=require(_0x0c31('0x0'));var util=require(_0x0c31('0x1'));var logger=require(_0x0c31('0x2'))(_0x0c31('0x3'));var moment=require(_0x0c31('0x4'));var BPromise=require(_0x0c31('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c31('0x6'));var rimraf=require(_0x0c31('0x7'));var config=require(_0x0c31('0x8'));var attributes=require(_0x0c31('0x9'));module['exports']=function(_0x48f0c0,_0x146a6e){return _0x48f0c0[_0x0c31('0xa')]('ScreenRecording',attributes,{'tableName':_0x0c31('0xb'),'paranoid':![],'indexes':[{'name':_0x0c31('0xc'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x69f8=['exports','screen_recordings','interactionid','lodash','util','api','moment','request-promise','path','../../config/environment','./screenRecording.attributes'];(function(_0x9c151a,_0x2cbaaf){var _0xbc1400=function(_0x545398){while(--_0x545398){_0x9c151a['push'](_0x9c151a['shift']());}};_0xbc1400(++_0x2cbaaf);}(_0x69f8,0x1bb));var _0x869f=function(_0x278708,_0x87909f){_0x278708=_0x278708-0x0;var _0x53b0df=_0x69f8[_0x278708];return _0x53b0df;};'use strict';var _=require(_0x869f('0x0'));var util=require(_0x869f('0x1'));var logger=require('../../config/logger')(_0x869f('0x2'));var moment=require(_0x869f('0x3'));var BPromise=require('bluebird');var rp=require(_0x869f('0x4'));var fs=require('fs');var path=require(_0x869f('0x5'));var rimraf=require('rimraf');var config=require(_0x869f('0x6'));var attributes=require(_0x869f('0x7'));module[_0x869f('0x8')]=function(_0x1d2f56,_0x190a9e){return _0x1d2f56['define']('ScreenRecording',attributes,{'tableName':_0x869f('0x9'),'paranoid':![],'indexes':[{'name':_0x869f('0xa'),'fields':[_0x869f('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index f220c75..8fef0be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeded=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message'];(function(_0x553849,_0x15cdb){var _0x22ac84=function(_0x436a7b){while(--_0x436a7b){_0x553849['push'](_0x553849['shift']());}};_0x22ac84(++_0x15cdb);}(_0xeded,0x18c));var _0xdede=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeded[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdede('0x0'));var util=require(_0xdede('0x1'));var moment=require(_0xdede('0x2'));var BPromise=require(_0xdede('0x3'));var rs=require(_0xdede('0x4'));var fs=require('fs');var Redis=require(_0xdede('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdede('0x6'));var logger=require(_0xdede('0x7'))('rpc');var config=require(_0xdede('0x8'));var jayson=require(_0xdede('0x9'));var client=jayson[_0xdede('0xa')][_0xdede('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594fa3,_0x596310,_0x58f595){return new BPromise(function(_0x5dc9a2,_0x432b4b){return client['request'](_0x594fa3,_0x58f595)[_0xdede('0xc')](function(_0x3a4b21){logger[_0xdede('0xd')](_0xdede('0xe'),_0x596310,_0xdede('0xf'));logger['debug'](_0xdede('0x10'),_0x596310,_0xdede('0xf'),JSON[_0xdede('0x11')](_0x3a4b21));if(_0x3a4b21[_0xdede('0x12')]){if(_0x3a4b21['error'][_0xdede('0x13')]===0x1f4){logger[_0xdede('0x12')](_0xdede('0xe'),_0x596310,_0x3a4b21[_0xdede('0x12')]['message']);return _0x432b4b(_0x3a4b21['error']['message']);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x596310,_0x3a4b21[_0xdede('0x12')]['message']);return _0x5dc9a2(_0x3a4b21['error']['message']);}else{logger[_0xdede('0xd')](_0xdede('0xe'),_0x596310,'request\x20sent');_0x5dc9a2(_0x3a4b21[_0xdede('0x14')][_0xdede('0x15')]);}})['catch'](function(_0x39a2d6){logger[_0xdede('0x12')](_0xdede('0xe'),_0x596310,_0x39a2d6);_0x432b4b(_0x39a2d6);});});}
\ No newline at end of file
+var _0xdd39=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x1a0565,_0x243d2c){var _0x509037=function(_0x39ce1b){while(--_0x39ce1b){_0x1a0565['push'](_0x1a0565['shift']());}};_0x509037(++_0x243d2c);}(_0xdd39,0xa7));var _0x9dd3=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xdd39[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x9dd3('0x0'));var util=require(_0x9dd3('0x1'));var moment=require(_0x9dd3('0x2'));var BPromise=require(_0x9dd3('0x3'));var rs=require(_0x9dd3('0x4'));var fs=require('fs');var Redis=require(_0x9dd3('0x5'));var db=require(_0x9dd3('0x6'))['db'];var utils=require(_0x9dd3('0x7'));var logger=require(_0x9dd3('0x8'))(_0x9dd3('0x9'));var config=require(_0x9dd3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x9dd3('0xb')][_0x9dd3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x297df9,_0x1dcf71,_0x12ee9a){return new BPromise(function(_0x318e15,_0x32d3fb){return client[_0x9dd3('0xd')](_0x297df9,_0x12ee9a)[_0x9dd3('0xe')](function(_0xedc3ad){logger[_0x9dd3('0xf')](_0x9dd3('0x10'),_0x1dcf71,'request\x20sent');logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1dcf71,_0x9dd3('0x11'),JSON[_0x9dd3('0x12')](_0xedc3ad));if(_0xedc3ad[_0x9dd3('0x13')]){if(_0xedc3ad[_0x9dd3('0x13')][_0x9dd3('0x14')]===0x1f4){logger[_0x9dd3('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x1dcf71,_0xedc3ad[_0x9dd3('0x13')][_0x9dd3('0x15')]);return _0x32d3fb(_0xedc3ad[_0x9dd3('0x13')][_0x9dd3('0x15')]);}logger[_0x9dd3('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x1dcf71,_0xedc3ad[_0x9dd3('0x13')][_0x9dd3('0x15')]);return _0x318e15(_0xedc3ad[_0x9dd3('0x13')][_0x9dd3('0x15')]);}else{logger[_0x9dd3('0xf')](_0x9dd3('0x10'),_0x1dcf71,_0x9dd3('0x11'));_0x318e15(_0xedc3ad[_0x9dd3('0x16')][_0x9dd3('0x15')]);}})[_0x9dd3('0x17')](function(_0x5a1412){logger[_0x9dd3('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x1dcf71,_0x5a1412);_0x32d3fb(_0x5a1412);});});}
\ No newline at end of file
index f12bb05..5b8868d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92b4=['index','/now','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','root','logologin','addLogoLogin','/:id/preferred','addPreferred','favicon','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x18231d,_0x3823d3){var _0x3abf68=function(_0x4cce6a){while(--_0x4cce6a){_0x18231d['push'](_0x18231d['shift']());}};_0x3abf68(++_0x3823d3);}(_0x92b4,0x198));var _0x492b=function(_0xb104b2,_0x9185b8){_0xb104b2=_0xb104b2-0x0;var _0x9a1893=_0x92b4[_0xb104b2];return _0x9a1893;};'use strict';var multer=require(_0x492b('0x0'));var util=require(_0x492b('0x1'));var path=require(_0x492b('0x2'));var timeout=require(_0x492b('0x3'));var express=require(_0x492b('0x4'));var router=express[_0x492b('0x5')]();var fs_extra=require(_0x492b('0x6'));var auth=require(_0x492b('0x7'));var interaction=require(_0x492b('0x8'));var config=require(_0x492b('0x9'));var controller=require('./setting.controller');router[_0x492b('0xa')]('/',auth[_0x492b('0xb')](),controller[_0x492b('0xc')]);router['get'](_0x492b('0xd'),controller['getDate']);router['get'](_0x492b('0xe'),controller['show']);router[_0x492b('0xa')](_0x492b('0xf'),controller[_0x492b('0x10')]);router['get'](_0x492b('0x11'),controller[_0x492b('0x12')]);router[_0x492b('0xa')]('/:id/gdpr',controller['gdpr']);router['get']('/:id/preferred',controller[_0x492b('0x13')]);router['get'](_0x492b('0x14'),controller[_0x492b('0x15')]);var upload=multer({'storage':multer[_0x492b('0x16')]({'destination':function(_0x2dc40a,_0x535c50,_0x206c9a){_0x206c9a(null,path[_0x492b('0x17')](config['root'],_0x492b('0x18')));},'filename':function(_0x510207,_0x2be597,_0x432dd5){_0x432dd5(null,util[_0x492b('0x19')](_0x492b('0x1a'),_0x492b('0x1b'),path[_0x492b('0x1c')](_0x2be597[_0x492b('0x1d')])));}})});router[_0x492b('0x1e')]('/:id/logo',upload[_0x492b('0x1f')](_0x492b('0x20')),controller[_0x492b('0x21')]);var upload=multer({'storage':multer[_0x492b('0x16')]({'destination':function(_0x2d9cf2,_0x39ade5,_0x43ade1){_0x43ade1(null,path['join'](config[_0x492b('0x22')],_0x492b('0x18')));},'filename':function(_0xb0abc8,_0x32ea06,_0x1d926d){_0x1d926d(null,util[_0x492b('0x19')]('%s%s',_0x492b('0x23'),path[_0x492b('0x1c')](_0x32ea06['originalname'])));}})});router[_0x492b('0x1e')]('/:id/logo_login',upload['single']('file'),controller[_0x492b('0x24')]);var upload=multer({'storage':multer[_0x492b('0x16')]({'destination':function(_0x3ffdc9,_0x559340,_0x3807a5){_0x3807a5(null,path[_0x492b('0x17')](config[_0x492b('0x22')],_0x492b('0x18')));},'filename':function(_0x54ca90,_0x1d7f69,_0x1e0426){_0x1e0426(null,util[_0x492b('0x19')](_0x492b('0x1a'),'preferred',path[_0x492b('0x1c')](_0x1d7f69[_0x492b('0x1d')])));}})});router[_0x492b('0x1e')](_0x492b('0x25'),upload[_0x492b('0x1f')](_0x492b('0x20')),controller[_0x492b('0x26')]);var upload=multer({'storage':multer[_0x492b('0x16')]({'destination':function(_0x54e600,_0x24ff0d,_0x5f26ed){_0x5f26ed(null,path[_0x492b('0x17')](config[_0x492b('0x22')],_0x492b('0x18')));},'filename':function(_0x4e8c3c,_0x146072,_0x19b542){_0x19b542(null,util[_0x492b('0x19')](_0x492b('0x1a'),_0x492b('0x27'),path[_0x492b('0x1c')](_0x146072[_0x492b('0x1d')])));}})});router[_0x492b('0x1e')](_0x492b('0x14'),upload['single'](_0x492b('0x20')),controller['addFavicon']);router[_0x492b('0x28')](_0x492b('0xe'),auth[_0x492b('0xb')](),controller['update']);module[_0x492b('0x29')]=router;
\ No newline at end of file
+var _0xcdc0=['addLogo','root','logologin','file','addLogoLogin','join','preferred','addPreferred','/:id/favicon','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/now','/:id','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','/:id/logo','single'];(function(_0x15ce61,_0x36edbc){var _0x5e1f49=function(_0x162a76){while(--_0x162a76){_0x15ce61['push'](_0x15ce61['shift']());}};_0x5e1f49(++_0x36edbc);}(_0xcdc0,0x1eb));var _0x0cdc=function(_0x33dd3b,_0x4c3aba){_0x33dd3b=_0x33dd3b-0x0;var _0xb7ffed=_0xcdc0[_0x33dd3b];return _0xb7ffed;};'use strict';var multer=require(_0x0cdc('0x0'));var util=require('util');var path=require(_0x0cdc('0x1'));var timeout=require(_0x0cdc('0x2'));var express=require(_0x0cdc('0x3'));var router=express[_0x0cdc('0x4')]();var fs_extra=require(_0x0cdc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0cdc('0x6'));var config=require(_0x0cdc('0x7'));var controller=require(_0x0cdc('0x8'));router['get']('/',auth[_0x0cdc('0x9')](),controller['index']);router[_0x0cdc('0xa')](_0x0cdc('0xb'),controller['getDate']);router[_0x0cdc('0xa')](_0x0cdc('0xc'),controller['show']);router[_0x0cdc('0xa')]('/:id/logo',controller['getLogo']);router['get'](_0x0cdc('0xd'),controller[_0x0cdc('0xe')]);router['get'](_0x0cdc('0xf'),controller['gdpr']);router[_0x0cdc('0xa')](_0x0cdc('0x10'),controller[_0x0cdc('0x11')]);router[_0x0cdc('0xa')]('/:id/favicon',controller[_0x0cdc('0x12')]);var upload=multer({'storage':multer[_0x0cdc('0x13')]({'destination':function(_0x59bf3b,_0xd2795c,_0x35b62b){_0x35b62b(null,path['join'](config['root'],_0x0cdc('0x14')));},'filename':function(_0x310af2,_0xb8bb6f,_0x2f36a9){_0x2f36a9(null,util[_0x0cdc('0x15')](_0x0cdc('0x16'),_0x0cdc('0x17'),path[_0x0cdc('0x18')](_0xb8bb6f[_0x0cdc('0x19')])));}})});router[_0x0cdc('0x1a')](_0x0cdc('0x1b'),upload[_0x0cdc('0x1c')]('file'),controller[_0x0cdc('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x11fe7f,_0x14de3a,_0x2162f6){_0x2162f6(null,path['join'](config[_0x0cdc('0x1e')],_0x0cdc('0x14')));},'filename':function(_0x32c587,_0xb9dc19,_0x2b5f47){_0x2b5f47(null,util[_0x0cdc('0x15')](_0x0cdc('0x16'),_0x0cdc('0x1f'),path[_0x0cdc('0x18')](_0xb9dc19[_0x0cdc('0x19')])));}})});router[_0x0cdc('0x1a')](_0x0cdc('0xd'),upload['single'](_0x0cdc('0x20')),controller[_0x0cdc('0x21')]);var upload=multer({'storage':multer[_0x0cdc('0x13')]({'destination':function(_0x5d85bf,_0x4d0553,_0x57b37e){_0x57b37e(null,path[_0x0cdc('0x22')](config[_0x0cdc('0x1e')],_0x0cdc('0x14')));},'filename':function(_0x598095,_0x4a4bca,_0x269aa2){_0x269aa2(null,util[_0x0cdc('0x15')](_0x0cdc('0x16'),_0x0cdc('0x23'),path[_0x0cdc('0x18')](_0x4a4bca[_0x0cdc('0x19')])));}})});router[_0x0cdc('0x1a')](_0x0cdc('0x10'),upload[_0x0cdc('0x1c')](_0x0cdc('0x20')),controller[_0x0cdc('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x274191,_0x298be0,_0x5d6296){_0x5d6296(null,path[_0x0cdc('0x22')](config['root'],_0x0cdc('0x14')));},'filename':function(_0x647273,_0x3cd751,_0x160eaf){_0x160eaf(null,util[_0x0cdc('0x15')]('%s%s','favicon',path[_0x0cdc('0x18')](_0x3cd751[_0x0cdc('0x19')])));}})});router[_0x0cdc('0x1a')](_0x0cdc('0x25'),upload['single'](_0x0cdc('0x20')),controller['addFavicon']);router['put'](_0x0cdc('0xc'),auth['isAuthenticated'](),controller[_0x0cdc('0x26')]);module[_0x0cdc('0x27')]=router;
\ No newline at end of file
index 0106999..4bd63d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x9ac43a,_0x167a2c){var _0x589c08=function(_0x5319f8){while(--_0x5319f8){_0x9ac43a['push'](_0x9ac43a['shift']());}};_0x589c08(++_0x167a2c);}(_0x7a54,0x106));var _0x47a5=function(_0x469308,_0x3b6b28){_0x469308=_0x469308-0x0;var _0x298c3b=_0x7a54[_0x469308];return _0x298c3b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x3fd613,_0x2e79ac){var _0x4997d0=function(_0x47bd83){while(--_0x47bd83){_0x3fd613['push'](_0x3fd613['shift']());}};_0x4997d0(++_0x2e79ac);}(_0x7a54,0x106));var _0x47a5=function(_0x4fba8a,_0x187e0b){_0x4fba8a=_0x4fba8a-0x0;var _0x585db3=_0x7a54[_0x4fba8a];return _0x585db3;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}};
\ No newline at end of file
index cbc98bf..6da2548 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76bb=['sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','undefined','limit','count','Content-Range','json','apply','reject','update','then','status','stack','name','send','index','map','Setting','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','length','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','preferred','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','root','join','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','favicon','defaultLogo','default_loginLogo.svg','\x20not\x20found','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','getLicense','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x76bb,0x16a));var _0xb76b=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x76bb[_0x588011];return _0x3b3773;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb76b('0x0'));var zipdir=require(_0xb76b('0x1'));var jsonpatch=require(_0xb76b('0x2'));var rp=require(_0xb76b('0x3'));var moment=require('moment');var BPromise=require(_0xb76b('0x4'));var Mustache=require(_0xb76b('0x5'));var util=require('util');var path=require(_0xb76b('0x6'));var sox=require(_0xb76b('0x7'));var csv=require('to-csv');var ejs=require(_0xb76b('0x8'));var fs=require('fs');var fs_extra=require(_0xb76b('0x9'));var _=require(_0xb76b('0xa'));var squel=require(_0xb76b('0xb'));var crypto=require(_0xb76b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb76b('0xd'));var toCsv=require(_0xb76b('0xe'));var querystring=require(_0xb76b('0xf'));var Papa=require(_0xb76b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb76b('0x11'));var as=require(_0xb76b('0x12'));var hardwareService=require(_0xb76b('0x13'));var logger=require(_0xb76b('0x14'))(_0xb76b('0x15'));var utils=require(_0xb76b('0x16'));var config=require(_0xb76b('0x17'));var licenseUtil=require(_0xb76b('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb76b('0x19'));var client=jayson['client'][_0xb76b('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3f8bc7,_0x29d479,_0x5c2db5,_0x4e715c){return new BPromise(function(_0x10a6aa,_0x16d909){var _0x58ce24=_0x4e715c||client;return _0x58ce24[_0xb76b('0x1b')](_0x3f8bc7,_0x5c2db5)['then'](function(_0x2b4590){logger[_0xb76b('0x1c')](_0xb76b('0x1d'),_0x29d479,_0xb76b('0x1e'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x29d479,_0xb76b('0x1e'),JSON[_0xb76b('0x1f')](_0x2b4590));if(_0x2b4590['error']){if(_0x2b4590[_0xb76b('0x20')][_0xb76b('0x21')]===0x1f4){logger[_0xb76b('0x20')](_0xb76b('0x1d'),_0x29d479,_0x2b4590[_0xb76b('0x20')][_0xb76b('0x22')]);return _0x16d909(_0x2b4590[_0xb76b('0x20')]['message']);}logger['error'](_0xb76b('0x1d'),_0x29d479,_0x2b4590[_0xb76b('0x20')][_0xb76b('0x22')]);return _0x10a6aa(_0x2b4590[_0xb76b('0x20')][_0xb76b('0x22')]);}else{logger['info'](_0xb76b('0x1d'),_0x29d479,'request\x20sent');_0x10a6aa(_0x2b4590[_0xb76b('0x23')][_0xb76b('0x22')]);}})[_0xb76b('0x24')](function(_0x3e299a){logger['error'](_0xb76b('0x1d'),_0x29d479,_0x3e299a);_0x16d909(_0x3e299a);});});}function respondWithStatusCode(_0x2b4f3f,_0x75cd9c){_0x75cd9c=_0x75cd9c||0xcc;return function(_0x1c8a54){if(_0x1c8a54){return _0x2b4f3f[_0xb76b('0x25')](_0x75cd9c);}return _0x2b4f3f['status'](_0x75cd9c)[_0xb76b('0x26')]();};}function respondWithResult(_0x44ec61,_0x56704b){_0x56704b=_0x56704b||0xc8;return function(_0x2569dc){if(_0x2569dc){return _0x44ec61['status'](_0x56704b)['json'](_0x2569dc);}};}function respondWithFilteredResult(_0x1dbeb5,_0x2d872b){return function(_0xb90480){if(_0xb90480){var _0x23df6d=typeof _0x2d872b['offset']===_0xb76b('0x27')&&typeof _0x2d872b[_0xb76b('0x28')]===_0xb76b('0x27');var _0x3badb4=_0xb90480[_0xb76b('0x29')];var _0x1cf72b=_0x23df6d?0x0:_0x2d872b['offset'];var _0x2c4fda=_0x23df6d?_0xb90480['count']:_0x2d872b['offset']+_0x2d872b[_0xb76b('0x28')];var _0x3b83e2;if(_0x2c4fda>=_0x3badb4){_0x2c4fda=_0x3badb4;_0x3b83e2=0xc8;}else{_0x3b83e2=0xce;}_0x1dbeb5['status'](_0x3b83e2);return _0x1dbeb5['set'](_0xb76b('0x2a'),_0x1cf72b+'-'+_0x2c4fda+'/'+_0x3badb4)[_0xb76b('0x2b')](_0xb90480);}return null;};}function patchUpdates(_0x4e94af){return function(_0x2a60db){try{jsonpatch[_0xb76b('0x2c')](_0x2a60db,_0x4e94af,!![]);}catch(_0x248dc7){return BPromise[_0xb76b('0x2d')](_0x248dc7);}return _0x2a60db['save']();};}function saveUpdates(_0x3425bd,_0x36e586){return function(_0x2a3c00){if(_0x2a3c00){return _0x2a3c00[_0xb76b('0x2e')](_0x3425bd)['then'](function(_0x5aec6b){return _0x5aec6b;});}return null;};}function removeEntity(_0xad0b72,_0x4db2b1){return function(_0x44d2ee){if(_0x44d2ee){return _0x44d2ee['destroy']()[_0xb76b('0x2f')](function(){_0xad0b72[_0xb76b('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x209f9e,_0x3854f1){return function(_0x631104){if(!_0x631104){_0x209f9e[_0xb76b('0x25')](0x194);}return _0x631104;};}function handleError(_0x409420,_0x22447f){_0x22447f=_0x22447f||0x1f4;return function(_0x36e797){logger[_0xb76b('0x20')](_0x36e797[_0xb76b('0x31')]);if(_0x36e797[_0xb76b('0x32')]){delete _0x36e797[_0xb76b('0x32')];}_0x409420['status'](_0x22447f)[_0xb76b('0x33')](_0x36e797);};}exports[_0xb76b('0x34')]=function(_0x2e4610,_0x434ecd){var _0x3e6e76={},_0x193cbf={},_0x214887={'count':0x0,'rows':[]};var _0x58860e=_[_0xb76b('0x35')](db[_0xb76b('0x36')][_0xb76b('0x37')],function(_0x88cfbb){return{'name':_0x88cfbb['fieldName'],'type':_0x88cfbb['type'][_0xb76b('0x38')]};});_0x193cbf[_0xb76b('0x39')]=_[_0xb76b('0x35')](_0x58860e,_0xb76b('0x32'));_0x193cbf[_0xb76b('0x3a')]=_[_0xb76b('0x3b')](_0x2e4610[_0xb76b('0x3a')]);_0x193cbf[_0xb76b('0x3c')]=_[_0xb76b('0x3d')](_0x193cbf[_0xb76b('0x39')],_0x193cbf[_0xb76b('0x3a')]);_0x3e6e76[_0xb76b('0x3e')]=_[_0xb76b('0x3d')](_0x193cbf['model'],qs[_0xb76b('0x3f')](_0x2e4610[_0xb76b('0x3a')][_0xb76b('0x3f')]));_0x3e6e76['attributes']=_0x3e6e76[_0xb76b('0x3e')]['length']?_0x3e6e76[_0xb76b('0x3e')]:_0x193cbf['model'];if(!_0x2e4610[_0xb76b('0x3a')][_0xb76b('0x40')](_0xb76b('0x41'))){_0x3e6e76[_0xb76b('0x28')]=qs['limit'](_0x2e4610[_0xb76b('0x3a')][_0xb76b('0x28')]);_0x3e6e76[_0xb76b('0x42')]=qs[_0xb76b('0x42')](_0x2e4610[_0xb76b('0x3a')][_0xb76b('0x42')]);}_0x3e6e76[_0xb76b('0x43')]=qs['sort'](_0x2e4610[_0xb76b('0x3a')][_0xb76b('0x44')]);_0x3e6e76['where']=qs['filters'](_[_0xb76b('0x45')](_0x2e4610[_0xb76b('0x3a')],_0x193cbf[_0xb76b('0x3c')]),_0x58860e);if(_0x2e4610[_0xb76b('0x3a')]['filter']){_0x3e6e76[_0xb76b('0x46')]=_[_0xb76b('0x47')](_0x3e6e76[_0xb76b('0x46')],{'$or':_[_0xb76b('0x35')](_0x58860e,function(_0x10d6b0){if(_0x10d6b0['type']!==_0xb76b('0x48')){var _0x470559={};_0x470559[_0x10d6b0[_0xb76b('0x32')]]={'$like':'%'+_0x2e4610['query'][_0xb76b('0x49')]+'%'};return _0x470559;}})});}_0x3e6e76=_[_0xb76b('0x47')]({},_0x3e6e76,_0x2e4610[_0xb76b('0x4a')]);var _0x6cc793={'where':_0x3e6e76[_0xb76b('0x46')]};return db[_0xb76b('0x36')]['count'](_0x6cc793)[_0xb76b('0x2f')](function(_0x5eed9f){_0x214887[_0xb76b('0x29')]=_0x5eed9f;if(_0x2e4610[_0xb76b('0x3a')][_0xb76b('0x4b')]){_0x3e6e76['include']=[{'all':!![]}];}return db[_0xb76b('0x36')][_0xb76b('0x4c')](_0x3e6e76);})['then'](function(_0x342387){_0x214887[_0xb76b('0x4d')]=_0x342387;return _0x214887;})[_0xb76b('0x2f')](respondWithFilteredResult(_0x434ecd,_0x3e6e76))[_0xb76b('0x24')](handleError(_0x434ecd,null));};exports[_0xb76b('0x4e')]=function(_0x3c6e95,_0x19a953){var _0xb28a18={'raw':![],'where':{'id':_0x3c6e95[_0xb76b('0x4f')]['id']}},_0x192555={};_0x192555[_0xb76b('0x39')]=_[_0xb76b('0x3b')](db[_0xb76b('0x36')]['rawAttributes']);_0x192555[_0xb76b('0x3a')]=_[_0xb76b('0x3b')](_0x3c6e95[_0xb76b('0x3a')]);_0x192555[_0xb76b('0x3c')]=_['intersection'](_0x192555[_0xb76b('0x39')],_0x192555[_0xb76b('0x3a')]);_0xb28a18['attributes']=_[_0xb76b('0x3d')](_0x192555[_0xb76b('0x39')],qs[_0xb76b('0x3f')](_0x3c6e95['query']['fields']));_0xb28a18[_0xb76b('0x3e')]=_0xb28a18[_0xb76b('0x3e')][_0xb76b('0x50')]?_0xb28a18[_0xb76b('0x3e')]:_0x192555[_0xb76b('0x39')];if(_0x3c6e95[_0xb76b('0x3a')][_0xb76b('0x4b')]){_0xb28a18['include']=[{'all':!![]}];}_0xb28a18=_[_0xb76b('0x47')]({},_0xb28a18,_0x3c6e95[_0xb76b('0x4a')]);return db[_0xb76b('0x36')][_0xb76b('0x51')](_0xb28a18)[_0xb76b('0x2f')](handleEntityNotFound(_0x19a953,null))[_0xb76b('0x2f')](respondWithResult(_0x19a953,null))['catch'](handleError(_0x19a953,null));};exports[_0xb76b('0x2e')]=function(_0xb2827b,_0x34232b){if(_0xb2827b['body']['id']){delete _0xb2827b[_0xb76b('0x52')]['id'];}return db[_0xb76b('0x36')][_0xb76b('0x51')]({'where':{'id':_0xb2827b[_0xb76b('0x4f')]['id']}})[_0xb76b('0x2f')](handleEntityNotFound(_0x34232b,null))[_0xb76b('0x2f')](saveUpdates(_0xb2827b[_0xb76b('0x52')],null))[_0xb76b('0x2f')](respondWithResult(_0x34232b,null))[_0xb76b('0x24')](handleError(_0x34232b,null));};exports[_0xb76b('0x53')]=function(_0x30ac4d,_0x13fb41,_0x3f68d9){if(_0x30ac4d[_0xb76b('0x54')]&&_0x30ac4d[_0xb76b('0x54')][_0xb76b('0x55')]){_0x30ac4d[_0xb76b('0x52')][_0xb76b('0x56')]=_0x30ac4d[_0xb76b('0x54')]['filename'];}return db[_0xb76b('0x36')]['find']({'where':{'id':_0x30ac4d[_0xb76b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x13fb41,null))[_0xb76b('0x2f')](saveUpdates(_0x30ac4d[_0xb76b('0x52')],null))[_0xb76b('0x2f')](respondWithResult(_0x13fb41,null))[_0xb76b('0x24')](handleError(_0x13fb41,null));};exports[_0xb76b('0x57')]=function(_0x3d23f1,_0x1f76cf,_0x5eb1bf){if(_0x3d23f1[_0xb76b('0x54')]&&_0x3d23f1['file'][_0xb76b('0x55')]){_0x3d23f1[_0xb76b('0x52')][_0xb76b('0x58')]=_0x3d23f1[_0xb76b('0x54')][_0xb76b('0x55')];}return db['Setting'][_0xb76b('0x51')]({'where':{'id':_0x3d23f1[_0xb76b('0x4f')]['id']}})[_0xb76b('0x2f')](handleEntityNotFound(_0x1f76cf,null))[_0xb76b('0x2f')](saveUpdates(_0x3d23f1[_0xb76b('0x52')],null))[_0xb76b('0x2f')](respondWithResult(_0x1f76cf,null))[_0xb76b('0x24')](handleError(_0x1f76cf,null));};var utilLicense=require(_0xb76b('0x18'));exports['getLogo']=function(_0x1ed970,_0x38e85c,_0x23f00c){var _0x34d954=_0xb76b('0x59');var _0x45b7bb={'custom':![]};return utilLicense['getLicense']()[_0xb76b('0x2f')](function(_0x1bee4f){if(_0x1bee4f){_0x45b7bb=_0x1bee4f;}return db[_0xb76b('0x36')][_0xb76b('0x51')]({'where':{'id':_0x1ed970[_0xb76b('0x4f')]['id']},'attributes':[_0xb76b('0x56'),_0xb76b('0x58'),_0xb76b('0x5a'),'favicon','defaultLogo',_0xb76b('0x5b'),_0xb76b('0x5c'),_0xb76b('0x5d')],'raw':!![]});})[_0xb76b('0x2f')](handleEntityNotFound(_0x38e85c,null))[_0xb76b('0x2f')](function(_0x37cac8){if(_0x37cac8){var _0x3002f8=_0x37cac8[_0xb76b('0x56')]&&fs[_0xb76b('0x5e')](path['join'](config['root'],_0x34d954,_[_0xb76b('0x5f')](_0x37cac8[_0xb76b('0x56')])))?path['join'](config[_0xb76b('0x60')],_0x34d954,_['toLower'](_0x37cac8[_0xb76b('0x56')])):path[_0xb76b('0x61')](config[_0xb76b('0x60')],_0x34d954,_['toLower'](_0xb76b('0x62')));var _0xf925a4=_0xb76b('0x63')+_[_0xb76b('0x64')]('logo');if(_0x37cac8[_0xf925a4]||!_0x45b7bb[_0xb76b('0x65')]){_0x3002f8=path['join'](config[_0xb76b('0x60')],_0x34d954,_[_0xb76b('0x5f')](_0xb76b('0x62')));}if(!fs[_0xb76b('0x5e')](_0x3002f8)){throw new db[(_0xb76b('0x66'))][(_0xb76b('0x67'))](_[_0xb76b('0x64')](_0xb76b('0x56'))+'\x20not\x20found');}return _0x38e85c[_0xb76b('0x68')](_0x3002f8);}})[_0xb76b('0x24')](handleError(_0x38e85c,null));};var utilLicense=require(_0xb76b('0x18'));exports[_0xb76b('0x69')]=function(_0x2dc879,_0x301104,_0x1fe5f5){var _0x41a023=_0xb76b('0x59');var _0x26acd1={'custom':![]};return utilLicense['getLicense']()[_0xb76b('0x2f')](function(_0xa61dfb){if(_0xa61dfb){_0x26acd1=_0xa61dfb;}return db[_0xb76b('0x36')][_0xb76b('0x51')]({'where':{'id':_0x2dc879[_0xb76b('0x4f')]['id']},'attributes':[_0xb76b('0x56'),_0xb76b('0x58'),_0xb76b('0x5a'),_0xb76b('0x6a'),_0xb76b('0x6b'),_0xb76b('0x5b'),_0xb76b('0x5c'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x301104,null))[_0xb76b('0x2f')](function(_0x1ef12f){if(_0x1ef12f){var _0x7fa7c3=_0x1ef12f['loginLogo']&&fs['existsSync'](path['join'](config['root'],_0x41a023,_[_0xb76b('0x5f')](_0x1ef12f[_0xb76b('0x58')])))?path[_0xb76b('0x61')](config[_0xb76b('0x60')],_0x41a023,_['toLower'](_0x1ef12f[_0xb76b('0x58')])):path[_0xb76b('0x61')](config[_0xb76b('0x60')],_0x41a023,_[_0xb76b('0x5f')](_0xb76b('0x6c')));var _0x4d50f2='default'+_[_0xb76b('0x64')](_0xb76b('0x58'));if(_0x1ef12f[_0x4d50f2]||!_0x26acd1['custom']){_0x7fa7c3=path[_0xb76b('0x61')](config[_0xb76b('0x60')],_0x41a023,_['toLower'](_0xb76b('0x6c')));}if(!fs[_0xb76b('0x5e')](_0x7fa7c3)){throw new db[(_0xb76b('0x66'))][(_0xb76b('0x67'))](_[_0xb76b('0x64')](_0xb76b('0x58'))+_0xb76b('0x6d'));}return _0x301104[_0xb76b('0x68')](_0x7fa7c3);}})[_0xb76b('0x24')](handleError(_0x301104,null));};exports[_0xb76b('0x6e')]=function(_0x4049fa,_0x204f2f){return db['Setting'][_0xb76b('0x51')]({'where':{'id':_0x4049fa['params']['id']},'attributes':['securePassword']})[_0xb76b('0x2f')](respondWithResult(_0x204f2f,null))[_0xb76b('0x24')](handleError(_0x204f2f,null));};exports[_0xb76b('0x6f')]=function(_0x316cd3,_0x28a8ee,_0x37e856){if(_0x316cd3[_0xb76b('0x54')]&&_0x316cd3[_0xb76b('0x54')][_0xb76b('0x55')]){_0x316cd3[_0xb76b('0x52')]['preferred']=_0x316cd3[_0xb76b('0x54')][_0xb76b('0x55')];}return db['Setting']['find']({'where':{'id':_0x316cd3[_0xb76b('0x4f')]['id']}})[_0xb76b('0x2f')](handleEntityNotFound(_0x28a8ee,null))['then'](saveUpdates(_0x316cd3[_0xb76b('0x52')],null))[_0xb76b('0x2f')](respondWithResult(_0x28a8ee,null))['catch'](handleError(_0x28a8ee,null));};var utilLicense=require(_0xb76b('0x18'));exports[_0xb76b('0x70')]=function(_0x4e1f86,_0x2ebf7e,_0xb5f22d){var _0x201e97='server/files/images/logos';var _0x1f5521={'custom':![]};return utilLicense['getLicense']()[_0xb76b('0x2f')](function(_0x5ef48d){if(_0x5ef48d){_0x1f5521=_0x5ef48d;}return db['Setting'][_0xb76b('0x51')]({'where':{'id':_0x4e1f86['params']['id']},'attributes':[_0xb76b('0x56'),'loginLogo',_0xb76b('0x5a'),_0xb76b('0x6a'),_0xb76b('0x6b'),_0xb76b('0x5b'),'defaultPreferred',_0xb76b('0x5d')],'raw':!![]});})[_0xb76b('0x2f')](handleEntityNotFound(_0x2ebf7e,null))[_0xb76b('0x2f')](function(_0x31045e){if(_0x31045e){var _0x1cca62=_0x31045e['preferred']&&fs[_0xb76b('0x5e')](path['join'](config[_0xb76b('0x60')],_0x201e97,_[_0xb76b('0x5f')](_0x31045e[_0xb76b('0x5a')])))?path['join'](config[_0xb76b('0x60')],_0x201e97,_[_0xb76b('0x5f')](_0x31045e[_0xb76b('0x5a')])):path[_0xb76b('0x61')](config[_0xb76b('0x60')],_0x201e97,_['toLower'](_0xb76b('0x71')));var _0x487802=_0xb76b('0x63')+_['upperFirst'](_0xb76b('0x5a'));if(_0x31045e[_0x487802]||!_0x1f5521[_0xb76b('0x65')]||!_0x1f5521['preferred']){_0x1cca62=path['join'](config['root'],_0x201e97,_[_0xb76b('0x5f')]('default_preferred.png'));}if(!fs[_0xb76b('0x5e')](_0x1cca62)){throw new db[(_0xb76b('0x66'))][(_0xb76b('0x67'))](_[_0xb76b('0x64')](_0xb76b('0x5a'))+_0xb76b('0x6d'));}return _0x2ebf7e[_0xb76b('0x68')](_0x1cca62);}})['catch'](handleError(_0x2ebf7e,null));};exports[_0xb76b('0x72')]=function(_0x1724b5,_0x4e0b08,_0x4d6aaa){if(_0x1724b5[_0xb76b('0x54')]&&_0x1724b5['file'][_0xb76b('0x55')]){_0x1724b5[_0xb76b('0x52')][_0xb76b('0x6a')]=_0x1724b5[_0xb76b('0x54')]['filename'];}return db[_0xb76b('0x36')][_0xb76b('0x51')]({'where':{'id':_0x1724b5[_0xb76b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4e0b08,null))['then'](saveUpdates(_0x1724b5[_0xb76b('0x52')],null))[_0xb76b('0x2f')](respondWithResult(_0x4e0b08,null))[_0xb76b('0x24')](handleError(_0x4e0b08,null));};var utilLicense=require(_0xb76b('0x18'));exports[_0xb76b('0x73')]=function(_0x56ec4d,_0x24b544,_0x298c60){var _0x5d4549=_0xb76b('0x59');var _0x4be6a4={'custom':![]};return utilLicense[_0xb76b('0x74')]()[_0xb76b('0x2f')](function(_0x425902){if(_0x425902){_0x4be6a4=_0x425902;}return db[_0xb76b('0x36')][_0xb76b('0x51')]({'where':{'id':_0x56ec4d[_0xb76b('0x4f')]['id']},'attributes':['logo','loginLogo','preferred',_0xb76b('0x6a'),_0xb76b('0x6b'),'defaultLoginLogo','defaultPreferred',_0xb76b('0x5d')],'raw':!![]});})[_0xb76b('0x2f')](handleEntityNotFound(_0x24b544,null))[_0xb76b('0x2f')](function(_0x5143e6){if(_0x5143e6){var _0x42843a=_0x5143e6['favicon']&&fs[_0xb76b('0x5e')](path['join'](config[_0xb76b('0x60')],_0x5d4549,_[_0xb76b('0x5f')](_0x5143e6[_0xb76b('0x6a')])))?path[_0xb76b('0x61')](config['root'],_0x5d4549,_[_0xb76b('0x5f')](_0x5143e6[_0xb76b('0x6a')])):path[_0xb76b('0x61')](config[_0xb76b('0x60')],_0x5d4549,_['toLower'](_0xb76b('0x75')));var _0x3cdd3a=_0xb76b('0x63')+_[_0xb76b('0x64')](_0xb76b('0x6a'));if(_0x5143e6[_0x3cdd3a]||!_0x4be6a4[_0xb76b('0x65')]){_0x42843a=path[_0xb76b('0x61')](config['root'],_0x5d4549,_[_0xb76b('0x5f')](_0xb76b('0x75')));}if(!fs['existsSync'](_0x42843a)){throw new db[(_0xb76b('0x66'))][(_0xb76b('0x67'))](_[_0xb76b('0x64')](_0xb76b('0x6a'))+_0xb76b('0x6d'));}return _0x24b544[_0xb76b('0x68')](_0x42843a);}})[_0xb76b('0x24')](handleError(_0x24b544,null));};exports[_0xb76b('0x76')]=function(_0x101fb3,_0x394bf0){var _0x35d729={'offset':moment()['utcOffset']()};_0x35d729[_0xb76b('0x77')]=moment()[_0xb76b('0x78')](_0x35d729[_0xb76b('0x42')])[_0xb76b('0x79')](_0xb76b('0x7a'));return _0x394bf0[_0xb76b('0x30')](0xc8)['send'](_0x35d729);};
\ No newline at end of file
+var _0xa276=['getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','custom','Sequelize','upperFirst','download','getLogoLogin','default_loginLogo.svg','ValidationError','\x20not\x20found','addPreferred','getPreferred','default_preferred.png','default','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','Setting','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','update','body','file','filename','logo','loginLogo'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xa276,0x9a));var _0x6a27=function(_0x56d848,_0x2efd64){_0x56d848=_0x56d848-0x0;var _0x459956=_0xa276[_0x56d848];return _0x459956;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a27('0x0'));var zipdir=require(_0x6a27('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a27('0x2'));var moment=require(_0x6a27('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a27('0x4'));var util=require(_0x6a27('0x5'));var path=require(_0x6a27('0x6'));var sox=require('sox');var csv=require(_0x6a27('0x7'));var ejs=require(_0x6a27('0x8'));var fs=require('fs');var fs_extra=require(_0x6a27('0x9'));var _=require('lodash');var squel=require(_0x6a27('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a27('0xb'));var Papa=require(_0x6a27('0xc'));var Redis=require(_0x6a27('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a27('0xe'));var hardwareService=require(_0x6a27('0xf'));var logger=require(_0x6a27('0x10'))(_0x6a27('0x11'));var utils=require(_0x6a27('0x12'));var config=require(_0x6a27('0x13'));var licenseUtil=require(_0x6a27('0x14'));var db=require(_0x6a27('0x15'))['db'];var jayson=require(_0x6a27('0x16'));var client=jayson['client'][_0x6a27('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x59012a,_0x4f5ce4,_0x2c7339,_0x1e987f){return new BPromise(function(_0x39ef85,_0x5b28c6){var _0x1b574a=_0x1e987f||client;return _0x1b574a[_0x6a27('0x18')](_0x59012a,_0x2c7339)[_0x6a27('0x19')](function(_0x8f297b){logger[_0x6a27('0x1a')]('Setting,\x20%s,\x20%s',_0x4f5ce4,'request\x20sent');logger[_0x6a27('0x1b')](_0x6a27('0x1c'),_0x4f5ce4,_0x6a27('0x1d'),JSON[_0x6a27('0x1e')](_0x8f297b));if(_0x8f297b[_0x6a27('0x1f')]){if(_0x8f297b[_0x6a27('0x1f')]['code']===0x1f4){logger[_0x6a27('0x1f')](_0x6a27('0x20'),_0x4f5ce4,_0x8f297b[_0x6a27('0x1f')][_0x6a27('0x21')]);return _0x5b28c6(_0x8f297b['error'][_0x6a27('0x21')]);}logger[_0x6a27('0x1f')](_0x6a27('0x20'),_0x4f5ce4,_0x8f297b[_0x6a27('0x1f')]['message']);return _0x39ef85(_0x8f297b['error'][_0x6a27('0x21')]);}else{logger[_0x6a27('0x1a')]('Setting,\x20%s,\x20%s',_0x4f5ce4,_0x6a27('0x1d'));_0x39ef85(_0x8f297b[_0x6a27('0x22')][_0x6a27('0x21')]);}})[_0x6a27('0x23')](function(_0x12ead4){logger[_0x6a27('0x1f')](_0x6a27('0x20'),_0x4f5ce4,_0x12ead4);_0x5b28c6(_0x12ead4);});});}function respondWithStatusCode(_0x13e148,_0x5e3a2e){_0x5e3a2e=_0x5e3a2e||0xcc;return function(_0x241029){if(_0x241029){return _0x13e148[_0x6a27('0x24')](_0x5e3a2e);}return _0x13e148[_0x6a27('0x25')](_0x5e3a2e)[_0x6a27('0x26')]();};}function respondWithResult(_0x2b3e5e,_0x5f4897){_0x5f4897=_0x5f4897||0xc8;return function(_0x5b725c){if(_0x5b725c){return _0x2b3e5e[_0x6a27('0x25')](_0x5f4897)[_0x6a27('0x27')](_0x5b725c);}};}function respondWithFilteredResult(_0x73dc52,_0x354781){return function(_0x54fc6c){if(_0x54fc6c){var _0x118df4=typeof _0x354781['offset']==='undefined'&&typeof _0x354781[_0x6a27('0x28')]===_0x6a27('0x29');var _0x4d1711=_0x54fc6c[_0x6a27('0x2a')];var _0x52cc5d=_0x118df4?0x0:_0x354781[_0x6a27('0x2b')];var _0xa42f9c=_0x118df4?_0x54fc6c['count']:_0x354781[_0x6a27('0x2b')]+_0x354781[_0x6a27('0x28')];var _0x3a1415;if(_0xa42f9c>=_0x4d1711){_0xa42f9c=_0x4d1711;_0x3a1415=0xc8;}else{_0x3a1415=0xce;}_0x73dc52[_0x6a27('0x25')](_0x3a1415);return _0x73dc52[_0x6a27('0x2c')](_0x6a27('0x2d'),_0x52cc5d+'-'+_0xa42f9c+'/'+_0x4d1711)[_0x6a27('0x27')](_0x54fc6c);}return null;};}function patchUpdates(_0x1d37f2){return function(_0x588df7){try{jsonpatch[_0x6a27('0x2e')](_0x588df7,_0x1d37f2,!![]);}catch(_0x10fc65){return BPromise[_0x6a27('0x2f')](_0x10fc65);}return _0x588df7[_0x6a27('0x30')]();};}function saveUpdates(_0x4f08de,_0x4ae1c6){return function(_0x20060f){if(_0x20060f){return _0x20060f['update'](_0x4f08de)[_0x6a27('0x19')](function(_0x94a431){return _0x94a431;});}return null;};}function removeEntity(_0x14d0aa,_0x5beac8){return function(_0x1ab3b0){if(_0x1ab3b0){return _0x1ab3b0[_0x6a27('0x31')]()[_0x6a27('0x19')](function(){_0x14d0aa[_0x6a27('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbb3d4,_0x574df6){return function(_0x1529c6){if(!_0x1529c6){_0xbb3d4[_0x6a27('0x24')](0x194);}return _0x1529c6;};}function handleError(_0x78e3c0,_0x1a96e4){_0x1a96e4=_0x1a96e4||0x1f4;return function(_0x164d6f){logger['error'](_0x164d6f[_0x6a27('0x32')]);if(_0x164d6f[_0x6a27('0x33')]){delete _0x164d6f['name'];}_0x78e3c0['status'](_0x1a96e4)[_0x6a27('0x34')](_0x164d6f);};}exports[_0x6a27('0x35')]=function(_0x28b1bc,_0x34e672){var _0x1d9c1c={},_0x3c3ad2={},_0x556b2a={'count':0x0,'rows':[]};var _0x2d5ab3=_['map'](db[_0x6a27('0x36')][_0x6a27('0x37')],function(_0x61939d){return{'name':_0x61939d[_0x6a27('0x38')],'type':_0x61939d[_0x6a27('0x39')][_0x6a27('0x3a')]};});_0x3c3ad2[_0x6a27('0x3b')]=_[_0x6a27('0x3c')](_0x2d5ab3,'name');_0x3c3ad2[_0x6a27('0x3d')]=_['keys'](_0x28b1bc['query']);_0x3c3ad2[_0x6a27('0x3e')]=_[_0x6a27('0x3f')](_0x3c3ad2[_0x6a27('0x3b')],_0x3c3ad2[_0x6a27('0x3d')]);_0x1d9c1c[_0x6a27('0x40')]=_[_0x6a27('0x3f')](_0x3c3ad2['model'],qs['fields'](_0x28b1bc[_0x6a27('0x3d')][_0x6a27('0x41')]));_0x1d9c1c['attributes']=_0x1d9c1c[_0x6a27('0x40')][_0x6a27('0x42')]?_0x1d9c1c['attributes']:_0x3c3ad2['model'];if(!_0x28b1bc[_0x6a27('0x3d')]['hasOwnProperty'](_0x6a27('0x43'))){_0x1d9c1c[_0x6a27('0x28')]=qs[_0x6a27('0x28')](_0x28b1bc[_0x6a27('0x3d')]['limit']);_0x1d9c1c[_0x6a27('0x2b')]=qs[_0x6a27('0x2b')](_0x28b1bc['query'][_0x6a27('0x2b')]);}_0x1d9c1c['order']=qs[_0x6a27('0x44')](_0x28b1bc[_0x6a27('0x3d')][_0x6a27('0x44')]);_0x1d9c1c[_0x6a27('0x45')]=qs['filters'](_['pick'](_0x28b1bc[_0x6a27('0x3d')],_0x3c3ad2[_0x6a27('0x3e')]),_0x2d5ab3);if(_0x28b1bc[_0x6a27('0x3d')][_0x6a27('0x46')]){_0x1d9c1c[_0x6a27('0x45')]=_['merge'](_0x1d9c1c[_0x6a27('0x45')],{'$or':_[_0x6a27('0x3c')](_0x2d5ab3,function(_0x35979f){if(_0x35979f[_0x6a27('0x39')]!==_0x6a27('0x47')){var _0x128c6d={};_0x128c6d[_0x35979f[_0x6a27('0x33')]]={'$like':'%'+_0x28b1bc[_0x6a27('0x3d')][_0x6a27('0x46')]+'%'};return _0x128c6d;}})});}_0x1d9c1c=_[_0x6a27('0x48')]({},_0x1d9c1c,_0x28b1bc[_0x6a27('0x49')]);var _0x38494f={'where':_0x1d9c1c[_0x6a27('0x45')]};return db[_0x6a27('0x36')][_0x6a27('0x2a')](_0x38494f)[_0x6a27('0x19')](function(_0x33972d){_0x556b2a[_0x6a27('0x2a')]=_0x33972d;if(_0x28b1bc[_0x6a27('0x3d')][_0x6a27('0x4a')]){_0x1d9c1c[_0x6a27('0x4b')]=[{'all':!![]}];}return db['Setting'][_0x6a27('0x4c')](_0x1d9c1c);})['then'](function(_0x5b8948){_0x556b2a[_0x6a27('0x4d')]=_0x5b8948;return _0x556b2a;})[_0x6a27('0x19')](respondWithFilteredResult(_0x34e672,_0x1d9c1c))[_0x6a27('0x23')](handleError(_0x34e672,null));};exports[_0x6a27('0x4e')]=function(_0x5290ef,_0x3cf7d7){var _0x30e5e9={'raw':![],'where':{'id':_0x5290ef[_0x6a27('0x4f')]['id']}},_0x5db14a={};_0x5db14a['model']=_['keys'](db[_0x6a27('0x36')][_0x6a27('0x37')]);_0x5db14a['query']=_[_0x6a27('0x50')](_0x5290ef['query']);_0x5db14a[_0x6a27('0x3e')]=_[_0x6a27('0x3f')](_0x5db14a['model'],_0x5db14a['query']);_0x30e5e9[_0x6a27('0x40')]=_[_0x6a27('0x3f')](_0x5db14a['model'],qs[_0x6a27('0x41')](_0x5290ef[_0x6a27('0x3d')][_0x6a27('0x41')]));_0x30e5e9[_0x6a27('0x40')]=_0x30e5e9[_0x6a27('0x40')][_0x6a27('0x42')]?_0x30e5e9['attributes']:_0x5db14a[_0x6a27('0x3b')];if(_0x5290ef[_0x6a27('0x3d')][_0x6a27('0x4a')]){_0x30e5e9['include']=[{'all':!![]}];}_0x30e5e9=_[_0x6a27('0x48')]({},_0x30e5e9,_0x5290ef[_0x6a27('0x49')]);return db[_0x6a27('0x36')][_0x6a27('0x51')](_0x30e5e9)[_0x6a27('0x19')](handleEntityNotFound(_0x3cf7d7,null))['then'](respondWithResult(_0x3cf7d7,null))['catch'](handleError(_0x3cf7d7,null));};exports[_0x6a27('0x52')]=function(_0x5aab0c,_0x9ab91b){if(_0x5aab0c[_0x6a27('0x53')]['id']){delete _0x5aab0c[_0x6a27('0x53')]['id'];}return db[_0x6a27('0x36')][_0x6a27('0x51')]({'where':{'id':_0x5aab0c[_0x6a27('0x4f')]['id']}})[_0x6a27('0x19')](handleEntityNotFound(_0x9ab91b,null))['then'](saveUpdates(_0x5aab0c[_0x6a27('0x53')],null))[_0x6a27('0x19')](respondWithResult(_0x9ab91b,null))['catch'](handleError(_0x9ab91b,null));};exports['addLogo']=function(_0x557cf6,_0x165e6d,_0x1e5d5c){if(_0x557cf6[_0x6a27('0x54')]&&_0x557cf6[_0x6a27('0x54')][_0x6a27('0x55')]){_0x557cf6[_0x6a27('0x53')][_0x6a27('0x56')]=_0x557cf6[_0x6a27('0x54')][_0x6a27('0x55')];}return db[_0x6a27('0x36')][_0x6a27('0x51')]({'where':{'id':_0x557cf6[_0x6a27('0x4f')]['id']}})[_0x6a27('0x19')](handleEntityNotFound(_0x165e6d,null))[_0x6a27('0x19')](saveUpdates(_0x557cf6[_0x6a27('0x53')],null))['then'](respondWithResult(_0x165e6d,null))[_0x6a27('0x23')](handleError(_0x165e6d,null));};exports['addLogoLogin']=function(_0x100a9f,_0x3826d4,_0x14bac7){if(_0x100a9f[_0x6a27('0x54')]&&_0x100a9f[_0x6a27('0x54')]['filename']){_0x100a9f[_0x6a27('0x53')][_0x6a27('0x57')]=_0x100a9f[_0x6a27('0x54')][_0x6a27('0x55')];}return db[_0x6a27('0x36')]['find']({'where':{'id':_0x100a9f[_0x6a27('0x4f')]['id']}})[_0x6a27('0x19')](handleEntityNotFound(_0x3826d4,null))['then'](saveUpdates(_0x100a9f[_0x6a27('0x53')],null))[_0x6a27('0x19')](respondWithResult(_0x3826d4,null))[_0x6a27('0x23')](handleError(_0x3826d4,null));};var utilLicense=require('../../config/license/util');exports[_0x6a27('0x58')]=function(_0x2af79c,_0x1e1cbc,_0x304a10){var _0x1e77ea=_0x6a27('0x59');var _0xc6eeaa={'custom':![]};return utilLicense[_0x6a27('0x5a')]()[_0x6a27('0x19')](function(_0x24811a){if(_0x24811a){_0xc6eeaa=_0x24811a;}return db[_0x6a27('0x36')][_0x6a27('0x51')]({'where':{'id':_0x2af79c[_0x6a27('0x4f')]['id']},'attributes':[_0x6a27('0x56'),_0x6a27('0x57'),_0x6a27('0x5b'),_0x6a27('0x5c'),_0x6a27('0x5d'),_0x6a27('0x5e'),_0x6a27('0x5f'),_0x6a27('0x60')],'raw':!![]});})[_0x6a27('0x19')](handleEntityNotFound(_0x1e1cbc,null))[_0x6a27('0x19')](function(_0x3b4f4d){if(_0x3b4f4d){var _0x349490=_0x3b4f4d['logo']&&fs[_0x6a27('0x61')](path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x1e77ea,_[_0x6a27('0x64')](_0x3b4f4d[_0x6a27('0x56')])))?path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x1e77ea,_[_0x6a27('0x64')](_0x3b4f4d[_0x6a27('0x56')])):path['join'](config[_0x6a27('0x63')],_0x1e77ea,_[_0x6a27('0x64')](_0x6a27('0x65')));var _0x3bc5f9='default'+_['upperFirst']('logo');if(_0x3b4f4d[_0x3bc5f9]||!_0xc6eeaa[_0x6a27('0x66')]){_0x349490=path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x1e77ea,_[_0x6a27('0x64')](_0x6a27('0x65')));}if(!fs[_0x6a27('0x61')](_0x349490)){throw new db[(_0x6a27('0x67'))]['ValidationError'](_[_0x6a27('0x68')](_0x6a27('0x56'))+'\x20not\x20found');}return _0x1e1cbc[_0x6a27('0x69')](_0x349490);}})[_0x6a27('0x23')](handleError(_0x1e1cbc,null));};var utilLicense=require(_0x6a27('0x14'));exports[_0x6a27('0x6a')]=function(_0x499fa2,_0x362084,_0x59e668){var _0x347a74=_0x6a27('0x59');var _0x3e1a1f={'custom':![]};return utilLicense[_0x6a27('0x5a')]()[_0x6a27('0x19')](function(_0x34e8fd){if(_0x34e8fd){_0x3e1a1f=_0x34e8fd;}return db['Setting'][_0x6a27('0x51')]({'where':{'id':_0x499fa2[_0x6a27('0x4f')]['id']},'attributes':[_0x6a27('0x56'),'loginLogo',_0x6a27('0x5b'),_0x6a27('0x5c'),_0x6a27('0x5d'),'defaultLoginLogo',_0x6a27('0x5f'),_0x6a27('0x60')],'raw':!![]});})[_0x6a27('0x19')](handleEntityNotFound(_0x362084,null))[_0x6a27('0x19')](function(_0xef42cd){if(_0xef42cd){var _0x536d42=_0xef42cd['loginLogo']&&fs[_0x6a27('0x61')](path['join'](config[_0x6a27('0x63')],_0x347a74,_['toLower'](_0xef42cd[_0x6a27('0x57')])))?path[_0x6a27('0x62')](config['root'],_0x347a74,_[_0x6a27('0x64')](_0xef42cd['loginLogo'])):path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x347a74,_['toLower'](_0x6a27('0x6b')));var _0x13ab6a='default'+_[_0x6a27('0x68')](_0x6a27('0x57'));if(_0xef42cd[_0x13ab6a]||!_0x3e1a1f[_0x6a27('0x66')]){_0x536d42=path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x347a74,_[_0x6a27('0x64')]('default_loginLogo.svg'));}if(!fs[_0x6a27('0x61')](_0x536d42)){throw new db[(_0x6a27('0x67'))][(_0x6a27('0x6c'))](_[_0x6a27('0x68')]('loginLogo')+_0x6a27('0x6d'));}return _0x362084[_0x6a27('0x69')](_0x536d42);}})['catch'](handleError(_0x362084,null));};exports['gdpr']=function(_0x563493,_0x3b2c8c){return db[_0x6a27('0x36')][_0x6a27('0x51')]({'where':{'id':_0x563493[_0x6a27('0x4f')]['id']},'attributes':['securePassword']})[_0x6a27('0x19')](respondWithResult(_0x3b2c8c,null))[_0x6a27('0x23')](handleError(_0x3b2c8c,null));};exports[_0x6a27('0x6e')]=function(_0x1f3b3b,_0x2cd8fa,_0x387dc3){if(_0x1f3b3b[_0x6a27('0x54')]&&_0x1f3b3b[_0x6a27('0x54')]['filename']){_0x1f3b3b['body'][_0x6a27('0x5b')]=_0x1f3b3b[_0x6a27('0x54')][_0x6a27('0x55')];}return db[_0x6a27('0x36')][_0x6a27('0x51')]({'where':{'id':_0x1f3b3b[_0x6a27('0x4f')]['id']}})[_0x6a27('0x19')](handleEntityNotFound(_0x2cd8fa,null))['then'](saveUpdates(_0x1f3b3b[_0x6a27('0x53')],null))['then'](respondWithResult(_0x2cd8fa,null))[_0x6a27('0x23')](handleError(_0x2cd8fa,null));};var utilLicense=require(_0x6a27('0x14'));exports[_0x6a27('0x6f')]=function(_0x2792c8,_0x33eec3,_0x2640c1){var _0x88bec1=_0x6a27('0x59');var _0x567c14={'custom':![]};return utilLicense['getLicense']()[_0x6a27('0x19')](function(_0x510530){if(_0x510530){_0x567c14=_0x510530;}return db[_0x6a27('0x36')][_0x6a27('0x51')]({'where':{'id':_0x2792c8[_0x6a27('0x4f')]['id']},'attributes':[_0x6a27('0x56'),_0x6a27('0x57'),_0x6a27('0x5b'),_0x6a27('0x5c'),_0x6a27('0x5d'),_0x6a27('0x5e'),_0x6a27('0x5f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x33eec3,null))[_0x6a27('0x19')](function(_0x53fd0f){if(_0x53fd0f){var _0x494e70=_0x53fd0f['preferred']&&fs[_0x6a27('0x61')](path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x88bec1,_['toLower'](_0x53fd0f[_0x6a27('0x5b')])))?path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x88bec1,_[_0x6a27('0x64')](_0x53fd0f[_0x6a27('0x5b')])):path['join'](config[_0x6a27('0x63')],_0x88bec1,_['toLower'](_0x6a27('0x70')));var _0x16143b=_0x6a27('0x71')+_[_0x6a27('0x68')](_0x6a27('0x5b'));if(_0x53fd0f[_0x16143b]||!_0x567c14[_0x6a27('0x66')]||!_0x567c14[_0x6a27('0x5b')]){_0x494e70=path['join'](config[_0x6a27('0x63')],_0x88bec1,_[_0x6a27('0x64')]('default_preferred.png'));}if(!fs['existsSync'](_0x494e70)){throw new db[(_0x6a27('0x67'))]['ValidationError'](_[_0x6a27('0x68')]('preferred')+'\x20not\x20found');}return _0x33eec3[_0x6a27('0x69')](_0x494e70);}})[_0x6a27('0x23')](handleError(_0x33eec3,null));};exports['addFavicon']=function(_0x231c54,_0x12830b,_0x5e8b80){if(_0x231c54[_0x6a27('0x54')]&&_0x231c54[_0x6a27('0x54')][_0x6a27('0x55')]){_0x231c54[_0x6a27('0x53')][_0x6a27('0x5c')]=_0x231c54[_0x6a27('0x54')][_0x6a27('0x55')];}return db['Setting'][_0x6a27('0x51')]({'where':{'id':_0x231c54[_0x6a27('0x4f')]['id']}})[_0x6a27('0x19')](handleEntityNotFound(_0x12830b,null))['then'](saveUpdates(_0x231c54[_0x6a27('0x53')],null))[_0x6a27('0x19')](respondWithResult(_0x12830b,null))[_0x6a27('0x23')](handleError(_0x12830b,null));};var utilLicense=require(_0x6a27('0x14'));exports[_0x6a27('0x72')]=function(_0x318628,_0xcc0bc8,_0x33c15f){var _0x1a249c='server/files/images/logos';var _0x1a1e0f={'custom':![]};return utilLicense[_0x6a27('0x5a')]()[_0x6a27('0x19')](function(_0x423c9d){if(_0x423c9d){_0x1a1e0f=_0x423c9d;}return db[_0x6a27('0x36')][_0x6a27('0x51')]({'where':{'id':_0x318628['params']['id']},'attributes':[_0x6a27('0x56'),'loginLogo',_0x6a27('0x5b'),_0x6a27('0x5c'),_0x6a27('0x5d'),_0x6a27('0x5e'),_0x6a27('0x5f'),_0x6a27('0x60')],'raw':!![]});})[_0x6a27('0x19')](handleEntityNotFound(_0xcc0bc8,null))[_0x6a27('0x19')](function(_0x19285d){if(_0x19285d){var _0x2bd376=_0x19285d[_0x6a27('0x5c')]&&fs[_0x6a27('0x61')](path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x1a249c,_['toLower'](_0x19285d['favicon'])))?path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x1a249c,_[_0x6a27('0x64')](_0x19285d[_0x6a27('0x5c')])):path['join'](config['root'],_0x1a249c,_[_0x6a27('0x64')](_0x6a27('0x73')));var _0x304a1f=_0x6a27('0x71')+_[_0x6a27('0x68')](_0x6a27('0x5c'));if(_0x19285d[_0x304a1f]||!_0x1a1e0f[_0x6a27('0x66')]){_0x2bd376=path[_0x6a27('0x62')](config[_0x6a27('0x63')],_0x1a249c,_['toLower'](_0x6a27('0x73')));}if(!fs[_0x6a27('0x61')](_0x2bd376)){throw new db[(_0x6a27('0x67'))][(_0x6a27('0x6c'))](_[_0x6a27('0x68')](_0x6a27('0x5c'))+_0x6a27('0x6d'));}return _0xcc0bc8[_0x6a27('0x69')](_0x2bd376);}})[_0x6a27('0x23')](handleError(_0xcc0bc8,null));};exports[_0x6a27('0x74')]=function(_0x6e700f,_0x18a6dd){var _0x560979={'offset':moment()[_0x6a27('0x75')]()};_0x560979[_0x6a27('0x76')]=moment()['utcOffset'](_0x560979['offset'])[_0x6a27('0x77')](_0x6a27('0x78'));return _0x18a6dd[_0x6a27('0x25')](0xc8)[_0x6a27('0x34')](_0x560979);};
\ No newline at end of file
index 237b9eb..64c3134 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x008c,0x188));var _0xc008=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0x008c[_0x2298f0];return _0x39b136;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0x7217,0x19e));var _0x7721=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x7217[_0x49ca18];return _0x145d54;};'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 30e0753..1cfcaa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6090=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','find','options','raw','where','attributes','map','include','model','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2e5249,_0xa4eed1){var _0x3f59fc=function(_0x2c6330){while(--_0x2c6330){_0x2e5249['push'](_0x2e5249['shift']());}};_0x3f59fc(++_0xa4eed1);}(_0x6090,0x15a));var _0x0609=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x6090[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0609('0x0'));var util=require('util');var moment=require(_0x0609('0x1'));var BPromise=require(_0x0609('0x2'));var rs=require(_0x0609('0x3'));var fs=require('fs');var Redis=require(_0x0609('0x4'));var db=require(_0x0609('0x5'))['db'];var utils=require(_0x0609('0x6'));var logger=require(_0x0609('0x7'))(_0x0609('0x8'));var config=require(_0x0609('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0609('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34bca3,_0x1f747e,_0x290759){return new BPromise(function(_0x5ef96e,_0x655d8){return client[_0x0609('0xb')](_0x34bca3,_0x290759)['then'](function(_0x1353f1){logger[_0x0609('0xc')](_0x0609('0xd'),_0x1f747e,_0x0609('0xe'));logger[_0x0609('0xf')](_0x0609('0x10'),_0x1f747e,_0x0609('0xe'),JSON[_0x0609('0x11')](_0x1353f1));if(_0x1353f1[_0x0609('0x12')]){if(_0x1353f1['error']['code']===0x1f4){logger['error'](_0x0609('0xd'),_0x1f747e,_0x1353f1[_0x0609('0x12')][_0x0609('0x13')]);return _0x655d8(_0x1353f1['error'][_0x0609('0x13')]);}logger[_0x0609('0x12')]('Setting,\x20%s,\x20%s',_0x1f747e,_0x1353f1[_0x0609('0x12')][_0x0609('0x13')]);return _0x5ef96e(_0x1353f1[_0x0609('0x12')]['message']);}else{logger[_0x0609('0xc')](_0x0609('0xd'),_0x1f747e,_0x0609('0xe'));_0x5ef96e(_0x1353f1[_0x0609('0x14')][_0x0609('0x13')]);}})[_0x0609('0x15')](function(_0x25e853){logger[_0x0609('0x12')](_0x0609('0xd'),_0x1f747e,_0x25e853);_0x655d8(_0x25e853);});});}exports[_0x0609('0x16')]=function(_0x50f587){var _0x8fbed8=this;return new Promise(function(_0x7f31e,_0xb6589f){return db['Setting'][_0x0609('0x17')]({'raw':_0x50f587[_0x0609('0x18')]?_0x50f587['options'][_0x0609('0x19')]===undefined?!![]:![]:!![],'where':_0x50f587['options']?_0x50f587['options'][_0x0609('0x1a')]||null:null,'attributes':_0x50f587[_0x0609('0x18')]?_0x50f587[_0x0609('0x18')][_0x0609('0x1b')]||null:null,'include':_0x50f587['options']?_0x50f587[_0x0609('0x18')]['include']?_[_0x0609('0x1c')](_0x50f587[_0x0609('0x18')][_0x0609('0x1d')],function(_0x211105){return{'model':db[_0x211105[_0x0609('0x1e')]],'as':_0x211105['as'],'attributes':_0x211105[_0x0609('0x1b')],'include':_0x211105[_0x0609('0x1d')]?_[_0x0609('0x1c')](_0x211105[_0x0609('0x1d')],function(_0x4c5222){return{'model':db[_0x4c5222['model']],'as':_0x4c5222['as'],'attributes':_0x4c5222['attributes'],'include':_0x4c5222[_0x0609('0x1d')]?_['map'](_0x4c5222[_0x0609('0x1d')],function(_0x1f1d28){return{'model':db[_0x1f1d28[_0x0609('0x1e')]],'as':_0x1f1d28['as'],'attributes':_0x1f1d28['attributes']};}):[]};}):[]};}):[]:[]})[_0x0609('0x1f')](function(_0x5ba895){logger['info'](_0x0609('0x16'),_0x50f587);logger['debug']('ShowSetting',_0x50f587,JSON[_0x0609('0x11')](_0x5ba895));_0x7f31e(_0x5ba895);})[_0x0609('0x15')](function(_0x3144dd){logger[_0x0609('0x12')](_0x0609('0x16'),_0x3144dd[_0x0609('0x13')],_0x50f587);_0xb6589f(_0x8fbed8[_0x0609('0x12')](0x1f4,_0x3144dd[_0x0609('0x13')]));});});};
\ No newline at end of file
+var _0x2f04=['request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSetting','Setting','find','raw','options','where','attributes','map','include','model','lodash','moment','rpc','../../config/environment','client','http'];(function(_0x57bb74,_0x4755ac){var _0x44e0eb=function(_0x19e800){while(--_0x19e800){_0x57bb74['push'](_0x57bb74['shift']());}};_0x44e0eb(++_0x4755ac);}(_0x2f04,0x6a));var _0x42f0=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x2f04[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x42f0('0x0'));var util=require('util');var moment=require(_0x42f0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x42f0('0x2'));var config=require(_0x42f0('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x42f0('0x4')][_0x42f0('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x189514,_0x4bbdc4,_0x1e73bd){return new BPromise(function(_0x176a08,_0x83dcdf){return client[_0x42f0('0x6')](_0x189514,_0x1e73bd)[_0x42f0('0x7')](function(_0x29da85){logger[_0x42f0('0x8')](_0x42f0('0x9'),_0x4bbdc4,_0x42f0('0xa'));logger[_0x42f0('0xb')](_0x42f0('0xc'),_0x4bbdc4,_0x42f0('0xa'),JSON[_0x42f0('0xd')](_0x29da85));if(_0x29da85['error']){if(_0x29da85[_0x42f0('0xe')][_0x42f0('0xf')]===0x1f4){logger[_0x42f0('0xe')](_0x42f0('0x9'),_0x4bbdc4,_0x29da85[_0x42f0('0xe')][_0x42f0('0x10')]);return _0x83dcdf(_0x29da85[_0x42f0('0xe')][_0x42f0('0x10')]);}logger[_0x42f0('0xe')]('Setting,\x20%s,\x20%s',_0x4bbdc4,_0x29da85[_0x42f0('0xe')][_0x42f0('0x10')]);return _0x176a08(_0x29da85[_0x42f0('0xe')][_0x42f0('0x10')]);}else{logger[_0x42f0('0x8')](_0x42f0('0x9'),_0x4bbdc4,_0x42f0('0xa'));_0x176a08(_0x29da85['result'][_0x42f0('0x10')]);}})[_0x42f0('0x11')](function(_0x256ad9){logger['error']('Setting,\x20%s,\x20%s',_0x4bbdc4,_0x256ad9);_0x83dcdf(_0x256ad9);});});}exports[_0x42f0('0x12')]=function(_0x583dc7){var _0x5e66ac=this;return new Promise(function(_0x2d19d1,_0x2e8d54){return db[_0x42f0('0x13')][_0x42f0('0x14')]({'raw':_0x583dc7['options']?_0x583dc7['options'][_0x42f0('0x15')]===undefined?!![]:![]:!![],'where':_0x583dc7[_0x42f0('0x16')]?_0x583dc7['options'][_0x42f0('0x17')]||null:null,'attributes':_0x583dc7[_0x42f0('0x16')]?_0x583dc7[_0x42f0('0x16')][_0x42f0('0x18')]||null:null,'include':_0x583dc7[_0x42f0('0x16')]?_0x583dc7[_0x42f0('0x16')]['include']?_[_0x42f0('0x19')](_0x583dc7[_0x42f0('0x16')][_0x42f0('0x1a')],function(_0x2d5f4c){return{'model':db[_0x2d5f4c[_0x42f0('0x1b')]],'as':_0x2d5f4c['as'],'attributes':_0x2d5f4c[_0x42f0('0x18')],'include':_0x2d5f4c[_0x42f0('0x1a')]?_['map'](_0x2d5f4c[_0x42f0('0x1a')],function(_0x2a4709){return{'model':db[_0x2a4709[_0x42f0('0x1b')]],'as':_0x2a4709['as'],'attributes':_0x2a4709[_0x42f0('0x18')],'include':_0x2a4709[_0x42f0('0x1a')]?_[_0x42f0('0x19')](_0x2a4709[_0x42f0('0x1a')],function(_0x43346d){return{'model':db[_0x43346d['model']],'as':_0x43346d['as'],'attributes':_0x43346d['attributes']};}):[]};}):[]};}):[]:[]})[_0x42f0('0x7')](function(_0x55b901){logger[_0x42f0('0x8')](_0x42f0('0x12'),_0x583dc7);logger[_0x42f0('0xb')](_0x42f0('0x12'),_0x583dc7,JSON[_0x42f0('0xd')](_0x55b901));_0x2d19d1(_0x55b901);})[_0x42f0('0x11')](function(_0x311204){logger[_0x42f0('0xe')]('ShowSetting',_0x311204[_0x42f0('0x10')],_0x583dc7);_0x2e8d54(_0x5e66ac[_0x42f0('0xe')](0x1f4,_0x311204[_0x42f0('0x10')]));});});};
\ No newline at end of file
index 7ada9fd..a3301b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7217,0x19e));var _0x7721=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7217[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x1e685f,_0x2eda9c){_0x1e685f=_0x1e685f-0x0;var _0x1457cc=_0xf494[_0x1e685f];return _0x1457cc;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router;
\ No newline at end of file
index ee602e6..c19dd4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37d7=['sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x5dd25d,_0x46e0cb){var _0x52df61=function(_0x3ff6f6){while(--_0x3ff6f6){_0x5dd25d['push'](_0x5dd25d['shift']());}};_0x52df61(++_0x46e0cb);}(_0x37d7,0x108));var _0x737d=function(_0x582f8b,_0x27e0d6){_0x582f8b=_0x582f8b-0x0;var _0x46cfcc=_0x37d7[_0x582f8b];return _0x46cfcc;};'use strict';var Sequelize=require(_0x737d('0x0'));var rs=require(_0x737d('0x1'));module[_0x737d('0x2')]={'name':{'type':Sequelize[_0x737d('0x3')],'unique':_0x737d('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x737d('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x737d('0x3')],'defaultValue':function(){return rs[_0x737d('0x5')]();}},'phone':{'type':Sequelize[_0x737d('0x3')]},'type':{'type':Sequelize[_0x737d('0x6')](_0x737d('0x7'),_0x737d('0x8'),_0x737d('0x9'),_0x737d('0xa'),_0x737d('0xb'),_0x737d('0xc'),'bandwidth','csc','infobip',_0x737d('0xd'))},'accountSid':{'type':Sequelize[_0x737d('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x737d('0x3')]},'smsMethod':{'type':Sequelize[_0x737d('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x737d('0x3')]},'apiKey':{'type':Sequelize[_0x737d('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x737d('0x3')]},'deliveryReport':{'type':Sequelize[_0x737d('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x737d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x737d('0xf')],'defaultValue':function(){return _0x737d('0x10');}},'notificationSound':{'type':Sequelize[_0x737d('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x737d('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x737d('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x737d('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x737d('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x737d('0x11')],'comment':_0x737d('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x737d('0xe')],'defaultValue':![],'comment':_0x737d('0x13'),'set':function(_0x4c1807){if(!_0x4c1807)this[_0x737d('0x14')](_0x737d('0x15'),null);this['setDataValue']('mandatoryDisposition',_0x4c1807);}}};
\ No newline at end of file
+var _0xc069=['clicksend','plivo','bandwidth','csc','intelepeer','ENUM','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','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','generate','skebby'];(function(_0x291f91,_0x15e63f){var _0x2a2f8f=function(_0x3f0264){while(--_0x3f0264){_0x291f91['push'](_0x291f91['shift']());}};_0x2a2f8f(++_0x15e63f);}(_0xc069,0x117));var _0x9c06=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc069[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x9c06('0x0'));var rs=require(_0x9c06('0x1'));module[_0x9c06('0x2')]={'name':{'type':Sequelize[_0x9c06('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x9c06('0x3')],'defaultValue':function(){return rs[_0x9c06('0x4')]();}},'phone':{'type':Sequelize[_0x9c06('0x3')]},'type':{'type':Sequelize['ENUM']('twilio',_0x9c06('0x5'),'connectel',_0x9c06('0x6'),_0x9c06('0x7'),'clickatell',_0x9c06('0x8'),_0x9c06('0x9'),'infobip',_0x9c06('0xa'))},'accountSid':{'type':Sequelize[_0x9c06('0x3')]},'authId':{'type':Sequelize[_0x9c06('0x3')]},'authToken':{'type':Sequelize[_0x9c06('0x3')]},'smsMethod':{'type':Sequelize[_0x9c06('0xb')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9c06('0x3')]},'apiKey':{'type':Sequelize[_0x9c06('0x3')]},'applicationId':{'type':Sequelize[_0x9c06('0x3')]},'accountId':{'type':Sequelize[_0x9c06('0x3')]},'senderString':{'type':Sequelize[_0x9c06('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x9c06('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9c06('0xc')],'defaultValue':function(){return _0x9c06('0xd');}},'notificationSound':{'type':Sequelize[_0x9c06('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9c06('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9c06('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9c06('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9c06('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9c06('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9c06('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9c06('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xf428ac){if(!_0xf428ac)this[_0x9c06('0x11')](_0x9c06('0x12'),null);this[_0x9c06('0x11')]('mandatoryDisposition',_0xf428ac);}}};
\ No newline at end of file
index 2b79e4b..a763b56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd87=['message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','get','SmsAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','show','params','Pause','keys','include','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','priority','asc','Sequelize','createdAt','updatedAt','ListId','twilio','From','messageId','skebby','sender','text','from','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','list','omit','contact','SmsInteraction','interaction','created','autoclose','close','unmanaged','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','info','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','List','DESC','out','SmsMessage','Messages','spread','dataValues','push','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','skebby_dispatch_id','connectel','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','bandwidth','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','csc'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xcd87,0xf3));var _0x7cd8=function(_0x1a853d,_0x2b8928){_0x1a853d=_0x1a853d-0x0;var _0x48d1e7=_0xcd87[_0x1a853d];return _0x48d1e7;};'use strict';var emlformat=require(_0x7cd8('0x0'));var rimraf=require(_0x7cd8('0x1'));var zipdir=require(_0x7cd8('0x2'));var jsonpatch=require(_0x7cd8('0x3'));var rp=require('request-promise');var moment=require(_0x7cd8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7cd8('0x5'));var util=require(_0x7cd8('0x6'));var path=require(_0x7cd8('0x7'));var sox=require(_0x7cd8('0x8'));var csv=require('to-csv');var ejs=require(_0x7cd8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7cd8('0xa'));var squel=require(_0x7cd8('0xb'));var crypto=require(_0x7cd8('0xc'));var jsforce=require(_0x7cd8('0xd'));var deskjs=require(_0x7cd8('0xe'));var toCsv=require(_0x7cd8('0xf'));var querystring=require(_0x7cd8('0x10'));var Papa=require(_0x7cd8('0x11'));var Redis=require(_0x7cd8('0x12'));var authService=require(_0x7cd8('0x13'));var qs=require(_0x7cd8('0x14'));var as=require(_0x7cd8('0x15'));var hardwareService=require(_0x7cd8('0x16'));var logger=require(_0x7cd8('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7cd8('0x18'));var db=require(_0x7cd8('0x19'))['db'];config[_0x7cd8('0x1a')]=_[_0x7cd8('0x1b')](config[_0x7cd8('0x1a')],{'host':_0x7cd8('0x1c'),'port':0x18eb});var socket=require(_0x7cd8('0x1d'))(new Redis(config['redis']));require(_0x7cd8('0x1e'))[_0x7cd8('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x7cd8('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3b0dad,_0x1cc069,_0x407dc0,_0x5c7ccd){return new BPromise(function(_0x4058c2,_0x4a4526){var _0x328c19=_0x5c7ccd||client;return _0x328c19[_0x7cd8('0x21')](_0x3b0dad,_0x407dc0)[_0x7cd8('0x22')](function(_0x595d26){logger['info'](_0x7cd8('0x23'),_0x1cc069,_0x7cd8('0x24'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1cc069,_0x7cd8('0x24'),JSON[_0x7cd8('0x25')](_0x595d26));if(_0x595d26[_0x7cd8('0x26')]){if(_0x595d26[_0x7cd8('0x26')][_0x7cd8('0x27')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x1cc069,_0x595d26[_0x7cd8('0x26')][_0x7cd8('0x28')]);return _0x4a4526(_0x595d26['error']['message']);}logger[_0x7cd8('0x26')](_0x7cd8('0x23'),_0x1cc069,_0x595d26[_0x7cd8('0x26')]['message']);return _0x4058c2(_0x595d26[_0x7cd8('0x26')][_0x7cd8('0x28')]);}else{logger['info'](_0x7cd8('0x23'),_0x1cc069,_0x7cd8('0x24'));_0x4058c2(_0x595d26[_0x7cd8('0x29')][_0x7cd8('0x28')]);}})[_0x7cd8('0x2a')](function(_0x20ea63){logger['error'](_0x7cd8('0x23'),_0x1cc069,_0x20ea63);_0x4a4526(_0x20ea63);});});}function respondWithStatusCode(_0x4cf7b7,_0x182f70){_0x182f70=_0x182f70||0xcc;return function(_0x32025d){if(_0x32025d){return _0x4cf7b7[_0x7cd8('0x2b')](_0x182f70);}return _0x4cf7b7[_0x7cd8('0x2c')](_0x182f70)['end']();};}function respondWithResult(_0x3c709a,_0x363cbf){_0x363cbf=_0x363cbf||0xc8;return function(_0x13ff99){if(_0x13ff99){return _0x3c709a['status'](_0x363cbf)[_0x7cd8('0x2d')](_0x13ff99);}};}function respondWithFilteredResult(_0x53559b,_0x253508){return function(_0x5e3742){if(_0x5e3742){var _0x299f6=typeof _0x253508['offset']==='undefined'&&typeof _0x253508[_0x7cd8('0x2e')]===_0x7cd8('0x2f');var _0xf22dac=_0x5e3742[_0x7cd8('0x30')];var _0x294e6c=_0x299f6?0x0:_0x253508[_0x7cd8('0x31')];var _0x402c94=_0x299f6?_0x5e3742['count']:_0x253508[_0x7cd8('0x31')]+_0x253508[_0x7cd8('0x2e')];var _0x23ae2b;if(_0x402c94>=_0xf22dac){_0x402c94=_0xf22dac;_0x23ae2b=0xc8;}else{_0x23ae2b=0xce;}_0x53559b['status'](_0x23ae2b);return _0x53559b[_0x7cd8('0x32')](_0x7cd8('0x33'),_0x294e6c+'-'+_0x402c94+'/'+_0xf22dac)['json'](_0x5e3742);}return null;};}function patchUpdates(_0x3d8ee4){return function(_0x387da8){try{jsonpatch['apply'](_0x387da8,_0x3d8ee4,!![]);}catch(_0x40d8ff){return BPromise[_0x7cd8('0x34')](_0x40d8ff);}return _0x387da8[_0x7cd8('0x35')]();};}function saveUpdates(_0x178405,_0x479f5b){return function(_0x3659e7){if(_0x3659e7){return _0x3659e7[_0x7cd8('0x36')](_0x178405)[_0x7cd8('0x22')](function(_0x3305a1){return _0x3305a1;});}return null;};}function removeEntity(_0x498927,_0x3cc24f){return function(_0x36f042){if(_0x36f042){return _0x36f042['destroy']()[_0x7cd8('0x22')](function(){var _0x3f9964=_0x36f042[_0x7cd8('0x37')]({'plain':!![]});var _0x486ea3=_0x7cd8('0x38');return db[_0x7cd8('0x39')]['destroy']({'where':{'type':_0x486ea3,'resourceId':_0x3f9964['id']}})[_0x7cd8('0x22')](function(){return _0x36f042;});})[_0x7cd8('0x22')](function(){_0x498927[_0x7cd8('0x2c')](0xcc)[_0x7cd8('0x3a')]();});}};}function handleEntityNotFound(_0x1a4141,_0x52a77e){return function(_0x54880e){if(!_0x54880e){_0x1a4141['sendStatus'](0x194);}return _0x54880e;};}function handleError(_0x2af8a5,_0x3f2e69){_0x3f2e69=_0x3f2e69||0x1f4;return function(_0x323b60){logger[_0x7cd8('0x26')](_0x323b60[_0x7cd8('0x3b')]);if(_0x323b60[_0x7cd8('0x3c')]){delete _0x323b60[_0x7cd8('0x3c')];}_0x2af8a5['status'](_0x3f2e69)[_0x7cd8('0x3d')](_0x323b60);};}exports[_0x7cd8('0x3e')]=function(_0x2e0ee5,_0x4f64bd){var _0x19386e={'include':[{'model':db['Pause'],'as':_0x7cd8('0x3f')}]},_0x590817={},_0x27aa79={'count':0x0,'rows':[]};var _0x3789f1=_[_0x7cd8('0x40')](db[_0x7cd8('0x41')][_0x7cd8('0x42')],function(_0x480251){return{'name':_0x480251[_0x7cd8('0x43')],'type':_0x480251['type'][_0x7cd8('0x44')]};});_0x590817[_0x7cd8('0x45')]=_[_0x7cd8('0x40')](_0x3789f1,_0x7cd8('0x3c'));_0x590817[_0x7cd8('0x46')]=_['keys'](_0x2e0ee5[_0x7cd8('0x46')]);_0x590817[_0x7cd8('0x47')]=_[_0x7cd8('0x48')](_0x590817[_0x7cd8('0x45')],_0x590817['query']);_0x19386e['attributes']=_[_0x7cd8('0x48')](_0x590817[_0x7cd8('0x45')],qs['fields'](_0x2e0ee5['query'][_0x7cd8('0x49')]));_0x19386e[_0x7cd8('0x4a')]=_0x19386e[_0x7cd8('0x4a')][_0x7cd8('0x4b')]?_0x19386e[_0x7cd8('0x4a')]:_0x590817[_0x7cd8('0x45')];if(!_0x2e0ee5[_0x7cd8('0x46')][_0x7cd8('0x4c')](_0x7cd8('0x4d'))){_0x19386e[_0x7cd8('0x2e')]=qs[_0x7cd8('0x2e')](_0x2e0ee5[_0x7cd8('0x46')][_0x7cd8('0x2e')]);_0x19386e[_0x7cd8('0x31')]=qs[_0x7cd8('0x31')](_0x2e0ee5[_0x7cd8('0x46')]['offset']);}_0x19386e[_0x7cd8('0x4e')]=qs[_0x7cd8('0x4f')](_0x2e0ee5[_0x7cd8('0x46')]['sort']);_0x19386e[_0x7cd8('0x50')]=qs[_0x7cd8('0x47')](_[_0x7cd8('0x51')](_0x2e0ee5[_0x7cd8('0x46')],_0x590817[_0x7cd8('0x47')]),_0x3789f1);if(_0x2e0ee5['query'][_0x7cd8('0x52')]){_0x19386e[_0x7cd8('0x50')]=_[_0x7cd8('0x53')](_0x19386e[_0x7cd8('0x50')],{'$or':_[_0x7cd8('0x40')](_0x3789f1,function(_0x4f9873){if(_0x4f9873[_0x7cd8('0x54')]!=='VIRTUAL'){var _0xc8bd1c={};_0xc8bd1c[_0x4f9873['name']]={'$like':'%'+_0x2e0ee5[_0x7cd8('0x46')]['filter']+'%'};return _0xc8bd1c;}})});}_0x19386e=_[_0x7cd8('0x53')]({},_0x19386e,_0x2e0ee5[_0x7cd8('0x55')]);var _0x3a3add={'where':_0x19386e['where']};return db[_0x7cd8('0x41')][_0x7cd8('0x30')](_0x3a3add)[_0x7cd8('0x22')](function(_0x154da7){_0x27aa79[_0x7cd8('0x30')]=_0x154da7;if(_0x2e0ee5[_0x7cd8('0x46')][_0x7cd8('0x56')]){_0x19386e['include']=[{'all':!![]}];}return db[_0x7cd8('0x41')][_0x7cd8('0x57')](_0x19386e);})['then'](function(_0x2d20d7){_0x27aa79[_0x7cd8('0x58')]=_0x2d20d7;return _0x27aa79;})[_0x7cd8('0x22')](respondWithFilteredResult(_0x4f64bd,_0x19386e))['catch'](handleError(_0x4f64bd,null));};exports[_0x7cd8('0x59')]=function(_0x865ff3,_0x13ad55){var _0x24c533={'raw':![],'where':{'id':_0x865ff3[_0x7cd8('0x5a')]['id']},'include':[{'model':db[_0x7cd8('0x5b')],'as':_0x7cd8('0x3f')}]},_0x4f0c94={};_0x4f0c94['model']=_[_0x7cd8('0x5c')](db[_0x7cd8('0x41')][_0x7cd8('0x42')]);_0x4f0c94[_0x7cd8('0x46')]=_[_0x7cd8('0x5c')](_0x865ff3[_0x7cd8('0x46')]);_0x4f0c94[_0x7cd8('0x47')]=_[_0x7cd8('0x48')](_0x4f0c94[_0x7cd8('0x45')],_0x4f0c94['query']);_0x24c533[_0x7cd8('0x4a')]=_[_0x7cd8('0x48')](_0x4f0c94[_0x7cd8('0x45')],qs['fields'](_0x865ff3[_0x7cd8('0x46')][_0x7cd8('0x49')]));_0x24c533['attributes']=_0x24c533[_0x7cd8('0x4a')][_0x7cd8('0x4b')]?_0x24c533[_0x7cd8('0x4a')]:_0x4f0c94[_0x7cd8('0x45')];if(_0x865ff3[_0x7cd8('0x46')][_0x7cd8('0x56')]){_0x24c533[_0x7cd8('0x5d')]=[{'all':!![]}];}_0x24c533=_[_0x7cd8('0x53')]({},_0x24c533,_0x865ff3[_0x7cd8('0x55')]);return db[_0x7cd8('0x41')]['find'](_0x24c533)[_0x7cd8('0x22')](handleEntityNotFound(_0x13ad55,null))[_0x7cd8('0x22')](respondWithResult(_0x13ad55,null))[_0x7cd8('0x2a')](handleError(_0x13ad55,null));};exports[_0x7cd8('0x5e')]=function(_0x509ac6,_0x34fa06){return db[_0x7cd8('0x41')]['create'](_0x509ac6[_0x7cd8('0x5f')],{})['then'](function(_0x386622){var _0x458711=_0x509ac6[_0x7cd8('0x60')][_0x7cd8('0x37')]({'plain':!![]});if(!_0x458711)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x458711[_0x7cd8('0x61')]===_0x7cd8('0x60')){var _0x239410=_0x386622[_0x7cd8('0x37')]({'plain':!![]});var _0x1c62a6='SmsAccounts';return db[_0x7cd8('0x62')][_0x7cd8('0x63')]({'where':{'name':_0x1c62a6,'userProfileId':_0x458711[_0x7cd8('0x64')]},'raw':!![]})[_0x7cd8('0x22')](function(_0x4a202e){if(_0x4a202e&&_0x4a202e[_0x7cd8('0x65')]===0x0){return db['UserProfileResource'][_0x7cd8('0x5e')]({'name':_0x239410[_0x7cd8('0x3c')],'resourceId':_0x239410['id'],'type':_0x4a202e[_0x7cd8('0x3c')],'sectionId':_0x4a202e['id']},{})[_0x7cd8('0x22')](function(){return _0x386622;});}else{return _0x386622;}})[_0x7cd8('0x2a')](function(_0x24a886){logger['error'](_0x7cd8('0x66'),_0x24a886);throw _0x24a886;});}return _0x386622;})[_0x7cd8('0x22')](respondWithResult(_0x34fa06,0xc9))['catch'](handleError(_0x34fa06,null));};exports[_0x7cd8('0x36')]=function(_0x45f257,_0x280025){if(_0x45f257[_0x7cd8('0x5f')]['id']){delete _0x45f257[_0x7cd8('0x5f')]['id'];}return db[_0x7cd8('0x41')][_0x7cd8('0x63')]({'where':{'id':_0x45f257['params']['id']},'include':[{'model':db[_0x7cd8('0x5b')],'as':_0x7cd8('0x3f')}]})[_0x7cd8('0x22')](handleEntityNotFound(_0x280025,null))['then'](saveUpdates(_0x45f257[_0x7cd8('0x5f')],null))['then'](respondWithResult(_0x280025,null))['catch'](handleError(_0x280025,null));};exports['destroy']=function(_0x378f1e,_0x4870c3){return db[_0x7cd8('0x41')][_0x7cd8('0x63')]({'where':{'id':_0x378f1e['params']['id']}})['then'](handleEntityNotFound(_0x4870c3,null))[_0x7cd8('0x22')](removeEntity(_0x4870c3,null))[_0x7cd8('0x2a')](handleError(_0x4870c3,null));};exports[_0x7cd8('0x67')]=function(_0x3e7ed8,_0x2ff188){return db[_0x7cd8('0x41')]['describe']()[_0x7cd8('0x22')](respondWithResult(_0x2ff188,null))[_0x7cd8('0x2a')](handleError(_0x2ff188,null));};exports[_0x7cd8('0x68')]=function(_0x5d5f4e,_0x3d9f2a,_0x4ca610){if(_0x5d5f4e['body']['id']){delete _0x5d5f4e[_0x7cd8('0x5f')]['id'];}return db[_0x7cd8('0x41')][_0x7cd8('0x63')]({'where':{'id':_0x5d5f4e[_0x7cd8('0x5a')]['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x3d9f2a,null))[_0x7cd8('0x22')](function(_0x22fd41){if(_0x22fd41){_0x5d5f4e['body'][_0x7cd8('0x69')]=_0x22fd41['id'];return db[_0x7cd8('0x6a')][_0x7cd8('0x5e')](_0x5d5f4e[_0x7cd8('0x5f')]);}})[_0x7cd8('0x22')](respondWithResult(_0x3d9f2a,null))['catch'](handleError(_0x3d9f2a,null));};exports[_0x7cd8('0x6b')]=function(_0x66a3bd,_0x278e9f,_0x243d36){var _0x2afdc3={'raw':![],'where':{}};var _0x427af4={};var _0x368b27={'count':0x0,'rows':[]};return db[_0x7cd8('0x41')][_0x7cd8('0x6c')]({'where':{'id':_0x66a3bd[_0x7cd8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x278e9f,null))[_0x7cd8('0x22')](function(_0x595327){if(_0x595327){_0x427af4[_0x7cd8('0x45')]=_['keys'](db[_0x7cd8('0x6a')][_0x7cd8('0x42')]);_0x427af4[_0x7cd8('0x46')]=_[_0x7cd8('0x5c')](_0x66a3bd['query']);_0x427af4[_0x7cd8('0x47')]=_[_0x7cd8('0x48')](_0x427af4['model'],_0x427af4[_0x7cd8('0x46')]);_0x2afdc3['attributes']=_[_0x7cd8('0x48')](_0x427af4['model'],qs[_0x7cd8('0x49')](_0x66a3bd[_0x7cd8('0x46')][_0x7cd8('0x49')]));_0x2afdc3[_0x7cd8('0x4a')]=_0x2afdc3['attributes'][_0x7cd8('0x4b')]?_0x2afdc3['attributes']:_0x427af4[_0x7cd8('0x45')];if(!_0x66a3bd['query']['hasOwnProperty'](_0x7cd8('0x4d'))){_0x2afdc3[_0x7cd8('0x2e')]=qs[_0x7cd8('0x2e')](_0x66a3bd[_0x7cd8('0x46')][_0x7cd8('0x2e')]);_0x2afdc3[_0x7cd8('0x31')]=qs[_0x7cd8('0x31')](_0x66a3bd['query'][_0x7cd8('0x31')]);}_0x2afdc3[_0x7cd8('0x4e')]=qs[_0x7cd8('0x4f')](_0x66a3bd[_0x7cd8('0x46')][_0x7cd8('0x4f')]);_0x2afdc3[_0x7cd8('0x50')]=qs[_0x7cd8('0x47')](_[_0x7cd8('0x51')](_0x66a3bd[_0x7cd8('0x46')],_0x427af4[_0x7cd8('0x47')]));_0x2afdc3[_0x7cd8('0x50')][_0x7cd8('0x69')]=_0x595327['id'];if(_0x66a3bd[_0x7cd8('0x46')][_0x7cd8('0x52')]){_0x2afdc3[_0x7cd8('0x50')]=_['merge'](_0x2afdc3[_0x7cd8('0x50')],{'$or':_[_0x7cd8('0x40')](_0x2afdc3['attributes'],function(_0x49d642){var _0x41ef23={};_0x41ef23[_0x49d642]={'$like':'%'+_0x66a3bd[_0x7cd8('0x46')]['filter']+'%'};return _0x41ef23;})});}_0x2afdc3=_[_0x7cd8('0x53')]({},_0x2afdc3,_0x66a3bd[_0x7cd8('0x55')]);return db[_0x7cd8('0x6a')]['count']({'where':_0x2afdc3[_0x7cd8('0x50')]})['then'](function(_0x3e795d){_0x368b27[_0x7cd8('0x30')]=_0x3e795d;if(_0x66a3bd[_0x7cd8('0x46')]['includeAll']){_0x2afdc3[_0x7cd8('0x5d')]=[{'all':!![]}];}return db[_0x7cd8('0x6a')][_0x7cd8('0x57')](_0x2afdc3);})[_0x7cd8('0x22')](function(_0x20129b){_0x368b27['rows']=_0x20129b;return _0x368b27;});}})[_0x7cd8('0x22')](respondWithFilteredResult(_0x278e9f,_0x2afdc3))[_0x7cd8('0x2a')](handleError(_0x278e9f,null));};exports[_0x7cd8('0x6d')]=function(_0x4d07a9,_0x544e4a,_0x6e54c7){return db[_0x7cd8('0x41')][_0x7cd8('0x63')]({'where':{'id':_0x4d07a9[_0x7cd8('0x5a')]['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x544e4a,null))['then'](function(_0x25c559){if(_0x25c559){return _0x25c559[_0x7cd8('0x6d')](_0x4d07a9[_0x7cd8('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x544e4a,null))[_0x7cd8('0x2a')](handleError(_0x544e4a,null));};exports['addAnswer']=function(_0x403b3d,_0x189ea7,_0x2194c1){if(_0x403b3d['body']['id']){delete _0x403b3d[_0x7cd8('0x5f')]['id'];}return db[_0x7cd8('0x41')][_0x7cd8('0x63')]({'where':{'id':_0x403b3d['params']['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x189ea7,null))[_0x7cd8('0x22')](function(_0x76b017){if(_0x76b017){_0x403b3d[_0x7cd8('0x5f')][_0x7cd8('0x69')]=_0x76b017['id'];return db['CannedAnswer'][_0x7cd8('0x5e')](_0x403b3d[_0x7cd8('0x5f')]);}})['then'](respondWithResult(_0x189ea7,null))[_0x7cd8('0x2a')](handleError(_0x189ea7,null));};exports[_0x7cd8('0x6e')]=function(_0x15f744,_0x540c54,_0x10c11d){var _0x4034b6={'raw':![],'where':{}};var _0x2db939={};var _0x4202d8={'count':0x0,'rows':[]};return db[_0x7cd8('0x41')]['findOne']({'where':{'id':_0x15f744[_0x7cd8('0x5a')]['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x540c54,null))[_0x7cd8('0x22')](function(_0x2596c7){if(_0x2596c7){_0x2db939[_0x7cd8('0x45')]=_['keys'](db[_0x7cd8('0x6f')][_0x7cd8('0x42')]);_0x2db939[_0x7cd8('0x46')]=_[_0x7cd8('0x5c')](_0x15f744[_0x7cd8('0x46')]);_0x2db939['filters']=_['intersection'](_0x2db939['model'],_0x2db939[_0x7cd8('0x46')]);_0x4034b6[_0x7cd8('0x4a')]=_[_0x7cd8('0x48')](_0x2db939[_0x7cd8('0x45')],qs[_0x7cd8('0x49')](_0x15f744[_0x7cd8('0x46')][_0x7cd8('0x49')]));_0x4034b6[_0x7cd8('0x4a')]=_0x4034b6['attributes'][_0x7cd8('0x4b')]?_0x4034b6['attributes']:_0x2db939[_0x7cd8('0x45')];if(!_0x15f744['query']['hasOwnProperty'](_0x7cd8('0x4d'))){_0x4034b6[_0x7cd8('0x2e')]=qs[_0x7cd8('0x2e')](_0x15f744['query'][_0x7cd8('0x2e')]);_0x4034b6[_0x7cd8('0x31')]=qs['offset'](_0x15f744[_0x7cd8('0x46')][_0x7cd8('0x31')]);}_0x4034b6[_0x7cd8('0x4e')]=qs[_0x7cd8('0x4f')](_0x15f744[_0x7cd8('0x46')]['sort']);_0x4034b6[_0x7cd8('0x50')]=qs['filters'](_[_0x7cd8('0x51')](_0x15f744['query'],_0x2db939[_0x7cd8('0x47')]));_0x4034b6[_0x7cd8('0x50')][_0x7cd8('0x69')]=_0x2596c7['id'];if(_0x15f744[_0x7cd8('0x46')][_0x7cd8('0x52')]){_0x4034b6[_0x7cd8('0x50')]=_[_0x7cd8('0x53')](_0x4034b6[_0x7cd8('0x50')],{'$or':_['map'](_0x4034b6[_0x7cd8('0x4a')],function(_0x47fe8c){var _0x24b275={};_0x24b275[_0x47fe8c]={'$like':'%'+_0x15f744['query'][_0x7cd8('0x52')]+'%'};return _0x24b275;})});}_0x4034b6=_[_0x7cd8('0x53')]({},_0x4034b6,_0x15f744[_0x7cd8('0x55')]);return db[_0x7cd8('0x6f')][_0x7cd8('0x30')]({'where':_0x4034b6[_0x7cd8('0x50')]})[_0x7cd8('0x22')](function(_0x558a32){_0x4202d8[_0x7cd8('0x30')]=_0x558a32;if(_0x15f744['query'][_0x7cd8('0x56')]){_0x4034b6[_0x7cd8('0x5d')]=[{'all':!![]}];}return db[_0x7cd8('0x6f')][_0x7cd8('0x57')](_0x4034b6);})[_0x7cd8('0x22')](function(_0x524ed7){_0x4202d8[_0x7cd8('0x58')]=_0x524ed7;return _0x4202d8;});}})[_0x7cd8('0x22')](respondWithFilteredResult(_0x540c54,_0x4034b6))[_0x7cd8('0x2a')](handleError(_0x540c54,null));};exports['removeAnswers']=function(_0xd1dba2,_0x50f671,_0x4b5f4c){return db[_0x7cd8('0x41')][_0x7cd8('0x63')]({'where':{'id':_0xd1dba2[_0x7cd8('0x5a')]['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x50f671,null))['then'](function(_0x438d14){if(_0x438d14){return _0x438d14[_0x7cd8('0x70')](_0xd1dba2['query'][_0x7cd8('0x71')]);}})['then'](respondWithStatusCode(_0x50f671,null))[_0x7cd8('0x2a')](handleError(_0x50f671,null));};exports[_0x7cd8('0x72')]=function(_0x4722fa,_0xe028ca,_0x513c13){var _0x36129b={'channel':_0x7cd8('0x73')};var _0xc80060=[];var _0x5858e9=[];var _0x5b636b={};return db[_0x7cd8('0x41')][_0x7cd8('0x63')]({'where':{'id':_0x4722fa[_0x7cd8('0x5a')]['id']},'include':[{'model':db[_0x7cd8('0x74')],'as':_0x7cd8('0x75')}]})[_0x7cd8('0x22')](handleEntityNotFound(_0xe028ca,null))[_0x7cd8('0x22')](function(_0xb07c61){_0x36129b[_0x7cd8('0x76')]=_0xb07c61;_0x36129b[_0x7cd8('0x77')]=_['orderBy'](_0xb07c61[_0x7cd8('0x75')],[_0x7cd8('0x78')],[_0x7cd8('0x79')]);if(_0x36129b[_0x7cd8('0x76')][_0x7cd8('0x75')]){delete _0x36129b[_0x7cd8('0x76')]['Applications'];}return db['CmContact'][_0x7cd8('0x67')]();})[_0x7cd8('0x22')](function(_0x46e161){if(!_0x46e161){throw new db[(_0x7cd8('0x7a'))]['ValidationError']('no\x20available\x20attributes');}_0xc80060=_['difference'](_['keys'](_0x46e161),[_0x7cd8('0x7b'),_0x7cd8('0x7c')]);_0x5858e9=_['difference'](_['keys'](_0x46e161),['createdAt','updatedAt','CompanyId',_0x7cd8('0x7d')]);_0x36129b['body']={'mapKey':'mobile'};if(_0x36129b['account'][_0x7cd8('0x54')]){switch(_0x36129b[_0x7cd8('0x76')]['type']){case _0x7cd8('0x7e'):_0x36129b[_0x7cd8('0x5f')]['from']=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x7f')];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x5f')]=_0x4722fa[_0x7cd8('0x5f')]['Body'];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x80')]=_0x4722fa[_0x7cd8('0x5f')]['MessageSid'];break;case _0x7cd8('0x81'):_0x36129b['body']['from']='+'+_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x82')];_0x36129b[_0x7cd8('0x5f')]['body']=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x83')];break;case'connectel':_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x84')]=_0x4722fa[_0x7cd8('0x5f')]['from'];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x5f')]=_0x4722fa[_0x7cd8('0x5f')]['message'];break;case'clicksend':_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x84')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x84')];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x5f')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x5f')];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x80')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x85')];break;case _0x7cd8('0x86'):_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x84')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x7f')];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x5f')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x87')];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x80')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x88')];break;case _0x7cd8('0x89'):_0x36129b['body']['from']='+'+_0x4722fa[_0x7cd8('0x5f')]['results'][0x0]['from'];_0x36129b['body'][_0x7cd8('0x5f')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x8a')][0x0][_0x7cd8('0x83')];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x80')]=_0x4722fa['body'][_0x7cd8('0x8a')][0x0]['messageId'];break;case'csc':_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x84')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x8b')];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x5f')]=_0x4722fa['body'][_0x7cd8('0x8c')][_0x7cd8('0x28')];break;case _0x7cd8('0x8d'):_0x36129b[_0x7cd8('0x5f')]['from']=_0x4722fa['body'][_0x7cd8('0x8e')];_0x36129b[_0x7cd8('0x5f')]['body']=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x83')];_0x36129b['body'][_0x7cd8('0x80')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x8f')];break;case'bandwidth':_0x36129b['body'][_0x7cd8('0x80')]=_0x4722fa['body'][0x0][_0x7cd8('0x28')]['id'];_0x36129b['body'][_0x7cd8('0x84')]=_0x4722fa[_0x7cd8('0x5f')][0x0][_0x7cd8('0x28')][_0x7cd8('0x84')];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x5f')]=_0x4722fa[_0x7cd8('0x5f')][0x0][_0x7cd8('0x28')]['text'];break;case _0x7cd8('0x90'):_0x36129b['body'][_0x7cd8('0x84')]=_0x4722fa['body'][_0x7cd8('0x84')];_0x36129b['body'][_0x7cd8('0x5f')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x28')];_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x80')]=_0x4722fa[_0x7cd8('0x5f')][_0x7cd8('0x91')];break;}}if(_0x36129b[_0x7cd8('0x5f')]['id']){delete _0x36129b[_0x7cd8('0x5f')]['id'];}if(_[_0x7cd8('0x92')](_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x84')])){throw new db[(_0x7cd8('0x7a'))][(_0x7cd8('0x93'))](_0x7cd8('0x94'));}if(_[_0x7cd8('0x92')](_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x5f')])||_0x36129b[_0x7cd8('0x5f')]['body']===''){throw new db[(_0x7cd8('0x7a'))][(_0x7cd8('0x93'))](_0x7cd8('0x95'));}if(_[_0x7cd8('0x92')](_0x36129b['body'][_0x7cd8('0x96')])){throw new db['Sequelize'][(_0x7cd8('0x93'))](_0x7cd8('0x97')+_0x5858e9);}if(!_[_0x7cd8('0x98')](_0x5858e9,_0x36129b[_0x7cd8('0x5f')]['mapKey'])){throw new db[(_0x7cd8('0x7a'))][(_0x7cd8('0x93'))](_0x7cd8('0x99')+_0x5858e9);}_0x5b636b[_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x96')]]=_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x84')];return db['CmList'][_0x7cd8('0x63')]({'where':{'id':_0x36129b[_0x7cd8('0x76')][_0x7cd8('0x7d')]},'include':[{'model':db[_0x7cd8('0x9a')],'as':_0x7cd8('0x9b'),'where':_0x5b636b,'limit':0x1,'order':[[_0x7cd8('0x7c'),'DESC']]}]});})[_0x7cd8('0x22')](handleEntityNotFound(_0xe028ca,null))['then'](function(_0x5f3cf4){if(_0x5f3cf4){_0x36129b[_0x7cd8('0x9c')]=_[_0x7cd8('0x9d')](_0x5f3cf4,['Contacts']);if(_0x5f3cf4[_0x7cd8('0x9b')][_0x7cd8('0x4b')]){return _0x5f3cf4[_0x7cd8('0x9b')][0x0];}var _0x5a56fb=_[_0x7cd8('0x1b')](_0x36129b[_0x7cd8('0x5f')],{'firstName':_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x84')],'ListId':_0x5f3cf4['id']});_0x5a56fb[_0x36129b['body'][_0x7cd8('0x96')]]=_0x36129b[_0x7cd8('0x5f')]['from'];return db[_0x7cd8('0x9a')]['create'](_0x5a56fb,{'fields':_0xc80060,'raw':!![]});}})[_0x7cd8('0x22')](handleEntityNotFound(_0xe028ca,null))['then'](function(_0x1d5e61){if(_0x1d5e61){_0x36129b[_0x7cd8('0x9e')]=_0x1d5e61;var _0x352b8b={'ContactId':_0x1d5e61['id'],'phone':_0x36129b['body'][_0x7cd8('0x84')],'SmsAccountId':_0x4722fa[_0x7cd8('0x5a')]['id']};var _0x4f8c2c={'ContactId':_0x1d5e61['id'],'SmsAccountId':_0x4722fa['params']['id'],'closed':![]};return db[_0x7cd8('0x9f')]['find']({'where':_0x4f8c2c})[_0x7cd8('0x22')](function(_0x3bdd77){if(_0x3bdd77){return[_0x3bdd77,![]];}return db[_0x7cd8('0x9f')][_0x7cd8('0x5e')](_0x352b8b)[_0x7cd8('0x22')](function(_0x101882){return[_0x101882,!![]];});});}})['spread'](function(_0x45e77f,_0xef2fc4){_0x36129b[_0x7cd8('0xa0')]=_0x45e77f[_0x7cd8('0x37')]({'plain':!![]});_0x36129b[_0x7cd8('0xa0')][_0x7cd8('0xa1')]=![];if(_0xef2fc4){if(_0x36129b[_0x7cd8('0x76')][_0x7cd8('0xa2')]){_0x36129b['applications']['push']({'id':0x0,'priority':_0x36129b[_0x7cd8('0x77')][_0x7cd8('0x4b')]+0x1,'app':_0x7cd8('0xa3'),'appdata':_0x7cd8('0xa4'),'interval':'*,*,*,*'});}_0x36129b[_0x7cd8('0xa0')][_0x7cd8('0xa1')]=!![];}return db['SmsMessage'][_0x7cd8('0x5e')]({'phone':_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x84')],'messageId':_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x80')],'body':_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0x5f')],'SmsAccountId':_0x4722fa['params']['id'],'SmsInteractionId':_0x45e77f['id'],'direction':'in','ContactId':_0x45e77f[_0x7cd8('0xa5')],'AttachmentId':_0x36129b[_0x7cd8('0x5f')][_0x7cd8('0xa6')]});})['then'](function(_0x4bcbff){_0x36129b['message']=_0x4bcbff;if(_0x36129b[_0x7cd8('0xa0')][_0x7cd8('0xa7')]){return db[_0x7cd8('0xa8')]['find']({'attributes':['id',_0x7cd8('0x3c')],'where':{'id':_0x36129b[_0x7cd8('0xa0')]['UserId']}})['then'](function(_0x4a34c9){if(_0x4a34c9){_0x36129b[_0x7cd8('0x77')][_0x7cd8('0xa9')]({'id':0x0,'priority':0x0,'app':_0x7cd8('0xaa'),'appdata':_0x4a34c9['name']+','+(_0x36129b[_0x7cd8('0x76')][_0x7cd8('0xab')]||0xa),'interval':_0x7cd8('0xac')});}return respondWithRpcPromise(_0x7cd8('0xad'),_0x7cd8('0xae'),_0x36129b);});}return respondWithRpcPromise('Start',_0x7cd8('0xae'),_0x36129b);})[_0x7cd8('0x22')](function(_0x14f629){if(_0x14f629){var _0x267962=0xc8;var _0x87b43d=_0x7cd8('0xaf');logger[_0x7cd8('0xb0')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x87b43d,_0x267962,_0x7cd8('0xb1'));logger[_0x7cd8('0xb2')](_0x7cd8('0xb3'),_0x87b43d,_0x267962,_0x7cd8('0xb1'),JSON[_0x7cd8('0x25')](_0x14f629));if(_0x36129b[_0x7cd8('0x76')][_0x7cd8('0x54')]==='twilio'){return _0xe028ca[_0x7cd8('0x2c')](_0x267962)['set'](_0x7cd8('0xb4'),_0x7cd8('0xb5'))[_0x7cd8('0x3d')](_0x7cd8('0xb6'));}else{return _0xe028ca[_0x7cd8('0x2c')](_0x267962)['json'](_0x14f629);}}})['catch'](handleError(_0xe028ca,null));};exports[_0x7cd8('0xb7')]=function(_0x73db41,_0x388f60,_0x1bf47a){return db[_0x7cd8('0x41')][_0x7cd8('0x6c')]({'where':{'id':_0x73db41[_0x7cd8('0x5a')]['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x388f60,null))[_0x7cd8('0x22')](function(_0x2c414a){if(_0x2c414a){return db[_0x7cd8('0xb8')]['transaction'](function(_0x4a1657){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x73db41[_0x7cd8('0x5a')]['id']},'transaction':_0x4a1657})[_0x7cd8('0x22')](function(_0x22acee){var _0x416515=_[_0x7cd8('0x40')](_0x73db41['body'],function(_0x4094a7){_0x4094a7[_0x7cd8('0x69')]=_0x73db41[_0x7cd8('0x5a')]['id'];return _0x4094a7;});return db[_0x7cd8('0x74')][_0x7cd8('0xb9')](_0x416515,{'transaction':_0x4a1657});});})[_0x7cd8('0x22')](function(){return db[_0x7cd8('0x74')][_0x7cd8('0xba')]({'where':{'SmsAccountId':_0x73db41['params']['id']},'order':'priority'});});}})[_0x7cd8('0x22')](respondWithResult(_0x388f60,null))['catch'](handleError(_0x388f60,null));};exports['getApplications']=function(_0x4b206c,_0x5c1ea9,_0x240fdf){var _0x487946={};var _0x3dd599={};var _0x1992c6;var _0x3e672c;return db['SmsAccount'][_0x7cd8('0x6c')]({'where':{'id':_0x4b206c[_0x7cd8('0x5a')]['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x5c1ea9,null))['then'](function(_0x240be9){if(_0x240be9){_0x1992c6=_0x240be9;_0x3dd599[_0x7cd8('0x45')]=_['keys'](db[_0x7cd8('0x74')][_0x7cd8('0x42')]);_0x3dd599[_0x7cd8('0x46')]=_[_0x7cd8('0x5c')](_0x4b206c[_0x7cd8('0x46')]);_0x3dd599[_0x7cd8('0x47')]=_[_0x7cd8('0x48')](_0x3dd599['model'],_0x3dd599['query']);_0x487946[_0x7cd8('0x4a')]=_[_0x7cd8('0x48')](_0x3dd599[_0x7cd8('0x45')],qs[_0x7cd8('0x49')](_0x4b206c[_0x7cd8('0x46')][_0x7cd8('0x49')]));_0x487946['attributes']=_0x487946[_0x7cd8('0x4a')][_0x7cd8('0x4b')]?_0x487946[_0x7cd8('0x4a')]:_0x3dd599['model'];_0x487946[_0x7cd8('0x4e')]=qs['sort'](_0x4b206c[_0x7cd8('0x46')][_0x7cd8('0x4f')]);_0x487946[_0x7cd8('0x50')]=qs[_0x7cd8('0x47')](_['pick'](_0x4b206c[_0x7cd8('0x46')],_0x3dd599[_0x7cd8('0x47')]));if(_0x4b206c['query'][_0x7cd8('0x52')]){_0x487946[_0x7cd8('0x50')]=_[_0x7cd8('0x53')](_0x487946[_0x7cd8('0x50')],{'$or':_[_0x7cd8('0x40')](_0x487946[_0x7cd8('0x4a')],function(_0x29780b){var _0x3bc54={};_0x3bc54[_0x29780b]={'$like':'%'+_0x4b206c['query']['filter']+'%'};return _0x3bc54;})});}_0x487946=_[_0x7cd8('0x53')]({},_0x487946,_0x4b206c['options']);return _0x1992c6[_0x7cd8('0xbb')](_0x487946);}})[_0x7cd8('0x22')](function(_0x5e9496){if(_0x5e9496){_0x3e672c=_0x5e9496[_0x7cd8('0x4b')];if(!_0x4b206c[_0x7cd8('0x46')]['hasOwnProperty'](_0x7cd8('0x4d'))){_0x487946[_0x7cd8('0x2e')]=qs[_0x7cd8('0x2e')](_0x4b206c[_0x7cd8('0x46')]['limit']);_0x487946['offset']=qs[_0x7cd8('0x31')](_0x4b206c['query'][_0x7cd8('0x31')]);}return _0x1992c6[_0x7cd8('0xbb')](_0x487946);}})[_0x7cd8('0x22')](function(_0x5ac06d){if(_0x5ac06d){return _0x5ac06d?{'count':_0x3e672c,'rows':_0x5ac06d}:null;}})[_0x7cd8('0x22')](respondWithResult(_0x5c1ea9,null))['catch'](handleError(_0x5c1ea9,null));};exports[_0x7cd8('0xbc')]=function(_0x3f156e,_0x3445d7,_0x2fb62f){var _0x5c9675={'raw':![],'where':{}};var _0x2bbdd7={};var _0x90a72={'count':0x0,'rows':[]};return db[_0x7cd8('0x41')][_0x7cd8('0x6c')]({'where':{'id':_0x3f156e[_0x7cd8('0x5a')]['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x3445d7,null))['then'](function(_0x1473c6){if(_0x1473c6){_0x2bbdd7[_0x7cd8('0x45')]=_[_0x7cd8('0x5c')](db[_0x7cd8('0x9f')][_0x7cd8('0x42')]);_0x2bbdd7[_0x7cd8('0x46')]=_['keys'](_0x3f156e['query']);_0x2bbdd7[_0x7cd8('0x47')]=_['intersection'](_0x2bbdd7[_0x7cd8('0x45')],_0x2bbdd7[_0x7cd8('0x46')]);_0x5c9675['attributes']=_[_0x7cd8('0x48')](_0x2bbdd7[_0x7cd8('0x45')],qs[_0x7cd8('0x49')](_0x3f156e[_0x7cd8('0x46')][_0x7cd8('0x49')]));_0x5c9675[_0x7cd8('0x4a')]=_0x5c9675['attributes'][_0x7cd8('0x4b')]?_0x5c9675[_0x7cd8('0x4a')]:_0x2bbdd7[_0x7cd8('0x45')];if(!_0x3f156e['query']['hasOwnProperty'](_0x7cd8('0x4d'))){_0x5c9675[_0x7cd8('0x2e')]=qs[_0x7cd8('0x2e')](_0x3f156e[_0x7cd8('0x46')][_0x7cd8('0x2e')]);_0x5c9675[_0x7cd8('0x31')]=qs[_0x7cd8('0x31')](_0x3f156e[_0x7cd8('0x46')][_0x7cd8('0x31')]);}_0x5c9675['order']=qs[_0x7cd8('0x4f')](_0x3f156e[_0x7cd8('0x46')][_0x7cd8('0x4f')]);_0x5c9675['where']=qs[_0x7cd8('0x47')](_[_0x7cd8('0x51')](_0x3f156e[_0x7cd8('0x46')],_0x2bbdd7[_0x7cd8('0x47')]));_0x5c9675[_0x7cd8('0x50')][_0x7cd8('0x69')]=_0x1473c6['id'];if(_0x3f156e['query'][_0x7cd8('0x52')]){_0x5c9675[_0x7cd8('0x50')]=_[_0x7cd8('0x53')](_0x5c9675[_0x7cd8('0x50')],{'$or':_['map'](_0x5c9675['attributes'],function(_0x340b9f){var _0x55125d={};_0x55125d[_0x340b9f]={'$like':'%'+_0x3f156e[_0x7cd8('0x46')]['filter']+'%'};return _0x55125d;})});}_0x5c9675=_['merge']({},_0x5c9675,_0x3f156e[_0x7cd8('0x55')]);return db[_0x7cd8('0x9f')][_0x7cd8('0x30')]({'where':_0x5c9675['where']})[_0x7cd8('0x22')](function(_0x4ca645){_0x90a72[_0x7cd8('0x30')]=_0x4ca645;if(_0x3f156e[_0x7cd8('0x46')][_0x7cd8('0x56')]){_0x5c9675[_0x7cd8('0x5d')]=[{'model':db['CmContact'],'as':_0x7cd8('0xbd'),'required':![]},{'model':db[_0x7cd8('0xa8')],'as':_0x7cd8('0xbe'),'attributes':['name',_0x7cd8('0xbf'),_0x7cd8('0xc0')],'required':![]},{'model':db[_0x7cd8('0xc1')],'as':_0x7cd8('0xc2'),'attributes':['id',_0x7cd8('0x3c'),'color'],'where':_0x3f156e['query'][_0x7cd8('0xc3')]?{'id':_0x3f156e[_0x7cd8('0x46')]['tag']}:undefined,'required':_0x3f156e[_0x7cd8('0x46')][_0x7cd8('0xc3')]?!![]:![]}];}return db[_0x7cd8('0x9f')][_0x7cd8('0x57')](_0x5c9675);})[_0x7cd8('0x22')](function(_0x4990fd){_0x90a72['rows']=_0x4990fd;return _0x90a72;});}})[_0x7cd8('0x22')](respondWithFilteredResult(_0x3445d7,_0x5c9675))[_0x7cd8('0x2a')](handleError(_0x3445d7,null));};exports[_0x7cd8('0x3d')]=function(_0x486f01,_0x58b246,_0x44e5dc){var _0x28b7da,_0xc60168,_0x493f7a;if(_[_0x7cd8('0x92')](_0x486f01[_0x7cd8('0x5f')]['body'])||_0x486f01[_0x7cd8('0x5f')]['body']===''){throw new db['Sequelize'][(_0x7cd8('0x93'))](_0x7cd8('0x95'));}if(_[_0x7cd8('0x92')](_0x486f01[_0x7cd8('0x5f')]['to'])){throw new db['Sequelize'][(_0x7cd8('0x93'))]('to\x20is\x20mandatory');}_0x28b7da=_0x486f01[_0x7cd8('0x5f')]['to'];return db[_0x7cd8('0x41')]['find']({'where':{'id':_0x486f01[_0x7cd8('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x7cd8('0xc4'),'include':[{'model':db[_0x7cd8('0x9a')],'as':'Contacts','where':{'mobile':_0x28b7da},'limit':0x1,'order':[[_0x7cd8('0x7c'),_0x7cd8('0xc5')]]}]}]})[_0x7cd8('0x22')](handleEntityNotFound(_0x58b246,null))[_0x7cd8('0x22')](function(_0x31b402){if(_0x31b402&&_0x31b402[_0x7cd8('0xc4')]){_0xc60168=_0x31b402[_0x7cd8('0x37')]({'plain':!![]});if(_0xc60168[_0x7cd8('0xc4')]&&_0xc60168[_0x7cd8('0xc4')][_0x7cd8('0x9b')]['length']){return _0xc60168['List']['Contacts'][0x0];}return db[_0x7cd8('0x9a')][_0x7cd8('0x5e')](_[_0x7cd8('0x1b')](_0x486f01[_0x7cd8('0x5f')],{'firstName':_0x28b7da,'mobile':_0x28b7da,'phone':_0x28b7da,'ListId':_0xc60168['ListId']}));}})['then'](handleEntityNotFound(_0x58b246,null))[_0x7cd8('0x22')](function(_0x5f3bd6){if(_0x5f3bd6){_0x493f7a=_0x5f3bd6;return db['SmsInteraction'][_0x7cd8('0x63')]({'where':{'ContactId':_0x493f7a['id'],'closed':![],'SmsAccountId':_0xc60168['id']}})[_0x7cd8('0x22')](function(_0x42f4e8){if(_0x42f4e8){return[_0x42f4e8,![]];}return db['SmsInteraction'][_0x7cd8('0x5e')]({'UserId':_0x486f01['user']['id'],'ContactId':_0x493f7a['id'],'SmsAccountId':_0xc60168['id'],'phone':_0x28b7da,'firstMsgDirection':_0x7cd8('0xc6'),'Messages':[_['merge'](_0x486f01[_0x7cd8('0x5f')],{'read':![],'body':_0x486f01[_0x7cd8('0x5f')][_0x7cd8('0x5f')],'phone':_0x28b7da,'SmsAccountId':_0xc60168['id'],'UserId':_0x486f01[_0x7cd8('0x60')]['id'],'ContactId':_0x493f7a['id']})]},{'include':[{'model':db[_0x7cd8('0xc7')],'as':_0x7cd8('0xc8')}]})[_0x7cd8('0x22')](function(_0x4ef300){return[_0x4ef300,!![]];});});}})[_0x7cd8('0xc9')](function(_0xc4a6bd,_0x401668){if(_0x401668){return _0xc4a6bd;}return db[_0x7cd8('0xc7')][_0x7cd8('0x5e')](_[_0x7cd8('0x53')](_0x486f01[_0x7cd8('0x5f')],{'read':![],'body':_0x486f01[_0x7cd8('0x5f')]['body'],'phone':_0x28b7da,'SmsAccountId':_0xc60168['id'],'SmsInteractionId':_0xc4a6bd['id'],'UserId':_0x486f01[_0x7cd8('0x60')]['id'],'ContactId':_0x493f7a['id']}))['then'](function(_0x40b8bb){_0xc4a6bd[_0x7cd8('0xca')][_0x7cd8('0xc8')]=[];_0xc4a6bd['dataValues'][_0x7cd8('0xc8')][_0x7cd8('0xcb')](_0x40b8bb[_0x7cd8('0xca')]);return _0xc4a6bd;});})[_0x7cd8('0x22')](respondWithResult(_0x58b246,null))[_0x7cd8('0x2a')](handleError(_0x58b246,null));};exports[_0x7cd8('0x2c')]=function(_0x25aee2,_0xb518e8,_0x3b3880){if(_0x25aee2['body']['id']){delete _0x25aee2[_0x7cd8('0x5f')]['id'];}var _0x4c65f9,_0x23794f,_0x52753f;return db[_0x7cd8('0x41')]['find']({'where':{'id':_0x25aee2['params']['id']}})['then'](handleEntityNotFound(_0xb518e8,null))['then'](function(_0x324b70){if(_0x324b70){_0x52753f=_0x324b70;logger[_0x7cd8('0xb2')](_0x7cd8('0xcc'),_0x7cd8('0x2c'),'received\x20delivery\x20report\x20from',_0x324b70[_0x7cd8('0x54')],util[_0x7cd8('0xcd')](_0x25aee2[_0x7cd8('0x5f')],{'showHidden':![],'depth':null}));switch(_0x324b70['type']){case _0x7cd8('0x81'):if(_0x25aee2['body'][_0x7cd8('0xce')]&&_0x25aee2['body'][_0x7cd8('0x2c')]){_0x23794f=_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0x2c')];return db[_0x7cd8('0xc7')][_0x7cd8('0x63')]({'where':{'messageId':_0x25aee2[_0x7cd8('0x5f')]['skebby_dispatch_id']}});}break;case _0x7cd8('0xcf'):if(_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0xd0')]&&_0x25aee2['body'][_0x7cd8('0xd1')]){_0x23794f=_0x25aee2['body']['statusInt'];return db[_0x7cd8('0xc7')]['find']({'where':{'messageId':_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0xd0')]}});}break;case _0x7cd8('0xd2'):if(_0x25aee2['body'][_0x7cd8('0x85')]&&_0x25aee2[_0x7cd8('0x5f')]['status_code']){_0x23794f=_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0xd3')];return db[_0x7cd8('0xc7')][_0x7cd8('0x63')]({'where':{'messageId':_0x25aee2[_0x7cd8('0x5f')]['message_id']}});}break;case _0x7cd8('0x89'):var _0x2c34a2=_0x25aee2['body'][_0x7cd8('0x8a')][0x0];if(_0x2c34a2[_0x7cd8('0x80')]&&_0x2c34a2[_0x7cd8('0x2c')][_0x7cd8('0xd4')]===_0x7cd8('0xd5')){_0x23794f=_0x2c34a2[_0x7cd8('0x2c')][_0x7cd8('0xd4')];return db[_0x7cd8('0xc7')]['find']({'where':{'messageId':_0x2c34a2[_0x7cd8('0x80')]}});}break;case _0x7cd8('0x8d'):if(_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0x80')]&&_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0x2c')]){_0x23794f=_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0x2c')];return db[_0x7cd8('0xc7')]['find']({'where':{'messageId':_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0x80')]}});}break;case _0x7cd8('0xd6'):if(_0x25aee2[_0x7cd8('0x5f')][0x0][_0x7cd8('0x28')]['id']){_0x23794f=_0x25aee2[_0x7cd8('0x5f')][0x0][_0x7cd8('0x54')];return db[_0x7cd8('0xc7')][_0x7cd8('0x63')]({'where':{'messageId':_0x25aee2[_0x7cd8('0x5f')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0xd7')]&&_0x25aee2['body'][_0x7cd8('0x2c')]){_0x23794f=_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0x2c')];return db[_0x7cd8('0xc7')][_0x7cd8('0x63')]({'where':{'messageId':_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0xb518e8,null))['then'](function(_0x5a3d75){if(_0x5a3d75){_0x4c65f9=_0x5a3d75;switch(_0x52753f['type']){case'skebby':if(_0x23794f===_0x7cd8('0xd5')){return _0x4c65f9[_0x7cd8('0x36')]({'read':!![]});}else{logger[_0x7cd8('0x26')](_0x7cd8('0xcc'),_0x7cd8('0x2c'),_0x7cd8('0x81'),util[_0x7cd8('0xcd')](_0x25aee2[_0x7cd8('0x5f')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x23794f==='1'){return _0x4c65f9['update']({'read':!![]});}else{logger['error'](_0x7cd8('0xcc'),'status',_0x7cd8('0x81'),util[_0x7cd8('0xcd')](_0x25aee2[_0x7cd8('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7cd8('0xd2'):if(!_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0xd8')]&&_0x23794f>=0xc8&&_0x23794f<=0xce){return _0x4c65f9[_0x7cd8('0x36')]({'read':!![]});}else{logger[_0x7cd8('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7cd8('0x2c'),_0x7cd8('0xd2'),util[_0x7cd8('0xcd')](_0x25aee2[_0x7cd8('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7cd8('0x89'):var _0x1706dc=_0x25aee2[_0x7cd8('0x5f')][_0x7cd8('0x8a')][0x0];if(_0x1706dc[_0x7cd8('0x2c')][_0x7cd8('0xd4')]===_0x7cd8('0xd5')){return _0x4c65f9[_0x7cd8('0x36')]({'read':!![]});}else{logger[_0x7cd8('0x26')](_0x7cd8('0xcc'),_0x7cd8('0x2c'),'infobip',util[_0x7cd8('0xcd')](_0x25aee2[_0x7cd8('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7cd8('0x8d'):if(_0x23794f==_0x7cd8('0xd9')||_0x23794f==_0x7cd8('0xda')){return _0x4c65f9['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7cd8('0x2c'),_0x7cd8('0x8d'),util[_0x7cd8('0xcd')](_0x25aee2[_0x7cd8('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7cd8('0xd6'):if(_0x23794f==_0x7cd8('0xdb')){return _0x4c65f9['update']({'read':!![]});}else{logger[_0x7cd8('0x26')](_0x7cd8('0xcc'),'status',_0x7cd8('0xd6'),util['inspect'](_0x25aee2[_0x7cd8('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x7cd8('0x90'):if(_0x23794f===_0x7cd8('0xdc')||_0x23794f===_0x7cd8('0xdd')){return _0x4c65f9['update']({'read':!![]});}else{logger[_0x7cd8('0x26')](_0x7cd8('0xcc'),_0x7cd8('0x2c'),_0x7cd8('0x90'),util[_0x7cd8('0xcd')](_0x25aee2[_0x7cd8('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x4c65f9;}})[_0x7cd8('0x22')](respondWithResult(_0xb518e8,null))[_0x7cd8('0x2a')](handleError(_0xb518e8,null));};exports[_0x7cd8('0xde')]=function(_0x54a396,_0x10353e,_0x3f19d9){var _0x26fe00,_0x565b28,_0xd224e8;return db['SmsAccount'][_0x7cd8('0x63')]({'where':{'id':_0x54a396['params']['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x10353e,null))[_0x7cd8('0x22')](function(_0x13b57b){if(_0x13b57b){_0xd224e8=_0x13b57b;logger[_0x7cd8('0xb2')](_0x7cd8('0xcc'),_0x7cd8('0x2c'),_0x7cd8('0xdf'),_0x13b57b[_0x7cd8('0x54')],util[_0x7cd8('0xcd')](_0x54a396[_0x7cd8('0x46')],{'showHidden':![],'depth':null}));switch(_0x13b57b[_0x7cd8('0x54')]){case _0x7cd8('0xe0'):if(_0x54a396[_0x7cd8('0x46')][_0x7cd8('0xe1')]&&_0x54a396[_0x7cd8('0x46')][_0x7cd8('0xe2')]){_0x565b28=_0x54a396[_0x7cd8('0x46')][_0x7cd8('0xe2')];return db['SmsMessage'][_0x7cd8('0x63')]({'where':{'messageId':_0x54a396['query'][_0x7cd8('0xe1')]}});}break;}}})[_0x7cd8('0x22')](handleEntityNotFound(_0x10353e,null))['then'](function(_0x5a5590){if(_0x5a5590){_0x26fe00=_0x5a5590;switch(_0xd224e8[_0x7cd8('0x54')]){case _0x7cd8('0xe0'):if(_0x565b28==='2'||_0x565b28==='6'){return _0x26fe00[_0x7cd8('0x36')]({'read':!![]});}else{logger[_0x7cd8('0x26')](_0x7cd8('0xcc'),'status',_0x7cd8('0xe0'),util[_0x7cd8('0xcd')](_0x54a396[_0x7cd8('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x26fe00;}})[_0x7cd8('0x22')](respondWithResult(_0x10353e,null))[_0x7cd8('0x2a')](handleError(_0x10353e,null));};exports['addAgents']=function(_0x56669b,_0x24a806,_0x147707){return db[_0x7cd8('0x41')]['find']({'where':{'id':_0x56669b['params']['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x24a806,null))['then'](function(_0x280fb9){if(_0x280fb9){return _0x280fb9[_0x7cd8('0xe3')](_0x56669b[_0x7cd8('0x5f')][_0x7cd8('0x71')],_[_0x7cd8('0x9d')](_0x56669b['body'],[_0x7cd8('0x71'),'id'])||{})['spread'](function(_0x22d067){for(var _0xaf1ece=0x0;_0xaf1ece<_0x56669b[_0x7cd8('0x5f')][_0x7cd8('0x71')][_0x7cd8('0x4b')];_0xaf1ece+=0x1){socket['emit'](_0x7cd8('0xe4'),{'UserId':Number(_0x56669b[_0x7cd8('0x5f')]['ids'][_0xaf1ece]),'SmsAccountId':Number(_0x56669b[_0x7cd8('0x5a')]['id'])});}return _0x22d067;});}})[_0x7cd8('0x22')](respondWithResult(_0x24a806,null))[_0x7cd8('0x2a')](handleError(_0x24a806,null));};exports[_0x7cd8('0xe5')]=function(_0x289e25,_0x168e2c,_0x31cf32){return db[_0x7cd8('0x41')]['find']({'where':{'id':_0x289e25[_0x7cd8('0x5a')]['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x168e2c,null))[_0x7cd8('0x22')](function(_0x3e84bf){if(_0x3e84bf){return _0x3e84bf['removeAgents'](_0x289e25[_0x7cd8('0x46')][_0x7cd8('0x71')])['then'](function(){if(_[_0x7cd8('0xe6')](_0x289e25[_0x7cd8('0x46')][_0x7cd8('0x71')])){for(var _0x53343d=0x0;_0x53343d<_0x289e25[_0x7cd8('0x46')]['ids'][_0x7cd8('0x4b')];_0x53343d+=0x1){socket[_0x7cd8('0xe7')](_0x7cd8('0xe8'),{'UserId':Number(_0x289e25['query'][_0x7cd8('0x71')][_0x53343d]),'SmsAccountId':Number(_0x289e25[_0x7cd8('0x5a')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x289e25[_0x7cd8('0x46')]['ids']),'SmsAccountId':Number(_0x289e25['params']['id'])});}});}})[_0x7cd8('0x22')](respondWithStatusCode(_0x168e2c,null))[_0x7cd8('0x2a')](handleError(_0x168e2c,null));};exports[_0x7cd8('0xe9')]=function(_0x115a92,_0x299257,_0x2f51f1){var _0x324ab4={};var _0x48b376={};var _0xfdbec;var _0x2ebde4;return db[_0x7cd8('0x41')][_0x7cd8('0x6c')]({'where':{'id':_0x115a92[_0x7cd8('0x5a')]['id']}})[_0x7cd8('0x22')](handleEntityNotFound(_0x299257,null))['then'](function(_0x94e458){if(_0x94e458){_0xfdbec=_0x94e458;_0x48b376[_0x7cd8('0x45')]=_[_0x7cd8('0x5c')](db[_0x7cd8('0xa8')][_0x7cd8('0x42')]);_0x48b376[_0x7cd8('0x46')]=_[_0x7cd8('0x5c')](_0x115a92['query']);_0x48b376['filters']=_[_0x7cd8('0x48')](_0x48b376[_0x7cd8('0x45')],_0x48b376['query']);_0x324ab4[_0x7cd8('0x4a')]=_['intersection'](_0x48b376[_0x7cd8('0x45')],qs['fields'](_0x115a92[_0x7cd8('0x46')]['fields']));_0x324ab4[_0x7cd8('0x4a')]=_0x324ab4[_0x7cd8('0x4a')][_0x7cd8('0x4b')]?_0x324ab4['attributes']:_0x48b376['model'];_0x324ab4['order']=qs[_0x7cd8('0x4f')](_0x115a92[_0x7cd8('0x46')][_0x7cd8('0x4f')]);_0x324ab4['where']=qs['filters'](_['pick'](_0x115a92[_0x7cd8('0x46')],_0x48b376[_0x7cd8('0x47')]));if(_0x115a92['query'][_0x7cd8('0x52')]){_0x324ab4['where']=_[_0x7cd8('0x53')](_0x324ab4['where'],{'$or':_[_0x7cd8('0x40')](_0x324ab4[_0x7cd8('0x4a')],function(_0xebc567){var _0xd74eb0={};_0xd74eb0[_0xebc567]={'$like':'%'+_0x115a92[_0x7cd8('0x46')][_0x7cd8('0x52')]+'%'};return _0xd74eb0;})});}_0x324ab4=_[_0x7cd8('0x53')]({},_0x324ab4,_0x115a92[_0x7cd8('0x55')]);return _0xfdbec[_0x7cd8('0xe9')](_0x324ab4);}})[_0x7cd8('0x22')](function(_0x21040a){if(_0x21040a){_0x2ebde4=_0x21040a[_0x7cd8('0x4b')];if(!_0x115a92[_0x7cd8('0x46')]['hasOwnProperty'](_0x7cd8('0x4d'))){_0x324ab4['limit']=qs[_0x7cd8('0x2e')](_0x115a92[_0x7cd8('0x46')][_0x7cd8('0x2e')]);_0x324ab4[_0x7cd8('0x31')]=qs[_0x7cd8('0x31')](_0x115a92[_0x7cd8('0x46')]['offset']);}return _0xfdbec['getAgents'](_0x324ab4);}})[_0x7cd8('0x22')](function(_0x5042af){if(_0x5042af){return _0x5042af?{'count':_0x2ebde4,'rows':_0x5042af}:null;}})[_0x7cd8('0x22')](respondWithResult(_0x299257,null))[_0x7cd8('0x2a')](handleError(_0x299257,null));};
\ No newline at end of file
+var _0xbc3a=['fullname','internal','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','List','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','statusInt','requestid','status_code','message_id','groupName','redif','DELIVERED','error_code','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','csc','message-id','addAgents','omit','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','client','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','destroy','get','SmsAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','map','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','VIRTUAL','merge','SmsAccount','includeAll','include','findAll','rows','show','params','Pause','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','keys','rawAttributes','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','sms','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','From','Body','MessageSid','from','sender','text','connectel','clicksend','messageId','Text','MessageUUID','infobip','results','originatingAddress','replyMessageId','bandwidth','intelepeer','refid','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','contact','SmsInteraction','interaction','autoclose','applications','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','startRouting','entity\x20found','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','findAndCountAll','getApplications','Contact','Owner'];(function(_0x3ff601,_0x565c8){var _0x168e2f=function(_0x5b0645){while(--_0x5b0645){_0x3ff601['push'](_0x3ff601['shift']());}};_0x168e2f(++_0x565c8);}(_0xbc3a,0xfd));var _0xabc3=function(_0x53d905,_0x220509){_0x53d905=_0x53d905-0x0;var _0x2d8d0f=_0xbc3a[_0x53d905];return _0x2d8d0f;};'use strict';var emlformat=require(_0xabc3('0x0'));var rimraf=require(_0xabc3('0x1'));var zipdir=require(_0xabc3('0x2'));var jsonpatch=require(_0xabc3('0x3'));var rp=require(_0xabc3('0x4'));var moment=require(_0xabc3('0x5'));var BPromise=require(_0xabc3('0x6'));var Mustache=require(_0xabc3('0x7'));var util=require(_0xabc3('0x8'));var path=require(_0xabc3('0x9'));var sox=require(_0xabc3('0xa'));var csv=require('to-csv');var ejs=require(_0xabc3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabc3('0xc'));var squel=require(_0xabc3('0xd'));var crypto=require(_0xabc3('0xe'));var jsforce=require(_0xabc3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xabc3('0x10'));var querystring=require(_0xabc3('0x11'));var Papa=require(_0xabc3('0x12'));var Redis=require(_0xabc3('0x13'));var authService=require(_0xabc3('0x14'));var qs=require(_0xabc3('0x15'));var as=require(_0xabc3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabc3('0x17'))(_0xabc3('0x18'));var utils=require('../../config/utils');var config=require(_0xabc3('0x19'));var licenseUtil=require(_0xabc3('0x1a'));var db=require(_0xabc3('0x1b'))['db'];config[_0xabc3('0x1c')]=_[_0xabc3('0x1d')](config[_0xabc3('0x1c')],{'host':_0xabc3('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabc3('0x1c')]));require(_0xabc3('0x1f'))[_0xabc3('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0xabc3('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5969f1,_0x35e17a,_0x36e7ab,_0x53b63a){return new BPromise(function(_0x579c6c,_0x16d065){var _0x3ab39e=_0x53b63a||client;return _0x3ab39e['request'](_0x5969f1,_0x36e7ab)[_0xabc3('0x22')](function(_0x4d5190){logger[_0xabc3('0x23')](_0xabc3('0x24'),_0x35e17a,_0xabc3('0x25'));logger[_0xabc3('0x26')](_0xabc3('0x27'),_0x35e17a,_0xabc3('0x25'),JSON['stringify'](_0x4d5190));if(_0x4d5190['error']){if(_0x4d5190[_0xabc3('0x28')]['code']===0x1f4){logger[_0xabc3('0x28')](_0xabc3('0x24'),_0x35e17a,_0x4d5190[_0xabc3('0x28')][_0xabc3('0x29')]);return _0x16d065(_0x4d5190[_0xabc3('0x28')][_0xabc3('0x29')]);}logger[_0xabc3('0x28')](_0xabc3('0x24'),_0x35e17a,_0x4d5190['error']['message']);return _0x579c6c(_0x4d5190[_0xabc3('0x28')][_0xabc3('0x29')]);}else{logger['info'](_0xabc3('0x24'),_0x35e17a,_0xabc3('0x25'));_0x579c6c(_0x4d5190['result'][_0xabc3('0x29')]);}})[_0xabc3('0x2a')](function(_0x25a169){logger[_0xabc3('0x28')](_0xabc3('0x24'),_0x35e17a,_0x25a169);_0x16d065(_0x25a169);});});}function respondWithStatusCode(_0x50c0bd,_0xedac3f){_0xedac3f=_0xedac3f||0xcc;return function(_0xc07954){if(_0xc07954){return _0x50c0bd[_0xabc3('0x2b')](_0xedac3f);}return _0x50c0bd[_0xabc3('0x2c')](_0xedac3f)[_0xabc3('0x2d')]();};}function respondWithResult(_0x4a77a5,_0x467427){_0x467427=_0x467427||0xc8;return function(_0xee312c){if(_0xee312c){return _0x4a77a5[_0xabc3('0x2c')](_0x467427)[_0xabc3('0x2e')](_0xee312c);}};}function respondWithFilteredResult(_0x2d9cc2,_0x315b16){return function(_0x4741a0){if(_0x4741a0){var _0x41f9e7=typeof _0x315b16[_0xabc3('0x2f')]===_0xabc3('0x30')&&typeof _0x315b16[_0xabc3('0x31')]==='undefined';var _0x1a0174=_0x4741a0[_0xabc3('0x32')];var _0x380cc0=_0x41f9e7?0x0:_0x315b16[_0xabc3('0x2f')];var _0x4c8a36=_0x41f9e7?_0x4741a0[_0xabc3('0x32')]:_0x315b16[_0xabc3('0x2f')]+_0x315b16[_0xabc3('0x31')];var _0x5c5a2e;if(_0x4c8a36>=_0x1a0174){_0x4c8a36=_0x1a0174;_0x5c5a2e=0xc8;}else{_0x5c5a2e=0xce;}_0x2d9cc2[_0xabc3('0x2c')](_0x5c5a2e);return _0x2d9cc2[_0xabc3('0x33')]('Content-Range',_0x380cc0+'-'+_0x4c8a36+'/'+_0x1a0174)[_0xabc3('0x2e')](_0x4741a0);}return null;};}function patchUpdates(_0x35ff5f){return function(_0x1b1e63){try{jsonpatch['apply'](_0x1b1e63,_0x35ff5f,!![]);}catch(_0xff9bc5){return BPromise['reject'](_0xff9bc5);}return _0x1b1e63[_0xabc3('0x34')]();};}function saveUpdates(_0x5cfd22,_0x337971){return function(_0x2a914e){if(_0x2a914e){return _0x2a914e[_0xabc3('0x35')](_0x5cfd22)[_0xabc3('0x22')](function(_0x3b77ea){return _0x3b77ea;});}return null;};}function removeEntity(_0x43481a,_0x38f5b8){return function(_0x29b889){if(_0x29b889){return _0x29b889[_0xabc3('0x36')]()[_0xabc3('0x22')](function(){var _0x29da33=_0x29b889[_0xabc3('0x37')]({'plain':!![]});var _0xecf8cc=_0xabc3('0x38');return db[_0xabc3('0x39')][_0xabc3('0x36')]({'where':{'type':_0xecf8cc,'resourceId':_0x29da33['id']}})[_0xabc3('0x22')](function(){return _0x29b889;});})[_0xabc3('0x22')](function(){_0x43481a[_0xabc3('0x2c')](0xcc)[_0xabc3('0x2d')]();});}};}function handleEntityNotFound(_0x2f73dc,_0x136373){return function(_0x259c99){if(!_0x259c99){_0x2f73dc[_0xabc3('0x2b')](0x194);}return _0x259c99;};}function handleError(_0x1ae1a1,_0x492312){_0x492312=_0x492312||0x1f4;return function(_0x572707){logger[_0xabc3('0x28')](_0x572707['stack']);if(_0x572707['name']){delete _0x572707[_0xabc3('0x3a')];}_0x1ae1a1[_0xabc3('0x2c')](_0x492312)[_0xabc3('0x3b')](_0x572707);};}exports[_0xabc3('0x3c')]=function(_0x42daf2,_0xde5dee){var _0x5d902e={'include':[{'model':db['Pause'],'as':_0xabc3('0x3d')}]},_0x410e87={},_0x44fd2d={'count':0x0,'rows':[]};var _0x2248f4=_[_0xabc3('0x3e')](db['SmsAccount']['rawAttributes'],function(_0x4a86c1){return{'name':_0x4a86c1[_0xabc3('0x3f')],'type':_0x4a86c1[_0xabc3('0x40')][_0xabc3('0x41')]};});_0x410e87[_0xabc3('0x42')]=_[_0xabc3('0x3e')](_0x2248f4,_0xabc3('0x3a'));_0x410e87[_0xabc3('0x43')]=_['keys'](_0x42daf2[_0xabc3('0x43')]);_0x410e87['filters']=_[_0xabc3('0x44')](_0x410e87[_0xabc3('0x42')],_0x410e87[_0xabc3('0x43')]);_0x5d902e[_0xabc3('0x45')]=_[_0xabc3('0x44')](_0x410e87[_0xabc3('0x42')],qs[_0xabc3('0x46')](_0x42daf2[_0xabc3('0x43')][_0xabc3('0x46')]));_0x5d902e['attributes']=_0x5d902e[_0xabc3('0x45')][_0xabc3('0x47')]?_0x5d902e['attributes']:_0x410e87[_0xabc3('0x42')];if(!_0x42daf2[_0xabc3('0x43')][_0xabc3('0x48')]('nolimit')){_0x5d902e['limit']=qs[_0xabc3('0x31')](_0x42daf2[_0xabc3('0x43')][_0xabc3('0x31')]);_0x5d902e[_0xabc3('0x2f')]=qs['offset'](_0x42daf2[_0xabc3('0x43')]['offset']);}_0x5d902e[_0xabc3('0x49')]=qs['sort'](_0x42daf2['query'][_0xabc3('0x4a')]);_0x5d902e['where']=qs[_0xabc3('0x4b')](_[_0xabc3('0x4c')](_0x42daf2['query'],_0x410e87[_0xabc3('0x4b')]),_0x2248f4);if(_0x42daf2[_0xabc3('0x43')][_0xabc3('0x4d')]){_0x5d902e[_0xabc3('0x4e')]=_['merge'](_0x5d902e[_0xabc3('0x4e')],{'$or':_[_0xabc3('0x3e')](_0x2248f4,function(_0x28f9b4){if(_0x28f9b4['type']!==_0xabc3('0x4f')){var _0x573e73={};_0x573e73[_0x28f9b4[_0xabc3('0x3a')]]={'$like':'%'+_0x42daf2[_0xabc3('0x43')][_0xabc3('0x4d')]+'%'};return _0x573e73;}})});}_0x5d902e=_[_0xabc3('0x50')]({},_0x5d902e,_0x42daf2['options']);var _0x1a6ba6={'where':_0x5d902e['where']};return db[_0xabc3('0x51')]['count'](_0x1a6ba6)[_0xabc3('0x22')](function(_0x219d00){_0x44fd2d[_0xabc3('0x32')]=_0x219d00;if(_0x42daf2[_0xabc3('0x43')][_0xabc3('0x52')]){_0x5d902e[_0xabc3('0x53')]=[{'all':!![]}];}return db[_0xabc3('0x51')][_0xabc3('0x54')](_0x5d902e);})[_0xabc3('0x22')](function(_0x116f1c){_0x44fd2d[_0xabc3('0x55')]=_0x116f1c;return _0x44fd2d;})[_0xabc3('0x22')](respondWithFilteredResult(_0xde5dee,_0x5d902e))[_0xabc3('0x2a')](handleError(_0xde5dee,null));};exports[_0xabc3('0x56')]=function(_0x3c5a22,_0x1ed62a){var _0x229b86={'raw':![],'where':{'id':_0x3c5a22[_0xabc3('0x57')]['id']},'include':[{'model':db[_0xabc3('0x58')],'as':'mandatoryDispositionPause'}]},_0x1a66ce={};_0x1a66ce['model']=_['keys'](db['SmsAccount']['rawAttributes']);_0x1a66ce[_0xabc3('0x43')]=_['keys'](_0x3c5a22['query']);_0x1a66ce[_0xabc3('0x4b')]=_[_0xabc3('0x44')](_0x1a66ce[_0xabc3('0x42')],_0x1a66ce['query']);_0x229b86[_0xabc3('0x45')]=_[_0xabc3('0x44')](_0x1a66ce[_0xabc3('0x42')],qs[_0xabc3('0x46')](_0x3c5a22[_0xabc3('0x43')][_0xabc3('0x46')]));_0x229b86[_0xabc3('0x45')]=_0x229b86['attributes'][_0xabc3('0x47')]?_0x229b86[_0xabc3('0x45')]:_0x1a66ce[_0xabc3('0x42')];if(_0x3c5a22[_0xabc3('0x43')][_0xabc3('0x52')]){_0x229b86[_0xabc3('0x53')]=[{'all':!![]}];}_0x229b86=_[_0xabc3('0x50')]({},_0x229b86,_0x3c5a22[_0xabc3('0x59')]);return db[_0xabc3('0x51')][_0xabc3('0x5a')](_0x229b86)[_0xabc3('0x22')](handleEntityNotFound(_0x1ed62a,null))[_0xabc3('0x22')](respondWithResult(_0x1ed62a,null))[_0xabc3('0x2a')](handleError(_0x1ed62a,null));};exports[_0xabc3('0x5b')]=function(_0x198cad,_0x155f22){return db[_0xabc3('0x51')][_0xabc3('0x5b')](_0x198cad['body'],{})[_0xabc3('0x22')](function(_0x310728){var _0x58a7c1=_0x198cad[_0xabc3('0x5c')][_0xabc3('0x37')]({'plain':!![]});if(!_0x58a7c1)throw new Error(_0xabc3('0x5d'));if(_0x58a7c1[_0xabc3('0x5e')]===_0xabc3('0x5c')){var _0x3e62ae=_0x310728[_0xabc3('0x37')]({'plain':!![]});var _0x78775b='SmsAccounts';return db[_0xabc3('0x5f')][_0xabc3('0x5a')]({'where':{'name':_0x78775b,'userProfileId':_0x58a7c1[_0xabc3('0x60')]},'raw':!![]})[_0xabc3('0x22')](function(_0x4edd6e){if(_0x4edd6e&&_0x4edd6e[_0xabc3('0x61')]===0x0){return db[_0xabc3('0x39')]['create']({'name':_0x3e62ae['name'],'resourceId':_0x3e62ae['id'],'type':_0x4edd6e[_0xabc3('0x3a')],'sectionId':_0x4edd6e['id']},{})[_0xabc3('0x22')](function(){return _0x310728;});}else{return _0x310728;}})['catch'](function(_0x4851eb){logger[_0xabc3('0x28')](_0xabc3('0x62'),_0x4851eb);throw _0x4851eb;});}return _0x310728;})['then'](respondWithResult(_0x155f22,0xc9))[_0xabc3('0x2a')](handleError(_0x155f22,null));};exports['update']=function(_0x1765a0,_0x417a9f){if(_0x1765a0[_0xabc3('0x63')]['id']){delete _0x1765a0['body']['id'];}return db['SmsAccount'][_0xabc3('0x5a')]({'where':{'id':_0x1765a0[_0xabc3('0x57')]['id']},'include':[{'model':db[_0xabc3('0x58')],'as':_0xabc3('0x3d')}]})['then'](handleEntityNotFound(_0x417a9f,null))[_0xabc3('0x22')](saveUpdates(_0x1765a0['body'],null))[_0xabc3('0x22')](respondWithResult(_0x417a9f,null))[_0xabc3('0x2a')](handleError(_0x417a9f,null));};exports[_0xabc3('0x36')]=function(_0x539d1c,_0x4c4362){return db['SmsAccount'][_0xabc3('0x5a')]({'where':{'id':_0x539d1c[_0xabc3('0x57')]['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x4c4362,null))['then'](removeEntity(_0x4c4362,null))[_0xabc3('0x2a')](handleError(_0x4c4362,null));};exports[_0xabc3('0x64')]=function(_0x388598,_0x1f6783){return db['SmsAccount'][_0xabc3('0x64')]()['then'](respondWithResult(_0x1f6783,null))['catch'](handleError(_0x1f6783,null));};exports[_0xabc3('0x65')]=function(_0x4f901e,_0x30215e,_0x36f86b){if(_0x4f901e[_0xabc3('0x63')]['id']){delete _0x4f901e['body']['id'];}return db[_0xabc3('0x51')][_0xabc3('0x5a')]({'where':{'id':_0x4f901e[_0xabc3('0x57')]['id']}})['then'](handleEntityNotFound(_0x30215e,null))[_0xabc3('0x22')](function(_0x3fab5d){if(_0x3fab5d){_0x4f901e[_0xabc3('0x63')][_0xabc3('0x66')]=_0x3fab5d['id'];return db[_0xabc3('0x67')][_0xabc3('0x5b')](_0x4f901e['body']);}})[_0xabc3('0x22')](respondWithResult(_0x30215e,null))['catch'](handleError(_0x30215e,null));};exports[_0xabc3('0x68')]=function(_0x3d2fb8,_0x45c28b,_0x42bf4c){var _0x433496={'raw':![],'where':{}};var _0x414fb6={};var _0x1539c2={'count':0x0,'rows':[]};return db[_0xabc3('0x51')]['findOne']({'where':{'id':_0x3d2fb8[_0xabc3('0x57')]['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x45c28b,null))['then'](function(_0x3a8ab8){if(_0x3a8ab8){_0x414fb6[_0xabc3('0x42')]=_[_0xabc3('0x69')](db[_0xabc3('0x67')][_0xabc3('0x6a')]);_0x414fb6[_0xabc3('0x43')]=_[_0xabc3('0x69')](_0x3d2fb8['query']);_0x414fb6['filters']=_[_0xabc3('0x44')](_0x414fb6[_0xabc3('0x42')],_0x414fb6[_0xabc3('0x43')]);_0x433496[_0xabc3('0x45')]=_[_0xabc3('0x44')](_0x414fb6[_0xabc3('0x42')],qs[_0xabc3('0x46')](_0x3d2fb8[_0xabc3('0x43')][_0xabc3('0x46')]));_0x433496['attributes']=_0x433496[_0xabc3('0x45')][_0xabc3('0x47')]?_0x433496[_0xabc3('0x45')]:_0x414fb6[_0xabc3('0x42')];if(!_0x3d2fb8[_0xabc3('0x43')][_0xabc3('0x48')](_0xabc3('0x6b'))){_0x433496[_0xabc3('0x31')]=qs[_0xabc3('0x31')](_0x3d2fb8[_0xabc3('0x43')][_0xabc3('0x31')]);_0x433496[_0xabc3('0x2f')]=qs[_0xabc3('0x2f')](_0x3d2fb8[_0xabc3('0x43')][_0xabc3('0x2f')]);}_0x433496['order']=qs['sort'](_0x3d2fb8['query'][_0xabc3('0x4a')]);_0x433496[_0xabc3('0x4e')]=qs[_0xabc3('0x4b')](_[_0xabc3('0x4c')](_0x3d2fb8[_0xabc3('0x43')],_0x414fb6[_0xabc3('0x4b')]));_0x433496[_0xabc3('0x4e')][_0xabc3('0x66')]=_0x3a8ab8['id'];if(_0x3d2fb8[_0xabc3('0x43')][_0xabc3('0x4d')]){_0x433496['where']=_[_0xabc3('0x50')](_0x433496['where'],{'$or':_['map'](_0x433496[_0xabc3('0x45')],function(_0x47d86c){var _0x17c386={};_0x17c386[_0x47d86c]={'$like':'%'+_0x3d2fb8[_0xabc3('0x43')]['filter']+'%'};return _0x17c386;})});}_0x433496=_['merge']({},_0x433496,_0x3d2fb8[_0xabc3('0x59')]);return db[_0xabc3('0x67')][_0xabc3('0x32')]({'where':_0x433496[_0xabc3('0x4e')]})[_0xabc3('0x22')](function(_0x309d4c){_0x1539c2[_0xabc3('0x32')]=_0x309d4c;if(_0x3d2fb8[_0xabc3('0x43')]['includeAll']){_0x433496[_0xabc3('0x53')]=[{'all':!![]}];}return db[_0xabc3('0x67')][_0xabc3('0x54')](_0x433496);})[_0xabc3('0x22')](function(_0x4d2453){_0x1539c2[_0xabc3('0x55')]=_0x4d2453;return _0x1539c2;});}})[_0xabc3('0x22')](respondWithFilteredResult(_0x45c28b,_0x433496))[_0xabc3('0x2a')](handleError(_0x45c28b,null));};exports['removeDispositions']=function(_0x4b348d,_0x267862,_0x586e48){return db['SmsAccount']['find']({'where':{'id':_0x4b348d[_0xabc3('0x57')]['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x267862,null))[_0xabc3('0x22')](function(_0x28d9f8){if(_0x28d9f8){return _0x28d9f8[_0xabc3('0x6c')](_0x4b348d['query'][_0xabc3('0x6d')]);}})[_0xabc3('0x22')](respondWithStatusCode(_0x267862,null))[_0xabc3('0x2a')](handleError(_0x267862,null));};exports[_0xabc3('0x6e')]=function(_0xbfc94e,_0x4201dc,_0x10274e){if(_0xbfc94e['body']['id']){delete _0xbfc94e[_0xabc3('0x63')]['id'];}return db[_0xabc3('0x51')]['find']({'where':{'id':_0xbfc94e[_0xabc3('0x57')]['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x4201dc,null))[_0xabc3('0x22')](function(_0x537a67){if(_0x537a67){_0xbfc94e['body'][_0xabc3('0x66')]=_0x537a67['id'];return db[_0xabc3('0x6f')]['create'](_0xbfc94e['body']);}})['then'](respondWithResult(_0x4201dc,null))[_0xabc3('0x2a')](handleError(_0x4201dc,null));};exports[_0xabc3('0x70')]=function(_0x1e35d7,_0x26870b,_0x207281){var _0x5f31ea={'raw':![],'where':{}};var _0x1547b6={};var _0x3aff7c={'count':0x0,'rows':[]};return db[_0xabc3('0x51')][_0xabc3('0x71')]({'where':{'id':_0x1e35d7['params']['id']}})['then'](handleEntityNotFound(_0x26870b,null))['then'](function(_0x21aab7){if(_0x21aab7){_0x1547b6[_0xabc3('0x42')]=_['keys'](db[_0xabc3('0x6f')][_0xabc3('0x6a')]);_0x1547b6[_0xabc3('0x43')]=_['keys'](_0x1e35d7[_0xabc3('0x43')]);_0x1547b6[_0xabc3('0x4b')]=_[_0xabc3('0x44')](_0x1547b6[_0xabc3('0x42')],_0x1547b6[_0xabc3('0x43')]);_0x5f31ea[_0xabc3('0x45')]=_[_0xabc3('0x44')](_0x1547b6[_0xabc3('0x42')],qs[_0xabc3('0x46')](_0x1e35d7[_0xabc3('0x43')]['fields']));_0x5f31ea['attributes']=_0x5f31ea['attributes'][_0xabc3('0x47')]?_0x5f31ea[_0xabc3('0x45')]:_0x1547b6[_0xabc3('0x42')];if(!_0x1e35d7['query'][_0xabc3('0x48')](_0xabc3('0x6b'))){_0x5f31ea[_0xabc3('0x31')]=qs[_0xabc3('0x31')](_0x1e35d7[_0xabc3('0x43')][_0xabc3('0x31')]);_0x5f31ea['offset']=qs[_0xabc3('0x2f')](_0x1e35d7[_0xabc3('0x43')][_0xabc3('0x2f')]);}_0x5f31ea[_0xabc3('0x49')]=qs['sort'](_0x1e35d7[_0xabc3('0x43')][_0xabc3('0x4a')]);_0x5f31ea[_0xabc3('0x4e')]=qs[_0xabc3('0x4b')](_[_0xabc3('0x4c')](_0x1e35d7['query'],_0x1547b6[_0xabc3('0x4b')]));_0x5f31ea['where'][_0xabc3('0x66')]=_0x21aab7['id'];if(_0x1e35d7[_0xabc3('0x43')][_0xabc3('0x4d')]){_0x5f31ea['where']=_[_0xabc3('0x50')](_0x5f31ea[_0xabc3('0x4e')],{'$or':_['map'](_0x5f31ea[_0xabc3('0x45')],function(_0x1cd7db){var _0x2ec608={};_0x2ec608[_0x1cd7db]={'$like':'%'+_0x1e35d7['query'][_0xabc3('0x4d')]+'%'};return _0x2ec608;})});}_0x5f31ea=_[_0xabc3('0x50')]({},_0x5f31ea,_0x1e35d7[_0xabc3('0x59')]);return db['CannedAnswer'][_0xabc3('0x32')]({'where':_0x5f31ea['where']})['then'](function(_0x373e99){_0x3aff7c[_0xabc3('0x32')]=_0x373e99;if(_0x1e35d7[_0xabc3('0x43')]['includeAll']){_0x5f31ea[_0xabc3('0x53')]=[{'all':!![]}];}return db[_0xabc3('0x6f')][_0xabc3('0x54')](_0x5f31ea);})[_0xabc3('0x22')](function(_0x221e6f){_0x3aff7c['rows']=_0x221e6f;return _0x3aff7c;});}})[_0xabc3('0x22')](respondWithFilteredResult(_0x26870b,_0x5f31ea))[_0xabc3('0x2a')](handleError(_0x26870b,null));};exports['removeAnswers']=function(_0x45309b,_0x11e28c,_0x332ad6){return db[_0xabc3('0x51')][_0xabc3('0x5a')]({'where':{'id':_0x45309b[_0xabc3('0x57')]['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x11e28c,null))[_0xabc3('0x22')](function(_0x243d7c){if(_0x243d7c){return _0x243d7c[_0xabc3('0x72')](_0x45309b['query'][_0xabc3('0x6d')]);}})[_0xabc3('0x22')](respondWithStatusCode(_0x11e28c,null))[_0xabc3('0x2a')](handleError(_0x11e28c,null));};exports['notify']=function(_0x3963cb,_0x2dd8a8,_0x511d1e){var _0x447a35={'channel':_0xabc3('0x73')};var _0x2ede97=[];var _0x4c5e0a=[];var _0x24bad6={};return db[_0xabc3('0x51')]['find']({'where':{'id':_0x3963cb['params']['id']},'include':[{'model':db[_0xabc3('0x74')],'as':_0xabc3('0x75')}]})['then'](handleEntityNotFound(_0x2dd8a8,null))[_0xabc3('0x22')](function(_0x388b0e){_0x447a35[_0xabc3('0x76')]=_0x388b0e;_0x447a35['applications']=_[_0xabc3('0x77')](_0x388b0e[_0xabc3('0x75')],[_0xabc3('0x78')],[_0xabc3('0x79')]);if(_0x447a35[_0xabc3('0x76')][_0xabc3('0x75')]){delete _0x447a35[_0xabc3('0x76')][_0xabc3('0x75')];}return db[_0xabc3('0x7a')][_0xabc3('0x64')]();})[_0xabc3('0x22')](function(_0x54d4fe){if(!_0x54d4fe){throw new db[(_0xabc3('0x7b'))][(_0xabc3('0x7c'))](_0xabc3('0x7d'));}_0x2ede97=_['difference'](_[_0xabc3('0x69')](_0x54d4fe),[_0xabc3('0x7e'),_0xabc3('0x7f')]);_0x4c5e0a=_[_0xabc3('0x80')](_[_0xabc3('0x69')](_0x54d4fe),['createdAt',_0xabc3('0x7f'),_0xabc3('0x81'),_0xabc3('0x82')]);_0x447a35[_0xabc3('0x63')]={'mapKey':_0xabc3('0x83')};if(_0x447a35[_0xabc3('0x76')][_0xabc3('0x40')]){switch(_0x447a35[_0xabc3('0x76')][_0xabc3('0x40')]){case _0xabc3('0x84'):_0x447a35['body']['from']=_0x3963cb['body'][_0xabc3('0x85')];_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')]=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x86')];_0x447a35['body']['messageId']=_0x3963cb['body'][_0xabc3('0x87')];break;case'skebby':_0x447a35['body'][_0xabc3('0x88')]='+'+_0x3963cb['body'][_0xabc3('0x89')];_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')]=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x8a')];break;case _0xabc3('0x8b'):_0x447a35[_0xabc3('0x63')]['from']=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x88')];_0x447a35['body'][_0xabc3('0x63')]=_0x3963cb['body']['message'];break;case _0xabc3('0x8c'):_0x447a35['body'][_0xabc3('0x88')]=_0x3963cb['body'][_0xabc3('0x88')];_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')]=_0x3963cb['body'][_0xabc3('0x63')];_0x447a35[_0xabc3('0x63')][_0xabc3('0x8d')]=_0x3963cb[_0xabc3('0x63')]['message_id'];break;case'plivo':_0x447a35[_0xabc3('0x63')]['from']=_0x3963cb['body']['From'];_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')]=_0x3963cb['body'][_0xabc3('0x8e')];_0x447a35['body'][_0xabc3('0x8d')]=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x8f')];break;case _0xabc3('0x90'):_0x447a35[_0xabc3('0x63')]['from']='+'+_0x3963cb[_0xabc3('0x63')][_0xabc3('0x91')][0x0][_0xabc3('0x88')];_0x447a35[_0xabc3('0x63')]['body']=_0x3963cb['body'][_0xabc3('0x91')][0x0]['text'];_0x447a35[_0xabc3('0x63')][_0xabc3('0x8d')]=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x91')][0x0][_0xabc3('0x8d')];break;case'csc':_0x447a35['body'][_0xabc3('0x88')]=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x92')];_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')]=_0x3963cb[_0xabc3('0x63')]['segmentedMessage'][_0xabc3('0x29')];break;case'clickatell':_0x447a35[_0xabc3('0x63')]['from']=_0x3963cb[_0xabc3('0x63')]['fromNumber'];_0x447a35['body'][_0xabc3('0x63')]=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x8a')];_0x447a35[_0xabc3('0x63')]['messageId']=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x93')];break;case _0xabc3('0x94'):_0x447a35[_0xabc3('0x63')][_0xabc3('0x8d')]=_0x3963cb['body'][0x0][_0xabc3('0x29')]['id'];_0x447a35[_0xabc3('0x63')]['from']=_0x3963cb[_0xabc3('0x63')][0x0][_0xabc3('0x29')]['from'];_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')]=_0x3963cb['body'][0x0][_0xabc3('0x29')][_0xabc3('0x8a')];break;case _0xabc3('0x95'):_0x447a35[_0xabc3('0x63')][_0xabc3('0x88')]=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x88')];_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')]=_0x3963cb[_0xabc3('0x63')][_0xabc3('0x29')];_0x447a35[_0xabc3('0x63')][_0xabc3('0x8d')]=_0x3963cb['body'][_0xabc3('0x96')];break;}}if(_0x447a35['body']['id']){delete _0x447a35[_0xabc3('0x63')]['id'];}if(_['isNil'](_0x447a35[_0xabc3('0x63')][_0xabc3('0x88')])){throw new db[(_0xabc3('0x7b'))][(_0xabc3('0x7c'))]('from\x20is\x20mandatory');}if(_[_0xabc3('0x97')](_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')])||_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')]===''){throw new db[(_0xabc3('0x7b'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xabc3('0x97')](_0x447a35[_0xabc3('0x63')][_0xabc3('0x98')])){throw new db['Sequelize'][(_0xabc3('0x7c'))](_0xabc3('0x99')+_0x4c5e0a);}if(!_[_0xabc3('0x9a')](_0x4c5e0a,_0x447a35[_0xabc3('0x63')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c5e0a);}_0x24bad6[_0x447a35['body'][_0xabc3('0x98')]]=_0x447a35[_0xabc3('0x63')]['from'];return db[_0xabc3('0x9b')][_0xabc3('0x5a')]({'where':{'id':_0x447a35[_0xabc3('0x76')][_0xabc3('0x82')]},'include':[{'model':db[_0xabc3('0x7a')],'as':_0xabc3('0x9c'),'where':_0x24bad6,'limit':0x1,'order':[[_0xabc3('0x7f'),_0xabc3('0x9d')]]}]});})[_0xabc3('0x22')](handleEntityNotFound(_0x2dd8a8,null))[_0xabc3('0x22')](function(_0x25d500){if(_0x25d500){_0x447a35['list']=_['omit'](_0x25d500,[_0xabc3('0x9c')]);if(_0x25d500[_0xabc3('0x9c')][_0xabc3('0x47')]){return _0x25d500[_0xabc3('0x9c')][0x0];}var _0x33b994=_['defaults'](_0x447a35[_0xabc3('0x63')],{'firstName':_0x447a35['body'][_0xabc3('0x88')],'ListId':_0x25d500['id']});_0x33b994[_0x447a35[_0xabc3('0x63')][_0xabc3('0x98')]]=_0x447a35['body'][_0xabc3('0x88')];return db['CmContact'][_0xabc3('0x5b')](_0x33b994,{'fields':_0x2ede97,'raw':!![]});}})[_0xabc3('0x22')](handleEntityNotFound(_0x2dd8a8,null))[_0xabc3('0x22')](function(_0x407b17){if(_0x407b17){_0x447a35[_0xabc3('0x9e')]=_0x407b17;var _0x297041={'ContactId':_0x407b17['id'],'phone':_0x447a35['body'][_0xabc3('0x88')],'SmsAccountId':_0x3963cb[_0xabc3('0x57')]['id']};var _0x4ebebf={'ContactId':_0x407b17['id'],'SmsAccountId':_0x3963cb['params']['id'],'closed':![]};return db[_0xabc3('0x9f')][_0xabc3('0x5a')]({'where':_0x4ebebf})[_0xabc3('0x22')](function(_0x2b8f75){if(_0x2b8f75){return[_0x2b8f75,![]];}return db[_0xabc3('0x9f')][_0xabc3('0x5b')](_0x297041)['then'](function(_0x36482d){return[_0x36482d,!![]];});});}})['spread'](function(_0x33b921,_0x2b5638){_0x447a35[_0xabc3('0xa0')]=_0x33b921[_0xabc3('0x37')]({'plain':!![]});_0x447a35[_0xabc3('0xa0')]['created']=![];if(_0x2b5638){if(_0x447a35[_0xabc3('0x76')][_0xabc3('0xa1')]){_0x447a35[_0xabc3('0xa2')]['push']({'id':0x0,'priority':_0x447a35[_0xabc3('0xa2')][_0xabc3('0x47')]+0x1,'app':_0xabc3('0xa3'),'appdata':'unmanaged','interval':_0xabc3('0xa4')});}_0x447a35['interaction']['created']=!![];}return db[_0xabc3('0xa5')][_0xabc3('0x5b')]({'phone':_0x447a35[_0xabc3('0x63')]['from'],'messageId':_0x447a35[_0xabc3('0x63')]['messageId'],'body':_0x447a35[_0xabc3('0x63')][_0xabc3('0x63')],'SmsAccountId':_0x3963cb[_0xabc3('0x57')]['id'],'SmsInteractionId':_0x33b921['id'],'direction':'in','ContactId':_0x33b921[_0xabc3('0xa6')],'AttachmentId':_0x447a35['body'][_0xabc3('0xa7')]});})[_0xabc3('0x22')](function(_0x200854){_0x447a35['message']=_0x200854;if(_0x447a35[_0xabc3('0xa0')][_0xabc3('0xa8')]){return db[_0xabc3('0xa9')]['find']({'attributes':['id','name'],'where':{'id':_0x447a35[_0xabc3('0xa0')][_0xabc3('0xa8')]}})[_0xabc3('0x22')](function(_0x49df11){if(_0x49df11){_0x447a35[_0xabc3('0xa2')][_0xabc3('0xaa')]({'id':0x0,'priority':0x0,'app':_0xabc3('0xab'),'appdata':_0x49df11['name']+','+(_0x447a35[_0xabc3('0x76')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xabc3('0xac'),_0x447a35);});}return respondWithRpcPromise('Start','startRouting',_0x447a35);})[_0xabc3('0x22')](function(_0x775a3a){if(_0x775a3a){var _0x32ca42=0xc8;var _0x33aabf='receiveMessage';logger[_0xabc3('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x33aabf,_0x32ca42,'entity\x20found');logger[_0xabc3('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x33aabf,_0x32ca42,_0xabc3('0xad'),JSON['stringify'](_0x775a3a));if(_0x447a35[_0xabc3('0x76')]['type']==='twilio'){return _0x2dd8a8['status'](_0x32ca42)[_0xabc3('0x33')](_0xabc3('0xae'),'text/xml')['send'](_0xabc3('0xaf'));}else{return _0x2dd8a8[_0xabc3('0x2c')](_0x32ca42)[_0xabc3('0x2e')](_0x775a3a);}}})[_0xabc3('0x2a')](handleError(_0x2dd8a8,null));};exports[_0xabc3('0xb0')]=function(_0x26412d,_0x5a3061,_0x414d51){return db['SmsAccount']['findOne']({'where':{'id':_0x26412d[_0xabc3('0x57')]['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x5a3061,null))[_0xabc3('0x22')](function(_0xb839eb){if(_0xb839eb){return db[_0xabc3('0xb1')][_0xabc3('0xb2')](function(_0x59d60f){return db[_0xabc3('0x74')]['destroy']({'where':{'SmsAccountId':_0x26412d[_0xabc3('0x57')]['id']},'transaction':_0x59d60f})['then'](function(_0x57e76c){var _0x100975=_[_0xabc3('0x3e')](_0x26412d[_0xabc3('0x63')],function(_0x55da5f){_0x55da5f[_0xabc3('0x66')]=_0x26412d[_0xabc3('0x57')]['id'];return _0x55da5f;});return db[_0xabc3('0x74')]['bulkCreate'](_0x100975,{'transaction':_0x59d60f});});})[_0xabc3('0x22')](function(){return db['SmsApplication'][_0xabc3('0xb3')]({'where':{'SmsAccountId':_0x26412d['params']['id']},'order':'priority'});});}})[_0xabc3('0x22')](respondWithResult(_0x5a3061,null))[_0xabc3('0x2a')](handleError(_0x5a3061,null));};exports[_0xabc3('0xb4')]=function(_0x47419e,_0x21d91d,_0x15ed28){var _0x9691b1={};var _0x408563={};var _0x196640;var _0xef3239;return db['SmsAccount'][_0xabc3('0x71')]({'where':{'id':_0x47419e['params']['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x21d91d,null))[_0xabc3('0x22')](function(_0x48e3c4){if(_0x48e3c4){_0x196640=_0x48e3c4;_0x408563[_0xabc3('0x42')]=_[_0xabc3('0x69')](db['SmsApplication'][_0xabc3('0x6a')]);_0x408563[_0xabc3('0x43')]=_['keys'](_0x47419e[_0xabc3('0x43')]);_0x408563[_0xabc3('0x4b')]=_[_0xabc3('0x44')](_0x408563[_0xabc3('0x42')],_0x408563[_0xabc3('0x43')]);_0x9691b1[_0xabc3('0x45')]=_[_0xabc3('0x44')](_0x408563[_0xabc3('0x42')],qs[_0xabc3('0x46')](_0x47419e[_0xabc3('0x43')][_0xabc3('0x46')]));_0x9691b1[_0xabc3('0x45')]=_0x9691b1['attributes'][_0xabc3('0x47')]?_0x9691b1['attributes']:_0x408563[_0xabc3('0x42')];_0x9691b1[_0xabc3('0x49')]=qs[_0xabc3('0x4a')](_0x47419e['query'][_0xabc3('0x4a')]);_0x9691b1[_0xabc3('0x4e')]=qs[_0xabc3('0x4b')](_[_0xabc3('0x4c')](_0x47419e[_0xabc3('0x43')],_0x408563[_0xabc3('0x4b')]));if(_0x47419e['query'][_0xabc3('0x4d')]){_0x9691b1['where']=_[_0xabc3('0x50')](_0x9691b1[_0xabc3('0x4e')],{'$or':_[_0xabc3('0x3e')](_0x9691b1[_0xabc3('0x45')],function(_0x3041b4){var _0x5cbc06={};_0x5cbc06[_0x3041b4]={'$like':'%'+_0x47419e[_0xabc3('0x43')][_0xabc3('0x4d')]+'%'};return _0x5cbc06;})});}_0x9691b1=_['merge']({},_0x9691b1,_0x47419e[_0xabc3('0x59')]);return _0x196640[_0xabc3('0xb4')](_0x9691b1);}})[_0xabc3('0x22')](function(_0x4aed54){if(_0x4aed54){_0xef3239=_0x4aed54[_0xabc3('0x47')];if(!_0x47419e[_0xabc3('0x43')][_0xabc3('0x48')](_0xabc3('0x6b'))){_0x9691b1[_0xabc3('0x31')]=qs[_0xabc3('0x31')](_0x47419e[_0xabc3('0x43')][_0xabc3('0x31')]);_0x9691b1[_0xabc3('0x2f')]=qs['offset'](_0x47419e[_0xabc3('0x43')]['offset']);}return _0x196640['getApplications'](_0x9691b1);}})[_0xabc3('0x22')](function(_0x55cc6e){if(_0x55cc6e){return _0x55cc6e?{'count':_0xef3239,'rows':_0x55cc6e}:null;}})[_0xabc3('0x22')](respondWithResult(_0x21d91d,null))[_0xabc3('0x2a')](handleError(_0x21d91d,null));};exports['getInteractions']=function(_0x53d397,_0x41a147,_0x2f0f6b){var _0xe4afd8={'raw':![],'where':{}};var _0x33d8e3={};var _0x189621={'count':0x0,'rows':[]};return db[_0xabc3('0x51')][_0xabc3('0x71')]({'where':{'id':_0x53d397['params']['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x41a147,null))['then'](function(_0x2ffaf3){if(_0x2ffaf3){_0x33d8e3[_0xabc3('0x42')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x33d8e3[_0xabc3('0x43')]=_[_0xabc3('0x69')](_0x53d397['query']);_0x33d8e3[_0xabc3('0x4b')]=_[_0xabc3('0x44')](_0x33d8e3[_0xabc3('0x42')],_0x33d8e3[_0xabc3('0x43')]);_0xe4afd8[_0xabc3('0x45')]=_[_0xabc3('0x44')](_0x33d8e3[_0xabc3('0x42')],qs['fields'](_0x53d397[_0xabc3('0x43')]['fields']));_0xe4afd8[_0xabc3('0x45')]=_0xe4afd8['attributes'][_0xabc3('0x47')]?_0xe4afd8[_0xabc3('0x45')]:_0x33d8e3[_0xabc3('0x42')];if(!_0x53d397[_0xabc3('0x43')][_0xabc3('0x48')](_0xabc3('0x6b'))){_0xe4afd8[_0xabc3('0x31')]=qs[_0xabc3('0x31')](_0x53d397[_0xabc3('0x43')]['limit']);_0xe4afd8[_0xabc3('0x2f')]=qs[_0xabc3('0x2f')](_0x53d397[_0xabc3('0x43')][_0xabc3('0x2f')]);}_0xe4afd8['order']=qs[_0xabc3('0x4a')](_0x53d397[_0xabc3('0x43')][_0xabc3('0x4a')]);_0xe4afd8[_0xabc3('0x4e')]=qs[_0xabc3('0x4b')](_[_0xabc3('0x4c')](_0x53d397[_0xabc3('0x43')],_0x33d8e3[_0xabc3('0x4b')]));_0xe4afd8[_0xabc3('0x4e')][_0xabc3('0x66')]=_0x2ffaf3['id'];if(_0x53d397[_0xabc3('0x43')]['filter']){_0xe4afd8[_0xabc3('0x4e')]=_[_0xabc3('0x50')](_0xe4afd8[_0xabc3('0x4e')],{'$or':_[_0xabc3('0x3e')](_0xe4afd8[_0xabc3('0x45')],function(_0x493551){var _0x5d3a87={};_0x5d3a87[_0x493551]={'$like':'%'+_0x53d397['query'][_0xabc3('0x4d')]+'%'};return _0x5d3a87;})});}_0xe4afd8=_[_0xabc3('0x50')]({},_0xe4afd8,_0x53d397[_0xabc3('0x59')]);return db['SmsInteraction']['count']({'where':_0xe4afd8[_0xabc3('0x4e')]})['then'](function(_0xe32d48){_0x189621['count']=_0xe32d48;if(_0x53d397[_0xabc3('0x43')]['includeAll']){_0xe4afd8[_0xabc3('0x53')]=[{'model':db[_0xabc3('0x7a')],'as':_0xabc3('0xb5'),'required':![]},{'model':db['User'],'as':_0xabc3('0xb6'),'attributes':[_0xabc3('0x3a'),_0xabc3('0xb7'),_0xabc3('0xb8')],'required':![]},{'model':db['Tag'],'as':_0xabc3('0xb9'),'attributes':['id',_0xabc3('0x3a'),_0xabc3('0xba')],'where':_0x53d397[_0xabc3('0x43')]['tag']?{'id':_0x53d397['query'][_0xabc3('0xbb')]}:undefined,'required':_0x53d397[_0xabc3('0x43')][_0xabc3('0xbb')]?!![]:![]}];}return db['SmsInteraction'][_0xabc3('0x54')](_0xe4afd8);})['then'](function(_0x1af31b){_0x189621[_0xabc3('0x55')]=_0x1af31b;return _0x189621;});}})[_0xabc3('0x22')](respondWithFilteredResult(_0x41a147,_0xe4afd8))[_0xabc3('0x2a')](handleError(_0x41a147,null));};exports[_0xabc3('0x3b')]=function(_0x4a47d6,_0x1428c7,_0x1ca20c){var _0xd0d4ba,_0x452b8,_0x5116b8;if(_[_0xabc3('0x97')](_0x4a47d6[_0xabc3('0x63')]['body'])||_0x4a47d6[_0xabc3('0x63')][_0xabc3('0x63')]===''){throw new db['Sequelize'][(_0xabc3('0x7c'))](_0xabc3('0xbc'));}if(_[_0xabc3('0x97')](_0x4a47d6['body']['to'])){throw new db[(_0xabc3('0x7b'))][(_0xabc3('0x7c'))]('to\x20is\x20mandatory');}_0xd0d4ba=_0x4a47d6[_0xabc3('0x63')]['to'];return db['SmsAccount'][_0xabc3('0x5a')]({'where':{'id':_0x4a47d6['params']['id']},'include':[{'model':db[_0xabc3('0x9b')],'as':_0xabc3('0xbd'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0xd0d4ba},'limit':0x1,'order':[[_0xabc3('0x7f'),'DESC']]}]}]})[_0xabc3('0x22')](handleEntityNotFound(_0x1428c7,null))[_0xabc3('0x22')](function(_0x1b631d){if(_0x1b631d&&_0x1b631d[_0xabc3('0xbd')]){_0x452b8=_0x1b631d[_0xabc3('0x37')]({'plain':!![]});if(_0x452b8['List']&&_0x452b8[_0xabc3('0xbd')]['Contacts'][_0xabc3('0x47')]){return _0x452b8[_0xabc3('0xbd')][_0xabc3('0x9c')][0x0];}return db[_0xabc3('0x7a')][_0xabc3('0x5b')](_['defaults'](_0x4a47d6[_0xabc3('0x63')],{'firstName':_0xd0d4ba,'mobile':_0xd0d4ba,'phone':_0xd0d4ba,'ListId':_0x452b8[_0xabc3('0x82')]}));}})[_0xabc3('0x22')](handleEntityNotFound(_0x1428c7,null))['then'](function(_0x45d7db){if(_0x45d7db){_0x5116b8=_0x45d7db;return db[_0xabc3('0x9f')][_0xabc3('0x5a')]({'where':{'ContactId':_0x5116b8['id'],'closed':![],'SmsAccountId':_0x452b8['id']}})[_0xabc3('0x22')](function(_0x38d58b){if(_0x38d58b){return[_0x38d58b,![]];}return db[_0xabc3('0x9f')][_0xabc3('0x5b')]({'UserId':_0x4a47d6[_0xabc3('0x5c')]['id'],'ContactId':_0x5116b8['id'],'SmsAccountId':_0x452b8['id'],'phone':_0xd0d4ba,'firstMsgDirection':'out','Messages':[_[_0xabc3('0x50')](_0x4a47d6[_0xabc3('0x63')],{'read':![],'body':_0x4a47d6[_0xabc3('0x63')][_0xabc3('0x63')],'phone':_0xd0d4ba,'SmsAccountId':_0x452b8['id'],'UserId':_0x4a47d6[_0xabc3('0x5c')]['id'],'ContactId':_0x5116b8['id']})]},{'include':[{'model':db[_0xabc3('0xa5')],'as':'Messages'}]})['then'](function(_0x3927d3){return[_0x3927d3,!![]];});});}})[_0xabc3('0xbe')](function(_0x2c3691,_0x38effb){if(_0x38effb){return _0x2c3691;}return db[_0xabc3('0xa5')][_0xabc3('0x5b')](_[_0xabc3('0x50')](_0x4a47d6['body'],{'read':![],'body':_0x4a47d6[_0xabc3('0x63')][_0xabc3('0x63')],'phone':_0xd0d4ba,'SmsAccountId':_0x452b8['id'],'SmsInteractionId':_0x2c3691['id'],'UserId':_0x4a47d6[_0xabc3('0x5c')]['id'],'ContactId':_0x5116b8['id']}))[_0xabc3('0x22')](function(_0x1afbd6){_0x2c3691[_0xabc3('0xbf')]['Messages']=[];_0x2c3691['dataValues']['Messages']['push'](_0x1afbd6[_0xabc3('0xbf')]);return _0x2c3691;});})['then'](respondWithResult(_0x1428c7,null))[_0xabc3('0x2a')](handleError(_0x1428c7,null));};exports[_0xabc3('0x2c')]=function(_0x3745ca,_0x13eeaf,_0x5cef7b){if(_0x3745ca[_0xabc3('0x63')]['id']){delete _0x3745ca[_0xabc3('0x63')]['id'];}var _0x57f886,_0x293f5b,_0x4b9324;return db[_0xabc3('0x51')][_0xabc3('0x5a')]({'where':{'id':_0x3745ca['params']['id']}})['then'](handleEntityNotFound(_0x13eeaf,null))['then'](function(_0x177b9e){if(_0x177b9e){_0x4b9324=_0x177b9e;logger[_0xabc3('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xabc3('0x2c'),_0xabc3('0xc0'),_0x177b9e[_0xabc3('0x40')],util[_0xabc3('0xc1')](_0x3745ca[_0xabc3('0x63')],{'showHidden':![],'depth':null}));switch(_0x177b9e[_0xabc3('0x40')]){case _0xabc3('0xc2'):if(_0x3745ca[_0xabc3('0x63')][_0xabc3('0xc3')]&&_0x3745ca[_0xabc3('0x63')]['status']){_0x293f5b=_0x3745ca[_0xabc3('0x63')]['status'];return db[_0xabc3('0xa5')][_0xabc3('0x5a')]({'where':{'messageId':_0x3745ca[_0xabc3('0x63')][_0xabc3('0xc3')]}});}break;case _0xabc3('0x8b'):if(_0x3745ca['body']['requestid']&&_0x3745ca[_0xabc3('0x63')][_0xabc3('0xc4')]){_0x293f5b=_0x3745ca[_0xabc3('0x63')]['statusInt'];return db[_0xabc3('0xa5')][_0xabc3('0x5a')]({'where':{'messageId':_0x3745ca['body'][_0xabc3('0xc5')]}});}break;case _0xabc3('0x8c'):if(_0x3745ca[_0xabc3('0x63')]['message_id']&&_0x3745ca[_0xabc3('0x63')][_0xabc3('0xc6')]){_0x293f5b=_0x3745ca['body']['status_code'];return db[_0xabc3('0xa5')][_0xabc3('0x5a')]({'where':{'messageId':_0x3745ca[_0xabc3('0x63')][_0xabc3('0xc7')]}});}break;case _0xabc3('0x90'):var _0x481366=_0x3745ca[_0xabc3('0x63')][_0xabc3('0x91')][0x0];if(_0x481366[_0xabc3('0x8d')]&&_0x481366['status'][_0xabc3('0xc8')]==='DELIVERED'){_0x293f5b=_0x481366[_0xabc3('0x2c')][_0xabc3('0xc8')];return db['SmsMessage'][_0xabc3('0x5a')]({'where':{'messageId':_0x481366[_0xabc3('0x8d')]}});}break;case'clickatell':if(_0x3745ca[_0xabc3('0x63')][_0xabc3('0x8d')]&&_0x3745ca['body'][_0xabc3('0x2c')]){_0x293f5b=_0x3745ca[_0xabc3('0x63')][_0xabc3('0x2c')];return db[_0xabc3('0xa5')][_0xabc3('0x5a')]({'where':{'messageId':_0x3745ca[_0xabc3('0x63')][_0xabc3('0x8d')]}});}break;case _0xabc3('0x94'):if(_0x3745ca['body'][0x0]['message']['id']){_0x293f5b=_0x3745ca[_0xabc3('0x63')][0x0][_0xabc3('0x40')];return db[_0xabc3('0xa5')][_0xabc3('0x5a')]({'where':{'messageId':_0x3745ca['body'][0x0]['message']['id']}});}break;case'intelepeer':if(_0x3745ca['body'][_0xabc3('0xc9')]&&_0x3745ca['body']['status']){_0x293f5b=_0x3745ca[_0xabc3('0x63')][_0xabc3('0x2c')];return db[_0xabc3('0xa5')][_0xabc3('0x5a')]({'where':{'messageId':_0x3745ca[_0xabc3('0x63')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x13eeaf,null))[_0xabc3('0x22')](function(_0x3072cf){if(_0x3072cf){_0x57f886=_0x3072cf;switch(_0x4b9324[_0xabc3('0x40')]){case _0xabc3('0xc2'):if(_0x293f5b===_0xabc3('0xca')){return _0x57f886['update']({'read':!![]});}else{logger['error'](_0xabc3('0x27'),_0xabc3('0x2c'),'skebby',util[_0xabc3('0xc1')](_0x3745ca[_0xabc3('0x63')],{'showHidden':![],'depth':null}));}break;case _0xabc3('0x8b'):if(_0x293f5b==='1'){return _0x57f886[_0xabc3('0x35')]({'read':!![]});}else{logger['error'](_0xabc3('0x27'),_0xabc3('0x2c'),_0xabc3('0xc2'),util[_0xabc3('0xc1')](_0x3745ca[_0xabc3('0x63')],{'showHidden':![],'depth':null}));}break;case _0xabc3('0x8c'):if(!_0x3745ca[_0xabc3('0x63')][_0xabc3('0xcb')]&&_0x293f5b>=0xc8&&_0x293f5b<=0xce){return _0x57f886[_0xabc3('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','clicksend',util[_0xabc3('0xc1')](_0x3745ca['body'],{'showHidden':![],'depth':null}));}break;case _0xabc3('0x90'):var _0x3fd77c=_0x3745ca['body']['results'][0x0];if(_0x3fd77c[_0xabc3('0x2c')][_0xabc3('0xc8')]===_0xabc3('0xca')){return _0x57f886[_0xabc3('0x35')]({'read':!![]});}else{logger[_0xabc3('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xabc3('0x2c'),_0xabc3('0x90'),util[_0xabc3('0xc1')](_0x3745ca['body'],{'showHidden':![],'depth':null}));}break;case _0xabc3('0xcc'):if(_0x293f5b==_0xabc3('0xcd')||_0x293f5b==_0xabc3('0xce')){return _0x57f886[_0xabc3('0x35')]({'read':!![]});}else{logger['error'](_0xabc3('0x27'),_0xabc3('0x2c'),_0xabc3('0xcc'),util['inspect'](_0x3745ca[_0xabc3('0x63')],{'showHidden':![],'depth':null}));}break;case _0xabc3('0x94'):if(_0x293f5b=='message-delivered'){return _0x57f886[_0xabc3('0x35')]({'read':!![]});}else{logger[_0xabc3('0x28')](_0xabc3('0x27'),'status','bandwidth',util[_0xabc3('0xc1')](_0x3745ca[_0xabc3('0x63')],{'showHidden':![],'depth':null}));}break;case _0xabc3('0x95'):if(_0x293f5b===_0xabc3('0xcf')||_0x293f5b===_0xabc3('0xd0')){return _0x57f886[_0xabc3('0x35')]({'read':!![]});}else{logger[_0xabc3('0x28')](_0xabc3('0x27'),_0xabc3('0x2c'),_0xabc3('0x95'),util[_0xabc3('0xc1')](_0x3745ca[_0xabc3('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x57f886;}})[_0xabc3('0x22')](respondWithResult(_0x13eeaf,null))[_0xabc3('0x2a')](handleError(_0x13eeaf,null));};exports[_0xabc3('0xd1')]=function(_0x114fb7,_0x34aa27,_0x4ea0e8){var _0x10458e,_0x55ebde,_0x2ad6bf;return db[_0xabc3('0x51')]['find']({'where':{'id':_0x114fb7[_0xabc3('0x57')]['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x34aa27,null))['then'](function(_0x546dd3){if(_0x546dd3){_0x2ad6bf=_0x546dd3;logger['debug'](_0xabc3('0x27'),_0xabc3('0x2c'),_0xabc3('0xc0'),_0x546dd3[_0xabc3('0x40')],util[_0xabc3('0xc1')](_0x114fb7[_0xabc3('0x43')],{'showHidden':![],'depth':null}));switch(_0x546dd3[_0xabc3('0x40')]){case _0xabc3('0xd2'):if(_0x114fb7[_0xabc3('0x43')][_0xabc3('0xd3')]&&_0x114fb7['query']['state']){_0x55ebde=_0x114fb7[_0xabc3('0x43')]['state'];return db['SmsMessage'][_0xabc3('0x5a')]({'where':{'messageId':_0x114fb7[_0xabc3('0x43')][_0xabc3('0xd3')]}});}break;}}})[_0xabc3('0x22')](handleEntityNotFound(_0x34aa27,null))[_0xabc3('0x22')](function(_0x2a8c45){if(_0x2a8c45){_0x10458e=_0x2a8c45;switch(_0x2ad6bf[_0xabc3('0x40')]){case _0xabc3('0xd2'):if(_0x55ebde==='2'||_0x55ebde==='6'){return _0x10458e['update']({'read':!![]});}else{logger[_0xabc3('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xabc3('0x2c'),_0xabc3('0xd2'),util[_0xabc3('0xc1')](_0x114fb7[_0xabc3('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x10458e;}})[_0xabc3('0x22')](respondWithResult(_0x34aa27,null))[_0xabc3('0x2a')](handleError(_0x34aa27,null));};exports[_0xabc3('0xd4')]=function(_0x15e5ad,_0x5bec2e,_0xd51d26){return db['SmsAccount'][_0xabc3('0x5a')]({'where':{'id':_0x15e5ad[_0xabc3('0x57')]['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x5bec2e,null))[_0xabc3('0x22')](function(_0x31e659){if(_0x31e659){return _0x31e659['addAgents'](_0x15e5ad[_0xabc3('0x63')]['ids'],_[_0xabc3('0xd5')](_0x15e5ad['body'],[_0xabc3('0x6d'),'id'])||{})[_0xabc3('0xbe')](function(_0x34da3f){for(var _0x1f81f1=0x0;_0x1f81f1<_0x15e5ad[_0xabc3('0x63')][_0xabc3('0x6d')][_0xabc3('0x47')];_0x1f81f1+=0x1){socket[_0xabc3('0xd6')]('userSmsAccount:save',{'UserId':Number(_0x15e5ad['body'][_0xabc3('0x6d')][_0x1f81f1]),'SmsAccountId':Number(_0x15e5ad[_0xabc3('0x57')]['id'])});}return _0x34da3f;});}})[_0xabc3('0x22')](respondWithResult(_0x5bec2e,null))[_0xabc3('0x2a')](handleError(_0x5bec2e,null));};exports[_0xabc3('0xd7')]=function(_0x4c0d85,_0xd5f4d0,_0x5efe99){return db[_0xabc3('0x51')][_0xabc3('0x5a')]({'where':{'id':_0x4c0d85['params']['id']}})['then'](handleEntityNotFound(_0xd5f4d0,null))[_0xabc3('0x22')](function(_0x16d121){if(_0x16d121){return _0x16d121[_0xabc3('0xd7')](_0x4c0d85['query'][_0xabc3('0x6d')])['then'](function(){if(_['isArray'](_0x4c0d85['query'][_0xabc3('0x6d')])){for(var _0x3378a9=0x0;_0x3378a9<_0x4c0d85[_0xabc3('0x43')][_0xabc3('0x6d')]['length'];_0x3378a9+=0x1){socket[_0xabc3('0xd6')](_0xabc3('0xd8'),{'UserId':Number(_0x4c0d85[_0xabc3('0x43')][_0xabc3('0x6d')][_0x3378a9]),'SmsAccountId':Number(_0x4c0d85[_0xabc3('0x57')]['id'])});}}else{socket['emit'](_0xabc3('0xd8'),{'UserId':Number(_0x4c0d85[_0xabc3('0x43')][_0xabc3('0x6d')]),'SmsAccountId':Number(_0x4c0d85[_0xabc3('0x57')]['id'])});}});}})[_0xabc3('0x22')](respondWithStatusCode(_0xd5f4d0,null))['catch'](handleError(_0xd5f4d0,null));};exports['getAgents']=function(_0x560641,_0x3eeb9b,_0x1352bc){var _0x3c43de={};var _0x1fbe77={};var _0x8e465e;var _0x5c3b90;return db[_0xabc3('0x51')][_0xabc3('0x71')]({'where':{'id':_0x560641[_0xabc3('0x57')]['id']}})[_0xabc3('0x22')](handleEntityNotFound(_0x3eeb9b,null))[_0xabc3('0x22')](function(_0x4ff4cb){if(_0x4ff4cb){_0x8e465e=_0x4ff4cb;_0x1fbe77['model']=_[_0xabc3('0x69')](db[_0xabc3('0xa9')][_0xabc3('0x6a')]);_0x1fbe77[_0xabc3('0x43')]=_[_0xabc3('0x69')](_0x560641[_0xabc3('0x43')]);_0x1fbe77[_0xabc3('0x4b')]=_['intersection'](_0x1fbe77[_0xabc3('0x42')],_0x1fbe77[_0xabc3('0x43')]);_0x3c43de[_0xabc3('0x45')]=_[_0xabc3('0x44')](_0x1fbe77['model'],qs[_0xabc3('0x46')](_0x560641[_0xabc3('0x43')]['fields']));_0x3c43de[_0xabc3('0x45')]=_0x3c43de[_0xabc3('0x45')][_0xabc3('0x47')]?_0x3c43de[_0xabc3('0x45')]:_0x1fbe77['model'];_0x3c43de[_0xabc3('0x49')]=qs['sort'](_0x560641[_0xabc3('0x43')][_0xabc3('0x4a')]);_0x3c43de['where']=qs['filters'](_['pick'](_0x560641[_0xabc3('0x43')],_0x1fbe77[_0xabc3('0x4b')]));if(_0x560641[_0xabc3('0x43')][_0xabc3('0x4d')]){_0x3c43de['where']=_[_0xabc3('0x50')](_0x3c43de[_0xabc3('0x4e')],{'$or':_[_0xabc3('0x3e')](_0x3c43de[_0xabc3('0x45')],function(_0x53854f){var _0x813882={};_0x813882[_0x53854f]={'$like':'%'+_0x560641[_0xabc3('0x43')]['filter']+'%'};return _0x813882;})});}_0x3c43de=_[_0xabc3('0x50')]({},_0x3c43de,_0x560641[_0xabc3('0x59')]);return _0x8e465e[_0xabc3('0xd9')](_0x3c43de);}})[_0xabc3('0x22')](function(_0x451698){if(_0x451698){_0x5c3b90=_0x451698['length'];if(!_0x560641['query'][_0xabc3('0x48')](_0xabc3('0x6b'))){_0x3c43de[_0xabc3('0x31')]=qs[_0xabc3('0x31')](_0x560641[_0xabc3('0x43')]['limit']);_0x3c43de[_0xabc3('0x2f')]=qs[_0xabc3('0x2f')](_0x560641[_0xabc3('0x43')][_0xabc3('0x2f')]);}return _0x8e465e[_0xabc3('0xd9')](_0x3c43de);}})[_0xabc3('0x22')](function(_0x1b1caa){if(_0x1b1caa){return _0x1b1caa?{'count':_0x5c3b90,'rows':_0x1b1caa}:null;}})[_0xabc3('0x22')](respondWithResult(_0x3eeb9b,null))['catch'](handleError(_0x3eeb9b,null));};
\ No newline at end of file
index 895d262..3fd9102 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21d8=['setMaxListeners','save','emit','hasOwnProperty','exports','../../mysqldb','SmsAccount'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x21d8,0xf3));var _0x821d=function(_0x26c2cf,_0x197565){_0x26c2cf=_0x26c2cf-0x0;var _0x2644be=_0x21d8[_0x26c2cf];return _0x2644be;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x821d('0x0'))['db'][_0x821d('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x821d('0x2')](0x0);var events={'afterCreate':_0x821d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x15a7a8){return function(_0xd327c0,_0x39330e,_0x2a92ee){SmsAccountEvents[_0x821d('0x4')](_0x15a7a8+':'+_0xd327c0['id'],_0xd327c0);SmsAccountEvents['emit'](_0x15a7a8,_0xd327c0);_0x2a92ee(null);};}for(var e in events){if(events[_0x821d('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x821d('0x6')]=SmsAccountEvents;
\ No newline at end of file
+var _0x93cf=['SmsAccount','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x36e360,_0xf8d352){var _0x1b2bc6=function(_0x3dd367){while(--_0x3dd367){_0x36e360['push'](_0x36e360['shift']());}};_0x1b2bc6(++_0xf8d352);}(_0x93cf,0xd7));var _0xf93c=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x93cf[_0x23e7c1];return _0x1add43;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xf93c('0x0'))['db'][_0xf93c('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf93c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf93c('0x3')};function emitEvent(_0x18677b){return function(_0x2d3e65,_0x4c980b,_0x3e83c1){SmsAccountEvents['emit'](_0x18677b+':'+_0x2d3e65['id'],_0x2d3e65);SmsAccountEvents[_0xf93c('0x4')](_0x18677b,_0x2d3e65);_0x3e83c1(null);};}for(var e in events){if(events[_0xf93c('0x5')](e)){var event=events[e];SmsAccount[_0xf93c('0x6')](e,emitEvent(event));}}module[_0xf93c('0x7')]=SmsAccountEvents;
\ No newline at end of file
index 3e12871..df58803 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabf9=['../../config/environment','./smsAccount.attributes','exports','define','sms_accounts','util','../../config/logger','api','moment','path','rimraf'];(function(_0x1462c2,_0x12a9da){var _0x143e0a=function(_0x3289e5){while(--_0x3289e5){_0x1462c2['push'](_0x1462c2['shift']());}};_0x143e0a(++_0x12a9da);}(_0xabf9,0x94));var _0x9abf=function(_0x15a912,_0x32bd2b){_0x15a912=_0x15a912-0x0;var _0x992620=_0xabf9[_0x15a912];return _0x992620;};'use strict';var _=require('lodash');var util=require(_0x9abf('0x0'));var logger=require(_0x9abf('0x1'))(_0x9abf('0x2'));var moment=require(_0x9abf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9abf('0x4'));var rimraf=require(_0x9abf('0x5'));var config=require(_0x9abf('0x6'));var attributes=require(_0x9abf('0x7'));module[_0x9abf('0x8')]=function(_0x27cf11,_0x4a3162){return _0x27cf11[_0x9abf('0x9')]('SmsAccount',attributes,{'tableName':_0x9abf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0772=['bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x355ee5,_0x116dec){var _0x2818c8=function(_0x59a27e){while(--_0x59a27e){_0x355ee5['push'](_0x355ee5['shift']());}};_0x2818c8(++_0x116dec);}(_0x0772,0x1c9));var _0x2077=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0772[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x2077('0x0'));var util=require(_0x2077('0x1'));var logger=require(_0x2077('0x2'))(_0x2077('0x3'));var moment=require(_0x2077('0x4'));var BPromise=require(_0x2077('0x5'));var rp=require(_0x2077('0x6'));var fs=require('fs');var path=require(_0x2077('0x7'));var rimraf=require(_0x2077('0x8'));var config=require('../../config/environment');var attributes=require(_0x2077('0x9'));module[_0x2077('0xa')]=function(_0x28b8f8,_0x3711b9){return _0x28b8f8[_0x2077('0xb')](_0x2077('0xc'),attributes,{'tableName':_0x2077('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 46006fa..d6c0114 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd445=['include','model','attributes','map','stringify','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ShowSmsAccount','SmsAccount','options'];(function(_0x359d98,_0xfee863){var _0x1d6f7b=function(_0x1fc982){while(--_0x1fc982){_0x359d98['push'](_0x359d98['shift']());}};_0x1d6f7b(++_0xfee863);}(_0xd445,0xa6));var _0x5d44=function(_0x3f3341,_0x1d4f74){_0x3f3341=_0x3f3341-0x0;var _0x3bdfef=_0xd445[_0x3f3341];return _0x3bdfef;};'use strict';var _=require(_0x5d44('0x0'));var util=require(_0x5d44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5d44('0x2'));var fs=require('fs');var Redis=require(_0x5d44('0x3'));var db=require(_0x5d44('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d44('0x5'))(_0x5d44('0x6'));var config=require('../../config/environment');var jayson=require(_0x5d44('0x7'));var client=jayson[_0x5d44('0x8')][_0x5d44('0x9')]({'port':0x232a});config[_0x5d44('0xa')]=_['defaults'](config[_0x5d44('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d44('0xa')]));require(_0x5d44('0xb'))[_0x5d44('0xc')](socket);function respondWithRpcPromise(_0x3a6002,_0x40e53c,_0x48cb3e){return new BPromise(function(_0x20e110,_0x4d40cf){return client[_0x5d44('0xd')](_0x3a6002,_0x48cb3e)[_0x5d44('0xe')](function(_0x2337a5){logger[_0x5d44('0xf')](_0x5d44('0x10'),_0x40e53c,'request\x20sent');logger[_0x5d44('0x11')](_0x5d44('0x12'),_0x40e53c,_0x5d44('0x13'),JSON['stringify'](_0x2337a5));if(_0x2337a5[_0x5d44('0x14')]){if(_0x2337a5['error'][_0x5d44('0x15')]===0x1f4){logger[_0x5d44('0x14')]('SmsAccount,\x20%s,\x20%s',_0x40e53c,_0x2337a5[_0x5d44('0x14')]['message']);return _0x4d40cf(_0x2337a5[_0x5d44('0x14')][_0x5d44('0x16')]);}logger[_0x5d44('0x14')](_0x5d44('0x10'),_0x40e53c,_0x2337a5[_0x5d44('0x14')][_0x5d44('0x16')]);return _0x20e110(_0x2337a5['error']['message']);}else{logger[_0x5d44('0xf')](_0x5d44('0x10'),_0x40e53c,_0x5d44('0x13'));_0x20e110(_0x2337a5['result'][_0x5d44('0x16')]);}})['catch'](function(_0x47acdc){logger[_0x5d44('0x14')](_0x5d44('0x10'),_0x40e53c,_0x47acdc);_0x4d40cf(_0x47acdc);});});}exports[_0x5d44('0x17')]=function(_0x4f2d92){var _0x23f02f=this;return new Promise(function(_0xbf1902,_0x23f2de){return db[_0x5d44('0x18')]['find']({'raw':_0x4f2d92[_0x5d44('0x19')]?_0x4f2d92[_0x5d44('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f2d92['options']?_0x4f2d92[_0x5d44('0x19')]['where']||null:null,'attributes':_0x4f2d92['options']?_0x4f2d92['options']['attributes']||null:null,'include':_0x4f2d92[_0x5d44('0x19')]?_0x4f2d92[_0x5d44('0x19')][_0x5d44('0x1a')]?_['map'](_0x4f2d92[_0x5d44('0x19')][_0x5d44('0x1a')],function(_0x252647){return{'model':db[_0x252647[_0x5d44('0x1b')]],'as':_0x252647['as'],'attributes':_0x252647[_0x5d44('0x1c')],'include':_0x252647['include']?_[_0x5d44('0x1d')](_0x252647[_0x5d44('0x1a')],function(_0x404387){return{'model':db[_0x404387['model']],'as':_0x404387['as'],'attributes':_0x404387['attributes'],'include':_0x404387[_0x5d44('0x1a')]?_[_0x5d44('0x1d')](_0x404387['include'],function(_0x24884c){return{'model':db[_0x24884c[_0x5d44('0x1b')]],'as':_0x24884c['as'],'attributes':_0x24884c[_0x5d44('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5d44('0xe')](function(_0x5edca0){logger[_0x5d44('0xf')](_0x5d44('0x17'),_0x4f2d92);logger['debug']('ShowSmsAccount',_0x4f2d92,JSON[_0x5d44('0x1e')](_0x5edca0));_0xbf1902(_0x5edca0);})[_0x5d44('0x1f')](function(_0x5d50f0){logger[_0x5d44('0x14')](_0x5d44('0x17'),_0x5d50f0['message'],_0x4f2d92);_0x23f2de(_0x23f02f[_0x5d44('0x14')](0x1f4,_0x5d50f0[_0x5d44('0x16')]));});});};
\ No newline at end of file
+var _0x23a3=['defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SmsAccount','options','raw','where','attributes','include','map','model','ShowSmsAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis'];(function(_0x112439,_0x24199a){var _0x1ff74b=function(_0x57a538){while(--_0x57a538){_0x112439['push'](_0x112439['shift']());}};_0x1ff74b(++_0x24199a);}(_0x23a3,0x182));var _0x323a=function(_0x2d586a,_0x594a56){_0x2d586a=_0x2d586a-0x0;var _0x8daaa9=_0x23a3[_0x2d586a];return _0x8daaa9;};'use strict';var _=require('lodash');var util=require(_0x323a('0x0'));var moment=require(_0x323a('0x1'));var BPromise=require(_0x323a('0x2'));var rs=require(_0x323a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x323a('0x4'))['db'];var utils=require(_0x323a('0x5'));var logger=require(_0x323a('0x6'))(_0x323a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x323a('0x8')]['http']({'port':0x232a});config[_0x323a('0x9')]=_[_0x323a('0xa')](config[_0x323a('0x9')],{'host':_0x323a('0xb'),'port':0x18eb});var socket=require(_0x323a('0xc'))(new Redis(config[_0x323a('0x9')]));require(_0x323a('0xd'))[_0x323a('0xe')](socket);function respondWithRpcPromise(_0x6e2bad,_0x1dd9ee,_0x528260){return new BPromise(function(_0x531c51,_0x64e40f){return client[_0x323a('0xf')](_0x6e2bad,_0x528260)[_0x323a('0x10')](function(_0x33ef7d){logger[_0x323a('0x11')](_0x323a('0x12'),_0x1dd9ee,_0x323a('0x13'));logger[_0x323a('0x14')](_0x323a('0x15'),_0x1dd9ee,'request\x20sent',JSON[_0x323a('0x16')](_0x33ef7d));if(_0x33ef7d[_0x323a('0x17')]){if(_0x33ef7d[_0x323a('0x17')][_0x323a('0x18')]===0x1f4){logger[_0x323a('0x17')](_0x323a('0x12'),_0x1dd9ee,_0x33ef7d[_0x323a('0x17')][_0x323a('0x19')]);return _0x64e40f(_0x33ef7d[_0x323a('0x17')][_0x323a('0x19')]);}logger[_0x323a('0x17')]('SmsAccount,\x20%s,\x20%s',_0x1dd9ee,_0x33ef7d[_0x323a('0x17')]['message']);return _0x531c51(_0x33ef7d['error'][_0x323a('0x19')]);}else{logger[_0x323a('0x11')](_0x323a('0x12'),_0x1dd9ee,_0x323a('0x13'));_0x531c51(_0x33ef7d[_0x323a('0x1a')][_0x323a('0x19')]);}})['catch'](function(_0x27817f){logger['error'](_0x323a('0x12'),_0x1dd9ee,_0x27817f);_0x64e40f(_0x27817f);});});}exports['ShowSmsAccount']=function(_0x4e4b61){var _0x4931dd=this;return new Promise(function(_0x50d14c,_0x4eefe6){return db[_0x323a('0x1b')]['find']({'raw':_0x4e4b61[_0x323a('0x1c')]?_0x4e4b61[_0x323a('0x1c')][_0x323a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4e4b61[_0x323a('0x1c')]?_0x4e4b61[_0x323a('0x1c')][_0x323a('0x1e')]||null:null,'attributes':_0x4e4b61[_0x323a('0x1c')]?_0x4e4b61[_0x323a('0x1c')][_0x323a('0x1f')]||null:null,'include':_0x4e4b61[_0x323a('0x1c')]?_0x4e4b61[_0x323a('0x1c')][_0x323a('0x20')]?_[_0x323a('0x21')](_0x4e4b61['options'][_0x323a('0x20')],function(_0x2eecde){return{'model':db[_0x2eecde[_0x323a('0x22')]],'as':_0x2eecde['as'],'attributes':_0x2eecde[_0x323a('0x1f')],'include':_0x2eecde[_0x323a('0x20')]?_[_0x323a('0x21')](_0x2eecde[_0x323a('0x20')],function(_0x18fab5){return{'model':db[_0x18fab5[_0x323a('0x22')]],'as':_0x18fab5['as'],'attributes':_0x18fab5[_0x323a('0x1f')],'include':_0x18fab5[_0x323a('0x20')]?_[_0x323a('0x21')](_0x18fab5[_0x323a('0x20')],function(_0x1f7fc1){return{'model':db[_0x1f7fc1['model']],'as':_0x1f7fc1['as'],'attributes':_0x1f7fc1[_0x323a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x323a('0x10')](function(_0x27cead){logger[_0x323a('0x11')](_0x323a('0x23'),_0x4e4b61);logger['debug']('ShowSmsAccount',_0x4e4b61,JSON[_0x323a('0x16')](_0x27cead));_0x50d14c(_0x27cead);})['catch'](function(_0x5cea3d){logger[_0x323a('0x17')](_0x323a('0x23'),_0x5cea3d['message'],_0x4e4b61);_0x4eefe6(_0x4931dd[_0x323a('0x17')](0x1f4,_0x5cea3d[_0x323a('0x19')]));});});};
\ No newline at end of file
index db7b79a..7548ff3 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 56f8f75..2cba2d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x5ee0f4,_0x52f575){var _0xa28e0d=function(_0x5d3dfc){while(--_0x5d3dfc){_0x5ee0f4['push'](_0x5ee0f4['shift']());}};_0xa28e0d(++_0x52f575);}(_0xe14b,0x93));var _0xbe14=function(_0x2bca61,_0x3e4fdd){_0x2bca61=_0x2bca61-0x0;var _0x5a089a=_0xe14b[_0x2bca61];return _0x5a089a;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router;
\ No newline at end of file
+var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0xb9c03c,_0x204bfe){var _0x30228c=function(_0x1b2606){while(--_0x1b2606){_0xb9c03c['push'](_0xb9c03c['shift']());}};_0x30228c(++_0x204bfe);}(_0x55ca,0x126));var _0xa55c=function(_0x44334a,_0x181bce){_0x44334a=_0x44334a-0x0;var _0x20a140=_0x55ca[_0x44334a];return _0x20a140;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router;
\ No newline at end of file
index 8a68a40..7529ced 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ef=['INTEGER','STRING','noop','TEXT','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x57ef,0xdb));var _0xf57e=function(_0x41a096,_0x68fa17){_0x41a096=_0x41a096-0x0;var _0x42ad38=_0x57ef[_0x41a096];return _0x42ad38;};'use strict';var Sequelize=require('sequelize');module[_0xf57e('0x0')]={'priority':{'type':Sequelize[_0xf57e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf57e('0x2')],'allowNull':![],'defaultValue':_0xf57e('0x3')},'appdata':{'type':Sequelize[_0xf57e('0x4')]()},'description':{'type':Sequelize[_0xf57e('0x2')]},'interval':{'type':Sequelize[_0xf57e('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xba2d=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x1e1314,_0x16d3e5){var _0x4e3ded=function(_0x16bfd4){while(--_0x16bfd4){_0x1e1314['push'](_0x1e1314['shift']());}};_0x4e3ded(++_0x16d3e5);}(_0xba2d,0x1de));var _0xdba2=function(_0x16a1b,_0x10a68c){_0x16a1b=_0x16a1b-0x0;var _0x60b9b0=_0xba2d[_0x16a1b];return _0x60b9b0;};'use strict';var Sequelize=require(_0xdba2('0x0'));module[_0xdba2('0x1')]={'priority':{'type':Sequelize[_0xdba2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdba2('0x3')],'allowNull':![],'defaultValue':_0xdba2('0x4')},'appdata':{'type':Sequelize[_0xdba2('0x5')]()},'description':{'type':Sequelize[_0xdba2('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 1a89314..e21f093 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5d2=['nolimit','order','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsApplication','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x1a863b,_0x23d1fe){var _0x2e9b64=function(_0x54a285){while(--_0x54a285){_0x1a863b['push'](_0x1a863b['shift']());}};_0x2e9b64(++_0x23d1fe);}(_0xd5d2,0x137));var _0x2d5d=function(_0x4af2c3,_0xf4d1f4){_0x4af2c3=_0x4af2c3-0x0;var _0x74088=_0xd5d2[_0x4af2c3];return _0x74088;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d5d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d5d('0x1'));var rp=require(_0x2d5d('0x2'));var moment=require(_0x2d5d('0x3'));var BPromise=require(_0x2d5d('0x4'));var Mustache=require(_0x2d5d('0x5'));var util=require(_0x2d5d('0x6'));var path=require(_0x2d5d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d5d('0x8'));var fs=require('fs');var fs_extra=require(_0x2d5d('0x9'));var _=require(_0x2d5d('0xa'));var squel=require(_0x2d5d('0xb'));var crypto=require(_0x2d5d('0xc'));var jsforce=require(_0x2d5d('0xd'));var deskjs=require(_0x2d5d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d5d('0xf'));var Redis=require(_0x2d5d('0x10'));var authService=require(_0x2d5d('0x11'));var qs=require(_0x2d5d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d5d('0x13'));var logger=require('../../config/logger')(_0x2d5d('0x14'));var utils=require('../../config/utils');var config=require(_0x2d5d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xeb2886,_0x3c4f4c){_0x3c4f4c=_0x3c4f4c||0xcc;return function(_0x407f61){if(_0x407f61){return _0xeb2886[_0x2d5d('0x16')](_0x3c4f4c);}return _0xeb2886['status'](_0x3c4f4c)[_0x2d5d('0x17')]();};}function respondWithResult(_0x5028ce,_0x112869){_0x112869=_0x112869||0xc8;return function(_0x1090fb){if(_0x1090fb){return _0x5028ce[_0x2d5d('0x18')](_0x112869)['json'](_0x1090fb);}};}function respondWithFilteredResult(_0x22675b,_0x38c5a2){return function(_0x3c84fb){if(_0x3c84fb){var _0x46ef9b=typeof _0x38c5a2[_0x2d5d('0x19')]===_0x2d5d('0x1a')&&typeof _0x38c5a2[_0x2d5d('0x1b')]===_0x2d5d('0x1a');var _0x2c2f80=_0x3c84fb['count'];var _0x150411=_0x46ef9b?0x0:_0x38c5a2[_0x2d5d('0x19')];var _0x224f1c=_0x46ef9b?_0x3c84fb[_0x2d5d('0x1c')]:_0x38c5a2[_0x2d5d('0x19')]+_0x38c5a2['limit'];var _0x2a0bc7;if(_0x224f1c>=_0x2c2f80){_0x224f1c=_0x2c2f80;_0x2a0bc7=0xc8;}else{_0x2a0bc7=0xce;}_0x22675b[_0x2d5d('0x18')](_0x2a0bc7);return _0x22675b[_0x2d5d('0x1d')](_0x2d5d('0x1e'),_0x150411+'-'+_0x224f1c+'/'+_0x2c2f80)[_0x2d5d('0x1f')](_0x3c84fb);}return null;};}function patchUpdates(_0x38ecce){return function(_0x3025be){try{jsonpatch['apply'](_0x3025be,_0x38ecce,!![]);}catch(_0x1f02b2){return BPromise[_0x2d5d('0x20')](_0x1f02b2);}return _0x3025be[_0x2d5d('0x21')]();};}function saveUpdates(_0x28238d,_0x3ecda6){return function(_0x1ab716){if(_0x1ab716){return _0x1ab716[_0x2d5d('0x22')](_0x28238d)[_0x2d5d('0x23')](function(_0x51b670){return _0x51b670;});}return null;};}function removeEntity(_0x226225,_0x1d2f0f){return function(_0x186769){if(_0x186769){return _0x186769[_0x2d5d('0x24')]()[_0x2d5d('0x23')](function(){_0x226225[_0x2d5d('0x18')](0xcc)[_0x2d5d('0x17')]();});}};}function handleEntityNotFound(_0x4cbb7b,_0x15c447){return function(_0x49181f){if(!_0x49181f){_0x4cbb7b[_0x2d5d('0x16')](0x194);}return _0x49181f;};}function handleError(_0x3d6d3d,_0x1f3969){_0x1f3969=_0x1f3969||0x1f4;return function(_0x62c038){logger[_0x2d5d('0x25')](_0x62c038[_0x2d5d('0x26')]);if(_0x62c038['name']){delete _0x62c038[_0x2d5d('0x27')];}_0x3d6d3d[_0x2d5d('0x18')](_0x1f3969)[_0x2d5d('0x28')](_0x62c038);};}exports[_0x2d5d('0x29')]=function(_0x351237,_0x5f4c42){var _0x21bb5b={},_0x50ce3b={},_0x30c949={'count':0x0,'rows':[]};var _0x3543f9=_[_0x2d5d('0x2a')](db[_0x2d5d('0x2b')]['rawAttributes'],function(_0x482862){return{'name':_0x482862['fieldName'],'type':_0x482862[_0x2d5d('0x2c')][_0x2d5d('0x2d')]};});_0x50ce3b[_0x2d5d('0x2e')]=_['map'](_0x3543f9,'name');_0x50ce3b[_0x2d5d('0x2f')]=_[_0x2d5d('0x30')](_0x351237[_0x2d5d('0x2f')]);_0x50ce3b[_0x2d5d('0x31')]=_[_0x2d5d('0x32')](_0x50ce3b[_0x2d5d('0x2e')],_0x50ce3b['query']);_0x21bb5b[_0x2d5d('0x33')]=_['intersection'](_0x50ce3b['model'],qs[_0x2d5d('0x34')](_0x351237[_0x2d5d('0x2f')][_0x2d5d('0x34')]));_0x21bb5b[_0x2d5d('0x33')]=_0x21bb5b[_0x2d5d('0x33')]['length']?_0x21bb5b[_0x2d5d('0x33')]:_0x50ce3b[_0x2d5d('0x2e')];if(!_0x351237[_0x2d5d('0x2f')][_0x2d5d('0x35')](_0x2d5d('0x36'))){_0x21bb5b[_0x2d5d('0x1b')]=qs[_0x2d5d('0x1b')](_0x351237[_0x2d5d('0x2f')][_0x2d5d('0x1b')]);_0x21bb5b[_0x2d5d('0x19')]=qs[_0x2d5d('0x19')](_0x351237[_0x2d5d('0x2f')]['offset']);}_0x21bb5b[_0x2d5d('0x37')]=qs['sort'](_0x351237[_0x2d5d('0x2f')]['sort']);_0x21bb5b['where']=qs['filters'](_['pick'](_0x351237[_0x2d5d('0x2f')],_0x50ce3b['filters']),_0x3543f9);if(_0x351237[_0x2d5d('0x2f')][_0x2d5d('0x38')]){_0x21bb5b[_0x2d5d('0x39')]=_[_0x2d5d('0x3a')](_0x21bb5b[_0x2d5d('0x39')],{'$or':_[_0x2d5d('0x2a')](_0x3543f9,function(_0x421f19){if(_0x421f19[_0x2d5d('0x2c')]!==_0x2d5d('0x3b')){var _0x280bce={};_0x280bce[_0x421f19['name']]={'$like':'%'+_0x351237[_0x2d5d('0x2f')][_0x2d5d('0x38')]+'%'};return _0x280bce;}})});}_0x21bb5b=_['merge']({},_0x21bb5b,_0x351237['options']);var _0x54d9b0={'where':_0x21bb5b['where']};return db['SmsApplication'][_0x2d5d('0x1c')](_0x54d9b0)[_0x2d5d('0x23')](function(_0x10d02b){_0x30c949[_0x2d5d('0x1c')]=_0x10d02b;if(_0x351237[_0x2d5d('0x2f')][_0x2d5d('0x3c')]){_0x21bb5b[_0x2d5d('0x3d')]=[{'all':!![]}];}return db[_0x2d5d('0x2b')][_0x2d5d('0x3e')](_0x21bb5b);})['then'](function(_0x311da5){_0x30c949[_0x2d5d('0x3f')]=_0x311da5;return _0x30c949;})[_0x2d5d('0x23')](respondWithFilteredResult(_0x5f4c42,_0x21bb5b))[_0x2d5d('0x40')](handleError(_0x5f4c42,null));};exports[_0x2d5d('0x41')]=function(_0x1fbc3c,_0x2e917e){var _0x2f63aa={'raw':!![],'where':{'id':_0x1fbc3c[_0x2d5d('0x42')]['id']}},_0x197bdc={};_0x197bdc['model']=_[_0x2d5d('0x30')](db[_0x2d5d('0x2b')][_0x2d5d('0x43')]);_0x197bdc[_0x2d5d('0x2f')]=_[_0x2d5d('0x30')](_0x1fbc3c[_0x2d5d('0x2f')]);_0x197bdc['filters']=_[_0x2d5d('0x32')](_0x197bdc[_0x2d5d('0x2e')],_0x197bdc[_0x2d5d('0x2f')]);_0x2f63aa[_0x2d5d('0x33')]=_[_0x2d5d('0x32')](_0x197bdc[_0x2d5d('0x2e')],qs[_0x2d5d('0x34')](_0x1fbc3c[_0x2d5d('0x2f')][_0x2d5d('0x34')]));_0x2f63aa[_0x2d5d('0x33')]=_0x2f63aa['attributes'][_0x2d5d('0x44')]?_0x2f63aa['attributes']:_0x197bdc[_0x2d5d('0x2e')];if(_0x1fbc3c['query'][_0x2d5d('0x3c')]){_0x2f63aa[_0x2d5d('0x3d')]=[{'all':!![]}];}_0x2f63aa=_['merge']({},_0x2f63aa,_0x1fbc3c[_0x2d5d('0x45')]);return db[_0x2d5d('0x2b')][_0x2d5d('0x46')](_0x2f63aa)[_0x2d5d('0x23')](handleEntityNotFound(_0x2e917e,null))[_0x2d5d('0x23')](respondWithResult(_0x2e917e,null))[_0x2d5d('0x40')](handleError(_0x2e917e,null));};exports[_0x2d5d('0x47')]=function(_0x4d316f,_0xc7b91e){return db[_0x2d5d('0x2b')][_0x2d5d('0x47')](_0x4d316f[_0x2d5d('0x48')],{})[_0x2d5d('0x23')](respondWithResult(_0xc7b91e,0xc9))[_0x2d5d('0x40')](handleError(_0xc7b91e,null));};exports[_0x2d5d('0x22')]=function(_0x582051,_0x4d0c87){if(_0x582051[_0x2d5d('0x48')]['id']){delete _0x582051['body']['id'];}return db[_0x2d5d('0x2b')][_0x2d5d('0x46')]({'where':{'id':_0x582051[_0x2d5d('0x42')]['id']}})[_0x2d5d('0x23')](handleEntityNotFound(_0x4d0c87,null))[_0x2d5d('0x23')](saveUpdates(_0x582051[_0x2d5d('0x48')],null))[_0x2d5d('0x23')](respondWithResult(_0x4d0c87,null))[_0x2d5d('0x40')](handleError(_0x4d0c87,null));};exports[_0x2d5d('0x24')]=function(_0x27945a,_0x38db72){return db['SmsApplication'][_0x2d5d('0x46')]({'where':{'id':_0x27945a['params']['id']}})['then'](handleEntityNotFound(_0x38db72,null))['then'](removeEntity(_0x38db72,null))[_0x2d5d('0x40')](handleError(_0x38db72,null));};
\ No newline at end of file
+var _0xe85e=['limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','SmsApplication','rows','show','params','length','include','find','catch','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x5b574b,_0x4ff1fa){var _0xb1c9d4=function(_0x1f3a77){while(--_0x1f3a77){_0x5b574b['push'](_0x5b574b['shift']());}};_0xb1c9d4(++_0x4ff1fa);}(_0xe85e,0x149));var _0xee85=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe85e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee85('0x0'));var rimraf=require(_0xee85('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee85('0x2'));var rp=require(_0xee85('0x3'));var moment=require(_0xee85('0x4'));var BPromise=require(_0xee85('0x5'));var Mustache=require(_0xee85('0x6'));var util=require(_0xee85('0x7'));var path=require('path');var sox=require(_0xee85('0x8'));var csv=require(_0xee85('0x9'));var ejs=require(_0xee85('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee85('0xb'));var squel=require('squel');var crypto=require(_0xee85('0xc'));var jsforce=require(_0xee85('0xd'));var deskjs=require(_0xee85('0xe'));var toCsv=require(_0xee85('0x9'));var querystring=require(_0xee85('0xf'));var Papa=require(_0xee85('0x10'));var Redis=require(_0xee85('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xee85('0x12'));var hardwareService=require(_0xee85('0x13'));var logger=require(_0xee85('0x14'))(_0xee85('0x15'));var utils=require(_0xee85('0x16'));var config=require(_0xee85('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xee85('0x18'))['db'];function respondWithStatusCode(_0x1ef8dc,_0x50ffea){_0x50ffea=_0x50ffea||0xcc;return function(_0x259e81){if(_0x259e81){return _0x1ef8dc[_0xee85('0x19')](_0x50ffea);}return _0x1ef8dc[_0xee85('0x1a')](_0x50ffea)[_0xee85('0x1b')]();};}function respondWithResult(_0x1e79a7,_0x7fc39c){_0x7fc39c=_0x7fc39c||0xc8;return function(_0x55cf33){if(_0x55cf33){return _0x1e79a7[_0xee85('0x1a')](_0x7fc39c)[_0xee85('0x1c')](_0x55cf33);}};}function respondWithFilteredResult(_0x27015d,_0x51eb5b){return function(_0x227171){if(_0x227171){var _0x1c4b35=typeof _0x51eb5b[_0xee85('0x1d')]===_0xee85('0x1e')&&typeof _0x51eb5b['limit']===_0xee85('0x1e');var _0x4843e9=_0x227171['count'];var _0x46c4c6=_0x1c4b35?0x0:_0x51eb5b['offset'];var _0x2ba9ca=_0x1c4b35?_0x227171[_0xee85('0x1f')]:_0x51eb5b[_0xee85('0x1d')]+_0x51eb5b['limit'];var _0x401e54;if(_0x2ba9ca>=_0x4843e9){_0x2ba9ca=_0x4843e9;_0x401e54=0xc8;}else{_0x401e54=0xce;}_0x27015d[_0xee85('0x1a')](_0x401e54);return _0x27015d[_0xee85('0x20')](_0xee85('0x21'),_0x46c4c6+'-'+_0x2ba9ca+'/'+_0x4843e9)[_0xee85('0x1c')](_0x227171);}return null;};}function patchUpdates(_0x4393fc){return function(_0x37c3cf){try{jsonpatch[_0xee85('0x22')](_0x37c3cf,_0x4393fc,!![]);}catch(_0xff61bb){return BPromise[_0xee85('0x23')](_0xff61bb);}return _0x37c3cf[_0xee85('0x24')]();};}function saveUpdates(_0x9c293a,_0x3e1fe6){return function(_0x15c9ec){if(_0x15c9ec){return _0x15c9ec['update'](_0x9c293a)[_0xee85('0x25')](function(_0x59b305){return _0x59b305;});}return null;};}function removeEntity(_0xfe24de,_0x4b97bd){return function(_0x16c009){if(_0x16c009){return _0x16c009[_0xee85('0x26')]()[_0xee85('0x25')](function(){_0xfe24de[_0xee85('0x1a')](0xcc)[_0xee85('0x1b')]();});}};}function handleEntityNotFound(_0x534f43,_0x443b54){return function(_0x5292b0){if(!_0x5292b0){_0x534f43[_0xee85('0x19')](0x194);}return _0x5292b0;};}function handleError(_0x14fc25,_0x3d4808){_0x3d4808=_0x3d4808||0x1f4;return function(_0x1eba4f){logger[_0xee85('0x27')](_0x1eba4f['stack']);if(_0x1eba4f[_0xee85('0x28')]){delete _0x1eba4f[_0xee85('0x28')];}_0x14fc25['status'](_0x3d4808)[_0xee85('0x29')](_0x1eba4f);};}exports[_0xee85('0x2a')]=function(_0x14b3ca,_0x59a897){var _0x277dd1={},_0x30c4cd={},_0x41b24e={'count':0x0,'rows':[]};var _0x4170c5=_[_0xee85('0x2b')](db['SmsApplication'][_0xee85('0x2c')],function(_0x1c7ee6){return{'name':_0x1c7ee6[_0xee85('0x2d')],'type':_0x1c7ee6['type'][_0xee85('0x2e')]};});_0x30c4cd[_0xee85('0x2f')]=_[_0xee85('0x2b')](_0x4170c5,_0xee85('0x28'));_0x30c4cd[_0xee85('0x30')]=_[_0xee85('0x31')](_0x14b3ca[_0xee85('0x30')]);_0x30c4cd[_0xee85('0x32')]=_[_0xee85('0x33')](_0x30c4cd[_0xee85('0x2f')],_0x30c4cd[_0xee85('0x30')]);_0x277dd1[_0xee85('0x34')]=_[_0xee85('0x33')](_0x30c4cd[_0xee85('0x2f')],qs[_0xee85('0x35')](_0x14b3ca[_0xee85('0x30')][_0xee85('0x35')]));_0x277dd1[_0xee85('0x34')]=_0x277dd1[_0xee85('0x34')]['length']?_0x277dd1[_0xee85('0x34')]:_0x30c4cd[_0xee85('0x2f')];if(!_0x14b3ca['query'][_0xee85('0x36')](_0xee85('0x37'))){_0x277dd1['limit']=qs[_0xee85('0x38')](_0x14b3ca[_0xee85('0x30')][_0xee85('0x38')]);_0x277dd1[_0xee85('0x1d')]=qs[_0xee85('0x1d')](_0x14b3ca[_0xee85('0x30')][_0xee85('0x1d')]);}_0x277dd1[_0xee85('0x39')]=qs['sort'](_0x14b3ca[_0xee85('0x30')][_0xee85('0x3a')]);_0x277dd1[_0xee85('0x3b')]=qs[_0xee85('0x32')](_[_0xee85('0x3c')](_0x14b3ca[_0xee85('0x30')],_0x30c4cd[_0xee85('0x32')]),_0x4170c5);if(_0x14b3ca[_0xee85('0x30')][_0xee85('0x3d')]){_0x277dd1['where']=_['merge'](_0x277dd1[_0xee85('0x3b')],{'$or':_[_0xee85('0x2b')](_0x4170c5,function(_0x113788){if(_0x113788[_0xee85('0x3e')]!==_0xee85('0x3f')){var _0x1bde2f={};_0x1bde2f[_0x113788[_0xee85('0x28')]]={'$like':'%'+_0x14b3ca[_0xee85('0x30')][_0xee85('0x3d')]+'%'};return _0x1bde2f;}})});}_0x277dd1=_[_0xee85('0x40')]({},_0x277dd1,_0x14b3ca[_0xee85('0x41')]);var _0x40a0cf={'where':_0x277dd1[_0xee85('0x3b')]};return db[_0xee85('0x42')][_0xee85('0x1f')](_0x40a0cf)[_0xee85('0x25')](function(_0x360353){_0x41b24e['count']=_0x360353;if(_0x14b3ca[_0xee85('0x30')]['includeAll']){_0x277dd1['include']=[{'all':!![]}];}return db[_0xee85('0x42')]['findAll'](_0x277dd1);})[_0xee85('0x25')](function(_0x5d9b49){_0x41b24e[_0xee85('0x43')]=_0x5d9b49;return _0x41b24e;})[_0xee85('0x25')](respondWithFilteredResult(_0x59a897,_0x277dd1))['catch'](handleError(_0x59a897,null));};exports[_0xee85('0x44')]=function(_0xb555bd,_0x52d0ce){var _0x2cb822={'raw':!![],'where':{'id':_0xb555bd[_0xee85('0x45')]['id']}},_0x221524={};_0x221524[_0xee85('0x2f')]=_[_0xee85('0x31')](db[_0xee85('0x42')]['rawAttributes']);_0x221524[_0xee85('0x30')]=_[_0xee85('0x31')](_0xb555bd['query']);_0x221524[_0xee85('0x32')]=_[_0xee85('0x33')](_0x221524[_0xee85('0x2f')],_0x221524[_0xee85('0x30')]);_0x2cb822[_0xee85('0x34')]=_['intersection'](_0x221524['model'],qs[_0xee85('0x35')](_0xb555bd[_0xee85('0x30')]['fields']));_0x2cb822[_0xee85('0x34')]=_0x2cb822[_0xee85('0x34')][_0xee85('0x46')]?_0x2cb822[_0xee85('0x34')]:_0x221524[_0xee85('0x2f')];if(_0xb555bd[_0xee85('0x30')]['includeAll']){_0x2cb822[_0xee85('0x47')]=[{'all':!![]}];}_0x2cb822=_[_0xee85('0x40')]({},_0x2cb822,_0xb555bd[_0xee85('0x41')]);return db[_0xee85('0x42')][_0xee85('0x48')](_0x2cb822)['then'](handleEntityNotFound(_0x52d0ce,null))[_0xee85('0x25')](respondWithResult(_0x52d0ce,null))[_0xee85('0x49')](handleError(_0x52d0ce,null));};exports['create']=function(_0x3cb5c6,_0x438e00){return db[_0xee85('0x42')][_0xee85('0x4a')](_0x3cb5c6[_0xee85('0x4b')],{})['then'](respondWithResult(_0x438e00,0xc9))[_0xee85('0x49')](handleError(_0x438e00,null));};exports[_0xee85('0x4c')]=function(_0x42d51b,_0x321e65){if(_0x42d51b[_0xee85('0x4b')]['id']){delete _0x42d51b['body']['id'];}return db[_0xee85('0x42')]['find']({'where':{'id':_0x42d51b[_0xee85('0x45')]['id']}})[_0xee85('0x25')](handleEntityNotFound(_0x321e65,null))[_0xee85('0x25')](saveUpdates(_0x42d51b['body'],null))['then'](respondWithResult(_0x321e65,null))['catch'](handleError(_0x321e65,null));};exports['destroy']=function(_0x1b5f69,_0x1f281e){return db[_0xee85('0x42')][_0xee85('0x48')]({'where':{'id':_0x1b5f69[_0xee85('0x45')]['id']}})[_0xee85('0x25')](handleEntityNotFound(_0x1f281e,null))[_0xee85('0x25')](removeEntity(_0x1f281e,null))[_0xee85('0x49')](handleError(_0x1f281e,null));};
\ No newline at end of file
index 738eb2e..c13b76a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8a3=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd8a3,0x1ea));var _0x3d8a=function(_0x4b4460,_0x4b4ef2){_0x4b4460=_0x4b4460-0x0;var _0x4803d3=_0xd8a3[_0x4b4460];return _0x4803d3;};'use strict';var _=require(_0x3d8a('0x0'));var util=require(_0x3d8a('0x1'));var logger=require(_0x3d8a('0x2'))(_0x3d8a('0x3'));var moment=require(_0x3d8a('0x4'));var BPromise=require('bluebird');var rp=require(_0x3d8a('0x5'));var fs=require('fs');var path=require(_0x3d8a('0x6'));var rimraf=require('rimraf');var config=require(_0x3d8a('0x7'));var attributes=require('./smsApplication.attributes');module[_0x3d8a('0x8')]=function(_0x3c0e83,_0x3b46fb){return _0x3c0e83['define']('SmsApplication',attributes,{'tableName':_0x3d8a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3d8a('0xa'),'collate':_0x3d8a('0xb')});};
\ No newline at end of file
+var _0x192a=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','utf8mb4'];(function(_0x4d3a9b,_0x20b47d){var _0x1b5471=function(_0x51bf57){while(--_0x51bf57){_0x4d3a9b['push'](_0x4d3a9b['shift']());}};_0x1b5471(++_0x20b47d);}(_0x192a,0x17b));var _0xa192=function(_0x475770,_0x64adb9){_0x475770=_0x475770-0x0;var _0x49745d=_0x192a[_0x475770];return _0x49745d;};'use strict';var _=require(_0xa192('0x0'));var util=require(_0xa192('0x1'));var logger=require(_0xa192('0x2'))(_0xa192('0x3'));var moment=require('moment');var BPromise=require(_0xa192('0x4'));var rp=require(_0xa192('0x5'));var fs=require('fs');var path=require(_0xa192('0x6'));var rimraf=require(_0xa192('0x7'));var config=require(_0xa192('0x8'));var attributes=require(_0xa192('0x9'));module[_0xa192('0xa')]=function(_0x4e8ccf,_0x1dfa98){return _0x4e8ccf[_0xa192('0xb')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa192('0xc'),'collate':_0xa192('0xd')});};
\ No newline at end of file
index 59caabc..940fbd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2deb=['SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var moment=require(_0xb2de('0x2'));var BPromise=require(_0xb2de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2de('0x4'))['db'];var utils=require(_0xb2de('0x5'));var logger=require(_0xb2de('0x6'))(_0xb2de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2de('0x8')][_0xb2de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191004,_0x49307b,_0x253d0b){return new BPromise(function(_0x1a4c44,_0x53ab0e){return client[_0xb2de('0xa')](_0x191004,_0x253d0b)[_0xb2de('0xb')](function(_0x1d40ec){logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));logger[_0xb2de('0xe')](_0xb2de('0xf'),_0x49307b,'request\x20sent',JSON['stringify'](_0x1d40ec));if(_0x1d40ec[_0xb2de('0x10')]){if(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x11')]===0x1f4){logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);return _0x53ab0e(_0x1d40ec['error'][_0xb2de('0x12')]);}logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec['error'][_0xb2de('0x12')]);return _0x1a4c44(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);}else{logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));_0x1a4c44(_0x1d40ec[_0xb2de('0x13')][_0xb2de('0x12')]);}})[_0xb2de('0x14')](function(_0x2dc15c){logger[_0xb2de('0x10')](_0xb2de('0xc'),_0x49307b,_0x2dc15c);_0x53ab0e(_0x2dc15c);});});}
\ No newline at end of file
+var _0x8277=['request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x8277,0xcf));var _0x7827=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0x8277[_0x1bfe2b];return _0x1477d4;};'use strict';var _=require('lodash');var util=require(_0x7827('0x0'));var moment=require(_0x7827('0x1'));var BPromise=require('bluebird');var rs=require(_0x7827('0x2'));var fs=require('fs');var Redis=require(_0x7827('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7827('0x4'));var logger=require(_0x7827('0x5'))('rpc');var config=require(_0x7827('0x6'));var jayson=require(_0x7827('0x7'));var client=jayson[_0x7827('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e9e85,_0xbbc7df,_0x182412){return new BPromise(function(_0x24970d,_0x35fc12){return client[_0x7827('0x9')](_0x2e9e85,_0x182412)[_0x7827('0xa')](function(_0x3d1158){logger[_0x7827('0xb')](_0x7827('0xc'),_0xbbc7df,_0x7827('0xd'));logger[_0x7827('0xe')](_0x7827('0xf'),_0xbbc7df,_0x7827('0xd'),JSON['stringify'](_0x3d1158));if(_0x3d1158[_0x7827('0x10')]){if(_0x3d1158[_0x7827('0x10')][_0x7827('0x11')]===0x1f4){logger[_0x7827('0x10')]('SmsApplication,\x20%s,\x20%s',_0xbbc7df,_0x3d1158[_0x7827('0x10')][_0x7827('0x12')]);return _0x35fc12(_0x3d1158[_0x7827('0x10')][_0x7827('0x12')]);}logger[_0x7827('0x10')](_0x7827('0xc'),_0xbbc7df,_0x3d1158[_0x7827('0x10')][_0x7827('0x12')]);return _0x24970d(_0x3d1158[_0x7827('0x10')][_0x7827('0x12')]);}else{logger[_0x7827('0xb')](_0x7827('0xc'),_0xbbc7df,_0x7827('0xd'));_0x24970d(_0x3d1158[_0x7827('0x13')][_0x7827('0x12')]);}})['catch'](function(_0x3767f0){logger[_0x7827('0x10')](_0x7827('0xc'),_0xbbc7df,_0x3767f0);_0x35fc12(_0x3767f0);});});}
\ No newline at end of file
index 54f8a18..8a2e02e 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(_0xf293cf,_0x233b55){var _0x587b2b=function(_0x5a5fec){while(--_0x5a5fec){_0xf293cf['push'](_0xf293cf['shift']());}};_0x587b2b(++_0x233b55);}(_0xefda,0x96));var _0xaefd=function(_0x2295aa,_0x3c41b6){_0x2295aa=_0x2295aa-0x0;var _0x56d1b9=_0xefda[_0x2295aa];return _0x56d1b9;};'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 _0x3423=['/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0x9')](_0x3342('0xe'),auth[_0x3342('0xa')](),controller['show']);router['get'](_0x3342('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x3342('0xa')](),controller[_0x3342('0x10')]);router['post']('/',auth[_0x3342('0xa')](),controller['create']);router[_0x3342('0x11')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x11')](_0x3342('0x13'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x16')),controller['addTags']);router[_0x3342('0x17')](_0x3342('0xe'),auth['isAuthenticated'](),interaction[_0x3342('0x14')](_0x3342('0x15'),'smsinteraction:update'),controller['update']);router[_0x3342('0x18')](_0x3342('0xe'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x19')),controller[_0x3342('0x1a')]);router[_0x3342('0x18')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x1b')]);module[_0x3342('0x1c')]=router;
\ No newline at end of file
index 04688e1..788482b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef17=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize','moment'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0xef17,0x136));var _0x7ef1=function(_0x2c7b9b,_0x33e3cc){_0x2c7b9b=_0x2c7b9b-0x0;var _0x1448da=_0xef17[_0x2c7b9b];return _0x1448da;};'use strict';var Sequelize=require(_0x7ef1('0x0'));var moment=require(_0x7ef1('0x1'));module[_0x7ef1('0x2')]={'closed':{'type':Sequelize[_0x7ef1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7ef1('0x4')]},'disposition':{'type':Sequelize[_0x7ef1('0x5')]},'secondDisposition':{'type':Sequelize[_0x7ef1('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7ef1('0x5')]},'note':{'type':Sequelize[_0x7ef1('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7ef1('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7ef1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7ef1('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x80c3=['BOOLEAN','STRING','ENUM','out','sequelize'];(function(_0x620dbb,_0x2653b6){var _0x396c1e=function(_0x489d7d){while(--_0x489d7d){_0x620dbb['push'](_0x620dbb['shift']());}};_0x396c1e(++_0x2653b6);}(_0x80c3,0x18f));var _0x380c=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x80c3[_0x34021d];return _0x16597b;};'use strict';var Sequelize=require(_0x380c('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x380c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x380c('0x2')]},'secondDisposition':{'type':Sequelize[_0x380c('0x2')]},'thirdDisposition':{'type':Sequelize[_0x380c('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x380c('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x380c('0x3')]('in',_0x380c('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x380c('0x1')],'defaultValue':![]}};
\ No newline at end of file
index f6d95d5..2a8de16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6902=['parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','show','params','includeAll','options','create','update','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','SmsInteractionId','format','include','findAll','rows','setTags','spread','smsInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','fullname','CmContact','firstName','lastName','Messages','direction','Account','Owner','mkdirSync','Sms','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','out','System','Contact','secret','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','catch','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','select','field','color','tools_tags','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','from','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','operator','$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','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','start','compact','isEmpty','SmsAccountId','concat','createdAt'];(function(_0x29562a,_0x7a5241){var _0x2bb15f=function(_0x3cae3c){while(--_0x3cae3c){_0x29562a['push'](_0x29562a['shift']());}};_0x2bb15f(++_0x7a5241);}(_0x6902,0x67));var _0x2690=function(_0x2c5014,_0x1ac954){_0x2c5014=_0x2c5014-0x0;var _0x126f85=_0x6902[_0x2c5014];return _0x126f85;};'use strict';var emlformat=require(_0x2690('0x0'));var rimraf=require(_0x2690('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2690('0x2'));var rp=require('request-promise');var moment=require(_0x2690('0x3'));var BPromise=require(_0x2690('0x4'));var Mustache=require('mustache');var util=require(_0x2690('0x5'));var path=require('path');var sox=require(_0x2690('0x6'));var csv=require('to-csv');var ejs=require(_0x2690('0x7'));var fs=require('fs');var fs_extra=require(_0x2690('0x8'));var _=require(_0x2690('0x9'));var squel=require('squel');var crypto=require(_0x2690('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2690('0xb'));var toCsv=require(_0x2690('0xc'));var querystring=require(_0x2690('0xd'));var Papa=require(_0x2690('0xe'));var Redis=require(_0x2690('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2690('0x10'));var as=require(_0x2690('0x11'));var pdf=require(_0x2690('0x12'));var hardwareService=require(_0x2690('0x13'));var logger=require(_0x2690('0x14'))('api');var utils=require(_0x2690('0x15'));var config=require(_0x2690('0x16'));var licenseUtil=require(_0x2690('0x17'));var db=require(_0x2690('0x18'))['db'];config[_0x2690('0x19')]=_[_0x2690('0x1a')](config['redis'],{'host':_0x2690('0x1b'),'port':0x18eb});var socket=require(_0x2690('0x1c'))(new Redis(config[_0x2690('0x19')]));require(_0x2690('0x1d'))[_0x2690('0x1e')](socket);function respondWithStatusCode(_0xa7236e,_0x8153e9){_0x8153e9=_0x8153e9||0xcc;return function(_0x895a59){if(_0x895a59){return _0xa7236e[_0x2690('0x1f')](_0x8153e9);}return _0xa7236e[_0x2690('0x20')](_0x8153e9)[_0x2690('0x21')]();};}function respondWithResult(_0x54aec1,_0x437eac){_0x437eac=_0x437eac||0xc8;return function(_0x459fa1){if(_0x459fa1){return _0x54aec1[_0x2690('0x20')](_0x437eac)[_0x2690('0x22')](_0x459fa1);}};}function respondWithFilteredResult(_0x520c7a,_0x56d790){return function(_0x1a5dcb){if(_0x1a5dcb){var _0x1c24e6=typeof _0x56d790[_0x2690('0x23')]===_0x2690('0x24')&&typeof _0x56d790['limit']===_0x2690('0x24');var _0x50c3f8=_0x1a5dcb[_0x2690('0x25')];var _0x1a05f0=_0x1c24e6?0x0:_0x56d790[_0x2690('0x23')];var _0x3e9eef=_0x1c24e6?_0x1a5dcb['count']:_0x56d790[_0x2690('0x23')]+_0x56d790[_0x2690('0x26')];var _0x1516be;if(_0x3e9eef>=_0x50c3f8){_0x3e9eef=_0x50c3f8;_0x1516be=0xc8;}else{_0x1516be=0xce;}_0x520c7a[_0x2690('0x20')](_0x1516be);return _0x520c7a['set'](_0x2690('0x27'),_0x1a05f0+'-'+_0x3e9eef+'/'+_0x50c3f8)[_0x2690('0x22')](_0x1a5dcb);}return null;};}function patchUpdates(_0x229819){return function(_0x48c09d){try{jsonpatch[_0x2690('0x28')](_0x48c09d,_0x229819,!![]);}catch(_0x1e3c67){return BPromise[_0x2690('0x29')](_0x1e3c67);}return _0x48c09d[_0x2690('0x2a')]();};}function saveUpdates(_0x55b8f6,_0x35a928){return function(_0x56a232){if(_0x56a232){return _0x56a232['update'](_0x55b8f6)[_0x2690('0x2b')](function(_0x292923){return _0x292923;});}return null;};}function removeEntity(_0x1d8692,_0x232783){return function(_0x270391){if(_0x270391){return _0x270391[_0x2690('0x2c')]()[_0x2690('0x2b')](function(){_0x1d8692[_0x2690('0x20')](0xcc)[_0x2690('0x21')]();});}};}function handleEntityNotFound(_0x341dbf,_0x1b001d){return function(_0x29a4a4){if(!_0x29a4a4){_0x341dbf['sendStatus'](0x194);}return _0x29a4a4;};}function handleError(_0x1e783b,_0x32b187){_0x32b187=_0x32b187||0x1f4;return function(_0x27d4f6){logger[_0x2690('0x2d')](_0x27d4f6[_0x2690('0x2e')]);if(_0x27d4f6[_0x2690('0x2f')]){delete _0x27d4f6[_0x2690('0x2f')];}_0x1e783b[_0x2690('0x20')](_0x32b187)[_0x2690('0x30')](_0x27d4f6);};}function getInteractionUsers(_0xe32d22,_0x3a9917){return new BPromise(function(_0x592e69,_0x3d0673){try{if(_0x3a9917[_0xe32d22['id']]){_0xe32d22[_0x2690('0x31')]=_[_0x2690('0x32')](_0x3a9917[_0xe32d22['id']],function(_0x2fee2b){return{'id':_0x2fee2b['id'],'fullname':_0x2fee2b['fullname']};});}}catch(_0x35db33){_0x3d0673(_0x35db33);}_0x592e69(_0xe32d22);});}function getInteractionTags(_0x347192,_0x7e6f1e){return new BPromise(function(_0x3a1d5d,_0xe0101){try{if(_0x347192[_0x2690('0x33')]){_0x347192[_0x2690('0x34')]=[];_0x347192[_0x2690('0x33')][_0x2690('0x35')](',')[_0x2690('0x36')](function(_0x487ea9){_0x347192[_0x2690('0x34')][_0x2690('0x37')](_0x7e6f1e[_0x487ea9]);});}delete _0x347192[_0x2690('0x33')];}catch(_0x6fb676){_0xe0101(_0x6fb676);}_0x3a1d5d(_0x347192);});}function updateSmsInteraction(_0x34b81d,_0x111321,_0x39c9b5){return new BPromise(function(_0xd9e5fd,_0x37c268){return getInteractionUsers(_0x34b81d,_0x39c9b5)['then'](function(_0xd0c6){return getInteractionTags(_0xd0c6,_0x111321);})['then'](function(_0x3df78a){_0xd9e5fd(_0x3df78a);})[_0x2690('0x38')](function(_0x6456df){_0x37c268(_0x6456df);});});}exports['index']=function(_0x87c508,_0x3ba28b){var _0x520799={},_0x3e5e08={},_0xa385b8={'count':0x0,'rows':[]};var _0x460967=_[_0x2690('0x32')](db[_0x2690('0x39')][_0x2690('0x3a')],function(_0x543d47){return{'name':_0x543d47[_0x2690('0x3b')],'type':_0x543d47[_0x2690('0x3c')][_0x2690('0x3d')]};});_0x3e5e08[_0x2690('0x3e')]=_[_0x2690('0x32')](_0x460967,_0x2690('0x2f'));_0x3e5e08[_0x2690('0x3f')]=_[_0x2690('0x40')](_0x87c508[_0x2690('0x3f')]);_0x3e5e08[_0x2690('0x41')]=_[_0x2690('0x42')](_0x3e5e08[_0x2690('0x3e')],_0x3e5e08[_0x2690('0x3f')]);_0x520799[_0x2690('0x43')]=_[_0x2690('0x42')](_0x3e5e08[_0x2690('0x3e')],qs['fields'](_0x87c508[_0x2690('0x3f')][_0x2690('0x44')]));_0x520799[_0x2690('0x43')]=_0x520799[_0x2690('0x43')]['length']?_0x520799[_0x2690('0x43')]:_0x3e5e08[_0x2690('0x3e')];if(!_0x87c508['query'][_0x2690('0x45')](_0x2690('0x46'))){_0x520799[_0x2690('0x26')]=qs[_0x2690('0x26')](_0x87c508[_0x2690('0x3f')]['limit']);_0x520799[_0x2690('0x23')]=qs[_0x2690('0x23')](_0x87c508['query']['offset']);}_0x520799['order']=qs[_0x2690('0x47')](_0x87c508[_0x2690('0x3f')]['sort']);_0x520799[_0x2690('0x48')]=qs['filters'](_[_0x2690('0x49')](_0x87c508[_0x2690('0x3f')],_0x3e5e08[_0x2690('0x41')]),_0x460967);var _0x11755f=[];var _0xa7b6db=squel[_0x2690('0x4a')]()[_0x2690('0x4b')]('id')[_0x2690('0x4b')](_0x2690('0x2f'))['field'](_0x2690('0x4c'))['from'](_0x2690('0x4d'));var _0x1b9346=squel['select']()[_0x2690('0x4b')](_0x2690('0x4e'))[_0x2690('0x4b')]('u.fullname')['field'](_0x2690('0x4f'))['from'](_0x2690('0x50'),'ui')[_0x2690('0x51')](_0x2690('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x5bd1d4=squel[_0x2690('0x4a')]()[_0x2690('0x53')](_0x2690('0x54'),'i')['left_join']('cm_contacts','c',_0x2690('0x55'))[_0x2690('0x51')](_0x2690('0x52'),'o',_0x2690('0x56'))[_0x2690('0x51')](_0x2690('0x57'),'a',_0x2690('0x58'))['left_join']('sms_messages','me',_0x2690('0x59'))[_0x2690('0x51')](_0x2690('0x5a'),'it',_0x2690('0x5b'))['left_join'](_0x2690('0x4d'),'t',_0x2690('0x5c'));var _0x463f3d=squel[_0x2690('0x5d')]();var _0x532b62=[];var _0x1dcb81=squel[_0x2690('0x5d')]();var _0x5c67d7;if(_0x87c508[_0x2690('0x3f')][_0x2690('0x5e')]){_0x5c67d7=as[_0x2690('0x5f')](_0x87c508[_0x2690('0x3f')][_0x2690('0x5e')]);var _0x17f538=_0x5c67d7[_0x2690('0x60')];for(var _0xf0cf67=0x0;_0xf0cf67<_0x5c67d7[_0x2690('0x61')]['length'];_0xf0cf67++){var _0x3dd4b5=_0x5c67d7[_0x2690('0x61')][_0xf0cf67];var _0xf2e766='i';var _0xbf6ea3=_[_0x2690('0x62')](_0x460967,['name',_0x3dd4b5[_0x2690('0x4b')]]);if(!_0xbf6ea3){switch(_0x3dd4b5['field']){case'unreadMessages':if(_0x3dd4b5[_0x2690('0x63')]==0x1){_0x5bd1d4[_0x2690('0x64')]('`'+_0x3dd4b5[_0x2690('0x4b')]+_0x2690('0x65'));}else{_0x5bd1d4[_0x2690('0x64')]('`'+_0x3dd4b5[_0x2690('0x4b')]+_0x2690('0x66'));}break;case'Contact':if(_0x3dd4b5[_0x2690('0x67')]===_0x2690('0x68')){if(_0x3dd4b5['value'][_0x2690('0x35')]('\x20')[_0x2690('0x69')]>0x1){_0x463f3d[_0x17f538](_0x2690('0x6a'),qs['getFullTextValue'](_0x3dd4b5['value']),null);}else{var _0x395f08='%'+_0x3dd4b5[_0x2690('0x63')]+'%';_0x463f3d[_0x17f538](_0x2690('0x6b'),_0x395f08,_0x395f08,_0x395f08);}}else{_0xbf6ea3=_[_0x2690('0x62')](_0x460967,[_0x2690('0x2f'),_0x2690('0x6c')]);_0x3dd4b5[_0x2690('0x4b')]=_0x2690('0x6c');_0xb88a0c=as[_0x2690('0x6d')](_0xf2e766,_0xbf6ea3[_0x2690('0x3c')],_0x3dd4b5);_0x463f3d[_0x17f538](_0xb88a0c['text'],_0xb88a0c[_0x2690('0x63')]['start'],_0xb88a0c[_0x2690('0x63')][_0x2690('0x21')]);}break;case _0x2690('0x6e'):var _0x46ec78=_0x3dd4b5[_0x2690('0x63')][_0x2690('0x35')](',')[_0x2690('0x32')](function(_0x36db6a){return Number(_0x36db6a);});_0x46ec78[_0x2690('0x36')](function(_0x27844a){_0x1dcb81['or'](_0x2690('0x6f'),'%,'+_0x27844a+',%');});_0x532b62=_[_0x2690('0x70')](_0x532b62,_0x46ec78);break;case'User':if(_0x3dd4b5[_0x2690('0x67')]===_0x2690('0x68')){_0x463f3d[_0x17f538](_0x2690('0x71'),'%'+_0x3dd4b5[_0x2690('0x63')]+'%',null);}else{_0xbf6ea3=_[_0x2690('0x62')](_0x460967,[_0x2690('0x2f'),_0x2690('0x72')]);_0x3dd4b5[_0x2690('0x4b')]='UserId';_0xb88a0c=as[_0x2690('0x6d')](_0xf2e766,_0xbf6ea3['type'],_0x3dd4b5);_0x463f3d[_0x17f538](_0xb88a0c[_0x2690('0x73')],_0xb88a0c['value']['start'],_0xb88a0c[_0x2690('0x63')][_0x2690('0x21')]);}break;case _0x2690('0x74'):_0xb88a0c=as[_0x2690('0x6d')]('me',null,_0x3dd4b5);_0x463f3d[_0x17f538](_0xb88a0c[_0x2690('0x73')],_0xb88a0c['value'][_0x2690('0x75')],_0xb88a0c[_0x2690('0x63')][_0x2690('0x21')]);break;}}else{var _0xb88a0c=as[_0x2690('0x6d')](_0xf2e766,_0xbf6ea3[_0x2690('0x3c')],_0x3dd4b5);_0x463f3d[_0x17f538](_0xb88a0c['text'],_0xb88a0c[_0x2690('0x63')][_0x2690('0x75')],_0xb88a0c[_0x2690('0x63')][_0x2690('0x21')]);}}}else{var _0x1ab1c7=_(_0x87c508[_0x2690('0x3f')])['keys']()[_0x2690('0x32')](function(_0x36407a){return _['some'](_0x460967,[_0x2690('0x2f'),_0x36407a])?_0x36407a:undefined;})[_0x2690('0x76')]()[_0x2690('0x63')]();if(!_[_0x2690('0x77')](_0x1ab1c7)){_0x1ab1c7['forEach'](function(_0x5802ec){if(_0x5802ec===_0x2690('0x78')){_0x5bd1d4[_0x2690('0x48')]('i.SmsAccountId\x20IN\x20?',[][_0x2690('0x79')](_0x87c508['query'][_0x5802ec]));}else if(_0x5802ec===_0x2690('0x7a')){var _0x3c7cea=JSON[_0x2690('0x7b')](_0x87c508[_0x2690('0x3f')][_0x5802ec])[_0x2690('0x7c')];var _0x1cfffe=JSON[_0x2690('0x7b')](_0x87c508[_0x2690('0x3f')][_0x5802ec])[_0x2690('0x7d')];_0x5bd1d4['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3c7cea,_0x1cfffe);}else{if(_0x87c508[_0x2690('0x3f')][_0x5802ec]==='null'){_0x5bd1d4[_0x2690('0x48')]('i.'+_0x5802ec+_0x2690('0x7e'));}else{_0x5bd1d4['where']('i.'+_0x5802ec+_0x2690('0x7f'),_0x87c508['query'][_0x5802ec]);}}});}if(_0x87c508[_0x2690('0x3f')][_0x2690('0x80')]){if(_0x87c508[_0x2690('0x3f')][_0x2690('0x80')]==0x1){_0x5bd1d4['having'](_0x2690('0x81'));}else{_0x5bd1d4[_0x2690('0x64')](_0x2690('0x82'));}}if(_0x87c508[_0x2690('0x3f')]['tag']){_0x532b62=_['isArray'](_0x87c508['query']['tag'])?_0x87c508[_0x2690('0x3f')][_0x2690('0x83')]:new Array(_0x87c508[_0x2690('0x3f')][_0x2690('0x83')]);_0x532b62[_0x2690('0x36')](function(_0x2e38ef){_0x1dcb81['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2e38ef+',%');});}if(_0x87c508['query'][_0x2690('0x84')]){var _0x120a5c=_0x87c508[_0x2690('0x3f')]['filter'][_0x2690('0x85')]('\x5c','\x5c\x5c')[_0x2690('0x85')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x120a5c)){_0x463f3d['or'](_0x2690('0x86'),_0x120a5c+'%')['or'](_0x2690('0x87'),_0x120a5c+'%');}else{_0x463f3d['or'](_0x2690('0x88'),qs[_0x2690('0x89')](_0x120a5c))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x120a5c+'%');}}}_0x5bd1d4[_0x2690('0x48')](_0x463f3d);_0x5bd1d4['group'](_0x2690('0x8a'));var _0x2fca6c={'type':db[_0x2690('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1a395b=_0x5bd1d4[_0x2690('0x8c')]();_0x1a395b[_0x2690('0x4b')](_0x2690('0x8a'));_0x1a395b['field'](_0x2690('0x8d'),_0x2690('0x8e'));if(_0x520799[_0x2690('0x8f')]){_0x520799[_0x2690('0x8f')][_0x2690('0x36')](function(_0x10314a){var _0x3794ae=_0x10314a[0x0]==='contactName'?_0x10314a[0x0]:'i.'+_0x10314a[0x0];_0x5bd1d4[_0x2690('0x8f')](_0x3794ae,_0x10314a[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2690('0x77')](_0x532b62)){_0x5bd1d4[_0x2690('0x64')](_0x1dcb81);_0x1a395b[_0x2690('0x48')]('t.id\x20IN\x20?',_0x532b62);}BPromise['resolve']()[_0x2690('0x2b')](function(){if(!_0x5c67d7){if(_0x87c508[_0x2690('0x3f')][_0x2690('0x78')])return;_0x1a395b[_0x2690('0x48')](_0x2690('0x90'));_0x5bd1d4['where'](_0x2690('0x90'));return;}if(_0x87c508['user'][_0x2690('0x91')]!=='agent')return;return _0x87c508[_0x2690('0x92')][_0x2690('0x93')]({'attributes':['id'],'raw':!![]})[_0x2690('0x2b')](function(_0x51a7fe){if(_[_0x2690('0x77')](_0x51a7fe)){_0x1a395b[_0x2690('0x48')](_0x2690('0x94'));_0x5bd1d4['where'](_0x2690('0x94'));}else{_0x1a395b[_0x2690('0x48')](_0x2690('0x95'),_[_0x2690('0x32')](_0x51a7fe,'id'));_0x5bd1d4[_0x2690('0x48')](_0x2690('0x95'),_[_0x2690('0x32')](_0x51a7fe,'id'));}});})[_0x2690('0x2b')](function(){if(_0x87c508[_0x2690('0x92')][_0x2690('0x91')]==='agent'&&!_0x5c67d7&&!_0x87c508[_0x2690('0x3f')][_0x2690('0x78')])return[];return db[_0x2690('0x96')][_0x2690('0x3f')](_0x1a395b[_0x2690('0x97')](),_0x2fca6c);})[_0x2690('0x2b')](function(_0x11bfe4){_0xa385b8['count']=_0x11bfe4[_0x2690('0x69')];if(_0xa385b8[_0x2690('0x25')]===0x0)return[];return db['sequelize'][_0x2690('0x3f')](_0xa7b6db[_0x2690('0x97')](),_0x2fca6c)[_0x2690('0x2b')](function(_0x10295e){_0x11755f=_[_0x2690('0x98')](_0x10295e,'id');_0x2fca6c=_[_0x2690('0x99')](_0x2fca6c,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x87c508['query'][_0x2690('0x44')]){_0x520799[_0x2690('0x43')]['forEach'](function(_0x58b257){_0x5bd1d4[_0x2690('0x4b')]('i.'+_0x58b257);});}else{_0x5bd1d4[_0x2690('0x4b')](_0x2690('0x8d'),_0x2690('0x8e'));_0x5bd1d4[_0x2690('0x4b')](_0x2690('0x9a'),_0x2690('0x9b'));_0x5bd1d4[_0x2690('0x4b')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x5bd1d4[_0x2690('0x4b')](_0x2690('0x9c'),'contactName');_0x5bd1d4[_0x2690('0x4b')]('i.*');_0x5bd1d4['field'](_0x2690('0x9d'),_0x2690('0x9e'));_0x5bd1d4[_0x2690('0x4b')](_0x2690('0x9f'),_0x2690('0xa0'));_0x5bd1d4[_0x2690('0x4b')]('c.email',_0x2690('0xa1'));_0x5bd1d4[_0x2690('0x4b')]('c.phone',_0x2690('0xa2'));_0x5bd1d4[_0x2690('0x4b')](_0x2690('0xa3'),_0x2690('0xa4'));_0x5bd1d4[_0x2690('0x4b')](_0x2690('0xa5'),'Contact.fax');_0x5bd1d4[_0x2690('0x4b')](_0x2690('0xa6'),_0x2690('0xa7'));_0x5bd1d4['field'](_0x2690('0xa8'),_0x2690('0xa9'));_0x5bd1d4[_0x2690('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2690('0x33'));}if(_0x520799['limit'])_0x5bd1d4[_0x2690('0x26')](_0x520799['limit']);if(_0x520799[_0x2690('0x23')])_0x5bd1d4[_0x2690('0x23')](_0x520799[_0x2690('0x23')]);return db[_0x2690('0x96')][_0x2690('0x3f')](_0x5bd1d4[_0x2690('0x97')](),_0x2fca6c);})['then'](function(_0x576865){if(_0x576865['length']>0x0)_0x1b9346['where'](_0x2690('0xaa'),_[_0x2690('0x32')](_0x576865,'id'));return db[_0x2690('0x96')][_0x2690('0x3f')](_0x1b9346[_0x2690('0x97')](),_0x2fca6c)[_0x2690('0x2b')](function(_0x208899){var _0x4c1105=_['groupBy'](_0x208899,'SmsInteractionId');var _0x32d54b=[];_0x576865[_0x2690('0x36')](function(_0x3e290a){_0x32d54b[_0x2690('0x37')](updateSmsInteraction(_0x3e290a,_0x11755f,_0x4c1105));});return BPromise['all'](_0x32d54b);});});})[_0x2690('0x2b')](function(_0x1f35cd){_0xa385b8['rows']=_0x1f35cd;return _0xa385b8;})[_0x2690('0x2b')](respondWithFilteredResult(_0x3ba28b,_0x520799))[_0x2690('0x38')](handleError(_0x3ba28b,null));};exports[_0x2690('0xab')]=function(_0xe38ad2,_0x14e363){var _0x6c4a93={'raw':![],'where':{'id':_0xe38ad2[_0x2690('0xac')]['id']}},_0x435439={};_0x435439['model']=_[_0x2690('0x40')](db[_0x2690('0x39')][_0x2690('0x3a')]);_0x435439['query']=_['keys'](_0xe38ad2[_0x2690('0x3f')]);_0x435439['filters']=_[_0x2690('0x42')](_0x435439[_0x2690('0x3e')],_0x435439[_0x2690('0x3f')]);_0x6c4a93[_0x2690('0x43')]=_[_0x2690('0x42')](_0x435439[_0x2690('0x3e')],qs[_0x2690('0x44')](_0xe38ad2[_0x2690('0x3f')]['fields']));_0x6c4a93[_0x2690('0x43')]=_0x6c4a93['attributes'][_0x2690('0x69')]?_0x6c4a93[_0x2690('0x43')]:_0x435439[_0x2690('0x3e')];if(_0xe38ad2[_0x2690('0x3f')][_0x2690('0xad')]){_0x6c4a93['include']=[{'all':!![]}];}_0x6c4a93=_[_0x2690('0x99')]({},_0x6c4a93,_0xe38ad2[_0x2690('0xae')]);return db[_0x2690('0x39')][_0x2690('0x62')](_0x6c4a93)[_0x2690('0x2b')](handleEntityNotFound(_0x14e363,null))[_0x2690('0x2b')](respondWithResult(_0x14e363,null))[_0x2690('0x38')](handleError(_0x14e363,null));};exports[_0x2690('0xaf')]=function(_0x3abba2,_0x3c210b){return db[_0x2690('0x39')][_0x2690('0xaf')](_0x3abba2['body'],{})[_0x2690('0x2b')](respondWithResult(_0x3c210b,0xc9))[_0x2690('0x38')](handleError(_0x3c210b,null));};exports[_0x2690('0xb0')]=function(_0x511a22,_0x53d4b9){if(_0x511a22['body']['id']){delete _0x511a22[_0x2690('0x74')]['id'];}return db['SmsInteraction'][_0x2690('0x62')]({'where':{'id':_0x511a22[_0x2690('0xac')]['id']}})[_0x2690('0x2b')](handleEntityNotFound(_0x53d4b9,null))[_0x2690('0x2b')](saveUpdates(_0x511a22['body'],null))[_0x2690('0x2b')](respondWithResult(_0x53d4b9,null))[_0x2690('0x38')](handleError(_0x53d4b9,null));};exports[_0x2690('0x2c')]=function(_0x108ed7,_0x5aa324){return db[_0x2690('0x39')][_0x2690('0x62')]({'where':{'id':_0x108ed7[_0x2690('0xac')]['id']}})[_0x2690('0x2b')](handleEntityNotFound(_0x5aa324,null))[_0x2690('0x2b')](removeEntity(_0x5aa324,null))[_0x2690('0x38')](handleError(_0x5aa324,null));};exports[_0x2690('0xb1')]=function(_0x46bfc9,_0x355e78){return db[_0x2690('0x39')][_0x2690('0xb1')]()['then'](respondWithResult(_0x355e78,null))[_0x2690('0x38')](handleError(_0x355e78,null));};exports[_0x2690('0xb2')]=function(_0xe764e0,_0x414a91,_0x192bdc){return db[_0x2690('0xb3')][_0x2690('0x62')]({'where':{'id':_0xe764e0[_0x2690('0xac')]['id']}})['then'](handleEntityNotFound(_0x414a91,null))[_0x2690('0x2b')](function(_0x1ba2f1){if(_0x1ba2f1){return _0x1ba2f1[_0x2690('0xb2')](_0xe764e0[_0x2690('0x74')][_0x2690('0xb4')],_[_0x2690('0xb5')](_0xe764e0['body'],[_0x2690('0xb4'),'id'])||{});}})[_0x2690('0x2b')](respondWithResult(_0x414a91,null))[_0x2690('0x38')](handleError(_0x414a91,null));};exports[_0x2690('0xb6')]=function(_0x4e2a7e,_0x2f8654,_0x1762f8){var _0x3d21b0={'raw':![],'where':{}};var _0x406fd0={};var _0x33c094={'count':0x0,'rows':[]};return db[_0x2690('0x39')][_0x2690('0xb7')]({'where':{'id':_0x4e2a7e['params']['id']}})[_0x2690('0x2b')](handleEntityNotFound(_0x2f8654,null))[_0x2690('0x2b')](function(_0x1c423b){if(_0x1c423b){_0x406fd0['model']=_[_0x2690('0x40')](db[_0x2690('0xb3')][_0x2690('0x3a')]);_0x406fd0[_0x2690('0x3f')]=_[_0x2690('0x40')](_0x4e2a7e['query']);_0x406fd0[_0x2690('0x41')]=_[_0x2690('0x42')](_0x406fd0[_0x2690('0x3e')],_0x406fd0[_0x2690('0x3f')]);_0x3d21b0[_0x2690('0x43')]=_['intersection'](_0x406fd0[_0x2690('0x3e')],qs[_0x2690('0x44')](_0x4e2a7e[_0x2690('0x3f')][_0x2690('0x44')]));_0x3d21b0[_0x2690('0x43')]=_0x3d21b0[_0x2690('0x43')]['length']?_0x3d21b0[_0x2690('0x43')]:_0x406fd0[_0x2690('0x3e')];if(!_0x4e2a7e[_0x2690('0x3f')][_0x2690('0x45')](_0x2690('0x46'))){_0x3d21b0[_0x2690('0x26')]=qs[_0x2690('0x26')](_0x4e2a7e[_0x2690('0x3f')][_0x2690('0x26')]);_0x3d21b0[_0x2690('0x23')]=qs['offset'](_0x4e2a7e[_0x2690('0x3f')][_0x2690('0x23')]);}_0x3d21b0[_0x2690('0x8f')]=qs[_0x2690('0x47')](_0x4e2a7e[_0x2690('0x3f')][_0x2690('0x47')]);_0x3d21b0[_0x2690('0x48')]=qs[_0x2690('0x41')](_[_0x2690('0x49')](_0x4e2a7e['query'],_0x406fd0[_0x2690('0x41')]));_0x3d21b0[_0x2690('0x48')][_0x2690('0xb8')]=_0x1c423b['id'];if(_0x4e2a7e[_0x2690('0x3f')][_0x2690('0x84')]){_0x3d21b0[_0x2690('0x48')]=_['merge'](_0x3d21b0[_0x2690('0x48')],{'$or':_[_0x2690('0x32')](_0x3d21b0['attributes'],function(_0x4385bb){var _0x15d259={};_0x15d259[_0x4385bb]={'$like':'%'+_0x4e2a7e[_0x2690('0x3f')]['filter']+'%'};return _0x15d259;})});}if(_0x4e2a7e[_0x2690('0x3f')][_0x2690('0x7c')]){var _0x5d0fc3=_0x4e2a7e[_0x2690('0x3f')][_0x2690('0x7c')][_0x2690('0x35')](',');var _0x479dcc={};_0x479dcc[_0x5d0fc3[0x0]]={'$gte':moment(_0x5d0fc3[0x1])[_0x2690('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3d21b0['where']=_['merge'](_0x3d21b0[_0x2690('0x48')],_0x479dcc);}_0x3d21b0=_[_0x2690('0x99')]({},_0x3d21b0,_0x4e2a7e['options']);return db[_0x2690('0xb3')][_0x2690('0x25')]({'where':_0x3d21b0['where']})[_0x2690('0x2b')](function(_0x255945){_0x33c094[_0x2690('0x25')]=_0x255945;if(_0x4e2a7e[_0x2690('0x3f')][_0x2690('0xad')]){_0x3d21b0[_0x2690('0xba')]=[{'all':!![]}];}return db[_0x2690('0xb3')][_0x2690('0xbb')](_0x3d21b0);})[_0x2690('0x2b')](function(_0x45c7dd){_0x33c094[_0x2690('0xbc')]=_0x45c7dd;return _0x33c094;});}})[_0x2690('0x2b')](respondWithFilteredResult(_0x2f8654,_0x3d21b0))[_0x2690('0x38')](handleError(_0x2f8654,null));};exports['addTags']=function(_0x36ac54,_0x29a7a2,_0x26f633){return db[_0x2690('0x39')][_0x2690('0x62')]({'where':{'id':_0x36ac54[_0x2690('0xac')]['id']}})[_0x2690('0x2b')](handleEntityNotFound(_0x29a7a2,null))['then'](function(_0x24139a){if(_0x24139a){return _0x24139a[_0x2690('0xbd')](_0x36ac54['body']['ids'],_[_0x2690('0xb5')](_0x36ac54[_0x2690('0x74')],[_0x2690('0xb4'),'id'])||{})[_0x2690('0xbe')](function(){return db[_0x2690('0x6e')]['findAll']({'attributes':['id',_0x2690('0x2f'),_0x2690('0x4c')],'where':{'id':_0x36ac54['body'][_0x2690('0xb4')]}});})[_0x2690('0x2b')](function(_0xa34c5){socket['emit'](_0x2690('0xbf'),{'id':Number(_0x36ac54[_0x2690('0xac')]['id']),'tags':_0xa34c5||[]});return{'id':Number(_0x36ac54[_0x2690('0xac')]['id']),'tags':_0xa34c5||[]};});}})[_0x2690('0x2b')](respondWithResult(_0x29a7a2,null))[_0x2690('0x38')](handleError(_0x29a7a2,null));};exports[_0x2690('0xc0')]=function(_0x3cdd34,_0x15a8d4,_0x50d3ee){return db[_0x2690('0x39')][_0x2690('0x62')]({'where':{'id':_0x3cdd34['params']['id']}})[_0x2690('0x2b')](handleEntityNotFound(_0x15a8d4,null))['then'](function(_0x95fc6){if(_0x95fc6){return _0x95fc6['removeTags'](_0x3cdd34[_0x2690('0x3f')]['ids']);}})[_0x2690('0x2b')](respondWithStatusCode(_0x15a8d4,null))['catch'](handleError(_0x15a8d4,null));};exports['download']=function(_0x34a0ef,_0x4bd565){var _0x2757d0=moment()[_0x2690('0xc1')]()[_0x2690('0x97')]();var _0x447876=path[_0x2690('0xc2')](config[_0x2690('0xc3')],_0x2690('0xc4'),_0x2690('0xc5'),_0x2690('0xc6'));var _0x1ef0c1=path[_0x2690('0xc2')](config['root'],_0x2690('0xc4'),_0x2690('0xc5'),_0x2690('0xc7'));var _0x2b3c7e=path[_0x2690('0xc2')](_0x447876,_0x2757d0);var _0x7537cd=util['format'](_0x2690('0xc8'),_0x34a0ef[_0x2690('0xac')]['id'],_0x2757d0);var _0x5c852b=path[_0x2690('0xc2')](_0x447876,_0x7537cd);var _0x2d2654=[];_0x2d2654['push']({'model':db['User'],'as':_0x2690('0xc9'),'attributes':['id',_0x2690('0xca')],'raw':!![]});_0x2d2654['push']({'model':db[_0x2690('0xcb')],'as':'Contact','attributes':['id',_0x2690('0xcc'),_0x2690('0xcd')],'raw':!![]});var _0x577d04=[{'model':db['SmsMessage'],'as':_0x2690('0xce'),'attributes':['id',_0x2690('0x74'),_0x2690('0x7a'),_0x2690('0xcf'),'secret',_0x2690('0x80')],'include':_0x2d2654}];_0x577d04[_0x2690('0x37')]({'model':db['SmsAccount'],'as':_0x2690('0xd0'),'attributes':['id','name']});_0x577d04[_0x2690('0x37')]({'model':db['User'],'as':_0x2690('0xd1'),'attributes':['id','fullname']});return db[_0x2690('0x39')]['find']({'where':{'id':_0x34a0ef['params']['id']},'include':_0x577d04})['then'](handleEntityNotFound(_0x4bd565,null))[_0x2690('0x2b')](function(_0x4623b9){if(_0x4623b9){var _0x2053d4=_0x4623b9['get']({'plain':!![]});fs[_0x2690('0xd2')](_0x2b3c7e);var _0x4e80fa={'channel':_0x2690('0xd3'),'account':_0x2053d4[_0x2690('0xd0')][_0x2690('0x2f')],'agent':_0x2053d4['Owner']?_0x2053d4[_0x2690('0xd1')][_0x2690('0xca')]:'N.A.','createdAt':moment(_0x2053d4['createdAt'])[_0x2690('0xb9')](_0x2690('0xd4'))[_0x2690('0x97')](),'closedAt':_0x2053d4[_0x2690('0xd5')]?moment(_0x2053d4[_0x2690('0xd6')])[_0x2690('0xb9')](_0x2690('0xd4'))[_0x2690('0x97')]():'','disposition':_0x2053d4['disposition'],'messages':_(_0x2053d4[_0x2690('0xce')])['filter']({'secret':![]})[_0x2690('0x32')](function(_0x27ff76){return{'date':moment(_0x27ff76[_0x2690('0x7a')])['format'](_0x2690('0xd4'))[_0x2690('0x97')](),'sender':_0x27ff76[_0x2690('0xcf')]===_0x2690('0xd7')?_0x27ff76[_0x2690('0xc9')]?_0x27ff76[_0x2690('0xc9')][_0x2690('0xca')]:_0x2690('0xd8'):_0x27ff76[_0x2690('0xd9')][_0x2690('0xcc')]+(_0x27ff76[_0x2690('0xd9')][_0x2690('0xcd')]?'\x20'+_0x27ff76[_0x2690('0xd9')][_0x2690('0xcd')]:''),'body':_0x27ff76[_0x2690('0x74')],'direction':_0x27ff76[_0x2690('0xcf')]===_0x2690('0xd7')?'A':'C','secret':_0x27ff76[_0x2690('0xda')],'read':_0x27ff76[_0x2690('0x80')]};})[_0x2690('0x63')]()};return ejs[_0x2690('0xdb')](path[_0x2690('0xc2')](config[_0x2690('0xc3')],_0x2690('0xc4'),'views',_0x2690('0xdc')),{'interaction':_0x4e80fa})[_0x2690('0x2b')](function(_0x496157){var _0x832443=path[_0x2690('0xc2')](_0x2b3c7e,_0x2690('0xdd')+_0x2053d4['id']+'-'+_0x2757d0+_0x2690('0xde'));var _0x2109d7={'path':_0x832443,'channel':_0x2690('0xd3'),'interactionId':_0x2053d4['id']};return pdf[_0x2690('0xdf')](_0x496157,_0x2109d7);})[_0x2690('0x2b')](function(){return new BPromise(function(_0x202ea4,_0x5dbb8d){zipdir(_0x2b3c7e,{'saveTo':_0x5c852b},function(_0x7de457,_0x26fab9){if(_0x7de457)return _0x5dbb8d(_0x7de457);return _0x202ea4(_0x26fab9);});})[_0x2690('0x2b')](function(){return new BPromise(function(_0xe3b386,_0x389714){rimraf(_0x2b3c7e,function(_0x4c23c5){if(_0x4c23c5)_0x389714(_0x4c23c5);return _0xe3b386();});});})['then'](function(){return _0x4bd565['download'](_0x5c852b,_0x7537cd,function(_0x1ddf2f){if(_0x1ddf2f){console[_0x2690('0xe0')](_0x2690('0xe1'),_0x1ddf2f);}else{fs['unlinkSync'](_0x5c852b);}});});});}else{return _0x4bd565[_0x2690('0x1f')](0xc8);}})[_0x2690('0x38')](handleError(_0x4bd565,null));};
\ No newline at end of file
+var _0x77cb=['mkdirSync','Sms','N.A.','closed','closedAt','disposition','Messages','out','direction','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','limit','count','Content-Range','save','update','then','destroy','error','name','send','Users','fullname','TagIds','split','forEach','push','catch','index','SmsInteraction','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','select','field','color','tools_tags','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','from','sms_interactions','cm_contacts','users','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','keys','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','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','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','rawAttributes','include','options','create','body','params','describe','addMessage','SmsMessage','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','CmContact','firstName','lastName','secret','SmsAccount','Account','Owner','get'];(function(_0x3714d3,_0x281bba){var _0x35a801=function(_0x2c46e4){while(--_0x2c46e4){_0x3714d3['push'](_0x3714d3['shift']());}};_0x35a801(++_0x281bba);}(_0x77cb,0x1e1));var _0xb77c=function(_0x59781d,_0x549c9f){_0x59781d=_0x59781d-0x0;var _0x2a5b01=_0x77cb[_0x59781d];return _0x2a5b01;};'use strict';var emlformat=require(_0xb77c('0x0'));var rimraf=require(_0xb77c('0x1'));var zipdir=require(_0xb77c('0x2'));var jsonpatch=require(_0xb77c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb77c('0x4'));var Mustache=require(_0xb77c('0x5'));var util=require('util');var path=require(_0xb77c('0x6'));var sox=require('sox');var csv=require(_0xb77c('0x7'));var ejs=require(_0xb77c('0x8'));var fs=require('fs');var fs_extra=require(_0xb77c('0x9'));var _=require(_0xb77c('0xa'));var squel=require(_0xb77c('0xb'));var crypto=require(_0xb77c('0xc'));var jsforce=require(_0xb77c('0xd'));var deskjs=require(_0xb77c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb77c('0xf'));var Papa=require(_0xb77c('0x10'));var Redis=require(_0xb77c('0x11'));var authService=require(_0xb77c('0x12'));var qs=require(_0xb77c('0x13'));var as=require(_0xb77c('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb77c('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb77c('0x16'));var db=require(_0xb77c('0x17'))['db'];config[_0xb77c('0x18')]=_[_0xb77c('0x19')](config[_0xb77c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb77c('0x1a'))(new Redis(config[_0xb77c('0x18')]));require(_0xb77c('0x1b'))[_0xb77c('0x1c')](socket);function respondWithStatusCode(_0x3604ef,_0x2f1e1a){_0x2f1e1a=_0x2f1e1a||0xcc;return function(_0xc65e8){if(_0xc65e8){return _0x3604ef[_0xb77c('0x1d')](_0x2f1e1a);}return _0x3604ef[_0xb77c('0x1e')](_0x2f1e1a)[_0xb77c('0x1f')]();};}function respondWithResult(_0x3eb74f,_0x458348){_0x458348=_0x458348||0xc8;return function(_0xf6b73a){if(_0xf6b73a){return _0x3eb74f[_0xb77c('0x1e')](_0x458348)[_0xb77c('0x20')](_0xf6b73a);}};}function respondWithFilteredResult(_0x56d12c,_0x4b7e6a){return function(_0x154f3e){if(_0x154f3e){var _0x7317e7=typeof _0x4b7e6a['offset']==='undefined'&&typeof _0x4b7e6a[_0xb77c('0x21')]==='undefined';var _0x2923f2=_0x154f3e['count'];var _0x3a590b=_0x7317e7?0x0:_0x4b7e6a['offset'];var _0x22d3b3=_0x7317e7?_0x154f3e[_0xb77c('0x22')]:_0x4b7e6a['offset']+_0x4b7e6a['limit'];var _0x22686d;if(_0x22d3b3>=_0x2923f2){_0x22d3b3=_0x2923f2;_0x22686d=0xc8;}else{_0x22686d=0xce;}_0x56d12c[_0xb77c('0x1e')](_0x22686d);return _0x56d12c['set'](_0xb77c('0x23'),_0x3a590b+'-'+_0x22d3b3+'/'+_0x2923f2)['json'](_0x154f3e);}return null;};}function patchUpdates(_0xc8b360){return function(_0x10ab74){try{jsonpatch['apply'](_0x10ab74,_0xc8b360,!![]);}catch(_0x59f792){return BPromise['reject'](_0x59f792);}return _0x10ab74[_0xb77c('0x24')]();};}function saveUpdates(_0x3ef83b,_0x559e60){return function(_0x391496){if(_0x391496){return _0x391496[_0xb77c('0x25')](_0x3ef83b)[_0xb77c('0x26')](function(_0x57510f){return _0x57510f;});}return null;};}function removeEntity(_0x3fbcaf,_0x3bab6c){return function(_0x25b449){if(_0x25b449){return _0x25b449[_0xb77c('0x27')]()[_0xb77c('0x26')](function(){_0x3fbcaf[_0xb77c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a87e,_0x383a39){return function(_0x5c783a){if(!_0x5c783a){_0x42a87e[_0xb77c('0x1d')](0x194);}return _0x5c783a;};}function handleError(_0x12230d,_0x2867c4){_0x2867c4=_0x2867c4||0x1f4;return function(_0x3f5601){logger[_0xb77c('0x28')](_0x3f5601['stack']);if(_0x3f5601[_0xb77c('0x29')]){delete _0x3f5601[_0xb77c('0x29')];}_0x12230d[_0xb77c('0x1e')](_0x2867c4)[_0xb77c('0x2a')](_0x3f5601);};}function getInteractionUsers(_0x208ccf,_0x263200){return new BPromise(function(_0x4202b1,_0x1ef8b5){try{if(_0x263200[_0x208ccf['id']]){_0x208ccf[_0xb77c('0x2b')]=_['map'](_0x263200[_0x208ccf['id']],function(_0x1c27d2){return{'id':_0x1c27d2['id'],'fullname':_0x1c27d2[_0xb77c('0x2c')]};});}}catch(_0x31347a){_0x1ef8b5(_0x31347a);}_0x4202b1(_0x208ccf);});}function getInteractionTags(_0x1a8536,_0x3d28b1){return new BPromise(function(_0xca1c4e,_0x4b7ad7){try{if(_0x1a8536['TagIds']){_0x1a8536['Tags']=[];_0x1a8536[_0xb77c('0x2d')][_0xb77c('0x2e')](',')[_0xb77c('0x2f')](function(_0x46b883){_0x1a8536['Tags'][_0xb77c('0x30')](_0x3d28b1[_0x46b883]);});}delete _0x1a8536['TagIds'];}catch(_0x18c473){_0x4b7ad7(_0x18c473);}_0xca1c4e(_0x1a8536);});}function updateSmsInteraction(_0x3bf4ee,_0x5f2204,_0x47efdf){return new BPromise(function(_0x545bce,_0x13c391){return getInteractionUsers(_0x3bf4ee,_0x47efdf)[_0xb77c('0x26')](function(_0x341ab3){return getInteractionTags(_0x341ab3,_0x5f2204);})['then'](function(_0x3887b1){_0x545bce(_0x3887b1);})[_0xb77c('0x31')](function(_0xf2103a){_0x13c391(_0xf2103a);});});}exports[_0xb77c('0x32')]=function(_0x39bc2c,_0x47fb12){var _0x41975f={},_0x310428={},_0x421b3a={'count':0x0,'rows':[]};var _0x3d24e9=_['map'](db[_0xb77c('0x33')]['rawAttributes'],function(_0x5f3f6f){return{'name':_0x5f3f6f['fieldName'],'type':_0x5f3f6f[_0xb77c('0x34')][_0xb77c('0x35')]};});_0x310428[_0xb77c('0x36')]=_[_0xb77c('0x37')](_0x3d24e9,'name');_0x310428[_0xb77c('0x38')]=_['keys'](_0x39bc2c[_0xb77c('0x38')]);_0x310428[_0xb77c('0x39')]=_[_0xb77c('0x3a')](_0x310428[_0xb77c('0x36')],_0x310428[_0xb77c('0x38')]);_0x41975f[_0xb77c('0x3b')]=_[_0xb77c('0x3a')](_0x310428[_0xb77c('0x36')],qs[_0xb77c('0x3c')](_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x3c')]));_0x41975f['attributes']=_0x41975f[_0xb77c('0x3b')][_0xb77c('0x3d')]?_0x41975f['attributes']:_0x310428[_0xb77c('0x36')];if(!_0x39bc2c['query'][_0xb77c('0x3e')](_0xb77c('0x3f'))){_0x41975f[_0xb77c('0x21')]=qs['limit'](_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x21')]);_0x41975f['offset']=qs[_0xb77c('0x40')](_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x40')]);}_0x41975f[_0xb77c('0x41')]=qs[_0xb77c('0x42')](_0x39bc2c['query']['sort']);_0x41975f[_0xb77c('0x43')]=qs[_0xb77c('0x39')](_[_0xb77c('0x44')](_0x39bc2c[_0xb77c('0x38')],_0x310428['filters']),_0x3d24e9);var _0x1d805f=[];var _0x35028d=squel[_0xb77c('0x45')]()['field']('id')[_0xb77c('0x46')]('name')[_0xb77c('0x46')](_0xb77c('0x47'))['from'](_0xb77c('0x48'));var _0x2746f7=squel[_0xb77c('0x45')]()[_0xb77c('0x46')](_0xb77c('0x49'))['field']('u.fullname')[_0xb77c('0x46')](_0xb77c('0x4a'))['from'](_0xb77c('0x4b'),'ui')[_0xb77c('0x4c')]('users','u',_0xb77c('0x4d'));var _0x1f3594=squel[_0xb77c('0x45')]()[_0xb77c('0x4e')](_0xb77c('0x4f'),'i')[_0xb77c('0x4c')](_0xb77c('0x50'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xb77c('0x51'),'o','o.id\x20=\x20i.UserId')[_0xb77c('0x4c')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0xb77c('0x4c')](_0xb77c('0x52'),'me',_0xb77c('0x53'))[_0xb77c('0x4c')](_0xb77c('0x54'),'it',_0xb77c('0x55'))[_0xb77c('0x4c')](_0xb77c('0x48'),'t',_0xb77c('0x56'));var _0x3edb76=squel[_0xb77c('0x57')]();var _0x535bb4=[];var _0x1c7d87=squel[_0xb77c('0x57')]();var _0xd4a6df;if(_0x39bc2c[_0xb77c('0x38')]['search']){_0xd4a6df=as[_0xb77c('0x58')](_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x59')]);var _0x2dbb20=_0xd4a6df[_0xb77c('0x5a')];for(var _0xe7c1f1=0x0;_0xe7c1f1<_0xd4a6df[_0xb77c('0x5b')]['length'];_0xe7c1f1++){var _0x4bfa00=_0xd4a6df[_0xb77c('0x5b')][_0xe7c1f1];var _0x83f6c1='i';var _0x4b38a3=_['find'](_0x3d24e9,[_0xb77c('0x29'),_0x4bfa00[_0xb77c('0x46')]]);if(!_0x4b38a3){switch(_0x4bfa00[_0xb77c('0x46')]){case'unreadMessages':if(_0x4bfa00[_0xb77c('0x5c')]==0x1){_0x1f3594[_0xb77c('0x5d')]('`'+_0x4bfa00[_0xb77c('0x46')]+_0xb77c('0x5e'));}else{_0x1f3594[_0xb77c('0x5d')]('`'+_0x4bfa00[_0xb77c('0x46')]+_0xb77c('0x5f'));}break;case _0xb77c('0x60'):if(_0x4bfa00[_0xb77c('0x61')]===_0xb77c('0x62')){if(_0x4bfa00['value'][_0xb77c('0x2e')]('\x20')['length']>0x1){_0x3edb76[_0x2dbb20](_0xb77c('0x63'),qs[_0xb77c('0x64')](_0x4bfa00[_0xb77c('0x5c')]),null);}else{var _0x47edca='%'+_0x4bfa00[_0xb77c('0x5c')]+'%';_0x3edb76[_0x2dbb20](_0xb77c('0x65'),_0x47edca,_0x47edca,_0x47edca);}}else{_0x4b38a3=_[_0xb77c('0x66')](_0x3d24e9,['name','ContactId']);_0x4bfa00[_0xb77c('0x46')]=_0xb77c('0x67');_0xfe6678=as[_0xb77c('0x68')](_0x83f6c1,_0x4b38a3['type'],_0x4bfa00);_0x3edb76[_0x2dbb20](_0xfe6678['text'],_0xfe6678['value'][_0xb77c('0x69')],_0xfe6678[_0xb77c('0x5c')][_0xb77c('0x1f')]);}break;case _0xb77c('0x6a'):var _0x2f17fd=_0x4bfa00['value'][_0xb77c('0x2e')](',')[_0xb77c('0x37')](function(_0x57bf9b){return Number(_0x57bf9b);});_0x2f17fd[_0xb77c('0x2f')](function(_0x5bdee2){_0x1c7d87['or'](_0xb77c('0x6b'),'%,'+_0x5bdee2+',%');});_0x535bb4=_[_0xb77c('0x6c')](_0x535bb4,_0x2f17fd);break;case _0xb77c('0x6d'):if(_0x4bfa00[_0xb77c('0x61')]==='$substring'){_0x3edb76[_0x2dbb20](_0xb77c('0x6e'),'%'+_0x4bfa00[_0xb77c('0x5c')]+'%',null);}else{_0x4b38a3=_['find'](_0x3d24e9,[_0xb77c('0x29'),_0xb77c('0x6f')]);_0x4bfa00[_0xb77c('0x46')]=_0xb77c('0x6f');_0xfe6678=as[_0xb77c('0x68')](_0x83f6c1,_0x4b38a3['type'],_0x4bfa00);_0x3edb76[_0x2dbb20](_0xfe6678[_0xb77c('0x70')],_0xfe6678[_0xb77c('0x5c')][_0xb77c('0x69')],_0xfe6678[_0xb77c('0x5c')][_0xb77c('0x1f')]);}break;case'body':_0xfe6678=as[_0xb77c('0x68')]('me',null,_0x4bfa00);_0x3edb76[_0x2dbb20](_0xfe6678[_0xb77c('0x70')],_0xfe6678[_0xb77c('0x5c')][_0xb77c('0x69')],_0xfe6678[_0xb77c('0x5c')]['end']);break;}}else{var _0xfe6678=as[_0xb77c('0x68')](_0x83f6c1,_0x4b38a3[_0xb77c('0x34')],_0x4bfa00);_0x3edb76[_0x2dbb20](_0xfe6678['text'],_0xfe6678['value'][_0xb77c('0x69')],_0xfe6678[_0xb77c('0x5c')][_0xb77c('0x1f')]);}}}else{var _0x399715=_(_0x39bc2c[_0xb77c('0x38')])[_0xb77c('0x71')]()[_0xb77c('0x37')](function(_0x13c85e){return _[_0xb77c('0x72')](_0x3d24e9,[_0xb77c('0x29'),_0x13c85e])?_0x13c85e:undefined;})[_0xb77c('0x73')]()[_0xb77c('0x5c')]();if(!_[_0xb77c('0x74')](_0x399715)){_0x399715[_0xb77c('0x2f')](function(_0x305624){if(_0x305624===_0xb77c('0x75')){_0x1f3594['where'](_0xb77c('0x76'),[]['concat'](_0x39bc2c['query'][_0x305624]));}else if(_0x305624===_0xb77c('0x77')){var _0x4337d3=JSON['parse'](_0x39bc2c[_0xb77c('0x38')][_0x305624])[_0xb77c('0x78')];var _0x1aba69=JSON[_0xb77c('0x79')](_0x39bc2c['query'][_0x305624])[_0xb77c('0x7a')];_0x1f3594[_0xb77c('0x43')](_0xb77c('0x7b'),_0x4337d3,_0x1aba69);}else{if(_0x39bc2c[_0xb77c('0x38')][_0x305624]==='null'){_0x1f3594['where']('i.'+_0x305624+_0xb77c('0x7c'));}else{_0x1f3594[_0xb77c('0x43')]('i.'+_0x305624+_0xb77c('0x7d'),_0x39bc2c[_0xb77c('0x38')][_0x305624]);}}});}if(_0x39bc2c[_0xb77c('0x38')]['read']){if(_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x7e')]==0x1){_0x1f3594[_0xb77c('0x5d')](_0xb77c('0x7f'));}else{_0x1f3594['having'](_0xb77c('0x80'));}}if(_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x81')]){_0x535bb4=_[_0xb77c('0x82')](_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x81')])?_0x39bc2c['query'][_0xb77c('0x81')]:new Array(_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x81')]);_0x535bb4[_0xb77c('0x2f')](function(_0x59997c){_0x1c7d87['or'](_0xb77c('0x6b'),'%,'+_0x59997c+',%');});}if(_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x83')]){var _0x2460f0=_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x83')][_0xb77c('0x84')]('\x5c','\x5c\x5c')[_0xb77c('0x84')](/'/g,'\x27\x27');if(qs[_0xb77c('0x85')](_0x2460f0)){_0x3edb76['or']('i.id\x20LIKE\x20?',_0x2460f0+'%')['or'](_0xb77c('0x86'),_0x2460f0+'%');}else{_0x3edb76['or'](_0xb77c('0x87'),qs[_0xb77c('0x64')](_0x2460f0))['or'](_0xb77c('0x88'),_0x2460f0+'%');}}}_0x1f3594[_0xb77c('0x43')](_0x3edb76);_0x1f3594[_0xb77c('0x89')](_0xb77c('0x8a'));var _0x481930={'type':db[_0xb77c('0x8b')][_0xb77c('0x8c')][_0xb77c('0x8d')],'raw':!![]};var _0x4bba27=_0x1f3594[_0xb77c('0x8e')]();_0x4bba27['field'](_0xb77c('0x8a'));_0x4bba27[_0xb77c('0x46')](_0xb77c('0x8f'),_0xb77c('0x90'));if(_0x41975f[_0xb77c('0x41')]){_0x41975f['order'][_0xb77c('0x2f')](function(_0x513d9d){var _0xe46ee9=_0x513d9d[0x0]==='contactName'?_0x513d9d[0x0]:'i.'+_0x513d9d[0x0];_0x1f3594['order'](_0xe46ee9,_0x513d9d[0x1]===_0xb77c('0x91')?![]:!![]);});}if(!_['isEmpty'](_0x535bb4)){_0x1f3594[_0xb77c('0x5d')](_0x1c7d87);_0x4bba27[_0xb77c('0x43')](_0xb77c('0x92'),_0x535bb4);}BPromise[_0xb77c('0x93')]()[_0xb77c('0x26')](function(){if(!_0xd4a6df){if(_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x75')])return;_0x4bba27[_0xb77c('0x43')](_0xb77c('0x94'));_0x1f3594[_0xb77c('0x43')](_0xb77c('0x94'));return;}if(_0x39bc2c[_0xb77c('0x95')][_0xb77c('0x96')]!==_0xb77c('0x97'))return;return _0x39bc2c[_0xb77c('0x95')][_0xb77c('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0x31b56c){if(_[_0xb77c('0x74')](_0x31b56c)){_0x4bba27[_0xb77c('0x43')]('i.SmsAccountId\x20IS\x20NULL');_0x1f3594['where'](_0xb77c('0x99'));}else{_0x4bba27[_0xb77c('0x43')](_0xb77c('0x76'),_[_0xb77c('0x37')](_0x31b56c,'id'));_0x1f3594[_0xb77c('0x43')](_0xb77c('0x76'),_[_0xb77c('0x37')](_0x31b56c,'id'));}});})[_0xb77c('0x26')](function(){if(_0x39bc2c['user'][_0xb77c('0x96')]===_0xb77c('0x97')&&!_0xd4a6df&&!_0x39bc2c[_0xb77c('0x38')][_0xb77c('0x75')])return[];return db[_0xb77c('0x9a')][_0xb77c('0x38')](_0x4bba27['toString'](),_0x481930);})[_0xb77c('0x26')](function(_0x39ecdf){_0x421b3a[_0xb77c('0x22')]=_0x39ecdf[_0xb77c('0x3d')];if(_0x421b3a['count']===0x0)return[];return db[_0xb77c('0x9a')][_0xb77c('0x38')](_0x35028d['toString'](),_0x481930)[_0xb77c('0x26')](function(_0x2c05bb){_0x1d805f=_[_0xb77c('0x9b')](_0x2c05bb,'id');_0x481930=_[_0xb77c('0x9c')](_0x481930,{'model':db[_0xb77c('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39bc2c['query'][_0xb77c('0x3c')]){_0x41975f[_0xb77c('0x3b')][_0xb77c('0x2f')](function(_0x255cbd){_0x1f3594[_0xb77c('0x46')]('i.'+_0x255cbd);});}else{_0x1f3594[_0xb77c('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x1f3594[_0xb77c('0x46')](_0xb77c('0x9d'),_0xb77c('0x9e'));_0x1f3594['field'](_0xb77c('0x9f'),_0xb77c('0xa0'));_0x1f3594[_0xb77c('0x46')](_0xb77c('0xa1'),'contactName');_0x1f3594[_0xb77c('0x46')](_0xb77c('0xa2'));_0x1f3594['field'](_0xb77c('0xa3'),_0xb77c('0xa4'));_0x1f3594['field']('c.lastName',_0xb77c('0xa5'));_0x1f3594[_0xb77c('0x46')](_0xb77c('0xa6'),'Contact.email');_0x1f3594['field'](_0xb77c('0xa7'),'Contact.phone');_0x1f3594[_0xb77c('0x46')](_0xb77c('0xa8'),_0xb77c('0xa9'));_0x1f3594[_0xb77c('0x46')]('c.fax','Contact.fax');_0x1f3594[_0xb77c('0x46')]('o.fullname','Owner.fullname');_0x1f3594['field']('o.internal',_0xb77c('0xaa'));_0x1f3594[_0xb77c('0x46')](_0xb77c('0xab'),_0xb77c('0x2d'));}if(_0x41975f[_0xb77c('0x21')])_0x1f3594['limit'](_0x41975f[_0xb77c('0x21')]);if(_0x41975f['offset'])_0x1f3594['offset'](_0x41975f['offset']);return db[_0xb77c('0x9a')][_0xb77c('0x38')](_0x1f3594[_0xb77c('0xac')](),_0x481930);})[_0xb77c('0x26')](function(_0x232ea1){if(_0x232ea1[_0xb77c('0x3d')]>0x0)_0x2746f7['where'](_0xb77c('0xad'),_['map'](_0x232ea1,'id'));return db['sequelize'][_0xb77c('0x38')](_0x2746f7[_0xb77c('0xac')](),_0x481930)['then'](function(_0x5bb7a4){var _0x152522=_[_0xb77c('0xae')](_0x5bb7a4,_0xb77c('0xaf'));var _0x1bdcd9=[];_0x232ea1[_0xb77c('0x2f')](function(_0x48c8b8){_0x1bdcd9[_0xb77c('0x30')](updateSmsInteraction(_0x48c8b8,_0x1d805f,_0x152522));});return BPromise[_0xb77c('0xb0')](_0x1bdcd9);});});})[_0xb77c('0x26')](function(_0x23b91d){_0x421b3a[_0xb77c('0xb1')]=_0x23b91d;return _0x421b3a;})['then'](respondWithFilteredResult(_0x47fb12,_0x41975f))[_0xb77c('0x31')](handleError(_0x47fb12,null));};exports['show']=function(_0x41e9b5,_0x59e4d1){var _0x34507d={'raw':![],'where':{'id':_0x41e9b5['params']['id']}},_0x3c3135={};_0x3c3135['model']=_[_0xb77c('0x71')](db[_0xb77c('0x33')][_0xb77c('0xb2')]);_0x3c3135[_0xb77c('0x38')]=_[_0xb77c('0x71')](_0x41e9b5[_0xb77c('0x38')]);_0x3c3135[_0xb77c('0x39')]=_[_0xb77c('0x3a')](_0x3c3135['model'],_0x3c3135[_0xb77c('0x38')]);_0x34507d[_0xb77c('0x3b')]=_['intersection'](_0x3c3135[_0xb77c('0x36')],qs[_0xb77c('0x3c')](_0x41e9b5['query']['fields']));_0x34507d[_0xb77c('0x3b')]=_0x34507d[_0xb77c('0x3b')][_0xb77c('0x3d')]?_0x34507d[_0xb77c('0x3b')]:_0x3c3135[_0xb77c('0x36')];if(_0x41e9b5[_0xb77c('0x38')]['includeAll']){_0x34507d[_0xb77c('0xb3')]=[{'all':!![]}];}_0x34507d=_[_0xb77c('0x9c')]({},_0x34507d,_0x41e9b5[_0xb77c('0xb4')]);return db[_0xb77c('0x33')][_0xb77c('0x66')](_0x34507d)[_0xb77c('0x26')](handleEntityNotFound(_0x59e4d1,null))[_0xb77c('0x26')](respondWithResult(_0x59e4d1,null))[_0xb77c('0x31')](handleError(_0x59e4d1,null));};exports[_0xb77c('0xb5')]=function(_0x35b804,_0x358470){return db[_0xb77c('0x33')][_0xb77c('0xb5')](_0x35b804[_0xb77c('0xb6')],{})[_0xb77c('0x26')](respondWithResult(_0x358470,0xc9))[_0xb77c('0x31')](handleError(_0x358470,null));};exports['update']=function(_0x357fa9,_0x446db0){if(_0x357fa9['body']['id']){delete _0x357fa9[_0xb77c('0xb6')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x357fa9[_0xb77c('0xb7')]['id']}})[_0xb77c('0x26')](handleEntityNotFound(_0x446db0,null))['then'](saveUpdates(_0x357fa9[_0xb77c('0xb6')],null))[_0xb77c('0x26')](respondWithResult(_0x446db0,null))[_0xb77c('0x31')](handleError(_0x446db0,null));};exports['destroy']=function(_0x1a7fff,_0x302389){return db['SmsInteraction'][_0xb77c('0x66')]({'where':{'id':_0x1a7fff[_0xb77c('0xb7')]['id']}})['then'](handleEntityNotFound(_0x302389,null))[_0xb77c('0x26')](removeEntity(_0x302389,null))[_0xb77c('0x31')](handleError(_0x302389,null));};exports[_0xb77c('0xb8')]=function(_0xb429c4,_0x4af197){return db[_0xb77c('0x33')][_0xb77c('0xb8')]()[_0xb77c('0x26')](respondWithResult(_0x4af197,null))['catch'](handleError(_0x4af197,null));};exports[_0xb77c('0xb9')]=function(_0x1341c3,_0x2511e9,_0x5ca905){return db[_0xb77c('0xba')][_0xb77c('0x66')]({'where':{'id':_0x1341c3[_0xb77c('0xb7')]['id']}})['then'](handleEntityNotFound(_0x2511e9,null))[_0xb77c('0x26')](function(_0x44f399){if(_0x44f399){return _0x44f399[_0xb77c('0xb9')](_0x1341c3['body'][_0xb77c('0xbb')],_[_0xb77c('0xbc')](_0x1341c3['body'],[_0xb77c('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x2511e9,null))[_0xb77c('0x31')](handleError(_0x2511e9,null));};exports['getMessages']=function(_0x25a28c,_0x206897,_0x50095a){var _0x544917={'raw':![],'where':{}};var _0xc6de3c={};var _0x138e6f={'count':0x0,'rows':[]};return db[_0xb77c('0x33')][_0xb77c('0xbd')]({'where':{'id':_0x25a28c[_0xb77c('0xb7')]['id']}})[_0xb77c('0x26')](handleEntityNotFound(_0x206897,null))[_0xb77c('0x26')](function(_0x981221){if(_0x981221){_0xc6de3c[_0xb77c('0x36')]=_[_0xb77c('0x71')](db[_0xb77c('0xba')]['rawAttributes']);_0xc6de3c[_0xb77c('0x38')]=_[_0xb77c('0x71')](_0x25a28c[_0xb77c('0x38')]);_0xc6de3c[_0xb77c('0x39')]=_['intersection'](_0xc6de3c[_0xb77c('0x36')],_0xc6de3c[_0xb77c('0x38')]);_0x544917[_0xb77c('0x3b')]=_[_0xb77c('0x3a')](_0xc6de3c[_0xb77c('0x36')],qs[_0xb77c('0x3c')](_0x25a28c['query'][_0xb77c('0x3c')]));_0x544917[_0xb77c('0x3b')]=_0x544917[_0xb77c('0x3b')][_0xb77c('0x3d')]?_0x544917[_0xb77c('0x3b')]:_0xc6de3c['model'];if(!_0x25a28c[_0xb77c('0x38')]['hasOwnProperty'](_0xb77c('0x3f'))){_0x544917[_0xb77c('0x21')]=qs[_0xb77c('0x21')](_0x25a28c[_0xb77c('0x38')][_0xb77c('0x21')]);_0x544917[_0xb77c('0x40')]=qs[_0xb77c('0x40')](_0x25a28c['query'][_0xb77c('0x40')]);}_0x544917['order']=qs[_0xb77c('0x42')](_0x25a28c['query']['sort']);_0x544917['where']=qs['filters'](_[_0xb77c('0x44')](_0x25a28c['query'],_0xc6de3c[_0xb77c('0x39')]));_0x544917[_0xb77c('0x43')][_0xb77c('0xaf')]=_0x981221['id'];if(_0x25a28c['query'][_0xb77c('0x83')]){_0x544917[_0xb77c('0x43')]=_[_0xb77c('0x9c')](_0x544917[_0xb77c('0x43')],{'$or':_[_0xb77c('0x37')](_0x544917[_0xb77c('0x3b')],function(_0x3477c5){var _0x8c7c91={};_0x8c7c91[_0x3477c5]={'$like':'%'+_0x25a28c['query'][_0xb77c('0x83')]+'%'};return _0x8c7c91;})});}if(_0x25a28c[_0xb77c('0x38')][_0xb77c('0x78')]){var _0x5866ef=_0x25a28c[_0xb77c('0x38')][_0xb77c('0x78')][_0xb77c('0x2e')](',');var _0x8981e9={};_0x8981e9[_0x5866ef[0x0]]={'$gte':moment(_0x5866ef[0x1])[_0xb77c('0xbe')](_0xb77c('0xbf'))};_0x544917[_0xb77c('0x43')]=_[_0xb77c('0x9c')](_0x544917[_0xb77c('0x43')],_0x8981e9);}_0x544917=_['merge']({},_0x544917,_0x25a28c[_0xb77c('0xb4')]);return db['SmsMessage']['count']({'where':_0x544917['where']})['then'](function(_0x28d224){_0x138e6f[_0xb77c('0x22')]=_0x28d224;if(_0x25a28c[_0xb77c('0x38')][_0xb77c('0xc0')]){_0x544917[_0xb77c('0xb3')]=[{'all':!![]}];}return db['SmsMessage'][_0xb77c('0xc1')](_0x544917);})[_0xb77c('0x26')](function(_0x5d9ad0){_0x138e6f[_0xb77c('0xb1')]=_0x5d9ad0;return _0x138e6f;});}})[_0xb77c('0x26')](respondWithFilteredResult(_0x206897,_0x544917))['catch'](handleError(_0x206897,null));};exports[_0xb77c('0xc2')]=function(_0x111930,_0x4fdf7c,_0x24ac7a){return db[_0xb77c('0x33')][_0xb77c('0x66')]({'where':{'id':_0x111930['params']['id']}})[_0xb77c('0x26')](handleEntityNotFound(_0x4fdf7c,null))[_0xb77c('0x26')](function(_0x215816){if(_0x215816){return _0x215816[_0xb77c('0xc3')](_0x111930['body'][_0xb77c('0xbb')],_[_0xb77c('0xbc')](_0x111930[_0xb77c('0xb6')],[_0xb77c('0xbb'),'id'])||{})[_0xb77c('0xc4')](function(){return db[_0xb77c('0x6a')][_0xb77c('0xc1')]({'attributes':['id',_0xb77c('0x29'),_0xb77c('0x47')],'where':{'id':_0x111930[_0xb77c('0xb6')][_0xb77c('0xbb')]}});})[_0xb77c('0x26')](function(_0xf6f070){socket[_0xb77c('0xc5')](_0xb77c('0xc6'),{'id':Number(_0x111930['params']['id']),'tags':_0xf6f070||[]});return{'id':Number(_0x111930[_0xb77c('0xb7')]['id']),'tags':_0xf6f070||[]};});}})[_0xb77c('0x26')](respondWithResult(_0x4fdf7c,null))['catch'](handleError(_0x4fdf7c,null));};exports['removeTags']=function(_0x2c82cd,_0x4e7f13,_0x48d1aa){return db[_0xb77c('0x33')][_0xb77c('0x66')]({'where':{'id':_0x2c82cd[_0xb77c('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4e7f13,null))['then'](function(_0x161ee7){if(_0x161ee7){return _0x161ee7[_0xb77c('0xc7')](_0x2c82cd['query'][_0xb77c('0xbb')]);}})[_0xb77c('0x26')](respondWithStatusCode(_0x4e7f13,null))['catch'](handleError(_0x4e7f13,null));};exports[_0xb77c('0xc8')]=function(_0x337886,_0x25e1a9){var _0x1f7e2b=moment()['unix']()[_0xb77c('0xac')]();var _0x244d82=path[_0xb77c('0xc9')](config['root'],_0xb77c('0xca'),_0xb77c('0xcb'),_0xb77c('0xcc'));var _0x83fd9f=path[_0xb77c('0xc9')](config[_0xb77c('0xcd')],_0xb77c('0xca'),_0xb77c('0xcb'),_0xb77c('0xce'));var _0x385f19=path[_0xb77c('0xc9')](_0x244d82,_0x1f7e2b);var _0x196a68=util[_0xb77c('0xbe')]('transcript-%d-%s.zip',_0x337886[_0xb77c('0xb7')]['id'],_0x1f7e2b);var _0x1e1775=path[_0xb77c('0xc9')](_0x244d82,_0x196a68);var _0x5287d3=[];_0x5287d3[_0xb77c('0x30')]({'model':db[_0xb77c('0x6d')],'as':_0xb77c('0x6d'),'attributes':['id','fullname'],'raw':!![]});_0x5287d3[_0xb77c('0x30')]({'model':db[_0xb77c('0xcf')],'as':_0xb77c('0x60'),'attributes':['id',_0xb77c('0xd0'),_0xb77c('0xd1')],'raw':!![]});var _0x363f9b=[{'model':db[_0xb77c('0xba')],'as':'Messages','attributes':['id','body',_0xb77c('0x77'),'direction',_0xb77c('0xd2'),_0xb77c('0x7e')],'include':_0x5287d3}];_0x363f9b[_0xb77c('0x30')]({'model':db[_0xb77c('0xd3')],'as':_0xb77c('0xd4'),'attributes':['id',_0xb77c('0x29')]});_0x363f9b[_0xb77c('0x30')]({'model':db[_0xb77c('0x6d')],'as':_0xb77c('0xd5'),'attributes':['id',_0xb77c('0x2c')]});return db[_0xb77c('0x33')][_0xb77c('0x66')]({'where':{'id':_0x337886['params']['id']},'include':_0x363f9b})[_0xb77c('0x26')](handleEntityNotFound(_0x25e1a9,null))[_0xb77c('0x26')](function(_0x5d961b){if(_0x5d961b){var _0x1b4188=_0x5d961b[_0xb77c('0xd6')]({'plain':!![]});fs[_0xb77c('0xd7')](_0x385f19);var _0x3b54c3={'channel':_0xb77c('0xd8'),'account':_0x1b4188['Account'][_0xb77c('0x29')],'agent':_0x1b4188[_0xb77c('0xd5')]?_0x1b4188[_0xb77c('0xd5')]['fullname']:_0xb77c('0xd9'),'createdAt':moment(_0x1b4188[_0xb77c('0x77')])[_0xb77c('0xbe')](_0xb77c('0xbf'))['toString'](),'closedAt':_0x1b4188[_0xb77c('0xda')]?moment(_0x1b4188[_0xb77c('0xdb')])[_0xb77c('0xbe')](_0xb77c('0xbf'))['toString']():'','disposition':_0x1b4188[_0xb77c('0xdc')],'messages':_(_0x1b4188[_0xb77c('0xdd')])['filter']({'secret':![]})['map'](function(_0x1d38e0){return{'date':moment(_0x1d38e0[_0xb77c('0x77')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x1d38e0['direction']===_0xb77c('0xde')?_0x1d38e0['User']?_0x1d38e0[_0xb77c('0x6d')][_0xb77c('0x2c')]:'System':_0x1d38e0[_0xb77c('0x60')][_0xb77c('0xd0')]+(_0x1d38e0[_0xb77c('0x60')][_0xb77c('0xd1')]?'\x20'+_0x1d38e0[_0xb77c('0x60')][_0xb77c('0xd1')]:''),'body':_0x1d38e0[_0xb77c('0xb6')],'direction':_0x1d38e0[_0xb77c('0xdf')]===_0xb77c('0xde')?'A':'C','secret':_0x1d38e0[_0xb77c('0xd2')],'read':_0x1d38e0[_0xb77c('0x7e')]};})['value']()};return ejs[_0xb77c('0xe0')](path[_0xb77c('0xc9')](config[_0xb77c('0xcd')],_0xb77c('0xca'),_0xb77c('0xe1'),_0xb77c('0xe2')),{'interaction':_0x3b54c3})[_0xb77c('0x26')](function(_0x1f2b1a){var _0x2d6835=path['join'](_0x385f19,'transcript-'+_0x1b4188['id']+'-'+_0x1f7e2b+_0xb77c('0xe3'));var _0x5b1f7b={'path':_0x2d6835,'channel':_0xb77c('0xd8'),'interactionId':_0x1b4188['id']};return pdf[_0xb77c('0xe4')](_0x1f2b1a,_0x5b1f7b);})[_0xb77c('0x26')](function(){return new BPromise(function(_0x40f96e,_0x42c48e){zipdir(_0x385f19,{'saveTo':_0x1e1775},function(_0x301818,_0x5cf297){if(_0x301818)return _0x42c48e(_0x301818);return _0x40f96e(_0x5cf297);});})[_0xb77c('0x26')](function(){return new BPromise(function(_0xbc5729,_0x4435f0){rimraf(_0x385f19,function(_0xec96eb){if(_0xec96eb)_0x4435f0(_0xec96eb);return _0xbc5729();});});})['then'](function(){return _0x25e1a9['download'](_0x1e1775,_0x196a68,function(_0xb9e98d){if(_0xb9e98d){console[_0xb77c('0xe5')](_0xb77c('0xe6'),_0xb9e98d);}else{fs[_0xb77c('0xe7')](_0x1e1775);}});});});}else{return _0x25e1a9[_0xb77c('0x1d')](0xc8);}})[_0xb77c('0x31')](handleError(_0x25e1a9,null));};
\ No newline at end of file
index d694063..2364e80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x958a=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users'];(function(_0x1e8f58,_0x50b404){var _0x129085=function(_0x5c41c7){while(--_0x5c41c7){_0x1e8f58['push'](_0x1e8f58['shift']());}};_0x129085(++_0x50b404);}(_0x958a,0x128));var _0xa958=function(_0x234ef7,_0x2c8e03){_0x234ef7=_0x234ef7-0x0;var _0x56b304=_0x958a[_0x234ef7];return _0x56b304;};'use strict';var EventEmitter=require(_0xa958('0x0'));var SmsInteraction=require(_0xa958('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xa958('0x1'))['db'][_0xa958('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa958('0x3')](0x0);var events={'afterCreate':_0xa958('0x4'),'afterUpdate':_0xa958('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3424b0){return function(_0x578481,_0x2024b8,_0x9b7d9e){_0x578481[_0xa958('0x6')]({'attributes':['id'],'raw':!![]})[_0xa958('0x7')](function(_0x3ca01f){_0x578481[_0xa958('0x8')](_0xa958('0x9'),_0x3ca01f['map'](function(_0x514b4f){return{'id':_0x514b4f['id']};}));return SmsMessage[_0xa958('0xa')]({'where':{'SmsInteractionId':_0x578481['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa958('0x7')](function(_0x11f090){_0x578481[_0xa958('0x8')](_0xa958('0xb'),_0x11f090[_0xa958('0xc')]);SmsInteractionEvents[_0xa958('0xd')](_0x3424b0+':'+_0x578481['id'],_0x578481);SmsInteractionEvents[_0xa958('0xd')](_0x3424b0,_0x578481);_0x9b7d9e(null);})[_0xa958('0xe')](_0x9b7d9e(null));};}for(var e in events){if(events[_0xa958('0xf')](e)){var event=events[e];SmsInteraction[_0xa958('0x10')](e,emitEvent(event));}}module[_0xa958('0x11')]=SmsInteractionEvents;
\ No newline at end of file
+var _0xb78e=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook'];(function(_0x111a53,_0x106aa2){var _0x2d560a=function(_0x592377){while(--_0x592377){_0x111a53['push'](_0x111a53['shift']());}};_0x2d560a(++_0x106aa2);}(_0xb78e,0x1c9));var _0xeb78=function(_0x3c1a3b,_0x228226){_0x3c1a3b=_0x3c1a3b-0x0;var _0x1fab26=_0xb78e[_0x3c1a3b];return _0x1fab26;};'use strict';var EventEmitter=require(_0xeb78('0x0'));var SmsInteraction=require(_0xeb78('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xeb78('0x1'))['db'][_0xeb78('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xeb78('0x3')](0x0);var events={'afterCreate':_0xeb78('0x4'),'afterUpdate':_0xeb78('0x5'),'afterDestroy':_0xeb78('0x6')};function emitEvent(_0x13ef9d){return function(_0x1bdf83,_0x57ec6b,_0x3c35e7){_0x1bdf83[_0xeb78('0x7')]({'attributes':['id'],'raw':!![]})[_0xeb78('0x8')](function(_0x30c884){_0x1bdf83[_0xeb78('0x9')](_0xeb78('0xa'),_0x30c884[_0xeb78('0xb')](function(_0x573406){return{'id':_0x573406['id']};}));return SmsMessage[_0xeb78('0xc')]({'where':{'SmsInteractionId':_0x1bdf83['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb78('0x8')](function(_0xa1ca82){_0x1bdf83[_0xeb78('0x9')](_0xeb78('0xd'),_0xa1ca82[_0xeb78('0xe')]);SmsInteractionEvents[_0xeb78('0xf')](_0x13ef9d+':'+_0x1bdf83['id'],_0x1bdf83);SmsInteractionEvents[_0xeb78('0xf')](_0x13ef9d,_0x1bdf83);_0x3c35e7(null);})[_0xeb78('0x10')](_0x3c35e7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xeb78('0x11')](e,emitEvent(event));}}module[_0xeb78('0x12')]=SmsInteractionEvents;
\ No newline at end of file
index 704c050..dffb3ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e47=['define','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./smsInteraction.attributes'];(function(_0x1e9cda,_0x3b3ffc){var _0x238e6a=function(_0x3979e4){while(--_0x3979e4){_0x1e9cda['push'](_0x1e9cda['shift']());}};_0x238e6a(++_0x3b3ffc);}(_0x8e47,0x8e));var _0x78e4=function(_0x58521c,_0xe5b828){_0x58521c=_0x58521c-0x0;var _0x14d891=_0x8e47[_0x58521c];return _0x14d891;};'use strict';var _=require('lodash');var util=require(_0x78e4('0x0'));var logger=require(_0x78e4('0x1'))(_0x78e4('0x2'));var moment=require(_0x78e4('0x3'));var BPromise=require(_0x78e4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78e4('0x5'));var rimraf=require('rimraf');var config=require(_0x78e4('0x6'));var attributes=require(_0x78e4('0x7'));module['exports']=function(_0x304469,_0x3ceb45){return _0x304469[_0x78e4('0x8')](_0x78e4('0x9'),attributes,{'tableName':_0x78e4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22c07c,_0x3101fa,_0x14982c){if(_0x22c07c[_0x78e4('0xb')](_0x78e4('0xc'))){_0x22c07c['closedAt']=moment()[_0x78e4('0xd')](_0x78e4('0xe'));}_0x14982c(null,_0x22c07c);}}});};
\ No newline at end of file
+var _0x8b4c=['moment','bluebird','path','define','SmsInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0x29891b,_0x4ed0c1){var _0xedb980=function(_0x2e670d){while(--_0x2e670d){_0x29891b['push'](_0x29891b['shift']());}};_0xedb980(++_0x4ed0c1);}(_0x8b4c,0x17d));var _0xc8b4=function(_0x1c0fc3,_0x3537bb){_0x1c0fc3=_0x1c0fc3-0x0;var _0x338237=_0x8b4c[_0x1c0fc3];return _0x338237;};'use strict';var _=require(_0xc8b4('0x0'));var util=require('util');var logger=require(_0xc8b4('0x1'))(_0xc8b4('0x2'));var moment=require(_0xc8b4('0x3'));var BPromise=require(_0xc8b4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8b4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x6b254d,_0x45c7ce){return _0x6b254d[_0xc8b4('0x6')](_0xc8b4('0x7'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4923fd,_0x372c20,_0x2e4cc0){if(_0x4923fd['changed'](_0xc8b4('0x8'))){_0x4923fd[_0xc8b4('0x9')]=moment()[_0xc8b4('0xa')](_0xc8b4('0xb'));}_0x2e4cc0(null,_0x4923fd);}}});};
\ No newline at end of file
index 8aeb070..2e90d17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x282a=['omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsInteraction','body','options','raw','attributes','limit','then','UpdateSmsInteraction','find','where','ids'];(function(_0x4c7a2b,_0x270a23){var _0x8cb5aa=function(_0xab2f02){while(--_0xab2f02){_0x4c7a2b['push'](_0x4c7a2b['shift']());}};_0x8cb5aa(++_0x270a23);}(_0x282a,0x81));var _0xa282=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x282a[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xa282('0x0'));var util=require(_0xa282('0x1'));var moment=require('moment');var BPromise=require(_0xa282('0x2'));var rs=require(_0xa282('0x3'));var fs=require('fs');var Redis=require(_0xa282('0x4'));var db=require(_0xa282('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa282('0x6'))(_0xa282('0x7'));var config=require(_0xa282('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa282('0x9')]['http']({'port':0x232a});config[_0xa282('0xa')]=_[_0xa282('0xb')](config['redis'],{'host':_0xa282('0xc'),'port':0x18eb});var socket=require(_0xa282('0xd'))(new Redis(config[_0xa282('0xa')]));require(_0xa282('0xe'))[_0xa282('0xf')](socket);function respondWithRpcPromise(_0x30abfd,_0x4289cd,_0x584185){return new BPromise(function(_0x55fa3b,_0x15b462){return client[_0xa282('0x10')](_0x30abfd,_0x584185)['then'](function(_0x584a30){logger['info'](_0xa282('0x11'),_0x4289cd,_0xa282('0x12'));logger[_0xa282('0x13')](_0xa282('0x14'),_0x4289cd,_0xa282('0x12'),JSON[_0xa282('0x15')](_0x584a30));if(_0x584a30[_0xa282('0x16')]){if(_0x584a30['error'][_0xa282('0x17')]===0x1f4){logger[_0xa282('0x16')](_0xa282('0x11'),_0x4289cd,_0x584a30[_0xa282('0x16')]['message']);return _0x15b462(_0x584a30['error'][_0xa282('0x18')]);}logger[_0xa282('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x4289cd,_0x584a30[_0xa282('0x16')][_0xa282('0x18')]);return _0x55fa3b(_0x584a30[_0xa282('0x16')][_0xa282('0x18')]);}else{logger[_0xa282('0x19')](_0xa282('0x11'),_0x4289cd,'request\x20sent');_0x55fa3b(_0x584a30[_0xa282('0x1a')]['message']);}})[_0xa282('0x1b')](function(_0x5b0ccf){logger[_0xa282('0x16')](_0xa282('0x11'),_0x4289cd,_0x5b0ccf);_0x15b462(_0x5b0ccf);});});}exports['UpdateSmsInteraction']=function(_0x4ba254){var _0x51ebf2=this;return new Promise(function(_0x372cd9,_0x5519a2){return db[_0xa282('0x1c')]['update'](_0x4ba254[_0xa282('0x1d')],{'raw':_0x4ba254[_0xa282('0x1e')]?_0x4ba254[_0xa282('0x1e')][_0xa282('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ba254[_0xa282('0x1e')]?_0x4ba254[_0xa282('0x1e')]['where']||null:null,'attributes':_0x4ba254[_0xa282('0x1e')]?_0x4ba254[_0xa282('0x1e')][_0xa282('0x20')]||null:null,'limit':_0x4ba254[_0xa282('0x1e')]?_0x4ba254[_0xa282('0x1e')][_0xa282('0x21')]||null:null})[_0xa282('0x22')](function(_0x23384f){logger[_0xa282('0x19')](_0xa282('0x23'),_0x4ba254);logger[_0xa282('0x13')]('UpdateSmsInteraction',_0x4ba254,JSON[_0xa282('0x15')](_0x23384f));_0x372cd9(_0x23384f);})[_0xa282('0x1b')](function(_0x1a3f0a){logger[_0xa282('0x16')](_0xa282('0x23'),_0x1a3f0a['message'],_0x4ba254);_0x5519a2(_0x51ebf2[_0xa282('0x16')](0x1f4,_0x1a3f0a['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x158853){return new Promise(function(_0x448066,_0x55b573){return db[_0xa282('0x1c')][_0xa282('0x24')]({'where':_0x158853[_0xa282('0x1e')]?_0x158853[_0xa282('0x1e')][_0xa282('0x25')]||null:null})[_0xa282('0x22')](function(_0x4fb24b){if(_0x4fb24b){return _0x4fb24b['addTags'](_0x158853[_0xa282('0x1d')][_0xa282('0x26')],_[_0xa282('0x27')](_0x158853[_0xa282('0x1d')],[_0xa282('0x26'),'id'])||{});}})[_0xa282('0x28')](function(_0x586492){logger['info']('AddTags',_0x158853);logger[_0xa282('0x13')]('AddTags',_0x158853,JSON[_0xa282('0x15')](_0x586492));_0x448066(_0x586492);})[_0xa282('0x1b')](function(_0x2bbe71){logger['error'](_0xa282('0x29'),_0x2bbe71['message'],_0x158853);_0x55b573(_this[_0xa282('0x16')](0x1f4,_0x2bbe71['message']));});});};
\ No newline at end of file
+var _0x6e68=['ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','then','addTags','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6e68,0x1bc));var _0x86e6=function(_0x465ed8,_0x2be2ac){_0x465ed8=_0x465ed8-0x0;var _0xcb088d=_0x6e68[_0x465ed8];return _0xcb088d;};'use strict';var _=require(_0x86e6('0x0'));var util=require(_0x86e6('0x1'));var moment=require(_0x86e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x86e6('0x3'));var fs=require('fs');var Redis=require(_0x86e6('0x4'));var db=require(_0x86e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x86e6('0x6'))(_0x86e6('0x7'));var config=require('../../config/environment');var jayson=require(_0x86e6('0x8'));var client=jayson[_0x86e6('0x9')][_0x86e6('0xa')]({'port':0x232a});config[_0x86e6('0xb')]=_[_0x86e6('0xc')](config['redis'],{'host':_0x86e6('0xd'),'port':0x18eb});var socket=require(_0x86e6('0xe'))(new Redis(config['redis']));require(_0x86e6('0xf'))['register'](socket);function respondWithRpcPromise(_0x495271,_0xc1b5ce,_0x27a379){return new BPromise(function(_0x3824ea,_0x4185f2){return client[_0x86e6('0x10')](_0x495271,_0x27a379)['then'](function(_0x16d924){logger[_0x86e6('0x11')](_0x86e6('0x12'),_0xc1b5ce,_0x86e6('0x13'));logger[_0x86e6('0x14')](_0x86e6('0x15'),_0xc1b5ce,'request\x20sent',JSON[_0x86e6('0x16')](_0x16d924));if(_0x16d924[_0x86e6('0x17')]){if(_0x16d924['error'][_0x86e6('0x18')]===0x1f4){logger['error'](_0x86e6('0x12'),_0xc1b5ce,_0x16d924['error'][_0x86e6('0x19')]);return _0x4185f2(_0x16d924[_0x86e6('0x17')][_0x86e6('0x19')]);}logger[_0x86e6('0x17')]('SmsInteraction,\x20%s,\x20%s',_0xc1b5ce,_0x16d924[_0x86e6('0x17')][_0x86e6('0x19')]);return _0x3824ea(_0x16d924[_0x86e6('0x17')][_0x86e6('0x19')]);}else{logger['info'](_0x86e6('0x12'),_0xc1b5ce,_0x86e6('0x13'));_0x3824ea(_0x16d924['result'][_0x86e6('0x19')]);}})[_0x86e6('0x1a')](function(_0xc3d46){logger[_0x86e6('0x17')](_0x86e6('0x12'),_0xc1b5ce,_0xc3d46);_0x4185f2(_0xc3d46);});});}exports[_0x86e6('0x1b')]=function(_0x2b7272){var _0x3f0c2c=this;return new Promise(function(_0x1b4cc6,_0x14e4d3){return db[_0x86e6('0x1c')][_0x86e6('0x1d')](_0x2b7272['body'],{'raw':_0x2b7272[_0x86e6('0x1e')]?_0x2b7272[_0x86e6('0x1e')][_0x86e6('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b7272[_0x86e6('0x1e')]?_0x2b7272[_0x86e6('0x1e')][_0x86e6('0x20')]||null:null,'attributes':_0x2b7272['options']?_0x2b7272['options'][_0x86e6('0x21')]||null:null,'limit':_0x2b7272['options']?_0x2b7272[_0x86e6('0x1e')][_0x86e6('0x22')]||null:null})['then'](function(_0x1e5fd0){logger[_0x86e6('0x11')](_0x86e6('0x1b'),_0x2b7272);logger[_0x86e6('0x14')](_0x86e6('0x1b'),_0x2b7272,JSON[_0x86e6('0x16')](_0x1e5fd0));_0x1b4cc6(_0x1e5fd0);})[_0x86e6('0x1a')](function(_0xddda1){logger[_0x86e6('0x17')](_0x86e6('0x1b'),_0xddda1[_0x86e6('0x19')],_0x2b7272);_0x14e4d3(_0x3f0c2c[_0x86e6('0x17')](0x1f4,_0xddda1[_0x86e6('0x19')]));});});};exports[_0x86e6('0x23')]=function(_0x43110d){return new Promise(function(_0x1f69b0,_0x2976d2){return db['SmsInteraction'][_0x86e6('0x24')]({'where':_0x43110d[_0x86e6('0x1e')]?_0x43110d['options'][_0x86e6('0x20')]||null:null})[_0x86e6('0x25')](function(_0x2d781f){if(_0x2d781f){return _0x2d781f[_0x86e6('0x26')](_0x43110d[_0x86e6('0x27')][_0x86e6('0x28')],_[_0x86e6('0x29')](_0x43110d[_0x86e6('0x27')],[_0x86e6('0x28'),'id'])||{});}})[_0x86e6('0x2a')](function(_0x24c5f9){logger[_0x86e6('0x11')]('AddTags',_0x43110d);logger[_0x86e6('0x14')](_0x86e6('0x2b'),_0x43110d,JSON[_0x86e6('0x16')](_0x24c5f9));_0x1f69b0(_0x24c5f9);})[_0x86e6('0x1a')](function(_0x33adb6){logger[_0x86e6('0x17')]('AddTags',_0x33adb6[_0x86e6('0x19')],_0x43110d);_0x2976d2(_this[_0x86e6('0x17')](0x1f4,_0x33adb6[_0x86e6('0x19')]));});});};
\ No newline at end of file
index 78e8320..5cc3e95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf229=['removeListener','register','length','remove','update'];(function(_0x112f43,_0x24c518){var _0x1878d4=function(_0x273d69){while(--_0x273d69){_0x112f43['push'](_0x112f43['shift']());}};_0x1878d4(++_0x24c518);}(_0xf229,0x166));var _0x9f22=function(_0x795460,_0x3b5e96){_0x795460=_0x795460-0x0;var _0x1c85d0=_0xf229[_0x795460];return _0x1c85d0;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0x9f22('0x0'),_0x9f22('0x1')];function createListener(_0x5abb5e,_0x4e7123){return function(_0x29d458){_0x4e7123['emit'](_0x5abb5e,_0x29d458);};}function removeListener(_0x2239d1,_0x4516f3){return function(){SmsInteractionEvents[_0x9f22('0x2')](_0x2239d1,_0x4516f3);};}exports[_0x9f22('0x3')]=function(_0x22b0ea){for(var _0x2c6cc9=0x0,_0x2a3796=events[_0x9f22('0x4')];_0x2c6cc9<_0x2a3796;_0x2c6cc9++){var _0x33f38f=events[_0x2c6cc9];var _0x33adfb=createListener('smsInteraction:'+_0x33f38f,_0x22b0ea);SmsInteractionEvents['on'](_0x33f38f,_0x33adfb);}};
\ No newline at end of file
+var _0x1904=['length','smsInteraction:','./smsInteraction.events','save','remove','update','emit','removeListener'];(function(_0x296289,_0x48a853){var _0x496eb5=function(_0x12a337){while(--_0x12a337){_0x296289['push'](_0x296289['shift']());}};_0x496eb5(++_0x48a853);}(_0x1904,0x72));var _0x4190=function(_0x3b902b,_0x5ace7d){_0x3b902b=_0x3b902b-0x0;var _0x268647=_0x1904[_0x3b902b];return _0x268647;};'use strict';var SmsInteractionEvents=require(_0x4190('0x0'));var events=[_0x4190('0x1'),_0x4190('0x2'),_0x4190('0x3')];function createListener(_0x243d5c,_0x2ceea1){return function(_0x118191){_0x2ceea1[_0x4190('0x4')](_0x243d5c,_0x118191);};}function removeListener(_0x454994,_0x49ac0e){return function(){SmsInteractionEvents[_0x4190('0x5')](_0x454994,_0x49ac0e);};}exports['register']=function(_0x537179){for(var _0x4df24f=0x0,_0x214307=events[_0x4190('0x6')];_0x4df24f<_0x214307;_0x4df24f++){var _0x328861=events[_0x4df24f];var _0x49d6db=createListener(_0x4190('0x7')+_0x328861,_0x537179);SmsInteractionEvents['on'](_0x328861,_0x49d6db);}};
\ No newline at end of file
index 3a1f69f..3ec16a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2b1=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','smsmessage:create','create','status','put','/:id/accept','/:id/reject','reject','delete','exports','multer','util','path','express'];(function(_0x445dc4,_0x3764da){var _0x19f060=function(_0x2fcf6f){while(--_0x2fcf6f){_0x445dc4['push'](_0x445dc4['shift']());}};_0x19f060(++_0x3764da);}(_0xa2b1,0x184));var _0x1a2b=function(_0x3b6e77,_0x12f7fc){_0x3b6e77=_0x3b6e77-0x0;var _0x44c6f5=_0xa2b1[_0x3b6e77];return _0x44c6f5;};'use strict';var multer=require(_0x1a2b('0x0'));var util=require(_0x1a2b('0x1'));var path=require(_0x1a2b('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a2b('0x3'));var router=express[_0x1a2b('0x4')]();var fs_extra=require(_0x1a2b('0x5'));var auth=require(_0x1a2b('0x6'));var interaction=require(_0x1a2b('0x7'));var config=require(_0x1a2b('0x8'));var controller=require(_0x1a2b('0x9'));router['get']('/',auth[_0x1a2b('0xa')](),controller[_0x1a2b('0xb')]);router[_0x1a2b('0xc')](_0x1a2b('0xd'),auth['isAuthenticated'](),controller[_0x1a2b('0xe')]);router[_0x1a2b('0xc')](_0x1a2b('0xf'),auth['isAuthenticated'](),controller[_0x1a2b('0x10')]);router[_0x1a2b('0x11')]('/',auth['isAuthenticated'](),interaction[_0x1a2b('0x12')]('sms',_0x1a2b('0x13')),controller[_0x1a2b('0x14')]);router[_0x1a2b('0x11')]('/:id/status',controller[_0x1a2b('0x15')]);router['put'](_0x1a2b('0xf'),auth[_0x1a2b('0xa')](),controller['update']);router[_0x1a2b('0x16')](_0x1a2b('0x17'),auth[_0x1a2b('0xa')](),controller['accept']);router['put'](_0x1a2b('0x18'),auth['isAuthenticated'](),controller[_0x1a2b('0x19')]);router[_0x1a2b('0x1a')](_0x1a2b('0xf'),auth[_0x1a2b('0xa')](),controller['destroy']);module[_0x1a2b('0x1b')]=router;
\ No newline at end of file
+var _0x3ad1=['post','smsmessage:create','create','status','put','update','/:id/accept','accept','reject','delete','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x3ad1,0x11e));var _0x13ad=function(_0x3c88be,_0x40ae3f){_0x3c88be=_0x3c88be-0x0;var _0x4d4264=_0x3ad1[_0x3c88be];return _0x4d4264;};'use strict';var multer=require(_0x13ad('0x0'));var util=require(_0x13ad('0x1'));var path=require('path');var timeout=require(_0x13ad('0x2'));var express=require(_0x13ad('0x3'));var router=express[_0x13ad('0x4')]();var fs_extra=require(_0x13ad('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13ad('0x6'));var controller=require(_0x13ad('0x7'));router[_0x13ad('0x8')]('/',auth[_0x13ad('0x9')](),controller[_0x13ad('0xa')]);router['get']('/describe',auth[_0x13ad('0x9')](),controller['describe']);router[_0x13ad('0x8')](_0x13ad('0xb'),auth['isAuthenticated'](),controller[_0x13ad('0xc')]);router[_0x13ad('0xd')]('/',auth[_0x13ad('0x9')](),interaction['tracked']('sms',_0x13ad('0xe')),controller[_0x13ad('0xf')]);router[_0x13ad('0xd')]('/:id/status',controller[_0x13ad('0x10')]);router[_0x13ad('0x11')](_0x13ad('0xb'),auth[_0x13ad('0x9')](),controller[_0x13ad('0x12')]);router[_0x13ad('0x11')](_0x13ad('0x13'),auth[_0x13ad('0x9')](),controller[_0x13ad('0x14')]);router[_0x13ad('0x11')]('/:id/reject',auth[_0x13ad('0x9')](),controller[_0x13ad('0x15')]);router[_0x13ad('0x16')]('/:id',auth[_0x13ad('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 6831c7e..564d667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e68=['TEXT','sequelize','medium','ENUM','out','STRING','DATE'];(function(_0x558674,_0x23104e){var _0x27b36b=function(_0x3251b7){while(--_0x3251b7){_0x558674['push'](_0x558674['shift']());}};_0x27b36b(++_0x23104e);}(_0x3e68,0x190));var _0x83e6=function(_0x4107c5,_0xc8f22e){_0x4107c5=_0x4107c5-0x0;var _0x31b5e8=_0x3e68[_0x4107c5];return _0x31b5e8;};'use strict';var Sequelize=require(_0x83e6('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x83e6('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x83e6('0x2')]('in',_0x83e6('0x3')),'defaultValue':_0x83e6('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x83e6('0x4')](0xbe)},'phone':{'type':Sequelize[_0x83e6('0x4')]},'readAt':{'type':Sequelize[_0x83e6('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x83e6('0x4')]},'providerResponse':{'type':Sequelize[_0x83e6('0x6')]}};
\ No newline at end of file
+var _0x4a93=['exports','ENUM','out','STRING','BOOLEAN','TEXT','sequelize'];(function(_0x5c6b9a,_0x3ff453){var _0xa5c6d8=function(_0x4633ef){while(--_0x4633ef){_0x5c6b9a['push'](_0x5c6b9a['shift']());}};_0xa5c6d8(++_0x3ff453);}(_0x4a93,0x1bf));var _0x34a9=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x4a93[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require(_0x34a9('0x0'));module[_0x34a9('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x34a9('0x2')]('in','out'),'defaultValue':_0x34a9('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x34a9('0x4')](0xbe)},'phone':{'type':Sequelize[_0x34a9('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x34a9('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x34a9('0x4')]},'providerResponse':{'type':Sequelize[_0x34a9('0x6')]}};
\ No newline at end of file
index e28f87e..b642eca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x166c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','jayson/promise','client','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','name','index','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','map','options','includeAll','include','SmsMessage','findAll','rows','show','find','create','body','params','describe','../../config/logger','sms','read','readAt','format','UserId','user','get','SmsInteraction','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','User','agent','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x398d1b,_0x50852c){var _0x159a64=function(_0x3893cd){while(--_0x3893cd){_0x398d1b['push'](_0x398d1b['shift']());}};_0x159a64(++_0x50852c);}(_0x166c,0x19e));var _0xc166=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x166c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xc166('0x0'));var rimraf=require(_0xc166('0x1'));var zipdir=require(_0xc166('0x2'));var jsonpatch=require(_0xc166('0x3'));var rp=require('request-promise');var moment=require(_0xc166('0x4'));var BPromise=require(_0xc166('0x5'));var Mustache=require(_0xc166('0x6'));var util=require(_0xc166('0x7'));var path=require(_0xc166('0x8'));var sox=require('sox');var csv=require(_0xc166('0x9'));var ejs=require(_0xc166('0xa'));var fs=require('fs');var fs_extra=require(_0xc166('0xb'));var _=require(_0xc166('0xc'));var squel=require('squel');var crypto=require(_0xc166('0xd'));var jsforce=require(_0xc166('0xe'));var deskjs=require(_0xc166('0xf'));var toCsv=require(_0xc166('0x9'));var querystring=require(_0xc166('0x10'));var Papa=require(_0xc166('0x11'));var Redis=require(_0xc166('0x12'));var authService=require(_0xc166('0x13'));var qs=require(_0xc166('0x14'));var as=require(_0xc166('0x15'));var hardwareService=require(_0xc166('0x16'));var logger=require('../../config/logger')(_0xc166('0x17'));var utils=require(_0xc166('0x18'));var config=require(_0xc166('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xc166('0x1a')](config['redis'],{'host':_0xc166('0x1b'),'port':0x18eb});var socket=require(_0xc166('0x1c'))(new Redis(config[_0xc166('0x1d')]));require(_0xc166('0x1e'))['register'](socket);var jayson=require(_0xc166('0x1f'));var client=jayson[_0xc166('0x20')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x438ce3,_0x521a0b,_0x1384f2,_0x59cb54){return new BPromise(function(_0x417401,_0x1a74be){var _0x2d5b79=_0x59cb54||client;return _0x2d5b79['request'](_0x438ce3,_0x1384f2)[_0xc166('0x21')](function(_0x3af326){logger[_0xc166('0x22')](_0xc166('0x23'),_0x521a0b,'request\x20sent');logger[_0xc166('0x24')](_0xc166('0x25'),_0x521a0b,_0xc166('0x26'),JSON[_0xc166('0x27')](_0x3af326));if(_0x3af326[_0xc166('0x28')]){if(_0x3af326[_0xc166('0x28')][_0xc166('0x29')]===0x1f4){logger[_0xc166('0x28')](_0xc166('0x23'),_0x521a0b,_0x3af326[_0xc166('0x28')][_0xc166('0x2a')]);return _0x1a74be(_0x3af326[_0xc166('0x28')][_0xc166('0x2a')]);}logger['error'](_0xc166('0x23'),_0x521a0b,_0x3af326[_0xc166('0x28')][_0xc166('0x2a')]);return _0x417401(_0x3af326[_0xc166('0x28')][_0xc166('0x2a')]);}else{logger[_0xc166('0x22')]('SmsMessage,\x20%s,\x20%s',_0x521a0b,'request\x20sent');_0x417401(_0x3af326[_0xc166('0x2b')]['message']);}})[_0xc166('0x2c')](function(_0x36f2c7){logger[_0xc166('0x28')](_0xc166('0x23'),_0x521a0b,_0x36f2c7);_0x1a74be(_0x36f2c7);});});}function respondWithStatusCode(_0x2750f9,_0x178b85){_0x178b85=_0x178b85||0xcc;return function(_0x175d75){if(_0x175d75){return _0x2750f9[_0xc166('0x2d')](_0x178b85);}return _0x2750f9['status'](_0x178b85)[_0xc166('0x2e')]();};}function respondWithResult(_0x249ad7,_0x168d49){_0x168d49=_0x168d49||0xc8;return function(_0x5c2adf){if(_0x5c2adf){return _0x249ad7[_0xc166('0x2f')](_0x168d49)['json'](_0x5c2adf);}};}function respondWithFilteredResult(_0x33bafd,_0x3f8a2a){return function(_0x4c5d27){if(_0x4c5d27){var _0x5a2b09=typeof _0x3f8a2a[_0xc166('0x30')]===_0xc166('0x31')&&typeof _0x3f8a2a[_0xc166('0x32')]===_0xc166('0x31');var _0x353352=_0x4c5d27['count'];var _0x3b30a1=_0x5a2b09?0x0:_0x3f8a2a[_0xc166('0x30')];var _0x1175e5=_0x5a2b09?_0x4c5d27[_0xc166('0x33')]:_0x3f8a2a[_0xc166('0x30')]+_0x3f8a2a[_0xc166('0x32')];var _0x447d90;if(_0x1175e5>=_0x353352){_0x1175e5=_0x353352;_0x447d90=0xc8;}else{_0x447d90=0xce;}_0x33bafd[_0xc166('0x2f')](_0x447d90);return _0x33bafd[_0xc166('0x34')](_0xc166('0x35'),_0x3b30a1+'-'+_0x1175e5+'/'+_0x353352)[_0xc166('0x36')](_0x4c5d27);}return null;};}function patchUpdates(_0x234092){return function(_0x3a0de3){try{jsonpatch[_0xc166('0x37')](_0x3a0de3,_0x234092,!![]);}catch(_0x4ebe32){return BPromise[_0xc166('0x38')](_0x4ebe32);}return _0x3a0de3['save']();};}function saveUpdates(_0x58e1d7,_0x4da0a7){return function(_0x16a392){if(_0x16a392){return _0x16a392[_0xc166('0x39')](_0x58e1d7)[_0xc166('0x21')](function(_0x4d413a){return _0x4d413a;});}return null;};}function removeEntity(_0x471f79,_0x5528d3){return function(_0x262017){if(_0x262017){return _0x262017[_0xc166('0x3a')]()[_0xc166('0x21')](function(){_0x471f79[_0xc166('0x2f')](0xcc)[_0xc166('0x2e')]();});}};}function handleEntityNotFound(_0x52ae62,_0x89dec3){return function(_0x59b4a2){if(!_0x59b4a2){_0x52ae62['sendStatus'](0x194);}return _0x59b4a2;};}function handleError(_0x5f48cd,_0x1cdf26){_0x1cdf26=_0x1cdf26||0x1f4;return function(_0x2388c3){logger[_0xc166('0x28')](_0x2388c3['stack']);if(_0x2388c3[_0xc166('0x3b')]){delete _0x2388c3[_0xc166('0x3b')];}_0x5f48cd[_0xc166('0x2f')](_0x1cdf26)['send'](_0x2388c3);};}exports[_0xc166('0x3c')]=function(_0x40b825,_0x552372){var _0x30eacc={},_0x566e22={},_0xb25f30={'count':0x0,'rows':[]};var _0x3a3ff0=_['map'](db['SmsMessage'][_0xc166('0x3d')],function(_0x4a8edc){return{'name':_0x4a8edc[_0xc166('0x3e')],'type':_0x4a8edc[_0xc166('0x3f')][_0xc166('0x40')]};});_0x566e22[_0xc166('0x41')]=_['map'](_0x3a3ff0,_0xc166('0x3b'));_0x566e22[_0xc166('0x42')]=_[_0xc166('0x43')](_0x40b825[_0xc166('0x42')]);_0x566e22['filters']=_['intersection'](_0x566e22['model'],_0x566e22[_0xc166('0x42')]);_0x30eacc[_0xc166('0x44')]=_[_0xc166('0x45')](_0x566e22[_0xc166('0x41')],qs[_0xc166('0x46')](_0x40b825[_0xc166('0x42')][_0xc166('0x46')]));_0x30eacc[_0xc166('0x44')]=_0x30eacc[_0xc166('0x44')][_0xc166('0x47')]?_0x30eacc[_0xc166('0x44')]:_0x566e22[_0xc166('0x41')];if(!_0x40b825['query'][_0xc166('0x48')]('nolimit')){_0x30eacc['limit']=qs[_0xc166('0x32')](_0x40b825[_0xc166('0x42')][_0xc166('0x32')]);_0x30eacc[_0xc166('0x30')]=qs['offset'](_0x40b825[_0xc166('0x42')][_0xc166('0x30')]);}_0x30eacc[_0xc166('0x49')]=qs[_0xc166('0x4a')](_0x40b825['query'][_0xc166('0x4a')]);_0x30eacc['where']=qs[_0xc166('0x4b')](_[_0xc166('0x4c')](_0x40b825['query'],_0x566e22[_0xc166('0x4b')]),_0x3a3ff0);if(_0x40b825['query']['filter']){_0x30eacc[_0xc166('0x4d')]=_[_0xc166('0x4e')](_0x30eacc[_0xc166('0x4d')],{'$or':_[_0xc166('0x4f')](_0x3a3ff0,function(_0x4b24d9){if(_0x4b24d9[_0xc166('0x3f')]!=='VIRTUAL'){var _0x2fd37b={};_0x2fd37b[_0x4b24d9[_0xc166('0x3b')]]={'$like':'%'+_0x40b825[_0xc166('0x42')]['filter']+'%'};return _0x2fd37b;}})});}_0x30eacc=_['merge']({},_0x30eacc,_0x40b825[_0xc166('0x50')]);var _0x390099={'where':_0x30eacc[_0xc166('0x4d')]};return db['SmsMessage'][_0xc166('0x33')](_0x390099)[_0xc166('0x21')](function(_0x394d39){_0xb25f30[_0xc166('0x33')]=_0x394d39;if(_0x40b825['query'][_0xc166('0x51')]){_0x30eacc[_0xc166('0x52')]=[{'all':!![]}];}return db[_0xc166('0x53')][_0xc166('0x54')](_0x30eacc);})[_0xc166('0x21')](function(_0xec07d6){_0xb25f30[_0xc166('0x55')]=_0xec07d6;return _0xb25f30;})[_0xc166('0x21')](respondWithFilteredResult(_0x552372,_0x30eacc))[_0xc166('0x2c')](handleError(_0x552372,null));};exports[_0xc166('0x56')]=function(_0x4e1a2e,_0x1a3689){var _0x162197={'raw':!![],'where':{'id':_0x4e1a2e['params']['id']}},_0x3113f5={};_0x3113f5[_0xc166('0x41')]=_[_0xc166('0x43')](db['SmsMessage']['rawAttributes']);_0x3113f5[_0xc166('0x42')]=_[_0xc166('0x43')](_0x4e1a2e['query']);_0x3113f5['filters']=_[_0xc166('0x45')](_0x3113f5['model'],_0x3113f5[_0xc166('0x42')]);_0x162197[_0xc166('0x44')]=_[_0xc166('0x45')](_0x3113f5[_0xc166('0x41')],qs[_0xc166('0x46')](_0x4e1a2e[_0xc166('0x42')][_0xc166('0x46')]));_0x162197[_0xc166('0x44')]=_0x162197[_0xc166('0x44')][_0xc166('0x47')]?_0x162197[_0xc166('0x44')]:_0x3113f5['model'];if(_0x4e1a2e[_0xc166('0x42')][_0xc166('0x51')]){_0x162197[_0xc166('0x52')]=[{'all':!![]}];}_0x162197=_['merge']({},_0x162197,_0x4e1a2e['options']);return db[_0xc166('0x53')][_0xc166('0x57')](_0x162197)[_0xc166('0x21')](handleEntityNotFound(_0x1a3689,null))['then'](respondWithResult(_0x1a3689,null))['catch'](handleError(_0x1a3689,null));};exports[_0xc166('0x58')]=function(_0x15eb50,_0x5e2e1d){return db['SmsMessage'][_0xc166('0x58')](_0x15eb50[_0xc166('0x59')],{})[_0xc166('0x21')](respondWithResult(_0x5e2e1d,0xc9))[_0xc166('0x2c')](handleError(_0x5e2e1d,null));};exports[_0xc166('0x39')]=function(_0x41d1fe,_0x33544e){if(_0x41d1fe[_0xc166('0x59')]['id']){delete _0x41d1fe[_0xc166('0x59')]['id'];}return db[_0xc166('0x53')][_0xc166('0x57')]({'where':{'id':_0x41d1fe['params']['id']}})['then'](handleEntityNotFound(_0x33544e,null))[_0xc166('0x21')](saveUpdates(_0x41d1fe[_0xc166('0x59')],null))[_0xc166('0x21')](respondWithResult(_0x33544e,null))[_0xc166('0x2c')](handleError(_0x33544e,null));};exports[_0xc166('0x3a')]=function(_0x302791,_0x3ad2db){return db['SmsMessage']['find']({'where':{'id':_0x302791[_0xc166('0x5a')]['id']}})[_0xc166('0x21')](handleEntityNotFound(_0x3ad2db,null))[_0xc166('0x21')](removeEntity(_0x3ad2db,null))[_0xc166('0x2c')](handleError(_0x3ad2db,null));};exports['describe']=function(_0x602d5c,_0x16c92b){return db['SmsMessage'][_0xc166('0x5b')]()[_0xc166('0x21')](respondWithResult(_0x16c92b,null))[_0xc166('0x2c')](handleError(_0x16c92b,null));};var interaction_log=require(_0xc166('0x5c'))('sms-interactions');exports['accept']=function(_0xdc3055,_0x40f235,_0xaadeb9){var _0x29d86a={'agent':{},'channel':_0xc166('0x5d')};if(_0xdc3055[_0xc166('0x59')]['id']){delete _0xdc3055[_0xc166('0x59')]['id'];}_0xdc3055[_0xc166('0x59')][_0xc166('0x5e')]=!![];_0xdc3055[_0xc166('0x59')][_0xc166('0x5f')]=moment()[_0xc166('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0xdc3055[_0xc166('0x59')][_0xc166('0x61')]=_0xdc3055['body'][_0xc166('0x61')]||_0xdc3055[_0xc166('0x62')]['id'];_0x29d86a['agent']['id']=_0xdc3055[_0xc166('0x59')][_0xc166('0x61')];return db[_0xc166('0x53')][_0xc166('0x57')]({'where':{'id':_0xdc3055[_0xc166('0x5a')]['id'],'UserId':null}})[_0xc166('0x21')](handleEntityNotFound(_0x40f235,null))['then'](saveUpdates(_0xdc3055[_0xc166('0x59')],null))[_0xc166('0x21')](function(_0x22779c){if(_0x22779c){_0x29d86a[_0xc166('0x2a')]=_0x22779c[_0xc166('0x63')]({'plain':!![]});return db[_0xc166('0x64')]['find']({'where':{'id':_0x22779c['SmsInteractionId']}});}return null;})[_0xc166('0x21')](handleEntityNotFound(_0x40f235,null))[_0xc166('0x21')](function(_0x4630ba){if(_0x4630ba){return _0x4630ba[_0xc166('0x39')]({'UserId':_0xdc3055[_0xc166('0x59')][_0xc166('0x61')],'read1stAt':_['isNil'](_0x4630ba['read1stAt'])?moment()['format'](_0xc166('0x65')):undefined});}return null;})[_0xc166('0x21')](function(_0xf688e5){if(_0xf688e5){_0x29d86a[_0xc166('0x66')]=_0xf688e5[_0xc166('0x63')]({'plain':!![]});interaction_log[_0xc166('0x22')](_0xc166('0x67'),_0xdc3055[_0xc166('0x62')]['id'],_0xdc3055[_0xc166('0x62')][_0xc166('0x3b')],_0xdc3055[_0xc166('0x62')][_0xc166('0x68')],_0x29d86a['interaction']['id'],_0xdc3055['body']?JSON[_0xc166('0x27')](_0xdc3055[_0xc166('0x59')]):_0xc166('0x69'));return respondWithRpcPromise('AcceptMessage',_0xc166('0x6a'),_0x29d86a);}return null;})[_0xc166('0x21')](function(_0x526974){var _0x3548f3=_0xc166('0x6b')+_0x526974[_0xc166('0x2a')][_0xc166('0x6c')];return db[_0xc166('0x6d')]['query'](_0x3548f3,{'type':db['Sequelize'][_0xc166('0x6e')]['SELECT'],'raw':!![]})[_0xc166('0x21')](function(_0x5a6ef6){return _0x5a6ef6;});})[_0xc166('0x21')](function(_0x419277){if(_0x419277){_0x29d86a[_0xc166('0x2a')]['contact']=_0x419277[0x0];if(!_0xdc3055[_0xc166('0x59')][_0xc166('0x61')])return;return db[_0xc166('0x6f')][_0xc166('0x57')]({'where':{'id':_0xdc3055[_0xc166('0x59')]['UserId'],'role':_0xc166('0x70')},'attributes':['id',_0xc166('0x3b'),_0xc166('0x71'),'email',_0xc166('0x72')],'raw':!![]});}return null;})[_0xc166('0x21')](function(_0x5274e9){if(!_0x5274e9)return null;_0x29d86a[_0xc166('0x2a')][_0xc166('0x70')]=_0x5274e9;return _0x29d86a;})[_0xc166('0x21')](function(_0x596a4b){if(_0x596a4b){if(_0xdc3055['body'][_0xc166('0x73')]){_0x29d86a[_0xc166('0x2a')][_0xc166('0x74')]=util[_0xc166('0x60')](_0xc166('0x75'),_0xdc3055['user'][_0xc166('0x3b')]);_0x29d86a['message'][_0xc166('0x76')]=_0x29d86a['channel'];_0x29d86a[_0xc166('0x2a')][_0xc166('0x77')]='accept';return respondWithRpcPromise(_0xc166('0x78'),_0xc166('0x78'),{'event':'acceptmessage','message':_0x29d86a[_0xc166('0x2a')]},client9002)[_0xc166('0x21')](function(){return _0x29d86a;});}return _0x29d86a;}return null;})['then'](respondWithResult(_0x40f235,null))[_0xc166('0x2c')](handleError(_0x40f235,null));};var interaction_log=require(_0xc166('0x5c'))(_0xc166('0x79'));exports[_0xc166('0x38')]=function(_0xa7d81,_0x4cf6b1,_0x61d7b7){var _0x57b729={'agent':{},'channel':_0xc166('0x5d')};if(_0xa7d81['body']['id']){delete _0xa7d81['body']['id'];}_0xa7d81[_0xc166('0x59')]['UserId']=_0xa7d81['body']['UserId']||_0xa7d81[_0xc166('0x62')]['id'];_0x57b729[_0xc166('0x70')]['id']=_0xa7d81[_0xc166('0x59')][_0xc166('0x61')];return db[_0xc166('0x53')][_0xc166('0x57')]({'where':{'id':_0xa7d81[_0xc166('0x5a')]['id'],'UserId':null}})[_0xc166('0x21')](handleEntityNotFound(_0x4cf6b1,null))[_0xc166('0x21')](function(_0x523126){if(_0x523126){_0x57b729[_0xc166('0x2a')]=_0x523126[_0xc166('0x63')]({'plain':!![]});return db[_0xc166('0x64')][_0xc166('0x57')]({'where':{'id':_0x523126['SmsInteractionId']}});}return null;})[_0xc166('0x21')](handleEntityNotFound(_0x4cf6b1,null))[_0xc166('0x21')](function(_0x4c2fbd){if(_0x4c2fbd){_0x57b729[_0xc166('0x66')]=_0x4c2fbd[_0xc166('0x63')]({'plain':!![]});interaction_log[_0xc166('0x22')](_0xc166('0x7a'),_0xa7d81[_0xc166('0x62')]['id'],_0xa7d81[_0xc166('0x62')]['name'],_0xa7d81[_0xc166('0x62')]['role'],_0x57b729[_0xc166('0x66')]['id'],_0xa7d81['body']?JSON[_0xc166('0x27')](_0xa7d81['body']):_0xc166('0x69'));return respondWithRpcPromise(_0xc166('0x7b'),_0xc166('0x7c'),_0x57b729);}return null;})[_0xc166('0x21')](function(_0x4880e1){var _0x18bc65=_0xc166('0x6b')+_0x4880e1['message'][_0xc166('0x6c')];return db[_0xc166('0x6d')][_0xc166('0x42')](_0x18bc65,{'type':db[_0xc166('0x7d')]['QueryTypes'][_0xc166('0x7e')],'raw':!![]})['then'](function(_0x3a3bf2){return _0x3a3bf2;});})['then'](function(_0x472088){if(_0x472088){_0x57b729[_0xc166('0x2a')]['contact']=_0x472088[0x0];if(!_0xa7d81[_0xc166('0x59')][_0xc166('0x61')])return;return db['User']['find']({'where':{'id':_0xa7d81['body'][_0xc166('0x61')],'role':'agent'},'attributes':['id',_0xc166('0x3b'),_0xc166('0x71'),'email',_0xc166('0x72')],'raw':!![]});}return null;})[_0xc166('0x21')](function(_0x182012){if(!_0x182012)return null;_0x57b729[_0xc166('0x2a')]['agent']=_0x182012;return _0x57b729;})['then'](function(_0x4d8e00){if(_0x4d8e00){_0x4d8e00[_0xc166('0x2a')][_0xc166('0x74')]=util['format']('SIP/%s',_0xa7d81[_0xc166('0x62')][_0xc166('0x3b')]);_0x4d8e00[_0xc166('0x2a')][_0xc166('0x76')]=_0x57b729[_0xc166('0x76')];_0x4d8e00[_0xc166('0x2a')][_0xc166('0x77')]='reject';respondWithRpcPromise('EventManager',_0xc166('0x78'),{'event':_0xc166('0x7f'),'message':_0x4d8e00['message']},client9002);return _0x57b729;}return null;})[_0xc166('0x21')](respondWithResult(_0x4cf6b1,null))[_0xc166('0x2c')](handleError(_0x4cf6b1,null));};exports[_0xc166('0x2f')]=function(_0x60140a,_0x4b6206,_0x5757f3){if(_0x60140a['body']['id']){delete _0x60140a['body']['id'];}var _0x17bf36;return db[_0xc166('0x53')][_0xc166('0x57')]({'where':{'id':_0x60140a[_0xc166('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b6206,null))['then'](function(_0x34d86a){if(_0x34d86a){_0x17bf36=_0x34d86a;return db['SmsAccount'][_0xc166('0x57')]({'where':{'id':_0x34d86a[_0xc166('0x80')]}});}})[_0xc166('0x21')](handleEntityNotFound(_0x4b6206,null))[_0xc166('0x21')](function(_0x50d2a6){if(_0x50d2a6){logger[_0xc166('0x24')](_0xc166('0x25'),'status',_0xc166('0x81'),_0x50d2a6[_0xc166('0x3f')],util['inspect'](_0x60140a[_0xc166('0x59')],{'showHidden':![],'depth':null}));switch(_0x50d2a6[_0xc166('0x3f')]){case _0xc166('0x82'):if(_0x60140a[_0xc166('0x59')][_0xc166('0x83')]&&_0x60140a['body'][_0xc166('0x83')]===_0x17bf36['messageId']){return _0x17bf36[_0xc166('0x39')]({'read':!![]});}else{logger[_0xc166('0x28')](_0xc166('0x84'),_0xc166('0x2f'),_0xc166('0x82'),util[_0xc166('0x85')](_0x60140a[_0xc166('0x59')],{'showHidden':![],'depth':null}));}break;case _0xc166('0x86'):if(_0x60140a[_0xc166('0x59')]['MessageUUID']&&_0x60140a[_0xc166('0x59')][_0xc166('0x87')]===_0x17bf36[_0xc166('0x88')]&&_['indexOf']([_0xc166('0x89'),_0xc166('0x8a')],_0x60140a[_0xc166('0x59')][_0xc166('0x8b')])>=0x0){return _0x17bf36[_0xc166('0x39')]({'read':!![]});}else{logger[_0xc166('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc166('0x2f'),_0xc166('0x8c'),util[_0xc166('0x85')](_0x60140a[_0xc166('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x441815=_0x60140a[_0xc166('0x59')][_0xc166('0x8d')][0x0];if(_0x441815[_0xc166('0x2f')][_0xc166('0x8e')]===_0xc166('0x8f')){return _0x17bf36[_0xc166('0x39')]({'read':!![]});}else{logger['error'](_0xc166('0x84'),_0xc166('0x2f'),_0xc166('0x90'),util[_0xc166('0x85')](_0x60140a['body'],{'showHidden':![],'depth':null}));}break;}return _0x17bf36;}})[_0xc166('0x21')](respondWithResult(_0x4b6206,null))[_0xc166('0x2c')](handleError(_0x4b6206,null));};
\ No newline at end of file
+var _0x4867=['request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','update','destroy','stack','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','params','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','QueryTypes','contact','User','agent','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','fullname','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','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http'];(function(_0x36b01a,_0x2e954c){var _0x1f371e=function(_0x497ef){while(--_0x497ef){_0x36b01a['push'](_0x36b01a['shift']());}};_0x1f371e(++_0x2e954c);}(_0x4867,0x1a2));var _0x7486=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x4867[_0x35da42];return _0x370035;};'use strict';var emlformat=require(_0x7486('0x0'));var rimraf=require(_0x7486('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7486('0x2'));var rp=require(_0x7486('0x3'));var moment=require(_0x7486('0x4'));var BPromise=require(_0x7486('0x5'));var Mustache=require(_0x7486('0x6'));var util=require(_0x7486('0x7'));var path=require(_0x7486('0x8'));var sox=require(_0x7486('0x9'));var csv=require(_0x7486('0xa'));var ejs=require(_0x7486('0xb'));var fs=require('fs');var fs_extra=require(_0x7486('0xc'));var _=require('lodash');var squel=require(_0x7486('0xd'));var crypto=require(_0x7486('0xe'));var jsforce=require(_0x7486('0xf'));var deskjs=require(_0x7486('0x10'));var toCsv=require(_0x7486('0xa'));var querystring=require('querystring');var Papa=require(_0x7486('0x11'));var Redis=require(_0x7486('0x12'));var authService=require(_0x7486('0x13'));var qs=require(_0x7486('0x14'));var as=require(_0x7486('0x15'));var hardwareService=require(_0x7486('0x16'));var logger=require(_0x7486('0x17'))('api');var utils=require(_0x7486('0x18'));var config=require(_0x7486('0x19'));var licenseUtil=require(_0x7486('0x1a'));var db=require(_0x7486('0x1b'))['db'];config[_0x7486('0x1c')]=_[_0x7486('0x1d')](config[_0x7486('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x7486('0x1e'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x7486('0x1f')](socket);var jayson=require(_0x7486('0x20'));var client=jayson[_0x7486('0x21')]['http']({'port':0x232c});var client9002=jayson['client'][_0x7486('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1d52e6,_0x54801d,_0x4517b2,_0x3f0e66){return new BPromise(function(_0x42b1b8,_0x2f122f){var _0x276c6e=_0x3f0e66||client;return _0x276c6e[_0x7486('0x23')](_0x1d52e6,_0x4517b2)[_0x7486('0x24')](function(_0x7704fd){logger[_0x7486('0x25')](_0x7486('0x26'),_0x54801d,_0x7486('0x27'));logger[_0x7486('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x54801d,'request\x20sent',JSON[_0x7486('0x29')](_0x7704fd));if(_0x7704fd[_0x7486('0x2a')]){if(_0x7704fd[_0x7486('0x2a')][_0x7486('0x2b')]===0x1f4){logger[_0x7486('0x2a')](_0x7486('0x26'),_0x54801d,_0x7704fd[_0x7486('0x2a')][_0x7486('0x2c')]);return _0x2f122f(_0x7704fd[_0x7486('0x2a')][_0x7486('0x2c')]);}logger[_0x7486('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x54801d,_0x7704fd[_0x7486('0x2a')]['message']);return _0x42b1b8(_0x7704fd[_0x7486('0x2a')][_0x7486('0x2c')]);}else{logger['info'](_0x7486('0x26'),_0x54801d,'request\x20sent');_0x42b1b8(_0x7704fd['result'][_0x7486('0x2c')]);}})[_0x7486('0x2d')](function(_0x2972df){logger['error'](_0x7486('0x26'),_0x54801d,_0x2972df);_0x2f122f(_0x2972df);});});}function respondWithStatusCode(_0x3632b5,_0x54bedc){_0x54bedc=_0x54bedc||0xcc;return function(_0x5ee20f){if(_0x5ee20f){return _0x3632b5[_0x7486('0x2e')](_0x54bedc);}return _0x3632b5['status'](_0x54bedc)[_0x7486('0x2f')]();};}function respondWithResult(_0x378885,_0x71659f){_0x71659f=_0x71659f||0xc8;return function(_0x592609){if(_0x592609){return _0x378885[_0x7486('0x30')](_0x71659f)['json'](_0x592609);}};}function respondWithFilteredResult(_0x2699e9,_0x2973c9){return function(_0x2477cc){if(_0x2477cc){var _0x476e2a=typeof _0x2973c9[_0x7486('0x31')]===_0x7486('0x32')&&typeof _0x2973c9[_0x7486('0x33')]===_0x7486('0x32');var _0x3a0689=_0x2477cc[_0x7486('0x34')];var _0x4f9768=_0x476e2a?0x0:_0x2973c9[_0x7486('0x31')];var _0x4c4e29=_0x476e2a?_0x2477cc[_0x7486('0x34')]:_0x2973c9[_0x7486('0x31')]+_0x2973c9[_0x7486('0x33')];var _0x301e8f;if(_0x4c4e29>=_0x3a0689){_0x4c4e29=_0x3a0689;_0x301e8f=0xc8;}else{_0x301e8f=0xce;}_0x2699e9[_0x7486('0x30')](_0x301e8f);return _0x2699e9['set'](_0x7486('0x35'),_0x4f9768+'-'+_0x4c4e29+'/'+_0x3a0689)[_0x7486('0x36')](_0x2477cc);}return null;};}function patchUpdates(_0x26a82d){return function(_0x4fc4b3){try{jsonpatch[_0x7486('0x37')](_0x4fc4b3,_0x26a82d,!![]);}catch(_0x31cce8){return BPromise['reject'](_0x31cce8);}return _0x4fc4b3['save']();};}function saveUpdates(_0x5b5295,_0x76471b){return function(_0x2552cd){if(_0x2552cd){return _0x2552cd[_0x7486('0x38')](_0x5b5295)[_0x7486('0x24')](function(_0x42dd28){return _0x42dd28;});}return null;};}function removeEntity(_0x194cf7,_0x2cf15c){return function(_0x381336){if(_0x381336){return _0x381336[_0x7486('0x39')]()[_0x7486('0x24')](function(){_0x194cf7[_0x7486('0x30')](0xcc)[_0x7486('0x2f')]();});}};}function handleEntityNotFound(_0x45d047,_0x596d86){return function(_0x3f960c){if(!_0x3f960c){_0x45d047[_0x7486('0x2e')](0x194);}return _0x3f960c;};}function handleError(_0x5c55f1,_0x104c77){_0x104c77=_0x104c77||0x1f4;return function(_0x5b6b6e){logger['error'](_0x5b6b6e[_0x7486('0x3a')]);if(_0x5b6b6e['name']){delete _0x5b6b6e['name'];}_0x5c55f1[_0x7486('0x30')](_0x104c77)[_0x7486('0x3b')](_0x5b6b6e);};}exports[_0x7486('0x3c')]=function(_0x424aa6,_0x13db14){var _0x24bcc4={},_0x3fb728={},_0x1a9bd2={'count':0x0,'rows':[]};var _0x50c1c5=_[_0x7486('0x3d')](db[_0x7486('0x3e')][_0x7486('0x3f')],function(_0x3f341e){return{'name':_0x3f341e[_0x7486('0x40')],'type':_0x3f341e['type'][_0x7486('0x41')]};});_0x3fb728[_0x7486('0x42')]=_['map'](_0x50c1c5,_0x7486('0x43'));_0x3fb728[_0x7486('0x44')]=_[_0x7486('0x45')](_0x424aa6['query']);_0x3fb728[_0x7486('0x46')]=_[_0x7486('0x47')](_0x3fb728['model'],_0x3fb728['query']);_0x24bcc4[_0x7486('0x48')]=_[_0x7486('0x47')](_0x3fb728[_0x7486('0x42')],qs[_0x7486('0x49')](_0x424aa6['query'][_0x7486('0x49')]));_0x24bcc4['attributes']=_0x24bcc4[_0x7486('0x48')][_0x7486('0x4a')]?_0x24bcc4['attributes']:_0x3fb728['model'];if(!_0x424aa6[_0x7486('0x44')][_0x7486('0x4b')](_0x7486('0x4c'))){_0x24bcc4['limit']=qs[_0x7486('0x33')](_0x424aa6[_0x7486('0x44')][_0x7486('0x33')]);_0x24bcc4[_0x7486('0x31')]=qs['offset'](_0x424aa6[_0x7486('0x44')][_0x7486('0x31')]);}_0x24bcc4['order']=qs[_0x7486('0x4d')](_0x424aa6[_0x7486('0x44')][_0x7486('0x4d')]);_0x24bcc4[_0x7486('0x4e')]=qs[_0x7486('0x46')](_['pick'](_0x424aa6[_0x7486('0x44')],_0x3fb728[_0x7486('0x46')]),_0x50c1c5);if(_0x424aa6[_0x7486('0x44')]['filter']){_0x24bcc4[_0x7486('0x4e')]=_[_0x7486('0x4f')](_0x24bcc4[_0x7486('0x4e')],{'$or':_[_0x7486('0x3d')](_0x50c1c5,function(_0x5d686c){if(_0x5d686c[_0x7486('0x50')]!==_0x7486('0x51')){var _0x48aae0={};_0x48aae0[_0x5d686c[_0x7486('0x43')]]={'$like':'%'+_0x424aa6['query'][_0x7486('0x52')]+'%'};return _0x48aae0;}})});}_0x24bcc4=_[_0x7486('0x4f')]({},_0x24bcc4,_0x424aa6[_0x7486('0x53')]);var _0x1ccd26={'where':_0x24bcc4[_0x7486('0x4e')]};return db[_0x7486('0x3e')][_0x7486('0x34')](_0x1ccd26)[_0x7486('0x24')](function(_0xf28a21){_0x1a9bd2[_0x7486('0x34')]=_0xf28a21;if(_0x424aa6['query'][_0x7486('0x54')]){_0x24bcc4[_0x7486('0x55')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x24bcc4);})[_0x7486('0x24')](function(_0x288ce0){_0x1a9bd2['rows']=_0x288ce0;return _0x1a9bd2;})['then'](respondWithFilteredResult(_0x13db14,_0x24bcc4))[_0x7486('0x2d')](handleError(_0x13db14,null));};exports['show']=function(_0x1507e8,_0x46bc54){var _0x3bc2c4={'raw':!![],'where':{'id':_0x1507e8[_0x7486('0x56')]['id']}},_0x59bf07={};_0x59bf07[_0x7486('0x42')]=_[_0x7486('0x45')](db[_0x7486('0x3e')]['rawAttributes']);_0x59bf07['query']=_['keys'](_0x1507e8[_0x7486('0x44')]);_0x59bf07['filters']=_[_0x7486('0x47')](_0x59bf07[_0x7486('0x42')],_0x59bf07[_0x7486('0x44')]);_0x3bc2c4[_0x7486('0x48')]=_['intersection'](_0x59bf07['model'],qs[_0x7486('0x49')](_0x1507e8[_0x7486('0x44')][_0x7486('0x49')]));_0x3bc2c4[_0x7486('0x48')]=_0x3bc2c4[_0x7486('0x48')][_0x7486('0x4a')]?_0x3bc2c4['attributes']:_0x59bf07[_0x7486('0x42')];if(_0x1507e8[_0x7486('0x44')][_0x7486('0x54')]){_0x3bc2c4['include']=[{'all':!![]}];}_0x3bc2c4=_['merge']({},_0x3bc2c4,_0x1507e8[_0x7486('0x53')]);return db[_0x7486('0x3e')][_0x7486('0x57')](_0x3bc2c4)['then'](handleEntityNotFound(_0x46bc54,null))['then'](respondWithResult(_0x46bc54,null))[_0x7486('0x2d')](handleError(_0x46bc54,null));};exports[_0x7486('0x58')]=function(_0x4a69b1,_0x40a320){return db['SmsMessage'][_0x7486('0x58')](_0x4a69b1[_0x7486('0x59')],{})[_0x7486('0x24')](respondWithResult(_0x40a320,0xc9))[_0x7486('0x2d')](handleError(_0x40a320,null));};exports['update']=function(_0xb07ea,_0x8a855b){if(_0xb07ea['body']['id']){delete _0xb07ea['body']['id'];}return db[_0x7486('0x3e')][_0x7486('0x57')]({'where':{'id':_0xb07ea[_0x7486('0x56')]['id']}})[_0x7486('0x24')](handleEntityNotFound(_0x8a855b,null))[_0x7486('0x24')](saveUpdates(_0xb07ea['body'],null))[_0x7486('0x24')](respondWithResult(_0x8a855b,null))[_0x7486('0x2d')](handleError(_0x8a855b,null));};exports[_0x7486('0x39')]=function(_0x1ffef3,_0x5c34c2){return db['SmsMessage'][_0x7486('0x57')]({'where':{'id':_0x1ffef3[_0x7486('0x56')]['id']}})[_0x7486('0x24')](handleEntityNotFound(_0x5c34c2,null))[_0x7486('0x24')](removeEntity(_0x5c34c2,null))[_0x7486('0x2d')](handleError(_0x5c34c2,null));};exports[_0x7486('0x5a')]=function(_0x1b8586,_0x4206e6){return db[_0x7486('0x3e')][_0x7486('0x5a')]()[_0x7486('0x24')](respondWithResult(_0x4206e6,null))[_0x7486('0x2d')](handleError(_0x4206e6,null));};var interaction_log=require(_0x7486('0x17'))(_0x7486('0x5b'));exports[_0x7486('0x5c')]=function(_0x164313,_0x10c690,_0x1badd4){var _0x517162={'agent':{},'channel':_0x7486('0x5d')};if(_0x164313['body']['id']){delete _0x164313['body']['id'];}_0x164313['body'][_0x7486('0x5e')]=!![];_0x164313[_0x7486('0x59')][_0x7486('0x5f')]=moment()[_0x7486('0x60')](_0x7486('0x61'));_0x164313[_0x7486('0x59')][_0x7486('0x62')]=_0x164313[_0x7486('0x59')]['UserId']||_0x164313[_0x7486('0x63')]['id'];_0x517162['agent']['id']=_0x164313[_0x7486('0x59')][_0x7486('0x62')];return db['SmsMessage']['find']({'where':{'id':_0x164313[_0x7486('0x56')]['id'],'UserId':null}})[_0x7486('0x24')](handleEntityNotFound(_0x10c690,null))[_0x7486('0x24')](saveUpdates(_0x164313[_0x7486('0x59')],null))['then'](function(_0x1ebc22){if(_0x1ebc22){_0x517162[_0x7486('0x2c')]=_0x1ebc22[_0x7486('0x64')]({'plain':!![]});return db[_0x7486('0x65')][_0x7486('0x57')]({'where':{'id':_0x1ebc22[_0x7486('0x66')]}});}return null;})[_0x7486('0x24')](handleEntityNotFound(_0x10c690,null))[_0x7486('0x24')](function(_0x2112df){if(_0x2112df){return _0x2112df[_0x7486('0x38')]({'UserId':_0x164313[_0x7486('0x59')][_0x7486('0x62')],'read1stAt':_[_0x7486('0x67')](_0x2112df[_0x7486('0x68')])?moment()['format'](_0x7486('0x61')):undefined});}return null;})[_0x7486('0x24')](function(_0x445655){if(_0x445655){_0x517162[_0x7486('0x69')]=_0x445655[_0x7486('0x64')]({'plain':!![]});interaction_log[_0x7486('0x25')](_0x7486('0x6a'),_0x164313[_0x7486('0x63')]['id'],_0x164313[_0x7486('0x63')][_0x7486('0x43')],_0x164313[_0x7486('0x63')][_0x7486('0x6b')],_0x517162[_0x7486('0x69')]['id'],_0x164313[_0x7486('0x59')]?JSON[_0x7486('0x29')](_0x164313[_0x7486('0x59')]):_0x7486('0x6c'));return respondWithRpcPromise(_0x7486('0x6d'),_0x7486('0x6e'),_0x517162);}return null;})[_0x7486('0x24')](function(_0x5f0fe9){var _0x2a3880='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5f0fe9[_0x7486('0x2c')]['ContactId'];return db['sequelize'][_0x7486('0x44')](_0x2a3880,{'type':db['Sequelize'][_0x7486('0x6f')]['SELECT'],'raw':!![]})[_0x7486('0x24')](function(_0x43e9c1){return _0x43e9c1;});})[_0x7486('0x24')](function(_0x207323){if(_0x207323){_0x517162[_0x7486('0x2c')][_0x7486('0x70')]=_0x207323[0x0];if(!_0x164313['body'][_0x7486('0x62')])return;return db[_0x7486('0x71')][_0x7486('0x57')]({'where':{'id':_0x164313[_0x7486('0x59')][_0x7486('0x62')],'role':_0x7486('0x72')},'attributes':['id',_0x7486('0x43'),'fullname',_0x7486('0x73'),_0x7486('0x74')],'raw':!![]});}return null;})[_0x7486('0x24')](function(_0x339b06){if(!_0x339b06)return null;_0x517162[_0x7486('0x2c')][_0x7486('0x72')]=_0x339b06;return _0x517162;})[_0x7486('0x24')](function(_0x234332){if(_0x234332){if(_0x164313[_0x7486('0x59')][_0x7486('0x75')]){_0x517162['message'][_0x7486('0x76')]=util[_0x7486('0x60')](_0x7486('0x77'),_0x164313[_0x7486('0x63')]['name']);_0x517162[_0x7486('0x2c')]['channel']=_0x517162[_0x7486('0x78')];_0x517162[_0x7486('0x2c')][_0x7486('0x79')]=_0x7486('0x5c');return respondWithRpcPromise(_0x7486('0x7a'),_0x7486('0x7a'),{'event':_0x7486('0x7b'),'message':_0x517162['message']},client9002)[_0x7486('0x24')](function(){return _0x517162;});}return _0x517162;}return null;})[_0x7486('0x24')](respondWithResult(_0x10c690,null))[_0x7486('0x2d')](handleError(_0x10c690,null));};var interaction_log=require(_0x7486('0x17'))(_0x7486('0x5b'));exports[_0x7486('0x7c')]=function(_0x5246ce,_0x31e3a3,_0x570c1f){var _0x551dc0={'agent':{},'channel':_0x7486('0x5d')};if(_0x5246ce[_0x7486('0x59')]['id']){delete _0x5246ce[_0x7486('0x59')]['id'];}_0x5246ce[_0x7486('0x59')][_0x7486('0x62')]=_0x5246ce['body'][_0x7486('0x62')]||_0x5246ce['user']['id'];_0x551dc0['agent']['id']=_0x5246ce[_0x7486('0x59')][_0x7486('0x62')];return db['SmsMessage'][_0x7486('0x57')]({'where':{'id':_0x5246ce[_0x7486('0x56')]['id'],'UserId':null}})[_0x7486('0x24')](handleEntityNotFound(_0x31e3a3,null))[_0x7486('0x24')](function(_0x9d974b){if(_0x9d974b){_0x551dc0[_0x7486('0x2c')]=_0x9d974b[_0x7486('0x64')]({'plain':!![]});return db[_0x7486('0x65')]['find']({'where':{'id':_0x9d974b[_0x7486('0x66')]}});}return null;})[_0x7486('0x24')](handleEntityNotFound(_0x31e3a3,null))[_0x7486('0x24')](function(_0x333eef){if(_0x333eef){_0x551dc0[_0x7486('0x69')]=_0x333eef[_0x7486('0x64')]({'plain':!![]});interaction_log[_0x7486('0x25')](_0x7486('0x7d'),_0x5246ce[_0x7486('0x63')]['id'],_0x5246ce[_0x7486('0x63')][_0x7486('0x43')],_0x5246ce[_0x7486('0x63')][_0x7486('0x6b')],_0x551dc0[_0x7486('0x69')]['id'],_0x5246ce[_0x7486('0x59')]?JSON[_0x7486('0x29')](_0x5246ce[_0x7486('0x59')]):'null');return respondWithRpcPromise('RejectMessage',_0x7486('0x7e'),_0x551dc0);}return null;})[_0x7486('0x24')](function(_0x4cef66){var _0xc3303f=_0x7486('0x7f')+_0x4cef66[_0x7486('0x2c')][_0x7486('0x80')];return db[_0x7486('0x81')]['query'](_0xc3303f,{'type':db[_0x7486('0x82')][_0x7486('0x6f')][_0x7486('0x83')],'raw':!![]})[_0x7486('0x24')](function(_0x38e520){return _0x38e520;});})['then'](function(_0x41169f){if(_0x41169f){_0x551dc0[_0x7486('0x2c')][_0x7486('0x70')]=_0x41169f[0x0];if(!_0x5246ce[_0x7486('0x59')][_0x7486('0x62')])return;return db[_0x7486('0x71')][_0x7486('0x57')]({'where':{'id':_0x5246ce[_0x7486('0x59')][_0x7486('0x62')],'role':'agent'},'attributes':['id',_0x7486('0x43'),_0x7486('0x84'),_0x7486('0x73'),_0x7486('0x74')],'raw':!![]});}return null;})[_0x7486('0x24')](function(_0xa82103){if(!_0xa82103)return null;_0x551dc0['message'][_0x7486('0x72')]=_0xa82103;return _0x551dc0;})[_0x7486('0x24')](function(_0x5dec42){if(_0x5dec42){_0x5dec42[_0x7486('0x2c')][_0x7486('0x76')]=util['format']('SIP/%s',_0x5246ce[_0x7486('0x63')]['name']);_0x5dec42['message'][_0x7486('0x78')]=_0x551dc0[_0x7486('0x78')];_0x5dec42[_0x7486('0x2c')]['event']=_0x7486('0x7c');respondWithRpcPromise(_0x7486('0x7a'),'EventManager',{'event':'rejectmessage','message':_0x5dec42[_0x7486('0x2c')]},client9002);return _0x551dc0;}return null;})[_0x7486('0x24')](respondWithResult(_0x31e3a3,null))[_0x7486('0x2d')](handleError(_0x31e3a3,null));};exports[_0x7486('0x30')]=function(_0x3d9614,_0x74f58c,_0x795c95){if(_0x3d9614[_0x7486('0x59')]['id']){delete _0x3d9614[_0x7486('0x59')]['id'];}var _0x1b673f;return db[_0x7486('0x3e')][_0x7486('0x57')]({'where':{'id':_0x3d9614['params']['id']}})['then'](handleEntityNotFound(_0x74f58c,null))[_0x7486('0x24')](function(_0x219f0d){if(_0x219f0d){_0x1b673f=_0x219f0d;return db[_0x7486('0x85')]['find']({'where':{'id':_0x219f0d[_0x7486('0x86')]}});}})[_0x7486('0x24')](handleEntityNotFound(_0x74f58c,null))[_0x7486('0x24')](function(_0x3acce5){if(_0x3acce5){logger[_0x7486('0x28')](_0x7486('0x87'),_0x7486('0x30'),_0x7486('0x88'),_0x3acce5[_0x7486('0x50')],util['inspect'](_0x3d9614[_0x7486('0x59')],{'showHidden':![],'depth':null}));switch(_0x3acce5[_0x7486('0x50')]){case _0x7486('0x89'):if(_0x3d9614[_0x7486('0x59')][_0x7486('0x8a')]&&_0x3d9614[_0x7486('0x59')][_0x7486('0x8a')]===_0x1b673f[_0x7486('0x8b')]){return _0x1b673f['update']({'read':!![]});}else{logger['error'](_0x7486('0x8c'),_0x7486('0x30'),_0x7486('0x89'),util[_0x7486('0x8d')](_0x3d9614[_0x7486('0x59')],{'showHidden':![],'depth':null}));}break;case _0x7486('0x8e'):if(_0x3d9614[_0x7486('0x59')]['MessageUUID']&&_0x3d9614[_0x7486('0x59')][_0x7486('0x8f')]===_0x1b673f['messageId']&&_['indexOf']([_0x7486('0x90'),_0x7486('0x91')],_0x3d9614[_0x7486('0x59')][_0x7486('0x92')])>=0x0){return _0x1b673f[_0x7486('0x38')]({'read':!![]});}else{logger['error'](_0x7486('0x8c'),_0x7486('0x30'),_0x7486('0x93'),util[_0x7486('0x8d')](_0x3d9614[_0x7486('0x59')],{'showHidden':![],'depth':null}));}break;case _0x7486('0x94'):var _0x4e2f00=_0x3d9614[_0x7486('0x59')][_0x7486('0x95')][0x0];if(_0x4e2f00[_0x7486('0x30')]['groupName']===_0x7486('0x96')){return _0x1b673f[_0x7486('0x38')]({'read':!![]});}else{logger[_0x7486('0x2a')](_0x7486('0x8c'),_0x7486('0x30'),_0x7486('0x94'),util[_0x7486('0x8d')](_0x3d9614[_0x7486('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x1b673f;}})['then'](respondWithResult(_0x74f58c,null))[_0x7486('0x2d')](handleError(_0x74f58c,null));};
\ No newline at end of file
index 00e78da..fb2526a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d74=['exports','events','../../mysqldb','SmsMessage','save','update','remove'];(function(_0x598033,_0x20b109){var _0x2b3126=function(_0x5ef726){while(--_0x5ef726){_0x598033['push'](_0x598033['shift']());}};_0x2b3126(++_0x20b109);}(_0x4d74,0x1eb));var _0x44d7=function(_0x20f9bc,_0x1057f0){_0x20f9bc=_0x20f9bc-0x0;var _0x2060a4=_0x4d74[_0x20f9bc];return _0x2060a4;};'use strict';var EventEmitter=require(_0x44d7('0x0'));var SmsMessage=require(_0x44d7('0x1'))['db'][_0x44d7('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x44d7('0x3'),'afterUpdate':_0x44d7('0x4'),'afterDestroy':_0x44d7('0x5')};function emitEvent(_0x49a04f){return function(_0x64a16,_0xac0f06,_0x112376){SmsMessageEvents['emit'](_0x49a04f+':'+_0x64a16['id'],_0x64a16);SmsMessageEvents['emit'](_0x49a04f,_0x64a16);_0x112376(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x44d7('0x6')]=SmsMessageEvents;
\ No newline at end of file
+var _0x7fd2=['events','../../mysqldb','SmsMessage','setMaxListeners','update','emit','hook','exports'];(function(_0x22ad41,_0x502d5a){var _0x5d0c2b=function(_0x27112b){while(--_0x27112b){_0x22ad41['push'](_0x22ad41['shift']());}};_0x5d0c2b(++_0x502d5a);}(_0x7fd2,0x90));var _0x27fd=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x7fd2[_0x525c7b];return _0x27b33e;};'use strict';var EventEmitter=require(_0x27fd('0x0'));var SmsMessage=require(_0x27fd('0x1'))['db'][_0x27fd('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x27fd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x27fd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4a3c05){return function(_0x58ebfa,_0x4e9fc7,_0x47b04e){SmsMessageEvents['emit'](_0x4a3c05+':'+_0x58ebfa['id'],_0x58ebfa);SmsMessageEvents[_0x27fd('0x5')](_0x4a3c05,_0x58ebfa);_0x47b04e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x27fd('0x6')](e,emitEvent(event));}}module[_0x27fd('0x7')]=SmsMessageEvents;
\ No newline at end of file
index 2958199..90888aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9567=['body','models','direction','toLowerCase','secret','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','error','out','SmsAccount','type','twilio','authToken','phone','create','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','IBSSO\x20','csc','crypto','login','text','timestamp','sort','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','Token\x20not\x20received','utf8mb4','lodash','util','../../config/logger','api','moment','path','rimraf','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages'];(function(_0x3119e0,_0x26865c){var _0x408fa4=function(_0xe008e2){while(--_0xe008e2){_0x3119e0['push'](_0x3119e0['shift']());}};_0x408fa4(++_0x26865c);}(_0x9567,0xdc));var _0x7956=function(_0x4beab4,_0x4a15cf){_0x4beab4=_0x4beab4-0x0;var _0x3ef736=_0x9567[_0x4beab4];return _0x3ef736;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var logger=require(_0x7956('0x2'))(_0x7956('0x3'));var moment=require(_0x7956('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7956('0x5'));var rimraf=require(_0x7956('0x6'));var config=require('../../config/environment');var attributes=require(_0x7956('0x7'));module['exports']=function(_0x12c09e,_0x48c4b6){return _0x12c09e[_0x7956('0x8')](_0x7956('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x7956('0xa'),'fields':['messageId']},{'name':_0x7956('0xb'),'fields':[_0x7956('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x127891,_0xe825,_0x5919db){var _0x1fd87b=_0x12c09e[_0x7956('0xd')];var _0x299e61=_0x127891['get']({'plain':!![]});if(_0x299e61[_0x7956('0xe')][_0x7956('0xf')]()==='in'||_0x299e61[_0x7956('0xe')][_0x7956('0xf')]()==='out'&&!_0x299e61[_0x7956('0x10')]&&!_[_0x7956('0x11')](_0x299e61[_0x7956('0x12')])){_0x1fd87b['SmsInteraction'][_0x7956('0x13')]({'where':{'id':_0x299e61[_0x7956('0x14')]}})[_0x7956('0x15')](function(_0x3a408a){if(_0x3a408a){_0x3a408a[_0x7956('0x16')]({'lastMsgAt':_0x299e61[_0x7956('0x17')],'lastMsgDirection':_0x299e61[_0x7956('0xe')][_0x7956('0xf')]()});}})[_0x7956('0x18')](function(_0x6a6d78){console[_0x7956('0x19')](_0x6a6d78);});}if(_0x299e61[_0x7956('0xe')]===_0x7956('0x1a')&&!_0x299e61[_0x7956('0x10')]){var _0x1e8040;_0x1fd87b[_0x7956('0x1b')]['find']({'where':{'id':_0x299e61['SmsAccountId']},'raw':!![]})[_0x7956('0x15')](function(_0x811122){_0x1e8040=_0x811122;if(_0x1e8040&&_0x1e8040['type']){switch(_0x1e8040[_0x7956('0x1c')]){case'twilio':var _0x635d5b=require(_0x7956('0x1d'));if(_0x1e8040['accountSid']&&_0x1e8040[_0x7956('0x1e')]&&_0x1e8040[_0x7956('0x1f')]){var _0xc500bd=new _0x635d5b(_0x1e8040['accountSid'],_0x1e8040[_0x7956('0x1e')]);_0xc500bd['messages'][_0x7956('0x20')]({'body':_0x299e61['body'],'to':_0x299e61[_0x7956('0x1f')],'from':_0x1e8040[_0x7956('0x1f')],'statusCallback':_0x1e8040[_0x7956('0x21')]+_0x7956('0x22')+_0x299e61['id']+'/status?token='+_0x1e8040[_0x7956('0x23')]})[_0x7956('0x15')](function(_0x432a2d){if(_0x432a2d['sid']){return _0x127891['update']({'messageId':_0x432a2d[_0x7956('0x24')]});}})[_0x7956('0x18')](function(_0x40d2d6){logger[_0x7956('0x19')](_0x7956('0x25'),'afterCreate',_0x7956('0x1d'),util[_0x7956('0x26')](_0x40d2d6,{'showHidden':![],'depth':null}));});}else{logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x7956('0x28'):var _0x33401e=_0x7956('0x29');if(_0x1e8040[_0x7956('0x2a')]&&_0x1e8040[_0x7956('0x2b')]){var _0x17c724={'recipient':[_0x299e61[_0x7956('0x1f')]],'message':_0x299e61[_0x7956('0xc')],'message_type':_0x1e8040[_0x7956('0x2c')]};if(_0x1e8040[_0x7956('0x2c')]&&_0x1e8040[_0x7956('0x2c')]!=='SI'){_0x17c724[_0x7956('0x2d')]=_0x1e8040[_0x7956('0x1f')];}var _0x36e9a6={'url':_0x33401e+_0x7956('0x2e')+_0x1e8040[_0x7956('0x2a')]+_0x7956('0x2f')+_0x1e8040[_0x7956('0x2b')],'method':_0x7956('0x30')};rp(_0x36e9a6)[_0x7956('0x15')](function(_0x5bb0f1){var _0x1edb4c=_0x5bb0f1[_0x7956('0x31')](';');var _0x443a57={'user_key':_0x1edb4c[0x0],'session_key':_0x1edb4c[0x1]};_0x36e9a6={'url':_0x33401e+_0x7956('0x32'),'method':_0x7956('0x33'),'headers':{'user_key':_0x443a57[_0x7956('0x34')],'Session_key':_0x443a57['session_key']},'json':!![],'body':_0x17c724};return rp(_0x36e9a6);})[_0x7956('0x15')](function(_0x18fdc6){if(_0x18fdc6['total_sent']>=0x1){var _0x14d1c9={'messageId':_0x18fdc6[_0x7956('0x35')]};if(_0x1e8040[_0x7956('0x2c')]!=='GP'||!_0x1e8040[_0x7956('0x36')]){_0x14d1c9[_0x7956('0x37')]=!![];}return _0x127891[_0x7956('0x16')](_0x14d1c9);}else{return logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x28'),util[_0x7956('0x26')](_0x18fdc6,{'showHidden':![],'depth':null}));}})[_0x7956('0x18')](function(_0x1326b5){return logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),'skebby',util[_0x7956('0x26')](_0x1326b5,{'showHidden':![],'depth':null}));});}else{logger[_0x7956('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7956('0x27'),'skebby',_0x7956('0x38'));}break;case'connectel':if(_0x1e8040['authToken']){var _0x360d71={'recipient':_0x299e61['phone'],'message':_0x299e61[_0x7956('0xc')],'sender':_0x1e8040[_0x7956('0x39')]||_0x1e8040[_0x7956('0x1f')],'authorization':_0x1e8040[_0x7956('0x1e')]};var _0xe825={'method':_0x7956('0x33'),'uri':_0x7956('0x3a'),'body':_0x360d71,'json':!![]};rp(_0xe825)[_0x7956('0x15')](function(_0x4720d3){var _0x55c526={'messageId':_0x4720d3[_0x7956('0x3b')]};if(!_0x1e8040['deliveryReport']){_0x55c526[_0x7956('0x37')]=!![];}return _0x127891[_0x7956('0x16')](_0x55c526);})[_0x7956('0x18')](function(_0x134644){logger['error'](_0x7956('0x25'),_0x7956('0x27'),'connectel',util['inspect'](_0x134644,{'showHidden':![],'depth':null}));});}else{logger[_0x7956('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7956('0x27'),_0x7956('0x3c'),_0x7956('0x3d'));}break;case'clicksend':if(_0x1e8040[_0x7956('0x2a')]&&_0x1e8040[_0x7956('0x2b')]){var _0x360d71={'messages':[{'source':_0x7956('0x3e'),'to':_0x299e61['phone'],'body':_0x299e61[_0x7956('0xc')],'from':_0x1e8040[_0x7956('0x39')]||_0x1e8040[_0x7956('0x1f')]}]};var _0x40680a=util[_0x7956('0x3f')]('%s:%s',_0x1e8040['username'],_0x1e8040[_0x7956('0x2b')]);var _0xe825={'method':_0x7956('0x33'),'uri':_0x7956('0x40'),'body':_0x360d71,'headers':{'Authorization':util[_0x7956('0x3f')](_0x7956('0x41'),new Buffer(_0x40680a)['toString'](_0x7956('0x42')))},'json':!![]};rp(_0xe825)[_0x7956('0x15')](function(_0x1e6544){if(_0x1e6544[_0x7956('0x43')]>=0xc8&&_0x1e6544[_0x7956('0x43')]<=0xce){if(_0x1e6544[_0x7956('0x44')]&&_0x1e6544[_0x7956('0x44')][_0x7956('0x45')]>0x0){var _0x1d64f2=_[_0x7956('0x46')](_0x1e6544[_0x7956('0x44')][_0x7956('0x47')]);var _0x393e55={'messageId':_0x1d64f2[_0x7956('0x48')]};if(!_0x1e8040[_0x7956('0x36')]){_0x393e55['read']=!![];}return _0x127891[_0x7956('0x16')](_0x393e55);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7956('0x27'),_0x7956('0x49'),util[_0x7956('0x26')](_0x1e6544,{'showHidden':![],'depth':null}));}}else{logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x49'),util[_0x7956('0x26')](_0x1e6544,{'showHidden':![],'depth':null}));}})[_0x7956('0x18')](function(_0x1c6722){logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x49'),util[_0x7956('0x26')](_0x1c6722,{'showHidden':![],'depth':null}));});}else{logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x49'),_0x7956('0x38'));}break;case _0x7956('0x4a'):if(_0x1e8040[_0x7956('0x4b')]&&_0x1e8040['authToken']){var _0x360d71={'dst':_0x299e61[_0x7956('0x1f')],'text':_0x299e61[_0x7956('0xc')],'src':_0x1e8040['senderString']||_0x1e8040[_0x7956('0x1f')],'url':_0x1e8040['remote']+_0x7956('0x22')+_0x299e61['id']+_0x7956('0x4c')+_0x1e8040['token']};var _0x40680a=util[_0x7956('0x3f')]('%s:%s',_0x1e8040[_0x7956('0x4b')],_0x1e8040[_0x7956('0x1e')]);var _0xe825={'method':_0x7956('0x33'),'uri':util[_0x7956('0x3f')](_0x7956('0x4d'),_0x1e8040[_0x7956('0x4b')]),'body':_0x360d71,'headers':{'Authorization':util[_0x7956('0x3f')](_0x7956('0x41'),new Buffer(_0x40680a)[_0x7956('0x4e')]('base64'))},'json':!![]};rp(_0xe825)[_0x7956('0x15')](function(_0x386919){var _0x1b69d1={'messageId':_0x386919[_0x7956('0x4f')][0x0]};return _0x127891['update'](_0x1b69d1);})[_0x7956('0x18')](function(_0x4127bf){logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x4a'),util[_0x7956('0x26')](_0x4127bf,{'showHidden':![],'depth':null}));});}else{logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x4a'),_0x7956('0x50'));}break;case _0x7956('0x51'):if(_0x1e8040[_0x7956('0x2a')]&&_0x1e8040['password']){if(_0x1e8040[_0x7956('0x52')]){var _0x1c84a6={'method':_0x7956('0x33'),'uri':_0x1e8040[_0x7956('0x52')]+'/auth/1/session','body':{'username':_0x1e8040[_0x7956('0x2a')],'password':_0x1e8040[_0x7956('0x2b')]},'json':!![]};return rp(_0x1c84a6)[_0x7956('0x15')](function(_0x196fdf){var _0x10b953={'method':_0x7956('0x33'),'uri':_0x1e8040[_0x7956('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1e8040['phone'],'destinations':[{'to':_0x299e61[_0x7956('0x1f')]}],'text':_0x299e61['body'],'notifyUrl':_0x1e8040[_0x7956('0x21')]+_0x7956('0x22')+_0x299e61['id']+_0x7956('0x4c')+_0x1e8040[_0x7956('0x23')],'notifyContentType':_0x7956('0x53'),'callbackData':_0x1e8040[_0x7956('0x1f')]+';'+_0x299e61[_0x7956('0xc')]}]},'headers':{'Authorization':_0x7956('0x54')+_0x196fdf[_0x7956('0x23')]},'json':!![]};return rp(_0x10b953)['then'](function(_0x29cc1f){if(_0x29cc1f[_0x7956('0x47')]){var _0x45cc68={'messageId':_0x29cc1f['messages'][0x0][_0x7956('0xa')]};if(!_0x1e8040[_0x7956('0x36')]){_0x45cc68['read']=!![];}return _0x127891[_0x7956('0x16')](_0x45cc68);}else{return logger['error'](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x51'),util[_0x7956('0x26')](_0x29cc1f,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x12d708){return logger[_0x7956('0x19')](_0x7956('0x25'),'afterCreate',_0x7956('0x51'),util[_0x7956('0x26')](_0x12d708,{'showHidden':![],'depth':null}));});}else{logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x51'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0x7956('0x25'),'afterCreate',_0x7956('0x51'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x7956('0x55'):var _0x2d9f8d=require(_0x7956('0x56'));if(_0x1e8040['apiKey']){var _0x49732b={};_0x49732b[_0x7956('0x57')]=_0x1e8040[_0x7956('0x2a')];_0x49732b[_0x7956('0x1f')]=_0x299e61[_0x7956('0x1f')];_0x49732b['sender']=_0x1e8040[_0x7956('0x1f')];_0x49732b[_0x7956('0x58')]=_0x299e61[_0x7956('0xc')];_0x49732b[_0x7956('0x59')]=+new Date();var _0xb1044f='';var _0x40d052='';var _0xf35ffd=Object['keys'](_0x49732b);_0xf35ffd[_0x7956('0x5a')]();for(var _0x7a5d6a=0x0;_0x7a5d6a<_0xf35ffd[_0x7956('0x5b')];_0x7a5d6a++){if(_0xb1044f!=''){_0xb1044f+='&';}_0xb1044f+=_0xf35ffd[_0x7a5d6a]+'='+encodeURIComponent(_0x49732b[_0xf35ffd[_0x7a5d6a]]);_0x40d052+=_0x49732b[_0xf35ffd[_0x7a5d6a]];}_0x40d052+=_0x1e8040[_0x7956('0x5c')];_0x40d052=_0x2d9f8d[_0x7956('0x5d')](_0x7956('0x5e'))['update'](_0x40d052)[_0x7956('0x5f')](_0x7956('0x60'));if(_0xb1044f!==''){_0xb1044f+='&';}_0xb1044f+=_0x7956('0x61')+_0x40d052;var _0x36e9a6={'method':_0x7956('0x30'),'uri':_0x1e8040[_0x7956('0x52')]+_0x7956('0x62')+_0xb1044f,'json':!![]};return rp(_0x36e9a6)[_0x7956('0x15')](function(_0x213d3d){var _0x3084bf=Object[_0x7956('0x63')](_0x213d3d);if(_0x213d3d[_0x3084bf[0x0]][_0x7956('0x19')]&&parseInt(_0x213d3d[_0x3084bf[0x0]]['error'])===0x0){var _0x46132a={'messageId':_0x213d3d[_0x3084bf[0x0]][_0x7956('0x64')]};if(!_0x1e8040[_0x7956('0x36')]){_0x46132a[_0x7956('0x37')]=!![];}return _0x127891[_0x7956('0x16')](_0x46132a);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7956('0x55'),util[_0x7956('0x26')](_0x213d3d['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x44c403){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7956('0x27'),'csc',util[_0x7956('0x26')](_0x44c403,{'showHidden':![],'depth':null}));});}else{logger[_0x7956('0x19')](_0x7956('0x25'),'afterCreate',_0x7956('0x55'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x1e8040[_0x7956('0x5c')]){var _0x15f2c0={'method':_0x7956('0x33'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x1e8040[_0x7956('0x5c')]},'body':{'content':_0x299e61[_0x7956('0xc')],'to':[_0x299e61[_0x7956('0x1f')]],'from':_0x1e8040[_0x7956('0x1f')],'binary':![],'clientMessageId':'uuid','charset':_0x7956('0x65')},'json':!![]};rp(_0x15f2c0)[_0x7956('0x15')](function(_0x47e42f){if(!_0x47e42f['error']){var _0x73a3c5={'messageId':_0x47e42f[_0x7956('0x47')][0x0][_0x7956('0x66')]};if(!_0x1e8040[_0x7956('0x36')]){_0x73a3c5[_0x7956('0x37')]=!![];}return _0x127891[_0x7956('0x16')](_0x73a3c5);}else{return logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),'clickatell',util[_0x7956('0x26')](_0x47e42f['error'],{'showHidden':![],'depth':null}));}})[_0x7956('0x18')](function(_0x1f3ac8){return logger['error'](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x67'),util[_0x7956('0x26')](_0x1f3ac8,{'showHidden':![],'depth':null}));});}else{logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x67'),'Missing\x20parameters:\x20apiKey');}break;case _0x7956('0x68'):if(_0x1e8040[_0x7956('0x2a')]&&_0x1e8040['password']){var _0x40680a=util[_0x7956('0x3f')]('%s:%s',_0x1e8040[_0x7956('0x2a')],_0x1e8040['password']);var _0xe825={'method':_0x7956('0x33'),'uri':_0x7956('0x69')+_0x1e8040['accountId']+'/messages','body':{'to':[_0x299e61[_0x7956('0x1f')]],'text':_0x299e61['body'],'from':_0x1e8040['phone'],'applicationId':_0x1e8040[_0x7956('0x6a')]},'headers':{'Authorization':util['format'](_0x7956('0x41'),new Buffer(_0x40680a)['toString'](_0x7956('0x42')))},'json':!![]};rp(_0xe825)[_0x7956('0x15')](function(_0x568a7c){if(_0x568a7c['id']){var _0x4430c6={'messageId':_0x568a7c['id']};return _0x127891[_0x7956('0x16')](_0x4430c6);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x7956('0x68'),util['inspect'](_0x568a7c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1f429a){logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x68'),util['inspect'](_0x1f429a,{'showHidden':![],'depth':null}));});}else{logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x68'),_0x7956('0x38'));}break;case _0x7956('0x6b'):if(_0x1e8040[_0x7956('0x5c')]){var _0x45dc2a={};var _0x36e9a6={'method':'POST','uri':_0x7956('0x6c'),'headers':{'Authorization':_0x7956('0x6d')+_0x1e8040[_0x7956('0x5c')],'Content-Type':_0x7956('0x53')},'body':{'from':_0x1e8040[_0x7956('0x1f')],'to':_0x299e61['phone'],'text':_0x299e61[_0x7956('0xc')]},'json':!![]};return rp(_0x36e9a6)[_0x7956('0x15')](function(_0x14ce4f){if(_0x14ce4f[_0x7956('0x6e')]==0xca){_0x45dc2a['message']=_0x14ce4f;var _0x55aae1={'method':_0x7956('0x33'),'uri':_0x7956('0x6f'),'headers':{'Authorization':_0x7956('0x6d')+_0x1e8040['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x45dc2a[_0x7956('0x70')][_0x7956('0x71')]},'json':!![]};return rp(_0x55aae1)[_0x7956('0x15')](function(_0x197289){_0x45dc2a['status']=_0x197289;var _0x3e581a={'messageId':_0x45dc2a[_0x7956('0x70')][_0x7956('0x71')],'read':!![]};return _0x127891[_0x7956('0x16')](_0x3e581a);});}else{return logger[_0x7956('0x19')](_0x7956('0x25'),_0x7956('0x27'),_0x7956('0x6b'),util[_0x7956('0x26')](_0x14ce4f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x58925b){return logger[_0x7956('0x19')](_0x7956('0x25'),'afterCreate',_0x7956('0x6b'),util[_0x7956('0x26')](_0x58925b,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x7956('0x25'),'afterCreate',_0x7956('0x6b'),_0x7956('0x72'));}break;}}})['finally'](function(){_0x5919db();});}else{_0x5919db();}}},'charset':_0x7956('0x73'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9063=['data','queued_count','head','message_id','clickSend','plivo','authId','/api/sms/messages/','/status?token=','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','apiKey','text','timestamp','keys','length','createHash','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','bandwidth','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','messageId','fti_sms_messages','FULLTEXT','models','get','direction','secret','isNil','findOne','SmsInteractionId','update','createdAt','toLowerCase','catch','error','out','SmsAccount','SmsAccountId','then','type','twilio','accountSid','authToken','messages','body','phone','remote','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','sender','login?username=','username','password','GET','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','POST','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code'];(function(_0x5871a7,_0x2525b4){var _0x38aaa1=function(_0x233a33){while(--_0x233a33){_0x5871a7['push'](_0x5871a7['shift']());}};_0x38aaa1(++_0x2525b4);}(_0x9063,0x1a2));var _0x3906=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x9063[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x3906('0x0'));var util=require(_0x3906('0x1'));var logger=require(_0x3906('0x2'))(_0x3906('0x3'));var moment=require(_0x3906('0x4'));var BPromise=require(_0x3906('0x5'));var rp=require(_0x3906('0x6'));var fs=require('fs');var path=require(_0x3906('0x7'));var rimraf=require('rimraf');var config=require(_0x3906('0x8'));var attributes=require(_0x3906('0x9'));module[_0x3906('0xa')]=function(_0x17c286,_0x79d5ae){return _0x17c286['define']('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x3906('0xb'),'fields':[_0x3906('0xb')]},{'name':_0x3906('0xc'),'fields':['body'],'type':_0x3906('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x469456,_0x4f4b46,_0x3c8f45){var _0x3218bb=_0x17c286[_0x3906('0xe')];var _0x535705=_0x469456[_0x3906('0xf')]({'plain':!![]});if(_0x535705[_0x3906('0x10')]['toLowerCase']()==='in'||_0x535705[_0x3906('0x10')]['toLowerCase']()==='out'&&!_0x535705[_0x3906('0x11')]&&!_[_0x3906('0x12')](_0x535705['UserId'])){_0x3218bb['SmsInteraction'][_0x3906('0x13')]({'where':{'id':_0x535705[_0x3906('0x14')]}})['then'](function(_0x57d5e4){if(_0x57d5e4){_0x57d5e4[_0x3906('0x15')]({'lastMsgAt':_0x535705[_0x3906('0x16')],'lastMsgDirection':_0x535705[_0x3906('0x10')][_0x3906('0x17')]()});}})[_0x3906('0x18')](function(_0x7d7401){console[_0x3906('0x19')](_0x7d7401);});}if(_0x535705[_0x3906('0x10')]===_0x3906('0x1a')&&!_0x535705[_0x3906('0x11')]){var _0x5b28bc;_0x3218bb[_0x3906('0x1b')]['find']({'where':{'id':_0x535705[_0x3906('0x1c')]},'raw':!![]})[_0x3906('0x1d')](function(_0x4b4221){_0x5b28bc=_0x4b4221;if(_0x5b28bc&&_0x5b28bc[_0x3906('0x1e')]){switch(_0x5b28bc['type']){case _0x3906('0x1f'):var _0x2fc1a2=require(_0x3906('0x1f'));if(_0x5b28bc[_0x3906('0x20')]&&_0x5b28bc[_0x3906('0x21')]&&_0x5b28bc['phone']){var _0x1495bc=new _0x2fc1a2(_0x5b28bc[_0x3906('0x20')],_0x5b28bc[_0x3906('0x21')]);_0x1495bc[_0x3906('0x22')]['create']({'body':_0x535705[_0x3906('0x23')],'to':_0x535705[_0x3906('0x24')],'from':_0x5b28bc[_0x3906('0x24')],'statusCallback':_0x5b28bc[_0x3906('0x25')]+'/api/sms/messages/'+_0x535705['id']+'/status?token='+_0x5b28bc[_0x3906('0x26')]})[_0x3906('0x1d')](function(_0x343821){if(_0x343821[_0x3906('0x27')]){return _0x469456['update']({'messageId':_0x343821[_0x3906('0x27')]});}})[_0x3906('0x18')](function(_0x5a471c){logger['error'](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x1f'),util['inspect'](_0x5a471c,{'showHidden':![],'depth':null}));});}else{logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x3906('0x2a'):var _0x59d260=_0x3906('0x2b');if(_0x5b28bc['username']&&_0x5b28bc['password']){var _0x21f846={'recipient':[_0x535705[_0x3906('0x24')]],'message':_0x535705[_0x3906('0x23')],'message_type':_0x5b28bc['smsMethod']};if(_0x5b28bc['smsMethod']&&_0x5b28bc[_0x3906('0x2c')]!=='SI'){_0x21f846[_0x3906('0x2d')]=_0x5b28bc[_0x3906('0x24')];}var _0x3e2562={'url':_0x59d260+_0x3906('0x2e')+_0x5b28bc[_0x3906('0x2f')]+'&password='+_0x5b28bc[_0x3906('0x30')],'method':_0x3906('0x31')};rp(_0x3e2562)['then'](function(_0x50eaa0){var _0x191e30=_0x50eaa0['split'](';');var _0x409e21={'user_key':_0x191e30[0x0],'session_key':_0x191e30[0x1]};_0x3e2562={'url':_0x59d260+_0x3906('0x32'),'method':'POST','headers':{'user_key':_0x409e21[_0x3906('0x33')],'Session_key':_0x409e21[_0x3906('0x34')]},'json':!![],'body':_0x21f846};return rp(_0x3e2562);})[_0x3906('0x1d')](function(_0x84b262){if(_0x84b262[_0x3906('0x35')]>=0x1){var _0x3e7e6e={'messageId':_0x84b262[_0x3906('0x36')]};if(_0x5b28bc[_0x3906('0x2c')]!=='GP'||!_0x5b28bc[_0x3906('0x37')]){_0x3e7e6e[_0x3906('0x38')]=!![];}return _0x469456['update'](_0x3e7e6e);}else{return logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x2a'),util['inspect'](_0x84b262,{'showHidden':![],'depth':null}));}})[_0x3906('0x18')](function(_0x153f51){return logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x2a'),util[_0x3906('0x39')](_0x153f51,{'showHidden':![],'depth':null}));});}else{logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x2a'),_0x3906('0x3a'));}break;case _0x3906('0x3b'):if(_0x5b28bc[_0x3906('0x21')]){var _0x54b569={'recipient':_0x535705['phone'],'message':_0x535705[_0x3906('0x23')],'sender':_0x5b28bc[_0x3906('0x3c')]||_0x5b28bc['phone'],'authorization':_0x5b28bc[_0x3906('0x21')]};var _0x4f4b46={'method':'POST','uri':_0x3906('0x3d'),'body':_0x54b569,'json':!![]};rp(_0x4f4b46)[_0x3906('0x1d')](function(_0x2e3def){var _0x5d0489={'messageId':_0x2e3def[_0x3906('0x3e')]};if(!_0x5b28bc['deliveryReport']){_0x5d0489[_0x3906('0x38')]=!![];}return _0x469456['update'](_0x5d0489);})[_0x3906('0x18')](function(_0x4d4365){logger['error'](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x3b'),util[_0x3906('0x39')](_0x4d4365,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x3b'),_0x3906('0x3f'));}break;case _0x3906('0x40'):if(_0x5b28bc['username']&&_0x5b28bc[_0x3906('0x30')]){var _0x54b569={'messages':[{'source':_0x3906('0x41'),'to':_0x535705[_0x3906('0x24')],'body':_0x535705['body'],'from':_0x5b28bc['senderString']||_0x5b28bc[_0x3906('0x24')]}]};var _0x196757=util[_0x3906('0x42')](_0x3906('0x43'),_0x5b28bc[_0x3906('0x2f')],_0x5b28bc[_0x3906('0x30')]);var _0x4f4b46={'method':_0x3906('0x44'),'uri':_0x3906('0x45'),'body':_0x54b569,'headers':{'Authorization':util[_0x3906('0x42')](_0x3906('0x46'),new Buffer(_0x196757)[_0x3906('0x47')](_0x3906('0x48')))},'json':!![]};rp(_0x4f4b46)[_0x3906('0x1d')](function(_0x38aacd){if(_0x38aacd[_0x3906('0x49')]>=0xc8&&_0x38aacd[_0x3906('0x49')]<=0xce){if(_0x38aacd[_0x3906('0x4a')]&&_0x38aacd['data'][_0x3906('0x4b')]>0x0){var _0x3e6e35=_[_0x3906('0x4c')](_0x38aacd['data']['messages']);var _0x3780cd={'messageId':_0x3e6e35[_0x3906('0x4d')]};if(!_0x5b28bc[_0x3906('0x37')]){_0x3780cd[_0x3906('0x38')]=!![];}return _0x469456[_0x3906('0x15')](_0x3780cd);}else{logger['error'](_0x3906('0x28'),'afterCreate',_0x3906('0x4e'),util[_0x3906('0x39')](_0x38aacd,{'showHidden':![],'depth':null}));}}else{logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x4e'),util[_0x3906('0x39')](_0x38aacd,{'showHidden':![],'depth':null}));}})['catch'](function(_0xbea2bf){logger['error'](_0x3906('0x28'),'afterCreate',_0x3906('0x4e'),util[_0x3906('0x39')](_0xbea2bf,{'showHidden':![],'depth':null}));});}else{logger[_0x3906('0x19')](_0x3906('0x28'),'afterCreate',_0x3906('0x4e'),_0x3906('0x3a'));}break;case _0x3906('0x4f'):if(_0x5b28bc[_0x3906('0x50')]&&_0x5b28bc[_0x3906('0x21')]){var _0x54b569={'dst':_0x535705[_0x3906('0x24')],'text':_0x535705['body'],'src':_0x5b28bc['senderString']||_0x5b28bc[_0x3906('0x24')],'url':_0x5b28bc['remote']+_0x3906('0x51')+_0x535705['id']+_0x3906('0x52')+_0x5b28bc[_0x3906('0x26')]};var _0x196757=util[_0x3906('0x42')](_0x3906('0x43'),_0x5b28bc[_0x3906('0x50')],_0x5b28bc['authToken']);var _0x4f4b46={'method':_0x3906('0x44'),'uri':util[_0x3906('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x5b28bc[_0x3906('0x50')]),'body':_0x54b569,'headers':{'Authorization':util[_0x3906('0x42')](_0x3906('0x46'),new Buffer(_0x196757)[_0x3906('0x47')]('base64'))},'json':!![]};rp(_0x4f4b46)[_0x3906('0x1d')](function(_0x3883eb){var _0x3451d7={'messageId':_0x3883eb[_0x3906('0x53')][0x0]};return _0x469456[_0x3906('0x15')](_0x3451d7);})[_0x3906('0x18')](function(_0x181a4a){logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x4f'),util[_0x3906('0x39')](_0x181a4a,{'showHidden':![],'depth':null}));});}else{logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x4f'),_0x3906('0x54'));}break;case _0x3906('0x55'):if(_0x5b28bc['username']&&_0x5b28bc['password']){if(_0x5b28bc[_0x3906('0x56')]){var _0x530cf4={'method':_0x3906('0x44'),'uri':_0x5b28bc[_0x3906('0x56')]+_0x3906('0x57'),'body':{'username':_0x5b28bc['username'],'password':_0x5b28bc[_0x3906('0x30')]},'json':!![]};return rp(_0x530cf4)[_0x3906('0x1d')](function(_0x494962){var _0x311d0a={'method':_0x3906('0x44'),'uri':_0x5b28bc[_0x3906('0x56')]+_0x3906('0x58'),'body':{'messages':[{'from':_0x5b28bc['phone'],'destinations':[{'to':_0x535705[_0x3906('0x24')]}],'text':_0x535705[_0x3906('0x23')],'notifyUrl':_0x5b28bc[_0x3906('0x25')]+_0x3906('0x51')+_0x535705['id']+'/status?token='+_0x5b28bc[_0x3906('0x26')],'notifyContentType':_0x3906('0x59'),'callbackData':_0x5b28bc['phone']+';'+_0x535705[_0x3906('0x23')]}]},'headers':{'Authorization':_0x3906('0x5a')+_0x494962['token']},'json':!![]};return rp(_0x311d0a)['then'](function(_0x52ded9){if(_0x52ded9[_0x3906('0x22')]){var _0x544800={'messageId':_0x52ded9[_0x3906('0x22')][0x0][_0x3906('0xb')]};if(!_0x5b28bc[_0x3906('0x37')]){_0x544800['read']=!![];}return _0x469456[_0x3906('0x15')](_0x544800);}else{return logger['error'](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x55'),util['inspect'](_0x52ded9,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x50dab0){return logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x55'),util['inspect'](_0x50dab0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x55'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x55'),_0x3906('0x3a'));}break;case _0x3906('0x5b'):var _0x2f8a9c=require(_0x3906('0x5c'));if(_0x5b28bc[_0x3906('0x5d')]){var _0x41c993={};_0x41c993['login']=_0x5b28bc['username'];_0x41c993[_0x3906('0x24')]=_0x535705[_0x3906('0x24')];_0x41c993[_0x3906('0x2d')]=_0x5b28bc[_0x3906('0x24')];_0x41c993[_0x3906('0x5e')]=_0x535705[_0x3906('0x23')];_0x41c993[_0x3906('0x5f')]=+new Date();var _0x494051='';var _0x161314='';var _0x5d9893=Object[_0x3906('0x60')](_0x41c993);_0x5d9893['sort']();for(var _0x2a0743=0x0;_0x2a0743<_0x5d9893[_0x3906('0x61')];_0x2a0743++){if(_0x494051!=''){_0x494051+='&';}_0x494051+=_0x5d9893[_0x2a0743]+'='+encodeURIComponent(_0x41c993[_0x5d9893[_0x2a0743]]);_0x161314+=_0x41c993[_0x5d9893[_0x2a0743]];}_0x161314+=_0x5b28bc['apiKey'];_0x161314=_0x2f8a9c[_0x3906('0x62')]('md5')[_0x3906('0x15')](_0x161314)[_0x3906('0x63')](_0x3906('0x64'));if(_0x494051!==''){_0x494051+='&';}_0x494051+=_0x3906('0x65')+_0x161314;var _0x3e2562={'method':_0x3906('0x31'),'uri':_0x5b28bc[_0x3906('0x56')]+_0x3906('0x66')+_0x494051,'json':!![]};return rp(_0x3e2562)['then'](function(_0x457571){var _0x4fc8a5=Object[_0x3906('0x60')](_0x457571);if(_0x457571[_0x4fc8a5[0x0]]['error']&&parseInt(_0x457571[_0x4fc8a5[0x0]][_0x3906('0x19')])===0x0){var _0x12133d={'messageId':_0x457571[_0x4fc8a5[0x0]]['id_sms']};if(!_0x5b28bc['deliveryReport']){_0x12133d['read']=!![];}return _0x469456['update'](_0x12133d);}else{return logger[_0x3906('0x19')](_0x3906('0x28'),'afterCreate','csc',util[_0x3906('0x39')](_0x457571[_0x3906('0x19')],{'showHidden':![],'depth':null}));}})[_0x3906('0x18')](function(_0x22faf1){return logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),'csc',util['inspect'](_0x22faf1,{'showHidden':![],'depth':null}));});}else{logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),'csc',_0x3906('0x67'));}break;case'clickatell':if(_0x5b28bc[_0x3906('0x5d')]){var _0x35ea5f={'method':'POST','uri':_0x3906('0x68'),'headers':{'Authorization':_0x5b28bc[_0x3906('0x5d')]},'body':{'content':_0x535705[_0x3906('0x23')],'to':[_0x535705[_0x3906('0x24')]],'from':_0x5b28bc[_0x3906('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0x3906('0x69')},'json':!![]};rp(_0x35ea5f)['then'](function(_0x5cfef1){if(!_0x5cfef1[_0x3906('0x19')]){var _0x98afa9={'messageId':_0x5cfef1[_0x3906('0x22')][0x0][_0x3906('0x6a')]};if(!_0x5b28bc[_0x3906('0x37')]){_0x98afa9[_0x3906('0x38')]=!![];}return _0x469456[_0x3906('0x15')](_0x98afa9);}else{return logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x6b'),util[_0x3906('0x39')](_0x5cfef1['error'],{'showHidden':![],'depth':null}));}})[_0x3906('0x18')](function(_0x6c682a){return logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x6b'),util['inspect'](_0x6c682a,{'showHidden':![],'depth':null}));});}else{logger[_0x3906('0x19')](_0x3906('0x28'),'afterCreate',_0x3906('0x6b'),_0x3906('0x67'));}break;case _0x3906('0x6c'):if(_0x5b28bc['username']&&_0x5b28bc[_0x3906('0x30')]){var _0x196757=util[_0x3906('0x42')](_0x3906('0x43'),_0x5b28bc[_0x3906('0x2f')],_0x5b28bc[_0x3906('0x30')]);var _0x4f4b46={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x5b28bc[_0x3906('0x6d')]+'/messages','body':{'to':[_0x535705['phone']],'text':_0x535705[_0x3906('0x23')],'from':_0x5b28bc[_0x3906('0x24')],'applicationId':_0x5b28bc[_0x3906('0x6e')]},'headers':{'Authorization':util[_0x3906('0x42')](_0x3906('0x46'),new Buffer(_0x196757)[_0x3906('0x47')](_0x3906('0x48')))},'json':!![]};rp(_0x4f4b46)[_0x3906('0x1d')](function(_0x16838e){if(_0x16838e['id']){var _0x35a9a6={'messageId':_0x16838e['id']};return _0x469456[_0x3906('0x15')](_0x35a9a6);}else{logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x6c'),util[_0x3906('0x39')](_0x16838e,{'showHidden':![],'depth':null}));}})[_0x3906('0x18')](function(_0x4b071f){logger[_0x3906('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3906('0x29'),_0x3906('0x6c'),util[_0x3906('0x39')](_0x4b071f,{'showHidden':![],'depth':null}));});}else{logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x6c'),_0x3906('0x3a'));}break;case _0x3906('0x6f'):if(_0x5b28bc[_0x3906('0x5d')]){var _0x3f9d96={};var _0x3e2562={'method':'POST','uri':_0x3906('0x70'),'headers':{'Authorization':_0x3906('0x71')+_0x5b28bc[_0x3906('0x5d')],'Content-Type':_0x3906('0x59')},'body':{'from':_0x5b28bc['phone'],'to':_0x535705[_0x3906('0x24')],'text':_0x535705[_0x3906('0x23')]},'json':!![]};return rp(_0x3e2562)[_0x3906('0x1d')](function(_0x5bbbca){if(_0x5bbbca[_0x3906('0x72')]==0xca){_0x3f9d96[_0x3906('0x73')]=_0x5bbbca;var _0x2c8763={'method':_0x3906('0x44'),'uri':_0x3906('0x74'),'headers':{'Authorization':_0x3906('0x71')+_0x5b28bc[_0x3906('0x5d')],'Content-Type':_0x3906('0x59')},'body':{'refid':_0x3f9d96['message'][_0x3906('0x75')]},'json':!![]};return rp(_0x2c8763)[_0x3906('0x1d')](function(_0x2b4329){_0x3f9d96[_0x3906('0x76')]=_0x2b4329;var _0x241ad2={'messageId':_0x3f9d96[_0x3906('0x73')][_0x3906('0x75')],'read':!![]};return _0x469456[_0x3906('0x15')](_0x241ad2);});}else{return logger[_0x3906('0x19')](_0x3906('0x28'),_0x3906('0x29'),_0x3906('0x6f'),util[_0x3906('0x39')](_0x5bbbca,{'showHidden':![],'depth':null}));}})[_0x3906('0x18')](function(_0x16cce3){return logger[_0x3906('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3906('0x29'),_0x3906('0x6f'),util['inspect'](_0x16cce3,{'showHidden':![],'depth':null}));});}else{return logger[_0x3906('0x19')](_0x3906('0x28'),'afterCreate',_0x3906('0x6f'),_0x3906('0x77'));}break;}}})[_0x3906('0x78')](function(){_0x3c8f45();});}else{_0x3c8f45();}}},'charset':_0x3906('0x79'),'collate':_0x3906('0x7a')});};
\ No newline at end of file
index e9d62dc..17ac9f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe920=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','then','CreateSmsMessage'];(function(_0x570574,_0x6d3a81){var _0x3c0609=function(_0x2cef6f){while(--_0x2cef6f){_0x570574['push'](_0x570574['shift']());}};_0x3c0609(++_0x6d3a81);}(_0xe920,0x18c));var _0x0e92=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xe920[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0x0e92('0x0'));var util=require(_0x0e92('0x1'));var moment=require(_0x0e92('0x2'));var BPromise=require(_0x0e92('0x3'));var rs=require(_0x0e92('0x4'));var fs=require('fs');var Redis=require(_0x0e92('0x5'));var db=require(_0x0e92('0x6'))['db'];var utils=require(_0x0e92('0x7'));var logger=require(_0x0e92('0x8'))(_0x0e92('0x9'));var config=require(_0x0e92('0xa'));var jayson=require(_0x0e92('0xb'));var client=jayson[_0x0e92('0xc')][_0x0e92('0xd')]({'port':0x232a});config['redis']=_[_0x0e92('0xe')](config[_0x0e92('0xf')],{'host':_0x0e92('0x10'),'port':0x18eb});var socket=require(_0x0e92('0x11'))(new Redis(config['redis']));require(_0x0e92('0x12'))[_0x0e92('0x13')](socket);function respondWithRpcPromise(_0x4ece62,_0x1475db,_0x2109aa){return new BPromise(function(_0x4bb54f,_0x3a9b2c){return client[_0x0e92('0x14')](_0x4ece62,_0x2109aa)['then'](function(_0x2638dc){logger[_0x0e92('0x15')](_0x0e92('0x16'),_0x1475db,_0x0e92('0x17'));logger[_0x0e92('0x18')](_0x0e92('0x19'),_0x1475db,_0x0e92('0x17'),JSON[_0x0e92('0x1a')](_0x2638dc));if(_0x2638dc['error']){if(_0x2638dc[_0x0e92('0x1b')][_0x0e92('0x1c')]===0x1f4){logger[_0x0e92('0x1b')]('SmsMessage,\x20%s,\x20%s',_0x1475db,_0x2638dc['error'][_0x0e92('0x1d')]);return _0x3a9b2c(_0x2638dc[_0x0e92('0x1b')][_0x0e92('0x1d')]);}logger[_0x0e92('0x1b')](_0x0e92('0x16'),_0x1475db,_0x2638dc['error'][_0x0e92('0x1d')]);return _0x4bb54f(_0x2638dc[_0x0e92('0x1b')][_0x0e92('0x1d')]);}else{logger['info'](_0x0e92('0x16'),_0x1475db,_0x0e92('0x17'));_0x4bb54f(_0x2638dc['result'][_0x0e92('0x1d')]);}})[_0x0e92('0x1e')](function(_0x2eed9c){logger[_0x0e92('0x1b')](_0x0e92('0x16'),_0x1475db,_0x2eed9c);_0x3a9b2c(_0x2eed9c);});});}exports['CreateSmsMessage']=function(_0x390bf0){var _0x1b775a=this;return new Promise(function(_0x5584a0,_0x388ad3){return db['SmsMessage'][_0x0e92('0x1f')](_0x390bf0[_0x0e92('0x20')],{'raw':_0x390bf0[_0x0e92('0x21')]?_0x390bf0[_0x0e92('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x0e92('0x22')](function(_0x5a8289){logger[_0x0e92('0x15')]('CreateSmsMessage',_0x390bf0);logger[_0x0e92('0x18')](_0x0e92('0x23'),_0x390bf0,JSON[_0x0e92('0x1a')](_0x5a8289));_0x5584a0(_0x5a8289);})[_0x0e92('0x1e')](function(_0x14ab09){logger['error'](_0x0e92('0x23'),_0x14ab09[_0x0e92('0x1d')],_0x390bf0);_0x388ad3(_0x1b775a[_0x0e92('0x1b')](0x1f4,_0x14ab09[_0x0e92('0x1d')]));});});};
\ No newline at end of file
+var _0xfefc=['ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','./smsMessage.socket','register','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','info','stringify','lodash','bluebird','randomstring'];(function(_0x5c720a,_0xe7bf7e){var _0x126186=function(_0xcddb40){while(--_0xcddb40){_0x5c720a['push'](_0x5c720a['shift']());}};_0x126186(++_0xe7bf7e);}(_0xfefc,0x15d));var _0xcfef=function(_0x2bc678,_0x4bb174){_0x2bc678=_0x2bc678-0x0;var _0x1844e8=_0xfefc[_0x2bc678];return _0x1844e8;};'use strict';var _=require(_0xcfef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcfef('0x1'));var rs=require(_0xcfef('0x2'));var fs=require('fs');var Redis=require(_0xcfef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfef('0x4'));var logger=require('../../config/logger')(_0xcfef('0x5'));var config=require(_0xcfef('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcfef('0x7')][_0xcfef('0x8')]({'port':0x232a});config['redis']=_[_0xcfef('0x9')](config[_0xcfef('0xa')],{'host':_0xcfef('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfef('0xa')]));require(_0xcfef('0xc'))[_0xcfef('0xd')](socket);function respondWithRpcPromise(_0x87b637,_0x43c125,_0x52cc8e){return new BPromise(function(_0x565d86,_0x4e1c7c){return client['request'](_0x87b637,_0x52cc8e)[_0xcfef('0xe')](function(_0x7e0957){logger['info'](_0xcfef('0xf'),_0x43c125,_0xcfef('0x10'));logger[_0xcfef('0x11')](_0xcfef('0x12'),_0x43c125,_0xcfef('0x10'),JSON['stringify'](_0x7e0957));if(_0x7e0957[_0xcfef('0x13')]){if(_0x7e0957[_0xcfef('0x13')][_0xcfef('0x14')]===0x1f4){logger[_0xcfef('0x13')](_0xcfef('0xf'),_0x43c125,_0x7e0957['error'][_0xcfef('0x15')]);return _0x4e1c7c(_0x7e0957[_0xcfef('0x13')]['message']);}logger[_0xcfef('0x13')](_0xcfef('0xf'),_0x43c125,_0x7e0957[_0xcfef('0x13')][_0xcfef('0x15')]);return _0x565d86(_0x7e0957[_0xcfef('0x13')][_0xcfef('0x15')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x43c125,'request\x20sent');_0x565d86(_0x7e0957[_0xcfef('0x16')][_0xcfef('0x15')]);}})[_0xcfef('0x17')](function(_0x518eac){logger[_0xcfef('0x13')](_0xcfef('0xf'),_0x43c125,_0x518eac);_0x4e1c7c(_0x518eac);});});}exports[_0xcfef('0x18')]=function(_0x56c248){var _0x57b606=this;return new Promise(function(_0x99440d,_0x579cef){return db[_0xcfef('0x19')][_0xcfef('0x1a')](_0x56c248[_0xcfef('0x1b')],{'raw':_0x56c248['options']?_0x56c248[_0xcfef('0x1c')][_0xcfef('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x547edc){logger[_0xcfef('0x1e')](_0xcfef('0x18'),_0x56c248);logger['debug']('CreateSmsMessage',_0x56c248,JSON[_0xcfef('0x1f')](_0x547edc));_0x99440d(_0x547edc);})[_0xcfef('0x17')](function(_0x57d969){logger['error'](_0xcfef('0x18'),_0x57d969[_0xcfef('0x15')],_0x56c248);_0x579cef(_0x57b606[_0xcfef('0x13')](0x1f4,_0x57d969[_0xcfef('0x15')]));});});};
\ No newline at end of file
index 3cc0e1e..54de1a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba25=['remove','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0xba25,0x6e));var _0x5ba2=function(_0x158630,_0x2d9759){_0x158630=_0x158630-0x0;var _0x20f146=_0xba25[_0x158630];return _0x20f146;};'use strict';var SmsMessageEvents=require(_0x5ba2('0x0'));var events=[_0x5ba2('0x1'),_0x5ba2('0x2'),'update'];function createListener(_0x221be5,_0x458b43){return function(_0x5095dc){_0x458b43['emit'](_0x221be5,_0x5095dc);};}function removeListener(_0x2f2573,_0xa4856c){return function(){SmsMessageEvents[_0x5ba2('0x3')](_0x2f2573,_0xa4856c);};}exports[_0x5ba2('0x4')]=function(_0x5226d0){for(var _0x32a89a=0x0,_0x184b05=events[_0x5ba2('0x5')];_0x32a89a<_0x184b05;_0x32a89a++){var _0x59112d=events[_0x32a89a];var _0x4e2f5b=createListener(_0x5ba2('0x6')+_0x59112d,_0x5226d0);SmsMessageEvents['on'](_0x59112d,_0x4e2f5b);}};
\ No newline at end of file
+var _0xf652=['length','./smsMessage.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf652,0x67));var _0x2f65=function(_0xa08b52,_0x166a59){_0xa08b52=_0xa08b52-0x0;var _0x311035=_0xf652[_0xa08b52];return _0x311035;};'use strict';var SmsMessageEvents=require(_0x2f65('0x0'));var events=[_0x2f65('0x1'),_0x2f65('0x2'),'update'];function createListener(_0x4b8aad,_0xde4934){return function(_0x9bdff9){_0xde4934[_0x2f65('0x3')](_0x4b8aad,_0x9bdff9);};}function removeListener(_0x56cebc,_0x5e5baa){return function(){SmsMessageEvents[_0x2f65('0x4')](_0x56cebc,_0x5e5baa);};}exports['register']=function(_0x1dda08){for(var _0x2f9dcf=0x0,_0x416eb6=events[_0x2f65('0x5')];_0x2f9dcf<_0x416eb6;_0x2f9dcf++){var _0x43d0c0=events[_0x2f9dcf];var _0x2a62d0=createListener('smsMessage:'+_0x43d0c0,_0x1dda08);SmsMessageEvents['on'](_0x43d0c0,_0x2a62d0);}};
\ No newline at end of file
index 30251cf..3a52b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53e5=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./smsQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x53e5,0x138));var _0x553e=function(_0x3d10c0,_0x2dfd0f){_0x3d10c0=_0x3d10c0-0x0;var _0x5f39d4=_0x53e5[_0x3d10c0];return _0x5f39d4;};'use strict';var multer=require(_0x553e('0x0'));var util=require('util');var path=require(_0x553e('0x1'));var timeout=require(_0x553e('0x2'));var express=require('express');var router=express[_0x553e('0x3')]();var fs_extra=require(_0x553e('0x4'));var auth=require(_0x553e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x553e('0x6'));router[_0x553e('0x7')]('/',auth[_0x553e('0x8')](),controller[_0x553e('0x9')]);router[_0x553e('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x553e('0x7')](_0x553e('0xa'),auth[_0x553e('0x8')](),controller[_0x553e('0xb')]);router['get'](_0x553e('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x553e('0x7')](_0x553e('0xd'),auth[_0x553e('0x8')](),controller[_0x553e('0xe')]);router[_0x553e('0x7')](_0x553e('0xf'),auth[_0x553e('0x8')](),controller[_0x553e('0x10')]);router[_0x553e('0x11')]('/',auth[_0x553e('0x8')](),controller[_0x553e('0x12')]);router[_0x553e('0x11')](_0x553e('0xd'),auth['isAuthenticated'](),controller['addTeams']);router[_0x553e('0x11')](_0x553e('0xf'),auth['isAuthenticated'](),controller[_0x553e('0x13')]);router[_0x553e('0x14')](_0x553e('0xa'),auth[_0x553e('0x8')](),controller[_0x553e('0x15')]);router[_0x553e('0x16')](_0x553e('0xa'),auth[_0x553e('0x8')](),controller[_0x553e('0x17')]);router['delete'](_0x553e('0xd'),auth['isAuthenticated'](),controller[_0x553e('0x18')]);router[_0x553e('0x16')](_0x553e('0xf'),auth['isAuthenticated'](),controller[_0x553e('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x2487=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addAgents','put','/:id','delete','removeTeams','removeAgents','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x2487,0x1c0));var _0x7248=function(_0x227cfb,_0x4f42cf){_0x227cfb=_0x227cfb-0x0;var _0x131407=_0x2487[_0x227cfb];return _0x131407;};'use strict';var multer=require(_0x7248('0x0'));var util=require(_0x7248('0x1'));var path=require(_0x7248('0x2'));var timeout=require(_0x7248('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7248('0x4'));var auth=require(_0x7248('0x5'));var interaction=require(_0x7248('0x6'));var config=require(_0x7248('0x7'));var controller=require(_0x7248('0x8'));router[_0x7248('0x9')]('/',auth[_0x7248('0xa')](),controller[_0x7248('0xb')]);router['get'](_0x7248('0xc'),auth[_0x7248('0xa')](),controller[_0x7248('0xd')]);router[_0x7248('0x9')]('/:id',auth[_0x7248('0xa')](),controller[_0x7248('0xe')]);router['get'](_0x7248('0xf'),auth[_0x7248('0xa')](),controller[_0x7248('0x10')]);router[_0x7248('0x9')](_0x7248('0x11'),auth[_0x7248('0xa')](),controller['getTeams']);router[_0x7248('0x9')](_0x7248('0x12'),auth[_0x7248('0xa')](),controller['getAgents']);router[_0x7248('0x13')]('/',auth['isAuthenticated'](),controller[_0x7248('0x14')]);router['post'](_0x7248('0x11'),auth[_0x7248('0xa')](),controller['addTeams']);router['post']('/:id/users',auth[_0x7248('0xa')](),controller[_0x7248('0x15')]);router[_0x7248('0x16')](_0x7248('0x17'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x7248('0x18')](_0x7248('0x11'),auth[_0x7248('0xa')](),controller[_0x7248('0x19')]);router[_0x7248('0x18')](_0x7248('0x12'),auth[_0x7248('0xa')](),controller[_0x7248('0x1a')]);module[_0x7248('0x1b')]=router;
\ No newline at end of file
index f563db0..4fc7ad0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6d4=['STRING','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x51d271,_0x33a3f9){var _0x496c5d=function(_0x1da6ec){while(--_0x1da6ec){_0x51d271['push'](_0x51d271['shift']());}};_0x496c5d(++_0x33a3f9);}(_0xb6d4,0x1a3));var _0x4b6d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb6d4[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x4b6d('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b6d('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4b6d('0x1')]},'timeout':{'type':Sequelize[_0x4b6d('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4b6d('0x3')]('rrmemory','beepall',_0x4b6d('0x4'))}};
\ No newline at end of file
+var _0x8401=['roundrobin','sequelize','name','STRING','rrmemory','beepall'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x8401,0x97));var _0x1840=function(_0x18942d,_0x2dac87){_0x18942d=_0x18942d-0x0;var _0x2091e9=_0x8401[_0x18942d];return _0x2091e9;};'use strict';var Sequelize=require(_0x1840('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1840('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1840('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1840('0x3'),_0x1840('0x4'),_0x1840('0x5'))}};
\ No newline at end of file
index 4d71570..b0709ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d19=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','key','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','SmsQueue','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','order','SmsQueueId','UserSmsQueue','User','UserId','updatedAt','createdAt','%s/%s','SIP','smsPause','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','every','TeamId','all','union','compact','value','isEmpty','addAgents','omit','removeAgents','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x51568d,_0xa4d7b){var _0x2d9494=function(_0x1f3b4b){while(--_0x1f3b4b){_0x51568d['push'](_0x51568d['shift']());}};_0x2d9494(++_0xa4d7b);}(_0x7d19,0x104));var _0x97d1=function(_0x593941,_0x54b080){_0x593941=_0x593941-0x0;var _0x292692=_0x7d19[_0x593941];return _0x292692;};'use strict';var emlformat=require(_0x97d1('0x0'));var rimraf=require(_0x97d1('0x1'));var zipdir=require(_0x97d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97d1('0x3'));var moment=require(_0x97d1('0x4'));var BPromise=require(_0x97d1('0x5'));var Mustache=require(_0x97d1('0x6'));var util=require(_0x97d1('0x7'));var path=require(_0x97d1('0x8'));var sox=require(_0x97d1('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97d1('0xa'));var _=require(_0x97d1('0xb'));var squel=require(_0x97d1('0xc'));var crypto=require(_0x97d1('0xd'));var jsforce=require(_0x97d1('0xe'));var deskjs=require(_0x97d1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x97d1('0x10'));var Papa=require(_0x97d1('0x11'));var Redis=require(_0x97d1('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97d1('0x13'));var logger=require(_0x97d1('0x14'))(_0x97d1('0x15'));var utils=require('../../config/utils');var config=require(_0x97d1('0x16'));var licenseUtil=require(_0x97d1('0x17'));var db=require(_0x97d1('0x18'))['db'];config[_0x97d1('0x19')]=_[_0x97d1('0x1a')](config[_0x97d1('0x19')],{'host':_0x97d1('0x1b'),'port':0x18eb});var socket=require(_0x97d1('0x1c'))(new Redis(config[_0x97d1('0x19')]));require('./smsQueue.socket')[_0x97d1('0x1d')](socket);function respondWithStatusCode(_0x345625,_0x26a3b6){_0x26a3b6=_0x26a3b6||0xcc;return function(_0x56503f){if(_0x56503f){return _0x345625['sendStatus'](_0x26a3b6);}return _0x345625['status'](_0x26a3b6)[_0x97d1('0x1e')]();};}function respondWithResult(_0x15a665,_0x56aaa9){_0x56aaa9=_0x56aaa9||0xc8;return function(_0x1e4c88){if(_0x1e4c88){return _0x15a665[_0x97d1('0x1f')](_0x56aaa9)[_0x97d1('0x20')](_0x1e4c88);}};}function respondWithFilteredResult(_0x5ad596,_0x306192){return function(_0x416af1){if(_0x416af1){var _0x17275a=typeof _0x306192[_0x97d1('0x21')]==='undefined'&&typeof _0x306192[_0x97d1('0x22')]===_0x97d1('0x23');var _0x3c20af=_0x416af1[_0x97d1('0x24')];var _0x2263ce=_0x17275a?0x0:_0x306192[_0x97d1('0x21')];var _0x9e3cfd=_0x17275a?_0x416af1[_0x97d1('0x24')]:_0x306192['offset']+_0x306192['limit'];var _0x3162a9;if(_0x9e3cfd>=_0x3c20af){_0x9e3cfd=_0x3c20af;_0x3162a9=0xc8;}else{_0x3162a9=0xce;}_0x5ad596['status'](_0x3162a9);return _0x5ad596[_0x97d1('0x25')](_0x97d1('0x26'),_0x2263ce+'-'+_0x9e3cfd+'/'+_0x3c20af)[_0x97d1('0x20')](_0x416af1);}return null;};}function patchUpdates(_0x417ba5){return function(_0x2ac360){try{jsonpatch[_0x97d1('0x27')](_0x2ac360,_0x417ba5,!![]);}catch(_0x4facb7){return BPromise[_0x97d1('0x28')](_0x4facb7);}return _0x2ac360[_0x97d1('0x29')]();};}function saveUpdates(_0x21be5a,_0x38e208){return function(_0x45166c){if(_0x45166c){return _0x45166c[_0x97d1('0x2a')](_0x21be5a)[_0x97d1('0x2b')](function(_0x5e936f){return _0x5e936f;});}return null;};}function removeEntity(_0x5a00ef,_0x1f8b73){return function(_0x344206){if(_0x344206){return _0x344206[_0x97d1('0x2c')]()[_0x97d1('0x2b')](function(){var _0x219d1a=_0x344206[_0x97d1('0x2d')]({'plain':!![]});var _0x142644=_0x97d1('0x2e');return db[_0x97d1('0x2f')][_0x97d1('0x2c')]({'where':{'type':_0x142644,'resourceId':_0x219d1a['id']}})[_0x97d1('0x2b')](function(){return _0x344206;});})[_0x97d1('0x2b')](function(){_0x5a00ef[_0x97d1('0x1f')](0xcc)[_0x97d1('0x1e')]();});}};}function handleEntityNotFound(_0x5015ff,_0x19751f){return function(_0x169a1f){if(!_0x169a1f){_0x5015ff[_0x97d1('0x30')](0x194);}return _0x169a1f;};}function handleError(_0x1a653a,_0x33e650){_0x33e650=_0x33e650||0x1f4;return function(_0x49def2){logger[_0x97d1('0x31')](_0x49def2[_0x97d1('0x32')]);if(_0x49def2['name']){delete _0x49def2[_0x97d1('0x33')];}_0x1a653a['status'](_0x33e650)[_0x97d1('0x34')](_0x49def2);};}exports[_0x97d1('0x35')]=function(_0x3b37df,_0x38e9d0){var _0x20f114={},_0x57e876={},_0x3426ac={'count':0x0,'rows':[]};var _0x5d5c8a=_[_0x97d1('0x36')](db['SmsQueue']['rawAttributes'],function(_0x114e45){return{'name':_0x114e45[_0x97d1('0x37')],'type':_0x114e45['type'][_0x97d1('0x38')]};});_0x57e876['model']=_[_0x97d1('0x36')](_0x5d5c8a,_0x97d1('0x33'));_0x57e876[_0x97d1('0x39')]=_['keys'](_0x3b37df[_0x97d1('0x39')]);_0x57e876['filters']=_['intersection'](_0x57e876[_0x97d1('0x3a')],_0x57e876['query']);_0x20f114[_0x97d1('0x3b')]=_[_0x97d1('0x3c')](_0x57e876[_0x97d1('0x3a')],qs[_0x97d1('0x3d')](_0x3b37df[_0x97d1('0x39')]['fields']));_0x20f114[_0x97d1('0x3b')]=_0x20f114['attributes']['length']?_0x20f114[_0x97d1('0x3b')]:_0x57e876['model'];if(!_0x3b37df[_0x97d1('0x39')][_0x97d1('0x3e')](_0x97d1('0x3f'))){_0x20f114[_0x97d1('0x22')]=qs[_0x97d1('0x22')](_0x3b37df[_0x97d1('0x39')][_0x97d1('0x22')]);_0x20f114[_0x97d1('0x21')]=qs[_0x97d1('0x21')](_0x3b37df['query'][_0x97d1('0x21')]);}_0x20f114['order']=qs['sort'](_0x3b37df[_0x97d1('0x39')][_0x97d1('0x40')]);_0x20f114[_0x97d1('0x41')]=qs['filters'](_[_0x97d1('0x42')](_0x3b37df['query'],_0x57e876[_0x97d1('0x43')]),_0x5d5c8a);if(_0x3b37df[_0x97d1('0x39')]['filter']){_0x20f114['where']=_[_0x97d1('0x44')](_0x20f114['where'],{'$or':_[_0x97d1('0x36')](_0x5d5c8a,function(_0x5e5079){if(_0x5e5079['type']!==_0x97d1('0x45')){var _0x351e4e={};_0x351e4e[_0x5e5079[_0x97d1('0x33')]]={'$like':'%'+_0x3b37df[_0x97d1('0x39')][_0x97d1('0x46')]+'%'};return _0x351e4e;}})});}_0x20f114=_['merge']({},_0x20f114,_0x3b37df['options']);var _0x117fe2={'where':_0x20f114[_0x97d1('0x41')]};return db[_0x97d1('0x47')][_0x97d1('0x24')](_0x117fe2)[_0x97d1('0x2b')](function(_0x58019b){_0x3426ac[_0x97d1('0x24')]=_0x58019b;if(_0x3b37df[_0x97d1('0x39')][_0x97d1('0x48')]){_0x20f114[_0x97d1('0x49')]=[{'all':!![]}];}return db['SmsQueue'][_0x97d1('0x4a')](_0x20f114);})[_0x97d1('0x2b')](function(_0x1709ca){_0x3426ac[_0x97d1('0x4b')]=_0x1709ca;return _0x3426ac;})[_0x97d1('0x2b')](respondWithFilteredResult(_0x38e9d0,_0x20f114))[_0x97d1('0x4c')](handleError(_0x38e9d0,null));};exports['show']=function(_0x4c7603,_0x47f0bd){var _0x305fd8={'raw':!![],'where':{'id':_0x4c7603[_0x97d1('0x4d')]['id']}},_0x2bfa7b={};_0x2bfa7b[_0x97d1('0x3a')]=_[_0x97d1('0x4e')](db[_0x97d1('0x47')][_0x97d1('0x4f')]);_0x2bfa7b[_0x97d1('0x39')]=_[_0x97d1('0x4e')](_0x4c7603[_0x97d1('0x39')]);_0x2bfa7b['filters']=_[_0x97d1('0x3c')](_0x2bfa7b[_0x97d1('0x3a')],_0x2bfa7b[_0x97d1('0x39')]);_0x305fd8[_0x97d1('0x3b')]=_['intersection'](_0x2bfa7b[_0x97d1('0x3a')],qs[_0x97d1('0x3d')](_0x4c7603[_0x97d1('0x39')][_0x97d1('0x3d')]));_0x305fd8[_0x97d1('0x3b')]=_0x305fd8[_0x97d1('0x3b')][_0x97d1('0x50')]?_0x305fd8[_0x97d1('0x3b')]:_0x2bfa7b['model'];if(_0x4c7603[_0x97d1('0x39')]['includeAll']){_0x305fd8[_0x97d1('0x49')]=[{'all':!![]}];}_0x305fd8=_['merge']({},_0x305fd8,_0x4c7603[_0x97d1('0x51')]);return db[_0x97d1('0x47')][_0x97d1('0x52')](_0x305fd8)[_0x97d1('0x2b')](handleEntityNotFound(_0x47f0bd,null))[_0x97d1('0x2b')](respondWithResult(_0x47f0bd,null))['catch'](handleError(_0x47f0bd,null));};exports[_0x97d1('0x53')]=function(_0x3a0501,_0x390bdc){return db[_0x97d1('0x47')]['create'](_0x3a0501['body'],{})[_0x97d1('0x2b')](function(_0x3d554e){var _0x1ea7ac=_0x3a0501[_0x97d1('0x54')][_0x97d1('0x2d')]({'plain':!![]});if(!_0x1ea7ac)throw new Error(_0x97d1('0x55'));if(_0x1ea7ac['role']===_0x97d1('0x54')){var _0x47e055=_0x3d554e['get']({'plain':!![]});var _0x5f11e2=_0x97d1('0x2e');return db[_0x97d1('0x56')]['find']({'where':{'name':_0x5f11e2,'userProfileId':_0x1ea7ac[_0x97d1('0x57')]},'raw':!![]})[_0x97d1('0x2b')](function(_0x4948c2){if(_0x4948c2&&_0x4948c2[_0x97d1('0x58')]===0x0){return db[_0x97d1('0x2f')]['create']({'name':_0x47e055[_0x97d1('0x33')],'resourceId':_0x47e055['id'],'type':_0x4948c2[_0x97d1('0x33')],'sectionId':_0x4948c2['id']},{})['then'](function(){return _0x3d554e;});}else{return _0x3d554e;}})[_0x97d1('0x4c')](function(_0x4af768){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4af768);throw _0x4af768;});}return _0x3d554e;})[_0x97d1('0x2b')](respondWithResult(_0x390bdc,0xc9))[_0x97d1('0x4c')](handleError(_0x390bdc,null));};exports[_0x97d1('0x2a')]=function(_0x2ebe5f,_0x24f3e9){if(_0x2ebe5f[_0x97d1('0x59')]['id']){delete _0x2ebe5f['body']['id'];}return db[_0x97d1('0x47')][_0x97d1('0x52')]({'where':{'id':_0x2ebe5f[_0x97d1('0x4d')]['id']}})[_0x97d1('0x2b')](handleEntityNotFound(_0x24f3e9,null))['then'](saveUpdates(_0x2ebe5f['body'],null))[_0x97d1('0x2b')](respondWithResult(_0x24f3e9,null))[_0x97d1('0x4c')](handleError(_0x24f3e9,null));};exports[_0x97d1('0x2c')]=function(_0x57ad5b,_0x5b2ca5){return db['SmsQueue'][_0x97d1('0x52')]({'where':{'id':_0x57ad5b[_0x97d1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5b2ca5,null))[_0x97d1('0x2b')](removeEntity(_0x5b2ca5,null))['catch'](handleError(_0x5b2ca5,null));};exports[_0x97d1('0x5a')]=function(_0x2406e9,_0xde9766){return db[_0x97d1('0x47')][_0x97d1('0x5a')]()['then'](respondWithResult(_0xde9766,null))['catch'](handleError(_0xde9766,null));};exports[_0x97d1('0x5b')]=function(_0x52d621,_0xc66a1b,_0x3fa3b9){var _0xde6043={'raw':!![],'where':{}},_0x385cc5={},_0xdbf178;return db[_0x97d1('0x47')][_0x97d1('0x5c')]({'where':{'id':_0x52d621['params']['id']}})[_0x97d1('0x2b')](handleEntityNotFound(_0xc66a1b,null))[_0x97d1('0x2b')](function(_0x34e2f6){if(_0x34e2f6){_0xdbf178=_0x34e2f6[_0x97d1('0x2d')]({'plain':!![]});_0x385cc5[_0x97d1('0x3a')]=_[_0x97d1('0x4e')](db['UserSmsQueue']['rawAttributes']);_0x385cc5[_0x97d1('0x39')]=_[_0x97d1('0x4e')](_0x52d621[_0x97d1('0x39')]);_0x385cc5['filters']=_[_0x97d1('0x3c')](_0x385cc5[_0x97d1('0x3a')],_0x385cc5[_0x97d1('0x39')]);_0xde6043[_0x97d1('0x3b')]=_[_0x97d1('0x3c')](_0x385cc5[_0x97d1('0x3a')],qs[_0x97d1('0x3d')](_0x52d621['query'][_0x97d1('0x3d')]));_0xde6043[_0x97d1('0x3b')]=_0xde6043[_0x97d1('0x3b')][_0x97d1('0x50')]?_0xde6043['attributes']:_0x385cc5['model'];if(!_0x52d621['query'][_0x97d1('0x3e')]('nolimit')){_0xde6043[_0x97d1('0x22')]=qs['limit'](_0x52d621[_0x97d1('0x39')][_0x97d1('0x22')]);_0xde6043[_0x97d1('0x21')]=qs['offset'](_0x52d621[_0x97d1('0x39')][_0x97d1('0x21')]);}_0xde6043[_0x97d1('0x5d')]=qs[_0x97d1('0x40')](_0x52d621[_0x97d1('0x39')][_0x97d1('0x40')]);_0xde6043[_0x97d1('0x41')]=qs[_0x97d1('0x43')](_[_0x97d1('0x42')](_0x52d621['query'],_0x385cc5['filters']));_0xde6043[_0x97d1('0x41')][_0x97d1('0x5e')]=_0x34e2f6['id'];if(_0x52d621['query'][_0x97d1('0x46')]){_0xde6043[_0x97d1('0x41')]=_[_0x97d1('0x44')](_0xde6043['where'],{'$or':_[_0x97d1('0x36')](_0xde6043[_0x97d1('0x3b')],function(_0x4a1c4d){var _0x5c8246={};_0x5c8246[_0x4a1c4d]={'$like':'%'+_0x52d621['query']['filter']+'%'};return _0x5c8246;})});}_0xde6043=_[_0x97d1('0x44')]({},_0xde6043,_0x52d621[_0x97d1('0x51')]);return db[_0x97d1('0x5f')]['findAll'](_0xde6043);}})[_0x97d1('0x2b')](function(_0x2e66e2){if(_0x2e66e2){return db[_0x97d1('0x60')]['findAndCountAll']({'where':{'id':_[_0x97d1('0x36')](_0x2e66e2,_0x97d1('0x61')),'role':'agent'},'attributes':['id',_0x97d1('0x33'),'smsPause',_0x97d1('0x62'),_0x97d1('0x63')]});}})['then'](function(_0x5ac4af){if(_0x5ac4af){return{'count':_0x5ac4af[_0x97d1('0x24')],'rows':_[_0x97d1('0x36')](_0x5ac4af[_0x97d1('0x4b')],function(_0x1dd617){return{'membername':_0x1dd617[_0x97d1('0x33')],'UserId':_0x1dd617['id'],'queue_name':_0xdbf178[_0x97d1('0x33')],'SmsQueueId':_0xdbf178['id'],'interface':util['format'](_0x97d1('0x64'),_0x97d1('0x65'),_0x1dd617['name']),'penalty':0x0,'paused':_0x1dd617[_0x97d1('0x66')],'createdAt':_0x1dd617[_0x97d1('0x63')],'updatedAt':_0x1dd617[_0x97d1('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xc66a1b,_0xde6043))[_0x97d1('0x4c')](handleError(_0xc66a1b,null));};exports[_0x97d1('0x67')]=function(_0x285db2,_0x36c719,_0x15cce9){var _0x45fd38={};var _0x488920={};var _0x1b307d;var _0x48f885;return db[_0x97d1('0x47')][_0x97d1('0x5c')]({'where':{'id':_0x285db2[_0x97d1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x36c719,null))[_0x97d1('0x2b')](function(_0x11b9f9){if(_0x11b9f9){_0x1b307d=_0x11b9f9;_0x488920[_0x97d1('0x3a')]=_[_0x97d1('0x4e')](db[_0x97d1('0x68')][_0x97d1('0x4f')]);_0x488920[_0x97d1('0x39')]=_['keys'](_0x285db2[_0x97d1('0x39')]);_0x488920['filters']=_[_0x97d1('0x3c')](_0x488920[_0x97d1('0x3a')],_0x488920[_0x97d1('0x39')]);_0x45fd38['attributes']=_[_0x97d1('0x3c')](_0x488920['model'],qs['fields'](_0x285db2[_0x97d1('0x39')][_0x97d1('0x3d')]));_0x45fd38[_0x97d1('0x3b')]=_0x45fd38[_0x97d1('0x3b')]['length']?_0x45fd38[_0x97d1('0x3b')]:_0x488920[_0x97d1('0x3a')];_0x45fd38['order']=qs[_0x97d1('0x40')](_0x285db2['query'][_0x97d1('0x40')]);_0x45fd38[_0x97d1('0x41')]=qs[_0x97d1('0x43')](_[_0x97d1('0x42')](_0x285db2['query'],_0x488920[_0x97d1('0x43')]));if(_0x285db2['query'][_0x97d1('0x46')]){_0x45fd38[_0x97d1('0x41')]=_[_0x97d1('0x44')](_0x45fd38[_0x97d1('0x41')],{'$or':_[_0x97d1('0x36')](_0x45fd38[_0x97d1('0x3b')],function(_0x337d82){var _0x2b89c3={};_0x2b89c3[_0x337d82]={'$like':'%'+_0x285db2[_0x97d1('0x39')]['filter']+'%'};return _0x2b89c3;})});}_0x45fd38=_[_0x97d1('0x44')]({},_0x45fd38,_0x285db2['options']);return _0x1b307d['getTeams'](_0x45fd38);}})['then'](function(_0x23175a){if(_0x23175a){_0x48f885=_0x23175a[_0x97d1('0x50')];if(!_0x285db2['query'][_0x97d1('0x3e')](_0x97d1('0x3f'))){_0x45fd38['limit']=qs[_0x97d1('0x22')](_0x285db2['query'][_0x97d1('0x22')]);_0x45fd38[_0x97d1('0x21')]=qs[_0x97d1('0x21')](_0x285db2[_0x97d1('0x39')][_0x97d1('0x21')]);}return _0x1b307d[_0x97d1('0x67')](_0x45fd38);}})['then'](function(_0x1d9674){if(_0x1d9674){return _0x1d9674?{'count':_0x48f885,'rows':_0x1d9674}:null;}})['then'](respondWithResult(_0x36c719,null))['catch'](handleError(_0x36c719,null));};exports[_0x97d1('0x69')]=function(_0x2e7dd3,_0x136436,_0x5a060d){var _0x32b937=_0x2e7dd3[_0x97d1('0x59')][_0x97d1('0x6a')];return db[_0x97d1('0x68')][_0x97d1('0x4a')]({'where':{'id':_0x32b937},'attributes':['id'],'include':[{'model':db['User'],'as':_0x97d1('0x6b'),'attributes':['id',_0x97d1('0x33'),'online',_0x97d1('0x6c'),_0x97d1('0x6d')],'raw':!![]}]})['then'](function(_0x215d73){if(_0x215d73){var _0x5c2498=_[_0x97d1('0x6e')](_0x215d73,function(_0x2db94e){var _0x5a09e4=_0x2db94e['get']({'plain':!![]});return _0x5a09e4[_0x97d1('0x6b')];});return db[_0x97d1('0x47')][_0x97d1('0x52')]({'where':{'id':_0x2e7dd3[_0x97d1('0x4d')]['id']}})[_0x97d1('0x2b')](function(_0x232ab2){return db[_0x97d1('0x6f')][_0x97d1('0x70')](function(_0x27c729){return _0x232ab2[_0x97d1('0x69')](_0x32b937,{'transaction':_0x27c729})[_0x97d1('0x2b')](function(){return BPromise[_0x97d1('0x71')](_0x5c2498,function(_0x42c6fc){return db[_0x97d1('0x5f')][_0x97d1('0x72')]({'where':{'UserId':_0x42c6fc['id'],'SmsQueueId':_0x2e7dd3[_0x97d1('0x4d')]['id']},'transaction':_0x27c729});});})['then'](function(){_0x5c2498[_0x97d1('0x73')](function(_0x4ef4b6){socket[_0x97d1('0x74')](_0x97d1('0x75'),{'UserId':_0x4ef4b6['id'],'SmsQueueId':_0x232ab2['id']});});});});});}})['then'](respondWithStatusCode(_0x136436,null))[_0x97d1('0x4c')](handleError(_0x136436,null));};exports[_0x97d1('0x76')]=function(_0x3f4d55,_0x550f91,_0x213d45){return db[_0x97d1('0x68')][_0x97d1('0x4a')]({'where':{'id':_0x3f4d55[_0x97d1('0x39')][_0x97d1('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x97d1('0x60')],'as':_0x97d1('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x97d1('0x2b')](handleEntityNotFound(_0x550f91,null))[_0x97d1('0x2b')](function(_0x23e7ba){var _0x3a5b4b=_[_0x97d1('0x36')](_0x23e7ba,'id');var _0x4d800f=[];var _0x211c09=[];var _0x545b94=squel[_0x97d1('0x77')]();_0x545b94[_0x97d1('0x78')](_0x97d1('0x79'))[_0x97d1('0x7a')](_0x97d1('0x7b'),'tq')['join'](_0x97d1('0x7c'),'ut',_0x97d1('0x7d'))[_0x97d1('0x41')](_0x97d1('0x7e'),_0x3f4d55['params']['id']);for(var _0x4e3d92=0x0;_0x4e3d92<_0x23e7ba[_0x97d1('0x50')];_0x4e3d92+=0x1){let _0x49b3dc=_0x23e7ba[_0x4e3d92];for(var _0x38e538=0x0;_0x38e538<_0x49b3dc[_0x97d1('0x6b')][_0x97d1('0x50')];_0x38e538+=0x1){let _0x44bc8d=_0x49b3dc[_0x97d1('0x6b')][_0x38e538];var _0x56dff8=_0x545b94['clone']();_0x56dff8[_0x97d1('0x41')](_0x97d1('0x7f'),_0x44bc8d['id']);_0x211c09['push'](db[_0x97d1('0x6f')][_0x97d1('0x39')](_0x56dff8[_0x97d1('0x80')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x97d1('0x2b')](function(_0x4c93c6){if(_0x4c93c6[_0x97d1('0x50')]===0x1){return _0x44bc8d['id'];}else{var _0x1d0275=_[_0x97d1('0x81')](_[_0x97d1('0x36')](_0x4c93c6,_0x97d1('0x82')),function(_0x5066c9){return _['includes'](_0x3a5b4b,_0x5066c9);});if(_0x1d0275){return _0x44bc8d['id'];}}}));}}return BPromise[_0x97d1('0x83')](_0x211c09)['then'](function(_0x451e16){_0x4d800f=_(_0x4d800f)[_0x97d1('0x84')](_0x451e16)[_0x97d1('0x85')]()[_0x97d1('0x86')]();return db[_0x97d1('0x47')][_0x97d1('0x52')]({'where':{'id':_0x3f4d55[_0x97d1('0x4d')]['id']}})[_0x97d1('0x2b')](function(_0x1dfd81){return db[_0x97d1('0x6f')][_0x97d1('0x70')](function(_0x16fb26){return _0x1dfd81[_0x97d1('0x76')](_0x3f4d55['query'][_0x97d1('0x6a')],{'transaction':_0x16fb26})[_0x97d1('0x2b')](function(){if(!_[_0x97d1('0x87')](_0x4d800f)){return _0x1dfd81['removeAgents'](_0x4d800f,{'transaction':_0x16fb26});}})[_0x97d1('0x2b')](function(){_0x4d800f[_0x97d1('0x73')](function(_0xffd957){socket['emit']('userSmsQueue:remove',{'UserId':_0xffd957,'SmsQueueId':_0x1dfd81['id']});});});});});});})['then'](respondWithStatusCode(_0x550f91,null))['catch'](handleError(_0x550f91,null));};exports[_0x97d1('0x88')]=function(_0x5640ba,_0x1cad51,_0x94ff7b){return db[_0x97d1('0x47')][_0x97d1('0x52')]({'where':{'id':_0x5640ba[_0x97d1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1cad51,null))[_0x97d1('0x2b')](function(_0x2bcc9c){if(_0x2bcc9c){return _0x2bcc9c[_0x97d1('0x88')](_0x5640ba[_0x97d1('0x59')][_0x97d1('0x6a')],_[_0x97d1('0x89')](_0x5640ba[_0x97d1('0x59')],[_0x97d1('0x6a'),'id'])||{})['spread'](function(_0xdb2db1){for(var _0x26e4bc=0x0;_0x26e4bc<_0x5640ba[_0x97d1('0x59')][_0x97d1('0x6a')][_0x97d1('0x50')];_0x26e4bc+=0x1){socket[_0x97d1('0x74')]('userSmsQueue:save',{'UserId':Number(_0x5640ba[_0x97d1('0x59')][_0x97d1('0x6a')][_0x26e4bc]),'SmsQueueId':Number(_0x5640ba[_0x97d1('0x4d')]['id'])});}return _0xdb2db1;});}})[_0x97d1('0x2b')](respondWithResult(_0x1cad51,null))[_0x97d1('0x4c')](handleError(_0x1cad51,null));};exports[_0x97d1('0x8a')]=function(_0x1eb988,_0x3d8ee9,_0x18c14b){return db[_0x97d1('0x47')]['find']({'where':{'id':_0x1eb988['params']['id']}})[_0x97d1('0x2b')](handleEntityNotFound(_0x3d8ee9,null))[_0x97d1('0x2b')](function(_0x1d5fc8){if(_0x1d5fc8){return _0x1d5fc8[_0x97d1('0x8a')](_0x1eb988[_0x97d1('0x39')][_0x97d1('0x6a')])['then'](function(){if(_[_0x97d1('0x8b')](_0x1eb988[_0x97d1('0x39')][_0x97d1('0x6a')])){for(var _0x2c61eb=0x0;_0x2c61eb<_0x1eb988[_0x97d1('0x39')][_0x97d1('0x6a')][_0x97d1('0x50')];_0x2c61eb+=0x1){socket['emit'](_0x97d1('0x8c'),{'UserId':Number(_0x1eb988[_0x97d1('0x39')]['ids'][_0x2c61eb]),'SmsQueueId':Number(_0x1eb988[_0x97d1('0x4d')]['id'])});}}else{socket[_0x97d1('0x74')](_0x97d1('0x8c'),{'UserId':Number(_0x1eb988[_0x97d1('0x39')][_0x97d1('0x6a')]),'SmsQueueId':Number(_0x1eb988['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3d8ee9,null))[_0x97d1('0x4c')](handleError(_0x3d8ee9,null));};exports[_0x97d1('0x8d')]=function(_0x1cee60,_0x4d919f,_0x135e9c){var _0x3647e4={};var _0x54f4a0={};var _0xd5d48a;var _0x13ea95;return db[_0x97d1('0x47')]['findOne']({'where':{'id':_0x1cee60['params']['id']}})[_0x97d1('0x2b')](handleEntityNotFound(_0x4d919f,null))[_0x97d1('0x2b')](function(_0x4f0889){if(_0x4f0889){_0xd5d48a=_0x4f0889;_0x54f4a0[_0x97d1('0x3a')]=_['keys'](db[_0x97d1('0x60')][_0x97d1('0x4f')]);_0x54f4a0['query']=_[_0x97d1('0x4e')](_0x1cee60['query']);_0x54f4a0[_0x97d1('0x43')]=_[_0x97d1('0x3c')](_0x54f4a0['model'],_0x54f4a0['query']);_0x3647e4[_0x97d1('0x3b')]=_['intersection'](_0x54f4a0[_0x97d1('0x3a')],qs[_0x97d1('0x3d')](_0x1cee60[_0x97d1('0x39')][_0x97d1('0x3d')]));_0x3647e4['attributes']=_0x3647e4[_0x97d1('0x3b')][_0x97d1('0x50')]?_0x3647e4['attributes']:_0x54f4a0[_0x97d1('0x3a')];_0x3647e4[_0x97d1('0x5d')]=qs[_0x97d1('0x40')](_0x1cee60[_0x97d1('0x39')]['sort']);_0x3647e4[_0x97d1('0x41')]=qs[_0x97d1('0x43')](_[_0x97d1('0x42')](_0x1cee60[_0x97d1('0x39')],_0x54f4a0['filters']));if(_0x1cee60[_0x97d1('0x39')][_0x97d1('0x46')]){_0x3647e4['where']=_['merge'](_0x3647e4['where'],{'$or':_[_0x97d1('0x36')](_0x3647e4[_0x97d1('0x3b')],function(_0x57b18d){var _0x12abf2={};_0x12abf2[_0x57b18d]={'$like':'%'+_0x1cee60[_0x97d1('0x39')]['filter']+'%'};return _0x12abf2;})});}_0x3647e4=_[_0x97d1('0x44')]({},_0x3647e4,_0x1cee60[_0x97d1('0x51')]);return _0xd5d48a['getAgents'](_0x3647e4);}})[_0x97d1('0x2b')](function(_0xc10b44){if(_0xc10b44){_0x13ea95=_0xc10b44['length'];if(!_0x1cee60['query'][_0x97d1('0x3e')](_0x97d1('0x3f'))){_0x3647e4[_0x97d1('0x22')]=qs[_0x97d1('0x22')](_0x1cee60[_0x97d1('0x39')][_0x97d1('0x22')]);_0x3647e4[_0x97d1('0x21')]=qs[_0x97d1('0x21')](_0x1cee60[_0x97d1('0x39')][_0x97d1('0x21')]);}return _0xd5d48a[_0x97d1('0x8d')](_0x3647e4);}})[_0x97d1('0x2b')](function(_0x486596){if(_0x486596){return _0x486596?{'count':_0x13ea95,'rows':_0x486596}:null;}})['then'](respondWithResult(_0x4d919f,null))[_0x97d1('0x4c')](handleError(_0x4d919f,null));};
\ No newline at end of file
+var _0xcc97=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','SmsQueue','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','count','include','findAll','catch','params','create','body','user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','order','SmsQueueId','findAndCountAll','agent','updatedAt','createdAt','rows','format','SIP','getTeams','Team','addTeams','Agents','online','interface','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','ids','select','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','User','eml-format','rimraf'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xcc97,0x1a8));var _0x7cc9=function(_0x58e3b7,_0x174a8f){_0x58e3b7=_0x58e3b7-0x0;var _0x37885b=_0xcc97[_0x58e3b7];return _0x37885b;};'use strict';var emlformat=require(_0x7cc9('0x0'));var rimraf=require(_0x7cc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7cc9('0x2'));var rp=require(_0x7cc9('0x3'));var moment=require(_0x7cc9('0x4'));var BPromise=require(_0x7cc9('0x5'));var Mustache=require(_0x7cc9('0x6'));var util=require(_0x7cc9('0x7'));var path=require(_0x7cc9('0x8'));var sox=require(_0x7cc9('0x9'));var csv=require(_0x7cc9('0xa'));var ejs=require(_0x7cc9('0xb'));var fs=require('fs');var fs_extra=require(_0x7cc9('0xc'));var _=require('lodash');var squel=require(_0x7cc9('0xd'));var crypto=require(_0x7cc9('0xe'));var jsforce=require(_0x7cc9('0xf'));var deskjs=require(_0x7cc9('0x10'));var toCsv=require(_0x7cc9('0xa'));var querystring=require('querystring');var Papa=require(_0x7cc9('0x11'));var Redis=require('ioredis');var authService=require(_0x7cc9('0x12'));var qs=require(_0x7cc9('0x13'));var as=require(_0x7cc9('0x14'));var hardwareService=require(_0x7cc9('0x15'));var logger=require(_0x7cc9('0x16'))(_0x7cc9('0x17'));var utils=require(_0x7cc9('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7cc9('0x19'))['db'];config['redis']=_[_0x7cc9('0x1a')](config['redis'],{'host':_0x7cc9('0x1b'),'port':0x18eb});var socket=require(_0x7cc9('0x1c'))(new Redis(config[_0x7cc9('0x1d')]));require(_0x7cc9('0x1e'))[_0x7cc9('0x1f')](socket);function respondWithStatusCode(_0x48694e,_0x4de4c5){_0x4de4c5=_0x4de4c5||0xcc;return function(_0x23c329){if(_0x23c329){return _0x48694e[_0x7cc9('0x20')](_0x4de4c5);}return _0x48694e[_0x7cc9('0x21')](_0x4de4c5)[_0x7cc9('0x22')]();};}function respondWithResult(_0x4f0e10,_0x2e5587){_0x2e5587=_0x2e5587||0xc8;return function(_0x4db823){if(_0x4db823){return _0x4f0e10[_0x7cc9('0x21')](_0x2e5587)[_0x7cc9('0x23')](_0x4db823);}};}function respondWithFilteredResult(_0xce7e46,_0x380638){return function(_0x317ec4){if(_0x317ec4){var _0x1f1f77=typeof _0x380638['offset']===_0x7cc9('0x24')&&typeof _0x380638[_0x7cc9('0x25')]===_0x7cc9('0x24');var _0x275128=_0x317ec4['count'];var _0x5a2333=_0x1f1f77?0x0:_0x380638['offset'];var _0x1c22f0=_0x1f1f77?_0x317ec4['count']:_0x380638[_0x7cc9('0x26')]+_0x380638[_0x7cc9('0x25')];var _0x4a07a0;if(_0x1c22f0>=_0x275128){_0x1c22f0=_0x275128;_0x4a07a0=0xc8;}else{_0x4a07a0=0xce;}_0xce7e46[_0x7cc9('0x21')](_0x4a07a0);return _0xce7e46[_0x7cc9('0x27')](_0x7cc9('0x28'),_0x5a2333+'-'+_0x1c22f0+'/'+_0x275128)[_0x7cc9('0x23')](_0x317ec4);}return null;};}function patchUpdates(_0x9b148e){return function(_0x1d5d12){try{jsonpatch[_0x7cc9('0x29')](_0x1d5d12,_0x9b148e,!![]);}catch(_0xec018d){return BPromise[_0x7cc9('0x2a')](_0xec018d);}return _0x1d5d12[_0x7cc9('0x2b')]();};}function saveUpdates(_0xa0eee6,_0x1022ac){return function(_0x4adb9e){if(_0x4adb9e){return _0x4adb9e[_0x7cc9('0x2c')](_0xa0eee6)[_0x7cc9('0x2d')](function(_0x5ad481){return _0x5ad481;});}return null;};}function removeEntity(_0x1013c1,_0x47f514){return function(_0x2d5ed9){if(_0x2d5ed9){return _0x2d5ed9[_0x7cc9('0x2e')]()[_0x7cc9('0x2d')](function(){var _0x4f6d59=_0x2d5ed9[_0x7cc9('0x2f')]({'plain':!![]});var _0x4bb12b='SmsQueues';return db['UserProfileResource'][_0x7cc9('0x2e')]({'where':{'type':_0x4bb12b,'resourceId':_0x4f6d59['id']}})[_0x7cc9('0x2d')](function(){return _0x2d5ed9;});})[_0x7cc9('0x2d')](function(){_0x1013c1[_0x7cc9('0x21')](0xcc)[_0x7cc9('0x22')]();});}};}function handleEntityNotFound(_0x527b75,_0x5ba534){return function(_0x5a3f15){if(!_0x5a3f15){_0x527b75[_0x7cc9('0x20')](0x194);}return _0x5a3f15;};}function handleError(_0x4a8c62,_0x3b12a9){_0x3b12a9=_0x3b12a9||0x1f4;return function(_0x2bc89d){logger[_0x7cc9('0x30')](_0x2bc89d[_0x7cc9('0x31')]);if(_0x2bc89d[_0x7cc9('0x32')]){delete _0x2bc89d['name'];}_0x4a8c62['status'](_0x3b12a9)[_0x7cc9('0x33')](_0x2bc89d);};}exports['index']=function(_0x116fd2,_0x52ea89){var _0x401f57={},_0x29a38a={},_0x172492={'count':0x0,'rows':[]};var _0x253379=_['map'](db[_0x7cc9('0x34')][_0x7cc9('0x35')],function(_0xe05c23){return{'name':_0xe05c23[_0x7cc9('0x36')],'type':_0xe05c23[_0x7cc9('0x37')]['key']};});_0x29a38a['model']=_[_0x7cc9('0x38')](_0x253379,_0x7cc9('0x32'));_0x29a38a['query']=_[_0x7cc9('0x39')](_0x116fd2[_0x7cc9('0x3a')]);_0x29a38a[_0x7cc9('0x3b')]=_[_0x7cc9('0x3c')](_0x29a38a[_0x7cc9('0x3d')],_0x29a38a[_0x7cc9('0x3a')]);_0x401f57[_0x7cc9('0x3e')]=_['intersection'](_0x29a38a[_0x7cc9('0x3d')],qs[_0x7cc9('0x3f')](_0x116fd2[_0x7cc9('0x3a')][_0x7cc9('0x3f')]));_0x401f57['attributes']=_0x401f57['attributes'][_0x7cc9('0x40')]?_0x401f57[_0x7cc9('0x3e')]:_0x29a38a[_0x7cc9('0x3d')];if(!_0x116fd2[_0x7cc9('0x3a')][_0x7cc9('0x41')](_0x7cc9('0x42'))){_0x401f57[_0x7cc9('0x25')]=qs[_0x7cc9('0x25')](_0x116fd2[_0x7cc9('0x3a')][_0x7cc9('0x25')]);_0x401f57['offset']=qs[_0x7cc9('0x26')](_0x116fd2[_0x7cc9('0x3a')][_0x7cc9('0x26')]);}_0x401f57['order']=qs[_0x7cc9('0x43')](_0x116fd2['query'][_0x7cc9('0x43')]);_0x401f57[_0x7cc9('0x44')]=qs[_0x7cc9('0x3b')](_[_0x7cc9('0x45')](_0x116fd2['query'],_0x29a38a[_0x7cc9('0x3b')]),_0x253379);if(_0x116fd2[_0x7cc9('0x3a')]['filter']){_0x401f57['where']=_['merge'](_0x401f57[_0x7cc9('0x44')],{'$or':_['map'](_0x253379,function(_0xbee8db){if(_0xbee8db[_0x7cc9('0x37')]!==_0x7cc9('0x46')){var _0x3d0b81={};_0x3d0b81[_0xbee8db[_0x7cc9('0x32')]]={'$like':'%'+_0x116fd2[_0x7cc9('0x3a')][_0x7cc9('0x47')]+'%'};return _0x3d0b81;}})});}_0x401f57=_[_0x7cc9('0x48')]({},_0x401f57,_0x116fd2[_0x7cc9('0x49')]);var _0x26749b={'where':_0x401f57[_0x7cc9('0x44')]};return db[_0x7cc9('0x34')][_0x7cc9('0x4a')](_0x26749b)[_0x7cc9('0x2d')](function(_0x1981a1){_0x172492[_0x7cc9('0x4a')]=_0x1981a1;if(_0x116fd2[_0x7cc9('0x3a')]['includeAll']){_0x401f57[_0x7cc9('0x4b')]=[{'all':!![]}];}return db[_0x7cc9('0x34')][_0x7cc9('0x4c')](_0x401f57);})[_0x7cc9('0x2d')](function(_0x2e3a3c){_0x172492['rows']=_0x2e3a3c;return _0x172492;})['then'](respondWithFilteredResult(_0x52ea89,_0x401f57))[_0x7cc9('0x4d')](handleError(_0x52ea89,null));};exports['show']=function(_0x4f6829,_0x5e220c){var _0x29cee3={'raw':!![],'where':{'id':_0x4f6829[_0x7cc9('0x4e')]['id']}},_0x2bc517={};_0x2bc517[_0x7cc9('0x3d')]=_[_0x7cc9('0x39')](db['SmsQueue']['rawAttributes']);_0x2bc517[_0x7cc9('0x3a')]=_[_0x7cc9('0x39')](_0x4f6829[_0x7cc9('0x3a')]);_0x2bc517[_0x7cc9('0x3b')]=_[_0x7cc9('0x3c')](_0x2bc517[_0x7cc9('0x3d')],_0x2bc517[_0x7cc9('0x3a')]);_0x29cee3['attributes']=_[_0x7cc9('0x3c')](_0x2bc517['model'],qs['fields'](_0x4f6829[_0x7cc9('0x3a')]['fields']));_0x29cee3[_0x7cc9('0x3e')]=_0x29cee3[_0x7cc9('0x3e')][_0x7cc9('0x40')]?_0x29cee3[_0x7cc9('0x3e')]:_0x2bc517[_0x7cc9('0x3d')];if(_0x4f6829['query']['includeAll']){_0x29cee3['include']=[{'all':!![]}];}_0x29cee3=_[_0x7cc9('0x48')]({},_0x29cee3,_0x4f6829[_0x7cc9('0x49')]);return db[_0x7cc9('0x34')]['find'](_0x29cee3)[_0x7cc9('0x2d')](handleEntityNotFound(_0x5e220c,null))[_0x7cc9('0x2d')](respondWithResult(_0x5e220c,null))[_0x7cc9('0x4d')](handleError(_0x5e220c,null));};exports[_0x7cc9('0x4f')]=function(_0x28693c,_0x521304){return db[_0x7cc9('0x34')][_0x7cc9('0x4f')](_0x28693c[_0x7cc9('0x50')],{})[_0x7cc9('0x2d')](function(_0x5146a7){var _0x3d0380=_0x28693c[_0x7cc9('0x51')][_0x7cc9('0x2f')]({'plain':!![]});if(!_0x3d0380)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d0380['role']===_0x7cc9('0x51')){var _0x4acd3f=_0x5146a7[_0x7cc9('0x2f')]({'plain':!![]});var _0x54e424='SmsQueues';return db[_0x7cc9('0x52')][_0x7cc9('0x53')]({'where':{'name':_0x54e424,'userProfileId':_0x3d0380[_0x7cc9('0x54')]},'raw':!![]})[_0x7cc9('0x2d')](function(_0x7020fe){if(_0x7020fe&&_0x7020fe['autoAssociation']===0x0){return db[_0x7cc9('0x55')]['create']({'name':_0x4acd3f[_0x7cc9('0x32')],'resourceId':_0x4acd3f['id'],'type':_0x7020fe[_0x7cc9('0x32')],'sectionId':_0x7020fe['id']},{})['then'](function(){return _0x5146a7;});}else{return _0x5146a7;}})['catch'](function(_0x1e6641){logger['error'](_0x7cc9('0x56'),_0x1e6641);throw _0x1e6641;});}return _0x5146a7;})[_0x7cc9('0x2d')](respondWithResult(_0x521304,0xc9))[_0x7cc9('0x4d')](handleError(_0x521304,null));};exports[_0x7cc9('0x2c')]=function(_0x5d5990,_0x34017f){if(_0x5d5990['body']['id']){delete _0x5d5990['body']['id'];}return db[_0x7cc9('0x34')][_0x7cc9('0x53')]({'where':{'id':_0x5d5990[_0x7cc9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x34017f,null))['then'](saveUpdates(_0x5d5990[_0x7cc9('0x50')],null))[_0x7cc9('0x2d')](respondWithResult(_0x34017f,null))[_0x7cc9('0x4d')](handleError(_0x34017f,null));};exports[_0x7cc9('0x2e')]=function(_0x280004,_0x5040f6){return db[_0x7cc9('0x34')][_0x7cc9('0x53')]({'where':{'id':_0x280004[_0x7cc9('0x4e')]['id']}})[_0x7cc9('0x2d')](handleEntityNotFound(_0x5040f6,null))[_0x7cc9('0x2d')](removeEntity(_0x5040f6,null))[_0x7cc9('0x4d')](handleError(_0x5040f6,null));};exports['describe']=function(_0x10d213,_0x353d08){return db[_0x7cc9('0x34')][_0x7cc9('0x57')]()[_0x7cc9('0x2d')](respondWithResult(_0x353d08,null))['catch'](handleError(_0x353d08,null));};exports[_0x7cc9('0x58')]=function(_0x50f739,_0x3c6fa7,_0x3a9af2){var _0x1c2a34={'raw':!![],'where':{}},_0x429bc4={},_0xb6c843;return db[_0x7cc9('0x34')][_0x7cc9('0x59')]({'where':{'id':_0x50f739[_0x7cc9('0x4e')]['id']}})[_0x7cc9('0x2d')](handleEntityNotFound(_0x3c6fa7,null))['then'](function(_0x14dd8e){if(_0x14dd8e){_0xb6c843=_0x14dd8e['get']({'plain':!![]});_0x429bc4[_0x7cc9('0x3d')]=_[_0x7cc9('0x39')](db[_0x7cc9('0x5a')][_0x7cc9('0x35')]);_0x429bc4[_0x7cc9('0x3a')]=_[_0x7cc9('0x39')](_0x50f739[_0x7cc9('0x3a')]);_0x429bc4['filters']=_['intersection'](_0x429bc4['model'],_0x429bc4[_0x7cc9('0x3a')]);_0x1c2a34[_0x7cc9('0x3e')]=_['intersection'](_0x429bc4[_0x7cc9('0x3d')],qs['fields'](_0x50f739[_0x7cc9('0x3a')][_0x7cc9('0x3f')]));_0x1c2a34[_0x7cc9('0x3e')]=_0x1c2a34[_0x7cc9('0x3e')][_0x7cc9('0x40')]?_0x1c2a34['attributes']:_0x429bc4[_0x7cc9('0x3d')];if(!_0x50f739[_0x7cc9('0x3a')][_0x7cc9('0x41')](_0x7cc9('0x42'))){_0x1c2a34[_0x7cc9('0x25')]=qs[_0x7cc9('0x25')](_0x50f739['query'][_0x7cc9('0x25')]);_0x1c2a34['offset']=qs[_0x7cc9('0x26')](_0x50f739['query'][_0x7cc9('0x26')]);}_0x1c2a34[_0x7cc9('0x5b')]=qs['sort'](_0x50f739[_0x7cc9('0x3a')][_0x7cc9('0x43')]);_0x1c2a34['where']=qs[_0x7cc9('0x3b')](_['pick'](_0x50f739[_0x7cc9('0x3a')],_0x429bc4['filters']));_0x1c2a34['where'][_0x7cc9('0x5c')]=_0x14dd8e['id'];if(_0x50f739[_0x7cc9('0x3a')][_0x7cc9('0x47')]){_0x1c2a34[_0x7cc9('0x44')]=_[_0x7cc9('0x48')](_0x1c2a34[_0x7cc9('0x44')],{'$or':_[_0x7cc9('0x38')](_0x1c2a34[_0x7cc9('0x3e')],function(_0x4a4e36){var _0x26e283={};_0x26e283[_0x4a4e36]={'$like':'%'+_0x50f739[_0x7cc9('0x3a')][_0x7cc9('0x47')]+'%'};return _0x26e283;})});}_0x1c2a34=_[_0x7cc9('0x48')]({},_0x1c2a34,_0x50f739['options']);return db[_0x7cc9('0x5a')]['findAll'](_0x1c2a34);}})['then'](function(_0x127b01){if(_0x127b01){return db['User'][_0x7cc9('0x5d')]({'where':{'id':_[_0x7cc9('0x38')](_0x127b01,'UserId'),'role':_0x7cc9('0x5e')},'attributes':['id',_0x7cc9('0x32'),'smsPause',_0x7cc9('0x5f'),_0x7cc9('0x60')]});}})['then'](function(_0x5ca609){if(_0x5ca609){return{'count':_0x5ca609[_0x7cc9('0x4a')],'rows':_[_0x7cc9('0x38')](_0x5ca609[_0x7cc9('0x61')],function(_0x175b76){return{'membername':_0x175b76[_0x7cc9('0x32')],'UserId':_0x175b76['id'],'queue_name':_0xb6c843['name'],'SmsQueueId':_0xb6c843['id'],'interface':util[_0x7cc9('0x62')]('%s/%s',_0x7cc9('0x63'),_0x175b76['name']),'penalty':0x0,'paused':_0x175b76['smsPause'],'createdAt':_0x175b76['createdAt'],'updatedAt':_0x175b76['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7cc9('0x2d')](respondWithFilteredResult(_0x3c6fa7,_0x1c2a34))['catch'](handleError(_0x3c6fa7,null));};exports[_0x7cc9('0x64')]=function(_0x5996d6,_0x2e0e05,_0x9c83f9){var _0xd08907={};var _0x4082f7={};var _0x4e1f9a;var _0xb187c4;return db[_0x7cc9('0x34')][_0x7cc9('0x59')]({'where':{'id':_0x5996d6[_0x7cc9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2e0e05,null))[_0x7cc9('0x2d')](function(_0x28480b){if(_0x28480b){_0x4e1f9a=_0x28480b;_0x4082f7[_0x7cc9('0x3d')]=_[_0x7cc9('0x39')](db[_0x7cc9('0x65')]['rawAttributes']);_0x4082f7[_0x7cc9('0x3a')]=_[_0x7cc9('0x39')](_0x5996d6['query']);_0x4082f7[_0x7cc9('0x3b')]=_[_0x7cc9('0x3c')](_0x4082f7[_0x7cc9('0x3d')],_0x4082f7[_0x7cc9('0x3a')]);_0xd08907[_0x7cc9('0x3e')]=_[_0x7cc9('0x3c')](_0x4082f7[_0x7cc9('0x3d')],qs[_0x7cc9('0x3f')](_0x5996d6[_0x7cc9('0x3a')][_0x7cc9('0x3f')]));_0xd08907[_0x7cc9('0x3e')]=_0xd08907[_0x7cc9('0x3e')][_0x7cc9('0x40')]?_0xd08907[_0x7cc9('0x3e')]:_0x4082f7[_0x7cc9('0x3d')];_0xd08907[_0x7cc9('0x5b')]=qs['sort'](_0x5996d6[_0x7cc9('0x3a')]['sort']);_0xd08907[_0x7cc9('0x44')]=qs[_0x7cc9('0x3b')](_[_0x7cc9('0x45')](_0x5996d6['query'],_0x4082f7[_0x7cc9('0x3b')]));if(_0x5996d6[_0x7cc9('0x3a')][_0x7cc9('0x47')]){_0xd08907[_0x7cc9('0x44')]=_[_0x7cc9('0x48')](_0xd08907[_0x7cc9('0x44')],{'$or':_[_0x7cc9('0x38')](_0xd08907['attributes'],function(_0x11840b){var _0x3df434={};_0x3df434[_0x11840b]={'$like':'%'+_0x5996d6[_0x7cc9('0x3a')][_0x7cc9('0x47')]+'%'};return _0x3df434;})});}_0xd08907=_[_0x7cc9('0x48')]({},_0xd08907,_0x5996d6[_0x7cc9('0x49')]);return _0x4e1f9a[_0x7cc9('0x64')](_0xd08907);}})[_0x7cc9('0x2d')](function(_0x3c9dc5){if(_0x3c9dc5){_0xb187c4=_0x3c9dc5[_0x7cc9('0x40')];if(!_0x5996d6[_0x7cc9('0x3a')][_0x7cc9('0x41')](_0x7cc9('0x42'))){_0xd08907[_0x7cc9('0x25')]=qs[_0x7cc9('0x25')](_0x5996d6[_0x7cc9('0x3a')][_0x7cc9('0x25')]);_0xd08907['offset']=qs[_0x7cc9('0x26')](_0x5996d6[_0x7cc9('0x3a')][_0x7cc9('0x26')]);}return _0x4e1f9a['getTeams'](_0xd08907);}})[_0x7cc9('0x2d')](function(_0x4fda2f){if(_0x4fda2f){return _0x4fda2f?{'count':_0xb187c4,'rows':_0x4fda2f}:null;}})[_0x7cc9('0x2d')](respondWithResult(_0x2e0e05,null))[_0x7cc9('0x4d')](handleError(_0x2e0e05,null));};exports[_0x7cc9('0x66')]=function(_0x15c392,_0x3c71b0,_0x168077){var _0x575a42=_0x15c392[_0x7cc9('0x50')]['ids'];return db[_0x7cc9('0x65')][_0x7cc9('0x4c')]({'where':{'id':_0x575a42},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7cc9('0x67'),'attributes':['id',_0x7cc9('0x32'),_0x7cc9('0x68'),'voicePause',_0x7cc9('0x69')],'raw':!![]}]})['then'](function(_0x5eb9fb){if(_0x5eb9fb){var _0x27f78a=_['flatMap'](_0x5eb9fb,function(_0x5ad2ec){var _0x41990e=_0x5ad2ec[_0x7cc9('0x2f')]({'plain':!![]});return _0x41990e[_0x7cc9('0x67')];});return db[_0x7cc9('0x34')]['find']({'where':{'id':_0x15c392['params']['id']}})[_0x7cc9('0x2d')](function(_0x430861){return db['sequelize'][_0x7cc9('0x6a')](function(_0x504150){return _0x430861[_0x7cc9('0x66')](_0x575a42,{'transaction':_0x504150})[_0x7cc9('0x2d')](function(){return BPromise[_0x7cc9('0x6b')](_0x27f78a,function(_0x363261){return db[_0x7cc9('0x5a')][_0x7cc9('0x6c')]({'where':{'UserId':_0x363261['id'],'SmsQueueId':_0x15c392['params']['id']},'transaction':_0x504150});});})['then'](function(){_0x27f78a['forEach'](function(_0x19e741){socket[_0x7cc9('0x6d')](_0x7cc9('0x6e'),{'UserId':_0x19e741['id'],'SmsQueueId':_0x430861['id']});});});});});}})['then'](respondWithStatusCode(_0x3c71b0,null))[_0x7cc9('0x4d')](handleError(_0x3c71b0,null));};exports[_0x7cc9('0x6f')]=function(_0xb0a432,_0x40ce68,_0x4922fa){return db['Team'][_0x7cc9('0x4c')]({'where':{'id':_0xb0a432[_0x7cc9('0x3a')][_0x7cc9('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7cc9('0x67'),'attributes':['id'],'raw':!![]}]})[_0x7cc9('0x2d')](handleEntityNotFound(_0x40ce68,null))['then'](function(_0x2133d7){var _0x2ba0e1=_[_0x7cc9('0x38')](_0x2133d7,'id');var _0x499ef5=[];var _0x22ddf5=[];var _0x255be8=squel[_0x7cc9('0x71')]();_0x255be8['field']('tq.TeamId')[_0x7cc9('0x72')](_0x7cc9('0x73'),'tq')[_0x7cc9('0x74')](_0x7cc9('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x7cc9('0x76'),_0xb0a432['params']['id']);for(var _0x297b6b=0x0;_0x297b6b<_0x2133d7['length'];_0x297b6b+=0x1){let _0x38a9cf=_0x2133d7[_0x297b6b];for(var _0x4fc9dc=0x0;_0x4fc9dc<_0x38a9cf[_0x7cc9('0x67')][_0x7cc9('0x40')];_0x4fc9dc+=0x1){let _0x26baf7=_0x38a9cf['Agents'][_0x4fc9dc];var _0x438696=_0x255be8[_0x7cc9('0x77')]();_0x438696[_0x7cc9('0x44')](_0x7cc9('0x78'),_0x26baf7['id']);_0x22ddf5[_0x7cc9('0x79')](db['sequelize'][_0x7cc9('0x3a')](_0x438696[_0x7cc9('0x7a')](),{'type':db[_0x7cc9('0x7b')][_0x7cc9('0x7c')][_0x7cc9('0x7d')]})[_0x7cc9('0x2d')](function(_0x1f6ed9){if(_0x1f6ed9['length']===0x1){return _0x26baf7['id'];}else{var _0x2cb93d=_[_0x7cc9('0x7e')](_['map'](_0x1f6ed9,'TeamId'),function(_0x294406){return _[_0x7cc9('0x7f')](_0x2ba0e1,_0x294406);});if(_0x2cb93d){return _0x26baf7['id'];}}}));}}return BPromise[_0x7cc9('0x80')](_0x22ddf5)['then'](function(_0x75a067){_0x499ef5=_(_0x499ef5)[_0x7cc9('0x81')](_0x75a067)[_0x7cc9('0x82')]()[_0x7cc9('0x83')]();return db['SmsQueue'][_0x7cc9('0x53')]({'where':{'id':_0xb0a432['params']['id']}})['then'](function(_0x24cf02){return db[_0x7cc9('0x7b')][_0x7cc9('0x6a')](function(_0x5447de){return _0x24cf02[_0x7cc9('0x6f')](_0xb0a432['query'][_0x7cc9('0x70')],{'transaction':_0x5447de})['then'](function(){if(!_[_0x7cc9('0x84')](_0x499ef5)){return _0x24cf02[_0x7cc9('0x85')](_0x499ef5,{'transaction':_0x5447de});}})[_0x7cc9('0x2d')](function(){_0x499ef5[_0x7cc9('0x86')](function(_0x27a6db){socket[_0x7cc9('0x6d')]('userSmsQueue:remove',{'UserId':_0x27a6db,'SmsQueueId':_0x24cf02['id']});});});});});});})[_0x7cc9('0x2d')](respondWithStatusCode(_0x40ce68,null))[_0x7cc9('0x4d')](handleError(_0x40ce68,null));};exports['addAgents']=function(_0x2ec095,_0x5178d2,_0x3a94cf){return db[_0x7cc9('0x34')][_0x7cc9('0x53')]({'where':{'id':_0x2ec095[_0x7cc9('0x4e')]['id']}})[_0x7cc9('0x2d')](handleEntityNotFound(_0x5178d2,null))[_0x7cc9('0x2d')](function(_0x3c3479){if(_0x3c3479){return _0x3c3479[_0x7cc9('0x87')](_0x2ec095[_0x7cc9('0x50')][_0x7cc9('0x70')],_[_0x7cc9('0x88')](_0x2ec095[_0x7cc9('0x50')],[_0x7cc9('0x70'),'id'])||{})[_0x7cc9('0x89')](function(_0x3caa62){for(var _0x217105=0x0;_0x217105<_0x2ec095[_0x7cc9('0x50')][_0x7cc9('0x70')]['length'];_0x217105+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x2ec095[_0x7cc9('0x50')][_0x7cc9('0x70')][_0x217105]),'SmsQueueId':Number(_0x2ec095[_0x7cc9('0x4e')]['id'])});}return _0x3caa62;});}})['then'](respondWithResult(_0x5178d2,null))[_0x7cc9('0x4d')](handleError(_0x5178d2,null));};exports['removeAgents']=function(_0x4fed3d,_0x323933,_0x4db8f5){return db[_0x7cc9('0x34')][_0x7cc9('0x53')]({'where':{'id':_0x4fed3d[_0x7cc9('0x4e')]['id']}})[_0x7cc9('0x2d')](handleEntityNotFound(_0x323933,null))[_0x7cc9('0x2d')](function(_0x1703b8){if(_0x1703b8){return _0x1703b8[_0x7cc9('0x85')](_0x4fed3d['query'][_0x7cc9('0x70')])['then'](function(){if(_[_0x7cc9('0x8a')](_0x4fed3d[_0x7cc9('0x3a')][_0x7cc9('0x70')])){for(var _0x4f7d99=0x0;_0x4f7d99<_0x4fed3d[_0x7cc9('0x3a')][_0x7cc9('0x70')][_0x7cc9('0x40')];_0x4f7d99+=0x1){socket['emit'](_0x7cc9('0x8b'),{'UserId':Number(_0x4fed3d[_0x7cc9('0x3a')][_0x7cc9('0x70')][_0x4f7d99]),'SmsQueueId':Number(_0x4fed3d[_0x7cc9('0x4e')]['id'])});}}else{socket[_0x7cc9('0x6d')](_0x7cc9('0x8b'),{'UserId':Number(_0x4fed3d[_0x7cc9('0x3a')][_0x7cc9('0x70')]),'SmsQueueId':Number(_0x4fed3d[_0x7cc9('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x323933,null))[_0x7cc9('0x4d')](handleError(_0x323933,null));};exports[_0x7cc9('0x8c')]=function(_0x34832c,_0x58e651,_0x19bf09){var _0x53caca={};var _0x532e00={};var _0x48ca9b;var _0x3d052a;return db[_0x7cc9('0x34')][_0x7cc9('0x59')]({'where':{'id':_0x34832c[_0x7cc9('0x4e')]['id']}})[_0x7cc9('0x2d')](handleEntityNotFound(_0x58e651,null))[_0x7cc9('0x2d')](function(_0x5b4e7e){if(_0x5b4e7e){_0x48ca9b=_0x5b4e7e;_0x532e00[_0x7cc9('0x3d')]=_['keys'](db[_0x7cc9('0x8d')][_0x7cc9('0x35')]);_0x532e00[_0x7cc9('0x3a')]=_[_0x7cc9('0x39')](_0x34832c[_0x7cc9('0x3a')]);_0x532e00[_0x7cc9('0x3b')]=_[_0x7cc9('0x3c')](_0x532e00[_0x7cc9('0x3d')],_0x532e00[_0x7cc9('0x3a')]);_0x53caca[_0x7cc9('0x3e')]=_[_0x7cc9('0x3c')](_0x532e00[_0x7cc9('0x3d')],qs[_0x7cc9('0x3f')](_0x34832c['query'][_0x7cc9('0x3f')]));_0x53caca['attributes']=_0x53caca[_0x7cc9('0x3e')][_0x7cc9('0x40')]?_0x53caca['attributes']:_0x532e00[_0x7cc9('0x3d')];_0x53caca[_0x7cc9('0x5b')]=qs['sort'](_0x34832c['query'][_0x7cc9('0x43')]);_0x53caca[_0x7cc9('0x44')]=qs[_0x7cc9('0x3b')](_[_0x7cc9('0x45')](_0x34832c[_0x7cc9('0x3a')],_0x532e00[_0x7cc9('0x3b')]));if(_0x34832c[_0x7cc9('0x3a')][_0x7cc9('0x47')]){_0x53caca[_0x7cc9('0x44')]=_[_0x7cc9('0x48')](_0x53caca[_0x7cc9('0x44')],{'$or':_['map'](_0x53caca[_0x7cc9('0x3e')],function(_0x3c9db2){var _0x4336e2={};_0x4336e2[_0x3c9db2]={'$like':'%'+_0x34832c[_0x7cc9('0x3a')][_0x7cc9('0x47')]+'%'};return _0x4336e2;})});}_0x53caca=_[_0x7cc9('0x48')]({},_0x53caca,_0x34832c[_0x7cc9('0x49')]);return _0x48ca9b['getAgents'](_0x53caca);}})[_0x7cc9('0x2d')](function(_0xe53011){if(_0xe53011){_0x3d052a=_0xe53011['length'];if(!_0x34832c[_0x7cc9('0x3a')][_0x7cc9('0x41')](_0x7cc9('0x42'))){_0x53caca['limit']=qs[_0x7cc9('0x25')](_0x34832c['query']['limit']);_0x53caca[_0x7cc9('0x26')]=qs[_0x7cc9('0x26')](_0x34832c[_0x7cc9('0x3a')][_0x7cc9('0x26')]);}return _0x48ca9b['getAgents'](_0x53caca);}})[_0x7cc9('0x2d')](function(_0x42eced){if(_0x42eced){return _0x42eced?{'count':_0x3d052a,'rows':_0x42eced}:null;}})[_0x7cc9('0x2d')](respondWithResult(_0x58e651,null))[_0x7cc9('0x4d')](handleError(_0x58e651,null));};
\ No newline at end of file
index 18016c6..3282edf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa34b=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x4684a8,_0xe764ae){var _0x360aab=function(_0x41d88e){while(--_0x41d88e){_0x4684a8['push'](_0x4684a8['shift']());}};_0x360aab(++_0xe764ae);}(_0xa34b,0x16e));var _0xba34=function(_0x9a3bf5,_0x3d28fa){_0x9a3bf5=_0x9a3bf5-0x0;var _0x3f5959=_0xa34b[_0x9a3bf5];return _0x3f5959;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xba34('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xba34('0x1')](0x0);var events={'afterCreate':_0xba34('0x2'),'afterUpdate':_0xba34('0x3'),'afterDestroy':_0xba34('0x4')};function emitEvent(_0x4a8b21){return function(_0x86eba7,_0x35f09e,_0x87c846){SmsQueueEvents['emit'](_0x4a8b21+':'+_0x86eba7['id'],_0x86eba7);SmsQueueEvents[_0xba34('0x5')](_0x4a8b21,_0x86eba7);_0x87c846(null);};}for(var e in events){if(events[_0xba34('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xba34('0x7')]=SmsQueueEvents;
\ No newline at end of file
+var _0x6737=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit'];(function(_0x54d32c,_0x210b27){var _0x20284f=function(_0x4be5d3){while(--_0x4be5d3){_0x54d32c['push'](_0x54d32c['shift']());}};_0x20284f(++_0x210b27);}(_0x6737,0x11b));var _0x7673=function(_0x45232e,_0x143066){_0x45232e=_0x45232e-0x0;var _0x15c0a2=_0x6737[_0x45232e];return _0x15c0a2;};'use strict';var EventEmitter=require(_0x7673('0x0'));var SmsQueue=require(_0x7673('0x1'))['db'][_0x7673('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7673('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7673('0x4'),'afterDestroy':_0x7673('0x5')};function emitEvent(_0x2e0892){return function(_0x193c7f,_0x4f9f2f,_0x5fbf9e){SmsQueueEvents[_0x7673('0x6')](_0x2e0892+':'+_0x193c7f['id'],_0x193c7f);SmsQueueEvents[_0x7673('0x6')](_0x2e0892,_0x193c7f);_0x5fbf9e(null);};}for(var e in events){if(events[_0x7673('0x7')](e)){var event=events[e];SmsQueue[_0x7673('0x8')](e,emitEvent(event));}}module[_0x7673('0x9')]=SmsQueueEvents;
\ No newline at end of file
index a190c61..59e94b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb32=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues'];(function(_0x1071c1,_0x353284){var _0x2920bf=function(_0x44fda7){while(--_0x44fda7){_0x1071c1['push'](_0x1071c1['shift']());}};_0x2920bf(++_0x353284);}(_0xfb32,0x118));var _0x2fb3=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xfb32[_0x817d9b];return _0x2752e1;};'use strict';var _=require('lodash');var util=require(_0x2fb3('0x0'));var logger=require(_0x2fb3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2fb3('0x2'));var fs=require('fs');var path=require(_0x2fb3('0x3'));var rimraf=require(_0x2fb3('0x4'));var config=require(_0x2fb3('0x5'));var attributes=require(_0x2fb3('0x6'));module[_0x2fb3('0x7')]=function(_0x1b619a,_0x185f6c){return _0x1b619a[_0x2fb3('0x8')]('SmsQueue',attributes,{'tableName':_0x2fb3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc812=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','define'];(function(_0x1f8feb,_0x41808d){var _0x111ead=function(_0x1a336b){while(--_0x1a336b){_0x1f8feb['push'](_0x1f8feb['shift']());}};_0x111ead(++_0x41808d);}(_0xc812,0x162));var _0x2c81=function(_0xda572e,_0x563565){_0xda572e=_0xda572e-0x0;var _0x49e5a3=_0xc812[_0xda572e];return _0x49e5a3;};'use strict';var _=require(_0x2c81('0x0'));var util=require(_0x2c81('0x1'));var logger=require(_0x2c81('0x2'))(_0x2c81('0x3'));var moment=require(_0x2c81('0x4'));var BPromise=require(_0x2c81('0x5'));var rp=require(_0x2c81('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c81('0x7'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module['exports']=function(_0x36b26b,_0x2388cb){return _0x36b26b[_0x2c81('0x8')](_0x2c81('0x9'),attributes,{'tableName':_0x2c81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fee5f03..2014c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6553=['info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowSmsQueue','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request'];(function(_0x5f5e01,_0x5a8dbf){var _0x317790=function(_0x5bda66){while(--_0x5bda66){_0x5f5e01['push'](_0x5f5e01['shift']());}};_0x317790(++_0x5a8dbf);}(_0x6553,0x188));var _0x3655=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x6553[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x3655('0x0'));var util=require('util');var moment=require(_0x3655('0x1'));var BPromise=require('bluebird');var rs=require(_0x3655('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3655('0x3'));var logger=require(_0x3655('0x4'))(_0x3655('0x5'));var config=require(_0x3655('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3655('0x7')]({'port':0x232a});config[_0x3655('0x8')]=_[_0x3655('0x9')](config[_0x3655('0x8')],{'host':_0x3655('0xa'),'port':0x18eb});var socket=require(_0x3655('0xb'))(new Redis(config['redis']));require(_0x3655('0xc'))[_0x3655('0xd')](socket);function respondWithRpcPromise(_0x2327ab,_0xaf357a,_0x27fe01){return new BPromise(function(_0x46180b,_0x3ec88a){return client[_0x3655('0xe')](_0x2327ab,_0x27fe01)['then'](function(_0x252e3e){logger[_0x3655('0xf')](_0x3655('0x10'),_0xaf357a,_0x3655('0x11'));logger[_0x3655('0x12')](_0x3655('0x13'),_0xaf357a,_0x3655('0x11'),JSON['stringify'](_0x252e3e));if(_0x252e3e[_0x3655('0x14')]){if(_0x252e3e[_0x3655('0x14')]['code']===0x1f4){logger['error'](_0x3655('0x10'),_0xaf357a,_0x252e3e[_0x3655('0x14')][_0x3655('0x15')]);return _0x3ec88a(_0x252e3e[_0x3655('0x14')][_0x3655('0x15')]);}logger['error'](_0x3655('0x10'),_0xaf357a,_0x252e3e[_0x3655('0x14')][_0x3655('0x15')]);return _0x46180b(_0x252e3e['error']['message']);}else{logger['info'](_0x3655('0x10'),_0xaf357a,_0x3655('0x11'));_0x46180b(_0x252e3e[_0x3655('0x16')][_0x3655('0x15')]);}})[_0x3655('0x17')](function(_0x4ee98b){logger[_0x3655('0x14')](_0x3655('0x10'),_0xaf357a,_0x4ee98b);_0x3ec88a(_0x4ee98b);});});}exports[_0x3655('0x18')]=function(_0x5df159){var _0xed48ca=this;return new Promise(function(_0x43b9d9,_0xa75bde){return db['SmsQueue'][_0x3655('0x19')]({'raw':_0x5df159[_0x3655('0x1a')]?_0x5df159[_0x3655('0x1a')][_0x3655('0x1b')]===undefined?!![]:![]:!![],'where':_0x5df159['options']?_0x5df159[_0x3655('0x1a')][_0x3655('0x1c')]||null:null,'attributes':_0x5df159[_0x3655('0x1a')]?_0x5df159[_0x3655('0x1a')][_0x3655('0x1d')]||null:null,'limit':_0x5df159[_0x3655('0x1a')]?_0x5df159['options'][_0x3655('0x1e')]||null:null,'include':_0x5df159[_0x3655('0x1a')]?_0x5df159[_0x3655('0x1a')][_0x3655('0x1f')]?_[_0x3655('0x20')](_0x5df159[_0x3655('0x1a')][_0x3655('0x1f')],function(_0x3dd739){return{'model':db[_0x3dd739[_0x3655('0x21')]],'as':_0x3dd739['as'],'attributes':_0x3dd739[_0x3655('0x1d')],'include':_0x3dd739[_0x3655('0x1f')]?_[_0x3655('0x20')](_0x3dd739[_0x3655('0x1f')],function(_0x1c26ad){return{'model':db[_0x1c26ad['model']],'as':_0x1c26ad['as'],'attributes':_0x1c26ad[_0x3655('0x1d')],'include':_0x1c26ad['include']?_[_0x3655('0x20')](_0x1c26ad[_0x3655('0x1f')],function(_0x4ce5fe){return{'model':db[_0x4ce5fe['model']],'as':_0x4ce5fe['as'],'attributes':_0x4ce5fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4917a2){logger[_0x3655('0xf')]('GetSmsQueue',_0x5df159);logger[_0x3655('0x12')](_0x3655('0x18'),_0x5df159,JSON[_0x3655('0x22')](_0x4917a2));_0x43b9d9(_0x4917a2);})[_0x3655('0x17')](function(_0x3db96f){logger[_0x3655('0x14')]('GetSmsQueue',_0x3db96f[_0x3655('0x15')],_0x5df159);_0xa75bde(_0xed48ca[_0x3655('0x14')](0x1f4,_0x3db96f[_0x3655('0x15')]));});});};exports['ShowSmsQueue']=function(_0x5716ba){var _0x1d2797=this;return new Promise(function(_0x368c88,_0x397744){return db['SmsQueue'][_0x3655('0x23')]({'raw':_0x5716ba[_0x3655('0x1a')]?_0x5716ba[_0x3655('0x1a')][_0x3655('0x1b')]===undefined?!![]:![]:!![],'where':_0x5716ba[_0x3655('0x1a')]?_0x5716ba['options'][_0x3655('0x1c')]||null:null,'attributes':_0x5716ba[_0x3655('0x1a')]?_0x5716ba[_0x3655('0x1a')][_0x3655('0x1d')]||null:null,'include':_0x5716ba[_0x3655('0x1a')]?_0x5716ba[_0x3655('0x1a')][_0x3655('0x1f')]?_[_0x3655('0x20')](_0x5716ba['options'][_0x3655('0x1f')],function(_0x1cfc7d){return{'model':db[_0x1cfc7d[_0x3655('0x21')]],'as':_0x1cfc7d['as'],'attributes':_0x1cfc7d['attributes'],'include':_0x1cfc7d[_0x3655('0x1f')]?_['map'](_0x1cfc7d[_0x3655('0x1f')],function(_0xdff584){return{'model':db[_0xdff584[_0x3655('0x21')]],'as':_0xdff584['as'],'attributes':_0xdff584[_0x3655('0x1d')],'include':_0xdff584[_0x3655('0x1f')]?_['map'](_0xdff584[_0x3655('0x1f')],function(_0x43d588){return{'model':db[_0x43d588[_0x3655('0x21')]],'as':_0x43d588['as'],'attributes':_0x43d588[_0x3655('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5776e8){logger[_0x3655('0xf')]('ShowSmsQueue',_0x5716ba);logger[_0x3655('0x12')]('ShowSmsQueue',_0x5716ba,JSON[_0x3655('0x22')](_0x5776e8));_0x368c88(_0x5776e8);})[_0x3655('0x17')](function(_0x54611b){logger['error'](_0x3655('0x24'),_0x54611b[_0x3655('0x15')],_0x5716ba);_0x397744(_0x1d2797['error'](0x1f4,_0x54611b[_0x3655('0x15')]));});});};
\ No newline at end of file
+var _0x08e8=['http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowSmsQueue','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x08e8,0x122));var _0x808e=function(_0x4f94f6,_0x3cc437){_0x4f94f6=_0x4f94f6-0x0;var _0x512a4b=_0x08e8[_0x4f94f6];return _0x512a4b;};'use strict';var _=require('lodash');var util=require(_0x808e('0x0'));var moment=require(_0x808e('0x1'));var BPromise=require(_0x808e('0x2'));var rs=require(_0x808e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x808e('0x4'))['db'];var utils=require(_0x808e('0x5'));var logger=require(_0x808e('0x6'))(_0x808e('0x7'));var config=require(_0x808e('0x8'));var jayson=require(_0x808e('0x9'));var client=jayson[_0x808e('0xa')][_0x808e('0xb')]({'port':0x232a});config['redis']=_[_0x808e('0xc')](config[_0x808e('0xd')],{'host':_0x808e('0xe'),'port':0x18eb});var socket=require(_0x808e('0xf'))(new Redis(config[_0x808e('0xd')]));require(_0x808e('0x10'))[_0x808e('0x11')](socket);function respondWithRpcPromise(_0x4a1561,_0x5bae3b,_0x130b40){return new BPromise(function(_0x1300dd,_0x1c2157){return client[_0x808e('0x12')](_0x4a1561,_0x130b40)[_0x808e('0x13')](function(_0x3cc4d3){logger[_0x808e('0x14')](_0x808e('0x15'),_0x5bae3b,_0x808e('0x16'));logger[_0x808e('0x17')](_0x808e('0x18'),_0x5bae3b,_0x808e('0x16'),JSON['stringify'](_0x3cc4d3));if(_0x3cc4d3[_0x808e('0x19')]){if(_0x3cc4d3[_0x808e('0x19')][_0x808e('0x1a')]===0x1f4){logger[_0x808e('0x19')](_0x808e('0x15'),_0x5bae3b,_0x3cc4d3['error']['message']);return _0x1c2157(_0x3cc4d3[_0x808e('0x19')]['message']);}logger[_0x808e('0x19')](_0x808e('0x15'),_0x5bae3b,_0x3cc4d3[_0x808e('0x19')][_0x808e('0x1b')]);return _0x1300dd(_0x3cc4d3[_0x808e('0x19')][_0x808e('0x1b')]);}else{logger[_0x808e('0x14')](_0x808e('0x15'),_0x5bae3b,_0x808e('0x16'));_0x1300dd(_0x3cc4d3[_0x808e('0x1c')]['message']);}})[_0x808e('0x1d')](function(_0x6ab826){logger[_0x808e('0x19')]('SmsQueue,\x20%s,\x20%s',_0x5bae3b,_0x6ab826);_0x1c2157(_0x6ab826);});});}exports[_0x808e('0x1e')]=function(_0x580919){var _0x3aad12=this;return new Promise(function(_0x50675e,_0x364709){return db[_0x808e('0x1f')]['findAll']({'raw':_0x580919[_0x808e('0x20')]?_0x580919[_0x808e('0x20')][_0x808e('0x21')]===undefined?!![]:![]:!![],'where':_0x580919[_0x808e('0x20')]?_0x580919[_0x808e('0x20')][_0x808e('0x22')]||null:null,'attributes':_0x580919['options']?_0x580919['options'][_0x808e('0x23')]||null:null,'limit':_0x580919[_0x808e('0x20')]?_0x580919[_0x808e('0x20')][_0x808e('0x24')]||null:null,'include':_0x580919['options']?_0x580919[_0x808e('0x20')][_0x808e('0x25')]?_['map'](_0x580919[_0x808e('0x20')][_0x808e('0x25')],function(_0x3df6ab){return{'model':db[_0x3df6ab['model']],'as':_0x3df6ab['as'],'attributes':_0x3df6ab['attributes'],'include':_0x3df6ab[_0x808e('0x25')]?_[_0x808e('0x26')](_0x3df6ab[_0x808e('0x25')],function(_0x57ecb4){return{'model':db[_0x57ecb4['model']],'as':_0x57ecb4['as'],'attributes':_0x57ecb4[_0x808e('0x23')],'include':_0x57ecb4[_0x808e('0x25')]?_['map'](_0x57ecb4[_0x808e('0x25')],function(_0x4e75c7){return{'model':db[_0x4e75c7[_0x808e('0x27')]],'as':_0x4e75c7['as'],'attributes':_0x4e75c7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43cdd3){logger['info']('GetSmsQueue',_0x580919);logger[_0x808e('0x17')]('GetSmsQueue',_0x580919,JSON[_0x808e('0x28')](_0x43cdd3));_0x50675e(_0x43cdd3);})[_0x808e('0x1d')](function(_0xcfb61){logger[_0x808e('0x19')]('GetSmsQueue',_0xcfb61['message'],_0x580919);_0x364709(_0x3aad12[_0x808e('0x19')](0x1f4,_0xcfb61[_0x808e('0x1b')]));});});};exports[_0x808e('0x29')]=function(_0x28d2da){var _0x4abf68=this;return new Promise(function(_0x379d5b,_0x42ccc4){return db[_0x808e('0x1f')][_0x808e('0x2a')]({'raw':_0x28d2da['options']?_0x28d2da[_0x808e('0x20')][_0x808e('0x21')]===undefined?!![]:![]:!![],'where':_0x28d2da[_0x808e('0x20')]?_0x28d2da['options'][_0x808e('0x22')]||null:null,'attributes':_0x28d2da['options']?_0x28d2da['options'][_0x808e('0x23')]||null:null,'include':_0x28d2da[_0x808e('0x20')]?_0x28d2da['options'][_0x808e('0x25')]?_['map'](_0x28d2da[_0x808e('0x20')][_0x808e('0x25')],function(_0x4ae319){return{'model':db[_0x4ae319[_0x808e('0x27')]],'as':_0x4ae319['as'],'attributes':_0x4ae319[_0x808e('0x23')],'include':_0x4ae319['include']?_[_0x808e('0x26')](_0x4ae319[_0x808e('0x25')],function(_0x25b747){return{'model':db[_0x25b747['model']],'as':_0x25b747['as'],'attributes':_0x25b747[_0x808e('0x23')],'include':_0x25b747[_0x808e('0x25')]?_[_0x808e('0x26')](_0x25b747[_0x808e('0x25')],function(_0x1bab74){return{'model':db[_0x1bab74['model']],'as':_0x1bab74['as'],'attributes':_0x1bab74[_0x808e('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55add2){logger[_0x808e('0x14')]('ShowSmsQueue',_0x28d2da);logger['debug']('ShowSmsQueue',_0x28d2da,JSON[_0x808e('0x28')](_0x55add2));_0x379d5b(_0x55add2);})['catch'](function(_0x56351d){logger[_0x808e('0x19')](_0x808e('0x29'),_0x56351d[_0x808e('0x1b')],_0x28d2da);_0x42ccc4(_0x4abf68[_0x808e('0x19')](0x1f4,_0x56351d[_0x808e('0x1b')]));});});};
\ No newline at end of file
index d4ec20d..4a46a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d92=['removeListener','register','length','smsQueue:','./smsQueue.events','save','update'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x1d92,0x10e));var _0x21d9=function(_0x475bf1,_0x5235b6){_0x475bf1=_0x475bf1-0x0;var _0x4095d1=_0x1d92[_0x475bf1];return _0x4095d1;};'use strict';var SmsQueueEvents=require(_0x21d9('0x0'));var events=[_0x21d9('0x1'),'remove',_0x21d9('0x2')];function createListener(_0x50dd4e,_0x966a6){return function(_0x193e7f){_0x966a6['emit'](_0x50dd4e,_0x193e7f);};}function removeListener(_0xccca62,_0xd5a83){return function(){SmsQueueEvents[_0x21d9('0x3')](_0xccca62,_0xd5a83);};}exports[_0x21d9('0x4')]=function(_0x2bbd63){for(var _0x16f6c3=0x0,_0x368b8d=events[_0x21d9('0x5')];_0x16f6c3<_0x368b8d;_0x16f6c3++){var _0x21b383=events[_0x16f6c3];var _0x214c8e=createListener(_0x21d9('0x6')+_0x21b383,_0x2bbd63);SmsQueueEvents['on'](_0x21b383,_0x214c8e);}};
\ No newline at end of file
+var _0xd60e=['register','length','smsQueue:','./smsQueue.events','save','update','emit','removeListener'];(function(_0x39d578,_0x2985b3){var _0x425e12=function(_0x505207){while(--_0x505207){_0x39d578['push'](_0x39d578['shift']());}};_0x425e12(++_0x2985b3);}(_0xd60e,0xcb));var _0xed60=function(_0x7d8bff,_0x1976c6){_0x7d8bff=_0x7d8bff-0x0;var _0x1535ae=_0xd60e[_0x7d8bff];return _0x1535ae;};'use strict';var SmsQueueEvents=require(_0xed60('0x0'));var events=[_0xed60('0x1'),'remove',_0xed60('0x2')];function createListener(_0x497883,_0x2ce2eb){return function(_0x536186){_0x2ce2eb[_0xed60('0x3')](_0x497883,_0x536186);};}function removeListener(_0x1facf5,_0x562139){return function(){SmsQueueEvents[_0xed60('0x4')](_0x1facf5,_0x562139);};}exports[_0xed60('0x5')]=function(_0x4b7f9d){for(var _0x5b5f27=0x0,_0x32101b=events[_0xed60('0x6')];_0x5b5f27<_0x32101b;_0x5b5f27++){var _0x5584d8=events[_0x5b5f27];var _0x98580f=createListener(_0xed60('0x7')+_0x5584d8,_0x4b7f9d);SmsQueueEvents['on'](_0x5584d8,_0x98580f);}};
\ No newline at end of file
index 2c31052..f6ae984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66e2=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x66e2,0x105));var _0x266e=function(_0x4c0da6,_0x49cee5){_0x4c0da6=_0x4c0da6-0x0;var _0x5825b2=_0x66e2[_0x4c0da6];return _0x5825b2;};'use strict';var multer=require(_0x266e('0x0'));var util=require(_0x266e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x266e('0x2'));var router=express[_0x266e('0x3')]();var fs_extra=require(_0x266e('0x4'));var auth=require(_0x266e('0x5'));var interaction=require(_0x266e('0x6'));var config=require(_0x266e('0x7'));var controller=require('./smsQueueReport.controller');router[_0x266e('0x8')]('/',auth[_0x266e('0x9')](),controller[_0x266e('0xa')]);router[_0x266e('0x8')](_0x266e('0xb'),auth[_0x266e('0x9')](),controller['describe']);router[_0x266e('0x8')](_0x266e('0xc'),auth[_0x266e('0x9')](),controller[_0x266e('0xd')]);router[_0x266e('0xe')]('/',auth[_0x266e('0x9')](),controller[_0x266e('0xf')]);router[_0x266e('0x10')](_0x266e('0xc'),auth['isAuthenticated'](),controller[_0x266e('0x11')]);router[_0x266e('0x12')](_0x266e('0xc'),auth[_0x266e('0x9')](),controller[_0x266e('0x13')]);module[_0x266e('0x14')]=router;
\ No newline at end of file
+var _0x724d=['/describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index'];(function(_0x555481,_0x4e1bf3){var _0x4b4a4f=function(_0x45e376){while(--_0x45e376){_0x555481['push'](_0x555481['shift']());}};_0x4b4a4f(++_0x4e1bf3);}(_0x724d,0xe5));var _0xd724=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x724d[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0xd724('0x0'));var util=require(_0xd724('0x1'));var path=require(_0xd724('0x2'));var timeout=require('connect-timeout');var express=require(_0xd724('0x3'));var router=express[_0xd724('0x4')]();var fs_extra=require(_0xd724('0x5'));var auth=require(_0xd724('0x6'));var interaction=require(_0xd724('0x7'));var config=require(_0xd724('0x8'));var controller=require(_0xd724('0x9'));router[_0xd724('0xa')]('/',auth[_0xd724('0xb')](),controller[_0xd724('0xc')]);router[_0xd724('0xa')](_0xd724('0xd'),auth[_0xd724('0xb')](),controller['describe']);router[_0xd724('0xa')](_0xd724('0xe'),auth[_0xd724('0xb')](),controller[_0xd724('0xf')]);router[_0xd724('0x10')]('/',auth[_0xd724('0xb')](),controller['create']);router[_0xd724('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd724('0x12')]);router[_0xd724('0x13')](_0xd724('0xe'),auth[_0xd724('0xb')](),controller[_0xd724('0x14')]);module[_0xd724('0x15')]=router;
\ No newline at end of file
index 03d0004..1f0d5cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b0d=['exports','STRING','DATE','moment','sequelize'];(function(_0x36f6ed,_0xd12ef6){var _0x304557=function(_0x297fd0){while(--_0x297fd0){_0x36f6ed['push'](_0x36f6ed['shift']());}};_0x304557(++_0xd12ef6);}(_0x8b0d,0x1f2));var _0xd8b0=function(_0x5e13b7,_0x441dbb){_0x5e13b7=_0x5e13b7-0x0;var _0x2098ab=_0x8b0d[_0x5e13b7];return _0x2098ab;};'use strict';var moment=require(_0xd8b0('0x0'));var Sequelize=require(_0xd8b0('0x1'));module[_0xd8b0('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd8b0('0x3')]},'joinAt':{'type':Sequelize[_0xd8b0('0x4')]},'leaveAt':{'type':Sequelize[_0xd8b0('0x4')]},'acceptAt':{'type':Sequelize[_0xd8b0('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x004c=['exports','STRING','DATE','moment','sequelize'];(function(_0x1d817b,_0x5b70e5){var _0x50dac5=function(_0x12fd5d){while(--_0x12fd5d){_0x1d817b['push'](_0x1d817b['shift']());}};_0x50dac5(++_0x5b70e5);}(_0x004c,0x85));var _0xc004=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x004c[_0x31a371];return _0x2a5bd6;};'use strict';var moment=require(_0xc004('0x0'));var Sequelize=require(_0xc004('0x1'));module[_0xc004('0x2')]={'uniqueid':{'type':Sequelize[_0xc004('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc004('0x4')]},'leaveAt':{'type':Sequelize[_0xc004('0x4')]},'acceptAt':{'type':Sequelize[_0xc004('0x4')]},'exitAt':{'type':Sequelize[_0xc004('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8d49abb..3ae86ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa51b=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','offset','limit','set','Content-Range','json','apply','reject','update','then','end','sendStatus','stack','name','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','find','create','body','params','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','squel'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xa51b,0x117));var _0xba51=function(_0x5881fe,_0x2b60ff){_0x5881fe=_0x5881fe-0x0;var _0x3404db=_0xa51b[_0x5881fe];return _0x3404db;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xba51('0x0'));var jsonpatch=require(_0xba51('0x1'));var rp=require('request-promise');var moment=require(_0xba51('0x2'));var BPromise=require(_0xba51('0x3'));var Mustache=require(_0xba51('0x4'));var util=require('util');var path=require(_0xba51('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xba51('0x6'));var fs=require('fs');var fs_extra=require(_0xba51('0x7'));var _=require('lodash');var squel=require(_0xba51('0x8'));var crypto=require('crypto');var jsforce=require(_0xba51('0x9'));var deskjs=require(_0xba51('0xa'));var toCsv=require(_0xba51('0xb'));var querystring=require(_0xba51('0xc'));var Papa=require(_0xba51('0xd'));var Redis=require(_0xba51('0xe'));var authService=require(_0xba51('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xba51('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba51('0x11'))(_0xba51('0x12'));var utils=require(_0xba51('0x13'));var config=require(_0xba51('0x14'));var licenseUtil=require(_0xba51('0x15'));var db=require(_0xba51('0x16'))['db'];function respondWithStatusCode(_0x3afb82,_0x381af2){_0x381af2=_0x381af2||0xcc;return function(_0x1a37dd){if(_0x1a37dd){return _0x3afb82['sendStatus'](_0x381af2);}return _0x3afb82['status'](_0x381af2)['end']();};}function respondWithResult(_0x4a972a,_0x5bce09){_0x5bce09=_0x5bce09||0xc8;return function(_0x1fce41){if(_0x1fce41){return _0x4a972a[_0xba51('0x17')](_0x5bce09)['json'](_0x1fce41);}};}function respondWithFilteredResult(_0x5176ca,_0x129a61){return function(_0x4eac95){if(_0x4eac95){var _0x52855f=typeof _0x129a61['offset']===_0xba51('0x18')&&typeof _0x129a61['limit']==='undefined';var _0x2810a7=_0x4eac95['count'];var _0x361c7c=_0x52855f?0x0:_0x129a61['offset'];var _0x346ac1=_0x52855f?_0x4eac95['count']:_0x129a61[_0xba51('0x19')]+_0x129a61[_0xba51('0x1a')];var _0x56221a;if(_0x346ac1>=_0x2810a7){_0x346ac1=_0x2810a7;_0x56221a=0xc8;}else{_0x56221a=0xce;}_0x5176ca[_0xba51('0x17')](_0x56221a);return _0x5176ca[_0xba51('0x1b')](_0xba51('0x1c'),_0x361c7c+'-'+_0x346ac1+'/'+_0x2810a7)[_0xba51('0x1d')](_0x4eac95);}return null;};}function patchUpdates(_0x4ea1ca){return function(_0xa846c0){try{jsonpatch[_0xba51('0x1e')](_0xa846c0,_0x4ea1ca,!![]);}catch(_0x3fbe1e){return BPromise[_0xba51('0x1f')](_0x3fbe1e);}return _0xa846c0['save']();};}function saveUpdates(_0x58c7b0,_0x445731){return function(_0x752d0a){if(_0x752d0a){return _0x752d0a[_0xba51('0x20')](_0x58c7b0)['then'](function(_0x198755){return _0x198755;});}return null;};}function removeEntity(_0x2fe9af,_0x8faacb){return function(_0x363dcc){if(_0x363dcc){return _0x363dcc['destroy']()[_0xba51('0x21')](function(){_0x2fe9af[_0xba51('0x17')](0xcc)[_0xba51('0x22')]();});}};}function handleEntityNotFound(_0x155e90,_0x19242c){return function(_0x40ca1c){if(!_0x40ca1c){_0x155e90[_0xba51('0x23')](0x194);}return _0x40ca1c;};}function handleError(_0x565192,_0x4be4a8){_0x4be4a8=_0x4be4a8||0x1f4;return function(_0x183d4d){logger['error'](_0x183d4d[_0xba51('0x24')]);if(_0x183d4d[_0xba51('0x25')]){delete _0x183d4d[_0xba51('0x25')];}_0x565192[_0xba51('0x17')](_0x4be4a8)['send'](_0x183d4d);};}exports[_0xba51('0x26')]=function(_0x422acf,_0x59d704){var _0x2d6f41={},_0x15738d={},_0x14d0a0={'count':0x0,'rows':[]};var _0x144318=_['map'](db[_0xba51('0x27')][_0xba51('0x28')],function(_0x31112c){return{'name':_0x31112c[_0xba51('0x29')],'type':_0x31112c[_0xba51('0x2a')][_0xba51('0x2b')]};});_0x15738d[_0xba51('0x2c')]=_['map'](_0x144318,_0xba51('0x25'));_0x15738d[_0xba51('0x2d')]=_[_0xba51('0x2e')](_0x422acf[_0xba51('0x2d')]);_0x15738d[_0xba51('0x2f')]=_[_0xba51('0x30')](_0x15738d[_0xba51('0x2c')],_0x15738d['query']);_0x2d6f41[_0xba51('0x31')]=_[_0xba51('0x30')](_0x15738d[_0xba51('0x2c')],qs[_0xba51('0x32')](_0x422acf[_0xba51('0x2d')][_0xba51('0x32')]));_0x2d6f41[_0xba51('0x31')]=_0x2d6f41['attributes'][_0xba51('0x33')]?_0x2d6f41[_0xba51('0x31')]:_0x15738d[_0xba51('0x2c')];if(!_0x422acf[_0xba51('0x2d')][_0xba51('0x34')]('nolimit')){_0x2d6f41[_0xba51('0x1a')]=qs['limit'](_0x422acf[_0xba51('0x2d')][_0xba51('0x1a')]);_0x2d6f41[_0xba51('0x19')]=qs[_0xba51('0x19')](_0x422acf[_0xba51('0x2d')][_0xba51('0x19')]);}_0x2d6f41['order']=qs[_0xba51('0x35')](_0x422acf['query']['sort']);_0x2d6f41[_0xba51('0x36')]=qs[_0xba51('0x2f')](_[_0xba51('0x37')](_0x422acf[_0xba51('0x2d')],_0x15738d[_0xba51('0x2f')]),_0x144318);if(_0x422acf[_0xba51('0x2d')][_0xba51('0x38')]){_0x2d6f41[_0xba51('0x36')]=_[_0xba51('0x39')](_0x2d6f41[_0xba51('0x36')],{'$or':_[_0xba51('0x3a')](_0x144318,function(_0x11fa60){if(_0x11fa60[_0xba51('0x2a')]!==_0xba51('0x3b')){var _0xa8599f={};_0xa8599f[_0x11fa60[_0xba51('0x25')]]={'$like':'%'+_0x422acf['query'][_0xba51('0x38')]+'%'};return _0xa8599f;}})});}_0x2d6f41=_[_0xba51('0x39')]({},_0x2d6f41,_0x422acf[_0xba51('0x3c')]);var _0x2925ea={'where':_0x2d6f41[_0xba51('0x36')]};return db[_0xba51('0x27')][_0xba51('0x3d')](_0x2925ea)[_0xba51('0x21')](function(_0x10674b){_0x14d0a0['count']=_0x10674b;if(_0x422acf[_0xba51('0x2d')][_0xba51('0x3e')]){_0x2d6f41[_0xba51('0x3f')]=[{'all':!![]}];}return db[_0xba51('0x27')][_0xba51('0x40')](_0x2d6f41);})['then'](function(_0x4e2cae){_0x14d0a0[_0xba51('0x41')]=_0x4e2cae;return _0x14d0a0;})[_0xba51('0x21')](respondWithFilteredResult(_0x59d704,_0x2d6f41))[_0xba51('0x42')](handleError(_0x59d704,null));};exports['show']=function(_0x5f2605,_0x585918){var _0x398e27={'raw':!![],'where':{'id':_0x5f2605['params']['id']}},_0x2a77f1={};_0x2a77f1[_0xba51('0x2c')]=_[_0xba51('0x2e')](db['SmsQueueReport'][_0xba51('0x28')]);_0x2a77f1[_0xba51('0x2d')]=_[_0xba51('0x2e')](_0x5f2605[_0xba51('0x2d')]);_0x2a77f1[_0xba51('0x2f')]=_['intersection'](_0x2a77f1[_0xba51('0x2c')],_0x2a77f1[_0xba51('0x2d')]);_0x398e27[_0xba51('0x31')]=_['intersection'](_0x2a77f1[_0xba51('0x2c')],qs[_0xba51('0x32')](_0x5f2605[_0xba51('0x2d')][_0xba51('0x32')]));_0x398e27[_0xba51('0x31')]=_0x398e27[_0xba51('0x31')]['length']?_0x398e27[_0xba51('0x31')]:_0x2a77f1['model'];if(_0x5f2605[_0xba51('0x2d')][_0xba51('0x3e')]){_0x398e27['include']=[{'all':!![]}];}_0x398e27=_[_0xba51('0x39')]({},_0x398e27,_0x5f2605['options']);return db['SmsQueueReport'][_0xba51('0x43')](_0x398e27)[_0xba51('0x21')](handleEntityNotFound(_0x585918,null))[_0xba51('0x21')](respondWithResult(_0x585918,null))['catch'](handleError(_0x585918,null));};exports[_0xba51('0x44')]=function(_0x7de1de,_0x16ed28){return db[_0xba51('0x27')][_0xba51('0x44')](_0x7de1de[_0xba51('0x45')],{})['then'](respondWithResult(_0x16ed28,0xc9))[_0xba51('0x42')](handleError(_0x16ed28,null));};exports[_0xba51('0x20')]=function(_0x14d267,_0x42f50b){if(_0x14d267[_0xba51('0x45')]['id']){delete _0x14d267[_0xba51('0x45')]['id'];}return db[_0xba51('0x27')][_0xba51('0x43')]({'where':{'id':_0x14d267[_0xba51('0x46')]['id']}})[_0xba51('0x21')](handleEntityNotFound(_0x42f50b,null))[_0xba51('0x21')](saveUpdates(_0x14d267[_0xba51('0x45')],null))[_0xba51('0x21')](respondWithResult(_0x42f50b,null))[_0xba51('0x42')](handleError(_0x42f50b,null));};exports['destroy']=function(_0xee9a2f,_0x4b56e3){return db[_0xba51('0x27')][_0xba51('0x43')]({'where':{'id':_0xee9a2f[_0xba51('0x46')]['id']}})[_0xba51('0x21')](handleEntityNotFound(_0x4b56e3,null))[_0xba51('0x21')](removeEntity(_0x4b56e3,null))[_0xba51('0x42')](handleError(_0x4b56e3,null));};exports[_0xba51('0x47')]=function(_0x1f920b,_0xbed689){return db[_0xba51('0x27')][_0xba51('0x47')]()[_0xba51('0x21')](respondWithResult(_0xbed689,null))[_0xba51('0x42')](handleError(_0xbed689,null));};
\ No newline at end of file
+var _0x3b15=['merge','map','VIRTUAL','filter','includeAll','include','findAll','show','params','keys','options','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','SmsQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where'];(function(_0x5aff1d,_0x4267c1){var _0x53c519=function(_0x2af464){while(--_0x2af464){_0x5aff1d['push'](_0x5aff1d['shift']());}};_0x53c519(++_0x4267c1);}(_0x3b15,0x148));var _0x53b1=function(_0x2e7a43,_0x3b3df4){_0x2e7a43=_0x2e7a43-0x0;var _0x52e9e1=_0x3b15[_0x2e7a43];return _0x52e9e1;};'use strict';var emlformat=require(_0x53b1('0x0'));var rimraf=require(_0x53b1('0x1'));var zipdir=require(_0x53b1('0x2'));var jsonpatch=require(_0x53b1('0x3'));var rp=require('request-promise');var moment=require(_0x53b1('0x4'));var BPromise=require(_0x53b1('0x5'));var Mustache=require(_0x53b1('0x6'));var util=require(_0x53b1('0x7'));var path=require('path');var sox=require(_0x53b1('0x8'));var csv=require(_0x53b1('0x9'));var ejs=require(_0x53b1('0xa'));var fs=require('fs');var fs_extra=require(_0x53b1('0xb'));var _=require(_0x53b1('0xc'));var squel=require(_0x53b1('0xd'));var crypto=require(_0x53b1('0xe'));var jsforce=require(_0x53b1('0xf'));var deskjs=require(_0x53b1('0x10'));var toCsv=require(_0x53b1('0x9'));var querystring=require(_0x53b1('0x11'));var Papa=require(_0x53b1('0x12'));var Redis=require('ioredis');var authService=require(_0x53b1('0x13'));var qs=require(_0x53b1('0x14'));var as=require(_0x53b1('0x15'));var hardwareService=require(_0x53b1('0x16'));var logger=require('../../config/logger')(_0x53b1('0x17'));var utils=require('../../config/utils');var config=require(_0x53b1('0x18'));var licenseUtil=require(_0x53b1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ef62d,_0x127171){_0x127171=_0x127171||0xcc;return function(_0x4fccfb){if(_0x4fccfb){return _0x1ef62d[_0x53b1('0x1a')](_0x127171);}return _0x1ef62d['status'](_0x127171)[_0x53b1('0x1b')]();};}function respondWithResult(_0x118964,_0xa09429){_0xa09429=_0xa09429||0xc8;return function(_0x558636){if(_0x558636){return _0x118964[_0x53b1('0x1c')](_0xa09429)[_0x53b1('0x1d')](_0x558636);}};}function respondWithFilteredResult(_0x5a3084,_0x26beb2){return function(_0x26e381){if(_0x26e381){var _0x509670=typeof _0x26beb2[_0x53b1('0x1e')]===_0x53b1('0x1f')&&typeof _0x26beb2[_0x53b1('0x20')]===_0x53b1('0x1f');var _0x55ea3d=_0x26e381[_0x53b1('0x21')];var _0x53431e=_0x509670?0x0:_0x26beb2['offset'];var _0x3eacf7=_0x509670?_0x26e381[_0x53b1('0x21')]:_0x26beb2[_0x53b1('0x1e')]+_0x26beb2['limit'];var _0x3a0608;if(_0x3eacf7>=_0x55ea3d){_0x3eacf7=_0x55ea3d;_0x3a0608=0xc8;}else{_0x3a0608=0xce;}_0x5a3084['status'](_0x3a0608);return _0x5a3084[_0x53b1('0x22')](_0x53b1('0x23'),_0x53431e+'-'+_0x3eacf7+'/'+_0x55ea3d)[_0x53b1('0x1d')](_0x26e381);}return null;};}function patchUpdates(_0x460d58){return function(_0x5ed2e6){try{jsonpatch[_0x53b1('0x24')](_0x5ed2e6,_0x460d58,!![]);}catch(_0x4470e7){return BPromise[_0x53b1('0x25')](_0x4470e7);}return _0x5ed2e6[_0x53b1('0x26')]();};}function saveUpdates(_0x5c5742,_0xb9980a){return function(_0x31a98c){if(_0x31a98c){return _0x31a98c[_0x53b1('0x27')](_0x5c5742)['then'](function(_0x50b732){return _0x50b732;});}return null;};}function removeEntity(_0x143191,_0x49c121){return function(_0x410cad){if(_0x410cad){return _0x410cad[_0x53b1('0x28')]()[_0x53b1('0x29')](function(){_0x143191[_0x53b1('0x1c')](0xcc)[_0x53b1('0x1b')]();});}};}function handleEntityNotFound(_0x1de749,_0x41cf4a){return function(_0x5201e2){if(!_0x5201e2){_0x1de749[_0x53b1('0x1a')](0x194);}return _0x5201e2;};}function handleError(_0x53ca4c,_0x45c546){_0x45c546=_0x45c546||0x1f4;return function(_0x23efbc){logger[_0x53b1('0x2a')](_0x23efbc['stack']);if(_0x23efbc[_0x53b1('0x2b')]){delete _0x23efbc['name'];}_0x53ca4c[_0x53b1('0x1c')](_0x45c546)['send'](_0x23efbc);};}exports[_0x53b1('0x2c')]=function(_0x48dfa0,_0xb1963f){var _0x152828={},_0x53ad6e={},_0x3b916d={'count':0x0,'rows':[]};var _0x3a171e=_['map'](db[_0x53b1('0x2d')][_0x53b1('0x2e')],function(_0x4895ed){return{'name':_0x4895ed[_0x53b1('0x2f')],'type':_0x4895ed['type'][_0x53b1('0x30')]};});_0x53ad6e[_0x53b1('0x31')]=_['map'](_0x3a171e,_0x53b1('0x2b'));_0x53ad6e[_0x53b1('0x32')]=_['keys'](_0x48dfa0[_0x53b1('0x32')]);_0x53ad6e[_0x53b1('0x33')]=_[_0x53b1('0x34')](_0x53ad6e[_0x53b1('0x31')],_0x53ad6e[_0x53b1('0x32')]);_0x152828[_0x53b1('0x35')]=_['intersection'](_0x53ad6e[_0x53b1('0x31')],qs[_0x53b1('0x36')](_0x48dfa0['query'][_0x53b1('0x36')]));_0x152828[_0x53b1('0x35')]=_0x152828[_0x53b1('0x35')][_0x53b1('0x37')]?_0x152828[_0x53b1('0x35')]:_0x53ad6e[_0x53b1('0x31')];if(!_0x48dfa0['query'][_0x53b1('0x38')](_0x53b1('0x39'))){_0x152828[_0x53b1('0x20')]=qs[_0x53b1('0x20')](_0x48dfa0[_0x53b1('0x32')][_0x53b1('0x20')]);_0x152828[_0x53b1('0x1e')]=qs[_0x53b1('0x1e')](_0x48dfa0['query']['offset']);}_0x152828[_0x53b1('0x3a')]=qs[_0x53b1('0x3b')](_0x48dfa0[_0x53b1('0x32')][_0x53b1('0x3b')]);_0x152828['where']=qs[_0x53b1('0x33')](_[_0x53b1('0x3c')](_0x48dfa0[_0x53b1('0x32')],_0x53ad6e['filters']),_0x3a171e);if(_0x48dfa0[_0x53b1('0x32')]['filter']){_0x152828[_0x53b1('0x3d')]=_[_0x53b1('0x3e')](_0x152828[_0x53b1('0x3d')],{'$or':_[_0x53b1('0x3f')](_0x3a171e,function(_0x3b1a44){if(_0x3b1a44['type']!==_0x53b1('0x40')){var _0x34270b={};_0x34270b[_0x3b1a44[_0x53b1('0x2b')]]={'$like':'%'+_0x48dfa0[_0x53b1('0x32')][_0x53b1('0x41')]+'%'};return _0x34270b;}})});}_0x152828=_['merge']({},_0x152828,_0x48dfa0['options']);var _0x1f152d={'where':_0x152828[_0x53b1('0x3d')]};return db[_0x53b1('0x2d')][_0x53b1('0x21')](_0x1f152d)[_0x53b1('0x29')](function(_0x53c578){_0x3b916d[_0x53b1('0x21')]=_0x53c578;if(_0x48dfa0[_0x53b1('0x32')][_0x53b1('0x42')]){_0x152828[_0x53b1('0x43')]=[{'all':!![]}];}return db[_0x53b1('0x2d')][_0x53b1('0x44')](_0x152828);})[_0x53b1('0x29')](function(_0x3b15d2){_0x3b916d['rows']=_0x3b15d2;return _0x3b916d;})[_0x53b1('0x29')](respondWithFilteredResult(_0xb1963f,_0x152828))['catch'](handleError(_0xb1963f,null));};exports[_0x53b1('0x45')]=function(_0x5035af,_0x33e374){var _0x478dd6={'raw':!![],'where':{'id':_0x5035af[_0x53b1('0x46')]['id']}},_0x2399ca={};_0x2399ca[_0x53b1('0x31')]=_[_0x53b1('0x47')](db[_0x53b1('0x2d')][_0x53b1('0x2e')]);_0x2399ca[_0x53b1('0x32')]=_[_0x53b1('0x47')](_0x5035af[_0x53b1('0x32')]);_0x2399ca['filters']=_[_0x53b1('0x34')](_0x2399ca[_0x53b1('0x31')],_0x2399ca['query']);_0x478dd6[_0x53b1('0x35')]=_['intersection'](_0x2399ca[_0x53b1('0x31')],qs[_0x53b1('0x36')](_0x5035af[_0x53b1('0x32')]['fields']));_0x478dd6[_0x53b1('0x35')]=_0x478dd6[_0x53b1('0x35')][_0x53b1('0x37')]?_0x478dd6[_0x53b1('0x35')]:_0x2399ca[_0x53b1('0x31')];if(_0x5035af[_0x53b1('0x32')][_0x53b1('0x42')]){_0x478dd6[_0x53b1('0x43')]=[{'all':!![]}];}_0x478dd6=_[_0x53b1('0x3e')]({},_0x478dd6,_0x5035af[_0x53b1('0x48')]);return db['SmsQueueReport']['find'](_0x478dd6)[_0x53b1('0x29')](handleEntityNotFound(_0x33e374,null))[_0x53b1('0x29')](respondWithResult(_0x33e374,null))['catch'](handleError(_0x33e374,null));};exports[_0x53b1('0x49')]=function(_0x435e73,_0x1b1306){return db['SmsQueueReport']['create'](_0x435e73[_0x53b1('0x4a')],{})[_0x53b1('0x29')](respondWithResult(_0x1b1306,0xc9))[_0x53b1('0x4b')](handleError(_0x1b1306,null));};exports['update']=function(_0x10261b,_0x117b2a){if(_0x10261b['body']['id']){delete _0x10261b['body']['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x10261b[_0x53b1('0x46')]['id']}})[_0x53b1('0x29')](handleEntityNotFound(_0x117b2a,null))['then'](saveUpdates(_0x10261b[_0x53b1('0x4a')],null))[_0x53b1('0x29')](respondWithResult(_0x117b2a,null))[_0x53b1('0x4b')](handleError(_0x117b2a,null));};exports[_0x53b1('0x28')]=function(_0xc91ea8,_0x14b125){return db['SmsQueueReport'][_0x53b1('0x4c')]({'where':{'id':_0xc91ea8[_0x53b1('0x46')]['id']}})[_0x53b1('0x29')](handleEntityNotFound(_0x14b125,null))[_0x53b1('0x29')](removeEntity(_0x14b125,null))[_0x53b1('0x4b')](handleError(_0x14b125,null));};exports[_0x53b1('0x4d')]=function(_0x237924,_0x4bef2f){return db[_0x53b1('0x2d')][_0x53b1('0x4d')]()[_0x53b1('0x29')](respondWithResult(_0x4bef2f,null))[_0x53b1('0x4b')](handleError(_0x4bef2f,null));};
\ No newline at end of file
index 6fc0250..be98825 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index e568c2f..d38b636 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6a4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','CreateSmsQueueReport','SmsQueueReport','create','options','raw','stringify','catch','UpdateSmsQueueReport','body','where','attributes','limit','lodash','util'];(function(_0x3c9741,_0x557e3d){var _0x72aa01=function(_0x2fb44d){while(--_0x2fb44d){_0x3c9741['push'](_0x3c9741['shift']());}};_0x72aa01(++_0x557e3d);}(_0xd6a4,0xb2));var _0x4d6a=function(_0x5c589e,_0x1e20c6){_0x5c589e=_0x5c589e-0x0;var _0x298ab2=_0xd6a4[_0x5c589e];return _0x298ab2;};'use strict';var _=require(_0x4d6a('0x0'));var util=require(_0x4d6a('0x1'));var moment=require(_0x4d6a('0x2'));var BPromise=require(_0x4d6a('0x3'));var rs=require(_0x4d6a('0x4'));var fs=require('fs');var Redis=require(_0x4d6a('0x5'));var db=require(_0x4d6a('0x6'))['db'];var utils=require(_0x4d6a('0x7'));var logger=require(_0x4d6a('0x8'))(_0x4d6a('0x9'));var config=require(_0x4d6a('0xa'));var jayson=require(_0x4d6a('0xb'));var client=jayson[_0x4d6a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1952a5,_0x56ce59,_0x35fe2f){return new BPromise(function(_0x286936,_0x56cdf4){return client[_0x4d6a('0xd')](_0x1952a5,_0x35fe2f)[_0x4d6a('0xe')](function(_0x32315e){logger['info'](_0x4d6a('0xf'),_0x56ce59,_0x4d6a('0x10'));logger[_0x4d6a('0x11')](_0x4d6a('0x12'),_0x56ce59,_0x4d6a('0x10'),JSON['stringify'](_0x32315e));if(_0x32315e['error']){if(_0x32315e['error'][_0x4d6a('0x13')]===0x1f4){logger[_0x4d6a('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x56ce59,_0x32315e[_0x4d6a('0x14')]['message']);return _0x56cdf4(_0x32315e[_0x4d6a('0x14')][_0x4d6a('0x15')]);}logger[_0x4d6a('0x14')](_0x4d6a('0xf'),_0x56ce59,_0x32315e[_0x4d6a('0x14')][_0x4d6a('0x15')]);return _0x286936(_0x32315e[_0x4d6a('0x14')][_0x4d6a('0x15')]);}else{logger[_0x4d6a('0x16')](_0x4d6a('0xf'),_0x56ce59,_0x4d6a('0x10'));_0x286936(_0x32315e[_0x4d6a('0x17')][_0x4d6a('0x15')]);}})['catch'](function(_0x3ac0b3){logger[_0x4d6a('0x14')](_0x4d6a('0xf'),_0x56ce59,_0x3ac0b3);_0x56cdf4(_0x3ac0b3);});});}exports[_0x4d6a('0x18')]=function(_0xfdf480){var _0x1ce168=this;return new Promise(function(_0x310cc1,_0xdbff2c){return db[_0x4d6a('0x19')][_0x4d6a('0x1a')](_0xfdf480['body'],{'raw':_0xfdf480[_0x4d6a('0x1b')]?_0xfdf480[_0x4d6a('0x1b')][_0x4d6a('0x1c')]===undefined?!![]:![]:!![]})[_0x4d6a('0xe')](function(_0x5ef6bc){logger['info']('CreateSmsQueueReport',_0xfdf480);logger[_0x4d6a('0x11')](_0x4d6a('0x18'),_0xfdf480,JSON[_0x4d6a('0x1d')](_0x5ef6bc));_0x310cc1(_0x5ef6bc);})[_0x4d6a('0x1e')](function(_0x2461e8){logger[_0x4d6a('0x14')](_0x4d6a('0x18'),_0x2461e8[_0x4d6a('0x15')],_0xfdf480);_0xdbff2c(_0x1ce168[_0x4d6a('0x14')](0x1f4,_0x2461e8[_0x4d6a('0x15')]));});});};exports[_0x4d6a('0x1f')]=function(_0xc85043){var _0xa9afe3=this;return new Promise(function(_0x39d53a,_0x294441){return db['SmsQueueReport']['update'](_0xc85043[_0x4d6a('0x20')],{'raw':_0xc85043[_0x4d6a('0x1b')]?_0xc85043['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc85043[_0x4d6a('0x1b')]?_0xc85043[_0x4d6a('0x1b')][_0x4d6a('0x21')]||null:null,'attributes':_0xc85043[_0x4d6a('0x1b')]?_0xc85043['options'][_0x4d6a('0x22')]||null:null,'limit':_0xc85043[_0x4d6a('0x1b')]?_0xc85043[_0x4d6a('0x1b')][_0x4d6a('0x23')]||null:null})[_0x4d6a('0xe')](function(_0xdded4d){logger['info'](_0x4d6a('0x1f'),_0xc85043);logger[_0x4d6a('0x11')](_0x4d6a('0x1f'),_0xc85043,JSON[_0x4d6a('0x1d')](_0xdded4d));_0x39d53a(_0xdded4d);})[_0x4d6a('0x1e')](function(_0x3e936e){logger['error'](_0x4d6a('0x1f'),_0x3e936e[_0x4d6a('0x15')],_0xc85043);_0x294441(_0xa9afe3[_0x4d6a('0x14')](0x1f4,_0x3e936e[_0x4d6a('0x15')]));});});};
\ No newline at end of file
+var _0x4030=['../../config/environment','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','SmsQueueReport','update','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x544afb,_0xa77ab6){var _0x3c39ec=function(_0x573442){while(--_0x573442){_0x544afb['push'](_0x544afb['shift']());}};_0x3c39ec(++_0xa77ab6);}(_0x4030,0x10e));var _0x0403=function(_0x300a0a,_0x1653d4){_0x300a0a=_0x300a0a-0x0;var _0x28b718=_0x4030[_0x300a0a];return _0x28b718;};'use strict';var _=require(_0x0403('0x0'));var util=require(_0x0403('0x1'));var moment=require(_0x0403('0x2'));var BPromise=require(_0x0403('0x3'));var rs=require(_0x0403('0x4'));var fs=require('fs');var Redis=require(_0x0403('0x5'));var db=require(_0x0403('0x6'))['db'];var utils=require(_0x0403('0x7'));var logger=require(_0x0403('0x8'))(_0x0403('0x9'));var config=require(_0x0403('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0403('0xb')][_0x0403('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf29bdc,_0x27015a,_0x5df9aa){return new BPromise(function(_0x325bfd,_0x17736c){return client[_0x0403('0xd')](_0xf29bdc,_0x5df9aa)[_0x0403('0xe')](function(_0xd37373){logger['info'](_0x0403('0xf'),_0x27015a,_0x0403('0x10'));logger[_0x0403('0x11')](_0x0403('0x12'),_0x27015a,_0x0403('0x10'),JSON['stringify'](_0xd37373));if(_0xd37373['error']){if(_0xd37373[_0x0403('0x13')][_0x0403('0x14')]===0x1f4){logger[_0x0403('0x13')](_0x0403('0xf'),_0x27015a,_0xd37373['error']['message']);return _0x17736c(_0xd37373[_0x0403('0x13')]['message']);}logger[_0x0403('0x13')](_0x0403('0xf'),_0x27015a,_0xd37373[_0x0403('0x13')][_0x0403('0x15')]);return _0x325bfd(_0xd37373['error'][_0x0403('0x15')]);}else{logger[_0x0403('0x16')](_0x0403('0xf'),_0x27015a,_0x0403('0x10'));_0x325bfd(_0xd37373[_0x0403('0x17')][_0x0403('0x15')]);}})[_0x0403('0x18')](function(_0x458249){logger[_0x0403('0x13')](_0x0403('0xf'),_0x27015a,_0x458249);_0x17736c(_0x458249);});});}exports[_0x0403('0x19')]=function(_0x4c572d){var _0xe9580d=this;return new Promise(function(_0x177e83,_0x14751a){return db['SmsQueueReport'][_0x0403('0x1a')](_0x4c572d[_0x0403('0x1b')],{'raw':_0x4c572d[_0x0403('0x1c')]?_0x4c572d['options'][_0x0403('0x1d')]===undefined?!![]:![]:!![]})[_0x0403('0xe')](function(_0x5617c7){logger[_0x0403('0x16')](_0x0403('0x19'),_0x4c572d);logger[_0x0403('0x11')](_0x0403('0x19'),_0x4c572d,JSON['stringify'](_0x5617c7));_0x177e83(_0x5617c7);})[_0x0403('0x18')](function(_0x1ee58c){logger[_0x0403('0x13')](_0x0403('0x19'),_0x1ee58c[_0x0403('0x15')],_0x4c572d);_0x14751a(_0xe9580d[_0x0403('0x13')](0x1f4,_0x1ee58c[_0x0403('0x15')]));});});};exports[_0x0403('0x1e')]=function(_0x32898e){var _0x386306=this;return new Promise(function(_0x3c7fe5,_0x1c35f1){return db[_0x0403('0x1f')][_0x0403('0x20')](_0x32898e[_0x0403('0x1b')],{'raw':_0x32898e[_0x0403('0x1c')]?_0x32898e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32898e[_0x0403('0x1c')]?_0x32898e[_0x0403('0x1c')]['where']||null:null,'attributes':_0x32898e['options']?_0x32898e[_0x0403('0x1c')][_0x0403('0x21')]||null:null,'limit':_0x32898e[_0x0403('0x1c')]?_0x32898e[_0x0403('0x1c')]['limit']||null:null})['then'](function(_0x251e1e){logger[_0x0403('0x16')](_0x0403('0x1e'),_0x32898e);logger[_0x0403('0x11')](_0x0403('0x1e'),_0x32898e,JSON[_0x0403('0x22')](_0x251e1e));_0x3c7fe5(_0x251e1e);})[_0x0403('0x18')](function(_0x149909){logger['error'](_0x0403('0x1e'),_0x149909[_0x0403('0x15')],_0x32898e);_0x1c35f1(_0x386306[_0x0403('0x13')](0x1f4,_0x149909['message']));});});};
\ No newline at end of file
index 0c187a4..3855a29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d0=['../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service'];(function(_0x4cba6c,_0xc0019){var _0x57b37b=function(_0x5cc704){while(--_0x5cc704){_0x4cba6c['push'](_0x4cba6c['shift']());}};_0x57b37b(++_0xc0019);}(_0x85d0,0x164));var _0x085d=function(_0x215e9a,_0x7da732){_0x215e9a=_0x215e9a-0x0;var _0x25ceef=_0x85d0[_0x215e9a];return _0x25ceef;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x085d('0x0'));var router=express[_0x085d('0x1')]();var fs_extra=require(_0x085d('0x2'));var auth=require(_0x085d('0x3'));var interaction=require(_0x085d('0x4'));var config=require(_0x085d('0x5'));var controller=require('./smsTransferReport.controller');router[_0x085d('0x6')]('/',auth['isAuthenticated'](),controller[_0x085d('0x7')]);router[_0x085d('0x6')](_0x085d('0x8'),auth['isAuthenticated'](),controller[_0x085d('0x9')]);router[_0x085d('0x6')](_0x085d('0xa'),auth[_0x085d('0xb')](),controller[_0x085d('0xc')]);router[_0x085d('0xd')]('/',auth[_0x085d('0xb')](),controller[_0x085d('0xe')]);router[_0x085d('0xf')]('/:id',auth[_0x085d('0xb')](),controller[_0x085d('0x10')]);router[_0x085d('0x11')](_0x085d('0xa'),auth['isAuthenticated'](),controller[_0x085d('0x12')]);module[_0x085d('0x13')]=router;
\ No newline at end of file
+var _0x7dfd=['isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x1b7254,_0x442034){var _0x30f907=function(_0x15b6d0){while(--_0x15b6d0){_0x1b7254['push'](_0x1b7254['shift']());}};_0x30f907(++_0x442034);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')]('/',auth[_0xd7df('0xc')](),controller[_0xd7df('0xd')]);router[_0xd7df('0xb')](_0xd7df('0xe'),auth[_0xd7df('0xc')](),controller['describe']);router[_0xd7df('0xb')](_0xd7df('0xf'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x10')]);router['post']('/',auth[_0xd7df('0xc')](),controller['create']);router[_0xd7df('0x11')]('/:id',auth[_0xd7df('0xc')](),controller[_0xd7df('0x12')]);router[_0xd7df('0x13')](_0xd7df('0xf'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x14')]);module[_0xd7df('0x15')]=router;
\ No newline at end of file
index a6504ac..3a452e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x34e8,0x12c));var _0x834e=function(_0x2c68b8,_0xc975de){_0x2c68b8=_0x2c68b8-0x0;var _0x298f36=_0x34e8[_0x2c68b8];return _0x298f36;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x9bde,0xe1));var _0xe9bd=function(_0x13c8aa,_0x2c9bd4){_0x13c8aa=_0x13c8aa-0x0;var _0x150b9f=_0x9bde[_0x13c8aa];return _0x150b9f;};'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 61bcf33..d9fe569 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8888=['Content-Range','json','reject','update','then','destroy','sendStatus','error','name','index','map','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SmsTransferReport','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set'];(function(_0xe6beba,_0x3f15d1){var _0x2f1c08=function(_0x2e7d9f){while(--_0x2e7d9f){_0xe6beba['push'](_0xe6beba['shift']());}};_0x2f1c08(++_0x3f15d1);}(_0x8888,0xbb));var _0x8888=function(_0x3dc594,_0x50fe0f){_0x3dc594=_0x3dc594-0x0;var _0xfd8728=_0x8888[_0x3dc594];return _0xfd8728;};'use strict';var emlformat=require(_0x8888('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8888('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8888('0x2'));var Mustache=require(_0x8888('0x3'));var util=require(_0x8888('0x4'));var path=require(_0x8888('0x5'));var sox=require(_0x8888('0x6'));var csv=require(_0x8888('0x7'));var ejs=require(_0x8888('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8888('0x9'));var jsforce=require(_0x8888('0xa'));var deskjs=require(_0x8888('0xb'));var toCsv=require(_0x8888('0x7'));var querystring=require(_0x8888('0xc'));var Papa=require('papaparse');var Redis=require(_0x8888('0xd'));var authService=require(_0x8888('0xe'));var qs=require(_0x8888('0xf'));var as=require(_0x8888('0x10'));var hardwareService=require(_0x8888('0x11'));var logger=require(_0x8888('0x12'))(_0x8888('0x13'));var utils=require('../../config/utils');var config=require(_0x8888('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8888('0x15'))['db'];function respondWithStatusCode(_0x554d6f,_0x2d01aa){_0x2d01aa=_0x2d01aa||0xcc;return function(_0xaa33c2){if(_0xaa33c2){return _0x554d6f['sendStatus'](_0x2d01aa);}return _0x554d6f[_0x8888('0x16')](_0x2d01aa)[_0x8888('0x17')]();};}function respondWithResult(_0x4c005b,_0x1ed6cf){_0x1ed6cf=_0x1ed6cf||0xc8;return function(_0x14be38){if(_0x14be38){return _0x4c005b[_0x8888('0x16')](_0x1ed6cf)['json'](_0x14be38);}};}function respondWithFilteredResult(_0x69a1f5,_0x1a4f7e){return function(_0x32a248){if(_0x32a248){var _0x46e7ff=typeof _0x1a4f7e[_0x8888('0x18')]==='undefined'&&typeof _0x1a4f7e['limit']===_0x8888('0x19');var _0x1b5b76=_0x32a248[_0x8888('0x1a')];var _0x467b41=_0x46e7ff?0x0:_0x1a4f7e[_0x8888('0x18')];var _0x49ea63=_0x46e7ff?_0x32a248['count']:_0x1a4f7e['offset']+_0x1a4f7e[_0x8888('0x1b')];var _0x28bced;if(_0x49ea63>=_0x1b5b76){_0x49ea63=_0x1b5b76;_0x28bced=0xc8;}else{_0x28bced=0xce;}_0x69a1f5['status'](_0x28bced);return _0x69a1f5[_0x8888('0x1c')](_0x8888('0x1d'),_0x467b41+'-'+_0x49ea63+'/'+_0x1b5b76)[_0x8888('0x1e')](_0x32a248);}return null;};}function patchUpdates(_0x14eea8){return function(_0x5a0b2d){try{jsonpatch['apply'](_0x5a0b2d,_0x14eea8,!![]);}catch(_0x5c1e76){return BPromise[_0x8888('0x1f')](_0x5c1e76);}return _0x5a0b2d['save']();};}function saveUpdates(_0x596dbd,_0x5ade1c){return function(_0x1f4325){if(_0x1f4325){return _0x1f4325[_0x8888('0x20')](_0x596dbd)[_0x8888('0x21')](function(_0x5cc477){return _0x5cc477;});}return null;};}function removeEntity(_0x567b52,_0x109712){return function(_0x7c204d){if(_0x7c204d){return _0x7c204d[_0x8888('0x22')]()[_0x8888('0x21')](function(){_0x567b52[_0x8888('0x16')](0xcc)[_0x8888('0x17')]();});}};}function handleEntityNotFound(_0x4d2bfe,_0x599e66){return function(_0x2dbad6){if(!_0x2dbad6){_0x4d2bfe[_0x8888('0x23')](0x194);}return _0x2dbad6;};}function handleError(_0x3dbf13,_0x553577){_0x553577=_0x553577||0x1f4;return function(_0x1d2528){logger[_0x8888('0x24')](_0x1d2528['stack']);if(_0x1d2528[_0x8888('0x25')]){delete _0x1d2528[_0x8888('0x25')];}_0x3dbf13['status'](_0x553577)['send'](_0x1d2528);};}exports[_0x8888('0x26')]=function(_0x49ae61,_0x249101){var _0x4f1d58={},_0x557c47={},_0x14148e={'count':0x0,'rows':[]};var _0x25d765=_[_0x8888('0x27')](db['SmsTransferReport']['rawAttributes'],function(_0x1b14bc){return{'name':_0x1b14bc[_0x8888('0x28')],'type':_0x1b14bc['type']['key']};});_0x557c47['model']=_[_0x8888('0x27')](_0x25d765,_0x8888('0x25'));_0x557c47[_0x8888('0x29')]=_[_0x8888('0x2a')](_0x49ae61[_0x8888('0x29')]);_0x557c47[_0x8888('0x2b')]=_[_0x8888('0x2c')](_0x557c47[_0x8888('0x2d')],_0x557c47[_0x8888('0x29')]);_0x4f1d58[_0x8888('0x2e')]=_[_0x8888('0x2c')](_0x557c47[_0x8888('0x2d')],qs[_0x8888('0x2f')](_0x49ae61[_0x8888('0x29')][_0x8888('0x2f')]));_0x4f1d58['attributes']=_0x4f1d58[_0x8888('0x2e')][_0x8888('0x30')]?_0x4f1d58[_0x8888('0x2e')]:_0x557c47[_0x8888('0x2d')];if(!_0x49ae61[_0x8888('0x29')][_0x8888('0x31')](_0x8888('0x32'))){_0x4f1d58['limit']=qs[_0x8888('0x1b')](_0x49ae61[_0x8888('0x29')][_0x8888('0x1b')]);_0x4f1d58[_0x8888('0x18')]=qs[_0x8888('0x18')](_0x49ae61[_0x8888('0x29')][_0x8888('0x18')]);}_0x4f1d58[_0x8888('0x33')]=qs['sort'](_0x49ae61[_0x8888('0x29')][_0x8888('0x34')]);_0x4f1d58[_0x8888('0x35')]=qs[_0x8888('0x2b')](_[_0x8888('0x36')](_0x49ae61[_0x8888('0x29')],_0x557c47[_0x8888('0x2b')]),_0x25d765);if(_0x49ae61['query'][_0x8888('0x37')]){_0x4f1d58[_0x8888('0x35')]=_[_0x8888('0x38')](_0x4f1d58[_0x8888('0x35')],{'$or':_['map'](_0x25d765,function(_0xd6eaf7){if(_0xd6eaf7[_0x8888('0x39')]!==_0x8888('0x3a')){var _0x15c93b={};_0x15c93b[_0xd6eaf7['name']]={'$like':'%'+_0x49ae61['query'][_0x8888('0x37')]+'%'};return _0x15c93b;}})});}_0x4f1d58=_[_0x8888('0x38')]({},_0x4f1d58,_0x49ae61['options']);var _0x21df84={'where':_0x4f1d58[_0x8888('0x35')]};return db[_0x8888('0x3b')][_0x8888('0x1a')](_0x21df84)[_0x8888('0x21')](function(_0x4b4e3e){_0x14148e['count']=_0x4b4e3e;if(_0x49ae61['query'][_0x8888('0x3c')]){_0x4f1d58[_0x8888('0x3d')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x8888('0x3e')](_0x4f1d58);})[_0x8888('0x21')](function(_0x551321){_0x14148e[_0x8888('0x3f')]=_0x551321;return _0x14148e;})[_0x8888('0x21')](respondWithFilteredResult(_0x249101,_0x4f1d58))['catch'](handleError(_0x249101,null));};exports[_0x8888('0x40')]=function(_0x4b3915,_0x12f857){var _0x49029d={'raw':!![],'where':{'id':_0x4b3915[_0x8888('0x41')]['id']}},_0x11857e={};_0x11857e['model']=_['keys'](db['SmsTransferReport']['rawAttributes']);_0x11857e[_0x8888('0x29')]=_[_0x8888('0x2a')](_0x4b3915[_0x8888('0x29')]);_0x11857e[_0x8888('0x2b')]=_[_0x8888('0x2c')](_0x11857e[_0x8888('0x2d')],_0x11857e[_0x8888('0x29')]);_0x49029d[_0x8888('0x2e')]=_[_0x8888('0x2c')](_0x11857e[_0x8888('0x2d')],qs[_0x8888('0x2f')](_0x4b3915['query'][_0x8888('0x2f')]));_0x49029d[_0x8888('0x2e')]=_0x49029d[_0x8888('0x2e')][_0x8888('0x30')]?_0x49029d[_0x8888('0x2e')]:_0x11857e[_0x8888('0x2d')];if(_0x4b3915[_0x8888('0x29')][_0x8888('0x3c')]){_0x49029d[_0x8888('0x3d')]=[{'all':!![]}];}_0x49029d=_[_0x8888('0x38')]({},_0x49029d,_0x4b3915[_0x8888('0x42')]);return db['SmsTransferReport'][_0x8888('0x43')](_0x49029d)[_0x8888('0x21')](handleEntityNotFound(_0x12f857,null))[_0x8888('0x21')](respondWithResult(_0x12f857,null))[_0x8888('0x44')](handleError(_0x12f857,null));};exports[_0x8888('0x45')]=function(_0x5c2fea,_0x1a9144){return db[_0x8888('0x3b')]['create'](_0x5c2fea['body'],{})[_0x8888('0x21')](respondWithResult(_0x1a9144,0xc9))[_0x8888('0x44')](handleError(_0x1a9144,null));};exports[_0x8888('0x20')]=function(_0x2818b5,_0x5d57a7){if(_0x2818b5[_0x8888('0x46')]['id']){delete _0x2818b5[_0x8888('0x46')]['id'];}return db[_0x8888('0x3b')]['find']({'where':{'id':_0x2818b5['params']['id']}})[_0x8888('0x21')](handleEntityNotFound(_0x5d57a7,null))['then'](saveUpdates(_0x2818b5['body'],null))[_0x8888('0x21')](respondWithResult(_0x5d57a7,null))[_0x8888('0x44')](handleError(_0x5d57a7,null));};exports[_0x8888('0x22')]=function(_0x238d1b,_0x5a7d19){return db['SmsTransferReport'][_0x8888('0x43')]({'where':{'id':_0x238d1b[_0x8888('0x41')]['id']}})[_0x8888('0x21')](handleEntityNotFound(_0x5a7d19,null))[_0x8888('0x21')](removeEntity(_0x5a7d19,null))[_0x8888('0x44')](handleError(_0x5a7d19,null));};exports[_0x8888('0x47')]=function(_0x512792,_0x36de52){return db[_0x8888('0x3b')]['describe']()[_0x8888('0x21')](respondWithResult(_0x36de52,null))[_0x8888('0x44')](handleError(_0x36de52,null));};
\ No newline at end of file
+var _0x12aa=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','save','then','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','SmsTransferReport','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x36da89,_0xe7d44f){var _0x31bdbd=function(_0x2957a9){while(--_0x2957a9){_0x36da89['push'](_0x36da89['shift']());}};_0x31bdbd(++_0xe7d44f);}(_0x12aa,0xcd));var _0xa12a=function(_0x38b76a,_0x3a9c42){_0x38b76a=_0x38b76a-0x0;var _0x698a18=_0x12aa[_0x38b76a];return _0x698a18;};'use strict';var emlformat=require(_0xa12a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa12a('0x1'));var jsonpatch=require(_0xa12a('0x2'));var rp=require('request-promise');var moment=require(_0xa12a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa12a('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa12a('0x5'));var csv=require(_0xa12a('0x6'));var ejs=require(_0xa12a('0x7'));var fs=require('fs');var fs_extra=require(_0xa12a('0x8'));var _=require(_0xa12a('0x9'));var squel=require(_0xa12a('0xa'));var crypto=require(_0xa12a('0xb'));var jsforce=require(_0xa12a('0xc'));var deskjs=require(_0xa12a('0xd'));var toCsv=require(_0xa12a('0x6'));var querystring=require(_0xa12a('0xe'));var Papa=require(_0xa12a('0xf'));var Redis=require(_0xa12a('0x10'));var authService=require(_0xa12a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa12a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa12a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa12a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa12a('0x15'))['db'];function respondWithStatusCode(_0x270f4e,_0x1a6878){_0x1a6878=_0x1a6878||0xcc;return function(_0x254abb){if(_0x254abb){return _0x270f4e['sendStatus'](_0x1a6878);}return _0x270f4e['status'](_0x1a6878)[_0xa12a('0x16')]();};}function respondWithResult(_0x4439a2,_0x3facf7){_0x3facf7=_0x3facf7||0xc8;return function(_0x6d41f3){if(_0x6d41f3){return _0x4439a2['status'](_0x3facf7)[_0xa12a('0x17')](_0x6d41f3);}};}function respondWithFilteredResult(_0x57e174,_0x546928){return function(_0x5ea6df){if(_0x5ea6df){var _0x499fcd=typeof _0x546928['offset']==='undefined'&&typeof _0x546928[_0xa12a('0x18')]===_0xa12a('0x19');var _0x1bd8b5=_0x5ea6df[_0xa12a('0x1a')];var _0x5e0d01=_0x499fcd?0x0:_0x546928[_0xa12a('0x1b')];var _0x36d4ec=_0x499fcd?_0x5ea6df['count']:_0x546928[_0xa12a('0x1b')]+_0x546928[_0xa12a('0x18')];var _0x329709;if(_0x36d4ec>=_0x1bd8b5){_0x36d4ec=_0x1bd8b5;_0x329709=0xc8;}else{_0x329709=0xce;}_0x57e174[_0xa12a('0x1c')](_0x329709);return _0x57e174[_0xa12a('0x1d')](_0xa12a('0x1e'),_0x5e0d01+'-'+_0x36d4ec+'/'+_0x1bd8b5)['json'](_0x5ea6df);}return null;};}function patchUpdates(_0x1e9d6b){return function(_0x3d8297){try{jsonpatch[_0xa12a('0x1f')](_0x3d8297,_0x1e9d6b,!![]);}catch(_0x49d3dc){return BPromise['reject'](_0x49d3dc);}return _0x3d8297[_0xa12a('0x20')]();};}function saveUpdates(_0x34051d,_0x538d48){return function(_0x4cd09f){if(_0x4cd09f){return _0x4cd09f['update'](_0x34051d)[_0xa12a('0x21')](function(_0x21b36c){return _0x21b36c;});}return null;};}function removeEntity(_0x3b8fba,_0x1373d6){return function(_0x43eb32){if(_0x43eb32){return _0x43eb32['destroy']()[_0xa12a('0x21')](function(){_0x3b8fba[_0xa12a('0x1c')](0xcc)[_0xa12a('0x16')]();});}};}function handleEntityNotFound(_0x4879c2,_0xf79c25){return function(_0x45d343){if(!_0x45d343){_0x4879c2[_0xa12a('0x22')](0x194);}return _0x45d343;};}function handleError(_0x440619,_0x5818ad){_0x5818ad=_0x5818ad||0x1f4;return function(_0x473f9f){logger[_0xa12a('0x23')](_0x473f9f['stack']);if(_0x473f9f['name']){delete _0x473f9f[_0xa12a('0x24')];}_0x440619[_0xa12a('0x1c')](_0x5818ad)['send'](_0x473f9f);};}exports[_0xa12a('0x25')]=function(_0x41ac3a,_0xb3fba3){var _0x292384={},_0x138fe7={},_0x4b3283={'count':0x0,'rows':[]};var _0x2e2c47=_[_0xa12a('0x26')](db['SmsTransferReport'][_0xa12a('0x27')],function(_0x4f93e4){return{'name':_0x4f93e4[_0xa12a('0x28')],'type':_0x4f93e4[_0xa12a('0x29')][_0xa12a('0x2a')]};});_0x138fe7[_0xa12a('0x2b')]=_[_0xa12a('0x26')](_0x2e2c47,_0xa12a('0x24'));_0x138fe7[_0xa12a('0x2c')]=_[_0xa12a('0x2d')](_0x41ac3a[_0xa12a('0x2c')]);_0x138fe7[_0xa12a('0x2e')]=_[_0xa12a('0x2f')](_0x138fe7[_0xa12a('0x2b')],_0x138fe7[_0xa12a('0x2c')]);_0x292384[_0xa12a('0x30')]=_[_0xa12a('0x2f')](_0x138fe7[_0xa12a('0x2b')],qs[_0xa12a('0x31')](_0x41ac3a[_0xa12a('0x2c')][_0xa12a('0x31')]));_0x292384[_0xa12a('0x30')]=_0x292384[_0xa12a('0x30')][_0xa12a('0x32')]?_0x292384[_0xa12a('0x30')]:_0x138fe7[_0xa12a('0x2b')];if(!_0x41ac3a[_0xa12a('0x2c')]['hasOwnProperty'](_0xa12a('0x33'))){_0x292384[_0xa12a('0x18')]=qs[_0xa12a('0x18')](_0x41ac3a['query'][_0xa12a('0x18')]);_0x292384[_0xa12a('0x1b')]=qs[_0xa12a('0x1b')](_0x41ac3a[_0xa12a('0x2c')][_0xa12a('0x1b')]);}_0x292384[_0xa12a('0x34')]=qs[_0xa12a('0x35')](_0x41ac3a[_0xa12a('0x2c')][_0xa12a('0x35')]);_0x292384[_0xa12a('0x36')]=qs[_0xa12a('0x2e')](_[_0xa12a('0x37')](_0x41ac3a[_0xa12a('0x2c')],_0x138fe7[_0xa12a('0x2e')]),_0x2e2c47);if(_0x41ac3a[_0xa12a('0x2c')]['filter']){_0x292384[_0xa12a('0x36')]=_[_0xa12a('0x38')](_0x292384[_0xa12a('0x36')],{'$or':_[_0xa12a('0x26')](_0x2e2c47,function(_0x134eb5){if(_0x134eb5[_0xa12a('0x29')]!==_0xa12a('0x39')){var _0x57e16b={};_0x57e16b[_0x134eb5['name']]={'$like':'%'+_0x41ac3a['query']['filter']+'%'};return _0x57e16b;}})});}_0x292384=_[_0xa12a('0x38')]({},_0x292384,_0x41ac3a[_0xa12a('0x3a')]);var _0x372b34={'where':_0x292384['where']};return db[_0xa12a('0x3b')][_0xa12a('0x1a')](_0x372b34)['then'](function(_0xfa06b0){_0x4b3283['count']=_0xfa06b0;if(_0x41ac3a[_0xa12a('0x2c')][_0xa12a('0x3c')]){_0x292384[_0xa12a('0x3d')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xa12a('0x3e')](_0x292384);})['then'](function(_0x143497){_0x4b3283[_0xa12a('0x3f')]=_0x143497;return _0x4b3283;})[_0xa12a('0x21')](respondWithFilteredResult(_0xb3fba3,_0x292384))[_0xa12a('0x40')](handleError(_0xb3fba3,null));};exports[_0xa12a('0x41')]=function(_0x10c5d8,_0x5e5710){var _0x475547={'raw':!![],'where':{'id':_0x10c5d8[_0xa12a('0x42')]['id']}},_0x1e8ee2={};_0x1e8ee2['model']=_[_0xa12a('0x2d')](db[_0xa12a('0x3b')][_0xa12a('0x27')]);_0x1e8ee2[_0xa12a('0x2c')]=_[_0xa12a('0x2d')](_0x10c5d8['query']);_0x1e8ee2[_0xa12a('0x2e')]=_['intersection'](_0x1e8ee2[_0xa12a('0x2b')],_0x1e8ee2[_0xa12a('0x2c')]);_0x475547[_0xa12a('0x30')]=_['intersection'](_0x1e8ee2['model'],qs['fields'](_0x10c5d8[_0xa12a('0x2c')]['fields']));_0x475547[_0xa12a('0x30')]=_0x475547[_0xa12a('0x30')]['length']?_0x475547['attributes']:_0x1e8ee2[_0xa12a('0x2b')];if(_0x10c5d8[_0xa12a('0x2c')][_0xa12a('0x3c')]){_0x475547[_0xa12a('0x3d')]=[{'all':!![]}];}_0x475547=_[_0xa12a('0x38')]({},_0x475547,_0x10c5d8[_0xa12a('0x3a')]);return db[_0xa12a('0x3b')]['find'](_0x475547)[_0xa12a('0x21')](handleEntityNotFound(_0x5e5710,null))[_0xa12a('0x21')](respondWithResult(_0x5e5710,null))['catch'](handleError(_0x5e5710,null));};exports[_0xa12a('0x43')]=function(_0x2c0fb9,_0x596ca8){return db[_0xa12a('0x3b')][_0xa12a('0x43')](_0x2c0fb9[_0xa12a('0x44')],{})[_0xa12a('0x21')](respondWithResult(_0x596ca8,0xc9))['catch'](handleError(_0x596ca8,null));};exports[_0xa12a('0x45')]=function(_0x1520e0,_0xb11b4c){if(_0x1520e0[_0xa12a('0x44')]['id']){delete _0x1520e0[_0xa12a('0x44')]['id'];}return db[_0xa12a('0x3b')][_0xa12a('0x46')]({'where':{'id':_0x1520e0['params']['id']}})[_0xa12a('0x21')](handleEntityNotFound(_0xb11b4c,null))[_0xa12a('0x21')](saveUpdates(_0x1520e0[_0xa12a('0x44')],null))[_0xa12a('0x21')](respondWithResult(_0xb11b4c,null))[_0xa12a('0x40')](handleError(_0xb11b4c,null));};exports[_0xa12a('0x47')]=function(_0x53a671,_0x44f9ee){return db[_0xa12a('0x3b')][_0xa12a('0x46')]({'where':{'id':_0x53a671[_0xa12a('0x42')]['id']}})['then'](handleEntityNotFound(_0x44f9ee,null))[_0xa12a('0x21')](removeEntity(_0x44f9ee,null))[_0xa12a('0x40')](handleError(_0x44f9ee,null));};exports[_0xa12a('0x48')]=function(_0x3cecf0,_0x119f89){return db[_0xa12a('0x3b')][_0xa12a('0x48')]()[_0xa12a('0x21')](respondWithResult(_0x119f89,null))[_0xa12a('0x40')](handleError(_0x119f89,null));};
\ No newline at end of file
index 40dccfd..ef18cfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd63=['path','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x491ec2,_0x540c00){var _0x1748db=function(_0x5a6258){while(--_0x5a6258){_0x491ec2['push'](_0x491ec2['shift']());}};_0x1748db(++_0x540c00);}(_0xcd63,0xe4));var _0x3cd6=function(_0x26d8bc,_0x1bad55){_0x26d8bc=_0x26d8bc-0x0;var _0x54e2e0=_0xcd63[_0x26d8bc];return _0x54e2e0;};'use strict';var _=require(_0x3cd6('0x0'));var util=require(_0x3cd6('0x1'));var logger=require(_0x3cd6('0x2'))(_0x3cd6('0x3'));var moment=require(_0x3cd6('0x4'));var BPromise=require('bluebird');var rp=require(_0x3cd6('0x5'));var fs=require('fs');var path=require(_0x3cd6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3cd6('0x7'));module[_0x3cd6('0x8')]=function(_0x17974e,_0x5d0192){return _0x17974e[_0x3cd6('0x9')](_0x3cd6('0xa'),attributes,{'tableName':_0x3cd6('0xb'),'paranoid':![],'indexes':[{'name':_0x3cd6('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3d6=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x802997,_0x5534a2){var _0x35c641=function(_0x22c4f2){while(--_0x22c4f2){_0x802997['push'](_0x802997['shift']());}};_0x35c641(++_0x5534a2);}(_0xc3d6,0x153));var _0x6c3d=function(_0x12190c,_0x98340a){_0x12190c=_0x12190c-0x0;var _0x91ca1=_0xc3d6[_0x12190c];return _0x91ca1;};'use strict';var _=require(_0x6c3d('0x0'));var util=require(_0x6c3d('0x1'));var logger=require(_0x6c3d('0x2'))(_0x6c3d('0x3'));var moment=require(_0x6c3d('0x4'));var BPromise=require(_0x6c3d('0x5'));var rp=require(_0x6c3d('0x6'));var fs=require('fs');var path=require(_0x6c3d('0x7'));var rimraf=require(_0x6c3d('0x8'));var config=require(_0x6c3d('0x9'));var attributes=require('./smsTransferReport.attributes');module[_0x6c3d('0xa')]=function(_0x4b59e5,_0x9c4987){return _0x4b59e5['define'](_0x6c3d('0xb'),attributes,{'tableName':_0x6c3d('0xc'),'paranoid':![],'indexes':[{'name':_0x6c3d('0xd'),'fields':[_0x6c3d('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 67d1222..a2fcd92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc090=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0xc090,0x112));var _0x0c09=function(_0x5577ba,_0x232977){_0x5577ba=_0x5577ba-0x0;var _0x142f45=_0xc090[_0x5577ba];return _0x142f45;};'use strict';var _=require(_0x0c09('0x0'));var util=require(_0x0c09('0x1'));var moment=require(_0x0c09('0x2'));var BPromise=require(_0x0c09('0x3'));var rs=require(_0x0c09('0x4'));var fs=require('fs');var Redis=require(_0x0c09('0x5'));var db=require(_0x0c09('0x6'))['db'];var utils=require(_0x0c09('0x7'));var logger=require(_0x0c09('0x8'))('rpc');var config=require(_0x0c09('0x9'));var jayson=require(_0x0c09('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c2143,_0x4bfe8a,_0x1f1a58){return new BPromise(function(_0x2854d8,_0x34e5f0){return client['request'](_0x4c2143,_0x1f1a58)[_0x0c09('0xb')](function(_0x45ec93){logger['info'](_0x0c09('0xc'),_0x4bfe8a,'request\x20sent');logger[_0x0c09('0xd')](_0x0c09('0xe'),_0x4bfe8a,_0x0c09('0xf'),JSON[_0x0c09('0x10')](_0x45ec93));if(_0x45ec93['error']){if(_0x45ec93['error']['code']===0x1f4){logger[_0x0c09('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4bfe8a,_0x45ec93['error'][_0x0c09('0x12')]);return _0x34e5f0(_0x45ec93['error'][_0x0c09('0x12')]);}logger[_0x0c09('0x11')](_0x0c09('0xc'),_0x4bfe8a,_0x45ec93[_0x0c09('0x11')][_0x0c09('0x12')]);return _0x2854d8(_0x45ec93[_0x0c09('0x11')][_0x0c09('0x12')]);}else{logger[_0x0c09('0x13')](_0x0c09('0xc'),_0x4bfe8a,_0x0c09('0xf'));_0x2854d8(_0x45ec93['result'][_0x0c09('0x12')]);}})[_0x0c09('0x14')](function(_0x173f4c){logger[_0x0c09('0x11')](_0x0c09('0xc'),_0x4bfe8a,_0x173f4c);_0x34e5f0(_0x173f4c);});});}
\ No newline at end of file
+var _0x8255=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','info','SmsTransferReport,\x20%s,\x20%s','catch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8255,0x176));var _0x5825=function(_0x5a03eb,_0x64c29e){_0x5a03eb=_0x5a03eb-0x0;var _0xe1f6ee=_0x8255[_0x5a03eb];return _0xe1f6ee;};'use strict';var _=require(_0x5825('0x0'));var util=require(_0x5825('0x1'));var moment=require(_0x5825('0x2'));var BPromise=require(_0x5825('0x3'));var rs=require(_0x5825('0x4'));var fs=require('fs');var Redis=require(_0x5825('0x5'));var db=require(_0x5825('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5825('0x7'));var jayson=require(_0x5825('0x8'));var client=jayson[_0x5825('0x9')][_0x5825('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x383a49,_0x3415c5,_0x27d87e){return new BPromise(function(_0x577974,_0x4975de){return client[_0x5825('0xb')](_0x383a49,_0x27d87e)[_0x5825('0xc')](function(_0x754d99){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x3415c5,_0x5825('0xd'));logger[_0x5825('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3415c5,_0x5825('0xd'),JSON[_0x5825('0xf')](_0x754d99));if(_0x754d99['error']){if(_0x754d99[_0x5825('0x10')][_0x5825('0x11')]===0x1f4){logger[_0x5825('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x3415c5,_0x754d99['error'][_0x5825('0x12')]);return _0x4975de(_0x754d99[_0x5825('0x10')][_0x5825('0x12')]);}logger[_0x5825('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x3415c5,_0x754d99[_0x5825('0x10')]['message']);return _0x577974(_0x754d99[_0x5825('0x10')][_0x5825('0x12')]);}else{logger[_0x5825('0x13')](_0x5825('0x14'),_0x3415c5,_0x5825('0xd'));_0x577974(_0x754d99['result']['message']);}})[_0x5825('0x15')](function(_0x38cd22){logger[_0x5825('0x10')](_0x5825('0x14'),_0x3415c5,_0x38cd22);_0x4975de(_0x38cd22);});});}
\ No newline at end of file
index 98fca7a..cfab8cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95f8=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','download','join','originalname','replace','format','%s-%s%s','basename','extname','put','delete','exports','multer','path','connect-timeout'];(function(_0x657884,_0x3557f8){var _0x15ac6c=function(_0xa39fff){while(--_0xa39fff){_0x657884['push'](_0x657884['shift']());}};_0x15ac6c(++_0x3557f8);}(_0x95f8,0x135));var _0x895f=function(_0x1ea26a,_0x2959ef){_0x1ea26a=_0x1ea26a-0x0;var _0x1aee96=_0x95f8[_0x1ea26a];return _0x1aee96;};'use strict';var multer=require(_0x895f('0x0'));var util=require('util');var path=require(_0x895f('0x1'));var timeout=require(_0x895f('0x2'));var express=require(_0x895f('0x3'));var router=express[_0x895f('0x4')]();var fs_extra=require(_0x895f('0x5'));var auth=require(_0x895f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x895f('0x7'));var controller=require('./sound.controller');router[_0x895f('0x8')]('/',auth['isAuthenticated'](),controller[_0x895f('0x9')]);router[_0x895f('0x8')](_0x895f('0xa'),auth[_0x895f('0xb')](),controller[_0x895f('0xc')]);router[_0x895f('0x8')]('/:id/download',auth[_0x895f('0xb')](),controller[_0x895f('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51639f,_0x30f339,_0x12c0b3){_0x12c0b3(null,path[_0x895f('0xe')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x3de9de,_0x2684e9,_0x220230){_0x2684e9[_0x895f('0xf')]=_0x2684e9[_0x895f('0xf')][_0x895f('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x220230(null,util[_0x895f('0x11')](_0x895f('0x12'),path[_0x895f('0x13')](_0x2684e9[_0x895f('0xf')],path[_0x895f('0x14')](_0x2684e9[_0x895f('0xf')])),Date['now'](),path[_0x895f('0x14')](_0x2684e9[_0x895f('0xf')])));}})});router['post']('/',upload['single']('file'),controller['create']);router[_0x895f('0x15')](_0x895f('0xa'),auth[_0x895f('0xb')](),controller['update']);router['delete'](_0x895f('0xa'),auth['isAuthenticated'](),controller[_0x895f('0x16')]);module[_0x895f('0x17')]=router;
\ No newline at end of file
+var _0x8dd0=['/:id/download','download','diskStorage','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./sound.controller','get','isAuthenticated','index','/:id'];(function(_0x378bcc,_0x545aa8){var _0x1f77d7=function(_0x3fbc6f){while(--_0x3fbc6f){_0x378bcc['push'](_0x378bcc['shift']());}};_0x1f77d7(++_0x545aa8);}(_0x8dd0,0x1d4));var _0x08dd=function(_0x5a7fe2,_0x21e7cc){_0x5a7fe2=_0x5a7fe2-0x0;var _0x44c5cf=_0x8dd0[_0x5a7fe2];return _0x44c5cf;};'use strict';var multer=require(_0x08dd('0x0'));var util=require(_0x08dd('0x1'));var path=require(_0x08dd('0x2'));var timeout=require(_0x08dd('0x3'));var express=require('express');var router=express[_0x08dd('0x4')]();var fs_extra=require(_0x08dd('0x5'));var auth=require(_0x08dd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x08dd('0x7'));router[_0x08dd('0x8')]('/',auth[_0x08dd('0x9')](),controller[_0x08dd('0xa')]);router[_0x08dd('0x8')](_0x08dd('0xb'),auth[_0x08dd('0x9')](),controller['show']);router[_0x08dd('0x8')](_0x08dd('0xc'),auth['isAuthenticated'](),controller[_0x08dd('0xd')]);var upload=multer({'storage':multer[_0x08dd('0xe')]({'destination':function(_0x46f553,_0x23c4da,_0x52a439){_0x52a439(null,path['join'](config['root'],'server/files/sounds/original/'));},'filename':function(_0x298ae1,_0x5d370f,_0x29d23f){_0x5d370f[_0x08dd('0xf')]=_0x5d370f[_0x08dd('0xf')][_0x08dd('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x29d23f(null,util[_0x08dd('0x11')](_0x08dd('0x12'),path[_0x08dd('0x13')](_0x5d370f['originalname'],path[_0x08dd('0x14')](_0x5d370f['originalname'])),Date[_0x08dd('0x15')](),path['extname'](_0x5d370f['originalname'])));}})});router[_0x08dd('0x16')]('/',upload[_0x08dd('0x17')](_0x08dd('0x18')),controller[_0x08dd('0x19')]);router[_0x08dd('0x1a')](_0x08dd('0xb'),auth[_0x08dd('0x9')](),controller[_0x08dd('0x1b')]);router['delete'](_0x08dd('0xb'),auth[_0x08dd('0x9')](),controller[_0x08dd('0x1c')]);module[_0x08dd('0x1d')]=router;
\ No newline at end of file
index 253f31f..7f74abb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15b5=['BIGINT','INTEGER','sequelize','STRING','name','FLOAT'];(function(_0x2b2e7f,_0x1285fe){var _0x3ba241=function(_0x351d99){while(--_0x351d99){_0x2b2e7f['push'](_0x2b2e7f['shift']());}};_0x3ba241(++_0x1285fe);}(_0x15b5,0x92));var _0x515b=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x15b5[_0xd09668];return _0x68726;};'use strict';var Sequelize=require(_0x515b('0x0'));module['exports']={'name':{'type':Sequelize[_0x515b('0x1')],'unique':_0x515b('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x515b('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x515b('0x1')]},'original_format':{'type':Sequelize[_0x515b('0x1')]},'original_duration':{'type':Sequelize[_0x515b('0x3')]},'original_sampleCount':{'type':Sequelize[_0x515b('0x4')]},'original_channelCount':{'type':Sequelize[_0x515b('0x5')]},'original_bitRate':{'type':Sequelize[_0x515b('0x4')]},'original_sampleRate':{'type':Sequelize[_0x515b('0x5')]},'converted_format':{'type':Sequelize[_0x515b('0x1')]},'converted_duration':{'type':Sequelize[_0x515b('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x515b('0x4')]},'converted_channelCount':{'type':Sequelize[_0x515b('0x5')]},'converted_bitRate':{'type':Sequelize[_0x515b('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x515b('0x5')]}};
\ No newline at end of file
+var _0x86af=['STRING','FLOAT','BIGINT','INTEGER'];(function(_0x37e848,_0x418405){var _0x512fe7=function(_0x1652c3){while(--_0x1652c3){_0x37e848['push'](_0x37e848['shift']());}};_0x512fe7(++_0x418405);}(_0x86af,0xdc));var _0xf86a=function(_0x443468,_0x5c8c24){_0x443468=_0x443468-0x0;var _0xb723f=_0x86af[_0x443468];return _0xb723f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf86a('0x0')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xf86a('0x0')],'defaultValue':''},'description':{'type':Sequelize[_0xf86a('0x0')]},'original_format':{'type':Sequelize[_0xf86a('0x0')]},'original_duration':{'type':Sequelize[_0xf86a('0x1')]},'original_sampleCount':{'type':Sequelize[_0xf86a('0x2')]},'original_channelCount':{'type':Sequelize[_0xf86a('0x3')]},'original_bitRate':{'type':Sequelize[_0xf86a('0x2')]},'original_sampleRate':{'type':Sequelize[_0xf86a('0x3')]},'converted_format':{'type':Sequelize[_0xf86a('0x0')]},'converted_duration':{'type':Sequelize[_0xf86a('0x1')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xf86a('0x3')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xf86a('0x3')]}};
\ No newline at end of file
index 2f24654..1d8af4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a5b=['limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','name','send','index','map','Sound','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','catch','download','find','params','save_name','converted_format','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','basename','file','originalname','extname','filename','substring','wav','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','error','unlinkSync','src','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','converted_duration','duration','converted_channelCount','converted_bitRate','converted_sampleRate','sampleRate','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','start','body','delete','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','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','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4a0b21,_0x1d310d){var _0xbc48b8=function(_0x584461){while(--_0x584461){_0x4a0b21['push'](_0x4a0b21['shift']());}};_0xbc48b8(++_0x1d310d);}(_0x7a5b,0x1d6));var _0xb7a5=function(_0x5c4ed9,_0x2475ea){_0x5c4ed9=_0x5c4ed9-0x0;var _0x3aded2=_0x7a5b[_0x5c4ed9];return _0x3aded2;};'use strict';var emlformat=require(_0xb7a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb7a5('0x1'));var jsonpatch=require(_0xb7a5('0x2'));var rp=require(_0xb7a5('0x3'));var moment=require(_0xb7a5('0x4'));var BPromise=require(_0xb7a5('0x5'));var Mustache=require(_0xb7a5('0x6'));var util=require('util');var path=require(_0xb7a5('0x7'));var sox=require(_0xb7a5('0x8'));var csv=require(_0xb7a5('0x9'));var ejs=require(_0xb7a5('0xa'));var fs=require('fs');var fs_extra=require(_0xb7a5('0xb'));var _=require(_0xb7a5('0xc'));var squel=require(_0xb7a5('0xd'));var crypto=require(_0xb7a5('0xe'));var jsforce=require(_0xb7a5('0xf'));var deskjs=require(_0xb7a5('0x10'));var toCsv=require(_0xb7a5('0x9'));var querystring=require('querystring');var Papa=require(_0xb7a5('0x11'));var Redis=require('ioredis');var authService=require(_0xb7a5('0x12'));var qs=require(_0xb7a5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7a5('0x14'));var logger=require('../../config/logger')(_0xb7a5('0x15'));var utils=require(_0xb7a5('0x16'));var config=require(_0xb7a5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7a5('0x18'))['db'];function respondWithStatusCode(_0x51d0df,_0x3491a3){_0x3491a3=_0x3491a3||0xcc;return function(_0x1cf9e0){if(_0x1cf9e0){return _0x51d0df[_0xb7a5('0x19')](_0x3491a3);}return _0x51d0df[_0xb7a5('0x1a')](_0x3491a3)[_0xb7a5('0x1b')]();};}function respondWithResult(_0x260aa9,_0x457b62){_0x457b62=_0x457b62||0xc8;return function(_0x2751b0){if(_0x2751b0){return _0x260aa9['status'](_0x457b62)[_0xb7a5('0x1c')](_0x2751b0);}};}function respondWithFilteredResult(_0x3a5f4b,_0x4af215){return function(_0x243e44){if(_0x243e44){var _0x2f6848=typeof _0x4af215[_0xb7a5('0x1d')]==='undefined'&&typeof _0x4af215[_0xb7a5('0x1e')]===_0xb7a5('0x1f');var _0x4eb70c=_0x243e44[_0xb7a5('0x20')];var _0x17f940=_0x2f6848?0x0:_0x4af215[_0xb7a5('0x1d')];var _0x3ad548=_0x2f6848?_0x243e44[_0xb7a5('0x20')]:_0x4af215[_0xb7a5('0x1d')]+_0x4af215[_0xb7a5('0x1e')];var _0x25808a;if(_0x3ad548>=_0x4eb70c){_0x3ad548=_0x4eb70c;_0x25808a=0xc8;}else{_0x25808a=0xce;}_0x3a5f4b['status'](_0x25808a);return _0x3a5f4b[_0xb7a5('0x21')]('Content-Range',_0x17f940+'-'+_0x3ad548+'/'+_0x4eb70c)[_0xb7a5('0x1c')](_0x243e44);}return null;};}function patchUpdates(_0x472c21){return function(_0xe13c9c){try{jsonpatch[_0xb7a5('0x22')](_0xe13c9c,_0x472c21,!![]);}catch(_0x5d5c3a){return BPromise[_0xb7a5('0x23')](_0x5d5c3a);}return _0xe13c9c[_0xb7a5('0x24')]();};}function saveUpdates(_0x11c74f,_0x54e5a3){return function(_0xc39c02){if(_0xc39c02){return _0xc39c02[_0xb7a5('0x25')](_0x11c74f)[_0xb7a5('0x26')](function(_0x3d5610){return _0x3d5610;});}return null;};}function removeEntity(_0x55706a,_0x328fd2){return function(_0x52aca0){if(_0x52aca0){return _0x52aca0[_0xb7a5('0x27')]()[_0xb7a5('0x26')](function(){var _0x41b568=_0x52aca0[_0xb7a5('0x28')]({'plain':!![]});var _0x4e0dd9=_0xb7a5('0x29');return db[_0xb7a5('0x2a')][_0xb7a5('0x27')]({'where':{'type':_0x4e0dd9,'resourceId':_0x41b568['id']}})['then'](function(){return _0x52aca0;});})[_0xb7a5('0x26')](function(){_0x55706a[_0xb7a5('0x1a')](0xcc)[_0xb7a5('0x1b')]();});}};}function handleEntityNotFound(_0x4e856f,_0x3e9759){return function(_0x1acbd6){if(!_0x1acbd6){_0x4e856f[_0xb7a5('0x19')](0x194);}return _0x1acbd6;};}function handleError(_0x11bb70,_0x1f8929){_0x1f8929=_0x1f8929||0x1f4;return function(_0xee0d3c){logger['error'](_0xee0d3c['stack']);if(_0xee0d3c[_0xb7a5('0x2b')]){delete _0xee0d3c[_0xb7a5('0x2b')];}_0x11bb70['status'](_0x1f8929)[_0xb7a5('0x2c')](_0xee0d3c);};}exports[_0xb7a5('0x2d')]=function(_0x577217,_0x4c388d){var _0x510e63={},_0x59f110={},_0x3117fc={'count':0x0,'rows':[]};var _0x3124d3=_[_0xb7a5('0x2e')](db[_0xb7a5('0x2f')][_0xb7a5('0x30')],function(_0x1affb2){return{'name':_0x1affb2[_0xb7a5('0x31')],'type':_0x1affb2['type'][_0xb7a5('0x32')]};});_0x59f110['model']=_['map'](_0x3124d3,_0xb7a5('0x2b'));_0x59f110[_0xb7a5('0x33')]=_[_0xb7a5('0x34')](_0x577217[_0xb7a5('0x33')]);_0x59f110['filters']=_[_0xb7a5('0x35')](_0x59f110['model'],_0x59f110[_0xb7a5('0x33')]);_0x510e63[_0xb7a5('0x36')]=_[_0xb7a5('0x35')](_0x59f110[_0xb7a5('0x37')],qs[_0xb7a5('0x38')](_0x577217[_0xb7a5('0x33')][_0xb7a5('0x38')]));_0x510e63[_0xb7a5('0x36')]=_0x510e63[_0xb7a5('0x36')][_0xb7a5('0x39')]?_0x510e63['attributes']:_0x59f110[_0xb7a5('0x37')];if(!_0x577217[_0xb7a5('0x33')][_0xb7a5('0x3a')]('nolimit')){_0x510e63[_0xb7a5('0x1e')]=qs['limit'](_0x577217[_0xb7a5('0x33')][_0xb7a5('0x1e')]);_0x510e63[_0xb7a5('0x1d')]=qs[_0xb7a5('0x1d')](_0x577217[_0xb7a5('0x33')][_0xb7a5('0x1d')]);}_0x510e63[_0xb7a5('0x3b')]=qs[_0xb7a5('0x3c')](_0x577217[_0xb7a5('0x33')][_0xb7a5('0x3c')]);_0x510e63['where']=qs['filters'](_[_0xb7a5('0x3d')](_0x577217[_0xb7a5('0x33')],_0x59f110[_0xb7a5('0x3e')]),_0x3124d3);if(_0x577217[_0xb7a5('0x33')][_0xb7a5('0x3f')]){_0x510e63[_0xb7a5('0x40')]=_[_0xb7a5('0x41')](_0x510e63[_0xb7a5('0x40')],{'$or':_[_0xb7a5('0x2e')](_0x3124d3,function(_0x252fb6){if(_0x252fb6['type']!==_0xb7a5('0x42')){var _0x23e32a={};_0x23e32a[_0x252fb6[_0xb7a5('0x2b')]]={'$like':'%'+_0x577217['query'][_0xb7a5('0x3f')]+'%'};return _0x23e32a;}})});}_0x510e63=_[_0xb7a5('0x41')]({},_0x510e63,_0x577217['options']);var _0x3061ed={'where':_0x510e63[_0xb7a5('0x40')]};return db[_0xb7a5('0x2f')][_0xb7a5('0x20')](_0x3061ed)[_0xb7a5('0x26')](function(_0x35baa1){_0x3117fc[_0xb7a5('0x20')]=_0x35baa1;if(_0x577217[_0xb7a5('0x33')][_0xb7a5('0x43')]){_0x510e63[_0xb7a5('0x44')]=[{'all':!![]}];}return db['Sound'][_0xb7a5('0x45')](_0x510e63);})[_0xb7a5('0x26')](function(_0x50b2f3){_0x3117fc[_0xb7a5('0x46')]=_0x50b2f3;return _0x3117fc;})[_0xb7a5('0x26')](respondWithFilteredResult(_0x4c388d,_0x510e63))['catch'](handleError(_0x4c388d,null));};exports[_0xb7a5('0x47')]=function(_0xc3b520,_0x57013c){var _0x25cf6c={'raw':!![],'where':{'id':_0xc3b520['params']['id']}},_0x3e3ee2={};_0x3e3ee2[_0xb7a5('0x37')]=_['keys'](db[_0xb7a5('0x2f')]['rawAttributes']);_0x3e3ee2['query']=_[_0xb7a5('0x34')](_0xc3b520['query']);_0x3e3ee2[_0xb7a5('0x3e')]=_[_0xb7a5('0x35')](_0x3e3ee2[_0xb7a5('0x37')],_0x3e3ee2[_0xb7a5('0x33')]);_0x25cf6c[_0xb7a5('0x36')]=_['intersection'](_0x3e3ee2[_0xb7a5('0x37')],qs['fields'](_0xc3b520[_0xb7a5('0x33')][_0xb7a5('0x38')]));_0x25cf6c[_0xb7a5('0x36')]=_0x25cf6c[_0xb7a5('0x36')]['length']?_0x25cf6c[_0xb7a5('0x36')]:_0x3e3ee2['model'];if(_0xc3b520['query'][_0xb7a5('0x43')]){_0x25cf6c['include']=[{'all':!![]}];}_0x25cf6c=_['merge']({},_0x25cf6c,_0xc3b520[_0xb7a5('0x48')]);return db[_0xb7a5('0x2f')]['find'](_0x25cf6c)[_0xb7a5('0x26')](handleEntityNotFound(_0x57013c,null))[_0xb7a5('0x26')](respondWithResult(_0x57013c,null))[_0xb7a5('0x49')](handleError(_0x57013c,null));};exports[_0xb7a5('0x4a')]=function(_0x31957a,_0x54fbdc,_0x4e7102){return db['Sound'][_0xb7a5('0x4b')]({'where':{'id':_0x31957a[_0xb7a5('0x4c')]['id']},'attributes':['name',_0xb7a5('0x4d'),_0xb7a5('0x4e')],'raw':!![]})[_0xb7a5('0x26')](handleEntityNotFound(_0x54fbdc,null))[_0xb7a5('0x26')](function(_0xd5e659){if(_0xd5e659){if(!fs['existsSync'](path[_0xb7a5('0x4f')](config[_0xb7a5('0x50')],'server/files/sounds/converted',_0xd5e659[_0xb7a5('0x4d')]+'.'+_0xd5e659[_0xb7a5('0x4e')]))){throw new db[(_0xb7a5('0x51'))][(_0xb7a5('0x52'))](_0xb7a5('0x53'));}return _0x54fbdc[_0xb7a5('0x4a')](path['join'](config['root'],_0xb7a5('0x54'),util[_0xb7a5('0x55')]('%s.%s',_0xd5e659[_0xb7a5('0x4d')],_0xd5e659['converted_format'])),util[_0xb7a5('0x55')]('%s.%s',_0xd5e659[_0xb7a5('0x2b')],_0xd5e659['converted_format']));}return null;})[_0xb7a5('0x49')](handleError(_0x54fbdc,null));};exports['create']=function(_0x3cd30b,_0x5d9cb4,_0x2a410e){var _0x3decb4={'name':path[_0xb7a5('0x56')](_0x3cd30b[_0xb7a5('0x57')][_0xb7a5('0x58')],path[_0xb7a5('0x59')](_0x3cd30b[_0xb7a5('0x57')][_0xb7a5('0x58')])),'save_name':path['basename'](_0x3cd30b['file']['filename'],path['extname'](_0x3cd30b[_0xb7a5('0x57')][_0xb7a5('0x5a')])),'original_format':path[_0xb7a5('0x59')](_0x3cd30b[_0xb7a5('0x57')][_0xb7a5('0x58')])[_0xb7a5('0x5b')](0x1),'converted_format':_0xb7a5('0x5c')};var _0x3414f1=path[_0xb7a5('0x4f')](config['root'],'server/files/sounds/original',_0x3cd30b[_0xb7a5('0x57')][_0xb7a5('0x5a')]);var _0x4424eb=path[_0xb7a5('0x4f')](config[_0xb7a5('0x50')],_0xb7a5('0x54'),util['format'](_0xb7a5('0x5d'),path[_0xb7a5('0x56')](_0x3cd30b[_0xb7a5('0x57')][_0xb7a5('0x5a')],path['extname'](_0x3cd30b[_0xb7a5('0x57')][_0xb7a5('0x5a')])),_0x3decb4['converted_format']));logger[_0xb7a5('0x5e')]('Sound\x20upload\x20filepath:\x20%s',_0x3414f1);logger['info'](_0xb7a5('0x5f'),_0x4424eb);try{fs[_0xb7a5('0x60')](_0x3414f1,parseInt(_0xb7a5('0x61'),0x8));var _0x588ef3=sox['transcode'](_0x3414f1,_0x4424eb,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x588ef3['on'](_0xb7a5('0x62'),function(_0xac8bca){fs[_0xb7a5('0x63')](_0x3414f1);_0x5d9cb4[_0xb7a5('0x1a')](0x1f4)[_0xb7a5('0x2c')](_0xac8bca);});_0x588ef3['on'](_0xb7a5('0x64'),function(_0x11e660){_0x3decb4[_0xb7a5('0x65')]=isNaN(_0x11e660['duration'])?null:_0x11e660['duration']*0x3e8;_0x3decb4[_0xb7a5('0x66')]=isNaN(_0x11e660['sampleCount'])?null:_0x11e660[_0xb7a5('0x67')];_0x3decb4[_0xb7a5('0x68')]=isNaN(_0x11e660[_0xb7a5('0x69')])?null:_0x11e660[_0xb7a5('0x69')];_0x3decb4['original_bitRate']=isNaN(_0x11e660[_0xb7a5('0x6a')])?null:_0x11e660[_0xb7a5('0x6a')];_0x3decb4['original_sampleRate']=isNaN(_0x11e660['sampleRate'])?null:_0x11e660['sampleRate'];});_0x588ef3['on']('dest',function(_0x1487e8){_0x3decb4[_0xb7a5('0x6b')]=isNaN(_0x1487e8[_0xb7a5('0x6c')])?null:_0x1487e8[_0xb7a5('0x6c')]*0x3e8;_0x3decb4['converted_sampleCount']=isNaN(_0x1487e8[_0xb7a5('0x67')])?null:_0x1487e8[_0xb7a5('0x67')];_0x3decb4[_0xb7a5('0x6d')]=isNaN(_0x1487e8[_0xb7a5('0x69')])?null:_0x1487e8[_0xb7a5('0x69')];_0x3decb4[_0xb7a5('0x6e')]=isNaN(_0x1487e8['bitRate'])?null:_0x1487e8[_0xb7a5('0x6a')];_0x3decb4[_0xb7a5('0x6f')]=isNaN(_0x1487e8[_0xb7a5('0x70')])?null:_0x1487e8['sampleRate'];});_0x588ef3['on'](_0xb7a5('0x1b'),function(){fs['chmodSync'](_0x4424eb,parseInt(_0xb7a5('0x61'),0x8));return db[_0xb7a5('0x2f')][_0xb7a5('0x71')](_0x3decb4)[_0xb7a5('0x26')](function(_0x31dbce){var _0x345451={'role':_0x3cd30b['body']['role'],'userProfileId':_0x3cd30b['body']['userProfileId']};if(!_0x345451)throw new Error(_0xb7a5('0x72'));if(_0x345451[_0xb7a5('0x73')]===_0xb7a5('0x74')){var _0x24a5a0=_0x31dbce['get']({'plain':!![]});return db[_0xb7a5('0x75')]['find']({'where':{'name':'Sounds','userProfileId':_0x345451[_0xb7a5('0x76')]},'raw':!![]})[_0xb7a5('0x26')](function(_0x42f71a){if(_0x42f71a&&_0x42f71a[_0xb7a5('0x77')]===0x0){return db[_0xb7a5('0x2a')][_0xb7a5('0x71')]({'name':_0x24a5a0[_0xb7a5('0x2b')],'resourceId':_0x24a5a0['id'],'type':_0x42f71a[_0xb7a5('0x2b')],'sectionId':_0x42f71a['id']},{})[_0xb7a5('0x26')](function(){return _0x31dbce;});}else{return _0x31dbce;}})[_0xb7a5('0x49')](function(_0x1510df){logger[_0xb7a5('0x62')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1510df);throw _0x1510df;});}return _0x31dbce;})[_0xb7a5('0x26')](respondWithResult(_0x5d9cb4,null))[_0xb7a5('0x49')](handleError(_0x5d9cb4,null));});_0x588ef3[_0xb7a5('0x78')]();}catch(_0x52ce52){_0x5d9cb4[_0xb7a5('0x1a')](0x1f4)[_0xb7a5('0x2c')](_0x52ce52);}};exports[_0xb7a5('0x25')]=function(_0x354af1,_0x25173d,_0x52ff59){return db['Sound'][_0xb7a5('0x4b')]({'where':{'id':_0x354af1['params']['id']}})['then'](handleEntityNotFound(_0x25173d,null))[_0xb7a5('0x26')](saveUpdates(_[_0xb7a5('0x3d')](_0x354af1[_0xb7a5('0x79')],[_0xb7a5('0x2b'),'description']),null))['then'](respondWithResult(_0x25173d,null))['catch'](handleError(_0x25173d,null));};exports[_0xb7a5('0x7a')]=function(_0x2a64e3,_0x58e916,_0x3e3ba6){return db['Sound'][_0xb7a5('0x4b')]({'where':{'id':_0x2a64e3[_0xb7a5('0x4c')]['id']}})[_0xb7a5('0x26')](function(_0x373c6f){if(_0x373c6f){return _0x373c6f[_0xb7a5('0x27')]();}})[_0xb7a5('0x26')](function(_0x3ad981){var _0x2d6911=path[_0xb7a5('0x4f')](config['root'],_0xb7a5('0x7b'),util[_0xb7a5('0x55')](_0xb7a5('0x5d'),_0x3ad981['save_name'],_0x3ad981[_0xb7a5('0x7c')]));var _0x176da6=path[_0xb7a5('0x4f')](config['root'],'server/files/sounds/converted',util['format']('%s.%s',_0x3ad981['save_name'],_0x3ad981[_0xb7a5('0x4e')]));fs[_0xb7a5('0x63')](_0x2d6911);fs[_0xb7a5('0x63')](_0x176da6);return _0x3ad981;})['then'](function(_0x5ecbe0){if(_0x5ecbe0){return _0x58e916[_0xb7a5('0x1a')](0xcc)[_0xb7a5('0x1b')]();}})[_0xb7a5('0x26')](handleEntityNotFound(_0x58e916,null))[_0xb7a5('0x49')](handleError(_0x58e916,null));};
\ No newline at end of file
+var _0x75f1=['findAll','show','params','keys','includeAll','include','find','catch','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','download','format','%s.%s','file','originalname','extname','basename','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','error','name','send','map','Sound','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options'];(function(_0x92776f,_0x7f7b9e){var _0x4f4a98=function(_0x3f8020){while(--_0x3f8020){_0x92776f['push'](_0x92776f['shift']());}};_0x4f4a98(++_0x7f7b9e);}(_0x75f1,0xc3));var _0x175f=function(_0x57b236,_0x30614e){_0x57b236=_0x57b236-0x0;var _0x4feb29=_0x75f1[_0x57b236];return _0x4feb29;};'use strict';var emlformat=require(_0x175f('0x0'));var rimraf=require(_0x175f('0x1'));var zipdir=require(_0x175f('0x2'));var jsonpatch=require(_0x175f('0x3'));var rp=require(_0x175f('0x4'));var moment=require(_0x175f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x175f('0x6'));var util=require(_0x175f('0x7'));var path=require(_0x175f('0x8'));var sox=require(_0x175f('0x9'));var csv=require(_0x175f('0xa'));var ejs=require(_0x175f('0xb'));var fs=require('fs');var fs_extra=require(_0x175f('0xc'));var _=require('lodash');var squel=require(_0x175f('0xd'));var crypto=require(_0x175f('0xe'));var jsforce=require(_0x175f('0xf'));var deskjs=require(_0x175f('0x10'));var toCsv=require(_0x175f('0xa'));var querystring=require(_0x175f('0x11'));var Papa=require(_0x175f('0x12'));var Redis=require('ioredis');var authService=require(_0x175f('0x13'));var qs=require(_0x175f('0x14'));var as=require(_0x175f('0x15'));var hardwareService=require(_0x175f('0x16'));var logger=require(_0x175f('0x17'))(_0x175f('0x18'));var utils=require(_0x175f('0x19'));var config=require(_0x175f('0x1a'));var licenseUtil=require(_0x175f('0x1b'));var db=require(_0x175f('0x1c'))['db'];function respondWithStatusCode(_0x5f26ee,_0x34e9d0){_0x34e9d0=_0x34e9d0||0xcc;return function(_0x4c74c9){if(_0x4c74c9){return _0x5f26ee[_0x175f('0x1d')](_0x34e9d0);}return _0x5f26ee[_0x175f('0x1e')](_0x34e9d0)[_0x175f('0x1f')]();};}function respondWithResult(_0x29db7c,_0x5ef2f1){_0x5ef2f1=_0x5ef2f1||0xc8;return function(_0x3eacd0){if(_0x3eacd0){return _0x29db7c[_0x175f('0x1e')](_0x5ef2f1)[_0x175f('0x20')](_0x3eacd0);}};}function respondWithFilteredResult(_0x4dc959,_0xccabb){return function(_0x2d5149){if(_0x2d5149){var _0x3c2ee2=typeof _0xccabb['offset']===_0x175f('0x21')&&typeof _0xccabb['limit']===_0x175f('0x21');var _0x42c75=_0x2d5149['count'];var _0x27f5cc=_0x3c2ee2?0x0:_0xccabb[_0x175f('0x22')];var _0x5ab0fa=_0x3c2ee2?_0x2d5149[_0x175f('0x23')]:_0xccabb[_0x175f('0x22')]+_0xccabb[_0x175f('0x24')];var _0x28f81d;if(_0x5ab0fa>=_0x42c75){_0x5ab0fa=_0x42c75;_0x28f81d=0xc8;}else{_0x28f81d=0xce;}_0x4dc959['status'](_0x28f81d);return _0x4dc959['set'](_0x175f('0x25'),_0x27f5cc+'-'+_0x5ab0fa+'/'+_0x42c75)[_0x175f('0x20')](_0x2d5149);}return null;};}function patchUpdates(_0x5aa3cf){return function(_0x141362){try{jsonpatch[_0x175f('0x26')](_0x141362,_0x5aa3cf,!![]);}catch(_0x4ffc30){return BPromise[_0x175f('0x27')](_0x4ffc30);}return _0x141362[_0x175f('0x28')]();};}function saveUpdates(_0x1e24a3,_0x2a84cc){return function(_0x1fdf60){if(_0x1fdf60){return _0x1fdf60[_0x175f('0x29')](_0x1e24a3)[_0x175f('0x2a')](function(_0x46baec){return _0x46baec;});}return null;};}function removeEntity(_0x2bfe5c,_0x162e6a){return function(_0xc25286){if(_0xc25286){return _0xc25286[_0x175f('0x2b')]()[_0x175f('0x2a')](function(){var _0x4260c1=_0xc25286[_0x175f('0x2c')]({'plain':!![]});var _0x4e6834=_0x175f('0x2d');return db['UserProfileResource'][_0x175f('0x2b')]({'where':{'type':_0x4e6834,'resourceId':_0x4260c1['id']}})[_0x175f('0x2a')](function(){return _0xc25286;});})['then'](function(){_0x2bfe5c[_0x175f('0x1e')](0xcc)[_0x175f('0x1f')]();});}};}function handleEntityNotFound(_0x4f7fd5,_0x5c1cf4){return function(_0x532d53){if(!_0x532d53){_0x4f7fd5['sendStatus'](0x194);}return _0x532d53;};}function handleError(_0x55f127,_0x1e17ad){_0x1e17ad=_0x1e17ad||0x1f4;return function(_0x289e7f){logger[_0x175f('0x2e')](_0x289e7f['stack']);if(_0x289e7f[_0x175f('0x2f')]){delete _0x289e7f[_0x175f('0x2f')];}_0x55f127[_0x175f('0x1e')](_0x1e17ad)[_0x175f('0x30')](_0x289e7f);};}exports['index']=function(_0x3f5a9a,_0x4567c5){var _0x5289d8={},_0x1f7a10={},_0x335cdc={'count':0x0,'rows':[]};var _0x1557a4=_[_0x175f('0x31')](db[_0x175f('0x32')][_0x175f('0x33')],function(_0x51bb1e){return{'name':_0x51bb1e[_0x175f('0x34')],'type':_0x51bb1e[_0x175f('0x35')][_0x175f('0x36')]};});_0x1f7a10[_0x175f('0x37')]=_[_0x175f('0x31')](_0x1557a4,_0x175f('0x2f'));_0x1f7a10[_0x175f('0x38')]=_['keys'](_0x3f5a9a[_0x175f('0x38')]);_0x1f7a10['filters']=_[_0x175f('0x39')](_0x1f7a10[_0x175f('0x37')],_0x1f7a10['query']);_0x5289d8[_0x175f('0x3a')]=_[_0x175f('0x39')](_0x1f7a10[_0x175f('0x37')],qs[_0x175f('0x3b')](_0x3f5a9a[_0x175f('0x38')][_0x175f('0x3b')]));_0x5289d8[_0x175f('0x3a')]=_0x5289d8[_0x175f('0x3a')][_0x175f('0x3c')]?_0x5289d8['attributes']:_0x1f7a10[_0x175f('0x37')];if(!_0x3f5a9a['query'][_0x175f('0x3d')](_0x175f('0x3e'))){_0x5289d8[_0x175f('0x24')]=qs[_0x175f('0x24')](_0x3f5a9a['query'][_0x175f('0x24')]);_0x5289d8[_0x175f('0x22')]=qs[_0x175f('0x22')](_0x3f5a9a[_0x175f('0x38')][_0x175f('0x22')]);}_0x5289d8[_0x175f('0x3f')]=qs[_0x175f('0x40')](_0x3f5a9a[_0x175f('0x38')]['sort']);_0x5289d8[_0x175f('0x41')]=qs['filters'](_['pick'](_0x3f5a9a[_0x175f('0x38')],_0x1f7a10[_0x175f('0x42')]),_0x1557a4);if(_0x3f5a9a[_0x175f('0x38')][_0x175f('0x43')]){_0x5289d8[_0x175f('0x41')]=_[_0x175f('0x44')](_0x5289d8[_0x175f('0x41')],{'$or':_[_0x175f('0x31')](_0x1557a4,function(_0xefe12){if(_0xefe12[_0x175f('0x35')]!==_0x175f('0x45')){var _0x402194={};_0x402194[_0xefe12[_0x175f('0x2f')]]={'$like':'%'+_0x3f5a9a[_0x175f('0x38')][_0x175f('0x43')]+'%'};return _0x402194;}})});}_0x5289d8=_[_0x175f('0x44')]({},_0x5289d8,_0x3f5a9a[_0x175f('0x46')]);var _0x30b912={'where':_0x5289d8[_0x175f('0x41')]};return db['Sound'][_0x175f('0x23')](_0x30b912)[_0x175f('0x2a')](function(_0xa16ee1){_0x335cdc[_0x175f('0x23')]=_0xa16ee1;if(_0x3f5a9a[_0x175f('0x38')]['includeAll']){_0x5289d8['include']=[{'all':!![]}];}return db[_0x175f('0x32')][_0x175f('0x47')](_0x5289d8);})[_0x175f('0x2a')](function(_0x1f69ef){_0x335cdc['rows']=_0x1f69ef;return _0x335cdc;})[_0x175f('0x2a')](respondWithFilteredResult(_0x4567c5,_0x5289d8))['catch'](handleError(_0x4567c5,null));};exports[_0x175f('0x48')]=function(_0x56569e,_0xf06a){var _0x7ebd18={'raw':!![],'where':{'id':_0x56569e[_0x175f('0x49')]['id']}},_0x4d381e={};_0x4d381e[_0x175f('0x37')]=_[_0x175f('0x4a')](db[_0x175f('0x32')]['rawAttributes']);_0x4d381e[_0x175f('0x38')]=_['keys'](_0x56569e[_0x175f('0x38')]);_0x4d381e[_0x175f('0x42')]=_['intersection'](_0x4d381e['model'],_0x4d381e[_0x175f('0x38')]);_0x7ebd18[_0x175f('0x3a')]=_[_0x175f('0x39')](_0x4d381e[_0x175f('0x37')],qs['fields'](_0x56569e[_0x175f('0x38')][_0x175f('0x3b')]));_0x7ebd18[_0x175f('0x3a')]=_0x7ebd18[_0x175f('0x3a')][_0x175f('0x3c')]?_0x7ebd18['attributes']:_0x4d381e[_0x175f('0x37')];if(_0x56569e[_0x175f('0x38')][_0x175f('0x4b')]){_0x7ebd18[_0x175f('0x4c')]=[{'all':!![]}];}_0x7ebd18=_[_0x175f('0x44')]({},_0x7ebd18,_0x56569e[_0x175f('0x46')]);return db['Sound'][_0x175f('0x4d')](_0x7ebd18)[_0x175f('0x2a')](handleEntityNotFound(_0xf06a,null))['then'](respondWithResult(_0xf06a,null))[_0x175f('0x4e')](handleError(_0xf06a,null));};exports['download']=function(_0xfcc75a,_0x51397e,_0x26ef15){return db[_0x175f('0x32')][_0x175f('0x4d')]({'where':{'id':_0xfcc75a[_0x175f('0x49')]['id']},'attributes':[_0x175f('0x2f'),_0x175f('0x4f'),_0x175f('0x50')],'raw':!![]})[_0x175f('0x2a')](handleEntityNotFound(_0x51397e,null))[_0x175f('0x2a')](function(_0x8c4066){if(_0x8c4066){if(!fs[_0x175f('0x51')](path[_0x175f('0x52')](config[_0x175f('0x53')],_0x175f('0x54'),_0x8c4066[_0x175f('0x4f')]+'.'+_0x8c4066['converted_format']))){throw new db['Sequelize'][(_0x175f('0x55'))](_0x175f('0x56'));}return _0x51397e[_0x175f('0x57')](path[_0x175f('0x52')](config[_0x175f('0x53')],_0x175f('0x54'),util[_0x175f('0x58')]('%s.%s',_0x8c4066['save_name'],_0x8c4066['converted_format'])),util[_0x175f('0x58')](_0x175f('0x59'),_0x8c4066['name'],_0x8c4066[_0x175f('0x50')]));}return null;})[_0x175f('0x4e')](handleError(_0x51397e,null));};exports['create']=function(_0x561fe6,_0xc40c20,_0x1b3d0e){var _0xe053a={'name':path['basename'](_0x561fe6[_0x175f('0x5a')][_0x175f('0x5b')],path[_0x175f('0x5c')](_0x561fe6[_0x175f('0x5a')][_0x175f('0x5b')])),'save_name':path[_0x175f('0x5d')](_0x561fe6[_0x175f('0x5a')]['filename'],path[_0x175f('0x5c')](_0x561fe6[_0x175f('0x5a')][_0x175f('0x5e')])),'original_format':path[_0x175f('0x5c')](_0x561fe6[_0x175f('0x5a')][_0x175f('0x5b')])[_0x175f('0x5f')](0x1),'converted_format':'wav'};var _0x18bb81=path[_0x175f('0x52')](config[_0x175f('0x53')],_0x175f('0x60'),_0x561fe6[_0x175f('0x5a')][_0x175f('0x5e')]);var _0x50637f=path['join'](config[_0x175f('0x53')],_0x175f('0x54'),util[_0x175f('0x58')]('%s.%s',path[_0x175f('0x5d')](_0x561fe6[_0x175f('0x5a')][_0x175f('0x5e')],path['extname'](_0x561fe6[_0x175f('0x5a')][_0x175f('0x5e')])),_0xe053a[_0x175f('0x50')]));logger[_0x175f('0x61')](_0x175f('0x62'),_0x18bb81);logger[_0x175f('0x61')](_0x175f('0x63'),_0x50637f);try{fs[_0x175f('0x64')](_0x18bb81,parseInt(_0x175f('0x65'),0x8));var _0xbac54a=sox[_0x175f('0x66')](_0x18bb81,_0x50637f,{'sampleRate':0x1f40,'format':_0x175f('0x67'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xbac54a['on'](_0x175f('0x2e'),function(_0x182a9e){fs[_0x175f('0x68')](_0x18bb81);_0xc40c20[_0x175f('0x1e')](0x1f4)['send'](_0x182a9e);});_0xbac54a['on'](_0x175f('0x69'),function(_0x367f7d){_0xe053a[_0x175f('0x6a')]=isNaN(_0x367f7d[_0x175f('0x6b')])?null:_0x367f7d[_0x175f('0x6b')]*0x3e8;_0xe053a['original_sampleCount']=isNaN(_0x367f7d[_0x175f('0x6c')])?null:_0x367f7d[_0x175f('0x6c')];_0xe053a[_0x175f('0x6d')]=isNaN(_0x367f7d['channelCount'])?null:_0x367f7d[_0x175f('0x6e')];_0xe053a[_0x175f('0x6f')]=isNaN(_0x367f7d[_0x175f('0x70')])?null:_0x367f7d[_0x175f('0x70')];_0xe053a[_0x175f('0x71')]=isNaN(_0x367f7d[_0x175f('0x72')])?null:_0x367f7d[_0x175f('0x72')];});_0xbac54a['on'](_0x175f('0x73'),function(_0x14c9fe){_0xe053a[_0x175f('0x74')]=isNaN(_0x14c9fe[_0x175f('0x6b')])?null:_0x14c9fe['duration']*0x3e8;_0xe053a[_0x175f('0x75')]=isNaN(_0x14c9fe[_0x175f('0x6c')])?null:_0x14c9fe[_0x175f('0x6c')];_0xe053a['converted_channelCount']=isNaN(_0x14c9fe[_0x175f('0x6e')])?null:_0x14c9fe[_0x175f('0x6e')];_0xe053a[_0x175f('0x76')]=isNaN(_0x14c9fe[_0x175f('0x70')])?null:_0x14c9fe[_0x175f('0x70')];_0xe053a[_0x175f('0x77')]=isNaN(_0x14c9fe[_0x175f('0x72')])?null:_0x14c9fe[_0x175f('0x72')];});_0xbac54a['on'](_0x175f('0x1f'),function(){fs[_0x175f('0x64')](_0x50637f,parseInt(_0x175f('0x65'),0x8));return db['Sound'][_0x175f('0x78')](_0xe053a)['then'](function(_0x3940bd){var _0xc76832={'role':_0x561fe6[_0x175f('0x79')][_0x175f('0x7a')],'userProfileId':_0x561fe6[_0x175f('0x79')]['userProfileId']};if(!_0xc76832)throw new Error(_0x175f('0x7b'));if(_0xc76832[_0x175f('0x7a')]===_0x175f('0x7c')){var _0x2040b1=_0x3940bd[_0x175f('0x2c')]({'plain':!![]});return db[_0x175f('0x7d')][_0x175f('0x4d')]({'where':{'name':_0x175f('0x2d'),'userProfileId':_0xc76832[_0x175f('0x7e')]},'raw':!![]})[_0x175f('0x2a')](function(_0x27a9c3){if(_0x27a9c3&&_0x27a9c3[_0x175f('0x7f')]===0x0){return db[_0x175f('0x80')][_0x175f('0x78')]({'name':_0x2040b1[_0x175f('0x2f')],'resourceId':_0x2040b1['id'],'type':_0x27a9c3[_0x175f('0x2f')],'sectionId':_0x27a9c3['id']},{})[_0x175f('0x2a')](function(){return _0x3940bd;});}else{return _0x3940bd;}})[_0x175f('0x4e')](function(_0x481185){logger[_0x175f('0x2e')](_0x175f('0x81'),_0x481185);throw _0x481185;});}return _0x3940bd;})['then'](respondWithResult(_0xc40c20,null))[_0x175f('0x4e')](handleError(_0xc40c20,null));});_0xbac54a['start']();}catch(_0x5ba72f){_0xc40c20[_0x175f('0x1e')](0x1f4)[_0x175f('0x30')](_0x5ba72f);}};exports[_0x175f('0x29')]=function(_0x334b04,_0x299e7a,_0x19d74f){return db['Sound'][_0x175f('0x4d')]({'where':{'id':_0x334b04[_0x175f('0x49')]['id']}})[_0x175f('0x2a')](handleEntityNotFound(_0x299e7a,null))['then'](saveUpdates(_[_0x175f('0x82')](_0x334b04[_0x175f('0x79')],[_0x175f('0x2f'),'description']),null))[_0x175f('0x2a')](respondWithResult(_0x299e7a,null))[_0x175f('0x4e')](handleError(_0x299e7a,null));};exports[_0x175f('0x83')]=function(_0x4210d4,_0x1f71ef,_0xbbd87d){return db[_0x175f('0x32')][_0x175f('0x4d')]({'where':{'id':_0x4210d4[_0x175f('0x49')]['id']}})[_0x175f('0x2a')](function(_0x1a2da9){if(_0x1a2da9){return _0x1a2da9[_0x175f('0x2b')]();}})[_0x175f('0x2a')](function(_0x165470){var _0xa7cc2e=path[_0x175f('0x52')](config[_0x175f('0x53')],_0x175f('0x60'),util[_0x175f('0x58')](_0x175f('0x59'),_0x165470[_0x175f('0x4f')],_0x165470[_0x175f('0x84')]));var _0x3f8da4=path['join'](config[_0x175f('0x53')],_0x175f('0x54'),util[_0x175f('0x58')](_0x175f('0x59'),_0x165470['save_name'],_0x165470[_0x175f('0x50')]));fs[_0x175f('0x68')](_0xa7cc2e);fs[_0x175f('0x68')](_0x3f8da4);return _0x165470;})[_0x175f('0x2a')](function(_0x2d6b62){if(_0x2d6b62){return _0x1f71ef[_0x175f('0x1e')](0xcc)[_0x175f('0x1f')]();}})[_0x175f('0x2a')](handleEntityNotFound(_0x1f71ef,null))[_0x175f('0x4e')](handleError(_0x1f71ef,null));};
\ No newline at end of file
index e717391..da88e86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25f2=['tools_sounds','util','../../config/logger','api','moment','bluebird','path','./sound.attributes','define','Sound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25f2,0x12d));var _0x225f=function(_0x17077b,_0x2879a0){_0x17077b=_0x17077b-0x0;var _0x4f11d5=_0x25f2[_0x17077b];return _0x4f11d5;};'use strict';var _=require('lodash');var util=require(_0x225f('0x0'));var logger=require(_0x225f('0x1'))(_0x225f('0x2'));var moment=require(_0x225f('0x3'));var BPromise=require(_0x225f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x225f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x225f('0x6'));module['exports']=function(_0x2318ae,_0x1f29de){return _0x2318ae[_0x225f('0x7')](_0x225f('0x8'),attributes,{'tableName':_0x225f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2763=['exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2763,0x8b));var _0x3276=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2763[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3276('0x0'));var util=require(_0x3276('0x1'));var logger=require(_0x3276('0x2'))(_0x3276('0x3'));var moment=require(_0x3276('0x4'));var BPromise=require(_0x3276('0x5'));var rp=require(_0x3276('0x6'));var fs=require('fs');var path=require(_0x3276('0x7'));var rimraf=require(_0x3276('0x8'));var config=require(_0x3276('0x9'));var attributes=require(_0x3276('0xa'));module[_0x3276('0xb')]=function(_0x380575,_0x17e80a){return _0x380575[_0x3276('0xc')](_0x3276('0xd'),attributes,{'tableName':_0x3276('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dc4fbab..fd20ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6b0=['http','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Sound,\x20%s,\x20%s','result','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x38b9c8,_0x2a491c){var _0x5057fb=function(_0x537479){while(--_0x537479){_0x38b9c8['push'](_0x38b9c8['shift']());}};_0x5057fb(++_0x2a491c);}(_0xc6b0,0x18d));var _0x0c6b=function(_0x1b4f09,_0x608d8e){_0x1b4f09=_0x1b4f09-0x0;var _0x57a182=_0xc6b0[_0x1b4f09];return _0x57a182;};'use strict';var _=require(_0x0c6b('0x0'));var util=require(_0x0c6b('0x1'));var moment=require(_0x0c6b('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c6b('0x3'));var fs=require('fs');var Redis=require(_0x0c6b('0x4'));var db=require(_0x0c6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c6b('0x6'))(_0x0c6b('0x7'));var config=require(_0x0c6b('0x8'));var jayson=require(_0x0c6b('0x9'));var client=jayson[_0x0c6b('0xa')][_0x0c6b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26cd8c,_0x2dd7eb,_0x50d52b){return new BPromise(function(_0x44ba2a,_0x3b716f){return client[_0x0c6b('0xc')](_0x26cd8c,_0x50d52b)[_0x0c6b('0xd')](function(_0x333606){logger[_0x0c6b('0xe')]('Sound,\x20%s,\x20%s',_0x2dd7eb,_0x0c6b('0xf'));logger[_0x0c6b('0x10')](_0x0c6b('0x11'),_0x2dd7eb,_0x0c6b('0xf'),JSON[_0x0c6b('0x12')](_0x333606));if(_0x333606[_0x0c6b('0x13')]){if(_0x333606['error'][_0x0c6b('0x14')]===0x1f4){logger[_0x0c6b('0x13')]('Sound,\x20%s,\x20%s',_0x2dd7eb,_0x333606['error']['message']);return _0x3b716f(_0x333606['error'][_0x0c6b('0x15')]);}logger[_0x0c6b('0x13')](_0x0c6b('0x16'),_0x2dd7eb,_0x333606[_0x0c6b('0x13')]['message']);return _0x44ba2a(_0x333606[_0x0c6b('0x13')][_0x0c6b('0x15')]);}else{logger[_0x0c6b('0xe')](_0x0c6b('0x16'),_0x2dd7eb,_0x0c6b('0xf'));_0x44ba2a(_0x333606[_0x0c6b('0x17')][_0x0c6b('0x15')]);}})['catch'](function(_0x6aeaf2){logger[_0x0c6b('0x13')](_0x0c6b('0x16'),_0x2dd7eb,_0x6aeaf2);_0x3b716f(_0x6aeaf2);});});}exports[_0x0c6b('0x18')]=function(_0x34a872){var _0x435ad0=this;return new Promise(function(_0x4344d5,_0x20c2fa){return db[_0x0c6b('0x19')][_0x0c6b('0x1a')]({'raw':_0x34a872[_0x0c6b('0x1b')]?_0x34a872[_0x0c6b('0x1b')][_0x0c6b('0x1c')]===undefined?!![]:![]:!![],'where':_0x34a872[_0x0c6b('0x1b')]?_0x34a872[_0x0c6b('0x1b')][_0x0c6b('0x1d')]||null:null,'attributes':_0x34a872[_0x0c6b('0x1b')]?_0x34a872['options'][_0x0c6b('0x1e')]||null:null,'include':_0x34a872[_0x0c6b('0x1b')]?_0x34a872[_0x0c6b('0x1b')][_0x0c6b('0x1f')]?_[_0x0c6b('0x20')](_0x34a872[_0x0c6b('0x1b')][_0x0c6b('0x1f')],function(_0x65e221){return{'model':db[_0x65e221['model']],'as':_0x65e221['as'],'attributes':_0x65e221[_0x0c6b('0x1e')],'include':_0x65e221['include']?_[_0x0c6b('0x20')](_0x65e221['include'],function(_0x389338){return{'model':db[_0x389338[_0x0c6b('0x21')]],'as':_0x389338['as'],'attributes':_0x389338[_0x0c6b('0x1e')],'include':_0x389338[_0x0c6b('0x1f')]?_[_0x0c6b('0x20')](_0x389338[_0x0c6b('0x1f')],function(_0x2130b4){return{'model':db[_0x2130b4[_0x0c6b('0x21')]],'as':_0x2130b4['as'],'attributes':_0x2130b4[_0x0c6b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a0dbe){logger[_0x0c6b('0xe')]('ShowSound',_0x34a872);logger['debug']('ShowSound',_0x34a872,JSON['stringify'](_0x2a0dbe));_0x4344d5(_0x2a0dbe);})['catch'](function(_0x4a47f7){logger[_0x0c6b('0x13')](_0x0c6b('0x18'),_0x4a47f7['message'],_0x34a872);_0x20c2fa(_0x435ad0[_0x0c6b('0x13')](0x1f4,_0x4a47f7[_0x0c6b('0x15')]));});});};
\ No newline at end of file
+var _0x1f90=['where','attributes','include','map','model','ShowSound','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','Sound','find','options','raw'];(function(_0x1bdcad,_0x14ffd1){var _0x2cb356=function(_0x44a508){while(--_0x44a508){_0x1bdcad['push'](_0x1bdcad['shift']());}};_0x2cb356(++_0x14ffd1);}(_0x1f90,0x1b9));var _0x01f9=function(_0x2867a6,_0x10d905){_0x2867a6=_0x2867a6-0x0;var _0x4afc2b=_0x1f90[_0x2867a6];return _0x4afc2b;};'use strict';var _=require(_0x01f9('0x0'));var util=require(_0x01f9('0x1'));var moment=require('moment');var BPromise=require(_0x01f9('0x2'));var rs=require(_0x01f9('0x3'));var fs=require('fs');var Redis=require(_0x01f9('0x4'));var db=require(_0x01f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x01f9('0x6'));var config=require('../../config/environment');var jayson=require(_0x01f9('0x7'));var client=jayson['client'][_0x01f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43c151,_0x2b67bf,_0x11ccfd){return new BPromise(function(_0xfc92ed,_0x3ea6ef){return client[_0x01f9('0x9')](_0x43c151,_0x11ccfd)['then'](function(_0x5e0da3){logger['info'](_0x01f9('0xa'),_0x2b67bf,_0x01f9('0xb'));logger[_0x01f9('0xc')](_0x01f9('0xd'),_0x2b67bf,_0x01f9('0xb'),JSON[_0x01f9('0xe')](_0x5e0da3));if(_0x5e0da3[_0x01f9('0xf')]){if(_0x5e0da3[_0x01f9('0xf')][_0x01f9('0x10')]===0x1f4){logger[_0x01f9('0xf')](_0x01f9('0xa'),_0x2b67bf,_0x5e0da3[_0x01f9('0xf')][_0x01f9('0x11')]);return _0x3ea6ef(_0x5e0da3['error'][_0x01f9('0x11')]);}logger[_0x01f9('0xf')](_0x01f9('0xa'),_0x2b67bf,_0x5e0da3['error'][_0x01f9('0x11')]);return _0xfc92ed(_0x5e0da3[_0x01f9('0xf')]['message']);}else{logger[_0x01f9('0x12')](_0x01f9('0xa'),_0x2b67bf,'request\x20sent');_0xfc92ed(_0x5e0da3[_0x01f9('0x13')][_0x01f9('0x11')]);}})['catch'](function(_0x283730){logger[_0x01f9('0xf')](_0x01f9('0xa'),_0x2b67bf,_0x283730);_0x3ea6ef(_0x283730);});});}exports['ShowSound']=function(_0x5113ab){var _0x4ce774=this;return new Promise(function(_0xb8f662,_0x8493a4){return db[_0x01f9('0x14')][_0x01f9('0x15')]({'raw':_0x5113ab[_0x01f9('0x16')]?_0x5113ab[_0x01f9('0x16')][_0x01f9('0x17')]===undefined?!![]:![]:!![],'where':_0x5113ab['options']?_0x5113ab[_0x01f9('0x16')][_0x01f9('0x18')]||null:null,'attributes':_0x5113ab[_0x01f9('0x16')]?_0x5113ab[_0x01f9('0x16')][_0x01f9('0x19')]||null:null,'include':_0x5113ab[_0x01f9('0x16')]?_0x5113ab[_0x01f9('0x16')][_0x01f9('0x1a')]?_[_0x01f9('0x1b')](_0x5113ab['options'][_0x01f9('0x1a')],function(_0x2d97d7){return{'model':db[_0x2d97d7[_0x01f9('0x1c')]],'as':_0x2d97d7['as'],'attributes':_0x2d97d7[_0x01f9('0x19')],'include':_0x2d97d7[_0x01f9('0x1a')]?_['map'](_0x2d97d7[_0x01f9('0x1a')],function(_0x215915){return{'model':db[_0x215915[_0x01f9('0x1c')]],'as':_0x215915['as'],'attributes':_0x215915['attributes'],'include':_0x215915[_0x01f9('0x1a')]?_['map'](_0x215915['include'],function(_0x188ad5){return{'model':db[_0x188ad5[_0x01f9('0x1c')]],'as':_0x188ad5['as'],'attributes':_0x188ad5[_0x01f9('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbd5239){logger['info'](_0x01f9('0x1d'),_0x5113ab);logger[_0x01f9('0xc')](_0x01f9('0x1d'),_0x5113ab,JSON[_0x01f9('0xe')](_0xbd5239));_0xb8f662(_0xbd5239);})[_0x01f9('0x1e')](function(_0x2405bf){logger['error'](_0x01f9('0x1d'),_0x2405bf[_0x01f9('0x11')],_0x5113ab);_0x8493a4(_0x4ce774[_0x01f9('0xf')](0x1f4,_0x2405bf[_0x01f9('0x11')]));});});};
\ No newline at end of file
index ed2dac0..2768446 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x174c76,_0x4224c9){var _0x228b84=function(_0x3752e5){while(--_0x3752e5){_0x174c76['push'](_0x174c76['shift']());}};_0x228b84(++_0x4224c9);}(_0xda2d,0x102));var _0xdda2=function(_0x52d969,_0x9cfc71){_0x52d969=_0x52d969-0x0;var _0x38b6bf=_0xda2d[_0x52d969];return _0x38b6bf;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4cef84,_0x1717ef){var _0x9620c1=function(_0x549acf){while(--_0x549acf){_0x4cef84['push'](_0x4cef84['shift']());}};_0x9620c1(++_0x1717ef);}(_0xb10b,0x12a));var _0xbb10=function(_0x466b8c,_0x492ed0){_0x466b8c=_0x466b8c-0x0;var _0x3f461d=_0xb10b[_0x466b8c];return _0x3f461d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router;
\ No newline at end of file
index ec6c1ea..0c10f60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4456=['STRING','TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4456,0x1a2));var _0x6445=function(_0x39f01d,_0x31ee5b){_0x39f01d=_0x39f01d-0x0;var _0x5b99f7=_0x4456[_0x39f01d];return _0x5b99f7;};'use strict';var Sequelize=require(_0x6445('0x0'));module[_0x6445('0x1')]={'uniqueid':{'type':Sequelize[_0x6445('0x2')]},'body':{'type':Sequelize[_0x6445('0x3')](_0x6445('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x6445('0x5')]('in',_0x6445('0x6')),'defaultValue':_0x6445('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x6445('0x3')]}};
\ No newline at end of file
+var _0x9492=['out','sequelize','exports','STRING','TEXT','medium','ENUM'];(function(_0x493836,_0x5af577){var _0x57b579=function(_0x254e42){while(--_0x254e42){_0x493836['push'](_0x493836['shift']());}};_0x57b579(++_0x5af577);}(_0x9492,0x1c8));var _0x2949=function(_0x39a1ae,_0x210b6e){_0x39a1ae=_0x39a1ae-0x0;var _0x1c1411=_0x9492[_0x39a1ae];return _0x1c1411;};'use strict';var Sequelize=require(_0x2949('0x0'));module[_0x2949('0x1')]={'uniqueid':{'type':Sequelize[_0x2949('0x2')]},'body':{'type':Sequelize[_0x2949('0x3')](_0x2949('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x2949('0x5')]('in','out'),'defaultValue':_0x2949('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x2949('0x3')]}};
\ No newline at end of file
index b3144fb..141cc3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9de=['limit','Content-Range','apply','save','update','then','error','stack','name','send','index','SquareMessage','fieldName','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','includeAll','include','findAll','rows','catch','params','keys','merge','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc9de,0x140));var _0xec9d=function(_0x4619e4,_0x6a10f8){_0x4619e4=_0x4619e4-0x0;var _0x1a7195=_0xc9de[_0x4619e4];return _0x1a7195;};'use strict';var emlformat=require(_0xec9d('0x0'));var rimraf=require(_0xec9d('0x1'));var zipdir=require(_0xec9d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec9d('0x3'));var moment=require(_0xec9d('0x4'));var BPromise=require(_0xec9d('0x5'));var Mustache=require(_0xec9d('0x6'));var util=require(_0xec9d('0x7'));var path=require(_0xec9d('0x8'));var sox=require(_0xec9d('0x9'));var csv=require(_0xec9d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec9d('0xb'));var _=require(_0xec9d('0xc'));var squel=require(_0xec9d('0xd'));var crypto=require(_0xec9d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xec9d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xec9d('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec9d('0x11'));var as=require(_0xec9d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec9d('0x13'))(_0xec9d('0x14'));var utils=require(_0xec9d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xec9d('0x16'));var db=require(_0xec9d('0x17'))['db'];function respondWithStatusCode(_0x307ffa,_0x50707d){_0x50707d=_0x50707d||0xcc;return function(_0x326385){if(_0x326385){return _0x307ffa['sendStatus'](_0x50707d);}return _0x307ffa[_0xec9d('0x18')](_0x50707d)[_0xec9d('0x19')]();};}function respondWithResult(_0x58c370,_0x3e0a16){_0x3e0a16=_0x3e0a16||0xc8;return function(_0x36017e){if(_0x36017e){return _0x58c370[_0xec9d('0x18')](_0x3e0a16)[_0xec9d('0x1a')](_0x36017e);}};}function respondWithFilteredResult(_0x398ab7,_0x715c25){return function(_0x53e74e){if(_0x53e74e){var _0x26cd98=typeof _0x715c25[_0xec9d('0x1b')]===_0xec9d('0x1c')&&typeof _0x715c25['limit']===_0xec9d('0x1c');var _0x5ecec8=_0x53e74e[_0xec9d('0x1d')];var _0xc5b105=_0x26cd98?0x0:_0x715c25[_0xec9d('0x1b')];var _0x572d3f=_0x26cd98?_0x53e74e['count']:_0x715c25[_0xec9d('0x1b')]+_0x715c25[_0xec9d('0x1e')];var _0x40e0a8;if(_0x572d3f>=_0x5ecec8){_0x572d3f=_0x5ecec8;_0x40e0a8=0xc8;}else{_0x40e0a8=0xce;}_0x398ab7[_0xec9d('0x18')](_0x40e0a8);return _0x398ab7['set'](_0xec9d('0x1f'),_0xc5b105+'-'+_0x572d3f+'/'+_0x5ecec8)['json'](_0x53e74e);}return null;};}function patchUpdates(_0x463cbc){return function(_0x12680f){try{jsonpatch[_0xec9d('0x20')](_0x12680f,_0x463cbc,!![]);}catch(_0x1125fa){return BPromise['reject'](_0x1125fa);}return _0x12680f[_0xec9d('0x21')]();};}function saveUpdates(_0x126e4e,_0x51ee86){return function(_0x2cb7ba){if(_0x2cb7ba){return _0x2cb7ba[_0xec9d('0x22')](_0x126e4e)['then'](function(_0x24d3f2){return _0x24d3f2;});}return null;};}function removeEntity(_0x18f8b4,_0x3435cf){return function(_0x3f54d6){if(_0x3f54d6){return _0x3f54d6['destroy']()[_0xec9d('0x23')](function(){_0x18f8b4[_0xec9d('0x18')](0xcc)[_0xec9d('0x19')]();});}};}function handleEntityNotFound(_0x568887,_0xc23bc4){return function(_0x57907d){if(!_0x57907d){_0x568887['sendStatus'](0x194);}return _0x57907d;};}function handleError(_0x183ffb,_0xe0e3b2){_0xe0e3b2=_0xe0e3b2||0x1f4;return function(_0x9aa176){logger[_0xec9d('0x24')](_0x9aa176[_0xec9d('0x25')]);if(_0x9aa176['name']){delete _0x9aa176[_0xec9d('0x26')];}_0x183ffb['status'](_0xe0e3b2)[_0xec9d('0x27')](_0x9aa176);};}exports[_0xec9d('0x28')]=function(_0x145a7a,_0x3bfc0c){var _0x62d4ea={},_0x5a311a={},_0x383d6e={'count':0x0,'rows':[]};var _0x322576=_['map'](db[_0xec9d('0x29')]['rawAttributes'],function(_0x777595){return{'name':_0x777595[_0xec9d('0x2a')],'type':_0x777595['type']['key']};});_0x5a311a['model']=_[_0xec9d('0x2b')](_0x322576,_0xec9d('0x26'));_0x5a311a[_0xec9d('0x2c')]=_['keys'](_0x145a7a[_0xec9d('0x2c')]);_0x5a311a[_0xec9d('0x2d')]=_[_0xec9d('0x2e')](_0x5a311a[_0xec9d('0x2f')],_0x5a311a[_0xec9d('0x2c')]);_0x62d4ea[_0xec9d('0x30')]=_[_0xec9d('0x2e')](_0x5a311a[_0xec9d('0x2f')],qs[_0xec9d('0x31')](_0x145a7a[_0xec9d('0x2c')]['fields']));_0x62d4ea[_0xec9d('0x30')]=_0x62d4ea[_0xec9d('0x30')][_0xec9d('0x32')]?_0x62d4ea[_0xec9d('0x30')]:_0x5a311a[_0xec9d('0x2f')];if(!_0x145a7a[_0xec9d('0x2c')][_0xec9d('0x33')]('nolimit')){_0x62d4ea['limit']=qs[_0xec9d('0x1e')](_0x145a7a[_0xec9d('0x2c')][_0xec9d('0x1e')]);_0x62d4ea['offset']=qs[_0xec9d('0x1b')](_0x145a7a[_0xec9d('0x2c')]['offset']);}_0x62d4ea[_0xec9d('0x34')]=qs['sort'](_0x145a7a[_0xec9d('0x2c')][_0xec9d('0x35')]);_0x62d4ea[_0xec9d('0x36')]=qs[_0xec9d('0x2d')](_[_0xec9d('0x37')](_0x145a7a[_0xec9d('0x2c')],_0x5a311a[_0xec9d('0x2d')]),_0x322576);if(_0x145a7a[_0xec9d('0x2c')][_0xec9d('0x38')]){_0x62d4ea[_0xec9d('0x36')]=_['merge'](_0x62d4ea[_0xec9d('0x36')],{'$or':_['map'](_0x322576,function(_0x126c8c){if(_0x126c8c[_0xec9d('0x39')]!=='VIRTUAL'){var _0x2581d1={};_0x2581d1[_0x126c8c[_0xec9d('0x26')]]={'$like':'%'+_0x145a7a['query']['filter']+'%'};return _0x2581d1;}})});}_0x62d4ea=_['merge']({},_0x62d4ea,_0x145a7a['options']);var _0x8c6d9a={'where':_0x62d4ea[_0xec9d('0x36')]};return db[_0xec9d('0x29')][_0xec9d('0x1d')](_0x8c6d9a)['then'](function(_0x47d51b){_0x383d6e[_0xec9d('0x1d')]=_0x47d51b;if(_0x145a7a[_0xec9d('0x2c')][_0xec9d('0x3a')]){_0x62d4ea[_0xec9d('0x3b')]=[{'all':!![]}];}return db[_0xec9d('0x29')][_0xec9d('0x3c')](_0x62d4ea);})['then'](function(_0x46b98b){_0x383d6e[_0xec9d('0x3d')]=_0x46b98b;return _0x383d6e;})[_0xec9d('0x23')](respondWithFilteredResult(_0x3bfc0c,_0x62d4ea))[_0xec9d('0x3e')](handleError(_0x3bfc0c,null));};exports['show']=function(_0x367dd2,_0x71bab6){var _0x20eefb={'raw':!![],'where':{'id':_0x367dd2[_0xec9d('0x3f')]['id']}},_0x476a71={};_0x476a71[_0xec9d('0x2f')]=_[_0xec9d('0x40')](db[_0xec9d('0x29')]['rawAttributes']);_0x476a71[_0xec9d('0x2c')]=_[_0xec9d('0x40')](_0x367dd2[_0xec9d('0x2c')]);_0x476a71[_0xec9d('0x2d')]=_[_0xec9d('0x2e')](_0x476a71[_0xec9d('0x2f')],_0x476a71[_0xec9d('0x2c')]);_0x20eefb[_0xec9d('0x30')]=_[_0xec9d('0x2e')](_0x476a71['model'],qs[_0xec9d('0x31')](_0x367dd2[_0xec9d('0x2c')][_0xec9d('0x31')]));_0x20eefb[_0xec9d('0x30')]=_0x20eefb[_0xec9d('0x30')][_0xec9d('0x32')]?_0x20eefb[_0xec9d('0x30')]:_0x476a71[_0xec9d('0x2f')];if(_0x367dd2[_0xec9d('0x2c')][_0xec9d('0x3a')]){_0x20eefb[_0xec9d('0x3b')]=[{'all':!![]}];}_0x20eefb=_[_0xec9d('0x41')]({},_0x20eefb,_0x367dd2['options']);return db[_0xec9d('0x29')][_0xec9d('0x42')](_0x20eefb)[_0xec9d('0x23')](handleEntityNotFound(_0x71bab6,null))[_0xec9d('0x23')](respondWithResult(_0x71bab6,null))['catch'](handleError(_0x71bab6,null));};exports['create']=function(_0x467d5f,_0x1b693c){return db['SquareMessage'][_0xec9d('0x43')](_0x467d5f[_0xec9d('0x44')],{})[_0xec9d('0x23')](respondWithResult(_0x1b693c,0xc9))[_0xec9d('0x3e')](handleError(_0x1b693c,null));};exports[_0xec9d('0x22')]=function(_0x4b180d,_0x1cb6c8){if(_0x4b180d[_0xec9d('0x44')]['id']){delete _0x4b180d[_0xec9d('0x44')]['id'];}return db[_0xec9d('0x29')][_0xec9d('0x42')]({'where':{'id':_0x4b180d[_0xec9d('0x3f')]['id']}})[_0xec9d('0x23')](handleEntityNotFound(_0x1cb6c8,null))['then'](saveUpdates(_0x4b180d[_0xec9d('0x44')],null))[_0xec9d('0x23')](respondWithResult(_0x1cb6c8,null))['catch'](handleError(_0x1cb6c8,null));};exports[_0xec9d('0x45')]=function(_0x501ea6,_0x404acc){return db[_0xec9d('0x29')][_0xec9d('0x42')]({'where':{'id':_0x501ea6[_0xec9d('0x3f')]['id']}})[_0xec9d('0x23')](handleEntityNotFound(_0x404acc,null))['then'](removeEntity(_0x404acc,null))[_0xec9d('0x3e')](handleError(_0x404acc,null));};
\ No newline at end of file
+var _0xc025=['findAll','rows','catch','params','find','body','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','SquareMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x2690f8,_0x4f9557){var _0x33f32c=function(_0x4a6e86){while(--_0x4a6e86){_0x2690f8['push'](_0x2690f8['shift']());}};_0x33f32c(++_0x4f9557);}(_0xc025,0x169));var _0x5c02=function(_0x42146d,_0x5daba1){_0x42146d=_0x42146d-0x0;var _0x354548=_0xc025[_0x42146d];return _0x354548;};'use strict';var emlformat=require(_0x5c02('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c02('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c02('0x2'));var moment=require(_0x5c02('0x3'));var BPromise=require(_0x5c02('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5c02('0x5'));var sox=require(_0x5c02('0x6'));var csv=require('to-csv');var ejs=require(_0x5c02('0x7'));var fs=require('fs');var fs_extra=require(_0x5c02('0x8'));var _=require(_0x5c02('0x9'));var squel=require(_0x5c02('0xa'));var crypto=require(_0x5c02('0xb'));var jsforce=require(_0x5c02('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5c02('0xd'));var querystring=require(_0x5c02('0xe'));var Papa=require('papaparse');var Redis=require(_0x5c02('0xf'));var authService=require(_0x5c02('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5c02('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5c02('0x12'));var db=require(_0x5c02('0x13'))['db'];function respondWithStatusCode(_0x531bc8,_0x490536){_0x490536=_0x490536||0xcc;return function(_0xa426cf){if(_0xa426cf){return _0x531bc8[_0x5c02('0x14')](_0x490536);}return _0x531bc8[_0x5c02('0x15')](_0x490536)[_0x5c02('0x16')]();};}function respondWithResult(_0x18610d,_0x1c30b3){_0x1c30b3=_0x1c30b3||0xc8;return function(_0x47c4f3){if(_0x47c4f3){return _0x18610d[_0x5c02('0x15')](_0x1c30b3)[_0x5c02('0x17')](_0x47c4f3);}};}function respondWithFilteredResult(_0x168f95,_0x2f948b){return function(_0x17888d){if(_0x17888d){var _0x1c6bfc=typeof _0x2f948b[_0x5c02('0x18')]===_0x5c02('0x19')&&typeof _0x2f948b[_0x5c02('0x1a')]==='undefined';var _0xf9532d=_0x17888d[_0x5c02('0x1b')];var _0x5b8444=_0x1c6bfc?0x0:_0x2f948b[_0x5c02('0x18')];var _0x4b7cb6=_0x1c6bfc?_0x17888d[_0x5c02('0x1b')]:_0x2f948b[_0x5c02('0x18')]+_0x2f948b[_0x5c02('0x1a')];var _0x2844ad;if(_0x4b7cb6>=_0xf9532d){_0x4b7cb6=_0xf9532d;_0x2844ad=0xc8;}else{_0x2844ad=0xce;}_0x168f95['status'](_0x2844ad);return _0x168f95[_0x5c02('0x1c')](_0x5c02('0x1d'),_0x5b8444+'-'+_0x4b7cb6+'/'+_0xf9532d)[_0x5c02('0x17')](_0x17888d);}return null;};}function patchUpdates(_0x2f96fd){return function(_0x43fe98){try{jsonpatch[_0x5c02('0x1e')](_0x43fe98,_0x2f96fd,!![]);}catch(_0x3e94a0){return BPromise[_0x5c02('0x1f')](_0x3e94a0);}return _0x43fe98[_0x5c02('0x20')]();};}function saveUpdates(_0x5801dc,_0x1ee5a2){return function(_0x3dca35){if(_0x3dca35){return _0x3dca35[_0x5c02('0x21')](_0x5801dc)[_0x5c02('0x22')](function(_0x5a8861){return _0x5a8861;});}return null;};}function removeEntity(_0x59ba1b,_0x4b09f6){return function(_0x4ba5e9){if(_0x4ba5e9){return _0x4ba5e9[_0x5c02('0x23')]()[_0x5c02('0x22')](function(){_0x59ba1b['status'](0xcc)[_0x5c02('0x16')]();});}};}function handleEntityNotFound(_0x24b8b6,_0x3f7dc8){return function(_0xbbaeea){if(!_0xbbaeea){_0x24b8b6[_0x5c02('0x14')](0x194);}return _0xbbaeea;};}function handleError(_0x54c18c,_0x2a9ea9){_0x2a9ea9=_0x2a9ea9||0x1f4;return function(_0x4780b9){logger[_0x5c02('0x24')](_0x4780b9[_0x5c02('0x25')]);if(_0x4780b9[_0x5c02('0x26')]){delete _0x4780b9['name'];}_0x54c18c['status'](_0x2a9ea9)[_0x5c02('0x27')](_0x4780b9);};}exports['index']=function(_0x2f8b5c,_0x5467d8){var _0x2a0dde={},_0x1c891f={},_0x39d6fe={'count':0x0,'rows':[]};var _0x3a0571=_['map'](db[_0x5c02('0x28')][_0x5c02('0x29')],function(_0x28a8c2){return{'name':_0x28a8c2[_0x5c02('0x2a')],'type':_0x28a8c2[_0x5c02('0x2b')][_0x5c02('0x2c')]};});_0x1c891f[_0x5c02('0x2d')]=_[_0x5c02('0x2e')](_0x3a0571,'name');_0x1c891f[_0x5c02('0x2f')]=_[_0x5c02('0x30')](_0x2f8b5c['query']);_0x1c891f[_0x5c02('0x31')]=_[_0x5c02('0x32')](_0x1c891f[_0x5c02('0x2d')],_0x1c891f[_0x5c02('0x2f')]);_0x2a0dde[_0x5c02('0x33')]=_[_0x5c02('0x32')](_0x1c891f[_0x5c02('0x2d')],qs[_0x5c02('0x34')](_0x2f8b5c[_0x5c02('0x2f')]['fields']));_0x2a0dde['attributes']=_0x2a0dde[_0x5c02('0x33')][_0x5c02('0x35')]?_0x2a0dde[_0x5c02('0x33')]:_0x1c891f[_0x5c02('0x2d')];if(!_0x2f8b5c[_0x5c02('0x2f')][_0x5c02('0x36')](_0x5c02('0x37'))){_0x2a0dde['limit']=qs[_0x5c02('0x1a')](_0x2f8b5c[_0x5c02('0x2f')]['limit']);_0x2a0dde[_0x5c02('0x18')]=qs[_0x5c02('0x18')](_0x2f8b5c['query'][_0x5c02('0x18')]);}_0x2a0dde[_0x5c02('0x38')]=qs[_0x5c02('0x39')](_0x2f8b5c[_0x5c02('0x2f')][_0x5c02('0x39')]);_0x2a0dde[_0x5c02('0x3a')]=qs['filters'](_['pick'](_0x2f8b5c[_0x5c02('0x2f')],_0x1c891f[_0x5c02('0x31')]),_0x3a0571);if(_0x2f8b5c[_0x5c02('0x2f')]['filter']){_0x2a0dde[_0x5c02('0x3a')]=_[_0x5c02('0x3b')](_0x2a0dde['where'],{'$or':_[_0x5c02('0x2e')](_0x3a0571,function(_0x31a997){if(_0x31a997[_0x5c02('0x2b')]!==_0x5c02('0x3c')){var _0xbd0419={};_0xbd0419[_0x31a997[_0x5c02('0x26')]]={'$like':'%'+_0x2f8b5c[_0x5c02('0x2f')][_0x5c02('0x3d')]+'%'};return _0xbd0419;}})});}_0x2a0dde=_[_0x5c02('0x3b')]({},_0x2a0dde,_0x2f8b5c[_0x5c02('0x3e')]);var _0x1e2ec7={'where':_0x2a0dde['where']};return db[_0x5c02('0x28')]['count'](_0x1e2ec7)['then'](function(_0x31fcc){_0x39d6fe[_0x5c02('0x1b')]=_0x31fcc;if(_0x2f8b5c[_0x5c02('0x2f')][_0x5c02('0x3f')]){_0x2a0dde[_0x5c02('0x40')]=[{'all':!![]}];}return db[_0x5c02('0x28')][_0x5c02('0x41')](_0x2a0dde);})[_0x5c02('0x22')](function(_0x3e87d8){_0x39d6fe[_0x5c02('0x42')]=_0x3e87d8;return _0x39d6fe;})['then'](respondWithFilteredResult(_0x5467d8,_0x2a0dde))[_0x5c02('0x43')](handleError(_0x5467d8,null));};exports['show']=function(_0x30ba0b,_0x4eccee){var _0x349310={'raw':!![],'where':{'id':_0x30ba0b[_0x5c02('0x44')]['id']}},_0x4aff10={};_0x4aff10[_0x5c02('0x2d')]=_[_0x5c02('0x30')](db['SquareMessage']['rawAttributes']);_0x4aff10[_0x5c02('0x2f')]=_[_0x5c02('0x30')](_0x30ba0b[_0x5c02('0x2f')]);_0x4aff10[_0x5c02('0x31')]=_[_0x5c02('0x32')](_0x4aff10[_0x5c02('0x2d')],_0x4aff10[_0x5c02('0x2f')]);_0x349310[_0x5c02('0x33')]=_['intersection'](_0x4aff10['model'],qs[_0x5c02('0x34')](_0x30ba0b[_0x5c02('0x2f')][_0x5c02('0x34')]));_0x349310[_0x5c02('0x33')]=_0x349310[_0x5c02('0x33')][_0x5c02('0x35')]?_0x349310['attributes']:_0x4aff10[_0x5c02('0x2d')];if(_0x30ba0b[_0x5c02('0x2f')][_0x5c02('0x3f')]){_0x349310[_0x5c02('0x40')]=[{'all':!![]}];}_0x349310=_[_0x5c02('0x3b')]({},_0x349310,_0x30ba0b[_0x5c02('0x3e')]);return db['SquareMessage'][_0x5c02('0x45')](_0x349310)[_0x5c02('0x22')](handleEntityNotFound(_0x4eccee,null))[_0x5c02('0x22')](respondWithResult(_0x4eccee,null))['catch'](handleError(_0x4eccee,null));};exports['create']=function(_0x5cdb00,_0x2c1c0b){return db[_0x5c02('0x28')]['create'](_0x5cdb00[_0x5c02('0x46')],{})[_0x5c02('0x22')](respondWithResult(_0x2c1c0b,0xc9))[_0x5c02('0x43')](handleError(_0x2c1c0b,null));};exports['update']=function(_0x607338,_0x1ae3a3){if(_0x607338[_0x5c02('0x46')]['id']){delete _0x607338['body']['id'];}return db[_0x5c02('0x28')][_0x5c02('0x45')]({'where':{'id':_0x607338[_0x5c02('0x44')]['id']}})[_0x5c02('0x22')](handleEntityNotFound(_0x1ae3a3,null))[_0x5c02('0x22')](saveUpdates(_0x607338[_0x5c02('0x46')],null))['then'](respondWithResult(_0x1ae3a3,null))[_0x5c02('0x43')](handleError(_0x1ae3a3,null));};exports[_0x5c02('0x23')]=function(_0x468a07,_0x1ceafb){return db[_0x5c02('0x28')][_0x5c02('0x45')]({'where':{'id':_0x468a07[_0x5c02('0x44')]['id']}})[_0x5c02('0x22')](handleEntityNotFound(_0x1ceafb,null))[_0x5c02('0x22')](removeEntity(_0x1ceafb,null))[_0x5c02('0x43')](handleError(_0x1ceafb,null));};
\ No newline at end of file
index ba294a9..762ff82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb6f=['moment','bluebird','request-promise','rimraf','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api'];(function(_0x41094c,_0x430ffc){var _0x2131b2=function(_0x512aeb){while(--_0x512aeb){_0x41094c['push'](_0x41094c['shift']());}};_0x2131b2(++_0x430ffc);}(_0xcb6f,0xa2));var _0xfcb6=function(_0x24a991,_0x1c4fca){_0x24a991=_0x24a991-0x0;var _0x583105=_0xcb6f[_0x24a991];return _0x583105;};'use strict';var _=require(_0xfcb6('0x0'));var util=require('util');var logger=require(_0xfcb6('0x1'))(_0xfcb6('0x2'));var moment=require(_0xfcb6('0x3'));var BPromise=require(_0xfcb6('0x4'));var rp=require(_0xfcb6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcb6('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0xfcb6('0x7')]=function(_0x5324c5,_0x18bae4){return _0x5324c5[_0xfcb6('0x8')](_0xfcb6('0x9'),attributes,{'tableName':_0xfcb6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf7bb=['square_messages','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SquareMessage'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0xf7bb,0x121));var _0xbf7b=function(_0x14a85c,_0x1db7a5){_0x14a85c=_0x14a85c-0x0;var _0x32e12b=_0xf7bb[_0x14a85c];return _0x32e12b;};'use strict';var _=require(_0xbf7b('0x0'));var util=require(_0xbf7b('0x1'));var logger=require(_0xbf7b('0x2'))('api');var moment=require(_0xbf7b('0x3'));var BPromise=require(_0xbf7b('0x4'));var rp=require(_0xbf7b('0x5'));var fs=require('fs');var path=require(_0xbf7b('0x6'));var rimraf=require(_0xbf7b('0x7'));var config=require(_0xbf7b('0x8'));var attributes=require('./squareMessage.attributes');module[_0xbf7b('0x9')]=function(_0x38056d,_0x5a38d1){return _0x38056d['define'](_0xbf7b('0xa'),attributes,{'tableName':_0xbf7b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cd4c29c..64a1b30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x306a=['CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','error','code','message','result','catch'];(function(_0x134b78,_0x323c91){var _0x5d77ec=function(_0x71ade){while(--_0x71ade){_0x134b78['push'](_0x134b78['shift']());}};_0x5d77ec(++_0x323c91);}(_0x306a,0xde));var _0xa306=function(_0x10a29d,_0x6b51d3){_0x10a29d=_0x10a29d-0x0;var _0xff1b77=_0x306a[_0x10a29d];return _0xff1b77;};'use strict';var _=require(_0xa306('0x0'));var util=require(_0xa306('0x1'));var moment=require(_0xa306('0x2'));var BPromise=require(_0xa306('0x3'));var rs=require(_0xa306('0x4'));var fs=require('fs');var Redis=require(_0xa306('0x5'));var db=require(_0xa306('0x6'))['db'];var utils=require(_0xa306('0x7'));var logger=require('../../config/logger')(_0xa306('0x8'));var config=require('../../config/environment');var jayson=require(_0xa306('0x9'));var client=jayson['client'][_0xa306('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cfba2,_0x3fd2af,_0x18c3ab){return new BPromise(function(_0x17d108,_0x1bc326){return client[_0xa306('0xb')](_0x5cfba2,_0x18c3ab)[_0xa306('0xc')](function(_0x16aa6d){logger[_0xa306('0xd')](_0xa306('0xe'),_0x3fd2af,'request\x20sent');logger[_0xa306('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3fd2af,'request\x20sent',JSON['stringify'](_0x16aa6d));if(_0x16aa6d[_0xa306('0x10')]){if(_0x16aa6d[_0xa306('0x10')][_0xa306('0x11')]===0x1f4){logger[_0xa306('0x10')](_0xa306('0xe'),_0x3fd2af,_0x16aa6d['error']['message']);return _0x1bc326(_0x16aa6d[_0xa306('0x10')][_0xa306('0x12')]);}logger[_0xa306('0x10')](_0xa306('0xe'),_0x3fd2af,_0x16aa6d[_0xa306('0x10')][_0xa306('0x12')]);return _0x17d108(_0x16aa6d['error'][_0xa306('0x12')]);}else{logger['info'](_0xa306('0xe'),_0x3fd2af,'request\x20sent');_0x17d108(_0x16aa6d[_0xa306('0x13')][_0xa306('0x12')]);}})[_0xa306('0x14')](function(_0x49ea1c){logger[_0xa306('0x10')](_0xa306('0xe'),_0x3fd2af,_0x49ea1c);_0x1bc326(_0x49ea1c);});});}exports[_0xa306('0x15')]=function(_0x5aaefd){var _0x28e177=this;return new Promise(function(_0x504444,_0x4988db){return db[_0xa306('0x16')][_0xa306('0x17')](_0x5aaefd[_0xa306('0x18')],{'raw':_0x5aaefd['options']?_0x5aaefd[_0xa306('0x19')][_0xa306('0x1a')]===undefined?!![]:![]:!![]})[_0xa306('0xc')](function(_0x146f1d){logger['info'](_0xa306('0x15'),_0x5aaefd);logger[_0xa306('0xf')]('CreateSquareMessage',_0x5aaefd,JSON['stringify'](_0x146f1d));_0x504444(_0x146f1d);})[_0xa306('0x14')](function(_0x252756){logger[_0xa306('0x10')](_0xa306('0x15'),_0x252756[_0xa306('0x12')],_0x5aaefd);_0x4988db(_0x28e177[_0xa306('0x10')](0x1f4,_0x252756['message']));});});};
\ No newline at end of file
+var _0xd203=['raw','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','options'];(function(_0x1872a1,_0x18ed95){var _0x5afa10=function(_0x104312){while(--_0x104312){_0x1872a1['push'](_0x1872a1['shift']());}};_0x5afa10(++_0x18ed95);}(_0xd203,0xdb));var _0x3d20=function(_0x70450,_0x30556a){_0x70450=_0x70450-0x0;var _0x2259a9=_0xd203[_0x70450];return _0x2259a9;};'use strict';var _=require(_0x3d20('0x0'));var util=require(_0x3d20('0x1'));var moment=require(_0x3d20('0x2'));var BPromise=require(_0x3d20('0x3'));var rs=require(_0x3d20('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d20('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3d20('0x6'));var config=require(_0x3d20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3d20('0x8')][_0x3d20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8af679,_0x39a74c,_0x423d01){return new BPromise(function(_0x3ce14b,_0x2951e9){return client[_0x3d20('0xa')](_0x8af679,_0x423d01)['then'](function(_0x2e7873){logger[_0x3d20('0xb')]('SquareMessage,\x20%s,\x20%s',_0x39a74c,_0x3d20('0xc'));logger['debug'](_0x3d20('0xd'),_0x39a74c,_0x3d20('0xc'),JSON[_0x3d20('0xe')](_0x2e7873));if(_0x2e7873[_0x3d20('0xf')]){if(_0x2e7873[_0x3d20('0xf')][_0x3d20('0x10')]===0x1f4){logger[_0x3d20('0xf')](_0x3d20('0x11'),_0x39a74c,_0x2e7873['error'][_0x3d20('0x12')]);return _0x2951e9(_0x2e7873[_0x3d20('0xf')][_0x3d20('0x12')]);}logger['error'](_0x3d20('0x11'),_0x39a74c,_0x2e7873[_0x3d20('0xf')][_0x3d20('0x12')]);return _0x3ce14b(_0x2e7873['error'][_0x3d20('0x12')]);}else{logger[_0x3d20('0xb')]('SquareMessage,\x20%s,\x20%s',_0x39a74c,_0x3d20('0xc'));_0x3ce14b(_0x2e7873[_0x3d20('0x13')]['message']);}})[_0x3d20('0x14')](function(_0x8df15c){logger[_0x3d20('0xf')]('SquareMessage,\x20%s,\x20%s',_0x39a74c,_0x8df15c);_0x2951e9(_0x8df15c);});});}exports[_0x3d20('0x15')]=function(_0x34d98e){var _0x36f95c=this;return new Promise(function(_0x112474,_0x46ecff){return db[_0x3d20('0x16')]['create'](_0x34d98e['body'],{'raw':_0x34d98e['options']?_0x34d98e[_0x3d20('0x17')][_0x3d20('0x18')]===undefined?!![]:![]:!![]})[_0x3d20('0x19')](function(_0xde9d1){logger[_0x3d20('0xb')](_0x3d20('0x15'),_0x34d98e);logger[_0x3d20('0x1a')]('CreateSquareMessage',_0x34d98e,JSON[_0x3d20('0xe')](_0xde9d1));_0x112474(_0xde9d1);})['catch'](function(_0x3337e8){logger[_0x3d20('0xf')](_0x3d20('0x15'),_0x3337e8[_0x3d20('0x12')],_0x34d98e);_0x46ecff(_0x36f95c[_0x3d20('0xf')](0x1f4,_0x3337e8['message']));});});};
\ No newline at end of file
index fee030f..dd936bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x359d=['../../config/environment','./squareOdbc.controller','get','index','isAuthenticated','show','/:id/test','15s','test','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x24a76b,_0x305414){var _0x56fde4=function(_0x1ff274){while(--_0x1ff274){_0x24a76b['push'](_0x24a76b['shift']());}};_0x56fde4(++_0x305414);}(_0x359d,0x1a9));var _0xd359=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x359d[_0x19a49f];return _0x5351ae;};'use strict';var multer=require(_0xd359('0x0'));var util=require(_0xd359('0x1'));var path=require(_0xd359('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd359('0x3')]();var fs_extra=require(_0xd359('0x4'));var auth=require(_0xd359('0x5'));var interaction=require(_0xd359('0x6'));var config=require(_0xd359('0x7'));var controller=require(_0xd359('0x8'));router[_0xd359('0x9')]('/',auth['isAuthenticated'](),controller[_0xd359('0xa')]);router['get']('/:id',auth[_0xd359('0xb')](),controller[_0xd359('0xc')]);router[_0xd359('0x9')](_0xd359('0xd'),auth['isAuthenticated'](),timeout(_0xd359('0xe')),controller[_0xd359('0xf')]);router[_0xd359('0x10')]('/',auth[_0xd359('0xb')](),controller[_0xd359('0x11')]);router[_0xd359('0x12')](_0xd359('0x13'),auth[_0xd359('0xb')](),controller[_0xd359('0x14')]);router[_0xd359('0x15')](_0xd359('0x13'),auth[_0xd359('0xb')](),controller[_0xd359('0x16')]);module[_0xd359('0x17')]=router;
\ No newline at end of file
+var _0x2369=['get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x2369,0x15e));var _0x9236=function(_0x4aca12,_0x335d87){_0x4aca12=_0x4aca12-0x0;var _0xf0f91=_0x2369[_0x4aca12];return _0xf0f91;};'use strict';var multer=require(_0x9236('0x0'));var util=require(_0x9236('0x1'));var path=require(_0x9236('0x2'));var timeout=require(_0x9236('0x3'));var express=require(_0x9236('0x4'));var router=express[_0x9236('0x5')]();var fs_extra=require(_0x9236('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9236('0x7'));var config=require(_0x9236('0x8'));var controller=require(_0x9236('0x9'));router[_0x9236('0xa')]('/',auth[_0x9236('0xb')](),controller[_0x9236('0xc')]);router[_0x9236('0xa')](_0x9236('0xd'),auth[_0x9236('0xb')](),controller[_0x9236('0xe')]);router[_0x9236('0xa')](_0x9236('0xf'),auth[_0x9236('0xb')](),timeout(_0x9236('0x10')),controller[_0x9236('0x11')]);router[_0x9236('0x12')]('/',auth['isAuthenticated'](),controller[_0x9236('0x13')]);router[_0x9236('0x14')](_0x9236('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x9236('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9236('0x16')]);module[_0x9236('0x17')]=router;
\ No newline at end of file
index 391d227..e47a280 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fd1=['exports','STRING','name','sequelize'];(function(_0x3eca5a,_0x20d490){var _0x15470e=function(_0x219cc6){while(--_0x219cc6){_0x3eca5a['push'](_0x3eca5a['shift']());}};_0x15470e(++_0x20d490);}(_0x9fd1,0x133));var _0x19fd=function(_0x167d4b,_0x5cc3e7){_0x167d4b=_0x167d4b-0x0;var _0x12b49c=_0x9fd1[_0x167d4b];return _0x12b49c;};'use strict';var Sequelize=require(_0x19fd('0x0'));module[_0x19fd('0x1')]={'name':{'type':Sequelize[_0x19fd('0x2')],'unique':_0x19fd('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x19fd('0x2')]},'description':{'type':Sequelize[_0x19fd('0x2')]}};
\ No newline at end of file
+var _0x60a2=['STRING','name'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x60a2,0xee));var _0x260a=function(_0xa630b0,_0x4eee1e){_0xa630b0=_0xa630b0-0x0;var _0x26dc98=_0x60a2[_0xa630b0];return _0x26dc98;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x260a('0x0')],'unique':_0x260a('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x260a('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index c5d76d6..f32abec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dc2=['destroy','get','UserProfileResource','end','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','SquareOdbc','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','role','user','ODBC','UserProfileSection','userProfileId','autoAssociation','update','dsn','openSync','closeSync','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x4ed388,_0x56e34d){var _0x46b444=function(_0x3dd44f){while(--_0x3dd44f){_0x4ed388['push'](_0x4ed388['shift']());}};_0x46b444(++_0x56e34d);}(_0x0dc2,0x83));var _0x20dc=function(_0x108b0b,_0x25c2e9){_0x108b0b=_0x108b0b-0x0;var _0x3137fd=_0x0dc2[_0x108b0b];return _0x3137fd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x20dc('0x0'));var rp=require(_0x20dc('0x1'));var moment=require(_0x20dc('0x2'));var BPromise=require(_0x20dc('0x3'));var Mustache=require('mustache');var util=require(_0x20dc('0x4'));var path=require(_0x20dc('0x5'));var sox=require(_0x20dc('0x6'));var csv=require(_0x20dc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20dc('0x8'));var _=require('lodash');var squel=require(_0x20dc('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20dc('0x7'));var querystring=require('querystring');var Papa=require(_0x20dc('0xa'));var Redis=require(_0x20dc('0xb'));var authService=require(_0x20dc('0xc'));var qs=require(_0x20dc('0xd'));var as=require(_0x20dc('0xe'));var hardwareService=require(_0x20dc('0xf'));var logger=require(_0x20dc('0x10'))('api');var utils=require(_0x20dc('0x11'));var config=require(_0x20dc('0x12'));var licenseUtil=require(_0x20dc('0x13'));var db=require(_0x20dc('0x14'))['db'];function respondWithStatusCode(_0x190f31,_0xb6680a){_0xb6680a=_0xb6680a||0xcc;return function(_0x10e0a2){if(_0x10e0a2){return _0x190f31['sendStatus'](_0xb6680a);}return _0x190f31[_0x20dc('0x15')](_0xb6680a)['end']();};}function respondWithResult(_0x545a95,_0x448af0){_0x448af0=_0x448af0||0xc8;return function(_0x59f08e){if(_0x59f08e){return _0x545a95[_0x20dc('0x15')](_0x448af0)[_0x20dc('0x16')](_0x59f08e);}};}function respondWithFilteredResult(_0x580c2b,_0x3f8d25){return function(_0x4fe6f4){if(_0x4fe6f4){var _0x1256d4=typeof _0x3f8d25[_0x20dc('0x17')]===_0x20dc('0x18')&&typeof _0x3f8d25[_0x20dc('0x19')]===_0x20dc('0x18');var _0x54cbfb=_0x4fe6f4[_0x20dc('0x1a')];var _0x591e7d=_0x1256d4?0x0:_0x3f8d25['offset'];var _0x12a392=_0x1256d4?_0x4fe6f4['count']:_0x3f8d25[_0x20dc('0x17')]+_0x3f8d25[_0x20dc('0x19')];var _0x2d41b7;if(_0x12a392>=_0x54cbfb){_0x12a392=_0x54cbfb;_0x2d41b7=0xc8;}else{_0x2d41b7=0xce;}_0x580c2b[_0x20dc('0x15')](_0x2d41b7);return _0x580c2b[_0x20dc('0x1b')](_0x20dc('0x1c'),_0x591e7d+'-'+_0x12a392+'/'+_0x54cbfb)[_0x20dc('0x16')](_0x4fe6f4);}return null;};}function patchUpdates(_0xca29c6){return function(_0x54daa0){try{jsonpatch[_0x20dc('0x1d')](_0x54daa0,_0xca29c6,!![]);}catch(_0x43e5b7){return BPromise[_0x20dc('0x1e')](_0x43e5b7);}return _0x54daa0[_0x20dc('0x1f')]();};}function saveUpdates(_0x27acf2,_0x2281dc){return function(_0x450853){if(_0x450853){return _0x450853['update'](_0x27acf2)[_0x20dc('0x20')](function(_0x30d67b){return _0x30d67b;});}return null;};}function removeEntity(_0x16be66,_0x31af87){return function(_0x5e2d58){if(_0x5e2d58){return _0x5e2d58[_0x20dc('0x21')]()[_0x20dc('0x20')](function(){var _0x28f93f=_0x5e2d58[_0x20dc('0x22')]({'plain':!![]});var _0x599276='ODBC';return db[_0x20dc('0x23')][_0x20dc('0x21')]({'where':{'type':_0x599276,'resourceId':_0x28f93f['id']}})['then'](function(){return _0x5e2d58;});})['then'](function(){_0x16be66['status'](0xcc)[_0x20dc('0x24')]();});}};}function handleEntityNotFound(_0x455297,_0x29edd5){return function(_0x1e6b03){if(!_0x1e6b03){_0x455297['sendStatus'](0x194);}return _0x1e6b03;};}function handleError(_0x27d395,_0x8e3ba6){_0x8e3ba6=_0x8e3ba6||0x1f4;return function(_0x16835d){logger[_0x20dc('0x25')](_0x16835d['stack']);if(_0x16835d[_0x20dc('0x26')]){delete _0x16835d['name'];}_0x27d395[_0x20dc('0x15')](_0x8e3ba6)[_0x20dc('0x27')](_0x16835d);};}exports[_0x20dc('0x28')]=function(_0x35ca8a,_0x314004){var _0x1492b0={},_0x1490ba={},_0xe50f45={'count':0x0,'rows':[]};var _0xda185c=_[_0x20dc('0x29')](db['SquareOdbc']['rawAttributes'],function(_0x4462e7){return{'name':_0x4462e7[_0x20dc('0x2a')],'type':_0x4462e7[_0x20dc('0x2b')][_0x20dc('0x2c')]};});_0x1490ba[_0x20dc('0x2d')]=_[_0x20dc('0x29')](_0xda185c,_0x20dc('0x26'));_0x1490ba[_0x20dc('0x2e')]=_[_0x20dc('0x2f')](_0x35ca8a[_0x20dc('0x2e')]);_0x1490ba[_0x20dc('0x30')]=_[_0x20dc('0x31')](_0x1490ba['model'],_0x1490ba[_0x20dc('0x2e')]);_0x1492b0['attributes']=_[_0x20dc('0x31')](_0x1490ba[_0x20dc('0x2d')],qs['fields'](_0x35ca8a[_0x20dc('0x2e')][_0x20dc('0x32')]));_0x1492b0['attributes']=_0x1492b0['attributes'][_0x20dc('0x33')]?_0x1492b0[_0x20dc('0x34')]:_0x1490ba[_0x20dc('0x2d')];if(!_0x35ca8a['query'][_0x20dc('0x35')](_0x20dc('0x36'))){_0x1492b0[_0x20dc('0x19')]=qs[_0x20dc('0x19')](_0x35ca8a[_0x20dc('0x2e')][_0x20dc('0x19')]);_0x1492b0[_0x20dc('0x17')]=qs[_0x20dc('0x17')](_0x35ca8a[_0x20dc('0x2e')][_0x20dc('0x17')]);}_0x1492b0['order']=qs[_0x20dc('0x37')](_0x35ca8a[_0x20dc('0x2e')]['sort']);_0x1492b0[_0x20dc('0x38')]=qs['filters'](_['pick'](_0x35ca8a[_0x20dc('0x2e')],_0x1490ba[_0x20dc('0x30')]),_0xda185c);if(_0x35ca8a['query'][_0x20dc('0x39')]){_0x1492b0[_0x20dc('0x38')]=_[_0x20dc('0x3a')](_0x1492b0[_0x20dc('0x38')],{'$or':_[_0x20dc('0x29')](_0xda185c,function(_0x525892){if(_0x525892[_0x20dc('0x2b')]!==_0x20dc('0x3b')){var _0x47fb55={};_0x47fb55[_0x525892['name']]={'$like':'%'+_0x35ca8a[_0x20dc('0x2e')][_0x20dc('0x39')]+'%'};return _0x47fb55;}})});}_0x1492b0=_[_0x20dc('0x3a')]({},_0x1492b0,_0x35ca8a['options']);var _0x57ebf4={'where':_0x1492b0['where']};return db['SquareOdbc'][_0x20dc('0x1a')](_0x57ebf4)[_0x20dc('0x20')](function(_0x11990a){_0xe50f45[_0x20dc('0x1a')]=_0x11990a;if(_0x35ca8a['query'][_0x20dc('0x3c')]){_0x1492b0['include']=[{'all':!![]}];}return db[_0x20dc('0x3d')][_0x20dc('0x3e')](_0x1492b0);})[_0x20dc('0x20')](function(_0x3f68d8){_0xe50f45[_0x20dc('0x3f')]=_0x3f68d8;return _0xe50f45;})[_0x20dc('0x20')](respondWithFilteredResult(_0x314004,_0x1492b0))['catch'](handleError(_0x314004,null));};exports[_0x20dc('0x40')]=function(_0x1032fc,_0x1d0d26){var _0x59d6fe={'raw':!![],'where':{'id':_0x1032fc[_0x20dc('0x41')]['id']}},_0x287729={};_0x287729['model']=_[_0x20dc('0x2f')](db[_0x20dc('0x3d')][_0x20dc('0x42')]);_0x287729[_0x20dc('0x2e')]=_[_0x20dc('0x2f')](_0x1032fc[_0x20dc('0x2e')]);_0x287729[_0x20dc('0x30')]=_[_0x20dc('0x31')](_0x287729[_0x20dc('0x2d')],_0x287729[_0x20dc('0x2e')]);_0x59d6fe[_0x20dc('0x34')]=_['intersection'](_0x287729[_0x20dc('0x2d')],qs[_0x20dc('0x32')](_0x1032fc[_0x20dc('0x2e')][_0x20dc('0x32')]));_0x59d6fe[_0x20dc('0x34')]=_0x59d6fe['attributes']['length']?_0x59d6fe[_0x20dc('0x34')]:_0x287729[_0x20dc('0x2d')];if(_0x1032fc[_0x20dc('0x2e')]['includeAll']){_0x59d6fe[_0x20dc('0x43')]=[{'all':!![]}];}_0x59d6fe=_[_0x20dc('0x3a')]({},_0x59d6fe,_0x1032fc['options']);return db['SquareOdbc'][_0x20dc('0x44')](_0x59d6fe)[_0x20dc('0x20')](handleEntityNotFound(_0x1d0d26,null))[_0x20dc('0x20')](respondWithResult(_0x1d0d26,null))[_0x20dc('0x45')](handleError(_0x1d0d26,null));};exports[_0x20dc('0x46')]=function(_0x4be8ff,_0x4f1403){return db[_0x20dc('0x3d')]['create'](_0x4be8ff[_0x20dc('0x47')],{})[_0x20dc('0x20')](function(_0x518105){var _0x2bd3cd=_0x4be8ff['user']['get']({'plain':!![]});if(!_0x2bd3cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bd3cd[_0x20dc('0x48')]===_0x20dc('0x49')){var _0x4da5a5=_0x518105[_0x20dc('0x22')]({'plain':!![]});var _0x24e4f9=_0x20dc('0x4a');return db[_0x20dc('0x4b')][_0x20dc('0x44')]({'where':{'name':_0x24e4f9,'userProfileId':_0x2bd3cd[_0x20dc('0x4c')]},'raw':!![]})[_0x20dc('0x20')](function(_0x181ac0){if(_0x181ac0&&_0x181ac0[_0x20dc('0x4d')]===0x0){return db[_0x20dc('0x23')][_0x20dc('0x46')]({'name':_0x4da5a5[_0x20dc('0x26')],'resourceId':_0x4da5a5['id'],'type':_0x181ac0['name'],'sectionId':_0x181ac0['id']},{})[_0x20dc('0x20')](function(){return _0x518105;});}else{return _0x518105;}})[_0x20dc('0x45')](function(_0x506bd0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x506bd0);throw _0x506bd0;});}return _0x518105;})[_0x20dc('0x20')](respondWithResult(_0x4f1403,0xc9))[_0x20dc('0x45')](handleError(_0x4f1403,null));};exports[_0x20dc('0x4e')]=function(_0x407e47,_0x3d1a00){if(_0x407e47[_0x20dc('0x47')]['id']){delete _0x407e47[_0x20dc('0x47')]['id'];}return db[_0x20dc('0x3d')]['find']({'where':{'id':_0x407e47[_0x20dc('0x41')]['id']}})[_0x20dc('0x20')](handleEntityNotFound(_0x3d1a00,null))['then'](saveUpdates(_0x407e47[_0x20dc('0x47')],null))[_0x20dc('0x20')](respondWithResult(_0x3d1a00,null))[_0x20dc('0x45')](handleError(_0x3d1a00,null));};exports['destroy']=function(_0xad17f5,_0x3694d5){return db[_0x20dc('0x3d')]['find']({'where':{'id':_0xad17f5[_0x20dc('0x41')]['id']}})[_0x20dc('0x20')](handleEntityNotFound(_0x3694d5,null))['then'](removeEntity(_0x3694d5,null))[_0x20dc('0x45')](handleError(_0x3694d5,null));};exports['test']=function(_0x26899b,_0x668859,_0x3e723f){var _0x3eaaf0;return db[_0x20dc('0x3d')][_0x20dc('0x44')]({'where':{'id':_0x26899b['params']['id']},'attributes':['id',_0x20dc('0x4f')]})[_0x20dc('0x20')](handleEntityNotFound(_0x668859,null))[_0x20dc('0x20')](function(_0x347b87){if(_0x347b87){var _0x7fd231=require('odbc')();_0x7fd231[_0x20dc('0x50')](_0x347b87[_0x20dc('0x4f')]);_0x7fd231[_0x20dc('0x51')]();return _0x347b87;}})[_0x20dc('0x20')](respondWithResult(_0x668859,null))['catch'](handleError(_0x668859,null));};
\ No newline at end of file
+var _0x1407=['ODBC','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include','show','params','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','then','destroy','get'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x1407,0x1e1));var _0x7140=function(_0x586205,_0x56f8ca){_0x586205=_0x586205-0x0;var _0x539adf=_0x1407[_0x586205];return _0x539adf;};'use strict';var emlformat=require(_0x7140('0x0'));var rimraf=require(_0x7140('0x1'));var zipdir=require(_0x7140('0x2'));var jsonpatch=require(_0x7140('0x3'));var rp=require(_0x7140('0x4'));var moment=require('moment');var BPromise=require(_0x7140('0x5'));var Mustache=require(_0x7140('0x6'));var util=require(_0x7140('0x7'));var path=require('path');var sox=require(_0x7140('0x8'));var csv=require(_0x7140('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7140('0xa'));var _=require(_0x7140('0xb'));var squel=require(_0x7140('0xc'));var crypto=require('crypto');var jsforce=require(_0x7140('0xd'));var deskjs=require(_0x7140('0xe'));var toCsv=require(_0x7140('0x9'));var querystring=require(_0x7140('0xf'));var Papa=require(_0x7140('0x10'));var Redis=require(_0x7140('0x11'));var authService=require(_0x7140('0x12'));var qs=require(_0x7140('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7140('0x14'));var logger=require(_0x7140('0x15'))(_0x7140('0x16'));var utils=require(_0x7140('0x17'));var config=require(_0x7140('0x18'));var licenseUtil=require(_0x7140('0x19'));var db=require(_0x7140('0x1a'))['db'];function respondWithStatusCode(_0x52e3d8,_0x2173d6){_0x2173d6=_0x2173d6||0xcc;return function(_0xa481ce){if(_0xa481ce){return _0x52e3d8[_0x7140('0x1b')](_0x2173d6);}return _0x52e3d8[_0x7140('0x1c')](_0x2173d6)[_0x7140('0x1d')]();};}function respondWithResult(_0x592731,_0x40057f){_0x40057f=_0x40057f||0xc8;return function(_0x2376e1){if(_0x2376e1){return _0x592731['status'](_0x40057f)[_0x7140('0x1e')](_0x2376e1);}};}function respondWithFilteredResult(_0x1957b8,_0x3982eb){return function(_0x16cf93){if(_0x16cf93){var _0xc74615=typeof _0x3982eb[_0x7140('0x1f')]===_0x7140('0x20')&&typeof _0x3982eb['limit']===_0x7140('0x20');var _0x32eaeb=_0x16cf93[_0x7140('0x21')];var _0x43f389=_0xc74615?0x0:_0x3982eb[_0x7140('0x1f')];var _0x4ceda4=_0xc74615?_0x16cf93['count']:_0x3982eb['offset']+_0x3982eb['limit'];var _0x487b9b;if(_0x4ceda4>=_0x32eaeb){_0x4ceda4=_0x32eaeb;_0x487b9b=0xc8;}else{_0x487b9b=0xce;}_0x1957b8['status'](_0x487b9b);return _0x1957b8['set'](_0x7140('0x22'),_0x43f389+'-'+_0x4ceda4+'/'+_0x32eaeb)[_0x7140('0x1e')](_0x16cf93);}return null;};}function patchUpdates(_0x5399bc){return function(_0x72da62){try{jsonpatch['apply'](_0x72da62,_0x5399bc,!![]);}catch(_0x1099d5){return BPromise[_0x7140('0x23')](_0x1099d5);}return _0x72da62[_0x7140('0x24')]();};}function saveUpdates(_0x39cec5,_0x14c326){return function(_0x472d2c){if(_0x472d2c){return _0x472d2c[_0x7140('0x25')](_0x39cec5)[_0x7140('0x26')](function(_0x131328){return _0x131328;});}return null;};}function removeEntity(_0x3dad9f,_0x413de1){return function(_0x47ef60){if(_0x47ef60){return _0x47ef60[_0x7140('0x27')]()['then'](function(){var _0x7037e5=_0x47ef60[_0x7140('0x28')]({'plain':!![]});var _0x3ca7cb=_0x7140('0x29');return db['UserProfileResource'][_0x7140('0x27')]({'where':{'type':_0x3ca7cb,'resourceId':_0x7037e5['id']}})[_0x7140('0x26')](function(){return _0x47ef60;});})[_0x7140('0x26')](function(){_0x3dad9f['status'](0xcc)[_0x7140('0x1d')]();});}};}function handleEntityNotFound(_0x27af61,_0xa17749){return function(_0x46fd4b){if(!_0x46fd4b){_0x27af61[_0x7140('0x1b')](0x194);}return _0x46fd4b;};}function handleError(_0x33b5bf,_0x264b86){_0x264b86=_0x264b86||0x1f4;return function(_0x2d42c8){logger[_0x7140('0x2a')](_0x2d42c8[_0x7140('0x2b')]);if(_0x2d42c8[_0x7140('0x2c')]){delete _0x2d42c8[_0x7140('0x2c')];}_0x33b5bf[_0x7140('0x1c')](_0x264b86)[_0x7140('0x2d')](_0x2d42c8);};}exports[_0x7140('0x2e')]=function(_0x19894f,_0xc8b00){var _0x13b355={},_0x418fbb={},_0x58431f={'count':0x0,'rows':[]};var _0x343dda=_[_0x7140('0x2f')](db[_0x7140('0x30')][_0x7140('0x31')],function(_0x27b2eb){return{'name':_0x27b2eb['fieldName'],'type':_0x27b2eb[_0x7140('0x32')][_0x7140('0x33')]};});_0x418fbb[_0x7140('0x34')]=_['map'](_0x343dda,_0x7140('0x2c'));_0x418fbb[_0x7140('0x35')]=_[_0x7140('0x36')](_0x19894f[_0x7140('0x35')]);_0x418fbb[_0x7140('0x37')]=_[_0x7140('0x38')](_0x418fbb[_0x7140('0x34')],_0x418fbb[_0x7140('0x35')]);_0x13b355[_0x7140('0x39')]=_['intersection'](_0x418fbb[_0x7140('0x34')],qs[_0x7140('0x3a')](_0x19894f['query'][_0x7140('0x3a')]));_0x13b355[_0x7140('0x39')]=_0x13b355[_0x7140('0x39')][_0x7140('0x3b')]?_0x13b355[_0x7140('0x39')]:_0x418fbb['model'];if(!_0x19894f[_0x7140('0x35')]['hasOwnProperty'](_0x7140('0x3c'))){_0x13b355[_0x7140('0x3d')]=qs[_0x7140('0x3d')](_0x19894f['query'][_0x7140('0x3d')]);_0x13b355[_0x7140('0x1f')]=qs[_0x7140('0x1f')](_0x19894f['query'][_0x7140('0x1f')]);}_0x13b355[_0x7140('0x3e')]=qs[_0x7140('0x3f')](_0x19894f[_0x7140('0x35')][_0x7140('0x3f')]);_0x13b355[_0x7140('0x40')]=qs[_0x7140('0x37')](_[_0x7140('0x41')](_0x19894f[_0x7140('0x35')],_0x418fbb['filters']),_0x343dda);if(_0x19894f[_0x7140('0x35')][_0x7140('0x42')]){_0x13b355[_0x7140('0x40')]=_['merge'](_0x13b355['where'],{'$or':_[_0x7140('0x2f')](_0x343dda,function(_0xabf008){if(_0xabf008['type']!=='VIRTUAL'){var _0x35645f={};_0x35645f[_0xabf008[_0x7140('0x2c')]]={'$like':'%'+_0x19894f[_0x7140('0x35')][_0x7140('0x42')]+'%'};return _0x35645f;}})});}_0x13b355=_[_0x7140('0x43')]({},_0x13b355,_0x19894f['options']);var _0x3b1247={'where':_0x13b355['where']};return db[_0x7140('0x30')][_0x7140('0x21')](_0x3b1247)[_0x7140('0x26')](function(_0x3617b2){_0x58431f[_0x7140('0x21')]=_0x3617b2;if(_0x19894f[_0x7140('0x35')][_0x7140('0x44')]){_0x13b355[_0x7140('0x45')]=[{'all':!![]}];}return db[_0x7140('0x30')]['findAll'](_0x13b355);})[_0x7140('0x26')](function(_0x384bcf){_0x58431f['rows']=_0x384bcf;return _0x58431f;})[_0x7140('0x26')](respondWithFilteredResult(_0xc8b00,_0x13b355))['catch'](handleError(_0xc8b00,null));};exports[_0x7140('0x46')]=function(_0x24e6f7,_0x1b034e){var _0x183048={'raw':!![],'where':{'id':_0x24e6f7[_0x7140('0x47')]['id']}},_0x39303b={};_0x39303b[_0x7140('0x34')]=_[_0x7140('0x36')](db[_0x7140('0x30')][_0x7140('0x31')]);_0x39303b['query']=_[_0x7140('0x36')](_0x24e6f7[_0x7140('0x35')]);_0x39303b[_0x7140('0x37')]=_[_0x7140('0x38')](_0x39303b['model'],_0x39303b[_0x7140('0x35')]);_0x183048[_0x7140('0x39')]=_['intersection'](_0x39303b[_0x7140('0x34')],qs['fields'](_0x24e6f7['query']['fields']));_0x183048[_0x7140('0x39')]=_0x183048[_0x7140('0x39')][_0x7140('0x3b')]?_0x183048[_0x7140('0x39')]:_0x39303b[_0x7140('0x34')];if(_0x24e6f7[_0x7140('0x35')][_0x7140('0x44')]){_0x183048['include']=[{'all':!![]}];}_0x183048=_[_0x7140('0x43')]({},_0x183048,_0x24e6f7[_0x7140('0x48')]);return db[_0x7140('0x30')][_0x7140('0x49')](_0x183048)[_0x7140('0x26')](handleEntityNotFound(_0x1b034e,null))[_0x7140('0x26')](respondWithResult(_0x1b034e,null))[_0x7140('0x4a')](handleError(_0x1b034e,null));};exports['create']=function(_0x3a229d,_0x5d4c9c){return db[_0x7140('0x30')][_0x7140('0x4b')](_0x3a229d[_0x7140('0x4c')],{})[_0x7140('0x26')](function(_0x20fcfa){var _0x4940e5=_0x3a229d['user'][_0x7140('0x28')]({'plain':!![]});if(!_0x4940e5)throw new Error(_0x7140('0x4d'));if(_0x4940e5['role']===_0x7140('0x4e')){var _0x351741=_0x20fcfa['get']({'plain':!![]});var _0x156776=_0x7140('0x29');return db[_0x7140('0x4f')][_0x7140('0x49')]({'where':{'name':_0x156776,'userProfileId':_0x4940e5[_0x7140('0x50')]},'raw':!![]})[_0x7140('0x26')](function(_0x500389){if(_0x500389&&_0x500389['autoAssociation']===0x0){return db[_0x7140('0x51')]['create']({'name':_0x351741['name'],'resourceId':_0x351741['id'],'type':_0x500389[_0x7140('0x2c')],'sectionId':_0x500389['id']},{})['then'](function(){return _0x20fcfa;});}else{return _0x20fcfa;}})[_0x7140('0x4a')](function(_0x353df8){logger[_0x7140('0x2a')](_0x7140('0x52'),_0x353df8);throw _0x353df8;});}return _0x20fcfa;})[_0x7140('0x26')](respondWithResult(_0x5d4c9c,0xc9))[_0x7140('0x4a')](handleError(_0x5d4c9c,null));};exports[_0x7140('0x25')]=function(_0x521d2a,_0x41b827){if(_0x521d2a[_0x7140('0x4c')]['id']){delete _0x521d2a[_0x7140('0x4c')]['id'];}return db[_0x7140('0x30')]['find']({'where':{'id':_0x521d2a['params']['id']}})[_0x7140('0x26')](handleEntityNotFound(_0x41b827,null))[_0x7140('0x26')](saveUpdates(_0x521d2a[_0x7140('0x4c')],null))[_0x7140('0x26')](respondWithResult(_0x41b827,null))['catch'](handleError(_0x41b827,null));};exports[_0x7140('0x27')]=function(_0x4a63a0,_0xf9b609){return db[_0x7140('0x30')][_0x7140('0x49')]({'where':{'id':_0x4a63a0[_0x7140('0x47')]['id']}})[_0x7140('0x26')](handleEntityNotFound(_0xf9b609,null))[_0x7140('0x26')](removeEntity(_0xf9b609,null))[_0x7140('0x4a')](handleError(_0xf9b609,null));};exports[_0x7140('0x53')]=function(_0x3f439e,_0x47df25,_0x2ff54c){var _0x53aa83;return db['SquareOdbc'][_0x7140('0x49')]({'where':{'id':_0x3f439e[_0x7140('0x47')]['id']},'attributes':['id','dsn']})[_0x7140('0x26')](handleEntityNotFound(_0x47df25,null))['then'](function(_0x30774b){if(_0x30774b){var _0x438463=require(_0x7140('0x54'))();_0x438463['openSync'](_0x30774b[_0x7140('0x55')]);_0x438463[_0x7140('0x56')]();return _0x30774b;}})[_0x7140('0x26')](respondWithResult(_0x47df25,null))['catch'](handleError(_0x47df25,null));};
\ No newline at end of file
index 0d7dd0e..8e6ebc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x686c=['square_odbc','lodash','../../config/logger','api','request-promise','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x12225f,_0x2a42fd){var _0x1a7a4f=function(_0xba7d6b){while(--_0xba7d6b){_0x12225f['push'](_0x12225f['shift']());}};_0x1a7a4f(++_0x2a42fd);}(_0x686c,0x1de));var _0xc686=function(_0x435f71,_0x2ff13d){_0x435f71=_0x435f71-0x0;var _0x6811ae=_0x686c[_0x435f71];return _0x6811ae;};'use strict';var _=require(_0xc686('0x0'));var util=require('util');var logger=require(_0xc686('0x1'))(_0xc686('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc686('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc686('0x4'));module[_0xc686('0x5')]=function(_0x4caa2,_0x1d6ad6){return _0x4caa2[_0xc686('0x6')](_0xc686('0x7'),attributes,{'tableName':_0xc686('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed2c=['exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0xed2c,0x10c));var _0xced2=function(_0x10e2c9,_0x489aab){_0x10e2c9=_0x10e2c9-0x0;var _0x426947=_0xed2c[_0x10e2c9];return _0x426947;};'use strict';var _=require(_0xced2('0x0'));var util=require(_0xced2('0x1'));var logger=require(_0xced2('0x2'))(_0xced2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xced2('0x5'));var config=require(_0xced2('0x6'));var attributes=require(_0xced2('0x7'));module[_0xced2('0x8')]=function(_0x2fdbe9,_0x20062f){return _0x2fdbe9[_0xced2('0x9')](_0xced2('0xa'),attributes,{'tableName':_0xced2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b01c24a..a41ff01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc0e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','map','model','stringify','util','moment'];(function(_0x5c8026,_0xc97d65){var _0x1eaf51=function(_0x54694c){while(--_0x54694c){_0x5c8026['push'](_0x5c8026['shift']());}};_0x1eaf51(++_0xc97d65);}(_0xcc0e,0x1de));var _0xecc0=function(_0x36f784,_0x1aac6d){_0x36f784=_0x36f784-0x0;var _0x273a04=_0xcc0e[_0x36f784];return _0x273a04;};'use strict';var _=require('lodash');var util=require(_0xecc0('0x0'));var moment=require(_0xecc0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecc0('0x2'));var db=require(_0xecc0('0x3'))['db'];var utils=require(_0xecc0('0x4'));var logger=require(_0xecc0('0x5'))('rpc');var config=require(_0xecc0('0x6'));var jayson=require(_0xecc0('0x7'));var client=jayson[_0xecc0('0x8')][_0xecc0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45c8b1,_0x48e097,_0x3ffa30){return new BPromise(function(_0x174d04,_0x4ee9a4){return client[_0xecc0('0xa')](_0x45c8b1,_0x3ffa30)[_0xecc0('0xb')](function(_0xf52478){logger['info'](_0xecc0('0xc'),_0x48e097,_0xecc0('0xd'));logger[_0xecc0('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x48e097,'request\x20sent',JSON['stringify'](_0xf52478));if(_0xf52478[_0xecc0('0xf')]){if(_0xf52478['error'][_0xecc0('0x10')]===0x1f4){logger[_0xecc0('0xf')](_0xecc0('0xc'),_0x48e097,_0xf52478[_0xecc0('0xf')][_0xecc0('0x11')]);return _0x4ee9a4(_0xf52478[_0xecc0('0xf')][_0xecc0('0x11')]);}logger[_0xecc0('0xf')](_0xecc0('0xc'),_0x48e097,_0xf52478['error'][_0xecc0('0x11')]);return _0x174d04(_0xf52478['error'][_0xecc0('0x11')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x48e097,_0xecc0('0xd'));_0x174d04(_0xf52478[_0xecc0('0x12')][_0xecc0('0x11')]);}})[_0xecc0('0x13')](function(_0x105c88){logger[_0xecc0('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x48e097,_0x105c88);_0x4ee9a4(_0x105c88);});});}exports[_0xecc0('0x14')]=function(_0x1f3780){var _0x713ebc=this;return new Promise(function(_0x243ce8,_0x35764d){return db[_0xecc0('0x15')]['find']({'raw':_0x1f3780[_0xecc0('0x16')]?_0x1f3780[_0xecc0('0x16')][_0xecc0('0x17')]===undefined?!![]:![]:!![],'where':_0x1f3780[_0xecc0('0x16')]?_0x1f3780[_0xecc0('0x16')][_0xecc0('0x18')]||null:null,'attributes':_0x1f3780[_0xecc0('0x16')]?_0x1f3780['options'][_0xecc0('0x19')]||null:null,'include':_0x1f3780['options']?_0x1f3780[_0xecc0('0x16')][_0xecc0('0x1a')]?_[_0xecc0('0x1b')](_0x1f3780[_0xecc0('0x16')]['include'],function(_0x5b7d57){return{'model':db[_0x5b7d57[_0xecc0('0x1c')]],'as':_0x5b7d57['as'],'attributes':_0x5b7d57[_0xecc0('0x19')],'include':_0x5b7d57[_0xecc0('0x1a')]?_[_0xecc0('0x1b')](_0x5b7d57['include'],function(_0xad889){return{'model':db[_0xad889[_0xecc0('0x1c')]],'as':_0xad889['as'],'attributes':_0xad889[_0xecc0('0x19')],'include':_0xad889[_0xecc0('0x1a')]?_[_0xecc0('0x1b')](_0xad889[_0xecc0('0x1a')],function(_0x1846e0){return{'model':db[_0x1846e0[_0xecc0('0x1c')]],'as':_0x1846e0['as'],'attributes':_0x1846e0['attributes']};}):[]};}):[]};}):[]:[]})[_0xecc0('0xb')](function(_0x1a47d4){logger['info'](_0xecc0('0x14'),_0x1f3780);logger[_0xecc0('0xe')](_0xecc0('0x14'),_0x1f3780,JSON[_0xecc0('0x1d')](_0x1a47d4));_0x243ce8(_0x1a47d4);})[_0xecc0('0x13')](function(_0x2cadcd){logger[_0xecc0('0xf')](_0xecc0('0x14'),_0x2cadcd[_0xecc0('0x11')],_0x1f3780);_0x35764d(_0x713ebc[_0xecc0('0xf')](0x1f4,_0x2cadcd['message']));});});};
\ No newline at end of file
+var _0x5172=['map','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','model'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x5172,0xf0));var _0x2517=function(_0x8320e8,_0x26030f){_0x8320e8=_0x8320e8-0x0;var _0xd04d0=_0x5172[_0x8320e8];return _0xd04d0;};'use strict';var _=require('lodash');var util=require(_0x2517('0x0'));var moment=require(_0x2517('0x1'));var BPromise=require('bluebird');var rs=require(_0x2517('0x2'));var fs=require('fs');var Redis=require(_0x2517('0x3'));var db=require(_0x2517('0x4'))['db'];var utils=require(_0x2517('0x5'));var logger=require(_0x2517('0x6'))(_0x2517('0x7'));var config=require(_0x2517('0x8'));var jayson=require(_0x2517('0x9'));var client=jayson[_0x2517('0xa')][_0x2517('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11c80c,_0x30bc2f,_0x4d8891){return new BPromise(function(_0xa8587d,_0x5394b4){return client[_0x2517('0xc')](_0x11c80c,_0x4d8891)[_0x2517('0xd')](function(_0x402175){logger[_0x2517('0xe')](_0x2517('0xf'),_0x30bc2f,_0x2517('0x10'));logger['debug'](_0x2517('0x11'),_0x30bc2f,_0x2517('0x10'),JSON[_0x2517('0x12')](_0x402175));if(_0x402175[_0x2517('0x13')]){if(_0x402175[_0x2517('0x13')][_0x2517('0x14')]===0x1f4){logger['error'](_0x2517('0xf'),_0x30bc2f,_0x402175['error'][_0x2517('0x15')]);return _0x5394b4(_0x402175[_0x2517('0x13')][_0x2517('0x15')]);}logger[_0x2517('0x13')](_0x2517('0xf'),_0x30bc2f,_0x402175[_0x2517('0x13')]['message']);return _0xa8587d(_0x402175[_0x2517('0x13')][_0x2517('0x15')]);}else{logger[_0x2517('0xe')](_0x2517('0xf'),_0x30bc2f,'request\x20sent');_0xa8587d(_0x402175[_0x2517('0x16')][_0x2517('0x15')]);}})[_0x2517('0x17')](function(_0x3e8066){logger[_0x2517('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x30bc2f,_0x3e8066);_0x5394b4(_0x3e8066);});});}exports[_0x2517('0x18')]=function(_0x42a73c){var _0x492040=this;return new Promise(function(_0xa4ad55,_0x6cf6ec){return db[_0x2517('0x19')][_0x2517('0x1a')]({'raw':_0x42a73c[_0x2517('0x1b')]?_0x42a73c['options'][_0x2517('0x1c')]===undefined?!![]:![]:!![],'where':_0x42a73c[_0x2517('0x1b')]?_0x42a73c[_0x2517('0x1b')]['where']||null:null,'attributes':_0x42a73c['options']?_0x42a73c['options'][_0x2517('0x1d')]||null:null,'include':_0x42a73c[_0x2517('0x1b')]?_0x42a73c['options']['include']?_['map'](_0x42a73c[_0x2517('0x1b')][_0x2517('0x1e')],function(_0x298945){return{'model':db[_0x298945[_0x2517('0x1f')]],'as':_0x298945['as'],'attributes':_0x298945[_0x2517('0x1d')],'include':_0x298945[_0x2517('0x1e')]?_[_0x2517('0x20')](_0x298945[_0x2517('0x1e')],function(_0x218a82){return{'model':db[_0x218a82['model']],'as':_0x218a82['as'],'attributes':_0x218a82[_0x2517('0x1d')],'include':_0x218a82['include']?_[_0x2517('0x20')](_0x218a82[_0x2517('0x1e')],function(_0x2f473d){return{'model':db[_0x2f473d[_0x2517('0x1f')]],'as':_0x2f473d['as'],'attributes':_0x2f473d[_0x2517('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2517('0xd')](function(_0x11db3a){logger['info'](_0x2517('0x18'),_0x42a73c);logger[_0x2517('0x21')](_0x2517('0x18'),_0x42a73c,JSON[_0x2517('0x12')](_0x11db3a));_0xa4ad55(_0x11db3a);})[_0x2517('0x17')](function(_0x627e83){logger['error'](_0x2517('0x18'),_0x627e83['message'],_0x42a73c);_0x6cf6ec(_0x492040['error'](0x1f4,_0x627e83[_0x2517('0x15')]));});});};
\ No newline at end of file
index 3672a00..8bfe4ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5388=['post','create','addUsers','put','delete','destroy','removeUsers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','get','/:id/users','getUsers'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x5388,0xee));var _0x8538=function(_0x55e546,_0x3bb6e3){_0x55e546=_0x55e546-0x0;var _0x58ff94=_0x5388[_0x55e546];return _0x58ff94;};'use strict';var multer=require(_0x8538('0x0'));var util=require(_0x8538('0x1'));var path=require(_0x8538('0x2'));var timeout=require(_0x8538('0x3'));var express=require(_0x8538('0x4'));var router=express[_0x8538('0x5')]();var fs_extra=require(_0x8538('0x6'));var auth=require(_0x8538('0x7'));var interaction=require(_0x8538('0x8'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router['get']('/',auth[_0x8538('0x9')](),controller['index']);router['get'](_0x8538('0xa'),auth[_0x8538('0x9')](),controller['show']);router[_0x8538('0xb')](_0x8538('0xc'),auth['isAuthenticated'](),controller[_0x8538('0xd')]);router[_0x8538('0xe')]('/',auth[_0x8538('0x9')](),controller[_0x8538('0xf')]);router[_0x8538('0xe')](_0x8538('0xc'),auth[_0x8538('0x9')](),controller[_0x8538('0x10')]);router[_0x8538('0x11')](_0x8538('0xa'),auth[_0x8538('0x9')](),controller['update']);router[_0x8538('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8538('0x13')]);router[_0x8538('0x12')](_0x8538('0xc'),auth[_0x8538('0x9')](),controller[_0x8538('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xbac1=['./squareProject.controller','get','/:id','show','/:id/users','getUsers','post','isAuthenticated','create','addUsers','put','update','delete','removeUsers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbac1,0x17f));var _0x1bac=function(_0x5df543,_0x6d1a24){_0x5df543=_0x5df543-0x0;var _0x20a242=_0xbac1[_0x5df543];return _0x20a242;};'use strict';var multer=require('multer');var util=require(_0x1bac('0x0'));var path=require(_0x1bac('0x1'));var timeout=require(_0x1bac('0x2'));var express=require(_0x1bac('0x3'));var router=express[_0x1bac('0x4')]();var fs_extra=require(_0x1bac('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1bac('0x6'));var config=require(_0x1bac('0x7'));var controller=require(_0x1bac('0x8'));router[_0x1bac('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1bac('0x9')](_0x1bac('0xa'),auth['isAuthenticated'](),controller[_0x1bac('0xb')]);router[_0x1bac('0x9')](_0x1bac('0xc'),auth['isAuthenticated'](),controller[_0x1bac('0xd')]);router[_0x1bac('0xe')]('/',auth[_0x1bac('0xf')](),controller[_0x1bac('0x10')]);router['post'](_0x1bac('0xc'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x11')]);router[_0x1bac('0x12')](_0x1bac('0xa'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x13')]);router[_0x1bac('0x14')]('/:id',auth[_0x1bac('0xf')](),controller['destroy']);router['delete'](_0x1bac('0xc'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x15')]);module[_0x1bac('0x16')]=router;
\ No newline at end of file
index 64f49dc..6ca645c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7d5=['DATE','sequelize','STRING','name','TEXT','getDataValue','preproduction','toString','utf8','BLOB','long'];(function(_0x4deb73,_0x55852){var _0x336abd=function(_0x2c4d79){while(--_0x2c4d79){_0x4deb73['push'](_0x4deb73['shift']());}};_0x336abd(++_0x55852);}(_0xc7d5,0x156));var _0x5c7d=function(_0x557b16,_0x1a9f38){_0x557b16=_0x557b16-0x0;var _0x43725d=_0xc7d5[_0x557b16];return _0x43725d;};'use strict';var Sequelize=require(_0x5c7d('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c7d('0x1')],'unique':_0x5c7d('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x5c7d('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x5c7d('0x4')](_0x5c7d('0x5'))){return this[_0x5c7d('0x4')](_0x5c7d('0x5'))[_0x5c7d('0x6')](_0x5c7d('0x7'));}}},'production':{'type':Sequelize[_0x5c7d('0x8')](_0x5c7d('0x9')),'get':function(){if(this[_0x5c7d('0x4')]('production')){return this[_0x5c7d('0x4')]('production')['toString'](_0x5c7d('0x7'));}}},'savedAt':{'type':Sequelize[_0x5c7d('0xa')]},'publishedAt':{'type':Sequelize[_0x5c7d('0xa')]}};
\ No newline at end of file
+var _0x5226=['utf8','production','DATE','sequelize','exports','STRING','name','BLOB','long','getDataValue','toString'];(function(_0x2401d2,_0x57caea){var _0x17c81f=function(_0x43259f){while(--_0x43259f){_0x2401d2['push'](_0x2401d2['shift']());}};_0x17c81f(++_0x57caea);}(_0x5226,0x137));var _0x6522=function(_0x3a9973,_0x24726b){_0x3a9973=_0x3a9973-0x0;var _0x3d26a8=_0x5226[_0x3a9973];return _0x3d26a8;};'use strict';var Sequelize=require(_0x6522('0x0'));module[_0x6522('0x1')]={'name':{'type':Sequelize[_0x6522('0x2')],'unique':_0x6522('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6522('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x6522('0x4')](_0x6522('0x5')),'get':function(){if(this[_0x6522('0x6')]('preproduction')){return this[_0x6522('0x6')]('preproduction')[_0x6522('0x7')](_0x6522('0x8'));}}},'production':{'type':Sequelize[_0x6522('0x4')](_0x6522('0x5')),'get':function(){if(this[_0x6522('0x6')](_0x6522('0x9'))){return this[_0x6522('0x6')]('production')['toString'](_0x6522('0x8'));}}},'savedAt':{'type':Sequelize[_0x6522('0xa')]},'publishedAt':{'type':Sequelize[_0x6522('0xa')]}};
\ No newline at end of file
index e3b169e..f0b8443 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4693=['UserProfileSection','userProfileId','autoAssociation','error','params','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./squareProject.socket','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','SquareProjects','UserProfileResource','end','stack','name','index','map','SquareProject','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','keys','rawAttributes','filters','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0xce0d56,_0x24f363){var _0x1703c5=function(_0x22ef2b){while(--_0x22ef2b){_0xce0d56['push'](_0xce0d56['shift']());}};_0x1703c5(++_0x24f363);}(_0x4693,0xca));var _0x3469=function(_0x40d59f,_0x23175e){_0x40d59f=_0x40d59f-0x0;var _0xaa6a83=_0x4693[_0x40d59f];return _0xaa6a83;};'use strict';var emlformat=require(_0x3469('0x0'));var rimraf=require(_0x3469('0x1'));var zipdir=require(_0x3469('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3469('0x3'));var BPromise=require(_0x3469('0x4'));var Mustache=require(_0x3469('0x5'));var util=require(_0x3469('0x6'));var path=require(_0x3469('0x7'));var sox=require(_0x3469('0x8'));var csv=require(_0x3469('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3469('0xa'));var squel=require(_0x3469('0xb'));var crypto=require(_0x3469('0xc'));var jsforce=require(_0x3469('0xd'));var deskjs=require(_0x3469('0xe'));var toCsv=require(_0x3469('0x9'));var querystring=require('querystring');var Papa=require(_0x3469('0xf'));var Redis=require(_0x3469('0x10'));var authService=require(_0x3469('0x11'));var qs=require(_0x3469('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3469('0x13'))(_0x3469('0x14'));var utils=require(_0x3469('0x15'));var config=require(_0x3469('0x16'));var licenseUtil=require(_0x3469('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3469('0x18')](config[_0x3469('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3469('0x19')]));require(_0x3469('0x1a'))['register'](socket);function respondWithStatusCode(_0x2b6e25,_0x59cf47){_0x59cf47=_0x59cf47||0xcc;return function(_0x13ed47){if(_0x13ed47){return _0x2b6e25['sendStatus'](_0x59cf47);}return _0x2b6e25[_0x3469('0x1b')](_0x59cf47)['end']();};}function respondWithResult(_0x1a0eb5,_0xf8c865){_0xf8c865=_0xf8c865||0xc8;return function(_0x49e9e8){if(_0x49e9e8){return _0x1a0eb5[_0x3469('0x1b')](_0xf8c865)[_0x3469('0x1c')](_0x49e9e8);}};}function respondWithFilteredResult(_0x5cec3f,_0x56ea1e){return function(_0x46c8d2){if(_0x46c8d2){var _0x33ca67=typeof _0x56ea1e[_0x3469('0x1d')]===_0x3469('0x1e')&&typeof _0x56ea1e[_0x3469('0x1f')]===_0x3469('0x1e');var _0x217c0d=_0x46c8d2[_0x3469('0x20')];var _0x20db8d=_0x33ca67?0x0:_0x56ea1e[_0x3469('0x1d')];var _0x9ca1bd=_0x33ca67?_0x46c8d2[_0x3469('0x20')]:_0x56ea1e['offset']+_0x56ea1e['limit'];var _0x230df8;if(_0x9ca1bd>=_0x217c0d){_0x9ca1bd=_0x217c0d;_0x230df8=0xc8;}else{_0x230df8=0xce;}_0x5cec3f[_0x3469('0x1b')](_0x230df8);return _0x5cec3f['set'](_0x3469('0x21'),_0x20db8d+'-'+_0x9ca1bd+'/'+_0x217c0d)[_0x3469('0x1c')](_0x46c8d2);}return null;};}function patchUpdates(_0x551651){return function(_0x4a4256){try{jsonpatch[_0x3469('0x22')](_0x4a4256,_0x551651,!![]);}catch(_0x137571){return BPromise[_0x3469('0x23')](_0x137571);}return _0x4a4256[_0x3469('0x24')]();};}function saveUpdates(_0x46017a,_0x513d67){return function(_0x561c61){if(_0x561c61){return _0x561c61['update'](_0x46017a)[_0x3469('0x25')](function(_0x239af0){return _0x239af0;});}return null;};}function removeEntity(_0x51ba6d,_0x4e4dcd){return function(_0x202aba){if(_0x202aba){return _0x202aba[_0x3469('0x26')]()[_0x3469('0x25')](function(){var _0x1fce3c=_0x202aba[_0x3469('0x27')]({'plain':!![]});var _0x573cd5=_0x3469('0x28');return db[_0x3469('0x29')][_0x3469('0x26')]({'where':{'type':_0x573cd5,'resourceId':_0x1fce3c['id']}})['then'](function(){return _0x202aba;});})['then'](function(){_0x51ba6d[_0x3469('0x1b')](0xcc)[_0x3469('0x2a')]();});}};}function handleEntityNotFound(_0x48f280,_0x43ff54){return function(_0x2aff82){if(!_0x2aff82){_0x48f280['sendStatus'](0x194);}return _0x2aff82;};}function handleError(_0x275b75,_0x1b1efe){_0x1b1efe=_0x1b1efe||0x1f4;return function(_0x12d201){logger['error'](_0x12d201[_0x3469('0x2b')]);if(_0x12d201['name']){delete _0x12d201[_0x3469('0x2c')];}_0x275b75[_0x3469('0x1b')](_0x1b1efe)['send'](_0x12d201);};}exports[_0x3469('0x2d')]=function(_0xa24ac4,_0x4c3e65){var _0x271f9e={},_0x169dcf={},_0x480e4a={'count':0x0,'rows':[]};var _0x2df185=_[_0x3469('0x2e')](db[_0x3469('0x2f')]['rawAttributes'],function(_0x143cad){return{'name':_0x143cad[_0x3469('0x30')],'type':_0x143cad[_0x3469('0x31')]['key']};});_0x169dcf[_0x3469('0x32')]=_[_0x3469('0x2e')](_0x2df185,_0x3469('0x2c'));_0x169dcf[_0x3469('0x33')]=_['keys'](_0xa24ac4[_0x3469('0x33')]);_0x169dcf['filters']=_[_0x3469('0x34')](_0x169dcf['model'],_0x169dcf['query']);_0x271f9e[_0x3469('0x35')]=_[_0x3469('0x34')](_0x169dcf[_0x3469('0x32')],qs[_0x3469('0x36')](_0xa24ac4[_0x3469('0x33')][_0x3469('0x36')]));_0x271f9e[_0x3469('0x35')]=_0x271f9e[_0x3469('0x35')][_0x3469('0x37')]?_0x271f9e['attributes']:_0x169dcf[_0x3469('0x32')];if(!_0xa24ac4[_0x3469('0x33')][_0x3469('0x38')](_0x3469('0x39'))){_0x271f9e[_0x3469('0x1f')]=qs['limit'](_0xa24ac4[_0x3469('0x33')][_0x3469('0x1f')]);_0x271f9e[_0x3469('0x1d')]=qs[_0x3469('0x1d')](_0xa24ac4['query'][_0x3469('0x1d')]);}_0x271f9e[_0x3469('0x3a')]=qs[_0x3469('0x3b')](_0xa24ac4[_0x3469('0x33')][_0x3469('0x3b')]);_0x271f9e[_0x3469('0x3c')]=qs['filters'](_[_0x3469('0x3d')](_0xa24ac4['query'],_0x169dcf['filters']),_0x2df185);if(_0xa24ac4[_0x3469('0x33')][_0x3469('0x3e')]){_0x271f9e['where']=_[_0x3469('0x3f')](_0x271f9e['where'],{'$or':_[_0x3469('0x2e')](_0x2df185,function(_0x5631b1){if(_0x5631b1[_0x3469('0x31')]!==_0x3469('0x40')){var _0x3297e2={};_0x3297e2[_0x5631b1['name']]={'$like':'%'+_0xa24ac4['query'][_0x3469('0x3e')]+'%'};return _0x3297e2;}})});}_0x271f9e=_[_0x3469('0x3f')]({},_0x271f9e,_0xa24ac4['options']);var _0x2dfb0c={'where':_0x271f9e[_0x3469('0x3c')]};return db[_0x3469('0x2f')]['count'](_0x2dfb0c)[_0x3469('0x25')](function(_0xb9437d){_0x480e4a['count']=_0xb9437d;if(_0xa24ac4[_0x3469('0x33')]['includeAll']){_0x271f9e[_0x3469('0x41')]=[{'all':!![]}];}return db[_0x3469('0x2f')][_0x3469('0x42')](_0x271f9e);})[_0x3469('0x25')](function(_0x308fb2){_0x480e4a[_0x3469('0x43')]=_0x308fb2;return _0x480e4a;})[_0x3469('0x25')](respondWithFilteredResult(_0x4c3e65,_0x271f9e))[_0x3469('0x44')](handleError(_0x4c3e65,null));};exports['show']=function(_0x37e0ee,_0x4fe105){var _0xf4209b={'raw':![],'where':{'id':_0x37e0ee['params']['id']}},_0x3584ea={};_0x3584ea[_0x3469('0x32')]=_[_0x3469('0x45')](db[_0x3469('0x2f')][_0x3469('0x46')]);_0x3584ea[_0x3469('0x33')]=_['keys'](_0x37e0ee[_0x3469('0x33')]);_0x3584ea[_0x3469('0x47')]=_['intersection'](_0x3584ea['model'],_0x3584ea[_0x3469('0x33')]);_0xf4209b[_0x3469('0x35')]=_[_0x3469('0x34')](_0x3584ea[_0x3469('0x32')],qs[_0x3469('0x36')](_0x37e0ee[_0x3469('0x33')][_0x3469('0x36')]));_0xf4209b[_0x3469('0x35')]=_0xf4209b[_0x3469('0x35')][_0x3469('0x37')]?_0xf4209b[_0x3469('0x35')]:_0x3584ea[_0x3469('0x32')];if(_0x37e0ee[_0x3469('0x33')][_0x3469('0x48')]){_0xf4209b[_0x3469('0x41')]=[{'all':!![]}];}_0xf4209b=_[_0x3469('0x3f')]({},_0xf4209b,_0x37e0ee[_0x3469('0x49')]);return db['SquareProject'][_0x3469('0x4a')](_0xf4209b)['then'](handleEntityNotFound(_0x4fe105,null))[_0x3469('0x25')](respondWithResult(_0x4fe105,null))['catch'](handleError(_0x4fe105,null));};exports[_0x3469('0x4b')]=function(_0x5a87ce,_0x127f7a){return db[_0x3469('0x2f')]['create'](_0x5a87ce[_0x3469('0x4c')],{})[_0x3469('0x25')](function(_0x41d95a){var _0x481044=_0x5a87ce['user']['get']({'plain':!![]});if(!_0x481044)throw new Error(_0x3469('0x4d'));if(_0x481044[_0x3469('0x4e')]===_0x3469('0x4f')){var _0x11a174=_0x41d95a[_0x3469('0x27')]({'plain':!![]});var _0x208fe0=_0x3469('0x28');return db[_0x3469('0x50')][_0x3469('0x4a')]({'where':{'name':_0x208fe0,'userProfileId':_0x481044[_0x3469('0x51')]},'raw':!![]})[_0x3469('0x25')](function(_0x37bdac){if(_0x37bdac&&_0x37bdac[_0x3469('0x52')]===0x0){return db[_0x3469('0x29')][_0x3469('0x4b')]({'name':_0x11a174[_0x3469('0x2c')],'resourceId':_0x11a174['id'],'type':_0x37bdac[_0x3469('0x2c')],'sectionId':_0x37bdac['id']},{})['then'](function(){return _0x41d95a;});}else{return _0x41d95a;}})['catch'](function(_0x5cfc9c){logger[_0x3469('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cfc9c);throw _0x5cfc9c;});}return _0x41d95a;})['then'](respondWithResult(_0x127f7a,0xc9))[_0x3469('0x44')](handleError(_0x127f7a,null));};exports['update']=function(_0x569149,_0x5edc9f){if(_0x569149[_0x3469('0x4c')]['id']){delete _0x569149[_0x3469('0x4c')]['id'];}return db['SquareProject'][_0x3469('0x4a')]({'where':{'id':_0x569149[_0x3469('0x54')]['id']}})['then'](handleEntityNotFound(_0x5edc9f,null))['then'](saveUpdates(_0x569149['body'],null))[_0x3469('0x25')](respondWithResult(_0x5edc9f,null))[_0x3469('0x44')](handleError(_0x5edc9f,null));};exports[_0x3469('0x26')]=function(_0x443d5d,_0x371b19){return db[_0x3469('0x2f')][_0x3469('0x4a')]({'where':{'id':_0x443d5d[_0x3469('0x54')]['id']}})[_0x3469('0x25')](handleEntityNotFound(_0x371b19,null))[_0x3469('0x25')](removeEntity(_0x371b19,null))['catch'](handleError(_0x371b19,null));};exports[_0x3469('0x55')]=function(_0x3e9949,_0x1e1c67,_0x293b95){return db['SquareProject']['find']({'where':{'id':_0x3e9949[_0x3469('0x54')]['id']}})[_0x3469('0x25')](handleEntityNotFound(_0x1e1c67,null))['then'](function(_0x32ed8a){if(_0x32ed8a){return _0x32ed8a['addUsers'](_0x3e9949[_0x3469('0x4c')][_0x3469('0x56')],_[_0x3469('0x57')](_0x3e9949['body'],['ids','id'])||{});}})[_0x3469('0x25')](respondWithResult(_0x1e1c67,null))['catch'](handleError(_0x1e1c67,null));};exports[_0x3469('0x58')]=function(_0x2f6f6b,_0x3db4c8,_0x421500){return db['SquareProject']['find']({'where':{'id':_0x2f6f6b[_0x3469('0x54')]['id']}})[_0x3469('0x25')](handleEntityNotFound(_0x3db4c8,null))[_0x3469('0x25')](function(_0x315aac){if(_0x315aac){return _0x315aac[_0x3469('0x58')](_0x2f6f6b[_0x3469('0x33')][_0x3469('0x56')])['then'](function(){if(_['isArray'](_0x2f6f6b[_0x3469('0x33')][_0x3469('0x56')])){for(var _0x193c4e=0x0;_0x193c4e<_0x2f6f6b['query'][_0x3469('0x56')][_0x3469('0x37')];_0x193c4e+=0x1){socket[_0x3469('0x59')](_0x3469('0x5a'),{'UserId':Number(_0x2f6f6b[_0x3469('0x33')][_0x3469('0x56')][_0x193c4e]),'SquareProjectId':Number(_0x2f6f6b[_0x3469('0x54')]['id'])});}}else{socket[_0x3469('0x59')](_0x3469('0x5a'),{'UserId':Number(_0x2f6f6b[_0x3469('0x33')][_0x3469('0x56')]),'SquareProjectId':Number(_0x2f6f6b[_0x3469('0x54')]['id'])});}});}})[_0x3469('0x25')](respondWithStatusCode(_0x3db4c8,null))[_0x3469('0x44')](handleError(_0x3db4c8,null));};exports[_0x3469('0x5b')]=function(_0x3451b2,_0x1ee82b,_0x3bdb07){var _0x28df0d={};var _0x1d6066={};var _0x3a3d14;var _0x19f357;return db['SquareProject'][_0x3469('0x5c')]({'where':{'id':_0x3451b2[_0x3469('0x54')]['id']}})[_0x3469('0x25')](handleEntityNotFound(_0x1ee82b,null))[_0x3469('0x25')](function(_0x1db7fc){if(_0x1db7fc){_0x3a3d14=_0x1db7fc;_0x1d6066[_0x3469('0x32')]=_['keys'](db[_0x3469('0x5d')][_0x3469('0x46')]);_0x1d6066['query']=_[_0x3469('0x45')](_0x3451b2[_0x3469('0x33')]);_0x1d6066[_0x3469('0x47')]=_['intersection'](_0x1d6066[_0x3469('0x32')],_0x1d6066[_0x3469('0x33')]);_0x28df0d[_0x3469('0x35')]=_[_0x3469('0x34')](_0x1d6066[_0x3469('0x32')],qs[_0x3469('0x36')](_0x3451b2[_0x3469('0x33')][_0x3469('0x36')]));_0x28df0d['attributes']=_0x28df0d[_0x3469('0x35')][_0x3469('0x37')]?_0x28df0d[_0x3469('0x35')]:_0x1d6066[_0x3469('0x32')];_0x28df0d[_0x3469('0x3a')]=qs[_0x3469('0x3b')](_0x3451b2[_0x3469('0x33')][_0x3469('0x3b')]);_0x28df0d[_0x3469('0x3c')]=qs[_0x3469('0x47')](_[_0x3469('0x3d')](_0x3451b2[_0x3469('0x33')],_0x1d6066[_0x3469('0x47')]));if(_0x3451b2[_0x3469('0x33')][_0x3469('0x3e')]){_0x28df0d[_0x3469('0x3c')]=_[_0x3469('0x3f')](_0x28df0d[_0x3469('0x3c')],{'$or':_[_0x3469('0x2e')](_0x28df0d[_0x3469('0x35')],function(_0x220b40){var _0xa3de9={};_0xa3de9[_0x220b40]={'$like':'%'+_0x3451b2[_0x3469('0x33')][_0x3469('0x3e')]+'%'};return _0xa3de9;})});}_0x28df0d=_['merge']({},_0x28df0d,_0x3451b2[_0x3469('0x49')]);return _0x3a3d14[_0x3469('0x5b')](_0x28df0d);}})[_0x3469('0x25')](function(_0x5dab90){if(_0x5dab90){_0x19f357=_0x5dab90['length'];if(!_0x3451b2[_0x3469('0x33')][_0x3469('0x38')]('nolimit')){_0x28df0d[_0x3469('0x1f')]=qs[_0x3469('0x1f')](_0x3451b2[_0x3469('0x33')][_0x3469('0x1f')]);_0x28df0d[_0x3469('0x1d')]=qs[_0x3469('0x1d')](_0x3451b2[_0x3469('0x33')][_0x3469('0x1d')]);}return _0x3a3d14[_0x3469('0x5b')](_0x28df0d);}})[_0x3469('0x25')](function(_0x18af18){if(_0x18af18){return _0x18af18?{'count':_0x19f357,'rows':_0x18af18}:null;}})[_0x3469('0x25')](respondWithResult(_0x1ee82b,null))['catch'](handleError(_0x1ee82b,null));};
\ No newline at end of file
+var _0x67bc=['util','sox','ejs','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','get','SquareProjects','destroy','end','error','stack','send','index','SquareProject','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','count','includeAll','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','addUsers','omit','removeUsers','isArray','ids','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','request-promise','moment','bluebird'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x67bc,0x1d7));var _0xc67b=function(_0x3e451f,_0x10500d){_0x3e451f=_0x3e451f-0x0;var _0x57978f=_0x67bc[_0x3e451f];return _0x57978f;};'use strict';var emlformat=require(_0xc67b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc67b('0x1'));var moment=require(_0xc67b('0x2'));var BPromise=require(_0xc67b('0x3'));var Mustache=require('mustache');var util=require(_0xc67b('0x4'));var path=require('path');var sox=require(_0xc67b('0x5'));var csv=require('to-csv');var ejs=require(_0xc67b('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc67b('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc67b('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xc67b('0x9'));var querystring=require(_0xc67b('0xa'));var Papa=require(_0xc67b('0xb'));var Redis=require(_0xc67b('0xc'));var authService=require(_0xc67b('0xd'));var qs=require(_0xc67b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc67b('0xf'));var logger=require(_0xc67b('0x10'))('api');var utils=require(_0xc67b('0x11'));var config=require(_0xc67b('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc67b('0x13')]=_['defaults'](config[_0xc67b('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xc67b('0x14'))(new Redis(config[_0xc67b('0x13')]));require(_0xc67b('0x15'))[_0xc67b('0x16')](socket);function respondWithStatusCode(_0x25e256,_0x5685b3){_0x5685b3=_0x5685b3||0xcc;return function(_0x3865e7){if(_0x3865e7){return _0x25e256[_0xc67b('0x17')](_0x5685b3);}return _0x25e256[_0xc67b('0x18')](_0x5685b3)['end']();};}function respondWithResult(_0x237921,_0x57549a){_0x57549a=_0x57549a||0xc8;return function(_0x4d444c){if(_0x4d444c){return _0x237921[_0xc67b('0x18')](_0x57549a)[_0xc67b('0x19')](_0x4d444c);}};}function respondWithFilteredResult(_0x1537e2,_0x21025e){return function(_0x5bc036){if(_0x5bc036){var _0x254712=typeof _0x21025e['offset']===_0xc67b('0x1a')&&typeof _0x21025e[_0xc67b('0x1b')]===_0xc67b('0x1a');var _0x2c8b02=_0x5bc036['count'];var _0x3db8c3=_0x254712?0x0:_0x21025e[_0xc67b('0x1c')];var _0x204653=_0x254712?_0x5bc036['count']:_0x21025e['offset']+_0x21025e[_0xc67b('0x1b')];var _0x41e87b;if(_0x204653>=_0x2c8b02){_0x204653=_0x2c8b02;_0x41e87b=0xc8;}else{_0x41e87b=0xce;}_0x1537e2['status'](_0x41e87b);return _0x1537e2[_0xc67b('0x1d')](_0xc67b('0x1e'),_0x3db8c3+'-'+_0x204653+'/'+_0x2c8b02)[_0xc67b('0x19')](_0x5bc036);}return null;};}function patchUpdates(_0x1fd171){return function(_0x1eb6e6){try{jsonpatch[_0xc67b('0x1f')](_0x1eb6e6,_0x1fd171,!![]);}catch(_0x1e00d1){return BPromise[_0xc67b('0x20')](_0x1e00d1);}return _0x1eb6e6[_0xc67b('0x21')]();};}function saveUpdates(_0x1ea884,_0x55ba3d){return function(_0x170300){if(_0x170300){return _0x170300[_0xc67b('0x22')](_0x1ea884)[_0xc67b('0x23')](function(_0x225629){return _0x225629;});}return null;};}function removeEntity(_0x200da4,_0x402487){return function(_0x38642c){if(_0x38642c){return _0x38642c['destroy']()[_0xc67b('0x23')](function(){var _0x26cf3c=_0x38642c[_0xc67b('0x24')]({'plain':!![]});var _0x4aaaa1=_0xc67b('0x25');return db['UserProfileResource'][_0xc67b('0x26')]({'where':{'type':_0x4aaaa1,'resourceId':_0x26cf3c['id']}})[_0xc67b('0x23')](function(){return _0x38642c;});})[_0xc67b('0x23')](function(){_0x200da4[_0xc67b('0x18')](0xcc)[_0xc67b('0x27')]();});}};}function handleEntityNotFound(_0x2ea5dc,_0x5c57fd){return function(_0x1f4ee1){if(!_0x1f4ee1){_0x2ea5dc[_0xc67b('0x17')](0x194);}return _0x1f4ee1;};}function handleError(_0x414e00,_0x3fe238){_0x3fe238=_0x3fe238||0x1f4;return function(_0x3cfa2d){logger[_0xc67b('0x28')](_0x3cfa2d[_0xc67b('0x29')]);if(_0x3cfa2d['name']){delete _0x3cfa2d['name'];}_0x414e00[_0xc67b('0x18')](_0x3fe238)[_0xc67b('0x2a')](_0x3cfa2d);};}exports[_0xc67b('0x2b')]=function(_0x4b3990,_0x2e5158){var _0x512878={},_0x16aa84={},_0x29db6e={'count':0x0,'rows':[]};var _0x4a358c=_['map'](db[_0xc67b('0x2c')][_0xc67b('0x2d')],function(_0x10ce4e){return{'name':_0x10ce4e[_0xc67b('0x2e')],'type':_0x10ce4e[_0xc67b('0x2f')]['key']};});_0x16aa84['model']=_['map'](_0x4a358c,_0xc67b('0x30'));_0x16aa84[_0xc67b('0x31')]=_[_0xc67b('0x32')](_0x4b3990[_0xc67b('0x31')]);_0x16aa84[_0xc67b('0x33')]=_[_0xc67b('0x34')](_0x16aa84[_0xc67b('0x35')],_0x16aa84[_0xc67b('0x31')]);_0x512878[_0xc67b('0x36')]=_[_0xc67b('0x34')](_0x16aa84[_0xc67b('0x35')],qs[_0xc67b('0x37')](_0x4b3990[_0xc67b('0x31')][_0xc67b('0x37')]));_0x512878[_0xc67b('0x36')]=_0x512878['attributes'][_0xc67b('0x38')]?_0x512878[_0xc67b('0x36')]:_0x16aa84[_0xc67b('0x35')];if(!_0x4b3990[_0xc67b('0x31')][_0xc67b('0x39')](_0xc67b('0x3a'))){_0x512878[_0xc67b('0x1b')]=qs[_0xc67b('0x1b')](_0x4b3990['query']['limit']);_0x512878[_0xc67b('0x1c')]=qs['offset'](_0x4b3990[_0xc67b('0x31')][_0xc67b('0x1c')]);}_0x512878[_0xc67b('0x3b')]=qs[_0xc67b('0x3c')](_0x4b3990['query'][_0xc67b('0x3c')]);_0x512878['where']=qs[_0xc67b('0x33')](_[_0xc67b('0x3d')](_0x4b3990[_0xc67b('0x31')],_0x16aa84[_0xc67b('0x33')]),_0x4a358c);if(_0x4b3990[_0xc67b('0x31')][_0xc67b('0x3e')]){_0x512878[_0xc67b('0x3f')]=_[_0xc67b('0x40')](_0x512878[_0xc67b('0x3f')],{'$or':_[_0xc67b('0x41')](_0x4a358c,function(_0x39880f){if(_0x39880f[_0xc67b('0x2f')]!=='VIRTUAL'){var _0x39be24={};_0x39be24[_0x39880f[_0xc67b('0x30')]]={'$like':'%'+_0x4b3990[_0xc67b('0x31')][_0xc67b('0x3e')]+'%'};return _0x39be24;}})});}_0x512878=_[_0xc67b('0x40')]({},_0x512878,_0x4b3990[_0xc67b('0x42')]);var _0x29a6ae={'where':_0x512878['where']};return db['SquareProject'][_0xc67b('0x43')](_0x29a6ae)[_0xc67b('0x23')](function(_0x441986){_0x29db6e['count']=_0x441986;if(_0x4b3990['query'][_0xc67b('0x44')]){_0x512878['include']=[{'all':!![]}];}return db[_0xc67b('0x2c')][_0xc67b('0x45')](_0x512878);})[_0xc67b('0x23')](function(_0x1baacd){_0x29db6e['rows']=_0x1baacd;return _0x29db6e;})[_0xc67b('0x23')](respondWithFilteredResult(_0x2e5158,_0x512878))[_0xc67b('0x46')](handleError(_0x2e5158,null));};exports[_0xc67b('0x47')]=function(_0xd8010b,_0xb45ee0){var _0xa8a977={'raw':![],'where':{'id':_0xd8010b['params']['id']}},_0x8ca6f2={};_0x8ca6f2[_0xc67b('0x35')]=_[_0xc67b('0x32')](db[_0xc67b('0x2c')][_0xc67b('0x2d')]);_0x8ca6f2['query']=_['keys'](_0xd8010b[_0xc67b('0x31')]);_0x8ca6f2[_0xc67b('0x33')]=_[_0xc67b('0x34')](_0x8ca6f2[_0xc67b('0x35')],_0x8ca6f2[_0xc67b('0x31')]);_0xa8a977[_0xc67b('0x36')]=_[_0xc67b('0x34')](_0x8ca6f2[_0xc67b('0x35')],qs[_0xc67b('0x37')](_0xd8010b[_0xc67b('0x31')][_0xc67b('0x37')]));_0xa8a977[_0xc67b('0x36')]=_0xa8a977[_0xc67b('0x36')]['length']?_0xa8a977[_0xc67b('0x36')]:_0x8ca6f2['model'];if(_0xd8010b['query'][_0xc67b('0x44')]){_0xa8a977[_0xc67b('0x48')]=[{'all':!![]}];}_0xa8a977=_[_0xc67b('0x40')]({},_0xa8a977,_0xd8010b[_0xc67b('0x42')]);return db['SquareProject'][_0xc67b('0x49')](_0xa8a977)[_0xc67b('0x23')](handleEntityNotFound(_0xb45ee0,null))[_0xc67b('0x23')](respondWithResult(_0xb45ee0,null))[_0xc67b('0x46')](handleError(_0xb45ee0,null));};exports[_0xc67b('0x4a')]=function(_0x742ba4,_0x54b496){return db['SquareProject'][_0xc67b('0x4a')](_0x742ba4['body'],{})['then'](function(_0x148bc0){var _0x47eeb0=_0x742ba4[_0xc67b('0x4b')][_0xc67b('0x24')]({'plain':!![]});if(!_0x47eeb0)throw new Error(_0xc67b('0x4c'));if(_0x47eeb0[_0xc67b('0x4d')]===_0xc67b('0x4b')){var _0x4800e1=_0x148bc0[_0xc67b('0x24')]({'plain':!![]});var _0x4605c0=_0xc67b('0x25');return db[_0xc67b('0x4e')][_0xc67b('0x49')]({'where':{'name':_0x4605c0,'userProfileId':_0x47eeb0[_0xc67b('0x4f')]},'raw':!![]})[_0xc67b('0x23')](function(_0x2e3382){if(_0x2e3382&&_0x2e3382[_0xc67b('0x50')]===0x0){return db[_0xc67b('0x51')]['create']({'name':_0x4800e1[_0xc67b('0x30')],'resourceId':_0x4800e1['id'],'type':_0x2e3382[_0xc67b('0x30')],'sectionId':_0x2e3382['id']},{})[_0xc67b('0x23')](function(){return _0x148bc0;});}else{return _0x148bc0;}})['catch'](function(_0x89b6c7){logger[_0xc67b('0x28')](_0xc67b('0x52'),_0x89b6c7);throw _0x89b6c7;});}return _0x148bc0;})[_0xc67b('0x23')](respondWithResult(_0x54b496,0xc9))[_0xc67b('0x46')](handleError(_0x54b496,null));};exports[_0xc67b('0x22')]=function(_0x1913d0,_0x1b9625){if(_0x1913d0['body']['id']){delete _0x1913d0['body']['id'];}return db['SquareProject']['find']({'where':{'id':_0x1913d0[_0xc67b('0x53')]['id']}})[_0xc67b('0x23')](handleEntityNotFound(_0x1b9625,null))[_0xc67b('0x23')](saveUpdates(_0x1913d0[_0xc67b('0x54')],null))[_0xc67b('0x23')](respondWithResult(_0x1b9625,null))[_0xc67b('0x46')](handleError(_0x1b9625,null));};exports[_0xc67b('0x26')]=function(_0x5376bf,_0x2aa135){return db[_0xc67b('0x2c')][_0xc67b('0x49')]({'where':{'id':_0x5376bf['params']['id']}})['then'](handleEntityNotFound(_0x2aa135,null))[_0xc67b('0x23')](removeEntity(_0x2aa135,null))[_0xc67b('0x46')](handleError(_0x2aa135,null));};exports[_0xc67b('0x55')]=function(_0x1d74aa,_0x2a73d8,_0x313744){return db['SquareProject'][_0xc67b('0x49')]({'where':{'id':_0x1d74aa[_0xc67b('0x53')]['id']}})[_0xc67b('0x23')](handleEntityNotFound(_0x2a73d8,null))['then'](function(_0xedd32b){if(_0xedd32b){return _0xedd32b['addUsers'](_0x1d74aa[_0xc67b('0x54')]['ids'],_[_0xc67b('0x56')](_0x1d74aa[_0xc67b('0x54')],['ids','id'])||{});}})['then'](respondWithResult(_0x2a73d8,null))['catch'](handleError(_0x2a73d8,null));};exports[_0xc67b('0x57')]=function(_0x2fd07b,_0x3ba549,_0x371dd0){return db['SquareProject'][_0xc67b('0x49')]({'where':{'id':_0x2fd07b[_0xc67b('0x53')]['id']}})[_0xc67b('0x23')](handleEntityNotFound(_0x3ba549,null))['then'](function(_0x179102){if(_0x179102){return _0x179102[_0xc67b('0x57')](_0x2fd07b['query']['ids'])[_0xc67b('0x23')](function(){if(_[_0xc67b('0x58')](_0x2fd07b['query'][_0xc67b('0x59')])){for(var _0x38e646=0x0;_0x38e646<_0x2fd07b['query'][_0xc67b('0x59')]['length'];_0x38e646+=0x1){socket[_0xc67b('0x5a')]('userSquareProject:remove',{'UserId':Number(_0x2fd07b['query'][_0xc67b('0x59')][_0x38e646]),'SquareProjectId':Number(_0x2fd07b['params']['id'])});}}else{socket['emit'](_0xc67b('0x5b'),{'UserId':Number(_0x2fd07b[_0xc67b('0x31')][_0xc67b('0x59')]),'SquareProjectId':Number(_0x2fd07b[_0xc67b('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x3ba549,null))['catch'](handleError(_0x3ba549,null));};exports[_0xc67b('0x5c')]=function(_0x5502e0,_0x342362,_0x3c5064){var _0x5b7765={};var _0x512234={};var _0x47c458;var _0x4e263e;return db['SquareProject'][_0xc67b('0x5d')]({'where':{'id':_0x5502e0['params']['id']}})[_0xc67b('0x23')](handleEntityNotFound(_0x342362,null))['then'](function(_0x2b9412){if(_0x2b9412){_0x47c458=_0x2b9412;_0x512234[_0xc67b('0x35')]=_[_0xc67b('0x32')](db[_0xc67b('0x5e')][_0xc67b('0x2d')]);_0x512234[_0xc67b('0x31')]=_['keys'](_0x5502e0[_0xc67b('0x31')]);_0x512234['filters']=_['intersection'](_0x512234[_0xc67b('0x35')],_0x512234[_0xc67b('0x31')]);_0x5b7765['attributes']=_[_0xc67b('0x34')](_0x512234['model'],qs[_0xc67b('0x37')](_0x5502e0[_0xc67b('0x31')][_0xc67b('0x37')]));_0x5b7765[_0xc67b('0x36')]=_0x5b7765[_0xc67b('0x36')][_0xc67b('0x38')]?_0x5b7765[_0xc67b('0x36')]:_0x512234['model'];_0x5b7765['order']=qs[_0xc67b('0x3c')](_0x5502e0[_0xc67b('0x31')]['sort']);_0x5b7765[_0xc67b('0x3f')]=qs[_0xc67b('0x33')](_[_0xc67b('0x3d')](_0x5502e0[_0xc67b('0x31')],_0x512234['filters']));if(_0x5502e0[_0xc67b('0x31')][_0xc67b('0x3e')]){_0x5b7765['where']=_['merge'](_0x5b7765[_0xc67b('0x3f')],{'$or':_['map'](_0x5b7765[_0xc67b('0x36')],function(_0x451e4a){var _0xf61721={};_0xf61721[_0x451e4a]={'$like':'%'+_0x5502e0[_0xc67b('0x31')][_0xc67b('0x3e')]+'%'};return _0xf61721;})});}_0x5b7765=_['merge']({},_0x5b7765,_0x5502e0['options']);return _0x47c458[_0xc67b('0x5c')](_0x5b7765);}})[_0xc67b('0x23')](function(_0x49773a){if(_0x49773a){_0x4e263e=_0x49773a[_0xc67b('0x38')];if(!_0x5502e0['query'][_0xc67b('0x39')](_0xc67b('0x3a'))){_0x5b7765['limit']=qs[_0xc67b('0x1b')](_0x5502e0[_0xc67b('0x31')]['limit']);_0x5b7765[_0xc67b('0x1c')]=qs[_0xc67b('0x1c')](_0x5502e0[_0xc67b('0x31')][_0xc67b('0x1c')]);}return _0x47c458['getUsers'](_0x5b7765);}})[_0xc67b('0x23')](function(_0x3b79ea){if(_0x3b79ea){return _0x3b79ea?{'count':_0x4e263e,'rows':_0x3b79ea}:null;}})[_0xc67b('0x23')](respondWithResult(_0x342362,null))[_0xc67b('0x46')](handleError(_0x342362,null));};
\ No newline at end of file
index 659d06d..41c2e16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b1f=['SquareProject','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x1bf301,_0xda5c4c){var _0x51c947=function(_0x5196d5){while(--_0x5196d5){_0x1bf301['push'](_0x1bf301['shift']());}};_0x51c947(++_0xda5c4c);}(_0x4b1f,0x155));var _0xf4b1=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x4b1f[_0x525c7b];return _0x27b33e;};'use strict';var EventEmitter=require(_0xf4b1('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xf4b1('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf4b1('0x2')](0x0);var events={'afterCreate':_0xf4b1('0x3'),'afterUpdate':_0xf4b1('0x4'),'afterDestroy':_0xf4b1('0x5')};function emitEvent(_0x4899d2){return function(_0x43ab36,_0x4721cc,_0x2d7f4e){SquareProjectEvents['emit'](_0x4899d2+':'+_0x43ab36['id'],_0x43ab36);SquareProjectEvents[_0xf4b1('0x6')](_0x4899d2,_0x43ab36);_0x2d7f4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xf4b1('0x7')](e,emitEvent(event));}}module[_0xf4b1('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0x37f0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','remove'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x37f0,0x1cc));var _0x037f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x37f0[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x037f('0x0'));var SquareProject=require(_0x037f('0x1'))['db'][_0x037f('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x037f('0x3')};function emitEvent(_0x22f365){return function(_0x200c8f,_0x49b908,_0x7768b8){SquareProjectEvents[_0x037f('0x4')](_0x22f365+':'+_0x200c8f['id'],_0x200c8f);SquareProjectEvents['emit'](_0x22f365,_0x200c8f);_0x7768b8(null);};}for(var e in events){if(events[_0x037f('0x5')](e)){var event=events[e];SquareProject[_0x037f('0x6')](e,emitEvent(event));}}module[_0x037f('0x7')]=SquareProjectEvents;
\ No newline at end of file
index 554752a..561d8aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1392=['preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed'];(function(_0x19f177,_0x31f453){var _0x579289=function(_0xd99d96){while(--_0xd99d96){_0x19f177['push'](_0x19f177['shift']());}};_0x579289(++_0x31f453);}(_0x1392,0x1e9));var _0x2139=function(_0x43576f,_0x1356ed){_0x43576f=_0x43576f-0x0;var _0x4d2466=_0x1392[_0x43576f];return _0x4d2466;};'use strict';var _=require(_0x2139('0x0'));var util=require(_0x2139('0x1'));var logger=require(_0x2139('0x2'))('api');var moment=require(_0x2139('0x3'));var BPromise=require(_0x2139('0x4'));var rp=require(_0x2139('0x5'));var fs=require('fs');var path=require(_0x2139('0x6'));var rimraf=require(_0x2139('0x7'));var config=require(_0x2139('0x8'));var attributes=require(_0x2139('0x9'));module[_0x2139('0xa')]=function(_0x29ddbe,_0x7f5a28){return _0x29ddbe[_0x2139('0xb')](_0x2139('0xc'),attributes,{'tableName':_0x2139('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c7ead,_0x4fd198,_0x77c1d2){if(_0x3c7ead[_0x2139('0xe')](_0x2139('0xf'))){_0x3c7ead[_0x2139('0x10')]=moment()[_0x2139('0x11')](_0x2139('0x12'));}if(_0x3c7ead[_0x2139('0xe')](_0x2139('0x13'))){_0x3c7ead[_0x2139('0x14')]=moment()[_0x2139('0x11')](_0x2139('0x12'));}_0x77c1d2(null,_0x3c7ead);}}});};
\ No newline at end of file
+var _0x6502=['production','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','SquareProject','square_projects','changed','preproduction','format'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6502,0x92));var _0x2650=function(_0xb98d8d,_0x481423){_0xb98d8d=_0xb98d8d-0x0;var _0x489b15=_0x6502[_0xb98d8d];return _0x489b15;};'use strict';var _=require(_0x2650('0x0'));var util=require(_0x2650('0x1'));var logger=require(_0x2650('0x2'))(_0x2650('0x3'));var moment=require(_0x2650('0x4'));var BPromise=require(_0x2650('0x5'));var rp=require(_0x2650('0x6'));var fs=require('fs');var path=require(_0x2650('0x7'));var rimraf=require('rimraf');var config=require(_0x2650('0x8'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x55a35b,_0x56eaa4){return _0x55a35b['define'](_0x2650('0x9'),attributes,{'tableName':_0x2650('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28cc29,_0x3cbcb1,_0x3192dc){if(_0x28cc29[_0x2650('0xb')](_0x2650('0xc'))){_0x28cc29['savedAt']=moment()[_0x2650('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x28cc29['changed'](_0x2650('0xe'))){_0x28cc29['publishedAt']=moment()[_0x2650('0xd')](_0x2650('0xf'));}_0x3192dc(null,_0x28cc29);}}});};
\ No newline at end of file
index 82696cb..6e79fa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd89=['SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','where','attributes','model','include','map','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0xdd89,0x1f1));var _0x9dd8=function(_0x1f62c3,_0x1ff95b){_0x1f62c3=_0x1f62c3-0x0;var _0x385c1c=_0xdd89[_0x1f62c3];return _0x385c1c;};'use strict';var _=require(_0x9dd8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9dd8('0x1'));var rs=require(_0x9dd8('0x2'));var fs=require('fs');var Redis=require(_0x9dd8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9dd8('0x4'))(_0x9dd8('0x5'));var config=require(_0x9dd8('0x6'));var jayson=require(_0x9dd8('0x7'));var client=jayson['client'][_0x9dd8('0x8')]({'port':0x232a});config['redis']=_[_0x9dd8('0x9')](config[_0x9dd8('0xa')],{'host':_0x9dd8('0xb'),'port':0x18eb});var socket=require(_0x9dd8('0xc'))(new Redis(config[_0x9dd8('0xa')]));require(_0x9dd8('0xd'))[_0x9dd8('0xe')](socket);function respondWithRpcPromise(_0x4d37f8,_0x5235f6,_0x66dba3){return new BPromise(function(_0x14ab58,_0x58d646){return client[_0x9dd8('0xf')](_0x4d37f8,_0x66dba3)[_0x9dd8('0x10')](function(_0x1bf9f9){logger[_0x9dd8('0x11')](_0x9dd8('0x12'),_0x5235f6,_0x9dd8('0x13'));logger[_0x9dd8('0x14')](_0x9dd8('0x15'),_0x5235f6,_0x9dd8('0x13'),JSON[_0x9dd8('0x16')](_0x1bf9f9));if(_0x1bf9f9[_0x9dd8('0x17')]){if(_0x1bf9f9[_0x9dd8('0x17')][_0x9dd8('0x18')]===0x1f4){logger['error'](_0x9dd8('0x12'),_0x5235f6,_0x1bf9f9[_0x9dd8('0x17')][_0x9dd8('0x19')]);return _0x58d646(_0x1bf9f9[_0x9dd8('0x17')][_0x9dd8('0x19')]);}logger[_0x9dd8('0x17')](_0x9dd8('0x12'),_0x5235f6,_0x1bf9f9['error'][_0x9dd8('0x19')]);return _0x14ab58(_0x1bf9f9[_0x9dd8('0x17')][_0x9dd8('0x19')]);}else{logger['info'](_0x9dd8('0x12'),_0x5235f6,_0x9dd8('0x13'));_0x14ab58(_0x1bf9f9[_0x9dd8('0x1a')][_0x9dd8('0x19')]);}})[_0x9dd8('0x1b')](function(_0x32ec2d){logger[_0x9dd8('0x17')](_0x9dd8('0x12'),_0x5235f6,_0x32ec2d);_0x58d646(_0x32ec2d);});});}exports[_0x9dd8('0x1c')]=function(_0x108245){var _0x1d06ad=this;return new Promise(function(_0x1e6abb,_0x303a1d){return db[_0x9dd8('0x1d')][_0x9dd8('0x1e')]({'raw':_0x108245['options']?_0x108245[_0x9dd8('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x108245[_0x9dd8('0x1f')]?_0x108245[_0x9dd8('0x1f')][_0x9dd8('0x20')]||null:null,'attributes':_0x108245['options']?_0x108245[_0x9dd8('0x1f')][_0x9dd8('0x21')]||null:null,'include':_0x108245[_0x9dd8('0x1f')]?_0x108245['options']['include']?_['map'](_0x108245[_0x9dd8('0x1f')]['include'],function(_0x270b16){return{'model':db[_0x270b16[_0x9dd8('0x22')]],'as':_0x270b16['as'],'attributes':_0x270b16[_0x9dd8('0x21')],'include':_0x270b16[_0x9dd8('0x23')]?_[_0x9dd8('0x24')](_0x270b16[_0x9dd8('0x23')],function(_0x52e40c){return{'model':db[_0x52e40c[_0x9dd8('0x22')]],'as':_0x52e40c['as'],'attributes':_0x52e40c[_0x9dd8('0x21')],'include':_0x52e40c[_0x9dd8('0x23')]?_[_0x9dd8('0x24')](_0x52e40c[_0x9dd8('0x23')],function(_0x503fba){return{'model':db[_0x503fba[_0x9dd8('0x22')]],'as':_0x503fba['as'],'attributes':_0x503fba[_0x9dd8('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x243ac5){logger[_0x9dd8('0x11')](_0x9dd8('0x1c'),_0x108245);logger[_0x9dd8('0x14')](_0x9dd8('0x1c'),_0x108245,JSON[_0x9dd8('0x16')](_0x243ac5));_0x1e6abb(_0x243ac5);})[_0x9dd8('0x1b')](function(_0x4b29b5){logger[_0x9dd8('0x17')](_0x9dd8('0x1c'),_0x4b29b5[_0x9dd8('0x19')],_0x108245);_0x303a1d(_0x1d06ad[_0x9dd8('0x17')](0x1f4,_0x4b29b5['message']));});});};
\ No newline at end of file
+var _0xc4eb=['../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','code','error','message','SquareProject,\x20%s,\x20%s','result','catch','SquareProject','options','raw','where','attributes','include','map','model','then','ShowSquareProject','lodash','util','moment','bluebird','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4eb,0xb9));var _0xbc4e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc4eb[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xbc4e('0x0'));var util=require(_0xbc4e('0x1'));var moment=require(_0xbc4e('0x2'));var BPromise=require(_0xbc4e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc4e('0x5'));var logger=require(_0xbc4e('0x6'))(_0xbc4e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc4e('0x8')][_0xbc4e('0x9')]({'port':0x232a});config[_0xbc4e('0xa')]=_[_0xbc4e('0xb')](config['redis'],{'host':_0xbc4e('0xc'),'port':0x18eb});var socket=require(_0xbc4e('0xd'))(new Redis(config[_0xbc4e('0xa')]));require(_0xbc4e('0xe'))[_0xbc4e('0xf')](socket);function respondWithRpcPromise(_0x1642ff,_0x171004,_0x30a989){return new BPromise(function(_0x25c8e4,_0x1ff30e){return client[_0xbc4e('0x10')](_0x1642ff,_0x30a989)['then'](function(_0x28361b){logger[_0xbc4e('0x11')]('SquareProject,\x20%s,\x20%s',_0x171004,_0xbc4e('0x12'));logger[_0xbc4e('0x13')](_0xbc4e('0x14'),_0x171004,_0xbc4e('0x12'),JSON[_0xbc4e('0x15')](_0x28361b));if(_0x28361b['error']){if(_0x28361b['error'][_0xbc4e('0x16')]===0x1f4){logger[_0xbc4e('0x17')]('SquareProject,\x20%s,\x20%s',_0x171004,_0x28361b[_0xbc4e('0x17')][_0xbc4e('0x18')]);return _0x1ff30e(_0x28361b[_0xbc4e('0x17')][_0xbc4e('0x18')]);}logger[_0xbc4e('0x17')](_0xbc4e('0x19'),_0x171004,_0x28361b[_0xbc4e('0x17')][_0xbc4e('0x18')]);return _0x25c8e4(_0x28361b['error'][_0xbc4e('0x18')]);}else{logger['info'](_0xbc4e('0x19'),_0x171004,_0xbc4e('0x12'));_0x25c8e4(_0x28361b[_0xbc4e('0x1a')][_0xbc4e('0x18')]);}})[_0xbc4e('0x1b')](function(_0x335a9f){logger[_0xbc4e('0x17')](_0xbc4e('0x19'),_0x171004,_0x335a9f);_0x1ff30e(_0x335a9f);});});}exports['ShowSquareProject']=function(_0x31b745){var _0x318644=this;return new Promise(function(_0x13e9e1,_0x1cde40){return db[_0xbc4e('0x1c')]['find']({'raw':_0x31b745[_0xbc4e('0x1d')]?_0x31b745[_0xbc4e('0x1d')][_0xbc4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x31b745[_0xbc4e('0x1d')]?_0x31b745[_0xbc4e('0x1d')][_0xbc4e('0x1f')]||null:null,'attributes':_0x31b745[_0xbc4e('0x1d')]?_0x31b745[_0xbc4e('0x1d')][_0xbc4e('0x20')]||null:null,'include':_0x31b745['options']?_0x31b745[_0xbc4e('0x1d')][_0xbc4e('0x21')]?_[_0xbc4e('0x22')](_0x31b745[_0xbc4e('0x1d')][_0xbc4e('0x21')],function(_0x5914c1){return{'model':db[_0x5914c1[_0xbc4e('0x23')]],'as':_0x5914c1['as'],'attributes':_0x5914c1[_0xbc4e('0x20')],'include':_0x5914c1[_0xbc4e('0x21')]?_[_0xbc4e('0x22')](_0x5914c1[_0xbc4e('0x21')],function(_0x295749){return{'model':db[_0x295749[_0xbc4e('0x23')]],'as':_0x295749['as'],'attributes':_0x295749['attributes'],'include':_0x295749[_0xbc4e('0x21')]?_[_0xbc4e('0x22')](_0x295749[_0xbc4e('0x21')],function(_0x1b28ec){return{'model':db[_0x1b28ec[_0xbc4e('0x23')]],'as':_0x1b28ec['as'],'attributes':_0x1b28ec[_0xbc4e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbc4e('0x24')](function(_0x8433e2){logger['info'](_0xbc4e('0x25'),_0x31b745);logger['debug'](_0xbc4e('0x25'),_0x31b745,JSON[_0xbc4e('0x15')](_0x8433e2));_0x13e9e1(_0x8433e2);})[_0xbc4e('0x1b')](function(_0x26214c){logger['error'](_0xbc4e('0x25'),_0x26214c['message'],_0x31b745);_0x1cde40(_0x318644[_0xbc4e('0x17')](0x1f4,_0x26214c[_0xbc4e('0x18')]));});});};
\ No newline at end of file
index 52f7a21..e295e68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2e2=['squareProject:','./squareProject.events','save','remove','update','emit','removeListener','register'];(function(_0x434083,_0x18a1d0){var _0x2e04aa=function(_0x122c06){while(--_0x122c06){_0x434083['push'](_0x434083['shift']());}};_0x2e04aa(++_0x18a1d0);}(_0xe2e2,0xf1));var _0x2e2e=function(_0x20ae90,_0x2cb54f){_0x20ae90=_0x20ae90-0x0;var _0x41d1eb=_0xe2e2[_0x20ae90];return _0x41d1eb;};'use strict';var SquareProjectEvents=require(_0x2e2e('0x0'));var events=[_0x2e2e('0x1'),_0x2e2e('0x2'),_0x2e2e('0x3')];function createListener(_0x2736c3,_0x2440a8){return function(_0x2f70b2){_0x2440a8[_0x2e2e('0x4')](_0x2736c3,_0x2f70b2);};}function removeListener(_0x583d64,_0x4956bd){return function(){SquareProjectEvents[_0x2e2e('0x5')](_0x583d64,_0x4956bd);};}exports[_0x2e2e('0x6')]=function(_0x51057a){for(var _0x20fcad=0x0,_0x404a73=events['length'];_0x20fcad<_0x404a73;_0x20fcad++){var _0x214706=events[_0x20fcad];var _0x8c871a=createListener(_0x2e2e('0x7')+_0x214706,_0x51057a);SquareProjectEvents['on'](_0x214706,_0x8c871a);}};
\ No newline at end of file
+var _0x8308=['register','length','squareProject:','./squareProject.events','save','remove','update','emit','removeListener'];(function(_0x3ce840,_0x1e0118){var _0x5089d1=function(_0x2cbefc){while(--_0x2cbefc){_0x3ce840['push'](_0x3ce840['shift']());}};_0x5089d1(++_0x1e0118);}(_0x8308,0xf6));var _0x8830=function(_0x4e29e5,_0x5ce388){_0x4e29e5=_0x4e29e5-0x0;var _0x312749=_0x8308[_0x4e29e5];return _0x312749;};'use strict';var SquareProjectEvents=require(_0x8830('0x0'));var events=[_0x8830('0x1'),_0x8830('0x2'),_0x8830('0x3')];function createListener(_0xc694ef,_0x45abc9){return function(_0x38b5c5){_0x45abc9[_0x8830('0x4')](_0xc694ef,_0x38b5c5);};}function removeListener(_0x6d80f9,_0x42d2f8){return function(){SquareProjectEvents[_0x8830('0x5')](_0x6d80f9,_0x42d2f8);};}exports[_0x8830('0x6')]=function(_0x4d4406){for(var _0x2ec6fc=0x0,_0x1fd53b=events[_0x8830('0x7')];_0x2ec6fc<_0x1fd53b;_0x2ec6fc++){var _0x1fb80e=events[_0x2ec6fc];var _0x236ed1=createListener(_0x8830('0x8')+_0x1fb80e,_0x4d4406);SquareProjectEvents['on'](_0x1fb80e,_0x236ed1);}};
\ No newline at end of file
index ae92d93..6b6c16f 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(_0x11f2bb,_0x5aaf8e){var _0x2a7afa=function(_0x39f4f8){while(--_0x39f4f8){_0x11f2bb['push'](_0x11f2bb['shift']());}};_0x2a7afa(++_0x5aaf8e);}(_0x4975,0x86));var _0x5497=function(_0x8776a0,_0x21cd37){_0x8776a0=_0x8776a0-0x0;var _0x4944b6=_0x4975[_0x8776a0];return _0x4944b6;};'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 _0x7217=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x7217,0x19e));var _0x7721=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x7217[_0x49ca18];return _0x145d54;};'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('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router;
\ No newline at end of file
index d88fed2..5283014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x3d8322,_0x3ecc10){var _0x5a1883=function(_0x173744){while(--_0x173744){_0x3d8322['push'](_0x3d8322['shift']());}};_0x5a1883(++_0x3ecc10);}(_0x032e,0x124));var _0xe032=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x032e[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}};
\ No newline at end of file
+var _0x7bae=['savePath','substring','lastIndexOf','STRING','VIRTUAL','getDataValue'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7bae,0x13b));var _0xe7ba=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x7bae[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe7ba('0x0')]},'callerid':{'type':Sequelize[_0xe7ba('0x0')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe7ba('0x0')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe7ba('0x0')]},'accountcode':{'type':Sequelize[_0xe7ba('0x0')]},'dnid':{'type':Sequelize[_0xe7ba('0x0')]},'projectName':{'type':Sequelize[_0xe7ba('0x0')]},'saveName':{'type':Sequelize[_0xe7ba('0x0')]},'filename':{'type':Sequelize[_0xe7ba('0x0')]},'savePath':{'type':Sequelize[_0xe7ba('0x0')]},'format':{'type':Sequelize[_0xe7ba('0x1')],'get':function(){var _0x10b307='';var _0x34fb18=this[_0xe7ba('0x2')](_0xe7ba('0x3'));if(_0x34fb18){_0x10b307=_0x34fb18[_0xe7ba('0x4')](_0x34fb18[_0xe7ba('0x5')]('.'));}return _0x10b307;}}};
\ No newline at end of file
index d20d61c..e27f612 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88e2=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','SquareRecording','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','length','find','create','body','download','../../components/encryptor','uniqueid','filename','savePath','format','existsSync','decryptFile','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel'];(function(_0x3ccfb0,_0x1d32ed){var _0x3184e8=function(_0x3ea16c){while(--_0x3ea16c){_0x3ccfb0['push'](_0x3ccfb0['shift']());}};_0x3184e8(++_0x1d32ed);}(_0x88e2,0x178));var _0x288e=function(_0x303bfb,_0x351d62){_0x303bfb=_0x303bfb-0x0;var _0x2f6322=_0x88e2[_0x303bfb];return _0x2f6322;};'use strict';var emlformat=require(_0x288e('0x0'));var rimraf=require(_0x288e('0x1'));var zipdir=require(_0x288e('0x2'));var jsonpatch=require(_0x288e('0x3'));var rp=require(_0x288e('0x4'));var moment=require('moment');var BPromise=require(_0x288e('0x5'));var Mustache=require(_0x288e('0x6'));var util=require(_0x288e('0x7'));var path=require('path');var sox=require(_0x288e('0x8'));var csv=require(_0x288e('0x9'));var ejs=require(_0x288e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x288e('0xb'));var crypto=require(_0x288e('0xc'));var jsforce=require(_0x288e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x288e('0x9'));var querystring=require(_0x288e('0xe'));var Papa=require(_0x288e('0xf'));var Redis=require(_0x288e('0x10'));var authService=require(_0x288e('0x11'));var qs=require(_0x288e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x288e('0x13'));var logger=require(_0x288e('0x14'))('api');var utils=require(_0x288e('0x15'));var config=require(_0x288e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x288e('0x17'))['db'];function respondWithStatusCode(_0x1c42ec,_0x2a4c7d){_0x2a4c7d=_0x2a4c7d||0xcc;return function(_0x5bc681){if(_0x5bc681){return _0x1c42ec['sendStatus'](_0x2a4c7d);}return _0x1c42ec[_0x288e('0x18')](_0x2a4c7d)['end']();};}function respondWithResult(_0x576f16,_0x2948f4){_0x2948f4=_0x2948f4||0xc8;return function(_0x4bc111){if(_0x4bc111){return _0x576f16[_0x288e('0x18')](_0x2948f4)['json'](_0x4bc111);}};}function respondWithFilteredResult(_0x30b610,_0x51f361){return function(_0x65b916){if(_0x65b916){var _0x3a5858=typeof _0x51f361['offset']===_0x288e('0x19')&&typeof _0x51f361[_0x288e('0x1a')]==='undefined';var _0xfdbd7b=_0x65b916['count'];var _0x3b0a91=_0x3a5858?0x0:_0x51f361['offset'];var _0x5514c8=_0x3a5858?_0x65b916['count']:_0x51f361[_0x288e('0x1b')]+_0x51f361['limit'];var _0xfd8991;if(_0x5514c8>=_0xfdbd7b){_0x5514c8=_0xfdbd7b;_0xfd8991=0xc8;}else{_0xfd8991=0xce;}_0x30b610[_0x288e('0x18')](_0xfd8991);return _0x30b610[_0x288e('0x1c')](_0x288e('0x1d'),_0x3b0a91+'-'+_0x5514c8+'/'+_0xfdbd7b)[_0x288e('0x1e')](_0x65b916);}return null;};}function patchUpdates(_0xbff590){return function(_0x197ebe){try{jsonpatch[_0x288e('0x1f')](_0x197ebe,_0xbff590,!![]);}catch(_0x574ec1){return BPromise[_0x288e('0x20')](_0x574ec1);}return _0x197ebe[_0x288e('0x21')]();};}function saveUpdates(_0x3d9d3c,_0x18c044){return function(_0x24185b){if(_0x24185b){return _0x24185b[_0x288e('0x22')](_0x3d9d3c)[_0x288e('0x23')](function(_0x21f5cf){return _0x21f5cf;});}return null;};}function removeEntity(_0x578c84,_0x403d21){return function(_0xc61f66){if(_0xc61f66){return _0xc61f66[_0x288e('0x24')]()[_0x288e('0x23')](function(){_0x578c84[_0x288e('0x18')](0xcc)[_0x288e('0x25')]();});}};}function handleEntityNotFound(_0xa83416,_0x28b227){return function(_0x49563c){if(!_0x49563c){_0xa83416[_0x288e('0x26')](0x194);}return _0x49563c;};}function handleError(_0x482770,_0x37531e){_0x37531e=_0x37531e||0x1f4;return function(_0x36f4e9){logger[_0x288e('0x27')](_0x36f4e9[_0x288e('0x28')]);if(_0x36f4e9['name']){delete _0x36f4e9[_0x288e('0x29')];}_0x482770[_0x288e('0x18')](_0x37531e)['send'](_0x36f4e9);};}exports[_0x288e('0x2a')]=function(_0x3b9311,_0x245a72){var _0x46b25b={},_0x14f807={},_0x39ed31={'count':0x0,'rows':[]};var _0x5820b6=_[_0x288e('0x2b')](db[_0x288e('0x2c')][_0x288e('0x2d')],function(_0xb6c612){return{'name':_0xb6c612['fieldName'],'type':_0xb6c612[_0x288e('0x2e')][_0x288e('0x2f')]};});_0x14f807[_0x288e('0x30')]=_['map'](_0x5820b6,'name');_0x14f807[_0x288e('0x31')]=_[_0x288e('0x32')](_0x3b9311['query']);_0x14f807[_0x288e('0x33')]=_[_0x288e('0x34')](_0x14f807[_0x288e('0x30')],_0x14f807['query']);_0x46b25b[_0x288e('0x35')]=_['intersection'](_0x14f807[_0x288e('0x30')],qs[_0x288e('0x36')](_0x3b9311[_0x288e('0x31')][_0x288e('0x36')]));_0x46b25b[_0x288e('0x35')]=_0x46b25b[_0x288e('0x35')]['length']?_0x46b25b[_0x288e('0x35')]:_0x14f807[_0x288e('0x30')];if(!_0x3b9311['query'][_0x288e('0x37')]('nolimit')){_0x46b25b['limit']=qs['limit'](_0x3b9311[_0x288e('0x31')][_0x288e('0x1a')]);_0x46b25b[_0x288e('0x1b')]=qs['offset'](_0x3b9311[_0x288e('0x31')][_0x288e('0x1b')]);}_0x46b25b[_0x288e('0x38')]=qs[_0x288e('0x39')](_0x3b9311[_0x288e('0x31')][_0x288e('0x39')]);_0x46b25b[_0x288e('0x3a')]=qs[_0x288e('0x33')](_['pick'](_0x3b9311['query'],_0x14f807['filters']),_0x5820b6);if(_0x3b9311[_0x288e('0x31')][_0x288e('0x3b')]){_0x46b25b[_0x288e('0x3a')]=_[_0x288e('0x3c')](_0x46b25b[_0x288e('0x3a')],{'$or':_[_0x288e('0x2b')](_0x5820b6,function(_0x376260){if(_0x376260['type']!==_0x288e('0x3d')){var _0x8d6316={};_0x8d6316[_0x376260[_0x288e('0x29')]]={'$like':'%'+_0x3b9311[_0x288e('0x31')][_0x288e('0x3b')]+'%'};return _0x8d6316;}})});}_0x46b25b=_['merge']({},_0x46b25b,_0x3b9311[_0x288e('0x3e')]);var _0x45ad58={'where':_0x46b25b[_0x288e('0x3a')]};return db[_0x288e('0x2c')]['count'](_0x45ad58)[_0x288e('0x23')](function(_0x141f96){_0x39ed31[_0x288e('0x3f')]=_0x141f96;if(_0x3b9311['query']['includeAll']){_0x46b25b[_0x288e('0x40')]=[{'all':!![]}];}return db[_0x288e('0x2c')][_0x288e('0x41')](_0x46b25b);})[_0x288e('0x23')](function(_0xd1d024){_0x39ed31[_0x288e('0x42')]=_0xd1d024;return _0x39ed31;})['then'](respondWithFilteredResult(_0x245a72,_0x46b25b))[_0x288e('0x43')](handleError(_0x245a72,null));};exports[_0x288e('0x44')]=function(_0x1836e5,_0x7ff414){var _0x54a35b={'raw':!![],'where':{'id':_0x1836e5[_0x288e('0x45')]['id']}},_0x152b8d={};_0x152b8d[_0x288e('0x30')]=_['keys'](db[_0x288e('0x2c')][_0x288e('0x2d')]);_0x152b8d[_0x288e('0x31')]=_['keys'](_0x1836e5['query']);_0x152b8d[_0x288e('0x33')]=_[_0x288e('0x34')](_0x152b8d[_0x288e('0x30')],_0x152b8d['query']);_0x54a35b[_0x288e('0x35')]=_[_0x288e('0x34')](_0x152b8d['model'],qs[_0x288e('0x36')](_0x1836e5[_0x288e('0x31')][_0x288e('0x36')]));_0x54a35b[_0x288e('0x35')]=_0x54a35b[_0x288e('0x35')][_0x288e('0x46')]?_0x54a35b[_0x288e('0x35')]:_0x152b8d[_0x288e('0x30')];if(_0x1836e5[_0x288e('0x31')]['includeAll']){_0x54a35b[_0x288e('0x40')]=[{'all':!![]}];}_0x54a35b=_[_0x288e('0x3c')]({},_0x54a35b,_0x1836e5[_0x288e('0x3e')]);return db['SquareRecording'][_0x288e('0x47')](_0x54a35b)[_0x288e('0x23')](handleEntityNotFound(_0x7ff414,null))['then'](respondWithResult(_0x7ff414,null))[_0x288e('0x43')](handleError(_0x7ff414,null));};exports[_0x288e('0x48')]=function(_0x2e46c9,_0x3b9da9){return db[_0x288e('0x2c')][_0x288e('0x48')](_0x2e46c9[_0x288e('0x49')],{})['then'](respondWithResult(_0x3b9da9,0xc9))[_0x288e('0x43')](handleError(_0x3b9da9,null));};exports[_0x288e('0x22')]=function(_0x13c982,_0x4bc3c6){if(_0x13c982[_0x288e('0x49')]['id']){delete _0x13c982[_0x288e('0x49')]['id'];}return db[_0x288e('0x2c')]['find']({'where':{'id':_0x13c982[_0x288e('0x45')]['id']}})[_0x288e('0x23')](handleEntityNotFound(_0x4bc3c6,null))[_0x288e('0x23')](saveUpdates(_0x13c982[_0x288e('0x49')],null))[_0x288e('0x23')](respondWithResult(_0x4bc3c6,null))[_0x288e('0x43')](handleError(_0x4bc3c6,null));};exports[_0x288e('0x4a')]=function(_0x2b6f98,_0x5cfd2e,_0x1ffcf9){var _0x877aaf=require(_0x288e('0x4b'));var _0x3a7fff=![];var _0x18cde7={};if(_0x2b6f98[_0x288e('0x31')][_0x288e('0x2e')]&&_0x2b6f98[_0x288e('0x31')][_0x288e('0x2e')]==='uniqueid'){_0x18cde7[_0x288e('0x4c')]=_0x2b6f98[_0x288e('0x45')]['id'];}else{_0x18cde7['id']=_0x2b6f98[_0x288e('0x45')]['id'];}return db[_0x288e('0x2c')][_0x288e('0x47')]({'where':_0x18cde7,'attributes':['id','savePath',_0x288e('0x4d')],'raw':!![]})[_0x288e('0x23')](handleEntityNotFound(_0x5cfd2e,null))[_0x288e('0x23')](function(_0x15a494){if(_0x15a494){var _0x763dac=_0x15a494[_0x288e('0x4e')];var _0x320053=util[_0x288e('0x4f')]('%s.cypher',_0x763dac);if(fs[_0x288e('0x50')](_0x320053)){_0x3a7fff=!![];return _0x877aaf[_0x288e('0x51')](_0x320053,_0x763dac,config['secrets'][_0x288e('0x52')])[_0x288e('0x23')](function(){return _0x15a494;});}return _0x15a494;}})[_0x288e('0x23')](function(_0x5efea0){if(_0x5efea0){var _0x2802a6=_0x5efea0[_0x288e('0x4e')];if(!fs['existsSync'](_0x2802a6)){throw new db[(_0x288e('0x53'))]['ValidationError'](_0x288e('0x54'));}if(_0x5efea0[_0x288e('0x4d')]){return _0x5cfd2e['download'](_0x2802a6,_0x5efea0[_0x288e('0x4d')]+path[_0x288e('0x55')](_0x2802a6),function(){if(_0x3a7fff){fs[_0x288e('0x56')](_0x2802a6);}});}else{return _0x5cfd2e[_0x288e('0x4a')](_0x2802a6,function(_0x557c08){if(_0x3a7fff){fs['unlink'](_0x2802a6);}});}}})['catch'](function(_0x1bbda0){if(_0x1bbda0[_0x288e('0x57')]===_0x288e('0x54')){_0x5cfd2e['status'](0x194)['send'](_0x288e('0x58'));}else{return handleError(_0x5cfd2e,null);}});};exports[_0x288e('0x24')]=function(_0x3ec8da,_0x315ada){return db[_0x288e('0x2c')][_0x288e('0x47')]({'where':{'id':_0x3ec8da[_0x288e('0x45')]['id']}})['then'](function(_0x58e9a8){if(_[_0x288e('0x59')](_0x58e9a8)){throw new ReferenceError(_0x288e('0x5a'));}return _0x58e9a8;})[_0x288e('0x23')](function(_0x50ebdc){var _0x3f5e2a=_0x50ebdc['savePath'];logger[_0x288e('0x5b')](_0x288e('0x5c'),_0x3f5e2a);if(!_[_0x288e('0x59')](_0x50ebdc[_0x288e('0x4e')])&&fs['existsSync'](_0x3f5e2a)){logger['info'](_0x288e('0x5d')+_0x3f5e2a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x288e('0x5e')](_0x3f5e2a);}_0x3f5e2a=_0x3f5e2a+_0x288e('0x5f');if(!_[_0x288e('0x59')](_0x50ebdc[_0x288e('0x4e')])&&fs[_0x288e('0x50')](_0x3f5e2a)){logger[_0x288e('0x5b')](_0x288e('0x5d')+_0x3f5e2a+_0x288e('0x60'));fs[_0x288e('0x5e')](_0x3f5e2a);}return _0x50ebdc;})[_0x288e('0x23')](function(_0x2b7b8d){if(!_0x2b7b8d)throw new InternalError();return _0x2b7b8d['destroy']();})['then'](function(){_0x315ada[_0x288e('0x18')](0xcc)[_0x288e('0x25')]();})[_0x288e('0x43')](handleError(_0x315ada,null));};
\ No newline at end of file
+var _0x533f=['reject','save','update','then','end','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','SquareRecording','includeAll','include','findAll','rows','catch','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','decryptFile','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','status','offset','undefined','limit','count','set','json'];(function(_0x1f8c59,_0x3c8819){var _0x56969e=function(_0x1bcf2c){while(--_0x1bcf2c){_0x1f8c59['push'](_0x1f8c59['shift']());}};_0x56969e(++_0x3c8819);}(_0x533f,0x14e));var _0xf533=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x533f[_0x79cd47];return _0x3b9484;};'use strict';var emlformat=require(_0xf533('0x0'));var rimraf=require(_0xf533('0x1'));var zipdir=require(_0xf533('0x2'));var jsonpatch=require(_0xf533('0x3'));var rp=require(_0xf533('0x4'));var moment=require(_0xf533('0x5'));var BPromise=require(_0xf533('0x6'));var Mustache=require(_0xf533('0x7'));var util=require(_0xf533('0x8'));var path=require('path');var sox=require(_0xf533('0x9'));var csv=require('to-csv');var ejs=require(_0xf533('0xa'));var fs=require('fs');var fs_extra=require(_0xf533('0xb'));var _=require('lodash');var squel=require(_0xf533('0xc'));var crypto=require(_0xf533('0xd'));var jsforce=require(_0xf533('0xe'));var deskjs=require(_0xf533('0xf'));var toCsv=require(_0xf533('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf533('0x11'));var authService=require(_0xf533('0x12'));var qs=require(_0xf533('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf533('0x14'));var utils=require(_0xf533('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf533('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e0a89,_0x3e3f21){_0x3e3f21=_0x3e3f21||0xcc;return function(_0x2091ff){if(_0x2091ff){return _0x2e0a89['sendStatus'](_0x3e3f21);}return _0x2e0a89[_0xf533('0x17')](_0x3e3f21)['end']();};}function respondWithResult(_0x99a107,_0x358b28){_0x358b28=_0x358b28||0xc8;return function(_0x3ddd36){if(_0x3ddd36){return _0x99a107['status'](_0x358b28)['json'](_0x3ddd36);}};}function respondWithFilteredResult(_0x337c5b,_0x11c34a){return function(_0x2aa0a8){if(_0x2aa0a8){var _0x578f2b=typeof _0x11c34a[_0xf533('0x18')]===_0xf533('0x19')&&typeof _0x11c34a[_0xf533('0x1a')]===_0xf533('0x19');var _0x3e1a2d=_0x2aa0a8[_0xf533('0x1b')];var _0xfdf54b=_0x578f2b?0x0:_0x11c34a['offset'];var _0x35426a=_0x578f2b?_0x2aa0a8[_0xf533('0x1b')]:_0x11c34a[_0xf533('0x18')]+_0x11c34a[_0xf533('0x1a')];var _0x1b0ae0;if(_0x35426a>=_0x3e1a2d){_0x35426a=_0x3e1a2d;_0x1b0ae0=0xc8;}else{_0x1b0ae0=0xce;}_0x337c5b[_0xf533('0x17')](_0x1b0ae0);return _0x337c5b[_0xf533('0x1c')]('Content-Range',_0xfdf54b+'-'+_0x35426a+'/'+_0x3e1a2d)[_0xf533('0x1d')](_0x2aa0a8);}return null;};}function patchUpdates(_0x51f384){return function(_0x2bef3c){try{jsonpatch['apply'](_0x2bef3c,_0x51f384,!![]);}catch(_0x1dea72){return BPromise[_0xf533('0x1e')](_0x1dea72);}return _0x2bef3c[_0xf533('0x1f')]();};}function saveUpdates(_0x3fd712,_0x23a837){return function(_0x40493d){if(_0x40493d){return _0x40493d[_0xf533('0x20')](_0x3fd712)[_0xf533('0x21')](function(_0x62a738){return _0x62a738;});}return null;};}function removeEntity(_0x19fd84,_0x5830d5){return function(_0x44d98e){if(_0x44d98e){return _0x44d98e['destroy']()[_0xf533('0x21')](function(){_0x19fd84[_0xf533('0x17')](0xcc)[_0xf533('0x22')]();});}};}function handleEntityNotFound(_0xa1fe06,_0x186930){return function(_0x1b8970){if(!_0x1b8970){_0xa1fe06[_0xf533('0x23')](0x194);}return _0x1b8970;};}function handleError(_0x4687c3,_0x1b23e8){_0x1b23e8=_0x1b23e8||0x1f4;return function(_0x5a41f2){logger['error'](_0x5a41f2[_0xf533('0x24')]);if(_0x5a41f2[_0xf533('0x25')]){delete _0x5a41f2[_0xf533('0x25')];}_0x4687c3[_0xf533('0x17')](_0x1b23e8)[_0xf533('0x26')](_0x5a41f2);};}exports['index']=function(_0xde9e05,_0x4ced7a){var _0x9d4df9={},_0x3b92c2={},_0x44f0e6={'count':0x0,'rows':[]};var _0x469758=_[_0xf533('0x27')](db['SquareRecording'][_0xf533('0x28')],function(_0xd1d41e){return{'name':_0xd1d41e[_0xf533('0x29')],'type':_0xd1d41e[_0xf533('0x2a')]['key']};});_0x3b92c2[_0xf533('0x2b')]=_[_0xf533('0x27')](_0x469758,'name');_0x3b92c2[_0xf533('0x2c')]=_[_0xf533('0x2d')](_0xde9e05[_0xf533('0x2c')]);_0x3b92c2['filters']=_[_0xf533('0x2e')](_0x3b92c2[_0xf533('0x2b')],_0x3b92c2[_0xf533('0x2c')]);_0x9d4df9['attributes']=_[_0xf533('0x2e')](_0x3b92c2[_0xf533('0x2b')],qs[_0xf533('0x2f')](_0xde9e05[_0xf533('0x2c')][_0xf533('0x2f')]));_0x9d4df9[_0xf533('0x30')]=_0x9d4df9[_0xf533('0x30')][_0xf533('0x31')]?_0x9d4df9[_0xf533('0x30')]:_0x3b92c2[_0xf533('0x2b')];if(!_0xde9e05[_0xf533('0x2c')][_0xf533('0x32')](_0xf533('0x33'))){_0x9d4df9[_0xf533('0x1a')]=qs[_0xf533('0x1a')](_0xde9e05['query'][_0xf533('0x1a')]);_0x9d4df9[_0xf533('0x18')]=qs['offset'](_0xde9e05['query']['offset']);}_0x9d4df9[_0xf533('0x34')]=qs['sort'](_0xde9e05[_0xf533('0x2c')][_0xf533('0x35')]);_0x9d4df9[_0xf533('0x36')]=qs['filters'](_[_0xf533('0x37')](_0xde9e05['query'],_0x3b92c2[_0xf533('0x38')]),_0x469758);if(_0xde9e05[_0xf533('0x2c')][_0xf533('0x39')]){_0x9d4df9[_0xf533('0x36')]=_['merge'](_0x9d4df9[_0xf533('0x36')],{'$or':_[_0xf533('0x27')](_0x469758,function(_0x43016b){if(_0x43016b[_0xf533('0x2a')]!==_0xf533('0x3a')){var _0xd2a42d={};_0xd2a42d[_0x43016b[_0xf533('0x25')]]={'$like':'%'+_0xde9e05[_0xf533('0x2c')][_0xf533('0x39')]+'%'};return _0xd2a42d;}})});}_0x9d4df9=_[_0xf533('0x3b')]({},_0x9d4df9,_0xde9e05[_0xf533('0x3c')]);var _0x25b815={'where':_0x9d4df9[_0xf533('0x36')]};return db[_0xf533('0x3d')][_0xf533('0x1b')](_0x25b815)['then'](function(_0x2cf6c5){_0x44f0e6[_0xf533('0x1b')]=_0x2cf6c5;if(_0xde9e05[_0xf533('0x2c')][_0xf533('0x3e')]){_0x9d4df9[_0xf533('0x3f')]=[{'all':!![]}];}return db['SquareRecording'][_0xf533('0x40')](_0x9d4df9);})['then'](function(_0x2941a7){_0x44f0e6[_0xf533('0x41')]=_0x2941a7;return _0x44f0e6;})[_0xf533('0x21')](respondWithFilteredResult(_0x4ced7a,_0x9d4df9))[_0xf533('0x42')](handleError(_0x4ced7a,null));};exports['show']=function(_0x4a7f00,_0x1ad2c9){var _0xef72bf={'raw':!![],'where':{'id':_0x4a7f00[_0xf533('0x43')]['id']}},_0x30e736={};_0x30e736[_0xf533('0x2b')]=_['keys'](db[_0xf533('0x3d')]['rawAttributes']);_0x30e736[_0xf533('0x2c')]=_['keys'](_0x4a7f00[_0xf533('0x2c')]);_0x30e736[_0xf533('0x38')]=_[_0xf533('0x2e')](_0x30e736[_0xf533('0x2b')],_0x30e736['query']);_0xef72bf[_0xf533('0x30')]=_[_0xf533('0x2e')](_0x30e736[_0xf533('0x2b')],qs[_0xf533('0x2f')](_0x4a7f00[_0xf533('0x2c')][_0xf533('0x2f')]));_0xef72bf[_0xf533('0x30')]=_0xef72bf[_0xf533('0x30')][_0xf533('0x31')]?_0xef72bf[_0xf533('0x30')]:_0x30e736[_0xf533('0x2b')];if(_0x4a7f00['query'][_0xf533('0x3e')]){_0xef72bf[_0xf533('0x3f')]=[{'all':!![]}];}_0xef72bf=_[_0xf533('0x3b')]({},_0xef72bf,_0x4a7f00[_0xf533('0x3c')]);return db[_0xf533('0x3d')][_0xf533('0x44')](_0xef72bf)[_0xf533('0x21')](handleEntityNotFound(_0x1ad2c9,null))[_0xf533('0x21')](respondWithResult(_0x1ad2c9,null))[_0xf533('0x42')](handleError(_0x1ad2c9,null));};exports[_0xf533('0x45')]=function(_0x370d5a,_0x2fde7b){return db[_0xf533('0x3d')][_0xf533('0x45')](_0x370d5a[_0xf533('0x46')],{})[_0xf533('0x21')](respondWithResult(_0x2fde7b,0xc9))[_0xf533('0x42')](handleError(_0x2fde7b,null));};exports[_0xf533('0x20')]=function(_0x1bb0ef,_0x13b631){if(_0x1bb0ef[_0xf533('0x46')]['id']){delete _0x1bb0ef[_0xf533('0x46')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x1bb0ef[_0xf533('0x43')]['id']}})[_0xf533('0x21')](handleEntityNotFound(_0x13b631,null))[_0xf533('0x21')](saveUpdates(_0x1bb0ef[_0xf533('0x46')],null))['then'](respondWithResult(_0x13b631,null))[_0xf533('0x42')](handleError(_0x13b631,null));};exports[_0xf533('0x47')]=function(_0x6a2e03,_0x5a4c10,_0x3761f7){var _0x1ab060=require(_0xf533('0x48'));var _0x331255=![];var _0x358d2c={};if(_0x6a2e03[_0xf533('0x2c')]['type']&&_0x6a2e03[_0xf533('0x2c')][_0xf533('0x2a')]===_0xf533('0x49')){_0x358d2c[_0xf533('0x49')]=_0x6a2e03[_0xf533('0x43')]['id'];}else{_0x358d2c['id']=_0x6a2e03[_0xf533('0x43')]['id'];}return db[_0xf533('0x3d')][_0xf533('0x44')]({'where':_0x358d2c,'attributes':['id',_0xf533('0x4a'),'filename'],'raw':!![]})[_0xf533('0x21')](handleEntityNotFound(_0x5a4c10,null))['then'](function(_0x124fda){if(_0x124fda){var _0xb63fe1=_0x124fda['savePath'];var _0x53c5d6=util['format']('%s.cypher',_0xb63fe1);if(fs['existsSync'](_0x53c5d6)){_0x331255=!![];return _0x1ab060[_0xf533('0x4b')](_0x53c5d6,_0xb63fe1,config['secrets'][_0xf533('0x4c')])['then'](function(){return _0x124fda;});}return _0x124fda;}})['then'](function(_0x2b0140){if(_0x2b0140){var _0x47bb09=_0x2b0140[_0xf533('0x4a')];if(!fs[_0xf533('0x4d')](_0x47bb09)){throw new db[(_0xf533('0x4e'))][(_0xf533('0x4f'))](_0xf533('0x50'));}if(_0x2b0140['filename']){return _0x5a4c10[_0xf533('0x47')](_0x47bb09,_0x2b0140[_0xf533('0x51')]+path[_0xf533('0x52')](_0x47bb09),function(){if(_0x331255){fs['unlink'](_0x47bb09);}});}else{return _0x5a4c10[_0xf533('0x47')](_0x47bb09,function(_0x3fb76d){if(_0x331255){fs['unlink'](_0x47bb09);}});}}})['catch'](function(_0x55f7b9){if(_0x55f7b9['message']===_0xf533('0x50')){_0x5a4c10[_0xf533('0x17')](0x194)[_0xf533('0x26')](_0xf533('0x53'));}else{return handleError(_0x5a4c10,null);}});};exports['destroy']=function(_0x36b186,_0x107c08){return db[_0xf533('0x3d')]['find']({'where':{'id':_0x36b186[_0xf533('0x43')]['id']}})['then'](function(_0x344bc5){if(_[_0xf533('0x54')](_0x344bc5)){throw new ReferenceError(_0xf533('0x55'));}return _0x344bc5;})[_0xf533('0x21')](function(_0x3c9b74){var _0x4cec0e=_0x3c9b74[_0xf533('0x4a')];logger[_0xf533('0x56')]('cancellazione\x20fisica\x20documento\x20%s',_0x4cec0e);if(!_[_0xf533('0x54')](_0x3c9b74[_0xf533('0x4a')])&&fs[_0xf533('0x4d')](_0x4cec0e)){logger[_0xf533('0x56')](_0xf533('0x57')+_0x4cec0e+_0xf533('0x58'));fs[_0xf533('0x59')](_0x4cec0e);}_0x4cec0e=_0x4cec0e+'.cypher';if(!_['isNil'](_0x3c9b74[_0xf533('0x4a')])&&fs[_0xf533('0x4d')](_0x4cec0e)){logger[_0xf533('0x56')](_0xf533('0x57')+_0x4cec0e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xf533('0x59')](_0x4cec0e);}return _0x3c9b74;})['then'](function(_0x4b5a2b){if(!_0x4b5a2b)throw new InternalError();return _0x4b5a2b[_0xf533('0x5a')]();})['then'](function(){_0x107c08[_0xf533('0x17')](0xcc)[_0xf533('0x22')]();})[_0xf533('0x42')](handleError(_0x107c08,null));};
\ No newline at end of file
index a4bcc06..432f916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa35e=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording'];(function(_0x5d0677,_0x133029){var _0xeacb42=function(_0x8eb062){while(--_0x8eb062){_0x5d0677['push'](_0x5d0677['shift']());}};_0xeacb42(++_0x133029);}(_0xa35e,0x111));var _0xea35=function(_0x57c1af,_0x12da4f){_0x57c1af=_0x57c1af-0x0;var _0x1fe8c9=_0xa35e[_0x57c1af];return _0x1fe8c9;};'use strict';var _=require(_0xea35('0x0'));var util=require('util');var logger=require(_0xea35('0x1'))(_0xea35('0x2'));var moment=require(_0xea35('0x3'));var BPromise=require(_0xea35('0x4'));var rp=require(_0xea35('0x5'));var fs=require('fs');var path=require(_0xea35('0x6'));var rimraf=require(_0xea35('0x7'));var config=require(_0xea35('0x8'));var attributes=require(_0xea35('0x9'));module[_0xea35('0xa')]=function(_0x3d2b41,_0x3dc645){return _0x3d2b41[_0xea35('0xb')](_0xea35('0xc'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2da6=['moment','bluebird','request-promise','path','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api'];(function(_0x4e6c2d,_0x10ebd0){var _0x2008aa=function(_0x13d0fc){while(--_0x13d0fc){_0x4e6c2d['push'](_0x4e6c2d['shift']());}};_0x2008aa(++_0x10ebd0);}(_0x2da6,0x1dd));var _0x62da=function(_0x36e68c,_0x2938c4){_0x36e68c=_0x36e68c-0x0;var _0x3a521e=_0x2da6[_0x36e68c];return _0x3a521e;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var logger=require(_0x62da('0x2'))(_0x62da('0x3'));var moment=require(_0x62da('0x4'));var BPromise=require(_0x62da('0x5'));var rp=require(_0x62da('0x6'));var fs=require('fs');var path=require(_0x62da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62da('0x8'));module[_0x62da('0x9')]=function(_0x3a59f8,_0x30437f){return _0x3a59f8[_0x62da('0xa')](_0x62da('0xb'),attributes,{'tableName':_0x62da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9e042ef..5a0d74c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7ba=['client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','stringify','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4aa869,_0x20fac6){var _0x45d201=function(_0x311fb5){while(--_0x311fb5){_0x4aa869['push'](_0x4aa869['shift']());}};_0x45d201(++_0x20fac6);}(_0xc7ba,0xfc));var _0xac7b=function(_0x1f970b,_0x50d83c){_0x1f970b=_0x1f970b-0x0;var _0x2a5ef0=_0xc7ba[_0x1f970b];return _0x2a5ef0;};'use strict';var _=require('lodash');var util=require(_0xac7b('0x0'));var moment=require(_0xac7b('0x1'));var BPromise=require('bluebird');var rs=require(_0xac7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac7b('0x3'))['db'];var utils=require(_0xac7b('0x4'));var logger=require(_0xac7b('0x5'))(_0xac7b('0x6'));var config=require(_0xac7b('0x7'));var jayson=require(_0xac7b('0x8'));var client=jayson[_0xac7b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49c888,_0x488ad8,_0x5e256b){return new BPromise(function(_0x3855b3,_0x52b10e){return client[_0xac7b('0xa')](_0x49c888,_0x5e256b)[_0xac7b('0xb')](function(_0x3ab51b){logger[_0xac7b('0xc')](_0xac7b('0xd'),_0x488ad8,_0xac7b('0xe'));logger[_0xac7b('0xf')](_0xac7b('0x10'),_0x488ad8,'request\x20sent',JSON['stringify'](_0x3ab51b));if(_0x3ab51b[_0xac7b('0x11')]){if(_0x3ab51b[_0xac7b('0x11')][_0xac7b('0x12')]===0x1f4){logger[_0xac7b('0x11')](_0xac7b('0xd'),_0x488ad8,_0x3ab51b['error'][_0xac7b('0x13')]);return _0x52b10e(_0x3ab51b['error']['message']);}logger[_0xac7b('0x11')](_0xac7b('0xd'),_0x488ad8,_0x3ab51b['error']['message']);return _0x3855b3(_0x3ab51b['error'][_0xac7b('0x13')]);}else{logger[_0xac7b('0xc')](_0xac7b('0xd'),_0x488ad8,_0xac7b('0xe'));_0x3855b3(_0x3ab51b[_0xac7b('0x14')][_0xac7b('0x13')]);}})[_0xac7b('0x15')](function(_0x5bae69){logger['error'](_0xac7b('0xd'),_0x488ad8,_0x5bae69);_0x52b10e(_0x5bae69);});});}exports[_0xac7b('0x16')]=function(_0x248df6){var _0x536cd3=this;return new Promise(function(_0x2d0c7e,_0x386493){return db[_0xac7b('0x17')][_0xac7b('0x18')](_0x248df6[_0xac7b('0x19')],{'raw':_0x248df6[_0xac7b('0x1a')]?_0x248df6['options'][_0xac7b('0x1b')]===undefined?!![]:![]:!![]})[_0xac7b('0xb')](function(_0x2c67ce){logger[_0xac7b('0xc')](_0xac7b('0x16'),_0x248df6);logger[_0xac7b('0xf')](_0xac7b('0x16'),_0x248df6,JSON[_0xac7b('0x1c')](_0x2c67ce));_0x2d0c7e(_0x2c67ce);})['catch'](function(_0x212be3){logger[_0xac7b('0x11')](_0xac7b('0x16'),_0x212be3[_0xac7b('0x13')],_0x248df6);_0x386493(_0x536cd3[_0xac7b('0x11')](0x1f4,_0x212be3[_0xac7b('0x13')]));});});};
\ No newline at end of file
+var _0x3e5c=['create','options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateSquareRecording','SquareRecording'];(function(_0x26df35,_0x4a8b78){var _0x1944a5=function(_0xa27fe8){while(--_0xa27fe8){_0x26df35['push'](_0x26df35['shift']());}};_0x1944a5(++_0x4a8b78);}(_0x3e5c,0x6c));var _0xc3e5=function(_0x2a1a09,_0x5ca556){_0x2a1a09=_0x2a1a09-0x0;var _0x2add23=_0x3e5c[_0x2a1a09];return _0x2add23;};'use strict';var _=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var moment=require(_0xc3e5('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3e5('0x3'));var fs=require('fs');var Redis=require(_0xc3e5('0x4'));var db=require(_0xc3e5('0x5'))['db'];var utils=require(_0xc3e5('0x6'));var logger=require(_0xc3e5('0x7'))('rpc');var config=require(_0xc3e5('0x8'));var jayson=require(_0xc3e5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1f15,_0xd8d560,_0x1d6b0d){return new BPromise(function(_0x488a7b,_0x316809){return client[_0xc3e5('0xa')](_0x3b1f15,_0x1d6b0d)['then'](function(_0xb4d9c5){logger[_0xc3e5('0xb')](_0xc3e5('0xc'),_0xd8d560,_0xc3e5('0xd'));logger[_0xc3e5('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0xd8d560,'request\x20sent',JSON['stringify'](_0xb4d9c5));if(_0xb4d9c5[_0xc3e5('0xf')]){if(_0xb4d9c5[_0xc3e5('0xf')][_0xc3e5('0x10')]===0x1f4){logger[_0xc3e5('0xf')](_0xc3e5('0xc'),_0xd8d560,_0xb4d9c5[_0xc3e5('0xf')][_0xc3e5('0x11')]);return _0x316809(_0xb4d9c5[_0xc3e5('0xf')]['message']);}logger[_0xc3e5('0xf')]('SquareRecording,\x20%s,\x20%s',_0xd8d560,_0xb4d9c5[_0xc3e5('0xf')][_0xc3e5('0x11')]);return _0x488a7b(_0xb4d9c5[_0xc3e5('0xf')][_0xc3e5('0x11')]);}else{logger[_0xc3e5('0xb')](_0xc3e5('0xc'),_0xd8d560,_0xc3e5('0xd'));_0x488a7b(_0xb4d9c5[_0xc3e5('0x12')]['message']);}})[_0xc3e5('0x13')](function(_0x1d84a1){logger['error'](_0xc3e5('0xc'),_0xd8d560,_0x1d84a1);_0x316809(_0x1d84a1);});});}exports[_0xc3e5('0x14')]=function(_0x2191b9){var _0x522560=this;return new Promise(function(_0x36012b,_0x110f79){return db[_0xc3e5('0x15')][_0xc3e5('0x16')](_0x2191b9['body'],{'raw':_0x2191b9[_0xc3e5('0x17')]?_0x2191b9['options'][_0xc3e5('0x18')]===undefined?!![]:![]:!![]})[_0xc3e5('0x19')](function(_0x25ae7a){logger[_0xc3e5('0xb')]('CreateSquareRecording',_0x2191b9);logger[_0xc3e5('0xe')](_0xc3e5('0x14'),_0x2191b9,JSON['stringify'](_0x25ae7a));_0x36012b(_0x25ae7a);})['catch'](function(_0x54bf05){logger[_0xc3e5('0xf')](_0xc3e5('0x14'),_0x54bf05[_0xc3e5('0x11')],_0x2191b9);_0x110f79(_0x522560['error'](0x1f4,_0x54bf05[_0xc3e5('0x11')]));});});};
\ No newline at end of file
index 712e052..bd6424a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x3a0ebd,_0x47f368){var _0x51a660=function(_0x4023e6){while(--_0x4023e6){_0x3a0ebd['push'](_0x3a0ebd['shift']());}};_0x51a660(++_0x47f368);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 _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(_0x33d64a,_0x4195e7){var _0x74efab=function(_0xf2a76a){while(--_0xf2a76a){_0x33d64a['push'](_0x33d64a['shift']());}};_0x74efab(++_0x4195e7);}(_0xe706,0xa3));var _0x6e70=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xe706[_0x4709c0];return _0x13348b;};'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
index e6d9520..9a97f12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fd1=['STRING','DATE','sequelize','exports'];(function(_0x3ef818,_0x2d90f5){var _0x1a2106=function(_0x578475){while(--_0x578475){_0x3ef818['push'](_0x3ef818['shift']());}};_0x1a2106(++_0x2d90f5);}(_0x8fd1,0x182));var _0x18fd=function(_0x2f3b14,_0x554f94){_0x2f3b14=_0x2f3b14-0x0;var _0x20e924=_0x8fd1[_0x2f3b14];return _0x20e924;};'use strict';var Sequelize=require(_0x18fd('0x0'));module[_0x18fd('0x1')]={'network':{'type':Sequelize[_0x18fd('0x2')]},'network_script':{'type':Sequelize[_0x18fd('0x2')]},'request':{'type':Sequelize[_0x18fd('0x2')]},'channel':{'type':Sequelize[_0x18fd('0x2')]},'language':{'type':Sequelize[_0x18fd('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x18fd('0x2')]},'version':{'type':Sequelize[_0x18fd('0x2')]},'callerid':{'type':Sequelize[_0x18fd('0x2')]},'calleridname':{'type':Sequelize[_0x18fd('0x2')]},'callingpres':{'type':Sequelize[_0x18fd('0x2')]},'callingani2':{'type':Sequelize[_0x18fd('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x18fd('0x2')]},'rdnis':{'type':Sequelize[_0x18fd('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x18fd('0x2')]},'priority':{'type':Sequelize[_0x18fd('0x2')]},'enhanced':{'type':Sequelize[_0x18fd('0x2')]},'accountcode':{'type':Sequelize[_0x18fd('0x2')]},'threadid':{'type':Sequelize[_0x18fd('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x18fd('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x5317=['DATE','sequelize','exports','STRING'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0x5317,0x1ad));var _0x7531=function(_0x27d1bd,_0xb04627){_0x27d1bd=_0x27d1bd-0x0;var _0x72f82a=_0x5317[_0x27d1bd];return _0x72f82a;};'use strict';var Sequelize=require(_0x7531('0x0'));module[_0x7531('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x7531('0x2')]},'request':{'type':Sequelize[_0x7531('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7531('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x7531('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x7531('0x2')]},'callingani2':{'type':Sequelize[_0x7531('0x2')]},'callington':{'type':Sequelize[_0x7531('0x2')]},'callingtns':{'type':Sequelize[_0x7531('0x2')]},'dnid':{'type':Sequelize[_0x7531('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x7531('0x2')]},'priority':{'type':Sequelize[_0x7531('0x2')]},'enhanced':{'type':Sequelize[_0x7531('0x2')]},'accountcode':{'type':Sequelize[_0x7531('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x7531('0x2')]},'joinAt':{'type':Sequelize[_0x7531('0x3')]},'leaveAt':{'type':Sequelize[_0x7531('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 1bfc76b..3d6ab83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f14=['mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','length','includeAll','include','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x33de54,_0x5434b9){var _0x18fe1f=function(_0x3fe66c){while(--_0x3fe66c){_0x33de54['push'](_0x33de54['shift']());}};_0x18fe1f(++_0x5434b9);}(_0x7f14,0x132));var _0x47f1=function(_0x34fc81,_0x2ebc54){_0x34fc81=_0x34fc81-0x0;var _0x23d702=_0x7f14[_0x34fc81];return _0x23d702;};'use strict';var emlformat=require(_0x47f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x47f1('0x1'));var jsonpatch=require(_0x47f1('0x2'));var rp=require(_0x47f1('0x3'));var moment=require(_0x47f1('0x4'));var BPromise=require(_0x47f1('0x5'));var Mustache=require(_0x47f1('0x6'));var util=require(_0x47f1('0x7'));var path=require(_0x47f1('0x8'));var sox=require(_0x47f1('0x9'));var csv=require('to-csv');var ejs=require(_0x47f1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x47f1('0xb'));var squel=require(_0x47f1('0xc'));var crypto=require(_0x47f1('0xd'));var jsforce=require(_0x47f1('0xe'));var deskjs=require(_0x47f1('0xf'));var toCsv=require(_0x47f1('0x10'));var querystring=require(_0x47f1('0x11'));var Papa=require(_0x47f1('0x12'));var Redis=require(_0x47f1('0x13'));var authService=require(_0x47f1('0x14'));var qs=require(_0x47f1('0x15'));var as=require(_0x47f1('0x16'));var hardwareService=require(_0x47f1('0x17'));var logger=require(_0x47f1('0x18'))(_0x47f1('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x47f1('0x1a'))['db'];function respondWithStatusCode(_0x53db4e,_0x2d148b){_0x2d148b=_0x2d148b||0xcc;return function(_0x202aeb){if(_0x202aeb){return _0x53db4e['sendStatus'](_0x2d148b);}return _0x53db4e['status'](_0x2d148b)[_0x47f1('0x1b')]();};}function respondWithResult(_0x48ce23,_0x2ea4f4){_0x2ea4f4=_0x2ea4f4||0xc8;return function(_0x1ba1cf){if(_0x1ba1cf){return _0x48ce23[_0x47f1('0x1c')](_0x2ea4f4)[_0x47f1('0x1d')](_0x1ba1cf);}};}function respondWithFilteredResult(_0x332433,_0x3004da){return function(_0x349f78){if(_0x349f78){var _0x7d32c7=typeof _0x3004da['offset']===_0x47f1('0x1e')&&typeof _0x3004da[_0x47f1('0x1f')]===_0x47f1('0x1e');var _0x18276a=_0x349f78[_0x47f1('0x20')];var _0x53cc6d=_0x7d32c7?0x0:_0x3004da[_0x47f1('0x21')];var _0xf2df32=_0x7d32c7?_0x349f78[_0x47f1('0x20')]:_0x3004da['offset']+_0x3004da[_0x47f1('0x1f')];var _0x2d86bd;if(_0xf2df32>=_0x18276a){_0xf2df32=_0x18276a;_0x2d86bd=0xc8;}else{_0x2d86bd=0xce;}_0x332433[_0x47f1('0x1c')](_0x2d86bd);return _0x332433['set'](_0x47f1('0x22'),_0x53cc6d+'-'+_0xf2df32+'/'+_0x18276a)[_0x47f1('0x1d')](_0x349f78);}return null;};}function patchUpdates(_0x3bba54){return function(_0x961fa9){try{jsonpatch[_0x47f1('0x23')](_0x961fa9,_0x3bba54,!![]);}catch(_0x20b2cf){return BPromise[_0x47f1('0x24')](_0x20b2cf);}return _0x961fa9[_0x47f1('0x25')]();};}function saveUpdates(_0x4508d9,_0x5c4375){return function(_0x1c0e64){if(_0x1c0e64){return _0x1c0e64[_0x47f1('0x26')](_0x4508d9)[_0x47f1('0x27')](function(_0x328bf3){return _0x328bf3;});}return null;};}function removeEntity(_0x1cf2b8,_0x4cab8d){return function(_0x13ce44){if(_0x13ce44){return _0x13ce44[_0x47f1('0x28')]()[_0x47f1('0x27')](function(){_0x1cf2b8[_0x47f1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x585dc3,_0x25d133){return function(_0x2ca12b){if(!_0x2ca12b){_0x585dc3[_0x47f1('0x29')](0x194);}return _0x2ca12b;};}function handleError(_0x32d073,_0x39e2ec){_0x39e2ec=_0x39e2ec||0x1f4;return function(_0x450dac){logger['error'](_0x450dac[_0x47f1('0x2a')]);if(_0x450dac[_0x47f1('0x2b')]){delete _0x450dac[_0x47f1('0x2b')];}_0x32d073[_0x47f1('0x1c')](_0x39e2ec)['send'](_0x450dac);};}exports['index']=function(_0x197da5,_0x616bb8){var _0x1edd9e={},_0x5b85c6={},_0x3a7ff5={'count':0x0,'rows':[]};var _0x334112=_[_0x47f1('0x2c')](db[_0x47f1('0x2d')][_0x47f1('0x2e')],function(_0xdede2e){return{'name':_0xdede2e[_0x47f1('0x2f')],'type':_0xdede2e[_0x47f1('0x30')][_0x47f1('0x31')]};});_0x5b85c6[_0x47f1('0x32')]=_['map'](_0x334112,'name');_0x5b85c6[_0x47f1('0x33')]=_[_0x47f1('0x34')](_0x197da5['query']);_0x5b85c6['filters']=_[_0x47f1('0x35')](_0x5b85c6['model'],_0x5b85c6[_0x47f1('0x33')]);_0x1edd9e[_0x47f1('0x36')]=_[_0x47f1('0x35')](_0x5b85c6['model'],qs['fields'](_0x197da5[_0x47f1('0x33')][_0x47f1('0x37')]));_0x1edd9e[_0x47f1('0x36')]=_0x1edd9e[_0x47f1('0x36')]['length']?_0x1edd9e[_0x47f1('0x36')]:_0x5b85c6['model'];if(!_0x197da5[_0x47f1('0x33')][_0x47f1('0x38')](_0x47f1('0x39'))){_0x1edd9e[_0x47f1('0x1f')]=qs[_0x47f1('0x1f')](_0x197da5[_0x47f1('0x33')][_0x47f1('0x1f')]);_0x1edd9e[_0x47f1('0x21')]=qs[_0x47f1('0x21')](_0x197da5[_0x47f1('0x33')][_0x47f1('0x21')]);}_0x1edd9e[_0x47f1('0x3a')]=qs[_0x47f1('0x3b')](_0x197da5[_0x47f1('0x33')][_0x47f1('0x3b')]);_0x1edd9e[_0x47f1('0x3c')]=qs[_0x47f1('0x3d')](_[_0x47f1('0x3e')](_0x197da5[_0x47f1('0x33')],_0x5b85c6[_0x47f1('0x3d')]),_0x334112);if(_0x197da5[_0x47f1('0x33')][_0x47f1('0x3f')]){_0x1edd9e[_0x47f1('0x3c')]=_[_0x47f1('0x40')](_0x1edd9e[_0x47f1('0x3c')],{'$or':_[_0x47f1('0x2c')](_0x334112,function(_0x3f2f76){if(_0x3f2f76[_0x47f1('0x30')]!==_0x47f1('0x41')){var _0x2d74c4={};_0x2d74c4[_0x3f2f76[_0x47f1('0x2b')]]={'$like':'%'+_0x197da5[_0x47f1('0x33')]['filter']+'%'};return _0x2d74c4;}})});}_0x1edd9e=_[_0x47f1('0x40')]({},_0x1edd9e,_0x197da5[_0x47f1('0x42')]);var _0x20aec9={'where':_0x1edd9e[_0x47f1('0x3c')]};return db[_0x47f1('0x2d')]['count'](_0x20aec9)[_0x47f1('0x27')](function(_0x5d46c3){_0x3a7ff5['count']=_0x5d46c3;if(_0x197da5[_0x47f1('0x33')]['includeAll']){_0x1edd9e['include']=[{'all':!![]}];}return db[_0x47f1('0x2d')]['findAll'](_0x1edd9e);})[_0x47f1('0x27')](function(_0x299731){_0x3a7ff5[_0x47f1('0x43')]=_0x299731;return _0x3a7ff5;})[_0x47f1('0x27')](respondWithFilteredResult(_0x616bb8,_0x1edd9e))[_0x47f1('0x44')](handleError(_0x616bb8,null));};exports[_0x47f1('0x45')]=function(_0x3e799f,_0x4dcfd6){var _0x42249c={'raw':!![],'where':{'id':_0x3e799f[_0x47f1('0x46')]['id']}},_0x9e30ca={};_0x9e30ca[_0x47f1('0x32')]=_[_0x47f1('0x34')](db[_0x47f1('0x2d')]['rawAttributes']);_0x9e30ca[_0x47f1('0x33')]=_['keys'](_0x3e799f['query']);_0x9e30ca[_0x47f1('0x3d')]=_[_0x47f1('0x35')](_0x9e30ca['model'],_0x9e30ca[_0x47f1('0x33')]);_0x42249c[_0x47f1('0x36')]=_[_0x47f1('0x35')](_0x9e30ca[_0x47f1('0x32')],qs[_0x47f1('0x37')](_0x3e799f[_0x47f1('0x33')]['fields']));_0x42249c[_0x47f1('0x36')]=_0x42249c[_0x47f1('0x36')][_0x47f1('0x47')]?_0x42249c[_0x47f1('0x36')]:_0x9e30ca[_0x47f1('0x32')];if(_0x3e799f['query'][_0x47f1('0x48')]){_0x42249c[_0x47f1('0x49')]=[{'all':!![]}];}_0x42249c=_[_0x47f1('0x40')]({},_0x42249c,_0x3e799f['options']);return db['SquareReport']['find'](_0x42249c)[_0x47f1('0x27')](handleEntityNotFound(_0x4dcfd6,null))[_0x47f1('0x27')](respondWithResult(_0x4dcfd6,null))[_0x47f1('0x44')](handleError(_0x4dcfd6,null));};exports[_0x47f1('0x4a')]=function(_0x1d08d9,_0xf565eb){return db[_0x47f1('0x2d')][_0x47f1('0x4a')](_0x1d08d9['body'],{})[_0x47f1('0x27')](respondWithResult(_0xf565eb,0xc9))[_0x47f1('0x44')](handleError(_0xf565eb,null));};exports[_0x47f1('0x26')]=function(_0x54dd14,_0x54a716){if(_0x54dd14[_0x47f1('0x4b')]['id']){delete _0x54dd14[_0x47f1('0x4b')]['id'];}return db[_0x47f1('0x2d')][_0x47f1('0x4c')]({'where':{'id':_0x54dd14[_0x47f1('0x46')]['id']}})[_0x47f1('0x27')](handleEntityNotFound(_0x54a716,null))['then'](saveUpdates(_0x54dd14['body'],null))['then'](respondWithResult(_0x54a716,null))['catch'](handleError(_0x54a716,null));};exports['destroy']=function(_0x54e45a,_0xa155db){return db['SquareReport'][_0x47f1('0x4c')]({'where':{'id':_0x54e45a[_0x47f1('0x46')]['id']}})[_0x47f1('0x27')](handleEntityNotFound(_0xa155db,null))['then'](removeEntity(_0xa155db,null))[_0x47f1('0x44')](handleError(_0xa155db,null));};exports['describe']=function(_0x113035,_0xbba39b){return db[_0x47f1('0x2d')][_0x47f1('0x4d')]()[_0x47f1('0x27')](respondWithResult(_0xbba39b,null))['catch'](handleError(_0xbba39b,null));};
\ No newline at end of file
+var _0x2a45=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','SquareReport','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xe6cf5e,_0x95f17a){var _0x168722=function(_0x14a950){while(--_0x14a950){_0xe6cf5e['push'](_0xe6cf5e['shift']());}};_0x168722(++_0x95f17a);}(_0x2a45,0x91));var _0x52a4=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x2a45[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require(_0x52a4('0x0'));var rimraf=require(_0x52a4('0x1'));var zipdir=require(_0x52a4('0x2'));var jsonpatch=require(_0x52a4('0x3'));var rp=require(_0x52a4('0x4'));var moment=require('moment');var BPromise=require(_0x52a4('0x5'));var Mustache=require(_0x52a4('0x6'));var util=require('util');var path=require(_0x52a4('0x7'));var sox=require(_0x52a4('0x8'));var csv=require(_0x52a4('0x9'));var ejs=require(_0x52a4('0xa'));var fs=require('fs');var fs_extra=require(_0x52a4('0xb'));var _=require(_0x52a4('0xc'));var squel=require(_0x52a4('0xd'));var crypto=require('crypto');var jsforce=require(_0x52a4('0xe'));var deskjs=require(_0x52a4('0xf'));var toCsv=require(_0x52a4('0x9'));var querystring=require(_0x52a4('0x10'));var Papa=require(_0x52a4('0x11'));var Redis=require(_0x52a4('0x12'));var authService=require(_0x52a4('0x13'));var qs=require(_0x52a4('0x14'));var as=require(_0x52a4('0x15'));var hardwareService=require(_0x52a4('0x16'));var logger=require(_0x52a4('0x17'))(_0x52a4('0x18'));var utils=require('../../config/utils');var config=require(_0x52a4('0x19'));var licenseUtil=require(_0x52a4('0x1a'));var db=require(_0x52a4('0x1b'))['db'];function respondWithStatusCode(_0x5fecba,_0x5bb166){_0x5bb166=_0x5bb166||0xcc;return function(_0x1eea7c){if(_0x1eea7c){return _0x5fecba[_0x52a4('0x1c')](_0x5bb166);}return _0x5fecba[_0x52a4('0x1d')](_0x5bb166)[_0x52a4('0x1e')]();};}function respondWithResult(_0x1b16ff,_0x6b569b){_0x6b569b=_0x6b569b||0xc8;return function(_0x48aeae){if(_0x48aeae){return _0x1b16ff[_0x52a4('0x1d')](_0x6b569b)[_0x52a4('0x1f')](_0x48aeae);}};}function respondWithFilteredResult(_0x412882,_0x48bc0e){return function(_0x56e1aa){if(_0x56e1aa){var _0x54c94c=typeof _0x48bc0e[_0x52a4('0x20')]==='undefined'&&typeof _0x48bc0e[_0x52a4('0x21')]===_0x52a4('0x22');var _0x48b832=_0x56e1aa[_0x52a4('0x23')];var _0xf555ba=_0x54c94c?0x0:_0x48bc0e[_0x52a4('0x20')];var _0x8d2b2f=_0x54c94c?_0x56e1aa[_0x52a4('0x23')]:_0x48bc0e[_0x52a4('0x20')]+_0x48bc0e[_0x52a4('0x21')];var _0x218ed2;if(_0x8d2b2f>=_0x48b832){_0x8d2b2f=_0x48b832;_0x218ed2=0xc8;}else{_0x218ed2=0xce;}_0x412882[_0x52a4('0x1d')](_0x218ed2);return _0x412882[_0x52a4('0x24')](_0x52a4('0x25'),_0xf555ba+'-'+_0x8d2b2f+'/'+_0x48b832)['json'](_0x56e1aa);}return null;};}function patchUpdates(_0x473ad5){return function(_0x59c0eb){try{jsonpatch[_0x52a4('0x26')](_0x59c0eb,_0x473ad5,!![]);}catch(_0x167649){return BPromise[_0x52a4('0x27')](_0x167649);}return _0x59c0eb[_0x52a4('0x28')]();};}function saveUpdates(_0x9f977d,_0x58167f){return function(_0xfbf281){if(_0xfbf281){return _0xfbf281[_0x52a4('0x29')](_0x9f977d)[_0x52a4('0x2a')](function(_0x1446e1){return _0x1446e1;});}return null;};}function removeEntity(_0x18e066,_0x56c62c){return function(_0x51fdfb){if(_0x51fdfb){return _0x51fdfb['destroy']()[_0x52a4('0x2a')](function(){_0x18e066[_0x52a4('0x1d')](0xcc)[_0x52a4('0x1e')]();});}};}function handleEntityNotFound(_0x5b52d2,_0x3e3ef3){return function(_0x2f9c73){if(!_0x2f9c73){_0x5b52d2[_0x52a4('0x1c')](0x194);}return _0x2f9c73;};}function handleError(_0x38ebcf,_0xb5811e){_0xb5811e=_0xb5811e||0x1f4;return function(_0x48b39f){logger[_0x52a4('0x2b')](_0x48b39f[_0x52a4('0x2c')]);if(_0x48b39f[_0x52a4('0x2d')]){delete _0x48b39f['name'];}_0x38ebcf[_0x52a4('0x1d')](_0xb5811e)['send'](_0x48b39f);};}exports[_0x52a4('0x2e')]=function(_0x5bb6e2,_0x22939b){var _0x3626c3={},_0x163540={},_0x35006b={'count':0x0,'rows':[]};var _0x13c494=_[_0x52a4('0x2f')](db[_0x52a4('0x30')]['rawAttributes'],function(_0x208106){return{'name':_0x208106['fieldName'],'type':_0x208106['type'][_0x52a4('0x31')]};});_0x163540[_0x52a4('0x32')]=_['map'](_0x13c494,_0x52a4('0x2d'));_0x163540[_0x52a4('0x33')]=_[_0x52a4('0x34')](_0x5bb6e2['query']);_0x163540[_0x52a4('0x35')]=_[_0x52a4('0x36')](_0x163540[_0x52a4('0x32')],_0x163540[_0x52a4('0x33')]);_0x3626c3['attributes']=_[_0x52a4('0x36')](_0x163540[_0x52a4('0x32')],qs[_0x52a4('0x37')](_0x5bb6e2[_0x52a4('0x33')][_0x52a4('0x37')]));_0x3626c3['attributes']=_0x3626c3[_0x52a4('0x38')][_0x52a4('0x39')]?_0x3626c3[_0x52a4('0x38')]:_0x163540['model'];if(!_0x5bb6e2['query'][_0x52a4('0x3a')](_0x52a4('0x3b'))){_0x3626c3[_0x52a4('0x21')]=qs[_0x52a4('0x21')](_0x5bb6e2['query'][_0x52a4('0x21')]);_0x3626c3[_0x52a4('0x20')]=qs[_0x52a4('0x20')](_0x5bb6e2['query'][_0x52a4('0x20')]);}_0x3626c3[_0x52a4('0x3c')]=qs[_0x52a4('0x3d')](_0x5bb6e2['query'][_0x52a4('0x3d')]);_0x3626c3[_0x52a4('0x3e')]=qs[_0x52a4('0x35')](_[_0x52a4('0x3f')](_0x5bb6e2[_0x52a4('0x33')],_0x163540[_0x52a4('0x35')]),_0x13c494);if(_0x5bb6e2[_0x52a4('0x33')][_0x52a4('0x40')]){_0x3626c3[_0x52a4('0x3e')]=_[_0x52a4('0x41')](_0x3626c3[_0x52a4('0x3e')],{'$or':_['map'](_0x13c494,function(_0x37251b){if(_0x37251b[_0x52a4('0x42')]!==_0x52a4('0x43')){var _0x196655={};_0x196655[_0x37251b[_0x52a4('0x2d')]]={'$like':'%'+_0x5bb6e2[_0x52a4('0x33')][_0x52a4('0x40')]+'%'};return _0x196655;}})});}_0x3626c3=_[_0x52a4('0x41')]({},_0x3626c3,_0x5bb6e2[_0x52a4('0x44')]);var _0x2b7d2b={'where':_0x3626c3['where']};return db[_0x52a4('0x30')][_0x52a4('0x23')](_0x2b7d2b)[_0x52a4('0x2a')](function(_0x578adc){_0x35006b[_0x52a4('0x23')]=_0x578adc;if(_0x5bb6e2[_0x52a4('0x33')][_0x52a4('0x45')]){_0x3626c3[_0x52a4('0x46')]=[{'all':!![]}];}return db[_0x52a4('0x30')]['findAll'](_0x3626c3);})[_0x52a4('0x2a')](function(_0x118afc){_0x35006b['rows']=_0x118afc;return _0x35006b;})['then'](respondWithFilteredResult(_0x22939b,_0x3626c3))[_0x52a4('0x47')](handleError(_0x22939b,null));};exports[_0x52a4('0x48')]=function(_0x2bf591,_0x40c444){var _0x5e31e2={'raw':!![],'where':{'id':_0x2bf591['params']['id']}},_0x259b90={};_0x259b90[_0x52a4('0x32')]=_[_0x52a4('0x34')](db[_0x52a4('0x30')][_0x52a4('0x49')]);_0x259b90[_0x52a4('0x33')]=_[_0x52a4('0x34')](_0x2bf591[_0x52a4('0x33')]);_0x259b90[_0x52a4('0x35')]=_['intersection'](_0x259b90[_0x52a4('0x32')],_0x259b90[_0x52a4('0x33')]);_0x5e31e2['attributes']=_[_0x52a4('0x36')](_0x259b90[_0x52a4('0x32')],qs[_0x52a4('0x37')](_0x2bf591[_0x52a4('0x33')][_0x52a4('0x37')]));_0x5e31e2[_0x52a4('0x38')]=_0x5e31e2['attributes']['length']?_0x5e31e2[_0x52a4('0x38')]:_0x259b90['model'];if(_0x2bf591[_0x52a4('0x33')]['includeAll']){_0x5e31e2[_0x52a4('0x46')]=[{'all':!![]}];}_0x5e31e2=_[_0x52a4('0x41')]({},_0x5e31e2,_0x2bf591['options']);return db['SquareReport'][_0x52a4('0x4a')](_0x5e31e2)[_0x52a4('0x2a')](handleEntityNotFound(_0x40c444,null))[_0x52a4('0x2a')](respondWithResult(_0x40c444,null))['catch'](handleError(_0x40c444,null));};exports[_0x52a4('0x4b')]=function(_0x568243,_0x2d6e9c){return db['SquareReport']['create'](_0x568243['body'],{})['then'](respondWithResult(_0x2d6e9c,0xc9))[_0x52a4('0x47')](handleError(_0x2d6e9c,null));};exports[_0x52a4('0x29')]=function(_0x11e876,_0x3ec10a){if(_0x11e876[_0x52a4('0x4c')]['id']){delete _0x11e876[_0x52a4('0x4c')]['id'];}return db[_0x52a4('0x30')][_0x52a4('0x4a')]({'where':{'id':_0x11e876[_0x52a4('0x4d')]['id']}})[_0x52a4('0x2a')](handleEntityNotFound(_0x3ec10a,null))['then'](saveUpdates(_0x11e876[_0x52a4('0x4c')],null))['then'](respondWithResult(_0x3ec10a,null))[_0x52a4('0x47')](handleError(_0x3ec10a,null));};exports[_0x52a4('0x4e')]=function(_0x511cdc,_0x851d92){return db['SquareReport'][_0x52a4('0x4a')]({'where':{'id':_0x511cdc[_0x52a4('0x4d')]['id']}})[_0x52a4('0x2a')](handleEntityNotFound(_0x851d92,null))[_0x52a4('0x2a')](removeEntity(_0x851d92,null))['catch'](handleError(_0x851d92,null));};exports[_0x52a4('0x4f')]=function(_0x2b527f,_0x3fcb22){return db['SquareReport'][_0x52a4('0x4f')]()[_0x52a4('0x2a')](respondWithResult(_0x3fcb22,null))[_0x52a4('0x47')](handleError(_0x3fcb22,null));};
\ No newline at end of file
index 995bc21..fb2f18a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bb2=['../../config/environment','./squareReport.attributes','exports','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','bluebird','path','rimraf'];(function(_0x11d265,_0x22d16c){var _0x14bfb7=function(_0x285d44){while(--_0x285d44){_0x11d265['push'](_0x11d265['shift']());}};_0x14bfb7(++_0x22d16c);}(_0x2bb2,0x1ac));var _0x22bb=function(_0x1a033a,_0x22b736){_0x1a033a=_0x1a033a-0x0;var _0x2dacfa=_0x2bb2[_0x1a033a];return _0x2dacfa;};'use strict';var _=require(_0x22bb('0x0'));var util=require(_0x22bb('0x1'));var logger=require('../../config/logger')(_0x22bb('0x2'));var moment=require('moment');var BPromise=require(_0x22bb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22bb('0x4'));var rimraf=require(_0x22bb('0x5'));var config=require(_0x22bb('0x6'));var attributes=require(_0x22bb('0x7'));module[_0x22bb('0x8')]=function(_0x199f84,_0x258aab){return _0x199f84['define'](_0x22bb('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x22bb('0xa'),'fields':[_0x22bb('0xb'),_0x22bb('0xc')]},{'name':_0x22bb('0xd'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa414=['../../config/environment','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','leaveAt','lodash','util','api','bluebird','rimraf'];(function(_0x2e3955,_0x18c718){var _0x347490=function(_0x321129){while(--_0x321129){_0x2e3955['push'](_0x2e3955['shift']());}};_0x347490(++_0x18c718);}(_0xa414,0xff));var _0x4a41=function(_0x1036fe,_0x2389b0){_0x1036fe=_0x1036fe-0x0;var _0x2d2782=_0xa414[_0x1036fe];return _0x2d2782;};'use strict';var _=require(_0x4a41('0x0'));var util=require(_0x4a41('0x1'));var logger=require('../../config/logger')(_0x4a41('0x2'));var moment=require('moment');var BPromise=require(_0x4a41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4a41('0x4'));var config=require(_0x4a41('0x5'));var attributes=require(_0x4a41('0x6'));module[_0x4a41('0x7')]=function(_0x144b2c,_0x380c01){return _0x144b2c[_0x4a41('0x8')]('SquareReport',attributes,{'tableName':_0x4a41('0x9'),'paranoid':![],'indexes':[{'name':_0x4a41('0xa'),'fields':[_0x4a41('0xb'),'project_name']},{'name':_0x4a41('0xc'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
index 49e92b3..8802504 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b6f=['CreateSquareReport','SquareReport','create','body','options','raw','then','info','UpdateSquareReport','update','limit','util','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x5b6f,0xeb));var _0xf5b6=function(_0x37d461,_0x3f7ec9){_0x37d461=_0x37d461-0x0;var _0x49ae83=_0x5b6f[_0x37d461];return _0x49ae83;};'use strict';var _=require('lodash');var util=require(_0xf5b6('0x0'));var moment=require('moment');var BPromise=require(_0xf5b6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5b6('0x2'));var db=require(_0xf5b6('0x3'))['db'];var utils=require(_0xf5b6('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf5b6('0x5'));var client=jayson['client'][_0xf5b6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1df5e3,_0x512832,_0x268a2c){return new BPromise(function(_0x57a240,_0x141b35){return client['request'](_0x1df5e3,_0x268a2c)['then'](function(_0x49c735){logger['info']('SquareReport,\x20%s,\x20%s',_0x512832,_0xf5b6('0x7'));logger[_0xf5b6('0x8')](_0xf5b6('0x9'),_0x512832,'request\x20sent',JSON[_0xf5b6('0xa')](_0x49c735));if(_0x49c735[_0xf5b6('0xb')]){if(_0x49c735[_0xf5b6('0xb')][_0xf5b6('0xc')]===0x1f4){logger[_0xf5b6('0xb')](_0xf5b6('0xd'),_0x512832,_0x49c735[_0xf5b6('0xb')][_0xf5b6('0xe')]);return _0x141b35(_0x49c735[_0xf5b6('0xb')][_0xf5b6('0xe')]);}logger['error'](_0xf5b6('0xd'),_0x512832,_0x49c735[_0xf5b6('0xb')][_0xf5b6('0xe')]);return _0x57a240(_0x49c735['error']['message']);}else{logger['info'](_0xf5b6('0xd'),_0x512832,'request\x20sent');_0x57a240(_0x49c735[_0xf5b6('0xf')][_0xf5b6('0xe')]);}})[_0xf5b6('0x10')](function(_0x159e0f){logger[_0xf5b6('0xb')](_0xf5b6('0xd'),_0x512832,_0x159e0f);_0x141b35(_0x159e0f);});});}exports[_0xf5b6('0x11')]=function(_0x4fd08e){var _0x1402b1=this;return new Promise(function(_0x5e376f,_0x472ce2){return db[_0xf5b6('0x12')][_0xf5b6('0x13')](_0x4fd08e[_0xf5b6('0x14')],{'raw':_0x4fd08e[_0xf5b6('0x15')]?_0x4fd08e['options'][_0xf5b6('0x16')]===undefined?!![]:![]:!![]})[_0xf5b6('0x17')](function(_0x826919){logger[_0xf5b6('0x18')](_0xf5b6('0x11'),_0x4fd08e);logger[_0xf5b6('0x8')]('CreateSquareReport',_0x4fd08e,JSON[_0xf5b6('0xa')](_0x826919));_0x5e376f(_0x826919);})[_0xf5b6('0x10')](function(_0x1db97a){logger[_0xf5b6('0xb')](_0xf5b6('0x11'),_0x1db97a['message'],_0x4fd08e);_0x472ce2(_0x1402b1[_0xf5b6('0xb')](0x1f4,_0x1db97a['message']));});});};exports[_0xf5b6('0x19')]=function(_0x2861bc){var _0x3b06e6=this;return new Promise(function(_0x145034,_0x3c0cca){return db[_0xf5b6('0x12')][_0xf5b6('0x1a')](_0x2861bc['body'],{'raw':_0x2861bc['options']?_0x2861bc['options'][_0xf5b6('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2861bc[_0xf5b6('0x15')]?_0x2861bc[_0xf5b6('0x15')]['where']||null:null,'attributes':_0x2861bc[_0xf5b6('0x15')]?_0x2861bc[_0xf5b6('0x15')]['attributes']||null:null,'limit':_0x2861bc[_0xf5b6('0x15')]?_0x2861bc[_0xf5b6('0x15')][_0xf5b6('0x1b')]||null:null})[_0xf5b6('0x17')](function(_0x2c4de6){logger['info'](_0xf5b6('0x19'),_0x2861bc);logger[_0xf5b6('0x8')](_0xf5b6('0x19'),_0x2861bc,JSON[_0xf5b6('0xa')](_0x2c4de6));_0x145034(_0x2c4de6);})[_0xf5b6('0x10')](function(_0x1ffbc7){logger[_0xf5b6('0xb')](_0xf5b6('0x19'),_0x1ffbc7[_0xf5b6('0xe')],_0x2861bc);_0x3c0cca(_0x3b06e6[_0xf5b6('0xb')](0x1f4,_0x1ffbc7[_0xf5b6('0xe')]));});});};
\ No newline at end of file
+var _0xb41b=['SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','update','raw','attributes','UpdateSquareReport','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x310cfb,_0x10b5ac){var _0x33735a=function(_0x1e1ae4){while(--_0x1e1ae4){_0x310cfb['push'](_0x310cfb['shift']());}};_0x33735a(++_0x10b5ac);}(_0xb41b,0x1b6));var _0xbb41=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb41b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbb41('0x0'));var util=require(_0xbb41('0x1'));var moment=require(_0xbb41('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb41('0x3'))['db'];var utils=require(_0xbb41('0x4'));var logger=require('../../config/logger')(_0xbb41('0x5'));var config=require(_0xbb41('0x6'));var jayson=require(_0xbb41('0x7'));var client=jayson[_0xbb41('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x539213,_0x3605c8,_0x55c5e4){return new BPromise(function(_0x483b05,_0x4cd009){return client[_0xbb41('0x9')](_0x539213,_0x55c5e4)[_0xbb41('0xa')](function(_0x416590){logger[_0xbb41('0xb')](_0xbb41('0xc'),_0x3605c8,_0xbb41('0xd'));logger[_0xbb41('0xe')](_0xbb41('0xf'),_0x3605c8,'request\x20sent',JSON['stringify'](_0x416590));if(_0x416590['error']){if(_0x416590[_0xbb41('0x10')][_0xbb41('0x11')]===0x1f4){logger['error'](_0xbb41('0xc'),_0x3605c8,_0x416590['error'][_0xbb41('0x12')]);return _0x4cd009(_0x416590[_0xbb41('0x10')][_0xbb41('0x12')]);}logger[_0xbb41('0x10')](_0xbb41('0xc'),_0x3605c8,_0x416590[_0xbb41('0x10')][_0xbb41('0x12')]);return _0x483b05(_0x416590[_0xbb41('0x10')][_0xbb41('0x12')]);}else{logger[_0xbb41('0xb')](_0xbb41('0xc'),_0x3605c8,_0xbb41('0xd'));_0x483b05(_0x416590[_0xbb41('0x13')][_0xbb41('0x12')]);}})[_0xbb41('0x14')](function(_0x12da54){logger[_0xbb41('0x10')](_0xbb41('0xc'),_0x3605c8,_0x12da54);_0x4cd009(_0x12da54);});});}exports[_0xbb41('0x15')]=function(_0x303f73){var _0x5271b5=this;return new Promise(function(_0x161f54,_0x51df1f){return db[_0xbb41('0x16')][_0xbb41('0x17')](_0x303f73[_0xbb41('0x18')],{'raw':_0x303f73[_0xbb41('0x19')]?_0x303f73[_0xbb41('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbb41('0xa')](function(_0x1b137c){logger['info'](_0xbb41('0x15'),_0x303f73);logger[_0xbb41('0xe')](_0xbb41('0x15'),_0x303f73,JSON['stringify'](_0x1b137c));_0x161f54(_0x1b137c);})[_0xbb41('0x14')](function(_0x538cc3){logger[_0xbb41('0x10')](_0xbb41('0x15'),_0x538cc3['message'],_0x303f73);_0x51df1f(_0x5271b5[_0xbb41('0x10')](0x1f4,_0x538cc3[_0xbb41('0x12')]));});});};exports['UpdateSquareReport']=function(_0x18eb86){var _0x51cded=this;return new Promise(function(_0x4d5f9f,_0x3e55f7){return db[_0xbb41('0x16')][_0xbb41('0x1a')](_0x18eb86[_0xbb41('0x18')],{'raw':_0x18eb86[_0xbb41('0x19')]?_0x18eb86['options'][_0xbb41('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18eb86[_0xbb41('0x19')]?_0x18eb86[_0xbb41('0x19')]['where']||null:null,'attributes':_0x18eb86[_0xbb41('0x19')]?_0x18eb86[_0xbb41('0x19')][_0xbb41('0x1c')]||null:null,'limit':_0x18eb86[_0xbb41('0x19')]?_0x18eb86['options']['limit']||null:null})[_0xbb41('0xa')](function(_0x2af1e2){logger[_0xbb41('0xb')](_0xbb41('0x1d'),_0x18eb86);logger[_0xbb41('0xe')]('UpdateSquareReport',_0x18eb86,JSON['stringify'](_0x2af1e2));_0x4d5f9f(_0x2af1e2);})[_0xbb41('0x14')](function(_0x32168e){logger[_0xbb41('0x10')]('UpdateSquareReport',_0x32168e[_0xbb41('0x12')],_0x18eb86);_0x3e55f7(_0x51cded[_0xbb41('0x10')](0x1f4,_0x32168e[_0xbb41('0x12')]));});});};
\ No newline at end of file
index 7b92357..4387c2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5a0=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0xa5a0,0x72));var _0x0a5a=function(_0x6c014a,_0x4e0d26){_0x6c014a=_0x6c014a-0x0;var _0x23f3ab=_0xa5a0[_0x6c014a];return _0x23f3ab;};'use strict';var multer=require(_0x0a5a('0x0'));var util=require(_0x0a5a('0x1'));var path=require(_0x0a5a('0x2'));var timeout=require(_0x0a5a('0x3'));var express=require('express');var router=express[_0x0a5a('0x4')]();var fs_extra=require(_0x0a5a('0x5'));var auth=require(_0x0a5a('0x6'));var interaction=require(_0x0a5a('0x7'));var config=require('../../config/environment');var controller=require(_0x0a5a('0x8'));router[_0x0a5a('0x9')]('/',auth[_0x0a5a('0xa')](),controller[_0x0a5a('0xb')]);router[_0x0a5a('0x9')](_0x0a5a('0xc'),auth[_0x0a5a('0xa')](),controller[_0x0a5a('0xd')]);router[_0x0a5a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0a5a('0xe')]);router[_0x0a5a('0xf')]('/',auth[_0x0a5a('0xa')](),controller[_0x0a5a('0x10')]);router[_0x0a5a('0x11')](_0x0a5a('0x12'),auth[_0x0a5a('0xa')](),controller[_0x0a5a('0x13')]);router[_0x0a5a('0x14')](_0x0a5a('0x12'),auth[_0x0a5a('0xa')](),controller[_0x0a5a('0x15')]);module[_0x0a5a('0x16')]=router;
\ No newline at end of file
+var _0x97c0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x9894ff,_0x9256ba){var _0x462988=function(_0x38f4ad){while(--_0x38f4ad){_0x9894ff['push'](_0x9894ff['shift']());}};_0x462988(++_0x9256ba);}(_0x97c0,0x172));var _0x097c=function(_0x4ba321,_0x106ec1){_0x4ba321=_0x4ba321-0x0;var _0x15c93b=_0x97c0[_0x4ba321];return _0x15c93b;};'use strict';var multer=require('multer');var util=require(_0x097c('0x0'));var path=require(_0x097c('0x1'));var timeout=require(_0x097c('0x2'));var express=require(_0x097c('0x3'));var router=express[_0x097c('0x4')]();var fs_extra=require(_0x097c('0x5'));var auth=require(_0x097c('0x6'));var interaction=require(_0x097c('0x7'));var config=require(_0x097c('0x8'));var controller=require(_0x097c('0x9'));router[_0x097c('0xa')]('/',auth[_0x097c('0xb')](),controller['index']);router['get'](_0x097c('0xc'),auth[_0x097c('0xb')](),controller['describe']);router[_0x097c('0xa')](_0x097c('0xd'),auth[_0x097c('0xb')](),controller[_0x097c('0xe')]);router[_0x097c('0xf')]('/',auth['isAuthenticated'](),controller[_0x097c('0x10')]);router[_0x097c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x097c('0x12')]);router[_0x097c('0x13')](_0x097c('0xd'),auth[_0x097c('0xb')](),controller[_0x097c('0x14')]);module[_0x097c('0x15')]=router;
\ No newline at end of file
index f6bca98..5e350a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabfa=['exports','STRING','TEXT','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xabfa,0xeb));var _0xaabf=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xabfa[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0xaabf('0x0'));module[_0xaabf('0x1')]={'uniqueid':{'type':Sequelize[_0xaabf('0x2')]},'node':{'type':Sequelize[_0xaabf('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xaabf('0x3')]},'project_name':{'type':Sequelize[_0xaabf('0x2')]},'callerid':{'type':Sequelize[_0xaabf('0x2')]}};
\ No newline at end of file
+var _0x8130=['sequelize','STRING','TEXT'];(function(_0x38cd13,_0x40822e){var _0x469ab7=function(_0x3ee90c){while(--_0x3ee90c){_0x38cd13['push'](_0x38cd13['shift']());}};_0x469ab7(++_0x40822e);}(_0x8130,0x1d4));var _0x0813=function(_0x48b10c,_0x152ea){_0x48b10c=_0x48b10c-0x0;var _0x4eb069=_0x8130[_0x48b10c];return _0x4eb069;};'use strict';var Sequelize=require(_0x0813('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x0813('0x1')]},'data':{'type':Sequelize[_0x0813('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0813('0x1')]}};
\ No newline at end of file
index 713ce5c..7138248 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff4d=['include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','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','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','end','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then'];(function(_0x263b1f,_0x3f2376){var _0x4aa612=function(_0x3cae79){while(--_0x3cae79){_0x263b1f['push'](_0x263b1f['shift']());}};_0x4aa612(++_0x3f2376);}(_0xff4d,0x181));var _0xdff4=function(_0x3b29ce,_0x13de5f){_0x3b29ce=_0x3b29ce-0x0;var _0x57b233=_0xff4d[_0x3b29ce];return _0x57b233;};'use strict';var emlformat=require(_0xdff4('0x0'));var rimraf=require(_0xdff4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdff4('0x2'));var BPromise=require(_0xdff4('0x3'));var Mustache=require(_0xdff4('0x4'));var util=require(_0xdff4('0x5'));var path=require(_0xdff4('0x6'));var sox=require(_0xdff4('0x7'));var csv=require('to-csv');var ejs=require(_0xdff4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdff4('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdff4('0xa'));var deskjs=require(_0xdff4('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdff4('0xc'));var Papa=require(_0xdff4('0xd'));var Redis=require(_0xdff4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdff4('0xf'));var as=require(_0xdff4('0x10'));var hardwareService=require(_0xdff4('0x11'));var logger=require(_0xdff4('0x12'))(_0xdff4('0x13'));var utils=require(_0xdff4('0x14'));var config=require(_0xdff4('0x15'));var licenseUtil=require(_0xdff4('0x16'));var db=require(_0xdff4('0x17'))['db'];function respondWithStatusCode(_0x3f0c7e,_0x22f3ee){_0x22f3ee=_0x22f3ee||0xcc;return function(_0x9c32d5){if(_0x9c32d5){return _0x3f0c7e[_0xdff4('0x18')](_0x22f3ee);}return _0x3f0c7e[_0xdff4('0x19')](_0x22f3ee)['end']();};}function respondWithResult(_0x579fc7,_0x8e37fe){_0x8e37fe=_0x8e37fe||0xc8;return function(_0x347481){if(_0x347481){return _0x579fc7[_0xdff4('0x19')](_0x8e37fe)['json'](_0x347481);}};}function respondWithFilteredResult(_0x101ffa,_0x43e1b6){return function(_0x33850c){if(_0x33850c){var _0x2141e4=typeof _0x43e1b6[_0xdff4('0x1a')]==='undefined'&&typeof _0x43e1b6[_0xdff4('0x1b')]===_0xdff4('0x1c');var _0x393461=_0x33850c[_0xdff4('0x1d')];var _0x2c13ee=_0x2141e4?0x0:_0x43e1b6[_0xdff4('0x1a')];var _0x295cf9=_0x2141e4?_0x33850c[_0xdff4('0x1d')]:_0x43e1b6[_0xdff4('0x1a')]+_0x43e1b6[_0xdff4('0x1b')];var _0x682831;if(_0x295cf9>=_0x393461){_0x295cf9=_0x393461;_0x682831=0xc8;}else{_0x682831=0xce;}_0x101ffa[_0xdff4('0x19')](_0x682831);return _0x101ffa[_0xdff4('0x1e')](_0xdff4('0x1f'),_0x2c13ee+'-'+_0x295cf9+'/'+_0x393461)['json'](_0x33850c);}return null;};}function patchUpdates(_0x2b6203){return function(_0x29b87c){try{jsonpatch[_0xdff4('0x20')](_0x29b87c,_0x2b6203,!![]);}catch(_0x387431){return BPromise[_0xdff4('0x21')](_0x387431);}return _0x29b87c[_0xdff4('0x22')]();};}function saveUpdates(_0xef4546,_0x22d890){return function(_0x23efba){if(_0x23efba){return _0x23efba['update'](_0xef4546)['then'](function(_0x469d74){return _0x469d74;});}return null;};}function removeEntity(_0x53fab8,_0x4b3c28){return function(_0x1045f8){if(_0x1045f8){return _0x1045f8[_0xdff4('0x23')]()['then'](function(){_0x53fab8[_0xdff4('0x19')](0xcc)[_0xdff4('0x24')]();});}};}function handleEntityNotFound(_0x585530,_0x3ea9ee){return function(_0x134ad0){if(!_0x134ad0){_0x585530[_0xdff4('0x18')](0x194);}return _0x134ad0;};}function handleError(_0x462648,_0x4e3f1c){_0x4e3f1c=_0x4e3f1c||0x1f4;return function(_0x25ece6){logger[_0xdff4('0x25')](_0x25ece6[_0xdff4('0x26')]);if(_0x25ece6[_0xdff4('0x27')]){delete _0x25ece6[_0xdff4('0x27')];}_0x462648[_0xdff4('0x19')](_0x4e3f1c)[_0xdff4('0x28')](_0x25ece6);};}exports[_0xdff4('0x29')]=function(_0x5b4ef1,_0x40653c){var _0x444902={},_0x38364f={},_0x126075={'count':0x0,'rows':[]};var _0x46f36b=_[_0xdff4('0x2a')](db[_0xdff4('0x2b')][_0xdff4('0x2c')],function(_0x3a3c6d){return{'name':_0x3a3c6d[_0xdff4('0x2d')],'type':_0x3a3c6d[_0xdff4('0x2e')][_0xdff4('0x2f')]};});_0x38364f[_0xdff4('0x30')]=_['map'](_0x46f36b,_0xdff4('0x27'));_0x38364f[_0xdff4('0x31')]=_[_0xdff4('0x32')](_0x5b4ef1[_0xdff4('0x31')]);_0x38364f[_0xdff4('0x33')]=_[_0xdff4('0x34')](_0x38364f[_0xdff4('0x30')],_0x38364f[_0xdff4('0x31')]);_0x444902[_0xdff4('0x35')]=_[_0xdff4('0x34')](_0x38364f[_0xdff4('0x30')],qs[_0xdff4('0x36')](_0x5b4ef1['query'][_0xdff4('0x36')]));_0x444902[_0xdff4('0x35')]=_0x444902['attributes']['length']?_0x444902[_0xdff4('0x35')]:_0x38364f['model'];if(!_0x5b4ef1[_0xdff4('0x31')][_0xdff4('0x37')]('nolimit')){_0x444902[_0xdff4('0x1b')]=qs[_0xdff4('0x1b')](_0x5b4ef1[_0xdff4('0x31')][_0xdff4('0x1b')]);_0x444902['offset']=qs['offset'](_0x5b4ef1[_0xdff4('0x31')]['offset']);}_0x444902[_0xdff4('0x38')]=qs[_0xdff4('0x39')](_0x5b4ef1[_0xdff4('0x31')][_0xdff4('0x39')]);_0x444902[_0xdff4('0x3a')]=qs[_0xdff4('0x33')](_[_0xdff4('0x3b')](_0x5b4ef1[_0xdff4('0x31')],_0x38364f['filters']),_0x46f36b);if(_0x5b4ef1[_0xdff4('0x31')][_0xdff4('0x3c')]){_0x444902[_0xdff4('0x3a')]=_[_0xdff4('0x3d')](_0x444902['where'],{'$or':_[_0xdff4('0x2a')](_0x46f36b,function(_0x139322){if(_0x139322[_0xdff4('0x2e')]!==_0xdff4('0x3e')){var _0x2f8007={};_0x2f8007[_0x139322[_0xdff4('0x27')]]={'$like':'%'+_0x5b4ef1[_0xdff4('0x31')][_0xdff4('0x3c')]+'%'};return _0x2f8007;}})});}_0x444902=_[_0xdff4('0x3d')]({},_0x444902,_0x5b4ef1[_0xdff4('0x3f')]);var _0x2a22a4={'where':_0x444902[_0xdff4('0x3a')]};return db[_0xdff4('0x2b')][_0xdff4('0x1d')](_0x2a22a4)[_0xdff4('0x40')](function(_0x2030e1){_0x126075[_0xdff4('0x1d')]=_0x2030e1;if(_0x5b4ef1[_0xdff4('0x31')]['includeAll']){_0x444902[_0xdff4('0x41')]=[{'all':!![]}];}return db[_0xdff4('0x2b')][_0xdff4('0x42')](_0x444902);})[_0xdff4('0x40')](function(_0x1e6cdd){_0x126075[_0xdff4('0x43')]=_0x1e6cdd;return _0x126075;})[_0xdff4('0x40')](respondWithFilteredResult(_0x40653c,_0x444902))[_0xdff4('0x44')](handleError(_0x40653c,null));};exports[_0xdff4('0x45')]=function(_0x460f0b,_0x4db5eb){var _0x3471ec={'raw':!![],'where':{'id':_0x460f0b['params']['id']}},_0x2ce9ae={};_0x2ce9ae[_0xdff4('0x30')]=_[_0xdff4('0x32')](db[_0xdff4('0x2b')][_0xdff4('0x2c')]);_0x2ce9ae[_0xdff4('0x31')]=_[_0xdff4('0x32')](_0x460f0b[_0xdff4('0x31')]);_0x2ce9ae[_0xdff4('0x33')]=_[_0xdff4('0x34')](_0x2ce9ae[_0xdff4('0x30')],_0x2ce9ae[_0xdff4('0x31')]);_0x3471ec['attributes']=_[_0xdff4('0x34')](_0x2ce9ae['model'],qs[_0xdff4('0x36')](_0x460f0b[_0xdff4('0x31')][_0xdff4('0x36')]));_0x3471ec[_0xdff4('0x35')]=_0x3471ec[_0xdff4('0x35')]['length']?_0x3471ec['attributes']:_0x2ce9ae[_0xdff4('0x30')];if(_0x460f0b[_0xdff4('0x31')]['includeAll']){_0x3471ec[_0xdff4('0x41')]=[{'all':!![]}];}_0x3471ec=_['merge']({},_0x3471ec,_0x460f0b[_0xdff4('0x3f')]);return db[_0xdff4('0x2b')][_0xdff4('0x46')](_0x3471ec)['then'](handleEntityNotFound(_0x4db5eb,null))['then'](respondWithResult(_0x4db5eb,null))['catch'](handleError(_0x4db5eb,null));};exports[_0xdff4('0x47')]=function(_0x49005f,_0x564fb4){return db[_0xdff4('0x2b')][_0xdff4('0x47')](_0x49005f['body'],{})[_0xdff4('0x40')](respondWithResult(_0x564fb4,0xc9))[_0xdff4('0x44')](handleError(_0x564fb4,null));};exports['update']=function(_0x4062b9,_0x4b79ee){if(_0x4062b9[_0xdff4('0x48')]['id']){delete _0x4062b9['body']['id'];}return db[_0xdff4('0x2b')][_0xdff4('0x46')]({'where':{'id':_0x4062b9[_0xdff4('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b79ee,null))['then'](saveUpdates(_0x4062b9['body'],null))[_0xdff4('0x40')](respondWithResult(_0x4b79ee,null))['catch'](handleError(_0x4b79ee,null));};exports[_0xdff4('0x23')]=function(_0x29d0d6,_0x2a5965){return db[_0xdff4('0x2b')]['find']({'where':{'id':_0x29d0d6['params']['id']}})[_0xdff4('0x40')](handleEntityNotFound(_0x2a5965,null))[_0xdff4('0x40')](removeEntity(_0x2a5965,null))[_0xdff4('0x44')](handleError(_0x2a5965,null));};exports['describe']=function(_0x5366ff,_0x385e71){return db[_0xdff4('0x2b')][_0xdff4('0x4a')]()[_0xdff4('0x40')](respondWithResult(_0x385e71,null))['catch'](handleError(_0x385e71,null));};
\ No newline at end of file
+var _0x4046=['status','end','json','undefined','count','offset','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','SquareDetailsReport','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','params','keys','rawAttributes','length','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x4046,0x7b));var _0x6404=function(_0x364d75,_0x4721f0){_0x364d75=_0x364d75-0x0;var _0x198ad7=_0x4046[_0x364d75];return _0x198ad7;};'use strict';var emlformat=require(_0x6404('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6404('0x1'));var jsonpatch=require(_0x6404('0x2'));var rp=require(_0x6404('0x3'));var moment=require(_0x6404('0x4'));var BPromise=require(_0x6404('0x5'));var Mustache=require(_0x6404('0x6'));var util=require(_0x6404('0x7'));var path=require('path');var sox=require(_0x6404('0x8'));var csv=require(_0x6404('0x9'));var ejs=require(_0x6404('0xa'));var fs=require('fs');var fs_extra=require(_0x6404('0xb'));var _=require(_0x6404('0xc'));var squel=require('squel');var crypto=require(_0x6404('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6404('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6404('0xf'));var Papa=require(_0x6404('0x10'));var Redis=require(_0x6404('0x11'));var authService=require(_0x6404('0x12'));var qs=require(_0x6404('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6404('0x14'));var logger=require('../../config/logger')(_0x6404('0x15'));var utils=require(_0x6404('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6404('0x17'))['db'];function respondWithStatusCode(_0xf1347c,_0x230917){_0x230917=_0x230917||0xcc;return function(_0x5870a8){if(_0x5870a8){return _0xf1347c[_0x6404('0x18')](_0x230917);}return _0xf1347c[_0x6404('0x19')](_0x230917)[_0x6404('0x1a')]();};}function respondWithResult(_0x516bdd,_0x4e9951){_0x4e9951=_0x4e9951||0xc8;return function(_0x10f4aa){if(_0x10f4aa){return _0x516bdd[_0x6404('0x19')](_0x4e9951)[_0x6404('0x1b')](_0x10f4aa);}};}function respondWithFilteredResult(_0x3df5f6,_0x14ecb2){return function(_0x552355){if(_0x552355){var _0x27b8ba=typeof _0x14ecb2['offset']===_0x6404('0x1c')&&typeof _0x14ecb2['limit']===_0x6404('0x1c');var _0x2d9523=_0x552355[_0x6404('0x1d')];var _0x553e93=_0x27b8ba?0x0:_0x14ecb2[_0x6404('0x1e')];var _0x217bd3=_0x27b8ba?_0x552355[_0x6404('0x1d')]:_0x14ecb2[_0x6404('0x1e')]+_0x14ecb2['limit'];var _0x3eff58;if(_0x217bd3>=_0x2d9523){_0x217bd3=_0x2d9523;_0x3eff58=0xc8;}else{_0x3eff58=0xce;}_0x3df5f6['status'](_0x3eff58);return _0x3df5f6[_0x6404('0x1f')]('Content-Range',_0x553e93+'-'+_0x217bd3+'/'+_0x2d9523)[_0x6404('0x1b')](_0x552355);}return null;};}function patchUpdates(_0x71ac46){return function(_0x2c6ec0){try{jsonpatch[_0x6404('0x20')](_0x2c6ec0,_0x71ac46,!![]);}catch(_0x543314){return BPromise[_0x6404('0x21')](_0x543314);}return _0x2c6ec0[_0x6404('0x22')]();};}function saveUpdates(_0x4850e6,_0x387135){return function(_0x50e437){if(_0x50e437){return _0x50e437[_0x6404('0x23')](_0x4850e6)['then'](function(_0x47d0e9){return _0x47d0e9;});}return null;};}function removeEntity(_0x509e44,_0x424a47){return function(_0x5e88c6){if(_0x5e88c6){return _0x5e88c6[_0x6404('0x24')]()[_0x6404('0x25')](function(){_0x509e44[_0x6404('0x19')](0xcc)[_0x6404('0x1a')]();});}};}function handleEntityNotFound(_0xbab10,_0x594c4){return function(_0x40b639){if(!_0x40b639){_0xbab10['sendStatus'](0x194);}return _0x40b639;};}function handleError(_0x584c67,_0x2417c3){_0x2417c3=_0x2417c3||0x1f4;return function(_0x17d8d6){logger['error'](_0x17d8d6[_0x6404('0x26')]);if(_0x17d8d6[_0x6404('0x27')]){delete _0x17d8d6[_0x6404('0x27')];}_0x584c67[_0x6404('0x19')](_0x2417c3)[_0x6404('0x28')](_0x17d8d6);};}exports[_0x6404('0x29')]=function(_0x1b778e,_0x215723){var _0x49e332={},_0x5305dd={},_0x5a0d09={'count':0x0,'rows':[]};var _0x50190a=_[_0x6404('0x2a')](db[_0x6404('0x2b')]['rawAttributes'],function(_0x1d9e9a){return{'name':_0x1d9e9a[_0x6404('0x2c')],'type':_0x1d9e9a['type'][_0x6404('0x2d')]};});_0x5305dd[_0x6404('0x2e')]=_[_0x6404('0x2a')](_0x50190a,'name');_0x5305dd[_0x6404('0x2f')]=_['keys'](_0x1b778e[_0x6404('0x2f')]);_0x5305dd['filters']=_[_0x6404('0x30')](_0x5305dd['model'],_0x5305dd[_0x6404('0x2f')]);_0x49e332[_0x6404('0x31')]=_['intersection'](_0x5305dd[_0x6404('0x2e')],qs[_0x6404('0x32')](_0x1b778e[_0x6404('0x2f')]['fields']));_0x49e332['attributes']=_0x49e332['attributes']['length']?_0x49e332[_0x6404('0x31')]:_0x5305dd[_0x6404('0x2e')];if(!_0x1b778e[_0x6404('0x2f')][_0x6404('0x33')](_0x6404('0x34'))){_0x49e332[_0x6404('0x35')]=qs['limit'](_0x1b778e[_0x6404('0x2f')][_0x6404('0x35')]);_0x49e332[_0x6404('0x1e')]=qs['offset'](_0x1b778e[_0x6404('0x2f')]['offset']);}_0x49e332[_0x6404('0x36')]=qs[_0x6404('0x37')](_0x1b778e['query'][_0x6404('0x37')]);_0x49e332[_0x6404('0x38')]=qs[_0x6404('0x39')](_['pick'](_0x1b778e[_0x6404('0x2f')],_0x5305dd[_0x6404('0x39')]),_0x50190a);if(_0x1b778e[_0x6404('0x2f')][_0x6404('0x3a')]){_0x49e332['where']=_[_0x6404('0x3b')](_0x49e332[_0x6404('0x38')],{'$or':_['map'](_0x50190a,function(_0x3ce621){if(_0x3ce621['type']!==_0x6404('0x3c')){var _0x214042={};_0x214042[_0x3ce621['name']]={'$like':'%'+_0x1b778e[_0x6404('0x2f')]['filter']+'%'};return _0x214042;}})});}_0x49e332=_[_0x6404('0x3b')]({},_0x49e332,_0x1b778e[_0x6404('0x3d')]);var _0x348100={'where':_0x49e332[_0x6404('0x38')]};return db[_0x6404('0x2b')][_0x6404('0x1d')](_0x348100)['then'](function(_0x1de3c2){_0x5a0d09[_0x6404('0x1d')]=_0x1de3c2;if(_0x1b778e[_0x6404('0x2f')]['includeAll']){_0x49e332[_0x6404('0x3e')]=[{'all':!![]}];}return db[_0x6404('0x2b')][_0x6404('0x3f')](_0x49e332);})[_0x6404('0x25')](function(_0x1f965e){_0x5a0d09['rows']=_0x1f965e;return _0x5a0d09;})[_0x6404('0x25')](respondWithFilteredResult(_0x215723,_0x49e332))[_0x6404('0x40')](handleError(_0x215723,null));};exports['show']=function(_0x2fa62b,_0x35cea0){var _0x4f0a6e={'raw':!![],'where':{'id':_0x2fa62b[_0x6404('0x41')]['id']}},_0x9a2354={};_0x9a2354['model']=_[_0x6404('0x42')](db['SquareDetailsReport'][_0x6404('0x43')]);_0x9a2354[_0x6404('0x2f')]=_[_0x6404('0x42')](_0x2fa62b['query']);_0x9a2354[_0x6404('0x39')]=_[_0x6404('0x30')](_0x9a2354['model'],_0x9a2354[_0x6404('0x2f')]);_0x4f0a6e[_0x6404('0x31')]=_[_0x6404('0x30')](_0x9a2354[_0x6404('0x2e')],qs['fields'](_0x2fa62b[_0x6404('0x2f')]['fields']));_0x4f0a6e['attributes']=_0x4f0a6e[_0x6404('0x31')][_0x6404('0x44')]?_0x4f0a6e[_0x6404('0x31')]:_0x9a2354['model'];if(_0x2fa62b[_0x6404('0x2f')][_0x6404('0x45')]){_0x4f0a6e['include']=[{'all':!![]}];}_0x4f0a6e=_[_0x6404('0x3b')]({},_0x4f0a6e,_0x2fa62b['options']);return db[_0x6404('0x2b')][_0x6404('0x46')](_0x4f0a6e)['then'](handleEntityNotFound(_0x35cea0,null))['then'](respondWithResult(_0x35cea0,null))[_0x6404('0x40')](handleError(_0x35cea0,null));};exports['create']=function(_0x52c919,_0x3d110b){return db[_0x6404('0x2b')][_0x6404('0x47')](_0x52c919['body'],{})[_0x6404('0x25')](respondWithResult(_0x3d110b,0xc9))['catch'](handleError(_0x3d110b,null));};exports['update']=function(_0x5630a5,_0x54ae2a){if(_0x5630a5[_0x6404('0x48')]['id']){delete _0x5630a5[_0x6404('0x48')]['id'];}return db[_0x6404('0x2b')][_0x6404('0x46')]({'where':{'id':_0x5630a5[_0x6404('0x41')]['id']}})['then'](handleEntityNotFound(_0x54ae2a,null))[_0x6404('0x25')](saveUpdates(_0x5630a5[_0x6404('0x48')],null))[_0x6404('0x25')](respondWithResult(_0x54ae2a,null))[_0x6404('0x40')](handleError(_0x54ae2a,null));};exports[_0x6404('0x24')]=function(_0x1b991d,_0x3876a4){return db[_0x6404('0x2b')][_0x6404('0x46')]({'where':{'id':_0x1b991d[_0x6404('0x41')]['id']}})['then'](handleEntityNotFound(_0x3876a4,null))[_0x6404('0x25')](removeEntity(_0x3876a4,null))[_0x6404('0x40')](handleError(_0x3876a4,null));};exports['describe']=function(_0x28045d,_0x2072ce){return db[_0x6404('0x2b')][_0x6404('0x49')]()[_0x6404('0x25')](respondWithResult(_0x2072ce,null))['catch'](handleError(_0x2072ce,null));};
\ No newline at end of file
index bdcac08..86e84bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7d0=['SquareDetailsReport','lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x4ebf37,_0x41886f){var _0x54a4d6=function(_0x42584a){while(--_0x42584a){_0x4ebf37['push'](_0x4ebf37['shift']());}};_0x54a4d6(++_0x41886f);}(_0xc7d0,0xe7));var _0x0c7d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc7d0[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x0c7d('0x0'));var util=require(_0x0c7d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c7d('0x2'));var BPromise=require(_0x0c7d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c7d('0x4'));var rimraf=require(_0x0c7d('0x5'));var config=require(_0x0c7d('0x6'));var attributes=require('./squareReportDetail.attributes');module[_0x0c7d('0x7')]=function(_0x41042f,_0x13e26c){return _0x41042f[_0x0c7d('0x8')](_0x0c7d('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb09f=['api','moment','bluebird','path','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xb09f,0xa6));var _0xfb09=function(_0x823cf0,_0x5495d7){_0x823cf0=_0x823cf0-0x0;var _0x370bb4=_0xb09f[_0x823cf0];return _0x370bb4;};'use strict';var _=require(_0xfb09('0x0'));var util=require('util');var logger=require(_0xfb09('0x1'))(_0xfb09('0x2'));var moment=require(_0xfb09('0x3'));var BPromise=require(_0xfb09('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb09('0x5'));var rimraf=require('rimraf');var config=require(_0xfb09('0x6'));var attributes=require(_0xfb09('0x7'));module[_0xfb09('0x8')]=function(_0x583927,_0x1fb446){return _0x583927[_0xfb09('0x9')](_0xfb09('0xa'),attributes,{'tableName':_0xfb09('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1bbf966..43a3ffe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49f8=['SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','then','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','info'];(function(_0x4631eb,_0x55649e){var _0x562eca=function(_0x25a436){while(--_0x25a436){_0x4631eb['push'](_0x4631eb['shift']());}};_0x562eca(++_0x55649e);}(_0x49f8,0xff));var _0x849f=function(_0x329ab8,_0x3295c7){_0x329ab8=_0x329ab8-0x0;var _0x5f3aa8=_0x49f8[_0x329ab8];return _0x5f3aa8;};'use strict';var _=require(_0x849f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x849f('0x1'));var rs=require(_0x849f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x849f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x849f('0x4'))('rpc');var config=require(_0x849f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x849f('0x6')][_0x849f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21f577,_0xb4c798,_0x33b630){return new BPromise(function(_0xc6443e,_0x565438){return client['request'](_0x21f577,_0x33b630)['then'](function(_0x306c11){logger[_0x849f('0x8')](_0x849f('0x9'),_0xb4c798,_0x849f('0xa'));logger[_0x849f('0xb')](_0x849f('0xc'),_0xb4c798,_0x849f('0xa'),JSON['stringify'](_0x306c11));if(_0x306c11[_0x849f('0xd')]){if(_0x306c11['error'][_0x849f('0xe')]===0x1f4){logger[_0x849f('0xd')](_0x849f('0x9'),_0xb4c798,_0x306c11[_0x849f('0xd')]['message']);return _0x565438(_0x306c11[_0x849f('0xd')][_0x849f('0xf')]);}logger[_0x849f('0xd')](_0x849f('0x9'),_0xb4c798,_0x306c11[_0x849f('0xd')]['message']);return _0xc6443e(_0x306c11['error'][_0x849f('0xf')]);}else{logger['info'](_0x849f('0x9'),_0xb4c798,_0x849f('0xa'));_0xc6443e(_0x306c11[_0x849f('0x10')][_0x849f('0xf')]);}})[_0x849f('0x11')](function(_0x19ba28){logger[_0x849f('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0xb4c798,_0x19ba28);_0x565438(_0x19ba28);});});}exports[_0x849f('0x12')]=function(_0x20bea7){var _0x189529=this;return new Promise(function(_0x541cd6,_0x1e4017){return db[_0x849f('0x13')]['create'](_0x20bea7[_0x849f('0x14')],{'raw':_0x20bea7[_0x849f('0x15')]?_0x20bea7['options']['raw']===undefined?!![]:![]:!![]})[_0x849f('0x16')](function(_0x11d183){logger[_0x849f('0x8')](_0x849f('0x12'),_0x20bea7);logger[_0x849f('0xb')](_0x849f('0x12'),_0x20bea7,JSON[_0x849f('0x17')](_0x11d183));_0x541cd6(_0x11d183);})[_0x849f('0x11')](function(_0x4b29f1){logger[_0x849f('0xd')](_0x849f('0x12'),_0x4b29f1[_0x849f('0xf')],_0x20bea7);_0x1e4017(_0x189529[_0x849f('0xd')](0x1f4,_0x4b29f1[_0x849f('0xf')]));});});};
\ No newline at end of file
+var _0xe2cf=['info','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x1bab70,_0x399ccf){_0x1bab70=_0x1bab70-0x0;var _0x44a639=_0xe2cf[_0x1bab70];return _0x44a639;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});}exports[_0xfe2c('0x13')]=function(_0x23242b){var _0x36aeec=this;return new Promise(function(_0x13f233,_0x4afea3){return db[_0xfe2c('0x14')][_0xfe2c('0x15')](_0x23242b[_0xfe2c('0x16')],{'raw':_0x23242b[_0xfe2c('0x17')]?_0x23242b['options'][_0xfe2c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4e9137){logger[_0xfe2c('0x19')](_0xfe2c('0x13'),_0x23242b);logger['debug'](_0xfe2c('0x13'),_0x23242b,JSON[_0xfe2c('0xd')](_0x4e9137));_0x13f233(_0x4e9137);})['catch'](function(_0x1bd50e){logger['error'](_0xfe2c('0x13'),_0x1bd50e[_0xfe2c('0x10')],_0x23242b);_0x4afea3(_0x36aeec[_0xfe2c('0xe')](0x1f4,_0x1bd50e[_0xfe2c('0x10')]));});});};
\ No newline at end of file
index 5d06c62..475cec1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7a5=['../../components/auth/service','./system.controller','isAuthenticated','get','exports','express','Router'];(function(_0x5ca353,_0x21eb37){var _0x4f2fe5=function(_0x14cd1b){while(--_0x14cd1b){_0x5ca353['push'](_0x5ca353['shift']());}};_0x4f2fe5(++_0x21eb37);}(_0xe7a5,0x140));var _0x5e7a=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0xe7a5[_0x35d4e9];return _0x5c2770;};'use strict';var express=require(_0x5e7a('0x0'));var router=express[_0x5e7a('0x1')]();var auth=require(_0x5e7a('0x2'));var controller=require(_0x5e7a('0x3'));router['get']('/',auth[_0x5e7a('0x4')](),controller['index']);router[_0x5e7a('0x5')]('/process/:pid/kill',auth[_0x5e7a('0x4')](),controller['killProcess']);module[_0x5e7a('0x6')]=router;
\ No newline at end of file
+var _0x6336=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports','Router','../../components/auth/service'];(function(_0x108340,_0x28030b){var _0xe8bf73=function(_0x5753e7){while(--_0x5753e7){_0x108340['push'](_0x108340['shift']());}};_0xe8bf73(++_0x28030b);}(_0x6336,0x1ae));var _0x6633=function(_0xcf610a,_0x11dcc5){_0xcf610a=_0xcf610a-0x0;var _0x4de265=_0x6336[_0xcf610a];return _0x4de265;};'use strict';var express=require('express');var router=express[_0x6633('0x0')]();var auth=require(_0x6633('0x1'));var controller=require(_0x6633('0x2'));router[_0x6633('0x3')]('/',auth[_0x6633('0x4')](),controller[_0x6633('0x5')]);router[_0x6633('0x3')](_0x6633('0x6'),auth['isAuthenticated'](),controller['killProcess']);module[_0x6633('0x7')]=router;
\ No newline at end of file
index 725af25..7900bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fa9=['lodash','error','inspect','name','status','send','index','then','catch','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','child_process','exec','../../config/logger','api','util','bluebird'];(function(_0x559571,_0x1b7b1d){var _0x42fe48=function(_0x5ee720){while(--_0x5ee720){_0x559571['push'](_0x559571['shift']());}};_0x42fe48(++_0x1b7b1d);}(_0x2fa9,0x1ee));var _0x92fa=function(_0x58a338,_0x3b972a){_0x58a338=_0x58a338-0x0;var _0x1f19e1=_0x2fa9[_0x58a338];return _0x1f19e1;};'use strict';var info=require('systeminformation');var exec=require(_0x92fa('0x0'))[_0x92fa('0x1')];var logger=require(_0x92fa('0x2'))(_0x92fa('0x3'));var util=require(_0x92fa('0x4'));var BPromise=require(_0x92fa('0x5'));var _=require(_0x92fa('0x6'));function handleError(_0x506c13,_0x33ace5,_0x518b8c){_0x33ace5=_0x33ace5||0x1f4;return function(_0x5855ed){logger[_0x92fa('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x518b8c,_0x33ace5,util[_0x92fa('0x8')](_0x5855ed,{'showHidden':![],'depth':null}));delete _0x5855ed[_0x92fa('0x9')];_0x506c13[_0x92fa('0xa')](_0x33ace5)[_0x92fa('0xb')](_0x5855ed);};}exports[_0x92fa('0xc')]=function(_0xec92bc,_0x5cb073){return info['getAllData']()[_0x92fa('0xd')](function(_0x542c00){return _0x5cb073[_0x92fa('0xa')](0xc8)['json'](_0x542c00);})[_0x92fa('0xe')](function(_0x5af0ae){return _0x5cb073[_0x92fa('0xa')](0x1f4)[_0x92fa('0xf')](_0x5af0ae);});};exports['killProcess']=function(_0x4840f8,_0x397113){var _0xdf1d4b=[_0x92fa('0x10')];return new BPromise(function(_0x5ccaaf,_0xdeaa0c){return exec(util[_0x92fa('0x11')](_0x92fa('0x12'),_0x4840f8[_0x92fa('0x13')]['pid']),function(_0x154cfa,_0x264d07,_0x5b2f88){if(_0x154cfa){return _0xdeaa0c(_0x154cfa);}return _0x5ccaaf(_0x264d07);});})[_0x92fa('0xd')](function(_0x5b46c9){var _0x3bbae3=![];var _0x204ee4=_0x5b46c9[_0x92fa('0x14')](/\n/);for(var _0x375201=0x0,_0x140f40=_0xdf1d4b[_0x92fa('0x15')];_0x375201<_0x140f40,_0x3bbae3===![];_0x375201+=0x1){if(_0x5b46c9['indexOf'](_0xdf1d4b[_0x375201])>=0x0){_0x3bbae3=!![];}}if(!_0x3bbae3){throw new Error(util[_0x92fa('0x11')](_0x92fa('0x16'),_0x4840f8[_0x92fa('0x13')][_0x92fa('0x17')]));}process[_0x92fa('0x18')](_0x4840f8[_0x92fa('0x13')]['pid'],'SIGINT');return _0x397113[_0x92fa('0xa')](0xc8)[_0x92fa('0xf')]({'message':util[_0x92fa('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x4840f8[_0x92fa('0x13')][_0x92fa('0x17')])});})['catch'](handleError(_0x397113,null,'killProcess'));};
\ No newline at end of file
+var _0x01b7=['inspect','name','status','index','json','killProcess','components/import/cm','format','params','pid','then','split','indexOf','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x353ae2,_0x462df3){var _0x46c63b=function(_0x123449){while(--_0x123449){_0x353ae2['push'](_0x353ae2['shift']());}};_0x46c63b(++_0x462df3);}(_0x01b7,0xc7));var _0x701b=function(_0x2734ee,_0x3e48ff){_0x2734ee=_0x2734ee-0x0;var _0x1d2d96=_0x01b7[_0x2734ee];return _0x1d2d96;};'use strict';var info=require(_0x701b('0x0'));var exec=require(_0x701b('0x1'))[_0x701b('0x2')];var logger=require(_0x701b('0x3'))('api');var util=require('util');var BPromise=require(_0x701b('0x4'));var _=require(_0x701b('0x5'));function handleError(_0x2d0d70,_0x5718da,_0x4a59a7){_0x5718da=_0x5718da||0x1f4;return function(_0x636b29){logger[_0x701b('0x6')](_0x701b('0x7'),_0x4a59a7,_0x5718da,util[_0x701b('0x8')](_0x636b29,{'showHidden':![],'depth':null}));delete _0x636b29[_0x701b('0x9')];_0x2d0d70[_0x701b('0xa')](_0x5718da)['send'](_0x636b29);};}exports[_0x701b('0xb')]=function(_0x3cf518,_0x4612d5){return info['getAllData']()['then'](function(_0x4cb1ab){return _0x4612d5[_0x701b('0xa')](0xc8)['json'](_0x4cb1ab);})['catch'](function(_0x3aaebf){return _0x4612d5[_0x701b('0xa')](0x1f4)[_0x701b('0xc')](_0x3aaebf);});};exports[_0x701b('0xd')]=function(_0x370167,_0x2107b7){var _0x2c7b8a=[_0x701b('0xe')];return new BPromise(function(_0x47a15c,_0x149c38){return exec(util[_0x701b('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x370167[_0x701b('0x10')][_0x701b('0x11')]),function(_0x5f07b4,_0x33e1c2,_0x2b6cb3){if(_0x5f07b4){return _0x149c38(_0x5f07b4);}return _0x47a15c(_0x33e1c2);});})[_0x701b('0x12')](function(_0x49e048){var _0x59205c=![];var _0x263de2=_0x49e048[_0x701b('0x13')](/\n/);for(var _0x4194f1=0x0,_0x5f445d=_0x2c7b8a['length'];_0x4194f1<_0x5f445d,_0x59205c===![];_0x4194f1+=0x1){if(_0x49e048[_0x701b('0x14')](_0x2c7b8a[_0x4194f1])>=0x0){_0x59205c=!![];}}if(!_0x59205c){throw new Error(util[_0x701b('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x370167[_0x701b('0x10')]['pid']));}process['kill'](_0x370167[_0x701b('0x10')]['pid'],'SIGINT');return _0x2107b7[_0x701b('0xa')](0xc8)[_0x701b('0xc')]({'message':util['format'](_0x701b('0x15'),_0x370167[_0x701b('0x10')][_0x701b('0x11')])});})[_0x701b('0x16')](handleError(_0x2107b7,null,_0x701b('0xd')));};
\ No newline at end of file
index 7197b1d..14e02a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x840f=['exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','./tag.controller','get','isAuthenticated','index','post','create','put','/:id','destroy'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0x840f,0xb5));var _0xf840=function(_0x4eb517,_0x385479){_0x4eb517=_0x4eb517-0x0;var _0x30e9ed=_0x840f[_0x4eb517];return _0x30e9ed;};'use strict';var multer=require(_0xf840('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf840('0x1'));var express=require('express');var router=express[_0xf840('0x2')]();var fs_extra=require(_0xf840('0x3'));var auth=require(_0xf840('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf840('0x5'));router[_0xf840('0x6')]('/',auth[_0xf840('0x7')](),controller[_0xf840('0x8')]);router[_0xf840('0x6')]('/:id',auth[_0xf840('0x7')](),controller['show']);router[_0xf840('0x9')]('/',auth[_0xf840('0x7')](),controller[_0xf840('0xa')]);router[_0xf840('0xb')](_0xf840('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf840('0xd')]);module[_0xf840('0xe')]=router;
\ No newline at end of file
+var _0x52ed=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','create','put','/:id','update','delete'];(function(_0x11b08d,_0x224f74){var _0x3d704a=function(_0x5be8dc){while(--_0x5be8dc){_0x11b08d['push'](_0x11b08d['shift']());}};_0x3d704a(++_0x224f74);}(_0x52ed,0x132));var _0xd52e=function(_0x18e3a1,_0xd51faa){_0x18e3a1=_0x18e3a1-0x0;var _0x69b4a1=_0x52ed[_0x18e3a1];return _0x69b4a1;};'use strict';var multer=require(_0xd52e('0x0'));var util=require(_0xd52e('0x1'));var path=require(_0xd52e('0x2'));var timeout=require(_0xd52e('0x3'));var express=require(_0xd52e('0x4'));var router=express['Router']();var fs_extra=require(_0xd52e('0x5'));var auth=require(_0xd52e('0x6'));var interaction=require(_0xd52e('0x7'));var config=require(_0xd52e('0x8'));var controller=require(_0xd52e('0x9'));router['get']('/',auth[_0xd52e('0xa')](),controller[_0xd52e('0xb')]);router['get']('/:id',auth[_0xd52e('0xa')](),controller['show']);router['post']('/',auth[_0xd52e('0xa')](),controller[_0xd52e('0xc')]);router[_0xd52e('0xd')](_0xd52e('0xe'),auth[_0xd52e('0xa')](),controller[_0xd52e('0xf')]);router[_0xd52e('0x10')](_0xd52e('0xe'),auth[_0xd52e('0xa')](),controller[_0xd52e('0x11')]);module[_0xd52e('0x12')]=router;
\ No newline at end of file
index 6693096..70032aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1123=['STRING','#0091EA'];(function(_0xd8370d,_0x41c9ad){var _0x43a13d=function(_0x3675e0){while(--_0x3675e0){_0xd8370d['push'](_0xd8370d['shift']());}};_0x43a13d(++_0x41c9ad);}(_0x1123,0x118));var _0x3112=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1123[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3112('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3112('0x0')],'defaultValue':_0x3112('0x1')},'description':{'type':Sequelize[_0x3112('0x0')]}};
\ No newline at end of file
+var _0x3e22=['exports','name','STRING','#0091EA'];(function(_0x15d707,_0x57ea06){var _0x280702=function(_0xcfb961){while(--_0xcfb961){_0x15d707['push'](_0x15d707['shift']());}};_0x280702(++_0x57ea06);}(_0x3e22,0xa8));var _0x23e2=function(_0x234491,_0x303898){_0x234491=_0x234491-0x0;var _0x4cac47=_0x3e22[_0x234491];return _0x4cac47;};'use strict';var Sequelize=require('sequelize');module[_0x23e2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x23e2('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x23e2('0x2')],'defaultValue':_0x23e2('0x3')},'description':{'type':Sequelize[_0x23e2('0x2')]}};
\ No newline at end of file
index 9f8ac1e..492a88b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d9b=['filter','type','options','Tag','rows','params','length','includeAll','include','merge','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0xfab330,_0x41d1a9){var _0x25441b=function(_0x2d104c){while(--_0x2d104c){_0xfab330['push'](_0xfab330['shift']());}};_0x25441b(++_0x41d1a9);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb8d9('0x0'));var rimraf=require(_0xb8d9('0x1'));var zipdir=require(_0xb8d9('0x2'));var jsonpatch=require(_0xb8d9('0x3'));var rp=require(_0xb8d9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8d9('0x5'));var util=require('util');var path=require(_0xb8d9('0x6'));var sox=require(_0xb8d9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8d9('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb8d9('0x9'));var toCsv=require(_0xb8d9('0xa'));var querystring=require(_0xb8d9('0xb'));var Papa=require(_0xb8d9('0xc'));var Redis=require(_0xb8d9('0xd'));var authService=require(_0xb8d9('0xe'));var qs=require(_0xb8d9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb8d9('0x10'));var logger=require('../../config/logger')(_0xb8d9('0x11'));var utils=require(_0xb8d9('0x12'));var config=require(_0xb8d9('0x13'));var licenseUtil=require(_0xb8d9('0x14'));var db=require(_0xb8d9('0x15'))['db'];function respondWithStatusCode(_0x13b1d8,_0x10b7fe){_0x10b7fe=_0x10b7fe||0xcc;return function(_0x265472){if(_0x265472){return _0x13b1d8[_0xb8d9('0x16')](_0x10b7fe);}return _0x13b1d8[_0xb8d9('0x17')](_0x10b7fe)[_0xb8d9('0x18')]();};}function respondWithResult(_0x4b0f9,_0x1bcb02){_0x1bcb02=_0x1bcb02||0xc8;return function(_0xb3fa68){if(_0xb3fa68){return _0x4b0f9['status'](_0x1bcb02)[_0xb8d9('0x19')](_0xb3fa68);}};}function respondWithFilteredResult(_0x2c5265,_0x513edf){return function(_0x24f33a){if(_0x24f33a){var _0x283780=typeof _0x513edf['offset']==='undefined'&&typeof _0x513edf['limit']===_0xb8d9('0x1a');var _0x2d1b34=_0x24f33a[_0xb8d9('0x1b')];var _0x1183e4=_0x283780?0x0:_0x513edf['offset'];var _0x31b33f=_0x283780?_0x24f33a['count']:_0x513edf[_0xb8d9('0x1c')]+_0x513edf[_0xb8d9('0x1d')];var _0x447367;if(_0x31b33f>=_0x2d1b34){_0x31b33f=_0x2d1b34;_0x447367=0xc8;}else{_0x447367=0xce;}_0x2c5265[_0xb8d9('0x17')](_0x447367);return _0x2c5265[_0xb8d9('0x1e')]('Content-Range',_0x1183e4+'-'+_0x31b33f+'/'+_0x2d1b34)['json'](_0x24f33a);}return null;};}function patchUpdates(_0x5444a5){return function(_0x42f600){try{jsonpatch[_0xb8d9('0x1f')](_0x42f600,_0x5444a5,!![]);}catch(_0x15495f){return BPromise[_0xb8d9('0x20')](_0x15495f);}return _0x42f600[_0xb8d9('0x21')]();};}function saveUpdates(_0x48c504,_0x963afa){return function(_0x430794){if(_0x430794){return _0x430794[_0xb8d9('0x22')](_0x48c504)[_0xb8d9('0x23')](function(_0x3cefe3){return _0x3cefe3;});}return null;};}function removeEntity(_0x1d94aa,_0x3f4b9d){return function(_0x3d1659){if(_0x3d1659){return _0x3d1659[_0xb8d9('0x24')]()[_0xb8d9('0x23')](function(){var _0x52df47=_0x3d1659[_0xb8d9('0x25')]({'plain':!![]});var _0x49380d='Tags';return db[_0xb8d9('0x26')][_0xb8d9('0x24')]({'where':{'type':_0x49380d,'resourceId':_0x52df47['id']}})[_0xb8d9('0x23')](function(){return _0x3d1659;});})[_0xb8d9('0x23')](function(){_0x1d94aa[_0xb8d9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x241041,_0x282db6){return function(_0x3111aa){if(!_0x3111aa){_0x241041['sendStatus'](0x194);}return _0x3111aa;};}function handleError(_0x2d1439,_0x1c9bd4){_0x1c9bd4=_0x1c9bd4||0x1f4;return function(_0x336918){logger['error'](_0x336918[_0xb8d9('0x27')]);if(_0x336918[_0xb8d9('0x28')]){delete _0x336918['name'];}_0x2d1439[_0xb8d9('0x17')](_0x1c9bd4)[_0xb8d9('0x29')](_0x336918);};}exports[_0xb8d9('0x2a')]=function(_0x1b1212,_0x358e4d){var _0x84b01c={},_0x13120c={},_0x27ed72={'count':0x0,'rows':[]};var _0x8674fc=_[_0xb8d9('0x2b')](db['Tag'][_0xb8d9('0x2c')],function(_0x374def){return{'name':_0x374def[_0xb8d9('0x2d')],'type':_0x374def['type'][_0xb8d9('0x2e')]};});_0x13120c[_0xb8d9('0x2f')]=_[_0xb8d9('0x2b')](_0x8674fc,_0xb8d9('0x28'));_0x13120c[_0xb8d9('0x30')]=_[_0xb8d9('0x31')](_0x1b1212['query']);_0x13120c['filters']=_[_0xb8d9('0x32')](_0x13120c[_0xb8d9('0x2f')],_0x13120c[_0xb8d9('0x30')]);_0x84b01c[_0xb8d9('0x33')]=_[_0xb8d9('0x32')](_0x13120c[_0xb8d9('0x2f')],qs['fields'](_0x1b1212['query'][_0xb8d9('0x34')]));_0x84b01c[_0xb8d9('0x33')]=_0x84b01c[_0xb8d9('0x33')]['length']?_0x84b01c[_0xb8d9('0x33')]:_0x13120c['model'];if(!_0x1b1212[_0xb8d9('0x30')][_0xb8d9('0x35')](_0xb8d9('0x36'))){_0x84b01c['limit']=qs[_0xb8d9('0x1d')](_0x1b1212[_0xb8d9('0x30')]['limit']);_0x84b01c['offset']=qs[_0xb8d9('0x1c')](_0x1b1212[_0xb8d9('0x30')][_0xb8d9('0x1c')]);}_0x84b01c[_0xb8d9('0x37')]=qs[_0xb8d9('0x38')](_0x1b1212[_0xb8d9('0x30')][_0xb8d9('0x38')]);_0x84b01c[_0xb8d9('0x39')]=qs[_0xb8d9('0x3a')](_[_0xb8d9('0x3b')](_0x1b1212[_0xb8d9('0x30')],_0x13120c[_0xb8d9('0x3a')]),_0x8674fc);if(_0x1b1212[_0xb8d9('0x30')][_0xb8d9('0x3c')]){_0x84b01c['where']=_['merge'](_0x84b01c[_0xb8d9('0x39')],{'$or':_[_0xb8d9('0x2b')](_0x8674fc,function(_0x364bb1){if(_0x364bb1[_0xb8d9('0x3d')]!=='VIRTUAL'){var _0x4b1d71={};_0x4b1d71[_0x364bb1[_0xb8d9('0x28')]]={'$like':'%'+_0x1b1212['query'][_0xb8d9('0x3c')]+'%'};return _0x4b1d71;}})});}_0x84b01c=_['merge']({},_0x84b01c,_0x1b1212[_0xb8d9('0x3e')]);var _0x5ae97b={'where':_0x84b01c[_0xb8d9('0x39')]};return db[_0xb8d9('0x3f')][_0xb8d9('0x1b')](_0x5ae97b)['then'](function(_0x40fd3e){_0x27ed72[_0xb8d9('0x1b')]=_0x40fd3e;if(_0x1b1212[_0xb8d9('0x30')]['includeAll']){_0x84b01c['include']=[{'all':!![]}];}return db['Tag']['findAll'](_0x84b01c);})['then'](function(_0xc1816a){_0x27ed72[_0xb8d9('0x40')]=_0xc1816a;return _0x27ed72;})[_0xb8d9('0x23')](respondWithFilteredResult(_0x358e4d,_0x84b01c))['catch'](handleError(_0x358e4d,null));};exports['show']=function(_0x142e54,_0x496d4f){var _0x13f7ce={'raw':!![],'where':{'id':_0x142e54[_0xb8d9('0x41')]['id']}},_0x25ae38={};_0x25ae38[_0xb8d9('0x2f')]=_[_0xb8d9('0x31')](db['Tag'][_0xb8d9('0x2c')]);_0x25ae38[_0xb8d9('0x30')]=_['keys'](_0x142e54[_0xb8d9('0x30')]);_0x25ae38[_0xb8d9('0x3a')]=_['intersection'](_0x25ae38['model'],_0x25ae38[_0xb8d9('0x30')]);_0x13f7ce[_0xb8d9('0x33')]=_[_0xb8d9('0x32')](_0x25ae38[_0xb8d9('0x2f')],qs[_0xb8d9('0x34')](_0x142e54['query'][_0xb8d9('0x34')]));_0x13f7ce[_0xb8d9('0x33')]=_0x13f7ce[_0xb8d9('0x33')][_0xb8d9('0x42')]?_0x13f7ce[_0xb8d9('0x33')]:_0x25ae38[_0xb8d9('0x2f')];if(_0x142e54['query'][_0xb8d9('0x43')]){_0x13f7ce[_0xb8d9('0x44')]=[{'all':!![]}];}_0x13f7ce=_[_0xb8d9('0x45')]({},_0x13f7ce,_0x142e54[_0xb8d9('0x3e')]);return db[_0xb8d9('0x3f')][_0xb8d9('0x46')](_0x13f7ce)['then'](handleEntityNotFound(_0x496d4f,null))[_0xb8d9('0x23')](respondWithResult(_0x496d4f,null))[_0xb8d9('0x47')](handleError(_0x496d4f,null));};exports['create']=function(_0x212310,_0x41f38b){return db['Tag']['create'](_0x212310[_0xb8d9('0x48')],{})[_0xb8d9('0x23')](function(_0x3c2a57){var _0xca2c82=_0x212310[_0xb8d9('0x49')][_0xb8d9('0x25')]({'plain':!![]});if(!_0xca2c82)throw new Error(_0xb8d9('0x4a'));if(_0xca2c82['role']===_0xb8d9('0x49')){var _0x431c21=_0x3c2a57[_0xb8d9('0x25')]({'plain':!![]});var _0x53575d=_0xb8d9('0x4b');return db[_0xb8d9('0x4c')]['find']({'where':{'name':_0x53575d,'userProfileId':_0xca2c82['userProfileId']},'raw':!![]})[_0xb8d9('0x23')](function(_0x213915){if(_0x213915&&_0x213915['autoAssociation']===0x0){return db[_0xb8d9('0x26')][_0xb8d9('0x4d')]({'name':_0x431c21[_0xb8d9('0x28')],'resourceId':_0x431c21['id'],'type':_0x213915[_0xb8d9('0x28')],'sectionId':_0x213915['id']},{})['then'](function(){return _0x3c2a57;});}else{return _0x3c2a57;}})[_0xb8d9('0x47')](function(_0x3d7ea6){logger[_0xb8d9('0x4e')](_0xb8d9('0x4f'),_0x3d7ea6);throw _0x3d7ea6;});}return _0x3c2a57;})[_0xb8d9('0x23')](respondWithResult(_0x41f38b,0xc9))[_0xb8d9('0x47')](handleError(_0x41f38b,null));};exports[_0xb8d9('0x22')]=function(_0x518bb4,_0x3101da){if(_0x518bb4['body']['id']){delete _0x518bb4[_0xb8d9('0x48')]['id'];}return db[_0xb8d9('0x3f')][_0xb8d9('0x46')]({'where':{'id':_0x518bb4['params']['id']}})[_0xb8d9('0x23')](handleEntityNotFound(_0x3101da,null))[_0xb8d9('0x23')](saveUpdates(_0x518bb4[_0xb8d9('0x48')],null))[_0xb8d9('0x23')](respondWithResult(_0x3101da,null))[_0xb8d9('0x47')](handleError(_0x3101da,null));};exports[_0xb8d9('0x24')]=function(_0x4533e5,_0x3480d1){return db[_0xb8d9('0x3f')][_0xb8d9('0x46')]({'where':{'id':_0x4533e5[_0xb8d9('0x41')]['id']}})['then'](handleEntityNotFound(_0x3480d1,null))[_0xb8d9('0x23')](removeEntity(_0x3480d1,null))[_0xb8d9('0x47')](handleError(_0x3480d1,null));};
\ No newline at end of file
+var _0x9f62=['name','send','index','Tag','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','map','filter','merge','options','count','includeAll','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','autoAssociation','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','then','get','UserProfileResource','error','stack'];(function(_0x1c3c0e,_0x1101cf){var _0x8d2169=function(_0x238b0e){while(--_0x238b0e){_0x1c3c0e['push'](_0x1c3c0e['shift']());}};_0x8d2169(++_0x1101cf);}(_0x9f62,0x154));var _0x29f6=function(_0x1b835e,_0x211544){_0x1b835e=_0x1b835e-0x0;var _0x46b7b7=_0x9f62[_0x1b835e];return _0x46b7b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29f6('0x1'));var rp=require(_0x29f6('0x2'));var moment=require(_0x29f6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f6('0x4'));var path=require(_0x29f6('0x5'));var sox=require(_0x29f6('0x6'));var csv=require(_0x29f6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f6('0x8'));var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f6('0xf'));var logger=require(_0x29f6('0x10'))('api');var utils=require(_0x29f6('0x11'));var config=require(_0x29f6('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x559585,_0x57b2d2){_0x57b2d2=_0x57b2d2||0xcc;return function(_0x2ae0e4){if(_0x2ae0e4){return _0x559585[_0x29f6('0x13')](_0x57b2d2);}return _0x559585[_0x29f6('0x14')](_0x57b2d2)[_0x29f6('0x15')]();};}function respondWithResult(_0x17de6e,_0x156c96){_0x156c96=_0x156c96||0xc8;return function(_0x35d2e2){if(_0x35d2e2){return _0x17de6e[_0x29f6('0x14')](_0x156c96)[_0x29f6('0x16')](_0x35d2e2);}};}function respondWithFilteredResult(_0x19331f,_0x28d314){return function(_0x370484){if(_0x370484){var _0x1dde97=typeof _0x28d314[_0x29f6('0x17')]===_0x29f6('0x18')&&typeof _0x28d314[_0x29f6('0x19')]===_0x29f6('0x18');var _0x5bfda7=_0x370484['count'];var _0x2e66d3=_0x1dde97?0x0:_0x28d314[_0x29f6('0x17')];var _0xb31436=_0x1dde97?_0x370484['count']:_0x28d314[_0x29f6('0x17')]+_0x28d314[_0x29f6('0x19')];var _0x49252f;if(_0xb31436>=_0x5bfda7){_0xb31436=_0x5bfda7;_0x49252f=0xc8;}else{_0x49252f=0xce;}_0x19331f[_0x29f6('0x14')](_0x49252f);return _0x19331f[_0x29f6('0x1a')](_0x29f6('0x1b'),_0x2e66d3+'-'+_0xb31436+'/'+_0x5bfda7)[_0x29f6('0x16')](_0x370484);}return null;};}function patchUpdates(_0xb6e7a9){return function(_0x2bfb3d){try{jsonpatch['apply'](_0x2bfb3d,_0xb6e7a9,!![]);}catch(_0xfb8fd2){return BPromise['reject'](_0xfb8fd2);}return _0x2bfb3d['save']();};}function saveUpdates(_0x470019,_0x1fa159){return function(_0x39c6b3){if(_0x39c6b3){return _0x39c6b3[_0x29f6('0x1c')](_0x470019)['then'](function(_0x2c672e){return _0x2c672e;});}return null;};}function removeEntity(_0x49f67d,_0xd4179c){return function(_0xcce041){if(_0xcce041){return _0xcce041[_0x29f6('0x1d')]()[_0x29f6('0x1e')](function(){var _0x4fc725=_0xcce041[_0x29f6('0x1f')]({'plain':!![]});var _0x4d494f='Tags';return db[_0x29f6('0x20')][_0x29f6('0x1d')]({'where':{'type':_0x4d494f,'resourceId':_0x4fc725['id']}})[_0x29f6('0x1e')](function(){return _0xcce041;});})[_0x29f6('0x1e')](function(){_0x49f67d[_0x29f6('0x14')](0xcc)[_0x29f6('0x15')]();});}};}function handleEntityNotFound(_0x23c630,_0x50cdd2){return function(_0x2183b7){if(!_0x2183b7){_0x23c630[_0x29f6('0x13')](0x194);}return _0x2183b7;};}function handleError(_0x1ab8d8,_0x3dace7){_0x3dace7=_0x3dace7||0x1f4;return function(_0xda0a63){logger[_0x29f6('0x21')](_0xda0a63[_0x29f6('0x22')]);if(_0xda0a63[_0x29f6('0x23')]){delete _0xda0a63[_0x29f6('0x23')];}_0x1ab8d8[_0x29f6('0x14')](_0x3dace7)[_0x29f6('0x24')](_0xda0a63);};}exports[_0x29f6('0x25')]=function(_0x40c830,_0x304c28){var _0x375564={},_0x218931={},_0x3a7249={'count':0x0,'rows':[]};var _0x5492c2=_['map'](db[_0x29f6('0x26')]['rawAttributes'],function(_0x341071){return{'name':_0x341071[_0x29f6('0x27')],'type':_0x341071[_0x29f6('0x28')][_0x29f6('0x29')]};});_0x218931['model']=_['map'](_0x5492c2,_0x29f6('0x23'));_0x218931[_0x29f6('0x2a')]=_[_0x29f6('0x2b')](_0x40c830[_0x29f6('0x2a')]);_0x218931[_0x29f6('0x2c')]=_[_0x29f6('0x2d')](_0x218931[_0x29f6('0x2e')],_0x218931[_0x29f6('0x2a')]);_0x375564[_0x29f6('0x2f')]=_[_0x29f6('0x2d')](_0x218931[_0x29f6('0x2e')],qs[_0x29f6('0x30')](_0x40c830[_0x29f6('0x2a')][_0x29f6('0x30')]));_0x375564['attributes']=_0x375564['attributes'][_0x29f6('0x31')]?_0x375564[_0x29f6('0x2f')]:_0x218931[_0x29f6('0x2e')];if(!_0x40c830['query'][_0x29f6('0x32')](_0x29f6('0x33'))){_0x375564[_0x29f6('0x19')]=qs[_0x29f6('0x19')](_0x40c830[_0x29f6('0x2a')]['limit']);_0x375564[_0x29f6('0x17')]=qs[_0x29f6('0x17')](_0x40c830[_0x29f6('0x2a')][_0x29f6('0x17')]);}_0x375564['order']=qs[_0x29f6('0x34')](_0x40c830[_0x29f6('0x2a')][_0x29f6('0x34')]);_0x375564[_0x29f6('0x35')]=qs['filters'](_['pick'](_0x40c830[_0x29f6('0x2a')],_0x218931['filters']),_0x5492c2);if(_0x40c830[_0x29f6('0x2a')]['filter']){_0x375564[_0x29f6('0x35')]=_['merge'](_0x375564[_0x29f6('0x35')],{'$or':_[_0x29f6('0x36')](_0x5492c2,function(_0x5448c4){if(_0x5448c4[_0x29f6('0x28')]!=='VIRTUAL'){var _0x3f3475={};_0x3f3475[_0x5448c4[_0x29f6('0x23')]]={'$like':'%'+_0x40c830['query'][_0x29f6('0x37')]+'%'};return _0x3f3475;}})});}_0x375564=_[_0x29f6('0x38')]({},_0x375564,_0x40c830[_0x29f6('0x39')]);var _0x1e9d5a={'where':_0x375564['where']};return db[_0x29f6('0x26')][_0x29f6('0x3a')](_0x1e9d5a)[_0x29f6('0x1e')](function(_0x2322eb){_0x3a7249[_0x29f6('0x3a')]=_0x2322eb;if(_0x40c830['query'][_0x29f6('0x3b')]){_0x375564['include']=[{'all':!![]}];}return db[_0x29f6('0x26')]['findAll'](_0x375564);})[_0x29f6('0x1e')](function(_0x3a8a12){_0x3a7249['rows']=_0x3a8a12;return _0x3a7249;})[_0x29f6('0x1e')](respondWithFilteredResult(_0x304c28,_0x375564))[_0x29f6('0x3c')](handleError(_0x304c28,null));};exports[_0x29f6('0x3d')]=function(_0x27d655,_0x5402bb){var _0x415dd3={'raw':!![],'where':{'id':_0x27d655[_0x29f6('0x3e')]['id']}},_0x2a83b7={};_0x2a83b7['model']=_[_0x29f6('0x2b')](db['Tag'][_0x29f6('0x3f')]);_0x2a83b7['query']=_['keys'](_0x27d655['query']);_0x2a83b7[_0x29f6('0x2c')]=_[_0x29f6('0x2d')](_0x2a83b7[_0x29f6('0x2e')],_0x2a83b7[_0x29f6('0x2a')]);_0x415dd3[_0x29f6('0x2f')]=_[_0x29f6('0x2d')](_0x2a83b7[_0x29f6('0x2e')],qs[_0x29f6('0x30')](_0x27d655[_0x29f6('0x2a')][_0x29f6('0x30')]));_0x415dd3['attributes']=_0x415dd3['attributes'][_0x29f6('0x31')]?_0x415dd3[_0x29f6('0x2f')]:_0x2a83b7[_0x29f6('0x2e')];if(_0x27d655[_0x29f6('0x2a')]['includeAll']){_0x415dd3[_0x29f6('0x40')]=[{'all':!![]}];}_0x415dd3=_[_0x29f6('0x38')]({},_0x415dd3,_0x27d655['options']);return db[_0x29f6('0x26')][_0x29f6('0x41')](_0x415dd3)[_0x29f6('0x1e')](handleEntityNotFound(_0x5402bb,null))[_0x29f6('0x1e')](respondWithResult(_0x5402bb,null))[_0x29f6('0x3c')](handleError(_0x5402bb,null));};exports[_0x29f6('0x42')]=function(_0x320b5e,_0x1f03b6){return db[_0x29f6('0x26')][_0x29f6('0x42')](_0x320b5e[_0x29f6('0x43')],{})[_0x29f6('0x1e')](function(_0x58ea69){var _0x416c24=_0x320b5e[_0x29f6('0x44')][_0x29f6('0x1f')]({'plain':!![]});if(!_0x416c24)throw new Error(_0x29f6('0x45'));if(_0x416c24[_0x29f6('0x46')]==='user'){var _0x2e29e3=_0x58ea69['get']({'plain':!![]});var _0x546c91=_0x29f6('0x47');return db[_0x29f6('0x48')][_0x29f6('0x41')]({'where':{'name':_0x546c91,'userProfileId':_0x416c24[_0x29f6('0x49')]},'raw':!![]})[_0x29f6('0x1e')](function(_0x509caf){if(_0x509caf&&_0x509caf[_0x29f6('0x4a')]===0x0){return db[_0x29f6('0x20')]['create']({'name':_0x2e29e3[_0x29f6('0x23')],'resourceId':_0x2e29e3['id'],'type':_0x509caf['name'],'sectionId':_0x509caf['id']},{})[_0x29f6('0x1e')](function(){return _0x58ea69;});}else{return _0x58ea69;}})[_0x29f6('0x3c')](function(_0x27601d){logger[_0x29f6('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27601d);throw _0x27601d;});}return _0x58ea69;})[_0x29f6('0x1e')](respondWithResult(_0x1f03b6,0xc9))[_0x29f6('0x3c')](handleError(_0x1f03b6,null));};exports[_0x29f6('0x1c')]=function(_0x217428,_0x3aa7eb){if(_0x217428[_0x29f6('0x43')]['id']){delete _0x217428[_0x29f6('0x43')]['id'];}return db['Tag'][_0x29f6('0x41')]({'where':{'id':_0x217428[_0x29f6('0x3e')]['id']}})[_0x29f6('0x1e')](handleEntityNotFound(_0x3aa7eb,null))[_0x29f6('0x1e')](saveUpdates(_0x217428[_0x29f6('0x43')],null))[_0x29f6('0x1e')](respondWithResult(_0x3aa7eb,null))[_0x29f6('0x3c')](handleError(_0x3aa7eb,null));};exports[_0x29f6('0x1d')]=function(_0x39d531,_0x3dbd19){return db['Tag']['find']({'where':{'id':_0x39d531[_0x29f6('0x3e')]['id']}})[_0x29f6('0x1e')](handleEntityNotFound(_0x3dbd19,null))[_0x29f6('0x1e')](removeEntity(_0x3dbd19,null))['catch'](handleError(_0x3dbd19,null));};
\ No newline at end of file
index 571d297..383ade1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1eb=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','define','Tag','tools_tags','lodash'];(function(_0x5d3979,_0x1977a0){var _0x3bee9e=function(_0x2d9af5){while(--_0x2d9af5){_0x5d3979['push'](_0x5d3979['shift']());}};_0x3bee9e(++_0x1977a0);}(_0xc1eb,0x1ed));var _0xbc1e=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0xc1eb[_0x1fc18b];return _0x16a351;};'use strict';var _=require(_0xbc1e('0x0'));var util=require(_0xbc1e('0x1'));var logger=require(_0xbc1e('0x2'))(_0xbc1e('0x3'));var moment=require(_0xbc1e('0x4'));var BPromise=require(_0xbc1e('0x5'));var rp=require(_0xbc1e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc1e('0x7'));var config=require(_0xbc1e('0x8'));var attributes=require(_0xbc1e('0x9'));module['exports']=function(_0x1c945b,_0x146e50){return _0x1c945b[_0xbc1e('0xa')](_0xbc1e('0xb'),attributes,{'tableName':_0xbc1e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda33=['moment','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x330101,_0x3f9f6b){var _0x344d8e=function(_0x2cb8b3){while(--_0x2cb8b3){_0x330101['push'](_0x330101['shift']());}};_0x344d8e(++_0x3f9f6b);}(_0xda33,0x1b7));var _0x3da3=function(_0x208524,_0x391c25){_0x208524=_0x208524-0x0;var _0x3b82a8=_0xda33[_0x208524];return _0x3b82a8;};'use strict';var _=require(_0x3da3('0x0'));var util=require(_0x3da3('0x1'));var logger=require(_0x3da3('0x2'))('api');var moment=require(_0x3da3('0x3'));var BPromise=require(_0x3da3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3da3('0x5'));var rimraf=require(_0x3da3('0x6'));var config=require(_0x3da3('0x7'));var attributes=require(_0x3da3('0x8'));module[_0x3da3('0x9')]=function(_0x2d2317,_0x5633bf){return _0x2d2317[_0x3da3('0xa')](_0x3da3('0xb'),attributes,{'tableName':_0x3da3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2a8921b..606341d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bde=['request','then','info','Tag,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3695c0,_0x3699c7){var _0x46f62e=function(_0x1750af){while(--_0x1750af){_0x3695c0['push'](_0x3695c0['shift']());}};_0x46f62e(++_0x3699c7);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xe0bd('0x0'));var moment=require('moment');var BPromise=require(_0xe0bd('0x1'));var rs=require(_0xe0bd('0x2'));var fs=require('fs');var Redis=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];var utils=require(_0xe0bd('0x5'));var logger=require('../../config/logger')(_0xe0bd('0x6'));var config=require(_0xe0bd('0x7'));var jayson=require(_0xe0bd('0x8'));var client=jayson[_0xe0bd('0x9')][_0xe0bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26393f,_0x217145,_0x491dc7){return new BPromise(function(_0x40b36a,_0x44cb0b){return client[_0xe0bd('0xb')](_0x26393f,_0x491dc7)[_0xe0bd('0xc')](function(_0x393379){logger[_0xe0bd('0xd')](_0xe0bd('0xe'),_0x217145,_0xe0bd('0xf'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x217145,'request\x20sent',JSON[_0xe0bd('0x10')](_0x393379));if(_0x393379['error']){if(_0x393379['error'][_0xe0bd('0x11')]===0x1f4){logger[_0xe0bd('0x12')]('Tag,\x20%s,\x20%s',_0x217145,_0x393379[_0xe0bd('0x12')]['message']);return _0x44cb0b(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}logger[_0xe0bd('0x12')](_0xe0bd('0xe'),_0x217145,_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);return _0x40b36a(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}else{logger['info']('Tag,\x20%s,\x20%s',_0x217145,'request\x20sent');_0x40b36a(_0x393379[_0xe0bd('0x14')][_0xe0bd('0x13')]);}})[_0xe0bd('0x15')](function(_0x379ea2){logger[_0xe0bd('0x12')]('Tag,\x20%s,\x20%s',_0x217145,_0x379ea2);_0x44cb0b(_0x379ea2);});});}
\ No newline at end of file
+var _0x0e9f=['debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x0e9f,0x116));var _0xf0e9=function(_0xae6736,_0x4e43c3){_0xae6736=_0xae6736-0x0;var _0x179d79=_0x0e9f[_0xae6736];return _0x179d79;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a35a3,_0x3f9792,_0x2fa08f){return new BPromise(function(_0x106ba0,_0x58edfe){return client['request'](_0x4a35a3,_0x2fa08f)[_0xf0e9('0x7')](function(_0x7b3146){logger[_0xf0e9('0x8')]('Tag,\x20%s,\x20%s',_0x3f9792,_0xf0e9('0x9'));logger[_0xf0e9('0xa')](_0xf0e9('0xb'),_0x3f9792,'request\x20sent',JSON[_0xf0e9('0xc')](_0x7b3146));if(_0x7b3146[_0xf0e9('0xd')]){if(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0xe')]===0x1f4){logger['error'](_0xf0e9('0xf'),_0x3f9792,_0x7b3146['error'][_0xf0e9('0x10')]);return _0x58edfe(_0x7b3146[_0xf0e9('0xd')]['message']);}logger[_0xf0e9('0xd')](_0xf0e9('0xf'),_0x3f9792,_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);return _0x106ba0(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);}else{logger['info'](_0xf0e9('0xf'),_0x3f9792,_0xf0e9('0x9'));_0x106ba0(_0x7b3146['result'][_0xf0e9('0x10')]);}})[_0xf0e9('0x11')](function(_0x3d0b4d){logger[_0xf0e9('0xd')]('Tag,\x20%s,\x20%s',_0x3f9792,_0x3d0b4d);_0x58edfe(_0x3d0b4d);});});}
\ No newline at end of file
index 5263e95..9977893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 ac809ab..502fc40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['STRING','sequelize','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe706,0xa3));var _0x6e70=function(_0x306106,_0x7dc50d){_0x306106=_0x306106-0x0;var _0x4d6083=_0xe706[_0x306106];return _0x4d6083;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}};
\ No newline at end of file
+var _0x2032=['name','exports','STRING'];(function(_0x44e1e0,_0x2cfe4a){var _0x3957ab=function(_0x112a43){while(--_0x112a43){_0x44e1e0['push'](_0x44e1e0['shift']());}};_0x3957ab(++_0x2cfe4a);}(_0x2032,0xd9));var _0x2203=function(_0x4ed094,_0x146fb2){_0x4ed094=_0x4ed094-0x0;var _0x1c28d3=_0x2032[_0x4ed094];return _0x1c28d3;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3fd82ae..4ad833b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8403=['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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','index','map','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','Team','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','channel','toLowerCase','Queue','order','pick','capitalize','Queues','addQueues','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Whatsapp','sequelize','transaction','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','interface','UserVoiceQueueRt','upsert','format','voicePause','all','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x23041f,_0x17d90c){var _0x1f7df7=function(_0x4cff86){while(--_0x4cff86){_0x23041f['push'](_0x23041f['shift']());}};_0x1f7df7(++_0x17d90c);}(_0x8403,0x188));var _0x3840=function(_0x126efc,_0x22763c){_0x126efc=_0x126efc-0x0;var _0x5ef738=_0x8403[_0x126efc];return _0x5ef738;};'use strict';var emlformat=require(_0x3840('0x0'));var rimraf=require(_0x3840('0x1'));var zipdir=require(_0x3840('0x2'));var jsonpatch=require(_0x3840('0x3'));var rp=require(_0x3840('0x4'));var moment=require('moment');var BPromise=require(_0x3840('0x5'));var Mustache=require(_0x3840('0x6'));var util=require('util');var path=require(_0x3840('0x7'));var sox=require('sox');var csv=require(_0x3840('0x8'));var ejs=require(_0x3840('0x9'));var fs=require('fs');var fs_extra=require(_0x3840('0xa'));var _=require(_0x3840('0xb'));var squel=require(_0x3840('0xc'));var crypto=require(_0x3840('0xd'));var jsforce=require(_0x3840('0xe'));var deskjs=require(_0x3840('0xf'));var toCsv=require(_0x3840('0x8'));var querystring=require(_0x3840('0x10'));var Papa=require(_0x3840('0x11'));var Redis=require(_0x3840('0x12'));var authService=require(_0x3840('0x13'));var qs=require(_0x3840('0x14'));var as=require(_0x3840('0x15'));var hardwareService=require(_0x3840('0x16'));var logger=require(_0x3840('0x17'))('api');var utils=require(_0x3840('0x18'));var config=require(_0x3840('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3840('0x1a'))['db'];config[_0x3840('0x1b')]=_[_0x3840('0x1c')](config[_0x3840('0x1b')],{'host':_0x3840('0x1d'),'port':0x18eb});var socket=require(_0x3840('0x1e'))(new Redis(config[_0x3840('0x1b')]));require(_0x3840('0x1f'))[_0x3840('0x20')](socket);function respondWithStatusCode(_0x1bb90c,_0x556ee7){_0x556ee7=_0x556ee7||0xcc;return function(_0x237418){if(_0x237418){return _0x1bb90c['sendStatus'](_0x556ee7);}return _0x1bb90c[_0x3840('0x21')](_0x556ee7)[_0x3840('0x22')]();};}function respondWithResult(_0x1402ce,_0x45dfe9){_0x45dfe9=_0x45dfe9||0xc8;return function(_0x326dc1){if(_0x326dc1){return _0x1402ce[_0x3840('0x21')](_0x45dfe9)[_0x3840('0x23')](_0x326dc1);}};}function respondWithFilteredResult(_0x52fa03,_0x2117c0){return function(_0x98ec86){if(_0x98ec86){var _0x10a5e4=typeof _0x2117c0[_0x3840('0x24')]==='undefined'&&typeof _0x2117c0[_0x3840('0x25')]===_0x3840('0x26');var _0x1ab785=_0x98ec86[_0x3840('0x27')];var _0x5775c4=_0x10a5e4?0x0:_0x2117c0['offset'];var _0x308ff9=_0x10a5e4?_0x98ec86[_0x3840('0x27')]:_0x2117c0[_0x3840('0x24')]+_0x2117c0[_0x3840('0x25')];var _0x1f2616;if(_0x308ff9>=_0x1ab785){_0x308ff9=_0x1ab785;_0x1f2616=0xc8;}else{_0x1f2616=0xce;}_0x52fa03[_0x3840('0x21')](_0x1f2616);return _0x52fa03[_0x3840('0x28')](_0x3840('0x29'),_0x5775c4+'-'+_0x308ff9+'/'+_0x1ab785)[_0x3840('0x23')](_0x98ec86);}return null;};}function patchUpdates(_0x11901a){return function(_0x234340){try{jsonpatch[_0x3840('0x2a')](_0x234340,_0x11901a,!![]);}catch(_0x15ecaa){return BPromise[_0x3840('0x2b')](_0x15ecaa);}return _0x234340[_0x3840('0x2c')]();};}function saveUpdates(_0x563e86,_0x3c75f5){return function(_0x14f50e){if(_0x14f50e){return _0x14f50e[_0x3840('0x2d')](_0x563e86)[_0x3840('0x2e')](function(_0x429b87){return _0x429b87;});}return null;};}function removeEntity(_0x419ac8,_0x590c22){return function(_0x3aea39){if(_0x3aea39){return _0x3aea39[_0x3840('0x2f')]()[_0x3840('0x2e')](function(){var _0xa49ea0=_0x3aea39[_0x3840('0x30')]({'plain':!![]});var _0x54797f='Teams';return db[_0x3840('0x31')][_0x3840('0x2f')]({'where':{'type':_0x54797f,'resourceId':_0xa49ea0['id']}})[_0x3840('0x2e')](function(){return _0x3aea39;});})[_0x3840('0x2e')](function(){_0x419ac8[_0x3840('0x21')](0xcc)[_0x3840('0x22')]();});}};}function handleEntityNotFound(_0x4f4686,_0x286d2a){return function(_0x39f194){if(!_0x39f194){_0x4f4686[_0x3840('0x32')](0x194);}return _0x39f194;};}function handleError(_0x365cd1,_0x115900){_0x115900=_0x115900||0x1f4;return function(_0x51acca){logger[_0x3840('0x33')](_0x51acca[_0x3840('0x34')]);if(_0x51acca['name']){delete _0x51acca['name'];}_0x365cd1[_0x3840('0x21')](_0x115900)['send'](_0x51acca);};}exports[_0x3840('0x35')]=function(_0x3c4f01,_0x5329c3){var _0x4d990d={},_0x48bd79={},_0x48fa86={'count':0x0,'rows':[]};var _0x4e62ee=_[_0x3840('0x36')](db['Team']['rawAttributes'],function(_0x384522){return{'name':_0x384522[_0x3840('0x37')],'type':_0x384522['type'][_0x3840('0x38')]};});_0x48bd79[_0x3840('0x39')]=_[_0x3840('0x36')](_0x4e62ee,_0x3840('0x3a'));_0x48bd79[_0x3840('0x3b')]=_[_0x3840('0x3c')](_0x3c4f01[_0x3840('0x3b')]);_0x48bd79['filters']=_[_0x3840('0x3d')](_0x48bd79['model'],_0x48bd79[_0x3840('0x3b')]);_0x4d990d[_0x3840('0x3e')]=_[_0x3840('0x3d')](_0x48bd79[_0x3840('0x39')],qs[_0x3840('0x3f')](_0x3c4f01[_0x3840('0x3b')][_0x3840('0x3f')]));_0x4d990d['attributes']=_0x4d990d[_0x3840('0x3e')][_0x3840('0x40')]?_0x4d990d[_0x3840('0x3e')]:_0x48bd79[_0x3840('0x39')];if(!_0x3c4f01[_0x3840('0x3b')][_0x3840('0x41')](_0x3840('0x42'))){_0x4d990d['limit']=qs['limit'](_0x3c4f01[_0x3840('0x3b')]['limit']);_0x4d990d['offset']=qs[_0x3840('0x24')](_0x3c4f01['query'][_0x3840('0x24')]);}_0x4d990d['order']=qs['sort'](_0x3c4f01[_0x3840('0x3b')][_0x3840('0x43')]);_0x4d990d[_0x3840('0x44')]=qs[_0x3840('0x45')](_['pick'](_0x3c4f01[_0x3840('0x3b')],_0x48bd79[_0x3840('0x45')]),_0x4e62ee);if(_0x3c4f01[_0x3840('0x3b')][_0x3840('0x46')]){_0x4d990d['where']=_['merge'](_0x4d990d['where'],{'$or':_['map'](_0x4e62ee,function(_0x8db218){if(_0x8db218['type']!==_0x3840('0x47')){var _0x5aa18e={};_0x5aa18e[_0x8db218[_0x3840('0x3a')]]={'$like':'%'+_0x3c4f01[_0x3840('0x3b')][_0x3840('0x46')]+'%'};return _0x5aa18e;}})});}_0x4d990d=_[_0x3840('0x48')]({},_0x4d990d,_0x3c4f01[_0x3840('0x49')]);var _0x431c5e={'where':_0x4d990d[_0x3840('0x44')]};return db[_0x3840('0x4a')][_0x3840('0x27')](_0x431c5e)['then'](function(_0x2ef61e){_0x48fa86[_0x3840('0x27')]=_0x2ef61e;if(_0x3c4f01['query'][_0x3840('0x4b')]){_0x4d990d[_0x3840('0x4c')]=[{'all':!![]}];}return db[_0x3840('0x4a')][_0x3840('0x4d')](_0x4d990d);})[_0x3840('0x2e')](function(_0x45a6fb){_0x48fa86[_0x3840('0x4e')]=_0x45a6fb;return _0x48fa86;})[_0x3840('0x2e')](respondWithFilteredResult(_0x5329c3,_0x4d990d))[_0x3840('0x4f')](handleError(_0x5329c3,null));};exports[_0x3840('0x50')]=function(_0xaddc5c,_0x37de6c){var _0x2e4e7e={'raw':![],'where':{'id':_0xaddc5c[_0x3840('0x51')]['id']}},_0x44c027={};_0x44c027[_0x3840('0x39')]=_[_0x3840('0x3c')](db[_0x3840('0x4a')][_0x3840('0x52')]);_0x44c027[_0x3840('0x3b')]=_[_0x3840('0x3c')](_0xaddc5c[_0x3840('0x3b')]);_0x44c027[_0x3840('0x45')]=_[_0x3840('0x3d')](_0x44c027[_0x3840('0x39')],_0x44c027[_0x3840('0x3b')]);_0x2e4e7e[_0x3840('0x3e')]=_[_0x3840('0x3d')](_0x44c027['model'],qs[_0x3840('0x3f')](_0xaddc5c[_0x3840('0x3b')][_0x3840('0x3f')]));_0x2e4e7e[_0x3840('0x3e')]=_0x2e4e7e['attributes']['length']?_0x2e4e7e[_0x3840('0x3e')]:_0x44c027[_0x3840('0x39')];if(_0xaddc5c[_0x3840('0x3b')][_0x3840('0x4b')]){_0x2e4e7e[_0x3840('0x4c')]=[{'all':!![]}];}_0x2e4e7e=_[_0x3840('0x48')]({},_0x2e4e7e,_0xaddc5c[_0x3840('0x49')]);return db['Team']['find'](_0x2e4e7e)['then'](handleEntityNotFound(_0x37de6c,null))['then'](respondWithResult(_0x37de6c,null))['catch'](handleError(_0x37de6c,null));};exports['create']=function(_0x228618,_0x24ac05){return db[_0x3840('0x4a')][_0x3840('0x53')](_0x228618[_0x3840('0x54')],{})[_0x3840('0x2e')](function(_0x33347e){var _0x18c241=_0x228618[_0x3840('0x55')][_0x3840('0x30')]({'plain':!![]});if(!_0x18c241)throw new Error(_0x3840('0x56'));if(_0x18c241[_0x3840('0x57')]===_0x3840('0x55')){var _0x6e6872=_0x33347e[_0x3840('0x30')]({'plain':!![]});var _0x51f355=_0x3840('0x58');return db[_0x3840('0x59')][_0x3840('0x5a')]({'where':{'name':_0x51f355,'userProfileId':_0x18c241[_0x3840('0x5b')]},'raw':!![]})[_0x3840('0x2e')](function(_0xf3798){if(_0xf3798&&_0xf3798[_0x3840('0x5c')]===0x0){return db['UserProfileResource'][_0x3840('0x53')]({'name':_0x6e6872[_0x3840('0x3a')],'resourceId':_0x6e6872['id'],'type':_0xf3798['name'],'sectionId':_0xf3798['id']},{})[_0x3840('0x2e')](function(){return _0x33347e;});}else{return _0x33347e;}})[_0x3840('0x4f')](function(_0x28c690){logger[_0x3840('0x33')](_0x3840('0x5d'),_0x28c690);throw _0x28c690;});}return _0x33347e;})[_0x3840('0x2e')](respondWithResult(_0x24ac05,0xc9))[_0x3840('0x4f')](handleError(_0x24ac05,null));};exports[_0x3840('0x2d')]=function(_0x2c5984,_0x136596){if(_0x2c5984[_0x3840('0x54')]['id']){delete _0x2c5984['body']['id'];}return db[_0x3840('0x4a')]['find']({'where':{'id':_0x2c5984[_0x3840('0x51')]['id']}})[_0x3840('0x2e')](handleEntityNotFound(_0x136596,null))[_0x3840('0x2e')](saveUpdates(_0x2c5984['body'],null))[_0x3840('0x2e')](respondWithResult(_0x136596,null))[_0x3840('0x4f')](handleError(_0x136596,null));};exports[_0x3840('0x2f')]=function(_0x3504d8,_0x52523b){return db['Team'][_0x3840('0x5a')]({'where':{'id':_0x3504d8[_0x3840('0x51')]['id']}})[_0x3840('0x2e')](handleEntityNotFound(_0x52523b,null))[_0x3840('0x2e')](removeEntity(_0x52523b,null))['catch'](handleError(_0x52523b,null));};exports[_0x3840('0x5e')]=function(_0x417ce4,_0xccc9ee,_0x3cc2da){return db['Team'][_0x3840('0x5f')]({'where':{'id':_0x417ce4[_0x3840('0x51')]['id']}})[_0x3840('0x2e')](handleEntityNotFound(_0xccc9ee,null))[_0x3840('0x2e')](function(_0x921c8e){if(!_0x417ce4[_0x3840('0x3b')]['channel']||!utils[_0x3840('0x60')](_0x417ce4[_0x3840('0x3b')]['channel'])){throw new db[(_0x3840('0x61'))][(_0x3840('0x62'))](_0x3840('0x63'));}var _0x3a6e5d={};var _0x22823d={};_0x22823d[_0x3840('0x39')]=_[_0x3840('0x3c')](db[_['capitalize'](_0x417ce4[_0x3840('0x3b')][_0x3840('0x64')][_0x3840('0x65')]())+_0x3840('0x66')][_0x3840('0x52')]);_0x22823d[_0x3840('0x3b')]=_[_0x3840('0x3c')](_0x417ce4['query']);_0x22823d['filters']=_[_0x3840('0x3d')](_0x22823d['model'],_0x22823d[_0x3840('0x3b')]);_0x3a6e5d[_0x3840('0x3e')]=_[_0x3840('0x3d')](_0x22823d[_0x3840('0x39')],qs[_0x3840('0x3f')](_0x417ce4[_0x3840('0x3b')]['fields']));_0x3a6e5d['attributes']=_0x3a6e5d[_0x3840('0x3e')][_0x3840('0x40')]?_0x3a6e5d[_0x3840('0x3e')]:_0x22823d['model'];_0x3a6e5d[_0x3840('0x25')]=qs[_0x3840('0x25')](_0x417ce4[_0x3840('0x3b')][_0x3840('0x25')]);_0x3a6e5d['offset']=qs[_0x3840('0x24')](_0x417ce4['query']['offset']);_0x3a6e5d[_0x3840('0x67')]=qs['sort'](_0x417ce4[_0x3840('0x3b')][_0x3840('0x43')]);_0x3a6e5d[_0x3840('0x44')]=qs[_0x3840('0x45')](_[_0x3840('0x68')](_0x417ce4[_0x3840('0x3b')],_0x22823d['filters']));_0x3a6e5d=_[_0x3840('0x48')]({},_0x3a6e5d,_0x417ce4[_0x3840('0x49')]);return _0x921c8e[_0x3840('0x30')+_[_0x3840('0x69')](_0x417ce4['query'][_0x3840('0x64')]['toLowerCase']())+_0x3840('0x6a')](_0x3a6e5d);})['then'](respondWithResult(_0xccc9ee,null))['catch'](handleError(_0xccc9ee,null));};exports[_0x3840('0x6b')]=function(_0xc2c110,_0xf36626,_0x3621aa){return db[_0x3840('0x4a')][_0x3840('0x5f')]({'where':{'id':_0xc2c110[_0x3840('0x51')]['id']}})[_0x3840('0x2e')](function(_0x491880){if(_0x491880){if(!_0xc2c110[_0x3840('0x54')][_0x3840('0x64')]||!utils[_0x3840('0x60')](_0xc2c110[_0x3840('0x54')]['channel'])){throw new db[(_0x3840('0x61'))][(_0x3840('0x62'))](_0x3840('0x63'));}return _0x491880['add'+_[_0x3840('0x69')](_0xc2c110[_0x3840('0x54')][_0x3840('0x64')][_0x3840('0x65')]())+_0x3840('0x6a')](_0xc2c110['body'][_0x3840('0x6c')]);}return null;})[_0x3840('0x2e')](handleEntityNotFound(_0xf36626,null))[_0x3840('0x2e')](respondWithStatusCode(_0xf36626,null))[_0x3840('0x4f')](handleError(_0xf36626,null));};exports[_0x3840('0x6d')]=function(_0x51e802,_0x4aafaa,_0x255651){return db[_0x3840('0x4a')][_0x3840('0x5f')]({'where':{'id':_0x51e802['params']['id']}})[_0x3840('0x2e')](function(_0x48b224){if(_0x48b224){if(!_0x51e802[_0x3840('0x3b')][_0x3840('0x64')]||!utils['isValidChannel'](_0x51e802[_0x3840('0x3b')]['channel'])){throw new db[(_0x3840('0x61'))]['ValidationError'](_0x3840('0x63'));}return _0x48b224['remove'+_['capitalize'](_0x51e802[_0x3840('0x3b')][_0x3840('0x64')][_0x3840('0x65')]())+_0x3840('0x6a')](_0x51e802['query'][_0x3840('0x6c')]);}return null;})[_0x3840('0x2e')](handleEntityNotFound(_0x4aafaa,null))[_0x3840('0x2e')](respondWithStatusCode(_0x4aafaa,null))[_0x3840('0x4f')](handleError(_0x4aafaa,null));};exports[_0x3840('0x6e')]=function(_0x4b8b87,_0x1f5627){return db[_0x3840('0x4a')][_0x3840('0x5a')]({'where':{'id':_0x4b8b87[_0x3840('0x51')]['id']}})[_0x3840('0x2e')](handleEntityNotFound(_0x1f5627,null))[_0x3840('0x2e')](function(_0x2085a2){if(_0x2085a2){var _0x4581d4=[_0x3840('0x6f'),_0x3840('0x70'),_0x3840('0x71'),_0x3840('0x72'),'Fax','Openchannel',_0x3840('0x73')];return db[_0x3840('0x74')][_0x3840('0x75')](function(_0x535896){var _0x3edb79=_[_0x3840('0x36')](_0x4581d4,function(_0x36621c){var _0x52b696={'attributes':['id',_0x3840('0x3a')]};if(_0x36621c===_0x3840('0x6f')){_0x52b696[_0x3840('0x76')]={'attributes':[_0x3840('0x77')]};}return _0x2085a2['get'+_0x36621c+_0x3840('0x6a')](_0x52b696)[_0x3840('0x2e')](function(_0x470b45){var _0x31ff20=_[_0x3840('0x36')](_0x470b45,function(_0x2037bb){var _0x53aa9d=_[_0x3840('0x36')](_0x4b8b87[_0x3840('0x54')][_0x3840('0x6c')],function(_0x946272){var _0x22a541={'where':{'UserId':_0x946272,[_0x36621c+_0x3840('0x78')]:_0x2037bb['id']},'transaction':_0x535896};if(_0x36621c===_0x3840('0x6f')){_0x22a541['defaults']={'penalty':_0x2037bb[_0x3840('0x79')][_0x3840('0x77')]};}return db[_0x3840('0x7a')+_0x36621c+_0x3840('0x66')][_0x3840('0x7b')](_0x22a541)[_0x3840('0x2e')](function(){socket[_0x3840('0x7c')](_0x3840('0x55')+_0x36621c+_0x3840('0x7d'),{'UserId':_0x946272,[_0x36621c+_0x3840('0x78')]:_0x2037bb['id']});if(_0x36621c!=='Voice')return;return db[_0x3840('0x7a')][_0x3840('0x4d')]({'where':{'id':_0x4b8b87['body']['ids'],'online':0x1},'attributes':['id',_0x3840('0x3a'),_0x3840('0x7e'),'voicePause',_0x3840('0x7f')],'raw':!![]})[_0x3840('0x2e')](function(_0x507f36){var _0xdc60f8=_[_0x3840('0x36')](_0x507f36,function(_0x52bdd7){return db[_0x3840('0x80')][_0x3840('0x81')]({'membername':_0x52bdd7[_0x3840('0x3a')],'UserId':_0x52bdd7['id'],'queue_name':_0x2037bb[_0x3840('0x3a')],'VoiceQueueId':_0x2037bb['id'],'interface':_['isNil'](_0x52bdd7['interface'])?util[_0x3840('0x82')]('SIP/%s',_0x52bdd7[_0x3840('0x3a')]):_0x52bdd7['interface'],'paused':_0x52bdd7[_0x3840('0x83')]||![],'penalty':_0x2037bb[_0x3840('0x79')]['penalty']},{'transaction':_0x535896});});return Promise['all'](_0xdc60f8);});});});return Promise[_0x3840('0x84')](_0x53aa9d);});return Promise[_0x3840('0x84')](_0x31ff20);});});return Promise[_0x3840('0x84')](_0x3edb79)['then'](function(){return _0x2085a2[_0x3840('0x6e')](_0x4b8b87[_0x3840('0x54')][_0x3840('0x6c')],{'transaction':_0x535896})[_0x3840('0x85')](function(_0x10c840){return _0x10c840;});});});}})[_0x3840('0x2e')](respondWithResult(_0x1f5627,null))[_0x3840('0x4f')](handleError(_0x1f5627,null));};exports['removeAgents']=function(_0x4694dd,_0x13d5db){return db['Team'][_0x3840('0x5a')]({'where':{'id':_0x4694dd[_0x3840('0x51')]['id']}})[_0x3840('0x2e')](handleEntityNotFound(_0x13d5db,null))[_0x3840('0x2e')](function(_0x13be5d){if(_0x13be5d){var _0x14a04c=[_0x3840('0x6f'),_0x3840('0x70'),_0x3840('0x71'),_0x3840('0x72'),'Fax','Openchannel',_0x3840('0x73')];return db[_0x3840('0x74')][_0x3840('0x75')](function(_0x2916a0){var _0x552755=_['map'](_0x14a04c,function(_0x32dffd){var _0x3a8c5d={'attributes':['id',_0x3840('0x3a')]};return _0x13be5d[_0x3840('0x30')+_0x32dffd+_0x3840('0x6a')](_0x3a8c5d)[_0x3840('0x2e')](function(_0x889dc2){var _0x111847=_[_0x3840('0x36')](_0x889dc2,function(_0x94abfd){return _0x94abfd['removeAgents'](_0x4694dd[_0x3840('0x3b')][_0x3840('0x6c')],{'transaction':_0x2916a0})['then'](function(){var _0x201937=JSON['parse']('['+_0x4694dd[_0x3840('0x3b')][_0x3840('0x6c')]+']');var _0xe7aee1=_[_0x3840('0x36')](_0x201937,function(_0x1af9bc){socket['emit'](_0x3840('0x55')+_0x32dffd+'Queue:remove',{'UserId':Number(_0x1af9bc),[_0x32dffd+'QueueId']:_0x94abfd['id']});if(_0x32dffd!=='Voice')return;return db[_0x3840('0x80')][_0x3840('0x2f')]({'where':{'VoiceQueueId':_0x94abfd['id'],'UserId':_0x1af9bc},'transaction':_0x2916a0});});return Promise['all'](_0xe7aee1);});});return Promise[_0x3840('0x84')](_0x111847);});});return Promise[_0x3840('0x84')](_0x552755)[_0x3840('0x2e')](function(){return _0x13be5d['removeAgents'](_0x4694dd[_0x3840('0x3b')][_0x3840('0x6c')],{'transaction':_0x2916a0});});});}})[_0x3840('0x2e')](respondWithStatusCode(_0x13d5db,null))[_0x3840('0x4f')](handleError(_0x13d5db,null));};exports[_0x3840('0x86')]=function(_0x24b15e,_0x3bb70a,_0xdb043e){var _0x53e722={};var _0x5e4261={};var _0xc2306e;var _0x3291fb;return db[_0x3840('0x4a')][_0x3840('0x5f')]({'where':{'id':_0x24b15e[_0x3840('0x51')]['id']}})[_0x3840('0x2e')](handleEntityNotFound(_0x3bb70a,null))['then'](function(_0x14da70){if(_0x14da70){_0xc2306e=_0x14da70;_0x5e4261[_0x3840('0x39')]=_['keys'](db['User'][_0x3840('0x52')]);_0x5e4261[_0x3840('0x3b')]=_[_0x3840('0x3c')](_0x24b15e['query']);_0x5e4261[_0x3840('0x45')]=_[_0x3840('0x3d')](_0x5e4261['model'],_0x5e4261[_0x3840('0x3b')]);_0x53e722['attributes']=_['intersection'](_0x5e4261['model'],qs[_0x3840('0x3f')](_0x24b15e[_0x3840('0x3b')][_0x3840('0x3f')]));_0x53e722[_0x3840('0x3e')]=_0x53e722[_0x3840('0x3e')][_0x3840('0x40')]?_0x53e722[_0x3840('0x3e')]:_0x5e4261[_0x3840('0x39')];_0x53e722[_0x3840('0x67')]=qs['sort'](_0x24b15e['query'][_0x3840('0x43')]);_0x53e722[_0x3840('0x44')]=qs[_0x3840('0x45')](_[_0x3840('0x68')](_0x24b15e['query'],_0x5e4261[_0x3840('0x45')]));if(_0x24b15e[_0x3840('0x3b')][_0x3840('0x46')]){_0x53e722[_0x3840('0x44')]=_[_0x3840('0x48')](_0x53e722[_0x3840('0x44')],{'$or':_[_0x3840('0x36')](_0x53e722['attributes'],function(_0x19dab3){var _0x5aca15={};_0x5aca15[_0x19dab3]={'$like':'%'+_0x24b15e['query'][_0x3840('0x46')]+'%'};return _0x5aca15;})});}_0x53e722=_[_0x3840('0x48')]({},_0x53e722,_0x24b15e[_0x3840('0x49')]);return _0xc2306e[_0x3840('0x86')](_0x53e722);}})[_0x3840('0x2e')](function(_0x56e41b){if(_0x56e41b){_0x3291fb=_0x56e41b[_0x3840('0x40')];if(!_0x24b15e['query'][_0x3840('0x41')](_0x3840('0x42'))){_0x53e722['limit']=qs[_0x3840('0x25')](_0x24b15e[_0x3840('0x3b')][_0x3840('0x25')]);_0x53e722['offset']=qs[_0x3840('0x24')](_0x24b15e['query'][_0x3840('0x24')]);}return _0xc2306e['getAgents'](_0x53e722);}})[_0x3840('0x2e')](function(_0x449c2d){if(_0x449c2d){return _0x449c2d?{'count':_0x3291fb,'rows':_0x449c2d}:null;}})[_0x3840('0x2e')](respondWithResult(_0x3bb70a,null))[_0x3840('0x4f')](handleError(_0x3bb70a,null));};
\ No newline at end of file
+var _0xc259=['voicePause','interface','upsert','isNil','format','SIP/%s','all','removeAgents','parse','emit','Queue:remove','getAgents','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','sendStatus','error','stack','name','send','Team','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','Queue','pick','capitalize','Queues','addQueues','add','toLowerCase','remove','addAgents','Chat','Mail','Fax','Openchannel','sequelize','Voice','penalty','ids','QueueId','TeamVoiceQueue','findOrCreate','Queue:save','User','online'];(function(_0x220237,_0x5828c3){var _0x46a45f=function(_0x23ec6d){while(--_0x23ec6d){_0x220237['push'](_0x220237['shift']());}};_0x46a45f(++_0x5828c3);}(_0xc259,0x193));var _0x9c25=function(_0x1f20b4,_0x4c2d3e){_0x1f20b4=_0x1f20b4-0x0;var _0x1dcf9c=_0xc259[_0x1f20b4];return _0x1dcf9c;};'use strict';var emlformat=require(_0x9c25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c25('0x1'));var jsonpatch=require(_0x9c25('0x2'));var rp=require(_0x9c25('0x3'));var moment=require('moment');var BPromise=require(_0x9c25('0x4'));var Mustache=require(_0x9c25('0x5'));var util=require(_0x9c25('0x6'));var path=require(_0x9c25('0x7'));var sox=require(_0x9c25('0x8'));var csv=require(_0x9c25('0x9'));var ejs=require(_0x9c25('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c25('0xb'));var squel=require(_0x9c25('0xc'));var crypto=require(_0x9c25('0xd'));var jsforce=require(_0x9c25('0xe'));var deskjs=require(_0x9c25('0xf'));var toCsv=require(_0x9c25('0x9'));var querystring=require(_0x9c25('0x10'));var Papa=require(_0x9c25('0x11'));var Redis=require(_0x9c25('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c25('0x13'));var logger=require(_0x9c25('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9c25('0x15'));var licenseUtil=require(_0x9c25('0x16'));var db=require(_0x9c25('0x17'))['db'];config[_0x9c25('0x18')]=_[_0x9c25('0x19')](config[_0x9c25('0x18')],{'host':_0x9c25('0x1a'),'port':0x18eb});var socket=require(_0x9c25('0x1b'))(new Redis(config[_0x9c25('0x18')]));require(_0x9c25('0x1c'))[_0x9c25('0x1d')](socket);function respondWithStatusCode(_0x123065,_0x4ca7be){_0x4ca7be=_0x4ca7be||0xcc;return function(_0x4e9aac){if(_0x4e9aac){return _0x123065['sendStatus'](_0x4ca7be);}return _0x123065[_0x9c25('0x1e')](_0x4ca7be)[_0x9c25('0x1f')]();};}function respondWithResult(_0x1974ca,_0x208a57){_0x208a57=_0x208a57||0xc8;return function(_0x4ee390){if(_0x4ee390){return _0x1974ca['status'](_0x208a57)[_0x9c25('0x20')](_0x4ee390);}};}function respondWithFilteredResult(_0x533d1a,_0x461894){return function(_0x164eb5){if(_0x164eb5){var _0x575f85=typeof _0x461894[_0x9c25('0x21')]===_0x9c25('0x22')&&typeof _0x461894[_0x9c25('0x23')]===_0x9c25('0x22');var _0x3e4420=_0x164eb5[_0x9c25('0x24')];var _0x4d7b07=_0x575f85?0x0:_0x461894[_0x9c25('0x21')];var _0x1f5b85=_0x575f85?_0x164eb5[_0x9c25('0x24')]:_0x461894[_0x9c25('0x21')]+_0x461894[_0x9c25('0x23')];var _0x2fa8f3;if(_0x1f5b85>=_0x3e4420){_0x1f5b85=_0x3e4420;_0x2fa8f3=0xc8;}else{_0x2fa8f3=0xce;}_0x533d1a[_0x9c25('0x1e')](_0x2fa8f3);return _0x533d1a['set'](_0x9c25('0x25'),_0x4d7b07+'-'+_0x1f5b85+'/'+_0x3e4420)[_0x9c25('0x20')](_0x164eb5);}return null;};}function patchUpdates(_0x557cfb){return function(_0x5956d3){try{jsonpatch['apply'](_0x5956d3,_0x557cfb,!![]);}catch(_0x503c74){return BPromise[_0x9c25('0x26')](_0x503c74);}return _0x5956d3[_0x9c25('0x27')]();};}function saveUpdates(_0x5a8e68,_0x59f0f1){return function(_0x1a2626){if(_0x1a2626){return _0x1a2626[_0x9c25('0x28')](_0x5a8e68)[_0x9c25('0x29')](function(_0x37f006){return _0x37f006;});}return null;};}function removeEntity(_0x1c4c5b,_0x53c075){return function(_0x507396){if(_0x507396){return _0x507396[_0x9c25('0x2a')]()[_0x9c25('0x29')](function(){var _0x139b62=_0x507396[_0x9c25('0x2b')]({'plain':!![]});var _0x26f19c='Teams';return db['UserProfileResource'][_0x9c25('0x2a')]({'where':{'type':_0x26f19c,'resourceId':_0x139b62['id']}})['then'](function(){return _0x507396;});})[_0x9c25('0x29')](function(){_0x1c4c5b[_0x9c25('0x1e')](0xcc)[_0x9c25('0x1f')]();});}};}function handleEntityNotFound(_0x1f4895,_0x2083b9){return function(_0x5aa5be){if(!_0x5aa5be){_0x1f4895[_0x9c25('0x2c')](0x194);}return _0x5aa5be;};}function handleError(_0x17392c,_0x263236){_0x263236=_0x263236||0x1f4;return function(_0x3aabe3){logger[_0x9c25('0x2d')](_0x3aabe3[_0x9c25('0x2e')]);if(_0x3aabe3[_0x9c25('0x2f')]){delete _0x3aabe3['name'];}_0x17392c[_0x9c25('0x1e')](_0x263236)[_0x9c25('0x30')](_0x3aabe3);};}exports['index']=function(_0x71e4ec,_0x4af603){var _0x3d8dbb={},_0x38b94e={},_0x98e80={'count':0x0,'rows':[]};var _0x133e74=_['map'](db[_0x9c25('0x31')][_0x9c25('0x32')],function(_0x171a11){return{'name':_0x171a11['fieldName'],'type':_0x171a11[_0x9c25('0x33')][_0x9c25('0x34')]};});_0x38b94e[_0x9c25('0x35')]=_[_0x9c25('0x36')](_0x133e74,_0x9c25('0x2f'));_0x38b94e[_0x9c25('0x37')]=_[_0x9c25('0x38')](_0x71e4ec[_0x9c25('0x37')]);_0x38b94e[_0x9c25('0x39')]=_['intersection'](_0x38b94e[_0x9c25('0x35')],_0x38b94e[_0x9c25('0x37')]);_0x3d8dbb[_0x9c25('0x3a')]=_[_0x9c25('0x3b')](_0x38b94e['model'],qs[_0x9c25('0x3c')](_0x71e4ec[_0x9c25('0x37')][_0x9c25('0x3c')]));_0x3d8dbb['attributes']=_0x3d8dbb[_0x9c25('0x3a')][_0x9c25('0x3d')]?_0x3d8dbb[_0x9c25('0x3a')]:_0x38b94e['model'];if(!_0x71e4ec[_0x9c25('0x37')][_0x9c25('0x3e')]('nolimit')){_0x3d8dbb[_0x9c25('0x23')]=qs[_0x9c25('0x23')](_0x71e4ec[_0x9c25('0x37')]['limit']);_0x3d8dbb[_0x9c25('0x21')]=qs[_0x9c25('0x21')](_0x71e4ec[_0x9c25('0x37')]['offset']);}_0x3d8dbb[_0x9c25('0x3f')]=qs[_0x9c25('0x40')](_0x71e4ec[_0x9c25('0x37')][_0x9c25('0x40')]);_0x3d8dbb[_0x9c25('0x41')]=qs[_0x9c25('0x39')](_['pick'](_0x71e4ec[_0x9c25('0x37')],_0x38b94e[_0x9c25('0x39')]),_0x133e74);if(_0x71e4ec[_0x9c25('0x37')][_0x9c25('0x42')]){_0x3d8dbb[_0x9c25('0x41')]=_[_0x9c25('0x43')](_0x3d8dbb[_0x9c25('0x41')],{'$or':_[_0x9c25('0x36')](_0x133e74,function(_0x4580f9){if(_0x4580f9[_0x9c25('0x33')]!==_0x9c25('0x44')){var _0x4b7186={};_0x4b7186[_0x4580f9[_0x9c25('0x2f')]]={'$like':'%'+_0x71e4ec['query'][_0x9c25('0x42')]+'%'};return _0x4b7186;}})});}_0x3d8dbb=_[_0x9c25('0x43')]({},_0x3d8dbb,_0x71e4ec[_0x9c25('0x45')]);var _0x4e99cd={'where':_0x3d8dbb['where']};return db[_0x9c25('0x31')][_0x9c25('0x24')](_0x4e99cd)['then'](function(_0x49fb82){_0x98e80['count']=_0x49fb82;if(_0x71e4ec[_0x9c25('0x37')][_0x9c25('0x46')]){_0x3d8dbb[_0x9c25('0x47')]=[{'all':!![]}];}return db[_0x9c25('0x31')][_0x9c25('0x48')](_0x3d8dbb);})[_0x9c25('0x29')](function(_0x11b73f){_0x98e80[_0x9c25('0x49')]=_0x11b73f;return _0x98e80;})[_0x9c25('0x29')](respondWithFilteredResult(_0x4af603,_0x3d8dbb))[_0x9c25('0x4a')](handleError(_0x4af603,null));};exports[_0x9c25('0x4b')]=function(_0x51ac04,_0xb53766){var _0x3d8b1f={'raw':![],'where':{'id':_0x51ac04[_0x9c25('0x4c')]['id']}},_0x1bfd21={};_0x1bfd21[_0x9c25('0x35')]=_[_0x9c25('0x38')](db[_0x9c25('0x31')][_0x9c25('0x32')]);_0x1bfd21['query']=_[_0x9c25('0x38')](_0x51ac04[_0x9c25('0x37')]);_0x1bfd21[_0x9c25('0x39')]=_['intersection'](_0x1bfd21[_0x9c25('0x35')],_0x1bfd21[_0x9c25('0x37')]);_0x3d8b1f['attributes']=_['intersection'](_0x1bfd21[_0x9c25('0x35')],qs[_0x9c25('0x3c')](_0x51ac04[_0x9c25('0x37')][_0x9c25('0x3c')]));_0x3d8b1f['attributes']=_0x3d8b1f['attributes']['length']?_0x3d8b1f[_0x9c25('0x3a')]:_0x1bfd21[_0x9c25('0x35')];if(_0x51ac04[_0x9c25('0x37')]['includeAll']){_0x3d8b1f[_0x9c25('0x47')]=[{'all':!![]}];}_0x3d8b1f=_[_0x9c25('0x43')]({},_0x3d8b1f,_0x51ac04[_0x9c25('0x45')]);return db[_0x9c25('0x31')][_0x9c25('0x4d')](_0x3d8b1f)[_0x9c25('0x29')](handleEntityNotFound(_0xb53766,null))[_0x9c25('0x29')](respondWithResult(_0xb53766,null))[_0x9c25('0x4a')](handleError(_0xb53766,null));};exports['create']=function(_0x2c6d91,_0x46aa5c){return db['Team'][_0x9c25('0x4e')](_0x2c6d91['body'],{})[_0x9c25('0x29')](function(_0x57b47d){var _0x57fceb=_0x2c6d91['user']['get']({'plain':!![]});if(!_0x57fceb)throw new Error(_0x9c25('0x4f'));if(_0x57fceb[_0x9c25('0x50')]===_0x9c25('0x51')){var _0x31c5e8=_0x57b47d[_0x9c25('0x2b')]({'plain':!![]});var _0x4633ad=_0x9c25('0x52');return db[_0x9c25('0x53')][_0x9c25('0x4d')]({'where':{'name':_0x4633ad,'userProfileId':_0x57fceb['userProfileId']},'raw':!![]})['then'](function(_0x2bfa7e){if(_0x2bfa7e&&_0x2bfa7e['autoAssociation']===0x0){return db[_0x9c25('0x54')][_0x9c25('0x4e')]({'name':_0x31c5e8[_0x9c25('0x2f')],'resourceId':_0x31c5e8['id'],'type':_0x2bfa7e[_0x9c25('0x2f')],'sectionId':_0x2bfa7e['id']},{})[_0x9c25('0x29')](function(){return _0x57b47d;});}else{return _0x57b47d;}})[_0x9c25('0x4a')](function(_0x4fbcf2){logger[_0x9c25('0x2d')](_0x9c25('0x55'),_0x4fbcf2);throw _0x4fbcf2;});}return _0x57b47d;})['then'](respondWithResult(_0x46aa5c,0xc9))[_0x9c25('0x4a')](handleError(_0x46aa5c,null));};exports[_0x9c25('0x28')]=function(_0x30bf03,_0x394ee7){if(_0x30bf03[_0x9c25('0x56')]['id']){delete _0x30bf03[_0x9c25('0x56')]['id'];}return db[_0x9c25('0x31')][_0x9c25('0x4d')]({'where':{'id':_0x30bf03[_0x9c25('0x4c')]['id']}})[_0x9c25('0x29')](handleEntityNotFound(_0x394ee7,null))['then'](saveUpdates(_0x30bf03[_0x9c25('0x56')],null))[_0x9c25('0x29')](respondWithResult(_0x394ee7,null))['catch'](handleError(_0x394ee7,null));};exports[_0x9c25('0x2a')]=function(_0x57dd44,_0x585340){return db[_0x9c25('0x31')][_0x9c25('0x4d')]({'where':{'id':_0x57dd44['params']['id']}})[_0x9c25('0x29')](handleEntityNotFound(_0x585340,null))[_0x9c25('0x29')](removeEntity(_0x585340,null))['catch'](handleError(_0x585340,null));};exports[_0x9c25('0x57')]=function(_0x51dba0,_0x7a3ff2,_0x36a46f){return db['Team'][_0x9c25('0x58')]({'where':{'id':_0x51dba0[_0x9c25('0x4c')]['id']}})['then'](handleEntityNotFound(_0x7a3ff2,null))[_0x9c25('0x29')](function(_0x771140){if(!_0x51dba0['query'][_0x9c25('0x59')]||!utils[_0x9c25('0x5a')](_0x51dba0[_0x9c25('0x37')][_0x9c25('0x59')])){throw new db[(_0x9c25('0x5b'))][(_0x9c25('0x5c'))](_0x9c25('0x5d'));}var _0x491dc9={};var _0xab429d={};_0xab429d[_0x9c25('0x35')]=_['keys'](db[_['capitalize'](_0x51dba0[_0x9c25('0x37')][_0x9c25('0x59')]['toLowerCase']())+_0x9c25('0x5e')][_0x9c25('0x32')]);_0xab429d[_0x9c25('0x37')]=_[_0x9c25('0x38')](_0x51dba0[_0x9c25('0x37')]);_0xab429d[_0x9c25('0x39')]=_[_0x9c25('0x3b')](_0xab429d[_0x9c25('0x35')],_0xab429d[_0x9c25('0x37')]);_0x491dc9['attributes']=_[_0x9c25('0x3b')](_0xab429d[_0x9c25('0x35')],qs[_0x9c25('0x3c')](_0x51dba0[_0x9c25('0x37')][_0x9c25('0x3c')]));_0x491dc9[_0x9c25('0x3a')]=_0x491dc9[_0x9c25('0x3a')]['length']?_0x491dc9[_0x9c25('0x3a')]:_0xab429d['model'];_0x491dc9[_0x9c25('0x23')]=qs['limit'](_0x51dba0['query'][_0x9c25('0x23')]);_0x491dc9[_0x9c25('0x21')]=qs[_0x9c25('0x21')](_0x51dba0[_0x9c25('0x37')][_0x9c25('0x21')]);_0x491dc9[_0x9c25('0x3f')]=qs[_0x9c25('0x40')](_0x51dba0[_0x9c25('0x37')][_0x9c25('0x40')]);_0x491dc9[_0x9c25('0x41')]=qs[_0x9c25('0x39')](_[_0x9c25('0x5f')](_0x51dba0[_0x9c25('0x37')],_0xab429d[_0x9c25('0x39')]));_0x491dc9=_[_0x9c25('0x43')]({},_0x491dc9,_0x51dba0['options']);return _0x771140[_0x9c25('0x2b')+_[_0x9c25('0x60')](_0x51dba0[_0x9c25('0x37')]['channel']['toLowerCase']())+_0x9c25('0x61')](_0x491dc9);})[_0x9c25('0x29')](respondWithResult(_0x7a3ff2,null))[_0x9c25('0x4a')](handleError(_0x7a3ff2,null));};exports[_0x9c25('0x62')]=function(_0x3f97f7,_0x57e786,_0x31680f){return db[_0x9c25('0x31')][_0x9c25('0x58')]({'where':{'id':_0x3f97f7[_0x9c25('0x4c')]['id']}})[_0x9c25('0x29')](function(_0x3feaa1){if(_0x3feaa1){if(!_0x3f97f7[_0x9c25('0x56')][_0x9c25('0x59')]||!utils[_0x9c25('0x5a')](_0x3f97f7[_0x9c25('0x56')][_0x9c25('0x59')])){throw new db[(_0x9c25('0x5b'))][(_0x9c25('0x5c'))](_0x9c25('0x5d'));}return _0x3feaa1[_0x9c25('0x63')+_[_0x9c25('0x60')](_0x3f97f7['body'][_0x9c25('0x59')][_0x9c25('0x64')]())+_0x9c25('0x61')](_0x3f97f7[_0x9c25('0x56')]['ids']);}return null;})[_0x9c25('0x29')](handleEntityNotFound(_0x57e786,null))[_0x9c25('0x29')](respondWithStatusCode(_0x57e786,null))[_0x9c25('0x4a')](handleError(_0x57e786,null));};exports['removeQueues']=function(_0x5cc9f6,_0x2515a3,_0xafbb17){return db[_0x9c25('0x31')][_0x9c25('0x58')]({'where':{'id':_0x5cc9f6[_0x9c25('0x4c')]['id']}})['then'](function(_0x1cd020){if(_0x1cd020){if(!_0x5cc9f6[_0x9c25('0x37')]['channel']||!utils['isValidChannel'](_0x5cc9f6[_0x9c25('0x37')][_0x9c25('0x59')])){throw new db[(_0x9c25('0x5b'))]['ValidationError']('Unknown\x20channel');}return _0x1cd020[_0x9c25('0x65')+_[_0x9c25('0x60')](_0x5cc9f6[_0x9c25('0x37')][_0x9c25('0x59')][_0x9c25('0x64')]())+_0x9c25('0x61')](_0x5cc9f6[_0x9c25('0x37')]['ids']);}return null;})[_0x9c25('0x29')](handleEntityNotFound(_0x2515a3,null))[_0x9c25('0x29')](respondWithStatusCode(_0x2515a3,null))[_0x9c25('0x4a')](handleError(_0x2515a3,null));};exports[_0x9c25('0x66')]=function(_0x462c31,_0x4b33aa){return db[_0x9c25('0x31')][_0x9c25('0x4d')]({'where':{'id':_0x462c31[_0x9c25('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b33aa,null))[_0x9c25('0x29')](function(_0xf22518){if(_0xf22518){var _0x966a86=['Voice',_0x9c25('0x67'),_0x9c25('0x68'),'Sms',_0x9c25('0x69'),_0x9c25('0x6a'),'Whatsapp'];return db[_0x9c25('0x6b')]['transaction'](function(_0x5112d3){var _0x17574a=_[_0x9c25('0x36')](_0x966a86,function(_0x386450){var _0x3f2f92={'attributes':['id','name']};if(_0x386450===_0x9c25('0x6c')){_0x3f2f92['through']={'attributes':[_0x9c25('0x6d')]};}return _0xf22518[_0x9c25('0x2b')+_0x386450+_0x9c25('0x61')](_0x3f2f92)['then'](function(_0x390be1){var _0x2675ae=_[_0x9c25('0x36')](_0x390be1,function(_0x1aaf0e){var _0x4f96b1=_[_0x9c25('0x36')](_0x462c31[_0x9c25('0x56')][_0x9c25('0x6e')],function(_0x3c7b19){var _0x285127={'where':{'UserId':_0x3c7b19,[_0x386450+_0x9c25('0x6f')]:_0x1aaf0e['id']},'transaction':_0x5112d3};if(_0x386450==='Voice'){_0x285127[_0x9c25('0x19')]={'penalty':_0x1aaf0e[_0x9c25('0x70')][_0x9c25('0x6d')]};}return db['User'+_0x386450+_0x9c25('0x5e')][_0x9c25('0x71')](_0x285127)[_0x9c25('0x29')](function(){socket['emit']('user'+_0x386450+_0x9c25('0x72'),{'UserId':_0x3c7b19,[_0x386450+'QueueId']:_0x1aaf0e['id']});if(_0x386450!=='Voice')return;return db[_0x9c25('0x73')][_0x9c25('0x48')]({'where':{'id':_0x462c31[_0x9c25('0x56')][_0x9c25('0x6e')],'online':0x1},'attributes':['id',_0x9c25('0x2f'),_0x9c25('0x74'),_0x9c25('0x75'),_0x9c25('0x76')],'raw':!![]})[_0x9c25('0x29')](function(_0x22c20f){var _0x3eaaf6=_[_0x9c25('0x36')](_0x22c20f,function(_0x1fd222){return db['UserVoiceQueueRt'][_0x9c25('0x77')]({'membername':_0x1fd222[_0x9c25('0x2f')],'UserId':_0x1fd222['id'],'queue_name':_0x1aaf0e[_0x9c25('0x2f')],'VoiceQueueId':_0x1aaf0e['id'],'interface':_[_0x9c25('0x78')](_0x1fd222[_0x9c25('0x76')])?util[_0x9c25('0x79')](_0x9c25('0x7a'),_0x1fd222[_0x9c25('0x2f')]):_0x1fd222[_0x9c25('0x76')],'paused':_0x1fd222[_0x9c25('0x75')]||![],'penalty':_0x1aaf0e['TeamVoiceQueue'][_0x9c25('0x6d')]},{'transaction':_0x5112d3});});return Promise[_0x9c25('0x7b')](_0x3eaaf6);});});});return Promise[_0x9c25('0x7b')](_0x4f96b1);});return Promise[_0x9c25('0x7b')](_0x2675ae);});});return Promise['all'](_0x17574a)[_0x9c25('0x29')](function(){return _0xf22518[_0x9c25('0x66')](_0x462c31['body']['ids'],{'transaction':_0x5112d3})['spread'](function(_0x17e5a0){return _0x17e5a0;});});});}})[_0x9c25('0x29')](respondWithResult(_0x4b33aa,null))[_0x9c25('0x4a')](handleError(_0x4b33aa,null));};exports[_0x9c25('0x7c')]=function(_0x6fa8fe,_0x738306){return db[_0x9c25('0x31')][_0x9c25('0x4d')]({'where':{'id':_0x6fa8fe['params']['id']}})['then'](handleEntityNotFound(_0x738306,null))['then'](function(_0x3d5dc5){if(_0x3d5dc5){var _0x173810=[_0x9c25('0x6c'),_0x9c25('0x67'),_0x9c25('0x68'),'Sms','Fax',_0x9c25('0x6a'),'Whatsapp'];return db[_0x9c25('0x6b')]['transaction'](function(_0x25fcdc){var _0x4c74f0=_[_0x9c25('0x36')](_0x173810,function(_0x34164c){var _0x410d0d={'attributes':['id',_0x9c25('0x2f')]};return _0x3d5dc5['get'+_0x34164c+_0x9c25('0x61')](_0x410d0d)['then'](function(_0x5aaadf){var _0x4a3586=_[_0x9c25('0x36')](_0x5aaadf,function(_0x37f79a){return _0x37f79a[_0x9c25('0x7c')](_0x6fa8fe[_0x9c25('0x37')][_0x9c25('0x6e')],{'transaction':_0x25fcdc})[_0x9c25('0x29')](function(){var _0x25d4fd=JSON[_0x9c25('0x7d')]('['+_0x6fa8fe['query']['ids']+']');var _0x1806b9=_['map'](_0x25d4fd,function(_0x3d1f69){socket[_0x9c25('0x7e')](_0x9c25('0x51')+_0x34164c+_0x9c25('0x7f'),{'UserId':Number(_0x3d1f69),[_0x34164c+_0x9c25('0x6f')]:_0x37f79a['id']});if(_0x34164c!==_0x9c25('0x6c'))return;return db['UserVoiceQueueRt'][_0x9c25('0x2a')]({'where':{'VoiceQueueId':_0x37f79a['id'],'UserId':_0x3d1f69},'transaction':_0x25fcdc});});return Promise[_0x9c25('0x7b')](_0x1806b9);});});return Promise[_0x9c25('0x7b')](_0x4a3586);});});return Promise[_0x9c25('0x7b')](_0x4c74f0)[_0x9c25('0x29')](function(){return _0x3d5dc5[_0x9c25('0x7c')](_0x6fa8fe['query'][_0x9c25('0x6e')],{'transaction':_0x25fcdc});});});}})[_0x9c25('0x29')](respondWithStatusCode(_0x738306,null))['catch'](handleError(_0x738306,null));};exports[_0x9c25('0x80')]=function(_0x36f55d,_0x2ff1cd,_0x3ce05f){var _0x7384ab={};var _0xf22c8e={};var _0x53140f;var _0x280ce5;return db[_0x9c25('0x31')][_0x9c25('0x58')]({'where':{'id':_0x36f55d[_0x9c25('0x4c')]['id']}})[_0x9c25('0x29')](handleEntityNotFound(_0x2ff1cd,null))[_0x9c25('0x29')](function(_0x12f3d6){if(_0x12f3d6){_0x53140f=_0x12f3d6;_0xf22c8e[_0x9c25('0x35')]=_[_0x9c25('0x38')](db[_0x9c25('0x73')][_0x9c25('0x32')]);_0xf22c8e[_0x9c25('0x37')]=_[_0x9c25('0x38')](_0x36f55d[_0x9c25('0x37')]);_0xf22c8e[_0x9c25('0x39')]=_['intersection'](_0xf22c8e['model'],_0xf22c8e[_0x9c25('0x37')]);_0x7384ab[_0x9c25('0x3a')]=_[_0x9c25('0x3b')](_0xf22c8e[_0x9c25('0x35')],qs['fields'](_0x36f55d[_0x9c25('0x37')]['fields']));_0x7384ab[_0x9c25('0x3a')]=_0x7384ab[_0x9c25('0x3a')][_0x9c25('0x3d')]?_0x7384ab[_0x9c25('0x3a')]:_0xf22c8e[_0x9c25('0x35')];_0x7384ab[_0x9c25('0x3f')]=qs['sort'](_0x36f55d[_0x9c25('0x37')]['sort']);_0x7384ab[_0x9c25('0x41')]=qs['filters'](_[_0x9c25('0x5f')](_0x36f55d[_0x9c25('0x37')],_0xf22c8e[_0x9c25('0x39')]));if(_0x36f55d[_0x9c25('0x37')][_0x9c25('0x42')]){_0x7384ab[_0x9c25('0x41')]=_[_0x9c25('0x43')](_0x7384ab[_0x9c25('0x41')],{'$or':_['map'](_0x7384ab[_0x9c25('0x3a')],function(_0x15e315){var _0x392fdf={};_0x392fdf[_0x15e315]={'$like':'%'+_0x36f55d[_0x9c25('0x37')][_0x9c25('0x42')]+'%'};return _0x392fdf;})});}_0x7384ab=_[_0x9c25('0x43')]({},_0x7384ab,_0x36f55d[_0x9c25('0x45')]);return _0x53140f[_0x9c25('0x80')](_0x7384ab);}})[_0x9c25('0x29')](function(_0x4b76d0){if(_0x4b76d0){_0x280ce5=_0x4b76d0['length'];if(!_0x36f55d[_0x9c25('0x37')][_0x9c25('0x3e')](_0x9c25('0x81'))){_0x7384ab[_0x9c25('0x23')]=qs['limit'](_0x36f55d['query']['limit']);_0x7384ab[_0x9c25('0x21')]=qs[_0x9c25('0x21')](_0x36f55d[_0x9c25('0x37')]['offset']);}return _0x53140f[_0x9c25('0x80')](_0x7384ab);}})[_0x9c25('0x29')](function(_0x50ce2f){if(_0x50ce2f){return _0x50ce2f?{'count':_0x280ce5,'rows':_0x50ce2f}:null;}})['then'](respondWithResult(_0x2ff1cd,null))['catch'](handleError(_0x2ff1cd,null));};
\ No newline at end of file
index dc4d8a1..9453d3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5a9=['hook','exports','events','Team','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x419a45,_0x2485f7){var _0x3a8bb5=function(_0x3a3c84){while(--_0x3a3c84){_0x419a45['push'](_0x419a45['shift']());}};_0x3a8bb5(++_0x2485f7);}(_0xc5a9,0x9b));var _0x9c5a=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xc5a9[_0x5834bc];return _0x3e183a;};'use strict';var EventEmitter=require(_0x9c5a('0x0'));var Team=require('../../mysqldb')['db'][_0x9c5a('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x9c5a('0x2')](0x0);var events={'afterCreate':_0x9c5a('0x3'),'afterUpdate':_0x9c5a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x26ad4f){return function(_0x5e626e,_0x1c77b9,_0x42b91d){TeamEvents[_0x9c5a('0x5')](_0x26ad4f+':'+_0x5e626e['id'],_0x5e626e);TeamEvents[_0x9c5a('0x5')](_0x26ad4f,_0x5e626e);_0x42b91d(null);};}for(var e in events){if(events[_0x9c5a('0x6')](e)){var event=events[e];Team[_0x9c5a('0x7')](e,emitEvent(event));}}module[_0x9c5a('0x8')]=TeamEvents;
\ No newline at end of file
+var _0x657c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','Team'];(function(_0x2278d1,_0x32a372){var _0x22442b=function(_0x5df6f9){while(--_0x5df6f9){_0x2278d1['push'](_0x2278d1['shift']());}};_0x22442b(++_0x32a372);}(_0x657c,0x19c));var _0xc657=function(_0x123450,_0x491c01){_0x123450=_0x123450-0x0;var _0x23b29d=_0x657c[_0x123450];return _0x23b29d;};'use strict';var EventEmitter=require('events');var Team=require(_0xc657('0x0'))['db'][_0xc657('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xc657('0x2')](0x0);var events={'afterCreate':_0xc657('0x3'),'afterUpdate':_0xc657('0x4'),'afterDestroy':_0xc657('0x5')};function emitEvent(_0x418770){return function(_0x1742d2,_0x2b2f5a,_0x4bce27){TeamEvents[_0xc657('0x6')](_0x418770+':'+_0x1742d2['id'],_0x1742d2);TeamEvents[_0xc657('0x6')](_0x418770,_0x1742d2);_0x4bce27(null);};}for(var e in events){if(events[_0xc657('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xc657('0x8')]=TeamEvents;
\ No newline at end of file
index 6cd9914..307377c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce15=['path','rimraf','../../config/environment','./team.attributes','exports','teams','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x360949,_0x41ac33){var _0x197a7f=function(_0x4029f7){while(--_0x4029f7){_0x360949['push'](_0x360949['shift']());}};_0x197a7f(++_0x41ac33);}(_0xce15,0xd6));var _0x5ce1=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0xce15[_0x4af01e];return _0x178c11;};'use strict';var _=require(_0x5ce1('0x0'));var util=require(_0x5ce1('0x1'));var logger=require(_0x5ce1('0x2'))(_0x5ce1('0x3'));var moment=require(_0x5ce1('0x4'));var BPromise=require(_0x5ce1('0x5'));var rp=require(_0x5ce1('0x6'));var fs=require('fs');var path=require(_0x5ce1('0x7'));var rimraf=require(_0x5ce1('0x8'));var config=require(_0x5ce1('0x9'));var attributes=require(_0x5ce1('0xa'));module[_0x5ce1('0xb')]=function(_0x34a8b1,_0xdbf80f){return _0x34a8b1['define']('Team',attributes,{'tableName':_0x5ce1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x06d0=['exports','define','Team','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./team.attributes'];(function(_0x3554c5,_0x350da9){var _0x225fa6=function(_0x69e398){while(--_0x69e398){_0x3554c5['push'](_0x3554c5['shift']());}};_0x225fa6(++_0x350da9);}(_0x06d0,0x66));var _0x006d=function(_0x2cf452,_0x763cf3){_0x2cf452=_0x2cf452-0x0;var _0x1eef13=_0x06d0[_0x2cf452];return _0x1eef13;};'use strict';var _=require(_0x006d('0x0'));var util=require(_0x006d('0x1'));var logger=require('../../config/logger')(_0x006d('0x2'));var moment=require(_0x006d('0x3'));var BPromise=require(_0x006d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x006d('0x5'));var config=require(_0x006d('0x6'));var attributes=require(_0x006d('0x7'));module[_0x006d('0x8')]=function(_0x32a5f7,_0x4a08bd){return _0x32a5f7[_0x006d('0x9')](_0x006d('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 52af9a6..aadf0b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6324=['Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x6324,0x13b));var _0x4632=function(_0x216494,_0x21a0b4){_0x216494=_0x216494-0x0;var _0x3fce22=_0x6324[_0x216494];return _0x3fce22;};'use strict';var _=require(_0x4632('0x0'));var util=require('util');var moment=require(_0x4632('0x1'));var BPromise=require('bluebird');var rs=require(_0x4632('0x2'));var fs=require('fs');var Redis=require(_0x4632('0x3'));var db=require(_0x4632('0x4'))['db'];var utils=require(_0x4632('0x5'));var logger=require(_0x4632('0x6'))(_0x4632('0x7'));var config=require(_0x4632('0x8'));var jayson=require(_0x4632('0x9'));var client=jayson['client'][_0x4632('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4632('0xb')],{'host':_0x4632('0xc'),'port':0x18eb});var socket=require(_0x4632('0xd'))(new Redis(config['redis']));require(_0x4632('0xe'))[_0x4632('0xf')](socket);function respondWithRpcPromise(_0x457a2e,_0x1d3b94,_0x38e049){return new BPromise(function(_0x36e342,_0x3d5b6a){return client['request'](_0x457a2e,_0x38e049)[_0x4632('0x10')](function(_0x13c780){logger[_0x4632('0x11')](_0x4632('0x12'),_0x1d3b94,_0x4632('0x13'));logger[_0x4632('0x14')](_0x4632('0x15'),_0x1d3b94,_0x4632('0x13'),JSON[_0x4632('0x16')](_0x13c780));if(_0x13c780[_0x4632('0x17')]){if(_0x13c780[_0x4632('0x17')][_0x4632('0x18')]===0x1f4){logger[_0x4632('0x17')]('Team,\x20%s,\x20%s',_0x1d3b94,_0x13c780['error'][_0x4632('0x19')]);return _0x3d5b6a(_0x13c780[_0x4632('0x17')]['message']);}logger[_0x4632('0x17')](_0x4632('0x12'),_0x1d3b94,_0x13c780[_0x4632('0x17')][_0x4632('0x19')]);return _0x36e342(_0x13c780['error'][_0x4632('0x19')]);}else{logger[_0x4632('0x11')]('Team,\x20%s,\x20%s',_0x1d3b94,_0x4632('0x13'));_0x36e342(_0x13c780[_0x4632('0x1a')][_0x4632('0x19')]);}})[_0x4632('0x1b')](function(_0x3b0d19){logger[_0x4632('0x17')](_0x4632('0x12'),_0x1d3b94,_0x3b0d19);_0x3d5b6a(_0x3b0d19);});});}
\ No newline at end of file
+var _0x1696=['result','lodash','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x1696,0x141));var _0x6169=function(_0x766aae,_0x415039){_0x766aae=_0x766aae-0x0;var _0x2af69c=_0x1696[_0x766aae];return _0x2af69c;};'use strict';var _=require(_0x6169('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6169('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6169('0x2'));var logger=require(_0x6169('0x3'))('rpc');var config=require(_0x6169('0x4'));var jayson=require(_0x6169('0x5'));var client=jayson['client'][_0x6169('0x6')]({'port':0x232a});config[_0x6169('0x7')]=_[_0x6169('0x8')](config[_0x6169('0x7')],{'host':_0x6169('0x9'),'port':0x18eb});var socket=require(_0x6169('0xa'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x3699dc,_0x1aa529,_0x1ce434){return new BPromise(function(_0x4428a0,_0x41c7d5){return client[_0x6169('0xb')](_0x3699dc,_0x1ce434)['then'](function(_0x43ebca){logger[_0x6169('0xc')](_0x6169('0xd'),_0x1aa529,_0x6169('0xe'));logger['debug'](_0x6169('0xf'),_0x1aa529,_0x6169('0xe'),JSON[_0x6169('0x10')](_0x43ebca));if(_0x43ebca[_0x6169('0x11')]){if(_0x43ebca[_0x6169('0x11')]['code']===0x1f4){logger[_0x6169('0x11')]('Team,\x20%s,\x20%s',_0x1aa529,_0x43ebca['error'][_0x6169('0x12')]);return _0x41c7d5(_0x43ebca[_0x6169('0x11')]['message']);}logger[_0x6169('0x11')](_0x6169('0xd'),_0x1aa529,_0x43ebca[_0x6169('0x11')]['message']);return _0x4428a0(_0x43ebca['error']['message']);}else{logger[_0x6169('0xc')](_0x6169('0xd'),_0x1aa529,_0x6169('0xe'));_0x4428a0(_0x43ebca[_0x6169('0x13')][_0x6169('0x12')]);}})['catch'](function(_0x2b470f){logger[_0x6169('0x11')](_0x6169('0xd'),_0x1aa529,_0x2b470f);_0x41c7d5(_0x2b470f);});});}
\ No newline at end of file
index 31ce5f3..41d88ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3979=['length','save','remove','update','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3979,0x114));var _0x9397=function(_0xa6cd87,_0x2df905){_0xa6cd87=_0xa6cd87-0x0;var _0x187821=_0x3979[_0xa6cd87];return _0x187821;};'use strict';var TeamEvents=require('./team.events');var events=[_0x9397('0x0'),_0x9397('0x1'),_0x9397('0x2')];function createListener(_0x372f8d,_0x223095){return function(_0x356149){_0x223095['emit'](_0x372f8d,_0x356149);};}function removeListener(_0x3bfe18,_0x329ec1){return function(){TeamEvents[_0x9397('0x3')](_0x3bfe18,_0x329ec1);};}exports['register']=function(_0x206ab2){for(var _0x380477=0x0,_0x42eb12=events[_0x9397('0x4')];_0x380477<_0x42eb12;_0x380477++){var _0x20278b=events[_0x380477];var _0x2aa6d9=createListener('team:'+_0x20278b,_0x206ab2);TeamEvents['on'](_0x20278b,_0x2aa6d9);}};
\ No newline at end of file
+var _0xdf97=['register','length','team:','./team.events','remove','update','emit','removeListener'];(function(_0x4a7906,_0x3ef77d){var _0x558373=function(_0xd892c3){while(--_0xd892c3){_0x4a7906['push'](_0x4a7906['shift']());}};_0x558373(++_0x3ef77d);}(_0xdf97,0xfb));var _0x7df9=function(_0x5bb47f,_0x5dfc60){_0x5bb47f=_0x5bb47f-0x0;var _0x483679=_0xdf97[_0x5bb47f];return _0x483679;};'use strict';var TeamEvents=require(_0x7df9('0x0'));var events=['save',_0x7df9('0x1'),_0x7df9('0x2')];function createListener(_0x99b37c,_0x4240ce){return function(_0x2d51c9){_0x4240ce[_0x7df9('0x3')](_0x99b37c,_0x2d51c9);};}function removeListener(_0x42b08c,_0x4e2c34){return function(){TeamEvents[_0x7df9('0x4')](_0x42b08c,_0x4e2c34);};}exports[_0x7df9('0x5')]=function(_0x355a1c){for(var _0x19ffc3=0x0,_0x1cb6b5=events[_0x7df9('0x6')];_0x19ffc3<_0x1cb6b5;_0x19ffc3++){var _0x132cff=events[_0x19ffc3];var _0x314153=createListener(_0x7df9('0x7')+_0x132cff,_0x355a1c);TeamEvents['on'](_0x132cff,_0x314153);}};
\ No newline at end of file
index 24e7a49..ebde60d 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(_0x1a6bde,_0x3e8809){var _0x490911=function(_0x1da913){while(--_0x1da913){_0x1a6bde['push'](_0x1a6bde['shift']());}};_0x490911(++_0x3e8809);}(_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(_0x4fc79e,_0x3b1919){var _0x301cba=function(_0x39ed05){while(--_0x39ed05){_0x4fc79e['push'](_0x4fc79e['shift']());}};_0x301cba(++_0x3b1919);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'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 15fd27e..cae3ea2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1af=['sequelize','exports'];(function(_0x237280,_0x4089cb){var _0x549204=function(_0x25eead){while(--_0x25eead){_0x237280['push'](_0x237280['shift']());}};_0x549204(++_0x4089cb);}(_0xc1af,0x1b8));var _0xfc1a=function(_0x5669f8,_0x2f52c6){_0x5669f8=_0x5669f8-0x0;var _0x294e72=_0xc1af[_0x5669f8];return _0x294e72;};'use strict';var Sequelize=require(_0xfc1a('0x0'));module[_0xfc1a('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x362a=['sequelize','exports','INTEGER'];(function(_0x2e907c,_0x248d21){var _0x2a28e2=function(_0x5e39ae){while(--_0x5e39ae){_0x2e907c['push'](_0x2e907c['shift']());}};_0x2a28e2(++_0x248d21);}(_0x362a,0x102));var _0xa362=function(_0x44d6b8,_0xe7e065){_0x44d6b8=_0x44d6b8-0x0;var _0x18cbfa=_0x362a[_0x44d6b8];return _0x18cbfa;};'use strict';var Sequelize=require(_0xa362('0x0'));module[_0xa362('0x1')]={'penalty':{'type':Sequelize[_0xa362('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 4de54c8..f1a33fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacb8=['path','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','../../config/logger','api','moment','request-promise'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xacb8,0x119));var _0x8acb=function(_0x11e213,_0x4f2b14){_0x11e213=_0x11e213-0x0;var _0x504df2=_0xacb8[_0x11e213];return _0x504df2;};'use strict';var _=require(_0x8acb('0x0'));var util=require('util');var logger=require(_0x8acb('0x1'))(_0x8acb('0x2'));var moment=require(_0x8acb('0x3'));var BPromise=require('bluebird');var rp=require(_0x8acb('0x4'));var fs=require('fs');var path=require(_0x8acb('0x5'));var rimraf=require('rimraf');var config=require(_0x8acb('0x6'));var attributes=require(_0x8acb('0x7'));module[_0x8acb('0x8')]=function(_0x2b8230,_0x893152){return _0x2b8230[_0x8acb('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0x8acb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1bb2=['TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x5a64ad,_0x323c95){var _0x548b73=function(_0x2e2dee){while(--_0x2e2dee){_0x5a64ad['push'](_0x5a64ad['shift']());}};_0x548b73(++_0x323c95);}(_0x1bb2,0x152));var _0x21bb=function(_0x38536f,_0x3ccc0b){_0x38536f=_0x38536f-0x0;var _0x2674ee=_0x1bb2[_0x38536f];return _0x2674ee;};'use strict';var _=require('lodash');var util=require(_0x21bb('0x0'));var logger=require(_0x21bb('0x1'))(_0x21bb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x21bb('0x3'));var fs=require('fs');var path=require(_0x21bb('0x4'));var rimraf=require(_0x21bb('0x5'));var config=require(_0x21bb('0x6'));var attributes=require(_0x21bb('0x7'));module[_0x21bb('0x8')]=function(_0x198344,_0x267bb0){return _0x198344[_0x21bb('0x9')](_0x21bb('0xa'),attributes,{'tableName':_0x21bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 41213e1..30fa4da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74cf=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x74cf,0x126));var _0xf74c=function(_0x387c2e,_0x1bc867){_0x387c2e=_0x387c2e-0x0;var _0x8987e1=_0x74cf[_0x387c2e];return _0x8987e1;};'use strict';var _=require(_0xf74c('0x0'));var util=require(_0xf74c('0x1'));var moment=require(_0xf74c('0x2'));var BPromise=require(_0xf74c('0x3'));var rs=require(_0xf74c('0x4'));var fs=require('fs');var Redis=require(_0xf74c('0x5'));var db=require(_0xf74c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf74c('0x7'))(_0xf74c('0x8'));var config=require(_0xf74c('0x9'));var jayson=require(_0xf74c('0xa'));var client=jayson[_0xf74c('0xb')][_0xf74c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9507cc,_0x4db363,_0x3d5148){return new BPromise(function(_0x2a6907,_0x48a904){return client[_0xf74c('0xd')](_0x9507cc,_0x3d5148)[_0xf74c('0xe')](function(_0x108c42){logger['info'](_0xf74c('0xf'),_0x4db363,_0xf74c('0x10'));logger[_0xf74c('0x11')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4db363,_0xf74c('0x10'),JSON[_0xf74c('0x12')](_0x108c42));if(_0x108c42[_0xf74c('0x13')]){if(_0x108c42['error'][_0xf74c('0x14')]===0x1f4){logger[_0xf74c('0x13')](_0xf74c('0xf'),_0x4db363,_0x108c42[_0xf74c('0x13')][_0xf74c('0x15')]);return _0x48a904(_0x108c42['error'][_0xf74c('0x15')]);}logger[_0xf74c('0x13')](_0xf74c('0xf'),_0x4db363,_0x108c42[_0xf74c('0x13')][_0xf74c('0x15')]);return _0x2a6907(_0x108c42[_0xf74c('0x13')][_0xf74c('0x15')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x4db363,_0xf74c('0x10'));_0x2a6907(_0x108c42[_0xf74c('0x16')]['message']);}})['catch'](function(_0x3db543){logger[_0xf74c('0x13')](_0xf74c('0xf'),_0x4db363,_0x3db543);_0x48a904(_0x3db543);});});}
\ No newline at end of file
+var _0x923f=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x36257b,_0x53ebf9){var _0x3f949f=function(_0x2569b9){while(--_0x2569b9){_0x36257b['push'](_0x36257b['shift']());}};_0x3f949f(++_0x53ebf9);}(_0x923f,0x7b));var _0xf923=function(_0x46b80a,_0x1f58f9){_0x46b80a=_0x46b80a-0x0;var _0x5c04fe=_0x923f[_0x46b80a];return _0x5c04fe;};'use strict';var _=require(_0xf923('0x0'));var util=require(_0xf923('0x1'));var moment=require(_0xf923('0x2'));var BPromise=require(_0xf923('0x3'));var rs=require(_0xf923('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf923('0x5'))['db'];var utils=require(_0xf923('0x6'));var logger=require(_0xf923('0x7'))('rpc');var config=require(_0xf923('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf923('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30f2b7,_0x42738b,_0x19501c){return new BPromise(function(_0x3db5ab,_0x2cfc53){return client[_0xf923('0xa')](_0x30f2b7,_0x19501c)['then'](function(_0x3ab9b){logger['info'](_0xf923('0xb'),_0x42738b,'request\x20sent');logger[_0xf923('0xc')](_0xf923('0xd'),_0x42738b,_0xf923('0xe'),JSON[_0xf923('0xf')](_0x3ab9b));if(_0x3ab9b[_0xf923('0x10')]){if(_0x3ab9b['error'][_0xf923('0x11')]===0x1f4){logger[_0xf923('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x42738b,_0x3ab9b[_0xf923('0x10')]['message']);return _0x2cfc53(_0x3ab9b[_0xf923('0x10')]['message']);}logger[_0xf923('0x10')](_0xf923('0xb'),_0x42738b,_0x3ab9b[_0xf923('0x10')][_0xf923('0x12')]);return _0x3db5ab(_0x3ab9b[_0xf923('0x10')][_0xf923('0x12')]);}else{logger['info'](_0xf923('0xb'),_0x42738b,_0xf923('0xe'));_0x3db5ab(_0x3ab9b[_0xf923('0x13')][_0xf923('0x12')]);}})[_0xf923('0x14')](function(_0x259cc9){logger[_0xf923('0x10')](_0xf923('0xb'),_0x42738b,_0x259cc9);_0x2cfc53(_0x259cc9);});});}
\ No newline at end of file
index 8789ad9..b06c476 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9e5=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated','delete','destroy'];(function(_0x52c6e1,_0x5d1341){var _0x2b47f5=function(_0x6ec58b){while(--_0x6ec58b){_0x52c6e1['push'](_0x52c6e1['shift']());}};_0x2b47f5(++_0x5d1341);}(_0xf9e5,0x89));var _0x5f9e=function(_0x381b63,_0x3492ac){_0x381b63=_0x381b63-0x0;var _0x535695=_0xf9e5[_0x381b63];return _0x535695;};'use strict';var multer=require(_0x5f9e('0x0'));var util=require(_0x5f9e('0x1'));var path=require(_0x5f9e('0x2'));var timeout=require(_0x5f9e('0x3'));var express=require(_0x5f9e('0x4'));var router=express[_0x5f9e('0x5')]();var fs_extra=require(_0x5f9e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5f9e('0x7'));var config=require(_0x5f9e('0x8'));var controller=require('./template.controller');router[_0x5f9e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5f9e('0x9')](_0x5f9e('0xa'),auth['isAuthenticated'](),controller[_0x5f9e('0xb')]);router[_0x5f9e('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5f9e('0xa'),auth[_0x5f9e('0xd')](),controller['update']);router[_0x5f9e('0xe')](_0x5f9e('0xa'),auth[_0x5f9e('0xd')](),controller[_0x5f9e('0xf')]);module[_0x5f9e('0x10')]=router;
\ No newline at end of file
+var _0xd237=['../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','show','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xd237,0x14f));var _0x7d23=function(_0x57b4dc,_0x3fbf56){_0x57b4dc=_0x57b4dc-0x0;var _0x19a18a=_0xd237[_0x57b4dc];return _0x19a18a;};'use strict';var multer=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var path=require(_0x7d23('0x2'));var timeout=require(_0x7d23('0x3'));var express=require('express');var router=express[_0x7d23('0x4')]();var fs_extra=require(_0x7d23('0x5'));var auth=require(_0x7d23('0x6'));var interaction=require(_0x7d23('0x7'));var config=require(_0x7d23('0x8'));var controller=require(_0x7d23('0x9'));router['get']('/',auth[_0x7d23('0xa')](),controller['index']);router['get']('/:id',auth[_0x7d23('0xa')](),controller[_0x7d23('0xb')]);router[_0x7d23('0xc')]('/',auth[_0x7d23('0xa')](),controller[_0x7d23('0xd')]);router[_0x7d23('0xe')](_0x7d23('0xf'),auth[_0x7d23('0xa')](),controller['update']);router[_0x7d23('0x10')](_0x7d23('0xf'),auth[_0x7d23('0xa')](),controller['destroy']);module[_0x7d23('0x11')]=router;
\ No newline at end of file
index 14fb54f..4719287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b9e=['sequelize','STRING'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x0b9e,0x18c));var _0xe0b9=function(_0x157822,_0x2e7f25){_0x157822=_0x157822-0x0;var _0x241015=_0x0b9e[_0x157822];return _0x241015;};'use strict';var Sequelize=require(_0xe0b9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe0b9('0x1')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xd136=['STRING','exports'];(function(_0x1850ba,_0x55e013){var _0x2045e8=function(_0x5a5b09){while(--_0x5a5b09){_0x1850ba['push'](_0x1850ba['shift']());}};_0x2045e8(++_0x55e013);}(_0xd136,0xfd));var _0x6d13=function(_0x4a7897,_0x456e37){_0x4a7897=_0x4a7897-0x0;var _0x42abd1=_0xd136[_0x4a7897];return _0x42abd1;};'use strict';var Sequelize=require('sequelize');module[_0x6d13('0x0')]={'name':{'type':Sequelize[_0x6d13('0x1')]},'description':{'type':Sequelize[_0x6d13('0x1')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index ed0e183..b525b39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2649=['end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','user','role','get','Templates','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x52965d,_0x25b21e){var _0x471208=function(_0x14e82f){while(--_0x14e82f){_0x52965d['push'](_0x52965d['shift']());}};_0x471208(++_0x25b21e);}(_0x2649,0x1e2));var _0x9264=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x2649[_0x1bc013];return _0x55df36;};'use strict';var emlformat=require(_0x9264('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9264('0x1'));var jsonpatch=require(_0x9264('0x2'));var rp=require(_0x9264('0x3'));var moment=require(_0x9264('0x4'));var BPromise=require(_0x9264('0x5'));var Mustache=require('mustache');var util=require(_0x9264('0x6'));var path=require(_0x9264('0x7'));var sox=require(_0x9264('0x8'));var csv=require(_0x9264('0x9'));var ejs=require(_0x9264('0xa'));var fs=require('fs');var fs_extra=require(_0x9264('0xb'));var _=require(_0x9264('0xc'));var squel=require(_0x9264('0xd'));var crypto=require(_0x9264('0xe'));var jsforce=require(_0x9264('0xf'));var deskjs=require(_0x9264('0x10'));var toCsv=require(_0x9264('0x9'));var querystring=require(_0x9264('0x11'));var Papa=require(_0x9264('0x12'));var Redis=require('ioredis');var authService=require(_0x9264('0x13'));var qs=require(_0x9264('0x14'));var as=require(_0x9264('0x15'));var hardwareService=require(_0x9264('0x16'));var logger=require(_0x9264('0x17'))('api');var utils=require(_0x9264('0x18'));var config=require(_0x9264('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9264('0x1a'))['db'];function respondWithStatusCode(_0x1c13d1,_0x546587){_0x546587=_0x546587||0xcc;return function(_0x2ec093){if(_0x2ec093){return _0x1c13d1[_0x9264('0x1b')](_0x546587);}return _0x1c13d1['status'](_0x546587)[_0x9264('0x1c')]();};}function respondWithResult(_0x497ddb,_0x126f83){_0x126f83=_0x126f83||0xc8;return function(_0x3625da){if(_0x3625da){return _0x497ddb[_0x9264('0x1d')](_0x126f83)[_0x9264('0x1e')](_0x3625da);}};}function respondWithFilteredResult(_0x8786cd,_0x1c2247){return function(_0x507fa5){if(_0x507fa5){var _0x41b02a=typeof _0x1c2247[_0x9264('0x1f')]===_0x9264('0x20')&&typeof _0x1c2247[_0x9264('0x21')]===_0x9264('0x20');var _0x12ea7e=_0x507fa5[_0x9264('0x22')];var _0x2b8140=_0x41b02a?0x0:_0x1c2247[_0x9264('0x1f')];var _0x1557a6=_0x41b02a?_0x507fa5['count']:_0x1c2247['offset']+_0x1c2247['limit'];var _0x3e2660;if(_0x1557a6>=_0x12ea7e){_0x1557a6=_0x12ea7e;_0x3e2660=0xc8;}else{_0x3e2660=0xce;}_0x8786cd[_0x9264('0x1d')](_0x3e2660);return _0x8786cd[_0x9264('0x23')](_0x9264('0x24'),_0x2b8140+'-'+_0x1557a6+'/'+_0x12ea7e)['json'](_0x507fa5);}return null;};}function patchUpdates(_0x19e085){return function(_0x4eea75){try{jsonpatch[_0x9264('0x25')](_0x4eea75,_0x19e085,!![]);}catch(_0x1e13d1){return BPromise[_0x9264('0x26')](_0x1e13d1);}return _0x4eea75[_0x9264('0x27')]();};}function saveUpdates(_0x539ec3,_0x535027){return function(_0x36f1d1){if(_0x36f1d1){return _0x36f1d1[_0x9264('0x28')](_0x539ec3)[_0x9264('0x29')](function(_0x4e2040){return _0x4e2040;});}return null;};}function removeEntity(_0x3b92ae,_0x46f406){return function(_0x187ea1){if(_0x187ea1){return _0x187ea1[_0x9264('0x2a')]()['then'](function(){var _0x439657=_0x187ea1['get']({'plain':!![]});var _0x50a242='Templates';return db['UserProfileResource'][_0x9264('0x2a')]({'where':{'type':_0x50a242,'resourceId':_0x439657['id']}})['then'](function(){return _0x187ea1;});})[_0x9264('0x29')](function(){_0x3b92ae[_0x9264('0x1d')](0xcc)[_0x9264('0x1c')]();});}};}function handleEntityNotFound(_0x5a2a92,_0x3407b7){return function(_0x518296){if(!_0x518296){_0x5a2a92[_0x9264('0x1b')](0x194);}return _0x518296;};}function handleError(_0x231705,_0x308992){_0x308992=_0x308992||0x1f4;return function(_0x302c0b){logger['error'](_0x302c0b['stack']);if(_0x302c0b[_0x9264('0x2b')]){delete _0x302c0b['name'];}_0x231705['status'](_0x308992)[_0x9264('0x2c')](_0x302c0b);};}exports[_0x9264('0x2d')]=function(_0x4766fd,_0x3925ef){var _0xcc7af7={},_0x3c29e9={},_0x161caf={'count':0x0,'rows':[]};var _0x10fdb4=_[_0x9264('0x2e')](db[_0x9264('0x2f')][_0x9264('0x30')],function(_0x7cd8bc){return{'name':_0x7cd8bc[_0x9264('0x31')],'type':_0x7cd8bc[_0x9264('0x32')][_0x9264('0x33')]};});_0x3c29e9[_0x9264('0x34')]=_[_0x9264('0x2e')](_0x10fdb4,_0x9264('0x2b'));_0x3c29e9['query']=_[_0x9264('0x35')](_0x4766fd['query']);_0x3c29e9[_0x9264('0x36')]=_[_0x9264('0x37')](_0x3c29e9['model'],_0x3c29e9[_0x9264('0x38')]);_0xcc7af7['attributes']=_[_0x9264('0x37')](_0x3c29e9[_0x9264('0x34')],qs[_0x9264('0x39')](_0x4766fd[_0x9264('0x38')][_0x9264('0x39')]));_0xcc7af7[_0x9264('0x3a')]=_0xcc7af7['attributes']['length']?_0xcc7af7['attributes']:_0x3c29e9[_0x9264('0x34')];if(!_0x4766fd['query'][_0x9264('0x3b')](_0x9264('0x3c'))){_0xcc7af7[_0x9264('0x21')]=qs[_0x9264('0x21')](_0x4766fd[_0x9264('0x38')]['limit']);_0xcc7af7[_0x9264('0x1f')]=qs[_0x9264('0x1f')](_0x4766fd[_0x9264('0x38')]['offset']);}_0xcc7af7[_0x9264('0x3d')]=qs[_0x9264('0x3e')](_0x4766fd[_0x9264('0x38')]['sort']);_0xcc7af7[_0x9264('0x3f')]=qs[_0x9264('0x36')](_[_0x9264('0x40')](_0x4766fd['query'],_0x3c29e9[_0x9264('0x36')]),_0x10fdb4);if(_0x4766fd[_0x9264('0x38')]['filter']){_0xcc7af7['where']=_[_0x9264('0x41')](_0xcc7af7[_0x9264('0x3f')],{'$or':_[_0x9264('0x2e')](_0x10fdb4,function(_0x568e78){if(_0x568e78[_0x9264('0x32')]!==_0x9264('0x42')){var _0x2c33f4={};_0x2c33f4[_0x568e78['name']]={'$like':'%'+_0x4766fd[_0x9264('0x38')]['filter']+'%'};return _0x2c33f4;}})});}_0xcc7af7=_[_0x9264('0x41')]({},_0xcc7af7,_0x4766fd[_0x9264('0x43')]);var _0x5a4798={'where':_0xcc7af7[_0x9264('0x3f')]};return db[_0x9264('0x2f')]['count'](_0x5a4798)[_0x9264('0x29')](function(_0x6e0e93){_0x161caf['count']=_0x6e0e93;if(_0x4766fd[_0x9264('0x38')][_0x9264('0x44')]){_0xcc7af7[_0x9264('0x45')]=[{'all':!![]}];}return db['Template'][_0x9264('0x46')](_0xcc7af7);})[_0x9264('0x29')](function(_0x22f0b4){_0x161caf['rows']=_0x22f0b4;return _0x161caf;})[_0x9264('0x29')](respondWithFilteredResult(_0x3925ef,_0xcc7af7))[_0x9264('0x47')](handleError(_0x3925ef,null));};exports[_0x9264('0x48')]=function(_0x3a9624,_0x41f396){var _0x7e943f={'raw':!![],'where':{'id':_0x3a9624[_0x9264('0x49')]['id']}},_0x5c1fc5={};_0x5c1fc5[_0x9264('0x34')]=_[_0x9264('0x35')](db[_0x9264('0x2f')][_0x9264('0x30')]);_0x5c1fc5[_0x9264('0x38')]=_[_0x9264('0x35')](_0x3a9624[_0x9264('0x38')]);_0x5c1fc5[_0x9264('0x36')]=_['intersection'](_0x5c1fc5[_0x9264('0x34')],_0x5c1fc5[_0x9264('0x38')]);_0x7e943f[_0x9264('0x3a')]=_['intersection'](_0x5c1fc5[_0x9264('0x34')],qs[_0x9264('0x39')](_0x3a9624[_0x9264('0x38')][_0x9264('0x39')]));_0x7e943f[_0x9264('0x3a')]=_0x7e943f[_0x9264('0x3a')][_0x9264('0x4a')]?_0x7e943f['attributes']:_0x5c1fc5['model'];if(_0x3a9624['query'][_0x9264('0x44')]){_0x7e943f[_0x9264('0x45')]=[{'all':!![]}];}_0x7e943f=_[_0x9264('0x41')]({},_0x7e943f,_0x3a9624[_0x9264('0x43')]);return db[_0x9264('0x2f')][_0x9264('0x4b')](_0x7e943f)['then'](handleEntityNotFound(_0x41f396,null))[_0x9264('0x29')](respondWithResult(_0x41f396,null))[_0x9264('0x47')](handleError(_0x41f396,null));};exports[_0x9264('0x4c')]=function(_0x4c0c6a,_0x177f56){return db[_0x9264('0x2f')][_0x9264('0x4c')](_0x4c0c6a[_0x9264('0x4d')],{})[_0x9264('0x29')](function(_0x56b642){var _0x191307=_0x4c0c6a[_0x9264('0x4e')]['get']({'plain':!![]});if(!_0x191307)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x191307[_0x9264('0x4f')]==='user'){var _0x1e4b04=_0x56b642[_0x9264('0x50')]({'plain':!![]});var _0x4d0c5b=_0x9264('0x51');return db['UserProfileSection'][_0x9264('0x4b')]({'where':{'name':_0x4d0c5b,'userProfileId':_0x191307[_0x9264('0x52')]},'raw':!![]})[_0x9264('0x29')](function(_0x450ea1){if(_0x450ea1&&_0x450ea1['autoAssociation']===0x0){return db[_0x9264('0x53')]['create']({'name':_0x1e4b04['name'],'resourceId':_0x1e4b04['id'],'type':_0x450ea1[_0x9264('0x2b')],'sectionId':_0x450ea1['id']},{})[_0x9264('0x29')](function(){return _0x56b642;});}else{return _0x56b642;}})[_0x9264('0x47')](function(_0x177d3f){logger['error'](_0x9264('0x54'),_0x177d3f);throw _0x177d3f;});}return _0x56b642;})['then'](respondWithResult(_0x177f56,0xc9))[_0x9264('0x47')](handleError(_0x177f56,null));};exports['update']=function(_0x1a2e6f,_0x3076bd){if(_0x1a2e6f[_0x9264('0x4d')]['id']){delete _0x1a2e6f[_0x9264('0x4d')]['id'];}return db[_0x9264('0x2f')]['find']({'where':{'id':_0x1a2e6f[_0x9264('0x49')]['id']}})[_0x9264('0x29')](handleEntityNotFound(_0x3076bd,null))[_0x9264('0x29')](saveUpdates(_0x1a2e6f[_0x9264('0x4d')],null))['then'](respondWithResult(_0x3076bd,null))[_0x9264('0x47')](handleError(_0x3076bd,null));};exports[_0x9264('0x2a')]=function(_0x5bb7b0,_0x139064){return db[_0x9264('0x2f')]['find']({'where':{'id':_0x5bb7b0[_0x9264('0x49')]['id']}})[_0x9264('0x29')](handleEntityNotFound(_0x139064,null))['then'](removeEntity(_0x139064,null))[_0x9264('0x47')](handleError(_0x139064,null));};
\ No newline at end of file
+var _0x9c86=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','Template','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','fast-json-patch','request-promise'];(function(_0x26013b,_0x4b6f7c){var _0x5a6e74=function(_0x13214f){while(--_0x13214f){_0x26013b['push'](_0x26013b['shift']());}};_0x5a6e74(++_0x4b6f7c);}(_0x9c86,0x9f));var _0x69c8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9c86[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x69c8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x69c8('0x1'));var rp=require(_0x69c8('0x2'));var moment=require(_0x69c8('0x3'));var BPromise=require(_0x69c8('0x4'));var Mustache=require(_0x69c8('0x5'));var util=require(_0x69c8('0x6'));var path=require(_0x69c8('0x7'));var sox=require(_0x69c8('0x8'));var csv=require(_0x69c8('0x9'));var ejs=require(_0x69c8('0xa'));var fs=require('fs');var fs_extra=require(_0x69c8('0xb'));var _=require(_0x69c8('0xc'));var squel=require(_0x69c8('0xd'));var crypto=require(_0x69c8('0xe'));var jsforce=require(_0x69c8('0xf'));var deskjs=require(_0x69c8('0x10'));var toCsv=require(_0x69c8('0x9'));var querystring=require(_0x69c8('0x11'));var Papa=require(_0x69c8('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x69c8('0x13'));var as=require(_0x69c8('0x14'));var hardwareService=require(_0x69c8('0x15'));var logger=require(_0x69c8('0x16'))('api');var utils=require(_0x69c8('0x17'));var config=require(_0x69c8('0x18'));var licenseUtil=require(_0x69c8('0x19'));var db=require(_0x69c8('0x1a'))['db'];function respondWithStatusCode(_0x47b1f9,_0x3da40a){_0x3da40a=_0x3da40a||0xcc;return function(_0x4179fb){if(_0x4179fb){return _0x47b1f9[_0x69c8('0x1b')](_0x3da40a);}return _0x47b1f9[_0x69c8('0x1c')](_0x3da40a)[_0x69c8('0x1d')]();};}function respondWithResult(_0x4d1b4e,_0x160c4d){_0x160c4d=_0x160c4d||0xc8;return function(_0x3ebbba){if(_0x3ebbba){return _0x4d1b4e['status'](_0x160c4d)[_0x69c8('0x1e')](_0x3ebbba);}};}function respondWithFilteredResult(_0x2d14a6,_0x3bb80b){return function(_0x5e7861){if(_0x5e7861){var _0x1d89b3=typeof _0x3bb80b['offset']===_0x69c8('0x1f')&&typeof _0x3bb80b[_0x69c8('0x20')]===_0x69c8('0x1f');var _0x385eca=_0x5e7861['count'];var _0x1c5b9d=_0x1d89b3?0x0:_0x3bb80b[_0x69c8('0x21')];var _0x27cad0=_0x1d89b3?_0x5e7861[_0x69c8('0x22')]:_0x3bb80b['offset']+_0x3bb80b[_0x69c8('0x20')];var _0xd365b8;if(_0x27cad0>=_0x385eca){_0x27cad0=_0x385eca;_0xd365b8=0xc8;}else{_0xd365b8=0xce;}_0x2d14a6[_0x69c8('0x1c')](_0xd365b8);return _0x2d14a6['set']('Content-Range',_0x1c5b9d+'-'+_0x27cad0+'/'+_0x385eca)[_0x69c8('0x1e')](_0x5e7861);}return null;};}function patchUpdates(_0x43d64c){return function(_0x3fee18){try{jsonpatch['apply'](_0x3fee18,_0x43d64c,!![]);}catch(_0x320c25){return BPromise['reject'](_0x320c25);}return _0x3fee18[_0x69c8('0x23')]();};}function saveUpdates(_0x105fc3,_0x365c91){return function(_0x458ec7){if(_0x458ec7){return _0x458ec7[_0x69c8('0x24')](_0x105fc3)['then'](function(_0x49e60e){return _0x49e60e;});}return null;};}function removeEntity(_0x377448,_0xd32da8){return function(_0xfb843e){if(_0xfb843e){return _0xfb843e['destroy']()[_0x69c8('0x25')](function(){var _0x12e8ab=_0xfb843e[_0x69c8('0x26')]({'plain':!![]});var _0xb9f67b='Templates';return db[_0x69c8('0x27')][_0x69c8('0x28')]({'where':{'type':_0xb9f67b,'resourceId':_0x12e8ab['id']}})[_0x69c8('0x25')](function(){return _0xfb843e;});})['then'](function(){_0x377448[_0x69c8('0x1c')](0xcc)[_0x69c8('0x1d')]();});}};}function handleEntityNotFound(_0x3416c0,_0x1016e6){return function(_0x36e607){if(!_0x36e607){_0x3416c0[_0x69c8('0x1b')](0x194);}return _0x36e607;};}function handleError(_0x8e7a98,_0x5aa017){_0x5aa017=_0x5aa017||0x1f4;return function(_0x1550e8){logger[_0x69c8('0x29')](_0x1550e8['stack']);if(_0x1550e8[_0x69c8('0x2a')]){delete _0x1550e8[_0x69c8('0x2a')];}_0x8e7a98[_0x69c8('0x1c')](_0x5aa017)[_0x69c8('0x2b')](_0x1550e8);};}exports[_0x69c8('0x2c')]=function(_0x491455,_0x590e8d){var _0x15dda6={},_0x3fef3e={},_0x5a7f64={'count':0x0,'rows':[]};var _0x4cd478=_[_0x69c8('0x2d')](db['Template'][_0x69c8('0x2e')],function(_0x3495b9){return{'name':_0x3495b9[_0x69c8('0x2f')],'type':_0x3495b9[_0x69c8('0x30')][_0x69c8('0x31')]};});_0x3fef3e[_0x69c8('0x32')]=_[_0x69c8('0x2d')](_0x4cd478,_0x69c8('0x2a'));_0x3fef3e['query']=_[_0x69c8('0x33')](_0x491455['query']);_0x3fef3e[_0x69c8('0x34')]=_[_0x69c8('0x35')](_0x3fef3e[_0x69c8('0x32')],_0x3fef3e['query']);_0x15dda6[_0x69c8('0x36')]=_[_0x69c8('0x35')](_0x3fef3e[_0x69c8('0x32')],qs[_0x69c8('0x37')](_0x491455[_0x69c8('0x38')][_0x69c8('0x37')]));_0x15dda6[_0x69c8('0x36')]=_0x15dda6['attributes'][_0x69c8('0x39')]?_0x15dda6[_0x69c8('0x36')]:_0x3fef3e[_0x69c8('0x32')];if(!_0x491455[_0x69c8('0x38')][_0x69c8('0x3a')](_0x69c8('0x3b'))){_0x15dda6[_0x69c8('0x20')]=qs[_0x69c8('0x20')](_0x491455[_0x69c8('0x38')][_0x69c8('0x20')]);_0x15dda6[_0x69c8('0x21')]=qs[_0x69c8('0x21')](_0x491455[_0x69c8('0x38')][_0x69c8('0x21')]);}_0x15dda6[_0x69c8('0x3c')]=qs[_0x69c8('0x3d')](_0x491455[_0x69c8('0x38')][_0x69c8('0x3d')]);_0x15dda6[_0x69c8('0x3e')]=qs[_0x69c8('0x34')](_[_0x69c8('0x3f')](_0x491455[_0x69c8('0x38')],_0x3fef3e['filters']),_0x4cd478);if(_0x491455['query'][_0x69c8('0x40')]){_0x15dda6[_0x69c8('0x3e')]=_[_0x69c8('0x41')](_0x15dda6[_0x69c8('0x3e')],{'$or':_['map'](_0x4cd478,function(_0x499d05){if(_0x499d05[_0x69c8('0x30')]!=='VIRTUAL'){var _0x45ec8d={};_0x45ec8d[_0x499d05[_0x69c8('0x2a')]]={'$like':'%'+_0x491455[_0x69c8('0x38')]['filter']+'%'};return _0x45ec8d;}})});}_0x15dda6=_[_0x69c8('0x41')]({},_0x15dda6,_0x491455[_0x69c8('0x42')]);var _0x4aaa22={'where':_0x15dda6[_0x69c8('0x3e')]};return db['Template'][_0x69c8('0x22')](_0x4aaa22)[_0x69c8('0x25')](function(_0x1df849){_0x5a7f64[_0x69c8('0x22')]=_0x1df849;if(_0x491455[_0x69c8('0x38')][_0x69c8('0x43')]){_0x15dda6[_0x69c8('0x44')]=[{'all':!![]}];}return db[_0x69c8('0x45')]['findAll'](_0x15dda6);})['then'](function(_0xb259cf){_0x5a7f64[_0x69c8('0x46')]=_0xb259cf;return _0x5a7f64;})[_0x69c8('0x25')](respondWithFilteredResult(_0x590e8d,_0x15dda6))[_0x69c8('0x47')](handleError(_0x590e8d,null));};exports['show']=function(_0x2d9cd5,_0x2c51c8){var _0x5e7674={'raw':!![],'where':{'id':_0x2d9cd5['params']['id']}},_0x238286={};_0x238286[_0x69c8('0x32')]=_[_0x69c8('0x33')](db['Template'][_0x69c8('0x2e')]);_0x238286[_0x69c8('0x38')]=_[_0x69c8('0x33')](_0x2d9cd5[_0x69c8('0x38')]);_0x238286['filters']=_[_0x69c8('0x35')](_0x238286[_0x69c8('0x32')],_0x238286[_0x69c8('0x38')]);_0x5e7674[_0x69c8('0x36')]=_['intersection'](_0x238286['model'],qs[_0x69c8('0x37')](_0x2d9cd5[_0x69c8('0x38')]['fields']));_0x5e7674[_0x69c8('0x36')]=_0x5e7674[_0x69c8('0x36')]['length']?_0x5e7674[_0x69c8('0x36')]:_0x238286[_0x69c8('0x32')];if(_0x2d9cd5['query'][_0x69c8('0x43')]){_0x5e7674['include']=[{'all':!![]}];}_0x5e7674=_[_0x69c8('0x41')]({},_0x5e7674,_0x2d9cd5[_0x69c8('0x42')]);return db['Template'][_0x69c8('0x48')](_0x5e7674)[_0x69c8('0x25')](handleEntityNotFound(_0x2c51c8,null))[_0x69c8('0x25')](respondWithResult(_0x2c51c8,null))['catch'](handleError(_0x2c51c8,null));};exports[_0x69c8('0x49')]=function(_0x2bf855,_0x33dfcf){return db[_0x69c8('0x45')]['create'](_0x2bf855[_0x69c8('0x4a')],{})[_0x69c8('0x25')](function(_0x2e7311){var _0x18a59b=_0x2bf855['user'][_0x69c8('0x26')]({'plain':!![]});if(!_0x18a59b)throw new Error(_0x69c8('0x4b'));if(_0x18a59b[_0x69c8('0x4c')]===_0x69c8('0x4d')){var _0x4f774a=_0x2e7311['get']({'plain':!![]});var _0x1368d2='Templates';return db['UserProfileSection'][_0x69c8('0x48')]({'where':{'name':_0x1368d2,'userProfileId':_0x18a59b[_0x69c8('0x4e')]},'raw':!![]})['then'](function(_0x3137a5){if(_0x3137a5&&_0x3137a5['autoAssociation']===0x0){return db[_0x69c8('0x27')][_0x69c8('0x49')]({'name':_0x4f774a[_0x69c8('0x2a')],'resourceId':_0x4f774a['id'],'type':_0x3137a5[_0x69c8('0x2a')],'sectionId':_0x3137a5['id']},{})[_0x69c8('0x25')](function(){return _0x2e7311;});}else{return _0x2e7311;}})[_0x69c8('0x47')](function(_0x3d6f7e){logger['error'](_0x69c8('0x4f'),_0x3d6f7e);throw _0x3d6f7e;});}return _0x2e7311;})['then'](respondWithResult(_0x33dfcf,0xc9))[_0x69c8('0x47')](handleError(_0x33dfcf,null));};exports[_0x69c8('0x24')]=function(_0x34f4d7,_0x2cbb84){if(_0x34f4d7[_0x69c8('0x4a')]['id']){delete _0x34f4d7[_0x69c8('0x4a')]['id'];}return db[_0x69c8('0x45')][_0x69c8('0x48')]({'where':{'id':_0x34f4d7[_0x69c8('0x50')]['id']}})[_0x69c8('0x25')](handleEntityNotFound(_0x2cbb84,null))[_0x69c8('0x25')](saveUpdates(_0x34f4d7[_0x69c8('0x4a')],null))[_0x69c8('0x25')](respondWithResult(_0x2cbb84,null))[_0x69c8('0x47')](handleError(_0x2cbb84,null));};exports['destroy']=function(_0x5aec4e,_0x1cfdd2){return db[_0x69c8('0x45')][_0x69c8('0x48')]({'where':{'id':_0x5aec4e['params']['id']}})[_0x69c8('0x25')](handleEntityNotFound(_0x1cfdd2,null))[_0x69c8('0x25')](removeEntity(_0x1cfdd2,null))[_0x69c8('0x47')](handleError(_0x1cfdd2,null));};
\ No newline at end of file
index 17b0bfc..20b8526 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd10b=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./template.attributes','exports','define','Template','tools_templates','lodash'];(function(_0x3e7f61,_0x16c36c){var _0x4949aa=function(_0x34f6a8){while(--_0x34f6a8){_0x3e7f61['push'](_0x3e7f61['shift']());}};_0x4949aa(++_0x16c36c);}(_0xd10b,0x173));var _0xbd10=function(_0x4875d4,_0x1c4068){_0x4875d4=_0x4875d4-0x0;var _0x50618d=_0xd10b[_0x4875d4];return _0x50618d;};'use strict';var _=require(_0xbd10('0x0'));var util=require('util');var logger=require(_0xbd10('0x1'))('api');var moment=require(_0xbd10('0x2'));var BPromise=require(_0xbd10('0x3'));var rp=require(_0xbd10('0x4'));var fs=require('fs');var path=require(_0xbd10('0x5'));var rimraf=require(_0xbd10('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd10('0x7'));module[_0xbd10('0x8')]=function(_0x13a36f,_0x37fbce){return _0x13a36f[_0xbd10('0x9')](_0xbd10('0xa'),attributes,{'tableName':_0xbd10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd1e2=['tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template'];(function(_0x13247b,_0x2ff535){var _0x1a1816=function(_0x79c98c){while(--_0x79c98c){_0x13247b['push'](_0x13247b['shift']());}};_0x1a1816(++_0x2ff535);}(_0xd1e2,0x11e));var _0x2d1e=function(_0x36547c,_0x49f530){_0x36547c=_0x36547c-0x0;var _0x409167=_0xd1e2[_0x36547c];return _0x409167;};'use strict';var _=require(_0x2d1e('0x0'));var util=require(_0x2d1e('0x1'));var logger=require(_0x2d1e('0x2'))(_0x2d1e('0x3'));var moment=require(_0x2d1e('0x4'));var BPromise=require(_0x2d1e('0x5'));var rp=require(_0x2d1e('0x6'));var fs=require('fs');var path=require(_0x2d1e('0x7'));var rimraf=require(_0x2d1e('0x8'));var config=require(_0x2d1e('0x9'));var attributes=require(_0x2d1e('0xa'));module[_0x2d1e('0xb')]=function(_0x356199,_0x215a61){return _0x356199[_0x2d1e('0xc')](_0x2d1e('0xd'),attributes,{'tableName':_0x2d1e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6034673..fccca7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8db=['../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetTemplate','Template','options','raw','where','attributes','map','include','model','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4a4d8e,_0x22a7a9){var _0x1a5cb4=function(_0xdcf2eb){while(--_0xdcf2eb){_0x4a4d8e['push'](_0x4a4d8e['shift']());}};_0x1a5cb4(++_0x22a7a9);}(_0xf8db,0x106));var _0xbf8d=function(_0x75ad68,_0xc75b2a){_0x75ad68=_0x75ad68-0x0;var _0x469c7d=_0xf8db[_0x75ad68];return _0x469c7d;};'use strict';var _=require(_0xbf8d('0x0'));var util=require(_0xbf8d('0x1'));var moment=require('moment');var BPromise=require(_0xbf8d('0x2'));var rs=require(_0xbf8d('0x3'));var fs=require('fs');var Redis=require(_0xbf8d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf8d('0x5'));var logger=require(_0xbf8d('0x6'))(_0xbf8d('0x7'));var config=require(_0xbf8d('0x8'));var jayson=require(_0xbf8d('0x9'));var client=jayson[_0xbf8d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe2b549,_0x337d4d,_0x3d2494){return new BPromise(function(_0x33685a,_0x1dc0d9){return client[_0xbf8d('0xb')](_0xe2b549,_0x3d2494)[_0xbf8d('0xc')](function(_0x2ee046){logger[_0xbf8d('0xd')](_0xbf8d('0xe'),_0x337d4d,_0xbf8d('0xf'));logger[_0xbf8d('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x337d4d,_0xbf8d('0xf'),JSON[_0xbf8d('0x11')](_0x2ee046));if(_0x2ee046[_0xbf8d('0x12')]){if(_0x2ee046[_0xbf8d('0x12')]['code']===0x1f4){logger['error'](_0xbf8d('0xe'),_0x337d4d,_0x2ee046[_0xbf8d('0x12')][_0xbf8d('0x13')]);return _0x1dc0d9(_0x2ee046[_0xbf8d('0x12')]['message']);}logger[_0xbf8d('0x12')]('Template,\x20%s,\x20%s',_0x337d4d,_0x2ee046[_0xbf8d('0x12')]['message']);return _0x33685a(_0x2ee046[_0xbf8d('0x12')]['message']);}else{logger[_0xbf8d('0xd')](_0xbf8d('0xe'),_0x337d4d,_0xbf8d('0xf'));_0x33685a(_0x2ee046['result']['message']);}})['catch'](function(_0x77f7a9){logger['error'](_0xbf8d('0xe'),_0x337d4d,_0x77f7a9);_0x1dc0d9(_0x77f7a9);});});}exports[_0xbf8d('0x14')]=function(_0x247a17){var _0x5ee255=this;return new Promise(function(_0x13704a,_0x2db052){return db[_0xbf8d('0x15')]['findAll']({'raw':_0x247a17[_0xbf8d('0x16')]?_0x247a17[_0xbf8d('0x16')][_0xbf8d('0x17')]===undefined?!![]:![]:!![],'where':_0x247a17[_0xbf8d('0x16')]?_0x247a17[_0xbf8d('0x16')][_0xbf8d('0x18')]||null:null,'attributes':_0x247a17[_0xbf8d('0x16')]?_0x247a17['options'][_0xbf8d('0x19')]||null:null,'limit':_0x247a17[_0xbf8d('0x16')]?_0x247a17[_0xbf8d('0x16')]['limit']||null:null,'include':_0x247a17[_0xbf8d('0x16')]?_0x247a17[_0xbf8d('0x16')]['include']?_[_0xbf8d('0x1a')](_0x247a17['options']['include'],function(_0x374d45){return{'model':db[_0x374d45['model']],'as':_0x374d45['as'],'attributes':_0x374d45[_0xbf8d('0x19')],'include':_0x374d45[_0xbf8d('0x1b')]?_[_0xbf8d('0x1a')](_0x374d45[_0xbf8d('0x1b')],function(_0x4d0cb8){return{'model':db[_0x4d0cb8['model']],'as':_0x4d0cb8['as'],'attributes':_0x4d0cb8['attributes'],'include':_0x4d0cb8[_0xbf8d('0x1b')]?_[_0xbf8d('0x1a')](_0x4d0cb8[_0xbf8d('0x1b')],function(_0xcf4def){return{'model':db[_0xcf4def[_0xbf8d('0x1c')]],'as':_0xcf4def['as'],'attributes':_0xcf4def[_0xbf8d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbf8d('0xc')](function(_0x3e0ccb){logger[_0xbf8d('0xd')]('GetTemplate',_0x247a17);logger[_0xbf8d('0x10')]('GetTemplate',_0x247a17,JSON['stringify'](_0x3e0ccb));_0x13704a(_0x3e0ccb);})[_0xbf8d('0x1d')](function(_0x390e40){logger[_0xbf8d('0x12')](_0xbf8d('0x14'),_0x390e40[_0xbf8d('0x13')],_0x247a17);_0x2db052(_0x5ee255[_0xbf8d('0x12')](0x1f4,_0x390e40[_0xbf8d('0x13')]));});});};
\ No newline at end of file
+var _0x50dd=['request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Template','findAll','options','raw','attributes','limit','include','map','model','GetTemplate','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x49c6cc,_0x308bdb){var _0x22e239=function(_0x48507d){while(--_0x48507d){_0x49c6cc['push'](_0x49c6cc['shift']());}};_0x22e239(++_0x308bdb);}(_0x50dd,0xd7));var _0xd50d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x50dd[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xd50d('0x0'));var moment=require('moment');var BPromise=require(_0xd50d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd50d('0x2'));var db=require(_0xd50d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd50d('0x4'))('rpc');var config=require(_0xd50d('0x5'));var jayson=require(_0xd50d('0x6'));var client=jayson[_0xd50d('0x7')][_0xd50d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3daca2,_0x4f7c25,_0x2d38ed){return new BPromise(function(_0x2eb55f,_0x92a5b9){return client[_0xd50d('0x9')](_0x3daca2,_0x2d38ed)[_0xd50d('0xa')](function(_0x20aa1b){logger[_0xd50d('0xb')](_0xd50d('0xc'),_0x4f7c25,_0xd50d('0xd'));logger[_0xd50d('0xe')](_0xd50d('0xf'),_0x4f7c25,_0xd50d('0xd'),JSON[_0xd50d('0x10')](_0x20aa1b));if(_0x20aa1b[_0xd50d('0x11')]){if(_0x20aa1b['error'][_0xd50d('0x12')]===0x1f4){logger[_0xd50d('0x11')](_0xd50d('0xc'),_0x4f7c25,_0x20aa1b[_0xd50d('0x11')][_0xd50d('0x13')]);return _0x92a5b9(_0x20aa1b['error'][_0xd50d('0x13')]);}logger['error']('Template,\x20%s,\x20%s',_0x4f7c25,_0x20aa1b['error'][_0xd50d('0x13')]);return _0x2eb55f(_0x20aa1b['error'][_0xd50d('0x13')]);}else{logger['info'](_0xd50d('0xc'),_0x4f7c25,_0xd50d('0xd'));_0x2eb55f(_0x20aa1b[_0xd50d('0x14')]['message']);}})['catch'](function(_0x20cdae){logger['error'](_0xd50d('0xc'),_0x4f7c25,_0x20cdae);_0x92a5b9(_0x20cdae);});});}exports['GetTemplate']=function(_0xbea4d3){var _0x37757e=this;return new Promise(function(_0x2118f0,_0x100681){return db[_0xd50d('0x15')][_0xd50d('0x16')]({'raw':_0xbea4d3['options']?_0xbea4d3[_0xd50d('0x17')][_0xd50d('0x18')]===undefined?!![]:![]:!![],'where':_0xbea4d3[_0xd50d('0x17')]?_0xbea4d3['options']['where']||null:null,'attributes':_0xbea4d3[_0xd50d('0x17')]?_0xbea4d3[_0xd50d('0x17')][_0xd50d('0x19')]||null:null,'limit':_0xbea4d3[_0xd50d('0x17')]?_0xbea4d3['options'][_0xd50d('0x1a')]||null:null,'include':_0xbea4d3['options']?_0xbea4d3[_0xd50d('0x17')][_0xd50d('0x1b')]?_[_0xd50d('0x1c')](_0xbea4d3[_0xd50d('0x17')][_0xd50d('0x1b')],function(_0x5131c9){return{'model':db[_0x5131c9[_0xd50d('0x1d')]],'as':_0x5131c9['as'],'attributes':_0x5131c9[_0xd50d('0x19')],'include':_0x5131c9[_0xd50d('0x1b')]?_[_0xd50d('0x1c')](_0x5131c9['include'],function(_0x16211d){return{'model':db[_0x16211d['model']],'as':_0x16211d['as'],'attributes':_0x16211d[_0xd50d('0x19')],'include':_0x16211d[_0xd50d('0x1b')]?_[_0xd50d('0x1c')](_0x16211d[_0xd50d('0x1b')],function(_0x25f691){return{'model':db[_0x25f691[_0xd50d('0x1d')]],'as':_0x25f691['as'],'attributes':_0x25f691[_0xd50d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd50d('0xa')](function(_0x227348){logger[_0xd50d('0xb')](_0xd50d('0x1e'),_0xbea4d3);logger[_0xd50d('0xe')](_0xd50d('0x1e'),_0xbea4d3,JSON['stringify'](_0x227348));_0x2118f0(_0x227348);})[_0xd50d('0x1f')](function(_0x29347a){logger[_0xd50d('0x11')]('GetTemplate',_0x29347a[_0xd50d('0x13')],_0xbea4d3);_0x100681(_0x37757e[_0xd50d('0x11')](0x1f4,_0x29347a['message']));});});};
\ No newline at end of file
index 016962a..cb4a7e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf249=['getAllConditions','/:id/any_conditions','getAnyConditions','getActions','create','post','addAllCondition','addAnyCondition','/:id/actions','addAction','put','delete','/:id','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id/all_conditions'];(function(_0x167224,_0xb45514){var _0x335750=function(_0x35dcd){while(--_0x35dcd){_0x167224['push'](_0x167224['shift']());}};_0x335750(++_0xb45514);}(_0xf249,0x8c));var _0x9f24=function(_0x3072e8,_0x2e24b8){_0x3072e8=_0x3072e8-0x0;var _0x5bb24f=_0xf249[_0x3072e8];return _0x5bb24f;};'use strict';var multer=require(_0x9f24('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9f24('0x1'));var express=require(_0x9f24('0x2'));var router=express['Router']();var fs_extra=require(_0x9f24('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9f24('0x4'));var config=require(_0x9f24('0x5'));var controller=require(_0x9f24('0x6'));router[_0x9f24('0x7')]('/',auth[_0x9f24('0x8')](),controller['index']);router[_0x9f24('0x7')]('/:id',auth[_0x9f24('0x8')](),controller['show']);router[_0x9f24('0x7')](_0x9f24('0x9'),auth['isAuthenticated'](),controller[_0x9f24('0xa')]);router['get'](_0x9f24('0xb'),auth[_0x9f24('0x8')](),controller[_0x9f24('0xc')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0x9f24('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9f24('0xe')]);router[_0x9f24('0xf')](_0x9f24('0x9'),auth[_0x9f24('0x8')](),controller[_0x9f24('0x10')]);router[_0x9f24('0xf')](_0x9f24('0xb'),auth[_0x9f24('0x8')](),controller[_0x9f24('0x11')]);router['post'](_0x9f24('0x12'),auth[_0x9f24('0x8')](),controller[_0x9f24('0x13')]);router[_0x9f24('0x14')]('/:id',auth[_0x9f24('0x8')](),controller['update']);router[_0x9f24('0x15')](_0x9f24('0x16'),auth[_0x9f24('0x8')](),controller[_0x9f24('0x17')]);module[_0x9f24('0x18')]=router;
\ No newline at end of file
+var _0x8d37=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAnyCondition','addAction'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0x8d37,0x1d5));var _0x78d3=function(_0x47ffb7,_0x12bef7){_0x47ffb7=_0x47ffb7-0x0;var _0x302154=_0x8d37[_0x47ffb7];return _0x302154;};'use strict';var multer=require(_0x78d3('0x0'));var util=require(_0x78d3('0x1'));var path=require(_0x78d3('0x2'));var timeout=require(_0x78d3('0x3'));var express=require(_0x78d3('0x4'));var router=express['Router']();var fs_extra=require(_0x78d3('0x5'));var auth=require(_0x78d3('0x6'));var interaction=require(_0x78d3('0x7'));var config=require(_0x78d3('0x8'));var controller=require(_0x78d3('0x9'));router[_0x78d3('0xa')]('/',auth[_0x78d3('0xb')](),controller[_0x78d3('0xc')]);router['get'](_0x78d3('0xd'),auth[_0x78d3('0xb')](),controller[_0x78d3('0xe')]);router[_0x78d3('0xa')](_0x78d3('0xf'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x10')]);router[_0x78d3('0xa')](_0x78d3('0x11'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x12')]);router[_0x78d3('0xa')](_0x78d3('0x13'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x14')]);router[_0x78d3('0x15')]('/',auth[_0x78d3('0xb')](),controller['create']);router['post'](_0x78d3('0xf'),auth[_0x78d3('0xb')](),controller['addAllCondition']);router[_0x78d3('0x15')]('/:id/any_conditions',auth[_0x78d3('0xb')](),controller[_0x78d3('0x16')]);router[_0x78d3('0x15')](_0x78d3('0x13'),auth[_0x78d3('0xb')](),controller[_0x78d3('0x17')]);router[_0x78d3('0x18')](_0x78d3('0xd'),auth['isAuthenticated'](),controller[_0x78d3('0x19')]);router[_0x78d3('0x1a')]('/:id',auth[_0x78d3('0xb')](),controller[_0x78d3('0x1b')]);module[_0x78d3('0x1c')]=router;
\ No newline at end of file
index 3c3058a..bf709fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e07=['exports','STRING','BOOLEAN','sequelize'];(function(_0xf44fce,_0x168480){var _0x2c6c2e=function(_0x52a76e){while(--_0x52a76e){_0xf44fce['push'](_0xf44fce['shift']());}};_0x2c6c2e(++_0x168480);}(_0x9e07,0x1cf));var _0x79e0=function(_0x5066df,_0xd4a3b4){_0x5066df=_0x5066df-0x0;var _0x390c2c=_0x9e07[_0x5066df];return _0x390c2c;};'use strict';var Sequelize=require(_0x79e0('0x0'));module[_0x79e0('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x79e0('0x2')]},'description':{'type':Sequelize[_0x79e0('0x2')]},'status':{'type':Sequelize[_0x79e0('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x55fd=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4cad81,_0x57ddcd){var _0x4edd5e=function(_0x3a5678){while(--_0x3a5678){_0x4cad81['push'](_0x4cad81['shift']());}};_0x4edd5e(++_0x57ddcd);}(_0x55fd,0xbf));var _0xd55f=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x55fd[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0xd55f('0x0'));module[_0xd55f('0x1')]={'name':{'type':Sequelize[_0xd55f('0x2')]},'channel':{'type':Sequelize[_0xd55f('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xd55f('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 97fd51d..df94c01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a2e=['merge','where','Trigger','includeAll','include','rows','show','params','options','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','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','order','hasOwnProperty','getAnyConditions','nolimit','addAction','getActions','Action','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Triggers','UserProfileResource','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter'];(function(_0x411025,_0x5475dc){var _0x4d001d=function(_0x187c5a){while(--_0x187c5a){_0x411025['push'](_0x411025['shift']());}};_0x4d001d(++_0x5475dc);}(_0x4a2e,0xdd));var _0xe4a2=function(_0x4a4d88,_0x2be95a){_0x4a4d88=_0x4a4d88-0x0;var _0x479329=_0x4a2e[_0x4a4d88];return _0x479329;};'use strict';var emlformat=require(_0xe4a2('0x0'));var rimraf=require(_0xe4a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4a2('0x2'));var rp=require(_0xe4a2('0x3'));var moment=require(_0xe4a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe4a2('0x5'));var util=require(_0xe4a2('0x6'));var path=require(_0xe4a2('0x7'));var sox=require('sox');var csv=require(_0xe4a2('0x8'));var ejs=require(_0xe4a2('0x9'));var fs=require('fs');var fs_extra=require(_0xe4a2('0xa'));var _=require(_0xe4a2('0xb'));var squel=require('squel');var crypto=require(_0xe4a2('0xc'));var jsforce=require(_0xe4a2('0xd'));var deskjs=require(_0xe4a2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe4a2('0xf'));var Papa=require(_0xe4a2('0x10'));var Redis=require(_0xe4a2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe4a2('0x12'));var as=require(_0xe4a2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe4a2('0x14'));var utils=require(_0xe4a2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe4a2('0x16'));var db=require(_0xe4a2('0x17'))['db'];function respondWithStatusCode(_0x48e90b,_0x43ae8f){_0x43ae8f=_0x43ae8f||0xcc;return function(_0x42eb31){if(_0x42eb31){return _0x48e90b[_0xe4a2('0x18')](_0x43ae8f);}return _0x48e90b[_0xe4a2('0x19')](_0x43ae8f)[_0xe4a2('0x1a')]();};}function respondWithResult(_0x377b0d,_0x1ed57e){_0x1ed57e=_0x1ed57e||0xc8;return function(_0x17dcf0){if(_0x17dcf0){return _0x377b0d[_0xe4a2('0x19')](_0x1ed57e)[_0xe4a2('0x1b')](_0x17dcf0);}};}function respondWithFilteredResult(_0x2aab72,_0x254600){return function(_0x2475ea){if(_0x2475ea){var _0x1a5c12=typeof _0x254600[_0xe4a2('0x1c')]===_0xe4a2('0x1d')&&typeof _0x254600[_0xe4a2('0x1e')]===_0xe4a2('0x1d');var _0x254769=_0x2475ea['count'];var _0x3457b5=_0x1a5c12?0x0:_0x254600[_0xe4a2('0x1c')];var _0x50855d=_0x1a5c12?_0x2475ea[_0xe4a2('0x1f')]:_0x254600[_0xe4a2('0x1c')]+_0x254600['limit'];var _0x58d464;if(_0x50855d>=_0x254769){_0x50855d=_0x254769;_0x58d464=0xc8;}else{_0x58d464=0xce;}_0x2aab72[_0xe4a2('0x19')](_0x58d464);return _0x2aab72[_0xe4a2('0x20')](_0xe4a2('0x21'),_0x3457b5+'-'+_0x50855d+'/'+_0x254769)['json'](_0x2475ea);}return null;};}function patchUpdates(_0x218ebd){return function(_0x1c1e37){try{jsonpatch['apply'](_0x1c1e37,_0x218ebd,!![]);}catch(_0x23c0c6){return BPromise[_0xe4a2('0x22')](_0x23c0c6);}return _0x1c1e37['save']();};}function saveUpdates(_0x12cad6,_0x9d9eca){return function(_0x3b82f9){if(_0x3b82f9){return _0x3b82f9[_0xe4a2('0x23')](_0x12cad6)[_0xe4a2('0x24')](function(_0x110dee){return _0x110dee;});}return null;};}function removeEntity(_0x252122,_0x205fc1){return function(_0x5b57aa){if(_0x5b57aa){return _0x5b57aa[_0xe4a2('0x25')]()[_0xe4a2('0x24')](function(){var _0x6b1dae=_0x5b57aa[_0xe4a2('0x26')]({'plain':!![]});var _0x2bf271=_0xe4a2('0x27');return db[_0xe4a2('0x28')]['destroy']({'where':{'type':_0x2bf271,'resourceId':_0x6b1dae['id']}})[_0xe4a2('0x24')](function(){return _0x5b57aa;});})[_0xe4a2('0x24')](function(){_0x252122[_0xe4a2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38e213,_0x1a0798){return function(_0x125d7b){if(!_0x125d7b){_0x38e213[_0xe4a2('0x18')](0x194);}return _0x125d7b;};}function handleError(_0x1f4444,_0x5baa22){_0x5baa22=_0x5baa22||0x1f4;return function(_0x1d1b31){logger[_0xe4a2('0x29')](_0x1d1b31['stack']);if(_0x1d1b31['name']){delete _0x1d1b31['name'];}_0x1f4444['status'](_0x5baa22)[_0xe4a2('0x2a')](_0x1d1b31);};}exports[_0xe4a2('0x2b')]=function(_0x3dd8f5,_0xe85359){var _0xabb94d={},_0x4c701d={},_0x1a29d8={'count':0x0,'rows':[]};var _0x51f133=_[_0xe4a2('0x2c')](db['Trigger'][_0xe4a2('0x2d')],function(_0x9ddd0b){return{'name':_0x9ddd0b[_0xe4a2('0x2e')],'type':_0x9ddd0b[_0xe4a2('0x2f')][_0xe4a2('0x30')]};});_0x4c701d[_0xe4a2('0x31')]=_[_0xe4a2('0x2c')](_0x51f133,_0xe4a2('0x32'));_0x4c701d[_0xe4a2('0x33')]=_[_0xe4a2('0x34')](_0x3dd8f5[_0xe4a2('0x33')]);_0x4c701d[_0xe4a2('0x35')]=_[_0xe4a2('0x36')](_0x4c701d['model'],_0x4c701d[_0xe4a2('0x33')]);_0xabb94d[_0xe4a2('0x37')]=_[_0xe4a2('0x36')](_0x4c701d[_0xe4a2('0x31')],qs[_0xe4a2('0x38')](_0x3dd8f5[_0xe4a2('0x33')][_0xe4a2('0x38')]));_0xabb94d[_0xe4a2('0x37')]=_0xabb94d[_0xe4a2('0x37')][_0xe4a2('0x39')]?_0xabb94d['attributes']:_0x4c701d[_0xe4a2('0x31')];if(!_0x3dd8f5[_0xe4a2('0x33')]['hasOwnProperty']('nolimit')){_0xabb94d[_0xe4a2('0x1e')]=qs[_0xe4a2('0x1e')](_0x3dd8f5['query'][_0xe4a2('0x1e')]);_0xabb94d['offset']=qs[_0xe4a2('0x1c')](_0x3dd8f5['query']['offset']);}_0xabb94d['order']=qs[_0xe4a2('0x3a')](_0x3dd8f5[_0xe4a2('0x33')][_0xe4a2('0x3a')]);_0xabb94d['where']=qs[_0xe4a2('0x35')](_[_0xe4a2('0x3b')](_0x3dd8f5[_0xe4a2('0x33')],_0x4c701d['filters']),_0x51f133);if(_0x3dd8f5['query'][_0xe4a2('0x3c')]){_0xabb94d['where']=_[_0xe4a2('0x3d')](_0xabb94d[_0xe4a2('0x3e')],{'$or':_['map'](_0x51f133,function(_0x56dffa){if(_0x56dffa[_0xe4a2('0x2f')]!=='VIRTUAL'){var _0x1c9825={};_0x1c9825[_0x56dffa[_0xe4a2('0x32')]]={'$like':'%'+_0x3dd8f5['query'][_0xe4a2('0x3c')]+'%'};return _0x1c9825;}})});}_0xabb94d=_[_0xe4a2('0x3d')]({},_0xabb94d,_0x3dd8f5['options']);var _0x4295c6={'where':_0xabb94d[_0xe4a2('0x3e')]};return db[_0xe4a2('0x3f')]['count'](_0x4295c6)['then'](function(_0x2c0efd){_0x1a29d8[_0xe4a2('0x1f')]=_0x2c0efd;if(_0x3dd8f5[_0xe4a2('0x33')][_0xe4a2('0x40')]){_0xabb94d[_0xe4a2('0x41')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0xabb94d);})['then'](function(_0x3f3ac2){_0x1a29d8[_0xe4a2('0x42')]=_0x3f3ac2;return _0x1a29d8;})[_0xe4a2('0x24')](respondWithFilteredResult(_0xe85359,_0xabb94d))['catch'](handleError(_0xe85359,null));};exports[_0xe4a2('0x43')]=function(_0x75eca9,_0x319d4f){var _0x6e58d3={'raw':![],'where':{'id':_0x75eca9[_0xe4a2('0x44')]['id']}},_0x1856dd={};_0x1856dd['model']=_[_0xe4a2('0x34')](db[_0xe4a2('0x3f')]['rawAttributes']);_0x1856dd[_0xe4a2('0x33')]=_['keys'](_0x75eca9[_0xe4a2('0x33')]);_0x1856dd[_0xe4a2('0x35')]=_[_0xe4a2('0x36')](_0x1856dd[_0xe4a2('0x31')],_0x1856dd[_0xe4a2('0x33')]);_0x6e58d3[_0xe4a2('0x37')]=_[_0xe4a2('0x36')](_0x1856dd['model'],qs[_0xe4a2('0x38')](_0x75eca9[_0xe4a2('0x33')]['fields']));_0x6e58d3['attributes']=_0x6e58d3['attributes'][_0xe4a2('0x39')]?_0x6e58d3[_0xe4a2('0x37')]:_0x1856dd[_0xe4a2('0x31')];if(_0x75eca9[_0xe4a2('0x33')][_0xe4a2('0x40')]){_0x6e58d3[_0xe4a2('0x41')]=[{'all':!![]}];}_0x6e58d3=_[_0xe4a2('0x3d')]({},_0x6e58d3,_0x75eca9[_0xe4a2('0x45')]);return db[_0xe4a2('0x3f')][_0xe4a2('0x46')](_0x6e58d3)[_0xe4a2('0x24')](handleEntityNotFound(_0x319d4f,null))[_0xe4a2('0x24')](respondWithResult(_0x319d4f,null))[_0xe4a2('0x47')](handleError(_0x319d4f,null));};exports[_0xe4a2('0x48')]=function(_0x5378c6,_0x1c17db){return db['Trigger']['create'](_0x5378c6[_0xe4a2('0x49')],{})[_0xe4a2('0x24')](function(_0x28b6db){var _0x4d81c0=_0x5378c6[_0xe4a2('0x4a')]['get']({'plain':!![]});if(!_0x4d81c0)throw new Error(_0xe4a2('0x4b'));if(_0x4d81c0[_0xe4a2('0x4c')]===_0xe4a2('0x4a')){var _0x27a935=_0x28b6db[_0xe4a2('0x26')]({'plain':!![]});var _0x2e49f0=_0xe4a2('0x27');return db[_0xe4a2('0x4d')]['find']({'where':{'name':_0x2e49f0,'userProfileId':_0x4d81c0[_0xe4a2('0x4e')]},'raw':!![]})[_0xe4a2('0x24')](function(_0x3b3b32){if(_0x3b3b32&&_0x3b3b32[_0xe4a2('0x4f')]===0x0){return db[_0xe4a2('0x28')][_0xe4a2('0x48')]({'name':_0x27a935[_0xe4a2('0x32')],'resourceId':_0x27a935['id'],'type':_0x3b3b32['name'],'sectionId':_0x3b3b32['id']},{})[_0xe4a2('0x24')](function(){return _0x28b6db;});}else{return _0x28b6db;}})[_0xe4a2('0x47')](function(_0x25b59f){logger[_0xe4a2('0x29')](_0xe4a2('0x50'),_0x25b59f);throw _0x25b59f;});}return _0x28b6db;})[_0xe4a2('0x24')](respondWithResult(_0x1c17db,0xc9))[_0xe4a2('0x47')](handleError(_0x1c17db,null));};exports[_0xe4a2('0x23')]=function(_0x39a96a,_0x138dd0){if(_0x39a96a['body']['id']){delete _0x39a96a[_0xe4a2('0x49')]['id'];}return db['Trigger'][_0xe4a2('0x46')]({'where':{'id':_0x39a96a[_0xe4a2('0x44')]['id']}})[_0xe4a2('0x24')](handleEntityNotFound(_0x138dd0,null))['then'](saveUpdates(_0x39a96a[_0xe4a2('0x49')],null))[_0xe4a2('0x24')](respondWithResult(_0x138dd0,null))[_0xe4a2('0x47')](handleError(_0x138dd0,null));};exports['destroy']=function(_0x146d1f,_0x4cb835){return db['Trigger'][_0xe4a2('0x46')]({'where':{'id':_0x146d1f[_0xe4a2('0x44')]['id']}})[_0xe4a2('0x24')](handleEntityNotFound(_0x4cb835,null))[_0xe4a2('0x24')](removeEntity(_0x4cb835,null))[_0xe4a2('0x47')](handleError(_0x4cb835,null));};exports[_0xe4a2('0x51')]=function(_0x204842,_0x3d21d6,_0x3565c1){if(_0x204842[_0xe4a2('0x49')]['id']){delete _0x204842[_0xe4a2('0x49')]['id'];}return db['Trigger'][_0xe4a2('0x46')]({'where':{'id':_0x204842['params']['id']}})['then'](handleEntityNotFound(_0x3d21d6,null))[_0xe4a2('0x24')](function(_0x5600e5){if(_0x5600e5){_0x204842['body'][_0xe4a2('0x52')]=_0x5600e5['id'];return db[_0xe4a2('0x53')][_0xe4a2('0x48')](_0x204842['body']);}})[_0xe4a2('0x24')](respondWithResult(_0x3d21d6,null))[_0xe4a2('0x47')](handleError(_0x3d21d6,null));};exports[_0xe4a2('0x54')]=function(_0x434d81,_0xa4d536,_0xc1562c){if(_0x434d81['body']['id']){delete _0x434d81['body']['id'];}return db[_0xe4a2('0x3f')][_0xe4a2('0x46')]({'where':{'id':_0x434d81[_0xe4a2('0x44')]['id']}})[_0xe4a2('0x24')](handleEntityNotFound(_0xa4d536,null))[_0xe4a2('0x24')](function(_0x445a95){if(_0x445a95){_0x434d81['body']['TriggerAnyId']=_0x445a95['id'];return db[_0xe4a2('0x53')][_0xe4a2('0x48')](_0x434d81[_0xe4a2('0x49')]);}})[_0xe4a2('0x24')](respondWithResult(_0xa4d536,null))[_0xe4a2('0x47')](handleError(_0xa4d536,null));};exports[_0xe4a2('0x55')]=function(_0x492d7c,_0x18e40a,_0x55b6f3){var _0x51b6f6={};var _0x26e83d={};var _0x346065;var _0x411e67;return db[_0xe4a2('0x3f')][_0xe4a2('0x56')]({'where':{'id':_0x492d7c['params']['id']}})[_0xe4a2('0x24')](handleEntityNotFound(_0x18e40a,null))[_0xe4a2('0x24')](function(_0x2599ad){if(_0x2599ad){_0x346065=_0x2599ad;_0x26e83d[_0xe4a2('0x31')]=_[_0xe4a2('0x34')](db[_0xe4a2('0x53')][_0xe4a2('0x2d')]);_0x26e83d[_0xe4a2('0x33')]=_['keys'](_0x492d7c[_0xe4a2('0x33')]);_0x26e83d['filters']=_[_0xe4a2('0x36')](_0x26e83d['model'],_0x26e83d[_0xe4a2('0x33')]);_0x51b6f6[_0xe4a2('0x37')]=_[_0xe4a2('0x36')](_0x26e83d[_0xe4a2('0x31')],qs[_0xe4a2('0x38')](_0x492d7c['query'][_0xe4a2('0x38')]));_0x51b6f6[_0xe4a2('0x37')]=_0x51b6f6[_0xe4a2('0x37')][_0xe4a2('0x39')]?_0x51b6f6['attributes']:_0x26e83d['model'];_0x51b6f6[_0xe4a2('0x57')]=qs[_0xe4a2('0x3a')](_0x492d7c[_0xe4a2('0x33')][_0xe4a2('0x3a')]);_0x51b6f6[_0xe4a2('0x3e')]=qs['filters'](_['pick'](_0x492d7c[_0xe4a2('0x33')],_0x26e83d[_0xe4a2('0x35')]));if(_0x492d7c[_0xe4a2('0x33')]['filter']){_0x51b6f6['where']=_[_0xe4a2('0x3d')](_0x51b6f6[_0xe4a2('0x3e')],{'$or':_[_0xe4a2('0x2c')](_0x51b6f6['attributes'],function(_0x69711b){var _0x3a9664={};_0x3a9664[_0x69711b]={'$like':'%'+_0x492d7c['query'][_0xe4a2('0x3c')]+'%'};return _0x3a9664;})});}_0x51b6f6=_[_0xe4a2('0x3d')]({},_0x51b6f6,_0x492d7c[_0xe4a2('0x45')]);return _0x346065[_0xe4a2('0x55')](_0x51b6f6);}})[_0xe4a2('0x24')](function(_0x52165b){if(_0x52165b){_0x411e67=_0x52165b[_0xe4a2('0x39')];if(!_0x492d7c[_0xe4a2('0x33')][_0xe4a2('0x58')]('nolimit')){_0x51b6f6[_0xe4a2('0x1e')]=qs[_0xe4a2('0x1e')](_0x492d7c[_0xe4a2('0x33')]['limit']);_0x51b6f6[_0xe4a2('0x1c')]=qs['offset'](_0x492d7c['query'][_0xe4a2('0x1c')]);}return _0x346065['getAllConditions'](_0x51b6f6);}})[_0xe4a2('0x24')](function(_0x2646ad){if(_0x2646ad){return _0x2646ad?{'count':_0x411e67,'rows':_0x2646ad}:null;}})['then'](respondWithResult(_0x18e40a,null))[_0xe4a2('0x47')](handleError(_0x18e40a,null));};exports[_0xe4a2('0x59')]=function(_0x58123e,_0xb656e0,_0x262cba){var _0x3ba993={};var _0x1379d0={};var _0x5619ba;var _0x307469;return db[_0xe4a2('0x3f')]['findOne']({'where':{'id':_0x58123e[_0xe4a2('0x44')]['id']}})[_0xe4a2('0x24')](handleEntityNotFound(_0xb656e0,null))[_0xe4a2('0x24')](function(_0x4867b0){if(_0x4867b0){_0x5619ba=_0x4867b0;_0x1379d0[_0xe4a2('0x31')]=_['keys'](db[_0xe4a2('0x53')]['rawAttributes']);_0x1379d0[_0xe4a2('0x33')]=_[_0xe4a2('0x34')](_0x58123e[_0xe4a2('0x33')]);_0x1379d0['filters']=_[_0xe4a2('0x36')](_0x1379d0[_0xe4a2('0x31')],_0x1379d0[_0xe4a2('0x33')]);_0x3ba993['attributes']=_[_0xe4a2('0x36')](_0x1379d0['model'],qs[_0xe4a2('0x38')](_0x58123e[_0xe4a2('0x33')][_0xe4a2('0x38')]));_0x3ba993[_0xe4a2('0x37')]=_0x3ba993[_0xe4a2('0x37')][_0xe4a2('0x39')]?_0x3ba993[_0xe4a2('0x37')]:_0x1379d0[_0xe4a2('0x31')];_0x3ba993[_0xe4a2('0x57')]=qs[_0xe4a2('0x3a')](_0x58123e[_0xe4a2('0x33')]['sort']);_0x3ba993['where']=qs['filters'](_[_0xe4a2('0x3b')](_0x58123e[_0xe4a2('0x33')],_0x1379d0[_0xe4a2('0x35')]));if(_0x58123e[_0xe4a2('0x33')][_0xe4a2('0x3c')]){_0x3ba993[_0xe4a2('0x3e')]=_[_0xe4a2('0x3d')](_0x3ba993[_0xe4a2('0x3e')],{'$or':_['map'](_0x3ba993[_0xe4a2('0x37')],function(_0x47d2b2){var _0x7a838a={};_0x7a838a[_0x47d2b2]={'$like':'%'+_0x58123e[_0xe4a2('0x33')][_0xe4a2('0x3c')]+'%'};return _0x7a838a;})});}_0x3ba993=_[_0xe4a2('0x3d')]({},_0x3ba993,_0x58123e[_0xe4a2('0x45')]);return _0x5619ba['getAnyConditions'](_0x3ba993);}})['then'](function(_0x49c857){if(_0x49c857){_0x307469=_0x49c857['length'];if(!_0x58123e['query'][_0xe4a2('0x58')](_0xe4a2('0x5a'))){_0x3ba993[_0xe4a2('0x1e')]=qs[_0xe4a2('0x1e')](_0x58123e['query'][_0xe4a2('0x1e')]);_0x3ba993[_0xe4a2('0x1c')]=qs[_0xe4a2('0x1c')](_0x58123e['query'][_0xe4a2('0x1c')]);}return _0x5619ba[_0xe4a2('0x59')](_0x3ba993);}})[_0xe4a2('0x24')](function(_0x273b5e){if(_0x273b5e){return _0x273b5e?{'count':_0x307469,'rows':_0x273b5e}:null;}})[_0xe4a2('0x24')](respondWithResult(_0xb656e0,null))['catch'](handleError(_0xb656e0,null));};exports[_0xe4a2('0x5b')]=function(_0x18db26,_0x535010,_0x57e488){if(_0x18db26[_0xe4a2('0x49')]['id']){delete _0x18db26[_0xe4a2('0x49')]['id'];}return db[_0xe4a2('0x3f')][_0xe4a2('0x46')]({'where':{'id':_0x18db26['params']['id']}})[_0xe4a2('0x24')](handleEntityNotFound(_0x535010,null))[_0xe4a2('0x24')](function(_0x4b42ce){if(_0x4b42ce){_0x18db26['body']['TriggerId']=_0x4b42ce['id'];return db['Action'][_0xe4a2('0x48')](_0x18db26[_0xe4a2('0x49')]);}})['then'](respondWithResult(_0x535010,null))[_0xe4a2('0x47')](handleError(_0x535010,null));};exports[_0xe4a2('0x5c')]=function(_0x1192ff,_0x423562,_0x4a3669){var _0x10d50b={};var _0x243d14={};var _0x1738d9;var _0x1d04c5;return db[_0xe4a2('0x3f')][_0xe4a2('0x56')]({'where':{'id':_0x1192ff['params']['id']}})[_0xe4a2('0x24')](handleEntityNotFound(_0x423562,null))[_0xe4a2('0x24')](function(_0x23314d){if(_0x23314d){_0x1738d9=_0x23314d;_0x243d14['model']=_[_0xe4a2('0x34')](db[_0xe4a2('0x5d')][_0xe4a2('0x2d')]);_0x243d14[_0xe4a2('0x33')]=_[_0xe4a2('0x34')](_0x1192ff[_0xe4a2('0x33')]);_0x243d14[_0xe4a2('0x35')]=_[_0xe4a2('0x36')](_0x243d14[_0xe4a2('0x31')],_0x243d14[_0xe4a2('0x33')]);_0x10d50b[_0xe4a2('0x37')]=_[_0xe4a2('0x36')](_0x243d14[_0xe4a2('0x31')],qs[_0xe4a2('0x38')](_0x1192ff[_0xe4a2('0x33')]['fields']));_0x10d50b[_0xe4a2('0x37')]=_0x10d50b[_0xe4a2('0x37')][_0xe4a2('0x39')]?_0x10d50b[_0xe4a2('0x37')]:_0x243d14[_0xe4a2('0x31')];_0x10d50b['order']=qs[_0xe4a2('0x3a')](_0x1192ff[_0xe4a2('0x33')][_0xe4a2('0x3a')]);_0x10d50b[_0xe4a2('0x3e')]=qs[_0xe4a2('0x35')](_[_0xe4a2('0x3b')](_0x1192ff[_0xe4a2('0x33')],_0x243d14[_0xe4a2('0x35')]));if(_0x1192ff[_0xe4a2('0x33')][_0xe4a2('0x3c')]){_0x10d50b[_0xe4a2('0x3e')]=_[_0xe4a2('0x3d')](_0x10d50b[_0xe4a2('0x3e')],{'$or':_[_0xe4a2('0x2c')](_0x10d50b[_0xe4a2('0x37')],function(_0xa0936e){var _0x39a2c3={};_0x39a2c3[_0xa0936e]={'$like':'%'+_0x1192ff[_0xe4a2('0x33')][_0xe4a2('0x3c')]+'%'};return _0x39a2c3;})});}_0x10d50b=_['merge']({},_0x10d50b,_0x1192ff[_0xe4a2('0x45')]);return _0x1738d9[_0xe4a2('0x5c')](_0x10d50b);}})[_0xe4a2('0x24')](function(_0x2ae9bd){if(_0x2ae9bd){_0x1d04c5=_0x2ae9bd[_0xe4a2('0x39')];if(!_0x1192ff[_0xe4a2('0x33')][_0xe4a2('0x58')]('nolimit')){_0x10d50b[_0xe4a2('0x1e')]=qs['limit'](_0x1192ff[_0xe4a2('0x33')][_0xe4a2('0x1e')]);_0x10d50b['offset']=qs[_0xe4a2('0x1c')](_0x1192ff[_0xe4a2('0x33')]['offset']);}return _0x1738d9['getActions'](_0x10d50b);}})[_0xe4a2('0x24')](function(_0x2c1d38){if(_0x2c1d38){return _0x2c1d38?{'count':_0x1d04c5,'rows':_0x2c1d38}:null;}})['then'](respondWithResult(_0x423562,null))[_0xe4a2('0x47')](handleError(_0x423562,null));};
\ No newline at end of file
+var _0xb533=['offset','undefined','limit','count','json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','TriggerAnyId','Condition','getAllConditions','getAnyConditions','findOne','Action','getActions','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xb533,0x9f));var _0x3b53=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xb533[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b53('0x0'));var zipdir=require(_0x3b53('0x1'));var jsonpatch=require(_0x3b53('0x2'));var rp=require(_0x3b53('0x3'));var moment=require(_0x3b53('0x4'));var BPromise=require(_0x3b53('0x5'));var Mustache=require('mustache');var util=require(_0x3b53('0x6'));var path=require(_0x3b53('0x7'));var sox=require(_0x3b53('0x8'));var csv=require(_0x3b53('0x9'));var ejs=require(_0x3b53('0xa'));var fs=require('fs');var fs_extra=require(_0x3b53('0xb'));var _=require(_0x3b53('0xc'));var squel=require(_0x3b53('0xd'));var crypto=require(_0x3b53('0xe'));var jsforce=require(_0x3b53('0xf'));var deskjs=require(_0x3b53('0x10'));var toCsv=require(_0x3b53('0x9'));var querystring=require(_0x3b53('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3b53('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3b53('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b53('0x14'))(_0x3b53('0x15'));var utils=require(_0x3b53('0x16'));var config=require(_0x3b53('0x17'));var licenseUtil=require(_0x3b53('0x18'));var db=require(_0x3b53('0x19'))['db'];function respondWithStatusCode(_0x5b06d3,_0x596850){_0x596850=_0x596850||0xcc;return function(_0x16668d){if(_0x16668d){return _0x5b06d3[_0x3b53('0x1a')](_0x596850);}return _0x5b06d3['status'](_0x596850)[_0x3b53('0x1b')]();};}function respondWithResult(_0x4fc5f7,_0x9dfbbb){_0x9dfbbb=_0x9dfbbb||0xc8;return function(_0x408f86){if(_0x408f86){return _0x4fc5f7[_0x3b53('0x1c')](_0x9dfbbb)['json'](_0x408f86);}};}function respondWithFilteredResult(_0x3b2b67,_0x1550ce){return function(_0x2e188c){if(_0x2e188c){var _0x4fcb56=typeof _0x1550ce[_0x3b53('0x1d')]===_0x3b53('0x1e')&&typeof _0x1550ce[_0x3b53('0x1f')]===_0x3b53('0x1e');var _0x3a7add=_0x2e188c[_0x3b53('0x20')];var _0x1baf93=_0x4fcb56?0x0:_0x1550ce[_0x3b53('0x1d')];var _0x23a4c9=_0x4fcb56?_0x2e188c['count']:_0x1550ce[_0x3b53('0x1d')]+_0x1550ce['limit'];var _0x11c717;if(_0x23a4c9>=_0x3a7add){_0x23a4c9=_0x3a7add;_0x11c717=0xc8;}else{_0x11c717=0xce;}_0x3b2b67[_0x3b53('0x1c')](_0x11c717);return _0x3b2b67['set']('Content-Range',_0x1baf93+'-'+_0x23a4c9+'/'+_0x3a7add)[_0x3b53('0x21')](_0x2e188c);}return null;};}function patchUpdates(_0x1918f1){return function(_0x27b7ae){try{jsonpatch[_0x3b53('0x22')](_0x27b7ae,_0x1918f1,!![]);}catch(_0x4d57dc){return BPromise[_0x3b53('0x23')](_0x4d57dc);}return _0x27b7ae['save']();};}function saveUpdates(_0x3c84ae,_0x126d94){return function(_0x2c439f){if(_0x2c439f){return _0x2c439f[_0x3b53('0x24')](_0x3c84ae)[_0x3b53('0x25')](function(_0x2989a8){return _0x2989a8;});}return null;};}function removeEntity(_0x2dd523,_0x1b8c6d){return function(_0x54e75a){if(_0x54e75a){return _0x54e75a[_0x3b53('0x26')]()[_0x3b53('0x25')](function(){var _0x444a52=_0x54e75a[_0x3b53('0x27')]({'plain':!![]});var _0x177dfb='Triggers';return db[_0x3b53('0x28')][_0x3b53('0x26')]({'where':{'type':_0x177dfb,'resourceId':_0x444a52['id']}})[_0x3b53('0x25')](function(){return _0x54e75a;});})[_0x3b53('0x25')](function(){_0x2dd523[_0x3b53('0x1c')](0xcc)[_0x3b53('0x1b')]();});}};}function handleEntityNotFound(_0x387939,_0x16d36d){return function(_0x355795){if(!_0x355795){_0x387939[_0x3b53('0x1a')](0x194);}return _0x355795;};}function handleError(_0xe494,_0x53b22c){_0x53b22c=_0x53b22c||0x1f4;return function(_0x20f689){logger[_0x3b53('0x29')](_0x20f689[_0x3b53('0x2a')]);if(_0x20f689[_0x3b53('0x2b')]){delete _0x20f689[_0x3b53('0x2b')];}_0xe494['status'](_0x53b22c)[_0x3b53('0x2c')](_0x20f689);};}exports[_0x3b53('0x2d')]=function(_0x5153c2,_0x297cd9){var _0x1d11d6={},_0xb45f60={},_0x2512cd={'count':0x0,'rows':[]};var _0xb5ba0e=_[_0x3b53('0x2e')](db[_0x3b53('0x2f')][_0x3b53('0x30')],function(_0x49a734){return{'name':_0x49a734['fieldName'],'type':_0x49a734[_0x3b53('0x31')][_0x3b53('0x32')]};});_0xb45f60['model']=_[_0x3b53('0x2e')](_0xb5ba0e,_0x3b53('0x2b'));_0xb45f60['query']=_[_0x3b53('0x33')](_0x5153c2[_0x3b53('0x34')]);_0xb45f60['filters']=_[_0x3b53('0x35')](_0xb45f60['model'],_0xb45f60[_0x3b53('0x34')]);_0x1d11d6[_0x3b53('0x36')]=_[_0x3b53('0x35')](_0xb45f60[_0x3b53('0x37')],qs['fields'](_0x5153c2[_0x3b53('0x34')][_0x3b53('0x38')]));_0x1d11d6[_0x3b53('0x36')]=_0x1d11d6['attributes'][_0x3b53('0x39')]?_0x1d11d6[_0x3b53('0x36')]:_0xb45f60[_0x3b53('0x37')];if(!_0x5153c2[_0x3b53('0x34')][_0x3b53('0x3a')](_0x3b53('0x3b'))){_0x1d11d6['limit']=qs['limit'](_0x5153c2[_0x3b53('0x34')][_0x3b53('0x1f')]);_0x1d11d6[_0x3b53('0x1d')]=qs[_0x3b53('0x1d')](_0x5153c2[_0x3b53('0x34')][_0x3b53('0x1d')]);}_0x1d11d6[_0x3b53('0x3c')]=qs[_0x3b53('0x3d')](_0x5153c2[_0x3b53('0x34')][_0x3b53('0x3d')]);_0x1d11d6[_0x3b53('0x3e')]=qs[_0x3b53('0x3f')](_[_0x3b53('0x40')](_0x5153c2[_0x3b53('0x34')],_0xb45f60[_0x3b53('0x3f')]),_0xb5ba0e);if(_0x5153c2[_0x3b53('0x34')][_0x3b53('0x41')]){_0x1d11d6[_0x3b53('0x3e')]=_[_0x3b53('0x42')](_0x1d11d6[_0x3b53('0x3e')],{'$or':_[_0x3b53('0x2e')](_0xb5ba0e,function(_0x36507b){if(_0x36507b['type']!=='VIRTUAL'){var _0x526080={};_0x526080[_0x36507b['name']]={'$like':'%'+_0x5153c2[_0x3b53('0x34')][_0x3b53('0x41')]+'%'};return _0x526080;}})});}_0x1d11d6=_[_0x3b53('0x42')]({},_0x1d11d6,_0x5153c2[_0x3b53('0x43')]);var _0x2d8e1f={'where':_0x1d11d6[_0x3b53('0x3e')]};return db[_0x3b53('0x2f')][_0x3b53('0x20')](_0x2d8e1f)[_0x3b53('0x25')](function(_0x187357){_0x2512cd[_0x3b53('0x20')]=_0x187357;if(_0x5153c2[_0x3b53('0x34')][_0x3b53('0x44')]){_0x1d11d6['include']=[{'all':!![]}];}return db[_0x3b53('0x2f')][_0x3b53('0x45')](_0x1d11d6);})[_0x3b53('0x25')](function(_0x38bc95){_0x2512cd[_0x3b53('0x46')]=_0x38bc95;return _0x2512cd;})[_0x3b53('0x25')](respondWithFilteredResult(_0x297cd9,_0x1d11d6))['catch'](handleError(_0x297cd9,null));};exports[_0x3b53('0x47')]=function(_0x59c764,_0x3a6b1c){var _0x11996f={'raw':![],'where':{'id':_0x59c764[_0x3b53('0x48')]['id']}},_0x577b04={};_0x577b04['model']=_['keys'](db[_0x3b53('0x2f')][_0x3b53('0x30')]);_0x577b04[_0x3b53('0x34')]=_[_0x3b53('0x33')](_0x59c764[_0x3b53('0x34')]);_0x577b04[_0x3b53('0x3f')]=_['intersection'](_0x577b04[_0x3b53('0x37')],_0x577b04['query']);_0x11996f['attributes']=_[_0x3b53('0x35')](_0x577b04['model'],qs[_0x3b53('0x38')](_0x59c764[_0x3b53('0x34')][_0x3b53('0x38')]));_0x11996f[_0x3b53('0x36')]=_0x11996f[_0x3b53('0x36')][_0x3b53('0x39')]?_0x11996f[_0x3b53('0x36')]:_0x577b04[_0x3b53('0x37')];if(_0x59c764['query'][_0x3b53('0x44')]){_0x11996f[_0x3b53('0x49')]=[{'all':!![]}];}_0x11996f=_[_0x3b53('0x42')]({},_0x11996f,_0x59c764['options']);return db['Trigger'][_0x3b53('0x4a')](_0x11996f)[_0x3b53('0x25')](handleEntityNotFound(_0x3a6b1c,null))[_0x3b53('0x25')](respondWithResult(_0x3a6b1c,null))['catch'](handleError(_0x3a6b1c,null));};exports['create']=function(_0x32c378,_0x25b2f4){return db[_0x3b53('0x2f')][_0x3b53('0x4b')](_0x32c378[_0x3b53('0x4c')],{})[_0x3b53('0x25')](function(_0x36cbd7){var _0x28a0f7=_0x32c378[_0x3b53('0x4d')][_0x3b53('0x27')]({'plain':!![]});if(!_0x28a0f7)throw new Error(_0x3b53('0x4e'));if(_0x28a0f7[_0x3b53('0x4f')]===_0x3b53('0x4d')){var _0x6a42fd=_0x36cbd7['get']({'plain':!![]});var _0x3b555e=_0x3b53('0x50');return db[_0x3b53('0x51')][_0x3b53('0x4a')]({'where':{'name':_0x3b555e,'userProfileId':_0x28a0f7[_0x3b53('0x52')]},'raw':!![]})[_0x3b53('0x25')](function(_0x7f0e53){if(_0x7f0e53&&_0x7f0e53[_0x3b53('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x6a42fd[_0x3b53('0x2b')],'resourceId':_0x6a42fd['id'],'type':_0x7f0e53['name'],'sectionId':_0x7f0e53['id']},{})[_0x3b53('0x25')](function(){return _0x36cbd7;});}else{return _0x36cbd7;}})[_0x3b53('0x54')](function(_0x29c0d7){logger[_0x3b53('0x29')](_0x3b53('0x55'),_0x29c0d7);throw _0x29c0d7;});}return _0x36cbd7;})[_0x3b53('0x25')](respondWithResult(_0x25b2f4,0xc9))[_0x3b53('0x54')](handleError(_0x25b2f4,null));};exports[_0x3b53('0x24')]=function(_0x46fcb8,_0x302ab5){if(_0x46fcb8['body']['id']){delete _0x46fcb8[_0x3b53('0x4c')]['id'];}return db[_0x3b53('0x2f')][_0x3b53('0x4a')]({'where':{'id':_0x46fcb8[_0x3b53('0x48')]['id']}})[_0x3b53('0x25')](handleEntityNotFound(_0x302ab5,null))['then'](saveUpdates(_0x46fcb8[_0x3b53('0x4c')],null))[_0x3b53('0x25')](respondWithResult(_0x302ab5,null))[_0x3b53('0x54')](handleError(_0x302ab5,null));};exports[_0x3b53('0x26')]=function(_0x91b51a,_0x449365){return db[_0x3b53('0x2f')][_0x3b53('0x4a')]({'where':{'id':_0x91b51a[_0x3b53('0x48')]['id']}})[_0x3b53('0x25')](handleEntityNotFound(_0x449365,null))[_0x3b53('0x25')](removeEntity(_0x449365,null))['catch'](handleError(_0x449365,null));};exports['addAllCondition']=function(_0x996793,_0x29ef70,_0x2bb701){if(_0x996793[_0x3b53('0x4c')]['id']){delete _0x996793['body']['id'];}return db[_0x3b53('0x2f')][_0x3b53('0x4a')]({'where':{'id':_0x996793['params']['id']}})[_0x3b53('0x25')](handleEntityNotFound(_0x29ef70,null))[_0x3b53('0x25')](function(_0x501764){if(_0x501764){_0x996793[_0x3b53('0x4c')][_0x3b53('0x56')]=_0x501764['id'];return db['Condition']['create'](_0x996793['body']);}})[_0x3b53('0x25')](respondWithResult(_0x29ef70,null))[_0x3b53('0x54')](handleError(_0x29ef70,null));};exports['addAnyCondition']=function(_0x5e5b21,_0x20ff83,_0x3d09c1){if(_0x5e5b21[_0x3b53('0x4c')]['id']){delete _0x5e5b21[_0x3b53('0x4c')]['id'];}return db[_0x3b53('0x2f')][_0x3b53('0x4a')]({'where':{'id':_0x5e5b21[_0x3b53('0x48')]['id']}})[_0x3b53('0x25')](handleEntityNotFound(_0x20ff83,null))['then'](function(_0x4085a5){if(_0x4085a5){_0x5e5b21['body'][_0x3b53('0x57')]=_0x4085a5['id'];return db['Condition'][_0x3b53('0x4b')](_0x5e5b21[_0x3b53('0x4c')]);}})[_0x3b53('0x25')](respondWithResult(_0x20ff83,null))[_0x3b53('0x54')](handleError(_0x20ff83,null));};exports['getAllConditions']=function(_0x47ed37,_0x36c333,_0x328d04){var _0x427229={};var _0x151667={};var _0x19bfa7;var _0x3efef1;return db[_0x3b53('0x2f')]['findOne']({'where':{'id':_0x47ed37['params']['id']}})[_0x3b53('0x25')](handleEntityNotFound(_0x36c333,null))['then'](function(_0x53571f){if(_0x53571f){_0x19bfa7=_0x53571f;_0x151667[_0x3b53('0x37')]=_[_0x3b53('0x33')](db[_0x3b53('0x58')][_0x3b53('0x30')]);_0x151667[_0x3b53('0x34')]=_['keys'](_0x47ed37[_0x3b53('0x34')]);_0x151667[_0x3b53('0x3f')]=_[_0x3b53('0x35')](_0x151667['model'],_0x151667[_0x3b53('0x34')]);_0x427229[_0x3b53('0x36')]=_['intersection'](_0x151667[_0x3b53('0x37')],qs['fields'](_0x47ed37[_0x3b53('0x34')][_0x3b53('0x38')]));_0x427229['attributes']=_0x427229[_0x3b53('0x36')][_0x3b53('0x39')]?_0x427229[_0x3b53('0x36')]:_0x151667['model'];_0x427229[_0x3b53('0x3c')]=qs['sort'](_0x47ed37['query']['sort']);_0x427229['where']=qs[_0x3b53('0x3f')](_[_0x3b53('0x40')](_0x47ed37[_0x3b53('0x34')],_0x151667[_0x3b53('0x3f')]));if(_0x47ed37[_0x3b53('0x34')][_0x3b53('0x41')]){_0x427229['where']=_[_0x3b53('0x42')](_0x427229[_0x3b53('0x3e')],{'$or':_['map'](_0x427229[_0x3b53('0x36')],function(_0x209658){var _0x579a46={};_0x579a46[_0x209658]={'$like':'%'+_0x47ed37[_0x3b53('0x34')][_0x3b53('0x41')]+'%'};return _0x579a46;})});}_0x427229=_['merge']({},_0x427229,_0x47ed37['options']);return _0x19bfa7[_0x3b53('0x59')](_0x427229);}})['then'](function(_0x3aa813){if(_0x3aa813){_0x3efef1=_0x3aa813[_0x3b53('0x39')];if(!_0x47ed37[_0x3b53('0x34')]['hasOwnProperty'](_0x3b53('0x3b'))){_0x427229[_0x3b53('0x1f')]=qs[_0x3b53('0x1f')](_0x47ed37[_0x3b53('0x34')][_0x3b53('0x1f')]);_0x427229[_0x3b53('0x1d')]=qs[_0x3b53('0x1d')](_0x47ed37[_0x3b53('0x34')][_0x3b53('0x1d')]);}return _0x19bfa7['getAllConditions'](_0x427229);}})['then'](function(_0x29d9c8){if(_0x29d9c8){return _0x29d9c8?{'count':_0x3efef1,'rows':_0x29d9c8}:null;}})[_0x3b53('0x25')](respondWithResult(_0x36c333,null))['catch'](handleError(_0x36c333,null));};exports[_0x3b53('0x5a')]=function(_0xa898a5,_0x5bdd3d,_0x45af05){var _0x4be1af={};var _0x1549cb={};var _0x291320;var _0x5dfbc1;return db['Trigger'][_0x3b53('0x5b')]({'where':{'id':_0xa898a5[_0x3b53('0x48')]['id']}})[_0x3b53('0x25')](handleEntityNotFound(_0x5bdd3d,null))[_0x3b53('0x25')](function(_0x9ec7e7){if(_0x9ec7e7){_0x291320=_0x9ec7e7;_0x1549cb['model']=_['keys'](db['Condition'][_0x3b53('0x30')]);_0x1549cb[_0x3b53('0x34')]=_[_0x3b53('0x33')](_0xa898a5['query']);_0x1549cb[_0x3b53('0x3f')]=_['intersection'](_0x1549cb[_0x3b53('0x37')],_0x1549cb[_0x3b53('0x34')]);_0x4be1af[_0x3b53('0x36')]=_[_0x3b53('0x35')](_0x1549cb[_0x3b53('0x37')],qs[_0x3b53('0x38')](_0xa898a5[_0x3b53('0x34')][_0x3b53('0x38')]));_0x4be1af['attributes']=_0x4be1af[_0x3b53('0x36')][_0x3b53('0x39')]?_0x4be1af['attributes']:_0x1549cb[_0x3b53('0x37')];_0x4be1af[_0x3b53('0x3c')]=qs['sort'](_0xa898a5[_0x3b53('0x34')][_0x3b53('0x3d')]);_0x4be1af['where']=qs[_0x3b53('0x3f')](_[_0x3b53('0x40')](_0xa898a5[_0x3b53('0x34')],_0x1549cb['filters']));if(_0xa898a5[_0x3b53('0x34')]['filter']){_0x4be1af[_0x3b53('0x3e')]=_['merge'](_0x4be1af[_0x3b53('0x3e')],{'$or':_[_0x3b53('0x2e')](_0x4be1af[_0x3b53('0x36')],function(_0x4280a5){var _0x424f66={};_0x424f66[_0x4280a5]={'$like':'%'+_0xa898a5[_0x3b53('0x34')][_0x3b53('0x41')]+'%'};return _0x424f66;})});}_0x4be1af=_[_0x3b53('0x42')]({},_0x4be1af,_0xa898a5['options']);return _0x291320[_0x3b53('0x5a')](_0x4be1af);}})[_0x3b53('0x25')](function(_0x1f9e54){if(_0x1f9e54){_0x5dfbc1=_0x1f9e54['length'];if(!_0xa898a5[_0x3b53('0x34')][_0x3b53('0x3a')](_0x3b53('0x3b'))){_0x4be1af[_0x3b53('0x1f')]=qs['limit'](_0xa898a5[_0x3b53('0x34')][_0x3b53('0x1f')]);_0x4be1af[_0x3b53('0x1d')]=qs[_0x3b53('0x1d')](_0xa898a5[_0x3b53('0x34')][_0x3b53('0x1d')]);}return _0x291320[_0x3b53('0x5a')](_0x4be1af);}})['then'](function(_0x1b40a9){if(_0x1b40a9){return _0x1b40a9?{'count':_0x5dfbc1,'rows':_0x1b40a9}:null;}})['then'](respondWithResult(_0x5bdd3d,null))[_0x3b53('0x54')](handleError(_0x5bdd3d,null));};exports['addAction']=function(_0x202dc8,_0x264250,_0x5ddb92){if(_0x202dc8['body']['id']){delete _0x202dc8[_0x3b53('0x4c')]['id'];}return db[_0x3b53('0x2f')][_0x3b53('0x4a')]({'where':{'id':_0x202dc8[_0x3b53('0x48')]['id']}})['then'](handleEntityNotFound(_0x264250,null))['then'](function(_0x34d9d9){if(_0x34d9d9){_0x202dc8[_0x3b53('0x4c')]['TriggerId']=_0x34d9d9['id'];return db[_0x3b53('0x5c')][_0x3b53('0x4b')](_0x202dc8[_0x3b53('0x4c')]);}})[_0x3b53('0x25')](respondWithResult(_0x264250,null))[_0x3b53('0x54')](handleError(_0x264250,null));};exports[_0x3b53('0x5d')]=function(_0x415dd1,_0x14bfdd,_0x21d01d){var _0x4b01f6={};var _0x160d0b={};var _0x5ce9ac;var _0x296dcb;return db[_0x3b53('0x2f')][_0x3b53('0x5b')]({'where':{'id':_0x415dd1[_0x3b53('0x48')]['id']}})[_0x3b53('0x25')](handleEntityNotFound(_0x14bfdd,null))[_0x3b53('0x25')](function(_0x2b41d1){if(_0x2b41d1){_0x5ce9ac=_0x2b41d1;_0x160d0b[_0x3b53('0x37')]=_[_0x3b53('0x33')](db[_0x3b53('0x5c')][_0x3b53('0x30')]);_0x160d0b[_0x3b53('0x34')]=_['keys'](_0x415dd1[_0x3b53('0x34')]);_0x160d0b[_0x3b53('0x3f')]=_[_0x3b53('0x35')](_0x160d0b[_0x3b53('0x37')],_0x160d0b['query']);_0x4b01f6[_0x3b53('0x36')]=_[_0x3b53('0x35')](_0x160d0b[_0x3b53('0x37')],qs['fields'](_0x415dd1[_0x3b53('0x34')][_0x3b53('0x38')]));_0x4b01f6[_0x3b53('0x36')]=_0x4b01f6[_0x3b53('0x36')][_0x3b53('0x39')]?_0x4b01f6[_0x3b53('0x36')]:_0x160d0b[_0x3b53('0x37')];_0x4b01f6[_0x3b53('0x3c')]=qs[_0x3b53('0x3d')](_0x415dd1[_0x3b53('0x34')][_0x3b53('0x3d')]);_0x4b01f6[_0x3b53('0x3e')]=qs[_0x3b53('0x3f')](_[_0x3b53('0x40')](_0x415dd1[_0x3b53('0x34')],_0x160d0b[_0x3b53('0x3f')]));if(_0x415dd1['query']['filter']){_0x4b01f6[_0x3b53('0x3e')]=_['merge'](_0x4b01f6['where'],{'$or':_[_0x3b53('0x2e')](_0x4b01f6[_0x3b53('0x36')],function(_0x3e2b9d){var _0x4dcb66={};_0x4dcb66[_0x3e2b9d]={'$like':'%'+_0x415dd1[_0x3b53('0x34')][_0x3b53('0x41')]+'%'};return _0x4dcb66;})});}_0x4b01f6=_[_0x3b53('0x42')]({},_0x4b01f6,_0x415dd1[_0x3b53('0x43')]);return _0x5ce9ac[_0x3b53('0x5d')](_0x4b01f6);}})[_0x3b53('0x25')](function(_0x3badaf){if(_0x3badaf){_0x296dcb=_0x3badaf[_0x3b53('0x39')];if(!_0x415dd1[_0x3b53('0x34')][_0x3b53('0x3a')](_0x3b53('0x3b'))){_0x4b01f6[_0x3b53('0x1f')]=qs['limit'](_0x415dd1[_0x3b53('0x34')][_0x3b53('0x1f')]);_0x4b01f6[_0x3b53('0x1d')]=qs[_0x3b53('0x1d')](_0x415dd1[_0x3b53('0x34')]['offset']);}return _0x5ce9ac[_0x3b53('0x5d')](_0x4b01f6);}})[_0x3b53('0x25')](function(_0x271d27){if(_0x271d27){return _0x271d27?{'count':_0x296dcb,'rows':_0x271d27}:null;}})['then'](respondWithResult(_0x14bfdd,null))[_0x3b53('0x54')](handleError(_0x14bfdd,null));};
\ No newline at end of file
index 537ebe1..b5b2b4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34aa=['./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4148ab,_0x19bf6b){var _0x517b42=function(_0x2a3e23){while(--_0x2a3e23){_0x4148ab['push'](_0x4148ab['shift']());}};_0x517b42(++_0x19bf6b);}(_0x34aa,0x171));var _0xa34a=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0x34aa[_0x30f07a];return _0xb38461;};'use strict';var _=require(_0xa34a('0x0'));var util=require('util');var logger=require(_0xa34a('0x1'))(_0xa34a('0x2'));var moment=require(_0xa34a('0x3'));var BPromise=require(_0xa34a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa34a('0x5'));var rimraf=require(_0xa34a('0x6'));var config=require(_0xa34a('0x7'));var attributes=require(_0xa34a('0x8'));module[_0xa34a('0x9')]=function(_0x475f8f,_0x27349c){return _0x475f8f[_0xa34a('0xa')](_0xa34a('0xb'),attributes,{'tableName':_0xa34a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xafe6=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','moment','bluebird'];(function(_0x48210d,_0x516363){var _0x4f87b6=function(_0x437a5b){while(--_0x437a5b){_0x48210d['push'](_0x48210d['shift']());}};_0x4f87b6(++_0x516363);}(_0xafe6,0xac));var _0x6afe=function(_0x5bd4b0,_0x1ba7b8){_0x5bd4b0=_0x5bd4b0-0x0;var _0x30dc0d=_0xafe6[_0x5bd4b0];return _0x30dc0d;};'use strict';var _=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6afe('0x2'));var BPromise=require(_0x6afe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6afe('0x4'));var config=require(_0x6afe('0x5'));var attributes=require(_0x6afe('0x6'));module[_0x6afe('0x7')]=function(_0x2ce302,_0x4898bb){return _0x2ce302[_0x6afe('0x8')](_0x6afe('0x9'),attributes,{'tableName':_0x6afe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a536ff8..a82b24e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfee1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','info','request\x20sent','debug','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll','options','raw','where','attributes','include','map','model','then','GetTrigger','ShowTrigger','find','lodash','util','moment'];(function(_0x2b3f1b,_0x3600c7){var _0x1497d9=function(_0x172985){while(--_0x172985){_0x2b3f1b['push'](_0x2b3f1b['shift']());}};_0x1497d9(++_0x3600c7);}(_0xfee1,0x195));var _0x1fee=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xfee1[_0x18fb16];return _0x147b0d;};'use strict';var _=require(_0x1fee('0x0'));var util=require(_0x1fee('0x1'));var moment=require(_0x1fee('0x2'));var BPromise=require(_0x1fee('0x3'));var rs=require(_0x1fee('0x4'));var fs=require('fs');var Redis=require(_0x1fee('0x5'));var db=require(_0x1fee('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fee('0x7'))(_0x1fee('0x8'));var config=require('../../config/environment');var jayson=require(_0x1fee('0x9'));var client=jayson['client'][_0x1fee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a1fee,_0x45f77f,_0x528a97){return new BPromise(function(_0x27274f,_0x1aca87){return client['request'](_0x3a1fee,_0x528a97)['then'](function(_0x2af8e2){logger[_0x1fee('0xb')]('Trigger,\x20%s,\x20%s',_0x45f77f,_0x1fee('0xc'));logger[_0x1fee('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x45f77f,_0x1fee('0xc'),JSON[_0x1fee('0xe')](_0x2af8e2));if(_0x2af8e2[_0x1fee('0xf')]){if(_0x2af8e2[_0x1fee('0xf')][_0x1fee('0x10')]===0x1f4){logger[_0x1fee('0xf')](_0x1fee('0x11'),_0x45f77f,_0x2af8e2[_0x1fee('0xf')][_0x1fee('0x12')]);return _0x1aca87(_0x2af8e2[_0x1fee('0xf')][_0x1fee('0x12')]);}logger[_0x1fee('0xf')](_0x1fee('0x11'),_0x45f77f,_0x2af8e2[_0x1fee('0xf')][_0x1fee('0x12')]);return _0x27274f(_0x2af8e2[_0x1fee('0xf')][_0x1fee('0x12')]);}else{logger[_0x1fee('0xb')](_0x1fee('0x11'),_0x45f77f,_0x1fee('0xc'));_0x27274f(_0x2af8e2[_0x1fee('0x13')]['message']);}})[_0x1fee('0x14')](function(_0x2ec48a){logger[_0x1fee('0xf')]('Trigger,\x20%s,\x20%s',_0x45f77f,_0x2ec48a);_0x1aca87(_0x2ec48a);});});}exports['GetTrigger']=function(_0x450bfd){var _0x2ade72=this;return new Promise(function(_0x13ed57,_0x1a4e72){return db[_0x1fee('0x15')][_0x1fee('0x16')]({'raw':_0x450bfd[_0x1fee('0x17')]?_0x450bfd['options'][_0x1fee('0x18')]===undefined?!![]:![]:!![],'where':_0x450bfd[_0x1fee('0x17')]?_0x450bfd[_0x1fee('0x17')][_0x1fee('0x19')]||null:null,'attributes':_0x450bfd['options']?_0x450bfd[_0x1fee('0x17')][_0x1fee('0x1a')]||null:null,'limit':_0x450bfd[_0x1fee('0x17')]?_0x450bfd[_0x1fee('0x17')]['limit']||null:null,'include':_0x450bfd[_0x1fee('0x17')]?_0x450bfd[_0x1fee('0x17')][_0x1fee('0x1b')]?_[_0x1fee('0x1c')](_0x450bfd[_0x1fee('0x17')][_0x1fee('0x1b')],function(_0x16adad){return{'model':db[_0x16adad[_0x1fee('0x1d')]],'as':_0x16adad['as'],'attributes':_0x16adad[_0x1fee('0x1a')],'include':_0x16adad[_0x1fee('0x1b')]?_[_0x1fee('0x1c')](_0x16adad[_0x1fee('0x1b')],function(_0x73971){return{'model':db[_0x73971[_0x1fee('0x1d')]],'as':_0x73971['as'],'attributes':_0x73971['attributes'],'include':_0x73971[_0x1fee('0x1b')]?_['map'](_0x73971[_0x1fee('0x1b')],function(_0x515992){return{'model':db[_0x515992['model']],'as':_0x515992['as'],'attributes':_0x515992[_0x1fee('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1fee('0x1e')](function(_0x47d03f){logger[_0x1fee('0xb')](_0x1fee('0x1f'),_0x450bfd);logger['debug'](_0x1fee('0x1f'),_0x450bfd,JSON['stringify'](_0x47d03f));_0x13ed57(_0x47d03f);})[_0x1fee('0x14')](function(_0x403964){logger[_0x1fee('0xf')](_0x1fee('0x1f'),_0x403964[_0x1fee('0x12')],_0x450bfd);_0x1a4e72(_0x2ade72[_0x1fee('0xf')](0x1f4,_0x403964[_0x1fee('0x12')]));});});};exports[_0x1fee('0x20')]=function(_0x429e99){var _0x5c6546=this;return new Promise(function(_0xdf353a,_0x5d4ad2){return db[_0x1fee('0x15')][_0x1fee('0x21')]({'raw':_0x429e99[_0x1fee('0x17')]?_0x429e99[_0x1fee('0x17')][_0x1fee('0x18')]===undefined?!![]:![]:!![],'where':_0x429e99[_0x1fee('0x17')]?_0x429e99['options']['where']||null:null,'attributes':_0x429e99['options']?_0x429e99[_0x1fee('0x17')][_0x1fee('0x1a')]||null:null,'include':_0x429e99[_0x1fee('0x17')]?_0x429e99[_0x1fee('0x17')][_0x1fee('0x1b')]?_[_0x1fee('0x1c')](_0x429e99['options'][_0x1fee('0x1b')],function(_0x59b152){return{'model':db[_0x59b152[_0x1fee('0x1d')]],'as':_0x59b152['as'],'attributes':_0x59b152[_0x1fee('0x1a')],'include':_0x59b152['include']?_['map'](_0x59b152[_0x1fee('0x1b')],function(_0x48e986){return{'model':db[_0x48e986[_0x1fee('0x1d')]],'as':_0x48e986['as'],'attributes':_0x48e986[_0x1fee('0x1a')],'include':_0x48e986['include']?_[_0x1fee('0x1c')](_0x48e986[_0x1fee('0x1b')],function(_0x59aaad){return{'model':db[_0x59aaad[_0x1fee('0x1d')]],'as':_0x59aaad['as'],'attributes':_0x59aaad['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e1882){logger[_0x1fee('0xb')](_0x1fee('0x20'),_0x429e99);logger[_0x1fee('0xd')](_0x1fee('0x20'),_0x429e99,JSON[_0x1fee('0xe')](_0x4e1882));_0xdf353a(_0x4e1882);})[_0x1fee('0x14')](function(_0x363e7a){logger[_0x1fee('0xf')](_0x1fee('0x20'),_0x363e7a[_0x1fee('0x12')],_0x429e99);_0x5d4ad2(_0x5c6546['error'](0x1f4,_0x363e7a['message']));});});};
\ No newline at end of file
+var _0x3f9f=['attributes','limit','include','map','model','find','ShowTrigger','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','options','raw','where'];(function(_0x292e74,_0x479e10){var _0x627ba6=function(_0x4f4900){while(--_0x4f4900){_0x292e74['push'](_0x292e74['shift']());}};_0x627ba6(++_0x479e10);}(_0x3f9f,0x112));var _0xf3f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f9f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf3f9('0x0'));var util=require(_0xf3f9('0x1'));var moment=require(_0xf3f9('0x2'));var BPromise=require(_0xf3f9('0x3'));var rs=require(_0xf3f9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3f9('0x5'))['db'];var utils=require(_0xf3f9('0x6'));var logger=require(_0xf3f9('0x7'))('rpc');var config=require(_0xf3f9('0x8'));var jayson=require(_0xf3f9('0x9'));var client=jayson[_0xf3f9('0xa')][_0xf3f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d792e,_0xe03d90,_0x116d1d){return new BPromise(function(_0x236909,_0xfa7750){return client[_0xf3f9('0xc')](_0x5d792e,_0x116d1d)[_0xf3f9('0xd')](function(_0x2b70d8){logger[_0xf3f9('0xe')]('Trigger,\x20%s,\x20%s',_0xe03d90,_0xf3f9('0xf'));logger[_0xf3f9('0x10')](_0xf3f9('0x11'),_0xe03d90,'request\x20sent',JSON[_0xf3f9('0x12')](_0x2b70d8));if(_0x2b70d8[_0xf3f9('0x13')]){if(_0x2b70d8[_0xf3f9('0x13')][_0xf3f9('0x14')]===0x1f4){logger[_0xf3f9('0x13')](_0xf3f9('0x15'),_0xe03d90,_0x2b70d8[_0xf3f9('0x13')]['message']);return _0xfa7750(_0x2b70d8[_0xf3f9('0x13')][_0xf3f9('0x16')]);}logger[_0xf3f9('0x13')](_0xf3f9('0x15'),_0xe03d90,_0x2b70d8['error'][_0xf3f9('0x16')]);return _0x236909(_0x2b70d8[_0xf3f9('0x13')][_0xf3f9('0x16')]);}else{logger[_0xf3f9('0xe')](_0xf3f9('0x15'),_0xe03d90,_0xf3f9('0xf'));_0x236909(_0x2b70d8[_0xf3f9('0x17')][_0xf3f9('0x16')]);}})['catch'](function(_0x52d40a){logger['error'](_0xf3f9('0x15'),_0xe03d90,_0x52d40a);_0xfa7750(_0x52d40a);});});}exports[_0xf3f9('0x18')]=function(_0x300ba7){var _0x26b1f9=this;return new Promise(function(_0xe8c531,_0xb3d788){return db[_0xf3f9('0x19')][_0xf3f9('0x1a')]({'raw':_0x300ba7[_0xf3f9('0x1b')]?_0x300ba7[_0xf3f9('0x1b')][_0xf3f9('0x1c')]===undefined?!![]:![]:!![],'where':_0x300ba7[_0xf3f9('0x1b')]?_0x300ba7[_0xf3f9('0x1b')][_0xf3f9('0x1d')]||null:null,'attributes':_0x300ba7[_0xf3f9('0x1b')]?_0x300ba7[_0xf3f9('0x1b')][_0xf3f9('0x1e')]||null:null,'limit':_0x300ba7['options']?_0x300ba7[_0xf3f9('0x1b')][_0xf3f9('0x1f')]||null:null,'include':_0x300ba7[_0xf3f9('0x1b')]?_0x300ba7[_0xf3f9('0x1b')][_0xf3f9('0x20')]?_[_0xf3f9('0x21')](_0x300ba7['options'][_0xf3f9('0x20')],function(_0x281dd8){return{'model':db[_0x281dd8['model']],'as':_0x281dd8['as'],'attributes':_0x281dd8[_0xf3f9('0x1e')],'include':_0x281dd8[_0xf3f9('0x20')]?_[_0xf3f9('0x21')](_0x281dd8[_0xf3f9('0x20')],function(_0x433710){return{'model':db[_0x433710[_0xf3f9('0x22')]],'as':_0x433710['as'],'attributes':_0x433710[_0xf3f9('0x1e')],'include':_0x433710[_0xf3f9('0x20')]?_[_0xf3f9('0x21')](_0x433710[_0xf3f9('0x20')],function(_0x3286f9){return{'model':db[_0x3286f9[_0xf3f9('0x22')]],'as':_0x3286f9['as'],'attributes':_0x3286f9[_0xf3f9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56496d){logger[_0xf3f9('0xe')](_0xf3f9('0x18'),_0x300ba7);logger[_0xf3f9('0x10')](_0xf3f9('0x18'),_0x300ba7,JSON[_0xf3f9('0x12')](_0x56496d));_0xe8c531(_0x56496d);})['catch'](function(_0x3fbc9f){logger[_0xf3f9('0x13')]('GetTrigger',_0x3fbc9f[_0xf3f9('0x16')],_0x300ba7);_0xb3d788(_0x26b1f9[_0xf3f9('0x13')](0x1f4,_0x3fbc9f[_0xf3f9('0x16')]));});});};exports['ShowTrigger']=function(_0x1e886b){var _0x3c0a04=this;return new Promise(function(_0x1e1a4d,_0x53f474){return db[_0xf3f9('0x19')][_0xf3f9('0x23')]({'raw':_0x1e886b[_0xf3f9('0x1b')]?_0x1e886b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e886b[_0xf3f9('0x1b')]?_0x1e886b[_0xf3f9('0x1b')][_0xf3f9('0x1d')]||null:null,'attributes':_0x1e886b[_0xf3f9('0x1b')]?_0x1e886b[_0xf3f9('0x1b')][_0xf3f9('0x1e')]||null:null,'include':_0x1e886b['options']?_0x1e886b[_0xf3f9('0x1b')][_0xf3f9('0x20')]?_[_0xf3f9('0x21')](_0x1e886b['options'][_0xf3f9('0x20')],function(_0x306e88){return{'model':db[_0x306e88['model']],'as':_0x306e88['as'],'attributes':_0x306e88['attributes'],'include':_0x306e88['include']?_[_0xf3f9('0x21')](_0x306e88['include'],function(_0x34d7ae){return{'model':db[_0x34d7ae['model']],'as':_0x34d7ae['as'],'attributes':_0x34d7ae[_0xf3f9('0x1e')],'include':_0x34d7ae[_0xf3f9('0x20')]?_[_0xf3f9('0x21')](_0x34d7ae[_0xf3f9('0x20')],function(_0x1c55f6){return{'model':db[_0x1c55f6[_0xf3f9('0x22')]],'as':_0x1c55f6['as'],'attributes':_0x1c55f6[_0xf3f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf3f9('0xd')](function(_0x2f956d){logger[_0xf3f9('0xe')](_0xf3f9('0x24'),_0x1e886b);logger[_0xf3f9('0x10')](_0xf3f9('0x24'),_0x1e886b,JSON[_0xf3f9('0x12')](_0x2f956d));_0x1e1a4d(_0x2f956d);})[_0xf3f9('0x25')](function(_0x2b1497){logger[_0xf3f9('0x13')](_0xf3f9('0x24'),_0x2b1497[_0xf3f9('0x16')],_0x1e886b);_0x53f474(_0x3c0a04[_0xf3f9('0x13')](0x1f4,_0x2b1497[_0xf3f9('0x16')]));});});};
\ No newline at end of file
index 63a6c2a..3703f9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29cf=['post','/:id/clone','clone','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','/:id','show'];(function(_0x51464d,_0x5dbfde){var _0x1b8c26=function(_0x12abfe){while(--_0x12abfe){_0x51464d['push'](_0x51464d['shift']());}};_0x1b8c26(++_0x5dbfde);}(_0x29cf,0x1ad));var _0xf29c=function(_0x3714bf,_0x214c72){_0x3714bf=_0x3714bf-0x0;var _0x296814=_0x29cf[_0x3714bf];return _0x296814;};'use strict';var multer=require('multer');var util=require(_0xf29c('0x0'));var path=require(_0xf29c('0x1'));var timeout=require(_0xf29c('0x2'));var express=require('express');var router=express[_0xf29c('0x3')]();var fs_extra=require(_0xf29c('0x4'));var auth=require(_0xf29c('0x5'));var interaction=require(_0xf29c('0x6'));var config=require('../../config/environment');var controller=require(_0xf29c('0x7'));router[_0xf29c('0x8')]('/',auth[_0xf29c('0x9')](),controller['index']);router['get'](_0xf29c('0xa'),auth[_0xf29c('0x9')](),controller[_0xf29c('0xb')]);router[_0xf29c('0xc')](_0xf29c('0xd'),auth[_0xf29c('0x9')](),controller[_0xf29c('0xe')]);router[_0xf29c('0xc')]('/',auth[_0xf29c('0x9')](),controller[_0xf29c('0xf')]);router[_0xf29c('0x10')]('/:id',auth[_0xf29c('0x9')](),controller[_0xf29c('0x11')]);router[_0xf29c('0x12')](_0xf29c('0xa'),auth[_0xf29c('0x9')](),controller[_0xf29c('0x13')]);module[_0xf29c('0x14')]=router;
\ No newline at end of file
+var _0xb16d=['delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','put'];(function(_0x17ad24,_0x5694a6){var _0x41dca6=function(_0x3c97ed){while(--_0x3c97ed){_0x17ad24['push'](_0x17ad24['shift']());}};_0x41dca6(++_0x5694a6);}(_0xb16d,0x8e));var _0xdb16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb16d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xdb16('0x0'));var path=require(_0xdb16('0x1'));var timeout=require(_0xdb16('0x2'));var express=require(_0xdb16('0x3'));var router=express['Router']();var fs_extra=require(_0xdb16('0x4'));var auth=require(_0xdb16('0x5'));var interaction=require(_0xdb16('0x6'));var config=require(_0xdb16('0x7'));var controller=require(_0xdb16('0x8'));router[_0xdb16('0x9')]('/',auth[_0xdb16('0xa')](),controller[_0xdb16('0xb')]);router['get'](_0xdb16('0xc'),auth[_0xdb16('0xa')](),controller[_0xdb16('0xd')]);router[_0xdb16('0xe')](_0xdb16('0xf'),auth['isAuthenticated'](),controller[_0xdb16('0x10')]);router[_0xdb16('0xe')]('/',auth[_0xdb16('0xa')](),controller['create']);router[_0xdb16('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdb16('0x12')]('/:id',auth[_0xdb16('0xa')](),controller[_0xdb16('0x13')]);module['exports']=router;
\ No newline at end of file
index 225beb4..2dee4c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6bf=['always','refuse','originate','uac','uas','pai','certificate','active','dynamic','update,nonat','BOOLEAN','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','getDataValue','rfc2833','info','shortinfo','inband','auto','nonat','update','yes','force_rport,comedia','setDataValue','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER'];(function(_0x23ec6b,_0x4aec18){var _0x129a73=function(_0x4ee162){while(--_0x4ee162){_0x23ec6b['push'](_0x23ec6b['shift']());}};_0x129a73(++_0x4aec18);}(_0xc6bf,0xa1));var _0xfc6b=function(_0x4032e3,_0x6d6449){_0x4032e3=_0x4032e3-0x0;var _0x34f51a=_0xc6bf[_0x4032e3];return _0x34f51a;};'use strict';var Sequelize=require('sequelize');module[_0xfc6b('0x0')]={'name':{'type':Sequelize[_0xfc6b('0x1')],'allowNull':![],'unique':_0xfc6b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x4'),_0xfc6b('0x5'),_0xfc6b('0x6')),'allowNull':![],'defaultValue':_0xfc6b('0x4')},'context':{'type':Sequelize[_0xfc6b('0x1')],'allowNull':![],'defaultValue':_0xfc6b('0x7')},'callingpres':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x8'),_0xfc6b('0x9'),_0xfc6b('0xa'),_0xfc6b('0xb'),_0xfc6b('0xc'),_0xfc6b('0xd'),'PROHIB_FAILED_SCREEN',_0xfc6b('0xe'))},'deny':{'type':Sequelize[_0xfc6b('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xfc6b('0x1')]},'md5secret':{'type':Sequelize[_0xfc6b('0x1')]},'remotesecret':{'type':Sequelize[_0xfc6b('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xfc6b('0xf'),'set':function(_0x1d0e2c){this['setDataValue'](_0xfc6b('0x10'),_0x1d0e2c?_0x1d0e2c[_0xfc6b('0x11')](','):null);},'get':function(){return this[_0xfc6b('0x12')](_0xfc6b('0x10'))?this[_0xfc6b('0x12')](_0xfc6b('0x10'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x13'),_0xfc6b('0x14'),_0xfc6b('0x15'),_0xfc6b('0x16'),_0xfc6b('0x17')),'defaultValue':_0xfc6b('0x13')},'directmedia':{'type':Sequelize[_0xfc6b('0x3')]('yes','no',_0xfc6b('0x18'),_0xfc6b('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xfc6b('0x1')]},'nat':{'type':Sequelize[_0xfc6b('0x1')],'defaultValue':_0xfc6b('0x1b'),'set':function(_0x2b40dc){this[_0xfc6b('0x1c')](_0xfc6b('0x1d'),_0x2b40dc?_0x2b40dc['join'](','):null);},'get':function(){return this[_0xfc6b('0x12')](_0xfc6b('0x1d'))?this[_0xfc6b('0x12')](_0xfc6b('0x1d'))[_0xfc6b('0x1e')](','):null;},'comment':_0xfc6b('0x1f')},'callgroup':{'type':Sequelize[_0xfc6b('0x1')]},'namedcallgroup':{'type':Sequelize[_0xfc6b('0x1')]},'pickupgroup':{'type':Sequelize[_0xfc6b('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xfc6b('0x1')]},'language':{'type':Sequelize[_0xfc6b('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfc6b('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xfc6b('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xfc6b('0x1')],'allowNull':![],'defaultValue':_0xfc6b('0x20'),'set':function(_0x1cc792){this[_0xfc6b('0x1c')](_0xfc6b('0x21'),_0x1cc792?_0x1cc792[_0xfc6b('0x11')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xfc6b('0x12')](_0xfc6b('0x21'))?this[_0xfc6b('0x12')]('allow')[_0xfc6b('0x1e')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xfc6b('0x3')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xfc6b('0x22'),'set':function(_0x34785f){this[_0xfc6b('0x1c')]('insecure',_0x34785f?_0x34785f[_0xfc6b('0x11')](','):null);},'get':function(){return this['getDataValue'](_0xfc6b('0x23'))?this[_0xfc6b('0x12')](_0xfc6b('0x23'))[_0xfc6b('0x1e')](','):null;},'comment':_0xfc6b('0x24')},'trustrpid':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no',_0xfc6b('0x25'))},'promiscredir':{'type':Sequelize[_0xfc6b('0x3')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0xfc6b('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'setvar':{'type':Sequelize[_0xfc6b('0x1')]},'callerid':{'type':Sequelize[_0xfc6b('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xfc6b('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0xfc6b('0x1a'),'no'),'defaultValue':_0xfc6b('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0xfc6b('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xfc6b('0x1')]},'template':{'type':Sequelize[_0xfc6b('0x1')]},'videosupport':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no',_0xfc6b('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xfc6b('0x1a'),'no')},'mailbox':{'type':Sequelize[_0xfc6b('0x1')]},'session_timers':{'type':Sequelize[_0xfc6b('0x3')]('accept',_0xfc6b('0x28'),_0xfc6b('0x29'))},'session_expires':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'session_minse':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x2a'),_0xfc6b('0x2b')),'defaultValue':_0xfc6b('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xfc6b('0x1')]},'regexten':{'type':Sequelize[_0xfc6b('0x1')]},'fromdomain':{'type':Sequelize[_0xfc6b('0x1')]},'fromuser':{'type':Sequelize[_0xfc6b('0x1')]},'port':{'type':Sequelize[_0xfc6b('0x26')](0x5)},'qualify':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no'),'defaultValue':_0xfc6b('0x1a')},'keepalive':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xfc6b('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0xfc6b('0x3')]('yes','no',_0xfc6b('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfc6b('0x1')]},'callbackextension':{'type':Sequelize[_0xfc6b('0x1')]},'timert1':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'timerb':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0xfc6b('0x1')]},'contactdeny':{'type':Sequelize[_0xfc6b('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xfc6b('0x1')]},'use_q850_reason':{'type':Sequelize[_0xfc6b('0x1')]},'maxforwards':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'encryption':{'type':Sequelize[_0xfc6b('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfc6b('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xfc6b('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no','fingerprint',_0xfc6b('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xfc6b('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0xfc6b('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xfc6b('0x1')]},'dtlscafile':{'type':Sequelize[_0xfc6b('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x2e'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xfc6b('0x1')]},'usereqphone':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfc6b('0x1')]},'recordofffeature':{'type':Sequelize[_0xfc6b('0x1')]},'call_limit':{'type':Sequelize[_0xfc6b('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xfc6b('0x3')](_0xfc6b('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xfc6b('0x1')]},'mohsuggest':{'type':Sequelize[_0xfc6b('0x1')]},'parkinglot':{'type':Sequelize[_0xfc6b('0x1')]},'description':{'type':Sequelize[_0xfc6b('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xfc6b('0x2f')},'canreinvite':{'type':Sequelize['ENUM'](_0xfc6b('0x1a'),'no',_0xfc6b('0x18'),_0xfc6b('0x19'),_0xfc6b('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xfc6b('0x1')]},'otherFields':{'type':Sequelize[_0xfc6b('0x1')]},'active':{'type':Sequelize[_0xfc6b('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
+var _0xcf18=['ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','friend'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf18,0x12b));var _0x8cf1=function(_0x53e787,_0x4298e6){_0x53e787=_0x53e787-0x0;var _0x2781a0=_0xcf18[_0x53e787];return _0x2781a0;};'use strict';var Sequelize=require(_0x8cf1('0x0'));module[_0x8cf1('0x1')]={'name':{'type':Sequelize[_0x8cf1('0x2')],'allowNull':![],'unique':_0x8cf1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8cf1('0x4')]('friend',_0x8cf1('0x5'),'peer'),'allowNull':![],'defaultValue':_0x8cf1('0x6')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x7'),_0x8cf1('0x8'),'ALLOWED_FAILED_SCREEN',_0x8cf1('0x9'),_0x8cf1('0xa'),_0x8cf1('0xb'),_0x8cf1('0xc'),_0x8cf1('0xd'))},'deny':{'type':Sequelize[_0x8cf1('0x2')]},'permit':{'type':Sequelize[_0x8cf1('0x2')]},'secret':{'type':Sequelize[_0x8cf1('0x2')]},'md5secret':{'type':Sequelize[_0x8cf1('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x8cf1('0xe'),'set':function(_0x3c4e1f){this[_0x8cf1('0xf')](_0x8cf1('0x10'),_0x3c4e1f?_0x3c4e1f[_0x8cf1('0x11')](','):null);},'get':function(){return this[_0x8cf1('0x12')](_0x8cf1('0x10'))?this[_0x8cf1('0x12')](_0x8cf1('0x10'))[_0x8cf1('0x13')](','):null;},'comment':_0x8cf1('0x14')},'dtmfmode':{'type':Sequelize[_0x8cf1('0x4')]('rfc2833',_0x8cf1('0x15'),_0x8cf1('0x16'),'inband',_0x8cf1('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no','nonat',_0x8cf1('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x8cf1('0x2')]},'nat':{'type':Sequelize[_0x8cf1('0x2')],'defaultValue':_0x8cf1('0x1a'),'set':function(_0x21d9b2){this[_0x8cf1('0xf')](_0x8cf1('0x1b'),_0x21d9b2?_0x21d9b2['join'](','):null);},'get':function(){return this[_0x8cf1('0x12')](_0x8cf1('0x1b'))?this[_0x8cf1('0x12')]('nat')['split'](','):null;},'comment':_0x8cf1('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x8cf1('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x8cf1('0x2')]},'language':{'type':Sequelize[_0x8cf1('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8cf1('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8cf1('0x2')],'defaultValue':_0x8cf1('0x1d')},'allow':{'type':Sequelize[_0x8cf1('0x2')],'allowNull':![],'defaultValue':_0x8cf1('0x1e'),'set':function(_0x520d98){this[_0x8cf1('0xf')](_0x8cf1('0x1f'),_0x520d98?_0x520d98[_0x8cf1('0x11')](';'):_0x8cf1('0x1e'));},'get':function(){return this[_0x8cf1('0x12')](_0x8cf1('0x1f'))?this[_0x8cf1('0x12')](_0x8cf1('0x1f'))['split'](';'):null;},'comment':_0x8cf1('0x20')},'autoframing':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no')},'insecure':{'type':Sequelize[_0x8cf1('0x2')],'defaultValue':_0x8cf1('0x21'),'set':function(_0x32e4f4){this['setDataValue'](_0x8cf1('0x22'),_0x32e4f4?_0x32e4f4[_0x8cf1('0x11')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x8cf1('0x12')](_0x8cf1('0x22'))[_0x8cf1('0x13')](','):null;},'comment':_0x8cf1('0x23')},'trustrpid':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no',_0x8cf1('0x24'))},'promiscredir':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x8cf1('0x18'),'no')},'accountcode':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8cf1('0x2')],'defaultValue':_0x8cf1('0x26')},'amaflags':{'type':Sequelize[_0x8cf1('0x2')]},'callcounter':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no'),'defaultValue':_0x8cf1('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x8cf1('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x8cf1('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x8cf1('0x4')]('yes','no',_0x8cf1('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x8cf1('0x2')]},'session_timers':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x28'),'refuse',_0x8cf1('0x29'))},'session_expires':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x8cf1('0x4')]('uac','uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x8cf1('0x2')]},'regexten':{'type':Sequelize[_0x8cf1('0x2')]},'fromdomain':{'type':Sequelize[_0x8cf1('0x2')]},'fromuser':{'type':Sequelize[_0x8cf1('0x2')]},'port':{'type':Sequelize[_0x8cf1('0x25')](0x5)},'qualify':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no'),'defaultValue':_0x8cf1('0x18')},'keepalive':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x8cf1('0x2')]},'defaultuser':{'type':Sequelize[_0x8cf1('0x2')]},'rtptimeout':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x8cf1('0x18'),'no',_0x8cf1('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8cf1('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x8cf1('0x2')]},'contactdeny':{'type':Sequelize[_0x8cf1('0x2')]},'contactacl':{'type':Sequelize[_0x8cf1('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x8cf1('0x2')]},'use_q850_reason':{'type':Sequelize[_0x8cf1('0x2')]},'maxforwards':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'encryption':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8cf1('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no')},'icesupport':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x8cf1('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no',_0x8cf1('0x2b'),_0x8cf1('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x8cf1('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x8cf1('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x8cf1('0x2')]},'dtlscipher':{'type':Sequelize[_0x8cf1('0x2')]},'dtlscafile':{'type':Sequelize[_0x8cf1('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x2d'),_0x8cf1('0x2e'),_0x8cf1('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8cf1('0x2')]},'usereqphone':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x8cf1('0x2')]},'call_limit':{'type':Sequelize[_0x8cf1('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x8cf1('0x4')](_0x8cf1('0x18'),'no')},'vmexten':{'type':Sequelize[_0x8cf1('0x2')]},'mohinterpret':{'type':Sequelize[_0x8cf1('0x2')]},'mohsuggest':{'type':Sequelize[_0x8cf1('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x8cf1('0x2')],'defaultValue':_0x8cf1('0x30')},'canreinvite':{'type':Sequelize[_0x8cf1('0x4')]('yes','no',_0x8cf1('0x31'),_0x8cf1('0x19'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8cf1('0x2')]},'otherFields':{'type':Sequelize[_0x8cf1('0x2')]},'active':{'type':Sequelize[_0x8cf1('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
index 2d8ee6f..392d2b6 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(_0x54820c,_0xd5a2f6){var _0x5c60c1=function(_0x495680){while(--_0x495680){_0x54820c['push'](_0x54820c['shift']());}};_0x5c60c1(++_0xd5a2f6);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4dd18b,_0x40ee5a){_0x4dd18b=_0x4dd18b-0x0;var _0x290a6e=_0x8d0e[_0x4dd18b];return _0x290a6e;};'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 _0x6aa7=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','clone','find','get','createdAt','body','omit','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','autoAssociation','update','utf8','server/files/templates/registry.ejs','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','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','jayson/promise','http','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order'];(function(_0x5bd0c9,_0x2d3dc9){var _0xce563d=function(_0x43a079){while(--_0x43a079){_0x5bd0c9['push'](_0x5bd0c9['shift']());}};_0xce563d(++_0x2d3dc9);}(_0x6aa7,0x178));var _0x76aa=function(_0x9e8375,_0x43daab){_0x9e8375=_0x9e8375-0x0;var _0x315660=_0x6aa7[_0x9e8375];return _0x315660;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76aa('0x19'));var client=jayson['client'][_0x76aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12dde0,_0x3f8f6b,_0x8e44ed,_0x10432c){return new BPromise(function(_0x4e309f,_0x5f5b59){var _0x2b3b4f=_0x10432c||client;return _0x2b3b4f['request'](_0x12dde0,_0x8e44ed)[_0x76aa('0x1b')](function(_0x319bf1){logger['info'](_0x76aa('0x1c'),_0x3f8f6b,'request\x20sent');logger[_0x76aa('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f8f6b,_0x76aa('0x1e'),JSON[_0x76aa('0x1f')](_0x319bf1));if(_0x319bf1[_0x76aa('0x20')]){if(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x20')]('Trunk,\x20%s,\x20%s',_0x3f8f6b,_0x319bf1['error'][_0x76aa('0x22')]);return _0x5f5b59(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);return _0x4e309f(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}else{logger['info'](_0x76aa('0x1c'),_0x3f8f6b,_0x76aa('0x1e'));_0x4e309f(_0x319bf1[_0x76aa('0x23')]['message']);}})[_0x76aa('0x24')](function(_0x189cb6){logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x189cb6);_0x5f5b59(_0x189cb6);});});}function respondWithStatusCode(_0x29c50c,_0xc1044c){_0xc1044c=_0xc1044c||0xcc;return function(_0x3cd039){if(_0x3cd039){return _0x29c50c[_0x76aa('0x25')](_0xc1044c);}return _0x29c50c[_0x76aa('0x26')](_0xc1044c)[_0x76aa('0x27')]();};}function respondWithResult(_0x37f1ab,_0x26b75e){_0x26b75e=_0x26b75e||0xc8;return function(_0x3599a9){if(_0x3599a9){return _0x37f1ab['status'](_0x26b75e)[_0x76aa('0x28')](_0x3599a9);}};}function respondWithFilteredResult(_0x1d6d15,_0x25c614){return function(_0x2e7ab4){if(_0x2e7ab4){var _0xa1e6=typeof _0x25c614[_0x76aa('0x29')]===_0x76aa('0x2a')&&typeof _0x25c614[_0x76aa('0x2b')]===_0x76aa('0x2a');var _0x1bdc3d=_0x2e7ab4['count'];var _0x3fcb7f=_0xa1e6?0x0:_0x25c614['offset'];var _0x994550=_0xa1e6?_0x2e7ab4[_0x76aa('0x2c')]:_0x25c614[_0x76aa('0x29')]+_0x25c614[_0x76aa('0x2b')];var _0x1eecd9;if(_0x994550>=_0x1bdc3d){_0x994550=_0x1bdc3d;_0x1eecd9=0xc8;}else{_0x1eecd9=0xce;}_0x1d6d15[_0x76aa('0x26')](_0x1eecd9);return _0x1d6d15[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x3fcb7f+'-'+_0x994550+'/'+_0x1bdc3d)[_0x76aa('0x28')](_0x2e7ab4);}return null;};}function patchUpdates(_0x3ea05a){return function(_0x5edcd8){try{jsonpatch[_0x76aa('0x2f')](_0x5edcd8,_0x3ea05a,!![]);}catch(_0x5532c7){return BPromise[_0x76aa('0x30')](_0x5532c7);}return _0x5edcd8[_0x76aa('0x31')]();};}function saveUpdates(_0x458ac3,_0x38ecd1){return function(_0x35a705){if(_0x35a705){return _0x35a705['update'](_0x458ac3)[_0x76aa('0x1b')](function(_0x25a11f){return _0x25a11f;});}return null;};}function removeEntity(_0x5a0f72,_0x2ee338){return function(_0x58d860){if(_0x58d860){return _0x58d860[_0x76aa('0x32')]()['then'](function(){var _0x8479a3=_0x58d860['get']({'plain':!![]});var _0x58f135=_0x76aa('0x33');return db[_0x76aa('0x34')][_0x76aa('0x32')]({'where':{'type':_0x58f135,'resourceId':_0x8479a3['id']}})[_0x76aa('0x1b')](function(){return _0x58d860;});})['then'](function(){_0x5a0f72['status'](0xcc)[_0x76aa('0x27')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x25')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x35')]);if(_0x5c77f1[_0x76aa('0x36')]){delete _0x5c77f1[_0x76aa('0x36')];}_0x5b57d8[_0x76aa('0x26')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x37')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=_[_0x76aa('0x38')](db[_0x76aa('0x39')][_0x76aa('0x3a')],function(_0x878903){return{'name':_0x878903[_0x76aa('0x3b')],'type':_0x878903[_0x76aa('0x3c')]['key']};});_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x38')](_0x2f7726,_0x76aa('0x36'));_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x1c22f7[_0x76aa('0x3e')]);_0x113770['filters']=_['intersection'](_0x113770[_0x76aa('0x3d')],_0x113770[_0x76aa('0x3e')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x113770['model'],qs[_0x76aa('0x42')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770['model'];if(!_0x1c22f7[_0x76aa('0x3e')]['hasOwnProperty']('nolimit')){_0x4e131a['limit']=qs[_0x76aa('0x2b')](_0x1c22f7['query']['limit']);_0x4e131a['offset']=qs[_0x76aa('0x29')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x29')]);}_0x4e131a[_0x76aa('0x43')]=qs[_0x76aa('0x44')](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x46')](_[_0x76aa('0x47')](_0x1c22f7[_0x76aa('0x3e')],_0x113770['filters']),_0x2f7726);if(_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]){_0x4e131a['where']=_[_0x76aa('0x49')](_0x4e131a['where'],{'$or':_[_0x76aa('0x38')](_0x2f7726,function(_0x24ea05){if(_0x24ea05[_0x76aa('0x3c')]!==_0x76aa('0x4a')){var _0x2d0bc4={};_0x2d0bc4[_0x24ea05[_0x76aa('0x36')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]+'%'};return _0x2d0bc4;}})});}_0x4e131a=_[_0x76aa('0x49')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4b')]);var _0x5e4967={'where':_0x4e131a[_0x76aa('0x45')]};return db['Trunk'][_0x76aa('0x2c')](_0x5e4967)[_0x76aa('0x1b')](function(_0x5e95f5){_0x1638db[_0x76aa('0x2c')]=_0x5e95f5;if(_0x1c22f7['query']['includeAll']){_0x4e131a[_0x76aa('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x76aa('0x4d')](_0x4e131a);})[_0x76aa('0x1b')](function(_0x4315b3){_0x1638db[_0x76aa('0x4e')]=_0x4315b3;return _0x1638db;})[_0x76aa('0x1b')](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x24')](handleError(_0x2eea79,null));};exports['show']=function(_0x564546,_0x2fcf8f){var _0x1eafb2={'raw':![],'where':{'id':_0x564546[_0x76aa('0x4f')]['id']}},_0x1708d4={};_0x1708d4[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x1708d4[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x564546['query']);_0x1708d4[_0x76aa('0x46')]=_['intersection'](_0x1708d4[_0x76aa('0x3d')],_0x1708d4['query']);_0x1eafb2[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x1708d4[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x564546[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x1eafb2[_0x76aa('0x40')]=_0x1eafb2['attributes'][_0x76aa('0x50')]?_0x1eafb2['attributes']:_0x1708d4[_0x76aa('0x3d')];if(_0x564546[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x1eafb2[_0x76aa('0x4c')]=[{'all':!![]}];}_0x1eafb2=_[_0x76aa('0x49')]({},_0x1eafb2,_0x564546[_0x76aa('0x4b')]);return db[_0x76aa('0x39')]['find'](_0x1eafb2)[_0x76aa('0x1b')](handleEntityNotFound(_0x2fcf8f,null))[_0x76aa('0x1b')](respondWithResult(_0x2fcf8f,null))[_0x76aa('0x24')](handleError(_0x2fcf8f,null));};exports[_0x76aa('0x52')]=function(_0x5c742c,_0xb9401b){var _0x163440={'where':{'id':_0x5c742c[_0x76aa('0x4f')]['id']}},_0x8dc601={};_0x8dc601[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x163440[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x8dc601[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x163440['attributes']=_0x163440['attributes'][_0x76aa('0x50')]?_0x163440[_0x76aa('0x40')]:_0x8dc601['model'];if(_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x163440['include']=[{'all':!![]}];}_0x163440=_[_0x76aa('0x49')]({},_0x163440,_0x5c742c[_0x76aa('0x4b')]);return db[_0x76aa('0x39')][_0x76aa('0x53')](_0x163440)[_0x76aa('0x1b')](handleEntityNotFound(_0xb9401b,null))[_0x76aa('0x1b')](function(_0x3376ec){if(_0x3376ec){var _0x30573a=_0x3376ec[_0x76aa('0x54')]({'plain':!![]});_0x30573a=qs['omit'](_0x30573a,['id',_0x76aa('0x55'),'updatedAt']);_0x5c742c[_0x76aa('0x56')]=_[_0x76aa('0x57')](_0x5c742c[_0x76aa('0x56')],['id',_0x76aa('0x55'),_0x76aa('0x58')]);return db[_0x76aa('0x39')][_0x76aa('0x59')](_[_0x76aa('0x49')](_0x30573a,_0x5c742c[_0x76aa('0x56')]),{'include':_0x5c742c['query'][_0x76aa('0x51')]?[{'all':!![]}]:undefined})[_0x76aa('0x1b')](function(_0x5c542b){var _0xe5957d=_0x5c742c[_0x76aa('0x5a')][_0x76aa('0x54')]({'plain':!![]});if(!_0xe5957d)throw new Error(_0x76aa('0x5b'));if(_0xe5957d[_0x76aa('0x5c')]==='user'){var _0x364d05=_0x5c542b['get']({'plain':!![]});var _0x35bd2b=_0x76aa('0x33');return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':_0x35bd2b,'userProfileId':_0xe5957d[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x2bfb46){if(_0x2bfb46&&_0x2bfb46['autoAssociation']===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x364d05['name'],'resourceId':_0x364d05['id'],'type':_0x2bfb46['name'],'sectionId':_0x2bfb46['id']},{})[_0x76aa('0x1b')](function(){return _0x5c542b;});}else{return _0x5c542b;}})[_0x76aa('0x24')](function(_0x5295a7){logger[_0x76aa('0x20')](_0x76aa('0x5f'),_0x5295a7);throw _0x5295a7;});}return _0x5c542b;});}})[_0x76aa('0x1b')](respondWithResult(_0xb9401b,0xc9))['catch'](handleError(_0xb9401b,null));};exports[_0x76aa('0x59')]=function(_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf;return db[_0x76aa('0x39')]['create'](_0x47f733['body'],{'raw':!![]})[_0x76aa('0x1b')](function(_0x4dfeb3){_0x2315cf=_0x4dfeb3;return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x43a2af){var _0x2dd320=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x63')),'utf8');var _0x7d02e7=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x557c11=ejs[_0x76aa('0x64')](_0x2dd320,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x65'),_0x557c11);if(_0x2315cf[_0x76aa('0x66')]){var _0x38faff=ejs[_0x76aa('0x64')](_0x7d02e7,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x67'),_0x38faff);}})['then'](function(){return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x59'),{'module':_0x76aa('0x69')});})[_0x76aa('0x1b')](function(){var _0x1037fb=_0x47f733['user'][_0x76aa('0x54')]({'plain':!![]});if(!_0x1037fb)throw new Error(_0x76aa('0x5b'));if(_0x1037fb[_0x76aa('0x5c')]===_0x76aa('0x5a')){var _0x32c1de=_0x2315cf[_0x76aa('0x54')]({'plain':!![]});return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1037fb[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x48136a){if(_0x48136a&&_0x48136a[_0x76aa('0x6a')]===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x32c1de[_0x76aa('0x36')],'resourceId':_0x32c1de['id'],'type':_0x48136a[_0x76aa('0x36')],'sectionId':_0x48136a['id']},{})[_0x76aa('0x1b')](function(){return _0x2315cf;});}else{return _0x2315cf;}})[_0x76aa('0x24')](function(_0x5dc923){logger[_0x76aa('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc923);throw _0x5dc923;});}return _0x2315cf;})['then'](respondWithResult(_0xf31e1f,0xc9))[_0x76aa('0x24')](handleError(_0xf31e1f,null));};exports[_0x76aa('0x6b')]=function(_0x5d8947,_0x5d1de1,_0x36da4d){var _0x14b5a2;return db[_0x76aa('0x39')]['find']({'where':{'id':_0x5d8947['params']['id']}})[_0x76aa('0x1b')](handleEntityNotFound(_0x5d1de1,null))[_0x76aa('0x1b')](saveUpdates(_0x5d8947[_0x76aa('0x56')],null))['then'](function(_0xb70589){if(_0xb70589){_0x14b5a2=_0xb70589;return db['Trunk'][_0x76aa('0x4d')]({'raw':!![]});}})[_0x76aa('0x1b')](function(_0x383290){if(_0x383290){var _0x325ffa=fs[_0x76aa('0x60')](path['join'](config['root'],_0x76aa('0x63')),_0x76aa('0x6c'));var _0x19ebb7=fs['readFileSync'](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x6d')),_0x76aa('0x6c'));var _0x303b78=ejs['render'](_0x325ffa,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x303b78);var _0x213f7f=ejs[_0x76aa('0x64')](_0x19ebb7,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x213f7f);return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x6b'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x547411){if(_0x547411){return _0x14b5a2;}})['then'](respondWithResult(_0x5d1de1,null))['catch'](handleError(_0x5d1de1,null));};exports[_0x76aa('0x32')]=function(_0x22f44f,_0x52c5be,_0x5c2c91){var _0x4f01e9;return db[_0x76aa('0x39')][_0x76aa('0x53')]({'where':{'id':_0x22f44f[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52c5be,null))['then'](removeEntity(_0x52c5be,null))[_0x76aa('0x1b')](function(){return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x354c7b){var _0x55e526=fs['readFileSync'](path[_0x76aa('0x61')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x4673e6=fs[_0x76aa('0x60')](path['join'](config[_0x76aa('0x62')],_0x76aa('0x6d')),'utf8');var _0x22063f=ejs[_0x76aa('0x64')](_0x55e526,{'trunks':_0x354c7b});var _0x11d91f=ejs[_0x76aa('0x64')](_0x4673e6,{'trunks':_0x354c7b});fs[_0x76aa('0x6e')](_0x76aa('0x65'),_0x22063f);fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x11d91f);return respondWithRpcPromise(_0x76aa('0x68'),'destroy',{'module':_0x76aa('0x69')});})[_0x76aa('0x24')](handleError(_0x52c5be,null));};
\ No newline at end of file
index d7f7777..c444f04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9ab=['moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','define','tools_trunks','util','api'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0xc9ab,0x1ac));var _0xbc9a=function(_0x93b8a0,_0x4cde66){_0x93b8a0=_0x93b8a0-0x0;var _0x5f1eeb=_0xc9ab[_0x93b8a0];return _0x5f1eeb;};'use strict';var _=require('lodash');var util=require(_0xbc9a('0x0'));var logger=require('../../config/logger')(_0xbc9a('0x1'));var moment=require(_0xbc9a('0x2'));var BPromise=require(_0xbc9a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc9a('0x4'));var rimraf=require(_0xbc9a('0x5'));var config=require(_0xbc9a('0x6'));var attributes=require(_0xbc9a('0x7'));module['exports']=function(_0xbd111e,_0x1fe416){return _0xbd111e[_0xbc9a('0x8')]('Trunk',attributes,{'tableName':_0xbc9a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9111=['./trunk.attributes','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x9111,0x1cb));var _0x1911=function(_0x55ba3e,_0x255a93){_0x55ba3e=_0x55ba3e-0x0;var _0x358c69=_0x9111[_0x55ba3e];return _0x358c69;};'use strict';var _=require(_0x1911('0x0'));var util=require(_0x1911('0x1'));var logger=require(_0x1911('0x2'))(_0x1911('0x3'));var moment=require(_0x1911('0x4'));var BPromise=require(_0x1911('0x5'));var rp=require(_0x1911('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1911('0x7'));var config=require(_0x1911('0x8'));var attributes=require(_0x1911('0x9'));module['exports']=function(_0x45fce3,_0x1135e1){return _0x45fce3[_0x1911('0xa')](_0x1911('0xb'),attributes,{'tableName':_0x1911('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d550424..fbcb8b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d4e=['then','ShowTrunk','find','info','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','Trunk,\x20%s,\x20%s','result','catch','GetTrunk','Trunk','options','where','attributes','map','include','model'];(function(_0x191b8d,_0x26d13b){var _0x414afd=function(_0x1fb46b){while(--_0x1fb46b){_0x191b8d['push'](_0x191b8d['shift']());}};_0x414afd(++_0x26d13b);}(_0x6d4e,0xaf));var _0xe6d4=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0x6d4e[_0x404cde];return _0x139882;};'use strict';var _=require(_0xe6d4('0x0'));var util=require(_0xe6d4('0x1'));var moment=require(_0xe6d4('0x2'));var BPromise=require(_0xe6d4('0x3'));var rs=require(_0xe6d4('0x4'));var fs=require('fs');var Redis=require(_0xe6d4('0x5'));var db=require(_0xe6d4('0x6'))['db'];var utils=require(_0xe6d4('0x7'));var logger=require(_0xe6d4('0x8'))('rpc');var config=require(_0xe6d4('0x9'));var jayson=require(_0xe6d4('0xa'));var client=jayson['client'][_0xe6d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x441381,_0x55a057,_0x15968e){return new BPromise(function(_0x20abf7,_0x28d873){return client[_0xe6d4('0xc')](_0x441381,_0x15968e)['then'](function(_0x1d1974){logger['info']('Trunk,\x20%s,\x20%s',_0x55a057,_0xe6d4('0xd'));logger[_0xe6d4('0xe')](_0xe6d4('0xf'),_0x55a057,'request\x20sent',JSON['stringify'](_0x1d1974));if(_0x1d1974[_0xe6d4('0x10')]){if(_0x1d1974['error']['code']===0x1f4){logger[_0xe6d4('0x10')]('Trunk,\x20%s,\x20%s',_0x55a057,_0x1d1974[_0xe6d4('0x10')][_0xe6d4('0x11')]);return _0x28d873(_0x1d1974[_0xe6d4('0x10')][_0xe6d4('0x11')]);}logger[_0xe6d4('0x10')](_0xe6d4('0x12'),_0x55a057,_0x1d1974[_0xe6d4('0x10')][_0xe6d4('0x11')]);return _0x20abf7(_0x1d1974[_0xe6d4('0x10')][_0xe6d4('0x11')]);}else{logger['info'](_0xe6d4('0x12'),_0x55a057,_0xe6d4('0xd'));_0x20abf7(_0x1d1974[_0xe6d4('0x13')][_0xe6d4('0x11')]);}})[_0xe6d4('0x14')](function(_0x1875ea){logger['error']('Trunk,\x20%s,\x20%s',_0x55a057,_0x1875ea);_0x28d873(_0x1875ea);});});}exports[_0xe6d4('0x15')]=function(_0x1006c2){var _0x33f0f2=this;return new Promise(function(_0x2a3a3e,_0x382846){return db[_0xe6d4('0x16')]['findAll']({'raw':_0x1006c2[_0xe6d4('0x17')]?_0x1006c2[_0xe6d4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1006c2[_0xe6d4('0x17')]?_0x1006c2['options'][_0xe6d4('0x18')]||null:null,'attributes':_0x1006c2[_0xe6d4('0x17')]?_0x1006c2[_0xe6d4('0x17')][_0xe6d4('0x19')]||null:null,'limit':_0x1006c2[_0xe6d4('0x17')]?_0x1006c2[_0xe6d4('0x17')]['limit']||null:null,'include':_0x1006c2[_0xe6d4('0x17')]?_0x1006c2['options']['include']?_[_0xe6d4('0x1a')](_0x1006c2['options'][_0xe6d4('0x1b')],function(_0x5c1fb0){return{'model':db[_0x5c1fb0[_0xe6d4('0x1c')]],'as':_0x5c1fb0['as'],'attributes':_0x5c1fb0[_0xe6d4('0x19')],'include':_0x5c1fb0[_0xe6d4('0x1b')]?_[_0xe6d4('0x1a')](_0x5c1fb0[_0xe6d4('0x1b')],function(_0x5e42c6){return{'model':db[_0x5e42c6[_0xe6d4('0x1c')]],'as':_0x5e42c6['as'],'attributes':_0x5e42c6[_0xe6d4('0x19')],'include':_0x5e42c6['include']?_[_0xe6d4('0x1a')](_0x5e42c6[_0xe6d4('0x1b')],function(_0x420299){return{'model':db[_0x420299[_0xe6d4('0x1c')]],'as':_0x420299['as'],'attributes':_0x420299['attributes']};}):[]};}):[]};}):[]:[]})[_0xe6d4('0x1d')](function(_0x3a5ff6){logger['info'](_0xe6d4('0x15'),_0x1006c2);logger[_0xe6d4('0xe')](_0xe6d4('0x15'),_0x1006c2,JSON['stringify'](_0x3a5ff6));_0x2a3a3e(_0x3a5ff6);})['catch'](function(_0x3c1bd8){logger[_0xe6d4('0x10')](_0xe6d4('0x15'),_0x3c1bd8[_0xe6d4('0x11')],_0x1006c2);_0x382846(_0x33f0f2[_0xe6d4('0x10')](0x1f4,_0x3c1bd8[_0xe6d4('0x11')]));});});};exports[_0xe6d4('0x1e')]=function(_0x49f169){var _0x44040f=this;return new Promise(function(_0x2f8777,_0x52d598){return db[_0xe6d4('0x16')][_0xe6d4('0x1f')]({'raw':_0x49f169[_0xe6d4('0x17')]?_0x49f169[_0xe6d4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x49f169[_0xe6d4('0x17')]?_0x49f169[_0xe6d4('0x17')][_0xe6d4('0x18')]||null:null,'attributes':_0x49f169[_0xe6d4('0x17')]?_0x49f169[_0xe6d4('0x17')]['attributes']||null:null,'include':_0x49f169[_0xe6d4('0x17')]?_0x49f169[_0xe6d4('0x17')][_0xe6d4('0x1b')]?_[_0xe6d4('0x1a')](_0x49f169[_0xe6d4('0x17')][_0xe6d4('0x1b')],function(_0x3e1519){return{'model':db[_0x3e1519['model']],'as':_0x3e1519['as'],'attributes':_0x3e1519[_0xe6d4('0x19')],'include':_0x3e1519[_0xe6d4('0x1b')]?_[_0xe6d4('0x1a')](_0x3e1519[_0xe6d4('0x1b')],function(_0xcd6abc){return{'model':db[_0xcd6abc[_0xe6d4('0x1c')]],'as':_0xcd6abc['as'],'attributes':_0xcd6abc[_0xe6d4('0x19')],'include':_0xcd6abc[_0xe6d4('0x1b')]?_[_0xe6d4('0x1a')](_0xcd6abc[_0xe6d4('0x1b')],function(_0x3996eb){return{'model':db[_0x3996eb[_0xe6d4('0x1c')]],'as':_0x3996eb['as'],'attributes':_0x3996eb[_0xe6d4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe6d4('0x1d')](function(_0x1829bf){logger[_0xe6d4('0x20')](_0xe6d4('0x1e'),_0x49f169);logger[_0xe6d4('0xe')]('ShowTrunk',_0x49f169,JSON[_0xe6d4('0x21')](_0x1829bf));_0x2f8777(_0x1829bf);})[_0xe6d4('0x14')](function(_0x186b57){logger['error'](_0xe6d4('0x1e'),_0x186b57[_0xe6d4('0x11')],_0x49f169);_0x52d598(_0x44040f[_0xe6d4('0x10')](0x1f4,_0x186b57[_0xe6d4('0x11')]));});});};
\ No newline at end of file
+var _0x40f0=['attributes','model','GetTrunk','debug','ShowTrunk','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll','options','raw','where','limit','map','include'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0x40f0,0x15a));var _0x040f=function(_0x4a9c91,_0xa777b6){_0x4a9c91=_0x4a9c91-0x0;var _0x2b5394=_0x40f0[_0x4a9c91];return _0x2b5394;};'use strict';var _=require(_0x040f('0x0'));var util=require(_0x040f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x040f('0x2'));var fs=require('fs');var Redis=require(_0x040f('0x3'));var db=require(_0x040f('0x4'))['db'];var utils=require(_0x040f('0x5'));var logger=require(_0x040f('0x6'))(_0x040f('0x7'));var config=require('../../config/environment');var jayson=require(_0x040f('0x8'));var client=jayson[_0x040f('0x9')][_0x040f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d7d43,_0x285ce9,_0x23f057){return new BPromise(function(_0xfb4594,_0x11ef7f){return client[_0x040f('0xb')](_0x3d7d43,_0x23f057)[_0x040f('0xc')](function(_0x3694f9){logger[_0x040f('0xd')](_0x040f('0xe'),_0x285ce9,_0x040f('0xf'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x285ce9,_0x040f('0xf'),JSON[_0x040f('0x10')](_0x3694f9));if(_0x3694f9[_0x040f('0x11')]){if(_0x3694f9['error'][_0x040f('0x12')]===0x1f4){logger[_0x040f('0x11')](_0x040f('0xe'),_0x285ce9,_0x3694f9[_0x040f('0x11')][_0x040f('0x13')]);return _0x11ef7f(_0x3694f9[_0x040f('0x11')][_0x040f('0x13')]);}logger[_0x040f('0x11')](_0x040f('0xe'),_0x285ce9,_0x3694f9['error']['message']);return _0xfb4594(_0x3694f9[_0x040f('0x11')][_0x040f('0x13')]);}else{logger['info'](_0x040f('0xe'),_0x285ce9,_0x040f('0xf'));_0xfb4594(_0x3694f9['result'][_0x040f('0x13')]);}})[_0x040f('0x14')](function(_0x46e81f){logger[_0x040f('0x11')](_0x040f('0xe'),_0x285ce9,_0x46e81f);_0x11ef7f(_0x46e81f);});});}exports['GetTrunk']=function(_0x5628c8){var _0x1e0290=this;return new Promise(function(_0x511a46,_0x4f4bc2){return db['Trunk'][_0x040f('0x15')]({'raw':_0x5628c8[_0x040f('0x16')]?_0x5628c8['options'][_0x040f('0x17')]===undefined?!![]:![]:!![],'where':_0x5628c8['options']?_0x5628c8[_0x040f('0x16')][_0x040f('0x18')]||null:null,'attributes':_0x5628c8[_0x040f('0x16')]?_0x5628c8[_0x040f('0x16')]['attributes']||null:null,'limit':_0x5628c8[_0x040f('0x16')]?_0x5628c8['options'][_0x040f('0x19')]||null:null,'include':_0x5628c8[_0x040f('0x16')]?_0x5628c8[_0x040f('0x16')]['include']?_[_0x040f('0x1a')](_0x5628c8[_0x040f('0x16')][_0x040f('0x1b')],function(_0x3611b4){return{'model':db[_0x3611b4['model']],'as':_0x3611b4['as'],'attributes':_0x3611b4[_0x040f('0x1c')],'include':_0x3611b4['include']?_[_0x040f('0x1a')](_0x3611b4[_0x040f('0x1b')],function(_0x4908b4){return{'model':db[_0x4908b4['model']],'as':_0x4908b4['as'],'attributes':_0x4908b4[_0x040f('0x1c')],'include':_0x4908b4[_0x040f('0x1b')]?_[_0x040f('0x1a')](_0x4908b4[_0x040f('0x1b')],function(_0x2a862f){return{'model':db[_0x2a862f[_0x040f('0x1d')]],'as':_0x2a862f['as'],'attributes':_0x2a862f[_0x040f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ded71){logger[_0x040f('0xd')](_0x040f('0x1e'),_0x5628c8);logger[_0x040f('0x1f')]('GetTrunk',_0x5628c8,JSON['stringify'](_0x3ded71));_0x511a46(_0x3ded71);})['catch'](function(_0x463999){logger[_0x040f('0x11')](_0x040f('0x1e'),_0x463999[_0x040f('0x13')],_0x5628c8);_0x4f4bc2(_0x1e0290[_0x040f('0x11')](0x1f4,_0x463999[_0x040f('0x13')]));});});};exports[_0x040f('0x20')]=function(_0x165ce6){var _0x2ea7b3=this;return new Promise(function(_0x5aee92,_0x407d70){return db['Trunk'][_0x040f('0x21')]({'raw':_0x165ce6['options']?_0x165ce6['options'][_0x040f('0x17')]===undefined?!![]:![]:!![],'where':_0x165ce6['options']?_0x165ce6[_0x040f('0x16')][_0x040f('0x18')]||null:null,'attributes':_0x165ce6[_0x040f('0x16')]?_0x165ce6['options'][_0x040f('0x1c')]||null:null,'include':_0x165ce6[_0x040f('0x16')]?_0x165ce6[_0x040f('0x16')][_0x040f('0x1b')]?_[_0x040f('0x1a')](_0x165ce6['options'][_0x040f('0x1b')],function(_0xae33a3){return{'model':db[_0xae33a3[_0x040f('0x1d')]],'as':_0xae33a3['as'],'attributes':_0xae33a3[_0x040f('0x1c')],'include':_0xae33a3[_0x040f('0x1b')]?_[_0x040f('0x1a')](_0xae33a3[_0x040f('0x1b')],function(_0x1eb2c7){return{'model':db[_0x1eb2c7['model']],'as':_0x1eb2c7['as'],'attributes':_0x1eb2c7[_0x040f('0x1c')],'include':_0x1eb2c7[_0x040f('0x1b')]?_[_0x040f('0x1a')](_0x1eb2c7[_0x040f('0x1b')],function(_0x427c80){return{'model':db[_0x427c80['model']],'as':_0x427c80['as'],'attributes':_0x427c80[_0x040f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59d702){logger[_0x040f('0xd')](_0x040f('0x20'),_0x165ce6);logger['debug'](_0x040f('0x20'),_0x165ce6,JSON['stringify'](_0x59d702));_0x5aee92(_0x59d702);})[_0x040f('0x14')](function(_0x4dd726){logger[_0x040f('0x11')](_0x040f('0x20'),_0x4dd726[_0x040f('0x13')],_0x165ce6);_0x407d70(_0x2ea7b3[_0x040f('0x11')](0x1f4,_0x4dd726[_0x040f('0x13')]));});});};
\ No newline at end of file
index 73e49b6..340cc3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x271a=['addSquareProjects','createApiKey','put','/:id/password','removeQueues','removeTeams','destroy','delete','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','describe','/whoami','whoami','/presence','isAuthenticated','getPresence','/:id','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/:id/contacts','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addSmsAccounts','/:id/chat_websites','addWhatsappAccounts','/:id/square_projects'];(function(_0x18bfcd,_0x19d23a){var _0x217d72=function(_0x1e2b13){while(--_0x1e2b13){_0x18bfcd['push'](_0x18bfcd['shift']());}};_0x217d72(++_0x19d23a);}(_0x271a,0x89));var _0xa271=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x271a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa271('0x0'));var util=require(_0xa271('0x1'));var path=require('path');var timeout=require(_0xa271('0x2'));var express=require('express');var router=express[_0xa271('0x3')]();var fs_extra=require(_0xa271('0x4'));var auth=require(_0xa271('0x5'));var interaction=require(_0xa271('0x6'));var config=require(_0xa271('0x7'));var controller=require(_0xa271('0x8'));router[_0xa271('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa271('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa271('0xa')]);router[_0xa271('0x9')](_0xa271('0xb'),auth['isAuthenticated'](),controller[_0xa271('0xc')]);router[_0xa271('0x9')](_0xa271('0xd'),auth[_0xa271('0xe')](),controller[_0xa271('0xf')]);router[_0xa271('0x9')](_0xa271('0x10'),auth[_0xa271('0xe')](),controller['show']);router[_0xa271('0x9')]('/:id/avatar',controller[_0xa271('0x11')]);router[_0xa271('0x9')](_0xa271('0x12'),auth[_0xa271('0xe')](),controller[_0xa271('0x13')]);router['get']('/:id/contacts',auth[_0xa271('0xe')](),controller[_0xa271('0x14')]);router[_0xa271('0x9')](_0xa271('0x15'),auth[_0xa271('0xe')](),controller[_0xa271('0x16')]);router[_0xa271('0x9')](_0xa271('0x17'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0xa271('0x9')](_0xa271('0x18'),auth['isAuthenticated'](),controller[_0xa271('0x19')]);router['get'](_0xa271('0x1a'),auth[_0xa271('0xe')](),controller[_0xa271('0x1b')]);router['get'](_0xa271('0x1c'),auth[_0xa271('0xe')](),controller[_0xa271('0x1d')]);router['get'](_0xa271('0x1e'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0xa271('0x9')]('/:id/openchannel/interactions',auth[_0xa271('0xe')](),controller[_0xa271('0x1f')]);router[_0xa271('0x9')](_0xa271('0x20'),auth[_0xa271('0xe')](),controller['getMailInteractions']);router[_0xa271('0x9')](_0xa271('0x21'),auth[_0xa271('0xe')](),controller[_0xa271('0x22')]);router['get'](_0xa271('0x23'),auth[_0xa271('0xe')](),controller['getFaxInteractions']);router['get'](_0xa271('0x24'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0xa271('0x9')](_0xa271('0x25'),auth[_0xa271('0xe')](),controller[_0xa271('0x26')]);router['get'](_0xa271('0x27'),auth['isAuthenticated'](),controller[_0xa271('0x28')]);router[_0xa271('0x9')](_0xa271('0x29'),auth['isAuthenticated'](),controller['getAgents']);router[_0xa271('0x9')](_0xa271('0x2a'),auth[_0xa271('0xe')](),controller[_0xa271('0x2b')]);router[_0xa271('0x9')]('/:id/fax_accounts',auth[_0xa271('0xe')](),controller['getFaxAccounts']);router['get'](_0xa271('0x2c'),auth['isAuthenticated'](),controller['getMailAccounts']);router['get'](_0xa271('0x2d'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xa271('0x9')](_0xa271('0x2e'),auth[_0xa271('0xe')](),controller[_0xa271('0x2f')]);router[_0xa271('0x9')]('/:id/chat_websites',auth[_0xa271('0xe')](),controller[_0xa271('0x30')]);router[_0xa271('0x9')](_0xa271('0x31'),auth[_0xa271('0xe')](),controller[_0xa271('0x32')]);router['get']('/:id/square_projects',auth[_0xa271('0xe')](),controller[_0xa271('0x33')]);router[_0xa271('0x9')](_0xa271('0x34'),auth[_0xa271('0xe')](),controller['getScheduledCalls']);router[_0xa271('0x9')](_0xa271('0x35'),auth['isAuthenticated'](),controller[_0xa271('0x36')]);router[_0xa271('0x37')](_0xa271('0x38'),auth[_0xa271('0xe')](),controller['addContacts']);router[_0xa271('0x37')]('/',auth[_0xa271('0xe')](),controller['create']);router[_0xa271('0x37')]('/create_many',auth[_0xa271('0xe')](),controller[_0xa271('0x39')]);router[_0xa271('0x37')]('/:id/queues',auth[_0xa271('0xe')](),controller[_0xa271('0x3a')]);var upload=multer({'storage':multer[_0xa271('0x3b')]({'destination':function(_0x40e779,_0x199554,_0x6f0037){_0x6f0037(null,path[_0xa271('0x3c')](config[_0xa271('0x3d')],_0xa271('0x3e')));},'filename':function(_0x3197de,_0x50efc1,_0x562fa2){_0x562fa2(null,util[_0xa271('0x3f')](_0xa271('0x40'),Date[_0xa271('0x41')](),_0x50efc1['originalname']));}})});router[_0xa271('0x37')](_0xa271('0x42'),upload[_0xa271('0x43')](_0xa271('0x44')),controller[_0xa271('0x45')]);router[_0xa271('0x37')](_0xa271('0x46'),auth[_0xa271('0xe')](),controller[_0xa271('0x47')]);router[_0xa271('0x37')](_0xa271('0x48'),auth[_0xa271('0xe')](),controller[_0xa271('0x49')]);router[_0xa271('0x37')](_0xa271('0x4a'),auth[_0xa271('0xe')](),controller[_0xa271('0x4b')]);router[_0xa271('0x37')]('/:id/unpause',auth[_0xa271('0xe')](),controller[_0xa271('0x4c')]);router[_0xa271('0x37')]('/:id/teams',auth[_0xa271('0xe')](),controller[_0xa271('0x4d')]);router[_0xa271('0x37')]('/:id/chat_interactions',auth[_0xa271('0xe')](),controller[_0xa271('0x4e')]);router[_0xa271('0x37')](_0xa271('0x4f'),auth['isAuthenticated'](),controller[_0xa271('0x50')]);router[_0xa271('0x37')](_0xa271('0x51'),auth[_0xa271('0xe')](),controller[_0xa271('0x52')]);router[_0xa271('0x37')](_0xa271('0x53'),auth[_0xa271('0xe')](),controller[_0xa271('0x54')]);router[_0xa271('0x37')]('/:id/openchannel_interactions',auth[_0xa271('0xe')](),controller['addOpenchannelInteractions']);router[_0xa271('0x37')](_0xa271('0x55'),auth[_0xa271('0xe')](),controller['addWhatsappInteractions']);router['post'](_0xa271('0x56'),auth[_0xa271('0xe')](),controller[_0xa271('0x57')]);router[_0xa271('0x37')](_0xa271('0x2c'),auth[_0xa271('0xe')](),controller[_0xa271('0x58')]);router[_0xa271('0x37')]('/:id/openchannel_accounts',auth[_0xa271('0xe')](),controller['addOpenchannelAccounts']);router[_0xa271('0x37')](_0xa271('0x2e'),auth[_0xa271('0xe')](),controller[_0xa271('0x59')]);router[_0xa271('0x37')](_0xa271('0x5a'),auth[_0xa271('0xe')](),controller['addChatWebsites']);router[_0xa271('0x37')]('/:id/whatsapp_accounts',auth[_0xa271('0xe')](),controller[_0xa271('0x5b')]);router[_0xa271('0x37')](_0xa271('0x5c'),auth[_0xa271('0xe')](),controller[_0xa271('0x5d')]);router[_0xa271('0x37')](_0xa271('0x35'),auth[_0xa271('0xe')](),controller[_0xa271('0x5e')]);router[_0xa271('0x5f')](_0xa271('0x10'),auth[_0xa271('0xe')](),controller['update']);router[_0xa271('0x5f')](_0xa271('0x60'),auth[_0xa271('0xe')](),controller['changePassword']);router['delete'](_0xa271('0x15'),auth['isAuthenticated'](),controller[_0xa271('0x61')]);router['delete'](_0xa271('0x25'),auth[_0xa271('0xe')](),controller[_0xa271('0x62')]);router['delete']('/:id',auth[_0xa271('0xe')](),controller[_0xa271('0x63')]);router[_0xa271('0x64')](_0xa271('0x65'),auth[_0xa271('0xe')](),controller[_0xa271('0x66')]);router[_0xa271('0x64')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xa271('0x67')]);router[_0xa271('0x64')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xa271('0x68')]);router[_0xa271('0x64')]('/:id/sms_interactions',auth[_0xa271('0xe')](),controller[_0xa271('0x69')]);router[_0xa271('0x64')](_0xa271('0x6a'),auth[_0xa271('0xe')](),controller[_0xa271('0x6b')]);router[_0xa271('0x64')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0xa271('0x6c')]);router['delete'](_0xa271('0x56'),auth[_0xa271('0xe')](),controller[_0xa271('0x6d')]);router[_0xa271('0x64')](_0xa271('0x2c'),auth['isAuthenticated'](),controller['removeMailAccounts']);router['delete'](_0xa271('0x2d'),auth[_0xa271('0xe')](),controller['removeOpenchannelAccounts']);router['delete']('/:id/sms_accounts',auth[_0xa271('0xe')](),controller[_0xa271('0x6e')]);router[_0xa271('0x64')](_0xa271('0x5a'),auth[_0xa271('0xe')](),controller[_0xa271('0x6f')]);router[_0xa271('0x64')](_0xa271('0x31'),auth[_0xa271('0xe')](),controller[_0xa271('0x70')]);router[_0xa271('0x64')](_0xa271('0x5c'),auth[_0xa271('0xe')](),controller['removeSquareProjects']);router[_0xa271('0x64')]('/:id/api_key',auth[_0xa271('0xe')](),controller[_0xa271('0x71')]);module[_0xa271('0x72')]=router;
\ No newline at end of file
+var _0xb3c6=['/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','/:id','show','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/api_key','getApiKey','post','addContacts','create','/create_many','addQueues','diskStorage','root','format','%s-%s','now','originalname','/:id/avatar','file','addAvatar'];(function(_0x3b73be,_0x2db174){var _0x388e65=function(_0x3f5659){while(--_0x3f5659){_0x3b73be['push'](_0x3b73be['shift']());}};_0x388e65(++_0x2db174);}(_0xb3c6,0x1a6));var _0x6b3c=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0xb3c6[_0x996bc8];return _0x20b0ea;};'use strict';var multer=require(_0x6b3c('0x0'));var util=require(_0x6b3c('0x1'));var path=require(_0x6b3c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b3c('0x3'));var router=express[_0x6b3c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6b3c('0x5'));var config=require(_0x6b3c('0x6'));var controller=require(_0x6b3c('0x7'));router[_0x6b3c('0x8')]('/',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0xa')]);router[_0x6b3c('0x8')](_0x6b3c('0xb'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0xc')]);router[_0x6b3c('0x8')](_0x6b3c('0xd'),auth['isAuthenticated'](),controller['whoami']);router['get'](_0x6b3c('0xe'),auth['isAuthenticated'](),controller[_0x6b3c('0xf')]);router[_0x6b3c('0x8')](_0x6b3c('0x10'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x11')]);router[_0x6b3c('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x6b3c('0x8')](_0x6b3c('0x12'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x13')]);router[_0x6b3c('0x8')](_0x6b3c('0x14'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x15')]);router[_0x6b3c('0x8')](_0x6b3c('0x16'),auth[_0x6b3c('0x9')](),controller['getQueues']);router[_0x6b3c('0x8')](_0x6b3c('0x17'),auth['isAuthenticated'](),controller[_0x6b3c('0x18')]);router['get'](_0x6b3c('0x19'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x1a')]);router[_0x6b3c('0x8')](_0x6b3c('0x1b'),auth['isAuthenticated'](),controller[_0x6b3c('0x1c')]);router[_0x6b3c('0x8')](_0x6b3c('0x1d'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x1e')]);router[_0x6b3c('0x8')](_0x6b3c('0x1f'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x20')]);router[_0x6b3c('0x8')](_0x6b3c('0x21'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x22')]);router[_0x6b3c('0x8')](_0x6b3c('0x23'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x24')]);router[_0x6b3c('0x8')]('/:id/sms/interactions',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x25')]);router[_0x6b3c('0x8')]('/:id/fax/interactions',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x26')]);router[_0x6b3c('0x8')](_0x6b3c('0x27'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x28')]);router[_0x6b3c('0x8')]('/:id/teams',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x29')]);router[_0x6b3c('0x8')](_0x6b3c('0x2a'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x2b')]);router[_0x6b3c('0x8')](_0x6b3c('0x2c'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x2d')]);router[_0x6b3c('0x8')](_0x6b3c('0x2e'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x2f')]);router['get']('/:id/fax_accounts',auth[_0x6b3c('0x9')](),controller['getFaxAccounts']);router['get'](_0x6b3c('0x30'),auth[_0x6b3c('0x9')](),controller['getMailAccounts']);router[_0x6b3c('0x8')](_0x6b3c('0x31'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x32')]);router['get'](_0x6b3c('0x33'),auth['isAuthenticated'](),controller[_0x6b3c('0x34')]);router[_0x6b3c('0x8')](_0x6b3c('0x35'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x36')]);router[_0x6b3c('0x8')]('/:id/whatsapp_accounts',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x37')]);router[_0x6b3c('0x8')](_0x6b3c('0x38'),auth['isAuthenticated'](),controller[_0x6b3c('0x39')]);router[_0x6b3c('0x8')]('/:id/scheduled_calls',auth[_0x6b3c('0x9')](),controller['getScheduledCalls']);router[_0x6b3c('0x8')](_0x6b3c('0x3a'),auth['isAuthenticated'](),controller[_0x6b3c('0x3b')]);router[_0x6b3c('0x3c')]('/:id/contacts',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x3d')]);router[_0x6b3c('0x3c')]('/',auth['isAuthenticated'](),controller[_0x6b3c('0x3e')]);router[_0x6b3c('0x3c')](_0x6b3c('0x3f'),auth[_0x6b3c('0x9')](),controller['bulkCreate']);router[_0x6b3c('0x3c')](_0x6b3c('0x16'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x40')]);var upload=multer({'storage':multer[_0x6b3c('0x41')]({'destination':function(_0x2b3410,_0x338234,_0x2c3c97){_0x2c3c97(null,path['join'](config[_0x6b3c('0x42')],'server/files/images/'));},'filename':function(_0x4702e6,_0x376009,_0xebd978){_0xebd978(null,util[_0x6b3c('0x43')](_0x6b3c('0x44'),Date[_0x6b3c('0x45')](),_0x376009[_0x6b3c('0x46')]));}})});router[_0x6b3c('0x3c')](_0x6b3c('0x47'),upload['single'](_0x6b3c('0x48')),controller[_0x6b3c('0x49')]);router[_0x6b3c('0x3c')](_0x6b3c('0x4a'),auth['isAuthenticated'](),controller[_0x6b3c('0x4b')]);router[_0x6b3c('0x3c')](_0x6b3c('0x4c'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x4d')]);router['post'](_0x6b3c('0x4e'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x4f')]);router[_0x6b3c('0x3c')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router[_0x6b3c('0x3c')](_0x6b3c('0x50'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x51')]);router[_0x6b3c('0x3c')](_0x6b3c('0x52'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x53')]);router[_0x6b3c('0x3c')]('/:id/mail_interactions',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x54')]);router[_0x6b3c('0x3c')](_0x6b3c('0x55'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x56')]);router['post'](_0x6b3c('0x57'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x58')]);router[_0x6b3c('0x3c')]('/:id/openchannel_interactions',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x59')]);router[_0x6b3c('0x3c')]('/:id/whatsapp_interactions',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x5a')]);router[_0x6b3c('0x3c')](_0x6b3c('0x5b'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x5c')]);router[_0x6b3c('0x3c')](_0x6b3c('0x30'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x5d')]);router[_0x6b3c('0x3c')](_0x6b3c('0x31'),auth[_0x6b3c('0x9')](),controller['addOpenchannelAccounts']);router[_0x6b3c('0x3c')](_0x6b3c('0x33'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x5e')]);router[_0x6b3c('0x3c')](_0x6b3c('0x35'),auth['isAuthenticated'](),controller[_0x6b3c('0x5f')]);router[_0x6b3c('0x3c')]('/:id/whatsapp_accounts',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x60')]);router[_0x6b3c('0x3c')](_0x6b3c('0x38'),auth[_0x6b3c('0x9')](),controller['addSquareProjects']);router[_0x6b3c('0x3c')](_0x6b3c('0x3a'),auth['isAuthenticated'](),controller[_0x6b3c('0x61')]);router['put'](_0x6b3c('0x10'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x62')]);router['put'](_0x6b3c('0x63'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x64')]);router[_0x6b3c('0x65')](_0x6b3c('0x16'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x66')]);router[_0x6b3c('0x65')](_0x6b3c('0x50'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x67')]);router[_0x6b3c('0x65')](_0x6b3c('0x10'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x68')]);router[_0x6b3c('0x65')]('/:id/chat_interactions',auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x69')]);router[_0x6b3c('0x65')](_0x6b3c('0x6a'),auth['isAuthenticated'](),controller[_0x6b3c('0x6b')]);router['delete'](_0x6b3c('0x55'),auth['isAuthenticated'](),controller[_0x6b3c('0x6c')]);router['delete'](_0x6b3c('0x57'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x6d')]);router[_0x6b3c('0x65')](_0x6b3c('0x6e'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x6f')]);router[_0x6b3c('0x65')](_0x6b3c('0x70'),auth['isAuthenticated'](),controller[_0x6b3c('0x71')]);router['delete'](_0x6b3c('0x5b'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x72')]);router[_0x6b3c('0x65')](_0x6b3c('0x30'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x73')]);router[_0x6b3c('0x65')](_0x6b3c('0x31'),auth['isAuthenticated'](),controller[_0x6b3c('0x74')]);router[_0x6b3c('0x65')](_0x6b3c('0x33'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x75')]);router[_0x6b3c('0x65')](_0x6b3c('0x35'),auth['isAuthenticated'](),controller[_0x6b3c('0x76')]);router[_0x6b3c('0x65')](_0x6b3c('0x77'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x78')]);router[_0x6b3c('0x65')](_0x6b3c('0x38'),auth['isAuthenticated'](),controller[_0x6b3c('0x79')]);router['delete'](_0x6b3c('0x3a'),auth[_0x6b3c('0x9')](),controller[_0x6b3c('0x7a')]);module[_0x6b3c('0x7b')]=router;
\ No newline at end of file
index 2669fb0..e5cb811 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f9=['TEXT','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlssetup','dtlsprivatekey','avpf','dtlsenable','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','exports','name','setDataValue','defaultuser','getDataValue','STRING','email','toLowerCase','ENUM','admin','user','agent','telephone','internal','format','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','certificate','active','passive','actpass','update,nonat'];(function(_0x4b6658,_0x15a721){var _0x3e311a=function(_0x51307b){while(--_0x51307b){_0x4b6658['push'](_0x4b6658['shift']());}};_0x3e311a(++_0x15a721);}(_0xb3f9,0x7a));var _0x9b3f=function(_0xab57c6,_0x340fa5){_0xab57c6=_0xab57c6-0x0;var _0x3571e8=_0xb3f9[_0xab57c6];return _0x3571e8;};'use strict';var Sequelize=require(_0x9b3f('0x0'));var moment=require(_0x9b3f('0x1'));var util=require('util');var _=require('lodash');module[_0x9b3f('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9b3f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x361db7){this[_0x9b3f('0x4')](_0x9b3f('0x3'),_0x361db7);this[_0x9b3f('0x4')](_0x9b3f('0x5'),_0x361db7);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x84df53){this[_0x9b3f('0x4')]('fullname',_0x84df53);this[_0x9b3f('0x4')]('callerid',util['format']('\x22%s\x22\x20<%s>',_0x84df53,this[_0x9b3f('0x6')]('internal')));}},'alias':{'type':Sequelize[_0x9b3f('0x7')]},'email':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':![],'unique':_0x9b3f('0x8'),'validate':{'isEmail':!![]},'set':function(_0x230b57){if(_0x230b57){this[_0x9b3f('0x4')]('email',_0x230b57[_0x9b3f('0x9')]());}}},'role':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0xb'),_0x9b3f('0xc'),_0x9b3f('0xd'),_0x9b3f('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9b3f('0x7')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9b3f('0xf'),'set':function(_0x2f9d90){this[_0x9b3f('0x4')](_0x9b3f('0xf'),_0x2f9d90);this[_0x9b3f('0x4')]('accountcode',_0x2f9d90);this['setDataValue']('callerid',util[_0x9b3f('0x10')](_0x9b3f('0x11'),this[_0x9b3f('0x6')](_0x9b3f('0x12')),_0x2f9d90));}},'salt':{'type':Sequelize[_0x9b3f('0x7')]},'phone':{'type':Sequelize[_0x9b3f('0x7')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x9b3f('0x7')]},'userpic':{'type':Sequelize[_0x9b3f('0x7')]},'city':{'type':Sequelize[_0x9b3f('0x7')]},'country':{'type':Sequelize[_0x9b3f('0x7')]},'online':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x9b3f('0x14')]},'voicePause':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9b3f('0x7')],'defaultValue':_0x9b3f('0x15')},'lastPauseAt':{'type':Sequelize[_0x9b3f('0x14')]},'chatCapacity':{'type':Sequelize[_0x9b3f('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9b3f('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9b3f('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9b3f('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9b3f('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9b3f('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![],'defaultValue':_0x9b3f('0x17')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x9b3f('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9b3f('0xa')]('friend',_0x9b3f('0xc'),'peer'),'allowNull':!![],'defaultValue':_0x9b3f('0x18')},'context':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![],'defaultValue':_0x9b3f('0x19')},'callingpres':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x1a'),'ALLOWED_PASSED_SCREEN',_0x9b3f('0x1b'),_0x9b3f('0x1c'),_0x9b3f('0x1d'),_0x9b3f('0x1e'),_0x9b3f('0x1f'),_0x9b3f('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9b3f('0x21'),'set':function(_0x4f3640){this[_0x9b3f('0x4')](_0x9b3f('0x22'),_0x4f3640?_0x4f3640[_0x9b3f('0x23')](','):null);},'get':function(){return this[_0x9b3f('0x6')](_0x9b3f('0x22'))?this['getDataValue'](_0x9b3f('0x22'))[_0x9b3f('0x24')](','):null;},'comment':_0x9b3f('0x25')},'dtmfmode':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x26'),_0x9b3f('0x27'),'shortinfo',_0x9b3f('0x28'),_0x9b3f('0x29')),'allowNull':!![],'defaultValue':_0x9b3f('0x26')},'directmedia':{'type':Sequelize['ENUM'](_0x9b3f('0x2a'),'no',_0x9b3f('0x2b'),_0x9b3f('0x2c'),_0x9b3f('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![],'defaultValue':_0x9b3f('0x2e'),'set':function(_0x3f4a1d){this[_0x9b3f('0x4')](_0x9b3f('0x2f'),_0x3f4a1d?_0x3f4a1d[_0x9b3f('0x23')](','):null);},'get':function(){return this[_0x9b3f('0x6')]('nat')?this[_0x9b3f('0x6')](_0x9b3f('0x2f'))[_0x9b3f('0x24')](','):null;},'comment':_0x9b3f('0x30')},'callgroup':{'type':Sequelize[_0x9b3f('0x7')]},'namedcallgroup':{'type':Sequelize[_0x9b3f('0x7')]},'pickupgroup':{'type':Sequelize[_0x9b3f('0x7')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9b3f('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9b3f('0x7')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9b3f('0x31')},'allow':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x13b6c4){this[_0x9b3f('0x4')](_0x9b3f('0x32'),_0x13b6c4?_0x13b6c4['join'](';'):_0x9b3f('0x33'));},'get':function(){return this[_0x9b3f('0x6')](_0x9b3f('0x32'))?this[_0x9b3f('0x6')](_0x9b3f('0x32'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x58e216){this[_0x9b3f('0x4')]('insecure',_0x58e216?_0x58e216[_0x9b3f('0x23')](','):null);},'get':function(){return this['getDataValue'](_0x9b3f('0x34'))?this['getDataValue']('insecure')[_0x9b3f('0x24')](','):null;},'comment':_0x9b3f('0x35')},'trustrpid':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9b3f('0xa')]('yes','no',_0x9b3f('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9b3f('0xa')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9b3f('0x37')},'amaflags':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x9b3f('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9b3f('0x2a'),'no',_0x9b3f('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x39'),_0x9b3f('0x3a'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x3b'),_0x9b3f('0x3c')),'allowNull':!![],'defaultValue':_0x9b3f('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x9b3f('0xa')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9b3f('0xa')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9b3f('0xa')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9b3f('0xa')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9b3f('0xa')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no','fingerprint',_0x9b3f('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x3e'),_0x9b3f('0x3f'),_0x9b3f('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x9b3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9b3f('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9b3f('0xa')](_0x9b3f('0x2a'),'no',_0x9b3f('0x2b'),'update',_0x9b3f('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x9b3f('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0x9b3f('0x14')]},'passwordResetAt':{'type':Sequelize[_0x9b3f('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x9b3f('0x42')]},'showWebBar':{'type':Sequelize[_0x9b3f('0x16')],'defaultValue':0x0,'set':function(_0x14c89b){this['setDataValue'](_0x9b3f('0x43'),_0x14c89b);var _0x4da3d6=this[_0x9b3f('0x44')]({'plain':!![]});switch(_0x14c89b){case 0x0:case 0x1:var _0x14457d=_0x4da3d6[_0x9b3f('0x22')]?_[_0x9b3f('0x45')](_0x4da3d6[_0x9b3f('0x22')])?_0x4da3d6[_0x9b3f('0x22')][_0x9b3f('0x23')]():_0x4da3d6[_0x9b3f('0x22')]:_0x9b3f('0x21');if(_0x14457d===_0x9b3f('0x46')){_0x14457d='udp';}this[_0x9b3f('0x4')](_0x9b3f('0x22'),_0x14457d);this[_0x9b3f('0x4')](_0x9b3f('0x47'),'no');this[_0x9b3f('0x4')]('avpf',null);this[_0x9b3f('0x4')](_0x9b3f('0x48'),null);this['setDataValue'](_0x9b3f('0x49'),null);this['setDataValue']('dtlsenable',null);this['setDataValue']('dtlsverify',null);this[_0x9b3f('0x4')](_0x9b3f('0x4a'),null);this['setDataValue']('dtlscertfile',null);this[_0x9b3f('0x4')](_0x9b3f('0x4b'),null);this[_0x9b3f('0x4')]('rtcp_mux','no');break;case 0x2:this[_0x9b3f('0x4')]('transport','wss');this['setDataValue']('encryption','yes');this[_0x9b3f('0x4')](_0x9b3f('0x4c'),_0x9b3f('0x2a'));this[_0x9b3f('0x4')](_0x9b3f('0x48'),_0x9b3f('0x2a'));this[_0x9b3f('0x4')]('icesupport',_0x9b3f('0x2a'));this[_0x9b3f('0x4')](_0x9b3f('0x4d'),_0x9b3f('0x2a'));this[_0x9b3f('0x4')]('dtlsverify','no');this['setDataValue'](_0x9b3f('0x4a'),_0x9b3f('0x40'));this['setDataValue'](_0x9b3f('0x4e'),_0x4da3d6[_0x9b3f('0x4e')]||_0x9b3f('0x4f'));this[_0x9b3f('0x4')](_0x9b3f('0x4b'),_0x4da3d6['dtlsprivatekey']||_0x9b3f('0x50'));this[_0x9b3f('0x4')](_0x9b3f('0x51'),_0x9b3f('0x2a'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x132b4e){this[_0x9b3f('0x4')](_0x9b3f('0x52'),_0x132b4e?_0x132b4e['join'](','):[]);},'get':function(){return this[_0x9b3f('0x6')]('permissions')?_[_0x9b3f('0x53')](this[_0x9b3f('0x6')](_0x9b3f('0x52'))[_0x9b3f('0x24')](','),function(_0x39fdb1){return parseInt(_0x39fdb1,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x9b3f('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9b3f('0x7')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9b3f('0x7')]},'phoneBarUnconditional':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x9b3f('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9b3f('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x9b3f('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9b3f('0x7')]},'phoneBarEnableJaws':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9b3f('0x54')],'get':function(){return this[_0x9b3f('0x6')](_0x9b3f('0x55'))?this['getDataValue'](_0x9b3f('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9b3f('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9b3f('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![],'set':function(_0x5b4efb){if(typeof _0x5b4efb===_0x9b3f('0x56')){var _0x5b87be=_0x5b4efb==='1'?!![]:_0x5b4efb==='0'?![]:_0x5b4efb===_0x9b3f('0x57')?!![]:_0x5b4efb===_0x9b3f('0x58')?![]:![];this['setDataValue'](_0x9b3f('0x59'),_0x5b87be);}else{this[_0x9b3f('0x4')](_0x9b3f('0x59'),_0x5b4efb);}}},'blocked':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':![],'set':function(_0x4471aa){this['setDataValue'](_0x9b3f('0x5a'),_0x4471aa);if(_0x4471aa===!![]){this[_0x9b3f('0x4')](_0x9b3f('0x5b'),moment());this[_0x9b3f('0x4')](_0x9b3f('0x5c'),0x0);}else{this[_0x9b3f('0x4')](_0x9b3f('0x5b'),null);}}},'blockedAt':{'type':Sequelize[_0x9b3f('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9b3f('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9b3f('0x16')](0x5)[_0x9b3f('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9b3f('0x13')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xa6b0=['setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','getDataValue','BOOLEAN','DATE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','map','permissions','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','exports','STRING','name'];(function(_0xd674fb,_0x3684e5){var _0x1449ba=function(_0x113bbb){while(--_0x113bbb){_0xd674fb['push'](_0xd674fb['shift']());}};_0x1449ba(++_0x3684e5);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x2fc41c,_0x37a491){_0x2fc41c=_0x2fc41c-0x0;var _0x78eded=_0xa6b0[_0x2fc41c];return _0x78eded;};'use strict';var Sequelize=require(_0x0a6b('0x0'));var moment=require(_0x0a6b('0x1'));var util=require('util');var _=require('lodash');module[_0x0a6b('0x2')]={'name':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'unique':_0x0a6b('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4c9a84){this[_0x0a6b('0x5')](_0x0a6b('0x4'),_0x4c9a84);this[_0x0a6b('0x5')](_0x0a6b('0x6'),_0x4c9a84);},'comment':_0x0a6b('0x7')},'fullname':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'set':function(_0x1b5fb5){this[_0x0a6b('0x5')](_0x0a6b('0x8'),_0x1b5fb5);this[_0x0a6b('0x5')](_0x0a6b('0x9'),util[_0x0a6b('0xa')]('\x22%s\x22\x20<%s>',_0x1b5fb5,this['getDataValue'](_0x0a6b('0xb'))));}},'alias':{'type':Sequelize[_0x0a6b('0x3')]},'email':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'unique':_0x0a6b('0xc'),'validate':{'isEmail':!![]},'set':function(_0x81a412){if(_0x81a412){this[_0x0a6b('0x5')](_0x0a6b('0xc'),_0x81a412[_0x0a6b('0xd')]());}}},'role':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0xf'),_0x0a6b('0x10'),_0x0a6b('0x11'),_0x0a6b('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':![],'unique':_0x0a6b('0xb'),'set':function(_0x2abc4e){this[_0x0a6b('0x5')](_0x0a6b('0xb'),_0x2abc4e);this[_0x0a6b('0x5')](_0x0a6b('0x14'),_0x2abc4e);this[_0x0a6b('0x5')](_0x0a6b('0x9'),util[_0x0a6b('0xa')]('\x22%s\x22\x20<%s>',this[_0x0a6b('0x15')](_0x0a6b('0x8')),_0x2abc4e));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a6b('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a6b('0x3')]},'zipcode':{'type':Sequelize[_0x0a6b('0x3')]},'userpic':{'type':Sequelize[_0x0a6b('0x3')]},'city':{'type':Sequelize[_0x0a6b('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a6b('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a6b('0x17')]},'chatCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a6b('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x0a6b('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x0a6b('0x19'),_0x0a6b('0x10'),_0x0a6b('0x1a')),'allowNull':!![],'defaultValue':_0x0a6b('0x19')},'context':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0x0a6b('0x1c'),_0x0a6b('0x1d'),'ALLOWED_FAILED_SCREEN',_0x0a6b('0x1e'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x0a6b('0x1f'),_0x0a6b('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x21'),'set':function(_0x235cc3){this[_0x0a6b('0x5')]('transport',_0x235cc3?_0x235cc3[_0x0a6b('0x22')](','):null);},'get':function(){return this[_0x0a6b('0x15')]('transport')?this['getDataValue'](_0x0a6b('0x23'))[_0x0a6b('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x25'),_0x0a6b('0x26'),_0x0a6b('0x27'),_0x0a6b('0x28'),_0x0a6b('0x29')),'allowNull':!![],'defaultValue':_0x0a6b('0x25')},'directmedia':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no',_0x0a6b('0x2b'),_0x0a6b('0x2c'),_0x0a6b('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x2e'),'set':function(_0x206612){this[_0x0a6b('0x5')](_0x0a6b('0x2f'),_0x206612?_0x206612[_0x0a6b('0x22')](','):null);},'get':function(){return this[_0x0a6b('0x15')](_0x0a6b('0x2f'))?this[_0x0a6b('0x15')]('nat')[_0x0a6b('0x24')](','):null;},'comment':_0x0a6b('0x30')},'callgroup':{'type':Sequelize[_0x0a6b('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a6b('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a6b('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a6b('0x3')]},'language':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a6b('0x3')]},'disallow':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'defaultValue':_0x0a6b('0x31'),'set':function(_0x3aa7d5){this[_0x0a6b('0x5')](_0x0a6b('0x32'),_0x3aa7d5?_0x3aa7d5[_0x0a6b('0x22')](';'):_0x0a6b('0x31'));},'get':function(){return this[_0x0a6b('0x15')](_0x0a6b('0x32'))?this['getDataValue'](_0x0a6b('0x32'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x2f1221){this[_0x0a6b('0x5')](_0x0a6b('0x33'),_0x2f1221?_0x2f1221['join'](','):null);},'get':function(){return this[_0x0a6b('0x15')]('insecure')?this['getDataValue'](_0x0a6b('0x33'))['split'](','):null;},'comment':_0x0a6b('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no',_0x0a6b('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x36')},'amaflags':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x0a6b('0x2a')},'busylevel':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no',_0x0a6b('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x38'),_0x0a6b('0x39'),_0x0a6b('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x3b'),'uas'),'allowNull':!![],'defaultValue':_0x0a6b('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x0a6b('0x2a')},'keepalive':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no','fingerprint',_0x0a6b('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x0a6b('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x0a6b('0x2b'),_0x0a6b('0x2c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x0a6b('0x17')]},'passwordResetAt':{'type':Sequelize[_0x0a6b('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a6b('0x3f')]},'showWebBar':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0,'set':function(_0x450a32){this['setDataValue'](_0x0a6b('0x40'),_0x450a32);var _0x34bebd=this[_0x0a6b('0x41')]({'plain':!![]});switch(_0x450a32){case 0x0:case 0x1:var _0x38974c=_0x34bebd['transport']?_[_0x0a6b('0x42')](_0x34bebd[_0x0a6b('0x23')])?_0x34bebd[_0x0a6b('0x23')][_0x0a6b('0x22')]():_0x34bebd[_0x0a6b('0x23')]:'udp';if(_0x38974c===_0x0a6b('0x43')){_0x38974c=_0x0a6b('0x21');}this[_0x0a6b('0x5')](_0x0a6b('0x23'),_0x38974c);this[_0x0a6b('0x5')](_0x0a6b('0x44'),'no');this[_0x0a6b('0x5')](_0x0a6b('0x45'),null);this['setDataValue'](_0x0a6b('0x46'),null);this[_0x0a6b('0x5')](_0x0a6b('0x47'),null);this[_0x0a6b('0x5')]('dtlsenable',null);this[_0x0a6b('0x5')](_0x0a6b('0x48'),null);this[_0x0a6b('0x5')](_0x0a6b('0x49'),null);this[_0x0a6b('0x5')](_0x0a6b('0x4a'),null);this[_0x0a6b('0x5')](_0x0a6b('0x4b'),null);this[_0x0a6b('0x5')](_0x0a6b('0x4c'),'no');break;case 0x2:this[_0x0a6b('0x5')](_0x0a6b('0x23'),_0x0a6b('0x43'));this[_0x0a6b('0x5')](_0x0a6b('0x44'),'yes');this['setDataValue'](_0x0a6b('0x45'),_0x0a6b('0x2a'));this['setDataValue'](_0x0a6b('0x46'),_0x0a6b('0x2a'));this[_0x0a6b('0x5')](_0x0a6b('0x47'),_0x0a6b('0x2a'));this[_0x0a6b('0x5')](_0x0a6b('0x4d'),_0x0a6b('0x2a'));this[_0x0a6b('0x5')](_0x0a6b('0x48'),'no');this[_0x0a6b('0x5')]('dtlssetup',_0x0a6b('0x4e'));this['setDataValue'](_0x0a6b('0x4a'),_0x34bebd[_0x0a6b('0x4a')]||_0x0a6b('0x4f'));this[_0x0a6b('0x5')](_0x0a6b('0x4b'),_0x34bebd[_0x0a6b('0x4b')]||_0x0a6b('0x50'));this['setDataValue'](_0x0a6b('0x4c'),_0x0a6b('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x0a6b('0x3f')],'set':function(_0x356d70){this[_0x0a6b('0x5')]('permissions',_0x356d70?_0x356d70[_0x0a6b('0x22')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x0a6b('0x51')](this[_0x0a6b('0x15')](_0x0a6b('0x52'))[_0x0a6b('0x24')](','),function(_0xec326b){return parseInt(_0xec326b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a6b('0x15')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a6b('0x15')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![],'set':function(_0x239be5){if(typeof _0x239be5===_0x0a6b('0x53')){var _0x571800=_0x239be5==='1'?!![]:_0x239be5==='0'?![]:_0x239be5===_0x0a6b('0x54')?!![]:_0x239be5==='false'?![]:![];this[_0x0a6b('0x5')](_0x0a6b('0x55'),_0x571800);}else{this[_0x0a6b('0x5')](_0x0a6b('0x55'),_0x239be5);}}},'blocked':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![],'set':function(_0x1374c3){this[_0x0a6b('0x5')](_0x0a6b('0x56'),_0x1374c3);if(_0x1374c3===!![]){this['setDataValue'](_0x0a6b('0x57'),moment());this['setDataValue'](_0x0a6b('0x58'),0x0);}else{this[_0x0a6b('0x5')](_0x0a6b('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x0a6b('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x0a6b('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]}};
\ No newline at end of file
index 8baf750..fbd5c24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e2=['validatePasswordHistory','previousPasswords','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','add','toLowerCase','ids','penalty','spread','QueueId','capitalize','Queue:save','voice','format','upsert','removeQueues','Unknown\x20channel','remove','emit','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','getContacts','CmContact','sort','pick','where','options','hasOwnProperty','List','Tags','tag','Queue','Queues','Unknown\x20role','nolimit','getVoiceQueuesRt','order','getGroups','getRecordings','VoiceRecording','getScreenRecordings','UserId','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','update','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','smsPause','whatsapppause','pauseType','QueuePause','manual','%s%s','Pause','getTeams','Team','addTeams','omit','getVoiceQueues','setDataValue','Voice','getChatQueues','Chat','getMailQueues','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','flatten','transaction','getDataValue','removeTeams','Mail','Openchannel','removeAgent','getLists','CmList','values','addChatInteractions','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$or','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notLike','$iLike','$notILike','$like','$overlap','$contained','$any','lastName','Contact','VoiceQueue','getApiKey','retrieveApiKey','json','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','getAgents','lower','col','toString','asc','desc','substring','uniqBy','orderBy','request','client','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','ringing','busy','slice','charAt','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','_interactions','OpenTabs','moment','util','lodash','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','then','info','User,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','destroy','get','admin','Users','user','Agents','agent','Telephones','filter','ignore','value','includes','role','find','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','password','salt','getOptions','User','includeAll','include','attributes','query','openTabs','length','push','chat','rows','dataValues','fax','mail','openchannel','whatsapp','all','catch','show','params','model','differenceBy','keys','filters','intersection','fields','merge','true','sms','body','addContacts','internal','Setting','securePassword','validatePasswordPattern','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','SELECT','from','voicemail','fullname','email','permissions','101','102','113','110','105','106','107','108','109','100','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','telephone','findAll','isEmpty','autoAssociation','map','compact','changePassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit'];(function(_0x43df70,_0x2642cd){var _0x2af77c=function(_0x5e89c4){while(--_0x5e89c4){_0x43df70['push'](_0x43df70['shift']());}};_0x2af77c(++_0x2642cd);}(_0xb7e2,0x103));var _0x2b7e=function(_0x1e3fd4,_0x4415a8){_0x1e3fd4=_0x1e3fd4-0x0;var _0x39ed11=_0xb7e2[_0x1e3fd4];return _0x39ed11;};'use strict';var moment=require(_0x2b7e('0x0'));var BPromise=require('bluebird');var util=require(_0x2b7e('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x2b7e('0x2'));var squel=require('squel');var jayson=require(_0x2b7e('0x3'));var Redis=require('ioredis');var authService=require(_0x2b7e('0x4'));var qs=require(_0x2b7e('0x5'));var logger=require(_0x2b7e('0x6'))(_0x2b7e('0x7'));var utils=require(_0x2b7e('0x8'));var config=require(_0x2b7e('0x9'));var licenseUtil=require('../../config/license/util');var db=require(_0x2b7e('0xa'))['db'];var socket=require(_0x2b7e('0xb'))(new Redis(config[_0x2b7e('0xc')]));require('./user.socket')[_0x2b7e('0xd')](socket);config[_0x2b7e('0xc')]=_[_0x2b7e('0xe')](config[_0x2b7e('0xc')],{'host':_0x2b7e('0xf'),'port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x1f08a3,_0x2ca5dd,_0x5e4eb4,_0x27d998){return new BPromise(function(_0x2e62be,_0x108a06){var _0x1792c7=_0x27d998||client;return _0x1792c7['request'](_0x1f08a3,_0x5e4eb4)[_0x2b7e('0x10')](function(_0x241b9c){logger[_0x2b7e('0x11')](_0x2b7e('0x12'),_0x2ca5dd,'request\x20sent');logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x2ca5dd,_0x2b7e('0x13'),JSON['stringify'](_0x241b9c));if(_0x241b9c[_0x2b7e('0x14')]){if(_0x241b9c['error'][_0x2b7e('0x15')]===0x1f4){logger['error'](_0x2b7e('0x12'),_0x2ca5dd,_0x241b9c[_0x2b7e('0x14')][_0x2b7e('0x16')]);return _0x108a06(_0x241b9c['error'][_0x2b7e('0x16')]);}logger[_0x2b7e('0x14')]('User,\x20%s,\x20%s',_0x2ca5dd,_0x241b9c[_0x2b7e('0x14')][_0x2b7e('0x16')]);return _0x2e62be(_0x241b9c[_0x2b7e('0x14')]['message']);}else{logger[_0x2b7e('0x11')](_0x2b7e('0x12'),_0x2ca5dd,_0x2b7e('0x13'));_0x2e62be(_0x241b9c[_0x2b7e('0x17')][_0x2b7e('0x16')]);}})['catch'](function(_0x3a1356){logger['error']('User,\x20%s,\x20%s',_0x2ca5dd,_0x3a1356);_0x108a06(_0x3a1356);});});}function respondWithStatusCode(_0x41c39b,_0x5dae66){_0x5dae66=_0x5dae66||0xcc;return function(_0x3ebfd6){if(_0x3ebfd6){return _0x41c39b[_0x2b7e('0x18')](_0x5dae66);}return _0x41c39b['status'](_0x5dae66)[_0x2b7e('0x19')]();};}function respondWithResult(_0x5988eb,_0x874ac8){_0x874ac8=_0x874ac8||0xc8;return function(_0x22b174){if(_0x22b174){return _0x5988eb['status'](_0x874ac8)['json'](_0x22b174);}};}function respondWithFilteredResult(_0x3548e3,_0x151e97){return function(_0x2b2863){if(_0x2b2863){var _0x6da48a=typeof _0x151e97[_0x2b7e('0x1a')]===_0x2b7e('0x1b')&&typeof _0x151e97[_0x2b7e('0x1c')]===_0x2b7e('0x1b');var _0x43e0bd=_0x2b2863[_0x2b7e('0x1d')];var _0x111892=_0x6da48a?0x0:_0x151e97[_0x2b7e('0x1a')];var _0x19824e=_0x6da48a?_0x2b2863[_0x2b7e('0x1d')]:_0x151e97['offset']+_0x151e97[_0x2b7e('0x1c')];var _0x18dd64;if(_0x19824e>=_0x43e0bd){_0x19824e=_0x43e0bd;_0x18dd64=0xc8;}else{_0x18dd64=0xce;}_0x3548e3[_0x2b7e('0x1e')](_0x18dd64);return _0x3548e3[_0x2b7e('0x1f')](_0x2b7e('0x20'),_0x111892+'-'+_0x19824e+'/'+_0x43e0bd)['json'](_0x2b2863);}return null;};}function saveUpdates(_0x2e4f7f){return function(_0x11cfd8){if(_0x11cfd8){return _0x11cfd8['update'](_0x2e4f7f)[_0x2b7e('0x10')](function(_0x5e3315){return _0x5e3315;});}return null;};}function removeEntity(_0x4128b6){return function(_0x585e25){if(_0x585e25){return _0x585e25[_0x2b7e('0x21')]()[_0x2b7e('0x10')](function(){var _0x1f6c89=_0x585e25[_0x2b7e('0x22')]({'plain':!![]});if(_0x1f6c89['role']===_0x2b7e('0x23'))return;var _0x4641a8=[{'name':_0x2b7e('0x24'),'value':_0x2b7e('0x25'),'ignore':!![]},{'name':_0x2b7e('0x26'),'value':_0x2b7e('0x27'),'ignore':![]},{'name':_0x2b7e('0x28'),'value':'telephone','ignore':![]}];var _0x33c0ed=_(_0x4641a8)[_0x2b7e('0x29')](_0x2b7e('0x2a'))['map']('value')[_0x2b7e('0x2b')]();if(_[_0x2b7e('0x2c')](_0x33c0ed,_0x1f6c89[_0x2b7e('0x2d')])){return;}var _0xcda41d=_[_0x2b7e('0x2e')](_0x4641a8,[_0x2b7e('0x2b'),_0x1f6c89[_0x2b7e('0x2d')]])['name'];return db[_0x2b7e('0x2f')][_0x2b7e('0x21')]({'where':{'type':_0xcda41d,'resourceId':_0x1f6c89['id']}})[_0x2b7e('0x10')](function(){return _0x585e25;});})[_0x2b7e('0x10')](function(){_0x4128b6[_0x2b7e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26a9f4){return function(_0x4f1574){if(!_0x4f1574){_0x26a9f4['sendStatus'](0x194);}return _0x4f1574;};}function handleError(_0x2b11f2,_0x54b7d9){_0x54b7d9=_0x54b7d9||0x1f4;return function(_0x21aa3d){logger['error'](_0x21aa3d[_0x2b7e('0x30')]);if(_0x21aa3d['name']){delete _0x21aa3d[_0x2b7e('0x31')];}_0x2b11f2[_0x2b7e('0x1e')](_0x54b7d9)[_0x2b7e('0x32')](_0x21aa3d);};}exports['index']=function(_0x2f6853,_0x2b6f0d){var _0x26c508={},_0x4dd071={'count':0x0,'rows':[]};var _0x558360=_(db['User'][_0x2b7e('0x33')])['map'](function(_0xf8712a){return{'name':_0xf8712a[_0x2b7e('0x34')],'type':_0xf8712a[_0x2b7e('0x35')]['key']};})[_0x2b7e('0x29')](function(_0x25a55a){return!_[_0x2b7e('0x2c')]([_0x2b7e('0x36'),_0x2b7e('0x37')],_0x25a55a['name']);})['value']();_0x26c508=qs[_0x2b7e('0x38')](_0x558360,_0x2f6853);var _0x55722c={'where':_0x26c508['where']};return db[_0x2b7e('0x39')]['count'](_0x55722c)[_0x2b7e('0x10')](function(_0x4f636a){_0x4dd071[_0x2b7e('0x1d')]=_0x4f636a;if(_0x2f6853['query'][_0x2b7e('0x3a')]){_0x26c508[_0x2b7e('0x3b')]=[{'all':!![]}];}if(!_['includes'](_0x26c508[_0x2b7e('0x3c')],'id')){_0x26c508[_0x2b7e('0x3c')]['push']('id');}return db[_0x2b7e('0x39')]['findAll'](_0x26c508);})[_0x2b7e('0x10')](function(_0x383d7f){_0x4dd071['rows']=_0x383d7f;if(_0x2f6853[_0x2b7e('0x3d')][_0x2b7e('0x3e')]==='true'){var _0x25df8d=[];for(var _0x7b5034=0x0;_0x7b5034<_0x4dd071['rows'][_0x2b7e('0x3f')];_0x7b5034++){_0x25df8d[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x41'),_0x4dd071[_0x2b7e('0x42')][_0x7b5034][_0x2b7e('0x43')]));_0x25df8d[_0x2b7e('0x40')](get_open_tabs('sms',_0x4dd071[_0x2b7e('0x42')][_0x7b5034][_0x2b7e('0x43')]));_0x25df8d[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x44'),_0x4dd071['rows'][_0x7b5034][_0x2b7e('0x43')]));_0x25df8d[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x45'),_0x4dd071['rows'][_0x7b5034][_0x2b7e('0x43')]));_0x25df8d['push'](get_open_tabs(_0x2b7e('0x46'),_0x4dd071[_0x2b7e('0x42')][_0x7b5034][_0x2b7e('0x43')]));_0x25df8d[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x47'),_0x4dd071[_0x2b7e('0x42')][_0x7b5034][_0x2b7e('0x43')]));}return BPromise[_0x2b7e('0x48')](_0x25df8d)['then'](function(_0x520eec){return _0x4dd071;});}else{return _0x4dd071;}})[_0x2b7e('0x10')](respondWithFilteredResult(_0x2b6f0d,_0x26c508))[_0x2b7e('0x49')](handleError(_0x2b6f0d,null));};exports[_0x2b7e('0x4a')]=function(_0x2d61f6,_0x399602){var _0xa405f9={'raw':![],'where':{'id':_0x2d61f6[_0x2b7e('0x4b')]['id']}},_0x42dd10={};_0x42dd10[_0x2b7e('0x4c')]=_[_0x2b7e('0x4d')](_[_0x2b7e('0x4e')](db[_0x2b7e('0x39')][_0x2b7e('0x33')]),[_0x2b7e('0x36'),_0x2b7e('0x37')]);_0x42dd10['query']=_['keys'](_0x2d61f6[_0x2b7e('0x3d')]);_0x42dd10[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x42dd10[_0x2b7e('0x4c')],_0x42dd10['query']);_0xa405f9[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x42dd10['model'],qs[_0x2b7e('0x51')](_0x2d61f6[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0xa405f9[_0x2b7e('0x3c')]=_0xa405f9[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0xa405f9['attributes']:_0x42dd10[_0x2b7e('0x4c')];if(_0x2d61f6[_0x2b7e('0x3d')][_0x2b7e('0x3a')]){_0xa405f9[_0x2b7e('0x3b')]=[{'all':!![]}];}_0xa405f9=_[_0x2b7e('0x52')]({},_0xa405f9,_0x2d61f6['options']);if(!_['includes'](_0xa405f9['attributes'],'id')){_0xa405f9[_0x2b7e('0x3c')][_0x2b7e('0x40')]('id');}return db[_0x2b7e('0x39')][_0x2b7e('0x2e')](_0xa405f9)['then'](handleEntityNotFound(_0x399602,null))['then'](function(_0x314402){var _0x531377=[];values=_0x314402;if(_0x2d61f6[_0x2b7e('0x3d')][_0x2b7e('0x3e')]===_0x2b7e('0x53')){_0x531377[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x41'),_0x314402[_0x2b7e('0x43')]));_0x531377[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x54'),_0x314402[_0x2b7e('0x43')]));_0x531377[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x46'),_0x314402[_0x2b7e('0x43')]));_0x531377['push'](get_open_tabs('whatsapp',_0x314402[_0x2b7e('0x43')]));_0x531377[_0x2b7e('0x40')](get_open_tabs('fax',_0x314402[_0x2b7e('0x43')]));_0x531377[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x45'),_0x314402[_0x2b7e('0x43')]));return BPromise[_0x2b7e('0x48')](_0x531377);}else{return values;}})[_0x2b7e('0x10')](function(_0x8881b6){return values;})[_0x2b7e('0x10')](respondWithResult(_0x399602,null))[_0x2b7e('0x49')](handleError(_0x399602,null));};exports['update']=function(_0x46bf1b,_0x371067){if(_0x46bf1b[_0x2b7e('0x55')]['id']){delete _0x46bf1b[_0x2b7e('0x55')]['id'];}delete _0x46bf1b[_0x2b7e('0x55')][_0x2b7e('0x2d')];return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x46bf1b[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x371067,null))[_0x2b7e('0x10')](saveUpdates(_0x46bf1b['body'],null))['then'](respondWithResult(_0x371067,null))[_0x2b7e('0x49')](handleError(_0x371067,null));};exports['describe']=function(_0x21cd0a,_0x42a529){return db[_0x2b7e('0x39')]['describe']()[_0x2b7e('0x10')](respondWithResult(_0x42a529,null))['catch'](handleError(_0x42a529,null));};exports['addContacts']=function(_0xee30f5,_0xd95de0){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0xee30f5['params']['id']}})['then'](handleEntityNotFound(_0xd95de0,null))[_0x2b7e('0x10')](function(_0x879152){if(_0x879152){return _0x879152[_0x2b7e('0x56')](_0xee30f5[_0x2b7e('0x55')]['ids'],_['omit'](_0xee30f5[_0x2b7e('0x55')],['ids','id'])||{});}})['then'](respondWithResult(_0xd95de0,null))[_0x2b7e('0x49')](handleError(_0xd95de0,null));};function validateUser(_0x41996e){return new BPromise(function(_0x2e7c19,_0x4a0e0c){if(_0x41996e[_0x2b7e('0x57')])return _0x2e7c19(_0x41996e);return db[_0x2b7e('0x58')]['findById'](0x1)['then'](function(_0x237d15){if(_0x237d15[_0x2b7e('0x59')])authService[_0x2b7e('0x5a')](_0x41996e[_0x2b7e('0x36')]);db['User']['max'](_0x2b7e('0x57'))[_0x2b7e('0x10')](function(_0x482e6f){if(_[_0x2b7e('0x5b')](_0x482e6f)){_0x41996e['internal']=_0x237d15[_0x2b7e('0x5c')]||0x1;return;}if(_[_0x2b7e('0x5b')](_0x237d15[_0x2b7e('0x5c')])||_0x237d15['min_internal']===_0x482e6f){_0x41996e['internal']=_0x482e6f+0x1;return;}if(_0x237d15[_0x2b7e('0x5c')]>_0x482e6f){_0x41996e[_0x2b7e('0x57')]=_0x237d15['min_internal'];return;}return db['sequelize'][_0x2b7e('0x3d')](_0x2b7e('0x5d'),{'type':db[_0x2b7e('0x5e')]['QueryTypes'][_0x2b7e('0x5f')]})[_0x2b7e('0x10')](function(_0x3a96fe){if(_0x3a96fe&&_0x3a96fe[_0x2b7e('0x3f')]){for(var _0x4f6ee8=0x0,_0x21de08=_0x3a96fe[_0x2b7e('0x3f')];_0x4f6ee8<_0x21de08&&_['isNil'](_0x41996e[_0x2b7e('0x57')]);_0x4f6ee8++){if(_0x237d15[_0x2b7e('0x5c')]<=_0x3a96fe[_0x4f6ee8][_0x2b7e('0x60')]){_0x41996e[_0x2b7e('0x57')]=_0x3a96fe[_0x4f6ee8]['from'];}else if(_0x237d15[_0x2b7e('0x5c')]>_0x3a96fe[_0x4f6ee8][_0x2b7e('0x60')]&&_0x237d15['min_internal']<=_0x3a96fe[_0x4f6ee8]['to']){_0x41996e[_0x2b7e('0x57')]=_0x237d15['min_internal'];}}}if(_['isNil'](_0x41996e[_0x2b7e('0x57')])){_0x41996e[_0x2b7e('0x57')]=_0x482e6f+0x1;}return _0x2e7c19(_0x41996e);});});})[_0x2b7e('0x49')](function(_0x15639f){_0x4a0e0c(_0x15639f);});});}function updateUser(_0x1e9081){return new BPromise(function(_0x4721dd,_0x522df2){try{if(_0x1e9081[_0x2b7e('0x61')]){_0x1e9081['mailbox']=_0x1e9081[_0x2b7e('0x57')];_0x1e9081['VoiceMail']={'mailbox':_0x1e9081[_0x2b7e('0x57')],'password':_0x1e9081['password'],'fullname':_0x1e9081[_0x2b7e('0x62')],'email':_0x1e9081[_0x2b7e('0x63')]};}if(_0x1e9081[_0x2b7e('0x2d')]===_0x2b7e('0x27')){if(!_0x1e9081[_0x2b7e('0x64')])_0x1e9081[_0x2b7e('0x64')]=[_0x2b7e('0x65'),_0x2b7e('0x66'),'103',_0x2b7e('0x67'),_0x2b7e('0x68'),'104',_0x2b7e('0x69'),_0x2b7e('0x6a'),_0x2b7e('0x6b'),_0x2b7e('0x6c'),_0x2b7e('0x6d'),_0x2b7e('0x6e'),'111','114','115'];}_0x4721dd(_0x1e9081);}catch(_0x7b01c6){_0x522df2(_0x7b01c6);}});}exports[_0x2b7e('0x6f')]=function(_0xec68cf,_0x33b952){if(_0xec68cf[_0x2b7e('0x25')][_0x2b7e('0x2d')]===_0x2b7e('0x27'))throw new Error(_0x2b7e('0x70'));if(_0xec68cf[_0x2b7e('0x55')][_0x2b7e('0x2d')]===_0x2b7e('0x25')&&_0xec68cf[_0x2b7e('0x25')][_0x2b7e('0x2d')]!==_0x2b7e('0x23')){throw new Error(_0x2b7e('0x71'));}if(_0xec68cf[_0x2b7e('0x55')]['role']===_0x2b7e('0x23')&&_0xec68cf['user'][_0x2b7e('0x2d')]!==_0x2b7e('0x23')){throw new Error(_0x2b7e('0x72'));}return licenseUtil[_0x2b7e('0x73')]([_0xec68cf[_0x2b7e('0x55')]])['then'](function(){return validateUser(_0xec68cf[_0x2b7e('0x55')]);})[_0x2b7e('0x10')](function(_0x3cb1f7){return updateUser(_0x3cb1f7)[_0x2b7e('0x10')](function(_0x100bed){if(_0x100bed[_0x2b7e('0x2d')]==='admin'){_0x100bed['settingsEnabled']=_0xec68cf[_0x2b7e('0x25')][_0x2b7e('0x74')];delete _0x100bed[_0x2b7e('0x75')];}return _0x100bed;});})[_0x2b7e('0x10')](function(_0x42bfb5){return db['User'][_0x2b7e('0x6f')](_0x42bfb5,{'include':[{'model':db[_0x2b7e('0x76')],'as':_0x2b7e('0x76')}]});})['then'](function(_0x166f66){if(_0xec68cf[_0x2b7e('0x55')]['role']==='user')return _0x166f66;if(_0xec68cf[_0x2b7e('0x25')]['role']!==_0x2b7e('0x25'))return _0x166f66;return db[_0x2b7e('0x77')][_0x2b7e('0x2e')]({'where':{'name':_0x166f66[_0x2b7e('0x2d')]===_0x2b7e('0x27')?_0x2b7e('0x26'):'Telephones','userProfileId':_0xec68cf[_0x2b7e('0x25')]['userProfileId']},'raw':!![]})[_0x2b7e('0x10')](function(_0x40246d){if(!_0x40246d||_0x40246d['autoAssociation']!=0x0)return _0x166f66;return db[_0x2b7e('0x2f')][_0x2b7e('0x6f')]({'name':_0x166f66[_0x2b7e('0x31')],'resourceId':_0x166f66['id'],'type':_0x40246d[_0x2b7e('0x31')],'sectionId':_0x40246d['id']},{})[_0x2b7e('0x10')](function(){return _0x166f66;});})[_0x2b7e('0x49')](function(_0x5930f8){logger[_0x2b7e('0x14')](_0x2b7e('0x78'),_0x5930f8);throw _0x5930f8;});})[_0x2b7e('0x10')](respondWithResult(_0x33b952,0xc9))[_0x2b7e('0x49')](handleError(_0x33b952,null));};exports[_0x2b7e('0x79')]=function(_0x3ae17d,_0x187604){var _0x54348a=_0x3ae17d[_0x2b7e('0x55')];var _0x398f8c=[];if(_0x3ae17d[_0x2b7e('0x25')][_0x2b7e('0x2d')]===_0x2b7e('0x27'))throw new Error(_0x2b7e('0x70'));if(_[_0x2b7e('0x7a')](_0x54348a,[_0x2b7e('0x2d'),_0x2b7e('0x25')])&&_0x3ae17d[_0x2b7e('0x25')][_0x2b7e('0x2d')]!==_0x2b7e('0x23')){throw new Error(_0x2b7e('0x71'));}if(_['some'](_0x54348a,[_0x2b7e('0x2d'),_0x2b7e('0x23')])&&_0x3ae17d[_0x2b7e('0x25')][_0x2b7e('0x2d')]!==_0x2b7e('0x23')){throw new Error(_0x2b7e('0x7b'));}return licenseUtil['checkUserLimits'](_0x54348a)['then'](function(){return validateUser(_0x54348a[0x0]);})['then'](function(){for(var _0x559d=0x1;_0x559d<_0x54348a['length'];_0x559d++){var _0x2e6e48=_0x54348a[_0x559d-0x1][_0x2b7e('0x57')];if(!_0x54348a[_0x559d]['internal'])_0x54348a[_0x559d][_0x2b7e('0x57')]=_0x2e6e48+0x1;_0x398f8c['push'](validateUser(_0x54348a[_0x559d]));}return BPromise[_0x2b7e('0x48')](_0x398f8c);})[_0x2b7e('0x10')](function(){_0x398f8c=[];for(var _0x298b42=0x0;_0x298b42<_0x54348a[_0x2b7e('0x3f')];_0x298b42++){_0x398f8c[_0x2b7e('0x40')](updateUser(_0x54348a[_0x298b42]));}return BPromise[_0x2b7e('0x48')](_0x398f8c);})[_0x2b7e('0x10')](function(){return BPromise[_0x2b7e('0x7c')](_0x54348a,function(_0x5320d9){return db['User']['create'](_0x5320d9,{'include':[{'model':db[_0x2b7e('0x76')],'as':'VoiceMail'}]})[_0x2b7e('0x10')](function(_0xc352c){_0x5320d9['id']=_0xc352c['id'];return _0x5320d9;});});})[_0x2b7e('0x10')](function(_0x2b98ea){if(_0x3ae17d[_0x2b7e('0x55')][_0x2b7e('0x2d')]===_0x2b7e('0x25'))return _0x2b98ea;if(_0x3ae17d[_0x2b7e('0x25')][_0x2b7e('0x2d')]!==_0x2b7e('0x25'))return _0x2b98ea;var _0x3be0eb=_[_0x2b7e('0x7a')](_0x2b98ea,function(_0x591944){return _0x591944[_0x2b7e('0x2d')]===_0x2b7e('0x27')||_0x591944[_0x2b7e('0x2d')]===_0x2b7e('0x7d');});if(!_0x3be0eb)return _0x2b98ea;return db['UserProfileSection'][_0x2b7e('0x7e')]({'where':{'name':{'$or':[_0x2b7e('0x26'),'Telephones']},'userProfileId':_0x3ae17d[_0x2b7e('0x25')][_0x2b7e('0x75')]},'raw':!![]})[_0x2b7e('0x10')](function(_0x406ad7){if(_[_0x2b7e('0x7f')](_0x406ad7)||!_['some'](_0x406ad7,[_0x2b7e('0x80'),0x0]))return _0x2b98ea;_0x398f8c=[];var _0x422fff=_(_0x406ad7)[_0x2b7e('0x81')](function(_0x4b13b0){if(_0x4b13b0[_0x2b7e('0x80')]===0x1)return;return _0x4b13b0[_0x2b7e('0x31')]===_0x2b7e('0x26')?'agent':_0x2b7e('0x7d');})[_0x2b7e('0x82')]()['value']();for(var _0x565f4e=0x0;_0x565f4e<_0x2b98ea[_0x2b7e('0x3f')];_0x565f4e++){if(!_['includes'](_0x422fff,_0x2b98ea[_0x565f4e][_0x2b7e('0x2d')]))return;var _0x5d9e0e=_0x2b98ea[_0x565f4e][_0x2b7e('0x2d')]===_0x2b7e('0x27')?'Agents':_0x2b7e('0x28');_0x398f8c[_0x2b7e('0x40')](db['UserProfileResource']['create']({'name':_0x2b98ea[_0x565f4e]['name'],'resourceId':_0x2b98ea[_0x565f4e]['id'],'type':_0x5d9e0e,'sectionId':_[_0x2b7e('0x2e')](_0x406ad7,[_0x2b7e('0x31'),_0x5d9e0e])['id']},{}));}return BPromise[_0x2b7e('0x48')](_0x398f8c);});})[_0x2b7e('0x10')](respondWithResult(_0x187604,0xc9))[_0x2b7e('0x49')](handleError(_0x187604,null));};exports[_0x2b7e('0x83')]=function(_0x53b5ce,_0x10e9ce){if(_0x53b5ce[_0x2b7e('0x55')]['id']){delete _0x53b5ce[_0x2b7e('0x55')]['id'];}return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x53b5ce[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](function(_0x565e37){if(!_0x565e37)return null;if(_0x565e37['id']===_0x53b5ce[_0x2b7e('0x25')]['id']){if(!_0x53b5ce[_0x2b7e('0x55')]['oldPassword']||!_0x53b5ce[_0x2b7e('0x55')]['newPassword']){throw new db[(_0x2b7e('0x84'))][(_0x2b7e('0x85'))](_0x2b7e('0x86'));}if(!_0x565e37[_0x2b7e('0x87')](_0x53b5ce[_0x2b7e('0x55')][_0x2b7e('0x88')])){throw new db['Sequelize'][(_0x2b7e('0x85'))]('Wrong\x20credentials');}if(_0x53b5ce[_0x2b7e('0x55')][_0x2b7e('0x88')]===_0x53b5ce['body'][_0x2b7e('0x89')]){throw new db[(_0x2b7e('0x84'))]['ValidationError'](_0x2b7e('0x8a'));}}else if(_0x53b5ce[_0x2b7e('0x25')][_0x2b7e('0x2d')]===_0x2b7e('0x23')){if(!_0x53b5ce['body'][_0x2b7e('0x89')]){throw new db[(_0x2b7e('0x84'))][(_0x2b7e('0x85'))](_0x2b7e('0x8b'));}}else if(_0x53b5ce[_0x2b7e('0x25')][_0x2b7e('0x2d')]===_0x2b7e('0x25')){if(!_0x53b5ce['body'][_0x2b7e('0x89')]){throw new db[(_0x2b7e('0x84'))]['ValidationError'](_0x2b7e('0x8b'));}if(_0x565e37['role']!==_0x2b7e('0x27')){throw new db[(_0x2b7e('0x84'))]['ValidationError'](_0x2b7e('0x70'));}}else{throw new db[(_0x2b7e('0x84'))][(_0x2b7e('0x85'))](_0x2b7e('0x70'));}return _0x565e37;})['then'](handleEntityNotFound(_0x10e9ce,null))[_0x2b7e('0x10')](function(_0x135139){return db[_0x2b7e('0x58')][_0x2b7e('0x8c')]({'attributes':['id','securePassword',_0x2b7e('0x8d'),_0x2b7e('0x8e')]})['then'](function(_0x3955a5){if(_0x3955a5['securePassword'])authService[_0x2b7e('0x5a')](_0x53b5ce['body']['newPassword']);if(!_0x3955a5[_0x2b7e('0x8d')]||!_0x135139['previousPasswords'])return _0x135139;authService[_0x2b7e('0x8f')](_0x53b5ce[_0x2b7e('0x55')][_0x2b7e('0x89')],_0x135139[_0x2b7e('0x90')],_0x3955a5[_0x2b7e('0x8e')]);return _0x135139;})[_0x2b7e('0x10')](saveUpdates({'password':_0x53b5ce['body'][_0x2b7e('0x89')],'passwordResetAt':_0x53b5ce[_0x2b7e('0x25')]['id']==_0x53b5ce['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x53b5ce[_0x2b7e('0x55')][_0x2b7e('0x89')],_0x135139[_0x2b7e('0x90')])},null));})[_0x2b7e('0x10')](respondWithResult(_0x10e9ce,null))[_0x2b7e('0x49')](handleError(_0x10e9ce,null));};exports[_0x2b7e('0x91')]=function(_0x259ea7,_0x48db1e){var _0x45a06c=_0x259ea7[_0x2b7e('0x55')][_0x2b7e('0x92')];return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x259ea7['params']['id']},'attributes':['id',_0x2b7e('0x31'),'role',_0x2b7e('0x93'),_0x2b7e('0x94'),_0x2b7e('0x95'),_0x2b7e('0x96')]})[_0x2b7e('0x10')](handleEntityNotFound(_0x48db1e,null))[_0x2b7e('0x10')](function(_0x4c50dc){if(_0x4c50dc){if(!utils[_0x2b7e('0x97')](_0x45a06c)){throw new db[(_0x2b7e('0x84'))][(_0x2b7e('0x85'))]('Unknown\x20channel');}return _0x4c50dc[_0x2b7e('0x98')+_['capitalize'](_0x45a06c[_0x2b7e('0x99')]())+'Queues'](_0x259ea7[_0x2b7e('0x55')][_0x2b7e('0x9a')],{'penalty':_0x259ea7[_0x2b7e('0x55')][_0x2b7e('0x9b')]||0x0})[_0x2b7e('0x9c')](function(_0x2d9da4){for(var _0x214b0d=0x0;_0x214b0d<_0x259ea7[_0x2b7e('0x55')][_0x2b7e('0x9a')][_0x2b7e('0x3f')];_0x214b0d+=0x1){var _0x4f9949={'UserId':Number(_0x259ea7[_0x2b7e('0x4b')]['id'])};_0x4f9949[_['capitalize'](_0x45a06c[_0x2b7e('0x99')]())+_0x2b7e('0x9d')]=Number(_0x259ea7[_0x2b7e('0x55')][_0x2b7e('0x9a')][_0x214b0d]);socket['emit'](_0x2b7e('0x25')+_[_0x2b7e('0x9e')](_0x45a06c['toLowerCase']())+_0x2b7e('0x9f'),_0x4f9949);}return _0x2d9da4;})[_0x2b7e('0x10')](function(){if(_0x45a06c===_0x2b7e('0xa0')){return db['VoiceQueue'][_0x2b7e('0x7e')]({'where':{'id':_0x259ea7[_0x2b7e('0x55')][_0x2b7e('0x9a')]||[]},'raw':!![],'attributes':['id',_0x2b7e('0x31')]});}})['then'](function(_0x56d668){var _0x223d66=_0x4c50dc[_0x2b7e('0x22')]({'plain':!![]});var _0x29d102=[];if(_0x45a06c===_0x2b7e('0xa0')&&_0x223d66[_0x2b7e('0x2d')]===_0x2b7e('0x27')&&_0x223d66[_0x2b7e('0x93')]){for(var _0x4e2c8c=0x0;_0x4e2c8c<_0x56d668[_0x2b7e('0x3f')];_0x4e2c8c+=0x1){_0x29d102[_0x2b7e('0x40')]({'membername':_0x223d66['name'],'UserId':_0x223d66['id'],'queue_name':_0x56d668[_0x4e2c8c][_0x2b7e('0x31')],'VoiceQueueId':_0x56d668[_0x4e2c8c]['id'],'interface':_[_0x2b7e('0x5b')](_0x223d66[_0x2b7e('0x96')])?util[_0x2b7e('0xa1')]('SIP/%s',_0x223d66['name']):_0x223d66[_0x2b7e('0x96')],'paused':_0x223d66[_0x2b7e('0x95')]||![],'penalty':_0x259ea7[_0x2b7e('0x55')][_0x2b7e('0x9b')]||0x0});}return BPromise['each'](_0x29d102,function(_0x422b07){return db['UserVoiceQueueRt'][_0x2b7e('0xa2')](_0x422b07);});}return _0x4c50dc;});}})['then'](respondWithStatusCode(_0x48db1e,null))[_0x2b7e('0x49')](handleError(_0x48db1e,null));};exports[_0x2b7e('0xa3')]=function(_0x57e38d,_0x2d97f3){var _0x45b2be;return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x57e38d[_0x2b7e('0x4b')]['id']},'attributes':['id',_0x2b7e('0x31'),_0x2b7e('0x2d')]})[_0x2b7e('0x10')](handleEntityNotFound(_0x2d97f3,null))['then'](function(_0x42d34c){if(_0x42d34c){_0x45b2be=_0x42d34c;if(!_0x57e38d[_0x2b7e('0x3d')][_0x2b7e('0x92')]||!utils['isValidChannel'](_0x57e38d[_0x2b7e('0x3d')][_0x2b7e('0x92')])){throw new db[(_0x2b7e('0x84'))][(_0x2b7e('0x85'))](_0x2b7e('0xa4'));}return _0x42d34c[_0x2b7e('0xa5')+_[_0x2b7e('0x9e')](_0x57e38d['query']['channel'][_0x2b7e('0x99')]())+'Queues'](_0x57e38d[_0x2b7e('0x3d')][_0x2b7e('0x9a')]);}})[_0x2b7e('0x10')](function(_0x5c97a1){if(_['isArray'](_0x57e38d[_0x2b7e('0x3d')][_0x2b7e('0x9a')])){for(var _0x20bc4=0x0;_0x20bc4<_0x57e38d[_0x2b7e('0x3d')][_0x2b7e('0x9a')][_0x2b7e('0x3f')];_0x20bc4+=0x1){var _0x409f00={'UserId':Number(_0x57e38d['params']['id'])};_0x409f00[_[_0x2b7e('0x9e')](_0x57e38d['query'][_0x2b7e('0x92')][_0x2b7e('0x99')]())+'QueueId']=Number(_0x57e38d[_0x2b7e('0x3d')][_0x2b7e('0x9a')][_0x20bc4]);socket[_0x2b7e('0xa6')](_0x2b7e('0x25')+_['capitalize'](_0x57e38d[_0x2b7e('0x3d')]['channel']['toLowerCase']())+_0x2b7e('0xa7'),_0x409f00);}}else{var _0x409f00={'UserId':Number(_0x57e38d[_0x2b7e('0x4b')]['id'])};_0x409f00[_[_0x2b7e('0x9e')](_0x57e38d['query'][_0x2b7e('0x92')][_0x2b7e('0x99')]())+_0x2b7e('0x9d')]=Number(_0x57e38d['query']['ids']);socket[_0x2b7e('0xa6')](_0x2b7e('0x25')+_['capitalize'](_0x57e38d[_0x2b7e('0x3d')][_0x2b7e('0x92')][_0x2b7e('0x99')]())+_0x2b7e('0xa7'),_0x409f00);}return _0x5c97a1;})[_0x2b7e('0x10')](function(){if(_0x57e38d[_0x2b7e('0x3d')][_0x2b7e('0x92')]===_0x2b7e('0xa0')){return db[_0x2b7e('0xa8')]['destroy']({'where':{'UserId':_0x57e38d[_0x2b7e('0x4b')]['id'],'VoiceQueueId':_0x57e38d['query']['ids']},'individualHooks':!![]})[_0x2b7e('0x10')](function(){return _0x45b2be;});}return _0x45b2be;})[_0x2b7e('0x10')](respondWithStatusCode(_0x2d97f3,null))[_0x2b7e('0x49')](handleError(_0x2d97f3,null));};exports[_0x2b7e('0xa9')]=function(_0x36b435,_0xef291c){_0x36b435[_0x2b7e('0x55')][_0x2b7e('0xaa')]=_0x36b435[_0x2b7e('0xab')][_0x2b7e('0xac')];return db[_0x2b7e('0x39')]['find']({'where':{'id':_0x36b435[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0xef291c,null))['then'](saveUpdates(_0x36b435[_0x2b7e('0x55')],null))[_0x2b7e('0x10')](respondWithResult(_0xef291c,null))[_0x2b7e('0x49')](handleError(_0xef291c,null));};exports['getAvatar']=function(_0x22ff7a,_0x2d9551){var _0x5d5fc0=path[_0x2b7e('0xad')](config[_0x2b7e('0xae')],_0x2b7e('0xaf'));return db[_0x2b7e('0x39')]['find']({'where':{'id':_0x22ff7a[_0x2b7e('0x4b')]['id']},'attributes':['id',_0x2b7e('0xaa')],'raw':!![]})[_0x2b7e('0x10')](handleEntityNotFound(_0x2d9551,null))[_0x2b7e('0x10')](function(_0x1a3b6b){if(_0x1a3b6b){if(_['isNil'](_0x1a3b6b[_0x2b7e('0xaa')])){return _0x2d9551[_0x2b7e('0xb0')](_0x5d5fc0);}else{if(!fs[_0x2b7e('0xb1')](path['join'](config[_0x2b7e('0xae')],'server/files/images/',_0x1a3b6b[_0x2b7e('0xaa')]))){return _0x2d9551['download'](_0x5d5fc0);}return _0x2d9551[_0x2b7e('0xb0')](path[_0x2b7e('0xad')](config[_0x2b7e('0xae')],'server/files/images/',_0x1a3b6b[_0x2b7e('0xaa')]));}}})[_0x2b7e('0x49')](handleError(_0x2d9551,null));};exports[_0x2b7e('0xb2')]=function(_0x5e37a4,_0x229a2f){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x5e37a4[_0x2b7e('0x4b')]['id']},'attributes':['id']})[_0x2b7e('0x10')](handleEntityNotFound(_0x229a2f,null))[_0x2b7e('0x10')](function(_0x39a7dd){var _0x1ac4f9=[];values=_0x39a7dd[_0x2b7e('0x43')];_0x1ac4f9[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x41'),_0x39a7dd[_0x2b7e('0x43')]));_0x1ac4f9['push'](get_open_tabs(_0x2b7e('0x54'),_0x39a7dd[_0x2b7e('0x43')]));_0x1ac4f9[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x46'),_0x39a7dd['dataValues']));_0x1ac4f9[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x47'),_0x39a7dd[_0x2b7e('0x43')]));_0x1ac4f9[_0x2b7e('0x40')](get_open_tabs(_0x2b7e('0x44'),_0x39a7dd[_0x2b7e('0x43')]));_0x1ac4f9[_0x2b7e('0x40')](get_open_tabs('mail',_0x39a7dd[_0x2b7e('0x43')]));return BPromise['all'](_0x1ac4f9);})[_0x2b7e('0x10')](function(_0x28c66a){var _0xda4527=[];if(_0x28c66a){for(var _0x324b5e=0x0;_0x324b5e<values[_0x2b7e('0xb3')][_0x2b7e('0x3f')];_0x324b5e++){var _0x7cd115=values['ChatOpenTabs'][_0x324b5e];_0xda4527['push']({'channel':_0x2b7e('0xb4'),'id':_0x7cd115['id'],'createdAt':_0x7cd115[_0x2b7e('0xb5')]});}for(var _0x324b5e=0x0;_0x324b5e<values[_0x2b7e('0xb6')]['length'];_0x324b5e++){var _0x7cd115=values[_0x2b7e('0xb6')][_0x324b5e];_0xda4527[_0x2b7e('0x40')]({'channel':'FAX','id':_0x7cd115['id'],'createdAt':_0x7cd115[_0x2b7e('0xb5')]});}for(var _0x324b5e=0x0;_0x324b5e<values[_0x2b7e('0xb7')][_0x2b7e('0x3f')];_0x324b5e++){var _0x7cd115=values[_0x2b7e('0xb7')][_0x324b5e];_0xda4527[_0x2b7e('0x40')]({'channel':_0x2b7e('0xb8'),'id':_0x7cd115['id'],'createdAt':_0x7cd115[_0x2b7e('0xb5')]});}for(var _0x324b5e=0x0;_0x324b5e<values[_0x2b7e('0xb9')][_0x2b7e('0x3f')];_0x324b5e++){var _0x7cd115=values['MailOpenTabs'][_0x324b5e];_0xda4527[_0x2b7e('0x40')]({'channel':_0x2b7e('0xba'),'id':_0x7cd115['id'],'createdAt':_0x7cd115[_0x2b7e('0xb5')]});}for(var _0x324b5e=0x0;_0x324b5e<values[_0x2b7e('0xbb')][_0x2b7e('0x3f')];_0x324b5e++){var _0x7cd115=values[_0x2b7e('0xbb')][_0x324b5e];_0xda4527[_0x2b7e('0x40')]({'channel':_0x2b7e('0xbc'),'id':_0x7cd115['id'],'createdAt':_0x7cd115[_0x2b7e('0xb5')]});}for(var _0x324b5e=0x0;_0x324b5e<values['WhatsappOpenTabs'][_0x2b7e('0x3f')];_0x324b5e++){var _0x7cd115=values['WhatsappOpenTabs'][_0x324b5e];_0xda4527[_0x2b7e('0x40')]({'channel':'WHATSAPP','id':_0x7cd115['id'],'createdAt':_0x7cd115[_0x2b7e('0xb5')]});}var _0x467f0d={'count':_0xda4527[_0x2b7e('0x3f')],'rows':_0xda4527};return _0x467f0d;}else return null;})['then'](respondWithResult(_0x229a2f,null))[_0x2b7e('0x49')](handleError(_0x229a2f,null));};exports[_0x2b7e('0xbd')]=function(_0xa0e232,_0x42da2b){var _0x2e32da={};var _0x23b7a6={};var _0xcad1ac;var _0x385df6;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0xa0e232['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x42da2b,null))['then'](function(_0x506d77){if(_0x506d77){_0xcad1ac=_0x506d77;_0x23b7a6[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0xbe')]['rawAttributes']);_0x23b7a6[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0xa0e232[_0x2b7e('0x3d')]);_0x23b7a6[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x23b7a6['model'],_0x23b7a6[_0x2b7e('0x3d')]);_0x2e32da[_0x2b7e('0x3c')]=_['intersection'](_0x23b7a6[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0xa0e232[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x2e32da['attributes']=_0x2e32da['attributes']['length']?_0x2e32da[_0x2b7e('0x3c')]:_0x23b7a6[_0x2b7e('0x4c')];_0x2e32da['order']=qs[_0x2b7e('0xbf')](_0xa0e232[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x2e32da['where']=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0xa0e232[_0x2b7e('0x3d')],_0x23b7a6[_0x2b7e('0x4f')]));if(_0xa0e232[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x2e32da[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x2e32da[_0x2b7e('0xc1')],{'$or':_['map'](_0x2e32da[_0x2b7e('0x3c')],function(_0x593c45){var _0x127ee4={};_0x127ee4[_0x593c45]={'$like':'%'+_0xa0e232[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x127ee4;})});}_0x2e32da=_['merge']({},_0x2e32da,_0xa0e232[_0x2b7e('0xc2')]);return _0xcad1ac[_0x2b7e('0xbd')](_0x2e32da);}})[_0x2b7e('0x10')](function(_0x3e7f36){if(_0x3e7f36){_0x385df6=_0x3e7f36[_0x2b7e('0x3f')];if(_0xa0e232['query'][_0x2b7e('0xc3')](_0x2b7e('0x3a'))){_0x2e32da[_0x2b7e('0x3b')]=[{'model':db['CmList'],'as':_0x2b7e('0xc4'),'required':![]},{'model':db['Tag'],'as':_0x2b7e('0xc5'),'attributes':['id','name','color'],'where':_0xa0e232[_0x2b7e('0x3d')][_0x2b7e('0xc6')]?{'id':_0xa0e232[_0x2b7e('0x3d')][_0x2b7e('0xc6')]}:undefined,'required':_0xa0e232[_0x2b7e('0x3d')]['tag']?!![]:![]}];}if(!_0xa0e232['query'][_0x2b7e('0xc3')]('nolimit')){_0x2e32da[_0x2b7e('0x1c')]=qs['limit'](_0xa0e232[_0x2b7e('0x3d')]['limit']);_0x2e32da[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0xa0e232['query'][_0x2b7e('0x1a')]);}return _0xcad1ac[_0x2b7e('0xbd')](_0x2e32da);}})[_0x2b7e('0x10')](function(_0x21689b){if(_0x21689b){return _0x21689b?{'count':_0x385df6,'rows':_0x21689b}:null;}})['then'](respondWithResult(_0x42da2b,null))[_0x2b7e('0x49')](handleError(_0x42da2b,null));};exports['getQueues']=function(_0x48a3a0,_0x436953){var _0x3fea5e;var _0x434402;var _0x1eb5eb={};var _0x48b715;return db['User'][_0x2b7e('0x8c')]({'where':{'id':_0x48a3a0[_0x2b7e('0x4b')]['id']},'attributes':['id',_0x2b7e('0x31'),'role']})[_0x2b7e('0x10')](handleEntityNotFound(_0x436953,null))[_0x2b7e('0x10')](function(_0x131c72){if(!utils[_0x2b7e('0x97')](_0x48a3a0[_0x2b7e('0x3d')][_0x2b7e('0x92')])){throw new db[(_0x2b7e('0x84'))][(_0x2b7e('0x85'))]('Unknown\x20channel');}_0x3fea5e=_0x131c72;var _0x405400={};_0x405400[_0x2b7e('0x4c')]=_['keys'](db[_[_0x2b7e('0x9e')](_0x48a3a0[_0x2b7e('0x3d')]['channel'])+_0x2b7e('0xc7')][_0x2b7e('0x33')]);_0x405400[_0x2b7e('0x3d')]=_['keys'](_0x48a3a0['query']);_0x405400[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x405400[_0x2b7e('0x4c')],_0x405400[_0x2b7e('0x3d')]);_0x1eb5eb['attributes']=_[_0x2b7e('0x50')](_0x405400['model'],qs['fields'](_0x48a3a0[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x1eb5eb[_0x2b7e('0x3c')]=_0x1eb5eb['attributes'][_0x2b7e('0x3f')]?_0x1eb5eb[_0x2b7e('0x3c')]:_0x405400['model'];_0x1eb5eb['order']=qs[_0x2b7e('0xbf')](_0x48a3a0[_0x2b7e('0x3d')]['sort']);_0x1eb5eb[_0x2b7e('0xc1')]=qs['filters'](_[_0x2b7e('0xc0')](_0x48a3a0['query'],_0x405400[_0x2b7e('0x4f')]));if(_0x48a3a0[_0x2b7e('0x3d')]['filter']){_0x1eb5eb['where']=_['merge'](_0x1eb5eb['where'],{'$or':_[_0x2b7e('0x81')](_0x1eb5eb['attributes'],function(_0x53a668){var _0x30c0f3={};_0x30c0f3[_0x53a668]={'$like':'%'+_0x48a3a0[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x30c0f3;})});}_0x1eb5eb=_[_0x2b7e('0x52')]({},_0x1eb5eb,_0x48a3a0[_0x2b7e('0xc2')]);switch(_0x3fea5e['role']){case _0x2b7e('0x23'):return db[_[_0x2b7e('0x9e')](_0x48a3a0[_0x2b7e('0x3d')][_0x2b7e('0x92')])+_0x2b7e('0xc7')][_0x2b7e('0x7e')](_0x1eb5eb);case _0x2b7e('0x25'):case'agent':return _0x3fea5e['get'+_[_0x2b7e('0x9e')](_0x48a3a0[_0x2b7e('0x3d')]['channel'])+_0x2b7e('0xc8')](_0x1eb5eb);default:throw new db['Sequelize'][(_0x2b7e('0x85'))](_0x2b7e('0xc9'));}})[_0x2b7e('0x10')](function(_0x2e4a52){_0x48b715=_0x2e4a52[_0x2b7e('0x3f')];if(!_0x48a3a0[_0x2b7e('0x3d')]['hasOwnProperty'](_0x2b7e('0xca'))){_0x1eb5eb[_0x2b7e('0x1c')]=qs['limit'](_0x48a3a0[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x1eb5eb[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x48a3a0[_0x2b7e('0x3d')]['offset']);}switch(_0x3fea5e[_0x2b7e('0x2d')]){case _0x2b7e('0x23'):return db[_[_0x2b7e('0x9e')](_0x48a3a0['query']['channel'])+'Queue'][_0x2b7e('0x7e')](_0x1eb5eb);case'user':case'agent':return _0x3fea5e['get'+_[_0x2b7e('0x9e')](_0x48a3a0['query'][_0x2b7e('0x92')])+'Queues'](_0x1eb5eb);}})[_0x2b7e('0x10')](function(_0x3371ae){return{'count':_0x48b715,'rows':_0x3371ae};})[_0x2b7e('0x10')](respondWithResult(_0x436953,null))[_0x2b7e('0x49')](handleError(_0x436953,null));};exports[_0x2b7e('0xcb')]=function(_0x5ca6e9,_0x4feea3){var _0x4a0eac={};var _0x1edb42={};var _0x4c8d44;var _0x22d8b8;return db[_0x2b7e('0x39')]['findOne']({'where':{'id':_0x5ca6e9['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x4feea3,null))[_0x2b7e('0x10')](function(_0x451ace){if(_0x451ace){_0x4c8d44=_0x451ace;_0x1edb42[_0x2b7e('0x4c')]=_['keys'](db['UserVoiceQueueRt'][_0x2b7e('0x33')]);_0x1edb42['query']=_['keys'](_0x5ca6e9[_0x2b7e('0x3d')]);_0x1edb42['filters']=_[_0x2b7e('0x50')](_0x1edb42[_0x2b7e('0x4c')],_0x1edb42['query']);_0x4a0eac[_0x2b7e('0x3c')]=_['intersection'](_0x1edb42['model'],qs[_0x2b7e('0x51')](_0x5ca6e9[_0x2b7e('0x3d')]['fields']));_0x4a0eac[_0x2b7e('0x3c')]=_0x4a0eac[_0x2b7e('0x3c')]['length']?_0x4a0eac[_0x2b7e('0x3c')]:_0x1edb42[_0x2b7e('0x4c')];_0x4a0eac[_0x2b7e('0xcc')]=qs['sort'](_0x5ca6e9['query'][_0x2b7e('0xbf')]);_0x4a0eac[_0x2b7e('0xc1')]=qs['filters'](_['pick'](_0x5ca6e9[_0x2b7e('0x3d')],_0x1edb42[_0x2b7e('0x4f')]));if(_0x5ca6e9[_0x2b7e('0x3d')]['filter']){_0x4a0eac['where']=_[_0x2b7e('0x52')](_0x4a0eac[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x4a0eac['attributes'],function(_0x136af2){var _0x268e9e={};_0x268e9e[_0x136af2]={'$like':'%'+_0x5ca6e9[_0x2b7e('0x3d')]['filter']+'%'};return _0x268e9e;})});}_0x4a0eac=_[_0x2b7e('0x52')]({},_0x4a0eac,_0x5ca6e9['options']);return _0x4c8d44[_0x2b7e('0xcb')](_0x4a0eac);}})[_0x2b7e('0x10')](function(_0x1c71f4){if(_0x1c71f4){_0x22d8b8=_0x1c71f4[_0x2b7e('0x3f')];if(!_0x5ca6e9[_0x2b7e('0x3d')][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x4a0eac[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x5ca6e9['query']['limit']);_0x4a0eac[_0x2b7e('0x1a')]=qs['offset'](_0x5ca6e9[_0x2b7e('0x3d')]['offset']);}return _0x4c8d44[_0x2b7e('0xcb')](_0x4a0eac);}})['then'](function(_0x1d2484){if(_0x1d2484){return _0x1d2484?{'count':_0x22d8b8,'rows':_0x1d2484}:null;}})['then'](respondWithResult(_0x4feea3,null))[_0x2b7e('0x49')](handleError(_0x4feea3,null));};exports[_0x2b7e('0xcd')]=function(_0x410bc8,_0x5e0130){var _0x387b77={};var _0x1c0bc9={};var _0x4a1474;var _0x515fe0;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x410bc8[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x5e0130,null))[_0x2b7e('0x10')](function(_0xa13bca){if(_0xa13bca){_0x4a1474=_0xa13bca;_0x1c0bc9[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db['ChatGroup']['rawAttributes']);_0x1c0bc9[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x410bc8['query']);_0x1c0bc9['filters']=_['intersection'](_0x1c0bc9[_0x2b7e('0x4c')],_0x1c0bc9[_0x2b7e('0x3d')]);_0x387b77[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x1c0bc9[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x410bc8['query'][_0x2b7e('0x51')]));_0x387b77['attributes']=_0x387b77['attributes'][_0x2b7e('0x3f')]?_0x387b77[_0x2b7e('0x3c')]:_0x1c0bc9[_0x2b7e('0x4c')];_0x387b77[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x410bc8[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x387b77[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_['pick'](_0x410bc8[_0x2b7e('0x3d')],_0x1c0bc9[_0x2b7e('0x4f')]));if(_0x410bc8[_0x2b7e('0x3d')]['filter']){_0x387b77['where']=_['merge'](_0x387b77[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x387b77[_0x2b7e('0x3c')],function(_0x157dd0){var _0x13da66={};_0x13da66[_0x157dd0]={'$like':'%'+_0x410bc8['query'][_0x2b7e('0x29')]+'%'};return _0x13da66;})});}_0x387b77=_[_0x2b7e('0x52')]({},_0x387b77,_0x410bc8[_0x2b7e('0xc2')]);return _0x4a1474['getGroups'](_0x387b77);}})[_0x2b7e('0x10')](function(_0x2d9c6d){if(_0x2d9c6d){_0x515fe0=_0x2d9c6d[_0x2b7e('0x3f')];if(!_0x410bc8[_0x2b7e('0x3d')][_0x2b7e('0xc3')]('nolimit')){_0x387b77['limit']=qs[_0x2b7e('0x1c')](_0x410bc8[_0x2b7e('0x3d')]['limit']);_0x387b77['offset']=qs[_0x2b7e('0x1a')](_0x410bc8[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}return _0x4a1474['getGroups'](_0x387b77);}})[_0x2b7e('0x10')](function(_0x1d6a87){if(_0x1d6a87){return _0x1d6a87?{'count':_0x515fe0,'rows':_0x1d6a87}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x5e0130,null))[_0x2b7e('0x49')](handleError(_0x5e0130,null));};exports[_0x2b7e('0xce')]=function(_0x48d2c6,_0x4917a8){var _0x14a661={'raw':!![],'where':{}};var _0x51751a={};var _0x4c2982={'count':0x0,'rows':[]};return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x48d2c6[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x4917a8,null))[_0x2b7e('0x10')](function(_0x2b254a){if(_0x2b254a){_0x51751a[_0x2b7e('0x4c')]=_['keys'](db[_0x2b7e('0xcf')][_0x2b7e('0x33')]);_0x51751a['query']=_['keys'](_0x48d2c6[_0x2b7e('0x3d')]);_0x51751a[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x51751a[_0x2b7e('0x4c')],_0x51751a[_0x2b7e('0x3d')]);_0x14a661['attributes']=_[_0x2b7e('0x50')](_0x51751a[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x48d2c6[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x14a661['attributes']=_0x14a661[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x14a661['attributes']:_0x51751a[_0x2b7e('0x4c')];if(!_0x48d2c6[_0x2b7e('0x3d')][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x14a661[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x48d2c6[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x14a661[_0x2b7e('0x1a')]=qs['offset'](_0x48d2c6[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}_0x14a661[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x48d2c6[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x14a661[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x48d2c6[_0x2b7e('0x3d')],_0x51751a[_0x2b7e('0x4f')]));_0x14a661[_0x2b7e('0xc1')]['UserId']=_0x2b254a['id'];if(_0x48d2c6[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x14a661[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x14a661[_0x2b7e('0xc1')],{'$or':_['map'](_0x14a661[_0x2b7e('0x3c')],function(_0x256afc){var _0x4c6497={};_0x4c6497[_0x256afc]={'$like':'%'+_0x48d2c6[_0x2b7e('0x3d')]['filter']+'%'};return _0x4c6497;})});}_0x14a661=_[_0x2b7e('0x52')]({},_0x14a661,_0x48d2c6[_0x2b7e('0xc2')]);return db[_0x2b7e('0xcf')][_0x2b7e('0x1d')]({'where':_0x14a661[_0x2b7e('0xc1')]})['then'](function(_0x3e9bbf){_0x4c2982[_0x2b7e('0x1d')]=_0x3e9bbf;if(_0x48d2c6['query'][_0x2b7e('0x3a')]){_0x14a661[_0x2b7e('0x3b')]=[{'all':!![]}];}return db[_0x2b7e('0xcf')]['findAll'](_0x14a661);})[_0x2b7e('0x10')](function(_0x556611){_0x4c2982[_0x2b7e('0x42')]=_0x556611;return _0x4c2982;});}})[_0x2b7e('0x10')](respondWithFilteredResult(_0x4917a8,_0x14a661))['catch'](handleError(_0x4917a8,null));};exports[_0x2b7e('0xd0')]=function(_0x2998b7,_0x39d590){var _0x505933={'raw':!![],'where':{}};var _0x2ad4af={};var _0x189c60={'count':0x0,'rows':[]};return db['User'][_0x2b7e('0x8c')]({'where':{'id':_0x2998b7[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x39d590,null))[_0x2b7e('0x10')](function(_0x30c14f){if(_0x30c14f){_0x2ad4af['model']=_[_0x2b7e('0x4e')](db['ScreenRecording']['rawAttributes']);_0x2ad4af[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x2998b7[_0x2b7e('0x3d')]);_0x2ad4af[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x2ad4af[_0x2b7e('0x4c')],_0x2ad4af[_0x2b7e('0x3d')]);_0x505933[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x2ad4af[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x2998b7[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x505933[_0x2b7e('0x3c')]=_0x505933[_0x2b7e('0x3c')]['length']?_0x505933['attributes']:_0x2ad4af[_0x2b7e('0x4c')];if(!_0x2998b7[_0x2b7e('0x3d')][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x505933[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x2998b7[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x505933[_0x2b7e('0x1a')]=qs['offset'](_0x2998b7[_0x2b7e('0x3d')]['offset']);}_0x505933[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x2998b7[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x505933['where']=qs['filters'](_['pick'](_0x2998b7['query'],_0x2ad4af[_0x2b7e('0x4f')]));_0x505933[_0x2b7e('0xc1')][_0x2b7e('0xd1')]=_0x30c14f['id'];if(_0x2998b7[_0x2b7e('0x3d')]['filter']){_0x505933[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x505933[_0x2b7e('0xc1')],{'$or':_['map'](_0x505933[_0x2b7e('0x3c')],function(_0x523e95){var _0x20a053={};_0x20a053[_0x523e95]={'$like':'%'+_0x2998b7[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x20a053;})});}_0x505933=_[_0x2b7e('0x52')]({},_0x505933,_0x2998b7[_0x2b7e('0xc2')]);return db[_0x2b7e('0xd2')][_0x2b7e('0x1d')]({'where':_0x505933['where']})[_0x2b7e('0x10')](function(_0x465f24){_0x189c60[_0x2b7e('0x1d')]=_0x465f24;if(_0x2998b7['query'][_0x2b7e('0x3a')]){_0x505933['include']=[{'all':!![]}];}return db[_0x2b7e('0xd2')][_0x2b7e('0x7e')](_0x505933);})[_0x2b7e('0x10')](function(_0xef9c1a){_0x189c60[_0x2b7e('0x42')]=_0xef9c1a;return _0x189c60;});}})[_0x2b7e('0x10')](respondWithFilteredResult(_0x39d590,_0x505933))[_0x2b7e('0x49')](handleError(_0x39d590,null));};exports['getChatInteractions']=function(_0x45a8e8,_0x3254d6){var _0x38d123={};var _0x14cc66={};var _0x4776a2;var _0x17e067;return db['User'][_0x2b7e('0x8c')]({'where':{'id':_0x45a8e8[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x3254d6,null))[_0x2b7e('0x10')](function(_0x37646a){if(_0x37646a){_0x4776a2=_0x37646a;_0x14cc66[_0x2b7e('0x4c')]=_['keys'](db[_0x2b7e('0xd3')][_0x2b7e('0x33')]);_0x14cc66[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x45a8e8[_0x2b7e('0x3d')]);_0x14cc66['filters']=_[_0x2b7e('0x50')](_0x14cc66['model'],_0x14cc66['query']);_0x38d123['attributes']=_[_0x2b7e('0x50')](_0x14cc66[_0x2b7e('0x4c')],qs['fields'](_0x45a8e8[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x38d123[_0x2b7e('0x3c')]=_0x38d123[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x38d123[_0x2b7e('0x3c')]:_0x14cc66[_0x2b7e('0x4c')];_0x38d123[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x45a8e8[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x38d123[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x45a8e8[_0x2b7e('0x3d')],_0x14cc66[_0x2b7e('0x4f')]));if(_0x45a8e8[_0x2b7e('0x3d')]['filter']){_0x38d123[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x38d123['where'],{'$or':_['map'](_0x38d123['attributes'],function(_0x4b8c21){var _0x18170d={};_0x18170d[_0x4b8c21]={'$like':'%'+_0x45a8e8[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x18170d;})});}_0x38d123=_['merge']({},_0x38d123,_0x45a8e8[_0x2b7e('0xc2')]);return _0x4776a2[_0x2b7e('0xd4')](_0x38d123);}})['then'](function(_0x7b0dfd){if(_0x7b0dfd){_0x17e067=_0x7b0dfd[_0x2b7e('0x3f')];if(!_0x45a8e8[_0x2b7e('0x3d')]['hasOwnProperty'](_0x2b7e('0xca'))){_0x38d123['limit']=qs['limit'](_0x45a8e8[_0x2b7e('0x3d')]['limit']);_0x38d123[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x45a8e8['query'][_0x2b7e('0x1a')]);}return _0x4776a2[_0x2b7e('0xd4')](_0x38d123);}})[_0x2b7e('0x10')](function(_0x59bbcf){if(_0x59bbcf){return _0x59bbcf?{'count':_0x17e067,'rows':_0x59bbcf}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x3254d6,null))[_0x2b7e('0x49')](handleError(_0x3254d6,null));};exports[_0x2b7e('0xd5')]=function(_0x19b504,_0x2769d5){var _0x4f8111={};var _0x425aed={};var _0x23779c;var _0x432d85;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x19b504['params']['id']}})['then'](handleEntityNotFound(_0x2769d5,null))[_0x2b7e('0x10')](function(_0x588129){if(_0x588129){_0x23779c=_0x588129;_0x425aed['model']=_[_0x2b7e('0x4e')](db[_0x2b7e('0xd6')][_0x2b7e('0x33')]);_0x425aed[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x19b504[_0x2b7e('0x3d')]);_0x425aed['filters']=_['intersection'](_0x425aed[_0x2b7e('0x4c')],_0x425aed['query']);_0x4f8111[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x425aed[_0x2b7e('0x4c')],qs['fields'](_0x19b504[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x4f8111['attributes']=_0x4f8111[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x4f8111[_0x2b7e('0x3c')]:_0x425aed[_0x2b7e('0x4c')];_0x4f8111['order']=qs[_0x2b7e('0xbf')](_0x19b504['query'][_0x2b7e('0xbf')]);_0x4f8111['where']=qs[_0x2b7e('0x4f')](_['pick'](_0x19b504[_0x2b7e('0x3d')],_0x425aed['filters']));if(_0x19b504[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x4f8111[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x4f8111[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x4f8111['attributes'],function(_0x2a800e){var _0x541cc4={};_0x541cc4[_0x2a800e]={'$like':'%'+_0x19b504[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x541cc4;})});}_0x4f8111=_[_0x2b7e('0x52')]({},_0x4f8111,_0x19b504[_0x2b7e('0xc2')]);return _0x23779c[_0x2b7e('0xd5')](_0x4f8111);}})[_0x2b7e('0x10')](function(_0x1740f9){if(_0x1740f9){_0x432d85=_0x1740f9[_0x2b7e('0x3f')];if(!_0x19b504['query'][_0x2b7e('0xc3')]('nolimit')){_0x4f8111[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x19b504[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x4f8111[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x19b504[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}return _0x23779c['getOpenchannelInteractions'](_0x4f8111);}})[_0x2b7e('0x10')](function(_0x1bbe59){if(_0x1bbe59){return _0x1bbe59?{'count':_0x432d85,'rows':_0x1bbe59}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x2769d5,null))[_0x2b7e('0x49')](handleError(_0x2769d5,null));};exports[_0x2b7e('0xd7')]=function(_0x55146b,_0x59f997){var _0x3bb28d={'raw':!![],'where':{}};var _0x432be8={};var _0x423950={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x55146b['params']['id']}})['then'](handleEntityNotFound(_0x59f997,null))[_0x2b7e('0x10')](function(_0x5390db){if(_0x5390db){_0x432be8[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0xd8')]['rawAttributes']);_0x432be8['query']=_[_0x2b7e('0x4e')](_0x55146b[_0x2b7e('0x3d')]);_0x432be8[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x432be8['model'],_0x432be8[_0x2b7e('0x3d')]);_0x3bb28d[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x432be8[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x55146b[_0x2b7e('0x3d')]['fields']));_0x3bb28d[_0x2b7e('0x3c')]=_0x3bb28d['attributes'][_0x2b7e('0x3f')]?_0x3bb28d['attributes']:_0x432be8['model'];if(!_0x55146b['query'][_0x2b7e('0xc3')]('nolimit')){_0x3bb28d[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x55146b[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x3bb28d[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x55146b[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}_0x3bb28d[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x55146b['query'][_0x2b7e('0xbf')]);_0x3bb28d[_0x2b7e('0xc1')]=qs['filters'](_[_0x2b7e('0xc0')](_0x55146b[_0x2b7e('0x3d')],_0x432be8[_0x2b7e('0x4f')]));_0x3bb28d[_0x2b7e('0xc1')][_0x2b7e('0xd1')]=_0x5390db['id'];if(_0x55146b[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x3bb28d[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x3bb28d[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x3bb28d[_0x2b7e('0x3c')],function(_0xf50270){var _0xd5d0d4={};_0xd5d0d4[_0xf50270]={'$like':'%'+_0x55146b[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0xd5d0d4;})});}_0x3bb28d=_[_0x2b7e('0x52')]({},_0x3bb28d,_0x55146b['options']);return db['MailInteraction']['count']({'where':_0x3bb28d[_0x2b7e('0xc1')]})[_0x2b7e('0x10')](function(_0x1eb353){_0x423950['count']=_0x1eb353;if(_0x55146b[_0x2b7e('0x3d')][_0x2b7e('0x3a')]){_0x3bb28d[_0x2b7e('0x3b')]=[{'all':!![]}];}return db[_0x2b7e('0xd8')][_0x2b7e('0x7e')](_0x3bb28d);})[_0x2b7e('0x10')](function(_0x16a07a){_0x423950[_0x2b7e('0x42')]=_0x16a07a;return _0x423950;});}})[_0x2b7e('0x10')](respondWithFilteredResult(_0x59f997,_0x3bb28d))['catch'](handleError(_0x59f997,null));};exports[_0x2b7e('0xd9')]=function(_0x5f0b4b,_0x28edbe){var _0x21ce50={};var _0x10bfc8={};var _0x33bc5b;var _0x530169;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x5f0b4b['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x28edbe,null))['then'](function(_0x468e0f){if(_0x468e0f){_0x33bc5b=_0x468e0f;_0x10bfc8['model']=_[_0x2b7e('0x4e')](db[_0x2b7e('0xda')][_0x2b7e('0x33')]);_0x10bfc8[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x5f0b4b[_0x2b7e('0x3d')]);_0x10bfc8[_0x2b7e('0x4f')]=_['intersection'](_0x10bfc8[_0x2b7e('0x4c')],_0x10bfc8['query']);_0x21ce50[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x10bfc8[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x5f0b4b[_0x2b7e('0x3d')]['fields']));_0x21ce50[_0x2b7e('0x3c')]=_0x21ce50[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x21ce50['attributes']:_0x10bfc8[_0x2b7e('0x4c')];_0x21ce50[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x5f0b4b['query'][_0x2b7e('0xbf')]);_0x21ce50[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x5f0b4b[_0x2b7e('0x3d')],_0x10bfc8[_0x2b7e('0x4f')]));if(_0x5f0b4b[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x21ce50[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x21ce50['where'],{'$or':_[_0x2b7e('0x81')](_0x21ce50[_0x2b7e('0x3c')],function(_0x1b139e){var _0x420ba1={};_0x420ba1[_0x1b139e]={'$like':'%'+_0x5f0b4b[_0x2b7e('0x3d')]['filter']+'%'};return _0x420ba1;})});}_0x21ce50=_[_0x2b7e('0x52')]({},_0x21ce50,_0x5f0b4b['options']);return _0x33bc5b['getSmsInteractions'](_0x21ce50);}})[_0x2b7e('0x10')](function(_0x5fd40){if(_0x5fd40){_0x530169=_0x5fd40[_0x2b7e('0x3f')];if(!_0x5f0b4b[_0x2b7e('0x3d')]['hasOwnProperty'](_0x2b7e('0xca'))){_0x21ce50['limit']=qs[_0x2b7e('0x1c')](_0x5f0b4b[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x21ce50['offset']=qs[_0x2b7e('0x1a')](_0x5f0b4b[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}return _0x33bc5b[_0x2b7e('0xd9')](_0x21ce50);}})[_0x2b7e('0x10')](function(_0x6958a4){if(_0x6958a4){return _0x6958a4?{'count':_0x530169,'rows':_0x6958a4}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x28edbe,null))[_0x2b7e('0x49')](handleError(_0x28edbe,null));};exports[_0x2b7e('0xdb')]=function(_0x59b04e,_0x468801){var _0x1b882b={};var _0x1ab40c={};var _0x2ff741;var _0x231a6f;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x59b04e[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x468801,null))['then'](function(_0x5b0151){if(_0x5b0151){_0x2ff741=_0x5b0151;_0x1ab40c[_0x2b7e('0x4c')]=_['keys'](db[_0x2b7e('0xdc')]['rawAttributes']);_0x1ab40c['query']=_[_0x2b7e('0x4e')](_0x59b04e['query']);_0x1ab40c[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x1ab40c[_0x2b7e('0x4c')],_0x1ab40c['query']);_0x1b882b[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x1ab40c[_0x2b7e('0x4c')],qs['fields'](_0x59b04e[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x1b882b[_0x2b7e('0x3c')]=_0x1b882b['attributes'][_0x2b7e('0x3f')]?_0x1b882b['attributes']:_0x1ab40c[_0x2b7e('0x4c')];_0x1b882b[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x59b04e[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x1b882b[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x59b04e['query'],_0x1ab40c[_0x2b7e('0x4f')]));if(_0x59b04e['query'][_0x2b7e('0x29')]){_0x1b882b['where']=_[_0x2b7e('0x52')](_0x1b882b[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x1b882b[_0x2b7e('0x3c')],function(_0x2893bf){var _0x4f1ce6={};_0x4f1ce6[_0x2893bf]={'$like':'%'+_0x59b04e[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x4f1ce6;})});}_0x1b882b=_[_0x2b7e('0x52')]({},_0x1b882b,_0x59b04e[_0x2b7e('0xc2')]);return _0x2ff741[_0x2b7e('0xdb')](_0x1b882b);}})[_0x2b7e('0x10')](function(_0x379891){if(_0x379891){_0x231a6f=_0x379891[_0x2b7e('0x3f')];if(!_0x59b04e[_0x2b7e('0x3d')][_0x2b7e('0xc3')]('nolimit')){_0x1b882b[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x59b04e[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x1b882b[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x59b04e['query'][_0x2b7e('0x1a')]);}return _0x2ff741[_0x2b7e('0xdb')](_0x1b882b);}})['then'](function(_0x480dc3){if(_0x480dc3){return _0x480dc3?{'count':_0x231a6f,'rows':_0x480dc3}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x468801,null))['catch'](handleError(_0x468801,null));};exports[_0x2b7e('0xdd')]=function(_0x2256b1,_0x585447){var _0xa6240={};var _0x5b1e26={};var _0x3df8ea;var _0x149890;return db[_0x2b7e('0x39')]['findOne']({'where':{'id':_0x2256b1[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x585447,null))[_0x2b7e('0x10')](function(_0x163214){if(_0x163214){_0x3df8ea=_0x163214;_0x5b1e26[_0x2b7e('0x4c')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x5b1e26['query']=_[_0x2b7e('0x4e')](_0x2256b1[_0x2b7e('0x3d')]);_0x5b1e26[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x5b1e26[_0x2b7e('0x4c')],_0x5b1e26['query']);_0xa6240[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x5b1e26[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x2256b1[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0xa6240[_0x2b7e('0x3c')]=_0xa6240['attributes']['length']?_0xa6240[_0x2b7e('0x3c')]:_0x5b1e26[_0x2b7e('0x4c')];_0xa6240[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x2256b1[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0xa6240[_0x2b7e('0xc1')]=qs['filters'](_[_0x2b7e('0xc0')](_0x2256b1[_0x2b7e('0x3d')],_0x5b1e26[_0x2b7e('0x4f')]));if(_0x2256b1[_0x2b7e('0x3d')]['filter']){_0xa6240['where']=_[_0x2b7e('0x52')](_0xa6240[_0x2b7e('0xc1')],{'$or':_['map'](_0xa6240[_0x2b7e('0x3c')],function(_0x194357){var _0x5b72be={};_0x5b72be[_0x194357]={'$like':'%'+_0x2256b1[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x5b72be;})});}_0xa6240=_[_0x2b7e('0x52')]({},_0xa6240,_0x2256b1[_0x2b7e('0xc2')]);return _0x3df8ea[_0x2b7e('0xdd')](_0xa6240);}})[_0x2b7e('0x10')](function(_0x573d03){if(_0x573d03){_0x149890=_0x573d03['length'];if(!_0x2256b1[_0x2b7e('0x3d')]['hasOwnProperty'](_0x2b7e('0xca'))){_0xa6240[_0x2b7e('0x1c')]=qs['limit'](_0x2256b1[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0xa6240[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x2256b1[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}return _0x3df8ea[_0x2b7e('0xdd')](_0xa6240);}})['then'](function(_0x114444){if(_0x114444){return _0x114444?{'count':_0x149890,'rows':_0x114444}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x585447,null))[_0x2b7e('0x49')](handleError(_0x585447,null));};exports[_0x2b7e('0xde')]=function(_0x2a4013,_0x4fbc36,_0x138279){var _0x3540cd;var _0x404a65;var _0x2de630;var _0x3fb02d=!_['isNil'](_0x2a4013[_0x2b7e('0x4b')]['id'])?_0x2a4013[_0x2b7e('0x4b')]['id']:!_[_0x2b7e('0x5b')](_0x2a4013[_0x2b7e('0x25')]['id'])?_0x2a4013['user']['id']:null;return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x3fb02d,'role':{'$or':['admin',_0x2b7e('0x25'),_0x2b7e('0x27')]}},'attributes':['id','name',_0x2b7e('0xdf'),_0x2b7e('0xe0'),_0x2b7e('0x2d'),_0x2b7e('0x57'),_0x2b7e('0x94')]})['then'](function(_0x46a6d4){if(_0x46a6d4){if(_0x46a6d4['role']===_0x2b7e('0x27')){_0x3540cd=_0x46a6d4;if(_0x2a4013[_0x2b7e('0x55')][_0x2b7e('0x96')]){_0x2de630=util['format'](_0x2b7e('0xe1'),_0x3540cd[_0x2a4013[_0x2b7e('0x55')][_0x2b7e('0x96')]]);}else if(_0x2a4013[_0x2b7e('0x55')][_0x2b7e('0xe2')]){_0x2de630=util[_0x2b7e('0xa1')](_0x2b7e('0xe3'),_0x2a4013[_0x2b7e('0x55')]['intrf']);}else{_0x2de630=util['format'](_0x2b7e('0xe3'),_0x3540cd[_0x2b7e('0x31')]);}socket['to'](util[_0x2b7e('0xa1')](_0x2b7e('0xe4'),_0x3540cd[_0x2b7e('0x31')]))['emit'](_0x2b7e('0xe5'),{'user':{'id':_0x3540cd['id'],'name':_0x3540cd[_0x2b7e('0x31')]},'ip':_0x2a4013['headers'][_0x2b7e('0xe6')]||_0x2a4013[_0x2b7e('0xe7')][_0x2b7e('0xe8')]||_0x2a4013[_0x2b7e('0xe9')][_0x2b7e('0xe8')]||_0x2a4013['connection'][_0x2b7e('0xe9')][_0x2b7e('0xe8')]});return db[_0x2b7e('0xa8')][_0x2b7e('0x21')]({'where':{'membername':_0x3540cd['name']},'individualHooks':!![]});}}else{throw new db[(_0x2b7e('0x84'))][(_0x2b7e('0x85'))](_0x2b7e('0xea'));}})[_0x2b7e('0x10')](function(){if(_0x3540cd){return _0x3540cd['getVoiceQueues']({'raw':!![]});}})[_0x2b7e('0x10')](function(_0x1dfe5b){if(_0x3540cd){var _0x557f3b=[];if(_0x1dfe5b){_0x404a65=_0x1dfe5b;if(_0x404a65[_0x2b7e('0x3f')]){for(var _0x39f80d=0x0;_0x39f80d<_0x404a65[_0x2b7e('0x3f')];_0x39f80d++){_0x557f3b['push']({'membername':_0x3540cd['name'],'UserId':_0x3540cd['id'],'queue_name':_0x404a65[_0x39f80d]['name'],'VoiceQueueId':_0x404a65[_0x39f80d]['id'],'interface':_0x2de630,'paused':_0x3540cd[_0x2b7e('0x94')]||![],'penalty':_0x404a65[_0x39f80d][_0x2b7e('0xeb')]||0x0});}return BPromise[_0x2b7e('0x7c')](_0x557f3b,function(_0x3e7979){return db[_0x2b7e('0xa8')][_0x2b7e('0xa2')](_0x3e7979);});}}}})[_0x2b7e('0x10')](function(){if(_0x3540cd){return db[_0x2b7e('0xec')][_0x2b7e('0x7e')]({'where':{'membername':_0x3540cd[_0x2b7e('0x31')],'exitAt':null}});}})[_0x2b7e('0x10')](function(_0x470ec0){if(_0x3540cd){var _0x442231=[];_0x470ec0[_0x2b7e('0xed')](function(_0x4b18f0){_0x442231['push'](_0x4b18f0[_0x2b7e('0xee')]({'exitAt':moment()[_0x2b7e('0xa1')](_0x2b7e('0xef'))}));});return BPromise[_0x2b7e('0x48')](_0x442231);}})[_0x2b7e('0x10')](function(){if(_0x3540cd){var _0xfda8fa=[];var _0x3bae3a=[];var _0x34fd3a=utils[_0x2b7e('0xf0')]();var _0x4d2163={'membername':_0x3540cd[_0x2b7e('0x31')],'interface':_0x2de630,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3540cd[_0x2b7e('0x2d')],'internal':_0x3540cd['internal']};_0x34fd3a[_0x2b7e('0xed')](function(_0x2cbf29){_0xfda8fa[_0x2b7e('0x40')](_[_0x2b7e('0x52')]({'channel':_0x2cbf29,'type':_0x2b7e('0xf1'),'data1':_0x2a4013[_0x2b7e('0x55')][_0x2b7e('0xf2')],'data2':_0x2de630},_0x4d2163));if(_0x3540cd[_0x2b7e('0x94')]){_0x3bae3a[_0x2b7e('0x40')](_[_0x2b7e('0x52')]({'channel':_0x2cbf29,'type':_0x2b7e('0xf3'),'data1':_0x2b7e('0xf4')},_0x4d2163));}});return db[_0x2b7e('0xec')][_0x2b7e('0x79')](_0xfda8fa['concat'](_0x3bae3a),{'individualHooks':!![]});}})[_0x2b7e('0x10')](function(){if(_0x3540cd){return _0x3540cd[_0x2b7e('0xee')]({'online':!![],'lastLoginAt':moment()[_0x2b7e('0xa1')](_0x2b7e('0xef')),'voicePause':_0x3540cd[_0x2b7e('0x94')]||![],'mailPause':_0x3540cd['loginInPause']||![],'chatPause':_0x3540cd['loginInPause']||![],'faxPause':_0x3540cd[_0x2b7e('0x94')]||![],'smsPause':_0x3540cd[_0x2b7e('0x94')]||![],'openchannelPause':_0x3540cd['loginInPause']||![],'whatsappPause':_0x3540cd[_0x2b7e('0x94')]||![],'pauseType':_0x3540cd[_0x2b7e('0x94')]?'LOGININPAUSE':null,'interface':_0x2de630,'lastPauseAt':moment()['format'](_0x2b7e('0xef'))});}})[_0x2b7e('0x10')](function(_0x19190f){if(_0x2a4013[_0x2b7e('0xf5')]){return _0x138279();}else{return BPromise[_0x2b7e('0xf6')](_0x19190f)[_0x2b7e('0x10')](respondWithResult(_0x4fbc36,null));}})['catch'](handleError(_0x4fbc36,null));};exports[_0x2b7e('0xf7')]=function(_0x4324d6,_0x485124){var _0x599e8b;return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x4324d6[_0x2b7e('0x4b')]['id'],'role':_0x2b7e('0x27')},'attributes':['id',_0x2b7e('0x31'),_0x2b7e('0x2d')]})[_0x2b7e('0x10')](handleEntityNotFound(_0x485124,null))[_0x2b7e('0x10')](function(_0x4b1f12){if(_0x4b1f12){_0x599e8b=_0x4b1f12;return db['UserVoiceQueueRt'][_0x2b7e('0x21')]({'where':{'membername':_0x599e8b['name']},'individualHooks':!![]});}})[_0x2b7e('0x10')](function(){return db[_0x2b7e('0xec')][_0x2b7e('0x7e')]({'where':{'membername':_0x599e8b[_0x2b7e('0x31')],'exitAt':null}});})[_0x2b7e('0x10')](function(_0x1d0332){var _0x532df4=[];_0x1d0332[_0x2b7e('0xed')](function(_0x473953){_0x532df4[_0x2b7e('0x40')](_0x473953[_0x2b7e('0xee')]({'exitAt':moment()[_0x2b7e('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x2b7e('0x48')](_0x532df4);})['then'](function(){return _0x599e8b[_0x2b7e('0xee')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x485124,null))[_0x2b7e('0x49')](handleError(_0x485124,null));};exports[_0x2b7e('0xf8')]=function(_0x2aacb3,_0xc830df){var _0x316864;return db[_0x2b7e('0xa8')][_0x2b7e('0xee')]({'paused':0x1},{'where':{'UserId':_0x2aacb3[_0x2b7e('0x4b')]['id']},'individualHooks':!![]})[_0x2b7e('0x10')](function(){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x2aacb3[_0x2b7e('0x4b')]['id'],'role':_0x2b7e('0x27')},'attributes':['id',_0x2b7e('0x31'),'role','internal','interface']});})['then'](handleEntityNotFound(_0xc830df,null))[_0x2b7e('0x10')](function(_0x5ef92f){if(_0x5ef92f){_0x316864=_0x5ef92f;return respondWithRpcPromise('QueuePause','pause',{'id':_0x316864['id'],'name':_0x316864[_0x2b7e('0x31')],'pause':!![]});}})['then'](function(){if(_0x316864){return db[_0x2b7e('0xec')][_0x2b7e('0x7e')]({'where':{'membername':_0x316864[_0x2b7e('0x31')],'type':'PAUSE','exitAt':null}});}})[_0x2b7e('0x10')](function(_0x31cd15){if(_0x31cd15[_0x2b7e('0x3f')]){var _0x3c9709=moment()[_0x2b7e('0xa1')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x42b42c=0x0,_0x23fe9a=_0x31cd15['length'];_0x42b42c<_0x23fe9a;_0x42b42c++){_0x31cd15[_0x42b42c][_0x2b7e('0xf9')]({'exitAt':_0x3c9709});}}})[_0x2b7e('0x10')](function(){var _0x3f5851=[];var _0x26645c=utils[_0x2b7e('0xf0')]();_0x26645c[_0x2b7e('0xed')](function(_0x22aa1a){_0x3f5851[_0x2b7e('0x40')]({'channel':_0x22aa1a,'membername':_0x316864[_0x2b7e('0x31')],'interface':_[_0x2b7e('0x5b')](_0x316864[_0x2b7e('0x96')])?util[_0x2b7e('0xa1')]('SIP/%s',_0x316864['name']):_0x316864[_0x2b7e('0x96')],'type':_0x2b7e('0xf3'),'enterAt':moment()[_0x2b7e('0xa1')](_0x2b7e('0xef')),'data1':_0x2aacb3[_0x2b7e('0x55')][_0x2b7e('0x35')]||'DEFAULT\x20PAUSE','role':_0x316864[_0x2b7e('0x2d')],'internal':_0x316864[_0x2b7e('0x57')]});});return db[_0x2b7e('0xec')]['bulkCreate'](_0x3f5851,{'individualHooks':!![]});})['then'](function(){return _0x316864[_0x2b7e('0xee')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2aacb3[_0x2b7e('0x55')][_0x2b7e('0x35')]||_0x2b7e('0xfa'),'lastPauseAt':moment()[_0x2b7e('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0xc830df,null))[_0x2b7e('0x49')](handleError(_0xc830df,null));};exports[_0x2b7e('0xfb')]=function(_0x4c4fc3,_0x274d0d){var _0x4104d5;return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x4c4fc3[_0x2b7e('0x4b')]['id']},'attributes':['id',_0x2b7e('0x31'),_0x2b7e('0x2d'),'voicePause',_0x2b7e('0xfc'),_0x2b7e('0xfd'),'faxPause',_0x2b7e('0xfe'),_0x2b7e('0xff'),_0x2b7e('0x100'),_0x2b7e('0x101'),'lastPauseAt']})[_0x2b7e('0x10')](handleEntityNotFound(_0x274d0d,null))[_0x2b7e('0x10')](function(_0x2dec62){if(_0x2dec62){_0x4104d5=_0x2dec62;if(_0x4c4fc3[_0x2b7e('0x55')][_0x2b7e('0x92')]&&!utils[_0x2b7e('0x97')](_0x4c4fc3[_0x2b7e('0x55')][_0x2b7e('0x92')])){throw new db[(_0x2b7e('0x84'))][(_0x2b7e('0x85'))](_0x2b7e('0xa4'));}switch(_0x4c4fc3['body'][_0x2b7e('0x92')]){case _0x2b7e('0xa0'):return respondWithRpcPromise(_0x2b7e('0x102'),_0x2b7e('0xfb'),{'id':_0x4104d5['id'],'name':_0x4104d5[_0x2b7e('0x31')],'pause':![]})[_0x2b7e('0x10')](function(){return db[_0x2b7e('0xa8')]['update']({'paused':0x0},{'where':{'UserId':_0x4104d5['id']},'individualHooks':!![]});})[_0x2b7e('0x10')](function(){return db[_0x2b7e('0xec')][_0x2b7e('0x2e')]({'where':{'channel':_0x4c4fc3[_0x2b7e('0x55')][_0x2b7e('0x92')],'membername':_0x4104d5['name'],'type':_0x2b7e('0xf3'),'exitAt':null}});})[_0x2b7e('0x10')](function(_0x528110){if(_0x528110){return _0x528110[_0x2b7e('0xee')]({'exitAt':moment()['format'](_0x2b7e('0xef')),'data2':_0x2b7e('0x103')},{'individualHooks':!![]});}return null;})[_0x2b7e('0x10')](function(){return _0x4104d5[_0x2b7e('0xee')]({'voicePause':![]});});case'mail':case _0x2b7e('0x41'):case _0x2b7e('0x44'):case _0x2b7e('0x54'):case _0x2b7e('0x47'):case _0x2b7e('0x46'):return db['MemberReport'][_0x2b7e('0x2e')]({'where':{'channel':_0x4c4fc3[_0x2b7e('0x55')][_0x2b7e('0x92')],'membername':_0x4104d5[_0x2b7e('0x31')],'type':_0x2b7e('0xf3'),'exitAt':null}})[_0x2b7e('0x10')](function(_0x1c552f){if(_0x1c552f){return _0x1c552f[_0x2b7e('0xee')]({'exitAt':moment()[_0x2b7e('0xa1')](_0x2b7e('0xef')),'data2':_0x2b7e('0x103')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x55fa26={};_['set'](_0x55fa26,util[_0x2b7e('0xa1')](_0x2b7e('0x104'),_0x4c4fc3[_0x2b7e('0x55')][_0x2b7e('0x92')],_0x2b7e('0x105')),![]);return _0x4104d5[_0x2b7e('0xee')](_0x55fa26);});default:return respondWithRpcPromise('QueuePause',_0x2b7e('0xfb'),{'id':_0x4104d5['id'],'name':_0x4104d5[_0x2b7e('0x31')],'pause':![]})[_0x2b7e('0x10')](function(){return db[_0x2b7e('0xa8')][_0x2b7e('0xee')]({'paused':0x0},{'where':{'UserId':_0x4104d5['id']}});})['then'](function(){return db['MemberReport'][_0x2b7e('0x7e')]({'where':{'membername':_0x4104d5[_0x2b7e('0x31')],'type':_0x2b7e('0xf3'),'exitAt':null}});})[_0x2b7e('0x10')](function(_0x14b9c6){var _0x547410=[];_0x14b9c6[_0x2b7e('0xed')](function(_0x8015f){_0x547410[_0x2b7e('0x40')](_0x8015f[_0x2b7e('0xee')]({'exitAt':moment()[_0x2b7e('0xa1')](_0x2b7e('0xef')),'data2':_0x2b7e('0x103')}));});return BPromise['all'](_0x547410);})['then'](function(){return _0x4104d5['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x2b7e('0x10')](respondWithResult(_0x274d0d,null))[_0x2b7e('0x49')](handleError(_0x274d0d,null));};exports[_0x2b7e('0x106')]=function(_0x4cb6e7,_0x10a518){var _0x95a4df={};var _0x2c73e2={};var _0x50f588;var _0x61496c;return db[_0x2b7e('0x39')]['findOne']({'where':{'id':_0x4cb6e7['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x10a518,null))['then'](function(_0x41a5c4){if(_0x41a5c4){_0x50f588=_0x41a5c4;_0x2c73e2[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0x107')][_0x2b7e('0x33')]);_0x2c73e2[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x4cb6e7[_0x2b7e('0x3d')]);_0x2c73e2['filters']=_[_0x2b7e('0x50')](_0x2c73e2[_0x2b7e('0x4c')],_0x2c73e2[_0x2b7e('0x3d')]);_0x95a4df[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x2c73e2[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x4cb6e7['query']['fields']));_0x95a4df[_0x2b7e('0x3c')]=_0x95a4df[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x95a4df[_0x2b7e('0x3c')]:_0x2c73e2[_0x2b7e('0x4c')];_0x95a4df[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x4cb6e7[_0x2b7e('0x3d')]['sort']);_0x95a4df['where']=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x4cb6e7[_0x2b7e('0x3d')],_0x2c73e2[_0x2b7e('0x4f')]));if(_0x4cb6e7[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x95a4df['where']=_[_0x2b7e('0x52')](_0x95a4df[_0x2b7e('0xc1')],{'$or':_['map'](_0x95a4df[_0x2b7e('0x3c')],function(_0x124e63){var _0x88ad45={};_0x88ad45[_0x124e63]={'$like':'%'+_0x4cb6e7[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x88ad45;})});}_0x95a4df=_[_0x2b7e('0x52')]({},_0x95a4df,_0x4cb6e7[_0x2b7e('0xc2')]);return _0x50f588[_0x2b7e('0x106')](_0x95a4df);}})[_0x2b7e('0x10')](function(_0x3cf3ed){if(_0x3cf3ed){_0x61496c=_0x3cf3ed[_0x2b7e('0x3f')];if(!_0x4cb6e7[_0x2b7e('0x3d')][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x95a4df[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x4cb6e7[_0x2b7e('0x3d')]['limit']);_0x95a4df[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x4cb6e7['query'][_0x2b7e('0x1a')]);}return _0x50f588[_0x2b7e('0x106')](_0x95a4df);}})['then'](function(_0x2ad7a0){if(_0x2ad7a0){return _0x2ad7a0?{'count':_0x61496c,'rows':_0x2ad7a0}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x10a518,null))[_0x2b7e('0x49')](handleError(_0x10a518,null));};exports[_0x2b7e('0x108')]=function(_0x1f7359,_0x207bce){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x1f7359['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x207bce,null))[_0x2b7e('0x10')](function(_0x21ef94){if(_0x21ef94){var _0x4c6373=_0x21ef94[_0x2b7e('0x22')]({'plain':!![]});return _0x21ef94[_0x2b7e('0x108')](_0x1f7359[_0x2b7e('0x55')][_0x2b7e('0x9a')],_[_0x2b7e('0x109')](_0x1f7359[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{})[_0x2b7e('0x10')](function(){for(var _0x22820f=0x0;_0x22820f<_0x1f7359['body'][_0x2b7e('0x9a')][_0x2b7e('0x3f')];_0x22820f++){var _0x3abbb9=[];db['Team'][_0x2b7e('0x8c')]({'where':{'id':_0x1f7359[_0x2b7e('0x55')][_0x2b7e('0x9a')][_0x22820f]}})[_0x2b7e('0x10')](function(_0x595a46){_0x3abbb9[_0x2b7e('0x40')](_0x595a46[_0x2b7e('0x10a')]()[_0x2b7e('0x10')](function(_0x3ad9aa){for(var _0x3c1f14=0x0;_0x3c1f14<_0x3ad9aa[_0x2b7e('0x3f')];_0x3c1f14++){_0x3ad9aa[_0x3c1f14][_0x2b7e('0x10b')](_0x2b7e('0x92'),_0x2b7e('0x10c'));}return _0x3ad9aa;}));_0x3abbb9['push'](_0x595a46[_0x2b7e('0x10d')]()[_0x2b7e('0x10')](function(_0x30aef8){for(var _0x2423c5=0x0;_0x2423c5<_0x30aef8[_0x2b7e('0x3f')];_0x2423c5++){_0x30aef8[_0x2423c5][_0x2b7e('0x10b')]('channel',_0x2b7e('0x10e'));}return _0x30aef8;}));_0x3abbb9[_0x2b7e('0x40')](_0x595a46[_0x2b7e('0x10f')]()[_0x2b7e('0x10')](function(_0x3fcb39){for(var _0xc59a42=0x0;_0xc59a42<_0x3fcb39[_0x2b7e('0x3f')];_0xc59a42++){_0x3fcb39[_0xc59a42]['setDataValue'](_0x2b7e('0x92'),'Mail');}return _0x3fcb39;}));_0x3abbb9[_0x2b7e('0x40')](_0x595a46[_0x2b7e('0x110')]()[_0x2b7e('0x10')](function(_0x5e5885){for(var _0x37659d=0x0;_0x37659d<_0x5e5885[_0x2b7e('0x3f')];_0x37659d++){_0x5e5885[_0x37659d][_0x2b7e('0x10b')](_0x2b7e('0x92'),_0x2b7e('0x111'));}return _0x5e5885;}));_0x3abbb9[_0x2b7e('0x40')](_0x595a46[_0x2b7e('0x112')]()[_0x2b7e('0x10')](function(_0x18d66d){for(var _0x5f4404=0x0;_0x5f4404<_0x18d66d[_0x2b7e('0x3f')];_0x5f4404++){_0x18d66d[_0x5f4404][_0x2b7e('0x10b')](_0x2b7e('0x92'),_0x2b7e('0x113'));}return _0x18d66d;}));_0x3abbb9[_0x2b7e('0x40')](_0x595a46[_0x2b7e('0x114')]()[_0x2b7e('0x10')](function(_0x5b427b){for(var _0x18a079=0x0;_0x18a079<_0x5b427b['length'];_0x18a079++){_0x5b427b[_0x18a079][_0x2b7e('0x10b')](_0x2b7e('0x92'),'Fax');}return _0x5b427b;}));_0x3abbb9['push'](_0x595a46['getOpenchannelQueues']()[_0x2b7e('0x10')](function(_0x5f18b1){for(var _0x3556f9=0x0;_0x3556f9<_0x5f18b1[_0x2b7e('0x3f')];_0x3556f9++){_0x5f18b1[_0x3556f9][_0x2b7e('0x10b')](_0x2b7e('0x92'),'Openchannel');}return _0x5f18b1;}));return BPromise[_0x2b7e('0x48')](_0x3abbb9);})[_0x2b7e('0x10')](function(_0x5c6749){var _0x3cc3d9=_[_0x2b7e('0x115')](_0x5c6749);_0x3abbb9=[];return db[_0x2b7e('0x5e')][_0x2b7e('0x116')](function(_0x1a4ce7){for(var _0x125803=0x0;_0x125803<_0x3cc3d9[_0x2b7e('0x3f')];_0x125803++){_0x3abbb9[_0x2b7e('0x40')](_0x3cc3d9[_0x125803]['addAgent'](_0x4c6373['id']),{'transaction':_0x1a4ce7});}return BPromise[_0x2b7e('0x48')](_0x3abbb9)['then'](function(){if(_0x4c6373['online']){return BPromise['each'](_[_0x2b7e('0x29')](_0x3cc3d9,function(_0x2199ee){return _0x2199ee[_0x2b7e('0x117')](_0x2b7e('0x92'))===_0x2b7e('0x10c');}),function(_0x531319){return db[_0x2b7e('0xa8')][_0x2b7e('0xa2')]({'membername':_0x4c6373['name'],'UserId':_0x4c6373['id'],'queue_name':_0x531319[_0x2b7e('0x31')],'VoiceQueueId':_0x531319['id'],'interface':_[_0x2b7e('0x5b')](_0x4c6373['interface'])?util[_0x2b7e('0xa1')](_0x2b7e('0xe3'),_0x4c6373[_0x2b7e('0x31')]):_0x4c6373['interface'],'paused':_0x4c6373[_0x2b7e('0x95')]||![],'penalty':_0x4c6373['penalty']},{'transaction':_0x1a4ce7});});}else{return;}})[_0x2b7e('0x10')](function(){for(var _0x3ec679=0x0;_0x3ec679<_0x3cc3d9[_0x2b7e('0x3f')];_0x3ec679++){var _0x1d248d=_0x3cc3d9[_0x3ec679][_0x2b7e('0x117')](_0x2b7e('0x92'));var _0x5657d8=_0x1d248d+_0x2b7e('0x9d');socket[_0x2b7e('0xa6')]('user'+_0x1d248d+_0x2b7e('0x9f'),{'UserId':_0x4c6373['id'],['queueField']:_0x3cc3d9[_0x3ec679]['id']});}});});});}});}})[_0x2b7e('0x10')](respondWithStatusCode(_0x207bce,null))[_0x2b7e('0x49')](handleError(_0x207bce,null));};exports['removeTeams']=function(_0x1bcaf2,_0x5e0230){return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x1bcaf2[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x5e0230,null))['then'](function(_0x5c730f){if(_0x5c730f){var _0x2657c9=_0x5c730f[_0x2b7e('0x22')]({'plain':!![]});var _0x4339f8=_0x1bcaf2[_0x2b7e('0x3d')][_0x2b7e('0x9a')];return _0x5c730f[_0x2b7e('0x118')](_0x4339f8)[_0x2b7e('0x10')](function(){for(var _0x4e237b=0x0;_0x4e237b<_0x4339f8['length'];_0x4e237b++){var _0x1d6f0d=[];db['Team']['findOne']({'where':{'id':_0x4339f8[_0x4e237b]}})[_0x2b7e('0x10')](function(_0x90c692){_0x1d6f0d['push'](_0x90c692[_0x2b7e('0x10a')]()[_0x2b7e('0x10')](function(_0x1f8906){for(var _0x57edaf=0x0;_0x57edaf<_0x1f8906[_0x2b7e('0x3f')];_0x57edaf++){_0x1f8906[_0x57edaf][_0x2b7e('0x10b')](_0x2b7e('0x92'),'Voice');}return _0x1f8906;}));_0x1d6f0d[_0x2b7e('0x40')](_0x90c692['getChatQueues']()['then'](function(_0xec957a){for(var _0x103ccf=0x0;_0x103ccf<_0xec957a[_0x2b7e('0x3f')];_0x103ccf++){_0xec957a[_0x103ccf][_0x2b7e('0x10b')](_0x2b7e('0x92'),_0x2b7e('0x10e'));}return _0xec957a;}));_0x1d6f0d[_0x2b7e('0x40')](_0x90c692[_0x2b7e('0x10f')]()[_0x2b7e('0x10')](function(_0x3dbe94){for(var _0x148c42=0x0;_0x148c42<_0x3dbe94['length'];_0x148c42++){_0x3dbe94[_0x148c42][_0x2b7e('0x10b')]('channel',_0x2b7e('0x119'));}return _0x3dbe94;}));_0x1d6f0d[_0x2b7e('0x40')](_0x90c692[_0x2b7e('0x110')]()[_0x2b7e('0x10')](function(_0x20577c){for(var _0x34dce9=0x0;_0x34dce9<_0x20577c[_0x2b7e('0x3f')];_0x34dce9++){_0x20577c[_0x34dce9][_0x2b7e('0x10b')]('channel','Sms');}return _0x20577c;}));_0x1d6f0d[_0x2b7e('0x40')](_0x90c692[_0x2b7e('0x112')]()[_0x2b7e('0x10')](function(_0x2aaaf7){for(var _0x21c8ea=0x0;_0x21c8ea<_0x2aaaf7[_0x2b7e('0x3f')];_0x21c8ea++){_0x2aaaf7[_0x21c8ea][_0x2b7e('0x10b')](_0x2b7e('0x92'),_0x2b7e('0x113'));}return _0x2aaaf7;}));_0x1d6f0d[_0x2b7e('0x40')](_0x90c692[_0x2b7e('0x114')]()[_0x2b7e('0x10')](function(_0x5791ef){for(var _0x1c09bf=0x0;_0x1c09bf<_0x5791ef[_0x2b7e('0x3f')];_0x1c09bf++){_0x5791ef[_0x1c09bf]['setDataValue'](_0x2b7e('0x92'),'Fax');}return _0x5791ef;}));_0x1d6f0d['push'](_0x90c692['getOpenchannelQueues']()[_0x2b7e('0x10')](function(_0x3ba384){for(var _0x15a6e9=0x0;_0x15a6e9<_0x3ba384[_0x2b7e('0x3f')];_0x15a6e9++){_0x3ba384[_0x15a6e9]['setDataValue'](_0x2b7e('0x92'),_0x2b7e('0x11a'));}return _0x3ba384;}));return BPromise[_0x2b7e('0x48')](_0x1d6f0d);})['then'](function(_0x2fd9ae){var _0xe5f76c=_[_0x2b7e('0x115')](_0x2fd9ae);_0x1d6f0d=[];return db[_0x2b7e('0x5e')][_0x2b7e('0x116')](function(_0x244f58){for(var _0xba149d=0x0;_0xba149d<_0xe5f76c['length'];_0xba149d++){_0x1d6f0d['push'](_0xe5f76c[_0xba149d][_0x2b7e('0x11b')](_0x2657c9['id']),{'transaction':_0x244f58});}return BPromise[_0x2b7e('0x48')](_0x1d6f0d)[_0x2b7e('0x10')](function(){if(_0x2657c9['online']){return BPromise['each'](_[_0x2b7e('0x29')](_0xe5f76c,function(_0x54757d){return _0x54757d[_0x2b7e('0x117')](_0x2b7e('0x92'))===_0x2b7e('0x10c');}),function(_0x3d0f29){return db[_0x2b7e('0xa8')]['destroy']({'where':{'VoiceQueueId':_0x3d0f29['id'],'UserId':_0x2657c9['id']},'transaction':_0x244f58});});}else{return;}})[_0x2b7e('0x10')](function(){for(var _0x5b0a07=0x0;_0x5b0a07<_0xe5f76c[_0x2b7e('0x3f')];_0x5b0a07++){var _0x5662c4=_0xe5f76c[_0x5b0a07][_0x2b7e('0x117')](_0x2b7e('0x92'));var _0x426b89=_0x5662c4+_0x2b7e('0x9d');socket[_0x2b7e('0xa6')](_0x2b7e('0x25')+_0x5662c4+_0x2b7e('0xa7'),{'UserId':_0x2657c9['id'],['queueField']:_0xe5f76c[_0x5b0a07]['id']});}});});});}});}})[_0x2b7e('0x10')](respondWithStatusCode(_0x5e0230,null))[_0x2b7e('0x49')](handleError(_0x5e0230,null));};exports[_0x2b7e('0x11c')]=function(_0x2a348e,_0x1399ca){var _0xd6e91a={};var _0x148e86={};var _0x4d3dd2;var _0x6bd598;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x2a348e['params']['id']}})['then'](handleEntityNotFound(_0x1399ca,null))['then'](function(_0x29ac11){if(_0x29ac11){_0x4d3dd2=_0x29ac11;_0x148e86['model']=_[_0x2b7e('0x4e')](db[_0x2b7e('0x11d')]['rawAttributes']);_0x148e86[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x2a348e[_0x2b7e('0x3d')]);_0x148e86[_0x2b7e('0x4f')]=_['intersection'](_0x148e86['model'],_0x148e86[_0x2b7e('0x3d')]);_0xd6e91a[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x148e86[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x2a348e[_0x2b7e('0x3d')]['fields']));_0xd6e91a[_0x2b7e('0x3c')]=_0xd6e91a['attributes'][_0x2b7e('0x3f')]?_0xd6e91a['attributes']:_0x148e86[_0x2b7e('0x4c')];_0xd6e91a[_0x2b7e('0xcc')]=qs['sort'](_0x2a348e['query']['sort']);_0xd6e91a['where']=qs['filters'](_[_0x2b7e('0xc0')](_0x2a348e[_0x2b7e('0x3d')],_0x148e86[_0x2b7e('0x4f')]));if(_0x2a348e['query']['filter']){_0xd6e91a[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0xd6e91a['where'],{'$or':_[_0x2b7e('0x81')](_0xd6e91a['attributes'],function(_0x4c8348){var _0x31942d={};_0x31942d[_0x4c8348]={'$like':'%'+_0x2a348e['query'][_0x2b7e('0x29')]+'%'};return _0x31942d;})});}_0xd6e91a=_[_0x2b7e('0x52')]({},_0xd6e91a,_0x2a348e[_0x2b7e('0xc2')]);return _0x4d3dd2[_0x2b7e('0x11c')](_0xd6e91a);}})[_0x2b7e('0x10')](function(_0x38f8e9){if(_0x38f8e9){_0x6bd598=_0x38f8e9['length'];if(!_0x2a348e['query']['hasOwnProperty']('nolimit')){_0xd6e91a[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x2a348e[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0xd6e91a['offset']=qs[_0x2b7e('0x1a')](_0x2a348e['query']['offset']);}return _0x4d3dd2[_0x2b7e('0x11c')](_0xd6e91a);}})['then'](function(_0x3dce2a){if(_0x3dce2a){return _0x3dce2a?{'count':_0x6bd598,'rows':_0x3dce2a}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x1399ca,null))[_0x2b7e('0x49')](handleError(_0x1399ca,null));};exports['getAgents']=function(_0x2f54d1,_0x2f98b3){var _0x5698c8={};var _0x4824aa={};var _0x234343;var _0x151f1b;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x2f54d1[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x2f98b3,null))[_0x2b7e('0x10')](function(_0x497206){if(_0x497206){_0x234343=_0x497206;_0x4824aa[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0x39')][_0x2b7e('0x33')]);_0x4824aa[_0x2b7e('0x3d')]=_['keys'](_0x2f54d1[_0x2b7e('0x3d')]);_0x4824aa['filters']=_[_0x2b7e('0x50')](_0x4824aa[_0x2b7e('0x4c')],_0x4824aa[_0x2b7e('0x3d')]);_0x5698c8['attributes']=_[_0x2b7e('0x50')](_0x4824aa[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x2f54d1['query']['fields']));_0x5698c8['attributes']=_0x5698c8['attributes'][_0x2b7e('0x3f')]?_0x5698c8[_0x2b7e('0x3c')]:_0x4824aa[_0x2b7e('0x4c')];_0x5698c8[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x2f54d1[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x5698c8[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x2f54d1[_0x2b7e('0x3d')],_0x4824aa[_0x2b7e('0x4f')]));if(_0x2f54d1[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x5698c8[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x5698c8[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x5698c8[_0x2b7e('0x3c')],function(_0x580217){var _0x39d23b={};_0x39d23b[_0x580217]={'$like':'%'+_0x2f54d1[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x39d23b;})});}_0x5698c8[_0x2b7e('0x4c')]=db['User'];_0x5698c8['as']='Agents';_0x5698c8=_[_0x2b7e('0x52')]({},_0x5698c8,_0x2f54d1[_0x2b7e('0xc2')]);return _0x234343[_0x2b7e('0x10a')]({'include':[_0x5698c8]});}})[_0x2b7e('0x10')](function(_0x18fd50){if(_0x18fd50){var _0x4cbf71={},_0x2d4b13=[],_0x2e68f1=0x0;for(var _0x6405da=0x0;_0x6405da<_0x18fd50[_0x2b7e('0x3f')];_0x6405da+=0x1){for(var _0x1d422e=0x0,_0x4e2550;_0x1d422e<_0x18fd50[_0x6405da][_0x2b7e('0x26')][_0x2b7e('0x3f')];_0x1d422e+=0x1){_0x4e2550=_0x18fd50[_0x6405da][_0x2b7e('0x26')][_0x1d422e][_0x2b7e('0x22')]({'plain':!![]});_0x4cbf71[_0x4e2550['id']]=_0x4e2550;}}_0x4cbf71=_[_0x2b7e('0x11e')](_0x4cbf71);for(var _0x3d2a72=qs[_0x2b7e('0x1a')](_0x2f54d1[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);_0x3d2a72<_0x4cbf71[_0x2b7e('0x3f')]&&_0x2d4b13[_0x2b7e('0x3f')]<qs['limit'](_0x2f54d1[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x3d2a72+=0x1){if(_0x4cbf71[_0x3d2a72]){_0x2d4b13['push'](_0x4cbf71[_0x3d2a72]);}}return{'count':_0x4cbf71['length'],'rows':_0x2d4b13};}})['then'](respondWithResult(_0x2f98b3,null))[_0x2b7e('0x49')](handleError(_0x2f98b3,null));};exports[_0x2b7e('0x21')]=function(_0x1c81cf,_0x1a87fb){if(_0x1c81cf['user']['id']==_0x1c81cf[_0x2b7e('0x4b')]['id']){return _0x1a87fb[_0x2b7e('0x1e')](0x1f4)[_0x2b7e('0x32')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db['User']['find']({'where':{'id':_0x1c81cf[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x1a87fb,null))[_0x2b7e('0x10')](removeEntity(_0x1a87fb,null))['catch'](handleError(_0x1a87fb,null));};exports[_0x2b7e('0x11f')]=function(_0x3ec8a3,_0xf95c3b){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x3ec8a3['params']['id']}})['then'](handleEntityNotFound(_0xf95c3b,null))['then'](function(_0x142668){if(_0x142668){return _0x142668[_0x2b7e('0x11f')](_0x3ec8a3[_0x2b7e('0x55')]['ids'],_[_0x2b7e('0x109')](_0x3ec8a3['body'],[_0x2b7e('0x9a'),'id'])||{})['spread'](function(){for(var _0x5532e4=0x0;_0x5532e4<_0x3ec8a3[_0x2b7e('0x55')][_0x2b7e('0x9a')]['length'];_0x5532e4+=0x1){socket['emit']('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x3ec8a3[_0x2b7e('0x55')][_0x2b7e('0x9a')][_0x5532e4]),'UserId':Number(_0x3ec8a3[_0x2b7e('0x4b')]['id'])});}return _0x3ec8a3[_0x2b7e('0x55')][_0x2b7e('0x9a')];});}})[_0x2b7e('0x10')](respondWithResult(_0xf95c3b,null))[_0x2b7e('0x49')](handleError(_0xf95c3b,null));};exports['removeChatInteractions']=function(_0x40e737,_0x8fefa4){return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x40e737['params']['id']}})['then'](handleEntityNotFound(_0x8fefa4,null))[_0x2b7e('0x10')](function(_0x1191fb){if(_0x1191fb){return _0x1191fb[_0x2b7e('0x120')](_0x40e737[_0x2b7e('0x3d')][_0x2b7e('0x9a')])[_0x2b7e('0x10')](function(){if(_[_0x2b7e('0x121')](_0x40e737[_0x2b7e('0x3d')][_0x2b7e('0x9a')])){for(var _0x33e1d0=0x0;_0x33e1d0<_0x40e737[_0x2b7e('0x3d')][_0x2b7e('0x9a')][_0x2b7e('0x3f')];_0x33e1d0+=0x1){socket[_0x2b7e('0xa6')](_0x2b7e('0x122'),{'ChatInteractionId':Number(_0x40e737[_0x2b7e('0x3d')][_0x2b7e('0x9a')][_0x33e1d0]),'UserId':Number(_0x40e737[_0x2b7e('0x4b')]['id'])});}}else{socket[_0x2b7e('0xa6')](_0x2b7e('0x122'),{'ChatInteractionId':Number(_0x40e737[_0x2b7e('0x3d')]['ids']),'UserId':Number(_0x40e737[_0x2b7e('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x8fefa4,null))[_0x2b7e('0x49')](handleError(_0x8fefa4,null));};exports[_0x2b7e('0x123')]=function(_0x35a18f,_0xd66388){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x35a18f['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0xd66388,null))['then'](function(_0x6bf239){if(_0x6bf239){return _0x6bf239[_0x2b7e('0x123')](_0x35a18f[_0x2b7e('0x55')][_0x2b7e('0x9a')],_['omit'](_0x35a18f[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{})[_0x2b7e('0x9c')](function(){for(var _0x42efd0=0x0;_0x42efd0<_0x35a18f[_0x2b7e('0x55')]['ids'][_0x2b7e('0x3f')];_0x42efd0+=0x1){socket[_0x2b7e('0xa6')]('user_has_mail_interactions:save',{'MailInteractionId':Number(_0x35a18f[_0x2b7e('0x55')][_0x2b7e('0x9a')][_0x42efd0]),'UserId':Number(_0x35a18f['params']['id'])});}return _0x35a18f[_0x2b7e('0x55')][_0x2b7e('0x9a')];});}})['then'](respondWithResult(_0xd66388,null))[_0x2b7e('0x49')](handleError(_0xd66388,null));};exports[_0x2b7e('0x124')]=function(_0x255f8e,_0x20b1e1){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x255f8e[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x20b1e1,null))[_0x2b7e('0x10')](function(_0x39a6b8){if(_0x39a6b8){return _0x39a6b8[_0x2b7e('0x124')](_0x255f8e[_0x2b7e('0x3d')][_0x2b7e('0x9a')])['then'](function(){if(_[_0x2b7e('0x121')](_0x255f8e[_0x2b7e('0x3d')][_0x2b7e('0x9a')])){for(var _0x554e96=0x0;_0x554e96<_0x255f8e[_0x2b7e('0x3d')]['ids'][_0x2b7e('0x3f')];_0x554e96+=0x1){socket[_0x2b7e('0xa6')](_0x2b7e('0x125'),{'MailInteractionId':Number(_0x255f8e[_0x2b7e('0x3d')]['ids'][_0x554e96]),'UserId':Number(_0x255f8e['params']['id'])});}}else{socket[_0x2b7e('0xa6')](_0x2b7e('0x125'),{'MailInteractionId':Number(_0x255f8e[_0x2b7e('0x3d')][_0x2b7e('0x9a')]),'UserId':Number(_0x255f8e[_0x2b7e('0x4b')]['id'])});}});}})[_0x2b7e('0x10')](respondWithStatusCode(_0x20b1e1,null))['catch'](handleError(_0x20b1e1,null));};exports[_0x2b7e('0x126')]=function(_0x36c9f9,_0x5ad4e5){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x36c9f9[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x5ad4e5,null))[_0x2b7e('0x10')](function(_0x73eba4){if(_0x73eba4){return _0x73eba4[_0x2b7e('0x126')](_0x36c9f9[_0x2b7e('0x55')][_0x2b7e('0x9a')],_[_0x2b7e('0x109')](_0x36c9f9[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{})[_0x2b7e('0x9c')](function(){for(var _0x2faad8=0x0;_0x2faad8<_0x36c9f9['body'][_0x2b7e('0x9a')][_0x2b7e('0x3f')];_0x2faad8+=0x1){socket['emit'](_0x2b7e('0x127'),{'FaxInteractionId':Number(_0x36c9f9[_0x2b7e('0x55')][_0x2b7e('0x9a')][_0x2faad8]),'UserId':Number(_0x36c9f9[_0x2b7e('0x4b')]['id'])});}return _0x36c9f9[_0x2b7e('0x55')][_0x2b7e('0x9a')];});}})[_0x2b7e('0x10')](respondWithResult(_0x5ad4e5,null))[_0x2b7e('0x49')](handleError(_0x5ad4e5,null));};exports['removeFaxInteractions']=function(_0x39f821,_0x3b4203){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x39f821[_0x2b7e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b4203,null))[_0x2b7e('0x10')](function(_0x5958b6){if(_0x5958b6){return _0x5958b6[_0x2b7e('0x128')](_0x39f821[_0x2b7e('0x3d')]['ids'])[_0x2b7e('0x10')](function(){if(_[_0x2b7e('0x121')](_0x39f821[_0x2b7e('0x3d')][_0x2b7e('0x9a')])){for(var _0x25ebb8=0x0;_0x25ebb8<_0x39f821['query'][_0x2b7e('0x9a')]['length'];_0x25ebb8+=0x1){socket['emit'](_0x2b7e('0x129'),{'FaxInteractionId':Number(_0x39f821[_0x2b7e('0x3d')][_0x2b7e('0x9a')][_0x25ebb8]),'UserId':Number(_0x39f821[_0x2b7e('0x4b')]['id'])});}}else{socket[_0x2b7e('0xa6')](_0x2b7e('0x129'),{'FaxInteractionId':Number(_0x39f821['query'][_0x2b7e('0x9a')]),'UserId':Number(_0x39f821[_0x2b7e('0x4b')]['id'])});}});}})[_0x2b7e('0x10')](respondWithStatusCode(_0x3b4203,null))['catch'](handleError(_0x3b4203,null));};exports[_0x2b7e('0x12a')]=function(_0x4a1965,_0x5d862c){return db['User']['find']({'where':{'id':_0x4a1965['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x5d862c,null))[_0x2b7e('0x10')](function(_0x4ce1c8){if(_0x4ce1c8){return _0x4ce1c8[_0x2b7e('0x12a')](_0x4a1965[_0x2b7e('0x55')][_0x2b7e('0x9a')],_['omit'](_0x4a1965[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{})['spread'](function(){for(var _0x1bba5d=0x0;_0x1bba5d<_0x4a1965[_0x2b7e('0x55')][_0x2b7e('0x9a')][_0x2b7e('0x3f')];_0x1bba5d+=0x1){socket['emit']('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x4a1965[_0x2b7e('0x55')][_0x2b7e('0x9a')][_0x1bba5d]),'UserId':Number(_0x4a1965[_0x2b7e('0x4b')]['id'])});}return _0x4a1965['body'][_0x2b7e('0x9a')];});}})[_0x2b7e('0x10')](respondWithResult(_0x5d862c,null))[_0x2b7e('0x49')](handleError(_0x5d862c,null));};exports[_0x2b7e('0x12b')]=function(_0x450942,_0x694370){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x450942[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x694370,null))[_0x2b7e('0x10')](function(_0x33cf94){if(_0x33cf94){return _0x33cf94[_0x2b7e('0x12b')](_0x450942['query'][_0x2b7e('0x9a')])['then'](function(){if(_[_0x2b7e('0x121')](_0x450942['query'][_0x2b7e('0x9a')])){for(var _0x4735c4=0x0;_0x4735c4<_0x450942[_0x2b7e('0x3d')][_0x2b7e('0x9a')][_0x2b7e('0x3f')];_0x4735c4+=0x1){socket[_0x2b7e('0xa6')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x450942['query'][_0x2b7e('0x9a')][_0x4735c4]),'UserId':Number(_0x450942['params']['id'])});}}else{socket[_0x2b7e('0xa6')](_0x2b7e('0x12c'),{'SmsInteractionId':Number(_0x450942['query'][_0x2b7e('0x9a')]),'UserId':Number(_0x450942['params']['id'])});}});}})[_0x2b7e('0x10')](respondWithStatusCode(_0x694370,null))[_0x2b7e('0x49')](handleError(_0x694370,null));};exports[_0x2b7e('0x12d')]=function(_0x34fc3f,_0x318625){return db[_0x2b7e('0x39')]['find']({'where':{'id':_0x34fc3f[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x318625,null))[_0x2b7e('0x10')](function(_0x3b7228){if(_0x3b7228){return _0x3b7228['addOpenchannelInteractions'](_0x34fc3f[_0x2b7e('0x55')]['ids'],_[_0x2b7e('0x109')](_0x34fc3f[_0x2b7e('0x55')],['ids','id'])||{})[_0x2b7e('0x9c')](function(){for(var _0x4fa03e=0x0;_0x4fa03e<_0x34fc3f['body'][_0x2b7e('0x9a')][_0x2b7e('0x3f')];_0x4fa03e+=0x1){socket[_0x2b7e('0xa6')](_0x2b7e('0x12e'),{'OpenchannelInteractionId':Number(_0x34fc3f[_0x2b7e('0x55')]['ids'][_0x4fa03e]),'UserId':Number(_0x34fc3f[_0x2b7e('0x4b')]['id'])});}return _0x34fc3f['body'][_0x2b7e('0x9a')];});}})[_0x2b7e('0x10')](respondWithResult(_0x318625,null))[_0x2b7e('0x49')](handleError(_0x318625,null));};exports['removeOpenchannelInteractions']=function(_0x4a7932,_0x397e5b){return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x4a7932['params']['id']}})['then'](handleEntityNotFound(_0x397e5b,null))[_0x2b7e('0x10')](function(_0x2bbdc1){if(_0x2bbdc1){return _0x2bbdc1[_0x2b7e('0x12f')](_0x4a7932[_0x2b7e('0x3d')][_0x2b7e('0x9a')])['then'](function(){if(_['isArray'](_0x4a7932[_0x2b7e('0x3d')]['ids'])){for(var _0xd49005=0x0;_0xd49005<_0x4a7932['query']['ids'][_0x2b7e('0x3f')];_0xd49005+=0x1){socket[_0x2b7e('0xa6')](_0x2b7e('0x130'),{'OpenchannelInteractionId':Number(_0x4a7932[_0x2b7e('0x3d')][_0x2b7e('0x9a')][_0xd49005]),'UserId':Number(_0x4a7932[_0x2b7e('0x4b')]['id'])});}}else{socket[_0x2b7e('0xa6')](_0x2b7e('0x130'),{'OpenchannelInteractionId':Number(_0x4a7932[_0x2b7e('0x3d')][_0x2b7e('0x9a')]),'UserId':Number(_0x4a7932['params']['id'])});}});}})[_0x2b7e('0x10')](respondWithStatusCode(_0x397e5b,null))[_0x2b7e('0x49')](handleError(_0x397e5b,null));};exports['addWhatsappInteractions']=function(_0x114b98,_0xe293f6){return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x114b98[_0x2b7e('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe293f6,null))['then'](function(_0x13c58a){if(_0x13c58a){return _0x13c58a['addWhatsappInteractions'](_0x114b98['body'][_0x2b7e('0x9a')],_['omit'](_0x114b98[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{})['spread'](function(){for(var _0xf54d0f=0x0;_0xf54d0f<_0x114b98[_0x2b7e('0x55')][_0x2b7e('0x9a')]['length'];_0xf54d0f+=0x1){socket[_0x2b7e('0xa6')](_0x2b7e('0x131'),{'WhatsappInteractionId':Number(_0x114b98[_0x2b7e('0x55')]['ids'][_0xf54d0f]),'UserId':Number(_0x114b98['params']['id'])});}return _0x114b98[_0x2b7e('0x55')][_0x2b7e('0x9a')];});}})['then'](respondWithResult(_0xe293f6,null))['catch'](handleError(_0xe293f6,null));};exports[_0x2b7e('0x132')]=function(_0x19a9a7,_0x50638e){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x19a9a7[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x50638e,null))[_0x2b7e('0x10')](function(_0x3767e4){if(_0x3767e4){return _0x3767e4[_0x2b7e('0x132')](_0x19a9a7[_0x2b7e('0x3d')]['ids']);}})[_0x2b7e('0x10')](respondWithStatusCode(_0x50638e,null))['catch'](handleError(_0x50638e,null));};exports[_0x2b7e('0x133')]=function(_0x563f70,_0x388938){var _0x37303e={};var _0x30145e={};var _0x5dd809;var _0x5cfd3a;return db[_0x2b7e('0x39')]['findOne']({'where':{'id':_0x563f70[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x388938,null))['then'](function(_0x1b9221){if(_0x1b9221){_0x5dd809=_0x1b9221;_0x30145e[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0x134')][_0x2b7e('0x33')]);_0x30145e['query']=_[_0x2b7e('0x4e')](_0x563f70[_0x2b7e('0x3d')]);_0x30145e[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x30145e[_0x2b7e('0x4c')],_0x30145e['query']);_0x37303e[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x30145e[_0x2b7e('0x4c')],qs['fields'](_0x563f70[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x37303e[_0x2b7e('0x3c')]=_0x37303e['attributes'][_0x2b7e('0x3f')]?_0x37303e['attributes']:_0x30145e[_0x2b7e('0x4c')];_0x37303e['order']=qs['sort'](_0x563f70[_0x2b7e('0x3d')]['sort']);_0x37303e['where']=qs['filters'](_[_0x2b7e('0xc0')](_0x563f70[_0x2b7e('0x3d')],_0x30145e['filters']));if(_0x563f70['query'][_0x2b7e('0x29')]){_0x37303e[_0x2b7e('0xc1')]=_['merge'](_0x37303e['where'],{'$or':_[_0x2b7e('0x81')](_0x37303e['attributes'],function(_0x5bd8cf){var _0xcf524b={};_0xcf524b[_0x5bd8cf]={'$like':'%'+_0x563f70[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0xcf524b;})});}_0x37303e=_[_0x2b7e('0x52')]({},_0x37303e,_0x563f70[_0x2b7e('0xc2')]);return _0x5dd809[_0x2b7e('0x133')](_0x37303e);}})['then'](function(_0x41f2d9){if(_0x41f2d9){_0x5cfd3a=_0x41f2d9[_0x2b7e('0x3f')];if(!_0x563f70[_0x2b7e('0x3d')]['hasOwnProperty']('nolimit')){_0x37303e['limit']=qs[_0x2b7e('0x1c')](_0x563f70[_0x2b7e('0x3d')]['limit']);_0x37303e[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x563f70[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}return _0x5dd809['getVoicePrefixes'](_0x37303e);}})[_0x2b7e('0x10')](function(_0x8668af){if(_0x8668af){return _0x8668af?{'count':_0x5cfd3a,'rows':_0x8668af}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x388938,null))['catch'](handleError(_0x388938,null));};exports['getFaxAccounts']=function(_0x3713e9,_0x4015a8){var _0x2c4930={};var _0x5abde7={};var _0x335ed7;var _0x18ec8a;return db[_0x2b7e('0x39')]['findOne']({'where':{'id':_0x3713e9['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x4015a8,null))['then'](function(_0x3e9437){if(_0x3e9437){_0x335ed7=_0x3e9437;_0x5abde7[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0x135')][_0x2b7e('0x33')]);_0x5abde7[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x3713e9[_0x2b7e('0x3d')]);_0x5abde7[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x5abde7[_0x2b7e('0x4c')],_0x5abde7[_0x2b7e('0x3d')]);_0x2c4930[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x5abde7['model'],qs[_0x2b7e('0x51')](_0x3713e9[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x2c4930[_0x2b7e('0x3c')]=_0x2c4930[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x2c4930[_0x2b7e('0x3c')]:_0x5abde7['model'];_0x2c4930[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x3713e9[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x2c4930[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x3713e9[_0x2b7e('0x3d')],_0x5abde7[_0x2b7e('0x4f')]));if(_0x3713e9['query']['filter']){_0x2c4930[_0x2b7e('0xc1')]=_['merge'](_0x2c4930[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x2c4930[_0x2b7e('0x3c')],function(_0x5a53f1){var _0x5d5107={};_0x5d5107[_0x5a53f1]={'$like':'%'+_0x3713e9[_0x2b7e('0x3d')]['filter']+'%'};return _0x5d5107;})});}_0x2c4930=_[_0x2b7e('0x52')]({},_0x2c4930,_0x3713e9[_0x2b7e('0xc2')]);return _0x335ed7[_0x2b7e('0x136')](_0x2c4930);}})[_0x2b7e('0x10')](function(_0x3a169d){if(_0x3a169d){_0x18ec8a=_0x3a169d[_0x2b7e('0x3f')];if(!_0x3713e9[_0x2b7e('0x3d')]['hasOwnProperty']('nolimit')){_0x2c4930[_0x2b7e('0x1c')]=qs['limit'](_0x3713e9[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x2c4930[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x3713e9[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}return _0x335ed7[_0x2b7e('0x136')](_0x2c4930);}})[_0x2b7e('0x10')](function(_0x8f5a42){if(_0x8f5a42){return _0x8f5a42?{'count':_0x18ec8a,'rows':_0x8f5a42}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x4015a8,null))[_0x2b7e('0x49')](handleError(_0x4015a8,null));};exports['addFaxAccounts']=function(_0x117b63,_0x5811b0){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x117b63[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x5811b0,null))[_0x2b7e('0x10')](function(_0x285615){if(_0x285615){return _0x285615[_0x2b7e('0x137')](_0x117b63['body'][_0x2b7e('0x9a')],_[_0x2b7e('0x109')](_0x117b63[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{});}})['then'](respondWithResult(_0x5811b0,null))[_0x2b7e('0x49')](handleError(_0x5811b0,null));};exports[_0x2b7e('0x138')]=function(_0x51b020,_0x4b05a4){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x51b020[_0x2b7e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4b05a4,null))[_0x2b7e('0x10')](function(_0x43a3a2){if(_0x43a3a2){return _0x43a3a2['removeFaxAccounts'](_0x51b020[_0x2b7e('0x3d')][_0x2b7e('0x9a')]);}})['then'](respondWithStatusCode(_0x4b05a4,null))[_0x2b7e('0x49')](handleError(_0x4b05a4,null));};exports[_0x2b7e('0x139')]=function(_0x26d1c6,_0x13508f){var _0x181cae={};var _0x3ecd3d={};var _0x4159cf;var _0x571837;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x26d1c6['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x13508f,null))[_0x2b7e('0x10')](function(_0x1f45e8){if(_0x1f45e8){_0x4159cf=_0x1f45e8;_0x3ecd3d[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0x13a')][_0x2b7e('0x33')]);_0x3ecd3d['query']=_[_0x2b7e('0x4e')](_0x26d1c6[_0x2b7e('0x3d')]);_0x3ecd3d[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x3ecd3d['model'],_0x3ecd3d[_0x2b7e('0x3d')]);_0x181cae['attributes']=_['intersection'](_0x3ecd3d[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x26d1c6[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x181cae[_0x2b7e('0x3c')]=_0x181cae['attributes'][_0x2b7e('0x3f')]?_0x181cae[_0x2b7e('0x3c')]:_0x3ecd3d[_0x2b7e('0x4c')];_0x181cae[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x26d1c6[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x181cae[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x26d1c6['query'],_0x3ecd3d[_0x2b7e('0x4f')]));if(_0x26d1c6[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x181cae[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x181cae['where'],{'$or':_[_0x2b7e('0x81')](_0x181cae[_0x2b7e('0x3c')],function(_0x4d7723){var _0x2fbe1a={};_0x2fbe1a[_0x4d7723]={'$like':'%'+_0x26d1c6['query'][_0x2b7e('0x29')]+'%'};return _0x2fbe1a;})});}_0x181cae=_[_0x2b7e('0x52')]({},_0x181cae,_0x26d1c6['options']);return _0x4159cf['getMailAccounts'](_0x181cae);}})[_0x2b7e('0x10')](function(_0x1b872f){if(_0x1b872f){_0x571837=_0x1b872f[_0x2b7e('0x3f')];if(!_0x26d1c6[_0x2b7e('0x3d')][_0x2b7e('0xc3')]('nolimit')){_0x181cae['limit']=qs['limit'](_0x26d1c6['query'][_0x2b7e('0x1c')]);_0x181cae[_0x2b7e('0x1a')]=qs['offset'](_0x26d1c6[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}return _0x4159cf[_0x2b7e('0x139')](_0x181cae);}})[_0x2b7e('0x10')](function(_0x40ed2b){if(_0x40ed2b){return _0x40ed2b?{'count':_0x571837,'rows':_0x40ed2b}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x13508f,null))[_0x2b7e('0x49')](handleError(_0x13508f,null));};exports[_0x2b7e('0x13b')]=function(_0x524aa1,_0xfe93b7){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x524aa1[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0xfe93b7,null))[_0x2b7e('0x10')](function(_0x24615f){if(_0x24615f){return _0x24615f[_0x2b7e('0x13b')](_0x524aa1[_0x2b7e('0x55')]['ids'],_[_0x2b7e('0x109')](_0x524aa1[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{});}})['then'](respondWithResult(_0xfe93b7,null))[_0x2b7e('0x49')](handleError(_0xfe93b7,null));};exports[_0x2b7e('0x13c')]=function(_0x2f736f,_0x44c275){return db['User']['find']({'where':{'id':_0x2f736f['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x44c275,null))[_0x2b7e('0x10')](function(_0x92b00c){if(_0x92b00c){return _0x92b00c['removeMailAccounts'](_0x2f736f[_0x2b7e('0x3d')][_0x2b7e('0x9a')]);}})[_0x2b7e('0x10')](respondWithStatusCode(_0x44c275,null))[_0x2b7e('0x49')](handleError(_0x44c275,null));};exports[_0x2b7e('0x13d')]=function(_0x53a1ac,_0x19678b){var _0x4095f1={};var _0x357fb1={};var _0x51249e;var _0x3357e9;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x53a1ac[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x19678b,null))['then'](function(_0x29530a){if(_0x29530a){_0x51249e=_0x29530a;_0x357fb1['model']=_[_0x2b7e('0x4e')](db[_0x2b7e('0x13e')][_0x2b7e('0x33')]);_0x357fb1[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x53a1ac[_0x2b7e('0x3d')]);_0x357fb1[_0x2b7e('0x4f')]=_['intersection'](_0x357fb1[_0x2b7e('0x4c')],_0x357fb1[_0x2b7e('0x3d')]);_0x4095f1[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x357fb1[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x53a1ac[_0x2b7e('0x3d')]['fields']));_0x4095f1[_0x2b7e('0x3c')]=_0x4095f1[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x4095f1['attributes']:_0x357fb1[_0x2b7e('0x4c')];_0x4095f1[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x53a1ac[_0x2b7e('0x3d')]['sort']);_0x4095f1[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_['pick'](_0x53a1ac[_0x2b7e('0x3d')],_0x357fb1[_0x2b7e('0x4f')]));if(_0x53a1ac[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x4095f1['where']=_['merge'](_0x4095f1[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x4095f1[_0x2b7e('0x3c')],function(_0x5ac00f){var _0x361eb7={};_0x361eb7[_0x5ac00f]={'$like':'%'+_0x53a1ac[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x361eb7;})});}_0x4095f1=_[_0x2b7e('0x52')]({},_0x4095f1,_0x53a1ac['options']);return _0x51249e['getOpenchannelAccounts'](_0x4095f1);}})[_0x2b7e('0x10')](function(_0x555b3c){if(_0x555b3c){_0x3357e9=_0x555b3c[_0x2b7e('0x3f')];if(!_0x53a1ac['query'][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x4095f1[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x53a1ac['query']['limit']);_0x4095f1[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x53a1ac[_0x2b7e('0x3d')]['offset']);}return _0x51249e[_0x2b7e('0x13d')](_0x4095f1);}})[_0x2b7e('0x10')](function(_0x31833e){if(_0x31833e){return _0x31833e?{'count':_0x3357e9,'rows':_0x31833e}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x19678b,null))[_0x2b7e('0x49')](handleError(_0x19678b,null));};exports['addOpenchannelAccounts']=function(_0x3083c4,_0x3c2209){return db[_0x2b7e('0x39')]['find']({'where':{'id':_0x3083c4['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x3c2209,null))['then'](function(_0x2bd82d){if(_0x2bd82d){return _0x2bd82d['addOpenchannelAccounts'](_0x3083c4[_0x2b7e('0x55')][_0x2b7e('0x9a')],_[_0x2b7e('0x109')](_0x3083c4[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{});}})[_0x2b7e('0x10')](respondWithResult(_0x3c2209,null))[_0x2b7e('0x49')](handleError(_0x3c2209,null));};exports[_0x2b7e('0x13f')]=function(_0x2fa453,_0x565435){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x2fa453[_0x2b7e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x565435,null))[_0x2b7e('0x10')](function(_0x5f1384){if(_0x5f1384){return _0x5f1384['removeOpenchannelAccounts'](_0x2fa453[_0x2b7e('0x3d')][_0x2b7e('0x9a')]);}})[_0x2b7e('0x10')](respondWithStatusCode(_0x565435,null))[_0x2b7e('0x49')](handleError(_0x565435,null));};exports[_0x2b7e('0x140')]=function(_0x47d5ec,_0x1a1125){var _0x484c6f={};var _0x5f292b={};var _0x478071;var _0x5bdab4;return db['User'][_0x2b7e('0x8c')]({'where':{'id':_0x47d5ec[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x1a1125,null))[_0x2b7e('0x10')](function(_0xf037da){if(_0xf037da){_0x478071=_0xf037da;_0x5f292b[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0x141')][_0x2b7e('0x33')]);_0x5f292b[_0x2b7e('0x3d')]=_[_0x2b7e('0x4e')](_0x47d5ec[_0x2b7e('0x3d')]);_0x5f292b[_0x2b7e('0x4f')]=_['intersection'](_0x5f292b['model'],_0x5f292b[_0x2b7e('0x3d')]);_0x484c6f[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x5f292b[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x47d5ec[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x484c6f[_0x2b7e('0x3c')]=_0x484c6f['attributes']['length']?_0x484c6f[_0x2b7e('0x3c')]:_0x5f292b[_0x2b7e('0x4c')];_0x484c6f[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x47d5ec[_0x2b7e('0x3d')][_0x2b7e('0xbf')]);_0x484c6f['where']=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x47d5ec['query'],_0x5f292b[_0x2b7e('0x4f')]));if(_0x47d5ec[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x484c6f[_0x2b7e('0xc1')]=_['merge'](_0x484c6f[_0x2b7e('0xc1')],{'$or':_['map'](_0x484c6f[_0x2b7e('0x3c')],function(_0x4334a4){var _0x4c74d5={};_0x4c74d5[_0x4334a4]={'$like':'%'+_0x47d5ec[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x4c74d5;})});}_0x484c6f=_[_0x2b7e('0x52')]({},_0x484c6f,_0x47d5ec[_0x2b7e('0xc2')]);return _0x478071[_0x2b7e('0x140')](_0x484c6f);}})['then'](function(_0x384dd7){if(_0x384dd7){_0x5bdab4=_0x384dd7[_0x2b7e('0x3f')];if(!_0x47d5ec['query'][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x484c6f[_0x2b7e('0x1c')]=qs['limit'](_0x47d5ec[_0x2b7e('0x3d')][_0x2b7e('0x1c')]);_0x484c6f[_0x2b7e('0x1a')]=qs[_0x2b7e('0x1a')](_0x47d5ec[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}return _0x478071[_0x2b7e('0x140')](_0x484c6f);}})['then'](function(_0x43d2b7){if(_0x43d2b7){return _0x43d2b7?{'count':_0x5bdab4,'rows':_0x43d2b7}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x1a1125,null))['catch'](handleError(_0x1a1125,null));};exports['addSmsAccounts']=function(_0x5527f5,_0xfba06f){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x5527f5[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0xfba06f,null))[_0x2b7e('0x10')](function(_0x5b28cd){if(_0x5b28cd){return _0x5b28cd[_0x2b7e('0x142')](_0x5527f5[_0x2b7e('0x55')]['ids'],_['omit'](_0x5527f5[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{});}})[_0x2b7e('0x10')](respondWithResult(_0xfba06f,null))['catch'](handleError(_0xfba06f,null));};exports[_0x2b7e('0x143')]=function(_0x4fb0c3,_0x40c62d){return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x4fb0c3[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x40c62d,null))[_0x2b7e('0x10')](function(_0x1aa3b1){if(_0x1aa3b1){return _0x1aa3b1[_0x2b7e('0x143')](_0x4fb0c3['query'][_0x2b7e('0x9a')]);}})[_0x2b7e('0x10')](respondWithStatusCode(_0x40c62d,null))['catch'](handleError(_0x40c62d,null));};exports[_0x2b7e('0x144')]=function(_0x4904bd,_0x26cd6d){var _0x485e99={};var _0xc539af={};var _0x293990;var _0xd84b87;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x4904bd[_0x2b7e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x26cd6d,null))[_0x2b7e('0x10')](function(_0x55adc2){if(_0x55adc2){_0x293990=_0x55adc2;_0xc539af[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0x145')][_0x2b7e('0x33')]);_0xc539af[_0x2b7e('0x3d')]=_['keys'](_0x4904bd[_0x2b7e('0x3d')]);_0xc539af['filters']=_['intersection'](_0xc539af[_0x2b7e('0x4c')],_0xc539af[_0x2b7e('0x3d')]);_0x485e99[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0xc539af[_0x2b7e('0x4c')],qs['fields'](_0x4904bd[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x485e99['attributes']=_0x485e99[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x485e99[_0x2b7e('0x3c')]:_0xc539af[_0x2b7e('0x4c')];_0x485e99['order']=qs[_0x2b7e('0xbf')](_0x4904bd[_0x2b7e('0x3d')]['sort']);_0x485e99[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_['pick'](_0x4904bd[_0x2b7e('0x3d')],_0xc539af[_0x2b7e('0x4f')]));if(_0x4904bd['query'][_0x2b7e('0x29')]){_0x485e99[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x485e99[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x485e99[_0x2b7e('0x3c')],function(_0x406045){var _0x2fa846={};_0x2fa846[_0x406045]={'$like':'%'+_0x4904bd[_0x2b7e('0x3d')][_0x2b7e('0x29')]+'%'};return _0x2fa846;})});}_0x485e99=_['merge']({},_0x485e99,_0x4904bd['options']);return _0x293990[_0x2b7e('0x144')](_0x485e99);}})[_0x2b7e('0x10')](function(_0x17d16c){if(_0x17d16c){_0xd84b87=_0x17d16c[_0x2b7e('0x3f')];if(!_0x4904bd[_0x2b7e('0x3d')][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x485e99['limit']=qs['limit'](_0x4904bd[_0x2b7e('0x3d')]['limit']);_0x485e99['offset']=qs['offset'](_0x4904bd[_0x2b7e('0x3d')]['offset']);}return _0x293990[_0x2b7e('0x144')](_0x485e99);}})['then'](function(_0x1d2f48){if(_0x1d2f48){return _0x1d2f48?{'count':_0xd84b87,'rows':_0x1d2f48}:null;}})['then'](respondWithResult(_0x26cd6d,null))[_0x2b7e('0x49')](handleError(_0x26cd6d,null));};exports[_0x2b7e('0x146')]=function(_0x4eb81c,_0x372b9c){return db[_0x2b7e('0x39')]['find']({'where':{'id':_0x4eb81c['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x372b9c,null))[_0x2b7e('0x10')](function(_0x4587cd){if(_0x4587cd){return _0x4587cd[_0x2b7e('0x146')](_0x4eb81c[_0x2b7e('0x55')][_0x2b7e('0x9a')],_[_0x2b7e('0x109')](_0x4eb81c[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{});}})[_0x2b7e('0x10')](respondWithResult(_0x372b9c,null))[_0x2b7e('0x49')](handleError(_0x372b9c,null));};exports[_0x2b7e('0x147')]=function(_0x389c00,_0x1e011f){return db['User']['find']({'where':{'id':_0x389c00[_0x2b7e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e011f,null))[_0x2b7e('0x10')](function(_0xbc16f9){if(_0xbc16f9){return _0xbc16f9['removeChatWebsites'](_0x389c00[_0x2b7e('0x3d')][_0x2b7e('0x9a')]);}})[_0x2b7e('0x10')](respondWithStatusCode(_0x1e011f,null))[_0x2b7e('0x49')](handleError(_0x1e011f,null));};exports[_0x2b7e('0x148')]=function(_0x3d8622,_0x86669){var _0x1b9013={};var _0x36afb9={};var _0x5548b7;var _0x26a39b;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x3d8622['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x86669,null))[_0x2b7e('0x10')](function(_0x178eae){if(_0x178eae){_0x5548b7=_0x178eae;_0x36afb9[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](db[_0x2b7e('0x149')][_0x2b7e('0x33')]);_0x36afb9['query']=_[_0x2b7e('0x4e')](_0x3d8622['query']);_0x36afb9[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0x36afb9[_0x2b7e('0x4c')],_0x36afb9['query']);_0x1b9013[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0x36afb9['model'],qs[_0x2b7e('0x51')](_0x3d8622[_0x2b7e('0x3d')][_0x2b7e('0x51')]));_0x1b9013[_0x2b7e('0x3c')]=_0x1b9013[_0x2b7e('0x3c')]['length']?_0x1b9013[_0x2b7e('0x3c')]:_0x36afb9[_0x2b7e('0x4c')];_0x1b9013['order']=qs[_0x2b7e('0xbf')](_0x3d8622['query'][_0x2b7e('0xbf')]);_0x1b9013[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x3d8622[_0x2b7e('0x3d')],_0x36afb9[_0x2b7e('0x4f')]));if(_0x3d8622[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x1b9013['where']=_[_0x2b7e('0x52')](_0x1b9013[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x1b9013[_0x2b7e('0x3c')],function(_0x282384){var _0x11b698={};_0x11b698[_0x282384]={'$like':'%'+_0x3d8622['query'][_0x2b7e('0x29')]+'%'};return _0x11b698;})});}_0x1b9013=_[_0x2b7e('0x52')]({},_0x1b9013,_0x3d8622['options']);return _0x5548b7[_0x2b7e('0x148')](_0x1b9013);}})['then'](function(_0x1ed337){if(_0x1ed337){_0x26a39b=_0x1ed337[_0x2b7e('0x3f')];if(!_0x3d8622['query'][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x1b9013[_0x2b7e('0x1c')]=qs['limit'](_0x3d8622['query'][_0x2b7e('0x1c')]);_0x1b9013[_0x2b7e('0x1a')]=qs['offset'](_0x3d8622['query'][_0x2b7e('0x1a')]);}return _0x5548b7['getWhatsappAccounts'](_0x1b9013);}})[_0x2b7e('0x10')](function(_0x1e9e47){if(_0x1e9e47){return _0x1e9e47?{'count':_0x26a39b,'rows':_0x1e9e47}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x86669,null))[_0x2b7e('0x49')](handleError(_0x86669,null));};exports[_0x2b7e('0x14a')]=function(_0x14e1a6,_0x2bb10c){return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x14e1a6['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x2bb10c,null))['then'](function(_0x1bdd11){if(_0x1bdd11){return _0x1bdd11[_0x2b7e('0x14a')](_0x14e1a6[_0x2b7e('0x55')]['ids'],_[_0x2b7e('0x109')](_0x14e1a6[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{});}})[_0x2b7e('0x10')](respondWithResult(_0x2bb10c,null))[_0x2b7e('0x49')](handleError(_0x2bb10c,null));};exports[_0x2b7e('0x14b')]=function(_0x1988e4,_0x1d18b7){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x1988e4['params']['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x1d18b7,null))[_0x2b7e('0x10')](function(_0x4c853e){if(_0x4c853e){return _0x4c853e['removeWhatsappAccounts'](_0x1988e4[_0x2b7e('0x3d')]['ids']);}})[_0x2b7e('0x10')](respondWithStatusCode(_0x1d18b7,null))[_0x2b7e('0x49')](handleError(_0x1d18b7,null));};exports[_0x2b7e('0x14c')]=function(_0x652f71,_0x3d14b6){var _0x5e492a={};var _0x3ffbc3={};var _0x42cd9e;var _0x3408b4;return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x652f71[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x3d14b6,null))[_0x2b7e('0x10')](function(_0x37b8af){if(_0x37b8af){_0x42cd9e=_0x37b8af;_0x3ffbc3['model']=_[_0x2b7e('0x4e')](db['SquareProject'][_0x2b7e('0x33')]);_0x3ffbc3['query']=_[_0x2b7e('0x4e')](_0x652f71[_0x2b7e('0x3d')]);_0x3ffbc3['filters']=_['intersection'](_0x3ffbc3[_0x2b7e('0x4c')],_0x3ffbc3[_0x2b7e('0x3d')]);_0x5e492a['attributes']=_[_0x2b7e('0x50')](_0x3ffbc3[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x652f71['query'][_0x2b7e('0x51')]));_0x5e492a[_0x2b7e('0x3c')]=_0x5e492a[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x5e492a['attributes']:_0x3ffbc3['model'];_0x5e492a[_0x2b7e('0xcc')]=qs['sort'](_0x652f71[_0x2b7e('0x3d')]['sort']);_0x5e492a[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x652f71['query'],_0x3ffbc3[_0x2b7e('0x4f')]));if(_0x652f71['query'][_0x2b7e('0x29')]){_0x5e492a[_0x2b7e('0xc1')]=_[_0x2b7e('0x52')](_0x5e492a[_0x2b7e('0xc1')],{'$or':_[_0x2b7e('0x81')](_0x5e492a[_0x2b7e('0x3c')],function(_0x5bf7be){var _0x39f6c8={};_0x39f6c8[_0x5bf7be]={'$like':'%'+_0x652f71[_0x2b7e('0x3d')]['filter']+'%'};return _0x39f6c8;})});}_0x5e492a=_[_0x2b7e('0x52')]({},_0x5e492a,_0x652f71[_0x2b7e('0xc2')]);return _0x42cd9e[_0x2b7e('0x14c')](_0x5e492a);}})[_0x2b7e('0x10')](function(_0x2fe851){if(_0x2fe851){_0x3408b4=_0x2fe851[_0x2b7e('0x3f')];if(!_0x652f71[_0x2b7e('0x3d')][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x5e492a['limit']=qs[_0x2b7e('0x1c')](_0x652f71['query'][_0x2b7e('0x1c')]);_0x5e492a['offset']=qs[_0x2b7e('0x1a')](_0x652f71[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}return _0x42cd9e[_0x2b7e('0x14c')](_0x5e492a);}})[_0x2b7e('0x10')](function(_0x2a6a02){if(_0x2a6a02){return _0x2a6a02?{'count':_0x3408b4,'rows':_0x2a6a02}:null;}})[_0x2b7e('0x10')](respondWithResult(_0x3d14b6,null))[_0x2b7e('0x49')](handleError(_0x3d14b6,null));};exports[_0x2b7e('0x14d')]=function(_0x43ba2b,_0x2e18cb){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x43ba2b[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x2e18cb,null))[_0x2b7e('0x10')](function(_0xaa21b1){if(_0xaa21b1){return _0xaa21b1[_0x2b7e('0x14d')](_0x43ba2b[_0x2b7e('0x55')][_0x2b7e('0x9a')],_[_0x2b7e('0x109')](_0x43ba2b[_0x2b7e('0x55')],[_0x2b7e('0x9a'),'id'])||{});}})[_0x2b7e('0x10')](respondWithResult(_0x2e18cb,null))[_0x2b7e('0x49')](handleError(_0x2e18cb,null));};exports[_0x2b7e('0x14e')]=function(_0x348d59,_0x45397b){return db[_0x2b7e('0x39')][_0x2b7e('0x2e')]({'where':{'id':_0x348d59[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x45397b,null))[_0x2b7e('0x10')](function(_0x5bd539){if(_0x5bd539){return _0x5bd539[_0x2b7e('0x14e')](_0x348d59['query'][_0x2b7e('0x9a')]);}})[_0x2b7e('0x10')](respondWithStatusCode(_0x45397b,null))[_0x2b7e('0x49')](handleError(_0x45397b,null));};exports[_0x2b7e('0x14f')]=function(_0x2253ac,_0x5c4a83){var _0x18076f={},_0xef73f9={},_0x519228={'count':0x0,'rows':[]};var _0x58ba69=db[_0x2b7e('0x150')]['rawAttributes'];_0xef73f9[_0x2b7e('0x4c')]=_[_0x2b7e('0x4e')](_0x58ba69);_0xef73f9['query']=_[_0x2b7e('0x4e')](_0x2253ac[_0x2b7e('0x3d')]);_0xef73f9[_0x2b7e('0x4f')]=_[_0x2b7e('0x50')](_0xef73f9[_0x2b7e('0x4c')],_0xef73f9['query']);_0xef73f9[_0x2b7e('0x4f')]=_[_0x2b7e('0x151')](_0xef73f9['filters'],['$and',_0x2b7e('0x152'),'$gt',_0x2b7e('0x153'),_0x2b7e('0x154'),_0x2b7e('0x155'),_0x2b7e('0x156'),'$eq',_0x2b7e('0x157'),_0x2b7e('0x158'),_0x2b7e('0x159'),_0x2b7e('0x15a'),'$notIn','$like',_0x2b7e('0x15b'),_0x2b7e('0x15c'),_0x2b7e('0x15d'),_0x2b7e('0x15e'),_0x2b7e('0x15f'),'$contains',_0x2b7e('0x160'),_0x2b7e('0x161')]);_0x18076f[_0x2b7e('0x3c')]=_[_0x2b7e('0x50')](_0xef73f9[_0x2b7e('0x4c')],qs[_0x2b7e('0x51')](_0x2253ac['query'][_0x2b7e('0x51')]));_0x18076f['attributes']=_0x18076f[_0x2b7e('0x3c')][_0x2b7e('0x3f')]?_0x18076f[_0x2b7e('0x3c')]:_0xef73f9['model'];if(!_0x2253ac[_0x2b7e('0x3d')][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x18076f['limit']=qs[_0x2b7e('0x1c')](_0x2253ac[_0x2b7e('0x3d')]['limit']);_0x18076f['offset']=qs['offset'](_0x2253ac[_0x2b7e('0x3d')]['offset']);}_0x18076f[_0x2b7e('0xcc')]=qs[_0x2b7e('0xbf')](_0x2253ac['query'][_0x2b7e('0xbf')]);_0x18076f[_0x2b7e('0xc1')]=qs[_0x2b7e('0x4f')](_[_0x2b7e('0xc0')](_0x2253ac['query'],_0xef73f9[_0x2b7e('0x4f')]));if(_0x2253ac[_0x2b7e('0x3d')][_0x2b7e('0x29')]){_0x18076f[_0x2b7e('0xc1')]=_['merge'](_0x18076f['where'],{'$or':_[_0x2b7e('0x81')](_0x18076f[_0x2b7e('0x3c')],function(_0x3b049f){var _0x1590a6={};_0x1590a6[_0x3b049f]={'$like':'%'+_0x2253ac[_0x2b7e('0x3d')]['filter']+'%'};return _0x1590a6;})});}_0x18076f[_0x2b7e('0xc1')]={'$and':[_0x18076f['where'],{'$or':[{'UserId':_0x2253ac[_0x2b7e('0x4b')]['id']},{'OwnerId':_0x2253ac[_0x2b7e('0x4b')]['id']}]}]};_0x18076f=_['merge']({},_0x18076f,_0x2253ac[_0x2b7e('0xc2')]);var _0x523c95={'where':_0x18076f[_0x2b7e('0xc1')]};return db[_0x2b7e('0x150')][_0x2b7e('0x1d')](_0x523c95)[_0x2b7e('0x10')](function(_0x46c713){_0x519228[_0x2b7e('0x1d')]=_0x46c713;if(_0x2253ac['query'][_0x2b7e('0x3a')]){_0x18076f[_0x2b7e('0x3b')]=[{'attributes':['id','firstName',_0x2b7e('0x162'),_0x2b7e('0xdf')],'model':db['CmContact'],'as':_0x2b7e('0x163')},{'attributes':['id',_0x2b7e('0x31'),'dialActive'],'model':db[_0x2b7e('0x164')],'as':_0x2b7e('0xc7')}];}return db[_0x2b7e('0x150')][_0x2b7e('0x7e')](_0x18076f);})[_0x2b7e('0x10')](function(_0x33de38){_0x519228[_0x2b7e('0x42')]=_0x33de38;return _0x519228;})[_0x2b7e('0x10')](respondWithFilteredResult(_0x5c4a83,_0x18076f))[_0x2b7e('0x49')](handleError(_0x5c4a83,null));};exports[_0x2b7e('0x165')]=function(_0x5bc922,_0x6eec47){if(!_['isNil'](_0x5bc922['user']['id'])&&(_0x5bc922[_0x2b7e('0x25')][_0x2b7e('0x2d')]==_0x2b7e('0x23')||_0x5bc922[_0x2b7e('0x25')][_0x2b7e('0x2d')]=='user')){return db[_0x2b7e('0x39')][_0x2b7e('0x8c')]({'where':{'id':_0x5bc922['params']['id']},'raw':!![]})[_0x2b7e('0x10')](function(_0x59968c){return authService[_0x2b7e('0x166')](_0x59968c);})[_0x2b7e('0x10')](function(_0x41da43){if(_0x41da43){return _0x6eec47[_0x2b7e('0x1e')](0xc8)['json']({'api_key':_0x41da43['token']});}else{return _0x6eec47[_0x2b7e('0x1e')](0xcc)[_0x2b7e('0x167')]({'message':'No\x20API\x20access\x20key\x20found!'});}})['catch'](handleError(_0x6eec47,0x193));}else{return _0x6eec47[_0x2b7e('0x1e')](0x191)['json']({'message':_0x2b7e('0x168')});}};exports[_0x2b7e('0x169')]=function(_0x15c998,_0x56c14d){if(!_[_0x2b7e('0x5b')](_0x15c998['user']['id'])&&(_0x15c998[_0x2b7e('0x25')][_0x2b7e('0x2d')]==_0x2b7e('0x23')||_0x15c998[_0x2b7e('0x25')][_0x2b7e('0x2d')]==_0x2b7e('0x25'))){return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x15c998[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](function(_0x186f47){return authService[_0x2b7e('0x16a')](_0x186f47);})['then'](function(_0x23c2d4){return db[_0x2b7e('0x39')][_0x2b7e('0xee')]({'apiKeyIat':_0x23c2d4[_0x2b7e('0x16b')],'apiKeyNonce':_0x23c2d4[_0x2b7e('0x16c')]},{'where':{'id':_0x15c998[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](function(){return _0x56c14d[_0x2b7e('0x1e')](0xc8)[_0x2b7e('0x167')]({'api_key':_0x23c2d4[_0x2b7e('0x16d')]});});})['catch'](handleError(_0x56c14d,0x193));}else{return _0x56c14d['status'](0x191)[_0x2b7e('0x167')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x2b7e('0x16e')]=function(_0x50908f,_0x44d3e8){if(!_[_0x2b7e('0x5b')](_0x50908f[_0x2b7e('0x25')]['id'])&&(_0x50908f[_0x2b7e('0x25')][_0x2b7e('0x2d')]=='admin'||_0x50908f[_0x2b7e('0x25')][_0x2b7e('0x2d')]=='user')){return db['User'][_0x2b7e('0x2e')]({'where':{'id':_0x50908f[_0x2b7e('0x4b')]['id']}})[_0x2b7e('0x10')](handleEntityNotFound(_0x44d3e8,null))[_0x2b7e('0x10')](function(_0x36d79f){if(_0x36d79f&&_0x36d79f[_0x2b7e('0x16f')]&&_0x36d79f[_0x2b7e('0x170')])return _0x36d79f;else throw{'message':'API\x20key\x20not\x20available'};})[_0x2b7e('0x10')](function(_0x3676b4){return db[_0x2b7e('0x39')][_0x2b7e('0xee')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x50908f[_0x2b7e('0x4b')]['id']}});})[_0x2b7e('0x10')](respondWithStatusCode(_0x44d3e8,0xc8))['catch'](handleError(_0x44d3e8,0x193));}else{return _0x44d3e8[_0x2b7e('0x1e')](0x191)[_0x2b7e('0x167')]({'message':_0x2b7e('0x168')});}};exports[_0x2b7e('0x171')]=function(_0x4eae1d,_0x1b5248){var _0x39871c=_0x4eae1d[_0x2b7e('0x25')][_0x2b7e('0x22')]({'plain':!![]});if(!_0x39871c){return _0x1b5248[_0x2b7e('0x1e')](0x191)['send'](_0x2b7e('0x172'));}else{return _0x1b5248[_0x2b7e('0x1e')](0xc8)[_0x2b7e('0x167')](_0x39871c);}};exports[_0x2b7e('0x173')]=function(_0x5c5b7c,_0x292efa){var _0x635909={'offset':0x0},_0xcbe0b4={'count':0x0,'rows':[]};Promise[_0x2b7e('0xf6')]()[_0x2b7e('0x10')](function(){if(!_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0x29')]&&!_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0x174')]&&!_0x5c5b7c[_0x2b7e('0x3d')]['queues'])return[];return Promise[_0x2b7e('0xf6')]()[_0x2b7e('0x10')](function(){var _0x41ff22=[];if(!_[_0x2b7e('0x7f')](_0x5c5b7c[_0x2b7e('0x3d')]['teams'])){_0x41ff22[_0x2b7e('0x40')](db[_0x2b7e('0x107')][_0x2b7e('0x7e')]({'attributes':['id','name'],'where':{'id':_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0x174')]}}));}if(!_['isEmpty'](_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0x175')])){_0x41ff22[_0x2b7e('0x40')](db[_0x2b7e('0x164')][_0x2b7e('0x7e')]({'attributes':['id',_0x2b7e('0x31')],'type':_0x2b7e('0x176'),'where':{'id':_0x5c5b7c[_0x2b7e('0x3d')]['queues']}}));}return Promise['all'](_0x41ff22);})[_0x2b7e('0x10')](function(_0x49fa97){var _0x32229d=_['flatten'](_0x49fa97)[_0x2b7e('0x81')](function(_0x48c03a){return _0x48c03a[_0x2b7e('0x177')]({'attributes':['id',_0x2b7e('0x31'),_0x2b7e('0x57'),'online'],'raw':!![]});});return Promise[_0x2b7e('0x48')](_0x32229d);})[_0x2b7e('0x10')](function(_0x114675){var _0x5ac09d=_[_0x2b7e('0x115')](_0x114675);if(!_0x5c5b7c['query']['filter'])return _0x5ac09d;if(_[_0x2b7e('0x7f')](_0x5ac09d)){return db['User'][_0x2b7e('0x7e')]({'attributes':['id',_0x2b7e('0x31'),_0x2b7e('0x57'),_0x2b7e('0x93')],'where':{'role':_0x2b7e('0x27'),'$or':[db[_0x2b7e('0x5e')][_0x2b7e('0xc1')](db[_0x2b7e('0x5e')]['fn'](_0x2b7e('0x178'),db['sequelize'][_0x2b7e('0x179')](_0x2b7e('0x31'))),{'$like':'%'+_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0x29')][_0x2b7e('0x99')]()+'%'}),{'internal':{'$like':'%'+_0x5c5b7c[_0x2b7e('0x3d')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x5ac09d)[_0x2b7e('0x115')]()[_0x2b7e('0x29')](function(_0x4fbf44){return _0x4fbf44[_0x2b7e('0x31')][_0x2b7e('0x99')]()[_0x2b7e('0x2c')](_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0x29')][_0x2b7e('0x99')]())||_0x4fbf44[_0x2b7e('0x57')][_0x2b7e('0x17a')]()['includes'](_0x5c5b7c['query'][_0x2b7e('0x29')]);})[_0x2b7e('0x2b')]();}})['then'](function(_0xfe5189){var _0x4b160f=_0x2b7e('0x31');var _0x56f3a6=_0x2b7e('0x17b');if(_0x5c5b7c[_0x2b7e('0x3d')]['sort']){var _0x56f3a6=_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0xbf')][0x0]==='-'?_0x2b7e('0x17c'):'asc';var _0x4b160f=_0x56f3a6==='asc'?_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0xbf')]:_0x5c5b7c['query'][_0x2b7e('0xbf')][_0x2b7e('0x17d')](0x1);}return _(_0xfe5189)[_0x2b7e('0x17e')]('id')[_0x2b7e('0x17f')]([function(_0x5c52e3){return _0x4b160f===_0x2b7e('0x31')?_0x5c52e3[_0x4b160f][_0x2b7e('0x99')]():_0x5c52e3[_0x4b160f];}],[_0x56f3a6])['map'](function(_0x3cd98e){return _[_0x2b7e('0xc0')](_0x3cd98e,['id','name',_0x2b7e('0x57'),'online']);})['value']();})[_0x2b7e('0x10')](function(_0x1bfd7c){return client[_0x2b7e('0x180')](_0x2b7e('0x26'),_0x5c5b7c)[_0x2b7e('0x10')](function(_0x31715f){if(_0x31715f[_0x2b7e('0x14')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x31b661=_0x31715f[_0x2b7e('0x17')];var _0x4841b7=jayson[_0x2b7e('0x181')][_0x2b7e('0x182')]({'port':0x232c});return _0x4841b7[_0x2b7e('0x180')](_0x2b7e('0x26'),_0x5c5b7c)['then'](function(_0x1f01dd){if(_0x1f01dd[_0x2b7e('0x14')])throw new Error(_0x2b7e('0x183'));var _0x3d490c=_0x1f01dd['result'];return _['merge']({},_0x3d490c,_0x31b661);});})[_0x2b7e('0x10')](function(_0xeab493){return _[_0x2b7e('0x81')](_0x1bfd7c,function(_0x308308){var _0x48702d=_[_0x2b7e('0x2e')](_0xeab493['rows'],['id',_0x308308['id']]);if(!_0x48702d||!_0x308308[_0x2b7e('0x93')]){_0x308308[_0x2b7e('0x1e')]=_0x2b7e('0x184');}else if(_0x48702d[_0x2b7e('0x95')]){_0x308308['status']='pause';}else{_0x308308[_0x2b7e('0x1e')]=_[_0x2b7e('0x2c')]([_0x2b7e('0x185'),'unknown','unavailable',_0x2b7e('0x186'),null,undefined],_0x48702d['voiceStatus'])?_0x2b7e('0x93'):_0x2b7e('0x187');}return _0x308308;});});});})['then'](function(_0x262a33){if(!_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0xc3')](_0x2b7e('0xca'))){_0x635909[_0x2b7e('0x1c')]=qs[_0x2b7e('0x1c')](_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0x1c')]||0xa);_0x635909['offset']=qs['offset'](_0x5c5b7c[_0x2b7e('0x3d')][_0x2b7e('0x1a')]);}_0xcbe0b4[_0x2b7e('0x1d')]=_0x262a33[_0x2b7e('0x3f')];_0xcbe0b4[_0x2b7e('0x42')]=_0x635909[_0x2b7e('0x1c')]?_0x262a33[_0x2b7e('0x188')](_0x635909['offset'],_0x635909[_0x2b7e('0x1a')]+_0x635909[_0x2b7e('0x1c')]):_0x262a33;return _0xcbe0b4;})['then'](respondWithFilteredResult(_0x292efa,_0x635909))['catch'](handleError(_0x292efa,null));};function get_open_tabs(_0x1b6f9d,_0x24d9ce){var _0x564d54=_0x1b6f9d[_0x2b7e('0x189')](0x0)['toUpperCase']()+_0x1b6f9d[_0x2b7e('0x188')](0x1);var _0x6dbed5={'type':db[_0x2b7e('0x84')][_0x2b7e('0x18a')][_0x2b7e('0x5f')],'raw':!![]};return new BPromise(function(_0x51bdbb,_0x4b6667){var _0x526984=squel[_0x2b7e('0x18b')]()[_0x2b7e('0x18c')](_0x2b7e('0x18d')+_0x564d54+_0x2b7e('0x18e'),'id')['field'](_0x2b7e('0x18f'))[_0x2b7e('0x60')]('user_has_'+_0x1b6f9d+_0x2b7e('0x190'),'ui')[_0x2b7e('0xc1')]('ui.UserId\x20=\x20?',_0x24d9ce['id']);return db['sequelize'][_0x2b7e('0x3d')](_0x526984['toString'](),_0x6dbed5)[_0x2b7e('0x10')](function(_0x171018){_0x24d9ce[_0x564d54+_0x2b7e('0x191')]=_0x171018;_0x51bdbb(_0x171018);})['catch'](function(_0x308be8){_0x4b6667(_0x308be8);});});};
\ No newline at end of file
+var _0xa486=['end','status','json','limit','count','offset','set','Content-Range','destroy','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','role','find','UserProfileResource','stack','name','send','index','User','rawAttributes','fieldName','type','key','salt','getOptions','where','query','attributes','push','rows','openTabs','length','chat','dataValues','sms','mail','whatsapp','all','show','model','differenceBy','password','filters','intersection','fields','includeAll','include','merge','options','true','openchannel','update','body','params','describe','addContacts','ids','internal','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','fullname','permissions','101','102','103','113','110','105','106','107','108','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','findAll','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','authenticate','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','addQueues','channel','online','voicePause','interface','Unknown\x20channel','add','toLowerCase','penalty','spread','capitalize','Queue:save','voice','VoiceQueue','get','format','UserVoiceQueueRt','upsert','isValidChannel','remove','Queues','isArray','QueueId','emit','Queue:remove','addAvatar','userpic','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','getOpenTabs','fax','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','findOne','keys','CmContact','order','sort','pick','getContacts','hasOwnProperty','CmList','List','Tags','color','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','MemberReport','getChannels','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','PAUSE','LOGININPAUSE','concat','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','omit','setDataValue','Voice','getChatQueues','Mail','Sms','Whatsapp','Fax','getOpenchannelQueues','Openchannel','flatten','addAgent','getDataValue','removeTeams','Chat','getMailQueues','getSmsQueues','getWhatsappQueues','transaction','removeAgent','getLists','getAgents','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','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','lastName','phone','Contact','CmHopper','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','resolve','teams','queues','inbound','lower','col','toString','asc','substring','uniqBy','orderBy','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','ringing','voiceStatus','busy','charAt','slice','select','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','util','lodash','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus'];(function(_0x4131b0,_0x504d34){var _0x18783d=function(_0x289767){while(--_0x289767){_0x4131b0['push'](_0x4131b0['shift']());}};_0x18783d(++_0x504d34);}(_0xa486,0x17d));var _0x6a48=function(_0x8e6301,_0x229dcf){_0x8e6301=_0x8e6301-0x0;var _0x28738c=_0xa486[_0x8e6301];return _0x28738c;};'use strict';var moment=require(_0x6a48('0x0'));var BPromise=require('bluebird');var util=require(_0x6a48('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x6a48('0x2'));var squel=require('squel');var jayson=require(_0x6a48('0x3'));var Redis=require(_0x6a48('0x4'));var authService=require(_0x6a48('0x5'));var qs=require(_0x6a48('0x6'));var logger=require(_0x6a48('0x7'))(_0x6a48('0x8'));var utils=require(_0x6a48('0x9'));var config=require(_0x6a48('0xa'));var licenseUtil=require(_0x6a48('0xb'));var db=require(_0x6a48('0xc'))['db'];var socket=require(_0x6a48('0xd'))(new Redis(config[_0x6a48('0xe')]));require(_0x6a48('0xf'))[_0x6a48('0x10')](socket);config[_0x6a48('0xe')]=_[_0x6a48('0x11')](config['redis'],{'host':_0x6a48('0x12'),'port':0x18eb});var client=jayson['client'][_0x6a48('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x454dbd,_0x158714,_0x290bd2,_0x12b760){return new BPromise(function(_0x3aec54,_0x448a82){var _0x416d66=_0x12b760||client;return _0x416d66[_0x6a48('0x14')](_0x454dbd,_0x290bd2)[_0x6a48('0x15')](function(_0x1ef5c7){logger[_0x6a48('0x16')](_0x6a48('0x17'),_0x158714,_0x6a48('0x18'));logger[_0x6a48('0x19')](_0x6a48('0x1a'),_0x158714,_0x6a48('0x18'),JSON[_0x6a48('0x1b')](_0x1ef5c7));if(_0x1ef5c7[_0x6a48('0x1c')]){if(_0x1ef5c7[_0x6a48('0x1c')][_0x6a48('0x1d')]===0x1f4){logger[_0x6a48('0x1c')](_0x6a48('0x17'),_0x158714,_0x1ef5c7[_0x6a48('0x1c')][_0x6a48('0x1e')]);return _0x448a82(_0x1ef5c7[_0x6a48('0x1c')][_0x6a48('0x1e')]);}logger[_0x6a48('0x1c')]('User,\x20%s,\x20%s',_0x158714,_0x1ef5c7[_0x6a48('0x1c')][_0x6a48('0x1e')]);return _0x3aec54(_0x1ef5c7[_0x6a48('0x1c')][_0x6a48('0x1e')]);}else{logger['info'](_0x6a48('0x17'),_0x158714,_0x6a48('0x18'));_0x3aec54(_0x1ef5c7[_0x6a48('0x1f')]['message']);}})[_0x6a48('0x20')](function(_0x6a0206){logger[_0x6a48('0x1c')]('User,\x20%s,\x20%s',_0x158714,_0x6a0206);_0x448a82(_0x6a0206);});});}function respondWithStatusCode(_0xd0230,_0x24c549){_0x24c549=_0x24c549||0xcc;return function(_0x14dc20){if(_0x14dc20){return _0xd0230[_0x6a48('0x21')](_0x24c549);}return _0xd0230['status'](_0x24c549)[_0x6a48('0x22')]();};}function respondWithResult(_0x230220,_0x59b031){_0x59b031=_0x59b031||0xc8;return function(_0x4aa84e){if(_0x4aa84e){return _0x230220[_0x6a48('0x23')](_0x59b031)[_0x6a48('0x24')](_0x4aa84e);}};}function respondWithFilteredResult(_0x4cb5d0,_0x2eae9f){return function(_0x4846bf){if(_0x4846bf){var _0x508432=typeof _0x2eae9f['offset']==='undefined'&&typeof _0x2eae9f[_0x6a48('0x25')]==='undefined';var _0x19594c=_0x4846bf['count'];var _0x5b1331=_0x508432?0x0:_0x2eae9f['offset'];var _0x5d62a6=_0x508432?_0x4846bf[_0x6a48('0x26')]:_0x2eae9f[_0x6a48('0x27')]+_0x2eae9f[_0x6a48('0x25')];var _0x20ecb0;if(_0x5d62a6>=_0x19594c){_0x5d62a6=_0x19594c;_0x20ecb0=0xc8;}else{_0x20ecb0=0xce;}_0x4cb5d0['status'](_0x20ecb0);return _0x4cb5d0[_0x6a48('0x28')](_0x6a48('0x29'),_0x5b1331+'-'+_0x5d62a6+'/'+_0x19594c)[_0x6a48('0x24')](_0x4846bf);}return null;};}function saveUpdates(_0x13fe57){return function(_0x5188e8){if(_0x5188e8){return _0x5188e8['update'](_0x13fe57)[_0x6a48('0x15')](function(_0xa75f3d){return _0xa75f3d;});}return null;};}function removeEntity(_0x4168f2){return function(_0x38e417){if(_0x38e417){return _0x38e417[_0x6a48('0x2a')]()['then'](function(){var _0x16982f=_0x38e417['get']({'plain':!![]});if(_0x16982f['role']===_0x6a48('0x2b'))return;var _0x396e12=[{'name':_0x6a48('0x2c'),'value':_0x6a48('0x2d'),'ignore':!![]},{'name':_0x6a48('0x2e'),'value':_0x6a48('0x2f'),'ignore':![]},{'name':_0x6a48('0x30'),'value':_0x6a48('0x31'),'ignore':![]}];var _0x1372ef=_(_0x396e12)[_0x6a48('0x32')](_0x6a48('0x33'))[_0x6a48('0x34')]('value')[_0x6a48('0x35')]();if(_[_0x6a48('0x36')](_0x1372ef,_0x16982f[_0x6a48('0x37')])){return;}var _0x5502bb=_[_0x6a48('0x38')](_0x396e12,['value',_0x16982f[_0x6a48('0x37')]])['name'];return db[_0x6a48('0x39')][_0x6a48('0x2a')]({'where':{'type':_0x5502bb,'resourceId':_0x16982f['id']}})[_0x6a48('0x15')](function(){return _0x38e417;});})['then'](function(){_0x4168f2[_0x6a48('0x23')](0xcc)[_0x6a48('0x22')]();});}};}function handleEntityNotFound(_0x51703a){return function(_0x53004c){if(!_0x53004c){_0x51703a[_0x6a48('0x21')](0x194);}return _0x53004c;};}function handleError(_0x463476,_0x4f3ec1){_0x4f3ec1=_0x4f3ec1||0x1f4;return function(_0x5bf085){logger[_0x6a48('0x1c')](_0x5bf085[_0x6a48('0x3a')]);if(_0x5bf085[_0x6a48('0x3b')]){delete _0x5bf085[_0x6a48('0x3b')];}_0x463476['status'](_0x4f3ec1)[_0x6a48('0x3c')](_0x5bf085);};}exports[_0x6a48('0x3d')]=function(_0x35c3cf,_0x2b236b){var _0x228297={},_0x434f53={'count':0x0,'rows':[]};var _0x2e085c=_(db[_0x6a48('0x3e')][_0x6a48('0x3f')])[_0x6a48('0x34')](function(_0x102ea2){return{'name':_0x102ea2[_0x6a48('0x40')],'type':_0x102ea2[_0x6a48('0x41')][_0x6a48('0x42')]};})['filter'](function(_0x1c08fd){return!_[_0x6a48('0x36')](['password',_0x6a48('0x43')],_0x1c08fd[_0x6a48('0x3b')]);})[_0x6a48('0x35')]();_0x228297=qs[_0x6a48('0x44')](_0x2e085c,_0x35c3cf);var _0x4ced81={'where':_0x228297[_0x6a48('0x45')]};return db[_0x6a48('0x3e')][_0x6a48('0x26')](_0x4ced81)[_0x6a48('0x15')](function(_0xdb2642){_0x434f53[_0x6a48('0x26')]=_0xdb2642;if(_0x35c3cf[_0x6a48('0x46')]['includeAll']){_0x228297['include']=[{'all':!![]}];}if(!_[_0x6a48('0x36')](_0x228297[_0x6a48('0x47')],'id')){_0x228297['attributes'][_0x6a48('0x48')]('id');}return db[_0x6a48('0x3e')]['findAll'](_0x228297);})[_0x6a48('0x15')](function(_0x2abea4){_0x434f53[_0x6a48('0x49')]=_0x2abea4;if(_0x35c3cf[_0x6a48('0x46')][_0x6a48('0x4a')]==='true'){var _0x367701=[];for(var _0x553dd5=0x0;_0x553dd5<_0x434f53['rows'][_0x6a48('0x4b')];_0x553dd5++){_0x367701['push'](get_open_tabs(_0x6a48('0x4c'),_0x434f53['rows'][_0x553dd5][_0x6a48('0x4d')]));_0x367701[_0x6a48('0x48')](get_open_tabs(_0x6a48('0x4e'),_0x434f53['rows'][_0x553dd5][_0x6a48('0x4d')]));_0x367701['push'](get_open_tabs('fax',_0x434f53['rows'][_0x553dd5][_0x6a48('0x4d')]));_0x367701['push'](get_open_tabs(_0x6a48('0x4f'),_0x434f53[_0x6a48('0x49')][_0x553dd5][_0x6a48('0x4d')]));_0x367701[_0x6a48('0x48')](get_open_tabs('openchannel',_0x434f53[_0x6a48('0x49')][_0x553dd5]['dataValues']));_0x367701[_0x6a48('0x48')](get_open_tabs(_0x6a48('0x50'),_0x434f53['rows'][_0x553dd5]['dataValues']));}return BPromise[_0x6a48('0x51')](_0x367701)[_0x6a48('0x15')](function(_0x5c91cf){return _0x434f53;});}else{return _0x434f53;}})[_0x6a48('0x15')](respondWithFilteredResult(_0x2b236b,_0x228297))[_0x6a48('0x20')](handleError(_0x2b236b,null));};exports[_0x6a48('0x52')]=function(_0x20dab5,_0x1adecf){var _0x350a82={'raw':![],'where':{'id':_0x20dab5['params']['id']}},_0x1b00fa={};_0x1b00fa[_0x6a48('0x53')]=_[_0x6a48('0x54')](_['keys'](db[_0x6a48('0x3e')][_0x6a48('0x3f')]),[_0x6a48('0x55'),_0x6a48('0x43')]);_0x1b00fa[_0x6a48('0x46')]=_['keys'](_0x20dab5[_0x6a48('0x46')]);_0x1b00fa[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x1b00fa[_0x6a48('0x53')],_0x1b00fa[_0x6a48('0x46')]);_0x350a82['attributes']=_['intersection'](_0x1b00fa[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x20dab5[_0x6a48('0x46')]['fields']));_0x350a82[_0x6a48('0x47')]=_0x350a82['attributes'][_0x6a48('0x4b')]?_0x350a82[_0x6a48('0x47')]:_0x1b00fa['model'];if(_0x20dab5[_0x6a48('0x46')][_0x6a48('0x59')]){_0x350a82[_0x6a48('0x5a')]=[{'all':!![]}];}_0x350a82=_[_0x6a48('0x5b')]({},_0x350a82,_0x20dab5[_0x6a48('0x5c')]);if(!_[_0x6a48('0x36')](_0x350a82[_0x6a48('0x47')],'id')){_0x350a82['attributes'][_0x6a48('0x48')]('id');}return db[_0x6a48('0x3e')]['find'](_0x350a82)['then'](handleEntityNotFound(_0x1adecf,null))[_0x6a48('0x15')](function(_0x5459c2){var _0x4ffe6b=[];values=_0x5459c2;if(_0x20dab5[_0x6a48('0x46')]['openTabs']===_0x6a48('0x5d')){_0x4ffe6b[_0x6a48('0x48')](get_open_tabs(_0x6a48('0x4c'),_0x5459c2['dataValues']));_0x4ffe6b[_0x6a48('0x48')](get_open_tabs(_0x6a48('0x4e'),_0x5459c2[_0x6a48('0x4d')]));_0x4ffe6b[_0x6a48('0x48')](get_open_tabs(_0x6a48('0x5e'),_0x5459c2[_0x6a48('0x4d')]));_0x4ffe6b['push'](get_open_tabs(_0x6a48('0x50'),_0x5459c2[_0x6a48('0x4d')]));_0x4ffe6b[_0x6a48('0x48')](get_open_tabs('fax',_0x5459c2[_0x6a48('0x4d')]));_0x4ffe6b['push'](get_open_tabs('mail',_0x5459c2[_0x6a48('0x4d')]));return BPromise[_0x6a48('0x51')](_0x4ffe6b);}else{return values;}})[_0x6a48('0x15')](function(_0x492174){return values;})['then'](respondWithResult(_0x1adecf,null))[_0x6a48('0x20')](handleError(_0x1adecf,null));};exports[_0x6a48('0x5f')]=function(_0x133494,_0x545e28){if(_0x133494[_0x6a48('0x60')]['id']){delete _0x133494[_0x6a48('0x60')]['id'];}delete _0x133494['body'][_0x6a48('0x37')];return db['User'][_0x6a48('0x38')]({'where':{'id':_0x133494[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x545e28,null))[_0x6a48('0x15')](saveUpdates(_0x133494[_0x6a48('0x60')],null))[_0x6a48('0x15')](respondWithResult(_0x545e28,null))[_0x6a48('0x20')](handleError(_0x545e28,null));};exports['describe']=function(_0xcede73,_0x2ae9c2){return db[_0x6a48('0x3e')][_0x6a48('0x62')]()[_0x6a48('0x15')](respondWithResult(_0x2ae9c2,null))[_0x6a48('0x20')](handleError(_0x2ae9c2,null));};exports[_0x6a48('0x63')]=function(_0x1da744,_0x232456){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x1da744['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x232456,null))[_0x6a48('0x15')](function(_0x27e689){if(_0x27e689){return _0x27e689[_0x6a48('0x63')](_0x1da744[_0x6a48('0x60')][_0x6a48('0x64')],_['omit'](_0x1da744['body'],['ids','id'])||{});}})[_0x6a48('0x15')](respondWithResult(_0x232456,null))[_0x6a48('0x20')](handleError(_0x232456,null));};function validateUser(_0x1a17f8){return new BPromise(function(_0x39b9b7,_0x5a53e0){if(_0x1a17f8[_0x6a48('0x65')])return _0x39b9b7(_0x1a17f8);return db['Setting'][_0x6a48('0x66')](0x1)[_0x6a48('0x15')](function(_0x2edba7){if(_0x2edba7[_0x6a48('0x67')])authService['validatePasswordPattern'](_0x1a17f8[_0x6a48('0x55')]);db[_0x6a48('0x3e')][_0x6a48('0x68')](_0x6a48('0x65'))[_0x6a48('0x15')](function(_0x1635fa){if(_[_0x6a48('0x69')](_0x1635fa)){_0x1a17f8[_0x6a48('0x65')]=_0x2edba7[_0x6a48('0x6a')]||0x1;return;}if(_[_0x6a48('0x69')](_0x2edba7[_0x6a48('0x6a')])||_0x2edba7[_0x6a48('0x6a')]===_0x1635fa){_0x1a17f8[_0x6a48('0x65')]=_0x1635fa+0x1;return;}if(_0x2edba7[_0x6a48('0x6a')]>_0x1635fa){_0x1a17f8[_0x6a48('0x65')]=_0x2edba7[_0x6a48('0x6a')];return;}return db[_0x6a48('0x6b')][_0x6a48('0x46')](_0x6a48('0x6c'),{'type':db[_0x6a48('0x6b')][_0x6a48('0x6d')][_0x6a48('0x6e')]})[_0x6a48('0x15')](function(_0x27ed0c){if(_0x27ed0c&&_0x27ed0c['length']){for(var _0x4435ab=0x0,_0x49bb0c=_0x27ed0c[_0x6a48('0x4b')];_0x4435ab<_0x49bb0c&&_[_0x6a48('0x69')](_0x1a17f8['internal']);_0x4435ab++){if(_0x2edba7[_0x6a48('0x6a')]<=_0x27ed0c[_0x4435ab][_0x6a48('0x6f')]){_0x1a17f8['internal']=_0x27ed0c[_0x4435ab][_0x6a48('0x6f')];}else if(_0x2edba7['min_internal']>_0x27ed0c[_0x4435ab][_0x6a48('0x6f')]&&_0x2edba7['min_internal']<=_0x27ed0c[_0x4435ab]['to']){_0x1a17f8[_0x6a48('0x65')]=_0x2edba7[_0x6a48('0x6a')];}}}if(_[_0x6a48('0x69')](_0x1a17f8['internal'])){_0x1a17f8[_0x6a48('0x65')]=_0x1635fa+0x1;}return _0x39b9b7(_0x1a17f8);});});})[_0x6a48('0x20')](function(_0x48042a){_0x5a53e0(_0x48042a);});});}function updateUser(_0x535fde){return new BPromise(function(_0x27129b,_0x58974b){try{if(_0x535fde['voicemail']){_0x535fde['mailbox']=_0x535fde[_0x6a48('0x65')];_0x535fde[_0x6a48('0x70')]={'mailbox':_0x535fde[_0x6a48('0x65')],'password':_0x535fde[_0x6a48('0x55')],'fullname':_0x535fde[_0x6a48('0x71')],'email':_0x535fde['email']};}if(_0x535fde[_0x6a48('0x37')]===_0x6a48('0x2f')){if(!_0x535fde[_0x6a48('0x72')])_0x535fde[_0x6a48('0x72')]=[_0x6a48('0x73'),_0x6a48('0x74'),_0x6a48('0x75'),_0x6a48('0x76'),_0x6a48('0x77'),'104',_0x6a48('0x78'),_0x6a48('0x79'),_0x6a48('0x7a'),_0x6a48('0x7b'),'109',_0x6a48('0x7c'),_0x6a48('0x7d'),_0x6a48('0x7e'),_0x6a48('0x7f')];}_0x27129b(_0x535fde);}catch(_0x52918d){_0x58974b(_0x52918d);}});}exports[_0x6a48('0x80')]=function(_0x488def,_0x14904b){if(_0x488def[_0x6a48('0x2d')]['role']===_0x6a48('0x2f'))throw new Error(_0x6a48('0x81'));if(_0x488def[_0x6a48('0x60')]['role']===_0x6a48('0x2d')&&_0x488def[_0x6a48('0x2d')][_0x6a48('0x37')]!==_0x6a48('0x2b')){throw new Error(_0x6a48('0x82'));}if(_0x488def[_0x6a48('0x60')][_0x6a48('0x37')]===_0x6a48('0x2b')&&_0x488def[_0x6a48('0x2d')]['role']!==_0x6a48('0x2b')){throw new Error(_0x6a48('0x83'));}return licenseUtil['checkUserLimits']([_0x488def[_0x6a48('0x60')]])['then'](function(){return validateUser(_0x488def[_0x6a48('0x60')]);})[_0x6a48('0x15')](function(_0x5c00de){return updateUser(_0x5c00de)[_0x6a48('0x15')](function(_0x6a8675){if(_0x6a8675[_0x6a48('0x37')]===_0x6a48('0x2b')){_0x6a8675[_0x6a48('0x84')]=_0x488def[_0x6a48('0x2d')][_0x6a48('0x84')];delete _0x6a8675['userProfileId'];}return _0x6a8675;});})[_0x6a48('0x15')](function(_0xdcfa2d){return db[_0x6a48('0x3e')][_0x6a48('0x80')](_0xdcfa2d,{'include':[{'model':db[_0x6a48('0x70')],'as':_0x6a48('0x70')}]});})[_0x6a48('0x15')](function(_0x51886e){if(_0x488def['body'][_0x6a48('0x37')]===_0x6a48('0x2d'))return _0x51886e;if(_0x488def['user']['role']!==_0x6a48('0x2d'))return _0x51886e;return db[_0x6a48('0x85')][_0x6a48('0x38')]({'where':{'name':_0x51886e[_0x6a48('0x37')]===_0x6a48('0x2f')?'Agents':_0x6a48('0x30'),'userProfileId':_0x488def['user'][_0x6a48('0x86')]},'raw':!![]})[_0x6a48('0x15')](function(_0x2600d9){if(!_0x2600d9||_0x2600d9[_0x6a48('0x87')]!=0x0)return _0x51886e;return db[_0x6a48('0x39')][_0x6a48('0x80')]({'name':_0x51886e[_0x6a48('0x3b')],'resourceId':_0x51886e['id'],'type':_0x2600d9[_0x6a48('0x3b')],'sectionId':_0x2600d9['id']},{})[_0x6a48('0x15')](function(){return _0x51886e;});})[_0x6a48('0x20')](function(_0x1f7602){logger['error'](_0x6a48('0x88'),_0x1f7602);throw _0x1f7602;});})[_0x6a48('0x15')](respondWithResult(_0x14904b,0xc9))[_0x6a48('0x20')](handleError(_0x14904b,null));};exports[_0x6a48('0x89')]=function(_0x3d0141,_0x58e395){var _0x5555d5=_0x3d0141[_0x6a48('0x60')];var _0x5ba0db=[];if(_0x3d0141[_0x6a48('0x2d')][_0x6a48('0x37')]===_0x6a48('0x2f'))throw new Error(_0x6a48('0x81'));if(_[_0x6a48('0x8a')](_0x5555d5,['role','user'])&&_0x3d0141[_0x6a48('0x2d')]['role']!==_0x6a48('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x6a48('0x8a')](_0x5555d5,[_0x6a48('0x37'),_0x6a48('0x2b')])&&_0x3d0141[_0x6a48('0x2d')]['role']!==_0x6a48('0x2b')){throw new Error(_0x6a48('0x8b'));}return licenseUtil[_0x6a48('0x8c')](_0x5555d5)['then'](function(){return validateUser(_0x5555d5[0x0]);})[_0x6a48('0x15')](function(){for(var _0x432204=0x1;_0x432204<_0x5555d5['length'];_0x432204++){var _0x57268d=_0x5555d5[_0x432204-0x1][_0x6a48('0x65')];if(!_0x5555d5[_0x432204][_0x6a48('0x65')])_0x5555d5[_0x432204]['internal']=_0x57268d+0x1;_0x5ba0db['push'](validateUser(_0x5555d5[_0x432204]));}return BPromise[_0x6a48('0x51')](_0x5ba0db);})['then'](function(){_0x5ba0db=[];for(var _0x15b678=0x0;_0x15b678<_0x5555d5[_0x6a48('0x4b')];_0x15b678++){_0x5ba0db[_0x6a48('0x48')](updateUser(_0x5555d5[_0x15b678]));}return BPromise[_0x6a48('0x51')](_0x5ba0db);})[_0x6a48('0x15')](function(){return BPromise[_0x6a48('0x8d')](_0x5555d5,function(_0x9318e4){return db[_0x6a48('0x3e')][_0x6a48('0x80')](_0x9318e4,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x6a48('0x15')](function(_0x49d4db){_0x9318e4['id']=_0x49d4db['id'];return _0x9318e4;});});})[_0x6a48('0x15')](function(_0x23cedd){if(_0x3d0141[_0x6a48('0x60')][_0x6a48('0x37')]===_0x6a48('0x2d'))return _0x23cedd;if(_0x3d0141[_0x6a48('0x2d')][_0x6a48('0x37')]!==_0x6a48('0x2d'))return _0x23cedd;var _0x59a53f=_[_0x6a48('0x8a')](_0x23cedd,function(_0x38f5c8){return _0x38f5c8[_0x6a48('0x37')]===_0x6a48('0x2f')||_0x38f5c8['role']===_0x6a48('0x31');});if(!_0x59a53f)return _0x23cedd;return db[_0x6a48('0x85')][_0x6a48('0x8e')]({'where':{'name':{'$or':[_0x6a48('0x2e'),_0x6a48('0x30')]},'userProfileId':_0x3d0141['user'][_0x6a48('0x86')]},'raw':!![]})[_0x6a48('0x15')](function(_0x563181){if(_[_0x6a48('0x8f')](_0x563181)||!_[_0x6a48('0x8a')](_0x563181,[_0x6a48('0x87'),0x0]))return _0x23cedd;_0x5ba0db=[];var _0x90c544=_(_0x563181)[_0x6a48('0x34')](function(_0x22b589){if(_0x22b589[_0x6a48('0x87')]===0x1)return;return _0x22b589['name']===_0x6a48('0x2e')?_0x6a48('0x2f'):_0x6a48('0x31');})[_0x6a48('0x90')]()['value']();for(var _0x20be82=0x0;_0x20be82<_0x23cedd[_0x6a48('0x4b')];_0x20be82++){if(!_[_0x6a48('0x36')](_0x90c544,_0x23cedd[_0x20be82][_0x6a48('0x37')]))return;var _0x513e5c=_0x23cedd[_0x20be82]['role']===_0x6a48('0x2f')?_0x6a48('0x2e'):_0x6a48('0x30');_0x5ba0db['push'](db['UserProfileResource'][_0x6a48('0x80')]({'name':_0x23cedd[_0x20be82][_0x6a48('0x3b')],'resourceId':_0x23cedd[_0x20be82]['id'],'type':_0x513e5c,'sectionId':_[_0x6a48('0x38')](_0x563181,['name',_0x513e5c])['id']},{}));}return BPromise[_0x6a48('0x51')](_0x5ba0db);});})['then'](respondWithResult(_0x58e395,0xc9))[_0x6a48('0x20')](handleError(_0x58e395,null));};exports[_0x6a48('0x91')]=function(_0xbbde4c,_0x54d72b){if(_0xbbde4c[_0x6a48('0x60')]['id']){delete _0xbbde4c['body']['id'];}return db['User'][_0x6a48('0x38')]({'where':{'id':_0xbbde4c['params']['id']}})[_0x6a48('0x15')](function(_0x2335c8){if(!_0x2335c8)return null;if(_0x2335c8['id']===_0xbbde4c[_0x6a48('0x2d')]['id']){if(!_0xbbde4c[_0x6a48('0x60')][_0x6a48('0x92')]||!_0xbbde4c[_0x6a48('0x60')][_0x6a48('0x93')]){throw new db[(_0x6a48('0x94'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x2335c8[_0x6a48('0x95')](_0xbbde4c[_0x6a48('0x60')][_0x6a48('0x92')])){throw new db['Sequelize'][(_0x6a48('0x96'))](_0x6a48('0x97'));}if(_0xbbde4c[_0x6a48('0x60')][_0x6a48('0x92')]===_0xbbde4c['body']['newPassword']){throw new db[(_0x6a48('0x94'))]['ValidationError'](_0x6a48('0x98'));}}else if(_0xbbde4c[_0x6a48('0x2d')][_0x6a48('0x37')]===_0x6a48('0x2b')){if(!_0xbbde4c[_0x6a48('0x60')]['newPassword']){throw new db[(_0x6a48('0x94'))][(_0x6a48('0x96'))](_0x6a48('0x99'));}}else if(_0xbbde4c[_0x6a48('0x2d')]['role']===_0x6a48('0x2d')){if(!_0xbbde4c[_0x6a48('0x60')][_0x6a48('0x93')]){throw new db[(_0x6a48('0x94'))]['ValidationError'](_0x6a48('0x99'));}if(_0x2335c8[_0x6a48('0x37')]!==_0x6a48('0x2f')){throw new db[(_0x6a48('0x94'))][(_0x6a48('0x96'))]('Unauthorized');}}else{throw new db[(_0x6a48('0x94'))]['ValidationError']('Unauthorized');}return _0x2335c8;})[_0x6a48('0x15')](handleEntityNotFound(_0x54d72b,null))[_0x6a48('0x15')](function(_0x3c11f7){return db[_0x6a48('0x9a')]['findOne']({'attributes':['id',_0x6a48('0x67'),_0x6a48('0x9b'),_0x6a48('0x9c')]})['then'](function(_0xe883db){if(_0xe883db[_0x6a48('0x67')])authService['validatePasswordPattern'](_0xbbde4c[_0x6a48('0x60')][_0x6a48('0x93')]);if(!_0xe883db['enforcePasswordHistory']||!_0x3c11f7['previousPasswords'])return _0x3c11f7;authService['validatePasswordHistory'](_0xbbde4c[_0x6a48('0x60')][_0x6a48('0x93')],_0x3c11f7[_0x6a48('0x9d')],_0xe883db[_0x6a48('0x9c')]);return _0x3c11f7;})[_0x6a48('0x15')](saveUpdates({'password':_0xbbde4c[_0x6a48('0x60')]['newPassword'],'passwordResetAt':_0xbbde4c[_0x6a48('0x2d')]['id']==_0xbbde4c['params']['id']?moment():null,'previousPasswords':authService[_0x6a48('0x9e')](_0xbbde4c[_0x6a48('0x60')][_0x6a48('0x93')],_0x3c11f7[_0x6a48('0x9d')])},null));})[_0x6a48('0x15')](respondWithResult(_0x54d72b,null))[_0x6a48('0x20')](handleError(_0x54d72b,null));};exports[_0x6a48('0x9f')]=function(_0x4f9527,_0x4b494d){var _0x292a04=_0x4f9527['body'][_0x6a48('0xa0')];return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x4f9527[_0x6a48('0x61')]['id']},'attributes':['id',_0x6a48('0x3b'),_0x6a48('0x37'),_0x6a48('0xa1'),'loginInPause',_0x6a48('0xa2'),_0x6a48('0xa3')]})[_0x6a48('0x15')](handleEntityNotFound(_0x4b494d,null))['then'](function(_0x505e99){if(_0x505e99){if(!utils['isValidChannel'](_0x292a04)){throw new db[(_0x6a48('0x94'))][(_0x6a48('0x96'))](_0x6a48('0xa4'));}return _0x505e99[_0x6a48('0xa5')+_['capitalize'](_0x292a04[_0x6a48('0xa6')]())+'Queues'](_0x4f9527[_0x6a48('0x60')][_0x6a48('0x64')],{'penalty':_0x4f9527[_0x6a48('0x60')][_0x6a48('0xa7')]||0x0})[_0x6a48('0xa8')](function(_0x3d8066){for(var _0x28ca9c=0x0;_0x28ca9c<_0x4f9527[_0x6a48('0x60')][_0x6a48('0x64')][_0x6a48('0x4b')];_0x28ca9c+=0x1){var _0x1e126d={'UserId':Number(_0x4f9527[_0x6a48('0x61')]['id'])};_0x1e126d[_[_0x6a48('0xa9')](_0x292a04[_0x6a48('0xa6')]())+'QueueId']=Number(_0x4f9527[_0x6a48('0x60')][_0x6a48('0x64')][_0x28ca9c]);socket['emit'](_0x6a48('0x2d')+_[_0x6a48('0xa9')](_0x292a04[_0x6a48('0xa6')]())+_0x6a48('0xaa'),_0x1e126d);}return _0x3d8066;})[_0x6a48('0x15')](function(){if(_0x292a04===_0x6a48('0xab')){return db[_0x6a48('0xac')][_0x6a48('0x8e')]({'where':{'id':_0x4f9527[_0x6a48('0x60')][_0x6a48('0x64')]||[]},'raw':!![],'attributes':['id',_0x6a48('0x3b')]});}})[_0x6a48('0x15')](function(_0x1408b4){var _0x5bee43=_0x505e99[_0x6a48('0xad')]({'plain':!![]});var _0x2b5f03=[];if(_0x292a04==='voice'&&_0x5bee43[_0x6a48('0x37')]==='agent'&&_0x5bee43[_0x6a48('0xa1')]){for(var _0x1b6111=0x0;_0x1b6111<_0x1408b4[_0x6a48('0x4b')];_0x1b6111+=0x1){_0x2b5f03['push']({'membername':_0x5bee43[_0x6a48('0x3b')],'UserId':_0x5bee43['id'],'queue_name':_0x1408b4[_0x1b6111][_0x6a48('0x3b')],'VoiceQueueId':_0x1408b4[_0x1b6111]['id'],'interface':_[_0x6a48('0x69')](_0x5bee43[_0x6a48('0xa3')])?util[_0x6a48('0xae')]('SIP/%s',_0x5bee43[_0x6a48('0x3b')]):_0x5bee43['interface'],'paused':_0x5bee43[_0x6a48('0xa2')]||![],'penalty':_0x4f9527[_0x6a48('0x60')][_0x6a48('0xa7')]||0x0});}return BPromise[_0x6a48('0x8d')](_0x2b5f03,function(_0x337acc){return db[_0x6a48('0xaf')][_0x6a48('0xb0')](_0x337acc);});}return _0x505e99;});}})['then'](respondWithStatusCode(_0x4b494d,null))[_0x6a48('0x20')](handleError(_0x4b494d,null));};exports['removeQueues']=function(_0x3fff05,_0xfc8158){var _0x362ea2;return db[_0x6a48('0x3e')]['find']({'where':{'id':_0x3fff05['params']['id']},'attributes':['id',_0x6a48('0x3b'),'role']})[_0x6a48('0x15')](handleEntityNotFound(_0xfc8158,null))[_0x6a48('0x15')](function(_0x57a915){if(_0x57a915){_0x362ea2=_0x57a915;if(!_0x3fff05[_0x6a48('0x46')][_0x6a48('0xa0')]||!utils[_0x6a48('0xb1')](_0x3fff05[_0x6a48('0x46')][_0x6a48('0xa0')])){throw new db[(_0x6a48('0x94'))][(_0x6a48('0x96'))](_0x6a48('0xa4'));}return _0x57a915[_0x6a48('0xb2')+_[_0x6a48('0xa9')](_0x3fff05[_0x6a48('0x46')][_0x6a48('0xa0')][_0x6a48('0xa6')]())+_0x6a48('0xb3')](_0x3fff05[_0x6a48('0x46')][_0x6a48('0x64')]);}})[_0x6a48('0x15')](function(_0x347fae){if(_[_0x6a48('0xb4')](_0x3fff05[_0x6a48('0x46')]['ids'])){for(var _0x18241a=0x0;_0x18241a<_0x3fff05[_0x6a48('0x46')][_0x6a48('0x64')][_0x6a48('0x4b')];_0x18241a+=0x1){var _0x5dbbd4={'UserId':Number(_0x3fff05[_0x6a48('0x61')]['id'])};_0x5dbbd4[_[_0x6a48('0xa9')](_0x3fff05[_0x6a48('0x46')][_0x6a48('0xa0')]['toLowerCase']())+_0x6a48('0xb5')]=Number(_0x3fff05[_0x6a48('0x46')][_0x6a48('0x64')][_0x18241a]);socket[_0x6a48('0xb6')](_0x6a48('0x2d')+_[_0x6a48('0xa9')](_0x3fff05[_0x6a48('0x46')][_0x6a48('0xa0')][_0x6a48('0xa6')]())+_0x6a48('0xb7'),_0x5dbbd4);}}else{var _0x5dbbd4={'UserId':Number(_0x3fff05[_0x6a48('0x61')]['id'])};_0x5dbbd4[_[_0x6a48('0xa9')](_0x3fff05[_0x6a48('0x46')][_0x6a48('0xa0')]['toLowerCase']())+_0x6a48('0xb5')]=Number(_0x3fff05[_0x6a48('0x46')][_0x6a48('0x64')]);socket['emit'](_0x6a48('0x2d')+_[_0x6a48('0xa9')](_0x3fff05[_0x6a48('0x46')][_0x6a48('0xa0')][_0x6a48('0xa6')]())+'Queue:remove',_0x5dbbd4);}return _0x347fae;})[_0x6a48('0x15')](function(){if(_0x3fff05['query']['channel']==='voice'){return db[_0x6a48('0xaf')][_0x6a48('0x2a')]({'where':{'UserId':_0x3fff05[_0x6a48('0x61')]['id'],'VoiceQueueId':_0x3fff05[_0x6a48('0x46')]['ids']},'individualHooks':!![]})['then'](function(){return _0x362ea2;});}return _0x362ea2;})['then'](respondWithStatusCode(_0xfc8158,null))[_0x6a48('0x20')](handleError(_0xfc8158,null));};exports[_0x6a48('0xb8')]=function(_0x23f88f,_0x536c21){_0x23f88f[_0x6a48('0x60')][_0x6a48('0xb9')]=_0x23f88f['file']['filename'];return db['User'][_0x6a48('0x38')]({'where':{'id':_0x23f88f[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x536c21,null))[_0x6a48('0x15')](saveUpdates(_0x23f88f[_0x6a48('0x60')],null))[_0x6a48('0x15')](respondWithResult(_0x536c21,null))[_0x6a48('0x20')](handleError(_0x536c21,null));};exports[_0x6a48('0xba')]=function(_0x405ba3,_0x385ef7){var _0x2e3efb=path[_0x6a48('0xbb')](config[_0x6a48('0xbc')],_0x6a48('0xbd'));return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x405ba3[_0x6a48('0x61')]['id']},'attributes':['id',_0x6a48('0xb9')],'raw':!![]})[_0x6a48('0x15')](handleEntityNotFound(_0x385ef7,null))[_0x6a48('0x15')](function(_0x62de82){if(_0x62de82){if(_[_0x6a48('0x69')](_0x62de82[_0x6a48('0xb9')])){return _0x385ef7[_0x6a48('0xbe')](_0x2e3efb);}else{if(!fs[_0x6a48('0xbf')](path['join'](config[_0x6a48('0xbc')],'server/files/images/',_0x62de82[_0x6a48('0xb9')]))){return _0x385ef7['download'](_0x2e3efb);}return _0x385ef7[_0x6a48('0xbe')](path[_0x6a48('0xbb')](config[_0x6a48('0xbc')],'server/files/images/',_0x62de82['userpic']));}}})[_0x6a48('0x20')](handleError(_0x385ef7,null));};exports[_0x6a48('0xc0')]=function(_0x5ddc5e,_0x96ea57){return db['User'][_0x6a48('0x38')]({'where':{'id':_0x5ddc5e['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x96ea57,null))['then'](function(_0x590c80){var _0x3474e5=[];values=_0x590c80[_0x6a48('0x4d')];_0x3474e5['push'](get_open_tabs(_0x6a48('0x4c'),_0x590c80[_0x6a48('0x4d')]));_0x3474e5[_0x6a48('0x48')](get_open_tabs(_0x6a48('0x4e'),_0x590c80['dataValues']));_0x3474e5[_0x6a48('0x48')](get_open_tabs(_0x6a48('0x5e'),_0x590c80[_0x6a48('0x4d')]));_0x3474e5[_0x6a48('0x48')](get_open_tabs(_0x6a48('0x50'),_0x590c80[_0x6a48('0x4d')]));_0x3474e5[_0x6a48('0x48')](get_open_tabs(_0x6a48('0xc1'),_0x590c80[_0x6a48('0x4d')]));_0x3474e5[_0x6a48('0x48')](get_open_tabs(_0x6a48('0x4f'),_0x590c80[_0x6a48('0x4d')]));return BPromise[_0x6a48('0x51')](_0x3474e5);})[_0x6a48('0x15')](function(_0x558e1c){var _0x317dc7=[];if(_0x558e1c){for(var _0x2b4b39=0x0;_0x2b4b39<values['ChatOpenTabs']['length'];_0x2b4b39++){var _0x46fe07=values[_0x6a48('0xc2')][_0x2b4b39];_0x317dc7[_0x6a48('0x48')]({'channel':_0x6a48('0xc3'),'id':_0x46fe07['id'],'createdAt':_0x46fe07[_0x6a48('0xc4')]});}for(var _0x2b4b39=0x0;_0x2b4b39<values[_0x6a48('0xc5')][_0x6a48('0x4b')];_0x2b4b39++){var _0x46fe07=values[_0x6a48('0xc5')][_0x2b4b39];_0x317dc7[_0x6a48('0x48')]({'channel':'FAX','id':_0x46fe07['id'],'createdAt':_0x46fe07[_0x6a48('0xc4')]});}for(var _0x2b4b39=0x0;_0x2b4b39<values[_0x6a48('0xc6')][_0x6a48('0x4b')];_0x2b4b39++){var _0x46fe07=values['OpenchannelOpenTabs'][_0x2b4b39];_0x317dc7[_0x6a48('0x48')]({'channel':_0x6a48('0xc7'),'id':_0x46fe07['id'],'createdAt':_0x46fe07[_0x6a48('0xc4')]});}for(var _0x2b4b39=0x0;_0x2b4b39<values['MailOpenTabs'][_0x6a48('0x4b')];_0x2b4b39++){var _0x46fe07=values[_0x6a48('0xc8')][_0x2b4b39];_0x317dc7[_0x6a48('0x48')]({'channel':_0x6a48('0xc9'),'id':_0x46fe07['id'],'createdAt':_0x46fe07[_0x6a48('0xc4')]});}for(var _0x2b4b39=0x0;_0x2b4b39<values[_0x6a48('0xca')][_0x6a48('0x4b')];_0x2b4b39++){var _0x46fe07=values[_0x6a48('0xca')][_0x2b4b39];_0x317dc7[_0x6a48('0x48')]({'channel':_0x6a48('0xcb'),'id':_0x46fe07['id'],'createdAt':_0x46fe07['createdAt']});}for(var _0x2b4b39=0x0;_0x2b4b39<values['WhatsappOpenTabs'][_0x6a48('0x4b')];_0x2b4b39++){var _0x46fe07=values['WhatsappOpenTabs'][_0x2b4b39];_0x317dc7[_0x6a48('0x48')]({'channel':'WHATSAPP','id':_0x46fe07['id'],'createdAt':_0x46fe07['createdAt']});}var _0x126409={'count':_0x317dc7['length'],'rows':_0x317dc7};return _0x126409;}else return null;})[_0x6a48('0x15')](respondWithResult(_0x96ea57,null))[_0x6a48('0x20')](handleError(_0x96ea57,null));};exports['getContacts']=function(_0x213742,_0x50e276){var _0x2f302d={};var _0x2b59fa={};var _0x149fc4;var _0x5e84fe;return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x213742['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x50e276,null))[_0x6a48('0x15')](function(_0x489b07){if(_0x489b07){_0x149fc4=_0x489b07;_0x2b59fa[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0xce')][_0x6a48('0x3f')]);_0x2b59fa[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x213742[_0x6a48('0x46')]);_0x2b59fa[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x2b59fa['model'],_0x2b59fa[_0x6a48('0x46')]);_0x2f302d['attributes']=_[_0x6a48('0x57')](_0x2b59fa['model'],qs['fields'](_0x213742[_0x6a48('0x46')][_0x6a48('0x58')]));_0x2f302d[_0x6a48('0x47')]=_0x2f302d[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x2f302d['attributes']:_0x2b59fa[_0x6a48('0x53')];_0x2f302d[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0x213742['query'][_0x6a48('0xd0')]);_0x2f302d[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x213742[_0x6a48('0x46')],_0x2b59fa[_0x6a48('0x56')]));if(_0x213742[_0x6a48('0x46')][_0x6a48('0x32')]){_0x2f302d['where']=_[_0x6a48('0x5b')](_0x2f302d['where'],{'$or':_[_0x6a48('0x34')](_0x2f302d[_0x6a48('0x47')],function(_0x720303){var _0x20b9f3={};_0x20b9f3[_0x720303]={'$like':'%'+_0x213742['query'][_0x6a48('0x32')]+'%'};return _0x20b9f3;})});}_0x2f302d=_[_0x6a48('0x5b')]({},_0x2f302d,_0x213742[_0x6a48('0x5c')]);return _0x149fc4[_0x6a48('0xd2')](_0x2f302d);}})[_0x6a48('0x15')](function(_0x1d719c){if(_0x1d719c){_0x5e84fe=_0x1d719c['length'];if(_0x213742[_0x6a48('0x46')][_0x6a48('0xd3')](_0x6a48('0x59'))){_0x2f302d[_0x6a48('0x5a')]=[{'model':db[_0x6a48('0xd4')],'as':_0x6a48('0xd5'),'required':![]},{'model':db['Tag'],'as':_0x6a48('0xd6'),'attributes':['id','name',_0x6a48('0xd7')],'where':_0x213742[_0x6a48('0x46')][_0x6a48('0xd8')]?{'id':_0x213742[_0x6a48('0x46')][_0x6a48('0xd8')]}:undefined,'required':_0x213742[_0x6a48('0x46')][_0x6a48('0xd8')]?!![]:![]}];}if(!_0x213742['query'][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x2f302d[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x213742[_0x6a48('0x46')]['limit']);_0x2f302d['offset']=qs[_0x6a48('0x27')](_0x213742[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x149fc4[_0x6a48('0xd2')](_0x2f302d);}})[_0x6a48('0x15')](function(_0x3fc6ce){if(_0x3fc6ce){return _0x3fc6ce?{'count':_0x5e84fe,'rows':_0x3fc6ce}:null;}})['then'](respondWithResult(_0x50e276,null))[_0x6a48('0x20')](handleError(_0x50e276,null));};exports[_0x6a48('0xda')]=function(_0x4bb62b,_0x529645){var _0x383801;var _0x2c95fd;var _0x2420af={};var _0x3f4548;return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x4bb62b['params']['id']},'attributes':['id',_0x6a48('0x3b'),_0x6a48('0x37')]})[_0x6a48('0x15')](handleEntityNotFound(_0x529645,null))[_0x6a48('0x15')](function(_0x208003){if(!utils[_0x6a48('0xb1')](_0x4bb62b[_0x6a48('0x46')][_0x6a48('0xa0')])){throw new db['Sequelize'][(_0x6a48('0x96'))]('Unknown\x20channel');}_0x383801=_0x208003;var _0x14f576={};_0x14f576[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_[_0x6a48('0xa9')](_0x4bb62b[_0x6a48('0x46')]['channel'])+'Queue'][_0x6a48('0x3f')]);_0x14f576['query']=_['keys'](_0x4bb62b[_0x6a48('0x46')]);_0x14f576[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x14f576[_0x6a48('0x53')],_0x14f576['query']);_0x2420af[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x14f576[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x4bb62b[_0x6a48('0x46')][_0x6a48('0x58')]));_0x2420af[_0x6a48('0x47')]=_0x2420af[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x2420af['attributes']:_0x14f576[_0x6a48('0x53')];_0x2420af[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0x4bb62b[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x2420af['where']=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x4bb62b[_0x6a48('0x46')],_0x14f576[_0x6a48('0x56')]));if(_0x4bb62b[_0x6a48('0x46')][_0x6a48('0x32')]){_0x2420af[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x2420af[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x2420af[_0x6a48('0x47')],function(_0x52272e){var _0x5d000a={};_0x5d000a[_0x52272e]={'$like':'%'+_0x4bb62b[_0x6a48('0x46')][_0x6a48('0x32')]+'%'};return _0x5d000a;})});}_0x2420af=_[_0x6a48('0x5b')]({},_0x2420af,_0x4bb62b[_0x6a48('0x5c')]);switch(_0x383801[_0x6a48('0x37')]){case _0x6a48('0x2b'):return db[_[_0x6a48('0xa9')](_0x4bb62b[_0x6a48('0x46')][_0x6a48('0xa0')])+'Queue']['findAll'](_0x2420af);case _0x6a48('0x2d'):case _0x6a48('0x2f'):return _0x383801[_0x6a48('0xad')+_[_0x6a48('0xa9')](_0x4bb62b[_0x6a48('0x46')][_0x6a48('0xa0')])+_0x6a48('0xb3')](_0x2420af);default:throw new db[(_0x6a48('0x94'))][(_0x6a48('0x96'))]('Unknown\x20role');}})[_0x6a48('0x15')](function(_0x2f900d){_0x3f4548=_0x2f900d[_0x6a48('0x4b')];if(!_0x4bb62b[_0x6a48('0x46')][_0x6a48('0xd3')]('nolimit')){_0x2420af[_0x6a48('0x25')]=qs['limit'](_0x4bb62b[_0x6a48('0x46')][_0x6a48('0x25')]);_0x2420af[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0x4bb62b[_0x6a48('0x46')][_0x6a48('0x27')]);}switch(_0x383801[_0x6a48('0x37')]){case _0x6a48('0x2b'):return db[_[_0x6a48('0xa9')](_0x4bb62b[_0x6a48('0x46')][_0x6a48('0xa0')])+_0x6a48('0xdb')][_0x6a48('0x8e')](_0x2420af);case'user':case _0x6a48('0x2f'):return _0x383801[_0x6a48('0xad')+_[_0x6a48('0xa9')](_0x4bb62b[_0x6a48('0x46')][_0x6a48('0xa0')])+_0x6a48('0xb3')](_0x2420af);}})[_0x6a48('0x15')](function(_0x18eb83){return{'count':_0x3f4548,'rows':_0x18eb83};})[_0x6a48('0x15')](respondWithResult(_0x529645,null))[_0x6a48('0x20')](handleError(_0x529645,null));};exports['getVoiceQueuesRt']=function(_0x1c00d2,_0x184af8){var _0x43da1b={};var _0x30460c={};var _0x9c6fde;var _0x530f9d;return db['User'][_0x6a48('0xcc')]({'where':{'id':_0x1c00d2[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x184af8,null))[_0x6a48('0x15')](function(_0x2f2d33){if(_0x2f2d33){_0x9c6fde=_0x2f2d33;_0x30460c[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0xaf')][_0x6a48('0x3f')]);_0x30460c['query']=_[_0x6a48('0xcd')](_0x1c00d2['query']);_0x30460c[_0x6a48('0x56')]=_['intersection'](_0x30460c[_0x6a48('0x53')],_0x30460c[_0x6a48('0x46')]);_0x43da1b[_0x6a48('0x47')]=_['intersection'](_0x30460c[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x1c00d2[_0x6a48('0x46')][_0x6a48('0x58')]));_0x43da1b[_0x6a48('0x47')]=_0x43da1b[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x43da1b[_0x6a48('0x47')]:_0x30460c['model'];_0x43da1b[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0x1c00d2[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x43da1b[_0x6a48('0x45')]=qs['filters'](_[_0x6a48('0xd1')](_0x1c00d2['query'],_0x30460c[_0x6a48('0x56')]));if(_0x1c00d2[_0x6a48('0x46')][_0x6a48('0x32')]){_0x43da1b[_0x6a48('0x45')]=_['merge'](_0x43da1b[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x43da1b[_0x6a48('0x47')],function(_0x48e6ec){var _0x178d18={};_0x178d18[_0x48e6ec]={'$like':'%'+_0x1c00d2[_0x6a48('0x46')][_0x6a48('0x32')]+'%'};return _0x178d18;})});}_0x43da1b=_['merge']({},_0x43da1b,_0x1c00d2[_0x6a48('0x5c')]);return _0x9c6fde['getVoiceQueuesRt'](_0x43da1b);}})[_0x6a48('0x15')](function(_0x3521bd){if(_0x3521bd){_0x530f9d=_0x3521bd[_0x6a48('0x4b')];if(!_0x1c00d2[_0x6a48('0x46')][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x43da1b['limit']=qs[_0x6a48('0x25')](_0x1c00d2[_0x6a48('0x46')][_0x6a48('0x25')]);_0x43da1b[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0x1c00d2[_0x6a48('0x46')]['offset']);}return _0x9c6fde[_0x6a48('0xdc')](_0x43da1b);}})['then'](function(_0x3de329){if(_0x3de329){return _0x3de329?{'count':_0x530f9d,'rows':_0x3de329}:null;}})[_0x6a48('0x15')](respondWithResult(_0x184af8,null))[_0x6a48('0x20')](handleError(_0x184af8,null));};exports['getGroups']=function(_0x181421,_0x165231){var _0x3412f8={};var _0x4b610f={};var _0x41f604;var _0x1e80c7;return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x181421['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x165231,null))[_0x6a48('0x15')](function(_0x5e9e61){if(_0x5e9e61){_0x41f604=_0x5e9e61;_0x4b610f[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0xdd')][_0x6a48('0x3f')]);_0x4b610f['query']=_['keys'](_0x181421[_0x6a48('0x46')]);_0x4b610f[_0x6a48('0x56')]=_['intersection'](_0x4b610f[_0x6a48('0x53')],_0x4b610f[_0x6a48('0x46')]);_0x3412f8[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x4b610f[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x181421['query'][_0x6a48('0x58')]));_0x3412f8[_0x6a48('0x47')]=_0x3412f8[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x3412f8[_0x6a48('0x47')]:_0x4b610f[_0x6a48('0x53')];_0x3412f8[_0x6a48('0xcf')]=qs['sort'](_0x181421[_0x6a48('0x46')]['sort']);_0x3412f8[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x181421[_0x6a48('0x46')],_0x4b610f[_0x6a48('0x56')]));if(_0x181421['query'][_0x6a48('0x32')]){_0x3412f8[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x3412f8['where'],{'$or':_[_0x6a48('0x34')](_0x3412f8[_0x6a48('0x47')],function(_0x4fdd38){var _0x30e0f5={};_0x30e0f5[_0x4fdd38]={'$like':'%'+_0x181421[_0x6a48('0x46')][_0x6a48('0x32')]+'%'};return _0x30e0f5;})});}_0x3412f8=_['merge']({},_0x3412f8,_0x181421[_0x6a48('0x5c')]);return _0x41f604[_0x6a48('0xde')](_0x3412f8);}})['then'](function(_0x1bffa9){if(_0x1bffa9){_0x1e80c7=_0x1bffa9[_0x6a48('0x4b')];if(!_0x181421[_0x6a48('0x46')][_0x6a48('0xd3')]('nolimit')){_0x3412f8[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x181421[_0x6a48('0x46')][_0x6a48('0x25')]);_0x3412f8['offset']=qs[_0x6a48('0x27')](_0x181421[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x41f604[_0x6a48('0xde')](_0x3412f8);}})[_0x6a48('0x15')](function(_0x431a19){if(_0x431a19){return _0x431a19?{'count':_0x1e80c7,'rows':_0x431a19}:null;}})[_0x6a48('0x15')](respondWithResult(_0x165231,null))['catch'](handleError(_0x165231,null));};exports[_0x6a48('0xdf')]=function(_0x5a06e6,_0x394cbf){var _0x435536={'raw':!![],'where':{}};var _0x127e2c={};var _0x22b427={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x5a06e6[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x394cbf,null))[_0x6a48('0x15')](function(_0x1f17d3){if(_0x1f17d3){_0x127e2c['model']=_['keys'](db[_0x6a48('0xe0')]['rawAttributes']);_0x127e2c[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x5a06e6[_0x6a48('0x46')]);_0x127e2c[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x127e2c['model'],_0x127e2c[_0x6a48('0x46')]);_0x435536[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x127e2c['model'],qs['fields'](_0x5a06e6[_0x6a48('0x46')][_0x6a48('0x58')]));_0x435536[_0x6a48('0x47')]=_0x435536[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x435536[_0x6a48('0x47')]:_0x127e2c[_0x6a48('0x53')];if(!_0x5a06e6['query'][_0x6a48('0xd3')]('nolimit')){_0x435536[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x5a06e6['query'][_0x6a48('0x25')]);_0x435536[_0x6a48('0x27')]=qs['offset'](_0x5a06e6[_0x6a48('0x46')][_0x6a48('0x27')]);}_0x435536['order']=qs[_0x6a48('0xd0')](_0x5a06e6['query'][_0x6a48('0xd0')]);_0x435536[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x5a06e6['query'],_0x127e2c['filters']));_0x435536[_0x6a48('0x45')][_0x6a48('0xe1')]=_0x1f17d3['id'];if(_0x5a06e6[_0x6a48('0x46')]['filter']){_0x435536[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x435536[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x435536['attributes'],function(_0x38d9d9){var _0x20b0ee={};_0x20b0ee[_0x38d9d9]={'$like':'%'+_0x5a06e6['query'][_0x6a48('0x32')]+'%'};return _0x20b0ee;})});}_0x435536=_[_0x6a48('0x5b')]({},_0x435536,_0x5a06e6['options']);return db[_0x6a48('0xe0')]['count']({'where':_0x435536[_0x6a48('0x45')]})['then'](function(_0x2138eb){_0x22b427[_0x6a48('0x26')]=_0x2138eb;if(_0x5a06e6['query'][_0x6a48('0x59')]){_0x435536[_0x6a48('0x5a')]=[{'all':!![]}];}return db[_0x6a48('0xe0')][_0x6a48('0x8e')](_0x435536);})['then'](function(_0x3a259d){_0x22b427['rows']=_0x3a259d;return _0x22b427;});}})['then'](respondWithFilteredResult(_0x394cbf,_0x435536))[_0x6a48('0x20')](handleError(_0x394cbf,null));};exports[_0x6a48('0xe2')]=function(_0x1b8939,_0xed310){var _0x10b8cb={'raw':!![],'where':{}};var _0x30d9d1={};var _0x1bc41b={'count':0x0,'rows':[]};return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x1b8939[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0xed310,null))['then'](function(_0x3a22d1){if(_0x3a22d1){_0x30d9d1[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db['ScreenRecording'][_0x6a48('0x3f')]);_0x30d9d1[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x1b8939['query']);_0x30d9d1[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x30d9d1[_0x6a48('0x53')],_0x30d9d1['query']);_0x10b8cb['attributes']=_[_0x6a48('0x57')](_0x30d9d1['model'],qs[_0x6a48('0x58')](_0x1b8939[_0x6a48('0x46')]['fields']));_0x10b8cb['attributes']=_0x10b8cb[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x10b8cb['attributes']:_0x30d9d1['model'];if(!_0x1b8939[_0x6a48('0x46')]['hasOwnProperty'](_0x6a48('0xd9'))){_0x10b8cb[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x1b8939[_0x6a48('0x46')][_0x6a48('0x25')]);_0x10b8cb[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0x1b8939['query']['offset']);}_0x10b8cb['order']=qs[_0x6a48('0xd0')](_0x1b8939['query']['sort']);_0x10b8cb[_0x6a48('0x45')]=qs['filters'](_[_0x6a48('0xd1')](_0x1b8939[_0x6a48('0x46')],_0x30d9d1[_0x6a48('0x56')]));_0x10b8cb[_0x6a48('0x45')]['UserId']=_0x3a22d1['id'];if(_0x1b8939[_0x6a48('0x46')][_0x6a48('0x32')]){_0x10b8cb[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x10b8cb[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x10b8cb['attributes'],function(_0x434d73){var _0x4cf3f3={};_0x4cf3f3[_0x434d73]={'$like':'%'+_0x1b8939[_0x6a48('0x46')]['filter']+'%'};return _0x4cf3f3;})});}_0x10b8cb=_[_0x6a48('0x5b')]({},_0x10b8cb,_0x1b8939[_0x6a48('0x5c')]);return db[_0x6a48('0xe3')][_0x6a48('0x26')]({'where':_0x10b8cb['where']})[_0x6a48('0x15')](function(_0xf69181){_0x1bc41b[_0x6a48('0x26')]=_0xf69181;if(_0x1b8939[_0x6a48('0x46')][_0x6a48('0x59')]){_0x10b8cb[_0x6a48('0x5a')]=[{'all':!![]}];}return db[_0x6a48('0xe3')]['findAll'](_0x10b8cb);})[_0x6a48('0x15')](function(_0x5727ae){_0x1bc41b['rows']=_0x5727ae;return _0x1bc41b;});}})['then'](respondWithFilteredResult(_0xed310,_0x10b8cb))['catch'](handleError(_0xed310,null));};exports[_0x6a48('0xe4')]=function(_0x27ee0e,_0x5ac46e){var _0x5d6627={};var _0x1c0a4b={};var _0x386d0b;var _0x5f3b1a;return db[_0x6a48('0x3e')]['findOne']({'where':{'id':_0x27ee0e[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x5ac46e,null))[_0x6a48('0x15')](function(_0x141d31){if(_0x141d31){_0x386d0b=_0x141d31;_0x1c0a4b[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0xe5')][_0x6a48('0x3f')]);_0x1c0a4b[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x27ee0e['query']);_0x1c0a4b['filters']=_[_0x6a48('0x57')](_0x1c0a4b[_0x6a48('0x53')],_0x1c0a4b[_0x6a48('0x46')]);_0x5d6627[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x1c0a4b[_0x6a48('0x53')],qs['fields'](_0x27ee0e[_0x6a48('0x46')]['fields']));_0x5d6627['attributes']=_0x5d6627[_0x6a48('0x47')]['length']?_0x5d6627['attributes']:_0x1c0a4b[_0x6a48('0x53')];_0x5d6627[_0x6a48('0xcf')]=qs['sort'](_0x27ee0e[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x5d6627['where']=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x27ee0e[_0x6a48('0x46')],_0x1c0a4b[_0x6a48('0x56')]));if(_0x27ee0e[_0x6a48('0x46')]['filter']){_0x5d6627['where']=_['merge'](_0x5d6627['where'],{'$or':_[_0x6a48('0x34')](_0x5d6627[_0x6a48('0x47')],function(_0x10a3db){var _0x1ee1e7={};_0x1ee1e7[_0x10a3db]={'$like':'%'+_0x27ee0e[_0x6a48('0x46')]['filter']+'%'};return _0x1ee1e7;})});}_0x5d6627=_[_0x6a48('0x5b')]({},_0x5d6627,_0x27ee0e[_0x6a48('0x5c')]);return _0x386d0b[_0x6a48('0xe4')](_0x5d6627);}})[_0x6a48('0x15')](function(_0x5726ff){if(_0x5726ff){_0x5f3b1a=_0x5726ff['length'];if(!_0x27ee0e[_0x6a48('0x46')][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x5d6627['limit']=qs['limit'](_0x27ee0e[_0x6a48('0x46')][_0x6a48('0x25')]);_0x5d6627['offset']=qs[_0x6a48('0x27')](_0x27ee0e['query'][_0x6a48('0x27')]);}return _0x386d0b[_0x6a48('0xe4')](_0x5d6627);}})[_0x6a48('0x15')](function(_0x9eb79){if(_0x9eb79){return _0x9eb79?{'count':_0x5f3b1a,'rows':_0x9eb79}:null;}})[_0x6a48('0x15')](respondWithResult(_0x5ac46e,null))[_0x6a48('0x20')](handleError(_0x5ac46e,null));};exports[_0x6a48('0xe6')]=function(_0x3e3a66,_0x5e56ca){var _0x232370={};var _0x25a1f1={};var _0x4a3eef;var _0x4e62e0;return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x3e3a66[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x5e56ca,null))['then'](function(_0x25716f){if(_0x25716f){_0x4a3eef=_0x25716f;_0x25a1f1[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db['OpenchannelInteraction'][_0x6a48('0x3f')]);_0x25a1f1['query']=_['keys'](_0x3e3a66[_0x6a48('0x46')]);_0x25a1f1[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x25a1f1['model'],_0x25a1f1[_0x6a48('0x46')]);_0x232370['attributes']=_[_0x6a48('0x57')](_0x25a1f1[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x3e3a66[_0x6a48('0x46')][_0x6a48('0x58')]));_0x232370[_0x6a48('0x47')]=_0x232370['attributes']['length']?_0x232370[_0x6a48('0x47')]:_0x25a1f1[_0x6a48('0x53')];_0x232370['order']=qs[_0x6a48('0xd0')](_0x3e3a66[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x232370[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x3e3a66[_0x6a48('0x46')],_0x25a1f1[_0x6a48('0x56')]));if(_0x3e3a66[_0x6a48('0x46')][_0x6a48('0x32')]){_0x232370[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x232370[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x232370['attributes'],function(_0x558177){var _0x791727={};_0x791727[_0x558177]={'$like':'%'+_0x3e3a66['query'][_0x6a48('0x32')]+'%'};return _0x791727;})});}_0x232370=_[_0x6a48('0x5b')]({},_0x232370,_0x3e3a66[_0x6a48('0x5c')]);return _0x4a3eef[_0x6a48('0xe6')](_0x232370);}})[_0x6a48('0x15')](function(_0x30eb23){if(_0x30eb23){_0x4e62e0=_0x30eb23['length'];if(!_0x3e3a66['query']['hasOwnProperty'](_0x6a48('0xd9'))){_0x232370[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x3e3a66[_0x6a48('0x46')][_0x6a48('0x25')]);_0x232370['offset']=qs[_0x6a48('0x27')](_0x3e3a66['query'][_0x6a48('0x27')]);}return _0x4a3eef['getOpenchannelInteractions'](_0x232370);}})[_0x6a48('0x15')](function(_0xe4cc29){if(_0xe4cc29){return _0xe4cc29?{'count':_0x4e62e0,'rows':_0xe4cc29}:null;}})[_0x6a48('0x15')](respondWithResult(_0x5e56ca,null))['catch'](handleError(_0x5e56ca,null));};exports[_0x6a48('0xe7')]=function(_0x216b93,_0x45cc7a){var _0x1b9ab1={'raw':!![],'where':{}};var _0x2737bc={};var _0x18fd83={'count':0x0,'rows':[]};return db['User'][_0x6a48('0xcc')]({'where':{'id':_0x216b93[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x45cc7a,null))[_0x6a48('0x15')](function(_0x12bab2){if(_0x12bab2){_0x2737bc['model']=_['keys'](db[_0x6a48('0xe8')]['rawAttributes']);_0x2737bc[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x216b93['query']);_0x2737bc[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x2737bc['model'],_0x2737bc['query']);_0x1b9ab1[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x2737bc[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x216b93[_0x6a48('0x46')][_0x6a48('0x58')]));_0x1b9ab1['attributes']=_0x1b9ab1['attributes'][_0x6a48('0x4b')]?_0x1b9ab1[_0x6a48('0x47')]:_0x2737bc[_0x6a48('0x53')];if(!_0x216b93[_0x6a48('0x46')][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x1b9ab1[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x216b93['query'][_0x6a48('0x25')]);_0x1b9ab1[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0x216b93[_0x6a48('0x46')][_0x6a48('0x27')]);}_0x1b9ab1[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0x216b93['query'][_0x6a48('0xd0')]);_0x1b9ab1[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x216b93[_0x6a48('0x46')],_0x2737bc[_0x6a48('0x56')]));_0x1b9ab1[_0x6a48('0x45')][_0x6a48('0xe1')]=_0x12bab2['id'];if(_0x216b93[_0x6a48('0x46')][_0x6a48('0x32')]){_0x1b9ab1[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x1b9ab1[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x1b9ab1['attributes'],function(_0x3e04ac){var _0x1f22c9={};_0x1f22c9[_0x3e04ac]={'$like':'%'+_0x216b93['query']['filter']+'%'};return _0x1f22c9;})});}_0x1b9ab1=_[_0x6a48('0x5b')]({},_0x1b9ab1,_0x216b93[_0x6a48('0x5c')]);return db['MailInteraction'][_0x6a48('0x26')]({'where':_0x1b9ab1[_0x6a48('0x45')]})['then'](function(_0x17272b){_0x18fd83[_0x6a48('0x26')]=_0x17272b;if(_0x216b93[_0x6a48('0x46')][_0x6a48('0x59')]){_0x1b9ab1[_0x6a48('0x5a')]=[{'all':!![]}];}return db[_0x6a48('0xe8')]['findAll'](_0x1b9ab1);})['then'](function(_0x161cc8){_0x18fd83[_0x6a48('0x49')]=_0x161cc8;return _0x18fd83;});}})[_0x6a48('0x15')](respondWithFilteredResult(_0x45cc7a,_0x1b9ab1))['catch'](handleError(_0x45cc7a,null));};exports[_0x6a48('0xe9')]=function(_0xcb64b4,_0x597e7f){var _0x632380={};var _0x4e9b6c={};var _0x9a781d;var _0x2ffd2d;return db['User'][_0x6a48('0xcc')]({'where':{'id':_0xcb64b4[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x597e7f,null))[_0x6a48('0x15')](function(_0x191a87){if(_0x191a87){_0x9a781d=_0x191a87;_0x4e9b6c[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0xea')][_0x6a48('0x3f')]);_0x4e9b6c[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0xcb64b4[_0x6a48('0x46')]);_0x4e9b6c[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x4e9b6c['model'],_0x4e9b6c[_0x6a48('0x46')]);_0x632380['attributes']=_['intersection'](_0x4e9b6c['model'],qs[_0x6a48('0x58')](_0xcb64b4[_0x6a48('0x46')][_0x6a48('0x58')]));_0x632380['attributes']=_0x632380[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x632380[_0x6a48('0x47')]:_0x4e9b6c['model'];_0x632380['order']=qs[_0x6a48('0xd0')](_0xcb64b4[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x632380[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_['pick'](_0xcb64b4['query'],_0x4e9b6c[_0x6a48('0x56')]));if(_0xcb64b4[_0x6a48('0x46')][_0x6a48('0x32')]){_0x632380['where']=_[_0x6a48('0x5b')](_0x632380[_0x6a48('0x45')],{'$or':_['map'](_0x632380[_0x6a48('0x47')],function(_0xec96f4){var _0x41eda7={};_0x41eda7[_0xec96f4]={'$like':'%'+_0xcb64b4[_0x6a48('0x46')]['filter']+'%'};return _0x41eda7;})});}_0x632380=_[_0x6a48('0x5b')]({},_0x632380,_0xcb64b4[_0x6a48('0x5c')]);return _0x9a781d[_0x6a48('0xe9')](_0x632380);}})[_0x6a48('0x15')](function(_0x156213){if(_0x156213){_0x2ffd2d=_0x156213[_0x6a48('0x4b')];if(!_0xcb64b4[_0x6a48('0x46')][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x632380[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0xcb64b4[_0x6a48('0x46')]['limit']);_0x632380[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0xcb64b4[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x9a781d[_0x6a48('0xe9')](_0x632380);}})[_0x6a48('0x15')](function(_0x53071d){if(_0x53071d){return _0x53071d?{'count':_0x2ffd2d,'rows':_0x53071d}:null;}})[_0x6a48('0x15')](respondWithResult(_0x597e7f,null))[_0x6a48('0x20')](handleError(_0x597e7f,null));};exports[_0x6a48('0xeb')]=function(_0xcaae44,_0x1f6a71){var _0x4b019e={};var _0x2c0abc={};var _0x431ecc;var _0x5027ca;return db[_0x6a48('0x3e')]['findOne']({'where':{'id':_0xcaae44[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x1f6a71,null))[_0x6a48('0x15')](function(_0xe1a6ac){if(_0xe1a6ac){_0x431ecc=_0xe1a6ac;_0x2c0abc[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db['FaxInteraction']['rawAttributes']);_0x2c0abc[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0xcaae44[_0x6a48('0x46')]);_0x2c0abc[_0x6a48('0x56')]=_['intersection'](_0x2c0abc[_0x6a48('0x53')],_0x2c0abc[_0x6a48('0x46')]);_0x4b019e['attributes']=_[_0x6a48('0x57')](_0x2c0abc[_0x6a48('0x53')],qs['fields'](_0xcaae44[_0x6a48('0x46')][_0x6a48('0x58')]));_0x4b019e[_0x6a48('0x47')]=_0x4b019e[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x4b019e['attributes']:_0x2c0abc[_0x6a48('0x53')];_0x4b019e[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0xcaae44['query'][_0x6a48('0xd0')]);_0x4b019e[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0xcaae44[_0x6a48('0x46')],_0x2c0abc['filters']));if(_0xcaae44[_0x6a48('0x46')][_0x6a48('0x32')]){_0x4b019e[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x4b019e[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x4b019e['attributes'],function(_0x2c1479){var _0x246e9c={};_0x246e9c[_0x2c1479]={'$like':'%'+_0xcaae44[_0x6a48('0x46')][_0x6a48('0x32')]+'%'};return _0x246e9c;})});}_0x4b019e=_['merge']({},_0x4b019e,_0xcaae44['options']);return _0x431ecc['getFaxInteractions'](_0x4b019e);}})[_0x6a48('0x15')](function(_0x5ac936){if(_0x5ac936){_0x5027ca=_0x5ac936['length'];if(!_0xcaae44[_0x6a48('0x46')][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x4b019e[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0xcaae44[_0x6a48('0x46')][_0x6a48('0x25')]);_0x4b019e[_0x6a48('0x27')]=qs['offset'](_0xcaae44[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x431ecc['getFaxInteractions'](_0x4b019e);}})['then'](function(_0x37a0c7){if(_0x37a0c7){return _0x37a0c7?{'count':_0x5027ca,'rows':_0x37a0c7}:null;}})[_0x6a48('0x15')](respondWithResult(_0x1f6a71,null))[_0x6a48('0x20')](handleError(_0x1f6a71,null));};exports[_0x6a48('0xec')]=function(_0x4dc03b,_0x1df7ac){var _0x2a6aa8={};var _0x4bec5d={};var _0x441308;var _0x2c879d;return db['User']['findOne']({'where':{'id':_0x4dc03b[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x1df7ac,null))[_0x6a48('0x15')](function(_0x5a7c00){if(_0x5a7c00){_0x441308=_0x5a7c00;_0x4bec5d['model']=_[_0x6a48('0xcd')](db[_0x6a48('0xed')][_0x6a48('0x3f')]);_0x4bec5d[_0x6a48('0x46')]=_['keys'](_0x4dc03b['query']);_0x4bec5d[_0x6a48('0x56')]=_['intersection'](_0x4bec5d['model'],_0x4bec5d[_0x6a48('0x46')]);_0x2a6aa8[_0x6a48('0x47')]=_['intersection'](_0x4bec5d[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x4dc03b[_0x6a48('0x46')][_0x6a48('0x58')]));_0x2a6aa8[_0x6a48('0x47')]=_0x2a6aa8[_0x6a48('0x47')]['length']?_0x2a6aa8[_0x6a48('0x47')]:_0x4bec5d[_0x6a48('0x53')];_0x2a6aa8[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0x4dc03b['query']['sort']);_0x2a6aa8[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x4dc03b[_0x6a48('0x46')],_0x4bec5d['filters']));if(_0x4dc03b['query'][_0x6a48('0x32')]){_0x2a6aa8[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x2a6aa8[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x2a6aa8[_0x6a48('0x47')],function(_0x487cfd){var _0x25cc66={};_0x25cc66[_0x487cfd]={'$like':'%'+_0x4dc03b[_0x6a48('0x46')]['filter']+'%'};return _0x25cc66;})});}_0x2a6aa8=_[_0x6a48('0x5b')]({},_0x2a6aa8,_0x4dc03b[_0x6a48('0x5c')]);return _0x441308[_0x6a48('0xec')](_0x2a6aa8);}})[_0x6a48('0x15')](function(_0x4bcf25){if(_0x4bcf25){_0x2c879d=_0x4bcf25[_0x6a48('0x4b')];if(!_0x4dc03b[_0x6a48('0x46')]['hasOwnProperty'](_0x6a48('0xd9'))){_0x2a6aa8[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x4dc03b[_0x6a48('0x46')][_0x6a48('0x25')]);_0x2a6aa8['offset']=qs[_0x6a48('0x27')](_0x4dc03b[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x441308[_0x6a48('0xec')](_0x2a6aa8);}})[_0x6a48('0x15')](function(_0x34f3f3){if(_0x34f3f3){return _0x34f3f3?{'count':_0x2c879d,'rows':_0x34f3f3}:null;}})[_0x6a48('0x15')](respondWithResult(_0x1df7ac,null))[_0x6a48('0x20')](handleError(_0x1df7ac,null));};exports[_0x6a48('0xee')]=function(_0x1f9f1f,_0xcb25dd,_0x201bfa){var _0xa2ba45;var _0x430b0b;var _0x4d688e;var _0x503fcf=!_[_0x6a48('0x69')](_0x1f9f1f['params']['id'])?_0x1f9f1f[_0x6a48('0x61')]['id']:!_[_0x6a48('0x69')](_0x1f9f1f[_0x6a48('0x2d')]['id'])?_0x1f9f1f[_0x6a48('0x2d')]['id']:null;return db['User'][_0x6a48('0x38')]({'where':{'id':_0x503fcf,'role':{'$or':[_0x6a48('0x2b'),_0x6a48('0x2d'),_0x6a48('0x2f')]}},'attributes':['id',_0x6a48('0x3b'),'phone',_0x6a48('0xef'),_0x6a48('0x37'),'internal','loginInPause']})[_0x6a48('0x15')](function(_0x22f321){if(_0x22f321){if(_0x22f321[_0x6a48('0x37')]===_0x6a48('0x2f')){_0xa2ba45=_0x22f321;if(_0x1f9f1f['body']['interface']){_0x4d688e=util[_0x6a48('0xae')](_0x6a48('0xf0'),_0xa2ba45[_0x1f9f1f[_0x6a48('0x60')][_0x6a48('0xa3')]]);}else if(_0x1f9f1f[_0x6a48('0x60')][_0x6a48('0xf1')]){_0x4d688e=util[_0x6a48('0xae')]('SIP/%s',_0x1f9f1f[_0x6a48('0x60')][_0x6a48('0xf1')]);}else{_0x4d688e=util[_0x6a48('0xae')](_0x6a48('0xf2'),_0xa2ba45[_0x6a48('0x3b')]);}socket['to'](util[_0x6a48('0xae')](_0x6a48('0xf3'),_0xa2ba45['name']))[_0x6a48('0xb6')](_0x6a48('0xf4'),{'user':{'id':_0xa2ba45['id'],'name':_0xa2ba45[_0x6a48('0x3b')]},'ip':_0x1f9f1f[_0x6a48('0xf5')][_0x6a48('0xf6')]||_0x1f9f1f[_0x6a48('0xf7')][_0x6a48('0xf8')]||_0x1f9f1f[_0x6a48('0xf9')][_0x6a48('0xf8')]||_0x1f9f1f[_0x6a48('0xf7')]['socket'][_0x6a48('0xf8')]});return db[_0x6a48('0xaf')][_0x6a48('0x2a')]({'where':{'membername':_0xa2ba45[_0x6a48('0x3b')]},'individualHooks':!![]});}}else{throw new db[(_0x6a48('0x94'))][(_0x6a48('0x96'))](_0x6a48('0xfa'));}})['then'](function(){if(_0xa2ba45){return _0xa2ba45[_0x6a48('0xfb')]({'raw':!![]});}})[_0x6a48('0x15')](function(_0x44f378){if(_0xa2ba45){var _0xf69b61=[];if(_0x44f378){_0x430b0b=_0x44f378;if(_0x430b0b[_0x6a48('0x4b')]){for(var _0x1c5fe1=0x0;_0x1c5fe1<_0x430b0b[_0x6a48('0x4b')];_0x1c5fe1++){_0xf69b61[_0x6a48('0x48')]({'membername':_0xa2ba45[_0x6a48('0x3b')],'UserId':_0xa2ba45['id'],'queue_name':_0x430b0b[_0x1c5fe1][_0x6a48('0x3b')],'VoiceQueueId':_0x430b0b[_0x1c5fe1]['id'],'interface':_0x4d688e,'paused':_0xa2ba45[_0x6a48('0xfc')]||![],'penalty':_0x430b0b[_0x1c5fe1][_0x6a48('0xfd')]||0x0});}return BPromise[_0x6a48('0x8d')](_0xf69b61,function(_0x114262){return db[_0x6a48('0xaf')][_0x6a48('0xb0')](_0x114262);});}}}})['then'](function(){if(_0xa2ba45){return db[_0x6a48('0xfe')]['findAll']({'where':{'membername':_0xa2ba45[_0x6a48('0x3b')],'exitAt':null}});}})[_0x6a48('0x15')](function(_0x14b336){if(_0xa2ba45){var _0x2706b8=[];_0x14b336['forEach'](function(_0x59d915){_0x2706b8[_0x6a48('0x48')](_0x59d915['update']({'exitAt':moment()[_0x6a48('0xae')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6a48('0x51')](_0x2706b8);}})['then'](function(){if(_0xa2ba45){var _0x566071=[];var _0x1972e0=[];var _0x3264bc=utils[_0x6a48('0xff')]();var _0x263362={'membername':_0xa2ba45[_0x6a48('0x3b')],'interface':_0x4d688e,'enterAt':moment()[_0x6a48('0xae')](_0x6a48('0x100')),'role':_0xa2ba45[_0x6a48('0x37')],'internal':_0xa2ba45['internal']};_0x3264bc[_0x6a48('0x101')](function(_0x5242bd){_0x566071[_0x6a48('0x48')](_[_0x6a48('0x5b')]({'channel':_0x5242bd,'type':_0x6a48('0x102'),'data1':_0x1f9f1f[_0x6a48('0x60')]['device'],'data2':_0x4d688e},_0x263362));if(_0xa2ba45[_0x6a48('0xfc')]){_0x1972e0[_0x6a48('0x48')](_[_0x6a48('0x5b')]({'channel':_0x5242bd,'type':_0x6a48('0x103'),'data1':_0x6a48('0x104')},_0x263362));}});return db[_0x6a48('0xfe')][_0x6a48('0x89')](_0x566071[_0x6a48('0x105')](_0x1972e0),{'individualHooks':!![]});}})[_0x6a48('0x15')](function(){if(_0xa2ba45){return _0xa2ba45[_0x6a48('0x5f')]({'online':!![],'lastLoginAt':moment()[_0x6a48('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xa2ba45[_0x6a48('0xfc')]||![],'mailPause':_0xa2ba45[_0x6a48('0xfc')]||![],'chatPause':_0xa2ba45[_0x6a48('0xfc')]||![],'faxPause':_0xa2ba45[_0x6a48('0xfc')]||![],'smsPause':_0xa2ba45[_0x6a48('0xfc')]||![],'openchannelPause':_0xa2ba45[_0x6a48('0xfc')]||![],'whatsappPause':_0xa2ba45[_0x6a48('0xfc')]||![],'pauseType':_0xa2ba45[_0x6a48('0xfc')]?'LOGININPAUSE':null,'interface':_0x4d688e,'lastPauseAt':moment()[_0x6a48('0xae')](_0x6a48('0x100'))});}})[_0x6a48('0x15')](function(_0x3ba5da){if(_0x1f9f1f['isMiddleware']){return _0x201bfa();}else{return BPromise['resolve'](_0x3ba5da)[_0x6a48('0x15')](respondWithResult(_0xcb25dd,null));}})[_0x6a48('0x20')](handleError(_0xcb25dd,null));};exports[_0x6a48('0x106')]=function(_0x1464b1,_0x7ef66d){var _0x57c584;return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x1464b1['params']['id'],'role':'agent'},'attributes':['id',_0x6a48('0x3b'),_0x6a48('0x37')]})['then'](handleEntityNotFound(_0x7ef66d,null))[_0x6a48('0x15')](function(_0x349b8b){if(_0x349b8b){_0x57c584=_0x349b8b;return db['UserVoiceQueueRt'][_0x6a48('0x2a')]({'where':{'membername':_0x57c584[_0x6a48('0x3b')]},'individualHooks':!![]});}})[_0x6a48('0x15')](function(){return db[_0x6a48('0xfe')][_0x6a48('0x8e')]({'where':{'membername':_0x57c584[_0x6a48('0x3b')],'exitAt':null}});})[_0x6a48('0x15')](function(_0x357db2){var _0xf87fe2=[];_0x357db2['forEach'](function(_0x927ace){_0xf87fe2['push'](_0x927ace[_0x6a48('0x5f')]({'exitAt':moment()[_0x6a48('0xae')](_0x6a48('0x100'))}));});return BPromise['all'](_0xf87fe2);})['then'](function(){return _0x57c584[_0x6a48('0x5f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6a48('0x15')](respondWithResult(_0x7ef66d,null))[_0x6a48('0x20')](handleError(_0x7ef66d,null));};exports[_0x6a48('0x107')]=function(_0x3ab135,_0x57da6b){var _0x1f6a94;return db[_0x6a48('0xaf')]['update']({'paused':0x1},{'where':{'UserId':_0x3ab135[_0x6a48('0x61')]['id']},'individualHooks':!![]})[_0x6a48('0x15')](function(){return db['User'][_0x6a48('0x38')]({'where':{'id':_0x3ab135[_0x6a48('0x61')]['id'],'role':'agent'},'attributes':['id',_0x6a48('0x3b'),_0x6a48('0x37'),_0x6a48('0x65'),_0x6a48('0xa3')]});})[_0x6a48('0x15')](handleEntityNotFound(_0x57da6b,null))['then'](function(_0x46b282){if(_0x46b282){_0x1f6a94=_0x46b282;return respondWithRpcPromise(_0x6a48('0x108'),_0x6a48('0x107'),{'id':_0x1f6a94['id'],'name':_0x1f6a94[_0x6a48('0x3b')],'pause':!![]});}})[_0x6a48('0x15')](function(){if(_0x1f6a94){return db['MemberReport'][_0x6a48('0x8e')]({'where':{'membername':_0x1f6a94[_0x6a48('0x3b')],'type':'PAUSE','exitAt':null}});}})[_0x6a48('0x15')](function(_0x51a483){if(_0x51a483[_0x6a48('0x4b')]){var _0x161767=moment()['format'](_0x6a48('0x100'));for(var _0x53e633=0x0,_0x1e5e70=_0x51a483[_0x6a48('0x4b')];_0x53e633<_0x1e5e70;_0x53e633++){_0x51a483[_0x53e633][_0x6a48('0x109')]({'exitAt':_0x161767});}}})[_0x6a48('0x15')](function(){var _0x294373=[];var _0x1b6174=utils[_0x6a48('0xff')]();_0x1b6174[_0x6a48('0x101')](function(_0xcb9353){_0x294373[_0x6a48('0x48')]({'channel':_0xcb9353,'membername':_0x1f6a94['name'],'interface':_['isNil'](_0x1f6a94['interface'])?util['format'](_0x6a48('0xf2'),_0x1f6a94[_0x6a48('0x3b')]):_0x1f6a94[_0x6a48('0xa3')],'type':_0x6a48('0x103'),'enterAt':moment()[_0x6a48('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3ab135[_0x6a48('0x60')][_0x6a48('0x41')]||_0x6a48('0x10a'),'role':_0x1f6a94[_0x6a48('0x37')],'internal':_0x1f6a94['internal']});});return db[_0x6a48('0xfe')]['bulkCreate'](_0x294373,{'individualHooks':!![]});})['then'](function(){return _0x1f6a94[_0x6a48('0x5f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3ab135[_0x6a48('0x60')][_0x6a48('0x41')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x6a48('0xae')](_0x6a48('0x100'))});})[_0x6a48('0x15')](respondWithResult(_0x57da6b,null))['catch'](handleError(_0x57da6b,null));};exports[_0x6a48('0x10b')]=function(_0x7a0f7,_0x2f891c){var _0x4a73d0;return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x7a0f7[_0x6a48('0x61')]['id']},'attributes':['id',_0x6a48('0x3b'),_0x6a48('0x37'),'voicePause',_0x6a48('0x10c'),'chatPause',_0x6a48('0x10d'),_0x6a48('0x10e'),_0x6a48('0x10f'),_0x6a48('0x110'),_0x6a48('0x111'),_0x6a48('0x112')]})[_0x6a48('0x15')](handleEntityNotFound(_0x2f891c,null))['then'](function(_0x42fea1){if(_0x42fea1){_0x4a73d0=_0x42fea1;if(_0x7a0f7[_0x6a48('0x60')][_0x6a48('0xa0')]&&!utils[_0x6a48('0xb1')](_0x7a0f7['body'][_0x6a48('0xa0')])){throw new db[(_0x6a48('0x94'))]['ValidationError'](_0x6a48('0xa4'));}switch(_0x7a0f7[_0x6a48('0x60')]['channel']){case _0x6a48('0xab'):return respondWithRpcPromise(_0x6a48('0x108'),_0x6a48('0x10b'),{'id':_0x4a73d0['id'],'name':_0x4a73d0[_0x6a48('0x3b')],'pause':![]})[_0x6a48('0x15')](function(){return db[_0x6a48('0xaf')][_0x6a48('0x5f')]({'paused':0x0},{'where':{'UserId':_0x4a73d0['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0x6a48('0x38')]({'where':{'channel':_0x7a0f7[_0x6a48('0x60')][_0x6a48('0xa0')],'membername':_0x4a73d0[_0x6a48('0x3b')],'type':_0x6a48('0x103'),'exitAt':null}});})[_0x6a48('0x15')](function(_0x54b2c1){if(_0x54b2c1){return _0x54b2c1['update']({'exitAt':moment()[_0x6a48('0xae')](_0x6a48('0x100')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x6a48('0x15')](function(){return _0x4a73d0[_0x6a48('0x5f')]({'voicePause':![]});});case _0x6a48('0x4f'):case _0x6a48('0x4c'):case'fax':case _0x6a48('0x4e'):case _0x6a48('0x50'):case'openchannel':return db[_0x6a48('0xfe')][_0x6a48('0x38')]({'where':{'channel':_0x7a0f7['body'][_0x6a48('0xa0')],'membername':_0x4a73d0[_0x6a48('0x3b')],'type':_0x6a48('0x103'),'exitAt':null}})[_0x6a48('0x15')](function(_0x1eec3f){if(_0x1eec3f){return _0x1eec3f[_0x6a48('0x5f')]({'exitAt':moment()[_0x6a48('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6a48('0x113')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x4c2deb={};_[_0x6a48('0x28')](_0x4c2deb,util[_0x6a48('0xae')](_0x6a48('0x114'),_0x7a0f7[_0x6a48('0x60')][_0x6a48('0xa0')],_0x6a48('0x115')),![]);return _0x4a73d0['update'](_0x4c2deb);});default:return respondWithRpcPromise('QueuePause',_0x6a48('0x10b'),{'id':_0x4a73d0['id'],'name':_0x4a73d0['name'],'pause':![]})[_0x6a48('0x15')](function(){return db[_0x6a48('0xaf')][_0x6a48('0x5f')]({'paused':0x0},{'where':{'UserId':_0x4a73d0['id']}});})[_0x6a48('0x15')](function(){return db[_0x6a48('0xfe')][_0x6a48('0x8e')]({'where':{'membername':_0x4a73d0['name'],'type':_0x6a48('0x103'),'exitAt':null}});})[_0x6a48('0x15')](function(_0x35a0a6){var _0x21d0ef=[];_0x35a0a6['forEach'](function(_0xe271b3){_0x21d0ef[_0x6a48('0x48')](_0xe271b3[_0x6a48('0x5f')]({'exitAt':moment()[_0x6a48('0xae')](_0x6a48('0x100')),'data2':_0x6a48('0x113')}));});return BPromise[_0x6a48('0x51')](_0x21d0ef);})['then'](function(){return _0x4a73d0['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x6a48('0x15')](respondWithResult(_0x2f891c,null))['catch'](handleError(_0x2f891c,null));};exports[_0x6a48('0x116')]=function(_0x2bb78f,_0x3d9066){var _0x2c2640={};var _0x527645={};var _0x3fa597;var _0x1b1055;return db['User'][_0x6a48('0xcc')]({'where':{'id':_0x2bb78f[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x3d9066,null))[_0x6a48('0x15')](function(_0xdfcd19){if(_0xdfcd19){_0x3fa597=_0xdfcd19;_0x527645[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0x117')][_0x6a48('0x3f')]);_0x527645['query']=_[_0x6a48('0xcd')](_0x2bb78f[_0x6a48('0x46')]);_0x527645['filters']=_[_0x6a48('0x57')](_0x527645[_0x6a48('0x53')],_0x527645['query']);_0x2c2640[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x527645[_0x6a48('0x53')],qs['fields'](_0x2bb78f[_0x6a48('0x46')]['fields']));_0x2c2640[_0x6a48('0x47')]=_0x2c2640['attributes'][_0x6a48('0x4b')]?_0x2c2640['attributes']:_0x527645[_0x6a48('0x53')];_0x2c2640[_0x6a48('0xcf')]=qs['sort'](_0x2bb78f[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x2c2640[_0x6a48('0x45')]=qs['filters'](_[_0x6a48('0xd1')](_0x2bb78f[_0x6a48('0x46')],_0x527645[_0x6a48('0x56')]));if(_0x2bb78f[_0x6a48('0x46')]['filter']){_0x2c2640['where']=_[_0x6a48('0x5b')](_0x2c2640[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x2c2640['attributes'],function(_0x32665b){var _0x57b713={};_0x57b713[_0x32665b]={'$like':'%'+_0x2bb78f[_0x6a48('0x46')]['filter']+'%'};return _0x57b713;})});}_0x2c2640=_[_0x6a48('0x5b')]({},_0x2c2640,_0x2bb78f[_0x6a48('0x5c')]);return _0x3fa597[_0x6a48('0x116')](_0x2c2640);}})[_0x6a48('0x15')](function(_0x27157f){if(_0x27157f){_0x1b1055=_0x27157f[_0x6a48('0x4b')];if(!_0x2bb78f[_0x6a48('0x46')][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x2c2640[_0x6a48('0x25')]=qs['limit'](_0x2bb78f['query'][_0x6a48('0x25')]);_0x2c2640[_0x6a48('0x27')]=qs['offset'](_0x2bb78f['query'][_0x6a48('0x27')]);}return _0x3fa597['getTeams'](_0x2c2640);}})[_0x6a48('0x15')](function(_0x1b08a8){if(_0x1b08a8){return _0x1b08a8?{'count':_0x1b1055,'rows':_0x1b08a8}:null;}})[_0x6a48('0x15')](respondWithResult(_0x3d9066,null))[_0x6a48('0x20')](handleError(_0x3d9066,null));};exports[_0x6a48('0x118')]=function(_0x29d127,_0x2e2b50){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x29d127['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x2e2b50,null))['then'](function(_0x480341){if(_0x480341){var _0x14643d=_0x480341[_0x6a48('0xad')]({'plain':!![]});return _0x480341['addTeams'](_0x29d127[_0x6a48('0x60')]['ids'],_[_0x6a48('0x119')](_0x29d127[_0x6a48('0x60')],['ids','id'])||{})[_0x6a48('0x15')](function(){for(var _0x3938c6=0x0;_0x3938c6<_0x29d127['body']['ids'][_0x6a48('0x4b')];_0x3938c6++){var _0x2ca15c=[];db[_0x6a48('0x117')][_0x6a48('0xcc')]({'where':{'id':_0x29d127[_0x6a48('0x60')][_0x6a48('0x64')][_0x3938c6]}})[_0x6a48('0x15')](function(_0x304a37){_0x2ca15c[_0x6a48('0x48')](_0x304a37[_0x6a48('0xfb')]()['then'](function(_0x428a9e){for(var _0x555bc3=0x0;_0x555bc3<_0x428a9e[_0x6a48('0x4b')];_0x555bc3++){_0x428a9e[_0x555bc3][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x11b'));}return _0x428a9e;}));_0x2ca15c[_0x6a48('0x48')](_0x304a37[_0x6a48('0x11c')]()[_0x6a48('0x15')](function(_0x5615c8){for(var _0x5c9355=0x0;_0x5c9355<_0x5615c8[_0x6a48('0x4b')];_0x5c9355++){_0x5615c8[_0x5c9355][_0x6a48('0x11a')](_0x6a48('0xa0'),'Chat');}return _0x5615c8;}));_0x2ca15c[_0x6a48('0x48')](_0x304a37['getMailQueues']()[_0x6a48('0x15')](function(_0x5137be){for(var _0x1d6380=0x0;_0x1d6380<_0x5137be['length'];_0x1d6380++){_0x5137be[_0x1d6380][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x11d'));}return _0x5137be;}));_0x2ca15c[_0x6a48('0x48')](_0x304a37['getSmsQueues']()[_0x6a48('0x15')](function(_0x39f1a7){for(var _0x5df06f=0x0;_0x5df06f<_0x39f1a7[_0x6a48('0x4b')];_0x5df06f++){_0x39f1a7[_0x5df06f][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x11e'));}return _0x39f1a7;}));_0x2ca15c[_0x6a48('0x48')](_0x304a37['getWhatsappQueues']()['then'](function(_0x5ed161){for(var _0x5b517d=0x0;_0x5b517d<_0x5ed161['length'];_0x5b517d++){_0x5ed161[_0x5b517d][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x11f'));}return _0x5ed161;}));_0x2ca15c[_0x6a48('0x48')](_0x304a37['getFaxQueues']()['then'](function(_0x5663e0){for(var _0x4ff8e3=0x0;_0x4ff8e3<_0x5663e0[_0x6a48('0x4b')];_0x4ff8e3++){_0x5663e0[_0x4ff8e3][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x120'));}return _0x5663e0;}));_0x2ca15c[_0x6a48('0x48')](_0x304a37[_0x6a48('0x121')]()[_0x6a48('0x15')](function(_0x2b7133){for(var _0x41cba0=0x0;_0x41cba0<_0x2b7133[_0x6a48('0x4b')];_0x41cba0++){_0x2b7133[_0x41cba0][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x122'));}return _0x2b7133;}));return BPromise[_0x6a48('0x51')](_0x2ca15c);})['then'](function(_0x2e7eb3){var _0x557260=_[_0x6a48('0x123')](_0x2e7eb3);_0x2ca15c=[];return db['sequelize']['transaction'](function(_0x36578f){for(var _0x385e5f=0x0;_0x385e5f<_0x557260['length'];_0x385e5f++){_0x2ca15c[_0x6a48('0x48')](_0x557260[_0x385e5f][_0x6a48('0x124')](_0x14643d['id']),{'transaction':_0x36578f});}return BPromise[_0x6a48('0x51')](_0x2ca15c)[_0x6a48('0x15')](function(){if(_0x14643d[_0x6a48('0xa1')]){return BPromise[_0x6a48('0x8d')](_[_0x6a48('0x32')](_0x557260,function(_0x3d174b){return _0x3d174b[_0x6a48('0x125')](_0x6a48('0xa0'))===_0x6a48('0x11b');}),function(_0x37ec45){return db[_0x6a48('0xaf')][_0x6a48('0xb0')]({'membername':_0x14643d[_0x6a48('0x3b')],'UserId':_0x14643d['id'],'queue_name':_0x37ec45[_0x6a48('0x3b')],'VoiceQueueId':_0x37ec45['id'],'interface':_['isNil'](_0x14643d[_0x6a48('0xa3')])?util['format'](_0x6a48('0xf2'),_0x14643d[_0x6a48('0x3b')]):_0x14643d[_0x6a48('0xa3')],'paused':_0x14643d['voicePause']||![],'penalty':_0x14643d[_0x6a48('0xa7')]},{'transaction':_0x36578f});});}else{return;}})['then'](function(){for(var _0xcc8548=0x0;_0xcc8548<_0x557260['length'];_0xcc8548++){var _0x4ac958=_0x557260[_0xcc8548][_0x6a48('0x125')](_0x6a48('0xa0'));var _0x57eccd=_0x4ac958+_0x6a48('0xb5');socket[_0x6a48('0xb6')]('user'+_0x4ac958+_0x6a48('0xaa'),{'UserId':_0x14643d['id'],['queueField']:_0x557260[_0xcc8548]['id']});}});});});}});}})[_0x6a48('0x15')](respondWithStatusCode(_0x2e2b50,null))[_0x6a48('0x20')](handleError(_0x2e2b50,null));};exports[_0x6a48('0x126')]=function(_0x301450,_0x3d89b7){return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x301450[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x3d89b7,null))[_0x6a48('0x15')](function(_0x270bc7){if(_0x270bc7){var _0x19d302=_0x270bc7[_0x6a48('0xad')]({'plain':!![]});var _0x2a7b1f=_0x301450[_0x6a48('0x46')][_0x6a48('0x64')];return _0x270bc7[_0x6a48('0x126')](_0x2a7b1f)[_0x6a48('0x15')](function(){for(var _0x250a94=0x0;_0x250a94<_0x2a7b1f[_0x6a48('0x4b')];_0x250a94++){var _0x229cd5=[];db[_0x6a48('0x117')][_0x6a48('0xcc')]({'where':{'id':_0x2a7b1f[_0x250a94]}})[_0x6a48('0x15')](function(_0x3cab66){_0x229cd5['push'](_0x3cab66[_0x6a48('0xfb')]()['then'](function(_0x59e3b4){for(var _0x594179=0x0;_0x594179<_0x59e3b4['length'];_0x594179++){_0x59e3b4[_0x594179]['setDataValue'](_0x6a48('0xa0'),_0x6a48('0x11b'));}return _0x59e3b4;}));_0x229cd5[_0x6a48('0x48')](_0x3cab66['getChatQueues']()[_0x6a48('0x15')](function(_0x3602e0){for(var _0x166fc0=0x0;_0x166fc0<_0x3602e0[_0x6a48('0x4b')];_0x166fc0++){_0x3602e0[_0x166fc0][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x127'));}return _0x3602e0;}));_0x229cd5['push'](_0x3cab66[_0x6a48('0x128')]()[_0x6a48('0x15')](function(_0x26d6ce){for(var _0x17a439=0x0;_0x17a439<_0x26d6ce[_0x6a48('0x4b')];_0x17a439++){_0x26d6ce[_0x17a439][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x11d'));}return _0x26d6ce;}));_0x229cd5[_0x6a48('0x48')](_0x3cab66[_0x6a48('0x129')]()[_0x6a48('0x15')](function(_0x4e868f){for(var _0x34fe23=0x0;_0x34fe23<_0x4e868f[_0x6a48('0x4b')];_0x34fe23++){_0x4e868f[_0x34fe23][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x11e'));}return _0x4e868f;}));_0x229cd5[_0x6a48('0x48')](_0x3cab66[_0x6a48('0x12a')]()[_0x6a48('0x15')](function(_0x1d0fb3){for(var _0x4ceeed=0x0;_0x4ceeed<_0x1d0fb3[_0x6a48('0x4b')];_0x4ceeed++){_0x1d0fb3[_0x4ceeed][_0x6a48('0x11a')]('channel','Whatsapp');}return _0x1d0fb3;}));_0x229cd5['push'](_0x3cab66['getFaxQueues']()[_0x6a48('0x15')](function(_0x100f3a){for(var _0x14bacf=0x0;_0x14bacf<_0x100f3a[_0x6a48('0x4b')];_0x14bacf++){_0x100f3a[_0x14bacf][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x120'));}return _0x100f3a;}));_0x229cd5[_0x6a48('0x48')](_0x3cab66[_0x6a48('0x121')]()[_0x6a48('0x15')](function(_0x45a1e4){for(var _0x497c63=0x0;_0x497c63<_0x45a1e4['length'];_0x497c63++){_0x45a1e4[_0x497c63][_0x6a48('0x11a')](_0x6a48('0xa0'),_0x6a48('0x122'));}return _0x45a1e4;}));return BPromise[_0x6a48('0x51')](_0x229cd5);})[_0x6a48('0x15')](function(_0x12392b){var _0x4f601d=_[_0x6a48('0x123')](_0x12392b);_0x229cd5=[];return db[_0x6a48('0x6b')][_0x6a48('0x12b')](function(_0x3c4bea){for(var _0x1a2d7e=0x0;_0x1a2d7e<_0x4f601d[_0x6a48('0x4b')];_0x1a2d7e++){_0x229cd5['push'](_0x4f601d[_0x1a2d7e][_0x6a48('0x12c')](_0x19d302['id']),{'transaction':_0x3c4bea});}return BPromise['all'](_0x229cd5)[_0x6a48('0x15')](function(){if(_0x19d302['online']){return BPromise[_0x6a48('0x8d')](_['filter'](_0x4f601d,function(_0x30b554){return _0x30b554[_0x6a48('0x125')]('channel')===_0x6a48('0x11b');}),function(_0x2d99f3){return db[_0x6a48('0xaf')][_0x6a48('0x2a')]({'where':{'VoiceQueueId':_0x2d99f3['id'],'UserId':_0x19d302['id']},'transaction':_0x3c4bea});});}else{return;}})['then'](function(){for(var _0x4a47bd=0x0;_0x4a47bd<_0x4f601d[_0x6a48('0x4b')];_0x4a47bd++){var _0x55bd8e=_0x4f601d[_0x4a47bd]['getDataValue'](_0x6a48('0xa0'));var _0x33871a=_0x55bd8e+_0x6a48('0xb5');socket[_0x6a48('0xb6')]('user'+_0x55bd8e+'Queue:remove',{'UserId':_0x19d302['id'],['queueField']:_0x4f601d[_0x4a47bd]['id']});}});});});}});}})[_0x6a48('0x15')](respondWithStatusCode(_0x3d89b7,null))[_0x6a48('0x20')](handleError(_0x3d89b7,null));};exports[_0x6a48('0x12d')]=function(_0x20eb26,_0xea3b04){var _0x17abd7={};var _0x528129={};var _0x239b57;var _0x391326;return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x20eb26['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0xea3b04,null))[_0x6a48('0x15')](function(_0x31f9d9){if(_0x31f9d9){_0x239b57=_0x31f9d9;_0x528129[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0xd4')][_0x6a48('0x3f')]);_0x528129[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x20eb26[_0x6a48('0x46')]);_0x528129['filters']=_['intersection'](_0x528129['model'],_0x528129[_0x6a48('0x46')]);_0x17abd7[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x528129[_0x6a48('0x53')],qs['fields'](_0x20eb26[_0x6a48('0x46')][_0x6a48('0x58')]));_0x17abd7[_0x6a48('0x47')]=_0x17abd7[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x17abd7['attributes']:_0x528129['model'];_0x17abd7['order']=qs['sort'](_0x20eb26[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x17abd7['where']=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x20eb26[_0x6a48('0x46')],_0x528129['filters']));if(_0x20eb26[_0x6a48('0x46')][_0x6a48('0x32')]){_0x17abd7[_0x6a48('0x45')]=_['merge'](_0x17abd7['where'],{'$or':_[_0x6a48('0x34')](_0x17abd7['attributes'],function(_0x27f1df){var _0x34e3f9={};_0x34e3f9[_0x27f1df]={'$like':'%'+_0x20eb26[_0x6a48('0x46')]['filter']+'%'};return _0x34e3f9;})});}_0x17abd7=_[_0x6a48('0x5b')]({},_0x17abd7,_0x20eb26[_0x6a48('0x5c')]);return _0x239b57[_0x6a48('0x12d')](_0x17abd7);}})[_0x6a48('0x15')](function(_0x2b649b){if(_0x2b649b){_0x391326=_0x2b649b[_0x6a48('0x4b')];if(!_0x20eb26['query']['hasOwnProperty']('nolimit')){_0x17abd7[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x20eb26[_0x6a48('0x46')][_0x6a48('0x25')]);_0x17abd7[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0x20eb26['query'][_0x6a48('0x27')]);}return _0x239b57[_0x6a48('0x12d')](_0x17abd7);}})[_0x6a48('0x15')](function(_0x5e4155){if(_0x5e4155){return _0x5e4155?{'count':_0x391326,'rows':_0x5e4155}:null;}})[_0x6a48('0x15')](respondWithResult(_0xea3b04,null))[_0x6a48('0x20')](handleError(_0xea3b04,null));};exports[_0x6a48('0x12e')]=function(_0xde4e3c,_0x59d7fc){var _0x5cd7ec={};var _0x1e4661={};var _0x2d4d61;var _0x2d87e7;return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0xde4e3c[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x59d7fc,null))[_0x6a48('0x15')](function(_0x2dedb5){if(_0x2dedb5){_0x2d4d61=_0x2dedb5;_0x1e4661[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db['User'][_0x6a48('0x3f')]);_0x1e4661[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0xde4e3c[_0x6a48('0x46')]);_0x1e4661[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x1e4661[_0x6a48('0x53')],_0x1e4661[_0x6a48('0x46')]);_0x5cd7ec[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x1e4661['model'],qs[_0x6a48('0x58')](_0xde4e3c['query']['fields']));_0x5cd7ec[_0x6a48('0x47')]=_0x5cd7ec['attributes'][_0x6a48('0x4b')]?_0x5cd7ec[_0x6a48('0x47')]:_0x1e4661[_0x6a48('0x53')];_0x5cd7ec[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0xde4e3c[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x5cd7ec[_0x6a48('0x45')]=qs['filters'](_[_0x6a48('0xd1')](_0xde4e3c[_0x6a48('0x46')],_0x1e4661[_0x6a48('0x56')]));if(_0xde4e3c[_0x6a48('0x46')][_0x6a48('0x32')]){_0x5cd7ec['where']=_[_0x6a48('0x5b')](_0x5cd7ec['where'],{'$or':_[_0x6a48('0x34')](_0x5cd7ec[_0x6a48('0x47')],function(_0x30ec17){var _0x6b897e={};_0x6b897e[_0x30ec17]={'$like':'%'+_0xde4e3c['query'][_0x6a48('0x32')]+'%'};return _0x6b897e;})});}_0x5cd7ec['model']=db['User'];_0x5cd7ec['as']='Agents';_0x5cd7ec=_[_0x6a48('0x5b')]({},_0x5cd7ec,_0xde4e3c[_0x6a48('0x5c')]);return _0x2d4d61[_0x6a48('0xfb')]({'include':[_0x5cd7ec]});}})[_0x6a48('0x15')](function(_0x106b9b){if(_0x106b9b){var _0x10888d={},_0x52c19d=[],_0x49985c=0x0;for(var _0x5e2cbe=0x0;_0x5e2cbe<_0x106b9b[_0x6a48('0x4b')];_0x5e2cbe+=0x1){for(var _0x57f63b=0x0,_0x248397;_0x57f63b<_0x106b9b[_0x5e2cbe][_0x6a48('0x2e')][_0x6a48('0x4b')];_0x57f63b+=0x1){_0x248397=_0x106b9b[_0x5e2cbe]['Agents'][_0x57f63b][_0x6a48('0xad')]({'plain':!![]});_0x10888d[_0x248397['id']]=_0x248397;}}_0x10888d=_['values'](_0x10888d);for(var _0x318c82=qs['offset'](_0xde4e3c[_0x6a48('0x46')][_0x6a48('0x27')]);_0x318c82<_0x10888d['length']&&_0x52c19d[_0x6a48('0x4b')]<qs[_0x6a48('0x25')](_0xde4e3c[_0x6a48('0x46')][_0x6a48('0x25')]);_0x318c82+=0x1){if(_0x10888d[_0x318c82]){_0x52c19d['push'](_0x10888d[_0x318c82]);}}return{'count':_0x10888d['length'],'rows':_0x52c19d};}})[_0x6a48('0x15')](respondWithResult(_0x59d7fc,null))['catch'](handleError(_0x59d7fc,null));};exports[_0x6a48('0x2a')]=function(_0x31d667,_0x443113){if(_0x31d667[_0x6a48('0x2d')]['id']==_0x31d667[_0x6a48('0x61')]['id']){return _0x443113[_0x6a48('0x23')](0x1f4)['send']({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0x6a48('0x3e')]['find']({'where':{'id':_0x31d667[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x443113,null))[_0x6a48('0x15')](removeEntity(_0x443113,null))[_0x6a48('0x20')](handleError(_0x443113,null));};exports['addChatInteractions']=function(_0x3563ff,_0xa7f247){return db[_0x6a48('0x3e')]['find']({'where':{'id':_0x3563ff[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0xa7f247,null))[_0x6a48('0x15')](function(_0x5134e0){if(_0x5134e0){return _0x5134e0[_0x6a48('0x12f')](_0x3563ff['body'][_0x6a48('0x64')],_['omit'](_0x3563ff[_0x6a48('0x60')],[_0x6a48('0x64'),'id'])||{})[_0x6a48('0xa8')](function(){for(var _0x1cfbae=0x0;_0x1cfbae<_0x3563ff[_0x6a48('0x60')]['ids'][_0x6a48('0x4b')];_0x1cfbae+=0x1){socket[_0x6a48('0xb6')](_0x6a48('0x130'),{'ChatInteractionId':Number(_0x3563ff[_0x6a48('0x60')][_0x6a48('0x64')][_0x1cfbae]),'UserId':Number(_0x3563ff[_0x6a48('0x61')]['id'])});}return _0x3563ff[_0x6a48('0x60')][_0x6a48('0x64')];});}})[_0x6a48('0x15')](respondWithResult(_0xa7f247,null))[_0x6a48('0x20')](handleError(_0xa7f247,null));};exports['removeChatInteractions']=function(_0x5f3cf5,_0x4ab6f1){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x5f3cf5[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x4ab6f1,null))[_0x6a48('0x15')](function(_0x13eb61){if(_0x13eb61){return _0x13eb61[_0x6a48('0x131')](_0x5f3cf5['query']['ids'])[_0x6a48('0x15')](function(){if(_[_0x6a48('0xb4')](_0x5f3cf5[_0x6a48('0x46')][_0x6a48('0x64')])){for(var _0x2dab7b=0x0;_0x2dab7b<_0x5f3cf5['query'][_0x6a48('0x64')]['length'];_0x2dab7b+=0x1){socket[_0x6a48('0xb6')](_0x6a48('0x132'),{'ChatInteractionId':Number(_0x5f3cf5['query'][_0x6a48('0x64')][_0x2dab7b]),'UserId':Number(_0x5f3cf5[_0x6a48('0x61')]['id'])});}}else{socket[_0x6a48('0xb6')](_0x6a48('0x132'),{'ChatInteractionId':Number(_0x5f3cf5[_0x6a48('0x46')][_0x6a48('0x64')]),'UserId':Number(_0x5f3cf5[_0x6a48('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ab6f1,null))[_0x6a48('0x20')](handleError(_0x4ab6f1,null));};exports[_0x6a48('0x133')]=function(_0xf91590,_0x44bf17){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0xf91590[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x44bf17,null))['then'](function(_0x3872ed){if(_0x3872ed){return _0x3872ed['addMailInteractions'](_0xf91590[_0x6a48('0x60')][_0x6a48('0x64')],_[_0x6a48('0x119')](_0xf91590[_0x6a48('0x60')],[_0x6a48('0x64'),'id'])||{})[_0x6a48('0xa8')](function(){for(var _0x13d650=0x0;_0x13d650<_0xf91590[_0x6a48('0x60')]['ids'][_0x6a48('0x4b')];_0x13d650+=0x1){socket[_0x6a48('0xb6')](_0x6a48('0x134'),{'MailInteractionId':Number(_0xf91590[_0x6a48('0x60')][_0x6a48('0x64')][_0x13d650]),'UserId':Number(_0xf91590['params']['id'])});}return _0xf91590[_0x6a48('0x60')][_0x6a48('0x64')];});}})[_0x6a48('0x15')](respondWithResult(_0x44bf17,null))['catch'](handleError(_0x44bf17,null));};exports[_0x6a48('0x135')]=function(_0x32a096,_0x5e5f6d){return db['User'][_0x6a48('0x38')]({'where':{'id':_0x32a096[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x5e5f6d,null))['then'](function(_0x5e44a0){if(_0x5e44a0){return _0x5e44a0['removeMailInteractions'](_0x32a096['query'][_0x6a48('0x64')])[_0x6a48('0x15')](function(){if(_[_0x6a48('0xb4')](_0x32a096['query'][_0x6a48('0x64')])){for(var _0xcd7fae=0x0;_0xcd7fae<_0x32a096['query'][_0x6a48('0x64')][_0x6a48('0x4b')];_0xcd7fae+=0x1){socket['emit'](_0x6a48('0x136'),{'MailInteractionId':Number(_0x32a096['query'][_0x6a48('0x64')][_0xcd7fae]),'UserId':Number(_0x32a096[_0x6a48('0x61')]['id'])});}}else{socket[_0x6a48('0xb6')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x32a096['query'][_0x6a48('0x64')]),'UserId':Number(_0x32a096[_0x6a48('0x61')]['id'])});}});}})[_0x6a48('0x15')](respondWithStatusCode(_0x5e5f6d,null))['catch'](handleError(_0x5e5f6d,null));};exports['addFaxInteractions']=function(_0x2fb064,_0x57b2ad){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x2fb064[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x57b2ad,null))[_0x6a48('0x15')](function(_0x28a4ad){if(_0x28a4ad){return _0x28a4ad[_0x6a48('0x137')](_0x2fb064[_0x6a48('0x60')]['ids'],_[_0x6a48('0x119')](_0x2fb064['body'],[_0x6a48('0x64'),'id'])||{})[_0x6a48('0xa8')](function(){for(var _0x56f6c4=0x0;_0x56f6c4<_0x2fb064[_0x6a48('0x60')]['ids'][_0x6a48('0x4b')];_0x56f6c4+=0x1){socket[_0x6a48('0xb6')]('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x2fb064[_0x6a48('0x60')][_0x6a48('0x64')][_0x56f6c4]),'UserId':Number(_0x2fb064['params']['id'])});}return _0x2fb064['body'][_0x6a48('0x64')];});}})[_0x6a48('0x15')](respondWithResult(_0x57b2ad,null))[_0x6a48('0x20')](handleError(_0x57b2ad,null));};exports[_0x6a48('0x138')]=function(_0x36a3d0,_0x1f07ce){return db['User'][_0x6a48('0x38')]({'where':{'id':_0x36a3d0['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x1f07ce,null))['then'](function(_0x20479f){if(_0x20479f){return _0x20479f[_0x6a48('0x138')](_0x36a3d0['query']['ids'])[_0x6a48('0x15')](function(){if(_['isArray'](_0x36a3d0[_0x6a48('0x46')][_0x6a48('0x64')])){for(var _0x447c84=0x0;_0x447c84<_0x36a3d0[_0x6a48('0x46')][_0x6a48('0x64')][_0x6a48('0x4b')];_0x447c84+=0x1){socket[_0x6a48('0xb6')](_0x6a48('0x139'),{'FaxInteractionId':Number(_0x36a3d0[_0x6a48('0x46')][_0x6a48('0x64')][_0x447c84]),'UserId':Number(_0x36a3d0[_0x6a48('0x61')]['id'])});}}else{socket[_0x6a48('0xb6')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x36a3d0[_0x6a48('0x46')][_0x6a48('0x64')]),'UserId':Number(_0x36a3d0[_0x6a48('0x61')]['id'])});}});}})[_0x6a48('0x15')](respondWithStatusCode(_0x1f07ce,null))[_0x6a48('0x20')](handleError(_0x1f07ce,null));};exports['addSmsInteractions']=function(_0x3b38b5,_0x1fcc1a){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x3b38b5['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x1fcc1a,null))[_0x6a48('0x15')](function(_0xb04c62){if(_0xb04c62){return _0xb04c62['addSmsInteractions'](_0x3b38b5[_0x6a48('0x60')][_0x6a48('0x64')],_[_0x6a48('0x119')](_0x3b38b5[_0x6a48('0x60')],[_0x6a48('0x64'),'id'])||{})[_0x6a48('0xa8')](function(){for(var _0x415322=0x0;_0x415322<_0x3b38b5[_0x6a48('0x60')][_0x6a48('0x64')]['length'];_0x415322+=0x1){socket[_0x6a48('0xb6')](_0x6a48('0x13a'),{'SmsInteractionId':Number(_0x3b38b5['body'][_0x6a48('0x64')][_0x415322]),'UserId':Number(_0x3b38b5['params']['id'])});}return _0x3b38b5[_0x6a48('0x60')]['ids'];});}})[_0x6a48('0x15')](respondWithResult(_0x1fcc1a,null))['catch'](handleError(_0x1fcc1a,null));};exports[_0x6a48('0x13b')]=function(_0x46abef,_0x2c98c2){return db['User'][_0x6a48('0x38')]({'where':{'id':_0x46abef[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x2c98c2,null))[_0x6a48('0x15')](function(_0x50ebcd){if(_0x50ebcd){return _0x50ebcd[_0x6a48('0x13b')](_0x46abef['query'][_0x6a48('0x64')])['then'](function(){if(_[_0x6a48('0xb4')](_0x46abef[_0x6a48('0x46')][_0x6a48('0x64')])){for(var _0x2c53c4=0x0;_0x2c53c4<_0x46abef[_0x6a48('0x46')][_0x6a48('0x64')]['length'];_0x2c53c4+=0x1){socket[_0x6a48('0xb6')](_0x6a48('0x13c'),{'SmsInteractionId':Number(_0x46abef[_0x6a48('0x46')][_0x6a48('0x64')][_0x2c53c4]),'UserId':Number(_0x46abef[_0x6a48('0x61')]['id'])});}}else{socket[_0x6a48('0xb6')](_0x6a48('0x13c'),{'SmsInteractionId':Number(_0x46abef['query'][_0x6a48('0x64')]),'UserId':Number(_0x46abef['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2c98c2,null))[_0x6a48('0x20')](handleError(_0x2c98c2,null));};exports[_0x6a48('0x13d')]=function(_0x1854a8,_0x4a0868){return db['User'][_0x6a48('0x38')]({'where':{'id':_0x1854a8[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x4a0868,null))[_0x6a48('0x15')](function(_0x5a03d2){if(_0x5a03d2){return _0x5a03d2[_0x6a48('0x13d')](_0x1854a8['body'][_0x6a48('0x64')],_['omit'](_0x1854a8[_0x6a48('0x60')],[_0x6a48('0x64'),'id'])||{})[_0x6a48('0xa8')](function(){for(var _0x27341f=0x0;_0x27341f<_0x1854a8['body']['ids'][_0x6a48('0x4b')];_0x27341f+=0x1){socket['emit'](_0x6a48('0x13e'),{'OpenchannelInteractionId':Number(_0x1854a8[_0x6a48('0x60')][_0x6a48('0x64')][_0x27341f]),'UserId':Number(_0x1854a8['params']['id'])});}return _0x1854a8[_0x6a48('0x60')][_0x6a48('0x64')];});}})['then'](respondWithResult(_0x4a0868,null))[_0x6a48('0x20')](handleError(_0x4a0868,null));};exports['removeOpenchannelInteractions']=function(_0x5c5515,_0x202503){return db['User'][_0x6a48('0x38')]({'where':{'id':_0x5c5515[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x202503,null))[_0x6a48('0x15')](function(_0x53d497){if(_0x53d497){return _0x53d497['removeOpenchannelInteractions'](_0x5c5515[_0x6a48('0x46')][_0x6a48('0x64')])['then'](function(){if(_['isArray'](_0x5c5515[_0x6a48('0x46')]['ids'])){for(var _0x5966cd=0x0;_0x5966cd<_0x5c5515[_0x6a48('0x46')][_0x6a48('0x64')]['length'];_0x5966cd+=0x1){socket['emit'](_0x6a48('0x13f'),{'OpenchannelInteractionId':Number(_0x5c5515[_0x6a48('0x46')]['ids'][_0x5966cd]),'UserId':Number(_0x5c5515[_0x6a48('0x61')]['id'])});}}else{socket[_0x6a48('0xb6')](_0x6a48('0x13f'),{'OpenchannelInteractionId':Number(_0x5c5515['query'][_0x6a48('0x64')]),'UserId':Number(_0x5c5515[_0x6a48('0x61')]['id'])});}});}})[_0x6a48('0x15')](respondWithStatusCode(_0x202503,null))[_0x6a48('0x20')](handleError(_0x202503,null));};exports[_0x6a48('0x140')]=function(_0x256aec,_0x37aada){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x256aec[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x37aada,null))['then'](function(_0x57d070){if(_0x57d070){return _0x57d070[_0x6a48('0x140')](_0x256aec[_0x6a48('0x60')][_0x6a48('0x64')],_[_0x6a48('0x119')](_0x256aec[_0x6a48('0x60')],[_0x6a48('0x64'),'id'])||{})['spread'](function(){for(var _0x37a176=0x0;_0x37a176<_0x256aec[_0x6a48('0x60')][_0x6a48('0x64')][_0x6a48('0x4b')];_0x37a176+=0x1){socket['emit'](_0x6a48('0x141'),{'WhatsappInteractionId':Number(_0x256aec[_0x6a48('0x60')][_0x6a48('0x64')][_0x37a176]),'UserId':Number(_0x256aec[_0x6a48('0x61')]['id'])});}return _0x256aec[_0x6a48('0x60')][_0x6a48('0x64')];});}})[_0x6a48('0x15')](respondWithResult(_0x37aada,null))['catch'](handleError(_0x37aada,null));};exports[_0x6a48('0x142')]=function(_0x5ad693,_0x5d3639){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x5ad693[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x5d3639,null))[_0x6a48('0x15')](function(_0x1de757){if(_0x1de757){return _0x1de757[_0x6a48('0x142')](_0x5ad693['query'][_0x6a48('0x64')]);}})[_0x6a48('0x15')](respondWithStatusCode(_0x5d3639,null))[_0x6a48('0x20')](handleError(_0x5d3639,null));};exports[_0x6a48('0x143')]=function(_0x2f228d,_0x369ca2){var _0x5ce774={};var _0x29d6b7={};var _0x3a358c;var _0xd814f8;return db[_0x6a48('0x3e')]['findOne']({'where':{'id':_0x2f228d[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x369ca2,null))[_0x6a48('0x15')](function(_0x2ca705){if(_0x2ca705){_0x3a358c=_0x2ca705;_0x29d6b7[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0x144')][_0x6a48('0x3f')]);_0x29d6b7[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x2f228d[_0x6a48('0x46')]);_0x29d6b7['filters']=_[_0x6a48('0x57')](_0x29d6b7[_0x6a48('0x53')],_0x29d6b7[_0x6a48('0x46')]);_0x5ce774[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x29d6b7['model'],qs['fields'](_0x2f228d['query'][_0x6a48('0x58')]));_0x5ce774[_0x6a48('0x47')]=_0x5ce774[_0x6a48('0x47')]['length']?_0x5ce774[_0x6a48('0x47')]:_0x29d6b7['model'];_0x5ce774['order']=qs[_0x6a48('0xd0')](_0x2f228d[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x5ce774[_0x6a48('0x45')]=qs['filters'](_[_0x6a48('0xd1')](_0x2f228d['query'],_0x29d6b7[_0x6a48('0x56')]));if(_0x2f228d[_0x6a48('0x46')][_0x6a48('0x32')]){_0x5ce774['where']=_['merge'](_0x5ce774[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x5ce774['attributes'],function(_0x22feb5){var _0x3833f7={};_0x3833f7[_0x22feb5]={'$like':'%'+_0x2f228d['query']['filter']+'%'};return _0x3833f7;})});}_0x5ce774=_[_0x6a48('0x5b')]({},_0x5ce774,_0x2f228d[_0x6a48('0x5c')]);return _0x3a358c['getVoicePrefixes'](_0x5ce774);}})[_0x6a48('0x15')](function(_0x49ddff){if(_0x49ddff){_0xd814f8=_0x49ddff[_0x6a48('0x4b')];if(!_0x2f228d[_0x6a48('0x46')][_0x6a48('0xd3')]('nolimit')){_0x5ce774[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x2f228d[_0x6a48('0x46')]['limit']);_0x5ce774[_0x6a48('0x27')]=qs['offset'](_0x2f228d[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x3a358c[_0x6a48('0x143')](_0x5ce774);}})['then'](function(_0x2d7102){if(_0x2d7102){return _0x2d7102?{'count':_0xd814f8,'rows':_0x2d7102}:null;}})[_0x6a48('0x15')](respondWithResult(_0x369ca2,null))[_0x6a48('0x20')](handleError(_0x369ca2,null));};exports[_0x6a48('0x145')]=function(_0x307b0b,_0x7be7a3){var _0x2f05d8={};var _0x1e2d65={};var _0x37ceff;var _0x11d041;return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x307b0b[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x7be7a3,null))[_0x6a48('0x15')](function(_0x84137e){if(_0x84137e){_0x37ceff=_0x84137e;_0x1e2d65['model']=_[_0x6a48('0xcd')](db[_0x6a48('0x146')]['rawAttributes']);_0x1e2d65['query']=_[_0x6a48('0xcd')](_0x307b0b[_0x6a48('0x46')]);_0x1e2d65[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x1e2d65['model'],_0x1e2d65['query']);_0x2f05d8[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x1e2d65[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x307b0b[_0x6a48('0x46')]['fields']));_0x2f05d8[_0x6a48('0x47')]=_0x2f05d8[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x2f05d8['attributes']:_0x1e2d65['model'];_0x2f05d8[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0x307b0b[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x2f05d8[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x307b0b[_0x6a48('0x46')],_0x1e2d65[_0x6a48('0x56')]));if(_0x307b0b[_0x6a48('0x46')]['filter']){_0x2f05d8[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x2f05d8[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x2f05d8[_0x6a48('0x47')],function(_0x14bf5c){var _0x38f627={};_0x38f627[_0x14bf5c]={'$like':'%'+_0x307b0b[_0x6a48('0x46')]['filter']+'%'};return _0x38f627;})});}_0x2f05d8=_[_0x6a48('0x5b')]({},_0x2f05d8,_0x307b0b[_0x6a48('0x5c')]);return _0x37ceff[_0x6a48('0x145')](_0x2f05d8);}})[_0x6a48('0x15')](function(_0x5aa020){if(_0x5aa020){_0x11d041=_0x5aa020[_0x6a48('0x4b')];if(!_0x307b0b['query'][_0x6a48('0xd3')]('nolimit')){_0x2f05d8[_0x6a48('0x25')]=qs['limit'](_0x307b0b[_0x6a48('0x46')][_0x6a48('0x25')]);_0x2f05d8[_0x6a48('0x27')]=qs['offset'](_0x307b0b[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x37ceff[_0x6a48('0x145')](_0x2f05d8);}})[_0x6a48('0x15')](function(_0x19f930){if(_0x19f930){return _0x19f930?{'count':_0x11d041,'rows':_0x19f930}:null;}})[_0x6a48('0x15')](respondWithResult(_0x7be7a3,null))[_0x6a48('0x20')](handleError(_0x7be7a3,null));};exports['addFaxAccounts']=function(_0x1186c1,_0x497410){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x1186c1[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x497410,null))[_0x6a48('0x15')](function(_0x4e13ba){if(_0x4e13ba){return _0x4e13ba['addFaxAccounts'](_0x1186c1[_0x6a48('0x60')][_0x6a48('0x64')],_[_0x6a48('0x119')](_0x1186c1[_0x6a48('0x60')],[_0x6a48('0x64'),'id'])||{});}})[_0x6a48('0x15')](respondWithResult(_0x497410,null))[_0x6a48('0x20')](handleError(_0x497410,null));};exports['removeFaxAccounts']=function(_0x203a0e,_0x386931){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x203a0e[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x386931,null))['then'](function(_0x5e97ce){if(_0x5e97ce){return _0x5e97ce[_0x6a48('0x147')](_0x203a0e[_0x6a48('0x46')][_0x6a48('0x64')]);}})[_0x6a48('0x15')](respondWithStatusCode(_0x386931,null))[_0x6a48('0x20')](handleError(_0x386931,null));};exports[_0x6a48('0x148')]=function(_0x4bc464,_0x3ffeae){var _0x435f36={};var _0x49df1b={};var _0x2214d7;var _0x12a15d;return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x4bc464['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x3ffeae,null))[_0x6a48('0x15')](function(_0x469b22){if(_0x469b22){_0x2214d7=_0x469b22;_0x49df1b[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0x149')][_0x6a48('0x3f')]);_0x49df1b[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x4bc464[_0x6a48('0x46')]);_0x49df1b[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x49df1b['model'],_0x49df1b[_0x6a48('0x46')]);_0x435f36[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x49df1b[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x4bc464[_0x6a48('0x46')][_0x6a48('0x58')]));_0x435f36[_0x6a48('0x47')]=_0x435f36[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x435f36[_0x6a48('0x47')]:_0x49df1b[_0x6a48('0x53')];_0x435f36[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0x4bc464[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x435f36['where']=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x4bc464['query'],_0x49df1b['filters']));if(_0x4bc464[_0x6a48('0x46')]['filter']){_0x435f36[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x435f36['where'],{'$or':_[_0x6a48('0x34')](_0x435f36[_0x6a48('0x47')],function(_0x1c509f){var _0x37d388={};_0x37d388[_0x1c509f]={'$like':'%'+_0x4bc464['query'][_0x6a48('0x32')]+'%'};return _0x37d388;})});}_0x435f36=_[_0x6a48('0x5b')]({},_0x435f36,_0x4bc464[_0x6a48('0x5c')]);return _0x2214d7[_0x6a48('0x148')](_0x435f36);}})[_0x6a48('0x15')](function(_0x13506d){if(_0x13506d){_0x12a15d=_0x13506d['length'];if(!_0x4bc464[_0x6a48('0x46')][_0x6a48('0xd3')]('nolimit')){_0x435f36[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x4bc464['query'][_0x6a48('0x25')]);_0x435f36[_0x6a48('0x27')]=qs['offset'](_0x4bc464[_0x6a48('0x46')]['offset']);}return _0x2214d7[_0x6a48('0x148')](_0x435f36);}})[_0x6a48('0x15')](function(_0x3021b5){if(_0x3021b5){return _0x3021b5?{'count':_0x12a15d,'rows':_0x3021b5}:null;}})['then'](respondWithResult(_0x3ffeae,null))[_0x6a48('0x20')](handleError(_0x3ffeae,null));};exports[_0x6a48('0x14a')]=function(_0x3776df,_0x1beceb){return db[_0x6a48('0x3e')]['find']({'where':{'id':_0x3776df[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x1beceb,null))['then'](function(_0x140783){if(_0x140783){return _0x140783['addMailAccounts'](_0x3776df[_0x6a48('0x60')][_0x6a48('0x64')],_[_0x6a48('0x119')](_0x3776df[_0x6a48('0x60')],[_0x6a48('0x64'),'id'])||{});}})[_0x6a48('0x15')](respondWithResult(_0x1beceb,null))[_0x6a48('0x20')](handleError(_0x1beceb,null));};exports['removeMailAccounts']=function(_0x51025a,_0x2828c3){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x51025a['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x2828c3,null))[_0x6a48('0x15')](function(_0x11b8ac){if(_0x11b8ac){return _0x11b8ac[_0x6a48('0x14b')](_0x51025a['query'][_0x6a48('0x64')]);}})[_0x6a48('0x15')](respondWithStatusCode(_0x2828c3,null))[_0x6a48('0x20')](handleError(_0x2828c3,null));};exports[_0x6a48('0x14c')]=function(_0xabc558,_0x4f21b9){var _0x21a55b={};var _0x27f079={};var _0x22a75a;var _0x26e765;return db[_0x6a48('0x3e')]['findOne']({'where':{'id':_0xabc558[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x4f21b9,null))[_0x6a48('0x15')](function(_0x316e93){if(_0x316e93){_0x22a75a=_0x316e93;_0x27f079[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0x14d')][_0x6a48('0x3f')]);_0x27f079['query']=_[_0x6a48('0xcd')](_0xabc558[_0x6a48('0x46')]);_0x27f079['filters']=_[_0x6a48('0x57')](_0x27f079[_0x6a48('0x53')],_0x27f079[_0x6a48('0x46')]);_0x21a55b[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x27f079[_0x6a48('0x53')],qs['fields'](_0xabc558[_0x6a48('0x46')][_0x6a48('0x58')]));_0x21a55b[_0x6a48('0x47')]=_0x21a55b[_0x6a48('0x47')]['length']?_0x21a55b[_0x6a48('0x47')]:_0x27f079['model'];_0x21a55b[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0xabc558['query'][_0x6a48('0xd0')]);_0x21a55b[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0xabc558[_0x6a48('0x46')],_0x27f079[_0x6a48('0x56')]));if(_0xabc558[_0x6a48('0x46')]['filter']){_0x21a55b[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x21a55b[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x21a55b[_0x6a48('0x47')],function(_0x3c795f){var _0x52766b={};_0x52766b[_0x3c795f]={'$like':'%'+_0xabc558['query'][_0x6a48('0x32')]+'%'};return _0x52766b;})});}_0x21a55b=_['merge']({},_0x21a55b,_0xabc558[_0x6a48('0x5c')]);return _0x22a75a[_0x6a48('0x14c')](_0x21a55b);}})[_0x6a48('0x15')](function(_0x17144d){if(_0x17144d){_0x26e765=_0x17144d[_0x6a48('0x4b')];if(!_0xabc558[_0x6a48('0x46')][_0x6a48('0xd3')]('nolimit')){_0x21a55b[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0xabc558[_0x6a48('0x46')][_0x6a48('0x25')]);_0x21a55b[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0xabc558[_0x6a48('0x46')]['offset']);}return _0x22a75a[_0x6a48('0x14c')](_0x21a55b);}})['then'](function(_0x40661c){if(_0x40661c){return _0x40661c?{'count':_0x26e765,'rows':_0x40661c}:null;}})[_0x6a48('0x15')](respondWithResult(_0x4f21b9,null))['catch'](handleError(_0x4f21b9,null));};exports['addOpenchannelAccounts']=function(_0x27eba7,_0x579baa){return db[_0x6a48('0x3e')]['find']({'where':{'id':_0x27eba7[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x579baa,null))[_0x6a48('0x15')](function(_0x6c450c){if(_0x6c450c){return _0x6c450c['addOpenchannelAccounts'](_0x27eba7[_0x6a48('0x60')][_0x6a48('0x64')],_[_0x6a48('0x119')](_0x27eba7['body'],[_0x6a48('0x64'),'id'])||{});}})[_0x6a48('0x15')](respondWithResult(_0x579baa,null))['catch'](handleError(_0x579baa,null));};exports['removeOpenchannelAccounts']=function(_0x14d51f,_0xb9b419){return db['User']['find']({'where':{'id':_0x14d51f[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0xb9b419,null))[_0x6a48('0x15')](function(_0x23aefd){if(_0x23aefd){return _0x23aefd['removeOpenchannelAccounts'](_0x14d51f[_0x6a48('0x46')][_0x6a48('0x64')]);}})[_0x6a48('0x15')](respondWithStatusCode(_0xb9b419,null))[_0x6a48('0x20')](handleError(_0xb9b419,null));};exports[_0x6a48('0x14e')]=function(_0x3c53e5,_0x245359){var _0x9af76d={};var _0x241a16={};var _0x23e383;var _0x38ed79;return db[_0x6a48('0x3e')]['findOne']({'where':{'id':_0x3c53e5[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x245359,null))[_0x6a48('0x15')](function(_0x291d3c){if(_0x291d3c){_0x23e383=_0x291d3c;_0x241a16[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0x14f')][_0x6a48('0x3f')]);_0x241a16[_0x6a48('0x46')]=_['keys'](_0x3c53e5[_0x6a48('0x46')]);_0x241a16[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x241a16[_0x6a48('0x53')],_0x241a16[_0x6a48('0x46')]);_0x9af76d[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x241a16[_0x6a48('0x53')],qs['fields'](_0x3c53e5[_0x6a48('0x46')]['fields']));_0x9af76d['attributes']=_0x9af76d[_0x6a48('0x47')]['length']?_0x9af76d[_0x6a48('0x47')]:_0x241a16[_0x6a48('0x53')];_0x9af76d[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0x3c53e5[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x9af76d[_0x6a48('0x45')]=qs['filters'](_['pick'](_0x3c53e5[_0x6a48('0x46')],_0x241a16[_0x6a48('0x56')]));if(_0x3c53e5[_0x6a48('0x46')][_0x6a48('0x32')]){_0x9af76d[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x9af76d['where'],{'$or':_['map'](_0x9af76d[_0x6a48('0x47')],function(_0x23f47f){var _0x44cf00={};_0x44cf00[_0x23f47f]={'$like':'%'+_0x3c53e5[_0x6a48('0x46')][_0x6a48('0x32')]+'%'};return _0x44cf00;})});}_0x9af76d=_[_0x6a48('0x5b')]({},_0x9af76d,_0x3c53e5[_0x6a48('0x5c')]);return _0x23e383[_0x6a48('0x14e')](_0x9af76d);}})['then'](function(_0x217920){if(_0x217920){_0x38ed79=_0x217920[_0x6a48('0x4b')];if(!_0x3c53e5['query'][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x9af76d[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x3c53e5[_0x6a48('0x46')]['limit']);_0x9af76d[_0x6a48('0x27')]=qs['offset'](_0x3c53e5[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x23e383[_0x6a48('0x14e')](_0x9af76d);}})[_0x6a48('0x15')](function(_0x375cf2){if(_0x375cf2){return _0x375cf2?{'count':_0x38ed79,'rows':_0x375cf2}:null;}})[_0x6a48('0x15')](respondWithResult(_0x245359,null))[_0x6a48('0x20')](handleError(_0x245359,null));};exports[_0x6a48('0x150')]=function(_0x5002ad,_0x53485e){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x5002ad['params']['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x53485e,null))[_0x6a48('0x15')](function(_0xcd447f){if(_0xcd447f){return _0xcd447f[_0x6a48('0x150')](_0x5002ad[_0x6a48('0x60')]['ids'],_[_0x6a48('0x119')](_0x5002ad[_0x6a48('0x60')],['ids','id'])||{});}})[_0x6a48('0x15')](respondWithResult(_0x53485e,null))[_0x6a48('0x20')](handleError(_0x53485e,null));};exports[_0x6a48('0x151')]=function(_0x42f3b4,_0x23db0a){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x42f3b4[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x23db0a,null))[_0x6a48('0x15')](function(_0x43506c){if(_0x43506c){return _0x43506c['removeSmsAccounts'](_0x42f3b4['query']['ids']);}})[_0x6a48('0x15')](respondWithStatusCode(_0x23db0a,null))[_0x6a48('0x20')](handleError(_0x23db0a,null));};exports[_0x6a48('0x152')]=function(_0x5ea4a7,_0x4e0a4c){var _0x3a2d16={};var _0xc71d88={};var _0x24ff06;var _0x262f76;return db[_0x6a48('0x3e')][_0x6a48('0xcc')]({'where':{'id':_0x5ea4a7[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x4e0a4c,null))[_0x6a48('0x15')](function(_0x4f55f8){if(_0x4f55f8){_0x24ff06=_0x4f55f8;_0xc71d88[_0x6a48('0x53')]=_['keys'](db['ChatWebsite'][_0x6a48('0x3f')]);_0xc71d88[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x5ea4a7[_0x6a48('0x46')]);_0xc71d88[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0xc71d88[_0x6a48('0x53')],_0xc71d88[_0x6a48('0x46')]);_0x3a2d16['attributes']=_['intersection'](_0xc71d88[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x5ea4a7[_0x6a48('0x46')]['fields']));_0x3a2d16[_0x6a48('0x47')]=_0x3a2d16['attributes'][_0x6a48('0x4b')]?_0x3a2d16[_0x6a48('0x47')]:_0xc71d88['model'];_0x3a2d16[_0x6a48('0xcf')]=qs['sort'](_0x5ea4a7['query'][_0x6a48('0xd0')]);_0x3a2d16[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0x5ea4a7[_0x6a48('0x46')],_0xc71d88[_0x6a48('0x56')]));if(_0x5ea4a7[_0x6a48('0x46')]['filter']){_0x3a2d16[_0x6a48('0x45')]=_['merge'](_0x3a2d16['where'],{'$or':_[_0x6a48('0x34')](_0x3a2d16[_0x6a48('0x47')],function(_0x27a0be){var _0x1f1dc4={};_0x1f1dc4[_0x27a0be]={'$like':'%'+_0x5ea4a7[_0x6a48('0x46')][_0x6a48('0x32')]+'%'};return _0x1f1dc4;})});}_0x3a2d16=_[_0x6a48('0x5b')]({},_0x3a2d16,_0x5ea4a7[_0x6a48('0x5c')]);return _0x24ff06[_0x6a48('0x152')](_0x3a2d16);}})[_0x6a48('0x15')](function(_0x3a92bb){if(_0x3a92bb){_0x262f76=_0x3a92bb[_0x6a48('0x4b')];if(!_0x5ea4a7[_0x6a48('0x46')]['hasOwnProperty'](_0x6a48('0xd9'))){_0x3a2d16['limit']=qs[_0x6a48('0x25')](_0x5ea4a7['query'][_0x6a48('0x25')]);_0x3a2d16[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0x5ea4a7[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x24ff06[_0x6a48('0x152')](_0x3a2d16);}})[_0x6a48('0x15')](function(_0x2dd12d){if(_0x2dd12d){return _0x2dd12d?{'count':_0x262f76,'rows':_0x2dd12d}:null;}})['then'](respondWithResult(_0x4e0a4c,null))[_0x6a48('0x20')](handleError(_0x4e0a4c,null));};exports[_0x6a48('0x153')]=function(_0x402a1c,_0x402404){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x402a1c['params']['id']}})['then'](handleEntityNotFound(_0x402404,null))['then'](function(_0x365de2){if(_0x365de2){return _0x365de2['addChatWebsites'](_0x402a1c[_0x6a48('0x60')][_0x6a48('0x64')],_[_0x6a48('0x119')](_0x402a1c[_0x6a48('0x60')],[_0x6a48('0x64'),'id'])||{});}})['then'](respondWithResult(_0x402404,null))[_0x6a48('0x20')](handleError(_0x402404,null));};exports[_0x6a48('0x154')]=function(_0x2903ee,_0x3b4b62){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x2903ee[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x3b4b62,null))[_0x6a48('0x15')](function(_0x41f0d9){if(_0x41f0d9){return _0x41f0d9[_0x6a48('0x154')](_0x2903ee[_0x6a48('0x46')][_0x6a48('0x64')]);}})[_0x6a48('0x15')](respondWithStatusCode(_0x3b4b62,null))['catch'](handleError(_0x3b4b62,null));};exports[_0x6a48('0x155')]=function(_0x3f2d55,_0x296bfd){var _0x5cc1e={};var _0x97dd89={};var _0x29ecc9;var _0x2467c0;return db['User']['findOne']({'where':{'id':_0x3f2d55[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x296bfd,null))['then'](function(_0x39acb8){if(_0x39acb8){_0x29ecc9=_0x39acb8;_0x97dd89['model']=_[_0x6a48('0xcd')](db[_0x6a48('0x156')][_0x6a48('0x3f')]);_0x97dd89[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x3f2d55[_0x6a48('0x46')]);_0x97dd89[_0x6a48('0x56')]=_[_0x6a48('0x57')](_0x97dd89[_0x6a48('0x53')],_0x97dd89[_0x6a48('0x46')]);_0x5cc1e[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x97dd89[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x3f2d55[_0x6a48('0x46')][_0x6a48('0x58')]));_0x5cc1e['attributes']=_0x5cc1e[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x5cc1e[_0x6a48('0x47')]:_0x97dd89['model'];_0x5cc1e[_0x6a48('0xcf')]=qs['sort'](_0x3f2d55[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x5cc1e[_0x6a48('0x45')]=qs['filters'](_[_0x6a48('0xd1')](_0x3f2d55[_0x6a48('0x46')],_0x97dd89[_0x6a48('0x56')]));if(_0x3f2d55[_0x6a48('0x46')][_0x6a48('0x32')]){_0x5cc1e[_0x6a48('0x45')]=_[_0x6a48('0x5b')](_0x5cc1e['where'],{'$or':_['map'](_0x5cc1e['attributes'],function(_0x5b2404){var _0x3957ab={};_0x3957ab[_0x5b2404]={'$like':'%'+_0x3f2d55['query']['filter']+'%'};return _0x3957ab;})});}_0x5cc1e=_[_0x6a48('0x5b')]({},_0x5cc1e,_0x3f2d55[_0x6a48('0x5c')]);return _0x29ecc9[_0x6a48('0x155')](_0x5cc1e);}})[_0x6a48('0x15')](function(_0x4bc651){if(_0x4bc651){_0x2467c0=_0x4bc651[_0x6a48('0x4b')];if(!_0x3f2d55[_0x6a48('0x46')][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x5cc1e['limit']=qs[_0x6a48('0x25')](_0x3f2d55[_0x6a48('0x46')][_0x6a48('0x25')]);_0x5cc1e[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0x3f2d55[_0x6a48('0x46')][_0x6a48('0x27')]);}return _0x29ecc9['getWhatsappAccounts'](_0x5cc1e);}})[_0x6a48('0x15')](function(_0x4c5873){if(_0x4c5873){return _0x4c5873?{'count':_0x2467c0,'rows':_0x4c5873}:null;}})[_0x6a48('0x15')](respondWithResult(_0x296bfd,null))[_0x6a48('0x20')](handleError(_0x296bfd,null));};exports['addWhatsappAccounts']=function(_0x28a0d9,_0x5a2d81){return db[_0x6a48('0x3e')]['find']({'where':{'id':_0x28a0d9[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x5a2d81,null))[_0x6a48('0x15')](function(_0x5aacb6){if(_0x5aacb6){return _0x5aacb6[_0x6a48('0x157')](_0x28a0d9[_0x6a48('0x60')]['ids'],_[_0x6a48('0x119')](_0x28a0d9['body'],[_0x6a48('0x64'),'id'])||{});}})[_0x6a48('0x15')](respondWithResult(_0x5a2d81,null))[_0x6a48('0x20')](handleError(_0x5a2d81,null));};exports[_0x6a48('0x158')]=function(_0x47f3f0,_0x3785c1){return db[_0x6a48('0x3e')]['find']({'where':{'id':_0x47f3f0[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x3785c1,null))['then'](function(_0x2b9651){if(_0x2b9651){return _0x2b9651['removeWhatsappAccounts'](_0x47f3f0[_0x6a48('0x46')][_0x6a48('0x64')]);}})[_0x6a48('0x15')](respondWithStatusCode(_0x3785c1,null))[_0x6a48('0x20')](handleError(_0x3785c1,null));};exports[_0x6a48('0x159')]=function(_0x2ae327,_0x204548){var _0x22e543={};var _0x13b75f={};var _0x2d5340;var _0x4091e6;return db[_0x6a48('0x3e')]['findOne']({'where':{'id':_0x2ae327[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](handleEntityNotFound(_0x204548,null))[_0x6a48('0x15')](function(_0x25d771){if(_0x25d771){_0x2d5340=_0x25d771;_0x13b75f[_0x6a48('0x53')]=_[_0x6a48('0xcd')](db[_0x6a48('0x15a')][_0x6a48('0x3f')]);_0x13b75f[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0x2ae327[_0x6a48('0x46')]);_0x13b75f['filters']=_['intersection'](_0x13b75f[_0x6a48('0x53')],_0x13b75f['query']);_0x22e543[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x13b75f[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0x2ae327[_0x6a48('0x46')][_0x6a48('0x58')]));_0x22e543['attributes']=_0x22e543['attributes']['length']?_0x22e543[_0x6a48('0x47')]:_0x13b75f[_0x6a48('0x53')];_0x22e543['order']=qs[_0x6a48('0xd0')](_0x2ae327['query']['sort']);_0x22e543['where']=qs['filters'](_['pick'](_0x2ae327[_0x6a48('0x46')],_0x13b75f[_0x6a48('0x56')]));if(_0x2ae327['query'][_0x6a48('0x32')]){_0x22e543['where']=_[_0x6a48('0x5b')](_0x22e543[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x22e543['attributes'],function(_0xccab43){var _0x6c09b8={};_0x6c09b8[_0xccab43]={'$like':'%'+_0x2ae327[_0x6a48('0x46')][_0x6a48('0x32')]+'%'};return _0x6c09b8;})});}_0x22e543=_[_0x6a48('0x5b')]({},_0x22e543,_0x2ae327['options']);return _0x2d5340[_0x6a48('0x159')](_0x22e543);}})[_0x6a48('0x15')](function(_0x1f9787){if(_0x1f9787){_0x4091e6=_0x1f9787[_0x6a48('0x4b')];if(!_0x2ae327['query'][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x22e543[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x2ae327['query']['limit']);_0x22e543[_0x6a48('0x27')]=qs[_0x6a48('0x27')](_0x2ae327[_0x6a48('0x46')]['offset']);}return _0x2d5340[_0x6a48('0x159')](_0x22e543);}})['then'](function(_0x58ad84){if(_0x58ad84){return _0x58ad84?{'count':_0x4091e6,'rows':_0x58ad84}:null;}})[_0x6a48('0x15')](respondWithResult(_0x204548,null))[_0x6a48('0x20')](handleError(_0x204548,null));};exports[_0x6a48('0x15b')]=function(_0x228605,_0x388d0c){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x228605['params']['id']}})['then'](handleEntityNotFound(_0x388d0c,null))[_0x6a48('0x15')](function(_0x4220ae){if(_0x4220ae){return _0x4220ae[_0x6a48('0x15b')](_0x228605[_0x6a48('0x60')][_0x6a48('0x64')],_['omit'](_0x228605[_0x6a48('0x60')],[_0x6a48('0x64'),'id'])||{});}})[_0x6a48('0x15')](respondWithResult(_0x388d0c,null))[_0x6a48('0x20')](handleError(_0x388d0c,null));};exports[_0x6a48('0x15c')]=function(_0x4785ab,_0x3ba54c){return db['User']['find']({'where':{'id':_0x4785ab[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x3ba54c,null))['then'](function(_0x1f8a4d){if(_0x1f8a4d){return _0x1f8a4d['removeSquareProjects'](_0x4785ab[_0x6a48('0x46')][_0x6a48('0x64')]);}})['then'](respondWithStatusCode(_0x3ba54c,null))[_0x6a48('0x20')](handleError(_0x3ba54c,null));};exports[_0x6a48('0x15d')]=function(_0xbd968a,_0x12b4a3){var _0x58a196={},_0x288031={},_0x201039={'count':0x0,'rows':[]};var _0x206e01=db['CmHopper']['rawAttributes'];_0x288031['model']=_[_0x6a48('0xcd')](_0x206e01);_0x288031[_0x6a48('0x46')]=_[_0x6a48('0xcd')](_0xbd968a['query']);_0x288031['filters']=_[_0x6a48('0x57')](_0x288031['model'],_0x288031[_0x6a48('0x46')]);_0x288031[_0x6a48('0x56')]=_['concat'](_0x288031[_0x6a48('0x56')],[_0x6a48('0x15e'),_0x6a48('0x15f'),_0x6a48('0x160'),'$gte',_0x6a48('0x161'),_0x6a48('0x162'),_0x6a48('0x163'),_0x6a48('0x164'),_0x6a48('0x165'),_0x6a48('0x166'),_0x6a48('0x167'),_0x6a48('0x168'),_0x6a48('0x169'),_0x6a48('0x16a'),_0x6a48('0x16b'),_0x6a48('0x16c'),_0x6a48('0x16d'),_0x6a48('0x16a'),_0x6a48('0x16e'),_0x6a48('0x16f'),'$contained','$any']);_0x58a196[_0x6a48('0x47')]=_[_0x6a48('0x57')](_0x288031[_0x6a48('0x53')],qs[_0x6a48('0x58')](_0xbd968a[_0x6a48('0x46')][_0x6a48('0x58')]));_0x58a196['attributes']=_0x58a196[_0x6a48('0x47')][_0x6a48('0x4b')]?_0x58a196[_0x6a48('0x47')]:_0x288031[_0x6a48('0x53')];if(!_0xbd968a['query'][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x58a196[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0xbd968a[_0x6a48('0x46')][_0x6a48('0x25')]);_0x58a196[_0x6a48('0x27')]=qs['offset'](_0xbd968a[_0x6a48('0x46')][_0x6a48('0x27')]);}_0x58a196[_0x6a48('0xcf')]=qs[_0x6a48('0xd0')](_0xbd968a[_0x6a48('0x46')][_0x6a48('0xd0')]);_0x58a196[_0x6a48('0x45')]=qs[_0x6a48('0x56')](_[_0x6a48('0xd1')](_0xbd968a['query'],_0x288031[_0x6a48('0x56')]));if(_0xbd968a[_0x6a48('0x46')][_0x6a48('0x32')]){_0x58a196[_0x6a48('0x45')]=_['merge'](_0x58a196[_0x6a48('0x45')],{'$or':_[_0x6a48('0x34')](_0x58a196[_0x6a48('0x47')],function(_0x4974b3){var _0x494cfc={};_0x494cfc[_0x4974b3]={'$like':'%'+_0xbd968a[_0x6a48('0x46')][_0x6a48('0x32')]+'%'};return _0x494cfc;})});}_0x58a196[_0x6a48('0x45')]={'$and':[_0x58a196[_0x6a48('0x45')],{'$or':[{'UserId':_0xbd968a[_0x6a48('0x61')]['id']},{'OwnerId':_0xbd968a[_0x6a48('0x61')]['id']}]}]};_0x58a196=_[_0x6a48('0x5b')]({},_0x58a196,_0xbd968a[_0x6a48('0x5c')]);var _0x3f55f3={'where':_0x58a196[_0x6a48('0x45')]};return db['CmHopper'][_0x6a48('0x26')](_0x3f55f3)[_0x6a48('0x15')](function(_0x244211){_0x201039[_0x6a48('0x26')]=_0x244211;if(_0xbd968a['query'][_0x6a48('0x59')]){_0x58a196[_0x6a48('0x5a')]=[{'attributes':['id','firstName',_0x6a48('0x170'),_0x6a48('0x171')],'model':db[_0x6a48('0xce')],'as':_0x6a48('0x172')},{'attributes':['id',_0x6a48('0x3b'),'dialActive'],'model':db[_0x6a48('0xac')],'as':_0x6a48('0xdb')}];}return db[_0x6a48('0x173')][_0x6a48('0x8e')](_0x58a196);})[_0x6a48('0x15')](function(_0x5ae6b8){_0x201039[_0x6a48('0x49')]=_0x5ae6b8;return _0x201039;})[_0x6a48('0x15')](respondWithFilteredResult(_0x12b4a3,_0x58a196))[_0x6a48('0x20')](handleError(_0x12b4a3,null));};exports[_0x6a48('0x174')]=function(_0x49de28,_0x5c9af6){if(!_[_0x6a48('0x69')](_0x49de28[_0x6a48('0x2d')]['id'])&&(_0x49de28[_0x6a48('0x2d')][_0x6a48('0x37')]==_0x6a48('0x2b')||_0x49de28[_0x6a48('0x2d')][_0x6a48('0x37')]==_0x6a48('0x2d'))){return db['User'][_0x6a48('0xcc')]({'where':{'id':_0x49de28[_0x6a48('0x61')]['id']},'raw':!![]})[_0x6a48('0x15')](function(_0x5e1eae){return authService[_0x6a48('0x175')](_0x5e1eae);})['then'](function(_0xa72191){if(_0xa72191){return _0x5c9af6[_0x6a48('0x23')](0xc8)[_0x6a48('0x24')]({'api_key':_0xa72191[_0x6a48('0x176')]});}else{return _0x5c9af6['status'](0xcc)[_0x6a48('0x24')]({'message':_0x6a48('0x177')});}})[_0x6a48('0x20')](handleError(_0x5c9af6,0x193));}else{return _0x5c9af6['status'](0x191)[_0x6a48('0x24')]({'message':_0x6a48('0x178')});}};exports[_0x6a48('0x179')]=function(_0x116911,_0x1638a7){if(!_[_0x6a48('0x69')](_0x116911[_0x6a48('0x2d')]['id'])&&(_0x116911[_0x6a48('0x2d')]['role']=='admin'||_0x116911['user'][_0x6a48('0x37')]=='user')){return db[_0x6a48('0x3e')][_0x6a48('0x38')]({'where':{'id':_0x116911[_0x6a48('0x61')]['id']}})[_0x6a48('0x15')](function(_0x62b557){return authService[_0x6a48('0x17a')](_0x62b557);})[_0x6a48('0x15')](function(_0x1e6eae){return db['User'][_0x6a48('0x5f')]({'apiKeyIat':_0x1e6eae[_0x6a48('0x17b')],'apiKeyNonce':_0x1e6eae[_0x6a48('0x17c')]},{'where':{'id':_0x116911['params']['id']}})['then'](function(){return _0x1638a7[_0x6a48('0x23')](0xc8)['json']({'api_key':_0x1e6eae[_0x6a48('0x176')]});});})['catch'](handleError(_0x1638a7,0x193));}else{return _0x1638a7[_0x6a48('0x23')](0x191)[_0x6a48('0x24')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x6a48('0x17d')]=function(_0xe669c4,_0x59a4ee){if(!_[_0x6a48('0x69')](_0xe669c4[_0x6a48('0x2d')]['id'])&&(_0xe669c4[_0x6a48('0x2d')][_0x6a48('0x37')]=='admin'||_0xe669c4[_0x6a48('0x2d')][_0x6a48('0x37')]==_0x6a48('0x2d'))){return db[_0x6a48('0x3e')]['find']({'where':{'id':_0xe669c4[_0x6a48('0x61')]['id']}})['then'](handleEntityNotFound(_0x59a4ee,null))[_0x6a48('0x15')](function(_0x4b8a61){if(_0x4b8a61&&_0x4b8a61[_0x6a48('0x17e')]&&_0x4b8a61[_0x6a48('0x17f')])return _0x4b8a61;else throw{'message':_0x6a48('0x180')};})['then'](function(_0x386ea0){return db[_0x6a48('0x3e')][_0x6a48('0x5f')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0xe669c4[_0x6a48('0x61')]['id']}});})[_0x6a48('0x15')](respondWithStatusCode(_0x59a4ee,0xc8))[_0x6a48('0x20')](handleError(_0x59a4ee,0x193));}else{return _0x59a4ee[_0x6a48('0x23')](0x191)[_0x6a48('0x24')]({'message':_0x6a48('0x178')});}};exports['whoami']=function(_0x5c6fb7,_0x4001b2){var _0x3456d5=_0x5c6fb7[_0x6a48('0x2d')][_0x6a48('0xad')]({'plain':!![]});if(!_0x3456d5){return _0x4001b2[_0x6a48('0x23')](0x191)[_0x6a48('0x3c')](_0x6a48('0x181'));}else{return _0x4001b2[_0x6a48('0x23')](0xc8)['json'](_0x3456d5);}};exports[_0x6a48('0x182')]=function(_0x434443,_0x2e7365){var _0x368352={'offset':0x0},_0x2e1be2={'count':0x0,'rows':[]};Promise[_0x6a48('0x183')]()['then'](function(){if(!_0x434443[_0x6a48('0x46')][_0x6a48('0x32')]&&!_0x434443[_0x6a48('0x46')][_0x6a48('0x184')]&&!_0x434443[_0x6a48('0x46')][_0x6a48('0x185')])return[];return Promise['resolve']()[_0x6a48('0x15')](function(){var _0x36d47e=[];if(!_[_0x6a48('0x8f')](_0x434443[_0x6a48('0x46')][_0x6a48('0x184')])){_0x36d47e[_0x6a48('0x48')](db[_0x6a48('0x117')]['findAll']({'attributes':['id',_0x6a48('0x3b')],'where':{'id':_0x434443[_0x6a48('0x46')][_0x6a48('0x184')]}}));}if(!_[_0x6a48('0x8f')](_0x434443[_0x6a48('0x46')][_0x6a48('0x185')])){_0x36d47e[_0x6a48('0x48')](db['VoiceQueue']['findAll']({'attributes':['id',_0x6a48('0x3b')],'type':_0x6a48('0x186'),'where':{'id':_0x434443['query'][_0x6a48('0x185')]}}));}return Promise['all'](_0x36d47e);})[_0x6a48('0x15')](function(_0x3ed2bf){var _0x472e0b=_[_0x6a48('0x123')](_0x3ed2bf)[_0x6a48('0x34')](function(_0x3c9008){return _0x3c9008[_0x6a48('0x12e')]({'attributes':['id',_0x6a48('0x3b'),'internal',_0x6a48('0xa1')],'raw':!![]});});return Promise['all'](_0x472e0b);})[_0x6a48('0x15')](function(_0x1f8fc6){var _0x259948=_[_0x6a48('0x123')](_0x1f8fc6);if(!_0x434443[_0x6a48('0x46')][_0x6a48('0x32')])return _0x259948;if(_[_0x6a48('0x8f')](_0x259948)){return db[_0x6a48('0x3e')][_0x6a48('0x8e')]({'attributes':['id','name',_0x6a48('0x65'),_0x6a48('0xa1')],'where':{'role':_0x6a48('0x2f'),'$or':[db['sequelize']['where'](db[_0x6a48('0x6b')]['fn'](_0x6a48('0x187'),db[_0x6a48('0x6b')][_0x6a48('0x188')](_0x6a48('0x3b'))),{'$like':'%'+_0x434443[_0x6a48('0x46')][_0x6a48('0x32')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x434443['query'][_0x6a48('0x32')]+'%'}}]},'raw':!![]});}else{return _(_0x259948)[_0x6a48('0x123')]()[_0x6a48('0x32')](function(_0x898eca){return _0x898eca[_0x6a48('0x3b')]['toLowerCase']()['includes'](_0x434443[_0x6a48('0x46')]['filter'][_0x6a48('0xa6')]())||_0x898eca[_0x6a48('0x65')][_0x6a48('0x189')]()[_0x6a48('0x36')](_0x434443['query'][_0x6a48('0x32')]);})[_0x6a48('0x35')]();}})[_0x6a48('0x15')](function(_0x20400e){var _0x82498e='name';var _0x429b63=_0x6a48('0x18a');if(_0x434443['query'][_0x6a48('0xd0')]){var _0x429b63=_0x434443[_0x6a48('0x46')][_0x6a48('0xd0')][0x0]==='-'?'desc':_0x6a48('0x18a');var _0x82498e=_0x429b63===_0x6a48('0x18a')?_0x434443['query']['sort']:_0x434443['query'][_0x6a48('0xd0')][_0x6a48('0x18b')](0x1);}return _(_0x20400e)[_0x6a48('0x18c')]('id')[_0x6a48('0x18d')]([function(_0x2ac429){return _0x82498e===_0x6a48('0x3b')?_0x2ac429[_0x82498e][_0x6a48('0xa6')]():_0x2ac429[_0x82498e];}],[_0x429b63])['map'](function(_0x2c571d){return _[_0x6a48('0xd1')](_0x2c571d,['id','name',_0x6a48('0x65'),'online']);})[_0x6a48('0x35')]();})['then'](function(_0x53105c){return client[_0x6a48('0x14')](_0x6a48('0x2e'),_0x434443)[_0x6a48('0x15')](function(_0x2120be){if(_0x2120be['error'])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x34f521=_0x2120be[_0x6a48('0x1f')];var _0x21ae9e=jayson[_0x6a48('0x18e')][_0x6a48('0x13')]({'port':0x232c});return _0x21ae9e['request'](_0x6a48('0x2e'),_0x434443)[_0x6a48('0x15')](function(_0x36894b){if(_0x36894b[_0x6a48('0x1c')])throw new Error(_0x6a48('0x18f'));var _0x23a672=_0x36894b[_0x6a48('0x1f')];return _['merge']({},_0x23a672,_0x34f521);});})['then'](function(_0x1a1a02){return _[_0x6a48('0x34')](_0x53105c,function(_0x722cd7){var _0x5727b7=_[_0x6a48('0x38')](_0x1a1a02[_0x6a48('0x49')],['id',_0x722cd7['id']]);if(!_0x5727b7||!_0x722cd7[_0x6a48('0xa1')]){_0x722cd7['status']=_0x6a48('0x190');}else if(_0x5727b7[_0x6a48('0xa2')]){_0x722cd7[_0x6a48('0x23')]='pause';}else{_0x722cd7[_0x6a48('0x23')]=_[_0x6a48('0x36')]([_0x6a48('0x191'),'unknown','unavailable',_0x6a48('0x192'),null,undefined],_0x5727b7[_0x6a48('0x193')])?_0x6a48('0xa1'):_0x6a48('0x194');}return _0x722cd7;});});});})[_0x6a48('0x15')](function(_0x5de43b){if(!_0x434443['query'][_0x6a48('0xd3')](_0x6a48('0xd9'))){_0x368352[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x434443[_0x6a48('0x46')][_0x6a48('0x25')]||0xa);_0x368352['offset']=qs[_0x6a48('0x27')](_0x434443[_0x6a48('0x46')]['offset']);}_0x2e1be2[_0x6a48('0x26')]=_0x5de43b['length'];_0x2e1be2[_0x6a48('0x49')]=_0x368352[_0x6a48('0x25')]?_0x5de43b['slice'](_0x368352[_0x6a48('0x27')],_0x368352[_0x6a48('0x27')]+_0x368352[_0x6a48('0x25')]):_0x5de43b;return _0x2e1be2;})['then'](respondWithFilteredResult(_0x2e7365,_0x368352))[_0x6a48('0x20')](handleError(_0x2e7365,null));};function get_open_tabs(_0x3c6d8b,_0x3a689e){var _0xf379dd=_0x3c6d8b[_0x6a48('0x195')](0x0)['toUpperCase']()+_0x3c6d8b[_0x6a48('0x196')](0x1);var _0x26fd04={'type':db[_0x6a48('0x94')][_0x6a48('0x6d')]['SELECT'],'raw':!![]};return new BPromise(function(_0x3a08b6,_0x1440d7){var _0x55803f=squel[_0x6a48('0x197')]()[_0x6a48('0x198')](_0x6a48('0x199')+_0xf379dd+_0x6a48('0x19a'),'id')['field'](_0x6a48('0x19b'))[_0x6a48('0x6f')]('user_has_'+_0x3c6d8b+_0x6a48('0x19c'),'ui')[_0x6a48('0x45')](_0x6a48('0x19d'),_0x3a689e['id']);return db['sequelize'][_0x6a48('0x46')](_0x55803f['toString'](),_0x26fd04)[_0x6a48('0x15')](function(_0x5eb24f){_0x3a689e[_0xf379dd+_0x6a48('0x19e')]=_0x5eb24f;_0x3a08b6(_0x5eb24f);})['catch'](function(_0x41c49a){_0x1440d7(_0x41c49a);});});};
\ No newline at end of file
index 54b7e6b..05e3153 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc460=['User','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1acf70,_0x534d29){var _0x46904b=function(_0x539869){while(--_0x539869){_0x1acf70['push'](_0x1acf70['shift']());}};_0x46904b(++_0x534d29);}(_0xc460,0x127));var _0x0c46=function(_0x544dc7,_0x1929b0){_0x544dc7=_0x544dc7-0x0;var _0x365534=_0xc460[_0x544dc7];return _0x365534;};'use strict';var EventEmitter=require(_0x0c46('0x0'));var User=require(_0x0c46('0x1'))['db'][_0x0c46('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x0c46('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0c46('0x4')};function emitEvent(_0x30503c){return function(_0x125f39,_0x5b8abd,_0x1e25f5){UserEvents[_0x0c46('0x5')](_0x30503c+':'+_0x125f39['id'],_0x125f39);UserEvents[_0x0c46('0x5')](_0x30503c,_0x125f39);_0x1e25f5(null);};}for(var e in events){if(events[_0x0c46('0x6')](e)){var event=events[e];User[_0x0c46('0x7')](e,emitEvent(event));}}module[_0x0c46('0x8')]=UserEvents;
\ No newline at end of file
+var _0x7f46=['update','emit','hook','exports','events','User','save'];(function(_0x31e5a4,_0x559fa1){var _0x1518ce=function(_0x448860){while(--_0x448860){_0x31e5a4['push'](_0x31e5a4['shift']());}};_0x1518ce(++_0x559fa1);}(_0x7f46,0x131));var _0x67f4=function(_0x465f75,_0x4b9141){_0x465f75=_0x465f75-0x0;var _0x53f44a=_0x7f46[_0x465f75];return _0x53f44a;};'use strict';var EventEmitter=require(_0x67f4('0x0'));var User=require('../../mysqldb')['db'][_0x67f4('0x1')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x67f4('0x2'),'afterUpdate':_0x67f4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2824a4){return function(_0x27d1d1,_0x28a808,_0x266ad9){UserEvents[_0x67f4('0x4')](_0x2824a4+':'+_0x27d1d1['id'],_0x27d1d1);UserEvents[_0x67f4('0x4')](_0x2824a4,_0x27d1d1);_0x266ad9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0x67f4('0x5')](e,emitEvent(event));}}module[_0x67f4('0x6')]=UserEvents;
\ No newline at end of file
index 247fd45..db34f01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc1a=['indexOf','provider','Invalid\x20password','makeSalt','encryptPassword','md5secret',':asterisk:','crypto','util','lodash','./user.attributes','google','length','from-sip','system','prefix','Set','format','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','merge','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','wav','gsm','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','name','Hangup','defaults','VoiceChanSpy','findAll','internal','concat','catch','exports','models','define','User','users','utf8','utf8_bin','userProfileId','resolve','UserProfile','find','then','privacyEnabled','updateMd5Password','updatePassword','changed','VoiceExtension','bulkCreate','destroy','extensionMonitor','function','randomBytes','salt','base64','sha1','pbkdf2','toString'];(function(_0x3fd9d7,_0x4e3578){var _0x2916de=function(_0x1e9d55){while(--_0x1e9d55){_0x3fd9d7['push'](_0x3fd9d7['shift']());}};_0x2916de(++_0x4e3578);}(_0xbc1a,0x1c9));var _0xabc1=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xbc1a[_0x432fca];return _0x3adba4;};'use strict';var BPromise=require('bluebird');var crypto=require(_0xabc1('0x0'));var util=require(_0xabc1('0x1'));var md5=require('md5');var _=require(_0xabc1('0x2'));var attributes=require(_0xabc1('0x3'));var authTypes=[_0xabc1('0x4')];var validatePresenceOf=function(_0x42ec88){return _0x42ec88&&_0x42ec88[_0xabc1('0x5')];};var getChanSpyApplications=function(_0x573bb7,_0x24908d,_0x43200b){var _0x28eca5={'context':_0x573bb7['context']||_0xabc1('0x6'),'type':_0xabc1('0x7'),'isApp':![],'UserId':_0x573bb7['id']};var _0x2fa668=[];for(var _0x567910=0x0,_0xd1bdf8=0x1;_0x567910<_0x43200b[_0xabc1('0x5')];_0x567910++,_0xd1bdf8=0x1){var _0x89d754={'exten':util['format']('%s%s',_0x43200b[_0x567910][_0xabc1('0x8')],_0x24908d),'ChanSpyId':_0x43200b[_0x567910]['id']};_0x2fa668['push'](_['merge']({'app':_0xabc1('0x9'),'appdata':util[_0xabc1('0xa')](_0xabc1('0xb'),_0xabc1('0xc')),'priority':_0xd1bdf8++},_0x28eca5,_0x89d754));if(_0x43200b[_0x567910][_0xabc1('0xd')]){_0x2fa668[_0xabc1('0xe')](_['merge']({'app':_0xabc1('0xf'),'appdata':util[_0xabc1('0xa')](_0xabc1('0x10'),_0x43200b[_0x567910][_0xabc1('0x11')]),'priority':_0xd1bdf8++},_0x28eca5,_0x89d754));}if(_0x43200b[_0x567910][_0xabc1('0x12')]){_0x2fa668[_0xabc1('0xe')](_[_0xabc1('0x13')]({'app':'Authenticate','appdata':_0x43200b[_0x567910][_0xabc1('0x14')],'priority':_0xd1bdf8++},_0x28eca5,_0x89d754));}_0x2fa668['push'](_[_0xabc1('0x13')]({'app':_0xabc1('0x15'),'appdata':util[_0xabc1('0xa')](_0xabc1('0x16'),_0x573bb7['name'],_0x43200b[_0x567910][_0xabc1('0x17')]?_0x43200b[_0x567910][_0xabc1('0x17')][_0xabc1('0x18')](''):''),'priority':_0xd1bdf8++},_0x28eca5,_0x89d754));if(_0x43200b[_0x567910][_0xabc1('0xd')]){_0x2fa668[_0xabc1('0xe')](_[_0xabc1('0x13')]({'app':_0xabc1('0x19'),'priority':_0xd1bdf8++},_0x28eca5,_0x89d754));}}return _0x2fa668;};var getUserApplications=function(_0x290ad6,_0x1c6726){var _0xc4b0d6=[_0xabc1('0x1a'),'WAV',_0xabc1('0x1b')];var _0x174dd9={'context':_0x290ad6['context']||_0xabc1('0x6'),'exten':_0x1c6726,'type':_0xabc1('0x7'),'isApp':![],'UserId':_0x290ad6['id']};var _0x1dd3f4=[{'app':_0xabc1('0x9'),'appdata':'CDR(type)=internal'}];if(_0x290ad6['extensionMonitor']&&_[_0xabc1('0x1c')](_0xc4b0d6,_0x290ad6['extensionMonitor'])){_0x1dd3f4[_0xabc1('0xe')]({'app':_0xabc1('0x9'),'appdata':_0xabc1('0x1d')});_0x1dd3f4[_0xabc1('0xe')]({'app':'Set','appdata':util[_0xabc1('0xa')](_0xabc1('0x1e'),_0x290ad6['extensionMonitor'])});_0x1dd3f4[_0xabc1('0xe')]({'app':_0xabc1('0x1f'),'appdata':util[_0xabc1('0xa')](_0xabc1('0x20'),_0x290ad6[_0xabc1('0x21')])});}else{_0x1dd3f4[_0xabc1('0xe')]({'app':_0xabc1('0x1f'),'appdata':util[_0xabc1('0xa')]('SIP/%s,,tTxX',_0x290ad6[_0xabc1('0x21')])});}_0x1dd3f4['push']({'app':_0xabc1('0x22')});for(var _0x1ef456=0x0;_0x1ef456<_0x1dd3f4[_0xabc1('0x5')];_0x1ef456++){_0x1dd3f4[_0x1ef456]['priority']=_0x1ef456+0x1;_0x1dd3f4[_0x1ef456]=_[_0xabc1('0x23')](_0x1dd3f4[_0x1ef456],_0x174dd9);}return _0x1dd3f4;};var getChanSpyPromise=function(_0x9b0b8a,_0x596c79){return new BPromise(function(_0x4f7ff1,_0x25ae1e){return _0x9b0b8a[_0xabc1('0x24')][_0xabc1('0x25')]()['then'](function(_0xa3c103){if(_0xa3c103){var _0x947099=getChanSpyApplications(_0x596c79,_0x596c79[_0xabc1('0x26')],_0xa3c103);if(_0x596c79['internal']!=_0x596c79[_0xabc1('0x21')]){_0x947099=_0x947099[_0xabc1('0x27')](getChanSpyApplications(_0x596c79,_0x596c79[_0xabc1('0x21')],_0xa3c103));}return _0x4f7ff1(_0x947099);}return _0x4f7ff1([]);})[_0xabc1('0x28')](function(_0x399317){_0x25ae1e(_0x399317);});});};module[_0xabc1('0x29')]=function(_0x3ebdc2,_0x3771bd){var _0x16db2b=_0x3ebdc2[_0xabc1('0x2a')];return _0x3ebdc2[_0xabc1('0x2b')](_0xabc1('0x2c'),attributes,{'tableName':_0xabc1('0x2d'),'charset':_0xabc1('0x2e'),'collate':_0xabc1('0x2f'),'hooks':{'beforeCreate':function(_0x1a0b9a,_0x440dd5,_0x3209f2){var _0xf1c3e1=typeof _0x1a0b9a[_0xabc1('0x30')]==='undefined'?BPromise[_0xabc1('0x31')](null):_0x16db2b[_0xabc1('0x32')][_0xabc1('0x33')]({'where':{'id':_0x1a0b9a[_0xabc1('0x30')]}});_0xf1c3e1[_0xabc1('0x34')](function(_0x1c7a60){if(_0x1c7a60){_0x1a0b9a[_0xabc1('0x35')]=_0x1c7a60[_0xabc1('0x35')];}})[_0xabc1('0x34')](function(){_0x1a0b9a[_0xabc1('0x36')]();_0x1a0b9a[_0xabc1('0x37')](_0x3209f2);})[_0xabc1('0x28')](function(_0x1528f8){_0x3209f2(_0x1528f8);});},'beforeUpdate':function(_0x4521b4,_0x40b477,_0x1eb6bf){Promise[_0xabc1('0x31')]()['then'](function(){if(_0x4521b4['changed']('userProfileId')===![])return;return _0x16db2b['UserProfile'][_0xabc1('0x33')]({'where':{'id':_0x4521b4[_0xabc1('0x30')]}})[_0xabc1('0x34')](function(_0x2b450a){if(_0x2b450a)_0x4521b4[_0xabc1('0x35')]=_0x2b450a[_0xabc1('0x35')];return;});})[_0xabc1('0x34')](function(){if(_0x4521b4[_0xabc1('0x38')]('password')){_0x4521b4[_0xabc1('0x36')]();return _0x4521b4['updatePassword'](_0x1eb6bf);}_0x1eb6bf();})['catch'](function(_0x28d19d){_0x1eb6bf(_0x28d19d);});},'afterCreate':function(_0xef6ba3,_0x26da24,_0x5c2877){var _0x292be2=getUserApplications(_0xef6ba3,_0xef6ba3[_0xabc1('0x26')]);if(_0xef6ba3[_0xabc1('0x26')]!=_0xef6ba3[_0xabc1('0x21')]){_0x292be2=_0x292be2[_0xabc1('0x27')](getUserApplications(_0xef6ba3,_0xef6ba3[_0xabc1('0x21')]));}return _0x16db2b[_0xabc1('0x39')][_0xabc1('0x3a')](_0x292be2)['then'](function(){if(_0xef6ba3[_0xabc1('0xc')]){return getChanSpyPromise(_0x16db2b,_0xef6ba3);}})[_0xabc1('0x34')](function(_0xec40e9){if(_0xec40e9&&_0xec40e9[_0xabc1('0x5')]){return _0x16db2b[_0xabc1('0x39')][_0xabc1('0x3a')](_0xec40e9);}})[_0xabc1('0x34')](function(){_0x5c2877();})['catch'](function(_0xd0f7f4){_0x5c2877(_0xd0f7f4);});},'afterUpdate':function(_0x2b6866,_0x374c3e,_0x4dbbae){return BPromise[_0xabc1('0x31')]()[_0xabc1('0x34')](function(){if(_0x2b6866[_0xabc1('0x38')]('chanspy')||_0x2b6866[_0xabc1('0x38')]('context')){return _0x16db2b[_0xabc1('0x39')][_0xabc1('0x3b')]({'where':{'UserId':_0x2b6866['id'],'type':_0xabc1('0x7'),'ChanSpyId':{'$ne':null}}})[_0xabc1('0x34')](function(){if(_0x2b6866['chanspy']){return getChanSpyPromise(_0x16db2b,_0x2b6866)[_0xabc1('0x34')](function(_0xaac207){if(_0xaac207&&_0xaac207[_0xabc1('0x5')]){return _0x16db2b[_0xabc1('0x39')][_0xabc1('0x3a')](_0xaac207);}});}});}})['then'](function(){if(_0x2b6866[_0xabc1('0x38')](_0xabc1('0x3c'))||_0x2b6866[_0xabc1('0x38')]('context')){return _0x16db2b[_0xabc1('0x39')]['destroy']({'where':{'UserId':_0x2b6866['id'],'type':_0xabc1('0x7'),'ChanSpyId':null}})[_0xabc1('0x34')](function(){var _0xf11c73=getUserApplications(_0x2b6866,_0x2b6866[_0xabc1('0x26')]);if(_0x2b6866[_0xabc1('0x26')]!=_0x2b6866[_0xabc1('0x21')]){_0xf11c73=_0xf11c73['concat'](getUserApplications(_0x2b6866,_0x2b6866[_0xabc1('0x21')]));}return _0x16db2b[_0xabc1('0x39')][_0xabc1('0x3a')](_0xf11c73);});}})[_0xabc1('0x34')](function(){_0x4dbbae();})[_0xabc1('0x28')](function(_0xbfe71a){_0x4dbbae(_0xbfe71a);});},'afterDestroy':function(_0xc1736a,_0x132350){return _0x16db2b['VoiceExtension']['destroy']({'where':{'UserId':_0xc1736a['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0xa72a0f,_0x11bb46){if(!_0x11bb46){return this[_0xabc1('0x14')]===this['encryptPassword'](_0xa72a0f);}var _0x447967=this;this['encryptPassword'](_0xa72a0f,function(_0x1d88bc,_0x3fefac){if(_0x1d88bc){_0x11bb46(_0x1d88bc);}if(_0x447967[_0xabc1('0x14')]===_0x3fefac){_0x11bb46(null,!![]);}else{_0x11bb46(null,![]);}});},'makeSalt':function(_0x289ac6,_0x3145f2){var _0x74902c=0x10;if(typeof arguments[0x0]===_0xabc1('0x3d')){_0x3145f2=arguments[0x0];_0x289ac6=_0x74902c;}else if(typeof arguments[0x1]===_0xabc1('0x3d')){_0x3145f2=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x289ac6){_0x289ac6=_0x74902c;}return crypto[_0xabc1('0x3e')](_0x289ac6,function(_0x2bf1c9,_0x3693c8){if(_0x2bf1c9){_0x3145f2(_0x2bf1c9);}return _0x3145f2(null,_0x3693c8['toString']('base64'));});},'encryptPassword':function(_0x415f5a,_0x119c0b){if(!_0x415f5a||!this['salt']){return _0x119c0b?_0x119c0b(null):null;}var _0x420c29=0x2710;var _0x498421=0x40;var _0x23ae97=new Buffer(this[_0xabc1('0x3f')],_0xabc1('0x40'));if(!_0x119c0b){return crypto['pbkdf2Sync'](_0x415f5a,_0x23ae97,_0x420c29,_0x498421,_0xabc1('0x41'))['toString'](_0xabc1('0x40'));}return crypto[_0xabc1('0x42')](_0x415f5a,_0x23ae97,_0x420c29,_0x498421,_0xabc1('0x41'),function(_0xf48b47,_0x1cc221){if(_0xf48b47){_0x119c0b(_0xf48b47);}return _0x119c0b(null,_0x1cc221[_0xabc1('0x43')](_0xabc1('0x40')));});},'updatePassword':function(_0x5c42df){if(!this[_0xabc1('0x14')]){return _0x5c42df(null);}if(!validatePresenceOf(this[_0xabc1('0x14')])&&authTypes[_0xabc1('0x44')](this[_0xabc1('0x45')])===-0x1){_0x5c42df(new Error(_0xabc1('0x46')));}var _0x4c2bd0=this;this[_0xabc1('0x47')](function(_0x17a757,_0x12875c){if(_0x17a757){return _0x5c42df(_0x17a757);}_0x4c2bd0[_0xabc1('0x3f')]=_0x12875c;_0x4c2bd0[_0xabc1('0x48')](_0x4c2bd0[_0xabc1('0x14')],function(_0x419dc0,_0x5e0e0e){if(_0x419dc0){_0x5c42df(_0x419dc0);}_0x4c2bd0[_0xabc1('0x14')]=_0x5e0e0e;_0x5c42df(null);});});},'updateMd5Password':function(){this[_0xabc1('0x49')]=md5(this[_0xabc1('0x21')]+_0xabc1('0x4a')+this[_0xabc1('0x14')]);return this[_0xabc1('0x49')];}}});};
\ No newline at end of file
+var _0x721a=['%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','options','join','WAV','gsm','context','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','name','priority','defaults','VoiceChanSpy','findAll','then','internal','catch','exports','User','utf8','utf8_bin','userProfileId','undefined','resolve','UserProfile','updateMd5Password','changed','find','privacyEnabled','updatePassword','VoiceExtension','bulkCreate','destroy','concat','encryptPassword','function','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','md5secret',':asterisk:','crypto','util','lodash','./user.attributes','google','from-sip','system','length'];(function(_0x237e33,_0x2213f6){var _0x5e6c79=function(_0x28e312){while(--_0x28e312){_0x237e33['push'](_0x237e33['shift']());}};_0x5e6c79(++_0x2213f6);}(_0x721a,0xd6));var _0xa721=function(_0x5c925a,_0xf62a21){_0x5c925a=_0x5c925a-0x0;var _0x382efd=_0x721a[_0x5c925a];return _0x382efd;};'use strict';var BPromise=require('bluebird');var crypto=require(_0xa721('0x0'));var util=require(_0xa721('0x1'));var md5=require('md5');var _=require(_0xa721('0x2'));var attributes=require(_0xa721('0x3'));var authTypes=[_0xa721('0x4')];var validatePresenceOf=function(_0x392cb0){return _0x392cb0&&_0x392cb0['length'];};var getChanSpyApplications=function(_0x2a5c95,_0x2b2875,_0x4fbdea){var _0x21c7ff={'context':_0x2a5c95['context']||_0xa721('0x5'),'type':_0xa721('0x6'),'isApp':![],'UserId':_0x2a5c95['id']};var _0x37cbfc=[];for(var _0x132954=0x0,_0x1c45b3=0x1;_0x132954<_0x4fbdea[_0xa721('0x7')];_0x132954++,_0x1c45b3=0x1){var _0x4fcf71={'exten':util['format'](_0xa721('0x8'),_0x4fbdea[_0x132954][_0xa721('0x9')],_0x2b2875),'ChanSpyId':_0x4fbdea[_0x132954]['id']};_0x37cbfc[_0xa721('0xa')](_[_0xa721('0xb')]({'app':_0xa721('0xc'),'appdata':util[_0xa721('0xd')](_0xa721('0xe'),_0xa721('0xf')),'priority':_0x1c45b3++},_0x21c7ff,_0x4fcf71));if(_0x4fbdea[_0x132954][_0xa721('0x10')]){_0x37cbfc[_0xa721('0xa')](_[_0xa721('0xb')]({'app':_0xa721('0x11'),'appdata':util[_0xa721('0xd')](_0xa721('0x12'),_0x4fbdea[_0x132954][_0xa721('0x13')]),'priority':_0x1c45b3++},_0x21c7ff,_0x4fcf71));}if(_0x4fbdea[_0x132954][_0xa721('0x14')]){_0x37cbfc[_0xa721('0xa')](_[_0xa721('0xb')]({'app':_0xa721('0x15'),'appdata':_0x4fbdea[_0x132954][_0xa721('0x16')],'priority':_0x1c45b3++},_0x21c7ff,_0x4fcf71));}_0x37cbfc[_0xa721('0xa')](_[_0xa721('0xb')]({'app':_0xa721('0x17'),'appdata':util[_0xa721('0xd')]('SIP/%s,%s',_0x2a5c95['name'],_0x4fbdea[_0x132954][_0xa721('0x18')]?_0x4fbdea[_0x132954][_0xa721('0x18')][_0xa721('0x19')](''):''),'priority':_0x1c45b3++},_0x21c7ff,_0x4fcf71));if(_0x4fbdea[_0x132954]['record']){_0x37cbfc[_0xa721('0xa')](_[_0xa721('0xb')]({'app':'StopMixMonitor','priority':_0x1c45b3++},_0x21c7ff,_0x4fcf71));}}return _0x37cbfc;};var getUserApplications=function(_0x120e19,_0x528d3b){var _0x288317=['wav',_0xa721('0x1a'),_0xa721('0x1b')];var _0x287696={'context':_0x120e19[_0xa721('0x1c')]||'from-sip','exten':_0x528d3b,'type':'system','isApp':![],'UserId':_0x120e19['id']};var _0x24e09a=[{'app':_0xa721('0xc'),'appdata':_0xa721('0x1d')}];if(_0x120e19[_0xa721('0x1e')]&&_['includes'](_0x288317,_0x120e19[_0xa721('0x1e')])){_0x24e09a[_0xa721('0xa')]({'app':'Set','appdata':_0xa721('0x1f')});_0x24e09a[_0xa721('0xa')]({'app':_0xa721('0xc'),'appdata':util[_0xa721('0xd')](_0xa721('0x20'),_0x120e19[_0xa721('0x1e')])});_0x24e09a[_0xa721('0xa')]({'app':_0xa721('0x21'),'appdata':util[_0xa721('0xd')](_0xa721('0x22'),_0x120e19['name'])});}else{_0x24e09a['push']({'app':'Dial','appdata':util[_0xa721('0xd')](_0xa721('0x23'),_0x120e19[_0xa721('0x24')])});}_0x24e09a[_0xa721('0xa')]({'app':'Hangup'});for(var _0x5dd804=0x0;_0x5dd804<_0x24e09a[_0xa721('0x7')];_0x5dd804++){_0x24e09a[_0x5dd804][_0xa721('0x25')]=_0x5dd804+0x1;_0x24e09a[_0x5dd804]=_[_0xa721('0x26')](_0x24e09a[_0x5dd804],_0x287696);}return _0x24e09a;};var getChanSpyPromise=function(_0x2b020e,_0x282c80){return new BPromise(function(_0x4b47f7,_0x191db5){return _0x2b020e[_0xa721('0x27')][_0xa721('0x28')]()[_0xa721('0x29')](function(_0x12784f){if(_0x12784f){var _0x2cac40=getChanSpyApplications(_0x282c80,_0x282c80[_0xa721('0x2a')],_0x12784f);if(_0x282c80['internal']!=_0x282c80[_0xa721('0x24')]){_0x2cac40=_0x2cac40['concat'](getChanSpyApplications(_0x282c80,_0x282c80['name'],_0x12784f));}return _0x4b47f7(_0x2cac40);}return _0x4b47f7([]);})[_0xa721('0x2b')](function(_0x1fb291){_0x191db5(_0x1fb291);});});};module[_0xa721('0x2c')]=function(_0x276427,_0xe65f4){var _0x510144=_0x276427['models'];return _0x276427['define'](_0xa721('0x2d'),attributes,{'tableName':'users','charset':_0xa721('0x2e'),'collate':_0xa721('0x2f'),'hooks':{'beforeCreate':function(_0x389be6,_0xb66ec8,_0xb64d21){var _0x41255d=typeof _0x389be6[_0xa721('0x30')]===_0xa721('0x31')?BPromise[_0xa721('0x32')](null):_0x510144[_0xa721('0x33')]['find']({'where':{'id':_0x389be6[_0xa721('0x30')]}});_0x41255d[_0xa721('0x29')](function(_0x2a757f){if(_0x2a757f){_0x389be6['privacyEnabled']=_0x2a757f['privacyEnabled'];}})['then'](function(){_0x389be6[_0xa721('0x34')]();_0x389be6['updatePassword'](_0xb64d21);})[_0xa721('0x2b')](function(_0x83f1dc){_0xb64d21(_0x83f1dc);});},'beforeUpdate':function(_0x2fa2d0,_0x7586c3,_0x4b4d09){Promise[_0xa721('0x32')]()[_0xa721('0x29')](function(){if(_0x2fa2d0[_0xa721('0x35')](_0xa721('0x30'))===![])return;return _0x510144['UserProfile'][_0xa721('0x36')]({'where':{'id':_0x2fa2d0['userProfileId']}})[_0xa721('0x29')](function(_0x26094b){if(_0x26094b)_0x2fa2d0[_0xa721('0x37')]=_0x26094b['privacyEnabled'];return;});})[_0xa721('0x29')](function(){if(_0x2fa2d0[_0xa721('0x35')]('password')){_0x2fa2d0[_0xa721('0x34')]();return _0x2fa2d0[_0xa721('0x38')](_0x4b4d09);}_0x4b4d09();})[_0xa721('0x2b')](function(_0x5c2d36){_0x4b4d09(_0x5c2d36);});},'afterCreate':function(_0x539e91,_0x4afd0f,_0x9a5c9e){var _0x36454c=getUserApplications(_0x539e91,_0x539e91[_0xa721('0x2a')]);if(_0x539e91[_0xa721('0x2a')]!=_0x539e91[_0xa721('0x24')]){_0x36454c=_0x36454c['concat'](getUserApplications(_0x539e91,_0x539e91[_0xa721('0x24')]));}return _0x510144[_0xa721('0x39')][_0xa721('0x3a')](_0x36454c)['then'](function(){if(_0x539e91[_0xa721('0xf')]){return getChanSpyPromise(_0x510144,_0x539e91);}})[_0xa721('0x29')](function(_0x1c36b2){if(_0x1c36b2&&_0x1c36b2[_0xa721('0x7')]){return _0x510144[_0xa721('0x39')][_0xa721('0x3a')](_0x1c36b2);}})[_0xa721('0x29')](function(){_0x9a5c9e();})['catch'](function(_0x129ba5){_0x9a5c9e(_0x129ba5);});},'afterUpdate':function(_0x5034e4,_0x54a9a6,_0x304cca){return BPromise[_0xa721('0x32')]()[_0xa721('0x29')](function(){if(_0x5034e4[_0xa721('0x35')](_0xa721('0xf'))||_0x5034e4[_0xa721('0x35')](_0xa721('0x1c'))){return _0x510144['VoiceExtension'][_0xa721('0x3b')]({'where':{'UserId':_0x5034e4['id'],'type':'system','ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x5034e4[_0xa721('0xf')]){return getChanSpyPromise(_0x510144,_0x5034e4)[_0xa721('0x29')](function(_0x24bf9c){if(_0x24bf9c&&_0x24bf9c[_0xa721('0x7')]){return _0x510144[_0xa721('0x39')][_0xa721('0x3a')](_0x24bf9c);}});}});}})[_0xa721('0x29')](function(){if(_0x5034e4[_0xa721('0x35')](_0xa721('0x1e'))||_0x5034e4[_0xa721('0x35')](_0xa721('0x1c'))){return _0x510144[_0xa721('0x39')][_0xa721('0x3b')]({'where':{'UserId':_0x5034e4['id'],'type':'system','ChanSpyId':null}})[_0xa721('0x29')](function(){var _0x312320=getUserApplications(_0x5034e4,_0x5034e4[_0xa721('0x2a')]);if(_0x5034e4['internal']!=_0x5034e4[_0xa721('0x24')]){_0x312320=_0x312320[_0xa721('0x3c')](getUserApplications(_0x5034e4,_0x5034e4[_0xa721('0x24')]));}return _0x510144[_0xa721('0x39')][_0xa721('0x3a')](_0x312320);});}})['then'](function(){_0x304cca();})[_0xa721('0x2b')](function(_0x39d072){_0x304cca(_0x39d072);});},'afterDestroy':function(_0x4b0130,_0x43af98){return _0x510144['VoiceExtension'][_0xa721('0x3b')]({'where':{'UserId':_0x4b0130['id'],'type':_0xa721('0x6')}});}},'instanceMethods':{'authenticate':function(_0x37c36d,_0xa5d504){if(!_0xa5d504){return this[_0xa721('0x16')]===this[_0xa721('0x3d')](_0x37c36d);}var _0x461502=this;this[_0xa721('0x3d')](_0x37c36d,function(_0x4a1d33,_0x3a0069){if(_0x4a1d33){_0xa5d504(_0x4a1d33);}if(_0x461502[_0xa721('0x16')]===_0x3a0069){_0xa5d504(null,!![]);}else{_0xa5d504(null,![]);}});},'makeSalt':function(_0x4e97b9,_0x323545){var _0x318dc5=0x10;if(typeof arguments[0x0]===_0xa721('0x3e')){_0x323545=arguments[0x0];_0x4e97b9=_0x318dc5;}else if(typeof arguments[0x1]===_0xa721('0x3e')){_0x323545=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x4e97b9){_0x4e97b9=_0x318dc5;}return crypto[_0xa721('0x3f')](_0x4e97b9,function(_0x373d5f,_0x3af63a){if(_0x373d5f){_0x323545(_0x373d5f);}return _0x323545(null,_0x3af63a[_0xa721('0x40')](_0xa721('0x41')));});},'encryptPassword':function(_0x4b504d,_0x40d024){if(!_0x4b504d||!this[_0xa721('0x42')]){return _0x40d024?_0x40d024(null):null;}var _0x36c460=0x2710;var _0x264219=0x40;var _0x1ccfc3=new Buffer(this[_0xa721('0x42')],'base64');if(!_0x40d024){return crypto[_0xa721('0x43')](_0x4b504d,_0x1ccfc3,_0x36c460,_0x264219,_0xa721('0x44'))[_0xa721('0x40')](_0xa721('0x41'));}return crypto[_0xa721('0x45')](_0x4b504d,_0x1ccfc3,_0x36c460,_0x264219,_0xa721('0x44'),function(_0x293e71,_0x57742e){if(_0x293e71){_0x40d024(_0x293e71);}return _0x40d024(null,_0x57742e[_0xa721('0x40')](_0xa721('0x41')));});},'updatePassword':function(_0x495d48){if(!this[_0xa721('0x16')]){return _0x495d48(null);}if(!validatePresenceOf(this[_0xa721('0x16')])&&authTypes[_0xa721('0x46')](this[_0xa721('0x47')])===-0x1){_0x495d48(new Error('Invalid\x20password'));}var _0x376d57=this;this['makeSalt'](function(_0x50c542,_0x3db51d){if(_0x50c542){return _0x495d48(_0x50c542);}_0x376d57[_0xa721('0x42')]=_0x3db51d;_0x376d57['encryptPassword'](_0x376d57[_0xa721('0x16')],function(_0x5d95d9,_0xa8057e){if(_0x5d95d9){_0x495d48(_0x5d95d9);}_0x376d57[_0xa721('0x16')]=_0xa8057e;_0x495d48(null);});});},'updateMd5Password':function(){this[_0xa721('0x48')]=md5(this[_0xa721('0x24')]+_0xa721('0x49')+this[_0xa721('0x16')]);return this[_0xa721('0x48')];}}});};
\ No newline at end of file
index 24a06be..fd448a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8537=['push','isNil','format','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','type','internal','uniqueid','UnpauseUser','channel','isValidChannel','Unknown\x20channel','MemberReport','mail','chat','fax','sms','openchannel','whatsapp','set','system','all','LogoutUser','findOne','destroy','LoginUser','mobile','phone','loginInPause','interface','count','agent','getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','bulkCreate','concat','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetUser','User','findAll','options','raw','attributes','limit','include','model','map','stringify','ShowUser','find','PauseUser','where','name','role','UserVoiceQueueRt','update','PAUSE','length','updateAttributes','getChannels','forEach'];(function(_0x49b91c,_0x1f506c){var _0x288925=function(_0x2d221f){while(--_0x2d221f){_0x49b91c['push'](_0x49b91c['shift']());}};_0x288925(++_0x1f506c);}(_0x8537,0x8a));var _0x7853=function(_0x431b4f,_0xe76916){_0x431b4f=_0x431b4f-0x0;var _0x5445d2=_0x8537[_0x431b4f];return _0x5445d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7853('0x0'));var BPromise=require(_0x7853('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7853('0x2'));var db=require(_0x7853('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7853('0x4'))(_0x7853('0x5'));var config=require(_0x7853('0x6'));var jayson=require(_0x7853('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x7853('0x8')]=_[_0x7853('0x9')](config[_0x7853('0x8')],{'host':_0x7853('0xa'),'port':0x18eb});var socket=require(_0x7853('0xb'))(new Redis(config[_0x7853('0x8')]));require(_0x7853('0xc'))[_0x7853('0xd')](socket);function respondWithRpcPromise(_0xa7697e,_0x12e310,_0x4c21fb){return new BPromise(function(_0x371ddd,_0x178592){return client[_0x7853('0xe')](_0xa7697e,_0x4c21fb)[_0x7853('0xf')](function(_0x45607b){logger[_0x7853('0x10')](_0x7853('0x11'),_0x12e310,'request\x20sent');logger[_0x7853('0x12')](_0x7853('0x13'),_0x12e310,_0x7853('0x14'),JSON['stringify'](_0x45607b));if(_0x45607b['error']){if(_0x45607b[_0x7853('0x15')][_0x7853('0x16')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x12e310,_0x45607b[_0x7853('0x15')][_0x7853('0x17')]);return _0x178592(_0x45607b[_0x7853('0x15')][_0x7853('0x17')]);}logger['error'](_0x7853('0x11'),_0x12e310,_0x45607b['error']['message']);return _0x371ddd(_0x45607b[_0x7853('0x15')][_0x7853('0x17')]);}else{logger[_0x7853('0x10')](_0x7853('0x11'),_0x12e310,'request\x20sent');_0x371ddd(_0x45607b[_0x7853('0x18')]['message']);}})[_0x7853('0x19')](function(_0x4af7ea){logger[_0x7853('0x15')]('User,\x20%s,\x20%s',_0x12e310,_0x4af7ea);_0x178592(_0x4af7ea);});});}exports[_0x7853('0x1a')]=function(_0x260a8e){var _0x22b53c=this;return new Promise(function(_0x40ad7f,_0x211675){return db[_0x7853('0x1b')][_0x7853('0x1c')]({'raw':_0x260a8e[_0x7853('0x1d')]?_0x260a8e[_0x7853('0x1d')][_0x7853('0x1e')]===undefined?!![]:![]:!![],'where':_0x260a8e[_0x7853('0x1d')]?_0x260a8e[_0x7853('0x1d')]['where']||null:null,'attributes':_0x260a8e[_0x7853('0x1d')]?_0x260a8e[_0x7853('0x1d')][_0x7853('0x1f')]||null:null,'limit':_0x260a8e[_0x7853('0x1d')]?_0x260a8e[_0x7853('0x1d')][_0x7853('0x20')]||null:null,'include':_0x260a8e['options']?_0x260a8e[_0x7853('0x1d')]['include']?_['map'](_0x260a8e['options'][_0x7853('0x21')],function(_0x2aaadf){return{'model':db[_0x2aaadf['model']],'as':_0x2aaadf['as'],'attributes':_0x2aaadf[_0x7853('0x1f')],'include':_0x2aaadf[_0x7853('0x21')]?_['map'](_0x2aaadf['include'],function(_0xef63f4){return{'model':db[_0xef63f4[_0x7853('0x22')]],'as':_0xef63f4['as'],'attributes':_0xef63f4['attributes'],'include':_0xef63f4[_0x7853('0x21')]?_[_0x7853('0x23')](_0xef63f4[_0x7853('0x21')],function(_0x40889a){return{'model':db[_0x40889a['model']],'as':_0x40889a['as'],'attributes':_0x40889a[_0x7853('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7853('0xf')](function(_0x1775e4){logger[_0x7853('0x10')](_0x7853('0x1a'),_0x260a8e);logger[_0x7853('0x12')]('GetUser',_0x260a8e,JSON[_0x7853('0x24')](_0x1775e4));_0x40ad7f(_0x1775e4);})[_0x7853('0x19')](function(_0x4a7a21){logger[_0x7853('0x15')](_0x7853('0x1a'),_0x4a7a21[_0x7853('0x17')],_0x260a8e);_0x211675(_0x22b53c[_0x7853('0x15')](0x1f4,_0x4a7a21[_0x7853('0x17')]));});});};exports[_0x7853('0x25')]=function(_0x2b0aae){var _0xa7b320=this;return new Promise(function(_0x2a8e14,_0x4584a6){return db[_0x7853('0x1b')][_0x7853('0x26')]({'raw':_0x2b0aae[_0x7853('0x1d')]?_0x2b0aae['options'][_0x7853('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b0aae[_0x7853('0x1d')]?_0x2b0aae['options']['where']||null:null,'attributes':_0x2b0aae[_0x7853('0x1d')]?_0x2b0aae[_0x7853('0x1d')]['attributes']||null:null,'include':_0x2b0aae[_0x7853('0x1d')]?_0x2b0aae[_0x7853('0x1d')][_0x7853('0x21')]?_[_0x7853('0x23')](_0x2b0aae[_0x7853('0x1d')][_0x7853('0x21')],function(_0xd92b25){return{'model':db[_0xd92b25[_0x7853('0x22')]],'as':_0xd92b25['as'],'attributes':_0xd92b25['attributes'],'include':_0xd92b25['include']?_[_0x7853('0x23')](_0xd92b25['include'],function(_0x5e731d){return{'model':db[_0x5e731d[_0x7853('0x22')]],'as':_0x5e731d['as'],'attributes':_0x5e731d['attributes'],'include':_0x5e731d[_0x7853('0x21')]?_['map'](_0x5e731d[_0x7853('0x21')],function(_0x141f73){return{'model':db[_0x141f73['model']],'as':_0x141f73['as'],'attributes':_0x141f73[_0x7853('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7853('0xf')](function(_0x3001b6){logger[_0x7853('0x10')](_0x7853('0x25'),_0x2b0aae);logger[_0x7853('0x12')](_0x7853('0x25'),_0x2b0aae,JSON[_0x7853('0x24')](_0x3001b6));_0x2a8e14(_0x3001b6);})[_0x7853('0x19')](function(_0x5abd38){logger['error'](_0x7853('0x25'),_0x5abd38[_0x7853('0x17')],_0x2b0aae);_0x4584a6(_0xa7b320[_0x7853('0x15')](0x1f4,_0x5abd38[_0x7853('0x17')]));});});};exports[_0x7853('0x27')]=function(_0x4be957){var _0x3499d4=this;return new Promise(function(_0xbded3f,_0x34065e){var _0x3bd3c9;return db['User'][_0x7853('0x26')]({'where':_0x4be957[_0x7853('0x1d')][_0x7853('0x28')]||{},'attributes':['id',_0x7853('0x29'),_0x7853('0x2a'),'internal','interface']})[_0x7853('0xf')](function(_0x24f373){if(_0x24f373){_0x3bd3c9=_0x24f373;return db[_0x7853('0x2b')][_0x7853('0x2c')]({'paused':0x1},{'where':{'UserId':_0x3bd3c9['id']},'individualHooks':!![]});}})[_0x7853('0xf')](function(){if(_0x3bd3c9){return db['MemberReport']['findAll']({'where':{'membername':_0x3bd3c9[_0x7853('0x29')],'type':_0x7853('0x2d'),'exitAt':null}});}})[_0x7853('0xf')](function(_0x24ca38){if(_0x3bd3c9){if(_0x24ca38&&_0x24ca38[_0x7853('0x2e')]){var _0x44b418=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0xd30d2=0x0,_0xa6921=_0x24ca38[_0x7853('0x2e')];_0xd30d2<_0xa6921;_0xd30d2++){_0x24ca38[_0xd30d2][_0x7853('0x2f')]({'exitAt':_0x44b418});}}}})[_0x7853('0xf')](function(){if(_0x3bd3c9){var _0x211722=[];var _0x3bb9fa=utils[_0x7853('0x30')]();_0x3bb9fa[_0x7853('0x31')](function(_0x2f8d81){_0x211722[_0x7853('0x32')]({'channel':_0x2f8d81,'membername':_0x3bd3c9['name'],'interface':_[_0x7853('0x33')](_0x3bd3c9['interface'])?util[_0x7853('0x34')](_0x7853('0x35'),_0x3bd3c9['name']):_0x3bd3c9['interface'],'type':_0x7853('0x2d'),'enterAt':moment()[_0x7853('0x34')](_0x7853('0x36')),'data1':_0x4be957[_0x7853('0x37')][_0x7853('0x38')]||'DEFAULT\x20PAUSE','role':_0x3bd3c9[_0x7853('0x2a')],'internal':_0x3bd3c9[_0x7853('0x39')],'uniqueid':_0x4be957[_0x7853('0x37')][_0x7853('0x3a')]||null});});return db['MemberReport']['bulkCreate'](_0x211722,{'individualHooks':!![]});}})['then'](function(){if(_0x3bd3c9){return _0x3bd3c9[_0x7853('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4be957['body'][_0x7853('0x38')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x7853('0x34')](_0x7853('0x36'))});}})[_0x7853('0xf')](function(_0x2c70cf){_0xbded3f(_0x2c70cf);})[_0x7853('0x19')](function(_0x1963a8){_0x34065e(_0x3499d4[_0x7853('0x15')](0x1f4,_0x1963a8['message']));});});};exports[_0x7853('0x3b')]=function(_0x590236){var _0xcac454=this;return new Promise(function(_0xae836f,_0x361c41){var _0x53e707;return db[_0x7853('0x1b')]['findOne']({'where':_0x590236[_0x7853('0x1d')]['where']||{},'attributes':['id',_0x7853('0x29')]})[_0x7853('0xf')](function(_0x2e155c){if(_0x2e155c){_0x53e707=_0x2e155c;if(_0x590236['body'][_0x7853('0x3c')]&&!utils[_0x7853('0x3d')](_0x590236[_0x7853('0x37')][_0x7853('0x3c')])){throw new Error(_0x7853('0x3e'));}switch(_0x590236[_0x7853('0x37')]['channel']){case'voice':return db[_0x7853('0x2b')][_0x7853('0x2c')]({'paused':0x0},{'where':{'UserId':_0x53e707['id']}})[_0x7853('0xf')](function(){return db[_0x7853('0x3f')][_0x7853('0x26')]({'where':{'channel':_0x590236[_0x7853('0x37')][_0x7853('0x3c')],'membername':_0x53e707['name'],'type':_0x7853('0x2d'),'exitAt':null}});})[_0x7853('0xf')](function(_0x334eb2){if(_0x334eb2){return _0x334eb2[_0x7853('0x2c')]({'exitAt':moment()[_0x7853('0x34')](_0x7853('0x36')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x7853('0xf')](function(){return _0x53e707[_0x7853('0x2c')]({'voicePause':![]});});case _0x7853('0x40'):case _0x7853('0x41'):case _0x7853('0x42'):case _0x7853('0x43'):case _0x7853('0x44'):case _0x7853('0x45'):return db['MemberReport']['find']({'where':{'channel':_0x590236[_0x7853('0x37')][_0x7853('0x3c')],'membername':_0x53e707[_0x7853('0x29')],'type':_0x7853('0x2d'),'exitAt':null}})[_0x7853('0xf')](function(_0x1dec3a){return _0x1dec3a[_0x7853('0x2c')]({'exitAt':moment()[_0x7853('0x34')](_0x7853('0x36')),'data2':'system'},{'individualHooks':!![]});})[_0x7853('0xf')](function(){var _0x817826={};_[_0x7853('0x46')](_0x817826,util[_0x7853('0x34')]('%s%s',_0x590236[_0x7853('0x37')]['channel'],'Pause'),![]);return _0x53e707['update'](_0x817826);});default:return db[_0x7853('0x2b')][_0x7853('0x2c')]({'paused':0x0},{'where':{'UserId':_0x53e707['id']}})[_0x7853('0xf')](function(){return db[_0x7853('0x3f')]['findAll']({'where':{'membername':_0x53e707[_0x7853('0x29')],'type':_0x7853('0x2d'),'exitAt':null}});})[_0x7853('0xf')](function(_0x1dc2f5){var _0x5c0788=[];_0x1dc2f5[_0x7853('0x31')](function(_0x175cb1){_0x5c0788[_0x7853('0x32')](_0x175cb1['update']({'exitAt':moment()['format'](_0x7853('0x36')),'data2':_0x7853('0x47')}));});return BPromise[_0x7853('0x48')](_0x5c0788);})[_0x7853('0xf')](function(){return _0x53e707[_0x7853('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x7853('0xf')](function(_0x21a4e3){_0xae836f(_0x21a4e3);})[_0x7853('0x19')](function(_0x1a5288){_0x361c41(_0xcac454[_0x7853('0x15')](0x1f4,_0x1a5288['message']));});});};exports[_0x7853('0x49')]=function(_0x2b5af9){var _0x3a038c=this;return new Promise(function(_0x4188ea,_0x876c1e){var _0x422bb0;return db[_0x7853('0x1b')][_0x7853('0x4a')]({'where':_0x2b5af9[_0x7853('0x1d')][_0x7853('0x28')]||{},'attributes':['id','name']})[_0x7853('0xf')](function(_0x39b8c0){if(_0x39b8c0){_0x422bb0=_0x39b8c0;return db['UserVoiceQueueRt'][_0x7853('0x4b')]({'where':{'membername':_0x422bb0[_0x7853('0x29')]},'individualHooks':!![]});}})[_0x7853('0xf')](function(){if(_0x422bb0){return db[_0x7853('0x3f')]['findAll']({'where':{'membername':_0x422bb0['name'],'exitAt':null}});}})[_0x7853('0xf')](function(_0x19d817){if(_0x422bb0){if(_0x19d817&&_0x19d817['length']){var _0xb689ec=[];_0x19d817[_0x7853('0x31')](function(_0x2c7ac9){_0xb689ec[_0x7853('0x32')](_0x2c7ac9[_0x7853('0x2c')]({'exitAt':moment()['format'](_0x7853('0x36'))}));});return BPromise['all'](_0xb689ec);}}})[_0x7853('0xf')](function(){if(_0x422bb0){return _0x422bb0[_0x7853('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x7853('0xf')](function(_0x2c09eb){_0x4188ea(_0x2c09eb);})[_0x7853('0x19')](function(_0x24a789){_0x876c1e(_0x3a038c[_0x7853('0x15')](0x1f4,_0x24a789[_0x7853('0x17')]));});});};exports[_0x7853('0x4c')]=function(_0x35a754){var _0x26b860=this;return new Promise(function(_0xc53acf,_0x38b314){var _0x3641db;var _0x5b5515;var _0x4fadd9;var _0x32f1d3;return db[_0x7853('0x1b')][_0x7853('0x4a')]({'where':_0x35a754[_0x7853('0x1d')]['where']||{},'attributes':['id',_0x7853('0x29'),_0x7853('0x2a'),_0x7853('0x4d'),_0x7853('0x4e'),'internal',_0x7853('0x4f'),_0x7853('0x50')]})[_0x7853('0xf')](function(_0x23226a){if(_0x23226a){_0x3641db=_0x23226a;_0x32f1d3=_0x35a754[_0x7853('0x37')][_0x7853('0x50')]?_0x35a754[_0x7853('0x37')][_0x7853('0x50')]:util[_0x7853('0x34')](_0x7853('0x35'),_0x3641db[_0x7853('0x29')]);return db[_0x7853('0x1b')][_0x7853('0x51')]({'where':{'role':_0x7853('0x52'),'online':!![],'id':{'$ne':_0x3641db['id']}}});}})[_0x7853('0xf')](function(_0x1357b1){if(_0x1357b1){_0x4fadd9=_0x1357b1;return require('../../config/license/util')[_0x7853('0x53')]();}})[_0x7853('0xf')](function(_0x2ff1f6){if(_0x2ff1f6&&_0x2ff1f6['agents']&&_0x4fadd9>=_0x2ff1f6[_0x7853('0x54')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x3641db){return db[_0x7853('0x2b')][_0x7853('0x4b')]({'where':{'membername':_0x3641db[_0x7853('0x29')]},'individualHooks':!![]});}})[_0x7853('0xf')](function(){if(_0x3641db){return _0x3641db[_0x7853('0x55')]({'raw':!![]});}})[_0x7853('0xf')](function(_0x327d10){if(_0x3641db){if(_0x327d10){var _0x135a9d=[];_0x5b5515=_0x327d10;if(_0x5b5515[_0x7853('0x2e')]){for(var _0x4bceda=0x0;_0x4bceda<_0x5b5515[_0x7853('0x2e')];_0x4bceda++){_0x135a9d[_0x7853('0x32')](db[_0x7853('0x2b')][_0x7853('0x56')]({'membername':_0x3641db[_0x7853('0x29')],'UserId':_0x3641db['id'],'queue_name':_0x5b5515[_0x4bceda][_0x7853('0x29')],'VoiceQueueId':_0x5b5515[_0x4bceda]['id'],'interface':_0x32f1d3,'paused':_0x3641db[_0x7853('0x4f')]||![],'penalty':_0x5b5515[_0x4bceda][_0x7853('0x57')]||0x0}));}return BPromise['all'](_0x135a9d);}}}})['then'](function(){if(_0x3641db){return db['MemberReport']['findAll']({'where':{'membername':_0x3641db[_0x7853('0x29')],'exitAt':null}});}})['then'](function(_0x35a31b){if(_0x3641db){if(_0x35a31b&&_0x35a31b[_0x7853('0x2e')]){var _0x578683=[];_0x35a31b['forEach'](function(_0x43066d){_0x578683[_0x7853('0x32')](_0x43066d[_0x7853('0x2c')]({'exitAt':moment()[_0x7853('0x34')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7853('0x48')](_0x578683);}}})[_0x7853('0xf')](function(_0x1f6cd1){if(_0x3641db){var _0x354d7d=[];var _0xaac7a3=[];var _0x38d6f3=utils['getChannels']();var _0x1e1fbf={'membername':_0x3641db[_0x7853('0x29')],'interface':_0x32f1d3,'enterAt':moment()[_0x7853('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3641db[_0x7853('0x2a')],'internal':_0x3641db[_0x7853('0x39')]};_0x38d6f3[_0x7853('0x31')](function(_0x5db835){_0x354d7d[_0x7853('0x32')](_[_0x7853('0x58')]({'channel':_0x5db835,'type':_0x7853('0x59'),'data1':_0x7853('0x5a'),'data2':_0x32f1d3},_0x1e1fbf));if(_0x3641db[_0x7853('0x4f')]){_0xaac7a3[_0x7853('0x32')](_['merge']({'channel':_0x5db835,'type':_0x7853('0x2d'),'data1':_0x7853('0x5b')},_0x1e1fbf));}});return db[_0x7853('0x3f')][_0x7853('0x5c')](_0x354d7d[_0x7853('0x5d')](_0xaac7a3),{'individualHooks':!![]});}})['then'](function(){if(_0x3641db){return _0x3641db[_0x7853('0x2c')]({'online':!![],'lastLoginAt':moment()['format'](_0x7853('0x36')),'voicePause':_0x3641db[_0x7853('0x4f')]||![],'mailPause':_0x3641db[_0x7853('0x4f')]||![],'chatPause':_0x3641db[_0x7853('0x4f')]||![],'faxPause':_0x3641db[_0x7853('0x4f')]||![],'smsPause':_0x3641db[_0x7853('0x4f')]||![],'openchannelPause':_0x3641db[_0x7853('0x4f')]||![],'pauseType':_0x3641db[_0x7853('0x4f')]?_0x7853('0x5b'):null,'lastPauseAt':moment()[_0x7853('0x34')](_0x7853('0x36')),'interface':_0x32f1d3});}})[_0x7853('0xf')](function(_0xa1721){_0xc53acf(_0xa1721);})[_0x7853('0x19')](function(_0x373fec){_0x38b314(_0x26b860[_0x7853('0x15')](0x1f4,_0x373fec[_0x7853('0x17')]));});});};
\ No newline at end of file
+var _0x5a47=['updateAttributes','forEach','push','isNil','format','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','UnpauseUser','findOne','channel','voice','system','chat','fax','sms','openchannel','%s%s','Pause','destroy','all','LoginUser','mobile','phone','loginInPause','SIP/%s','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','getChannels','merge','LOGIN','LOGININPAUSE','concat','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','request','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','GetUser','User','findAll','raw','options','attributes','limit','include','model','map','then','ShowUser','find','PauseUser','where','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4c27b4,_0x393655){var _0x1dbaeb=function(_0x189322){while(--_0x189322){_0x4c27b4['push'](_0x4c27b4['shift']());}};_0x1dbaeb(++_0x393655);}(_0x5a47,0x7f));var _0x75a4=function(_0x195917,_0xd15888){_0x195917=_0x195917-0x0;var _0x408c62=_0x5a47[_0x195917];return _0x408c62;};'use strict';var _=require('lodash');var util=require(_0x75a4('0x0'));var moment=require(_0x75a4('0x1'));var BPromise=require(_0x75a4('0x2'));var rs=require(_0x75a4('0x3'));var fs=require('fs');var Redis=require(_0x75a4('0x4'));var db=require(_0x75a4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x75a4('0x6'))(_0x75a4('0x7'));var config=require(_0x75a4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x75a4('0x9')][_0x75a4('0xa')]({'port':0x232a});config[_0x75a4('0xb')]=_[_0x75a4('0xc')](config[_0x75a4('0xb')],{'host':_0x75a4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x75a4('0xb')]));require('./user.socket')['register'](socket);function respondWithRpcPromise(_0x43f657,_0x2e2e4f,_0x22316c){return new BPromise(function(_0x4348ea,_0x1dc408){return client[_0x75a4('0xe')](_0x43f657,_0x22316c)['then'](function(_0x1da582){logger[_0x75a4('0xf')](_0x75a4('0x10'),_0x2e2e4f,'request\x20sent');logger[_0x75a4('0x11')](_0x75a4('0x12'),_0x2e2e4f,'request\x20sent',JSON[_0x75a4('0x13')](_0x1da582));if(_0x1da582[_0x75a4('0x14')]){if(_0x1da582[_0x75a4('0x14')]['code']===0x1f4){logger[_0x75a4('0x14')](_0x75a4('0x10'),_0x2e2e4f,_0x1da582[_0x75a4('0x14')]['message']);return _0x1dc408(_0x1da582[_0x75a4('0x14')][_0x75a4('0x15')]);}logger[_0x75a4('0x14')]('User,\x20%s,\x20%s',_0x2e2e4f,_0x1da582[_0x75a4('0x14')]['message']);return _0x4348ea(_0x1da582[_0x75a4('0x14')][_0x75a4('0x15')]);}else{logger[_0x75a4('0xf')](_0x75a4('0x10'),_0x2e2e4f,_0x75a4('0x16'));_0x4348ea(_0x1da582['result'][_0x75a4('0x15')]);}})[_0x75a4('0x17')](function(_0x267358){logger[_0x75a4('0x14')](_0x75a4('0x10'),_0x2e2e4f,_0x267358);_0x1dc408(_0x267358);});});}exports[_0x75a4('0x18')]=function(_0x3d66d5){var _0x825ac4=this;return new Promise(function(_0x2c1a37,_0x4a265a){return db[_0x75a4('0x19')][_0x75a4('0x1a')]({'raw':_0x3d66d5['options']?_0x3d66d5['options'][_0x75a4('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d66d5[_0x75a4('0x1c')]?_0x3d66d5[_0x75a4('0x1c')]['where']||null:null,'attributes':_0x3d66d5[_0x75a4('0x1c')]?_0x3d66d5[_0x75a4('0x1c')][_0x75a4('0x1d')]||null:null,'limit':_0x3d66d5[_0x75a4('0x1c')]?_0x3d66d5[_0x75a4('0x1c')][_0x75a4('0x1e')]||null:null,'include':_0x3d66d5['options']?_0x3d66d5[_0x75a4('0x1c')][_0x75a4('0x1f')]?_['map'](_0x3d66d5[_0x75a4('0x1c')][_0x75a4('0x1f')],function(_0x1187c2){return{'model':db[_0x1187c2[_0x75a4('0x20')]],'as':_0x1187c2['as'],'attributes':_0x1187c2[_0x75a4('0x1d')],'include':_0x1187c2['include']?_[_0x75a4('0x21')](_0x1187c2[_0x75a4('0x1f')],function(_0xb95e63){return{'model':db[_0xb95e63[_0x75a4('0x20')]],'as':_0xb95e63['as'],'attributes':_0xb95e63[_0x75a4('0x1d')],'include':_0xb95e63['include']?_[_0x75a4('0x21')](_0xb95e63['include'],function(_0x2d2e6c){return{'model':db[_0x2d2e6c[_0x75a4('0x20')]],'as':_0x2d2e6c['as'],'attributes':_0x2d2e6c[_0x75a4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x75a4('0x22')](function(_0x23b1be){logger[_0x75a4('0xf')](_0x75a4('0x18'),_0x3d66d5);logger[_0x75a4('0x11')](_0x75a4('0x18'),_0x3d66d5,JSON[_0x75a4('0x13')](_0x23b1be));_0x2c1a37(_0x23b1be);})[_0x75a4('0x17')](function(_0x4cfd9c){logger[_0x75a4('0x14')]('GetUser',_0x4cfd9c[_0x75a4('0x15')],_0x3d66d5);_0x4a265a(_0x825ac4[_0x75a4('0x14')](0x1f4,_0x4cfd9c['message']));});});};exports[_0x75a4('0x23')]=function(_0x57b753){var _0x1f87ef=this;return new Promise(function(_0x1996da,_0x326d78){return db['User'][_0x75a4('0x24')]({'raw':_0x57b753['options']?_0x57b753[_0x75a4('0x1c')][_0x75a4('0x1b')]===undefined?!![]:![]:!![],'where':_0x57b753[_0x75a4('0x1c')]?_0x57b753[_0x75a4('0x1c')]['where']||null:null,'attributes':_0x57b753[_0x75a4('0x1c')]?_0x57b753['options'][_0x75a4('0x1d')]||null:null,'include':_0x57b753['options']?_0x57b753['options'][_0x75a4('0x1f')]?_['map'](_0x57b753['options'][_0x75a4('0x1f')],function(_0x511db0){return{'model':db[_0x511db0[_0x75a4('0x20')]],'as':_0x511db0['as'],'attributes':_0x511db0[_0x75a4('0x1d')],'include':_0x511db0[_0x75a4('0x1f')]?_[_0x75a4('0x21')](_0x511db0[_0x75a4('0x1f')],function(_0x5d1ad5){return{'model':db[_0x5d1ad5[_0x75a4('0x20')]],'as':_0x5d1ad5['as'],'attributes':_0x5d1ad5[_0x75a4('0x1d')],'include':_0x5d1ad5[_0x75a4('0x1f')]?_[_0x75a4('0x21')](_0x5d1ad5[_0x75a4('0x1f')],function(_0x27b1ca){return{'model':db[_0x27b1ca[_0x75a4('0x20')]],'as':_0x27b1ca['as'],'attributes':_0x27b1ca[_0x75a4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30de26){logger[_0x75a4('0xf')]('ShowUser',_0x57b753);logger['debug'](_0x75a4('0x23'),_0x57b753,JSON['stringify'](_0x30de26));_0x1996da(_0x30de26);})[_0x75a4('0x17')](function(_0x58a53c){logger[_0x75a4('0x14')](_0x75a4('0x23'),_0x58a53c['message'],_0x57b753);_0x326d78(_0x1f87ef[_0x75a4('0x14')](0x1f4,_0x58a53c[_0x75a4('0x15')]));});});};exports[_0x75a4('0x25')]=function(_0x131a28){var _0x50adaf=this;return new Promise(function(_0xc077a7,_0x33416f){var _0x3320a3;return db[_0x75a4('0x19')][_0x75a4('0x24')]({'where':_0x131a28['options'][_0x75a4('0x26')]||{},'attributes':['id',_0x75a4('0x27'),_0x75a4('0x28'),_0x75a4('0x29'),_0x75a4('0x2a')]})[_0x75a4('0x22')](function(_0xead540){if(_0xead540){_0x3320a3=_0xead540;return db[_0x75a4('0x2b')][_0x75a4('0x2c')]({'paused':0x1},{'where':{'UserId':_0x3320a3['id']},'individualHooks':!![]});}})[_0x75a4('0x22')](function(){if(_0x3320a3){return db[_0x75a4('0x2d')][_0x75a4('0x1a')]({'where':{'membername':_0x3320a3[_0x75a4('0x27')],'type':_0x75a4('0x2e'),'exitAt':null}});}})['then'](function(_0x2ae9c0){if(_0x3320a3){if(_0x2ae9c0&&_0x2ae9c0[_0x75a4('0x2f')]){var _0x2aaaa2=moment()['format'](_0x75a4('0x30'));for(var _0xf689b8=0x0,_0x5de4ee=_0x2ae9c0['length'];_0xf689b8<_0x5de4ee;_0xf689b8++){_0x2ae9c0[_0xf689b8][_0x75a4('0x31')]({'exitAt':_0x2aaaa2});}}}})[_0x75a4('0x22')](function(){if(_0x3320a3){var _0x534ae4=[];var _0x1c7ad9=utils['getChannels']();_0x1c7ad9[_0x75a4('0x32')](function(_0x5d9aad){_0x534ae4[_0x75a4('0x33')]({'channel':_0x5d9aad,'membername':_0x3320a3[_0x75a4('0x27')],'interface':_[_0x75a4('0x34')](_0x3320a3[_0x75a4('0x2a')])?util[_0x75a4('0x35')]('SIP/%s',_0x3320a3['name']):_0x3320a3[_0x75a4('0x2a')],'type':_0x75a4('0x2e'),'enterAt':moment()[_0x75a4('0x35')](_0x75a4('0x30')),'data1':_0x131a28['body'][_0x75a4('0x36')]||_0x75a4('0x37'),'role':_0x3320a3[_0x75a4('0x28')],'internal':_0x3320a3['internal'],'uniqueid':_0x131a28[_0x75a4('0x38')][_0x75a4('0x39')]||null});});return db[_0x75a4('0x2d')][_0x75a4('0x3a')](_0x534ae4,{'individualHooks':!![]});}})[_0x75a4('0x22')](function(){if(_0x3320a3){return _0x3320a3[_0x75a4('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x131a28[_0x75a4('0x38')][_0x75a4('0x36')]||_0x75a4('0x37'),'lastPauseAt':moment()[_0x75a4('0x35')](_0x75a4('0x30'))});}})[_0x75a4('0x22')](function(_0x343114){_0xc077a7(_0x343114);})[_0x75a4('0x17')](function(_0x2578c0){_0x33416f(_0x50adaf[_0x75a4('0x14')](0x1f4,_0x2578c0[_0x75a4('0x15')]));});});};exports[_0x75a4('0x3b')]=function(_0x185c45){var _0x4fd05d=this;return new Promise(function(_0x338ce6,_0x25348b){var _0x58a83f;return db['User'][_0x75a4('0x3c')]({'where':_0x185c45[_0x75a4('0x1c')][_0x75a4('0x26')]||{},'attributes':['id','name']})[_0x75a4('0x22')](function(_0x568096){if(_0x568096){_0x58a83f=_0x568096;if(_0x185c45[_0x75a4('0x38')]['channel']&&!utils['isValidChannel'](_0x185c45[_0x75a4('0x38')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x185c45[_0x75a4('0x38')][_0x75a4('0x3d')]){case _0x75a4('0x3e'):return db[_0x75a4('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x58a83f['id']}})[_0x75a4('0x22')](function(){return db[_0x75a4('0x2d')]['find']({'where':{'channel':_0x185c45[_0x75a4('0x38')][_0x75a4('0x3d')],'membername':_0x58a83f[_0x75a4('0x27')],'type':_0x75a4('0x2e'),'exitAt':null}});})[_0x75a4('0x22')](function(_0x175bba){if(_0x175bba){return _0x175bba[_0x75a4('0x2c')]({'exitAt':moment()[_0x75a4('0x35')](_0x75a4('0x30')),'data2':_0x75a4('0x3f')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x58a83f['update']({'voicePause':![]});});case'mail':case _0x75a4('0x40'):case _0x75a4('0x41'):case _0x75a4('0x42'):case _0x75a4('0x43'):case'whatsapp':return db['MemberReport'][_0x75a4('0x24')]({'where':{'channel':_0x185c45[_0x75a4('0x38')][_0x75a4('0x3d')],'membername':_0x58a83f[_0x75a4('0x27')],'type':_0x75a4('0x2e'),'exitAt':null}})[_0x75a4('0x22')](function(_0x1a302c){return _0x1a302c[_0x75a4('0x2c')]({'exitAt':moment()[_0x75a4('0x35')](_0x75a4('0x30')),'data2':_0x75a4('0x3f')},{'individualHooks':!![]});})[_0x75a4('0x22')](function(){var _0x482949={};_['set'](_0x482949,util['format'](_0x75a4('0x44'),_0x185c45[_0x75a4('0x38')][_0x75a4('0x3d')],_0x75a4('0x45')),![]);return _0x58a83f[_0x75a4('0x2c')](_0x482949);});default:return db[_0x75a4('0x2b')][_0x75a4('0x2c')]({'paused':0x0},{'where':{'UserId':_0x58a83f['id']}})[_0x75a4('0x22')](function(){return db[_0x75a4('0x2d')]['findAll']({'where':{'membername':_0x58a83f[_0x75a4('0x27')],'type':_0x75a4('0x2e'),'exitAt':null}});})[_0x75a4('0x22')](function(_0x48c21b){var _0x3a99b5=[];_0x48c21b[_0x75a4('0x32')](function(_0x3291f7){_0x3a99b5[_0x75a4('0x33')](_0x3291f7[_0x75a4('0x2c')]({'exitAt':moment()['format'](_0x75a4('0x30')),'data2':_0x75a4('0x3f')}));});return BPromise['all'](_0x3a99b5);})['then'](function(){return _0x58a83f[_0x75a4('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x2af4fa){_0x338ce6(_0x2af4fa);})[_0x75a4('0x17')](function(_0x338481){_0x25348b(_0x4fd05d[_0x75a4('0x14')](0x1f4,_0x338481[_0x75a4('0x15')]));});});};exports['LogoutUser']=function(_0x3598d2){var _0x497ceb=this;return new Promise(function(_0x1f09d1,_0x23e230){var _0x4a11ef;return db['User']['findOne']({'where':_0x3598d2['options'][_0x75a4('0x26')]||{},'attributes':['id',_0x75a4('0x27')]})['then'](function(_0x53ecbc){if(_0x53ecbc){_0x4a11ef=_0x53ecbc;return db[_0x75a4('0x2b')][_0x75a4('0x46')]({'where':{'membername':_0x4a11ef[_0x75a4('0x27')]},'individualHooks':!![]});}})[_0x75a4('0x22')](function(){if(_0x4a11ef){return db[_0x75a4('0x2d')][_0x75a4('0x1a')]({'where':{'membername':_0x4a11ef[_0x75a4('0x27')],'exitAt':null}});}})[_0x75a4('0x22')](function(_0x183843){if(_0x4a11ef){if(_0x183843&&_0x183843[_0x75a4('0x2f')]){var _0x8a2b18=[];_0x183843[_0x75a4('0x32')](function(_0x1a6b0a){_0x8a2b18['push'](_0x1a6b0a['update']({'exitAt':moment()['format'](_0x75a4('0x30'))}));});return BPromise[_0x75a4('0x47')](_0x8a2b18);}}})['then'](function(){if(_0x4a11ef){return _0x4a11ef[_0x75a4('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x75a4('0x22')](function(_0x2e2d69){_0x1f09d1(_0x2e2d69);})[_0x75a4('0x17')](function(_0x43d89d){_0x23e230(_0x497ceb['error'](0x1f4,_0x43d89d[_0x75a4('0x15')]));});});};exports[_0x75a4('0x48')]=function(_0x30db0b){var _0x61a1bb=this;return new Promise(function(_0x5262f2,_0x57b140){var _0x3d8153;var _0x588e9b;var _0xe4768;var _0x349e97;return db['User'][_0x75a4('0x3c')]({'where':_0x30db0b[_0x75a4('0x1c')][_0x75a4('0x26')]||{},'attributes':['id',_0x75a4('0x27'),_0x75a4('0x28'),_0x75a4('0x49'),_0x75a4('0x4a'),_0x75a4('0x29'),_0x75a4('0x4b'),_0x75a4('0x2a')]})[_0x75a4('0x22')](function(_0x1b1616){if(_0x1b1616){_0x3d8153=_0x1b1616;_0x349e97=_0x30db0b['body']['interface']?_0x30db0b[_0x75a4('0x38')]['interface']:util[_0x75a4('0x35')](_0x75a4('0x4c'),_0x3d8153[_0x75a4('0x27')]);return db[_0x75a4('0x19')][_0x75a4('0x4d')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3d8153['id']}}});}})['then'](function(_0x2a740b){if(_0x2a740b){_0xe4768=_0x2a740b;return require(_0x75a4('0x4e'))[_0x75a4('0x4f')]();}})['then'](function(_0x51ea65){if(_0x51ea65&&_0x51ea65[_0x75a4('0x50')]&&_0xe4768>=_0x51ea65[_0x75a4('0x50')]){throw new Error(_0x75a4('0x51'));}})[_0x75a4('0x22')](function(){if(_0x3d8153){return db['UserVoiceQueueRt'][_0x75a4('0x46')]({'where':{'membername':_0x3d8153[_0x75a4('0x27')]},'individualHooks':!![]});}})[_0x75a4('0x22')](function(){if(_0x3d8153){return _0x3d8153[_0x75a4('0x52')]({'raw':!![]});}})[_0x75a4('0x22')](function(_0x2d1df1){if(_0x3d8153){if(_0x2d1df1){var _0x45dd67=[];_0x588e9b=_0x2d1df1;if(_0x588e9b[_0x75a4('0x2f')]){for(var _0x15f0ea=0x0;_0x15f0ea<_0x588e9b[_0x75a4('0x2f')];_0x15f0ea++){_0x45dd67[_0x75a4('0x33')](db[_0x75a4('0x2b')]['upsert']({'membername':_0x3d8153['name'],'UserId':_0x3d8153['id'],'queue_name':_0x588e9b[_0x15f0ea][_0x75a4('0x27')],'VoiceQueueId':_0x588e9b[_0x15f0ea]['id'],'interface':_0x349e97,'paused':_0x3d8153[_0x75a4('0x4b')]||![],'penalty':_0x588e9b[_0x15f0ea]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x75a4('0x47')](_0x45dd67);}}}})['then'](function(){if(_0x3d8153){return db[_0x75a4('0x2d')][_0x75a4('0x1a')]({'where':{'membername':_0x3d8153[_0x75a4('0x27')],'exitAt':null}});}})[_0x75a4('0x22')](function(_0x26f1ea){if(_0x3d8153){if(_0x26f1ea&&_0x26f1ea[_0x75a4('0x2f')]){var _0x4d01a4=[];_0x26f1ea[_0x75a4('0x32')](function(_0x365d92){_0x4d01a4[_0x75a4('0x33')](_0x365d92[_0x75a4('0x2c')]({'exitAt':moment()[_0x75a4('0x35')](_0x75a4('0x30'))}));});return BPromise['all'](_0x4d01a4);}}})[_0x75a4('0x22')](function(_0x4582eb){if(_0x3d8153){var _0x1fed8d=[];var _0x3a1bca=[];var _0x7eb5a8=utils[_0x75a4('0x53')]();var _0x13938e={'membername':_0x3d8153[_0x75a4('0x27')],'interface':_0x349e97,'enterAt':moment()[_0x75a4('0x35')](_0x75a4('0x30')),'role':_0x3d8153[_0x75a4('0x28')],'internal':_0x3d8153[_0x75a4('0x29')]};_0x7eb5a8[_0x75a4('0x32')](function(_0x4b817b){_0x1fed8d[_0x75a4('0x33')](_[_0x75a4('0x54')]({'channel':_0x4b817b,'type':_0x75a4('0x55'),'data1':'callysquare','data2':_0x349e97},_0x13938e));if(_0x3d8153['loginInPause']){_0x3a1bca['push'](_[_0x75a4('0x54')]({'channel':_0x4b817b,'type':_0x75a4('0x2e'),'data1':_0x75a4('0x56')},_0x13938e));}});return db[_0x75a4('0x2d')][_0x75a4('0x3a')](_0x1fed8d[_0x75a4('0x57')](_0x3a1bca),{'individualHooks':!![]});}})[_0x75a4('0x22')](function(){if(_0x3d8153){return _0x3d8153['update']({'online':!![],'lastLoginAt':moment()[_0x75a4('0x35')](_0x75a4('0x30')),'voicePause':_0x3d8153[_0x75a4('0x4b')]||![],'mailPause':_0x3d8153[_0x75a4('0x4b')]||![],'chatPause':_0x3d8153['loginInPause']||![],'faxPause':_0x3d8153[_0x75a4('0x4b')]||![],'smsPause':_0x3d8153[_0x75a4('0x4b')]||![],'openchannelPause':_0x3d8153[_0x75a4('0x4b')]||![],'pauseType':_0x3d8153[_0x75a4('0x4b')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x75a4('0x35')](_0x75a4('0x30')),'interface':_0x349e97});}})[_0x75a4('0x22')](function(_0x910908){_0x5262f2(_0x910908);})[_0x75a4('0x17')](function(_0x493810){_0x57b140(_0x61a1bb[_0x75a4('0x14')](0x1f4,_0x493810[_0x75a4('0x15')]));});});};
\ No newline at end of file
index 793bb3c..ef55dac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4213=['update','emit','removeListener','length','./user.events','remove'];(function(_0x4d9023,_0x33ce11){var _0x261ed5=function(_0x483e47){while(--_0x483e47){_0x4d9023['push'](_0x4d9023['shift']());}};_0x261ed5(++_0x33ce11);}(_0x4213,0x130));var _0x3421=function(_0x254f51,_0x2befa9){_0x254f51=_0x254f51-0x0;var _0x161b8d=_0x4213[_0x254f51];return _0x161b8d;};'use strict';var UserEvents=require(_0x3421('0x0'));var events=['save',_0x3421('0x1'),_0x3421('0x2')];function createListener(_0x48900c,_0x188c0d){return function(_0x30adca){_0x188c0d[_0x3421('0x3')](_0x48900c,_0x30adca);};}function removeListener(_0x44d71f,_0x3022a9){return function(){UserEvents[_0x3421('0x4')](_0x44d71f,_0x3022a9);};}exports['register']=function(_0x15eac0){for(var _0x4958c9=0x0,_0x2918e9=events[_0x3421('0x5')];_0x4958c9<_0x2918e9;_0x4958c9++){var _0x56e709=events[_0x4958c9];var _0x4eb8a9=createListener('user:'+_0x56e709,_0x15eac0);UserEvents['on'](_0x56e709,_0x4eb8a9);}};
\ No newline at end of file
+var _0x8fb3=['./user.events','save','remove','update','register','length','user:'];(function(_0x24795e,_0x886b65){var _0x3981b0=function(_0x2cd7ce){while(--_0x2cd7ce){_0x24795e['push'](_0x24795e['shift']());}};_0x3981b0(++_0x886b65);}(_0x8fb3,0x103));var _0x38fb=function(_0x9411f4,_0x1714d0){_0x9411f4=_0x9411f4-0x0;var _0x3304ea=_0x8fb3[_0x9411f4];return _0x3304ea;};'use strict';var UserEvents=require(_0x38fb('0x0'));var events=[_0x38fb('0x1'),_0x38fb('0x2'),_0x38fb('0x3')];function createListener(_0x3dfa8f,_0x24f2ab){return function(_0x47446e){_0x24f2ab['emit'](_0x3dfa8f,_0x47446e);};}function removeListener(_0x2459b5,_0x324f23){return function(){UserEvents['removeListener'](_0x2459b5,_0x324f23);};}exports[_0x38fb('0x4')]=function(_0x364719){for(var _0x29d50c=0x0,_0x534cf3=events[_0x38fb('0x5')];_0x29d50c<_0x534cf3;_0x29d50c++){var _0x2caa84=events[_0x29d50c];var _0x11df77=createListener(_0x38fb('0x6')+_0x2caa84,_0x364719);UserEvents['on'](_0x2caa84,_0x11df77);}};
\ No newline at end of file
index 28ad0b3..e3b440c 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(_0x2def46,_0x1ae3df){var _0x295982=function(_0x13cf7e){while(--_0x13cf7e){_0x2def46['push'](_0x2def46['shift']());}};_0x295982(++_0x1ae3df);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2dadad,_0x174057){var _0x5c67a0=function(_0x14d07b){while(--_0x14d07b){_0x2dadad['push'](_0x2dadad['shift']());}};_0x5c67a0(++_0x174057);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index ca2fe4b..be1c421 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bf8=['exports','INTEGER'];(function(_0x1aca09,_0x413275){var _0x267ac9=function(_0x390c9b){while(--_0x390c9b){_0x1aca09['push'](_0x1aca09['shift']());}};_0x267ac9(++_0x413275);}(_0x8bf8,0x11a));var _0x88bf=function(_0x44f378,_0x43fe3b){_0x44f378=_0x44f378-0x0;var _0x3f76ec=_0x8bf8[_0x44f378];return _0x3f76ec;};'use strict';var Sequelize=require('sequelize');module[_0x88bf('0x0')]={'penalty':{'type':Sequelize[_0x88bf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4b28=['INTEGER','sequelize','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4b28,0x121));var _0x84b2=function(_0xaf0ac3,_0x338231){_0xaf0ac3=_0xaf0ac3-0x0;var _0x2f6e40=_0x4b28[_0xaf0ac3];return _0x2f6e40;};'use strict';var Sequelize=require(_0x84b2('0x0'));module[_0x84b2('0x1')]={'penalty':{'type':Sequelize[_0x84b2('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 7392d86..ced5710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4ba=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf4ba,0x176));var _0xaf4b=function(_0xd5f6e3,_0x5bdb05){_0xd5f6e3=_0xd5f6e3-0x0;var _0x472b5e=_0xf4ba[_0xd5f6e3];return _0x472b5e;};'use strict';var _=require(_0xaf4b('0x0'));var util=require(_0xaf4b('0x1'));var logger=require(_0xaf4b('0x2'))(_0xaf4b('0x3'));var moment=require('moment');var BPromise=require(_0xaf4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf4b('0x5'));var rimraf=require(_0xaf4b('0x6'));var config=require(_0xaf4b('0x7'));var attributes=require(_0xaf4b('0x8'));module[_0xaf4b('0x9')]=function(_0x17b2a6,_0x553867){return _0x17b2a6['define'](_0xaf4b('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x46fc=['../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5c4585,_0x3d0eab){var _0x21dede=function(_0x5c3d6a){while(--_0x5c3d6a){_0x5c4585['push'](_0x5c4585['shift']());}};_0x21dede(++_0x3d0eab);}(_0x46fc,0x87));var _0xc46f=function(_0x1e7de9,_0x52f0ca){_0x1e7de9=_0x1e7de9-0x0;var _0x4639ce=_0x46fc[_0x1e7de9];return _0x4639ce;};'use strict';var _=require(_0xc46f('0x0'));var util=require('util');var logger=require(_0xc46f('0x1'))(_0xc46f('0x2'));var moment=require(_0xc46f('0x3'));var BPromise=require(_0xc46f('0x4'));var rp=require(_0xc46f('0x5'));var fs=require('fs');var path=require(_0xc46f('0x6'));var rimraf=require(_0xc46f('0x7'));var config=require(_0xc46f('0x8'));var attributes=require('./userChatQueue.attributes');module[_0xc46f('0x9')]=function(_0x4e7a74,_0xf1aa1a){return _0x4e7a74[_0xc46f('0xa')](_0xc46f('0xb'),attributes,{'tableName':_0xc46f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f571f70..3f64e95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1a6=['jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xd1a6,0x1bf));var _0x6d1a=function(_0x4014c8,_0x38efb6){_0x4014c8=_0x4014c8-0x0;var _0x194847=_0xd1a6[_0x4014c8];return _0x194847;};'use strict';var _=require(_0x6d1a('0x0'));var util=require(_0x6d1a('0x1'));var moment=require(_0x6d1a('0x2'));var BPromise=require(_0x6d1a('0x3'));var rs=require(_0x6d1a('0x4'));var fs=require('fs');var Redis=require(_0x6d1a('0x5'));var db=require(_0x6d1a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d1a('0x7'))('rpc');var config=require(_0x6d1a('0x8'));var jayson=require(_0x6d1a('0x9'));var client=jayson[_0x6d1a('0xa')][_0x6d1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b12a9,_0x44abec,_0x3f8867){return new BPromise(function(_0x311db8,_0x3ccdef){return client[_0x6d1a('0xc')](_0x4b12a9,_0x3f8867)[_0x6d1a('0xd')](function(_0x48cca7){logger[_0x6d1a('0xe')](_0x6d1a('0xf'),_0x44abec,_0x6d1a('0x10'));logger[_0x6d1a('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x44abec,_0x6d1a('0x10'),JSON[_0x6d1a('0x12')](_0x48cca7));if(_0x48cca7['error']){if(_0x48cca7[_0x6d1a('0x13')][_0x6d1a('0x14')]===0x1f4){logger[_0x6d1a('0x13')](_0x6d1a('0xf'),_0x44abec,_0x48cca7[_0x6d1a('0x13')][_0x6d1a('0x15')]);return _0x3ccdef(_0x48cca7[_0x6d1a('0x13')][_0x6d1a('0x15')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x44abec,_0x48cca7[_0x6d1a('0x13')][_0x6d1a('0x15')]);return _0x311db8(_0x48cca7[_0x6d1a('0x13')][_0x6d1a('0x15')]);}else{logger[_0x6d1a('0xe')](_0x6d1a('0xf'),_0x44abec,_0x6d1a('0x10'));_0x311db8(_0x48cca7[_0x6d1a('0x16')][_0x6d1a('0x15')]);}})[_0x6d1a('0x17')](function(_0x41feac){logger[_0x6d1a('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x44abec,_0x41feac);_0x3ccdef(_0x41feac);});});}
\ No newline at end of file
+var _0xa44e=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x4fb2dd,_0x6f90bb){var _0x2156d9=function(_0x4d1f06){while(--_0x4d1f06){_0x4fb2dd['push'](_0x4fb2dd['shift']());}};_0x2156d9(++_0x6f90bb);}(_0xa44e,0x1ed));var _0xea44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa44e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xea44('0x0'));var util=require(_0xea44('0x1'));var moment=require(_0xea44('0x2'));var BPromise=require(_0xea44('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea44('0x4'))['db'];var utils=require(_0xea44('0x5'));var logger=require(_0xea44('0x6'))('rpc');var config=require(_0xea44('0x7'));var jayson=require(_0xea44('0x8'));var client=jayson[_0xea44('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2889f1,_0x32ad9f,_0x52478e){return new BPromise(function(_0x74903c,_0x517781){return client[_0xea44('0xa')](_0x2889f1,_0x52478e)['then'](function(_0x2e136f){logger['info'](_0xea44('0xb'),_0x32ad9f,_0xea44('0xc'));logger[_0xea44('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x32ad9f,_0xea44('0xc'),JSON[_0xea44('0xe')](_0x2e136f));if(_0x2e136f[_0xea44('0xf')]){if(_0x2e136f[_0xea44('0xf')][_0xea44('0x10')]===0x1f4){logger['error'](_0xea44('0xb'),_0x32ad9f,_0x2e136f[_0xea44('0xf')]['message']);return _0x517781(_0x2e136f[_0xea44('0xf')]['message']);}logger[_0xea44('0xf')](_0xea44('0xb'),_0x32ad9f,_0x2e136f[_0xea44('0xf')][_0xea44('0x11')]);return _0x74903c(_0x2e136f['error']['message']);}else{logger[_0xea44('0x12')](_0xea44('0xb'),_0x32ad9f,_0xea44('0xc'));_0x74903c(_0x2e136f[_0xea44('0x13')][_0xea44('0x11')]);}})[_0xea44('0x14')](function(_0x99341){logger[_0xea44('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x32ad9f,_0x99341);_0x517781(_0x99341);});});}
\ No newline at end of file
index a1c918b..49a10d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x31e982,_0x521c6a){var _0x3efb59=function(_0x9a5416){while(--_0x9a5416){_0x31e982['push'](_0x31e982['shift']());}};_0x3efb59(++_0x521c6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x54d970,_0x1d8c10){var _0xa51348=function(_0x396d08){while(--_0x396d08){_0x54d970['push'](_0x54d970['shift']());}};_0xa51348(++_0x1d8c10);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0xcb91[_0x4d2f00];return _0x2d7b7f;};'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 4f019ce..cb19f5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4c7=['INTEGER','STRING','exports'];(function(_0x5cb089,_0x5ab216){var _0xad3113=function(_0xaabbfd){while(--_0xaabbfd){_0x5cb089['push'](_0x5cb089['shift']());}};_0xad3113(++_0x5ab216);}(_0xa4c7,0x119));var _0x7a4c=function(_0xfe372e,_0x319ffd){_0xfe372e=_0xfe372e-0x0;var _0x43fd17=_0xa4c7[_0xfe372e];return _0x43fd17;};'use strict';var Sequelize=require('sequelize');module[_0x7a4c('0x0')]={'penalty':{'type':Sequelize[_0x7a4c('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7a4c('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x7a4c('0x2')]}};
\ No newline at end of file
+var _0xe6f1=['exports','INTEGER','sequelize'];(function(_0x264267,_0x28d67e){var _0x891190=function(_0x31aa5a){while(--_0x31aa5a){_0x264267['push'](_0x264267['shift']());}};_0x891190(++_0x28d67e);}(_0xe6f1,0x7a));var _0x1e6f=function(_0x507357,_0x2c9a2f){_0x507357=_0x507357-0x0;var _0x164653=_0xe6f1[_0x507357];return _0x164653;};'use strict';var Sequelize=require(_0x1e6f('0x0'));module[_0x1e6f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1e6f('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9c39ffc..b34c414 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc01d=['../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','../../config/logger','moment','path','rimraf'];(function(_0x1dcc0d,_0x5073f2){var _0x455fe6=function(_0x5b72f1){while(--_0x5b72f1){_0x1dcc0d['push'](_0x1dcc0d['shift']());}};_0x455fe6(++_0x5073f2);}(_0xc01d,0x146));var _0xdc01=function(_0x118278,_0x5e64a1){_0x118278=_0x118278-0x0;var _0x1f47f3=_0xc01d[_0x118278];return _0x1f47f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdc01('0x0'))('api');var moment=require(_0xdc01('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc01('0x2'));var rimraf=require(_0xdc01('0x3'));var config=require(_0xdc01('0x4'));var attributes=require(_0xdc01('0x5'));module[_0xdc01('0x6')]=function(_0x14c470,_0x390425){return _0x14c470[_0xdc01('0x7')](_0xdc01('0x8'),attributes,{'tableName':_0xdc01('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb405=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_has_fax_queues','lodash','../../config/logger'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xb405,0x94));var _0x5b40=function(_0x4222c6,_0x18ff2a){_0x4222c6=_0x4222c6-0x0;var _0x19b9e3=_0xb405[_0x4222c6];return _0x19b9e3;};'use strict';var _=require(_0x5b40('0x0'));var util=require('util');var logger=require(_0x5b40('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5b40('0x2'));var rp=require(_0x5b40('0x3'));var fs=require('fs');var path=require(_0x5b40('0x4'));var rimraf=require(_0x5b40('0x5'));var config=require(_0x5b40('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x5b40('0x7')]=function(_0x388f5c,_0x28bb7d){return _0x388f5c[_0x5b40('0x8')]('UserFaxQueue',attributes,{'tableName':_0x5b40('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9be36de..a252068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8447=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x536295,_0x436f44){var _0x58879d=function(_0x28cd1b){while(--_0x28cd1b){_0x536295['push'](_0x536295['shift']());}};_0x58879d(++_0x436f44);}(_0x8447,0x17e));var _0x7844=function(_0x1e6891,_0x2aa03c){_0x1e6891=_0x1e6891-0x0;var _0x1bf2db=_0x8447[_0x1e6891];return _0x1bf2db;};'use strict';var _=require(_0x7844('0x0'));var util=require(_0x7844('0x1'));var moment=require(_0x7844('0x2'));var BPromise=require(_0x7844('0x3'));var rs=require(_0x7844('0x4'));var fs=require('fs');var Redis=require(_0x7844('0x5'));var db=require(_0x7844('0x6'))['db'];var utils=require(_0x7844('0x7'));var logger=require(_0x7844('0x8'))(_0x7844('0x9'));var config=require(_0x7844('0xa'));var jayson=require(_0x7844('0xb'));var client=jayson['client'][_0x7844('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38167b,_0xf71a36,_0x63cd93){return new BPromise(function(_0xe1510c,_0x40a060){return client['request'](_0x38167b,_0x63cd93)[_0x7844('0xd')](function(_0x1776f5){logger['info'](_0x7844('0xe'),_0xf71a36,_0x7844('0xf'));logger['debug'](_0x7844('0x10'),_0xf71a36,_0x7844('0xf'),JSON[_0x7844('0x11')](_0x1776f5));if(_0x1776f5[_0x7844('0x12')]){if(_0x1776f5[_0x7844('0x12')][_0x7844('0x13')]===0x1f4){logger[_0x7844('0x12')](_0x7844('0xe'),_0xf71a36,_0x1776f5[_0x7844('0x12')][_0x7844('0x14')]);return _0x40a060(_0x1776f5[_0x7844('0x12')][_0x7844('0x14')]);}logger[_0x7844('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0xf71a36,_0x1776f5['error'][_0x7844('0x14')]);return _0xe1510c(_0x1776f5[_0x7844('0x12')]['message']);}else{logger[_0x7844('0x15')](_0x7844('0xe'),_0xf71a36,_0x7844('0xf'));_0xe1510c(_0x1776f5[_0x7844('0x16')][_0x7844('0x14')]);}})[_0x7844('0x17')](function(_0x2c30e3){logger['error'](_0x7844('0xe'),_0xf71a36,_0x2c30e3);_0x40a060(_0x2c30e3);});});}
\ No newline at end of file
+var _0x2472=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x2472,0xd8));var _0x2247=function(_0x519644,_0x1f4200){_0x519644=_0x519644-0x0;var _0x25b338=_0x2472[_0x519644];return _0x25b338;};'use strict';var _=require(_0x2247('0x0'));var util=require(_0x2247('0x1'));var moment=require(_0x2247('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2247('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2247('0x4'))(_0x2247('0x5'));var config=require(_0x2247('0x6'));var jayson=require(_0x2247('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x984435,_0x2325d9,_0x2881c9){return new BPromise(function(_0x1c83ae,_0x58f607){return client['request'](_0x984435,_0x2881c9)[_0x2247('0x8')](function(_0x4db2bb){logger[_0x2247('0x9')](_0x2247('0xa'),_0x2325d9,_0x2247('0xb'));logger[_0x2247('0xc')](_0x2247('0xd'),_0x2325d9,'request\x20sent',JSON[_0x2247('0xe')](_0x4db2bb));if(_0x4db2bb['error']){if(_0x4db2bb['error'][_0x2247('0xf')]===0x1f4){logger[_0x2247('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x2325d9,_0x4db2bb['error'][_0x2247('0x11')]);return _0x58f607(_0x4db2bb['error'][_0x2247('0x11')]);}logger['error'](_0x2247('0xa'),_0x2325d9,_0x4db2bb[_0x2247('0x10')][_0x2247('0x11')]);return _0x1c83ae(_0x4db2bb['error'][_0x2247('0x11')]);}else{logger[_0x2247('0x9')](_0x2247('0xa'),_0x2325d9,_0x2247('0xb'));_0x1c83ae(_0x4db2bb[_0x2247('0x12')][_0x2247('0x11')]);}})['catch'](function(_0x3a646a){logger['error'](_0x2247('0xa'),_0x2325d9,_0x3a646a);_0x58f607(_0x3a646a);});});}
\ No newline at end of file
index 4974280..27915b3 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(_0x4663be,_0x3e451a){var _0x125632=function(_0x57a52e){while(--_0x57a52e){_0x4663be['push'](_0x4663be['shift']());}};_0x125632(++_0x3e451a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0xcb91[_0x457b64];return _0x437111;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x9a23df,_0x2edc93){var _0x44c94e=function(_0xb17494){while(--_0xb17494){_0x9a23df['push'](_0x9a23df['shift']());}};_0x44c94e(++_0x2edc93);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 03c8285..11d87f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c42=['INTEGER','sequelize'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x2c42,0x18b));var _0x22c4=function(_0x30eed8,_0x112840){_0x30eed8=_0x30eed8-0x0;var _0x410c92=_0x2c42[_0x30eed8];return _0x410c92;};'use strict';var Sequelize=require(_0x22c4('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x22c4('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdfe9=['INTEGER','sequelize','exports'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0xdfe9,0x199));var _0x9dfe=function(_0x4136aa,_0x470735){_0x4136aa=_0x4136aa-0x0;var _0x293cf6=_0xdfe9[_0x4136aa];return _0x293cf6;};'use strict';var Sequelize=require(_0x9dfe('0x0'));module[_0x9dfe('0x1')]={'penalty':{'type':Sequelize[_0x9dfe('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index cd8f0f3..94e5ceb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ba9=['../../config/logger','api','request-promise','path','exports','define','util'];(function(_0x1e4c19,_0x495a1a){var _0x1e1b9a=function(_0x586424){while(--_0x586424){_0x1e4c19['push'](_0x1e4c19['shift']());}};_0x1e1b9a(++_0x495a1a);}(_0x2ba9,0x68));var _0x92ba=function(_0x4bfcb6,_0xb3a761){_0x4bfcb6=_0x4bfcb6-0x0;var _0x273919=_0x2ba9[_0x4bfcb6];return _0x273919;};'use strict';var _=require('lodash');var util=require(_0x92ba('0x0'));var logger=require(_0x92ba('0x1'))(_0x92ba('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x92ba('0x3'));var fs=require('fs');var path=require(_0x92ba('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x92ba('0x5')]=function(_0x410f7c,_0x3a3fdc){return _0x410f7c[_0x92ba('0x6')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf33c=['user_has_mail_queues','lodash','api','moment','request-promise','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xf33c,0x1b1));var _0xcf33=function(_0x9bc5b5,_0x17c13a){_0x9bc5b5=_0x9bc5b5-0x0;var _0x1209ff=_0xf33c[_0x9bc5b5];return _0x1209ff;};'use strict';var _=require(_0xcf33('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf33('0x1'));var moment=require(_0xcf33('0x2'));var BPromise=require('bluebird');var rp=require(_0xcf33('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcf33('0x4'));var attributes=require(_0xcf33('0x5'));module[_0xcf33('0x6')]=function(_0x2fe589,_0xcc7537){return _0x2fe589['define'](_0xcf33('0x7'),attributes,{'tableName':_0xcf33('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bf7a842..ef40cec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5be253,_0x470b74){var _0x3fee0e=function(_0x12e485){while(--_0x12e485){_0x5be253['push'](_0x5be253['shift']());}};_0x3fee0e(++_0x470b74);}(_0x6aa7,0x178));var _0x76aa=function(_0x497f4a,_0x92ae85){_0x497f4a=_0x497f4a-0x0;var _0x194c59=_0x6aa7[_0x497f4a];return _0x194c59;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}
\ No newline at end of file
+var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x557132,_0x3650c9){var _0x4cf7e1=function(_0x4eb2e6){while(--_0x4eb2e6){_0x557132['push'](_0x557132['shift']());}};_0x4cf7e1(++_0x3650c9);}(_0x6aa7,0x178));var _0x76aa=function(_0x369eae,_0x3a960d){_0x369eae=_0x369eae-0x0;var _0x56e35e=_0x6aa7[_0x369eae];return _0x56e35e;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}
\ No newline at end of file
index 44ac449..6f40bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61dc=['post','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller'];(function(_0x577871,_0x39b23c){var _0x575c39=function(_0x22e16a){while(--_0x22e16a){_0x577871['push'](_0x577871['shift']());}};_0x575c39(++_0x39b23c);}(_0x61dc,0x11a));var _0xc61d=function(_0x2dccaa,_0x17d83f){_0x2dccaa=_0x2dccaa-0x0;var _0x5b22c6=_0x61dc[_0x2dccaa];return _0x5b22c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc61d('0x0'));var timeout=require(_0xc61d('0x1'));var express=require(_0xc61d('0x2'));var router=express[_0xc61d('0x3')]();var fs_extra=require(_0xc61d('0x4'));var auth=require(_0xc61d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc61d('0x6'));var controller=require(_0xc61d('0x7'));router[_0xc61d('0x8')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0xc61d('0x9')]=router;
\ No newline at end of file
+var _0x9d2f=['post','isAuthenticated','sendUserNotification','path','connect-timeout','Router','fs-extra','../../components/auth/service','./userNotification.controller'];(function(_0xd22ad6,_0x374849){var _0x196776=function(_0x11fbe5){while(--_0x11fbe5){_0xd22ad6['push'](_0xd22ad6['shift']());}};_0x196776(++_0x374849);}(_0x9d2f,0x6f));var _0xf9d2=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9d2f[_0x32f7d7];return _0x133d09;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf9d2('0x0'));var timeout=require(_0xf9d2('0x1'));var express=require('express');var router=express[_0xf9d2('0x2')]();var fs_extra=require(_0xf9d2('0x3'));var auth=require(_0xf9d2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf9d2('0x5'));router[_0xf9d2('0x6')]('/',auth[_0xf9d2('0x7')](),controller[_0xf9d2('0x8')]);module['exports']=router;
\ No newline at end of file
index ee776a7..9afb6a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a5=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x3c715a,_0x632b85){var _0x5737a3=function(_0x24496c){while(--_0x24496c){_0x3c715a['push'](_0x3c715a['shift']());}};_0x5737a3(++_0x632b85);}(_0x14a5,0x156));var _0x514a=function(_0x5a35ce,_0x27503a){_0x5a35ce=_0x5a35ce-0x0;var _0x418750=_0x14a5[_0x5a35ce];return _0x418750;};'use strict';var Sequelize=require(_0x514a('0x0'));module['exports']={'body':{'type':Sequelize[_0x514a('0x1')]},'senderName':{'type':Sequelize[_0x514a('0x2')]},'recipientsId':{'type':Sequelize[_0x514a('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x514a('0x3')]}};
\ No newline at end of file
+var _0x8436=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x39428c,_0x34b23a){var _0x52d069=function(_0x394962){while(--_0x394962){_0x39428c['push'](_0x39428c['shift']());}};_0x52d069(++_0x34b23a);}(_0x8436,0x198));var _0x6843=function(_0xc83161,_0x2fe694){_0xc83161=_0xc83161-0x0;var _0x791195=_0x8436[_0xc83161];return _0x791195;};'use strict';var Sequelize=require(_0x6843('0x0'));module[_0x6843('0x1')]={'body':{'type':Sequelize[_0x6843('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x6843('0x3')]},'beep':{'type':Sequelize[_0x6843('0x4')]}};
\ No newline at end of file
index 964bb18..291ade4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53d9=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','userNotification:send','catch','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','User','union','ids','includes','queue','replace','Queue','all','flatten','findOne','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x53d9,0x18c));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x953d('0x0'));var rimraf=require(_0x953d('0x1'));var zipdir=require(_0x953d('0x2'));var jsonpatch=require(_0x953d('0x3'));var rp=require(_0x953d('0x4'));var moment=require(_0x953d('0x5'));var BPromise=require(_0x953d('0x6'));var Mustache=require(_0x953d('0x7'));var util=require(_0x953d('0x8'));var path=require(_0x953d('0x9'));var sox=require('sox');var csv=require(_0x953d('0xa'));var ejs=require(_0x953d('0xb'));var fs=require('fs');var fs_extra=require(_0x953d('0xc'));var _=require(_0x953d('0xd'));var squel=require(_0x953d('0xe'));var crypto=require('crypto');var jsforce=require(_0x953d('0xf'));var deskjs=require(_0x953d('0x10'));var toCsv=require(_0x953d('0xa'));var querystring=require(_0x953d('0x11'));var Papa=require(_0x953d('0x12'));var Redis=require(_0x953d('0x13'));var authService=require(_0x953d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x953d('0x15'));var hardwareService=require(_0x953d('0x16'));var logger=require(_0x953d('0x17'))(_0x953d('0x18'));var utils=require('../../config/utils');var config=require(_0x953d('0x19'));var licenseUtil=require(_0x953d('0x1a'));var db=require(_0x953d('0x1b'))['db'];config[_0x953d('0x1c')]=_[_0x953d('0x1d')](config[_0x953d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x953d('0x1e'))['register'](socket);function respondWithStatusCode(_0x1959f5,_0x3f966f){_0x3f966f=_0x3f966f||0xcc;return function(_0x4cda0d){if(_0x4cda0d){return _0x1959f5[_0x953d('0x1f')](_0x3f966f);}return _0x1959f5[_0x953d('0x20')](_0x3f966f)[_0x953d('0x21')]();};}function respondWithResult(_0x1af48e,_0x56120c){_0x56120c=_0x56120c||0xc8;return function(_0x3ec0ce){if(_0x3ec0ce){return _0x1af48e[_0x953d('0x20')](_0x56120c)[_0x953d('0x22')](_0x3ec0ce);}};}function respondWithFilteredResult(_0x42b25f,_0x5d7f31){return function(_0x1d2b77){if(_0x1d2b77){var _0x3ab368=typeof _0x5d7f31[_0x953d('0x23')]===_0x953d('0x24')&&typeof _0x5d7f31[_0x953d('0x25')]===_0x953d('0x24');var _0x4a2a00=_0x1d2b77[_0x953d('0x26')];var _0xacdaff=_0x3ab368?0x0:_0x5d7f31['offset'];var _0xdc3396=_0x3ab368?_0x1d2b77[_0x953d('0x26')]:_0x5d7f31[_0x953d('0x23')]+_0x5d7f31['limit'];var _0x1a7910;if(_0xdc3396>=_0x4a2a00){_0xdc3396=_0x4a2a00;_0x1a7910=0xc8;}else{_0x1a7910=0xce;}_0x42b25f['status'](_0x1a7910);return _0x42b25f[_0x953d('0x27')](_0x953d('0x28'),_0xacdaff+'-'+_0xdc3396+'/'+_0x4a2a00)[_0x953d('0x22')](_0x1d2b77);}return null;};}function patchUpdates(_0x24e228){return function(_0x71f615){try{jsonpatch['apply'](_0x71f615,_0x24e228,!![]);}catch(_0x3efe4c){return BPromise[_0x953d('0x29')](_0x3efe4c);}return _0x71f615[_0x953d('0x2a')]();};}function saveUpdates(_0x3d4077,_0x22db10){return function(_0x3238e6){if(_0x3238e6){return _0x3238e6[_0x953d('0x2b')](_0x3d4077)[_0x953d('0x2c')](function(_0x511443){return _0x511443;});}return null;};}function removeEntity(_0x898f10,_0x34563f){return function(_0x1507c2){if(_0x1507c2){return _0x1507c2[_0x953d('0x2d')]()['then'](function(){_0x898f10[_0x953d('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217ac1,_0x1807cd){return function(_0x39766d){if(!_0x39766d){_0x217ac1[_0x953d('0x1f')](0x194);}return _0x39766d;};}function handleError(_0x25b642,_0x37bbc1){_0x37bbc1=_0x37bbc1||0x1f4;return function(_0x1f5bcd){logger[_0x953d('0x2e')](_0x1f5bcd[_0x953d('0x2f')]);if(_0x1f5bcd[_0x953d('0x30')]){delete _0x1f5bcd[_0x953d('0x30')];}_0x25b642[_0x953d('0x20')](_0x37bbc1)[_0x953d('0x31')](_0x1f5bcd);};}exports[_0x953d('0x32')]=function(_0x14304e,_0x49bc30,_0xccc6af){if(!_0x14304e['body'][_0x953d('0x33')](_0x953d('0x34'))&&!_0x14304e[_0x953d('0x35')][_0x953d('0x33')](_0x953d('0x36'))){throw new db[(_0x953d('0x37'))][(_0x953d('0x38'))](_0x953d('0x39'));}else{if(_0x14304e['body']['hasOwnProperty'](_0x953d('0x36'))&&!_0x14304e['body'][_0x953d('0x33')](_0x953d('0x3a'))){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x14304e[_0x953d('0x35')][_0x953d('0x33')](_0x953d('0x3b'))){throw new db['Sequelize'][(_0x953d('0x38'))](_0x953d('0x3c'));}else{try{var _0xb0508c=JSON[_0x953d('0x3d')](_0x14304e[_0x953d('0x35')]['recipients']);}catch(_0x5c2fdd){logger[_0x953d('0x2e')](_0x5c2fdd);throw new db['Sequelize'][(_0x953d('0x38'))](_0x953d('0x3e'));}var _0xb2a1b7=[_0x953d('0x3f'),_0x953d('0x40'),_0x953d('0x41'),'openchannelqueue',_0x953d('0x42'),_0x953d('0x43'),_0x953d('0x44'),_0x953d('0x45'),_0x953d('0x46')];if(_[_0x953d('0x47')](_0xb0508c,function(_0x3fe7c8){return!_['includes'](_0xb2a1b7,_0x3fe7c8[_0x953d('0x48')][_0x953d('0x49')]());})){throw new db[(_0x953d('0x37'))][(_0x953d('0x38'))](_0x953d('0x4a'));}}}var _0x527ddf={};_0x527ddf[_0x953d('0x4b')]=_0x14304e[_0x953d('0x35')][_0x953d('0x33')]('senderName')?_0x14304e['body'][_0x953d('0x4b')]:_0x14304e[_0x953d('0x46')][_0x953d('0x4c')];_0x527ddf[_0x953d('0x4d')]=_['isEmpty'](_0x14304e[_0x953d('0x35')][_0x953d('0x4d')])?null:_0x14304e[_0x953d('0x35')][_0x953d('0x4d')];_0x527ddf[_0x953d('0x4e')]=_0x14304e[_0x953d('0x35')][_0x953d('0x4e')]||![];_0x527ddf[_0x953d('0x4f')]=_0x14304e[_0x953d('0x46')]['id'];return getContent(_0x14304e[_0x953d('0x35')])[_0x953d('0x2c')](function(_0x507b0b){_0x527ddf[_0x953d('0x35')]=_0x507b0b;return getRecipients(_0xb0508c);})[_0x953d('0x2c')](function(_0x572bb1){_0x527ddf['recipientsId']=_[_0x953d('0x50')](_0x572bb1)[_0x953d('0x51')](',');return db[_0x953d('0x52')][_0x953d('0x53')](function(_0x3c4948){return db[_0x953d('0x54')]['create'](_0x527ddf,{'raw':!![],'transaction':_0x3c4948})[_0x953d('0x2c')](function(_0xccaf22){var _0x486c27={'sender':_0x527ddf[_0x953d('0x4b')],'description':_0x527ddf[_0x953d('0x4d')],'content':_0x527ddf[_0x953d('0x35')],'beep':_0x527ddf[_0x953d('0x4e')]};_0x572bb1[_0x953d('0x55')](function(_0x3e6662){_0x486c27[_0x953d('0x56')]=_0x3e6662;socket['emit'](_0x953d('0x57'),_0x486c27);});return _0xccaf22;});});})[_0x953d('0x2c')](respondWithResult(_0x49bc30,0xc9))[_0x953d('0x58')](handleError(_0x49bc30,null));};function getContent(_0x578dd9){return new BPromise(function(_0x4b11e2,_0x46efa7){if(_0x578dd9[_0x953d('0x34')]){_0x4b11e2(_0x578dd9['text']);return;}return db[_0x953d('0x59')]['findOne']({'attributes':['html'],'where':{'id':_0x578dd9[_0x953d('0x36')]},'raw':!![]})[_0x953d('0x2c')](function(_0x30f15c){if(!_0x30f15c)throw new db[(_0x953d('0x37'))][(_0x953d('0x38'))](_0x953d('0x5a'));var _0x47a34d=Mustache[_0x953d('0x5b')](_0x30f15c[_0x953d('0x5c')],_0x578dd9[_0x953d('0x3a')]);_0x4b11e2(_0x47a34d);})[_0x953d('0x58')](function(_0x59b44c){_0x46efa7(_0x59b44c);});});}function getRecipients(_0x2e4151){return new BPromise(function(_0x121b64,_0x18f3ae){var _0x2becaa=[];var _0x355788=[];_0x2e4151['forEach'](function(_0x221b83){var _0x3a35e6=_['startCase'](_0x221b83[_0x953d('0x48')][_0x953d('0x49')]());if(_0x3a35e6===_0x953d('0x5d')){_0x2becaa=_[_0x953d('0x5e')](_0x2becaa,_0x221b83[_0x953d('0x5f')]);}else{if(_[_0x953d('0x60')](_0x3a35e6,_0x953d('0x61')))_0x3a35e6=_0x3a35e6[_0x953d('0x62')](_0x953d('0x61'),_0x953d('0x63'));_0x221b83['ids']['forEach'](function(_0x30eae5){_0x355788['push'](getAgents(_0x3a35e6,_0x30eae5));});}});return BPromise[_0x953d('0x64')](_0x355788)[_0x953d('0x2c')](function(_0x5194b6){_0x2becaa=_[_0x953d('0x5e')](_0x2becaa,_[_0x953d('0x65')](_0x5194b6));_0x121b64(_0x2becaa);})[_0x953d('0x58')](function(_0x1f4623){_0x18f3ae(_0x1f4623);});});}function getAgents(_0x42190a,_0x1f9b82){return new BPromise(function(_0x24483b,_0x29b71c){return db[_0x42190a][_0x953d('0x66')]({'where':{'id':_0x1f9b82}})['then'](function(_0x2c474d){return _0x2c474d['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x3a9ed0){var _0x5c0376=_[_0x953d('0x67')](_0x3a9ed0,'id');_0x24483b(_0x5c0376);});})[_0x953d('0x58')](function(_0x4411b4){_0x29b71c(_0x4411b4);});});}
\ No newline at end of file
+var _0xe954=['sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','union','queue','replace','ids','push','all','flatten','getAgents','map','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','sendUserNotification','body','hasOwnProperty','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join'];(function(_0x222b60,_0x5cb508){var _0x5334a7=function(_0x4ff520){while(--_0x4ff520){_0x222b60['push'](_0x222b60['shift']());}};_0x5334a7(++_0x5cb508);}(_0xe954,0x145));var _0x4e95=function(_0x13a3c4,_0x1f03a3){_0x13a3c4=_0x13a3c4-0x0;var _0x5dd2d1=_0xe954[_0x13a3c4];return _0x5dd2d1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4e95('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e95('0x1'));var moment=require(_0x4e95('0x2'));var BPromise=require(_0x4e95('0x3'));var Mustache=require(_0x4e95('0x4'));var util=require(_0x4e95('0x5'));var path=require(_0x4e95('0x6'));var sox=require(_0x4e95('0x7'));var csv=require(_0x4e95('0x8'));var ejs=require(_0x4e95('0x9'));var fs=require('fs');var fs_extra=require(_0x4e95('0xa'));var _=require('lodash');var squel=require(_0x4e95('0xb'));var crypto=require(_0x4e95('0xc'));var jsforce=require(_0x4e95('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4e95('0xe'));var Papa=require(_0x4e95('0xf'));var Redis=require(_0x4e95('0x10'));var authService=require(_0x4e95('0x11'));var qs=require(_0x4e95('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e95('0x13'));var logger=require(_0x4e95('0x14'))(_0x4e95('0x15'));var utils=require(_0x4e95('0x16'));var config=require(_0x4e95('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e95('0x18'))['db'];config[_0x4e95('0x19')]=_[_0x4e95('0x1a')](config['redis'],{'host':_0x4e95('0x1b'),'port':0x18eb});var socket=require(_0x4e95('0x1c'))(new Redis(config[_0x4e95('0x19')]));require('./userNotification.socket')[_0x4e95('0x1d')](socket);function respondWithStatusCode(_0x5539ce,_0xf24105){_0xf24105=_0xf24105||0xcc;return function(_0x3882c8){if(_0x3882c8){return _0x5539ce['sendStatus'](_0xf24105);}return _0x5539ce[_0x4e95('0x1e')](_0xf24105)[_0x4e95('0x1f')]();};}function respondWithResult(_0x36f7b5,_0x27a3d4){_0x27a3d4=_0x27a3d4||0xc8;return function(_0x171a65){if(_0x171a65){return _0x36f7b5[_0x4e95('0x1e')](_0x27a3d4)['json'](_0x171a65);}};}function respondWithFilteredResult(_0x2b4dfa,_0x550ceb){return function(_0x291927){if(_0x291927){var _0x5c27e1=typeof _0x550ceb[_0x4e95('0x20')]===_0x4e95('0x21')&&typeof _0x550ceb[_0x4e95('0x22')]==='undefined';var _0x3f7d5f=_0x291927['count'];var _0x63d177=_0x5c27e1?0x0:_0x550ceb[_0x4e95('0x20')];var _0x1c4079=_0x5c27e1?_0x291927[_0x4e95('0x23')]:_0x550ceb['offset']+_0x550ceb[_0x4e95('0x22')];var _0x16b96b;if(_0x1c4079>=_0x3f7d5f){_0x1c4079=_0x3f7d5f;_0x16b96b=0xc8;}else{_0x16b96b=0xce;}_0x2b4dfa['status'](_0x16b96b);return _0x2b4dfa['set'](_0x4e95('0x24'),_0x63d177+'-'+_0x1c4079+'/'+_0x3f7d5f)['json'](_0x291927);}return null;};}function patchUpdates(_0x4393f6){return function(_0x3984ac){try{jsonpatch[_0x4e95('0x25')](_0x3984ac,_0x4393f6,!![]);}catch(_0x174a84){return BPromise[_0x4e95('0x26')](_0x174a84);}return _0x3984ac[_0x4e95('0x27')]();};}function saveUpdates(_0x2c6de6,_0xfd909a){return function(_0x351114){if(_0x351114){return _0x351114[_0x4e95('0x28')](_0x2c6de6)[_0x4e95('0x29')](function(_0x4bec6e){return _0x4bec6e;});}return null;};}function removeEntity(_0x4a9c22,_0x41f3bb){return function(_0x4a8d0d){if(_0x4a8d0d){return _0x4a8d0d[_0x4e95('0x2a')]()[_0x4e95('0x29')](function(){_0x4a9c22[_0x4e95('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14247a,_0x1082cb){return function(_0x30619b){if(!_0x30619b){_0x14247a[_0x4e95('0x2b')](0x194);}return _0x30619b;};}function handleError(_0x4e50f4,_0x2abd54){_0x2abd54=_0x2abd54||0x1f4;return function(_0x26d363){logger[_0x4e95('0x2c')](_0x26d363[_0x4e95('0x2d')]);if(_0x26d363[_0x4e95('0x2e')]){delete _0x26d363[_0x4e95('0x2e')];}_0x4e50f4[_0x4e95('0x1e')](_0x2abd54)[_0x4e95('0x2f')](_0x26d363);};}exports[_0x4e95('0x30')]=function(_0x2b242e,_0x3736be,_0x47330a){if(!_0x2b242e[_0x4e95('0x31')][_0x4e95('0x32')]('text')&&!_0x2b242e[_0x4e95('0x31')][_0x4e95('0x32')]('TemplateId')){throw new db['Sequelize'][(_0x4e95('0x33'))](_0x4e95('0x34'));}else{if(_0x2b242e[_0x4e95('0x31')][_0x4e95('0x32')](_0x4e95('0x35'))&&!_0x2b242e[_0x4e95('0x31')][_0x4e95('0x32')](_0x4e95('0x36'))){throw new db[(_0x4e95('0x37'))][(_0x4e95('0x33'))](_0x4e95('0x38'));}if(!_0x2b242e[_0x4e95('0x31')]['hasOwnProperty'](_0x4e95('0x39'))){throw new db[(_0x4e95('0x37'))][(_0x4e95('0x33'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x250452=JSON[_0x4e95('0x3a')](_0x2b242e[_0x4e95('0x31')][_0x4e95('0x39')]);}catch(_0x281178){logger['error'](_0x281178);throw new db[(_0x4e95('0x37'))][(_0x4e95('0x33'))](_0x4e95('0x3b'));}var _0x2e3f3e=[_0x4e95('0x3c'),'faxqueue','mailqueue',_0x4e95('0x3d'),_0x4e95('0x3e'),'voicequeue',_0x4e95('0x3f'),_0x4e95('0x40'),_0x4e95('0x41')];if(_[_0x4e95('0x42')](_0x250452,function(_0x36d989){return!_[_0x4e95('0x43')](_0x2e3f3e,_0x36d989[_0x4e95('0x44')][_0x4e95('0x45')]());})){throw new db['Sequelize']['ValidationError'](_0x4e95('0x46'));}}}var _0x57abd0={};_0x57abd0[_0x4e95('0x47')]=_0x2b242e['body'][_0x4e95('0x32')](_0x4e95('0x47'))?_0x2b242e[_0x4e95('0x31')][_0x4e95('0x47')]:_0x2b242e[_0x4e95('0x41')]['fullname'];_0x57abd0[_0x4e95('0x48')]=_[_0x4e95('0x49')](_0x2b242e[_0x4e95('0x31')][_0x4e95('0x48')])?null:_0x2b242e[_0x4e95('0x31')][_0x4e95('0x48')];_0x57abd0[_0x4e95('0x4a')]=_0x2b242e[_0x4e95('0x31')][_0x4e95('0x4a')]||![];_0x57abd0[_0x4e95('0x4b')]=_0x2b242e[_0x4e95('0x41')]['id'];return getContent(_0x2b242e[_0x4e95('0x31')])[_0x4e95('0x29')](function(_0x2e242f){_0x57abd0['body']=_0x2e242f;return getRecipients(_0x250452);})[_0x4e95('0x29')](function(_0x5a927d){_0x57abd0[_0x4e95('0x4c')]=_[_0x4e95('0x4d')](_0x5a927d)[_0x4e95('0x4e')](',');return db[_0x4e95('0x4f')][_0x4e95('0x50')](function(_0x166308){return db[_0x4e95('0x51')]['create'](_0x57abd0,{'raw':!![],'transaction':_0x166308})[_0x4e95('0x29')](function(_0x187123){var _0x113cf0={'sender':_0x57abd0['senderName'],'description':_0x57abd0[_0x4e95('0x48')],'content':_0x57abd0[_0x4e95('0x31')],'beep':_0x57abd0[_0x4e95('0x4a')]};_0x5a927d[_0x4e95('0x52')](function(_0x91cfc4){_0x113cf0[_0x4e95('0x53')]=_0x91cfc4;socket[_0x4e95('0x54')](_0x4e95('0x55'),_0x113cf0);});return _0x187123;});});})[_0x4e95('0x29')](respondWithResult(_0x3736be,0xc9))[_0x4e95('0x56')](handleError(_0x3736be,null));};function getContent(_0x11052e){return new BPromise(function(_0x405934,_0x348136){if(_0x11052e[_0x4e95('0x57')]){_0x405934(_0x11052e[_0x4e95('0x57')]);return;}return db[_0x4e95('0x58')][_0x4e95('0x59')]({'attributes':['html'],'where':{'id':_0x11052e[_0x4e95('0x35')]},'raw':!![]})[_0x4e95('0x29')](function(_0x5efdbe){if(!_0x5efdbe)throw new db[(_0x4e95('0x37'))]['ValidationError'](_0x4e95('0x5a'));var _0x5b6aa9=Mustache[_0x4e95('0x5b')](_0x5efdbe['html'],_0x11052e[_0x4e95('0x36')]);_0x405934(_0x5b6aa9);})[_0x4e95('0x56')](function(_0x27a353){_0x348136(_0x27a353);});});}function getRecipients(_0x2c2bdd){return new BPromise(function(_0x13e689,_0x298878){var _0x181cbf=[];var _0x22f243=[];_0x2c2bdd[_0x4e95('0x52')](function(_0x5c7a1c){var _0x273a84=_['startCase'](_0x5c7a1c[_0x4e95('0x44')]['toLowerCase']());if(_0x273a84==='User'){_0x181cbf=_[_0x4e95('0x5c')](_0x181cbf,_0x5c7a1c['ids']);}else{if(_['includes'](_0x273a84,_0x4e95('0x5d')))_0x273a84=_0x273a84[_0x4e95('0x5e')](_0x4e95('0x5d'),'Queue');_0x5c7a1c[_0x4e95('0x5f')][_0x4e95('0x52')](function(_0x5e8ca2){_0x22f243[_0x4e95('0x60')](getAgents(_0x273a84,_0x5e8ca2));});}});return BPromise[_0x4e95('0x61')](_0x22f243)['then'](function(_0x44cd16){_0x181cbf=_[_0x4e95('0x5c')](_0x181cbf,_[_0x4e95('0x62')](_0x44cd16));_0x13e689(_0x181cbf);})[_0x4e95('0x56')](function(_0x478798){_0x298878(_0x478798);});});}function getAgents(_0x20d065,_0x1f5337){return new BPromise(function(_0x44e2d8,_0x42a1e6){return db[_0x20d065][_0x4e95('0x59')]({'where':{'id':_0x1f5337}})['then'](function(_0x598867){return _0x598867[_0x4e95('0x63')]({'attributes':['id'],'raw':!![]})[_0x4e95('0x29')](function(_0x5505a9){var _0x1db8a8=_[_0x4e95('0x64')](_0x5505a9,'id');_0x44e2d8(_0x1db8a8);});})[_0x4e95('0x56')](function(_0x25ce6f){_0x42a1e6(_0x25ce6f);});});}
\ No newline at end of file
index aad2b42..56ef374 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf048=['emit','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf048,0xd2));var _0x8f04=function(_0x205190,_0x43fcce){_0x205190=_0x205190-0x0;var _0xe61c25=_0xf048[_0x205190];return _0xe61c25;};'use strict';var EventEmitter=require(_0x8f04('0x0'));var UserNotification=require(_0x8f04('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8f04('0x2')](0x0);var events={'afterCreate':_0x8f04('0x3'),'afterUpdate':_0x8f04('0x4'),'afterDestroy':_0x8f04('0x5')};function emitEvent(_0x150d8a){return function(_0x51b6ce,_0x548fd7,_0x50d923){UserNotificationEvents[_0x8f04('0x6')](_0x150d8a+':'+_0x51b6ce['id'],_0x51b6ce);UserNotificationEvents[_0x8f04('0x6')](_0x150d8a,_0x51b6ce);_0x50d923(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x8f04('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0x1e9b=['emit','hook','events','../../mysqldb','UserNotification','setMaxListeners','save','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1e9b,0x112));var _0xb1e9=function(_0x4cc5c6,_0x406b79){_0x4cc5c6=_0x4cc5c6-0x0;var _0x2ae5e8=_0x1e9b[_0x4cc5c6];return _0x2ae5e8;};'use strict';var EventEmitter=require(_0xb1e9('0x0'));var UserNotification=require(_0xb1e9('0x1'))['db'][_0xb1e9('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb1e9('0x3')](0x0);var events={'afterCreate':_0xb1e9('0x4'),'afterUpdate':_0xb1e9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3811e7){return function(_0x2b3583,_0x820709,_0x46b6b9){UserNotificationEvents[_0xb1e9('0x6')](_0x3811e7+':'+_0x2b3583['id'],_0x2b3583);UserNotificationEvents[_0xb1e9('0x6')](_0x3811e7,_0x2b3583);_0x46b6b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xb1e9('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
index c4210fa..dfae74a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62c1=['./userNotification.attributes','exports','define','userNotifications','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x426285,_0x474f56){var _0x57a8c2=function(_0x45b135){while(--_0x45b135){_0x426285['push'](_0x426285['shift']());}};_0x57a8c2(++_0x474f56);}(_0x62c1,0xf7));var _0x162c=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x62c1[_0x16629d];return _0x56ccee;};'use strict';var _=require(_0x162c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x162c('0x1'));var moment=require('moment');var BPromise=require(_0x162c('0x2'));var rp=require(_0x162c('0x3'));var fs=require('fs');var path=require(_0x162c('0x4'));var rimraf=require(_0x162c('0x5'));var config=require('../../config/environment');var attributes=require(_0x162c('0x6'));module[_0x162c('0x7')]=function(_0xcd9d3b,_0x32725d){return _0xcd9d3b[_0x162c('0x8')]('UserNotification',attributes,{'tableName':_0x162c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x162c('0xa')});};
\ No newline at end of file
+var _0x17a5=['utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4'];(function(_0x1be8d4,_0x4e9d06){var _0xa5171a=function(_0x19d932){while(--_0x19d932){_0x1be8d4['push'](_0x1be8d4['shift']());}};_0xa5171a(++_0x4e9d06);}(_0x17a5,0x1d5));var _0x517a=function(_0x46b4aa,_0x303110){_0x46b4aa=_0x46b4aa-0x0;var _0x192019=_0x17a5[_0x46b4aa];return _0x192019;};'use strict';var _=require('lodash');var util=require(_0x517a('0x0'));var logger=require(_0x517a('0x1'))('api');var moment=require(_0x517a('0x2'));var BPromise=require('bluebird');var rp=require(_0x517a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x517a('0x4'));var config=require('../../config/environment');var attributes=require(_0x517a('0x5'));module[_0x517a('0x6')]=function(_0x3c34f8,_0x4db37b){return _0x3c34f8[_0x517a('0x7')](_0x517a('0x8'),attributes,{'tableName':_0x517a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x517a('0xa'),'collate':_0x517a('0xb')});};
\ No newline at end of file
index 20671f4..b96315f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93c0=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x183be2,_0x42ff22){var _0xc760f9=function(_0x58d29e){while(--_0x58d29e){_0x183be2['push'](_0x183be2['shift']());}};_0xc760f9(++_0x42ff22);}(_0x93c0,0x1bc));var _0x093c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x93c0[_0x432682];return _0x463d05;};'use strict';var _=require(_0x093c('0x0'));var util=require(_0x093c('0x1'));var moment=require(_0x093c('0x2'));var BPromise=require(_0x093c('0x3'));var rs=require(_0x093c('0x4'));var fs=require('fs');var Redis=require(_0x093c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x093c('0x6'));var logger=require(_0x093c('0x7'))(_0x093c('0x8'));var config=require(_0x093c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x093c('0xa')][_0x093c('0xb')]({'port':0x232a});config[_0x093c('0xc')]=_[_0x093c('0xd')](config[_0x093c('0xc')],{'host':_0x093c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x093c('0xc')]));require(_0x093c('0xf'))['register'](socket);function respondWithRpcPromise(_0x120577,_0x1baa3b,_0x25a18c){return new BPromise(function(_0x45baba,_0x25f675){return client[_0x093c('0x10')](_0x120577,_0x25a18c)[_0x093c('0x11')](function(_0x11f8b2){logger[_0x093c('0x12')](_0x093c('0x13'),_0x1baa3b,_0x093c('0x14'));logger[_0x093c('0x15')](_0x093c('0x16'),_0x1baa3b,_0x093c('0x14'),JSON[_0x093c('0x17')](_0x11f8b2));if(_0x11f8b2[_0x093c('0x18')]){if(_0x11f8b2['error']['code']===0x1f4){logger[_0x093c('0x18')]('UserNotification,\x20%s,\x20%s',_0x1baa3b,_0x11f8b2['error'][_0x093c('0x19')]);return _0x25f675(_0x11f8b2[_0x093c('0x18')][_0x093c('0x19')]);}logger['error'](_0x093c('0x13'),_0x1baa3b,_0x11f8b2[_0x093c('0x18')][_0x093c('0x19')]);return _0x45baba(_0x11f8b2['error'][_0x093c('0x19')]);}else{logger[_0x093c('0x12')](_0x093c('0x13'),_0x1baa3b,_0x093c('0x14'));_0x45baba(_0x11f8b2[_0x093c('0x1a')][_0x093c('0x19')]);}})[_0x093c('0x1b')](function(_0x134c3a){logger[_0x093c('0x18')]('UserNotification,\x20%s,\x20%s',_0x1baa3b,_0x134c3a);_0x25f675(_0x134c3a);});});}
\ No newline at end of file
+var _0x51ec=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x51ec,0x106));var _0xc51e=function(_0xc26026,_0x1dc681){_0xc26026=_0xc26026-0x0;var _0x119198=_0x51ec[_0xc26026];return _0x119198;};'use strict';var _=require(_0xc51e('0x0'));var util=require(_0xc51e('0x1'));var moment=require(_0xc51e('0x2'));var BPromise=require('bluebird');var rs=require(_0xc51e('0x3'));var fs=require('fs');var Redis=require(_0xc51e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc51e('0x5'));var logger=require(_0xc51e('0x6'))(_0xc51e('0x7'));var config=require(_0xc51e('0x8'));var jayson=require(_0xc51e('0x9'));var client=jayson[_0xc51e('0xa')][_0xc51e('0xb')]({'port':0x232a});config[_0xc51e('0xc')]=_[_0xc51e('0xd')](config[_0xc51e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc51e('0xe'))(new Redis(config['redis']));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x5a67e5,_0xf70d88,_0x40ecc1){return new BPromise(function(_0x4b5333,_0x3858ef){return client[_0xc51e('0xf')](_0x5a67e5,_0x40ecc1)['then'](function(_0x44e0ae){logger['info']('UserNotification,\x20%s,\x20%s',_0xf70d88,_0xc51e('0x10'));logger[_0xc51e('0x11')](_0xc51e('0x12'),_0xf70d88,'request\x20sent',JSON[_0xc51e('0x13')](_0x44e0ae));if(_0x44e0ae[_0xc51e('0x14')]){if(_0x44e0ae[_0xc51e('0x14')][_0xc51e('0x15')]===0x1f4){logger['error'](_0xc51e('0x16'),_0xf70d88,_0x44e0ae[_0xc51e('0x14')][_0xc51e('0x17')]);return _0x3858ef(_0x44e0ae[_0xc51e('0x14')][_0xc51e('0x17')]);}logger[_0xc51e('0x14')]('UserNotification,\x20%s,\x20%s',_0xf70d88,_0x44e0ae['error'][_0xc51e('0x17')]);return _0x4b5333(_0x44e0ae[_0xc51e('0x14')][_0xc51e('0x17')]);}else{logger[_0xc51e('0x18')](_0xc51e('0x16'),_0xf70d88,_0xc51e('0x10'));_0x4b5333(_0x44e0ae[_0xc51e('0x19')][_0xc51e('0x17')]);}})[_0xc51e('0x1a')](function(_0x2bb2e2){logger[_0xc51e('0x14')](_0xc51e('0x16'),_0xf70d88,_0x2bb2e2);_0x3858ef(_0x2bb2e2);});});}
\ No newline at end of file
index 445c6bc..6051c51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cdb=['emit','removeListener','length','./userNotification.events','save','remove','update'];(function(_0x32358b,_0x5c7c35){var _0x58c21d=function(_0x238a63){while(--_0x238a63){_0x32358b['push'](_0x32358b['shift']());}};_0x58c21d(++_0x5c7c35);}(_0x1cdb,0xb9));var _0xb1cd=function(_0x35f4cb,_0x539904){_0x35f4cb=_0x35f4cb-0x0;var _0x1abdd2=_0x1cdb[_0x35f4cb];return _0x1abdd2;};'use strict';var UserNotificationEvents=require(_0xb1cd('0x0'));var events=[_0xb1cd('0x1'),_0xb1cd('0x2'),_0xb1cd('0x3')];function createListener(_0x13f245,_0x534d31){return function(_0x415833){_0x534d31[_0xb1cd('0x4')](_0x13f245,_0x415833);};}function removeListener(_0x1c1520,_0x5cd3fd){return function(){UserNotificationEvents[_0xb1cd('0x5')](_0x1c1520,_0x5cd3fd);};}exports['register']=function(_0x49472c){for(var _0xbed046=0x0,_0x203d8d=events[_0xb1cd('0x6')];_0xbed046<_0x203d8d;_0xbed046++){var _0x591b0b=events[_0xbed046];var _0x143659=createListener('userNotification:'+_0x591b0b,_0x49472c);UserNotificationEvents['on'](_0x591b0b,_0x143659);}};
\ No newline at end of file
+var _0x175d=['remove','emit','register','length','userNotification:','./userNotification.events','save'];(function(_0x4c2db2,_0x4a2b51){var _0x1914fb=function(_0x21999c){while(--_0x21999c){_0x4c2db2['push'](_0x4c2db2['shift']());}};_0x1914fb(++_0x4a2b51);}(_0x175d,0x1b7));var _0xd175=function(_0x476036,_0x13c6a6){_0x476036=_0x476036-0x0;var _0x30b0ef=_0x175d[_0x476036];return _0x30b0ef;};'use strict';var UserNotificationEvents=require(_0xd175('0x0'));var events=[_0xd175('0x1'),_0xd175('0x2'),'update'];function createListener(_0x313896,_0x30e44f){return function(_0x4a96c2){_0x30e44f[_0xd175('0x3')](_0x313896,_0x4a96c2);};}function removeListener(_0x263fdb,_0x24956b){return function(){UserNotificationEvents['removeListener'](_0x263fdb,_0x24956b);};}exports[_0xd175('0x4')]=function(_0x4eb530){for(var _0x59b445=0x0,_0x80b291=events[_0xd175('0x5')];_0x59b445<_0x80b291;_0x59b445++){var _0x3a03b9=events[_0x59b445];var _0x32278c=createListener(_0xd175('0x6')+_0x3a03b9,_0x4eb530);UserNotificationEvents['on'](_0x3a03b9,_0x32278c);}};
\ No newline at end of file
index dc213c4..0bb836b 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(_0x3d0528,_0x21a0b7){var _0x4ebb2d=function(_0x536ec8){while(--_0x536ec8){_0x3d0528['push'](_0x3d0528['shift']());}};_0x4ebb2d(++_0x21a0b7);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x48decd,_0x4e9995){var _0x4be802=function(_0x23094c){while(--_0x23094c){_0x48decd['push'](_0x48decd['shift']());}};_0x4be802(++_0x4e9995);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xcb91[_0x101e7b];return _0x4995c0;};'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 070b3dc..ba6365b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9407=['sequelize','exports'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0x9407,0x1ec));var _0x7940=function(_0x203742,_0x66f825){_0x203742=_0x203742-0x0;var _0x150967=_0x9407[_0x203742];return _0x150967;};'use strict';var Sequelize=require(_0x7940('0x0'));module[_0x7940('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3e2a=['exports'];(function(_0x5ce898,_0x33da79){var _0x552cab=function(_0xa92d40){while(--_0xa92d40){_0x5ce898['push'](_0x5ce898['shift']());}};_0x552cab(++_0x33da79);}(_0x3e2a,0x106));var _0xa3e2=function(_0x17cd47,_0x4af8d0){_0x17cd47=_0x17cd47-0x0;var _0x171b91=_0x3e2a[_0x17cd47];return _0x171b91;};'use strict';var Sequelize=require('sequelize');module[_0xa3e2('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 3baeda9..cdf1281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe21=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./userOpenchannelQueue.attributes','exports','define'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0xfe21,0x1af));var _0x1fe2=function(_0x3ce98b,_0x3b2c6e){_0x3ce98b=_0x3ce98b-0x0;var _0x1118aa=_0xfe21[_0x3ce98b];return _0x1118aa;};'use strict';var _=require(_0x1fe2('0x0'));var util=require('util');var logger=require(_0x1fe2('0x1'))('api');var moment=require(_0x1fe2('0x2'));var BPromise=require(_0x1fe2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fe2('0x4'));var rimraf=require('rimraf');var config=require(_0x1fe2('0x5'));var attributes=require(_0x1fe2('0x6'));module[_0x1fe2('0x7')]=function(_0x34b492,_0x2128a4){return _0x34b492[_0x1fe2('0x8')](_0x1fe2('0x9'),attributes,{'tableName':_0x1fe2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf565=['../../config/environment','exports','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xf565,0x7c));var _0x5f56=function(_0x5d0177,_0x466a86){_0x5d0177=_0x5d0177-0x0;var _0x3f572e=_0xf565[_0x5d0177];return _0x3f572e;};'use strict';var _=require(_0x5f56('0x0'));var util=require(_0x5f56('0x1'));var logger=require(_0x5f56('0x2'))(_0x5f56('0x3'));var moment=require(_0x5f56('0x4'));var BPromise=require(_0x5f56('0x5'));var rp=require(_0x5f56('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f56('0x7'));var config=require(_0x5f56('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x5f56('0x9')]=function(_0x474385,_0x3bdc60){return _0x474385['define']('UserOpenchannelQueue',attributes,{'tableName':_0x5f56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7db1123..a5c217b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5549=['http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x5549,0x1d9));var _0x9554=function(_0x472254,_0x403d0e){_0x472254=_0x472254-0x0;var _0x18ce89=_0x5549[_0x472254];return _0x18ce89;};'use strict';var _=require(_0x9554('0x0'));var util=require(_0x9554('0x1'));var moment=require(_0x9554('0x2'));var BPromise=require('bluebird');var rs=require(_0x9554('0x3'));var fs=require('fs');var Redis=require(_0x9554('0x4'));var db=require(_0x9554('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9554('0x6'));var config=require(_0x9554('0x7'));var jayson=require(_0x9554('0x8'));var client=jayson[_0x9554('0x9')][_0x9554('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb2ad5f,_0x462a53,_0x144c15){return new BPromise(function(_0x12ec37,_0x32887c){return client[_0x9554('0xb')](_0xb2ad5f,_0x144c15)[_0x9554('0xc')](function(_0x391a8f){logger[_0x9554('0xd')](_0x9554('0xe'),_0x462a53,_0x9554('0xf'));logger[_0x9554('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x462a53,_0x9554('0xf'),JSON[_0x9554('0x11')](_0x391a8f));if(_0x391a8f[_0x9554('0x12')]){if(_0x391a8f['error'][_0x9554('0x13')]===0x1f4){logger[_0x9554('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x462a53,_0x391a8f[_0x9554('0x12')][_0x9554('0x14')]);return _0x32887c(_0x391a8f[_0x9554('0x12')]['message']);}logger[_0x9554('0x12')](_0x9554('0xe'),_0x462a53,_0x391a8f['error'][_0x9554('0x14')]);return _0x12ec37(_0x391a8f[_0x9554('0x12')]['message']);}else{logger[_0x9554('0xd')](_0x9554('0xe'),_0x462a53,_0x9554('0xf'));_0x12ec37(_0x391a8f[_0x9554('0x15')]['message']);}})[_0x9554('0x16')](function(_0xa5cca4){logger[_0x9554('0x12')](_0x9554('0xe'),_0x462a53,_0xa5cca4);_0x32887c(_0xa5cca4);});});}
\ No newline at end of file
+var _0x9275=['request','then','info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x28729d,_0x49edcc){var _0x5519b3=function(_0x1c530a){while(--_0x1c530a){_0x28729d['push'](_0x28729d['shift']());}};_0x5519b3(++_0x49edcc);}(_0x9275,0x170));var _0x5927=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x9275[_0x265aa2];return _0x447a3a;};'use strict';var _=require('lodash');var util=require(_0x5927('0x0'));var moment=require('moment');var BPromise=require(_0x5927('0x1'));var rs=require(_0x5927('0x2'));var fs=require('fs');var Redis=require(_0x5927('0x3'));var db=require(_0x5927('0x4'))['db'];var utils=require(_0x5927('0x5'));var logger=require(_0x5927('0x6'))('rpc');var config=require(_0x5927('0x7'));var jayson=require(_0x5927('0x8'));var client=jayson['client'][_0x5927('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5662ec,_0x289cf0,_0xc3267f){return new BPromise(function(_0x399e55,_0x21fc6f){return client[_0x5927('0xa')](_0x5662ec,_0xc3267f)[_0x5927('0xb')](function(_0x2daddd){logger[_0x5927('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x289cf0,_0x5927('0xd'));logger['debug'](_0x5927('0xe'),_0x289cf0,'request\x20sent',JSON[_0x5927('0xf')](_0x2daddd));if(_0x2daddd['error']){if(_0x2daddd[_0x5927('0x10')][_0x5927('0x11')]===0x1f4){logger['error'](_0x5927('0x12'),_0x289cf0,_0x2daddd[_0x5927('0x10')][_0x5927('0x13')]);return _0x21fc6f(_0x2daddd['error'][_0x5927('0x13')]);}logger['error'](_0x5927('0x12'),_0x289cf0,_0x2daddd[_0x5927('0x10')][_0x5927('0x13')]);return _0x399e55(_0x2daddd[_0x5927('0x10')][_0x5927('0x13')]);}else{logger[_0x5927('0xc')](_0x5927('0x12'),_0x289cf0,_0x5927('0xd'));_0x399e55(_0x2daddd[_0x5927('0x14')][_0x5927('0x13')]);}})['catch'](function(_0x15316a){logger[_0x5927('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x289cf0,_0x15316a);_0x21fc6f(_0x15316a);});});}
\ No newline at end of file
index e46a54c..50adf6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5087=['put','update','destroy','removeSections','delete','removeResources','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources'];(function(_0x413484,_0x20f756){var _0x4eae0e=function(_0x3c791e){while(--_0x3c791e){_0x413484['push'](_0x413484['shift']());}};_0x4eae0e(++_0x20f756);}(_0x5087,0x6a));var _0x7508=function(_0x10b317,_0x2adf32){_0x10b317=_0x10b317-0x0;var _0x1e3054=_0x5087[_0x10b317];return _0x1e3054;};'use strict';var multer=require(_0x7508('0x0'));var util=require(_0x7508('0x1'));var path=require(_0x7508('0x2'));var timeout=require('connect-timeout');var express=require(_0x7508('0x3'));var router=express[_0x7508('0x4')]();var fs_extra=require(_0x7508('0x5'));var auth=require(_0x7508('0x6'));var interaction=require(_0x7508('0x7'));var config=require(_0x7508('0x8'));var controller=require(_0x7508('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7508('0xa')]);router[_0x7508('0xb')](_0x7508('0xc'),auth[_0x7508('0xd')](),controller[_0x7508('0xe')]);router[_0x7508('0xb')](_0x7508('0xf'),auth[_0x7508('0xd')](),controller[_0x7508('0x10')]);router[_0x7508('0xb')](_0x7508('0x11'),auth[_0x7508('0xd')](),controller[_0x7508('0x12')]);router[_0x7508('0xb')](_0x7508('0x13'),auth[_0x7508('0xd')](),controller[_0x7508('0x14')]);router[_0x7508('0x15')]('/',auth[_0x7508('0xd')](),controller[_0x7508('0x16')]);router[_0x7508('0x15')](_0x7508('0x17'),auth['isAuthenticated'](),controller['clone']);router[_0x7508('0x15')](_0x7508('0x11'),auth['isAuthenticated'](),controller[_0x7508('0x18')]);router[_0x7508('0x15')]('/:id/resources',auth[_0x7508('0xd')](),controller[_0x7508('0x19')]);router[_0x7508('0x1a')]('/:id',auth[_0x7508('0xd')](),controller[_0x7508('0x1b')]);router['delete'](_0x7508('0xf'),auth['isAuthenticated'](),controller[_0x7508('0x1c')]);router['delete'](_0x7508('0x11'),auth['isAuthenticated'](),controller[_0x7508('0x1d')]);router[_0x7508('0x1e')](_0x7508('0x13'),auth['isAuthenticated'](),controller[_0x7508('0x1f')]);module[_0x7508('0x20')]=router;
\ No newline at end of file
+var _0x46ba=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','update','delete','destroy','removeSections','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5a32fc,_0x4ddbde){var _0x39f28b=function(_0xaebcaa){while(--_0xaebcaa){_0x5a32fc['push'](_0x5a32fc['shift']());}};_0x39f28b(++_0x4ddbde);}(_0x46ba,0xd9));var _0xa46b=function(_0x30d6df,_0x26549f){_0x30d6df=_0x30d6df-0x0;var _0x25cc9d=_0x46ba[_0x30d6df];return _0x25cc9d;};'use strict';var multer=require(_0xa46b('0x0'));var util=require(_0xa46b('0x1'));var path=require(_0xa46b('0x2'));var timeout=require('connect-timeout');var express=require(_0xa46b('0x3'));var router=express[_0xa46b('0x4')]();var fs_extra=require(_0xa46b('0x5'));var auth=require(_0xa46b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa46b('0x7'));var controller=require('./userProfile.controller');router[_0xa46b('0x8')]('/',auth[_0xa46b('0x9')](),controller[_0xa46b('0xa')]);router['get']('/describe',auth[_0xa46b('0x9')](),controller[_0xa46b('0xb')]);router[_0xa46b('0x8')](_0xa46b('0xc'),auth[_0xa46b('0x9')](),controller[_0xa46b('0xd')]);router['get'](_0xa46b('0xe'),auth[_0xa46b('0x9')](),controller[_0xa46b('0xf')]);router[_0xa46b('0x8')](_0xa46b('0x10'),auth['isAuthenticated'](),controller[_0xa46b('0x11')]);router[_0xa46b('0x12')]('/',auth[_0xa46b('0x9')](),controller[_0xa46b('0x13')]);router[_0xa46b('0x12')](_0xa46b('0x14'),auth[_0xa46b('0x9')](),controller[_0xa46b('0x15')]);router[_0xa46b('0x12')]('/:id/sections',auth[_0xa46b('0x9')](),controller[_0xa46b('0x16')]);router['post'](_0xa46b('0x10'),auth[_0xa46b('0x9')](),controller['addResources']);router['put']('/:id',auth[_0xa46b('0x9')](),controller[_0xa46b('0x17')]);router[_0xa46b('0x18')]('/:id',auth[_0xa46b('0x9')](),controller[_0xa46b('0x19')]);router['delete'](_0xa46b('0xe'),auth[_0xa46b('0x9')](),controller[_0xa46b('0x1a')]);router[_0xa46b('0x18')](_0xa46b('0x10'),auth[_0xa46b('0x9')](),controller['removeResources']);module[_0xa46b('0x1b')]=router;
\ No newline at end of file
index 696dca0..2a970d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf4d=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x3fe0fe,_0x3bdc49){var _0x5c11f4=function(_0x127973){while(--_0x127973){_0x3fe0fe['push'](_0x3fe0fe['shift']());}};_0x5c11f4(++_0x3bdc49);}(_0xbf4d,0x19e));var _0xdbf4=function(_0x229128,_0x273558){_0x229128=_0x229128-0x0;var _0x1875b9=_0xbf4d[_0x229128];return _0x1875b9;};'use strict';var Sequelize=require(_0xdbf4('0x0'));module[_0xdbf4('0x1')]={'name':{'type':Sequelize[_0xdbf4('0x2')],'allowNull':![],'unique':_0xdbf4('0x3')},'crudPermissions':{'type':Sequelize[_0xdbf4('0x2')],'set':function(_0x1adadc){this[_0xdbf4('0x4')](_0xdbf4('0x5'),_0x1adadc?_0x1adadc[_0xdbf4('0x6')](''):[]);},'get':function(){return this[_0xdbf4('0x7')](_0xdbf4('0x5'))?this['getDataValue'](_0xdbf4('0x5'))[_0xdbf4('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xdbf4('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xdbf4('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xdbf4('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xdbf4('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xdbf4('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xdbf4('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xdbf4('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xdbf4('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xdbf4('0x9')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1d6a=['name','crudPermissions','join','getDataValue','split','BOOLEAN','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1d6a,0x12c));var _0xa1d6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1d6a[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa1d6('0x0')],'allowNull':![],'unique':_0xa1d6('0x1')},'crudPermissions':{'type':Sequelize[_0xa1d6('0x0')],'set':function(_0x54ee4e){this['setDataValue'](_0xa1d6('0x2'),_0x54ee4e?_0x54ee4e[_0xa1d6('0x3')](''):[]);},'get':function(){return this[_0xa1d6('0x4')](_0xa1d6('0x2'))?this['getDataValue']('crudPermissions')[_0xa1d6('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa1d6('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa1d6('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa1d6('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xa1d6('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa1d6('0x6')],'defaultValue':!![]}};
\ No newline at end of file
index bf4a567..0674ae3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1ca=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','undefined','limit','offset','status','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','length','options','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','destroy','sectionId','ids','getSections','includes','subsections','enabled','push','Dashboard','forEach','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto'];(function(_0x260c74,_0x163c5e){var _0x3b55ef=function(_0x4bcb23){while(--_0x4bcb23){_0x260c74['push'](_0x260c74['shift']());}};_0x3b55ef(++_0x163c5e);}(_0xd1ca,0x140));var _0xad1c=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xd1ca[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0xad1c('0x0'));var rimraf=require(_0xad1c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xad1c('0x2'));var BPromise=require(_0xad1c('0x3'));var Mustache=require(_0xad1c('0x4'));var util=require('util');var path=require(_0xad1c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xad1c('0x6'));var fs=require('fs');var fs_extra=require(_0xad1c('0x7'));var _=require(_0xad1c('0x8'));var squel=require('squel');var crypto=require(_0xad1c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xad1c('0xa'));var toCsv=require(_0xad1c('0xb'));var querystring=require(_0xad1c('0xc'));var Papa=require(_0xad1c('0xd'));var Redis=require(_0xad1c('0xe'));var authService=require(_0xad1c('0xf'));var qs=require(_0xad1c('0x10'));var as=require(_0xad1c('0x11'));var hardwareService=require(_0xad1c('0x12'));var logger=require(_0xad1c('0x13'))('api');var utils=require(_0xad1c('0x14'));var config=require(_0xad1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xad1c('0x16'))['db'];config[_0xad1c('0x17')]=_[_0xad1c('0x18')](config[_0xad1c('0x17')],{'host':_0xad1c('0x19'),'port':0x18eb});var socket=require(_0xad1c('0x1a'))(new Redis(config[_0xad1c('0x17')]));require('./userProfile.socket')[_0xad1c('0x1b')](socket);function respondWithStatusCode(_0x3a7308,_0x1ad84a){_0x1ad84a=_0x1ad84a||0xcc;return function(_0x5b6015){if(_0x5b6015){return _0x3a7308[_0xad1c('0x1c')](_0x1ad84a);}return _0x3a7308['status'](_0x1ad84a)[_0xad1c('0x1d')]();};}function respondWithResult(_0x48c651,_0x2173e5){_0x2173e5=_0x2173e5||0xc8;return function(_0x8420de){if(_0x8420de){return _0x48c651['status'](_0x2173e5)[_0xad1c('0x1e')](_0x8420de);}};}function respondWithFilteredResult(_0x5d188a,_0xf21501){return function(_0x417112){if(_0x417112){var _0x536fc9=typeof _0xf21501['offset']===_0xad1c('0x1f')&&typeof _0xf21501[_0xad1c('0x20')]===_0xad1c('0x1f');var _0x35c246=_0x417112['count'];var _0x2db328=_0x536fc9?0x0:_0xf21501[_0xad1c('0x21')];var _0xa80469=_0x536fc9?_0x417112['count']:_0xf21501['offset']+_0xf21501[_0xad1c('0x20')];var _0x395037;if(_0xa80469>=_0x35c246){_0xa80469=_0x35c246;_0x395037=0xc8;}else{_0x395037=0xce;}_0x5d188a[_0xad1c('0x22')](_0x395037);return _0x5d188a[_0xad1c('0x23')](_0xad1c('0x24'),_0x2db328+'-'+_0xa80469+'/'+_0x35c246)[_0xad1c('0x1e')](_0x417112);}return null;};}function patchUpdates(_0x2a6953){return function(_0x581641){try{jsonpatch[_0xad1c('0x25')](_0x581641,_0x2a6953,!![]);}catch(_0xfe9e59){return BPromise[_0xad1c('0x26')](_0xfe9e59);}return _0x581641[_0xad1c('0x27')]();};}function saveUpdates(_0x42e527,_0x1f7a30){return function(_0x518a14){if(_0x518a14){return _0x518a14[_0xad1c('0x28')](_0x42e527)['then'](function(_0x3893a3){return _0x3893a3;});}return null;};}function removeEntity(_0x18bd4c,_0x3f2edc){return function(_0x156d04){if(_0x156d04){return _0x156d04['destroy']()[_0xad1c('0x29')](function(){_0x18bd4c[_0xad1c('0x22')](0xcc)[_0xad1c('0x1d')]();});}};}function handleEntityNotFound(_0x345174,_0x30abaa){return function(_0x5c1203){if(!_0x5c1203){_0x345174[_0xad1c('0x1c')](0x194);}return _0x5c1203;};}function handleError(_0x5518e0,_0x16f56c){_0x16f56c=_0x16f56c||0x1f4;return function(_0x2a70f9){logger['error'](_0x2a70f9[_0xad1c('0x2a')]);if(_0x2a70f9[_0xad1c('0x2b')]){delete _0x2a70f9[_0xad1c('0x2b')];}_0x5518e0['status'](_0x16f56c)['send'](_0x2a70f9);};}exports[_0xad1c('0x2c')]=function(_0x553367,_0x34d32c){var _0x5294f6={},_0x448b36={},_0x55d377={'count':0x0,'rows':[]};var _0xd715a3=_[_0xad1c('0x2d')](db[_0xad1c('0x2e')][_0xad1c('0x2f')],function(_0x2816d7){return{'name':_0x2816d7[_0xad1c('0x30')],'type':_0x2816d7[_0xad1c('0x31')][_0xad1c('0x32')]};});_0x448b36[_0xad1c('0x33')]=_[_0xad1c('0x2d')](_0xd715a3,'name');_0x448b36[_0xad1c('0x34')]=_[_0xad1c('0x35')](_0x553367['query']);_0x448b36[_0xad1c('0x36')]=_[_0xad1c('0x37')](_0x448b36[_0xad1c('0x33')],_0x448b36['query']);_0x5294f6['attributes']=_[_0xad1c('0x37')](_0x448b36['model'],qs[_0xad1c('0x38')](_0x553367[_0xad1c('0x34')][_0xad1c('0x38')]));_0x5294f6[_0xad1c('0x39')]=_0x5294f6[_0xad1c('0x39')]['length']?_0x5294f6[_0xad1c('0x39')]:_0x448b36[_0xad1c('0x33')];if(!_0x553367[_0xad1c('0x34')][_0xad1c('0x3a')](_0xad1c('0x3b'))){_0x5294f6['limit']=qs[_0xad1c('0x20')](_0x553367[_0xad1c('0x34')][_0xad1c('0x20')]);_0x5294f6[_0xad1c('0x21')]=qs[_0xad1c('0x21')](_0x553367[_0xad1c('0x34')][_0xad1c('0x21')]);}_0x5294f6[_0xad1c('0x3c')]=qs[_0xad1c('0x3d')](_0x553367['query'][_0xad1c('0x3d')]);_0x5294f6[_0xad1c('0x3e')]=qs[_0xad1c('0x36')](_['pick'](_0x553367[_0xad1c('0x34')],_0x448b36['filters']),_0xd715a3);if(_0x553367['query'][_0xad1c('0x3f')]){_0x5294f6[_0xad1c('0x3e')]=_[_0xad1c('0x40')](_0x5294f6[_0xad1c('0x3e')],{'$or':_[_0xad1c('0x2d')](_0xd715a3,function(_0x45ab49){if(_0x45ab49['type']!==_0xad1c('0x41')){var _0x1479c6={};_0x1479c6[_0x45ab49[_0xad1c('0x2b')]]={'$like':'%'+_0x553367['query']['filter']+'%'};return _0x1479c6;}})});}_0x5294f6=_[_0xad1c('0x40')]({},_0x5294f6,_0x553367['options']);var _0x42b7f9={'where':_0x5294f6[_0xad1c('0x3e')]};return db[_0xad1c('0x2e')][_0xad1c('0x42')](_0x42b7f9)['then'](function(_0x1b5a1a){_0x55d377[_0xad1c('0x42')]=_0x1b5a1a;if(_0x553367[_0xad1c('0x34')][_0xad1c('0x43')]){_0x5294f6[_0xad1c('0x44')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x5294f6);})['then'](function(_0x27d78d){_0x55d377[_0xad1c('0x45')]=_0x27d78d;return _0x55d377;})[_0xad1c('0x29')](respondWithFilteredResult(_0x34d32c,_0x5294f6))[_0xad1c('0x46')](handleError(_0x34d32c,null));};exports[_0xad1c('0x47')]=function(_0x297335,_0x45ca6a){var _0x41f41e={'raw':![],'where':{'id':_0x297335[_0xad1c('0x48')]['id']}},_0x2f4b2c={};_0x2f4b2c[_0xad1c('0x33')]=_[_0xad1c('0x35')](db[_0xad1c('0x2e')][_0xad1c('0x2f')]);_0x2f4b2c[_0xad1c('0x34')]=_['keys'](_0x297335[_0xad1c('0x34')]);_0x2f4b2c['filters']=_[_0xad1c('0x37')](_0x2f4b2c[_0xad1c('0x33')],_0x2f4b2c[_0xad1c('0x34')]);_0x41f41e[_0xad1c('0x39')]=_[_0xad1c('0x37')](_0x2f4b2c[_0xad1c('0x33')],qs[_0xad1c('0x38')](_0x297335['query']['fields']));_0x41f41e[_0xad1c('0x39')]=_0x41f41e[_0xad1c('0x39')][_0xad1c('0x49')]?_0x41f41e['attributes']:_0x2f4b2c[_0xad1c('0x33')];if(_0x297335['query']['includeAll']){_0x41f41e[_0xad1c('0x44')]=[{'all':!![]}];}_0x41f41e=_[_0xad1c('0x40')]({},_0x41f41e,_0x297335[_0xad1c('0x4a')]);return db[_0xad1c('0x2e')][_0xad1c('0x4b')](_0x41f41e)[_0xad1c('0x29')](handleEntityNotFound(_0x45ca6a,null))[_0xad1c('0x29')](respondWithResult(_0x45ca6a,null))['catch'](handleError(_0x45ca6a,null));};exports['create']=function(_0x3ed569,_0x35c5e7){return db[_0xad1c('0x2e')][_0xad1c('0x4c')](_0x3ed569[_0xad1c('0x4d')],{})[_0xad1c('0x29')](respondWithResult(_0x35c5e7,0xc9))['catch'](handleError(_0x35c5e7,null));};exports[_0xad1c('0x4e')]=function(_0x357c21,_0x222049){var _0x11d308={'where':{'id':_0x357c21[_0xad1c('0x48')]['id']}},_0x38848b={};_0x38848b[_0xad1c('0x33')]=_[_0xad1c('0x35')](db['UserProfile'][_0xad1c('0x2f')]);_0x11d308['attributes']=_['intersection'](_0x38848b[_0xad1c('0x33')],qs['fields'](_0x357c21[_0xad1c('0x34')][_0xad1c('0x38')]));_0x11d308[_0xad1c('0x39')]=_0x11d308[_0xad1c('0x39')][_0xad1c('0x49')]?_0x11d308[_0xad1c('0x39')]:_0x38848b[_0xad1c('0x33')];if(_0x357c21[_0xad1c('0x34')][_0xad1c('0x43')]){_0x11d308[_0xad1c('0x44')]=[{'all':!![]}];}_0x11d308=_[_0xad1c('0x40')]({},_0x11d308,_0x357c21[_0xad1c('0x4a')]);return db['UserProfile']['find'](_0x11d308)[_0xad1c('0x29')](handleEntityNotFound(_0x222049,null))[_0xad1c('0x29')](function(_0x31f356){if(_0x31f356){var _0x44a238=_0x31f356[_0xad1c('0x4f')]({'plain':!![]});_0x44a238=qs[_0xad1c('0x50')](_0x44a238,['id',_0xad1c('0x51'),_0xad1c('0x52'),_0xad1c('0x53')]);_0x357c21[_0xad1c('0x4d')]=_['omit'](_0x357c21[_0xad1c('0x4d')],['id',_0xad1c('0x51'),'updatedAt']);return db[_0xad1c('0x54')][_0xad1c('0x55')](function(_0x48f0a0){return db[_0xad1c('0x2e')][_0xad1c('0x4c')](_[_0xad1c('0x40')](_0x44a238,_0x357c21[_0xad1c('0x4d')]),{'include':_0x357c21['query'][_0xad1c('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x48f0a0})[_0xad1c('0x29')](function(_0x1a8b51){var _0x4b9de2=_0x1a8b51['get']({'plain':!![]});return db[_0xad1c('0x56')][_0xad1c('0x57')]({'where':{'userProfileId':_0x357c21[_0xad1c('0x48')]['id']},'raw':!![]})[_0xad1c('0x29')](function(_0x113e1b){if(_0x113e1b){return BPromise[_0xad1c('0x58')](_0x113e1b,function(_0x557400){return new BPromise(function(_0x4bba42,_0x160ef8){if(_0x557400[_0xad1c('0x59')]===null||_0x557400[_0xad1c('0x59')]===0x1)_0x4bba42(null);return db[_0xad1c('0x5a')][_0xad1c('0x57')]({'where':{'sectionId':_0x557400['id']},'raw':!![]})[_0xad1c('0x29')](function(_0x125ba3){var _0x4be9fe=_['map'](_0x125ba3,function(_0x5b37e5){return qs[_0xad1c('0x50')](_0x5b37e5,['id',_0xad1c('0x51'),'updatedAt','sectionId']);});_0x4bba42(_0x4be9fe);})[_0xad1c('0x46')](function(_0x16820f){_0x160ef8(_0x16820f);});})[_0xad1c('0x29')](function(_0x4d20de){var _0x371be4=qs[_0xad1c('0x50')](_0x557400,['id',_0xad1c('0x51'),_0xad1c('0x52')]);_0x371be4[_0xad1c('0x5b')]=_0x4b9de2['id'];if(_0x4d20de)_0x371be4[_0xad1c('0x5c')]=_0x4d20de;return _0x371be4;})[_0xad1c('0x29')](function(_0x1e9233){return db[_0xad1c('0x56')][_0xad1c('0x4c')](_0x1e9233,{'include':[{'model':db[_0xad1c('0x5a')],'as':_0xad1c('0x5c')}],'raw':!![],'transaction':_0x48f0a0});});})[_0xad1c('0x29')](function(){return _0x4b9de2;});}});});});}})[_0xad1c('0x29')](respondWithResult(_0x222049,0xc9))[_0xad1c('0x46')](handleError(_0x222049,null));};exports['update']=function(_0x2584f7,_0xce589d){if(_0x2584f7[_0xad1c('0x4d')]['id']){delete _0x2584f7['body']['id'];}return db['UserProfile'][_0xad1c('0x4b')]({'where':{'id':_0x2584f7[_0xad1c('0x48')]['id']}})['then'](handleEntityNotFound(_0xce589d,null))['then'](saveUpdates(_0x2584f7[_0xad1c('0x4d')],null))[_0xad1c('0x29')](respondWithResult(_0xce589d,null))[_0xad1c('0x46')](handleError(_0xce589d,null));};exports['destroy']=function(_0x11ec79,_0x42ecc0){return db[_0xad1c('0x2e')][_0xad1c('0x4b')]({'where':{'id':_0x11ec79[_0xad1c('0x48')]['id']}})['then'](handleEntityNotFound(_0x42ecc0,null))[_0xad1c('0x29')](removeEntity(_0x42ecc0,null))[_0xad1c('0x46')](handleError(_0x42ecc0,null));};exports[_0xad1c('0x5d')]=function(_0x1c7ade,_0x19588e){return db[_0xad1c('0x2e')][_0xad1c('0x5d')]()[_0xad1c('0x29')](respondWithResult(_0x19588e,null))[_0xad1c('0x46')](handleError(_0x19588e,null));};exports['addSections']=function(_0x1ef7b1,_0x4526e5){var _0xd3807f=_0x1ef7b1[_0xad1c('0x4d')];return db['UserProfile']['find']({'where':{'id':_0x1ef7b1[_0xad1c('0x48')]['id']}})[_0xad1c('0x29')](handleEntityNotFound(_0x4526e5,null))['then'](function(_0x3f800a){if(_0x3f800a){return db['sequelize'][_0xad1c('0x55')](function(_0x2213e7){return db[_0xad1c('0x56')][_0xad1c('0x5e')]({'where':{'userProfileId':_0x1ef7b1[_0xad1c('0x48')]['id'],'sectionId':_[_0xad1c('0x2d')](_0xd3807f,function(_0x12f5ea){return _0x12f5ea[_0xad1c('0x5f')];})},'transaction':_0x2213e7})[_0xad1c('0x29')](function(){var _0x66b75a=_[_0xad1c('0x2d')](_0xd3807f,function(_0x10356e){_0x10356e[_0xad1c('0x5b')]=_0x1ef7b1[_0xad1c('0x48')]['id'];return _0x10356e;});var _0x1e877a=[];return BPromise[_0xad1c('0x58')](_0x66b75a,function(_0x30e84e){return db[_0xad1c('0x56')][_0xad1c('0x4c')](_0x30e84e,{'include':[{'model':db[_0xad1c('0x5a')],'as':_0xad1c('0x5c')}],'raw':!![],'transaction':_0x2213e7})['then'](function(_0x3f0f63){_0x1e877a['push'](_0x3f0f63['get']({'plain':!![]}));});})[_0xad1c('0x29')](function(){return _0x1e877a;});});});}})[_0xad1c('0x29')](function(_0x5afebd){return _0x5afebd;})[_0xad1c('0x29')](respondWithResult(_0x4526e5,null))[_0xad1c('0x46')](handleError(_0x4526e5,null));};exports['removeSections']=function(_0x2e4a9d,_0x5c278c){var _0x5d7a88;return db[_0xad1c('0x2e')]['find']({'where':{'id':_0x2e4a9d[_0xad1c('0x48')]['id']},'attributes':['id',_0xad1c('0x2b')]})[_0xad1c('0x29')](handleEntityNotFound(_0x5c278c,null))[_0xad1c('0x29')](function(_0x2f7fae){if(_0x2f7fae){_0x5d7a88=_0x2f7fae;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2e4a9d['params']['id'],'sectionId':_0x2e4a9d[_0xad1c('0x34')][_0xad1c('0x60')]}});}})['then'](function(){return _0x5d7a88;})['then'](respondWithStatusCode(_0x5c278c,null))[_0xad1c('0x46')](handleError(_0x5c278c,null));};exports[_0xad1c('0x61')]=function(_0x53729d,_0x310bfc){var _0x10afe6=[];var _0x43170a=[];return db[_0xad1c('0x56')][_0xad1c('0x57')]({'where':{'userProfileId':_0x53729d[_0xad1c('0x48')]['id']},'raw':!![]})[_0xad1c('0x29')](function(_0x37eded){_0x10afe6=_[_0xad1c('0x3f')](_0x37eded,function(_0xe93b3){return _0xe93b3['enabled']===0x1||_[_0xad1c('0x62')]([0x3eb,0x709],_0xe93b3['sectionId']);});if(!_['isEmpty'](_0x10afe6)){return _['map'](_0x10afe6,function(_0x52937e){return _0x52937e[_0xad1c('0x5f')];});}else{return;}})[_0xad1c('0x29')](function(_0x27c792){if(_0x27c792)_0x43170a=_0x27c792;if(_[_0xad1c('0x62')](_0x43170a,0x64)){var _0x572869=_[_0xad1c('0x4b')](_0x10afe6,{'sectionId':0x64});return hasDefaultDashboard(_0x572869)[_0xad1c('0x29')](function(_0x9a924f){return _[_0xad1c('0x2d')](_0x10afe6,function(_0x50f549){if(_0x50f549['sectionId']===0x64){_0x50f549[_0xad1c('0x63')]=_0x9a924f;}return _0x50f549;});});}else{return;}})[_0xad1c('0x29')](function(_0x537b7e){if(_0x537b7e)_0x10afe6=_0x537b7e;if(_[_0xad1c('0x62')](_0x43170a,0x3eb)){var _0x3cc5d1=_[_0xad1c('0x4b')](_0x10afe6,{'sectionId':0x3eb});return getCustomDashboards(_0x3cc5d1)[_0xad1c('0x29')](function(_0xf5f219){return _[_0xad1c('0x2d')](_0x10afe6,function(_0x18e425){if(_0x3cc5d1[_0xad1c('0x64')]){if(_0x18e425[_0xad1c('0x5f')]===0x3eb){_0x18e425[_0xad1c('0x63')]=_0xf5f219;}}else{if(_0x18e425[_0xad1c('0x5f')]===0x64){_0x18e425[_0xad1c('0x63')]=_0xf5f219;}}return _0x18e425;});});}else{return;}})[_0xad1c('0x29')](function(_0x3e0e33){if(_0x3e0e33)_0x10afe6=_0x3e0e33;if(_['includes'](_0x43170a,0x709)){var _0x4b9b25=_[_0xad1c('0x4b')](_0x10afe6,{'sectionId':0x709});return getPlugins(_0x4b9b25)['then'](function(_0x454a3b){if(_0x4b9b25[_0xad1c('0x64')]){return _['map'](_0x10afe6,function(_0xf05993){if(_0xf05993[_0xad1c('0x5f')]===0x709){_0xf05993[_0xad1c('0x63')]=_0x454a3b;}return _0xf05993;});}else{var _0x18f49a={'sectionId':0x76c,'enabled':0x1,'subsections':_0x454a3b};var _0x542bf1=_[_0xad1c('0x2d')](_0x10afe6);_0x542bf1[_0xad1c('0x65')](_0x18f49a);return _0x542bf1;}});}else{return;}})[_0xad1c('0x29')](function(_0x4e8f34){if(_0x4e8f34)_0x10afe6=_0x4e8f34;return _[_0xad1c('0x3f')](_0x10afe6,['enabled',0x1]);})[_0xad1c('0x29')](respondWithResult(_0x310bfc,null))[_0xad1c('0x46')](handleError(_0x310bfc,null));};function hasDefaultDashboard(_0x356a6f){var _0xe4fb43=[0x65];return new BPromise(function(_0x53de85,_0x45f484){try{if(_0x356a6f[_0xad1c('0x59')]){_0x53de85(_0xe4fb43);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x356a6f['id']},'raw':!![]})[_0xad1c('0x29')](function(_0x4bbb8c){_0x4bbb8c?_0x53de85(_0xe4fb43):_0x53de85();});}}catch(_0x6ceabf){_0x45f484(_0x6ceabf);}});}function getCustomDashboards(_0xa59251){var _0x468f9b=[];return new BPromise(function(_0x1aac83,_0x1665d8){try{if(_0xa59251['autoAssociation']){return db[_0xad1c('0x66')][_0xad1c('0x57')]({'raw':!![]})['then'](function(_0x4bbee4){_0x4bbee4['forEach'](function(_0xd17479){_0x468f9b[_0xad1c('0x65')](_0xd17479['id']+0x1869f);});_0x1aac83(_0x468f9b);});}else{return db[_0xad1c('0x5a')][_0xad1c('0x57')]({'where':{'sectionId':_0xa59251['id']},'raw':!![]})[_0xad1c('0x29')](function(_0x1090a0){_0x1090a0[_0xad1c('0x67')](function(_0x29fb57){_0x468f9b[_0xad1c('0x65')](_0x29fb57['resourceId']+0x1869f);});_0x1aac83(_0x468f9b);});}}catch(_0x473119){_0x1665d8(_0x473119);}});}function getPlugins(_0x1ebd40){var _0x567b57=[];return new BPromise(function(_0x58068c,_0x2fd6b4){try{if(_0x1ebd40[_0xad1c('0x59')]){return db[_0xad1c('0x68')][_0xad1c('0x57')]({'raw':!![]})['then'](function(_0x5947ee){_0x5947ee[_0xad1c('0x67')](function(_0xbe146e){_0x567b57[_0xad1c('0x65')](_0xbe146e['id']+0x15b38);});_0x58068c(_0x567b57);});}else{return db['UserProfileResource'][_0xad1c('0x57')]({'where':{'sectionId':_0x1ebd40['id']},'raw':!![]})[_0xad1c('0x29')](function(_0x302870){_0x302870['forEach'](function(_0x3e4736){_0x567b57['push'](_0x3e4736['resourceId']+0x15b38);});_0x58068c(_0x567b57);});}}catch(_0x599bf4){_0x2fd6b4(_0x599bf4);}});}exports['addResources']=function(_0x12e2c2,_0xf7f5c6){return db[_0xad1c('0x2e')][_0xad1c('0x4b')]({'where':{'id':_0x12e2c2[_0xad1c('0x48')]['id']}})[_0xad1c('0x29')](handleEntityNotFound(_0xf7f5c6,null))[_0xad1c('0x29')](function(_0x24d928){if(_0x24d928){return db[_0xad1c('0x54')][_0xad1c('0x55')](function(_0x3470f8){return db[_0xad1c('0x56')][_0xad1c('0x57')]({'where':{'userProfileId':_0x12e2c2[_0xad1c('0x48')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x2ca54c){if(_0x2ca54c){return db[_0xad1c('0x56')][_0xad1c('0x5e')]({'where':{'userProfileId':_0x12e2c2[_0xad1c('0x48')]['id'],'id':_[_0xad1c('0x2d')](_0x2ca54c,function(_0x3f16b6){return _0x3f16b6['id'];})},'transaction':_0x3470f8});}})[_0xad1c('0x29')](function(_0x21fc5c){var _0xbd5766=_[_0xad1c('0x2d')](_0x12e2c2[_0xad1c('0x4d')],function(_0x25c906){_0x25c906[_0xad1c('0x5b')]=_0x12e2c2['params']['id'];return _0x25c906;});return db[_0xad1c('0x56')][_0xad1c('0x69')](_0xbd5766,{'raw':!![],'transaction':_0x3470f8});})[_0xad1c('0x29')](function(_0x516828){var _0x292ad1=_[_0xad1c('0x3f')](_[_0xad1c('0x2d')](_0x516828,function(_0x43ec00){return _0x43ec00[_0xad1c('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x292ad1){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x12e2c2[_0xad1c('0x48')]['id'],'sectionId':_[_0xad1c('0x2d')](_0x292ad1,function(_0x27f28c){return _0x27f28c[_0xad1c('0x5f')];})},'attributes':['id',_0xad1c('0x5f')],'raw':!![]})[_0xad1c('0x29')](function(_0xbc4b88){var _0x4dc0a8=_[_0xad1c('0x2d')](_0x12e2c2[_0xad1c('0x4d')],function(_0x3a38d5){_0x3a38d5[_0xad1c('0x5b')]=_0x12e2c2[_0xad1c('0x48')]['id'];return _0x3a38d5;});return db[_0xad1c('0x5a')][_0xad1c('0x69')](_0x4dc0a8,{'raw':!![],'transaction':_0x3470f8});});}})[_0xad1c('0x46')](handleError(_0xf7f5c6,null));});}})[_0xad1c('0x29')](function(_0x1bc334){var _0x59cc9c=_[_0xad1c('0x2d')](_0x1bc334,function(_0x2f0930){return _0x2f0930['get']({'plain':!![]});});})['then'](respondWithResult(_0xf7f5c6,null))['catch'](handleError(_0xf7f5c6,null));};exports[_0xad1c('0x6a')]=function(_0x1aa945,_0x358669,_0x448180){return db['UserProfile'][_0xad1c('0x4b')]({'where':{'id':_0x1aa945[_0xad1c('0x48')]['id']}})[_0xad1c('0x29')](handleEntityNotFound(_0x358669,null))['then'](function(_0x53a517){if(_0x53a517){return _0x53a517[_0xad1c('0x6a')](_0x1aa945[_0xad1c('0x34')]['ids']);}})['then'](respondWithStatusCode(_0x358669,null))[_0xad1c('0x46')](handleError(_0x358669,null));};exports[_0xad1c('0x6b')]=function(_0x79a010,_0xba6295){var _0x10f54b={};if(!_0x79a010[_0xad1c('0x34')][_0xad1c('0x6c')])throw new Error(_0xad1c('0x6d'));if(!_0x79a010['query']['hasOwnProperty'](_0xad1c('0x3b'))){_0x10f54b[_0xad1c('0x20')]=qs[_0xad1c('0x20')](_0x79a010[_0xad1c('0x34')]['limit']);_0x10f54b['offset']=qs['offset'](_0x79a010[_0xad1c('0x34')]['offset']);}return db[_0xad1c('0x2e')][_0xad1c('0x4b')]({'where':{'id':_0x79a010[_0xad1c('0x48')]['id']}})[_0xad1c('0x29')](function(_0x5e0019){if(!_0x5e0019)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x79a010[_0xad1c('0x48')]['id']);return db[_0xad1c('0x2e')]['getResources'](_0x79a010);})[_0xad1c('0x29')](respondWithFilteredResult(_0xba6295,_0x10f54b))[_0xad1c('0x46')](handleError(_0xba6295,null));};
\ No newline at end of file
+var _0x8af6=['forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','save','update','then','destroy','name','map','UserProfile','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','length','find','create','body','clone','keys','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','get','UserProfileSection','autoAssociation','Resources','UserProfileResource','describe','addSections','sectionId','push','removeSections','ids','enabled','includes','isEmpty','subsections','findOne','Dashboard'];(function(_0x168f97,_0x2e9319){var _0x1e2e11=function(_0x5a4a85){while(--_0x5a4a85){_0x168f97['push'](_0x168f97['shift']());}};_0x1e2e11(++_0x2e9319);}(_0x8af6,0x76));var _0x68af=function(_0x58efe3,_0x4bc205){_0x58efe3=_0x58efe3-0x0;var _0x4cd1e3=_0x8af6[_0x58efe3];return _0x4cd1e3;};'use strict';var emlformat=require(_0x68af('0x0'));var rimraf=require(_0x68af('0x1'));var zipdir=require(_0x68af('0x2'));var jsonpatch=require(_0x68af('0x3'));var rp=require(_0x68af('0x4'));var moment=require(_0x68af('0x5'));var BPromise=require(_0x68af('0x6'));var Mustache=require(_0x68af('0x7'));var util=require(_0x68af('0x8'));var path=require(_0x68af('0x9'));var sox=require('sox');var csv=require(_0x68af('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68af('0xb'));var _=require(_0x68af('0xc'));var squel=require(_0x68af('0xd'));var crypto=require(_0x68af('0xe'));var jsforce=require(_0x68af('0xf'));var deskjs=require(_0x68af('0x10'));var toCsv=require(_0x68af('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x68af('0x11'));var authService=require(_0x68af('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x68af('0x13'));var hardwareService=require(_0x68af('0x14'));var logger=require(_0x68af('0x15'))(_0x68af('0x16'));var utils=require(_0x68af('0x17'));var config=require(_0x68af('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x68af('0x19')]=_['defaults'](config['redis'],{'host':_0x68af('0x1a'),'port':0x18eb});var socket=require(_0x68af('0x1b'))(new Redis(config[_0x68af('0x19')]));require('./userProfile.socket')[_0x68af('0x1c')](socket);function respondWithStatusCode(_0x50f1ea,_0x3a6d18){_0x3a6d18=_0x3a6d18||0xcc;return function(_0x3c37db){if(_0x3c37db){return _0x50f1ea[_0x68af('0x1d')](_0x3a6d18);}return _0x50f1ea[_0x68af('0x1e')](_0x3a6d18)[_0x68af('0x1f')]();};}function respondWithResult(_0x58764e,_0x43c1d9){_0x43c1d9=_0x43c1d9||0xc8;return function(_0xcdf590){if(_0xcdf590){return _0x58764e[_0x68af('0x1e')](_0x43c1d9)[_0x68af('0x20')](_0xcdf590);}};}function respondWithFilteredResult(_0x59d7f3,_0x5357b1){return function(_0x3aa998){if(_0x3aa998){var _0x29ddbf=typeof _0x5357b1['offset']===_0x68af('0x21')&&typeof _0x5357b1[_0x68af('0x22')]===_0x68af('0x21');var _0x1a82f0=_0x3aa998['count'];var _0x2ed0a6=_0x29ddbf?0x0:_0x5357b1[_0x68af('0x23')];var _0x5ab38b=_0x29ddbf?_0x3aa998['count']:_0x5357b1[_0x68af('0x23')]+_0x5357b1[_0x68af('0x22')];var _0x14b930;if(_0x5ab38b>=_0x1a82f0){_0x5ab38b=_0x1a82f0;_0x14b930=0xc8;}else{_0x14b930=0xce;}_0x59d7f3[_0x68af('0x1e')](_0x14b930);return _0x59d7f3[_0x68af('0x24')](_0x68af('0x25'),_0x2ed0a6+'-'+_0x5ab38b+'/'+_0x1a82f0)['json'](_0x3aa998);}return null;};}function patchUpdates(_0x25a210){return function(_0x3c71ef){try{jsonpatch['apply'](_0x3c71ef,_0x25a210,!![]);}catch(_0x3ebd57){return BPromise['reject'](_0x3ebd57);}return _0x3c71ef[_0x68af('0x26')]();};}function saveUpdates(_0x1f0d0e,_0xa489c3){return function(_0x16e07a){if(_0x16e07a){return _0x16e07a[_0x68af('0x27')](_0x1f0d0e)[_0x68af('0x28')](function(_0x5851b9){return _0x5851b9;});}return null;};}function removeEntity(_0x514ebc,_0x29f003){return function(_0x6c175e){if(_0x6c175e){return _0x6c175e[_0x68af('0x29')]()[_0x68af('0x28')](function(){_0x514ebc[_0x68af('0x1e')](0xcc)[_0x68af('0x1f')]();});}};}function handleEntityNotFound(_0x1839f9,_0x2729fd){return function(_0x5417e9){if(!_0x5417e9){_0x1839f9[_0x68af('0x1d')](0x194);}return _0x5417e9;};}function handleError(_0x1c6011,_0xec7c01){_0xec7c01=_0xec7c01||0x1f4;return function(_0x3d1303){logger['error'](_0x3d1303['stack']);if(_0x3d1303[_0x68af('0x2a')]){delete _0x3d1303[_0x68af('0x2a')];}_0x1c6011[_0x68af('0x1e')](_0xec7c01)['send'](_0x3d1303);};}exports['index']=function(_0x3c3268,_0x135dc1){var _0x5c0adb={},_0x718b39={},_0x2d5aac={'count':0x0,'rows':[]};var _0x21b677=_[_0x68af('0x2b')](db[_0x68af('0x2c')][_0x68af('0x2d')],function(_0x18120e){return{'name':_0x18120e['fieldName'],'type':_0x18120e[_0x68af('0x2e')][_0x68af('0x2f')]};});_0x718b39[_0x68af('0x30')]=_['map'](_0x21b677,_0x68af('0x2a'));_0x718b39[_0x68af('0x31')]=_['keys'](_0x3c3268[_0x68af('0x31')]);_0x718b39[_0x68af('0x32')]=_['intersection'](_0x718b39[_0x68af('0x30')],_0x718b39['query']);_0x5c0adb['attributes']=_[_0x68af('0x33')](_0x718b39[_0x68af('0x30')],qs[_0x68af('0x34')](_0x3c3268[_0x68af('0x31')][_0x68af('0x34')]));_0x5c0adb[_0x68af('0x35')]=_0x5c0adb['attributes']['length']?_0x5c0adb['attributes']:_0x718b39[_0x68af('0x30')];if(!_0x3c3268[_0x68af('0x31')]['hasOwnProperty'](_0x68af('0x36'))){_0x5c0adb[_0x68af('0x22')]=qs[_0x68af('0x22')](_0x3c3268['query'][_0x68af('0x22')]);_0x5c0adb[_0x68af('0x23')]=qs[_0x68af('0x23')](_0x3c3268[_0x68af('0x31')][_0x68af('0x23')]);}_0x5c0adb['order']=qs[_0x68af('0x37')](_0x3c3268[_0x68af('0x31')][_0x68af('0x37')]);_0x5c0adb[_0x68af('0x38')]=qs[_0x68af('0x32')](_[_0x68af('0x39')](_0x3c3268[_0x68af('0x31')],_0x718b39[_0x68af('0x32')]),_0x21b677);if(_0x3c3268[_0x68af('0x31')][_0x68af('0x3a')]){_0x5c0adb['where']=_[_0x68af('0x3b')](_0x5c0adb[_0x68af('0x38')],{'$or':_['map'](_0x21b677,function(_0x3ba003){if(_0x3ba003[_0x68af('0x2e')]!==_0x68af('0x3c')){var _0x47292c={};_0x47292c[_0x3ba003[_0x68af('0x2a')]]={'$like':'%'+_0x3c3268['query']['filter']+'%'};return _0x47292c;}})});}_0x5c0adb=_['merge']({},_0x5c0adb,_0x3c3268[_0x68af('0x3d')]);var _0x139900={'where':_0x5c0adb['where']};return db[_0x68af('0x2c')][_0x68af('0x3e')](_0x139900)[_0x68af('0x28')](function(_0x3bb630){_0x2d5aac['count']=_0x3bb630;if(_0x3c3268[_0x68af('0x31')][_0x68af('0x3f')]){_0x5c0adb[_0x68af('0x40')]=[{'all':!![]}];}return db[_0x68af('0x2c')][_0x68af('0x41')](_0x5c0adb);})[_0x68af('0x28')](function(_0x3b0953){_0x2d5aac[_0x68af('0x42')]=_0x3b0953;return _0x2d5aac;})[_0x68af('0x28')](respondWithFilteredResult(_0x135dc1,_0x5c0adb))[_0x68af('0x43')](handleError(_0x135dc1,null));};exports['show']=function(_0x52adab,_0x395cce){var _0x105243={'raw':![],'where':{'id':_0x52adab[_0x68af('0x44')]['id']}},_0x1a0b10={};_0x1a0b10[_0x68af('0x30')]=_['keys'](db[_0x68af('0x2c')][_0x68af('0x2d')]);_0x1a0b10[_0x68af('0x31')]=_['keys'](_0x52adab[_0x68af('0x31')]);_0x1a0b10[_0x68af('0x32')]=_[_0x68af('0x33')](_0x1a0b10[_0x68af('0x30')],_0x1a0b10[_0x68af('0x31')]);_0x105243[_0x68af('0x35')]=_[_0x68af('0x33')](_0x1a0b10['model'],qs[_0x68af('0x34')](_0x52adab[_0x68af('0x31')][_0x68af('0x34')]));_0x105243[_0x68af('0x35')]=_0x105243['attributes'][_0x68af('0x45')]?_0x105243[_0x68af('0x35')]:_0x1a0b10['model'];if(_0x52adab[_0x68af('0x31')]['includeAll']){_0x105243[_0x68af('0x40')]=[{'all':!![]}];}_0x105243=_['merge']({},_0x105243,_0x52adab[_0x68af('0x3d')]);return db[_0x68af('0x2c')][_0x68af('0x46')](_0x105243)[_0x68af('0x28')](handleEntityNotFound(_0x395cce,null))[_0x68af('0x28')](respondWithResult(_0x395cce,null))[_0x68af('0x43')](handleError(_0x395cce,null));};exports[_0x68af('0x47')]=function(_0x3b43a6,_0x3544d5){return db[_0x68af('0x2c')][_0x68af('0x47')](_0x3b43a6[_0x68af('0x48')],{})['then'](respondWithResult(_0x3544d5,0xc9))[_0x68af('0x43')](handleError(_0x3544d5,null));};exports[_0x68af('0x49')]=function(_0x4d44cd,_0x2bce28){var _0x472868={'where':{'id':_0x4d44cd['params']['id']}},_0x46a1f0={};_0x46a1f0[_0x68af('0x30')]=_[_0x68af('0x4a')](db[_0x68af('0x2c')][_0x68af('0x2d')]);_0x472868[_0x68af('0x35')]=_['intersection'](_0x46a1f0[_0x68af('0x30')],qs[_0x68af('0x34')](_0x4d44cd[_0x68af('0x31')][_0x68af('0x34')]));_0x472868[_0x68af('0x35')]=_0x472868[_0x68af('0x35')][_0x68af('0x45')]?_0x472868[_0x68af('0x35')]:_0x46a1f0[_0x68af('0x30')];if(_0x4d44cd[_0x68af('0x31')]['includeAll']){_0x472868[_0x68af('0x40')]=[{'all':!![]}];}_0x472868=_[_0x68af('0x3b')]({},_0x472868,_0x4d44cd[_0x68af('0x3d')]);return db[_0x68af('0x2c')][_0x68af('0x46')](_0x472868)[_0x68af('0x28')](handleEntityNotFound(_0x2bce28,null))['then'](function(_0x5ca2ae){if(_0x5ca2ae){var _0x433d50=_0x5ca2ae['get']({'plain':!![]});_0x433d50=qs['omit'](_0x433d50,['id',_0x68af('0x4b'),_0x68af('0x4c'),_0x68af('0x4d')]);_0x4d44cd[_0x68af('0x48')]=_[_0x68af('0x4e')](_0x4d44cd[_0x68af('0x48')],['id',_0x68af('0x4b'),'updatedAt']);return db[_0x68af('0x4f')][_0x68af('0x50')](function(_0x255e1c){return db[_0x68af('0x2c')][_0x68af('0x47')](_[_0x68af('0x3b')](_0x433d50,_0x4d44cd[_0x68af('0x48')]),{'include':_0x4d44cd[_0x68af('0x31')][_0x68af('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x255e1c})['then'](function(_0x367685){var _0x2706a4=_0x367685[_0x68af('0x51')]({'plain':!![]});return db[_0x68af('0x52')][_0x68af('0x41')]({'where':{'userProfileId':_0x4d44cd[_0x68af('0x44')]['id']},'raw':!![]})['then'](function(_0x1f2ba6){if(_0x1f2ba6){return BPromise['each'](_0x1f2ba6,function(_0x2fea5f){return new BPromise(function(_0x4ee21b,_0x5e6aca){if(_0x2fea5f['autoAssociation']===null||_0x2fea5f[_0x68af('0x53')]===0x1)_0x4ee21b(null);return db['UserProfileResource'][_0x68af('0x41')]({'where':{'sectionId':_0x2fea5f['id']},'raw':!![]})[_0x68af('0x28')](function(_0x39388f){var _0x137d3e=_[_0x68af('0x2b')](_0x39388f,function(_0x162961){return qs[_0x68af('0x4e')](_0x162961,['id','createdAt',_0x68af('0x4c'),'sectionId']);});_0x4ee21b(_0x137d3e);})[_0x68af('0x43')](function(_0x37170a){_0x5e6aca(_0x37170a);});})[_0x68af('0x28')](function(_0x588453){var _0x3d57ca=qs[_0x68af('0x4e')](_0x2fea5f,['id',_0x68af('0x4b'),_0x68af('0x4c')]);_0x3d57ca['userProfileId']=_0x2706a4['id'];if(_0x588453)_0x3d57ca[_0x68af('0x54')]=_0x588453;return _0x3d57ca;})['then'](function(_0x20d912){return db['UserProfileSection'][_0x68af('0x47')](_0x20d912,{'include':[{'model':db[_0x68af('0x55')],'as':_0x68af('0x54')}],'raw':!![],'transaction':_0x255e1c});});})['then'](function(){return _0x2706a4;});}});});});}})[_0x68af('0x28')](respondWithResult(_0x2bce28,0xc9))[_0x68af('0x43')](handleError(_0x2bce28,null));};exports[_0x68af('0x27')]=function(_0x36b9ae,_0x55c62a){if(_0x36b9ae[_0x68af('0x48')]['id']){delete _0x36b9ae['body']['id'];}return db[_0x68af('0x2c')]['find']({'where':{'id':_0x36b9ae['params']['id']}})[_0x68af('0x28')](handleEntityNotFound(_0x55c62a,null))['then'](saveUpdates(_0x36b9ae[_0x68af('0x48')],null))['then'](respondWithResult(_0x55c62a,null))[_0x68af('0x43')](handleError(_0x55c62a,null));};exports[_0x68af('0x29')]=function(_0x4d3587,_0x21260a){return db[_0x68af('0x2c')]['find']({'where':{'id':_0x4d3587[_0x68af('0x44')]['id']}})[_0x68af('0x28')](handleEntityNotFound(_0x21260a,null))[_0x68af('0x28')](removeEntity(_0x21260a,null))[_0x68af('0x43')](handleError(_0x21260a,null));};exports[_0x68af('0x56')]=function(_0x5bb1e8,_0x2f7a3a){return db[_0x68af('0x2c')][_0x68af('0x56')]()[_0x68af('0x28')](respondWithResult(_0x2f7a3a,null))[_0x68af('0x43')](handleError(_0x2f7a3a,null));};exports[_0x68af('0x57')]=function(_0x125d2a,_0x183349){var _0x2d814a=_0x125d2a['body'];return db[_0x68af('0x2c')]['find']({'where':{'id':_0x125d2a[_0x68af('0x44')]['id']}})[_0x68af('0x28')](handleEntityNotFound(_0x183349,null))[_0x68af('0x28')](function(_0x4b23e6){if(_0x4b23e6){return db[_0x68af('0x4f')][_0x68af('0x50')](function(_0x4e1f0e){return db[_0x68af('0x52')][_0x68af('0x29')]({'where':{'userProfileId':_0x125d2a[_0x68af('0x44')]['id'],'sectionId':_[_0x68af('0x2b')](_0x2d814a,function(_0x5dbf33){return _0x5dbf33[_0x68af('0x58')];})},'transaction':_0x4e1f0e})[_0x68af('0x28')](function(){var _0x1acb3e=_[_0x68af('0x2b')](_0x2d814a,function(_0x51b055){_0x51b055['userProfileId']=_0x125d2a[_0x68af('0x44')]['id'];return _0x51b055;});var _0x44418f=[];return BPromise['each'](_0x1acb3e,function(_0x351d52){return db[_0x68af('0x52')][_0x68af('0x47')](_0x351d52,{'include':[{'model':db[_0x68af('0x55')],'as':_0x68af('0x54')}],'raw':!![],'transaction':_0x4e1f0e})['then'](function(_0x22cd4c){_0x44418f[_0x68af('0x59')](_0x22cd4c[_0x68af('0x51')]({'plain':!![]}));});})['then'](function(){return _0x44418f;});});});}})[_0x68af('0x28')](function(_0x290f64){return _0x290f64;})['then'](respondWithResult(_0x183349,null))['catch'](handleError(_0x183349,null));};exports[_0x68af('0x5a')]=function(_0x3e837d,_0x2e61f9){var _0x324205;return db['UserProfile'][_0x68af('0x46')]({'where':{'id':_0x3e837d['params']['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x2e61f9,null))[_0x68af('0x28')](function(_0x56cadf){if(_0x56cadf){_0x324205=_0x56cadf;return db['UserProfileSection'][_0x68af('0x29')]({'where':{'userProfileId':_0x3e837d[_0x68af('0x44')]['id'],'sectionId':_0x3e837d[_0x68af('0x31')][_0x68af('0x5b')]}});}})[_0x68af('0x28')](function(){return _0x324205;})[_0x68af('0x28')](respondWithStatusCode(_0x2e61f9,null))[_0x68af('0x43')](handleError(_0x2e61f9,null));};exports['getSections']=function(_0x36d27e,_0x2643a1){var _0x2f6a9c=[];var _0x4cd9b3=[];return db[_0x68af('0x52')]['findAll']({'where':{'userProfileId':_0x36d27e[_0x68af('0x44')]['id']},'raw':!![]})[_0x68af('0x28')](function(_0x10521b){_0x2f6a9c=_[_0x68af('0x3a')](_0x10521b,function(_0x270392){return _0x270392[_0x68af('0x5c')]===0x1||_[_0x68af('0x5d')]([0x3eb,0x709],_0x270392[_0x68af('0x58')]);});if(!_[_0x68af('0x5e')](_0x2f6a9c)){return _[_0x68af('0x2b')](_0x2f6a9c,function(_0x3e8660){return _0x3e8660[_0x68af('0x58')];});}else{return;}})[_0x68af('0x28')](function(_0x576e9d){if(_0x576e9d)_0x4cd9b3=_0x576e9d;if(_[_0x68af('0x5d')](_0x4cd9b3,0x64)){var _0x3b1fec=_['find'](_0x2f6a9c,{'sectionId':0x64});return hasDefaultDashboard(_0x3b1fec)[_0x68af('0x28')](function(_0x20b73b){return _[_0x68af('0x2b')](_0x2f6a9c,function(_0x469711){if(_0x469711[_0x68af('0x58')]===0x64){_0x469711[_0x68af('0x5f')]=_0x20b73b;}return _0x469711;});});}else{return;}})['then'](function(_0x43dc7b){if(_0x43dc7b)_0x2f6a9c=_0x43dc7b;if(_[_0x68af('0x5d')](_0x4cd9b3,0x3eb)){var _0x387f2d=_['find'](_0x2f6a9c,{'sectionId':0x3eb});return getCustomDashboards(_0x387f2d)['then'](function(_0x1bebe1){return _[_0x68af('0x2b')](_0x2f6a9c,function(_0x126ece){if(_0x387f2d['enabled']){if(_0x126ece[_0x68af('0x58')]===0x3eb){_0x126ece[_0x68af('0x5f')]=_0x1bebe1;}}else{if(_0x126ece[_0x68af('0x58')]===0x64){_0x126ece[_0x68af('0x5f')]=_0x1bebe1;}}return _0x126ece;});});}else{return;}})['then'](function(_0x2eea52){if(_0x2eea52)_0x2f6a9c=_0x2eea52;if(_[_0x68af('0x5d')](_0x4cd9b3,0x709)){var _0x2bbd03=_[_0x68af('0x46')](_0x2f6a9c,{'sectionId':0x709});return getPlugins(_0x2bbd03)[_0x68af('0x28')](function(_0x4d2fca){if(_0x2bbd03[_0x68af('0x5c')]){return _[_0x68af('0x2b')](_0x2f6a9c,function(_0x3c6c97){if(_0x3c6c97['sectionId']===0x709){_0x3c6c97[_0x68af('0x5f')]=_0x4d2fca;}return _0x3c6c97;});}else{var _0x226d1f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4d2fca};var _0x216506=_[_0x68af('0x2b')](_0x2f6a9c);_0x216506[_0x68af('0x59')](_0x226d1f);return _0x216506;}});}else{return;}})[_0x68af('0x28')](function(_0x58901d){if(_0x58901d)_0x2f6a9c=_0x58901d;return _[_0x68af('0x3a')](_0x2f6a9c,[_0x68af('0x5c'),0x1]);})[_0x68af('0x28')](respondWithResult(_0x2643a1,null))['catch'](handleError(_0x2643a1,null));};function hasDefaultDashboard(_0x56404f){var _0x470804=[0x65];return new BPromise(function(_0x42b58d,_0x1ce09a){try{if(_0x56404f[_0x68af('0x53')]){_0x42b58d(_0x470804);}else{return db['UserProfileResource'][_0x68af('0x60')]({'where':{'sectionId':_0x56404f['id']},'raw':!![]})[_0x68af('0x28')](function(_0x4a2797){_0x4a2797?_0x42b58d(_0x470804):_0x42b58d();});}}catch(_0x584796){_0x1ce09a(_0x584796);}});}function getCustomDashboards(_0x3a348c){var _0x1f77c1=[];return new BPromise(function(_0x5dc173,_0x220fe8){try{if(_0x3a348c[_0x68af('0x53')]){return db[_0x68af('0x61')][_0x68af('0x41')]({'raw':!![]})['then'](function(_0x12a8c2){_0x12a8c2[_0x68af('0x62')](function(_0x53cad0){_0x1f77c1['push'](_0x53cad0['id']+0x1869f);});_0x5dc173(_0x1f77c1);});}else{return db[_0x68af('0x55')][_0x68af('0x41')]({'where':{'sectionId':_0x3a348c['id']},'raw':!![]})['then'](function(_0x3f97ad){_0x3f97ad['forEach'](function(_0x2dcaaa){_0x1f77c1['push'](_0x2dcaaa['resourceId']+0x1869f);});_0x5dc173(_0x1f77c1);});}}catch(_0x5babfa){_0x220fe8(_0x5babfa);}});}function getPlugins(_0x8c5d55){var _0x31b589=[];return new BPromise(function(_0x3c3313,_0x3749f2){try{if(_0x8c5d55[_0x68af('0x53')]){return db['Plugin'][_0x68af('0x41')]({'raw':!![]})[_0x68af('0x28')](function(_0x47948b){_0x47948b[_0x68af('0x62')](function(_0x160a65){_0x31b589['push'](_0x160a65['id']+0x15b38);});_0x3c3313(_0x31b589);});}else{return db[_0x68af('0x55')][_0x68af('0x41')]({'where':{'sectionId':_0x8c5d55['id']},'raw':!![]})[_0x68af('0x28')](function(_0xc9e13a){_0xc9e13a['forEach'](function(_0x31ebb5){_0x31b589[_0x68af('0x59')](_0x31ebb5[_0x68af('0x63')]+0x15b38);});_0x3c3313(_0x31b589);});}}catch(_0x4b0616){_0x3749f2(_0x4b0616);}});}exports[_0x68af('0x64')]=function(_0x3d8421,_0x258677){return db[_0x68af('0x2c')][_0x68af('0x46')]({'where':{'id':_0x3d8421[_0x68af('0x44')]['id']}})[_0x68af('0x28')](handleEntityNotFound(_0x258677,null))['then'](function(_0xadc4e2){if(_0xadc4e2){return db['sequelize'][_0x68af('0x50')](function(_0x48f249){return db[_0x68af('0x52')][_0x68af('0x41')]({'where':{'userProfileId':_0x3d8421[_0x68af('0x44')]['id']},'attributes':['id'],'raw':!![]})[_0x68af('0x28')](function(_0x414566){if(_0x414566){return db[_0x68af('0x52')][_0x68af('0x29')]({'where':{'userProfileId':_0x3d8421[_0x68af('0x44')]['id'],'id':_[_0x68af('0x2b')](_0x414566,function(_0x1339c0){return _0x1339c0['id'];})},'transaction':_0x48f249});}})['then'](function(_0x3afa1e){var _0x5580a3=_[_0x68af('0x2b')](_0x3d8421[_0x68af('0x48')],function(_0x39451d){_0x39451d['userProfileId']=_0x3d8421[_0x68af('0x44')]['id'];return _0x39451d;});return db['UserProfileSection']['bulkCreate'](_0x5580a3,{'raw':!![],'transaction':_0x48f249});})[_0x68af('0x28')](function(_0x2357c8){var _0x1e7a6a=_['filter'](_[_0x68af('0x2b')](_0x2357c8,function(_0x544979){return _0x544979[_0x68af('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x1e7a6a){return db[_0x68af('0x52')][_0x68af('0x41')]({'where':{'userProfileId':_0x3d8421[_0x68af('0x44')]['id'],'sectionId':_[_0x68af('0x2b')](_0x1e7a6a,function(_0x1138bd){return _0x1138bd['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x68af('0x28')](function(_0x3dbea6){var _0x3a68d8=_[_0x68af('0x2b')](_0x3d8421[_0x68af('0x48')],function(_0x1a845f){_0x1a845f['userProfileId']=_0x3d8421['params']['id'];return _0x1a845f;});return db[_0x68af('0x55')][_0x68af('0x65')](_0x3a68d8,{'raw':!![],'transaction':_0x48f249});});}})[_0x68af('0x43')](handleError(_0x258677,null));});}})[_0x68af('0x28')](function(_0x4e18ec){var _0x4b1f2c=_[_0x68af('0x2b')](_0x4e18ec,function(_0xe7205d){return _0xe7205d[_0x68af('0x51')]({'plain':!![]});});})[_0x68af('0x28')](respondWithResult(_0x258677,null))[_0x68af('0x43')](handleError(_0x258677,null));};exports['removeResources']=function(_0x3a72a0,_0x1714a9,_0x148a17){return db['UserProfile'][_0x68af('0x46')]({'where':{'id':_0x3a72a0['params']['id']}})[_0x68af('0x28')](handleEntityNotFound(_0x1714a9,null))[_0x68af('0x28')](function(_0xaa0fd8){if(_0xaa0fd8){return _0xaa0fd8[_0x68af('0x66')](_0x3a72a0['query'][_0x68af('0x5b')]);}})[_0x68af('0x28')](respondWithStatusCode(_0x1714a9,null))[_0x68af('0x43')](handleError(_0x1714a9,null));};exports[_0x68af('0x67')]=function(_0xc2cfe7,_0x1f2fe8){var _0xd51acf={};if(!_0xc2cfe7['query'][_0x68af('0x68')])throw new Error(_0x68af('0x69'));if(!_0xc2cfe7['query'][_0x68af('0x6a')](_0x68af('0x36'))){_0xd51acf[_0x68af('0x22')]=qs['limit'](_0xc2cfe7[_0x68af('0x31')][_0x68af('0x22')]);_0xd51acf[_0x68af('0x23')]=qs[_0x68af('0x23')](_0xc2cfe7[_0x68af('0x31')][_0x68af('0x23')]);}return db['UserProfile']['find']({'where':{'id':_0xc2cfe7[_0x68af('0x44')]['id']}})[_0x68af('0x28')](function(_0x52d79e){if(!_0x52d79e)throw new Error(_0x68af('0x6b')+_0xc2cfe7[_0x68af('0x44')]['id']);return db['UserProfile'][_0x68af('0x67')](_0xc2cfe7);})['then'](respondWithFilteredResult(_0x1f2fe8,_0xd51acf))[_0x68af('0x43')](handleError(_0x1f2fe8,null));};
\ No newline at end of file
index ec0347e..76a8764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2484=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x22409d,_0x2426ba){var _0x135467=function(_0x12d608){while(--_0x12d608){_0x22409d['push'](_0x22409d['shift']());}};_0x135467(++_0x2426ba);}(_0x2484,0x178));var _0x4248=function(_0x3592ab,_0x4f669a){_0x3592ab=_0x3592ab-0x0;var _0x13298a=_0x2484[_0x3592ab];return _0x13298a;};'use strict';var EventEmitter=require(_0x4248('0x0'));var UserProfile=require(_0x4248('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4248('0x2')](0x0);var events={'afterCreate':_0x4248('0x3'),'afterUpdate':_0x4248('0x4'),'afterDestroy':_0x4248('0x5')};function emitEvent(_0x20f0ec){return function(_0x3f98a6,_0x42b611,_0x588b99){UserProfileEvents[_0x4248('0x6')](_0x20f0ec+':'+_0x3f98a6['id'],_0x3f98a6);UserProfileEvents[_0x4248('0x6')](_0x20f0ec,_0x3f98a6);_0x588b99(null);};}for(var e in events){if(events[_0x4248('0x7')](e)){var event=events[e];UserProfile[_0x4248('0x8')](e,emitEvent(event));}}module[_0x4248('0x9')]=UserProfileEvents;
\ No newline at end of file
+var _0xde46=['UserProfile','setMaxListeners','remove','emit','hook','events','../../mysqldb'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xde46,0x14e));var _0x6de4=function(_0x28340a,_0x205ccb){_0x28340a=_0x28340a-0x0;var _0x3dee26=_0xde46[_0x28340a];return _0x3dee26;};'use strict';var EventEmitter=require(_0x6de4('0x0'));var UserProfile=require(_0x6de4('0x1'))['db'][_0x6de4('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6de4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6de4('0x4')};function emitEvent(_0x5ddab6){return function(_0x2aec40,_0x19e9a6,_0xd7f8a7){UserProfileEvents[_0x6de4('0x5')](_0x5ddab6+':'+_0x2aec40['id'],_0x2aec40);UserProfileEvents['emit'](_0x5ddab6,_0x2aec40);_0xd7f8a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x6de4('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index 069b67c..7928f9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8de5=['key','VIRTUAL','foreignKey','forEach','options','includeAll','include','default','DefaultReports','custom','reportId','rows','count','Tag','Tags','tag','ThroughTags','color','openTabs','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','filter','field','value','findAll','then','associatedResources','catch','model','map','name','UserProfileResource','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','voicemails','VoiceMail','voicerecordings','Agents','agent','Telephones','membername','User','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','role','admin','user','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','templates','Trigger','Trunk','Variable','plugins','Plugin','AnalyticExtractedReport','metrics','AnalyticMetric','WhatsappAccount','slice','QueryTypes','SELECT','ui.','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','all','ignore','isEmpty','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','merge'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0x8de5,0xd7));var _0x58de=function(_0x59bdb6,_0x41fa35){_0x59bdb6=_0x59bdb6-0x0;var _0x144024=_0x8de5[_0x59bdb6];return _0x144024;};'use strict';var _=require(_0x58de('0x0'));var attributes=require(_0x58de('0x1'));var qs=require(_0x58de('0x2'));module[_0x58de('0x3')]=function(_0x364c63){var _0x3aa6f1=_0x364c63['models'];function _0xfa97de(_0x462ce0,_0xf1b9d9){return new Promise(function(_0x5cf370,_0x3daff5){if(!_0xf1b9d9)return _0x5cf370(null);var _0x465e76=_0xf1b9d9[_0x58de('0x4')]?{[_0xf1b9d9[_0x58de('0x4')][_0x58de('0x5')]]:_0xf1b9d9[_0x58de('0x4')][_0x58de('0x6')]}:undefined;return _0x3aa6f1[_0x462ce0][_0x58de('0x7')]({'where':_0x465e76,'raw':!![]})[_0x58de('0x8')](function(_0x8d2e43){_0xf1b9d9[_0x58de('0x9')]=_['map'](_0x8d2e43,'id');_0x5cf370(_0xf1b9d9);})[_0x58de('0xa')](function(_0x1adafc){_0x3daff5(_0x1adafc);});});}function _0x3120d1(_0x4b005e,_0x280dfa){return new Promise(function(_0x1adc2b,_0x2703de){var _0xd3cb75=_0x4b005e[_0x58de('0x4')]?{[_0x4b005e['filter'][_0x58de('0x5')]]:_0x4b005e[_0x58de('0x4')][_0x58de('0x6')]}:undefined;return _0x3aa6f1[_0x4b005e[_0x58de('0xb')]][_0x58de('0x7')]({'where':_0xd3cb75,'raw':!![]})[_0x58de('0x8')](function(_0x47c2ae){_0x280dfa[_0x58de('0x9')]=_[_0x58de('0xc')](_0x47c2ae,function(_0x3e77ca){return _0x3e77ca[_0x58de('0xd')];});_0x1adc2b(_0x280dfa);})[_0x58de('0xa')](function(_0x4e955b){_0x2703de(_0x4e955b);});});}function _0x21f018(_0x30fe80,_0x155ad9,_0x3fb038){if(!_0x155ad9)return resolve(null);return new Promise(function(_0x493df3,_0x2700c5){return _0x3aa6f1[_0x58de('0xe')][_0x58de('0x7')]({'where':{'sectionId':_0x155ad9['id']},'raw':!![]})[_0x58de('0x8')](function(_0x368716){if(_0x30fe80[_0x58de('0x5')]&&_0x30fe80[_0x58de('0x5')]!=='id'){_0x155ad9[_0x58de('0x9')]=_[_0x58de('0xc')](_0x368716,function(_0x1f4a84){return _0x1f4a84[_0x30fe80[_0x58de('0x5')]];});}else{if(_0x3fb038==='AnalyticExtractedReport'){_0x155ad9[_0x58de('0x9')]=_[_0x58de('0xc')](_0x368716,function(_0x2f282a){return{'id':_0x2f282a[_0x58de('0xf')],'type':_0x2f282a[_0x58de('0x10')]};});}else{_0x155ad9[_0x58de('0x9')]=_[_0x58de('0xc')](_0x368716,function(_0x5c2ab9){return _0x5c2ab9['resourceId'];});}}_0x493df3(_0x155ad9);})[_0x58de('0xa')](function(_0x5b0e6b){_0x2700c5(_0x5b0e6b);});});}function _0x17e2d8(_0x5c4c54,_0x20f3b0){var _0xafdccd={'parentSections':[]};switch(_0x5c4c54[_0x58de('0x11')]()){case _0x58de('0x12'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x14');break;case _0x58de('0x15'):_0xafdccd['childModel']=_0x58de('0x16');break;case _0x58de('0x17'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x18');_0xafdccd[_0x58de('0x19')]=[{'name':_0x58de('0x1a'),'field':_0x58de('0xd'),'foreignKey':_0x58de('0x1b')}];break;case _0x58de('0x1c'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x1d');break;case _0x58de('0x1e'):_0xafdccd['childModel']=_0x58de('0x1f');_0xafdccd[_0x58de('0x19')]=[{'name':_0x58de('0x20'),'field':'id','foreignKey':_0x58de('0x21')}];break;case _0x58de('0x22'):_0xafdccd['childModel']='CmList';break;case _0x58de('0x23'):_0xafdccd['childModel']=_0x58de('0x24');break;case _0x58de('0x25'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x26');break;case _0x58de('0x27'):_0xafdccd['childModel']=_0x58de('0x28');break;case _0x58de('0x29'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x2a');break;case _0x58de('0x2b'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x2c');break;case _0x58de('0x2d'):_0xafdccd['childModel']=_0x58de('0x2e');break;case _0x58de('0x2f'):case'internalroutes':case _0x58de('0x30'):_0xafdccd['childModel']=_0x58de('0x31');break;case'contexts':_0xafdccd[_0x58de('0x13')]='VoiceContext';break;case _0x58de('0x32'):_0xafdccd['childModel']=_0x58de('0x33');break;case _0x58de('0x34'):_0xafdccd[_0x58de('0x13')]='VoiceRecording';_0xafdccd['parentSections']=[{'name':_0x58de('0x35'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0x58de('0x36')]}},{'name':_0x58de('0x37'),'field':_0x58de('0xd'),'foreignKey':_0x58de('0x38'),'model':_0x58de('0x39'),'filter':{'field':'role','value':['telephone']}},{'name':_0x58de('0x3a'),'field':_0x58de('0xd'),'foreignKey':_0x58de('0x3b'),'model':_0x58de('0x3c'),'filter':{'field':_0x58de('0x10'),'value':[_0x58de('0x3d')]}},{'name':_0x58de('0x3e'),'field':'name','foreignKey':_0x58de('0x3b'),'model':_0x58de('0x3c'),'filter':{'field':_0x58de('0x10'),'value':[_0x58de('0x3f')]}}];break;case _0x58de('0x40'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x41');break;case _0x58de('0x42'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x43');break;case'voiceprefixes':_0xafdccd[_0x58de('0x13')]=_0x58de('0x44');break;case _0x58de('0x45'):_0xafdccd['childModel']=_0x58de('0x46');break;case _0x58de('0x47'):_0xafdccd[_0x58de('0x13')]='MailQueue';break;case _0x58de('0x48'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x49');break;case _0x58de('0x4a'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x4b');break;case _0x58de('0x4c'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x4d');break;case _0x58de('0x4e'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x4f');break;case _0x58de('0x50'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x51');break;case _0x58de('0x52'):_0xafdccd[_0x58de('0x13')]='SmsAccount';break;case _0x58de('0x53'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x54');break;case _0x58de('0x55'):_0xafdccd[_0x58de('0x13')]='WhatsappAccount';break;case _0x58de('0x56'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x57');break;case _0x58de('0x58'):case _0x58de('0x59'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x3c');if(_0x20f3b0){_0xafdccd[_0x58de('0x19')]=[{'name':_0x58de('0x3a')},{'name':_0x58de('0x3e')}];}break;case _0x58de('0x5a'):case _0x58de('0x5b'):case _0x58de('0x5c'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x39');if(_0x20f3b0){_0xafdccd[_0x58de('0x19')]=[{'name':_0x58de('0x5d'),'filter':{'field':_0x58de('0x5e'),'value':[_0x58de('0x5f'),_0x58de('0x60')]},'ignore':!![]},{'name':_0x58de('0x35')},{'name':_0x58de('0x37')}];}break;case'zendeskaccounts':_0xafdccd[_0x58de('0x13')]=_0x58de('0x61');break;case _0x58de('0x62'):_0xafdccd[_0x58de('0x13')]='SalesforceAccount';break;case _0x58de('0x63'):_0xafdccd['childModel']=_0x58de('0x64');break;case _0x58de('0x65'):_0xafdccd[_0x58de('0x13')]='SugarcrmAccount';break;case _0x58de('0x66'):_0xafdccd['childModel']=_0x58de('0x67');break;case'zohoaccounts':_0xafdccd['childModel']=_0x58de('0x68');break;case _0x58de('0x69'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x39');break;case _0x58de('0x6a'):_0xafdccd[_0x58de('0x13')]='CannedAnswer';break;case'dispositions':_0xafdccd[_0x58de('0x13')]=_0x58de('0x6b');break;case _0x58de('0x6c'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x6d');break;case _0x58de('0x6e'):_0xafdccd['childModel']=_0x58de('0x6f');break;case _0x58de('0x70'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x71');break;case _0x58de('0x72'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x73');break;case _0x58de('0x74'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x75');break;case'tags':_0xafdccd[_0x58de('0x13')]='Tag';break;case _0x58de('0x76'):_0xafdccd[_0x58de('0x13')]='Template';break;case'triggers':_0xafdccd[_0x58de('0x13')]=_0x58de('0x77');break;case'trunks':_0xafdccd[_0x58de('0x13')]=_0x58de('0x78');break;case'variables':_0xafdccd['childModel']=_0x58de('0x79');break;case _0x58de('0x7a'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x7b');break;case'extractedreports':_0xafdccd[_0x58de('0x13')]=_0x58de('0x7c');_0xafdccd[_0x58de('0x19')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x58de('0x7d'):_0xafdccd[_0x58de('0x13')]=_0x58de('0x7e');break;case'whatsappaccounts':_0xafdccd['childModel']=_0x58de('0x7f');break;}return _0xafdccd;}function _0x49c992(_0x56fdab,_0x3f903a){var _0x2693d1=_0x56fdab['charAt'](0x0)['toUpperCase']()+_0x56fdab[_0x58de('0x80')](0x1);var _0x5eadd5={'type':_0x3aa6f1['Sequelize'][_0x58de('0x81')][_0x58de('0x82')],'raw':!![]};return new BPromise(function(_0x41e9e6,_0x2d12d4){var _0x53188b=squel['select']()[_0x58de('0x5')](_0x58de('0x83')+_0x2693d1+'InteractionId','id')[_0x58de('0x5')](_0x58de('0x84'))[_0x58de('0x85')](_0x58de('0x86')+_0x56fdab+_0x58de('0x87'),'ui')[_0x58de('0x88')](_0x58de('0x89'),_0x3f903a['id']);return _0x3aa6f1[_0x58de('0x8a')][_0x58de('0x8b')](_0x53188b[_0x58de('0x8c')](),_0x5eadd5)[_0x58de('0x8')](function(_0x5d4b5d){_0x3f903a[_0x2693d1+'OpenTabs']=_0x5d4b5d;_0x41e9e6(_0x5d4b5d);})[_0x58de('0xa')](function(_0x15a4e9){_0x2d12d4(_0x15a4e9);});});}return _0x364c63['define'](_0x58de('0x8d'),attributes,{'tableName':_0x58de('0x8e'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x51d1a9){var _0x1555d2={'raw':![],'where':{}};var _0x4a8550={};var _0xa2910a={'count':0x0,'rows':[]};var _0x91cf32=_0x51d1a9[_0x58de('0x8b')]['section'];var _0xcee77a=_0x51d1a9[_0x58de('0x8b')][_0x58de('0x8f')]||![];var _0x957304=_0x17e2d8(_0x91cf32,_0xcee77a);if(!_0x957304[_0x58de('0x13')])throw new Error(_0x58de('0x90')+_0x91cf32+'\x27');var _0x322d13=[{'name':_0x91cf32}];if(!_['isEmpty'](_0x957304[_0x58de('0x19')]))_0x322d13=_0x957304[_0x58de('0x19')];var _0x278c0d=[];for(var _0x26dda3=0x0;_0x26dda3<_0x322d13[_0x58de('0x91')];_0x26dda3++){_0x278c0d[_0x58de('0x92')](_0x3aa6f1[_0x58de('0x93')][_0x58de('0x94')]({'where':{'userProfileId':_0x51d1a9[_0x58de('0x95')]['id'],'name':_0x322d13[_0x26dda3][_0x58de('0xd')]},'raw':!![]}));}return Promise[_0x58de('0x96')](_0x278c0d)['then'](function(_0x1127c0){var _0x597c40=_[_0x58de('0x4')](_0x1127c0,function(_0x1da409){return _0x1da409?_0x1da409:undefined;});var _0x168a63=_['filter'](_0x322d13,[_0x58de('0x97'),!![]]);var _0x351e=_['isEmpty'](_0x597c40)&&_[_0x58de('0x98')](_0x168a63)?null:_['union'](_0x168a63,_0x597c40);if(!_0x351e)return null;var _0xa5d587=[];for(var _0x2c6532=0x0;_0x2c6532<_0x351e[_0x58de('0x91')];_0x2c6532++){var _0x5b45c1=_[_0x58de('0x94')](_0x322d13,function(_0x1cd58c){return _0x351e[_0x2c6532]?_0x1cd58c[_0x58de('0xd')]===_0x351e[_0x2c6532][_0x58de('0xd')]:null;});if(_0x5b45c1){if(_0x351e[_0x2c6532][_0x58de('0x97')]){_0xa5d587[_0x58de('0x92')](_0xfa97de(_0x957304[_0x58de('0x13')],_0x351e[_0x2c6532]));}else{if(!_0x351e[_0x2c6532][_0x58de('0x99')]){_0xa5d587[_0x58de('0x92')](_0x21f018(_0x5b45c1,_0x351e[_0x2c6532],_0x957304[_0x58de('0x13')]));}else{if(_0x5b45c1[_0x58de('0xb')]){_0xa5d587[_0x58de('0x92')](_0x3120d1(_0x5b45c1,_0x351e[_0x2c6532]));}}}}}return Promise[_0x58de('0x96')](_0xa5d587);})['then'](function(_0x13cc4b){var _0x4570ec=_0x13cc4b;var _0x255183=null;if(_0x4570ec){_0x255183=_0x4570ec[_0x58de('0x91')]===0x1?_0x4570ec[0x0]:null;}if(!_0x255183&&!_0x4570ec)return _0xa2910a;var _0x1f2870=_0x3aa6f1[_0x957304[_0x58de('0x13')]][_0x58de('0x9a')];_0x4a8550[_0x58de('0xb')]=_[_0x58de('0x9b')](_0x1f2870);_0x4a8550[_0x58de('0x8b')]=_['keys'](_0x51d1a9[_0x58de('0x8b')]);_0x4a8550[_0x58de('0x9c')]=_[_0x58de('0x9d')](_0x4a8550[_0x58de('0xb')],_0x4a8550[_0x58de('0x8b')]);_0x1555d2['attributes']=_['intersection'](_0x4a8550[_0x58de('0xb')],qs[_0x58de('0x9e')](_0x51d1a9[_0x58de('0x8b')][_0x58de('0x9e')]));_0x1555d2[_0x58de('0x9f')]=_0x1555d2[_0x58de('0x9f')]['length']?_0x1555d2[_0x58de('0x9f')]:_0x4a8550[_0x58de('0xb')];if(!_0x51d1a9[_0x58de('0x8b')][_0x58de('0xa0')](_0x58de('0xa1'))){_0x1555d2[_0x58de('0xa2')]=qs['limit'](_0x51d1a9[_0x58de('0x8b')][_0x58de('0xa2')]);_0x1555d2[_0x58de('0xa3')]=qs[_0x58de('0xa3')](_0x51d1a9[_0x58de('0x8b')][_0x58de('0xa3')]);}_0x1555d2[_0x58de('0xa4')]=qs[_0x58de('0xa5')](_0x51d1a9['query'][_0x58de('0xa5')]);_0x1555d2[_0x58de('0x88')]=qs[_0x58de('0x9c')](_['pick'](_0x51d1a9['query'],_0x4a8550[_0x58de('0x9c')]));if(_0x51d1a9['query'][_0x58de('0x4')]){_0x1555d2[_0x58de('0x88')]=_[_0x58de('0xa6')](_0x1555d2['where'],{'$or':_['map'](_0x1f2870,function(_0x29f04a){if(_0x29f04a[_0x58de('0x10')][_0x58de('0xa7')]!==_0x58de('0xa8')){var _0x2846e0={};_0x2846e0[_0x29f04a[_0x58de('0x5')]]={'$like':'%'+_0x51d1a9[_0x58de('0x8b')][_0x58de('0x4')]+'%'};return _0x2846e0;}})});}var _0x2be245=[];if(_0x255183){var _0x578f64=_['find'](_0x322d13,[_0x58de('0xd'),_0x255183[_0x58de('0xd')]]);if(_0x578f64[_0x58de('0x5')]){var _0x18edf0={};if(_0x957304[_0x58de('0x13')]===_0x58de('0x7c')){_0x18edf0[_0x578f64[_0x58de('0xa9')]]=_[_0x58de('0xc')](_0x255183['associatedResources'],'id');}else{_0x18edf0[_0x578f64[_0x58de('0xa9')]]=_0x255183[_0x58de('0x9')];}_0x2be245[_0x58de('0x92')](_0x18edf0);}else{_0x1555d2[_0x58de('0x88')]['id']=_0x255183[_0x58de('0x9')];}}else{for(var _0x3c7011=0x0;_0x3c7011<_0x4570ec[_0x58de('0x91')];_0x3c7011++){var _0x578f64=_[_0x58de('0x94')](_0x322d13,[_0x58de('0xd'),_0x4570ec[_0x3c7011][_0x58de('0xd')]]);if(_0x578f64[_0x58de('0x5')]){var _0x18edf0={};_0x18edf0[_0x578f64[_0x58de('0xa9')]]=_0x4570ec[_0x3c7011]['associatedResources'];_0x2be245['push'](_0x18edf0);}else{if(!_0x1555d2[_0x58de('0x88')]['id'])_0x1555d2[_0x58de('0x88')]['id']=[];_0x4570ec[_0x3c7011][_0x58de('0x9')][_0x58de('0xaa')](function(_0x5c87b7){_0x1555d2[_0x58de('0x88')]['id'][_0x58de('0x92')](_0x5c87b7);});}}}if(!_[_0x58de('0x98')](_0x2be245)){_0x1555d2[_0x58de('0x88')]=_[_0x58de('0xa6')](_0x1555d2[_0x58de('0x88')],{'$and':{'$or':_0x2be245}});}_0x1555d2=_[_0x58de('0xa6')]({},_0x1555d2,_0x51d1a9[_0x58de('0xab')]);if(_0x255183&&!_0x255183[_0x58de('0x99')]&&_0x957304['childModel']===_0x58de('0x7c')){if(_0x51d1a9[_0x58de('0x8b')][_0x58de('0xac')]){_0x1555d2[_0x58de('0xad')]=[{'all':!![]}];}return _0x3aa6f1[_0x957304[_0x58de('0x13')]][_0x58de('0x7')](_0x1555d2)[_0x58de('0x8')](function(_0x2763a8){var _0x59aa12=[];_0x2763a8[_0x58de('0xaa')](function(_0x327a1c){var _0x2f4530;switch(_0x327a1c['reportType']){case _0x58de('0xae'):_0x2f4530=_[_0x58de('0x94')](_0x255183[_0x58de('0x9')],function(_0x4da634){return _0x4da634['id']===_0x327a1c['reportId']&&_0x4da634[_0x58de('0x10')]===_0x58de('0xaf');});break;case _0x58de('0xb0'):_0x2f4530=_[_0x58de('0x94')](_0x255183['associatedResources'],function(_0x401345){return _0x401345['id']===_0x327a1c[_0x58de('0xb1')]&&_0x401345[_0x58de('0x10')]==='CustomReports';});break;}if(_0x2f4530)_0x59aa12['push'](_0x327a1c);});_0xa2910a['count']=_0x59aa12['length'];_0xa2910a[_0x58de('0xb2')]=_0x59aa12;return _0xa2910a;});}else{return _0x3aa6f1[_0x957304[_0x58de('0x13')]]['count']({'where':_0x1555d2[_0x58de('0x88')]})[_0x58de('0x8')](function(_0x3b9762){_0xa2910a[_0x58de('0xb3')]=_0x3b9762;if(_0x51d1a9[_0x58de('0x8b')][_0x58de('0xac')]){if(_0x957304['childModel']===_0x58de('0x1f')){_0x1555d2[_0x58de('0xad')]=[{'model':_0x3aa6f1[_0x58de('0xb4')],'as':_0x58de('0xb5'),'attributes':['id',_0x58de('0xd'),'color'],'required':_0x51d1a9[_0x58de('0x8b')][_0x58de('0xb6')]?!![]:![]},{'model':_0x3aa6f1[_0x58de('0xb4')],'as':_0x58de('0xb7'),'attributes':['id',_0x58de('0xd'),_0x58de('0xb8')],'through':_0x51d1a9[_0x58de('0x8b')]['tag']?{'attributes':[],'where':{'TagId':_0x51d1a9[_0x58de('0x8b')][_0x58de('0xb6')]||undefined}}:{},'required':_0x51d1a9[_0x58de('0x8b')]['tag']?!![]:![]}];}else{_0x1555d2[_0x58de('0xad')]=[{'all':!![]}];}}return _0x3aa6f1[_0x957304[_0x58de('0x13')]]['findAll'](_0x1555d2);})[_0x58de('0x8')](function(_0x167b99){_0xa2910a['rows']=_0x167b99;if(_0x91cf32==='Agents'&&_0x51d1a9[_0x58de('0x8b')][_0x58de('0xb9')]==='true'){var _0x31c9f0=[];for(var _0x1ce9b8=0x0;_0x1ce9b8<_0xa2910a[_0x58de('0xb2')][_0x58de('0x91')];_0x1ce9b8++){_0x31c9f0[_0x58de('0x92')](_0x49c992('chat',_0xa2910a[_0x58de('0xb2')][_0x1ce9b8][_0x58de('0xba')]));_0x31c9f0[_0x58de('0x92')](_0x49c992('sms',_0xa2910a[_0x58de('0xb2')][_0x1ce9b8]['dataValues']));_0x31c9f0[_0x58de('0x92')](_0x49c992(_0x58de('0xbb'),_0xa2910a['rows'][_0x1ce9b8][_0x58de('0xba')]));_0x31c9f0['push'](_0x49c992(_0x58de('0xbc'),_0xa2910a[_0x58de('0xb2')][_0x1ce9b8]['dataValues']));_0x31c9f0['push'](_0x49c992(_0x58de('0xbd'),_0xa2910a[_0x58de('0xb2')][_0x1ce9b8][_0x58de('0xba')]));_0x31c9f0[_0x58de('0x92')](_0x49c992(_0x58de('0xbe'),_0xa2910a[_0x58de('0xb2')][_0x1ce9b8]['dataValues']));}return Promise[_0x58de('0x96')](_0x31c9f0)['then'](function(){return _0xa2910a;});}return _0xa2910a;});}});}}});};
\ No newline at end of file
+var _0x7fda=['metrics','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','all','ignore','isEmpty','union','autoAssociation','rawAttributes','keys','intersection','attributes','fields','nolimit','limit','offset','sort','filters','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','default','find','DefaultReports','CustomReports','rows','count','Tags','color','tag','ThroughTags','openTabs','true','chat','sms','fax','dataValues','mail','openchannel','lodash','./userProfile.attributes','exports','models','filter','field','value','findAll','then','map','catch','model','associatedResources','name','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','SquareOdbc','SquareRecording','parentSections','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','Telephones','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','queue','outbound','musiconholds','chanspies','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','Users','admin','user','ZendeskAccount','SalesforceAccount','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','Disposition','customdashboards','Dashboard','Interval','Pause','Schedule','tags','Tag','templates','Template','triggers','trunks','Trunk','variables','Plugin','extractedreports','reportId'];(function(_0xeb67fa,_0x4dda10){var _0x534ecb=function(_0x3d4058){while(--_0x3d4058){_0xeb67fa['push'](_0xeb67fa['shift']());}};_0x534ecb(++_0x4dda10);}(_0x7fda,0xf4));var _0xa7fd=function(_0x2d638f,_0x368a4f){_0x2d638f=_0x2d638f-0x0;var _0x4d07bd=_0x7fda[_0x2d638f];return _0x4d07bd;};'use strict';var _=require(_0xa7fd('0x0'));var attributes=require(_0xa7fd('0x1'));var qs=require('../../components/parsers/qs');module[_0xa7fd('0x2')]=function(_0x36f305){var _0x2d82a1=_0x36f305[_0xa7fd('0x3')];function _0x515c3a(_0x4115c9,_0x553dad){return new Promise(function(_0x3980d8,_0x4255c0){if(!_0x553dad)return _0x3980d8(null);var _0x57545d=_0x553dad[_0xa7fd('0x4')]?{[_0x553dad[_0xa7fd('0x4')][_0xa7fd('0x5')]]:_0x553dad[_0xa7fd('0x4')][_0xa7fd('0x6')]}:undefined;return _0x2d82a1[_0x4115c9][_0xa7fd('0x7')]({'where':_0x57545d,'raw':!![]})[_0xa7fd('0x8')](function(_0x315bf9){_0x553dad['associatedResources']=_[_0xa7fd('0x9')](_0x315bf9,'id');_0x3980d8(_0x553dad);})[_0xa7fd('0xa')](function(_0x1c71ad){_0x4255c0(_0x1c71ad);});});}function _0x5e3bd4(_0x12d4dd,_0x42353f){return new Promise(function(_0x88a76e,_0xe8ca3d){var _0x1c60f7=_0x12d4dd['filter']?{[_0x12d4dd[_0xa7fd('0x4')][_0xa7fd('0x5')]]:_0x12d4dd[_0xa7fd('0x4')][_0xa7fd('0x6')]}:undefined;return _0x2d82a1[_0x12d4dd[_0xa7fd('0xb')]][_0xa7fd('0x7')]({'where':_0x1c60f7,'raw':!![]})['then'](function(_0x4df152){_0x42353f[_0xa7fd('0xc')]=_[_0xa7fd('0x9')](_0x4df152,function(_0x4acdf5){return _0x4acdf5[_0xa7fd('0xd')];});_0x88a76e(_0x42353f);})[_0xa7fd('0xa')](function(_0x4684fa){_0xe8ca3d(_0x4684fa);});});}function _0x533bed(_0xb3b5a9,_0x2cc993,_0x5b5ac8){if(!_0x2cc993)return resolve(null);return new Promise(function(_0x13f7f0,_0xf9268f){return _0x2d82a1[_0xa7fd('0xe')][_0xa7fd('0x7')]({'where':{'sectionId':_0x2cc993['id']},'raw':!![]})[_0xa7fd('0x8')](function(_0x32be1c){if(_0xb3b5a9['field']&&_0xb3b5a9[_0xa7fd('0x5')]!=='id'){_0x2cc993[_0xa7fd('0xc')]=_['map'](_0x32be1c,function(_0x2eccfe){return _0x2eccfe[_0xb3b5a9[_0xa7fd('0x5')]];});}else{if(_0x5b5ac8===_0xa7fd('0xf')){_0x2cc993['associatedResources']=_[_0xa7fd('0x9')](_0x32be1c,function(_0x503cca){return{'id':_0x503cca[_0xa7fd('0x10')],'type':_0x503cca[_0xa7fd('0x11')]};});}else{_0x2cc993[_0xa7fd('0xc')]=_[_0xa7fd('0x9')](_0x32be1c,function(_0x1df448){return _0x1df448[_0xa7fd('0x10')];});}}_0x13f7f0(_0x2cc993);})[_0xa7fd('0xa')](function(_0x5b6e9e){_0xf9268f(_0x5b6e9e);});});}function _0x48088b(_0x22a486,_0x3b0562){var _0x302a78={'parentSections':[]};switch(_0x22a486[_0xa7fd('0x12')]()){case _0xa7fd('0x13'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x15');break;case'odbc':_0x302a78['childModel']=_0xa7fd('0x16');break;case'squarerecordings':_0x302a78['childModel']=_0xa7fd('0x17');_0x302a78[_0xa7fd('0x18')]=[{'name':'SquareProjects','field':_0xa7fd('0xd'),'foreignKey':'projectName'}];break;case'projects':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x19');break;case _0xa7fd('0x1a'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x1b');_0x302a78[_0xa7fd('0x18')]=[{'name':_0xa7fd('0x1c'),'field':'id','foreignKey':_0xa7fd('0x1d')}];break;case _0xa7fd('0x1e'):_0x302a78['childModel']=_0xa7fd('0x1f');break;case _0xa7fd('0x20'):_0x302a78[_0xa7fd('0x14')]='CmCompany';break;case _0xa7fd('0x21'):_0x302a78[_0xa7fd('0x14')]='CmCustomField';break;case _0xa7fd('0x22'):_0x302a78['childModel']=_0xa7fd('0x23');break;case'chatwebsites':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x24');break;case _0xa7fd('0x25'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x26');break;case'faxaccounts':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x27');break;case _0xa7fd('0x28'):case _0xa7fd('0x29'):case _0xa7fd('0x2a'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x2b');break;case'contexts':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x2c');break;case _0xa7fd('0x2d'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x2e');break;case _0xa7fd('0x2f'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x30');_0x302a78[_0xa7fd('0x18')]=[{'name':_0xa7fd('0x31'),'field':'name','foreignKey':_0xa7fd('0x32'),'model':_0xa7fd('0x33'),'filter':{'field':_0xa7fd('0x34'),'value':['agent']}},{'name':_0xa7fd('0x35'),'field':_0xa7fd('0xd'),'foreignKey':_0xa7fd('0x32'),'model':'User','filter':{'field':_0xa7fd('0x34'),'value':[_0xa7fd('0x36')]}},{'name':_0xa7fd('0x37'),'field':_0xa7fd('0xd'),'foreignKey':'queue','model':_0xa7fd('0x38'),'filter':{'field':'type','value':['inbound']}},{'name':_0xa7fd('0x39'),'field':_0xa7fd('0xd'),'foreignKey':_0xa7fd('0x3a'),'model':_0xa7fd('0x38'),'filter':{'field':_0xa7fd('0x11'),'value':[_0xa7fd('0x3b')]}}];break;case _0xa7fd('0x3c'):_0x302a78[_0xa7fd('0x14')]='VoiceMusicOnHold';break;case _0xa7fd('0x3d'):_0x302a78[_0xa7fd('0x14')]='VoiceChanSpy';break;case'voiceprefixes':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x3e');break;case _0xa7fd('0x3f'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x40');break;case _0xa7fd('0x41'):_0x302a78['childModel']=_0xa7fd('0x42');break;case _0xa7fd('0x43'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x44');break;case _0xa7fd('0x45'):_0x302a78[_0xa7fd('0x14')]='MailSubstatus';break;case'openchannelqueues':_0x302a78['childModel']=_0xa7fd('0x46');break;case'openchannelaccounts':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x47');break;case _0xa7fd('0x48'):_0x302a78['childModel']=_0xa7fd('0x49');break;case _0xa7fd('0x4a'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x4b');break;case _0xa7fd('0x4c'):_0x302a78[_0xa7fd('0x14')]='WhatsappQueue';break;case _0xa7fd('0x4d'):_0x302a78['childModel']=_0xa7fd('0x4e');break;case _0xa7fd('0x4f'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x50');break;case _0xa7fd('0x51'):case'queuecampaigns':_0x302a78[_0xa7fd('0x14')]='VoiceQueue';if(_0x3b0562){_0x302a78[_0xa7fd('0x18')]=[{'name':_0xa7fd('0x37')},{'name':_0xa7fd('0x39')}];}break;case'users':case'agents':case'telephones':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x33');if(_0x3b0562){_0x302a78[_0xa7fd('0x18')]=[{'name':_0xa7fd('0x52'),'filter':{'field':_0xa7fd('0x34'),'value':[_0xa7fd('0x53'),_0xa7fd('0x54')]},'ignore':!![]},{'name':'Agents'},{'name':_0xa7fd('0x35')}];}break;case'zendeskaccounts':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x55');break;case'salesforceaccounts':_0x302a78['childModel']=_0xa7fd('0x56');break;case'freshdeskaccounts':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x57');break;case'sugarcrmaccounts':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x58');break;case _0xa7fd('0x59'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x5a');break;case _0xa7fd('0x5b'):_0x302a78[_0xa7fd('0x14')]='ZohoAccount';break;case _0xa7fd('0x5c'):_0x302a78[_0xa7fd('0x14')]='User';break;case'cannedanswers':_0x302a78[_0xa7fd('0x14')]='CannedAnswer';break;case'dispositions':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x5d');break;case _0xa7fd('0x5e'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x5f');break;case'intervals':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x60');break;case'pauses':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x61');break;case'scheduler':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x62');break;case'sounds':_0x302a78[_0xa7fd('0x14')]='Sound';break;case _0xa7fd('0x63'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x64');break;case _0xa7fd('0x65'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x66');break;case _0xa7fd('0x67'):_0x302a78['childModel']='Trigger';break;case _0xa7fd('0x68'):_0x302a78['childModel']=_0xa7fd('0x69');break;case _0xa7fd('0x6a'):_0x302a78['childModel']='Variable';break;case'plugins':_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x6b');break;case _0xa7fd('0x6c'):_0x302a78['childModel']=_0xa7fd('0xf');_0x302a78[_0xa7fd('0x18')]=[{'name':'Reports','field':'id','foreignKey':_0xa7fd('0x6d')}];break;case _0xa7fd('0x6e'):_0x302a78[_0xa7fd('0x14')]='AnalyticMetric';break;case _0xa7fd('0x4d'):_0x302a78[_0xa7fd('0x14')]=_0xa7fd('0x4e');break;}return _0x302a78;}function _0x10a4e1(_0x3b9dbd,_0x34d0d3){var _0x2d817b=_0x3b9dbd['charAt'](0x0)[_0xa7fd('0x6f')]()+_0x3b9dbd[_0xa7fd('0x70')](0x1);var _0x2b9dbb={'type':_0x2d82a1[_0xa7fd('0x71')][_0xa7fd('0x72')][_0xa7fd('0x73')],'raw':!![]};return new BPromise(function(_0xc4c9c,_0x244047){var _0x112de5=squel['select']()[_0xa7fd('0x5')](_0xa7fd('0x74')+_0x2d817b+_0xa7fd('0x75'),'id')['field'](_0xa7fd('0x76'))[_0xa7fd('0x77')](_0xa7fd('0x78')+_0x3b9dbd+_0xa7fd('0x79'),'ui')[_0xa7fd('0x7a')]('ui.UserId\x20=\x20?',_0x34d0d3['id']);return _0x2d82a1[_0xa7fd('0x7b')][_0xa7fd('0x7c')](_0x112de5[_0xa7fd('0x7d')](),_0x2b9dbb)[_0xa7fd('0x8')](function(_0x26c247){_0x34d0d3[_0x2d817b+_0xa7fd('0x7e')]=_0x26c247;_0xc4c9c(_0x26c247);})[_0xa7fd('0xa')](function(_0x168c4d){_0x244047(_0x168c4d);});});}return _0x36f305[_0xa7fd('0x7f')](_0xa7fd('0x80'),attributes,{'tableName':_0xa7fd('0x81'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3285ed){var _0x579061={'raw':![],'where':{}};var _0x22449b={};var _0x21b158={'count':0x0,'rows':[]};var _0x2d6242=_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0x82')];var _0x1919ee=_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0x83')]||![];var _0x2a516c=_0x48088b(_0x2d6242,_0x1919ee);if(!_0x2a516c[_0xa7fd('0x14')])throw new Error(_0xa7fd('0x84')+_0x2d6242+'\x27');var _0x19cd16=[{'name':_0x2d6242}];if(!_['isEmpty'](_0x2a516c[_0xa7fd('0x18')]))_0x19cd16=_0x2a516c[_0xa7fd('0x18')];var _0x179e99=[];for(var _0x46e6f4=0x0;_0x46e6f4<_0x19cd16[_0xa7fd('0x85')];_0x46e6f4++){_0x179e99[_0xa7fd('0x86')](_0x2d82a1[_0xa7fd('0x87')]['find']({'where':{'userProfileId':_0x3285ed['params']['id'],'name':_0x19cd16[_0x46e6f4]['name']},'raw':!![]}));}return Promise[_0xa7fd('0x88')](_0x179e99)[_0xa7fd('0x8')](function(_0x32c490){var _0xd4aa3f=_[_0xa7fd('0x4')](_0x32c490,function(_0x5731d2){return _0x5731d2?_0x5731d2:undefined;});var _0x204992=_[_0xa7fd('0x4')](_0x19cd16,[_0xa7fd('0x89'),!![]]);var _0x1782da=_[_0xa7fd('0x8a')](_0xd4aa3f)&&_[_0xa7fd('0x8a')](_0x204992)?null:_[_0xa7fd('0x8b')](_0x204992,_0xd4aa3f);if(!_0x1782da)return null;var _0x2f58d0=[];for(var _0x2eb646=0x0;_0x2eb646<_0x1782da[_0xa7fd('0x85')];_0x2eb646++){var _0x340055=_['find'](_0x19cd16,function(_0x46c53f){return _0x1782da[_0x2eb646]?_0x46c53f[_0xa7fd('0xd')]===_0x1782da[_0x2eb646][_0xa7fd('0xd')]:null;});if(_0x340055){if(_0x1782da[_0x2eb646][_0xa7fd('0x89')]){_0x2f58d0[_0xa7fd('0x86')](_0x515c3a(_0x2a516c[_0xa7fd('0x14')],_0x1782da[_0x2eb646]));}else{if(!_0x1782da[_0x2eb646][_0xa7fd('0x8c')]){_0x2f58d0[_0xa7fd('0x86')](_0x533bed(_0x340055,_0x1782da[_0x2eb646],_0x2a516c['childModel']));}else{if(_0x340055[_0xa7fd('0xb')]){_0x2f58d0[_0xa7fd('0x86')](_0x5e3bd4(_0x340055,_0x1782da[_0x2eb646]));}}}}}return Promise[_0xa7fd('0x88')](_0x2f58d0);})[_0xa7fd('0x8')](function(_0x4367d8){var _0x333eaa=_0x4367d8;var _0x334595=null;if(_0x333eaa){_0x334595=_0x333eaa[_0xa7fd('0x85')]===0x1?_0x333eaa[0x0]:null;}if(!_0x334595&&!_0x333eaa)return _0x21b158;var _0x562f09=_0x2d82a1[_0x2a516c[_0xa7fd('0x14')]][_0xa7fd('0x8d')];_0x22449b['model']=_['keys'](_0x562f09);_0x22449b[_0xa7fd('0x7c')]=_[_0xa7fd('0x8e')](_0x3285ed[_0xa7fd('0x7c')]);_0x22449b['filters']=_[_0xa7fd('0x8f')](_0x22449b[_0xa7fd('0xb')],_0x22449b[_0xa7fd('0x7c')]);_0x579061[_0xa7fd('0x90')]=_[_0xa7fd('0x8f')](_0x22449b[_0xa7fd('0xb')],qs[_0xa7fd('0x91')](_0x3285ed['query'][_0xa7fd('0x91')]));_0x579061[_0xa7fd('0x90')]=_0x579061[_0xa7fd('0x90')][_0xa7fd('0x85')]?_0x579061[_0xa7fd('0x90')]:_0x22449b[_0xa7fd('0xb')];if(!_0x3285ed[_0xa7fd('0x7c')]['hasOwnProperty'](_0xa7fd('0x92'))){_0x579061['limit']=qs[_0xa7fd('0x93')](_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0x93')]);_0x579061[_0xa7fd('0x94')]=qs[_0xa7fd('0x94')](_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0x94')]);}_0x579061['order']=qs[_0xa7fd('0x95')](_0x3285ed[_0xa7fd('0x7c')]['sort']);_0x579061['where']=qs[_0xa7fd('0x96')](_['pick'](_0x3285ed[_0xa7fd('0x7c')],_0x22449b[_0xa7fd('0x96')]));if(_0x3285ed['query']['filter']){_0x579061['where']=_[_0xa7fd('0x97')](_0x579061[_0xa7fd('0x7a')],{'$or':_[_0xa7fd('0x9')](_0x562f09,function(_0x58b43b){if(_0x58b43b[_0xa7fd('0x11')][_0xa7fd('0x98')]!==_0xa7fd('0x99')){var _0x4b4237={};_0x4b4237[_0x58b43b['field']]={'$like':'%'+_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0x4')]+'%'};return _0x4b4237;}})});}var _0x380ae9=[];if(_0x334595){var _0x43a386=_['find'](_0x19cd16,[_0xa7fd('0xd'),_0x334595['name']]);if(_0x43a386[_0xa7fd('0x5')]){var _0x78d075={};if(_0x2a516c[_0xa7fd('0x14')]===_0xa7fd('0xf')){_0x78d075[_0x43a386['foreignKey']]=_[_0xa7fd('0x9')](_0x334595[_0xa7fd('0xc')],'id');}else{_0x78d075[_0x43a386[_0xa7fd('0x9a')]]=_0x334595[_0xa7fd('0xc')];}_0x380ae9[_0xa7fd('0x86')](_0x78d075);}else{_0x579061['where']['id']=_0x334595[_0xa7fd('0xc')];}}else{for(var _0x21776e=0x0;_0x21776e<_0x333eaa[_0xa7fd('0x85')];_0x21776e++){var _0x43a386=_['find'](_0x19cd16,['name',_0x333eaa[_0x21776e][_0xa7fd('0xd')]]);if(_0x43a386['field']){var _0x78d075={};_0x78d075[_0x43a386['foreignKey']]=_0x333eaa[_0x21776e][_0xa7fd('0xc')];_0x380ae9['push'](_0x78d075);}else{if(!_0x579061[_0xa7fd('0x7a')]['id'])_0x579061[_0xa7fd('0x7a')]['id']=[];_0x333eaa[_0x21776e][_0xa7fd('0xc')][_0xa7fd('0x9b')](function(_0x5862e2){_0x579061[_0xa7fd('0x7a')]['id'][_0xa7fd('0x86')](_0x5862e2);});}}}if(!_[_0xa7fd('0x8a')](_0x380ae9)){_0x579061[_0xa7fd('0x7a')]=_['merge'](_0x579061[_0xa7fd('0x7a')],{'$and':{'$or':_0x380ae9}});}_0x579061=_[_0xa7fd('0x97')]({},_0x579061,_0x3285ed[_0xa7fd('0x9c')]);if(_0x334595&&!_0x334595['autoAssociation']&&_0x2a516c[_0xa7fd('0x14')]==='AnalyticExtractedReport'){if(_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0x9d')]){_0x579061[_0xa7fd('0x9e')]=[{'all':!![]}];}return _0x2d82a1[_0x2a516c[_0xa7fd('0x14')]][_0xa7fd('0x7')](_0x579061)[_0xa7fd('0x8')](function(_0x35ffd6){var _0x1e8179=[];_0x35ffd6[_0xa7fd('0x9b')](function(_0x5083f6){var _0x58a31e;switch(_0x5083f6['reportType']){case _0xa7fd('0x9f'):_0x58a31e=_[_0xa7fd('0xa0')](_0x334595['associatedResources'],function(_0x42226b){return _0x42226b['id']===_0x5083f6['reportId']&&_0x42226b[_0xa7fd('0x11')]===_0xa7fd('0xa1');});break;case'custom':_0x58a31e=_[_0xa7fd('0xa0')](_0x334595[_0xa7fd('0xc')],function(_0x425e76){return _0x425e76['id']===_0x5083f6[_0xa7fd('0x6d')]&&_0x425e76[_0xa7fd('0x11')]===_0xa7fd('0xa2');});break;}if(_0x58a31e)_0x1e8179[_0xa7fd('0x86')](_0x5083f6);});_0x21b158['count']=_0x1e8179[_0xa7fd('0x85')];_0x21b158[_0xa7fd('0xa3')]=_0x1e8179;return _0x21b158;});}else{return _0x2d82a1[_0x2a516c['childModel']][_0xa7fd('0xa4')]({'where':_0x579061[_0xa7fd('0x7a')]})[_0xa7fd('0x8')](function(_0x275eaa){_0x21b158['count']=_0x275eaa;if(_0x3285ed[_0xa7fd('0x7c')]['includeAll']){if(_0x2a516c['childModel']===_0xa7fd('0x1b')){_0x579061['include']=[{'model':_0x2d82a1[_0xa7fd('0x64')],'as':_0xa7fd('0xa5'),'attributes':['id',_0xa7fd('0xd'),_0xa7fd('0xa6')],'required':_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0xa7')]?!![]:![]},{'model':_0x2d82a1[_0xa7fd('0x64')],'as':_0xa7fd('0xa8'),'attributes':['id','name','color'],'through':_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0xa7')]?{'attributes':[],'where':{'TagId':_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0xa7')]||undefined}}:{},'required':_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0xa7')]?!![]:![]}];}else{_0x579061[_0xa7fd('0x9e')]=[{'all':!![]}];}}return _0x2d82a1[_0x2a516c[_0xa7fd('0x14')]][_0xa7fd('0x7')](_0x579061);})[_0xa7fd('0x8')](function(_0x5265f1){_0x21b158[_0xa7fd('0xa3')]=_0x5265f1;if(_0x2d6242===_0xa7fd('0x31')&&_0x3285ed[_0xa7fd('0x7c')][_0xa7fd('0xa9')]===_0xa7fd('0xaa')){var _0x245054=[];for(var _0xb13261=0x0;_0xb13261<_0x21b158['rows'][_0xa7fd('0x85')];_0xb13261++){_0x245054[_0xa7fd('0x86')](_0x10a4e1(_0xa7fd('0xab'),_0x21b158[_0xa7fd('0xa3')][_0xb13261]['dataValues']));_0x245054['push'](_0x10a4e1(_0xa7fd('0xac'),_0x21b158[_0xa7fd('0xa3')][_0xb13261]['dataValues']));_0x245054['push'](_0x10a4e1(_0xa7fd('0xad'),_0x21b158[_0xa7fd('0xa3')][_0xb13261][_0xa7fd('0xae')]));_0x245054[_0xa7fd('0x86')](_0x10a4e1(_0xa7fd('0xaf'),_0x21b158[_0xa7fd('0xa3')][_0xb13261][_0xa7fd('0xae')]));_0x245054[_0xa7fd('0x86')](_0x10a4e1(_0xa7fd('0xb0'),_0x21b158[_0xa7fd('0xa3')][_0xb13261][_0xa7fd('0xae')]));_0x245054[_0xa7fd('0x86')](_0x10a4e1('whatsapp',_0x21b158[_0xa7fd('0xa3')][_0xb13261][_0xa7fd('0xae')]));}return Promise[_0xa7fd('0x88')](_0x245054)[_0xa7fd('0x8')](function(){return _0x21b158;});}return _0x21b158;});}});}}});};
\ No newline at end of file
index 40dc540..52521b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1dc=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment'];(function(_0x3556a1,_0x277fee){var _0x4a2e3d=function(_0x4bb3a3){while(--_0x4bb3a3){_0x3556a1['push'](_0x3556a1['shift']());}};_0x4a2e3d(++_0x277fee);}(_0xc1dc,0x84));var _0xcc1d=function(_0x18493e,_0xb396a){_0x18493e=_0x18493e-0x0;var _0x4d815a=_0xc1dc[_0x18493e];return _0x4d815a;};'use strict';var _=require(_0xcc1d('0x0'));var util=require(_0xcc1d('0x1'));var moment=require(_0xcc1d('0x2'));var BPromise=require('bluebird');var rs=require(_0xcc1d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc1d('0x4'))['db'];var utils=require(_0xcc1d('0x5'));var logger=require('../../config/logger')(_0xcc1d('0x6'));var config=require(_0xcc1d('0x7'));var jayson=require(_0xcc1d('0x8'));var client=jayson[_0xcc1d('0x9')][_0xcc1d('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcc1d('0xb')],{'host':_0xcc1d('0xc'),'port':0x18eb});var socket=require(_0xcc1d('0xd'))(new Redis(config[_0xcc1d('0xb')]));require(_0xcc1d('0xe'))[_0xcc1d('0xf')](socket);function respondWithRpcPromise(_0x5b6b3e,_0x2a62b7,_0x27e81c){return new BPromise(function(_0x2e0fa4,_0x1771dc){return client[_0xcc1d('0x10')](_0x5b6b3e,_0x27e81c)[_0xcc1d('0x11')](function(_0x48579e){logger[_0xcc1d('0x12')](_0xcc1d('0x13'),_0x2a62b7,'request\x20sent');logger[_0xcc1d('0x14')](_0xcc1d('0x15'),_0x2a62b7,_0xcc1d('0x16'),JSON[_0xcc1d('0x17')](_0x48579e));if(_0x48579e[_0xcc1d('0x18')]){if(_0x48579e[_0xcc1d('0x18')][_0xcc1d('0x19')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x2a62b7,_0x48579e[_0xcc1d('0x18')]['message']);return _0x1771dc(_0x48579e[_0xcc1d('0x18')][_0xcc1d('0x1a')]);}logger[_0xcc1d('0x18')](_0xcc1d('0x13'),_0x2a62b7,_0x48579e[_0xcc1d('0x18')][_0xcc1d('0x1a')]);return _0x2e0fa4(_0x48579e[_0xcc1d('0x18')][_0xcc1d('0x1a')]);}else{logger[_0xcc1d('0x12')](_0xcc1d('0x13'),_0x2a62b7,'request\x20sent');_0x2e0fa4(_0x48579e['result'][_0xcc1d('0x1a')]);}})['catch'](function(_0x1f2249){logger[_0xcc1d('0x18')](_0xcc1d('0x13'),_0x2a62b7,_0x1f2249);_0x1771dc(_0x1f2249);});});}
\ No newline at end of file
+var _0x36fe=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info','request\x20sent','debug','stringify','error','UserProfile,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x5af22d,_0x4059f7){var _0x2c627f=function(_0x14e411){while(--_0x14e411){_0x5af22d['push'](_0x5af22d['shift']());}};_0x2c627f(++_0x4059f7);}(_0x36fe,0x127));var _0xe36f=function(_0x2715cf,_0x517bb2){_0x2715cf=_0x2715cf-0x0;var _0x1bdcb8=_0x36fe[_0x2715cf];return _0x1bdcb8;};'use strict';var _=require(_0xe36f('0x0'));var util=require(_0xe36f('0x1'));var moment=require(_0xe36f('0x2'));var BPromise=require(_0xe36f('0x3'));var rs=require(_0xe36f('0x4'));var fs=require('fs');var Redis=require(_0xe36f('0x5'));var db=require(_0xe36f('0x6'))['db'];var utils=require(_0xe36f('0x7'));var logger=require(_0xe36f('0x8'))(_0xe36f('0x9'));var config=require(_0xe36f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe36f('0xb')]['http']({'port':0x232a});config[_0xe36f('0xc')]=_[_0xe36f('0xd')](config['redis'],{'host':_0xe36f('0xe'),'port':0x18eb});var socket=require(_0xe36f('0xf'))(new Redis(config['redis']));require(_0xe36f('0x10'))[_0xe36f('0x11')](socket);function respondWithRpcPromise(_0xa26c3d,_0x44bc2f,_0x3d036f){return new BPromise(function(_0x5b23ff,_0x212ff9){return client['request'](_0xa26c3d,_0x3d036f)[_0xe36f('0x12')](function(_0x2b1c1c){logger[_0xe36f('0x13')]('UserProfile,\x20%s,\x20%s',_0x44bc2f,_0xe36f('0x14'));logger[_0xe36f('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x44bc2f,_0xe36f('0x14'),JSON[_0xe36f('0x16')](_0x2b1c1c));if(_0x2b1c1c[_0xe36f('0x17')]){if(_0x2b1c1c[_0xe36f('0x17')]['code']===0x1f4){logger[_0xe36f('0x17')](_0xe36f('0x18'),_0x44bc2f,_0x2b1c1c[_0xe36f('0x17')]['message']);return _0x212ff9(_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);}logger['error'](_0xe36f('0x18'),_0x44bc2f,_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);return _0x5b23ff(_0x2b1c1c[_0xe36f('0x17')][_0xe36f('0x19')]);}else{logger[_0xe36f('0x13')]('UserProfile,\x20%s,\x20%s',_0x44bc2f,'request\x20sent');_0x5b23ff(_0x2b1c1c['result']['message']);}})[_0xe36f('0x1a')](function(_0x2d6409){logger[_0xe36f('0x17')](_0xe36f('0x18'),_0x44bc2f,_0x2d6409);_0x212ff9(_0x2d6409);});});}
\ No newline at end of file
index 18c8d5e..0a764a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x521b=['length','./userProfile.events','register'];(function(_0x5c843a,_0x5a5ec0){var _0x129977=function(_0x539ddf){while(--_0x539ddf){_0x5c843a['push'](_0x5c843a['shift']());}};_0x129977(++_0x5a5ec0);}(_0x521b,0x136));var _0xb521=function(_0x38a1e5,_0x272e02){_0x38a1e5=_0x38a1e5-0x0;var _0x5f4632=_0x521b[_0x38a1e5];return _0x5f4632;};'use strict';var UserProfileEvents=require(_0xb521('0x0'));var events=['save','remove','update'];function createListener(_0x236fb8,_0x565041){return function(_0x5cc409){_0x565041['emit'](_0x236fb8,_0x5cc409);};}function removeListener(_0x374a44,_0x299595){return function(){UserProfileEvents['removeListener'](_0x374a44,_0x299595);};}exports[_0xb521('0x1')]=function(_0x2247b2){for(var _0x2ac9f5=0x0,_0x3cf866=events[_0xb521('0x2')];_0x2ac9f5<_0x3cf866;_0x2ac9f5++){var _0x1ac6b2=events[_0x2ac9f5];var _0xc47ee1=createListener('userProfile:'+_0x1ac6b2,_0x2247b2);UserProfileEvents['on'](_0x1ac6b2,_0xc47ee1);}};
\ No newline at end of file
+var _0x1c21=['remove','removeListener','register','length','userProfile:'];(function(_0x5442b0,_0x43d009){var _0x20da77=function(_0x3386df){while(--_0x3386df){_0x5442b0['push'](_0x5442b0['shift']());}};_0x20da77(++_0x43d009);}(_0x1c21,0x17c));var _0x11c2=function(_0x2fc5be,_0x5ae57a){_0x2fc5be=_0x2fc5be-0x0;var _0x5a6a3a=_0x1c21[_0x2fc5be];return _0x5a6a3a;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0x11c2('0x0'),'update'];function createListener(_0x1429ff,_0x36c5db){return function(_0x85a178){_0x36c5db['emit'](_0x1429ff,_0x85a178);};}function removeListener(_0x508e2b,_0x21351d){return function(){UserProfileEvents[_0x11c2('0x1')](_0x508e2b,_0x21351d);};}exports[_0x11c2('0x2')]=function(_0x15a2e3){for(var _0x60af78=0x0,_0x6950a0=events[_0x11c2('0x3')];_0x60af78<_0x6950a0;_0x60af78++){var _0x158c28=events[_0x60af78];var _0x53a232=createListener(_0x11c2('0x4')+_0x158c28,_0x15a2e3);UserProfileEvents['on'](_0x158c28,_0x53a232);}};
\ No newline at end of file
index 4808eaf..f6f7af0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc07c=['describe','/:id','isAuthenticated','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','/describe'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0xc07c,0x8d));var _0xcc07=function(_0x1c54c8,_0x1efe34){_0x1c54c8=_0x1c54c8-0x0;var _0x5d983c=_0xc07c[_0x1c54c8];return _0x5d983c;};'use strict';var multer=require(_0xcc07('0x0'));var util=require('util');var path=require(_0xcc07('0x1'));var timeout=require(_0xcc07('0x2'));var express=require(_0xcc07('0x3'));var router=express[_0xcc07('0x4')]();var fs_extra=require(_0xcc07('0x5'));var auth=require(_0xcc07('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcc07('0x7'));var controller=require(_0xcc07('0x8'));router[_0xcc07('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcc07('0x9')](_0xcc07('0xa'),auth['isAuthenticated'](),controller[_0xcc07('0xb')]);router['get'](_0xcc07('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xcc07('0xd')](),controller[_0xcc07('0xe')]);router[_0xcc07('0xf')](_0xcc07('0xc'),auth['isAuthenticated'](),controller[_0xcc07('0x10')]);router['delete'](_0xcc07('0xc'),auth[_0xcc07('0xd')](),controller[_0xcc07('0x11')]);module[_0xcc07('0x12')]=router;
\ No newline at end of file
+var _0x34ad=['create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','describe','/:id','show','post'];(function(_0xa64531,_0x48c65f){var _0x1b1f42=function(_0x78e575){while(--_0x78e575){_0xa64531['push'](_0xa64531['shift']());}};_0x1b1f42(++_0x48c65f);}(_0x34ad,0x181));var _0xd34a=function(_0x24d711,_0x3cdb28){_0x24d711=_0x24d711-0x0;var _0x3491b4=_0x34ad[_0x24d711];return _0x3491b4;};'use strict';var multer=require(_0xd34a('0x0'));var util=require(_0xd34a('0x1'));var path=require(_0xd34a('0x2'));var timeout=require(_0xd34a('0x3'));var express=require('express');var router=express[_0xd34a('0x4')]();var fs_extra=require(_0xd34a('0x5'));var auth=require(_0xd34a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd34a('0x7'));var controller=require(_0xd34a('0x8'));router[_0xd34a('0x9')]('/',auth[_0xd34a('0xa')](),controller['index']);router['get']('/describe',auth[_0xd34a('0xa')](),controller[_0xd34a('0xb')]);router['get'](_0xd34a('0xc'),auth[_0xd34a('0xa')](),controller[_0xd34a('0xd')]);router[_0xd34a('0xe')]('/',auth[_0xd34a('0xa')](),controller[_0xd34a('0xf')]);router[_0xd34a('0x10')](_0xd34a('0xc'),auth[_0xd34a('0xa')](),controller[_0xd34a('0x11')]);router[_0xd34a('0x12')]('/:id',auth[_0xd34a('0xa')](),controller[_0xd34a('0x13')]);module['exports']=router;
\ No newline at end of file
index 572e609..4932718 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccd7=['INTEGER','sequelize','STRING'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xccd7,0x115));var _0x7ccd=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0xccd7[_0x5c18ef];return _0x33789d;};'use strict';var Sequelize=require(_0x7ccd('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ccd('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7ccd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7ccd('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x8a98=['exports','STRING','INTEGER','sequelize'];(function(_0x2b5ffb,_0x268de9){var _0x4c159f=function(_0x3fa4b3){while(--_0x3fa4b3){_0x2b5ffb['push'](_0x2b5ffb['shift']());}};_0x4c159f(++_0x268de9);}(_0x8a98,0xef));var _0x88a9=function(_0x51ac09,_0x383098){_0x51ac09=_0x51ac09-0x0;var _0x3f827d=_0x8a98[_0x51ac09];return _0x3f827d;};'use strict';var Sequelize=require(_0x88a9('0x0'));module[_0x88a9('0x1')]={'name':{'type':Sequelize[_0x88a9('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x88a9('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x88a9('0x2')],'allowNull':![]}};
\ No newline at end of file
index fbd10fa..737c51e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','describe','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','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','UserProfileResource','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0xaf25ae,_0x2001c1){var _0x49732d=function(_0x5b764d){while(--_0x5b764d){_0xaf25ae['push'](_0xaf25ae['shift']());}};_0x49732d(++_0x2001c1);}(_0x6d38,0x1ef));var _0x86d3=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x6d38[_0xefd519];return _0x4bb882;};'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'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['UserProfileResource'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));};exports['describe']=function(_0x5bedc6,_0x159253){return db[_0x86d3('0x26')][_0x86d3('0x44')]()[_0x86d3('0x20')](respondWithResult(_0x159253,null))[_0x86d3('0x40')](handleError(_0x159253,null));};
\ No newline at end of file
+var _0xd117=['filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','UserProfileResource','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5b3712,_0x55c33c){var _0x513549=function(_0x3cf881){while(--_0x3cf881){_0x5b3712['push'](_0x5b3712['shift']());}};_0x513549(++_0x55c33c);}(_0xd117,0x182));var _0x7d11=function(_0x4471ff,_0x4bb7de){_0x4471ff=_0x4471ff-0x0;var _0xe723ca=_0xd117[_0x4471ff];return _0xe723ca;};'use strict';var emlformat=require(_0x7d11('0x0'));var rimraf=require(_0x7d11('0x1'));var zipdir=require(_0x7d11('0x2'));var jsonpatch=require(_0x7d11('0x3'));var rp=require(_0x7d11('0x4'));var moment=require(_0x7d11('0x5'));var BPromise=require(_0x7d11('0x6'));var Mustache=require(_0x7d11('0x7'));var util=require(_0x7d11('0x8'));var path=require(_0x7d11('0x9'));var sox=require(_0x7d11('0xa'));var csv=require(_0x7d11('0xb'));var ejs=require(_0x7d11('0xc'));var fs=require('fs');var fs_extra=require(_0x7d11('0xd'));var _=require(_0x7d11('0xe'));var squel=require(_0x7d11('0xf'));var crypto=require('crypto');var jsforce=require(_0x7d11('0x10'));var deskjs=require(_0x7d11('0x11'));var toCsv=require(_0x7d11('0xb'));var querystring=require('querystring');var Papa=require(_0x7d11('0x12'));var Redis=require(_0x7d11('0x13'));var authService=require(_0x7d11('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x7d11('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d11('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d11('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4767d5,_0x471f46){_0x471f46=_0x471f46||0xcc;return function(_0x5ee572){if(_0x5ee572){return _0x4767d5[_0x7d11('0x18')](_0x471f46);}return _0x4767d5[_0x7d11('0x19')](_0x471f46)['end']();};}function respondWithResult(_0x324de5,_0x16949d){_0x16949d=_0x16949d||0xc8;return function(_0x20a2df){if(_0x20a2df){return _0x324de5[_0x7d11('0x19')](_0x16949d)[_0x7d11('0x1a')](_0x20a2df);}};}function respondWithFilteredResult(_0xeae744,_0x2a269e){return function(_0xb1669e){if(_0xb1669e){var _0x4aa795=typeof _0x2a269e[_0x7d11('0x1b')]===_0x7d11('0x1c')&&typeof _0x2a269e[_0x7d11('0x1d')]===_0x7d11('0x1c');var _0x45f916=_0xb1669e['count'];var _0x456cb9=_0x4aa795?0x0:_0x2a269e[_0x7d11('0x1b')];var _0x4d1306=_0x4aa795?_0xb1669e['count']:_0x2a269e[_0x7d11('0x1b')]+_0x2a269e['limit'];var _0x1f9990;if(_0x4d1306>=_0x45f916){_0x4d1306=_0x45f916;_0x1f9990=0xc8;}else{_0x1f9990=0xce;}_0xeae744['status'](_0x1f9990);return _0xeae744[_0x7d11('0x1e')](_0x7d11('0x1f'),_0x456cb9+'-'+_0x4d1306+'/'+_0x45f916)[_0x7d11('0x1a')](_0xb1669e);}return null;};}function patchUpdates(_0x46f662){return function(_0x30df70){try{jsonpatch[_0x7d11('0x20')](_0x30df70,_0x46f662,!![]);}catch(_0x4297f8){return BPromise[_0x7d11('0x21')](_0x4297f8);}return _0x30df70['save']();};}function saveUpdates(_0x441917,_0x4a34f4){return function(_0x58455b){if(_0x58455b){return _0x58455b['update'](_0x441917)[_0x7d11('0x22')](function(_0x3545dc){return _0x3545dc;});}return null;};}function removeEntity(_0x44476c,_0x1a7853){return function(_0x355d14){if(_0x355d14){return _0x355d14[_0x7d11('0x23')]()[_0x7d11('0x22')](function(){_0x44476c[_0x7d11('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c2b4,_0x577ca9){return function(_0x4bfa76){if(!_0x4bfa76){_0x36c2b4['sendStatus'](0x194);}return _0x4bfa76;};}function handleError(_0x3ba092,_0x59cdba){_0x59cdba=_0x59cdba||0x1f4;return function(_0x180e1e){logger[_0x7d11('0x24')](_0x180e1e[_0x7d11('0x25')]);if(_0x180e1e['name']){delete _0x180e1e[_0x7d11('0x26')];}_0x3ba092[_0x7d11('0x19')](_0x59cdba)[_0x7d11('0x27')](_0x180e1e);};}exports['index']=function(_0x601650,_0x35a789){var _0x18c049={},_0x38f1be={},_0x4c7d6a={'count':0x0,'rows':[]};var _0x1a7745=_['map'](db[_0x7d11('0x28')]['rawAttributes'],function(_0x31866d){return{'name':_0x31866d[_0x7d11('0x29')],'type':_0x31866d[_0x7d11('0x2a')]['key']};});_0x38f1be['model']=_[_0x7d11('0x2b')](_0x1a7745,_0x7d11('0x26'));_0x38f1be['query']=_[_0x7d11('0x2c')](_0x601650[_0x7d11('0x2d')]);_0x38f1be[_0x7d11('0x2e')]=_['intersection'](_0x38f1be[_0x7d11('0x2f')],_0x38f1be['query']);_0x18c049['attributes']=_[_0x7d11('0x30')](_0x38f1be['model'],qs[_0x7d11('0x31')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x31')]));_0x18c049[_0x7d11('0x32')]=_0x18c049['attributes'][_0x7d11('0x33')]?_0x18c049[_0x7d11('0x32')]:_0x38f1be['model'];if(!_0x601650['query'][_0x7d11('0x34')](_0x7d11('0x35'))){_0x18c049['limit']=qs[_0x7d11('0x1d')](_0x601650['query']['limit']);_0x18c049[_0x7d11('0x1b')]=qs['offset'](_0x601650['query'][_0x7d11('0x1b')]);}_0x18c049[_0x7d11('0x36')]=qs[_0x7d11('0x37')](_0x601650[_0x7d11('0x2d')][_0x7d11('0x37')]);_0x18c049[_0x7d11('0x38')]=qs[_0x7d11('0x2e')](_[_0x7d11('0x39')](_0x601650[_0x7d11('0x2d')],_0x38f1be[_0x7d11('0x2e')]),_0x1a7745);if(_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]){_0x18c049['where']=_[_0x7d11('0x3b')](_0x18c049['where'],{'$or':_[_0x7d11('0x2b')](_0x1a7745,function(_0x111e26){if(_0x111e26[_0x7d11('0x2a')]!==_0x7d11('0x3c')){var _0x4f8fd2={};_0x4f8fd2[_0x111e26[_0x7d11('0x26')]]={'$like':'%'+_0x601650[_0x7d11('0x2d')][_0x7d11('0x3a')]+'%'};return _0x4f8fd2;}})});}_0x18c049=_[_0x7d11('0x3b')]({},_0x18c049,_0x601650['options']);var _0x22730e={'where':_0x18c049['where']};return db[_0x7d11('0x28')]['count'](_0x22730e)[_0x7d11('0x22')](function(_0x622725){_0x4c7d6a[_0x7d11('0x3d')]=_0x622725;if(_0x601650[_0x7d11('0x2d')]['includeAll']){_0x18c049['include']=[{'all':!![]}];}return db[_0x7d11('0x28')][_0x7d11('0x3e')](_0x18c049);})['then'](function(_0x1caef9){_0x4c7d6a[_0x7d11('0x3f')]=_0x1caef9;return _0x4c7d6a;})[_0x7d11('0x22')](respondWithFilteredResult(_0x35a789,_0x18c049))[_0x7d11('0x40')](handleError(_0x35a789,null));};exports[_0x7d11('0x41')]=function(_0x2e1647,_0x47e968){var _0x25b73b={'raw':![],'where':{'id':_0x2e1647[_0x7d11('0x42')]['id']}},_0x5cf6a6={};_0x5cf6a6[_0x7d11('0x2f')]=_[_0x7d11('0x2c')](db[_0x7d11('0x28')][_0x7d11('0x43')]);_0x5cf6a6[_0x7d11('0x2d')]=_['keys'](_0x2e1647['query']);_0x5cf6a6['filters']=_[_0x7d11('0x30')](_0x5cf6a6[_0x7d11('0x2f')],_0x5cf6a6[_0x7d11('0x2d')]);_0x25b73b[_0x7d11('0x32')]=_[_0x7d11('0x30')](_0x5cf6a6['model'],qs[_0x7d11('0x31')](_0x2e1647[_0x7d11('0x2d')]['fields']));_0x25b73b[_0x7d11('0x32')]=_0x25b73b[_0x7d11('0x32')][_0x7d11('0x33')]?_0x25b73b['attributes']:_0x5cf6a6[_0x7d11('0x2f')];if(_0x2e1647[_0x7d11('0x2d')][_0x7d11('0x44')]){_0x25b73b['include']=[{'all':!![]}];}_0x25b73b=_[_0x7d11('0x3b')]({},_0x25b73b,_0x2e1647['options']);return db[_0x7d11('0x28')][_0x7d11('0x45')](_0x25b73b)[_0x7d11('0x22')](handleEntityNotFound(_0x47e968,null))[_0x7d11('0x22')](respondWithResult(_0x47e968,null))[_0x7d11('0x40')](handleError(_0x47e968,null));};exports[_0x7d11('0x46')]=function(_0x161213,_0x193631){return db[_0x7d11('0x28')]['create'](_0x161213['body'],{})['then'](respondWithResult(_0x193631,0xc9))[_0x7d11('0x40')](handleError(_0x193631,null));};exports[_0x7d11('0x47')]=function(_0x20297a,_0x18ae0e){if(_0x20297a[_0x7d11('0x48')]['id']){delete _0x20297a[_0x7d11('0x48')]['id'];}return db[_0x7d11('0x28')][_0x7d11('0x45')]({'where':{'id':_0x20297a[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x18ae0e,null))[_0x7d11('0x22')](saveUpdates(_0x20297a[_0x7d11('0x48')],null))['then'](respondWithResult(_0x18ae0e,null))[_0x7d11('0x40')](handleError(_0x18ae0e,null));};exports[_0x7d11('0x23')]=function(_0x29207f,_0x553a03){return db['UserProfileResource'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));};exports[_0x7d11('0x49')]=function(_0x36af2b,_0x5e6234){return db[_0x7d11('0x28')][_0x7d11('0x49')]()[_0x7d11('0x22')](respondWithResult(_0x5e6234,null))[_0x7d11('0x40')](handleError(_0x5e6234,null));};
\ No newline at end of file
index 0d2ea39..18b6c84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3cc=['compositeIndex','resourceId','sectionId','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource'];(function(_0x463f29,_0x315360){var _0x516d9b=function(_0x8c52c9){while(--_0x8c52c9){_0x463f29['push'](_0x463f29['shift']());}};_0x516d9b(++_0x315360);}(_0xb3cc,0x1c3));var _0xcb3c=function(_0x3076ed,_0x23db8a){_0x3076ed=_0x3076ed-0x0;var _0x25a6a9=_0xb3cc[_0x3076ed];return _0x25a6a9;};'use strict';var _=require(_0xcb3c('0x0'));var util=require(_0xcb3c('0x1'));var logger=require('../../config/logger')(_0xcb3c('0x2'));var moment=require(_0xcb3c('0x3'));var BPromise=require('bluebird');var rp=require(_0xcb3c('0x4'));var fs=require('fs');var path=require(_0xcb3c('0x5'));var rimraf=require(_0xcb3c('0x6'));var config=require(_0xcb3c('0x7'));var attributes=require(_0xcb3c('0x8'));module['exports']=function(_0x19b29a,_0x23e209){return _0x19b29a[_0xcb3c('0x9')](_0xcb3c('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xcb3c('0xb'),'fields':[_0xcb3c('0xc'),_0xcb3c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xff34=['api','moment','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger'];(function(_0x43b616,_0xb842c){var _0xc188db=function(_0x2faaf5){while(--_0x2faaf5){_0x43b616['push'](_0x43b616['shift']());}};_0xc188db(++_0xb842c);}(_0xff34,0x192));var _0x4ff3=function(_0x5895ca,_0x5e67f1){_0x5895ca=_0x5895ca-0x0;var _0x4b6055=_0xff34[_0x5895ca];return _0x4b6055;};'use strict';var _=require(_0x4ff3('0x0'));var util=require(_0x4ff3('0x1'));var logger=require(_0x4ff3('0x2'))(_0x4ff3('0x3'));var moment=require(_0x4ff3('0x4'));var BPromise=require(_0x4ff3('0x5'));var rp=require(_0x4ff3('0x6'));var fs=require('fs');var path=require(_0x4ff3('0x7'));var rimraf=require(_0x4ff3('0x8'));var config=require('../../config/environment');var attributes=require(_0x4ff3('0x9'));module['exports']=function(_0x2a57b7,_0x57e770){return _0x2a57b7[_0x4ff3('0xa')]('UserProfileResource',attributes,{'tableName':_0x4ff3('0xb'),'paranoid':![],'indexes':[{'name':_0x4ff3('0xc'),'fields':[_0x4ff3('0xd'),_0x4ff3('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index bd433d9..442c6e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90de=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent'];(function(_0x67fdbf,_0xc3c2f3){var _0x3e8004=function(_0x5ee7bb){while(--_0x5ee7bb){_0x67fdbf['push'](_0x67fdbf['shift']());}};_0x3e8004(++_0xc3c2f3);}(_0x90de,0x94));var _0xe90d=function(_0xb2e670,_0x436e56){_0xb2e670=_0xb2e670-0x0;var _0x598b6b=_0x90de[_0xb2e670];return _0x598b6b;};'use strict';var _=require(_0xe90d('0x0'));var util=require('util');var moment=require(_0xe90d('0x1'));var BPromise=require(_0xe90d('0x2'));var rs=require(_0xe90d('0x3'));var fs=require('fs');var Redis=require(_0xe90d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe90d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe90d('0x6')][_0xe90d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xeebfa,_0x6106d2,_0x5f16a0){return new BPromise(function(_0x44a6da,_0x3f99b0){return client[_0xe90d('0x8')](_0xeebfa,_0x5f16a0)['then'](function(_0x5eb50b){logger[_0xe90d('0x9')](_0xe90d('0xa'),_0x6106d2,_0xe90d('0xb'));logger[_0xe90d('0xc')](_0xe90d('0xd'),_0x6106d2,_0xe90d('0xb'),JSON[_0xe90d('0xe')](_0x5eb50b));if(_0x5eb50b[_0xe90d('0xf')]){if(_0x5eb50b['error'][_0xe90d('0x10')]===0x1f4){logger[_0xe90d('0xf')](_0xe90d('0xa'),_0x6106d2,_0x5eb50b[_0xe90d('0xf')][_0xe90d('0x11')]);return _0x3f99b0(_0x5eb50b[_0xe90d('0xf')][_0xe90d('0x11')]);}logger[_0xe90d('0xf')](_0xe90d('0xa'),_0x6106d2,_0x5eb50b[_0xe90d('0xf')][_0xe90d('0x11')]);return _0x44a6da(_0x5eb50b['error'][_0xe90d('0x11')]);}else{logger[_0xe90d('0x9')](_0xe90d('0xa'),_0x6106d2,_0xe90d('0xb'));_0x44a6da(_0x5eb50b[_0xe90d('0x12')][_0xe90d('0x11')]);}})[_0xe90d('0x13')](function(_0x468e70){logger[_0xe90d('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x6106d2,_0x468e70);_0x3f99b0(_0x468e70);});});}
\ No newline at end of file
+var _0xa212=['code','message','info','result','catch','lodash','util','moment','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa212,0xec));var _0x2a21=function(_0x57c4bb,_0x284386){_0x57c4bb=_0x57c4bb-0x0;var _0x2ca240=_0xa212[_0x57c4bb];return _0x2ca240;};'use strict';var _=require(_0x2a21('0x0'));var util=require(_0x2a21('0x1'));var moment=require(_0x2a21('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a21('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a21('0x4'));var config=require(_0x2a21('0x5'));var jayson=require(_0x2a21('0x6'));var client=jayson[_0x2a21('0x7')][_0x2a21('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f76c0,_0x3c0b85,_0x41b1ba){return new BPromise(function(_0x519ee3,_0x55ae9e){return client[_0x2a21('0x9')](_0x4f76c0,_0x41b1ba)[_0x2a21('0xa')](function(_0x3f73bc){logger['info'](_0x2a21('0xb'),_0x3c0b85,_0x2a21('0xc'));logger[_0x2a21('0xd')](_0x2a21('0xe'),_0x3c0b85,_0x2a21('0xc'),JSON['stringify'](_0x3f73bc));if(_0x3f73bc[_0x2a21('0xf')]){if(_0x3f73bc[_0x2a21('0xf')][_0x2a21('0x10')]===0x1f4){logger[_0x2a21('0xf')](_0x2a21('0xb'),_0x3c0b85,_0x3f73bc[_0x2a21('0xf')][_0x2a21('0x11')]);return _0x55ae9e(_0x3f73bc[_0x2a21('0xf')]['message']);}logger[_0x2a21('0xf')](_0x2a21('0xb'),_0x3c0b85,_0x3f73bc[_0x2a21('0xf')][_0x2a21('0x11')]);return _0x519ee3(_0x3f73bc[_0x2a21('0xf')][_0x2a21('0x11')]);}else{logger[_0x2a21('0x12')](_0x2a21('0xb'),_0x3c0b85,_0x2a21('0xc'));_0x519ee3(_0x3f73bc[_0x2a21('0x13')][_0x2a21('0x11')]);}})[_0x2a21('0x14')](function(_0x55e489){logger[_0x2a21('0xf')](_0x2a21('0xb'),_0x3c0b85,_0x55e489);_0x55ae9e(_0x55e489);});});}
\ No newline at end of file
index 919f424..8d24218 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf583=['/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','show','create','put'];(function(_0x3af1b7,_0x21b419){var _0x33906a=function(_0x547a9f){while(--_0x547a9f){_0x3af1b7['push'](_0x3af1b7['shift']());}};_0x33906a(++_0x21b419);}(_0xf583,0x122));var _0x3f58=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xf583[_0x22e47a];return _0x15a12a;};'use strict';var multer=require(_0x3f58('0x0'));var util=require('util');var path=require(_0x3f58('0x1'));var timeout=require(_0x3f58('0x2'));var express=require(_0x3f58('0x3'));var router=express[_0x3f58('0x4')]();var fs_extra=require(_0x3f58('0x5'));var auth=require(_0x3f58('0x6'));var interaction=require(_0x3f58('0x7'));var config=require(_0x3f58('0x8'));var controller=require(_0x3f58('0x9'));router[_0x3f58('0xa')]('/',auth[_0x3f58('0xb')](),controller[_0x3f58('0xc')]);router[_0x3f58('0xa')](_0x3f58('0xd'),auth[_0x3f58('0xb')](),controller[_0x3f58('0xe')]);router[_0x3f58('0xa')]('/:id',auth[_0x3f58('0xb')](),controller[_0x3f58('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3f58('0x10')]);router[_0x3f58('0x11')](_0x3f58('0x12'),auth[_0x3f58('0xb')](),controller[_0x3f58('0x13')]);router[_0x3f58('0x14')](_0x3f58('0x12'),auth[_0x3f58('0xb')](),controller['destroy']);module[_0x3f58('0x15')]=router;
\ No newline at end of file
+var _0x0a1f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x3b7fb0,_0x553e21){var _0x3b7fc5=function(_0x286bdc){while(--_0x286bdc){_0x3b7fb0['push'](_0x3b7fb0['shift']());}};_0x3b7fc5(++_0x553e21);}(_0x0a1f,0xef));var _0xf0a1=function(_0x51ccec,_0x2da2ed){_0x51ccec=_0x51ccec-0x0;var _0x2fe51d=_0x0a1f[_0x51ccec];return _0x2fe51d;};'use strict';var multer=require(_0xf0a1('0x0'));var util=require(_0xf0a1('0x1'));var path=require(_0xf0a1('0x2'));var timeout=require(_0xf0a1('0x3'));var express=require(_0xf0a1('0x4'));var router=express[_0xf0a1('0x5')]();var fs_extra=require(_0xf0a1('0x6'));var auth=require(_0xf0a1('0x7'));var interaction=require(_0xf0a1('0x8'));var config=require('../../config/environment');var controller=require(_0xf0a1('0x9'));router[_0xf0a1('0xa')]('/',auth[_0xf0a1('0xb')](),controller[_0xf0a1('0xc')]);router['get'](_0xf0a1('0xd'),auth['isAuthenticated'](),controller[_0xf0a1('0xe')]);router[_0xf0a1('0xa')](_0xf0a1('0xf'),auth[_0xf0a1('0xb')](),controller['show']);router[_0xf0a1('0x10')]('/',auth[_0xf0a1('0xb')](),controller[_0xf0a1('0x11')]);router[_0xf0a1('0x12')](_0xf0a1('0xf'),auth[_0xf0a1('0xb')](),controller[_0xf0a1('0x13')]);router['delete'](_0xf0a1('0xf'),auth[_0xf0a1('0xb')](),controller[_0xf0a1('0x14')]);module[_0xf0a1('0x15')]=router;
\ No newline at end of file
index b02351b..3477cdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['setDataValue','crudPermissions','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x2a7dc0,_0x18a015){var _0xbde7f0=function(_0x38a93a){while(--_0x38a93a){_0x2a7dc0['push'](_0x2a7dc0['shift']());}};_0xbde7f0(++_0x18a015);}(_0xac4a,0x13f));var _0xaac4=function(_0x4c293d,_0x46d1ac){_0x4c293d=_0x4c293d-0x0;var _0x4b94b3=_0xac4a[_0x4c293d];return _0x4b94b3;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'name':{'type':Sequelize[_0xaac4('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xaac4('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xaac4('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2af0f6){this[_0xaac4('0x5')](_0xaac4('0x6'),_0x2af0f6?_0x2af0f6['join'](''):[]);},'get':function(){return this[_0xaac4('0x7')]('crudPermissions')?this[_0xaac4('0x7')]('crudPermissions')[_0xaac4('0x8')](''):[];}}};
\ No newline at end of file
+var _0x02ce=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize','exports','STRING','INTEGER'];(function(_0x2e3d80,_0x4e2ae4){var _0x326557=function(_0x1d5d63){while(--_0x1d5d63){_0x2e3d80['push'](_0x2e3d80['shift']());}};_0x326557(++_0x4e2ae4);}(_0x02ce,0x1ac));var _0xe02c=function(_0x3df333,_0x486849){_0x3df333=_0x3df333-0x0;var _0x428261=_0x02ce[_0x3df333];return _0x428261;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe02c('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe02c('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe02c('0x2')],'set':function(_0x46475c){this[_0xe02c('0x5')](_0xe02c('0x6'),_0x46475c?_0x46475c[_0xe02c('0x7')](''):[]);},'get':function(){return this[_0xe02c('0x8')](_0xe02c('0x6'))?this[_0xe02c('0x8')]('crudPermissions')['split'](''):[];}}};
\ No newline at end of file
index 78e2dd1..f9f29fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7d2=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','then','includeAll','include','UserProfileSection','findAll','show','params','keys','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util'];(function(_0x53b31,_0x5a0ec4){var _0x5d888d=function(_0x1c5b77){while(--_0x1c5b77){_0x53b31['push'](_0x53b31['shift']());}};_0x5d888d(++_0x5a0ec4);}(_0xf7d2,0xc4));var _0x2f7d=function(_0x581d90,_0x40fa2a){_0x581d90=_0x581d90-0x0;var _0x39247f=_0xf7d2[_0x581d90];return _0x39247f;};'use strict';var emlformat=require(_0x2f7d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f7d('0x1'));var jsonpatch=require(_0x2f7d('0x2'));var rp=require('request-promise');var moment=require(_0x2f7d('0x3'));var BPromise=require(_0x2f7d('0x4'));var Mustache=require('mustache');var util=require(_0x2f7d('0x5'));var path=require(_0x2f7d('0x6'));var sox=require(_0x2f7d('0x7'));var csv=require(_0x2f7d('0x8'));var ejs=require(_0x2f7d('0x9'));var fs=require('fs');var fs_extra=require(_0x2f7d('0xa'));var _=require(_0x2f7d('0xb'));var squel=require('squel');var crypto=require(_0x2f7d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2f7d('0x8'));var querystring=require(_0x2f7d('0xd'));var Papa=require(_0x2f7d('0xe'));var Redis=require(_0x2f7d('0xf'));var authService=require(_0x2f7d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2f7d('0x11'));var hardwareService=require(_0x2f7d('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2f7d('0x13'));var db=require(_0x2f7d('0x14'))['db'];function respondWithStatusCode(_0x7260e1,_0x28329f){_0x28329f=_0x28329f||0xcc;return function(_0x4e3842){if(_0x4e3842){return _0x7260e1[_0x2f7d('0x15')](_0x28329f);}return _0x7260e1[_0x2f7d('0x16')](_0x28329f)[_0x2f7d('0x17')]();};}function respondWithResult(_0x220cbc,_0x1eea7b){_0x1eea7b=_0x1eea7b||0xc8;return function(_0x278865){if(_0x278865){return _0x220cbc[_0x2f7d('0x16')](_0x1eea7b)[_0x2f7d('0x18')](_0x278865);}};}function respondWithFilteredResult(_0x47ac55,_0x1af8bc){return function(_0x205520){if(_0x205520){var _0x28b2a2=typeof _0x1af8bc[_0x2f7d('0x19')]===_0x2f7d('0x1a')&&typeof _0x1af8bc[_0x2f7d('0x1b')]===_0x2f7d('0x1a');var _0x3b39ae=_0x205520['count'];var _0x18db2b=_0x28b2a2?0x0:_0x1af8bc[_0x2f7d('0x19')];var _0x711a84=_0x28b2a2?_0x205520[_0x2f7d('0x1c')]:_0x1af8bc[_0x2f7d('0x19')]+_0x1af8bc[_0x2f7d('0x1b')];var _0x411eb0;if(_0x711a84>=_0x3b39ae){_0x711a84=_0x3b39ae;_0x411eb0=0xc8;}else{_0x411eb0=0xce;}_0x47ac55['status'](_0x411eb0);return _0x47ac55[_0x2f7d('0x1d')](_0x2f7d('0x1e'),_0x18db2b+'-'+_0x711a84+'/'+_0x3b39ae)[_0x2f7d('0x18')](_0x205520);}return null;};}function patchUpdates(_0x279689){return function(_0x4d2db4){try{jsonpatch['apply'](_0x4d2db4,_0x279689,!![]);}catch(_0x3724ce){return BPromise[_0x2f7d('0x1f')](_0x3724ce);}return _0x4d2db4['save']();};}function saveUpdates(_0x22c492,_0x4dcc1c){return function(_0x5cefda){if(_0x5cefda){return _0x5cefda[_0x2f7d('0x20')](_0x22c492)['then'](function(_0xea1f8a){return _0xea1f8a;});}return null;};}function removeEntity(_0x4f49f6,_0x427904){return function(_0x65560d){if(_0x65560d){return _0x65560d[_0x2f7d('0x21')]()['then'](function(){_0x4f49f6[_0x2f7d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x73eebc,_0x13a0ac){return function(_0xd30ec4){if(!_0xd30ec4){_0x73eebc['sendStatus'](0x194);}return _0xd30ec4;};}function handleError(_0xe3baa4,_0x3978d7){_0x3978d7=_0x3978d7||0x1f4;return function(_0x380d14){logger[_0x2f7d('0x22')](_0x380d14[_0x2f7d('0x23')]);if(_0x380d14['name']){delete _0x380d14[_0x2f7d('0x24')];}_0xe3baa4[_0x2f7d('0x16')](_0x3978d7)[_0x2f7d('0x25')](_0x380d14);};}exports[_0x2f7d('0x26')]=function(_0x373b41,_0x3c10b0){var _0x4a6265={},_0x1809f9={},_0x58af43={'count':0x0,'rows':[]};var _0x5c5c93=_[_0x2f7d('0x27')](db['UserProfileSection'][_0x2f7d('0x28')],function(_0x417548){return{'name':_0x417548[_0x2f7d('0x29')],'type':_0x417548[_0x2f7d('0x2a')][_0x2f7d('0x2b')]};});_0x1809f9[_0x2f7d('0x2c')]=_[_0x2f7d('0x27')](_0x5c5c93,_0x2f7d('0x24'));_0x1809f9['query']=_['keys'](_0x373b41[_0x2f7d('0x2d')]);_0x1809f9[_0x2f7d('0x2e')]=_[_0x2f7d('0x2f')](_0x1809f9['model'],_0x1809f9['query']);_0x4a6265['attributes']=_[_0x2f7d('0x2f')](_0x1809f9['model'],qs['fields'](_0x373b41['query'][_0x2f7d('0x30')]));_0x4a6265[_0x2f7d('0x31')]=_0x4a6265['attributes'][_0x2f7d('0x32')]?_0x4a6265['attributes']:_0x1809f9[_0x2f7d('0x2c')];if(!_0x373b41[_0x2f7d('0x2d')][_0x2f7d('0x33')](_0x2f7d('0x34'))){_0x4a6265['limit']=qs[_0x2f7d('0x1b')](_0x373b41['query'][_0x2f7d('0x1b')]);_0x4a6265[_0x2f7d('0x19')]=qs[_0x2f7d('0x19')](_0x373b41[_0x2f7d('0x2d')][_0x2f7d('0x19')]);}_0x4a6265[_0x2f7d('0x35')]=qs['sort'](_0x373b41[_0x2f7d('0x2d')][_0x2f7d('0x36')]);_0x4a6265[_0x2f7d('0x37')]=qs[_0x2f7d('0x2e')](_[_0x2f7d('0x38')](_0x373b41[_0x2f7d('0x2d')],_0x1809f9[_0x2f7d('0x2e')]),_0x5c5c93);if(_0x373b41[_0x2f7d('0x2d')]['filter']){_0x4a6265[_0x2f7d('0x37')]=_[_0x2f7d('0x39')](_0x4a6265[_0x2f7d('0x37')],{'$or':_[_0x2f7d('0x27')](_0x5c5c93,function(_0xcd26c4){if(_0xcd26c4[_0x2f7d('0x2a')]!==_0x2f7d('0x3a')){var _0x35c903={};_0x35c903[_0xcd26c4['name']]={'$like':'%'+_0x373b41[_0x2f7d('0x2d')]['filter']+'%'};return _0x35c903;}})});}_0x4a6265=_[_0x2f7d('0x39')]({},_0x4a6265,_0x373b41[_0x2f7d('0x3b')]);var _0x4bad06={'where':_0x4a6265[_0x2f7d('0x37')]};return db['UserProfileSection']['count'](_0x4bad06)[_0x2f7d('0x3c')](function(_0x43cbc2){_0x58af43[_0x2f7d('0x1c')]=_0x43cbc2;if(_0x373b41[_0x2f7d('0x2d')][_0x2f7d('0x3d')]){_0x4a6265[_0x2f7d('0x3e')]=[{'all':!![]}];}return db[_0x2f7d('0x3f')][_0x2f7d('0x40')](_0x4a6265);})[_0x2f7d('0x3c')](function(_0x140928){_0x58af43['rows']=_0x140928;return _0x58af43;})[_0x2f7d('0x3c')](respondWithFilteredResult(_0x3c10b0,_0x4a6265))['catch'](handleError(_0x3c10b0,null));};exports[_0x2f7d('0x41')]=function(_0x230c85,_0x285754){var _0x3c0770={'raw':![],'where':{'id':_0x230c85[_0x2f7d('0x42')]['id']}},_0x21f73b={};_0x21f73b['model']=_['keys'](db[_0x2f7d('0x3f')][_0x2f7d('0x28')]);_0x21f73b[_0x2f7d('0x2d')]=_[_0x2f7d('0x43')](_0x230c85['query']);_0x21f73b[_0x2f7d('0x2e')]=_[_0x2f7d('0x2f')](_0x21f73b[_0x2f7d('0x2c')],_0x21f73b[_0x2f7d('0x2d')]);_0x3c0770['attributes']=_[_0x2f7d('0x2f')](_0x21f73b[_0x2f7d('0x2c')],qs[_0x2f7d('0x30')](_0x230c85[_0x2f7d('0x2d')][_0x2f7d('0x30')]));_0x3c0770[_0x2f7d('0x31')]=_0x3c0770[_0x2f7d('0x31')][_0x2f7d('0x32')]?_0x3c0770[_0x2f7d('0x31')]:_0x21f73b[_0x2f7d('0x2c')];if(_0x230c85[_0x2f7d('0x2d')][_0x2f7d('0x3d')]){_0x3c0770[_0x2f7d('0x3e')]=[{'all':!![]}];}_0x3c0770=_[_0x2f7d('0x39')]({},_0x3c0770,_0x230c85['options']);return db['UserProfileSection'][_0x2f7d('0x44')](_0x3c0770)[_0x2f7d('0x3c')](handleEntityNotFound(_0x285754,null))[_0x2f7d('0x3c')](respondWithResult(_0x285754,null))[_0x2f7d('0x45')](handleError(_0x285754,null));};exports[_0x2f7d('0x46')]=function(_0xf64cfe,_0x1ba00c){return db[_0x2f7d('0x3f')]['create'](_0xf64cfe[_0x2f7d('0x47')],{})[_0x2f7d('0x3c')](respondWithResult(_0x1ba00c,0xc9))[_0x2f7d('0x45')](handleError(_0x1ba00c,null));};exports[_0x2f7d('0x20')]=function(_0x39343b,_0x217b99){if(_0x39343b[_0x2f7d('0x47')]['id']){delete _0x39343b['body']['id'];}return db[_0x2f7d('0x3f')][_0x2f7d('0x44')]({'where':{'id':_0x39343b['params']['id']}})['then'](handleEntityNotFound(_0x217b99,null))[_0x2f7d('0x3c')](saveUpdates(_0x39343b[_0x2f7d('0x47')],null))[_0x2f7d('0x3c')](respondWithResult(_0x217b99,null))[_0x2f7d('0x45')](handleError(_0x217b99,null));};exports[_0x2f7d('0x21')]=function(_0x374e34,_0x576040){return db['UserProfileSection'][_0x2f7d('0x44')]({'where':{'id':_0x374e34[_0x2f7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x576040,null))[_0x2f7d('0x3c')](removeEntity(_0x576040,null))['catch'](handleError(_0x576040,null));};exports['describe']=function(_0x279fd9,_0x2859e5){return db[_0x2f7d('0x3f')]['describe']()['then'](respondWithResult(_0x2859e5,null))[_0x2f7d('0x45')](handleError(_0x2859e5,null));};
\ No newline at end of file
+var _0xe8c2=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','end','error','stack','name','send','index','map','UserProfileSection','type','key','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','merge','options','then','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','destroy','describe','eml-format','rimraf'];(function(_0x1c16b5,_0x52afbc){var _0x54c5a2=function(_0x2c59eb){while(--_0x2c59eb){_0x1c16b5['push'](_0x1c16b5['shift']());}};_0x54c5a2(++_0x52afbc);}(_0xe8c2,0x1ba));var _0x2e8c=function(_0x295726,_0x5f072e){_0x295726=_0x295726-0x0;var _0x30315b=_0xe8c2[_0x295726];return _0x30315b;};'use strict';var emlformat=require(_0x2e8c('0x0'));var rimraf=require(_0x2e8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e8c('0x2'));var rp=require(_0x2e8c('0x3'));var moment=require(_0x2e8c('0x4'));var BPromise=require(_0x2e8c('0x5'));var Mustache=require(_0x2e8c('0x6'));var util=require(_0x2e8c('0x7'));var path=require(_0x2e8c('0x8'));var sox=require(_0x2e8c('0x9'));var csv=require(_0x2e8c('0xa'));var ejs=require(_0x2e8c('0xb'));var fs=require('fs');var fs_extra=require(_0x2e8c('0xc'));var _=require('lodash');var squel=require(_0x2e8c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2e8c('0xa'));var querystring=require(_0x2e8c('0xe'));var Papa=require(_0x2e8c('0xf'));var Redis=require(_0x2e8c('0x10'));var authService=require(_0x2e8c('0x11'));var qs=require(_0x2e8c('0x12'));var as=require(_0x2e8c('0x13'));var hardwareService=require(_0x2e8c('0x14'));var logger=require(_0x2e8c('0x15'))(_0x2e8c('0x16'));var utils=require(_0x2e8c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2e8c('0x18'))['db'];function respondWithStatusCode(_0xce2d8f,_0x2ceb56){_0x2ceb56=_0x2ceb56||0xcc;return function(_0x54f46a){if(_0x54f46a){return _0xce2d8f[_0x2e8c('0x19')](_0x2ceb56);}return _0xce2d8f[_0x2e8c('0x1a')](_0x2ceb56)['end']();};}function respondWithResult(_0x1a2911,_0x111b0c){_0x111b0c=_0x111b0c||0xc8;return function(_0x3e2d9c){if(_0x3e2d9c){return _0x1a2911['status'](_0x111b0c)[_0x2e8c('0x1b')](_0x3e2d9c);}};}function respondWithFilteredResult(_0x332c73,_0x15bb6d){return function(_0x490059){if(_0x490059){var _0x3839b0=typeof _0x15bb6d[_0x2e8c('0x1c')]===_0x2e8c('0x1d')&&typeof _0x15bb6d[_0x2e8c('0x1e')]===_0x2e8c('0x1d');var _0x44be5e=_0x490059['count'];var _0x36cddd=_0x3839b0?0x0:_0x15bb6d[_0x2e8c('0x1c')];var _0x1405a6=_0x3839b0?_0x490059[_0x2e8c('0x1f')]:_0x15bb6d[_0x2e8c('0x1c')]+_0x15bb6d['limit'];var _0x3ca856;if(_0x1405a6>=_0x44be5e){_0x1405a6=_0x44be5e;_0x3ca856=0xc8;}else{_0x3ca856=0xce;}_0x332c73[_0x2e8c('0x1a')](_0x3ca856);return _0x332c73[_0x2e8c('0x20')](_0x2e8c('0x21'),_0x36cddd+'-'+_0x1405a6+'/'+_0x44be5e)['json'](_0x490059);}return null;};}function patchUpdates(_0x107da2){return function(_0xab3da9){try{jsonpatch['apply'](_0xab3da9,_0x107da2,!![]);}catch(_0x3276c3){return BPromise[_0x2e8c('0x22')](_0x3276c3);}return _0xab3da9[_0x2e8c('0x23')]();};}function saveUpdates(_0x186273,_0x27221e){return function(_0x5a7299){if(_0x5a7299){return _0x5a7299[_0x2e8c('0x24')](_0x186273)['then'](function(_0x4db2a8){return _0x4db2a8;});}return null;};}function removeEntity(_0xa2f09f,_0x40131d){return function(_0x593b6e){if(_0x593b6e){return _0x593b6e['destroy']()['then'](function(){_0xa2f09f[_0x2e8c('0x1a')](0xcc)[_0x2e8c('0x25')]();});}};}function handleEntityNotFound(_0x53fd14,_0x3fb3ab){return function(_0xff8414){if(!_0xff8414){_0x53fd14[_0x2e8c('0x19')](0x194);}return _0xff8414;};}function handleError(_0x2deeef,_0x2d02e5){_0x2d02e5=_0x2d02e5||0x1f4;return function(_0x49f769){logger[_0x2e8c('0x26')](_0x49f769[_0x2e8c('0x27')]);if(_0x49f769[_0x2e8c('0x28')]){delete _0x49f769[_0x2e8c('0x28')];}_0x2deeef[_0x2e8c('0x1a')](_0x2d02e5)[_0x2e8c('0x29')](_0x49f769);};}exports[_0x2e8c('0x2a')]=function(_0x7c1e2,_0x42037a){var _0x7cb0f6={},_0x5b0a1f={},_0x98d4a5={'count':0x0,'rows':[]};var _0x514a98=_[_0x2e8c('0x2b')](db[_0x2e8c('0x2c')]['rawAttributes'],function(_0x115926){return{'name':_0x115926['fieldName'],'type':_0x115926[_0x2e8c('0x2d')][_0x2e8c('0x2e')]};});_0x5b0a1f['model']=_[_0x2e8c('0x2b')](_0x514a98,_0x2e8c('0x28'));_0x5b0a1f[_0x2e8c('0x2f')]=_[_0x2e8c('0x30')](_0x7c1e2[_0x2e8c('0x2f')]);_0x5b0a1f[_0x2e8c('0x31')]=_[_0x2e8c('0x32')](_0x5b0a1f[_0x2e8c('0x33')],_0x5b0a1f[_0x2e8c('0x2f')]);_0x7cb0f6[_0x2e8c('0x34')]=_[_0x2e8c('0x32')](_0x5b0a1f[_0x2e8c('0x33')],qs['fields'](_0x7c1e2[_0x2e8c('0x2f')][_0x2e8c('0x35')]));_0x7cb0f6[_0x2e8c('0x34')]=_0x7cb0f6[_0x2e8c('0x34')][_0x2e8c('0x36')]?_0x7cb0f6[_0x2e8c('0x34')]:_0x5b0a1f['model'];if(!_0x7c1e2[_0x2e8c('0x2f')]['hasOwnProperty']('nolimit')){_0x7cb0f6[_0x2e8c('0x1e')]=qs[_0x2e8c('0x1e')](_0x7c1e2[_0x2e8c('0x2f')][_0x2e8c('0x1e')]);_0x7cb0f6[_0x2e8c('0x1c')]=qs[_0x2e8c('0x1c')](_0x7c1e2['query'][_0x2e8c('0x1c')]);}_0x7cb0f6['order']=qs[_0x2e8c('0x37')](_0x7c1e2[_0x2e8c('0x2f')][_0x2e8c('0x37')]);_0x7cb0f6[_0x2e8c('0x38')]=qs['filters'](_[_0x2e8c('0x39')](_0x7c1e2['query'],_0x5b0a1f[_0x2e8c('0x31')]),_0x514a98);if(_0x7c1e2[_0x2e8c('0x2f')][_0x2e8c('0x3a')]){_0x7cb0f6[_0x2e8c('0x38')]=_[_0x2e8c('0x3b')](_0x7cb0f6['where'],{'$or':_[_0x2e8c('0x2b')](_0x514a98,function(_0x302847){if(_0x302847[_0x2e8c('0x2d')]!=='VIRTUAL'){var _0x4692e2={};_0x4692e2[_0x302847[_0x2e8c('0x28')]]={'$like':'%'+_0x7c1e2[_0x2e8c('0x2f')][_0x2e8c('0x3a')]+'%'};return _0x4692e2;}})});}_0x7cb0f6=_[_0x2e8c('0x3b')]({},_0x7cb0f6,_0x7c1e2[_0x2e8c('0x3c')]);var _0x44d448={'where':_0x7cb0f6[_0x2e8c('0x38')]};return db[_0x2e8c('0x2c')][_0x2e8c('0x1f')](_0x44d448)[_0x2e8c('0x3d')](function(_0x3be569){_0x98d4a5[_0x2e8c('0x1f')]=_0x3be569;if(_0x7c1e2[_0x2e8c('0x2f')]['includeAll']){_0x7cb0f6[_0x2e8c('0x3e')]=[{'all':!![]}];}return db[_0x2e8c('0x2c')][_0x2e8c('0x3f')](_0x7cb0f6);})[_0x2e8c('0x3d')](function(_0x49aa5d){_0x98d4a5[_0x2e8c('0x40')]=_0x49aa5d;return _0x98d4a5;})['then'](respondWithFilteredResult(_0x42037a,_0x7cb0f6))[_0x2e8c('0x41')](handleError(_0x42037a,null));};exports[_0x2e8c('0x42')]=function(_0x47d52a,_0x5c525e){var _0x5858a5={'raw':![],'where':{'id':_0x47d52a[_0x2e8c('0x43')]['id']}},_0x249f88={};_0x249f88[_0x2e8c('0x33')]=_[_0x2e8c('0x30')](db[_0x2e8c('0x2c')][_0x2e8c('0x44')]);_0x249f88[_0x2e8c('0x2f')]=_[_0x2e8c('0x30')](_0x47d52a[_0x2e8c('0x2f')]);_0x249f88[_0x2e8c('0x31')]=_['intersection'](_0x249f88[_0x2e8c('0x33')],_0x249f88['query']);_0x5858a5[_0x2e8c('0x34')]=_[_0x2e8c('0x32')](_0x249f88[_0x2e8c('0x33')],qs[_0x2e8c('0x35')](_0x47d52a[_0x2e8c('0x2f')][_0x2e8c('0x35')]));_0x5858a5['attributes']=_0x5858a5[_0x2e8c('0x34')][_0x2e8c('0x36')]?_0x5858a5[_0x2e8c('0x34')]:_0x249f88[_0x2e8c('0x33')];if(_0x47d52a[_0x2e8c('0x2f')][_0x2e8c('0x45')]){_0x5858a5['include']=[{'all':!![]}];}_0x5858a5=_[_0x2e8c('0x3b')]({},_0x5858a5,_0x47d52a[_0x2e8c('0x3c')]);return db[_0x2e8c('0x2c')][_0x2e8c('0x46')](_0x5858a5)[_0x2e8c('0x3d')](handleEntityNotFound(_0x5c525e,null))[_0x2e8c('0x3d')](respondWithResult(_0x5c525e,null))[_0x2e8c('0x41')](handleError(_0x5c525e,null));};exports['create']=function(_0x8e58cc,_0x51352f){return db['UserProfileSection']['create'](_0x8e58cc[_0x2e8c('0x47')],{})[_0x2e8c('0x3d')](respondWithResult(_0x51352f,0xc9))[_0x2e8c('0x41')](handleError(_0x51352f,null));};exports[_0x2e8c('0x24')]=function(_0x1ce374,_0x520ac7){if(_0x1ce374[_0x2e8c('0x47')]['id']){delete _0x1ce374[_0x2e8c('0x47')]['id'];}return db[_0x2e8c('0x2c')][_0x2e8c('0x46')]({'where':{'id':_0x1ce374[_0x2e8c('0x43')]['id']}})[_0x2e8c('0x3d')](handleEntityNotFound(_0x520ac7,null))[_0x2e8c('0x3d')](saveUpdates(_0x1ce374[_0x2e8c('0x47')],null))[_0x2e8c('0x3d')](respondWithResult(_0x520ac7,null))[_0x2e8c('0x41')](handleError(_0x520ac7,null));};exports[_0x2e8c('0x48')]=function(_0x40c37b,_0x4efb0a){return db[_0x2e8c('0x2c')][_0x2e8c('0x46')]({'where':{'id':_0x40c37b[_0x2e8c('0x43')]['id']}})['then'](handleEntityNotFound(_0x4efb0a,null))[_0x2e8c('0x3d')](removeEntity(_0x4efb0a,null))['catch'](handleError(_0x4efb0a,null));};exports[_0x2e8c('0x49')]=function(_0x4e7d49,_0x1eff2b){return db[_0x2e8c('0x2c')][_0x2e8c('0x49')]()[_0x2e8c('0x3d')](respondWithResult(_0x1eff2b,null))[_0x2e8c('0x41')](handleError(_0x1eff2b,null));};
\ No newline at end of file
index 7283ac8..0d44720 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4feb=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api','moment'];(function(_0x7eaa6b,_0x29c3c7){var _0x5bcd23=function(_0x379d14){while(--_0x379d14){_0x7eaa6b['push'](_0x7eaa6b['shift']());}};_0x5bcd23(++_0x29c3c7);}(_0x4feb,0x190));var _0xb4fe=function(_0x10b27b,_0x2c6069){_0x10b27b=_0x10b27b-0x0;var _0x115ec7=_0x4feb[_0x10b27b];return _0x115ec7;};'use strict';var _=require(_0xb4fe('0x0'));var util=require(_0xb4fe('0x1'));var logger=require(_0xb4fe('0x2'))(_0xb4fe('0x3'));var moment=require(_0xb4fe('0x4'));var BPromise=require(_0xb4fe('0x5'));var rp=require(_0xb4fe('0x6'));var fs=require('fs');var path=require(_0xb4fe('0x7'));var rimraf=require(_0xb4fe('0x8'));var config=require(_0xb4fe('0x9'));var attributes=require('./userProfileSection.attributes');module[_0xb4fe('0xa')]=function(_0x1b9ba2,_0x2b4137){return _0x1b9ba2[_0xb4fe('0xb')]('UserProfileSection',attributes,{'tableName':_0xb4fe('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb4fe('0xd'),_0xb4fe('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbedb=['util','../../config/logger','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x17ea97,_0x234a33){var _0x3ed183=function(_0xfcb57c){while(--_0xfcb57c){_0x17ea97['push'](_0x17ea97['shift']());}};_0x3ed183(++_0x234a33);}(_0xbedb,0xe3));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbbed('0x0'));var util=require(_0xbbed('0x1'));var logger=require(_0xbbed('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbbed('0x3'));var fs=require('fs');var path=require(_0xbbed('0x4'));var rimraf=require(_0xbbed('0x5'));var config=require('../../config/environment');var attributes=require(_0xbbed('0x6'));module[_0xbbed('0x7')]=function(_0x10d2b3,_0x372d5f){return _0x10d2b3[_0xbbed('0x8')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xbbed('0x9'),'fields':[_0xbbed('0xa'),_0xbbed('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 39fb903..21a5359 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9c5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x135bde,_0x3ee9bc){var _0x31cc0d=function(_0x101cca){while(--_0x101cca){_0x135bde['push'](_0x135bde['shift']());}};_0x31cc0d(++_0x3ee9bc);}(_0xb9c5,0x14c));var _0x5b9c=function(_0x26609f,_0x2d2ab3){_0x26609f=_0x26609f-0x0;var _0x1d0d3c=_0xb9c5[_0x26609f];return _0x1d0d3c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5b9c('0x0'));var BPromise=require(_0x5b9c('0x1'));var rs=require(_0x5b9c('0x2'));var fs=require('fs');var Redis=require(_0x5b9c('0x3'));var db=require(_0x5b9c('0x4'))['db'];var utils=require(_0x5b9c('0x5'));var logger=require(_0x5b9c('0x6'))(_0x5b9c('0x7'));var config=require(_0x5b9c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5b9c('0x9')][_0x5b9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3259c2,_0x5ba63b,_0x2a9fd6){return new BPromise(function(_0x3f43b5,_0x1cd540){return client[_0x5b9c('0xb')](_0x3259c2,_0x2a9fd6)[_0x5b9c('0xc')](function(_0x2f9c44){logger['info'](_0x5b9c('0xd'),_0x5ba63b,'request\x20sent');logger[_0x5b9c('0xe')](_0x5b9c('0xf'),_0x5ba63b,_0x5b9c('0x10'),JSON[_0x5b9c('0x11')](_0x2f9c44));if(_0x2f9c44[_0x5b9c('0x12')]){if(_0x2f9c44[_0x5b9c('0x12')][_0x5b9c('0x13')]===0x1f4){logger['error'](_0x5b9c('0xd'),_0x5ba63b,_0x2f9c44[_0x5b9c('0x12')][_0x5b9c('0x14')]);return _0x1cd540(_0x2f9c44['error'][_0x5b9c('0x14')]);}logger[_0x5b9c('0x12')](_0x5b9c('0xd'),_0x5ba63b,_0x2f9c44[_0x5b9c('0x12')]['message']);return _0x3f43b5(_0x2f9c44[_0x5b9c('0x12')]['message']);}else{logger[_0x5b9c('0x15')](_0x5b9c('0xd'),_0x5ba63b,'request\x20sent');_0x3f43b5(_0x2f9c44[_0x5b9c('0x16')][_0x5b9c('0x14')]);}})[_0x5b9c('0x17')](function(_0x219c8e){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5ba63b,_0x219c8e);_0x1cd540(_0x219c8e);});});}
\ No newline at end of file
+var _0x89f8=['code','message','result','catch','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x89f8,0x14e));var _0x889f=function(_0x2ae78d,_0x4bdc21){_0x2ae78d=_0x2ae78d-0x0;var _0xb84c6a=_0x89f8[_0x2ae78d];return _0xb84c6a;};'use strict';var _=require(_0x889f('0x0'));var util=require(_0x889f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x889f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x889f('0x3'))(_0x889f('0x4'));var config=require(_0x889f('0x5'));var jayson=require(_0x889f('0x6'));var client=jayson[_0x889f('0x7')][_0x889f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53c0b9,_0x1742a5,_0x22e9f6){return new BPromise(function(_0x51e027,_0xd9b5c9){return client[_0x889f('0x9')](_0x53c0b9,_0x22e9f6)[_0x889f('0xa')](function(_0x341546){logger[_0x889f('0xb')](_0x889f('0xc'),_0x1742a5,_0x889f('0xd'));logger[_0x889f('0xe')](_0x889f('0xf'),_0x1742a5,'request\x20sent',JSON[_0x889f('0x10')](_0x341546));if(_0x341546[_0x889f('0x11')]){if(_0x341546[_0x889f('0x11')][_0x889f('0x12')]===0x1f4){logger[_0x889f('0x11')](_0x889f('0xc'),_0x1742a5,_0x341546[_0x889f('0x11')][_0x889f('0x13')]);return _0xd9b5c9(_0x341546[_0x889f('0x11')]['message']);}logger[_0x889f('0x11')](_0x889f('0xc'),_0x1742a5,_0x341546['error'][_0x889f('0x13')]);return _0x51e027(_0x341546['error']['message']);}else{logger[_0x889f('0xb')](_0x889f('0xc'),_0x1742a5,'request\x20sent');_0x51e027(_0x341546[_0x889f('0x14')][_0x889f('0x13')]);}})[_0x889f('0x15')](function(_0x3a0a46){logger[_0x889f('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x1742a5,_0x3a0a46);_0xd9b5c9(_0x3a0a46);});});}
\ No newline at end of file
index c3168ef..2669f91 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(_0x4fd96d,_0x3a5551){var _0xf7e94b=function(_0x30eeb5){while(--_0x30eeb5){_0x4fd96d['push'](_0x4fd96d['shift']());}};_0xf7e94b(++_0x3a5551);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5e3fb7,_0x4f0c05){var _0x3c9228=function(_0x8636ae){while(--_0x8636ae){_0x5e3fb7['push'](_0x5e3fb7['shift']());}};_0x3c9228(++_0x4f0c05);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 8d2d2c7..7ff5153 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7917=['INTEGER'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7917,0x131));var _0x7791=function(_0x5820cf,_0x55b098){_0x5820cf=_0x5820cf-0x0;var _0x334a8e=_0x7917[_0x5820cf];return _0x334a8e;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x7791('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1784=['sequelize','INTEGER'];(function(_0x3220bb,_0x342a03){var _0x23415c=function(_0x56cc05){while(--_0x56cc05){_0x3220bb['push'](_0x3220bb['shift']());}};_0x23415c(++_0x342a03);}(_0x1784,0x1ec));var _0x4178=function(_0x2ec5b9,_0x56e0a3){_0x2ec5b9=_0x2ec5b9-0x0;var _0x10dcea=_0x1784[_0x2ec5b9];return _0x10dcea;};'use strict';var Sequelize=require(_0x4178('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4178('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 3820228..c1f2424 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['path','rimraf','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4e0417,_0x574fd4){var _0x5d6909=function(_0x54e5d3){while(--_0x54e5d3){_0x4e0417['push'](_0x4e0417['shift']());}};_0x5d6909(++_0x574fd4);}(_0x1967,0x173));var _0x7196=function(_0x423392,_0x4a4d9c){_0x423392=_0x423392-0x0;var _0x21722e=_0x1967[_0x423392];return _0x21722e;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue'];(function(_0x7f56a5,_0x5c5075){var _0x5c7d75=function(_0x3e648d){while(--_0x3e648d){_0x7f56a5['push'](_0x7f56a5['shift']());}};_0x5c7d75(++_0x5c5075);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6d38[_0x2f5ac5];return _0x37c9a8;};'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'));module['exports']=function(_0x2d8272,_0xfbbc15){return _0x2d8272[_0x86d3('0x7')](_0x86d3('0x8'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 967cb0e..2699dad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f7e=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x3f7e,0x7e));var _0xe3f7=function(_0x29ff5f,_0x347cfd){_0x29ff5f=_0x29ff5f-0x0;var _0x3c1073=_0x3f7e[_0x29ff5f];return _0x3c1073;};'use strict';var _=require(_0xe3f7('0x0'));var util=require(_0xe3f7('0x1'));var moment=require(_0xe3f7('0x2'));var BPromise=require(_0xe3f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3f7('0x4'));var db=require(_0xe3f7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3f7('0x6'))('rpc');var config=require(_0xe3f7('0x7'));var jayson=require(_0xe3f7('0x8'));var client=jayson[_0xe3f7('0x9')][_0xe3f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dc040,_0x2edd8d,_0x5e90ae){return new BPromise(function(_0x234ca1,_0x162fda){return client['request'](_0x1dc040,_0x5e90ae)['then'](function(_0x212b04){logger[_0xe3f7('0xb')](_0xe3f7('0xc'),_0x2edd8d,'request\x20sent');logger[_0xe3f7('0xd')](_0xe3f7('0xe'),_0x2edd8d,_0xe3f7('0xf'),JSON[_0xe3f7('0x10')](_0x212b04));if(_0x212b04[_0xe3f7('0x11')]){if(_0x212b04[_0xe3f7('0x11')][_0xe3f7('0x12')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x2edd8d,_0x212b04[_0xe3f7('0x11')][_0xe3f7('0x13')]);return _0x162fda(_0x212b04['error'][_0xe3f7('0x13')]);}logger[_0xe3f7('0x11')](_0xe3f7('0xc'),_0x2edd8d,_0x212b04[_0xe3f7('0x11')][_0xe3f7('0x13')]);return _0x234ca1(_0x212b04[_0xe3f7('0x11')][_0xe3f7('0x13')]);}else{logger[_0xe3f7('0xb')](_0xe3f7('0xc'),_0x2edd8d,_0xe3f7('0xf'));_0x234ca1(_0x212b04['result']['message']);}})[_0xe3f7('0x14')](function(_0x21d72a){logger[_0xe3f7('0x11')](_0xe3f7('0xc'),_0x2edd8d,_0x21d72a);_0x162fda(_0x21d72a);});});}
\ No newline at end of file
+var _0x10dc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserSmsQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash'];(function(_0x39be59,_0x511fd9){var _0x20ac62=function(_0x2783f8){while(--_0x2783f8){_0x39be59['push'](_0x39be59['shift']());}};_0x20ac62(++_0x511fd9);}(_0x10dc,0x77));var _0xc10d=function(_0x5e3665,_0x369ac8){_0x5e3665=_0x5e3665-0x0;var _0x187299=_0x10dc[_0x5e3665];return _0x187299;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var moment=require(_0xc10d('0x2'));var BPromise=require(_0xc10d('0x3'));var rs=require(_0xc10d('0x4'));var fs=require('fs');var Redis=require(_0xc10d('0x5'));var db=require(_0xc10d('0x6'))['db'];var utils=require(_0xc10d('0x7'));var logger=require('../../config/logger')(_0xc10d('0x8'));var config=require(_0xc10d('0x9'));var jayson=require(_0xc10d('0xa'));var client=jayson[_0xc10d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x464404,_0x11e7f9,_0x26af3b){return new BPromise(function(_0x111305,_0x2e19cb){return client[_0xc10d('0xc')](_0x464404,_0x26af3b)[_0xc10d('0xd')](function(_0x56b87f){logger[_0xc10d('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x11e7f9,'request\x20sent');logger[_0xc10d('0xf')](_0xc10d('0x10'),_0x11e7f9,'request\x20sent',JSON[_0xc10d('0x11')](_0x56b87f));if(_0x56b87f[_0xc10d('0x12')]){if(_0x56b87f[_0xc10d('0x12')]['code']===0x1f4){logger[_0xc10d('0x12')](_0xc10d('0x13'),_0x11e7f9,_0x56b87f[_0xc10d('0x12')][_0xc10d('0x14')]);return _0x2e19cb(_0x56b87f[_0xc10d('0x12')][_0xc10d('0x14')]);}logger[_0xc10d('0x12')](_0xc10d('0x13'),_0x11e7f9,_0x56b87f[_0xc10d('0x12')][_0xc10d('0x14')]);return _0x111305(_0x56b87f[_0xc10d('0x12')][_0xc10d('0x14')]);}else{logger[_0xc10d('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x11e7f9,_0xc10d('0x15'));_0x111305(_0x56b87f[_0xc10d('0x16')][_0xc10d('0x14')]);}})[_0xc10d('0x17')](function(_0x1c88d2){logger['error'](_0xc10d('0x13'),_0x11e7f9,_0x1c88d2);_0x2e19cb(_0x1c88d2);});});}
\ No newline at end of file
index 8315808..087a66c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x516c74,_0x225f26){var _0x38a5c0=function(_0x360e7a){while(--_0x360e7a){_0x516c74['push'](_0x516c74['shift']());}};_0x38a5c0(++_0x225f26);}(_0x70e0,0x17b));var _0x070e=function(_0x1a4b54,_0x309a5e){_0x1a4b54=_0x1a4b54-0x0;var _0x2ceb59=_0x70e0[_0x1a4b54];return _0x2ceb59;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3e96a4,_0x2db1db){var _0x18ce41=function(_0x5e4acd){while(--_0x5e4acd){_0x3e96a4['push'](_0x3e96a4['shift']());}};_0x18ce41(++_0x2db1db);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index a279575..064571e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['exports','INTEGER','sequelize'];(function(_0x2718f5,_0x59f00a){var _0x4dca7f=function(_0xaf398d){while(--_0xaf398d){_0x2718f5['push'](_0x2718f5['shift']());}};_0x4dca7f(++_0x59f00a);}(_0x008c,0x188));var _0xc008=function(_0x55d76f,_0x3ec4e8){_0x55d76f=_0x55d76f-0x0;var _0x27f726=_0x008c[_0x55d76f];return _0x27f726;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'penalty':{'type':Sequelize[_0xc008('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x300a=['INTEGER','sequelize','exports'];(function(_0x504c1e,_0x51e919){var _0x1967e5=function(_0x56044e){while(--_0x56044e){_0x504c1e['push'](_0x504c1e['shift']());}};_0x1967e5(++_0x51e919);}(_0x300a,0x184));var _0xa300=function(_0x2577d9,_0x8f2f28){_0x2577d9=_0x2577d9-0x0;var _0x36fe58=_0x300a[_0x2577d9];return _0x36fe58;};'use strict';var Sequelize=require(_0xa300('0x0'));module[_0xa300('0x1')]={'penalty':{'type':Sequelize[_0xa300('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 352ee18..f606a6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5a9=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x230f6c,_0x2ca0c2){var _0x22b4b7=function(_0x441f1c){while(--_0x441f1c){_0x230f6c['push'](_0x230f6c['shift']());}};_0x22b4b7(++_0x2ca0c2);}(_0xc5a9,0x1f3));var _0x9c5a=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xc5a9[_0x166d93];return _0xba708;};'use strict';var _=require(_0x9c5a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9c5a('0x1'));var moment=require(_0x9c5a('0x2'));var BPromise=require(_0x9c5a('0x3'));var rp=require(_0x9c5a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c5a('0x5'));var config=require(_0x9c5a('0x6'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x4082f0,_0x4ea637){return _0x4082f0[_0x9c5a('0x7')](_0x9c5a('0x8'),attributes,{'tableName':_0x9c5a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef48=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues'];(function(_0x11da6,_0x1b215c){var _0x4e9ae8=function(_0x24b0d9){while(--_0x24b0d9){_0x11da6['push'](_0x11da6['shift']());}};_0x4e9ae8(++_0x1b215c);}(_0xef48,0x96));var _0x8ef4=function(_0x60fe,_0x513468){_0x60fe=_0x60fe-0x0;var _0x2e9051=_0xef48[_0x60fe];return _0x2e9051;};'use strict';var _=require(_0x8ef4('0x0'));var util=require(_0x8ef4('0x1'));var logger=require(_0x8ef4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8ef4('0x3'));var rp=require(_0x8ef4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ef4('0x5'));var config=require(_0x8ef4('0x6'));var attributes=require(_0x8ef4('0x7'));module['exports']=function(_0x678270,_0x52a15c){return _0x678270['define'](_0x8ef4('0x8'),attributes,{'tableName':_0x8ef4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9a9950c..3e15950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca58=['request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http'];(function(_0x18ccd6,_0x1098e8){var _0x587d2c=function(_0x460ad6){while(--_0x460ad6){_0x18ccd6['push'](_0x18ccd6['shift']());}};_0x587d2c(++_0x1098e8);}(_0xca58,0x90));var _0x8ca5=function(_0x21f80e,_0x159eb7){_0x21f80e=_0x21f80e-0x0;var _0x396ea2=_0xca58[_0x21f80e];return _0x396ea2;};'use strict';var _=require(_0x8ca5('0x0'));var util=require('util');var moment=require(_0x8ca5('0x1'));var BPromise=require(_0x8ca5('0x2'));var rs=require(_0x8ca5('0x3'));var fs=require('fs');var Redis=require(_0x8ca5('0x4'));var db=require(_0x8ca5('0x5'))['db'];var utils=require(_0x8ca5('0x6'));var logger=require(_0x8ca5('0x7'))(_0x8ca5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8ca5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1638f6,_0x229af3,_0x8a4d54){return new BPromise(function(_0x440d0e,_0x174b45){return client[_0x8ca5('0xa')](_0x1638f6,_0x8a4d54)[_0x8ca5('0xb')](function(_0x56b3a2){logger['info'](_0x8ca5('0xc'),_0x229af3,_0x8ca5('0xd'));logger[_0x8ca5('0xe')](_0x8ca5('0xf'),_0x229af3,'request\x20sent',JSON[_0x8ca5('0x10')](_0x56b3a2));if(_0x56b3a2['error']){if(_0x56b3a2[_0x8ca5('0x11')][_0x8ca5('0x12')]===0x1f4){logger[_0x8ca5('0x11')](_0x8ca5('0xc'),_0x229af3,_0x56b3a2[_0x8ca5('0x11')]['message']);return _0x174b45(_0x56b3a2[_0x8ca5('0x11')]['message']);}logger[_0x8ca5('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x229af3,_0x56b3a2['error']['message']);return _0x440d0e(_0x56b3a2[_0x8ca5('0x11')][_0x8ca5('0x13')]);}else{logger['info'](_0x8ca5('0xc'),_0x229af3,_0x8ca5('0xd'));_0x440d0e(_0x56b3a2[_0x8ca5('0x14')]['message']);}})[_0x8ca5('0x15')](function(_0x31d844){logger[_0x8ca5('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x229af3,_0x31d844);_0x174b45(_0x31d844);});});}
\ No newline at end of file
+var _0xb233=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xb233,0x14b));var _0x3b23=function(_0x22be10,_0x4c23c0){_0x22be10=_0x22be10-0x0;var _0x36c4a9=_0xb233[_0x22be10];return _0x36c4a9;};'use strict';var _=require(_0x3b23('0x0'));var util=require(_0x3b23('0x1'));var moment=require(_0x3b23('0x2'));var BPromise=require(_0x3b23('0x3'));var rs=require(_0x3b23('0x4'));var fs=require('fs');var Redis=require(_0x3b23('0x5'));var db=require(_0x3b23('0x6'))['db'];var utils=require(_0x3b23('0x7'));var logger=require(_0x3b23('0x8'))(_0x3b23('0x9'));var config=require('../../config/environment');var jayson=require(_0x3b23('0xa'));var client=jayson[_0x3b23('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5db33c,_0x550031,_0x1c170c){return new BPromise(function(_0x3af365,_0x6191df){return client['request'](_0x5db33c,_0x1c170c)[_0x3b23('0xc')](function(_0x3dba1d){logger[_0x3b23('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x550031,_0x3b23('0xe'));logger[_0x3b23('0xf')](_0x3b23('0x10'),_0x550031,_0x3b23('0xe'),JSON[_0x3b23('0x11')](_0x3dba1d));if(_0x3dba1d[_0x3b23('0x12')]){if(_0x3dba1d[_0x3b23('0x12')][_0x3b23('0x13')]===0x1f4){logger['error'](_0x3b23('0x14'),_0x550031,_0x3dba1d[_0x3b23('0x12')][_0x3b23('0x15')]);return _0x6191df(_0x3dba1d[_0x3b23('0x12')][_0x3b23('0x15')]);}logger[_0x3b23('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x550031,_0x3dba1d['error']['message']);return _0x3af365(_0x3dba1d['error'][_0x3b23('0x15')]);}else{logger[_0x3b23('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x550031,'request\x20sent');_0x3af365(_0x3dba1d[_0x3b23('0x16')]['message']);}})['catch'](function(_0x4edf96){logger[_0x3b23('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x550031,_0x4edf96);_0x6191df(_0x4edf96);});});}
\ No newline at end of file
index a638ae9..f8b98ab 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(_0x3a23c1,_0x495d49){var _0x286863=function(_0x3accee){while(--_0x3accee){_0x3a23c1['push'](_0x3a23c1['shift']());}};_0x286863(++_0x495d49);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x121a91,_0x26ec77){var _0x506bf4=function(_0x5b2f5c){while(--_0x5b2f5c){_0x121a91['push'](_0x121a91['shift']());}};_0x506bf4(++_0x26ec77);}(_0xedd9,0xfc));var _0x9edd=function(_0x3149bf,_0x1a3976){_0x3149bf=_0x3149bf-0x0;var _0x190bf6=_0xedd9[_0x3149bf];return _0x190bf6;};'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 8893748..89c231b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe041=['queue_interface','sequelize','exports','Required\x20by\x20Asterisk','INTEGER','STRING'];(function(_0x428a53,_0x2f0e76){var _0x3ff74=function(_0x5f1b78){while(--_0x5f1b78){_0x428a53['push'](_0x428a53['shift']());}};_0x3ff74(++_0x2f0e76);}(_0xe041,0x17b));var _0x1e04=function(_0x29d021,_0x501224){_0x29d021=_0x29d021-0x0;var _0x1bbf0d=_0xe041[_0x29d021];return _0x1bbf0d;};'use strict';var Sequelize=require(_0x1e04('0x0'));module[_0x1e04('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1e04('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x1e04('0x2')},'UserId':{'type':Sequelize[_0x1e04('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x1e04('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x1e04('0x2')},'VoiceQueueId':{'type':Sequelize[_0x1e04('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0x1e04('0x4')],'allowNull':![],'unique':_0x1e04('0x5'),'comment':_0x1e04('0x2')},'penalty':{'type':Sequelize[_0x1e04('0x3')](0xb),'defaultValue':0x0,'comment':_0x1e04('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
+var _0x5872=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x4a6362,_0x9e782a){var _0x2653a5=function(_0x52b12b){while(--_0x52b12b){_0x4a6362['push'](_0x4a6362['shift']());}};_0x2653a5(++_0x9e782a);}(_0x5872,0x18b));var _0x2587=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x5872[_0x215dc8];return _0x583ea3;};'use strict';var Sequelize=require(_0x2587('0x0'));module[_0x2587('0x1')]={'uniqueid':{'type':Sequelize[_0x2587('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x2587('0x3')},'membername':{'type':Sequelize[_0x2587('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x2587('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x2587('0x4')],'allowNull':![],'unique':_0x2587('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x2587('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x2587('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x2587('0x3')},'penalty':{'type':Sequelize[_0x2587('0x2')](0xb),'defaultValue':0x0,'comment':_0x2587('0x3')},'paused':{'type':Sequelize[_0x2587('0x2')](0xb),'defaultValue':0x0,'comment':_0x2587('0x3')}};
\ No newline at end of file
index 54123ff..82681cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb10=['update','emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xbb10,0x12d));var _0x0bb1=function(_0x1e8ffa,_0x212dcb){_0x1e8ffa=_0x1e8ffa-0x0;var _0x2e9f23=_0xbb10[_0x1e8ffa];return _0x2e9f23;};'use strict';var EventEmitter=require(_0x0bb1('0x0'));var UserVoiceQueueRt=require(_0x0bb1('0x1'))['db'][_0x0bb1('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0bb1('0x3')](0x0);var events={'afterCreate':_0x0bb1('0x4'),'afterUpdate':_0x0bb1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a85a1){return function(_0x49af4a,_0x478770,_0x4f753a){UserVoiceQueueRtEvents['emit'](_0x1a85a1+':'+_0x49af4a['id'],_0x49af4a);UserVoiceQueueRtEvents[_0x0bb1('0x6')](_0x1a85a1,_0x49af4a);_0x4f753a(null);};}for(var e in events){if(events[_0x0bb1('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x0bb1('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xf2f0=['exports','events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x7ad123,_0xeeeef3){var _0x37d073=function(_0x51367b){while(--_0x51367b){_0x7ad123['push'](_0x7ad123['shift']());}};_0x37d073(++_0xeeeef3);}(_0xf2f0,0x1e9));var _0x0f2f=function(_0x510f22,_0x391e2d){_0x510f22=_0x510f22-0x0;var _0x131834=_0xf2f0[_0x510f22];return _0x131834;};'use strict';var EventEmitter=require(_0x0f2f('0x0'));var UserVoiceQueueRt=require(_0x0f2f('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f2f('0x2'),'afterDestroy':_0x0f2f('0x3')};function emitEvent(_0x39516f){return function(_0x4d51f7,_0x2ea25f,_0x3be672){UserVoiceQueueRtEvents[_0x0f2f('0x4')](_0x39516f+':'+_0x4d51f7['id'],_0x4d51f7);UserVoiceQueueRtEvents[_0x0f2f('0x4')](_0x39516f,_0x4d51f7);_0x3be672(null);};}for(var e in events){if(events[_0x0f2f('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x0f2f('0x6')](e,emitEvent(event));}}module[_0x0f2f('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 60c51b7..03269c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3a9=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x40d67a,_0xe2e062){var _0x3093ec=function(_0x182bd5){while(--_0x182bd5){_0x40d67a['push'](_0x40d67a['shift']());}};_0x3093ec(++_0xe2e062);}(_0xb3a9,0xb5));var _0x9b3a=function(_0x586f71,_0x2ceea4){_0x586f71=_0x586f71-0x0;var _0x44b7ff=_0xb3a9[_0x586f71];return _0x44b7ff;};'use strict';var _=require(_0x9b3a('0x0'));var util=require(_0x9b3a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b3a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b3a('0x3'));var rimraf=require(_0x9b3a('0x4'));var config=require(_0x9b3a('0x5'));var attributes=require(_0x9b3a('0x6'));module[_0x9b3a('0x7')]=function(_0x3318a7,_0x2ee8b5){return _0x3318a7[_0x9b3a('0x8')](_0x9b3a('0x9'),attributes,{'tableName':_0x9b3a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x58cd=['moment','bluebird','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api'];(function(_0x48aabf,_0x338fc8){var _0x3f6011=function(_0x53a3d6){while(--_0x53a3d6){_0x48aabf['push'](_0x48aabf['shift']());}};_0x3f6011(++_0x338fc8);}(_0x58cd,0xea));var _0xd58c=function(_0x367aa1,_0x28451f){_0x367aa1=_0x367aa1-0x0;var _0x2d3611=_0x58cd[_0x367aa1];return _0x2d3611;};'use strict';var _=require(_0xd58c('0x0'));var util=require(_0xd58c('0x1'));var logger=require(_0xd58c('0x2'))(_0xd58c('0x3'));var moment=require(_0xd58c('0x4'));var BPromise=require(_0xd58c('0x5'));var rp=require(_0xd58c('0x6'));var fs=require('fs');var path=require(_0xd58c('0x7'));var rimraf=require(_0xd58c('0x8'));var config=require('../../config/environment');var attributes=require(_0xd58c('0x9'));module[_0xd58c('0xa')]=function(_0x245fae,_0x101e79){return _0x245fae[_0xd58c('0xb')](_0xd58c('0xc'),attributes,{'tableName':_0xd58c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0f9dd59..67a7ab1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45ff=['UserVoiceQueueRt,\x20%s,\x20%s','message','result','UserVoiceQueueRt','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x45ff,0xfb));var _0xf45f=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x45ff[_0x229d7e];return _0xa78280;};'use strict';var _=require(_0xf45f('0x0'));var util=require('util');var moment=require(_0xf45f('0x1'));var BPromise=require(_0xf45f('0x2'));var rs=require(_0xf45f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf45f('0x4'))(_0xf45f('0x5'));var config=require(_0xf45f('0x6'));var jayson=require(_0xf45f('0x7'));var client=jayson[_0xf45f('0x8')][_0xf45f('0x9')]({'port':0x232a});config[_0xf45f('0xa')]=_[_0xf45f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf45f('0xa')]));require(_0xf45f('0xc'))[_0xf45f('0xd')](socket);function respondWithRpcPromise(_0x1250a1,_0x520c9e,_0x5de023){return new BPromise(function(_0x5ae21a,_0x55a375){return client['request'](_0x1250a1,_0x5de023)[_0xf45f('0xe')](function(_0x13c020){logger[_0xf45f('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x520c9e,'request\x20sent');logger['debug'](_0xf45f('0x10'),_0x520c9e,_0xf45f('0x11'),JSON[_0xf45f('0x12')](_0x13c020));if(_0x13c020[_0xf45f('0x13')]){if(_0x13c020[_0xf45f('0x13')][_0xf45f('0x14')]===0x1f4){logger[_0xf45f('0x13')](_0xf45f('0x15'),_0x520c9e,_0x13c020['error'][_0xf45f('0x16')]);return _0x55a375(_0x13c020[_0xf45f('0x13')]['message']);}logger[_0xf45f('0x13')](_0xf45f('0x15'),_0x520c9e,_0x13c020[_0xf45f('0x13')][_0xf45f('0x16')]);return _0x5ae21a(_0x13c020[_0xf45f('0x13')]['message']);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x520c9e,'request\x20sent');_0x5ae21a(_0x13c020[_0xf45f('0x17')][_0xf45f('0x16')]);}})['catch'](function(_0xb825a2){logger[_0xf45f('0x13')](_0xf45f('0x15'),_0x520c9e,_0xb825a2);_0x55a375(_0xb825a2);});});}exports['GetVoiceQueueRtPauses']=function(_0x347dac){var _0x1f96e5=this;return new Promise(function(_0xdf13ff,_0x20bfe9){return db[_0xf45f('0x18')]['findAll']({'raw':_0x347dac[_0xf45f('0x19')]?_0x347dac[_0xf45f('0x19')][_0xf45f('0x1a')]===undefined?!![]:![]:!![],'where':_0x347dac[_0xf45f('0x19')]?_0x347dac[_0xf45f('0x19')][_0xf45f('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0xf45f('0x1c'),db[_0xf45f('0x1d')]['fn']('IF',db['sequelize'][_0xf45f('0x1e')](_0xf45f('0x1f')))),'outboundQueuePauses']]})[_0xf45f('0xe')](function(_0x77b90b){logger[_0xf45f('0xf')]('GetVoiceQueueRtPauses',_0x347dac);logger['debug'](_0xf45f('0x20'),_0x347dac,JSON[_0xf45f('0x12')](_0x77b90b));_0xdf13ff(_0x77b90b);})[_0xf45f('0x21')](function(_0x4cbd42){logger['error'](_0xf45f('0x20'),_0x4cbd42[_0xf45f('0x16')],_0x347dac);_0x20bfe9(_0x1f96e5[_0xf45f('0x13')](0x1f4,_0x4cbd42[_0xf45f('0x16')]));});});};
\ No newline at end of file
+var _0xd5fd=['options','raw','where','COUNT','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UserVoiceQueueRt','findAll'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xd5fd,0x1c5));var _0xdd5f=function(_0x3d789d,_0x534c06){_0x3d789d=_0x3d789d-0x0;var _0x464ae9=_0xd5fd[_0x3d789d];return _0x464ae9;};'use strict';var _=require(_0xdd5f('0x0'));var util=require(_0xdd5f('0x1'));var moment=require(_0xdd5f('0x2'));var BPromise=require(_0xdd5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd5f('0x4'));var db=require(_0xdd5f('0x5'))['db'];var utils=require(_0xdd5f('0x6'));var logger=require(_0xdd5f('0x7'))('rpc');var config=require(_0xdd5f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdd5f('0x9')]({'port':0x232a});config[_0xdd5f('0xa')]=_[_0xdd5f('0xb')](config[_0xdd5f('0xa')],{'host':_0xdd5f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd5f('0xa')]));require(_0xdd5f('0xd'))[_0xdd5f('0xe')](socket);function respondWithRpcPromise(_0x568fa0,_0x24bd79,_0x1a04b9){return new BPromise(function(_0x460669,_0x51877d){return client[_0xdd5f('0xf')](_0x568fa0,_0x1a04b9)[_0xdd5f('0x10')](function(_0x3f4bb0){logger[_0xdd5f('0x11')](_0xdd5f('0x12'),_0x24bd79,_0xdd5f('0x13'));logger['debug'](_0xdd5f('0x14'),_0x24bd79,_0xdd5f('0x13'),JSON['stringify'](_0x3f4bb0));if(_0x3f4bb0['error']){if(_0x3f4bb0[_0xdd5f('0x15')][_0xdd5f('0x16')]===0x1f4){logger[_0xdd5f('0x15')](_0xdd5f('0x12'),_0x24bd79,_0x3f4bb0[_0xdd5f('0x15')][_0xdd5f('0x17')]);return _0x51877d(_0x3f4bb0[_0xdd5f('0x15')][_0xdd5f('0x17')]);}logger[_0xdd5f('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x24bd79,_0x3f4bb0[_0xdd5f('0x15')][_0xdd5f('0x17')]);return _0x460669(_0x3f4bb0['error'][_0xdd5f('0x17')]);}else{logger['info'](_0xdd5f('0x12'),_0x24bd79,_0xdd5f('0x13'));_0x460669(_0x3f4bb0[_0xdd5f('0x18')]['message']);}})[_0xdd5f('0x19')](function(_0x2cd7f8){logger[_0xdd5f('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x24bd79,_0x2cd7f8);_0x51877d(_0x2cd7f8);});});}exports['GetVoiceQueueRtPauses']=function(_0x40bf07){var _0x4c9437=this;return new Promise(function(_0x4d0667,_0x26caaf){return db[_0xdd5f('0x1a')][_0xdd5f('0x1b')]({'raw':_0x40bf07['options']?_0x40bf07[_0xdd5f('0x1c')][_0xdd5f('0x1d')]===undefined?!![]:![]:!![],'where':_0x40bf07[_0xdd5f('0x1c')]?_0x40bf07['options'][_0xdd5f('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0xdd5f('0x1f'),db[_0xdd5f('0x20')]['fn']('IF',db[_0xdd5f('0x20')]['literal'](_0xdd5f('0x21')))),_0xdd5f('0x22')]]})[_0xdd5f('0x10')](function(_0x525276){logger[_0xdd5f('0x11')](_0xdd5f('0x23'),_0x40bf07);logger[_0xdd5f('0x24')]('GetVoiceQueueRtPauses',_0x40bf07,JSON['stringify'](_0x525276));_0x4d0667(_0x525276);})['catch'](function(_0x201920){logger[_0xdd5f('0x15')]('GetVoiceQueueRtPauses',_0x201920[_0xdd5f('0x17')],_0x40bf07);_0x26caaf(_0x4c9437['error'](0x1f4,_0x201920[_0xdd5f('0x17')]));});});};
\ No newline at end of file
index a37cc7e..4d06186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f9=['register','length','./userVoiceQueueRt.events','save','emit','removeListener'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0xb3f9,0x7a));var _0x9b3f=function(_0x39ea95,_0x27210f){_0x39ea95=_0x39ea95-0x0;var _0x2df580=_0xb3f9[_0x39ea95];return _0x2df580;};'use strict';var UserVoiceQueueRtEvents=require(_0x9b3f('0x0'));var events=[_0x9b3f('0x1'),'remove','update'];function createListener(_0x46c112,_0x4c79b1){return function(_0x282166){_0x4c79b1[_0x9b3f('0x2')](_0x46c112,_0x282166);};}function removeListener(_0x35fd0b,_0xa9df41){return function(){UserVoiceQueueRtEvents[_0x9b3f('0x3')](_0x35fd0b,_0xa9df41);};}exports[_0x9b3f('0x4')]=function(_0x47dc65){for(var _0x52889d=0x0,_0x84df53=events[_0x9b3f('0x5')];_0x52889d<_0x84df53;_0x52889d++){var _0x4d3e78=events[_0x52889d];var _0x2194b5=createListener('userVoiceQueueRt:'+_0x4d3e78,_0x47dc65);UserVoiceQueueRtEvents['on'](_0x4d3e78,_0x2194b5);}};
\ No newline at end of file
+var _0x8ff3=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update','emit','removeListener'];(function(_0xf4452a,_0x578630){var _0x5b9baa=function(_0x211540){while(--_0x211540){_0xf4452a['push'](_0xf4452a['shift']());}};_0x5b9baa(++_0x578630);}(_0x8ff3,0x72));var _0x38ff=function(_0x3945f4,_0x2da4ad){_0x3945f4=_0x3945f4-0x0;var _0x2a1633=_0x8ff3[_0x3945f4];return _0x2a1633;};'use strict';var UserVoiceQueueRtEvents=require(_0x38ff('0x0'));var events=[_0x38ff('0x1'),'remove',_0x38ff('0x2')];function createListener(_0x3a6f7a,_0x3da206){return function(_0x1ba4fb){_0x3da206[_0x38ff('0x3')](_0x3a6f7a,_0x1ba4fb);};}function removeListener(_0x5bf243,_0x5f377c){return function(){UserVoiceQueueRtEvents[_0x38ff('0x4')](_0x5bf243,_0x5f377c);};}exports['register']=function(_0x32a606){for(var _0x5428e3=0x0,_0x158d7f=events[_0x38ff('0x5')];_0x5428e3<_0x158d7f;_0x5428e3++){var _0x1f6e52=events[_0x5428e3];var _0x8a1088=createListener(_0x38ff('0x6')+_0x1f6e52,_0x32a606);UserVoiceQueueRtEvents['on'](_0x1f6e52,_0x8a1088);}};
\ No newline at end of file
index 88dcaa0..cc61729 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(_0x5f02d1,_0x31a0d7){var _0x2c7ecc=function(_0xdfa6a6){while(--_0xdfa6a6){_0x5f02d1['push'](_0x5f02d1['shift']());}};_0x2c7ecc(++_0x31a0d7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0xcb91[_0x334d1e];return _0x3b33ba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3d309c,_0x242f4c){var _0x241187=function(_0x594990){while(--_0x594990){_0x3d309c['push'](_0x3d309c['shift']());}};_0x241187(++_0x242f4c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 17a194f..e926877 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03d3=['exports','INTEGER'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x03d3,0x6e));var _0x303d=function(_0xd66d96,_0x2ceea9){_0xd66d96=_0xd66d96-0x0;var _0x5be39c=_0x03d3[_0xd66d96];return _0x5be39c;};'use strict';var Sequelize=require('sequelize');module[_0x303d('0x0')]={'penalty':{'type':Sequelize[_0x303d('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe953=['exports','sequelize'];(function(_0x37cce6,_0x42aaf5){var _0x3dc9ba=function(_0x1cc51f){while(--_0x1cc51f){_0x37cce6['push'](_0x37cce6['shift']());}};_0x3dc9ba(++_0x42aaf5);}(_0xe953,0xc9));var _0x3e95=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe953[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x3e95('0x0'));module[_0x3e95('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index ec3e3ae..d5a3086 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3741=['api','moment','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','../../config/logger'];(function(_0x425f46,_0x32342a){var _0x24ee85=function(_0x47b323){while(--_0x47b323){_0x425f46['push'](_0x425f46['shift']());}};_0x24ee85(++_0x32342a);}(_0x3741,0xb3));var _0x1374=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x3741[_0x166742];return _0xb7814a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1374('0x0'))(_0x1374('0x1'));var moment=require(_0x1374('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1374('0x3'));var rimraf=require(_0x1374('0x4'));var config=require(_0x1374('0x5'));var attributes=require(_0x1374('0x6'));module[_0x1374('0x7')]=function(_0xb37319,_0x3114fe){return _0xb37319[_0x1374('0x8')](_0x1374('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x719e=['bluebird','path','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue','lodash','util','../../config/logger','moment'];(function(_0x27c067,_0x201bd0){var _0x3cb9e9=function(_0x2e6423){while(--_0x2e6423){_0x27c067['push'](_0x27c067['shift']());}};_0x3cb9e9(++_0x201bd0);}(_0x719e,0x149));var _0xe719=function(_0x556dda,_0x3180e8){_0x556dda=_0x556dda-0x0;var _0x3405ce=_0x719e[_0x556dda];return _0x3405ce;};'use strict';var _=require(_0xe719('0x0'));var util=require(_0xe719('0x1'));var logger=require(_0xe719('0x2'))('api');var moment=require(_0xe719('0x3'));var BPromise=require(_0xe719('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe719('0x5'));var rimraf=require('rimraf');var config=require(_0xe719('0x6'));var attributes=require(_0xe719('0x7'));module['exports']=function(_0x370821,_0x417d9a){return _0x370821['define'](_0xe719('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c7e9372..5ada02b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1220=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x405f03,_0x4f9362){var _0xd67ccf=function(_0x12b827){while(--_0x12b827){_0x405f03['push'](_0x405f03['shift']());}};_0xd67ccf(++_0x4f9362);}(_0x1220,0x143));var _0x0122=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x1220[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x0122('0x0'));var util=require(_0x0122('0x1'));var moment=require(_0x0122('0x2'));var BPromise=require(_0x0122('0x3'));var rs=require(_0x0122('0x4'));var fs=require('fs');var Redis=require(_0x0122('0x5'));var db=require(_0x0122('0x6'))['db'];var utils=require(_0x0122('0x7'));var logger=require(_0x0122('0x8'))(_0x0122('0x9'));var config=require(_0x0122('0xa'));var jayson=require(_0x0122('0xb'));var client=jayson[_0x0122('0xc')][_0x0122('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4195d4,_0x2e491f,_0x5362d2){return new BPromise(function(_0x23dd08,_0x877553){return client[_0x0122('0xe')](_0x4195d4,_0x5362d2)['then'](function(_0x316cdd){logger[_0x0122('0xf')](_0x0122('0x10'),_0x2e491f,_0x0122('0x11'));logger[_0x0122('0x12')](_0x0122('0x13'),_0x2e491f,'request\x20sent',JSON[_0x0122('0x14')](_0x316cdd));if(_0x316cdd[_0x0122('0x15')]){if(_0x316cdd[_0x0122('0x15')]['code']===0x1f4){logger[_0x0122('0x15')](_0x0122('0x10'),_0x2e491f,_0x316cdd['error'][_0x0122('0x16')]);return _0x877553(_0x316cdd[_0x0122('0x15')][_0x0122('0x16')]);}logger['error'](_0x0122('0x10'),_0x2e491f,_0x316cdd[_0x0122('0x15')][_0x0122('0x16')]);return _0x23dd08(_0x316cdd['error']['message']);}else{logger['info'](_0x0122('0x10'),_0x2e491f,_0x0122('0x11'));_0x23dd08(_0x316cdd[_0x0122('0x17')][_0x0122('0x16')]);}})[_0x0122('0x18')](function(_0x409f20){logger[_0x0122('0x15')](_0x0122('0x10'),_0x2e491f,_0x409f20);_0x877553(_0x409f20);});});}
\ No newline at end of file
+var _0x0d07=['debug','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4750b4,_0x588610){var _0x3f7b38=function(_0x41d21f){while(--_0x41d21f){_0x4750b4['push'](_0x4750b4['shift']());}};_0x3f7b38(++_0x588610);}(_0x0d07,0x140));var _0x70d0=function(_0x4f90d9,_0x4a6697){_0x4f90d9=_0x4f90d9-0x0;var _0x593a44=_0x0d07[_0x4f90d9];return _0x593a44;};'use strict';var _=require(_0x70d0('0x0'));var util=require('util');var moment=require(_0x70d0('0x1'));var BPromise=require(_0x70d0('0x2'));var rs=require(_0x70d0('0x3'));var fs=require('fs');var Redis=require(_0x70d0('0x4'));var db=require(_0x70d0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x70d0('0x6'));var config=require(_0x70d0('0x7'));var jayson=require(_0x70d0('0x8'));var client=jayson[_0x70d0('0x9')][_0x70d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12e32f,_0x40eed3,_0x4ee6db){return new BPromise(function(_0x47a538,_0x22b603){return client[_0x70d0('0xb')](_0x12e32f,_0x4ee6db)[_0x70d0('0xc')](function(_0x1b1412){logger[_0x70d0('0xd')](_0x70d0('0xe'),_0x40eed3,_0x70d0('0xf'));logger[_0x70d0('0x10')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x40eed3,_0x70d0('0xf'),JSON['stringify'](_0x1b1412));if(_0x1b1412[_0x70d0('0x11')]){if(_0x1b1412[_0x70d0('0x11')][_0x70d0('0x12')]===0x1f4){logger[_0x70d0('0x11')](_0x70d0('0xe'),_0x40eed3,_0x1b1412[_0x70d0('0x11')][_0x70d0('0x13')]);return _0x22b603(_0x1b1412[_0x70d0('0x11')][_0x70d0('0x13')]);}logger[_0x70d0('0x11')](_0x70d0('0xe'),_0x40eed3,_0x1b1412[_0x70d0('0x11')]['message']);return _0x47a538(_0x1b1412[_0x70d0('0x11')][_0x70d0('0x13')]);}else{logger[_0x70d0('0xd')](_0x70d0('0xe'),_0x40eed3,'request\x20sent');_0x47a538(_0x1b1412[_0x70d0('0x14')][_0x70d0('0x13')]);}})['catch'](function(_0xc878b0){logger[_0x70d0('0x11')](_0x70d0('0xe'),_0x40eed3,_0xc878b0);_0x22b603(_0xc878b0);});});}
\ No newline at end of file
index b3b9556..19706c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x292e=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','update','exports','multer'];(function(_0x39f91c,_0x10b9b4){var _0x360c69=function(_0x66218b){while(--_0x66218b){_0x39f91c['push'](_0x39f91c['shift']());}};_0x360c69(++_0x10b9b4);}(_0x292e,0xcb));var _0xe292=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x292e[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xe292('0x0'));var util=require(_0xe292('0x1'));var path=require(_0xe292('0x2'));var timeout=require(_0xe292('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe292('0x4'));var auth=require(_0xe292('0x5'));var interaction=require(_0xe292('0x6'));var config=require(_0xe292('0x7'));var controller=require('./variable.controller');router[_0xe292('0x8')]('/',auth['isAuthenticated'](),controller[_0xe292('0x9')]);router[_0xe292('0x8')](_0xe292('0xa'),auth[_0xe292('0xb')](),controller[_0xe292('0xc')]);router[_0xe292('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe292('0xe')](_0xe292('0xa'),auth[_0xe292('0xb')](),controller[_0xe292('0xf')]);router['delete'](_0xe292('0xa'),auth[_0xe292('0xb')](),controller['destroy']);module[_0xe292('0x10')]=router;
\ No newline at end of file
+var _0x175e=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get'];(function(_0x4182f7,_0xcc375f){var _0x24872c=function(_0x3bacdd){while(--_0x3bacdd){_0x4182f7['push'](_0x4182f7['shift']());}};_0x24872c(++_0xcc375f);}(_0x175e,0xe6));var _0xe175=function(_0x22be9f,_0x2307cc){_0x22be9f=_0x22be9f-0x0;var _0xcea3c1=_0x175e[_0x22be9f];return _0xcea3c1;};'use strict';var multer=require(_0xe175('0x0'));var util=require(_0xe175('0x1'));var path=require(_0xe175('0x2'));var timeout=require(_0xe175('0x3'));var express=require(_0xe175('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe175('0x5'));var interaction=require(_0xe175('0x6'));var config=require(_0xe175('0x7'));var controller=require(_0xe175('0x8'));router[_0xe175('0x9')]('/',auth[_0xe175('0xa')](),controller[_0xe175('0xb')]);router[_0xe175('0x9')](_0xe175('0xc'),auth[_0xe175('0xa')](),controller[_0xe175('0xd')]);router[_0xe175('0xe')]('/',auth[_0xe175('0xa')](),controller[_0xe175('0xf')]);router[_0xe175('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe175('0x11')]);router['delete'](_0xe175('0xc'),auth[_0xe175('0xa')](),controller[_0xe175('0x12')]);module[_0xe175('0x13')]=router;
\ No newline at end of file
index a3bb7d3..0d166f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30a9=['name','exports','STRING'];(function(_0x5aa05d,_0x3f443c){var _0x41ba33=function(_0x4728fc){while(--_0x4728fc){_0x5aa05d['push'](_0x5aa05d['shift']());}};_0x41ba33(++_0x3f443c);}(_0x30a9,0x82));var _0x930a=function(_0x27312e,_0x4d85e7){_0x27312e=_0x27312e-0x0;var _0x3a4eec=_0x30a9[_0x27312e];return _0x3a4eec;};'use strict';var Sequelize=require('sequelize');module[_0x930a('0x0')]={'name':{'type':Sequelize[_0x930a('0x1')],'unique':_0x930a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x930a('0x1')]}};
\ No newline at end of file
+var _0xa28b=['sequelize','exports','STRING','name'];(function(_0xfeed64,_0x2330e6){var _0x17e15a=function(_0x37e69d){while(--_0x37e69d){_0xfeed64['push'](_0xfeed64['shift']());}};_0x17e15a(++_0x2330e6);}(_0xa28b,0x1dc));var _0xba28=function(_0x12f7a5,_0x241f6d){_0x12f7a5=_0x12f7a5-0x0;var _0x3bc7b9=_0xa28b[_0x12f7a5];return _0x3bc7b9;};'use strict';var Sequelize=require(_0xba28('0x0'));module[_0xba28('0x1')]={'name':{'type':Sequelize[_0xba28('0x2')],'unique':_0xba28('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0efd576..f9bd043 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbafb=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','pick','where','merge','filter','options','Variable','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5c41d5,_0x278aa6){var _0x246341=function(_0x247ce0){while(--_0x247ce0){_0x5c41d5['push'](_0x5c41d5['shift']());}};_0x246341(++_0x278aa6);}(_0xbafb,0x8a));var _0xbbaf=function(_0x382dae,_0xd0b319){_0x382dae=_0x382dae-0x0;var _0x1c700d=_0xbafb[_0x382dae];return _0x1c700d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbaf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbaf('0x1'));var rp=require(_0xbbaf('0x2'));var moment=require(_0xbbaf('0x3'));var BPromise=require(_0xbbaf('0x4'));var Mustache=require(_0xbbaf('0x5'));var util=require(_0xbbaf('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbbaf('0x7'));var ejs=require(_0xbbaf('0x8'));var fs=require('fs');var fs_extra=require(_0xbbaf('0x9'));var _=require('lodash');var squel=require(_0xbbaf('0xa'));var crypto=require(_0xbbaf('0xb'));var jsforce=require(_0xbbaf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbbaf('0x7'));var querystring=require(_0xbbaf('0xd'));var Papa=require(_0xbbaf('0xe'));var Redis=require('ioredis');var authService=require(_0xbbaf('0xf'));var qs=require(_0xbbaf('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbbaf('0x11'));var logger=require(_0xbbaf('0x12'))(_0xbbaf('0x13'));var utils=require('../../config/utils');var config=require(_0xbbaf('0x14'));var licenseUtil=require(_0xbbaf('0x15'));var db=require(_0xbbaf('0x16'))['db'];function respondWithStatusCode(_0x5d4a77,_0xf60949){_0xf60949=_0xf60949||0xcc;return function(_0x530363){if(_0x530363){return _0x5d4a77[_0xbbaf('0x17')](_0xf60949);}return _0x5d4a77[_0xbbaf('0x18')](_0xf60949)[_0xbbaf('0x19')]();};}function respondWithResult(_0x579a94,_0x4d1600){_0x4d1600=_0x4d1600||0xc8;return function(_0x11cf62){if(_0x11cf62){return _0x579a94[_0xbbaf('0x18')](_0x4d1600)[_0xbbaf('0x1a')](_0x11cf62);}};}function respondWithFilteredResult(_0x23a23e,_0x5203f3){return function(_0x4d414f){if(_0x4d414f){var _0x493e0c=typeof _0x5203f3[_0xbbaf('0x1b')]===_0xbbaf('0x1c')&&typeof _0x5203f3[_0xbbaf('0x1d')]===_0xbbaf('0x1c');var _0x39e36d=_0x4d414f[_0xbbaf('0x1e')];var _0x581689=_0x493e0c?0x0:_0x5203f3[_0xbbaf('0x1b')];var _0x39b2a6=_0x493e0c?_0x4d414f[_0xbbaf('0x1e')]:_0x5203f3[_0xbbaf('0x1b')]+_0x5203f3[_0xbbaf('0x1d')];var _0x549b45;if(_0x39b2a6>=_0x39e36d){_0x39b2a6=_0x39e36d;_0x549b45=0xc8;}else{_0x549b45=0xce;}_0x23a23e[_0xbbaf('0x18')](_0x549b45);return _0x23a23e[_0xbbaf('0x1f')](_0xbbaf('0x20'),_0x581689+'-'+_0x39b2a6+'/'+_0x39e36d)['json'](_0x4d414f);}return null;};}function patchUpdates(_0x3465a0){return function(_0x1aab77){try{jsonpatch[_0xbbaf('0x21')](_0x1aab77,_0x3465a0,!![]);}catch(_0x4ed025){return BPromise[_0xbbaf('0x22')](_0x4ed025);}return _0x1aab77[_0xbbaf('0x23')]();};}function saveUpdates(_0xff90e4,_0x16789e){return function(_0x6aa81e){if(_0x6aa81e){return _0x6aa81e[_0xbbaf('0x24')](_0xff90e4)[_0xbbaf('0x25')](function(_0x368133){return _0x368133;});}return null;};}function removeEntity(_0x2c1149,_0x4b9076){return function(_0x56af1c){if(_0x56af1c){return _0x56af1c[_0xbbaf('0x26')]()['then'](function(){var _0x1e10bc=_0x56af1c[_0xbbaf('0x27')]({'plain':!![]});var _0x29262b=_0xbbaf('0x28');return db['UserProfileResource'][_0xbbaf('0x26')]({'where':{'type':_0x29262b,'resourceId':_0x1e10bc['id']}})[_0xbbaf('0x25')](function(){return _0x56af1c;});})['then'](function(){_0x2c1149[_0xbbaf('0x18')](0xcc)[_0xbbaf('0x19')]();});}};}function handleEntityNotFound(_0x86afd6,_0x1c775e){return function(_0x33683f){if(!_0x33683f){_0x86afd6[_0xbbaf('0x17')](0x194);}return _0x33683f;};}function handleError(_0x3ad5cd,_0x23f10d){_0x23f10d=_0x23f10d||0x1f4;return function(_0x572b23){logger['error'](_0x572b23['stack']);if(_0x572b23[_0xbbaf('0x29')]){delete _0x572b23[_0xbbaf('0x29')];}_0x3ad5cd[_0xbbaf('0x18')](_0x23f10d)['send'](_0x572b23);};}exports[_0xbbaf('0x2a')]=function(_0x4fd7a8,_0x3b30f0){var _0x217507={},_0x562f57={},_0x15c41a={'count':0x0,'rows':[]};var _0x303c91=_[_0xbbaf('0x2b')](db['Variable'][_0xbbaf('0x2c')],function(_0x83e259){return{'name':_0x83e259[_0xbbaf('0x2d')],'type':_0x83e259[_0xbbaf('0x2e')][_0xbbaf('0x2f')]};});_0x562f57[_0xbbaf('0x30')]=_['map'](_0x303c91,_0xbbaf('0x29'));_0x562f57[_0xbbaf('0x31')]=_['keys'](_0x4fd7a8['query']);_0x562f57[_0xbbaf('0x32')]=_[_0xbbaf('0x33')](_0x562f57[_0xbbaf('0x30')],_0x562f57[_0xbbaf('0x31')]);_0x217507[_0xbbaf('0x34')]=_[_0xbbaf('0x33')](_0x562f57['model'],qs[_0xbbaf('0x35')](_0x4fd7a8[_0xbbaf('0x31')]['fields']));_0x217507[_0xbbaf('0x34')]=_0x217507[_0xbbaf('0x34')]['length']?_0x217507[_0xbbaf('0x34')]:_0x562f57[_0xbbaf('0x30')];if(!_0x4fd7a8[_0xbbaf('0x31')]['hasOwnProperty']('nolimit')){_0x217507[_0xbbaf('0x1d')]=qs[_0xbbaf('0x1d')](_0x4fd7a8[_0xbbaf('0x31')]['limit']);_0x217507['offset']=qs[_0xbbaf('0x1b')](_0x4fd7a8['query'][_0xbbaf('0x1b')]);}_0x217507[_0xbbaf('0x36')]=qs[_0xbbaf('0x37')](_0x4fd7a8[_0xbbaf('0x31')]['sort']);_0x217507['where']=qs[_0xbbaf('0x32')](_[_0xbbaf('0x38')](_0x4fd7a8[_0xbbaf('0x31')],_0x562f57[_0xbbaf('0x32')]),_0x303c91);if(_0x4fd7a8[_0xbbaf('0x31')]['filter']){_0x217507[_0xbbaf('0x39')]=_[_0xbbaf('0x3a')](_0x217507[_0xbbaf('0x39')],{'$or':_['map'](_0x303c91,function(_0xab82e7){if(_0xab82e7[_0xbbaf('0x2e')]!=='VIRTUAL'){var _0x451a8c={};_0x451a8c[_0xab82e7['name']]={'$like':'%'+_0x4fd7a8[_0xbbaf('0x31')][_0xbbaf('0x3b')]+'%'};return _0x451a8c;}})});}_0x217507=_[_0xbbaf('0x3a')]({},_0x217507,_0x4fd7a8[_0xbbaf('0x3c')]);var _0x4f0672={'where':_0x217507[_0xbbaf('0x39')]};return db[_0xbbaf('0x3d')][_0xbbaf('0x1e')](_0x4f0672)[_0xbbaf('0x25')](function(_0x2747d0){_0x15c41a[_0xbbaf('0x1e')]=_0x2747d0;if(_0x4fd7a8['query'][_0xbbaf('0x3e')]){_0x217507[_0xbbaf('0x3f')]=[{'all':!![]}];}return db[_0xbbaf('0x3d')][_0xbbaf('0x40')](_0x217507);})[_0xbbaf('0x25')](function(_0x367ce0){_0x15c41a[_0xbbaf('0x41')]=_0x367ce0;return _0x15c41a;})[_0xbbaf('0x25')](respondWithFilteredResult(_0x3b30f0,_0x217507))['catch'](handleError(_0x3b30f0,null));};exports[_0xbbaf('0x42')]=function(_0x53e01c,_0x104456){var _0x45a711={'raw':!![],'where':{'id':_0x53e01c[_0xbbaf('0x43')]['id']}},_0x3e7ffb={};_0x3e7ffb[_0xbbaf('0x30')]=_['keys'](db[_0xbbaf('0x3d')][_0xbbaf('0x2c')]);_0x3e7ffb[_0xbbaf('0x31')]=_[_0xbbaf('0x44')](_0x53e01c[_0xbbaf('0x31')]);_0x3e7ffb[_0xbbaf('0x32')]=_[_0xbbaf('0x33')](_0x3e7ffb[_0xbbaf('0x30')],_0x3e7ffb['query']);_0x45a711[_0xbbaf('0x34')]=_[_0xbbaf('0x33')](_0x3e7ffb[_0xbbaf('0x30')],qs[_0xbbaf('0x35')](_0x53e01c[_0xbbaf('0x31')][_0xbbaf('0x35')]));_0x45a711[_0xbbaf('0x34')]=_0x45a711[_0xbbaf('0x34')][_0xbbaf('0x45')]?_0x45a711[_0xbbaf('0x34')]:_0x3e7ffb[_0xbbaf('0x30')];if(_0x53e01c[_0xbbaf('0x31')][_0xbbaf('0x3e')]){_0x45a711[_0xbbaf('0x3f')]=[{'all':!![]}];}_0x45a711=_['merge']({},_0x45a711,_0x53e01c['options']);return db[_0xbbaf('0x3d')][_0xbbaf('0x46')](_0x45a711)['then'](handleEntityNotFound(_0x104456,null))[_0xbbaf('0x25')](respondWithResult(_0x104456,null))[_0xbbaf('0x47')](handleError(_0x104456,null));};exports[_0xbbaf('0x48')]=function(_0xeccf92,_0x4e7b91){return db[_0xbbaf('0x3d')][_0xbbaf('0x48')](_0xeccf92[_0xbbaf('0x49')],{})['then'](function(_0x1f2e96){var _0x346796=_0xeccf92[_0xbbaf('0x4a')][_0xbbaf('0x27')]({'plain':!![]});if(!_0x346796)throw new Error(_0xbbaf('0x4b'));if(_0x346796[_0xbbaf('0x4c')]===_0xbbaf('0x4a')){var _0x5b522f=_0x1f2e96[_0xbbaf('0x27')]({'plain':!![]});var _0x307a92=_0xbbaf('0x28');return db[_0xbbaf('0x4d')][_0xbbaf('0x46')]({'where':{'name':_0x307a92,'userProfileId':_0x346796[_0xbbaf('0x4e')]},'raw':!![]})[_0xbbaf('0x25')](function(_0x3cf59e){if(_0x3cf59e&&_0x3cf59e[_0xbbaf('0x4f')]===0x0){return db[_0xbbaf('0x50')][_0xbbaf('0x48')]({'name':_0x5b522f[_0xbbaf('0x29')],'resourceId':_0x5b522f['id'],'type':_0x3cf59e[_0xbbaf('0x29')],'sectionId':_0x3cf59e['id']},{})['then'](function(){return _0x1f2e96;});}else{return _0x1f2e96;}})[_0xbbaf('0x47')](function(_0x382be9){logger[_0xbbaf('0x51')](_0xbbaf('0x52'),_0x382be9);throw _0x382be9;});}return _0x1f2e96;})['then'](respondWithResult(_0x4e7b91,0xc9))[_0xbbaf('0x47')](handleError(_0x4e7b91,null));};exports[_0xbbaf('0x24')]=function(_0x1a9f1e,_0x26b329){if(_0x1a9f1e[_0xbbaf('0x49')]['id']){delete _0x1a9f1e['body']['id'];}return db['Variable']['find']({'where':{'id':_0x1a9f1e[_0xbbaf('0x43')]['id']}})[_0xbbaf('0x25')](handleEntityNotFound(_0x26b329,null))[_0xbbaf('0x25')](saveUpdates(_0x1a9f1e[_0xbbaf('0x49')],null))[_0xbbaf('0x25')](respondWithResult(_0x26b329,null))[_0xbbaf('0x47')](handleError(_0x26b329,null));};exports['destroy']=function(_0x32d13c,_0x479bd4){return db[_0xbbaf('0x3d')][_0xbbaf('0x46')]({'where':{'id':_0x32d13c['params']['id']}})[_0xbbaf('0x25')](handleEntityNotFound(_0x479bd4,null))[_0xbbaf('0x25')](removeEntity(_0x479bd4,null))[_0xbbaf('0x47')](handleError(_0x479bd4,null));};
\ No newline at end of file
+var _0xdb15=['sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','error','stack','name','send','index','Variable','fieldName','type','key','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','moment','mustache','util','path'];(function(_0x5357ca,_0x801fac){var _0x24a125=function(_0x29ff8c){while(--_0x29ff8c){_0x5357ca['push'](_0x5357ca['shift']());}};_0x24a125(++_0x801fac);}(_0xdb15,0xf1));var _0x5db1=function(_0x31de07,_0x495ba4){_0x31de07=_0x31de07-0x0;var _0x29c60d=_0xdb15[_0x31de07];return _0x29c60d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5db1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5db1('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x5db1('0x2'));var util=require(_0x5db1('0x3'));var path=require(_0x5db1('0x4'));var sox=require(_0x5db1('0x5'));var csv=require(_0x5db1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5db1('0x7'));var _=require(_0x5db1('0x8'));var squel=require(_0x5db1('0x9'));var crypto=require(_0x5db1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5db1('0xb'));var toCsv=require(_0x5db1('0x6'));var querystring=require(_0x5db1('0xc'));var Papa=require(_0x5db1('0xd'));var Redis=require(_0x5db1('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('../../config/logger')(_0x5db1('0xf'));var utils=require(_0x5db1('0x10'));var config=require(_0x5db1('0x11'));var licenseUtil=require(_0x5db1('0x12'));var db=require(_0x5db1('0x13'))['db'];function respondWithStatusCode(_0x178c0a,_0x1f8565){_0x1f8565=_0x1f8565||0xcc;return function(_0x25dfca){if(_0x25dfca){return _0x178c0a[_0x5db1('0x14')](_0x1f8565);}return _0x178c0a['status'](_0x1f8565)['end']();};}function respondWithResult(_0x3abaf3,_0x3bd85e){_0x3bd85e=_0x3bd85e||0xc8;return function(_0x4ba89b){if(_0x4ba89b){return _0x3abaf3[_0x5db1('0x15')](_0x3bd85e)['json'](_0x4ba89b);}};}function respondWithFilteredResult(_0x12b5b6,_0x30e424){return function(_0x295d88){if(_0x295d88){var _0x4fafb3=typeof _0x30e424[_0x5db1('0x16')]==='undefined'&&typeof _0x30e424[_0x5db1('0x17')]===_0x5db1('0x18');var _0x4633a4=_0x295d88[_0x5db1('0x19')];var _0x2ee0d6=_0x4fafb3?0x0:_0x30e424[_0x5db1('0x16')];var _0x4552e0=_0x4fafb3?_0x295d88[_0x5db1('0x19')]:_0x30e424['offset']+_0x30e424[_0x5db1('0x17')];var _0x42b01f;if(_0x4552e0>=_0x4633a4){_0x4552e0=_0x4633a4;_0x42b01f=0xc8;}else{_0x42b01f=0xce;}_0x12b5b6[_0x5db1('0x15')](_0x42b01f);return _0x12b5b6[_0x5db1('0x1a')]('Content-Range',_0x2ee0d6+'-'+_0x4552e0+'/'+_0x4633a4)[_0x5db1('0x1b')](_0x295d88);}return null;};}function patchUpdates(_0x55e663){return function(_0xdda69a){try{jsonpatch[_0x5db1('0x1c')](_0xdda69a,_0x55e663,!![]);}catch(_0x15b9af){return BPromise[_0x5db1('0x1d')](_0x15b9af);}return _0xdda69a[_0x5db1('0x1e')]();};}function saveUpdates(_0x13badd,_0x1490e2){return function(_0x44e4a9){if(_0x44e4a9){return _0x44e4a9[_0x5db1('0x1f')](_0x13badd)[_0x5db1('0x20')](function(_0x2dbfbe){return _0x2dbfbe;});}return null;};}function removeEntity(_0x5146d4,_0x55f1bb){return function(_0x349dff){if(_0x349dff){return _0x349dff[_0x5db1('0x21')]()[_0x5db1('0x20')](function(){var _0x14a9de=_0x349dff[_0x5db1('0x22')]({'plain':!![]});var _0x12ca98=_0x5db1('0x23');return db[_0x5db1('0x24')]['destroy']({'where':{'type':_0x12ca98,'resourceId':_0x14a9de['id']}})[_0x5db1('0x20')](function(){return _0x349dff;});})[_0x5db1('0x20')](function(){_0x5146d4[_0x5db1('0x15')](0xcc)[_0x5db1('0x25')]();});}};}function handleEntityNotFound(_0x4b103c,_0x17911a){return function(_0x946b0a){if(!_0x946b0a){_0x4b103c[_0x5db1('0x14')](0x194);}return _0x946b0a;};}function handleError(_0x2e86e6,_0x3d867d){_0x3d867d=_0x3d867d||0x1f4;return function(_0x551933){logger[_0x5db1('0x26')](_0x551933[_0x5db1('0x27')]);if(_0x551933[_0x5db1('0x28')]){delete _0x551933[_0x5db1('0x28')];}_0x2e86e6[_0x5db1('0x15')](_0x3d867d)[_0x5db1('0x29')](_0x551933);};}exports[_0x5db1('0x2a')]=function(_0x46e452,_0x40e407){var _0x5c0955={},_0xc0cbed={},_0x5e46cc={'count':0x0,'rows':[]};var _0xd7013b=_['map'](db[_0x5db1('0x2b')]['rawAttributes'],function(_0x441322){return{'name':_0x441322[_0x5db1('0x2c')],'type':_0x441322[_0x5db1('0x2d')][_0x5db1('0x2e')]};});_0xc0cbed[_0x5db1('0x2f')]=_[_0x5db1('0x30')](_0xd7013b,'name');_0xc0cbed['query']=_['keys'](_0x46e452['query']);_0xc0cbed[_0x5db1('0x31')]=_[_0x5db1('0x32')](_0xc0cbed[_0x5db1('0x2f')],_0xc0cbed[_0x5db1('0x33')]);_0x5c0955[_0x5db1('0x34')]=_[_0x5db1('0x32')](_0xc0cbed[_0x5db1('0x2f')],qs[_0x5db1('0x35')](_0x46e452[_0x5db1('0x33')][_0x5db1('0x35')]));_0x5c0955[_0x5db1('0x34')]=_0x5c0955[_0x5db1('0x34')][_0x5db1('0x36')]?_0x5c0955[_0x5db1('0x34')]:_0xc0cbed[_0x5db1('0x2f')];if(!_0x46e452['query'][_0x5db1('0x37')](_0x5db1('0x38'))){_0x5c0955[_0x5db1('0x17')]=qs[_0x5db1('0x17')](_0x46e452[_0x5db1('0x33')]['limit']);_0x5c0955[_0x5db1('0x16')]=qs[_0x5db1('0x16')](_0x46e452['query'][_0x5db1('0x16')]);}_0x5c0955[_0x5db1('0x39')]=qs[_0x5db1('0x3a')](_0x46e452[_0x5db1('0x33')]['sort']);_0x5c0955[_0x5db1('0x3b')]=qs[_0x5db1('0x31')](_[_0x5db1('0x3c')](_0x46e452['query'],_0xc0cbed[_0x5db1('0x31')]),_0xd7013b);if(_0x46e452[_0x5db1('0x33')][_0x5db1('0x3d')]){_0x5c0955[_0x5db1('0x3b')]=_[_0x5db1('0x3e')](_0x5c0955[_0x5db1('0x3b')],{'$or':_[_0x5db1('0x30')](_0xd7013b,function(_0x428946){if(_0x428946[_0x5db1('0x2d')]!=='VIRTUAL'){var _0x23c627={};_0x23c627[_0x428946[_0x5db1('0x28')]]={'$like':'%'+_0x46e452[_0x5db1('0x33')][_0x5db1('0x3d')]+'%'};return _0x23c627;}})});}_0x5c0955=_[_0x5db1('0x3e')]({},_0x5c0955,_0x46e452[_0x5db1('0x3f')]);var _0x29a1e4={'where':_0x5c0955['where']};return db[_0x5db1('0x2b')]['count'](_0x29a1e4)[_0x5db1('0x20')](function(_0x686464){_0x5e46cc[_0x5db1('0x19')]=_0x686464;if(_0x46e452[_0x5db1('0x33')]['includeAll']){_0x5c0955[_0x5db1('0x40')]=[{'all':!![]}];}return db[_0x5db1('0x2b')][_0x5db1('0x41')](_0x5c0955);})['then'](function(_0xb0bf3c){_0x5e46cc[_0x5db1('0x42')]=_0xb0bf3c;return _0x5e46cc;})[_0x5db1('0x20')](respondWithFilteredResult(_0x40e407,_0x5c0955))['catch'](handleError(_0x40e407,null));};exports[_0x5db1('0x43')]=function(_0x41ac63,_0x31c244){var _0xb46db0={'raw':!![],'where':{'id':_0x41ac63[_0x5db1('0x44')]['id']}},_0x139322={};_0x139322['model']=_[_0x5db1('0x45')](db[_0x5db1('0x2b')][_0x5db1('0x46')]);_0x139322[_0x5db1('0x33')]=_[_0x5db1('0x45')](_0x41ac63[_0x5db1('0x33')]);_0x139322['filters']=_[_0x5db1('0x32')](_0x139322[_0x5db1('0x2f')],_0x139322[_0x5db1('0x33')]);_0xb46db0[_0x5db1('0x34')]=_[_0x5db1('0x32')](_0x139322[_0x5db1('0x2f')],qs[_0x5db1('0x35')](_0x41ac63[_0x5db1('0x33')][_0x5db1('0x35')]));_0xb46db0[_0x5db1('0x34')]=_0xb46db0[_0x5db1('0x34')]['length']?_0xb46db0['attributes']:_0x139322[_0x5db1('0x2f')];if(_0x41ac63[_0x5db1('0x33')][_0x5db1('0x47')]){_0xb46db0[_0x5db1('0x40')]=[{'all':!![]}];}_0xb46db0=_[_0x5db1('0x3e')]({},_0xb46db0,_0x41ac63[_0x5db1('0x3f')]);return db['Variable'][_0x5db1('0x48')](_0xb46db0)[_0x5db1('0x20')](handleEntityNotFound(_0x31c244,null))['then'](respondWithResult(_0x31c244,null))[_0x5db1('0x49')](handleError(_0x31c244,null));};exports[_0x5db1('0x4a')]=function(_0x100757,_0x362506){return db['Variable'][_0x5db1('0x4a')](_0x100757['body'],{})['then'](function(_0xe53600){var _0x2d6c94=_0x100757['user'][_0x5db1('0x22')]({'plain':!![]});if(!_0x2d6c94)throw new Error(_0x5db1('0x4b'));if(_0x2d6c94[_0x5db1('0x4c')]===_0x5db1('0x4d')){var _0x49d8de=_0xe53600[_0x5db1('0x22')]({'plain':!![]});var _0x4a9cff=_0x5db1('0x23');return db[_0x5db1('0x4e')][_0x5db1('0x48')]({'where':{'name':_0x4a9cff,'userProfileId':_0x2d6c94[_0x5db1('0x4f')]},'raw':!![]})[_0x5db1('0x20')](function(_0x3d7b3a){if(_0x3d7b3a&&_0x3d7b3a['autoAssociation']===0x0){return db[_0x5db1('0x24')]['create']({'name':_0x49d8de[_0x5db1('0x28')],'resourceId':_0x49d8de['id'],'type':_0x3d7b3a[_0x5db1('0x28')],'sectionId':_0x3d7b3a['id']},{})[_0x5db1('0x20')](function(){return _0xe53600;});}else{return _0xe53600;}})['catch'](function(_0x588f64){logger['error'](_0x5db1('0x50'),_0x588f64);throw _0x588f64;});}return _0xe53600;})[_0x5db1('0x20')](respondWithResult(_0x362506,0xc9))[_0x5db1('0x49')](handleError(_0x362506,null));};exports[_0x5db1('0x1f')]=function(_0x42737f,_0x36106a){if(_0x42737f[_0x5db1('0x51')]['id']){delete _0x42737f[_0x5db1('0x51')]['id'];}return db[_0x5db1('0x2b')]['find']({'where':{'id':_0x42737f[_0x5db1('0x44')]['id']}})[_0x5db1('0x20')](handleEntityNotFound(_0x36106a,null))[_0x5db1('0x20')](saveUpdates(_0x42737f[_0x5db1('0x51')],null))[_0x5db1('0x20')](respondWithResult(_0x36106a,null))[_0x5db1('0x49')](handleError(_0x36106a,null));};exports['destroy']=function(_0xb9b546,_0x241ef8){return db[_0x5db1('0x2b')][_0x5db1('0x48')]({'where':{'id':_0xb9b546['params']['id']}})['then'](handleEntityNotFound(_0x241ef8,null))[_0x5db1('0x20')](removeEntity(_0x241ef8,null))[_0x5db1('0x49')](handleError(_0x241ef8,null));};
\ No newline at end of file
index 1cebd9e..004f656 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5775=['tools_variables','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define'];(function(_0x28377a,_0x2bdd24){var _0x575813=function(_0x3a8911){while(--_0x3a8911){_0x28377a['push'](_0x28377a['shift']());}};_0x575813(++_0x2bdd24);}(_0x5775,0x79));var _0x5577=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x5775[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x5577('0x0'));var util=require('util');var logger=require(_0x5577('0x1'))(_0x5577('0x2'));var moment=require(_0x5577('0x3'));var BPromise=require('bluebird');var rp=require(_0x5577('0x4'));var fs=require('fs');var path=require(_0x5577('0x5'));var rimraf=require(_0x5577('0x6'));var config=require(_0x5577('0x7'));var attributes=require(_0x5577('0x8'));module[_0x5577('0x9')]=function(_0x362afc,_0x26f1c9){return _0x362afc[_0x5577('0xa')]('Variable',attributes,{'tableName':_0x5577('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x59e5=['../../config/environment','exports','define','Variable','util','../../config/logger','api','bluebird','path'];(function(_0x59a415,_0x3269f0){var _0x595fbd=function(_0x1e42e7){while(--_0x1e42e7){_0x59a415['push'](_0x59a415['shift']());}};_0x595fbd(++_0x3269f0);}(_0x59e5,0x11b));var _0x559e=function(_0x245793,_0x580900){_0x245793=_0x245793-0x0;var _0x556e18=_0x59e5[_0x245793];return _0x556e18;};'use strict';var _=require('lodash');var util=require(_0x559e('0x0'));var logger=require(_0x559e('0x1'))(_0x559e('0x2'));var moment=require('moment');var BPromise=require(_0x559e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x559e('0x4'));var rimraf=require('rimraf');var config=require(_0x559e('0x5'));var attributes=require('./variable.attributes');module[_0x559e('0x6')]=function(_0x378a25,_0x50798f){return _0x378a25[_0x559e('0x7')](_0x559e('0x8'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 14fd99a..ff037cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x5d01e3,_0x580578){var _0x4671b9=function(_0x233638){while(--_0x233638){_0x5d01e3['push'](_0x5d01e3['shift']());}};_0x4671b9(++_0x580578);}(_0xe14b,0x93));var _0xbe14=function(_0x4eddc6,_0x111b89){_0x4eddc6=_0x4eddc6-0x0;var _0x1d6770=_0xe14b[_0x4eddc6];return _0x1d6770;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});};
\ No newline at end of file
+var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xa41a,0x6b));var _0xaa41=function(_0x4b24c2,_0x494b55){_0x4b24c2=_0x4b24c2-0x0;var _0x52379e=_0xa41a[_0x4b24c2];return _0x52379e;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});};
\ No newline at end of file
index c6ae7e7..3df6c1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83cb=['pull','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','/pull'];(function(_0x195503,_0x24917e){var _0x1f1d32=function(_0x24b9cf){while(--_0x24b9cf){_0x195503['push'](_0x195503['shift']());}};_0x1f1d32(++_0x24917e);}(_0x83cb,0x8a));var _0xb83c=function(_0x2da1f9,_0x5e4269){_0x2da1f9=_0x2da1f9-0x0;var _0x22ef92=_0x83cb[_0x2da1f9];return _0x22ef92;};'use strict';var express=require(_0xb83c('0x0'));var router=express[_0xb83c('0x1')]();var auth=require(_0xb83c('0x2'));var controller=require(_0xb83c('0x3'));router[_0xb83c('0x4')]('/',controller[_0xb83c('0x5')]);router[_0xb83c('0x4')](_0xb83c('0x6'),auth[_0xb83c('0x7')](),auth[_0xb83c('0x8')](),controller['fetch']);router['get'](_0xb83c('0x9'),auth[_0xb83c('0x7')](),auth['canUpdate'](),controller[_0xb83c('0xa')]);router['get'](_0xb83c('0xb'),auth[_0xb83c('0x7')](),auth[_0xb83c('0x8')](),controller[_0xb83c('0xc')]);router[_0xb83c('0x4')]('/restart',auth[_0xb83c('0x7')](),controller['restart']);router[_0xb83c('0x4')]('/migrations',controller[_0xb83c('0xd')]);module[_0xb83c('0xe')]=router;
\ No newline at end of file
+var _0x0123=['Router','get','index','/fetch','canUpdate','/reset','isAuthenticated','reset','pull','restart','/migrations','migrations','express'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x0123,0xb5));var _0x3012=function(_0x3809e0,_0x3c2e4e){_0x3809e0=_0x3809e0-0x0;var _0x5447d4=_0x0123[_0x3809e0];return _0x5447d4;};'use strict';var express=require(_0x3012('0x0'));var router=express[_0x3012('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x3012('0x2')]('/',controller[_0x3012('0x3')]);router['get'](_0x3012('0x4'),auth['isAuthenticated'](),auth[_0x3012('0x5')](),controller['fetch']);router[_0x3012('0x2')](_0x3012('0x6'),auth[_0x3012('0x7')](),auth[_0x3012('0x5')](),controller[_0x3012('0x8')]);router[_0x3012('0x2')]('/pull',auth[_0x3012('0x7')](),auth[_0x3012('0x5')](),controller[_0x3012('0x9')]);router['get']('/restart',auth[_0x3012('0x7')](),controller[_0x3012('0xa')]);router['get'](_0x3012('0xb'),controller[_0x3012('0xc')]);module['exports']=router;
\ No newline at end of file
index f524862..43b0a62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27dc=['root','index','query','latest','fetch','tags','exports','2.0.0','json','status','origin','git\x20fetch','reset','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','server','replace','.js','push','length','sort','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','\x20to\x20','last','catch','sequelize','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git'];(function(_0x37e161,_0x2b6add){var _0x42d9e9=function(_0x280e28){while(--_0x280e28){_0x37e161['push'](_0x37e161['shift']());}};_0x42d9e9(++_0x2b6add);}(_0x27dc,0x8f));var _0xc27d=function(_0xd91574,_0x43bdfe){_0xd91574=_0xd91574-0x0;var _0x481540=_0x27dc[_0xd91574];return _0x481540;};'use strict';var Umzug=require(_0xc27d('0x0'));var path=require(_0xc27d('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xc27d('0x2'))(module,_0xc27d('0x3'));var compareVersions=require(_0xc27d('0x4'));var exec=require(_0xc27d('0x5'))[_0xc27d('0x6')];var db=require(_0xc27d('0x7'))['db'];var config=require(_0xc27d('0x8'));var pm2=require(_0xc27d('0x9'));var logger=require(_0xc27d('0xa'))(_0xc27d('0xb'));var git=require(_0xc27d('0xc'))(config[_0xc27d('0xd')]);exports[_0xc27d('0xe')]=function(_0x4f6c6b,_0x558c80){var _0x28e4ce={'current':module['exports'][_0xc27d('0x3')],'phonebar':0x2};if(_0x4f6c6b[_0xc27d('0xf')]&&_0x4f6c6b[_0xc27d('0xf')][_0xc27d('0x10')]){return git[_0xc27d('0x11')]()[_0xc27d('0x12')](function(_0x37254a,_0x17748f){_0x28e4ce[_0xc27d('0x10')]=(_0x37254a?module[_0xc27d('0x13')]['version']:_0x17748f['latest'])||_0xc27d('0x14');return _0x558c80['status'](0xc8)[_0xc27d('0x15')](_0x28e4ce);});}else{return _0x558c80[_0xc27d('0x16')](0xc8)[_0xc27d('0x15')](_0x28e4ce);}};exports[_0xc27d('0x11')]=function(_0x403d93,_0x1e7768){return git[_0xc27d('0x11')]([_0xc27d('0x17'),'master'],function(_0x106ed5){if(_0x106ed5){logger['error'](_0x106ed5);return _0x1e7768[_0xc27d('0x16')](0x1f4)['json'](_0x106ed5);}logger['info'](_0xc27d('0x18'));return _0x1e7768['status'](0xc8)[_0xc27d('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xc27d('0x19')]=function(_0x3b8f1b,_0x4fa72a){return git[_0xc27d('0x19')](['--hard','FETCH_HEAD'],function(_0x289a3b){if(_0x289a3b){logger[_0xc27d('0x1a')](_0x289a3b);return _0x4fa72a[_0xc27d('0x16')](0x1f4)[_0xc27d('0x15')](_0x289a3b);}logger[_0xc27d('0x1b')](_0xc27d('0x1c'));return _0x4fa72a[_0xc27d('0x16')](0xc8)['json']({'output':_0xc27d('0x1d')});});};exports['pull']=function(_0x4e6252,_0xc8785){exec('npm\x20install\x20--production',function(_0x536d3f,_0x476981,_0x371467){logger['info'](_0x476981);logger[_0xc27d('0x1b')](_0x371467);if(_0x536d3f){logger['error'](_0x536d3f);return _0xc8785[_0xc27d('0x16')](0x1f4)[_0xc27d('0x15')](_0x536d3f);}return _0xc8785[_0xc27d('0x16')](0xc8)[_0xc27d('0x15')]({'output':_0x476981});});};exports[_0xc27d('0x1e')]=function(_0x36255f,_0x9777fc){return pm2['restart']('motion2')[_0xc27d('0x1f')](function(_0x103ac6){logger[_0xc27d('0x1b')](_0xc27d('0x20'),_0x103ac6);return _0x9777fc['status'](0xc8)[_0xc27d('0x15')]({'output':_0xc27d('0x21')});})['catch'](function(_0x2888cd){logger['error'](_0x2888cd);return _0x9777fc[_0xc27d('0x16')](0x1f4)['json'](_0x2888cd);});};exports[_0xc27d('0x22')]=function(_0x54bb03,_0x209334){var _0x4333f2=fs['readdirSync'](path['join'](config['root'],_0xc27d('0x23'),_0xc27d('0x22')));var _0x2c1957=[];for(var _0x10815f=0x0;_0x10815f<_0x4333f2['length'];_0x10815f++){var _0x2652d5=_0x4333f2[_0x10815f][_0xc27d('0x24')](_0xc27d('0x25'),'');if(compareVersions(module[_0xc27d('0x13')][_0xc27d('0x3')],_0x2652d5)===-0x1){_0x2c1957[_0xc27d('0x26')](_0x2652d5);}}if(_0x2c1957[_0xc27d('0x27')]){var _0x393de6=_0x2c1957[_0xc27d('0x28')](compareVersions);var _0x88b32a=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0xc27d('0x3')},'migrations':{'params':[db['sequelize'][_0xc27d('0x29')](),db['sequelize'][_0xc27d('0x2a')],function(){throw new Error(_0xc27d('0x2b'));}],'path':path[_0xc27d('0x2c')](config[_0xc27d('0xd')],_0xc27d('0x23'),_0xc27d('0x22')),'pattern':/\.js$/}});_0x88b32a['up']({'migrations':_[_0xc27d('0x2d')](_0x393de6,function(_0x52800b){return _0x52800b+'.js';})})[_0xc27d('0x1f')](function(){return _0x209334[_0xc27d('0x16')](0xc8)[_0xc27d('0x15')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xc27d('0x3')]+_0xc27d('0x2e')+_[_0xc27d('0x2f')](_0x393de6),'migrations':_[_0xc27d('0x2c')](_0x393de6)});})[_0xc27d('0x30')](function(_0x5ba695){if(_0x5ba695 instanceof db[_0xc27d('0x31')][_0xc27d('0x32')]){return _0x209334['status'](0xc8)[_0xc27d('0x15')]({'output':_0xc27d('0x33')});}else{return _0x209334[_0xc27d('0x16')](0x1f4)[_0xc27d('0x15')](_0x5ba695);}});}else{return _0x209334[_0xc27d('0x16')](0xc8)[_0xc27d('0x15')]({'output':_0xc27d('0x33')});}};
\ No newline at end of file
+var _0x979f=['Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','root','server','replace','.js','push','sort','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0x979f,0xf2));var _0xf979=function(_0x162da8,_0x1f40aa){_0x162da8=_0x162da8-0x0;var _0x4226b0=_0x979f[_0x162da8];return _0x4226b0;};'use strict';var Umzug=require('umzug');var path=require(_0xf979('0x0'));var fs=require('fs');var _=require(_0xf979('0x1'));var pkginfo=require(_0xf979('0x2'))(module,_0xf979('0x3'));var compareVersions=require(_0xf979('0x4'));var exec=require(_0xf979('0x5'))[_0xf979('0x6')];var db=require(_0xf979('0x7'))['db'];var config=require(_0xf979('0x8'));var pm2=require(_0xf979('0x9'));var logger=require(_0xf979('0xa'))(_0xf979('0xb'));var git=require(_0xf979('0xc'))(config['root']);exports[_0xf979('0xd')]=function(_0x4ae693,_0x32df94){var _0x65a570={'current':module[_0xf979('0xe')]['version'],'phonebar':0x2};if(_0x4ae693['query']&&_0x4ae693[_0xf979('0xf')][_0xf979('0x10')]){return git[_0xf979('0x11')]()[_0xf979('0x12')](function(_0x3a0690,_0x4b52ab){_0x65a570[_0xf979('0x10')]=(_0x3a0690?module[_0xf979('0xe')][_0xf979('0x3')]:_0x4b52ab[_0xf979('0x10')])||_0xf979('0x13');return _0x32df94[_0xf979('0x14')](0xc8)[_0xf979('0x15')](_0x65a570);});}else{return _0x32df94[_0xf979('0x14')](0xc8)[_0xf979('0x15')](_0x65a570);}};exports[_0xf979('0x11')]=function(_0xf8e0f7,_0x4ed9df){return git[_0xf979('0x11')]([_0xf979('0x16'),_0xf979('0x17')],function(_0x563c30){if(_0x563c30){logger[_0xf979('0x18')](_0x563c30);return _0x4ed9df[_0xf979('0x14')](0x1f4)['json'](_0x563c30);}logger[_0xf979('0x19')](_0xf979('0x1a'));return _0x4ed9df[_0xf979('0x14')](0xc8)[_0xf979('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x402281,_0x5db302){return git[_0xf979('0x1b')]([_0xf979('0x1c'),_0xf979('0x1d')],function(_0x5cb4b0){if(_0x5cb4b0){logger[_0xf979('0x18')](_0x5cb4b0);return _0x5db302[_0xf979('0x14')](0x1f4)[_0xf979('0x15')](_0x5cb4b0);}logger[_0xf979('0x19')](_0xf979('0x1e'));return _0x5db302[_0xf979('0x14')](0xc8)[_0xf979('0x15')]({'output':_0xf979('0x1f')});});};exports[_0xf979('0x20')]=function(_0x13f037,_0x70e0ce){exec(_0xf979('0x21'),function(_0x46349f,_0x26ba33,_0x1b33dd){logger[_0xf979('0x19')](_0x26ba33);logger['info'](_0x1b33dd);if(_0x46349f){logger[_0xf979('0x18')](_0x46349f);return _0x70e0ce[_0xf979('0x14')](0x1f4)['json'](_0x46349f);}return _0x70e0ce[_0xf979('0x14')](0xc8)[_0xf979('0x15')]({'output':_0x26ba33});});};exports[_0xf979('0x22')]=function(_0x4ebeea,_0xca0a03){return pm2['restart'](_0xf979('0x23'))[_0xf979('0x24')](function(_0x2157d9){logger[_0xf979('0x19')](_0xf979('0x25'),_0x2157d9);return _0xca0a03['status'](0xc8)[_0xf979('0x15')]({'output':_0xf979('0x26')});})['catch'](function(_0x1fc842){logger[_0xf979('0x18')](_0x1fc842);return _0xca0a03[_0xf979('0x14')](0x1f4)[_0xf979('0x15')](_0x1fc842);});};exports[_0xf979('0x27')]=function(_0x5c7da8,_0x209b33){var _0x12ae69=fs['readdirSync'](path['join'](config[_0xf979('0x28')],_0xf979('0x29'),_0xf979('0x27')));var _0x4afad3=[];for(var _0xae03da=0x0;_0xae03da<_0x12ae69['length'];_0xae03da++){var _0x300adb=_0x12ae69[_0xae03da][_0xf979('0x2a')](_0xf979('0x2b'),'');if(compareVersions(module['exports'][_0xf979('0x3')],_0x300adb)===-0x1){_0x4afad3[_0xf979('0x2c')](_0x300adb);}}if(_0x4afad3['length']){var _0x46ca59=_0x4afad3[_0xf979('0x2d')](compareVersions);var _0x1d0537=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xf979('0x2e')],'modelName':_0xf979('0x2e'),'columnName':'version'},'migrations':{'params':[db[_0xf979('0x2f')]['getQueryInterface'](),db['sequelize'][_0xf979('0x30')],function(){throw new Error(_0xf979('0x31'));}],'path':path[_0xf979('0x32')](config[_0xf979('0x28')],'server',_0xf979('0x27')),'pattern':/\.js$/}});_0x1d0537['up']({'migrations':_[_0xf979('0x33')](_0x46ca59,function(_0x4ba351){return _0x4ba351+'.js';})})['then'](function(){return _0x209b33[_0xf979('0x14')](0xc8)[_0xf979('0x15')]({'output':_0xf979('0x34')+module[_0xf979('0xe')][_0xf979('0x3')]+'\x20to\x20'+_[_0xf979('0x35')](_0x46ca59),'migrations':_[_0xf979('0x32')](_0x46ca59)});})['catch'](function(_0xc113ca){if(_0xc113ca instanceof db[_0xf979('0x2f')][_0xf979('0x36')]){return _0x209b33['status'](0xc8)[_0xf979('0x15')]({'output':_0xf979('0x37')});}else{return _0x209b33[_0xf979('0x14')](0x1f4)['json'](_0xc113ca);}});}else{return _0x209b33[_0xf979('0x14')](0xc8)[_0xf979('0x15')]({'output':_0xf979('0x37')});}};
\ No newline at end of file
index ceab161..6b61b82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4297=['../../components/auth/service','./voiceAgentReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x4297,0x1d7));var _0x7429=function(_0x3a1ea8,_0x248961){_0x3a1ea8=_0x3a1ea8-0x0;var _0x4bee5a=_0x4297[_0x3a1ea8];return _0x4bee5a;};'use strict';var multer=require(_0x7429('0x0'));var util=require(_0x7429('0x1'));var path=require(_0x7429('0x2'));var timeout=require(_0x7429('0x3'));var express=require('express');var router=express[_0x7429('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7429('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7429('0x6'));router[_0x7429('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7429('0x7')](_0x7429('0x8'),auth[_0x7429('0x9')](),controller['describe']);router[_0x7429('0x7')](_0x7429('0xa'),auth[_0x7429('0x9')](),controller[_0x7429('0xb')]);router[_0x7429('0xc')]('/',auth[_0x7429('0x9')](),controller[_0x7429('0xd')]);router[_0x7429('0xe')](_0x7429('0xa'),auth['isAuthenticated'](),controller[_0x7429('0xf')]);router['delete'](_0x7429('0xa'),auth[_0x7429('0x9')](),controller['destroy']);module[_0x7429('0x10')]=router;
\ No newline at end of file
+var _0x554c=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x554c,0x14b));var _0xc554=function(_0x4df62a,_0x152e28){_0x4df62a=_0x4df62a-0x0;var _0x1d5c56=_0x554c[_0x4df62a];return _0x1d5c56;};'use strict';var multer=require(_0xc554('0x0'));var util=require(_0xc554('0x1'));var path=require(_0xc554('0x2'));var timeout=require(_0xc554('0x3'));var express=require(_0xc554('0x4'));var router=express[_0xc554('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc554('0x6'));var interaction=require(_0xc554('0x7'));var config=require(_0xc554('0x8'));var controller=require(_0xc554('0x9'));router[_0xc554('0xa')]('/',auth[_0xc554('0xb')](),controller[_0xc554('0xc')]);router[_0xc554('0xa')](_0xc554('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xc554('0xa')](_0xc554('0xe'),auth[_0xc554('0xb')](),controller[_0xc554('0xf')]);router[_0xc554('0x10')]('/',auth[_0xc554('0xb')](),controller[_0xc554('0x11')]);router[_0xc554('0x12')]('/:id',auth[_0xc554('0xb')](),controller[_0xc554('0x13')]);router[_0xc554('0x14')](_0xc554('0xe'),auth[_0xc554('0xb')](),controller['destroy']);module[_0xc554('0x15')]=router;
\ No newline at end of file
index 3e6b1e9..c6ebefc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x422baa,_0x98d34a){var _0x31c810=function(_0xa554fe){while(--_0xa554fe){_0x422baa['push'](_0x422baa['shift']());}};_0x31c810(++_0x98d34a);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x45128c,_0x196bc6){_0x45128c=_0x45128c-0x0;var _0x3122f9=_0xf4f4[_0x45128c];return _0x3122f9;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4f4f('0x2')]},'calleridnum':{'type':Sequelize[_0x4f4f('0x2')]},'calleridname':{'type':Sequelize[_0x4f4f('0x2')]},'queue':{'type':Sequelize[_0x4f4f('0x2')]},'interface':{'type':Sequelize[_0x4f4f('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x4f4f('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x4f4f('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x4f4f('0x3')]},'agentdumpAt':{'type':Sequelize[_0x4f4f('0x3')]},'holdtime':{'type':Sequelize[_0x4f4f('0x4')]},'agentcomplete':{'type':Sequelize[_0x4f4f('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4f4f('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4f4f('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4f4f('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4f4f('0x4')]},'reason':{'type':Sequelize[_0x4f4f('0x2')]},'lastevent':{'type':Sequelize[_0x4f4f('0x2')]},'channel':{'type':Sequelize[_0x4f4f('0x2')]},'channelstate':{'type':Sequelize[_0x4f4f('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4f4f('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4f4f('0x2')]},'connectedlinename':{'type':Sequelize[_0x4f4f('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4f4f('0x2')]},'exten':{'type':Sequelize[_0x4f4f('0x2')]},'priority':{'type':Sequelize[_0x4f4f('0x2')]},'destchannel':{'type':Sequelize[_0x4f4f('0x2')]},'destchannelstate':{'type':Sequelize[_0x4f4f('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x4f4f('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4f4f('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x4f4f('0x2')]},'destlanguage':{'type':Sequelize[_0x4f4f('0x2')]},'destaccountcode':{'type':Sequelize[_0x4f4f('0x2')]},'destcontext':{'type':Sequelize[_0x4f4f('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x4f4f('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x4f4f('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4f4f('0x2')],'comment':_0x4f4f('0x6')},'transferexten':{'type':Sequelize[_0x4f4f('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4f4f('0x2')]},'agententerreason':{'type':Sequelize[_0x4f4f('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7be1=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x4c5aa3,_0x31989b){var _0x1bcfa2=function(_0x16685d){while(--_0x16685d){_0x4c5aa3['push'](_0x4c5aa3['shift']());}};_0x1bcfa2(++_0x31989b);}(_0x7be1,0x165));var _0x17be=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x7be1[_0x3b150c];return _0x5cd414;};'use strict';var Sequelize=require(_0x17be('0x0'));module[_0x17be('0x1')]={'type':{'type':Sequelize[_0x17be('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x17be('0x2')]},'calleridname':{'type':Sequelize[_0x17be('0x2')]},'queue':{'type':Sequelize[_0x17be('0x2')]},'interface':{'type':Sequelize[_0x17be('0x2')]},'membername':{'type':Sequelize[_0x17be('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x17be('0x3')]},'agentdumpAt':{'type':Sequelize[_0x17be('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x17be('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x17be('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x17be('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x17be('0x5')]},'agentacw':{'type':Sequelize[_0x17be('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x17be('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x17be('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x17be('0x5')]},'channelstatedesc':{'type':Sequelize[_0x17be('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x17be('0x2')]},'language':{'type':Sequelize[_0x17be('0x2')]},'accountcode':{'type':Sequelize[_0x17be('0x2')]},'context':{'type':Sequelize[_0x17be('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x17be('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x17be('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x17be('0x2')]},'destcalleridname':{'type':Sequelize[_0x17be('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x17be('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x17be('0x2')]},'destlanguage':{'type':Sequelize[_0x17be('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x17be('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x17be('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x17be('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x17be('0x2')],'comment':_0x17be('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x17be('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index cfce852..6806d33 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(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 9b2ccde..5b0036a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda19=['request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','moment'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xda19,0xd5));var _0x9da1=function(_0x349ea1,_0x4f019d){_0x349ea1=_0x349ea1-0x0;var _0x15b460=_0xda19[_0x349ea1];return _0x15b460;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9da1('0xb'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a52=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','destuniqueid','lodash','util','api','moment','bluebird','path'];(function(_0x55b96d,_0x2a0db9){var _0x438583=function(_0x448437){while(--_0x448437){_0x55b96d['push'](_0x55b96d['shift']());}};_0x438583(++_0x2a0db9);}(_0x0a52,0xe4));var _0x20a5=function(_0x4a02e5,_0x2cdf02){_0x4a02e5=_0x4a02e5-0x0;var _0x2e75b9=_0x0a52[_0x4a02e5];return _0x2e75b9;};'use strict';var _=require(_0x20a5('0x0'));var util=require(_0x20a5('0x1'));var logger=require('../../config/logger')(_0x20a5('0x2'));var moment=require(_0x20a5('0x3'));var BPromise=require(_0x20a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a5('0x5'));var rimraf=require(_0x20a5('0x6'));var config=require(_0x20a5('0x7'));var attributes=require(_0x20a5('0x8'));module[_0x20a5('0x9')]=function(_0x1fcc72,_0x4acc66){return _0x1fcc72['define'](_0x20a5('0xa'),attributes,{'tableName':_0x20a5('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x20a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index ba99f45..707bd71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95af=['error','code','message','info','result','catch','VoiceAgentReport','create','body','options','raw','then','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3860f7,_0x386844){var _0xb5e09e=function(_0x4e6714){while(--_0x4e6714){_0x3860f7['push'](_0x3860f7['shift']());}};_0xb5e09e(++_0x386844);}(_0x95af,0xdd));var _0xf95a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x95af[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xf95a('0x0'));var util=require('util');var moment=require(_0xf95a('0x1'));var BPromise=require(_0xf95a('0x2'));var rs=require(_0xf95a('0x3'));var fs=require('fs');var Redis=require(_0xf95a('0x4'));var db=require(_0xf95a('0x5'))['db'];var utils=require(_0xf95a('0x6'));var logger=require(_0xf95a('0x7'))(_0xf95a('0x8'));var config=require(_0xf95a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf95a('0xa')][_0xf95a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x184cdc,_0x46a4c9,_0x428ad6){return new BPromise(function(_0x44b700,_0x3df314){return client['request'](_0x184cdc,_0x428ad6)['then'](function(_0xfad353){logger['info'](_0xf95a('0xc'),_0x46a4c9,_0xf95a('0xd'));logger[_0xf95a('0xe')](_0xf95a('0xf'),_0x46a4c9,_0xf95a('0xd'),JSON[_0xf95a('0x10')](_0xfad353));if(_0xfad353[_0xf95a('0x11')]){if(_0xfad353[_0xf95a('0x11')][_0xf95a('0x12')]===0x1f4){logger['error'](_0xf95a('0xc'),_0x46a4c9,_0xfad353['error']['message']);return _0x3df314(_0xfad353[_0xf95a('0x11')][_0xf95a('0x13')]);}logger[_0xf95a('0x11')](_0xf95a('0xc'),_0x46a4c9,_0xfad353[_0xf95a('0x11')][_0xf95a('0x13')]);return _0x44b700(_0xfad353[_0xf95a('0x11')][_0xf95a('0x13')]);}else{logger[_0xf95a('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0x46a4c9,_0xf95a('0xd'));_0x44b700(_0xfad353[_0xf95a('0x15')][_0xf95a('0x13')]);}})[_0xf95a('0x16')](function(_0x43bdf3){logger['error'](_0xf95a('0xc'),_0x46a4c9,_0x43bdf3);_0x3df314(_0x43bdf3);});});}exports['CreateVoiceAgentReport']=function(_0x160846){var _0x1eba67=this;return new Promise(function(_0x556a9c,_0x38e87c){return db[_0xf95a('0x17')][_0xf95a('0x18')](_0x160846[_0xf95a('0x19')],{'raw':_0x160846[_0xf95a('0x1a')]?_0x160846[_0xf95a('0x1a')][_0xf95a('0x1b')]===undefined?!![]:![]:!![]})[_0xf95a('0x1c')](function(_0x2b5e10){logger[_0xf95a('0x14')](_0xf95a('0x1d'),_0x160846);logger[_0xf95a('0xe')](_0xf95a('0x1d'),_0x160846,JSON[_0xf95a('0x10')](_0x2b5e10));_0x556a9c(_0x2b5e10);})[_0xf95a('0x16')](function(_0x5d76c9){logger['error'](_0xf95a('0x1d'),_0x5d76c9[_0xf95a('0x13')],_0x160846);_0x38e87c(_0x1eba67[_0xf95a('0x11')](0x1f4,_0x5d76c9[_0xf95a('0x13')]));});});};exports[_0xf95a('0x1e')]=function(_0x3d4914){var _0xf46aac=this;return new Promise(function(_0xac8d3d,_0x5796ec){return db[_0xf95a('0x17')][_0xf95a('0x1f')](_0x3d4914['body'],{'raw':_0x3d4914[_0xf95a('0x1a')]?_0x3d4914['options'][_0xf95a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d4914[_0xf95a('0x1a')]?_0x3d4914[_0xf95a('0x1a')][_0xf95a('0x20')]||null:null,'attributes':_0x3d4914[_0xf95a('0x1a')]?_0x3d4914[_0xf95a('0x1a')][_0xf95a('0x21')]||null:null,'limit':_0x3d4914[_0xf95a('0x1a')]?_0x3d4914['options']['limit']||null:null})[_0xf95a('0x1c')](function(_0x29e145){logger[_0xf95a('0x14')]('UpdateVoiceAgentReport',_0x3d4914);logger[_0xf95a('0xe')](_0xf95a('0x1e'),_0x3d4914,JSON[_0xf95a('0x10')](_0x29e145));_0xac8d3d(_0x29e145);})[_0xf95a('0x16')](function(_0x513d8f){logger[_0xf95a('0x11')](_0xf95a('0x1e'),_0x513d8f[_0xf95a('0x13')],_0x3d4914);_0x5796ec(_0xf46aac[_0xf95a('0x11')](0x1f4,_0x513d8f['message']));});});};
\ No newline at end of file
+var _0x8bc1=['result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','then','UpdateVoiceAgentReport','update','where','attributes','limit','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','VoiceAgentReport,\x20%s,\x20%s','message'];(function(_0x5193e5,_0x36cd71){var _0x27cb8a=function(_0x5140ca){while(--_0x5140ca){_0x5193e5['push'](_0x5193e5['shift']());}};_0x27cb8a(++_0x36cd71);}(_0x8bc1,0x193));var _0x18bc=function(_0x3c0960,_0x21cac0){_0x3c0960=_0x3c0960-0x0;var _0x43d706=_0x8bc1[_0x3c0960];return _0x43d706;};'use strict';var _=require('lodash');var util=require(_0x18bc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x18bc('0x1'));var fs=require('fs');var Redis=require(_0x18bc('0x2'));var db=require(_0x18bc('0x3'))['db'];var utils=require(_0x18bc('0x4'));var logger=require(_0x18bc('0x5'))('rpc');var config=require(_0x18bc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x18bc('0x7')][_0x18bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc325b0,_0x17bafa,_0xb3f516){return new BPromise(function(_0x33fc1c,_0x4db061){return client[_0x18bc('0x9')](_0xc325b0,_0xb3f516)['then'](function(_0x4f454b){logger[_0x18bc('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x17bafa,_0x18bc('0xb'));logger[_0x18bc('0xc')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x17bafa,_0x18bc('0xb'),JSON[_0x18bc('0xd')](_0x4f454b));if(_0x4f454b[_0x18bc('0xe')]){if(_0x4f454b[_0x18bc('0xe')]['code']===0x1f4){logger[_0x18bc('0xe')](_0x18bc('0xf'),_0x17bafa,_0x4f454b[_0x18bc('0xe')][_0x18bc('0x10')]);return _0x4db061(_0x4f454b[_0x18bc('0xe')][_0x18bc('0x10')]);}logger[_0x18bc('0xe')](_0x18bc('0xf'),_0x17bafa,_0x4f454b[_0x18bc('0xe')]['message']);return _0x33fc1c(_0x4f454b[_0x18bc('0xe')][_0x18bc('0x10')]);}else{logger[_0x18bc('0xa')](_0x18bc('0xf'),_0x17bafa,'request\x20sent');_0x33fc1c(_0x4f454b[_0x18bc('0x11')][_0x18bc('0x10')]);}})['catch'](function(_0x33142b){logger[_0x18bc('0xe')](_0x18bc('0xf'),_0x17bafa,_0x33142b);_0x4db061(_0x33142b);});});}exports[_0x18bc('0x12')]=function(_0x16aed5){var _0x33334e=this;return new Promise(function(_0x5900ea,_0x33473e){return db[_0x18bc('0x13')][_0x18bc('0x14')](_0x16aed5[_0x18bc('0x15')],{'raw':_0x16aed5[_0x18bc('0x16')]?_0x16aed5[_0x18bc('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x18bc('0x17')](function(_0x22dfa6){logger['info'](_0x18bc('0x12'),_0x16aed5);logger[_0x18bc('0xc')](_0x18bc('0x12'),_0x16aed5,JSON[_0x18bc('0xd')](_0x22dfa6));_0x5900ea(_0x22dfa6);})['catch'](function(_0x36e0d2){logger[_0x18bc('0xe')]('CreateVoiceAgentReport',_0x36e0d2['message'],_0x16aed5);_0x33473e(_0x33334e['error'](0x1f4,_0x36e0d2[_0x18bc('0x10')]));});});};exports[_0x18bc('0x18')]=function(_0xa1f078){var _0x21395b=this;return new Promise(function(_0x4f8b21,_0x42b223){return db[_0x18bc('0x13')][_0x18bc('0x19')](_0xa1f078[_0x18bc('0x15')],{'raw':_0xa1f078[_0x18bc('0x16')]?_0xa1f078[_0x18bc('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa1f078[_0x18bc('0x16')]?_0xa1f078[_0x18bc('0x16')][_0x18bc('0x1a')]||null:null,'attributes':_0xa1f078[_0x18bc('0x16')]?_0xa1f078[_0x18bc('0x16')][_0x18bc('0x1b')]||null:null,'limit':_0xa1f078[_0x18bc('0x16')]?_0xa1f078[_0x18bc('0x16')][_0x18bc('0x1c')]||null:null})['then'](function(_0x6e9268){logger[_0x18bc('0xa')](_0x18bc('0x18'),_0xa1f078);logger[_0x18bc('0xc')]('UpdateVoiceAgentReport',_0xa1f078,JSON[_0x18bc('0xd')](_0x6e9268));_0x4f8b21(_0x6e9268);})[_0x18bc('0x1d')](function(_0x60c7bf){logger['error']('UpdateVoiceAgentReport',_0x60c7bf[_0x18bc('0x10')],_0xa1f078);_0x42b223(_0x21395b['error'](0x1f4,_0x60c7bf['message']));});});};
\ No newline at end of file
index 691843c..c96f676 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf006=['post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0xf006,0x146));var _0x6f00=function(_0xca556d,_0x63b8d3){_0xca556d=_0xca556d-0x0;var _0x1b0e0a=_0xf006[_0xca556d];return _0x1b0e0a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xc')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xd')]);router['delete'](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);module[_0x6f00('0xf')]=router;
\ No newline at end of file
+var _0x4b84=['update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','isAuthenticated','show','post','create','put','/:id'];(function(_0x438e18,_0x52e2c5){var _0x50c6ea=function(_0x7ae358){while(--_0x7ae358){_0x438e18['push'](_0x438e18['shift']());}};_0x50c6ea(++_0x52e2c5);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0x4b84[_0x1c6089];return _0x4d97c1;};'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('./voiceCallReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router['get']('/:id',auth[_0x44b8('0x9')](),controller[_0x44b8('0xa')]);router[_0x44b8('0xb')]('/',auth['isAuthenticated'](),controller[_0x44b8('0xc')]);router[_0x44b8('0xd')](_0x44b8('0xe'),auth[_0x44b8('0x9')](),controller[_0x44b8('0xf')]);router[_0x44b8('0x10')](_0x44b8('0xe'),auth['isAuthenticated'](),controller[_0x44b8('0x11')]);module[_0x44b8('0x12')]=router;
\ No newline at end of file
index 7b4cb0e..955648c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc473=['DATE','INTEGER','exports','STRING','inbound','internal','outbound','outbound-fax','dialer','TEXT'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0xc473,0x174));var _0x3c47=function(_0x91c951,_0x2988ba){_0x91c951=_0x91c951-0x0;var _0xc454d1=_0xc473[_0x91c951];return _0xc454d1;};'use strict';var Sequelize=require('sequelize');module[_0x3c47('0x0')]={'uniqueid':{'type':Sequelize[_0x3c47('0x1')]},'type':{'type':Sequelize['ENUM'](_0x3c47('0x2'),_0x3c47('0x3'),_0x3c47('0x4'),'inbound-fax',_0x3c47('0x5'),_0x3c47('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3c47('0x1')]},'source':{'type':Sequelize[_0x3c47('0x1')]},'destination':{'type':Sequelize[_0x3c47('0x1')]},'destinationcontext':{'type':Sequelize[_0x3c47('0x1')]},'callerid':{'type':Sequelize[_0x3c47('0x1')]},'channel':{'type':Sequelize[_0x3c47('0x1')]},'destinationchannel':{'type':Sequelize[_0x3c47('0x1')]},'lastapplication':{'type':Sequelize[_0x3c47('0x1')]},'lastdata':{'type':Sequelize[_0x3c47('0x7')]},'starttime':{'type':Sequelize[_0x3c47('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x3c47('0x8')]},'endtime':{'type':Sequelize[_0x3c47('0x8')]},'duration':{'type':Sequelize[_0x3c47('0x9')]},'billableseconds':{'type':Sequelize[_0x3c47('0x9')]},'mohtime':{'type':Sequelize[_0x3c47('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x3c47('0x1')]},'userfield':{'type':Sequelize[_0x3c47('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x3c47('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x3c47('0x1')]},'note':{'type':Sequelize[_0x3c47('0x1')]},'prefix':{'type':Sequelize[_0x3c47('0x1')]},'routeid':{'type':Sequelize[_0x3c47('0x9')]},'sipcallid':{'type':Sequelize[_0x3c47('0x1')]}};
\ No newline at end of file
+var _0x4cd3=['DATE','INTEGER','sequelize','exports','outbound','inbound-fax','STRING','TEXT'];(function(_0x384d39,_0xf060fc){var _0x13bf22=function(_0x5d83f2){while(--_0x5d83f2){_0x384d39['push'](_0x384d39['shift']());}};_0x13bf22(++_0xf060fc);}(_0x4cd3,0x1ca));var _0x34cd=function(_0x1e7701,_0x13fd0f){_0x1e7701=_0x1e7701-0x0;var _0x3ab707=_0x4cd3[_0x1e7701];return _0x3ab707;};'use strict';var Sequelize=require(_0x34cd('0x0'));module[_0x34cd('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('inbound','internal',_0x34cd('0x2'),_0x34cd('0x3'),'outbound-fax','dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x34cd('0x4')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x34cd('0x4')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x34cd('0x4')]},'lastapplication':{'type':Sequelize[_0x34cd('0x4')]},'lastdata':{'type':Sequelize[_0x34cd('0x5')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x34cd('0x6')]},'answertime':{'type':Sequelize[_0x34cd('0x6')]},'endtime':{'type':Sequelize[_0x34cd('0x6')]},'duration':{'type':Sequelize[_0x34cd('0x7')]},'billableseconds':{'type':Sequelize[_0x34cd('0x7')]},'mohtime':{'type':Sequelize[_0x34cd('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x34cd('0x4')]},'amaflags':{'type':Sequelize[_0x34cd('0x4')]},'userfield':{'type':Sequelize[_0x34cd('0x4')]},'userDisposition':{'type':Sequelize[_0x34cd('0x4')]},'userSecondDisposition':{'type':Sequelize[_0x34cd('0x4')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x34cd('0x4')]},'prefix':{'type':Sequelize[_0x34cd('0x4')]},'routeid':{'type':Sequelize[_0x34cd('0x7')]},'sipcallid':{'type':Sequelize[_0x34cd('0x4')]}};
\ No newline at end of file
index e14a2fc..8ae4075 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));};
\ No newline at end of file
+var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x2ef3,0xba));var _0x32ef=function(_0x3bcdc8,_0x2b7d8c){_0x3bcdc8=_0x3bcdc8-0x0;var _0x5bb5d2=_0x2ef3[_0x3bcdc8];return _0x5bb5d2;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));};
\ No newline at end of file
index 4187253..0063994 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd6c=['uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xdd6c,0xb7));var _0xcdd6=function(_0x260072,_0x163b97){_0x260072=_0x260072-0x0;var _0x28380a=_0xdd6c[_0x260072];return _0x28380a;};'use strict';var _=require(_0xcdd6('0x0'));var util=require(_0xcdd6('0x1'));var logger=require(_0xcdd6('0x2'))('api');var moment=require(_0xcdd6('0x3'));var BPromise=require(_0xcdd6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdd6('0x5'));var rimraf=require(_0xcdd6('0x6'));var config=require(_0xcdd6('0x7'));var attributes=require(_0xcdd6('0x8'));module['exports']=function(_0x5a32fd,_0x2be6ce){return _0x5a32fd[_0xcdd6('0x9')](_0xcdd6('0xa'),attributes,{'tableName':_0xcdd6('0xb'),'paranoid':![],'indexes':[{'fields':[_0xcdd6('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc069=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc069,0x1cd));var _0x9c06=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc069[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9c06('0x0'));var util=require(_0x9c06('0x1'));var logger=require(_0x9c06('0x2'))('api');var moment=require(_0x9c06('0x3'));var BPromise=require(_0x9c06('0x4'));var rp=require(_0x9c06('0x5'));var fs=require('fs');var path=require(_0x9c06('0x6'));var rimraf=require(_0x9c06('0x7'));var config=require(_0x9c06('0x8'));var attributes=require(_0x9c06('0x9'));module[_0x9c06('0xa')]=function(_0xf640c9,_0x41c32e){return _0xf640c9[_0x9c06('0xb')](_0x9c06('0xc'),attributes,{'tableName':_0x9c06('0xd'),'paranoid':![],'indexes':[{'fields':[_0x9c06('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 53bfd28..927c8a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbef=['findAll','options','raw','attributes','limit','map','include','model','GetVoiceCallReport','debug','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VoiceCallReport'];(function(_0x345264,_0x144db9){var _0xd828d9=function(_0x1e0f4c){while(--_0x1e0f4c){_0x345264['push'](_0x345264['shift']());}};_0xd828d9(++_0x144db9);}(_0xbbef,0x18d));var _0xfbbe=function(_0x8f724c,_0x5ca1bf){_0x8f724c=_0x8f724c-0x0;var _0x3e9cbe=_0xbbef[_0x8f724c];return _0x3e9cbe;};'use strict';var _=require('lodash');var util=require(_0xfbbe('0x0'));var moment=require(_0xfbbe('0x1'));var BPromise=require(_0xfbbe('0x2'));var rs=require(_0xfbbe('0x3'));var fs=require('fs');var Redis=require(_0xfbbe('0x4'));var db=require(_0xfbbe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbbe('0x6'))(_0xfbbe('0x7'));var config=require(_0xfbbe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfbbe('0x9')][_0xfbbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x466018,_0x1b4ac9,_0xd51453){return new BPromise(function(_0x479fdd,_0x262952){return client['request'](_0x466018,_0xd51453)[_0xfbbe('0xb')](function(_0x173bfb){logger[_0xfbbe('0xc')](_0xfbbe('0xd'),_0x1b4ac9,'request\x20sent');logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1b4ac9,_0xfbbe('0xe'),JSON['stringify'](_0x173bfb));if(_0x173bfb[_0xfbbe('0xf')]){if(_0x173bfb[_0xfbbe('0xf')][_0xfbbe('0x10')]===0x1f4){logger[_0xfbbe('0xf')](_0xfbbe('0xd'),_0x1b4ac9,_0x173bfb[_0xfbbe('0xf')][_0xfbbe('0x11')]);return _0x262952(_0x173bfb[_0xfbbe('0xf')]['message']);}logger['error'](_0xfbbe('0xd'),_0x1b4ac9,_0x173bfb[_0xfbbe('0xf')][_0xfbbe('0x11')]);return _0x479fdd(_0x173bfb[_0xfbbe('0xf')][_0xfbbe('0x11')]);}else{logger[_0xfbbe('0xc')](_0xfbbe('0xd'),_0x1b4ac9,_0xfbbe('0xe'));_0x479fdd(_0x173bfb[_0xfbbe('0x12')][_0xfbbe('0x11')]);}})[_0xfbbe('0x13')](function(_0x2d3e52){logger[_0xfbbe('0xf')](_0xfbbe('0xd'),_0x1b4ac9,_0x2d3e52);_0x262952(_0x2d3e52);});});}exports['GetVoiceCallReport']=function(_0x4608cb){var _0x2e2379=this;return new Promise(function(_0xa20518,_0x10809e){return db[_0xfbbe('0x14')][_0xfbbe('0x15')]({'raw':_0x4608cb[_0xfbbe('0x16')]?_0x4608cb[_0xfbbe('0x16')][_0xfbbe('0x17')]===undefined?!![]:![]:!![],'where':_0x4608cb['options']?_0x4608cb[_0xfbbe('0x16')]['where']||null:null,'attributes':_0x4608cb[_0xfbbe('0x16')]?_0x4608cb['options'][_0xfbbe('0x18')]||null:null,'limit':_0x4608cb[_0xfbbe('0x16')]?_0x4608cb[_0xfbbe('0x16')][_0xfbbe('0x19')]||null:null,'include':_0x4608cb['options']?_0x4608cb['options']['include']?_[_0xfbbe('0x1a')](_0x4608cb[_0xfbbe('0x16')][_0xfbbe('0x1b')],function(_0x166595){return{'model':db[_0x166595['model']],'as':_0x166595['as'],'attributes':_0x166595['attributes'],'include':_0x166595[_0xfbbe('0x1b')]?_[_0xfbbe('0x1a')](_0x166595['include'],function(_0x2f94a3){return{'model':db[_0x2f94a3[_0xfbbe('0x1c')]],'as':_0x2f94a3['as'],'attributes':_0x2f94a3[_0xfbbe('0x18')],'include':_0x2f94a3[_0xfbbe('0x1b')]?_['map'](_0x2f94a3[_0xfbbe('0x1b')],function(_0xaa501d){return{'model':db[_0xaa501d[_0xfbbe('0x1c')]],'as':_0xaa501d['as'],'attributes':_0xaa501d['attributes']};}):[]};}):[]};}):[]:[]})[_0xfbbe('0xb')](function(_0x1fe3d5){logger[_0xfbbe('0xc')](_0xfbbe('0x1d'),_0x4608cb);logger[_0xfbbe('0x1e')](_0xfbbe('0x1d'),_0x4608cb,JSON[_0xfbbe('0x1f')](_0x1fe3d5));_0xa20518(_0x1fe3d5);})[_0xfbbe('0x13')](function(_0x573262){logger[_0xfbbe('0xf')]('GetVoiceCallReport',_0x573262['message'],_0x4608cb);_0x10809e(_0x2e2379[_0xfbbe('0xf')](0x1f4,_0x573262[_0xfbbe('0x11')]));});});};exports[_0xfbbe('0x20')]=function(_0x42cd68){var _0x4d08a4=this;return new Promise(function(_0x204811,_0x57c50c){return db[_0xfbbe('0x14')][_0xfbbe('0x21')](_0x42cd68[_0xfbbe('0x22')],{'raw':_0x42cd68[_0xfbbe('0x16')]?_0x42cd68['options']['raw']===undefined?!![]:![]:!![]})[_0xfbbe('0xb')](function(_0x3a7864){logger[_0xfbbe('0xc')](_0xfbbe('0x20'),_0x42cd68);logger[_0xfbbe('0x1e')](_0xfbbe('0x20'),_0x42cd68,JSON[_0xfbbe('0x1f')](_0x3a7864));_0x204811(_0x3a7864);})[_0xfbbe('0x13')](function(_0x3f15dc){logger[_0xfbbe('0xf')](_0xfbbe('0x20'),_0x3f15dc[_0xfbbe('0x11')],_0x42cd68);_0x57c50c(_0x4d08a4[_0xfbbe('0xf')](0x1f4,_0x3f15dc[_0xfbbe('0x11')]));});});};exports[_0xfbbe('0x23')]=function(_0x54b3cd){var _0x264f10=this;return new Promise(function(_0x1fb41a,_0x48aa95){return db[_0xfbbe('0x14')][_0xfbbe('0x24')](_0x54b3cd[_0xfbbe('0x22')],{'raw':_0x54b3cd[_0xfbbe('0x16')]?_0x54b3cd[_0xfbbe('0x16')][_0xfbbe('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54b3cd['options']?_0x54b3cd['options'][_0xfbbe('0x25')]||null:null,'attributes':_0x54b3cd[_0xfbbe('0x16')]?_0x54b3cd[_0xfbbe('0x16')][_0xfbbe('0x18')]||null:null,'limit':_0x54b3cd[_0xfbbe('0x16')]?_0x54b3cd[_0xfbbe('0x16')][_0xfbbe('0x19')]||null:null})['then'](function(_0x2a9443){logger['info']('UpdateVoiceCallReport',_0x54b3cd);logger['debug'](_0xfbbe('0x23'),_0x54b3cd,JSON[_0xfbbe('0x1f')](_0x2a9443));_0x1fb41a(_0x2a9443);})[_0xfbbe('0x13')](function(_0x43d7b0){logger[_0xfbbe('0xf')](_0xfbbe('0x23'),_0x43d7b0['message'],_0x54b3cd);_0x48aa95(_0x264f10[_0xfbbe('0xf')](0x1f4,_0x43d7b0[_0xfbbe('0x11')]));});});};
\ No newline at end of file
+var _0xd494=['result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','include','model','then','CreateVoiceCallReport','body','UpdateVoiceCallReport','update','stringify','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info'];(function(_0x1e4146,_0x48d1bf){var _0x3f7956=function(_0x1061b8){while(--_0x1061b8){_0x1e4146['push'](_0x1e4146['shift']());}};_0x3f7956(++_0x48d1bf);}(_0xd494,0xdf));var _0x4d49=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd494[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x4d49('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d49('0x1'));var fs=require('fs');var Redis=require(_0x4d49('0x2'));var db=require(_0x4d49('0x3'))['db'];var utils=require(_0x4d49('0x4'));var logger=require(_0x4d49('0x5'))(_0x4d49('0x6'));var config=require('../../config/environment');var jayson=require(_0x4d49('0x7'));var client=jayson[_0x4d49('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44e8a4,_0x64299a,_0x15cbcf){return new BPromise(function(_0xe42051,_0x9bc2c6){return client['request'](_0x44e8a4,_0x15cbcf)['then'](function(_0x58947e){logger['info'](_0x4d49('0x9'),_0x64299a,_0x4d49('0xa'));logger[_0x4d49('0xb')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x64299a,_0x4d49('0xa'),JSON['stringify'](_0x58947e));if(_0x58947e[_0x4d49('0xc')]){if(_0x58947e[_0x4d49('0xc')]['code']===0x1f4){logger[_0x4d49('0xc')](_0x4d49('0x9'),_0x64299a,_0x58947e[_0x4d49('0xc')][_0x4d49('0xd')]);return _0x9bc2c6(_0x58947e[_0x4d49('0xc')]['message']);}logger[_0x4d49('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x64299a,_0x58947e[_0x4d49('0xc')]['message']);return _0xe42051(_0x58947e[_0x4d49('0xc')][_0x4d49('0xd')]);}else{logger[_0x4d49('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x64299a,_0x4d49('0xa'));_0xe42051(_0x58947e[_0x4d49('0xf')][_0x4d49('0xd')]);}})[_0x4d49('0x10')](function(_0x3f7358){logger[_0x4d49('0xc')](_0x4d49('0x9'),_0x64299a,_0x3f7358);_0x9bc2c6(_0x3f7358);});});}exports[_0x4d49('0x11')]=function(_0xebbb6d){var _0x45f44a=this;return new Promise(function(_0x30d3e1,_0x14b734){return db[_0x4d49('0x12')][_0x4d49('0x13')]({'raw':_0xebbb6d[_0x4d49('0x14')]?_0xebbb6d['options'][_0x4d49('0x15')]===undefined?!![]:![]:!![],'where':_0xebbb6d[_0x4d49('0x14')]?_0xebbb6d[_0x4d49('0x14')][_0x4d49('0x16')]||null:null,'attributes':_0xebbb6d[_0x4d49('0x14')]?_0xebbb6d[_0x4d49('0x14')][_0x4d49('0x17')]||null:null,'limit':_0xebbb6d[_0x4d49('0x14')]?_0xebbb6d[_0x4d49('0x14')][_0x4d49('0x18')]||null:null,'include':_0xebbb6d[_0x4d49('0x14')]?_0xebbb6d[_0x4d49('0x14')]['include']?_[_0x4d49('0x19')](_0xebbb6d['options'][_0x4d49('0x1a')],function(_0x26a351){return{'model':db[_0x26a351[_0x4d49('0x1b')]],'as':_0x26a351['as'],'attributes':_0x26a351[_0x4d49('0x17')],'include':_0x26a351[_0x4d49('0x1a')]?_[_0x4d49('0x19')](_0x26a351[_0x4d49('0x1a')],function(_0x272b73){return{'model':db[_0x272b73[_0x4d49('0x1b')]],'as':_0x272b73['as'],'attributes':_0x272b73[_0x4d49('0x17')],'include':_0x272b73['include']?_[_0x4d49('0x19')](_0x272b73[_0x4d49('0x1a')],function(_0x3573e9){return{'model':db[_0x3573e9['model']],'as':_0x3573e9['as'],'attributes':_0x3573e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d49('0x1c')](function(_0x21c3b9){logger[_0x4d49('0xe')]('GetVoiceCallReport',_0xebbb6d);logger['debug'](_0x4d49('0x11'),_0xebbb6d,JSON['stringify'](_0x21c3b9));_0x30d3e1(_0x21c3b9);})['catch'](function(_0x57d3d1){logger[_0x4d49('0xc')](_0x4d49('0x11'),_0x57d3d1['message'],_0xebbb6d);_0x14b734(_0x45f44a[_0x4d49('0xc')](0x1f4,_0x57d3d1[_0x4d49('0xd')]));});});};exports[_0x4d49('0x1d')]=function(_0xab83cd){var _0x90b71b=this;return new Promise(function(_0xbe6a63,_0x3d6eb0){return db[_0x4d49('0x12')]['create'](_0xab83cd[_0x4d49('0x1e')],{'raw':_0xab83cd['options']?_0xab83cd[_0x4d49('0x14')][_0x4d49('0x15')]===undefined?!![]:![]:!![]})[_0x4d49('0x1c')](function(_0x1dc179){logger['info'](_0x4d49('0x1d'),_0xab83cd);logger[_0x4d49('0xb')](_0x4d49('0x1d'),_0xab83cd,JSON['stringify'](_0x1dc179));_0xbe6a63(_0x1dc179);})['catch'](function(_0x5bb524){logger['error'](_0x4d49('0x1d'),_0x5bb524[_0x4d49('0xd')],_0xab83cd);_0x3d6eb0(_0x90b71b['error'](0x1f4,_0x5bb524[_0x4d49('0xd')]));});});};exports[_0x4d49('0x1f')]=function(_0x53fce1){var _0x2cf593=this;return new Promise(function(_0x4161b1,_0x1111e9){return db['VoiceCallReport'][_0x4d49('0x20')](_0x53fce1['body'],{'raw':_0x53fce1['options']?_0x53fce1[_0x4d49('0x14')][_0x4d49('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53fce1[_0x4d49('0x14')]?_0x53fce1[_0x4d49('0x14')]['where']||null:null,'attributes':_0x53fce1[_0x4d49('0x14')]?_0x53fce1['options'][_0x4d49('0x17')]||null:null,'limit':_0x53fce1['options']?_0x53fce1[_0x4d49('0x14')][_0x4d49('0x18')]||null:null})[_0x4d49('0x1c')](function(_0x5f12d0){logger[_0x4d49('0xe')](_0x4d49('0x1f'),_0x53fce1);logger['debug']('UpdateVoiceCallReport',_0x53fce1,JSON[_0x4d49('0x21')](_0x5f12d0));_0x4161b1(_0x5f12d0);})[_0x4d49('0x10')](function(_0x32eed1){logger['error']('UpdateVoiceCallReport',_0x32eed1[_0x4d49('0xd')],_0x53fce1);_0x1111e9(_0x2cf593[_0x4d49('0xc')](0x1f4,_0x32eed1['message']));});});};
\ No newline at end of file
index 9a83f90..1ae1ae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c9e=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x1539bf,_0x28aace){var _0x2607eb=function(_0x137f3e){while(--_0x137f3e){_0x1539bf['push'](_0x1539bf['shift']());}};_0x2607eb(++_0x28aace);}(_0x1c9e,0xcd));var _0xe1c9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1c9e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe1c9('0x0'));var util=require(_0xe1c9('0x1'));var path=require(_0xe1c9('0x2'));var timeout=require(_0xe1c9('0x3'));var express=require(_0xe1c9('0x4'));var router=express[_0xe1c9('0x5')]();var fs_extra=require(_0xe1c9('0x6'));var auth=require(_0xe1c9('0x7'));var interaction=require(_0xe1c9('0x8'));var config=require(_0xe1c9('0x9'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0xe1c9('0xa')](),controller[_0xe1c9('0xb')]);router[_0xe1c9('0xc')](_0xe1c9('0xd'),auth[_0xe1c9('0xa')](),controller[_0xe1c9('0xe')]);router['post']('/',auth[_0xe1c9('0xa')](),controller[_0xe1c9('0xf')]);router['put'](_0xe1c9('0xd'),auth[_0xe1c9('0xa')](),controller[_0xe1c9('0x10')]);router[_0xe1c9('0x11')](_0xe1c9('0xd'),auth[_0xe1c9('0xa')](),controller[_0xe1c9('0x12')]);module[_0xe1c9('0x13')]=router;
\ No newline at end of file
+var _0x18d5=['/:id','show','create','put','update','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get'];(function(_0x3b547c,_0x261444){var _0x27b773=function(_0x3f607f){while(--_0x3f607f){_0x3b547c['push'](_0x3b547c['shift']());}};_0x27b773(++_0x261444);}(_0x18d5,0xe5));var _0x518d=function(_0x104d64,_0x379875){_0x104d64=_0x104d64-0x0;var _0xb210e0=_0x18d5[_0x104d64];return _0xb210e0;};'use strict';var multer=require(_0x518d('0x0'));var util=require(_0x518d('0x1'));var path=require(_0x518d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x518d('0x3'));var auth=require(_0x518d('0x4'));var interaction=require(_0x518d('0x5'));var config=require(_0x518d('0x6'));var controller=require(_0x518d('0x7'));router['get']('/',auth[_0x518d('0x8')](),controller[_0x518d('0x9')]);router[_0x518d('0xa')](_0x518d('0xb'),auth[_0x518d('0x8')](),controller[_0x518d('0xc')]);router['post']('/',auth[_0x518d('0x8')](),controller[_0x518d('0xd')]);router[_0x518d('0xe')](_0x518d('0xb'),auth['isAuthenticated'](),controller[_0x518d('0xf')]);router['delete'](_0x518d('0xb'),auth[_0x518d('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 800624c..4ef43be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7538=['BOOLEAN','exports','STRING','options','join','getDataValue','split'];(function(_0x32bb6b,_0x1a5fbe){var _0x58dcb4=function(_0x402ee2){while(--_0x402ee2){_0x32bb6b['push'](_0x32bb6b['shift']());}};_0x58dcb4(++_0x1a5fbe);}(_0x7538,0x13c));var _0x8753=function(_0x196050,_0x32a955){_0x196050=_0x196050-0x0;var _0x2d2f8a=_0x7538[_0x196050];return _0x2d2f8a;};'use strict';var Sequelize=require('sequelize');module[_0x8753('0x0')]={'name':{'type':Sequelize[_0x8753('0x1')]},'prefix':{'type':Sequelize[_0x8753('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x8753('0x1')],'set':function(_0x5ce33c){this['setDataValue'](_0x8753('0x2'),_0x5ce33c?_0x5ce33c[_0x8753('0x3')](''):[]);},'get':function(){return this[_0x8753('0x4')](_0x8753('0x2'))?this[_0x8753('0x4')](_0x8753('0x2'))[_0x8753('0x5')](''):[];}},'auth':{'type':Sequelize[_0x8753('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x8753('0x1')]},'record':{'type':Sequelize[_0x8753('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8753('0x1')]}};
\ No newline at end of file
+var _0x1da2=['setDataValue','options','join','getDataValue','split','BOOLEAN','exports','STRING','name'];(function(_0x48e5cd,_0x46acc0){var _0x559f41=function(_0x284af1){while(--_0x284af1){_0x48e5cd['push'](_0x48e5cd['shift']());}};_0x559f41(++_0x46acc0);}(_0x1da2,0x141));var _0x21da=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1da2[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0x21da('0x0')]={'name':{'type':Sequelize[_0x21da('0x1')]},'prefix':{'type':Sequelize[_0x21da('0x1')],'unique':_0x21da('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x21da('0x1')],'set':function(_0x1766a1){this[_0x21da('0x3')](_0x21da('0x4'),_0x1766a1?_0x1766a1[_0x21da('0x5')](''):[]);},'get':function(){return this[_0x21da('0x6')](_0x21da('0x4'))?this[_0x21da('0x6')]('options')[_0x21da('0x7')](''):[];}},'auth':{'type':Sequelize[_0x21da('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x21da('0x1')]},'record':{'type':Sequelize[_0x21da('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f3c100b..8a8e9b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf14=['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','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','findAll','rows','catch','params','keys','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x31a176,_0x271c44){var _0x3ab000=function(_0x464552){while(--_0x464552){_0x31a176['push'](_0x31a176['shift']());}};_0x3ab000(++_0x271c44);}(_0xcf14,0xa1));var _0x4cf1=function(_0x49f420,_0x454a32){_0x49f420=_0x49f420-0x0;var _0x323bdb=_0xcf14[_0x49f420];return _0x323bdb;};'use strict';var emlformat=require(_0x4cf1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4cf1('0x1'));var jsonpatch=require(_0x4cf1('0x2'));var rp=require('request-promise');var moment=require(_0x4cf1('0x3'));var BPromise=require(_0x4cf1('0x4'));var Mustache=require(_0x4cf1('0x5'));var util=require(_0x4cf1('0x6'));var path=require('path');var sox=require(_0x4cf1('0x7'));var csv=require(_0x4cf1('0x8'));var ejs=require(_0x4cf1('0x9'));var fs=require('fs');var fs_extra=require(_0x4cf1('0xa'));var _=require(_0x4cf1('0xb'));var squel=require(_0x4cf1('0xc'));var crypto=require(_0x4cf1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4cf1('0xe'));var toCsv=require(_0x4cf1('0x8'));var querystring=require(_0x4cf1('0xf'));var Papa=require(_0x4cf1('0x10'));var Redis=require(_0x4cf1('0x11'));var authService=require(_0x4cf1('0x12'));var qs=require(_0x4cf1('0x13'));var as=require(_0x4cf1('0x14'));var hardwareService=require(_0x4cf1('0x15'));var logger=require(_0x4cf1('0x16'))(_0x4cf1('0x17'));var utils=require(_0x4cf1('0x18'));var config=require(_0x4cf1('0x19'));var licenseUtil=require(_0x4cf1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cee57,_0x5622dc){_0x5622dc=_0x5622dc||0xcc;return function(_0x1ae8fb){if(_0x1ae8fb){return _0x3cee57[_0x4cf1('0x1b')](_0x5622dc);}return _0x3cee57[_0x4cf1('0x1c')](_0x5622dc)[_0x4cf1('0x1d')]();};}function respondWithResult(_0x10abde,_0x3f365c){_0x3f365c=_0x3f365c||0xc8;return function(_0x25f091){if(_0x25f091){return _0x10abde[_0x4cf1('0x1c')](_0x3f365c)[_0x4cf1('0x1e')](_0x25f091);}};}function respondWithFilteredResult(_0xec2510,_0xcfa115){return function(_0x2a8cf7){if(_0x2a8cf7){var _0xe257a5=typeof _0xcfa115['offset']===_0x4cf1('0x1f')&&typeof _0xcfa115['limit']===_0x4cf1('0x1f');var _0x3c485a=_0x2a8cf7[_0x4cf1('0x20')];var _0x1f20c0=_0xe257a5?0x0:_0xcfa115[_0x4cf1('0x21')];var _0x48d35a=_0xe257a5?_0x2a8cf7[_0x4cf1('0x20')]:_0xcfa115[_0x4cf1('0x21')]+_0xcfa115[_0x4cf1('0x22')];var _0x4557e0;if(_0x48d35a>=_0x3c485a){_0x48d35a=_0x3c485a;_0x4557e0=0xc8;}else{_0x4557e0=0xce;}_0xec2510['status'](_0x4557e0);return _0xec2510['set'](_0x4cf1('0x23'),_0x1f20c0+'-'+_0x48d35a+'/'+_0x3c485a)[_0x4cf1('0x1e')](_0x2a8cf7);}return null;};}function patchUpdates(_0x5603ae){return function(_0x85885a){try{jsonpatch[_0x4cf1('0x24')](_0x85885a,_0x5603ae,!![]);}catch(_0x3cc036){return BPromise[_0x4cf1('0x25')](_0x3cc036);}return _0x85885a['save']();};}function saveUpdates(_0x3469ac,_0x158000){return function(_0x2338c3){if(_0x2338c3){return _0x2338c3[_0x4cf1('0x26')](_0x3469ac)[_0x4cf1('0x27')](function(_0x2945b4){return _0x2945b4;});}return null;};}function removeEntity(_0x4f14a0,_0x351ccc){return function(_0x5bb535){if(_0x5bb535){return _0x5bb535[_0x4cf1('0x28')]()[_0x4cf1('0x27')](function(){var _0x1b0ad4=_0x5bb535[_0x4cf1('0x29')]({'plain':!![]});var _0x389575=_0x4cf1('0x2a');return db[_0x4cf1('0x2b')][_0x4cf1('0x28')]({'where':{'type':_0x389575,'resourceId':_0x1b0ad4['id']}})[_0x4cf1('0x27')](function(){return _0x5bb535;});})[_0x4cf1('0x27')](function(){_0x4f14a0[_0x4cf1('0x1c')](0xcc)[_0x4cf1('0x1d')]();});}};}function handleEntityNotFound(_0x2a17ce,_0x4bcd78){return function(_0x4498b5){if(!_0x4498b5){_0x2a17ce[_0x4cf1('0x1b')](0x194);}return _0x4498b5;};}function handleError(_0x20d9d9,_0x1c7c9c){_0x1c7c9c=_0x1c7c9c||0x1f4;return function(_0x4348d0){logger[_0x4cf1('0x2c')](_0x4348d0[_0x4cf1('0x2d')]);if(_0x4348d0[_0x4cf1('0x2e')]){delete _0x4348d0[_0x4cf1('0x2e')];}_0x20d9d9[_0x4cf1('0x1c')](_0x1c7c9c)[_0x4cf1('0x2f')](_0x4348d0);};}exports['index']=function(_0x18232e,_0x167da0){var _0x59ea9f={},_0x2c8c92={},_0x54adfa={'count':0x0,'rows':[]};var _0x29f111=_[_0x4cf1('0x30')](db[_0x4cf1('0x31')][_0x4cf1('0x32')],function(_0x483f48){return{'name':_0x483f48[_0x4cf1('0x33')],'type':_0x483f48['type'][_0x4cf1('0x34')]};});_0x2c8c92[_0x4cf1('0x35')]=_[_0x4cf1('0x30')](_0x29f111,_0x4cf1('0x2e'));_0x2c8c92[_0x4cf1('0x36')]=_['keys'](_0x18232e[_0x4cf1('0x36')]);_0x2c8c92['filters']=_['intersection'](_0x2c8c92['model'],_0x2c8c92[_0x4cf1('0x36')]);_0x59ea9f[_0x4cf1('0x37')]=_[_0x4cf1('0x38')](_0x2c8c92[_0x4cf1('0x35')],qs[_0x4cf1('0x39')](_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x39')]));_0x59ea9f[_0x4cf1('0x37')]=_0x59ea9f['attributes']['length']?_0x59ea9f['attributes']:_0x2c8c92[_0x4cf1('0x35')];if(!_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x3a')](_0x4cf1('0x3b'))){_0x59ea9f[_0x4cf1('0x22')]=qs[_0x4cf1('0x22')](_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x22')]);_0x59ea9f[_0x4cf1('0x21')]=qs[_0x4cf1('0x21')](_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x21')]);}_0x59ea9f[_0x4cf1('0x3c')]=qs['sort'](_0x18232e['query'][_0x4cf1('0x3d')]);_0x59ea9f[_0x4cf1('0x3e')]=qs[_0x4cf1('0x3f')](_[_0x4cf1('0x40')](_0x18232e[_0x4cf1('0x36')],_0x2c8c92[_0x4cf1('0x3f')]),_0x29f111);if(_0x18232e[_0x4cf1('0x36')]['filter']){_0x59ea9f[_0x4cf1('0x3e')]=_[_0x4cf1('0x41')](_0x59ea9f[_0x4cf1('0x3e')],{'$or':_[_0x4cf1('0x30')](_0x29f111,function(_0x2850f7){if(_0x2850f7[_0x4cf1('0x42')]!=='VIRTUAL'){var _0x5348f5={};_0x5348f5[_0x2850f7[_0x4cf1('0x2e')]]={'$like':'%'+_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x43')]+'%'};return _0x5348f5;}})});}_0x59ea9f=_[_0x4cf1('0x41')]({},_0x59ea9f,_0x18232e[_0x4cf1('0x44')]);var _0x43d336={'where':_0x59ea9f[_0x4cf1('0x3e')]};return db[_0x4cf1('0x31')][_0x4cf1('0x20')](_0x43d336)[_0x4cf1('0x27')](function(_0x1a2869){_0x54adfa['count']=_0x1a2869;if(_0x18232e[_0x4cf1('0x36')][_0x4cf1('0x45')]){_0x59ea9f['include']=[{'all':!![]}];}return db[_0x4cf1('0x31')][_0x4cf1('0x46')](_0x59ea9f);})[_0x4cf1('0x27')](function(_0xc2b163){_0x54adfa[_0x4cf1('0x47')]=_0xc2b163;return _0x54adfa;})['then'](respondWithFilteredResult(_0x167da0,_0x59ea9f))[_0x4cf1('0x48')](handleError(_0x167da0,null));};exports['show']=function(_0x5d024c,_0x3d1464){var _0x3fb6ed={'raw':![],'where':{'id':_0x5d024c[_0x4cf1('0x49')]['id']}},_0x17f59e={};_0x17f59e[_0x4cf1('0x35')]=_[_0x4cf1('0x4a')](db[_0x4cf1('0x31')][_0x4cf1('0x32')]);_0x17f59e[_0x4cf1('0x36')]=_[_0x4cf1('0x4a')](_0x5d024c[_0x4cf1('0x36')]);_0x17f59e[_0x4cf1('0x3f')]=_[_0x4cf1('0x38')](_0x17f59e[_0x4cf1('0x35')],_0x17f59e[_0x4cf1('0x36')]);_0x3fb6ed[_0x4cf1('0x37')]=_['intersection'](_0x17f59e[_0x4cf1('0x35')],qs[_0x4cf1('0x39')](_0x5d024c[_0x4cf1('0x36')][_0x4cf1('0x39')]));_0x3fb6ed[_0x4cf1('0x37')]=_0x3fb6ed[_0x4cf1('0x37')][_0x4cf1('0x4b')]?_0x3fb6ed['attributes']:_0x17f59e[_0x4cf1('0x35')];if(_0x5d024c['query'][_0x4cf1('0x45')]){_0x3fb6ed[_0x4cf1('0x4c')]=[{'all':!![]}];}_0x3fb6ed=_[_0x4cf1('0x41')]({},_0x3fb6ed,_0x5d024c[_0x4cf1('0x44')]);return db[_0x4cf1('0x31')][_0x4cf1('0x4d')](_0x3fb6ed)['then'](handleEntityNotFound(_0x3d1464,null))['then'](respondWithResult(_0x3d1464,null))['catch'](handleError(_0x3d1464,null));};exports[_0x4cf1('0x4e')]=function(_0x18e085,_0x1cd038){return db['VoiceChanSpy'][_0x4cf1('0x4e')](_0x18e085[_0x4cf1('0x4f')],{})['then'](function(_0x28a267){var _0x3e3e5d=_0x18e085[_0x4cf1('0x50')][_0x4cf1('0x29')]({'plain':!![]});if(!_0x3e3e5d)throw new Error(_0x4cf1('0x51'));if(_0x3e3e5d['role']===_0x4cf1('0x50')){var _0x1f3c7e=_0x28a267[_0x4cf1('0x29')]({'plain':!![]});var _0x77418c=_0x4cf1('0x2a');return db['UserProfileSection'][_0x4cf1('0x4d')]({'where':{'name':_0x77418c,'userProfileId':_0x3e3e5d[_0x4cf1('0x52')]},'raw':!![]})['then'](function(_0x5b74fc){if(_0x5b74fc&&_0x5b74fc['autoAssociation']===0x0){return db[_0x4cf1('0x2b')][_0x4cf1('0x4e')]({'name':_0x1f3c7e[_0x4cf1('0x2e')],'resourceId':_0x1f3c7e['id'],'type':_0x5b74fc['name'],'sectionId':_0x5b74fc['id']},{})[_0x4cf1('0x27')](function(){return _0x28a267;});}else{return _0x28a267;}})[_0x4cf1('0x48')](function(_0x296065){logger['error'](_0x4cf1('0x53'),_0x296065);throw _0x296065;});}return _0x28a267;})[_0x4cf1('0x27')](respondWithResult(_0x1cd038,0xc9))[_0x4cf1('0x48')](handleError(_0x1cd038,null));};exports[_0x4cf1('0x26')]=function(_0x57dfb3,_0x1105cb){if(_0x57dfb3[_0x4cf1('0x4f')]['id']){delete _0x57dfb3['body']['id'];}return db[_0x4cf1('0x31')][_0x4cf1('0x4d')]({'where':{'id':_0x57dfb3[_0x4cf1('0x49')]['id']}})['then'](handleEntityNotFound(_0x1105cb,null))[_0x4cf1('0x27')](saveUpdates(_0x57dfb3[_0x4cf1('0x4f')],null))[_0x4cf1('0x27')](respondWithResult(_0x1105cb,null))[_0x4cf1('0x48')](handleError(_0x1105cb,null));};exports[_0x4cf1('0x28')]=function(_0x2e93cc,_0x2d161f){return db['VoiceChanSpy']['find']({'where':{'id':_0x2e93cc[_0x4cf1('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d161f,null))[_0x4cf1('0x27')](removeEntity(_0x2d161f,null))[_0x4cf1('0x48')](handleError(_0x2d161f,null));};
\ No newline at end of file
+var _0xf021=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','limit','reject','save','update','then','ChanSpies','end','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','VoiceChanSpy','count','includeAll','include','rows','catch','show','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xf021,0x18f));var _0x1f02=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0xf021[_0xfd9b19];return _0x514918;};'use strict';var emlformat=require(_0x1f02('0x0'));var rimraf=require(_0x1f02('0x1'));var zipdir=require(_0x1f02('0x2'));var jsonpatch=require(_0x1f02('0x3'));var rp=require(_0x1f02('0x4'));var moment=require('moment');var BPromise=require(_0x1f02('0x5'));var Mustache=require('mustache');var util=require(_0x1f02('0x6'));var path=require(_0x1f02('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1f02('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f02('0x9'));var squel=require(_0x1f02('0xa'));var crypto=require(_0x1f02('0xb'));var jsforce=require(_0x1f02('0xc'));var deskjs=require(_0x1f02('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1f02('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1f02('0xf'));var as=require(_0x1f02('0x10'));var hardwareService=require(_0x1f02('0x11'));var logger=require(_0x1f02('0x12'))(_0x1f02('0x13'));var utils=require('../../config/utils');var config=require(_0x1f02('0x14'));var licenseUtil=require(_0x1f02('0x15'));var db=require(_0x1f02('0x16'))['db'];function respondWithStatusCode(_0x56a2c2,_0x24e9b8){_0x24e9b8=_0x24e9b8||0xcc;return function(_0x1ac6eb){if(_0x1ac6eb){return _0x56a2c2[_0x1f02('0x17')](_0x24e9b8);}return _0x56a2c2['status'](_0x24e9b8)['end']();};}function respondWithResult(_0x4974bd,_0x11ba7e){_0x11ba7e=_0x11ba7e||0xc8;return function(_0x2c08ad){if(_0x2c08ad){return _0x4974bd[_0x1f02('0x18')](_0x11ba7e)[_0x1f02('0x19')](_0x2c08ad);}};}function respondWithFilteredResult(_0x1c16ce,_0x45bae1){return function(_0x440328){if(_0x440328){var _0x3b0a3d=typeof _0x45bae1['offset']===_0x1f02('0x1a')&&typeof _0x45bae1['limit']==='undefined';var _0x4a66a5=_0x440328['count'];var _0x4d1e4f=_0x3b0a3d?0x0:_0x45bae1[_0x1f02('0x1b')];var _0x3033a2=_0x3b0a3d?_0x440328['count']:_0x45bae1[_0x1f02('0x1b')]+_0x45bae1[_0x1f02('0x1c')];var _0x356444;if(_0x3033a2>=_0x4a66a5){_0x3033a2=_0x4a66a5;_0x356444=0xc8;}else{_0x356444=0xce;}_0x1c16ce[_0x1f02('0x18')](_0x356444);return _0x1c16ce['set']('Content-Range',_0x4d1e4f+'-'+_0x3033a2+'/'+_0x4a66a5)[_0x1f02('0x19')](_0x440328);}return null;};}function patchUpdates(_0x37393a){return function(_0x5e78c2){try{jsonpatch['apply'](_0x5e78c2,_0x37393a,!![]);}catch(_0x339c29){return BPromise[_0x1f02('0x1d')](_0x339c29);}return _0x5e78c2[_0x1f02('0x1e')]();};}function saveUpdates(_0xbabbd7,_0x480297){return function(_0x12c4af){if(_0x12c4af){return _0x12c4af[_0x1f02('0x1f')](_0xbabbd7)[_0x1f02('0x20')](function(_0x2f422c){return _0x2f422c;});}return null;};}function removeEntity(_0x43b3e7,_0x134398){return function(_0x1328ea){if(_0x1328ea){return _0x1328ea['destroy']()[_0x1f02('0x20')](function(){var _0x3a8c57=_0x1328ea['get']({'plain':!![]});var _0x25a8d1=_0x1f02('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x25a8d1,'resourceId':_0x3a8c57['id']}})[_0x1f02('0x20')](function(){return _0x1328ea;});})[_0x1f02('0x20')](function(){_0x43b3e7[_0x1f02('0x18')](0xcc)[_0x1f02('0x22')]();});}};}function handleEntityNotFound(_0x3f5c5e,_0x3f5577){return function(_0x297cf4){if(!_0x297cf4){_0x3f5c5e['sendStatus'](0x194);}return _0x297cf4;};}function handleError(_0x4d5f7e,_0x4e04f2){_0x4e04f2=_0x4e04f2||0x1f4;return function(_0x3ef4bf){logger[_0x1f02('0x23')](_0x3ef4bf[_0x1f02('0x24')]);if(_0x3ef4bf['name']){delete _0x3ef4bf['name'];}_0x4d5f7e[_0x1f02('0x18')](_0x4e04f2)[_0x1f02('0x25')](_0x3ef4bf);};}exports[_0x1f02('0x26')]=function(_0x433a1e,_0x220345){var _0x3080a6={},_0x442333={},_0x23fa22={'count':0x0,'rows':[]};var _0x1c2a0d=_[_0x1f02('0x27')](db['VoiceChanSpy'][_0x1f02('0x28')],function(_0x5ab7a2){return{'name':_0x5ab7a2[_0x1f02('0x29')],'type':_0x5ab7a2[_0x1f02('0x2a')][_0x1f02('0x2b')]};});_0x442333[_0x1f02('0x2c')]=_[_0x1f02('0x27')](_0x1c2a0d,_0x1f02('0x2d'));_0x442333['query']=_['keys'](_0x433a1e[_0x1f02('0x2e')]);_0x442333[_0x1f02('0x2f')]=_['intersection'](_0x442333[_0x1f02('0x2c')],_0x442333['query']);_0x3080a6[_0x1f02('0x30')]=_['intersection'](_0x442333[_0x1f02('0x2c')],qs['fields'](_0x433a1e['query'][_0x1f02('0x31')]));_0x3080a6[_0x1f02('0x30')]=_0x3080a6[_0x1f02('0x30')][_0x1f02('0x32')]?_0x3080a6['attributes']:_0x442333[_0x1f02('0x2c')];if(!_0x433a1e[_0x1f02('0x2e')][_0x1f02('0x33')]('nolimit')){_0x3080a6[_0x1f02('0x1c')]=qs[_0x1f02('0x1c')](_0x433a1e[_0x1f02('0x2e')][_0x1f02('0x1c')]);_0x3080a6[_0x1f02('0x1b')]=qs[_0x1f02('0x1b')](_0x433a1e['query'][_0x1f02('0x1b')]);}_0x3080a6[_0x1f02('0x34')]=qs[_0x1f02('0x35')](_0x433a1e['query'][_0x1f02('0x35')]);_0x3080a6['where']=qs[_0x1f02('0x2f')](_['pick'](_0x433a1e['query'],_0x442333[_0x1f02('0x2f')]),_0x1c2a0d);if(_0x433a1e['query']['filter']){_0x3080a6[_0x1f02('0x36')]=_[_0x1f02('0x37')](_0x3080a6[_0x1f02('0x36')],{'$or':_[_0x1f02('0x27')](_0x1c2a0d,function(_0x47ee27){if(_0x47ee27[_0x1f02('0x2a')]!=='VIRTUAL'){var _0x2cd179={};_0x2cd179[_0x47ee27[_0x1f02('0x2d')]]={'$like':'%'+_0x433a1e[_0x1f02('0x2e')][_0x1f02('0x38')]+'%'};return _0x2cd179;}})});}_0x3080a6=_[_0x1f02('0x37')]({},_0x3080a6,_0x433a1e[_0x1f02('0x39')]);var _0xb4fac5={'where':_0x3080a6[_0x1f02('0x36')]};return db[_0x1f02('0x3a')]['count'](_0xb4fac5)[_0x1f02('0x20')](function(_0x5aab10){_0x23fa22[_0x1f02('0x3b')]=_0x5aab10;if(_0x433a1e['query'][_0x1f02('0x3c')]){_0x3080a6[_0x1f02('0x3d')]=[{'all':!![]}];}return db[_0x1f02('0x3a')]['findAll'](_0x3080a6);})['then'](function(_0x1c3f09){_0x23fa22[_0x1f02('0x3e')]=_0x1c3f09;return _0x23fa22;})[_0x1f02('0x20')](respondWithFilteredResult(_0x220345,_0x3080a6))[_0x1f02('0x3f')](handleError(_0x220345,null));};exports[_0x1f02('0x40')]=function(_0x15fb49,_0x23733c){var _0x11f31f={'raw':![],'where':{'id':_0x15fb49['params']['id']}},_0x391b57={};_0x391b57[_0x1f02('0x2c')]=_['keys'](db['VoiceChanSpy'][_0x1f02('0x28')]);_0x391b57['query']=_['keys'](_0x15fb49[_0x1f02('0x2e')]);_0x391b57['filters']=_['intersection'](_0x391b57[_0x1f02('0x2c')],_0x391b57[_0x1f02('0x2e')]);_0x11f31f['attributes']=_[_0x1f02('0x41')](_0x391b57[_0x1f02('0x2c')],qs[_0x1f02('0x31')](_0x15fb49[_0x1f02('0x2e')]['fields']));_0x11f31f[_0x1f02('0x30')]=_0x11f31f[_0x1f02('0x30')][_0x1f02('0x32')]?_0x11f31f[_0x1f02('0x30')]:_0x391b57[_0x1f02('0x2c')];if(_0x15fb49[_0x1f02('0x2e')][_0x1f02('0x3c')]){_0x11f31f[_0x1f02('0x3d')]=[{'all':!![]}];}_0x11f31f=_[_0x1f02('0x37')]({},_0x11f31f,_0x15fb49[_0x1f02('0x39')]);return db[_0x1f02('0x3a')][_0x1f02('0x42')](_0x11f31f)[_0x1f02('0x20')](handleEntityNotFound(_0x23733c,null))[_0x1f02('0x20')](respondWithResult(_0x23733c,null))['catch'](handleError(_0x23733c,null));};exports[_0x1f02('0x43')]=function(_0x50d5ed,_0x37759d){return db['VoiceChanSpy'][_0x1f02('0x43')](_0x50d5ed[_0x1f02('0x44')],{})[_0x1f02('0x20')](function(_0x32dac3){var _0x40bf99=_0x50d5ed[_0x1f02('0x45')][_0x1f02('0x46')]({'plain':!![]});if(!_0x40bf99)throw new Error(_0x1f02('0x47'));if(_0x40bf99[_0x1f02('0x48')]===_0x1f02('0x45')){var _0x1241c5=_0x32dac3['get']({'plain':!![]});var _0x45e71d=_0x1f02('0x21');return db[_0x1f02('0x49')][_0x1f02('0x42')]({'where':{'name':_0x45e71d,'userProfileId':_0x40bf99[_0x1f02('0x4a')]},'raw':!![]})[_0x1f02('0x20')](function(_0x2201b4){if(_0x2201b4&&_0x2201b4[_0x1f02('0x4b')]===0x0){return db[_0x1f02('0x4c')]['create']({'name':_0x1241c5[_0x1f02('0x2d')],'resourceId':_0x1241c5['id'],'type':_0x2201b4[_0x1f02('0x2d')],'sectionId':_0x2201b4['id']},{})[_0x1f02('0x20')](function(){return _0x32dac3;});}else{return _0x32dac3;}})[_0x1f02('0x3f')](function(_0x3cdf8c){logger['error'](_0x1f02('0x4d'),_0x3cdf8c);throw _0x3cdf8c;});}return _0x32dac3;})['then'](respondWithResult(_0x37759d,0xc9))[_0x1f02('0x3f')](handleError(_0x37759d,null));};exports[_0x1f02('0x1f')]=function(_0x2240d1,_0x18d80d){if(_0x2240d1[_0x1f02('0x44')]['id']){delete _0x2240d1[_0x1f02('0x44')]['id'];}return db[_0x1f02('0x3a')][_0x1f02('0x42')]({'where':{'id':_0x2240d1[_0x1f02('0x4e')]['id']}})[_0x1f02('0x20')](handleEntityNotFound(_0x18d80d,null))['then'](saveUpdates(_0x2240d1['body'],null))['then'](respondWithResult(_0x18d80d,null))[_0x1f02('0x3f')](handleError(_0x18d80d,null));};exports['destroy']=function(_0x238911,_0x449d58){return db['VoiceChanSpy'][_0x1f02('0x42')]({'where':{'id':_0x238911['params']['id']}})['then'](handleEntityNotFound(_0x449d58,null))['then'](removeEntity(_0x449d58,null))[_0x1f02('0x3f')](handleError(_0x449d58,null));};
\ No newline at end of file
index c8b2c8b..d173213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda57=['CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','merge','StopMixMonitor','concat','internal','User','findAll','agent','then','catch','exports','models','define','voice_chanspy','length','bulkCreate','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','Set'];(function(_0x4c8232,_0x4e0dea){var _0x3cc8e5=function(_0x248561){while(--_0x248561){_0x4c8232['push'](_0x4c8232['shift']());}};_0x3cc8e5(++_0x4e0dea);}(_0xda57,0x1c3));var _0x7da5=function(_0x7a22df,_0x246808){_0x7a22df=_0x7a22df-0x0;var _0x1986c5=_0xda57[_0x7a22df];return _0x1986c5;};'use strict';var _=require(_0x7da5('0x0'));var util=require(_0x7da5('0x1'));var BPromise=require(_0x7da5('0x2'));var attributes=require(_0x7da5('0x3'));var getUserApplications=function(_0x1965d6,_0x569f13,_0x4cf309){var _0x410dd8=0x1;var _0x5a7d47=[];var _0x1811fd={'context':_0x569f13[_0x7da5('0x4')]||_0x7da5('0x5'),'exten':util[_0x7da5('0x6')]('%s%s',_0x1965d6[_0x7da5('0x7')],_0x4cf309),'type':_0x7da5('0x8'),'isApp':![],'ChanSpyId':_0x1965d6['id'],'UserId':_0x569f13['id']};_0x5a7d47[_0x7da5('0x9')](_['merge']({'app':_0x7da5('0xa'),'appdata':util['format'](_0x7da5('0xb'),_0x7da5('0xc')),'priority':_0x410dd8++},_0x1811fd));if(_0x1965d6[_0x7da5('0xd')]){_0x5a7d47[_0x7da5('0x9')](_['merge']({'app':_0x7da5('0xe'),'appdata':util['format'](_0x7da5('0xf'),_0x1965d6[_0x7da5('0x10')]),'priority':_0x410dd8++},_0x1811fd));}if(_0x1965d6[_0x7da5('0x11')]){_0x5a7d47[_0x7da5('0x9')](_['merge']({'app':_0x7da5('0x12'),'appdata':_0x1965d6[_0x7da5('0x13')],'priority':_0x410dd8++},_0x1811fd));}_0x5a7d47['push'](_['merge']({'app':_0x7da5('0x14'),'appdata':util[_0x7da5('0x6')](_0x7da5('0x15'),_0x569f13[_0x7da5('0x16')],_0x1965d6[_0x7da5('0x17')]?_0x1965d6[_0x7da5('0x17')][_0x7da5('0x18')](''):''),'priority':_0x410dd8++},_0x1811fd));if(_0x1965d6[_0x7da5('0xd')]){_0x5a7d47[_0x7da5('0x9')](_[_0x7da5('0x19')]({'app':_0x7da5('0x1a'),'priority':_0x410dd8++},_0x1811fd));}return _0x5a7d47;};var getChanSpyApplications=function(_0x34cfbd,_0x1f9677){var _0x1db128=[];for(var _0x51c5a9=0x0,_0x1aaab4=0x1;_0x51c5a9<_0x1f9677['length'];_0x51c5a9++,_0x1aaab4=0x1){_0x1db128=_0x1db128[_0x7da5('0x1b')](getUserApplications(_0x34cfbd,_0x1f9677[_0x51c5a9],_0x1f9677[_0x51c5a9]['internal']));if(_0x1f9677[_0x51c5a9][_0x7da5('0x1c')]!=_0x1f9677[_0x51c5a9]['name']){_0x1db128=_0x1db128[_0x7da5('0x1b')](getUserApplications(_0x34cfbd,_0x1f9677[_0x51c5a9],_0x1f9677[_0x51c5a9][_0x7da5('0x16')]));}}return _0x1db128;};var getChanSpyPromise=function(_0x1f6b40,_0x38d2f8){return new BPromise(function(_0x9a3a88,_0x32f17f){return _0x1f6b40[_0x7da5('0x1d')][_0x7da5('0x1e')]({'attributes':['id',_0x7da5('0x16'),_0x7da5('0x1c')],'where':{'role':_0x7da5('0x1f'),'chanspy':!![]},'raw':!![]})[_0x7da5('0x20')](function(_0x9be565){if(_0x9be565){return _0x9a3a88(getChanSpyApplications(_0x38d2f8,_0x9be565));}return _0x9a3a88([]);})[_0x7da5('0x21')](function(_0x570cd2){_0x32f17f(_0x570cd2);});});};module[_0x7da5('0x22')]=function(_0x194b01,_0x46e89b){var _0x49159f=_0x194b01[_0x7da5('0x23')];return _0x194b01[_0x7da5('0x24')]('VoiceChanSpy',attributes,{'tableName':_0x7da5('0x25'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35e049,_0x15b98f,_0x5bea10){return getChanSpyPromise(_0x49159f,_0x35e049)[_0x7da5('0x20')](function(_0x418c84){if(_0x418c84&&_0x418c84[_0x7da5('0x26')]){return _0x49159f['VoiceExtension'][_0x7da5('0x27')](_0x418c84);}})[_0x7da5('0x20')](function(){_0x5bea10();})[_0x7da5('0x21')](function(_0xae9f87){_0x5bea10(_0xae9f87);});},'afterUpdate':function(_0x547cb1,_0x54cc2d,_0x3816ab){return _0x49159f[_0x7da5('0x28')][_0x7da5('0x29')]({'where':{'ChanSpyId':_0x547cb1['id']}})[_0x7da5('0x20')](function(){return getChanSpyPromise(_0x49159f,_0x547cb1);})[_0x7da5('0x20')](function(_0x4e2fa2){if(_0x4e2fa2&&_0x4e2fa2[_0x7da5('0x26')]){return _0x49159f[_0x7da5('0x28')][_0x7da5('0x27')](_0x4e2fa2);}})[_0x7da5('0x20')](function(){_0x3816ab();})[_0x7da5('0x21')](function(_0x3ff5a4){_0x3816ab(_0x3ff5a4);});},'afterDestroy':function(_0x446a4c,_0x2c9e7d,_0x31c18b){return _0x49159f[_0x7da5('0x28')][_0x7da5('0x29')]({'where':{'ChanSpyId':_0x446a4c['id']}})[_0x7da5('0x20')](function(){_0x31c18b();})[_0x7da5('0x21')](function(_0x7f6d9b){_0x31c18b(_0x7f6d9b);});}}});};
\ No newline at end of file
+var _0x6fa2=['util','bluebird','./voiceChanSpy.attributes','context','from-sip','prefix','system','push','Set','format','CDR(type)=%s','chanspy','record','merge','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6fa2,0x167));var _0x26fa=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x6fa2[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x26fa('0x0'));var util=require(_0x26fa('0x1'));var BPromise=require(_0x26fa('0x2'));var attributes=require(_0x26fa('0x3'));var getUserApplications=function(_0x2f5f2a,_0x4b15b9,_0xe6becf){var _0x1c92d7=0x1;var _0x1e32d2=[];var _0x36b90c={'context':_0x4b15b9[_0x26fa('0x4')]||_0x26fa('0x5'),'exten':util['format']('%s%s',_0x2f5f2a[_0x26fa('0x6')],_0xe6becf),'type':_0x26fa('0x7'),'isApp':![],'ChanSpyId':_0x2f5f2a['id'],'UserId':_0x4b15b9['id']};_0x1e32d2[_0x26fa('0x8')](_['merge']({'app':_0x26fa('0x9'),'appdata':util[_0x26fa('0xa')](_0x26fa('0xb'),_0x26fa('0xc')),'priority':_0x1c92d7++},_0x36b90c));if(_0x2f5f2a[_0x26fa('0xd')]){_0x1e32d2[_0x26fa('0x8')](_[_0x26fa('0xe')]({'app':_0x26fa('0xf'),'appdata':util[_0x26fa('0xa')]('${UNIQUEID}.%s,a',_0x2f5f2a[_0x26fa('0x10')]),'priority':_0x1c92d7++},_0x36b90c));}if(_0x2f5f2a[_0x26fa('0x11')]){_0x1e32d2[_0x26fa('0x8')](_[_0x26fa('0xe')]({'app':_0x26fa('0x12'),'appdata':_0x2f5f2a[_0x26fa('0x13')],'priority':_0x1c92d7++},_0x36b90c));}_0x1e32d2[_0x26fa('0x8')](_[_0x26fa('0xe')]({'app':_0x26fa('0x14'),'appdata':util[_0x26fa('0xa')](_0x26fa('0x15'),_0x4b15b9[_0x26fa('0x16')],_0x2f5f2a[_0x26fa('0x17')]?_0x2f5f2a[_0x26fa('0x17')]['join'](''):''),'priority':_0x1c92d7++},_0x36b90c));if(_0x2f5f2a[_0x26fa('0xd')]){_0x1e32d2[_0x26fa('0x8')](_['merge']({'app':_0x26fa('0x18'),'priority':_0x1c92d7++},_0x36b90c));}return _0x1e32d2;};var getChanSpyApplications=function(_0x8ffba,_0x1001d6){var _0x350fdf=[];for(var _0x362f85=0x0,_0x2dbb3e=0x1;_0x362f85<_0x1001d6[_0x26fa('0x19')];_0x362f85++,_0x2dbb3e=0x1){_0x350fdf=_0x350fdf['concat'](getUserApplications(_0x8ffba,_0x1001d6[_0x362f85],_0x1001d6[_0x362f85][_0x26fa('0x1a')]));if(_0x1001d6[_0x362f85][_0x26fa('0x1a')]!=_0x1001d6[_0x362f85][_0x26fa('0x16')]){_0x350fdf=_0x350fdf['concat'](getUserApplications(_0x8ffba,_0x1001d6[_0x362f85],_0x1001d6[_0x362f85][_0x26fa('0x16')]));}}return _0x350fdf;};var getChanSpyPromise=function(_0x54f40b,_0x3bb29b){return new BPromise(function(_0x31487a,_0x46f1fa){return _0x54f40b[_0x26fa('0x1b')][_0x26fa('0x1c')]({'attributes':['id','name','internal'],'where':{'role':_0x26fa('0x1d'),'chanspy':!![]},'raw':!![]})[_0x26fa('0x1e')](function(_0x116fdc){if(_0x116fdc){return _0x31487a(getChanSpyApplications(_0x3bb29b,_0x116fdc));}return _0x31487a([]);})[_0x26fa('0x1f')](function(_0x5dc7c1){_0x46f1fa(_0x5dc7c1);});});};module[_0x26fa('0x20')]=function(_0x91c741,_0x4d260c){var _0x5a21b4=_0x91c741[_0x26fa('0x21')];return _0x91c741[_0x26fa('0x22')](_0x26fa('0x23'),attributes,{'tableName':_0x26fa('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x114b0a,_0x5197c6,_0x2cc535){return getChanSpyPromise(_0x5a21b4,_0x114b0a)[_0x26fa('0x1e')](function(_0x3a3760){if(_0x3a3760&&_0x3a3760[_0x26fa('0x19')]){return _0x5a21b4[_0x26fa('0x25')][_0x26fa('0x26')](_0x3a3760);}})['then'](function(){_0x2cc535();})[_0x26fa('0x1f')](function(_0x35033d){_0x2cc535(_0x35033d);});},'afterUpdate':function(_0x44fbf2,_0x30e66d,_0x332d98){return _0x5a21b4[_0x26fa('0x25')][_0x26fa('0x27')]({'where':{'ChanSpyId':_0x44fbf2['id']}})['then'](function(){return getChanSpyPromise(_0x5a21b4,_0x44fbf2);})[_0x26fa('0x1e')](function(_0x4b5ed4){if(_0x4b5ed4&&_0x4b5ed4[_0x26fa('0x19')]){return _0x5a21b4['VoiceExtension'][_0x26fa('0x26')](_0x4b5ed4);}})[_0x26fa('0x1e')](function(){_0x332d98();})[_0x26fa('0x1f')](function(_0x48ba13){_0x332d98(_0x48ba13);});},'afterDestroy':function(_0x1f518e,_0x21a782,_0x139338){return _0x5a21b4[_0x26fa('0x25')][_0x26fa('0x27')]({'where':{'ChanSpyId':_0x1f518e['id']}})[_0x26fa('0x1e')](function(){_0x139338();})[_0x26fa('0x1f')](function(_0x3ba361){_0x139338(_0x3ba361);});}}});};
\ No newline at end of file
index 2b5ea10..382bf8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7072=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x18c08a,_0x46e340){var _0x388429=function(_0x27d239){while(--_0x27d239){_0x18c08a['push'](_0x18c08a['shift']());}};_0x388429(++_0x46e340);}(_0x7072,0x138));var _0x2707=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x7072[_0x101e7b];return _0x4995c0;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});}
\ No newline at end of file
+var _0xc901=['ioredis','../../mysqldb','../../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','error','code','message','lodash'];(function(_0x4eaedd,_0x4c28c0){var _0x1f943c=function(_0x529d8d){while(--_0x529d8d){_0x4eaedd['push'](_0x4eaedd['shift']());}};_0x1f943c(++_0x4c28c0);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});}
\ No newline at end of file
index 3961d5d..929bfa2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x196b=['path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','multer','util'];(function(_0x30afb5,_0x3f5f9f){var _0x48be6a=function(_0x21ed60){while(--_0x21ed60){_0x30afb5['push'](_0x30afb5['shift']());}};_0x48be6a(++_0x3f5f9f);}(_0x196b,0x1c9));var _0xb196=function(_0x1ef1ac,_0xd4ed91){_0x1ef1ac=_0x1ef1ac-0x0;var _0x569690=_0x196b[_0x1ef1ac];return _0x569690;};'use strict';var multer=require(_0xb196('0x0'));var util=require(_0xb196('0x1'));var path=require(_0xb196('0x2'));var timeout=require(_0xb196('0x3'));var express=require(_0xb196('0x4'));var router=express[_0xb196('0x5')]();var fs_extra=require(_0xb196('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb196('0x7'));var controller=require('./voiceContext.controller');router[_0xb196('0x8')]('/',auth[_0xb196('0x9')](),controller[_0xb196('0xa')]);router[_0xb196('0x8')]('/:id',auth[_0xb196('0x9')](),controller[_0xb196('0xb')]);router[_0xb196('0xc')]('/',auth[_0xb196('0x9')](),controller[_0xb196('0xd')]);router[_0xb196('0xe')](_0xb196('0xf'),auth[_0xb196('0x9')](),controller[_0xb196('0x10')]);router['delete'](_0xb196('0xf'),auth[_0xb196('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb68a=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0xb04f6b,_0x1ade6){var _0x571dcb=function(_0x47f9e1){while(--_0x47f9e1){_0xb04f6b['push'](_0xb04f6b['shift']());}};_0x571dcb(++_0x1ade6);}(_0xb68a,0xa1));var _0xab68=function(_0x3849ff,_0x4ae25e){_0x3849ff=_0x3849ff-0x0;var _0x3ab676=_0xb68a[_0x3849ff];return _0x3ab676;};'use strict';var multer=require(_0xab68('0x0'));var util=require(_0xab68('0x1'));var path=require(_0xab68('0x2'));var timeout=require(_0xab68('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xab68('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xab68('0x5'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0xab68('0x6')]('/',auth[_0xab68('0x7')](),controller['index']);router[_0xab68('0x6')](_0xab68('0x8'),auth['isAuthenticated'](),controller[_0xab68('0x9')]);router[_0xab68('0xa')]('/',auth['isAuthenticated'](),controller[_0xab68('0xb')]);router[_0xab68('0xc')]('/:id',auth[_0xab68('0x7')](),controller[_0xab68('0xd')]);router[_0xab68('0xe')](_0xab68('0x8'),auth[_0xab68('0x7')](),controller[_0xab68('0xf')]);module[_0xab68('0x10')]=router;
\ No newline at end of file
index ae7bec8..fb9cf79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ecf=['sequelize','exports','STRING','BOOLEAN'];(function(_0x21f1b2,_0x219946){var _0x2c92b5=function(_0x53e753){while(--_0x53e753){_0x21f1b2['push'](_0x21f1b2['shift']());}};_0x2c92b5(++_0x219946);}(_0x7ecf,0xfc));var _0xf7ec=function(_0x2f37e1,_0x28cf58){_0x2f37e1=_0x2f37e1-0x0;var _0x3a5e20=_0x7ecf[_0x2f37e1];return _0x3a5e20;};'use strict';var Sequelize=require(_0xf7ec('0x0'));module[_0xf7ec('0x1')]={'name':{'type':Sequelize[_0xf7ec('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xf7ec('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf7ec('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3c69=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x9d4ce4,_0x510f23){var _0x555e00=function(_0x2572f9){while(--_0x2572f9){_0x9d4ce4['push'](_0x9d4ce4['shift']());}};_0x555e00(++_0x510f23);}(_0x3c69,0x9e));var _0x93c6=function(_0x30e25c,_0x355276){_0x30e25c=_0x30e25c-0x0;var _0x47959b=_0x3c69[_0x30e25c];return _0x47959b;};'use strict';var Sequelize=require(_0x93c6('0x0'));module[_0x93c6('0x1')]={'name':{'type':Sequelize[_0x93c6('0x2')],'unique':_0x93c6('0x3')},'description':{'type':Sequelize[_0x93c6('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x93c6('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 0ba1d85..0aa6800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c30=['nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','show','params','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','Reload','chan_sip.so','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','count','limit','apply','reject','save','update','destroy','UserProfileResource','stack','name','index','VoiceContext','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x3ded30,_0x2e7228){var _0x11f797=function(_0x3bd419){while(--_0x3bd419){_0x3ded30['push'](_0x3ded30['shift']());}};_0x11f797(++_0x2e7228);}(_0x9c30,0x8e));var _0x09c3=function(_0xc99bdf,_0x217d8e){_0xc99bdf=_0xc99bdf-0x0;var _0x46651d=_0x9c30[_0xc99bdf];return _0x46651d;};'use strict';var emlformat=require(_0x09c3('0x0'));var rimraf=require(_0x09c3('0x1'));var zipdir=require(_0x09c3('0x2'));var jsonpatch=require(_0x09c3('0x3'));var rp=require(_0x09c3('0x4'));var moment=require(_0x09c3('0x5'));var BPromise=require(_0x09c3('0x6'));var Mustache=require(_0x09c3('0x7'));var util=require(_0x09c3('0x8'));var path=require(_0x09c3('0x9'));var sox=require(_0x09c3('0xa'));var csv=require(_0x09c3('0xb'));var ejs=require(_0x09c3('0xc'));var fs=require('fs');var fs_extra=require(_0x09c3('0xd'));var _=require(_0x09c3('0xe'));var squel=require(_0x09c3('0xf'));var crypto=require('crypto');var jsforce=require(_0x09c3('0x10'));var deskjs=require(_0x09c3('0x11'));var toCsv=require(_0x09c3('0xb'));var querystring=require(_0x09c3('0x12'));var Papa=require(_0x09c3('0x13'));var Redis=require(_0x09c3('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x09c3('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x09c3('0x16'));var logger=require(_0x09c3('0x17'))(_0x09c3('0x18'));var utils=require(_0x09c3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x09c3('0x1a'));var db=require(_0x09c3('0x1b'))['db'];var jayson=require(_0x09c3('0x1c'));var client=jayson[_0x09c3('0x1d')][_0x09c3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x107eb5,_0x15ac8f,_0x5cea7e,_0x2cfc9a){return new BPromise(function(_0x461c68,_0x54bc3d){var _0x15eaff=_0x2cfc9a||client;return _0x15eaff[_0x09c3('0x1f')](_0x107eb5,_0x5cea7e)[_0x09c3('0x20')](function(_0x1ac6d3){logger[_0x09c3('0x21')]('VoiceContext,\x20%s,\x20%s',_0x15ac8f,_0x09c3('0x22'));logger[_0x09c3('0x23')](_0x09c3('0x24'),_0x15ac8f,'request\x20sent',JSON[_0x09c3('0x25')](_0x1ac6d3));if(_0x1ac6d3[_0x09c3('0x26')]){if(_0x1ac6d3['error'][_0x09c3('0x27')]===0x1f4){logger[_0x09c3('0x26')](_0x09c3('0x28'),_0x15ac8f,_0x1ac6d3[_0x09c3('0x26')][_0x09c3('0x29')]);return _0x54bc3d(_0x1ac6d3[_0x09c3('0x26')][_0x09c3('0x29')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x15ac8f,_0x1ac6d3['error'][_0x09c3('0x29')]);return _0x461c68(_0x1ac6d3[_0x09c3('0x26')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x15ac8f,_0x09c3('0x22'));_0x461c68(_0x1ac6d3[_0x09c3('0x2a')][_0x09c3('0x29')]);}})[_0x09c3('0x2b')](function(_0x7afc63){logger[_0x09c3('0x26')](_0x09c3('0x28'),_0x15ac8f,_0x7afc63);_0x54bc3d(_0x7afc63);});});}function respondWithStatusCode(_0x1892fe,_0x1de658){_0x1de658=_0x1de658||0xcc;return function(_0x18b37f){if(_0x18b37f){return _0x1892fe[_0x09c3('0x2c')](_0x1de658);}return _0x1892fe[_0x09c3('0x2d')](_0x1de658)[_0x09c3('0x2e')]();};}function respondWithResult(_0x4e22ca,_0xec47b2){_0xec47b2=_0xec47b2||0xc8;return function(_0x1033f0){if(_0x1033f0){return _0x4e22ca[_0x09c3('0x2d')](_0xec47b2)[_0x09c3('0x2f')](_0x1033f0);}};}function respondWithFilteredResult(_0x37ddba,_0x27a41a){return function(_0x42f536){if(_0x42f536){var _0x2a9163=typeof _0x27a41a[_0x09c3('0x30')]==='undefined'&&typeof _0x27a41a['limit']==='undefined';var _0x4fe007=_0x42f536[_0x09c3('0x31')];var _0x53d033=_0x2a9163?0x0:_0x27a41a['offset'];var _0x825ca0=_0x2a9163?_0x42f536[_0x09c3('0x31')]:_0x27a41a[_0x09c3('0x30')]+_0x27a41a[_0x09c3('0x32')];var _0x51cf46;if(_0x825ca0>=_0x4fe007){_0x825ca0=_0x4fe007;_0x51cf46=0xc8;}else{_0x51cf46=0xce;}_0x37ddba['status'](_0x51cf46);return _0x37ddba['set']('Content-Range',_0x53d033+'-'+_0x825ca0+'/'+_0x4fe007)[_0x09c3('0x2f')](_0x42f536);}return null;};}function patchUpdates(_0x3c0c23){return function(_0x10e26f){try{jsonpatch[_0x09c3('0x33')](_0x10e26f,_0x3c0c23,!![]);}catch(_0x219517){return BPromise[_0x09c3('0x34')](_0x219517);}return _0x10e26f[_0x09c3('0x35')]();};}function saveUpdates(_0x1ae9c3,_0x352a88){return function(_0x43f1fc){if(_0x43f1fc){return _0x43f1fc[_0x09c3('0x36')](_0x1ae9c3)['then'](function(_0x42386c){return _0x42386c;});}return null;};}function removeEntity(_0x5c07af,_0x987a73){return function(_0x30f604){if(_0x30f604){return _0x30f604[_0x09c3('0x37')]()[_0x09c3('0x20')](function(){var _0x65bc6=_0x30f604['get']({'plain':!![]});var _0x42402f='Contexts';return db[_0x09c3('0x38')][_0x09c3('0x37')]({'where':{'type':_0x42402f,'resourceId':_0x65bc6['id']}})[_0x09c3('0x20')](function(){return _0x30f604;});})[_0x09c3('0x20')](function(){_0x5c07af[_0x09c3('0x2d')](0xcc)[_0x09c3('0x2e')]();});}};}function handleEntityNotFound(_0x5270f8,_0x457ef2){return function(_0x272a62){if(!_0x272a62){_0x5270f8[_0x09c3('0x2c')](0x194);}return _0x272a62;};}function handleError(_0x55d479,_0x43ec56){_0x43ec56=_0x43ec56||0x1f4;return function(_0xee94eb){logger[_0x09c3('0x26')](_0xee94eb[_0x09c3('0x39')]);if(_0xee94eb[_0x09c3('0x3a')]){delete _0xee94eb['name'];}_0x55d479[_0x09c3('0x2d')](_0x43ec56)['send'](_0xee94eb);};}exports[_0x09c3('0x3b')]=function(_0x2db941,_0x22ed56){var _0xebb491={},_0x1af7bf={},_0x4d913b={'count':0x0,'rows':[]};var _0x3d5bf2=_['map'](db[_0x09c3('0x3c')][_0x09c3('0x3d')],function(_0x4af2f5){return{'name':_0x4af2f5[_0x09c3('0x3e')],'type':_0x4af2f5['type'][_0x09c3('0x3f')]};});_0x1af7bf['model']=_[_0x09c3('0x40')](_0x3d5bf2,_0x09c3('0x3a'));_0x1af7bf[_0x09c3('0x41')]=_[_0x09c3('0x42')](_0x2db941[_0x09c3('0x41')]);_0x1af7bf[_0x09c3('0x43')]=_[_0x09c3('0x44')](_0x1af7bf[_0x09c3('0x45')],_0x1af7bf[_0x09c3('0x41')]);_0xebb491[_0x09c3('0x46')]=_[_0x09c3('0x44')](_0x1af7bf[_0x09c3('0x45')],qs[_0x09c3('0x47')](_0x2db941[_0x09c3('0x41')][_0x09c3('0x47')]));_0xebb491['attributes']=_0xebb491[_0x09c3('0x46')][_0x09c3('0x48')]?_0xebb491[_0x09c3('0x46')]:_0x1af7bf[_0x09c3('0x45')];if(!_0x2db941[_0x09c3('0x41')][_0x09c3('0x49')](_0x09c3('0x4a'))){_0xebb491[_0x09c3('0x32')]=qs[_0x09c3('0x32')](_0x2db941[_0x09c3('0x41')][_0x09c3('0x32')]);_0xebb491['offset']=qs[_0x09c3('0x30')](_0x2db941[_0x09c3('0x41')]['offset']);}_0xebb491[_0x09c3('0x4b')]=qs[_0x09c3('0x4c')](_0x2db941[_0x09c3('0x41')][_0x09c3('0x4c')]);_0xebb491[_0x09c3('0x4d')]=qs[_0x09c3('0x43')](_[_0x09c3('0x4e')](_0x2db941[_0x09c3('0x41')],_0x1af7bf[_0x09c3('0x43')]),_0x3d5bf2);if(_0x2db941[_0x09c3('0x41')]['filter']){_0xebb491[_0x09c3('0x4d')]=_[_0x09c3('0x4f')](_0xebb491[_0x09c3('0x4d')],{'$or':_['map'](_0x3d5bf2,function(_0x36dbf7){if(_0x36dbf7['type']!==_0x09c3('0x50')){var _0x428e7b={};_0x428e7b[_0x36dbf7[_0x09c3('0x3a')]]={'$like':'%'+_0x2db941['query']['filter']+'%'};return _0x428e7b;}})});}_0xebb491=_[_0x09c3('0x4f')]({},_0xebb491,_0x2db941[_0x09c3('0x51')]);var _0x21ce9f={'where':_0xebb491[_0x09c3('0x4d')]};return db[_0x09c3('0x3c')]['count'](_0x21ce9f)[_0x09c3('0x20')](function(_0x43faf0){_0x4d913b['count']=_0x43faf0;if(_0x2db941['query'][_0x09c3('0x52')]){_0xebb491[_0x09c3('0x53')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0xebb491);})['then'](function(_0x15e8a8){_0x4d913b['rows']=_0x15e8a8;return _0x4d913b;})[_0x09c3('0x20')](respondWithFilteredResult(_0x22ed56,_0xebb491))[_0x09c3('0x2b')](handleError(_0x22ed56,null));};exports[_0x09c3('0x54')]=function(_0x5707de,_0x11be26){var _0x272f76={'raw':![],'where':{'id':_0x5707de[_0x09c3('0x55')]['id']}},_0x44fe67={};_0x44fe67['model']=_[_0x09c3('0x42')](db['VoiceContext'][_0x09c3('0x3d')]);_0x44fe67[_0x09c3('0x41')]=_['keys'](_0x5707de[_0x09c3('0x41')]);_0x44fe67[_0x09c3('0x43')]=_[_0x09c3('0x44')](_0x44fe67[_0x09c3('0x45')],_0x44fe67['query']);_0x272f76[_0x09c3('0x46')]=_[_0x09c3('0x44')](_0x44fe67[_0x09c3('0x45')],qs['fields'](_0x5707de[_0x09c3('0x41')]['fields']));_0x272f76[_0x09c3('0x46')]=_0x272f76[_0x09c3('0x46')][_0x09c3('0x48')]?_0x272f76[_0x09c3('0x46')]:_0x44fe67[_0x09c3('0x45')];if(_0x5707de['query'][_0x09c3('0x52')]){_0x272f76[_0x09c3('0x53')]=[{'all':!![]}];}_0x272f76=_[_0x09c3('0x4f')]({},_0x272f76,_0x5707de[_0x09c3('0x51')]);return db[_0x09c3('0x3c')][_0x09c3('0x56')](_0x272f76)['then'](handleEntityNotFound(_0x11be26,null))[_0x09c3('0x20')](respondWithResult(_0x11be26,null))['catch'](handleError(_0x11be26,null));};exports[_0x09c3('0x57')]=function(_0x538681,_0x2f6596,_0x1d7b15){var _0x371e97;return db[_0x09c3('0x3c')][_0x09c3('0x57')](_0x538681[_0x09c3('0x58')],{'raw':!![]})[_0x09c3('0x20')](function(_0x35212a){_0x371e97=_0x35212a;return db[_0x09c3('0x3c')][_0x09c3('0x59')]({'raw':!![]});})['then'](function(_0x9706be){var _0x23fc47=fs[_0x09c3('0x5a')](path[_0x09c3('0x5b')](config[_0x09c3('0x5c')],_0x09c3('0x5d')),'utf8');var _0x31018f=ejs[_0x09c3('0x5e')](_0x23fc47,{'contexts':_0x9706be||[]});fs[_0x09c3('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x31018f);})[_0x09c3('0x20')](function(){return respondWithRpcPromise('Reload',_0x09c3('0x57'),{'module':'chan_sip.so'});})[_0x09c3('0x20')](function(){var _0x49780d=_0x538681[_0x09c3('0x60')]['get']({'plain':!![]});if(!_0x49780d)throw new Error(_0x09c3('0x61'));if(_0x49780d['role']===_0x09c3('0x60')){var _0x4dc5e1=_0x371e97[_0x09c3('0x62')]({'plain':!![]});return db[_0x09c3('0x63')]['find']({'where':{'name':_0x09c3('0x64'),'userProfileId':_0x49780d[_0x09c3('0x65')]},'raw':!![]})['then'](function(_0x470da3){if(_0x470da3&&_0x470da3[_0x09c3('0x66')]===0x0){return db[_0x09c3('0x38')]['create']({'name':_0x4dc5e1[_0x09c3('0x3a')],'resourceId':_0x4dc5e1['id'],'type':_0x470da3[_0x09c3('0x3a')],'sectionId':_0x470da3['id']},{})[_0x09c3('0x20')](function(){return _0x371e97;});}else{return _0x371e97;}})[_0x09c3('0x2b')](function(_0x409489){logger[_0x09c3('0x26')](_0x09c3('0x67'),_0x409489);throw _0x409489;});}return _0x371e97;})[_0x09c3('0x20')](respondWithResult(_0x2f6596,0xc9))[_0x09c3('0x2b')](handleError(_0x2f6596,null));};exports[_0x09c3('0x36')]=function(_0x30cef,_0x11ffae,_0x3f5fbf){var _0x3ab409;return db[_0x09c3('0x3c')][_0x09c3('0x56')]({'where':{'id':_0x30cef[_0x09c3('0x55')]['id']}})[_0x09c3('0x20')](handleEntityNotFound(_0x11ffae,null))['then'](saveUpdates(_0x30cef['body'],null))[_0x09c3('0x20')](function(_0x3602a0){if(_0x3602a0){_0x3ab409=_0x3602a0;return db[_0x09c3('0x3c')][_0x09c3('0x59')]({'raw':!![]});}})[_0x09c3('0x20')](function(_0x18fd14){var _0x34d6e4=fs['readFileSync'](path['join'](config['root'],_0x09c3('0x5d')),_0x09c3('0x68'));var _0x562d56=ejs['render'](_0x34d6e4,{'contexts':_0x18fd14||[]});fs[_0x09c3('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x562d56);})[_0x09c3('0x20')](function(){return respondWithRpcPromise(_0x09c3('0x69'),_0x09c3('0x36'),{'module':_0x09c3('0x6a')});})[_0x09c3('0x20')](function(){return _0x3ab409;})[_0x09c3('0x20')](respondWithResult(_0x11ffae,null))['catch'](handleError(_0x11ffae,null));};exports[_0x09c3('0x37')]=function(_0x238a55,_0x1e4b4a,_0x3a15bc){var _0x3a2fa3;return db[_0x09c3('0x3c')][_0x09c3('0x56')]({'where':{'id':_0x238a55[_0x09c3('0x55')]['id']}})[_0x09c3('0x20')](handleEntityNotFound(_0x1e4b4a,null))['then'](removeEntity(_0x1e4b4a,null))[_0x09c3('0x20')](function(){return db['VoiceContext'][_0x09c3('0x59')]({'raw':!![]});})['then'](function(_0x22aabf){var _0x16aee6=fs[_0x09c3('0x5a')](path[_0x09c3('0x5b')](config[_0x09c3('0x5c')],_0x09c3('0x5d')),_0x09c3('0x68'));var _0x19730d=ejs[_0x09c3('0x5e')](_0x16aee6,{'contexts':_0x22aabf});fs[_0x09c3('0x5f')](_0x09c3('0x6b'),_0x19730d);return respondWithRpcPromise(_0x09c3('0x69'),_0x09c3('0x37'),{'module':_0x09c3('0x6a')});})[_0x09c3('0x2b')](handleError(_0x1e4b4a,null));};
\ No newline at end of file
+var _0x6d9d=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','send','index','map','VoiceContext','rawAttributes','fieldName','key','model','name','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','keys','include','find','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','create','chan_sip.so','user','get','role','UserProfileSection','Contexts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','utf8','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x6d9d,0x1e2));var _0xd6d9=function(_0x5cff20,_0x57b5a3){_0x5cff20=_0x5cff20-0x0;var _0x40ad5a=_0x6d9d[_0x5cff20];return _0x40ad5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6d9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd6d9('0x1'));var moment=require('moment');var BPromise=require(_0xd6d9('0x2'));var Mustache=require(_0xd6d9('0x3'));var util=require(_0xd6d9('0x4'));var path=require(_0xd6d9('0x5'));var sox=require(_0xd6d9('0x6'));var csv=require(_0xd6d9('0x7'));var ejs=require(_0xd6d9('0x8'));var fs=require('fs');var fs_extra=require(_0xd6d9('0x9'));var _=require(_0xd6d9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd6d9('0xb'));var deskjs=require(_0xd6d9('0xc'));var toCsv=require(_0xd6d9('0x7'));var querystring=require(_0xd6d9('0xd'));var Papa=require(_0xd6d9('0xe'));var Redis=require(_0xd6d9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd6d9('0x10'));var as=require(_0xd6d9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd6d9('0x12'))(_0xd6d9('0x13'));var utils=require('../../config/utils');var config=require(_0xd6d9('0x14'));var licenseUtil=require(_0xd6d9('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xd6d9('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x1118ac,_0x568b39,_0x31a373,_0x5da583){return new BPromise(function(_0x3fac16,_0x586c8e){var _0x2c4c97=_0x5da583||client;return _0x2c4c97[_0xd6d9('0x17')](_0x1118ac,_0x31a373)[_0xd6d9('0x18')](function(_0x456549){logger[_0xd6d9('0x19')](_0xd6d9('0x1a'),_0x568b39,'request\x20sent');logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x568b39,_0xd6d9('0x1b'),JSON['stringify'](_0x456549));if(_0x456549[_0xd6d9('0x1c')]){if(_0x456549[_0xd6d9('0x1c')]['code']===0x1f4){logger[_0xd6d9('0x1c')](_0xd6d9('0x1a'),_0x568b39,_0x456549[_0xd6d9('0x1c')][_0xd6d9('0x1d')]);return _0x586c8e(_0x456549[_0xd6d9('0x1c')][_0xd6d9('0x1d')]);}logger['error'](_0xd6d9('0x1a'),_0x568b39,_0x456549[_0xd6d9('0x1c')][_0xd6d9('0x1d')]);return _0x3fac16(_0x456549[_0xd6d9('0x1c')]['message']);}else{logger[_0xd6d9('0x19')]('VoiceContext,\x20%s,\x20%s',_0x568b39,_0xd6d9('0x1b'));_0x3fac16(_0x456549['result'][_0xd6d9('0x1d')]);}})[_0xd6d9('0x1e')](function(_0x4a4218){logger[_0xd6d9('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x568b39,_0x4a4218);_0x586c8e(_0x4a4218);});});}function respondWithStatusCode(_0x3040b2,_0x4ed755){_0x4ed755=_0x4ed755||0xcc;return function(_0x3a3f17){if(_0x3a3f17){return _0x3040b2[_0xd6d9('0x1f')](_0x4ed755);}return _0x3040b2[_0xd6d9('0x20')](_0x4ed755)[_0xd6d9('0x21')]();};}function respondWithResult(_0xea9c3d,_0x14a65f){_0x14a65f=_0x14a65f||0xc8;return function(_0x2f9df8){if(_0x2f9df8){return _0xea9c3d['status'](_0x14a65f)['json'](_0x2f9df8);}};}function respondWithFilteredResult(_0x385b88,_0xb7994e){return function(_0x5afd22){if(_0x5afd22){var _0xe4902a=typeof _0xb7994e[_0xd6d9('0x22')]===_0xd6d9('0x23')&&typeof _0xb7994e[_0xd6d9('0x24')]==='undefined';var _0xdefa6d=_0x5afd22[_0xd6d9('0x25')];var _0x36fe18=_0xe4902a?0x0:_0xb7994e[_0xd6d9('0x22')];var _0x17cd29=_0xe4902a?_0x5afd22[_0xd6d9('0x25')]:_0xb7994e['offset']+_0xb7994e['limit'];var _0x58d5dc;if(_0x17cd29>=_0xdefa6d){_0x17cd29=_0xdefa6d;_0x58d5dc=0xc8;}else{_0x58d5dc=0xce;}_0x385b88[_0xd6d9('0x20')](_0x58d5dc);return _0x385b88[_0xd6d9('0x26')](_0xd6d9('0x27'),_0x36fe18+'-'+_0x17cd29+'/'+_0xdefa6d)[_0xd6d9('0x28')](_0x5afd22);}return null;};}function patchUpdates(_0x1d5aac){return function(_0x3e02d0){try{jsonpatch[_0xd6d9('0x29')](_0x3e02d0,_0x1d5aac,!![]);}catch(_0x5d72d4){return BPromise[_0xd6d9('0x2a')](_0x5d72d4);}return _0x3e02d0[_0xd6d9('0x2b')]();};}function saveUpdates(_0xd98f19,_0x4547da){return function(_0x18bd25){if(_0x18bd25){return _0x18bd25[_0xd6d9('0x2c')](_0xd98f19)[_0xd6d9('0x18')](function(_0x2d34bd){return _0x2d34bd;});}return null;};}function removeEntity(_0x2feefa,_0x9e59c6){return function(_0x5d6405){if(_0x5d6405){return _0x5d6405[_0xd6d9('0x2d')]()[_0xd6d9('0x18')](function(){var _0x111be7=_0x5d6405['get']({'plain':!![]});var _0x2788a0='Contexts';return db['UserProfileResource'][_0xd6d9('0x2d')]({'where':{'type':_0x2788a0,'resourceId':_0x111be7['id']}})[_0xd6d9('0x18')](function(){return _0x5d6405;});})[_0xd6d9('0x18')](function(){_0x2feefa[_0xd6d9('0x20')](0xcc)[_0xd6d9('0x21')]();});}};}function handleEntityNotFound(_0x4aabde,_0x1bc0b0){return function(_0x4f3130){if(!_0x4f3130){_0x4aabde['sendStatus'](0x194);}return _0x4f3130;};}function handleError(_0x2806df,_0x246355){_0x246355=_0x246355||0x1f4;return function(_0x5d6671){logger[_0xd6d9('0x1c')](_0x5d6671[_0xd6d9('0x2e')]);if(_0x5d6671['name']){delete _0x5d6671['name'];}_0x2806df[_0xd6d9('0x20')](_0x246355)[_0xd6d9('0x2f')](_0x5d6671);};}exports[_0xd6d9('0x30')]=function(_0x2a27c2,_0x2b7fb8){var _0x3f974a={},_0x3f9a80={},_0x37122f={'count':0x0,'rows':[]};var _0x2a3522=_[_0xd6d9('0x31')](db[_0xd6d9('0x32')][_0xd6d9('0x33')],function(_0x415bf0){return{'name':_0x415bf0[_0xd6d9('0x34')],'type':_0x415bf0['type'][_0xd6d9('0x35')]};});_0x3f9a80[_0xd6d9('0x36')]=_[_0xd6d9('0x31')](_0x2a3522,_0xd6d9('0x37'));_0x3f9a80[_0xd6d9('0x38')]=_['keys'](_0x2a27c2['query']);_0x3f9a80[_0xd6d9('0x39')]=_['intersection'](_0x3f9a80[_0xd6d9('0x36')],_0x3f9a80[_0xd6d9('0x38')]);_0x3f974a[_0xd6d9('0x3a')]=_[_0xd6d9('0x3b')](_0x3f9a80['model'],qs[_0xd6d9('0x3c')](_0x2a27c2['query'][_0xd6d9('0x3c')]));_0x3f974a['attributes']=_0x3f974a[_0xd6d9('0x3a')]['length']?_0x3f974a[_0xd6d9('0x3a')]:_0x3f9a80[_0xd6d9('0x36')];if(!_0x2a27c2['query'][_0xd6d9('0x3d')](_0xd6d9('0x3e'))){_0x3f974a[_0xd6d9('0x24')]=qs[_0xd6d9('0x24')](_0x2a27c2[_0xd6d9('0x38')][_0xd6d9('0x24')]);_0x3f974a[_0xd6d9('0x22')]=qs['offset'](_0x2a27c2[_0xd6d9('0x38')]['offset']);}_0x3f974a[_0xd6d9('0x3f')]=qs['sort'](_0x2a27c2['query'][_0xd6d9('0x40')]);_0x3f974a[_0xd6d9('0x41')]=qs[_0xd6d9('0x39')](_[_0xd6d9('0x42')](_0x2a27c2['query'],_0x3f9a80[_0xd6d9('0x39')]),_0x2a3522);if(_0x2a27c2['query']['filter']){_0x3f974a[_0xd6d9('0x41')]=_[_0xd6d9('0x43')](_0x3f974a['where'],{'$or':_[_0xd6d9('0x31')](_0x2a3522,function(_0x46a623){if(_0x46a623['type']!==_0xd6d9('0x44')){var _0x34df6f={};_0x34df6f[_0x46a623[_0xd6d9('0x37')]]={'$like':'%'+_0x2a27c2[_0xd6d9('0x38')][_0xd6d9('0x45')]+'%'};return _0x34df6f;}})});}_0x3f974a=_['merge']({},_0x3f974a,_0x2a27c2[_0xd6d9('0x46')]);var _0x3bba53={'where':_0x3f974a[_0xd6d9('0x41')]};return db['VoiceContext'][_0xd6d9('0x25')](_0x3bba53)[_0xd6d9('0x18')](function(_0x330c44){_0x37122f[_0xd6d9('0x25')]=_0x330c44;if(_0x2a27c2[_0xd6d9('0x38')][_0xd6d9('0x47')]){_0x3f974a['include']=[{'all':!![]}];}return db['VoiceContext'][_0xd6d9('0x48')](_0x3f974a);})[_0xd6d9('0x18')](function(_0x4649dc){_0x37122f[_0xd6d9('0x49')]=_0x4649dc;return _0x37122f;})[_0xd6d9('0x18')](respondWithFilteredResult(_0x2b7fb8,_0x3f974a))[_0xd6d9('0x1e')](handleError(_0x2b7fb8,null));};exports['show']=function(_0x5a29ca,_0x114325){var _0x4281c8={'raw':![],'where':{'id':_0x5a29ca[_0xd6d9('0x4a')]['id']}},_0xb30f2e={};_0xb30f2e[_0xd6d9('0x36')]=_[_0xd6d9('0x4b')](db[_0xd6d9('0x32')][_0xd6d9('0x33')]);_0xb30f2e[_0xd6d9('0x38')]=_[_0xd6d9('0x4b')](_0x5a29ca[_0xd6d9('0x38')]);_0xb30f2e[_0xd6d9('0x39')]=_[_0xd6d9('0x3b')](_0xb30f2e['model'],_0xb30f2e[_0xd6d9('0x38')]);_0x4281c8[_0xd6d9('0x3a')]=_[_0xd6d9('0x3b')](_0xb30f2e[_0xd6d9('0x36')],qs[_0xd6d9('0x3c')](_0x5a29ca[_0xd6d9('0x38')][_0xd6d9('0x3c')]));_0x4281c8[_0xd6d9('0x3a')]=_0x4281c8[_0xd6d9('0x3a')]['length']?_0x4281c8[_0xd6d9('0x3a')]:_0xb30f2e[_0xd6d9('0x36')];if(_0x5a29ca[_0xd6d9('0x38')][_0xd6d9('0x47')]){_0x4281c8[_0xd6d9('0x4c')]=[{'all':!![]}];}_0x4281c8=_[_0xd6d9('0x43')]({},_0x4281c8,_0x5a29ca['options']);return db[_0xd6d9('0x32')][_0xd6d9('0x4d')](_0x4281c8)['then'](handleEntityNotFound(_0x114325,null))['then'](respondWithResult(_0x114325,null))[_0xd6d9('0x1e')](handleError(_0x114325,null));};exports['create']=function(_0x547e0d,_0x4014b5,_0x270533){var _0x311cc5;return db[_0xd6d9('0x32')]['create'](_0x547e0d['body'],{'raw':!![]})[_0xd6d9('0x18')](function(_0x1c66e5){_0x311cc5=_0x1c66e5;return db[_0xd6d9('0x32')][_0xd6d9('0x48')]({'raw':!![]});})[_0xd6d9('0x18')](function(_0xcd7a19){var _0x1ed4de=fs[_0xd6d9('0x4e')](path[_0xd6d9('0x4f')](config[_0xd6d9('0x50')],_0xd6d9('0x51')),'utf8');var _0x2c4664=ejs[_0xd6d9('0x52')](_0x1ed4de,{'contexts':_0xcd7a19||[]});fs[_0xd6d9('0x53')](_0xd6d9('0x54'),_0x2c4664);})[_0xd6d9('0x18')](function(){return respondWithRpcPromise(_0xd6d9('0x55'),_0xd6d9('0x56'),{'module':_0xd6d9('0x57')});})[_0xd6d9('0x18')](function(){var _0x1f27ee=_0x547e0d[_0xd6d9('0x58')][_0xd6d9('0x59')]({'plain':!![]});if(!_0x1f27ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f27ee[_0xd6d9('0x5a')]===_0xd6d9('0x58')){var _0x24a1df=_0x311cc5[_0xd6d9('0x59')]({'plain':!![]});return db[_0xd6d9('0x5b')][_0xd6d9('0x4d')]({'where':{'name':_0xd6d9('0x5c'),'userProfileId':_0x1f27ee[_0xd6d9('0x5d')]},'raw':!![]})[_0xd6d9('0x18')](function(_0x5edfd9){if(_0x5edfd9&&_0x5edfd9[_0xd6d9('0x5e')]===0x0){return db[_0xd6d9('0x5f')]['create']({'name':_0x24a1df[_0xd6d9('0x37')],'resourceId':_0x24a1df['id'],'type':_0x5edfd9['name'],'sectionId':_0x5edfd9['id']},{})[_0xd6d9('0x18')](function(){return _0x311cc5;});}else{return _0x311cc5;}})[_0xd6d9('0x1e')](function(_0x5d4a6e){logger[_0xd6d9('0x1c')](_0xd6d9('0x60'),_0x5d4a6e);throw _0x5d4a6e;});}return _0x311cc5;})[_0xd6d9('0x18')](respondWithResult(_0x4014b5,0xc9))[_0xd6d9('0x1e')](handleError(_0x4014b5,null));};exports[_0xd6d9('0x2c')]=function(_0x229840,_0x3f74a6,_0x339110){var _0xee856b;return db[_0xd6d9('0x32')][_0xd6d9('0x4d')]({'where':{'id':_0x229840['params']['id']}})[_0xd6d9('0x18')](handleEntityNotFound(_0x3f74a6,null))[_0xd6d9('0x18')](saveUpdates(_0x229840[_0xd6d9('0x61')],null))[_0xd6d9('0x18')](function(_0x37a2a7){if(_0x37a2a7){_0xee856b=_0x37a2a7;return db[_0xd6d9('0x32')][_0xd6d9('0x48')]({'raw':!![]});}})[_0xd6d9('0x18')](function(_0x4b3432){var _0x32eb05=fs[_0xd6d9('0x4e')](path[_0xd6d9('0x4f')](config[_0xd6d9('0x50')],_0xd6d9('0x51')),_0xd6d9('0x62'));var _0x17d3fd=ejs[_0xd6d9('0x52')](_0x32eb05,{'contexts':_0x4b3432||[]});fs[_0xd6d9('0x53')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x17d3fd);})[_0xd6d9('0x18')](function(){return respondWithRpcPromise(_0xd6d9('0x55'),'update',{'module':_0xd6d9('0x57')});})[_0xd6d9('0x18')](function(){return _0xee856b;})[_0xd6d9('0x18')](respondWithResult(_0x3f74a6,null))['catch'](handleError(_0x3f74a6,null));};exports[_0xd6d9('0x2d')]=function(_0x3b8059,_0x2e3c78,_0x3ee787){var _0x409626;return db[_0xd6d9('0x32')]['find']({'where':{'id':_0x3b8059[_0xd6d9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e3c78,null))[_0xd6d9('0x18')](removeEntity(_0x2e3c78,null))[_0xd6d9('0x18')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xd6d9('0x18')](function(_0x5d35ec){var _0x421ab3=fs[_0xd6d9('0x4e')](path[_0xd6d9('0x4f')](config[_0xd6d9('0x50')],_0xd6d9('0x51')),_0xd6d9('0x62'));var _0x28f09c=ejs[_0xd6d9('0x52')](_0x421ab3,{'contexts':_0x5d35ec});fs[_0xd6d9('0x53')](_0xd6d9('0x54'),_0x28f09c);return respondWithRpcPromise(_0xd6d9('0x55'),_0xd6d9('0x2d'),{'module':_0xd6d9('0x57')});})['catch'](handleError(_0x2e3c78,null));};
\ No newline at end of file
index 157d6fb..2849f9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cc1=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x253238,_0x54a270){var _0x546455=function(_0x212d29){while(--_0x212d29){_0x253238['push'](_0x253238['shift']());}};_0x546455(++_0x54a270);}(_0x9cc1,0x134));var _0x19cc=function(_0x458dd7,_0xe5602b){_0x458dd7=_0x458dd7-0x0;var _0x2a12f3=_0x9cc1[_0x458dd7];return _0x2a12f3;};'use strict';var _=require(_0x19cc('0x0'));var util=require(_0x19cc('0x1'));var logger=require(_0x19cc('0x2'))(_0x19cc('0x3'));var moment=require(_0x19cc('0x4'));var BPromise=require(_0x19cc('0x5'));var rp=require(_0x19cc('0x6'));var fs=require('fs');var path=require(_0x19cc('0x7'));var rimraf=require(_0x19cc('0x8'));var config=require(_0x19cc('0x9'));var attributes=require(_0x19cc('0xa'));module[_0x19cc('0xb')]=function(_0x45d792,_0x2bf64b){return _0x45d792[_0x19cc('0xc')](_0x19cc('0xd'),attributes,{'tableName':_0x19cc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b16=['VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0xb4fe2c,_0x3d2be6){var _0x460a1a=function(_0x2f8039){while(--_0x2f8039){_0xb4fe2c['push'](_0xb4fe2c['shift']());}};_0x460a1a(++_0x3d2be6);}(_0x9b16,0x16e));var _0x69b1=function(_0x59ea41,_0x5ef780){_0x59ea41=_0x59ea41-0x0;var _0x1d71ad=_0x9b16[_0x59ea41];return _0x1d71ad;};'use strict';var _=require(_0x69b1('0x0'));var util=require('util');var logger=require(_0x69b1('0x1'))(_0x69b1('0x2'));var moment=require(_0x69b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x69b1('0x4'));var fs=require('fs');var path=require(_0x69b1('0x5'));var rimraf=require(_0x69b1('0x6'));var config=require(_0x69b1('0x7'));var attributes=require(_0x69b1('0x8'));module[_0x69b1('0x9')]=function(_0x1fc2dd,_0x5830bb){return _0x1fc2dd[_0x69b1('0xa')](_0x69b1('0xb'),attributes,{'tableName':_0x69b1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a581344..1da05aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97f5=['code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','error'];(function(_0xe9c061,_0x38ee98){var _0x289f96=function(_0x57847a){while(--_0x57847a){_0xe9c061['push'](_0xe9c061['shift']());}};_0x289f96(++_0x38ee98);}(_0x97f5,0x72));var _0x597f=function(_0x828e15,_0x4172de){_0x828e15=_0x828e15-0x0;var _0x24b0a8=_0x97f5[_0x828e15];return _0x24b0a8;};'use strict';var _=require(_0x597f('0x0'));var util=require(_0x597f('0x1'));var moment=require(_0x597f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x597f('0x3'));var db=require(_0x597f('0x4'))['db'];var utils=require(_0x597f('0x5'));var logger=require(_0x597f('0x6'))(_0x597f('0x7'));var config=require(_0x597f('0x8'));var jayson=require(_0x597f('0x9'));var client=jayson[_0x597f('0xa')][_0x597f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f4eb9,_0x22b5d0,_0x20f0fc){return new BPromise(function(_0x1098e6,_0x40b1cd){return client[_0x597f('0xc')](_0x5f4eb9,_0x20f0fc)[_0x597f('0xd')](function(_0x5b293a){logger[_0x597f('0xe')](_0x597f('0xf'),_0x22b5d0,_0x597f('0x10'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x22b5d0,_0x597f('0x10'),JSON['stringify'](_0x5b293a));if(_0x5b293a[_0x597f('0x11')]){if(_0x5b293a[_0x597f('0x11')][_0x597f('0x12')]===0x1f4){logger['error'](_0x597f('0xf'),_0x22b5d0,_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);return _0x40b1cd(_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);}logger[_0x597f('0x11')](_0x597f('0xf'),_0x22b5d0,_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);return _0x1098e6(_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);}else{logger[_0x597f('0xe')](_0x597f('0xf'),_0x22b5d0,'request\x20sent');_0x1098e6(_0x5b293a[_0x597f('0x14')][_0x597f('0x13')]);}})[_0x597f('0x15')](function(_0x55eed9){logger[_0x597f('0x11')]('VoiceContext,\x20%s,\x20%s',_0x22b5d0,_0x55eed9);_0x40b1cd(_0x55eed9);});});}
\ No newline at end of file
+var _0x9972=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1a094c,_0x30fd18){var _0x7c3ca6=function(_0xce6f1a){while(--_0xce6f1a){_0x1a094c['push'](_0x1a094c['shift']());}};_0x7c3ca6(++_0x30fd18);}(_0x9972,0xaa));var _0x2997=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9972[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x2997('0x0'));var util=require(_0x2997('0x1'));var moment=require(_0x2997('0x2'));var BPromise=require(_0x2997('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2997('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2997('0x5'));var logger=require('../../config/logger')(_0x2997('0x6'));var config=require(_0x2997('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2997('0x8')][_0x2997('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27d795,_0x581ed1,_0x1820dc){return new BPromise(function(_0x4445bb,_0x1fe2bb){return client[_0x2997('0xa')](_0x27d795,_0x1820dc)[_0x2997('0xb')](function(_0x5d857){logger['info'](_0x2997('0xc'),_0x581ed1,_0x2997('0xd'));logger['debug'](_0x2997('0xe'),_0x581ed1,'request\x20sent',JSON[_0x2997('0xf')](_0x5d857));if(_0x5d857['error']){if(_0x5d857[_0x2997('0x10')][_0x2997('0x11')]===0x1f4){logger[_0x2997('0x10')]('VoiceContext,\x20%s,\x20%s',_0x581ed1,_0x5d857[_0x2997('0x10')][_0x2997('0x12')]);return _0x1fe2bb(_0x5d857['error'][_0x2997('0x12')]);}logger[_0x2997('0x10')](_0x2997('0xc'),_0x581ed1,_0x5d857[_0x2997('0x10')][_0x2997('0x12')]);return _0x4445bb(_0x5d857[_0x2997('0x10')][_0x2997('0x12')]);}else{logger['info'](_0x2997('0xc'),_0x581ed1,_0x2997('0xd'));_0x4445bb(_0x5d857[_0x2997('0x13')]['message']);}})[_0x2997('0x14')](function(_0x2c65d1){logger[_0x2997('0x10')](_0x2997('0xc'),_0x581ed1,_0x2c65d1);_0x1fe2bb(_0x2c65d1);});});}
\ No newline at end of file
index 512e904..09923b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d57=['index','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get'];(function(_0x1ccda4,_0x1647d3){var _0x334196=function(_0x470901){while(--_0x470901){_0x1ccda4['push'](_0x1ccda4['shift']());}};_0x334196(++_0x1647d3);}(_0x1d57,0x123));var _0x71d5=function(_0x1874e5,_0xabe75a){_0x1874e5=_0x1874e5-0x0;var _0x5541f9=_0x1d57[_0x1874e5];return _0x5541f9;};'use strict';var multer=require('multer');var util=require(_0x71d5('0x0'));var path=require(_0x71d5('0x1'));var timeout=require(_0x71d5('0x2'));var express=require('express');var router=express[_0x71d5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x71d5('0x4'));var interaction=require(_0x71d5('0x5'));var config=require(_0x71d5('0x6'));var controller=require(_0x71d5('0x7'));router[_0x71d5('0x8')]('/',auth['isAuthenticated'](),controller[_0x71d5('0x9')]);router[_0x71d5('0x8')]('/describe',auth[_0x71d5('0xa')](),controller[_0x71d5('0xb')]);router['get'](_0x71d5('0xc'),auth[_0x71d5('0xa')](),controller[_0x71d5('0xd')]);router[_0x71d5('0xe')]('/',auth[_0x71d5('0xa')](),controller['create']);router[_0x71d5('0xf')](_0x71d5('0xc'),auth[_0x71d5('0xa')](),controller[_0x71d5('0x10')]);router[_0x71d5('0x11')]('/:id',auth[_0x71d5('0xa')](),controller[_0x71d5('0x12')]);module[_0x71d5('0x13')]=router;
\ No newline at end of file
+var _0x7119=['/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','describe','post','create'];(function(_0x5ce56c,_0x27e813){var _0x528aac=function(_0x500983){while(--_0x500983){_0x5ce56c['push'](_0x5ce56c['shift']());}};_0x528aac(++_0x27e813);}(_0x7119,0x1c7));var _0x9711=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0x7119[_0x576d8a];return _0x3dc3ef;};'use strict';var multer=require('multer');var util=require(_0x9711('0x0'));var path=require('path');var timeout=require(_0x9711('0x1'));var express=require('express');var router=express[_0x9711('0x2')]();var fs_extra=require(_0x9711('0x3'));var auth=require(_0x9711('0x4'));var interaction=require(_0x9711('0x5'));var config=require('../../config/environment');var controller=require(_0x9711('0x6'));router[_0x9711('0x7')]('/',auth[_0x9711('0x8')](),controller[_0x9711('0x9')]);router[_0x9711('0x7')]('/describe',auth[_0x9711('0x8')](),controller[_0x9711('0xa')]);router[_0x9711('0x7')]('/:id',auth[_0x9711('0x8')](),controller['show']);router[_0x9711('0xb')]('/',auth[_0x9711('0x8')](),controller[_0x9711('0xc')]);router['put'](_0x9711('0xd'),auth[_0x9711('0x8')](),controller[_0x9711('0xe')]);router[_0x9711('0xf')](_0x9711('0xd'),auth[_0x9711('0x8')](),controller[_0x9711('0x10')]);module[_0x9711('0x11')]=router;
\ No newline at end of file
index e460912..de719d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x7baac8,_0x481055){var _0x572f4e=function(_0x4c0020){while(--_0x4c0020){_0x7baac8['push'](_0x7baac8['shift']());}};_0x572f4e(++_0x481055);}(_0x008c,0x188));var _0xc008=function(_0x41216a,_0x53e83d){_0x41216a=_0x41216a-0x0;var _0x122cf1=_0x008c[_0x41216a];return _0x122cf1;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}};
\ No newline at end of file
+var _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0x3299ea,_0x5196c0){var _0xe9255=function(_0x122d1f){while(--_0x122d1f){_0x3299ea['push'](_0x3299ea['shift']());}};_0xe9255(++_0x5196c0);}(_0x6aa7,0x178));var _0x76aa=function(_0x80b1f2,_0x80544f){_0x80b1f2=_0x80b1f2-0x0;var _0x15a1ad=_0x6aa7[_0x80b1f2];return _0x15a1ad;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index bcbda4f..ad03304 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb29b=['fieldName','type','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','fields','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','VoiceDialReport','rawAttributes'];(function(_0x2bddf9,_0x22c873){var _0x3f3ae9=function(_0x2d91ac){while(--_0x2d91ac){_0x2bddf9['push'](_0x2bddf9['shift']());}};_0x3f3ae9(++_0x22c873);}(_0xb29b,0x68));var _0xbb29=function(_0x52ecc9,_0x472be8){_0x52ecc9=_0x52ecc9-0x0;var _0x50f6a5=_0xb29b[_0x52ecc9];return _0x50f6a5;};'use strict';var emlformat=require(_0xbb29('0x0'));var rimraf=require(_0xbb29('0x1'));var zipdir=require(_0xbb29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb29('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbb29('0x4'));var util=require(_0xbb29('0x5'));var path=require('path');var sox=require(_0xbb29('0x6'));var csv=require(_0xbb29('0x7'));var ejs=require(_0xbb29('0x8'));var fs=require('fs');var fs_extra=require(_0xbb29('0x9'));var _=require(_0xbb29('0xa'));var squel=require(_0xbb29('0xb'));var crypto=require(_0xbb29('0xc'));var jsforce=require(_0xbb29('0xd'));var deskjs=require(_0xbb29('0xe'));var toCsv=require(_0xbb29('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbb29('0xf'));var authService=require(_0xbb29('0x10'));var qs=require(_0xbb29('0x11'));var as=require(_0xbb29('0x12'));var hardwareService=require(_0xbb29('0x13'));var logger=require(_0xbb29('0x14'))(_0xbb29('0x15'));var utils=require('../../config/utils');var config=require(_0xbb29('0x16'));var licenseUtil=require(_0xbb29('0x17'));var db=require(_0xbb29('0x18'))['db'];function respondWithStatusCode(_0x4dc602,_0x515cd9){_0x515cd9=_0x515cd9||0xcc;return function(_0x366aef){if(_0x366aef){return _0x4dc602[_0xbb29('0x19')](_0x515cd9);}return _0x4dc602[_0xbb29('0x1a')](_0x515cd9)[_0xbb29('0x1b')]();};}function respondWithResult(_0x38e772,_0x9d9f83){_0x9d9f83=_0x9d9f83||0xc8;return function(_0x2e6abb){if(_0x2e6abb){return _0x38e772[_0xbb29('0x1a')](_0x9d9f83)[_0xbb29('0x1c')](_0x2e6abb);}};}function respondWithFilteredResult(_0x4e07a4,_0x4cbbca){return function(_0x1c3447){if(_0x1c3447){var _0x43d71d=typeof _0x4cbbca[_0xbb29('0x1d')]==='undefined'&&typeof _0x4cbbca['limit']===_0xbb29('0x1e');var _0x3fa3ee=_0x1c3447[_0xbb29('0x1f')];var _0x559fa1=_0x43d71d?0x0:_0x4cbbca[_0xbb29('0x1d')];var _0x3f5a00=_0x43d71d?_0x1c3447[_0xbb29('0x1f')]:_0x4cbbca['offset']+_0x4cbbca[_0xbb29('0x20')];var _0x4e33c2;if(_0x3f5a00>=_0x3fa3ee){_0x3f5a00=_0x3fa3ee;_0x4e33c2=0xc8;}else{_0x4e33c2=0xce;}_0x4e07a4[_0xbb29('0x1a')](_0x4e33c2);return _0x4e07a4['set'](_0xbb29('0x21'),_0x559fa1+'-'+_0x3f5a00+'/'+_0x3fa3ee)[_0xbb29('0x1c')](_0x1c3447);}return null;};}function patchUpdates(_0x543650){return function(_0x4f961d){try{jsonpatch[_0xbb29('0x22')](_0x4f961d,_0x543650,!![]);}catch(_0x432009){return BPromise[_0xbb29('0x23')](_0x432009);}return _0x4f961d['save']();};}function saveUpdates(_0x56f573,_0x25e5e3){return function(_0x5dead2){if(_0x5dead2){return _0x5dead2[_0xbb29('0x24')](_0x56f573)[_0xbb29('0x25')](function(_0x2af833){return _0x2af833;});}return null;};}function removeEntity(_0x7fec1,_0x5d1cc7){return function(_0x14353f){if(_0x14353f){return _0x14353f[_0xbb29('0x26')]()[_0xbb29('0x25')](function(){_0x7fec1[_0xbb29('0x1a')](0xcc)[_0xbb29('0x1b')]();});}};}function handleEntityNotFound(_0x138a37,_0x3c5a59){return function(_0x50be1f){if(!_0x50be1f){_0x138a37[_0xbb29('0x19')](0x194);}return _0x50be1f;};}function handleError(_0x45d1b3,_0xbd3390){_0xbd3390=_0xbd3390||0x1f4;return function(_0x5d7188){logger[_0xbb29('0x27')](_0x5d7188[_0xbb29('0x28')]);if(_0x5d7188['name']){delete _0x5d7188[_0xbb29('0x29')];}_0x45d1b3[_0xbb29('0x1a')](_0xbd3390)[_0xbb29('0x2a')](_0x5d7188);};}exports['index']=function(_0x39ce67,_0x3f57cc){var _0x181aff={},_0x56b4ef={},_0x130120={'count':0x0,'rows':[]};var _0x10b925=_[_0xbb29('0x2b')](db[_0xbb29('0x2c')][_0xbb29('0x2d')],function(_0x272b60){return{'name':_0x272b60[_0xbb29('0x2e')],'type':_0x272b60[_0xbb29('0x2f')][_0xbb29('0x30')]};});_0x56b4ef['model']=_[_0xbb29('0x2b')](_0x10b925,_0xbb29('0x29'));_0x56b4ef[_0xbb29('0x31')]=_[_0xbb29('0x32')](_0x39ce67[_0xbb29('0x31')]);_0x56b4ef[_0xbb29('0x33')]=_['intersection'](_0x56b4ef[_0xbb29('0x34')],_0x56b4ef['query']);_0x181aff[_0xbb29('0x35')]=_[_0xbb29('0x36')](_0x56b4ef['model'],qs['fields'](_0x39ce67[_0xbb29('0x31')]['fields']));_0x181aff[_0xbb29('0x35')]=_0x181aff[_0xbb29('0x35')][_0xbb29('0x37')]?_0x181aff[_0xbb29('0x35')]:_0x56b4ef['model'];if(!_0x39ce67[_0xbb29('0x31')][_0xbb29('0x38')](_0xbb29('0x39'))){_0x181aff['limit']=qs[_0xbb29('0x20')](_0x39ce67[_0xbb29('0x31')][_0xbb29('0x20')]);_0x181aff['offset']=qs[_0xbb29('0x1d')](_0x39ce67['query']['offset']);}_0x181aff['order']=qs[_0xbb29('0x3a')](_0x39ce67[_0xbb29('0x31')][_0xbb29('0x3a')]);_0x181aff[_0xbb29('0x3b')]=qs[_0xbb29('0x33')](_[_0xbb29('0x3c')](_0x39ce67[_0xbb29('0x31')],_0x56b4ef[_0xbb29('0x33')]),_0x10b925);if(_0x39ce67[_0xbb29('0x31')]['filter']){_0x181aff[_0xbb29('0x3b')]=_['merge'](_0x181aff[_0xbb29('0x3b')],{'$or':_['map'](_0x10b925,function(_0x26b68e){if(_0x26b68e[_0xbb29('0x2f')]!==_0xbb29('0x3d')){var _0x24c78e={};_0x24c78e[_0x26b68e['name']]={'$like':'%'+_0x39ce67[_0xbb29('0x31')]['filter']+'%'};return _0x24c78e;}})});}_0x181aff=_[_0xbb29('0x3e')]({},_0x181aff,_0x39ce67[_0xbb29('0x3f')]);var _0x449216={'where':_0x181aff[_0xbb29('0x3b')]};return db['VoiceDialReport']['count'](_0x449216)['then'](function(_0x17ef42){_0x130120[_0xbb29('0x1f')]=_0x17ef42;if(_0x39ce67[_0xbb29('0x31')][_0xbb29('0x40')]){_0x181aff[_0xbb29('0x41')]=[{'all':!![]}];}return db[_0xbb29('0x2c')][_0xbb29('0x42')](_0x181aff);})[_0xbb29('0x25')](function(_0x4bd325){_0x130120[_0xbb29('0x43')]=_0x4bd325;return _0x130120;})[_0xbb29('0x25')](respondWithFilteredResult(_0x3f57cc,_0x181aff))['catch'](handleError(_0x3f57cc,null));};exports['show']=function(_0x493d91,_0x437e87){var _0x2ac236={'raw':!![],'where':{'id':_0x493d91[_0xbb29('0x44')]['id']}},_0x29184f={};_0x29184f['model']=_['keys'](db[_0xbb29('0x2c')][_0xbb29('0x2d')]);_0x29184f[_0xbb29('0x31')]=_[_0xbb29('0x32')](_0x493d91['query']);_0x29184f['filters']=_[_0xbb29('0x36')](_0x29184f['model'],_0x29184f['query']);_0x2ac236[_0xbb29('0x35')]=_['intersection'](_0x29184f[_0xbb29('0x34')],qs[_0xbb29('0x45')](_0x493d91['query'][_0xbb29('0x45')]));_0x2ac236[_0xbb29('0x35')]=_0x2ac236[_0xbb29('0x35')][_0xbb29('0x37')]?_0x2ac236[_0xbb29('0x35')]:_0x29184f['model'];if(_0x493d91[_0xbb29('0x31')][_0xbb29('0x40')]){_0x2ac236[_0xbb29('0x41')]=[{'all':!![]}];}_0x2ac236=_[_0xbb29('0x3e')]({},_0x2ac236,_0x493d91['options']);return db[_0xbb29('0x2c')]['find'](_0x2ac236)['then'](handleEntityNotFound(_0x437e87,null))['then'](respondWithResult(_0x437e87,null))[_0xbb29('0x46')](handleError(_0x437e87,null));};exports[_0xbb29('0x47')]=function(_0x3d876d,_0x3bc843){return db[_0xbb29('0x2c')][_0xbb29('0x47')](_0x3d876d['body'],{})[_0xbb29('0x25')](respondWithResult(_0x3bc843,0xc9))[_0xbb29('0x46')](handleError(_0x3bc843,null));};exports[_0xbb29('0x24')]=function(_0x1da956,_0x4ec215){if(_0x1da956[_0xbb29('0x48')]['id']){delete _0x1da956[_0xbb29('0x48')]['id'];}return db[_0xbb29('0x2c')][_0xbb29('0x49')]({'where':{'id':_0x1da956['params']['id']}})[_0xbb29('0x25')](handleEntityNotFound(_0x4ec215,null))[_0xbb29('0x25')](saveUpdates(_0x1da956['body'],null))[_0xbb29('0x25')](respondWithResult(_0x4ec215,null))[_0xbb29('0x46')](handleError(_0x4ec215,null));};exports['destroy']=function(_0x1dc142,_0x1d6771){return db[_0xbb29('0x2c')]['find']({'where':{'id':_0x1dc142[_0xbb29('0x44')]['id']}})[_0xbb29('0x25')](handleEntityNotFound(_0x1d6771,null))['then'](removeEntity(_0x1d6771,null))[_0xbb29('0x46')](handleError(_0x1d6771,null));};exports['describe']=function(_0x4dae31,_0x3efc8d){return db[_0xbb29('0x2c')][_0xbb29('0x4a')]()[_0xbb29('0x25')](respondWithResult(_0x3efc8d,null))[_0xbb29('0x46')](handleError(_0x3efc8d,null));};
\ No newline at end of file
+var _0xb0b5=['request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','VoiceDialReport','includeAll','include','rows','show','params','options','create','body','catch','find','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x38a998,_0x37b7f1){var _0x1160eb=function(_0x29c38b){while(--_0x29c38b){_0x38a998['push'](_0x38a998['shift']());}};_0x1160eb(++_0x37b7f1);}(_0xb0b5,0x12d));var _0x5b0b=function(_0x5c80c1,_0x4f80ca){_0x5c80c1=_0x5c80c1-0x0;var _0xb74ac=_0xb0b5[_0x5c80c1];return _0xb74ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b0b('0x0'));var zipdir=require(_0x5b0b('0x1'));var jsonpatch=require(_0x5b0b('0x2'));var rp=require(_0x5b0b('0x3'));var moment=require('moment');var BPromise=require(_0x5b0b('0x4'));var Mustache=require(_0x5b0b('0x5'));var util=require(_0x5b0b('0x6'));var path=require(_0x5b0b('0x7'));var sox=require(_0x5b0b('0x8'));var csv=require(_0x5b0b('0x9'));var ejs=require(_0x5b0b('0xa'));var fs=require('fs');var fs_extra=require(_0x5b0b('0xb'));var _=require(_0x5b0b('0xc'));var squel=require(_0x5b0b('0xd'));var crypto=require('crypto');var jsforce=require(_0x5b0b('0xe'));var deskjs=require(_0x5b0b('0xf'));var toCsv=require(_0x5b0b('0x9'));var querystring=require(_0x5b0b('0x10'));var Papa=require(_0x5b0b('0x11'));var Redis=require(_0x5b0b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5b0b('0x13'));var as=require(_0x5b0b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b0b('0x15'))('api');var utils=require(_0x5b0b('0x16'));var config=require(_0x5b0b('0x17'));var licenseUtil=require(_0x5b0b('0x18'));var db=require(_0x5b0b('0x19'))['db'];function respondWithStatusCode(_0x2bf08d,_0x5e0295){_0x5e0295=_0x5e0295||0xcc;return function(_0x425ce5){if(_0x425ce5){return _0x2bf08d[_0x5b0b('0x1a')](_0x5e0295);}return _0x2bf08d[_0x5b0b('0x1b')](_0x5e0295)['end']();};}function respondWithResult(_0x44c438,_0x136d25){_0x136d25=_0x136d25||0xc8;return function(_0x560e83){if(_0x560e83){return _0x44c438[_0x5b0b('0x1b')](_0x136d25)[_0x5b0b('0x1c')](_0x560e83);}};}function respondWithFilteredResult(_0x4b0e33,_0x2125da){return function(_0x3459d0){if(_0x3459d0){var _0x586e3c=typeof _0x2125da[_0x5b0b('0x1d')]===_0x5b0b('0x1e')&&typeof _0x2125da[_0x5b0b('0x1f')]===_0x5b0b('0x1e');var _0x7b77b7=_0x3459d0[_0x5b0b('0x20')];var _0x3808fd=_0x586e3c?0x0:_0x2125da[_0x5b0b('0x1d')];var _0x39ae82=_0x586e3c?_0x3459d0[_0x5b0b('0x20')]:_0x2125da['offset']+_0x2125da['limit'];var _0x565d83;if(_0x39ae82>=_0x7b77b7){_0x39ae82=_0x7b77b7;_0x565d83=0xc8;}else{_0x565d83=0xce;}_0x4b0e33[_0x5b0b('0x1b')](_0x565d83);return _0x4b0e33['set']('Content-Range',_0x3808fd+'-'+_0x39ae82+'/'+_0x7b77b7)[_0x5b0b('0x1c')](_0x3459d0);}return null;};}function patchUpdates(_0x7c22bc){return function(_0x9ae7e7){try{jsonpatch[_0x5b0b('0x21')](_0x9ae7e7,_0x7c22bc,!![]);}catch(_0x5417e0){return BPromise[_0x5b0b('0x22')](_0x5417e0);}return _0x9ae7e7[_0x5b0b('0x23')]();};}function saveUpdates(_0xe7cbbc,_0x383411){return function(_0x20c7d3){if(_0x20c7d3){return _0x20c7d3[_0x5b0b('0x24')](_0xe7cbbc)['then'](function(_0x12d4e1){return _0x12d4e1;});}return null;};}function removeEntity(_0x4f1dcc,_0x37ea7e){return function(_0x12280f){if(_0x12280f){return _0x12280f[_0x5b0b('0x25')]()[_0x5b0b('0x26')](function(){_0x4f1dcc['status'](0xcc)[_0x5b0b('0x27')]();});}};}function handleEntityNotFound(_0x4dbbb7,_0xb137cb){return function(_0xdf309c){if(!_0xdf309c){_0x4dbbb7[_0x5b0b('0x1a')](0x194);}return _0xdf309c;};}function handleError(_0x5cd35a,_0x3dccc6){_0x3dccc6=_0x3dccc6||0x1f4;return function(_0x1b1889){logger[_0x5b0b('0x28')](_0x1b1889['stack']);if(_0x1b1889[_0x5b0b('0x29')]){delete _0x1b1889[_0x5b0b('0x29')];}_0x5cd35a[_0x5b0b('0x1b')](_0x3dccc6)[_0x5b0b('0x2a')](_0x1b1889);};}exports[_0x5b0b('0x2b')]=function(_0x44a9d0,_0x1f83b5){var _0x686357={},_0x135d4f={},_0x474206={'count':0x0,'rows':[]};var _0x24dc4b=_[_0x5b0b('0x2c')](db['VoiceDialReport'][_0x5b0b('0x2d')],function(_0x1a5adb){return{'name':_0x1a5adb[_0x5b0b('0x2e')],'type':_0x1a5adb[_0x5b0b('0x2f')][_0x5b0b('0x30')]};});_0x135d4f[_0x5b0b('0x31')]=_[_0x5b0b('0x2c')](_0x24dc4b,_0x5b0b('0x29'));_0x135d4f[_0x5b0b('0x32')]=_[_0x5b0b('0x33')](_0x44a9d0[_0x5b0b('0x32')]);_0x135d4f[_0x5b0b('0x34')]=_[_0x5b0b('0x35')](_0x135d4f[_0x5b0b('0x31')],_0x135d4f[_0x5b0b('0x32')]);_0x686357[_0x5b0b('0x36')]=_[_0x5b0b('0x35')](_0x135d4f[_0x5b0b('0x31')],qs[_0x5b0b('0x37')](_0x44a9d0[_0x5b0b('0x32')][_0x5b0b('0x37')]));_0x686357[_0x5b0b('0x36')]=_0x686357[_0x5b0b('0x36')][_0x5b0b('0x38')]?_0x686357[_0x5b0b('0x36')]:_0x135d4f[_0x5b0b('0x31')];if(!_0x44a9d0['query'][_0x5b0b('0x39')]('nolimit')){_0x686357['limit']=qs[_0x5b0b('0x1f')](_0x44a9d0[_0x5b0b('0x32')][_0x5b0b('0x1f')]);_0x686357['offset']=qs['offset'](_0x44a9d0['query']['offset']);}_0x686357[_0x5b0b('0x3a')]=qs[_0x5b0b('0x3b')](_0x44a9d0[_0x5b0b('0x32')][_0x5b0b('0x3b')]);_0x686357['where']=qs[_0x5b0b('0x34')](_['pick'](_0x44a9d0['query'],_0x135d4f[_0x5b0b('0x34')]),_0x24dc4b);if(_0x44a9d0['query'][_0x5b0b('0x3c')]){_0x686357[_0x5b0b('0x3d')]=_[_0x5b0b('0x3e')](_0x686357[_0x5b0b('0x3d')],{'$or':_[_0x5b0b('0x2c')](_0x24dc4b,function(_0x36461c){if(_0x36461c[_0x5b0b('0x2f')]!==_0x5b0b('0x3f')){var _0x251682={};_0x251682[_0x36461c[_0x5b0b('0x29')]]={'$like':'%'+_0x44a9d0['query'][_0x5b0b('0x3c')]+'%'};return _0x251682;}})});}_0x686357=_[_0x5b0b('0x3e')]({},_0x686357,_0x44a9d0['options']);var _0x2cc29d={'where':_0x686357['where']};return db[_0x5b0b('0x40')][_0x5b0b('0x20')](_0x2cc29d)[_0x5b0b('0x26')](function(_0x431b25){_0x474206[_0x5b0b('0x20')]=_0x431b25;if(_0x44a9d0[_0x5b0b('0x32')][_0x5b0b('0x41')]){_0x686357[_0x5b0b('0x42')]=[{'all':!![]}];}return db[_0x5b0b('0x40')]['findAll'](_0x686357);})[_0x5b0b('0x26')](function(_0x126884){_0x474206[_0x5b0b('0x43')]=_0x126884;return _0x474206;})[_0x5b0b('0x26')](respondWithFilteredResult(_0x1f83b5,_0x686357))['catch'](handleError(_0x1f83b5,null));};exports[_0x5b0b('0x44')]=function(_0x5aa666,_0x38ea51){var _0x537241={'raw':!![],'where':{'id':_0x5aa666[_0x5b0b('0x45')]['id']}},_0x421fdf={};_0x421fdf['model']=_['keys'](db['VoiceDialReport']['rawAttributes']);_0x421fdf[_0x5b0b('0x32')]=_['keys'](_0x5aa666[_0x5b0b('0x32')]);_0x421fdf[_0x5b0b('0x34')]=_['intersection'](_0x421fdf['model'],_0x421fdf[_0x5b0b('0x32')]);_0x537241[_0x5b0b('0x36')]=_[_0x5b0b('0x35')](_0x421fdf[_0x5b0b('0x31')],qs['fields'](_0x5aa666[_0x5b0b('0x32')][_0x5b0b('0x37')]));_0x537241['attributes']=_0x537241['attributes']['length']?_0x537241[_0x5b0b('0x36')]:_0x421fdf[_0x5b0b('0x31')];if(_0x5aa666[_0x5b0b('0x32')][_0x5b0b('0x41')]){_0x537241[_0x5b0b('0x42')]=[{'all':!![]}];}_0x537241=_[_0x5b0b('0x3e')]({},_0x537241,_0x5aa666[_0x5b0b('0x46')]);return db['VoiceDialReport']['find'](_0x537241)[_0x5b0b('0x26')](handleEntityNotFound(_0x38ea51,null))[_0x5b0b('0x26')](respondWithResult(_0x38ea51,null))['catch'](handleError(_0x38ea51,null));};exports[_0x5b0b('0x47')]=function(_0x220724,_0x138b96){return db[_0x5b0b('0x40')][_0x5b0b('0x47')](_0x220724[_0x5b0b('0x48')],{})[_0x5b0b('0x26')](respondWithResult(_0x138b96,0xc9))[_0x5b0b('0x49')](handleError(_0x138b96,null));};exports[_0x5b0b('0x24')]=function(_0x12473a,_0x2cf7ab){if(_0x12473a[_0x5b0b('0x48')]['id']){delete _0x12473a[_0x5b0b('0x48')]['id'];}return db[_0x5b0b('0x40')][_0x5b0b('0x4a')]({'where':{'id':_0x12473a[_0x5b0b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2cf7ab,null))[_0x5b0b('0x26')](saveUpdates(_0x12473a[_0x5b0b('0x48')],null))[_0x5b0b('0x26')](respondWithResult(_0x2cf7ab,null))[_0x5b0b('0x49')](handleError(_0x2cf7ab,null));};exports[_0x5b0b('0x25')]=function(_0x239a01,_0x1c28c1){return db[_0x5b0b('0x40')]['find']({'where':{'id':_0x239a01[_0x5b0b('0x45')]['id']}})[_0x5b0b('0x26')](handleEntityNotFound(_0x1c28c1,null))[_0x5b0b('0x26')](removeEntity(_0x1c28c1,null))[_0x5b0b('0x49')](handleError(_0x1c28c1,null));};exports['describe']=function(_0x58b6fb,_0x2fd3f9){return db[_0x5b0b('0x40')][_0x5b0b('0x4b')]()[_0x5b0b('0x26')](respondWithResult(_0x2fd3f9,null))['catch'](handleError(_0x2fd3f9,null));};
\ No newline at end of file
index c049c2a..40dcdd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0af=['define','uniqueid','lodash','util','api','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x3bfef0,_0x548e2f){var _0x3d4dd1=function(_0x4b04ee){while(--_0x4b04ee){_0x3bfef0['push'](_0x3bfef0['shift']());}};_0x3d4dd1(++_0x548e2f);}(_0xc0af,0xff));var _0xfc0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0af[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc0a('0x0'));var util=require(_0xfc0a('0x1'));var logger=require('../../config/logger')(_0xfc0a('0x2'));var moment=require('moment');var BPromise=require(_0xfc0a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc0a('0x4'));var rimraf=require(_0xfc0a('0x5'));var config=require(_0xfc0a('0x6'));var attributes=require(_0xfc0a('0x7'));module[_0xfc0a('0x8')]=function(_0x23bcfc,_0x581d89){return _0x23bcfc[_0xfc0a('0x9')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xfc0a('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa16e=['api','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','lodash'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0xa16e,0x133));var _0xea16=function(_0x169ef9,_0x2ce3ab){_0x169ef9=_0x169ef9-0x0;var _0x5910a0=_0xa16e[_0x169ef9];return _0x5910a0;};'use strict';var _=require(_0xea16('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xea16('0x1'));var moment=require('moment');var BPromise=require(_0xea16('0x2'));var rp=require(_0xea16('0x3'));var fs=require('fs');var path=require(_0xea16('0x4'));var rimraf=require('rimraf');var config=require(_0xea16('0x5'));var attributes=require(_0xea16('0x6'));module[_0xea16('0x7')]=function(_0x5979d8,_0x20d943){return _0x5979d8[_0xea16('0x8')](_0xea16('0x9'),attributes,{'tableName':_0xea16('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 935eea0..a767e08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6210=['rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','VoiceDialReport','body','where','attributes','limit','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x49b54e,_0x1e8a86){var _0xce0de=function(_0x3428bb){while(--_0x3428bb){_0x49b54e['push'](_0x49b54e['shift']());}};_0xce0de(++_0x1e8a86);}(_0x6210,0x95));var _0x0621=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6210[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x0621('0x0'));var util=require('util');var moment=require(_0x0621('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0621('0x2'));var db=require(_0x0621('0x3'))['db'];var utils=require(_0x0621('0x4'));var logger=require(_0x0621('0x5'))(_0x0621('0x6'));var config=require(_0x0621('0x7'));var jayson=require(_0x0621('0x8'));var client=jayson[_0x0621('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21383a,_0x4b5801,_0x4516bb){return new BPromise(function(_0x2cc3a4,_0x19a20b){return client[_0x0621('0xa')](_0x21383a,_0x4516bb)[_0x0621('0xb')](function(_0x18efb2){logger[_0x0621('0xc')](_0x0621('0xd'),_0x4b5801,_0x0621('0xe'));logger[_0x0621('0xf')](_0x0621('0x10'),_0x4b5801,_0x0621('0xe'),JSON[_0x0621('0x11')](_0x18efb2));if(_0x18efb2[_0x0621('0x12')]){if(_0x18efb2[_0x0621('0x12')]['code']===0x1f4){logger['error'](_0x0621('0xd'),_0x4b5801,_0x18efb2[_0x0621('0x12')][_0x0621('0x13')]);return _0x19a20b(_0x18efb2['error'][_0x0621('0x13')]);}logger[_0x0621('0x12')](_0x0621('0xd'),_0x4b5801,_0x18efb2['error'][_0x0621('0x13')]);return _0x2cc3a4(_0x18efb2[_0x0621('0x12')][_0x0621('0x13')]);}else{logger[_0x0621('0xc')](_0x0621('0xd'),_0x4b5801,_0x0621('0xe'));_0x2cc3a4(_0x18efb2[_0x0621('0x14')][_0x0621('0x13')]);}})['catch'](function(_0xd82e25){logger[_0x0621('0x12')](_0x0621('0xd'),_0x4b5801,_0xd82e25);_0x19a20b(_0xd82e25);});});}exports['CreateVoiceDialReport']=function(_0x1382fa){var _0x3d5868=this;return new Promise(function(_0x496a53,_0x868bef){return db['VoiceDialReport']['create'](_0x1382fa['body'],{'raw':_0x1382fa[_0x0621('0x15')]?_0x1382fa[_0x0621('0x15')][_0x0621('0x16')]===undefined?!![]:![]:!![]})[_0x0621('0xb')](function(_0x5a5310){logger['info'](_0x0621('0x17'),_0x1382fa);logger[_0x0621('0xf')](_0x0621('0x17'),_0x1382fa,JSON[_0x0621('0x11')](_0x5a5310));_0x496a53(_0x5a5310);})['catch'](function(_0x1593fb){logger[_0x0621('0x12')](_0x0621('0x17'),_0x1593fb[_0x0621('0x13')],_0x1382fa);_0x868bef(_0x3d5868[_0x0621('0x12')](0x1f4,_0x1593fb['message']));});});};exports[_0x0621('0x18')]=function(_0x6af1b6){var _0x5d252d=this;return new Promise(function(_0x56c07e,_0x5de8bb){return db[_0x0621('0x19')]['update'](_0x6af1b6[_0x0621('0x1a')],{'raw':_0x6af1b6[_0x0621('0x15')]?_0x6af1b6[_0x0621('0x15')][_0x0621('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6af1b6[_0x0621('0x15')]?_0x6af1b6[_0x0621('0x15')][_0x0621('0x1b')]||null:null,'attributes':_0x6af1b6[_0x0621('0x15')]?_0x6af1b6[_0x0621('0x15')][_0x0621('0x1c')]||null:null,'limit':_0x6af1b6[_0x0621('0x15')]?_0x6af1b6[_0x0621('0x15')][_0x0621('0x1d')]||null:null})[_0x0621('0xb')](function(_0x54c329){logger[_0x0621('0xc')](_0x0621('0x18'),_0x6af1b6);logger[_0x0621('0xf')](_0x0621('0x18'),_0x6af1b6,JSON['stringify'](_0x54c329));_0x56c07e(_0x54c329);})[_0x0621('0x1e')](function(_0x1d10dd){logger['error'](_0x0621('0x18'),_0x1d10dd[_0x0621('0x13')],_0x6af1b6);_0x5de8bb(_0x5d252d['error'](0x1f4,_0x1d10dd[_0x0621('0x13')]));});});};
\ No newline at end of file
+var _0xbe31=['UpdateVoiceDialReport','where','limit','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw'];(function(_0x5c0776,_0x4f7ccb){var _0x1bf7e9=function(_0x238b78){while(--_0x238b78){_0x5c0776['push'](_0x5c0776['shift']());}};_0x1bf7e9(++_0x4f7ccb);}(_0xbe31,0x16b));var _0x1be3=function(_0x30affd,_0x47df28){_0x30affd=_0x30affd-0x0;var _0x97122d=_0xbe31[_0x30affd];return _0x97122d;};'use strict';var _=require('lodash');var util=require(_0x1be3('0x0'));var moment=require(_0x1be3('0x1'));var BPromise=require('bluebird');var rs=require(_0x1be3('0x2'));var fs=require('fs');var Redis=require(_0x1be3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1be3('0x4'));var logger=require(_0x1be3('0x5'))(_0x1be3('0x6'));var config=require(_0x1be3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1be3('0x8')][_0x1be3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9d38,_0x509128,_0x4d6bec){return new BPromise(function(_0x1909fa,_0x3da8e3){return client[_0x1be3('0xa')](_0x2a9d38,_0x4d6bec)[_0x1be3('0xb')](function(_0x3091b9){logger['info'](_0x1be3('0xc'),_0x509128,_0x1be3('0xd'));logger[_0x1be3('0xe')](_0x1be3('0xf'),_0x509128,_0x1be3('0xd'),JSON[_0x1be3('0x10')](_0x3091b9));if(_0x3091b9['error']){if(_0x3091b9[_0x1be3('0x11')]['code']===0x1f4){logger[_0x1be3('0x11')](_0x1be3('0xc'),_0x509128,_0x3091b9[_0x1be3('0x11')][_0x1be3('0x12')]);return _0x3da8e3(_0x3091b9[_0x1be3('0x11')][_0x1be3('0x12')]);}logger[_0x1be3('0x11')](_0x1be3('0xc'),_0x509128,_0x3091b9[_0x1be3('0x11')][_0x1be3('0x12')]);return _0x1909fa(_0x3091b9[_0x1be3('0x11')][_0x1be3('0x12')]);}else{logger[_0x1be3('0x13')](_0x1be3('0xc'),_0x509128,_0x1be3('0xd'));_0x1909fa(_0x3091b9[_0x1be3('0x14')][_0x1be3('0x12')]);}})[_0x1be3('0x15')](function(_0x88463a){logger[_0x1be3('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x509128,_0x88463a);_0x3da8e3(_0x88463a);});});}exports[_0x1be3('0x16')]=function(_0x10d897){var _0x1b2a7c=this;return new Promise(function(_0x187d72,_0x363b6d){return db[_0x1be3('0x17')][_0x1be3('0x18')](_0x10d897['body'],{'raw':_0x10d897[_0x1be3('0x19')]?_0x10d897['options'][_0x1be3('0x1a')]===undefined?!![]:![]:!![]})[_0x1be3('0xb')](function(_0x184ce8){logger[_0x1be3('0x13')](_0x1be3('0x16'),_0x10d897);logger[_0x1be3('0xe')]('CreateVoiceDialReport',_0x10d897,JSON['stringify'](_0x184ce8));_0x187d72(_0x184ce8);})[_0x1be3('0x15')](function(_0x2ef38c){logger[_0x1be3('0x11')](_0x1be3('0x16'),_0x2ef38c['message'],_0x10d897);_0x363b6d(_0x1b2a7c['error'](0x1f4,_0x2ef38c[_0x1be3('0x12')]));});});};exports[_0x1be3('0x1b')]=function(_0x5504f3){var _0x2a2e80=this;return new Promise(function(_0x44f2ea,_0x39d88b){return db[_0x1be3('0x17')]['update'](_0x5504f3['body'],{'raw':_0x5504f3[_0x1be3('0x19')]?_0x5504f3[_0x1be3('0x19')][_0x1be3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5504f3[_0x1be3('0x19')]?_0x5504f3[_0x1be3('0x19')][_0x1be3('0x1c')]||null:null,'attributes':_0x5504f3[_0x1be3('0x19')]?_0x5504f3[_0x1be3('0x19')]['attributes']||null:null,'limit':_0x5504f3[_0x1be3('0x19')]?_0x5504f3[_0x1be3('0x19')][_0x1be3('0x1d')]||null:null})['then'](function(_0x3adc14){logger[_0x1be3('0x13')]('UpdateVoiceDialReport',_0x5504f3);logger['debug'](_0x1be3('0x1b'),_0x5504f3,JSON['stringify'](_0x3adc14));_0x44f2ea(_0x3adc14);})[_0x1be3('0x15')](function(_0x3519f6){logger[_0x1be3('0x11')](_0x1be3('0x1b'),_0x3519f6['message'],_0x5504f3);_0x39d88b(_0x2a2e80[_0x1be3('0x11')](0x1f4,_0x3519f6['message']));});});};
\ No newline at end of file
index 45fca87..87bdb9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a4d=['/:id/applications','addApplications','put','delete','/:id','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create'];(function(_0x13726c,_0x3819fe){var _0x3c6617=function(_0x3f61f0){while(--_0x3f61f0){_0x13726c['push'](_0x13726c['shift']());}};_0x3c6617(++_0x3819fe);}(_0x7a4d,0x16f));var _0xd7a4=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x7a4d[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require('multer');var util=require(_0xd7a4('0x0'));var path=require(_0xd7a4('0x1'));var timeout=require(_0xd7a4('0x2'));var express=require(_0xd7a4('0x3'));var router=express['Router']();var fs_extra=require(_0xd7a4('0x4'));var auth=require(_0xd7a4('0x5'));var interaction=require(_0xd7a4('0x6'));var config=require(_0xd7a4('0x7'));var controller=require('./voiceExtension.controller');router[_0xd7a4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd7a4('0x8')]('/:id',auth[_0xd7a4('0x9')](),controller[_0xd7a4('0xa')]);router[_0xd7a4('0xb')]('/',auth[_0xd7a4('0x9')](),controller[_0xd7a4('0xc')]);router[_0xd7a4('0xb')](_0xd7a4('0xd'),auth['isAuthenticated'](),controller[_0xd7a4('0xe')]);router[_0xd7a4('0xf')]('/:id',auth[_0xd7a4('0x9')](),controller['update']);router[_0xd7a4('0x10')](_0xd7a4('0x11'),auth[_0xd7a4('0x9')](),controller['destroy']);module[_0xd7a4('0x12')]=router;
\ No newline at end of file
+var _0x804e=['post','/:id/applications','addApplications','put','delete','exports','express','Router','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id'];(function(_0x199756,_0x5d0b24){var _0x47ab5c=function(_0x1b4342){while(--_0x1b4342){_0x199756['push'](_0x199756['shift']());}};_0x47ab5c(++_0x5d0b24);}(_0x804e,0x110));var _0xe804=function(_0x5dc628,_0x1aa304){_0x5dc628=_0x5dc628-0x0;var _0x2f82c3=_0x804e[_0x5dc628];return _0x2f82c3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe804('0x0'));var router=express[_0xe804('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe804('0x2'));var controller=require(_0xe804('0x3'));router[_0xe804('0x4')]('/',auth[_0xe804('0x5')](),controller[_0xe804('0x6')]);router[_0xe804('0x4')](_0xe804('0x7'),auth[_0xe804('0x5')](),controller['show']);router[_0xe804('0x8')]('/',auth[_0xe804('0x5')](),controller['create']);router[_0xe804('0x8')](_0xe804('0x9'),auth[_0xe804('0x5')](),controller[_0xe804('0xa')]);router[_0xe804('0xb')](_0xe804('0x7'),auth[_0xe804('0x5')](),controller['update']);router[_0xe804('0xc')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe804('0xd')]=router;
\ No newline at end of file
index 59abe48..a293aea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ed2=['exports','compositeIndex','STRING','ENUM','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','sequelize'];(function(_0x4fae3c,_0x1b88ff){var _0x1f66fe=function(_0x229b1b){while(--_0x229b1b){_0x4fae3c['push'](_0x4fae3c['shift']());}};_0x1f66fe(++_0x1b88ff);}(_0x2ed2,0x1ef));var _0x22ed=function(_0x415c35,_0x2729d1){_0x415c35=_0x415c35-0x0;var _0x10a31c=_0x2ed2[_0x415c35];return _0x10a31c;};'use strict';var Sequelize=require(_0x22ed('0x0'));module[_0x22ed('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x22ed('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x22ed('0x3')],'allowNull':![],'unique':_0x22ed('0x2')},'priority':{'type':Sequelize[_0x22ed('0x3')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x22ed('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x22ed('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x22ed('0x4')](_0x22ed('0x5'),_0x22ed('0x6'),_0x22ed('0x7'),'inbound-fax',_0x22ed('0x8'),_0x22ed('0x9'),_0x22ed('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x22ed('0x3')]},'interval':{'type':Sequelize[_0x22ed('0x3')],'allowNull':![],'defaultValue':_0x22ed('0xb')},'IntervalId':{'type':Sequelize[_0x22ed('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x22ed('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x22ed('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x22ed('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x22ed('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x22ed('0xe')},'answer':{'type':Sequelize[_0x22ed('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x22ed('0xf')],'get':function(_0x177972){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0x22ed('0x3')],'allowNull':!![]}};
\ No newline at end of file
+var _0xc745=['VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x5beb9a,_0x18df8e){var _0x23ba76=function(_0x49c1d5){while(--_0x49c1d5){_0x5beb9a['push'](_0x5beb9a['shift']());}};_0x23ba76(++_0x18df8e);}(_0xc745,0x133));var _0x5c74=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc745[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x5c74('0x0'));module[_0x5c74('0x1')]={'context':{'type':Sequelize[_0x5c74('0x2')],'allowNull':![],'unique':_0x5c74('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5c74('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x5c74('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x5c74('0x3')},'tag':{'type':Sequelize[_0x5c74('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5c74('0x2')],'allowNull':![],'defaultValue':_0x5c74('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5c74('0x5')](_0x5c74('0x6'),_0x5c74('0x7'),_0x5c74('0x8'),_0x5c74('0x9'),'outbound-fax',_0x5c74('0xa'),_0x5c74('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x5c74('0x2')]},'interval':{'type':Sequelize[_0x5c74('0x2')],'allowNull':![],'defaultValue':_0x5c74('0xc')},'IntervalId':{'type':Sequelize[_0x5c74('0xd')]},'isApp':{'type':Sequelize[_0x5c74('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5c74('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x5c74('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x5c74('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x5c74('0xf')},'answer':{'type':Sequelize[_0x5c74('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x5c74('0x10')],'get':function(_0x1df0ee){return this[_0x5c74('0x11')](_0x5c74('0x12'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index f0812c8..405c9c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a42=['create','user','role','OutboundRoutes','InternalRoutes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','findOne','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','then','destroy','get','InboundRoutes','inbound','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','sendStatus','error','stack','send','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','include','VoiceExtension','findAll','catch','params','rawAttributes','body','outbound','startsWith','exten','concat'];(function(_0x400eb6,_0x54ba4c){var _0x44a094=function(_0x31b46b){while(--_0x31b46b){_0x400eb6['push'](_0x400eb6['shift']());}};_0x44a094(++_0x54ba4c);}(_0x2a42,0x1d6));var _0x22a4=function(_0x316171,_0x34511a){_0x316171=_0x316171-0x0;var _0x3070c7=_0x2a42[_0x316171];return _0x3070c7;};'use strict';var emlformat=require(_0x22a4('0x0'));var rimraf=require(_0x22a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x22a4('0x2'));var BPromise=require(_0x22a4('0x3'));var Mustache=require(_0x22a4('0x4'));var util=require(_0x22a4('0x5'));var path=require(_0x22a4('0x6'));var sox=require('sox');var csv=require(_0x22a4('0x7'));var ejs=require(_0x22a4('0x8'));var fs=require('fs');var fs_extra=require(_0x22a4('0x9'));var _=require(_0x22a4('0xa'));var squel=require(_0x22a4('0xb'));var crypto=require(_0x22a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x22a4('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x22a4('0xe'));var Redis=require(_0x22a4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x22a4('0x10'));var as=require(_0x22a4('0x11'));var hardwareService=require(_0x22a4('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x22a4('0x13'));var config=require(_0x22a4('0x14'));var licenseUtil=require(_0x22a4('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x22a4('0x16')](config[_0x22a4('0x17')],{'host':_0x22a4('0x18'),'port':0x18eb});var socket=require(_0x22a4('0x19'))(new Redis(config[_0x22a4('0x17')]));require(_0x22a4('0x1a'))[_0x22a4('0x1b')](socket);function respondWithStatusCode(_0x37f5aa,_0x14628e){_0x14628e=_0x14628e||0xcc;return function(_0x239b34){if(_0x239b34){return _0x37f5aa['sendStatus'](_0x14628e);}return _0x37f5aa[_0x22a4('0x1c')](_0x14628e)[_0x22a4('0x1d')]();};}function respondWithResult(_0x49d2e9,_0x49f84d){_0x49f84d=_0x49f84d||0xc8;return function(_0x22b302){if(_0x22b302){return _0x49d2e9[_0x22a4('0x1c')](_0x49f84d)[_0x22a4('0x1e')](_0x22b302);}};}function respondWithFilteredResult(_0x35bc92,_0x2fa0d5){return function(_0x141ebe){if(_0x141ebe){var _0xbb6a86=typeof _0x2fa0d5[_0x22a4('0x1f')]===_0x22a4('0x20')&&typeof _0x2fa0d5['limit']===_0x22a4('0x20');var _0x23188c=_0x141ebe[_0x22a4('0x21')];var _0x51e815=_0xbb6a86?0x0:_0x2fa0d5[_0x22a4('0x1f')];var _0x28336f=_0xbb6a86?_0x141ebe['count']:_0x2fa0d5['offset']+_0x2fa0d5[_0x22a4('0x22')];var _0x42f0a5;if(_0x28336f>=_0x23188c){_0x28336f=_0x23188c;_0x42f0a5=0xc8;}else{_0x42f0a5=0xce;}_0x35bc92[_0x22a4('0x1c')](_0x42f0a5);return _0x35bc92['set'](_0x22a4('0x23'),_0x51e815+'-'+_0x28336f+'/'+_0x23188c)['json'](_0x141ebe);}return null;};}function patchUpdates(_0x4f464a){return function(_0x1f0bcf){try{jsonpatch[_0x22a4('0x24')](_0x1f0bcf,_0x4f464a,!![]);}catch(_0x19ba94){return BPromise[_0x22a4('0x25')](_0x19ba94);}return _0x1f0bcf['save']();};}function saveUpdates(_0x5b9650,_0x5de3db){return function(_0x3e906d){if(_0x3e906d){return _0x3e906d['update'](_0x5b9650)[_0x22a4('0x26')](function(_0x1a832b){return _0x1a832b;});}return null;};}function removeEntity(_0xc10945,_0x2f52b1){return function(_0x5569fa){if(_0x5569fa){return _0x5569fa[_0x22a4('0x27')]()[_0x22a4('0x26')](function(){var _0x5922f8=_0x5569fa[_0x22a4('0x28')]({'plain':!![]});var _0x2751a8=[{'name':_0x22a4('0x29'),'value':_0x22a4('0x2a'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0x22a4('0x2b'),'ignore':![]}];var _0x3564f7=_(_0x2751a8)[_0x22a4('0x2c')](_0x22a4('0x2d'))[_0x22a4('0x2e')](_0x22a4('0x2f'))[_0x22a4('0x2f')]();if(_[_0x22a4('0x30')](_0x3564f7,_0x5922f8[_0x22a4('0x31')])){return;}var _0x4588ea=_[_0x22a4('0x32')](_0x2751a8,[_0x22a4('0x2f'),_0x5922f8[_0x22a4('0x31')]])[_0x22a4('0x33')];return db[_0x22a4('0x34')][_0x22a4('0x27')]({'where':{'type':_0x4588ea,'resourceId':_0x5922f8['id']}})[_0x22a4('0x26')](function(){return _0x5569fa;});})[_0x22a4('0x26')](function(){_0xc10945[_0x22a4('0x1c')](0xcc)[_0x22a4('0x1d')]();});}};}function handleEntityNotFound(_0x46581c,_0x59f5b5){return function(_0x2567b2){if(!_0x2567b2){_0x46581c[_0x22a4('0x35')](0x194);}return _0x2567b2;};}function handleError(_0x2ff395,_0x5b2d51){_0x5b2d51=_0x5b2d51||0x1f4;return function(_0x54abaa){logger[_0x22a4('0x36')](_0x54abaa[_0x22a4('0x37')]);if(_0x54abaa[_0x22a4('0x33')]){delete _0x54abaa[_0x22a4('0x33')];}_0x2ff395['status'](_0x5b2d51)[_0x22a4('0x38')](_0x54abaa);};}exports['index']=function(_0x506bff,_0x2ff0c0){var _0x1a3299={},_0x3ea0fc={},_0x549c58={'count':0x0,'rows':[]};var _0x7e51db=_[_0x22a4('0x2e')](db['VoiceExtension']['rawAttributes'],function(_0xd1e735){return{'name':_0xd1e735[_0x22a4('0x39')],'type':_0xd1e735[_0x22a4('0x31')][_0x22a4('0x3a')]};});_0x3ea0fc[_0x22a4('0x3b')]=_[_0x22a4('0x2e')](_0x7e51db,'name');_0x3ea0fc[_0x22a4('0x3c')]=_[_0x22a4('0x3d')](_0x506bff[_0x22a4('0x3c')]);_0x3ea0fc['filters']=_[_0x22a4('0x3e')](_0x3ea0fc[_0x22a4('0x3b')],_0x3ea0fc[_0x22a4('0x3c')]);_0x1a3299['attributes']=_[_0x22a4('0x3e')](_0x3ea0fc['model'],qs[_0x22a4('0x3f')](_0x506bff[_0x22a4('0x3c')][_0x22a4('0x3f')]));_0x1a3299[_0x22a4('0x40')]=_0x1a3299[_0x22a4('0x40')][_0x22a4('0x41')]?_0x1a3299[_0x22a4('0x40')]:_0x3ea0fc['model'];if(!_0x506bff[_0x22a4('0x3c')][_0x22a4('0x42')](_0x22a4('0x43'))){_0x1a3299[_0x22a4('0x22')]=qs[_0x22a4('0x22')](_0x506bff[_0x22a4('0x3c')][_0x22a4('0x22')]);_0x1a3299[_0x22a4('0x1f')]=qs[_0x22a4('0x1f')](_0x506bff[_0x22a4('0x3c')][_0x22a4('0x1f')]);}_0x1a3299[_0x22a4('0x44')]=qs[_0x22a4('0x45')](_0x506bff[_0x22a4('0x3c')]['sort']);_0x1a3299[_0x22a4('0x46')]=qs[_0x22a4('0x47')](_['pick'](_0x506bff[_0x22a4('0x3c')],_0x3ea0fc[_0x22a4('0x47')]),_0x7e51db);if(_0x506bff['query'][_0x22a4('0x2c')]){_0x1a3299[_0x22a4('0x46')]=_[_0x22a4('0x48')](_0x1a3299[_0x22a4('0x46')],{'$or':_[_0x22a4('0x2e')](_0x7e51db,function(_0x2b3005){if(_0x2b3005[_0x22a4('0x31')]!=='VIRTUAL'){var _0x2e4a1f={};_0x2e4a1f[_0x2b3005[_0x22a4('0x33')]]={'$like':'%'+_0x506bff[_0x22a4('0x3c')][_0x22a4('0x2c')]+'%'};return _0x2e4a1f;}})});}_0x1a3299=_['merge']({},_0x1a3299,_0x506bff[_0x22a4('0x49')]);var _0x3f3587={'where':_0x1a3299[_0x22a4('0x46')]};return db['VoiceExtension']['count'](_0x3f3587)[_0x22a4('0x26')](function(_0x5aa6b9){_0x549c58[_0x22a4('0x21')]=_0x5aa6b9;if(_0x506bff[_0x22a4('0x3c')]['includeAll']){_0x1a3299[_0x22a4('0x4a')]=[{'all':!![]}];}return db[_0x22a4('0x4b')][_0x22a4('0x4c')](_0x1a3299);})[_0x22a4('0x26')](function(_0x359d91){_0x549c58['rows']=_0x359d91;return _0x549c58;})[_0x22a4('0x26')](respondWithFilteredResult(_0x2ff0c0,_0x1a3299))[_0x22a4('0x4d')](handleError(_0x2ff0c0,null));};exports['show']=function(_0xdf3102,_0x164202){var _0x30c3c4={'raw':![],'where':{'id':_0xdf3102[_0x22a4('0x4e')]['id']}},_0x3b16e8={};_0x3b16e8[_0x22a4('0x3b')]=_[_0x22a4('0x3d')](db[_0x22a4('0x4b')][_0x22a4('0x4f')]);_0x3b16e8[_0x22a4('0x3c')]=_[_0x22a4('0x3d')](_0xdf3102[_0x22a4('0x3c')]);_0x3b16e8[_0x22a4('0x47')]=_['intersection'](_0x3b16e8[_0x22a4('0x3b')],_0x3b16e8[_0x22a4('0x3c')]);_0x30c3c4['attributes']=_[_0x22a4('0x3e')](_0x3b16e8[_0x22a4('0x3b')],qs[_0x22a4('0x3f')](_0xdf3102['query'][_0x22a4('0x3f')]));_0x30c3c4[_0x22a4('0x40')]=_0x30c3c4[_0x22a4('0x40')][_0x22a4('0x41')]?_0x30c3c4[_0x22a4('0x40')]:_0x3b16e8[_0x22a4('0x3b')];if(_0xdf3102[_0x22a4('0x3c')]['includeAll']){_0x30c3c4['include']=[{'all':!![]}];}_0x30c3c4=_['merge']({},_0x30c3c4,_0xdf3102[_0x22a4('0x49')]);return db[_0x22a4('0x4b')][_0x22a4('0x32')](_0x30c3c4)[_0x22a4('0x26')](handleEntityNotFound(_0x164202,null))['then'](respondWithResult(_0x164202,null))[_0x22a4('0x4d')](handleError(_0x164202,null));};exports['destroy']=function(_0x2f875f,_0x47e0fd){return db[_0x22a4('0x4b')][_0x22a4('0x32')]({'where':{'id':_0x2f875f[_0x22a4('0x4e')]['id']}})[_0x22a4('0x26')](handleEntityNotFound(_0x47e0fd,null))['then'](removeEntity(_0x47e0fd,null))[_0x22a4('0x4d')](handleError(_0x47e0fd,null));};exports['create']=function(_0x1c326b,_0x4306e6){if(_0x1c326b[_0x22a4('0x50')]['type']===_0x22a4('0x51')&&!_[_0x22a4('0x52')](_0x1c326b[_0x22a4('0x50')][_0x22a4('0x53')],'_')){_0x1c326b[_0x22a4('0x50')]['exten']='_'[_0x22a4('0x54')](_0x1c326b[_0x22a4('0x50')][_0x22a4('0x53')]);}return db[_0x22a4('0x4b')][_0x22a4('0x55')](_0x1c326b[_0x22a4('0x50')],{'raw':![]})['then'](function(_0x53318c){var _0xf2b596=_0x1c326b[_0x22a4('0x56')]['get']({'plain':!![]});if(!_0xf2b596)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf2b596[_0x22a4('0x57')]===_0x22a4('0x56')){var _0x10d85e=_0x53318c[_0x22a4('0x28')]({'plain':!![]});var _0x3ef6fd=[{'name':_0x22a4('0x29'),'value':_0x22a4('0x2a')},{'name':_0x22a4('0x58'),'value':_0x22a4('0x51')},{'name':_0x22a4('0x59'),'value':_0x22a4('0x2b')}];var _0x1684b3=_[_0x22a4('0x32')](_0x3ef6fd,[_0x22a4('0x2f'),_0x10d85e[_0x22a4('0x31')]])[_0x22a4('0x33')];return db['UserProfileSection'][_0x22a4('0x32')]({'where':{'name':_0x1684b3,'userProfileId':_0xf2b596['userProfileId']},'raw':!![]})[_0x22a4('0x26')](function(_0x36b2e4){if(_0x36b2e4&&_0x36b2e4[_0x22a4('0x5a')]===0x0){return db[_0x22a4('0x34')][_0x22a4('0x55')]({'name':_0x10d85e[_0x22a4('0x33')],'resourceId':_0x10d85e['id'],'type':_0x36b2e4['name'],'sectionId':_0x36b2e4['id']},{})[_0x22a4('0x26')](function(){return _0x53318c;});}else{return _0x53318c;}})[_0x22a4('0x4d')](function(_0x63946f){logger[_0x22a4('0x36')](_0x22a4('0x5b'),_0x63946f);throw _0x63946f;});}return _0x53318c;})['then'](respondWithResult(_0x4306e6,0xc9))[_0x22a4('0x4d')](handleError(_0x4306e6,null));};exports['update']=function(_0x564851,_0x55fc4b){if(_0x564851[_0x22a4('0x50')]['id']){delete _0x564851['body']['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x564851[_0x22a4('0x4e')]['id']}})[_0x22a4('0x26')](handleEntityNotFound(_0x55fc4b,null))[_0x22a4('0x26')](function(_0x59fe9c){if(_0x59fe9c){return db[_0x22a4('0x4b')][_0x22a4('0x5c')](_[_0x22a4('0x5d')](_0x564851[_0x22a4('0x50')],[_0x22a4('0x53'),_0x22a4('0x5e'),_0x22a4('0x5f'),_0x22a4('0x60'),_0x22a4('0x61'),_0x22a4('0x62'),_0x22a4('0x63')]),{'where':{'context':_0x59fe9c[_0x22a4('0x5e')],'exten':_0x59fe9c['exten']},'individualHooks':!![]})[_0x22a4('0x26')](function(_0x55feb7){return _0x55feb7;});}return null;})[_0x22a4('0x26')](respondWithStatusCode(_0x55fc4b,null))['catch'](handleError(_0x55fc4b,null));};exports[_0x22a4('0x64')]=function(_0x20493b,_0x2ab35f){return db[_0x22a4('0x4b')][_0x22a4('0x65')]({'where':{'id':_0x20493b[_0x22a4('0x4e')]['id']}})[_0x22a4('0x26')](function(_0x365568){if(_0x365568){return db['sequelize'][_0x22a4('0x66')](function(_0x41e19f){return db[_0x22a4('0x4b')][_0x22a4('0x27')]({'where':{'VoiceExtensionId':_0x20493b[_0x22a4('0x4e')]['id']},'transaction':_0x41e19f})[_0x22a4('0x26')](function(){var _0x1c5a26=_[_0x22a4('0x2e')](_0x20493b['body'],function(_0x2b7834){_0x2b7834[_0x22a4('0x67')]=_0x20493b[_0x22a4('0x4e')]['id'];_0x2b7834[_0x22a4('0x68')]=!![];return _0x2b7834;});var _0x4f4e67=_0x20493b[_0x22a4('0x3c')][_0x22a4('0x69')]&&_0x20493b[_0x22a4('0x3c')][_0x22a4('0x69')][_0x22a4('0x6a')]()===_0x22a4('0x6b')?!![]:![];return _0x365568[_0x22a4('0x6c')](_0x1c5a26,_0x4f4e67);})[_0x22a4('0x26')](function(_0x36b3e7){return db['VoiceExtension']['bulkCreate'](_0x36b3e7,{'transaction':_0x41e19f});});})[_0x22a4('0x26')](function(){return db[_0x22a4('0x4b')][_0x22a4('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x20493b[_0x22a4('0x4e')]['id']},'order':_0x22a4('0x6e')});});}})[_0x22a4('0x26')](respondWithResult(_0x2ab35f,null))[_0x22a4('0x4d')](handleError(_0x2ab35f,null));};
\ No newline at end of file
+var _0x84c9=['error','send','index','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','pick','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','options','find','create','body','startsWith','exten','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','toLowerCase','true','findAndCountAll','eml-format','rimraf','request-promise','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','offset','count','Content-Range','apply','reject','update','destroy','then','get','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','name','UserProfileResource'];(function(_0x2ac11c,_0xc8bdde){var _0x42e473=function(_0x2115aa){while(--_0x2115aa){_0x2ac11c['push'](_0x2ac11c['shift']());}};_0x42e473(++_0xc8bdde);}(_0x84c9,0x1d3));var _0x984c=function(_0x2fb3ff,_0x236f5a){_0x2fb3ff=_0x2fb3ff-0x0;var _0x1d868e=_0x84c9[_0x2fb3ff];return _0x1d868e;};'use strict';var emlformat=require(_0x984c('0x0'));var rimraf=require(_0x984c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x984c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x984c('0x3'));var path=require(_0x984c('0x4'));var sox=require('sox');var csv=require(_0x984c('0x5'));var ejs=require(_0x984c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x984c('0x7'));var squel=require('squel');var crypto=require(_0x984c('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x984c('0x9'));var toCsv=require('to-csv');var querystring=require(_0x984c('0xa'));var Papa=require('papaparse');var Redis=require(_0x984c('0xb'));var authService=require(_0x984c('0xc'));var qs=require(_0x984c('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x984c('0xe'));var logger=require(_0x984c('0xf'))(_0x984c('0x10'));var utils=require(_0x984c('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x984c('0x12'))['db'];config[_0x984c('0x13')]=_['defaults'](config[_0x984c('0x13')],{'host':_0x984c('0x14'),'port':0x18eb});var socket=require(_0x984c('0x15'))(new Redis(config[_0x984c('0x13')]));require('./voiceExtension.socket')[_0x984c('0x16')](socket);function respondWithStatusCode(_0x12bfe2,_0x3378a3){_0x3378a3=_0x3378a3||0xcc;return function(_0x24d540){if(_0x24d540){return _0x12bfe2[_0x984c('0x17')](_0x3378a3);}return _0x12bfe2[_0x984c('0x18')](_0x3378a3)[_0x984c('0x19')]();};}function respondWithResult(_0x2254c4,_0x5d858c){_0x5d858c=_0x5d858c||0xc8;return function(_0x382895){if(_0x382895){return _0x2254c4['status'](_0x5d858c)[_0x984c('0x1a')](_0x382895);}};}function respondWithFilteredResult(_0x5378ec,_0x4aaa4b){return function(_0x4516b5){if(_0x4516b5){var _0x233f30=typeof _0x4aaa4b['offset']==='undefined'&&typeof _0x4aaa4b['limit']===_0x984c('0x1b');var _0x47e4df=_0x4516b5['count'];var _0x321281=_0x233f30?0x0:_0x4aaa4b[_0x984c('0x1c')];var _0x57810c=_0x233f30?_0x4516b5[_0x984c('0x1d')]:_0x4aaa4b[_0x984c('0x1c')]+_0x4aaa4b['limit'];var _0x4074dc;if(_0x57810c>=_0x47e4df){_0x57810c=_0x47e4df;_0x4074dc=0xc8;}else{_0x4074dc=0xce;}_0x5378ec[_0x984c('0x18')](_0x4074dc);return _0x5378ec['set'](_0x984c('0x1e'),_0x321281+'-'+_0x57810c+'/'+_0x47e4df)['json'](_0x4516b5);}return null;};}function patchUpdates(_0x34d97f){return function(_0x4c07ed){try{jsonpatch[_0x984c('0x1f')](_0x4c07ed,_0x34d97f,!![]);}catch(_0x439354){return BPromise[_0x984c('0x20')](_0x439354);}return _0x4c07ed['save']();};}function saveUpdates(_0x5020db,_0x57a578){return function(_0x4809d0){if(_0x4809d0){return _0x4809d0[_0x984c('0x21')](_0x5020db)['then'](function(_0x516037){return _0x516037;});}return null;};}function removeEntity(_0x4ec30a,_0x59d016){return function(_0x5ad702){if(_0x5ad702){return _0x5ad702[_0x984c('0x22')]()[_0x984c('0x23')](function(){var _0x984c8=_0x5ad702[_0x984c('0x24')]({'plain':!![]});var _0xe8fb08=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x984c('0x25'),'value':_0x984c('0x26'),'ignore':![]},{'name':_0x984c('0x27'),'value':_0x984c('0x28'),'ignore':![]}];var _0x489fd5=_(_0xe8fb08)[_0x984c('0x29')]('ignore')[_0x984c('0x2a')](_0x984c('0x2b'))[_0x984c('0x2b')]();if(_[_0x984c('0x2c')](_0x489fd5,_0x984c8[_0x984c('0x2d')])){return;}var _0x2a2ae6=_['find'](_0xe8fb08,['value',_0x984c8['type']])[_0x984c('0x2e')];return db[_0x984c('0x2f')][_0x984c('0x22')]({'where':{'type':_0x2a2ae6,'resourceId':_0x984c8['id']}})[_0x984c('0x23')](function(){return _0x5ad702;});})[_0x984c('0x23')](function(){_0x4ec30a[_0x984c('0x18')](0xcc)[_0x984c('0x19')]();});}};}function handleEntityNotFound(_0x3ed086,_0x441253){return function(_0x26f9a3){if(!_0x26f9a3){_0x3ed086[_0x984c('0x17')](0x194);}return _0x26f9a3;};}function handleError(_0x124880,_0x4b5446){_0x4b5446=_0x4b5446||0x1f4;return function(_0x280ef7){logger[_0x984c('0x30')](_0x280ef7['stack']);if(_0x280ef7[_0x984c('0x2e')]){delete _0x280ef7[_0x984c('0x2e')];}_0x124880['status'](_0x4b5446)[_0x984c('0x31')](_0x280ef7);};}exports[_0x984c('0x32')]=function(_0x426e3c,_0x970f28){var _0x2f649f={},_0x1c5719={},_0x245bee={'count':0x0,'rows':[]};var _0x2ebe79=_[_0x984c('0x2a')](db[_0x984c('0x33')][_0x984c('0x34')],function(_0x2896ac){return{'name':_0x2896ac['fieldName'],'type':_0x2896ac['type'][_0x984c('0x35')]};});_0x1c5719[_0x984c('0x36')]=_['map'](_0x2ebe79,'name');_0x1c5719[_0x984c('0x37')]=_[_0x984c('0x38')](_0x426e3c[_0x984c('0x37')]);_0x1c5719[_0x984c('0x39')]=_[_0x984c('0x3a')](_0x1c5719['model'],_0x1c5719[_0x984c('0x37')]);_0x2f649f[_0x984c('0x3b')]=_[_0x984c('0x3a')](_0x1c5719[_0x984c('0x36')],qs[_0x984c('0x3c')](_0x426e3c[_0x984c('0x37')][_0x984c('0x3c')]));_0x2f649f[_0x984c('0x3b')]=_0x2f649f['attributes'][_0x984c('0x3d')]?_0x2f649f[_0x984c('0x3b')]:_0x1c5719[_0x984c('0x36')];if(!_0x426e3c[_0x984c('0x37')]['hasOwnProperty']('nolimit')){_0x2f649f[_0x984c('0x3e')]=qs[_0x984c('0x3e')](_0x426e3c[_0x984c('0x37')][_0x984c('0x3e')]);_0x2f649f['offset']=qs[_0x984c('0x1c')](_0x426e3c[_0x984c('0x37')]['offset']);}_0x2f649f[_0x984c('0x3f')]=qs[_0x984c('0x40')](_0x426e3c[_0x984c('0x37')][_0x984c('0x40')]);_0x2f649f['where']=qs['filters'](_[_0x984c('0x41')](_0x426e3c['query'],_0x1c5719[_0x984c('0x39')]),_0x2ebe79);if(_0x426e3c['query'][_0x984c('0x29')]){_0x2f649f[_0x984c('0x42')]=_['merge'](_0x2f649f[_0x984c('0x42')],{'$or':_[_0x984c('0x2a')](_0x2ebe79,function(_0xa07809){if(_0xa07809['type']!==_0x984c('0x43')){var _0x4a1fa5={};_0x4a1fa5[_0xa07809[_0x984c('0x2e')]]={'$like':'%'+_0x426e3c['query'][_0x984c('0x29')]+'%'};return _0x4a1fa5;}})});}_0x2f649f=_['merge']({},_0x2f649f,_0x426e3c['options']);var _0x9e3956={'where':_0x2f649f[_0x984c('0x42')]};return db[_0x984c('0x33')]['count'](_0x9e3956)['then'](function(_0x5056ea){_0x245bee[_0x984c('0x1d')]=_0x5056ea;if(_0x426e3c[_0x984c('0x37')][_0x984c('0x44')]){_0x2f649f[_0x984c('0x45')]=[{'all':!![]}];}return db[_0x984c('0x33')][_0x984c('0x46')](_0x2f649f);})[_0x984c('0x23')](function(_0x4b0f42){_0x245bee[_0x984c('0x47')]=_0x4b0f42;return _0x245bee;})[_0x984c('0x23')](respondWithFilteredResult(_0x970f28,_0x2f649f))[_0x984c('0x48')](handleError(_0x970f28,null));};exports[_0x984c('0x49')]=function(_0x219b04,_0x36f81e){var _0x573bb7={'raw':![],'where':{'id':_0x219b04[_0x984c('0x4a')]['id']}},_0x5e7551={};_0x5e7551[_0x984c('0x36')]=_[_0x984c('0x38')](db['VoiceExtension'][_0x984c('0x34')]);_0x5e7551[_0x984c('0x37')]=_[_0x984c('0x38')](_0x219b04['query']);_0x5e7551[_0x984c('0x39')]=_[_0x984c('0x3a')](_0x5e7551[_0x984c('0x36')],_0x5e7551['query']);_0x573bb7[_0x984c('0x3b')]=_[_0x984c('0x3a')](_0x5e7551[_0x984c('0x36')],qs[_0x984c('0x3c')](_0x219b04[_0x984c('0x37')][_0x984c('0x3c')]));_0x573bb7[_0x984c('0x3b')]=_0x573bb7[_0x984c('0x3b')][_0x984c('0x3d')]?_0x573bb7['attributes']:_0x5e7551[_0x984c('0x36')];if(_0x219b04[_0x984c('0x37')]['includeAll']){_0x573bb7[_0x984c('0x45')]=[{'all':!![]}];}_0x573bb7=_[_0x984c('0x4b')]({},_0x573bb7,_0x219b04[_0x984c('0x4c')]);return db[_0x984c('0x33')][_0x984c('0x4d')](_0x573bb7)[_0x984c('0x23')](handleEntityNotFound(_0x36f81e,null))['then'](respondWithResult(_0x36f81e,null))['catch'](handleError(_0x36f81e,null));};exports[_0x984c('0x22')]=function(_0x290779,_0x3e2b23){return db[_0x984c('0x33')]['find']({'where':{'id':_0x290779[_0x984c('0x4a')]['id']}})[_0x984c('0x23')](handleEntityNotFound(_0x3e2b23,null))[_0x984c('0x23')](removeEntity(_0x3e2b23,null))['catch'](handleError(_0x3e2b23,null));};exports[_0x984c('0x4e')]=function(_0x425cf2,_0x1c7fea){if(_0x425cf2[_0x984c('0x4f')][_0x984c('0x2d')]===_0x984c('0x26')&&!_[_0x984c('0x50')](_0x425cf2[_0x984c('0x4f')]['exten'],'_')){_0x425cf2[_0x984c('0x4f')]['exten']='_'['concat'](_0x425cf2[_0x984c('0x4f')][_0x984c('0x51')]);}return db[_0x984c('0x33')][_0x984c('0x4e')](_0x425cf2['body'],{'raw':![]})['then'](function(_0x5ac10c){var _0x51649b=_0x425cf2['user'][_0x984c('0x24')]({'plain':!![]});if(!_0x51649b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51649b[_0x984c('0x52')]==='user'){var _0x403ba1=_0x5ac10c['get']({'plain':!![]});var _0x29840b=[{'name':'InboundRoutes','value':_0x984c('0x53')},{'name':_0x984c('0x25'),'value':_0x984c('0x26')},{'name':_0x984c('0x27'),'value':_0x984c('0x28')}];var _0xf42f25=_[_0x984c('0x4d')](_0x29840b,[_0x984c('0x2b'),_0x403ba1['type']])[_0x984c('0x2e')];return db[_0x984c('0x54')]['find']({'where':{'name':_0xf42f25,'userProfileId':_0x51649b[_0x984c('0x55')]},'raw':!![]})[_0x984c('0x23')](function(_0x2ce72a){if(_0x2ce72a&&_0x2ce72a[_0x984c('0x56')]===0x0){return db[_0x984c('0x2f')]['create']({'name':_0x403ba1['name'],'resourceId':_0x403ba1['id'],'type':_0x2ce72a[_0x984c('0x2e')],'sectionId':_0x2ce72a['id']},{})[_0x984c('0x23')](function(){return _0x5ac10c;});}else{return _0x5ac10c;}})[_0x984c('0x48')](function(_0x31f589){logger[_0x984c('0x30')](_0x984c('0x57'),_0x31f589);throw _0x31f589;});}return _0x5ac10c;})[_0x984c('0x23')](respondWithResult(_0x1c7fea,0xc9))[_0x984c('0x48')](handleError(_0x1c7fea,null));};exports[_0x984c('0x21')]=function(_0x1e093b,_0x2aa0b1){if(_0x1e093b['body']['id']){delete _0x1e093b[_0x984c('0x4f')]['id'];}return db[_0x984c('0x33')]['find']({'where':{'id':_0x1e093b[_0x984c('0x4a')]['id']}})[_0x984c('0x23')](handleEntityNotFound(_0x2aa0b1,null))[_0x984c('0x23')](function(_0x44fe4d){if(_0x44fe4d){return db[_0x984c('0x33')][_0x984c('0x21')](_[_0x984c('0x41')](_0x1e093b[_0x984c('0x4f')],['exten',_0x984c('0x58'),_0x984c('0x59'),_0x984c('0x5a'),_0x984c('0x5b'),_0x984c('0x5c'),_0x984c('0x5d')]),{'where':{'context':_0x44fe4d['context'],'exten':_0x44fe4d[_0x984c('0x51')]},'individualHooks':!![]})[_0x984c('0x23')](function(_0x21771f){return _0x21771f;});}return null;})[_0x984c('0x23')](respondWithStatusCode(_0x2aa0b1,null))[_0x984c('0x48')](handleError(_0x2aa0b1,null));};exports[_0x984c('0x5e')]=function(_0x5c618d,_0x263d0a){return db[_0x984c('0x33')][_0x984c('0x5f')]({'where':{'id':_0x5c618d[_0x984c('0x4a')]['id']}})[_0x984c('0x23')](function(_0x1e2b29){if(_0x1e2b29){return db[_0x984c('0x60')][_0x984c('0x61')](function(_0x1ce6dd){return db[_0x984c('0x33')]['destroy']({'where':{'VoiceExtensionId':_0x5c618d['params']['id']},'transaction':_0x1ce6dd})[_0x984c('0x23')](function(){var _0x4b38b4=_['map'](_0x5c618d[_0x984c('0x4f')],function(_0xca5794){_0xca5794[_0x984c('0x62')]=_0x5c618d['params']['id'];_0xca5794[_0x984c('0x63')]=!![];return _0xca5794;});var _0x2dbda5=_0x5c618d[_0x984c('0x37')]['rewriteDial']&&_0x5c618d[_0x984c('0x37')]['rewriteDial'][_0x984c('0x64')]()===_0x984c('0x65')?!![]:![];return _0x1e2b29['createRouting'](_0x4b38b4,_0x2dbda5);})[_0x984c('0x23')](function(_0x32e008){return db[_0x984c('0x33')]['bulkCreate'](_0x32e008,{'transaction':_0x1ce6dd});});})['then'](function(){return db[_0x984c('0x33')][_0x984c('0x66')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5c618d[_0x984c('0x4a')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x984c('0x23')](respondWithResult(_0x263d0a,null))['catch'](handleError(_0x263d0a,null));};
\ No newline at end of file
index 6b53ad2..8117aaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe1b=['exports','events','../../mysqldb','VoiceExtension','save','update','emit','hasOwnProperty'];(function(_0x270d0d,_0x3fe5af){var _0x1e000b=function(_0x1e241a){while(--_0x1e241a){_0x270d0d['push'](_0x270d0d['shift']());}};_0x1e000b(++_0x3fe5af);}(_0xbe1b,0xa9));var _0xbbe1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbe1b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xbbe1('0x0'));var VoiceExtension=require(_0xbbe1('0x1'))['db'][_0xbbe1('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbbe1('0x3'),'afterUpdate':_0xbbe1('0x4'),'afterDestroy':'remove'};function emitEvent(_0xf7294e){return function(_0x357b90,_0x165fbc,_0x4ee160){VoiceExtensionEvents[_0xbbe1('0x5')](_0xf7294e+':'+_0x357b90['id'],_0x357b90);VoiceExtensionEvents[_0xbbe1('0x5')](_0xf7294e,_0x357b90);_0x4ee160(null);};}for(var e in events){if(events[_0xbbe1('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xbbe1('0x7')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xb918=['../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xb918,0x11d));var _0x8b91=function(_0x41b3e7,_0x94678a){_0x41b3e7=_0x41b3e7-0x0;var _0x47a92c=_0xb918[_0x41b3e7];return _0x47a92c;};'use strict';var EventEmitter=require(_0x8b91('0x0'));var VoiceExtension=require(_0x8b91('0x1'))['db'][_0x8b91('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8b91('0x3')](0x0);var events={'afterCreate':_0x8b91('0x4'),'afterUpdate':_0x8b91('0x5'),'afterDestroy':_0x8b91('0x6')};function emitEvent(_0x28bced){return function(_0x47b434,_0x1bfb4d,_0x3c4a61){VoiceExtensionEvents[_0x8b91('0x7')](_0x28bced+':'+_0x47b434['id'],_0x47b434);VoiceExtensionEvents['emit'](_0x28bced,_0x47b434);_0x3c4a61(null);};}for(var e in events){if(events[_0x8b91('0x8')](e)){var event=events[e];VoiceExtension[_0x8b91('0x9')](e,emitEvent(event));}}module[_0x8b91('0xa')]=VoiceExtensionEvents;
\ No newline at end of file
index 4d8d27f..f1401f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44eb=['SIP','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','then','intervals','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','queue','playback','includes','app','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','VoiceExtension','concat','Hangup','util','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','Set','NoOp','CDR(routeAlias)=','alias','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','length','trunk','param','phone','split','prefix'];(function(_0x2e9d8d,_0x7a858b){var _0x75236c=function(_0x43e413){while(--_0x43e413){_0x2e9d8d['push'](_0x2e9d8d['shift']());}};_0x75236c(++_0x7a858b);}(_0x44eb,0x78));var _0xb44e=function(_0x1c206c,_0x30bdcf){_0x1c206c=_0x1c206c-0x0;var _0x188aaa=_0x44eb[_0x1c206c];return _0x188aaa;};'use strict';var util=require(_0xb44e('0x0'));var _=require(_0xb44e('0x1'));var attributes=require(_0xb44e('0x2'));module[_0xb44e('0x3')]=function(_0x3b8ea8){var _0x49e0dd=_0x3b8ea8[_0xb44e('0x4')];function _0x48be3c(_0x5de1af){var _0x36b07d=0x2;var _0x3f0d7a=[{'type':_0x5de1af[_0xb44e('0x5')],'app':'Set','appdata':_0xb44e('0x6')+_0x5de1af[_0xb44e('0x5')],'context':_0x5de1af[_0xb44e('0x7')],'exten':_0x5de1af[_0xb44e('0x8')],'priority':_0x36b07d++,'VoiceExtensionId':_0x5de1af['id']},{'type':_0x5de1af[_0xb44e('0x5')],'app':_0x5de1af['alias']?_0xb44e('0x9'):_0xb44e('0xa'),'appdata':_0x5de1af['alias']?_0xb44e('0xb')+_0x5de1af[_0xb44e('0xc')]:_0xb44e('0xd'),'context':_0x5de1af['context'],'exten':_0x5de1af[_0xb44e('0x8')],'priority':_0x36b07d++,'VoiceExtensionId':_0x5de1af['id']}];if(_0x5de1af['type']===_0xb44e('0xe')){_0x3f0d7a[_0xb44e('0xf')]({'type':_0xb44e('0xe'),'app':_0xb44e('0x9'),'appdata':'CDR(routeid)='+_0x5de1af['id'],'context':_0x5de1af[_0xb44e('0x7')],'exten':_0x5de1af[_0xb44e('0x8')],'priority':_0x36b07d++,'VoiceExtensionId':_0x5de1af['id']});}_0x3f0d7a['push']({'type':_0x5de1af[_0xb44e('0x5')],'app':_0xb44e('0x9'),'appdata':_0xb44e('0x10'),'context':_0x5de1af[_0xb44e('0x7')],'exten':_0x5de1af[_0xb44e('0x8')],'priority':_0x36b07d++,'VoiceExtensionId':_0x5de1af['id']},{'type':_0x5de1af['type'],'app':_0xb44e('0x9'),'appdata':_0xb44e('0x11'),'context':_0x5de1af[_0xb44e('0x7')],'exten':_0x5de1af[_0xb44e('0x8')],'priority':_0x36b07d++,'VoiceExtensionId':_0x5de1af['id']},{'type':_0x5de1af[_0xb44e('0x5')],'app':_0xb44e('0x9'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5de1af['context'],'exten':_0x5de1af['exten'],'priority':_0x36b07d++,'VoiceExtensionId':_0x5de1af['id']});return _0x3f0d7a;}function _0x4fb777(_0x469ea0){var _0x3ad0aa=0x2;var _0x2df282=[{'type':_0xb44e('0x12'),'app':_0xb44e('0x9'),'appdata':_0xb44e('0x13'),'context':_0x469ea0[_0xb44e('0x7')],'exten':_0x469ea0[_0xb44e('0x8')],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':_0xb44e('0x12'),'app':_0x469ea0[_0xb44e('0xc')]?_0xb44e('0x9'):'NoOp','appdata':_0x469ea0[_0xb44e('0xc')]?'CDR(routeAlias)='+_0x469ea0['alias']:'No\x20alias\x20set','context':_0x469ea0[_0xb44e('0x7')],'exten':_0x469ea0[_0xb44e('0x8')],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':'outbound','app':'Set','appdata':_0xb44e('0x14')+(_0x469ea0[_0xb44e('0x15')]?_0xb44e('0x16')+_0x469ea0[_0xb44e('0x15')]+'}':_0xb44e('0x17')),'context':_0x469ea0[_0xb44e('0x7')],'exten':_0x469ea0['exten'],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':_0xb44e('0x12'),'app':_0xb44e('0x9'),'appdata':_0xb44e('0x18')+_0x469ea0['id'],'context':_0x469ea0['context'],'exten':_0x469ea0[_0xb44e('0x8')],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':_0xb44e('0x12'),'app':_0xb44e('0x19'),'appdata':_0xb44e('0x1a')+(_0x3ad0aa+0x2)+_0xb44e('0x1b')+(_0x3ad0aa+0x1)+')','context':_0x469ea0[_0xb44e('0x7')],'exten':_0x469ea0['exten'],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':_0xb44e('0x12'),'app':_0xb44e('0x9'),'appdata':_0x469ea0['cutdigits']?_0xb44e('0x1c')+_0x469ea0[_0xb44e('0x15')]+'}':_0xb44e('0x1d'),'context':_0x469ea0[_0xb44e('0x7')],'exten':_0x469ea0['exten'],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':_0xb44e('0x12'),'app':_0xb44e('0x9'),'appdata':_0xb44e('0x10'),'context':_0x469ea0['context'],'exten':_0x469ea0[_0xb44e('0x8')],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':_0xb44e('0x12'),'app':_0xb44e('0x9'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x469ea0[_0xb44e('0x7')],'exten':_0x469ea0[_0xb44e('0x8')],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':'outbound','app':'Set','appdata':_0xb44e('0x1e'),'context':_0x469ea0[_0xb44e('0x7')],'exten':_0x469ea0[_0xb44e('0x8')],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':_0xb44e('0x12'),'app':_0xb44e('0x9'),'appdata':'outboundrouteid='+_0x469ea0['id'],'context':_0x469ea0['context'],'exten':_0x469ea0[_0xb44e('0x8')],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']}];if(_0x469ea0[_0xb44e('0x1f')](_0xb44e('0x20'))&&_0x469ea0['recordingFormat']!==_0xb44e('0x21')){_0x2df282[_0xb44e('0xf')]({'type':'outbound','app':_0xb44e('0x9'),'appdata':_0xb44e('0x22'),'context':_0x469ea0[_0xb44e('0x7')],'exten':_0x469ea0[_0xb44e('0x8')],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']},{'type':'outbound','app':_0xb44e('0x9'),'appdata':_0xb44e('0x23')+_0x469ea0['recordingFormat']||_0xb44e('0x24'),'context':_0x469ea0[_0xb44e('0x7')],'exten':_0x469ea0[_0xb44e('0x8')],'priority':_0x3ad0aa++,'VoiceExtensionId':_0x469ea0['id']});}return _0x2df282;}function _0xe86a1c(_0x33ef24){var _0x57894c=[{'name':'trunk','param':0x0},{'name':_0xb44e('0x25'),'param':0x1},{'name':_0xb44e('0x26'),'param':0x2},{'name':_0xb44e('0x27'),'param':0x3}];var _0x29bcc7={};var _0x238043=_0x33ef24['split'](',');var _0x1978c=[];for(var _0x32561c=0x0;_0x32561c<_0x57894c[_0xb44e('0x28')];_0x32561c++){switch(_0x57894c[_0x32561c]['name']){case _0xb44e('0x29'):_0x29bcc7[_0xb44e('0x29')]=_0x238043[_0x57894c[_0x32561c][_0xb44e('0x2a')]]['split']('/')[0x1];_0x29bcc7[_0xb44e('0x2b')]=_0x238043[_0x57894c[_0x32561c][_0xb44e('0x2a')]][_0xb44e('0x2c')]('/')[0x2];_0x29bcc7[_0xb44e('0x2d')]=_0x29bcc7[_0xb44e('0x2b')]?_0x29bcc7['phone'][_0xb44e('0x2c')]('$')[0x0]:undefined;_0x29bcc7[_0xb44e('0x2b')]=route[_0xb44e('0x15')]?(_0x29bcc7['prefix']||'')+_0xb44e('0x16')+route[_0xb44e('0x15')]+'}':(_0x29bcc7[_0xb44e('0x2d')]||'')+_0xb44e('0x17');_0x1978c[_0x57894c[_0x32561c][_0xb44e('0x2a')]]=[_0xb44e('0x2e'),_0x29bcc7['trunk'],_0x29bcc7[_0xb44e('0x2b')]]['join']('/');break;case'options':_0x29bcc7[_0xb44e('0x26')]=_0x238043[_0x57894c[_0x32561c][_0xb44e('0x2a')]];if(route['recordingFormat']!==_0xb44e('0x21')){if(_0x29bcc7[_0xb44e('0x26')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x29bcc7[_0xb44e('0x26')]+=_0xb44e('0x2f');}}else{_0x29bcc7['options']=_0x29bcc7[_0xb44e('0x26')][_0xb44e('0x30')](_0xb44e('0x2f'),'');}_0x1978c[_0x57894c[_0x32561c]['param']]=_0x29bcc7[_0xb44e('0x26')];break;default:_0x1978c[_0x57894c[_0x32561c][_0xb44e('0x2a')]]=_0x238043[_0x57894c[_0x32561c][_0xb44e('0x2a')]];}}return _0x1978c[_0xb44e('0x31')](',');}function _0x397f90(_0x36b24b,_0x18fb72,_0x20742c,_0x108565){return new Promise(function(_0x1973aa,_0x2ca184){var _0x3e8188=[];if(_[_0xb44e('0x32')](_0x18fb72))return _0x1973aa(_0x3e8188);_0x49e0dd[_0xb44e('0x33')][_0xb44e('0x34')]({'attributes':['id',_0xb44e('0x35'),_0xb44e('0x36')],'raw':!![]})[_0xb44e('0x37')](function(_0x1ea276){for(var _0x3f46ad=0x0,_0x259362=0x0;_0x3f46ad<_0x18fb72[_0xb44e('0x28')];_0x3f46ad++,_0x259362=0x0){var _0x2f9a97=_0x18fb72[_0x3f46ad];var _0x25fbbe=[];var _0x32f4ac=[];if(_0x2f9a97[_0xb44e('0x35')]!=='*,*,*,*'){_0x2f9a97[_0xb44e('0x38')]=[_0x2f9a97['interval']];}else{_0x2f9a97[_0xb44e('0x38')]=_0x2f9a97[_0xb44e('0x36')]?_[_0xb44e('0x39')](_[_0xb44e('0x3a')](_0x1ea276,{'IntervalId':_0x2f9a97[_0xb44e('0x36')]}),_0xb44e('0x35')):[];}_0x2f9a97[_0xb44e('0x7')]=_0x36b24b[_0xb44e('0x7')];_0x2f9a97[_0xb44e('0x8')]=_0x36b24b[_0xb44e('0x8')];if(_0x2f9a97[_0xb44e('0x5')])_0x2f9a97[_0xb44e('0x5')]=_0x2f9a97['type']['toLowerCase']();if(_0x36b24b[_0xb44e('0x5')]===_0xb44e('0x12')){if(_0x2f9a97[_0xb44e('0x1f')](_0xb44e('0x3b'))&&_0x2f9a97[_0xb44e('0x3b')]&&_0x2f9a97[_0xb44e('0x3b')]!=='--'){_0x25fbbe['push']({'type':_0x2f9a97['type'][_0xb44e('0x3c')](),'app':_0xb44e('0x9'),'appdata':_0xb44e('0x3d')+_0x2f9a97[_0xb44e('0x3b')],'context':_0x36b24b[_0xb44e('0x7')],'exten':_0x36b24b[_0xb44e('0x8')],'priority':_0x2f9a97[_0xb44e('0x38')][_0xb44e('0x28')]+_0x20742c+_0x259362++,'VoiceExtensionId':_0x36b24b['id']});}_0x25fbbe['push']({'type':_0x2f9a97[_0xb44e('0x5')][_0xb44e('0x3c')](),'app':'ExecIf','appdata':_0xb44e('0x3e')+(_0x2f9a97[_0xb44e('0x3f')]?'Set(CALLERID(all)='+_0x2f9a97[_0xb44e('0x3f')]+')':'NoOp(No\x20number\x20available)'),'context':_0x36b24b[_0xb44e('0x7')],'exten':_0x36b24b[_0xb44e('0x8')],'priority':_0x2f9a97[_0xb44e('0x38')][_0xb44e('0x28')]+_0x20742c+_0x259362++,'VoiceExtensionId':_0x36b24b['id']});}else{if(_0x2f9a97[_0xb44e('0x1f')]('answer')){if([_0xb44e('0x40'),_0xb44e('0x41')][_0xb44e('0x42')](_0x2f9a97[_0xb44e('0x43')][_0xb44e('0x3c')]())&&_0x2f9a97[_0xb44e('0x44')]!=='custom'){if(_0x2f9a97[_0xb44e('0x45')]){_0x25fbbe[_0xb44e('0xf')]({'type':_0x2f9a97[_0xb44e('0x5')][_0xb44e('0x3c')](),'app':_0xb44e('0x19'),'appdata':_0xb44e('0x46'),'context':_0x36b24b[_0xb44e('0x7')],'exten':_0x36b24b['exten'],'priority':_0x2f9a97[_0xb44e('0x38')]['length']+_0x20742c+_0x259362++,'VoiceExtensionId':_0x36b24b['id']});_0x25fbbe[_0xb44e('0xf')]({'type':_0x2f9a97['type'][_0xb44e('0x3c')](),'app':_0xb44e('0x9'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x36b24b[_0xb44e('0x7')],'exten':_0x36b24b[_0xb44e('0x8')],'priority':_0x2f9a97[_0xb44e('0x38')][_0xb44e('0x28')]+_0x20742c+_0x259362++,'VoiceExtensionId':_0x36b24b['id']});}else{_0x25fbbe[_0xb44e('0xf')]({'type':_0x2f9a97['type']['toLowerCase'](),'app':'ExecIf','appdata':_0xb44e('0x47'),'context':_0x36b24b[_0xb44e('0x7')],'exten':_0x36b24b['exten'],'priority':_0x2f9a97[_0xb44e('0x38')]['length']+_0x20742c+_0x259362++,'VoiceExtensionId':_0x36b24b['id']});_0x25fbbe[_0xb44e('0xf')]({'type':_0x2f9a97[_0xb44e('0x5')]['toLowerCase'](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x36b24b[_0xb44e('0x7')],'exten':_0x36b24b['exten'],'priority':_0x2f9a97[_0xb44e('0x38')][_0xb44e('0x28')]+_0x20742c+_0x259362++,'VoiceExtensionId':_0x36b24b['id']});}}}}for(var _0x502edf=0x0;_0x502edf<_0x2f9a97[_0xb44e('0x38')]['length'];_0x502edf++){var _0x523e74=_0x20742c+_0x2f9a97[_0xb44e('0x38')][_0xb44e('0x28')];var _0x5ee9a6=_0x502edf===_0x2f9a97[_0xb44e('0x38')][_0xb44e('0x28')]-0x1?_0x20742c+_0x25fbbe[_0xb44e('0x28')]+_0x32f4ac[_0xb44e('0x28')]+0x2:_0x20742c+_0x502edf+0x1;_0x25fbbe[_0xb44e('0x48')](_0x502edf,0x0,{'type':_0x36b24b['type'],'app':_0xb44e('0x49'),'appdata':_0x2f9a97[_0xb44e('0x38')][_0x502edf]+'?'+_0x36b24b[_0xb44e('0x7')]+_0xb44e('0x4a')+_0x523e74+':'+_0x36b24b[_0xb44e('0x7')]+_0xb44e('0x4a')+_0x5ee9a6,'exten':_0x36b24b[_0xb44e('0x8')],'context':_0x36b24b[_0xb44e('0x7')],'priority':_0x20742c+_0x502edf,'VoiceExtensionId':_0x36b24b['id']});}if(_0x108565&&_0x2f9a97['appType']===_0xb44e('0x4b'))_0x2f9a97[_0xb44e('0x4c')]=_0xe86a1c(_0x2f9a97[_0xb44e('0x4c')]);_0x2f9a97[_0xb44e('0x4d')]=_0x25fbbe[_0xb44e('0x28')]?_[_0xb44e('0x4e')](_0x25fbbe)[_0xb44e('0x4d')]+0x1:_0x20742c;_0x3e8188=_['concat'](_0x3e8188,_0x25fbbe,[_0x2f9a97],_0x32f4ac);_0x20742c=_[_0xb44e('0x4e')](_0x3e8188)[_0xb44e('0x4d')]+0x1;}return _0x1973aa(_0x3e8188);})[_0xb44e('0x4f')](function(_0x24717b){_0x2ca184(_0x24717b);});});}return _0x3b8ea8['define'](_0xb44e('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x190f1d,_0x483b2d){var _0x273f64=this;var _0x2ea291=_0x273f64[_0xb44e('0x5')]===_0xb44e('0x12')?_0x4fb777(_0x273f64):_0x48be3c(_0x273f64);return _0x397f90(_0x273f64,_0x190f1d,_[_0xb44e('0x4e')](_0x2ea291)[_0xb44e('0x4d')]+0x1,_0x483b2d)['then'](function(_0x24d7a5){var _0x32048a=_[_0xb44e('0x51')](_0x2ea291,_0x24d7a5);_0x32048a[_0xb44e('0xf')]({'type':_0x273f64['type'],'app':_0xb44e('0x52'),'exten':_0x273f64[_0xb44e('0x8')],'context':_0x273f64['context'],'priority':_['last'](_0x32048a)[_0xb44e('0x4d')]+0x1,'VoiceExtensionId':_0x273f64['id']});return _0x32048a;});}}});};
\ No newline at end of file
+var _0x1ac5=['XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','split','length','name','phone','param','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','priority','last','concat','catch','define','VoiceExtension','voice_extensions','util','lodash','exports','models','CDR(type)=','context','exten','type','alias','Set','NoOp','No\x20alias\x20set','inbound','push'];(function(_0x17f479,_0x3d8dc8){var _0x25ab39=function(_0x48b609){while(--_0x48b609){_0x17f479['push'](_0x17f479['shift']());}};_0x25ab39(++_0x3d8dc8);}(_0x1ac5,0x9c));var _0x51ac=function(_0x4b9c3d,_0x30e12a){_0x4b9c3d=_0x4b9c3d-0x0;var _0x9d9a6d=_0x1ac5[_0x4b9c3d];return _0x9d9a6d;};'use strict';var util=require(_0x51ac('0x0'));var _=require(_0x51ac('0x1'));var attributes=require('./voiceExtension.attributes');module[_0x51ac('0x2')]=function(_0x2ccd28){var _0x299a4f=_0x2ccd28[_0x51ac('0x3')];function _0x4ce91e(_0x5b0244){var _0x4a8283=0x2;var _0x594a90=[{'type':_0x5b0244['type'],'app':'Set','appdata':_0x51ac('0x4')+_0x5b0244['type'],'context':_0x5b0244[_0x51ac('0x5')],'exten':_0x5b0244[_0x51ac('0x6')],'priority':_0x4a8283++,'VoiceExtensionId':_0x5b0244['id']},{'type':_0x5b0244[_0x51ac('0x7')],'app':_0x5b0244[_0x51ac('0x8')]?_0x51ac('0x9'):_0x51ac('0xa'),'appdata':_0x5b0244[_0x51ac('0x8')]?'CDR(routeAlias)='+_0x5b0244[_0x51ac('0x8')]:_0x51ac('0xb'),'context':_0x5b0244[_0x51ac('0x5')],'exten':_0x5b0244['exten'],'priority':_0x4a8283++,'VoiceExtensionId':_0x5b0244['id']}];if(_0x5b0244['type']===_0x51ac('0xc')){_0x594a90[_0x51ac('0xd')]({'type':_0x51ac('0xc'),'app':_0x51ac('0x9'),'appdata':'CDR(routeid)='+_0x5b0244['id'],'context':_0x5b0244['context'],'exten':_0x5b0244[_0x51ac('0x6')],'priority':_0x4a8283++,'VoiceExtensionId':_0x5b0244['id']});}_0x594a90[_0x51ac('0xd')]({'type':_0x5b0244[_0x51ac('0x7')],'app':_0x51ac('0x9'),'appdata':_0x51ac('0xe'),'context':_0x5b0244[_0x51ac('0x5')],'exten':_0x5b0244['exten'],'priority':_0x4a8283++,'VoiceExtensionId':_0x5b0244['id']},{'type':_0x5b0244[_0x51ac('0x7')],'app':_0x51ac('0x9'),'appdata':_0x51ac('0xf'),'context':_0x5b0244[_0x51ac('0x5')],'exten':_0x5b0244[_0x51ac('0x6')],'priority':_0x4a8283++,'VoiceExtensionId':_0x5b0244['id']},{'type':_0x5b0244[_0x51ac('0x7')],'app':_0x51ac('0x9'),'appdata':_0x51ac('0x10'),'context':_0x5b0244['context'],'exten':_0x5b0244[_0x51ac('0x6')],'priority':_0x4a8283++,'VoiceExtensionId':_0x5b0244['id']});return _0x594a90;}function _0x59b655(_0x4c9152){var _0x6d1416=0x2;var _0x47cffc=[{'type':_0x51ac('0x11'),'app':_0x51ac('0x9'),'appdata':_0x51ac('0x12'),'context':_0x4c9152[_0x51ac('0x5')],'exten':_0x4c9152[_0x51ac('0x6')],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':_0x51ac('0x11'),'app':_0x4c9152['alias']?_0x51ac('0x9'):_0x51ac('0xa'),'appdata':_0x4c9152[_0x51ac('0x8')]?_0x51ac('0x13')+_0x4c9152[_0x51ac('0x8')]:_0x51ac('0xb'),'context':_0x4c9152['context'],'exten':_0x4c9152[_0x51ac('0x6')],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':_0x51ac('0x11'),'app':_0x51ac('0x9'),'appdata':_0x51ac('0x14')+(_0x4c9152[_0x51ac('0x15')]?_0x51ac('0x16')+_0x4c9152[_0x51ac('0x15')]+'}':_0x51ac('0x17')),'context':_0x4c9152[_0x51ac('0x5')],'exten':_0x4c9152['exten'],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':_0x51ac('0x11'),'app':_0x51ac('0x9'),'appdata':'CDR(routeid)='+_0x4c9152['id'],'context':_0x4c9152[_0x51ac('0x5')],'exten':_0x4c9152[_0x51ac('0x6')],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':_0x51ac('0x11'),'app':_0x51ac('0x18'),'appdata':_0x51ac('0x19')+(_0x6d1416+0x2)+_0x51ac('0x1a')+(_0x6d1416+0x1)+')','context':_0x4c9152['context'],'exten':_0x4c9152[_0x51ac('0x6')],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':_0x51ac('0x11'),'app':_0x51ac('0x9'),'appdata':_0x4c9152[_0x51ac('0x15')]?_0x51ac('0x1b')+_0x4c9152[_0x51ac('0x15')]+'}':_0x51ac('0x1c'),'context':_0x4c9152[_0x51ac('0x5')],'exten':_0x4c9152['exten'],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':_0x51ac('0x11'),'app':_0x51ac('0x9'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4c9152[_0x51ac('0x5')],'exten':_0x4c9152[_0x51ac('0x6')],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':'outbound','app':_0x51ac('0x9'),'appdata':_0x51ac('0xf'),'context':_0x4c9152[_0x51ac('0x5')],'exten':_0x4c9152[_0x51ac('0x6')],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':_0x51ac('0x11'),'app':'Set','appdata':_0x51ac('0x10'),'context':_0x4c9152[_0x51ac('0x5')],'exten':_0x4c9152[_0x51ac('0x6')],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':_0x51ac('0x11'),'app':'Set','appdata':_0x51ac('0x1d')+_0x4c9152['id'],'context':_0x4c9152['context'],'exten':_0x4c9152[_0x51ac('0x6')],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']}];if(_0x4c9152[_0x51ac('0x1e')](_0x51ac('0x1f'))&&_0x4c9152[_0x51ac('0x1f')]!=='none'){_0x47cffc['push']({'type':_0x51ac('0x11'),'app':_0x51ac('0x9'),'appdata':_0x51ac('0x20'),'context':_0x4c9152[_0x51ac('0x5')],'exten':_0x4c9152[_0x51ac('0x6')],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']},{'type':_0x51ac('0x11'),'app':'Set','appdata':_0x51ac('0x21')+_0x4c9152['recordingFormat']||'wav','context':_0x4c9152[_0x51ac('0x5')],'exten':_0x4c9152['exten'],'priority':_0x6d1416++,'VoiceExtensionId':_0x4c9152['id']});}return _0x47cffc;}function _0x464417(_0x376933){var _0xaf45f9=[{'name':_0x51ac('0x22'),'param':0x0},{'name':_0x51ac('0x23'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x5f1d93={};var _0x547fca=_0x376933[_0x51ac('0x24')](',');var _0x5ef6e3=[];for(var _0x292d74=0x0;_0x292d74<_0xaf45f9[_0x51ac('0x25')];_0x292d74++){switch(_0xaf45f9[_0x292d74][_0x51ac('0x26')]){case _0x51ac('0x22'):_0x5f1d93[_0x51ac('0x22')]=_0x547fca[_0xaf45f9[_0x292d74]['param']]['split']('/')[0x1];_0x5f1d93[_0x51ac('0x27')]=_0x547fca[_0xaf45f9[_0x292d74][_0x51ac('0x28')]][_0x51ac('0x24')]('/')[0x2];_0x5f1d93[_0x51ac('0x29')]=_0x5f1d93[_0x51ac('0x27')]?_0x5f1d93['phone'][_0x51ac('0x24')]('$')[0x0]:undefined;_0x5f1d93[_0x51ac('0x27')]=route[_0x51ac('0x15')]?(_0x5f1d93['prefix']||'')+_0x51ac('0x16')+route['cutdigits']+'}':(_0x5f1d93['prefix']||'')+_0x51ac('0x17');_0x5ef6e3[_0xaf45f9[_0x292d74][_0x51ac('0x28')]]=[_0x51ac('0x2a'),_0x5f1d93['trunk'],_0x5f1d93[_0x51ac('0x27')]][_0x51ac('0x2b')]('/');break;case _0x51ac('0x2c'):_0x5f1d93[_0x51ac('0x2c')]=_0x547fca[_0xaf45f9[_0x292d74][_0x51ac('0x28')]];if(route[_0x51ac('0x1f')]!=='none'){if(_0x5f1d93['options'][_0x51ac('0x2d')](_0x51ac('0x2e'))<0x0){_0x5f1d93[_0x51ac('0x2c')]+='U(xcally-mixmonitor-context)';}}else{_0x5f1d93[_0x51ac('0x2c')]=_0x5f1d93['options'][_0x51ac('0x2f')](_0x51ac('0x2e'),'');}_0x5ef6e3[_0xaf45f9[_0x292d74][_0x51ac('0x28')]]=_0x5f1d93[_0x51ac('0x2c')];break;default:_0x5ef6e3[_0xaf45f9[_0x292d74][_0x51ac('0x28')]]=_0x547fca[_0xaf45f9[_0x292d74][_0x51ac('0x28')]];}}return _0x5ef6e3[_0x51ac('0x2b')](',');}function _0x2eaab8(_0x49e871,_0x366188,_0x240f3a,_0x3c9069){return new Promise(function(_0x67d69e,_0x9554c2){var _0x58e9e1=[];if(_[_0x51ac('0x30')](_0x366188))return _0x67d69e(_0x58e9e1);_0x299a4f[_0x51ac('0x31')][_0x51ac('0x32')]({'attributes':['id',_0x51ac('0x33'),_0x51ac('0x34')],'raw':!![]})[_0x51ac('0x35')](function(_0x32f8d3){for(var _0x8a87d3=0x0,_0x2e8b02=0x0;_0x8a87d3<_0x366188[_0x51ac('0x25')];_0x8a87d3++,_0x2e8b02=0x0){var _0x66fabc=_0x366188[_0x8a87d3];var _0x1e17b4=[];var _0x3c1a1c=[];if(_0x66fabc[_0x51ac('0x33')]!=='*,*,*,*'){_0x66fabc[_0x51ac('0x36')]=[_0x66fabc['interval']];}else{_0x66fabc[_0x51ac('0x36')]=_0x66fabc[_0x51ac('0x34')]?_[_0x51ac('0x37')](_[_0x51ac('0x38')](_0x32f8d3,{'IntervalId':_0x66fabc['IntervalId']}),_0x51ac('0x33')):[];}_0x66fabc['context']=_0x49e871['context'];_0x66fabc[_0x51ac('0x6')]=_0x49e871['exten'];if(_0x66fabc[_0x51ac('0x7')])_0x66fabc[_0x51ac('0x7')]=_0x66fabc[_0x51ac('0x7')][_0x51ac('0x39')]();if(_0x49e871[_0x51ac('0x7')]===_0x51ac('0x11')){if(_0x66fabc['hasOwnProperty']('tag')&&_0x66fabc[_0x51ac('0x3a')]&&_0x66fabc[_0x51ac('0x3a')]!=='--'){_0x1e17b4['push']({'type':_0x66fabc[_0x51ac('0x7')]['toLowerCase'](),'app':_0x51ac('0x9'),'appdata':_0x51ac('0x3b')+_0x66fabc['tag'],'context':_0x49e871[_0x51ac('0x5')],'exten':_0x49e871[_0x51ac('0x6')],'priority':_0x66fabc[_0x51ac('0x36')][_0x51ac('0x25')]+_0x240f3a+_0x2e8b02++,'VoiceExtensionId':_0x49e871['id']});}_0x1e17b4[_0x51ac('0xd')]({'type':_0x66fabc[_0x51ac('0x7')][_0x51ac('0x39')](),'app':'ExecIf','appdata':_0x51ac('0x3c')+(_0x66fabc['callerID']?_0x51ac('0x3d')+_0x66fabc[_0x51ac('0x3e')]+')':_0x51ac('0x3f')),'context':_0x49e871[_0x51ac('0x5')],'exten':_0x49e871['exten'],'priority':_0x66fabc['intervals'][_0x51ac('0x25')]+_0x240f3a+_0x2e8b02++,'VoiceExtensionId':_0x49e871['id']});}else{if(_0x66fabc[_0x51ac('0x1e')](_0x51ac('0x40'))){if(['queue',_0x51ac('0x41')][_0x51ac('0x42')](_0x66fabc[_0x51ac('0x43')][_0x51ac('0x39')]())&&_0x66fabc[_0x51ac('0x44')]!==_0x51ac('0x45')){if(_0x66fabc[_0x51ac('0x40')]){_0x1e17b4['push']({'type':_0x66fabc[_0x51ac('0x7')][_0x51ac('0x39')](),'app':_0x51ac('0x18'),'appdata':_0x51ac('0x46'),'context':_0x49e871[_0x51ac('0x5')],'exten':_0x49e871['exten'],'priority':_0x66fabc[_0x51ac('0x36')][_0x51ac('0x25')]+_0x240f3a+_0x2e8b02++,'VoiceExtensionId':_0x49e871['id']});_0x1e17b4[_0x51ac('0xd')]({'type':_0x66fabc['type'][_0x51ac('0x39')](),'app':_0x51ac('0x9'),'appdata':_0x51ac('0x47'),'context':_0x49e871[_0x51ac('0x5')],'exten':_0x49e871[_0x51ac('0x6')],'priority':_0x66fabc['intervals'][_0x51ac('0x25')]+_0x240f3a+_0x2e8b02++,'VoiceExtensionId':_0x49e871['id']});}else{_0x1e17b4[_0x51ac('0xd')]({'type':_0x66fabc[_0x51ac('0x7')][_0x51ac('0x39')](),'app':_0x51ac('0x18'),'appdata':_0x51ac('0x48'),'context':_0x49e871['context'],'exten':_0x49e871[_0x51ac('0x6')],'priority':_0x66fabc[_0x51ac('0x36')][_0x51ac('0x25')]+_0x240f3a+_0x2e8b02++,'VoiceExtensionId':_0x49e871['id']});_0x1e17b4[_0x51ac('0xd')]({'type':_0x66fabc['type'][_0x51ac('0x39')](),'app':_0x51ac('0x9'),'appdata':_0x51ac('0x49'),'context':_0x49e871[_0x51ac('0x5')],'exten':_0x49e871[_0x51ac('0x6')],'priority':_0x66fabc[_0x51ac('0x36')][_0x51ac('0x25')]+_0x240f3a+_0x2e8b02++,'VoiceExtensionId':_0x49e871['id']});}}}}for(var _0x4d3e49=0x0;_0x4d3e49<_0x66fabc[_0x51ac('0x36')][_0x51ac('0x25')];_0x4d3e49++){var _0x184d81=_0x240f3a+_0x66fabc[_0x51ac('0x36')]['length'];var _0x504e7e=_0x4d3e49===_0x66fabc[_0x51ac('0x36')][_0x51ac('0x25')]-0x1?_0x240f3a+_0x1e17b4['length']+_0x3c1a1c[_0x51ac('0x25')]+0x2:_0x240f3a+_0x4d3e49+0x1;_0x1e17b4[_0x51ac('0x4a')](_0x4d3e49,0x0,{'type':_0x49e871['type'],'app':_0x51ac('0x4b'),'appdata':_0x66fabc[_0x51ac('0x36')][_0x4d3e49]+'?'+_0x49e871['context']+_0x51ac('0x4c')+_0x184d81+':'+_0x49e871[_0x51ac('0x5')]+',${EXTEN},'+_0x504e7e,'exten':_0x49e871[_0x51ac('0x6')],'context':_0x49e871['context'],'priority':_0x240f3a+_0x4d3e49,'VoiceExtensionId':_0x49e871['id']});}if(_0x3c9069&&_0x66fabc[_0x51ac('0x44')]===_0x51ac('0x4d'))_0x66fabc['appdata']=_0x464417(_0x66fabc['appdata']);_0x66fabc[_0x51ac('0x4e')]=_0x1e17b4[_0x51ac('0x25')]?_[_0x51ac('0x4f')](_0x1e17b4)['priority']+0x1:_0x240f3a;_0x58e9e1=_[_0x51ac('0x50')](_0x58e9e1,_0x1e17b4,[_0x66fabc],_0x3c1a1c);_0x240f3a=_[_0x51ac('0x4f')](_0x58e9e1)[_0x51ac('0x4e')]+0x1;}return _0x67d69e(_0x58e9e1);})[_0x51ac('0x51')](function(_0x396c8b){_0x9554c2(_0x396c8b);});});}return _0x2ccd28[_0x51ac('0x52')](_0x51ac('0x53'),attributes,{'tableName':_0x51ac('0x54'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x388b7d,_0x350097){var _0xe0c735=this;var _0xddb45b=_0xe0c735[_0x51ac('0x7')]==='outbound'?_0x59b655(_0xe0c735):_0x4ce91e(_0xe0c735);return _0x2eaab8(_0xe0c735,_0x388b7d,_[_0x51ac('0x4f')](_0xddb45b)[_0x51ac('0x4e')]+0x1,_0x350097)[_0x51ac('0x35')](function(_0x5b0e2e){var _0x1b97e9=_[_0x51ac('0x50')](_0xddb45b,_0x5b0e2e);_0x1b97e9[_0x51ac('0xd')]({'type':_0xe0c735['type'],'app':'Hangup','exten':_0xe0c735[_0x51ac('0x6')],'context':_0xe0c735['context'],'priority':_[_0x51ac('0x4f')](_0x1b97e9)['priority']+0x1,'VoiceExtensionId':_0xe0c735['id']});return _0x1b97e9;});}}});};
\ No newline at end of file
index 17cf6e1..2c2034f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36c3=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','VoiceExtension','findAll','options','where','attributes','limit','include','model','map','GetVoiceExtension','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x360739,_0x2ec1b2){var _0x3e23a1=function(_0x105b37){while(--_0x105b37){_0x360739['push'](_0x360739['shift']());}};_0x3e23a1(++_0x2ec1b2);}(_0x36c3,0x1a6));var _0x336c=function(_0x389a03,_0x380e6c){_0x389a03=_0x389a03-0x0;var _0xaf19ea=_0x36c3[_0x389a03];return _0xaf19ea;};'use strict';var _=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var moment=require('moment');var BPromise=require(_0x336c('0x2'));var rs=require(_0x336c('0x3'));var fs=require('fs');var Redis=require(_0x336c('0x4'));var db=require(_0x336c('0x5'))['db'];var utils=require(_0x336c('0x6'));var logger=require(_0x336c('0x7'))(_0x336c('0x8'));var config=require('../../config/environment');var jayson=require(_0x336c('0x9'));var client=jayson[_0x336c('0xa')][_0x336c('0xb')]({'port':0x232a});config[_0x336c('0xc')]=_[_0x336c('0xd')](config['redis'],{'host':_0x336c('0xe'),'port':0x18eb});var socket=require(_0x336c('0xf'))(new Redis(config[_0x336c('0xc')]));require(_0x336c('0x10'))[_0x336c('0x11')](socket);function respondWithRpcPromise(_0x243984,_0x33ced0,_0x1a4503){return new BPromise(function(_0x179247,_0x31cee7){return client[_0x336c('0x12')](_0x243984,_0x1a4503)[_0x336c('0x13')](function(_0x1d896b){logger[_0x336c('0x14')](_0x336c('0x15'),_0x33ced0,_0x336c('0x16'));logger[_0x336c('0x17')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x33ced0,'request\x20sent',JSON[_0x336c('0x18')](_0x1d896b));if(_0x1d896b['error']){if(_0x1d896b[_0x336c('0x19')][_0x336c('0x1a')]===0x1f4){logger[_0x336c('0x19')](_0x336c('0x15'),_0x33ced0,_0x1d896b['error'][_0x336c('0x1b')]);return _0x31cee7(_0x1d896b[_0x336c('0x19')]['message']);}logger[_0x336c('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x33ced0,_0x1d896b[_0x336c('0x19')]['message']);return _0x179247(_0x1d896b[_0x336c('0x19')]['message']);}else{logger[_0x336c('0x14')](_0x336c('0x15'),_0x33ced0,'request\x20sent');_0x179247(_0x1d896b['result'][_0x336c('0x1b')]);}})[_0x336c('0x1c')](function(_0x1d306c){logger[_0x336c('0x19')](_0x336c('0x15'),_0x33ced0,_0x1d306c);_0x31cee7(_0x1d306c);});});}exports['GetVoiceExtension']=function(_0x327e10){var _0x532e12=this;return new Promise(function(_0x4dcdce,_0x5f401e){return db[_0x336c('0x1d')][_0x336c('0x1e')]({'raw':_0x327e10[_0x336c('0x1f')]?_0x327e10['options']['raw']===undefined?!![]:![]:!![],'where':_0x327e10[_0x336c('0x1f')]?_0x327e10[_0x336c('0x1f')][_0x336c('0x20')]||null:null,'attributes':_0x327e10['options']?_0x327e10[_0x336c('0x1f')][_0x336c('0x21')]||null:null,'limit':_0x327e10[_0x336c('0x1f')]?_0x327e10['options'][_0x336c('0x22')]||null:null,'include':_0x327e10[_0x336c('0x1f')]?_0x327e10[_0x336c('0x1f')][_0x336c('0x23')]?_['map'](_0x327e10[_0x336c('0x1f')][_0x336c('0x23')],function(_0x412a00){return{'model':db[_0x412a00[_0x336c('0x24')]],'as':_0x412a00['as'],'attributes':_0x412a00[_0x336c('0x21')],'include':_0x412a00[_0x336c('0x23')]?_['map'](_0x412a00[_0x336c('0x23')],function(_0x3d2442){return{'model':db[_0x3d2442[_0x336c('0x24')]],'as':_0x3d2442['as'],'attributes':_0x3d2442[_0x336c('0x21')],'include':_0x3d2442['include']?_[_0x336c('0x25')](_0x3d2442[_0x336c('0x23')],function(_0x54b06b){return{'model':db[_0x54b06b['model']],'as':_0x54b06b['as'],'attributes':_0x54b06b['attributes']};}):[]};}):[]};}):[]:[]})[_0x336c('0x13')](function(_0x1c7a34){logger['info']('GetVoiceExtension',_0x327e10);logger['debug'](_0x336c('0x26'),_0x327e10,JSON[_0x336c('0x18')](_0x1c7a34));_0x4dcdce(_0x1c7a34);})[_0x336c('0x1c')](function(_0x424712){logger[_0x336c('0x19')](_0x336c('0x26'),_0x424712[_0x336c('0x1b')],_0x327e10);_0x5f401e(_0x532e12['error'](0x1f4,_0x424712[_0x336c('0x1b')]));});});};
\ No newline at end of file
+var _0x6d19=['register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x6d19,0x160));var _0x96d1=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x6d19[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0x96d1('0x0'));var util=require(_0x96d1('0x1'));var moment=require(_0x96d1('0x2'));var BPromise=require(_0x96d1('0x3'));var rs=require(_0x96d1('0x4'));var fs=require('fs');var Redis=require(_0x96d1('0x5'));var db=require(_0x96d1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x96d1('0x7'))(_0x96d1('0x8'));var config=require(_0x96d1('0x9'));var jayson=require(_0x96d1('0xa'));var client=jayson['client'][_0x96d1('0xb')]({'port':0x232a});config[_0x96d1('0xc')]=_[_0x96d1('0xd')](config['redis'],{'host':_0x96d1('0xe'),'port':0x18eb});var socket=require(_0x96d1('0xf'))(new Redis(config[_0x96d1('0xc')]));require(_0x96d1('0x10'))[_0x96d1('0x11')](socket);function respondWithRpcPromise(_0x38ecf1,_0x4d3e32,_0x4bd620){return new BPromise(function(_0x44e65d,_0x2de9e3){return client['request'](_0x38ecf1,_0x4bd620)[_0x96d1('0x12')](function(_0x51b089){logger[_0x96d1('0x13')](_0x96d1('0x14'),_0x4d3e32,_0x96d1('0x15'));logger[_0x96d1('0x16')](_0x96d1('0x17'),_0x4d3e32,_0x96d1('0x15'),JSON['stringify'](_0x51b089));if(_0x51b089[_0x96d1('0x18')]){if(_0x51b089[_0x96d1('0x18')][_0x96d1('0x19')]===0x1f4){logger[_0x96d1('0x18')](_0x96d1('0x14'),_0x4d3e32,_0x51b089['error']['message']);return _0x2de9e3(_0x51b089[_0x96d1('0x18')][_0x96d1('0x1a')]);}logger[_0x96d1('0x18')](_0x96d1('0x14'),_0x4d3e32,_0x51b089[_0x96d1('0x18')][_0x96d1('0x1a')]);return _0x44e65d(_0x51b089[_0x96d1('0x18')][_0x96d1('0x1a')]);}else{logger[_0x96d1('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x4d3e32,_0x96d1('0x15'));_0x44e65d(_0x51b089[_0x96d1('0x1b')][_0x96d1('0x1a')]);}})[_0x96d1('0x1c')](function(_0x10a351){logger['error'](_0x96d1('0x14'),_0x4d3e32,_0x10a351);_0x2de9e3(_0x10a351);});});}exports[_0x96d1('0x1d')]=function(_0x28b2aa){var _0x393f5c=this;return new Promise(function(_0x5866e9,_0x17e281){return db[_0x96d1('0x1e')][_0x96d1('0x1f')]({'raw':_0x28b2aa[_0x96d1('0x20')]?_0x28b2aa['options'][_0x96d1('0x21')]===undefined?!![]:![]:!![],'where':_0x28b2aa[_0x96d1('0x20')]?_0x28b2aa[_0x96d1('0x20')][_0x96d1('0x22')]||null:null,'attributes':_0x28b2aa['options']?_0x28b2aa[_0x96d1('0x20')][_0x96d1('0x23')]||null:null,'limit':_0x28b2aa['options']?_0x28b2aa[_0x96d1('0x20')][_0x96d1('0x24')]||null:null,'include':_0x28b2aa['options']?_0x28b2aa[_0x96d1('0x20')][_0x96d1('0x25')]?_[_0x96d1('0x26')](_0x28b2aa['options'][_0x96d1('0x25')],function(_0x46aa64){return{'model':db[_0x46aa64[_0x96d1('0x27')]],'as':_0x46aa64['as'],'attributes':_0x46aa64['attributes'],'include':_0x46aa64['include']?_[_0x96d1('0x26')](_0x46aa64['include'],function(_0x3728c8){return{'model':db[_0x3728c8[_0x96d1('0x27')]],'as':_0x3728c8['as'],'attributes':_0x3728c8[_0x96d1('0x23')],'include':_0x3728c8[_0x96d1('0x25')]?_[_0x96d1('0x26')](_0x3728c8['include'],function(_0x1b42a0){return{'model':db[_0x1b42a0[_0x96d1('0x27')]],'as':_0x1b42a0['as'],'attributes':_0x1b42a0[_0x96d1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x96d1('0x12')](function(_0x5a83e6){logger[_0x96d1('0x13')](_0x96d1('0x1d'),_0x28b2aa);logger['debug']('GetVoiceExtension',_0x28b2aa,JSON[_0x96d1('0x28')](_0x5a83e6));_0x5866e9(_0x5a83e6);})[_0x96d1('0x1c')](function(_0x3968f5){logger[_0x96d1('0x18')](_0x96d1('0x1d'),_0x3968f5[_0x96d1('0x1a')],_0x28b2aa);_0x17e281(_0x393f5c['error'](0x1f4,_0x3968f5[_0x96d1('0x1a')]));});});};
\ No newline at end of file
index 9e3aec0..9470878 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x2b0768,_0x5127d0){var _0x432479=function(_0xb414e0){while(--_0xb414e0){_0x2b0768['push'](_0x2b0768['shift']());}};_0x432479(++_0x5127d0);}(_0x7a54,0x106));var _0x47a5=function(_0x4ce836,_0x56e00d){_0x4ce836=_0x4ce836-0x0;var _0x4f2072=_0x7a54[_0x4ce836];return _0x4f2072;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
+var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x210343,_0x49c255){var _0x30a8e8=function(_0x4c4738){while(--_0x4c4738){_0x210343['push'](_0x210343['shift']());}};_0x30a8e8(++_0x49c255);}(_0xf494,0x1c6));var _0x4f49=function(_0xd69099,_0x4e017b){_0xd69099=_0xd69099-0x0;var _0x2a4022=_0xf494[_0xd69099];return _0x2a4022;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}};
\ No newline at end of file
index 3f30603..30f0fd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68b3=['index','/:id','show','/:id/messages','getMessages','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5138dc,_0x15b351){var _0x12aa21=function(_0x18c11c){while(--_0x18c11c){_0x5138dc['push'](_0x5138dc['shift']());}};_0x12aa21(++_0x15b351);}(_0x68b3,0x1d8));var _0x368b=function(_0x4e3ce9,_0x143e3b){_0x4e3ce9=_0x4e3ce9-0x0;var _0x491b9f=_0x68b3[_0x4e3ce9];return _0x491b9f;};'use strict';var multer=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var path=require(_0x368b('0x2'));var timeout=require(_0x368b('0x3'));var express=require(_0x368b('0x4'));var router=express['Router']();var fs_extra=require(_0x368b('0x5'));var auth=require(_0x368b('0x6'));var interaction=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var controller=require('./voiceMail.controller');router[_0x368b('0x9')]('/',auth[_0x368b('0xa')](),controller[_0x368b('0xb')]);router[_0x368b('0x9')](_0x368b('0xc'),auth[_0x368b('0xa')](),controller[_0x368b('0xd')]);router[_0x368b('0x9')](_0x368b('0xe'),auth[_0x368b('0xa')](),controller[_0x368b('0xf')]);router['post']('/',auth[_0x368b('0xa')](),controller[_0x368b('0x10')]);router[_0x368b('0x11')]('/:id',auth[_0x368b('0xa')](),controller[_0x368b('0x12')]);router[_0x368b('0x13')]('/:id',auth[_0x368b('0xa')](),controller[_0x368b('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xb145=['show','/:id/messages','getMessages','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id'];(function(_0x4ce5db,_0xd6ecd3){var _0x2e3398=function(_0x4b049f){while(--_0x4b049f){_0x4ce5db['push'](_0x4ce5db['shift']());}};_0x2e3398(++_0xd6ecd3);}(_0xb145,0xa3));var _0x5b14=function(_0x5f2359,_0x152375){_0x5f2359=_0x5f2359-0x0;var _0xc41a57=_0xb145[_0x5f2359];return _0xc41a57;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x10')]('/',auth['isAuthenticated'](),controller[_0x5b14('0x11')]);router[_0x5b14('0x12')](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x13')]);router['delete'](_0x5b14('0xc'),auth['isAuthenticated'](),controller[_0x5b14('0x14')]);module[_0x5b14('0x15')]=router;
\ No newline at end of file
index 4033288..145e3bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3d6=['yes','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','email','string','trim','central','ENUM'];(function(_0x2cf4c4,_0x3490f3){var _0x24b7f7=function(_0x3a12eb){while(--_0x3a12eb){_0x2cf4c4['push'](_0x2cf4c4['shift']());}};_0x24b7f7(++_0x3490f3);}(_0xe3d6,0xe7));var _0x6e3d=function(_0x233c4e,_0x367986){_0x233c4e=_0x233c4e-0x0;var _0xb74775=_0xe3d6[_0x233c4e];return _0xb74775;};'use strict';var Sequelize=require(_0x6e3d('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x6e3d('0x1')]},'context':{'type':Sequelize[_0x6e3d('0x1')],'defaultValue':_0x6e3d('0x2'),'unique':_0x6e3d('0x3')},'mailbox':{'type':Sequelize[_0x6e3d('0x1')],'defaultValue':'','allowNull':![],'unique':_0x6e3d('0x3')},'password':{'type':Sequelize[_0x6e3d('0x1')]},'fullname':{'type':Sequelize[_0x6e3d('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x4ac244){this['setDataValue'](_0x6e3d('0x4'),typeof _0x4ac244===_0x6e3d('0x5')&&_0x4ac244['trim']()?_0x4ac244[_0x6e3d('0x6')]():null);}},'pager':{'type':Sequelize[_0x6e3d('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x6e3d('0x7')},'attach':{'type':Sequelize[_0x6e3d('0x8')](_0x6e3d('0x9'),'no'),'defaultValue':_0x6e3d('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6e3d('0x8')](_0x6e3d('0x9'),'no'),'defaultValue':_0x6e3d('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x6e3d('0x1')]},'callback':{'type':Sequelize[_0x6e3d('0x1')]},'review':{'type':Sequelize[_0x6e3d('0x8')](_0x6e3d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x6e3d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x6e3d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6e3d('0x8')](_0x6e3d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x6e3d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6e3d('0x8')]('yes','no'),'defaultValue':_0x6e3d('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x6e3d('0x8')](_0x6e3d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6e3d('0x8')](_0x6e3d('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x6e3d('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x6e3d('0x1')]},'emailbody':{'type':Sequelize[_0x6e3d('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6e3d('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6e3d('0xb')],'get':function(){return this[_0x6e3d('0xc')]('fullname')+_0x6e3d('0xd')+this[_0x6e3d('0xc')](_0x6e3d('0xe'));}}};
\ No newline at end of file
+var _0x5260=['trim','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','email','string'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x5260,0x15a));var _0x0526=function(_0x475f0e,_0x109994){_0x475f0e=_0x475f0e-0x0;var _0x470ab9=_0x5260[_0x475f0e];return _0x470ab9;};'use strict';var Sequelize=require('sequelize');module[_0x0526('0x0')]={'customer_id':{'type':Sequelize[_0x0526('0x1')]},'context':{'type':Sequelize[_0x0526('0x1')],'defaultValue':_0x0526('0x2'),'unique':_0x0526('0x3')},'mailbox':{'type':Sequelize[_0x0526('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x0526('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0526('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1c89fe){this['setDataValue'](_0x0526('0x4'),typeof _0x1c89fe===_0x0526('0x5')&&_0x1c89fe['trim']()?_0x1c89fe[_0x0526('0x6')]():null);}},'pager':{'type':Sequelize[_0x0526('0x1')]},'tz':{'type':Sequelize[_0x0526('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x0526('0x7')](_0x0526('0x8'),'no'),'defaultValue':_0x0526('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x0526('0x8'),'no'),'defaultValue':_0x0526('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0526('0x1')]},'callback':{'type':Sequelize[_0x0526('0x1')]},'review':{'type':Sequelize[_0x0526('0x7')](_0x0526('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x0526('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0526('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0526('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0526('0x7')](_0x0526('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0526('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x0526('0x8'),'no'),'defaultValue':_0x0526('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x0526('0x7')](_0x0526('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x0526('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x0526('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x0526('0x1')]},'emailbody':{'type':Sequelize[_0x0526('0x1')]},'maxsecs':{'type':Sequelize[_0x0526('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0526('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0526('0xb')],'get':function(){return this[_0x0526('0xc')](_0x0526('0xd'))+_0x0526('0xe')+this['getDataValue'](_0x0526('0xf'));}}};
\ No newline at end of file
index fdeb79f..8584a9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3266=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','nolimit','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','get','error','stack','name','send','index','VoiceMail','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','find'];(function(_0x4f59f6,_0x5e7399){var _0x5471c0=function(_0xb4bebe){while(--_0xb4bebe){_0x4f59f6['push'](_0x4f59f6['shift']());}};_0x5471c0(++_0x5e7399);}(_0x3266,0x6a));var _0x6326=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x3266[_0x4063a4];return _0x17908d;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){var _0x72d020=_0x2d0d00[_0x6326('0x27')]({'plain':!![]});var _0x575701='Voicemails';return db['UserProfileResource'][_0x6326('0x26')]({'where':{'type':_0x575701,'resourceId':_0x72d020['id']}})['then'](function(){return _0x2d0d00;});})[_0x6326('0x25')](function(){_0x429bb0[_0x6326('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e33d,_0x21ec69){return function(_0xb68fec){if(!_0xb68fec){_0x15e33d[_0x6326('0x1c')](0x194);}return _0xb68fec;};}function handleError(_0x2d2180,_0x45d037){_0x45d037=_0x45d037||0x1f4;return function(_0x40e036){logger[_0x6326('0x28')](_0x40e036[_0x6326('0x29')]);if(_0x40e036[_0x6326('0x2a')]){delete _0x40e036[_0x6326('0x2a')];}_0x2d2180[_0x6326('0x1d')](_0x45d037)[_0x6326('0x2b')](_0x40e036);};}exports[_0x6326('0x2c')]=function(_0x2e0445,_0x20c5ab){var _0x520e57={},_0x2bf5ef={},_0x47303c={'count':0x0,'rows':[]};var _0x1f8982=_['map'](db[_0x6326('0x2d')]['rawAttributes'],function(_0x4e703a){return{'name':_0x4e703a[_0x6326('0x2e')],'type':_0x4e703a[_0x6326('0x2f')][_0x6326('0x30')]};});_0x2bf5ef[_0x6326('0x31')]=_[_0x6326('0x32')](_0x1f8982,_0x6326('0x2a'));_0x2bf5ef[_0x6326('0x33')]=_[_0x6326('0x34')](_0x2e0445[_0x6326('0x33')]);_0x2bf5ef[_0x6326('0x35')]=_[_0x6326('0x36')](_0x2bf5ef[_0x6326('0x31')],_0x2bf5ef['query']);_0x520e57[_0x6326('0x37')]=_[_0x6326('0x36')](_0x2bf5ef['model'],qs[_0x6326('0x38')](_0x2e0445[_0x6326('0x33')][_0x6326('0x38')]));_0x520e57['attributes']=_0x520e57[_0x6326('0x37')]['length']?_0x520e57['attributes']:_0x2bf5ef[_0x6326('0x31')];if(!_0x2e0445[_0x6326('0x33')][_0x6326('0x39')]('nolimit')){_0x520e57[_0x6326('0x3a')]=qs['limit'](_0x2e0445[_0x6326('0x33')]['limit']);_0x520e57[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x2e0445[_0x6326('0x33')][_0x6326('0x1f')]);}_0x520e57[_0x6326('0x3b')]=qs[_0x6326('0x3c')](_0x2e0445['query'][_0x6326('0x3c')]);_0x520e57[_0x6326('0x3d')]=qs['filters'](_[_0x6326('0x3e')](_0x2e0445['query'],_0x2bf5ef['filters']),_0x1f8982);if(_0x2e0445[_0x6326('0x33')][_0x6326('0x3f')]){_0x520e57[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x520e57[_0x6326('0x3d')],{'$or':_[_0x6326('0x32')](_0x1f8982,function(_0x5de1c3){if(_0x5de1c3['type']!==_0x6326('0x41')){var _0x5b68af={};_0x5b68af[_0x5de1c3[_0x6326('0x2a')]]={'$like':'%'+_0x2e0445['query'][_0x6326('0x3f')]+'%'};return _0x5b68af;}})});}_0x520e57=_[_0x6326('0x40')]({},_0x520e57,_0x2e0445[_0x6326('0x42')]);var _0x1da798={'where':_0x520e57[_0x6326('0x3d')]};return db[_0x6326('0x2d')][_0x6326('0x20')](_0x1da798)[_0x6326('0x25')](function(_0x3b089b){_0x47303c[_0x6326('0x20')]=_0x3b089b;if(_0x2e0445[_0x6326('0x33')]['includeAll']){_0x520e57[_0x6326('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x6326('0x44')](_0x520e57);})[_0x6326('0x25')](function(_0x16fc33){_0x47303c[_0x6326('0x45')]=_0x16fc33;return _0x47303c;})['then'](respondWithFilteredResult(_0x20c5ab,_0x520e57))[_0x6326('0x46')](handleError(_0x20c5ab,null));};exports[_0x6326('0x47')]=function(_0x562d5f,_0x12703d){var _0xe6a992={'raw':!![],'where':{'id':_0x562d5f[_0x6326('0x48')]['id']}},_0x7a5057={};_0x7a5057['model']=_[_0x6326('0x34')](db[_0x6326('0x2d')][_0x6326('0x49')]);_0x7a5057[_0x6326('0x33')]=_[_0x6326('0x34')](_0x562d5f[_0x6326('0x33')]);_0x7a5057[_0x6326('0x35')]=_['intersection'](_0x7a5057[_0x6326('0x31')],_0x7a5057[_0x6326('0x33')]);_0xe6a992[_0x6326('0x37')]=_[_0x6326('0x36')](_0x7a5057['model'],qs[_0x6326('0x38')](_0x562d5f['query'][_0x6326('0x38')]));_0xe6a992[_0x6326('0x37')]=_0xe6a992[_0x6326('0x37')][_0x6326('0x4a')]?_0xe6a992[_0x6326('0x37')]:_0x7a5057['model'];if(_0x562d5f[_0x6326('0x33')]['includeAll']){_0xe6a992['include']=[{'all':!![]}];}_0xe6a992=_[_0x6326('0x40')]({},_0xe6a992,_0x562d5f[_0x6326('0x42')]);return db['VoiceMail'][_0x6326('0x4b')](_0xe6a992)[_0x6326('0x25')](handleEntityNotFound(_0x12703d,null))[_0x6326('0x25')](respondWithResult(_0x12703d,null))[_0x6326('0x46')](handleError(_0x12703d,null));};exports[_0x6326('0x4c')]=function(_0x4f8dc0,_0x4af0ee){return db[_0x6326('0x2d')][_0x6326('0x4c')](_0x4f8dc0[_0x6326('0x4d')],{})[_0x6326('0x25')](function(_0x210a1b){var _0x318d19=_0x4f8dc0[_0x6326('0x4e')]['get']({'plain':!![]});if(!_0x318d19)throw new Error(_0x6326('0x4f'));if(_0x318d19[_0x6326('0x50')]===_0x6326('0x4e')){var _0x3e7674=_0x210a1b[_0x6326('0x27')]({'plain':!![]});var _0x4ff8e6=_0x6326('0x51');return db['UserProfileSection'][_0x6326('0x4b')]({'where':{'name':_0x4ff8e6,'userProfileId':_0x318d19[_0x6326('0x52')]},'raw':!![]})['then'](function(_0x37b045){if(_0x37b045&&_0x37b045['autoAssociation']===0x0){return db[_0x6326('0x53')][_0x6326('0x4c')]({'name':_0x3e7674[_0x6326('0x2a')],'resourceId':_0x3e7674['id'],'type':_0x37b045[_0x6326('0x2a')],'sectionId':_0x37b045['id']},{})['then'](function(){return _0x210a1b;});}else{return _0x210a1b;}})[_0x6326('0x46')](function(_0xbe6b3e){logger['error'](_0x6326('0x54'),_0xbe6b3e);throw _0xbe6b3e;});}return _0x210a1b;})[_0x6326('0x25')](respondWithResult(_0x4af0ee,0xc9))[_0x6326('0x46')](handleError(_0x4af0ee,null));};exports['update']=function(_0x2bece1,_0x2ac64b){if(_0x2bece1['body']['id']){delete _0x2bece1[_0x6326('0x4d')]['id'];}return db['VoiceMail'][_0x6326('0x4b')]({'where':{'id':_0x2bece1[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x2ac64b,null))[_0x6326('0x25')](saveUpdates(_0x2bece1[_0x6326('0x4d')],null))[_0x6326('0x25')](respondWithResult(_0x2ac64b,null))[_0x6326('0x46')](handleError(_0x2ac64b,null));};exports['destroy']=function(_0x51adce,_0x4d4de7){return db[_0x6326('0x2d')]['find']({'where':{'id':_0x51adce[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4d4de7,null))[_0x6326('0x25')](removeEntity(_0x4d4de7,null))[_0x6326('0x46')](handleError(_0x4d4de7,null));};exports[_0x6326('0x55')]=function(_0x4b5bc6,_0x23bf64,_0x2e4244){return db['VoiceMail'][_0x6326('0x56')]({'where':{'id':_0x4b5bc6[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x23bf64,null))[_0x6326('0x25')](function(_0x45e3d5){var _0x36f2f5;var _0x320d43={},_0x2f624f={};_0x2f624f[_0x6326('0x31')]=_[_0x6326('0x34')](db['VoiceMailMessage'][_0x6326('0x49')]);_0x2f624f[_0x6326('0x33')]=_[_0x6326('0x34')](_0x4b5bc6[_0x6326('0x33')]);_0x2f624f['filters']=_['intersection'](_0x2f624f[_0x6326('0x31')],_0x2f624f[_0x6326('0x33')]);_0x320d43[_0x6326('0x37')]=_[_0x6326('0x36')](_0x2f624f[_0x6326('0x31')],qs['fields'](_0x4b5bc6['query'][_0x6326('0x38')]));_0x320d43[_0x6326('0x37')]=_0x320d43[_0x6326('0x37')][_0x6326('0x4a')]?_0x320d43['attributes']:_0x2f624f[_0x6326('0x31')];if(!_0x4b5bc6[_0x6326('0x33')][_0x6326('0x39')](_0x6326('0x57'))){_0x320d43[_0x6326('0x3a')]=qs[_0x6326('0x3a')](_0x4b5bc6['query'][_0x6326('0x3a')]);_0x320d43['offset']=qs[_0x6326('0x1f')](_0x4b5bc6[_0x6326('0x33')]['offset']);}_0x320d43[_0x6326('0x3b')]=qs[_0x6326('0x3c')](_0x4b5bc6[_0x6326('0x33')][_0x6326('0x3c')]);_0x320d43[_0x6326('0x3d')]=qs[_0x6326('0x35')](_[_0x6326('0x3e')](_0x4b5bc6[_0x6326('0x33')],_0x2f624f[_0x6326('0x35')]));if(_0x4b5bc6[_0x6326('0x33')]['filter']){_0x320d43[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x320d43[_0x6326('0x3d')],{'$or':_[_0x6326('0x32')](_0x320d43[_0x6326('0x37')],function(_0x5599da){var _0x299795={};_0x299795[_0x5599da]={'$like':'%'+_0x4b5bc6[_0x6326('0x33')][_0x6326('0x3f')]+'%'};return _0x299795;})});}_0x320d43[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x320d43['where'],{'mailboxuser':_0x45e3d5[_0x6326('0x58')]});_0x320d43=_['merge']({},_0x320d43,_0x4b5bc6['options']);return db[_0x6326('0x59')][_0x6326('0x5a')](_0x320d43)[_0x6326('0x25')](respondWithFilteredResult(_0x23bf64,_0x320d43));})[_0x6326('0x46')](handleError(_0x23bf64,null));};
\ No newline at end of file
+var _0xd64b=['merge','filter','options','includeAll','include','findAll','catch','params','filters','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','order','sort','mailbox','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','apply','reject','update','then','destroy','get','Voicemails','stack','name','send','index','map','VoiceMail','rawAttributes','type','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick'];(function(_0x270a02,_0x223adb){var _0x3cd07b=function(_0x387642){while(--_0x387642){_0x270a02['push'](_0x270a02['shift']());}};_0x3cd07b(++_0x223adb);}(_0xd64b,0xc1));var _0xbd64=function(_0x3a09e5,_0x22b07d){_0x3a09e5=_0x3a09e5-0x0;var _0x47f87d=_0xd64b[_0x3a09e5];return _0x47f87d;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('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(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136f60,_0x2729d8){_0x2729d8=_0x2729d8||0xcc;return function(_0x3a941c){if(_0x3a941c){return _0x136f60[_0xbd64('0x16')](_0x2729d8);}return _0x136f60[_0xbd64('0x17')](_0x2729d8)[_0xbd64('0x18')]();};}function respondWithResult(_0x2e23f2,_0x269e2f){_0x269e2f=_0x269e2f||0xc8;return function(_0x2b5808){if(_0x2b5808){return _0x2e23f2['status'](_0x269e2f)[_0xbd64('0x19')](_0x2b5808);}};}function respondWithFilteredResult(_0x13e7a4,_0x3ff550){return function(_0x32fd34){if(_0x32fd34){var _0x29fc16=typeof _0x3ff550['offset']===_0xbd64('0x1a')&&typeof _0x3ff550['limit']===_0xbd64('0x1a');var _0x1432a6=_0x32fd34[_0xbd64('0x1b')];var _0x1d7a14=_0x29fc16?0x0:_0x3ff550[_0xbd64('0x1c')];var _0x2f4554=_0x29fc16?_0x32fd34[_0xbd64('0x1b')]:_0x3ff550[_0xbd64('0x1c')]+_0x3ff550['limit'];var _0x305545;if(_0x2f4554>=_0x1432a6){_0x2f4554=_0x1432a6;_0x305545=0xc8;}else{_0x305545=0xce;}_0x13e7a4[_0xbd64('0x17')](_0x305545);return _0x13e7a4['set']('Content-Range',_0x1d7a14+'-'+_0x2f4554+'/'+_0x1432a6)[_0xbd64('0x19')](_0x32fd34);}return null;};}function patchUpdates(_0x42b328){return function(_0x196d21){try{jsonpatch[_0xbd64('0x1d')](_0x196d21,_0x42b328,!![]);}catch(_0x2c5551){return BPromise[_0xbd64('0x1e')](_0x2c5551);}return _0x196d21['save']();};}function saveUpdates(_0x4d4a16,_0x6038f){return function(_0x41f2f){if(_0x41f2f){return _0x41f2f[_0xbd64('0x1f')](_0x4d4a16)[_0xbd64('0x20')](function(_0x55e74c){return _0x55e74c;});}return null;};}function removeEntity(_0x51d118,_0x28497c){return function(_0x4afaff){if(_0x4afaff){return _0x4afaff[_0xbd64('0x21')]()['then'](function(){var _0x33452d=_0x4afaff[_0xbd64('0x22')]({'plain':!![]});var _0x3d12a0=_0xbd64('0x23');return db['UserProfileResource'][_0xbd64('0x21')]({'where':{'type':_0x3d12a0,'resourceId':_0x33452d['id']}})[_0xbd64('0x20')](function(){return _0x4afaff;});})[_0xbd64('0x20')](function(){_0x51d118[_0xbd64('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8719,_0x29c9c8){return function(_0x49eac5){if(!_0x49eac5){_0x4e8719['sendStatus'](0x194);}return _0x49eac5;};}function handleError(_0xfa918,_0x5aacdd){_0x5aacdd=_0x5aacdd||0x1f4;return function(_0x3cf5b7){logger['error'](_0x3cf5b7[_0xbd64('0x24')]);if(_0x3cf5b7['name']){delete _0x3cf5b7[_0xbd64('0x25')];}_0xfa918[_0xbd64('0x17')](_0x5aacdd)[_0xbd64('0x26')](_0x3cf5b7);};}exports[_0xbd64('0x27')]=function(_0x306f19,_0x207ffc){var _0x4ed44a={},_0x35bdd5={},_0xe876c9={'count':0x0,'rows':[]};var _0xc44280=_[_0xbd64('0x28')](db[_0xbd64('0x29')][_0xbd64('0x2a')],function(_0x5e70d3){return{'name':_0x5e70d3['fieldName'],'type':_0x5e70d3[_0xbd64('0x2b')]['key']};});_0x35bdd5[_0xbd64('0x2c')]=_[_0xbd64('0x28')](_0xc44280,'name');_0x35bdd5['query']=_[_0xbd64('0x2d')](_0x306f19['query']);_0x35bdd5['filters']=_[_0xbd64('0x2e')](_0x35bdd5[_0xbd64('0x2c')],_0x35bdd5[_0xbd64('0x2f')]);_0x4ed44a['attributes']=_[_0xbd64('0x2e')](_0x35bdd5['model'],qs[_0xbd64('0x30')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x4ed44a[_0xbd64('0x31')]=_0x4ed44a[_0xbd64('0x31')][_0xbd64('0x32')]?_0x4ed44a['attributes']:_0x35bdd5['model'];if(!_0x306f19[_0xbd64('0x2f')][_0xbd64('0x33')](_0xbd64('0x34'))){_0x4ed44a[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x306f19[_0xbd64('0x2f')]['limit']);_0x4ed44a['offset']=qs[_0xbd64('0x1c')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x4ed44a['order']=qs['sort'](_0x306f19[_0xbd64('0x2f')]['sort']);_0x4ed44a[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x306f19[_0xbd64('0x2f')],_0x35bdd5['filters']),_0xc44280);if(_0x306f19[_0xbd64('0x2f')]['filter']){_0x4ed44a['where']=_[_0xbd64('0x38')](_0x4ed44a[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0xc44280,function(_0x52f401){if(_0x52f401['type']!=='VIRTUAL'){var _0x344d46={};_0x344d46[_0x52f401[_0xbd64('0x25')]]={'$like':'%'+_0x306f19['query'][_0xbd64('0x39')]+'%'};return _0x344d46;}})});}_0x4ed44a=_[_0xbd64('0x38')]({},_0x4ed44a,_0x306f19[_0xbd64('0x3a')]);var _0x27fd12={'where':_0x4ed44a['where']};return db['VoiceMail'][_0xbd64('0x1b')](_0x27fd12)['then'](function(_0x595a91){_0xe876c9[_0xbd64('0x1b')]=_0x595a91;if(_0x306f19[_0xbd64('0x2f')][_0xbd64('0x3b')]){_0x4ed44a[_0xbd64('0x3c')]=[{'all':!![]}];}return db[_0xbd64('0x29')][_0xbd64('0x3d')](_0x4ed44a);})[_0xbd64('0x20')](function(_0x762380){_0xe876c9['rows']=_0x762380;return _0xe876c9;})[_0xbd64('0x20')](respondWithFilteredResult(_0x207ffc,_0x4ed44a))[_0xbd64('0x3e')](handleError(_0x207ffc,null));};exports['show']=function(_0x41b27a,_0x1e4983){var _0xe5b069={'raw':!![],'where':{'id':_0x41b27a[_0xbd64('0x3f')]['id']}},_0x2bc972={};_0x2bc972[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['VoiceMail'][_0xbd64('0x2a')]);_0x2bc972['query']=_[_0xbd64('0x2d')](_0x41b27a['query']);_0x2bc972[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x2bc972[_0xbd64('0x2c')],_0x2bc972['query']);_0xe5b069[_0xbd64('0x31')]=_['intersection'](_0x2bc972['model'],qs['fields'](_0x41b27a[_0xbd64('0x2f')][_0xbd64('0x30')]));_0xe5b069[_0xbd64('0x31')]=_0xe5b069[_0xbd64('0x31')][_0xbd64('0x32')]?_0xe5b069[_0xbd64('0x31')]:_0x2bc972[_0xbd64('0x2c')];if(_0x41b27a['query'][_0xbd64('0x3b')]){_0xe5b069[_0xbd64('0x3c')]=[{'all':!![]}];}_0xe5b069=_[_0xbd64('0x38')]({},_0xe5b069,_0x41b27a['options']);return db[_0xbd64('0x29')][_0xbd64('0x41')](_0xe5b069)[_0xbd64('0x20')](handleEntityNotFound(_0x1e4983,null))[_0xbd64('0x20')](respondWithResult(_0x1e4983,null))[_0xbd64('0x3e')](handleError(_0x1e4983,null));};exports['create']=function(_0x283699,_0x1a9ec8){return db[_0xbd64('0x29')][_0xbd64('0x42')](_0x283699['body'],{})['then'](function(_0x1e008f){var _0x2a7eec=_0x283699[_0xbd64('0x43')][_0xbd64('0x22')]({'plain':!![]});if(!_0x2a7eec)throw new Error(_0xbd64('0x44'));if(_0x2a7eec[_0xbd64('0x45')]===_0xbd64('0x43')){var _0x3807a7=_0x1e008f[_0xbd64('0x22')]({'plain':!![]});var _0x2709b2=_0xbd64('0x23');return db[_0xbd64('0x46')][_0xbd64('0x41')]({'where':{'name':_0x2709b2,'userProfileId':_0x2a7eec[_0xbd64('0x47')]},'raw':!![]})[_0xbd64('0x20')](function(_0x5bd444){if(_0x5bd444&&_0x5bd444[_0xbd64('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x3807a7['name'],'resourceId':_0x3807a7['id'],'type':_0x5bd444['name'],'sectionId':_0x5bd444['id']},{})[_0xbd64('0x20')](function(){return _0x1e008f;});}else{return _0x1e008f;}})[_0xbd64('0x3e')](function(_0x5480f5){logger[_0xbd64('0x49')](_0xbd64('0x4a'),_0x5480f5);throw _0x5480f5;});}return _0x1e008f;})[_0xbd64('0x20')](respondWithResult(_0x1a9ec8,0xc9))['catch'](handleError(_0x1a9ec8,null));};exports[_0xbd64('0x1f')]=function(_0x371bad,_0x44cd4f){if(_0x371bad[_0xbd64('0x4b')]['id']){delete _0x371bad[_0xbd64('0x4b')]['id'];}return db[_0xbd64('0x29')]['find']({'where':{'id':_0x371bad['params']['id']}})['then'](handleEntityNotFound(_0x44cd4f,null))[_0xbd64('0x20')](saveUpdates(_0x371bad[_0xbd64('0x4b')],null))[_0xbd64('0x20')](respondWithResult(_0x44cd4f,null))[_0xbd64('0x3e')](handleError(_0x44cd4f,null));};exports['destroy']=function(_0x1d0d9f,_0x20b275){return db[_0xbd64('0x29')][_0xbd64('0x41')]({'where':{'id':_0x1d0d9f[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x20b275,null))['then'](removeEntity(_0x20b275,null))[_0xbd64('0x3e')](handleError(_0x20b275,null));};exports[_0xbd64('0x4c')]=function(_0x15f1fc,_0x1fe3e5,_0x465661){return db[_0xbd64('0x29')][_0xbd64('0x4d')]({'where':{'id':_0x15f1fc[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x1fe3e5,null))[_0xbd64('0x20')](function(_0x3812b3){var _0xffda84;var _0x4a1e21={},_0x56c7d9={};_0x56c7d9[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['VoiceMailMessage']['rawAttributes']);_0x56c7d9[_0xbd64('0x2f')]=_[_0xbd64('0x2d')](_0x15f1fc['query']);_0x56c7d9[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x56c7d9[_0xbd64('0x2c')],_0x56c7d9[_0xbd64('0x2f')]);_0x4a1e21[_0xbd64('0x31')]=_[_0xbd64('0x2e')](_0x56c7d9[_0xbd64('0x2c')],qs[_0xbd64('0x30')](_0x15f1fc[_0xbd64('0x2f')]['fields']));_0x4a1e21[_0xbd64('0x31')]=_0x4a1e21[_0xbd64('0x31')][_0xbd64('0x32')]?_0x4a1e21['attributes']:_0x56c7d9[_0xbd64('0x2c')];if(!_0x15f1fc[_0xbd64('0x2f')]['hasOwnProperty'](_0xbd64('0x34'))){_0x4a1e21[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x15f1fc[_0xbd64('0x2f')][_0xbd64('0x35')]);_0x4a1e21[_0xbd64('0x1c')]=qs['offset'](_0x15f1fc[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x4a1e21[_0xbd64('0x4e')]=qs[_0xbd64('0x4f')](_0x15f1fc['query'][_0xbd64('0x4f')]);_0x4a1e21[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x15f1fc['query'],_0x56c7d9[_0xbd64('0x40')]));if(_0x15f1fc[_0xbd64('0x2f')][_0xbd64('0x39')]){_0x4a1e21[_0xbd64('0x36')]=_['merge'](_0x4a1e21[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0x4a1e21[_0xbd64('0x31')],function(_0x23925c){var _0x463a60={};_0x463a60[_0x23925c]={'$like':'%'+_0x15f1fc[_0xbd64('0x2f')]['filter']+'%'};return _0x463a60;})});}_0x4a1e21['where']=_['merge'](_0x4a1e21[_0xbd64('0x36')],{'mailboxuser':_0x3812b3[_0xbd64('0x50')]});_0x4a1e21=_[_0xbd64('0x38')]({},_0x4a1e21,_0x15f1fc[_0xbd64('0x3a')]);return db[_0xbd64('0x51')][_0xbd64('0x52')](_0x4a1e21)['then'](respondWithFilteredResult(_0x1fe3e5,_0x4a1e21));})[_0xbd64('0x3e')](handleError(_0x1fe3e5,null));};
\ No newline at end of file
index ae7c01f..a74cf3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f99=['request-promise','rimraf','./voiceMail.attributes','exports','voice_voicemail','mailbox_context','mailbox','context','lodash','util','moment'];(function(_0x13ebfc,_0x4313a6){var _0x3f069e=function(_0x41f472){while(--_0x41f472){_0x13ebfc['push'](_0x13ebfc['shift']());}};_0x3f069e(++_0x4313a6);}(_0x6f99,0x15d));var _0x96f9=function(_0x595f25,_0x412b29){_0x595f25=_0x595f25-0x0;var _0x388fb0=_0x6f99[_0x595f25];return _0x388fb0;};'use strict';var _=require(_0x96f9('0x0'));var util=require(_0x96f9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x96f9('0x2'));var BPromise=require('bluebird');var rp=require(_0x96f9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96f9('0x4'));var config=require('../../config/environment');var attributes=require(_0x96f9('0x5'));module[_0x96f9('0x6')]=function(_0x56db70,_0x5b270a){return _0x56db70['define']('VoiceMail',attributes,{'tableName':_0x96f9('0x7'),'paranoid':![],'indexes':[{'name':_0x96f9('0x8'),'fields':[_0x96f9('0x9'),_0x96f9('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe24d=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xe24d,0xf9));var _0xde24=function(_0x14746a,_0x38839d){_0x14746a=_0x14746a-0x0;var _0x2133a7=_0xe24d[_0x14746a];return _0x2133a7;};'use strict';var _=require(_0xde24('0x0'));var util=require('util');var logger=require(_0xde24('0x1'))(_0xde24('0x2'));var moment=require(_0xde24('0x3'));var BPromise=require(_0xde24('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde24('0x5'));var rimraf=require(_0xde24('0x6'));var config=require(_0xde24('0x7'));var attributes=require(_0xde24('0x8'));module[_0xde24('0x9')]=function(_0x4d930e,_0x23403b){return _0x4d930e[_0xde24('0xa')](_0xde24('0xb'),attributes,{'tableName':_0xde24('0xc'),'paranoid':![],'indexes':[{'name':_0xde24('0xd'),'fields':[_0xde24('0xe'),'context']}],'timestamps':!![]});};
\ No newline at end of file
index d24ccc4..663b9ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cd7=['jayson/promise','http','request','info','request\x20sent','debug','stringify','error','message','VoiceMail,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x210550,_0x279a03){var _0x366ccf=function(_0x351f1a){while(--_0x351f1a){_0x210550['push'](_0x210550['shift']());}};_0x366ccf(++_0x279a03);}(_0x1cd7,0xde));var _0x71cd=function(_0x3dcc9d,_0x38ceb9){_0x3dcc9d=_0x3dcc9d-0x0;var _0x3b0d59=_0x1cd7[_0x3dcc9d];return _0x3b0d59;};'use strict';var _=require('lodash');var util=require(_0x71cd('0x0'));var moment=require(_0x71cd('0x1'));var BPromise=require(_0x71cd('0x2'));var rs=require(_0x71cd('0x3'));var fs=require('fs');var Redis=require(_0x71cd('0x4'));var db=require(_0x71cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x71cd('0x6'))(_0x71cd('0x7'));var config=require(_0x71cd('0x8'));var jayson=require(_0x71cd('0x9'));var client=jayson['client'][_0x71cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f25d1,_0x67846e,_0x568025){return new BPromise(function(_0x27da90,_0x1ba5b7){return client[_0x71cd('0xb')](_0x3f25d1,_0x568025)['then'](function(_0x5488c5){logger[_0x71cd('0xc')]('VoiceMail,\x20%s,\x20%s',_0x67846e,_0x71cd('0xd'));logger[_0x71cd('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x67846e,_0x71cd('0xd'),JSON[_0x71cd('0xf')](_0x5488c5));if(_0x5488c5[_0x71cd('0x10')]){if(_0x5488c5['error']['code']===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x67846e,_0x5488c5['error']['message']);return _0x1ba5b7(_0x5488c5[_0x71cd('0x10')][_0x71cd('0x11')]);}logger[_0x71cd('0x10')]('VoiceMail,\x20%s,\x20%s',_0x67846e,_0x5488c5['error'][_0x71cd('0x11')]);return _0x27da90(_0x5488c5[_0x71cd('0x10')][_0x71cd('0x11')]);}else{logger[_0x71cd('0xc')](_0x71cd('0x12'),_0x67846e,_0x71cd('0xd'));_0x27da90(_0x5488c5[_0x71cd('0x13')][_0x71cd('0x11')]);}})[_0x71cd('0x14')](function(_0xf26cfb){logger['error'](_0x71cd('0x12'),_0x67846e,_0xf26cfb);_0x1ba5b7(_0xf26cfb);});});}
\ No newline at end of file
+var _0x674a=['../../config/utils','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0x674a,0xc0));var _0xa674=function(_0x4201c2,_0x36fc2a){_0x4201c2=_0x4201c2-0x0;var _0x45020c=_0x674a[_0x4201c2];return _0x45020c;};'use strict';var _=require(_0xa674('0x0'));var util=require(_0xa674('0x1'));var moment=require(_0xa674('0x2'));var BPromise=require('bluebird');var rs=require(_0xa674('0x3'));var fs=require('fs');var Redis=require(_0xa674('0x4'));var db=require(_0xa674('0x5'))['db'];var utils=require(_0xa674('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa674('0x7'));var client=jayson[_0xa674('0x8')][_0xa674('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f2539,_0x310d78,_0x154afe){return new BPromise(function(_0x144635,_0x33de45){return client[_0xa674('0xa')](_0x4f2539,_0x154afe)[_0xa674('0xb')](function(_0x568ba7){logger['info'](_0xa674('0xc'),_0x310d78,'request\x20sent');logger['debug'](_0xa674('0xd'),_0x310d78,'request\x20sent',JSON[_0xa674('0xe')](_0x568ba7));if(_0x568ba7[_0xa674('0xf')]){if(_0x568ba7[_0xa674('0xf')][_0xa674('0x10')]===0x1f4){logger['error'](_0xa674('0xc'),_0x310d78,_0x568ba7[_0xa674('0xf')]['message']);return _0x33de45(_0x568ba7[_0xa674('0xf')][_0xa674('0x11')]);}logger[_0xa674('0xf')]('VoiceMail,\x20%s,\x20%s',_0x310d78,_0x568ba7[_0xa674('0xf')][_0xa674('0x11')]);return _0x144635(_0x568ba7[_0xa674('0xf')]['message']);}else{logger[_0xa674('0x12')](_0xa674('0xc'),_0x310d78,_0xa674('0x13'));_0x144635(_0x568ba7[_0xa674('0x14')][_0xa674('0x11')]);}})[_0xa674('0x15')](function(_0xe1a20d){logger[_0xa674('0xf')]('VoiceMail,\x20%s,\x20%s',_0x310d78,_0xe1a20d);_0x33de45(_0xe1a20d);});});}
\ No newline at end of file
index 943e259..5336da6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x206a=['show','/:id/download','download','post','create','put','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id'];(function(_0xe7dfa7,_0x3d17ee){var _0x1a9fbf=function(_0x2ef98a){while(--_0x2ef98a){_0xe7dfa7['push'](_0xe7dfa7['shift']());}};_0x1a9fbf(++_0x3d17ee);}(_0x206a,0xe3));var _0xa206=function(_0x8889c3,_0x1e3212){_0x8889c3=_0x8889c3-0x0;var _0x427dd2=_0x206a[_0x8889c3];return _0x427dd2;};'use strict';var multer=require(_0xa206('0x0'));var util=require(_0xa206('0x1'));var path=require(_0xa206('0x2'));var timeout=require(_0xa206('0x3'));var express=require('express');var router=express[_0xa206('0x4')]();var fs_extra=require(_0xa206('0x5'));var auth=require(_0xa206('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa206('0x7'));var controller=require(_0xa206('0x8'));router[_0xa206('0x9')]('/',auth[_0xa206('0xa')](),controller[_0xa206('0xb')]);router[_0xa206('0x9')](_0xa206('0xc'),auth[_0xa206('0xa')](),controller[_0xa206('0xd')]);router[_0xa206('0x9')](_0xa206('0xe'),auth[_0xa206('0xa')](),controller[_0xa206('0xf')]);router[_0xa206('0x10')]('/',auth[_0xa206('0xa')](),controller[_0xa206('0x11')]);router[_0xa206('0x12')](_0xa206('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xa206('0xa')](),controller[_0xa206('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7c36=['download','post','create','/:id','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','show','/:id/download','isAuthenticated'];(function(_0x4c807c,_0x3e41c5){var _0xad2435=function(_0x1e7b31){while(--_0x1e7b31){_0x4c807c['push'](_0x4c807c['shift']());}};_0xad2435(++_0x3e41c5);}(_0x7c36,0xfe));var _0x67c3=function(_0x14b3dc,_0x47caeb){_0x14b3dc=_0x14b3dc-0x0;var _0x10ff20=_0x7c36[_0x14b3dc];return _0x10ff20;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x67c3('0x0'));var timeout=require(_0x67c3('0x1'));var express=require(_0x67c3('0x2'));var router=express[_0x67c3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x67c3('0x4'));var interaction=require(_0x67c3('0x5'));var config=require(_0x67c3('0x6'));var controller=require(_0x67c3('0x7'));router[_0x67c3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x67c3('0x9')]);router[_0x67c3('0x8')](_0x67c3('0xa'),auth[_0x67c3('0xb')](),controller[_0x67c3('0xc')]);router[_0x67c3('0xd')]('/',auth['isAuthenticated'](),controller[_0x67c3('0xe')]);router['put'](_0x67c3('0xf'),auth[_0x67c3('0xb')](),controller['update']);router[_0x67c3('0x10')](_0x67c3('0xf'),auth[_0x67c3('0xb')](),controller[_0x67c3('0x11')]);module[_0x67c3('0x12')]=router;
\ No newline at end of file
index afadf18..b073d92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94f3=['getDataValue','STRING','BLOB','TIMESTAMP','exports'];(function(_0x65e491,_0x15cb08){var _0x4d9115=function(_0x36b5f6){while(--_0x36b5f6){_0x65e491['push'](_0x65e491['shift']());}};_0x4d9115(++_0x15cb08);}(_0x94f3,0x8b));var _0x394f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94f3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x394f('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f5515){return this[_0x394f('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x394f('0x2')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x394f('0x2')],'defaultValue':''},'callerid':{'type':Sequelize[_0x394f('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0x394f('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0x394f('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x394f('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x394f('0x2')],'defaultValue':''},'recording':{'type':Sequelize[_0x394f('0x3')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x394f('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x394f('0x2')],'defaultValue':''},'stamp':{'type':_0x394f('0x4'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
+var _0xb556=['TIMESTAMP','literal','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long'];(function(_0x36c16a,_0x492ad7){var _0x24727f=function(_0x2fe567){while(--_0x2fe567){_0x36c16a['push'](_0x36c16a['shift']());}};_0x24727f(++_0x492ad7);}(_0xb556,0x1e8));var _0x6b55=function(_0x213bac,_0x4ec014){_0x213bac=_0x213bac-0x0;var _0x41519f=_0xb556[_0x213bac];return _0x41519f;};'use strict';var Sequelize=require(_0x6b55('0x0'));module[_0x6b55('0x1')]={'name':{'type':Sequelize[_0x6b55('0x2')],'get':function(_0xc97fcf){return this[_0x6b55('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6b55('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6b55('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x6b55('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x6b55('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x6b55('0x5')](_0x6b55('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x6b55('0x4')],'defaultValue':''},'stamp':{'type':_0x6b55('0x7'),'defaultValue':Sequelize[_0x6b55('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index 09b10b6..20f1169 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06d2=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse'];(function(_0x171ca6,_0x2f8f9d){var _0x244768=function(_0x25390c){while(--_0x25390c){_0x171ca6['push'](_0x171ca6['shift']());}};_0x244768(++_0x2f8f9d);}(_0x06d2,0x18d));var _0x206d=function(_0x1c093a,_0x5b18f2){_0x1c093a=_0x1c093a-0x0;var _0x2905a6=_0x06d2[_0x1c093a];return _0x2905a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x206d('0x0'));var zipdir=require(_0x206d('0x1'));var jsonpatch=require(_0x206d('0x2'));var rp=require(_0x206d('0x3'));var moment=require('moment');var BPromise=require(_0x206d('0x4'));var Mustache=require('mustache');var util=require(_0x206d('0x5'));var path=require('path');var sox=require(_0x206d('0x6'));var csv=require(_0x206d('0x7'));var ejs=require(_0x206d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x206d('0x9'));var deskjs=require(_0x206d('0xa'));var toCsv=require(_0x206d('0x7'));var querystring=require(_0x206d('0xb'));var Papa=require(_0x206d('0xc'));var Redis=require(_0x206d('0xd'));var authService=require(_0x206d('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x206d('0xf'));var logger=require(_0x206d('0x10'))(_0x206d('0x11'));var utils=require(_0x206d('0x12'));var config=require(_0x206d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x206d('0x14'))['db'];function respondWithStatusCode(_0xb67ace,_0x4b96ad){_0x4b96ad=_0x4b96ad||0xcc;return function(_0x200817){if(_0x200817){return _0xb67ace[_0x206d('0x15')](_0x4b96ad);}return _0xb67ace[_0x206d('0x16')](_0x4b96ad)[_0x206d('0x17')]();};}function respondWithResult(_0x27d137,_0x380461){_0x380461=_0x380461||0xc8;return function(_0x1c9437){if(_0x1c9437){return _0x27d137['status'](_0x380461)[_0x206d('0x18')](_0x1c9437);}};}function respondWithFilteredResult(_0x2a2b85,_0x43faa1){return function(_0x25f365){if(_0x25f365){var _0x47b81f=typeof _0x43faa1[_0x206d('0x19')]===_0x206d('0x1a')&&typeof _0x43faa1[_0x206d('0x1b')]==='undefined';var _0x2b6f51=_0x25f365['count'];var _0x24d713=_0x47b81f?0x0:_0x43faa1[_0x206d('0x19')];var _0x3bbf6a=_0x47b81f?_0x25f365[_0x206d('0x1c')]:_0x43faa1[_0x206d('0x19')]+_0x43faa1[_0x206d('0x1b')];var _0x1a88ff;if(_0x3bbf6a>=_0x2b6f51){_0x3bbf6a=_0x2b6f51;_0x1a88ff=0xc8;}else{_0x1a88ff=0xce;}_0x2a2b85['status'](_0x1a88ff);return _0x2a2b85[_0x206d('0x1d')](_0x206d('0x1e'),_0x24d713+'-'+_0x3bbf6a+'/'+_0x2b6f51)['json'](_0x25f365);}return null;};}function patchUpdates(_0x17a4aa){return function(_0x5ae944){try{jsonpatch[_0x206d('0x1f')](_0x5ae944,_0x17a4aa,!![]);}catch(_0x2d6012){return BPromise['reject'](_0x2d6012);}return _0x5ae944[_0x206d('0x20')]();};}function saveUpdates(_0x50478a,_0x17573b){return function(_0x347f58){if(_0x347f58){return _0x347f58[_0x206d('0x21')](_0x50478a)[_0x206d('0x22')](function(_0x2f080a){return _0x2f080a;});}return null;};}function removeEntity(_0x5e57ab,_0x597ae4){return function(_0x4b1092){if(_0x4b1092){return _0x4b1092[_0x206d('0x23')]()[_0x206d('0x22')](function(){_0x5e57ab[_0x206d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26f841,_0x3f5351){return function(_0x1a06eb){if(!_0x1a06eb){_0x26f841[_0x206d('0x15')](0x194);}return _0x1a06eb;};}function handleError(_0x2516ae,_0x248f69){_0x248f69=_0x248f69||0x1f4;return function(_0x20ed08){logger[_0x206d('0x24')](_0x20ed08[_0x206d('0x25')]);if(_0x20ed08[_0x206d('0x26')]){delete _0x20ed08[_0x206d('0x26')];}_0x2516ae['status'](_0x248f69)[_0x206d('0x27')](_0x20ed08);};}exports[_0x206d('0x28')]=function(_0x27bebf,_0x388593){var _0x11123d={},_0x5bdfd6={},_0x77d4d9={'count':0x0,'rows':[]};var _0x55ff70=_[_0x206d('0x29')](db[_0x206d('0x2a')][_0x206d('0x2b')],function(_0x450916){return{'name':_0x450916[_0x206d('0x2c')],'type':_0x450916['type'][_0x206d('0x2d')]};});_0x5bdfd6[_0x206d('0x2e')]=_[_0x206d('0x2f')](_[_0x206d('0x29')](_0x55ff70,_0x206d('0x26')),[_0x206d('0x26')]);_0x5bdfd6[_0x206d('0x30')]=_[_0x206d('0x31')](_0x27bebf[_0x206d('0x30')]);_0x5bdfd6[_0x206d('0x32')]=_['intersection'](_0x5bdfd6[_0x206d('0x2e')],_0x5bdfd6[_0x206d('0x30')]);_0x11123d[_0x206d('0x33')]=_[_0x206d('0x34')](_0x5bdfd6['model'],qs[_0x206d('0x35')](_0x27bebf[_0x206d('0x30')][_0x206d('0x35')]));_0x11123d[_0x206d('0x33')]=_0x11123d['attributes'][_0x206d('0x36')]?_0x11123d[_0x206d('0x33')]:_0x5bdfd6[_0x206d('0x2e')];if(!_0x27bebf[_0x206d('0x30')][_0x206d('0x37')](_0x206d('0x38'))){_0x11123d[_0x206d('0x1b')]=qs[_0x206d('0x1b')](_0x27bebf[_0x206d('0x30')][_0x206d('0x1b')]);_0x11123d[_0x206d('0x19')]=qs[_0x206d('0x19')](_0x27bebf[_0x206d('0x30')][_0x206d('0x19')]);}_0x11123d['order']=qs[_0x206d('0x39')](_0x27bebf[_0x206d('0x30')][_0x206d('0x39')]);_0x11123d[_0x206d('0x3a')]=qs['filters'](_[_0x206d('0x3b')](_0x27bebf[_0x206d('0x30')],_0x5bdfd6[_0x206d('0x32')]),_0x55ff70);if(_0x27bebf[_0x206d('0x30')][_0x206d('0x3c')]){_0x11123d[_0x206d('0x3a')]=_['merge'](_0x11123d[_0x206d('0x3a')],{'$or':_[_0x206d('0x29')](_0x55ff70,function(_0x52be26){if(_0x52be26[_0x206d('0x3d')]!==_0x206d('0x3e')){var _0x56986f={};_0x56986f[_0x52be26['name']]={'$like':'%'+_0x27bebf[_0x206d('0x30')]['filter']+'%'};return _0x56986f;}})});}_0x11123d=_[_0x206d('0x3f')]({},_0x11123d,_0x27bebf[_0x206d('0x40')]);var _0x48ab8a={'where':_0x11123d['where']};return db[_0x206d('0x2a')][_0x206d('0x1c')](_0x48ab8a)['then'](function(_0x466205){_0x77d4d9[_0x206d('0x1c')]=_0x466205;if(_0x27bebf[_0x206d('0x30')][_0x206d('0x41')]){_0x11123d[_0x206d('0x42')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x11123d);})[_0x206d('0x22')](function(_0x3360f6){_0x77d4d9['rows']=_0x3360f6;return _0x77d4d9;})[_0x206d('0x22')](respondWithFilteredResult(_0x388593,_0x11123d))[_0x206d('0x43')](handleError(_0x388593,null));};exports[_0x206d('0x44')]=function(_0x1f4aa0,_0x310fdf){var _0x213624={'raw':!![],'where':{'id':_0x1f4aa0[_0x206d('0x45')]['id']}},_0x263827={};_0x263827[_0x206d('0x2e')]=_['keys'](db[_0x206d('0x2a')]['rawAttributes']);_0x263827['query']=_[_0x206d('0x31')](_0x1f4aa0[_0x206d('0x30')]);_0x263827[_0x206d('0x32')]=_[_0x206d('0x34')](_0x263827[_0x206d('0x2e')],_0x263827[_0x206d('0x30')]);_0x213624[_0x206d('0x33')]=_[_0x206d('0x34')](_0x263827['model'],qs[_0x206d('0x35')](_0x1f4aa0[_0x206d('0x30')][_0x206d('0x35')]));_0x213624[_0x206d('0x33')]=_0x213624['attributes'][_0x206d('0x36')]?_0x213624[_0x206d('0x33')]:_0x263827[_0x206d('0x2e')];if(_0x1f4aa0[_0x206d('0x30')][_0x206d('0x41')]){_0x213624[_0x206d('0x42')]=[{'all':!![]}];}_0x213624=_[_0x206d('0x3f')]({},_0x213624,_0x1f4aa0['options']);return db[_0x206d('0x2a')][_0x206d('0x46')](_0x213624)[_0x206d('0x22')](handleEntityNotFound(_0x310fdf,null))[_0x206d('0x22')](respondWithResult(_0x310fdf,null))[_0x206d('0x43')](handleError(_0x310fdf,null));};exports['create']=function(_0x2415f8,_0x84121d){return db[_0x206d('0x2a')][_0x206d('0x47')](_0x2415f8[_0x206d('0x48')],{})[_0x206d('0x22')](respondWithResult(_0x84121d,0xc9))['catch'](handleError(_0x84121d,null));};exports['update']=function(_0x4d7683,_0x54b4ba){if(_0x4d7683[_0x206d('0x48')]['id']){delete _0x4d7683[_0x206d('0x48')]['id'];}return db[_0x206d('0x2a')][_0x206d('0x46')]({'where':{'id':_0x4d7683['params']['id']}})[_0x206d('0x22')](handleEntityNotFound(_0x54b4ba,null))[_0x206d('0x22')](saveUpdates(_0x4d7683[_0x206d('0x48')],null))[_0x206d('0x22')](respondWithResult(_0x54b4ba,null))[_0x206d('0x43')](handleError(_0x54b4ba,null));};exports[_0x206d('0x23')]=function(_0x4b4223,_0xc7ebd6){return db['VoiceMailMessage'][_0x206d('0x46')]({'where':{'id':_0x4b4223[_0x206d('0x45')]['id']}})[_0x206d('0x22')](handleEntityNotFound(_0xc7ebd6,null))[_0x206d('0x22')](removeEntity(_0xc7ebd6,null))[_0x206d('0x43')](handleError(_0xc7ebd6,null));};exports[_0x206d('0x49')]=function(_0x555688,_0x8fc46e,_0x3a0ca7){return db[_0x206d('0x2a')][_0x206d('0x46')]({'where':{'id':_0x555688[_0x206d('0x45')]['id']},'attributes':['id',_0x206d('0x4a'),_0x206d('0x4b')]})[_0x206d('0x22')](handleEntityNotFound(_0x8fc46e,null))[_0x206d('0x22')](function(_0x10106f){if(_0x10106f){if(!_0x10106f[_0x206d('0x4a')]){throw new db['Sequelize'][(_0x206d('0x4c'))](_0x206d('0x4d'));}var _0x14a125={'Content-Type':_0x206d('0x4e'),'Content-Disposition':_0x206d('0x4f')};if(_0x10106f[_0x206d('0x4b')]){_0x14a125[_0x206d('0x50')]=_0x206d('0x51')+_0x10106f[_0x206d('0x4b')]+'.wav\x22';}_0x8fc46e[_0x206d('0x1d')](_0x14a125);return _0x8fc46e[_0x206d('0x27')](new Buffer(_0x10106f[_0x206d('0x4a')]));}})[_0x206d('0x43')](handleError(_0x8fc46e,null));};
\ No newline at end of file
+var _0x798e=['catch','params','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','reject','save','update','then','destroy','error','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','filter','where','merge','options','includeAll','findAll','rows'];(function(_0x3681f7,_0x3c5ade){var _0xec3c3c=function(_0x1e3084){while(--_0x1e3084){_0x3681f7['push'](_0x3681f7['shift']());}};_0xec3c3c(++_0x3c5ade);}(_0x798e,0xf2));var _0xe798=function(_0x28c8fc,_0x1e007e){_0x28c8fc=_0x28c8fc-0x0;var _0x3bc1c1=_0x798e[_0x28c8fc];return _0x3bc1c1;};'use strict';var emlformat=require(_0xe798('0x0'));var rimraf=require(_0xe798('0x1'));var zipdir=require(_0xe798('0x2'));var jsonpatch=require(_0xe798('0x3'));var rp=require(_0xe798('0x4'));var moment=require(_0xe798('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe798('0x6'));var path=require('path');var sox=require(_0xe798('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe798('0x8'));var squel=require(_0xe798('0x9'));var crypto=require(_0xe798('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe798('0xb'));var toCsv=require(_0xe798('0xc'));var querystring=require(_0xe798('0xd'));var Papa=require('papaparse');var Redis=require(_0xe798('0xe'));var authService=require(_0xe798('0xf'));var qs=require(_0xe798('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe798('0x11'));var logger=require('../../config/logger')(_0xe798('0x12'));var utils=require(_0xe798('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe798('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5825d6,_0x4d1c9d){_0x4d1c9d=_0x4d1c9d||0xcc;return function(_0x4173b6){if(_0x4173b6){return _0x5825d6[_0xe798('0x15')](_0x4d1c9d);}return _0x5825d6[_0xe798('0x16')](_0x4d1c9d)[_0xe798('0x17')]();};}function respondWithResult(_0x3c3558,_0x2a3fe7){_0x2a3fe7=_0x2a3fe7||0xc8;return function(_0x3bb988){if(_0x3bb988){return _0x3c3558[_0xe798('0x16')](_0x2a3fe7)[_0xe798('0x18')](_0x3bb988);}};}function respondWithFilteredResult(_0x5cd12f,_0x55f33a){return function(_0x4aa8b2){if(_0x4aa8b2){var _0x1b0afb=typeof _0x55f33a['offset']===_0xe798('0x19')&&typeof _0x55f33a['limit']===_0xe798('0x19');var _0x21b8b4=_0x4aa8b2[_0xe798('0x1a')];var _0x57539f=_0x1b0afb?0x0:_0x55f33a['offset'];var _0xd3e646=_0x1b0afb?_0x4aa8b2[_0xe798('0x1a')]:_0x55f33a['offset']+_0x55f33a['limit'];var _0x5d62d2;if(_0xd3e646>=_0x21b8b4){_0xd3e646=_0x21b8b4;_0x5d62d2=0xc8;}else{_0x5d62d2=0xce;}_0x5cd12f[_0xe798('0x16')](_0x5d62d2);return _0x5cd12f['set']('Content-Range',_0x57539f+'-'+_0xd3e646+'/'+_0x21b8b4)[_0xe798('0x18')](_0x4aa8b2);}return null;};}function patchUpdates(_0x52cc04){return function(_0x1f4445){try{jsonpatch['apply'](_0x1f4445,_0x52cc04,!![]);}catch(_0x2b7d7e){return BPromise[_0xe798('0x1b')](_0x2b7d7e);}return _0x1f4445[_0xe798('0x1c')]();};}function saveUpdates(_0x2b9cdf,_0x388749){return function(_0x380dea){if(_0x380dea){return _0x380dea[_0xe798('0x1d')](_0x2b9cdf)[_0xe798('0x1e')](function(_0x5e9962){return _0x5e9962;});}return null;};}function removeEntity(_0x23fd50,_0x56d76f){return function(_0x3e63b3){if(_0x3e63b3){return _0x3e63b3[_0xe798('0x1f')]()[_0xe798('0x1e')](function(){_0x23fd50['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8cdc67,_0x2ba4e3){return function(_0x1e681b){if(!_0x1e681b){_0x8cdc67[_0xe798('0x15')](0x194);}return _0x1e681b;};}function handleError(_0x5bcf4a,_0x27f38d){_0x27f38d=_0x27f38d||0x1f4;return function(_0x26e8eb){logger[_0xe798('0x20')](_0x26e8eb['stack']);if(_0x26e8eb['name']){delete _0x26e8eb[_0xe798('0x21')];}_0x5bcf4a[_0xe798('0x16')](_0x27f38d)[_0xe798('0x22')](_0x26e8eb);};}exports['index']=function(_0x5868a7,_0x18bf93){var _0x2211d3={},_0x2bfed6={},_0x5a44cf={'count':0x0,'rows':[]};var _0x24931d=_[_0xe798('0x23')](db[_0xe798('0x24')][_0xe798('0x25')],function(_0x1769de){return{'name':_0x1769de[_0xe798('0x26')],'type':_0x1769de[_0xe798('0x27')]['key']};});_0x2bfed6['model']=_['differenceBy'](_['map'](_0x24931d,_0xe798('0x21')),[_0xe798('0x21')]);_0x2bfed6['query']=_[_0xe798('0x28')](_0x5868a7[_0xe798('0x29')]);_0x2bfed6['filters']=_[_0xe798('0x2a')](_0x2bfed6[_0xe798('0x2b')],_0x2bfed6[_0xe798('0x29')]);_0x2211d3[_0xe798('0x2c')]=_[_0xe798('0x2a')](_0x2bfed6[_0xe798('0x2b')],qs[_0xe798('0x2d')](_0x5868a7['query'][_0xe798('0x2d')]));_0x2211d3['attributes']=_0x2211d3[_0xe798('0x2c')][_0xe798('0x2e')]?_0x2211d3[_0xe798('0x2c')]:_0x2bfed6[_0xe798('0x2b')];if(!_0x5868a7['query'][_0xe798('0x2f')](_0xe798('0x30'))){_0x2211d3['limit']=qs['limit'](_0x5868a7['query'][_0xe798('0x31')]);_0x2211d3['offset']=qs['offset'](_0x5868a7[_0xe798('0x29')][_0xe798('0x32')]);}_0x2211d3[_0xe798('0x33')]=qs['sort'](_0x5868a7[_0xe798('0x29')][_0xe798('0x34')]);_0x2211d3['where']=qs[_0xe798('0x35')](_[_0xe798('0x36')](_0x5868a7[_0xe798('0x29')],_0x2bfed6[_0xe798('0x35')]),_0x24931d);if(_0x5868a7[_0xe798('0x29')][_0xe798('0x37')]){_0x2211d3[_0xe798('0x38')]=_[_0xe798('0x39')](_0x2211d3[_0xe798('0x38')],{'$or':_[_0xe798('0x23')](_0x24931d,function(_0xbc1b26){if(_0xbc1b26[_0xe798('0x27')]!=='VIRTUAL'){var _0x251dae={};_0x251dae[_0xbc1b26['name']]={'$like':'%'+_0x5868a7[_0xe798('0x29')][_0xe798('0x37')]+'%'};return _0x251dae;}})});}_0x2211d3=_['merge']({},_0x2211d3,_0x5868a7[_0xe798('0x3a')]);var _0x550b73={'where':_0x2211d3[_0xe798('0x38')]};return db['VoiceMailMessage'][_0xe798('0x1a')](_0x550b73)[_0xe798('0x1e')](function(_0xf3105c){_0x5a44cf[_0xe798('0x1a')]=_0xf3105c;if(_0x5868a7[_0xe798('0x29')][_0xe798('0x3b')]){_0x2211d3['include']=[{'all':!![]}];}return db[_0xe798('0x24')][_0xe798('0x3c')](_0x2211d3);})['then'](function(_0x5557c2){_0x5a44cf[_0xe798('0x3d')]=_0x5557c2;return _0x5a44cf;})[_0xe798('0x1e')](respondWithFilteredResult(_0x18bf93,_0x2211d3))[_0xe798('0x3e')](handleError(_0x18bf93,null));};exports['show']=function(_0x536d52,_0x417861){var _0x3af3ca={'raw':!![],'where':{'id':_0x536d52[_0xe798('0x3f')]['id']}},_0x25249a={};_0x25249a['model']=_[_0xe798('0x28')](db['VoiceMailMessage'][_0xe798('0x25')]);_0x25249a['query']=_['keys'](_0x536d52[_0xe798('0x29')]);_0x25249a['filters']=_['intersection'](_0x25249a['model'],_0x25249a[_0xe798('0x29')]);_0x3af3ca[_0xe798('0x2c')]=_[_0xe798('0x2a')](_0x25249a['model'],qs[_0xe798('0x2d')](_0x536d52[_0xe798('0x29')][_0xe798('0x2d')]));_0x3af3ca['attributes']=_0x3af3ca[_0xe798('0x2c')][_0xe798('0x2e')]?_0x3af3ca['attributes']:_0x25249a[_0xe798('0x2b')];if(_0x536d52[_0xe798('0x29')][_0xe798('0x3b')]){_0x3af3ca['include']=[{'all':!![]}];}_0x3af3ca=_['merge']({},_0x3af3ca,_0x536d52[_0xe798('0x3a')]);return db[_0xe798('0x24')]['find'](_0x3af3ca)['then'](handleEntityNotFound(_0x417861,null))[_0xe798('0x1e')](respondWithResult(_0x417861,null))[_0xe798('0x3e')](handleError(_0x417861,null));};exports['create']=function(_0x58fe7c,_0xdc7041){return db['VoiceMailMessage'][_0xe798('0x40')](_0x58fe7c['body'],{})[_0xe798('0x1e')](respondWithResult(_0xdc7041,0xc9))[_0xe798('0x3e')](handleError(_0xdc7041,null));};exports[_0xe798('0x1d')]=function(_0x6aebd8,_0x47d533){if(_0x6aebd8[_0xe798('0x41')]['id']){delete _0x6aebd8[_0xe798('0x41')]['id'];}return db[_0xe798('0x24')]['find']({'where':{'id':_0x6aebd8[_0xe798('0x3f')]['id']}})[_0xe798('0x1e')](handleEntityNotFound(_0x47d533,null))[_0xe798('0x1e')](saveUpdates(_0x6aebd8[_0xe798('0x41')],null))[_0xe798('0x1e')](respondWithResult(_0x47d533,null))[_0xe798('0x3e')](handleError(_0x47d533,null));};exports[_0xe798('0x1f')]=function(_0x1f7157,_0x3007c5){return db[_0xe798('0x24')]['find']({'where':{'id':_0x1f7157[_0xe798('0x3f')]['id']}})[_0xe798('0x1e')](handleEntityNotFound(_0x3007c5,null))[_0xe798('0x1e')](removeEntity(_0x3007c5,null))[_0xe798('0x3e')](handleError(_0x3007c5,null));};exports[_0xe798('0x42')]=function(_0x406a24,_0x451710,_0x659e01){return db[_0xe798('0x24')]['find']({'where':{'id':_0x406a24[_0xe798('0x3f')]['id']},'attributes':['id',_0xe798('0x43'),_0xe798('0x44')]})[_0xe798('0x1e')](handleEntityNotFound(_0x451710,null))[_0xe798('0x1e')](function(_0x420f9f){if(_0x420f9f){if(!_0x420f9f['recording']){throw new db[(_0xe798('0x45'))][(_0xe798('0x46'))](_0xe798('0x47'));}var _0x379b84={'Content-Type':'audio/wav','Content-Disposition':_0xe798('0x48')};if(_0x420f9f['msg_id']){_0x379b84[_0xe798('0x49')]='attachment;\x20filename=\x22'+_0x420f9f[_0xe798('0x44')]+_0xe798('0x4a');}_0x451710[_0xe798('0x4b')](_0x379b84);return _0x451710['send'](new Buffer(_0x420f9f[_0xe798('0x43')]));}})['catch'](handleError(_0x451710,null));};
\ No newline at end of file
index c3d72cc..2c1b7ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc256=['request-promise','path','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api','moment','bluebird'];(function(_0x570b2b,_0x4ed749){var _0x1a5096=function(_0x2111bd){while(--_0x2111bd){_0x570b2b['push'](_0x570b2b['shift']());}};_0x1a5096(++_0x4ed749);}(_0xc256,0x187));var _0x6c25=function(_0x3cc80c,_0x208af9){_0x3cc80c=_0x3cc80c-0x0;var _0x950214=_0xc256[_0x3cc80c];return _0x950214;};'use strict';var _=require('lodash');var util=require(_0x6c25('0x0'));var logger=require(_0x6c25('0x1'))(_0x6c25('0x2'));var moment=require(_0x6c25('0x3'));var BPromise=require(_0x6c25('0x4'));var rp=require(_0x6c25('0x5'));var fs=require('fs');var path=require(_0x6c25('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c25('0x7'));module[_0x6c25('0x8')]=function(_0x426586,_0x74e81a){return _0x426586['define'](_0x6c25('0x9'),attributes,{'tableName':_0x6c25('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x6c25('0xb')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x0ff9=['rimraf','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x0ff9,0x13e));var _0x90ff=function(_0x90add5,_0x531360){_0x90add5=_0x90add5-0x0;var _0x376af0=_0x0ff9[_0x90add5];return _0x376af0;};'use strict';var _=require(_0x90ff('0x0'));var util=require(_0x90ff('0x1'));var logger=require(_0x90ff('0x2'))('api');var moment=require(_0x90ff('0x3'));var BPromise=require('bluebird');var rp=require(_0x90ff('0x4'));var fs=require('fs');var path=require(_0x90ff('0x5'));var rimraf=require(_0x90ff('0x6'));var config=require('../../config/environment');var attributes=require(_0x90ff('0x7'));module[_0x90ff('0x8')]=function(_0x4b57a7,_0x572886){return _0x4b57a7[_0x90ff('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x90ff('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x90ff('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index 633cbb5..735ce7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07e7=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x344a18,_0x48eccd){var _0x150e6a=function(_0x1f0512){while(--_0x1f0512){_0x344a18['push'](_0x344a18['shift']());}};_0x150e6a(++_0x48eccd);}(_0x07e7,0x87));var _0x707e=function(_0x1bc460,_0x575289){_0x1bc460=_0x1bc460-0x0;var _0xc4419=_0x07e7[_0x1bc460];return _0xc4419;};'use strict';var _=require(_0x707e('0x0'));var util=require(_0x707e('0x1'));var moment=require('moment');var BPromise=require(_0x707e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x707e('0x3'));var db=require(_0x707e('0x4'))['db'];var utils=require(_0x707e('0x5'));var logger=require('../../config/logger')(_0x707e('0x6'));var config=require(_0x707e('0x7'));var jayson=require(_0x707e('0x8'));var client=jayson['client'][_0x707e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e8b7b,_0x28ade8,_0x2afa7e){return new BPromise(function(_0x8dc457,_0x45cb49){return client[_0x707e('0xa')](_0x2e8b7b,_0x2afa7e)[_0x707e('0xb')](function(_0x10777f){logger[_0x707e('0xc')](_0x707e('0xd'),_0x28ade8,_0x707e('0xe'));logger[_0x707e('0xf')](_0x707e('0x10'),_0x28ade8,_0x707e('0xe'),JSON['stringify'](_0x10777f));if(_0x10777f[_0x707e('0x11')]){if(_0x10777f[_0x707e('0x11')][_0x707e('0x12')]===0x1f4){logger[_0x707e('0x11')](_0x707e('0xd'),_0x28ade8,_0x10777f['error']['message']);return _0x45cb49(_0x10777f[_0x707e('0x11')][_0x707e('0x13')]);}logger[_0x707e('0x11')](_0x707e('0xd'),_0x28ade8,_0x10777f[_0x707e('0x11')][_0x707e('0x13')]);return _0x8dc457(_0x10777f[_0x707e('0x11')]['message']);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x28ade8,_0x707e('0xe'));_0x8dc457(_0x10777f[_0x707e('0x14')][_0x707e('0x13')]);}})[_0x707e('0x15')](function(_0x7dcee4){logger[_0x707e('0x11')](_0x707e('0xd'),_0x28ade8,_0x7dcee4);_0x45cb49(_0x7dcee4);});});}
\ No newline at end of file
+var _0x1ae6=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring'];(function(_0x18f8ff,_0x257e95){var _0x18de97=function(_0xc8eb68){while(--_0xc8eb68){_0x18f8ff['push'](_0x18f8ff['shift']());}};_0x18de97(++_0x257e95);}(_0x1ae6,0x90));var _0x61ae=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x1ae6[_0x5c351c];return _0x26f3b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x61ae('0x0'));var BPromise=require(_0x61ae('0x1'));var rs=require(_0x61ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61ae('0x3'))['db'];var utils=require(_0x61ae('0x4'));var logger=require(_0x61ae('0x5'))('rpc');var config=require(_0x61ae('0x6'));var jayson=require(_0x61ae('0x7'));var client=jayson[_0x61ae('0x8')][_0x61ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x336ecf,_0x3c8369,_0x463b01){return new BPromise(function(_0x35f08b,_0x59ca68){return client[_0x61ae('0xa')](_0x336ecf,_0x463b01)['then'](function(_0x28b7ea){logger[_0x61ae('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x3c8369,_0x61ae('0xc'));logger[_0x61ae('0xd')](_0x61ae('0xe'),_0x3c8369,_0x61ae('0xc'),JSON[_0x61ae('0xf')](_0x28b7ea));if(_0x28b7ea[_0x61ae('0x10')]){if(_0x28b7ea[_0x61ae('0x10')][_0x61ae('0x11')]===0x1f4){logger[_0x61ae('0x10')](_0x61ae('0x12'),_0x3c8369,_0x28b7ea[_0x61ae('0x10')][_0x61ae('0x13')]);return _0x59ca68(_0x28b7ea['error'][_0x61ae('0x13')]);}logger[_0x61ae('0x10')](_0x61ae('0x12'),_0x3c8369,_0x28b7ea['error']['message']);return _0x35f08b(_0x28b7ea[_0x61ae('0x10')][_0x61ae('0x13')]);}else{logger[_0x61ae('0xb')](_0x61ae('0x12'),_0x3c8369,_0x61ae('0xc'));_0x35f08b(_0x28b7ea['result'][_0x61ae('0x13')]);}})[_0x61ae('0x14')](function(_0x1ce1a2){logger['error'](_0x61ae('0x12'),_0x3c8369,_0x1ce1a2);_0x59ca68(_0x1ce1a2);});});}
\ No newline at end of file
index 9b8854f..8a3fd4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64b8=['addSound','put','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','path','Router','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create'];(function(_0x4c4c26,_0x3ea8f6){var _0x5d241b=function(_0x11bc56){while(--_0x11bc56){_0x4c4c26['push'](_0x4c4c26['shift']());}};_0x5d241b(++_0x3ea8f6);}(_0x64b8,0xa1));var _0x864b=function(_0x53f95f,_0x47fa5d){_0x53f95f=_0x53f95f-0x0;var _0xf2e615=_0x64b8[_0x53f95f];return _0xf2e615;};'use strict';var multer=require(_0x864b('0x0'));var util=require('util');var path=require(_0x864b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x864b('0x2')]();var fs_extra=require(_0x864b('0x3'));var auth=require(_0x864b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x864b('0x5'));router[_0x864b('0x6')]('/',auth[_0x864b('0x7')](),controller[_0x864b('0x8')]);router[_0x864b('0x6')](_0x864b('0x9'),auth[_0x864b('0x7')](),controller[_0x864b('0xa')]);router[_0x864b('0x6')](_0x864b('0xb'),auth[_0x864b('0x7')](),controller[_0x864b('0xc')]);router[_0x864b('0xd')]('/',auth[_0x864b('0x7')](),controller[_0x864b('0xe')]);router[_0x864b('0xd')](_0x864b('0xb'),auth[_0x864b('0x7')](),controller[_0x864b('0xf')]);router[_0x864b('0x10')](_0x864b('0x9'),auth[_0x864b('0x7')](),controller['update']);router['delete'](_0x864b('0x9'),auth[_0x864b('0x7')](),controller[_0x864b('0x11')]);router[_0x864b('0x12')](_0x864b('0x13'),auth[_0x864b('0x7')](),controller[_0x864b('0x14')]);module[_0x864b('0x15')]=router;
\ No newline at end of file
+var _0x7437=['express','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','getSounds','post','create','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout'];(function(_0x3b3253,_0x282bf2){var _0x147c1f=function(_0x1fe7db){while(--_0x1fe7db){_0x3b3253['push'](_0x3b3253['shift']());}};_0x147c1f(++_0x282bf2);}(_0x7437,0x1f4));var _0x7743=function(_0x5e42b4,_0x1b9678){_0x5e42b4=_0x5e42b4-0x0;var _0x3f89c8=_0x7437[_0x5e42b4];return _0x3f89c8;};'use strict';var multer=require(_0x7743('0x0'));var util=require(_0x7743('0x1'));var path=require(_0x7743('0x2'));var timeout=require(_0x7743('0x3'));var express=require(_0x7743('0x4'));var router=express['Router']();var fs_extra=require(_0x7743('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7743('0x6'));var config=require('../../config/environment');var controller=require(_0x7743('0x7'));router['get']('/',auth[_0x7743('0x8')](),controller[_0x7743('0x9')]);router[_0x7743('0xa')](_0x7743('0xb'),auth['isAuthenticated'](),controller[_0x7743('0xc')]);router[_0x7743('0xa')](_0x7743('0xd'),auth[_0x7743('0x8')](),controller[_0x7743('0xe')]);router[_0x7743('0xf')]('/',auth[_0x7743('0x8')](),controller[_0x7743('0x10')]);router[_0x7743('0xf')](_0x7743('0xd'),auth[_0x7743('0x8')](),controller[_0x7743('0x11')]);router[_0x7743('0x12')](_0x7743('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7743('0x13')](_0x7743('0xb'),auth[_0x7743('0x8')](),controller[_0x7743('0x14')]);router['delete'](_0x7743('0x15'),auth[_0x7743('0x8')](),controller[_0x7743('0x16')]);module[_0x7743('0x17')]=router;
\ No newline at end of file
index e5951e7..b9206f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81e8=['alpha','TIMESTAMP','BOOLEAN','exports','STRING','name','ENUM','custom','files','quietmp3nb'];(function(_0x3faa8d,_0x1a6460){var _0x12e06d=function(_0x2720f5){while(--_0x2720f5){_0x3faa8d['push'](_0x3faa8d['shift']());}};_0x12e06d(++_0x1a6460);}(_0x81e8,0x14d));var _0x881e=function(_0x4e852f,_0x58302a){_0x4e852f=_0x4e852f-0x0;var _0x1c1afb=_0x81e8[_0x4e852f];return _0x1c1afb;};'use strict';var Sequelize=require('sequelize');module[_0x881e('0x0')]={'name':{'type':Sequelize[_0x881e('0x1')],'allowNull':![],'unique':_0x881e('0x2')},'mode':{'type':Sequelize[_0x881e('0x3')](_0x881e('0x4'),_0x881e('0x5'),'mp3nb',_0x881e('0x6'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x881e('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x881e('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x881e('0x8')},'defaultEntry':{'type':Sequelize[_0x881e('0x9')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf061=['mp3','alpha','sequelize','exports','STRING','ENUM','files','mp3nb','quietmp3nb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf061,0xec));var _0x1f06=function(_0x40b655,_0x394cfb){_0x40b655=_0x40b655-0x0;var _0x1ccb75=_0xf061[_0x40b655];return _0x1ccb75;};'use strict';var Sequelize=require(_0x1f06('0x0'));module[_0x1f06('0x1')]={'name':{'type':Sequelize[_0x1f06('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x1f06('0x3')]('custom',_0x1f06('0x4'),_0x1f06('0x5'),_0x1f06('0x6'),'quietmp3',_0x1f06('0x7')),'allowNull':!![],'defaultValue':_0x1f06('0x4')},'directory':{'type':Sequelize[_0x1f06('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x1f06('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x1f06('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1f06('0x8')},'format':{'type':Sequelize[_0x1f06('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index 6bf53af..2d72c75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0754=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','error','stack','name','send','VoiceMusicOnHold','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','type','VIRTUAL','merge','findAll','show','length','includeAll','include','options','find','catch','params','body','create','sequelize','transaction','mode','directory','join','root','server/files/moh','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','save_name','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','removeSound','id2','findOne','createdAt','getSounds','eml-format'];(function(_0x59ffd5,_0x179d68){var _0x7a8333=function(_0x16b665){while(--_0x16b665){_0x59ffd5['push'](_0x59ffd5['shift']());}};_0x7a8333(++_0x179d68);}(_0x0754,0x1cb));var _0x4075=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0x0754[_0xce93c];return _0x230720;};'use strict';var emlformat=require(_0x4075('0x0'));var rimraf=require(_0x4075('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4075('0x2'));var rp=require(_0x4075('0x3'));var moment=require(_0x4075('0x4'));var BPromise=require(_0x4075('0x5'));var Mustache=require(_0x4075('0x6'));var util=require(_0x4075('0x7'));var path=require(_0x4075('0x8'));var sox=require(_0x4075('0x9'));var csv=require(_0x4075('0xa'));var ejs=require(_0x4075('0xb'));var fs=require('fs');var fs_extra=require(_0x4075('0xc'));var _=require(_0x4075('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4075('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4075('0xf'));var Papa=require(_0x4075('0x10'));var Redis=require(_0x4075('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4075('0x12'));var hardwareService=require(_0x4075('0x13'));var logger=require(_0x4075('0x14'))(_0x4075('0x15'));var utils=require('../../config/utils');var config=require(_0x4075('0x16'));var licenseUtil=require(_0x4075('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa00b63,_0x439ce5){_0x439ce5=_0x439ce5||0xcc;return function(_0x1fe3ce){if(_0x1fe3ce){return _0xa00b63[_0x4075('0x18')](_0x439ce5);}return _0xa00b63[_0x4075('0x19')](_0x439ce5)[_0x4075('0x1a')]();};}function respondWithResult(_0x40d734,_0x17ae1a){_0x17ae1a=_0x17ae1a||0xc8;return function(_0x47c2e0){if(_0x47c2e0){return _0x40d734[_0x4075('0x19')](_0x17ae1a)[_0x4075('0x1b')](_0x47c2e0);}};}function respondWithFilteredResult(_0x44f858,_0x45c8f5){return function(_0x2923cf){if(_0x2923cf){var _0x4cbe4c=typeof _0x45c8f5[_0x4075('0x1c')]===_0x4075('0x1d')&&typeof _0x45c8f5[_0x4075('0x1e')]===_0x4075('0x1d');var _0x199f05=_0x2923cf[_0x4075('0x1f')];var _0x5825e8=_0x4cbe4c?0x0:_0x45c8f5[_0x4075('0x1c')];var _0x3c6c8e=_0x4cbe4c?_0x2923cf[_0x4075('0x1f')]:_0x45c8f5['offset']+_0x45c8f5[_0x4075('0x1e')];var _0x2d7fc8;if(_0x3c6c8e>=_0x199f05){_0x3c6c8e=_0x199f05;_0x2d7fc8=0xc8;}else{_0x2d7fc8=0xce;}_0x44f858[_0x4075('0x19')](_0x2d7fc8);return _0x44f858[_0x4075('0x20')](_0x4075('0x21'),_0x5825e8+'-'+_0x3c6c8e+'/'+_0x199f05)[_0x4075('0x1b')](_0x2923cf);}return null;};}function patchUpdates(_0x49c662){return function(_0x5c4382){try{jsonpatch[_0x4075('0x22')](_0x5c4382,_0x49c662,!![]);}catch(_0xb676a0){return BPromise[_0x4075('0x23')](_0xb676a0);}return _0x5c4382[_0x4075('0x24')]();};}function saveUpdates(_0x4beaf1,_0x56f05c){return function(_0x3bca53){if(_0x3bca53){return _0x3bca53[_0x4075('0x25')](_0x4beaf1)[_0x4075('0x26')](function(_0x28863c){return _0x28863c;});}return null;};}function removeEntity(_0x3ee647,_0x31e306){return function(_0x32f1b8){if(_0x32f1b8){return _0x32f1b8['destroy']()['then'](function(){var _0x223b47=_0x32f1b8[_0x4075('0x27')]({'plain':!![]});var _0x5f3893=_0x4075('0x28');return db[_0x4075('0x29')]['destroy']({'where':{'type':_0x5f3893,'resourceId':_0x223b47['id']}})['then'](function(){return _0x32f1b8;});})['then'](function(){_0x3ee647[_0x4075('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6650d,_0xa36a80){return function(_0x22c581){if(!_0x22c581){_0xd6650d['sendStatus'](0x194);}return _0x22c581;};}function handleError(_0x3df501,_0x4b567e){_0x4b567e=_0x4b567e||0x1f4;return function(_0x5ab65e){logger[_0x4075('0x2a')](_0x5ab65e[_0x4075('0x2b')]);if(_0x5ab65e[_0x4075('0x2c')]){delete _0x5ab65e[_0x4075('0x2c')];}_0x3df501[_0x4075('0x19')](_0x4b567e)[_0x4075('0x2d')](_0x5ab65e);};}exports['index']=function(_0x23d6ef,_0x4bc2b7){var _0x5d5cf3={},_0x228083={},_0x438b01={'count':0x0,'rows':[]};var _0x3c3596=_['map'](db[_0x4075('0x2e')][_0x4075('0x2f')],function(_0xb04fe1){return{'name':_0xb04fe1[_0x4075('0x30')],'type':_0xb04fe1['type'][_0x4075('0x31')]};});_0x228083['model']=_[_0x4075('0x32')](_0x3c3596,_0x4075('0x2c'));_0x228083[_0x4075('0x33')]=_[_0x4075('0x34')](_0x23d6ef['query']);_0x228083['filters']=_[_0x4075('0x35')](_0x228083[_0x4075('0x36')],_0x228083[_0x4075('0x33')]);_0x5d5cf3['attributes']=_[_0x4075('0x35')](_0x228083[_0x4075('0x36')],qs[_0x4075('0x37')](_0x23d6ef['query'][_0x4075('0x37')]));_0x5d5cf3['attributes']=_0x5d5cf3[_0x4075('0x38')]['length']?_0x5d5cf3[_0x4075('0x38')]:_0x228083[_0x4075('0x36')];if(!_0x23d6ef[_0x4075('0x33')][_0x4075('0x39')](_0x4075('0x3a'))){_0x5d5cf3[_0x4075('0x1e')]=qs[_0x4075('0x1e')](_0x23d6ef[_0x4075('0x33')][_0x4075('0x1e')]);_0x5d5cf3['offset']=qs[_0x4075('0x1c')](_0x23d6ef[_0x4075('0x33')][_0x4075('0x1c')]);}_0x5d5cf3[_0x4075('0x3b')]=qs[_0x4075('0x3c')](_0x23d6ef[_0x4075('0x33')]['sort']);delete _0x23d6ef['query'][_0x4075('0x3c')];_0x5d5cf3['where']=qs['filters'](_[_0x4075('0x3d')](_0x23d6ef['query'],_0x228083[_0x4075('0x3e')]),_0x3c3596);if(_0x23d6ef['query'][_0x4075('0x3f')]){_0x5d5cf3[_0x4075('0x40')]=_['merge'](_0x5d5cf3['where'],{'$or':_[_0x4075('0x32')](_0x3c3596,function(_0x2c6edc){if(_0x2c6edc[_0x4075('0x41')]!==_0x4075('0x42')){var _0x4c3d5c={};_0x4c3d5c[_0x2c6edc[_0x4075('0x2c')]]={'$like':'%'+_0x23d6ef[_0x4075('0x33')][_0x4075('0x3f')]+'%'};return _0x4c3d5c;}})});}_0x5d5cf3=_[_0x4075('0x43')]({},_0x5d5cf3,_0x23d6ef['options']);var _0x1b4a72={'where':_0x5d5cf3[_0x4075('0x40')]};return db['VoiceMusicOnHold'][_0x4075('0x1f')](_0x1b4a72)[_0x4075('0x26')](function(_0x1f99d4){_0x438b01[_0x4075('0x1f')]=_0x1f99d4;if(_0x23d6ef[_0x4075('0x33')]['includeAll']){_0x5d5cf3['include']=[{'all':!![]}];}return db[_0x4075('0x2e')][_0x4075('0x44')](_0x5d5cf3);})[_0x4075('0x26')](function(_0x24453e){_0x438b01['rows']=_0x24453e;return _0x438b01;})[_0x4075('0x26')](respondWithFilteredResult(_0x4bc2b7,_0x5d5cf3))['catch'](handleError(_0x4bc2b7,null));};exports[_0x4075('0x45')]=function(_0x133182,_0x16693f){var _0x170e7d={'raw':![],'where':{'id':_0x133182['params']['id']}},_0x17ac34={};_0x17ac34[_0x4075('0x36')]=_['keys'](db[_0x4075('0x2e')][_0x4075('0x2f')]);_0x17ac34[_0x4075('0x33')]=_['keys'](_0x133182[_0x4075('0x33')]);_0x17ac34[_0x4075('0x3e')]=_[_0x4075('0x35')](_0x17ac34['model'],_0x17ac34[_0x4075('0x33')]);_0x170e7d[_0x4075('0x38')]=_[_0x4075('0x35')](_0x17ac34[_0x4075('0x36')],qs[_0x4075('0x37')](_0x133182[_0x4075('0x33')][_0x4075('0x37')]));_0x170e7d[_0x4075('0x38')]=_0x170e7d[_0x4075('0x38')][_0x4075('0x46')]?_0x170e7d[_0x4075('0x38')]:_0x17ac34[_0x4075('0x36')];if(_0x133182['query'][_0x4075('0x47')]){_0x170e7d[_0x4075('0x48')]=[{'all':!![]}];}_0x170e7d=_[_0x4075('0x43')]({},_0x170e7d,_0x133182[_0x4075('0x49')]);return db[_0x4075('0x2e')][_0x4075('0x4a')](_0x170e7d)['then'](handleEntityNotFound(_0x16693f,null))[_0x4075('0x26')](respondWithResult(_0x16693f,null))[_0x4075('0x4b')](handleError(_0x16693f,null));};exports[_0x4075('0x25')]=function(_0x3429bc,_0x4e27af){if(_0x3429bc['body']['id']){delete _0x3429bc['body']['id'];}return db['VoiceMusicOnHold'][_0x4075('0x4a')]({'where':{'id':_0x3429bc[_0x4075('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e27af,null))[_0x4075('0x26')](saveUpdates(_0x3429bc[_0x4075('0x4d')],null))[_0x4075('0x26')](respondWithResult(_0x4e27af,null))[_0x4075('0x4b')](handleError(_0x4e27af,null));};exports[_0x4075('0x4e')]=function(_0x1e9c3b,_0x4e3cdb,_0x1ad667){return db[_0x4075('0x4f')][_0x4075('0x50')](function(_0x13b007){if(_0x1e9c3b['body'][_0x4075('0x51')]==='files'){_0x1e9c3b['body'][_0x4075('0x52')]=path[_0x4075('0x53')](config[_0x4075('0x54')],_0x4075('0x55'),_0x1e9c3b[_0x4075('0x4d')][_0x4075('0x2c')]);}return db[_0x4075('0x2e')][_0x4075('0x4e')](_0x1e9c3b[_0x4075('0x4d')],{'transaction':_0x13b007})[_0x4075('0x26')](function(_0x2cd48b){if(_0x1e9c3b[_0x4075('0x4d')][_0x4075('0x51')]==='files'){fs['mkdirSync'](_0x2cd48b[_0x4075('0x52')],parseInt(_0x4075('0x56'),0x8));}var _0x158519=_0x1e9c3b['user'][_0x4075('0x27')]({'plain':!![]});if(!_0x158519)throw new Error(_0x4075('0x57'));if(_0x158519[_0x4075('0x58')]===_0x4075('0x59')){var _0x112569=_0x2cd48b[_0x4075('0x27')]({'plain':!![]});return db[_0x4075('0x5a')][_0x4075('0x4a')]({'where':{'name':'MusicOnHolds','userProfileId':_0x158519[_0x4075('0x5b')]},'raw':!![]})[_0x4075('0x26')](function(_0x5c511d){if(_0x5c511d&&_0x5c511d[_0x4075('0x5c')]===0x0){return db[_0x4075('0x29')][_0x4075('0x4e')]({'name':_0x112569[_0x4075('0x2c')],'resourceId':_0x112569['id'],'type':_0x5c511d[_0x4075('0x2c')],'sectionId':_0x5c511d['id']},{})['then'](function(){return _0x2cd48b;});}else{return _0x2cd48b;}})[_0x4075('0x4b')](function(_0x2abdd8){logger[_0x4075('0x2a')](_0x4075('0x5d'),_0x2abdd8);});}return _0x2cd48b;});})[_0x4075('0x26')](respondWithResult(_0x4e3cdb,0xc9))['catch'](handleError(_0x4e3cdb,null));};exports[_0x4075('0x5e')]=function(_0x27f83b,_0xa349f4,_0x40c8af){var _0x4241e9;return db[_0x4075('0x2e')][_0x4075('0x4a')]({'where':{'id':_0x27f83b['params']['id']}})[_0x4075('0x26')](function(_0x159370){if(_0x159370){return db[_0x4075('0x4f')][_0x4075('0x50')](function(_0x417515){return _0x159370['destroy']({'transaction':_0x417515,'raw':!![]})[_0x4075('0x26')](function(_0x4fb029){if(_0x4fb029[_0x4075('0x52')]){fs['readdirSync'](_0x4fb029[_0x4075('0x52')])[_0x4075('0x5f')](function(_0x2d10ba){fs[_0x4075('0x60')](path[_0x4075('0x53')](_0x4fb029[_0x4075('0x52')],_0x2d10ba));});fs['rmdirSync'](_0x4fb029[_0x4075('0x52')]);}return _0x4fb029;});})['catch'](function(_0x1c9b59){throw new db[(_0x4075('0x61'))][(_0x4075('0x62'))](_0x1c9b59[_0x4075('0x63')]);});}})[_0x4075('0x26')](handleEntityNotFound(_0xa349f4,null))[_0x4075('0x26')](removeEntity(_0xa349f4,null))['catch'](handleError(_0xa349f4,null));};exports['addSound']=function(_0x152cd0,_0x360b04,_0x225e17){return db['sequelize'][_0x4075('0x50')](function(_0x461b0d){var _0x5d800a;return db[_0x4075('0x2e')]['find']({'where':{'id':_0x152cd0[_0x4075('0x4c')]['id']}})[_0x4075('0x26')](function(_0x5bde6c){if(_0x5bde6c){_0x5d800a=_0x5bde6c;return _0x5bde6c[_0x4075('0x64')](_0x152cd0[_0x4075('0x4d')]['id'],{'transaction':_0x461b0d});}})[_0x4075('0x26')](function(_0x228b38){if(_0x228b38){return db[_0x4075('0x65')]['findOne']({'where':{'id':_0x152cd0[_0x4075('0x4d')]['id']},'attributes':['id','name',_0x4075('0x66'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x31a1a8){if(_0x31a1a8){var _0x1f7faf=path['join'](config[_0x4075('0x54')],_0x4075('0x67'),util[_0x4075('0x68')](_0x4075('0x69'),path[_0x4075('0x6a')](_0x31a1a8[_0x4075('0x66')],path[_0x4075('0x6b')](_0x31a1a8[_0x4075('0x66')])),_0x31a1a8[_0x4075('0x6c')]));var _0x576d5a=path[_0x4075('0x53')](config[_0x4075('0x54')],'server/files/moh',_0x5d800a[_0x4075('0x2c')],util[_0x4075('0x68')](_0x4075('0x69'),_0x31a1a8['name'],_0x31a1a8['converted_format']));fs[_0x4075('0x6d')](_0x1f7faf,_0x576d5a);return _0x31a1a8;}})['catch'](function(_0x4dc453){throw new db['Sequelize'][(_0x4075('0x62'))](_0x4dc453['message']);});})[_0x4075('0x26')](handleEntityNotFound(_0x360b04,null))[_0x4075('0x26')](respondWithResult(_0x360b04,0xc9))[_0x4075('0x4b')](handleError(_0x360b04,null));};exports['removeSound']=function(_0x412bf1,_0x1dd305,_0x27af00){return db['sequelize'][_0x4075('0x50')](function(_0x53ade2){var _0xb1f41e;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x412bf1[_0x4075('0x4c')]['id']}})[_0x4075('0x26')](handleEntityNotFound(_0x1dd305,null))[_0x4075('0x26')](function(_0x4d93b0){if(_0x4d93b0){_0xb1f41e=_0x4d93b0;return _0x4d93b0[_0x4075('0x6e')](_0x412bf1[_0x4075('0x4c')][_0x4075('0x6f')]);}})['then'](function(_0x350244){if(_0x350244){return db[_0x4075('0x65')][_0x4075('0x70')]({'where':{'id':_0x412bf1[_0x4075('0x4c')][_0x4075('0x6f')]},'attributes':['id',_0x4075('0x2c'),_0x4075('0x66'),_0x4075('0x6c'),_0x4075('0x71')],'raw':!![]});}})[_0x4075('0x26')](function(_0x21b998){if(_0x21b998){fs[_0x4075('0x60')](path['join'](_0xb1f41e['directory'],util[_0x4075('0x68')](_0x4075('0x69'),_0x21b998[_0x4075('0x2c')],_0x21b998[_0x4075('0x6c')])));return _0x21b998;}})[_0x4075('0x4b')](function(_0x2ae792){throw new db[(_0x4075('0x61'))]['ValidationError'](_0x2ae792[_0x4075('0x63')]);});})['then'](handleEntityNotFound(_0x1dd305,null))['then'](respondWithStatusCode(_0x1dd305,0xcc))[_0x4075('0x4b')](handleError(_0x1dd305,null));};exports[_0x4075('0x72')]=function(_0x537369,_0x1b7b42,_0x528b27){var _0x171818={};var _0x43328c={};var _0xef41f7;var _0x1aa66a;return db[_0x4075('0x2e')]['findOne']({'where':{'id':_0x537369[_0x4075('0x4c')]['id']}})[_0x4075('0x26')](handleEntityNotFound(_0x1b7b42,null))[_0x4075('0x26')](function(_0x4858e1){if(_0x4858e1){_0xef41f7=_0x4858e1;_0x43328c['model']=_[_0x4075('0x34')](db['Sound'][_0x4075('0x2f')]);_0x43328c['query']=_[_0x4075('0x34')](_0x537369[_0x4075('0x33')]);_0x43328c[_0x4075('0x3e')]=_[_0x4075('0x35')](_0x43328c[_0x4075('0x36')],_0x43328c[_0x4075('0x33')]);_0x171818['attributes']=_[_0x4075('0x35')](_0x43328c[_0x4075('0x36')],qs[_0x4075('0x37')](_0x537369[_0x4075('0x33')][_0x4075('0x37')]));_0x171818[_0x4075('0x38')]=_0x171818[_0x4075('0x38')][_0x4075('0x46')]?_0x171818[_0x4075('0x38')]:_0x43328c['model'];_0x171818[_0x4075('0x3b')]=qs['sort'](_0x537369[_0x4075('0x33')][_0x4075('0x3c')]);_0x171818['where']=qs[_0x4075('0x3e')](_['pick'](_0x537369[_0x4075('0x33')],_0x43328c[_0x4075('0x3e')]));if(_0x537369[_0x4075('0x33')]['filter']){_0x171818[_0x4075('0x40')]=_[_0x4075('0x43')](_0x171818[_0x4075('0x40')],{'$or':_[_0x4075('0x32')](_0x171818[_0x4075('0x38')],function(_0xd204ea){var _0x13bf9b={};_0x13bf9b[_0xd204ea]={'$like':'%'+_0x537369[_0x4075('0x33')]['filter']+'%'};return _0x13bf9b;})});}_0x171818=_[_0x4075('0x43')]({},_0x171818,_0x537369['options']);return _0xef41f7['getSounds'](_0x171818);}})[_0x4075('0x26')](function(_0xfd7ab5){if(_0xfd7ab5){_0x1aa66a=_0xfd7ab5['length'];if(!_0x537369[_0x4075('0x33')][_0x4075('0x39')]('nolimit')){_0x171818['limit']=qs[_0x4075('0x1e')](_0x537369[_0x4075('0x33')][_0x4075('0x1e')]);_0x171818[_0x4075('0x1c')]=qs[_0x4075('0x1c')](_0x537369[_0x4075('0x33')][_0x4075('0x1c')]);}return _0xef41f7[_0x4075('0x72')](_0x171818);}})['then'](function(_0x15ce76){if(_0x15ce76){return _0x15ce76?{'count':_0x1aa66a,'rows':_0x15ce76}:null;}})[_0x4075('0x26')](respondWithResult(_0x1b7b42,null))[_0x4075('0x4b')](handleError(_0x1b7b42,null));};
\ No newline at end of file
+var _0xcbb7=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','readdirSync','forEach','unlinkSync','ValidationError','message','addSound','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','save_name','extname','format','symlinkSync','Sequelize','removeSound','id2','Sound','getSounds','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','limit','undefined','count','offset','status','apply','reject','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','name','send','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x21eafe,_0x41af5a){var _0x4b3631=function(_0x38975e){while(--_0x38975e){_0x21eafe['push'](_0x21eafe['shift']());}};_0x4b3631(++_0x41af5a);}(_0xcbb7,0xa8));var _0x7cbb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xcbb7[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x7cbb('0x0'));var rimraf=require(_0x7cbb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7cbb('0x2'));var rp=require(_0x7cbb('0x3'));var moment=require(_0x7cbb('0x4'));var BPromise=require(_0x7cbb('0x5'));var Mustache=require(_0x7cbb('0x6'));var util=require(_0x7cbb('0x7'));var path=require(_0x7cbb('0x8'));var sox=require(_0x7cbb('0x9'));var csv=require(_0x7cbb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7cbb('0xb'));var _=require(_0x7cbb('0xc'));var squel=require(_0x7cbb('0xd'));var crypto=require('crypto');var jsforce=require(_0x7cbb('0xe'));var deskjs=require(_0x7cbb('0xf'));var toCsv=require(_0x7cbb('0xa'));var querystring=require(_0x7cbb('0x10'));var Papa=require(_0x7cbb('0x11'));var Redis=require(_0x7cbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7cbb('0x13'));var hardwareService=require(_0x7cbb('0x14'));var logger=require(_0x7cbb('0x15'))(_0x7cbb('0x16'));var utils=require(_0x7cbb('0x17'));var config=require(_0x7cbb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7cbb('0x19'))['db'];function respondWithStatusCode(_0x24b2a8,_0x3d18ff){_0x3d18ff=_0x3d18ff||0xcc;return function(_0x702b5c){if(_0x702b5c){return _0x24b2a8[_0x7cbb('0x1a')](_0x3d18ff);}return _0x24b2a8['status'](_0x3d18ff)['end']();};}function respondWithResult(_0x5ec88f,_0x19bfa3){_0x19bfa3=_0x19bfa3||0xc8;return function(_0x1f36cf){if(_0x1f36cf){return _0x5ec88f['status'](_0x19bfa3)['json'](_0x1f36cf);}};}function respondWithFilteredResult(_0x363714,_0x54a896){return function(_0x3df877){if(_0x3df877){var _0x5119d9=typeof _0x54a896['offset']==='undefined'&&typeof _0x54a896[_0x7cbb('0x1b')]===_0x7cbb('0x1c');var _0x20225f=_0x3df877[_0x7cbb('0x1d')];var _0x7446f8=_0x5119d9?0x0:_0x54a896[_0x7cbb('0x1e')];var _0x4ebb8b=_0x5119d9?_0x3df877[_0x7cbb('0x1d')]:_0x54a896[_0x7cbb('0x1e')]+_0x54a896[_0x7cbb('0x1b')];var _0x2aebb9;if(_0x4ebb8b>=_0x20225f){_0x4ebb8b=_0x20225f;_0x2aebb9=0xc8;}else{_0x2aebb9=0xce;}_0x363714[_0x7cbb('0x1f')](_0x2aebb9);return _0x363714['set']('Content-Range',_0x7446f8+'-'+_0x4ebb8b+'/'+_0x20225f)['json'](_0x3df877);}return null;};}function patchUpdates(_0x18923f){return function(_0x5cdc76){try{jsonpatch[_0x7cbb('0x20')](_0x5cdc76,_0x18923f,!![]);}catch(_0x59e5e8){return BPromise[_0x7cbb('0x21')](_0x59e5e8);}return _0x5cdc76[_0x7cbb('0x22')]();};}function saveUpdates(_0x213f38,_0x2af604){return function(_0x32aa88){if(_0x32aa88){return _0x32aa88[_0x7cbb('0x23')](_0x213f38)['then'](function(_0x11b3f9){return _0x11b3f9;});}return null;};}function removeEntity(_0x309fe4,_0x3ce606){return function(_0x5389a0){if(_0x5389a0){return _0x5389a0[_0x7cbb('0x24')]()[_0x7cbb('0x25')](function(){var _0x550aeb=_0x5389a0[_0x7cbb('0x26')]({'plain':!![]});var _0x44cfb1=_0x7cbb('0x27');return db[_0x7cbb('0x28')]['destroy']({'where':{'type':_0x44cfb1,'resourceId':_0x550aeb['id']}})['then'](function(){return _0x5389a0;});})[_0x7cbb('0x25')](function(){_0x309fe4[_0x7cbb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c45c7,_0x319f75){return function(_0x17458e){if(!_0x17458e){_0x5c45c7[_0x7cbb('0x1a')](0x194);}return _0x17458e;};}function handleError(_0x23421b,_0x12f64f){_0x12f64f=_0x12f64f||0x1f4;return function(_0x138599){logger[_0x7cbb('0x29')](_0x138599['stack']);if(_0x138599['name']){delete _0x138599[_0x7cbb('0x2a')];}_0x23421b[_0x7cbb('0x1f')](_0x12f64f)[_0x7cbb('0x2b')](_0x138599);};}exports['index']=function(_0x51a56a,_0x158963){var _0x126bc6={},_0xb9b42e={},_0x20272c={'count':0x0,'rows':[]};var _0xcd0585=_[_0x7cbb('0x2c')](db[_0x7cbb('0x2d')]['rawAttributes'],function(_0x16bd3a){return{'name':_0x16bd3a[_0x7cbb('0x2e')],'type':_0x16bd3a[_0x7cbb('0x2f')][_0x7cbb('0x30')]};});_0xb9b42e[_0x7cbb('0x31')]=_[_0x7cbb('0x2c')](_0xcd0585,_0x7cbb('0x2a'));_0xb9b42e[_0x7cbb('0x32')]=_[_0x7cbb('0x33')](_0x51a56a[_0x7cbb('0x32')]);_0xb9b42e[_0x7cbb('0x34')]=_[_0x7cbb('0x35')](_0xb9b42e[_0x7cbb('0x31')],_0xb9b42e['query']);_0x126bc6['attributes']=_['intersection'](_0xb9b42e[_0x7cbb('0x31')],qs[_0x7cbb('0x36')](_0x51a56a[_0x7cbb('0x32')]['fields']));_0x126bc6[_0x7cbb('0x37')]=_0x126bc6[_0x7cbb('0x37')][_0x7cbb('0x38')]?_0x126bc6[_0x7cbb('0x37')]:_0xb9b42e[_0x7cbb('0x31')];if(!_0x51a56a['query'][_0x7cbb('0x39')](_0x7cbb('0x3a'))){_0x126bc6[_0x7cbb('0x1b')]=qs['limit'](_0x51a56a[_0x7cbb('0x32')]['limit']);_0x126bc6[_0x7cbb('0x1e')]=qs[_0x7cbb('0x1e')](_0x51a56a[_0x7cbb('0x32')][_0x7cbb('0x1e')]);}_0x126bc6[_0x7cbb('0x3b')]=qs[_0x7cbb('0x3c')](_0x51a56a['query'][_0x7cbb('0x3c')]);delete _0x51a56a[_0x7cbb('0x32')]['sort'];_0x126bc6['where']=qs[_0x7cbb('0x34')](_[_0x7cbb('0x3d')](_0x51a56a[_0x7cbb('0x32')],_0xb9b42e[_0x7cbb('0x34')]),_0xcd0585);if(_0x51a56a['query'][_0x7cbb('0x3e')]){_0x126bc6[_0x7cbb('0x3f')]=_[_0x7cbb('0x40')](_0x126bc6[_0x7cbb('0x3f')],{'$or':_[_0x7cbb('0x2c')](_0xcd0585,function(_0x4f6829){if(_0x4f6829[_0x7cbb('0x2f')]!==_0x7cbb('0x41')){var _0x1af6bd={};_0x1af6bd[_0x4f6829[_0x7cbb('0x2a')]]={'$like':'%'+_0x51a56a[_0x7cbb('0x32')][_0x7cbb('0x3e')]+'%'};return _0x1af6bd;}})});}_0x126bc6=_[_0x7cbb('0x40')]({},_0x126bc6,_0x51a56a[_0x7cbb('0x42')]);var _0x4fee0a={'where':_0x126bc6[_0x7cbb('0x3f')]};return db[_0x7cbb('0x2d')][_0x7cbb('0x1d')](_0x4fee0a)[_0x7cbb('0x25')](function(_0x5454e2){_0x20272c[_0x7cbb('0x1d')]=_0x5454e2;if(_0x51a56a['query'][_0x7cbb('0x43')]){_0x126bc6[_0x7cbb('0x44')]=[{'all':!![]}];}return db[_0x7cbb('0x2d')][_0x7cbb('0x45')](_0x126bc6);})['then'](function(_0x220b8a){_0x20272c[_0x7cbb('0x46')]=_0x220b8a;return _0x20272c;})[_0x7cbb('0x25')](respondWithFilteredResult(_0x158963,_0x126bc6))[_0x7cbb('0x47')](handleError(_0x158963,null));};exports[_0x7cbb('0x48')]=function(_0x2f7162,_0x179aec){var _0xb369ed={'raw':![],'where':{'id':_0x2f7162[_0x7cbb('0x49')]['id']}},_0x57453e={};_0x57453e[_0x7cbb('0x31')]=_['keys'](db[_0x7cbb('0x2d')][_0x7cbb('0x4a')]);_0x57453e[_0x7cbb('0x32')]=_[_0x7cbb('0x33')](_0x2f7162[_0x7cbb('0x32')]);_0x57453e['filters']=_[_0x7cbb('0x35')](_0x57453e[_0x7cbb('0x31')],_0x57453e[_0x7cbb('0x32')]);_0xb369ed[_0x7cbb('0x37')]=_[_0x7cbb('0x35')](_0x57453e[_0x7cbb('0x31')],qs[_0x7cbb('0x36')](_0x2f7162[_0x7cbb('0x32')]['fields']));_0xb369ed[_0x7cbb('0x37')]=_0xb369ed[_0x7cbb('0x37')]['length']?_0xb369ed[_0x7cbb('0x37')]:_0x57453e[_0x7cbb('0x31')];if(_0x2f7162['query'][_0x7cbb('0x43')]){_0xb369ed[_0x7cbb('0x44')]=[{'all':!![]}];}_0xb369ed=_[_0x7cbb('0x40')]({},_0xb369ed,_0x2f7162['options']);return db[_0x7cbb('0x2d')][_0x7cbb('0x4b')](_0xb369ed)[_0x7cbb('0x25')](handleEntityNotFound(_0x179aec,null))['then'](respondWithResult(_0x179aec,null))[_0x7cbb('0x47')](handleError(_0x179aec,null));};exports[_0x7cbb('0x23')]=function(_0x8a9fb6,_0x4f5952){if(_0x8a9fb6['body']['id']){delete _0x8a9fb6[_0x7cbb('0x4c')]['id'];}return db[_0x7cbb('0x2d')][_0x7cbb('0x4b')]({'where':{'id':_0x8a9fb6[_0x7cbb('0x49')]['id']}})[_0x7cbb('0x25')](handleEntityNotFound(_0x4f5952,null))['then'](saveUpdates(_0x8a9fb6[_0x7cbb('0x4c')],null))[_0x7cbb('0x25')](respondWithResult(_0x4f5952,null))[_0x7cbb('0x47')](handleError(_0x4f5952,null));};exports[_0x7cbb('0x4d')]=function(_0x474c1c,_0x3d3535,_0x567a85){return db[_0x7cbb('0x4e')][_0x7cbb('0x4f')](function(_0x20c68c){if(_0x474c1c[_0x7cbb('0x4c')][_0x7cbb('0x50')]===_0x7cbb('0x51')){_0x474c1c[_0x7cbb('0x4c')][_0x7cbb('0x52')]=path[_0x7cbb('0x53')](config[_0x7cbb('0x54')],_0x7cbb('0x55'),_0x474c1c[_0x7cbb('0x4c')][_0x7cbb('0x2a')]);}return db[_0x7cbb('0x2d')][_0x7cbb('0x4d')](_0x474c1c[_0x7cbb('0x4c')],{'transaction':_0x20c68c})[_0x7cbb('0x25')](function(_0xeb4309){if(_0x474c1c[_0x7cbb('0x4c')]['mode']===_0x7cbb('0x51')){fs[_0x7cbb('0x56')](_0xeb4309[_0x7cbb('0x52')],parseInt('0777',0x8));}var _0x198afb=_0x474c1c[_0x7cbb('0x57')][_0x7cbb('0x26')]({'plain':!![]});if(!_0x198afb)throw new Error(_0x7cbb('0x58'));if(_0x198afb[_0x7cbb('0x59')]===_0x7cbb('0x57')){var _0x5b356a=_0xeb4309['get']({'plain':!![]});return db[_0x7cbb('0x5a')]['find']({'where':{'name':_0x7cbb('0x27'),'userProfileId':_0x198afb['userProfileId']},'raw':!![]})['then'](function(_0x50c317){if(_0x50c317&&_0x50c317[_0x7cbb('0x5b')]===0x0){return db[_0x7cbb('0x28')][_0x7cbb('0x4d')]({'name':_0x5b356a[_0x7cbb('0x2a')],'resourceId':_0x5b356a['id'],'type':_0x50c317[_0x7cbb('0x2a')],'sectionId':_0x50c317['id']},{})['then'](function(){return _0xeb4309;});}else{return _0xeb4309;}})['catch'](function(_0x37c14a){logger[_0x7cbb('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37c14a);});}return _0xeb4309;});})[_0x7cbb('0x25')](respondWithResult(_0x3d3535,0xc9))['catch'](handleError(_0x3d3535,null));};exports[_0x7cbb('0x24')]=function(_0x42c80c,_0x4dc8e3,_0x589811){var _0x462124;return db[_0x7cbb('0x2d')]['find']({'where':{'id':_0x42c80c[_0x7cbb('0x49')]['id']}})[_0x7cbb('0x25')](function(_0x3eab9b){if(_0x3eab9b){return db[_0x7cbb('0x4e')]['transaction'](function(_0x156b95){return _0x3eab9b[_0x7cbb('0x24')]({'transaction':_0x156b95,'raw':!![]})[_0x7cbb('0x25')](function(_0x291a16){if(_0x291a16['directory']){fs[_0x7cbb('0x5c')](_0x291a16['directory'])[_0x7cbb('0x5d')](function(_0x10b011){fs[_0x7cbb('0x5e')](path[_0x7cbb('0x53')](_0x291a16['directory'],_0x10b011));});fs['rmdirSync'](_0x291a16['directory']);}return _0x291a16;});})[_0x7cbb('0x47')](function(_0x48f911){throw new db['Sequelize'][(_0x7cbb('0x5f'))](_0x48f911[_0x7cbb('0x60')]);});}})[_0x7cbb('0x25')](handleEntityNotFound(_0x4dc8e3,null))[_0x7cbb('0x25')](removeEntity(_0x4dc8e3,null))[_0x7cbb('0x47')](handleError(_0x4dc8e3,null));};exports[_0x7cbb('0x61')]=function(_0x54c1a6,_0xaa02,_0x10d8b4){return db[_0x7cbb('0x4e')][_0x7cbb('0x4f')](function(_0x53c357){var _0x5b1c52;return db[_0x7cbb('0x2d')][_0x7cbb('0x4b')]({'where':{'id':_0x54c1a6['params']['id']}})[_0x7cbb('0x25')](function(_0x2b916e){if(_0x2b916e){_0x5b1c52=_0x2b916e;return _0x2b916e[_0x7cbb('0x61')](_0x54c1a6[_0x7cbb('0x4c')]['id'],{'transaction':_0x53c357});}})[_0x7cbb('0x25')](function(_0x4d29f9){if(_0x4d29f9){return db['Sound']['findOne']({'where':{'id':_0x54c1a6[_0x7cbb('0x4c')]['id']},'attributes':['id',_0x7cbb('0x2a'),'save_name',_0x7cbb('0x62'),_0x7cbb('0x63')],'raw':!![]});}})[_0x7cbb('0x25')](function(_0x411634){if(_0x411634){var _0xce0d24=path[_0x7cbb('0x53')](config[_0x7cbb('0x54')],_0x7cbb('0x64'),util['format'](_0x7cbb('0x65'),path[_0x7cbb('0x66')](_0x411634[_0x7cbb('0x67')],path[_0x7cbb('0x68')](_0x411634[_0x7cbb('0x67')])),_0x411634['converted_format']));var _0xabfdf6=path[_0x7cbb('0x53')](config[_0x7cbb('0x54')],'server/files/moh',_0x5b1c52[_0x7cbb('0x2a')],util[_0x7cbb('0x69')](_0x7cbb('0x65'),_0x411634[_0x7cbb('0x2a')],_0x411634[_0x7cbb('0x62')]));fs[_0x7cbb('0x6a')](_0xce0d24,_0xabfdf6);return _0x411634;}})[_0x7cbb('0x47')](function(_0xf7d6c6){throw new db[(_0x7cbb('0x6b'))][(_0x7cbb('0x5f'))](_0xf7d6c6[_0x7cbb('0x60')]);});})[_0x7cbb('0x25')](handleEntityNotFound(_0xaa02,null))[_0x7cbb('0x25')](respondWithResult(_0xaa02,0xc9))[_0x7cbb('0x47')](handleError(_0xaa02,null));};exports[_0x7cbb('0x6c')]=function(_0x518a5b,_0xad49f5,_0x45f5cf){return db['sequelize']['transaction'](function(_0x27170a){var _0x158218;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x518a5b['params']['id']}})[_0x7cbb('0x25')](handleEntityNotFound(_0xad49f5,null))[_0x7cbb('0x25')](function(_0x518c5b){if(_0x518c5b){_0x158218=_0x518c5b;return _0x518c5b[_0x7cbb('0x6c')](_0x518a5b['params'][_0x7cbb('0x6d')]);}})[_0x7cbb('0x25')](function(_0x182658){if(_0x182658){return db[_0x7cbb('0x6e')]['findOne']({'where':{'id':_0x518a5b[_0x7cbb('0x49')]['id2']},'attributes':['id',_0x7cbb('0x2a'),_0x7cbb('0x67'),_0x7cbb('0x62'),_0x7cbb('0x63')],'raw':!![]});}})[_0x7cbb('0x25')](function(_0x176d33){if(_0x176d33){fs[_0x7cbb('0x5e')](path[_0x7cbb('0x53')](_0x158218[_0x7cbb('0x52')],util[_0x7cbb('0x69')](_0x7cbb('0x65'),_0x176d33['name'],_0x176d33[_0x7cbb('0x62')])));return _0x176d33;}})[_0x7cbb('0x47')](function(_0x38c285){throw new db['Sequelize'][(_0x7cbb('0x5f'))](_0x38c285['message']);});})[_0x7cbb('0x25')](handleEntityNotFound(_0xad49f5,null))[_0x7cbb('0x25')](respondWithStatusCode(_0xad49f5,0xcc))[_0x7cbb('0x47')](handleError(_0xad49f5,null));};exports[_0x7cbb('0x6f')]=function(_0x200a6c,_0x2b3870,_0x44020e){var _0x516eee={};var _0x8b7d19={};var _0x31f728;var _0x32b8fb;return db[_0x7cbb('0x2d')][_0x7cbb('0x70')]({'where':{'id':_0x200a6c[_0x7cbb('0x49')]['id']}})['then'](handleEntityNotFound(_0x2b3870,null))[_0x7cbb('0x25')](function(_0x4f5794){if(_0x4f5794){_0x31f728=_0x4f5794;_0x8b7d19[_0x7cbb('0x31')]=_['keys'](db[_0x7cbb('0x6e')][_0x7cbb('0x4a')]);_0x8b7d19[_0x7cbb('0x32')]=_[_0x7cbb('0x33')](_0x200a6c[_0x7cbb('0x32')]);_0x8b7d19[_0x7cbb('0x34')]=_[_0x7cbb('0x35')](_0x8b7d19['model'],_0x8b7d19[_0x7cbb('0x32')]);_0x516eee['attributes']=_[_0x7cbb('0x35')](_0x8b7d19[_0x7cbb('0x31')],qs[_0x7cbb('0x36')](_0x200a6c[_0x7cbb('0x32')][_0x7cbb('0x36')]));_0x516eee[_0x7cbb('0x37')]=_0x516eee['attributes'][_0x7cbb('0x38')]?_0x516eee['attributes']:_0x8b7d19['model'];_0x516eee[_0x7cbb('0x3b')]=qs['sort'](_0x200a6c[_0x7cbb('0x32')][_0x7cbb('0x3c')]);_0x516eee[_0x7cbb('0x3f')]=qs[_0x7cbb('0x34')](_[_0x7cbb('0x3d')](_0x200a6c[_0x7cbb('0x32')],_0x8b7d19[_0x7cbb('0x34')]));if(_0x200a6c[_0x7cbb('0x32')][_0x7cbb('0x3e')]){_0x516eee[_0x7cbb('0x3f')]=_[_0x7cbb('0x40')](_0x516eee[_0x7cbb('0x3f')],{'$or':_[_0x7cbb('0x2c')](_0x516eee[_0x7cbb('0x37')],function(_0x17379d){var _0x44fa3={};_0x44fa3[_0x17379d]={'$like':'%'+_0x200a6c[_0x7cbb('0x32')][_0x7cbb('0x3e')]+'%'};return _0x44fa3;})});}_0x516eee=_[_0x7cbb('0x40')]({},_0x516eee,_0x200a6c[_0x7cbb('0x42')]);return _0x31f728['getSounds'](_0x516eee);}})[_0x7cbb('0x25')](function(_0x42190d){if(_0x42190d){_0x32b8fb=_0x42190d[_0x7cbb('0x38')];if(!_0x200a6c['query']['hasOwnProperty'](_0x7cbb('0x3a'))){_0x516eee[_0x7cbb('0x1b')]=qs[_0x7cbb('0x1b')](_0x200a6c[_0x7cbb('0x32')][_0x7cbb('0x1b')]);_0x516eee[_0x7cbb('0x1e')]=qs[_0x7cbb('0x1e')](_0x200a6c[_0x7cbb('0x32')][_0x7cbb('0x1e')]);}return _0x31f728[_0x7cbb('0x6f')](_0x516eee);}})['then'](function(_0x15db9d){if(_0x15db9d){return _0x15db9d?{'count':_0x32b8fb,'rows':_0x15db9d}:null;}})[_0x7cbb('0x25')](respondWithResult(_0x2b3870,null))[_0x7cbb('0x47')](handleError(_0x2b3870,null));};
\ No newline at end of file
index 3c1ae6b..2b8b6f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0de=['request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','moment','bluebird'];(function(_0x5c6d67,_0x538ca5){var _0x486f3f=function(_0x941046){while(--_0x941046){_0x5c6d67['push'](_0x5c6d67['shift']());}};_0x486f3f(++_0x538ca5);}(_0xa0de,0x8b));var _0xea0d=function(_0x454307,_0x4d7229){_0x454307=_0x454307-0x0;var _0x4d7bb8=_0xa0de[_0x454307];return _0x4d7bb8;};'use strict';var _=require('lodash');var util=require(_0xea0d('0x0'));var logger=require(_0xea0d('0x1'))('api');var moment=require(_0xea0d('0x2'));var BPromise=require(_0xea0d('0x3'));var rp=require(_0xea0d('0x4'));var fs=require('fs');var path=require(_0xea0d('0x5'));var rimraf=require('rimraf');var config=require(_0xea0d('0x6'));var attributes=require(_0xea0d('0x7'));module[_0xea0d('0x8')]=function(_0x24eac8,_0x1ff9c5){return _0x24eac8['define'](_0xea0d('0x9'),attributes,{'tableName':_0xea0d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x380d=['bluebird','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x380d,0x165));var _0xd380=function(_0x205c4d,_0x3a2e6d){_0x205c4d=_0x205c4d-0x0;var _0x4a3e0e=_0x380d[_0x205c4d];return _0x4a3e0e;};'use strict';var _=require(_0xd380('0x0'));var util=require(_0xd380('0x1'));var logger=require(_0xd380('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd380('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd380('0x4'));var config=require(_0xd380('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xd380('0x6')]=function(_0x301450,_0x189e11){return _0x301450[_0xd380('0x7')](_0xd380('0x8'),attributes,{'tableName':_0xd380('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4359135..6778145 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2c15a9,_0x4d0749){var _0x46f887=function(_0x1b5473){while(--_0x1b5473){_0x2c15a9['push'](_0x2c15a9['shift']());}};_0x46f887(++_0x4d0749);}(_0x34e8,0x12c));var _0x834e=function(_0xd216a0,_0x4438de){_0xd216a0=_0xd216a0-0x0;var _0x2adb15=_0x34e8[_0xd216a0];return _0x2adb15;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});}
\ No newline at end of file
+var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2a54ce,_0x3d6f76){var _0x4ed5fc=function(_0x1c2195){while(--_0x1c2195){_0x2a54ce['push'](_0x2a54ce['shift']());}};_0x4ed5fc(++_0x3d6f76);}(_0xe706,0xa3));var _0x6e70=function(_0xe6894,_0x5a1755){_0xe6894=_0xe6894-0x0;var _0x4e2ea7=_0xe706[_0xe6894];return _0x4e2ea7;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
index c7f62e0..5d1d831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668e=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getAgents','post','create','addAgents','delete','destroy','/:id/users','removeAgents','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x668e,0x1a3));var _0xe668=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0x668e[_0x168127];return _0x4c99ad;};'use strict';var multer=require(_0xe668('0x0'));var util=require('util');var path=require(_0xe668('0x1'));var timeout=require(_0xe668('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe668('0x3'));var auth=require(_0xe668('0x4'));var interaction=require(_0xe668('0x5'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xe668('0x6')]('/',auth[_0xe668('0x7')](),controller[_0xe668('0x8')]);router[_0xe668('0x6')]('/describe',auth[_0xe668('0x7')](),controller['describe']);router[_0xe668('0x6')](_0xe668('0x9'),auth[_0xe668('0x7')](),controller[_0xe668('0xa')]);router[_0xe668('0x6')]('/:id/users',auth[_0xe668('0x7')](),controller[_0xe668('0xb')]);router[_0xe668('0xc')]('/',auth[_0xe668('0x7')](),controller[_0xe668('0xd')]);router[_0xe668('0xc')]('/:id/users',auth[_0xe668('0x7')](),controller[_0xe668('0xe')]);router['put'](_0xe668('0x9'),auth[_0xe668('0x7')](),controller['update']);router[_0xe668('0xf')](_0xe668('0x9'),auth[_0xe668('0x7')](),controller[_0xe668('0x10')]);router[_0xe668('0xf')](_0xe668('0x11'),auth[_0xe668('0x7')](),controller[_0xe668('0x12')]);module[_0xe668('0x13')]=router;
\ No newline at end of file
+var _0xd4c6=['getAgents','create','post','/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voicePrefix.controller','get','isAuthenticated','index','describe','show','/:id/users'];(function(_0x31692c,_0x29ac68){var _0x1a15df=function(_0x11036f){while(--_0x11036f){_0x31692c['push'](_0x31692c['shift']());}};_0x1a15df(++_0x29ac68);}(_0xd4c6,0x195));var _0x6d4c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4c6[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6d4c('0x0'));var util=require(_0x6d4c('0x1'));var path=require(_0x6d4c('0x2'));var timeout=require(_0x6d4c('0x3'));var express=require(_0x6d4c('0x4'));var router=express[_0x6d4c('0x5')]();var fs_extra=require(_0x6d4c('0x6'));var auth=require(_0x6d4c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d4c('0x8'));router[_0x6d4c('0x9')]('/',auth[_0x6d4c('0xa')](),controller[_0x6d4c('0xb')]);router[_0x6d4c('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6d4c('0xc')]);router[_0x6d4c('0x9')]('/:id',auth[_0x6d4c('0xa')](),controller[_0x6d4c('0xd')]);router[_0x6d4c('0x9')](_0x6d4c('0xe'),auth[_0x6d4c('0xa')](),controller[_0x6d4c('0xf')]);router['post']('/',auth[_0x6d4c('0xa')](),controller[_0x6d4c('0x10')]);router[_0x6d4c('0x11')](_0x6d4c('0xe'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x6d4c('0x12'),auth[_0x6d4c('0xa')](),controller[_0x6d4c('0x13')]);router['delete'](_0x6d4c('0x12'),auth[_0x6d4c('0xa')](),controller['destroy']);router[_0x6d4c('0x14')](_0x6d4c('0xe'),auth[_0x6d4c('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 9e6e87c..f276623 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d69=['exports','STRING','VIRTUAL','system-','getDataValue','name','sequelize'];(function(_0x36970f,_0x49b665){var _0x354efd=function(_0x2a1ff6){while(--_0x2a1ff6){_0x36970f['push'](_0x36970f['shift']());}};_0x354efd(++_0x49b665);}(_0x4d69,0xae));var _0x94d6=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x4d69[_0x1a72f3];return _0x57ef47;};'use strict';var Sequelize=require(_0x94d6('0x0'));module[_0x94d6('0x1')]={'name':{'type':Sequelize[_0x94d6('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x94d6('0x3')],'get':function(_0x535d3e){return _0x94d6('0x4')+this[_0x94d6('0x5')](_0x94d6('0x6'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xccda=['VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x348c13,_0xfd15db){var _0xe34d01=function(_0x248147){while(--_0x248147){_0x348c13['push'](_0x348c13['shift']());}};_0xe34d01(++_0xfd15db);}(_0xccda,0x18c));var _0xaccd=function(_0x5c6469,_0x54afe8){_0x5c6469=_0x5c6469-0x0;var _0x4a85d0=_0xccda[_0x5c6469];return _0x4a85d0;};'use strict';var Sequelize=require(_0xaccd('0x0'));module[_0xaccd('0x1')]={'name':{'type':Sequelize[_0xaccd('0x2')],'allowNull':![],'unique':_0xaccd('0x3')},'prefix':{'type':Sequelize[_0xaccd('0x4')],'get':function(_0x5ee7f6){return _0xaccd('0x5')+this[_0xaccd('0x6')](_0xaccd('0x3'))+'-';}},'description':{'type':Sequelize[_0xaccd('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xaccd('0x7')]}};
\ No newline at end of file
index 3a3c926..471f94d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15b8=['VoicePrefix','fieldName','type','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','describe','sequelize','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','map','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','order','pick','rimraf','zip-dir','fast-json-patch','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','../../config/license/util','defaults','redis','./voicePrefix.socket','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x15b8,0xcd));var _0x815b=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x15b8[_0x45d55e];return _0x29812a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x815b('0x0'));var zipdir=require(_0x815b('0x1'));var jsonpatch=require(_0x815b('0x2'));var rp=require(_0x815b('0x3'));var moment=require(_0x815b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x815b('0x5'));var util=require(_0x815b('0x6'));var path=require(_0x815b('0x7'));var sox=require(_0x815b('0x8'));var csv=require(_0x815b('0x9'));var ejs=require(_0x815b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x815b('0xb'));var squel=require(_0x815b('0xc'));var crypto=require(_0x815b('0xd'));var jsforce=require(_0x815b('0xe'));var deskjs=require(_0x815b('0xf'));var toCsv=require(_0x815b('0x9'));var querystring=require(_0x815b('0x10'));var Papa=require(_0x815b('0x11'));var Redis=require(_0x815b('0x12'));var authService=require(_0x815b('0x13'));var qs=require(_0x815b('0x14'));var as=require(_0x815b('0x15'));var hardwareService=require(_0x815b('0x16'));var logger=require(_0x815b('0x17'))(_0x815b('0x18'));var utils=require(_0x815b('0x19'));var config=require(_0x815b('0x1a'));var licenseUtil=require(_0x815b('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x815b('0x1c')](config[_0x815b('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x815b('0x1e'))['register'](socket);function respondWithStatusCode(_0x5814ee,_0x3dbba1){_0x3dbba1=_0x3dbba1||0xcc;return function(_0xba812b){if(_0xba812b){return _0x5814ee[_0x815b('0x1f')](_0x3dbba1);}return _0x5814ee['status'](_0x3dbba1)['end']();};}function respondWithResult(_0x14f14f,_0xf2d146){_0xf2d146=_0xf2d146||0xc8;return function(_0x3c2a38){if(_0x3c2a38){return _0x14f14f[_0x815b('0x20')](_0xf2d146)[_0x815b('0x21')](_0x3c2a38);}};}function respondWithFilteredResult(_0x114305,_0x58c4c7){return function(_0x92d86a){if(_0x92d86a){var _0x26a8a3=typeof _0x58c4c7[_0x815b('0x22')]===_0x815b('0x23')&&typeof _0x58c4c7[_0x815b('0x24')]===_0x815b('0x23');var _0x4cd48b=_0x92d86a[_0x815b('0x25')];var _0x348faa=_0x26a8a3?0x0:_0x58c4c7[_0x815b('0x22')];var _0x7418d=_0x26a8a3?_0x92d86a[_0x815b('0x25')]:_0x58c4c7['offset']+_0x58c4c7[_0x815b('0x24')];var _0x2f7f8b;if(_0x7418d>=_0x4cd48b){_0x7418d=_0x4cd48b;_0x2f7f8b=0xc8;}else{_0x2f7f8b=0xce;}_0x114305[_0x815b('0x20')](_0x2f7f8b);return _0x114305['set']('Content-Range',_0x348faa+'-'+_0x7418d+'/'+_0x4cd48b)[_0x815b('0x21')](_0x92d86a);}return null;};}function patchUpdates(_0x2923ed){return function(_0x30208e){try{jsonpatch[_0x815b('0x26')](_0x30208e,_0x2923ed,!![]);}catch(_0xe36d21){return BPromise[_0x815b('0x27')](_0xe36d21);}return _0x30208e[_0x815b('0x28')]();};}function saveUpdates(_0x480c89,_0x4a2431){return function(_0x3be736){if(_0x3be736){return _0x3be736[_0x815b('0x29')](_0x480c89)[_0x815b('0x2a')](function(_0x15098a){return _0x15098a;});}return null;};}function removeEntity(_0x1486c6,_0x3115c7){return function(_0x37d3a1){if(_0x37d3a1){return _0x37d3a1[_0x815b('0x2b')]()['then'](function(){var _0x27b4e1=_0x37d3a1[_0x815b('0x2c')]({'plain':!![]});var _0x299898='VoicePrefixes';return db[_0x815b('0x2d')][_0x815b('0x2b')]({'where':{'type':_0x299898,'resourceId':_0x27b4e1['id']}})['then'](function(){return _0x37d3a1;});})[_0x815b('0x2a')](function(){_0x1486c6[_0x815b('0x20')](0xcc)[_0x815b('0x2e')]();});}};}function handleEntityNotFound(_0x3b76d4,_0xb04f){return function(_0x1bc921){if(!_0x1bc921){_0x3b76d4[_0x815b('0x1f')](0x194);}return _0x1bc921;};}function handleError(_0x2c12c3,_0x315d2b){_0x315d2b=_0x315d2b||0x1f4;return function(_0x3f11bd){logger['error'](_0x3f11bd[_0x815b('0x2f')]);if(_0x3f11bd[_0x815b('0x30')]){delete _0x3f11bd[_0x815b('0x30')];}_0x2c12c3[_0x815b('0x20')](_0x315d2b)[_0x815b('0x31')](_0x3f11bd);};}exports[_0x815b('0x32')]=function(_0x55769a,_0xbd756b){var _0x24b181={},_0x20ccca={},_0x40cf32={'count':0x0,'rows':[]};var _0xc2b279=_['map'](db[_0x815b('0x33')]['rawAttributes'],function(_0x20beba){return{'name':_0x20beba[_0x815b('0x34')],'type':_0x20beba[_0x815b('0x35')]['key']};});_0x20ccca[_0x815b('0x36')]=_['map'](_0xc2b279,'name');_0x20ccca['query']=_[_0x815b('0x37')](_0x55769a['query']);_0x20ccca[_0x815b('0x38')]=_['intersection'](_0x20ccca[_0x815b('0x36')],_0x20ccca[_0x815b('0x39')]);_0x24b181['attributes']=_[_0x815b('0x3a')](_0x20ccca['model'],qs['fields'](_0x55769a[_0x815b('0x39')][_0x815b('0x3b')]));_0x24b181[_0x815b('0x3c')]=_0x24b181['attributes'][_0x815b('0x3d')]?_0x24b181[_0x815b('0x3c')]:_0x20ccca[_0x815b('0x36')];if(!_0x55769a['query'][_0x815b('0x3e')](_0x815b('0x3f'))){_0x24b181[_0x815b('0x24')]=qs['limit'](_0x55769a[_0x815b('0x39')][_0x815b('0x24')]);_0x24b181[_0x815b('0x22')]=qs[_0x815b('0x22')](_0x55769a[_0x815b('0x39')]['offset']);}_0x24b181['order']=qs[_0x815b('0x40')](_0x55769a['query']['sort']);_0x24b181[_0x815b('0x41')]=qs[_0x815b('0x38')](_['pick'](_0x55769a[_0x815b('0x39')],_0x20ccca[_0x815b('0x38')]),_0xc2b279);if(_0x55769a[_0x815b('0x39')][_0x815b('0x42')]){_0x24b181[_0x815b('0x41')]=_[_0x815b('0x43')](_0x24b181[_0x815b('0x41')],{'$or':_['map'](_0xc2b279,function(_0x6196d5){if(_0x6196d5[_0x815b('0x35')]!==_0x815b('0x44')){var _0x17f48f={};_0x17f48f[_0x6196d5[_0x815b('0x30')]]={'$like':'%'+_0x55769a[_0x815b('0x39')]['filter']+'%'};return _0x17f48f;}})});}_0x24b181=_[_0x815b('0x43')]({},_0x24b181,_0x55769a[_0x815b('0x45')]);var _0x22d0af={'where':_0x24b181[_0x815b('0x41')]};return db[_0x815b('0x33')]['count'](_0x22d0af)[_0x815b('0x2a')](function(_0x44a8a7){_0x40cf32[_0x815b('0x25')]=_0x44a8a7;if(_0x55769a[_0x815b('0x39')][_0x815b('0x46')]){_0x24b181['include']=[{'all':!![]}];}return db[_0x815b('0x33')][_0x815b('0x47')](_0x24b181);})[_0x815b('0x2a')](function(_0x1071c1){_0x40cf32[_0x815b('0x48')]=_0x1071c1;return _0x40cf32;})[_0x815b('0x2a')](respondWithFilteredResult(_0xbd756b,_0x24b181))[_0x815b('0x49')](handleError(_0xbd756b,null));};exports['show']=function(_0xbd4b25,_0x5b274c){var _0x1a07bf={'raw':![],'where':{'id':_0xbd4b25[_0x815b('0x4a')]['id']}},_0x250e59={};_0x250e59[_0x815b('0x36')]=_[_0x815b('0x37')](db[_0x815b('0x33')][_0x815b('0x4b')]);_0x250e59['query']=_[_0x815b('0x37')](_0xbd4b25[_0x815b('0x39')]);_0x250e59['filters']=_[_0x815b('0x3a')](_0x250e59[_0x815b('0x36')],_0x250e59[_0x815b('0x39')]);_0x1a07bf[_0x815b('0x3c')]=_[_0x815b('0x3a')](_0x250e59[_0x815b('0x36')],qs[_0x815b('0x3b')](_0xbd4b25[_0x815b('0x39')]['fields']));_0x1a07bf[_0x815b('0x3c')]=_0x1a07bf[_0x815b('0x3c')][_0x815b('0x3d')]?_0x1a07bf[_0x815b('0x3c')]:_0x250e59['model'];if(_0xbd4b25[_0x815b('0x39')][_0x815b('0x46')]){_0x1a07bf[_0x815b('0x4c')]=[{'all':!![]}];}_0x1a07bf=_[_0x815b('0x43')]({},_0x1a07bf,_0xbd4b25[_0x815b('0x45')]);return db[_0x815b('0x33')]['find'](_0x1a07bf)[_0x815b('0x2a')](handleEntityNotFound(_0x5b274c,null))[_0x815b('0x2a')](respondWithResult(_0x5b274c,null))[_0x815b('0x49')](handleError(_0x5b274c,null));};exports['destroy']=function(_0x5cd7d8,_0x56e5cb){return db['VoicePrefix'][_0x815b('0x4d')]({'where':{'id':_0x5cd7d8['params']['id']}})[_0x815b('0x2a')](handleEntityNotFound(_0x56e5cb,null))[_0x815b('0x2a')](removeEntity(_0x56e5cb,null))['catch'](handleError(_0x56e5cb,null));};exports[_0x815b('0x4e')]=function(_0x1d7b63,_0x1ad9ea){return db[_0x815b('0x33')][_0x815b('0x4e')]()[_0x815b('0x2a')](respondWithResult(_0x1ad9ea,null))[_0x815b('0x49')](handleError(_0x1ad9ea,null));};exports['create']=function(_0x266803,_0x2b6f71){var _0x3c9c87;return db[_0x815b('0x4f')]['transaction'](function(_0x991211){return db[_0x815b('0x33')][_0x815b('0x50')](_0x266803[_0x815b('0x51')],{'transaction':_0x991211})[_0x815b('0x2a')](function(_0x5039fe){_0x3c9c87=_0x5039fe['get']({'plain':!![]});return db['VoiceExtension'][_0x815b('0x4d')]({'where':{'id':_0x3c9c87['VoiceExtensionId']},'raw':!![]})['then'](function(_0x5103aa){return createVoicePrefixExtensions(_0x3c9c87,_0x5103aa,_0x991211);});});})[_0x815b('0x2a')](function(){var _0x1edd76=_0x266803[_0x815b('0x52')][_0x815b('0x2c')]({'plain':!![]});if(!_0x1edd76)throw new Error(_0x815b('0x53'));if(_0x1edd76[_0x815b('0x54')]==='user'){var _0x28bdf6=_0x3c9c87;return db[_0x815b('0x55')][_0x815b('0x4d')]({'where':{'name':_0x815b('0x56'),'userProfileId':_0x1edd76['userProfileId']},'raw':!![]})[_0x815b('0x2a')](function(_0x5b2404){if(_0x5b2404&&_0x5b2404[_0x815b('0x57')]===0x0){return db[_0x815b('0x2d')]['create']({'name':_0x28bdf6[_0x815b('0x30')],'resourceId':_0x28bdf6['id'],'type':_0x5b2404[_0x815b('0x30')],'sectionId':_0x5b2404['id']},{})[_0x815b('0x2a')](function(){return _0x3c9c87;});}else{return _0x3c9c87;}})[_0x815b('0x49')](function(_0x3ecbf2){logger['error'](_0x815b('0x58'),_0x3ecbf2);throw _0x3ecbf2;});}return _0x3c9c87;})[_0x815b('0x2a')](respondWithResult(_0x2b6f71,null))[_0x815b('0x49')](handleError(_0x2b6f71,null));};function Extension(_0x162723,_0x39c780,_0x122bba,_0x3ba48a){this[_0x815b('0x59')]=_0x815b('0x5a');this[_0x815b('0x5b')]=_0x162723;this[_0x815b('0x5c')]=_0x122bba;this[_0x815b('0x35')]=_0x815b('0x5d');this[_0x815b('0x5e')]=_0x815b('0x5f');this[_0x815b('0x60')]=_0x39c780;this['appdata']=_0x3ba48a;}function createVoicePrefixExtensions(_0xa7f471,_0x20aa2c,_0x59391e){return new BPromise(function(_0x29c6bd,_0x11e84e){var _0x353598=new Extension(formatPrefixName(_0xa7f471['prefix']),0x1,_0x815b('0x61'),_0x815b('0x62'));_0x353598[_0x815b('0x63')]=_0xa7f471['id'];return db[_0x815b('0x64')]['create'](_0x353598,{'transaction':_0x59391e})['then'](function(_0x27fff5){var _0x2704e7=_0x27fff5[_0x815b('0x2c')]({'plain':!![]});var _0x29c3f1=_[_0x815b('0x65')](addVoicePrefixExtensions(_0xa7f471,_0x20aa2c),function(_0x5c3f16){_0x5c3f16[_0x815b('0x66')]=_0x2704e7['id'];_0x5c3f16[_0x815b('0x63')]=_0xa7f471['id'];return _0x5c3f16;});return db[_0x815b('0x64')][_0x815b('0x67')](_0x29c3f1,{'transaction':_0x59391e})[_0x815b('0x2a')](function(_0x3c5427){if(!_0x3c5427){return _0x11e84e(_0x815b('0x68'));}else{return _0x29c6bd(_0x3c5427);}})[_0x815b('0x49')](function(_0x4aa550){return _0x11e84e(_0x4aa550);});});;});};function addVoicePrefixExtensions(_0x4a1172,_0x34a7a0){var _0x477d66=[];var _0x1080de=formatPrefixName(_0x4a1172[_0x815b('0x69')]);_0x477d66[_0x815b('0x6a')](new Extension(_0x1080de,0x2,_0x815b('0x6b'),_0x815b('0x6c')+_0x4a1172[_0x815b('0x30')]));if(_0x4a1172[_0x815b('0x6d')]){_0x477d66[_0x815b('0x6a')](new Extension(_0x1080de,0x3,_0x815b('0x6b'),_0x815b('0x6e')+_0x4a1172['callerIdAll']));}else{_0x477d66[_0x815b('0x6a')](new Extension(_0x1080de,0x3,_0x815b('0x61'),'No\x20callerid\x20available'));}_0x477d66[_0x815b('0x6a')](new Extension(_0x1080de,0x4,'goto',_0x34a7a0[_0x815b('0x59')]+','+_0x815b('0x6f')+(0x8+_0x4a1172[_0x815b('0x30')][_0x815b('0x3d')])+'}'+','+0x1));return _0x477d66;}function formatPrefixName(_0x53a323){var _0xb17ffe='_';for(var _0x31aa10=0x0;_0x31aa10<_0x53a323[_0x815b('0x3d')];_0x31aa10++){if(_0x53a323[_0x815b('0x70')](_0x31aa10)=='-'){_0xb17ffe+=_0x53a323[_0x815b('0x70')](_0x31aa10);}else{_0xb17ffe+='['+_0x53a323[_0x815b('0x70')](_0x31aa10)+']';}}_0xb17ffe+='.';return _0xb17ffe;}exports[_0x815b('0x29')]=function(_0x1f988a,_0x2086ce,_0x2dded0){var _0xfa5eef=_0x1f988a[_0x815b('0x51')];_0xfa5eef[_0x815b('0x69')]=_0x815b('0x71')+_0xfa5eef[_0x815b('0x30')]+'-';return db[_0x815b('0x4f')][_0x815b('0x72')](function(_0x222a3c){return db[_0x815b('0x33')]['update'](_0xfa5eef,{'where':{'id':_0xfa5eef['id']},'transaction':_0x222a3c})[_0x815b('0x2a')](function(){return db[_0x815b('0x64')]['destroy']({'where':{'VoicePrefixId':_0xfa5eef['id']},'transaction':_0x222a3c})[_0x815b('0x2a')](function(){return db['VoiceExtension'][_0x815b('0x4d')]({'where':{'id':_0xfa5eef[_0x815b('0x66')]},'raw':!![]})[_0x815b('0x2a')](function(_0x1906fc){return createVoicePrefixExtensions(_0xfa5eef,_0x1906fc,_0x222a3c);});});});})[_0x815b('0x2a')](function(){return db[_0x815b('0x33')][_0x815b('0x73')](_0xfa5eef['id']);})[_0x815b('0x2a')](respondWithResult(_0x2086ce,null))[_0x815b('0x49')](handleError(_0x2086ce,null));};exports[_0x815b('0x74')]=function(_0x5efad5,_0x13d829,_0x29681f){return db['VoicePrefix'][_0x815b('0x4d')]({'where':{'id':_0x5efad5[_0x815b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x13d829,null))[_0x815b('0x2a')](function(_0x59c9d3){if(_0x59c9d3){return _0x59c9d3['addAgents'](_0x5efad5[_0x815b('0x51')][_0x815b('0x75')],_['omit'](_0x5efad5[_0x815b('0x51')],[_0x815b('0x75'),'id'])||{})[_0x815b('0x76')](function(_0x357487){for(var _0x505730=0x0;_0x505730<_0x5efad5[_0x815b('0x51')][_0x815b('0x75')]['length'];_0x505730+=0x1){socket['emit'](_0x815b('0x77'),{'UserId':Number(_0x5efad5[_0x815b('0x51')][_0x815b('0x75')][_0x505730]),'VoicePrefixId':Number(_0x5efad5[_0x815b('0x4a')]['id'])});}return _0x357487;});}})[_0x815b('0x2a')](respondWithResult(_0x13d829,null))[_0x815b('0x49')](handleError(_0x13d829,null));};exports[_0x815b('0x78')]=function(_0x264d22,_0x4b00f6,_0x591dc7){return db[_0x815b('0x33')][_0x815b('0x4d')]({'where':{'id':_0x264d22[_0x815b('0x4a')]['id']}})[_0x815b('0x2a')](handleEntityNotFound(_0x4b00f6,null))[_0x815b('0x2a')](function(_0x44cb27){if(_0x44cb27){return _0x44cb27[_0x815b('0x78')](_0x264d22[_0x815b('0x39')]['ids'])[_0x815b('0x2a')](function(){if(_[_0x815b('0x79')](_0x264d22['query']['ids'])){for(var _0x4fceef=0x0;_0x4fceef<_0x264d22[_0x815b('0x39')][_0x815b('0x75')]['length'];_0x4fceef+=0x1){socket[_0x815b('0x7a')](_0x815b('0x7b'),{'UserId':Number(_0x264d22[_0x815b('0x39')][_0x815b('0x75')][_0x4fceef]),'VoicePrefixId':Number(_0x264d22[_0x815b('0x4a')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x264d22[_0x815b('0x39')][_0x815b('0x75')]),'VoicePrefixId':Number(_0x264d22[_0x815b('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x4b00f6,null))[_0x815b('0x49')](handleError(_0x4b00f6,null));};exports[_0x815b('0x7c')]=function(_0x1bdf4e,_0x235423,_0x3f174a){var _0x5380c9={};var _0x460b1d={};var _0x59cf5a;var _0x297606;return db[_0x815b('0x33')][_0x815b('0x7d')]({'where':{'id':_0x1bdf4e['params']['id']}})['then'](handleEntityNotFound(_0x235423,null))[_0x815b('0x2a')](function(_0x2b48ce){if(_0x2b48ce){_0x59cf5a=_0x2b48ce;_0x460b1d['model']=_[_0x815b('0x37')](db['User'][_0x815b('0x4b')]);_0x460b1d['query']=_[_0x815b('0x37')](_0x1bdf4e[_0x815b('0x39')]);_0x460b1d[_0x815b('0x38')]=_[_0x815b('0x3a')](_0x460b1d['model'],_0x460b1d[_0x815b('0x39')]);_0x5380c9['attributes']=_['intersection'](_0x460b1d[_0x815b('0x36')],qs[_0x815b('0x3b')](_0x1bdf4e[_0x815b('0x39')][_0x815b('0x3b')]));_0x5380c9[_0x815b('0x3c')]=_0x5380c9[_0x815b('0x3c')]['length']?_0x5380c9[_0x815b('0x3c')]:_0x460b1d[_0x815b('0x36')];_0x5380c9[_0x815b('0x7e')]=qs['sort'](_0x1bdf4e[_0x815b('0x39')]['sort']);_0x5380c9['where']=qs[_0x815b('0x38')](_[_0x815b('0x7f')](_0x1bdf4e['query'],_0x460b1d[_0x815b('0x38')]));if(_0x1bdf4e[_0x815b('0x39')][_0x815b('0x42')]){_0x5380c9[_0x815b('0x41')]=_['merge'](_0x5380c9[_0x815b('0x41')],{'$or':_[_0x815b('0x65')](_0x5380c9[_0x815b('0x3c')],function(_0x258536){var _0x4a6926={};_0x4a6926[_0x258536]={'$like':'%'+_0x1bdf4e[_0x815b('0x39')][_0x815b('0x42')]+'%'};return _0x4a6926;})});}_0x5380c9=_['merge']({},_0x5380c9,_0x1bdf4e[_0x815b('0x45')]);return _0x59cf5a[_0x815b('0x7c')](_0x5380c9);}})['then'](function(_0x118434){if(_0x118434){_0x297606=_0x118434[_0x815b('0x3d')];if(!_0x1bdf4e['query']['hasOwnProperty'](_0x815b('0x3f'))){_0x5380c9['limit']=qs[_0x815b('0x24')](_0x1bdf4e['query'][_0x815b('0x24')]);_0x5380c9[_0x815b('0x22')]=qs[_0x815b('0x22')](_0x1bdf4e[_0x815b('0x39')][_0x815b('0x22')]);}return _0x59cf5a[_0x815b('0x7c')](_0x5380c9);}})[_0x815b('0x2a')](function(_0x2a7eea){if(_0x2a7eea){return _0x2a7eea?{'count':_0x297606,'rows':_0x2a7eea}:null;}})[_0x815b('0x2a')](respondWithResult(_0x235423,null))[_0x815b('0x49')](handleError(_0x235423,null));};
\ No newline at end of file
+var _0x30c7=['CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','update','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','getAgents','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','ejs','fs-extra','squel','crypto','jsforce','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','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','VoicePrefixes','UserProfileResource','destroy','end','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','get','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x30c7,0x111));var _0x730c=function(_0x3f37f1,_0x50041e){_0x3f37f1=_0x3f37f1-0x0;var _0x33472d=_0x30c7[_0x3f37f1];return _0x33472d;};'use strict';var emlformat=require(_0x730c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x730c('0x1'));var jsonpatch=require(_0x730c('0x2'));var rp=require(_0x730c('0x3'));var moment=require('moment');var BPromise=require(_0x730c('0x4'));var Mustache=require(_0x730c('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x730c('0x6'));var fs=require('fs');var fs_extra=require(_0x730c('0x7'));var _=require('lodash');var squel=require(_0x730c('0x8'));var crypto=require(_0x730c('0x9'));var jsforce=require(_0x730c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x730c('0xb'));var querystring=require(_0x730c('0xc'));var Papa=require('papaparse');var Redis=require(_0x730c('0xd'));var authService=require(_0x730c('0xe'));var qs=require(_0x730c('0xf'));var as=require(_0x730c('0x10'));var hardwareService=require(_0x730c('0x11'));var logger=require(_0x730c('0x12'))(_0x730c('0x13'));var utils=require('../../config/utils');var config=require(_0x730c('0x14'));var licenseUtil=require(_0x730c('0x15'));var db=require(_0x730c('0x16'))['db'];config[_0x730c('0x17')]=_['defaults'](config[_0x730c('0x17')],{'host':_0x730c('0x18'),'port':0x18eb});var socket=require(_0x730c('0x19'))(new Redis(config[_0x730c('0x17')]));require(_0x730c('0x1a'))[_0x730c('0x1b')](socket);function respondWithStatusCode(_0x419b7b,_0x342f90){_0x342f90=_0x342f90||0xcc;return function(_0x1bb9d7){if(_0x1bb9d7){return _0x419b7b[_0x730c('0x1c')](_0x342f90);}return _0x419b7b[_0x730c('0x1d')](_0x342f90)['end']();};}function respondWithResult(_0x55e11c,_0x4f9f2c){_0x4f9f2c=_0x4f9f2c||0xc8;return function(_0x35f1bd){if(_0x35f1bd){return _0x55e11c[_0x730c('0x1d')](_0x4f9f2c)[_0x730c('0x1e')](_0x35f1bd);}};}function respondWithFilteredResult(_0xa7a352,_0x5800d7){return function(_0x3b3fda){if(_0x3b3fda){var _0x39a2be=typeof _0x5800d7[_0x730c('0x1f')]===_0x730c('0x20')&&typeof _0x5800d7[_0x730c('0x21')]===_0x730c('0x20');var _0x2fe217=_0x3b3fda[_0x730c('0x22')];var _0x1349c3=_0x39a2be?0x0:_0x5800d7[_0x730c('0x1f')];var _0x5e9806=_0x39a2be?_0x3b3fda[_0x730c('0x22')]:_0x5800d7[_0x730c('0x1f')]+_0x5800d7[_0x730c('0x21')];var _0x2cc248;if(_0x5e9806>=_0x2fe217){_0x5e9806=_0x2fe217;_0x2cc248=0xc8;}else{_0x2cc248=0xce;}_0xa7a352[_0x730c('0x1d')](_0x2cc248);return _0xa7a352[_0x730c('0x23')]('Content-Range',_0x1349c3+'-'+_0x5e9806+'/'+_0x2fe217)[_0x730c('0x1e')](_0x3b3fda);}return null;};}function patchUpdates(_0x1e87e3){return function(_0x2d4dfb){try{jsonpatch[_0x730c('0x24')](_0x2d4dfb,_0x1e87e3,!![]);}catch(_0x2d0850){return BPromise[_0x730c('0x25')](_0x2d0850);}return _0x2d4dfb[_0x730c('0x26')]();};}function saveUpdates(_0x1d6c33,_0x5520d0){return function(_0x4a104b){if(_0x4a104b){return _0x4a104b['update'](_0x1d6c33)[_0x730c('0x27')](function(_0xea1cfd){return _0xea1cfd;});}return null;};}function removeEntity(_0x1d8bf8,_0x26a58c){return function(_0x2c0cb3){if(_0x2c0cb3){return _0x2c0cb3['destroy']()['then'](function(){var _0x984a84=_0x2c0cb3['get']({'plain':!![]});var _0x58290c=_0x730c('0x28');return db[_0x730c('0x29')][_0x730c('0x2a')]({'where':{'type':_0x58290c,'resourceId':_0x984a84['id']}})[_0x730c('0x27')](function(){return _0x2c0cb3;});})['then'](function(){_0x1d8bf8[_0x730c('0x1d')](0xcc)[_0x730c('0x2b')]();});}};}function handleEntityNotFound(_0x1f988a,_0x3fdb87){return function(_0x14425e){if(!_0x14425e){_0x1f988a[_0x730c('0x1c')](0x194);}return _0x14425e;};}function handleError(_0x652b0e,_0x2ae689){_0x2ae689=_0x2ae689||0x1f4;return function(_0x13d446){logger[_0x730c('0x2c')](_0x13d446[_0x730c('0x2d')]);if(_0x13d446['name']){delete _0x13d446[_0x730c('0x2e')];}_0x652b0e['status'](_0x2ae689)[_0x730c('0x2f')](_0x13d446);};}exports[_0x730c('0x30')]=function(_0x55df01,_0x4cf98b){var _0x304c5f={},_0x23026f={},_0x33a6b0={'count':0x0,'rows':[]};var _0xfb277f=_[_0x730c('0x31')](db[_0x730c('0x32')][_0x730c('0x33')],function(_0x56114b){return{'name':_0x56114b[_0x730c('0x34')],'type':_0x56114b[_0x730c('0x35')][_0x730c('0x36')]};});_0x23026f[_0x730c('0x37')]=_['map'](_0xfb277f,_0x730c('0x2e'));_0x23026f[_0x730c('0x38')]=_['keys'](_0x55df01[_0x730c('0x38')]);_0x23026f[_0x730c('0x39')]=_[_0x730c('0x3a')](_0x23026f['model'],_0x23026f[_0x730c('0x38')]);_0x304c5f[_0x730c('0x3b')]=_[_0x730c('0x3a')](_0x23026f['model'],qs['fields'](_0x55df01[_0x730c('0x38')][_0x730c('0x3c')]));_0x304c5f['attributes']=_0x304c5f[_0x730c('0x3b')][_0x730c('0x3d')]?_0x304c5f[_0x730c('0x3b')]:_0x23026f[_0x730c('0x37')];if(!_0x55df01[_0x730c('0x38')][_0x730c('0x3e')]('nolimit')){_0x304c5f['limit']=qs[_0x730c('0x21')](_0x55df01['query'][_0x730c('0x21')]);_0x304c5f[_0x730c('0x1f')]=qs[_0x730c('0x1f')](_0x55df01['query'][_0x730c('0x1f')]);}_0x304c5f[_0x730c('0x3f')]=qs[_0x730c('0x40')](_0x55df01[_0x730c('0x38')]['sort']);_0x304c5f[_0x730c('0x41')]=qs[_0x730c('0x39')](_[_0x730c('0x42')](_0x55df01['query'],_0x23026f[_0x730c('0x39')]),_0xfb277f);if(_0x55df01[_0x730c('0x38')][_0x730c('0x43')]){_0x304c5f['where']=_[_0x730c('0x44')](_0x304c5f[_0x730c('0x41')],{'$or':_[_0x730c('0x31')](_0xfb277f,function(_0x13e649){if(_0x13e649[_0x730c('0x35')]!==_0x730c('0x45')){var _0x2d7cd3={};_0x2d7cd3[_0x13e649['name']]={'$like':'%'+_0x55df01[_0x730c('0x38')][_0x730c('0x43')]+'%'};return _0x2d7cd3;}})});}_0x304c5f=_[_0x730c('0x44')]({},_0x304c5f,_0x55df01[_0x730c('0x46')]);var _0x49fb2d={'where':_0x304c5f[_0x730c('0x41')]};return db['VoicePrefix']['count'](_0x49fb2d)[_0x730c('0x27')](function(_0x37371e){_0x33a6b0[_0x730c('0x22')]=_0x37371e;if(_0x55df01['query']['includeAll']){_0x304c5f[_0x730c('0x47')]=[{'all':!![]}];}return db[_0x730c('0x32')][_0x730c('0x48')](_0x304c5f);})[_0x730c('0x27')](function(_0x301aa2){_0x33a6b0[_0x730c('0x49')]=_0x301aa2;return _0x33a6b0;})[_0x730c('0x27')](respondWithFilteredResult(_0x4cf98b,_0x304c5f))[_0x730c('0x4a')](handleError(_0x4cf98b,null));};exports[_0x730c('0x4b')]=function(_0xfcbd86,_0x5d4211){var _0x1f8df9={'raw':![],'where':{'id':_0xfcbd86[_0x730c('0x4c')]['id']}},_0x58479e={};_0x58479e['model']=_[_0x730c('0x4d')](db[_0x730c('0x32')][_0x730c('0x33')]);_0x58479e[_0x730c('0x38')]=_[_0x730c('0x4d')](_0xfcbd86[_0x730c('0x38')]);_0x58479e[_0x730c('0x39')]=_[_0x730c('0x3a')](_0x58479e[_0x730c('0x37')],_0x58479e[_0x730c('0x38')]);_0x1f8df9[_0x730c('0x3b')]=_[_0x730c('0x3a')](_0x58479e[_0x730c('0x37')],qs[_0x730c('0x3c')](_0xfcbd86[_0x730c('0x38')][_0x730c('0x3c')]));_0x1f8df9[_0x730c('0x3b')]=_0x1f8df9[_0x730c('0x3b')]['length']?_0x1f8df9[_0x730c('0x3b')]:_0x58479e[_0x730c('0x37')];if(_0xfcbd86[_0x730c('0x38')]['includeAll']){_0x1f8df9[_0x730c('0x47')]=[{'all':!![]}];}_0x1f8df9=_[_0x730c('0x44')]({},_0x1f8df9,_0xfcbd86[_0x730c('0x46')]);return db[_0x730c('0x32')][_0x730c('0x4e')](_0x1f8df9)[_0x730c('0x27')](handleEntityNotFound(_0x5d4211,null))[_0x730c('0x27')](respondWithResult(_0x5d4211,null))[_0x730c('0x4a')](handleError(_0x5d4211,null));};exports[_0x730c('0x2a')]=function(_0x591545,_0x324cab){return db[_0x730c('0x32')]['find']({'where':{'id':_0x591545[_0x730c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x324cab,null))[_0x730c('0x27')](removeEntity(_0x324cab,null))[_0x730c('0x4a')](handleError(_0x324cab,null));};exports[_0x730c('0x4f')]=function(_0x166c29,_0x3dc0c8){return db[_0x730c('0x32')][_0x730c('0x4f')]()['then'](respondWithResult(_0x3dc0c8,null))[_0x730c('0x4a')](handleError(_0x3dc0c8,null));};exports[_0x730c('0x50')]=function(_0x26b846,_0x7ccaf7){var _0x204871;return db[_0x730c('0x51')]['transaction'](function(_0x49e410){return db[_0x730c('0x32')][_0x730c('0x50')](_0x26b846[_0x730c('0x52')],{'transaction':_0x49e410})[_0x730c('0x27')](function(_0x4461d2){_0x204871=_0x4461d2['get']({'plain':!![]});return db[_0x730c('0x53')][_0x730c('0x4e')]({'where':{'id':_0x204871[_0x730c('0x54')]},'raw':!![]})['then'](function(_0x374bf5){return createVoicePrefixExtensions(_0x204871,_0x374bf5,_0x49e410);});});})[_0x730c('0x27')](function(){var _0x34cfbb=_0x26b846['user'][_0x730c('0x55')]({'plain':!![]});if(!_0x34cfbb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34cfbb['role']===_0x730c('0x56')){var _0x3b2fa2=_0x204871;return db['UserProfileSection'][_0x730c('0x4e')]({'where':{'name':_0x730c('0x28'),'userProfileId':_0x34cfbb[_0x730c('0x57')]},'raw':!![]})[_0x730c('0x27')](function(_0x210ec3){if(_0x210ec3&&_0x210ec3[_0x730c('0x58')]===0x0){return db[_0x730c('0x29')]['create']({'name':_0x3b2fa2[_0x730c('0x2e')],'resourceId':_0x3b2fa2['id'],'type':_0x210ec3[_0x730c('0x2e')],'sectionId':_0x210ec3['id']},{})[_0x730c('0x27')](function(){return _0x204871;});}else{return _0x204871;}})[_0x730c('0x4a')](function(_0x255282){logger[_0x730c('0x2c')](_0x730c('0x59'),_0x255282);throw _0x255282;});}return _0x204871;})['then'](respondWithResult(_0x7ccaf7,null))['catch'](handleError(_0x7ccaf7,null));};function Extension(_0x499793,_0x482214,_0x1bf9b2,_0x1e0563){this[_0x730c('0x5a')]='from-sip';this['exten']=_0x499793;this['app']=_0x1bf9b2;this[_0x730c('0x35')]=_0x730c('0x5b');this[_0x730c('0x5c')]='Voice\x20Prefix\x20Extension';this[_0x730c('0x5d')]=_0x482214;this[_0x730c('0x5e')]=_0x1e0563;}function createVoicePrefixExtensions(_0x10d58e,_0xa7aaeb,_0x17a63e){return new BPromise(function(_0x15ca49,_0x381096){var _0x47f427=new Extension(formatPrefixName(_0x10d58e[_0x730c('0x5f')]),0x1,_0x730c('0x60'),_0x730c('0x61'));_0x47f427[_0x730c('0x62')]=_0x10d58e['id'];return db[_0x730c('0x53')][_0x730c('0x50')](_0x47f427,{'transaction':_0x17a63e})[_0x730c('0x27')](function(_0x38c6f3){var _0x5b0f96=_0x38c6f3['get']({'plain':!![]});var _0x3a630b=_[_0x730c('0x31')](addVoicePrefixExtensions(_0x10d58e,_0xa7aaeb),function(_0x281fe1){_0x281fe1[_0x730c('0x54')]=_0x5b0f96['id'];_0x281fe1[_0x730c('0x62')]=_0x10d58e['id'];return _0x281fe1;});return db[_0x730c('0x53')][_0x730c('0x63')](_0x3a630b,{'transaction':_0x17a63e})[_0x730c('0x27')](function(_0x2a650b){if(!_0x2a650b){return _0x381096(_0x730c('0x64'));}else{return _0x15ca49(_0x2a650b);}})[_0x730c('0x4a')](function(_0x5539f7){return _0x381096(_0x5539f7);});});;});};function addVoicePrefixExtensions(_0x1aed19,_0x952a4b){var _0x253645=[];var _0x1d36b7=formatPrefixName(_0x1aed19[_0x730c('0x5f')]);_0x253645[_0x730c('0x65')](new Extension(_0x1d36b7,0x2,'Set',_0x730c('0x66')+_0x1aed19['name']));if(_0x1aed19[_0x730c('0x67')]){_0x253645['push'](new Extension(_0x1d36b7,0x3,_0x730c('0x68'),_0x730c('0x69')+_0x1aed19['callerIdAll']));}else{_0x253645[_0x730c('0x65')](new Extension(_0x1d36b7,0x3,_0x730c('0x60'),_0x730c('0x6a')));}_0x253645[_0x730c('0x65')](new Extension(_0x1d36b7,0x4,'goto',_0x952a4b[_0x730c('0x5a')]+','+_0x730c('0x6b')+(0x8+_0x1aed19['name'][_0x730c('0x3d')])+'}'+','+0x1));return _0x253645;}function formatPrefixName(_0x444863){var _0x15e662='_';for(var _0x1c3718=0x0;_0x1c3718<_0x444863[_0x730c('0x3d')];_0x1c3718++){if(_0x444863['charAt'](_0x1c3718)=='-'){_0x15e662+=_0x444863[_0x730c('0x6c')](_0x1c3718);}else{_0x15e662+='['+_0x444863[_0x730c('0x6c')](_0x1c3718)+']';}}_0x15e662+='.';return _0x15e662;}exports['update']=function(_0x353547,_0x212505,_0x911071){var _0x32d4e8=_0x353547[_0x730c('0x52')];_0x32d4e8[_0x730c('0x5f')]=_0x730c('0x6d')+_0x32d4e8[_0x730c('0x2e')]+'-';return db[_0x730c('0x51')][_0x730c('0x6e')](function(_0x3b02b3){return db[_0x730c('0x32')][_0x730c('0x6f')](_0x32d4e8,{'where':{'id':_0x32d4e8['id']},'transaction':_0x3b02b3})[_0x730c('0x27')](function(){return db['VoiceExtension'][_0x730c('0x2a')]({'where':{'VoicePrefixId':_0x32d4e8['id']},'transaction':_0x3b02b3})[_0x730c('0x27')](function(){return db['VoiceExtension']['find']({'where':{'id':_0x32d4e8[_0x730c('0x54')]},'raw':!![]})[_0x730c('0x27')](function(_0x44eb1d){return createVoicePrefixExtensions(_0x32d4e8,_0x44eb1d,_0x3b02b3);});});});})[_0x730c('0x27')](function(){return db[_0x730c('0x32')]['findById'](_0x32d4e8['id']);})[_0x730c('0x27')](respondWithResult(_0x212505,null))[_0x730c('0x4a')](handleError(_0x212505,null));};exports[_0x730c('0x70')]=function(_0x1bf755,_0x237b8e,_0x1846b6){return db[_0x730c('0x32')][_0x730c('0x4e')]({'where':{'id':_0x1bf755[_0x730c('0x4c')]['id']}})[_0x730c('0x27')](handleEntityNotFound(_0x237b8e,null))[_0x730c('0x27')](function(_0x3527dd){if(_0x3527dd){return _0x3527dd[_0x730c('0x70')](_0x1bf755['body'][_0x730c('0x71')],_[_0x730c('0x72')](_0x1bf755['body'],[_0x730c('0x71'),'id'])||{})[_0x730c('0x73')](function(_0x46a1a3){for(var _0x421460=0x0;_0x421460<_0x1bf755['body'][_0x730c('0x71')]['length'];_0x421460+=0x1){socket['emit'](_0x730c('0x74'),{'UserId':Number(_0x1bf755[_0x730c('0x52')]['ids'][_0x421460]),'VoicePrefixId':Number(_0x1bf755[_0x730c('0x4c')]['id'])});}return _0x46a1a3;});}})[_0x730c('0x27')](respondWithResult(_0x237b8e,null))[_0x730c('0x4a')](handleError(_0x237b8e,null));};exports['removeAgents']=function(_0x3785b4,_0x18a493,_0x47baaa){return db['VoicePrefix'][_0x730c('0x4e')]({'where':{'id':_0x3785b4['params']['id']}})[_0x730c('0x27')](handleEntityNotFound(_0x18a493,null))['then'](function(_0x3913d){if(_0x3913d){return _0x3913d[_0x730c('0x75')](_0x3785b4[_0x730c('0x38')][_0x730c('0x71')])[_0x730c('0x27')](function(){if(_[_0x730c('0x76')](_0x3785b4[_0x730c('0x38')][_0x730c('0x71')])){for(var _0xb56c1e=0x0;_0xb56c1e<_0x3785b4[_0x730c('0x38')][_0x730c('0x71')]['length'];_0xb56c1e+=0x1){socket[_0x730c('0x77')](_0x730c('0x78'),{'UserId':Number(_0x3785b4[_0x730c('0x38')][_0x730c('0x71')][_0xb56c1e]),'VoicePrefixId':Number(_0x3785b4[_0x730c('0x4c')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3785b4[_0x730c('0x38')][_0x730c('0x71')]),'VoicePrefixId':Number(_0x3785b4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x18a493,null))[_0x730c('0x4a')](handleError(_0x18a493,null));};exports['getAgents']=function(_0x88cc95,_0x9da88e,_0x17dc1c){var _0x368604={};var _0x4e1cf5={};var _0x511cb9;var _0x3ed63f;return db[_0x730c('0x32')][_0x730c('0x79')]({'where':{'id':_0x88cc95[_0x730c('0x4c')]['id']}})[_0x730c('0x27')](handleEntityNotFound(_0x9da88e,null))[_0x730c('0x27')](function(_0x3e1ea6){if(_0x3e1ea6){_0x511cb9=_0x3e1ea6;_0x4e1cf5['model']=_['keys'](db[_0x730c('0x7a')][_0x730c('0x33')]);_0x4e1cf5[_0x730c('0x38')]=_[_0x730c('0x4d')](_0x88cc95['query']);_0x4e1cf5['filters']=_[_0x730c('0x3a')](_0x4e1cf5[_0x730c('0x37')],_0x4e1cf5[_0x730c('0x38')]);_0x368604['attributes']=_[_0x730c('0x3a')](_0x4e1cf5[_0x730c('0x37')],qs[_0x730c('0x3c')](_0x88cc95['query'][_0x730c('0x3c')]));_0x368604['attributes']=_0x368604[_0x730c('0x3b')]['length']?_0x368604[_0x730c('0x3b')]:_0x4e1cf5['model'];_0x368604[_0x730c('0x3f')]=qs[_0x730c('0x40')](_0x88cc95['query'][_0x730c('0x40')]);_0x368604[_0x730c('0x41')]=qs[_0x730c('0x39')](_[_0x730c('0x42')](_0x88cc95[_0x730c('0x38')],_0x4e1cf5[_0x730c('0x39')]));if(_0x88cc95[_0x730c('0x38')][_0x730c('0x43')]){_0x368604[_0x730c('0x41')]=_[_0x730c('0x44')](_0x368604[_0x730c('0x41')],{'$or':_[_0x730c('0x31')](_0x368604[_0x730c('0x3b')],function(_0x213194){var _0x5a55b4={};_0x5a55b4[_0x213194]={'$like':'%'+_0x88cc95[_0x730c('0x38')][_0x730c('0x43')]+'%'};return _0x5a55b4;})});}_0x368604=_[_0x730c('0x44')]({},_0x368604,_0x88cc95[_0x730c('0x46')]);return _0x511cb9[_0x730c('0x7b')](_0x368604);}})[_0x730c('0x27')](function(_0x229c24){if(_0x229c24){_0x3ed63f=_0x229c24['length'];if(!_0x88cc95['query'][_0x730c('0x3e')](_0x730c('0x7c'))){_0x368604[_0x730c('0x21')]=qs[_0x730c('0x21')](_0x88cc95[_0x730c('0x38')][_0x730c('0x21')]);_0x368604[_0x730c('0x1f')]=qs['offset'](_0x88cc95[_0x730c('0x38')][_0x730c('0x1f')]);}return _0x511cb9[_0x730c('0x7b')](_0x368604);}})[_0x730c('0x27')](function(_0x1fe5d9){if(_0x1fe5d9){return _0x1fe5d9?{'count':_0x3ed63f,'rows':_0x1fe5d9}:null;}})[_0x730c('0x27')](respondWithResult(_0x9da88e,null))['catch'](handleError(_0x9da88e,null));};
\ No newline at end of file
index bf0bc3a..20a8895 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd871=['exports','events','VoicePrefix','setMaxListeners','emit','hasOwnProperty','hook'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0xd871,0xe1));var _0x1d87=function(_0x2678cf,_0x558c9a){_0x2678cf=_0x2678cf-0x0;var _0x194162=_0xd871[_0x2678cf];return _0x194162;};'use strict';var EventEmitter=require(_0x1d87('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x1d87('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1d87('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x499285){return function(_0x251ac2,_0x264df2,_0x24e4cd){VoicePrefixEvents['emit'](_0x499285+':'+_0x251ac2['id'],_0x251ac2);VoicePrefixEvents[_0x1d87('0x3')](_0x499285,_0x251ac2);_0x24e4cd(null);};}for(var e in events){if(events[_0x1d87('0x4')](e)){var event=events[e];VoicePrefix[_0x1d87('0x5')](e,emitEvent(event));}}module[_0x1d87('0x6')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x41c5=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41c5,0x8c));var _0x541c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x41c5[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x541c('0x0'));var VoicePrefix=require(_0x541c('0x1'))['db'][_0x541c('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x541c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x541c('0x4')};function emitEvent(_0x3bfc09){return function(_0x3e8907,_0x1eb400,_0x3caaa4){VoicePrefixEvents[_0x541c('0x5')](_0x3bfc09+':'+_0x3e8907['id'],_0x3e8907);VoicePrefixEvents[_0x541c('0x5')](_0x3bfc09,_0x3e8907);_0x3caaa4(null);};}for(var e in events){if(events[_0x541c('0x6')](e)){var event=events[e];VoicePrefix[_0x541c('0x7')](e,emitEvent(event));}}module[_0x541c('0x8')]=VoicePrefixEvents;
\ No newline at end of file
index 68c5aba..2d27816 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09ea=['voice_prefixes','lodash','util','api','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','define'];(function(_0x28c143,_0x2bd723){var _0x444173=function(_0x206429){while(--_0x206429){_0x28c143['push'](_0x28c143['shift']());}};_0x444173(++_0x2bd723);}(_0x09ea,0x8d));var _0xa09e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x09ea[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa09e('0x0'));var util=require(_0xa09e('0x1'));var logger=require('../../config/logger')(_0xa09e('0x2'));var moment=require('moment');var BPromise=require(_0xa09e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa09e('0x4'));var rimraf=require(_0xa09e('0x5'));var config=require(_0xa09e('0x6'));var attributes=require(_0xa09e('0x7'));module['exports']=function(_0x3fe889,_0x140beb){return _0x3fe889[_0xa09e('0x8')]('VoicePrefix',attributes,{'tableName':_0xa09e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8742=['define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./voicePrefix.attributes','exports'];(function(_0x505108,_0x573bbd){var _0x376bdc=function(_0x36f30d){while(--_0x36f30d){_0x505108['push'](_0x505108['shift']());}};_0x376bdc(++_0x573bbd);}(_0x8742,0xf3));var _0x2874=function(_0x3fb520,_0x9d07d5){_0x3fb520=_0x3fb520-0x0;var _0x42d9f7=_0x8742[_0x3fb520];return _0x42d9f7;};'use strict';var _=require(_0x2874('0x0'));var util=require(_0x2874('0x1'));var logger=require(_0x2874('0x2'))(_0x2874('0x3'));var moment=require(_0x2874('0x4'));var BPromise=require(_0x2874('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2874('0x6'));var attributes=require(_0x2874('0x7'));module[_0x2874('0x8')]=function(_0x13e8ec,_0xac2156){return _0x13e8ec[_0x2874('0x9')](_0x2874('0xa'),attributes,{'tableName':_0x2874('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e7f296d..85e142a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9505=['request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s'];(function(_0x5920fc,_0x345dc8){var _0x3b25f5=function(_0x4597d4){while(--_0x4597d4){_0x5920fc['push'](_0x5920fc['shift']());}};_0x3b25f5(++_0x345dc8);}(_0x9505,0x1e5));var _0x5950=function(_0x3d5b63,_0x23106c){_0x3d5b63=_0x3d5b63-0x0;var _0x45eea5=_0x9505[_0x3d5b63];return _0x45eea5;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var moment=require('moment');var BPromise=require(_0x5950('0x2'));var rs=require(_0x5950('0x3'));var fs=require('fs');var Redis=require(_0x5950('0x4'));var db=require(_0x5950('0x5'))['db'];var utils=require(_0x5950('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5950('0x7'));var jayson=require(_0x5950('0x8'));var client=jayson[_0x5950('0x9')][_0x5950('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5950('0xb')],{'host':_0x5950('0xc'),'port':0x18eb});var socket=require(_0x5950('0xd'))(new Redis(config[_0x5950('0xb')]));require(_0x5950('0xe'))[_0x5950('0xf')](socket);function respondWithRpcPromise(_0x1148ef,_0x213e3b,_0x1c8f39){return new BPromise(function(_0x5ef4ab,_0x32f2e0){return client[_0x5950('0x10')](_0x1148ef,_0x1c8f39)['then'](function(_0x5a6098){logger[_0x5950('0x11')](_0x5950('0x12'),_0x213e3b,_0x5950('0x13'));logger[_0x5950('0x14')](_0x5950('0x15'),_0x213e3b,_0x5950('0x13'),JSON[_0x5950('0x16')](_0x5a6098));if(_0x5a6098[_0x5950('0x17')]){if(_0x5a6098[_0x5950('0x17')][_0x5950('0x18')]===0x1f4){logger[_0x5950('0x17')](_0x5950('0x12'),_0x213e3b,_0x5a6098[_0x5950('0x17')][_0x5950('0x19')]);return _0x32f2e0(_0x5a6098[_0x5950('0x17')][_0x5950('0x19')]);}logger[_0x5950('0x17')](_0x5950('0x12'),_0x213e3b,_0x5a6098[_0x5950('0x17')][_0x5950('0x19')]);return _0x5ef4ab(_0x5a6098[_0x5950('0x17')]['message']);}else{logger['info'](_0x5950('0x12'),_0x213e3b,_0x5950('0x13'));_0x5ef4ab(_0x5a6098[_0x5950('0x1a')][_0x5950('0x19')]);}})[_0x5950('0x1b')](function(_0x483aaf){logger['error'](_0x5950('0x12'),_0x213e3b,_0x483aaf);_0x32f2e0(_0x483aaf);});});}
\ No newline at end of file
+var _0x2b29=['code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x49dc5b,_0x47647b){var _0x562e00=function(_0x5df3ab){while(--_0x5df3ab){_0x49dc5b['push'](_0x49dc5b['shift']());}};_0x562e00(++_0x47647b);}(_0x2b29,0x163));var _0x92b2=function(_0x410225,_0x38f3e0){_0x410225=_0x410225-0x0;var _0xfaed1=_0x2b29[_0x410225];return _0xfaed1;};'use strict';var _=require('lodash');var util=require(_0x92b2('0x0'));var moment=require(_0x92b2('0x1'));var BPromise=require(_0x92b2('0x2'));var rs=require(_0x92b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92b2('0x4'))['db'];var utils=require(_0x92b2('0x5'));var logger=require(_0x92b2('0x6'))(_0x92b2('0x7'));var config=require(_0x92b2('0x8'));var jayson=require(_0x92b2('0x9'));var client=jayson['client'][_0x92b2('0xa')]({'port':0x232a});config['redis']=_[_0x92b2('0xb')](config[_0x92b2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x92b2('0xd'))(new Redis(config[_0x92b2('0xc')]));require(_0x92b2('0xe'))[_0x92b2('0xf')](socket);function respondWithRpcPromise(_0x592c9e,_0x2b17de,_0x21bbf5){return new BPromise(function(_0x187eab,_0x1ef7f3){return client[_0x92b2('0x10')](_0x592c9e,_0x21bbf5)[_0x92b2('0x11')](function(_0xa18d4e){logger['info'](_0x92b2('0x12'),_0x2b17de,_0x92b2('0x13'));logger[_0x92b2('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x2b17de,_0x92b2('0x13'),JSON[_0x92b2('0x15')](_0xa18d4e));if(_0xa18d4e[_0x92b2('0x16')]){if(_0xa18d4e[_0x92b2('0x16')][_0x92b2('0x17')]===0x1f4){logger[_0x92b2('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x2b17de,_0xa18d4e[_0x92b2('0x16')]['message']);return _0x1ef7f3(_0xa18d4e[_0x92b2('0x16')][_0x92b2('0x18')]);}logger[_0x92b2('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x2b17de,_0xa18d4e['error'][_0x92b2('0x18')]);return _0x187eab(_0xa18d4e['error'][_0x92b2('0x18')]);}else{logger['info'](_0x92b2('0x12'),_0x2b17de,_0x92b2('0x13'));_0x187eab(_0xa18d4e[_0x92b2('0x19')][_0x92b2('0x18')]);}})[_0x92b2('0x1a')](function(_0x3dfd47){logger[_0x92b2('0x16')](_0x92b2('0x12'),_0x2b17de,_0x3dfd47);_0x1ef7f3(_0x3dfd47);});});}
\ No newline at end of file
index 4666cc3..c4057d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cd1=['length','voicePrefix:','save','remove','update','emit','removeListener','register'];(function(_0xf57ab4,_0xadda04){var _0x18012d=function(_0x48b93c){while(--_0x48b93c){_0xf57ab4['push'](_0xf57ab4['shift']());}};_0x18012d(++_0xadda04);}(_0x3cd1,0x112));var _0x13cd=function(_0xf88629,_0x170f07){_0xf88629=_0xf88629-0x0;var _0x4b6536=_0x3cd1[_0xf88629];return _0x4b6536;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x13cd('0x0'),_0x13cd('0x1'),_0x13cd('0x2')];function createListener(_0x2e2c4c,_0x105bd6){return function(_0x174a5f){_0x105bd6[_0x13cd('0x3')](_0x2e2c4c,_0x174a5f);};}function removeListener(_0x5d0e7,_0x511fcf){return function(){VoicePrefixEvents[_0x13cd('0x4')](_0x5d0e7,_0x511fcf);};}exports[_0x13cd('0x5')]=function(_0x3c0209){for(var _0x48ae57=0x0,_0x55cac0=events[_0x13cd('0x6')];_0x48ae57<_0x55cac0;_0x48ae57++){var _0x427fb0=events[_0x48ae57];var _0x258008=createListener(_0x13cd('0x7')+_0x427fb0,_0x3c0209);VoicePrefixEvents['on'](_0x427fb0,_0x258008);}};
\ No newline at end of file
+var _0x98b8=['removeListener','register','voicePrefix:','./voicePrefix.events','save','remove','update','emit'];(function(_0x3a48c8,_0x11e3c5){var _0x54822e=function(_0x447730){while(--_0x447730){_0x3a48c8['push'](_0x3a48c8['shift']());}};_0x54822e(++_0x11e3c5);}(_0x98b8,0x93));var _0x898b=function(_0x408b1e,_0x4fd20f){_0x408b1e=_0x408b1e-0x0;var _0x231e81=_0x98b8[_0x408b1e];return _0x231e81;};'use strict';var VoicePrefixEvents=require(_0x898b('0x0'));var events=[_0x898b('0x1'),_0x898b('0x2'),_0x898b('0x3')];function createListener(_0x17a43c,_0x141e59){return function(_0x86f457){_0x141e59[_0x898b('0x4')](_0x17a43c,_0x86f457);};}function removeListener(_0xc90f04,_0x7aea2f){return function(){VoicePrefixEvents[_0x898b('0x5')](_0xc90f04,_0x7aea2f);};}exports[_0x898b('0x6')]=function(_0x1ddef6){for(var _0x27b2fd=0x0,_0x124030=events['length'];_0x27b2fd<_0x124030;_0x27b2fd++){var _0x3989f9=events[_0x27b2fd];var _0x32e2e=createListener(_0x898b('0x7')+_0x3989f9,_0x1ddef6);VoicePrefixEvents['on'](_0x3989f9,_0x32e2e);}};
\ No newline at end of file
index 02effff..4ac6bbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6fa=['index','get','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/members','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','/:id/users','addAgents','addLists','addBlackLists','delete','removeAgents','removeBlackLists','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0xc29e65,_0x7f1e9e){var _0x36240d=function(_0x29a1ce){while(--_0x29a1ce){_0xc29e65['push'](_0xc29e65['shift']());}};_0x36240d(++_0x7f1e9e);}(_0xe6fa,0x184));var _0xae6f=function(_0x2e4041,_0x315cb2){_0x2e4041=_0x2e4041-0x0;var _0x3d9e66=_0xe6fa[_0x2e4041];return _0x3d9e66;};'use strict';var multer=require(_0xae6f('0x0'));var util=require('util');var path=require(_0xae6f('0x1'));var timeout=require('connect-timeout');var express=require(_0xae6f('0x2'));var router=express[_0xae6f('0x3')]();var fs_extra=require(_0xae6f('0x4'));var auth=require(_0xae6f('0x5'));var interaction=require(_0xae6f('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router['get']('/',auth[_0xae6f('0x7')](),controller[_0xae6f('0x8')]);router[_0xae6f('0x9')](_0xae6f('0xa'),auth[_0xae6f('0x7')](),controller['show']);router[_0xae6f('0x9')](_0xae6f('0xb'),auth[_0xae6f('0x7')](),controller['getHoppers']);router[_0xae6f('0x9')](_0xae6f('0xc'),auth[_0xae6f('0x7')](),controller[_0xae6f('0xd')]);router[_0xae6f('0x9')]('/:id/hopper_finals',auth[_0xae6f('0x7')](),controller[_0xae6f('0xe')]);router['get']('/:id/hopper_black',auth[_0xae6f('0x7')](),controller[_0xae6f('0xf')]);router[_0xae6f('0x9')](_0xae6f('0x10'),auth[_0xae6f('0x7')](),controller[_0xae6f('0x11')]);router['get']('/:id/users',auth[_0xae6f('0x7')](),controller['getAgents']);router[_0xae6f('0x9')](_0xae6f('0x12'),auth['isAuthenticated'](),controller['getMembers']);router[_0xae6f('0x9')](_0xae6f('0x13'),auth[_0xae6f('0x7')](),controller[_0xae6f('0x14')]);router[_0xae6f('0x9')](_0xae6f('0x15'),auth[_0xae6f('0x7')](),controller[_0xae6f('0x16')]);router['post']('/',auth[_0xae6f('0x7')](),controller['create']);router[_0xae6f('0x17')](_0xae6f('0x18'),auth[_0xae6f('0x7')](),controller['clone']);router[_0xae6f('0x17')](_0xae6f('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0xae6f('0x17')](_0xae6f('0x19'),auth[_0xae6f('0x7')](),controller[_0xae6f('0x1a')]);router[_0xae6f('0x17')](_0xae6f('0x13'),auth[_0xae6f('0x7')](),controller[_0xae6f('0x1b')]);router[_0xae6f('0x17')](_0xae6f('0x15'),auth[_0xae6f('0x7')](),controller[_0xae6f('0x1c')]);router['put'](_0xae6f('0xa'),auth[_0xae6f('0x7')](),controller['update']);router[_0xae6f('0x1d')]('/:id',auth[_0xae6f('0x7')](),controller['destroy']);router[_0xae6f('0x1d')]('/:id/teams',auth[_0xae6f('0x7')](),controller['removeTeams']);router[_0xae6f('0x1d')]('/:id/users',auth['isAuthenticated'](),controller[_0xae6f('0x1e')]);router['delete'](_0xae6f('0x13'),auth['isAuthenticated'](),controller['removeLists']);router[_0xae6f('0x1d')](_0xae6f('0x15'),auth['isAuthenticated'](),controller[_0xae6f('0x1f')]);module[_0xae6f('0x20')]=router;
\ No newline at end of file
+var _0x7aa7=['getMembers','/:id/lists','getLists','/:id/blacklists','post','create','clone','addTeams','addAgents','addLists','addBlackLists','put','update','destroy','delete','removeTeams','removeAgents','removeBlackLists','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueue.controller','isAuthenticated','index','/:id','show','get','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x4b4f45,_0x3e2865){var _0x1b3d3c=function(_0x5b2fed){while(--_0x5b2fed){_0x4b4f45['push'](_0x4b4f45['shift']());}};_0x1b3d3c(++_0x3e2865);}(_0x7aa7,0x94));var _0x77aa=function(_0x403feb,_0x407396){_0x403feb=_0x403feb-0x0;var _0xc7e78c=_0x7aa7[_0x403feb];return _0xc7e78c;};'use strict';var multer=require(_0x77aa('0x0'));var util=require(_0x77aa('0x1'));var path=require('path');var timeout=require(_0x77aa('0x2'));var express=require(_0x77aa('0x3'));var router=express[_0x77aa('0x4')]();var fs_extra=require(_0x77aa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x77aa('0x6'));var controller=require(_0x77aa('0x7'));router['get']('/',auth[_0x77aa('0x8')](),controller[_0x77aa('0x9')]);router['get'](_0x77aa('0xa'),auth[_0x77aa('0x8')](),controller[_0x77aa('0xb')]);router[_0x77aa('0xc')](_0x77aa('0xd'),auth[_0x77aa('0x8')](),controller['getHoppers']);router['get'](_0x77aa('0xe'),auth[_0x77aa('0x8')](),controller[_0x77aa('0xf')]);router['get'](_0x77aa('0x10'),auth['isAuthenticated'](),controller[_0x77aa('0x11')]);router[_0x77aa('0xc')](_0x77aa('0x12'),auth[_0x77aa('0x8')](),controller[_0x77aa('0x13')]);router[_0x77aa('0xc')](_0x77aa('0x14'),auth[_0x77aa('0x8')](),controller[_0x77aa('0x15')]);router[_0x77aa('0xc')](_0x77aa('0x16'),auth[_0x77aa('0x8')](),controller[_0x77aa('0x17')]);router[_0x77aa('0xc')]('/:id/members',auth[_0x77aa('0x8')](),controller[_0x77aa('0x18')]);router['get'](_0x77aa('0x19'),auth[_0x77aa('0x8')](),controller[_0x77aa('0x1a')]);router['get'](_0x77aa('0x1b'),auth[_0x77aa('0x8')](),controller['getBlackLists']);router[_0x77aa('0x1c')]('/',auth[_0x77aa('0x8')](),controller[_0x77aa('0x1d')]);router['post']('/:id/clone',auth[_0x77aa('0x8')](),controller[_0x77aa('0x1e')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x77aa('0x1f')]);router[_0x77aa('0x1c')](_0x77aa('0x16'),auth['isAuthenticated'](),controller[_0x77aa('0x20')]);router[_0x77aa('0x1c')](_0x77aa('0x19'),auth[_0x77aa('0x8')](),controller[_0x77aa('0x21')]);router[_0x77aa('0x1c')](_0x77aa('0x1b'),auth[_0x77aa('0x8')](),controller[_0x77aa('0x22')]);router[_0x77aa('0x23')](_0x77aa('0xa'),auth[_0x77aa('0x8')](),controller[_0x77aa('0x24')]);router['delete'](_0x77aa('0xa'),auth['isAuthenticated'](),controller[_0x77aa('0x25')]);router[_0x77aa('0x26')](_0x77aa('0x14'),auth['isAuthenticated'](),controller[_0x77aa('0x27')]);router[_0x77aa('0x26')]('/:id/users',auth[_0x77aa('0x8')](),controller[_0x77aa('0x28')]);router[_0x77aa('0x26')](_0x77aa('0x19'),auth[_0x77aa('0x8')](),controller['removeLists']);router[_0x77aa('0x26')](_0x77aa('0x1b'),auth[_0x77aa('0x8')](),controller[_0x77aa('0x29')]);module[_0x77aa('0x2a')]=router;
\ No newline at end of file
index e9f80f4..0e760f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14e5=['periodic_announce','join','joinempty','leavewhenempty','split','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','ENUM','outbound','inbound','default','STRING','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','all','yes','once','TEXT','setDataValue'];(function(_0x194b5c,_0x3e4893){var _0x2badf6=function(_0x28433a){while(--_0x28433a){_0x194b5c['push'](_0x194b5c['shift']());}};_0x2badf6(++_0x3e4893);}(_0x14e5,0x128));var _0x514e=function(_0x39fb09,_0x4f0fc6){_0x39fb09=_0x39fb09-0x0;var _0x31aa84=_0x14e5[_0x39fb09];return _0x31aa84;};'use strict';var Sequelize=require(_0x514e('0x0'));module[_0x514e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x514e('0x2')]('inbound',_0x514e('0x3')),'allowNull':![],'defaultValue':_0x514e('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x514e('0x5')},'announce':{'type':Sequelize[_0x514e('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x514e('0x2')]('rr',_0x514e('0x7'),_0x514e('0x8'),_0x514e('0x9'),'random',_0x514e('0xa'),_0x514e('0xb'),_0x514e('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0x514e('0x7'),'set':function(_0xb1cbaa){this['setDataValue'](_0x514e('0xd'),_0xb1cbaa?_0xb1cbaa:_0x514e('0xa'));},'get':function(){var _0x58f02e=this[_0x514e('0xe')](_0x514e('0xf'));var _0x3ba791=this[_0x514e('0xe')](_0x514e('0x10'));var _0x54ce67=this[_0x514e('0xe')](_0x514e('0xd'));if(_0x58f02e===_0x514e('0x4')){return _0x54ce67;}if(_0x3ba791===_0x514e('0x11')&&_0x54ce67===_0x514e('0xa')||_0x3ba791===_0x514e('0x11')&&_0x54ce67===_0x514e('0x12')){return _0x54ce67;}if(_0x3ba791===_0x514e('0x13')||_0x3ba791===_0x514e('0x14')||_0x3ba791===_0x514e('0x15')){return _0x54ce67;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x514e('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x514e('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x514e('0x6')]},'weight':{'type':Sequelize[_0x514e('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x514e('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x514e('0x2')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x514e('0x2')]('yes','no',_0x514e('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x514e('0x16')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x514e('0x2')](_0x514e('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x514e('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x514e('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x514e('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x514e('0x2')](_0x514e('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x514e('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x514e('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x514e('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x514e('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x514e('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x514e('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x514e('0x18'),'no'),'defaultValue':_0x514e('0x18')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x514e('0x18'),'no',_0x514e('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x514e('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x514e('0x2')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x514e('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x514e('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x514e('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x514e('0x6')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x514e('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x514e('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x514e('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x514e('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x514e('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x514e('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x514e('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x514e('0x6')]},'queue_quantity1':{'type':Sequelize[_0x514e('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x514e('0x6')]},'queue_less_than':{'type':Sequelize[_0x514e('0x6')]},'periodic_announce':{'type':Sequelize[_0x514e('0x1a')],'set':function(_0x4d9958){this[_0x514e('0x1b')](_0x514e('0x1c'),_0x4d9958?_0x4d9958[_0x514e('0x1d')](','):[]);},'get':function(){return this[_0x514e('0xe')](_0x514e('0x1c'))?this[_0x514e('0xe')](_0x514e('0x1c'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x514e('0x6')],'defaultValue':_0x514e('0x18'),'set':function(_0x54ed10){this['setDataValue'](_0x514e('0x1e'),_0x54ed10?_0x54ed10['join'](','):undefined);},'get':function(){return this[_0x514e('0xe')](_0x514e('0x1e'))?this['getDataValue'](_0x514e('0x1e'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x514e('0x6')],'defaultValue':'no','set':function(_0xd1c570){this[_0x514e('0x1b')](_0x514e('0x1f'),_0xd1c570?_0xd1c570[_0x514e('0x1d')](','):undefined);},'get':function(){return this[_0x514e('0xe')](_0x514e('0x1f'))?this[_0x514e('0xe')](_0x514e('0x1f'))[_0x514e('0x20')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x514e('0x2')](_0x514e('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x514e('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x514e('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x514e('0x2')](_0x514e('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x514e('0x6')]},'acw':{'type':Sequelize[_0x514e('0x21')],'defaultValue':0x0,'set':function(_0x5f41fe){this[_0x514e('0x1b')](_0x514e('0x22'),_0x5f41fe);if(_0x5f41fe){if(this[_0x514e('0xe')](_0x514e('0x23'))<0x2){this[_0x514e('0x1b')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x514e('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x514e('0x21')],'defaultValue':0x0,'comment':_0x514e('0x24')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x514e('0x13'),_0x514e('0x15'),_0x514e('0x14'),_0x514e('0x11')),'defaultValue':_0x514e('0x13'),'comment':_0x514e('0x25')},'dialLimitChannel':{'type':Sequelize[_0x514e('0x16')](0x4)[_0x514e('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x514e('0x27')},'dialLimitQueue':{'type':Sequelize[_0x514e('0x16')](0x4)[_0x514e('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x514e('0x28')},'dialPowerLevel':{'type':Sequelize[_0x514e('0x29')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x514e('0x2a')),'defaultValue':_0x514e('0x2a'),'comment':_0x514e('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x514e('0x29')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x514e('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x514e('0x16')](0x3)[_0x514e('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x514e('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x514e('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x514e('0x16')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x514e('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x514e('0x6')],'defaultValue':_0x514e('0x2f'),'comment':_0x514e('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x514e('0x16')](0x3)[_0x514e('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x514e('0x31')},'dialQueueProject':{'type':Sequelize[_0x514e('0x6')],'comment':_0x514e('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x514e('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x514e('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x514e('0x16')](0x5)[_0x514e('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x514e('0x34')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x514e('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x514e('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x514e('0x16')](0x5)[_0x514e('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x514e('0x16')](0x3)[_0x514e('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x514e('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x514e('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x514e('0x16')](0x3)[_0x514e('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x514e('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x514e('0x6')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x514e('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x514e('0x37'),_0x514e('0x38'),_0x514e('0x39')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x514e('0x21')],'defaultValue':0x0,'comment':_0x514e('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x514e('0x16')](0x9)[_0x514e('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x514e('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x514e('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x514e('0x16')](0x9)[_0x514e('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x514e('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x514e('0x16')](0x9)[_0x514e('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x514e('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x514e('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x514e('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x514e('0x16')](0x9)[_0x514e('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x514e('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x514e('0x16')](0x9)[_0x514e('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x514e('0x16')](0x5)[_0x514e('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x514e('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x514e('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x514e('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x514e('0x16')](0x5)[_0x514e('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x514e('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x514e('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x514e('0x2')](_0x514e('0x43'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x514e('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x514e('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x514e('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x514e('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x514e('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x514e('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x514e('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x514e('0x16')](0x3)[_0x514e('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x514e('0x16')](0x5)[_0x514e('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x514e('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x514e('0x16')](0x3)[_0x514e('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x514e('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x514e('0x16')](0x5)[_0x514e('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x514e('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x514e('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x514e('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x514e('0x16')](0x5)[_0x514e('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x514e('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x514e('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x514e('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x514e('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x514e('0x16')](0x3)[_0x514e('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x514e('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x514e('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x514e('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x514e('0x16')],'allowNull':!![],'comment':_0x514e('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x514e('0x21')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3d3202){if(!_0x3d3202)this[_0x514e('0x1b')](_0x514e('0x4f'),null);this[_0x514e('0x1b')](_0x514e('0x50'),_0x3d3202);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x514e('0x16')](0x3)[_0x514e('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x514e('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x514e('0x16')](0x3)[_0x514e('0x26')],'defaultValue':0x4}};
\ No newline at end of file
+var _0x7cad=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','sequelize','exports','STRING','name','inbound','outbound','ENUM','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','progressive','predictive','power','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','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)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7cad,0x13b));var _0xd7ca=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7cad[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xd7ca('0x0'));module[_0xd7ca('0x1')]={'name':{'type':Sequelize[_0xd7ca('0x2')],'allowNull':![],'unique':_0xd7ca('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xd7ca('0x4'),_0xd7ca('0x5')),'allowNull':![],'defaultValue':_0xd7ca('0x4')},'musiconhold':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xd7ca('0x6')]('rr',_0xd7ca('0x7'),_0xd7ca('0x8'),_0xd7ca('0x9'),_0xd7ca('0xa'),_0xd7ca('0xb'),_0xd7ca('0xc'),_0xd7ca('0xd'),_0xd7ca('0xe')),'allowNull':![],'defaultValue':'ringall','set':function(_0xcb41ce){this[_0xd7ca('0xf')](_0xd7ca('0x10'),_0xcb41ce?_0xcb41ce:_0xd7ca('0xb'));},'get':function(){var _0x3aee18=this['getDataValue']('type');var _0x2affd3=this[_0xd7ca('0x11')](_0xd7ca('0x12'));var _0x5bf741=this[_0xd7ca('0x11')](_0xd7ca('0x10'));if(_0x3aee18==='inbound'){return _0x5bf741;}if(_0x2affd3===_0xd7ca('0x13')&&_0x5bf741==='rrmemory'||_0x2affd3===_0xd7ca('0x13')&&_0x5bf741==='roundrobin'){return _0x5bf741;}if(_0x2affd3===_0xd7ca('0x14')||_0x2affd3===_0xd7ca('0x15')||_0x2affd3===_0xd7ca('0x16')){return _0x5bf741;}return null;}},'servicelevel':{'type':Sequelize[_0xd7ca('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xd7ca('0x17')](0xb)},'timeout':{'type':Sequelize[_0xd7ca('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd7ca('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xd7ca('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xd7ca('0x6')](_0xd7ca('0x18'),'no'),'defaultValue':_0xd7ca('0x18')},'autopause':{'type':Sequelize[_0xd7ca('0x6')](_0xd7ca('0x18'),'no',_0xd7ca('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xd7ca('0x17')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xd7ca('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xd7ca('0x6')](_0xd7ca('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xd7ca('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd7ca('0x6')](_0xd7ca('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xd7ca('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xd7ca('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xd7ca('0x6')](_0xd7ca('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xd7ca('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xd7ca('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xd7ca('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd7ca('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xd7ca('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xd7ca('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd7ca('0x6')]('yes','no'),'defaultValue':_0xd7ca('0x18')},'announce_holdtime':{'type':Sequelize[_0xd7ca('0x6')]('yes','no',_0xd7ca('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xd7ca('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0xd7ca('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xd7ca('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xd7ca('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xd7ca('0x2')]},'queue_quantity2':{'type':Sequelize[_0xd7ca('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xd7ca('0x2')]},'queue_less_than':{'type':Sequelize[_0xd7ca('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x42aa4d){this['setDataValue'](_0xd7ca('0x1b'),_0x42aa4d?_0x42aa4d[_0xd7ca('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0xd7ca('0x1b'))?this[_0xd7ca('0x11')](_0xd7ca('0x1b'))[_0xd7ca('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':_0xd7ca('0x18'),'set':function(_0x4d06ee){this[_0xd7ca('0xf')](_0xd7ca('0x1e'),_0x4d06ee?_0x4d06ee[_0xd7ca('0x1c')](','):undefined);},'get':function(){return this[_0xd7ca('0x11')](_0xd7ca('0x1e'))?this[_0xd7ca('0x11')](_0xd7ca('0x1e'))[_0xd7ca('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':'no','set':function(_0x2d0088){this[_0xd7ca('0xf')](_0xd7ca('0x1f'),_0x2d0088?_0x2d0088[_0xd7ca('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0xd7ca('0x1f'))?this['getDataValue'](_0xd7ca('0x1f'))[_0xd7ca('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xd7ca('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xd7ca('0x6')](_0xd7ca('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xd7ca('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd7ca('0x6')](_0xd7ca('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xd7ca('0x2')]},'description':{'type':Sequelize[_0xd7ca('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x1264ba){this['setDataValue'](_0xd7ca('0x20'),_0x1264ba);if(_0x1264ba){if(this[_0xd7ca('0x11')](_0xd7ca('0x21'))<0x2){this[_0xd7ca('0xf')](_0xd7ca('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd7ca('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xd7ca('0x22')],'defaultValue':0x0,'comment':_0xd7ca('0x23')},'dialMethod':{'type':Sequelize[_0xd7ca('0x6')]('preview',_0xd7ca('0x14'),_0xd7ca('0x16'),_0xd7ca('0x15'),_0xd7ca('0x13')),'defaultValue':_0xd7ca('0x14'),'comment':_0xd7ca('0x24')},'dialLimitChannel':{'type':Sequelize[_0xd7ca('0x17')](0x4)[_0xd7ca('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd7ca('0x26')},'dialLimitQueue':{'type':Sequelize[_0xd7ca('0x17')](0x4)[_0xd7ca('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd7ca('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xd7ca('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xd7ca('0x6')](_0xd7ca('0x28'),_0xd7ca('0x29')),'defaultValue':'dropRate','comment':_0xd7ca('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xd7ca('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xd7ca('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xd7ca('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd7ca('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xd7ca('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7ca('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':_0xd7ca('0x2d'),'comment':_0xd7ca('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xd7ca('0x17')](0x3)[_0xd7ca('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7ca('0x2f')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xd7ca('0x30')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7ca('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd7ca('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7ca('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xd7ca('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7ca('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd7ca('0x17')](0x3)[_0xd7ca('0x25')],'defaultValue':0x3,'comment':_0xd7ca('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd7ca('0x17')](0x5)[_0xd7ca('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd7ca('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd7ca('0x2')],'defaultValue':_0xd7ca('0x35')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xd7ca('0x36'),_0xd7ca('0x37'),_0xd7ca('0x38')),'defaultValue':_0xd7ca('0x36')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd7ca('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd7ca('0x39')},'dialAMDGreeting':{'type':Sequelize[_0xd7ca('0x17')](0x9)[_0xd7ca('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd7ca('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd7ca('0x17')](0x9)[_0xd7ca('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd7ca('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd7ca('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0xd7ca('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd7ca('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd7ca('0x17')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd7ca('0x17')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd7ca('0x17')](0x5)[_0xd7ca('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd7ca('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd7ca('0x17')](0x9)[_0xd7ca('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xd7ca('0x17')](0x5)[_0xd7ca('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd7ca('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0xd7ca('0x22')],'defaultValue':0x0,'comment':_0xd7ca('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd7ca('0x6')](_0xd7ca('0x40'),'ASC'),'defaultValue':_0xd7ca('0x40')},'dialQueueProject2':{'type':Sequelize[_0xd7ca('0x2')],'comment':_0xd7ca('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xd7ca('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xd7ca('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd7ca('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xd7ca('0x17')](0x3)[_0xd7ca('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd7ca('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd7ca('0x17')](0x3)[_0xd7ca('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7ca('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd7ca('0x17')](0x5)[_0xd7ca('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7ca('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0xd7ca('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7ca('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0xd7ca('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7ca('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd7ca('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7ca('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd7ca('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7ca('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0xd7ca('0x17')](0x3)[_0xd7ca('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd7ca('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd7ca('0x17')](0x5)[_0xd7ca('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7ca('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd7ca('0x17')](0x3)[_0xd7ca('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd7ca('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd7ca('0x17')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x43832c){if(!_0x43832c)this[_0xd7ca('0xf')](_0xd7ca('0x4b'),null);this['setDataValue']('mandatoryDisposition',_0x43832c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xd7ca('0x17')](0x3)[_0xd7ca('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xd7ca('0x17')](0x3)[_0xd7ca('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xd7ca('0x17')](0x3)[_0xd7ca('0x25')],'defaultValue':0x4}};
\ No newline at end of file
index 0e66871..e46a558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','options','count','includeAll','include','show','keys','length','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','inbound','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','params','omit','createdAt','updatedAt','getHoppers','findOne','order','VoiceQueueId','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','each','upsert','UserVoiceQueue','findOrCreate','isNil','emit','userVoiceQueue:save','ids','User','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','transaction','removeTeams','removeAgents','userVoiceQueue:remove','addAgents','spread','UserVoiceQueueRt','SIP/%s','getAgents','getMembers','CmList','getLists','addLists','format','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','offset','undefined','set','Content-Range','json','apply','reject','update','then','destroy','get','QueueCampaigns','outbound','filter','ignore','value','includes','stack','name','index','map','VoiceQueue','rawAttributes','type','key','query'];(function(_0x3ec989,_0x754444){var _0x40dbf7=function(_0x542863){while(--_0x542863){_0x3ec989['push'](_0x3ec989['shift']());}};_0x40dbf7(++_0x754444);}(_0x1261,0x144));var _0x1126=function(_0x1601ad,_0x4e4a92){_0x1601ad=_0x1601ad-0x0;var _0x3973aa=_0x1261[_0x1601ad];return _0x3973aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];config[_0x1126('0x18')]=_[_0x1126('0x19')](config[_0x1126('0x18')],{'host':_0x1126('0x1a'),'port':0x18eb});var socket=require(_0x1126('0x1b'))(new Redis(config[_0x1126('0x18')]));require(_0x1126('0x1c'))['register'](socket);function respondWithStatusCode(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xcc;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1d')](_0x1af673);}return _0x5de9a7['status'](_0x1af673)[_0x1126('0x1e')]();};}function respondWithResult(_0x4794a7,_0x35fe9f){_0x35fe9f=_0x35fe9f||0xc8;return function(_0x42f379){if(_0x42f379){return _0x4794a7[_0x1126('0x1f')](_0x35fe9f)['json'](_0x42f379);}};}function respondWithFilteredResult(_0x245cd7,_0x1695f6){return function(_0x4a7b49){if(_0x4a7b49){var _0x4d2b38=typeof _0x1695f6[_0x1126('0x20')]===_0x1126('0x21')&&typeof _0x1695f6['limit']==='undefined';var _0x4564c0=_0x4a7b49['count'];var _0x22ed37=_0x4d2b38?0x0:_0x1695f6[_0x1126('0x20')];var _0x2f70ac=_0x4d2b38?_0x4a7b49['count']:_0x1695f6[_0x1126('0x20')]+_0x1695f6['limit'];var _0x56efeb;if(_0x2f70ac>=_0x4564c0){_0x2f70ac=_0x4564c0;_0x56efeb=0xc8;}else{_0x56efeb=0xce;}_0x245cd7[_0x1126('0x1f')](_0x56efeb);return _0x245cd7[_0x1126('0x22')](_0x1126('0x23'),_0x22ed37+'-'+_0x2f70ac+'/'+_0x4564c0)[_0x1126('0x24')](_0x4a7b49);}return null;};}function patchUpdates(_0x526ca1){return function(_0x29ab60){try{jsonpatch[_0x1126('0x25')](_0x29ab60,_0x526ca1,!![]);}catch(_0x48a08d){return BPromise[_0x1126('0x26')](_0x48a08d);}return _0x29ab60['save']();};}function saveUpdates(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x27')](_0x529dd9)[_0x1126('0x28')](function(_0x34bcf1){return _0x34bcf1;});}return null;};}function removeEntity(_0x566c09,_0x1b07a7){return function(_0xea0971){if(_0xea0971){return _0xea0971[_0x1126('0x29')]()['then'](function(){var _0x35eec3=_0xea0971[_0x1126('0x2a')]({'plain':!![]});var _0xa293f4=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x1126('0x2b'),'value':_0x1126('0x2c'),'ignore':![]}];var _0x55e195=_(_0xa293f4)[_0x1126('0x2d')](_0x1126('0x2e'))['map'](_0x1126('0x2f'))['value']();if(_[_0x1126('0x30')](_0x55e195,_0x35eec3['type'])){return;}var _0x771bb8=_['find'](_0xa293f4,[_0x1126('0x2f'),_0x35eec3['type']])['name'];return db['UserProfileResource'][_0x1126('0x29')]({'where':{'type':_0x771bb8,'resourceId':_0x35eec3['id']}})[_0x1126('0x28')](function(){return _0xea0971;});})[_0x1126('0x28')](function(){_0x566c09['status'](0xcc)[_0x1126('0x1e')]();});}};}function handleEntityNotFound(_0x226afb,_0x56f7f8){return function(_0x3dd50e){if(!_0x3dd50e){_0x226afb[_0x1126('0x1d')](0x194);}return _0x3dd50e;};}function handleError(_0x2d8127,_0x29fbfa){_0x29fbfa=_0x29fbfa||0x1f4;return function(_0x5836a2){logger['error'](_0x5836a2[_0x1126('0x31')]);if(_0x5836a2[_0x1126('0x32')]){delete _0x5836a2[_0x1126('0x32')];}_0x2d8127[_0x1126('0x1f')](_0x29fbfa)['send'](_0x5836a2);};}exports[_0x1126('0x33')]=function(_0x6f4312,_0x313ebe){var _0x22436c={},_0x3b0f79={},_0x5df232={'count':0x0,'rows':[]};var _0x2a0dfe=_[_0x1126('0x34')](db[_0x1126('0x35')][_0x1126('0x36')],function(_0x5c019d){return{'name':_0x5c019d['fieldName'],'type':_0x5c019d[_0x1126('0x37')][_0x1126('0x38')]};});_0x3b0f79['model']=_[_0x1126('0x34')](_0x2a0dfe,_0x1126('0x32'));_0x3b0f79[_0x1126('0x39')]=_['keys'](_0x6f4312['query']);_0x3b0f79[_0x1126('0x3a')]=_[_0x1126('0x3b')](_0x3b0f79[_0x1126('0x3c')],_0x3b0f79[_0x1126('0x39')]);_0x22436c['attributes']=_[_0x1126('0x3b')](_0x3b0f79['model'],qs[_0x1126('0x3d')](_0x6f4312[_0x1126('0x39')][_0x1126('0x3d')]));_0x22436c[_0x1126('0x3e')]=_0x22436c[_0x1126('0x3e')]['length']?_0x22436c[_0x1126('0x3e')]:_0x3b0f79[_0x1126('0x3c')];if(!_0x6f4312[_0x1126('0x39')][_0x1126('0x3f')](_0x1126('0x40'))){_0x22436c[_0x1126('0x41')]=qs[_0x1126('0x41')](_0x6f4312['query'][_0x1126('0x41')]);_0x22436c[_0x1126('0x20')]=qs[_0x1126('0x20')](_0x6f4312[_0x1126('0x39')][_0x1126('0x20')]);}_0x22436c['order']=qs['sort'](_0x6f4312[_0x1126('0x39')][_0x1126('0x42')]);_0x22436c[_0x1126('0x43')]=qs[_0x1126('0x3a')](_[_0x1126('0x44')](_0x6f4312[_0x1126('0x39')],_0x3b0f79['filters']),_0x2a0dfe);if(_0x6f4312['query']['filter']){_0x22436c[_0x1126('0x43')]=_['merge'](_0x22436c[_0x1126('0x43')],{'$or':_[_0x1126('0x34')](_0x2a0dfe,function(_0x3584a3){if(_0x3584a3[_0x1126('0x37')]!=='VIRTUAL'){var _0x4c94bb={};_0x4c94bb[_0x3584a3[_0x1126('0x32')]]={'$like':'%'+_0x6f4312[_0x1126('0x39')][_0x1126('0x2d')]+'%'};return _0x4c94bb;}})});}_0x22436c=_['merge']({},_0x22436c,_0x6f4312[_0x1126('0x45')]);var _0x5f35fa={'where':_0x22436c[_0x1126('0x43')]};return db['VoiceQueue'][_0x1126('0x46')](_0x5f35fa)[_0x1126('0x28')](function(_0x1006fb){_0x5df232['count']=_0x1006fb;if(_0x6f4312[_0x1126('0x39')][_0x1126('0x47')]){_0x22436c[_0x1126('0x48')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x22436c);})['then'](function(_0x6e78cf){_0x5df232['rows']=_0x6e78cf;return _0x5df232;})[_0x1126('0x28')](respondWithFilteredResult(_0x313ebe,_0x22436c))['catch'](handleError(_0x313ebe,null));};exports[_0x1126('0x49')]=function(_0x323499,_0x146066){var _0x120de1={'raw':![],'where':{'id':_0x323499['params']['id']}},_0xede3d8={};_0xede3d8[_0x1126('0x3c')]=_[_0x1126('0x4a')](db['VoiceQueue'][_0x1126('0x36')]);_0xede3d8[_0x1126('0x39')]=_['keys'](_0x323499[_0x1126('0x39')]);_0xede3d8[_0x1126('0x3a')]=_['intersection'](_0xede3d8[_0x1126('0x3c')],_0xede3d8[_0x1126('0x39')]);_0x120de1[_0x1126('0x3e')]=_['intersection'](_0xede3d8[_0x1126('0x3c')],qs[_0x1126('0x3d')](_0x323499[_0x1126('0x39')][_0x1126('0x3d')]));_0x120de1[_0x1126('0x3e')]=_0x120de1[_0x1126('0x3e')][_0x1126('0x4b')]?_0x120de1[_0x1126('0x3e')]:_0xede3d8['model'];if(_0x323499[_0x1126('0x39')]['includeAll']){_0x120de1[_0x1126('0x48')]=[{'all':!![]}];}_0x120de1=_[_0x1126('0x4c')]({},_0x120de1,_0x323499['options']);return db['VoiceQueue'][_0x1126('0x4d')](_0x120de1)[_0x1126('0x28')](handleEntityNotFound(_0x146066,null))[_0x1126('0x28')](respondWithResult(_0x146066,null))['catch'](handleError(_0x146066,null));};exports[_0x1126('0x4e')]=function(_0x3506d7,_0x3ea23f){return db[_0x1126('0x35')]['create'](_0x3506d7[_0x1126('0x4f')],{})[_0x1126('0x28')](function(_0x5c36b9){var _0x4bcc08=_0x3506d7['user']['get']({'plain':!![]});if(!_0x4bcc08)throw new Error(_0x1126('0x50'));if(_0x4bcc08[_0x1126('0x51')]==='user'){var _0x16552b=_0x5c36b9[_0x1126('0x2a')]({'plain':!![]});var _0x38093e=[{'name':_0x1126('0x52'),'value':_0x1126('0x53')},{'name':'QueueCampaigns','value':_0x1126('0x2c')}];var _0x267592=_['find'](_0x38093e,[_0x1126('0x2f'),_0x16552b[_0x1126('0x37')]])[_0x1126('0x32')];return db[_0x1126('0x54')][_0x1126('0x4d')]({'where':{'name':_0x267592,'userProfileId':_0x4bcc08['userProfileId']},'raw':!![]})[_0x1126('0x28')](function(_0x49aeaa){if(_0x49aeaa&&_0x49aeaa[_0x1126('0x55')]===0x0){return db[_0x1126('0x56')][_0x1126('0x4e')]({'name':_0x16552b['name'],'resourceId':_0x16552b['id'],'type':_0x49aeaa[_0x1126('0x32')],'sectionId':_0x49aeaa['id']},{})[_0x1126('0x28')](function(){return _0x5c36b9;});}else{return _0x5c36b9;}})['catch'](function(_0x30812d){logger[_0x1126('0x57')](_0x1126('0x58'),_0x30812d);throw _0x30812d;});}return _0x5c36b9;})['then'](respondWithResult(_0x3ea23f,0xc9))[_0x1126('0x59')](handleError(_0x3ea23f,null));};exports[_0x1126('0x5a')]=function(_0x22ab18,_0x308ee4){var _0x128c94={'where':{'id':_0x22ab18[_0x1126('0x5b')]['id']}},_0x26949c={};_0x26949c[_0x1126('0x3c')]=_['keys'](db[_0x1126('0x35')][_0x1126('0x36')]);_0x128c94[_0x1126('0x3e')]=_[_0x1126('0x3b')](_0x26949c[_0x1126('0x3c')],qs['fields'](_0x22ab18[_0x1126('0x39')][_0x1126('0x3d')]));_0x128c94['attributes']=_0x128c94[_0x1126('0x3e')]['length']?_0x128c94[_0x1126('0x3e')]:_0x26949c[_0x1126('0x3c')];if(_0x22ab18['query'][_0x1126('0x47')]){_0x128c94[_0x1126('0x48')]=[{'all':!![]}];}_0x128c94=_[_0x1126('0x4c')]({},_0x128c94,_0x22ab18['options']);return db[_0x1126('0x35')]['find'](_0x128c94)['then'](handleEntityNotFound(_0x308ee4,null))[_0x1126('0x28')](function(_0x40185f){if(_0x40185f){var _0x130f26=_0x40185f[_0x1126('0x2a')]({'plain':!![]});_0x130f26=qs[_0x1126('0x5c')](_0x130f26,['id',_0x1126('0x5d'),_0x1126('0x5e')]);_0x22ab18['body']=_[_0x1126('0x5c')](_0x22ab18[_0x1126('0x4f')],['id',_0x1126('0x5d'),_0x1126('0x5e')]);return db[_0x1126('0x35')][_0x1126('0x4e')](_['merge'](_0x130f26,_0x22ab18['body']),{'include':_0x22ab18[_0x1126('0x39')][_0x1126('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x5ee130){var _0x5e9260=_0x22ab18['user'][_0x1126('0x2a')]({'plain':!![]});if(!_0x5e9260)throw new Error(_0x1126('0x50'));if(_0x5e9260[_0x1126('0x51')]==='user'){var _0x30e32f=_0x5ee130[_0x1126('0x2a')]({'plain':!![]});var _0x170bf0=[{'name':_0x1126('0x52'),'value':_0x1126('0x53')},{'name':_0x1126('0x2b'),'value':_0x1126('0x2c')}];var _0x49a0a3=_[_0x1126('0x4d')](_0x170bf0,[_0x1126('0x2f'),_0x30e32f[_0x1126('0x37')]])[_0x1126('0x32')];return db[_0x1126('0x54')]['find']({'where':{'name':_0x49a0a3,'userProfileId':_0x5e9260['userProfileId']},'raw':!![]})[_0x1126('0x28')](function(_0x2643d7){if(_0x2643d7&&_0x2643d7['autoAssociation']===0x0){return db[_0x1126('0x56')][_0x1126('0x4e')]({'name':_0x30e32f[_0x1126('0x32')],'resourceId':_0x30e32f['id'],'type':_0x2643d7[_0x1126('0x32')],'sectionId':_0x2643d7['id']},{})[_0x1126('0x28')](function(){return _0x5ee130;});}else{return _0x5ee130;}})[_0x1126('0x59')](function(_0x41ce78){logger[_0x1126('0x57')](_0x1126('0x58'),_0x41ce78);throw _0x41ce78;});}return _0x5ee130;});}})[_0x1126('0x28')](respondWithResult(_0x308ee4,0xc9))[_0x1126('0x59')](handleError(_0x308ee4,null));};exports[_0x1126('0x27')]=function(_0x3dad39,_0x592005){if(_0x3dad39[_0x1126('0x4f')]['id']){delete _0x3dad39[_0x1126('0x4f')]['id'];}return db[_0x1126('0x35')]['find']({'where':{'id':_0x3dad39['params']['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x592005,null))[_0x1126('0x28')](saveUpdates(_0x3dad39[_0x1126('0x4f')],null))[_0x1126('0x28')](respondWithResult(_0x592005,null))['catch'](handleError(_0x592005,null));};exports['destroy']=function(_0x48621e,_0x79afca){return db[_0x1126('0x35')][_0x1126('0x4d')]({'where':{'id':_0x48621e[_0x1126('0x5b')]['id']}})['then'](handleEntityNotFound(_0x79afca,null))[_0x1126('0x28')](removeEntity(_0x79afca,null))['catch'](handleError(_0x79afca,null));};exports[_0x1126('0x5f')]=function(_0x637535,_0x3a4e4c,_0xe8bda7){var _0x3263cf={'raw':![],'where':{}};var _0x1e7c9a={};var _0x9a61b1={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x1126('0x60')]({'where':{'id':_0x637535['params']['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x3a4e4c,null))[_0x1126('0x28')](function(_0x4dd275){if(_0x4dd275){_0x1e7c9a[_0x1126('0x3c')]=_[_0x1126('0x4a')](db['CmHopper'][_0x1126('0x36')]);_0x1e7c9a[_0x1126('0x39')]=_['keys'](_0x637535['query']);_0x1e7c9a[_0x1126('0x3a')]=_[_0x1126('0x3b')](_0x1e7c9a[_0x1126('0x3c')],_0x1e7c9a['query']);_0x3263cf['attributes']=_['intersection'](_0x1e7c9a[_0x1126('0x3c')],qs['fields'](_0x637535['query'][_0x1126('0x3d')]));_0x3263cf['attributes']=_0x3263cf[_0x1126('0x3e')][_0x1126('0x4b')]?_0x3263cf['attributes']:_0x1e7c9a[_0x1126('0x3c')];if(!_0x637535[_0x1126('0x39')][_0x1126('0x3f')](_0x1126('0x40'))){_0x3263cf[_0x1126('0x41')]=qs['limit'](_0x637535[_0x1126('0x39')][_0x1126('0x41')]);_0x3263cf['offset']=qs[_0x1126('0x20')](_0x637535[_0x1126('0x39')][_0x1126('0x20')]);}_0x3263cf[_0x1126('0x61')]=qs[_0x1126('0x42')](_0x637535[_0x1126('0x39')][_0x1126('0x42')]);_0x3263cf[_0x1126('0x43')]=qs[_0x1126('0x3a')](_[_0x1126('0x44')](_0x637535[_0x1126('0x39')],_0x1e7c9a[_0x1126('0x3a')]));_0x3263cf[_0x1126('0x43')][_0x1126('0x62')]=_0x4dd275['id'];if(_0x637535[_0x1126('0x39')][_0x1126('0x2d')]){_0x3263cf['where']=_[_0x1126('0x4c')](_0x3263cf[_0x1126('0x43')],{'$or':_[_0x1126('0x34')](_0x3263cf[_0x1126('0x3e')],function(_0x3be5bf){var _0x4e4eb9={};_0x4e4eb9[_0x3be5bf]={'$like':'%'+_0x637535[_0x1126('0x39')]['filter']+'%'};return _0x4e4eb9;})});}_0x3263cf=_['merge']({},_0x3263cf,_0x637535[_0x1126('0x45')]);return db[_0x1126('0x63')]['count']({'where':_0x3263cf['where']})[_0x1126('0x28')](function(_0x1e70e0){_0x9a61b1[_0x1126('0x46')]=_0x1e70e0;if(_0x637535[_0x1126('0x39')][_0x1126('0x47')]){_0x3263cf[_0x1126('0x48')]=[{'all':!![]}];}return db[_0x1126('0x63')][_0x1126('0x64')](_0x3263cf);})[_0x1126('0x28')](function(_0x5644ea){_0x9a61b1[_0x1126('0x65')]=_0x5644ea;return _0x9a61b1;});}})[_0x1126('0x28')](respondWithFilteredResult(_0x3a4e4c,_0x3263cf))[_0x1126('0x59')](handleError(_0x3a4e4c,null));};exports[_0x1126('0x66')]=function(_0x23c4ab,_0x336b4b,_0x482199){var _0xadea7b={'raw':!![],'where':{}};var _0x2cc4c8={};var _0x194b3c={'count':0x0,'rows':[]};return db[_0x1126('0x35')][_0x1126('0x60')]({'where':{'id':_0x23c4ab[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x336b4b,null))[_0x1126('0x28')](function(_0x38eac6){if(_0x38eac6){_0x2cc4c8[_0x1126('0x3c')]=_['keys'](db['CmHopperHistory'][_0x1126('0x36')]);_0x2cc4c8['query']=_[_0x1126('0x4a')](_0x23c4ab['query']);_0x2cc4c8[_0x1126('0x3a')]=_['intersection'](_0x2cc4c8[_0x1126('0x3c')],_0x2cc4c8['query']);_0xadea7b['attributes']=_['intersection'](_0x2cc4c8[_0x1126('0x3c')],qs[_0x1126('0x3d')](_0x23c4ab['query']['fields']));_0xadea7b[_0x1126('0x3e')]=_0xadea7b[_0x1126('0x3e')][_0x1126('0x4b')]?_0xadea7b['attributes']:_0x2cc4c8['model'];if(!_0x23c4ab[_0x1126('0x39')]['hasOwnProperty'](_0x1126('0x40'))){_0xadea7b[_0x1126('0x41')]=qs[_0x1126('0x41')](_0x23c4ab[_0x1126('0x39')][_0x1126('0x41')]);_0xadea7b['offset']=qs['offset'](_0x23c4ab[_0x1126('0x39')][_0x1126('0x20')]);}_0xadea7b[_0x1126('0x61')]=qs[_0x1126('0x42')](_0x23c4ab[_0x1126('0x39')][_0x1126('0x42')]);_0xadea7b[_0x1126('0x43')]=qs[_0x1126('0x3a')](_[_0x1126('0x44')](_0x23c4ab[_0x1126('0x39')],_0x2cc4c8[_0x1126('0x3a')]));_0xadea7b['where'][_0x1126('0x62')]=_0x38eac6['id'];if(_0x23c4ab['query'][_0x1126('0x2d')]){_0xadea7b['where']=_[_0x1126('0x4c')](_0xadea7b[_0x1126('0x43')],{'$or':_[_0x1126('0x34')](_0xadea7b[_0x1126('0x3e')],function(_0x59c04b){var _0x429183={};_0x429183[_0x59c04b]={'$like':'%'+_0x23c4ab[_0x1126('0x39')]['filter']+'%'};return _0x429183;})});}_0xadea7b=_['merge']({},_0xadea7b,_0x23c4ab[_0x1126('0x45')]);return db[_0x1126('0x67')][_0x1126('0x46')]({'where':_0xadea7b['where']})[_0x1126('0x28')](function(_0x55706a){_0x194b3c[_0x1126('0x46')]=_0x55706a;if(_0x23c4ab[_0x1126('0x39')]['includeAll']){_0xadea7b[_0x1126('0x48')]=[{'all':!![]}];}return db[_0x1126('0x67')][_0x1126('0x64')](_0xadea7b);})[_0x1126('0x28')](function(_0x323d0a){_0x194b3c['rows']=_0x323d0a;return _0x194b3c;});}})[_0x1126('0x28')](respondWithFilteredResult(_0x336b4b,_0xadea7b))[_0x1126('0x59')](handleError(_0x336b4b,null));};exports[_0x1126('0x68')]=function(_0x5b6297,_0x53fd91,_0x55b45e){var _0x9d7607={'raw':!![],'where':{}};var _0x463051={};var _0x1a7c9b={'count':0x0,'rows':[]};return db[_0x1126('0x35')]['findOne']({'where':{'id':_0x5b6297[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x53fd91,null))[_0x1126('0x28')](function(_0x37dae3){if(_0x37dae3){_0x463051[_0x1126('0x3c')]=_['keys'](db[_0x1126('0x69')][_0x1126('0x36')]);_0x463051['query']=_[_0x1126('0x4a')](_0x5b6297['query']);_0x463051['filters']=_[_0x1126('0x3b')](_0x463051['model'],_0x463051[_0x1126('0x39')]);_0x9d7607[_0x1126('0x3e')]=_[_0x1126('0x3b')](_0x463051[_0x1126('0x3c')],qs[_0x1126('0x3d')](_0x5b6297[_0x1126('0x39')][_0x1126('0x3d')]));_0x9d7607[_0x1126('0x3e')]=_0x9d7607[_0x1126('0x3e')]['length']?_0x9d7607[_0x1126('0x3e')]:_0x463051[_0x1126('0x3c')];if(!_0x5b6297[_0x1126('0x39')][_0x1126('0x3f')]('nolimit')){_0x9d7607[_0x1126('0x41')]=qs[_0x1126('0x41')](_0x5b6297[_0x1126('0x39')][_0x1126('0x41')]);_0x9d7607['offset']=qs['offset'](_0x5b6297['query'][_0x1126('0x20')]);}_0x9d7607['order']=qs[_0x1126('0x42')](_0x5b6297[_0x1126('0x39')]['sort']);_0x9d7607['where']=qs[_0x1126('0x3a')](_[_0x1126('0x44')](_0x5b6297['query'],_0x463051[_0x1126('0x3a')]));_0x9d7607[_0x1126('0x43')]['VoiceQueueId']=_0x37dae3['id'];if(_0x5b6297[_0x1126('0x39')]['filter']){_0x9d7607[_0x1126('0x43')]=_[_0x1126('0x4c')](_0x9d7607[_0x1126('0x43')],{'$or':_['map'](_0x9d7607[_0x1126('0x3e')],function(_0x369be4){var _0x4297f5={};_0x4297f5[_0x369be4]={'$like':'%'+_0x5b6297[_0x1126('0x39')][_0x1126('0x2d')]+'%'};return _0x4297f5;})});}_0x9d7607=_[_0x1126('0x4c')]({},_0x9d7607,_0x5b6297[_0x1126('0x45')]);return db[_0x1126('0x69')][_0x1126('0x46')]({'where':_0x9d7607[_0x1126('0x43')]})[_0x1126('0x28')](function(_0x1cacbe){_0x1a7c9b[_0x1126('0x46')]=_0x1cacbe;if(_0x5b6297[_0x1126('0x39')][_0x1126('0x47')]){_0x9d7607[_0x1126('0x48')]=[{'all':!![]}];}return db[_0x1126('0x69')]['findAll'](_0x9d7607);})[_0x1126('0x28')](function(_0x17a50a){_0x1a7c9b['rows']=_0x17a50a;return _0x1a7c9b;});}})['then'](respondWithFilteredResult(_0x53fd91,_0x9d7607))[_0x1126('0x59')](handleError(_0x53fd91,null));};exports[_0x1126('0x6a')]=function(_0x35065c,_0x462522,_0x5c0215){var _0x444f94={'raw':!![],'where':{}};var _0x2c3c80={};var _0x47ad60={'count':0x0,'rows':[]};return db[_0x1126('0x35')]['findOne']({'where':{'id':_0x35065c[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x462522,null))['then'](function(_0x4d43ad){if(_0x4d43ad){_0x2c3c80[_0x1126('0x3c')]=_['keys'](db['CmHopperBlack'][_0x1126('0x36')]);_0x2c3c80[_0x1126('0x39')]=_[_0x1126('0x4a')](_0x35065c[_0x1126('0x39')]);_0x2c3c80['filters']=_['intersection'](_0x2c3c80['model'],_0x2c3c80[_0x1126('0x39')]);_0x444f94[_0x1126('0x3e')]=_['intersection'](_0x2c3c80[_0x1126('0x3c')],qs[_0x1126('0x3d')](_0x35065c[_0x1126('0x39')][_0x1126('0x3d')]));_0x444f94[_0x1126('0x3e')]=_0x444f94[_0x1126('0x3e')][_0x1126('0x4b')]?_0x444f94[_0x1126('0x3e')]:_0x2c3c80[_0x1126('0x3c')];if(!_0x35065c[_0x1126('0x39')][_0x1126('0x3f')]('nolimit')){_0x444f94[_0x1126('0x41')]=qs['limit'](_0x35065c[_0x1126('0x39')][_0x1126('0x41')]);_0x444f94[_0x1126('0x20')]=qs['offset'](_0x35065c[_0x1126('0x39')][_0x1126('0x20')]);}_0x444f94[_0x1126('0x61')]=qs['sort'](_0x35065c[_0x1126('0x39')][_0x1126('0x42')]);_0x444f94[_0x1126('0x43')]=qs[_0x1126('0x3a')](_[_0x1126('0x44')](_0x35065c['query'],_0x2c3c80['filters']));_0x444f94[_0x1126('0x43')][_0x1126('0x62')]=_0x4d43ad['id'];if(_0x35065c[_0x1126('0x39')][_0x1126('0x2d')]){_0x444f94[_0x1126('0x43')]=_[_0x1126('0x4c')](_0x444f94[_0x1126('0x43')],{'$or':_[_0x1126('0x34')](_0x444f94[_0x1126('0x3e')],function(_0x2fb228){var _0x2c95b6={};_0x2c95b6[_0x2fb228]={'$like':'%'+_0x35065c['query']['filter']+'%'};return _0x2c95b6;})});}_0x444f94=_[_0x1126('0x4c')]({},_0x444f94,_0x35065c[_0x1126('0x45')]);return db[_0x1126('0x6b')]['count']({'where':_0x444f94['where']})[_0x1126('0x28')](function(_0x372563){_0x47ad60[_0x1126('0x46')]=_0x372563;if(_0x35065c['query'][_0x1126('0x47')]){_0x444f94[_0x1126('0x48')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x1126('0x64')](_0x444f94);})[_0x1126('0x28')](function(_0x32e5d7){_0x47ad60[_0x1126('0x65')]=_0x32e5d7;return _0x47ad60;});}})[_0x1126('0x28')](respondWithFilteredResult(_0x462522,_0x444f94))['catch'](handleError(_0x462522,null));};exports[_0x1126('0x6c')]=function(_0x1140ec,_0x59f637,_0x578f5c){var _0x559dae={};var _0x2addc7={};var _0x1f3faa;var _0xd20754;return db[_0x1126('0x35')][_0x1126('0x60')]({'where':{'id':_0x1140ec['params']['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x59f637,null))['then'](function(_0x24b745){if(_0x24b745){_0x1f3faa=_0x24b745;_0x2addc7[_0x1126('0x3c')]=_['keys'](db['Team'][_0x1126('0x36')]);_0x2addc7[_0x1126('0x39')]=_['keys'](_0x1140ec['query']);_0x2addc7[_0x1126('0x3a')]=_[_0x1126('0x3b')](_0x2addc7[_0x1126('0x3c')],_0x2addc7[_0x1126('0x39')]);_0x559dae[_0x1126('0x3e')]=_[_0x1126('0x3b')](_0x2addc7[_0x1126('0x3c')],qs[_0x1126('0x3d')](_0x1140ec[_0x1126('0x39')][_0x1126('0x3d')]));_0x559dae['attributes']=_0x559dae['attributes'][_0x1126('0x4b')]?_0x559dae[_0x1126('0x3e')]:_0x2addc7[_0x1126('0x3c')];_0x559dae[_0x1126('0x61')]=qs[_0x1126('0x42')](_0x1140ec[_0x1126('0x39')]['sort']);_0x559dae['where']=qs[_0x1126('0x3a')](_['pick'](_0x1140ec['query'],_0x2addc7[_0x1126('0x3a')]));if(_0x1140ec[_0x1126('0x39')]['filter']){_0x559dae[_0x1126('0x43')]=_[_0x1126('0x4c')](_0x559dae[_0x1126('0x43')],{'$or':_[_0x1126('0x34')](_0x559dae['attributes'],function(_0x2a969c){var _0x2ea320={};_0x2ea320[_0x2a969c]={'$like':'%'+_0x1140ec[_0x1126('0x39')][_0x1126('0x2d')]+'%'};return _0x2ea320;})});}_0x559dae=_[_0x1126('0x4c')]({},_0x559dae,_0x1140ec[_0x1126('0x45')]);return _0x1f3faa[_0x1126('0x6c')](_0x559dae);}})['then'](function(_0x41e475){if(_0x41e475){_0xd20754=_0x41e475[_0x1126('0x4b')];if(!_0x1140ec[_0x1126('0x39')][_0x1126('0x3f')]('nolimit')){_0x559dae[_0x1126('0x41')]=qs[_0x1126('0x41')](_0x1140ec['query'][_0x1126('0x41')]);_0x559dae[_0x1126('0x20')]=qs[_0x1126('0x20')](_0x1140ec['query'][_0x1126('0x20')]);}return _0x1f3faa[_0x1126('0x6c')](_0x559dae);}})[_0x1126('0x28')](function(_0xddc3e1){if(_0xddc3e1){return _0xddc3e1?{'count':_0xd20754,'rows':_0xddc3e1}:null;}})[_0x1126('0x28')](respondWithResult(_0x59f637,null))[_0x1126('0x59')](handleError(_0x59f637,null));};exports['addTeams']=function(_0x206e9f,_0x3bf6b5,_0x49a1dd){var _0x18592b=_0x206e9f[_0x1126('0x4f')][_0x1126('0x6d')];var _0xd09fb0=_[_0x1126('0x34')](_0x18592b,'id');return db[_0x1126('0x6e')]['findAll']({'where':{'id':_0xd09fb0},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1126('0x6f'),'attributes':['id',_0x1126('0x32'),_0x1126('0x70'),_0x1126('0x71'),_0x1126('0x72')],'raw':!![]}]})[_0x1126('0x28')](function(_0xbaac37){if(_0xbaac37){var _0x2047eb=_[_0x1126('0x73')](_0xbaac37,function(_0x1a963c){var _0x1ceca5=_0x1a963c[_0x1126('0x2a')]({'plain':!![]});_0x1ceca5[_0x1126('0x6f')][_0x1126('0x74')](function(_0xd1c9ae){_0xd1c9ae[_0x1126('0x75')]=_[_0x1126('0x4d')](_0x18592b,{'id':_0x1ceca5['id']})[_0x1126('0x75')];});return _0x1ceca5[_0x1126('0x6f')];});return db[_0x1126('0x35')][_0x1126('0x4d')]({'where':{'id':_0x206e9f[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](function(_0x134387){return db[_0x1126('0x76')]['transaction'](function(_0x1445ca){return _0x134387['addTeams'](_0xd09fb0,{'transaction':_0x1445ca})[_0x1126('0x28')](function(){return BPromise[_0x1126('0x77')](_0x18592b,function(_0x7d4af8){return db['TeamVoiceQueue'][_0x1126('0x78')]({'TeamId':_0x7d4af8['id'],'VoiceQueueId':_0x206e9f['params']['id'],'penalty':_0x7d4af8[_0x1126('0x75')]},{'transaction':_0x1445ca});});})[_0x1126('0x28')](function(){return BPromise['each'](_0x2047eb,function(_0x3472db){return db[_0x1126('0x79')][_0x1126('0x7a')]({'where':{'UserId':_0x3472db['id'],'VoiceQueueId':_0x206e9f[_0x1126('0x5b')]['id']},'defaults':{'penalty':_0x3472db[_0x1126('0x75')]},'transaction':_0x1445ca});});})[_0x1126('0x28')](function(){return BPromise[_0x1126('0x77')](_[_0x1126('0x2d')](_0x2047eb,{'online':!![]}),function(_0x1b657b){return db['UserVoiceQueueRt'][_0x1126('0x78')]({'membername':_0x1b657b[_0x1126('0x32')],'UserId':_0x1b657b['id'],'queue_name':_0x134387[_0x1126('0x32')],'VoiceQueueId':_0x134387['id'],'interface':_[_0x1126('0x7b')](_0x1b657b['interface'])?util['format']('SIP/%s',_0x1b657b['name']):_0x1b657b[_0x1126('0x72')],'paused':_0x1b657b['voicePause']||![],'penalty':_0x1b657b[_0x1126('0x75')]},{'transaction':_0x1445ca});});})[_0x1126('0x28')](function(){_0x2047eb[_0x1126('0x74')](function(_0xdbbf9){socket[_0x1126('0x7c')](_0x1126('0x7d'),{'UserId':_0xdbbf9['id'],'VoiceQueueId':_0x134387['id']});});});});});}})['then'](respondWithStatusCode(_0x3bf6b5,null))[_0x1126('0x59')](handleError(_0x3bf6b5,null));};exports['removeTeams']=function(_0x35abd9,_0x2759f2,_0x176d75){return db[_0x1126('0x6e')][_0x1126('0x64')]({'where':{'id':_0x35abd9[_0x1126('0x39')][_0x1126('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x1126('0x7f')],'as':_0x1126('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x1126('0x28')](handleEntityNotFound(_0x2759f2,null))[_0x1126('0x28')](function(_0x5ca18d){var _0x40536a=_[_0x1126('0x34')](_0x5ca18d,'id');var _0x278b0b=[];var _0x103101=[];var _0xa1d5fc=squel[_0x1126('0x80')]();_0xa1d5fc[_0x1126('0x81')]('tq.TeamId')['from']('team_has_voice_queues','tq')[_0x1126('0x82')](_0x1126('0x83'),'ut',_0x1126('0x84'))['where'](_0x1126('0x85'),_0x35abd9[_0x1126('0x5b')]['id']);for(var _0x5f0662=0x0;_0x5f0662<_0x5ca18d['length'];_0x5f0662+=0x1){let _0x2c4e1d=_0x5ca18d[_0x5f0662];for(var _0x258601=0x0;_0x258601<_0x2c4e1d[_0x1126('0x6f')][_0x1126('0x4b')];_0x258601+=0x1){let _0x18b3db=_0x2c4e1d[_0x1126('0x6f')][_0x258601];var _0x47ad85=_0xa1d5fc[_0x1126('0x5a')]();_0x47ad85[_0x1126('0x43')](_0x1126('0x86'),_0x18b3db['id']);_0x103101[_0x1126('0x87')](db[_0x1126('0x76')][_0x1126('0x39')](_0x47ad85[_0x1126('0x88')](),{'type':db[_0x1126('0x76')]['QueryTypes'][_0x1126('0x89')]})[_0x1126('0x28')](function(_0x4ce88f){if(_0x4ce88f[_0x1126('0x4b')]===0x1){return _0x18b3db['id'];}else{var _0x114be3=_['every'](_[_0x1126('0x34')](_0x4ce88f,_0x1126('0x8a')),function(_0x3939ec){return _['includes'](_0x40536a,_0x3939ec);});if(_0x114be3){return _0x18b3db['id'];}}}));}}return BPromise[_0x1126('0x8b')](_0x103101)[_0x1126('0x28')](function(_0xfb954d){_0x278b0b=_(_0x278b0b)[_0x1126('0x8c')](_0xfb954d)[_0x1126('0x8d')]()[_0x1126('0x2f')]();return db[_0x1126('0x35')][_0x1126('0x4d')]({'where':{'id':_0x35abd9[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](function(_0x2f5410){return db[_0x1126('0x76')][_0x1126('0x8e')](function(_0x52cb0f){return _0x2f5410[_0x1126('0x8f')](_0x35abd9[_0x1126('0x39')][_0x1126('0x7e')],{'transaction':_0x52cb0f})[_0x1126('0x28')](function(){if(!_['isEmpty'](_0x278b0b)){return _0x2f5410[_0x1126('0x90')](_0x278b0b,{'transaction':_0x52cb0f})[_0x1126('0x28')](function(){return db['UserVoiceQueueRt'][_0x1126('0x29')]({'where':{'VoiceQueueId':_0x35abd9[_0x1126('0x5b')]['id'],'UserId':_0x278b0b},'transaction':_0x52cb0f});});}})['then'](function(){_0x278b0b[_0x1126('0x74')](function(_0x584982){socket[_0x1126('0x7c')](_0x1126('0x91'),{'UserId':_0x584982,'VoiceQueueId':_0x2f5410['id']});});});});});});})['then'](respondWithStatusCode(_0x2759f2,null))[_0x1126('0x59')](handleError(_0x2759f2,null));};exports[_0x1126('0x92')]=function(_0x5bb99c,_0x5123fe,_0x442f0c){var _0x1b0393,_0x40c2f6;return db[_0x1126('0x35')][_0x1126('0x4d')]({'where':{'id':_0x5bb99c[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x5123fe,null))['then'](function(_0x16f42d){if(_0x16f42d){_0x40c2f6=_0x16f42d;return _0x16f42d[_0x1126('0x92')](_0x5bb99c[_0x1126('0x4f')][_0x1126('0x7e')],_['omit'](_0x5bb99c[_0x1126('0x4f')],['ids','id'])||{})[_0x1126('0x93')](function(_0x5c7821){for(var _0x25320b=0x0;_0x25320b<_0x5bb99c[_0x1126('0x4f')][_0x1126('0x7e')][_0x1126('0x4b')];_0x25320b+=0x1){socket[_0x1126('0x7c')](_0x1126('0x7d'),{'UserId':Number(_0x5bb99c[_0x1126('0x4f')]['ids'][_0x25320b]),'VoiceQueueId':Number(_0x5bb99c[_0x1126('0x5b')]['id'])});}return _0x5c7821;});}})[_0x1126('0x28')](function(_0x433515){_0x1b0393=_0x433515||[];if(_0x40c2f6){return db[_0x1126('0x7f')][_0x1126('0x64')]({'where':{'id':_0x5bb99c['body'][_0x1126('0x7e')]},'attributes':['id',_0x1126('0x32'),_0x1126('0x70'),'voicePause',_0x1126('0x72')],'raw':!![]});}})['then'](function(_0x3251e5){if(!_['isEmpty'](_0x3251e5)){var _0x5eac31=[];for(var _0x509040=0x0;_0x509040<_0x3251e5[_0x1126('0x4b')];_0x509040++){if(_0x3251e5[_0x509040][_0x1126('0x70')]){_0x5eac31[_0x1126('0x87')](db[_0x1126('0x94')][_0x1126('0x78')]({'membername':_0x3251e5[_0x509040][_0x1126('0x32')],'UserId':_0x3251e5[_0x509040]['id'],'queue_name':_0x40c2f6[_0x1126('0x32')],'VoiceQueueId':_0x40c2f6['id'],'interface':_[_0x1126('0x7b')](_0x3251e5[_0x509040]['interface'])?util['format'](_0x1126('0x95'),_0x3251e5[_0x509040][_0x1126('0x32')]):_0x3251e5[_0x509040][_0x1126('0x72')],'paused':_0x3251e5[_0x509040][_0x1126('0x71')]||![],'penalty':_0x5bb99c[_0x1126('0x4f')][_0x1126('0x75')]||0x0}));}}return BPromise[_0x1126('0x8b')](_0x5eac31);}})[_0x1126('0x28')](function(){return _0x1b0393;})['then'](respondWithResult(_0x5123fe,null))['catch'](handleError(_0x5123fe,null));};exports[_0x1126('0x90')]=function(_0xdaef78,_0x386d7f,_0xae6a66){return db[_0x1126('0x35')]['find']({'where':{'id':_0xdaef78[_0x1126('0x5b')]['id']}})['then'](handleEntityNotFound(_0x386d7f,null))[_0x1126('0x28')](function(_0x56d4f4){if(_0x56d4f4){return _0x56d4f4[_0x1126('0x90')](_0xdaef78[_0x1126('0x39')][_0x1126('0x7e')])[_0x1126('0x28')](function(){if(_['isArray'](_0xdaef78['query'][_0x1126('0x7e')])){for(var _0x21c509=0x0;_0x21c509<_0xdaef78[_0x1126('0x39')]['ids'][_0x1126('0x4b')];_0x21c509+=0x1){socket[_0x1126('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0xdaef78['query'][_0x1126('0x7e')][_0x21c509]),'VoiceQueueId':Number(_0xdaef78[_0x1126('0x5b')]['id'])});}}else{socket[_0x1126('0x7c')](_0x1126('0x91'),{'UserId':Number(_0xdaef78[_0x1126('0x39')][_0x1126('0x7e')]),'VoiceQueueId':Number(_0xdaef78['params']['id'])});}});}})[_0x1126('0x28')](function(_0x89dfab){return db[_0x1126('0x94')]['destroy']({'where':{'VoiceQueueId':_0xdaef78[_0x1126('0x5b')]['id'],'UserId':_0xdaef78[_0x1126('0x39')][_0x1126('0x7e')]}})[_0x1126('0x28')](function(){return _0x89dfab;});})[_0x1126('0x28')](respondWithStatusCode(_0x386d7f,null))[_0x1126('0x59')](handleError(_0x386d7f,null));};exports[_0x1126('0x96')]=function(_0x5b53f5,_0x4fc622,_0x237acc){var _0x338259={};var _0x299c35={};var _0x40a8f8;var _0x200a50;return db[_0x1126('0x35')][_0x1126('0x60')]({'where':{'id':_0x5b53f5[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x4fc622,null))[_0x1126('0x28')](function(_0x528eda){if(_0x528eda){_0x40a8f8=_0x528eda;_0x299c35[_0x1126('0x3c')]=_[_0x1126('0x4a')](db['User'][_0x1126('0x36')]);_0x299c35['query']=_[_0x1126('0x4a')](_0x5b53f5[_0x1126('0x39')]);_0x299c35['filters']=_['intersection'](_0x299c35[_0x1126('0x3c')],_0x299c35['query']);_0x338259[_0x1126('0x3e')]=_[_0x1126('0x3b')](_0x299c35[_0x1126('0x3c')],qs['fields'](_0x5b53f5[_0x1126('0x39')][_0x1126('0x3d')]));_0x338259[_0x1126('0x3e')]=_0x338259['attributes']['length']?_0x338259[_0x1126('0x3e')]:_0x299c35[_0x1126('0x3c')];_0x338259[_0x1126('0x61')]=qs[_0x1126('0x42')](_0x5b53f5[_0x1126('0x39')]['sort']);_0x338259[_0x1126('0x43')]=qs[_0x1126('0x3a')](_[_0x1126('0x44')](_0x5b53f5[_0x1126('0x39')],_0x299c35[_0x1126('0x3a')]));if(_0x5b53f5[_0x1126('0x39')][_0x1126('0x2d')]){_0x338259[_0x1126('0x43')]=_[_0x1126('0x4c')](_0x338259[_0x1126('0x43')],{'$or':_[_0x1126('0x34')](_0x338259[_0x1126('0x3e')],function(_0xaa77ad){var _0xeca280={};_0xeca280[_0xaa77ad]={'$like':'%'+_0x5b53f5['query'][_0x1126('0x2d')]+'%'};return _0xeca280;})});}_0x338259=_['merge']({},_0x338259,_0x5b53f5[_0x1126('0x45')]);return _0x40a8f8[_0x1126('0x96')](_0x338259);}})['then'](function(_0xceeb86){if(_0xceeb86){_0x200a50=_0xceeb86['length'];if(!_0x5b53f5[_0x1126('0x39')][_0x1126('0x3f')]('nolimit')){_0x338259['limit']=qs[_0x1126('0x41')](_0x5b53f5[_0x1126('0x39')]['limit']);_0x338259['offset']=qs[_0x1126('0x20')](_0x5b53f5[_0x1126('0x39')][_0x1126('0x20')]);}return _0x40a8f8[_0x1126('0x96')](_0x338259);}})['then'](function(_0x289910){if(_0x289910){return _0x289910?{'count':_0x200a50,'rows':_0x289910}:null;}})['then'](respondWithResult(_0x4fc622,null))[_0x1126('0x59')](handleError(_0x4fc622,null));};exports[_0x1126('0x97')]=function(_0x44cb03,_0x214cb8,_0x3085cb){var _0x333c0e={};var _0x5e4d88={};var _0x375464;var _0x189592;return db[_0x1126('0x35')][_0x1126('0x60')]({'where':{'id':_0x44cb03[_0x1126('0x5b')]['id']}})['then'](handleEntityNotFound(_0x214cb8,null))[_0x1126('0x28')](function(_0x330dd4){if(_0x330dd4){_0x375464=_0x330dd4;_0x5e4d88[_0x1126('0x3c')]=_[_0x1126('0x4a')](db['UserVoiceQueueRt'][_0x1126('0x36')]);_0x5e4d88[_0x1126('0x39')]=_[_0x1126('0x4a')](_0x44cb03[_0x1126('0x39')]);_0x5e4d88[_0x1126('0x3a')]=_[_0x1126('0x3b')](_0x5e4d88[_0x1126('0x3c')],_0x5e4d88[_0x1126('0x39')]);_0x333c0e[_0x1126('0x3e')]=_['intersection'](_0x5e4d88[_0x1126('0x3c')],qs[_0x1126('0x3d')](_0x44cb03[_0x1126('0x39')]['fields']));_0x333c0e[_0x1126('0x3e')]=_0x333c0e[_0x1126('0x3e')][_0x1126('0x4b')]?_0x333c0e[_0x1126('0x3e')]:_0x5e4d88[_0x1126('0x3c')];_0x333c0e['order']=qs[_0x1126('0x42')](_0x44cb03[_0x1126('0x39')][_0x1126('0x42')]);_0x333c0e['where']=qs[_0x1126('0x3a')](_[_0x1126('0x44')](_0x44cb03['query'],_0x5e4d88['filters']));if(_0x44cb03['query'][_0x1126('0x2d')]){_0x333c0e[_0x1126('0x43')]=_[_0x1126('0x4c')](_0x333c0e['where'],{'$or':_[_0x1126('0x34')](_0x333c0e['attributes'],function(_0x4ca726){var _0x17d099={};_0x17d099[_0x4ca726]={'$like':'%'+_0x44cb03[_0x1126('0x39')][_0x1126('0x2d')]+'%'};return _0x17d099;})});}_0x333c0e=_[_0x1126('0x4c')]({},_0x333c0e,_0x44cb03['options']);return _0x375464[_0x1126('0x97')](_0x333c0e);}})[_0x1126('0x28')](function(_0x4342e2){if(_0x4342e2){_0x189592=_0x4342e2[_0x1126('0x4b')];if(!_0x44cb03[_0x1126('0x39')]['hasOwnProperty'](_0x1126('0x40'))){_0x333c0e[_0x1126('0x41')]=qs['limit'](_0x44cb03[_0x1126('0x39')]['limit']);_0x333c0e[_0x1126('0x20')]=qs['offset'](_0x44cb03['query']['offset']);}return _0x375464[_0x1126('0x97')](_0x333c0e);}})[_0x1126('0x28')](function(_0x5aae02){return _0x5aae02?{'count':_0x189592,'rows':_0x5aae02}:null;})[_0x1126('0x28')](respondWithResult(_0x214cb8,null))[_0x1126('0x59')](handleError(_0x214cb8,null));};exports['getLists']=function(_0x205c52,_0x40f92f,_0x11a440){var _0x220b02={};var _0x48d62d={};var _0x206063;var _0x3e437c;return db[_0x1126('0x35')]['findOne']({'where':{'id':_0x205c52[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x40f92f,null))[_0x1126('0x28')](function(_0x249fa6){if(_0x249fa6){_0x206063=_0x249fa6;_0x48d62d[_0x1126('0x3c')]=_[_0x1126('0x4a')](db[_0x1126('0x98')][_0x1126('0x36')]);_0x48d62d[_0x1126('0x39')]=_['keys'](_0x205c52[_0x1126('0x39')]);_0x48d62d['filters']=_[_0x1126('0x3b')](_0x48d62d['model'],_0x48d62d[_0x1126('0x39')]);_0x220b02[_0x1126('0x3e')]=_[_0x1126('0x3b')](_0x48d62d[_0x1126('0x3c')],qs[_0x1126('0x3d')](_0x205c52[_0x1126('0x39')]['fields']));_0x220b02[_0x1126('0x3e')]=_0x220b02[_0x1126('0x3e')][_0x1126('0x4b')]?_0x220b02[_0x1126('0x3e')]:_0x48d62d[_0x1126('0x3c')];_0x220b02[_0x1126('0x61')]=qs['sort'](_0x205c52[_0x1126('0x39')][_0x1126('0x42')]);_0x220b02['where']=qs['filters'](_[_0x1126('0x44')](_0x205c52[_0x1126('0x39')],_0x48d62d[_0x1126('0x3a')]));if(_0x205c52['query']['filter']){_0x220b02['where']=_['merge'](_0x220b02['where'],{'$or':_['map'](_0x220b02[_0x1126('0x3e')],function(_0x919311){var _0x39f99a={};_0x39f99a[_0x919311]={'$like':'%'+_0x205c52[_0x1126('0x39')][_0x1126('0x2d')]+'%'};return _0x39f99a;})});}_0x220b02=_['merge']({},_0x220b02,_0x205c52['options']);return _0x206063[_0x1126('0x99')](_0x220b02);}})['then'](function(_0x1d743c){if(_0x1d743c){_0x3e437c=_0x1d743c[_0x1126('0x4b')];if(!_0x205c52[_0x1126('0x39')][_0x1126('0x3f')]('nolimit')){_0x220b02[_0x1126('0x41')]=qs[_0x1126('0x41')](_0x205c52[_0x1126('0x39')][_0x1126('0x41')]);_0x220b02[_0x1126('0x20')]=qs['offset'](_0x205c52[_0x1126('0x39')][_0x1126('0x20')]);}return _0x206063[_0x1126('0x99')](_0x220b02);}})[_0x1126('0x28')](function(_0x115006){if(_0x115006){return _0x115006?{'count':_0x3e437c,'rows':_0x115006}:null;}})[_0x1126('0x28')](respondWithResult(_0x40f92f,null))[_0x1126('0x59')](handleError(_0x40f92f,null));};exports[_0x1126('0x9a')]=function(_0x3af933,_0x24f211,_0x14b801){var _0x195f47=moment()[_0x1126('0x9b')]('YYYY-MM-DD\x20HH:mm:ss');var _0xe19371,_0x43f0c1;return db[_0x1126('0x35')]['find']({'where':{'id':_0x3af933['params']['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x24f211,null))[_0x1126('0x28')](function(_0x2eb42e){if(_0x2eb42e){_0x43f0c1=_0x2eb42e;return _0x2eb42e[_0x1126('0x9a')](_0x3af933[_0x1126('0x4f')][_0x1126('0x7e')],_['omit'](_0x3af933[_0x1126('0x4f')],[_0x1126('0x7e'),'id'])||{});}return null;})[_0x1126('0x93')](function(_0xa6f5ce){var _0x42ebce;_0xe19371=_0xa6f5ce||[];var _0x20649c=[];if(_0xa6f5ce){for(var _0x476ac4=0x0;_0x476ac4<_0xa6f5ce['length'];_0x476ac4+=0x1){var _0x8f4885=_0xa6f5ce[_0x476ac4]['get']({'plain':!![]});_0x43f0c1[_0x1126('0x9c')]=_0x3af933[_0x1126('0x4f')][_0x1126('0x9c')]?_0x3af933['body'][_0x1126('0x9c')]:_0x43f0c1[_0x1126('0x9c')];switch(_0x43f0c1[_0x1126('0x9c')]){case'always':_0x42ebce=squel[_0x1126('0x9d')]()[_0x1126('0x9e')](_0x1126('0x9f'))[_0x1126('0xa0')]([_0x1126('0xa1'),_0x1126('0xa2'),_0x1126('0xa3'),_0x1126('0xa4'),_0x1126('0x62'),'createdAt',_0x1126('0x5e')],squel[_0x1126('0x80')]()[_0x1126('0x81')](_0x1126('0xa1'),_0x1126('0xa1'))[_0x1126('0x81')]('\x27'+_0x195f47+'\x27',_0x1126('0xa2'))[_0x1126('0x81')]('id',_0x1126('0xa3'))[_0x1126('0x81')](_0x8f4885[_0x1126('0xa5')]['toString'](),_0x1126('0xa4'))[_0x1126('0x81')](_0x3af933[_0x1126('0x5b')]['id']['toString'](),'VoiceQueueId')['field']('\x27'+_0x195f47+'\x27','createdAt')['field']('\x27'+_0x195f47+'\x27',_0x1126('0x5e'))[_0x1126('0xa6')](_0x1126('0xa7'))[_0x1126('0x43')]('deletedAt\x20IS\x20NULL')[_0x1126('0x43')](_0x1126('0xa8'),_0x8f4885[_0x1126('0xa5')]['toString']())['where'](_0x1126('0xa9'))[_0x1126('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1126('0x80')]()[_0x1126('0x81')](_0x1126('0xaa'))[_0x1126('0xa6')]('cm_hopper_final')[_0x1126('0x43')](_0x1126('0x85'),_0x3af933['params']['id'][_0x1126('0x88')]()))[_0x1126('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1126('0x80')]()[_0x1126('0x81')](_0x1126('0xab'))['from'](_0x1126('0x9f'))[_0x1126('0x43')](_0x1126('0x85'),_0x3af933[_0x1126('0x5b')]['id'][_0x1126('0x88')]())))[_0x1126('0x88')]();break;case _0x1126('0xac'):_0x42ebce=squel[_0x1126('0x9d')]()['into'](_0x1126('0x9f'))['fromQuery']([_0x1126('0xa1'),'scheduledAt',_0x1126('0xa3'),_0x1126('0xa4'),'VoiceQueueId',_0x1126('0x5d'),_0x1126('0x5e')],squel['select']()[_0x1126('0x81')](_0x1126('0xa1'),_0x1126('0xa1'))[_0x1126('0x81')]('\x27'+_0x195f47+'\x27',_0x1126('0xa2'))[_0x1126('0x81')]('id',_0x1126('0xa3'))['field'](_0x8f4885[_0x1126('0xa5')][_0x1126('0x88')](),_0x1126('0xa4'))[_0x1126('0x81')](_0x3af933[_0x1126('0x5b')]['id'][_0x1126('0x88')](),_0x1126('0x62'))[_0x1126('0x81')]('\x27'+_0x195f47+'\x27',_0x1126('0x5d'))['field']('\x27'+_0x195f47+'\x27',_0x1126('0x5e'))['from'](_0x1126('0xa7'))[_0x1126('0x43')](_0x1126('0xad'))[_0x1126('0x43')](_0x1126('0xa8'),_0x8f4885[_0x1126('0xa5')][_0x1126('0x88')]())[_0x1126('0x43')](_0x1126('0xa9'))[_0x1126('0x43')](_0x1126('0xae'),squel[_0x1126('0x80')]()[_0x1126('0x81')]('COALESCE(phone,\x27\x27)')[_0x1126('0xa6')](_0x1126('0x9f'))[_0x1126('0x43')](_0x1126('0x85'),_0x3af933[_0x1126('0x5b')]['id'][_0x1126('0x88')]())))[_0x1126('0x88')]();break;default:_0x42ebce=squel['insert']()[_0x1126('0x9e')](_0x1126('0x9f'))[_0x1126('0xa0')](['phone',_0x1126('0xa2'),'ContactId',_0x1126('0xa4'),'VoiceQueueId',_0x1126('0x5d'),_0x1126('0x5e')],squel[_0x1126('0x80')]()[_0x1126('0x81')](_0x1126('0xa1'),_0x1126('0xa1'))['field']('\x27'+_0x195f47+'\x27',_0x1126('0xa2'))['field']('id',_0x1126('0xa3'))[_0x1126('0x81')](_0x8f4885['CmListId'][_0x1126('0x88')](),'ListId')[_0x1126('0x81')](_0x3af933[_0x1126('0x5b')]['id'][_0x1126('0x88')](),'VoiceQueueId')[_0x1126('0x81')]('\x27'+_0x195f47+'\x27',_0x1126('0x5d'))[_0x1126('0x81')]('\x27'+_0x195f47+'\x27',_0x1126('0x5e'))[_0x1126('0xa6')](_0x1126('0xa7'))[_0x1126('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0x1126('0xa8'),_0x8f4885[_0x1126('0xa5')]['toString']())[_0x1126('0x43')](_0x1126('0xa9')))[_0x1126('0x88')]();}_0x20649c['push'](db[_0x1126('0x76')][_0x1126('0x39')](_0x42ebce));}return BPromise[_0x1126('0x8b')](_0x20649c);}})[_0x1126('0x28')](function(){var _0x572cd9=[];var _0x39a5d8=squel['insert']()[_0x1126('0x9e')](_0x1126('0xaf'))[_0x1126('0xa0')]([_0x1126('0xb0'),'phone',_0x1126('0xb1'),_0x1126('0x5d'),_0x1126('0x5e')],squel[_0x1126('0x80')]()[_0x1126('0x81')](_0x1126('0xb2'))[_0x1126('0x81')]('ci.item')[_0x1126('0x81')](_0x1126('0xb3'))['field']('\x27'+_0x195f47+'\x27',_0x1126('0x5d'))['field']('\x27'+_0x195f47+'\x27',_0x1126('0x5e'))[_0x1126('0xa6')](_0x1126('0xb4'),'ci')['join']('cm_hopper','h',_0x1126('0xb5'))[_0x1126('0x43')](_0x1126('0xb6'),_0x195f47)[_0x1126('0x43')](_0x1126('0xb7'),_0x1126('0xb8')))[_0x1126('0x88')]();_0x572cd9['push'](db[_0x1126('0x76')][_0x1126('0x39')](_0x39a5d8));return BPromise[_0x1126('0x8b')](_0x572cd9);})[_0x1126('0x28')](function(){return _0xe19371;})['then'](respondWithResult(_0x24f211,null))[_0x1126('0x59')](handleError(_0x24f211,null));};exports[_0x1126('0xb9')]=function(_0x2e768c,_0x32bf1e,_0x40cb5b){return db[_0x1126('0x35')][_0x1126('0x4d')]({'where':{'id':_0x2e768c['params']['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x32bf1e,null))[_0x1126('0x28')](function(_0x262e04){if(_0x262e04){return _0x262e04[_0x1126('0xb9')](_0x2e768c[_0x1126('0x39')][_0x1126('0x7e')]);}})['then'](function(_0x358d9a){if(_0x358d9a){return db[_0x1126('0x63')][_0x1126('0x29')]({'where':{'ListId':_0x2e768c[_0x1126('0x39')]['ids'],'VoiceQueueId':_0x2e768c[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](function(){return _0x358d9a;});}})[_0x1126('0x28')](respondWithStatusCode(_0x32bf1e,null))[_0x1126('0x59')](handleError(_0x32bf1e,null));};exports[_0x1126('0xba')]=function(_0x173636,_0x2741a6,_0x3b87d2){var _0x236faa={};var _0x20b698={};var _0xc86426;var _0x27b56e;return db['VoiceQueue']['findOne']({'where':{'id':_0x173636[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x2741a6,null))[_0x1126('0x28')](function(_0x315256){if(_0x315256){_0xc86426=_0x315256;_0x20b698['model']=_[_0x1126('0x4a')](db[_0x1126('0x98')]['rawAttributes']);_0x20b698[_0x1126('0x39')]=_['keys'](_0x173636['query']);_0x20b698['filters']=_[_0x1126('0x3b')](_0x20b698[_0x1126('0x3c')],_0x20b698['query']);_0x236faa['attributes']=_[_0x1126('0x3b')](_0x20b698[_0x1126('0x3c')],qs[_0x1126('0x3d')](_0x173636[_0x1126('0x39')]['fields']));_0x236faa[_0x1126('0x3e')]=_0x236faa[_0x1126('0x3e')]['length']?_0x236faa['attributes']:_0x20b698[_0x1126('0x3c')];_0x236faa[_0x1126('0x61')]=qs['sort'](_0x173636['query'][_0x1126('0x42')]);_0x236faa[_0x1126('0x43')]=qs[_0x1126('0x3a')](_[_0x1126('0x44')](_0x173636['query'],_0x20b698[_0x1126('0x3a')]));if(_0x173636[_0x1126('0x39')][_0x1126('0x2d')]){_0x236faa[_0x1126('0x43')]=_[_0x1126('0x4c')](_0x236faa[_0x1126('0x43')],{'$or':_['map'](_0x236faa['attributes'],function(_0x11cf0a){var _0x493d9c={};_0x493d9c[_0x11cf0a]={'$like':'%'+_0x173636['query'][_0x1126('0x2d')]+'%'};return _0x493d9c;})});}_0x236faa=_['merge']({},_0x236faa,_0x173636[_0x1126('0x45')]);return _0xc86426[_0x1126('0xba')](_0x236faa);}})['then'](function(_0x39fe62){if(_0x39fe62){_0x27b56e=_0x39fe62['length'];if(!_0x173636[_0x1126('0x39')][_0x1126('0x3f')](_0x1126('0x40'))){_0x236faa[_0x1126('0x41')]=qs[_0x1126('0x41')](_0x173636['query'][_0x1126('0x41')]);_0x236faa[_0x1126('0x20')]=qs[_0x1126('0x20')](_0x173636['query'][_0x1126('0x20')]);}return _0xc86426[_0x1126('0xba')](_0x236faa);}})['then'](function(_0x14d4db){if(_0x14d4db){return _0x14d4db?{'count':_0x27b56e,'rows':_0x14d4db}:null;}})['then'](respondWithResult(_0x2741a6,null))[_0x1126('0x59')](handleError(_0x2741a6,null));};exports[_0x1126('0xbb')]=function(_0xb2aae5,_0x33d6a3,_0x13dea4){var _0x19e02b,_0xd35829;return db[_0x1126('0x35')]['find']({'where':{'id':_0xb2aae5['params']['id']}})[_0x1126('0x28')](handleEntityNotFound(_0x33d6a3,null))[_0x1126('0x28')](function(_0x52b33c){if(_0x52b33c){_0xd35829=_0x52b33c;return _0x52b33c[_0x1126('0xbb')](_0xb2aae5[_0x1126('0x4f')]['ids'],_[_0x1126('0x5c')](_0xb2aae5[_0x1126('0x4f')],[_0x1126('0x7e'),'id'])||{});}return null;})['spread'](function(_0x2d1801){var _0x2793fa;_0x19e02b=_0x2d1801||[];var _0x47086a=[];if(_0x2d1801){for(var _0x4b6333=0x0;_0x4b6333<_0x2d1801[_0x1126('0x4b')];_0x4b6333+=0x1){var _0x5b298e=_0x2d1801[_0x4b6333][_0x1126('0x2a')]({'plain':!![]});_0x2793fa=squel[_0x1126('0x9d')]()[_0x1126('0x9e')](_0x1126('0xbc'))[_0x1126('0xa0')]([_0x1126('0xa1'),_0x1126('0xa3'),_0x1126('0xa4'),_0x1126('0x62'),_0x1126('0x5d'),_0x1126('0x5e')],squel[_0x1126('0x80')]()[_0x1126('0x81')](_0x1126('0xa1'),_0x1126('0xa1'))['field']('id',_0x1126('0xa3'))['field'](_0x5b298e[_0x1126('0xa5')][_0x1126('0x88')](),_0x1126('0xa4'))[_0x1126('0x81')](_0xb2aae5[_0x1126('0x5b')]['id']['toString'](),_0x1126('0x62'))[_0x1126('0x81')]('NOW()','createdAt')[_0x1126('0x81')](_0x1126('0xbd'),_0x1126('0x5e'))[_0x1126('0xa6')](_0x1126('0xa7'))[_0x1126('0x43')](_0x1126('0xad'))[_0x1126('0x43')]('ListId\x20=\x20?',_0x5b298e[_0x1126('0xa5')][_0x1126('0x88')]())[_0x1126('0x43')](_0x1126('0xa9')))[_0x1126('0x88')]();_0x47086a[_0x1126('0x87')](db[_0x1126('0x76')]['query'](_0x2793fa));}return BPromise[_0x1126('0x8b')](_0x47086a);}})[_0x1126('0x28')](function(){return _0x19e02b;})[_0x1126('0x28')](respondWithResult(_0x33d6a3,null))[_0x1126('0x59')](handleError(_0x33d6a3,null));};exports[_0x1126('0xbe')]=function(_0x32226b,_0xf2f1d1,_0x2ed39e){return db['VoiceQueue'][_0x1126('0x4d')]({'where':{'id':_0x32226b[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](handleEntityNotFound(_0xf2f1d1,null))[_0x1126('0x28')](function(_0x59c906){if(_0x59c906){return _0x59c906['removeBlackLists'](_0x32226b[_0x1126('0x39')][_0x1126('0x7e')]);}})[_0x1126('0x28')](function(_0x2a3075){if(_0x2a3075){return db['CmHopperBlack'][_0x1126('0x29')]({'where':{'ListId':_0x32226b[_0x1126('0x39')]['ids'],'VoiceQueueId':_0x32226b[_0x1126('0x5b')]['id']}})[_0x1126('0x28')](function(){return _0x2a3075;});}})[_0x1126('0x28')](respondWithStatusCode(_0xf2f1d1,null))['catch'](handleError(_0xf2f1d1,null));};
\ No newline at end of file
+var _0xabce=['voicePause','forEach','emit','removeTeams','ids','select','field','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','toString','QueryTypes','SELECT','TeamId','all','union','transaction','removeAgents','userVoiceQueue:remove','addAgents','userVoiceQueue:save','User','online','isEmpty','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','cm_contact_has_items','h.scheduledat=?','PHONE','removeLists','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','get','inbound','outbound','ignore','map','value','includes','type','find','name','error','stack','send','index','rawAttributes','fieldName','key','query','keys','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','VoiceQueue','includeAll','include','findAll','catch','show','params','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','VoiceQueues','update','getHoppers','findOne','CmHopper','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','interface','flatMap','Agents','penalty','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s'];(function(_0x183904,_0x18903d){var _0x44a8fd=function(_0x19b3a3){while(--_0x19b3a3){_0x183904['push'](_0x183904['shift']());}};_0x44a8fd(++_0x18903d);}(_0xabce,0x103));var _0xeabc=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xabce[_0x1ddedd];return _0xa3e1ac;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];config[_0xeabc('0x1a')]=_[_0xeabc('0x1b')](config[_0xeabc('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xeabc('0x1c'))(new Redis(config[_0xeabc('0x1a')]));require(_0xeabc('0x1d'))['register'](socket);function respondWithStatusCode(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xcc;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1e')](_0x3170ea);}return _0x5f4ee8['status'](_0x3170ea)[_0xeabc('0x1f')]();};}function respondWithResult(_0x638976,_0x49f2d8){_0x49f2d8=_0x49f2d8||0xc8;return function(_0x53fe28){if(_0x53fe28){return _0x638976[_0xeabc('0x20')](_0x49f2d8)['json'](_0x53fe28);}};}function respondWithFilteredResult(_0x3d0e21,_0x1b64b9){return function(_0x58a3c0){if(_0x58a3c0){var _0x16f08b=typeof _0x1b64b9[_0xeabc('0x21')]===_0xeabc('0x22')&&typeof _0x1b64b9[_0xeabc('0x23')]===_0xeabc('0x22');var _0x5d92e5=_0x58a3c0[_0xeabc('0x24')];var _0x4d68ea=_0x16f08b?0x0:_0x1b64b9[_0xeabc('0x21')];var _0x16530c=_0x16f08b?_0x58a3c0['count']:_0x1b64b9[_0xeabc('0x21')]+_0x1b64b9[_0xeabc('0x23')];var _0x254590;if(_0x16530c>=_0x5d92e5){_0x16530c=_0x5d92e5;_0x254590=0xc8;}else{_0x254590=0xce;}_0x3d0e21[_0xeabc('0x20')](_0x254590);return _0x3d0e21[_0xeabc('0x25')]('Content-Range',_0x4d68ea+'-'+_0x16530c+'/'+_0x5d92e5)[_0xeabc('0x26')](_0x58a3c0);}return null;};}function patchUpdates(_0x10c675){return function(_0x91ab00){try{jsonpatch['apply'](_0x91ab00,_0x10c675,!![]);}catch(_0x457f27){return BPromise[_0xeabc('0x27')](_0x457f27);}return _0x91ab00[_0xeabc('0x28')]();};}function saveUpdates(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['update'](_0x319119)[_0xeabc('0x29')](function(_0x4d4e29){return _0x4d4e29;});}return null;};}function removeEntity(_0x811f0d,_0x12acbd){return function(_0x269621){if(_0x269621){return _0x269621[_0xeabc('0x2a')]()[_0xeabc('0x29')](function(){var _0x137293=_0x269621[_0xeabc('0x2b')]({'plain':!![]});var _0x4c2693=[{'name':'VoiceQueues','value':_0xeabc('0x2c'),'ignore':![]},{'name':'QueueCampaigns','value':_0xeabc('0x2d'),'ignore':![]}];var _0x2b342c=_(_0x4c2693)['filter'](_0xeabc('0x2e'))[_0xeabc('0x2f')](_0xeabc('0x30'))[_0xeabc('0x30')]();if(_[_0xeabc('0x31')](_0x2b342c,_0x137293[_0xeabc('0x32')])){return;}var _0x2c62fe=_[_0xeabc('0x33')](_0x4c2693,[_0xeabc('0x30'),_0x137293['type']])[_0xeabc('0x34')];return db['UserProfileResource'][_0xeabc('0x2a')]({'where':{'type':_0x2c62fe,'resourceId':_0x137293['id']}})[_0xeabc('0x29')](function(){return _0x269621;});})[_0xeabc('0x29')](function(){_0x811f0d[_0xeabc('0x20')](0xcc)[_0xeabc('0x1f')]();});}};}function handleEntityNotFound(_0x368b8a,_0x61c0af){return function(_0x545d7f){if(!_0x545d7f){_0x368b8a[_0xeabc('0x1e')](0x194);}return _0x545d7f;};}function handleError(_0x2df9e6,_0x3bc45e){_0x3bc45e=_0x3bc45e||0x1f4;return function(_0x4918e2){logger[_0xeabc('0x35')](_0x4918e2[_0xeabc('0x36')]);if(_0x4918e2[_0xeabc('0x34')]){delete _0x4918e2['name'];}_0x2df9e6[_0xeabc('0x20')](_0x3bc45e)[_0xeabc('0x37')](_0x4918e2);};}exports[_0xeabc('0x38')]=function(_0x521091,_0xf98c7c){var _0x286203={},_0x5d9acf={},_0x50cca2={'count':0x0,'rows':[]};var _0x254568=_[_0xeabc('0x2f')](db['VoiceQueue'][_0xeabc('0x39')],function(_0x81976d){return{'name':_0x81976d[_0xeabc('0x3a')],'type':_0x81976d[_0xeabc('0x32')][_0xeabc('0x3b')]};});_0x5d9acf['model']=_[_0xeabc('0x2f')](_0x254568,'name');_0x5d9acf[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x521091[_0xeabc('0x3c')]);_0x5d9acf['filters']=_['intersection'](_0x5d9acf[_0xeabc('0x3e')],_0x5d9acf['query']);_0x286203[_0xeabc('0x3f')]=_['intersection'](_0x5d9acf['model'],qs['fields'](_0x521091['query'][_0xeabc('0x40')]));_0x286203['attributes']=_0x286203[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x286203['attributes']:_0x5d9acf[_0xeabc('0x3e')];if(!_0x521091['query'][_0xeabc('0x42')]('nolimit')){_0x286203[_0xeabc('0x23')]=qs[_0xeabc('0x23')](_0x521091[_0xeabc('0x3c')]['limit']);_0x286203['offset']=qs['offset'](_0x521091[_0xeabc('0x3c')][_0xeabc('0x21')]);}_0x286203[_0xeabc('0x43')]=qs['sort'](_0x521091['query'][_0xeabc('0x44')]);_0x286203[_0xeabc('0x45')]=qs['filters'](_[_0xeabc('0x46')](_0x521091['query'],_0x5d9acf[_0xeabc('0x47')]),_0x254568);if(_0x521091['query']['filter']){_0x286203['where']=_[_0xeabc('0x48')](_0x286203[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x254568,function(_0x3eeeb5){if(_0x3eeeb5['type']!==_0xeabc('0x49')){var _0x555d26={};_0x555d26[_0x3eeeb5[_0xeabc('0x34')]]={'$like':'%'+_0x521091[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x555d26;}})});}_0x286203=_[_0xeabc('0x48')]({},_0x286203,_0x521091[_0xeabc('0x4b')]);var _0x48b988={'where':_0x286203['where']};return db[_0xeabc('0x4c')]['count'](_0x48b988)[_0xeabc('0x29')](function(_0x2cdf59){_0x50cca2['count']=_0x2cdf59;if(_0x521091[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0x286203[_0xeabc('0x4e')]=[{'all':!![]}];}return db[_0xeabc('0x4c')][_0xeabc('0x4f')](_0x286203);})[_0xeabc('0x29')](function(_0x2003a7){_0x50cca2['rows']=_0x2003a7;return _0x50cca2;})[_0xeabc('0x29')](respondWithFilteredResult(_0xf98c7c,_0x286203))[_0xeabc('0x50')](handleError(_0xf98c7c,null));};exports[_0xeabc('0x51')]=function(_0x1b41c8,_0x271f8c){var _0x3fbc97={'raw':![],'where':{'id':_0x1b41c8[_0xeabc('0x52')]['id']}},_0x2107d5={};_0x2107d5[_0xeabc('0x3e')]=_[_0xeabc('0x3d')](db['VoiceQueue'][_0xeabc('0x39')]);_0x2107d5[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x1b41c8[_0xeabc('0x3c')]);_0x2107d5[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x2107d5[_0xeabc('0x3e')],_0x2107d5['query']);_0x3fbc97[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0x2107d5[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x1b41c8[_0xeabc('0x3c')]['fields']));_0x3fbc97[_0xeabc('0x3f')]=_0x3fbc97[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x3fbc97[_0xeabc('0x3f')]:_0x2107d5['model'];if(_0x1b41c8[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0x3fbc97['include']=[{'all':!![]}];}_0x3fbc97=_[_0xeabc('0x48')]({},_0x3fbc97,_0x1b41c8['options']);return db[_0xeabc('0x4c')]['find'](_0x3fbc97)[_0xeabc('0x29')](handleEntityNotFound(_0x271f8c,null))[_0xeabc('0x29')](respondWithResult(_0x271f8c,null))[_0xeabc('0x50')](handleError(_0x271f8c,null));};exports[_0xeabc('0x54')]=function(_0x1ee837,_0x15ba95){return db[_0xeabc('0x4c')][_0xeabc('0x54')](_0x1ee837[_0xeabc('0x55')],{})[_0xeabc('0x29')](function(_0x48a13f){var _0x180a14=_0x1ee837[_0xeabc('0x56')][_0xeabc('0x2b')]({'plain':!![]});if(!_0x180a14)throw new Error(_0xeabc('0x57'));if(_0x180a14['role']===_0xeabc('0x56')){var _0x392913=_0x48a13f[_0xeabc('0x2b')]({'plain':!![]});var _0x21f972=[{'name':'VoiceQueues','value':_0xeabc('0x2c')},{'name':_0xeabc('0x58'),'value':_0xeabc('0x2d')}];var _0xa55cce=_[_0xeabc('0x33')](_0x21f972,[_0xeabc('0x30'),_0x392913[_0xeabc('0x32')]])[_0xeabc('0x34')];return db[_0xeabc('0x59')]['find']({'where':{'name':_0xa55cce,'userProfileId':_0x180a14[_0xeabc('0x5a')]},'raw':!![]})['then'](function(_0x5e09fc){if(_0x5e09fc&&_0x5e09fc['autoAssociation']===0x0){return db[_0xeabc('0x5b')][_0xeabc('0x54')]({'name':_0x392913[_0xeabc('0x34')],'resourceId':_0x392913['id'],'type':_0x5e09fc[_0xeabc('0x34')],'sectionId':_0x5e09fc['id']},{})[_0xeabc('0x29')](function(){return _0x48a13f;});}else{return _0x48a13f;}})[_0xeabc('0x50')](function(_0x4a2ad6){logger[_0xeabc('0x35')](_0xeabc('0x5c'),_0x4a2ad6);throw _0x4a2ad6;});}return _0x48a13f;})[_0xeabc('0x29')](respondWithResult(_0x15ba95,0xc9))[_0xeabc('0x50')](handleError(_0x15ba95,null));};exports[_0xeabc('0x5d')]=function(_0x2c7b4e,_0x1750e9){var _0x25c728={'where':{'id':_0x2c7b4e['params']['id']}},_0x5820ca={};_0x5820ca[_0xeabc('0x3e')]=_[_0xeabc('0x3d')](db[_0xeabc('0x4c')]['rawAttributes']);_0x25c728[_0xeabc('0x3f')]=_['intersection'](_0x5820ca['model'],qs[_0xeabc('0x40')](_0x2c7b4e[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x25c728[_0xeabc('0x3f')]=_0x25c728[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x25c728['attributes']:_0x5820ca[_0xeabc('0x3e')];if(_0x2c7b4e[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0x25c728[_0xeabc('0x4e')]=[{'all':!![]}];}_0x25c728=_[_0xeabc('0x48')]({},_0x25c728,_0x2c7b4e[_0xeabc('0x4b')]);return db['VoiceQueue'][_0xeabc('0x33')](_0x25c728)[_0xeabc('0x29')](handleEntityNotFound(_0x1750e9,null))[_0xeabc('0x29')](function(_0x165899){if(_0x165899){var _0x1b61a8=_0x165899[_0xeabc('0x2b')]({'plain':!![]});_0x1b61a8=qs[_0xeabc('0x5e')](_0x1b61a8,['id',_0xeabc('0x5f'),_0xeabc('0x60')]);_0x2c7b4e['body']=_[_0xeabc('0x5e')](_0x2c7b4e['body'],['id',_0xeabc('0x5f'),_0xeabc('0x60')]);return db[_0xeabc('0x4c')][_0xeabc('0x54')](_[_0xeabc('0x48')](_0x1b61a8,_0x2c7b4e[_0xeabc('0x55')]),{'include':_0x2c7b4e[_0xeabc('0x3c')][_0xeabc('0x4d')]?[{'all':!![]}]:undefined})[_0xeabc('0x29')](function(_0x24d0e5){var _0x5702cb=_0x2c7b4e[_0xeabc('0x56')][_0xeabc('0x2b')]({'plain':!![]});if(!_0x5702cb)throw new Error(_0xeabc('0x57'));if(_0x5702cb[_0xeabc('0x61')]==='user'){var _0x12fd48=_0x24d0e5['get']({'plain':!![]});var _0x54e7d6=[{'name':_0xeabc('0x62'),'value':_0xeabc('0x2c')},{'name':_0xeabc('0x58'),'value':_0xeabc('0x2d')}];var _0x4b7730=_['find'](_0x54e7d6,[_0xeabc('0x30'),_0x12fd48['type']])['name'];return db[_0xeabc('0x59')]['find']({'where':{'name':_0x4b7730,'userProfileId':_0x5702cb['userProfileId']},'raw':!![]})[_0xeabc('0x29')](function(_0x1c84b5){if(_0x1c84b5&&_0x1c84b5['autoAssociation']===0x0){return db['UserProfileResource'][_0xeabc('0x54')]({'name':_0x12fd48['name'],'resourceId':_0x12fd48['id'],'type':_0x1c84b5[_0xeabc('0x34')],'sectionId':_0x1c84b5['id']},{})[_0xeabc('0x29')](function(){return _0x24d0e5;});}else{return _0x24d0e5;}})['catch'](function(_0x5d6477){logger[_0xeabc('0x35')](_0xeabc('0x5c'),_0x5d6477);throw _0x5d6477;});}return _0x24d0e5;});}})[_0xeabc('0x29')](respondWithResult(_0x1750e9,0xc9))[_0xeabc('0x50')](handleError(_0x1750e9,null));};exports[_0xeabc('0x63')]=function(_0x511b33,_0x53f578){if(_0x511b33[_0xeabc('0x55')]['id']){delete _0x511b33['body']['id'];}return db[_0xeabc('0x4c')]['find']({'where':{'id':_0x511b33[_0xeabc('0x52')]['id']}})['then'](handleEntityNotFound(_0x53f578,null))[_0xeabc('0x29')](saveUpdates(_0x511b33['body'],null))[_0xeabc('0x29')](respondWithResult(_0x53f578,null))[_0xeabc('0x50')](handleError(_0x53f578,null));};exports[_0xeabc('0x2a')]=function(_0x36cc41,_0x5e121c){return db[_0xeabc('0x4c')]['find']({'where':{'id':_0x36cc41[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x5e121c,null))[_0xeabc('0x29')](removeEntity(_0x5e121c,null))[_0xeabc('0x50')](handleError(_0x5e121c,null));};exports[_0xeabc('0x64')]=function(_0x5c1ab2,_0x239350,_0x329d8b){var _0x4b9614={'raw':![],'where':{}};var _0x2509a4={};var _0x5427c8={'count':0x0,'rows':[]};return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x5c1ab2[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x239350,null))['then'](function(_0xb9b460){if(_0xb9b460){_0x2509a4[_0xeabc('0x3e')]=_[_0xeabc('0x3d')](db[_0xeabc('0x66')]['rawAttributes']);_0x2509a4['query']=_[_0xeabc('0x3d')](_0x5c1ab2['query']);_0x2509a4['filters']=_[_0xeabc('0x53')](_0x2509a4[_0xeabc('0x3e')],_0x2509a4[_0xeabc('0x3c')]);_0x4b9614['attributes']=_[_0xeabc('0x53')](_0x2509a4[_0xeabc('0x3e')],qs['fields'](_0x5c1ab2[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x4b9614[_0xeabc('0x3f')]=_0x4b9614[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x4b9614['attributes']:_0x2509a4[_0xeabc('0x3e')];if(!_0x5c1ab2['query']['hasOwnProperty']('nolimit')){_0x4b9614[_0xeabc('0x23')]=qs[_0xeabc('0x23')](_0x5c1ab2[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x4b9614[_0xeabc('0x21')]=qs['offset'](_0x5c1ab2[_0xeabc('0x3c')]['offset']);}_0x4b9614[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x5c1ab2['query'][_0xeabc('0x44')]);_0x4b9614['where']=qs['filters'](_[_0xeabc('0x46')](_0x5c1ab2[_0xeabc('0x3c')],_0x2509a4[_0xeabc('0x47')]));_0x4b9614[_0xeabc('0x45')][_0xeabc('0x67')]=_0xb9b460['id'];if(_0x5c1ab2['query'][_0xeabc('0x4a')]){_0x4b9614[_0xeabc('0x45')]=_[_0xeabc('0x48')](_0x4b9614[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x4b9614[_0xeabc('0x3f')],function(_0x2d05b4){var _0x419fc6={};_0x419fc6[_0x2d05b4]={'$like':'%'+_0x5c1ab2[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x419fc6;})});}_0x4b9614=_['merge']({},_0x4b9614,_0x5c1ab2[_0xeabc('0x4b')]);return db[_0xeabc('0x66')][_0xeabc('0x24')]({'where':_0x4b9614['where']})['then'](function(_0x1506bd){_0x5427c8[_0xeabc('0x24')]=_0x1506bd;if(_0x5c1ab2[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0x4b9614[_0xeabc('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0xeabc('0x4f')](_0x4b9614);})['then'](function(_0x5f39ef){_0x5427c8[_0xeabc('0x68')]=_0x5f39ef;return _0x5427c8;});}})[_0xeabc('0x29')](respondWithFilteredResult(_0x239350,_0x4b9614))['catch'](handleError(_0x239350,null));};exports[_0xeabc('0x69')]=function(_0x45c9c7,_0x49a70a,_0x5963f7){var _0xfaef39={'raw':!![],'where':{}};var _0xb04677={};var _0x135a79={'count':0x0,'rows':[]};return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x45c9c7[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x49a70a,null))['then'](function(_0xb54c35){if(_0xb54c35){_0xb04677['model']=_[_0xeabc('0x3d')](db[_0xeabc('0x6a')][_0xeabc('0x39')]);_0xb04677[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x45c9c7[_0xeabc('0x3c')]);_0xb04677[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0xb04677[_0xeabc('0x3e')],_0xb04677[_0xeabc('0x3c')]);_0xfaef39[_0xeabc('0x3f')]=_['intersection'](_0xb04677[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x40')]));_0xfaef39['attributes']=_0xfaef39[_0xeabc('0x3f')][_0xeabc('0x41')]?_0xfaef39['attributes']:_0xb04677[_0xeabc('0x3e')];if(!_0x45c9c7[_0xeabc('0x3c')]['hasOwnProperty']('nolimit')){_0xfaef39['limit']=qs['limit'](_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x23')]);_0xfaef39[_0xeabc('0x21')]=qs[_0xeabc('0x21')](_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x21')]);}_0xfaef39[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x44')]);_0xfaef39['where']=qs[_0xeabc('0x47')](_[_0xeabc('0x46')](_0x45c9c7['query'],_0xb04677[_0xeabc('0x47')]));_0xfaef39[_0xeabc('0x45')][_0xeabc('0x67')]=_0xb54c35['id'];if(_0x45c9c7['query'][_0xeabc('0x4a')]){_0xfaef39['where']=_[_0xeabc('0x48')](_0xfaef39[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0xfaef39[_0xeabc('0x3f')],function(_0x1c52f7){var _0x5e7e00={};_0x5e7e00[_0x1c52f7]={'$like':'%'+_0x45c9c7['query']['filter']+'%'};return _0x5e7e00;})});}_0xfaef39=_['merge']({},_0xfaef39,_0x45c9c7[_0xeabc('0x4b')]);return db[_0xeabc('0x6a')][_0xeabc('0x24')]({'where':_0xfaef39['where']})[_0xeabc('0x29')](function(_0x19536d){_0x135a79[_0xeabc('0x24')]=_0x19536d;if(_0x45c9c7[_0xeabc('0x3c')][_0xeabc('0x4d')]){_0xfaef39[_0xeabc('0x4e')]=[{'all':!![]}];}return db[_0xeabc('0x6a')][_0xeabc('0x4f')](_0xfaef39);})[_0xeabc('0x29')](function(_0x391e67){_0x135a79[_0xeabc('0x68')]=_0x391e67;return _0x135a79;});}})[_0xeabc('0x29')](respondWithFilteredResult(_0x49a70a,_0xfaef39))['catch'](handleError(_0x49a70a,null));};exports['getHopperFinals']=function(_0x3286a2,_0x50a5d5,_0x20c4d7){var _0x18ee16={'raw':!![],'where':{}};var _0x102591={};var _0x56f622={'count':0x0,'rows':[]};return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x3286a2[_0xeabc('0x52')]['id']}})['then'](handleEntityNotFound(_0x50a5d5,null))['then'](function(_0x3557f2){if(_0x3557f2){_0x102591[_0xeabc('0x3e')]=_[_0xeabc('0x3d')](db[_0xeabc('0x6b')][_0xeabc('0x39')]);_0x102591[_0xeabc('0x3c')]=_['keys'](_0x3286a2['query']);_0x102591[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x102591[_0xeabc('0x3e')],_0x102591[_0xeabc('0x3c')]);_0x18ee16['attributes']=_['intersection'](_0x102591['model'],qs[_0xeabc('0x40')](_0x3286a2['query'][_0xeabc('0x40')]));_0x18ee16['attributes']=_0x18ee16[_0xeabc('0x3f')]['length']?_0x18ee16[_0xeabc('0x3f')]:_0x102591[_0xeabc('0x3e')];if(!_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x18ee16['limit']=qs[_0xeabc('0x23')](_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x18ee16['offset']=qs[_0xeabc('0x21')](_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x21')]);}_0x18ee16[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x3286a2['query'][_0xeabc('0x44')]);_0x18ee16[_0xeabc('0x45')]=qs['filters'](_[_0xeabc('0x46')](_0x3286a2[_0xeabc('0x3c')],_0x102591['filters']));_0x18ee16[_0xeabc('0x45')][_0xeabc('0x67')]=_0x3557f2['id'];if(_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x4a')]){_0x18ee16[_0xeabc('0x45')]=_[_0xeabc('0x48')](_0x18ee16[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x18ee16[_0xeabc('0x3f')],function(_0x11a185){var _0x223cd6={};_0x223cd6[_0x11a185]={'$like':'%'+_0x3286a2[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x223cd6;})});}_0x18ee16=_['merge']({},_0x18ee16,_0x3286a2['options']);return db[_0xeabc('0x6b')][_0xeabc('0x24')]({'where':_0x18ee16[_0xeabc('0x45')]})[_0xeabc('0x29')](function(_0x5805c9){_0x56f622[_0xeabc('0x24')]=_0x5805c9;if(_0x3286a2['query']['includeAll']){_0x18ee16['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x18ee16);})['then'](function(_0x72dd0e){_0x56f622[_0xeabc('0x68')]=_0x72dd0e;return _0x56f622;});}})[_0xeabc('0x29')](respondWithFilteredResult(_0x50a5d5,_0x18ee16))[_0xeabc('0x50')](handleError(_0x50a5d5,null));};exports[_0xeabc('0x6d')]=function(_0xe27492,_0x152d99,_0x3eaedf){var _0x44dc85={'raw':!![],'where':{}};var _0x550273={};var _0x3b1f77={'count':0x0,'rows':[]};return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0xe27492[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x152d99,null))[_0xeabc('0x29')](function(_0x2a29d7){if(_0x2a29d7){_0x550273['model']=_[_0xeabc('0x3d')](db['CmHopperBlack'][_0xeabc('0x39')]);_0x550273[_0xeabc('0x3c')]=_['keys'](_0xe27492[_0xeabc('0x3c')]);_0x550273['filters']=_[_0xeabc('0x53')](_0x550273[_0xeabc('0x3e')],_0x550273[_0xeabc('0x3c')]);_0x44dc85[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0x550273[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0xe27492[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x44dc85['attributes']=_0x44dc85['attributes'][_0xeabc('0x41')]?_0x44dc85[_0xeabc('0x3f')]:_0x550273['model'];if(!_0xe27492[_0xeabc('0x3c')]['hasOwnProperty'](_0xeabc('0x6c'))){_0x44dc85[_0xeabc('0x23')]=qs[_0xeabc('0x23')](_0xe27492[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x44dc85[_0xeabc('0x21')]=qs['offset'](_0xe27492[_0xeabc('0x3c')]['offset']);}_0x44dc85[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0xe27492[_0xeabc('0x3c')][_0xeabc('0x44')]);_0x44dc85['where']=qs[_0xeabc('0x47')](_[_0xeabc('0x46')](_0xe27492[_0xeabc('0x3c')],_0x550273['filters']));_0x44dc85[_0xeabc('0x45')][_0xeabc('0x67')]=_0x2a29d7['id'];if(_0xe27492[_0xeabc('0x3c')]['filter']){_0x44dc85['where']=_['merge'](_0x44dc85['where'],{'$or':_[_0xeabc('0x2f')](_0x44dc85[_0xeabc('0x3f')],function(_0x52e84f){var _0x12f024={};_0x12f024[_0x52e84f]={'$like':'%'+_0xe27492[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x12f024;})});}_0x44dc85=_[_0xeabc('0x48')]({},_0x44dc85,_0xe27492[_0xeabc('0x4b')]);return db[_0xeabc('0x6e')][_0xeabc('0x24')]({'where':_0x44dc85[_0xeabc('0x45')]})[_0xeabc('0x29')](function(_0x4df674){_0x3b1f77[_0xeabc('0x24')]=_0x4df674;if(_0xe27492['query'][_0xeabc('0x4d')]){_0x44dc85[_0xeabc('0x4e')]=[{'all':!![]}];}return db[_0xeabc('0x6e')][_0xeabc('0x4f')](_0x44dc85);})[_0xeabc('0x29')](function(_0x3a43ad){_0x3b1f77[_0xeabc('0x68')]=_0x3a43ad;return _0x3b1f77;});}})['then'](respondWithFilteredResult(_0x152d99,_0x44dc85))[_0xeabc('0x50')](handleError(_0x152d99,null));};exports['getTeams']=function(_0x475160,_0x4d8953,_0x10d66b){var _0x12a042={};var _0x266b53={};var _0x1aee85;var _0x507037;return db['VoiceQueue'][_0xeabc('0x65')]({'where':{'id':_0x475160[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x4d8953,null))[_0xeabc('0x29')](function(_0x3339ce){if(_0x3339ce){_0x1aee85=_0x3339ce;_0x266b53['model']=_[_0xeabc('0x3d')](db[_0xeabc('0x6f')][_0xeabc('0x39')]);_0x266b53[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x475160['query']);_0x266b53[_0xeabc('0x47')]=_['intersection'](_0x266b53[_0xeabc('0x3e')],_0x266b53[_0xeabc('0x3c')]);_0x12a042[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0x266b53[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x475160[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x12a042[_0xeabc('0x3f')]=_0x12a042[_0xeabc('0x3f')]['length']?_0x12a042[_0xeabc('0x3f')]:_0x266b53[_0xeabc('0x3e')];_0x12a042[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x475160['query'][_0xeabc('0x44')]);_0x12a042['where']=qs['filters'](_[_0xeabc('0x46')](_0x475160[_0xeabc('0x3c')],_0x266b53[_0xeabc('0x47')]));if(_0x475160['query'][_0xeabc('0x4a')]){_0x12a042[_0xeabc('0x45')]=_[_0xeabc('0x48')](_0x12a042[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x12a042['attributes'],function(_0x1dc0fc){var _0x316e15={};_0x316e15[_0x1dc0fc]={'$like':'%'+_0x475160['query']['filter']+'%'};return _0x316e15;})});}_0x12a042=_[_0xeabc('0x48')]({},_0x12a042,_0x475160[_0xeabc('0x4b')]);return _0x1aee85[_0xeabc('0x70')](_0x12a042);}})[_0xeabc('0x29')](function(_0x2a0075){if(_0x2a0075){_0x507037=_0x2a0075[_0xeabc('0x41')];if(!_0x475160[_0xeabc('0x3c')][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x12a042['limit']=qs[_0xeabc('0x23')](_0x475160['query'][_0xeabc('0x23')]);_0x12a042['offset']=qs[_0xeabc('0x21')](_0x475160[_0xeabc('0x3c')][_0xeabc('0x21')]);}return _0x1aee85[_0xeabc('0x70')](_0x12a042);}})[_0xeabc('0x29')](function(_0x227f00){if(_0x227f00){return _0x227f00?{'count':_0x507037,'rows':_0x227f00}:null;}})[_0xeabc('0x29')](respondWithResult(_0x4d8953,null))[_0xeabc('0x50')](handleError(_0x4d8953,null));};exports[_0xeabc('0x71')]=function(_0x31f1bf,_0x5c83e5,_0x5629db){var _0x1ad48f=_0x31f1bf['body'][_0xeabc('0x72')];var _0x283d40=_['map'](_0x1ad48f,'id');return db['Team'][_0xeabc('0x4f')]({'where':{'id':_0x283d40},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xeabc('0x34'),'online','voicePause',_0xeabc('0x73')],'raw':!![]}]})[_0xeabc('0x29')](function(_0x4a2b27){if(_0x4a2b27){var _0x480bbd=_[_0xeabc('0x74')](_0x4a2b27,function(_0x2465f9){var _0x4b6717=_0x2465f9[_0xeabc('0x2b')]({'plain':!![]});_0x4b6717[_0xeabc('0x75')]['forEach'](function(_0x578fdc){_0x578fdc[_0xeabc('0x76')]=_[_0xeabc('0x33')](_0x1ad48f,{'id':_0x4b6717['id']})[_0xeabc('0x76')];});return _0x4b6717['Agents'];});return db[_0xeabc('0x4c')]['find']({'where':{'id':_0x31f1bf[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](function(_0x2055d8){return db['sequelize']['transaction'](function(_0x6dff2a){return _0x2055d8[_0xeabc('0x71')](_0x283d40,{'transaction':_0x6dff2a})[_0xeabc('0x29')](function(){return BPromise[_0xeabc('0x77')](_0x1ad48f,function(_0x40658b){return db[_0xeabc('0x78')][_0xeabc('0x79')]({'TeamId':_0x40658b['id'],'VoiceQueueId':_0x31f1bf[_0xeabc('0x52')]['id'],'penalty':_0x40658b['penalty']},{'transaction':_0x6dff2a});});})['then'](function(){return BPromise[_0xeabc('0x77')](_0x480bbd,function(_0x55e41e){return db[_0xeabc('0x7a')]['findOrCreate']({'where':{'UserId':_0x55e41e['id'],'VoiceQueueId':_0x31f1bf[_0xeabc('0x52')]['id']},'defaults':{'penalty':_0x55e41e[_0xeabc('0x76')]},'transaction':_0x6dff2a});});})[_0xeabc('0x29')](function(){return BPromise[_0xeabc('0x77')](_[_0xeabc('0x4a')](_0x480bbd,{'online':!![]}),function(_0x75f13b){return db[_0xeabc('0x7b')][_0xeabc('0x79')]({'membername':_0x75f13b['name'],'UserId':_0x75f13b['id'],'queue_name':_0x2055d8[_0xeabc('0x34')],'VoiceQueueId':_0x2055d8['id'],'interface':_[_0xeabc('0x7c')](_0x75f13b[_0xeabc('0x73')])?util[_0xeabc('0x7d')](_0xeabc('0x7e'),_0x75f13b[_0xeabc('0x34')]):_0x75f13b[_0xeabc('0x73')],'paused':_0x75f13b[_0xeabc('0x7f')]||![],'penalty':_0x75f13b[_0xeabc('0x76')]},{'transaction':_0x6dff2a});});})[_0xeabc('0x29')](function(){_0x480bbd[_0xeabc('0x80')](function(_0x1ba153){socket[_0xeabc('0x81')]('userVoiceQueue:save',{'UserId':_0x1ba153['id'],'VoiceQueueId':_0x2055d8['id']});});});});});}})[_0xeabc('0x29')](respondWithStatusCode(_0x5c83e5,null))[_0xeabc('0x50')](handleError(_0x5c83e5,null));};exports[_0xeabc('0x82')]=function(_0x2a0793,_0x198641,_0x34738e){return db[_0xeabc('0x6f')][_0xeabc('0x4f')]({'where':{'id':_0x2a0793[_0xeabc('0x3c')][_0xeabc('0x83')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeabc('0x75'),'attributes':['id'],'raw':!![]}]})[_0xeabc('0x29')](handleEntityNotFound(_0x198641,null))['then'](function(_0x598105){var _0x5fc21a=_[_0xeabc('0x2f')](_0x598105,'id');var _0x201539=[];var _0x597bd0=[];var _0xba66a2=squel[_0xeabc('0x84')]();_0xba66a2[_0xeabc('0x85')]('tq.TeamId')[_0xeabc('0x86')](_0xeabc('0x87'),'tq')[_0xeabc('0x88')]('user_has_teams','ut',_0xeabc('0x89'))[_0xeabc('0x45')]('VoiceQueueId\x20=\x20?',_0x2a0793[_0xeabc('0x52')]['id']);for(var _0x50371d=0x0;_0x50371d<_0x598105[_0xeabc('0x41')];_0x50371d+=0x1){let _0x39916c=_0x598105[_0x50371d];for(var _0x5cc6d0=0x0;_0x5cc6d0<_0x39916c['Agents']['length'];_0x5cc6d0+=0x1){let _0x122f23=_0x39916c[_0xeabc('0x75')][_0x5cc6d0];var _0x3571c6=_0xba66a2['clone']();_0x3571c6['where']('ut.UserId\x20=\x20?',_0x122f23['id']);_0x597bd0[_0xeabc('0x8a')](db[_0xeabc('0x8b')]['query'](_0x3571c6[_0xeabc('0x8c')](),{'type':db[_0xeabc('0x8b')][_0xeabc('0x8d')][_0xeabc('0x8e')]})[_0xeabc('0x29')](function(_0x1ca3da){if(_0x1ca3da[_0xeabc('0x41')]===0x1){return _0x122f23['id'];}else{var _0x4a5555=_['every'](_['map'](_0x1ca3da,_0xeabc('0x8f')),function(_0x24cf0a){return _[_0xeabc('0x31')](_0x5fc21a,_0x24cf0a);});if(_0x4a5555){return _0x122f23['id'];}}}));}}return BPromise[_0xeabc('0x90')](_0x597bd0)[_0xeabc('0x29')](function(_0x564ebd){_0x201539=_(_0x201539)[_0xeabc('0x91')](_0x564ebd)['compact']()[_0xeabc('0x30')]();return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0x2a0793[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](function(_0x94fb8e){return db[_0xeabc('0x8b')][_0xeabc('0x92')](function(_0x4287e3){return _0x94fb8e[_0xeabc('0x82')](_0x2a0793['query'][_0xeabc('0x83')],{'transaction':_0x4287e3})[_0xeabc('0x29')](function(){if(!_['isEmpty'](_0x201539)){return _0x94fb8e[_0xeabc('0x93')](_0x201539,{'transaction':_0x4287e3})['then'](function(){return db[_0xeabc('0x7b')][_0xeabc('0x2a')]({'where':{'VoiceQueueId':_0x2a0793[_0xeabc('0x52')]['id'],'UserId':_0x201539},'transaction':_0x4287e3});});}})[_0xeabc('0x29')](function(){_0x201539['forEach'](function(_0x40156a){socket[_0xeabc('0x81')](_0xeabc('0x94'),{'UserId':_0x40156a,'VoiceQueueId':_0x94fb8e['id']});});});});});});})[_0xeabc('0x29')](respondWithStatusCode(_0x198641,null))[_0xeabc('0x50')](handleError(_0x198641,null));};exports['addAgents']=function(_0x34fc2b,_0x43fa37,_0x4913cf){var _0x584b2b,_0xb28be5;return db[_0xeabc('0x4c')]['find']({'where':{'id':_0x34fc2b[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x43fa37,null))['then'](function(_0x4d9ebd){if(_0x4d9ebd){_0xb28be5=_0x4d9ebd;return _0x4d9ebd[_0xeabc('0x95')](_0x34fc2b['body'][_0xeabc('0x83')],_[_0xeabc('0x5e')](_0x34fc2b[_0xeabc('0x55')],['ids','id'])||{})['spread'](function(_0x245991){for(var _0x3abe64=0x0;_0x3abe64<_0x34fc2b[_0xeabc('0x55')][_0xeabc('0x83')][_0xeabc('0x41')];_0x3abe64+=0x1){socket[_0xeabc('0x81')](_0xeabc('0x96'),{'UserId':Number(_0x34fc2b[_0xeabc('0x55')][_0xeabc('0x83')][_0x3abe64]),'VoiceQueueId':Number(_0x34fc2b['params']['id'])});}return _0x245991;});}})['then'](function(_0x1f0a8e){_0x584b2b=_0x1f0a8e||[];if(_0xb28be5){return db[_0xeabc('0x97')][_0xeabc('0x4f')]({'where':{'id':_0x34fc2b['body'][_0xeabc('0x83')]},'attributes':['id',_0xeabc('0x34'),_0xeabc('0x98'),_0xeabc('0x7f'),_0xeabc('0x73')],'raw':!![]});}})[_0xeabc('0x29')](function(_0x2f5ab8){if(!_[_0xeabc('0x99')](_0x2f5ab8)){var _0x1c77a0=[];for(var _0x10f354=0x0;_0x10f354<_0x2f5ab8[_0xeabc('0x41')];_0x10f354++){if(_0x2f5ab8[_0x10f354][_0xeabc('0x98')]){_0x1c77a0['push'](db[_0xeabc('0x7b')][_0xeabc('0x79')]({'membername':_0x2f5ab8[_0x10f354][_0xeabc('0x34')],'UserId':_0x2f5ab8[_0x10f354]['id'],'queue_name':_0xb28be5['name'],'VoiceQueueId':_0xb28be5['id'],'interface':_[_0xeabc('0x7c')](_0x2f5ab8[_0x10f354][_0xeabc('0x73')])?util['format'](_0xeabc('0x7e'),_0x2f5ab8[_0x10f354]['name']):_0x2f5ab8[_0x10f354][_0xeabc('0x73')],'paused':_0x2f5ab8[_0x10f354][_0xeabc('0x7f')]||![],'penalty':_0x34fc2b[_0xeabc('0x55')][_0xeabc('0x76')]||0x0}));}}return BPromise[_0xeabc('0x90')](_0x1c77a0);}})[_0xeabc('0x29')](function(){return _0x584b2b;})[_0xeabc('0x29')](respondWithResult(_0x43fa37,null))[_0xeabc('0x50')](handleError(_0x43fa37,null));};exports[_0xeabc('0x93')]=function(_0x4946af,_0x17a858,_0x4d3ead){return db['VoiceQueue'][_0xeabc('0x33')]({'where':{'id':_0x4946af[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x17a858,null))[_0xeabc('0x29')](function(_0x224a0e){if(_0x224a0e){return _0x224a0e[_0xeabc('0x93')](_0x4946af[_0xeabc('0x3c')][_0xeabc('0x83')])[_0xeabc('0x29')](function(){if(_[_0xeabc('0x9a')](_0x4946af[_0xeabc('0x3c')]['ids'])){for(var _0x57cf40=0x0;_0x57cf40<_0x4946af[_0xeabc('0x3c')][_0xeabc('0x83')]['length'];_0x57cf40+=0x1){socket[_0xeabc('0x81')](_0xeabc('0x94'),{'UserId':Number(_0x4946af['query']['ids'][_0x57cf40]),'VoiceQueueId':Number(_0x4946af[_0xeabc('0x52')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x4946af['query'][_0xeabc('0x83')]),'VoiceQueueId':Number(_0x4946af[_0xeabc('0x52')]['id'])});}});}})['then'](function(_0x58982a){return db[_0xeabc('0x7b')]['destroy']({'where':{'VoiceQueueId':_0x4946af[_0xeabc('0x52')]['id'],'UserId':_0x4946af['query']['ids']}})[_0xeabc('0x29')](function(){return _0x58982a;});})[_0xeabc('0x29')](respondWithStatusCode(_0x17a858,null))[_0xeabc('0x50')](handleError(_0x17a858,null));};exports[_0xeabc('0x9b')]=function(_0x2e23da,_0x1bf9a2,_0x29153b){var _0x114ffc={};var _0x235270={};var _0x23fab7;var _0x29b175;return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x2e23da['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x1bf9a2,null))['then'](function(_0x42ceb1){if(_0x42ceb1){_0x23fab7=_0x42ceb1;_0x235270['model']=_[_0xeabc('0x3d')](db[_0xeabc('0x97')][_0xeabc('0x39')]);_0x235270['query']=_[_0xeabc('0x3d')](_0x2e23da['query']);_0x235270[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x235270[_0xeabc('0x3e')],_0x235270[_0xeabc('0x3c')]);_0x114ffc[_0xeabc('0x3f')]=_['intersection'](_0x235270[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x114ffc[_0xeabc('0x3f')]=_0x114ffc[_0xeabc('0x3f')][_0xeabc('0x41')]?_0x114ffc[_0xeabc('0x3f')]:_0x235270[_0xeabc('0x3e')];_0x114ffc['order']=qs['sort'](_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x44')]);_0x114ffc[_0xeabc('0x45')]=qs[_0xeabc('0x47')](_['pick'](_0x2e23da[_0xeabc('0x3c')],_0x235270[_0xeabc('0x47')]));if(_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x4a')]){_0x114ffc['where']=_[_0xeabc('0x48')](_0x114ffc[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x114ffc['attributes'],function(_0x497ee4){var _0x43e541={};_0x43e541[_0x497ee4]={'$like':'%'+_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x43e541;})});}_0x114ffc=_[_0xeabc('0x48')]({},_0x114ffc,_0x2e23da[_0xeabc('0x4b')]);return _0x23fab7[_0xeabc('0x9b')](_0x114ffc);}})[_0xeabc('0x29')](function(_0x4124c6){if(_0x4124c6){_0x29b175=_0x4124c6['length'];if(!_0x2e23da['query'][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x114ffc[_0xeabc('0x23')]=qs['limit'](_0x2e23da[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x114ffc[_0xeabc('0x21')]=qs[_0xeabc('0x21')](_0x2e23da[_0xeabc('0x3c')]['offset']);}return _0x23fab7[_0xeabc('0x9b')](_0x114ffc);}})[_0xeabc('0x29')](function(_0x207932){if(_0x207932){return _0x207932?{'count':_0x29b175,'rows':_0x207932}:null;}})[_0xeabc('0x29')](respondWithResult(_0x1bf9a2,null))[_0xeabc('0x50')](handleError(_0x1bf9a2,null));};exports[_0xeabc('0x9c')]=function(_0x35ed8a,_0x977d14,_0x141dbb){var _0x318be6={};var _0xf97e59={};var _0x1293ab;var _0x55c261;return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0x35ed8a[_0xeabc('0x52')]['id']}})['then'](handleEntityNotFound(_0x977d14,null))[_0xeabc('0x29')](function(_0x26e38b){if(_0x26e38b){_0x1293ab=_0x26e38b;_0xf97e59['model']=_[_0xeabc('0x3d')](db[_0xeabc('0x7b')]['rawAttributes']);_0xf97e59['query']=_[_0xeabc('0x3d')](_0x35ed8a[_0xeabc('0x3c')]);_0xf97e59[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0xf97e59[_0xeabc('0x3e')],_0xf97e59[_0xeabc('0x3c')]);_0x318be6[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0xf97e59['model'],qs['fields'](_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x40')]));_0x318be6[_0xeabc('0x3f')]=_0x318be6[_0xeabc('0x3f')]['length']?_0x318be6['attributes']:_0xf97e59[_0xeabc('0x3e')];_0x318be6[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x44')]);_0x318be6[_0xeabc('0x45')]=qs[_0xeabc('0x47')](_['pick'](_0x35ed8a[_0xeabc('0x3c')],_0xf97e59[_0xeabc('0x47')]));if(_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x4a')]){_0x318be6['where']=_['merge'](_0x318be6[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x318be6[_0xeabc('0x3f')],function(_0xb9df16){var _0x432709={};_0x432709[_0xb9df16]={'$like':'%'+_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0x432709;})});}_0x318be6=_[_0xeabc('0x48')]({},_0x318be6,_0x35ed8a[_0xeabc('0x4b')]);return _0x1293ab[_0xeabc('0x9c')](_0x318be6);}})[_0xeabc('0x29')](function(_0x2a3a5c){if(_0x2a3a5c){_0x55c261=_0x2a3a5c[_0xeabc('0x41')];if(!_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x318be6[_0xeabc('0x23')]=qs['limit'](_0x35ed8a['query']['limit']);_0x318be6['offset']=qs['offset'](_0x35ed8a[_0xeabc('0x3c')][_0xeabc('0x21')]);}return _0x1293ab['getMembers'](_0x318be6);}})[_0xeabc('0x29')](function(_0xdfb37a){return _0xdfb37a?{'count':_0x55c261,'rows':_0xdfb37a}:null;})[_0xeabc('0x29')](respondWithResult(_0x977d14,null))[_0xeabc('0x50')](handleError(_0x977d14,null));};exports[_0xeabc('0x9d')]=function(_0x366034,_0x5d16cb,_0x52c973){var _0x1f90b6={};var _0x1c0703={};var _0x5ad17f;var _0x3f6255;return db['VoiceQueue'][_0xeabc('0x65')]({'where':{'id':_0x366034['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x5d16cb,null))[_0xeabc('0x29')](function(_0x31df33){if(_0x31df33){_0x5ad17f=_0x31df33;_0x1c0703[_0xeabc('0x3e')]=_['keys'](db[_0xeabc('0x9e')][_0xeabc('0x39')]);_0x1c0703[_0xeabc('0x3c')]=_[_0xeabc('0x3d')](_0x366034[_0xeabc('0x3c')]);_0x1c0703[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x1c0703[_0xeabc('0x3e')],_0x1c0703['query']);_0x1f90b6[_0xeabc('0x3f')]=_['intersection'](_0x1c0703[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0x366034[_0xeabc('0x3c')]['fields']));_0x1f90b6[_0xeabc('0x3f')]=_0x1f90b6['attributes']['length']?_0x1f90b6[_0xeabc('0x3f')]:_0x1c0703['model'];_0x1f90b6[_0xeabc('0x43')]=qs[_0xeabc('0x44')](_0x366034[_0xeabc('0x3c')]['sort']);_0x1f90b6[_0xeabc('0x45')]=qs['filters'](_['pick'](_0x366034[_0xeabc('0x3c')],_0x1c0703[_0xeabc('0x47')]));if(_0x366034['query']['filter']){_0x1f90b6[_0xeabc('0x45')]=_[_0xeabc('0x48')](_0x1f90b6[_0xeabc('0x45')],{'$or':_[_0xeabc('0x2f')](_0x1f90b6[_0xeabc('0x3f')],function(_0x274693){var _0x73de81={};_0x73de81[_0x274693]={'$like':'%'+_0x366034['query'][_0xeabc('0x4a')]+'%'};return _0x73de81;})});}_0x1f90b6=_['merge']({},_0x1f90b6,_0x366034[_0xeabc('0x4b')]);return _0x5ad17f[_0xeabc('0x9d')](_0x1f90b6);}})[_0xeabc('0x29')](function(_0x197261){if(_0x197261){_0x3f6255=_0x197261['length'];if(!_0x366034['query'][_0xeabc('0x42')](_0xeabc('0x6c'))){_0x1f90b6[_0xeabc('0x23')]=qs[_0xeabc('0x23')](_0x366034[_0xeabc('0x3c')][_0xeabc('0x23')]);_0x1f90b6[_0xeabc('0x21')]=qs[_0xeabc('0x21')](_0x366034[_0xeabc('0x3c')]['offset']);}return _0x5ad17f[_0xeabc('0x9d')](_0x1f90b6);}})[_0xeabc('0x29')](function(_0x16d3c1){if(_0x16d3c1){return _0x16d3c1?{'count':_0x3f6255,'rows':_0x16d3c1}:null;}})['then'](respondWithResult(_0x5d16cb,null))[_0xeabc('0x50')](handleError(_0x5d16cb,null));};exports[_0xeabc('0x9f')]=function(_0x5cf0e6,_0x4f8763,_0x534147){var _0x1708ec=moment()[_0xeabc('0x7d')](_0xeabc('0xa0'));var _0x394082,_0xc1fb57;return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0x5cf0e6['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x4f8763,null))['then'](function(_0x3939a5){if(_0x3939a5){_0xc1fb57=_0x3939a5;return _0x3939a5[_0xeabc('0x9f')](_0x5cf0e6[_0xeabc('0x55')][_0xeabc('0x83')],_[_0xeabc('0x5e')](_0x5cf0e6['body'],[_0xeabc('0x83'),'id'])||{});}return null;})[_0xeabc('0xa1')](function(_0x5a92db){var _0xceed5f;_0x394082=_0x5a92db||[];var _0x44ac6f=[];if(_0x5a92db){for(var _0x3b807d=0x0;_0x3b807d<_0x5a92db[_0xeabc('0x41')];_0x3b807d+=0x1){var _0x11128b=_0x5a92db[_0x3b807d][_0xeabc('0x2b')]({'plain':!![]});_0xc1fb57[_0xeabc('0xa2')]=_0x5cf0e6[_0xeabc('0x55')]['dialCheckDuplicateType']?_0x5cf0e6[_0xeabc('0x55')][_0xeabc('0xa2')]:_0xc1fb57[_0xeabc('0xa2')];switch(_0xc1fb57['dialCheckDuplicateType']){case _0xeabc('0xa3'):_0xceed5f=squel[_0xeabc('0xa4')]()[_0xeabc('0xa5')]('cm_hopper')[_0xeabc('0xa6')](['phone',_0xeabc('0xa7'),_0xeabc('0xa8'),_0xeabc('0xa9'),_0xeabc('0x67'),'createdAt',_0xeabc('0x60')],squel[_0xeabc('0x84')]()['field'](_0xeabc('0xaa'),'phone')[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0xa7'))[_0xeabc('0x85')]('id',_0xeabc('0xa8'))['field'](_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')](),_0xeabc('0xa9'))[_0xeabc('0x85')](_0x5cf0e6['params']['id']['toString'](),_0xeabc('0x67'))['field']('\x27'+_0x1708ec+'\x27','createdAt')['field']('\x27'+_0x1708ec+'\x27','updatedAt')[_0xeabc('0x86')](_0xeabc('0xac'))['where'](_0xeabc('0xad'))[_0xeabc('0x45')](_0xeabc('0xae'),_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')]())[_0xeabc('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0xeabc('0x45')](_0xeabc('0xaf'),squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xb0'))[_0xeabc('0x86')](_0xeabc('0xb1'))[_0xeabc('0x45')](_0xeabc('0xb2'),_0x5cf0e6[_0xeabc('0x52')]['id'][_0xeabc('0x8c')]()))[_0xeabc('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xb3'))[_0xeabc('0x86')]('cm_hopper')[_0xeabc('0x45')](_0xeabc('0xb2'),_0x5cf0e6['params']['id']['toString']())))[_0xeabc('0x8c')]();break;case _0xeabc('0xb4'):_0xceed5f=squel[_0xeabc('0xa4')]()[_0xeabc('0xa5')](_0xeabc('0xb5'))['fromQuery']([_0xeabc('0xaa'),_0xeabc('0xa7'),_0xeabc('0xa8'),_0xeabc('0xa9'),_0xeabc('0x67'),_0xeabc('0x5f'),'updatedAt'],squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xaa'),_0xeabc('0xaa'))[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0xa7'))['field']('id',_0xeabc('0xa8'))[_0xeabc('0x85')](_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')](),'ListId')[_0xeabc('0x85')](_0x5cf0e6[_0xeabc('0x52')]['id']['toString'](),_0xeabc('0x67'))[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0x5f'))[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0x60'))[_0xeabc('0x86')](_0xeabc('0xac'))[_0xeabc('0x45')](_0xeabc('0xad'))[_0xeabc('0x45')](_0xeabc('0xae'),_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xeabc('0xaf'),squel[_0xeabc('0x84')]()['field'](_0xeabc('0xb3'))[_0xeabc('0x86')](_0xeabc('0xb5'))['where'](_0xeabc('0xb2'),_0x5cf0e6[_0xeabc('0x52')]['id'][_0xeabc('0x8c')]())))[_0xeabc('0x8c')]();break;default:_0xceed5f=squel[_0xeabc('0xa4')]()[_0xeabc('0xa5')](_0xeabc('0xb5'))[_0xeabc('0xa6')](['phone','scheduledAt','ContactId',_0xeabc('0xa9'),_0xeabc('0x67'),'createdAt','updatedAt'],squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xaa'),_0xeabc('0xaa'))['field']('\x27'+_0x1708ec+'\x27',_0xeabc('0xa7'))[_0xeabc('0x85')]('id',_0xeabc('0xa8'))[_0xeabc('0x85')](_0x11128b[_0xeabc('0xab')][_0xeabc('0x8c')](),'ListId')[_0xeabc('0x85')](_0x5cf0e6[_0xeabc('0x52')]['id']['toString'](),'VoiceQueueId')[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0x5f'))['field']('\x27'+_0x1708ec+'\x27',_0xeabc('0x60'))[_0xeabc('0x86')]('cm_contacts')[_0xeabc('0x45')]('deletedAt\x20IS\x20NULL')[_0xeabc('0x45')](_0xeabc('0xae'),_0x11128b[_0xeabc('0xab')]['toString']())[_0xeabc('0x45')](_0xeabc('0xb6')))['toString']();}_0x44ac6f[_0xeabc('0x8a')](db[_0xeabc('0x8b')][_0xeabc('0x3c')](_0xceed5f));}return BPromise[_0xeabc('0x90')](_0x44ac6f);}})['then'](function(){var _0x390d90=[];var _0x414fc3=squel[_0xeabc('0xa4')]()[_0xeabc('0xa5')](_0xeabc('0xb7'))[_0xeabc('0xa6')]([_0xeabc('0xb8'),_0xeabc('0xaa'),_0xeabc('0xb9'),'createdAt',_0xeabc('0x60')],squel[_0xeabc('0x84')]()[_0xeabc('0x85')](_0xeabc('0xba'))[_0xeabc('0x85')]('ci.item')[_0xeabc('0x85')]('ci.OrderBy')[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27',_0xeabc('0x5f'))[_0xeabc('0x85')]('\x27'+_0x1708ec+'\x27','updatedAt')['from'](_0xeabc('0xbb'),'ci')[_0xeabc('0x88')](_0xeabc('0xb5'),'h','h.ContactId=ci.CmContactId')[_0xeabc('0x45')](_0xeabc('0xbc'),_0x1708ec)[_0xeabc('0x45')]('ci.ItemClass=?',_0xeabc('0xbd')))['toString']();_0x390d90[_0xeabc('0x8a')](db['sequelize'][_0xeabc('0x3c')](_0x414fc3));return BPromise[_0xeabc('0x90')](_0x390d90);})[_0xeabc('0x29')](function(){return _0x394082;})[_0xeabc('0x29')](respondWithResult(_0x4f8763,null))[_0xeabc('0x50')](handleError(_0x4f8763,null));};exports[_0xeabc('0xbe')]=function(_0x1216cf,_0x198c42,_0x21a0df){return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0x1216cf['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x198c42,null))[_0xeabc('0x29')](function(_0x42c8c9){if(_0x42c8c9){return _0x42c8c9[_0xeabc('0xbe')](_0x1216cf[_0xeabc('0x3c')][_0xeabc('0x83')]);}})['then'](function(_0x67df66){if(_0x67df66){return db[_0xeabc('0x66')][_0xeabc('0x2a')]({'where':{'ListId':_0x1216cf[_0xeabc('0x3c')][_0xeabc('0x83')],'VoiceQueueId':_0x1216cf[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](function(){return _0x67df66;});}})[_0xeabc('0x29')](respondWithStatusCode(_0x198c42,null))[_0xeabc('0x50')](handleError(_0x198c42,null));};exports['getBlackLists']=function(_0xaf0794,_0x47da72,_0x30b6a2){var _0xcc42a7={};var _0x13be21={};var _0x28a4cb;var _0x5ee7bb;return db[_0xeabc('0x4c')][_0xeabc('0x65')]({'where':{'id':_0xaf0794['params']['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x47da72,null))['then'](function(_0x22c237){if(_0x22c237){_0x28a4cb=_0x22c237;_0x13be21[_0xeabc('0x3e')]=_['keys'](db[_0xeabc('0x9e')]['rawAttributes']);_0x13be21['query']=_['keys'](_0xaf0794[_0xeabc('0x3c')]);_0x13be21[_0xeabc('0x47')]=_[_0xeabc('0x53')](_0x13be21[_0xeabc('0x3e')],_0x13be21[_0xeabc('0x3c')]);_0xcc42a7[_0xeabc('0x3f')]=_[_0xeabc('0x53')](_0x13be21[_0xeabc('0x3e')],qs[_0xeabc('0x40')](_0xaf0794[_0xeabc('0x3c')]['fields']));_0xcc42a7[_0xeabc('0x3f')]=_0xcc42a7['attributes'][_0xeabc('0x41')]?_0xcc42a7[_0xeabc('0x3f')]:_0x13be21[_0xeabc('0x3e')];_0xcc42a7['order']=qs[_0xeabc('0x44')](_0xaf0794['query']['sort']);_0xcc42a7[_0xeabc('0x45')]=qs['filters'](_[_0xeabc('0x46')](_0xaf0794[_0xeabc('0x3c')],_0x13be21['filters']));if(_0xaf0794[_0xeabc('0x3c')]['filter']){_0xcc42a7[_0xeabc('0x45')]=_['merge'](_0xcc42a7[_0xeabc('0x45')],{'$or':_['map'](_0xcc42a7[_0xeabc('0x3f')],function(_0x559792){var _0xb959bf={};_0xb959bf[_0x559792]={'$like':'%'+_0xaf0794[_0xeabc('0x3c')][_0xeabc('0x4a')]+'%'};return _0xb959bf;})});}_0xcc42a7=_[_0xeabc('0x48')]({},_0xcc42a7,_0xaf0794['options']);return _0x28a4cb['getBlackLists'](_0xcc42a7);}})['then'](function(_0x51f91d){if(_0x51f91d){_0x5ee7bb=_0x51f91d[_0xeabc('0x41')];if(!_0xaf0794[_0xeabc('0x3c')][_0xeabc('0x42')]('nolimit')){_0xcc42a7[_0xeabc('0x23')]=qs['limit'](_0xaf0794[_0xeabc('0x3c')][_0xeabc('0x23')]);_0xcc42a7[_0xeabc('0x21')]=qs[_0xeabc('0x21')](_0xaf0794['query']['offset']);}return _0x28a4cb['getBlackLists'](_0xcc42a7);}})[_0xeabc('0x29')](function(_0x457d82){if(_0x457d82){return _0x457d82?{'count':_0x5ee7bb,'rows':_0x457d82}:null;}})[_0xeabc('0x29')](respondWithResult(_0x47da72,null))[_0xeabc('0x50')](handleError(_0x47da72,null));};exports['addBlackLists']=function(_0x3d9f54,_0x440501,_0x11a8af){var _0x268aff,_0x1fbd9b;return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0x3d9f54[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x440501,null))[_0xeabc('0x29')](function(_0x5643f6){if(_0x5643f6){_0x1fbd9b=_0x5643f6;return _0x5643f6['addBlackLists'](_0x3d9f54['body'][_0xeabc('0x83')],_[_0xeabc('0x5e')](_0x3d9f54[_0xeabc('0x55')],[_0xeabc('0x83'),'id'])||{});}return null;})[_0xeabc('0xa1')](function(_0x18157e){var _0x404839;_0x268aff=_0x18157e||[];var _0x30eb6f=[];if(_0x18157e){for(var _0xba3953=0x0;_0xba3953<_0x18157e[_0xeabc('0x41')];_0xba3953+=0x1){var _0xa1613b=_0x18157e[_0xba3953][_0xeabc('0x2b')]({'plain':!![]});_0x404839=squel[_0xeabc('0xa4')]()['into']('cm_hopper_black')[_0xeabc('0xa6')](['phone',_0xeabc('0xa8'),'ListId',_0xeabc('0x67'),_0xeabc('0x5f'),'updatedAt'],squel['select']()[_0xeabc('0x85')](_0xeabc('0xaa'),_0xeabc('0xaa'))['field']('id',_0xeabc('0xa8'))[_0xeabc('0x85')](_0xa1613b[_0xeabc('0xab')][_0xeabc('0x8c')](),'ListId')[_0xeabc('0x85')](_0x3d9f54[_0xeabc('0x52')]['id'][_0xeabc('0x8c')](),_0xeabc('0x67'))[_0xeabc('0x85')](_0xeabc('0xbf'),_0xeabc('0x5f'))[_0xeabc('0x85')](_0xeabc('0xbf'),_0xeabc('0x60'))[_0xeabc('0x86')](_0xeabc('0xac'))[_0xeabc('0x45')](_0xeabc('0xad'))[_0xeabc('0x45')](_0xeabc('0xae'),_0xa1613b[_0xeabc('0xab')][_0xeabc('0x8c')]())[_0xeabc('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0xeabc('0x8c')]();_0x30eb6f[_0xeabc('0x8a')](db[_0xeabc('0x8b')][_0xeabc('0x3c')](_0x404839));}return BPromise[_0xeabc('0x90')](_0x30eb6f);}})[_0xeabc('0x29')](function(){return _0x268aff;})[_0xeabc('0x29')](respondWithResult(_0x440501,null))['catch'](handleError(_0x440501,null));};exports[_0xeabc('0xc0')]=function(_0xb22c9f,_0x24bc07,_0x52bc60){return db[_0xeabc('0x4c')][_0xeabc('0x33')]({'where':{'id':_0xb22c9f[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](handleEntityNotFound(_0x24bc07,null))['then'](function(_0x3a3d98){if(_0x3a3d98){return _0x3a3d98[_0xeabc('0xc0')](_0xb22c9f[_0xeabc('0x3c')][_0xeabc('0x83')]);}})[_0xeabc('0x29')](function(_0x14cf92){if(_0x14cf92){return db[_0xeabc('0x6e')][_0xeabc('0x2a')]({'where':{'ListId':_0xb22c9f[_0xeabc('0x3c')][_0xeabc('0x83')],'VoiceQueueId':_0xb22c9f[_0xeabc('0x52')]['id']}})[_0xeabc('0x29')](function(){return _0x14cf92;});}})[_0xeabc('0x29')](respondWithStatusCode(_0x24bc07,null))[_0xeabc('0x50')](handleError(_0x24bc07,null));};
\ No newline at end of file
index 4c9dead..4083c12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fa8=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x6fa8,0x1da));var _0x86fa=function(_0x5b88f1,_0x9555f0){_0x5b88f1=_0x5b88f1-0x0;var _0x41f6c2=_0x6fa8[_0x5b88f1];return _0x41f6c2;};'use strict';var EventEmitter=require(_0x86fa('0x0'));var VoiceQueue=require(_0x86fa('0x1'))['db'][_0x86fa('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x86fa('0x3')](0x0);var events={'afterCreate':_0x86fa('0x4'),'afterUpdate':_0x86fa('0x5'),'afterDestroy':_0x86fa('0x6')};function emitEvent(_0x12ea9e){return function(_0x39ec5b,_0x265edd,_0x1e0cc2){VoiceQueueEvents[_0x86fa('0x7')](_0x12ea9e+':'+_0x39ec5b['id'],_0x39ec5b);VoiceQueueEvents['emit'](_0x12ea9e,_0x39ec5b);_0x1e0cc2(null);};}for(var e in events){if(events[_0x86fa('0x8')](e)){var event=events[e];VoiceQueue[_0x86fa('0x9')](e,emitEvent(event));}}module[_0x86fa('0xa')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x94f0=['exports','events','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2ff9fe,_0x6f9bfd){var _0x46e18d=function(_0x30aaab){while(--_0x30aaab){_0x2ff9fe['push'](_0x2ff9fe['shift']());}};_0x46e18d(++_0x6f9bfd);}(_0x94f0,0x1b1));var _0x094f=function(_0x1f6a87,_0x31aa8d){_0x1f6a87=_0x1f6a87-0x0;var _0x4db6f0=_0x94f0[_0x1f6a87];return _0x4db6f0;};'use strict';var EventEmitter=require(_0x094f('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x094f('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x094f('0x2')](0x0);var events={'afterCreate':_0x094f('0x3'),'afterUpdate':_0x094f('0x4'),'afterDestroy':'remove'};function emitEvent(_0xb91398){return function(_0x2b5a3b,_0x15d939,_0x30da06){VoiceQueueEvents[_0x094f('0x5')](_0xb91398+':'+_0x2b5a3b['id'],_0x2b5a3b);VoiceQueueEvents[_0x094f('0x5')](_0xb91398,_0x2b5a3b);_0x30da06(null);};}for(var e in events){if(events[_0x094f('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x094f('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 7e58d04..3188fb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x55ca,0x126));var _0xa55c=function(_0x5572b7,_0x244036){_0x5572b7=_0x5572b7-0x0;var _0x1bc232=_0x55ca[_0x5572b7];return _0x1bc232;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x50ea98,_0x20e2e2){var _0xaa7ea5=function(_0x4794d6){while(--_0x4794d6){_0x50ea98['push'](_0x50ea98['shift']());}};_0xaa7ea5(++_0x20e2e2);}(_0x34e8,0x12c));var _0x834e=function(_0x1ae7d4,_0x4e8336){_0x1ae7d4=_0x1ae7d4-0x0;var _0x2bb27d=_0x34e8[_0x1ae7d4];return _0x2bb27d;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 227c0f1..9e67d0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f2d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetVoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowVoiceQueue','find','catch','lodash','moment','bluebird','randomstring'];(function(_0x5d1c2d,_0x38b5c8){var _0x4646b4=function(_0xe4562c){while(--_0xe4562c){_0x5d1c2d['push'](_0x5d1c2d['shift']());}};_0x4646b4(++_0x38b5c8);}(_0x8f2d,0x15b));var _0xd8f2=function(_0x26e218,_0x3e72ef){_0x26e218=_0x26e218-0x0;var _0xc8bfb3=_0x8f2d[_0x26e218];return _0xc8bfb3;};'use strict';var _=require(_0xd8f2('0x0'));var util=require('util');var moment=require(_0xd8f2('0x1'));var BPromise=require(_0xd8f2('0x2'));var rs=require(_0xd8f2('0x3'));var fs=require('fs');var Redis=require(_0xd8f2('0x4'));var db=require(_0xd8f2('0x5'))['db'];var utils=require(_0xd8f2('0x6'));var logger=require(_0xd8f2('0x7'))(_0xd8f2('0x8'));var config=require(_0xd8f2('0x9'));var jayson=require(_0xd8f2('0xa'));var client=jayson[_0xd8f2('0xb')]['http']({'port':0x232a});config[_0xd8f2('0xc')]=_[_0xd8f2('0xd')](config[_0xd8f2('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8f2('0xc')]));require(_0xd8f2('0xe'))[_0xd8f2('0xf')](socket);function respondWithRpcPromise(_0x2bdb2e,_0x3ca1b1,_0x4ca4f1){return new BPromise(function(_0x2d165b,_0x36fe8a){return client[_0xd8f2('0x10')](_0x2bdb2e,_0x4ca4f1)[_0xd8f2('0x11')](function(_0x5dee6f){logger[_0xd8f2('0x12')](_0xd8f2('0x13'),_0x3ca1b1,_0xd8f2('0x14'));logger[_0xd8f2('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3ca1b1,'request\x20sent',JSON[_0xd8f2('0x16')](_0x5dee6f));if(_0x5dee6f[_0xd8f2('0x17')]){if(_0x5dee6f[_0xd8f2('0x17')][_0xd8f2('0x18')]===0x1f4){logger['error'](_0xd8f2('0x13'),_0x3ca1b1,_0x5dee6f['error'][_0xd8f2('0x19')]);return _0x36fe8a(_0x5dee6f[_0xd8f2('0x17')]['message']);}logger[_0xd8f2('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x3ca1b1,_0x5dee6f['error'][_0xd8f2('0x19')]);return _0x2d165b(_0x5dee6f[_0xd8f2('0x17')][_0xd8f2('0x19')]);}else{logger[_0xd8f2('0x12')](_0xd8f2('0x13'),_0x3ca1b1,_0xd8f2('0x14'));_0x2d165b(_0x5dee6f['result']['message']);}})['catch'](function(_0x2f7272){logger[_0xd8f2('0x17')](_0xd8f2('0x13'),_0x3ca1b1,_0x2f7272);_0x36fe8a(_0x2f7272);});});}exports[_0xd8f2('0x1a')]=function(_0x8b49c8){var _0x5691d1=this;return new Promise(function(_0x3392db,_0x44fe32){return db['VoiceQueue'][_0xd8f2('0x1b')]({'raw':_0x8b49c8[_0xd8f2('0x1c')]?_0x8b49c8['options'][_0xd8f2('0x1d')]===undefined?!![]:![]:!![],'where':_0x8b49c8['options']?_0x8b49c8[_0xd8f2('0x1c')][_0xd8f2('0x1e')]||null:null,'attributes':_0x8b49c8['options']?_0x8b49c8[_0xd8f2('0x1c')][_0xd8f2('0x1f')]||null:null,'limit':_0x8b49c8[_0xd8f2('0x1c')]?_0x8b49c8[_0xd8f2('0x1c')][_0xd8f2('0x20')]||null:null,'include':_0x8b49c8[_0xd8f2('0x1c')]?_0x8b49c8['options']['include']?_[_0xd8f2('0x21')](_0x8b49c8['options'][_0xd8f2('0x22')],function(_0x523c06){return{'model':db[_0x523c06['model']],'as':_0x523c06['as'],'attributes':_0x523c06['attributes'],'include':_0x523c06[_0xd8f2('0x22')]?_['map'](_0x523c06[_0xd8f2('0x22')],function(_0x5f2518){return{'model':db[_0x5f2518[_0xd8f2('0x23')]],'as':_0x5f2518['as'],'attributes':_0x5f2518[_0xd8f2('0x1f')],'include':_0x5f2518[_0xd8f2('0x22')]?_[_0xd8f2('0x21')](_0x5f2518[_0xd8f2('0x22')],function(_0x258af6){return{'model':db[_0x258af6[_0xd8f2('0x23')]],'as':_0x258af6['as'],'attributes':_0x258af6[_0xd8f2('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x597470){logger[_0xd8f2('0x12')](_0xd8f2('0x1a'),_0x8b49c8);logger[_0xd8f2('0x15')]('GetVoiceQueue',_0x8b49c8,JSON[_0xd8f2('0x16')](_0x597470));_0x3392db(_0x597470);})['catch'](function(_0xd0b0aa){logger['error'](_0xd8f2('0x1a'),_0xd0b0aa[_0xd8f2('0x19')],_0x8b49c8);_0x44fe32(_0x5691d1[_0xd8f2('0x17')](0x1f4,_0xd0b0aa[_0xd8f2('0x19')]));});});};exports[_0xd8f2('0x24')]=function(_0x1e3f83){var _0x323e72=this;return new Promise(function(_0x23ccba,_0x3bc442){return db['VoiceQueue'][_0xd8f2('0x25')]({'raw':_0x1e3f83['options']?_0x1e3f83[_0xd8f2('0x1c')][_0xd8f2('0x1d')]===undefined?!![]:![]:!![],'where':_0x1e3f83[_0xd8f2('0x1c')]?_0x1e3f83['options'][_0xd8f2('0x1e')]||null:null,'attributes':_0x1e3f83['options']?_0x1e3f83[_0xd8f2('0x1c')]['attributes']||null:null,'include':_0x1e3f83['options']?_0x1e3f83['options'][_0xd8f2('0x22')]?_['map'](_0x1e3f83[_0xd8f2('0x1c')][_0xd8f2('0x22')],function(_0x4bdb46){return{'model':db[_0x4bdb46[_0xd8f2('0x23')]],'as':_0x4bdb46['as'],'attributes':_0x4bdb46['attributes'],'include':_0x4bdb46[_0xd8f2('0x22')]?_[_0xd8f2('0x21')](_0x4bdb46[_0xd8f2('0x22')],function(_0x43c121){return{'model':db[_0x43c121[_0xd8f2('0x23')]],'as':_0x43c121['as'],'attributes':_0x43c121[_0xd8f2('0x1f')],'include':_0x43c121[_0xd8f2('0x22')]?_['map'](_0x43c121[_0xd8f2('0x22')],function(_0x2730fa){return{'model':db[_0x2730fa[_0xd8f2('0x23')]],'as':_0x2730fa['as'],'attributes':_0x2730fa[_0xd8f2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd8f2('0x11')](function(_0x3fb455){logger[_0xd8f2('0x12')](_0xd8f2('0x24'),_0x1e3f83);logger['debug']('ShowVoiceQueue',_0x1e3f83,JSON['stringify'](_0x3fb455));_0x23ccba(_0x3fb455);})[_0xd8f2('0x26')](function(_0x41658e){logger[_0xd8f2('0x17')](_0xd8f2('0x24'),_0x41658e[_0xd8f2('0x19')],_0x1e3f83);_0x3bc442(_0x323e72['error'](0x1f4,_0x41658e['message']));});});};
\ No newline at end of file
+var _0x29aa=['raw','where','attributes','limit','include','map','model','catch','ShowVoiceQueue','VoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','GetVoiceQueue','options'];(function(_0x119880,_0x4f291f){var _0x4a1707=function(_0x4e88c2){while(--_0x4e88c2){_0x119880['push'](_0x119880['shift']());}};_0x4a1707(++_0x4f291f);}(_0x29aa,0x142));var _0xa29a=function(_0x7cdb44,_0x3be490){_0x7cdb44=_0x7cdb44-0x0;var _0x1f7408=_0x29aa[_0x7cdb44];return _0x1f7408;};'use strict';var _=require(_0xa29a('0x0'));var util=require(_0xa29a('0x1'));var moment=require(_0xa29a('0x2'));var BPromise=require(_0xa29a('0x3'));var rs=require(_0xa29a('0x4'));var fs=require('fs');var Redis=require(_0xa29a('0x5'));var db=require(_0xa29a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa29a('0x7'));var config=require(_0xa29a('0x8'));var jayson=require(_0xa29a('0x9'));var client=jayson[_0xa29a('0xa')][_0xa29a('0xb')]({'port':0x232a});config[_0xa29a('0xc')]=_['defaults'](config[_0xa29a('0xc')],{'host':_0xa29a('0xd'),'port':0x18eb});var socket=require(_0xa29a('0xe'))(new Redis(config[_0xa29a('0xc')]));require('./voiceQueue.socket')[_0xa29a('0xf')](socket);function respondWithRpcPromise(_0x51cfb5,_0x41c035,_0x166a77){return new BPromise(function(_0x2b9bce,_0x5a4ff7){return client[_0xa29a('0x10')](_0x51cfb5,_0x166a77)[_0xa29a('0x11')](function(_0x11be49){logger[_0xa29a('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x41c035,_0xa29a('0x13'));logger[_0xa29a('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x41c035,_0xa29a('0x13'),JSON[_0xa29a('0x15')](_0x11be49));if(_0x11be49[_0xa29a('0x16')]){if(_0x11be49[_0xa29a('0x16')][_0xa29a('0x17')]===0x1f4){logger[_0xa29a('0x16')](_0xa29a('0x18'),_0x41c035,_0x11be49['error']['message']);return _0x5a4ff7(_0x11be49[_0xa29a('0x16')]['message']);}logger[_0xa29a('0x16')](_0xa29a('0x18'),_0x41c035,_0x11be49['error'][_0xa29a('0x19')]);return _0x2b9bce(_0x11be49[_0xa29a('0x16')][_0xa29a('0x19')]);}else{logger[_0xa29a('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x41c035,_0xa29a('0x13'));_0x2b9bce(_0x11be49[_0xa29a('0x1a')][_0xa29a('0x19')]);}})['catch'](function(_0xda5adf){logger[_0xa29a('0x16')](_0xa29a('0x18'),_0x41c035,_0xda5adf);_0x5a4ff7(_0xda5adf);});});}exports[_0xa29a('0x1b')]=function(_0x4a701c){var _0x691028=this;return new Promise(function(_0x37762a,_0x4788c2){return db['VoiceQueue']['findAll']({'raw':_0x4a701c[_0xa29a('0x1c')]?_0x4a701c['options'][_0xa29a('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a701c['options']?_0x4a701c[_0xa29a('0x1c')][_0xa29a('0x1e')]||null:null,'attributes':_0x4a701c[_0xa29a('0x1c')]?_0x4a701c[_0xa29a('0x1c')][_0xa29a('0x1f')]||null:null,'limit':_0x4a701c[_0xa29a('0x1c')]?_0x4a701c['options'][_0xa29a('0x20')]||null:null,'include':_0x4a701c[_0xa29a('0x1c')]?_0x4a701c[_0xa29a('0x1c')][_0xa29a('0x21')]?_[_0xa29a('0x22')](_0x4a701c[_0xa29a('0x1c')][_0xa29a('0x21')],function(_0x6a0521){return{'model':db[_0x6a0521['model']],'as':_0x6a0521['as'],'attributes':_0x6a0521[_0xa29a('0x1f')],'include':_0x6a0521[_0xa29a('0x21')]?_[_0xa29a('0x22')](_0x6a0521['include'],function(_0x3cec62){return{'model':db[_0x3cec62[_0xa29a('0x23')]],'as':_0x3cec62['as'],'attributes':_0x3cec62[_0xa29a('0x1f')],'include':_0x3cec62[_0xa29a('0x21')]?_['map'](_0x3cec62[_0xa29a('0x21')],function(_0x5560aa){return{'model':db[_0x5560aa[_0xa29a('0x23')]],'as':_0x5560aa['as'],'attributes':_0x5560aa[_0xa29a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd66bd1){logger[_0xa29a('0x12')](_0xa29a('0x1b'),_0x4a701c);logger[_0xa29a('0x14')](_0xa29a('0x1b'),_0x4a701c,JSON[_0xa29a('0x15')](_0xd66bd1));_0x37762a(_0xd66bd1);})[_0xa29a('0x24')](function(_0x32dcdd){logger[_0xa29a('0x16')]('GetVoiceQueue',_0x32dcdd[_0xa29a('0x19')],_0x4a701c);_0x4788c2(_0x691028[_0xa29a('0x16')](0x1f4,_0x32dcdd['message']));});});};exports[_0xa29a('0x25')]=function(_0x584e6a){var _0x33c27d=this;return new Promise(function(_0x4f1320,_0x428ab4){return db[_0xa29a('0x26')]['find']({'raw':_0x584e6a['options']?_0x584e6a[_0xa29a('0x1c')][_0xa29a('0x1d')]===undefined?!![]:![]:!![],'where':_0x584e6a[_0xa29a('0x1c')]?_0x584e6a['options'][_0xa29a('0x1e')]||null:null,'attributes':_0x584e6a['options']?_0x584e6a[_0xa29a('0x1c')][_0xa29a('0x1f')]||null:null,'include':_0x584e6a['options']?_0x584e6a[_0xa29a('0x1c')][_0xa29a('0x21')]?_[_0xa29a('0x22')](_0x584e6a[_0xa29a('0x1c')][_0xa29a('0x21')],function(_0x39a642){return{'model':db[_0x39a642['model']],'as':_0x39a642['as'],'attributes':_0x39a642[_0xa29a('0x1f')],'include':_0x39a642[_0xa29a('0x21')]?_[_0xa29a('0x22')](_0x39a642[_0xa29a('0x21')],function(_0x15e2cc){return{'model':db[_0x15e2cc[_0xa29a('0x23')]],'as':_0x15e2cc['as'],'attributes':_0x15e2cc[_0xa29a('0x1f')],'include':_0x15e2cc[_0xa29a('0x21')]?_[_0xa29a('0x22')](_0x15e2cc[_0xa29a('0x21')],function(_0x5d9585){return{'model':db[_0x5d9585['model']],'as':_0x5d9585['as'],'attributes':_0x5d9585[_0xa29a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa29a('0x11')](function(_0x3ef062){logger[_0xa29a('0x12')](_0xa29a('0x25'),_0x584e6a);logger[_0xa29a('0x14')](_0xa29a('0x25'),_0x584e6a,JSON[_0xa29a('0x15')](_0x3ef062));_0x4f1320(_0x3ef062);})[_0xa29a('0x24')](function(_0x5682c9){logger['error'](_0xa29a('0x25'),_0x5682c9[_0xa29a('0x19')],_0x584e6a);_0x428ab4(_0x33c27d[_0xa29a('0x16')](0x1f4,_0x5682c9[_0xa29a('0x19')]));});});};
\ No newline at end of file
index 8a0994d..6df155d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64eb=['update','emit','removeListener','length','voiceQueue:','./voiceQueue.events','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x64eb,0xc9));var _0xb64e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x64eb[_0x14add3];return _0x4a174f;};'use strict';var VoiceQueueEvents=require(_0xb64e('0x0'));var events=['save',_0xb64e('0x1'),_0xb64e('0x2')];function createListener(_0x30ac99,_0x14593d){return function(_0x1a8e71){_0x14593d[_0xb64e('0x3')](_0x30ac99,_0x1a8e71);};}function removeListener(_0x5c735b,_0x3f8ef8){return function(){VoiceQueueEvents[_0xb64e('0x4')](_0x5c735b,_0x3f8ef8);};}exports['register']=function(_0x48741e){for(var _0x30a06f=0x0,_0x3d940f=events[_0xb64e('0x5')];_0x30a06f<_0x3d940f;_0x30a06f++){var _0x132ee8=events[_0x30a06f];var _0x32258b=createListener(_0xb64e('0x6')+_0x132ee8,_0x48741e);VoiceQueueEvents['on'](_0x132ee8,_0x32258b);}};
\ No newline at end of file
+var _0x27fe=['./voiceQueue.events','save','update','emit','removeListener','register','voiceQueue:'];(function(_0x1d0456,_0x353c0b){var _0x1f4fbf=function(_0x21c62c){while(--_0x21c62c){_0x1d0456['push'](_0x1d0456['shift']());}};_0x1f4fbf(++_0x353c0b);}(_0x27fe,0xe7));var _0xe27f=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x27fe[_0x3ce3c];return _0x55a2c9;};'use strict';var VoiceQueueEvents=require(_0xe27f('0x0'));var events=[_0xe27f('0x1'),'remove',_0xe27f('0x2')];function createListener(_0x23bf98,_0x19011b){return function(_0x27cb88){_0x19011b[_0xe27f('0x3')](_0x23bf98,_0x27cb88);};}function removeListener(_0x279866,_0xc2880e){return function(){VoiceQueueEvents[_0xe27f('0x4')](_0x279866,_0xc2880e);};}exports[_0xe27f('0x5')]=function(_0x1857e5){for(var _0x2a7284=0x0,_0x210cab=events['length'];_0x2a7284<_0x210cab;_0x2a7284++){var _0x521953=events[_0x2a7284];var _0x22f81d=createListener(_0xe27f('0x6')+_0x521953,_0x1857e5);VoiceQueueEvents['on'](_0x521953,_0x22f81d);}};
\ No newline at end of file
index 63f9302..f7aa1c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa7d=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','get','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','destroy','exports'];(function(_0x3d7f19,_0x54c94a){var _0x5af876=function(_0x42b41d){while(--_0x42b41d){_0x3d7f19['push'](_0x3d7f19['shift']());}};_0x5af876(++_0x54c94a);}(_0xfa7d,0x78));var _0xdfa7=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xfa7d[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0xdfa7('0x0'));var util=require(_0xdfa7('0x1'));var path=require(_0xdfa7('0x2'));var timeout=require(_0xdfa7('0x3'));var express=require(_0xdfa7('0x4'));var router=express['Router']();var fs_extra=require(_0xdfa7('0x5'));var auth=require(_0xdfa7('0x6'));var interaction=require(_0xdfa7('0x7'));var config=require(_0xdfa7('0x8'));var controller=require(_0xdfa7('0x9'));router['get']('/',auth[_0xdfa7('0xa')](),controller['index']);router[_0xdfa7('0xb')](_0xdfa7('0xc'),auth['isAuthenticated'](),controller[_0xdfa7('0xd')]);router['get'](_0xdfa7('0xe'),auth[_0xdfa7('0xa')](),controller[_0xdfa7('0xf')]);router[_0xdfa7('0xb')](_0xdfa7('0x10'),auth[_0xdfa7('0xa')](),controller[_0xdfa7('0x11')]);router[_0xdfa7('0x12')]('/',auth[_0xdfa7('0xa')](),controller[_0xdfa7('0x13')]);router[_0xdfa7('0x14')](_0xdfa7('0x10'),auth[_0xdfa7('0xa')](),controller[_0xdfa7('0x15')]);router['delete'](_0xdfa7('0x10'),auth[_0xdfa7('0xa')](),controller[_0xdfa7('0x16')]);module[_0xdfa7('0x17')]=router;
\ No newline at end of file
+var _0x2023=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','delete','exports','util','connect-timeout','express'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0x2023,0x131));var _0x3202=function(_0x3e55eb,_0x24e873){_0x3e55eb=_0x3e55eb-0x0;var _0xf6c688=_0x2023[_0x3e55eb];return _0xf6c688;};'use strict';var multer=require('multer');var util=require(_0x3202('0x0'));var path=require('path');var timeout=require(_0x3202('0x1'));var express=require(_0x3202('0x2'));var router=express[_0x3202('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3202('0x4'));var interaction=require(_0x3202('0x5'));var config=require(_0x3202('0x6'));var controller=require(_0x3202('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3202('0x8')]);router[_0x3202('0x9')](_0x3202('0xa'),auth[_0x3202('0xb')](),controller[_0x3202('0xc')]);router[_0x3202('0x9')](_0x3202('0xd'),auth[_0x3202('0xb')](),controller[_0x3202('0xe')]);router[_0x3202('0x9')](_0x3202('0xf'),auth['isAuthenticated'](),controller[_0x3202('0x10')]);router[_0x3202('0x11')]('/',auth[_0x3202('0xb')](),controller[_0x3202('0x12')]);router[_0x3202('0x13')](_0x3202('0xf'),auth[_0x3202('0xb')](),controller['update']);router[_0x3202('0x14')](_0x3202('0xf'),auth[_0x3202('0xb')](),controller['destroy']);module[_0x3202('0x15')]=router;
\ No newline at end of file
index 57c6fd9..d38322c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeb7=['seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x2a1268,_0x4f93b8){var _0x2bf668=function(_0x50b8e5){while(--_0x50b8e5){_0x2a1268['push'](_0x2a1268['shift']());}};_0x2bf668(++_0x4f93b8);}(_0xbeb7,0x6e));var _0x7beb=function(_0xd115da,_0x3c1fd6){_0xd115da=_0xd115da-0x0;var _0x5dcc65=_0xbeb7[_0xd115da];return _0x5dcc65;};'use strict';var Sequelize=require(_0x7beb('0x0'));var moment=require('moment');module[_0x7beb('0x1')]={'type':{'type':Sequelize[_0x7beb('0x2')]},'uniqueid':{'type':Sequelize[_0x7beb('0x2')]},'calleridnum':{'type':Sequelize[_0x7beb('0x2')]},'calleridname':{'type':Sequelize[_0x7beb('0x2')]},'queue':{'type':Sequelize[_0x7beb('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x7beb('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x7beb('0x3')],'set':function(_0x3e0314){var _0x76039d=moment(_0x3e0314);var _0x430e03=moment(this[_0x7beb('0x4')](_0x7beb('0x5')))[_0x7beb('0x6')](_0x7beb('0x7'));var _0xe46749=_0x76039d[_0x7beb('0x8')](_0x430e03,_0x7beb('0x9'));this[_0x7beb('0xa')](_0x7beb('0xb'),_0x3e0314);this['setDataValue'](_0x7beb('0xc'),_0xe46749||null);}},'position':{'type':Sequelize[_0x7beb('0xd')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x7beb('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x7beb('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7beb('0x3')]},'queuecallerexit':{'type':Sequelize[_0x7beb('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7beb('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x7beb('0x2')],'comment':_0x7beb('0xf')},'originalposition':{'type':Sequelize[_0x7beb('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x7beb('0x2')]},'connectedlinename':{'type':Sequelize[_0x7beb('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7beb('0x2')]},'exten':{'type':Sequelize[_0x7beb('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7beb('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x7beb('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7beb('0x2')],'comment':_0x7beb('0x10')},'transferexten':{'type':Sequelize[_0x7beb('0x2')]},'transferuniqueid':{'type':Sequelize[_0x7beb('0x2')]},'disposition':{'type':Sequelize[_0x7beb('0x2')]},'secondDisposition':{'type':Sequelize[_0x7beb('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x7beb('0xd')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0798=['sequelize','moment','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x657798,_0x35496e){var _0x58c7e1=function(_0x178198){while(--_0x178198){_0x657798['push'](_0x657798['shift']());}};_0x58c7e1(++_0x35496e);}(_0x0798,0x126));var _0x8079=function(_0xa572c1,_0xb11bd5){_0xa572c1=_0xa572c1-0x0;var _0x11753f=_0x0798[_0xa572c1];return _0x11753f;};'use strict';var Sequelize=require(_0x8079('0x0'));var moment=require(_0x8079('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8079('0x2')]},'calleridnum':{'type':Sequelize[_0x8079('0x2')]},'calleridname':{'type':Sequelize[_0x8079('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x8079('0x3')],'set':function(_0x14fd2c){var _0x7d2be1=moment(_0x14fd2c);var _0x249457=moment(this[_0x8079('0x4')]('queuecallerjoinAt'))[_0x8079('0x5')](_0x8079('0x6'));var _0x377fbf=_0x7d2be1[_0x8079('0x7')](_0x249457,'seconds');this[_0x8079('0x8')](_0x8079('0x9'),_0x14fd2c);this[_0x8079('0x8')](_0x8079('0xa'),_0x377fbf||null);}},'position':{'type':Sequelize[_0x8079('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x8079('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8079('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x8079('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8079('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8079('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x8079('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8079('0x2')]},'connectedlinename':{'type':Sequelize[_0x8079('0x2')]},'accountcode':{'type':Sequelize[_0x8079('0x2')]},'context':{'type':Sequelize[_0x8079('0x2')]},'exten':{'type':Sequelize[_0x8079('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x8079('0xb')]},'mohtime':{'type':Sequelize[_0x8079('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8079('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8079('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8079('0x2')],'comment':_0x8079('0xd')},'transferexten':{'type':Sequelize[_0x8079('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8079('0x2')]},'disposition':{'type':Sequelize[_0x8079('0x2')]},'secondDisposition':{'type':Sequelize[_0x8079('0x2')]},'thirdDisposition':{'type':Sequelize[_0x8079('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x8079('0xb')],'defaultValue':0x0}};
\ No newline at end of file
index 6ddedea..e6424b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9430=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','offset','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','VoiceQueueReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','getVoiceQueuesReport','eml-format'];(function(_0x230c5c,_0x46db0d){var _0x1c92f8=function(_0x23a1d7){while(--_0x23a1d7){_0x230c5c['push'](_0x230c5c['shift']());}};_0x1c92f8(++_0x46db0d);}(_0x9430,0xec));var _0x0943=function(_0x2d8303,_0xcd9317){_0x2d8303=_0x2d8303-0x0;var _0x299bee=_0x9430[_0x2d8303];return _0x299bee;};'use strict';var emlformat=require(_0x0943('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0943('0x1'));var moment=require(_0x0943('0x2'));var BPromise=require(_0x0943('0x3'));var Mustache=require(_0x0943('0x4'));var util=require(_0x0943('0x5'));var path=require('path');var sox=require(_0x0943('0x6'));var csv=require(_0x0943('0x7'));var ejs=require(_0x0943('0x8'));var fs=require('fs');var fs_extra=require(_0x0943('0x9'));var _=require(_0x0943('0xa'));var squel=require(_0x0943('0xb'));var crypto=require(_0x0943('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0943('0xd'));var toCsv=require(_0x0943('0x7'));var querystring=require(_0x0943('0xe'));var Papa=require(_0x0943('0xf'));var Redis=require(_0x0943('0x10'));var authService=require(_0x0943('0x11'));var qs=require(_0x0943('0x12'));var as=require(_0x0943('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0943('0x14'));var licenseUtil=require(_0x0943('0x15'));var db=require(_0x0943('0x16'))['db'];config['redis']=_['defaults'](config[_0x0943('0x17')],{'host':_0x0943('0x18'),'port':0x18eb});var socket=require(_0x0943('0x19'))(new Redis(config[_0x0943('0x17')]));require(_0x0943('0x1a'))[_0x0943('0x1b')](socket);function respondWithStatusCode(_0x2847bf,_0xaf97d6){_0xaf97d6=_0xaf97d6||0xcc;return function(_0x46f128){if(_0x46f128){return _0x2847bf['sendStatus'](_0xaf97d6);}return _0x2847bf[_0x0943('0x1c')](_0xaf97d6)['end']();};}function respondWithResult(_0x4ccd03,_0x2e57a2){_0x2e57a2=_0x2e57a2||0xc8;return function(_0x544d0c){if(_0x544d0c){return _0x4ccd03[_0x0943('0x1c')](_0x2e57a2)['json'](_0x544d0c);}};}function respondWithFilteredResult(_0x306eef,_0x5cff9a){return function(_0x4c9294){if(_0x4c9294){var _0x3139dd=typeof _0x5cff9a[_0x0943('0x1d')]==='undefined'&&typeof _0x5cff9a[_0x0943('0x1e')]==='undefined';var _0x444a55=_0x4c9294[_0x0943('0x1f')];var _0x147f60=_0x3139dd?0x0:_0x5cff9a[_0x0943('0x1d')];var _0x20bba5=_0x3139dd?_0x4c9294[_0x0943('0x1f')]:_0x5cff9a['offset']+_0x5cff9a[_0x0943('0x1e')];var _0x96f704;if(_0x20bba5>=_0x444a55){_0x20bba5=_0x444a55;_0x96f704=0xc8;}else{_0x96f704=0xce;}_0x306eef[_0x0943('0x1c')](_0x96f704);return _0x306eef[_0x0943('0x20')](_0x0943('0x21'),_0x147f60+'-'+_0x20bba5+'/'+_0x444a55)['json'](_0x4c9294);}return null;};}function patchUpdates(_0x3af53e){return function(_0x521b13){try{jsonpatch[_0x0943('0x22')](_0x521b13,_0x3af53e,!![]);}catch(_0x516903){return BPromise['reject'](_0x516903);}return _0x521b13[_0x0943('0x23')]();};}function saveUpdates(_0x40a544,_0x4d8321){return function(_0x2b5404){if(_0x2b5404){return _0x2b5404[_0x0943('0x24')](_0x40a544)['then'](function(_0x5d82c9){return _0x5d82c9;});}return null;};}function removeEntity(_0x581ecb,_0xd20a6f){return function(_0x30fb57){if(_0x30fb57){return _0x30fb57[_0x0943('0x25')]()[_0x0943('0x26')](function(){_0x581ecb[_0x0943('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x492167,_0x2281b0){return function(_0x7a932b){if(!_0x7a932b){_0x492167[_0x0943('0x27')](0x194);}return _0x7a932b;};}function handleError(_0xb06aa7,_0x12a7d3){_0x12a7d3=_0x12a7d3||0x1f4;return function(_0x4fd4ca){logger[_0x0943('0x28')](_0x4fd4ca[_0x0943('0x29')]);if(_0x4fd4ca[_0x0943('0x2a')]){delete _0x4fd4ca[_0x0943('0x2a')];}_0xb06aa7[_0x0943('0x1c')](_0x12a7d3)[_0x0943('0x2b')](_0x4fd4ca);};}exports['index']=function(_0x449a82,_0x5de5d6){var _0x81c6a2={},_0x307ed3={},_0x1cd63={'count':0x0,'rows':[]};var _0x2d8347=_['map'](db[_0x0943('0x2c')][_0x0943('0x2d')],function(_0xcc71fd){return{'name':_0xcc71fd[_0x0943('0x2e')],'type':_0xcc71fd[_0x0943('0x2f')]['key']};});_0x307ed3['model']=_['map'](_0x2d8347,_0x0943('0x2a'));_0x307ed3[_0x0943('0x30')]=_[_0x0943('0x31')](_0x449a82[_0x0943('0x30')]);_0x307ed3[_0x0943('0x32')]=_['intersection'](_0x307ed3[_0x0943('0x33')],_0x307ed3['query']);_0x81c6a2[_0x0943('0x34')]=_[_0x0943('0x35')](_0x307ed3['model'],qs[_0x0943('0x36')](_0x449a82[_0x0943('0x30')]['fields']));_0x81c6a2[_0x0943('0x34')]=_0x81c6a2['attributes']['length']?_0x81c6a2[_0x0943('0x34')]:_0x307ed3[_0x0943('0x33')];if(!_0x449a82['query'][_0x0943('0x37')](_0x0943('0x38'))){_0x81c6a2[_0x0943('0x1e')]=qs[_0x0943('0x1e')](_0x449a82[_0x0943('0x30')][_0x0943('0x1e')]);_0x81c6a2[_0x0943('0x1d')]=qs['offset'](_0x449a82['query'][_0x0943('0x1d')]);}_0x81c6a2[_0x0943('0x39')]=qs['sort'](_0x449a82[_0x0943('0x30')][_0x0943('0x3a')]);_0x81c6a2[_0x0943('0x3b')]=qs[_0x0943('0x32')](_[_0x0943('0x3c')](_0x449a82[_0x0943('0x30')],_0x307ed3[_0x0943('0x32')]),_0x2d8347);if(_0x449a82[_0x0943('0x30')][_0x0943('0x3d')]){_0x81c6a2[_0x0943('0x3b')]=_[_0x0943('0x3e')](_0x81c6a2[_0x0943('0x3b')],{'$or':_[_0x0943('0x3f')](_0x2d8347,function(_0x4a80ac){if(_0x4a80ac[_0x0943('0x2f')]!==_0x0943('0x40')){var _0x515c3c={};_0x515c3c[_0x4a80ac['name']]={'$like':'%'+_0x449a82[_0x0943('0x30')][_0x0943('0x3d')]+'%'};return _0x515c3c;}})});}_0x81c6a2=_[_0x0943('0x3e')]({},_0x81c6a2,_0x449a82['options']);var _0xfbb9e4={'where':_0x81c6a2[_0x0943('0x3b')]};return db[_0x0943('0x2c')][_0x0943('0x1f')](_0xfbb9e4)[_0x0943('0x26')](function(_0x8efe22){_0x1cd63[_0x0943('0x1f')]=_0x8efe22;if(_0x449a82[_0x0943('0x30')][_0x0943('0x41')]){_0x81c6a2[_0x0943('0x42')]=[{'all':!![]}];}return db[_0x0943('0x2c')][_0x0943('0x43')](_0x81c6a2);})[_0x0943('0x26')](function(_0x5255dc){_0x1cd63[_0x0943('0x44')]=_0x5255dc;return _0x1cd63;})['then'](respondWithFilteredResult(_0x5de5d6,_0x81c6a2))[_0x0943('0x45')](handleError(_0x5de5d6,null));};exports[_0x0943('0x46')]=function(_0x439f0e,_0x3568b4){var _0x4e3738={'raw':![],'where':{'id':_0x439f0e[_0x0943('0x47')]['id']}},_0x31c7bd={};_0x31c7bd[_0x0943('0x33')]=_[_0x0943('0x31')](db[_0x0943('0x2c')][_0x0943('0x2d')]);_0x31c7bd['query']=_['keys'](_0x439f0e[_0x0943('0x30')]);_0x31c7bd[_0x0943('0x32')]=_['intersection'](_0x31c7bd[_0x0943('0x33')],_0x31c7bd[_0x0943('0x30')]);_0x4e3738[_0x0943('0x34')]=_[_0x0943('0x35')](_0x31c7bd['model'],qs[_0x0943('0x36')](_0x439f0e[_0x0943('0x30')][_0x0943('0x36')]));_0x4e3738[_0x0943('0x34')]=_0x4e3738[_0x0943('0x34')][_0x0943('0x48')]?_0x4e3738['attributes']:_0x31c7bd[_0x0943('0x33')];if(_0x439f0e[_0x0943('0x30')][_0x0943('0x41')]){_0x4e3738['include']=[{'all':!![]}];}_0x4e3738=_[_0x0943('0x3e')]({},_0x4e3738,_0x439f0e[_0x0943('0x49')]);return db[_0x0943('0x2c')][_0x0943('0x4a')](_0x4e3738)[_0x0943('0x26')](handleEntityNotFound(_0x3568b4,null))['then'](respondWithResult(_0x3568b4,null))[_0x0943('0x45')](handleError(_0x3568b4,null));};exports[_0x0943('0x4b')]=function(_0x3d4ba8,_0x9bc6aa){return db['VoiceQueueReport'][_0x0943('0x4b')](_0x3d4ba8[_0x0943('0x4c')],{})[_0x0943('0x26')](respondWithResult(_0x9bc6aa,0xc9))[_0x0943('0x45')](handleError(_0x9bc6aa,null));};exports[_0x0943('0x24')]=function(_0x5de71e,_0x2d0e51){if(_0x5de71e[_0x0943('0x4c')]['id']){delete _0x5de71e[_0x0943('0x4c')]['id'];}return db['VoiceQueueReport'][_0x0943('0x4a')]({'where':{'id':_0x5de71e[_0x0943('0x47')]['id']}})[_0x0943('0x26')](handleEntityNotFound(_0x2d0e51,null))['then'](saveUpdates(_0x5de71e['body'],null))[_0x0943('0x26')](respondWithResult(_0x2d0e51,null))[_0x0943('0x45')](handleError(_0x2d0e51,null));};exports['destroy']=function(_0x4ea375,_0x43bd62){return db['VoiceQueueReport'][_0x0943('0x4a')]({'where':{'id':_0x4ea375[_0x0943('0x47')]['id']}})[_0x0943('0x26')](handleEntityNotFound(_0x43bd62,null))[_0x0943('0x26')](removeEntity(_0x43bd62,null))[_0x0943('0x45')](handleError(_0x43bd62,null));};exports[_0x0943('0x4d')]=function(_0x3b00c1,_0x70a5ac){return db[_0x0943('0x2c')][_0x0943('0x4d')]()['then'](respondWithResult(_0x70a5ac,null))[_0x0943('0x45')](handleError(_0x70a5ac,null));};exports[_0x0943('0x4e')]=function(_0x27ed11,_0x4b7211){var _0x1fc864={},_0x5760ce={},_0x452c07={'count':0x0,'rows':[]};_0x5760ce[_0x0943('0x33')]=_[_0x0943('0x31')](db[_0x0943('0x2c')][_0x0943('0x2d')]);_0x5760ce['query']=_['keys'](_0x27ed11[_0x0943('0x30')]);_0x5760ce[_0x0943('0x32')]=_['intersection'](_0x5760ce[_0x0943('0x33')],_0x5760ce[_0x0943('0x30')]);_0x1fc864[_0x0943('0x34')]=_[_0x0943('0x35')](_0x5760ce[_0x0943('0x33')],qs['fields'](_0x27ed11[_0x0943('0x30')][_0x0943('0x36')]));_0x1fc864[_0x0943('0x34')]=_0x1fc864[_0x0943('0x34')]['length']?_0x1fc864['attributes']:_0x5760ce[_0x0943('0x33')];if(!_0x27ed11[_0x0943('0x30')][_0x0943('0x37')](_0x0943('0x38'))){_0x1fc864['limit']=qs[_0x0943('0x1e')](_0x27ed11['query'][_0x0943('0x1e')]);_0x1fc864[_0x0943('0x1d')]=qs[_0x0943('0x1d')](_0x27ed11[_0x0943('0x30')]['offset']);}_0x1fc864[_0x0943('0x39')]=qs[_0x0943('0x3a')](_0x27ed11[_0x0943('0x30')][_0x0943('0x3a')]);_0x1fc864['where']=qs[_0x0943('0x32')](_['pick'](_0x27ed11['query'],_0x5760ce[_0x0943('0x32')]));if(_0x27ed11[_0x0943('0x30')][_0x0943('0x3d')]){_0x1fc864[_0x0943('0x3b')]=_['merge'](_0x1fc864['where'],{'$or':_['map'](_0x1fc864[_0x0943('0x34')],function(_0x318f93){var _0x4b87de={};_0x4b87de[_0x318f93]={'$like':'%'+_0x27ed11[_0x0943('0x30')]['filter']+'%'};return _0x4b87de;})});}_0x1fc864=_[_0x0943('0x3e')]({},_0x1fc864,_0x27ed11[_0x0943('0x49')]);var _0x5a7890={'where':_0x1fc864['where']};return db[_0x0943('0x2c')][_0x0943('0x1f')](_0x5a7890)[_0x0943('0x26')](function(_0xd5c583){_0x452c07['count']=_0xd5c583;if(_0x27ed11[_0x0943('0x30')][_0x0943('0x41')]){_0x1fc864[_0x0943('0x42')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x0943('0x43')](_0x1fc864);})[_0x0943('0x26')](function(_0x142256){_0x452c07[_0x0943('0x44')]=_0x142256;return _0x452c07;})['then'](respondWithFilteredResult(_0x4b7211,_0x1fc864,'getVoiceQueuesReport'))[_0x0943('0x45')](handleError(_0x4b7211,null,_0x0943('0x4e')));};
\ No newline at end of file
+var _0x3d55=['map','VoiceQueueReport','rawAttributes','type','key','keys','query','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','create','body','find','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index'];(function(_0x2eb898,_0x43c47b){var _0x58974f=function(_0x5cdc1){while(--_0x5cdc1){_0x2eb898['push'](_0x2eb898['shift']());}};_0x58974f(++_0x43c47b);}(_0x3d55,0x75));var _0x53d5=function(_0x17788a,_0x150887){_0x17788a=_0x17788a-0x0;var _0x33f47c=_0x3d55[_0x17788a];return _0x33f47c;};'use strict';var emlformat=require(_0x53d5('0x0'));var rimraf=require(_0x53d5('0x1'));var zipdir=require(_0x53d5('0x2'));var jsonpatch=require(_0x53d5('0x3'));var rp=require(_0x53d5('0x4'));var moment=require(_0x53d5('0x5'));var BPromise=require(_0x53d5('0x6'));var Mustache=require(_0x53d5('0x7'));var util=require('util');var path=require(_0x53d5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53d5('0x9'));var squel=require(_0x53d5('0xa'));var crypto=require('crypto');var jsforce=require(_0x53d5('0xb'));var deskjs=require(_0x53d5('0xc'));var toCsv=require(_0x53d5('0xd'));var querystring=require(_0x53d5('0xe'));var Papa=require(_0x53d5('0xf'));var Redis=require(_0x53d5('0x10'));var authService=require(_0x53d5('0x11'));var qs=require(_0x53d5('0x12'));var as=require(_0x53d5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x53d5('0x14'));var utils=require(_0x53d5('0x15'));var config=require(_0x53d5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x53d5('0x17'))['db'];config[_0x53d5('0x18')]=_[_0x53d5('0x19')](config[_0x53d5('0x18')],{'host':_0x53d5('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x53d5('0x1b'))[_0x53d5('0x1c')](socket);function respondWithStatusCode(_0x3cbefa,_0x2e67cf){_0x2e67cf=_0x2e67cf||0xcc;return function(_0x2cc6b2){if(_0x2cc6b2){return _0x3cbefa[_0x53d5('0x1d')](_0x2e67cf);}return _0x3cbefa[_0x53d5('0x1e')](_0x2e67cf)[_0x53d5('0x1f')]();};}function respondWithResult(_0x19a43e,_0x52a02f){_0x52a02f=_0x52a02f||0xc8;return function(_0x453242){if(_0x453242){return _0x19a43e['status'](_0x52a02f)[_0x53d5('0x20')](_0x453242);}};}function respondWithFilteredResult(_0x40e00a,_0x2b3c7f){return function(_0x161552){if(_0x161552){var _0x561809=typeof _0x2b3c7f[_0x53d5('0x21')]==='undefined'&&typeof _0x2b3c7f[_0x53d5('0x22')]===_0x53d5('0x23');var _0x28f886=_0x161552[_0x53d5('0x24')];var _0x126e18=_0x561809?0x0:_0x2b3c7f['offset'];var _0x3bdd1e=_0x561809?_0x161552[_0x53d5('0x24')]:_0x2b3c7f['offset']+_0x2b3c7f['limit'];var _0x1c5c1a;if(_0x3bdd1e>=_0x28f886){_0x3bdd1e=_0x28f886;_0x1c5c1a=0xc8;}else{_0x1c5c1a=0xce;}_0x40e00a[_0x53d5('0x1e')](_0x1c5c1a);return _0x40e00a[_0x53d5('0x25')](_0x53d5('0x26'),_0x126e18+'-'+_0x3bdd1e+'/'+_0x28f886)[_0x53d5('0x20')](_0x161552);}return null;};}function patchUpdates(_0x3ebeaf){return function(_0x3825d1){try{jsonpatch[_0x53d5('0x27')](_0x3825d1,_0x3ebeaf,!![]);}catch(_0x4083d0){return BPromise[_0x53d5('0x28')](_0x4083d0);}return _0x3825d1[_0x53d5('0x29')]();};}function saveUpdates(_0x5bd5ee,_0x251791){return function(_0x5ccf1e){if(_0x5ccf1e){return _0x5ccf1e[_0x53d5('0x2a')](_0x5bd5ee)[_0x53d5('0x2b')](function(_0x3fa43e){return _0x3fa43e;});}return null;};}function removeEntity(_0x12a678,_0x1424d4){return function(_0x238ad3){if(_0x238ad3){return _0x238ad3[_0x53d5('0x2c')]()[_0x53d5('0x2b')](function(){_0x12a678[_0x53d5('0x1e')](0xcc)[_0x53d5('0x1f')]();});}};}function handleEntityNotFound(_0x49e806,_0x1efff4){return function(_0x17261e){if(!_0x17261e){_0x49e806[_0x53d5('0x1d')](0x194);}return _0x17261e;};}function handleError(_0x4a1f69,_0x87ca12){_0x87ca12=_0x87ca12||0x1f4;return function(_0x4937b0){logger[_0x53d5('0x2d')](_0x4937b0['stack']);if(_0x4937b0[_0x53d5('0x2e')]){delete _0x4937b0['name'];}_0x4a1f69[_0x53d5('0x1e')](_0x87ca12)[_0x53d5('0x2f')](_0x4937b0);};}exports[_0x53d5('0x30')]=function(_0xb47996,_0x3a4453){var _0x4c1cfe={},_0x174cb6={},_0x4b550c={'count':0x0,'rows':[]};var _0x2f0126=_[_0x53d5('0x31')](db[_0x53d5('0x32')][_0x53d5('0x33')],function(_0x7ad244){return{'name':_0x7ad244['fieldName'],'type':_0x7ad244[_0x53d5('0x34')][_0x53d5('0x35')]};});_0x174cb6['model']=_[_0x53d5('0x31')](_0x2f0126,_0x53d5('0x2e'));_0x174cb6['query']=_[_0x53d5('0x36')](_0xb47996[_0x53d5('0x37')]);_0x174cb6[_0x53d5('0x38')]=_['intersection'](_0x174cb6[_0x53d5('0x39')],_0x174cb6['query']);_0x4c1cfe['attributes']=_['intersection'](_0x174cb6['model'],qs[_0x53d5('0x3a')](_0xb47996[_0x53d5('0x37')][_0x53d5('0x3a')]));_0x4c1cfe[_0x53d5('0x3b')]=_0x4c1cfe[_0x53d5('0x3b')]['length']?_0x4c1cfe['attributes']:_0x174cb6['model'];if(!_0xb47996[_0x53d5('0x37')][_0x53d5('0x3c')](_0x53d5('0x3d'))){_0x4c1cfe[_0x53d5('0x22')]=qs[_0x53d5('0x22')](_0xb47996[_0x53d5('0x37')][_0x53d5('0x22')]);_0x4c1cfe['offset']=qs['offset'](_0xb47996[_0x53d5('0x37')]['offset']);}_0x4c1cfe[_0x53d5('0x3e')]=qs[_0x53d5('0x3f')](_0xb47996['query'][_0x53d5('0x3f')]);_0x4c1cfe[_0x53d5('0x40')]=qs[_0x53d5('0x38')](_[_0x53d5('0x41')](_0xb47996[_0x53d5('0x37')],_0x174cb6['filters']),_0x2f0126);if(_0xb47996['query']['filter']){_0x4c1cfe[_0x53d5('0x40')]=_[_0x53d5('0x42')](_0x4c1cfe[_0x53d5('0x40')],{'$or':_[_0x53d5('0x31')](_0x2f0126,function(_0x3adbdf){if(_0x3adbdf[_0x53d5('0x34')]!==_0x53d5('0x43')){var _0x3fa9c8={};_0x3fa9c8[_0x3adbdf[_0x53d5('0x2e')]]={'$like':'%'+_0xb47996[_0x53d5('0x37')][_0x53d5('0x44')]+'%'};return _0x3fa9c8;}})});}_0x4c1cfe=_['merge']({},_0x4c1cfe,_0xb47996[_0x53d5('0x45')]);var _0x1f5991={'where':_0x4c1cfe['where']};return db[_0x53d5('0x32')][_0x53d5('0x24')](_0x1f5991)[_0x53d5('0x2b')](function(_0x55d501){_0x4b550c[_0x53d5('0x24')]=_0x55d501;if(_0xb47996[_0x53d5('0x37')][_0x53d5('0x46')]){_0x4c1cfe[_0x53d5('0x47')]=[{'all':!![]}];}return db[_0x53d5('0x32')][_0x53d5('0x48')](_0x4c1cfe);})['then'](function(_0x4ae649){_0x4b550c[_0x53d5('0x49')]=_0x4ae649;return _0x4b550c;})[_0x53d5('0x2b')](respondWithFilteredResult(_0x3a4453,_0x4c1cfe))[_0x53d5('0x4a')](handleError(_0x3a4453,null));};exports[_0x53d5('0x4b')]=function(_0xae35d2,_0x5d2fe9){var _0x3d018c={'raw':![],'where':{'id':_0xae35d2[_0x53d5('0x4c')]['id']}},_0x3ee106={};_0x3ee106[_0x53d5('0x39')]=_[_0x53d5('0x36')](db['VoiceQueueReport'][_0x53d5('0x33')]);_0x3ee106[_0x53d5('0x37')]=_['keys'](_0xae35d2[_0x53d5('0x37')]);_0x3ee106[_0x53d5('0x38')]=_[_0x53d5('0x4d')](_0x3ee106[_0x53d5('0x39')],_0x3ee106[_0x53d5('0x37')]);_0x3d018c[_0x53d5('0x3b')]=_[_0x53d5('0x4d')](_0x3ee106[_0x53d5('0x39')],qs['fields'](_0xae35d2[_0x53d5('0x37')][_0x53d5('0x3a')]));_0x3d018c[_0x53d5('0x3b')]=_0x3d018c[_0x53d5('0x3b')][_0x53d5('0x4e')]?_0x3d018c[_0x53d5('0x3b')]:_0x3ee106[_0x53d5('0x39')];if(_0xae35d2[_0x53d5('0x37')]['includeAll']){_0x3d018c['include']=[{'all':!![]}];}_0x3d018c=_[_0x53d5('0x42')]({},_0x3d018c,_0xae35d2[_0x53d5('0x45')]);return db[_0x53d5('0x32')]['find'](_0x3d018c)[_0x53d5('0x2b')](handleEntityNotFound(_0x5d2fe9,null))['then'](respondWithResult(_0x5d2fe9,null))[_0x53d5('0x4a')](handleError(_0x5d2fe9,null));};exports[_0x53d5('0x4f')]=function(_0x10b463,_0x52a222){return db[_0x53d5('0x32')][_0x53d5('0x4f')](_0x10b463[_0x53d5('0x50')],{})[_0x53d5('0x2b')](respondWithResult(_0x52a222,0xc9))['catch'](handleError(_0x52a222,null));};exports[_0x53d5('0x2a')]=function(_0x2988e1,_0x50835c){if(_0x2988e1[_0x53d5('0x50')]['id']){delete _0x2988e1['body']['id'];}return db[_0x53d5('0x32')][_0x53d5('0x51')]({'where':{'id':_0x2988e1[_0x53d5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x50835c,null))[_0x53d5('0x2b')](saveUpdates(_0x2988e1[_0x53d5('0x50')],null))[_0x53d5('0x2b')](respondWithResult(_0x50835c,null))[_0x53d5('0x4a')](handleError(_0x50835c,null));};exports['destroy']=function(_0x233f70,_0x411356){return db[_0x53d5('0x32')][_0x53d5('0x51')]({'where':{'id':_0x233f70['params']['id']}})[_0x53d5('0x2b')](handleEntityNotFound(_0x411356,null))[_0x53d5('0x2b')](removeEntity(_0x411356,null))[_0x53d5('0x4a')](handleError(_0x411356,null));};exports['describe']=function(_0x452255,_0x5d3e7b){return db[_0x53d5('0x32')]['describe']()['then'](respondWithResult(_0x5d3e7b,null))[_0x53d5('0x4a')](handleError(_0x5d3e7b,null));};exports[_0x53d5('0x52')]=function(_0x154df8,_0x41f828){var _0x343c9c={},_0x42ad82={},_0x52366d={'count':0x0,'rows':[]};_0x42ad82[_0x53d5('0x39')]=_[_0x53d5('0x36')](db['VoiceQueueReport'][_0x53d5('0x33')]);_0x42ad82[_0x53d5('0x37')]=_['keys'](_0x154df8[_0x53d5('0x37')]);_0x42ad82[_0x53d5('0x38')]=_[_0x53d5('0x4d')](_0x42ad82['model'],_0x42ad82[_0x53d5('0x37')]);_0x343c9c[_0x53d5('0x3b')]=_['intersection'](_0x42ad82[_0x53d5('0x39')],qs[_0x53d5('0x3a')](_0x154df8[_0x53d5('0x37')][_0x53d5('0x3a')]));_0x343c9c[_0x53d5('0x3b')]=_0x343c9c['attributes']['length']?_0x343c9c['attributes']:_0x42ad82[_0x53d5('0x39')];if(!_0x154df8[_0x53d5('0x37')][_0x53d5('0x3c')]('nolimit')){_0x343c9c[_0x53d5('0x22')]=qs[_0x53d5('0x22')](_0x154df8[_0x53d5('0x37')]['limit']);_0x343c9c[_0x53d5('0x21')]=qs['offset'](_0x154df8[_0x53d5('0x37')]['offset']);}_0x343c9c[_0x53d5('0x3e')]=qs[_0x53d5('0x3f')](_0x154df8[_0x53d5('0x37')][_0x53d5('0x3f')]);_0x343c9c[_0x53d5('0x40')]=qs[_0x53d5('0x38')](_[_0x53d5('0x41')](_0x154df8[_0x53d5('0x37')],_0x42ad82['filters']));if(_0x154df8[_0x53d5('0x37')][_0x53d5('0x44')]){_0x343c9c['where']=_[_0x53d5('0x42')](_0x343c9c[_0x53d5('0x40')],{'$or':_[_0x53d5('0x31')](_0x343c9c['attributes'],function(_0x31d381){var _0x3719e3={};_0x3719e3[_0x31d381]={'$like':'%'+_0x154df8[_0x53d5('0x37')]['filter']+'%'};return _0x3719e3;})});}_0x343c9c=_[_0x53d5('0x42')]({},_0x343c9c,_0x154df8['options']);var _0x21fdc9={'where':_0x343c9c[_0x53d5('0x40')]};return db['VoiceQueueReport'][_0x53d5('0x24')](_0x21fdc9)[_0x53d5('0x2b')](function(_0x58d229){_0x52366d['count']=_0x58d229;if(_0x154df8[_0x53d5('0x37')][_0x53d5('0x46')]){_0x343c9c[_0x53d5('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x53d5('0x48')](_0x343c9c);})['then'](function(_0x37610c){_0x52366d[_0x53d5('0x49')]=_0x37610c;return _0x52366d;})[_0x53d5('0x2b')](respondWithFilteredResult(_0x41f828,_0x343c9c,_0x53d5('0x52')))[_0x53d5('0x4a')](handleError(_0x41f828,null,'getVoiceQueuesReport'));};
\ No newline at end of file
index 8d9b36d..8db70de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99e6=['emit','hasOwnProperty','hook','exports','VoiceQueueReport','setMaxListeners','save','update','remove'];(function(_0x5e0e29,_0x254f4b){var _0x3e914c=function(_0x2b95ab){while(--_0x2b95ab){_0x5e0e29['push'](_0x5e0e29['shift']());}};_0x3e914c(++_0x254f4b);}(_0x99e6,0x9d));var _0x699e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x99e6[_0x3c2a69];return _0x596bc8;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x699e('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x699e('0x1')](0x0);var events={'afterCreate':_0x699e('0x2'),'afterUpdate':_0x699e('0x3'),'afterDestroy':_0x699e('0x4')};function emitEvent(_0x3e36e3){return function(_0x4981bc,_0x196315,_0x23e829){VoiceQueueReportEvents[_0x699e('0x5')](_0x3e36e3+':'+_0x4981bc['id'],_0x4981bc);VoiceQueueReportEvents[_0x699e('0x5')](_0x3e36e3,_0x4981bc);_0x23e829(null);};}for(var e in events){if(events[_0x699e('0x6')](e)){var event=events[e];VoiceQueueReport[_0x699e('0x7')](e,emitEvent(event));}}module[_0x699e('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x224f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport'];(function(_0x1accf6,_0x4a9854){var _0x24e446=function(_0x487f51){while(--_0x487f51){_0x1accf6['push'](_0x1accf6['shift']());}};_0x24e446(++_0x4a9854);}(_0x224f,0x129));var _0xf224=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x224f[_0x557fd2];return _0x1b54a2;};'use strict';var EventEmitter=require(_0xf224('0x0'));var VoiceQueueReport=require(_0xf224('0x1'))['db'][_0xf224('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf224('0x3')](0x0);var events={'afterCreate':_0xf224('0x4'),'afterUpdate':_0xf224('0x5'),'afterDestroy':_0xf224('0x6')};function emitEvent(_0x1b6746){return function(_0x1341e,_0x1f7311,_0x1c3fb6){VoiceQueueReportEvents[_0xf224('0x7')](_0x1b6746+':'+_0x1341e['id'],_0x1341e);VoiceQueueReportEvents[_0xf224('0x7')](_0x1b6746,_0x1341e);_0x1c3fb6(null);};}for(var e in events){if(events[_0xf224('0x8')](e)){var event=events[e];VoiceQueueReport[_0xf224('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
index 4531441..53306ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d6a=['./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1635dd,_0x1ed277){var _0x2419dc=function(_0x196c97){while(--_0x196c97){_0x1635dd['push'](_0x1635dd['shift']());}};_0x2419dc(++_0x1ed277);}(_0x7d6a,0xf6));var _0xa7d6=function(_0x90436b,_0x26f6e8){_0x90436b=_0x90436b-0x0;var _0x30e3d6=_0x7d6a[_0x90436b];return _0x30e3d6;};'use strict';var _=require(_0xa7d6('0x0'));var util=require(_0xa7d6('0x1'));var logger=require(_0xa7d6('0x2'))(_0xa7d6('0x3'));var moment=require(_0xa7d6('0x4'));var BPromise=require(_0xa7d6('0x5'));var rp=require(_0xa7d6('0x6'));var fs=require('fs');var path=require(_0xa7d6('0x7'));var rimraf=require(_0xa7d6('0x8'));var config=require(_0xa7d6('0x9'));var attributes=require(_0xa7d6('0xa'));module['exports']=function(_0x589a63,_0x250a81){return _0x589a63[_0xa7d6('0xb')](_0xa7d6('0xc'),attributes,{'tableName':_0xa7d6('0xd'),'paranoid':![],'indexes':[{'fields':[_0xa7d6('0xe')]},{'fields':[_0xa7d6('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4848=['uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','VoiceQueueReport'];(function(_0x12ad0f,_0x46f8f2){var _0x3b0fb9=function(_0x571b0c){while(--_0x571b0c){_0x12ad0f['push'](_0x12ad0f['shift']());}};_0x3b0fb9(++_0x46f8f2);}(_0x4848,0x195));var _0x8484=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x4848[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x8484('0x0'));var util=require(_0x8484('0x1'));var logger=require(_0x8484('0x2'))(_0x8484('0x3'));var moment=require(_0x8484('0x4'));var BPromise=require('bluebird');var rp=require(_0x8484('0x5'));var fs=require('fs');var path=require(_0x8484('0x6'));var rimraf=require(_0x8484('0x7'));var config=require(_0x8484('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0x8484('0x9')]=function(_0x5f2d38,_0x27fab7){return _0x5f2d38['define'](_0x8484('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x8484('0xb')]},{'fields':[_0x8484('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index b57bda7..bc02a00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7b1=['./voiceQueueReport.socket','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','catch','VoiceQueueReport','options','where','attributes','limit','include','map','model','GetVoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','raw','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x2f5d09,_0x57e932){var _0x26ccd2=function(_0x50ae0f){while(--_0x50ae0f){_0x2f5d09['push'](_0x2f5d09['shift']());}};_0x26ccd2(++_0x57e932);}(_0xc7b1,0xb6));var _0x1c7b=function(_0x722103,_0x5732f3){_0x722103=_0x722103-0x0;var _0x3e2435=_0xc7b1[_0x722103];return _0x3e2435;};'use strict';var _=require(_0x1c7b('0x0'));var util=require('util');var moment=require(_0x1c7b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1c7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c7b('0x3'))['db'];var utils=require(_0x1c7b('0x4'));var logger=require(_0x1c7b('0x5'))(_0x1c7b('0x6'));var config=require(_0x1c7b('0x7'));var jayson=require(_0x1c7b('0x8'));var client=jayson[_0x1c7b('0x9')]['http']({'port':0x232a});config[_0x1c7b('0xa')]=_[_0x1c7b('0xb')](config[_0x1c7b('0xa')],{'host':_0x1c7b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1c7b('0xd'))['register'](socket);function respondWithRpcPromise(_0x2a9219,_0x5888ca,_0x4a237b){return new BPromise(function(_0x5cfc79,_0x59dd6a){return client[_0x1c7b('0xe')](_0x2a9219,_0x4a237b)[_0x1c7b('0xf')](function(_0x348fb6){logger[_0x1c7b('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x5888ca,_0x1c7b('0x11'));logger[_0x1c7b('0x12')](_0x1c7b('0x13'),_0x5888ca,_0x1c7b('0x11'),JSON[_0x1c7b('0x14')](_0x348fb6));if(_0x348fb6[_0x1c7b('0x15')]){if(_0x348fb6[_0x1c7b('0x15')]['code']===0x1f4){logger['error'](_0x1c7b('0x16'),_0x5888ca,_0x348fb6['error'][_0x1c7b('0x17')]);return _0x59dd6a(_0x348fb6[_0x1c7b('0x15')][_0x1c7b('0x17')]);}logger[_0x1c7b('0x15')](_0x1c7b('0x16'),_0x5888ca,_0x348fb6[_0x1c7b('0x15')][_0x1c7b('0x17')]);return _0x5cfc79(_0x348fb6[_0x1c7b('0x15')][_0x1c7b('0x17')]);}else{logger[_0x1c7b('0x10')](_0x1c7b('0x16'),_0x5888ca,_0x1c7b('0x11'));_0x5cfc79(_0x348fb6['result']['message']);}})[_0x1c7b('0x18')](function(_0x58a6ee){logger[_0x1c7b('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x5888ca,_0x58a6ee);_0x59dd6a(_0x58a6ee);});});}exports['GetVoiceQueueReport']=function(_0x37c4a0){var _0x4b7150=this;return new Promise(function(_0x6ea0c4,_0x21f788){return db[_0x1c7b('0x19')]['findAll']({'raw':_0x37c4a0[_0x1c7b('0x1a')]?_0x37c4a0[_0x1c7b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x37c4a0['options']?_0x37c4a0[_0x1c7b('0x1a')][_0x1c7b('0x1b')]||null:null,'attributes':_0x37c4a0['options']?_0x37c4a0[_0x1c7b('0x1a')][_0x1c7b('0x1c')]||null:null,'limit':_0x37c4a0[_0x1c7b('0x1a')]?_0x37c4a0[_0x1c7b('0x1a')][_0x1c7b('0x1d')]||null:null,'include':_0x37c4a0[_0x1c7b('0x1a')]?_0x37c4a0[_0x1c7b('0x1a')][_0x1c7b('0x1e')]?_[_0x1c7b('0x1f')](_0x37c4a0[_0x1c7b('0x1a')][_0x1c7b('0x1e')],function(_0x1f9211){return{'model':db[_0x1f9211[_0x1c7b('0x20')]],'as':_0x1f9211['as'],'attributes':_0x1f9211[_0x1c7b('0x1c')],'include':_0x1f9211['include']?_[_0x1c7b('0x1f')](_0x1f9211[_0x1c7b('0x1e')],function(_0x1f0903){return{'model':db[_0x1f0903[_0x1c7b('0x20')]],'as':_0x1f0903['as'],'attributes':_0x1f0903[_0x1c7b('0x1c')],'include':_0x1f0903[_0x1c7b('0x1e')]?_[_0x1c7b('0x1f')](_0x1f0903[_0x1c7b('0x1e')],function(_0x198303){return{'model':db[_0x198303[_0x1c7b('0x20')]],'as':_0x198303['as'],'attributes':_0x198303['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c7b('0xf')](function(_0x13c732){logger['info']('GetVoiceQueueReport',_0x37c4a0);logger['debug'](_0x1c7b('0x21'),_0x37c4a0,JSON[_0x1c7b('0x14')](_0x13c732));_0x6ea0c4(_0x13c732);})[_0x1c7b('0x18')](function(_0xe56fb8){logger[_0x1c7b('0x15')](_0x1c7b('0x21'),_0xe56fb8[_0x1c7b('0x17')],_0x37c4a0);_0x21f788(_0x4b7150[_0x1c7b('0x15')](0x1f4,_0xe56fb8[_0x1c7b('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x2cae1f){var _0x16f1bf=this;return new Promise(function(_0x24f8ed,_0x3dd7f0){return db[_0x1c7b('0x19')][_0x1c7b('0x22')](_0x2cae1f[_0x1c7b('0x23')],{'raw':_0x2cae1f[_0x1c7b('0x1a')]?_0x2cae1f[_0x1c7b('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x694147){logger[_0x1c7b('0x10')]('CreateVoiceQueueReport',_0x2cae1f);logger[_0x1c7b('0x12')](_0x1c7b('0x24'),_0x2cae1f,JSON['stringify'](_0x694147));_0x24f8ed(_0x694147);})[_0x1c7b('0x18')](function(_0x45a5a4){logger[_0x1c7b('0x15')](_0x1c7b('0x24'),_0x45a5a4[_0x1c7b('0x17')],_0x2cae1f);_0x3dd7f0(_0x16f1bf[_0x1c7b('0x15')](0x1f4,_0x45a5a4[_0x1c7b('0x17')]));});});};exports[_0x1c7b('0x25')]=function(_0x3a626f){var _0x9133b5=this;return new Promise(function(_0x424f3c,_0x639df5){return db[_0x1c7b('0x19')]['update'](_0x3a626f[_0x1c7b('0x23')],{'raw':_0x3a626f[_0x1c7b('0x1a')]?_0x3a626f[_0x1c7b('0x1a')][_0x1c7b('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a626f['options']?_0x3a626f[_0x1c7b('0x1a')][_0x1c7b('0x1b')]||null:null,'attributes':_0x3a626f[_0x1c7b('0x1a')]?_0x3a626f[_0x1c7b('0x1a')][_0x1c7b('0x1c')]||null:null,'limit':_0x3a626f[_0x1c7b('0x1a')]?_0x3a626f[_0x1c7b('0x1a')][_0x1c7b('0x1d')]||null:null})[_0x1c7b('0xf')](function(_0x4ff830){logger[_0x1c7b('0x10')](_0x1c7b('0x25'),_0x3a626f);logger['debug'](_0x1c7b('0x25'),_0x3a626f,JSON[_0x1c7b('0x14')](_0x4ff830));_0x424f3c(_0x4ff830);})[_0x1c7b('0x18')](function(_0x272af9){logger[_0x1c7b('0x15')]('UpdateVoiceQueueReport',_0x272af9[_0x1c7b('0x17')],_0x3a626f);_0x639df5(_0x9133b5[_0x1c7b('0x15')](0x1f4,_0x272af9[_0x1c7b('0x17')]));});});};
\ No newline at end of file
+var _0x0b7a=['../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','include','map','model','attributes','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','raw','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x57dacc,_0x4f7511){var _0xce9ecc=function(_0x26df7a){while(--_0x26df7a){_0x57dacc['push'](_0x57dacc['shift']());}};_0xce9ecc(++_0x4f7511);}(_0x0b7a,0x81));var _0xa0b7=function(_0x3612d9,_0x377ebb){_0x3612d9=_0x3612d9-0x0;var _0xe3f806=_0x0b7a[_0x3612d9];return _0xe3f806;};'use strict';var _=require(_0xa0b7('0x0'));var util=require(_0xa0b7('0x1'));var moment=require(_0xa0b7('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0b7('0x3'));var fs=require('fs');var Redis=require(_0xa0b7('0x4'));var db=require(_0xa0b7('0x5'))['db'];var utils=require(_0xa0b7('0x6'));var logger=require('../../config/logger')(_0xa0b7('0x7'));var config=require(_0xa0b7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa0b7('0x9')][_0xa0b7('0xa')]({'port':0x232a});config[_0xa0b7('0xb')]=_[_0xa0b7('0xc')](config['redis'],{'host':_0xa0b7('0xd'),'port':0x18eb});var socket=require(_0xa0b7('0xe'))(new Redis(config[_0xa0b7('0xb')]));require(_0xa0b7('0xf'))[_0xa0b7('0x10')](socket);function respondWithRpcPromise(_0x3d89dd,_0x3559db,_0x3dcaf6){return new BPromise(function(_0x3158f7,_0x1bf6bf){return client['request'](_0x3d89dd,_0x3dcaf6)[_0xa0b7('0x11')](function(_0x4f5d62){logger['info'](_0xa0b7('0x12'),_0x3559db,'request\x20sent');logger[_0xa0b7('0x13')](_0xa0b7('0x14'),_0x3559db,_0xa0b7('0x15'),JSON[_0xa0b7('0x16')](_0x4f5d62));if(_0x4f5d62[_0xa0b7('0x17')]){if(_0x4f5d62[_0xa0b7('0x17')][_0xa0b7('0x18')]===0x1f4){logger[_0xa0b7('0x17')](_0xa0b7('0x12'),_0x3559db,_0x4f5d62[_0xa0b7('0x17')]['message']);return _0x1bf6bf(_0x4f5d62[_0xa0b7('0x17')][_0xa0b7('0x19')]);}logger[_0xa0b7('0x17')](_0xa0b7('0x12'),_0x3559db,_0x4f5d62[_0xa0b7('0x17')][_0xa0b7('0x19')]);return _0x3158f7(_0x4f5d62['error'][_0xa0b7('0x19')]);}else{logger[_0xa0b7('0x1a')]('VoiceQueueReport,\x20%s,\x20%s',_0x3559db,'request\x20sent');_0x3158f7(_0x4f5d62[_0xa0b7('0x1b')]['message']);}})[_0xa0b7('0x1c')](function(_0x31193b){logger[_0xa0b7('0x17')](_0xa0b7('0x12'),_0x3559db,_0x31193b);_0x1bf6bf(_0x31193b);});});}exports[_0xa0b7('0x1d')]=function(_0x2ba57b){var _0x80a673=this;return new Promise(function(_0x15615b,_0x3e8b13){return db[_0xa0b7('0x1e')][_0xa0b7('0x1f')]({'raw':_0x2ba57b[_0xa0b7('0x20')]?_0x2ba57b[_0xa0b7('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2ba57b[_0xa0b7('0x20')]?_0x2ba57b[_0xa0b7('0x20')][_0xa0b7('0x21')]||null:null,'attributes':_0x2ba57b[_0xa0b7('0x20')]?_0x2ba57b[_0xa0b7('0x20')]['attributes']||null:null,'limit':_0x2ba57b[_0xa0b7('0x20')]?_0x2ba57b['options']['limit']||null:null,'include':_0x2ba57b[_0xa0b7('0x20')]?_0x2ba57b[_0xa0b7('0x20')][_0xa0b7('0x22')]?_[_0xa0b7('0x23')](_0x2ba57b[_0xa0b7('0x20')][_0xa0b7('0x22')],function(_0x332b6a){return{'model':db[_0x332b6a[_0xa0b7('0x24')]],'as':_0x332b6a['as'],'attributes':_0x332b6a['attributes'],'include':_0x332b6a[_0xa0b7('0x22')]?_['map'](_0x332b6a[_0xa0b7('0x22')],function(_0xb19c4b){return{'model':db[_0xb19c4b[_0xa0b7('0x24')]],'as':_0xb19c4b['as'],'attributes':_0xb19c4b[_0xa0b7('0x25')],'include':_0xb19c4b['include']?_['map'](_0xb19c4b['include'],function(_0x2bf1ae){return{'model':db[_0x2bf1ae[_0xa0b7('0x24')]],'as':_0x2bf1ae['as'],'attributes':_0x2bf1ae[_0xa0b7('0x25')]};}):[]};}):[]};}):[]:[]})[_0xa0b7('0x11')](function(_0x4fb315){logger[_0xa0b7('0x1a')](_0xa0b7('0x1d'),_0x2ba57b);logger[_0xa0b7('0x13')](_0xa0b7('0x1d'),_0x2ba57b,JSON['stringify'](_0x4fb315));_0x15615b(_0x4fb315);})['catch'](function(_0x429077){logger[_0xa0b7('0x17')](_0xa0b7('0x1d'),_0x429077['message'],_0x2ba57b);_0x3e8b13(_0x80a673['error'](0x1f4,_0x429077[_0xa0b7('0x19')]));});});};exports[_0xa0b7('0x26')]=function(_0x40507c){var _0x3e3331=this;return new Promise(function(_0x597b25,_0x36839b){return db[_0xa0b7('0x1e')][_0xa0b7('0x27')](_0x40507c['body'],{'raw':_0x40507c[_0xa0b7('0x20')]?_0x40507c[_0xa0b7('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xa0b7('0x11')](function(_0x44f797){logger[_0xa0b7('0x1a')](_0xa0b7('0x26'),_0x40507c);logger[_0xa0b7('0x13')](_0xa0b7('0x26'),_0x40507c,JSON[_0xa0b7('0x16')](_0x44f797));_0x597b25(_0x44f797);})[_0xa0b7('0x1c')](function(_0xa19770){logger[_0xa0b7('0x17')](_0xa0b7('0x26'),_0xa19770[_0xa0b7('0x19')],_0x40507c);_0x36839b(_0x3e3331['error'](0x1f4,_0xa19770[_0xa0b7('0x19')]));});});};exports[_0xa0b7('0x28')]=function(_0x38cc03){var _0x475426=this;return new Promise(function(_0x576c93,_0x4ca201){return db[_0xa0b7('0x1e')][_0xa0b7('0x29')](_0x38cc03[_0xa0b7('0x2a')],{'raw':_0x38cc03['options']?_0x38cc03[_0xa0b7('0x20')][_0xa0b7('0x2b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38cc03[_0xa0b7('0x20')]?_0x38cc03[_0xa0b7('0x20')][_0xa0b7('0x21')]||null:null,'attributes':_0x38cc03[_0xa0b7('0x20')]?_0x38cc03['options']['attributes']||null:null,'limit':_0x38cc03[_0xa0b7('0x20')]?_0x38cc03[_0xa0b7('0x20')][_0xa0b7('0x2c')]||null:null})[_0xa0b7('0x11')](function(_0x4dedff){logger['info'](_0xa0b7('0x28'),_0x38cc03);logger[_0xa0b7('0x13')]('UpdateVoiceQueueReport',_0x38cc03,JSON[_0xa0b7('0x16')](_0x4dedff));_0x576c93(_0x4dedff);})[_0xa0b7('0x1c')](function(_0x5c3553){logger['error'](_0xa0b7('0x28'),_0x5c3553['message'],_0x38cc03);_0x4ca201(_0x475426[_0xa0b7('0x17')](0x1f4,_0x5c3553['message']));});});};
\ No newline at end of file
index dbfa03f..a5f00c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc923=['remove','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x3e6196,_0x592010){var _0x5a9737=function(_0x5b228c){while(--_0x5b228c){_0x3e6196['push'](_0x3e6196['shift']());}};_0x5a9737(++_0x592010);}(_0xc923,0x1ef));var _0x3c92=function(_0x432f73,_0x440ed1){_0x432f73=_0x432f73-0x0;var _0x3fc272=_0xc923[_0x432f73];return _0x3fc272;};'use strict';var VoiceQueueReportEvents=require(_0x3c92('0x0'));var events=[_0x3c92('0x1'),_0x3c92('0x2'),'update'];function createListener(_0x5d86b7,_0x5c14de){return function(_0x570fcc){_0x5c14de['emit'](_0x5d86b7,_0x570fcc);};}function removeListener(_0x3fd700,_0x3b52a5){return function(){VoiceQueueReportEvents[_0x3c92('0x3')](_0x3fd700,_0x3b52a5);};}exports[_0x3c92('0x4')]=function(_0x3cb88c){for(var _0x1feb30=0x0,_0x381cbf=events[_0x3c92('0x5')];_0x1feb30<_0x381cbf;_0x1feb30++){var _0x1ad818=events[_0x1feb30];var _0x533633=createListener(_0x3c92('0x6')+_0x1ad818,_0x3cb88c);VoiceQueueReportEvents['on'](_0x1ad818,_0x533633);}};
\ No newline at end of file
+var _0x1cb9=['update','emit','removeListener','register','length','./voiceQueueReport.events','remove'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3d17d5,_0x2cdb4b){_0x3d17d5=_0x3d17d5-0x0;var _0x2f9bb6=_0x1cb9[_0x3d17d5];return _0x2f9bb6;};'use strict';var VoiceQueueReportEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceQueueReportEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceQueueReport:'+_0x4c1f56,_0x186dc3);VoiceQueueReportEvents['on'](_0x4c1f56,_0x15c517);}};
\ No newline at end of file
index 235c66c..3ed11d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa81a=['post','put','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa81a,0x1f1));var _0xaa81=function(_0x3da02f,_0x2dc4ca){_0x3da02f=_0x3da02f-0x0;var _0x5a29ca=_0xa81a[_0x3da02f];return _0x5a29ca;};'use strict';var multer=require(_0xaa81('0x0'));var util=require('util');var path=require(_0xaa81('0x1'));var timeout=require(_0xaa81('0x2'));var express=require(_0xaa81('0x3'));var router=express['Router']();var fs_extra=require(_0xaa81('0x4'));var auth=require(_0xaa81('0x5'));var interaction=require(_0xaa81('0x6'));var config=require('../../config/environment');var controller=require(_0xaa81('0x7'));router[_0xaa81('0x8')]('/',auth['isAuthenticated'](),controller[_0xaa81('0x9')]);router[_0xaa81('0x8')](_0xaa81('0xa'),auth[_0xaa81('0xb')](),controller[_0xaa81('0xc')]);router[_0xaa81('0xd')]('/',auth[_0xaa81('0xb')](),controller['create']);router[_0xaa81('0xe')]('/:id',auth[_0xaa81('0xb')](),controller['update']);router[_0xaa81('0xf')](_0xaa81('0xa'),auth[_0xaa81('0xb')](),controller[_0xaa81('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x4278=['show','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id'];(function(_0x2e3e94,_0x3d75cc){var _0x1deca2=function(_0x34d92a){while(--_0x34d92a){_0x2e3e94['push'](_0x2e3e94['shift']());}};_0x1deca2(++_0x3d75cc);}(_0x4278,0x18d));var _0x8427=function(_0x378a4f,_0x45aed6){_0x378a4f=_0x378a4f-0x0;var _0x2289cb=_0x4278[_0x378a4f];return _0x2289cb;};'use strict';var multer=require('multer');var util=require(_0x8427('0x0'));var path=require(_0x8427('0x1'));var timeout=require(_0x8427('0x2'));var express=require(_0x8427('0x3'));var router=express[_0x8427('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8427('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8427('0x6'));router[_0x8427('0x7')]('/',auth[_0x8427('0x8')](),controller[_0x8427('0x9')]);router['get'](_0x8427('0xa'),auth[_0x8427('0x8')](),controller[_0x8427('0xb')]);router['post']('/',auth[_0x8427('0x8')](),controller[_0x8427('0xc')]);router[_0x8427('0xd')](_0x8427('0xa'),auth[_0x8427('0x8')](),controller[_0x8427('0xe')]);router[_0x8427('0xf')](_0x8427('0xa'),auth[_0x8427('0x8')](),controller[_0x8427('0x10')]);module['exports']=router;
\ No newline at end of file
index 509f5ab..c2bedda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b94=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x12d1ac,_0x3faf76){var _0x5b8f0a=function(_0x11c5c2){while(--_0x11c5c2){_0x12d1ac['push'](_0x12d1ac['shift']());}};_0x5b8f0a(++_0x3faf76);}(_0x1b94,0x1f2));var _0x41b9=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x1b94[_0x4b73a2];return _0x383c66;};'use strict';var Sequelize=require(_0x41b9('0x0'));var moment=require(_0x41b9('0x1'));module[_0x41b9('0x2')]={'time':{'type':Sequelize[_0x41b9('0x3')]},'callid':{'type':Sequelize[_0x41b9('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x41b9('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x41b9('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x41b9('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x41b9('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x41b9('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x41b9('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x41b9('0x4')],'allowNull':![],'defaultValue':moment()[_0x41b9('0x5')](_0x41b9('0x6'))}};
\ No newline at end of file
+var _0x184e=['format','sequelize','moment','exports','STRING'];(function(_0x119c38,_0xd4b3aa){var _0x5ba417=function(_0x56a66b){while(--_0x56a66b){_0x119c38['push'](_0x119c38['shift']());}};_0x5ba417(++_0xd4b3aa);}(_0x184e,0x1a0));var _0xe184=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x184e[_0x2f3794];return _0x1c9fbe;};'use strict';var Sequelize=require(_0xe184('0x0'));var moment=require(_0xe184('0x1'));module[_0xe184('0x2')]={'time':{'type':Sequelize[_0xe184('0x3')]},'callid':{'type':Sequelize[_0xe184('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe184('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe184('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe184('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe184('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe184('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xe184('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xe184('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
index c5ed69d..ad97397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x707a=['util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x22690e,_0x4172ab){var _0x323906=function(_0x47d391){while(--_0x47d391){_0x22690e['push'](_0x22690e['shift']());}};_0x323906(++_0x4172ab);}(_0x707a,0xda));var _0xa707=function(_0x56c92f,_0x59f4a0){_0x56c92f=_0x56c92f-0x0;var _0x4c2745=_0x707a[_0x56c92f];return _0x4c2745;};'use strict';var emlformat=require(_0xa707('0x0'));var rimraf=require(_0xa707('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa707('0x2'));var rp=require(_0xa707('0x3'));var moment=require(_0xa707('0x4'));var BPromise=require(_0xa707('0x5'));var Mustache=require(_0xa707('0x6'));var util=require(_0xa707('0x7'));var path=require(_0xa707('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa707('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa707('0xa'));var squel=require(_0xa707('0xb'));var crypto=require(_0xa707('0xc'));var jsforce=require(_0xa707('0xd'));var deskjs=require(_0xa707('0xe'));var toCsv=require(_0xa707('0xf'));var querystring=require(_0xa707('0x10'));var Papa=require(_0xa707('0x11'));var Redis=require(_0xa707('0x12'));var authService=require(_0xa707('0x13'));var qs=require(_0xa707('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa707('0x15'));var logger=require(_0xa707('0x16'))(_0xa707('0x17'));var utils=require('../../config/utils');var config=require(_0xa707('0x18'));var licenseUtil=require(_0xa707('0x19'));var db=require(_0xa707('0x1a'))['db'];function respondWithStatusCode(_0xe448f7,_0x22728d){_0x22728d=_0x22728d||0xcc;return function(_0x21a6a9){if(_0x21a6a9){return _0xe448f7[_0xa707('0x1b')](_0x22728d);}return _0xe448f7[_0xa707('0x1c')](_0x22728d)['end']();};}function respondWithResult(_0x3cc51e,_0x2b56f1){_0x2b56f1=_0x2b56f1||0xc8;return function(_0x244f0c){if(_0x244f0c){return _0x3cc51e['status'](_0x2b56f1)[_0xa707('0x1d')](_0x244f0c);}};}function respondWithFilteredResult(_0x4e1da4,_0x12afa2){return function(_0x402779){if(_0x402779){var _0xc3ee8e=typeof _0x12afa2[_0xa707('0x1e')]===_0xa707('0x1f')&&typeof _0x12afa2[_0xa707('0x20')]===_0xa707('0x1f');var _0x319096=_0x402779[_0xa707('0x21')];var _0x53e131=_0xc3ee8e?0x0:_0x12afa2[_0xa707('0x1e')];var _0x35fc6c=_0xc3ee8e?_0x402779[_0xa707('0x21')]:_0x12afa2[_0xa707('0x1e')]+_0x12afa2['limit'];var _0x37abec;if(_0x35fc6c>=_0x319096){_0x35fc6c=_0x319096;_0x37abec=0xc8;}else{_0x37abec=0xce;}_0x4e1da4['status'](_0x37abec);return _0x4e1da4[_0xa707('0x22')](_0xa707('0x23'),_0x53e131+'-'+_0x35fc6c+'/'+_0x319096)['json'](_0x402779);}return null;};}function patchUpdates(_0x5c8504){return function(_0x3cbdf1){try{jsonpatch['apply'](_0x3cbdf1,_0x5c8504,!![]);}catch(_0x57c45a){return BPromise['reject'](_0x57c45a);}return _0x3cbdf1[_0xa707('0x24')]();};}function saveUpdates(_0x20518b,_0xe731d){return function(_0x4c18e9){if(_0x4c18e9){return _0x4c18e9[_0xa707('0x25')](_0x20518b)['then'](function(_0x5ae0f4){return _0x5ae0f4;});}return null;};}function removeEntity(_0x1f0964,_0x18b4d1){return function(_0x5eed16){if(_0x5eed16){return _0x5eed16[_0xa707('0x26')]()[_0xa707('0x27')](function(){_0x1f0964['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d6ae3,_0x5675c9){return function(_0x36b556){if(!_0x36b556){_0x5d6ae3['sendStatus'](0x194);}return _0x36b556;};}function handleError(_0x4fb760,_0x37e7ea){_0x37e7ea=_0x37e7ea||0x1f4;return function(_0x29059f){logger[_0xa707('0x28')](_0x29059f[_0xa707('0x29')]);if(_0x29059f[_0xa707('0x2a')]){delete _0x29059f[_0xa707('0x2a')];}_0x4fb760[_0xa707('0x1c')](_0x37e7ea)[_0xa707('0x2b')](_0x29059f);};}exports[_0xa707('0x2c')]=function(_0x456f82,_0x1e4107){var _0x821a2={},_0x1009b9={},_0x615ad0={'count':0x0,'rows':[]};var _0xf19ee1=_[_0xa707('0x2d')](db[_0xa707('0x2e')][_0xa707('0x2f')],function(_0x53d46f){return{'name':_0x53d46f['fieldName'],'type':_0x53d46f[_0xa707('0x30')]['key']};});_0x1009b9[_0xa707('0x31')]=_['map'](_0xf19ee1,_0xa707('0x2a'));_0x1009b9[_0xa707('0x32')]=_[_0xa707('0x33')](_0x456f82[_0xa707('0x32')]);_0x1009b9[_0xa707('0x34')]=_[_0xa707('0x35')](_0x1009b9[_0xa707('0x31')],_0x1009b9['query']);_0x821a2[_0xa707('0x36')]=_[_0xa707('0x35')](_0x1009b9[_0xa707('0x31')],qs[_0xa707('0x37')](_0x456f82['query']['fields']));_0x821a2[_0xa707('0x36')]=_0x821a2['attributes'][_0xa707('0x38')]?_0x821a2[_0xa707('0x36')]:_0x1009b9[_0xa707('0x31')];if(!_0x456f82[_0xa707('0x32')]['hasOwnProperty'](_0xa707('0x39'))){_0x821a2[_0xa707('0x20')]=qs['limit'](_0x456f82['query'][_0xa707('0x20')]);_0x821a2[_0xa707('0x1e')]=qs['offset'](_0x456f82[_0xa707('0x32')][_0xa707('0x1e')]);}_0x821a2[_0xa707('0x3a')]=qs[_0xa707('0x3b')](_0x456f82[_0xa707('0x32')][_0xa707('0x3b')]);_0x821a2[_0xa707('0x3c')]=qs['filters'](_[_0xa707('0x3d')](_0x456f82[_0xa707('0x32')],_0x1009b9['filters']),_0xf19ee1);if(_0x456f82[_0xa707('0x32')]['filter']){_0x821a2[_0xa707('0x3c')]=_[_0xa707('0x3e')](_0x821a2[_0xa707('0x3c')],{'$or':_[_0xa707('0x2d')](_0xf19ee1,function(_0x183d71){if(_0x183d71[_0xa707('0x30')]!==_0xa707('0x3f')){var _0x2c2c07={};_0x2c2c07[_0x183d71[_0xa707('0x2a')]]={'$like':'%'+_0x456f82[_0xa707('0x32')][_0xa707('0x40')]+'%'};return _0x2c2c07;}})});}_0x821a2=_['merge']({},_0x821a2,_0x456f82[_0xa707('0x41')]);var _0x52b4c8={'where':_0x821a2[_0xa707('0x3c')]};return db[_0xa707('0x2e')]['count'](_0x52b4c8)['then'](function(_0x1f96a1){_0x615ad0[_0xa707('0x21')]=_0x1f96a1;if(_0x456f82['query'][_0xa707('0x42')]){_0x821a2[_0xa707('0x43')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xa707('0x44')](_0x821a2);})[_0xa707('0x27')](function(_0x17b1be){_0x615ad0[_0xa707('0x45')]=_0x17b1be;return _0x615ad0;})[_0xa707('0x27')](respondWithFilteredResult(_0x1e4107,_0x821a2))[_0xa707('0x46')](handleError(_0x1e4107,null));};exports['show']=function(_0x48153d,_0x2252a5){var _0x442aa6={'raw':!![],'where':{'id':_0x48153d[_0xa707('0x47')]['id']}},_0x408286={};_0x408286[_0xa707('0x31')]=_[_0xa707('0x33')](db[_0xa707('0x2e')]['rawAttributes']);_0x408286[_0xa707('0x32')]=_['keys'](_0x48153d[_0xa707('0x32')]);_0x408286[_0xa707('0x34')]=_[_0xa707('0x35')](_0x408286[_0xa707('0x31')],_0x408286[_0xa707('0x32')]);_0x442aa6[_0xa707('0x36')]=_['intersection'](_0x408286[_0xa707('0x31')],qs['fields'](_0x48153d[_0xa707('0x32')][_0xa707('0x37')]));_0x442aa6[_0xa707('0x36')]=_0x442aa6[_0xa707('0x36')]['length']?_0x442aa6[_0xa707('0x36')]:_0x408286['model'];if(_0x48153d[_0xa707('0x32')]['includeAll']){_0x442aa6[_0xa707('0x43')]=[{'all':!![]}];}_0x442aa6=_[_0xa707('0x3e')]({},_0x442aa6,_0x48153d[_0xa707('0x41')]);return db[_0xa707('0x2e')][_0xa707('0x48')](_0x442aa6)['then'](handleEntityNotFound(_0x2252a5,null))['then'](respondWithResult(_0x2252a5,null))[_0xa707('0x46')](handleError(_0x2252a5,null));};exports[_0xa707('0x49')]=function(_0x5747f5,_0x1a3f90){return db['VoiceQueuesLog'][_0xa707('0x49')](_0x5747f5['body'],{})['then'](respondWithResult(_0x1a3f90,0xc9))['catch'](handleError(_0x1a3f90,null));};exports['update']=function(_0x47cf00,_0x344390){if(_0x47cf00[_0xa707('0x4a')]['id']){delete _0x47cf00[_0xa707('0x4a')]['id'];}return db[_0xa707('0x2e')][_0xa707('0x48')]({'where':{'id':_0x47cf00['params']['id']}})['then'](handleEntityNotFound(_0x344390,null))[_0xa707('0x27')](saveUpdates(_0x47cf00[_0xa707('0x4a')],null))[_0xa707('0x27')](respondWithResult(_0x344390,null))[_0xa707('0x46')](handleError(_0x344390,null));};exports[_0xa707('0x26')]=function(_0x26f2ac,_0x329090){return db[_0xa707('0x2e')][_0xa707('0x48')]({'where':{'id':_0x26f2ac['params']['id']}})['then'](handleEntityNotFound(_0x329090,null))[_0xa707('0x27')](removeEntity(_0x329090,null))[_0xa707('0x46')](handleError(_0x329090,null));};
\ No newline at end of file
+var _0xbde4=['limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','filters','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined'];(function(_0x38e202,_0x1fcf51){var _0x2bb32d=function(_0x488a85){while(--_0x488a85){_0x38e202['push'](_0x38e202['shift']());}};_0x2bb32d(++_0x1fcf51);}(_0xbde4,0x18a));var _0x4bde=function(_0x54340b,_0x439f0a){_0x54340b=_0x54340b-0x0;var _0x496ea4=_0xbde4[_0x54340b];return _0x496ea4;};'use strict';var emlformat=require(_0x4bde('0x0'));var rimraf=require(_0x4bde('0x1'));var zipdir=require(_0x4bde('0x2'));var jsonpatch=require(_0x4bde('0x3'));var rp=require(_0x4bde('0x4'));var moment=require(_0x4bde('0x5'));var BPromise=require(_0x4bde('0x6'));var Mustache=require(_0x4bde('0x7'));var util=require(_0x4bde('0x8'));var path=require(_0x4bde('0x9'));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(_0x4bde('0xa'));var squel=require(_0x4bde('0xb'));var crypto=require(_0x4bde('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4bde('0xd'));var querystring=require(_0x4bde('0xe'));var Papa=require(_0x4bde('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4bde('0x10'));var as=require(_0x4bde('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4bde('0x12'))('api');var utils=require(_0x4bde('0x13'));var config=require(_0x4bde('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4bde('0x15'))['db'];function respondWithStatusCode(_0x43b4ed,_0x2afa67){_0x2afa67=_0x2afa67||0xcc;return function(_0x2acad9){if(_0x2acad9){return _0x43b4ed['sendStatus'](_0x2afa67);}return _0x43b4ed[_0x4bde('0x16')](_0x2afa67)[_0x4bde('0x17')]();};}function respondWithResult(_0x5d8081,_0x329e2d){_0x329e2d=_0x329e2d||0xc8;return function(_0x1fa493){if(_0x1fa493){return _0x5d8081[_0x4bde('0x16')](_0x329e2d)['json'](_0x1fa493);}};}function respondWithFilteredResult(_0x41c043,_0x2c04b8){return function(_0x245718){if(_0x245718){var _0x1b6c80=typeof _0x2c04b8[_0x4bde('0x18')]===_0x4bde('0x19')&&typeof _0x2c04b8[_0x4bde('0x1a')]===_0x4bde('0x19');var _0x5f1029=_0x245718['count'];var _0x33e4d4=_0x1b6c80?0x0:_0x2c04b8['offset'];var _0x4712f3=_0x1b6c80?_0x245718[_0x4bde('0x1b')]:_0x2c04b8[_0x4bde('0x18')]+_0x2c04b8[_0x4bde('0x1a')];var _0x502833;if(_0x4712f3>=_0x5f1029){_0x4712f3=_0x5f1029;_0x502833=0xc8;}else{_0x502833=0xce;}_0x41c043[_0x4bde('0x16')](_0x502833);return _0x41c043[_0x4bde('0x1c')](_0x4bde('0x1d'),_0x33e4d4+'-'+_0x4712f3+'/'+_0x5f1029)['json'](_0x245718);}return null;};}function patchUpdates(_0x20e1bb){return function(_0x92848d){try{jsonpatch[_0x4bde('0x1e')](_0x92848d,_0x20e1bb,!![]);}catch(_0x30ef4e){return BPromise[_0x4bde('0x1f')](_0x30ef4e);}return _0x92848d[_0x4bde('0x20')]();};}function saveUpdates(_0x3e3f18,_0x3ca6f9){return function(_0x46f31f){if(_0x46f31f){return _0x46f31f[_0x4bde('0x21')](_0x3e3f18)[_0x4bde('0x22')](function(_0x709469){return _0x709469;});}return null;};}function removeEntity(_0x2dd52c,_0x19e015){return function(_0x3bcc61){if(_0x3bcc61){return _0x3bcc61['destroy']()[_0x4bde('0x22')](function(){_0x2dd52c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412ef7,_0x4723f6){return function(_0x4c719f){if(!_0x4c719f){_0x412ef7['sendStatus'](0x194);}return _0x4c719f;};}function handleError(_0x2cb759,_0x1cd17d){_0x1cd17d=_0x1cd17d||0x1f4;return function(_0x43a5e1){logger[_0x4bde('0x23')](_0x43a5e1[_0x4bde('0x24')]);if(_0x43a5e1['name']){delete _0x43a5e1[_0x4bde('0x25')];}_0x2cb759[_0x4bde('0x16')](_0x1cd17d)['send'](_0x43a5e1);};}exports['index']=function(_0x29060c,_0x5607a1){var _0x5d1bd1={},_0x3148db={},_0x4578f6={'count':0x0,'rows':[]};var _0x3e80da=_[_0x4bde('0x26')](db[_0x4bde('0x27')]['rawAttributes'],function(_0x2b8fd1){return{'name':_0x2b8fd1[_0x4bde('0x28')],'type':_0x2b8fd1[_0x4bde('0x29')][_0x4bde('0x2a')]};});_0x3148db[_0x4bde('0x2b')]=_[_0x4bde('0x26')](_0x3e80da,_0x4bde('0x25'));_0x3148db[_0x4bde('0x2c')]=_[_0x4bde('0x2d')](_0x29060c[_0x4bde('0x2c')]);_0x3148db['filters']=_[_0x4bde('0x2e')](_0x3148db[_0x4bde('0x2b')],_0x3148db[_0x4bde('0x2c')]);_0x5d1bd1[_0x4bde('0x2f')]=_[_0x4bde('0x2e')](_0x3148db[_0x4bde('0x2b')],qs[_0x4bde('0x30')](_0x29060c[_0x4bde('0x2c')][_0x4bde('0x30')]));_0x5d1bd1['attributes']=_0x5d1bd1[_0x4bde('0x2f')][_0x4bde('0x31')]?_0x5d1bd1[_0x4bde('0x2f')]:_0x3148db[_0x4bde('0x2b')];if(!_0x29060c[_0x4bde('0x2c')][_0x4bde('0x32')](_0x4bde('0x33'))){_0x5d1bd1[_0x4bde('0x1a')]=qs['limit'](_0x29060c['query'][_0x4bde('0x1a')]);_0x5d1bd1[_0x4bde('0x18')]=qs[_0x4bde('0x18')](_0x29060c['query'][_0x4bde('0x18')]);}_0x5d1bd1['order']=qs[_0x4bde('0x34')](_0x29060c['query'][_0x4bde('0x34')]);_0x5d1bd1[_0x4bde('0x35')]=qs['filters'](_[_0x4bde('0x36')](_0x29060c[_0x4bde('0x2c')],_0x3148db['filters']),_0x3e80da);if(_0x29060c['query']['filter']){_0x5d1bd1[_0x4bde('0x35')]=_['merge'](_0x5d1bd1[_0x4bde('0x35')],{'$or':_[_0x4bde('0x26')](_0x3e80da,function(_0x578252){if(_0x578252[_0x4bde('0x29')]!==_0x4bde('0x37')){var _0x22feaa={};_0x22feaa[_0x578252[_0x4bde('0x25')]]={'$like':'%'+_0x29060c[_0x4bde('0x2c')][_0x4bde('0x38')]+'%'};return _0x22feaa;}})});}_0x5d1bd1=_[_0x4bde('0x39')]({},_0x5d1bd1,_0x29060c[_0x4bde('0x3a')]);var _0x31249b={'where':_0x5d1bd1['where']};return db['VoiceQueuesLog'][_0x4bde('0x1b')](_0x31249b)[_0x4bde('0x22')](function(_0xcfeb11){_0x4578f6['count']=_0xcfeb11;if(_0x29060c[_0x4bde('0x2c')][_0x4bde('0x3b')]){_0x5d1bd1['include']=[{'all':!![]}];}return db[_0x4bde('0x27')][_0x4bde('0x3c')](_0x5d1bd1);})[_0x4bde('0x22')](function(_0xcf94ca){_0x4578f6['rows']=_0xcf94ca;return _0x4578f6;})[_0x4bde('0x22')](respondWithFilteredResult(_0x5607a1,_0x5d1bd1))[_0x4bde('0x3d')](handleError(_0x5607a1,null));};exports[_0x4bde('0x3e')]=function(_0x246ae9,_0x1a5665){var _0xa27fd8={'raw':!![],'where':{'id':_0x246ae9[_0x4bde('0x3f')]['id']}},_0x2d380f={};_0x2d380f[_0x4bde('0x2b')]=_['keys'](db[_0x4bde('0x27')]['rawAttributes']);_0x2d380f[_0x4bde('0x2c')]=_[_0x4bde('0x2d')](_0x246ae9['query']);_0x2d380f[_0x4bde('0x40')]=_[_0x4bde('0x2e')](_0x2d380f[_0x4bde('0x2b')],_0x2d380f[_0x4bde('0x2c')]);_0xa27fd8['attributes']=_['intersection'](_0x2d380f[_0x4bde('0x2b')],qs['fields'](_0x246ae9[_0x4bde('0x2c')][_0x4bde('0x30')]));_0xa27fd8[_0x4bde('0x2f')]=_0xa27fd8[_0x4bde('0x2f')][_0x4bde('0x31')]?_0xa27fd8[_0x4bde('0x2f')]:_0x2d380f[_0x4bde('0x2b')];if(_0x246ae9[_0x4bde('0x2c')][_0x4bde('0x3b')]){_0xa27fd8[_0x4bde('0x41')]=[{'all':!![]}];}_0xa27fd8=_[_0x4bde('0x39')]({},_0xa27fd8,_0x246ae9[_0x4bde('0x3a')]);return db[_0x4bde('0x27')][_0x4bde('0x42')](_0xa27fd8)[_0x4bde('0x22')](handleEntityNotFound(_0x1a5665,null))[_0x4bde('0x22')](respondWithResult(_0x1a5665,null))['catch'](handleError(_0x1a5665,null));};exports[_0x4bde('0x43')]=function(_0x13f39f,_0x4f618f){return db[_0x4bde('0x27')][_0x4bde('0x43')](_0x13f39f[_0x4bde('0x44')],{})[_0x4bde('0x22')](respondWithResult(_0x4f618f,0xc9))[_0x4bde('0x3d')](handleError(_0x4f618f,null));};exports[_0x4bde('0x21')]=function(_0x1a193b,_0x3e8f86){if(_0x1a193b[_0x4bde('0x44')]['id']){delete _0x1a193b[_0x4bde('0x44')]['id'];}return db[_0x4bde('0x27')][_0x4bde('0x42')]({'where':{'id':_0x1a193b[_0x4bde('0x3f')]['id']}})[_0x4bde('0x22')](handleEntityNotFound(_0x3e8f86,null))[_0x4bde('0x22')](saveUpdates(_0x1a193b[_0x4bde('0x44')],null))[_0x4bde('0x22')](respondWithResult(_0x3e8f86,null))[_0x4bde('0x3d')](handleError(_0x3e8f86,null));};exports[_0x4bde('0x45')]=function(_0x18ab20,_0x424998){return db[_0x4bde('0x27')]['find']({'where':{'id':_0x18ab20[_0x4bde('0x3f')]['id']}})['then'](handleEntityNotFound(_0x424998,null))[_0x4bde('0x22')](removeEntity(_0x424998,null))[_0x4bde('0x3d')](handleError(_0x424998,null));};
\ No newline at end of file
index fe045c3..b630db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55f2=['../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','rimraf'];(function(_0x49708a,_0x580b45){var _0x5e0927=function(_0x499f87){while(--_0x499f87){_0x49708a['push'](_0x49708a['shift']());}};_0x5e0927(++_0x580b45);}(_0x55f2,0x117));var _0x255f=function(_0x559e2a,_0x4136dd){_0x559e2a=_0x559e2a-0x0;var _0x208401=_0x55f2[_0x559e2a];return _0x208401;};'use strict';var _=require(_0x255f('0x0'));var util=require(_0x255f('0x1'));var logger=require(_0x255f('0x2'))(_0x255f('0x3'));var moment=require(_0x255f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x255f('0x5'));var config=require(_0x255f('0x6'));var attributes=require(_0x255f('0x7'));module[_0x255f('0x8')]=function(_0x297627,_0x141d43){return _0x297627[_0x255f('0x9')](_0x255f('0xa'),attributes,{'tableName':_0x255f('0xb'),'paranoid':![],'indexes':[{'name':_0x255f('0xc'),'fields':[_0x255f('0xd'),_0x255f('0xe')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x66d9=['rimraf','define','VoiceQueuesLog','event_dtm','event','lodash','util','../../config/logger','api','moment','path'];(function(_0x3b33eb,_0x535569){var _0x207836=function(_0x255406){while(--_0x255406){_0x3b33eb['push'](_0x3b33eb['shift']());}};_0x207836(++_0x535569);}(_0x66d9,0x1e9));var _0x966d=function(_0x155ac2,_0x134492){_0x155ac2=_0x155ac2-0x0;var _0x4cbb9b=_0x66d9[_0x155ac2];return _0x4cbb9b;};'use strict';var _=require(_0x966d('0x0'));var util=require(_0x966d('0x1'));var logger=require(_0x966d('0x2'))(_0x966d('0x3'));var moment=require(_0x966d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x966d('0x5'));var rimraf=require(_0x966d('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x11538a,_0x1aa2b7){return _0x11538a[_0x966d('0x7')](_0x966d('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x966d('0x9'),'fields':[_0x966d('0xa'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
index c69ad05..e6f472a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0187=['code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5039c9,_0x3e289a){var _0x41d993=function(_0x3ec88a){while(--_0x3ec88a){_0x5039c9['push'](_0x5039c9['shift']());}};_0x41d993(++_0x3e289a);}(_0x0187,0x158));var _0x7018=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x0187[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x7018('0x0'));var util=require(_0x7018('0x1'));var moment=require(_0x7018('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7018('0x3'))['db'];var utils=require(_0x7018('0x4'));var logger=require(_0x7018('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7018('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xadb814,_0x4162f7,_0x14f0f1){return new BPromise(function(_0x323113,_0x47c06d){return client[_0x7018('0x7')](_0xadb814,_0x14f0f1)[_0x7018('0x8')](function(_0x4d1da2){logger[_0x7018('0x9')](_0x7018('0xa'),_0x4162f7,_0x7018('0xb'));logger[_0x7018('0xc')](_0x7018('0xd'),_0x4162f7,_0x7018('0xb'),JSON[_0x7018('0xe')](_0x4d1da2));if(_0x4d1da2[_0x7018('0xf')]){if(_0x4d1da2[_0x7018('0xf')][_0x7018('0x10')]===0x1f4){logger[_0x7018('0xf')](_0x7018('0xa'),_0x4162f7,_0x4d1da2[_0x7018('0xf')][_0x7018('0x11')]);return _0x47c06d(_0x4d1da2['error'][_0x7018('0x11')]);}logger['error'](_0x7018('0xa'),_0x4162f7,_0x4d1da2[_0x7018('0xf')][_0x7018('0x11')]);return _0x323113(_0x4d1da2[_0x7018('0xf')][_0x7018('0x11')]);}else{logger[_0x7018('0x9')](_0x7018('0xa'),_0x4162f7,'request\x20sent');_0x323113(_0x4d1da2[_0x7018('0x12')][_0x7018('0x11')]);}})[_0x7018('0x13')](function(_0xf623c9){logger['error'](_0x7018('0xa'),_0x4162f7,_0xf623c9);_0x47c06d(_0xf623c9);});});}
\ No newline at end of file
+var _0x1e00=['randomstring','ioredis','../../config/logger','rpc','client','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','moment'];(function(_0x5b21a2,_0x2c6461){var _0x57166b=function(_0x2c0c1a){while(--_0x2c0c1a){_0x5b21a2['push'](_0x5b21a2['shift']());}};_0x57166b(++_0x2c6461);}(_0x1e00,0x1df));var _0x01e0=function(_0x592c18,_0x3993ff){_0x592c18=_0x592c18-0x0;var _0x3d3510=_0x1e00[_0x592c18];return _0x3d3510;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x01e0('0x0'));var BPromise=require('bluebird');var rs=require(_0x01e0('0x1'));var fs=require('fs');var Redis=require(_0x01e0('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x01e0('0x3'))(_0x01e0('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x01e0('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5456cc,_0x2781fe,_0x31b1d6){return new BPromise(function(_0x2cebf5,_0x54366e){return client[_0x01e0('0x6')](_0x5456cc,_0x31b1d6)['then'](function(_0x16f432){logger[_0x01e0('0x7')](_0x01e0('0x8'),_0x2781fe,_0x01e0('0x9'));logger[_0x01e0('0xa')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x2781fe,_0x01e0('0x9'),JSON[_0x01e0('0xb')](_0x16f432));if(_0x16f432[_0x01e0('0xc')]){if(_0x16f432['error']['code']===0x1f4){logger[_0x01e0('0xc')](_0x01e0('0x8'),_0x2781fe,_0x16f432['error'][_0x01e0('0xd')]);return _0x54366e(_0x16f432[_0x01e0('0xc')][_0x01e0('0xd')]);}logger[_0x01e0('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2781fe,_0x16f432[_0x01e0('0xc')]['message']);return _0x2cebf5(_0x16f432[_0x01e0('0xc')][_0x01e0('0xd')]);}else{logger[_0x01e0('0x7')](_0x01e0('0x8'),_0x2781fe,_0x01e0('0x9'));_0x2cebf5(_0x16f432[_0x01e0('0xe')][_0x01e0('0xd')]);}})['catch'](function(_0xfcab){logger[_0x01e0('0xc')](_0x01e0('0x8'),_0x2781fe,_0xfcab);_0x54366e(_0xfcab);});});}
\ No newline at end of file
index b1e05a9..1dae327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69ec=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','update','delete','destroy','exports','multer'];(function(_0x1fe065,_0x45e0d3){var _0x4dccab=function(_0x271935){while(--_0x271935){_0x1fe065['push'](_0x1fe065['shift']());}};_0x4dccab(++_0x45e0d3);}(_0x69ec,0x1df));var _0xc69e=function(_0x9c5247,_0x187a01){_0x9c5247=_0x9c5247-0x0;var _0x1dc166=_0x69ec[_0x9c5247];return _0x1dc166;};'use strict';var multer=require(_0xc69e('0x0'));var util=require(_0xc69e('0x1'));var path=require('path');var timeout=require(_0xc69e('0x2'));var express=require(_0xc69e('0x3'));var router=express[_0xc69e('0x4')]();var fs_extra=require(_0xc69e('0x5'));var auth=require(_0xc69e('0x6'));var interaction=require(_0xc69e('0x7'));var config=require('../../config/environment');var controller=require(_0xc69e('0x8'));router['get']('/',auth[_0xc69e('0x9')](),controller[_0xc69e('0xa')]);router['get'](_0xc69e('0xb'),auth[_0xc69e('0x9')](),controller[_0xc69e('0xc')]);router[_0xc69e('0xd')](_0xc69e('0xe'),auth[_0xc69e('0x9')](),controller[_0xc69e('0xf')]);router['get'](_0xc69e('0x10'),auth[_0xc69e('0x9')](),controller[_0xc69e('0x11')]);router[_0xc69e('0xd')](_0xc69e('0x12'),controller[_0xc69e('0x13')]);router[_0xc69e('0xd')](_0xc69e('0x14'),auth[_0xc69e('0x9')](),controller[_0xc69e('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc69e('0x16')]);router[_0xc69e('0x17')](_0xc69e('0x14'),auth['isAuthenticated'](),controller[_0xc69e('0x18')]);router[_0xc69e('0x19')]('/:id',auth[_0xc69e('0x9')](),controller[_0xc69e('0x1a')]);router[_0xc69e('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xc69e('0x1c')]);module[_0xc69e('0x1d')]=router;
\ No newline at end of file
+var _0x7129=['destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','put','update','delete'];(function(_0x2e12f5,_0x93d1f3){var _0x34370a=function(_0x3999d5){while(--_0x3999d5){_0x2e12f5['push'](_0x2e12f5['shift']());}};_0x34370a(++_0x93d1f3);}(_0x7129,0x65));var _0x9712=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7129[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x9712('0x0'));var util=require(_0x9712('0x1'));var path=require(_0x9712('0x2'));var timeout=require('connect-timeout');var express=require(_0x9712('0x3'));var router=express[_0x9712('0x4')]();var fs_extra=require(_0x9712('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9712('0x6'));var config=require(_0x9712('0x7'));var controller=require('./voiceRecording.controller');router[_0x9712('0x8')]('/',auth[_0x9712('0x9')](),controller[_0x9712('0xa')]);router[_0x9712('0x8')](_0x9712('0xb'),auth[_0x9712('0x9')](),controller[_0x9712('0xc')]);router[_0x9712('0x8')](_0x9712('0xd'),auth['isAuthenticated'](),controller[_0x9712('0xe')]);router[_0x9712('0x8')](_0x9712('0xf'),auth[_0x9712('0x9')](),controller['download']);router[_0x9712('0x8')](_0x9712('0x10'),controller[_0x9712('0x11')]);router['get'](_0x9712('0x12'),auth[_0x9712('0x9')](),controller[_0x9712('0x13')]);router[_0x9712('0x14')]('/',auth[_0x9712('0x9')](),controller['create']);router[_0x9712('0x14')](_0x9712('0x12'),auth[_0x9712('0x9')](),controller['runTranscribe']);router[_0x9712('0x15')](_0x9712('0xd'),auth[_0x9712('0x9')](),controller[_0x9712('0x16')]);router[_0x9712('0x17')](_0x9712('0xd'),auth[_0x9712('0x9')](),controller[_0x9712('0x18')]);module['exports']=router;
\ No newline at end of file
index 1463c93..37c95a7 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(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 17efdbc..6ea342c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b32=['startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','../../components/encryptor','Voice\x20Recording\x20not\x20found','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','save','update','then','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','download','uniqueid','value','%s.cypher','decryptFile','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','secrets','recording','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','listBuckets','createBucket','upload','TranscribeService'];(function(_0x1e7345,_0x18bcce){var _0x33017c=function(_0x2b274f){while(--_0x2b274f){_0x1e7345['push'](_0x1e7345['shift']());}};_0x33017c(++_0x18bcce);}(_0x4b32,0xbf));var _0x24b3=function(_0x5c66cd,_0x5a9ade){_0x5c66cd=_0x5c66cd-0x0;var _0x48d48d=_0x4b32[_0x5c66cd];return _0x48d48d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24b3('0x0'));var zipdir=require(_0x24b3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24b3('0x2'));var moment=require(_0x24b3('0x3'));var BPromise=require(_0x24b3('0x4'));var Mustache=require(_0x24b3('0x5'));var util=require(_0x24b3('0x6'));var path=require(_0x24b3('0x7'));var sox=require(_0x24b3('0x8'));var csv=require(_0x24b3('0x9'));var ejs=require(_0x24b3('0xa'));var fs=require('fs');var fs_extra=require(_0x24b3('0xb'));var _=require(_0x24b3('0xc'));var squel=require(_0x24b3('0xd'));var crypto=require('crypto');var jsforce=require(_0x24b3('0xe'));var deskjs=require(_0x24b3('0xf'));var toCsv=require(_0x24b3('0x9'));var querystring=require(_0x24b3('0x10'));var Papa=require('papaparse');var AWS=require(_0x24b3('0x11'));var uuidv4=require(_0x24b3('0x12'));var Redis=require(_0x24b3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x24b3('0x14'));var as=require(_0x24b3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24b3('0x16'))(_0x24b3('0x17'));var utils=require(_0x24b3('0x18'));var config=require(_0x24b3('0x19'));var licenseUtil=require(_0x24b3('0x1a'));var db=require(_0x24b3('0x1b'))['db'];function respondWithStatusCode(_0x90203d,_0x33d94c){_0x33d94c=_0x33d94c||0xcc;return function(_0x5c7915){if(_0x5c7915){return _0x90203d['sendStatus'](_0x33d94c);}return _0x90203d[_0x24b3('0x1c')](_0x33d94c)[_0x24b3('0x1d')]();};}function respondWithResult(_0x227514,_0x152a27){_0x152a27=_0x152a27||0xc8;return function(_0x44dd3c){if(_0x44dd3c){return _0x227514[_0x24b3('0x1c')](_0x152a27)[_0x24b3('0x1e')](_0x44dd3c);}};}function respondWithFilteredResult(_0x247a17,_0x546b93){return function(_0x5cb28a){if(_0x5cb28a){var _0x2a510f=typeof _0x546b93[_0x24b3('0x1f')]===_0x24b3('0x20')&&typeof _0x546b93[_0x24b3('0x21')]===_0x24b3('0x20');var _0x4ece8c=_0x5cb28a[_0x24b3('0x22')];var _0x325b0c=_0x2a510f?0x0:_0x546b93[_0x24b3('0x1f')];var _0x1b6bed=_0x2a510f?_0x5cb28a[_0x24b3('0x22')]:_0x546b93[_0x24b3('0x1f')]+_0x546b93[_0x24b3('0x21')];var _0x15bac0;if(_0x1b6bed>=_0x4ece8c){_0x1b6bed=_0x4ece8c;_0x15bac0=0xc8;}else{_0x15bac0=0xce;}_0x247a17[_0x24b3('0x1c')](_0x15bac0);return _0x247a17['set']('Content-Range',_0x325b0c+'-'+_0x1b6bed+'/'+_0x4ece8c)[_0x24b3('0x1e')](_0x5cb28a);}return null;};}function patchUpdates(_0x3db7a8){return function(_0x2e9352){try{jsonpatch['apply'](_0x2e9352,_0x3db7a8,!![]);}catch(_0xb85958){return BPromise[_0x24b3('0x23')](_0xb85958);}return _0x2e9352[_0x24b3('0x24')]();};}function saveUpdates(_0xad28b9,_0x3a44f3){return function(_0x21bbdc){if(_0x21bbdc){return _0x21bbdc[_0x24b3('0x25')](_0xad28b9)['then'](function(_0x248979){return _0x248979;});}return null;};}function removeEntity(_0x2f9a24,_0xbefd27){return function(_0x33f288){if(_0x33f288){return _0x33f288['destroy']()[_0x24b3('0x26')](function(){_0x2f9a24[_0x24b3('0x1c')](0xcc)[_0x24b3('0x1d')]();});}};}function handleEntityNotFound(_0x2ae548,_0x4d5ea4){return function(_0x21d8a1){if(!_0x21d8a1){_0x2ae548['sendStatus'](0x194);}return _0x21d8a1;};}function handleError(_0x55b7ef,_0x466ed2){_0x466ed2=_0x466ed2||0x1f4;return function(_0x17b887){logger[_0x24b3('0x27')](_0x17b887['stack']);if(_0x17b887[_0x24b3('0x28')]){delete _0x17b887[_0x24b3('0x28')];}_0x55b7ef[_0x24b3('0x1c')](_0x466ed2)[_0x24b3('0x29')](_0x17b887);};}exports[_0x24b3('0x2a')]=function(_0x33ae40,_0x1a34db){var _0x16e034={},_0x1fdfcd={},_0x3b060a={'count':0x0,'rows':[]};var _0xc09d00=_[_0x24b3('0x2b')](db[_0x24b3('0x2c')][_0x24b3('0x2d')],function(_0x3be191){return{'name':_0x3be191[_0x24b3('0x2e')],'type':_0x3be191[_0x24b3('0x2f')][_0x24b3('0x30')]};});_0x1fdfcd[_0x24b3('0x31')]=_[_0x24b3('0x32')](_[_0x24b3('0x2b')](_0xc09d00,_0x24b3('0x28')),[_0x24b3('0x33')]);_0x1fdfcd['query']=_[_0x24b3('0x34')](_0x33ae40[_0x24b3('0x35')]);_0x1fdfcd[_0x24b3('0x36')]=_['intersection'](_0x1fdfcd['model'],_0x1fdfcd[_0x24b3('0x35')]);_0x16e034[_0x24b3('0x37')]=_[_0x24b3('0x38')](_0x1fdfcd['model'],qs[_0x24b3('0x39')](_0x33ae40[_0x24b3('0x35')][_0x24b3('0x39')]));_0x16e034['attributes']=_0x16e034[_0x24b3('0x37')][_0x24b3('0x3a')]?_0x16e034[_0x24b3('0x37')]:_0x1fdfcd[_0x24b3('0x31')];if(!_0x33ae40[_0x24b3('0x35')][_0x24b3('0x3b')](_0x24b3('0x3c'))){_0x16e034['limit']=qs[_0x24b3('0x21')](_0x33ae40['query'][_0x24b3('0x21')]);_0x16e034['offset']=qs[_0x24b3('0x1f')](_0x33ae40[_0x24b3('0x35')]['offset']);}_0x16e034[_0x24b3('0x3d')]=qs[_0x24b3('0x3e')](_0x33ae40[_0x24b3('0x35')][_0x24b3('0x3e')]);_0x16e034[_0x24b3('0x3f')]=qs[_0x24b3('0x36')](_[_0x24b3('0x40')](_0x33ae40[_0x24b3('0x35')],_0x1fdfcd[_0x24b3('0x36')]),_0xc09d00);if(_0x33ae40[_0x24b3('0x35')][_0x24b3('0x41')]){_0x16e034[_0x24b3('0x3f')]=_['merge'](_0x16e034['where'],{'$or':_[_0x24b3('0x2b')](_0xc09d00,function(_0x298642){if(_0x298642[_0x24b3('0x2f')]!==_0x24b3('0x42')){var _0x45809e={};_0x45809e[_0x298642[_0x24b3('0x28')]]={'$like':'%'+_0x33ae40[_0x24b3('0x35')]['filter']+'%'};return _0x45809e;}})});}_0x16e034=_[_0x24b3('0x43')]({},_0x16e034,_0x33ae40[_0x24b3('0x44')]);var _0x8aee42={'where':_0x16e034[_0x24b3('0x3f')]};return db['VoiceRecording']['count'](_0x8aee42)[_0x24b3('0x26')](function(_0x16e4cb){_0x3b060a['count']=_0x16e4cb;if(_0x33ae40[_0x24b3('0x35')][_0x24b3('0x45')]){_0x16e034[_0x24b3('0x46')]=[{'all':!![]}];}return db[_0x24b3('0x2c')][_0x24b3('0x47')](_0x16e034);})[_0x24b3('0x26')](function(_0x2ba8e2){_0x3b060a[_0x24b3('0x48')]=_0x2ba8e2;return _0x3b060a;})['then'](respondWithFilteredResult(_0x1a34db,_0x16e034))['catch'](handleError(_0x1a34db,null));};exports[_0x24b3('0x49')]=function(_0x2ecdbe,_0x33862d){var _0x3903a9={'raw':![],'where':{'id':_0x2ecdbe[_0x24b3('0x4a')]['id']}},_0xbe4ea5={};_0xbe4ea5['model']=_[_0x24b3('0x34')](db[_0x24b3('0x2c')][_0x24b3('0x2d')]);_0xbe4ea5[_0x24b3('0x35')]=_[_0x24b3('0x34')](_0x2ecdbe[_0x24b3('0x35')]);_0xbe4ea5[_0x24b3('0x36')]=_[_0x24b3('0x38')](_0xbe4ea5[_0x24b3('0x31')],_0xbe4ea5['query']);_0x3903a9[_0x24b3('0x37')]=_[_0x24b3('0x38')](_0xbe4ea5[_0x24b3('0x31')],qs['fields'](_0x2ecdbe[_0x24b3('0x35')][_0x24b3('0x39')]));_0x3903a9[_0x24b3('0x37')]=_0x3903a9[_0x24b3('0x37')][_0x24b3('0x3a')]?_0x3903a9['attributes']:_0xbe4ea5[_0x24b3('0x31')];if(_0x2ecdbe['query'][_0x24b3('0x45')]){_0x3903a9['include']=[{'all':!![]}];}_0x3903a9=_['merge']({},_0x3903a9,_0x2ecdbe['options']);return db[_0x24b3('0x2c')][_0x24b3('0x4b')](_0x3903a9)[_0x24b3('0x26')](handleEntityNotFound(_0x33862d,null))[_0x24b3('0x26')](respondWithResult(_0x33862d,null))[_0x24b3('0x4c')](handleError(_0x33862d,null));};exports[_0x24b3('0x4d')]=function(_0x267018,_0x5e7eaf){return db[_0x24b3('0x2c')][_0x24b3('0x4d')](_0x267018[_0x24b3('0x4e')],{})[_0x24b3('0x26')](respondWithResult(_0x5e7eaf,0xc9))['catch'](handleError(_0x5e7eaf,null));};exports[_0x24b3('0x25')]=function(_0x5f71ea,_0x129fb5){if(_0x5f71ea['body']['id']){delete _0x5f71ea[_0x24b3('0x4e')]['id'];}return db[_0x24b3('0x2c')][_0x24b3('0x4b')]({'where':{'id':_0x5f71ea[_0x24b3('0x4a')]['id']}})[_0x24b3('0x26')](handleEntityNotFound(_0x129fb5,null))[_0x24b3('0x26')](saveUpdates(_0x5f71ea[_0x24b3('0x4e')],null))[_0x24b3('0x26')](respondWithResult(_0x129fb5,null))[_0x24b3('0x4c')](handleError(_0x129fb5,null));};exports['describe']=function(_0x2553f2,_0x110986){return db[_0x24b3('0x2c')][_0x24b3('0x4f')]()[_0x24b3('0x26')](respondWithResult(_0x110986,null))['catch'](handleError(_0x110986,null));};exports[_0x24b3('0x50')]=function(_0x117b67,_0x479429,_0xfcc637){var _0x5f5aa4=require('../../components/encryptor');var _0x3ed690=![];var _0x4664af={};if(_0x117b67['query'][_0x24b3('0x2f')]&&_0x117b67[_0x24b3('0x35')][_0x24b3('0x2f')]===_0x24b3('0x51')){_0x4664af[_0x24b3('0x51')]=_0x117b67[_0x24b3('0x4a')]['id'];}else{_0x4664af['id']=_0x117b67[_0x24b3('0x4a')]['id'];}return db[_0x24b3('0x2c')][_0x24b3('0x4b')]({'where':_0x4664af,'attributes':['id','value'],'raw':!![]})[_0x24b3('0x26')](handleEntityNotFound(_0x479429,null))[_0x24b3('0x26')](function(_0x1fa15b){if(_0x1fa15b){var _0x1636d9=_0x1fa15b[_0x24b3('0x52')];var _0x2ed80b=util[_0x24b3('0x33')](_0x24b3('0x53'),_0x1636d9);if(fs['existsSync'](_0x2ed80b)){_0x3ed690=!![];return _0x5f5aa4[_0x24b3('0x54')](_0x2ed80b,_0x1636d9,config['secrets']['recording'])[_0x24b3('0x26')](function(){return _0x1fa15b;});}return _0x1fa15b;}})[_0x24b3('0x26')](function(_0x3b6da6){if(_0x3b6da6){var _0x1d6a46=_0x3b6da6[_0x24b3('0x52')];if(!fs[_0x24b3('0x55')](_0x1d6a46)){throw new db[(_0x24b3('0x56'))][(_0x24b3('0x57'))](_0x24b3('0x58'));}if(_0x3b6da6[_0x24b3('0x59')]){return _0x479429[_0x24b3('0x50')](_0x1d6a46,_0x3b6da6[_0x24b3('0x59')]+path['extname'](_0x1d6a46),function(){if(_0x3ed690){fs[_0x24b3('0x5a')](_0x1d6a46);}});}else{return _0x479429[_0x24b3('0x50')](_0x1d6a46,function(_0x5bacb9){if(_0x3ed690){fs[_0x24b3('0x5a')](_0x1d6a46);}});}}})[_0x24b3('0x4c')](function(_0x50e9d6){if(_0x50e9d6[_0x24b3('0x5b')]===_0x24b3('0x58')){_0x479429['status'](0x194)['send'](_0x24b3('0x5c'));}else{return handleError(_0x479429,null);}});};exports[_0x24b3('0x5d')]=function(_0x1fcb57,_0x2a14d9,_0x105bca){var _0x2b4beb=require('../../components/encryptor');var _0x17483a=![];var _0x2422cb={'$and':[db[_0x24b3('0x5e')][_0x24b3('0x3f')](db[_0x24b3('0x5e')]['fn'](_0x24b3('0x5f'),db[_0x24b3('0x5e')]['col'](_0x24b3('0x51'))),_0x1fcb57[_0x24b3('0x35')][_0x24b3('0x60')])]};if(_0x1fcb57[_0x24b3('0x35')][_0x24b3('0x2f')]&&_0x1fcb57['query'][_0x24b3('0x2f')]===_0x24b3('0x51')){_0x2422cb[_0x24b3('0x61')]['push']({'uniqueid':_0x1fcb57[_0x24b3('0x4a')]['id']});}else{_0x2422cb[_0x24b3('0x61')][_0x24b3('0x62')]({'id':_0x1fcb57[_0x24b3('0x4a')]['id']});}return db['VoiceRecording'][_0x24b3('0x4b')]({'where':_0x2422cb,'attributes':['id',_0x24b3('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x2a14d9,null))[_0x24b3('0x26')](function(_0x3dbfe9){if(_0x3dbfe9){var _0x42b9db=util[_0x24b3('0x33')](_0x24b3('0x53'),_0x3dbfe9[_0x24b3('0x52')]);if(fs[_0x24b3('0x55')](_0x42b9db)){_0x17483a=!![];return _0x2b4beb[_0x24b3('0x54')](_0x42b9db,_0x3dbfe9['value'],config[_0x24b3('0x63')][_0x24b3('0x64')])[_0x24b3('0x26')](function(){return _0x3dbfe9;});}return _0x3dbfe9;}})[_0x24b3('0x26')](function(_0x275f85){if(_0x275f85){if(!fs[_0x24b3('0x55')](_0x275f85['value'])){throw new db['Sequelize'][(_0x24b3('0x57'))](_0x24b3('0x58'));}if(_0x275f85[_0x24b3('0x59')]){return _0x2a14d9[_0x24b3('0x50')](_0x275f85[_0x24b3('0x52')],_0x275f85[_0x24b3('0x59')]+path['extname'](_0x275f85[_0x24b3('0x52')]),function(){if(_0x17483a){fs[_0x24b3('0x5a')](_0x275f85[_0x24b3('0x52')]);}});}else{return _0x2a14d9[_0x24b3('0x50')](_0x275f85[_0x24b3('0x52')],function(_0xcaed5c){if(_0x17483a){fs[_0x24b3('0x5a')](_0x275f85[_0x24b3('0x52')]);}});}}})[_0x24b3('0x4c')](handleError(_0x2a14d9,null));};exports[_0x24b3('0x65')]=function(_0x3d3842,_0x479d47){return db[_0x24b3('0x2c')][_0x24b3('0x4b')]({'where':{'id':_0x3d3842[_0x24b3('0x4a')]['id']}})[_0x24b3('0x26')](function(_0x5aba64){if(_[_0x24b3('0x66')](_0x5aba64)){throw new ReferenceError(_0x24b3('0x67'));}return _0x5aba64;})[_0x24b3('0x26')](function(_0x46127b){var _0x40b567=_0x46127b[_0x24b3('0x52')];logger[_0x24b3('0x68')](_0x24b3('0x69'),_0x40b567);if(!_[_0x24b3('0x66')](_0x46127b[_0x24b3('0x52')])&&fs[_0x24b3('0x55')](_0x40b567)){logger[_0x24b3('0x68')](_0x24b3('0x6a')+_0x40b567+_0x24b3('0x6b'));fs['unlinkSync'](_0x40b567);}_0x40b567=_0x40b567+_0x24b3('0x6c');if(!_[_0x24b3('0x66')](_0x46127b[_0x24b3('0x52')])&&fs[_0x24b3('0x55')](_0x40b567)){logger[_0x24b3('0x68')](_0x24b3('0x6a')+_0x40b567+_0x24b3('0x6b'));fs['unlinkSync'](_0x40b567);}return _0x46127b;})[_0x24b3('0x26')](function(_0x39dd46){if(!_0x39dd46)throw new InternalError();return _0x39dd46[_0x24b3('0x65')]();})[_0x24b3('0x26')](function(){_0x479d47[_0x24b3('0x1c')](0xcc)[_0x24b3('0x1d')]();})[_0x24b3('0x4c')](handleError(_0x479d47,null));};function getBucketslist(_0x62440a,_0x132507,_0x1bc43a){return new Promise(function(_0x883b1a,_0xf84775){var _0x5dc834=new AWS['S3']({'accessKeyId':_0x132507,'secretAccessKey':_0x62440a,'region':_0x1bc43a});_0x5dc834[_0x24b3('0x6d')]({},function(_0x175f5f,_0xb3d960){if(_0x175f5f){return _0xf84775(_0x175f5f);}else{return _0x883b1a(_0xb3d960);}});});}function createBucket(_0x295e6f,_0xde5f6c,_0x22848e,_0xc4bb91){return new Promise(function(_0x332a13,_0x929ca1){var _0x5e5655=new AWS['S3']({'accessKeyId':_0xde5f6c,'secretAccessKey':_0x295e6f,'region':_0x22848e});_0x5e5655[_0x24b3('0x6e')]({'Bucket':_0xc4bb91},function(_0x337f38,_0x4554ae){if(_0x337f38){return _0x929ca1(_0x337f38);}else{return _0x332a13(_0x4554ae);}});});}function uploadFile(_0x2c6864,_0x533058,_0x48d36d,_0x49d4c3,_0x15be21,_0x3afed8){return new Promise(function(_0x45c3c8,_0x493e83){var _0x3ec159=new AWS['S3']({'accessKeyId':_0x533058,'secretAccessKey':_0x2c6864,'region':_0x48d36d});_0x3ec159[_0x24b3('0x6f')]({'Bucket':_0x49d4c3,'Key':_0x15be21,'Body':_0x3afed8},function(_0x588ee5,_0x5a33d5){if(_0x588ee5){return _0x493e83(_0x588ee5);}else{return _0x45c3c8(_0x5a33d5);}});});}function startTranscribe(_0x3af4d8,_0x22260c,_0x11845a,_0x59db7e,_0x22d6e5,_0x1db713){return new Promise(function(_0x161632,_0x13d236){var _0xfd13e4=new AWS[(_0x24b3('0x70'))]({'accessKeyId':_0x22260c,'secretAccessKey':_0x3af4d8,'region':_0x11845a});_0xfd13e4[_0x24b3('0x71')]({'TranscriptionJobName':_0x59db7e,'LanguageCode':_0x22d6e5,'Media':{'MediaFileUri':_0x1db713}},function(_0x9c5c8a,_0x2bc119){if(_0x9c5c8a){return _0x13d236(_0x9c5c8a);}else{return _0x161632(_0x2bc119);}});});}function transcribe(_0x2c14dd,_0xd160d5,_0x2c36b3,_0x5b361e,_0x9b49ba,_0x157a57,_0x26b0c5){return new Promise(function(_0xe6cf54,_0x42adea){var _0x5c08e2={};logger[_0x24b3('0x68')](util[_0x24b3('0x33')](_0x24b3('0x72'),_0x2c14dd,_0x9b49ba));return uploadFile(_0xd160d5,_0x2c36b3,_0x5b361e,_0x9b49ba,path[_0x24b3('0x73')](_0x157a57),fs[_0x24b3('0x74')](_0x157a57))[_0x24b3('0x26')](function(_0x230706){logger[_0x24b3('0x68')](util[_0x24b3('0x33')](_0x24b3('0x75'),_0x2c14dd,_0x9b49ba,_0x230706[_0x24b3('0x76')]));_0x5c08e2['bucket']=_0x230706['Bucket'];_0x5c08e2['location']=_0x230706['Location'];logger['info'](util[_0x24b3('0x33')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2c14dd));return startTranscribe(_0xd160d5,_0x2c36b3,_0x5b361e,uuidv4(),_0x26b0c5,_0x230706[_0x24b3('0x76')]);})[_0x24b3('0x26')](function(_0x2967be){logger['info'](util['format'](_0x24b3('0x77'),_0x2c14dd,_0x2967be[_0x24b3('0x78')][_0x24b3('0x79')]));_0x5c08e2[_0x24b3('0x7a')]=_0x2967be[_0x24b3('0x78')][_0x24b3('0x79')];_0x5c08e2[_0x24b3('0x7b')]=_0x2967be[_0x24b3('0x78')]['TranscriptionJobStatus'];return _0xe6cf54(_0x5c08e2);})['catch'](function(_0x5aa211){return _0x42adea(_0x5aa211);});});}exports[_0x24b3('0x7c')]=function(_0x238160,_0xfb9b46,_0xe50a1d){var _0x58165f;var _0x3fe2c6;var _0x4d3191;var _0x113541=require(_0x24b3('0x7d'));return db[_0x24b3('0x2c')]['findOne']({'where':{'id':_0x238160[_0x24b3('0x4a')]['id']}})[_0x24b3('0x26')](function(_0x33d36f){if(_0x33d36f){var _0x9319e5=util[_0x24b3('0x33')](_0x24b3('0x53'),_0x33d36f[_0x24b3('0x52')]);if(fs['existsSync'](_0x9319e5)){cypher=!![];return _0x113541['decryptFile'](_0x9319e5,_0x33d36f[_0x24b3('0x52')],config['secrets'][_0x24b3('0x64')])['then'](function(){return _0x33d36f;});}return _0x33d36f;}})['then'](function(_0x575da7){if(!_0x575da7){throw new db[(_0x24b3('0x56'))]['ValidationError'](_0x24b3('0x7e'));}_0x3fe2c6=_0x575da7;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x24b3('0x26')](handleEntityNotFound(_0xfb9b46,null))[_0x24b3('0x26')](function(_0x1bcb0b){if(_0x1bcb0b){_0x58165f=_0x1bcb0b;if(!_0x58165f['transcribe']||!_0x58165f[_0x24b3('0x7f')]||!_0x58165f[_0x24b3('0x80')]||!_0x58165f['language']||!_0x58165f['bucket']){throw new db[(_0x24b3('0x56'))][(_0x24b3('0x57'))](_0x24b3('0x81'));}if(_0x238160[_0x24b3('0x4e')][_0x24b3('0x82')]&&(!_0x58165f[_0x24b3('0x83')]||!_0x58165f['sentimentAccountId']||!_0x58165f[_0x24b3('0x84')]||!_0x58165f[_0x24b3('0x85')]||!_0x58165f[_0x24b3('0x86')])){throw new db[(_0x24b3('0x56'))][(_0x24b3('0x57'))](_0x24b3('0x87'));}return db[_0x24b3('0x88')][_0x24b3('0x89')]({'where':{'id':_0x58165f[_0x24b3('0x7f')]}});}})['then'](function(_0x2f17ce){if(!_0x2f17ce){throw new db[(_0x24b3('0x56'))]['ValidationError'](_0x24b3('0x8a'));}if(!_0x2f17ce['data1']||!_0x2f17ce[_0x24b3('0x8b')]){throw new db[(_0x24b3('0x56'))][(_0x24b3('0x57'))]('Cloud\x20Provider\x20not\x20configured');}_0x4d3191=_0x2f17ce;return getBucketslist(_0x4d3191['data1'],_0x4d3191[_0x24b3('0x8b')],_0x58165f[_0x24b3('0x80')]);})[_0x24b3('0x26')](function(_0x5303c1){if(_0x5303c1&&_0x5303c1['Buckets']){var _0x1c7386=_[_0x24b3('0x4b')](_0x5303c1['Buckets'],function(_0x58eb22){return _0x58eb22[_0x24b3('0x8c')]===_0x58165f[_0x24b3('0x86')];});if(!_0x1c7386){logger[_0x24b3('0x68')](util['format'](_0x24b3('0x8d'),_0x238160[_0x24b3('0x4a')]['id'],_0x58165f[_0x24b3('0x86')]));return createBucket(_0x4d3191[_0x24b3('0x8e')],_0x4d3191[_0x24b3('0x8b')],_0x58165f['transcribeRegion'],_0x58165f[_0x24b3('0x86')]);}logger[_0x24b3('0x68')](util[_0x24b3('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x238160[_0x24b3('0x4a')]['id'],_0x58165f['bucket']));return;}})[_0x24b3('0x26')](function(_0x21abe1){if(_0x3fe2c6[_0x24b3('0x7b')]===_0x24b3('0x8f')){return transcribe(_0x238160['params']['id'],_0x4d3191[_0x24b3('0x8e')],_0x4d3191[_0x24b3('0x8b')],_0x58165f['transcribeRegion'],_0x58165f[_0x24b3('0x86')],_0x3fe2c6['value'],_0x58165f[_0x24b3('0x85')]);}else{logger[_0x24b3('0x68')](util['format'](_0x24b3('0x90'),_0x238160['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x24b3('0x26')](function(_0x43008e){if(_0x43008e){_0x43008e[_0x24b3('0x91')]=_0x238160[_0x24b3('0x4e')][_0x24b3('0x82')];return _0x3fe2c6[_0x24b3('0x92')](_0x43008e);}})['then'](respondWithResult(_0xfb9b46,null))[_0x24b3('0x4c')](handleError(_0xfb9b46,null));};function writeFile(_0x180aed,_0x438903){return new Promise(function(_0x20fdae,_0x30dd39){fs[_0x24b3('0x93')](_0x438903,_0x180aed,function(_0x189753,_0x306806){if(_0x189753){return _0x30dd39(_0x189753);}else{return _0x20fdae(_0x306806);}});});}exports[_0x24b3('0x94')]=function(_0x23968b,_0x5d4d73,_0x8a520e){return db[_0x24b3('0x2c')][_0x24b3('0x89')]({'where':{'id':_0x23968b[_0x24b3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d4d73))[_0x24b3('0x26')](function(_0x29e775){if(_0x29e775&&_0x29e775['fileText']){var _0x52ab20=_0x29e775[_0x24b3('0x95')];var _0x4af142=config[_0x24b3('0x96')]+_0x24b3('0x97')+_0x29e775['id']+'.txt';if(fs[_0x24b3('0x55')](_0x4af142)){return _0x4af142;}return writeFile(_0x52ab20,_0x4af142)[_0x24b3('0x26')](function(){return _0x4af142;});}else{throw new db[(_0x24b3('0x56'))][(_0x24b3('0x57'))]('Transcript\x20not\x20available');}})[_0x24b3('0x26')](function(_0x5d3265){return _0x5d4d73[_0x24b3('0x50')](_0x5d3265);})[_0x24b3('0x4c')](handleError(_0x5d4d73));};
\ No newline at end of file
+var _0xe3b1=['upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','findOne','ValidationError','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','aws-sdk','uuid/v4','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','stack','name','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','download','extname','send','Not\x20found','sequelize','MD5','col','token','$and','push','unlink','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','createBucket'];(function(_0x10a24c,_0x3609dd){var _0x2c2333=function(_0x13ddd0){while(--_0x13ddd0){_0x10a24c['push'](_0x10a24c['shift']());}};_0x2c2333(++_0x3609dd);}(_0xe3b1,0x152));var _0x1e3b=function(_0x3293e6,_0x83a410){_0x3293e6=_0x3293e6-0x0;var _0x35f5f4=_0xe3b1[_0x3293e6];return _0x35f5f4;};'use strict';var emlformat=require(_0x1e3b('0x0'));var rimraf=require(_0x1e3b('0x1'));var zipdir=require(_0x1e3b('0x2'));var jsonpatch=require(_0x1e3b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1e3b('0x4'));var Mustache=require(_0x1e3b('0x5'));var util=require(_0x1e3b('0x6'));var path=require('path');var sox=require(_0x1e3b('0x7'));var csv=require(_0x1e3b('0x8'));var ejs=require(_0x1e3b('0x9'));var fs=require('fs');var fs_extra=require(_0x1e3b('0xa'));var _=require(_0x1e3b('0xb'));var squel=require(_0x1e3b('0xc'));var crypto=require(_0x1e3b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1e3b('0xe'));var Papa=require('papaparse');var AWS=require(_0x1e3b('0xf'));var uuidv4=require(_0x1e3b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1e3b('0x11'));var as=require(_0x1e3b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e3b('0x13'))('api');var utils=require(_0x1e3b('0x14'));var config=require(_0x1e3b('0x15'));var licenseUtil=require(_0x1e3b('0x16'));var db=require(_0x1e3b('0x17'))['db'];function respondWithStatusCode(_0x317355,_0x2668c3){_0x2668c3=_0x2668c3||0xcc;return function(_0x1a268b){if(_0x1a268b){return _0x317355[_0x1e3b('0x18')](_0x2668c3);}return _0x317355['status'](_0x2668c3)[_0x1e3b('0x19')]();};}function respondWithResult(_0x385309,_0xc8aef9){_0xc8aef9=_0xc8aef9||0xc8;return function(_0x341add){if(_0x341add){return _0x385309[_0x1e3b('0x1a')](_0xc8aef9)['json'](_0x341add);}};}function respondWithFilteredResult(_0x346f82,_0x17cd18){return function(_0x30e42d){if(_0x30e42d){var _0x53318a=typeof _0x17cd18['offset']===_0x1e3b('0x1b')&&typeof _0x17cd18['limit']==='undefined';var _0x48a2c3=_0x30e42d[_0x1e3b('0x1c')];var _0x78e648=_0x53318a?0x0:_0x17cd18['offset'];var _0x14f81a=_0x53318a?_0x30e42d['count']:_0x17cd18[_0x1e3b('0x1d')]+_0x17cd18[_0x1e3b('0x1e')];var _0x6b059;if(_0x14f81a>=_0x48a2c3){_0x14f81a=_0x48a2c3;_0x6b059=0xc8;}else{_0x6b059=0xce;}_0x346f82['status'](_0x6b059);return _0x346f82['set'](_0x1e3b('0x1f'),_0x78e648+'-'+_0x14f81a+'/'+_0x48a2c3)[_0x1e3b('0x20')](_0x30e42d);}return null;};}function patchUpdates(_0x36c47c){return function(_0x3aac36){try{jsonpatch[_0x1e3b('0x21')](_0x3aac36,_0x36c47c,!![]);}catch(_0x5e4ffd){return BPromise[_0x1e3b('0x22')](_0x5e4ffd);}return _0x3aac36[_0x1e3b('0x23')]();};}function saveUpdates(_0x2a2729,_0xeba1ae){return function(_0x349dd3){if(_0x349dd3){return _0x349dd3[_0x1e3b('0x24')](_0x2a2729)['then'](function(_0x449bbb){return _0x449bbb;});}return null;};}function removeEntity(_0x914f90,_0x37261d){return function(_0x4993d5){if(_0x4993d5){return _0x4993d5['destroy']()[_0x1e3b('0x25')](function(){_0x914f90[_0x1e3b('0x1a')](0xcc)[_0x1e3b('0x19')]();});}};}function handleEntityNotFound(_0x14345b,_0x1513a5){return function(_0x5e5cb9){if(!_0x5e5cb9){_0x14345b[_0x1e3b('0x18')](0x194);}return _0x5e5cb9;};}function handleError(_0x2effaa,_0x9dd64b){_0x9dd64b=_0x9dd64b||0x1f4;return function(_0x1da731){logger['error'](_0x1da731[_0x1e3b('0x26')]);if(_0x1da731[_0x1e3b('0x27')]){delete _0x1da731[_0x1e3b('0x27')];}_0x2effaa[_0x1e3b('0x1a')](_0x9dd64b)['send'](_0x1da731);};}exports['index']=function(_0x5c663c,_0x52119b){var _0x36ca19={},_0x302473={},_0x2b40d3={'count':0x0,'rows':[]};var _0x3abfe4=_[_0x1e3b('0x28')](db[_0x1e3b('0x29')][_0x1e3b('0x2a')],function(_0x50ae4c){return{'name':_0x50ae4c[_0x1e3b('0x2b')],'type':_0x50ae4c[_0x1e3b('0x2c')]['key']};});_0x302473[_0x1e3b('0x2d')]=_[_0x1e3b('0x2e')](_[_0x1e3b('0x28')](_0x3abfe4,_0x1e3b('0x27')),[_0x1e3b('0x2f')]);_0x302473[_0x1e3b('0x30')]=_[_0x1e3b('0x31')](_0x5c663c[_0x1e3b('0x30')]);_0x302473[_0x1e3b('0x32')]=_[_0x1e3b('0x33')](_0x302473[_0x1e3b('0x2d')],_0x302473[_0x1e3b('0x30')]);_0x36ca19[_0x1e3b('0x34')]=_['intersection'](_0x302473['model'],qs[_0x1e3b('0x35')](_0x5c663c[_0x1e3b('0x30')][_0x1e3b('0x35')]));_0x36ca19['attributes']=_0x36ca19[_0x1e3b('0x34')][_0x1e3b('0x36')]?_0x36ca19[_0x1e3b('0x34')]:_0x302473[_0x1e3b('0x2d')];if(!_0x5c663c['query'][_0x1e3b('0x37')]('nolimit')){_0x36ca19[_0x1e3b('0x1e')]=qs[_0x1e3b('0x1e')](_0x5c663c['query'][_0x1e3b('0x1e')]);_0x36ca19[_0x1e3b('0x1d')]=qs[_0x1e3b('0x1d')](_0x5c663c[_0x1e3b('0x30')][_0x1e3b('0x1d')]);}_0x36ca19[_0x1e3b('0x38')]=qs[_0x1e3b('0x39')](_0x5c663c[_0x1e3b('0x30')][_0x1e3b('0x39')]);_0x36ca19[_0x1e3b('0x3a')]=qs[_0x1e3b('0x32')](_[_0x1e3b('0x3b')](_0x5c663c[_0x1e3b('0x30')],_0x302473[_0x1e3b('0x32')]),_0x3abfe4);if(_0x5c663c[_0x1e3b('0x30')][_0x1e3b('0x3c')]){_0x36ca19[_0x1e3b('0x3a')]=_[_0x1e3b('0x3d')](_0x36ca19['where'],{'$or':_[_0x1e3b('0x28')](_0x3abfe4,function(_0x45a75c){if(_0x45a75c[_0x1e3b('0x2c')]!==_0x1e3b('0x3e')){var _0x43b1ec={};_0x43b1ec[_0x45a75c[_0x1e3b('0x27')]]={'$like':'%'+_0x5c663c[_0x1e3b('0x30')][_0x1e3b('0x3c')]+'%'};return _0x43b1ec;}})});}_0x36ca19=_[_0x1e3b('0x3d')]({},_0x36ca19,_0x5c663c[_0x1e3b('0x3f')]);var _0x2c80a2={'where':_0x36ca19['where']};return db[_0x1e3b('0x29')][_0x1e3b('0x1c')](_0x2c80a2)['then'](function(_0x223e6a){_0x2b40d3[_0x1e3b('0x1c')]=_0x223e6a;if(_0x5c663c[_0x1e3b('0x30')][_0x1e3b('0x40')]){_0x36ca19[_0x1e3b('0x41')]=[{'all':!![]}];}return db[_0x1e3b('0x29')][_0x1e3b('0x42')](_0x36ca19);})[_0x1e3b('0x25')](function(_0x5bf0c8){_0x2b40d3[_0x1e3b('0x43')]=_0x5bf0c8;return _0x2b40d3;})['then'](respondWithFilteredResult(_0x52119b,_0x36ca19))[_0x1e3b('0x44')](handleError(_0x52119b,null));};exports[_0x1e3b('0x45')]=function(_0x1fe974,_0x44663c){var _0x41e78b={'raw':![],'where':{'id':_0x1fe974[_0x1e3b('0x46')]['id']}},_0x1fd1c5={};_0x1fd1c5[_0x1e3b('0x2d')]=_[_0x1e3b('0x31')](db['VoiceRecording']['rawAttributes']);_0x1fd1c5['query']=_['keys'](_0x1fe974[_0x1e3b('0x30')]);_0x1fd1c5[_0x1e3b('0x32')]=_[_0x1e3b('0x33')](_0x1fd1c5['model'],_0x1fd1c5['query']);_0x41e78b[_0x1e3b('0x34')]=_[_0x1e3b('0x33')](_0x1fd1c5[_0x1e3b('0x2d')],qs['fields'](_0x1fe974['query'][_0x1e3b('0x35')]));_0x41e78b[_0x1e3b('0x34')]=_0x41e78b['attributes']['length']?_0x41e78b[_0x1e3b('0x34')]:_0x1fd1c5['model'];if(_0x1fe974[_0x1e3b('0x30')][_0x1e3b('0x40')]){_0x41e78b[_0x1e3b('0x41')]=[{'all':!![]}];}_0x41e78b=_['merge']({},_0x41e78b,_0x1fe974[_0x1e3b('0x3f')]);return db[_0x1e3b('0x29')]['find'](_0x41e78b)[_0x1e3b('0x25')](handleEntityNotFound(_0x44663c,null))[_0x1e3b('0x25')](respondWithResult(_0x44663c,null))['catch'](handleError(_0x44663c,null));};exports['create']=function(_0xa22972,_0x34dfda){return db[_0x1e3b('0x29')][_0x1e3b('0x47')](_0xa22972[_0x1e3b('0x48')],{})[_0x1e3b('0x25')](respondWithResult(_0x34dfda,0xc9))[_0x1e3b('0x44')](handleError(_0x34dfda,null));};exports['update']=function(_0x415aa7,_0x406a4b){if(_0x415aa7[_0x1e3b('0x48')]['id']){delete _0x415aa7[_0x1e3b('0x48')]['id'];}return db['VoiceRecording'][_0x1e3b('0x49')]({'where':{'id':_0x415aa7[_0x1e3b('0x46')]['id']}})[_0x1e3b('0x25')](handleEntityNotFound(_0x406a4b,null))[_0x1e3b('0x25')](saveUpdates(_0x415aa7[_0x1e3b('0x48')],null))[_0x1e3b('0x25')](respondWithResult(_0x406a4b,null))[_0x1e3b('0x44')](handleError(_0x406a4b,null));};exports[_0x1e3b('0x4a')]=function(_0xd68758,_0x5f1b92){return db['VoiceRecording'][_0x1e3b('0x4a')]()[_0x1e3b('0x25')](respondWithResult(_0x5f1b92,null))['catch'](handleError(_0x5f1b92,null));};exports['download']=function(_0x16810c,_0x113eb9,_0x1127b7){var _0x1183f5=require(_0x1e3b('0x4b'));var _0x489815=![];var _0x2169d0={};if(_0x16810c[_0x1e3b('0x30')]['type']&&_0x16810c[_0x1e3b('0x30')][_0x1e3b('0x2c')]===_0x1e3b('0x4c')){_0x2169d0[_0x1e3b('0x4c')]=_0x16810c[_0x1e3b('0x46')]['id'];}else{_0x2169d0['id']=_0x16810c['params']['id'];}return db[_0x1e3b('0x29')][_0x1e3b('0x49')]({'where':_0x2169d0,'attributes':['id',_0x1e3b('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x113eb9,null))[_0x1e3b('0x25')](function(_0x31bb1c){if(_0x31bb1c){var _0x7fe687=_0x31bb1c[_0x1e3b('0x4d')];var _0x2a4760=util[_0x1e3b('0x2f')](_0x1e3b('0x4e'),_0x7fe687);if(fs[_0x1e3b('0x4f')](_0x2a4760)){_0x489815=!![];return _0x1183f5[_0x1e3b('0x50')](_0x2a4760,_0x7fe687,config[_0x1e3b('0x51')][_0x1e3b('0x52')])[_0x1e3b('0x25')](function(){return _0x31bb1c;});}return _0x31bb1c;}})[_0x1e3b('0x25')](function(_0x1b7836){if(_0x1b7836){var _0xba0ac1=_0x1b7836[_0x1e3b('0x4d')];if(!fs[_0x1e3b('0x4f')](_0xba0ac1)){throw new db[(_0x1e3b('0x53'))]['ValidationError'](_0x1e3b('0x54'));}if(_0x1b7836[_0x1e3b('0x55')]){return _0x113eb9[_0x1e3b('0x56')](_0xba0ac1,_0x1b7836[_0x1e3b('0x55')]+path[_0x1e3b('0x57')](_0xba0ac1),function(){if(_0x489815){fs['unlink'](_0xba0ac1);}});}else{return _0x113eb9['download'](_0xba0ac1,function(_0x3bf155){if(_0x489815){fs['unlink'](_0xba0ac1);}});}}})[_0x1e3b('0x44')](function(_0x18c8cd){if(_0x18c8cd['message']===_0x1e3b('0x54')){_0x113eb9[_0x1e3b('0x1a')](0x194)[_0x1e3b('0x58')](_0x1e3b('0x59'));}else{return handleError(_0x113eb9,null);}});};exports['downloads']=function(_0x49fb36,_0x537ca5,_0x46c47e){var _0x376461=require(_0x1e3b('0x4b'));var _0x2fb0fc=![];var _0x36631f={'$and':[db[_0x1e3b('0x5a')][_0x1e3b('0x3a')](db[_0x1e3b('0x5a')]['fn'](_0x1e3b('0x5b'),db[_0x1e3b('0x5a')][_0x1e3b('0x5c')](_0x1e3b('0x4c'))),_0x49fb36['query'][_0x1e3b('0x5d')])]};if(_0x49fb36['query'][_0x1e3b('0x2c')]&&_0x49fb36['query'][_0x1e3b('0x2c')]===_0x1e3b('0x4c')){_0x36631f[_0x1e3b('0x5e')][_0x1e3b('0x5f')]({'uniqueid':_0x49fb36[_0x1e3b('0x46')]['id']});}else{_0x36631f[_0x1e3b('0x5e')][_0x1e3b('0x5f')]({'id':_0x49fb36['params']['id']});}return db[_0x1e3b('0x29')][_0x1e3b('0x49')]({'where':_0x36631f,'attributes':['id',_0x1e3b('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x537ca5,null))[_0x1e3b('0x25')](function(_0x3e91a3){if(_0x3e91a3){var _0x279ef5=util[_0x1e3b('0x2f')]('%s.cypher',_0x3e91a3[_0x1e3b('0x4d')]);if(fs[_0x1e3b('0x4f')](_0x279ef5)){_0x2fb0fc=!![];return _0x376461['decryptFile'](_0x279ef5,_0x3e91a3[_0x1e3b('0x4d')],config[_0x1e3b('0x51')]['recording'])[_0x1e3b('0x25')](function(){return _0x3e91a3;});}return _0x3e91a3;}})[_0x1e3b('0x25')](function(_0x382f84){if(_0x382f84){if(!fs[_0x1e3b('0x4f')](_0x382f84[_0x1e3b('0x4d')])){throw new db['Sequelize']['ValidationError'](_0x1e3b('0x54'));}if(_0x382f84[_0x1e3b('0x55')]){return _0x537ca5[_0x1e3b('0x56')](_0x382f84[_0x1e3b('0x4d')],_0x382f84[_0x1e3b('0x55')]+path[_0x1e3b('0x57')](_0x382f84[_0x1e3b('0x4d')]),function(){if(_0x2fb0fc){fs[_0x1e3b('0x60')](_0x382f84[_0x1e3b('0x4d')]);}});}else{return _0x537ca5[_0x1e3b('0x56')](_0x382f84['value'],function(_0x3a0f3e){if(_0x2fb0fc){fs[_0x1e3b('0x60')](_0x382f84[_0x1e3b('0x4d')]);}});}}})[_0x1e3b('0x44')](handleError(_0x537ca5,null));};exports[_0x1e3b('0x61')]=function(_0x2632f2,_0xec4e3d){return db[_0x1e3b('0x29')][_0x1e3b('0x49')]({'where':{'id':_0x2632f2['params']['id']}})[_0x1e3b('0x25')](function(_0x126e85){if(_[_0x1e3b('0x62')](_0x126e85)){throw new ReferenceError('Entity\x20not\x20found');}return _0x126e85;})[_0x1e3b('0x25')](function(_0x3efe5d){var _0x52f29e=_0x3efe5d[_0x1e3b('0x4d')];logger[_0x1e3b('0x63')](_0x1e3b('0x64'),_0x52f29e);if(!_[_0x1e3b('0x62')](_0x3efe5d[_0x1e3b('0x4d')])&&fs[_0x1e3b('0x4f')](_0x52f29e)){logger['info'](_0x1e3b('0x65')+_0x52f29e+_0x1e3b('0x66'));fs['unlinkSync'](_0x52f29e);}_0x52f29e=_0x52f29e+_0x1e3b('0x67');if(!_[_0x1e3b('0x62')](_0x3efe5d['value'])&&fs[_0x1e3b('0x4f')](_0x52f29e)){logger[_0x1e3b('0x63')]('File:\x20\x22'+_0x52f29e+_0x1e3b('0x66'));fs[_0x1e3b('0x68')](_0x52f29e);}return _0x3efe5d;})[_0x1e3b('0x25')](function(_0x56f7df){if(!_0x56f7df)throw new InternalError();return _0x56f7df[_0x1e3b('0x61')]();})['then'](function(){_0xec4e3d[_0x1e3b('0x1a')](0xcc)['end']();})['catch'](handleError(_0xec4e3d,null));};function getBucketslist(_0x1cd387,_0x582bef,_0x220008){return new Promise(function(_0xa08706,_0x24c43a){var _0x4a10ac=new AWS['S3']({'accessKeyId':_0x582bef,'secretAccessKey':_0x1cd387,'region':_0x220008});_0x4a10ac['listBuckets']({},function(_0x2a9b59,_0xd32d){if(_0x2a9b59){return _0x24c43a(_0x2a9b59);}else{return _0xa08706(_0xd32d);}});});}function createBucket(_0x2e9dc8,_0x4b6e50,_0x1d50e3,_0xb33711){return new Promise(function(_0x25c360,_0x1b5035){var _0x163f72=new AWS['S3']({'accessKeyId':_0x4b6e50,'secretAccessKey':_0x2e9dc8,'region':_0x1d50e3});_0x163f72[_0x1e3b('0x69')]({'Bucket':_0xb33711},function(_0x37be02,_0x187958){if(_0x37be02){return _0x1b5035(_0x37be02);}else{return _0x25c360(_0x187958);}});});}function uploadFile(_0x17eac8,_0x5320f6,_0x103707,_0x3531ba,_0x2a1141,_0x1f4b5d){return new Promise(function(_0x37e88b,_0x5604be){var _0x5f42f2=new AWS['S3']({'accessKeyId':_0x5320f6,'secretAccessKey':_0x17eac8,'region':_0x103707});_0x5f42f2[_0x1e3b('0x6a')]({'Bucket':_0x3531ba,'Key':_0x2a1141,'Body':_0x1f4b5d},function(_0x143de2,_0x300aaf){if(_0x143de2){return _0x5604be(_0x143de2);}else{return _0x37e88b(_0x300aaf);}});});}function startTranscribe(_0x26ebe7,_0x2d2237,_0x40b702,_0x2d9577,_0x5669de,_0x42fb20){return new Promise(function(_0x41d8ad,_0x3ba57a){var _0x497935=new AWS[(_0x1e3b('0x6b'))]({'accessKeyId':_0x2d2237,'secretAccessKey':_0x26ebe7,'region':_0x40b702});_0x497935[_0x1e3b('0x6c')]({'TranscriptionJobName':_0x2d9577,'LanguageCode':_0x5669de,'Media':{'MediaFileUri':_0x42fb20}},function(_0x3f2142,_0x2866be){if(_0x3f2142){return _0x3ba57a(_0x3f2142);}else{return _0x41d8ad(_0x2866be);}});});}function transcribe(_0xf486de,_0x2084dc,_0x372a5f,_0x3410dd,_0x32477d,_0x5ce6eb,_0x5b14d2){return new Promise(function(_0x52242d,_0x196a35){var _0x1767ea={};logger[_0x1e3b('0x63')](util[_0x1e3b('0x2f')](_0x1e3b('0x6d'),_0xf486de,_0x32477d));return uploadFile(_0x2084dc,_0x372a5f,_0x3410dd,_0x32477d,path['basename'](_0x5ce6eb),fs[_0x1e3b('0x6e')](_0x5ce6eb))['then'](function(_0x138561){logger[_0x1e3b('0x63')](util[_0x1e3b('0x2f')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0xf486de,_0x32477d,_0x138561[_0x1e3b('0x6f')]));_0x1767ea[_0x1e3b('0x70')]=_0x138561[_0x1e3b('0x71')];_0x1767ea[_0x1e3b('0x72')]=_0x138561['Location'];logger[_0x1e3b('0x63')](util[_0x1e3b('0x2f')](_0x1e3b('0x73'),_0xf486de));return startTranscribe(_0x2084dc,_0x372a5f,_0x3410dd,uuidv4(),_0x5b14d2,_0x138561[_0x1e3b('0x6f')]);})[_0x1e3b('0x25')](function(_0x89d0fc){logger['info'](util[_0x1e3b('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0xf486de,_0x89d0fc['TranscriptionJob'][_0x1e3b('0x74')]));_0x1767ea[_0x1e3b('0x75')]=_0x89d0fc[_0x1e3b('0x76')][_0x1e3b('0x74')];_0x1767ea[_0x1e3b('0x77')]=_0x89d0fc['TranscriptionJob'][_0x1e3b('0x78')];return _0x52242d(_0x1767ea);})[_0x1e3b('0x44')](function(_0x564070){return _0x196a35(_0x564070);});});}exports['runTranscribe']=function(_0x35e632,_0x39918e,_0x51e999){var _0x246640;var _0x2c7154;var _0x2bc984;var _0x4b22d3=require(_0x1e3b('0x4b'));return db[_0x1e3b('0x29')][_0x1e3b('0x79')]({'where':{'id':_0x35e632['params']['id']}})['then'](function(_0x1c0b12){if(_0x1c0b12){var _0x1b9abe=util[_0x1e3b('0x2f')](_0x1e3b('0x4e'),_0x1c0b12[_0x1e3b('0x4d')]);if(fs[_0x1e3b('0x4f')](_0x1b9abe)){cypher=!![];return _0x4b22d3[_0x1e3b('0x50')](_0x1b9abe,_0x1c0b12['value'],config['secrets']['recording'])[_0x1e3b('0x25')](function(){return _0x1c0b12;});}return _0x1c0b12;}})[_0x1e3b('0x25')](function(_0x4107d0){if(!_0x4107d0){throw new db[(_0x1e3b('0x53'))][(_0x1e3b('0x7a'))]('Voice\x20Recording\x20not\x20found');}_0x2c7154=_0x4107d0;return db['Setting'][_0x1e3b('0x79')]({'where':{'id':0x1}});})[_0x1e3b('0x25')](handleEntityNotFound(_0x39918e,null))[_0x1e3b('0x25')](function(_0x11ea2d){if(_0x11ea2d){_0x246640=_0x11ea2d;if(!_0x246640[_0x1e3b('0x7b')]||!_0x246640['transcribeAccountId']||!_0x246640[_0x1e3b('0x7c')]||!_0x246640[_0x1e3b('0x7d')]||!_0x246640[_0x1e3b('0x70')]){throw new db['Sequelize'][(_0x1e3b('0x7a'))](_0x1e3b('0x7e'));}if(_0x35e632['body'][_0x1e3b('0x7f')]&&(!_0x246640[_0x1e3b('0x80')]||!_0x246640[_0x1e3b('0x81')]||!_0x246640[_0x1e3b('0x82')]||!_0x246640[_0x1e3b('0x7d')]||!_0x246640['bucket'])){throw new db['Sequelize'][(_0x1e3b('0x7a'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x1e3b('0x83')][_0x1e3b('0x79')]({'where':{'id':_0x246640[_0x1e3b('0x84')]}});}})[_0x1e3b('0x25')](function(_0x46321e){if(!_0x46321e){throw new db[(_0x1e3b('0x53'))][(_0x1e3b('0x7a'))](_0x1e3b('0x85'));}if(!_0x46321e[_0x1e3b('0x86')]||!_0x46321e[_0x1e3b('0x87')]){throw new db[(_0x1e3b('0x53'))][(_0x1e3b('0x7a'))]('Cloud\x20Provider\x20not\x20configured');}_0x2bc984=_0x46321e;return getBucketslist(_0x2bc984['data1'],_0x2bc984[_0x1e3b('0x87')],_0x246640[_0x1e3b('0x7c')]);})[_0x1e3b('0x25')](function(_0x5b7c29){if(_0x5b7c29&&_0x5b7c29[_0x1e3b('0x88')]){var _0x1f5e61=_[_0x1e3b('0x49')](_0x5b7c29[_0x1e3b('0x88')],function(_0x73b34f){return _0x73b34f[_0x1e3b('0x89')]===_0x246640[_0x1e3b('0x70')];});if(!_0x1f5e61){logger[_0x1e3b('0x63')](util[_0x1e3b('0x2f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x35e632['params']['id'],_0x246640[_0x1e3b('0x70')]));return createBucket(_0x2bc984[_0x1e3b('0x86')],_0x2bc984['data2'],_0x246640[_0x1e3b('0x7c')],_0x246640[_0x1e3b('0x70')]);}logger['info'](util[_0x1e3b('0x2f')](_0x1e3b('0x8a'),_0x35e632['params']['id'],_0x246640[_0x1e3b('0x70')]));return;}})[_0x1e3b('0x25')](function(_0x533d95){if(_0x2c7154[_0x1e3b('0x77')]===_0x1e3b('0x8b')){return transcribe(_0x35e632['params']['id'],_0x2bc984[_0x1e3b('0x86')],_0x2bc984[_0x1e3b('0x87')],_0x246640['transcribeRegion'],_0x246640[_0x1e3b('0x70')],_0x2c7154[_0x1e3b('0x4d')],_0x246640['language']);}else{logger[_0x1e3b('0x63')](util[_0x1e3b('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x35e632[_0x1e3b('0x46')]['id']));return{'transcribeStatus':_0x1e3b('0x8c')};}})[_0x1e3b('0x25')](function(_0x3b87b0){if(_0x3b87b0){_0x3b87b0[_0x1e3b('0x8d')]=_0x35e632[_0x1e3b('0x48')]['runSentiment'];return _0x2c7154['updateAttributes'](_0x3b87b0);}})[_0x1e3b('0x25')](respondWithResult(_0x39918e,null))['catch'](handleError(_0x39918e,null));};function writeFile(_0x11eb40,_0xfa6338){return new Promise(function(_0x363cc8,_0x3cd62d){fs[_0x1e3b('0x8e')](_0xfa6338,_0x11eb40,function(_0x1211c2,_0x3bdf4e){if(_0x1211c2){return _0x3cd62d(_0x1211c2);}else{return _0x363cc8(_0x3bdf4e);}});});}exports[_0x1e3b('0x8f')]=function(_0x41bd22,_0x43adcb,_0x2ce063){return db[_0x1e3b('0x29')][_0x1e3b('0x79')]({'where':{'id':_0x41bd22['params']['id']}})[_0x1e3b('0x25')](handleEntityNotFound(_0x43adcb))['then'](function(_0x499fa6){if(_0x499fa6&&_0x499fa6[_0x1e3b('0x90')]){var _0x48b197=_0x499fa6[_0x1e3b('0x90')];var _0x3c6ed9=config[_0x1e3b('0x91')]+'/server/files/transcribes/transcribe_'+_0x499fa6['id']+_0x1e3b('0x92');if(fs[_0x1e3b('0x4f')](_0x3c6ed9)){return _0x3c6ed9;}return writeFile(_0x48b197,_0x3c6ed9)[_0x1e3b('0x25')](function(){return _0x3c6ed9;});}else{throw new db[(_0x1e3b('0x53'))]['ValidationError'](_0x1e3b('0x93'));}})['then'](function(_0x391dfd){return _0x43adcb[_0x1e3b('0x56')](_0x391dfd);})[_0x1e3b('0x44')](handleError(_0x43adcb));};
\ No newline at end of file
index 919d897..ec6badd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7896=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7896,0x127));var _0x6789=function(_0x45b36c,_0x4efbfe){_0x45b36c=_0x45b36c-0x0;var _0x1dad2f=_0x7896[_0x45b36c];return _0x1dad2f;};'use strict';var _=require(_0x6789('0x0'));var util=require(_0x6789('0x1'));var logger=require(_0x6789('0x2'))(_0x6789('0x3'));var moment=require(_0x6789('0x4'));var BPromise=require(_0x6789('0x5'));var rp=require(_0x6789('0x6'));var fs=require('fs');var path=require(_0x6789('0x7'));var rimraf=require(_0x6789('0x8'));var config=require(_0x6789('0x9'));var attributes=require(_0x6789('0xa'));module[_0x6789('0xb')]=function(_0x571fb4,_0x407ef2){return _0x571fb4[_0x6789('0xc')](_0x6789('0xd'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x6789('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd8f=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x1933ec,_0x3af28e){var _0x29a85c=function(_0x8b3053){while(--_0x8b3053){_0x1933ec['push'](_0x1933ec['shift']());}};_0x29a85c(++_0x3af28e);}(_0xdd8f,0x1ad));var _0xfdd8=function(_0xfe4b24,_0x397414){_0xfe4b24=_0xfe4b24-0x0;var _0xa70d40=_0xdd8f[_0xfe4b24];return _0xa70d40;};'use strict';var _=require(_0xfdd8('0x0'));var util=require(_0xfdd8('0x1'));var logger=require(_0xfdd8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfdd8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdd8('0x4'));var rimraf=require(_0xfdd8('0x5'));var config=require(_0xfdd8('0x6'));var attributes=require(_0xfdd8('0x7'));module[_0xfdd8('0x8')]=function(_0x4a7848,_0x5bc9dd){return _0x4a7848[_0xfdd8('0x9')](_0xfdd8('0xa'),attributes,{'tableName':_0xfdd8('0xb'),'paranoid':![],'indexes':[{'name':_0xfdd8('0xc'),'fields':[_0xfdd8('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 1def100..aa7c0ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','where','debug','Setting','findOne','existsSync','value','format','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1967,0x173));var _0x7196=function(_0x4231ba,_0x54351f){_0x4231ba=_0x4231ba-0x0;var _0x3df683=_0x1967[_0x4231ba];return _0x3df683;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});}exports[_0x7196('0x18')]=function(_0x32fe2b){var _0x385f2d=this;return new Promise(function(_0x5b716a,_0x4c4f91){return db[_0x7196('0x19')][_0x7196('0x1a')](_0x32fe2b[_0x7196('0x1b')],{'raw':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32fe2b['options']?_0x32fe2b[_0x7196('0x1c')][_0x7196('0x1d')]||null:null,'attributes':_0x32fe2b[_0x7196('0x1c')]?_0x32fe2b['options']['attributes']||null:null,'limit':_0x32fe2b[_0x7196('0x1c')]?_0x32fe2b[_0x7196('0x1c')]['limit']||null:null})[_0x7196('0xd')](function(_0x27ff84){logger[_0x7196('0xe')](_0x7196('0x18'),_0x32fe2b);logger[_0x7196('0x1e')]('UpdateVoiceRecording',_0x32fe2b,JSON[_0x7196('0x12')](_0x27ff84));_0x5b716a(_0x27ff84);})['catch'](function(_0x3ce9a0){logger[_0x7196('0x13')](_0x7196('0x18'),_0x3ce9a0[_0x7196('0x15')],_0x32fe2b);_0x4c4f91(_0x385f2d[_0x7196('0x13')](0x1f4,_0x3ce9a0[_0x7196('0x15')]));});});};exports['CreateVoiceRecording']=function(_0x57c404){var _0x1482e5=this;return new Promise(function(_0x2d284f,_0x184c09){var _0x4e878f=require('../../components/encryptor');var _0x41cfd2;return db[_0x7196('0x1f')][_0x7196('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x7196('0xd')](function(_0x4ecea1){_0x41cfd2=_0x4ecea1;return db[_0x7196('0x19')]['create'](_0x57c404[_0x7196('0x1b')]);})[_0x7196('0xd')](function(_0x1257ad){if(_0x41cfd2['callRecordingEncryption']&&fs[_0x7196('0x21')](_0x1257ad[_0x7196('0x22')])){var _0x2f9583=util[_0x7196('0x23')]('%s.cypher',_0x1257ad[_0x7196('0x22')]);return _0x4e878f[_0x7196('0x24')](_0x1257ad[_0x7196('0x22')],_0x2f9583,config[_0x7196('0x25')][_0x7196('0x26')])[_0x7196('0xd')](function(){fs[_0x7196('0x27')](_0x1257ad[_0x7196('0x22')]);logger[_0x7196('0xe')](_0x7196('0x28'));return _0x1257ad;});}return _0x1257ad;})[_0x7196('0xd')](function(_0x54e46b){logger[_0x7196('0xe')]('CreateVoiceRecording',_0x57c404);logger[_0x7196('0x1e')]('CreateVoiceRecording',_0x57c404,JSON[_0x7196('0x12')](_0x54e46b));_0x2d284f(_0x54e46b);})[_0x7196('0x17')](function(_0x5616ed){logger[_0x7196('0x13')](_0x7196('0x29'),_0x5616ed[_0x7196('0x15')],_0x57c404);_0x184c09(_0x1482e5[_0x7196('0x13')](0x1f4,_0x5616ed[_0x7196('0x15')]));});});};
\ No newline at end of file
+var _0x7bd0=['callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','VoiceRecording','update','body','options','raw','attributes','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x7bd0,0x111));var _0x07bd=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x7bd0[_0x119280];return _0x481797;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('VoiceRecording,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['UpdateVoiceRecording']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')](_0x3f9f0b[_0x07bd('0x1b')],{'raw':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['where']||null:null,'attributes':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['limit']||null:null})['then'](function(_0xbb7117){logger['info'](_0x07bd('0x1f'),_0x3f9f0b);logger['debug']('UpdateVoiceRecording',_0x3f9f0b,JSON[_0x07bd('0x13')](_0xbb7117));_0x4948f4(_0xbb7117);})[_0x07bd('0x18')](function(_0xf3b23c){logger[_0x07bd('0x14')](_0x07bd('0x1f'),_0xf3b23c[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0xf3b23c[_0x07bd('0x16')]));});});};exports[_0x07bd('0x20')]=function(_0x3db9d0){var _0x2a7202=this;return new Promise(function(_0x12ce26,_0x1c1fda){var _0x571dab=require('../../components/encryptor');var _0x5184dc;return db[_0x07bd('0x21')][_0x07bd('0x22')]({'attributes':['id',_0x07bd('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1a3aa9){_0x5184dc=_0x1a3aa9;return db[_0x07bd('0x19')][_0x07bd('0x24')](_0x3db9d0[_0x07bd('0x1b')]);})[_0x07bd('0xe')](function(_0x13bf6b){if(_0x5184dc['callRecordingEncryption']&&fs[_0x07bd('0x25')](_0x13bf6b[_0x07bd('0x26')])){var _0x4182b9=util[_0x07bd('0x27')](_0x07bd('0x28'),_0x13bf6b[_0x07bd('0x26')]);return _0x571dab[_0x07bd('0x29')](_0x13bf6b[_0x07bd('0x26')],_0x4182b9,config['secrets']['recording'])[_0x07bd('0xe')](function(){fs[_0x07bd('0x2a')](_0x13bf6b[_0x07bd('0x26')]);logger['info'](_0x07bd('0x2b'));return _0x13bf6b;});}return _0x13bf6b;})[_0x07bd('0xe')](function(_0x208aca){logger['info']('CreateVoiceRecording',_0x3db9d0);logger[_0x07bd('0x11')](_0x07bd('0x20'),_0x3db9d0,JSON[_0x07bd('0x13')](_0x208aca));_0x12ce26(_0x208aca);})[_0x07bd('0x18')](function(_0x5f29c5){logger[_0x07bd('0x14')](_0x07bd('0x20'),_0x5f29c5[_0x07bd('0x16')],_0x3db9d0);_0x1c1fda(_0x2a7202['error'](0x1f4,_0x5f29c5[_0x07bd('0x16')]));});});};
\ No newline at end of file
index 63bbb1b..057a930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2f8=['../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x5de5a3,_0x72d384){var _0x591c78=function(_0x361253){while(--_0x361253){_0x5de5a3['push'](_0x5de5a3['shift']());}};_0x591c78(++_0x72d384);}(_0xb2f8,0x13d));var _0x8b2f=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0xb2f8[_0x13f980];return _0x27153c;};'use strict';var multer=require(_0x8b2f('0x0'));var util=require(_0x8b2f('0x1'));var path=require(_0x8b2f('0x2'));var timeout=require(_0x8b2f('0x3'));var express=require('express');var router=express[_0x8b2f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8b2f('0x5'));var interaction=require(_0x8b2f('0x6'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x8b2f('0x7')](),controller[_0x8b2f('0x8')]);router['get'](_0x8b2f('0x9'),auth[_0x8b2f('0x7')](),controller[_0x8b2f('0xa')]);router[_0x8b2f('0xb')](_0x8b2f('0xc'),auth[_0x8b2f('0x7')](),controller[_0x8b2f('0xd')]);router['post']('/',auth[_0x8b2f('0x7')](),controller[_0x8b2f('0xe')]);router[_0x8b2f('0xf')](_0x8b2f('0xc'),auth['isAuthenticated'](),controller[_0x8b2f('0x10')]);router[_0x8b2f('0x11')](_0x8b2f('0xc'),auth[_0x8b2f('0x7')](),controller['destroy']);module[_0x8b2f('0x12')]=router;
\ No newline at end of file
+var _0xc83b=['describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index'];(function(_0x3ac463,_0x94bb9){var _0x499738=function(_0x194722){while(--_0x194722){_0x3ac463['push'](_0x3ac463['shift']());}};_0x499738(++_0x94bb9);}(_0xc83b,0x145));var _0xbc83=function(_0x4a0495,_0x38c733){_0x4a0495=_0x4a0495-0x0;var _0x2dc986=_0xc83b[_0x4a0495];return _0x2dc986;};'use strict';var multer=require(_0xbc83('0x0'));var util=require(_0xbc83('0x1'));var path=require('path');var timeout=require(_0xbc83('0x2'));var express=require('express');var router=express[_0xbc83('0x3')]();var fs_extra=require(_0xbc83('0x4'));var auth=require(_0xbc83('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbc83('0x6'));var controller=require(_0xbc83('0x7'));router[_0xbc83('0x8')]('/',auth[_0xbc83('0x9')](),controller[_0xbc83('0xa')]);router[_0xbc83('0x8')]('/describe',auth[_0xbc83('0x9')](),controller[_0xbc83('0xb')]);router[_0xbc83('0x8')]('/:id',auth[_0xbc83('0x9')](),controller[_0xbc83('0xc')]);router[_0xbc83('0xd')]('/',auth[_0xbc83('0x9')](),controller[_0xbc83('0xe')]);router[_0xbc83('0xf')](_0xbc83('0x10'),auth[_0xbc83('0x9')](),controller[_0xbc83('0x11')]);router[_0xbc83('0x12')](_0xbc83('0x10'),auth[_0xbc83('0x9')](),controller[_0xbc83('0x13')]);module[_0xbc83('0x14')]=router;
\ No newline at end of file
index 3e146c4..37e1970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58c0=['STRING','ENUM','Yes','sequelize','moment','exports','attended'];(function(_0x1d0184,_0x3fa782){var _0x364129=function(_0x14475f){while(--_0x14475f){_0x1d0184['push'](_0x1d0184['shift']());}};_0x364129(++_0x3fa782);}(_0x58c0,0x14c));var _0x058c=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x58c0[_0x44a64f];return _0x52024b;};'use strict';var Sequelize=require(_0x058c('0x0'));var moment=require(_0x058c('0x1'));module[_0x058c('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0x058c('0x3'))},'result':{'type':Sequelize[_0x058c('0x4')]},'transfererchannel':{'type':Sequelize[_0x058c('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x058c('0x4')]},'transferercalleridname':{'type':Sequelize[_0x058c('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x058c('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x058c('0x4')]},'transfererexten':{'type':Sequelize[_0x058c('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x058c('0x4')]},'transfereechannel':{'type':Sequelize[_0x058c('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x058c('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x058c('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x058c('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x058c('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x058c('0x4')]},'transfereecontext':{'type':Sequelize[_0x058c('0x4')]},'transfereeexten':{'type':Sequelize[_0x058c('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x058c('0x5')](_0x058c('0x6'),'No')},'context':{'type':Sequelize[_0x058c('0x4')]},'extension':{'type':Sequelize[_0x058c('0x4')]}};
\ No newline at end of file
+var _0x5fb9=['moment','exports','blind','attended','STRING','ENUM','sequelize'];(function(_0x36530c,_0x45a523){var _0x24ed93=function(_0x2a7e36){while(--_0x2a7e36){_0x36530c['push'](_0x36530c['shift']());}};_0x24ed93(++_0x45a523);}(_0x5fb9,0x99));var _0x95fb=function(_0x9e87ed,_0x4443c3){_0x9e87ed=_0x9e87ed-0x0;var _0xc7bdeb=_0x5fb9[_0x9e87ed];return _0xc7bdeb;};'use strict';var Sequelize=require(_0x95fb('0x0'));var moment=require(_0x95fb('0x1'));module[_0x95fb('0x2')]={'type':{'type':Sequelize['ENUM'](_0x95fb('0x3'),_0x95fb('0x4'))},'result':{'type':Sequelize[_0x95fb('0x5')]},'transfererchannel':{'type':Sequelize[_0x95fb('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x95fb('0x5')]},'transferercalleridname':{'type':Sequelize[_0x95fb('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x95fb('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x95fb('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x95fb('0x5')]},'transferercontext':{'type':Sequelize[_0x95fb('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x95fb('0x5')]},'transfereechannel':{'type':Sequelize[_0x95fb('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x95fb('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x95fb('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x95fb('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x95fb('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x95fb('0x5')]},'transfereeexten':{'type':Sequelize[_0x95fb('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x95fb('0x6')]('Yes','No')},'context':{'type':Sequelize[_0x95fb('0x5')]},'extension':{'type':Sequelize[_0x95fb('0x5')]}};
\ No newline at end of file
index 2b93234..0cbc519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff59=['update','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','VoiceTransferReport','rawAttributes','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body'];(function(_0x55ad9b,_0x139a41){var _0x34e3f2=function(_0x7fb760){while(--_0x7fb760){_0x55ad9b['push'](_0x55ad9b['shift']());}};_0x34e3f2(++_0x139a41);}(_0xff59,0x12e));var _0x9ff5=function(_0x3d45f8,_0x176603){_0x3d45f8=_0x3d45f8-0x0;var _0x44f74a=_0xff59[_0x3d45f8];return _0x44f74a;};'use strict';var emlformat=require(_0x9ff5('0x0'));var rimraf=require(_0x9ff5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ff5('0x2'));var rp=require('request-promise');var moment=require(_0x9ff5('0x3'));var BPromise=require(_0x9ff5('0x4'));var Mustache=require(_0x9ff5('0x5'));var util=require('util');var path=require(_0x9ff5('0x6'));var sox=require('sox');var csv=require(_0x9ff5('0x7'));var ejs=require(_0x9ff5('0x8'));var fs=require('fs');var fs_extra=require(_0x9ff5('0x9'));var _=require(_0x9ff5('0xa'));var squel=require('squel');var crypto=require(_0x9ff5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9ff5('0x7'));var querystring=require(_0x9ff5('0xc'));var Papa=require(_0x9ff5('0xd'));var Redis=require(_0x9ff5('0xe'));var authService=require(_0x9ff5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9ff5('0x10'));var hardwareService=require(_0x9ff5('0x11'));var logger=require(_0x9ff5('0x12'))(_0x9ff5('0x13'));var utils=require(_0x9ff5('0x14'));var config=require(_0x9ff5('0x15'));var licenseUtil=require(_0x9ff5('0x16'));var db=require(_0x9ff5('0x17'))['db'];function respondWithStatusCode(_0x52f8c5,_0x3488b9){_0x3488b9=_0x3488b9||0xcc;return function(_0x5d498b){if(_0x5d498b){return _0x52f8c5[_0x9ff5('0x18')](_0x3488b9);}return _0x52f8c5[_0x9ff5('0x19')](_0x3488b9)[_0x9ff5('0x1a')]();};}function respondWithResult(_0x568133,_0x2d7535){_0x2d7535=_0x2d7535||0xc8;return function(_0x51fd6f){if(_0x51fd6f){return _0x568133['status'](_0x2d7535)[_0x9ff5('0x1b')](_0x51fd6f);}};}function respondWithFilteredResult(_0x31e743,_0x2c314b){return function(_0x388d80){if(_0x388d80){var _0x293433=typeof _0x2c314b['offset']===_0x9ff5('0x1c')&&typeof _0x2c314b['limit']==='undefined';var _0x317239=_0x388d80[_0x9ff5('0x1d')];var _0x5b9f1a=_0x293433?0x0:_0x2c314b[_0x9ff5('0x1e')];var _0x2af477=_0x293433?_0x388d80['count']:_0x2c314b[_0x9ff5('0x1e')]+_0x2c314b['limit'];var _0x4ffb4d;if(_0x2af477>=_0x317239){_0x2af477=_0x317239;_0x4ffb4d=0xc8;}else{_0x4ffb4d=0xce;}_0x31e743[_0x9ff5('0x19')](_0x4ffb4d);return _0x31e743[_0x9ff5('0x1f')](_0x9ff5('0x20'),_0x5b9f1a+'-'+_0x2af477+'/'+_0x317239)[_0x9ff5('0x1b')](_0x388d80);}return null;};}function patchUpdates(_0x155294){return function(_0x52f8f6){try{jsonpatch[_0x9ff5('0x21')](_0x52f8f6,_0x155294,!![]);}catch(_0x25d8f0){return BPromise[_0x9ff5('0x22')](_0x25d8f0);}return _0x52f8f6[_0x9ff5('0x23')]();};}function saveUpdates(_0x1336cd,_0x590805){return function(_0x9e1e63){if(_0x9e1e63){return _0x9e1e63['update'](_0x1336cd)[_0x9ff5('0x24')](function(_0x51b1bb){return _0x51b1bb;});}return null;};}function removeEntity(_0x4d66b2,_0x4174a0){return function(_0x2ee593){if(_0x2ee593){return _0x2ee593[_0x9ff5('0x25')]()[_0x9ff5('0x24')](function(){_0x4d66b2[_0x9ff5('0x19')](0xcc)[_0x9ff5('0x1a')]();});}};}function handleEntityNotFound(_0xd6222e,_0x580ed8){return function(_0x2f518e){if(!_0x2f518e){_0xd6222e[_0x9ff5('0x18')](0x194);}return _0x2f518e;};}function handleError(_0x5606e6,_0xe42c58){_0xe42c58=_0xe42c58||0x1f4;return function(_0x287d1e){logger['error'](_0x287d1e[_0x9ff5('0x26')]);if(_0x287d1e['name']){delete _0x287d1e[_0x9ff5('0x27')];}_0x5606e6[_0x9ff5('0x19')](_0xe42c58)['send'](_0x287d1e);};}exports[_0x9ff5('0x28')]=function(_0x5d7af4,_0x1a908d){var _0x40cefa={},_0x37d0f6={},_0x44c5bb={'count':0x0,'rows':[]};var _0x404068=_['map'](db[_0x9ff5('0x29')][_0x9ff5('0x2a')],function(_0x6e184a){return{'name':_0x6e184a['fieldName'],'type':_0x6e184a[_0x9ff5('0x2b')][_0x9ff5('0x2c')]};});_0x37d0f6[_0x9ff5('0x2d')]=_[_0x9ff5('0x2e')](_0x404068,_0x9ff5('0x27'));_0x37d0f6['query']=_[_0x9ff5('0x2f')](_0x5d7af4[_0x9ff5('0x30')]);_0x37d0f6['filters']=_[_0x9ff5('0x31')](_0x37d0f6['model'],_0x37d0f6['query']);_0x40cefa[_0x9ff5('0x32')]=_[_0x9ff5('0x31')](_0x37d0f6['model'],qs[_0x9ff5('0x33')](_0x5d7af4[_0x9ff5('0x30')][_0x9ff5('0x33')]));_0x40cefa['attributes']=_0x40cefa['attributes'][_0x9ff5('0x34')]?_0x40cefa['attributes']:_0x37d0f6[_0x9ff5('0x2d')];if(!_0x5d7af4['query'][_0x9ff5('0x35')]('nolimit')){_0x40cefa[_0x9ff5('0x36')]=qs['limit'](_0x5d7af4[_0x9ff5('0x30')][_0x9ff5('0x36')]);_0x40cefa['offset']=qs[_0x9ff5('0x1e')](_0x5d7af4[_0x9ff5('0x30')][_0x9ff5('0x1e')]);}_0x40cefa[_0x9ff5('0x37')]=qs['sort'](_0x5d7af4[_0x9ff5('0x30')][_0x9ff5('0x38')]);_0x40cefa['where']=qs['filters'](_[_0x9ff5('0x39')](_0x5d7af4[_0x9ff5('0x30')],_0x37d0f6[_0x9ff5('0x3a')]),_0x404068);if(_0x5d7af4[_0x9ff5('0x30')][_0x9ff5('0x3b')]){_0x40cefa[_0x9ff5('0x3c')]=_[_0x9ff5('0x3d')](_0x40cefa[_0x9ff5('0x3c')],{'$or':_[_0x9ff5('0x2e')](_0x404068,function(_0x5c8111){if(_0x5c8111[_0x9ff5('0x2b')]!==_0x9ff5('0x3e')){var _0x5a2237={};_0x5a2237[_0x5c8111[_0x9ff5('0x27')]]={'$like':'%'+_0x5d7af4[_0x9ff5('0x30')][_0x9ff5('0x3b')]+'%'};return _0x5a2237;}})});}_0x40cefa=_[_0x9ff5('0x3d')]({},_0x40cefa,_0x5d7af4[_0x9ff5('0x3f')]);var _0x5536f4={'where':_0x40cefa[_0x9ff5('0x3c')]};return db['VoiceTransferReport'][_0x9ff5('0x1d')](_0x5536f4)[_0x9ff5('0x24')](function(_0x6052df){_0x44c5bb[_0x9ff5('0x1d')]=_0x6052df;if(_0x5d7af4[_0x9ff5('0x30')][_0x9ff5('0x40')]){_0x40cefa[_0x9ff5('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x40cefa);})[_0x9ff5('0x24')](function(_0x52a438){_0x44c5bb[_0x9ff5('0x42')]=_0x52a438;return _0x44c5bb;})[_0x9ff5('0x24')](respondWithFilteredResult(_0x1a908d,_0x40cefa))[_0x9ff5('0x43')](handleError(_0x1a908d,null));};exports[_0x9ff5('0x44')]=function(_0x3c3efa,_0x3f21da){var _0x2461a4={'raw':!![],'where':{'id':_0x3c3efa[_0x9ff5('0x45')]['id']}},_0x1fd323={};_0x1fd323[_0x9ff5('0x2d')]=_[_0x9ff5('0x2f')](db['VoiceTransferReport'][_0x9ff5('0x2a')]);_0x1fd323[_0x9ff5('0x30')]=_[_0x9ff5('0x2f')](_0x3c3efa['query']);_0x1fd323[_0x9ff5('0x3a')]=_[_0x9ff5('0x31')](_0x1fd323[_0x9ff5('0x2d')],_0x1fd323[_0x9ff5('0x30')]);_0x2461a4[_0x9ff5('0x32')]=_[_0x9ff5('0x31')](_0x1fd323[_0x9ff5('0x2d')],qs[_0x9ff5('0x33')](_0x3c3efa[_0x9ff5('0x30')][_0x9ff5('0x33')]));_0x2461a4[_0x9ff5('0x32')]=_0x2461a4[_0x9ff5('0x32')][_0x9ff5('0x34')]?_0x2461a4[_0x9ff5('0x32')]:_0x1fd323[_0x9ff5('0x2d')];if(_0x3c3efa[_0x9ff5('0x30')]['includeAll']){_0x2461a4['include']=[{'all':!![]}];}_0x2461a4=_[_0x9ff5('0x3d')]({},_0x2461a4,_0x3c3efa[_0x9ff5('0x3f')]);return db[_0x9ff5('0x29')][_0x9ff5('0x46')](_0x2461a4)[_0x9ff5('0x24')](handleEntityNotFound(_0x3f21da,null))['then'](respondWithResult(_0x3f21da,null))[_0x9ff5('0x43')](handleError(_0x3f21da,null));};exports[_0x9ff5('0x47')]=function(_0x29160f,_0x23c27a){return db[_0x9ff5('0x29')][_0x9ff5('0x47')](_0x29160f[_0x9ff5('0x48')],{})[_0x9ff5('0x24')](respondWithResult(_0x23c27a,0xc9))[_0x9ff5('0x43')](handleError(_0x23c27a,null));};exports[_0x9ff5('0x49')]=function(_0x1e73f8,_0x5f2389){if(_0x1e73f8[_0x9ff5('0x48')]['id']){delete _0x1e73f8[_0x9ff5('0x48')]['id'];}return db[_0x9ff5('0x29')][_0x9ff5('0x46')]({'where':{'id':_0x1e73f8[_0x9ff5('0x45')]['id']}})['then'](handleEntityNotFound(_0x5f2389,null))[_0x9ff5('0x24')](saveUpdates(_0x1e73f8[_0x9ff5('0x48')],null))['then'](respondWithResult(_0x5f2389,null))[_0x9ff5('0x43')](handleError(_0x5f2389,null));};exports[_0x9ff5('0x25')]=function(_0x42352d,_0x24430c){return db['VoiceTransferReport'][_0x9ff5('0x46')]({'where':{'id':_0x42352d[_0x9ff5('0x45')]['id']}})[_0x9ff5('0x24')](handleEntityNotFound(_0x24430c,null))[_0x9ff5('0x24')](removeEntity(_0x24430c,null))['catch'](handleError(_0x24430c,null));};exports[_0x9ff5('0x4a')]=function(_0xe81bd,_0x8f4fdc){return db[_0x9ff5('0x29')][_0x9ff5('0x4a')]()[_0x9ff5('0x24')](respondWithResult(_0x8f4fdc,null))[_0x9ff5('0x43')](handleError(_0x8f4fdc,null));};
\ No newline at end of file
+var _0x2b9a=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceTransferReport','catch','show','keys','includeAll','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel'];(function(_0xeb06b4,_0x1840e1){var _0x10226c=function(_0x15d2f9){while(--_0x15d2f9){_0xeb06b4['push'](_0xeb06b4['shift']());}};_0x10226c(++_0x1840e1);}(_0x2b9a,0x8b));var _0xa2b9=function(_0x2b505b,_0x27d646){_0x2b505b=_0x2b505b-0x0;var _0x17ce82=_0x2b9a[_0x2b505b];return _0x17ce82;};'use strict';var emlformat=require(_0xa2b9('0x0'));var rimraf=require(_0xa2b9('0x1'));var zipdir=require(_0xa2b9('0x2'));var jsonpatch=require(_0xa2b9('0x3'));var rp=require(_0xa2b9('0x4'));var moment=require('moment');var BPromise=require(_0xa2b9('0x5'));var Mustache=require(_0xa2b9('0x6'));var util=require(_0xa2b9('0x7'));var path=require(_0xa2b9('0x8'));var sox=require('sox');var csv=require(_0xa2b9('0x9'));var ejs=require(_0xa2b9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2b9('0xb'));var squel=require(_0xa2b9('0xc'));var crypto=require(_0xa2b9('0xd'));var jsforce=require(_0xa2b9('0xe'));var deskjs=require(_0xa2b9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa2b9('0x10'));var Papa=require(_0xa2b9('0x11'));var Redis=require('ioredis');var authService=require(_0xa2b9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa2b9('0x13'));var hardwareService=require(_0xa2b9('0x14'));var logger=require(_0xa2b9('0x15'))(_0xa2b9('0x16'));var utils=require(_0xa2b9('0x17'));var config=require(_0xa2b9('0x18'));var licenseUtil=require(_0xa2b9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18b4cb,_0x58cf51){_0x58cf51=_0x58cf51||0xcc;return function(_0x331f13){if(_0x331f13){return _0x18b4cb[_0xa2b9('0x1a')](_0x58cf51);}return _0x18b4cb['status'](_0x58cf51)[_0xa2b9('0x1b')]();};}function respondWithResult(_0x7a0eda,_0x183beb){_0x183beb=_0x183beb||0xc8;return function(_0x382332){if(_0x382332){return _0x7a0eda[_0xa2b9('0x1c')](_0x183beb)[_0xa2b9('0x1d')](_0x382332);}};}function respondWithFilteredResult(_0x5233a8,_0x2c4356){return function(_0x5c8191){if(_0x5c8191){var _0x94657c=typeof _0x2c4356[_0xa2b9('0x1e')]===_0xa2b9('0x1f')&&typeof _0x2c4356[_0xa2b9('0x20')]===_0xa2b9('0x1f');var _0x5861cd=_0x5c8191['count'];var _0x3fc1ea=_0x94657c?0x0:_0x2c4356[_0xa2b9('0x1e')];var _0x1bac39=_0x94657c?_0x5c8191[_0xa2b9('0x21')]:_0x2c4356[_0xa2b9('0x1e')]+_0x2c4356[_0xa2b9('0x20')];var _0x1de6d7;if(_0x1bac39>=_0x5861cd){_0x1bac39=_0x5861cd;_0x1de6d7=0xc8;}else{_0x1de6d7=0xce;}_0x5233a8[_0xa2b9('0x1c')](_0x1de6d7);return _0x5233a8['set']('Content-Range',_0x3fc1ea+'-'+_0x1bac39+'/'+_0x5861cd)[_0xa2b9('0x1d')](_0x5c8191);}return null;};}function patchUpdates(_0x5c307c){return function(_0x1949fb){try{jsonpatch[_0xa2b9('0x22')](_0x1949fb,_0x5c307c,!![]);}catch(_0x258467){return BPromise[_0xa2b9('0x23')](_0x258467);}return _0x1949fb[_0xa2b9('0x24')]();};}function saveUpdates(_0x17cba2,_0x18b0eb){return function(_0x1d324f){if(_0x1d324f){return _0x1d324f[_0xa2b9('0x25')](_0x17cba2)[_0xa2b9('0x26')](function(_0x5200bc){return _0x5200bc;});}return null;};}function removeEntity(_0x5b165f,_0x5c9d12){return function(_0x1a9e4b){if(_0x1a9e4b){return _0x1a9e4b[_0xa2b9('0x27')]()[_0xa2b9('0x26')](function(){_0x5b165f[_0xa2b9('0x1c')](0xcc)[_0xa2b9('0x1b')]();});}};}function handleEntityNotFound(_0x1ce091,_0x49e66f){return function(_0x45f4ba){if(!_0x45f4ba){_0x1ce091[_0xa2b9('0x1a')](0x194);}return _0x45f4ba;};}function handleError(_0xa20724,_0x48f9fe){_0x48f9fe=_0x48f9fe||0x1f4;return function(_0x2e06e2){logger[_0xa2b9('0x28')](_0x2e06e2[_0xa2b9('0x29')]);if(_0x2e06e2[_0xa2b9('0x2a')]){delete _0x2e06e2[_0xa2b9('0x2a')];}_0xa20724[_0xa2b9('0x1c')](_0x48f9fe)[_0xa2b9('0x2b')](_0x2e06e2);};}exports[_0xa2b9('0x2c')]=function(_0x32092e,_0x1511be){var _0x392358={},_0xe3b9b4={},_0x10750d={'count':0x0,'rows':[]};var _0x870eb5=_[_0xa2b9('0x2d')](db['VoiceTransferReport'][_0xa2b9('0x2e')],function(_0x4f6ff5){return{'name':_0x4f6ff5['fieldName'],'type':_0x4f6ff5[_0xa2b9('0x2f')][_0xa2b9('0x30')]};});_0xe3b9b4[_0xa2b9('0x31')]=_[_0xa2b9('0x2d')](_0x870eb5,'name');_0xe3b9b4[_0xa2b9('0x32')]=_['keys'](_0x32092e[_0xa2b9('0x32')]);_0xe3b9b4[_0xa2b9('0x33')]=_[_0xa2b9('0x34')](_0xe3b9b4[_0xa2b9('0x31')],_0xe3b9b4[_0xa2b9('0x32')]);_0x392358[_0xa2b9('0x35')]=_[_0xa2b9('0x34')](_0xe3b9b4[_0xa2b9('0x31')],qs[_0xa2b9('0x36')](_0x32092e[_0xa2b9('0x32')][_0xa2b9('0x36')]));_0x392358[_0xa2b9('0x35')]=_0x392358['attributes'][_0xa2b9('0x37')]?_0x392358[_0xa2b9('0x35')]:_0xe3b9b4['model'];if(!_0x32092e[_0xa2b9('0x32')][_0xa2b9('0x38')](_0xa2b9('0x39'))){_0x392358['limit']=qs[_0xa2b9('0x20')](_0x32092e[_0xa2b9('0x32')][_0xa2b9('0x20')]);_0x392358[_0xa2b9('0x1e')]=qs[_0xa2b9('0x1e')](_0x32092e['query']['offset']);}_0x392358['order']=qs[_0xa2b9('0x3a')](_0x32092e[_0xa2b9('0x32')]['sort']);_0x392358[_0xa2b9('0x3b')]=qs['filters'](_[_0xa2b9('0x3c')](_0x32092e[_0xa2b9('0x32')],_0xe3b9b4[_0xa2b9('0x33')]),_0x870eb5);if(_0x32092e[_0xa2b9('0x32')][_0xa2b9('0x3d')]){_0x392358[_0xa2b9('0x3b')]=_[_0xa2b9('0x3e')](_0x392358['where'],{'$or':_[_0xa2b9('0x2d')](_0x870eb5,function(_0x24fa5e){if(_0x24fa5e[_0xa2b9('0x2f')]!==_0xa2b9('0x3f')){var _0x229bd1={};_0x229bd1[_0x24fa5e['name']]={'$like':'%'+_0x32092e['query'][_0xa2b9('0x3d')]+'%'};return _0x229bd1;}})});}_0x392358=_['merge']({},_0x392358,_0x32092e[_0xa2b9('0x40')]);var _0x1ffa1f={'where':_0x392358[_0xa2b9('0x3b')]};return db[_0xa2b9('0x41')][_0xa2b9('0x21')](_0x1ffa1f)[_0xa2b9('0x26')](function(_0x285c67){_0x10750d[_0xa2b9('0x21')]=_0x285c67;if(_0x32092e[_0xa2b9('0x32')]['includeAll']){_0x392358['include']=[{'all':!![]}];}return db[_0xa2b9('0x41')]['findAll'](_0x392358);})[_0xa2b9('0x26')](function(_0x533349){_0x10750d['rows']=_0x533349;return _0x10750d;})[_0xa2b9('0x26')](respondWithFilteredResult(_0x1511be,_0x392358))[_0xa2b9('0x42')](handleError(_0x1511be,null));};exports[_0xa2b9('0x43')]=function(_0x364db4,_0x2a002f){var _0x4cb00f={'raw':!![],'where':{'id':_0x364db4['params']['id']}},_0x527680={};_0x527680[_0xa2b9('0x31')]=_['keys'](db[_0xa2b9('0x41')][_0xa2b9('0x2e')]);_0x527680['query']=_[_0xa2b9('0x44')](_0x364db4['query']);_0x527680[_0xa2b9('0x33')]=_[_0xa2b9('0x34')](_0x527680['model'],_0x527680[_0xa2b9('0x32')]);_0x4cb00f[_0xa2b9('0x35')]=_[_0xa2b9('0x34')](_0x527680['model'],qs[_0xa2b9('0x36')](_0x364db4[_0xa2b9('0x32')][_0xa2b9('0x36')]));_0x4cb00f[_0xa2b9('0x35')]=_0x4cb00f[_0xa2b9('0x35')][_0xa2b9('0x37')]?_0x4cb00f['attributes']:_0x527680[_0xa2b9('0x31')];if(_0x364db4[_0xa2b9('0x32')][_0xa2b9('0x45')]){_0x4cb00f[_0xa2b9('0x46')]=[{'all':!![]}];}_0x4cb00f=_['merge']({},_0x4cb00f,_0x364db4[_0xa2b9('0x40')]);return db[_0xa2b9('0x41')][_0xa2b9('0x47')](_0x4cb00f)[_0xa2b9('0x26')](handleEntityNotFound(_0x2a002f,null))['then'](respondWithResult(_0x2a002f,null))['catch'](handleError(_0x2a002f,null));};exports[_0xa2b9('0x48')]=function(_0xe16928,_0x8163f8){return db[_0xa2b9('0x41')]['create'](_0xe16928[_0xa2b9('0x49')],{})[_0xa2b9('0x26')](respondWithResult(_0x8163f8,0xc9))[_0xa2b9('0x42')](handleError(_0x8163f8,null));};exports['update']=function(_0x435b58,_0x19504c){if(_0x435b58[_0xa2b9('0x49')]['id']){delete _0x435b58[_0xa2b9('0x49')]['id'];}return db['VoiceTransferReport'][_0xa2b9('0x47')]({'where':{'id':_0x435b58[_0xa2b9('0x4a')]['id']}})[_0xa2b9('0x26')](handleEntityNotFound(_0x19504c,null))['then'](saveUpdates(_0x435b58[_0xa2b9('0x49')],null))['then'](respondWithResult(_0x19504c,null))[_0xa2b9('0x42')](handleError(_0x19504c,null));};exports[_0xa2b9('0x27')]=function(_0x3f61ba,_0x278d58){return db['VoiceTransferReport'][_0xa2b9('0x47')]({'where':{'id':_0x3f61ba[_0xa2b9('0x4a')]['id']}})[_0xa2b9('0x26')](handleEntityNotFound(_0x278d58,null))[_0xa2b9('0x26')](removeEntity(_0x278d58,null))[_0xa2b9('0x42')](handleError(_0x278d58,null));};exports[_0xa2b9('0x4b')]=function(_0x497be3,_0x283252){return db[_0xa2b9('0x41')][_0xa2b9('0x4b')]()[_0xa2b9('0x26')](respondWithResult(_0x283252,null))['catch'](handleError(_0x283252,null));};
\ No newline at end of file
index 135f2a8..51753b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29e4=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','api','bluebird'];(function(_0x589c08,_0x3ecfdc){var _0x529748=function(_0x4fd954){while(--_0x4fd954){_0x589c08['push'](_0x589c08['shift']());}};_0x529748(++_0x3ecfdc);}(_0x29e4,0xbb));var _0x429e=function(_0x3eaa32,_0x2b435c){_0x3eaa32=_0x3eaa32-0x0;var _0x3cde8b=_0x29e4[_0x3eaa32];return _0x3cde8b;};'use strict';var _=require(_0x429e('0x0'));var util=require(_0x429e('0x1'));var logger=require(_0x429e('0x2'))(_0x429e('0x3'));var moment=require('moment');var BPromise=require(_0x429e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x429e('0x5'));var rimraf=require(_0x429e('0x6'));var config=require(_0x429e('0x7'));var attributes=require(_0x429e('0x8'));module[_0x429e('0x9')]=function(_0x56a52d,_0xfbebd3){return _0x56a52d[_0x429e('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x429e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a65=['rimraf','../../config/environment','./voiceTransferReport.attributes','define','report_call_transfer','lodash','util','../../config/logger','api','request-promise'];(function(_0x5f2392,_0x45a5e7){var _0x574f39=function(_0x1f70d8){while(--_0x1f70d8){_0x5f2392['push'](_0x5f2392['shift']());}};_0x574f39(++_0x45a5e7);}(_0x4a65,0x181));var _0x54a6=function(_0x3b32f6,_0x450ee3){_0x3b32f6=_0x3b32f6-0x0;var _0x11f56c=_0x4a65[_0x3b32f6];return _0x11f56c;};'use strict';var _=require(_0x54a6('0x0'));var util=require(_0x54a6('0x1'));var logger=require(_0x54a6('0x2'))(_0x54a6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x54a6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54a6('0x5'));var config=require(_0x54a6('0x6'));var attributes=require(_0x54a6('0x7'));module['exports']=function(_0x3de963,_0x38a830){return _0x3de963[_0x54a6('0x8')]('VoiceTransferReport',attributes,{'tableName':_0x54a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c03313..0e2010f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7648=['client','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x390100,_0x26c823){var _0x494474=function(_0x25b046){while(--_0x25b046){_0x390100['push'](_0x390100['shift']());}};_0x494474(++_0x26c823);}(_0x7648,0xd9));var _0x8764=function(_0x210faf,_0x24465d){_0x210faf=_0x210faf-0x0;var _0x39dfeb=_0x7648[_0x210faf];return _0x39dfeb;};'use strict';var _=require(_0x8764('0x0'));var util=require(_0x8764('0x1'));var moment=require('moment');var BPromise=require(_0x8764('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8764('0x3'));var db=require(_0x8764('0x4'))['db'];var utils=require(_0x8764('0x5'));var logger=require('../../config/logger')(_0x8764('0x6'));var config=require(_0x8764('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8764('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23697d,_0x3a0330,_0x19a4e3){return new BPromise(function(_0x4585fd,_0xb4b813){return client['request'](_0x23697d,_0x19a4e3)[_0x8764('0x9')](function(_0x406fb5){logger['info'](_0x8764('0xa'),_0x3a0330,_0x8764('0xb'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3a0330,_0x8764('0xb'),JSON[_0x8764('0xc')](_0x406fb5));if(_0x406fb5[_0x8764('0xd')]){if(_0x406fb5[_0x8764('0xd')][_0x8764('0xe')]===0x1f4){logger[_0x8764('0xd')](_0x8764('0xa'),_0x3a0330,_0x406fb5[_0x8764('0xd')][_0x8764('0xf')]);return _0xb4b813(_0x406fb5[_0x8764('0xd')][_0x8764('0xf')]);}logger[_0x8764('0xd')](_0x8764('0xa'),_0x3a0330,_0x406fb5[_0x8764('0xd')]['message']);return _0x4585fd(_0x406fb5['error'][_0x8764('0xf')]);}else{logger[_0x8764('0x10')](_0x8764('0xa'),_0x3a0330,_0x8764('0xb'));_0x4585fd(_0x406fb5[_0x8764('0x11')][_0x8764('0xf')]);}})['catch'](function(_0x433544){logger[_0x8764('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x3a0330,_0x433544);_0xb4b813(_0x433544);});});}exports[_0x8764('0x12')]=function(_0x599ad1){var _0x2b388e=this;return new Promise(function(_0x5be0e7,_0x51d07b){return db[_0x8764('0x13')][_0x8764('0x14')](_0x599ad1[_0x8764('0x15')],{'raw':_0x599ad1[_0x8764('0x16')]?_0x599ad1[_0x8764('0x16')][_0x8764('0x17')]===undefined?!![]:![]:!![]})[_0x8764('0x9')](function(_0x3cba8f){logger['info']('CreateVoiceTransferReport',_0x599ad1);logger['debug'](_0x8764('0x12'),_0x599ad1,JSON[_0x8764('0xc')](_0x3cba8f));_0x5be0e7(_0x3cba8f);})[_0x8764('0x18')](function(_0x5f35d3){logger[_0x8764('0xd')](_0x8764('0x12'),_0x5f35d3['message'],_0x599ad1);_0x51d07b(_0x2b388e['error'](0x1f4,_0x5f35d3[_0x8764('0xf')]));});});};
\ No newline at end of file
+var _0x2a35=['VoiceTransferReport','create','options','raw','CreateVoiceTransferReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x55eaa9,_0x51228e){var _0x4e1c7e=function(_0x1f0999){while(--_0x1f0999){_0x55eaa9['push'](_0x55eaa9['shift']());}};_0x4e1c7e(++_0x51228e);}(_0x2a35,0x161));var _0x52a3=function(_0x11e444,_0x28f7dd){_0x11e444=_0x11e444-0x0;var _0xe20052=_0x2a35[_0x11e444];return _0xe20052;};'use strict';var _=require('lodash');var util=require(_0x52a3('0x0'));var moment=require('moment');var BPromise=require(_0x52a3('0x1'));var rs=require(_0x52a3('0x2'));var fs=require('fs');var Redis=require(_0x52a3('0x3'));var db=require(_0x52a3('0x4'))['db'];var utils=require(_0x52a3('0x5'));var logger=require(_0x52a3('0x6'))(_0x52a3('0x7'));var config=require('../../config/environment');var jayson=require(_0x52a3('0x8'));var client=jayson[_0x52a3('0x9')][_0x52a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12d4c2,_0x339ef9,_0x20ec02){return new BPromise(function(_0x5e8094,_0x4c3fe5){return client[_0x52a3('0xb')](_0x12d4c2,_0x20ec02)[_0x52a3('0xc')](function(_0x560b09){logger[_0x52a3('0xd')](_0x52a3('0xe'),_0x339ef9,_0x52a3('0xf'));logger[_0x52a3('0x10')](_0x52a3('0x11'),_0x339ef9,_0x52a3('0xf'),JSON[_0x52a3('0x12')](_0x560b09));if(_0x560b09[_0x52a3('0x13')]){if(_0x560b09[_0x52a3('0x13')][_0x52a3('0x14')]===0x1f4){logger[_0x52a3('0x13')](_0x52a3('0xe'),_0x339ef9,_0x560b09[_0x52a3('0x13')][_0x52a3('0x15')]);return _0x4c3fe5(_0x560b09[_0x52a3('0x13')][_0x52a3('0x15')]);}logger[_0x52a3('0x13')](_0x52a3('0xe'),_0x339ef9,_0x560b09[_0x52a3('0x13')][_0x52a3('0x15')]);return _0x5e8094(_0x560b09[_0x52a3('0x13')][_0x52a3('0x15')]);}else{logger[_0x52a3('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x339ef9,_0x52a3('0xf'));_0x5e8094(_0x560b09[_0x52a3('0x16')][_0x52a3('0x15')]);}})[_0x52a3('0x17')](function(_0x4d406d){logger[_0x52a3('0x13')](_0x52a3('0xe'),_0x339ef9,_0x4d406d);_0x4c3fe5(_0x4d406d);});});}exports['CreateVoiceTransferReport']=function(_0x4a4565){var _0x282902=this;return new Promise(function(_0x4d32f3,_0x4429d2){return db[_0x52a3('0x18')][_0x52a3('0x19')](_0x4a4565['body'],{'raw':_0x4a4565['options']?_0x4a4565[_0x52a3('0x1a')][_0x52a3('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1eb6e2){logger[_0x52a3('0xd')](_0x52a3('0x1c'),_0x4a4565);logger[_0x52a3('0x10')](_0x52a3('0x1c'),_0x4a4565,JSON[_0x52a3('0x12')](_0x1eb6e2));_0x4d32f3(_0x1eb6e2);})[_0x52a3('0x17')](function(_0xdf562f){logger[_0x52a3('0x13')]('CreateVoiceTransferReport',_0xdf562f['message'],_0x4a4565);_0x4429d2(_0x282902[_0x52a3('0x13')](0x1f4,_0xdf562f[_0x52a3('0x15')]));});});};
\ No newline at end of file
index 7578d6e..a3ff730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9726=['isAuthenticated','canUpdate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','/calls','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate'];(function(_0x5a223f,_0x169c45){var _0x2bfd02=function(_0x136d0c){while(--_0x136d0c){_0x5a223f['push'](_0x5a223f['shift']());}};_0x2bfd02(++_0x169c45);}(_0x9726,0x95));var _0x6972=function(_0x2135f7,_0x2ddcf2){_0x2135f7=_0x2135f7-0x0;var _0x343ebb=_0x9726[_0x2135f7];return _0x343ebb;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x6972('0x0'));var controller=require(_0x6972('0x1'));router[_0x6972('0x2')](_0x6972('0x3'),auth[_0x6972('0x4')](),auth[_0x6972('0x5')](),controller['originate']);router[_0x6972('0x2')](_0x6972('0x6'),auth['isAuthenticated'](),auth[_0x6972('0x5')](),controller[_0x6972('0x7')]);router[_0x6972('0x2')](_0x6972('0x8'),auth[_0x6972('0x4')](),auth[_0x6972('0x5')](),controller[_0x6972('0x9')]);router[_0x6972('0x2')](_0x6972('0xa'),auth[_0x6972('0x4')](),auth[_0x6972('0x5')](),controller[_0x6972('0xb')]);router[_0x6972('0x2')](_0x6972('0xc'),auth[_0x6972('0x4')](),auth[_0x6972('0x5')](),controller['unhold']);router[_0x6972('0x2')](_0x6972('0xd'),auth['isAuthenticated'](),auth[_0x6972('0x5')](),controller['calls']);router[_0x6972('0x2')](_0x6972('0xe'),auth[_0x6972('0x4')](),auth[_0x6972('0x5')](),controller[_0x6972('0xf')]);module[_0x6972('0x10')]=router;
\ No newline at end of file
+var _0x9c7e=['/answer','answer','hold','/unhold','unhold','calls','/transfer','transfer','exports','Router','../../components/auth/service','/originate','canUpdate','originate','post','/hangup','isAuthenticated','hangup'];(function(_0x2f57c6,_0x401f36){var _0x47b7c0=function(_0x24532f){while(--_0x24532f){_0x2f57c6['push'](_0x2f57c6['shift']());}};_0x47b7c0(++_0x401f36);}(_0x9c7e,0x129));var _0xe9c7=function(_0x31bca3,_0x209a1e){_0x31bca3=_0x31bca3-0x0;var _0x2f10ea=_0x9c7e[_0x31bca3];return _0x2f10ea;};'use strict';var express=require('express');var router=express[_0xe9c7('0x0')]();var auth=require(_0xe9c7('0x1'));var controller=require('./webbar.controller');router['post'](_0xe9c7('0x2'),auth['isAuthenticated'](),auth[_0xe9c7('0x3')](),controller[_0xe9c7('0x4')]);router[_0xe9c7('0x5')](_0xe9c7('0x6'),auth[_0xe9c7('0x7')](),auth[_0xe9c7('0x3')](),controller[_0xe9c7('0x8')]);router[_0xe9c7('0x5')](_0xe9c7('0x9'),auth[_0xe9c7('0x7')](),auth[_0xe9c7('0x3')](),controller[_0xe9c7('0xa')]);router[_0xe9c7('0x5')]('/hold',auth[_0xe9c7('0x7')](),auth[_0xe9c7('0x3')](),controller[_0xe9c7('0xb')]);router[_0xe9c7('0x5')](_0xe9c7('0xc'),auth['isAuthenticated'](),auth[_0xe9c7('0x3')](),controller[_0xe9c7('0xd')]);router[_0xe9c7('0x5')]('/calls',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xe9c7('0xe')]);router[_0xe9c7('0x5')](_0xe9c7('0xf'),auth[_0xe9c7('0x7')](),auth['canUpdate'](),controller[_0xe9c7('0x10')]);module[_0xe9c7('0x11')]=router;
\ No newline at end of file
index 81f6eab..78e650e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc7=['stringify','emit','log','handleError:','stack','name','send','status','NotFound','request','then','error','code','message','result','catch','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','hangup','hangup\x20fired:','userId','answer','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','calls','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','jayson/promise','client','http','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number'];(function(_0x2b66a8,_0x57e102){var _0x725551=function(_0x354448){while(--_0x354448){_0x2b66a8['push'](_0x2b66a8['shift']());}};_0x725551(++_0x57e102);}(_0x1cc7,0x15a));var _0x71cc=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0x1cc7[_0x35181c];return _0xe14bf9;};'use strict';var path=require(_0x71cc('0x0'));var fs=require('fs');var _=require(_0x71cc('0x1'));var db=require(_0x71cc('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x71cc('0x3'));var amiClient=jayson[_0x71cc('0x4')][_0x71cc('0x5')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require('ioredis');config[_0x71cc('0x6')]=_['defaults'](config[_0x71cc('0x6')],{'host':_0x71cc('0x7'),'port':0x18eb});var io=require(_0x71cc('0x8'))(new Redis(config[_0x71cc('0x6')]));var Schema=require(_0x71cc('0x9'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x71cc('0xa')]},'callNumber':{'type':_0x71cc('0xb'),'required':[!![],_0x71cc('0xc')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x71cc('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x71cc('0xd'),'required':[!![],_0x71cc('0xa')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x71cc('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x71cc('0xb'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x71cc('0xb'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x71cc('0xd'),'required':[!![],_0x71cc('0xa')]},'sessionId':{'type':_0x71cc('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x71cc('0xd'),'required':[!![],_0x71cc('0xa')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x71cc('0xd'),'required':[!![],_0x71cc('0xa')]}});var conferenceValidation=new Schema({'userId':{'type':_0x71cc('0xd'),'required':[!![],_0x71cc('0xa')]}});function emit(_0x3875b8,_0x14087c,_0x1e359d){logger['info'](_0x3875b8,_0x14087c,JSON[_0x71cc('0xe')](_0x1e359d));io['to'](_0x3875b8)[_0x71cc('0xf')](_0x14087c,_0x1e359d);}function handleError(_0x1a7d71){return function(_0x1d1da8){console[_0x71cc('0x10')](_0x71cc('0x11'),_0x1d1da8,_0x1d1da8 instanceof RangeError);logger['error'](_0x1d1da8[_0x71cc('0x12')]);if(_0x1d1da8 instanceof RangeError){if(_0x1d1da8[_0x71cc('0x13')]){delete _0x1d1da8['name'];}_0x1a7d71['status'](0x194)[_0x71cc('0x14')](_0x1d1da8);}else{if(_0x1d1da8[_0x71cc('0x13')]){delete _0x1d1da8[_0x71cc('0x13')];}_0x1a7d71[_0x71cc('0x15')](0x1f4)[_0x71cc('0x14')](_0x1d1da8);}};}function checkError(){return function(_0xccbfb){if(!_0xccbfb){throw new RangeError(_0x71cc('0x16'));}return _0xccbfb;};}function respondWithRpcPromise(_0x18683d,_0x4cfba0){return new BPromise(function(_0x1442ef,_0x109239){var _0x587a0b=amiClient;return _0x587a0b[_0x71cc('0x17')](_0x18683d,_0x4cfba0)[_0x71cc('0x18')](function(_0x38f58e){if(_0x38f58e[_0x71cc('0x19')]){if(_0x38f58e[_0x71cc('0x19')][_0x71cc('0x1a')]===0x1f4){return _0x109239(_0x38f58e['error'][_0x71cc('0x1b')]);}return _0x1442ef(_0x38f58e[_0x71cc('0x19')][_0x71cc('0x1b')]);}else{_0x1442ef(_0x38f58e[_0x71cc('0x1c')]);}})[_0x71cc('0x1d')](function(_0x5fa323){_0x109239(_0x5fa323);});});}function getAgent(_0x27b933){return db[_0x71cc('0x1e')][_0x71cc('0x1f')]({'where':{'id':_0x27b933,'role':'agent'}})[_0x71cc('0x18')](checkError());}function getAgentCheckSession(_0x43c155,_0x28e095){return new BPromise(function(_0x26becf,_0x20b093){var _0x1fa9c1=respondWithRpcPromise(_0x71cc('0x20'));var _0x9a7ca3=getAgent(_0x43c155);Promise[_0x71cc('0x21')]([_0x1fa9c1,_0x9a7ca3])[_0x71cc('0x18')](function(_0x30f94d){var _0x35f723=_0x30f94d[0x0];var _0x1d5805=_0x30f94d[0x1];var _0x2db9c9=_[_0x71cc('0x22')](_0x35f723[_0x71cc('0x23')],function(_0x4fa63e){return _0x4fa63e[_0x71cc('0x24')]==_0x1d5805['id']&&_0x4fa63e[_0x71cc('0x25')]==_0x28e095;});if(_0x2db9c9[_0x71cc('0x26')]==0x1){_0x26becf(_0x1d5805);}else{_0x20b093(new RangeError(_0x71cc('0x27')+_0x28e095+_0x71cc('0x28')));}});});}exports[_0x71cc('0x29')]=function(_0x4a44c1,_0x3110e3){logger[_0x71cc('0x2a')](_0x71cc('0x2b'),_0x4a44c1[_0x71cc('0x2c')]);var _0x3b11ba=originateValidation[_0x71cc('0x9')](_0x4a44c1[_0x71cc('0x2c')]);if(_0x3b11ba['length']>0x0){return _0x3110e3[_0x71cc('0x15')](0x190)['json'](_0x3b11ba);}var _0x5f3c24=_0x4a44c1[_0x71cc('0x2c')]['userId'];var _0x4fa34d=_0x4a44c1[_0x71cc('0x2c')]['callNumber'];var _0xf86f30=_0x4a44c1['body'][_0x71cc('0x2d')];var _0x1d8560=_0x4a44c1['body'][_0x71cc('0x2e')];return getAgent(_0x5f3c24)[_0x71cc('0x18')](function(_0x2ab9fb){logger[_0x71cc('0x2a')](_0x71cc('0x2f'),_0x2ab9fb[_0x71cc('0x13')]);emit(util[_0x71cc('0x30')](_0x71cc('0x31'),_0x2ab9fb[_0x71cc('0x13')]),_0x71cc('0x32'),{'callNumber':_0x4fa34d,'callerId':_0xf86f30,'callbackUrl':_0x1d8560});return _0x3110e3['status'](0xc8)[_0x71cc('0x33')]({'error':![],'message':'originate\x20executed!'});})[_0x71cc('0x1d')](handleError(_0x3110e3));};exports[_0x71cc('0x34')]=function(_0x3e9812,_0x9328e2){logger[_0x71cc('0x2a')](_0x71cc('0x35'),_0x3e9812['body']);var _0x38a701=hangupValidation['validate'](_0x3e9812[_0x71cc('0x2c')]);if(_0x38a701[_0x71cc('0x26')]>0x0){return _0x9328e2[_0x71cc('0x15')](0x190)['json'](_0x38a701);}var _0x588748=_0x3e9812['body'][_0x71cc('0x36')];var _0x33190b=_0x3e9812[_0x71cc('0x2c')][_0x71cc('0x25')];return getAgent(_0x588748)[_0x71cc('0x18')](function(_0x1e7e67){logger[_0x71cc('0x2a')](_0x71cc('0x2f'),_0x1e7e67[_0x71cc('0x13')]);emit(util[_0x71cc('0x30')](_0x71cc('0x31'),_0x1e7e67[_0x71cc('0x13')]),'webbar:hangup',{'sessionId':_0x33190b});return _0x9328e2[_0x71cc('0x15')](0xc8)[_0x71cc('0x33')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x9328e2));};exports[_0x71cc('0x37')]=function(_0x21492b,_0x490b46){logger[_0x71cc('0x2a')](_0x71cc('0x38'),_0x21492b[_0x71cc('0x2c')]);var _0x19d7c8=answerValidation[_0x71cc('0x9')](_0x21492b['body']);if(_0x19d7c8['length']>0x0){return _0x490b46['status'](0x190)[_0x71cc('0x33')](_0x19d7c8);}var _0x51c0e7=_0x21492b[_0x71cc('0x2c')][_0x71cc('0x36')];var _0x70cd0e=_0x21492b[_0x71cc('0x2c')][_0x71cc('0x25')];return getAgent(_0x51c0e7)[_0x71cc('0x18')](function(_0x383af4){logger[_0x71cc('0x2a')](_0x71cc('0x2f'),_0x383af4[_0x71cc('0x13')]);emit(util[_0x71cc('0x30')](_0x71cc('0x31'),_0x383af4[_0x71cc('0x13')]),'webbar:answer',{'sessionId':_0x70cd0e});return _0x490b46[_0x71cc('0x15')](0xc8)[_0x71cc('0x33')]({'error':![],'message':_0x71cc('0x39')});})['catch'](handleError(_0x490b46));};exports[_0x71cc('0x3a')]=function(_0x3478f1,_0x30cf8a){logger[_0x71cc('0x2a')](_0x71cc('0x3b'),_0x3478f1[_0x71cc('0x2c')]);var _0x14f645=holdValidation[_0x71cc('0x9')](_0x3478f1[_0x71cc('0x2c')]);if(_0x14f645[_0x71cc('0x26')]>0x0){return _0x30cf8a[_0x71cc('0x15')](0x190)[_0x71cc('0x33')](_0x14f645);}var _0x47cefc=_0x3478f1[_0x71cc('0x2c')][_0x71cc('0x36')];var _0x3050c6=_0x3478f1[_0x71cc('0x2c')][_0x71cc('0x25')];return getAgent(_0x47cefc)[_0x71cc('0x18')](function(_0x430387){logger['info'](_0x71cc('0x2f'),_0x430387[_0x71cc('0x13')]);emit(util['format'](_0x71cc('0x31'),_0x430387[_0x71cc('0x13')]),_0x71cc('0x3c'),{'sessionId':_0x3050c6});return _0x30cf8a[_0x71cc('0x15')](0xc8)[_0x71cc('0x33')]({'error':![],'message':_0x71cc('0x3d')});})[_0x71cc('0x1d')](handleError(_0x30cf8a));};exports[_0x71cc('0x3e')]=function(_0x3cf0bf,_0x1647ce){logger[_0x71cc('0x2a')]('unhold\x20fired:',_0x3cf0bf[_0x71cc('0x2c')]);var _0x4e5bba=unholdValidation[_0x71cc('0x9')](_0x3cf0bf['body']);if(_0x4e5bba[_0x71cc('0x26')]>0x0){return _0x1647ce[_0x71cc('0x15')](0x190)['json'](_0x4e5bba);}var _0x2cac03=_0x3cf0bf[_0x71cc('0x2c')]['userId'];var _0x3edacf=_0x3cf0bf[_0x71cc('0x2c')][_0x71cc('0x25')];return getAgent(_0x2cac03)[_0x71cc('0x18')](function(_0x3ac021){logger[_0x71cc('0x2a')](_0x71cc('0x2f'),_0x3ac021['name']);emit(util[_0x71cc('0x30')](_0x71cc('0x31'),_0x3ac021['name']),'webbar:unhold',{'sessionId':_0x3edacf});return _0x1647ce[_0x71cc('0x15')](0xc8)[_0x71cc('0x33')]({'error':![],'message':'unhold\x20executed!'});})[_0x71cc('0x1d')](handleError(_0x1647ce));};exports[_0x71cc('0x3f')]=function(_0x3a2a0a,_0x3dd56d){logger[_0x71cc('0x2a')](_0x71cc('0x40'),_0x3dd56d['body']);var _0x49cd24=callsValidation[_0x71cc('0x9')](_0x3a2a0a['body']);if(_0x49cd24['length']>0x0){return _0x3dd56d[_0x71cc('0x15')](0x190)['json'](_0x49cd24);}var _0x47de7b=_0x3a2a0a['body']['userId'];var _0x572c62=respondWithRpcPromise(_0x71cc('0x20'));var _0x4b5587=getAgent(_0x47de7b);return Promise['all']([_0x572c62,_0x4b5587])[_0x71cc('0x18')](function(_0xbf7295){var _0x37190f=_0xbf7295[0x0];var _0x98e79b=_0xbf7295[0x1];var _0x2b108e=_[_0x71cc('0x22')](_0x37190f['rows'],function(_0x5b5bd0){return _0x5b5bd0['UserId']==_0x98e79b['id'];});return _0x3dd56d[_0x71cc('0x15')](0xc8)[_0x71cc('0x33')]({'count':_0x2b108e[_0x71cc('0x26')],'rows':_0x2b108e});})[_0x71cc('0x1d')](handleError(_0x3dd56d));};exports[_0x71cc('0x41')]=function(_0x5b1560,_0xcd78b5){logger[_0x71cc('0x2a')]('conference\x20fired:',_0x5b1560['body']);var _0x349d62=conferenceValidation[_0x71cc('0x9')](_0x5b1560['body']);if(_0x349d62['length']>0x0){return _0xcd78b5[_0x71cc('0x15')](0x190)['json'](_0x349d62);}var _0x48735b=_0x5b1560[_0x71cc('0x2c')][_0x71cc('0x36')];return getAgent(_0x48735b)[_0x71cc('0x18')](function(_0x5ed6b9){logger[_0x71cc('0x2a')](_0x71cc('0x2f'),_0x5ed6b9[_0x71cc('0x13')]);emit(util['format']('user:%s',_0x5ed6b9['name']),_0x71cc('0x42'));return _0xcd78b5[_0x71cc('0x15')](0xc8)[_0x71cc('0x33')]({'error':![],'message':_0x71cc('0x43')});})[_0x71cc('0x1d')](handleError(_0xcd78b5));};exports[_0x71cc('0x44')]=function(_0x515d18,_0x48b10c){logger[_0x71cc('0x2a')](_0x71cc('0x45'),_0x515d18[_0x71cc('0x2c')]);var _0x1c60f0=transferValidation[_0x71cc('0x9')](_0x515d18[_0x71cc('0x2c')]);if(_0x1c60f0[_0x71cc('0x26')]>0x0){return _0x48b10c[_0x71cc('0x15')](0x190)[_0x71cc('0x33')](_0x1c60f0);}var _0x17ecd1=_0x515d18['body']['userId'];var _0x36944a=_0x515d18[_0x71cc('0x2c')][_0x71cc('0x25')];var _0x2d05b5=_0x515d18[_0x71cc('0x2c')][_0x71cc('0x46')];return getAgent(_0x17ecd1)[_0x71cc('0x18')](function(_0x2f89b1){logger[_0x71cc('0x2a')]('entityFound:',_0x2f89b1[_0x71cc('0x13')]);emit(util[_0x71cc('0x30')](_0x71cc('0x31'),_0x2f89b1[_0x71cc('0x13')]),'webbar:transfer',{'sessionId':_0x36944a,'transferNumber':_0x2d05b5});return _0x48b10c['status'](0xc8)[_0x71cc('0x33')]({'error':![],'message':_0x71cc('0x47')});})[_0x71cc('0x1d')](handleError(_0x48b10c));};
\ No newline at end of file
+var _0x222f=['json','userId','callNumber','callbackUrl','entityFound:','format','originate\x20executed!','hangup','sessionId','user:%s','answer','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','jayson/promise','client','http','../../config/logger','ioredis','defaults','redis','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','validate','body'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x222f,0x1a4));var _0xf222=function(_0x546ab6,_0x357f23){_0x546ab6=_0x546ab6-0x0;var _0x3952ca=_0x222f[_0x546ab6];return _0x3952ca;};'use strict';var path=require(_0xf222('0x0'));var fs=require('fs');var _=require(_0xf222('0x1'));var db=require(_0xf222('0x2'))['db'];var config=require(_0xf222('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xf222('0x4'));var amiClient=jayson[_0xf222('0x5')][_0xf222('0x6')]({'port':0x232a});var logger=require(_0xf222('0x7'))('webbarapi');var Redis=require(_0xf222('0x8'));config['redis']=_[_0xf222('0x9')](config[_0xf222('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xf222('0xb'))(new Redis(config[_0xf222('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xf222('0xc'),'required':[!![],_0xf222('0xd')]},'callNumber':{'type':_0xf222('0xe'),'required':[!![],_0xf222('0xf')]},'callerId':{'type':_0xf222('0xe')},'callbackUrl':{'type':_0xf222('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf222('0xd')]},'sessionId':{'type':_0xf222('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf222('0xc'),'required':[!![],_0xf222('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf222('0xc'),'required':[!![],_0xf222('0xd')]},'sessionId':{'type':_0xf222('0xe'),'required':[!![],_0xf222('0x10')]},'transferNumber':{'type':_0xf222('0xe'),'required':[!![],_0xf222('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf222('0xc'),'required':[!![],_0xf222('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf222('0xd')]},'sessionId':{'type':_0xf222('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf222('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0xf222('0xc'),'required':[!![],_0xf222('0xd')]}});function emit(_0x4392a0,_0x464060,_0x25e1c2){logger[_0xf222('0x12')](_0x4392a0,_0x464060,JSON['stringify'](_0x25e1c2));io['to'](_0x4392a0)[_0xf222('0x13')](_0x464060,_0x25e1c2);}function handleError(_0x823314){return function(_0x8783ab){console[_0xf222('0x14')](_0xf222('0x15'),_0x8783ab,_0x8783ab instanceof RangeError);logger[_0xf222('0x16')](_0x8783ab[_0xf222('0x17')]);if(_0x8783ab instanceof RangeError){if(_0x8783ab['name']){delete _0x8783ab[_0xf222('0x18')];}_0x823314[_0xf222('0x19')](0x194)[_0xf222('0x1a')](_0x8783ab);}else{if(_0x8783ab[_0xf222('0x18')]){delete _0x8783ab['name'];}_0x823314['status'](0x1f4)[_0xf222('0x1a')](_0x8783ab);}};}function checkError(){return function(_0x3e8875){if(!_0x3e8875){throw new RangeError(_0xf222('0x1b'));}return _0x3e8875;};}function respondWithRpcPromise(_0x33406d,_0x35539d){return new BPromise(function(_0x151a89,_0x51b872){var _0x176b20=amiClient;return _0x176b20[_0xf222('0x1c')](_0x33406d,_0x35539d)[_0xf222('0x1d')](function(_0x12d443){if(_0x12d443[_0xf222('0x16')]){if(_0x12d443[_0xf222('0x16')][_0xf222('0x1e')]===0x1f4){return _0x51b872(_0x12d443[_0xf222('0x16')]['message']);}return _0x151a89(_0x12d443[_0xf222('0x16')][_0xf222('0x1f')]);}else{_0x151a89(_0x12d443[_0xf222('0x20')]);}})[_0xf222('0x21')](function(_0x4305e0){_0x51b872(_0x4305e0);});});}function getAgent(_0x3e2a1c){return db[_0xf222('0x22')][_0xf222('0x23')]({'where':{'id':_0x3e2a1c,'role':_0xf222('0x24')}})[_0xf222('0x1d')](checkError());}function getAgentCheckSession(_0x2a8310,_0x501f8e){return new BPromise(function(_0x14b2b1,_0x1c5cd3){var _0x3d5508=respondWithRpcPromise(_0xf222('0x25'));var _0xe41039=getAgent(_0x2a8310);Promise[_0xf222('0x26')]([_0x3d5508,_0xe41039])[_0xf222('0x1d')](function(_0x1b928b){var _0x1e87ec=_0x1b928b[0x0];var _0x59721a=_0x1b928b[0x1];var _0x3bdf98=_[_0xf222('0x27')](_0x1e87ec[_0xf222('0x28')],function(_0x53a382){return _0x53a382[_0xf222('0x29')]==_0x59721a['id']&&_0x53a382['sessionId']==_0x501f8e;});if(_0x3bdf98[_0xf222('0x2a')]==0x1){_0x14b2b1(_0x59721a);}else{_0x1c5cd3(new RangeError(_0xf222('0x2b')+_0x501f8e+_0xf222('0x2c')));}});});}exports[_0xf222('0x2d')]=function(_0x37b4f7,_0x152d79){logger[_0xf222('0x12')]('originate\x20fired:',_0x37b4f7['body']);var _0x439c2f=originateValidation[_0xf222('0x2e')](_0x37b4f7[_0xf222('0x2f')]);if(_0x439c2f[_0xf222('0x2a')]>0x0){return _0x152d79[_0xf222('0x19')](0x190)[_0xf222('0x30')](_0x439c2f);}var _0x4e6a5e=_0x37b4f7[_0xf222('0x2f')][_0xf222('0x31')];var _0x13324a=_0x37b4f7['body'][_0xf222('0x32')];var _0x22ca97=_0x37b4f7[_0xf222('0x2f')]['callerId'];var _0x226d84=_0x37b4f7[_0xf222('0x2f')][_0xf222('0x33')];return getAgent(_0x4e6a5e)['then'](function(_0x3acea1){logger[_0xf222('0x12')](_0xf222('0x34'),_0x3acea1[_0xf222('0x18')]);emit(util[_0xf222('0x35')]('user:%s',_0x3acea1[_0xf222('0x18')]),'webbar:originate',{'callNumber':_0x13324a,'callerId':_0x22ca97,'callbackUrl':_0x226d84});return _0x152d79[_0xf222('0x19')](0xc8)[_0xf222('0x30')]({'error':![],'message':_0xf222('0x36')});})['catch'](handleError(_0x152d79));};exports[_0xf222('0x37')]=function(_0x3d70b0,_0x54a10d){logger[_0xf222('0x12')]('hangup\x20fired:',_0x3d70b0[_0xf222('0x2f')]);var _0x1b2f78=hangupValidation[_0xf222('0x2e')](_0x3d70b0['body']);if(_0x1b2f78[_0xf222('0x2a')]>0x0){return _0x54a10d[_0xf222('0x19')](0x190)[_0xf222('0x30')](_0x1b2f78);}var _0x2cacca=_0x3d70b0[_0xf222('0x2f')][_0xf222('0x31')];var _0x51154b=_0x3d70b0[_0xf222('0x2f')][_0xf222('0x38')];return getAgent(_0x2cacca)['then'](function(_0x49cad2){logger[_0xf222('0x12')]('entityFound:',_0x49cad2[_0xf222('0x18')]);emit(util[_0xf222('0x35')](_0xf222('0x39'),_0x49cad2[_0xf222('0x18')]),'webbar:hangup',{'sessionId':_0x51154b});return _0x54a10d['status'](0xc8)[_0xf222('0x30')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x54a10d));};exports[_0xf222('0x3a')]=function(_0x278fb8,_0x153597){logger[_0xf222('0x12')](_0xf222('0x3b'),_0x278fb8[_0xf222('0x2f')]);var _0x5c60e6=answerValidation[_0xf222('0x2e')](_0x278fb8[_0xf222('0x2f')]);if(_0x5c60e6['length']>0x0){return _0x153597[_0xf222('0x19')](0x190)[_0xf222('0x30')](_0x5c60e6);}var _0x56a5f0=_0x278fb8[_0xf222('0x2f')]['userId'];var _0x149589=_0x278fb8[_0xf222('0x2f')][_0xf222('0x38')];return getAgent(_0x56a5f0)[_0xf222('0x1d')](function(_0x3a3185){logger[_0xf222('0x12')](_0xf222('0x34'),_0x3a3185[_0xf222('0x18')]);emit(util[_0xf222('0x35')](_0xf222('0x39'),_0x3a3185[_0xf222('0x18')]),'webbar:answer',{'sessionId':_0x149589});return _0x153597['status'](0xc8)['json']({'error':![],'message':_0xf222('0x3c')});})[_0xf222('0x21')](handleError(_0x153597));};exports[_0xf222('0x3d')]=function(_0x3cf89b,_0x5a0763){logger[_0xf222('0x12')](_0xf222('0x3e'),_0x3cf89b[_0xf222('0x2f')]);var _0x2841a2=holdValidation['validate'](_0x3cf89b[_0xf222('0x2f')]);if(_0x2841a2[_0xf222('0x2a')]>0x0){return _0x5a0763[_0xf222('0x19')](0x190)[_0xf222('0x30')](_0x2841a2);}var _0x1d60e5=_0x3cf89b[_0xf222('0x2f')][_0xf222('0x31')];var _0x7a8ea9=_0x3cf89b[_0xf222('0x2f')][_0xf222('0x38')];return getAgent(_0x1d60e5)['then'](function(_0x5d0d70){logger[_0xf222('0x12')]('entityFound:',_0x5d0d70[_0xf222('0x18')]);emit(util['format'](_0xf222('0x39'),_0x5d0d70['name']),_0xf222('0x3f'),{'sessionId':_0x7a8ea9});return _0x5a0763[_0xf222('0x19')](0xc8)[_0xf222('0x30')]({'error':![],'message':_0xf222('0x40')});})['catch'](handleError(_0x5a0763));};exports[_0xf222('0x41')]=function(_0x34fd50,_0x380642){logger[_0xf222('0x12')](_0xf222('0x42'),_0x34fd50[_0xf222('0x2f')]);var _0xe3809c=unholdValidation[_0xf222('0x2e')](_0x34fd50[_0xf222('0x2f')]);if(_0xe3809c[_0xf222('0x2a')]>0x0){return _0x380642[_0xf222('0x19')](0x190)[_0xf222('0x30')](_0xe3809c);}var _0x4aa98c=_0x34fd50['body'][_0xf222('0x31')];var _0x28c5d1=_0x34fd50[_0xf222('0x2f')][_0xf222('0x38')];return getAgent(_0x4aa98c)[_0xf222('0x1d')](function(_0x1be64c){logger[_0xf222('0x12')](_0xf222('0x34'),_0x1be64c[_0xf222('0x18')]);emit(util[_0xf222('0x35')](_0xf222('0x39'),_0x1be64c['name']),'webbar:unhold',{'sessionId':_0x28c5d1});return _0x380642[_0xf222('0x19')](0xc8)[_0xf222('0x30')]({'error':![],'message':_0xf222('0x43')});})[_0xf222('0x21')](handleError(_0x380642));};exports[_0xf222('0x44')]=function(_0x6eb194,_0x22bc07){logger[_0xf222('0x12')](_0xf222('0x45'),_0x22bc07[_0xf222('0x2f')]);var _0x32ec77=callsValidation[_0xf222('0x2e')](_0x6eb194[_0xf222('0x2f')]);if(_0x32ec77[_0xf222('0x2a')]>0x0){return _0x22bc07['status'](0x190)[_0xf222('0x30')](_0x32ec77);}var _0x5ee917=_0x6eb194[_0xf222('0x2f')][_0xf222('0x31')];var _0x2c9222=respondWithRpcPromise(_0xf222('0x25'));var _0x5dc3fa=getAgent(_0x5ee917);return Promise['all']([_0x2c9222,_0x5dc3fa])[_0xf222('0x1d')](function(_0x2fc98a){var _0x29eaa9=_0x2fc98a[0x0];var _0xd092fc=_0x2fc98a[0x1];var _0x356746=_['filter'](_0x29eaa9[_0xf222('0x28')],function(_0x497994){return _0x497994[_0xf222('0x29')]==_0xd092fc['id'];});return _0x22bc07[_0xf222('0x19')](0xc8)['json']({'count':_0x356746[_0xf222('0x2a')],'rows':_0x356746});})['catch'](handleError(_0x22bc07));};exports[_0xf222('0x46')]=function(_0x2b6181,_0x41469e){logger['info'](_0xf222('0x47'),_0x2b6181[_0xf222('0x2f')]);var _0x434e8e=conferenceValidation[_0xf222('0x2e')](_0x2b6181[_0xf222('0x2f')]);if(_0x434e8e[_0xf222('0x2a')]>0x0){return _0x41469e[_0xf222('0x19')](0x190)['json'](_0x434e8e);}var _0x286355=_0x2b6181[_0xf222('0x2f')]['userId'];return getAgent(_0x286355)['then'](function(_0x5befb8){logger[_0xf222('0x12')](_0xf222('0x34'),_0x5befb8[_0xf222('0x18')]);emit(util[_0xf222('0x35')]('user:%s',_0x5befb8[_0xf222('0x18')]),'webbar:conference');return _0x41469e[_0xf222('0x19')](0xc8)[_0xf222('0x30')]({'error':![],'message':_0xf222('0x48')});})[_0xf222('0x21')](handleError(_0x41469e));};exports[_0xf222('0x49')]=function(_0x369b85,_0x3bb273){logger[_0xf222('0x12')](_0xf222('0x4a'),_0x369b85['body']);var _0x4e7d09=transferValidation[_0xf222('0x2e')](_0x369b85['body']);if(_0x4e7d09[_0xf222('0x2a')]>0x0){return _0x3bb273[_0xf222('0x19')](0x190)[_0xf222('0x30')](_0x4e7d09);}var _0x5e14f1=_0x369b85[_0xf222('0x2f')]['userId'];var _0x3dbda2=_0x369b85[_0xf222('0x2f')][_0xf222('0x38')];var _0x476655=_0x369b85['body'][_0xf222('0x4b')];return getAgent(_0x5e14f1)[_0xf222('0x1d')](function(_0x3c6cda){logger[_0xf222('0x12')](_0xf222('0x34'),_0x3c6cda[_0xf222('0x18')]);emit(util[_0xf222('0x35')](_0xf222('0x39'),_0x3c6cda[_0xf222('0x18')]),_0xf222('0x4c'),{'sessionId':_0x3dbda2,'transferNumber':_0x476655});return _0x3bb273['status'](0xc8)[_0xf222('0x30')]({'error':![],'message':_0xf222('0x4d')});})[_0xf222('0x21')](handleError(_0x3bb273));};
\ No newline at end of file
index 034255f..5705619 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_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('./whatsappAccount.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('0x7')](_0xee2f('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0xee2f('0x8')](),controller['getAnswers']);router['get']('/:id/users',auth[_0xee2f('0x8')](),controller[_0xee2f('0xd')]);router[_0xee2f('0x7')](_0xee2f('0xe'),auth[_0xee2f('0x8')](),controller[_0xee2f('0xf')]);router['post']('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0x10')](_0xee2f('0xc'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router[_0xee2f('0x10')](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x13')]);router['post'](_0xee2f('0x14'),auth['isAuthenticated'](),controller[_0xee2f('0x15')]);router[_0xee2f('0x10')]('/:id/applications',auth['isAuthenticated'](),controller[_0xee2f('0x16')]);router['post'](_0xee2f('0x17'),controller[_0xee2f('0x18')]);router[_0xee2f('0x10')]('/:id/send',auth[_0xee2f('0x8')](),controller[_0xee2f('0x19')]);router[_0xee2f('0x1a')](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['update']);router['delete'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1b')]);router[_0xee2f('0x1c')](_0xee2f('0xc'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1d')]);router['delete'](_0xee2f('0x12'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1e')]);router[_0xee2f('0x1c')](_0xee2f('0x14'),auth[_0xee2f('0x8')](),controller[_0xee2f('0x1f')]);module[_0xee2f('0x20')]=router;
\ No newline at end of file
+var _0xef0f=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','removeAnswers','exports'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xef0f,0x168));var _0xfef0=function(_0x38ceec,_0x18526c){_0x38ceec=_0x38ceec-0x0;var _0x21956e=_0xef0f[_0x38ceec];return _0x21956e;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0x8')](_0xfef0('0xf'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x8')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x8')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller['getAgents']);router[_0xfef0('0x8')](_0xfef0('0x14'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x15')]);router[_0xfef0('0x16')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x17')]);router['post'](_0xfef0('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x18')]);router[_0xfef0('0x16')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x19')]);router[_0xfef0('0x16')]('/:id/applications',auth[_0xfef0('0x9')](),controller[_0xfef0('0x1a')]);router[_0xfef0('0x16')](_0xfef0('0x1b'),controller[_0xfef0('0x1c')]);router['post'](_0xfef0('0x1d'),auth['isAuthenticated'](),controller[_0xfef0('0x1e')]);router[_0xfef0('0x1f')](_0xfef0('0xd'),auth['isAuthenticated'](),controller[_0xfef0('0x20')]);router['delete'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0xfef0('0x9')](),controller['removeDispositions']);router[_0xfef0('0x21')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x22')]);router[_0xfef0('0x21')](_0xfef0('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xfef0('0x23')]=router;
\ No newline at end of file
index 8433a27..a7d5ce8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb4d=['mandatoryDisposition','sequelize','STRING','name','generate','ENUM','twilio','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue'];(function(_0x1fd76e,_0x142f88){var _0x133c11=function(_0x160eae){while(--_0x160eae){_0x1fd76e['push'](_0x1fd76e['shift']());}};_0x133c11(++_0x142f88);}(_0xeb4d,0x139));var _0xdeb4=function(_0xae2b2,_0x40a399){_0xae2b2=_0xae2b2-0x0;var _0x5e7339=_0xeb4d[_0xae2b2];return _0x5e7339;};'use strict';var Sequelize=require(_0xdeb4('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xdeb4('0x1')],'unique':_0xdeb4('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xdeb4('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xdeb4('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xdeb4('0x1')],'defaultValue':function(){return rs[_0xdeb4('0x3')]();}},'phone':{'type':Sequelize[_0xdeb4('0x1')]},'type':{'type':Sequelize[_0xdeb4('0x4')](_0xdeb4('0x5'))},'accountSid':{'type':Sequelize[_0xdeb4('0x1')]},'authToken':{'type':Sequelize[_0xdeb4('0x1')]},'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[_0xdeb4('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xdeb4('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdeb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdeb4('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdeb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdeb4('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdeb4('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdeb4('0x7')],'comment':_0xdeb4('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xdeb4('0x9'),'set':function(_0x578e63){if(!_0x578e63){this['setDataValue'](_0xdeb4('0xa'),null);}this[_0xdeb4('0xb')](_0xdeb4('0xc'),_0x578e63);}},'description':{'type':Sequelize[_0xdeb4('0x1')]}};
\ No newline at end of file
+var _0x4743=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','TEXT'];(function(_0x31b88d,_0x32e9ef){var _0x1128c9=function(_0x243665){while(--_0x243665){_0x31b88d['push'](_0x31b88d['shift']());}};_0x1128c9(++_0x32e9ef);}(_0x4743,0x123));var _0x3474=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x4743[_0x15ec4e];return _0xb5e5dd;};'use strict';var Sequelize=require(_0x3474('0x0'));var rs=require(_0x3474('0x1'));module[_0x3474('0x2')]={'name':{'type':Sequelize[_0x3474('0x3')],'unique':_0x3474('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x3474('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x3474('0x3')],'defaultValue':function(){return rs[_0x3474('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3474('0x6')](_0x3474('0x7'))},'accountSid':{'type':Sequelize[_0x3474('0x3')]},'authToken':{'type':Sequelize[_0x3474('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3474('0x8')],'defaultValue':function(){return _0x3474('0x9');}},'notificationSound':{'type':Sequelize[_0x3474('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3474('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3474('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3474('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3474('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3474('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3474('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3474('0xa')],'defaultValue':![],'comment':_0x3474('0xc'),'set':function(_0x339574){if(!_0x339574){this['setDataValue'](_0x3474('0xd'),null);}this['setDataValue'](_0x3474('0xe'),_0x339574);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1b5eefd..866cf28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf89a=['account','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','mobile','From','replace','whatsapp:','Body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','defaults','WhatsappInteraction','interaction','autoclose','push','unmanaged','*,*,*,*','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./whatsappAccount.socket','register','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','WhatsappAccounts','destroy','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','WhatsappAccountId','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','isArray','User','getAgents','sequelize','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','applications','orderBy','asc'];(function(_0x2260fc,_0x473e02){var _0x52d9d1=function(_0x1100be){while(--_0x1100be){_0x2260fc['push'](_0x2260fc['shift']());}};_0x52d9d1(++_0x473e02);}(_0xf89a,0xe3));var _0xaf89=function(_0x36610c,_0x74ef0f){_0x36610c=_0x36610c-0x0;var _0x4f6392=_0xf89a[_0x36610c];return _0x4f6392;};'use strict';var emlformat=require(_0xaf89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf89('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf89('0x2'));var moment=require(_0xaf89('0x3'));var BPromise=require(_0xaf89('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaf89('0x5'));var sox=require(_0xaf89('0x6'));var csv=require(_0xaf89('0x7'));var ejs=require(_0xaf89('0x8'));var fs=require('fs');var fs_extra=require(_0xaf89('0x9'));var _=require('lodash');var squel=require(_0xaf89('0xa'));var crypto=require('crypto');var jsforce=require(_0xaf89('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaf89('0x7'));var querystring=require(_0xaf89('0xc'));var Papa=require(_0xaf89('0xd'));var Redis=require(_0xaf89('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xaf89('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf89('0x10'))(_0xaf89('0x11'));var utils=require(_0xaf89('0x12'));var config=require(_0xaf89('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf89('0x14'))['db'];config[_0xaf89('0x15')]=_['defaults'](config[_0xaf89('0x15')],{'host':_0xaf89('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf89('0x15')]));require(_0xaf89('0x17'))[_0xaf89('0x18')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xaf89('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x39c0b9,_0x9a7dd4,_0x96da6c,_0x4402bc){return new BPromise(function(_0x4aa7e6,_0x3aa77a){var _0x17bda1=_0x4402bc||client;return _0x17bda1[_0xaf89('0x1a')](_0x39c0b9,_0x96da6c)[_0xaf89('0x1b')](function(_0x39c426){logger[_0xaf89('0x1c')](_0xaf89('0x1d'),_0x9a7dd4,_0xaf89('0x1e'));logger[_0xaf89('0x1f')](_0xaf89('0x20'),_0x9a7dd4,_0xaf89('0x1e'),JSON[_0xaf89('0x21')](_0x39c426));if(_0x39c426['error']){if(_0x39c426[_0xaf89('0x22')]['code']===0x1f4){logger[_0xaf89('0x22')](_0xaf89('0x1d'),_0x9a7dd4,_0x39c426[_0xaf89('0x22')][_0xaf89('0x23')]);return _0x3aa77a(_0x39c426[_0xaf89('0x22')][_0xaf89('0x23')]);}logger['error'](_0xaf89('0x1d'),_0x9a7dd4,_0x39c426[_0xaf89('0x22')]['message']);return _0x4aa7e6(_0x39c426[_0xaf89('0x22')][_0xaf89('0x23')]);}else{logger['info'](_0xaf89('0x1d'),_0x9a7dd4,_0xaf89('0x1e'));_0x4aa7e6(_0x39c426[_0xaf89('0x24')][_0xaf89('0x23')]);}})['catch'](function(_0x484577){logger[_0xaf89('0x22')](_0xaf89('0x1d'),_0x9a7dd4,_0x484577);_0x3aa77a(_0x484577);});});}function respondWithStatusCode(_0x215ace,_0x5d1795){_0x5d1795=_0x5d1795||0xcc;return function(_0x17a472){if(_0x17a472){return _0x215ace[_0xaf89('0x25')](_0x5d1795);}return _0x215ace[_0xaf89('0x26')](_0x5d1795)[_0xaf89('0x27')]();};}function respondWithResult(_0x35ca69,_0x264c09){_0x264c09=_0x264c09||0xc8;return function(_0x3b683e){if(_0x3b683e){return _0x35ca69[_0xaf89('0x26')](_0x264c09)[_0xaf89('0x28')](_0x3b683e);}};}function respondWithFilteredResult(_0xd6bcd3,_0x4c60c3){return function(_0x677cd){if(_0x677cd){var _0x189694=typeof _0x4c60c3[_0xaf89('0x29')]===_0xaf89('0x2a')&&typeof _0x4c60c3[_0xaf89('0x2b')]==='undefined';var _0x5f3d53=_0x677cd[_0xaf89('0x2c')];var _0x533c90=_0x189694?0x0:_0x4c60c3[_0xaf89('0x29')];var _0x83abd0=_0x189694?_0x677cd[_0xaf89('0x2c')]:_0x4c60c3[_0xaf89('0x29')]+_0x4c60c3[_0xaf89('0x2b')];var _0x20db01;if(_0x83abd0>=_0x5f3d53){_0x83abd0=_0x5f3d53;_0x20db01=0xc8;}else{_0x20db01=0xce;}_0xd6bcd3[_0xaf89('0x26')](_0x20db01);return _0xd6bcd3[_0xaf89('0x2d')](_0xaf89('0x2e'),_0x533c90+'-'+_0x83abd0+'/'+_0x5f3d53)[_0xaf89('0x28')](_0x677cd);}return null;};}function patchUpdates(_0x4f2a4b){return function(_0x199a36){try{jsonpatch[_0xaf89('0x2f')](_0x199a36,_0x4f2a4b,!![]);}catch(_0x9a0450){return BPromise[_0xaf89('0x30')](_0x9a0450);}return _0x199a36['save']();};}function saveUpdates(_0x9677ea,_0x1abeae){return function(_0xe60cec){if(_0xe60cec){return _0xe60cec[_0xaf89('0x31')](_0x9677ea)['then'](function(_0x459c8a){return _0x459c8a;});}return null;};}function removeEntity(_0x5e6eaa,_0x5979dd){return function(_0x254066){if(_0x254066){return _0x254066['destroy']()['then'](function(){var _0x4720ff=_0x254066['get']({'plain':!![]});var _0x386ce5=_0xaf89('0x32');return db['UserProfileResource'][_0xaf89('0x33')]({'where':{'type':_0x386ce5,'resourceId':_0x4720ff['id']}})[_0xaf89('0x1b')](function(){return _0x254066;});})[_0xaf89('0x1b')](function(){_0x5e6eaa[_0xaf89('0x26')](0xcc)[_0xaf89('0x27')]();});}};}function handleEntityNotFound(_0x2ca674,_0x56d85e){return function(_0x1bd239){if(!_0x1bd239){_0x2ca674['sendStatus'](0x194);}return _0x1bd239;};}function handleError(_0x4ff64f,_0x4ec8fe){_0x4ec8fe=_0x4ec8fe||0x1f4;return function(_0x28dd0a){logger[_0xaf89('0x22')](_0x28dd0a[_0xaf89('0x34')]);if(_0x28dd0a[_0xaf89('0x35')]){delete _0x28dd0a['name'];}_0x4ff64f['status'](_0x4ec8fe)[_0xaf89('0x36')](_0x28dd0a);};}exports[_0xaf89('0x37')]=function(_0x3c16aa,_0x5dffa8){var _0xdbf94d={'include':[{'model':db['Pause'],'as':_0xaf89('0x38')}]},_0x2b87d8={},_0x1fe30a={'count':0x0,'rows':[]};var _0x5aaf9b=_[_0xaf89('0x39')](db[_0xaf89('0x3a')][_0xaf89('0x3b')],function(_0x579df1){return{'name':_0x579df1['fieldName'],'type':_0x579df1[_0xaf89('0x3c')][_0xaf89('0x3d')]};});_0x2b87d8[_0xaf89('0x3e')]=_[_0xaf89('0x39')](_0x5aaf9b,_0xaf89('0x35'));_0x2b87d8['query']=_[_0xaf89('0x3f')](_0x3c16aa[_0xaf89('0x40')]);_0x2b87d8['filters']=_[_0xaf89('0x41')](_0x2b87d8[_0xaf89('0x3e')],_0x2b87d8[_0xaf89('0x40')]);_0xdbf94d[_0xaf89('0x42')]=_[_0xaf89('0x41')](_0x2b87d8[_0xaf89('0x3e')],qs[_0xaf89('0x43')](_0x3c16aa['query'][_0xaf89('0x43')]));_0xdbf94d['attributes']=_0xdbf94d[_0xaf89('0x42')][_0xaf89('0x44')]?_0xdbf94d[_0xaf89('0x42')]:_0x2b87d8['model'];if(!_0x3c16aa[_0xaf89('0x40')][_0xaf89('0x45')](_0xaf89('0x46'))){_0xdbf94d[_0xaf89('0x2b')]=qs['limit'](_0x3c16aa[_0xaf89('0x40')][_0xaf89('0x2b')]);_0xdbf94d[_0xaf89('0x29')]=qs[_0xaf89('0x29')](_0x3c16aa[_0xaf89('0x40')][_0xaf89('0x29')]);}_0xdbf94d[_0xaf89('0x47')]=qs[_0xaf89('0x48')](_0x3c16aa['query']['sort']);_0xdbf94d['where']=qs[_0xaf89('0x49')](_[_0xaf89('0x4a')](_0x3c16aa[_0xaf89('0x40')],_0x2b87d8[_0xaf89('0x49')]),_0x5aaf9b);if(_0x3c16aa[_0xaf89('0x40')][_0xaf89('0x4b')]){_0xdbf94d[_0xaf89('0x4c')]=_[_0xaf89('0x4d')](_0xdbf94d[_0xaf89('0x4c')],{'$or':_[_0xaf89('0x39')](_0x5aaf9b,function(_0x7baba2){if(_0x7baba2['type']!==_0xaf89('0x4e')){var _0x4dceb8={};_0x4dceb8[_0x7baba2[_0xaf89('0x35')]]={'$like':'%'+_0x3c16aa['query'][_0xaf89('0x4b')]+'%'};return _0x4dceb8;}})});}_0xdbf94d=_[_0xaf89('0x4d')]({},_0xdbf94d,_0x3c16aa[_0xaf89('0x4f')]);var _0x519b64={'where':_0xdbf94d['where']};return db[_0xaf89('0x3a')][_0xaf89('0x2c')](_0x519b64)['then'](function(_0x461ed8){_0x1fe30a['count']=_0x461ed8;if(_0x3c16aa['query'][_0xaf89('0x50')]){_0xdbf94d[_0xaf89('0x51')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xaf89('0x52')](_0xdbf94d);})[_0xaf89('0x1b')](function(_0x409633){_0x1fe30a[_0xaf89('0x53')]=_0x409633;return _0x1fe30a;})[_0xaf89('0x1b')](respondWithFilteredResult(_0x5dffa8,_0xdbf94d))['catch'](handleError(_0x5dffa8,null));};exports[_0xaf89('0x54')]=function(_0x2836f2,_0x2689a9){var _0x451510={'raw':![],'where':{'id':_0x2836f2[_0xaf89('0x55')]['id']},'include':[{'model':db[_0xaf89('0x56')],'as':_0xaf89('0x38')}]},_0x4a0c48={};_0x4a0c48['model']=_['keys'](db['WhatsappAccount']['rawAttributes']);_0x4a0c48[_0xaf89('0x40')]=_['keys'](_0x2836f2['query']);_0x4a0c48[_0xaf89('0x49')]=_[_0xaf89('0x41')](_0x4a0c48['model'],_0x4a0c48[_0xaf89('0x40')]);_0x451510[_0xaf89('0x42')]=_[_0xaf89('0x41')](_0x4a0c48[_0xaf89('0x3e')],qs[_0xaf89('0x43')](_0x2836f2[_0xaf89('0x40')]['fields']));_0x451510[_0xaf89('0x42')]=_0x451510[_0xaf89('0x42')]['length']?_0x451510[_0xaf89('0x42')]:_0x4a0c48[_0xaf89('0x3e')];if(_0x2836f2[_0xaf89('0x40')][_0xaf89('0x50')]){_0x451510[_0xaf89('0x51')]=[{'all':!![]}];}_0x451510=_[_0xaf89('0x4d')]({},_0x451510,_0x2836f2[_0xaf89('0x4f')]);return db['WhatsappAccount'][_0xaf89('0x57')](_0x451510)[_0xaf89('0x1b')](handleEntityNotFound(_0x2689a9,null))[_0xaf89('0x1b')](respondWithResult(_0x2689a9,null))[_0xaf89('0x58')](handleError(_0x2689a9,null));};exports[_0xaf89('0x59')]=function(_0x105e2f,_0x5033c9){return db[_0xaf89('0x3a')][_0xaf89('0x59')](_0x105e2f['body'],{})[_0xaf89('0x1b')](function(_0x586ff5){var _0x1e0b44=_0x105e2f[_0xaf89('0x5a')]['get']({'plain':!![]});if(!_0x1e0b44)throw new Error(_0xaf89('0x5b'));if(_0x1e0b44[_0xaf89('0x5c')]===_0xaf89('0x5a')){var _0x2dd1c3=_0x586ff5[_0xaf89('0x5d')]({'plain':!![]});var _0x2501a9='WhatsappAccounts';return db[_0xaf89('0x5e')][_0xaf89('0x57')]({'where':{'name':_0x2501a9,'userProfileId':_0x1e0b44['userProfileId']},'raw':!![]})[_0xaf89('0x1b')](function(_0xe72e19){if(_0xe72e19&&_0xe72e19['autoAssociation']===0x0){return db['UserProfileResource'][_0xaf89('0x59')]({'name':_0x2dd1c3[_0xaf89('0x35')],'resourceId':_0x2dd1c3['id'],'type':_0xe72e19[_0xaf89('0x35')],'sectionId':_0xe72e19['id']},{})[_0xaf89('0x1b')](function(){return _0x586ff5;});}else{return _0x586ff5;}})['catch'](function(_0x36e630){logger[_0xaf89('0x22')](_0xaf89('0x5f'),_0x36e630);throw _0x36e630;});}return _0x586ff5;})[_0xaf89('0x1b')](respondWithResult(_0x5033c9,0xc9))[_0xaf89('0x58')](handleError(_0x5033c9,null));};exports[_0xaf89('0x31')]=function(_0x3f0a1f,_0x2e9be4){if(_0x3f0a1f[_0xaf89('0x60')]['id']){delete _0x3f0a1f[_0xaf89('0x60')]['id'];}return db[_0xaf89('0x3a')][_0xaf89('0x57')]({'where':{'id':_0x3f0a1f[_0xaf89('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2e9be4,null))[_0xaf89('0x1b')](saveUpdates(_0x3f0a1f[_0xaf89('0x60')],null))[_0xaf89('0x1b')](respondWithResult(_0x2e9be4,null))[_0xaf89('0x58')](handleError(_0x2e9be4,null));};exports['destroy']=function(_0x2f2cf9,_0x211cd6){return db[_0xaf89('0x3a')][_0xaf89('0x57')]({'where':{'id':_0x2f2cf9['params']['id']}})['then'](handleEntityNotFound(_0x211cd6,null))[_0xaf89('0x1b')](removeEntity(_0x211cd6,null))[_0xaf89('0x58')](handleError(_0x211cd6,null));};exports[_0xaf89('0x61')]=function(_0x4eb54a,_0x33a1db){return db[_0xaf89('0x3a')][_0xaf89('0x61')]()[_0xaf89('0x1b')](respondWithResult(_0x33a1db,null))[_0xaf89('0x58')](handleError(_0x33a1db,null));};exports[_0xaf89('0x62')]=function(_0x9643d2,_0x3ca677,_0x516636){if(_0x9643d2[_0xaf89('0x60')]['id']){delete _0x9643d2[_0xaf89('0x60')]['id'];}return db[_0xaf89('0x3a')][_0xaf89('0x57')]({'where':{'id':_0x9643d2['params']['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x3ca677,null))[_0xaf89('0x1b')](function(_0x19685d){if(_0x19685d){_0x9643d2[_0xaf89('0x60')]['WhatsappAccountId']=_0x19685d['id'];return db[_0xaf89('0x63')][_0xaf89('0x59')](_0x9643d2['body']);}})[_0xaf89('0x1b')](respondWithResult(_0x3ca677,null))[_0xaf89('0x58')](handleError(_0x3ca677,null));};exports['getDispositions']=function(_0x3aef38,_0x52872d,_0x493adb){var _0x1bb7ad={'raw':![],'where':{}};var _0x44acd8={};var _0x18da8b={'count':0x0,'rows':[]};return db[_0xaf89('0x3a')]['findOne']({'where':{'id':_0x3aef38[_0xaf89('0x55')]['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x52872d,null))[_0xaf89('0x1b')](function(_0x5212d9){if(_0x5212d9){_0x44acd8['model']=_[_0xaf89('0x3f')](db[_0xaf89('0x63')][_0xaf89('0x3b')]);_0x44acd8['query']=_[_0xaf89('0x3f')](_0x3aef38[_0xaf89('0x40')]);_0x44acd8[_0xaf89('0x49')]=_[_0xaf89('0x41')](_0x44acd8[_0xaf89('0x3e')],_0x44acd8[_0xaf89('0x40')]);_0x1bb7ad[_0xaf89('0x42')]=_[_0xaf89('0x41')](_0x44acd8[_0xaf89('0x3e')],qs[_0xaf89('0x43')](_0x3aef38[_0xaf89('0x40')]['fields']));_0x1bb7ad[_0xaf89('0x42')]=_0x1bb7ad[_0xaf89('0x42')][_0xaf89('0x44')]?_0x1bb7ad[_0xaf89('0x42')]:_0x44acd8['model'];if(!_0x3aef38[_0xaf89('0x40')][_0xaf89('0x45')]('nolimit')){_0x1bb7ad[_0xaf89('0x2b')]=qs[_0xaf89('0x2b')](_0x3aef38[_0xaf89('0x40')][_0xaf89('0x2b')]);_0x1bb7ad[_0xaf89('0x29')]=qs[_0xaf89('0x29')](_0x3aef38[_0xaf89('0x40')][_0xaf89('0x29')]);}_0x1bb7ad[_0xaf89('0x47')]=qs[_0xaf89('0x48')](_0x3aef38[_0xaf89('0x40')]['sort']);_0x1bb7ad[_0xaf89('0x4c')]=qs[_0xaf89('0x49')](_[_0xaf89('0x4a')](_0x3aef38[_0xaf89('0x40')],_0x44acd8[_0xaf89('0x49')]));_0x1bb7ad[_0xaf89('0x4c')][_0xaf89('0x64')]=_0x5212d9['id'];if(_0x3aef38[_0xaf89('0x40')][_0xaf89('0x4b')]){_0x1bb7ad[_0xaf89('0x4c')]=_[_0xaf89('0x4d')](_0x1bb7ad[_0xaf89('0x4c')],{'$or':_[_0xaf89('0x39')](_0x1bb7ad['attributes'],function(_0x5e3a7d){var _0x52026d={};_0x52026d[_0x5e3a7d]={'$like':'%'+_0x3aef38[_0xaf89('0x40')]['filter']+'%'};return _0x52026d;})});}_0x1bb7ad=_[_0xaf89('0x4d')]({},_0x1bb7ad,_0x3aef38['options']);return db[_0xaf89('0x63')]['count']({'where':_0x1bb7ad[_0xaf89('0x4c')]})[_0xaf89('0x1b')](function(_0x1de8a7){_0x18da8b[_0xaf89('0x2c')]=_0x1de8a7;if(_0x3aef38[_0xaf89('0x40')][_0xaf89('0x50')]){_0x1bb7ad[_0xaf89('0x51')]=[{'all':!![]}];}return db[_0xaf89('0x63')]['findAll'](_0x1bb7ad);})['then'](function(_0x4dddb2){_0x18da8b['rows']=_0x4dddb2;return _0x18da8b;});}})[_0xaf89('0x1b')](respondWithFilteredResult(_0x52872d,_0x1bb7ad))[_0xaf89('0x58')](handleError(_0x52872d,null));};exports['removeDispositions']=function(_0x42347b,_0xb91960,_0x5aed1b){return db[_0xaf89('0x3a')][_0xaf89('0x57')]({'where':{'id':_0x42347b[_0xaf89('0x55')]['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0xb91960,null))[_0xaf89('0x1b')](function(_0x231a9a){if(_0x231a9a){return _0x231a9a[_0xaf89('0x65')](_0x42347b[_0xaf89('0x40')][_0xaf89('0x66')]);}})[_0xaf89('0x1b')](respondWithStatusCode(_0xb91960,null))[_0xaf89('0x58')](handleError(_0xb91960,null));};exports[_0xaf89('0x67')]=function(_0x123709,_0x39d468,_0x5f8d66){if(_0x123709[_0xaf89('0x60')]['id']){delete _0x123709[_0xaf89('0x60')]['id'];}return db['WhatsappAccount'][_0xaf89('0x57')]({'where':{'id':_0x123709[_0xaf89('0x55')]['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x39d468,null))[_0xaf89('0x1b')](function(_0x3bca05){if(_0x3bca05){_0x123709[_0xaf89('0x60')][_0xaf89('0x64')]=_0x3bca05['id'];return db[_0xaf89('0x68')][_0xaf89('0x59')](_0x123709[_0xaf89('0x60')]);}})[_0xaf89('0x1b')](respondWithResult(_0x39d468,null))[_0xaf89('0x58')](handleError(_0x39d468,null));};exports['getAnswers']=function(_0x5b31ad,_0x509136,_0x7db01a){var _0x282aa7={'raw':![],'where':{}};var _0x32b3fc={};var _0x19386b={'count':0x0,'rows':[]};return db[_0xaf89('0x3a')][_0xaf89('0x69')]({'where':{'id':_0x5b31ad[_0xaf89('0x55')]['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x509136,null))['then'](function(_0x11a01){if(_0x11a01){_0x32b3fc[_0xaf89('0x3e')]=_[_0xaf89('0x3f')](db[_0xaf89('0x68')]['rawAttributes']);_0x32b3fc[_0xaf89('0x40')]=_[_0xaf89('0x3f')](_0x5b31ad[_0xaf89('0x40')]);_0x32b3fc[_0xaf89('0x49')]=_['intersection'](_0x32b3fc[_0xaf89('0x3e')],_0x32b3fc[_0xaf89('0x40')]);_0x282aa7['attributes']=_[_0xaf89('0x41')](_0x32b3fc['model'],qs[_0xaf89('0x43')](_0x5b31ad[_0xaf89('0x40')][_0xaf89('0x43')]));_0x282aa7['attributes']=_0x282aa7['attributes'][_0xaf89('0x44')]?_0x282aa7['attributes']:_0x32b3fc['model'];if(!_0x5b31ad[_0xaf89('0x40')]['hasOwnProperty'](_0xaf89('0x46'))){_0x282aa7[_0xaf89('0x2b')]=qs['limit'](_0x5b31ad['query'][_0xaf89('0x2b')]);_0x282aa7[_0xaf89('0x29')]=qs[_0xaf89('0x29')](_0x5b31ad[_0xaf89('0x40')][_0xaf89('0x29')]);}_0x282aa7['order']=qs['sort'](_0x5b31ad[_0xaf89('0x40')][_0xaf89('0x48')]);_0x282aa7[_0xaf89('0x4c')]=qs[_0xaf89('0x49')](_[_0xaf89('0x4a')](_0x5b31ad[_0xaf89('0x40')],_0x32b3fc[_0xaf89('0x49')]));_0x282aa7[_0xaf89('0x4c')][_0xaf89('0x64')]=_0x11a01['id'];if(_0x5b31ad[_0xaf89('0x40')][_0xaf89('0x4b')]){_0x282aa7[_0xaf89('0x4c')]=_[_0xaf89('0x4d')](_0x282aa7[_0xaf89('0x4c')],{'$or':_[_0xaf89('0x39')](_0x282aa7['attributes'],function(_0x59194e){var _0xdea645={};_0xdea645[_0x59194e]={'$like':'%'+_0x5b31ad[_0xaf89('0x40')][_0xaf89('0x4b')]+'%'};return _0xdea645;})});}_0x282aa7=_[_0xaf89('0x4d')]({},_0x282aa7,_0x5b31ad['options']);return db[_0xaf89('0x68')][_0xaf89('0x2c')]({'where':_0x282aa7[_0xaf89('0x4c')]})[_0xaf89('0x1b')](function(_0x860135){_0x19386b[_0xaf89('0x2c')]=_0x860135;if(_0x5b31ad['query'][_0xaf89('0x50')]){_0x282aa7[_0xaf89('0x51')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x282aa7);})[_0xaf89('0x1b')](function(_0x1c427f){_0x19386b[_0xaf89('0x53')]=_0x1c427f;return _0x19386b;});}})[_0xaf89('0x1b')](respondWithFilteredResult(_0x509136,_0x282aa7))[_0xaf89('0x58')](handleError(_0x509136,null));};exports[_0xaf89('0x6a')]=function(_0x378c9c,_0x51b899,_0x5d8fed){return db['WhatsappAccount']['find']({'where':{'id':_0x378c9c['params']['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x51b899,null))[_0xaf89('0x1b')](function(_0x200974){if(_0x200974){return _0x200974[_0xaf89('0x6a')](_0x378c9c[_0xaf89('0x40')]['ids']);}})[_0xaf89('0x1b')](respondWithStatusCode(_0x51b899,null))[_0xaf89('0x58')](handleError(_0x51b899,null));};exports['addAgents']=function(_0x135cc3,_0x273289,_0x3acf5d){return db[_0xaf89('0x3a')][_0xaf89('0x57')]({'where':{'id':_0x135cc3[_0xaf89('0x55')]['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x273289,null))[_0xaf89('0x1b')](function(_0x37ff02){if(_0x37ff02){return _0x37ff02[_0xaf89('0x6b')](_0x135cc3[_0xaf89('0x60')]['ids'],_[_0xaf89('0x6c')](_0x135cc3[_0xaf89('0x60')],[_0xaf89('0x66'),'id'])||{})[_0xaf89('0x6d')](function(_0x110f10){for(var _0x1038cf=0x0;_0x1038cf<_0x135cc3[_0xaf89('0x60')][_0xaf89('0x66')][_0xaf89('0x44')];_0x1038cf+=0x1){socket[_0xaf89('0x6e')](_0xaf89('0x6f'),{'UserId':Number(_0x135cc3[_0xaf89('0x60')][_0xaf89('0x66')][_0x1038cf]),'WhatsappAccountId':Number(_0x135cc3[_0xaf89('0x55')]['id'])});}return _0x110f10;});}})['then'](respondWithResult(_0x273289,null))[_0xaf89('0x58')](handleError(_0x273289,null));};exports['removeAgents']=function(_0x5e61e2,_0x309d07,_0x28d5b7){return db[_0xaf89('0x3a')]['find']({'where':{'id':_0x5e61e2[_0xaf89('0x55')]['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x309d07,null))[_0xaf89('0x1b')](function(_0x4a1a53){if(_0x4a1a53){return _0x4a1a53['removeAgents'](_0x5e61e2[_0xaf89('0x40')][_0xaf89('0x66')])[_0xaf89('0x1b')](function(){if(_[_0xaf89('0x70')](_0x5e61e2[_0xaf89('0x40')][_0xaf89('0x66')])){for(var _0xb14621=0x0;_0xb14621<_0x5e61e2[_0xaf89('0x40')][_0xaf89('0x66')][_0xaf89('0x44')];_0xb14621+=0x1){socket[_0xaf89('0x6e')]('userWhatsappAccount:remove',{'UserId':Number(_0x5e61e2[_0xaf89('0x40')][_0xaf89('0x66')][_0xb14621]),'WhatsappAccountId':Number(_0x5e61e2['params']['id'])});}}else{socket[_0xaf89('0x6e')]('userWhatsappAccount:remove',{'UserId':Number(_0x5e61e2[_0xaf89('0x40')][_0xaf89('0x66')]),'WhatsappAccountId':Number(_0x5e61e2[_0xaf89('0x55')]['id'])});}});}})[_0xaf89('0x1b')](respondWithStatusCode(_0x309d07,null))[_0xaf89('0x58')](handleError(_0x309d07,null));};exports['getAgents']=function(_0x4866a4,_0x41db16,_0x11215a){var _0x40e9bc={};var _0x51a657={};var _0xb2d0d3;var _0x2ce5b2;return db[_0xaf89('0x3a')][_0xaf89('0x69')]({'where':{'id':_0x4866a4[_0xaf89('0x55')]['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x41db16,null))[_0xaf89('0x1b')](function(_0x41094b){if(_0x41094b){_0xb2d0d3=_0x41094b;_0x51a657[_0xaf89('0x3e')]=_['keys'](db[_0xaf89('0x71')][_0xaf89('0x3b')]);_0x51a657['query']=_[_0xaf89('0x3f')](_0x4866a4[_0xaf89('0x40')]);_0x51a657[_0xaf89('0x49')]=_[_0xaf89('0x41')](_0x51a657[_0xaf89('0x3e')],_0x51a657['query']);_0x40e9bc[_0xaf89('0x42')]=_[_0xaf89('0x41')](_0x51a657[_0xaf89('0x3e')],qs[_0xaf89('0x43')](_0x4866a4[_0xaf89('0x40')][_0xaf89('0x43')]));_0x40e9bc[_0xaf89('0x42')]=_0x40e9bc[_0xaf89('0x42')][_0xaf89('0x44')]?_0x40e9bc[_0xaf89('0x42')]:_0x51a657[_0xaf89('0x3e')];_0x40e9bc['order']=qs[_0xaf89('0x48')](_0x4866a4[_0xaf89('0x40')][_0xaf89('0x48')]);_0x40e9bc['where']=qs[_0xaf89('0x49')](_[_0xaf89('0x4a')](_0x4866a4[_0xaf89('0x40')],_0x51a657[_0xaf89('0x49')]));if(_0x4866a4[_0xaf89('0x40')][_0xaf89('0x4b')]){_0x40e9bc[_0xaf89('0x4c')]=_['merge'](_0x40e9bc[_0xaf89('0x4c')],{'$or':_[_0xaf89('0x39')](_0x40e9bc[_0xaf89('0x42')],function(_0x5c043c){var _0x1891cc={};_0x1891cc[_0x5c043c]={'$like':'%'+_0x4866a4['query'][_0xaf89('0x4b')]+'%'};return _0x1891cc;})});}_0x40e9bc=_[_0xaf89('0x4d')]({},_0x40e9bc,_0x4866a4[_0xaf89('0x4f')]);return _0xb2d0d3[_0xaf89('0x72')](_0x40e9bc);}})[_0xaf89('0x1b')](function(_0xf9ab23){if(_0xf9ab23){_0x2ce5b2=_0xf9ab23[_0xaf89('0x44')];if(!_0x4866a4[_0xaf89('0x40')][_0xaf89('0x45')](_0xaf89('0x46'))){_0x40e9bc[_0xaf89('0x2b')]=qs[_0xaf89('0x2b')](_0x4866a4['query'][_0xaf89('0x2b')]);_0x40e9bc[_0xaf89('0x29')]=qs[_0xaf89('0x29')](_0x4866a4[_0xaf89('0x40')][_0xaf89('0x29')]);}return _0xb2d0d3['getAgents'](_0x40e9bc);}})['then'](function(_0x31f935){if(_0x31f935){return _0x31f935?{'count':_0x2ce5b2,'rows':_0x31f935}:null;}})[_0xaf89('0x1b')](respondWithResult(_0x41db16,null))[_0xaf89('0x58')](handleError(_0x41db16,null));};exports['addApplications']=function(_0x42f616,_0x28ca4b,_0x488bcb){return db[_0xaf89('0x3a')]['findOne']({'where':{'id':_0x42f616['params']['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x28ca4b,null))[_0xaf89('0x1b')](function(_0x32e4c5){if(_0x32e4c5){return db[_0xaf89('0x73')]['transaction'](function(_0x5045ca){return db[_0xaf89('0x74')]['destroy']({'where':{'WhatsappAccountId':_0x42f616[_0xaf89('0x55')]['id']},'transaction':_0x5045ca})[_0xaf89('0x1b')](function(_0x1e4203){var _0x36166f=_[_0xaf89('0x39')](_0x42f616[_0xaf89('0x60')],function(_0x5ada59){_0x5ada59[_0xaf89('0x64')]=_0x42f616['params']['id'];return _0x5ada59;});return db['WhatsappApplication'][_0xaf89('0x75')](_0x36166f,{'transaction':_0x5045ca});});})[_0xaf89('0x1b')](function(){return db[_0xaf89('0x74')][_0xaf89('0x76')]({'where':{'WhatsappAccountId':_0x42f616[_0xaf89('0x55')]['id']},'order':_0xaf89('0x77')});});}})[_0xaf89('0x1b')](respondWithResult(_0x28ca4b,null))[_0xaf89('0x58')](handleError(_0x28ca4b,null));};exports[_0xaf89('0x78')]=function(_0x1e1844,_0x9866c9,_0x14b7cd){var _0x5a5540={};var _0x5164ab={};var _0x287b2e;var _0x29d3b7;return db[_0xaf89('0x3a')][_0xaf89('0x69')]({'where':{'id':_0x1e1844[_0xaf89('0x55')]['id']}})[_0xaf89('0x1b')](handleEntityNotFound(_0x9866c9,null))['then'](function(_0x2067c6){if(_0x2067c6){_0x287b2e=_0x2067c6;_0x5164ab[_0xaf89('0x3e')]=_['keys'](db[_0xaf89('0x74')][_0xaf89('0x3b')]);_0x5164ab[_0xaf89('0x40')]=_['keys'](_0x1e1844[_0xaf89('0x40')]);_0x5164ab[_0xaf89('0x49')]=_[_0xaf89('0x41')](_0x5164ab[_0xaf89('0x3e')],_0x5164ab['query']);_0x5a5540[_0xaf89('0x42')]=_[_0xaf89('0x41')](_0x5164ab['model'],qs[_0xaf89('0x43')](_0x1e1844[_0xaf89('0x40')][_0xaf89('0x43')]));_0x5a5540[_0xaf89('0x42')]=_0x5a5540['attributes'][_0xaf89('0x44')]?_0x5a5540[_0xaf89('0x42')]:_0x5164ab['model'];_0x5a5540[_0xaf89('0x47')]=qs[_0xaf89('0x48')](_0x1e1844['query'][_0xaf89('0x48')]);_0x5a5540[_0xaf89('0x4c')]=qs[_0xaf89('0x49')](_[_0xaf89('0x4a')](_0x1e1844[_0xaf89('0x40')],_0x5164ab[_0xaf89('0x49')]));if(_0x1e1844['query'][_0xaf89('0x4b')]){_0x5a5540[_0xaf89('0x4c')]=_['merge'](_0x5a5540['where'],{'$or':_[_0xaf89('0x39')](_0x5a5540[_0xaf89('0x42')],function(_0x5189f5){var _0x540c4c={};_0x540c4c[_0x5189f5]={'$like':'%'+_0x1e1844[_0xaf89('0x40')][_0xaf89('0x4b')]+'%'};return _0x540c4c;})});}_0x5a5540=_[_0xaf89('0x4d')]({},_0x5a5540,_0x1e1844[_0xaf89('0x4f')]);return _0x287b2e['getApplications'](_0x5a5540);}})['then'](function(_0x40fc8d){if(_0x40fc8d){_0x29d3b7=_0x40fc8d[_0xaf89('0x44')];if(!_0x1e1844[_0xaf89('0x40')][_0xaf89('0x45')]('nolimit')){_0x5a5540[_0xaf89('0x2b')]=qs[_0xaf89('0x2b')](_0x1e1844['query']['limit']);_0x5a5540[_0xaf89('0x29')]=qs[_0xaf89('0x29')](_0x1e1844['query'][_0xaf89('0x29')]);}return _0x287b2e[_0xaf89('0x78')](_0x5a5540);}})[_0xaf89('0x1b')](function(_0x968c53){if(_0x968c53){return _0x968c53?{'count':_0x29d3b7,'rows':_0x968c53}:null;}})[_0xaf89('0x1b')](respondWithResult(_0x9866c9,null))['catch'](handleError(_0x9866c9,null));};exports[_0xaf89('0x79')]=function(_0x3e6084,_0x49d442,_0x232517){var _0x4ce1b4={'channel':_0xaf89('0x7a')};var _0x3d5e87=[];var _0x490a6e=[];var _0x2947ef={};return db[_0xaf89('0x3a')][_0xaf89('0x57')]({'where':{'id':_0x3e6084[_0xaf89('0x55')]['id']},'include':[{'model':db[_0xaf89('0x74')],'as':_0xaf89('0x7b')}]})[_0xaf89('0x1b')](handleEntityNotFound(_0x49d442,null))[_0xaf89('0x1b')](function(_0x6756ae){_0x4ce1b4['account']=_0x6756ae;_0x4ce1b4[_0xaf89('0x7c')]=_[_0xaf89('0x7d')](_0x6756ae[_0xaf89('0x7b')],[_0xaf89('0x77')],[_0xaf89('0x7e')]);if(_0x4ce1b4[_0xaf89('0x7f')]['Applications']){delete _0x4ce1b4[_0xaf89('0x7f')]['Applications'];}return db[_0xaf89('0x80')][_0xaf89('0x61')]();})['then'](function(_0x1fa54f){if(!_0x1fa54f){throw new db[(_0xaf89('0x81'))][(_0xaf89('0x82'))]('no\x20available\x20attributes');}_0x3d5e87=_[_0xaf89('0x83')](_[_0xaf89('0x3f')](_0x1fa54f),[_0xaf89('0x84'),_0xaf89('0x85')]);_0x490a6e=_[_0xaf89('0x83')](_[_0xaf89('0x3f')](_0x1fa54f),['createdAt',_0xaf89('0x85'),'CompanyId',_0xaf89('0x86')]);_0x4ce1b4[_0xaf89('0x60')]={'mapKey':_0xaf89('0x87')};if(_0x4ce1b4[_0xaf89('0x7f')]['type']&&_0x4ce1b4[_0xaf89('0x7f')][_0xaf89('0x3c')]==='twilio'){_0x4ce1b4[_0xaf89('0x60')]['from']=_0x3e6084[_0xaf89('0x60')][_0xaf89('0x88')][_0xaf89('0x89')](_0xaf89('0x8a'),'');_0x4ce1b4[_0xaf89('0x60')][_0xaf89('0x60')]=_0x3e6084[_0xaf89('0x60')][_0xaf89('0x8b')];_0x4ce1b4[_0xaf89('0x60')]['messageId']=_0x3e6084[_0xaf89('0x60')]['MessageSid'];}if(_0x4ce1b4[_0xaf89('0x60')]['id']){delete _0x4ce1b4['body']['id'];}if(_[_0xaf89('0x8c')](_0x4ce1b4[_0xaf89('0x60')][_0xaf89('0x8d')])){throw new db[(_0xaf89('0x81'))][(_0xaf89('0x82'))](_0xaf89('0x8e'));}if(_['isNil'](_0x4ce1b4['body'][_0xaf89('0x60')])||_0x4ce1b4[_0xaf89('0x60')][_0xaf89('0x60')]===''){throw new db[(_0xaf89('0x81'))][(_0xaf89('0x82'))](_0xaf89('0x8f'));}if(_[_0xaf89('0x8c')](_0x4ce1b4[_0xaf89('0x60')][_0xaf89('0x90')])){throw new db[(_0xaf89('0x81'))][(_0xaf89('0x82'))](_0xaf89('0x91')+_0x490a6e);}if(!_[_0xaf89('0x92')](_0x490a6e,_0x4ce1b4['body'][_0xaf89('0x90')])){throw new db[(_0xaf89('0x81'))][(_0xaf89('0x82'))](_0xaf89('0x93')+_0x490a6e);}_0x2947ef[_0x4ce1b4[_0xaf89('0x60')]['mapKey']]=_0x4ce1b4[_0xaf89('0x60')]['from'];return db['CmList']['find']({'where':{'id':_0x4ce1b4['account'][_0xaf89('0x86')]},'include':[{'model':db[_0xaf89('0x80')],'as':_0xaf89('0x94'),'where':_0x2947ef,'limit':0x1,'order':[[_0xaf89('0x85'),_0xaf89('0x95')]]}]});})[_0xaf89('0x1b')](handleEntityNotFound(_0x49d442,null))[_0xaf89('0x1b')](function(_0x293ef){if(_0x293ef){_0x4ce1b4[_0xaf89('0x96')]=_[_0xaf89('0x6c')](_0x293ef,[_0xaf89('0x94')]);if(_0x293ef['Contacts'][_0xaf89('0x44')]){return _0x293ef[_0xaf89('0x94')][0x0];}var _0x3365f0=_[_0xaf89('0x97')](_0x4ce1b4[_0xaf89('0x60')],{'firstName':_0x4ce1b4[_0xaf89('0x60')][_0xaf89('0x8d')],'ListId':_0x293ef['id']});_0x3365f0[_0x4ce1b4['body'][_0xaf89('0x90')]]=_0x4ce1b4[_0xaf89('0x60')]['from'];return db[_0xaf89('0x80')][_0xaf89('0x59')](_0x3365f0,{'fields':_0x3d5e87,'raw':!![]});}})[_0xaf89('0x1b')](handleEntityNotFound(_0x49d442,null))[_0xaf89('0x1b')](function(_0x256400){if(_0x256400){_0x4ce1b4['contact']=_0x256400;var _0x53fd15={'ContactId':_0x256400['id'],'phone':_0x4ce1b4['body'][_0xaf89('0x8d')],'WhatsappAccountId':_0x3e6084[_0xaf89('0x55')]['id']};var _0x31e485={'ContactId':_0x256400['id'],'WhatsappAccountId':_0x3e6084[_0xaf89('0x55')]['id'],'closed':![]};return db[_0xaf89('0x98')][_0xaf89('0x57')]({'where':_0x31e485})[_0xaf89('0x1b')](function(_0x15f128){if(_0x15f128){return[_0x15f128,![]];}return db[_0xaf89('0x98')]['create'](_0x53fd15)[_0xaf89('0x1b')](function(_0x4d60a8){return[_0x4d60a8,!![]];});});}})[_0xaf89('0x6d')](function(_0x43c967,_0x16d4df){_0x4ce1b4[_0xaf89('0x99')]=_0x43c967[_0xaf89('0x5d')]({'plain':!![]});_0x4ce1b4[_0xaf89('0x99')]['created']=![];if(_0x16d4df){if(_0x4ce1b4[_0xaf89('0x7f')][_0xaf89('0x9a')]){_0x4ce1b4[_0xaf89('0x7c')][_0xaf89('0x9b')]({'id':0x0,'priority':_0x4ce1b4[_0xaf89('0x7c')][_0xaf89('0x44')]+0x1,'app':'close','appdata':_0xaf89('0x9c'),'interval':_0xaf89('0x9d')});}_0x4ce1b4[_0xaf89('0x99')]['created']=!![];}return db[_0xaf89('0x9e')][_0xaf89('0x59')]({'phone':_0x4ce1b4['body'][_0xaf89('0x8d')],'messageId':_0x4ce1b4[_0xaf89('0x60')][_0xaf89('0x9f')],'body':_0x4ce1b4['body'][_0xaf89('0x60')],'WhatsappAccountId':_0x3e6084[_0xaf89('0x55')]['id'],'WhatsappInteractionId':_0x43c967['id'],'direction':'in','ContactId':_0x43c967[_0xaf89('0xa0')],'AttachmentId':_0x4ce1b4[_0xaf89('0x60')][_0xaf89('0xa1')]});})[_0xaf89('0x1b')](function(_0x75ad31){_0x4ce1b4[_0xaf89('0x23')]=_0x75ad31;if(_0x4ce1b4[_0xaf89('0x99')][_0xaf89('0xa2')]){return db[_0xaf89('0x71')][_0xaf89('0x57')]({'attributes':['id','name'],'where':{'id':_0x4ce1b4['interaction'][_0xaf89('0xa2')]}})[_0xaf89('0x1b')](function(_0x512e74){if(_0x512e74){_0x4ce1b4[_0xaf89('0x7c')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x512e74[_0xaf89('0x35')]+','+(_0x4ce1b4['account'][_0xaf89('0xa3')]||0xa),'interval':_0xaf89('0x9d')});}return respondWithRpcPromise(_0xaf89('0xa4'),'startRouting',_0x4ce1b4);});}return respondWithRpcPromise(_0xaf89('0xa4'),_0xaf89('0xa5'),_0x4ce1b4);})[_0xaf89('0x1b')](function(_0x108740){if(_0x108740){var _0x35c9a8=0xc8;var _0x55464f=_0xaf89('0xa6');logger[_0xaf89('0x1c')](_0xaf89('0x20'),_0x55464f,_0x35c9a8,'entity\x20found');logger[_0xaf89('0x1f')](_0xaf89('0xa7'),_0x55464f,_0x35c9a8,'entity\x20found',JSON[_0xaf89('0x21')](_0x108740));if(_0x4ce1b4['account'][_0xaf89('0x3c')]==='twilio'){return _0x49d442[_0xaf89('0x26')](_0x35c9a8)[_0xaf89('0x2d')](_0xaf89('0xa8'),_0xaf89('0xa9'))[_0xaf89('0x36')](_0xaf89('0xaa'));}else{return _0x49d442['status'](_0x35c9a8)[_0xaf89('0x28')](_0x108740);}}})[_0xaf89('0x58')](handleError(_0x49d442,null));};exports['send']=function(_0x469063,_0x5acfbd,_0x57c7b1){var _0x2674b6,_0x305681,_0x6c984f;if(_[_0xaf89('0x8c')](_0x469063[_0xaf89('0x60')]['body'])||_0x469063[_0xaf89('0x60')][_0xaf89('0x60')]===''){throw new db['Sequelize']['ValidationError'](_0xaf89('0x8f'));}if(_[_0xaf89('0x8c')](_0x469063[_0xaf89('0x60')]['to'])){throw new db[(_0xaf89('0x81'))][(_0xaf89('0x82'))](_0xaf89('0xab'));}_0x2674b6=_0x469063[_0xaf89('0x60')]['to'];return db[_0xaf89('0x3a')][_0xaf89('0x57')]({'where':{'id':_0x469063[_0xaf89('0x55')]['id']},'include':[{'model':db[_0xaf89('0xac')],'as':'List','include':[{'model':db[_0xaf89('0x80')],'as':_0xaf89('0x94'),'where':{'mobile':_0x2674b6},'limit':0x1,'order':[[_0xaf89('0x85'),_0xaf89('0x95')]]}]}]})['then'](handleEntityNotFound(_0x5acfbd,null))[_0xaf89('0x1b')](function(_0x480a41){if(_0x480a41&&_0x480a41[_0xaf89('0xad')]){_0x305681=_0x480a41[_0xaf89('0x5d')]({'plain':!![]});if(_0x305681['List']&&_0x305681[_0xaf89('0xad')][_0xaf89('0x94')][_0xaf89('0x44')]){return _0x305681['List']['Contacts'][0x0];}return db[_0xaf89('0x80')]['create'](_['defaults'](_0x469063[_0xaf89('0x60')],{'firstName':_0x2674b6,'mobile':_0x2674b6,'phone':_0x2674b6,'ListId':_0x305681[_0xaf89('0x86')]}));}})[_0xaf89('0x1b')](handleEntityNotFound(_0x5acfbd,null))['then'](function(_0x3ea5e7){if(_0x3ea5e7){_0x6c984f=_0x3ea5e7;return db['WhatsappInteraction'][_0xaf89('0x57')]({'where':{'ContactId':_0x6c984f['id'],'closed':![],'WhatsappAccountId':_0x305681['id']}})[_0xaf89('0x1b')](function(_0x2a4625){if(_0x2a4625){return[_0x2a4625,![]];}return db[_0xaf89('0x98')]['create']({'UserId':_0x469063['user']['id'],'ContactId':_0x6c984f['id'],'WhatsappAccountId':_0x305681['id'],'phone':_0x2674b6,'firstMsgDirection':_0xaf89('0xae'),'Messages':[_[_0xaf89('0x4d')](_0x469063[_0xaf89('0x60')],{'read':![],'body':_0x469063[_0xaf89('0x60')][_0xaf89('0x60')],'phone':_0x2674b6,'WhatsappAccountId':_0x305681['id'],'UserId':_0x469063['user']['id'],'ContactId':_0x6c984f['id']})]},{'include':[{'model':db[_0xaf89('0x9e')],'as':_0xaf89('0xaf')}]})[_0xaf89('0x1b')](function(_0x55d215){return[_0x55d215,!![]];});});}})['spread'](function(_0xa2bffd,_0x27c118){if(_0x27c118){return _0xa2bffd;}return db[_0xaf89('0x9e')]['create'](_[_0xaf89('0x4d')](_0x469063[_0xaf89('0x60')],{'read':![],'body':_0x469063[_0xaf89('0x60')][_0xaf89('0x60')],'phone':_0x2674b6,'WhatsappAccountId':_0x305681['id'],'WhatsappInteractionId':_0xa2bffd['id'],'UserId':_0x469063[_0xaf89('0x5a')]['id'],'ContactId':_0x6c984f['id']}))['then'](function(_0x3c8947){_0xa2bffd[_0xaf89('0xb0')][_0xaf89('0xaf')]=[];_0xa2bffd[_0xaf89('0xb0')][_0xaf89('0xaf')][_0xaf89('0x9b')](_0x3c8947['dataValues']);return _0xa2bffd;});})['then'](respondWithResult(_0x5acfbd,null))['catch'](handleError(_0x5acfbd,null));};
\ No newline at end of file
+var _0xad90=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','get','WhatsappAccounts','destroy','end','stack','name','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','body','params','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','order','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','From','whatsapp:','Body','messageId','MessageSid','isNil','from','from\x20is\x20mandatory','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','ListId','CmContact','Contacts','list','contact','WhatsappInteraction','interaction','created','autoclose','applications','unmanaged','*,*,*,*','WhatsappMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x7f7cb2,_0x1cf149){var _0x23e68b=function(_0x5ac3f4){while(--_0x5ac3f4){_0x7f7cb2['push'](_0x7f7cb2['shift']());}};_0x23e68b(++_0x1cf149);}(_0xad90,0xab));var _0x0ad9=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xad90[_0xbb9dbf];return _0x30223c;};'use strict';var emlformat=require(_0x0ad9('0x0'));var rimraf=require(_0x0ad9('0x1'));var zipdir=require(_0x0ad9('0x2'));var jsonpatch=require(_0x0ad9('0x3'));var rp=require(_0x0ad9('0x4'));var moment=require('moment');var BPromise=require(_0x0ad9('0x5'));var Mustache=require('mustache');var util=require(_0x0ad9('0x6'));var path=require('path');var sox=require(_0x0ad9('0x7'));var csv=require(_0x0ad9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ad9('0x9'));var squel=require(_0x0ad9('0xa'));var crypto=require(_0x0ad9('0xb'));var jsforce=require(_0x0ad9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0ad9('0x8'));var querystring=require(_0x0ad9('0xd'));var Papa=require(_0x0ad9('0xe'));var Redis=require('ioredis');var authService=require(_0x0ad9('0xf'));var qs=require(_0x0ad9('0x10'));var as=require(_0x0ad9('0x11'));var hardwareService=require(_0x0ad9('0x12'));var logger=require(_0x0ad9('0x13'))(_0x0ad9('0x14'));var utils=require(_0x0ad9('0x15'));var config=require(_0x0ad9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0ad9('0x17')]=_[_0x0ad9('0x18')](config[_0x0ad9('0x17')],{'host':_0x0ad9('0x19'),'port':0x18eb});var socket=require(_0x0ad9('0x1a'))(new Redis(config[_0x0ad9('0x17')]));require(_0x0ad9('0x1b'))[_0x0ad9('0x1c')](socket);var jayson=require(_0x0ad9('0x1d'));var client=jayson[_0x0ad9('0x1e')][_0x0ad9('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x3b171a,_0x5c3957,_0x35b457,_0x478589){return new BPromise(function(_0x88b3a,_0x1c5c64){var _0x28d8dd=_0x478589||client;return _0x28d8dd[_0x0ad9('0x20')](_0x3b171a,_0x35b457)['then'](function(_0x3ab49f){logger[_0x0ad9('0x21')](_0x0ad9('0x22'),_0x5c3957,_0x0ad9('0x23'));logger[_0x0ad9('0x24')](_0x0ad9('0x25'),_0x5c3957,_0x0ad9('0x23'),JSON['stringify'](_0x3ab49f));if(_0x3ab49f[_0x0ad9('0x26')]){if(_0x3ab49f[_0x0ad9('0x26')][_0x0ad9('0x27')]===0x1f4){logger[_0x0ad9('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x5c3957,_0x3ab49f['error'][_0x0ad9('0x28')]);return _0x1c5c64(_0x3ab49f[_0x0ad9('0x26')]['message']);}logger[_0x0ad9('0x26')](_0x0ad9('0x22'),_0x5c3957,_0x3ab49f[_0x0ad9('0x26')][_0x0ad9('0x28')]);return _0x88b3a(_0x3ab49f[_0x0ad9('0x26')]['message']);}else{logger['info'](_0x0ad9('0x22'),_0x5c3957,'request\x20sent');_0x88b3a(_0x3ab49f[_0x0ad9('0x29')][_0x0ad9('0x28')]);}})[_0x0ad9('0x2a')](function(_0x2d41b0){logger[_0x0ad9('0x26')](_0x0ad9('0x22'),_0x5c3957,_0x2d41b0);_0x1c5c64(_0x2d41b0);});});}function respondWithStatusCode(_0x2baf09,_0x3dc9e4){_0x3dc9e4=_0x3dc9e4||0xcc;return function(_0x160bc1){if(_0x160bc1){return _0x2baf09[_0x0ad9('0x2b')](_0x3dc9e4);}return _0x2baf09['status'](_0x3dc9e4)['end']();};}function respondWithResult(_0x198e41,_0x42d52d){_0x42d52d=_0x42d52d||0xc8;return function(_0x5ed528){if(_0x5ed528){return _0x198e41[_0x0ad9('0x2c')](_0x42d52d)[_0x0ad9('0x2d')](_0x5ed528);}};}function respondWithFilteredResult(_0x40dd83,_0x369561){return function(_0x403198){if(_0x403198){var _0xba93b7=typeof _0x369561[_0x0ad9('0x2e')]==='undefined'&&typeof _0x369561['limit']==='undefined';var _0x4c0ee3=_0x403198[_0x0ad9('0x2f')];var _0x396099=_0xba93b7?0x0:_0x369561['offset'];var _0x4bbb87=_0xba93b7?_0x403198[_0x0ad9('0x2f')]:_0x369561[_0x0ad9('0x2e')]+_0x369561[_0x0ad9('0x30')];var _0xb16a46;if(_0x4bbb87>=_0x4c0ee3){_0x4bbb87=_0x4c0ee3;_0xb16a46=0xc8;}else{_0xb16a46=0xce;}_0x40dd83[_0x0ad9('0x2c')](_0xb16a46);return _0x40dd83[_0x0ad9('0x31')](_0x0ad9('0x32'),_0x396099+'-'+_0x4bbb87+'/'+_0x4c0ee3)[_0x0ad9('0x2d')](_0x403198);}return null;};}function patchUpdates(_0x5c95c7){return function(_0x4625b9){try{jsonpatch[_0x0ad9('0x33')](_0x4625b9,_0x5c95c7,!![]);}catch(_0x1f07c5){return BPromise[_0x0ad9('0x34')](_0x1f07c5);}return _0x4625b9[_0x0ad9('0x35')]();};}function saveUpdates(_0x3af971,_0x461420){return function(_0x5d8e50){if(_0x5d8e50){return _0x5d8e50[_0x0ad9('0x36')](_0x3af971)[_0x0ad9('0x37')](function(_0x1a6464){return _0x1a6464;});}return null;};}function removeEntity(_0x58d4f8,_0x4b759f){return function(_0x30996c){if(_0x30996c){return _0x30996c['destroy']()['then'](function(){var _0x447be4=_0x30996c[_0x0ad9('0x38')]({'plain':!![]});var _0x35677e=_0x0ad9('0x39');return db['UserProfileResource'][_0x0ad9('0x3a')]({'where':{'type':_0x35677e,'resourceId':_0x447be4['id']}})[_0x0ad9('0x37')](function(){return _0x30996c;});})[_0x0ad9('0x37')](function(){_0x58d4f8[_0x0ad9('0x2c')](0xcc)[_0x0ad9('0x3b')]();});}};}function handleEntityNotFound(_0x12ba1b,_0x1dc4ff){return function(_0x37c565){if(!_0x37c565){_0x12ba1b[_0x0ad9('0x2b')](0x194);}return _0x37c565;};}function handleError(_0x448de4,_0xd68df3){_0xd68df3=_0xd68df3||0x1f4;return function(_0x436789){logger[_0x0ad9('0x26')](_0x436789[_0x0ad9('0x3c')]);if(_0x436789['name']){delete _0x436789[_0x0ad9('0x3d')];}_0x448de4[_0x0ad9('0x2c')](_0xd68df3)['send'](_0x436789);};}exports['index']=function(_0x865926,_0x13e680){var _0x2e9581={'include':[{'model':db[_0x0ad9('0x3e')],'as':_0x0ad9('0x3f')}]},_0x1c0bc0={},_0x5e2668={'count':0x0,'rows':[]};var _0x2ae670=_[_0x0ad9('0x40')](db[_0x0ad9('0x41')][_0x0ad9('0x42')],function(_0x192818){return{'name':_0x192818['fieldName'],'type':_0x192818[_0x0ad9('0x43')][_0x0ad9('0x44')]};});_0x1c0bc0[_0x0ad9('0x45')]=_['map'](_0x2ae670,_0x0ad9('0x3d'));_0x1c0bc0['query']=_[_0x0ad9('0x46')](_0x865926[_0x0ad9('0x47')]);_0x1c0bc0[_0x0ad9('0x48')]=_[_0x0ad9('0x49')](_0x1c0bc0['model'],_0x1c0bc0[_0x0ad9('0x47')]);_0x2e9581[_0x0ad9('0x4a')]=_['intersection'](_0x1c0bc0[_0x0ad9('0x45')],qs[_0x0ad9('0x4b')](_0x865926[_0x0ad9('0x47')][_0x0ad9('0x4b')]));_0x2e9581[_0x0ad9('0x4a')]=_0x2e9581[_0x0ad9('0x4a')][_0x0ad9('0x4c')]?_0x2e9581['attributes']:_0x1c0bc0[_0x0ad9('0x45')];if(!_0x865926['query'][_0x0ad9('0x4d')](_0x0ad9('0x4e'))){_0x2e9581[_0x0ad9('0x30')]=qs[_0x0ad9('0x30')](_0x865926[_0x0ad9('0x47')][_0x0ad9('0x30')]);_0x2e9581[_0x0ad9('0x2e')]=qs['offset'](_0x865926[_0x0ad9('0x47')][_0x0ad9('0x2e')]);}_0x2e9581['order']=qs[_0x0ad9('0x4f')](_0x865926['query']['sort']);_0x2e9581['where']=qs['filters'](_[_0x0ad9('0x50')](_0x865926[_0x0ad9('0x47')],_0x1c0bc0[_0x0ad9('0x48')]),_0x2ae670);if(_0x865926[_0x0ad9('0x47')][_0x0ad9('0x51')]){_0x2e9581[_0x0ad9('0x52')]=_[_0x0ad9('0x53')](_0x2e9581[_0x0ad9('0x52')],{'$or':_['map'](_0x2ae670,function(_0xcb1eee){if(_0xcb1eee[_0x0ad9('0x43')]!==_0x0ad9('0x54')){var _0x96b9d3={};_0x96b9d3[_0xcb1eee[_0x0ad9('0x3d')]]={'$like':'%'+_0x865926[_0x0ad9('0x47')][_0x0ad9('0x51')]+'%'};return _0x96b9d3;}})});}_0x2e9581=_[_0x0ad9('0x53')]({},_0x2e9581,_0x865926[_0x0ad9('0x55')]);var _0x4c7740={'where':_0x2e9581['where']};return db[_0x0ad9('0x41')][_0x0ad9('0x2f')](_0x4c7740)['then'](function(_0x4c6c05){_0x5e2668[_0x0ad9('0x2f')]=_0x4c6c05;if(_0x865926[_0x0ad9('0x47')]['includeAll']){_0x2e9581[_0x0ad9('0x56')]=[{'all':!![]}];}return db[_0x0ad9('0x41')]['findAll'](_0x2e9581);})[_0x0ad9('0x37')](function(_0x41e65d){_0x5e2668[_0x0ad9('0x57')]=_0x41e65d;return _0x5e2668;})[_0x0ad9('0x37')](respondWithFilteredResult(_0x13e680,_0x2e9581))['catch'](handleError(_0x13e680,null));};exports['show']=function(_0x5c90d9,_0x103c80){var _0xeb9dad={'raw':![],'where':{'id':_0x5c90d9['params']['id']},'include':[{'model':db[_0x0ad9('0x3e')],'as':_0x0ad9('0x3f')}]},_0x4a027b={};_0x4a027b['model']=_[_0x0ad9('0x46')](db[_0x0ad9('0x41')][_0x0ad9('0x42')]);_0x4a027b['query']=_[_0x0ad9('0x46')](_0x5c90d9[_0x0ad9('0x47')]);_0x4a027b[_0x0ad9('0x48')]=_['intersection'](_0x4a027b[_0x0ad9('0x45')],_0x4a027b[_0x0ad9('0x47')]);_0xeb9dad['attributes']=_[_0x0ad9('0x49')](_0x4a027b[_0x0ad9('0x45')],qs[_0x0ad9('0x4b')](_0x5c90d9['query'][_0x0ad9('0x4b')]));_0xeb9dad[_0x0ad9('0x4a')]=_0xeb9dad[_0x0ad9('0x4a')][_0x0ad9('0x4c')]?_0xeb9dad[_0x0ad9('0x4a')]:_0x4a027b[_0x0ad9('0x45')];if(_0x5c90d9[_0x0ad9('0x47')][_0x0ad9('0x58')]){_0xeb9dad['include']=[{'all':!![]}];}_0xeb9dad=_[_0x0ad9('0x53')]({},_0xeb9dad,_0x5c90d9['options']);return db[_0x0ad9('0x41')][_0x0ad9('0x59')](_0xeb9dad)[_0x0ad9('0x37')](handleEntityNotFound(_0x103c80,null))[_0x0ad9('0x37')](respondWithResult(_0x103c80,null))[_0x0ad9('0x2a')](handleError(_0x103c80,null));};exports[_0x0ad9('0x5a')]=function(_0x496a04,_0x3adbd0){return db['WhatsappAccount']['create'](_0x496a04['body'],{})[_0x0ad9('0x37')](function(_0xaf8064){var _0x22b249=_0x496a04[_0x0ad9('0x5b')][_0x0ad9('0x38')]({'plain':!![]});if(!_0x22b249)throw new Error(_0x0ad9('0x5c'));if(_0x22b249[_0x0ad9('0x5d')]===_0x0ad9('0x5b')){var _0x3b9a42=_0xaf8064[_0x0ad9('0x38')]({'plain':!![]});var _0x18daff=_0x0ad9('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x18daff,'userProfileId':_0x22b249[_0x0ad9('0x5e')]},'raw':!![]})[_0x0ad9('0x37')](function(_0x2987eb){if(_0x2987eb&&_0x2987eb[_0x0ad9('0x5f')]===0x0){return db[_0x0ad9('0x60')]['create']({'name':_0x3b9a42[_0x0ad9('0x3d')],'resourceId':_0x3b9a42['id'],'type':_0x2987eb[_0x0ad9('0x3d')],'sectionId':_0x2987eb['id']},{})['then'](function(){return _0xaf8064;});}else{return _0xaf8064;}})[_0x0ad9('0x2a')](function(_0x46a255){logger[_0x0ad9('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46a255);throw _0x46a255;});}return _0xaf8064;})[_0x0ad9('0x37')](respondWithResult(_0x3adbd0,0xc9))[_0x0ad9('0x2a')](handleError(_0x3adbd0,null));};exports[_0x0ad9('0x36')]=function(_0x34b529,_0x45e132){if(_0x34b529[_0x0ad9('0x61')]['id']){delete _0x34b529[_0x0ad9('0x61')]['id'];}return db[_0x0ad9('0x41')][_0x0ad9('0x59')]({'where':{'id':_0x34b529[_0x0ad9('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0x0ad9('0x3f')}]})[_0x0ad9('0x37')](handleEntityNotFound(_0x45e132,null))[_0x0ad9('0x37')](saveUpdates(_0x34b529['body'],null))['then'](respondWithResult(_0x45e132,null))['catch'](handleError(_0x45e132,null));};exports[_0x0ad9('0x3a')]=function(_0x23c494,_0x439b4e){return db[_0x0ad9('0x41')][_0x0ad9('0x59')]({'where':{'id':_0x23c494[_0x0ad9('0x62')]['id']}})['then'](handleEntityNotFound(_0x439b4e,null))['then'](removeEntity(_0x439b4e,null))[_0x0ad9('0x2a')](handleError(_0x439b4e,null));};exports[_0x0ad9('0x63')]=function(_0x387df9,_0x125d18){return db[_0x0ad9('0x41')][_0x0ad9('0x63')]()['then'](respondWithResult(_0x125d18,null))[_0x0ad9('0x2a')](handleError(_0x125d18,null));};exports[_0x0ad9('0x64')]=function(_0x34820d,_0x16b16a,_0x513c90){if(_0x34820d[_0x0ad9('0x61')]['id']){delete _0x34820d['body']['id'];}return db[_0x0ad9('0x41')][_0x0ad9('0x59')]({'where':{'id':_0x34820d[_0x0ad9('0x62')]['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x16b16a,null))[_0x0ad9('0x37')](function(_0x12dc54){if(_0x12dc54){_0x34820d[_0x0ad9('0x61')][_0x0ad9('0x65')]=_0x12dc54['id'];return db['Disposition'][_0x0ad9('0x5a')](_0x34820d[_0x0ad9('0x61')]);}})[_0x0ad9('0x37')](respondWithResult(_0x16b16a,null))[_0x0ad9('0x2a')](handleError(_0x16b16a,null));};exports[_0x0ad9('0x66')]=function(_0x2806be,_0x45dd89,_0x1d289f){var _0x2b1fd7={'raw':![],'where':{}};var _0x28720a={};var _0x4def93={'count':0x0,'rows':[]};return db[_0x0ad9('0x41')][_0x0ad9('0x67')]({'where':{'id':_0x2806be[_0x0ad9('0x62')]['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x45dd89,null))['then'](function(_0x3297a2){if(_0x3297a2){_0x28720a[_0x0ad9('0x45')]=_[_0x0ad9('0x46')](db['Disposition']['rawAttributes']);_0x28720a[_0x0ad9('0x47')]=_['keys'](_0x2806be[_0x0ad9('0x47')]);_0x28720a[_0x0ad9('0x48')]=_[_0x0ad9('0x49')](_0x28720a['model'],_0x28720a[_0x0ad9('0x47')]);_0x2b1fd7[_0x0ad9('0x4a')]=_[_0x0ad9('0x49')](_0x28720a[_0x0ad9('0x45')],qs[_0x0ad9('0x4b')](_0x2806be[_0x0ad9('0x47')][_0x0ad9('0x4b')]));_0x2b1fd7[_0x0ad9('0x4a')]=_0x2b1fd7[_0x0ad9('0x4a')][_0x0ad9('0x4c')]?_0x2b1fd7[_0x0ad9('0x4a')]:_0x28720a['model'];if(!_0x2806be[_0x0ad9('0x47')]['hasOwnProperty'](_0x0ad9('0x4e'))){_0x2b1fd7[_0x0ad9('0x30')]=qs[_0x0ad9('0x30')](_0x2806be[_0x0ad9('0x47')][_0x0ad9('0x30')]);_0x2b1fd7[_0x0ad9('0x2e')]=qs['offset'](_0x2806be[_0x0ad9('0x47')]['offset']);}_0x2b1fd7[_0x0ad9('0x68')]=qs['sort'](_0x2806be[_0x0ad9('0x47')][_0x0ad9('0x4f')]);_0x2b1fd7[_0x0ad9('0x52')]=qs[_0x0ad9('0x48')](_['pick'](_0x2806be[_0x0ad9('0x47')],_0x28720a[_0x0ad9('0x48')]));_0x2b1fd7[_0x0ad9('0x52')]['WhatsappAccountId']=_0x3297a2['id'];if(_0x2806be[_0x0ad9('0x47')][_0x0ad9('0x51')]){_0x2b1fd7[_0x0ad9('0x52')]=_[_0x0ad9('0x53')](_0x2b1fd7[_0x0ad9('0x52')],{'$or':_[_0x0ad9('0x40')](_0x2b1fd7[_0x0ad9('0x4a')],function(_0x512e56){var _0x3c2fe4={};_0x3c2fe4[_0x512e56]={'$like':'%'+_0x2806be[_0x0ad9('0x47')]['filter']+'%'};return _0x3c2fe4;})});}_0x2b1fd7=_[_0x0ad9('0x53')]({},_0x2b1fd7,_0x2806be[_0x0ad9('0x55')]);return db[_0x0ad9('0x69')]['count']({'where':_0x2b1fd7[_0x0ad9('0x52')]})['then'](function(_0x560146){_0x4def93[_0x0ad9('0x2f')]=_0x560146;if(_0x2806be['query']['includeAll']){_0x2b1fd7['include']=[{'all':!![]}];}return db[_0x0ad9('0x69')]['findAll'](_0x2b1fd7);})[_0x0ad9('0x37')](function(_0x92c60b){_0x4def93[_0x0ad9('0x57')]=_0x92c60b;return _0x4def93;});}})['then'](respondWithFilteredResult(_0x45dd89,_0x2b1fd7))['catch'](handleError(_0x45dd89,null));};exports['removeDispositions']=function(_0x31b5b3,_0x2aea7b,_0x35830d){return db['WhatsappAccount'][_0x0ad9('0x59')]({'where':{'id':_0x31b5b3[_0x0ad9('0x62')]['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x2aea7b,null))[_0x0ad9('0x37')](function(_0x4c0e2e){if(_0x4c0e2e){return _0x4c0e2e[_0x0ad9('0x6a')](_0x31b5b3['query'][_0x0ad9('0x6b')]);}})['then'](respondWithStatusCode(_0x2aea7b,null))[_0x0ad9('0x2a')](handleError(_0x2aea7b,null));};exports[_0x0ad9('0x6c')]=function(_0x131cbe,_0x54573a,_0x43cc68){if(_0x131cbe[_0x0ad9('0x61')]['id']){delete _0x131cbe['body']['id'];}return db[_0x0ad9('0x41')][_0x0ad9('0x59')]({'where':{'id':_0x131cbe['params']['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x54573a,null))['then'](function(_0x19e0ed){if(_0x19e0ed){_0x131cbe[_0x0ad9('0x61')]['WhatsappAccountId']=_0x19e0ed['id'];return db[_0x0ad9('0x6d')][_0x0ad9('0x5a')](_0x131cbe[_0x0ad9('0x61')]);}})[_0x0ad9('0x37')](respondWithResult(_0x54573a,null))[_0x0ad9('0x2a')](handleError(_0x54573a,null));};exports[_0x0ad9('0x6e')]=function(_0x1112fb,_0x29ea50,_0x4ddbb2){var _0x149674={'raw':![],'where':{}};var _0x2ccc39={};var _0x44fc22={'count':0x0,'rows':[]};return db[_0x0ad9('0x41')][_0x0ad9('0x67')]({'where':{'id':_0x1112fb['params']['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x29ea50,null))['then'](function(_0x403d93){if(_0x403d93){_0x2ccc39[_0x0ad9('0x45')]=_[_0x0ad9('0x46')](db['CannedAnswer']['rawAttributes']);_0x2ccc39[_0x0ad9('0x47')]=_[_0x0ad9('0x46')](_0x1112fb[_0x0ad9('0x47')]);_0x2ccc39[_0x0ad9('0x48')]=_['intersection'](_0x2ccc39[_0x0ad9('0x45')],_0x2ccc39[_0x0ad9('0x47')]);_0x149674[_0x0ad9('0x4a')]=_['intersection'](_0x2ccc39['model'],qs[_0x0ad9('0x4b')](_0x1112fb[_0x0ad9('0x47')][_0x0ad9('0x4b')]));_0x149674['attributes']=_0x149674['attributes'][_0x0ad9('0x4c')]?_0x149674[_0x0ad9('0x4a')]:_0x2ccc39[_0x0ad9('0x45')];if(!_0x1112fb[_0x0ad9('0x47')][_0x0ad9('0x4d')](_0x0ad9('0x4e'))){_0x149674[_0x0ad9('0x30')]=qs[_0x0ad9('0x30')](_0x1112fb[_0x0ad9('0x47')][_0x0ad9('0x30')]);_0x149674[_0x0ad9('0x2e')]=qs['offset'](_0x1112fb[_0x0ad9('0x47')][_0x0ad9('0x2e')]);}_0x149674[_0x0ad9('0x68')]=qs['sort'](_0x1112fb[_0x0ad9('0x47')]['sort']);_0x149674[_0x0ad9('0x52')]=qs[_0x0ad9('0x48')](_[_0x0ad9('0x50')](_0x1112fb[_0x0ad9('0x47')],_0x2ccc39[_0x0ad9('0x48')]));_0x149674[_0x0ad9('0x52')][_0x0ad9('0x65')]=_0x403d93['id'];if(_0x1112fb[_0x0ad9('0x47')][_0x0ad9('0x51')]){_0x149674[_0x0ad9('0x52')]=_[_0x0ad9('0x53')](_0x149674[_0x0ad9('0x52')],{'$or':_['map'](_0x149674['attributes'],function(_0x1e8a49){var _0x3aac42={};_0x3aac42[_0x1e8a49]={'$like':'%'+_0x1112fb[_0x0ad9('0x47')][_0x0ad9('0x51')]+'%'};return _0x3aac42;})});}_0x149674=_[_0x0ad9('0x53')]({},_0x149674,_0x1112fb[_0x0ad9('0x55')]);return db[_0x0ad9('0x6d')][_0x0ad9('0x2f')]({'where':_0x149674['where']})[_0x0ad9('0x37')](function(_0x20789c){_0x44fc22[_0x0ad9('0x2f')]=_0x20789c;if(_0x1112fb[_0x0ad9('0x47')][_0x0ad9('0x58')]){_0x149674[_0x0ad9('0x56')]=[{'all':!![]}];}return db[_0x0ad9('0x6d')][_0x0ad9('0x6f')](_0x149674);})[_0x0ad9('0x37')](function(_0x1b017f){_0x44fc22['rows']=_0x1b017f;return _0x44fc22;});}})[_0x0ad9('0x37')](respondWithFilteredResult(_0x29ea50,_0x149674))[_0x0ad9('0x2a')](handleError(_0x29ea50,null));};exports[_0x0ad9('0x70')]=function(_0x3e2f81,_0x2d5589,_0x126f40){return db['WhatsappAccount'][_0x0ad9('0x59')]({'where':{'id':_0x3e2f81[_0x0ad9('0x62')]['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x2d5589,null))[_0x0ad9('0x37')](function(_0xf320f0){if(_0xf320f0){return _0xf320f0['removeAnswers'](_0x3e2f81[_0x0ad9('0x47')]['ids']);}})[_0x0ad9('0x37')](respondWithStatusCode(_0x2d5589,null))[_0x0ad9('0x2a')](handleError(_0x2d5589,null));};exports[_0x0ad9('0x71')]=function(_0x43b9cd,_0x2d7bac,_0x3d1b4c){return db[_0x0ad9('0x41')]['find']({'where':{'id':_0x43b9cd[_0x0ad9('0x62')]['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x2d7bac,null))[_0x0ad9('0x37')](function(_0x299ab4){if(_0x299ab4){return _0x299ab4[_0x0ad9('0x71')](_0x43b9cd[_0x0ad9('0x61')][_0x0ad9('0x6b')],_[_0x0ad9('0x72')](_0x43b9cd[_0x0ad9('0x61')],[_0x0ad9('0x6b'),'id'])||{})[_0x0ad9('0x73')](function(_0x301cff){for(var _0x46ab90=0x0;_0x46ab90<_0x43b9cd['body'][_0x0ad9('0x6b')][_0x0ad9('0x4c')];_0x46ab90+=0x1){socket[_0x0ad9('0x74')]('userWhatsappAccount:save',{'UserId':Number(_0x43b9cd['body']['ids'][_0x46ab90]),'WhatsappAccountId':Number(_0x43b9cd[_0x0ad9('0x62')]['id'])});}return _0x301cff;});}})[_0x0ad9('0x37')](respondWithResult(_0x2d7bac,null))[_0x0ad9('0x2a')](handleError(_0x2d7bac,null));};exports['removeAgents']=function(_0x250dcf,_0x30d177,_0x106608){return db[_0x0ad9('0x41')][_0x0ad9('0x59')]({'where':{'id':_0x250dcf[_0x0ad9('0x62')]['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x30d177,null))[_0x0ad9('0x37')](function(_0x5c3f6c){if(_0x5c3f6c){return _0x5c3f6c[_0x0ad9('0x75')](_0x250dcf[_0x0ad9('0x47')][_0x0ad9('0x6b')])[_0x0ad9('0x37')](function(){if(_[_0x0ad9('0x76')](_0x250dcf[_0x0ad9('0x47')][_0x0ad9('0x6b')])){for(var _0x200f8d=0x0;_0x200f8d<_0x250dcf[_0x0ad9('0x47')]['ids'][_0x0ad9('0x4c')];_0x200f8d+=0x1){socket[_0x0ad9('0x74')](_0x0ad9('0x77'),{'UserId':Number(_0x250dcf[_0x0ad9('0x47')][_0x0ad9('0x6b')][_0x200f8d]),'WhatsappAccountId':Number(_0x250dcf[_0x0ad9('0x62')]['id'])});}}else{socket['emit'](_0x0ad9('0x77'),{'UserId':Number(_0x250dcf[_0x0ad9('0x47')][_0x0ad9('0x6b')]),'WhatsappAccountId':Number(_0x250dcf['params']['id'])});}});}})[_0x0ad9('0x37')](respondWithStatusCode(_0x30d177,null))[_0x0ad9('0x2a')](handleError(_0x30d177,null));};exports[_0x0ad9('0x78')]=function(_0x209cf8,_0x3ea565,_0x4e23f3){var _0x28431e={};var _0x4b7343={};var _0x1f6925;var _0x46a52d;return db['WhatsappAccount'][_0x0ad9('0x67')]({'where':{'id':_0x209cf8['params']['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x3ea565,null))[_0x0ad9('0x37')](function(_0x4e691b){if(_0x4e691b){_0x1f6925=_0x4e691b;_0x4b7343[_0x0ad9('0x45')]=_['keys'](db[_0x0ad9('0x79')][_0x0ad9('0x42')]);_0x4b7343['query']=_[_0x0ad9('0x46')](_0x209cf8[_0x0ad9('0x47')]);_0x4b7343[_0x0ad9('0x48')]=_[_0x0ad9('0x49')](_0x4b7343[_0x0ad9('0x45')],_0x4b7343[_0x0ad9('0x47')]);_0x28431e[_0x0ad9('0x4a')]=_[_0x0ad9('0x49')](_0x4b7343[_0x0ad9('0x45')],qs['fields'](_0x209cf8[_0x0ad9('0x47')]['fields']));_0x28431e['attributes']=_0x28431e['attributes'][_0x0ad9('0x4c')]?_0x28431e[_0x0ad9('0x4a')]:_0x4b7343['model'];_0x28431e[_0x0ad9('0x68')]=qs['sort'](_0x209cf8[_0x0ad9('0x47')][_0x0ad9('0x4f')]);_0x28431e[_0x0ad9('0x52')]=qs[_0x0ad9('0x48')](_['pick'](_0x209cf8[_0x0ad9('0x47')],_0x4b7343[_0x0ad9('0x48')]));if(_0x209cf8[_0x0ad9('0x47')][_0x0ad9('0x51')]){_0x28431e[_0x0ad9('0x52')]=_[_0x0ad9('0x53')](_0x28431e[_0x0ad9('0x52')],{'$or':_[_0x0ad9('0x40')](_0x28431e[_0x0ad9('0x4a')],function(_0x19e892){var _0x3010b5={};_0x3010b5[_0x19e892]={'$like':'%'+_0x209cf8[_0x0ad9('0x47')][_0x0ad9('0x51')]+'%'};return _0x3010b5;})});}_0x28431e=_[_0x0ad9('0x53')]({},_0x28431e,_0x209cf8[_0x0ad9('0x55')]);return _0x1f6925['getAgents'](_0x28431e);}})[_0x0ad9('0x37')](function(_0x27ce01){if(_0x27ce01){_0x46a52d=_0x27ce01[_0x0ad9('0x4c')];if(!_0x209cf8[_0x0ad9('0x47')]['hasOwnProperty'](_0x0ad9('0x4e'))){_0x28431e[_0x0ad9('0x30')]=qs['limit'](_0x209cf8[_0x0ad9('0x47')][_0x0ad9('0x30')]);_0x28431e[_0x0ad9('0x2e')]=qs[_0x0ad9('0x2e')](_0x209cf8[_0x0ad9('0x47')]['offset']);}return _0x1f6925[_0x0ad9('0x78')](_0x28431e);}})[_0x0ad9('0x37')](function(_0xba8fd2){if(_0xba8fd2){return _0xba8fd2?{'count':_0x46a52d,'rows':_0xba8fd2}:null;}})[_0x0ad9('0x37')](respondWithResult(_0x3ea565,null))['catch'](handleError(_0x3ea565,null));};exports[_0x0ad9('0x7a')]=function(_0xc24c0,_0x402d5f,_0x3d0d21){return db[_0x0ad9('0x41')][_0x0ad9('0x67')]({'where':{'id':_0xc24c0[_0x0ad9('0x62')]['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x402d5f,null))[_0x0ad9('0x37')](function(_0x24b9b7){if(_0x24b9b7){return db[_0x0ad9('0x7b')][_0x0ad9('0x7c')](function(_0x307d78){return db[_0x0ad9('0x7d')][_0x0ad9('0x3a')]({'where':{'WhatsappAccountId':_0xc24c0[_0x0ad9('0x62')]['id']},'transaction':_0x307d78})[_0x0ad9('0x37')](function(_0x5eaacc){var _0x4b436a=_['map'](_0xc24c0['body'],function(_0x2cc93f){_0x2cc93f[_0x0ad9('0x65')]=_0xc24c0[_0x0ad9('0x62')]['id'];return _0x2cc93f;});return db['WhatsappApplication']['bulkCreate'](_0x4b436a,{'transaction':_0x307d78});});})[_0x0ad9('0x37')](function(){return db[_0x0ad9('0x7d')][_0x0ad9('0x7e')]({'where':{'WhatsappAccountId':_0xc24c0[_0x0ad9('0x62')]['id']},'order':_0x0ad9('0x7f')});});}})['then'](respondWithResult(_0x402d5f,null))['catch'](handleError(_0x402d5f,null));};exports[_0x0ad9('0x80')]=function(_0x3f000d,_0x20e266,_0x3e0ec4){var _0x4bce40={};var _0xb7ee93={};var _0x4c3de9;var _0x2cc581;return db[_0x0ad9('0x41')]['findOne']({'where':{'id':_0x3f000d[_0x0ad9('0x62')]['id']}})[_0x0ad9('0x37')](handleEntityNotFound(_0x20e266,null))[_0x0ad9('0x37')](function(_0x46a337){if(_0x46a337){_0x4c3de9=_0x46a337;_0xb7ee93[_0x0ad9('0x45')]=_[_0x0ad9('0x46')](db[_0x0ad9('0x7d')][_0x0ad9('0x42')]);_0xb7ee93[_0x0ad9('0x47')]=_[_0x0ad9('0x46')](_0x3f000d[_0x0ad9('0x47')]);_0xb7ee93[_0x0ad9('0x48')]=_[_0x0ad9('0x49')](_0xb7ee93[_0x0ad9('0x45')],_0xb7ee93[_0x0ad9('0x47')]);_0x4bce40[_0x0ad9('0x4a')]=_[_0x0ad9('0x49')](_0xb7ee93[_0x0ad9('0x45')],qs['fields'](_0x3f000d['query'][_0x0ad9('0x4b')]));_0x4bce40[_0x0ad9('0x4a')]=_0x4bce40['attributes'][_0x0ad9('0x4c')]?_0x4bce40['attributes']:_0xb7ee93[_0x0ad9('0x45')];_0x4bce40[_0x0ad9('0x68')]=qs[_0x0ad9('0x4f')](_0x3f000d[_0x0ad9('0x47')][_0x0ad9('0x4f')]);_0x4bce40[_0x0ad9('0x52')]=qs[_0x0ad9('0x48')](_[_0x0ad9('0x50')](_0x3f000d['query'],_0xb7ee93[_0x0ad9('0x48')]));if(_0x3f000d['query'][_0x0ad9('0x51')]){_0x4bce40[_0x0ad9('0x52')]=_[_0x0ad9('0x53')](_0x4bce40[_0x0ad9('0x52')],{'$or':_[_0x0ad9('0x40')](_0x4bce40[_0x0ad9('0x4a')],function(_0x1083fc){var _0x490279={};_0x490279[_0x1083fc]={'$like':'%'+_0x3f000d[_0x0ad9('0x47')]['filter']+'%'};return _0x490279;})});}_0x4bce40=_['merge']({},_0x4bce40,_0x3f000d[_0x0ad9('0x55')]);return _0x4c3de9[_0x0ad9('0x80')](_0x4bce40);}})['then'](function(_0x3e6aeb){if(_0x3e6aeb){_0x2cc581=_0x3e6aeb['length'];if(!_0x3f000d['query'][_0x0ad9('0x4d')](_0x0ad9('0x4e'))){_0x4bce40[_0x0ad9('0x30')]=qs[_0x0ad9('0x30')](_0x3f000d['query'][_0x0ad9('0x30')]);_0x4bce40[_0x0ad9('0x2e')]=qs['offset'](_0x3f000d[_0x0ad9('0x47')][_0x0ad9('0x2e')]);}return _0x4c3de9[_0x0ad9('0x80')](_0x4bce40);}})[_0x0ad9('0x37')](function(_0x47a37a){if(_0x47a37a){return _0x47a37a?{'count':_0x2cc581,'rows':_0x47a37a}:null;}})[_0x0ad9('0x37')](respondWithResult(_0x20e266,null))[_0x0ad9('0x2a')](handleError(_0x20e266,null));};exports[_0x0ad9('0x81')]=function(_0x3a4d89,_0x4cb7e4,_0x5bbed8){var _0x1b73a0={'channel':_0x0ad9('0x82')};var _0x2db503=[];var _0x1c4f9f=[];var _0x495873={};return db['WhatsappAccount'][_0x0ad9('0x59')]({'where':{'id':_0x3a4d89[_0x0ad9('0x62')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x0ad9('0x83')}]})[_0x0ad9('0x37')](handleEntityNotFound(_0x4cb7e4,null))[_0x0ad9('0x37')](function(_0x240ddf){_0x1b73a0[_0x0ad9('0x84')]=_0x240ddf;_0x1b73a0['applications']=_['orderBy'](_0x240ddf[_0x0ad9('0x83')],[_0x0ad9('0x7f')],[_0x0ad9('0x85')]);if(_0x1b73a0['account']['Applications']){delete _0x1b73a0[_0x0ad9('0x84')][_0x0ad9('0x83')];}return db['CmContact'][_0x0ad9('0x63')]();})['then'](function(_0x363edf){if(!_0x363edf){throw new db[(_0x0ad9('0x86'))][(_0x0ad9('0x87'))](_0x0ad9('0x88'));}_0x2db503=_[_0x0ad9('0x89')](_[_0x0ad9('0x46')](_0x363edf),[_0x0ad9('0x8a'),_0x0ad9('0x8b')]);_0x1c4f9f=_[_0x0ad9('0x89')](_[_0x0ad9('0x46')](_0x363edf),[_0x0ad9('0x8a'),_0x0ad9('0x8b'),_0x0ad9('0x8c'),'ListId']);_0x1b73a0['body']={'mapKey':'mobile'};if(_0x1b73a0[_0x0ad9('0x84')][_0x0ad9('0x43')]&&_0x1b73a0[_0x0ad9('0x84')]['type']===_0x0ad9('0x8d')){_0x1b73a0[_0x0ad9('0x61')]['from']=_0x3a4d89[_0x0ad9('0x61')][_0x0ad9('0x8e')]['replace'](_0x0ad9('0x8f'),'');_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x61')]=_0x3a4d89[_0x0ad9('0x61')][_0x0ad9('0x90')];_0x1b73a0['body'][_0x0ad9('0x91')]=_0x3a4d89['body'][_0x0ad9('0x92')];}if(_0x1b73a0[_0x0ad9('0x61')]['id']){delete _0x1b73a0[_0x0ad9('0x61')]['id'];}if(_[_0x0ad9('0x93')](_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x94')])){throw new db[(_0x0ad9('0x86'))][(_0x0ad9('0x87'))](_0x0ad9('0x95'));}if(_[_0x0ad9('0x93')](_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x61')])||_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x61')]===''){throw new db[(_0x0ad9('0x86'))][(_0x0ad9('0x87'))](_0x0ad9('0x96'));}if(_[_0x0ad9('0x93')](_0x1b73a0['body']['mapKey'])){throw new db[(_0x0ad9('0x86'))][(_0x0ad9('0x87'))](_0x0ad9('0x97')+_0x1c4f9f);}if(!_['includes'](_0x1c4f9f,_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x98')])){throw new db[(_0x0ad9('0x86'))][(_0x0ad9('0x87'))](_0x0ad9('0x99')+_0x1c4f9f);}_0x495873[_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x98')]]=_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x94')];return db[_0x0ad9('0x9a')][_0x0ad9('0x59')]({'where':{'id':_0x1b73a0[_0x0ad9('0x84')][_0x0ad9('0x9b')]},'include':[{'model':db[_0x0ad9('0x9c')],'as':_0x0ad9('0x9d'),'where':_0x495873,'limit':0x1,'order':[[_0x0ad9('0x8b'),'DESC']]}]});})[_0x0ad9('0x37')](handleEntityNotFound(_0x4cb7e4,null))[_0x0ad9('0x37')](function(_0x1a699d){if(_0x1a699d){_0x1b73a0[_0x0ad9('0x9e')]=_[_0x0ad9('0x72')](_0x1a699d,[_0x0ad9('0x9d')]);if(_0x1a699d['Contacts'][_0x0ad9('0x4c')]){return _0x1a699d[_0x0ad9('0x9d')][0x0];}var _0x3fde39=_[_0x0ad9('0x18')](_0x1b73a0['body'],{'firstName':_0x1b73a0[_0x0ad9('0x61')]['from'],'ListId':_0x1a699d['id']});_0x3fde39[_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x98')]]=_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x94')];return db[_0x0ad9('0x9c')][_0x0ad9('0x5a')](_0x3fde39,{'fields':_0x2db503,'raw':!![]});}})[_0x0ad9('0x37')](handleEntityNotFound(_0x4cb7e4,null))[_0x0ad9('0x37')](function(_0xe46970){if(_0xe46970){_0x1b73a0[_0x0ad9('0x9f')]=_0xe46970;var _0x557b7b={'ContactId':_0xe46970['id'],'phone':_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x94')],'WhatsappAccountId':_0x3a4d89['params']['id']};var _0xbf9787={'ContactId':_0xe46970['id'],'WhatsappAccountId':_0x3a4d89[_0x0ad9('0x62')]['id'],'closed':![]};return db[_0x0ad9('0xa0')][_0x0ad9('0x59')]({'where':_0xbf9787})['then'](function(_0x51ecc){if(_0x51ecc){return[_0x51ecc,![]];}return db[_0x0ad9('0xa0')]['create'](_0x557b7b)[_0x0ad9('0x37')](function(_0x17d9bb){return[_0x17d9bb,!![]];});});}})[_0x0ad9('0x73')](function(_0x295eb5,_0x412243){_0x1b73a0[_0x0ad9('0xa1')]=_0x295eb5[_0x0ad9('0x38')]({'plain':!![]});_0x1b73a0[_0x0ad9('0xa1')][_0x0ad9('0xa2')]=![];if(_0x412243){if(_0x1b73a0[_0x0ad9('0x84')][_0x0ad9('0xa3')]){_0x1b73a0[_0x0ad9('0xa4')]['push']({'id':0x0,'priority':_0x1b73a0['applications']['length']+0x1,'app':'close','appdata':_0x0ad9('0xa5'),'interval':_0x0ad9('0xa6')});}_0x1b73a0[_0x0ad9('0xa1')][_0x0ad9('0xa2')]=!![];}return db[_0x0ad9('0xa7')][_0x0ad9('0x5a')]({'phone':_0x1b73a0[_0x0ad9('0x61')][_0x0ad9('0x94')],'messageId':_0x1b73a0['body'][_0x0ad9('0x91')],'body':_0x1b73a0[_0x0ad9('0x61')]['body'],'WhatsappAccountId':_0x3a4d89['params']['id'],'WhatsappInteractionId':_0x295eb5['id'],'direction':'in','ContactId':_0x295eb5['ContactId'],'AttachmentId':_0x1b73a0['body'][_0x0ad9('0xa8')]});})[_0x0ad9('0x37')](function(_0x285b94){_0x1b73a0['message']=_0x285b94;if(_0x1b73a0['interaction'][_0x0ad9('0xa9')]){return db[_0x0ad9('0x79')][_0x0ad9('0x59')]({'attributes':['id',_0x0ad9('0x3d')],'where':{'id':_0x1b73a0[_0x0ad9('0xa1')]['UserId']}})[_0x0ad9('0x37')](function(_0xe8f99c){if(_0xe8f99c){_0x1b73a0[_0x0ad9('0xa4')][_0x0ad9('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xe8f99c['name']+','+(_0x1b73a0['account'][_0x0ad9('0xab')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0ad9('0xac'),'startRouting',_0x1b73a0);});}return respondWithRpcPromise(_0x0ad9('0xac'),_0x0ad9('0xad'),_0x1b73a0);})['then'](function(_0x3cf8ad){if(_0x3cf8ad){var _0xb60d9c=0xc8;var _0x30fc97=_0x0ad9('0xae');logger[_0x0ad9('0x21')](_0x0ad9('0x25'),_0x30fc97,_0xb60d9c,_0x0ad9('0xaf'));logger[_0x0ad9('0x24')](_0x0ad9('0xb0'),_0x30fc97,_0xb60d9c,_0x0ad9('0xaf'),JSON[_0x0ad9('0xb1')](_0x3cf8ad));if(_0x1b73a0[_0x0ad9('0x84')]['type']===_0x0ad9('0x8d')){return _0x4cb7e4['status'](_0xb60d9c)['set'](_0x0ad9('0xb2'),_0x0ad9('0xb3'))[_0x0ad9('0xb4')](_0x0ad9('0xb5'));}else{return _0x4cb7e4[_0x0ad9('0x2c')](_0xb60d9c)['json'](_0x3cf8ad);}}})[_0x0ad9('0x2a')](handleError(_0x4cb7e4,null));};exports['send']=function(_0x31ed6e,_0x44ba4e,_0x4c6030){var _0x22624f,_0x5f8e5b,_0x2349a5;if(_[_0x0ad9('0x93')](_0x31ed6e[_0x0ad9('0x61')][_0x0ad9('0x61')])||_0x31ed6e[_0x0ad9('0x61')][_0x0ad9('0x61')]===''){throw new db[(_0x0ad9('0x86'))][(_0x0ad9('0x87'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x31ed6e[_0x0ad9('0x61')]['to'])){throw new db[(_0x0ad9('0x86'))][(_0x0ad9('0x87'))](_0x0ad9('0xb6'));}_0x22624f=_0x31ed6e[_0x0ad9('0x61')]['to'];return db[_0x0ad9('0x41')][_0x0ad9('0x59')]({'where':{'id':_0x31ed6e[_0x0ad9('0x62')]['id']},'include':[{'model':db[_0x0ad9('0x9a')],'as':_0x0ad9('0xb7'),'include':[{'model':db[_0x0ad9('0x9c')],'as':_0x0ad9('0x9d'),'where':{'mobile':_0x22624f},'limit':0x1,'order':[[_0x0ad9('0x8b'),'DESC']]}]}]})[_0x0ad9('0x37')](handleEntityNotFound(_0x44ba4e,null))['then'](function(_0x59e8f0){if(_0x59e8f0&&_0x59e8f0[_0x0ad9('0xb7')]){_0x5f8e5b=_0x59e8f0[_0x0ad9('0x38')]({'plain':!![]});if(_0x5f8e5b[_0x0ad9('0xb7')]&&_0x5f8e5b[_0x0ad9('0xb7')][_0x0ad9('0x9d')][_0x0ad9('0x4c')]){return _0x5f8e5b[_0x0ad9('0xb7')][_0x0ad9('0x9d')][0x0];}return db[_0x0ad9('0x9c')][_0x0ad9('0x5a')](_[_0x0ad9('0x18')](_0x31ed6e[_0x0ad9('0x61')],{'firstName':_0x22624f,'mobile':_0x22624f,'phone':_0x22624f,'ListId':_0x5f8e5b[_0x0ad9('0x9b')]}));}})['then'](handleEntityNotFound(_0x44ba4e,null))['then'](function(_0x2074a8){if(_0x2074a8){_0x2349a5=_0x2074a8;return db[_0x0ad9('0xa0')][_0x0ad9('0x59')]({'where':{'ContactId':_0x2349a5['id'],'closed':![],'WhatsappAccountId':_0x5f8e5b['id']}})['then'](function(_0x391187){if(_0x391187){return[_0x391187,![]];}return db[_0x0ad9('0xa0')][_0x0ad9('0x5a')]({'UserId':_0x31ed6e['user']['id'],'ContactId':_0x2349a5['id'],'WhatsappAccountId':_0x5f8e5b['id'],'phone':_0x22624f,'firstMsgDirection':_0x0ad9('0xb8'),'Messages':[_[_0x0ad9('0x53')](_0x31ed6e['body'],{'read':![],'body':_0x31ed6e[_0x0ad9('0x61')]['body'],'phone':_0x22624f,'WhatsappAccountId':_0x5f8e5b['id'],'UserId':_0x31ed6e[_0x0ad9('0x5b')]['id'],'ContactId':_0x2349a5['id']})]},{'include':[{'model':db[_0x0ad9('0xa7')],'as':_0x0ad9('0xb9')}]})[_0x0ad9('0x37')](function(_0x3a9fdc){return[_0x3a9fdc,!![]];});});}})[_0x0ad9('0x73')](function(_0x56607a,_0x4e58c4){if(_0x4e58c4){return _0x56607a;}return db[_0x0ad9('0xa7')]['create'](_[_0x0ad9('0x53')](_0x31ed6e[_0x0ad9('0x61')],{'read':![],'body':_0x31ed6e[_0x0ad9('0x61')][_0x0ad9('0x61')],'phone':_0x22624f,'WhatsappAccountId':_0x5f8e5b['id'],'WhatsappInteractionId':_0x56607a['id'],'UserId':_0x31ed6e['user']['id'],'ContactId':_0x2349a5['id']}))['then'](function(_0x12464a){_0x56607a['dataValues'][_0x0ad9('0xb9')]=[];_0x56607a[_0x0ad9('0xba')][_0x0ad9('0xb9')][_0x0ad9('0xbb')](_0x12464a['dataValues']);return _0x56607a;});})[_0x0ad9('0x37')](respondWithResult(_0x44ba4e,null))[_0x0ad9('0x2a')](handleError(_0x44ba4e,null));};
\ No newline at end of file
index 0a30e67..f14a195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x595c=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','save','update','remove','emit'];(function(_0x43e699,_0x57a402){var _0x60d519=function(_0x45faaf){while(--_0x45faaf){_0x43e699['push'](_0x43e699['shift']());}};_0x60d519(++_0x57a402);}(_0x595c,0xdf));var _0xc595=function(_0x59fad7,_0x1cd19e){_0x59fad7=_0x59fad7-0x0;var _0x1e508a=_0x595c[_0x59fad7];return _0x1e508a;};'use strict';var EventEmitter=require(_0xc595('0x0'));var WhatsappAccount=require(_0xc595('0x1'))['db'][_0xc595('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc595('0x3'),'afterUpdate':_0xc595('0x4'),'afterDestroy':_0xc595('0x5')};function emitEvent(_0x2cf24a){return function(_0x5daf6f,_0xac56fa,_0x4b958d){WhatsappAccountEvents[_0xc595('0x6')](_0x2cf24a+':'+_0x5daf6f['id'],_0x5daf6f);WhatsappAccountEvents['emit'](_0x2cf24a,_0x5daf6f);_0x4b958d(null);};}for(var e in events){if(events[_0xc595('0x7')](e)){var event=events[e];WhatsappAccount[_0xc595('0x8')](e,emitEvent(event));}}module[_0xc595('0x9')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xe8b5=['WhatsappAccount','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x222b8e,_0x2745ef){var _0x3a05d5=function(_0x20b594){while(--_0x20b594){_0x222b8e['push'](_0x222b8e['shift']());}};_0x3a05d5(++_0x2745ef);}(_0xe8b5,0x66));var _0x5e8b=function(_0x5bef39,_0x12095f){_0x5bef39=_0x5bef39-0x0;var _0x132ed8=_0xe8b5[_0x5bef39];return _0x132ed8;};'use strict';var EventEmitter=require(_0x5e8b('0x0'));var WhatsappAccount=require(_0x5e8b('0x1'))['db'][_0x5e8b('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e8b('0x3'),'afterUpdate':'update','afterDestroy':_0x5e8b('0x4')};function emitEvent(_0x5efadb){return function(_0x12aecb,_0x106bc0,_0xc9e02a){WhatsappAccountEvents[_0x5e8b('0x5')](_0x5efadb+':'+_0x12aecb['id'],_0x12aecb);WhatsappAccountEvents[_0x5e8b('0x5')](_0x5efadb,_0x12aecb);_0xc9e02a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x5e8b('0x6')](e,emitEvent(event));}}module[_0x5e8b('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
index e385e7c..4ff2641 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83d0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','define','whatsapp_accounts','lodash'];(function(_0x2c3f42,_0x58abc0){var _0x50cee8=function(_0x29262c){while(--_0x29262c){_0x2c3f42['push'](_0x2c3f42['shift']());}};_0x50cee8(++_0x58abc0);}(_0x83d0,0x8b));var _0x083d=function(_0x5caa2d,_0x138bab){_0x5caa2d=_0x5caa2d-0x0;var _0x264a01=_0x83d0[_0x5caa2d];return _0x264a01;};'use strict';var _=require(_0x083d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x083d('0x1'));var BPromise=require(_0x083d('0x2'));var rp=require(_0x083d('0x3'));var fs=require('fs');var path=require(_0x083d('0x4'));var rimraf=require(_0x083d('0x5'));var config=require(_0x083d('0x6'));var attributes=require(_0x083d('0x7'));module['exports']=function(_0x27e4db,_0x531a3){return _0x27e4db[_0x083d('0x8')]('WhatsappAccount',attributes,{'tableName':_0x083d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c91=['bluebird','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','moment'];(function(_0x4b4b0e,_0x6c674){var _0x4c2d91=function(_0x4d440d){while(--_0x4d440d){_0x4b4b0e['push'](_0x4b4b0e['shift']());}};_0x4c2d91(++_0x6c674);}(_0x2c91,0xe3));var _0x12c9=function(_0x3c1e72,_0x1e7f10){_0x3c1e72=_0x3c1e72-0x0;var _0x5748d5=_0x2c91[_0x3c1e72];return _0x5748d5;};'use strict';var _=require(_0x12c9('0x0'));var util=require('util');var logger=require(_0x12c9('0x1'))('api');var moment=require(_0x12c9('0x2'));var BPromise=require(_0x12c9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x12c9('0x4'));var attributes=require(_0x12c9('0x5'));module[_0x12c9('0x6')]=function(_0xcef6d3,_0x1903df){return _0xcef6d3[_0x12c9('0x7')](_0x12c9('0x8'),attributes,{'tableName':_0x12c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 41c4796..63ff748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7599=['localhost','socket.io-emitter','register','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappAccount','find','options','include','map','model','attributes','then','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x1d0c2e,_0x180406){var _0x477950=function(_0x5328d2){while(--_0x5328d2){_0x1d0c2e['push'](_0x1d0c2e['shift']());}};_0x477950(++_0x180406);}(_0x7599,0x14f));var _0x9759=function(_0x361727,_0x19fb76){_0x361727=_0x361727-0x0;var _0x121eb1=_0x7599[_0x361727];return _0x121eb1;};'use strict';var _=require(_0x9759('0x0'));var util=require(_0x9759('0x1'));var moment=require(_0x9759('0x2'));var BPromise=require(_0x9759('0x3'));var rs=require(_0x9759('0x4'));var fs=require('fs');var Redis=require(_0x9759('0x5'));var db=require(_0x9759('0x6'))['db'];var utils=require(_0x9759('0x7'));var logger=require(_0x9759('0x8'))(_0x9759('0x9'));var config=require(_0x9759('0xa'));var jayson=require(_0x9759('0xb'));var client=jayson[_0x9759('0xc')][_0x9759('0xd')]({'port':0x232a});config[_0x9759('0xe')]=_[_0x9759('0xf')](config['redis'],{'host':_0x9759('0x10'),'port':0x18eb});var socket=require(_0x9759('0x11'))(new Redis(config[_0x9759('0xe')]));require('./whatsappAccount.socket')[_0x9759('0x12')](socket);function respondWithRpcPromise(_0x5ea5c1,_0x15d1ef,_0x25df10){return new BPromise(function(_0x44e1d7,_0x5735d5){return client['request'](_0x5ea5c1,_0x25df10)['then'](function(_0x309128){logger[_0x9759('0x13')](_0x9759('0x14'),_0x15d1ef,_0x9759('0x15'));logger[_0x9759('0x16')](_0x9759('0x17'),_0x15d1ef,'request\x20sent',JSON[_0x9759('0x18')](_0x309128));if(_0x309128[_0x9759('0x19')]){if(_0x309128[_0x9759('0x19')][_0x9759('0x1a')]===0x1f4){logger[_0x9759('0x19')](_0x9759('0x14'),_0x15d1ef,_0x309128['error'][_0x9759('0x1b')]);return _0x5735d5(_0x309128[_0x9759('0x19')][_0x9759('0x1b')]);}logger[_0x9759('0x19')](_0x9759('0x14'),_0x15d1ef,_0x309128[_0x9759('0x19')]['message']);return _0x44e1d7(_0x309128[_0x9759('0x19')][_0x9759('0x1b')]);}else{logger[_0x9759('0x13')](_0x9759('0x14'),_0x15d1ef,_0x9759('0x15'));_0x44e1d7(_0x309128[_0x9759('0x1c')][_0x9759('0x1b')]);}})[_0x9759('0x1d')](function(_0x2756fd){logger[_0x9759('0x19')](_0x9759('0x14'),_0x15d1ef,_0x2756fd);_0x5735d5(_0x2756fd);});});}exports['ShowWhatsappAccount']=function(_0x5ce88d){var _0x3c91a0=this;return new Promise(function(_0x148744,_0x222223){return db[_0x9759('0x1e')][_0x9759('0x1f')]({'raw':_0x5ce88d[_0x9759('0x20')]?_0x5ce88d['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ce88d[_0x9759('0x20')]?_0x5ce88d['options']['where']||null:null,'attributes':_0x5ce88d[_0x9759('0x20')]?_0x5ce88d[_0x9759('0x20')]['attributes']||null:null,'include':_0x5ce88d[_0x9759('0x20')]?_0x5ce88d[_0x9759('0x20')][_0x9759('0x21')]?_[_0x9759('0x22')](_0x5ce88d[_0x9759('0x20')][_0x9759('0x21')],function(_0x13a327){return{'model':db[_0x13a327['model']],'as':_0x13a327['as'],'attributes':_0x13a327['attributes'],'include':_0x13a327[_0x9759('0x21')]?_[_0x9759('0x22')](_0x13a327[_0x9759('0x21')],function(_0x172418){return{'model':db[_0x172418[_0x9759('0x23')]],'as':_0x172418['as'],'attributes':_0x172418[_0x9759('0x24')],'include':_0x172418['include']?_[_0x9759('0x22')](_0x172418[_0x9759('0x21')],function(_0xdcc3db){return{'model':db[_0xdcc3db[_0x9759('0x23')]],'as':_0xdcc3db['as'],'attributes':_0xdcc3db[_0x9759('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9759('0x25')](function(_0x399332){logger[_0x9759('0x13')](_0x9759('0x26'),_0x5ce88d);logger[_0x9759('0x16')](_0x9759('0x26'),_0x5ce88d,JSON[_0x9759('0x18')](_0x399332));_0x148744(_0x399332);})[_0x9759('0x1d')](function(_0x5f23fb){logger[_0x9759('0x19')](_0x9759('0x26'),_0x5f23fb['message'],_0x5ce88d);_0x222223(_0x3c91a0['error'](0x1f4,_0x5f23fb[_0x9759('0x1b')]));});});};
\ No newline at end of file
+var _0xf672=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowWhatsappAccount','options','where','include','map','model','attributes','lodash'];(function(_0x58cb0a,_0x50cece){var _0x3e9744=function(_0x1d0f0f){while(--_0x1d0f0f){_0x58cb0a['push'](_0x58cb0a['shift']());}};_0x3e9744(++_0x50cece);}(_0xf672,0xc5));var _0x2f67=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xf672[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x2f67('0x0'));var util=require(_0x2f67('0x1'));var moment=require(_0x2f67('0x2'));var BPromise=require(_0x2f67('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f67('0x4'));var db=require(_0x2f67('0x5'))['db'];var utils=require(_0x2f67('0x6'));var logger=require(_0x2f67('0x7'))('rpc');var config=require(_0x2f67('0x8'));var jayson=require(_0x2f67('0x9'));var client=jayson[_0x2f67('0xa')][_0x2f67('0xb')]({'port':0x232a});config['redis']=_[_0x2f67('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2f67('0xd'))(new Redis(config['redis']));require(_0x2f67('0xe'))[_0x2f67('0xf')](socket);function respondWithRpcPromise(_0x2a85ca,_0x398bbb,_0x37c5b3){return new BPromise(function(_0x3e6660,_0x4161c1){return client[_0x2f67('0x10')](_0x2a85ca,_0x37c5b3)[_0x2f67('0x11')](function(_0x46e31a){logger[_0x2f67('0x12')](_0x2f67('0x13'),_0x398bbb,'request\x20sent');logger[_0x2f67('0x14')](_0x2f67('0x15'),_0x398bbb,'request\x20sent',JSON[_0x2f67('0x16')](_0x46e31a));if(_0x46e31a['error']){if(_0x46e31a[_0x2f67('0x17')]['code']===0x1f4){logger[_0x2f67('0x17')](_0x2f67('0x13'),_0x398bbb,_0x46e31a[_0x2f67('0x17')]['message']);return _0x4161c1(_0x46e31a['error'][_0x2f67('0x18')]);}logger[_0x2f67('0x17')](_0x2f67('0x13'),_0x398bbb,_0x46e31a[_0x2f67('0x17')][_0x2f67('0x18')]);return _0x3e6660(_0x46e31a[_0x2f67('0x17')][_0x2f67('0x18')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x398bbb,'request\x20sent');_0x3e6660(_0x46e31a['result']['message']);}})[_0x2f67('0x19')](function(_0x2854a2){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x398bbb,_0x2854a2);_0x4161c1(_0x2854a2);});});}exports[_0x2f67('0x1a')]=function(_0x1e2017){var _0x22581d=this;return new Promise(function(_0x1fbd24,_0xbe8812){return db['WhatsappAccount']['find']({'raw':_0x1e2017[_0x2f67('0x1b')]?_0x1e2017[_0x2f67('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1e2017[_0x2f67('0x1b')]?_0x1e2017[_0x2f67('0x1b')][_0x2f67('0x1c')]||null:null,'attributes':_0x1e2017[_0x2f67('0x1b')]?_0x1e2017[_0x2f67('0x1b')]['attributes']||null:null,'include':_0x1e2017[_0x2f67('0x1b')]?_0x1e2017[_0x2f67('0x1b')][_0x2f67('0x1d')]?_[_0x2f67('0x1e')](_0x1e2017[_0x2f67('0x1b')]['include'],function(_0x41a926){return{'model':db[_0x41a926[_0x2f67('0x1f')]],'as':_0x41a926['as'],'attributes':_0x41a926[_0x2f67('0x20')],'include':_0x41a926['include']?_['map'](_0x41a926[_0x2f67('0x1d')],function(_0x3636ef){return{'model':db[_0x3636ef[_0x2f67('0x1f')]],'as':_0x3636ef['as'],'attributes':_0x3636ef[_0x2f67('0x20')],'include':_0x3636ef['include']?_[_0x2f67('0x1e')](_0x3636ef[_0x2f67('0x1d')],function(_0x8227b7){return{'model':db[_0x8227b7[_0x2f67('0x1f')]],'as':_0x8227b7['as'],'attributes':_0x8227b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f67('0x11')](function(_0x11a039){logger['info'](_0x2f67('0x1a'),_0x1e2017);logger[_0x2f67('0x14')](_0x2f67('0x1a'),_0x1e2017,JSON[_0x2f67('0x16')](_0x11a039));_0x1fbd24(_0x11a039);})[_0x2f67('0x19')](function(_0xdb28d3){logger[_0x2f67('0x17')](_0x2f67('0x1a'),_0xdb28d3[_0x2f67('0x18')],_0x1e2017);_0xbe8812(_0x22581d['error'](0x1f4,_0xdb28d3['message']));});});};
\ No newline at end of file
index 552cfec..6b8f170 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a1f=['./whatsappAccount.events','save','update','emit','removeListener','register','length','whatsappAccount:'];(function(_0x347146,_0x5d9bd3){var _0x44c484=function(_0x509bc5){while(--_0x509bc5){_0x347146['push'](_0x347146['shift']());}};_0x44c484(++_0x5d9bd3);}(_0x3a1f,0x178));var _0xf3a1=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x3a1f[_0x433a86];return _0x23000c;};'use strict';var WhatsappAccountEvents=require(_0xf3a1('0x0'));var events=[_0xf3a1('0x1'),'remove',_0xf3a1('0x2')];function createListener(_0x5d7f71,_0x536977){return function(_0x345d7f){_0x536977[_0xf3a1('0x3')](_0x5d7f71,_0x345d7f);};}function removeListener(_0x57e573,_0x33a20f){return function(){WhatsappAccountEvents[_0xf3a1('0x4')](_0x57e573,_0x33a20f);};}exports[_0xf3a1('0x5')]=function(_0x3039d4){for(var _0x1bee56=0x0,_0x7afc9=events[_0xf3a1('0x6')];_0x1bee56<_0x7afc9;_0x1bee56++){var _0x2b123b=events[_0x1bee56];var _0x333bd9=createListener(_0xf3a1('0x7')+_0x2b123b,_0x3039d4);WhatsappAccountEvents['on'](_0x2b123b,_0x333bd9);}};
\ No newline at end of file
+var _0x2f03=['update','emit','register','./whatsappAccount.events','save','remove'];(function(_0x583292,_0x2277dd){var _0x1e1a32=function(_0x576c73){while(--_0x576c73){_0x583292['push'](_0x583292['shift']());}};_0x1e1a32(++_0x2277dd);}(_0x2f03,0x10b));var _0x32f0=function(_0x6be99e,_0x48cf79){_0x6be99e=_0x6be99e-0x0;var _0x3ccdb3=_0x2f03[_0x6be99e];return _0x3ccdb3;};'use strict';var WhatsappAccountEvents=require(_0x32f0('0x0'));var events=[_0x32f0('0x1'),_0x32f0('0x2'),_0x32f0('0x3')];function createListener(_0x476aaf,_0x341cb7){return function(_0x3bb768){_0x341cb7[_0x32f0('0x4')](_0x476aaf,_0x3bb768);};}function removeListener(_0x16e844,_0x1a032f){return function(){WhatsappAccountEvents['removeListener'](_0x16e844,_0x1a032f);};}exports[_0x32f0('0x5')]=function(_0x16a9cf){for(var _0x4546c8=0x0,_0x512853=events['length'];_0x4546c8<_0x512853;_0x4546c8++){var _0xe244a4=events[_0x4546c8];var _0x20ad2c=createListener('whatsappAccount:'+_0xe244a4,_0x16a9cf);WhatsappAccountEvents['on'](_0xe244a4,_0x20ad2c);}};
\ No newline at end of file
index a63edfc..eecf36d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66b1=['destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x66b1,0x131));var _0x166b=function(_0x49c5c3,_0x503f17){_0x49c5c3=_0x49c5c3-0x0;var _0x343cd1=_0x66b1[_0x49c5c3];return _0x343cd1;};'use strict';var multer=require(_0x166b('0x0'));var util=require(_0x166b('0x1'));var path=require(_0x166b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x166b('0x3')]();var fs_extra=require(_0x166b('0x4'));var auth=require(_0x166b('0x5'));var interaction=require(_0x166b('0x6'));var config=require(_0x166b('0x7'));var controller=require(_0x166b('0x8'));router['get']('/',auth[_0x166b('0x9')](),controller[_0x166b('0xa')]);router[_0x166b('0xb')](_0x166b('0xc'),auth[_0x166b('0x9')](),controller[_0x166b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x166b('0xe')]);router[_0x166b('0xf')](_0x166b('0xc'),auth[_0x166b('0x9')](),controller[_0x166b('0x10')]);router[_0x166b('0x11')](_0x166b('0xc'),auth[_0x166b('0x9')](),controller[_0x166b('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x9c24=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xecab8,_0x54c092){var _0x4bb052=function(_0x56ce4a){while(--_0x56ce4a){_0xecab8['push'](_0xecab8['shift']());}};_0x4bb052(++_0x54c092);}(_0x9c24,0xb0));var _0x49c2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9c24[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x49c2('0x0'));var util=require(_0x49c2('0x1'));var path=require(_0x49c2('0x2'));var timeout=require(_0x49c2('0x3'));var express=require(_0x49c2('0x4'));var router=express[_0x49c2('0x5')]();var fs_extra=require(_0x49c2('0x6'));var auth=require(_0x49c2('0x7'));var interaction=require(_0x49c2('0x8'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x49c2('0x9')]);router[_0x49c2('0xa')](_0x49c2('0xb'),auth[_0x49c2('0xc')](),controller['show']);router[_0x49c2('0xd')]('/',auth[_0x49c2('0xc')](),controller[_0x49c2('0xe')]);router[_0x49c2('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x49c2('0x10')]);router[_0x49c2('0x11')](_0x49c2('0xb'),auth[_0x49c2('0xc')](),controller[_0x49c2('0x12')]);module[_0x49c2('0x13')]=router;
\ No newline at end of file
index 451511c..4d9801e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5f=['INTEGER','TEXT','*,*,*,*','sequelize'];(function(_0x4d8244,_0xf3eead){var _0xcf5a5b=function(_0x2fdb2f){while(--_0x2fdb2f){_0x4d8244['push'](_0x4d8244['shift']());}};_0xcf5a5b(++_0xf3eead);}(_0x9c5f,0x9b));var _0xf9c5=function(_0x58563f,_0x196ea2){_0x58563f=_0x58563f-0x0;var _0xe50dc7=_0x9c5f[_0x58563f];return _0xe50dc7;};'use strict';var Sequelize=require(_0xf9c5('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf9c5('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf9c5('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf9c5('0x3')}};
\ No newline at end of file
+var _0xd307=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x58a36d,_0x57d9cb){var _0x2d27e1=function(_0xf07e2a){while(--_0xf07e2a){_0x58a36d['push'](_0x58a36d['shift']());}};_0x2d27e1(++_0x57d9cb);}(_0xd307,0x1d7));var _0x7d30=function(_0x35cd44,_0x68d063){_0x35cd44=_0x35cd44-0x0;var _0x3f456f=_0xd307[_0x35cd44];return _0x3f456f;};'use strict';var Sequelize=require(_0x7d30('0x0'));module[_0x7d30('0x1')]={'priority':{'type':Sequelize[_0x7d30('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7d30('0x3')},'appdata':{'type':Sequelize[_0x7d30('0x4')]()},'description':{'type':Sequelize[_0x7d30('0x5')]},'interval':{'type':Sequelize[_0x7d30('0x5')],'defaultValue':_0x7d30('0x6')}};
\ No newline at end of file
index 88231e5..553c6c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4253=['update','then','destroy','error','stack','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','include','options','catch','create','body','find','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject'];(function(_0x10b4b8,_0x450fea){var _0x424293=function(_0x58ad42){while(--_0x58ad42){_0x10b4b8['push'](_0x10b4b8['shift']());}};_0x424293(++_0x450fea);}(_0x4253,0x14c));var _0x3425=function(_0x3d9dd0,_0x58f802){_0x3d9dd0=_0x3d9dd0-0x0;var _0x7d290=_0x4253[_0x3d9dd0];return _0x7d290;};'use strict';var emlformat=require(_0x3425('0x0'));var rimraf=require(_0x3425('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3425('0x2'));var rp=require('request-promise');var moment=require(_0x3425('0x3'));var BPromise=require(_0x3425('0x4'));var Mustache=require(_0x3425('0x5'));var util=require(_0x3425('0x6'));var path=require(_0x3425('0x7'));var sox=require(_0x3425('0x8'));var csv=require(_0x3425('0x9'));var ejs=require(_0x3425('0xa'));var fs=require('fs');var fs_extra=require(_0x3425('0xb'));var _=require('lodash');var squel=require(_0x3425('0xc'));var crypto=require(_0x3425('0xd'));var jsforce=require(_0x3425('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3425('0x9'));var querystring=require(_0x3425('0xf'));var Papa=require('papaparse');var Redis=require(_0x3425('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3425('0x11'));var logger=require(_0x3425('0x12'))(_0x3425('0x13'));var utils=require('../../config/utils');var config=require(_0x3425('0x14'));var licenseUtil=require(_0x3425('0x15'));var db=require(_0x3425('0x16'))['db'];function respondWithStatusCode(_0x5a5cd2,_0xb19960){_0xb19960=_0xb19960||0xcc;return function(_0x31afd8){if(_0x31afd8){return _0x5a5cd2[_0x3425('0x17')](_0xb19960);}return _0x5a5cd2[_0x3425('0x18')](_0xb19960)[_0x3425('0x19')]();};}function respondWithResult(_0x440cc1,_0x42e226){_0x42e226=_0x42e226||0xc8;return function(_0x4ded18){if(_0x4ded18){return _0x440cc1[_0x3425('0x18')](_0x42e226)['json'](_0x4ded18);}};}function respondWithFilteredResult(_0x3c77e6,_0x23aac7){return function(_0x534aed){if(_0x534aed){var _0x169458=typeof _0x23aac7[_0x3425('0x1a')]==='undefined'&&typeof _0x23aac7[_0x3425('0x1b')]==='undefined';var _0xd43449=_0x534aed[_0x3425('0x1c')];var _0x1565c8=_0x169458?0x0:_0x23aac7[_0x3425('0x1a')];var _0x4d5933=_0x169458?_0x534aed[_0x3425('0x1c')]:_0x23aac7['offset']+_0x23aac7[_0x3425('0x1b')];var _0xe4b66e;if(_0x4d5933>=_0xd43449){_0x4d5933=_0xd43449;_0xe4b66e=0xc8;}else{_0xe4b66e=0xce;}_0x3c77e6[_0x3425('0x18')](_0xe4b66e);return _0x3c77e6[_0x3425('0x1d')](_0x3425('0x1e'),_0x1565c8+'-'+_0x4d5933+'/'+_0xd43449)[_0x3425('0x1f')](_0x534aed);}return null;};}function patchUpdates(_0x1e12bb){return function(_0x264d65){try{jsonpatch['apply'](_0x264d65,_0x1e12bb,!![]);}catch(_0x4a6131){return BPromise[_0x3425('0x20')](_0x4a6131);}return _0x264d65['save']();};}function saveUpdates(_0x1ef660,_0x26710c){return function(_0x11705a){if(_0x11705a){return _0x11705a[_0x3425('0x21')](_0x1ef660)[_0x3425('0x22')](function(_0x2f9881){return _0x2f9881;});}return null;};}function removeEntity(_0x520aba,_0x38b577){return function(_0x34617c){if(_0x34617c){return _0x34617c[_0x3425('0x23')]()[_0x3425('0x22')](function(){_0x520aba['status'](0xcc)[_0x3425('0x19')]();});}};}function handleEntityNotFound(_0x31d4d5,_0x2a2162){return function(_0x407a76){if(!_0x407a76){_0x31d4d5[_0x3425('0x17')](0x194);}return _0x407a76;};}function handleError(_0x3322be,_0x3f2e34){_0x3f2e34=_0x3f2e34||0x1f4;return function(_0x2638b5){logger[_0x3425('0x24')](_0x2638b5[_0x3425('0x25')]);if(_0x2638b5[_0x3425('0x26')]){delete _0x2638b5[_0x3425('0x26')];}_0x3322be[_0x3425('0x18')](_0x3f2e34)[_0x3425('0x27')](_0x2638b5);};}exports['index']=function(_0x1ae04f,_0x453914){var _0x3ca2b7={},_0x27f416={},_0x1452b6={'count':0x0,'rows':[]};var _0x1b732a=_[_0x3425('0x28')](db[_0x3425('0x29')][_0x3425('0x2a')],function(_0x15aca6){return{'name':_0x15aca6[_0x3425('0x2b')],'type':_0x15aca6[_0x3425('0x2c')][_0x3425('0x2d')]};});_0x27f416[_0x3425('0x2e')]=_[_0x3425('0x28')](_0x1b732a,_0x3425('0x26'));_0x27f416[_0x3425('0x2f')]=_[_0x3425('0x30')](_0x1ae04f['query']);_0x27f416[_0x3425('0x31')]=_[_0x3425('0x32')](_0x27f416[_0x3425('0x2e')],_0x27f416['query']);_0x3ca2b7[_0x3425('0x33')]=_[_0x3425('0x32')](_0x27f416[_0x3425('0x2e')],qs[_0x3425('0x34')](_0x1ae04f[_0x3425('0x2f')][_0x3425('0x34')]));_0x3ca2b7[_0x3425('0x33')]=_0x3ca2b7[_0x3425('0x33')][_0x3425('0x35')]?_0x3ca2b7[_0x3425('0x33')]:_0x27f416[_0x3425('0x2e')];if(!_0x1ae04f[_0x3425('0x2f')]['hasOwnProperty'](_0x3425('0x36'))){_0x3ca2b7[_0x3425('0x1b')]=qs[_0x3425('0x1b')](_0x1ae04f[_0x3425('0x2f')][_0x3425('0x1b')]);_0x3ca2b7[_0x3425('0x1a')]=qs[_0x3425('0x1a')](_0x1ae04f[_0x3425('0x2f')][_0x3425('0x1a')]);}_0x3ca2b7[_0x3425('0x37')]=qs[_0x3425('0x38')](_0x1ae04f[_0x3425('0x2f')]['sort']);_0x3ca2b7[_0x3425('0x39')]=qs[_0x3425('0x31')](_[_0x3425('0x3a')](_0x1ae04f[_0x3425('0x2f')],_0x27f416[_0x3425('0x31')]),_0x1b732a);if(_0x1ae04f[_0x3425('0x2f')][_0x3425('0x3b')]){_0x3ca2b7[_0x3425('0x39')]=_[_0x3425('0x3c')](_0x3ca2b7[_0x3425('0x39')],{'$or':_[_0x3425('0x28')](_0x1b732a,function(_0x48f5dc){if(_0x48f5dc[_0x3425('0x2c')]!==_0x3425('0x3d')){var _0x526c3b={};_0x526c3b[_0x48f5dc[_0x3425('0x26')]]={'$like':'%'+_0x1ae04f[_0x3425('0x2f')][_0x3425('0x3b')]+'%'};return _0x526c3b;}})});}_0x3ca2b7=_[_0x3425('0x3c')]({},_0x3ca2b7,_0x1ae04f['options']);var _0x23733e={'where':_0x3ca2b7[_0x3425('0x39')]};return db[_0x3425('0x29')]['count'](_0x23733e)['then'](function(_0x40a959){_0x1452b6[_0x3425('0x1c')]=_0x40a959;if(_0x1ae04f[_0x3425('0x2f')][_0x3425('0x3e')]){_0x3ca2b7['include']=[{'all':!![]}];}return db[_0x3425('0x29')][_0x3425('0x3f')](_0x3ca2b7);})[_0x3425('0x22')](function(_0x175084){_0x1452b6[_0x3425('0x40')]=_0x175084;return _0x1452b6;})[_0x3425('0x22')](respondWithFilteredResult(_0x453914,_0x3ca2b7))['catch'](handleError(_0x453914,null));};exports[_0x3425('0x41')]=function(_0xfa49c0,_0x56348d){var _0x4a5fb1={'raw':!![],'where':{'id':_0xfa49c0['params']['id']}},_0x1b8633={};_0x1b8633[_0x3425('0x2e')]=_[_0x3425('0x30')](db[_0x3425('0x29')][_0x3425('0x2a')]);_0x1b8633[_0x3425('0x2f')]=_[_0x3425('0x30')](_0xfa49c0[_0x3425('0x2f')]);_0x1b8633['filters']=_['intersection'](_0x1b8633[_0x3425('0x2e')],_0x1b8633[_0x3425('0x2f')]);_0x4a5fb1[_0x3425('0x33')]=_[_0x3425('0x32')](_0x1b8633[_0x3425('0x2e')],qs[_0x3425('0x34')](_0xfa49c0['query'][_0x3425('0x34')]));_0x4a5fb1[_0x3425('0x33')]=_0x4a5fb1[_0x3425('0x33')][_0x3425('0x35')]?_0x4a5fb1[_0x3425('0x33')]:_0x1b8633[_0x3425('0x2e')];if(_0xfa49c0['query'][_0x3425('0x3e')]){_0x4a5fb1[_0x3425('0x42')]=[{'all':!![]}];}_0x4a5fb1=_['merge']({},_0x4a5fb1,_0xfa49c0[_0x3425('0x43')]);return db['WhatsappApplication']['find'](_0x4a5fb1)[_0x3425('0x22')](handleEntityNotFound(_0x56348d,null))[_0x3425('0x22')](respondWithResult(_0x56348d,null))[_0x3425('0x44')](handleError(_0x56348d,null));};exports['create']=function(_0x11715f,_0x4cb1f5){return db[_0x3425('0x29')][_0x3425('0x45')](_0x11715f['body'],{})[_0x3425('0x22')](respondWithResult(_0x4cb1f5,0xc9))[_0x3425('0x44')](handleError(_0x4cb1f5,null));};exports[_0x3425('0x21')]=function(_0x17626f,_0x357312){if(_0x17626f[_0x3425('0x46')]['id']){delete _0x17626f[_0x3425('0x46')]['id'];}return db[_0x3425('0x29')][_0x3425('0x47')]({'where':{'id':_0x17626f[_0x3425('0x48')]['id']}})[_0x3425('0x22')](handleEntityNotFound(_0x357312,null))['then'](saveUpdates(_0x17626f[_0x3425('0x46')],null))[_0x3425('0x22')](respondWithResult(_0x357312,null))['catch'](handleError(_0x357312,null));};exports[_0x3425('0x23')]=function(_0x397727,_0x4b2a9a){return db['WhatsappApplication'][_0x3425('0x47')]({'where':{'id':_0x397727[_0x3425('0x48')]['id']}})[_0x3425('0x22')](handleEntityNotFound(_0x4b2a9a,null))['then'](removeEntity(_0x4b2a9a,null))[_0x3425('0x44')](handleError(_0x4b2a9a,null));};
\ No newline at end of file
+var _0xba6f=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','WhatsappApplication','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0xa1f4ad,_0x308e1c){var _0x11c356=function(_0x111bde){while(--_0x111bde){_0xa1f4ad['push'](_0xa1f4ad['shift']());}};_0x11c356(++_0x308e1c);}(_0xba6f,0x1d0));var _0xfba6=function(_0x3b677a,_0x274ecc){_0x3b677a=_0x3b677a-0x0;var _0x2e2eb6=_0xba6f[_0x3b677a];return _0x2e2eb6;};'use strict';var emlformat=require(_0xfba6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfba6('0x1'));var jsonpatch=require(_0xfba6('0x2'));var rp=require(_0xfba6('0x3'));var moment=require(_0xfba6('0x4'));var BPromise=require(_0xfba6('0x5'));var Mustache=require(_0xfba6('0x6'));var util=require(_0xfba6('0x7'));var path=require(_0xfba6('0x8'));var sox=require(_0xfba6('0x9'));var csv=require(_0xfba6('0xa'));var ejs=require(_0xfba6('0xb'));var fs=require('fs');var fs_extra=require(_0xfba6('0xc'));var _=require(_0xfba6('0xd'));var squel=require('squel');var crypto=require(_0xfba6('0xe'));var jsforce=require(_0xfba6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfba6('0x10'));var Redis=require(_0xfba6('0x11'));var authService=require(_0xfba6('0x12'));var qs=require(_0xfba6('0x13'));var as=require(_0xfba6('0x14'));var hardwareService=require(_0xfba6('0x15'));var logger=require(_0xfba6('0x16'))(_0xfba6('0x17'));var utils=require(_0xfba6('0x18'));var config=require(_0xfba6('0x19'));var licenseUtil=require(_0xfba6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcfafdb,_0xd34d87){_0xd34d87=_0xd34d87||0xcc;return function(_0x315faf){if(_0x315faf){return _0xcfafdb[_0xfba6('0x1b')](_0xd34d87);}return _0xcfafdb['status'](_0xd34d87)[_0xfba6('0x1c')]();};}function respondWithResult(_0x5dc9e1,_0x4f465f){_0x4f465f=_0x4f465f||0xc8;return function(_0x184169){if(_0x184169){return _0x5dc9e1[_0xfba6('0x1d')](_0x4f465f)[_0xfba6('0x1e')](_0x184169);}};}function respondWithFilteredResult(_0x1d76de,_0x38055e){return function(_0x2c4692){if(_0x2c4692){var _0x24b6a0=typeof _0x38055e[_0xfba6('0x1f')]===_0xfba6('0x20')&&typeof _0x38055e[_0xfba6('0x21')]===_0xfba6('0x20');var _0xf3dbbc=_0x2c4692[_0xfba6('0x22')];var _0x5a29a4=_0x24b6a0?0x0:_0x38055e[_0xfba6('0x1f')];var _0x267c09=_0x24b6a0?_0x2c4692['count']:_0x38055e['offset']+_0x38055e[_0xfba6('0x21')];var _0x204784;if(_0x267c09>=_0xf3dbbc){_0x267c09=_0xf3dbbc;_0x204784=0xc8;}else{_0x204784=0xce;}_0x1d76de['status'](_0x204784);return _0x1d76de[_0xfba6('0x23')](_0xfba6('0x24'),_0x5a29a4+'-'+_0x267c09+'/'+_0xf3dbbc)[_0xfba6('0x1e')](_0x2c4692);}return null;};}function patchUpdates(_0x4f1d15){return function(_0x167528){try{jsonpatch[_0xfba6('0x25')](_0x167528,_0x4f1d15,!![]);}catch(_0xa16868){return BPromise['reject'](_0xa16868);}return _0x167528[_0xfba6('0x26')]();};}function saveUpdates(_0x12f000,_0x25e0ff){return function(_0x2afd26){if(_0x2afd26){return _0x2afd26[_0xfba6('0x27')](_0x12f000)[_0xfba6('0x28')](function(_0x203a4e){return _0x203a4e;});}return null;};}function removeEntity(_0x56b427,_0x5e09ff){return function(_0x41b356){if(_0x41b356){return _0x41b356[_0xfba6('0x29')]()[_0xfba6('0x28')](function(){_0x56b427[_0xfba6('0x1d')](0xcc)[_0xfba6('0x1c')]();});}};}function handleEntityNotFound(_0x53c99a,_0x408ccc){return function(_0x4114bc){if(!_0x4114bc){_0x53c99a[_0xfba6('0x1b')](0x194);}return _0x4114bc;};}function handleError(_0x11bde3,_0x3af399){_0x3af399=_0x3af399||0x1f4;return function(_0x7c7f6a){logger['error'](_0x7c7f6a[_0xfba6('0x2a')]);if(_0x7c7f6a[_0xfba6('0x2b')]){delete _0x7c7f6a['name'];}_0x11bde3[_0xfba6('0x1d')](_0x3af399)[_0xfba6('0x2c')](_0x7c7f6a);};}exports['index']=function(_0x2d703e,_0x3da118){var _0x5f31af={},_0x47973f={},_0x56e8e6={'count':0x0,'rows':[]};var _0xf8134a=_[_0xfba6('0x2d')](db[_0xfba6('0x2e')]['rawAttributes'],function(_0x17440e){return{'name':_0x17440e[_0xfba6('0x2f')],'type':_0x17440e[_0xfba6('0x30')][_0xfba6('0x31')]};});_0x47973f['model']=_[_0xfba6('0x2d')](_0xf8134a,'name');_0x47973f[_0xfba6('0x32')]=_[_0xfba6('0x33')](_0x2d703e[_0xfba6('0x32')]);_0x47973f[_0xfba6('0x34')]=_[_0xfba6('0x35')](_0x47973f['model'],_0x47973f[_0xfba6('0x32')]);_0x5f31af[_0xfba6('0x36')]=_['intersection'](_0x47973f[_0xfba6('0x37')],qs[_0xfba6('0x38')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x38')]));_0x5f31af[_0xfba6('0x36')]=_0x5f31af[_0xfba6('0x36')][_0xfba6('0x39')]?_0x5f31af[_0xfba6('0x36')]:_0x47973f[_0xfba6('0x37')];if(!_0x2d703e[_0xfba6('0x32')][_0xfba6('0x3a')](_0xfba6('0x3b'))){_0x5f31af['limit']=qs[_0xfba6('0x21')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x21')]);_0x5f31af[_0xfba6('0x1f')]=qs[_0xfba6('0x1f')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x1f')]);}_0x5f31af[_0xfba6('0x3c')]=qs[_0xfba6('0x3d')](_0x2d703e[_0xfba6('0x32')][_0xfba6('0x3d')]);_0x5f31af['where']=qs[_0xfba6('0x34')](_['pick'](_0x2d703e[_0xfba6('0x32')],_0x47973f[_0xfba6('0x34')]),_0xf8134a);if(_0x2d703e[_0xfba6('0x32')][_0xfba6('0x3e')]){_0x5f31af[_0xfba6('0x3f')]=_[_0xfba6('0x40')](_0x5f31af[_0xfba6('0x3f')],{'$or':_[_0xfba6('0x2d')](_0xf8134a,function(_0x5bad10){if(_0x5bad10[_0xfba6('0x30')]!==_0xfba6('0x41')){var _0x4807f5={};_0x4807f5[_0x5bad10[_0xfba6('0x2b')]]={'$like':'%'+_0x2d703e['query'][_0xfba6('0x3e')]+'%'};return _0x4807f5;}})});}_0x5f31af=_[_0xfba6('0x40')]({},_0x5f31af,_0x2d703e['options']);var _0x203c67={'where':_0x5f31af[_0xfba6('0x3f')]};return db[_0xfba6('0x2e')]['count'](_0x203c67)[_0xfba6('0x28')](function(_0x18d17c){_0x56e8e6[_0xfba6('0x22')]=_0x18d17c;if(_0x2d703e[_0xfba6('0x32')][_0xfba6('0x42')]){_0x5f31af[_0xfba6('0x43')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xfba6('0x44')](_0x5f31af);})[_0xfba6('0x28')](function(_0x27a493){_0x56e8e6[_0xfba6('0x45')]=_0x27a493;return _0x56e8e6;})[_0xfba6('0x28')](respondWithFilteredResult(_0x3da118,_0x5f31af))[_0xfba6('0x46')](handleError(_0x3da118,null));};exports[_0xfba6('0x47')]=function(_0x28a9d6,_0x51ee39){var _0x47ca82={'raw':!![],'where':{'id':_0x28a9d6['params']['id']}},_0x18b81d={};_0x18b81d[_0xfba6('0x37')]=_[_0xfba6('0x33')](db[_0xfba6('0x2e')][_0xfba6('0x48')]);_0x18b81d['query']=_[_0xfba6('0x33')](_0x28a9d6['query']);_0x18b81d[_0xfba6('0x34')]=_['intersection'](_0x18b81d[_0xfba6('0x37')],_0x18b81d[_0xfba6('0x32')]);_0x47ca82[_0xfba6('0x36')]=_[_0xfba6('0x35')](_0x18b81d[_0xfba6('0x37')],qs[_0xfba6('0x38')](_0x28a9d6[_0xfba6('0x32')][_0xfba6('0x38')]));_0x47ca82[_0xfba6('0x36')]=_0x47ca82['attributes'][_0xfba6('0x39')]?_0x47ca82[_0xfba6('0x36')]:_0x18b81d[_0xfba6('0x37')];if(_0x28a9d6[_0xfba6('0x32')][_0xfba6('0x42')]){_0x47ca82[_0xfba6('0x43')]=[{'all':!![]}];}_0x47ca82=_[_0xfba6('0x40')]({},_0x47ca82,_0x28a9d6[_0xfba6('0x49')]);return db[_0xfba6('0x2e')][_0xfba6('0x4a')](_0x47ca82)[_0xfba6('0x28')](handleEntityNotFound(_0x51ee39,null))[_0xfba6('0x28')](respondWithResult(_0x51ee39,null))[_0xfba6('0x46')](handleError(_0x51ee39,null));};exports[_0xfba6('0x4b')]=function(_0x2c3e90,_0x56900e){return db[_0xfba6('0x2e')][_0xfba6('0x4b')](_0x2c3e90[_0xfba6('0x4c')],{})[_0xfba6('0x28')](respondWithResult(_0x56900e,0xc9))[_0xfba6('0x46')](handleError(_0x56900e,null));};exports[_0xfba6('0x27')]=function(_0x26c050,_0xb637ca){if(_0x26c050['body']['id']){delete _0x26c050['body']['id'];}return db[_0xfba6('0x2e')][_0xfba6('0x4a')]({'where':{'id':_0x26c050[_0xfba6('0x4d')]['id']}})[_0xfba6('0x28')](handleEntityNotFound(_0xb637ca,null))[_0xfba6('0x28')](saveUpdates(_0x26c050['body'],null))['then'](respondWithResult(_0xb637ca,null))[_0xfba6('0x46')](handleError(_0xb637ca,null));};exports[_0xfba6('0x29')]=function(_0x4f78ff,_0x4c150){return db[_0xfba6('0x2e')][_0xfba6('0x4a')]({'where':{'id':_0x4f78ff['params']['id']}})[_0xfba6('0x28')](handleEntityNotFound(_0x4c150,null))['then'](removeEntity(_0x4c150,null))[_0xfba6('0x46')](handleError(_0x4c150,null));};
\ No newline at end of file
index 1511e59..e9837bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb903=['api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0xb903,0x185));var _0x3b90=function(_0x406504,_0x5902ad){_0x406504=_0x406504-0x0;var _0x5ef097=_0xb903[_0x406504];return _0x5ef097;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('WhatsappApplication',attributes,{'tableName':_0x3b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3b90('0xc'),'collate':_0x3b90('0xd')});};
\ No newline at end of file
+var _0xca8d=['whatsapp_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication'];(function(_0x2b100f,_0x237749){var _0x38edf2=function(_0x7702b){while(--_0x7702b){_0x2b100f['push'](_0x2b100f['shift']());}};_0x38edf2(++_0x237749);}(_0xca8d,0x172));var _0xdca8=function(_0x4decad,_0x361d84){_0x4decad=_0x4decad-0x0;var _0x334651=_0xca8d[_0x4decad];return _0x334651;};'use strict';var _=require(_0xdca8('0x0'));var util=require(_0xdca8('0x1'));var logger=require(_0xdca8('0x2'))(_0xdca8('0x3'));var moment=require(_0xdca8('0x4'));var BPromise=require(_0xdca8('0x5'));var rp=require(_0xdca8('0x6'));var fs=require('fs');var path=require(_0xdca8('0x7'));var rimraf=require(_0xdca8('0x8'));var config=require(_0xdca8('0x9'));var attributes=require(_0xdca8('0xa'));module[_0xdca8('0xb')]=function(_0x4d6383,_0x3366d5){return _0x4d6383[_0xdca8('0xc')](_0xdca8('0xd'),attributes,{'tableName':_0xdca8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdca8('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index c3784fc..5a4a5a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x2d17,0x17e));var _0x72d1=function(_0x390b25,_0x1faec1){_0x390b25=_0x390b25-0x0;var _0x3f6fd7=_0x2d17[_0x390b25];return _0x3f6fd7;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});}
\ No newline at end of file
+var _0x5c12=['../../config/environment','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0x5c12,0x188));var _0x25c1=function(_0x6aad74,_0x32ecf4){_0x6aad74=_0x6aad74-0x0;var _0x5b1c38=_0x5c12[_0x6aad74];return _0x5b1c38;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});}
\ No newline at end of file
index fbcf390..f2f093c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc492=['describe','/:id','/:id/download','download','post','create','/:id/messages','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0xc492,0xd7));var _0x2c49=function(_0x116f49,_0x408558){_0x116f49=_0x116f49-0x0;var _0x4aa320=_0xc492[_0x116f49];return _0x4aa320;};'use strict';var multer=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var path=require(_0x2c49('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c49('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2c49('0x4'));var config=require(_0x2c49('0x5'));var controller=require('./whatsappInteraction.controller');router[_0x2c49('0x6')]('/',auth['isAuthenticated'](),controller[_0x2c49('0x7')]);router[_0x2c49('0x6')]('/describe',auth[_0x2c49('0x8')](),controller[_0x2c49('0x9')]);router[_0x2c49('0x6')](_0x2c49('0xa'),auth[_0x2c49('0x8')](),controller['show']);router[_0x2c49('0x6')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x2c49('0xb'),auth['isAuthenticated'](),controller[_0x2c49('0xc')]);router[_0x2c49('0xd')]('/',auth['isAuthenticated'](),controller[_0x2c49('0xe')]);router[_0x2c49('0xd')](_0x2c49('0xf'),auth[_0x2c49('0x8')](),controller[_0x2c49('0x10')]);router[_0x2c49('0xd')]('/:id/tags',auth[_0x2c49('0x8')](),interaction[_0x2c49('0x11')](_0x2c49('0x12'),_0x2c49('0x13')),controller[_0x2c49('0x14')]);router['put'](_0x2c49('0xa'),auth[_0x2c49('0x8')](),interaction[_0x2c49('0x11')](_0x2c49('0x12'),_0x2c49('0x15')),controller[_0x2c49('0x16')]);router[_0x2c49('0x17')](_0x2c49('0xa'),auth[_0x2c49('0x8')](),interaction[_0x2c49('0x11')]('whatsapp',_0x2c49('0x18')),controller[_0x2c49('0x19')]);router[_0x2c49('0x17')](_0x2c49('0x1a'),auth['isAuthenticated'](),controller[_0x2c49('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x6596=['whatsappinteraction:destroy','delete','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update'];(function(_0x2b33d7,_0x4c6a42){var _0x5f3a31=function(_0x6a72b0){while(--_0x6a72b0){_0x2b33d7['push'](_0x2b33d7['shift']());}};_0x5f3a31(++_0x4c6a42);}(_0x6596,0x1d3));var _0x6659=function(_0x59d9c0,_0x3b3459){_0x59d9c0=_0x59d9c0-0x0;var _0x2d27e1=_0x6596[_0x59d9c0];return _0x2d27e1;};'use strict';var multer=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var path=require('path');var timeout=require(_0x6659('0x2'));var express=require(_0x6659('0x3'));var router=express[_0x6659('0x4')]();var fs_extra=require(_0x6659('0x5'));var auth=require(_0x6659('0x6'));var interaction=require(_0x6659('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x6659('0x8')]('/',auth[_0x6659('0x9')](),controller[_0x6659('0xa')]);router[_0x6659('0x8')](_0x6659('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6659('0x8')](_0x6659('0xc'),auth[_0x6659('0x9')](),controller[_0x6659('0xd')]);router[_0x6659('0x8')](_0x6659('0xe'),auth['isAuthenticated'](),controller[_0x6659('0xf')]);router['get']('/:id/download',auth[_0x6659('0x9')](),controller['download']);router[_0x6659('0x10')]('/',auth[_0x6659('0x9')](),controller[_0x6659('0x11')]);router[_0x6659('0x10')]('/:id/messages',auth[_0x6659('0x9')](),controller[_0x6659('0x12')]);router['post'](_0x6659('0x13'),auth[_0x6659('0x9')](),interaction[_0x6659('0x14')](_0x6659('0x15'),_0x6659('0x16')),controller[_0x6659('0x17')]);router['put'](_0x6659('0xc'),auth[_0x6659('0x9')](),interaction[_0x6659('0x14')](_0x6659('0x15'),_0x6659('0x18')),controller[_0x6659('0x19')]);router['delete']('/:id',auth[_0x6659('0x9')](),interaction['tracked'](_0x6659('0x15'),_0x6659('0x1a')),controller['destroy']);router[_0x6659('0x1b')]('/:id/tags',auth[_0x6659('0x9')](),controller[_0x6659('0x1c')]);module['exports']=router;
\ No newline at end of file
index 5d44ba5..c47ef48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0958=['STRING','out','ENUM','BOOLEAN','sequelize','moment','exports','DATE'];(function(_0x87f8ad,_0x393592){var _0x5d6fbb=function(_0x12b9d0){while(--_0x12b9d0){_0x87f8ad['push'](_0x87f8ad['shift']());}};_0x5d6fbb(++_0x393592);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x8095('0x0'));var moment=require(_0x8095('0x1'));module[_0x8095('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8095('0x3')]},'disposition':{'type':Sequelize[_0x8095('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8095('0x4')]},'phone':{'type':Sequelize[_0x8095('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8095('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8095('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8095('0x6')]('in',_0x8095('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8095('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5a63=['moment','DATE','STRING','ENUM','out','sequelize'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5a63,0xe3));var _0x35a6=function(_0x49e3d6,_0x38ee36){_0x49e3d6=_0x49e3d6-0x0;var _0x5375a6=_0x5a63[_0x49e3d6];return _0x5375a6;};'use strict';var Sequelize=require(_0x35a6('0x0'));var moment=require(_0x35a6('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x35a6('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x35a6('0x3')]},'note':{'type':Sequelize[_0x35a6('0x3')]},'phone':{'type':Sequelize[_0x35a6('0x3')]},'read1stAt':{'type':Sequelize[_0x35a6('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x35a6('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x35a6('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x35a6('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index aba9c49..485b590 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x077a=['System','firstName','views','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','catch','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','tools_tags','u.fullname','ui.WhatsappInteractionId','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','find','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','user','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','show','params','includeAll','options','create','body','describe','addMessage','ids','getMessages','findOne','WhatsappMessage','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','omit','spread','color','emit','whatsappInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','format','CmContact','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream'];(function(_0x26d17d,_0xa32553){var _0x1bae94=function(_0x1f182c){while(--_0x1f182c){_0x26d17d['push'](_0x26d17d['shift']());}};_0x1bae94(++_0xa32553);}(_0x077a,0x1f2));var _0xa077=function(_0x1fd8b3,_0x3bd29a){_0x1fd8b3=_0x1fd8b3-0x0;var _0x1f461f=_0x077a[_0x1fd8b3];return _0x1f461f;};'use strict';var emlformat=require(_0xa077('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa077('0x1'));var jsonpatch=require(_0xa077('0x2'));var rp=require(_0xa077('0x3'));var moment=require(_0xa077('0x4'));var BPromise=require(_0xa077('0x5'));var Mustache=require(_0xa077('0x6'));var util=require(_0xa077('0x7'));var path=require(_0xa077('0x8'));var sox=require('sox');var csv=require(_0xa077('0x9'));var ejs=require(_0xa077('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa077('0xb'));var jsforce=require(_0xa077('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa077('0xd'));var Papa=require(_0xa077('0xe'));var Redis=require(_0xa077('0xf'));var authService=require(_0xa077('0x10'));var qs=require(_0xa077('0x11'));var as=require(_0xa077('0x12'));var pdf=require(_0xa077('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa077('0x14'))(_0xa077('0x15'));var utils=require(_0xa077('0x16'));var config=require(_0xa077('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa077('0x18')]=_[_0xa077('0x19')](config[_0xa077('0x18')],{'host':_0xa077('0x1a'),'port':0x18eb});var socket=require(_0xa077('0x1b'))(new Redis(config[_0xa077('0x18')]));require(_0xa077('0x1c'))[_0xa077('0x1d')](socket);function respondWithStatusCode(_0x356ebf,_0x8432d5){_0x8432d5=_0x8432d5||0xcc;return function(_0x1b2d7b){if(_0x1b2d7b){return _0x356ebf[_0xa077('0x1e')](_0x8432d5);}return _0x356ebf[_0xa077('0x1f')](_0x8432d5)[_0xa077('0x20')]();};}function respondWithResult(_0x43dd7d,_0x4654f8){_0x4654f8=_0x4654f8||0xc8;return function(_0x9701e2){if(_0x9701e2){return _0x43dd7d[_0xa077('0x1f')](_0x4654f8)[_0xa077('0x21')](_0x9701e2);}};}function respondWithFilteredResult(_0x45eaf5,_0x7c58a){return function(_0x498010){if(_0x498010){var _0x579144=typeof _0x7c58a[_0xa077('0x22')]===_0xa077('0x23')&&typeof _0x7c58a[_0xa077('0x24')]===_0xa077('0x23');var _0x25ba19=_0x498010['count'];var _0x28c126=_0x579144?0x0:_0x7c58a['offset'];var _0x3c608d=_0x579144?_0x498010[_0xa077('0x25')]:_0x7c58a[_0xa077('0x22')]+_0x7c58a['limit'];var _0x848bfa;if(_0x3c608d>=_0x25ba19){_0x3c608d=_0x25ba19;_0x848bfa=0xc8;}else{_0x848bfa=0xce;}_0x45eaf5[_0xa077('0x1f')](_0x848bfa);return _0x45eaf5[_0xa077('0x26')](_0xa077('0x27'),_0x28c126+'-'+_0x3c608d+'/'+_0x25ba19)[_0xa077('0x21')](_0x498010);}return null;};}function patchUpdates(_0x581be7){return function(_0xb7542a){try{jsonpatch[_0xa077('0x28')](_0xb7542a,_0x581be7,!![]);}catch(_0x11f568){return BPromise[_0xa077('0x29')](_0x11f568);}return _0xb7542a[_0xa077('0x2a')]();};}function saveUpdates(_0xf02913,_0x4fd68d){return function(_0x5bf712){if(_0x5bf712){return _0x5bf712[_0xa077('0x2b')](_0xf02913)['then'](function(_0x54ec2e){return _0x54ec2e;});}return null;};}function removeEntity(_0x5731bb,_0x3e49dc){return function(_0x326a01){if(_0x326a01){return _0x326a01[_0xa077('0x2c')]()[_0xa077('0x2d')](function(){_0x5731bb['status'](0xcc)[_0xa077('0x20')]();});}};}function handleEntityNotFound(_0x383c4a,_0xaec6a3){return function(_0x581df6){if(!_0x581df6){_0x383c4a[_0xa077('0x1e')](0x194);}return _0x581df6;};}function handleError(_0x34a207,_0x5cc35b){_0x5cc35b=_0x5cc35b||0x1f4;return function(_0x11c5de){logger[_0xa077('0x2e')](_0x11c5de[_0xa077('0x2f')]);if(_0x11c5de[_0xa077('0x30')]){delete _0x11c5de[_0xa077('0x30')];}_0x34a207[_0xa077('0x1f')](_0x5cc35b)[_0xa077('0x31')](_0x11c5de);};}function getInteractionUsers(_0x439464,_0x3d43b7){return new BPromise(function(_0xd3e15a,_0x3fd7bd){try{if(_0x3d43b7[_0x439464['id']]){_0x439464[_0xa077('0x32')]=_['map'](_0x3d43b7[_0x439464['id']],function(_0xc803b5){return{'id':_0xc803b5['id'],'fullname':_0xc803b5[_0xa077('0x33')]};});}}catch(_0x410a0a){_0x3fd7bd(_0x410a0a);}_0xd3e15a(_0x439464);});}function getInteractionTags(_0x5adc61,_0xf398ff){return new BPromise(function(_0x14463e,_0x21a5e4){try{if(_0x5adc61[_0xa077('0x34')]){_0x5adc61['Tags']=[];_0x5adc61['TagIds'][_0xa077('0x35')](',')[_0xa077('0x36')](function(_0x4f7259){_0x5adc61[_0xa077('0x37')]['push'](_0xf398ff[_0x4f7259]);});}delete _0x5adc61[_0xa077('0x34')];}catch(_0x5620f3){_0x21a5e4(_0x5620f3);}_0x14463e(_0x5adc61);});}function updateWhatsappInteraction(_0x485a64,_0x2764e0,_0x24ce4d){return new BPromise(function(_0x4fb9df,_0x496e0c){return getInteractionUsers(_0x485a64,_0x24ce4d)['then'](function(_0x3c9d11){return getInteractionTags(_0x3c9d11,_0x2764e0);})['then'](function(_0x36fd85){_0x4fb9df(_0x36fd85);})[_0xa077('0x38')](function(_0x309e63){_0x496e0c(_0x309e63);});});}exports[_0xa077('0x39')]=function(_0x20a2d3,_0x2a6659){var _0x32f7ad={},_0x52a892={},_0xc26f07={'count':0x0,'rows':[]};var _0x11ef01=_[_0xa077('0x3a')](db[_0xa077('0x3b')][_0xa077('0x3c')],function(_0x4b1960){return{'name':_0x4b1960[_0xa077('0x3d')],'type':_0x4b1960[_0xa077('0x3e')][_0xa077('0x3f')]};});_0x52a892['model']=_[_0xa077('0x3a')](_0x11ef01,_0xa077('0x30'));_0x52a892[_0xa077('0x40')]=_[_0xa077('0x41')](_0x20a2d3['query']);_0x52a892[_0xa077('0x42')]=_[_0xa077('0x43')](_0x52a892[_0xa077('0x44')],_0x52a892[_0xa077('0x40')]);_0x32f7ad['attributes']=_[_0xa077('0x43')](_0x52a892[_0xa077('0x44')],qs[_0xa077('0x45')](_0x20a2d3['query'][_0xa077('0x45')]));_0x32f7ad[_0xa077('0x46')]=_0x32f7ad[_0xa077('0x46')]['length']?_0x32f7ad[_0xa077('0x46')]:_0x52a892[_0xa077('0x44')];if(!_0x20a2d3[_0xa077('0x40')][_0xa077('0x47')](_0xa077('0x48'))){_0x32f7ad[_0xa077('0x24')]=qs[_0xa077('0x24')](_0x20a2d3['query'][_0xa077('0x24')]);_0x32f7ad[_0xa077('0x22')]=qs['offset'](_0x20a2d3[_0xa077('0x40')]['offset']);}_0x32f7ad[_0xa077('0x49')]=qs['sort'](_0x20a2d3[_0xa077('0x40')][_0xa077('0x4a')]);_0x32f7ad[_0xa077('0x4b')]=qs['filters'](_[_0xa077('0x4c')](_0x20a2d3[_0xa077('0x40')],_0x52a892['filters']),_0x11ef01);var _0x2298ca=[];var _0x396698=squel[_0xa077('0x4d')]()[_0xa077('0x4e')]('id')[_0xa077('0x4e')](_0xa077('0x30'))[_0xa077('0x4e')]('color')['from'](_0xa077('0x4f'));var _0x4c991c=squel['select']()['field']('u.id')[_0xa077('0x4e')](_0xa077('0x50'))[_0xa077('0x4e')](_0xa077('0x51'))[_0xa077('0x52')](_0xa077('0x53'),'ui')[_0xa077('0x54')](_0xa077('0x55'),'u',_0xa077('0x56'));var _0x32d4d9=squel['select']()['from'](_0xa077('0x57'),'i')[_0xa077('0x54')]('cm_contacts','c',_0xa077('0x58'))[_0xa077('0x54')](_0xa077('0x55'),'o',_0xa077('0x59'))[_0xa077('0x54')](_0xa077('0x5a'),'a',_0xa077('0x5b'))['left_join'](_0xa077('0x5c'),'me',_0xa077('0x5d'))[_0xa077('0x54')](_0xa077('0x5e'),'it',_0xa077('0x5f'))[_0xa077('0x54')](_0xa077('0x4f'),'t',_0xa077('0x60'));var _0x540aeb=squel[_0xa077('0x61')]();var _0x216dd8=[];var _0x2a27ff=squel[_0xa077('0x61')]();var _0x5bea6b;if(_0x20a2d3[_0xa077('0x40')]['search']){_0x5bea6b=as[_0xa077('0x62')](_0x20a2d3[_0xa077('0x40')][_0xa077('0x63')]);var _0x584d75=_0x5bea6b[_0xa077('0x64')];for(var _0x34c792=0x0;_0x34c792<_0x5bea6b[_0xa077('0x65')][_0xa077('0x66')];_0x34c792++){var _0xf0e8d1=_0x5bea6b[_0xa077('0x65')][_0x34c792];var _0x4d8e16='i';var _0x5eed98=_[_0xa077('0x67')](_0x11ef01,[_0xa077('0x30'),_0xf0e8d1[_0xa077('0x4e')]]);if(!_0x5eed98){switch(_0xf0e8d1['field']){case _0xa077('0x68'):if(_0xf0e8d1[_0xa077('0x69')]==0x1){_0x32d4d9[_0xa077('0x6a')]('`'+_0xf0e8d1[_0xa077('0x4e')]+'`\x20=\x200');}else{_0x32d4d9[_0xa077('0x6a')]('`'+_0xf0e8d1['field']+'`\x20>\x200');}break;case _0xa077('0x6b'):if(_0xf0e8d1[_0xa077('0x6c')]===_0xa077('0x6d')){if(_0xf0e8d1[_0xa077('0x69')][_0xa077('0x35')]('\x20')[_0xa077('0x66')]>0x1){_0x540aeb[_0x584d75](_0xa077('0x6e'),qs[_0xa077('0x6f')](_0xf0e8d1[_0xa077('0x69')]),null);}else{var _0x5c4d27='%'+_0xf0e8d1[_0xa077('0x69')]+'%';_0x540aeb[_0x584d75](_0xa077('0x70'),_0x5c4d27,_0x5c4d27,_0x5c4d27);}}else{_0x5eed98=_[_0xa077('0x67')](_0x11ef01,[_0xa077('0x30'),_0xa077('0x71')]);_0xf0e8d1[_0xa077('0x4e')]=_0xa077('0x71');_0x46733e=as[_0xa077('0x72')](_0x4d8e16,_0x5eed98[_0xa077('0x3e')],_0xf0e8d1);_0x540aeb[_0x584d75](_0x46733e[_0xa077('0x73')],_0x46733e[_0xa077('0x69')][_0xa077('0x74')],_0x46733e[_0xa077('0x69')][_0xa077('0x20')]);}break;case _0xa077('0x75'):var _0x3852ed=_0xf0e8d1[_0xa077('0x69')][_0xa077('0x35')](',')['map'](function(_0xf5cb3d){return Number(_0xf5cb3d);});_0x3852ed[_0xa077('0x36')](function(_0x2032c7){_0x2a27ff['or'](_0xa077('0x76'),'%,'+_0x2032c7+',%');});_0x216dd8=_[_0xa077('0x77')](_0x216dd8,_0x3852ed);break;case _0xa077('0x78'):if(_0xf0e8d1[_0xa077('0x6c')]===_0xa077('0x6d')){_0x540aeb[_0x584d75]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xf0e8d1['value']+'%',null);}else{_0x5eed98=_[_0xa077('0x67')](_0x11ef01,[_0xa077('0x30'),'UserId']);_0xf0e8d1['field']=_0xa077('0x79');_0x46733e=as[_0xa077('0x72')](_0x4d8e16,_0x5eed98[_0xa077('0x3e')],_0xf0e8d1);_0x540aeb[_0x584d75](_0x46733e[_0xa077('0x73')],_0x46733e[_0xa077('0x69')][_0xa077('0x74')],_0x46733e[_0xa077('0x69')][_0xa077('0x20')]);}break;case'body':_0x46733e=as[_0xa077('0x72')]('me',null,_0xf0e8d1);_0x540aeb[_0x584d75](_0x46733e[_0xa077('0x73')],_0x46733e[_0xa077('0x69')][_0xa077('0x74')],_0x46733e[_0xa077('0x69')]['end']);break;}}else{var _0x46733e=as[_0xa077('0x72')](_0x4d8e16,_0x5eed98[_0xa077('0x3e')],_0xf0e8d1);_0x540aeb[_0x584d75](_0x46733e[_0xa077('0x73')],_0x46733e[_0xa077('0x69')][_0xa077('0x74')],_0x46733e[_0xa077('0x69')][_0xa077('0x20')]);}}}else{var _0x513551=_(_0x20a2d3[_0xa077('0x40')])[_0xa077('0x41')]()[_0xa077('0x3a')](function(_0x30aa96){return _[_0xa077('0x7a')](_0x11ef01,['name',_0x30aa96])?_0x30aa96:undefined;})[_0xa077('0x7b')]()[_0xa077('0x69')]();if(!_[_0xa077('0x7c')](_0x513551)){_0x513551[_0xa077('0x36')](function(_0x2cdef9){if(_0x2cdef9===_0xa077('0x7d')){_0x32d4d9[_0xa077('0x4b')](_0xa077('0x7e'),[][_0xa077('0x7f')](_0x20a2d3[_0xa077('0x40')][_0x2cdef9]));}else if(_0x2cdef9===_0xa077('0x80')){var _0x30c449=JSON['parse'](_0x20a2d3[_0xa077('0x40')][_0x2cdef9])[_0xa077('0x81')];var _0x42c937=JSON[_0xa077('0x82')](_0x20a2d3[_0xa077('0x40')][_0x2cdef9])[_0xa077('0x83')];_0x32d4d9[_0xa077('0x4b')](_0xa077('0x84'),_0x30c449,_0x42c937);}else{if(_0x20a2d3[_0xa077('0x40')][_0x2cdef9]===_0xa077('0x85')){_0x32d4d9['where']('i.'+_0x2cdef9+'\x20IS\x20NULL');}else{_0x32d4d9[_0xa077('0x4b')]('i.'+_0x2cdef9+_0xa077('0x86'),_0x20a2d3['query'][_0x2cdef9]);}}});}if(_0x20a2d3['query'][_0xa077('0x87')]){if(_0x20a2d3[_0xa077('0x40')][_0xa077('0x87')]==0x1){_0x32d4d9[_0xa077('0x6a')](_0xa077('0x88'));}else{_0x32d4d9['having'](_0xa077('0x89'));}}if(_0x20a2d3['query'][_0xa077('0x8a')]){_0x216dd8=_[_0xa077('0x8b')](_0x20a2d3[_0xa077('0x40')][_0xa077('0x8a')])?_0x20a2d3[_0xa077('0x40')][_0xa077('0x8a')]:new Array(_0x20a2d3[_0xa077('0x40')]['tag']);_0x216dd8[_0xa077('0x36')](function(_0x573edd){_0x2a27ff['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x573edd+',%');});}if(_0x20a2d3['query'][_0xa077('0x8c')]){var _0x17f0a2=_0x20a2d3[_0xa077('0x40')][_0xa077('0x8c')]['replace']('\x5c','\x5c\x5c')[_0xa077('0x8d')](/'/g,'\x27\x27');if(qs[_0xa077('0x8e')](_0x17f0a2)){_0x540aeb['or'](_0xa077('0x8f'),_0x17f0a2+'%')['or'](_0xa077('0x90'),_0x17f0a2+'%');}else{_0x540aeb['or'](_0xa077('0x91'),qs['getFullTextValue'](_0x17f0a2))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x17f0a2+'%');}}}_0x32d4d9[_0xa077('0x4b')](_0x540aeb);_0x32d4d9[_0xa077('0x92')](_0xa077('0x93'));var _0x30f89b={'type':db[_0xa077('0x94')][_0xa077('0x95')]['SELECT'],'raw':!![]};var _0x3bb596=_0x32d4d9[_0xa077('0x96')]();_0x3bb596['field'](_0xa077('0x93'));_0x3bb596['field'](_0xa077('0x97'),_0xa077('0x68'));if(_0x32f7ad[_0xa077('0x49')]){_0x32f7ad[_0xa077('0x49')][_0xa077('0x36')](function(_0x4af13f){var _0xe19140=_0x4af13f[0x0]===_0xa077('0x98')?_0x4af13f[0x0]:'i.'+_0x4af13f[0x0];_0x32d4d9[_0xa077('0x49')](_0xe19140,_0x4af13f[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x216dd8)){_0x32d4d9[_0xa077('0x6a')](_0x2a27ff);_0x3bb596[_0xa077('0x4b')](_0xa077('0x99'),_0x216dd8);}BPromise[_0xa077('0x9a')]()[_0xa077('0x2d')](function(){if(!_0x5bea6b){if(_0x20a2d3[_0xa077('0x40')]['WhatsappAccountId'])return;_0x3bb596[_0xa077('0x4b')](_0xa077('0x9b'));_0x32d4d9[_0xa077('0x4b')](_0xa077('0x9b'));return;}if(_0x20a2d3['user']['role']!==_0xa077('0x9c'))return;return _0x20a2d3[_0xa077('0x9d')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xa077('0x2d')](function(_0x34570c){if(_[_0xa077('0x7c')](_0x34570c)){_0x3bb596[_0xa077('0x4b')](_0xa077('0x9e'));_0x32d4d9['where'](_0xa077('0x9e'));}else{_0x3bb596['where'](_0xa077('0x7e'),_[_0xa077('0x3a')](_0x34570c,'id'));_0x32d4d9['where'](_0xa077('0x7e'),_[_0xa077('0x3a')](_0x34570c,'id'));}});})[_0xa077('0x2d')](function(){if(_0x20a2d3[_0xa077('0x9d')][_0xa077('0x9f')]===_0xa077('0x9c')&&!_0x5bea6b&&!_0x20a2d3['query']['WhatsappAccountId'])return[];return db[_0xa077('0xa0')][_0xa077('0x40')](_0x3bb596['toString'](),_0x30f89b);})[_0xa077('0x2d')](function(_0x5c2d5b){_0xc26f07['count']=_0x5c2d5b[_0xa077('0x66')];if(_0xc26f07[_0xa077('0x25')]===0x0)return[];return db[_0xa077('0xa0')][_0xa077('0x40')](_0x396698[_0xa077('0xa1')](),_0x30f89b)[_0xa077('0x2d')](function(_0x25d3ba){_0x2298ca=_[_0xa077('0xa2')](_0x25d3ba,'id');_0x30f89b=_[_0xa077('0xa3')](_0x30f89b,{'model':db[_0xa077('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x20a2d3[_0xa077('0x40')][_0xa077('0x45')]){_0x32f7ad[_0xa077('0x46')]['forEach'](function(_0x318418){_0x32d4d9[_0xa077('0x4e')]('i.'+_0x318418);});}else{_0x32d4d9['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x32d4d9[_0xa077('0x4e')](_0xa077('0xa4'),_0xa077('0xa5'));_0x32d4d9[_0xa077('0x4e')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x32d4d9[_0xa077('0x4e')]('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',_0xa077('0x98'));_0x32d4d9[_0xa077('0x4e')](_0xa077('0xa6'));_0x32d4d9[_0xa077('0x4e')](_0xa077('0xa7'),_0xa077('0xa8'));_0x32d4d9[_0xa077('0x4e')](_0xa077('0xa9'),_0xa077('0xaa'));_0x32d4d9[_0xa077('0x4e')]('c.email',_0xa077('0xab'));_0x32d4d9[_0xa077('0x4e')](_0xa077('0xac'),'Contact.phone');_0x32d4d9[_0xa077('0x4e')]('c.mobile',_0xa077('0xad'));_0x32d4d9[_0xa077('0x4e')]('c.fax',_0xa077('0xae'));_0x32d4d9[_0xa077('0x4e')](_0xa077('0xaf'),'Owner.fullname');_0x32d4d9['field'](_0xa077('0xb0'),_0xa077('0xb1'));_0x32d4d9[_0xa077('0x4e')](_0xa077('0xb2'),_0xa077('0x34'));}if(_0x32f7ad['limit'])_0x32d4d9[_0xa077('0x24')](_0x32f7ad['limit']);if(_0x32f7ad[_0xa077('0x22')])_0x32d4d9[_0xa077('0x22')](_0x32f7ad['offset']);return db[_0xa077('0xa0')]['query'](_0x32d4d9[_0xa077('0xa1')](),_0x30f89b);})[_0xa077('0x2d')](function(_0x55e853){if(_0x55e853[_0xa077('0x66')]>0x0)_0x4c991c[_0xa077('0x4b')](_0xa077('0xb3'),_[_0xa077('0x3a')](_0x55e853,'id'));return db[_0xa077('0xa0')]['query'](_0x4c991c[_0xa077('0xa1')](),_0x30f89b)[_0xa077('0x2d')](function(_0xeb45a3){var _0x5b88f2=_[_0xa077('0xb4')](_0xeb45a3,_0xa077('0xb5'));var _0x5c4fdd=[];_0x55e853['forEach'](function(_0x785c0d){_0x5c4fdd[_0xa077('0xb6')](updateWhatsappInteraction(_0x785c0d,_0x2298ca,_0x5b88f2));});return BPromise[_0xa077('0xb7')](_0x5c4fdd);});});})['then'](function(_0x4aa3f6){_0xc26f07[_0xa077('0xb8')]=_0x4aa3f6;return _0xc26f07;})[_0xa077('0x2d')](respondWithFilteredResult(_0x2a6659,_0x32f7ad))['catch'](handleError(_0x2a6659,null));};exports[_0xa077('0xb9')]=function(_0x481cd3,_0x6627f3){var _0x1b9598={'raw':![],'where':{'id':_0x481cd3[_0xa077('0xba')]['id']}},_0x1a00f4={};_0x1a00f4[_0xa077('0x44')]=_[_0xa077('0x41')](db[_0xa077('0x3b')]['rawAttributes']);_0x1a00f4[_0xa077('0x40')]=_[_0xa077('0x41')](_0x481cd3[_0xa077('0x40')]);_0x1a00f4[_0xa077('0x42')]=_[_0xa077('0x43')](_0x1a00f4[_0xa077('0x44')],_0x1a00f4[_0xa077('0x40')]);_0x1b9598[_0xa077('0x46')]=_[_0xa077('0x43')](_0x1a00f4[_0xa077('0x44')],qs[_0xa077('0x45')](_0x481cd3[_0xa077('0x40')][_0xa077('0x45')]));_0x1b9598[_0xa077('0x46')]=_0x1b9598['attributes']['length']?_0x1b9598[_0xa077('0x46')]:_0x1a00f4['model'];if(_0x481cd3[_0xa077('0x40')][_0xa077('0xbb')]){_0x1b9598['include']=[{'all':!![]}];}_0x1b9598=_[_0xa077('0xa3')]({},_0x1b9598,_0x481cd3[_0xa077('0xbc')]);return db[_0xa077('0x3b')]['find'](_0x1b9598)[_0xa077('0x2d')](handleEntityNotFound(_0x6627f3,null))[_0xa077('0x2d')](respondWithResult(_0x6627f3,null))[_0xa077('0x38')](handleError(_0x6627f3,null));};exports[_0xa077('0xbd')]=function(_0x5ef9ef,_0x4b731c){return db[_0xa077('0x3b')][_0xa077('0xbd')](_0x5ef9ef['body'],{})[_0xa077('0x2d')](respondWithResult(_0x4b731c,0xc9))[_0xa077('0x38')](handleError(_0x4b731c,null));};exports['update']=function(_0x4f6486,_0x29eac4){if(_0x4f6486[_0xa077('0xbe')]['id']){delete _0x4f6486[_0xa077('0xbe')]['id'];}return db[_0xa077('0x3b')][_0xa077('0x67')]({'where':{'id':_0x4f6486[_0xa077('0xba')]['id']}})[_0xa077('0x2d')](handleEntityNotFound(_0x29eac4,null))[_0xa077('0x2d')](saveUpdates(_0x4f6486[_0xa077('0xbe')],null))[_0xa077('0x2d')](respondWithResult(_0x29eac4,null))[_0xa077('0x38')](handleError(_0x29eac4,null));};exports[_0xa077('0x2c')]=function(_0x4e1dff,_0x2fe628){return db[_0xa077('0x3b')][_0xa077('0x67')]({'where':{'id':_0x4e1dff[_0xa077('0xba')]['id']}})['then'](handleEntityNotFound(_0x2fe628,null))[_0xa077('0x2d')](removeEntity(_0x2fe628,null))[_0xa077('0x38')](handleError(_0x2fe628,null));};exports[_0xa077('0xbf')]=function(_0x150515,_0x439cb4){return db['WhatsappInteraction'][_0xa077('0xbf')]()[_0xa077('0x2d')](respondWithResult(_0x439cb4,null))[_0xa077('0x38')](handleError(_0x439cb4,null));};exports['addMessage']=function(_0xc46cf7,_0x38e9ee,_0x3078a6){return db['WhatsappMessage'][_0xa077('0x67')]({'where':{'id':_0xc46cf7[_0xa077('0xba')]['id']}})[_0xa077('0x2d')](handleEntityNotFound(_0x38e9ee,null))[_0xa077('0x2d')](function(_0x42f377){if(_0x42f377){return _0x42f377[_0xa077('0xc0')](_0xc46cf7[_0xa077('0xbe')][_0xa077('0xc1')],_['omit'](_0xc46cf7[_0xa077('0xbe')],[_0xa077('0xc1'),'id'])||{});}})['then'](respondWithResult(_0x38e9ee,null))[_0xa077('0x38')](handleError(_0x38e9ee,null));};exports[_0xa077('0xc2')]=function(_0x2e27fe,_0x1c69cd,_0x3e5bdc){var _0x3a3d30={'raw':![],'where':{}};var _0x3f3214={};var _0x4aada1={'count':0x0,'rows':[]};return db[_0xa077('0x3b')][_0xa077('0xc3')]({'where':{'id':_0x2e27fe['params']['id']}})[_0xa077('0x2d')](handleEntityNotFound(_0x1c69cd,null))[_0xa077('0x2d')](function(_0x3a8699){if(_0x3a8699){_0x3f3214[_0xa077('0x44')]=_[_0xa077('0x41')](db[_0xa077('0xc4')][_0xa077('0x3c')]);_0x3f3214[_0xa077('0x40')]=_[_0xa077('0x41')](_0x2e27fe['query']);_0x3f3214[_0xa077('0x42')]=_[_0xa077('0x43')](_0x3f3214[_0xa077('0x44')],_0x3f3214['query']);_0x3a3d30[_0xa077('0x46')]=_[_0xa077('0x43')](_0x3f3214[_0xa077('0x44')],qs[_0xa077('0x45')](_0x2e27fe['query'][_0xa077('0x45')]));_0x3a3d30[_0xa077('0x46')]=_0x3a3d30[_0xa077('0x46')][_0xa077('0x66')]?_0x3a3d30[_0xa077('0x46')]:_0x3f3214[_0xa077('0x44')];if(!_0x2e27fe[_0xa077('0x40')][_0xa077('0x47')](_0xa077('0x48'))){_0x3a3d30[_0xa077('0x24')]=qs[_0xa077('0x24')](_0x2e27fe[_0xa077('0x40')]['limit']);_0x3a3d30[_0xa077('0x22')]=qs['offset'](_0x2e27fe[_0xa077('0x40')][_0xa077('0x22')]);}_0x3a3d30[_0xa077('0x49')]=qs['sort'](_0x2e27fe[_0xa077('0x40')][_0xa077('0x4a')]);_0x3a3d30[_0xa077('0x4b')]=qs[_0xa077('0x42')](_[_0xa077('0x4c')](_0x2e27fe[_0xa077('0x40')],_0x3f3214['filters']));_0x3a3d30[_0xa077('0x4b')][_0xa077('0xb5')]=_0x3a8699['id'];if(_0x2e27fe[_0xa077('0x40')][_0xa077('0x8c')]){_0x3a3d30[_0xa077('0x4b')]=_['merge'](_0x3a3d30[_0xa077('0x4b')],{'$or':_[_0xa077('0x3a')](_0x3a3d30[_0xa077('0x46')],function(_0x3be11f){var _0x3273ba={};_0x3273ba[_0x3be11f]={'$like':'%'+_0x2e27fe[_0xa077('0x40')][_0xa077('0x8c')]+'%'};return _0x3273ba;})});}if(_0x2e27fe['query'][_0xa077('0x81')]){var _0x56d4b7=_0x2e27fe[_0xa077('0x40')][_0xa077('0x81')]['split'](',');var _0x12fafa={};_0x12fafa[_0x56d4b7[0x0]]={'$gte':moment(_0x56d4b7[0x1])['format'](_0xa077('0xc5'))};_0x3a3d30[_0xa077('0x4b')]=_[_0xa077('0xa3')](_0x3a3d30['where'],_0x12fafa);}_0x3a3d30=_[_0xa077('0xa3')]({},_0x3a3d30,_0x2e27fe[_0xa077('0xbc')]);return db[_0xa077('0xc4')][_0xa077('0x25')]({'where':_0x3a3d30[_0xa077('0x4b')]})[_0xa077('0x2d')](function(_0x4510f9){_0x4aada1[_0xa077('0x25')]=_0x4510f9;if(_0x2e27fe[_0xa077('0x40')][_0xa077('0xbb')]){_0x3a3d30[_0xa077('0xc6')]=[{'all':!![]}];}return db[_0xa077('0xc4')][_0xa077('0xc7')](_0x3a3d30);})[_0xa077('0x2d')](function(_0x1149ae){_0x4aada1[_0xa077('0xb8')]=_0x1149ae;return _0x4aada1;});}})['then'](respondWithFilteredResult(_0x1c69cd,_0x3a3d30))[_0xa077('0x38')](handleError(_0x1c69cd,null));};exports[_0xa077('0xc8')]=function(_0xc7e02e,_0x4492e7,_0x233803){return db[_0xa077('0x3b')][_0xa077('0x67')]({'where':{'id':_0xc7e02e[_0xa077('0xba')]['id']}})[_0xa077('0x2d')](handleEntityNotFound(_0x4492e7,null))['then'](function(_0x2ec267){if(_0x2ec267){return _0x2ec267[_0xa077('0xc9')](_0xc7e02e[_0xa077('0xbe')]['ids'],_[_0xa077('0xca')](_0xc7e02e[_0xa077('0xbe')],[_0xa077('0xc1'),'id'])||{})[_0xa077('0xcb')](function(){return db[_0xa077('0x75')]['findAll']({'attributes':['id',_0xa077('0x30'),_0xa077('0xcc')],'where':{'id':_0xc7e02e[_0xa077('0xbe')]['ids']}});})[_0xa077('0x2d')](function(_0x352f93){socket[_0xa077('0xcd')](_0xa077('0xce'),{'id':Number(_0xc7e02e['params']['id']),'tags':_0x352f93||[]});return{'id':Number(_0xc7e02e[_0xa077('0xba')]['id']),'tags':_0x352f93||[]};});}})['then'](respondWithResult(_0x4492e7,null))[_0xa077('0x38')](handleError(_0x4492e7,null));};exports[_0xa077('0xcf')]=function(_0x1ca8bb,_0x33c098,_0x34b0c2){return db['WhatsappInteraction'][_0xa077('0x67')]({'where':{'id':_0x1ca8bb['params']['id']}})[_0xa077('0x2d')](handleEntityNotFound(_0x33c098,null))['then'](function(_0x4ca565){if(_0x4ca565){return _0x4ca565[_0xa077('0xcf')](_0x1ca8bb['query'][_0xa077('0xc1')]);}})[_0xa077('0x2d')](respondWithStatusCode(_0x33c098,null))[_0xa077('0x38')](handleError(_0x33c098,null));};exports[_0xa077('0xd0')]=function(_0x8cd618,_0x562f91){var _0x527fe2=moment()['unix']()[_0xa077('0xa1')]();var _0x585432=path['join'](config[_0xa077('0xd1')],_0xa077('0xd2'),_0xa077('0xd3'),_0xa077('0xd4'));var _0x145841=path[_0xa077('0xd5')](config[_0xa077('0xd1')],_0xa077('0xd2'),'files',_0xa077('0xd6'));var _0x31129e=path[_0xa077('0xd5')](_0x585432,_0x527fe2);var _0x58ab90=util[_0xa077('0xd7')]('transcript-%d-%s.zip',_0x8cd618[_0xa077('0xba')]['id'],_0x527fe2);var _0x4610db=path[_0xa077('0xd5')](_0x585432,_0x58ab90);var _0xe0c356=[];_0xe0c356['push']({'model':db['User'],'as':_0xa077('0x78'),'attributes':['id','fullname'],'raw':!![]});_0xe0c356[_0xa077('0xb6')]({'model':db[_0xa077('0xd8')],'as':_0xa077('0x6b'),'attributes':['id','firstName',_0xa077('0xd9')],'raw':!![]});if(_0x8cd618[_0xa077('0x40')][_0xa077('0xd6')]){_0xe0c356['push']({'model':db[_0xa077('0xda')],'as':_0xa077('0xda'),'raw':!![]});}var _0x13fe34=[{'model':db[_0xa077('0xc4')],'as':'Messages','attributes':['id',_0xa077('0xbe'),_0xa077('0x80'),_0xa077('0xdb'),_0xa077('0xdc'),_0xa077('0x87')],'include':_0xe0c356}];_0x13fe34[_0xa077('0xb6')]({'model':db[_0xa077('0xdd')],'as':_0xa077('0xde'),'attributes':['id','name']});_0x13fe34[_0xa077('0xb6')]({'model':db[_0xa077('0x78')],'as':_0xa077('0xdf'),'attributes':['id','fullname']});return db[_0xa077('0x3b')][_0xa077('0x67')]({'where':{'id':_0x8cd618['params']['id']},'include':_0x13fe34})['then'](handleEntityNotFound(_0x562f91,null))[_0xa077('0x2d')](function(_0x2803da){if(_0x2803da){var _0x366245=_0x2803da[_0xa077('0xe0')]({'plain':!![]});fs[_0xa077('0xe1')](_0x31129e);var _0x33be2b={'channel':_0xa077('0xe2'),'account':_0x366245[_0xa077('0xde')]['name'],'agent':_0x366245[_0xa077('0xdf')]?_0x366245[_0xa077('0xdf')]['fullname']:_0xa077('0xe3'),'createdAt':moment(_0x366245['createdAt'])[_0xa077('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa077('0xa1')](),'closedAt':_0x366245[_0xa077('0xe4')]?moment(_0x366245[_0xa077('0xe5')])[_0xa077('0xd7')](_0xa077('0xc5'))['toString']():'','disposition':_0x366245[_0xa077('0xe6')],'messages':_(_0x366245[_0xa077('0xe7')])[_0xa077('0x8c')]({'secret':![]})['map'](function(_0x388eff){if(_0x388eff[_0xa077('0xda')]){var _0x461334=path[_0xa077('0xd5')](_0x145841,_0x388eff[_0xa077('0xda')][_0xa077('0xe8')]);if(fs[_0xa077('0xe9')](_0x461334)){fs[_0xa077('0xea')](_0x461334)[_0xa077('0xeb')](fs[_0xa077('0xec')](path[_0xa077('0xd5')](_0x31129e,_0x388eff[_0xa077('0xda')][_0xa077('0xe8')])));}}return{'date':moment(_0x388eff['createdAt'])[_0xa077('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa077('0xa1')](),'sender':_0x388eff['direction']==='out'?_0x388eff['User']?_0x388eff[_0xa077('0x78')][_0xa077('0x33')]:_0xa077('0xed'):_0x388eff[_0xa077('0x6b')][_0xa077('0xee')]+(_0x388eff[_0xa077('0x6b')]['lastName']?'\x20'+_0x388eff[_0xa077('0x6b')][_0xa077('0xd9')]:''),'body':_0x388eff[_0xa077('0xda')]?_0x388eff[_0xa077('0xda')][_0xa077('0xe8')]:_0x388eff['body'],'direction':_0x388eff[_0xa077('0xdb')]==='out'?'A':'C','secret':_0x388eff[_0xa077('0xdc')],'read':_0x388eff[_0xa077('0x87')],'attachment':_0x388eff[_0xa077('0xda')]};})[_0xa077('0x69')]()};return ejs['renderFile'](path[_0xa077('0xd5')](config['root'],_0xa077('0xd2'),_0xa077('0xef'),_0xa077('0xf0')),{'interaction':_0x33be2b})[_0xa077('0x2d')](function(_0x3be48e){var _0x1cde84=path[_0xa077('0xd5')](_0x31129e,_0xa077('0xf1')+_0x366245['id']+'-'+_0x527fe2+_0xa077('0xf2'));var _0x2be6f4={'path':_0x1cde84,'channel':_0xa077('0xe2'),'interactionId':_0x366245['id']};return pdf['createPdfFromHTML'](_0x3be48e,_0x2be6f4);})['then'](function(){return new BPromise(function(_0x356356,_0x4c78b5){zipdir(_0x31129e,{'saveTo':_0x4610db},function(_0x2fa41b,_0x5cae0d){if(_0x2fa41b)return _0x4c78b5(_0x2fa41b);return _0x356356(_0x5cae0d);});})[_0xa077('0x2d')](function(){return new BPromise(function(_0xc2c7d3,_0x5e054f){rimraf(_0x31129e,function(_0x503c39){if(_0x503c39)_0x5e054f(_0x503c39);return _0xc2c7d3();});});})[_0xa077('0x2d')](function(){return _0x562f91[_0xa077('0xd0')](_0x4610db,_0x58ab90,function(_0x11219f){if(_0x11219f){console[_0xa077('0xf3')]('err',_0x11219f);}else{fs[_0xa077('0xf4')](_0x4610db);}});});});}else{return _0x562f91['sendStatus'](0xc8);}})[_0xa077('0x38')](handleError(_0x562f91,null));};
\ No newline at end of file
+var _0x8ff9=['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?','ContactId','buildExpression','type','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','text','body','compact','isEmpty','WhatsappAccountId','where','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','filters','includeAll','include','create','destroy','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','nolimit','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','spread','findAll','whatsappInteractionTags:save','removeTags','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','secret','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','disposition','Messages','existsSync','createWriteStream','basename','direction','out','System','Contact','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappInteraction.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','Users','map','fullname','Tags','TagIds','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','pick','select','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','`\x20>\x200'];(function(_0xc66c1b,_0x29125f){var _0x1f42be=function(_0x3d185f){while(--_0x3d185f){_0xc66c1b['push'](_0xc66c1b['shift']());}};_0x1f42be(++_0x29125f);}(_0x8ff9,0x188));var _0x98ff=function(_0x595fba,_0x16dcfc){_0x595fba=_0x595fba-0x0;var _0x5a4ae6=_0x8ff9[_0x595fba];return _0x5a4ae6;};'use strict';var emlformat=require(_0x98ff('0x0'));var rimraf=require(_0x98ff('0x1'));var zipdir=require(_0x98ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98ff('0x3'));var moment=require(_0x98ff('0x4'));var BPromise=require(_0x98ff('0x5'));var Mustache=require(_0x98ff('0x6'));var util=require(_0x98ff('0x7'));var path=require(_0x98ff('0x8'));var sox=require(_0x98ff('0x9'));var csv=require('to-csv');var ejs=require(_0x98ff('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98ff('0xb'));var squel=require(_0x98ff('0xc'));var crypto=require('crypto');var jsforce=require(_0x98ff('0xd'));var deskjs=require(_0x98ff('0xe'));var toCsv=require(_0x98ff('0xf'));var querystring=require(_0x98ff('0x10'));var Papa=require(_0x98ff('0x11'));var Redis=require(_0x98ff('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x98ff('0x13'));var as=require(_0x98ff('0x14'));var pdf=require(_0x98ff('0x15'));var hardwareService=require(_0x98ff('0x16'));var logger=require('../../config/logger')(_0x98ff('0x17'));var utils=require(_0x98ff('0x18'));var config=require(_0x98ff('0x19'));var licenseUtil=require(_0x98ff('0x1a'));var db=require(_0x98ff('0x1b'))['db'];config[_0x98ff('0x1c')]=_['defaults'](config['redis'],{'host':_0x98ff('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x98ff('0x1c')]));require(_0x98ff('0x1e'))['register'](socket);function respondWithStatusCode(_0x45e5ae,_0x4f1bec){_0x4f1bec=_0x4f1bec||0xcc;return function(_0x18132e){if(_0x18132e){return _0x45e5ae[_0x98ff('0x1f')](_0x4f1bec);}return _0x45e5ae['status'](_0x4f1bec)[_0x98ff('0x20')]();};}function respondWithResult(_0x5471d5,_0x312c07){_0x312c07=_0x312c07||0xc8;return function(_0x142834){if(_0x142834){return _0x5471d5[_0x98ff('0x21')](_0x312c07)['json'](_0x142834);}};}function respondWithFilteredResult(_0x59b453,_0x19e1db){return function(_0x1108c0){if(_0x1108c0){var _0x48ca02=typeof _0x19e1db[_0x98ff('0x22')]===_0x98ff('0x23')&&typeof _0x19e1db[_0x98ff('0x24')]===_0x98ff('0x23');var _0x4449e1=_0x1108c0[_0x98ff('0x25')];var _0x1ce987=_0x48ca02?0x0:_0x19e1db[_0x98ff('0x22')];var _0x3b79db=_0x48ca02?_0x1108c0['count']:_0x19e1db[_0x98ff('0x22')]+_0x19e1db['limit'];var _0xc44631;if(_0x3b79db>=_0x4449e1){_0x3b79db=_0x4449e1;_0xc44631=0xc8;}else{_0xc44631=0xce;}_0x59b453[_0x98ff('0x21')](_0xc44631);return _0x59b453[_0x98ff('0x26')](_0x98ff('0x27'),_0x1ce987+'-'+_0x3b79db+'/'+_0x4449e1)['json'](_0x1108c0);}return null;};}function patchUpdates(_0x5c1e7c){return function(_0x904491){try{jsonpatch[_0x98ff('0x28')](_0x904491,_0x5c1e7c,!![]);}catch(_0x766b31){return BPromise['reject'](_0x766b31);}return _0x904491[_0x98ff('0x29')]();};}function saveUpdates(_0x34d7c7,_0x3d0fbb){return function(_0x107cd9){if(_0x107cd9){return _0x107cd9[_0x98ff('0x2a')](_0x34d7c7)[_0x98ff('0x2b')](function(_0x464a14){return _0x464a14;});}return null;};}function removeEntity(_0x2c4d4e,_0x5326eb){return function(_0x839545){if(_0x839545){return _0x839545['destroy']()[_0x98ff('0x2b')](function(){_0x2c4d4e[_0x98ff('0x21')](0xcc)[_0x98ff('0x20')]();});}};}function handleEntityNotFound(_0x285f72,_0x3311c1){return function(_0x9b284c){if(!_0x9b284c){_0x285f72[_0x98ff('0x1f')](0x194);}return _0x9b284c;};}function handleError(_0x1c4c64,_0xa9787c){_0xa9787c=_0xa9787c||0x1f4;return function(_0xa9a152){logger[_0x98ff('0x2c')](_0xa9a152[_0x98ff('0x2d')]);if(_0xa9a152[_0x98ff('0x2e')]){delete _0xa9a152[_0x98ff('0x2e')];}_0x1c4c64[_0x98ff('0x21')](_0xa9787c)[_0x98ff('0x2f')](_0xa9a152);};}function getInteractionUsers(_0x2b686b,_0x5af0dc){return new BPromise(function(_0x346dee,_0x371096){try{if(_0x5af0dc[_0x2b686b['id']]){_0x2b686b[_0x98ff('0x30')]=_[_0x98ff('0x31')](_0x5af0dc[_0x2b686b['id']],function(_0x55b72f){return{'id':_0x55b72f['id'],'fullname':_0x55b72f[_0x98ff('0x32')]};});}}catch(_0x4ca856){_0x371096(_0x4ca856);}_0x346dee(_0x2b686b);});}function getInteractionTags(_0x1d8ddd,_0x40f57d){return new BPromise(function(_0x303d06,_0x5c15ba){try{if(_0x1d8ddd['TagIds']){_0x1d8ddd[_0x98ff('0x33')]=[];_0x1d8ddd[_0x98ff('0x34')]['split'](',')[_0x98ff('0x35')](function(_0x23026c){_0x1d8ddd['Tags'][_0x98ff('0x36')](_0x40f57d[_0x23026c]);});}delete _0x1d8ddd[_0x98ff('0x34')];}catch(_0x53dff4){_0x5c15ba(_0x53dff4);}_0x303d06(_0x1d8ddd);});}function updateWhatsappInteraction(_0x45775a,_0x93fdec,_0x429ca3){return new BPromise(function(_0x45213a,_0x505bf4){return getInteractionUsers(_0x45775a,_0x429ca3)[_0x98ff('0x2b')](function(_0x4bf9f4){return getInteractionTags(_0x4bf9f4,_0x93fdec);})[_0x98ff('0x2b')](function(_0x42958c){_0x45213a(_0x42958c);})[_0x98ff('0x37')](function(_0x497db1){_0x505bf4(_0x497db1);});});}exports[_0x98ff('0x38')]=function(_0x179538,_0x1b1291){var _0x3c59c9={},_0x151ab1={},_0x2c3649={'count':0x0,'rows':[]};var _0x1d2054=_[_0x98ff('0x31')](db[_0x98ff('0x39')][_0x98ff('0x3a')],function(_0x202c37){return{'name':_0x202c37[_0x98ff('0x3b')],'type':_0x202c37['type'][_0x98ff('0x3c')]};});_0x151ab1[_0x98ff('0x3d')]=_['map'](_0x1d2054,'name');_0x151ab1[_0x98ff('0x3e')]=_[_0x98ff('0x3f')](_0x179538[_0x98ff('0x3e')]);_0x151ab1['filters']=_[_0x98ff('0x40')](_0x151ab1[_0x98ff('0x3d')],_0x151ab1['query']);_0x3c59c9[_0x98ff('0x41')]=_[_0x98ff('0x40')](_0x151ab1[_0x98ff('0x3d')],qs[_0x98ff('0x42')](_0x179538[_0x98ff('0x3e')]['fields']));_0x3c59c9[_0x98ff('0x41')]=_0x3c59c9['attributes'][_0x98ff('0x43')]?_0x3c59c9[_0x98ff('0x41')]:_0x151ab1[_0x98ff('0x3d')];if(!_0x179538[_0x98ff('0x3e')][_0x98ff('0x44')]('nolimit')){_0x3c59c9[_0x98ff('0x24')]=qs['limit'](_0x179538[_0x98ff('0x3e')][_0x98ff('0x24')]);_0x3c59c9['offset']=qs[_0x98ff('0x22')](_0x179538[_0x98ff('0x3e')][_0x98ff('0x22')]);}_0x3c59c9['order']=qs[_0x98ff('0x45')](_0x179538[_0x98ff('0x3e')]['sort']);_0x3c59c9['where']=qs['filters'](_[_0x98ff('0x46')](_0x179538[_0x98ff('0x3e')],_0x151ab1['filters']),_0x1d2054);var _0x47a32a=[];var _0x2eb351=squel[_0x98ff('0x47')]()[_0x98ff('0x48')]('id')['field']('name')['field'](_0x98ff('0x49'))[_0x98ff('0x4a')](_0x98ff('0x4b'));var _0x514e0c=squel[_0x98ff('0x47')]()['field'](_0x98ff('0x4c'))[_0x98ff('0x48')]('u.fullname')[_0x98ff('0x48')](_0x98ff('0x4d'))['from'](_0x98ff('0x4e'),'ui')[_0x98ff('0x4f')](_0x98ff('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x58a089=squel[_0x98ff('0x47')]()[_0x98ff('0x4a')](_0x98ff('0x51'),'i')[_0x98ff('0x4f')](_0x98ff('0x52'),'c',_0x98ff('0x53'))[_0x98ff('0x4f')](_0x98ff('0x50'),'o',_0x98ff('0x54'))[_0x98ff('0x4f')](_0x98ff('0x55'),'a',_0x98ff('0x56'))[_0x98ff('0x4f')]('whatsapp_messages','me',_0x98ff('0x57'))[_0x98ff('0x4f')](_0x98ff('0x58'),'it',_0x98ff('0x59'))[_0x98ff('0x4f')](_0x98ff('0x4b'),'t',_0x98ff('0x5a'));var _0x4e14a0=squel[_0x98ff('0x5b')]();var _0x3885f8=[];var _0x57c562=squel[_0x98ff('0x5b')]();var _0x189258;if(_0x179538[_0x98ff('0x3e')][_0x98ff('0x5c')]){_0x189258=as[_0x98ff('0x5d')](_0x179538[_0x98ff('0x3e')][_0x98ff('0x5c')]);var _0x35da9b=_0x189258['sqlOperator'];for(var _0x58faf5=0x0;_0x58faf5<_0x189258[_0x98ff('0x5e')][_0x98ff('0x43')];_0x58faf5++){var _0x2fe731=_0x189258[_0x98ff('0x5e')][_0x58faf5];var _0x5ce204='i';var _0x2a7fad=_[_0x98ff('0x5f')](_0x1d2054,['name',_0x2fe731['field']]);if(!_0x2a7fad){switch(_0x2fe731['field']){case'unreadMessages':if(_0x2fe731[_0x98ff('0x60')]==0x1){_0x58a089[_0x98ff('0x61')]('`'+_0x2fe731[_0x98ff('0x48')]+_0x98ff('0x62'));}else{_0x58a089[_0x98ff('0x61')]('`'+_0x2fe731[_0x98ff('0x48')]+_0x98ff('0x63'));}break;case'Contact':if(_0x2fe731[_0x98ff('0x64')]==='$substring'){if(_0x2fe731[_0x98ff('0x60')][_0x98ff('0x65')]('\x20')[_0x98ff('0x43')]>0x1){_0x4e14a0[_0x35da9b](_0x98ff('0x66'),qs[_0x98ff('0x67')](_0x2fe731[_0x98ff('0x60')]),null);}else{var _0x2d1845='%'+_0x2fe731[_0x98ff('0x60')]+'%';_0x4e14a0[_0x35da9b](_0x98ff('0x68'),_0x2d1845,_0x2d1845,_0x2d1845);}}else{_0x2a7fad=_['find'](_0x1d2054,['name',_0x98ff('0x69')]);_0x2fe731[_0x98ff('0x48')]=_0x98ff('0x69');_0x4f4568=as[_0x98ff('0x6a')](_0x5ce204,_0x2a7fad[_0x98ff('0x6b')],_0x2fe731);_0x4e14a0[_0x35da9b](_0x4f4568['text'],_0x4f4568['value'][_0x98ff('0x6c')],_0x4f4568[_0x98ff('0x60')][_0x98ff('0x20')]);}break;case _0x98ff('0x6d'):var _0x28744d=_0x2fe731[_0x98ff('0x60')][_0x98ff('0x65')](',')[_0x98ff('0x31')](function(_0x42df02){return Number(_0x42df02);});_0x28744d['forEach'](function(_0x209c2d){_0x57c562['or'](_0x98ff('0x6e'),'%,'+_0x209c2d+',%');});_0x3885f8=_[_0x98ff('0x6f')](_0x3885f8,_0x28744d);break;case _0x98ff('0x70'):if(_0x2fe731[_0x98ff('0x64')]===_0x98ff('0x71')){_0x4e14a0[_0x35da9b](_0x98ff('0x72'),'%'+_0x2fe731[_0x98ff('0x60')]+'%',null);}else{_0x2a7fad=_[_0x98ff('0x5f')](_0x1d2054,[_0x98ff('0x2e'),_0x98ff('0x73')]);_0x2fe731[_0x98ff('0x48')]=_0x98ff('0x73');_0x4f4568=as[_0x98ff('0x6a')](_0x5ce204,_0x2a7fad[_0x98ff('0x6b')],_0x2fe731);_0x4e14a0[_0x35da9b](_0x4f4568[_0x98ff('0x74')],_0x4f4568['value'][_0x98ff('0x6c')],_0x4f4568[_0x98ff('0x60')][_0x98ff('0x20')]);}break;case _0x98ff('0x75'):_0x4f4568=as[_0x98ff('0x6a')]('me',null,_0x2fe731);_0x4e14a0[_0x35da9b](_0x4f4568[_0x98ff('0x74')],_0x4f4568[_0x98ff('0x60')][_0x98ff('0x6c')],_0x4f4568[_0x98ff('0x60')][_0x98ff('0x20')]);break;}}else{var _0x4f4568=as[_0x98ff('0x6a')](_0x5ce204,_0x2a7fad[_0x98ff('0x6b')],_0x2fe731);_0x4e14a0[_0x35da9b](_0x4f4568[_0x98ff('0x74')],_0x4f4568[_0x98ff('0x60')][_0x98ff('0x6c')],_0x4f4568[_0x98ff('0x60')][_0x98ff('0x20')]);}}}else{var _0x2a4138=_(_0x179538[_0x98ff('0x3e')])[_0x98ff('0x3f')]()[_0x98ff('0x31')](function(_0x370e97){return _['some'](_0x1d2054,[_0x98ff('0x2e'),_0x370e97])?_0x370e97:undefined;})[_0x98ff('0x76')]()[_0x98ff('0x60')]();if(!_[_0x98ff('0x77')](_0x2a4138)){_0x2a4138[_0x98ff('0x35')](function(_0x461878){if(_0x461878===_0x98ff('0x78')){_0x58a089[_0x98ff('0x79')]('i.WhatsappAccountId\x20IN\x20?',[][_0x98ff('0x7a')](_0x179538[_0x98ff('0x3e')][_0x461878]));}else if(_0x461878===_0x98ff('0x7b')){var _0xe1d35=JSON[_0x98ff('0x7c')](_0x179538[_0x98ff('0x3e')][_0x461878])['$gte'];var _0x2fefac=JSON['parse'](_0x179538[_0x98ff('0x3e')][_0x461878])['$lte'];_0x58a089[_0x98ff('0x79')](_0x98ff('0x7d'),_0xe1d35,_0x2fefac);}else{if(_0x179538['query'][_0x461878]===_0x98ff('0x7e')){_0x58a089[_0x98ff('0x79')]('i.'+_0x461878+_0x98ff('0x7f'));}else{_0x58a089[_0x98ff('0x79')]('i.'+_0x461878+'\x20=\x20?',_0x179538['query'][_0x461878]);}}});}if(_0x179538[_0x98ff('0x3e')]['read']){if(_0x179538[_0x98ff('0x3e')][_0x98ff('0x80')]==0x1){_0x58a089[_0x98ff('0x61')](_0x98ff('0x81'));}else{_0x58a089[_0x98ff('0x61')](_0x98ff('0x82'));}}if(_0x179538[_0x98ff('0x3e')][_0x98ff('0x83')]){_0x3885f8=_[_0x98ff('0x84')](_0x179538[_0x98ff('0x3e')][_0x98ff('0x83')])?_0x179538[_0x98ff('0x3e')][_0x98ff('0x83')]:new Array(_0x179538[_0x98ff('0x3e')]['tag']);_0x3885f8[_0x98ff('0x35')](function(_0x2ead57){_0x57c562['or'](_0x98ff('0x6e'),'%,'+_0x2ead57+',%');});}if(_0x179538[_0x98ff('0x3e')][_0x98ff('0x85')]){var _0x203ac0=_0x179538[_0x98ff('0x3e')]['filter'][_0x98ff('0x86')]('\x5c','\x5c\x5c')[_0x98ff('0x86')](/'/g,'\x27\x27');if(qs[_0x98ff('0x87')](_0x203ac0)){_0x4e14a0['or'](_0x98ff('0x88'),_0x203ac0+'%')['or'](_0x98ff('0x89'),_0x203ac0+'%');}else{_0x4e14a0['or'](_0x98ff('0x8a'),qs[_0x98ff('0x67')](_0x203ac0))['or'](_0x98ff('0x8b'),_0x203ac0+'%');}}}_0x58a089['where'](_0x4e14a0);_0x58a089[_0x98ff('0x8c')](_0x98ff('0x8d'));var _0x4ab7ac={'type':db[_0x98ff('0x8e')]['QueryTypes'][_0x98ff('0x8f')],'raw':!![]};var _0xc10c86=_0x58a089[_0x98ff('0x90')]();_0xc10c86[_0x98ff('0x48')](_0x98ff('0x8d'));_0xc10c86[_0x98ff('0x48')](_0x98ff('0x91'),_0x98ff('0x92'));if(_0x3c59c9[_0x98ff('0x93')]){_0x3c59c9['order'][_0x98ff('0x35')](function(_0x55a931){var _0x186205=_0x55a931[0x0]==='contactName'?_0x55a931[0x0]:'i.'+_0x55a931[0x0];_0x58a089[_0x98ff('0x93')](_0x186205,_0x55a931[0x1]===_0x98ff('0x94')?![]:!![]);});}if(!_[_0x98ff('0x77')](_0x3885f8)){_0x58a089['having'](_0x57c562);_0xc10c86[_0x98ff('0x79')](_0x98ff('0x95'),_0x3885f8);}BPromise[_0x98ff('0x96')]()[_0x98ff('0x2b')](function(){if(!_0x189258){if(_0x179538[_0x98ff('0x3e')]['WhatsappAccountId'])return;_0xc10c86['where'](_0x98ff('0x97'));_0x58a089[_0x98ff('0x79')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x179538['user'][_0x98ff('0x98')]!==_0x98ff('0x99'))return;return _0x179538[_0x98ff('0x9a')][_0x98ff('0x9b')]({'attributes':['id'],'raw':!![]})[_0x98ff('0x2b')](function(_0x2660b5){if(_['isEmpty'](_0x2660b5)){_0xc10c86['where'](_0x98ff('0x9c'));_0x58a089[_0x98ff('0x79')](_0x98ff('0x9c'));}else{_0xc10c86[_0x98ff('0x79')](_0x98ff('0x9d'),_[_0x98ff('0x31')](_0x2660b5,'id'));_0x58a089[_0x98ff('0x79')](_0x98ff('0x9d'),_['map'](_0x2660b5,'id'));}});})[_0x98ff('0x2b')](function(){if(_0x179538['user']['role']===_0x98ff('0x99')&&!_0x189258&&!_0x179538[_0x98ff('0x3e')][_0x98ff('0x78')])return[];return db[_0x98ff('0x9e')]['query'](_0xc10c86[_0x98ff('0x9f')](),_0x4ab7ac);})[_0x98ff('0x2b')](function(_0x154696){_0x2c3649[_0x98ff('0x25')]=_0x154696['length'];if(_0x2c3649[_0x98ff('0x25')]===0x0)return[];return db[_0x98ff('0x9e')]['query'](_0x2eb351['toString'](),_0x4ab7ac)['then'](function(_0x2292ba){_0x47a32a=_[_0x98ff('0xa0')](_0x2292ba,'id');_0x4ab7ac=_[_0x98ff('0xa1')](_0x4ab7ac,{'model':db[_0x98ff('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x179538[_0x98ff('0x3e')]['fields']){_0x3c59c9[_0x98ff('0x41')][_0x98ff('0x35')](function(_0x544288){_0x58a089[_0x98ff('0x48')]('i.'+_0x544288);});}else{_0x58a089['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x58a089['field'](_0x98ff('0xa2'),_0x98ff('0xa3'));_0x58a089['field'](_0x98ff('0xa4'),_0x98ff('0xa5'));_0x58a089['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',_0x98ff('0xa6'));_0x58a089[_0x98ff('0x48')](_0x98ff('0xa7'));_0x58a089[_0x98ff('0x48')](_0x98ff('0xa8'),_0x98ff('0xa9'));_0x58a089['field'](_0x98ff('0xaa'),_0x98ff('0xab'));_0x58a089['field'](_0x98ff('0xac'),'Contact.email');_0x58a089[_0x98ff('0x48')](_0x98ff('0xad'),_0x98ff('0xae'));_0x58a089[_0x98ff('0x48')](_0x98ff('0xaf'),_0x98ff('0xb0'));_0x58a089['field'](_0x98ff('0xb1'),_0x98ff('0xb2'));_0x58a089[_0x98ff('0x48')]('o.fullname',_0x98ff('0xb3'));_0x58a089[_0x98ff('0x48')]('o.internal','Owner.internal');_0x58a089[_0x98ff('0x48')](_0x98ff('0xb4'),_0x98ff('0x34'));}if(_0x3c59c9[_0x98ff('0x24')])_0x58a089[_0x98ff('0x24')](_0x3c59c9[_0x98ff('0x24')]);if(_0x3c59c9[_0x98ff('0x22')])_0x58a089[_0x98ff('0x22')](_0x3c59c9[_0x98ff('0x22')]);return db[_0x98ff('0x9e')][_0x98ff('0x3e')](_0x58a089['toString'](),_0x4ab7ac);})[_0x98ff('0x2b')](function(_0x187d3e){if(_0x187d3e[_0x98ff('0x43')]>0x0)_0x514e0c[_0x98ff('0x79')](_0x98ff('0xb5'),_[_0x98ff('0x31')](_0x187d3e,'id'));return db[_0x98ff('0x9e')][_0x98ff('0x3e')](_0x514e0c[_0x98ff('0x9f')](),_0x4ab7ac)[_0x98ff('0x2b')](function(_0xc86820){var _0xaba4b3=_[_0x98ff('0xb6')](_0xc86820,'WhatsappInteractionId');var _0x4684ad=[];_0x187d3e[_0x98ff('0x35')](function(_0x7bb23d){_0x4684ad['push'](updateWhatsappInteraction(_0x7bb23d,_0x47a32a,_0xaba4b3));});return BPromise[_0x98ff('0xb7')](_0x4684ad);});});})[_0x98ff('0x2b')](function(_0x2d28df){_0x2c3649[_0x98ff('0xb8')]=_0x2d28df;return _0x2c3649;})[_0x98ff('0x2b')](respondWithFilteredResult(_0x1b1291,_0x3c59c9))[_0x98ff('0x37')](handleError(_0x1b1291,null));};exports[_0x98ff('0xb9')]=function(_0x4b346d,_0x4a295f){var _0x1f3307={'raw':![],'where':{'id':_0x4b346d[_0x98ff('0xba')]['id']}},_0x5cc3d7={};_0x5cc3d7[_0x98ff('0x3d')]=_['keys'](db[_0x98ff('0x39')][_0x98ff('0x3a')]);_0x5cc3d7['query']=_[_0x98ff('0x3f')](_0x4b346d['query']);_0x5cc3d7[_0x98ff('0xbb')]=_[_0x98ff('0x40')](_0x5cc3d7[_0x98ff('0x3d')],_0x5cc3d7['query']);_0x1f3307[_0x98ff('0x41')]=_[_0x98ff('0x40')](_0x5cc3d7[_0x98ff('0x3d')],qs['fields'](_0x4b346d['query'][_0x98ff('0x42')]));_0x1f3307[_0x98ff('0x41')]=_0x1f3307['attributes'][_0x98ff('0x43')]?_0x1f3307[_0x98ff('0x41')]:_0x5cc3d7[_0x98ff('0x3d')];if(_0x4b346d[_0x98ff('0x3e')][_0x98ff('0xbc')]){_0x1f3307[_0x98ff('0xbd')]=[{'all':!![]}];}_0x1f3307=_[_0x98ff('0xa1')]({},_0x1f3307,_0x4b346d['options']);return db[_0x98ff('0x39')][_0x98ff('0x5f')](_0x1f3307)[_0x98ff('0x2b')](handleEntityNotFound(_0x4a295f,null))[_0x98ff('0x2b')](respondWithResult(_0x4a295f,null))['catch'](handleError(_0x4a295f,null));};exports[_0x98ff('0xbe')]=function(_0xfea44d,_0x2ebd35){return db[_0x98ff('0x39')][_0x98ff('0xbe')](_0xfea44d[_0x98ff('0x75')],{})[_0x98ff('0x2b')](respondWithResult(_0x2ebd35,0xc9))[_0x98ff('0x37')](handleError(_0x2ebd35,null));};exports['update']=function(_0x43a879,_0x227324){if(_0x43a879[_0x98ff('0x75')]['id']){delete _0x43a879[_0x98ff('0x75')]['id'];}return db[_0x98ff('0x39')][_0x98ff('0x5f')]({'where':{'id':_0x43a879[_0x98ff('0xba')]['id']}})['then'](handleEntityNotFound(_0x227324,null))['then'](saveUpdates(_0x43a879[_0x98ff('0x75')],null))['then'](respondWithResult(_0x227324,null))[_0x98ff('0x37')](handleError(_0x227324,null));};exports[_0x98ff('0xbf')]=function(_0x1f615b,_0x57b27c){return db['WhatsappInteraction'][_0x98ff('0x5f')]({'where':{'id':_0x1f615b[_0x98ff('0xba')]['id']}})['then'](handleEntityNotFound(_0x57b27c,null))[_0x98ff('0x2b')](removeEntity(_0x57b27c,null))[_0x98ff('0x37')](handleError(_0x57b27c,null));};exports[_0x98ff('0xc0')]=function(_0x4484d6,_0x25a7a6){return db['WhatsappInteraction'][_0x98ff('0xc0')]()[_0x98ff('0x2b')](respondWithResult(_0x25a7a6,null))[_0x98ff('0x37')](handleError(_0x25a7a6,null));};exports[_0x98ff('0xc1')]=function(_0x11d390,_0x50d9ae,_0x1c0972){return db['WhatsappMessage']['find']({'where':{'id':_0x11d390['params']['id']}})[_0x98ff('0x2b')](handleEntityNotFound(_0x50d9ae,null))[_0x98ff('0x2b')](function(_0x48d33a){if(_0x48d33a){return _0x48d33a[_0x98ff('0xc1')](_0x11d390['body'][_0x98ff('0xc2')],_[_0x98ff('0xc3')](_0x11d390['body'],['ids','id'])||{});}})[_0x98ff('0x2b')](respondWithResult(_0x50d9ae,null))[_0x98ff('0x37')](handleError(_0x50d9ae,null));};exports[_0x98ff('0xc4')]=function(_0x3c6c58,_0x12ec31,_0x16a1bf){var _0x2011b6={'raw':![],'where':{}};var _0x4d7d2c={};var _0x4d56c5={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x98ff('0xc5')]({'where':{'id':_0x3c6c58['params']['id']}})[_0x98ff('0x2b')](handleEntityNotFound(_0x12ec31,null))['then'](function(_0x32bb2d){if(_0x32bb2d){_0x4d7d2c[_0x98ff('0x3d')]=_[_0x98ff('0x3f')](db[_0x98ff('0xc6')][_0x98ff('0x3a')]);_0x4d7d2c[_0x98ff('0x3e')]=_[_0x98ff('0x3f')](_0x3c6c58['query']);_0x4d7d2c[_0x98ff('0xbb')]=_[_0x98ff('0x40')](_0x4d7d2c[_0x98ff('0x3d')],_0x4d7d2c[_0x98ff('0x3e')]);_0x2011b6[_0x98ff('0x41')]=_[_0x98ff('0x40')](_0x4d7d2c['model'],qs[_0x98ff('0x42')](_0x3c6c58[_0x98ff('0x3e')]['fields']));_0x2011b6[_0x98ff('0x41')]=_0x2011b6[_0x98ff('0x41')][_0x98ff('0x43')]?_0x2011b6[_0x98ff('0x41')]:_0x4d7d2c[_0x98ff('0x3d')];if(!_0x3c6c58[_0x98ff('0x3e')][_0x98ff('0x44')](_0x98ff('0xc7'))){_0x2011b6[_0x98ff('0x24')]=qs['limit'](_0x3c6c58[_0x98ff('0x3e')][_0x98ff('0x24')]);_0x2011b6[_0x98ff('0x22')]=qs[_0x98ff('0x22')](_0x3c6c58['query'][_0x98ff('0x22')]);}_0x2011b6['order']=qs[_0x98ff('0x45')](_0x3c6c58[_0x98ff('0x3e')][_0x98ff('0x45')]);_0x2011b6[_0x98ff('0x79')]=qs['filters'](_[_0x98ff('0x46')](_0x3c6c58[_0x98ff('0x3e')],_0x4d7d2c[_0x98ff('0xbb')]));_0x2011b6[_0x98ff('0x79')][_0x98ff('0xc8')]=_0x32bb2d['id'];if(_0x3c6c58[_0x98ff('0x3e')][_0x98ff('0x85')]){_0x2011b6[_0x98ff('0x79')]=_[_0x98ff('0xa1')](_0x2011b6[_0x98ff('0x79')],{'$or':_[_0x98ff('0x31')](_0x2011b6['attributes'],function(_0x3655fe){var _0x517969={};_0x517969[_0x3655fe]={'$like':'%'+_0x3c6c58[_0x98ff('0x3e')]['filter']+'%'};return _0x517969;})});}if(_0x3c6c58[_0x98ff('0x3e')][_0x98ff('0xc9')]){var _0x3e7ac7=_0x3c6c58[_0x98ff('0x3e')][_0x98ff('0xc9')]['split'](',');var _0x122a05={};_0x122a05[_0x3e7ac7[0x0]]={'$gte':moment(_0x3e7ac7[0x1])[_0x98ff('0xca')](_0x98ff('0xcb'))};_0x2011b6[_0x98ff('0x79')]=_[_0x98ff('0xa1')](_0x2011b6[_0x98ff('0x79')],_0x122a05);}_0x2011b6=_[_0x98ff('0xa1')]({},_0x2011b6,_0x3c6c58[_0x98ff('0xcc')]);return db[_0x98ff('0xc6')][_0x98ff('0x25')]({'where':_0x2011b6[_0x98ff('0x79')]})[_0x98ff('0x2b')](function(_0x469d98){_0x4d56c5[_0x98ff('0x25')]=_0x469d98;if(_0x3c6c58[_0x98ff('0x3e')][_0x98ff('0xbc')]){_0x2011b6[_0x98ff('0xbd')]=[{'all':!![]}];}return db[_0x98ff('0xc6')]['findAll'](_0x2011b6);})[_0x98ff('0x2b')](function(_0x1fffc2){_0x4d56c5['rows']=_0x1fffc2;return _0x4d56c5;});}})[_0x98ff('0x2b')](respondWithFilteredResult(_0x12ec31,_0x2011b6))[_0x98ff('0x37')](handleError(_0x12ec31,null));};exports[_0x98ff('0xcd')]=function(_0x43712e,_0x2721ab,_0x4213b2){return db['WhatsappInteraction']['find']({'where':{'id':_0x43712e['params']['id']}})[_0x98ff('0x2b')](handleEntityNotFound(_0x2721ab,null))[_0x98ff('0x2b')](function(_0x2765a2){if(_0x2765a2){return _0x2765a2['setTags'](_0x43712e[_0x98ff('0x75')][_0x98ff('0xc2')],_[_0x98ff('0xc3')](_0x43712e[_0x98ff('0x75')],[_0x98ff('0xc2'),'id'])||{})[_0x98ff('0xce')](function(){return db[_0x98ff('0x6d')][_0x98ff('0xcf')]({'attributes':['id',_0x98ff('0x2e'),_0x98ff('0x49')],'where':{'id':_0x43712e[_0x98ff('0x75')][_0x98ff('0xc2')]}});})['then'](function(_0x1ae263){socket['emit'](_0x98ff('0xd0'),{'id':Number(_0x43712e[_0x98ff('0xba')]['id']),'tags':_0x1ae263||[]});return{'id':Number(_0x43712e[_0x98ff('0xba')]['id']),'tags':_0x1ae263||[]};});}})[_0x98ff('0x2b')](respondWithResult(_0x2721ab,null))[_0x98ff('0x37')](handleError(_0x2721ab,null));};exports[_0x98ff('0xd1')]=function(_0x3380ca,_0x5473dd,_0x43abb5){return db[_0x98ff('0x39')][_0x98ff('0x5f')]({'where':{'id':_0x3380ca[_0x98ff('0xba')]['id']}})['then'](handleEntityNotFound(_0x5473dd,null))['then'](function(_0x351eb0){if(_0x351eb0){return _0x351eb0[_0x98ff('0xd1')](_0x3380ca['query'][_0x98ff('0xc2')]);}})[_0x98ff('0x2b')](respondWithStatusCode(_0x5473dd,null))[_0x98ff('0x37')](handleError(_0x5473dd,null));};exports['download']=function(_0x587f07,_0x1e3bba){var _0x25545b=moment()[_0x98ff('0xd2')]()['toString']();var _0x46b0a1=path['join'](config[_0x98ff('0xd3')],_0x98ff('0xd4'),_0x98ff('0xd5'),_0x98ff('0xd6'));var _0x2074b8=path[_0x98ff('0xd7')](config[_0x98ff('0xd3')],'server',_0x98ff('0xd5'),_0x98ff('0xd8'));var _0x6a47d0=path[_0x98ff('0xd7')](_0x46b0a1,_0x25545b);var _0xc8843c=util[_0x98ff('0xca')](_0x98ff('0xd9'),_0x587f07[_0x98ff('0xba')]['id'],_0x25545b);var _0x7c6fa1=path[_0x98ff('0xd7')](_0x46b0a1,_0xc8843c);var _0x3090d3=[];_0x3090d3[_0x98ff('0x36')]({'model':db[_0x98ff('0x70')],'as':_0x98ff('0x70'),'attributes':['id',_0x98ff('0x32')],'raw':!![]});_0x3090d3[_0x98ff('0x36')]({'model':db[_0x98ff('0xda')],'as':'Contact','attributes':['id',_0x98ff('0xdb'),_0x98ff('0xdc')],'raw':!![]});if(_0x587f07[_0x98ff('0x3e')][_0x98ff('0xd8')]){_0x3090d3[_0x98ff('0x36')]({'model':db[_0x98ff('0xdd')],'as':'Attachment','raw':!![]});}var _0x2d388d=[{'model':db[_0x98ff('0xc6')],'as':'Messages','attributes':['id','body','createdAt','direction',_0x98ff('0xde'),_0x98ff('0x80')],'include':_0x3090d3}];_0x2d388d['push']({'model':db[_0x98ff('0xdf')],'as':_0x98ff('0xe0'),'attributes':['id',_0x98ff('0x2e')]});_0x2d388d[_0x98ff('0x36')]({'model':db[_0x98ff('0x70')],'as':_0x98ff('0xe1'),'attributes':['id',_0x98ff('0x32')]});return db[_0x98ff('0x39')][_0x98ff('0x5f')]({'where':{'id':_0x587f07[_0x98ff('0xba')]['id']},'include':_0x2d388d})['then'](handleEntityNotFound(_0x1e3bba,null))[_0x98ff('0x2b')](function(_0x35e539){if(_0x35e539){var _0x5874a1=_0x35e539[_0x98ff('0xe2')]({'plain':!![]});fs['mkdirSync'](_0x6a47d0);var _0x5619ec={'channel':_0x98ff('0xe3'),'account':_0x5874a1[_0x98ff('0xe0')][_0x98ff('0x2e')],'agent':_0x5874a1[_0x98ff('0xe1')]?_0x5874a1[_0x98ff('0xe1')][_0x98ff('0x32')]:_0x98ff('0xe4'),'createdAt':moment(_0x5874a1['createdAt'])['format'](_0x98ff('0xcb'))['toString'](),'closedAt':_0x5874a1['closed']?moment(_0x5874a1['closedAt'])[_0x98ff('0xca')](_0x98ff('0xcb'))[_0x98ff('0x9f')]():'','disposition':_0x5874a1[_0x98ff('0xe5')],'messages':_(_0x5874a1[_0x98ff('0xe6')])['filter']({'secret':![]})[_0x98ff('0x31')](function(_0x13e34b){if(_0x13e34b[_0x98ff('0xdd')]){var _0x3895df=path[_0x98ff('0xd7')](_0x2074b8,_0x13e34b[_0x98ff('0xdd')]['basename']);if(fs[_0x98ff('0xe7')](_0x3895df)){fs['createReadStream'](_0x3895df)['pipe'](fs[_0x98ff('0xe8')](path['join'](_0x6a47d0,_0x13e34b[_0x98ff('0xdd')][_0x98ff('0xe9')])));}}return{'date':moment(_0x13e34b['createdAt'])[_0x98ff('0xca')](_0x98ff('0xcb'))[_0x98ff('0x9f')](),'sender':_0x13e34b[_0x98ff('0xea')]===_0x98ff('0xeb')?_0x13e34b[_0x98ff('0x70')]?_0x13e34b[_0x98ff('0x70')]['fullname']:_0x98ff('0xec'):_0x13e34b[_0x98ff('0xed')][_0x98ff('0xdb')]+(_0x13e34b[_0x98ff('0xed')][_0x98ff('0xdc')]?'\x20'+_0x13e34b[_0x98ff('0xed')]['lastName']:''),'body':_0x13e34b[_0x98ff('0xdd')]?_0x13e34b['Attachment'][_0x98ff('0xe9')]:_0x13e34b[_0x98ff('0x75')],'direction':_0x13e34b[_0x98ff('0xea')]==='out'?'A':'C','secret':_0x13e34b['secret'],'read':_0x13e34b[_0x98ff('0x80')],'attachment':_0x13e34b[_0x98ff('0xdd')]};})[_0x98ff('0x60')]()};return ejs[_0x98ff('0xee')](path['join'](config[_0x98ff('0xd3')],_0x98ff('0xd4'),_0x98ff('0xef'),'downloadInteraction.ejs'),{'interaction':_0x5619ec})[_0x98ff('0x2b')](function(_0x2b5aa2){var _0x36ac43=path[_0x98ff('0xd7')](_0x6a47d0,_0x98ff('0xf0')+_0x5874a1['id']+'-'+_0x25545b+_0x98ff('0xf1'));var _0x36ad0f={'path':_0x36ac43,'channel':_0x98ff('0xe3'),'interactionId':_0x5874a1['id']};return pdf[_0x98ff('0xf2')](_0x2b5aa2,_0x36ad0f);})[_0x98ff('0x2b')](function(){return new BPromise(function(_0x3fe57d,_0x5604c1){zipdir(_0x6a47d0,{'saveTo':_0x7c6fa1},function(_0x5cd2ee,_0x219623){if(_0x5cd2ee)return _0x5604c1(_0x5cd2ee);return _0x3fe57d(_0x219623);});})[_0x98ff('0x2b')](function(){return new BPromise(function(_0x202851,_0x135d03){rimraf(_0x6a47d0,function(_0x25135b){if(_0x25135b)_0x135d03(_0x25135b);return _0x202851();});});})[_0x98ff('0x2b')](function(){return _0x1e3bba[_0x98ff('0xf3')](_0x7c6fa1,_0xc8843c,function(_0x3f9e05){if(_0x3f9e05){console['log'](_0x98ff('0xf4'),_0x3f9e05);}else{fs[_0x98ff('0xf5')](_0x7c6fa1);}});});});}else{return _0x1e3bba[_0x98ff('0x1f')](0xc8);}})[_0x98ff('0x37')](handleError(_0x1e3bba,null));};
\ No newline at end of file
index 1d315da..bb663bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09dd=['exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','then','emit','catch','hasOwnProperty','hook'];(function(_0x2dc96f,_0x459058){var _0xd012da=function(_0x38d032){while(--_0x38d032){_0x2dc96f['push'](_0x2dc96f['shift']());}};_0xd012da(++_0x459058);}(_0x09dd,0xb7));var _0xd09d=function(_0x323591,_0x518650){_0x323591=_0x323591-0x0;var _0x423982=_0x09dd[_0x323591];return _0x423982;};'use strict';var EventEmitter=require(_0xd09d('0x0'));var WhatsappInteraction=require(_0xd09d('0x1'))['db'][_0xd09d('0x2')];var WhatsappMessage=require(_0xd09d('0x1'))['db'][_0xd09d('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd09d('0x4')](0x0);var events={'afterCreate':_0xd09d('0x5'),'afterUpdate':_0xd09d('0x6'),'afterDestroy':_0xd09d('0x7')};function emitEvent(_0x50d0a5){return function(_0x467211,_0x5c3a69,_0x274db5){_0x467211['getUsers']({'attributes':['id'],'raw':!![]})[_0xd09d('0x8')](function(_0x5e2910){_0x467211['setDataValue']('Users',_0x5e2910['map'](function(_0x66a82){return{'id':_0x66a82['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x467211['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd09d('0x8')](function(_0x2566ce){_0x467211['setDataValue']('unreadMessages',_0x2566ce['length']);WhatsappInteractionEvents[_0xd09d('0x9')](_0x50d0a5+':'+_0x467211['id'],_0x467211);WhatsappInteractionEvents[_0xd09d('0x9')](_0x50d0a5,_0x467211);_0x274db5(null);})[_0xd09d('0xa')](_0x274db5(null));};}for(var e in events){if(events[_0xd09d('0xb')](e)){var event=events[e];WhatsappInteraction[_0xd09d('0xc')](e,emitEvent(event));}}module[_0xd09d('0xd')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x1c8a=['map','findAll','length','emit','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','remove','getUsers','then','setDataValue','Users'];(function(_0x23fa4d,_0x5bd8f2){var _0x1a5b22=function(_0x3cf99a){while(--_0x3cf99a){_0x23fa4d['push'](_0x23fa4d['shift']());}};_0x1a5b22(++_0x5bd8f2);}(_0x1c8a,0x140));var _0xa1c8=function(_0x1507f6,_0x26269c){_0x1507f6=_0x1507f6-0x0;var _0x5991a7=_0x1c8a[_0x1507f6];return _0x5991a7;};'use strict';var EventEmitter=require(_0xa1c8('0x0'));var WhatsappInteraction=require(_0xa1c8('0x1'))['db'][_0xa1c8('0x2')];var WhatsappMessage=require(_0xa1c8('0x1'))['db'][_0xa1c8('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa1c8('0x4'),'afterUpdate':'update','afterDestroy':_0xa1c8('0x5')};function emitEvent(_0x1cdee0){return function(_0x4668e8,_0x559330,_0x331282){_0x4668e8[_0xa1c8('0x6')]({'attributes':['id'],'raw':!![]})[_0xa1c8('0x7')](function(_0x57d2d4){_0x4668e8[_0xa1c8('0x8')](_0xa1c8('0x9'),_0x57d2d4[_0xa1c8('0xa')](function(_0x4a5d71){return{'id':_0x4a5d71['id']};}));return WhatsappMessage[_0xa1c8('0xb')]({'where':{'WhatsappInteractionId':_0x4668e8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa1c8('0x7')](function(_0x6e2ad7){_0x4668e8['setDataValue']('unreadMessages',_0x6e2ad7[_0xa1c8('0xc')]);WhatsappInteractionEvents['emit'](_0x1cdee0+':'+_0x4668e8['id'],_0x4668e8);WhatsappInteractionEvents[_0xa1c8('0xd')](_0x1cdee0,_0x4668e8);_0x331282(null);})['catch'](_0x331282(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xa1c8('0xe')]=WhatsappInteractionEvents;
\ No newline at end of file
index 3709182..065a946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90ad=['changed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions'];(function(_0x5cc194,_0x1d187b){var _0x24cbbb=function(_0x5f2e6c){while(--_0x5f2e6c){_0x5cc194['push'](_0x5cc194['shift']());}};_0x24cbbb(++_0x1d187b);}(_0x90ad,0x195));var _0xd90a=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x90ad[_0x43d16c];return _0x208cce;};'use strict';var _=require(_0xd90a('0x0'));var util=require(_0xd90a('0x1'));var logger=require(_0xd90a('0x2'))(_0xd90a('0x3'));var moment=require(_0xd90a('0x4'));var BPromise=require('bluebird');var rp=require(_0xd90a('0x5'));var fs=require('fs');var path=require(_0xd90a('0x6'));var rimraf=require(_0xd90a('0x7'));var config=require('../../config/environment');var attributes=require(_0xd90a('0x8'));module['exports']=function(_0xec5cd1,_0x21da8b){return _0xec5cd1['define'](_0xd90a('0x9'),attributes,{'tableName':_0xd90a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ffb6f,_0x5ed7fa,_0x491c30){if(_0x3ffb6f[_0xd90a('0xb')]('closed')){_0x3ffb6f['closedAt']=moment()['format'](_0xd90a('0xc'));}_0x491c30(null,_0x3ffb6f);}}});};
\ No newline at end of file
+var _0xe77e=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','whatsapp_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5ad6b1,_0x426253){var _0x10c5a2=function(_0x4a2238){while(--_0x4a2238){_0x5ad6b1['push'](_0x5ad6b1['shift']());}};_0x10c5a2(++_0x426253);}(_0xe77e,0xc4));var _0xee77=function(_0x10ecc8,_0x2f7958){_0x10ecc8=_0x10ecc8-0x0;var _0x26b436=_0xe77e[_0x10ecc8];return _0x26b436;};'use strict';var _=require('lodash');var util=require(_0xee77('0x0'));var logger=require(_0xee77('0x1'))('api');var moment=require(_0xee77('0x2'));var BPromise=require(_0xee77('0x3'));var rp=require(_0xee77('0x4'));var fs=require('fs');var path=require(_0xee77('0x5'));var rimraf=require(_0xee77('0x6'));var config=require(_0xee77('0x7'));var attributes=require(_0xee77('0x8'));module[_0xee77('0x9')]=function(_0x320cef,_0x4c265c){return _0x320cef['define']('WhatsappInteraction',attributes,{'tableName':_0xee77('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4cb642,_0x209a0d,_0x5d2821){if(_0x4cb642['changed'](_0xee77('0xb'))){_0x4cb642[_0xee77('0xc')]=moment()['format'](_0xee77('0xd'));}_0x5d2821(null,_0x4cb642);}}});};
\ No newline at end of file
index a7e88fa..726fc28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64a1=['WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','where','attributes','limit','then','AddTagsToWhatsappInteraction','find','ids','omit','body','spread','AddTags','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','info'];(function(_0x548ba3,_0x127eb1){var _0x1ef4a9=function(_0x30adc5){while(--_0x30adc5){_0x548ba3['push'](_0x548ba3['shift']());}};_0x1ef4a9(++_0x127eb1);}(_0x64a1,0x6c));var _0x164a=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x64a1[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x164a('0x0'));var util=require(_0x164a('0x1'));var moment=require(_0x164a('0x2'));var BPromise=require(_0x164a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x164a('0x4'));var logger=require(_0x164a('0x5'))(_0x164a('0x6'));var config=require(_0x164a('0x7'));var jayson=require(_0x164a('0x8'));var client=jayson[_0x164a('0x9')][_0x164a('0xa')]({'port':0x232a});config[_0x164a('0xb')]=_[_0x164a('0xc')](config[_0x164a('0xb')],{'host':_0x164a('0xd'),'port':0x18eb});var socket=require(_0x164a('0xe'))(new Redis(config[_0x164a('0xb')]));require(_0x164a('0xf'))['register'](socket);function respondWithRpcPromise(_0x1cdf28,_0x2dfa0d,_0x44863a){return new BPromise(function(_0x52ecf8,_0xe1e70a){return client[_0x164a('0x10')](_0x1cdf28,_0x44863a)['then'](function(_0x419c3a){logger[_0x164a('0x11')](_0x164a('0x12'),_0x2dfa0d,_0x164a('0x13'));logger[_0x164a('0x14')](_0x164a('0x15'),_0x2dfa0d,_0x164a('0x13'),JSON['stringify'](_0x419c3a));if(_0x419c3a[_0x164a('0x16')]){if(_0x419c3a[_0x164a('0x16')][_0x164a('0x17')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x2dfa0d,_0x419c3a[_0x164a('0x16')][_0x164a('0x18')]);return _0xe1e70a(_0x419c3a['error'][_0x164a('0x18')]);}logger[_0x164a('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x2dfa0d,_0x419c3a[_0x164a('0x16')][_0x164a('0x18')]);return _0x52ecf8(_0x419c3a[_0x164a('0x16')]['message']);}else{logger[_0x164a('0x11')](_0x164a('0x12'),_0x2dfa0d,_0x164a('0x13'));_0x52ecf8(_0x419c3a['result']['message']);}})[_0x164a('0x19')](function(_0x1e2951){logger[_0x164a('0x16')](_0x164a('0x12'),_0x2dfa0d,_0x1e2951);_0xe1e70a(_0x1e2951);});});}exports[_0x164a('0x1a')]=function(_0x446569){var _0x1cbf86=this;return new Promise(function(_0x2b7e6b,_0x175a78){return db[_0x164a('0x1b')]['update'](_0x446569['body'],{'raw':_0x446569[_0x164a('0x1c')]?_0x446569['options'][_0x164a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x446569['options']?_0x446569[_0x164a('0x1c')][_0x164a('0x1e')]||null:null,'attributes':_0x446569[_0x164a('0x1c')]?_0x446569[_0x164a('0x1c')][_0x164a('0x1f')]||null:null,'limit':_0x446569[_0x164a('0x1c')]?_0x446569[_0x164a('0x1c')][_0x164a('0x20')]||null:null})[_0x164a('0x21')](function(_0x3b1bb2){logger['info']('UpdateWhatsappInteraction',_0x446569);logger['debug']('UpdateWhatsappInteraction',_0x446569,JSON['stringify'](_0x3b1bb2));_0x2b7e6b(_0x3b1bb2);})[_0x164a('0x19')](function(_0x617eea){logger[_0x164a('0x16')]('UpdateWhatsappInteraction',_0x617eea[_0x164a('0x18')],_0x446569);_0x175a78(_0x1cbf86['error'](0x1f4,_0x617eea[_0x164a('0x18')]));});});};exports[_0x164a('0x22')]=function(_0x5734f5){return new Promise(function(_0x550178,_0x5a339b){return db[_0x164a('0x1b')][_0x164a('0x23')]({'where':_0x5734f5[_0x164a('0x1c')]?_0x5734f5[_0x164a('0x1c')][_0x164a('0x1e')]||null:null})[_0x164a('0x21')](function(_0x48e21a){if(_0x48e21a){return _0x48e21a['addTags'](_0x5734f5['body'][_0x164a('0x24')],_[_0x164a('0x25')](_0x5734f5[_0x164a('0x26')],['ids','id'])||{});}})[_0x164a('0x27')](function(_0x9ea08f){logger[_0x164a('0x11')](_0x164a('0x28'),_0x5734f5);logger['debug'](_0x164a('0x28'),_0x5734f5,JSON[_0x164a('0x29')](_0x9ea08f));_0x550178(_0x9ea08f);})['catch'](function(_0x32ba4f){logger[_0x164a('0x16')](_0x164a('0x28'),_0x32ba4f[_0x164a('0x18')],_0x5734f5);_0x5a339b(_this[_0x164a('0x16')](0x1f4,_0x32ba4f[_0x164a('0x18')]));});});};
\ No newline at end of file
+var _0x2029=['AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','stringify','WhatsappInteraction','find','addTags','ids','omit'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x2029,0x1c9));var _0x9202=function(_0x12a224,_0x251044){_0x12a224=_0x12a224-0x0;var _0x244bac=_0x2029[_0x12a224];return _0x244bac;};'use strict';var _=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var moment=require('moment');var BPromise=require(_0x9202('0x2'));var rs=require(_0x9202('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9202('0x4'))['db'];var utils=require(_0x9202('0x5'));var logger=require(_0x9202('0x6'))('rpc');var config=require(_0x9202('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9202('0x8')][_0x9202('0x9')]({'port':0x232a});config[_0x9202('0xa')]=_[_0x9202('0xb')](config['redis'],{'host':_0x9202('0xc'),'port':0x18eb});var socket=require(_0x9202('0xd'))(new Redis(config[_0x9202('0xa')]));require('./whatsappInteraction.socket')[_0x9202('0xe')](socket);function respondWithRpcPromise(_0x54e634,_0x32de68,_0x5a733e){return new BPromise(function(_0x11cd33,_0x12dd7d){return client['request'](_0x54e634,_0x5a733e)[_0x9202('0xf')](function(_0x12ff41){logger[_0x9202('0x10')](_0x9202('0x11'),_0x32de68,_0x9202('0x12'));logger[_0x9202('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x32de68,_0x9202('0x12'),JSON['stringify'](_0x12ff41));if(_0x12ff41['error']){if(_0x12ff41[_0x9202('0x14')][_0x9202('0x15')]===0x1f4){logger[_0x9202('0x14')](_0x9202('0x11'),_0x32de68,_0x12ff41[_0x9202('0x14')][_0x9202('0x16')]);return _0x12dd7d(_0x12ff41[_0x9202('0x14')][_0x9202('0x16')]);}logger[_0x9202('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x32de68,_0x12ff41['error'][_0x9202('0x16')]);return _0x11cd33(_0x12ff41[_0x9202('0x14')]['message']);}else{logger[_0x9202('0x10')](_0x9202('0x11'),_0x32de68,'request\x20sent');_0x11cd33(_0x12ff41['result'][_0x9202('0x16')]);}})[_0x9202('0x17')](function(_0x83076d){logger[_0x9202('0x14')](_0x9202('0x11'),_0x32de68,_0x83076d);_0x12dd7d(_0x83076d);});});}exports[_0x9202('0x18')]=function(_0x2c62cd){var _0x1ee69a=this;return new Promise(function(_0xed029e,_0x41770f){return db['WhatsappInteraction'][_0x9202('0x19')](_0x2c62cd[_0x9202('0x1a')],{'raw':_0x2c62cd['options']?_0x2c62cd[_0x9202('0x1b')][_0x9202('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c62cd[_0x9202('0x1b')]?_0x2c62cd[_0x9202('0x1b')][_0x9202('0x1d')]||null:null,'attributes':_0x2c62cd['options']?_0x2c62cd['options'][_0x9202('0x1e')]||null:null,'limit':_0x2c62cd[_0x9202('0x1b')]?_0x2c62cd['options']['limit']||null:null})[_0x9202('0xf')](function(_0x288579){logger['info'](_0x9202('0x18'),_0x2c62cd);logger[_0x9202('0x13')]('UpdateWhatsappInteraction',_0x2c62cd,JSON[_0x9202('0x1f')](_0x288579));_0xed029e(_0x288579);})['catch'](function(_0x4f0ae8){logger[_0x9202('0x14')]('UpdateWhatsappInteraction',_0x4f0ae8[_0x9202('0x16')],_0x2c62cd);_0x41770f(_0x1ee69a[_0x9202('0x14')](0x1f4,_0x4f0ae8[_0x9202('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x1ed6cd){return new Promise(function(_0x25bc2d,_0x277c3c){return db[_0x9202('0x20')][_0x9202('0x21')]({'where':_0x1ed6cd['options']?_0x1ed6cd[_0x9202('0x1b')][_0x9202('0x1d')]||null:null})['then'](function(_0x32a6c9){if(_0x32a6c9){return _0x32a6c9[_0x9202('0x22')](_0x1ed6cd[_0x9202('0x1a')][_0x9202('0x23')],_[_0x9202('0x24')](_0x1ed6cd[_0x9202('0x1a')],[_0x9202('0x23'),'id'])||{});}})['spread'](function(_0x20f7ee){logger[_0x9202('0x10')](_0x9202('0x25'),_0x1ed6cd);logger['debug']('AddTags',_0x1ed6cd,JSON[_0x9202('0x1f')](_0x20f7ee));_0x25bc2d(_0x20f7ee);})[_0x9202('0x17')](function(_0x20505d){logger[_0x9202('0x14')](_0x9202('0x25'),_0x20505d[_0x9202('0x16')],_0x1ed6cd);_0x277c3c(_this[_0x9202('0x14')](0x1f4,_0x20505d[_0x9202('0x16')]));});});};
\ No newline at end of file
index cc7d326..496ea06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb05=['save','update','emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0xcb05,0x1e9));var _0x5cb0=function(_0xe67fe3,_0x14ac43){_0xe67fe3=_0xe67fe3-0x0;var _0x2769af=_0xcb05[_0xe67fe3];return _0x2769af;};'use strict';var WhatsappInteractionEvents=require(_0x5cb0('0x0'));var events=[_0x5cb0('0x1'),'remove',_0x5cb0('0x2')];function createListener(_0x23a99d,_0x4dbc76){return function(_0x2ab321){_0x4dbc76[_0x5cb0('0x3')](_0x23a99d,_0x2ab321);};}function removeListener(_0x112c95,_0x221496){return function(){WhatsappInteractionEvents[_0x5cb0('0x4')](_0x112c95,_0x221496);};}exports[_0x5cb0('0x5')]=function(_0x337c5d){for(var _0x55238d=0x0,_0x5d59df=events['length'];_0x55238d<_0x5d59df;_0x55238d++){var _0x57e7c4=events[_0x55238d];var _0x848fa9=createListener(_0x5cb0('0x6')+_0x57e7c4,_0x337c5d);WhatsappInteractionEvents['on'](_0x57e7c4,_0x848fa9);}};
\ No newline at end of file
+var _0x99d2=['remove','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x99d2,0xa6));var _0x299d=function(_0x5152ea,_0x368c99){_0x5152ea=_0x5152ea-0x0;var _0x5eeb3d=_0x99d2[_0x5152ea];return _0x5eeb3d;};'use strict';var WhatsappInteractionEvents=require(_0x299d('0x0'));var events=[_0x299d('0x1'),_0x299d('0x2'),'update'];function createListener(_0x3f47e9,_0x231b33){return function(_0x117292){_0x231b33[_0x299d('0x3')](_0x3f47e9,_0x117292);};}function removeListener(_0x32729a,_0x1d3bc6){return function(){WhatsappInteractionEvents[_0x299d('0x4')](_0x32729a,_0x1d3bc6);};}exports[_0x299d('0x5')]=function(_0x8ae208){for(var _0x3d7e0a=0x0,_0x11185d=events[_0x299d('0x6')];_0x3d7e0a<_0x11185d;_0x3d7e0a++){var _0x7f29fd=events[_0x3d7e0a];var _0x19917e=createListener(_0x299d('0x7')+_0x7f29fd,_0x8ae208);WhatsappInteractionEvents['on'](_0x7f29fd,_0x19917e);}};
\ No newline at end of file
index c655e49..738eaeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5895=['index','/describe','describe','show','tracked','whatsapp','create','post','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x5895,0x13a));var _0x5589=function(_0x2870ec,_0x3f2be6){_0x2870ec=_0x2870ec-0x0;var _0x3e2ae6=_0x5895[_0x2870ec];return _0x3e2ae6;};'use strict';var multer=require('multer');var util=require(_0x5589('0x0'));var path=require(_0x5589('0x1'));var timeout=require(_0x5589('0x2'));var express=require(_0x5589('0x3'));var router=express['Router']();var fs_extra=require(_0x5589('0x4'));var auth=require(_0x5589('0x5'));var interaction=require(_0x5589('0x6'));var config=require('../../config/environment');var controller=require(_0x5589('0x7'));router[_0x5589('0x8')]('/',auth[_0x5589('0x9')](),controller[_0x5589('0xa')]);router[_0x5589('0x8')](_0x5589('0xb'),auth[_0x5589('0x9')](),controller[_0x5589('0xc')]);router[_0x5589('0x8')]('/:id',auth[_0x5589('0x9')](),controller[_0x5589('0xd')]);router['post']('/',auth[_0x5589('0x9')](),interaction[_0x5589('0xe')](_0x5589('0xf'),'whatsappmessage:create'),controller[_0x5589('0x10')]);router[_0x5589('0x11')](_0x5589('0x12'),controller[_0x5589('0x13')]);router[_0x5589('0x14')](_0x5589('0x15'),auth[_0x5589('0x9')](),controller[_0x5589('0x16')]);router[_0x5589('0x14')](_0x5589('0x17'),auth[_0x5589('0x9')](),controller[_0x5589('0x18')]);router[_0x5589('0x14')](_0x5589('0x19'),auth[_0x5589('0x9')](),controller['reject']);router['delete'](_0x5589('0x15'),auth[_0x5589('0x9')](),controller[_0x5589('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x720e=['multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','tracked','create','put','/:id','update','accept','reject','delete','destroy','exports'];(function(_0x45a31b,_0x1ae643){var _0x5d9743=function(_0x3b36c7){while(--_0x3b36c7){_0x45a31b['push'](_0x45a31b['shift']());}};_0x5d9743(++_0x1ae643);}(_0x720e,0xb8));var _0xe720=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0x720e[_0x254b22];return _0x1279db;};'use strict';var multer=require(_0xe720('0x0'));var util=require(_0xe720('0x1'));var path=require(_0xe720('0x2'));var timeout=require(_0xe720('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe720('0x4'));var config=require(_0xe720('0x5'));var controller=require('./whatsappMessage.controller');router[_0xe720('0x6')]('/',auth['isAuthenticated'](),controller[_0xe720('0x7')]);router[_0xe720('0x6')](_0xe720('0x8'),auth[_0xe720('0x9')](),controller[_0xe720('0xa')]);router[_0xe720('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xe720('0xb')]);router[_0xe720('0xc')]('/',auth['isAuthenticated'](),interaction[_0xe720('0xd')]('whatsapp','whatsappmessage:create'),controller[_0xe720('0xe')]);router[_0xe720('0xc')]('/:id/status',controller['status']);router[_0xe720('0xf')](_0xe720('0x10'),auth[_0xe720('0x9')](),controller[_0xe720('0x11')]);router[_0xe720('0xf')]('/:id/accept',auth[_0xe720('0x9')](),controller[_0xe720('0x12')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xe720('0x13')]);router[_0xe720('0x14')]('/:id',auth[_0xe720('0x9')](),controller[_0xe720('0x15')]);module[_0xe720('0x16')]=router;
\ No newline at end of file
index 88ed900..b16c2fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351f=['TEXT','medium','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x351f,0xd6));var _0xf351=function(_0x4d704c,_0x5946f8){_0x4d704c=_0x4d704c-0x0;var _0x5b75a3=_0x351f[_0x4d704c];return _0x5b75a3;};'use strict';var Sequelize=require(_0xf351('0x0'));module[_0xf351('0x1')]={'body':{'type':Sequelize[_0xf351('0x2')](_0xf351('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf351('0x4')]('in',_0xf351('0x5')),'defaultValue':_0xf351('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf351('0x6')](0xbe)},'phone':{'type':Sequelize[_0xf351('0x6')]},'readAt':{'type':Sequelize[_0xf351('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf351('0x6')]},'providerResponse':{'type':Sequelize[_0xf351('0x2')]}};
\ No newline at end of file
+var _0xb4c7=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0xa454d4,_0x298a6a){var _0x2daf62=function(_0x30907e){while(--_0x30907e){_0xa454d4['push'](_0xa454d4['shift']());}};_0x2daf62(++_0x298a6a);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x535bb0,_0xf7ba07){_0x535bb0=_0x535bb0-0x0;var _0x45e279=_0xb4c7[_0x535bb0];return _0x45e279;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'body':{'type':Sequelize[_0x7b4c('0x2')](_0x7b4c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7b4c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7b4c('0x5')),'defaultValue':_0x7b4c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7b4c('0x6')](0xbe)},'phone':{'type':Sequelize[_0x7b4c('0x6')]},'readAt':{'type':Sequelize[_0x7b4c('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7b4c('0x6')]},'providerResponse':{'type':Sequelize[_0x7b4c('0x2')]}};
\ No newline at end of file
index a521851..4816a19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ca1=['role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','accept','EventManager','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','./whatsappMessage.socket','register','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','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','update','find','describe','whatsapp-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','format','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0xf018cb,_0x189731){var _0x22997f=function(_0x4c6d60){while(--_0x4c6d60){_0xf018cb['push'](_0xf018cb['shift']());}};_0x22997f(++_0x189731);}(_0x9ca1,0x1cc));var _0x19ca=function(_0x35bb77,_0x12b101){_0x35bb77=_0x35bb77-0x0;var _0x42234c=_0x9ca1[_0x35bb77];return _0x42234c;};'use strict';var emlformat=require(_0x19ca('0x0'));var rimraf=require(_0x19ca('0x1'));var zipdir=require(_0x19ca('0x2'));var jsonpatch=require(_0x19ca('0x3'));var rp=require(_0x19ca('0x4'));var moment=require(_0x19ca('0x5'));var BPromise=require(_0x19ca('0x6'));var Mustache=require(_0x19ca('0x7'));var util=require(_0x19ca('0x8'));var path=require(_0x19ca('0x9'));var sox=require(_0x19ca('0xa'));var csv=require('to-csv');var ejs=require(_0x19ca('0xb'));var fs=require('fs');var fs_extra=require(_0x19ca('0xc'));var _=require(_0x19ca('0xd'));var squel=require('squel');var crypto=require(_0x19ca('0xe'));var jsforce=require(_0x19ca('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x19ca('0x10'));var querystring=require(_0x19ca('0x11'));var Papa=require('papaparse');var Redis=require(_0x19ca('0x12'));var authService=require(_0x19ca('0x13'));var qs=require(_0x19ca('0x14'));var as=require(_0x19ca('0x15'));var hardwareService=require(_0x19ca('0x16'));var logger=require(_0x19ca('0x17'))(_0x19ca('0x18'));var utils=require(_0x19ca('0x19'));var config=require(_0x19ca('0x1a'));var licenseUtil=require(_0x19ca('0x1b'));var db=require('../../mysqldb')['db'];config[_0x19ca('0x1c')]=_['defaults'](config[_0x19ca('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x19ca('0x1d'))[_0x19ca('0x1e')](socket);var jayson=require(_0x19ca('0x1f'));var client=jayson[_0x19ca('0x20')][_0x19ca('0x21')]({'port':0x232c});var client9002=jayson[_0x19ca('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dd7bf,_0x2e4e4c,_0x524277,_0xd852a9){return new BPromise(function(_0x2942a4,_0x334fc4){var _0x32b675=_0xd852a9||client;return _0x32b675[_0x19ca('0x22')](_0x4dd7bf,_0x524277)['then'](function(_0x5b1d46){logger[_0x19ca('0x23')](_0x19ca('0x24'),_0x2e4e4c,_0x19ca('0x25'));logger['debug'](_0x19ca('0x26'),_0x2e4e4c,'request\x20sent',JSON[_0x19ca('0x27')](_0x5b1d46));if(_0x5b1d46[_0x19ca('0x28')]){if(_0x5b1d46['error'][_0x19ca('0x29')]===0x1f4){logger[_0x19ca('0x28')](_0x19ca('0x24'),_0x2e4e4c,_0x5b1d46['error'][_0x19ca('0x2a')]);return _0x334fc4(_0x5b1d46[_0x19ca('0x28')]['message']);}logger[_0x19ca('0x28')](_0x19ca('0x24'),_0x2e4e4c,_0x5b1d46['error']['message']);return _0x2942a4(_0x5b1d46['error'][_0x19ca('0x2a')]);}else{logger['info'](_0x19ca('0x24'),_0x2e4e4c,'request\x20sent');_0x2942a4(_0x5b1d46[_0x19ca('0x2b')]['message']);}})[_0x19ca('0x2c')](function(_0x3cfe4c){logger[_0x19ca('0x28')](_0x19ca('0x24'),_0x2e4e4c,_0x3cfe4c);_0x334fc4(_0x3cfe4c);});});}function respondWithStatusCode(_0x3df1a0,_0x21fd04){_0x21fd04=_0x21fd04||0xcc;return function(_0xfd8065){if(_0xfd8065){return _0x3df1a0[_0x19ca('0x2d')](_0x21fd04);}return _0x3df1a0[_0x19ca('0x2e')](_0x21fd04)[_0x19ca('0x2f')]();};}function respondWithResult(_0x2a3197,_0x280a30){_0x280a30=_0x280a30||0xc8;return function(_0x1414fc){if(_0x1414fc){return _0x2a3197[_0x19ca('0x2e')](_0x280a30)[_0x19ca('0x30')](_0x1414fc);}};}function respondWithFilteredResult(_0x398da7,_0x108cdd){return function(_0x31decb){if(_0x31decb){var _0x4205d3=typeof _0x108cdd[_0x19ca('0x31')]===_0x19ca('0x32')&&typeof _0x108cdd['limit']==='undefined';var _0x58d699=_0x31decb[_0x19ca('0x33')];var _0x83e400=_0x4205d3?0x0:_0x108cdd[_0x19ca('0x31')];var _0x2eebd7=_0x4205d3?_0x31decb[_0x19ca('0x33')]:_0x108cdd[_0x19ca('0x31')]+_0x108cdd[_0x19ca('0x34')];var _0x158814;if(_0x2eebd7>=_0x58d699){_0x2eebd7=_0x58d699;_0x158814=0xc8;}else{_0x158814=0xce;}_0x398da7[_0x19ca('0x2e')](_0x158814);return _0x398da7[_0x19ca('0x35')](_0x19ca('0x36'),_0x83e400+'-'+_0x2eebd7+'/'+_0x58d699)[_0x19ca('0x30')](_0x31decb);}return null;};}function patchUpdates(_0x24eba5){return function(_0x548082){try{jsonpatch[_0x19ca('0x37')](_0x548082,_0x24eba5,!![]);}catch(_0xefeda6){return BPromise[_0x19ca('0x38')](_0xefeda6);}return _0x548082['save']();};}function saveUpdates(_0x10eb6d,_0x3c1bd7){return function(_0x3f58b2){if(_0x3f58b2){return _0x3f58b2['update'](_0x10eb6d)[_0x19ca('0x39')](function(_0x182162){return _0x182162;});}return null;};}function removeEntity(_0x25f5ab,_0x4a98fd){return function(_0x4d6889){if(_0x4d6889){return _0x4d6889[_0x19ca('0x3a')]()[_0x19ca('0x39')](function(){_0x25f5ab[_0x19ca('0x2e')](0xcc)[_0x19ca('0x2f')]();});}};}function handleEntityNotFound(_0x1131b4,_0x4f5fec){return function(_0x5767af){if(!_0x5767af){_0x1131b4[_0x19ca('0x2d')](0x194);}return _0x5767af;};}function handleError(_0x4e6713,_0xc983e){_0xc983e=_0xc983e||0x1f4;return function(_0x3d4132){logger[_0x19ca('0x28')](_0x3d4132['stack']);if(_0x3d4132[_0x19ca('0x3b')]){delete _0x3d4132[_0x19ca('0x3b')];}_0x4e6713[_0x19ca('0x2e')](_0xc983e)[_0x19ca('0x3c')](_0x3d4132);};}exports[_0x19ca('0x3d')]=function(_0x17c92a,_0x2d7897){var _0x1bf32b={},_0x2f385a={},_0x4446d7={'count':0x0,'rows':[]};var _0x1d1eb5=_['map'](db[_0x19ca('0x3e')][_0x19ca('0x3f')],function(_0x30b6f5){return{'name':_0x30b6f5[_0x19ca('0x40')],'type':_0x30b6f5[_0x19ca('0x41')][_0x19ca('0x42')]};});_0x2f385a[_0x19ca('0x43')]=_['map'](_0x1d1eb5,'name');_0x2f385a[_0x19ca('0x44')]=_[_0x19ca('0x45')](_0x17c92a[_0x19ca('0x44')]);_0x2f385a[_0x19ca('0x46')]=_[_0x19ca('0x47')](_0x2f385a[_0x19ca('0x43')],_0x2f385a[_0x19ca('0x44')]);_0x1bf32b[_0x19ca('0x48')]=_[_0x19ca('0x47')](_0x2f385a[_0x19ca('0x43')],qs['fields'](_0x17c92a['query'][_0x19ca('0x49')]));_0x1bf32b['attributes']=_0x1bf32b[_0x19ca('0x48')][_0x19ca('0x4a')]?_0x1bf32b[_0x19ca('0x48')]:_0x2f385a[_0x19ca('0x43')];if(!_0x17c92a[_0x19ca('0x44')]['hasOwnProperty']('nolimit')){_0x1bf32b[_0x19ca('0x34')]=qs[_0x19ca('0x34')](_0x17c92a[_0x19ca('0x44')][_0x19ca('0x34')]);_0x1bf32b[_0x19ca('0x31')]=qs[_0x19ca('0x31')](_0x17c92a[_0x19ca('0x44')]['offset']);}_0x1bf32b[_0x19ca('0x4b')]=qs[_0x19ca('0x4c')](_0x17c92a[_0x19ca('0x44')][_0x19ca('0x4c')]);_0x1bf32b['where']=qs['filters'](_[_0x19ca('0x4d')](_0x17c92a[_0x19ca('0x44')],_0x2f385a[_0x19ca('0x46')]),_0x1d1eb5);if(_0x17c92a[_0x19ca('0x44')][_0x19ca('0x4e')]){_0x1bf32b[_0x19ca('0x4f')]=_[_0x19ca('0x50')](_0x1bf32b['where'],{'$or':_[_0x19ca('0x51')](_0x1d1eb5,function(_0x5c417d){if(_0x5c417d[_0x19ca('0x41')]!==_0x19ca('0x52')){var _0x202dbb={};_0x202dbb[_0x5c417d[_0x19ca('0x3b')]]={'$like':'%'+_0x17c92a['query'][_0x19ca('0x4e')]+'%'};return _0x202dbb;}})});}_0x1bf32b=_['merge']({},_0x1bf32b,_0x17c92a[_0x19ca('0x53')]);var _0x4e276f={'where':_0x1bf32b[_0x19ca('0x4f')]};return db['WhatsappMessage'][_0x19ca('0x33')](_0x4e276f)[_0x19ca('0x39')](function(_0x1b7c81){_0x4446d7[_0x19ca('0x33')]=_0x1b7c81;if(_0x17c92a[_0x19ca('0x44')][_0x19ca('0x54')]){_0x1bf32b[_0x19ca('0x55')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x19ca('0x56')](_0x1bf32b);})[_0x19ca('0x39')](function(_0x8189aa){_0x4446d7[_0x19ca('0x57')]=_0x8189aa;return _0x4446d7;})['then'](respondWithFilteredResult(_0x2d7897,_0x1bf32b))[_0x19ca('0x2c')](handleError(_0x2d7897,null));};exports[_0x19ca('0x58')]=function(_0x4cdfd7,_0xe72e06){var _0x482d64={'raw':!![],'where':{'id':_0x4cdfd7[_0x19ca('0x59')]['id']}},_0x378a51={};_0x378a51[_0x19ca('0x43')]=_[_0x19ca('0x45')](db['WhatsappMessage'][_0x19ca('0x3f')]);_0x378a51[_0x19ca('0x44')]=_[_0x19ca('0x45')](_0x4cdfd7[_0x19ca('0x44')]);_0x378a51[_0x19ca('0x46')]=_[_0x19ca('0x47')](_0x378a51['model'],_0x378a51[_0x19ca('0x44')]);_0x482d64['attributes']=_[_0x19ca('0x47')](_0x378a51[_0x19ca('0x43')],qs['fields'](_0x4cdfd7[_0x19ca('0x44')][_0x19ca('0x49')]));_0x482d64[_0x19ca('0x48')]=_0x482d64[_0x19ca('0x48')][_0x19ca('0x4a')]?_0x482d64[_0x19ca('0x48')]:_0x378a51[_0x19ca('0x43')];if(_0x4cdfd7[_0x19ca('0x44')][_0x19ca('0x54')]){_0x482d64[_0x19ca('0x55')]=[{'all':!![]}];}_0x482d64=_[_0x19ca('0x50')]({},_0x482d64,_0x4cdfd7[_0x19ca('0x53')]);return db[_0x19ca('0x3e')]['find'](_0x482d64)[_0x19ca('0x39')](handleEntityNotFound(_0xe72e06,null))['then'](respondWithResult(_0xe72e06,null))['catch'](handleError(_0xe72e06,null));};exports[_0x19ca('0x5a')]=function(_0x27539a,_0x25ce70){return db[_0x19ca('0x3e')][_0x19ca('0x5a')](_0x27539a[_0x19ca('0x5b')],{})[_0x19ca('0x39')](respondWithResult(_0x25ce70,0xc9))[_0x19ca('0x2c')](handleError(_0x25ce70,null));};exports[_0x19ca('0x5c')]=function(_0x2a1495,_0x5bf7dd){if(_0x2a1495[_0x19ca('0x5b')]['id']){delete _0x2a1495['body']['id'];}return db['WhatsappMessage'][_0x19ca('0x5d')]({'where':{'id':_0x2a1495['params']['id']}})[_0x19ca('0x39')](handleEntityNotFound(_0x5bf7dd,null))[_0x19ca('0x39')](saveUpdates(_0x2a1495[_0x19ca('0x5b')],null))[_0x19ca('0x39')](respondWithResult(_0x5bf7dd,null))[_0x19ca('0x2c')](handleError(_0x5bf7dd,null));};exports[_0x19ca('0x3a')]=function(_0x321cf9,_0x93f106){return db[_0x19ca('0x3e')][_0x19ca('0x5d')]({'where':{'id':_0x321cf9[_0x19ca('0x59')]['id']}})[_0x19ca('0x39')](handleEntityNotFound(_0x93f106,null))['then'](removeEntity(_0x93f106,null))['catch'](handleError(_0x93f106,null));};exports[_0x19ca('0x5e')]=function(_0x59a4c3,_0x3250bf){return db['WhatsappMessage'][_0x19ca('0x5e')]()[_0x19ca('0x39')](respondWithResult(_0x3250bf,null))[_0x19ca('0x2c')](handleError(_0x3250bf,null));};var interaction_log=require('../../config/logger')(_0x19ca('0x5f'));exports['accept']=function(_0x3eb51e,_0x33e7f5,_0x2c0566){var _0x47338a={'agent':{},'channel':'whatsapp'};if(_0x3eb51e['body']['id']){delete _0x3eb51e[_0x19ca('0x5b')]['id'];}_0x3eb51e[_0x19ca('0x5b')][_0x19ca('0x60')]=!![];_0x3eb51e[_0x19ca('0x5b')][_0x19ca('0x61')]=moment()['format'](_0x19ca('0x62'));_0x3eb51e['body'][_0x19ca('0x63')]=_0x3eb51e[_0x19ca('0x5b')][_0x19ca('0x63')]||_0x3eb51e[_0x19ca('0x64')]['id'];_0x47338a[_0x19ca('0x65')]['id']=_0x3eb51e[_0x19ca('0x5b')][_0x19ca('0x63')];return db['WhatsappMessage'][_0x19ca('0x5d')]({'where':{'id':_0x3eb51e[_0x19ca('0x59')]['id'],'UserId':null}})[_0x19ca('0x39')](handleEntityNotFound(_0x33e7f5,null))[_0x19ca('0x39')](saveUpdates(_0x3eb51e[_0x19ca('0x5b')],null))[_0x19ca('0x39')](function(_0x37c88d){if(_0x37c88d){_0x47338a['message']=_0x37c88d['get']({'plain':!![]});return db[_0x19ca('0x66')][_0x19ca('0x5d')]({'where':{'id':_0x37c88d[_0x19ca('0x67')]}});}return null;})[_0x19ca('0x39')](handleEntityNotFound(_0x33e7f5,null))['then'](function(_0x356786){if(_0x356786){return _0x356786[_0x19ca('0x5c')]({'UserId':_0x3eb51e[_0x19ca('0x5b')][_0x19ca('0x63')],'read1stAt':_[_0x19ca('0x68')](_0x356786['read1stAt'])?moment()[_0x19ca('0x69')](_0x19ca('0x62')):undefined});}return null;})[_0x19ca('0x39')](function(_0x29fd77){if(_0x29fd77){_0x47338a['interaction']=_0x29fd77[_0x19ca('0x6a')]({'plain':!![]});interaction_log[_0x19ca('0x23')](_0x19ca('0x6b'),_0x3eb51e['user']['id'],_0x3eb51e['user'][_0x19ca('0x3b')],_0x3eb51e[_0x19ca('0x64')][_0x19ca('0x6c')],_0x47338a[_0x19ca('0x6d')]['id'],_0x3eb51e[_0x19ca('0x5b')]?JSON[_0x19ca('0x27')](_0x3eb51e[_0x19ca('0x5b')]):_0x19ca('0x6e'));return respondWithRpcPromise(_0x19ca('0x6f'),_0x19ca('0x70'),_0x47338a);}return null;})[_0x19ca('0x39')](function(_0x58a532){var _0x24624a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x58a532[_0x19ca('0x2a')][_0x19ca('0x71')];return db[_0x19ca('0x72')][_0x19ca('0x44')](_0x24624a,{'type':db[_0x19ca('0x73')][_0x19ca('0x74')][_0x19ca('0x75')],'raw':!![]})[_0x19ca('0x39')](function(_0x165ff1){return _0x165ff1;});})[_0x19ca('0x39')](function(_0x51cc92){if(_0x51cc92){_0x47338a[_0x19ca('0x2a')]['contact']=_0x51cc92[0x0];if(!_0x3eb51e['body'][_0x19ca('0x63')])return;return db[_0x19ca('0x76')][_0x19ca('0x5d')]({'where':{'id':_0x3eb51e[_0x19ca('0x5b')]['UserId'],'role':_0x19ca('0x65')},'attributes':['id','name',_0x19ca('0x77'),_0x19ca('0x78'),_0x19ca('0x79')],'raw':!![]});}return null;})['then'](function(_0x1b0a55){if(!_0x1b0a55)return null;_0x47338a[_0x19ca('0x2a')][_0x19ca('0x65')]=_0x1b0a55;return _0x47338a;})[_0x19ca('0x39')](function(_0x403d17){if(_0x403d17){if(_0x3eb51e['body'][_0x19ca('0x7a')]){_0x47338a['message'][_0x19ca('0x7b')]=util['format'](_0x19ca('0x7c'),_0x3eb51e[_0x19ca('0x64')][_0x19ca('0x3b')]);_0x47338a[_0x19ca('0x2a')][_0x19ca('0x7d')]=_0x47338a[_0x19ca('0x7d')];_0x47338a[_0x19ca('0x2a')]['event']=_0x19ca('0x7e');return respondWithRpcPromise(_0x19ca('0x7f'),_0x19ca('0x7f'),{'event':'acceptmessage','message':_0x47338a[_0x19ca('0x2a')]},client9002)[_0x19ca('0x39')](function(){return _0x47338a;});}return _0x47338a;}return null;})[_0x19ca('0x39')](respondWithResult(_0x33e7f5,null))[_0x19ca('0x2c')](handleError(_0x33e7f5,null));};var interaction_log=require(_0x19ca('0x17'))(_0x19ca('0x5f'));exports[_0x19ca('0x38')]=function(_0xf8f1ca,_0x6899a5,_0x55a26f){var _0x299fd9={'agent':{},'channel':_0x19ca('0x80')};if(_0xf8f1ca[_0x19ca('0x5b')]['id']){delete _0xf8f1ca['body']['id'];}_0xf8f1ca[_0x19ca('0x5b')]['UserId']=_0xf8f1ca['body']['UserId']||_0xf8f1ca[_0x19ca('0x64')]['id'];_0x299fd9[_0x19ca('0x65')]['id']=_0xf8f1ca[_0x19ca('0x5b')]['UserId'];return db[_0x19ca('0x3e')][_0x19ca('0x5d')]({'where':{'id':_0xf8f1ca[_0x19ca('0x59')]['id'],'UserId':null}})[_0x19ca('0x39')](handleEntityNotFound(_0x6899a5,null))[_0x19ca('0x39')](function(_0x1b87d6){if(_0x1b87d6){_0x299fd9[_0x19ca('0x2a')]=_0x1b87d6['get']({'plain':!![]});return db['WhatsappInteraction'][_0x19ca('0x5d')]({'where':{'id':_0x1b87d6[_0x19ca('0x67')]}});}return null;})[_0x19ca('0x39')](handleEntityNotFound(_0x6899a5,null))[_0x19ca('0x39')](function(_0x20c637){if(_0x20c637){_0x299fd9[_0x19ca('0x6d')]=_0x20c637[_0x19ca('0x6a')]({'plain':!![]});interaction_log[_0x19ca('0x23')](_0x19ca('0x81'),_0xf8f1ca['user']['id'],_0xf8f1ca[_0x19ca('0x64')][_0x19ca('0x3b')],_0xf8f1ca['user'][_0x19ca('0x6c')],_0x299fd9[_0x19ca('0x6d')]['id'],_0xf8f1ca[_0x19ca('0x5b')]?JSON[_0x19ca('0x27')](_0xf8f1ca[_0x19ca('0x5b')]):_0x19ca('0x6e'));return respondWithRpcPromise(_0x19ca('0x82'),_0x19ca('0x83'),_0x299fd9);}return null;})[_0x19ca('0x39')](function(_0x79356a){var _0x6d2cc=_0x19ca('0x84')+_0x79356a[_0x19ca('0x2a')][_0x19ca('0x71')];return db['sequelize']['query'](_0x6d2cc,{'type':db[_0x19ca('0x73')]['QueryTypes'][_0x19ca('0x75')],'raw':!![]})[_0x19ca('0x39')](function(_0xf32c3a){return _0xf32c3a;});})['then'](function(_0x15a258){if(_0x15a258){_0x299fd9[_0x19ca('0x2a')][_0x19ca('0x85')]=_0x15a258[0x0];if(!_0xf8f1ca['body'][_0x19ca('0x63')])return;return db[_0x19ca('0x76')][_0x19ca('0x5d')]({'where':{'id':_0xf8f1ca[_0x19ca('0x5b')][_0x19ca('0x63')],'role':_0x19ca('0x65')},'attributes':['id','name',_0x19ca('0x77'),'email',_0x19ca('0x79')],'raw':!![]});}return null;})[_0x19ca('0x39')](function(_0x4458b9){if(!_0x4458b9)return null;_0x299fd9['message'][_0x19ca('0x65')]=_0x4458b9;return _0x299fd9;})[_0x19ca('0x39')](function(_0x853e65){if(_0x853e65){_0x853e65[_0x19ca('0x2a')][_0x19ca('0x7b')]=util[_0x19ca('0x69')](_0x19ca('0x7c'),_0xf8f1ca[_0x19ca('0x64')][_0x19ca('0x3b')]);_0x853e65[_0x19ca('0x2a')][_0x19ca('0x7d')]=_0x299fd9['channel'];_0x853e65['message']['event']=_0x19ca('0x38');respondWithRpcPromise(_0x19ca('0x7f'),'EventManager',{'event':'rejectmessage','message':_0x853e65['message']},client9002);return _0x299fd9;}return null;})[_0x19ca('0x39')](respondWithResult(_0x6899a5,null))[_0x19ca('0x2c')](handleError(_0x6899a5,null));};exports[_0x19ca('0x2e')]=function(_0x55b7b4,_0x18f285,_0x1e737c){if(_0x55b7b4[_0x19ca('0x5b')]['id']){delete _0x55b7b4[_0x19ca('0x5b')]['id'];}var _0x4b1186;return db['WhatsappMessage']['find']({'where':{'id':_0x55b7b4[_0x19ca('0x59')]['id']}})['then'](handleEntityNotFound(_0x18f285,null))[_0x19ca('0x39')](function(_0x2a4241){if(_0x2a4241){_0x4b1186=_0x2a4241;return db['WhatsappAccount'][_0x19ca('0x5d')]({'where':{'id':_0x2a4241[_0x19ca('0x86')]}});}})[_0x19ca('0x39')](handleEntityNotFound(_0x18f285,null))[_0x19ca('0x39')](function(_0x4683d2){if(_0x4683d2){logger[_0x19ca('0x87')](_0x19ca('0x88'),_0x19ca('0x2e'),'received\x20delivery\x20report\x20from',_0x4683d2[_0x19ca('0x41')],util[_0x19ca('0x89')](_0x55b7b4[_0x19ca('0x5b')],{'showHidden':![],'depth':null}));switch(_0x4683d2[_0x19ca('0x41')]){case _0x19ca('0x8a'):if(_0x55b7b4['body'][_0x19ca('0x8b')]&&_0x55b7b4[_0x19ca('0x5b')]['MessageSid']===_0x4b1186[_0x19ca('0x8c')]&&_0x55b7b4[_0x19ca('0x5b')][_0x19ca('0x8d')]&&_0x55b7b4[_0x19ca('0x5b')]['MessageStatus']===_0x19ca('0x60')){return _0x4b1186[_0x19ca('0x5c')]({'read':!![]});}else{logger[_0x19ca('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x19ca('0x2e'),_0x19ca('0x8a'),util[_0x19ca('0x89')](_0x55b7b4[_0x19ca('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x4b1186;}})[_0x19ca('0x39')](respondWithResult(_0x18f285,null))[_0x19ca('0x2c')](handleError(_0x18f285,null));};
\ No newline at end of file
+var _0xa7ee=['key','map','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','options','create','body','describe','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','find','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','format','SIP/%s','channel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','contact','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','messageId','MessageStatus','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','debug','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type'];(function(_0x4604ad,_0x2c516e){var _0x3ed8ef=function(_0x2cb13e){while(--_0x2cb13e){_0x4604ad['push'](_0x4604ad['shift']());}};_0x3ed8ef(++_0x2c516e);}(_0xa7ee,0x159));var _0xea7e=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0xa7ee[_0x16539a];return _0x200796;};'use strict';var emlformat=require(_0xea7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea7e('0x1'));var jsonpatch=require(_0xea7e('0x2'));var rp=require(_0xea7e('0x3'));var moment=require(_0xea7e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea7e('0x5'));var path=require('path');var sox=require(_0xea7e('0x6'));var csv=require(_0xea7e('0x7'));var ejs=require(_0xea7e('0x8'));var fs=require('fs');var fs_extra=require(_0xea7e('0x9'));var _=require('lodash');var squel=require(_0xea7e('0xa'));var crypto=require(_0xea7e('0xb'));var jsforce=require(_0xea7e('0xc'));var deskjs=require(_0xea7e('0xd'));var toCsv=require(_0xea7e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xea7e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xea7e('0xf'));var as=require(_0xea7e('0x10'));var hardwareService=require(_0xea7e('0x11'));var logger=require(_0xea7e('0x12'))('api');var utils=require(_0xea7e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xea7e('0x14'));var db=require(_0xea7e('0x15'))['db'];config[_0xea7e('0x16')]=_[_0xea7e('0x17')](config[_0xea7e('0x16')],{'host':_0xea7e('0x18'),'port':0x18eb});var socket=require(_0xea7e('0x19'))(new Redis(config[_0xea7e('0x16')]));require('./whatsappMessage.socket')[_0xea7e('0x1a')](socket);var jayson=require(_0xea7e('0x1b'));var client=jayson[_0xea7e('0x1c')][_0xea7e('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xea7e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4d3796,_0x5c7466,_0x3cd795,_0x2d5794){return new BPromise(function(_0x162c47,_0x519959){var _0x5c3b15=_0x2d5794||client;return _0x5c3b15[_0xea7e('0x1e')](_0x4d3796,_0x3cd795)['then'](function(_0x195d5a){logger[_0xea7e('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x5c7466,'request\x20sent');logger[_0xea7e('0x20')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5c7466,'request\x20sent',JSON[_0xea7e('0x21')](_0x195d5a));if(_0x195d5a['error']){if(_0x195d5a[_0xea7e('0x22')][_0xea7e('0x23')]===0x1f4){logger['error'](_0xea7e('0x24'),_0x5c7466,_0x195d5a['error'][_0xea7e('0x25')]);return _0x519959(_0x195d5a[_0xea7e('0x22')][_0xea7e('0x25')]);}logger[_0xea7e('0x22')](_0xea7e('0x24'),_0x5c7466,_0x195d5a[_0xea7e('0x22')]['message']);return _0x162c47(_0x195d5a[_0xea7e('0x22')][_0xea7e('0x25')]);}else{logger['info'](_0xea7e('0x24'),_0x5c7466,_0xea7e('0x26'));_0x162c47(_0x195d5a[_0xea7e('0x27')]['message']);}})[_0xea7e('0x28')](function(_0x400125){logger[_0xea7e('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x5c7466,_0x400125);_0x519959(_0x400125);});});}function respondWithStatusCode(_0x456222,_0x2a6623){_0x2a6623=_0x2a6623||0xcc;return function(_0x41d40c){if(_0x41d40c){return _0x456222[_0xea7e('0x29')](_0x2a6623);}return _0x456222[_0xea7e('0x2a')](_0x2a6623)[_0xea7e('0x2b')]();};}function respondWithResult(_0x31871e,_0x25b5a4){_0x25b5a4=_0x25b5a4||0xc8;return function(_0x1067cd){if(_0x1067cd){return _0x31871e[_0xea7e('0x2a')](_0x25b5a4)['json'](_0x1067cd);}};}function respondWithFilteredResult(_0x1744f3,_0xd856de){return function(_0x4d3c38){if(_0x4d3c38){var _0x2a1753=typeof _0xd856de[_0xea7e('0x2c')]===_0xea7e('0x2d')&&typeof _0xd856de[_0xea7e('0x2e')]===_0xea7e('0x2d');var _0x56ea98=_0x4d3c38[_0xea7e('0x2f')];var _0xd89897=_0x2a1753?0x0:_0xd856de['offset'];var _0x4cfa72=_0x2a1753?_0x4d3c38[_0xea7e('0x2f')]:_0xd856de['offset']+_0xd856de[_0xea7e('0x2e')];var _0x5c12d6;if(_0x4cfa72>=_0x56ea98){_0x4cfa72=_0x56ea98;_0x5c12d6=0xc8;}else{_0x5c12d6=0xce;}_0x1744f3[_0xea7e('0x2a')](_0x5c12d6);return _0x1744f3[_0xea7e('0x30')](_0xea7e('0x31'),_0xd89897+'-'+_0x4cfa72+'/'+_0x56ea98)[_0xea7e('0x32')](_0x4d3c38);}return null;};}function patchUpdates(_0xe60da3){return function(_0x352b07){try{jsonpatch['apply'](_0x352b07,_0xe60da3,!![]);}catch(_0x2a2272){return BPromise[_0xea7e('0x33')](_0x2a2272);}return _0x352b07[_0xea7e('0x34')]();};}function saveUpdates(_0x42922a,_0x419475){return function(_0x400c05){if(_0x400c05){return _0x400c05['update'](_0x42922a)['then'](function(_0xb53ef9){return _0xb53ef9;});}return null;};}function removeEntity(_0x2b3744,_0x1260e7){return function(_0x5e8f90){if(_0x5e8f90){return _0x5e8f90[_0xea7e('0x35')]()[_0xea7e('0x36')](function(){_0x2b3744[_0xea7e('0x2a')](0xcc)[_0xea7e('0x2b')]();});}};}function handleEntityNotFound(_0x2ab95b,_0x21ca5f){return function(_0x2291f2){if(!_0x2291f2){_0x2ab95b[_0xea7e('0x29')](0x194);}return _0x2291f2;};}function handleError(_0x3dd55b,_0x1c4d76){_0x1c4d76=_0x1c4d76||0x1f4;return function(_0x334324){logger[_0xea7e('0x22')](_0x334324[_0xea7e('0x37')]);if(_0x334324[_0xea7e('0x38')]){delete _0x334324[_0xea7e('0x38')];}_0x3dd55b['status'](_0x1c4d76)[_0xea7e('0x39')](_0x334324);};}exports[_0xea7e('0x3a')]=function(_0x3f3b2f,_0xfc3106){var _0x5cc121={},_0x165024={},_0x4ce7d3={'count':0x0,'rows':[]};var _0x226fa2=_['map'](db[_0xea7e('0x3b')][_0xea7e('0x3c')],function(_0x468606){return{'name':_0x468606[_0xea7e('0x3d')],'type':_0x468606[_0xea7e('0x3e')][_0xea7e('0x3f')]};});_0x165024['model']=_[_0xea7e('0x40')](_0x226fa2,_0xea7e('0x38'));_0x165024['query']=_[_0xea7e('0x41')](_0x3f3b2f['query']);_0x165024[_0xea7e('0x42')]=_[_0xea7e('0x43')](_0x165024['model'],_0x165024[_0xea7e('0x44')]);_0x5cc121[_0xea7e('0x45')]=_[_0xea7e('0x43')](_0x165024[_0xea7e('0x46')],qs[_0xea7e('0x47')](_0x3f3b2f[_0xea7e('0x44')][_0xea7e('0x47')]));_0x5cc121[_0xea7e('0x45')]=_0x5cc121[_0xea7e('0x45')][_0xea7e('0x48')]?_0x5cc121[_0xea7e('0x45')]:_0x165024[_0xea7e('0x46')];if(!_0x3f3b2f[_0xea7e('0x44')][_0xea7e('0x49')]('nolimit')){_0x5cc121['limit']=qs['limit'](_0x3f3b2f['query']['limit']);_0x5cc121['offset']=qs[_0xea7e('0x2c')](_0x3f3b2f['query'][_0xea7e('0x2c')]);}_0x5cc121[_0xea7e('0x4a')]=qs['sort'](_0x3f3b2f['query'][_0xea7e('0x4b')]);_0x5cc121[_0xea7e('0x4c')]=qs[_0xea7e('0x42')](_[_0xea7e('0x4d')](_0x3f3b2f['query'],_0x165024['filters']),_0x226fa2);if(_0x3f3b2f[_0xea7e('0x44')]['filter']){_0x5cc121[_0xea7e('0x4c')]=_[_0xea7e('0x4e')](_0x5cc121['where'],{'$or':_[_0xea7e('0x40')](_0x226fa2,function(_0x26a4f5){if(_0x26a4f5['type']!==_0xea7e('0x4f')){var _0x2d3034={};_0x2d3034[_0x26a4f5['name']]={'$like':'%'+_0x3f3b2f['query'][_0xea7e('0x50')]+'%'};return _0x2d3034;}})});}_0x5cc121=_[_0xea7e('0x4e')]({},_0x5cc121,_0x3f3b2f['options']);var _0x3fbaef={'where':_0x5cc121[_0xea7e('0x4c')]};return db['WhatsappMessage'][_0xea7e('0x2f')](_0x3fbaef)[_0xea7e('0x36')](function(_0x42446c){_0x4ce7d3[_0xea7e('0x2f')]=_0x42446c;if(_0x3f3b2f[_0xea7e('0x44')][_0xea7e('0x51')]){_0x5cc121[_0xea7e('0x52')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xea7e('0x53')](_0x5cc121);})[_0xea7e('0x36')](function(_0xe137bf){_0x4ce7d3[_0xea7e('0x54')]=_0xe137bf;return _0x4ce7d3;})[_0xea7e('0x36')](respondWithFilteredResult(_0xfc3106,_0x5cc121))[_0xea7e('0x28')](handleError(_0xfc3106,null));};exports['show']=function(_0x4404e5,_0x1ba27f){var _0x273392={'raw':!![],'where':{'id':_0x4404e5[_0xea7e('0x55')]['id']}},_0x3347c7={};_0x3347c7[_0xea7e('0x46')]=_['keys'](db[_0xea7e('0x3b')][_0xea7e('0x3c')]);_0x3347c7[_0xea7e('0x44')]=_['keys'](_0x4404e5[_0xea7e('0x44')]);_0x3347c7[_0xea7e('0x42')]=_['intersection'](_0x3347c7[_0xea7e('0x46')],_0x3347c7[_0xea7e('0x44')]);_0x273392[_0xea7e('0x45')]=_[_0xea7e('0x43')](_0x3347c7[_0xea7e('0x46')],qs[_0xea7e('0x47')](_0x4404e5[_0xea7e('0x44')][_0xea7e('0x47')]));_0x273392[_0xea7e('0x45')]=_0x273392['attributes']['length']?_0x273392[_0xea7e('0x45')]:_0x3347c7[_0xea7e('0x46')];if(_0x4404e5['query'][_0xea7e('0x51')]){_0x273392['include']=[{'all':!![]}];}_0x273392=_[_0xea7e('0x4e')]({},_0x273392,_0x4404e5[_0xea7e('0x56')]);return db[_0xea7e('0x3b')]['find'](_0x273392)[_0xea7e('0x36')](handleEntityNotFound(_0x1ba27f,null))[_0xea7e('0x36')](respondWithResult(_0x1ba27f,null))[_0xea7e('0x28')](handleError(_0x1ba27f,null));};exports[_0xea7e('0x57')]=function(_0x9aa251,_0x4fa681){return db['WhatsappMessage'][_0xea7e('0x57')](_0x9aa251[_0xea7e('0x58')],{})[_0xea7e('0x36')](respondWithResult(_0x4fa681,0xc9))[_0xea7e('0x28')](handleError(_0x4fa681,null));};exports['update']=function(_0x2fde0c,_0x28529b){if(_0x2fde0c[_0xea7e('0x58')]['id']){delete _0x2fde0c[_0xea7e('0x58')]['id'];}return db[_0xea7e('0x3b')]['find']({'where':{'id':_0x2fde0c['params']['id']}})[_0xea7e('0x36')](handleEntityNotFound(_0x28529b,null))[_0xea7e('0x36')](saveUpdates(_0x2fde0c['body'],null))[_0xea7e('0x36')](respondWithResult(_0x28529b,null))[_0xea7e('0x28')](handleError(_0x28529b,null));};exports[_0xea7e('0x35')]=function(_0x107727,_0x2c6008){return db['WhatsappMessage']['find']({'where':{'id':_0x107727[_0xea7e('0x55')]['id']}})[_0xea7e('0x36')](handleEntityNotFound(_0x2c6008,null))[_0xea7e('0x36')](removeEntity(_0x2c6008,null))[_0xea7e('0x28')](handleError(_0x2c6008,null));};exports[_0xea7e('0x59')]=function(_0x2a76ad,_0x337ee7){return db['WhatsappMessage']['describe']()['then'](respondWithResult(_0x337ee7,null))[_0xea7e('0x28')](handleError(_0x337ee7,null));};var interaction_log=require(_0xea7e('0x12'))('whatsapp-interactions');exports[_0xea7e('0x5a')]=function(_0x4bf6c6,_0x590577,_0x3a8514){var _0x7b0c67={'agent':{},'channel':'whatsapp'};if(_0x4bf6c6[_0xea7e('0x58')]['id']){delete _0x4bf6c6[_0xea7e('0x58')]['id'];}_0x4bf6c6[_0xea7e('0x58')][_0xea7e('0x5b')]=!![];_0x4bf6c6[_0xea7e('0x58')]['readAt']=moment()['format'](_0xea7e('0x5c'));_0x4bf6c6[_0xea7e('0x58')][_0xea7e('0x5d')]=_0x4bf6c6['body'][_0xea7e('0x5d')]||_0x4bf6c6[_0xea7e('0x5e')]['id'];_0x7b0c67[_0xea7e('0x5f')]['id']=_0x4bf6c6[_0xea7e('0x58')][_0xea7e('0x5d')];return db['WhatsappMessage']['find']({'where':{'id':_0x4bf6c6[_0xea7e('0x55')]['id'],'UserId':null}})[_0xea7e('0x36')](handleEntityNotFound(_0x590577,null))['then'](saveUpdates(_0x4bf6c6[_0xea7e('0x58')],null))[_0xea7e('0x36')](function(_0x5e0797){if(_0x5e0797){_0x7b0c67[_0xea7e('0x25')]=_0x5e0797[_0xea7e('0x60')]({'plain':!![]});return db[_0xea7e('0x61')][_0xea7e('0x62')]({'where':{'id':_0x5e0797[_0xea7e('0x63')]}});}return null;})[_0xea7e('0x36')](handleEntityNotFound(_0x590577,null))['then'](function(_0x2cdc7b){if(_0x2cdc7b){return _0x2cdc7b['update']({'UserId':_0x4bf6c6[_0xea7e('0x58')][_0xea7e('0x5d')],'read1stAt':_[_0xea7e('0x64')](_0x2cdc7b[_0xea7e('0x65')])?moment()['format'](_0xea7e('0x5c')):undefined});}return null;})['then'](function(_0x460f8e){if(_0x460f8e){_0x7b0c67[_0xea7e('0x66')]=_0x460f8e['get']({'plain':!![]});interaction_log[_0xea7e('0x1f')](_0xea7e('0x67'),_0x4bf6c6[_0xea7e('0x5e')]['id'],_0x4bf6c6['user'][_0xea7e('0x38')],_0x4bf6c6['user']['role'],_0x7b0c67['interaction']['id'],_0x4bf6c6[_0xea7e('0x58')]?JSON['stringify'](_0x4bf6c6['body']):_0xea7e('0x68'));return respondWithRpcPromise(_0xea7e('0x69'),_0xea7e('0x6a'),_0x7b0c67);}return null;})[_0xea7e('0x36')](function(_0x364d14){var _0x585332=_0xea7e('0x6b')+_0x364d14['message']['ContactId'];return db[_0xea7e('0x6c')][_0xea7e('0x44')](_0x585332,{'type':db['Sequelize'][_0xea7e('0x6d')][_0xea7e('0x6e')],'raw':!![]})['then'](function(_0x5b4dfa){return _0x5b4dfa;});})['then'](function(_0x4fbaae){if(_0x4fbaae){_0x7b0c67[_0xea7e('0x25')]['contact']=_0x4fbaae[0x0];if(!_0x4bf6c6[_0xea7e('0x58')][_0xea7e('0x5d')])return;return db[_0xea7e('0x6f')]['find']({'where':{'id':_0x4bf6c6['body'][_0xea7e('0x5d')],'role':_0xea7e('0x5f')},'attributes':['id','name',_0xea7e('0x70'),_0xea7e('0x71'),_0xea7e('0x72')],'raw':!![]});}return null;})[_0xea7e('0x36')](function(_0x1314d0){if(!_0x1314d0)return null;_0x7b0c67[_0xea7e('0x25')][_0xea7e('0x5f')]=_0x1314d0;return _0x7b0c67;})[_0xea7e('0x36')](function(_0x38211e){if(_0x38211e){if(_0x4bf6c6[_0xea7e('0x58')][_0xea7e('0x73')]){_0x7b0c67['message'][_0xea7e('0x74')]=util[_0xea7e('0x75')](_0xea7e('0x76'),_0x4bf6c6['user'][_0xea7e('0x38')]);_0x7b0c67[_0xea7e('0x25')][_0xea7e('0x77')]=_0x7b0c67[_0xea7e('0x77')];_0x7b0c67[_0xea7e('0x25')][_0xea7e('0x78')]=_0xea7e('0x5a');return respondWithRpcPromise(_0xea7e('0x79'),_0xea7e('0x79'),{'event':'acceptmessage','message':_0x7b0c67[_0xea7e('0x25')]},client9002)['then'](function(){return _0x7b0c67;});}return _0x7b0c67;}return null;})[_0xea7e('0x36')](respondWithResult(_0x590577,null))[_0xea7e('0x28')](handleError(_0x590577,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xea7e('0x33')]=function(_0x47afc2,_0x5778a8,_0x170b17){var _0x49e982={'agent':{},'channel':'whatsapp'};if(_0x47afc2[_0xea7e('0x58')]['id']){delete _0x47afc2[_0xea7e('0x58')]['id'];}_0x47afc2[_0xea7e('0x58')][_0xea7e('0x5d')]=_0x47afc2[_0xea7e('0x58')][_0xea7e('0x5d')]||_0x47afc2[_0xea7e('0x5e')]['id'];_0x49e982[_0xea7e('0x5f')]['id']=_0x47afc2[_0xea7e('0x58')]['UserId'];return db['WhatsappMessage'][_0xea7e('0x62')]({'where':{'id':_0x47afc2[_0xea7e('0x55')]['id'],'UserId':null}})[_0xea7e('0x36')](handleEntityNotFound(_0x5778a8,null))[_0xea7e('0x36')](function(_0x397cdd){if(_0x397cdd){_0x49e982[_0xea7e('0x25')]=_0x397cdd[_0xea7e('0x60')]({'plain':!![]});return db[_0xea7e('0x61')][_0xea7e('0x62')]({'where':{'id':_0x397cdd[_0xea7e('0x63')]}});}return null;})[_0xea7e('0x36')](handleEntityNotFound(_0x5778a8,null))['then'](function(_0x44fa3d){if(_0x44fa3d){_0x49e982[_0xea7e('0x66')]=_0x44fa3d[_0xea7e('0x60')]({'plain':!![]});interaction_log[_0xea7e('0x1f')](_0xea7e('0x7a'),_0x47afc2[_0xea7e('0x5e')]['id'],_0x47afc2[_0xea7e('0x5e')][_0xea7e('0x38')],_0x47afc2[_0xea7e('0x5e')]['role'],_0x49e982[_0xea7e('0x66')]['id'],_0x47afc2[_0xea7e('0x58')]?JSON[_0xea7e('0x21')](_0x47afc2[_0xea7e('0x58')]):_0xea7e('0x68'));return respondWithRpcPromise(_0xea7e('0x7b'),_0xea7e('0x7c'),_0x49e982);}return null;})[_0xea7e('0x36')](function(_0x366f88){var _0x4a56e5=_0xea7e('0x6b')+_0x366f88[_0xea7e('0x25')]['ContactId'];return db[_0xea7e('0x6c')]['query'](_0x4a56e5,{'type':db[_0xea7e('0x7d')]['QueryTypes'][_0xea7e('0x6e')],'raw':!![]})[_0xea7e('0x36')](function(_0x297238){return _0x297238;});})[_0xea7e('0x36')](function(_0x51dcc5){if(_0x51dcc5){_0x49e982['message'][_0xea7e('0x7e')]=_0x51dcc5[0x0];if(!_0x47afc2[_0xea7e('0x58')]['UserId'])return;return db[_0xea7e('0x6f')]['find']({'where':{'id':_0x47afc2[_0xea7e('0x58')][_0xea7e('0x5d')],'role':'agent'},'attributes':['id',_0xea7e('0x38'),_0xea7e('0x70'),_0xea7e('0x71'),_0xea7e('0x72')],'raw':!![]});}return null;})['then'](function(_0x139e0c){if(!_0x139e0c)return null;_0x49e982[_0xea7e('0x25')][_0xea7e('0x5f')]=_0x139e0c;return _0x49e982;})['then'](function(_0x42ebee){if(_0x42ebee){_0x42ebee[_0xea7e('0x25')]['interface']=util['format'](_0xea7e('0x76'),_0x47afc2[_0xea7e('0x5e')]['name']);_0x42ebee['message']['channel']=_0x49e982[_0xea7e('0x77')];_0x42ebee[_0xea7e('0x25')][_0xea7e('0x78')]='reject';respondWithRpcPromise(_0xea7e('0x79'),_0xea7e('0x79'),{'event':_0xea7e('0x7f'),'message':_0x42ebee['message']},client9002);return _0x49e982;}return null;})['then'](respondWithResult(_0x5778a8,null))[_0xea7e('0x28')](handleError(_0x5778a8,null));};exports[_0xea7e('0x2a')]=function(_0x1325e9,_0x498d2c,_0x22080a){if(_0x1325e9[_0xea7e('0x58')]['id']){delete _0x1325e9[_0xea7e('0x58')]['id'];}var _0x1ef693;return db[_0xea7e('0x3b')][_0xea7e('0x62')]({'where':{'id':_0x1325e9[_0xea7e('0x55')]['id']}})[_0xea7e('0x36')](handleEntityNotFound(_0x498d2c,null))[_0xea7e('0x36')](function(_0x4a0b28){if(_0x4a0b28){_0x1ef693=_0x4a0b28;return db[_0xea7e('0x80')]['find']({'where':{'id':_0x4a0b28[_0xea7e('0x81')]}});}})[_0xea7e('0x36')](handleEntityNotFound(_0x498d2c,null))[_0xea7e('0x36')](function(_0xb3ec6a){if(_0xb3ec6a){logger['debug'](_0xea7e('0x82'),_0xea7e('0x2a'),'received\x20delivery\x20report\x20from',_0xb3ec6a[_0xea7e('0x3e')],util[_0xea7e('0x83')](_0x1325e9[_0xea7e('0x58')],{'showHidden':![],'depth':null}));switch(_0xb3ec6a['type']){case'twilio':if(_0x1325e9[_0xea7e('0x58')][_0xea7e('0x84')]&&_0x1325e9[_0xea7e('0x58')][_0xea7e('0x84')]===_0x1ef693[_0xea7e('0x85')]&&_0x1325e9['body'][_0xea7e('0x86')]&&_0x1325e9[_0xea7e('0x58')]['MessageStatus']==='read'){return _0x1ef693[_0xea7e('0x87')]({'read':!![]});}else{logger[_0xea7e('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xea7e('0x2a'),'twilio',util[_0xea7e('0x83')](_0x1325e9[_0xea7e('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x1ef693;}})[_0xea7e('0x36')](respondWithResult(_0x498d2c,null))[_0xea7e('0x28')](handleError(_0x498d2c,null));};
\ No newline at end of file
index 8980e46..20fd266 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd52d=['WhatsappMessage','save','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xd52d,0x1c7));var _0xdd52=function(_0x343bee,_0x254c32){_0x343bee=_0x343bee-0x0;var _0x36c70e=_0xd52d[_0x343bee];return _0x36c70e;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xdd52('0x0'))['db'][_0xdd52('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdd52('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1dfed5){return function(_0x211062,_0x30fb04,_0x29a95e){WhatsappMessageEvents[_0xdd52('0x3')](_0x1dfed5+':'+_0x211062['id'],_0x211062);WhatsappMessageEvents[_0xdd52('0x3')](_0x1dfed5,_0x211062);_0x29a95e(null);};}for(var e in events){if(events[_0xdd52('0x4')](e)){var event=events[e];WhatsappMessage[_0xdd52('0x5')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0x2547=['hasOwnProperty','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x2547,0x1cd));var _0x7254=function(_0x9e3b7f,_0x272d11){_0x9e3b7f=_0x9e3b7f-0x0;var _0x4fd9e4=_0x2547[_0x9e3b7f];return _0x4fd9e4;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x7254('0x0'))['db'][_0x7254('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7254('0x2')](0x0);var events={'afterCreate':_0x7254('0x3'),'afterUpdate':_0x7254('0x4'),'afterDestroy':_0x7254('0x5')};function emitEvent(_0x9f3435){return function(_0x265ebf,_0x53a02f,_0x2ddeae){WhatsappMessageEvents[_0x7254('0x6')](_0x9f3435+':'+_0x265ebf['id'],_0x265ebf);WhatsappMessageEvents[_0x7254('0x6')](_0x9f3435,_0x265ebf);_0x2ddeae(null);};}for(var e in events){if(events[_0x7254('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x7254('0x8')]=WhatsappMessageEvents;
\ No newline at end of file
index be8e077..80c94e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46be=['Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','whatsapp:','remote','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate'];(function(_0x13a889,_0x1b2eaa){var _0x211088=function(_0x2e90e5){while(--_0x2e90e5){_0x13a889['push'](_0x13a889['shift']());}};_0x211088(++_0x1b2eaa);}(_0x46be,0x193));var _0xe46b=function(_0x3ace1b,_0x208eb8){_0x3ace1b=_0x3ace1b-0x0;var _0x2c33a0=_0x46be[_0x3ace1b];return _0x2c33a0;};'use strict';var _=require(_0xe46b('0x0'));var util=require(_0xe46b('0x1'));var logger=require(_0xe46b('0x2'))(_0xe46b('0x3'));var moment=require(_0xe46b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe46b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe46b('0x6'));module[_0xe46b('0x7')]=function(_0x57e1e7,_0x2c8fff){return _0x57e1e7[_0xe46b('0x8')](_0xe46b('0x9'),attributes,{'tableName':_0xe46b('0xa'),'paranoid':![],'indexes':[{'name':_0xe46b('0xb'),'fields':['messageId']},{'name':_0xe46b('0xc'),'fields':[_0xe46b('0xd')],'type':_0xe46b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d87b0,_0x4909c6,_0x240b40){var _0x285704=_0x57e1e7[_0xe46b('0xf')];var _0x34a1fe=_0x1d87b0[_0xe46b('0x10')]({'plain':!![]});if(_0x34a1fe['direction'][_0xe46b('0x11')]()==='in'||_0x34a1fe[_0xe46b('0x12')][_0xe46b('0x11')]()===_0xe46b('0x13')&&!_0x34a1fe[_0xe46b('0x14')]&&!_[_0xe46b('0x15')](_0x34a1fe[_0xe46b('0x16')])){_0x285704[_0xe46b('0x17')][_0xe46b('0x18')]({'where':{'id':_0x34a1fe[_0xe46b('0x19')]}})[_0xe46b('0x1a')](function(_0x1c3f4c){if(_0x1c3f4c){_0x1c3f4c[_0xe46b('0x1b')]({'lastMsgAt':_0x34a1fe[_0xe46b('0x1c')],'lastMsgDirection':_0x34a1fe[_0xe46b('0x12')][_0xe46b('0x11')]()});}})['catch'](function(_0x850bb6){console[_0xe46b('0x1d')](_0x850bb6);});}if(_0x34a1fe[_0xe46b('0x12')]==='out'&&!_0x34a1fe['secret']){var _0x32827e;_0x285704[_0xe46b('0x1e')][_0xe46b('0x1f')]({'where':{'id':_0x34a1fe[_0xe46b('0x20')]},'raw':!![]})[_0xe46b('0x1a')](function(_0x1b6258){_0x32827e=_0x1b6258;if(_0x32827e&&_0x32827e['type']){switch(_0x32827e[_0xe46b('0x21')]){case _0xe46b('0x22'):var _0x45e25c=require('twilio');if(_0x32827e[_0xe46b('0x23')]&&_0x32827e[_0xe46b('0x24')]&&_0x32827e[_0xe46b('0x25')]){var _0x5bc560=new _0x45e25c(_0x32827e[_0xe46b('0x23')],_0x32827e[_0xe46b('0x24')]);_0x5bc560['messages']['create']({'body':_0x34a1fe['body'],'to':_0xe46b('0x26')+_0x34a1fe[_0xe46b('0x25')],'from':_0xe46b('0x26')+_0x32827e[_0xe46b('0x25')],'statusCallback':_0x32827e[_0xe46b('0x27')]+'/api/whatsapp/messages/'+_0x34a1fe['id']+_0xe46b('0x28')+_0x32827e[_0xe46b('0x29')]})[_0xe46b('0x1a')](function(_0x4ef9b5){if(_0x4ef9b5[_0xe46b('0x2a')]){return _0x1d87b0[_0xe46b('0x1b')]({'messageId':_0x4ef9b5[_0xe46b('0x2a')]});}})[_0xe46b('0x2b')](function(_0x2160ca){logger[_0xe46b('0x1d')](_0xe46b('0x2c'),'afterCreate',_0xe46b('0x22'),util[_0xe46b('0x2d')](_0x2160ca,{'showHidden':![],'depth':null}));});}else{logger[_0xe46b('0x1d')](_0xe46b('0x2c'),_0xe46b('0x2e'),_0xe46b('0x22'),_0xe46b('0x2f'));}break;}}})[_0xe46b('0x30')](function(){_0x240b40();});}else{_0x240b40();}}},'charset':'utf8mb4','collate':_0xe46b('0x31')});};
\ No newline at end of file
+var _0x753c=['catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','models','get','direction','toLowerCase','out','secret','isNil','findOne','update','createdAt'];(function(_0x2fce43,_0x1d9626){var _0x537102=function(_0xe100d2){while(--_0xe100d2){_0x2fce43['push'](_0x2fce43['shift']());}};_0x537102(++_0x1d9626);}(_0x753c,0x79));var _0xc753=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x753c[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xc753('0x0'));var util=require(_0xc753('0x1'));var logger=require(_0xc753('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc753('0x3'));var rp=require(_0xc753('0x4'));var fs=require('fs');var path=require(_0xc753('0x5'));var rimraf=require('rimraf');var config=require(_0xc753('0x6'));var attributes=require(_0xc753('0x7'));module[_0xc753('0x8')]=function(_0x3908b3,_0x269f98){return _0x3908b3['define'](_0xc753('0x9'),attributes,{'tableName':_0xc753('0xa'),'paranoid':![],'indexes':[{'name':_0xc753('0xb'),'fields':[_0xc753('0xb')]},{'name':_0xc753('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x556e92,_0x1e4579,_0x3a153e){var _0x3013d0=_0x3908b3[_0xc753('0xd')];var _0x4482af=_0x556e92[_0xc753('0xe')]({'plain':!![]});if(_0x4482af[_0xc753('0xf')][_0xc753('0x10')]()==='in'||_0x4482af[_0xc753('0xf')]['toLowerCase']()===_0xc753('0x11')&&!_0x4482af[_0xc753('0x12')]&&!_[_0xc753('0x13')](_0x4482af['UserId'])){_0x3013d0['WhatsappInteraction'][_0xc753('0x14')]({'where':{'id':_0x4482af['WhatsappInteractionId']}})['then'](function(_0x63ed32){if(_0x63ed32){_0x63ed32[_0xc753('0x15')]({'lastMsgAt':_0x4482af[_0xc753('0x16')],'lastMsgDirection':_0x4482af[_0xc753('0xf')]['toLowerCase']()});}})[_0xc753('0x17')](function(_0x3fbfd6){console[_0xc753('0x18')](_0x3fbfd6);});}if(_0x4482af['direction']===_0xc753('0x11')&&!_0x4482af[_0xc753('0x12')]){var _0x22ed90;_0x3013d0[_0xc753('0x19')][_0xc753('0x1a')]({'where':{'id':_0x4482af[_0xc753('0x1b')]},'raw':!![]})[_0xc753('0x1c')](function(_0x41e1cc){_0x22ed90=_0x41e1cc;if(_0x22ed90&&_0x22ed90[_0xc753('0x1d')]){switch(_0x22ed90[_0xc753('0x1d')]){case _0xc753('0x1e'):var _0xdd73ec=require(_0xc753('0x1e'));if(_0x22ed90[_0xc753('0x1f')]&&_0x22ed90[_0xc753('0x20')]&&_0x22ed90[_0xc753('0x21')]){var _0x567c78=new _0xdd73ec(_0x22ed90[_0xc753('0x1f')],_0x22ed90[_0xc753('0x20')]);_0x567c78[_0xc753('0x22')][_0xc753('0x23')]({'body':_0x4482af[_0xc753('0x24')],'to':'whatsapp:'+_0x4482af[_0xc753('0x21')],'from':_0xc753('0x25')+_0x22ed90[_0xc753('0x21')],'statusCallback':_0x22ed90[_0xc753('0x26')]+_0xc753('0x27')+_0x4482af['id']+_0xc753('0x28')+_0x22ed90[_0xc753('0x29')]})['then'](function(_0x28a241){if(_0x28a241[_0xc753('0x2a')]){return _0x556e92[_0xc753('0x15')]({'messageId':_0x28a241[_0xc753('0x2a')]});}})[_0xc753('0x17')](function(_0x198c89){logger[_0xc753('0x18')](_0xc753('0x2b'),_0xc753('0x2c'),'twilio',util['inspect'](_0x198c89,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc753('0x2b'),_0xc753('0x2c'),_0xc753('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0xc753('0x2d')](function(){_0x3a153e();});}else{_0x3a153e();}}},'charset':_0xc753('0x2e'),'collate':_0xc753('0x2f')});};
\ No newline at end of file
index abb077f..2c3cc20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0593=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','CreateWhatsappMessage','WhatsappMessage','options','raw','debug','catch'];(function(_0x303ed7,_0x4daabe){var _0x5dfda2=function(_0x2abca8){while(--_0x2abca8){_0x303ed7['push'](_0x303ed7['shift']());}};_0x5dfda2(++_0x4daabe);}(_0x0593,0x1a4));var _0x3059=function(_0x57cc1f,_0xb4691a){_0x57cc1f=_0x57cc1f-0x0;var _0x2c4f54=_0x0593[_0x57cc1f];return _0x2c4f54;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3059('0x0'));var rs=require(_0x3059('0x1'));var fs=require('fs');var Redis=require(_0x3059('0x2'));var db=require(_0x3059('0x3'))['db'];var utils=require(_0x3059('0x4'));var logger=require('../../config/logger')(_0x3059('0x5'));var config=require(_0x3059('0x6'));var jayson=require(_0x3059('0x7'));var client=jayson['client'][_0x3059('0x8')]({'port':0x232a});config[_0x3059('0x9')]=_[_0x3059('0xa')](config[_0x3059('0x9')],{'host':_0x3059('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3059('0x9')]));require(_0x3059('0xc'))[_0x3059('0xd')](socket);function respondWithRpcPromise(_0x45d354,_0x441c53,_0x1a407a){return new BPromise(function(_0x565649,_0x4a273d){return client[_0x3059('0xe')](_0x45d354,_0x1a407a)[_0x3059('0xf')](function(_0x22fc28){logger[_0x3059('0x10')](_0x3059('0x11'),_0x441c53,_0x3059('0x12'));logger['debug'](_0x3059('0x13'),_0x441c53,_0x3059('0x12'),JSON['stringify'](_0x22fc28));if(_0x22fc28[_0x3059('0x14')]){if(_0x22fc28['error']['code']===0x1f4){logger[_0x3059('0x14')](_0x3059('0x11'),_0x441c53,_0x22fc28[_0x3059('0x14')][_0x3059('0x15')]);return _0x4a273d(_0x22fc28[_0x3059('0x14')][_0x3059('0x15')]);}logger[_0x3059('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x441c53,_0x22fc28[_0x3059('0x14')][_0x3059('0x15')]);return _0x565649(_0x22fc28['error']['message']);}else{logger['info'](_0x3059('0x11'),_0x441c53,_0x3059('0x12'));_0x565649(_0x22fc28['result'][_0x3059('0x15')]);}})['catch'](function(_0x9f62a){logger['error'](_0x3059('0x11'),_0x441c53,_0x9f62a);_0x4a273d(_0x9f62a);});});}exports[_0x3059('0x16')]=function(_0x18ff28){var _0x4cee1c=this;return new Promise(function(_0x13f315,_0x23d479){return db[_0x3059('0x17')]['create'](_0x18ff28['body'],{'raw':_0x18ff28[_0x3059('0x18')]?_0x18ff28[_0x3059('0x18')][_0x3059('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5d4dd3){logger[_0x3059('0x10')](_0x3059('0x16'),_0x18ff28);logger[_0x3059('0x1a')](_0x3059('0x16'),_0x18ff28,JSON['stringify'](_0x5d4dd3));_0x13f315(_0x5d4dd3);})[_0x3059('0x1b')](function(_0x263d46){logger['error']('CreateWhatsappMessage',_0x263d46['message'],_0x18ff28);_0x23d479(_0x4cee1c['error'](0x1f4,_0x263d46[_0x3059('0x15')]));});});};
\ No newline at end of file
+var _0x8a58=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x192306,_0x345a3c){var _0x211126=function(_0x587d65){while(--_0x587d65){_0x192306['push'](_0x192306['shift']());}};_0x211126(++_0x345a3c);}(_0x8a58,0x1db));var _0x88a5=function(_0x191460,_0x16a0cb){_0x191460=_0x191460-0x0;var _0x49eeaa=_0x8a58[_0x191460];return _0x49eeaa;};'use strict';var _=require('lodash');var util=require(_0x88a5('0x0'));var moment=require(_0x88a5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88a5('0x2'))['db'];var utils=require(_0x88a5('0x3'));var logger=require(_0x88a5('0x4'))(_0x88a5('0x5'));var config=require(_0x88a5('0x6'));var jayson=require(_0x88a5('0x7'));var client=jayson[_0x88a5('0x8')][_0x88a5('0x9')]({'port':0x232a});config[_0x88a5('0xa')]=_[_0x88a5('0xb')](config[_0x88a5('0xa')],{'host':_0x88a5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88a5('0xa')]));require('./whatsappMessage.socket')[_0x88a5('0xd')](socket);function respondWithRpcPromise(_0x551a72,_0x16db2f,_0x539b1d){return new BPromise(function(_0x1138e3,_0x2df392){return client[_0x88a5('0xe')](_0x551a72,_0x539b1d)[_0x88a5('0xf')](function(_0x108561){logger[_0x88a5('0x10')](_0x88a5('0x11'),_0x16db2f,_0x88a5('0x12'));logger[_0x88a5('0x13')](_0x88a5('0x14'),_0x16db2f,_0x88a5('0x12'),JSON[_0x88a5('0x15')](_0x108561));if(_0x108561['error']){if(_0x108561['error'][_0x88a5('0x16')]===0x1f4){logger[_0x88a5('0x17')](_0x88a5('0x11'),_0x16db2f,_0x108561[_0x88a5('0x17')][_0x88a5('0x18')]);return _0x2df392(_0x108561['error'][_0x88a5('0x18')]);}logger[_0x88a5('0x17')](_0x88a5('0x11'),_0x16db2f,_0x108561['error'][_0x88a5('0x18')]);return _0x1138e3(_0x108561['error'][_0x88a5('0x18')]);}else{logger[_0x88a5('0x10')](_0x88a5('0x11'),_0x16db2f,'request\x20sent');_0x1138e3(_0x108561[_0x88a5('0x19')]['message']);}})[_0x88a5('0x1a')](function(_0x35eb42){logger[_0x88a5('0x17')](_0x88a5('0x11'),_0x16db2f,_0x35eb42);_0x2df392(_0x35eb42);});});}exports[_0x88a5('0x1b')]=function(_0xb7c201){var _0x5b6be0=this;return new Promise(function(_0x2632fe,_0x572d5c){return db[_0x88a5('0x1c')]['create'](_0xb7c201[_0x88a5('0x1d')],{'raw':_0xb7c201[_0x88a5('0x1e')]?_0xb7c201[_0x88a5('0x1e')][_0x88a5('0x1f')]===undefined?!![]:![]:!![]})[_0x88a5('0xf')](function(_0x2eb457){logger['info'](_0x88a5('0x1b'),_0xb7c201);logger['debug'](_0x88a5('0x1b'),_0xb7c201,JSON[_0x88a5('0x15')](_0x2eb457));_0x2632fe(_0x2eb457);})[_0x88a5('0x1a')](function(_0x3ad7d1){logger[_0x88a5('0x17')](_0x88a5('0x1b'),_0x3ad7d1['message'],_0xb7c201);_0x572d5c(_0x5b6be0[_0x88a5('0x17')](0x1f4,_0x3ad7d1[_0x88a5('0x18')]));});});};
\ No newline at end of file
index 0e1daba..8732385 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc7a=['update','emit','removeListener','register','length','whatsappMessage:','remove'];(function(_0x24d8dd,_0x103354){var _0x126a6d=function(_0xeb4fc7){while(--_0xeb4fc7){_0x24d8dd['push'](_0x24d8dd['shift']());}};_0x126a6d(++_0x103354);}(_0xbc7a,0x76));var _0xabc7=function(_0x5ca209,_0x4e312f){_0x5ca209=_0x5ca209-0x0;var _0x630b27=_0xbc7a[_0x5ca209];return _0x630b27;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0xabc7('0x0'),_0xabc7('0x1')];function createListener(_0xe91716,_0x42333d){return function(_0x1551ef){_0x42333d[_0xabc7('0x2')](_0xe91716,_0x1551ef);};}function removeListener(_0x4e4732,_0x35adb5){return function(){WhatsappMessageEvents[_0xabc7('0x3')](_0x4e4732,_0x35adb5);};}exports[_0xabc7('0x4')]=function(_0x200fa7){for(var _0x524b94=0x0,_0x4aed28=events[_0xabc7('0x5')];_0x524b94<_0x4aed28;_0x524b94++){var _0x573136=events[_0x524b94];var _0x5f48d5=createListener(_0xabc7('0x6')+_0x573136,_0x200fa7);WhatsappMessageEvents['on'](_0x573136,_0x5f48d5);}};
\ No newline at end of file
+var _0xc74d=['remove','update','emit','removeListener','register','length','./whatsappMessage.events','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc74d,0x1ee));var _0xdc74=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc74d[_0x413feb];return _0x40ee88;};'use strict';var WhatsappMessageEvents=require(_0xdc74('0x0'));var events=[_0xdc74('0x1'),_0xdc74('0x2'),_0xdc74('0x3')];function createListener(_0x1659f4,_0x998684){return function(_0x57aa54){_0x998684[_0xdc74('0x4')](_0x1659f4,_0x57aa54);};}function removeListener(_0x3da819,_0x49fb14){return function(){WhatsappMessageEvents[_0xdc74('0x5')](_0x3da819,_0x49fb14);};}exports[_0xdc74('0x6')]=function(_0x1ac09b){for(var _0x418a86=0x0,_0x72a6ff=events[_0xdc74('0x7')];_0x418a86<_0x72a6ff;_0x418a86++){var _0x52d67e=events[_0x418a86];var _0x77804f=createListener('whatsappMessage:'+_0x52d67e,_0x1ac09b);WhatsappMessageEvents['on'](_0x52d67e,_0x77804f);}};
\ No newline at end of file
index d465083..1dff363 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27ea=['describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','update','delete','destroy','removeTeams','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x477e37,_0x44109d){var _0x435dcf=function(_0x17240e){while(--_0x17240e){_0x477e37['push'](_0x477e37['shift']());}};_0x435dcf(++_0x44109d);}(_0x27ea,0x11d));var _0xa27e=function(_0x2dfffa,_0x5a1d26){_0x2dfffa=_0x2dfffa-0x0;var _0x8509eb=_0x27ea[_0x2dfffa];return _0x8509eb;};'use strict';var multer=require(_0xa27e('0x0'));var util=require(_0xa27e('0x1'));var path=require('path');var timeout=require(_0xa27e('0x2'));var express=require(_0xa27e('0x3'));var router=express[_0xa27e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa27e('0x5'));var interaction=require(_0xa27e('0x6'));var config=require(_0xa27e('0x7'));var controller=require('./whatsappQueue.controller');router[_0xa27e('0x8')]('/',auth[_0xa27e('0x9')](),controller[_0xa27e('0xa')]);router[_0xa27e('0x8')](_0xa27e('0xb'),auth[_0xa27e('0x9')](),controller[_0xa27e('0xc')]);router[_0xa27e('0x8')](_0xa27e('0xd'),auth[_0xa27e('0x9')](),controller[_0xa27e('0xe')]);router[_0xa27e('0x8')]('/:id/members',auth[_0xa27e('0x9')](),controller[_0xa27e('0xf')]);router['get'](_0xa27e('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0xa27e('0x8')](_0xa27e('0x11'),auth['isAuthenticated'](),controller[_0xa27e('0x12')]);router['post']('/',auth[_0xa27e('0x9')](),controller[_0xa27e('0x13')]);router[_0xa27e('0x14')]('/:id/teams',auth[_0xa27e('0x9')](),controller[_0xa27e('0x15')]);router['post'](_0xa27e('0x11'),auth[_0xa27e('0x9')](),controller[_0xa27e('0x16')]);router['put'](_0xa27e('0xd'),auth[_0xa27e('0x9')](),controller[_0xa27e('0x17')]);router[_0xa27e('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xa27e('0x19')]);router[_0xa27e('0x18')]('/:id/teams',auth[_0xa27e('0x9')](),controller[_0xa27e('0x1a')]);router['delete'](_0xa27e('0x11'),auth[_0xa27e('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x7961=['getAgents','post','addTeams','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x228532,_0x30019c){var _0x82d902=function(_0x5546b8){while(--_0x5546b8){_0x228532['push'](_0x228532['shift']());}};_0x82d902(++_0x30019c);}(_0x7961,0x122));var _0x1796=function(_0x2d5805,_0x21954e){_0x2d5805=_0x2d5805-0x0;var _0x1cae4f=_0x7961[_0x2d5805];return _0x1cae4f;};'use strict';var multer=require(_0x1796('0x0'));var util=require(_0x1796('0x1'));var path=require(_0x1796('0x2'));var timeout=require(_0x1796('0x3'));var express=require(_0x1796('0x4'));var router=express[_0x1796('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1796('0x6'));var interaction=require(_0x1796('0x7'));var config=require(_0x1796('0x8'));var controller=require(_0x1796('0x9'));router['get']('/',auth[_0x1796('0xa')](),controller[_0x1796('0xb')]);router[_0x1796('0xc')](_0x1796('0xd'),auth[_0x1796('0xa')](),controller[_0x1796('0xe')]);router[_0x1796('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x1796('0xf')]);router[_0x1796('0xc')]('/:id/members',auth[_0x1796('0xa')](),controller[_0x1796('0x10')]);router[_0x1796('0xc')](_0x1796('0x11'),auth[_0x1796('0xa')](),controller[_0x1796('0x12')]);router[_0x1796('0xc')](_0x1796('0x13'),auth[_0x1796('0xa')](),controller[_0x1796('0x14')]);router[_0x1796('0x15')]('/',auth[_0x1796('0xa')](),controller['create']);router[_0x1796('0x15')](_0x1796('0x11'),auth['isAuthenticated'](),controller[_0x1796('0x16')]);router[_0x1796('0x15')]('/:id/users',auth[_0x1796('0xa')](),controller['addAgents']);router[_0x1796('0x17')](_0x1796('0x18'),auth['isAuthenticated'](),controller[_0x1796('0x19')]);router[_0x1796('0x1a')](_0x1796('0x18'),auth['isAuthenticated'](),controller[_0x1796('0x1b')]);router[_0x1796('0x1a')](_0x1796('0x11'),auth[_0x1796('0xa')](),controller[_0x1796('0x1c')]);router['delete'](_0x1796('0x13'),auth[_0x1796('0xa')](),controller[_0x1796('0x1d')]);module[_0x1796('0x1e')]=router;
\ No newline at end of file
index 3573326..ca55077 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2557=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2557,0x11e));var _0x7255=function(_0x3c5f68,_0x37135d){_0x3c5f68=_0x3c5f68-0x0;var _0x27a46f=_0x2557[_0x3c5f68];return _0x27a46f;};'use strict';var Sequelize=require(_0x7255('0x0'));module['exports']={'name':{'type':Sequelize[_0x7255('0x1')],'unique':_0x7255('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7255('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7255('0x4')](_0x7255('0x5'),_0x7255('0x6'),'roundrobin')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x98e5=['rrmemory','beepall','STRING','name','INTEGER'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0x98e5,0x8a));var _0x598e=function(_0x160d0c,_0x42b3ab){_0x160d0c=_0x160d0c-0x0;var _0x424352=_0x98e5[_0x160d0c];return _0x424352;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x598e('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x598e('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x598e('0x2'),_0x598e('0x3'),'roundrobin')},'description':{'type':Sequelize[_0x598e('0x4')]}};
\ No newline at end of file
index 13cfaa8..60f99df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2983=['TeamId','includes','all','value','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','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','update','describe','UserWhatsappQueue','User','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','push','QueryTypes','SELECT','every'];(function(_0x108c78,_0x179f38){var _0x494e31=function(_0x45c2e6){while(--_0x45c2e6){_0x108c78['push'](_0x108c78['shift']());}};_0x494e31(++_0x179f38);}(_0x2983,0x1b9));var _0x3298=function(_0x1d30da,_0x14ab14){_0x1d30da=_0x1d30da-0x0;var _0x3b72e2=_0x2983[_0x1d30da];return _0x3b72e2;};'use strict';var emlformat=require(_0x3298('0x0'));var rimraf=require(_0x3298('0x1'));var zipdir=require(_0x3298('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3298('0x3'));var moment=require(_0x3298('0x4'));var BPromise=require(_0x3298('0x5'));var Mustache=require(_0x3298('0x6'));var util=require(_0x3298('0x7'));var path=require(_0x3298('0x8'));var sox=require(_0x3298('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3298('0xa'));var _=require(_0x3298('0xb'));var squel=require(_0x3298('0xc'));var crypto=require(_0x3298('0xd'));var jsforce=require(_0x3298('0xe'));var deskjs=require(_0x3298('0xf'));var toCsv=require(_0x3298('0x10'));var querystring=require(_0x3298('0x11'));var Papa=require(_0x3298('0x12'));var Redis=require(_0x3298('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3298('0x14'));var as=require(_0x3298('0x15'));var hardwareService=require(_0x3298('0x16'));var logger=require(_0x3298('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3298('0x18'));var db=require(_0x3298('0x19'))['db'];config[_0x3298('0x1a')]=_[_0x3298('0x1b')](config[_0x3298('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3298('0x1c'))(new Redis(config[_0x3298('0x1a')]));require(_0x3298('0x1d'))[_0x3298('0x1e')](socket);function respondWithStatusCode(_0x18fe85,_0x30f7fc){_0x30f7fc=_0x30f7fc||0xcc;return function(_0x16d43f){if(_0x16d43f){return _0x18fe85[_0x3298('0x1f')](_0x30f7fc);}return _0x18fe85[_0x3298('0x20')](_0x30f7fc)[_0x3298('0x21')]();};}function respondWithResult(_0x1e294b,_0x4a3ec1){_0x4a3ec1=_0x4a3ec1||0xc8;return function(_0xdb7757){if(_0xdb7757){return _0x1e294b[_0x3298('0x20')](_0x4a3ec1)[_0x3298('0x22')](_0xdb7757);}};}function respondWithFilteredResult(_0x2137cc,_0xe23d28){return function(_0x135310){if(_0x135310){var _0x3841c8=typeof _0xe23d28['offset']==='undefined'&&typeof _0xe23d28['limit']===_0x3298('0x23');var _0x1abb14=_0x135310[_0x3298('0x24')];var _0x5625a7=_0x3841c8?0x0:_0xe23d28[_0x3298('0x25')];var _0x2a72e1=_0x3841c8?_0x135310['count']:_0xe23d28[_0x3298('0x25')]+_0xe23d28[_0x3298('0x26')];var _0x2c016d;if(_0x2a72e1>=_0x1abb14){_0x2a72e1=_0x1abb14;_0x2c016d=0xc8;}else{_0x2c016d=0xce;}_0x2137cc[_0x3298('0x20')](_0x2c016d);return _0x2137cc[_0x3298('0x27')](_0x3298('0x28'),_0x5625a7+'-'+_0x2a72e1+'/'+_0x1abb14)[_0x3298('0x22')](_0x135310);}return null;};}function patchUpdates(_0x463f2e){return function(_0x4c09b0){try{jsonpatch[_0x3298('0x29')](_0x4c09b0,_0x463f2e,!![]);}catch(_0x27e6c2){return BPromise['reject'](_0x27e6c2);}return _0x4c09b0['save']();};}function saveUpdates(_0x5aa24e,_0x3ed528){return function(_0x4db9e0){if(_0x4db9e0){return _0x4db9e0['update'](_0x5aa24e)[_0x3298('0x2a')](function(_0x48ef10){return _0x48ef10;});}return null;};}function removeEntity(_0x32fe94,_0xe9d31){return function(_0x534df0){if(_0x534df0){return _0x534df0[_0x3298('0x2b')]()[_0x3298('0x2a')](function(){var _0x420379=_0x534df0[_0x3298('0x2c')]({'plain':!![]});var _0x4fb5d5=_0x3298('0x2d');return db[_0x3298('0x2e')][_0x3298('0x2b')]({'where':{'type':_0x4fb5d5,'resourceId':_0x420379['id']}})[_0x3298('0x2a')](function(){return _0x534df0;});})[_0x3298('0x2a')](function(){_0x32fe94['status'](0xcc)[_0x3298('0x21')]();});}};}function handleEntityNotFound(_0x2763a0,_0x50fae2){return function(_0x11325f){if(!_0x11325f){_0x2763a0[_0x3298('0x1f')](0x194);}return _0x11325f;};}function handleError(_0x47b9e6,_0xabfac7){_0xabfac7=_0xabfac7||0x1f4;return function(_0x552700){logger[_0x3298('0x2f')](_0x552700[_0x3298('0x30')]);if(_0x552700['name']){delete _0x552700[_0x3298('0x31')];}_0x47b9e6['status'](_0xabfac7)['send'](_0x552700);};}exports[_0x3298('0x32')]=function(_0x519bd3,_0x343ad0){var _0x24b137={},_0x572b2c={},_0x4d8b74={'count':0x0,'rows':[]};var _0x3b013a=_[_0x3298('0x33')](db[_0x3298('0x34')][_0x3298('0x35')],function(_0x79b5b9){return{'name':_0x79b5b9[_0x3298('0x36')],'type':_0x79b5b9[_0x3298('0x37')][_0x3298('0x38')]};});_0x572b2c[_0x3298('0x39')]=_[_0x3298('0x33')](_0x3b013a,_0x3298('0x31'));_0x572b2c[_0x3298('0x3a')]=_['keys'](_0x519bd3[_0x3298('0x3a')]);_0x572b2c[_0x3298('0x3b')]=_[_0x3298('0x3c')](_0x572b2c[_0x3298('0x39')],_0x572b2c[_0x3298('0x3a')]);_0x24b137['attributes']=_[_0x3298('0x3c')](_0x572b2c['model'],qs[_0x3298('0x3d')](_0x519bd3[_0x3298('0x3a')][_0x3298('0x3d')]));_0x24b137['attributes']=_0x24b137[_0x3298('0x3e')][_0x3298('0x3f')]?_0x24b137[_0x3298('0x3e')]:_0x572b2c[_0x3298('0x39')];if(!_0x519bd3['query'][_0x3298('0x40')](_0x3298('0x41'))){_0x24b137[_0x3298('0x26')]=qs[_0x3298('0x26')](_0x519bd3[_0x3298('0x3a')][_0x3298('0x26')]);_0x24b137[_0x3298('0x25')]=qs[_0x3298('0x25')](_0x519bd3[_0x3298('0x3a')]['offset']);}_0x24b137[_0x3298('0x42')]=qs[_0x3298('0x43')](_0x519bd3[_0x3298('0x3a')][_0x3298('0x43')]);_0x24b137[_0x3298('0x44')]=qs['filters'](_[_0x3298('0x45')](_0x519bd3[_0x3298('0x3a')],_0x572b2c['filters']),_0x3b013a);if(_0x519bd3[_0x3298('0x3a')][_0x3298('0x46')]){_0x24b137['where']=_[_0x3298('0x47')](_0x24b137[_0x3298('0x44')],{'$or':_[_0x3298('0x33')](_0x3b013a,function(_0x30ac7d){if(_0x30ac7d[_0x3298('0x37')]!==_0x3298('0x48')){var _0x2972fa={};_0x2972fa[_0x30ac7d[_0x3298('0x31')]]={'$like':'%'+_0x519bd3[_0x3298('0x3a')][_0x3298('0x46')]+'%'};return _0x2972fa;}})});}_0x24b137=_['merge']({},_0x24b137,_0x519bd3['options']);var _0x39c52a={'where':_0x24b137[_0x3298('0x44')]};return db[_0x3298('0x34')][_0x3298('0x24')](_0x39c52a)[_0x3298('0x2a')](function(_0x6e0e3a){_0x4d8b74[_0x3298('0x24')]=_0x6e0e3a;if(_0x519bd3[_0x3298('0x3a')][_0x3298('0x49')]){_0x24b137[_0x3298('0x4a')]=[{'all':!![]}];}return db[_0x3298('0x34')][_0x3298('0x4b')](_0x24b137);})['then'](function(_0x50aa67){_0x4d8b74[_0x3298('0x4c')]=_0x50aa67;return _0x4d8b74;})[_0x3298('0x2a')](respondWithFilteredResult(_0x343ad0,_0x24b137))['catch'](handleError(_0x343ad0,null));};exports[_0x3298('0x4d')]=function(_0x4f887d,_0x35f0c5){var _0x177994={'raw':!![],'where':{'id':_0x4f887d[_0x3298('0x4e')]['id']}},_0x385dbf={};_0x385dbf['model']=_[_0x3298('0x4f')](db['WhatsappQueue'][_0x3298('0x35')]);_0x385dbf[_0x3298('0x3a')]=_[_0x3298('0x4f')](_0x4f887d[_0x3298('0x3a')]);_0x385dbf['filters']=_[_0x3298('0x3c')](_0x385dbf[_0x3298('0x39')],_0x385dbf['query']);_0x177994[_0x3298('0x3e')]=_['intersection'](_0x385dbf[_0x3298('0x39')],qs[_0x3298('0x3d')](_0x4f887d[_0x3298('0x3a')][_0x3298('0x3d')]));_0x177994['attributes']=_0x177994['attributes'][_0x3298('0x3f')]?_0x177994[_0x3298('0x3e')]:_0x385dbf['model'];if(_0x4f887d[_0x3298('0x3a')][_0x3298('0x49')]){_0x177994[_0x3298('0x4a')]=[{'all':!![]}];}_0x177994=_[_0x3298('0x47')]({},_0x177994,_0x4f887d[_0x3298('0x50')]);return db[_0x3298('0x34')][_0x3298('0x51')](_0x177994)[_0x3298('0x2a')](handleEntityNotFound(_0x35f0c5,null))[_0x3298('0x2a')](respondWithResult(_0x35f0c5,null))[_0x3298('0x52')](handleError(_0x35f0c5,null));};exports[_0x3298('0x53')]=function(_0x478204,_0x33d190){return db[_0x3298('0x34')][_0x3298('0x53')](_0x478204[_0x3298('0x54')],{})[_0x3298('0x2a')](function(_0xf905a1){var _0x46cd3b=_0x478204[_0x3298('0x55')]['get']({'plain':!![]});if(!_0x46cd3b)throw new Error(_0x3298('0x56'));if(_0x46cd3b[_0x3298('0x57')]===_0x3298('0x55')){var _0x3983dc=_0xf905a1[_0x3298('0x2c')]({'plain':!![]});var _0x23deb6='WhatsappQueues';return db[_0x3298('0x58')][_0x3298('0x51')]({'where':{'name':_0x23deb6,'userProfileId':_0x46cd3b[_0x3298('0x59')]},'raw':!![]})[_0x3298('0x2a')](function(_0x3f8eb1){if(_0x3f8eb1&&_0x3f8eb1[_0x3298('0x5a')]===0x0){return db[_0x3298('0x2e')][_0x3298('0x53')]({'name':_0x3983dc['name'],'resourceId':_0x3983dc['id'],'type':_0x3f8eb1[_0x3298('0x31')],'sectionId':_0x3f8eb1['id']},{})['then'](function(){return _0xf905a1;});}else{return _0xf905a1;}})['catch'](function(_0x16f46a){logger['error'](_0x3298('0x5b'),_0x16f46a);throw _0x16f46a;});}return _0xf905a1;})[_0x3298('0x2a')](respondWithResult(_0x33d190,0xc9))[_0x3298('0x52')](handleError(_0x33d190,null));};exports[_0x3298('0x5c')]=function(_0x746d15,_0x42ce12){if(_0x746d15['body']['id']){delete _0x746d15['body']['id'];}return db[_0x3298('0x34')][_0x3298('0x51')]({'where':{'id':_0x746d15[_0x3298('0x4e')]['id']}})['then'](handleEntityNotFound(_0x42ce12,null))['then'](saveUpdates(_0x746d15[_0x3298('0x54')],null))[_0x3298('0x2a')](respondWithResult(_0x42ce12,null))[_0x3298('0x52')](handleError(_0x42ce12,null));};exports[_0x3298('0x2b')]=function(_0xa18b74,_0x32c0cd){return db['WhatsappQueue'][_0x3298('0x51')]({'where':{'id':_0xa18b74[_0x3298('0x4e')]['id']}})[_0x3298('0x2a')](handleEntityNotFound(_0x32c0cd,null))[_0x3298('0x2a')](removeEntity(_0x32c0cd,null))[_0x3298('0x52')](handleError(_0x32c0cd,null));};exports[_0x3298('0x5d')]=function(_0x3dbff7,_0x59ac05){return db[_0x3298('0x34')]['describe']()['then'](respondWithResult(_0x59ac05,null))['catch'](handleError(_0x59ac05,null));};exports['getMembers']=function(_0x1a2f7e,_0x4d1b58,_0x2af303){var _0xcd157b={'raw':!![],'where':{}},_0x549032={},_0x9138a4;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1a2f7e[_0x3298('0x4e')]['id']}})[_0x3298('0x2a')](handleEntityNotFound(_0x4d1b58,null))[_0x3298('0x2a')](function(_0x3c8533){if(_0x3c8533){_0x9138a4=_0x3c8533[_0x3298('0x2c')]({'plain':!![]});_0x549032[_0x3298('0x39')]=_[_0x3298('0x4f')](db[_0x3298('0x5e')][_0x3298('0x35')]);_0x549032['query']=_[_0x3298('0x4f')](_0x1a2f7e[_0x3298('0x3a')]);_0x549032[_0x3298('0x3b')]=_[_0x3298('0x3c')](_0x549032['model'],_0x549032['query']);_0xcd157b[_0x3298('0x3e')]=_[_0x3298('0x3c')](_0x549032[_0x3298('0x39')],qs[_0x3298('0x3d')](_0x1a2f7e['query'][_0x3298('0x3d')]));_0xcd157b[_0x3298('0x3e')]=_0xcd157b[_0x3298('0x3e')]['length']?_0xcd157b[_0x3298('0x3e')]:_0x549032['model'];if(!_0x1a2f7e[_0x3298('0x3a')]['hasOwnProperty'](_0x3298('0x41'))){_0xcd157b[_0x3298('0x26')]=qs[_0x3298('0x26')](_0x1a2f7e['query']['limit']);_0xcd157b[_0x3298('0x25')]=qs[_0x3298('0x25')](_0x1a2f7e['query'][_0x3298('0x25')]);}_0xcd157b['order']=qs[_0x3298('0x43')](_0x1a2f7e['query'][_0x3298('0x43')]);_0xcd157b['where']=qs['filters'](_[_0x3298('0x45')](_0x1a2f7e[_0x3298('0x3a')],_0x549032[_0x3298('0x3b')]));_0xcd157b[_0x3298('0x44')]['WhatsappQueueId']=_0x3c8533['id'];if(_0x1a2f7e[_0x3298('0x3a')]['filter']){_0xcd157b[_0x3298('0x44')]=_[_0x3298('0x47')](_0xcd157b[_0x3298('0x44')],{'$or':_[_0x3298('0x33')](_0xcd157b[_0x3298('0x3e')],function(_0x160d6d){var _0x1ddae9={};_0x1ddae9[_0x160d6d]={'$like':'%'+_0x1a2f7e['query'][_0x3298('0x46')]+'%'};return _0x1ddae9;})});}_0xcd157b=_[_0x3298('0x47')]({},_0xcd157b,_0x1a2f7e[_0x3298('0x50')]);return db[_0x3298('0x5e')]['findAll'](_0xcd157b);}})[_0x3298('0x2a')](function(_0x161ec){if(_0x161ec){return db[_0x3298('0x5f')]['findAndCountAll']({'where':{'id':_[_0x3298('0x33')](_0x161ec,_0x3298('0x60')),'role':_0x3298('0x61')},'attributes':['id','name',_0x3298('0x62'),_0x3298('0x63'),_0x3298('0x64')]});}})[_0x3298('0x2a')](function(_0x574f54){if(_0x574f54){return{'count':_0x574f54[_0x3298('0x24')],'rows':_[_0x3298('0x33')](_0x574f54[_0x3298('0x4c')],function(_0x21878b){return{'membername':_0x21878b[_0x3298('0x31')],'UserId':_0x21878b['id'],'queue_name':_0x9138a4[_0x3298('0x31')],'WhatsappQueueId':_0x9138a4['id'],'interface':util[_0x3298('0x65')](_0x3298('0x66'),_0x3298('0x67'),_0x21878b[_0x3298('0x31')]),'penalty':0x0,'paused':_0x21878b[_0x3298('0x62')],'createdAt':_0x21878b['createdAt'],'updatedAt':_0x21878b[_0x3298('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3298('0x2a')](respondWithFilteredResult(_0x4d1b58,_0xcd157b))[_0x3298('0x52')](handleError(_0x4d1b58,null));};exports[_0x3298('0x68')]=function(_0x346b5f,_0x43074f,_0x374f42){var _0x2c4693={};var _0x245f1d={};var _0x3bade5;var _0x22f95c;return db[_0x3298('0x34')][_0x3298('0x69')]({'where':{'id':_0x346b5f[_0x3298('0x4e')]['id']}})[_0x3298('0x2a')](handleEntityNotFound(_0x43074f,null))[_0x3298('0x2a')](function(_0x3a6951){if(_0x3a6951){_0x3bade5=_0x3a6951;_0x245f1d[_0x3298('0x39')]=_[_0x3298('0x4f')](db[_0x3298('0x6a')]['rawAttributes']);_0x245f1d[_0x3298('0x3a')]=_[_0x3298('0x4f')](_0x346b5f[_0x3298('0x3a')]);_0x245f1d[_0x3298('0x3b')]=_[_0x3298('0x3c')](_0x245f1d['model'],_0x245f1d[_0x3298('0x3a')]);_0x2c4693[_0x3298('0x3e')]=_[_0x3298('0x3c')](_0x245f1d['model'],qs['fields'](_0x346b5f[_0x3298('0x3a')]['fields']));_0x2c4693[_0x3298('0x3e')]=_0x2c4693['attributes'][_0x3298('0x3f')]?_0x2c4693['attributes']:_0x245f1d[_0x3298('0x39')];_0x2c4693['order']=qs[_0x3298('0x43')](_0x346b5f[_0x3298('0x3a')][_0x3298('0x43')]);_0x2c4693[_0x3298('0x44')]=qs['filters'](_['pick'](_0x346b5f[_0x3298('0x3a')],_0x245f1d[_0x3298('0x3b')]));if(_0x346b5f[_0x3298('0x3a')]['filter']){_0x2c4693[_0x3298('0x44')]=_['merge'](_0x2c4693['where'],{'$or':_[_0x3298('0x33')](_0x2c4693[_0x3298('0x3e')],function(_0x31540e){var _0x6d3e34={};_0x6d3e34[_0x31540e]={'$like':'%'+_0x346b5f[_0x3298('0x3a')][_0x3298('0x46')]+'%'};return _0x6d3e34;})});}_0x2c4693=_['merge']({},_0x2c4693,_0x346b5f[_0x3298('0x50')]);return _0x3bade5[_0x3298('0x68')](_0x2c4693);}})[_0x3298('0x2a')](function(_0xad613c){if(_0xad613c){_0x22f95c=_0xad613c[_0x3298('0x3f')];if(!_0x346b5f[_0x3298('0x3a')][_0x3298('0x40')](_0x3298('0x41'))){_0x2c4693['limit']=qs[_0x3298('0x26')](_0x346b5f['query'][_0x3298('0x26')]);_0x2c4693[_0x3298('0x25')]=qs[_0x3298('0x25')](_0x346b5f[_0x3298('0x3a')][_0x3298('0x25')]);}return _0x3bade5[_0x3298('0x68')](_0x2c4693);}})['then'](function(_0x3434a0){if(_0x3434a0){return _0x3434a0?{'count':_0x22f95c,'rows':_0x3434a0}:null;}})[_0x3298('0x2a')](respondWithResult(_0x43074f,null))[_0x3298('0x52')](handleError(_0x43074f,null));};exports[_0x3298('0x6b')]=function(_0x4f53fc,_0x521fcd,_0x49c53a){var _0x5cd8ec=_0x4f53fc[_0x3298('0x54')][_0x3298('0x6c')];return db[_0x3298('0x6a')]['findAll']({'where':{'id':_0x5cd8ec},'attributes':['id'],'include':[{'model':db[_0x3298('0x5f')],'as':_0x3298('0x6d'),'attributes':['id',_0x3298('0x31'),_0x3298('0x6e'),_0x3298('0x6f'),'interface'],'raw':!![]}]})[_0x3298('0x2a')](function(_0x2c0567){if(_0x2c0567){var _0x555742=_[_0x3298('0x70')](_0x2c0567,function(_0x5d1f89){var _0x318238=_0x5d1f89[_0x3298('0x2c')]({'plain':!![]});return _0x318238[_0x3298('0x6d')];});return db['WhatsappQueue'][_0x3298('0x51')]({'where':{'id':_0x4f53fc[_0x3298('0x4e')]['id']}})['then'](function(_0x17f188){return db[_0x3298('0x71')][_0x3298('0x72')](function(_0x2c9edb){return _0x17f188[_0x3298('0x6b')](_0x5cd8ec,{'transaction':_0x2c9edb})['then'](function(){return BPromise[_0x3298('0x73')](_0x555742,function(_0x5c5706){return db['UserWhatsappQueue'][_0x3298('0x74')]({'where':{'UserId':_0x5c5706['id'],'WhatsappQueueId':_0x4f53fc['params']['id']},'transaction':_0x2c9edb});});})[_0x3298('0x2a')](function(){_0x555742['forEach'](function(_0x18f45b){socket[_0x3298('0x75')](_0x3298('0x76'),{'UserId':_0x18f45b['id'],'WhatsappQueueId':_0x17f188['id']});});});});});}})[_0x3298('0x2a')](respondWithStatusCode(_0x521fcd,null))[_0x3298('0x52')](handleError(_0x521fcd,null));};exports[_0x3298('0x77')]=function(_0xbafd46,_0x58d115,_0x52c4cf){return db['Team'][_0x3298('0x4b')]({'where':{'id':_0xbafd46[_0x3298('0x3a')][_0x3298('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x3298('0x5f')],'as':_0x3298('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x3298('0x2a')](handleEntityNotFound(_0x58d115,null))[_0x3298('0x2a')](function(_0xcf56e0){var _0xc043e=_[_0x3298('0x33')](_0xcf56e0,'id');var _0x58465b=[];var _0x2f0937=[];var _0x49b1ab=squel['select']();_0x49b1ab[_0x3298('0x78')]('tq.TeamId')[_0x3298('0x79')](_0x3298('0x7a'),'tq')[_0x3298('0x7b')](_0x3298('0x7c'),'ut',_0x3298('0x7d'))[_0x3298('0x44')](_0x3298('0x7e'),_0xbafd46[_0x3298('0x4e')]['id']);for(var _0x358906=0x0;_0x358906<_0xcf56e0['length'];_0x358906+=0x1){let _0x4332b9=_0xcf56e0[_0x358906];for(var _0x8517d=0x0;_0x8517d<_0x4332b9['Agents'][_0x3298('0x3f')];_0x8517d+=0x1){let _0xadb8ed=_0x4332b9[_0x3298('0x6d')][_0x8517d];var _0x3ae1a1=_0x49b1ab['clone']();_0x3ae1a1[_0x3298('0x44')]('ut.UserId\x20=\x20?',_0xadb8ed['id']);_0x2f0937[_0x3298('0x7f')](db[_0x3298('0x71')][_0x3298('0x3a')](_0x3ae1a1['toString'](),{'type':db['sequelize'][_0x3298('0x80')][_0x3298('0x81')]})[_0x3298('0x2a')](function(_0x3b6aa6){if(_0x3b6aa6[_0x3298('0x3f')]===0x1){return _0xadb8ed['id'];}else{var _0x4c4e06=_[_0x3298('0x82')](_[_0x3298('0x33')](_0x3b6aa6,_0x3298('0x83')),function(_0x50ce0c){return _[_0x3298('0x84')](_0xc043e,_0x50ce0c);});if(_0x4c4e06){return _0xadb8ed['id'];}}}));}}return BPromise[_0x3298('0x85')](_0x2f0937)[_0x3298('0x2a')](function(_0x2d1021){_0x58465b=_(_0x58465b)['union'](_0x2d1021)['compact']()[_0x3298('0x86')]();return db['WhatsappQueue'][_0x3298('0x51')]({'where':{'id':_0xbafd46[_0x3298('0x4e')]['id']}})['then'](function(_0x5c9777){return db[_0x3298('0x71')][_0x3298('0x72')](function(_0x3ecdb5){return _0x5c9777['removeTeams'](_0xbafd46['query'][_0x3298('0x6c')],{'transaction':_0x3ecdb5})[_0x3298('0x2a')](function(){if(!_['isEmpty'](_0x58465b)){return _0x5c9777[_0x3298('0x87')](_0x58465b,{'transaction':_0x3ecdb5});}})[_0x3298('0x2a')](function(){_0x58465b[_0x3298('0x88')](function(_0x88fc21){socket[_0x3298('0x75')](_0x3298('0x89'),{'UserId':_0x88fc21,'WhatsappQueueId':_0x5c9777['id']});});});});});});})['then'](respondWithStatusCode(_0x58d115,null))[_0x3298('0x52')](handleError(_0x58d115,null));};exports[_0x3298('0x8a')]=function(_0x4c3220,_0x177359,_0x3d7be9){return db[_0x3298('0x34')][_0x3298('0x51')]({'where':{'id':_0x4c3220['params']['id']}})[_0x3298('0x2a')](handleEntityNotFound(_0x177359,null))[_0x3298('0x2a')](function(_0x2f38ca){if(_0x2f38ca){return _0x2f38ca[_0x3298('0x8a')](_0x4c3220['body'][_0x3298('0x6c')],_[_0x3298('0x8b')](_0x4c3220['body'],[_0x3298('0x6c'),'id'])||{})[_0x3298('0x8c')](function(_0x121412){for(var _0x1fec5e=0x0;_0x1fec5e<_0x4c3220[_0x3298('0x54')][_0x3298('0x6c')][_0x3298('0x3f')];_0x1fec5e+=0x1){socket[_0x3298('0x75')](_0x3298('0x76'),{'UserId':Number(_0x4c3220['body'][_0x3298('0x6c')][_0x1fec5e]),'WhatsappQueueId':Number(_0x4c3220[_0x3298('0x4e')]['id'])});}return _0x121412;});}})[_0x3298('0x2a')](respondWithResult(_0x177359,null))[_0x3298('0x52')](handleError(_0x177359,null));};exports[_0x3298('0x87')]=function(_0x1c57fb,_0x468e4e,_0x43e77a){return db['WhatsappQueue'][_0x3298('0x51')]({'where':{'id':_0x1c57fb[_0x3298('0x4e')]['id']}})['then'](handleEntityNotFound(_0x468e4e,null))[_0x3298('0x2a')](function(_0x4d7d61){if(_0x4d7d61){return _0x4d7d61['removeAgents'](_0x1c57fb[_0x3298('0x3a')][_0x3298('0x6c')])[_0x3298('0x2a')](function(){if(_[_0x3298('0x8d')](_0x1c57fb[_0x3298('0x3a')]['ids'])){for(var _0x22fcf6=0x0;_0x22fcf6<_0x1c57fb[_0x3298('0x3a')][_0x3298('0x6c')][_0x3298('0x3f')];_0x22fcf6+=0x1){socket[_0x3298('0x75')](_0x3298('0x89'),{'UserId':Number(_0x1c57fb[_0x3298('0x3a')][_0x3298('0x6c')][_0x22fcf6]),'WhatsappQueueId':Number(_0x1c57fb[_0x3298('0x4e')]['id'])});}}else{socket['emit'](_0x3298('0x89'),{'UserId':Number(_0x1c57fb[_0x3298('0x3a')][_0x3298('0x6c')]),'WhatsappQueueId':Number(_0x1c57fb['params']['id'])});}});}})['then'](respondWithStatusCode(_0x468e4e,null))['catch'](handleError(_0x468e4e,null));};exports[_0x3298('0x8e')]=function(_0x2cb8dc,_0xfab5bb,_0x449eb9){var _0x30a67e={};var _0x29d1a2={};var _0x4ab847;var _0x361605;return db[_0x3298('0x34')]['findOne']({'where':{'id':_0x2cb8dc[_0x3298('0x4e')]['id']}})[_0x3298('0x2a')](handleEntityNotFound(_0xfab5bb,null))['then'](function(_0x3d062a){if(_0x3d062a){_0x4ab847=_0x3d062a;_0x29d1a2['model']=_[_0x3298('0x4f')](db[_0x3298('0x5f')]['rawAttributes']);_0x29d1a2['query']=_[_0x3298('0x4f')](_0x2cb8dc['query']);_0x29d1a2[_0x3298('0x3b')]=_['intersection'](_0x29d1a2[_0x3298('0x39')],_0x29d1a2[_0x3298('0x3a')]);_0x30a67e[_0x3298('0x3e')]=_[_0x3298('0x3c')](_0x29d1a2[_0x3298('0x39')],qs['fields'](_0x2cb8dc['query']['fields']));_0x30a67e[_0x3298('0x3e')]=_0x30a67e['attributes'][_0x3298('0x3f')]?_0x30a67e[_0x3298('0x3e')]:_0x29d1a2[_0x3298('0x39')];_0x30a67e[_0x3298('0x42')]=qs[_0x3298('0x43')](_0x2cb8dc[_0x3298('0x3a')][_0x3298('0x43')]);_0x30a67e[_0x3298('0x44')]=qs[_0x3298('0x3b')](_[_0x3298('0x45')](_0x2cb8dc['query'],_0x29d1a2['filters']));if(_0x2cb8dc[_0x3298('0x3a')][_0x3298('0x46')]){_0x30a67e[_0x3298('0x44')]=_[_0x3298('0x47')](_0x30a67e[_0x3298('0x44')],{'$or':_[_0x3298('0x33')](_0x30a67e[_0x3298('0x3e')],function(_0x2a2b80){var _0x52cf91={};_0x52cf91[_0x2a2b80]={'$like':'%'+_0x2cb8dc[_0x3298('0x3a')][_0x3298('0x46')]+'%'};return _0x52cf91;})});}_0x30a67e=_[_0x3298('0x47')]({},_0x30a67e,_0x2cb8dc['options']);return _0x4ab847[_0x3298('0x8e')](_0x30a67e);}})['then'](function(_0x2ecb8e){if(_0x2ecb8e){_0x361605=_0x2ecb8e[_0x3298('0x3f')];if(!_0x2cb8dc[_0x3298('0x3a')][_0x3298('0x40')]('nolimit')){_0x30a67e[_0x3298('0x26')]=qs[_0x3298('0x26')](_0x2cb8dc[_0x3298('0x3a')][_0x3298('0x26')]);_0x30a67e[_0x3298('0x25')]=qs[_0x3298('0x25')](_0x2cb8dc[_0x3298('0x3a')][_0x3298('0x25')]);}return _0x4ab847['getAgents'](_0x30a67e);}})[_0x3298('0x2a')](function(_0x35b567){if(_0x35b567){return _0x35b567?{'count':_0x361605,'rows':_0x35b567}:null;}})['then'](respondWithResult(_0xfab5bb,null))[_0x3298('0x52')](handleError(_0xfab5bb,null));};
\ No newline at end of file
+var _0xd838=['filters','pick','filter','merge','VIRTUAL','options','WhatsappQueue','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','hasOwnProperty','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','whatsappPause','updatedAt','getTeams','findOne','Team','order','addTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','then','WhatsappQueues','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where'];(function(_0x4f8c39,_0x457239){var _0x479c07=function(_0xcc387c){while(--_0xcc387c){_0x4f8c39['push'](_0x4f8c39['shift']());}};_0x479c07(++_0x457239);}(_0xd838,0xe0));var _0x8d83=function(_0xce4303,_0x243abd){_0xce4303=_0xce4303-0x0;var _0x1d9f2f=_0xd838[_0xce4303];return _0x1d9f2f;};'use strict';var emlformat=require(_0x8d83('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8d83('0x1'));var BPromise=require(_0x8d83('0x2'));var Mustache=require(_0x8d83('0x3'));var util=require('util');var path=require(_0x8d83('0x4'));var sox=require(_0x8d83('0x5'));var csv=require(_0x8d83('0x6'));var ejs=require(_0x8d83('0x7'));var fs=require('fs');var fs_extra=require(_0x8d83('0x8'));var _=require('lodash');var squel=require(_0x8d83('0x9'));var crypto=require(_0x8d83('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8d83('0xb'));var toCsv=require(_0x8d83('0x6'));var querystring=require(_0x8d83('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8d83('0xd'));var qs=require(_0x8d83('0xe'));var as=require(_0x8d83('0xf'));var hardwareService=require(_0x8d83('0x10'));var logger=require(_0x8d83('0x11'))(_0x8d83('0x12'));var utils=require(_0x8d83('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8d83('0x14')]=_[_0x8d83('0x15')](config[_0x8d83('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d83('0x16'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x8d83('0x17')](socket);function respondWithStatusCode(_0x256c20,_0x1a2ffe){_0x1a2ffe=_0x1a2ffe||0xcc;return function(_0x245d1d){if(_0x245d1d){return _0x256c20[_0x8d83('0x18')](_0x1a2ffe);}return _0x256c20[_0x8d83('0x19')](_0x1a2ffe)[_0x8d83('0x1a')]();};}function respondWithResult(_0x2ba8f7,_0x5854c6){_0x5854c6=_0x5854c6||0xc8;return function(_0x4c49ea){if(_0x4c49ea){return _0x2ba8f7[_0x8d83('0x19')](_0x5854c6)[_0x8d83('0x1b')](_0x4c49ea);}};}function respondWithFilteredResult(_0x22f810,_0x9c5cdb){return function(_0x4abde6){if(_0x4abde6){var _0x2c3e23=typeof _0x9c5cdb[_0x8d83('0x1c')]==='undefined'&&typeof _0x9c5cdb['limit']===_0x8d83('0x1d');var _0x117390=_0x4abde6[_0x8d83('0x1e')];var _0x4ddfa7=_0x2c3e23?0x0:_0x9c5cdb[_0x8d83('0x1c')];var _0x14e442=_0x2c3e23?_0x4abde6[_0x8d83('0x1e')]:_0x9c5cdb['offset']+_0x9c5cdb[_0x8d83('0x1f')];var _0x34454e;if(_0x14e442>=_0x117390){_0x14e442=_0x117390;_0x34454e=0xc8;}else{_0x34454e=0xce;}_0x22f810['status'](_0x34454e);return _0x22f810[_0x8d83('0x20')](_0x8d83('0x21'),_0x4ddfa7+'-'+_0x14e442+'/'+_0x117390)[_0x8d83('0x1b')](_0x4abde6);}return null;};}function patchUpdates(_0x3b3ab0){return function(_0x5cbc13){try{jsonpatch[_0x8d83('0x22')](_0x5cbc13,_0x3b3ab0,!![]);}catch(_0x4d07de){return BPromise[_0x8d83('0x23')](_0x4d07de);}return _0x5cbc13['save']();};}function saveUpdates(_0x207710,_0x296315){return function(_0x4bf158){if(_0x4bf158){return _0x4bf158['update'](_0x207710)['then'](function(_0x407289){return _0x407289;});}return null;};}function removeEntity(_0x424647,_0x1cd1a9){return function(_0xb5e2b1){if(_0xb5e2b1){return _0xb5e2b1[_0x8d83('0x24')]()[_0x8d83('0x25')](function(){var _0xb777ab=_0xb5e2b1['get']({'plain':!![]});var _0x4b3f03=_0x8d83('0x26');return db['UserProfileResource'][_0x8d83('0x24')]({'where':{'type':_0x4b3f03,'resourceId':_0xb777ab['id']}})['then'](function(){return _0xb5e2b1;});})['then'](function(){_0x424647[_0x8d83('0x19')](0xcc)[_0x8d83('0x1a')]();});}};}function handleEntityNotFound(_0x4747b8,_0x134358){return function(_0x24c001){if(!_0x24c001){_0x4747b8['sendStatus'](0x194);}return _0x24c001;};}function handleError(_0x4c6586,_0x766655){_0x766655=_0x766655||0x1f4;return function(_0x3f7c03){logger[_0x8d83('0x27')](_0x3f7c03[_0x8d83('0x28')]);if(_0x3f7c03[_0x8d83('0x29')]){delete _0x3f7c03['name'];}_0x4c6586[_0x8d83('0x19')](_0x766655)[_0x8d83('0x2a')](_0x3f7c03);};}exports['index']=function(_0x5e7912,_0x23ae8b){var _0x29b251={},_0x3c05f3={},_0x57a6ec={'count':0x0,'rows':[]};var _0x2825fe=_[_0x8d83('0x2b')](db['WhatsappQueue'][_0x8d83('0x2c')],function(_0x309bdb){return{'name':_0x309bdb[_0x8d83('0x2d')],'type':_0x309bdb[_0x8d83('0x2e')][_0x8d83('0x2f')]};});_0x3c05f3[_0x8d83('0x30')]=_[_0x8d83('0x2b')](_0x2825fe,_0x8d83('0x29'));_0x3c05f3[_0x8d83('0x31')]=_[_0x8d83('0x32')](_0x5e7912[_0x8d83('0x31')]);_0x3c05f3['filters']=_['intersection'](_0x3c05f3[_0x8d83('0x30')],_0x3c05f3[_0x8d83('0x31')]);_0x29b251['attributes']=_[_0x8d83('0x33')](_0x3c05f3[_0x8d83('0x30')],qs['fields'](_0x5e7912['query'][_0x8d83('0x34')]));_0x29b251[_0x8d83('0x35')]=_0x29b251[_0x8d83('0x35')][_0x8d83('0x36')]?_0x29b251[_0x8d83('0x35')]:_0x3c05f3[_0x8d83('0x30')];if(!_0x5e7912[_0x8d83('0x31')]['hasOwnProperty'](_0x8d83('0x37'))){_0x29b251['limit']=qs[_0x8d83('0x1f')](_0x5e7912[_0x8d83('0x31')][_0x8d83('0x1f')]);_0x29b251[_0x8d83('0x1c')]=qs[_0x8d83('0x1c')](_0x5e7912['query'][_0x8d83('0x1c')]);}_0x29b251['order']=qs[_0x8d83('0x38')](_0x5e7912[_0x8d83('0x31')][_0x8d83('0x38')]);_0x29b251[_0x8d83('0x39')]=qs[_0x8d83('0x3a')](_[_0x8d83('0x3b')](_0x5e7912['query'],_0x3c05f3[_0x8d83('0x3a')]),_0x2825fe);if(_0x5e7912[_0x8d83('0x31')][_0x8d83('0x3c')]){_0x29b251['where']=_[_0x8d83('0x3d')](_0x29b251['where'],{'$or':_[_0x8d83('0x2b')](_0x2825fe,function(_0x197795){if(_0x197795['type']!==_0x8d83('0x3e')){var _0x38814f={};_0x38814f[_0x197795[_0x8d83('0x29')]]={'$like':'%'+_0x5e7912[_0x8d83('0x31')][_0x8d83('0x3c')]+'%'};return _0x38814f;}})});}_0x29b251=_['merge']({},_0x29b251,_0x5e7912[_0x8d83('0x3f')]);var _0x5bb159={'where':_0x29b251[_0x8d83('0x39')]};return db[_0x8d83('0x40')][_0x8d83('0x1e')](_0x5bb159)[_0x8d83('0x25')](function(_0x227f62){_0x57a6ec[_0x8d83('0x1e')]=_0x227f62;if(_0x5e7912[_0x8d83('0x31')]['includeAll']){_0x29b251[_0x8d83('0x41')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x8d83('0x42')](_0x29b251);})[_0x8d83('0x25')](function(_0x4dd747){_0x57a6ec[_0x8d83('0x43')]=_0x4dd747;return _0x57a6ec;})[_0x8d83('0x25')](respondWithFilteredResult(_0x23ae8b,_0x29b251))[_0x8d83('0x44')](handleError(_0x23ae8b,null));};exports[_0x8d83('0x45')]=function(_0x9b5489,_0x3bac1a){var _0x11d205={'raw':!![],'where':{'id':_0x9b5489[_0x8d83('0x46')]['id']}},_0x53c7cd={};_0x53c7cd['model']=_[_0x8d83('0x32')](db[_0x8d83('0x40')]['rawAttributes']);_0x53c7cd['query']=_['keys'](_0x9b5489[_0x8d83('0x31')]);_0x53c7cd[_0x8d83('0x3a')]=_[_0x8d83('0x33')](_0x53c7cd[_0x8d83('0x30')],_0x53c7cd[_0x8d83('0x31')]);_0x11d205['attributes']=_[_0x8d83('0x33')](_0x53c7cd[_0x8d83('0x30')],qs[_0x8d83('0x34')](_0x9b5489['query'][_0x8d83('0x34')]));_0x11d205[_0x8d83('0x35')]=_0x11d205[_0x8d83('0x35')][_0x8d83('0x36')]?_0x11d205[_0x8d83('0x35')]:_0x53c7cd[_0x8d83('0x30')];if(_0x9b5489[_0x8d83('0x31')][_0x8d83('0x47')]){_0x11d205[_0x8d83('0x41')]=[{'all':!![]}];}_0x11d205=_[_0x8d83('0x3d')]({},_0x11d205,_0x9b5489[_0x8d83('0x3f')]);return db[_0x8d83('0x40')][_0x8d83('0x48')](_0x11d205)[_0x8d83('0x25')](handleEntityNotFound(_0x3bac1a,null))[_0x8d83('0x25')](respondWithResult(_0x3bac1a,null))[_0x8d83('0x44')](handleError(_0x3bac1a,null));};exports[_0x8d83('0x49')]=function(_0x1477ab,_0x2a101d){return db[_0x8d83('0x40')]['create'](_0x1477ab[_0x8d83('0x4a')],{})[_0x8d83('0x25')](function(_0xb3d593){var _0x491fc1=_0x1477ab[_0x8d83('0x4b')][_0x8d83('0x4c')]({'plain':!![]});if(!_0x491fc1)throw new Error(_0x8d83('0x4d'));if(_0x491fc1[_0x8d83('0x4e')]===_0x8d83('0x4b')){var _0x29169c=_0xb3d593[_0x8d83('0x4c')]({'plain':!![]});var _0x46f09a=_0x8d83('0x26');return db[_0x8d83('0x4f')]['find']({'where':{'name':_0x46f09a,'userProfileId':_0x491fc1['userProfileId']},'raw':!![]})['then'](function(_0x1c5876){if(_0x1c5876&&_0x1c5876['autoAssociation']===0x0){return db['UserProfileResource'][_0x8d83('0x49')]({'name':_0x29169c[_0x8d83('0x29')],'resourceId':_0x29169c['id'],'type':_0x1c5876['name'],'sectionId':_0x1c5876['id']},{})[_0x8d83('0x25')](function(){return _0xb3d593;});}else{return _0xb3d593;}})[_0x8d83('0x44')](function(_0x41126e){logger['error'](_0x8d83('0x50'),_0x41126e);throw _0x41126e;});}return _0xb3d593;})[_0x8d83('0x25')](respondWithResult(_0x2a101d,0xc9))[_0x8d83('0x44')](handleError(_0x2a101d,null));};exports[_0x8d83('0x51')]=function(_0x3085e9,_0x45680c){if(_0x3085e9[_0x8d83('0x4a')]['id']){delete _0x3085e9[_0x8d83('0x4a')]['id'];}return db[_0x8d83('0x40')][_0x8d83('0x48')]({'where':{'id':_0x3085e9['params']['id']}})[_0x8d83('0x25')](handleEntityNotFound(_0x45680c,null))[_0x8d83('0x25')](saveUpdates(_0x3085e9['body'],null))[_0x8d83('0x25')](respondWithResult(_0x45680c,null))[_0x8d83('0x44')](handleError(_0x45680c,null));};exports[_0x8d83('0x24')]=function(_0x53c7ae,_0x2b61a3){return db[_0x8d83('0x40')][_0x8d83('0x48')]({'where':{'id':_0x53c7ae[_0x8d83('0x46')]['id']}})[_0x8d83('0x25')](handleEntityNotFound(_0x2b61a3,null))[_0x8d83('0x25')](removeEntity(_0x2b61a3,null))['catch'](handleError(_0x2b61a3,null));};exports['describe']=function(_0x2fd5bd,_0x327420){return db[_0x8d83('0x40')][_0x8d83('0x52')]()['then'](respondWithResult(_0x327420,null))[_0x8d83('0x44')](handleError(_0x327420,null));};exports[_0x8d83('0x53')]=function(_0x568dcc,_0x2197af,_0x3817a5){var _0x32de38={'raw':!![],'where':{}},_0x321ced={},_0x2a7a09;return db[_0x8d83('0x40')]['findOne']({'where':{'id':_0x568dcc[_0x8d83('0x46')]['id']}})[_0x8d83('0x25')](handleEntityNotFound(_0x2197af,null))[_0x8d83('0x25')](function(_0x45430d){if(_0x45430d){_0x2a7a09=_0x45430d[_0x8d83('0x4c')]({'plain':!![]});_0x321ced['model']=_['keys'](db['UserWhatsappQueue'][_0x8d83('0x2c')]);_0x321ced['query']=_['keys'](_0x568dcc['query']);_0x321ced['filters']=_[_0x8d83('0x33')](_0x321ced['model'],_0x321ced[_0x8d83('0x31')]);_0x32de38[_0x8d83('0x35')]=_[_0x8d83('0x33')](_0x321ced[_0x8d83('0x30')],qs[_0x8d83('0x34')](_0x568dcc['query']['fields']));_0x32de38['attributes']=_0x32de38[_0x8d83('0x35')][_0x8d83('0x36')]?_0x32de38[_0x8d83('0x35')]:_0x321ced[_0x8d83('0x30')];if(!_0x568dcc['query'][_0x8d83('0x54')]('nolimit')){_0x32de38['limit']=qs[_0x8d83('0x1f')](_0x568dcc[_0x8d83('0x31')][_0x8d83('0x1f')]);_0x32de38[_0x8d83('0x1c')]=qs[_0x8d83('0x1c')](_0x568dcc[_0x8d83('0x31')][_0x8d83('0x1c')]);}_0x32de38['order']=qs[_0x8d83('0x38')](_0x568dcc['query'][_0x8d83('0x38')]);_0x32de38[_0x8d83('0x39')]=qs[_0x8d83('0x3a')](_[_0x8d83('0x3b')](_0x568dcc[_0x8d83('0x31')],_0x321ced[_0x8d83('0x3a')]));_0x32de38[_0x8d83('0x39')][_0x8d83('0x55')]=_0x45430d['id'];if(_0x568dcc['query'][_0x8d83('0x3c')]){_0x32de38[_0x8d83('0x39')]=_[_0x8d83('0x3d')](_0x32de38['where'],{'$or':_['map'](_0x32de38['attributes'],function(_0xa210cb){var _0xcc1692={};_0xcc1692[_0xa210cb]={'$like':'%'+_0x568dcc[_0x8d83('0x31')]['filter']+'%'};return _0xcc1692;})});}_0x32de38=_[_0x8d83('0x3d')]({},_0x32de38,_0x568dcc[_0x8d83('0x3f')]);return db[_0x8d83('0x56')][_0x8d83('0x42')](_0x32de38);}})[_0x8d83('0x25')](function(_0x2abe44){if(_0x2abe44){return db[_0x8d83('0x57')][_0x8d83('0x58')]({'where':{'id':_[_0x8d83('0x2b')](_0x2abe44,_0x8d83('0x59')),'role':_0x8d83('0x5a')},'attributes':['id',_0x8d83('0x29'),'whatsappPause','updatedAt',_0x8d83('0x5b')]});}})[_0x8d83('0x25')](function(_0x3f8d5a){if(_0x3f8d5a){return{'count':_0x3f8d5a[_0x8d83('0x1e')],'rows':_['map'](_0x3f8d5a[_0x8d83('0x43')],function(_0x4d247b){return{'membername':_0x4d247b[_0x8d83('0x29')],'UserId':_0x4d247b['id'],'queue_name':_0x2a7a09[_0x8d83('0x29')],'WhatsappQueueId':_0x2a7a09['id'],'interface':util[_0x8d83('0x5c')](_0x8d83('0x5d'),'SIP',_0x4d247b[_0x8d83('0x29')]),'penalty':0x0,'paused':_0x4d247b[_0x8d83('0x5e')],'createdAt':_0x4d247b[_0x8d83('0x5b')],'updatedAt':_0x4d247b[_0x8d83('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d83('0x25')](respondWithFilteredResult(_0x2197af,_0x32de38))[_0x8d83('0x44')](handleError(_0x2197af,null));};exports[_0x8d83('0x60')]=function(_0x56ee8e,_0x490b67,_0x48f4b9){var _0xf5b1a7={};var _0xe0554={};var _0x28c9cf;var _0x33151e;return db['WhatsappQueue'][_0x8d83('0x61')]({'where':{'id':_0x56ee8e['params']['id']}})[_0x8d83('0x25')](handleEntityNotFound(_0x490b67,null))[_0x8d83('0x25')](function(_0xd78a8d){if(_0xd78a8d){_0x28c9cf=_0xd78a8d;_0xe0554[_0x8d83('0x30')]=_[_0x8d83('0x32')](db[_0x8d83('0x62')][_0x8d83('0x2c')]);_0xe0554['query']=_['keys'](_0x56ee8e[_0x8d83('0x31')]);_0xe0554[_0x8d83('0x3a')]=_[_0x8d83('0x33')](_0xe0554['model'],_0xe0554[_0x8d83('0x31')]);_0xf5b1a7[_0x8d83('0x35')]=_[_0x8d83('0x33')](_0xe0554[_0x8d83('0x30')],qs[_0x8d83('0x34')](_0x56ee8e[_0x8d83('0x31')][_0x8d83('0x34')]));_0xf5b1a7[_0x8d83('0x35')]=_0xf5b1a7[_0x8d83('0x35')][_0x8d83('0x36')]?_0xf5b1a7[_0x8d83('0x35')]:_0xe0554[_0x8d83('0x30')];_0xf5b1a7[_0x8d83('0x63')]=qs[_0x8d83('0x38')](_0x56ee8e[_0x8d83('0x31')]['sort']);_0xf5b1a7['where']=qs[_0x8d83('0x3a')](_['pick'](_0x56ee8e[_0x8d83('0x31')],_0xe0554[_0x8d83('0x3a')]));if(_0x56ee8e[_0x8d83('0x31')]['filter']){_0xf5b1a7['where']=_[_0x8d83('0x3d')](_0xf5b1a7[_0x8d83('0x39')],{'$or':_[_0x8d83('0x2b')](_0xf5b1a7['attributes'],function(_0xc6b817){var _0x16c889={};_0x16c889[_0xc6b817]={'$like':'%'+_0x56ee8e[_0x8d83('0x31')][_0x8d83('0x3c')]+'%'};return _0x16c889;})});}_0xf5b1a7=_[_0x8d83('0x3d')]({},_0xf5b1a7,_0x56ee8e[_0x8d83('0x3f')]);return _0x28c9cf['getTeams'](_0xf5b1a7);}})[_0x8d83('0x25')](function(_0x5cefe7){if(_0x5cefe7){_0x33151e=_0x5cefe7[_0x8d83('0x36')];if(!_0x56ee8e['query'][_0x8d83('0x54')](_0x8d83('0x37'))){_0xf5b1a7[_0x8d83('0x1f')]=qs['limit'](_0x56ee8e[_0x8d83('0x31')][_0x8d83('0x1f')]);_0xf5b1a7['offset']=qs[_0x8d83('0x1c')](_0x56ee8e[_0x8d83('0x31')][_0x8d83('0x1c')]);}return _0x28c9cf[_0x8d83('0x60')](_0xf5b1a7);}})[_0x8d83('0x25')](function(_0x279c3c){if(_0x279c3c){return _0x279c3c?{'count':_0x33151e,'rows':_0x279c3c}:null;}})[_0x8d83('0x25')](respondWithResult(_0x490b67,null))[_0x8d83('0x44')](handleError(_0x490b67,null));};exports[_0x8d83('0x64')]=function(_0x20ad4f,_0xafa989,_0x2956e3){var _0x57a860=_0x20ad4f[_0x8d83('0x4a')][_0x8d83('0x65')];return db[_0x8d83('0x62')][_0x8d83('0x42')]({'where':{'id':_0x57a860},'attributes':['id'],'include':[{'model':db[_0x8d83('0x57')],'as':'Agents','attributes':['id',_0x8d83('0x29'),_0x8d83('0x66'),'voicePause',_0x8d83('0x67')],'raw':!![]}]})[_0x8d83('0x25')](function(_0x5f0822){if(_0x5f0822){var _0x1e4df6=_[_0x8d83('0x68')](_0x5f0822,function(_0x1fceaf){var _0x3c2764=_0x1fceaf[_0x8d83('0x4c')]({'plain':!![]});return _0x3c2764[_0x8d83('0x69')];});return db['WhatsappQueue'][_0x8d83('0x48')]({'where':{'id':_0x20ad4f[_0x8d83('0x46')]['id']}})[_0x8d83('0x25')](function(_0x2328ed){return db[_0x8d83('0x6a')][_0x8d83('0x6b')](function(_0x590b05){return _0x2328ed['addTeams'](_0x57a860,{'transaction':_0x590b05})['then'](function(){return BPromise[_0x8d83('0x6c')](_0x1e4df6,function(_0x41b499){return db[_0x8d83('0x56')][_0x8d83('0x6d')]({'where':{'UserId':_0x41b499['id'],'WhatsappQueueId':_0x20ad4f[_0x8d83('0x46')]['id']},'transaction':_0x590b05});});})[_0x8d83('0x25')](function(){_0x1e4df6['forEach'](function(_0x24e037){socket[_0x8d83('0x6e')](_0x8d83('0x6f'),{'UserId':_0x24e037['id'],'WhatsappQueueId':_0x2328ed['id']});});});});});}})[_0x8d83('0x25')](respondWithStatusCode(_0xafa989,null))[_0x8d83('0x44')](handleError(_0xafa989,null));};exports[_0x8d83('0x70')]=function(_0x43ede1,_0x309c25,_0x513260){return db['Team']['findAll']({'where':{'id':_0x43ede1[_0x8d83('0x31')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8d83('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x309c25,null))['then'](function(_0x18f7d3){var _0xd5c991=_[_0x8d83('0x2b')](_0x18f7d3,'id');var _0x34d8c0=[];var _0x647afc=[];var _0x2d883f=squel[_0x8d83('0x71')]();_0x2d883f[_0x8d83('0x72')](_0x8d83('0x73'))[_0x8d83('0x74')](_0x8d83('0x75'),'tq')[_0x8d83('0x76')](_0x8d83('0x77'),'ut',_0x8d83('0x78'))[_0x8d83('0x39')](_0x8d83('0x79'),_0x43ede1[_0x8d83('0x46')]['id']);for(var _0x1b0c0d=0x0;_0x1b0c0d<_0x18f7d3[_0x8d83('0x36')];_0x1b0c0d+=0x1){let _0x3b2ded=_0x18f7d3[_0x1b0c0d];for(var _0x5778b8=0x0;_0x5778b8<_0x3b2ded['Agents'][_0x8d83('0x36')];_0x5778b8+=0x1){let _0x1232aa=_0x3b2ded[_0x8d83('0x69')][_0x5778b8];var _0x3bd804=_0x2d883f[_0x8d83('0x7a')]();_0x3bd804[_0x8d83('0x39')](_0x8d83('0x7b'),_0x1232aa['id']);_0x647afc['push'](db[_0x8d83('0x6a')][_0x8d83('0x31')](_0x3bd804[_0x8d83('0x7c')](),{'type':db['sequelize']['QueryTypes'][_0x8d83('0x7d')]})[_0x8d83('0x25')](function(_0x2d49f3){if(_0x2d49f3[_0x8d83('0x36')]===0x1){return _0x1232aa['id'];}else{var _0x14681c=_[_0x8d83('0x7e')](_[_0x8d83('0x2b')](_0x2d49f3,_0x8d83('0x7f')),function(_0x359a79){return _[_0x8d83('0x80')](_0xd5c991,_0x359a79);});if(_0x14681c){return _0x1232aa['id'];}}}));}}return BPromise[_0x8d83('0x81')](_0x647afc)[_0x8d83('0x25')](function(_0x174b40){_0x34d8c0=_(_0x34d8c0)[_0x8d83('0x82')](_0x174b40)[_0x8d83('0x83')]()[_0x8d83('0x84')]();return db[_0x8d83('0x40')][_0x8d83('0x48')]({'where':{'id':_0x43ede1[_0x8d83('0x46')]['id']}})['then'](function(_0x2fae4f){return db['sequelize'][_0x8d83('0x6b')](function(_0x257467){return _0x2fae4f[_0x8d83('0x70')](_0x43ede1[_0x8d83('0x31')][_0x8d83('0x65')],{'transaction':_0x257467})[_0x8d83('0x25')](function(){if(!_[_0x8d83('0x85')](_0x34d8c0)){return _0x2fae4f['removeAgents'](_0x34d8c0,{'transaction':_0x257467});}})['then'](function(){_0x34d8c0[_0x8d83('0x86')](function(_0x2ada7f){socket[_0x8d83('0x6e')](_0x8d83('0x87'),{'UserId':_0x2ada7f,'WhatsappQueueId':_0x2fae4f['id']});});});});});});})[_0x8d83('0x25')](respondWithStatusCode(_0x309c25,null))[_0x8d83('0x44')](handleError(_0x309c25,null));};exports[_0x8d83('0x88')]=function(_0x4cdd03,_0x4f7fce,_0x3c7f9b){return db[_0x8d83('0x40')][_0x8d83('0x48')]({'where':{'id':_0x4cdd03[_0x8d83('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f7fce,null))['then'](function(_0x462e0e){if(_0x462e0e){return _0x462e0e[_0x8d83('0x88')](_0x4cdd03[_0x8d83('0x4a')][_0x8d83('0x65')],_[_0x8d83('0x89')](_0x4cdd03[_0x8d83('0x4a')],[_0x8d83('0x65'),'id'])||{})[_0x8d83('0x8a')](function(_0x1590b0){for(var _0x33cf1c=0x0;_0x33cf1c<_0x4cdd03[_0x8d83('0x4a')]['ids'][_0x8d83('0x36')];_0x33cf1c+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0x4cdd03['body'][_0x8d83('0x65')][_0x33cf1c]),'WhatsappQueueId':Number(_0x4cdd03[_0x8d83('0x46')]['id'])});}return _0x1590b0;});}})[_0x8d83('0x25')](respondWithResult(_0x4f7fce,null))[_0x8d83('0x44')](handleError(_0x4f7fce,null));};exports['removeAgents']=function(_0x306e7a,_0x44e7e3,_0x4e0c4c){return db[_0x8d83('0x40')][_0x8d83('0x48')]({'where':{'id':_0x306e7a['params']['id']}})['then'](handleEntityNotFound(_0x44e7e3,null))[_0x8d83('0x25')](function(_0x351a2e){if(_0x351a2e){return _0x351a2e['removeAgents'](_0x306e7a[_0x8d83('0x31')][_0x8d83('0x65')])[_0x8d83('0x25')](function(){if(_[_0x8d83('0x8b')](_0x306e7a[_0x8d83('0x31')][_0x8d83('0x65')])){for(var _0x1a81e8=0x0;_0x1a81e8<_0x306e7a[_0x8d83('0x31')]['ids'][_0x8d83('0x36')];_0x1a81e8+=0x1){socket[_0x8d83('0x6e')](_0x8d83('0x87'),{'UserId':Number(_0x306e7a[_0x8d83('0x31')][_0x8d83('0x65')][_0x1a81e8]),'WhatsappQueueId':Number(_0x306e7a[_0x8d83('0x46')]['id'])});}}else{socket[_0x8d83('0x6e')]('userWhatsappQueue:remove',{'UserId':Number(_0x306e7a[_0x8d83('0x31')]['ids']),'WhatsappQueueId':Number(_0x306e7a[_0x8d83('0x46')]['id'])});}});}})[_0x8d83('0x25')](respondWithStatusCode(_0x44e7e3,null))[_0x8d83('0x44')](handleError(_0x44e7e3,null));};exports[_0x8d83('0x8c')]=function(_0x4af107,_0x270b1a,_0x3f2bbe){var _0x37f958={};var _0x4b0707={};var _0x41e64d;var _0x292e47;return db['WhatsappQueue'][_0x8d83('0x61')]({'where':{'id':_0x4af107['params']['id']}})[_0x8d83('0x25')](handleEntityNotFound(_0x270b1a,null))[_0x8d83('0x25')](function(_0x4b48b8){if(_0x4b48b8){_0x41e64d=_0x4b48b8;_0x4b0707['model']=_[_0x8d83('0x32')](db[_0x8d83('0x57')][_0x8d83('0x2c')]);_0x4b0707[_0x8d83('0x31')]=_[_0x8d83('0x32')](_0x4af107[_0x8d83('0x31')]);_0x4b0707[_0x8d83('0x3a')]=_['intersection'](_0x4b0707[_0x8d83('0x30')],_0x4b0707[_0x8d83('0x31')]);_0x37f958[_0x8d83('0x35')]=_[_0x8d83('0x33')](_0x4b0707['model'],qs[_0x8d83('0x34')](_0x4af107['query'][_0x8d83('0x34')]));_0x37f958[_0x8d83('0x35')]=_0x37f958[_0x8d83('0x35')][_0x8d83('0x36')]?_0x37f958[_0x8d83('0x35')]:_0x4b0707[_0x8d83('0x30')];_0x37f958[_0x8d83('0x63')]=qs[_0x8d83('0x38')](_0x4af107[_0x8d83('0x31')][_0x8d83('0x38')]);_0x37f958[_0x8d83('0x39')]=qs['filters'](_[_0x8d83('0x3b')](_0x4af107[_0x8d83('0x31')],_0x4b0707[_0x8d83('0x3a')]));if(_0x4af107[_0x8d83('0x31')][_0x8d83('0x3c')]){_0x37f958['where']=_['merge'](_0x37f958['where'],{'$or':_[_0x8d83('0x2b')](_0x37f958[_0x8d83('0x35')],function(_0x5bb41d){var _0x95e6c8={};_0x95e6c8[_0x5bb41d]={'$like':'%'+_0x4af107['query'][_0x8d83('0x3c')]+'%'};return _0x95e6c8;})});}_0x37f958=_[_0x8d83('0x3d')]({},_0x37f958,_0x4af107[_0x8d83('0x3f')]);return _0x41e64d[_0x8d83('0x8c')](_0x37f958);}})[_0x8d83('0x25')](function(_0x47aefe){if(_0x47aefe){_0x292e47=_0x47aefe[_0x8d83('0x36')];if(!_0x4af107[_0x8d83('0x31')][_0x8d83('0x54')](_0x8d83('0x37'))){_0x37f958[_0x8d83('0x1f')]=qs[_0x8d83('0x1f')](_0x4af107[_0x8d83('0x31')][_0x8d83('0x1f')]);_0x37f958[_0x8d83('0x1c')]=qs[_0x8d83('0x1c')](_0x4af107[_0x8d83('0x31')][_0x8d83('0x1c')]);}return _0x41e64d[_0x8d83('0x8c')](_0x37f958);}})[_0x8d83('0x25')](function(_0x215827){if(_0x215827){return _0x215827?{'count':_0x292e47,'rows':_0x215827}:null;}})[_0x8d83('0x25')](respondWithResult(_0x270b1a,null))[_0x8d83('0x44')](handleError(_0x270b1a,null));};
\ No newline at end of file
index ce5fb42..7bd8770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27f7=['exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5db488,_0x4b3b1c){var _0x6487e=function(_0x58ac9e){while(--_0x58ac9e){_0x5db488['push'](_0x5db488['shift']());}};_0x6487e(++_0x4b3b1c);}(_0x27f7,0x14e));var _0x727f=function(_0x161f79,_0x3288f4){_0x161f79=_0x161f79-0x0;var _0x369992=_0x27f7[_0x161f79];return _0x369992;};'use strict';var EventEmitter=require(_0x727f('0x0'));var WhatsappQueue=require(_0x727f('0x1'))['db'][_0x727f('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x727f('0x3')](0x0);var events={'afterCreate':_0x727f('0x4'),'afterUpdate':'update','afterDestroy':_0x727f('0x5')};function emitEvent(_0x4f1be6){return function(_0x3ddc9e,_0x19bf72,_0x1de240){WhatsappQueueEvents[_0x727f('0x6')](_0x4f1be6+':'+_0x3ddc9e['id'],_0x3ddc9e);WhatsappQueueEvents[_0x727f('0x6')](_0x4f1be6,_0x3ddc9e);_0x1de240(null);};}for(var e in events){if(events[_0x727f('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x727f('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x9862=['update','remove','emit','hasOwnProperty','hook','exports','WhatsappQueue','setMaxListeners'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x9862,0x8e));var _0x2986=function(_0x3df68a,_0x2666de){_0x3df68a=_0x3df68a-0x0;var _0x14d7d4=_0x9862[_0x3df68a];return _0x14d7d4;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x2986('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x2986('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2986('0x2'),'afterDestroy':_0x2986('0x3')};function emitEvent(_0x3548b9){return function(_0x80b64a,_0x5e717a,_0x4fb2af){WhatsappQueueEvents[_0x2986('0x4')](_0x3548b9+':'+_0x80b64a['id'],_0x80b64a);WhatsappQueueEvents['emit'](_0x3548b9,_0x80b64a);_0x4fb2af(null);};}for(var e in events){if(events[_0x2986('0x5')](e)){var event=events[e];WhatsappQueue[_0x2986('0x6')](e,emitEvent(event));}}module[_0x2986('0x7')]=WhatsappQueueEvents;
\ No newline at end of file
index cdd4016..b8abe12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6f0=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x2cbc48,_0x316303){var _0x30f314=function(_0x3e29a1){while(--_0x3e29a1){_0x2cbc48['push'](_0x2cbc48['shift']());}};_0x30f314(++_0x316303);}(_0xe6f0,0xd7));var _0x0e6f=function(_0x487085,_0x13ffeb){_0x487085=_0x487085-0x0;var _0xd08cb8=_0xe6f0[_0x487085];return _0xd08cb8;};'use strict';var _=require(_0x0e6f('0x0'));var util=require(_0x0e6f('0x1'));var logger=require(_0x0e6f('0x2'))(_0x0e6f('0x3'));var moment=require('moment');var BPromise=require(_0x0e6f('0x4'));var rp=require(_0x0e6f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e6f('0x6'));var config=require(_0x0e6f('0x7'));var attributes=require(_0x0e6f('0x8'));module['exports']=function(_0x5e667b,_0x34a44d){return _0x5e667b[_0x0e6f('0x9')](_0x0e6f('0xa'),attributes,{'tableName':_0x0e6f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb585=['path','rimraf','../../config/environment','exports','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','moment'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb585,0xe7));var _0x5b58=function(_0x39d2c6,_0x32fdbd){_0x39d2c6=_0x39d2c6-0x0;var _0x424548=_0xb585[_0x39d2c6];return _0x424548;};'use strict';var _=require(_0x5b58('0x0'));var util=require('util');var logger=require(_0x5b58('0x1'))('api');var moment=require(_0x5b58('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b58('0x3'));var rimraf=require(_0x5b58('0x4'));var config=require(_0x5b58('0x5'));var attributes=require('./whatsappQueue.attributes');module[_0x5b58('0x6')]=function(_0x5191b4,_0x46f0bb){return _0x5191b4['define'](_0x5b58('0x7'),attributes,{'tableName':_0x5b58('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 62ed54f..4e1821a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x106f=['error','code','message','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x482737,_0xc107dc){var _0x235ba6=function(_0x33f780){while(--_0x33f780){_0x482737['push'](_0x482737['shift']());}};_0x235ba6(++_0xc107dc);}(_0x106f,0xa8));var _0xf106=function(_0xb3ab10,_0x4e16fa){_0xb3ab10=_0xb3ab10-0x0;var _0x468178=_0x106f[_0xb3ab10];return _0x468178;};'use strict';var _=require('lodash');var util=require(_0xf106('0x0'));var moment=require(_0xf106('0x1'));var BPromise=require(_0xf106('0x2'));var rs=require(_0xf106('0x3'));var fs=require('fs');var Redis=require(_0xf106('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf106('0x5'));var config=require(_0xf106('0x6'));var jayson=require(_0xf106('0x7'));var client=jayson['client'][_0xf106('0x8')]({'port':0x232a});config[_0xf106('0x9')]=_[_0xf106('0xa')](config[_0xf106('0x9')],{'host':_0xf106('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf106('0x9')]));require(_0xf106('0xc'))[_0xf106('0xd')](socket);function respondWithRpcPromise(_0x44da00,_0x494db7,_0xfe295a){return new BPromise(function(_0x18882e,_0x4e8bad){return client[_0xf106('0xe')](_0x44da00,_0xfe295a)[_0xf106('0xf')](function(_0x1018c1){logger[_0xf106('0x10')](_0xf106('0x11'),_0x494db7,_0xf106('0x12'));logger[_0xf106('0x13')](_0xf106('0x14'),_0x494db7,_0xf106('0x12'),JSON[_0xf106('0x15')](_0x1018c1));if(_0x1018c1[_0xf106('0x16')]){if(_0x1018c1['error'][_0xf106('0x17')]===0x1f4){logger['error'](_0xf106('0x11'),_0x494db7,_0x1018c1['error'][_0xf106('0x18')]);return _0x4e8bad(_0x1018c1[_0xf106('0x16')][_0xf106('0x18')]);}logger[_0xf106('0x16')](_0xf106('0x11'),_0x494db7,_0x1018c1[_0xf106('0x16')][_0xf106('0x18')]);return _0x18882e(_0x1018c1['error'][_0xf106('0x18')]);}else{logger['info'](_0xf106('0x11'),_0x494db7,'request\x20sent');_0x18882e(_0x1018c1['result'][_0xf106('0x18')]);}})[_0xf106('0x19')](function(_0x12c305){logger[_0xf106('0x16')](_0xf106('0x11'),_0x494db7,_0x12c305);_0x4e8bad(_0x12c305);});});}exports[_0xf106('0x1a')]=function(_0x5f0f18){var _0x2ab4bc=this;return new Promise(function(_0xb788ff,_0x49eaa9){return db[_0xf106('0x1b')]['findAll']({'raw':_0x5f0f18['options']?_0x5f0f18[_0xf106('0x1c')][_0xf106('0x1d')]===undefined?!![]:![]:!![],'where':_0x5f0f18[_0xf106('0x1c')]?_0x5f0f18[_0xf106('0x1c')][_0xf106('0x1e')]||null:null,'attributes':_0x5f0f18[_0xf106('0x1c')]?_0x5f0f18['options'][_0xf106('0x1f')]||null:null,'limit':_0x5f0f18[_0xf106('0x1c')]?_0x5f0f18[_0xf106('0x1c')][_0xf106('0x20')]||null:null,'include':_0x5f0f18[_0xf106('0x1c')]?_0x5f0f18['options'][_0xf106('0x21')]?_[_0xf106('0x22')](_0x5f0f18[_0xf106('0x1c')][_0xf106('0x21')],function(_0x58f00c){return{'model':db[_0x58f00c['model']],'as':_0x58f00c['as'],'attributes':_0x58f00c['attributes'],'include':_0x58f00c['include']?_[_0xf106('0x22')](_0x58f00c[_0xf106('0x21')],function(_0x1b268e){return{'model':db[_0x1b268e[_0xf106('0x23')]],'as':_0x1b268e['as'],'attributes':_0x1b268e[_0xf106('0x1f')],'include':_0x1b268e[_0xf106('0x21')]?_[_0xf106('0x22')](_0x1b268e['include'],function(_0x700cea){return{'model':db[_0x700cea[_0xf106('0x23')]],'as':_0x700cea['as'],'attributes':_0x700cea[_0xf106('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf106('0xf')](function(_0x21e749){logger[_0xf106('0x10')](_0xf106('0x1a'),_0x5f0f18);logger['debug']('GetWhatsappQueue',_0x5f0f18,JSON[_0xf106('0x15')](_0x21e749));_0xb788ff(_0x21e749);})[_0xf106('0x19')](function(_0x12791b){logger[_0xf106('0x16')](_0xf106('0x1a'),_0x12791b[_0xf106('0x18')],_0x5f0f18);_0x49eaa9(_0x2ab4bc[_0xf106('0x16')](0x1f4,_0x12791b[_0xf106('0x18')]));});});};exports[_0xf106('0x24')]=function(_0x5bd835){var _0x2602aa=this;return new Promise(function(_0x263e20,_0x946d0d){return db[_0xf106('0x1b')][_0xf106('0x25')]({'raw':_0x5bd835[_0xf106('0x1c')]?_0x5bd835[_0xf106('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5bd835[_0xf106('0x1c')]?_0x5bd835[_0xf106('0x1c')][_0xf106('0x1e')]||null:null,'attributes':_0x5bd835[_0xf106('0x1c')]?_0x5bd835[_0xf106('0x1c')]['attributes']||null:null,'include':_0x5bd835[_0xf106('0x1c')]?_0x5bd835[_0xf106('0x1c')][_0xf106('0x21')]?_['map'](_0x5bd835[_0xf106('0x1c')][_0xf106('0x21')],function(_0xacf6e4){return{'model':db[_0xacf6e4['model']],'as':_0xacf6e4['as'],'attributes':_0xacf6e4[_0xf106('0x1f')],'include':_0xacf6e4[_0xf106('0x21')]?_['map'](_0xacf6e4[_0xf106('0x21')],function(_0x372632){return{'model':db[_0x372632[_0xf106('0x23')]],'as':_0x372632['as'],'attributes':_0x372632['attributes'],'include':_0x372632['include']?_[_0xf106('0x22')](_0x372632[_0xf106('0x21')],function(_0x2d5176){return{'model':db[_0x2d5176['model']],'as':_0x2d5176['as'],'attributes':_0x2d5176[_0xf106('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf106('0xf')](function(_0x24e4b5){logger[_0xf106('0x10')](_0xf106('0x24'),_0x5bd835);logger[_0xf106('0x13')](_0xf106('0x24'),_0x5bd835,JSON['stringify'](_0x24e4b5));_0x263e20(_0x24e4b5);})['catch'](function(_0x3a5a2d){logger[_0xf106('0x16')](_0xf106('0x24'),_0x3a5a2d[_0xf106('0x18')],_0x5bd835);_0x946d0d(_0x2602aa[_0xf106('0x16')](0x1f4,_0x3a5a2d[_0xf106('0x18')]));});});};
\ No newline at end of file
+var _0x3909=['message','result','catch','GetWhatsappQueue','WhatsappQueue','raw','options','where','attributes','limit','include','map','model','find','ShowWhatsappQueue','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ee496,_0x489e26){var _0x8b9d5a=function(_0x2d1f2c){while(--_0x2d1f2c){_0x1ee496['push'](_0x1ee496['shift']());}};_0x8b9d5a(++_0x489e26);}(_0x3909,0x120));var _0x9390=function(_0x386306,_0x1363c9){_0x386306=_0x386306-0x0;var _0xcb23d=_0x3909[_0x386306];return _0xcb23d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9390('0x0'));var BPromise=require(_0x9390('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9390('0x2'))['db'];var utils=require(_0x9390('0x3'));var logger=require(_0x9390('0x4'))(_0x9390('0x5'));var config=require(_0x9390('0x6'));var jayson=require(_0x9390('0x7'));var client=jayson[_0x9390('0x8')]['http']({'port':0x232a});config[_0x9390('0x9')]=_[_0x9390('0xa')](config['redis'],{'host':_0x9390('0xb'),'port':0x18eb});var socket=require(_0x9390('0xc'))(new Redis(config['redis']));require(_0x9390('0xd'))[_0x9390('0xe')](socket);function respondWithRpcPromise(_0x7d1e86,_0x32bc4,_0x53f938){return new BPromise(function(_0x2d813f,_0x5c4a2c){return client[_0x9390('0xf')](_0x7d1e86,_0x53f938)[_0x9390('0x10')](function(_0x23c560){logger[_0x9390('0x11')](_0x9390('0x12'),_0x32bc4,_0x9390('0x13'));logger[_0x9390('0x14')](_0x9390('0x15'),_0x32bc4,_0x9390('0x13'),JSON[_0x9390('0x16')](_0x23c560));if(_0x23c560['error']){if(_0x23c560['error']['code']===0x1f4){logger[_0x9390('0x17')](_0x9390('0x12'),_0x32bc4,_0x23c560[_0x9390('0x17')][_0x9390('0x18')]);return _0x5c4a2c(_0x23c560[_0x9390('0x17')][_0x9390('0x18')]);}logger['error'](_0x9390('0x12'),_0x32bc4,_0x23c560[_0x9390('0x17')][_0x9390('0x18')]);return _0x2d813f(_0x23c560[_0x9390('0x17')][_0x9390('0x18')]);}else{logger[_0x9390('0x11')](_0x9390('0x12'),_0x32bc4,_0x9390('0x13'));_0x2d813f(_0x23c560[_0x9390('0x19')][_0x9390('0x18')]);}})[_0x9390('0x1a')](function(_0x52435b){logger[_0x9390('0x17')](_0x9390('0x12'),_0x32bc4,_0x52435b);_0x5c4a2c(_0x52435b);});});}exports[_0x9390('0x1b')]=function(_0x44f909){var _0x1fb94c=this;return new Promise(function(_0x511b8b,_0x3108a2){return db[_0x9390('0x1c')]['findAll']({'raw':_0x44f909['options']?_0x44f909['options'][_0x9390('0x1d')]===undefined?!![]:![]:!![],'where':_0x44f909[_0x9390('0x1e')]?_0x44f909[_0x9390('0x1e')][_0x9390('0x1f')]||null:null,'attributes':_0x44f909[_0x9390('0x1e')]?_0x44f909[_0x9390('0x1e')][_0x9390('0x20')]||null:null,'limit':_0x44f909[_0x9390('0x1e')]?_0x44f909['options'][_0x9390('0x21')]||null:null,'include':_0x44f909['options']?_0x44f909[_0x9390('0x1e')][_0x9390('0x22')]?_[_0x9390('0x23')](_0x44f909['options'][_0x9390('0x22')],function(_0xd8db7b){return{'model':db[_0xd8db7b[_0x9390('0x24')]],'as':_0xd8db7b['as'],'attributes':_0xd8db7b[_0x9390('0x20')],'include':_0xd8db7b[_0x9390('0x22')]?_['map'](_0xd8db7b[_0x9390('0x22')],function(_0x585e55){return{'model':db[_0x585e55['model']],'as':_0x585e55['as'],'attributes':_0x585e55[_0x9390('0x20')],'include':_0x585e55[_0x9390('0x22')]?_[_0x9390('0x23')](_0x585e55[_0x9390('0x22')],function(_0x4680d4){return{'model':db[_0x4680d4['model']],'as':_0x4680d4['as'],'attributes':_0x4680d4[_0x9390('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9390('0x10')](function(_0x5dd99a){logger['info'](_0x9390('0x1b'),_0x44f909);logger['debug'](_0x9390('0x1b'),_0x44f909,JSON[_0x9390('0x16')](_0x5dd99a));_0x511b8b(_0x5dd99a);})['catch'](function(_0x1a006b){logger[_0x9390('0x17')](_0x9390('0x1b'),_0x1a006b[_0x9390('0x18')],_0x44f909);_0x3108a2(_0x1fb94c[_0x9390('0x17')](0x1f4,_0x1a006b['message']));});});};exports['ShowWhatsappQueue']=function(_0x50b617){var _0x491772=this;return new Promise(function(_0x4dd362,_0x18182c){return db[_0x9390('0x1c')][_0x9390('0x25')]({'raw':_0x50b617[_0x9390('0x1e')]?_0x50b617[_0x9390('0x1e')][_0x9390('0x1d')]===undefined?!![]:![]:!![],'where':_0x50b617[_0x9390('0x1e')]?_0x50b617[_0x9390('0x1e')]['where']||null:null,'attributes':_0x50b617[_0x9390('0x1e')]?_0x50b617[_0x9390('0x1e')][_0x9390('0x20')]||null:null,'include':_0x50b617['options']?_0x50b617['options']['include']?_[_0x9390('0x23')](_0x50b617['options'][_0x9390('0x22')],function(_0x43ebac){return{'model':db[_0x43ebac[_0x9390('0x24')]],'as':_0x43ebac['as'],'attributes':_0x43ebac[_0x9390('0x20')],'include':_0x43ebac[_0x9390('0x22')]?_[_0x9390('0x23')](_0x43ebac[_0x9390('0x22')],function(_0x424319){return{'model':db[_0x424319['model']],'as':_0x424319['as'],'attributes':_0x424319[_0x9390('0x20')],'include':_0x424319[_0x9390('0x22')]?_[_0x9390('0x23')](_0x424319[_0x9390('0x22')],function(_0x3a8812){return{'model':db[_0x3a8812[_0x9390('0x24')]],'as':_0x3a8812['as'],'attributes':_0x3a8812['attributes']};}):[]};}):[]};}):[]:[]})[_0x9390('0x10')](function(_0x57c979){logger[_0x9390('0x11')](_0x9390('0x26'),_0x50b617);logger[_0x9390('0x14')](_0x9390('0x26'),_0x50b617,JSON[_0x9390('0x16')](_0x57c979));_0x4dd362(_0x57c979);})[_0x9390('0x1a')](function(_0x1817e9){logger[_0x9390('0x17')](_0x9390('0x26'),_0x1817e9[_0x9390('0x18')],_0x50b617);_0x18182c(_0x491772[_0x9390('0x17')](0x1f4,_0x1817e9[_0x9390('0x18')]));});});};
\ No newline at end of file
index c7f2ea5..fedc0d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb2f=['save','remove','update','emit','removeListener','length'];(function(_0x56fbd5,_0x1766be){var _0x591fb7=function(_0xab29cf){while(--_0xab29cf){_0x56fbd5['push'](_0x56fbd5['shift']());}};_0x591fb7(++_0x1766be);}(_0xfb2f,0xa2));var _0xffb2=function(_0xfd120,_0x67cca){_0xfd120=_0xfd120-0x0;var _0x536c90=_0xfb2f[_0xfd120];return _0x536c90;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xffb2('0x0'),_0xffb2('0x1'),_0xffb2('0x2')];function createListener(_0x451988,_0x501d60){return function(_0x1ebe2a){_0x501d60[_0xffb2('0x3')](_0x451988,_0x1ebe2a);};}function removeListener(_0x2d6f3f,_0x14037f){return function(){WhatsappQueueEvents[_0xffb2('0x4')](_0x2d6f3f,_0x14037f);};}exports['register']=function(_0x3c039c){for(var _0x5dae3b=0x0,_0x51d742=events[_0xffb2('0x5')];_0x5dae3b<_0x51d742;_0x5dae3b++){var _0x10687e=events[_0x5dae3b];var _0x549c83=createListener('whatsappQueue:'+_0x10687e,_0x3c039c);WhatsappQueueEvents['on'](_0x10687e,_0x549c83);}};
\ No newline at end of file
+var _0xca72=['register','length','./whatsappQueue.events','remove','update','emit','removeListener'];(function(_0x6dcb0d,_0x15ea31){var _0x3cec29=function(_0x2b02e1){while(--_0x2b02e1){_0x6dcb0d['push'](_0x6dcb0d['shift']());}};_0x3cec29(++_0x15ea31);}(_0xca72,0x19f));var _0x2ca7=function(_0x54c695,_0x5d6677){_0x54c695=_0x54c695-0x0;var _0x3ce06b=_0xca72[_0x54c695];return _0x3ce06b;};'use strict';var WhatsappQueueEvents=require(_0x2ca7('0x0'));var events=['save',_0x2ca7('0x1'),_0x2ca7('0x2')];function createListener(_0x6011d1,_0x5982b0){return function(_0x549990){_0x5982b0[_0x2ca7('0x3')](_0x6011d1,_0x549990);};}function removeListener(_0x2194df,_0x423372){return function(){WhatsappQueueEvents[_0x2ca7('0x4')](_0x2194df,_0x423372);};}exports[_0x2ca7('0x5')]=function(_0x16c588){for(var _0x43e7dd=0x0,_0xc4236f=events[_0x2ca7('0x6')];_0x43e7dd<_0xc4236f;_0x43e7dd++){var _0x2d6ac8=events[_0x43e7dd];var _0x5b72e2=createListener('whatsappQueue:'+_0x2d6ac8,_0x16c588);WhatsappQueueEvents['on'](_0x2d6ac8,_0x5b72e2);}};
\ No newline at end of file
index ac5dd1f..0a0d788 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x180f=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x41ebf7,_0x51d695){var _0x4be724=function(_0x3d1fa7){while(--_0x3d1fa7){_0x41ebf7['push'](_0x41ebf7['shift']());}};_0x4be724(++_0x51d695);}(_0x180f,0x169));var _0xf180=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x180f[_0x342700];return _0x53406f;};'use strict';var multer=require(_0xf180('0x0'));var util=require(_0xf180('0x1'));var path=require(_0xf180('0x2'));var timeout=require(_0xf180('0x3'));var express=require(_0xf180('0x4'));var router=express[_0xf180('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf180('0x6'));var interaction=require(_0xf180('0x7'));var config=require(_0xf180('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0xf180('0x9')]('/',auth[_0xf180('0xa')](),controller[_0xf180('0xb')]);router[_0xf180('0x9')](_0xf180('0xc'),auth['isAuthenticated'](),controller[_0xf180('0xd')]);router[_0xf180('0x9')]('/:id',auth[_0xf180('0xa')](),controller[_0xf180('0xe')]);router[_0xf180('0xf')]('/',auth[_0xf180('0xa')](),controller[_0xf180('0x10')]);router[_0xf180('0x11')](_0xf180('0x12'),auth['isAuthenticated'](),controller[_0xf180('0x13')]);router[_0xf180('0x14')](_0xf180('0x12'),auth['isAuthenticated'](),controller[_0xf180('0x15')]);module[_0xf180('0x16')]=router;
\ No newline at end of file
+var _0x0ef7=['multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./whatsappQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','delete','destroy'];(function(_0x2aa50b,_0x4c23c9){var _0x102c25=function(_0x3f0d2c){while(--_0x3f0d2c){_0x2aa50b['push'](_0x2aa50b['shift']());}};_0x102c25(++_0x4c23c9);}(_0x0ef7,0x187));var _0x70ef=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x0ef7[_0x35ef6b];return _0x3ad145;};'use strict';var multer=require(_0x70ef('0x0'));var util=require('util');var path=require(_0x70ef('0x1'));var timeout=require(_0x70ef('0x2'));var express=require('express');var router=express[_0x70ef('0x3')]();var fs_extra=require(_0x70ef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x70ef('0x5'));var config=require('../../config/environment');var controller=require(_0x70ef('0x6'));router['get']('/',auth[_0x70ef('0x7')](),controller[_0x70ef('0x8')]);router[_0x70ef('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x70ef('0xa')]);router[_0x70ef('0x9')](_0x70ef('0xb'),auth[_0x70ef('0x7')](),controller[_0x70ef('0xc')]);router[_0x70ef('0xd')]('/',auth[_0x70ef('0x7')](),controller[_0x70ef('0xe')]);router['put'](_0x70ef('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x70ef('0xf')]('/:id',auth[_0x70ef('0x7')](),controller[_0x70ef('0x10')]);module['exports']=router;
\ No newline at end of file
index c65bfdc..58cb642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x25b9bb,_0x808abe){var _0x4c49ec=function(_0x246c37){while(--_0x246c37){_0x25b9bb['push'](_0x25b9bb['shift']());}};_0x4c49ec(++_0x808abe);}(_0x7a54,0x106));var _0x47a5=function(_0x38fe9d,_0x432ff5){_0x38fe9d=_0x38fe9d-0x0;var _0x8ced40=_0x7a54[_0x38fe9d];return _0x8ced40;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x37a949,_0x447368){var _0x1b33db=function(_0x58f6b6){while(--_0x58f6b6){_0x37a949['push'](_0x37a949['shift']());}};_0x1b33db(++_0x447368);}(_0x7a54,0x106));var _0x47a5=function(_0x29be1f,_0x36c67a){_0x29be1f=_0x29be1f-0x0;var _0x1936ca=_0x7a54[_0x29be1f];return _0x1936ca;};'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 e2b3eca..b8c15a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0xc8bd0a,_0x50c7b7){var _0x361343=function(_0x4497ec){while(--_0x4497ec){_0xc8bd0a['push'](_0xc8bd0a['shift']());}};_0x361343(++_0x50c7b7);}(_0xb58b,0x1f1));var _0xbb58=function(_0x26e90b,_0x11a646){_0x26e90b=_0x26e90b-0x0;var _0x1e80ae=_0xb58b[_0x26e90b];return _0x1e80ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x2d556a,_0x15e4c5){return function(_0x4e0303){if(!_0x4e0303){_0x2d556a[_0xbb58('0x18')](0x194);}return _0x4e0303;};}function handleError(_0x3bd550,_0x1be0ae){_0x1be0ae=_0x1be0ae||0x1f4;return function(_0x129094){logger[_0xbb58('0x27')](_0x129094[_0xbb58('0x28')]);if(_0x129094[_0xbb58('0x29')]){delete _0x129094[_0xbb58('0x29')];}_0x3bd550[_0xbb58('0x19')](_0x1be0ae)[_0xbb58('0x2a')](_0x129094);};}exports[_0xbb58('0x2b')]=function(_0x28b3a3,_0x2a0481){var _0x4157c4={},_0x3559b6={},_0x573cca={'count':0x0,'rows':[]};var _0x2b0f73=_[_0xbb58('0x2c')](db[_0xbb58('0x2d')][_0xbb58('0x2e')],function(_0x3304b9){return{'name':_0x3304b9[_0xbb58('0x2f')],'type':_0x3304b9[_0xbb58('0x30')][_0xbb58('0x31')]};});_0x3559b6[_0xbb58('0x32')]=_['map'](_0x2b0f73,_0xbb58('0x29'));_0x3559b6[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x28b3a3[_0xbb58('0x33')]);_0x3559b6[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],_0x3559b6[_0xbb58('0x33')]);_0x4157c4[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x28b3a3[_0xbb58('0x33')]['fields']));_0x4157c4['attributes']=_0x4157c4['attributes'][_0xbb58('0x39')]?_0x4157c4[_0xbb58('0x37')]:_0x3559b6[_0xbb58('0x32')];if(!_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3a')](_0xbb58('0x3b'))){_0x4157c4[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x28b3a3['query'][_0xbb58('0x1e')]);_0x4157c4[_0xbb58('0x1c')]=qs['offset'](_0x28b3a3[_0xbb58('0x33')]['offset']);}_0x4157c4[_0xbb58('0x3c')]=qs['sort'](_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3d')]);_0x4157c4['where']=qs[_0xbb58('0x35')](_[_0xbb58('0x3e')](_0x28b3a3[_0xbb58('0x33')],_0x3559b6[_0xbb58('0x35')]),_0x2b0f73);if(_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3f')]){_0x4157c4[_0xbb58('0x40')]=_[_0xbb58('0x41')](_0x4157c4['where'],{'$or':_[_0xbb58('0x2c')](_0x2b0f73,function(_0x31aa4b){if(_0x31aa4b[_0xbb58('0x30')]!=='VIRTUAL'){var _0x4dbd5e={};_0x4dbd5e[_0x31aa4b[_0xbb58('0x29')]]={'$like':'%'+_0x28b3a3['query'][_0xbb58('0x3f')]+'%'};return _0x4dbd5e;}})});}_0x4157c4=_[_0xbb58('0x41')]({},_0x4157c4,_0x28b3a3[_0xbb58('0x42')]);var _0x560911={'where':_0x4157c4['where']};return db[_0xbb58('0x2d')][_0xbb58('0x1d')](_0x560911)[_0xbb58('0x26')](function(_0x24d82d){_0x573cca[_0xbb58('0x1d')]=_0x24d82d;if(_0x28b3a3[_0xbb58('0x33')]['includeAll']){_0x4157c4[_0xbb58('0x43')]=[{'all':!![]}];}return db[_0xbb58('0x2d')][_0xbb58('0x44')](_0x4157c4);})[_0xbb58('0x26')](function(_0x1185b3){_0x573cca[_0xbb58('0x45')]=_0x1185b3;return _0x573cca;})['then'](respondWithFilteredResult(_0x2a0481,_0x4157c4))[_0xbb58('0x46')](handleError(_0x2a0481,null));};exports['show']=function(_0x22f1c3,_0x285ad4){var _0x29fb1c={'raw':!![],'where':{'id':_0x22f1c3['params']['id']}},_0x45817f={};_0x45817f[_0xbb58('0x32')]=_[_0xbb58('0x34')](db[_0xbb58('0x2d')][_0xbb58('0x2e')]);_0x45817f['query']=_[_0xbb58('0x34')](_0x22f1c3['query']);_0x45817f[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],_0x45817f[_0xbb58('0x33')]);_0x29fb1c[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x22f1c3[_0xbb58('0x33')][_0xbb58('0x38')]));_0x29fb1c[_0xbb58('0x37')]=_0x29fb1c[_0xbb58('0x37')][_0xbb58('0x39')]?_0x29fb1c['attributes']:_0x45817f[_0xbb58('0x32')];if(_0x22f1c3['query']['includeAll']){_0x29fb1c[_0xbb58('0x43')]=[{'all':!![]}];}_0x29fb1c=_[_0xbb58('0x41')]({},_0x29fb1c,_0x22f1c3[_0xbb58('0x42')]);return db[_0xbb58('0x2d')][_0xbb58('0x47')](_0x29fb1c)[_0xbb58('0x26')](handleEntityNotFound(_0x285ad4,null))[_0xbb58('0x26')](respondWithResult(_0x285ad4,null))[_0xbb58('0x46')](handleError(_0x285ad4,null));};exports[_0xbb58('0x48')]=function(_0x39995e,_0x440fb3){return db['WhatsappQueueReport'][_0xbb58('0x48')](_0x39995e[_0xbb58('0x49')],{})['then'](respondWithResult(_0x440fb3,0xc9))[_0xbb58('0x46')](handleError(_0x440fb3,null));};exports[_0xbb58('0x24')]=function(_0xf94897,_0xdb0ff7){if(_0xf94897['body']['id']){delete _0xf94897[_0xbb58('0x49')]['id'];}return db['WhatsappQueueReport'][_0xbb58('0x47')]({'where':{'id':_0xf94897[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0xdb0ff7,null))['then'](saveUpdates(_0xf94897[_0xbb58('0x49')],null))[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,null))['catch'](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x25')]=function(_0x4ca201,_0x28301d){return db[_0xbb58('0x2d')][_0xbb58('0x47')]({'where':{'id':_0x4ca201[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x28301d,null))[_0xbb58('0x26')](removeEntity(_0x28301d,null))[_0xbb58('0x46')](handleError(_0x28301d,null));};exports['describe']=function(_0x449088,_0x1fd892){return db['WhatsappQueueReport'][_0xbb58('0x4b')]()[_0xbb58('0x26')](respondWithResult(_0x1fd892,null))['catch'](handleError(_0x1fd892,null));};
\ No newline at end of file
+var _0x63a5=['filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x14ab4b,_0x15b381){var _0x3fa444=function(_0x21261d){while(--_0x21261d){_0x14ab4b['push'](_0x14ab4b['shift']());}};_0x3fa444(++_0x15b381);}(_0x63a5,0x18e));var _0x563a=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x63a5[_0x2d34d6];return _0x1d3d12;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61d5b2,_0x214f42){_0x214f42=_0x214f42||0xcc;return function(_0x10de2e){if(_0x10de2e){return _0x61d5b2[_0x563a('0x19')](_0x214f42);}return _0x61d5b2[_0x563a('0x1a')](_0x214f42)[_0x563a('0x1b')]();};}function respondWithResult(_0x50396b,_0x2cf052){_0x2cf052=_0x2cf052||0xc8;return function(_0x3045ac){if(_0x3045ac){return _0x50396b[_0x563a('0x1a')](_0x2cf052)[_0x563a('0x1c')](_0x3045ac);}};}function respondWithFilteredResult(_0x5a2980,_0x504cb7){return function(_0x414535){if(_0x414535){var _0x2ad667=typeof _0x504cb7['offset']===_0x563a('0x1d')&&typeof _0x504cb7[_0x563a('0x1e')]===_0x563a('0x1d');var _0x9c2f77=_0x414535['count'];var _0x598693=_0x2ad667?0x0:_0x504cb7[_0x563a('0x1f')];var _0x422aaf=_0x2ad667?_0x414535[_0x563a('0x20')]:_0x504cb7['offset']+_0x504cb7['limit'];var _0x52b99a;if(_0x422aaf>=_0x9c2f77){_0x422aaf=_0x9c2f77;_0x52b99a=0xc8;}else{_0x52b99a=0xce;}_0x5a2980['status'](_0x52b99a);return _0x5a2980[_0x563a('0x21')](_0x563a('0x22'),_0x598693+'-'+_0x422aaf+'/'+_0x9c2f77)[_0x563a('0x1c')](_0x414535);}return null;};}function patchUpdates(_0x43b7a8){return function(_0x562fce){try{jsonpatch['apply'](_0x562fce,_0x43b7a8,!![]);}catch(_0x3930f0){return BPromise[_0x563a('0x23')](_0x3930f0);}return _0x562fce[_0x563a('0x24')]();};}function saveUpdates(_0x2beccb,_0x1bf502){return function(_0x2dc7e2){if(_0x2dc7e2){return _0x2dc7e2[_0x563a('0x25')](_0x2beccb)[_0x563a('0x26')](function(_0x506491){return _0x506491;});}return null;};}function removeEntity(_0xd59ba8,_0x5422f6){return function(_0x44e2c1){if(_0x44e2c1){return _0x44e2c1[_0x563a('0x27')]()[_0x563a('0x26')](function(){_0xd59ba8[_0x563a('0x1a')](0xcc)[_0x563a('0x1b')]();});}};}function handleEntityNotFound(_0x1682ee,_0x3642b3){return function(_0x173990){if(!_0x173990){_0x1682ee['sendStatus'](0x194);}return _0x173990;};}function handleError(_0x146ea0,_0x2b688e){_0x2b688e=_0x2b688e||0x1f4;return function(_0x2311f2){logger[_0x563a('0x28')](_0x2311f2[_0x563a('0x29')]);if(_0x2311f2[_0x563a('0x2a')]){delete _0x2311f2[_0x563a('0x2a')];}_0x146ea0[_0x563a('0x1a')](_0x2b688e)[_0x563a('0x2b')](_0x2311f2);};}exports[_0x563a('0x2c')]=function(_0x1a69d5,_0x24d1a8){var _0x1bdfb0={},_0x7696c2={},_0x579cb5={'count':0x0,'rows':[]};var _0x43379c=_[_0x563a('0x2d')](db[_0x563a('0x2e')]['rawAttributes'],function(_0x1e8d43){return{'name':_0x1e8d43[_0x563a('0x2f')],'type':_0x1e8d43[_0x563a('0x30')][_0x563a('0x31')]};});_0x7696c2[_0x563a('0x32')]=_[_0x563a('0x2d')](_0x43379c,_0x563a('0x2a'));_0x7696c2['query']=_[_0x563a('0x33')](_0x1a69d5[_0x563a('0x34')]);_0x7696c2[_0x563a('0x35')]=_[_0x563a('0x36')](_0x7696c2[_0x563a('0x32')],_0x7696c2['query']);_0x1bdfb0['attributes']=_['intersection'](_0x7696c2['model'],qs[_0x563a('0x37')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x37')]));_0x1bdfb0[_0x563a('0x38')]=_0x1bdfb0[_0x563a('0x38')][_0x563a('0x39')]?_0x1bdfb0['attributes']:_0x7696c2['model'];if(!_0x1a69d5[_0x563a('0x34')][_0x563a('0x3a')](_0x563a('0x3b'))){_0x1bdfb0[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x1e')]);_0x1bdfb0[_0x563a('0x1f')]=qs[_0x563a('0x1f')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x1f')]);}_0x1bdfb0[_0x563a('0x3c')]=qs[_0x563a('0x3d')](_0x1a69d5[_0x563a('0x34')][_0x563a('0x3d')]);_0x1bdfb0[_0x563a('0x3e')]=qs['filters'](_[_0x563a('0x3f')](_0x1a69d5[_0x563a('0x34')],_0x7696c2[_0x563a('0x35')]),_0x43379c);if(_0x1a69d5['query'][_0x563a('0x40')]){_0x1bdfb0['where']=_[_0x563a('0x41')](_0x1bdfb0[_0x563a('0x3e')],{'$or':_['map'](_0x43379c,function(_0x52e4a2){if(_0x52e4a2[_0x563a('0x30')]!=='VIRTUAL'){var _0x13b795={};_0x13b795[_0x52e4a2[_0x563a('0x2a')]]={'$like':'%'+_0x1a69d5[_0x563a('0x34')][_0x563a('0x40')]+'%'};return _0x13b795;}})});}_0x1bdfb0=_['merge']({},_0x1bdfb0,_0x1a69d5['options']);var _0x615d2e={'where':_0x1bdfb0['where']};return db[_0x563a('0x2e')][_0x563a('0x20')](_0x615d2e)[_0x563a('0x26')](function(_0x9c392c){_0x579cb5[_0x563a('0x20')]=_0x9c392c;if(_0x1a69d5[_0x563a('0x34')][_0x563a('0x42')]){_0x1bdfb0[_0x563a('0x43')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x563a('0x44')](_0x1bdfb0);})['then'](function(_0x20c142){_0x579cb5[_0x563a('0x45')]=_0x20c142;return _0x579cb5;})[_0x563a('0x26')](respondWithFilteredResult(_0x24d1a8,_0x1bdfb0))[_0x563a('0x46')](handleError(_0x24d1a8,null));};exports['show']=function(_0x4b3d38,_0x54ac1e){var _0x2221d4={'raw':!![],'where':{'id':_0x4b3d38[_0x563a('0x47')]['id']}},_0x1255da={};_0x1255da[_0x563a('0x32')]=_[_0x563a('0x33')](db[_0x563a('0x2e')][_0x563a('0x48')]);_0x1255da[_0x563a('0x34')]=_[_0x563a('0x33')](_0x4b3d38[_0x563a('0x34')]);_0x1255da[_0x563a('0x35')]=_[_0x563a('0x36')](_0x1255da[_0x563a('0x32')],_0x1255da[_0x563a('0x34')]);_0x2221d4[_0x563a('0x38')]=_[_0x563a('0x36')](_0x1255da[_0x563a('0x32')],qs[_0x563a('0x37')](_0x4b3d38[_0x563a('0x34')]['fields']));_0x2221d4['attributes']=_0x2221d4[_0x563a('0x38')][_0x563a('0x39')]?_0x2221d4[_0x563a('0x38')]:_0x1255da[_0x563a('0x32')];if(_0x4b3d38[_0x563a('0x34')][_0x563a('0x42')]){_0x2221d4[_0x563a('0x43')]=[{'all':!![]}];}_0x2221d4=_[_0x563a('0x41')]({},_0x2221d4,_0x4b3d38['options']);return db['WhatsappQueueReport'][_0x563a('0x49')](_0x2221d4)[_0x563a('0x26')](handleEntityNotFound(_0x54ac1e,null))[_0x563a('0x26')](respondWithResult(_0x54ac1e,null))[_0x563a('0x46')](handleError(_0x54ac1e,null));};exports[_0x563a('0x4a')]=function(_0x3f2c5d,_0x2689b5){return db[_0x563a('0x2e')]['create'](_0x3f2c5d[_0x563a('0x4b')],{})[_0x563a('0x26')](respondWithResult(_0x2689b5,0xc9))['catch'](handleError(_0x2689b5,null));};exports[_0x563a('0x25')]=function(_0x5a063a,_0x3ea787){if(_0x5a063a[_0x563a('0x4b')]['id']){delete _0x5a063a[_0x563a('0x4b')]['id'];}return db['WhatsappQueueReport'][_0x563a('0x49')]({'where':{'id':_0x5a063a[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x3ea787,null))[_0x563a('0x26')](saveUpdates(_0x5a063a[_0x563a('0x4b')],null))[_0x563a('0x26')](respondWithResult(_0x3ea787,null))[_0x563a('0x46')](handleError(_0x3ea787,null));};exports[_0x563a('0x27')]=function(_0x277d54,_0x2008d4){return db[_0x563a('0x2e')][_0x563a('0x49')]({'where':{'id':_0x277d54[_0x563a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2008d4,null))['then'](removeEntity(_0x2008d4,null))[_0x563a('0x46')](handleError(_0x2008d4,null));};exports[_0x563a('0x4c')]=function(_0x143daa,_0x4a807f){return db['WhatsappQueueReport'][_0x563a('0x4c')]()[_0x563a('0x26')](respondWithResult(_0x4a807f,null))['catch'](handleError(_0x4a807f,null));};
\ No newline at end of file
index 5d48feb..9b8db92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ec3=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','rimraf','exports','define'];(function(_0x1aa301,_0x40ae8c){var _0x4a9145=function(_0x27fcec){while(--_0x27fcec){_0x1aa301['push'](_0x1aa301['shift']());}};_0x4a9145(++_0x40ae8c);}(_0x9ec3,0x125));var _0x39ec=function(_0x20126d,_0x1623b5){_0x20126d=_0x20126d-0x0;var _0x4e80c8=_0x9ec3[_0x20126d];return _0x4e80c8;};'use strict';var _=require(_0x39ec('0x0'));var util=require(_0x39ec('0x1'));var logger=require(_0x39ec('0x2'))(_0x39ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x39ec('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x39ec('0x5')]=function(_0x229e5a,_0x90cad8){return _0x229e5a[_0x39ec('0x6')](_0x39ec('0x7'),attributes,{'tableName':_0x39ec('0x8'),'paranoid':![],'indexes':[{'name':_0x39ec('0x9'),'fields':[_0x39ec('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c58=['rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x1c58,0x164));var _0x81c5=function(_0xff44a,_0x3c80e2){_0xff44a=_0xff44a-0x0;var _0x5766fd=_0x1c58[_0xff44a];return _0x5766fd;};'use strict';var _=require(_0x81c5('0x0'));var util=require(_0x81c5('0x1'));var logger=require(_0x81c5('0x2'))(_0x81c5('0x3'));var moment=require(_0x81c5('0x4'));var BPromise=require(_0x81c5('0x5'));var rp=require(_0x81c5('0x6'));var fs=require('fs');var path=require(_0x81c5('0x7'));var rimraf=require(_0x81c5('0x8'));var config=require(_0x81c5('0x9'));var attributes=require(_0x81c5('0xa'));module['exports']=function(_0x680a47,_0x33fdc2){return _0x680a47[_0x81c5('0xb')](_0x81c5('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x81c5('0xd'),'fields':[_0x81c5('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 255ff4b..a8e3343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81d7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','catch','options','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','WhatsappQueueReport','update','body','raw','util','moment','bluebird'];(function(_0x28e836,_0x237f70){var _0x2bfeed=function(_0x5b7f77){while(--_0x5b7f77){_0x28e836['push'](_0x28e836['shift']());}};_0x2bfeed(++_0x237f70);}(_0x81d7,0x115));var _0x781d=function(_0x5019fd,_0x3b2a29){_0x5019fd=_0x5019fd-0x0;var _0xbcd991=_0x81d7[_0x5019fd];return _0xbcd991;};'use strict';var _=require('lodash');var util=require(_0x781d('0x0'));var moment=require(_0x781d('0x1'));var BPromise=require(_0x781d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x781d('0x3'));var db=require(_0x781d('0x4'))['db'];var utils=require(_0x781d('0x5'));var logger=require(_0x781d('0x6'))(_0x781d('0x7'));var config=require(_0x781d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x781d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39d593,_0x2c5b1c,_0x3dafe4){return new BPromise(function(_0x55797c,_0x36cd7e){return client[_0x781d('0xa')](_0x39d593,_0x3dafe4)[_0x781d('0xb')](function(_0x10828a){logger[_0x781d('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2c5b1c,_0x781d('0xd'));logger[_0x781d('0xe')](_0x781d('0xf'),_0x2c5b1c,_0x781d('0xd'),JSON[_0x781d('0x10')](_0x10828a));if(_0x10828a[_0x781d('0x11')]){if(_0x10828a[_0x781d('0x11')]['code']===0x1f4){logger[_0x781d('0x11')](_0x781d('0x12'),_0x2c5b1c,_0x10828a[_0x781d('0x11')][_0x781d('0x13')]);return _0x36cd7e(_0x10828a[_0x781d('0x11')][_0x781d('0x13')]);}logger[_0x781d('0x11')](_0x781d('0x12'),_0x2c5b1c,_0x10828a[_0x781d('0x11')][_0x781d('0x13')]);return _0x55797c(_0x10828a[_0x781d('0x11')][_0x781d('0x13')]);}else{logger[_0x781d('0xc')](_0x781d('0x12'),_0x2c5b1c,_0x781d('0xd'));_0x55797c(_0x10828a['result'][_0x781d('0x13')]);}})[_0x781d('0x14')](function(_0x28caaf){logger[_0x781d('0x11')](_0x781d('0x12'),_0x2c5b1c,_0x28caaf);_0x36cd7e(_0x28caaf);});});}exports['CreateWhatsappQueueReport']=function(_0x580e6e){var _0xd7744f=this;return new Promise(function(_0x242a6e,_0x379652){return db['WhatsappQueueReport']['create'](_0x580e6e['body'],{'raw':_0x580e6e[_0x781d('0x15')]?_0x580e6e[_0x781d('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x59a0ab){logger['info'](_0x781d('0x16'),_0x580e6e);logger[_0x781d('0xe')](_0x781d('0x16'),_0x580e6e,JSON['stringify'](_0x59a0ab));_0x242a6e(_0x59a0ab);})[_0x781d('0x14')](function(_0x2e14d9){logger['error'](_0x781d('0x16'),_0x2e14d9['message'],_0x580e6e);_0x379652(_0xd7744f['error'](0x1f4,_0x2e14d9[_0x781d('0x13')]));});});};exports[_0x781d('0x17')]=function(_0x2a4957){var _0x2d0d45=this;return new Promise(function(_0x28b180,_0x4a86b2){return db[_0x781d('0x18')][_0x781d('0x19')](_0x2a4957[_0x781d('0x1a')],{'raw':_0x2a4957['options']?_0x2a4957['options'][_0x781d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a4957[_0x781d('0x15')]?_0x2a4957['options']['where']||null:null,'attributes':_0x2a4957[_0x781d('0x15')]?_0x2a4957[_0x781d('0x15')]['attributes']||null:null,'limit':_0x2a4957[_0x781d('0x15')]?_0x2a4957[_0x781d('0x15')]['limit']||null:null})[_0x781d('0xb')](function(_0x3bed45){logger[_0x781d('0xc')](_0x781d('0x17'),_0x2a4957);logger[_0x781d('0xe')](_0x781d('0x17'),_0x2a4957,JSON[_0x781d('0x10')](_0x3bed45));_0x28b180(_0x3bed45);})['catch'](function(_0x5bd00b){logger[_0x781d('0x11')]('UpdateWhatsappQueueReport',_0x5bd00b['message'],_0x2a4957);_0x4a86b2(_0x2d0d45['error'](0x1f4,_0x5bd00b[_0x781d('0x13')]));});});};
\ No newline at end of file
+var _0x9ce5=['stringify','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options'];(function(_0x31ce3d,_0x581047){var _0x203d95=function(_0x9b9243){while(--_0x9b9243){_0x31ce3d['push'](_0x31ce3d['shift']());}};_0x203d95(++_0x581047);}(_0x9ce5,0x193));var _0x59ce=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x9ce5[_0x3fba9f];return _0x192cf1;};'use strict';var _=require('lodash');var util=require(_0x59ce('0x0'));var moment=require(_0x59ce('0x1'));var BPromise=require(_0x59ce('0x2'));var rs=require(_0x59ce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59ce('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x59ce('0x5'))('rpc');var config=require(_0x59ce('0x6'));var jayson=require(_0x59ce('0x7'));var client=jayson[_0x59ce('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14fb16,_0x5524b8,_0x494c3e){return new BPromise(function(_0x105d26,_0xbdb5c6){return client[_0x59ce('0x9')](_0x14fb16,_0x494c3e)[_0x59ce('0xa')](function(_0x23e243){logger['info'](_0x59ce('0xb'),_0x5524b8,'request\x20sent');logger[_0x59ce('0xc')](_0x59ce('0xd'),_0x5524b8,_0x59ce('0xe'),JSON['stringify'](_0x23e243));if(_0x23e243[_0x59ce('0xf')]){if(_0x23e243[_0x59ce('0xf')][_0x59ce('0x10')]===0x1f4){logger[_0x59ce('0xf')](_0x59ce('0xb'),_0x5524b8,_0x23e243[_0x59ce('0xf')]['message']);return _0xbdb5c6(_0x23e243[_0x59ce('0xf')][_0x59ce('0x11')]);}logger['error'](_0x59ce('0xb'),_0x5524b8,_0x23e243[_0x59ce('0xf')][_0x59ce('0x11')]);return _0x105d26(_0x23e243[_0x59ce('0xf')]['message']);}else{logger[_0x59ce('0x12')](_0x59ce('0xb'),_0x5524b8,_0x59ce('0xe'));_0x105d26(_0x23e243[_0x59ce('0x13')][_0x59ce('0x11')]);}})[_0x59ce('0x14')](function(_0x1f121c){logger[_0x59ce('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5524b8,_0x1f121c);_0xbdb5c6(_0x1f121c);});});}exports[_0x59ce('0x15')]=function(_0x40cecd){var _0x5e4627=this;return new Promise(function(_0x31f05c,_0x4eef8d){return db[_0x59ce('0x16')][_0x59ce('0x17')](_0x40cecd[_0x59ce('0x18')],{'raw':_0x40cecd[_0x59ce('0x19')]?_0x40cecd[_0x59ce('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x59ce('0xa')](function(_0x51d40a){logger[_0x59ce('0x12')]('CreateWhatsappQueueReport',_0x40cecd);logger['debug'](_0x59ce('0x15'),_0x40cecd,JSON[_0x59ce('0x1a')](_0x51d40a));_0x31f05c(_0x51d40a);})[_0x59ce('0x14')](function(_0x31e16e){logger['error'](_0x59ce('0x15'),_0x31e16e[_0x59ce('0x11')],_0x40cecd);_0x4eef8d(_0x5e4627[_0x59ce('0xf')](0x1f4,_0x31e16e[_0x59ce('0x11')]));});});};exports[_0x59ce('0x1b')]=function(_0x5528b4){var _0x27b20b=this;return new Promise(function(_0x5a7a06,_0x5c473f){return db['WhatsappQueueReport'][_0x59ce('0x1c')](_0x5528b4[_0x59ce('0x18')],{'raw':_0x5528b4[_0x59ce('0x19')]?_0x5528b4[_0x59ce('0x19')][_0x59ce('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5528b4['options']?_0x5528b4[_0x59ce('0x19')][_0x59ce('0x1e')]||null:null,'attributes':_0x5528b4[_0x59ce('0x19')]?_0x5528b4[_0x59ce('0x19')][_0x59ce('0x1f')]||null:null,'limit':_0x5528b4[_0x59ce('0x19')]?_0x5528b4['options'][_0x59ce('0x20')]||null:null})[_0x59ce('0xa')](function(_0x403c4b){logger[_0x59ce('0x12')](_0x59ce('0x1b'),_0x5528b4);logger[_0x59ce('0xc')](_0x59ce('0x1b'),_0x5528b4,JSON[_0x59ce('0x1a')](_0x403c4b));_0x5a7a06(_0x403c4b);})[_0x59ce('0x14')](function(_0x3b39b7){logger[_0x59ce('0xf')](_0x59ce('0x1b'),_0x3b39b7['message'],_0x5528b4);_0x5c473f(_0x27b20b[_0x59ce('0xf')](0x1f4,_0x3b39b7[_0x59ce('0x11')]));});});};
\ No newline at end of file
index 2898b33..9a908f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb0f=['get','describe','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x105702,_0x3d4a6c){var _0x10ff6b=function(_0x26ddf0){while(--_0x26ddf0){_0x105702['push'](_0x105702['shift']());}};_0x10ff6b(++_0x3d4a6c);}(_0xbb0f,0x13c));var _0xfbb0=function(_0xb5fb2c,_0x485ba8){_0xb5fb2c=_0xb5fb2c-0x0;var _0x568df6=_0xbb0f[_0xb5fb2c];return _0x568df6;};'use strict';var multer=require(_0xfbb0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfbb0('0x1'));var express=require('express');var router=express[_0xfbb0('0x2')]();var fs_extra=require(_0xfbb0('0x3'));var auth=require(_0xfbb0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfbb0('0x5'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0xfbb0('0x6')](),controller[_0xfbb0('0x7')]);router[_0xfbb0('0x8')]('/describe',auth[_0xfbb0('0x6')](),controller[_0xfbb0('0x9')]);router[_0xfbb0('0x8')](_0xfbb0('0xa'),auth[_0xfbb0('0x6')](),controller[_0xfbb0('0xb')]);router[_0xfbb0('0xc')]('/',auth[_0xfbb0('0x6')](),controller[_0xfbb0('0xd')]);router[_0xfbb0('0xe')](_0xfbb0('0xa'),auth[_0xfbb0('0x6')](),controller[_0xfbb0('0xf')]);router[_0xfbb0('0x10')]('/:id',auth[_0xfbb0('0x6')](),controller['destroy']);module[_0xfbb0('0x11')]=router;
\ No newline at end of file
+var _0xbb7f=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update'];(function(_0x5bdfa5,_0x7506df){var _0x483c74=function(_0x55fbd0){while(--_0x55fbd0){_0x5bdfa5['push'](_0x5bdfa5['shift']());}};_0x483c74(++_0x7506df);}(_0xbb7f,0x1a1));var _0xfbb7=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbb7f[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0xfbb7('0x0'));var path=require(_0xfbb7('0x1'));var timeout=require(_0xfbb7('0x2'));var express=require(_0xfbb7('0x3'));var router=express[_0xfbb7('0x4')]();var fs_extra=require(_0xfbb7('0x5'));var auth=require(_0xfbb7('0x6'));var interaction=require(_0xfbb7('0x7'));var config=require(_0xfbb7('0x8'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0xfbb7('0x9')](),controller[_0xfbb7('0xa')]);router[_0xfbb7('0xb')](_0xfbb7('0xc'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0xd')]);router['get'](_0xfbb7('0xe'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0xf')]);router[_0xfbb7('0x10')]('/',auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x11')]);router[_0xfbb7('0x12')]('/:id',auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x13')]);router[_0xfbb7('0x14')](_0xfbb7('0xe'),auth[_0xfbb7('0x9')](),controller[_0xfbb7('0x15')]);module[_0xfbb7('0x16')]=router;
\ No newline at end of file
index 8d7ad7a..d4019ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07a2=['exports','ENUM','account','agent','queue','DATE','sequelize'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x07a2,0x12c));var _0x207a=function(_0x4685e4,_0x51031f){_0x4685e4=_0x4685e4-0x0;var _0x5abd59=_0x07a2[_0x4685e4];return _0x5abd59;};'use strict';var Sequelize=require(_0x207a('0x0'));module[_0x207a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x207a('0x2')](_0x207a('0x3'),_0x207a('0x4'),_0x207a('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x207a('0x6')]}};
\ No newline at end of file
+var _0xd48a=['agent','queue','DATE','sequelize','STRING','ENUM','account'];(function(_0x5d8afd,_0xd7f769){var _0x336c61=function(_0x539e58){while(--_0x539e58){_0x5d8afd['push'](_0x5d8afd['shift']());}};_0x336c61(++_0xd7f769);}(_0xd48a,0x96));var _0xad48=function(_0xf008f4,_0x51891d){_0xf008f4=_0xf008f4-0x0;var _0x4767b0=_0xd48a[_0xf008f4];return _0x4767b0;};'use strict';var Sequelize=require(_0xad48('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xad48('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xad48('0x2')](_0xad48('0x3'),_0xad48('0x4'),_0xad48('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xad48('0x6')]}};
\ No newline at end of file
index 7106bf5..ebfc099 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c82=['count','offset','Content-Range','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','pick','filter','merge','options','WhatsappTransferReport','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x3575bb,_0x4a2c70){var _0x14722e=function(_0x10af5a){while(--_0x10af5a){_0x3575bb['push'](_0x3575bb['shift']());}};_0x14722e(++_0x4a2c70);}(_0x5c82,0x198));var _0x25c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c82[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x25c8('0x0'));var rimraf=require(_0x25c8('0x1'));var zipdir=require(_0x25c8('0x2'));var jsonpatch=require(_0x25c8('0x3'));var rp=require(_0x25c8('0x4'));var moment=require(_0x25c8('0x5'));var BPromise=require(_0x25c8('0x6'));var Mustache=require(_0x25c8('0x7'));var util=require(_0x25c8('0x8'));var path=require(_0x25c8('0x9'));var sox=require(_0x25c8('0xa'));var csv=require(_0x25c8('0xb'));var ejs=require(_0x25c8('0xc'));var fs=require('fs');var fs_extra=require(_0x25c8('0xd'));var _=require(_0x25c8('0xe'));var squel=require(_0x25c8('0xf'));var crypto=require(_0x25c8('0x10'));var jsforce=require(_0x25c8('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x25c8('0x12'));var Redis=require('ioredis');var authService=require(_0x25c8('0x13'));var qs=require(_0x25c8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25c8('0x15'));var logger=require('../../config/logger')(_0x25c8('0x16'));var utils=require(_0x25c8('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x25c8('0x18'))['db'];function respondWithStatusCode(_0x21a4d7,_0x35a9be){_0x35a9be=_0x35a9be||0xcc;return function(_0x4d2f32){if(_0x4d2f32){return _0x21a4d7[_0x25c8('0x19')](_0x35a9be);}return _0x21a4d7[_0x25c8('0x1a')](_0x35a9be)[_0x25c8('0x1b')]();};}function respondWithResult(_0x3d305f,_0x4da009){_0x4da009=_0x4da009||0xc8;return function(_0x25800a){if(_0x25800a){return _0x3d305f[_0x25c8('0x1a')](_0x4da009)[_0x25c8('0x1c')](_0x25800a);}};}function respondWithFilteredResult(_0x151366,_0x3d4b03){return function(_0x400efb){if(_0x400efb){var _0x51d632=typeof _0x3d4b03['offset']===_0x25c8('0x1d')&&typeof _0x3d4b03['limit']===_0x25c8('0x1d');var _0x129a93=_0x400efb[_0x25c8('0x1e')];var _0x1c28c4=_0x51d632?0x0:_0x3d4b03[_0x25c8('0x1f')];var _0x4416af=_0x51d632?_0x400efb[_0x25c8('0x1e')]:_0x3d4b03['offset']+_0x3d4b03['limit'];var _0x1a3f76;if(_0x4416af>=_0x129a93){_0x4416af=_0x129a93;_0x1a3f76=0xc8;}else{_0x1a3f76=0xce;}_0x151366[_0x25c8('0x1a')](_0x1a3f76);return _0x151366['set'](_0x25c8('0x20'),_0x1c28c4+'-'+_0x4416af+'/'+_0x129a93)[_0x25c8('0x1c')](_0x400efb);}return null;};}function patchUpdates(_0x39c6e6){return function(_0x594cf6){try{jsonpatch['apply'](_0x594cf6,_0x39c6e6,!![]);}catch(_0x32cdd2){return BPromise['reject'](_0x32cdd2);}return _0x594cf6['save']();};}function saveUpdates(_0x34e580,_0x102f15){return function(_0x4311b8){if(_0x4311b8){return _0x4311b8[_0x25c8('0x21')](_0x34e580)[_0x25c8('0x22')](function(_0x1be7b6){return _0x1be7b6;});}return null;};}function removeEntity(_0x1e1d21,_0x319412){return function(_0x30931a){if(_0x30931a){return _0x30931a['destroy']()[_0x25c8('0x22')](function(){_0x1e1d21[_0x25c8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x132fb1,_0x33c232){return function(_0x5dc5d5){if(!_0x5dc5d5){_0x132fb1[_0x25c8('0x19')](0x194);}return _0x5dc5d5;};}function handleError(_0x4f24b5,_0x582ccb){_0x582ccb=_0x582ccb||0x1f4;return function(_0x5cab0d){logger[_0x25c8('0x23')](_0x5cab0d[_0x25c8('0x24')]);if(_0x5cab0d[_0x25c8('0x25')]){delete _0x5cab0d[_0x25c8('0x25')];}_0x4f24b5[_0x25c8('0x1a')](_0x582ccb)[_0x25c8('0x26')](_0x5cab0d);};}exports['index']=function(_0x47a996,_0x3fd79b){var _0x1a5a8d={},_0x3cd844={},_0x3b8eb5={'count':0x0,'rows':[]};var _0x5c501a=_[_0x25c8('0x27')](db['WhatsappTransferReport'][_0x25c8('0x28')],function(_0x1f9a44){return{'name':_0x1f9a44[_0x25c8('0x29')],'type':_0x1f9a44[_0x25c8('0x2a')][_0x25c8('0x2b')]};});_0x3cd844[_0x25c8('0x2c')]=_['map'](_0x5c501a,_0x25c8('0x25'));_0x3cd844['query']=_[_0x25c8('0x2d')](_0x47a996[_0x25c8('0x2e')]);_0x3cd844[_0x25c8('0x2f')]=_['intersection'](_0x3cd844['model'],_0x3cd844['query']);_0x1a5a8d[_0x25c8('0x30')]=_[_0x25c8('0x31')](_0x3cd844[_0x25c8('0x2c')],qs[_0x25c8('0x32')](_0x47a996['query']['fields']));_0x1a5a8d[_0x25c8('0x30')]=_0x1a5a8d[_0x25c8('0x30')]['length']?_0x1a5a8d[_0x25c8('0x30')]:_0x3cd844[_0x25c8('0x2c')];if(!_0x47a996['query']['hasOwnProperty'](_0x25c8('0x33'))){_0x1a5a8d[_0x25c8('0x34')]=qs['limit'](_0x47a996[_0x25c8('0x2e')]['limit']);_0x1a5a8d['offset']=qs[_0x25c8('0x1f')](_0x47a996[_0x25c8('0x2e')][_0x25c8('0x1f')]);}_0x1a5a8d[_0x25c8('0x35')]=qs[_0x25c8('0x36')](_0x47a996[_0x25c8('0x2e')]['sort']);_0x1a5a8d[_0x25c8('0x37')]=qs[_0x25c8('0x2f')](_[_0x25c8('0x38')](_0x47a996[_0x25c8('0x2e')],_0x3cd844['filters']),_0x5c501a);if(_0x47a996[_0x25c8('0x2e')][_0x25c8('0x39')]){_0x1a5a8d['where']=_[_0x25c8('0x3a')](_0x1a5a8d['where'],{'$or':_[_0x25c8('0x27')](_0x5c501a,function(_0x596b3f){if(_0x596b3f[_0x25c8('0x2a')]!=='VIRTUAL'){var _0x389d73={};_0x389d73[_0x596b3f[_0x25c8('0x25')]]={'$like':'%'+_0x47a996[_0x25c8('0x2e')]['filter']+'%'};return _0x389d73;}})});}_0x1a5a8d=_[_0x25c8('0x3a')]({},_0x1a5a8d,_0x47a996[_0x25c8('0x3b')]);var _0x288f37={'where':_0x1a5a8d[_0x25c8('0x37')]};return db[_0x25c8('0x3c')][_0x25c8('0x1e')](_0x288f37)[_0x25c8('0x22')](function(_0x15abf0){_0x3b8eb5[_0x25c8('0x1e')]=_0x15abf0;if(_0x47a996['query']['includeAll']){_0x1a5a8d[_0x25c8('0x3d')]=[{'all':!![]}];}return db[_0x25c8('0x3c')][_0x25c8('0x3e')](_0x1a5a8d);})[_0x25c8('0x22')](function(_0x4bd5f9){_0x3b8eb5[_0x25c8('0x3f')]=_0x4bd5f9;return _0x3b8eb5;})[_0x25c8('0x22')](respondWithFilteredResult(_0x3fd79b,_0x1a5a8d))[_0x25c8('0x40')](handleError(_0x3fd79b,null));};exports[_0x25c8('0x41')]=function(_0x475c4b,_0x79377d){var _0x73c8f7={'raw':!![],'where':{'id':_0x475c4b[_0x25c8('0x42')]['id']}},_0x2a9557={};_0x2a9557[_0x25c8('0x2c')]=_[_0x25c8('0x2d')](db[_0x25c8('0x3c')][_0x25c8('0x28')]);_0x2a9557[_0x25c8('0x2e')]=_[_0x25c8('0x2d')](_0x475c4b['query']);_0x2a9557[_0x25c8('0x2f')]=_[_0x25c8('0x31')](_0x2a9557[_0x25c8('0x2c')],_0x2a9557[_0x25c8('0x2e')]);_0x73c8f7[_0x25c8('0x30')]=_[_0x25c8('0x31')](_0x2a9557[_0x25c8('0x2c')],qs['fields'](_0x475c4b['query'][_0x25c8('0x32')]));_0x73c8f7[_0x25c8('0x30')]=_0x73c8f7[_0x25c8('0x30')][_0x25c8('0x43')]?_0x73c8f7[_0x25c8('0x30')]:_0x2a9557['model'];if(_0x475c4b[_0x25c8('0x2e')][_0x25c8('0x44')]){_0x73c8f7['include']=[{'all':!![]}];}_0x73c8f7=_[_0x25c8('0x3a')]({},_0x73c8f7,_0x475c4b[_0x25c8('0x3b')]);return db[_0x25c8('0x3c')][_0x25c8('0x45')](_0x73c8f7)[_0x25c8('0x22')](handleEntityNotFound(_0x79377d,null))[_0x25c8('0x22')](respondWithResult(_0x79377d,null))[_0x25c8('0x40')](handleError(_0x79377d,null));};exports[_0x25c8('0x46')]=function(_0xa4e6e4,_0x4cac6f){return db[_0x25c8('0x3c')][_0x25c8('0x46')](_0xa4e6e4[_0x25c8('0x47')],{})[_0x25c8('0x22')](respondWithResult(_0x4cac6f,0xc9))[_0x25c8('0x40')](handleError(_0x4cac6f,null));};exports[_0x25c8('0x21')]=function(_0x397297,_0x2d2503){if(_0x397297['body']['id']){delete _0x397297['body']['id'];}return db['WhatsappTransferReport'][_0x25c8('0x45')]({'where':{'id':_0x397297[_0x25c8('0x42')]['id']}})[_0x25c8('0x22')](handleEntityNotFound(_0x2d2503,null))[_0x25c8('0x22')](saveUpdates(_0x397297[_0x25c8('0x47')],null))['then'](respondWithResult(_0x2d2503,null))['catch'](handleError(_0x2d2503,null));};exports['destroy']=function(_0x148234,_0x41053b){return db[_0x25c8('0x3c')][_0x25c8('0x45')]({'where':{'id':_0x148234['params']['id']}})[_0x25c8('0x22')](handleEntityNotFound(_0x41053b,null))[_0x25c8('0x22')](removeEntity(_0x41053b,null))['catch'](handleError(_0x41053b,null));};exports[_0x25c8('0x48')]=function(_0xf8b968,_0x23d842){return db[_0x25c8('0x3c')][_0x25c8('0x48')]()[_0x25c8('0x22')](respondWithResult(_0x23d842,null))[_0x25c8('0x40')](handleError(_0x23d842,null));};
\ No newline at end of file
+var _0x917d=['fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','options','WhatsappTransferReport','includeAll','include','findAll','rows','show','params','catch','create','update','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs'];(function(_0x336280,_0x10a45c){var _0x2a1b5b=function(_0x3c99ea){while(--_0x3c99ea){_0x336280['push'](_0x336280['shift']());}};_0x2a1b5b(++_0x10a45c);}(_0x917d,0x17c));var _0xd917=function(_0x124a03,_0x25633e){_0x124a03=_0x124a03-0x0;var _0x4f3cbb=_0x917d[_0x124a03];return _0x4f3cbb;};'use strict';var emlformat=require(_0xd917('0x0'));var rimraf=require(_0xd917('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd917('0x2'));var rp=require(_0xd917('0x3'));var moment=require(_0xd917('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd917('0x5'));var util=require(_0xd917('0x6'));var path=require('path');var sox=require(_0xd917('0x7'));var csv=require(_0xd917('0x8'));var ejs=require(_0xd917('0x9'));var fs=require('fs');var fs_extra=require(_0xd917('0xa'));var _=require(_0xd917('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd917('0xc'));var deskjs=require(_0xd917('0xd'));var toCsv=require(_0xd917('0x8'));var querystring=require(_0xd917('0xe'));var Papa=require(_0xd917('0xf'));var Redis=require(_0xd917('0x10'));var authService=require(_0xd917('0x11'));var qs=require(_0xd917('0x12'));var as=require(_0xd917('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd917('0x14'))(_0xd917('0x15'));var utils=require('../../config/utils');var config=require(_0xd917('0x16'));var licenseUtil=require(_0xd917('0x17'));var db=require(_0xd917('0x18'))['db'];function respondWithStatusCode(_0x3bd54b,_0x5ce552){_0x5ce552=_0x5ce552||0xcc;return function(_0x342ddb){if(_0x342ddb){return _0x3bd54b['sendStatus'](_0x5ce552);}return _0x3bd54b[_0xd917('0x19')](_0x5ce552)[_0xd917('0x1a')]();};}function respondWithResult(_0x6cdfa7,_0x5b8eda){_0x5b8eda=_0x5b8eda||0xc8;return function(_0x17b81e){if(_0x17b81e){return _0x6cdfa7[_0xd917('0x19')](_0x5b8eda)[_0xd917('0x1b')](_0x17b81e);}};}function respondWithFilteredResult(_0x193ec0,_0x4d4f8b){return function(_0x5d05b7){if(_0x5d05b7){var _0x5e9c8d=typeof _0x4d4f8b[_0xd917('0x1c')]==='undefined'&&typeof _0x4d4f8b[_0xd917('0x1d')]===_0xd917('0x1e');var _0x4ce3a7=_0x5d05b7[_0xd917('0x1f')];var _0x1cfb52=_0x5e9c8d?0x0:_0x4d4f8b[_0xd917('0x1c')];var _0x18e7cf=_0x5e9c8d?_0x5d05b7[_0xd917('0x1f')]:_0x4d4f8b[_0xd917('0x1c')]+_0x4d4f8b['limit'];var _0xe50f2e;if(_0x18e7cf>=_0x4ce3a7){_0x18e7cf=_0x4ce3a7;_0xe50f2e=0xc8;}else{_0xe50f2e=0xce;}_0x193ec0[_0xd917('0x19')](_0xe50f2e);return _0x193ec0[_0xd917('0x20')](_0xd917('0x21'),_0x1cfb52+'-'+_0x18e7cf+'/'+_0x4ce3a7)['json'](_0x5d05b7);}return null;};}function patchUpdates(_0x2eab97){return function(_0x53c693){try{jsonpatch[_0xd917('0x22')](_0x53c693,_0x2eab97,!![]);}catch(_0x3c10d3){return BPromise[_0xd917('0x23')](_0x3c10d3);}return _0x53c693[_0xd917('0x24')]();};}function saveUpdates(_0x44d518,_0x352a7c){return function(_0x363d7c){if(_0x363d7c){return _0x363d7c['update'](_0x44d518)['then'](function(_0x5748c2){return _0x5748c2;});}return null;};}function removeEntity(_0x16a45a,_0x4628b5){return function(_0x585971){if(_0x585971){return _0x585971['destroy']()[_0xd917('0x25')](function(){_0x16a45a['status'](0xcc)[_0xd917('0x1a')]();});}};}function handleEntityNotFound(_0x505d5e,_0x14b025){return function(_0x1f146a){if(!_0x1f146a){_0x505d5e[_0xd917('0x26')](0x194);}return _0x1f146a;};}function handleError(_0x3d3709,_0x866ed4){_0x866ed4=_0x866ed4||0x1f4;return function(_0x37fe27){logger[_0xd917('0x27')](_0x37fe27[_0xd917('0x28')]);if(_0x37fe27[_0xd917('0x29')]){delete _0x37fe27[_0xd917('0x29')];}_0x3d3709[_0xd917('0x19')](_0x866ed4)[_0xd917('0x2a')](_0x37fe27);};}exports[_0xd917('0x2b')]=function(_0x2f4939,_0x151655){var _0x2632cf={},_0x554322={},_0x46bb6d={'count':0x0,'rows':[]};var _0x28d802=_[_0xd917('0x2c')](db['WhatsappTransferReport'][_0xd917('0x2d')],function(_0x1dee51){return{'name':_0x1dee51[_0xd917('0x2e')],'type':_0x1dee51[_0xd917('0x2f')][_0xd917('0x30')]};});_0x554322[_0xd917('0x31')]=_[_0xd917('0x2c')](_0x28d802,_0xd917('0x29'));_0x554322['query']=_[_0xd917('0x32')](_0x2f4939[_0xd917('0x33')]);_0x554322['filters']=_[_0xd917('0x34')](_0x554322[_0xd917('0x31')],_0x554322[_0xd917('0x33')]);_0x2632cf['attributes']=_[_0xd917('0x34')](_0x554322[_0xd917('0x31')],qs[_0xd917('0x35')](_0x2f4939[_0xd917('0x33')][_0xd917('0x35')]));_0x2632cf[_0xd917('0x36')]=_0x2632cf[_0xd917('0x36')][_0xd917('0x37')]?_0x2632cf[_0xd917('0x36')]:_0x554322[_0xd917('0x31')];if(!_0x2f4939[_0xd917('0x33')]['hasOwnProperty'](_0xd917('0x38'))){_0x2632cf[_0xd917('0x1d')]=qs['limit'](_0x2f4939[_0xd917('0x33')][_0xd917('0x1d')]);_0x2632cf[_0xd917('0x1c')]=qs['offset'](_0x2f4939[_0xd917('0x33')][_0xd917('0x1c')]);}_0x2632cf[_0xd917('0x39')]=qs[_0xd917('0x3a')](_0x2f4939[_0xd917('0x33')][_0xd917('0x3a')]);_0x2632cf['where']=qs[_0xd917('0x3b')](_[_0xd917('0x3c')](_0x2f4939[_0xd917('0x33')],_0x554322[_0xd917('0x3b')]),_0x28d802);if(_0x2f4939['query'][_0xd917('0x3d')]){_0x2632cf[_0xd917('0x3e')]=_['merge'](_0x2632cf[_0xd917('0x3e')],{'$or':_[_0xd917('0x2c')](_0x28d802,function(_0x1cc5e5){if(_0x1cc5e5[_0xd917('0x2f')]!=='VIRTUAL'){var _0x129f0b={};_0x129f0b[_0x1cc5e5['name']]={'$like':'%'+_0x2f4939[_0xd917('0x33')][_0xd917('0x3d')]+'%'};return _0x129f0b;}})});}_0x2632cf=_[_0xd917('0x3f')]({},_0x2632cf,_0x2f4939[_0xd917('0x40')]);var _0x4ca586={'where':_0x2632cf[_0xd917('0x3e')]};return db[_0xd917('0x41')][_0xd917('0x1f')](_0x4ca586)[_0xd917('0x25')](function(_0x45e0d8){_0x46bb6d[_0xd917('0x1f')]=_0x45e0d8;if(_0x2f4939[_0xd917('0x33')][_0xd917('0x42')]){_0x2632cf[_0xd917('0x43')]=[{'all':!![]}];}return db[_0xd917('0x41')][_0xd917('0x44')](_0x2632cf);})[_0xd917('0x25')](function(_0x15c211){_0x46bb6d[_0xd917('0x45')]=_0x15c211;return _0x46bb6d;})[_0xd917('0x25')](respondWithFilteredResult(_0x151655,_0x2632cf))['catch'](handleError(_0x151655,null));};exports[_0xd917('0x46')]=function(_0x463b45,_0x3d980b){var _0x59495b={'raw':!![],'where':{'id':_0x463b45[_0xd917('0x47')]['id']}},_0xb7c939={};_0xb7c939[_0xd917('0x31')]=_[_0xd917('0x32')](db[_0xd917('0x41')][_0xd917('0x2d')]);_0xb7c939[_0xd917('0x33')]=_[_0xd917('0x32')](_0x463b45[_0xd917('0x33')]);_0xb7c939[_0xd917('0x3b')]=_[_0xd917('0x34')](_0xb7c939[_0xd917('0x31')],_0xb7c939[_0xd917('0x33')]);_0x59495b[_0xd917('0x36')]=_[_0xd917('0x34')](_0xb7c939[_0xd917('0x31')],qs['fields'](_0x463b45[_0xd917('0x33')][_0xd917('0x35')]));_0x59495b[_0xd917('0x36')]=_0x59495b[_0xd917('0x36')][_0xd917('0x37')]?_0x59495b[_0xd917('0x36')]:_0xb7c939[_0xd917('0x31')];if(_0x463b45[_0xd917('0x33')]['includeAll']){_0x59495b[_0xd917('0x43')]=[{'all':!![]}];}_0x59495b=_[_0xd917('0x3f')]({},_0x59495b,_0x463b45[_0xd917('0x40')]);return db['WhatsappTransferReport']['find'](_0x59495b)[_0xd917('0x25')](handleEntityNotFound(_0x3d980b,null))['then'](respondWithResult(_0x3d980b,null))[_0xd917('0x48')](handleError(_0x3d980b,null));};exports[_0xd917('0x49')]=function(_0x4495db,_0x2c1d21){return db[_0xd917('0x41')]['create'](_0x4495db['body'],{})['then'](respondWithResult(_0x2c1d21,0xc9))[_0xd917('0x48')](handleError(_0x2c1d21,null));};exports[_0xd917('0x4a')]=function(_0x520afe,_0x17d3dc){if(_0x520afe['body']['id']){delete _0x520afe['body']['id'];}return db[_0xd917('0x41')][_0xd917('0x4b')]({'where':{'id':_0x520afe['params']['id']}})[_0xd917('0x25')](handleEntityNotFound(_0x17d3dc,null))[_0xd917('0x25')](saveUpdates(_0x520afe[_0xd917('0x4c')],null))[_0xd917('0x25')](respondWithResult(_0x17d3dc,null))[_0xd917('0x48')](handleError(_0x17d3dc,null));};exports['destroy']=function(_0x268a4e,_0x5290fa){return db[_0xd917('0x41')][_0xd917('0x4b')]({'where':{'id':_0x268a4e['params']['id']}})[_0xd917('0x25')](handleEntityNotFound(_0x5290fa,null))[_0xd917('0x25')](removeEntity(_0x5290fa,null))[_0xd917('0x48')](handleError(_0x5290fa,null));};exports[_0xd917('0x4d')]=function(_0x5ca86c,_0x3a4abf){return db[_0xd917('0x41')][_0xd917('0x4d')]()[_0xd917('0x25')](respondWithResult(_0x3a4abf,null))['catch'](handleError(_0x3a4abf,null));};
\ No newline at end of file
index dddbbd9..3e8bc7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x212f=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3505c8,_0x175b7c){var _0x1c3083=function(_0x396a28){while(--_0x396a28){_0x3505c8['push'](_0x3505c8['shift']());}};_0x1c3083(++_0x175b7c);}(_0x212f,0x13e));var _0xf212=function(_0x7c3554,_0x4e7bec){_0x7c3554=_0x7c3554-0x0;var _0x6a8966=_0x212f[_0x7c3554];return _0x6a8966;};'use strict';var _=require(_0xf212('0x0'));var util=require(_0xf212('0x1'));var logger=require(_0xf212('0x2'))(_0xf212('0x3'));var moment=require(_0xf212('0x4'));var BPromise=require(_0xf212('0x5'));var rp=require(_0xf212('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf212('0x7'));var config=require(_0xf212('0x8'));var attributes=require(_0xf212('0x9'));module[_0xf212('0xa')]=function(_0x340be6,_0x6fb6bd){return _0x340be6[_0xf212('0xb')](_0xf212('0xc'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xf212('0xd'),'fields':[_0xf212('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1e6d=['uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer'];(function(_0x24f4eb,_0x2536cd){var _0x420875=function(_0x14464b){while(--_0x14464b){_0x24f4eb['push'](_0x24f4eb['shift']());}};_0x420875(++_0x2536cd);}(_0x1e6d,0x1b1));var _0xd1e6=function(_0xd050c6,_0x58ffb4){_0xd050c6=_0xd050c6-0x0;var _0x7278a=_0x1e6d[_0xd050c6];return _0x7278a;};'use strict';var _=require('lodash');var util=require(_0xd1e6('0x0'));var logger=require(_0xd1e6('0x1'))('api');var moment=require(_0xd1e6('0x2'));var BPromise=require(_0xd1e6('0x3'));var rp=require(_0xd1e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1e6('0x5'));var config=require(_0xd1e6('0x6'));var attributes=require(_0xd1e6('0x7'));module[_0xd1e6('0x8')]=function(_0x6e607d,_0x2902cb){return _0x6e607d[_0xd1e6('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0xd1e6('0xa'),'paranoid':![],'indexes':[{'name':_0xd1e6('0xb'),'fields':[_0xd1e6('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 8d04df3..4058d9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5719=['then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x5719,0xb2));var _0x9571=function(_0x17f29b,_0x57719d){_0x17f29b=_0x17f29b-0x0;var _0x229acc=_0x5719[_0x17f29b];return _0x229acc;};'use strict';var _=require(_0x9571('0x0'));var util=require(_0x9571('0x1'));var moment=require(_0x9571('0x2'));var BPromise=require(_0x9571('0x3'));var rs=require(_0x9571('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9571('0x5'))['db'];var utils=require(_0x9571('0x6'));var logger=require('../../config/logger')(_0x9571('0x7'));var config=require('../../config/environment');var jayson=require(_0x9571('0x8'));var client=jayson[_0x9571('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d9b1b,_0x33a83a,_0x4052af){return new BPromise(function(_0x15e0fe,_0x1e536b){return client[_0x9571('0xa')](_0x5d9b1b,_0x4052af)[_0x9571('0xb')](function(_0x5d5df0){logger[_0x9571('0xc')](_0x9571('0xd'),_0x33a83a,_0x9571('0xe'));logger[_0x9571('0xf')](_0x9571('0x10'),_0x33a83a,_0x9571('0xe'),JSON[_0x9571('0x11')](_0x5d5df0));if(_0x5d5df0[_0x9571('0x12')]){if(_0x5d5df0[_0x9571('0x12')][_0x9571('0x13')]===0x1f4){logger[_0x9571('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x33a83a,_0x5d5df0['error']['message']);return _0x1e536b(_0x5d5df0[_0x9571('0x12')][_0x9571('0x14')]);}logger[_0x9571('0x12')](_0x9571('0xd'),_0x33a83a,_0x5d5df0[_0x9571('0x12')]['message']);return _0x15e0fe(_0x5d5df0[_0x9571('0x12')]['message']);}else{logger['info'](_0x9571('0xd'),_0x33a83a,_0x9571('0xe'));_0x15e0fe(_0x5d5df0['result'][_0x9571('0x14')]);}})['catch'](function(_0x47716c){logger['error'](_0x9571('0xd'),_0x33a83a,_0x47716c);_0x1e536b(_0x47716c);});});}
\ No newline at end of file
+var _0x49ee=['http','request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x4f1abc,_0xe26531){var _0x7f0012=function(_0x2955de){while(--_0x2955de){_0x4f1abc['push'](_0x4f1abc['shift']());}};_0x7f0012(++_0xe26531);}(_0x49ee,0x199));var _0xe49e=function(_0x3d87f7,_0x3caae7){_0x3d87f7=_0x3d87f7-0x0;var _0x5440f9=_0x49ee[_0x3d87f7];return _0x5440f9;};'use strict';var _=require(_0xe49e('0x0'));var util=require('util');var moment=require(_0xe49e('0x1'));var BPromise=require(_0xe49e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe49e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe49e('0x4'));var logger=require(_0xe49e('0x5'))(_0xe49e('0x6'));var config=require(_0xe49e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe49e('0x8')][_0xe49e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37e881,_0x171e23,_0x2dd666){return new BPromise(function(_0x28ca24,_0x41757d){return client[_0xe49e('0xa')](_0x37e881,_0x2dd666)[_0xe49e('0xb')](function(_0x2321d8){logger['info'](_0xe49e('0xc'),_0x171e23,'request\x20sent');logger[_0xe49e('0xd')](_0xe49e('0xe'),_0x171e23,_0xe49e('0xf'),JSON[_0xe49e('0x10')](_0x2321d8));if(_0x2321d8['error']){if(_0x2321d8[_0xe49e('0x11')][_0xe49e('0x12')]===0x1f4){logger[_0xe49e('0x11')](_0xe49e('0xc'),_0x171e23,_0x2321d8[_0xe49e('0x11')]['message']);return _0x41757d(_0x2321d8['error'][_0xe49e('0x13')]);}logger[_0xe49e('0x11')](_0xe49e('0xc'),_0x171e23,_0x2321d8[_0xe49e('0x11')][_0xe49e('0x13')]);return _0x28ca24(_0x2321d8[_0xe49e('0x11')]['message']);}else{logger[_0xe49e('0x14')](_0xe49e('0xc'),_0x171e23,_0xe49e('0xf'));_0x28ca24(_0x2321d8[_0xe49e('0x15')][_0xe49e('0x13')]);}})['catch'](function(_0x4bdf1a){logger[_0xe49e('0x11')](_0xe49e('0xc'),_0x171e23,_0x4bdf1a);_0x41757d(_0x4bdf1a);});});}
\ No newline at end of file
index 645285e..17c62f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc88c=['then','listen','info','start','map','filter','online','name','join','status','None','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync'];(function(_0x38eae9,_0x2df4cc){var _0x5f3973=function(_0x47b5e4){while(--_0x47b5e4){_0x38eae9['push'](_0x38eae9['shift']());}};_0x5f3973(++_0x2df4cc);}(_0xc88c,0xc0));var _0xcc88=function(_0x20c9de,_0x2e1b5c){_0x20c9de=_0x20c9de-0x0;var _0x3dc952=_0xc88c[_0x20c9de];return _0x3dc952;};'use strict';var _=require(_0xcc88('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xcc88('0x1'));var config=require('./config/environment');var logger=require('./config/logger')(_0xcc88('0x2'));var pm2=require(_0xcc88('0x3'));var pm2Config=require(_0xcc88('0x4'));var schedule=require(_0xcc88('0x5'));var chat=require(_0xcc88('0x6'));var whatsapp=require(_0xcc88('0x7'));var transcribe=require(_0xcc88('0x8'));function main(){return mysqldb['db'][_0xcc88('0x9')][_0xcc88('0xa')]()[_0xcc88('0xb')](function(){return rpc[_0xcc88('0xc')]();})[_0xcc88('0xb')](function(_0x1fd3a0){logger[_0xcc88('0xd')](_0x1fd3a0);return chat[_0xcc88('0xe')]();})[_0xcc88('0xb')](function(){return whatsapp[_0xcc88('0xe')]();})[_0xcc88('0xb')](function(){return schedule[_0xcc88('0xe')]();})[_0xcc88('0xb')](function(){return transcribe[_0xcc88('0xe')]();})[_0xcc88('0xb')](function(_0x533a2e){logger[_0xcc88('0xd')](_0x533a2e);return pm2[_0xcc88('0xe')](pm2Config);})[_0xcc88('0xb')](function(_0x463d06){logger[_0xcc88('0xd')]('Online\x20apps:',_[_0xcc88('0xf')](_[_0xcc88('0x10')](_0x463d06,{'status':_0xcc88('0x11')}),_0xcc88('0x12'))[_0xcc88('0x13')]());logger[_0xcc88('0xd')]('Offline\x20apps:',_['map'](_[_0xcc88('0x10')](_0x463d06,function(_0x371496){return _0x371496[_0xcc88('0x14')]!==_0xcc88('0x11');}),'name')[_0xcc88('0x13')]()||_0xcc88('0x15'));config['seedDB']&&require(_0xcc88('0x16'))[_0xcc88('0x17')]();require(_0xcc88('0x18'))[_0xcc88('0x17')]();})[_0xcc88('0x19')](function(_0x10e51a){logger[_0xcc88('0x1a')](_0xcc88('0x1b'),_0x10e51a);process[_0xcc88('0x1c')](0x1);});}main();
\ No newline at end of file
+var _0x3235=['map','filter','join','Offline\x20apps:','status','online','seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./rpc','./config/environment','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:'];(function(_0x203cf5,_0x8421e0){var _0x17a51d=function(_0x466b7a){while(--_0x466b7a){_0x203cf5['push'](_0x203cf5['shift']());}};_0x17a51d(++_0x8421e0);}(_0x3235,0x16a));var _0x5323=function(_0x372484,_0x5ecdbc){_0x372484=_0x372484-0x0;var _0x1d98d6=_0x3235[_0x372484];return _0x1d98d6;};'use strict';var _=require(_0x5323('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x5323('0x1'));var config=require(_0x5323('0x2'));var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x5323('0x3'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x5323('0x4'));var transcribe=require(_0x5323('0x5'));function main(){return mysqldb['db'][_0x5323('0x6')][_0x5323('0x7')]()[_0x5323('0x8')](function(){return rpc[_0x5323('0x9')]();})[_0x5323('0x8')](function(_0x491e3e){logger[_0x5323('0xa')](_0x491e3e);return chat[_0x5323('0xb')]();})['then'](function(){return whatsapp[_0x5323('0xb')]();})['then'](function(){return schedule[_0x5323('0xb')]();})[_0x5323('0x8')](function(){return transcribe[_0x5323('0xb')]();})[_0x5323('0x8')](function(_0x34b147){logger['info'](_0x34b147);return pm2['start'](pm2Config);})[_0x5323('0x8')](function(_0x398f8a){logger[_0x5323('0xa')](_0x5323('0xc'),_[_0x5323('0xd')](_[_0x5323('0xe')](_0x398f8a,{'status':'online'}),'name')[_0x5323('0xf')]());logger[_0x5323('0xa')](_0x5323('0x10'),_[_0x5323('0xd')](_[_0x5323('0xe')](_0x398f8a,function(_0x3e9b2e){return _0x3e9b2e[_0x5323('0x11')]!==_0x5323('0x12');}),'name')['join']()||'None');config[_0x5323('0x13')]&&require('./config/seedDB')[_0x5323('0x14')]();require(_0x5323('0x15'))[_0x5323('0x14')]();})[_0x5323('0x16')](function(_0x2a4591){logger[_0x5323('0x17')](_0x5323('0x18'),_0x2a4591);process['exit'](0x1);});}main();
\ No newline at end of file
index 3b696f6..5c04f3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d14=['nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','minutes','Unknown\x20authorization\x20format','user','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','randomBytes','floor','now','HS512','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','email','userpic','permissions','md5secret','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','params','closed','disposition','status','unmanaged','Forbidden.','authorization','startsWith','headers','Basic','User','find','then','authenticate','pass','json','catch','Bearer','apikey','getUuid','query','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x2d14,0xad));var _0x42d1=function(_0x3da7c5,_0x64f4c8){_0x3da7c5=_0x3da7c5-0x0;var _0x95cc52=_0x2d14[_0x3da7c5];return _0x95cc52;};'use strict';var db=require(_0x42d1('0x0'))['db'];var config=require(_0x42d1('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x42d1('0x2'));var encryptor=require(_0x42d1('0x3'));var _=require('lodash');var jwt=require(_0x42d1('0x4'));var expressJwt=require(_0x42d1('0x5'));var compose=require(_0x42d1('0x6'));var basicAuth=require(_0x42d1('0x7'));var crypto=require(_0x42d1('0x8'));var BPromise=require(_0x42d1('0x9'));var util=require(_0x42d1('0xa'));var moment=require(_0x42d1('0xb'));var validateJwt=expressJwt({'secret':config[_0x42d1('0xc')][_0x42d1('0xd')]});var userAttributes=['id',_0x42d1('0xe'),_0x42d1('0xf'),_0x42d1('0x10'),'internal',_0x42d1('0x11'),_0x42d1('0x12'),_0x42d1('0x13'),_0x42d1('0x14'),_0x42d1('0x15'),'chatPause',_0x42d1('0x16'),_0x42d1('0x17'),_0x42d1('0x18'),_0x42d1('0x19'),_0x42d1('0x1a'),_0x42d1('0x1b'),_0x42d1('0x1c'),_0x42d1('0x1d'),'crudPermissions',_0x42d1('0x1e'),_0x42d1('0x1f'),_0x42d1('0x20'),_0x42d1('0x21'),_0x42d1('0x22'),_0x42d1('0x23'),'phoneBarEnableRecording',_0x42d1('0x24'),_0x42d1('0x25'),'phoneBarExpires',_0x42d1('0x26'),_0x42d1('0x27'),'phoneBarRemoteControlPort',_0x42d1('0x28'),_0x42d1('0x29'),'userProfileId',_0x42d1('0x2a'),_0x42d1('0x2b'),_0x42d1('0x2c'),_0x42d1('0x2d'),'downloadOmnichannelInteractions','downloadAttachments'];exports[_0x42d1('0x2e')]=function(){return this[_0x42d1('0x2f')](!![])[_0x42d1('0x30')](function(_0x2236db,_0x23502d,_0x218c1d){if(_0x2236db['user']){_0x218c1d();}else{return db[_0x42d1('0x31')][_0x42d1('0x32')]({'where':{'id':_0x2236db[_0x42d1('0x33')]['id']},'attributes':['id',_0x42d1('0x34'),_0x42d1('0x35')],'raw':!![]})['then'](function(_0xfa2caa){if(_0xfa2caa&&_0xfa2caa[_0x42d1('0x34')]){return _0x23502d[_0x42d1('0x36')](_0xfa2caa['disposition']===_0x42d1('0x37')?0x195:0x193)['json']({'message':_0xfa2caa[_0x42d1('0x35')]==='unmanaged'?'Unmanaged.':_0x42d1('0x38')});}else{_0x218c1d();}})['catch'](function(_0x374bc5){_0x218c1d(_0x374bc5);});}});};exports[_0x42d1('0x2f')]=function isAuthenticated(_0x2a1570){return compose()[_0x42d1('0x30')](function(_0x4bbf77,_0x323abf,_0xfc788d){var _0x5d71ad;if(_0x4bbf77['headers'][_0x42d1('0x39')]){if(_[_0x42d1('0x3a')](_0x4bbf77[_0x42d1('0x3b')][_0x42d1('0x39')],_0x42d1('0x3c'))){var _0x2217fb=basicAuth(_0x4bbf77);db[_0x42d1('0x3d')][_0x42d1('0x3e')]({'where':{'name':_0x2217fb['name']}})[_0x42d1('0x3f')](function(_0x189661){if(!_0x189661||!_0x189661[_0x42d1('0x40')](_0x2217fb[_0x42d1('0x41')])){return _0x323abf[_0x42d1('0x36')](0x191)[_0x42d1('0x42')]({'message':'Wrong\x20credentials.'});}_0x4bbf77['user']={'id':_0x189661['id']};_0xfc788d();})[_0x42d1('0x43')](function(_0x3cda6c){_0xfc788d(_0x3cda6c);});}else if(_[_0x42d1('0x3a')](_0x4bbf77[_0x42d1('0x3b')][_0x42d1('0x39')],_0x42d1('0x44'))){validateJwt(_0x4bbf77,_0x323abf,_0xfc788d);}else{if(_0x2a1570){_0xfc788d();}else{return _0x323abf[_0x42d1('0x36')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x4bbf77['query'][_0x42d1('0x45')]){try{var _0x23e2a2={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x42d1('0x46')]()};verifyJwt(_0x4bbf77[_0x42d1('0x47')][_0x42d1('0x45')],_0x23e2a2)['then'](function(_0x32111c){return db[_0x42d1('0x3d')][_0x42d1('0x3e')]({'where':{'id':_0x32111c['sub']}})[_0x42d1('0x3f')](function(_0x5e4dbf){_0x5d71ad=_0x5e4dbf;return db[_0x42d1('0x48')]['findOne']({'where':{'id':0x1},'attributes':[_0x42d1('0x49'),_0x42d1('0x4a')],'raw':!![]});})[_0x42d1('0x3f')](function(_0x4d2200){if(!_0x5d71ad||!_[_0x42d1('0x4b')](_0x5d71ad[_0x42d1('0x4c')],_0x32111c[_0x42d1('0x4d')])){return _0x323abf[_0x42d1('0x36')](0x191)[_0x42d1('0x42')]({'message':_0x42d1('0x4e')});}if(_0x5d71ad['disabled']){return _0x323abf['status'](0x191)['json']({'message':_0x42d1('0x4f')});}if(_0x5d71ad['blocked']){if(_0x4d2200['blockDuration']>0x0){if(moment(_0x5d71ad[_0x42d1('0x50')])['add'](_0x4d2200['blockDuration'],_0x42d1('0x51'))>moment()){return _0x323abf[_0x42d1('0x36')](0x191)[_0x42d1('0x42')]({'message':_0x42d1('0x4f')});}}else{return _0x323abf[_0x42d1('0x36')](0x191)['json']({'message':_0x42d1('0x4f')});}}_0x4bbf77['user']={'id':_0x5d71ad['id']};_0xfc788d();});})[_0x42d1('0x43')](function(){return _0x323abf[_0x42d1('0x36')](0x191)['json']({'message':_0x42d1('0x4f')});});}catch(_0x23a179){_0xfc788d(_0x23a179);}}else if(_0x2a1570){_0xfc788d();}else{return _0x323abf['status'](0x193)[_0x42d1('0x42')]({'message':_0x42d1('0x52')});}})[_0x42d1('0x30')](function(_0x113256,_0x3ddabf,_0x31345b){if(_0x113256[_0x42d1('0x53')]){db[_0x42d1('0x3d')]['find']({'where':{'id':_0x113256['user']['id']},'attributes':userAttributes})[_0x42d1('0x3f')](function(_0x2405db){if(!_0x2405db){return _0x3ddabf[_0x42d1('0x36')](0x194)['json']({'message':_0x42d1('0x54')});}_0x113256[_0x42d1('0x53')]=_0x2405db;_0x31345b();})[_0x42d1('0x43')](function(_0x30354b){_0x31345b(_0x30354b);});}else if(_0x2a1570){_0x31345b();}else{return _0x3ddabf[_0x42d1('0x36')](0x194)[_0x42d1('0x42')]({'message':_0x42d1('0x55')});}});};exports[_0x42d1('0x56')]=function canUpdate(){return compose()[_0x42d1('0x30')](function(_0x213bee,_0x55e10d,_0x27f2ac){return licenseUtil[_0x42d1('0x57')]()['then'](function(_0x59dca3){if(_0x59dca3[_0x42d1('0x58')]){_0x27f2ac();}else{return _0x55e10d['status'](0x193)[_0x42d1('0x42')]({'message':'Forbidden'});}})['catch'](function(_0x3b0e08){_0x27f2ac(_0x3b0e08);});});};exports[_0x42d1('0x59')]=function(_0x2a69b4,_0xbc3235,_0x16db57){_0x2a69b4[_0x42d1('0x59')]=!![];return _0x16db57();};exports['signToken']=function signToken(_0xbca92a){return signJwt(_0xbca92a);};exports[_0x42d1('0x5a')]=function(_0x4f1a8b,_0x4dfdba){if(!_0x4f1a8b[_0x42d1('0x53')]){return _0x4dfdba['status'](0x194)[_0x42d1('0x42')]({'message':_0x42d1('0x5b')});}var _0x35d2c6={'payload':{'id':_0x4f1a8b[_0x42d1('0x53')]['id'],'role':_0x4f1a8b[_0x42d1('0x53')][_0x42d1('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x35d2c6)['then'](function(_0x3fc49e){_0x4dfdba['cookie'](_0x42d1('0x5c'),_0x3fc49e);_0x4dfdba[_0x42d1('0x5d')](_0x42d1('0x5e'));})[_0x42d1('0x43')](function(_0x556bba){return _0x4dfdba['status'](0x1f4)[_0x42d1('0x5f')](_0x556bba);});};exports[_0x42d1('0x60')]=function(_0x47b296){if(_[_0x42d1('0x61')](_0x47b296[_0x42d1('0x4c')])||_[_0x42d1('0x61')](_0x47b296[_0x42d1('0x62')])){return null;}else{return createJwt(_0x47b296);}};exports[_0x42d1('0x63')]=function(_0x55e7df){_0x55e7df[_0x42d1('0x4c')]=generateNonce();_0x55e7df['apiKeyIat']=generateIssuedAt();return createJwt(_0x55e7df);};exports[_0x42d1('0x64')]=function(_0x4e77c6,_0x4d16e9){var _0x4fa110=_0x4e77c6[_0x42d1('0x47')][_0x42d1('0x45')];if(_0x4fa110){var _0x1880be={'nonce':_0x4d16e9['apiKeyNonce'],'iat':_0x4d16e9[_0x42d1('0x62')],'audience':hardwareConf[_0x42d1('0x46')](),'issuer':hardwareConf[_0x42d1('0x46')]()};return verifyJwt(_0x4fa110,_0x1880be)[_0x42d1('0x3f')](function(){return generateApiKey(_0x4d16e9);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x26ef66){var _0x446c15=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x446c15[_0x42d1('0x65')](_0x26ef66))throw new db[(_0x42d1('0x66'))][(_0x42d1('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x42d1('0x68')]=function(_0x2cef46,_0x83a856,_0x3b595c){var _0x484327=encryptor[_0x42d1('0x69')](_0x83a856)['split'](',');for(var _0x1d3949=0x0;_0x1d3949<_0x3b595c;_0x1d3949++){if(!_0x484327[_0x1d3949])break;if(_0x2cef46[_0x42d1('0x6a')]()===_0x484327[_0x1d3949][_0x42d1('0x6a')]()){var _0x41b3a7=util[_0x42d1('0x6b')](_0x42d1('0x6c'),_0x3b595c);if(_0x3b595c===0x1){_0x41b3a7=_0x42d1('0x6d');}throw new db[(_0x42d1('0x66'))][(_0x42d1('0x67'))](_0x41b3a7);}}return;};exports['updatePasswordsHistory']=function(_0x5f1f37,_0x3c5193){var _0x24fc14=_0x3c5193?encryptor[_0x42d1('0x69')](_0x3c5193)['split'](','):[];if(_0x24fc14[_0x42d1('0x6e')]===0x5){_0x24fc14[_0x42d1('0x6f')](-0x1,0x1);}_0x24fc14[_0x42d1('0x70')](_0x5f1f37);return encryptor[_0x42d1('0x71')](_0x24fc14[_0x42d1('0x72')](','));};function signJwt(_0x53971b){var _0x52f3d9=BPromise[_0x42d1('0x73')](jwt[_0x42d1('0x74')],{'context':jwt});var _0x355096=_0x53971b[_0x42d1('0x75')]||config['secrets']['session'];return new BPromise(function(_0x328cc6,_0x2385f0){_0x52f3d9(_0x53971b[_0x42d1('0x76')],_0x355096,_0x53971b[_0x42d1('0x77')])[_0x42d1('0x3f')](function(_0x39889e){_0x328cc6(_0x39889e);})[_0x42d1('0x43')](function(_0x431cc4){_0x2385f0(_0x431cc4);});});}function verifyJwt(_0x244f62,_0x5bcf0d,_0x6b5a27){var _0x65c52f=BPromise[_0x42d1('0x73')](jwt['verify'],{'context':jwt});var _0x13d89e=_0x6b5a27||config['secrets'][_0x42d1('0xd')];return new BPromise(function(_0x507dc0,_0x31343d){_0x65c52f(_0x244f62,_0x13d89e,_0x5bcf0d)[_0x42d1('0x3f')](function(_0x2495c6){_0x507dc0(_0x2495c6);})[_0x42d1('0x43')](function(_0xd97b49){_0x31343d(_0xd97b49);});});}function generateNonce(){return crypto[_0x42d1('0x78')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x42d1('0x79')](Date[_0x42d1('0x7a')]()/0x3e8)['toString']();}function createJwt(_0x27f282){var _0x160783={'payload':{'iat':_0x27f282[_0x42d1('0x62')],'nonce':_0x27f282[_0x42d1('0x4c')]},'options':{'algorithm':_0x42d1('0x7b'),'subject':_0x27f282['id'][_0x42d1('0x7c')](),'issuer':hardwareConf[_0x42d1('0x46')](),'audience':hardwareConf[_0x42d1('0x46')]()}};return signJwt(_0x160783)[_0x42d1('0x3f')](function(_0x1dbf83){return{'iat':_0x27f282[_0x42d1('0x62')],'nonce':_0x27f282[_0x42d1('0x4c')],'token':_0x1dbf83};});}
\ No newline at end of file
+var _0x68c9=['find','name','then','authenticate','pass','Wrong\x20credentials.','apikey','getUuid','query','Setting','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','user','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isMiddleware','cookie','redirect','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','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','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.','Sequelize','split','length','splice','encryptString','join','sign','payload','options','verify','secrets','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt','basic-auth','bluebird','util','moment','session','role','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isAuthenticated','ChatInteraction','params','closed','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','catch','use','authorization','startsWith','headers','User'];(function(_0x3f1d02,_0x533c27){var _0x3da535=function(_0x145083){while(--_0x145083){_0x3f1d02['push'](_0x3f1d02['shift']());}};_0x3da535(++_0x533c27);}(_0x68c9,0x184));var _0x968c=function(_0x262ada,_0x3d1a45){_0x262ada=_0x262ada-0x0;var _0x5b2f76=_0x68c9[_0x262ada];return _0x5b2f76;};'use strict';var db=require(_0x968c('0x0'))['db'];var config=require(_0x968c('0x1'));var hardwareConf=require(_0x968c('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0x968c('0x3'));var expressJwt=require(_0x968c('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x968c('0x5'));var crypto=require('crypto');var BPromise=require(_0x968c('0x6'));var util=require(_0x968c('0x7'));var moment=require(_0x968c('0x8'));var validateJwt=expressJwt({'secret':config['secrets'][_0x968c('0x9')]});var userAttributes=['id',_0x968c('0xa'),'fullname','name',_0x968c('0xb'),_0x968c('0xc'),_0x968c('0xd'),_0x968c('0xe'),'md5secret',_0x968c('0xf'),_0x968c('0x10'),_0x968c('0x11'),_0x968c('0x12'),_0x968c('0x13'),_0x968c('0x14'),_0x968c('0x15'),'showWebBar','lastLoginAt',_0x968c('0x16'),_0x968c('0x17'),_0x968c('0x18'),'passwordResetAt',_0x968c('0x19'),_0x968c('0x1a'),_0x968c('0x1b'),'phoneBarDnd',_0x968c('0x1c'),_0x968c('0x1d'),_0x968c('0x1e'),'phoneBarExpires','phoneBarPrefixRequired',_0x968c('0x1f'),_0x968c('0x20'),'hotdesk',_0x968c('0x21'),_0x968c('0x22'),'privacyEnabled',_0x968c('0x23'),_0x968c('0x24'),_0x968c('0x25'),_0x968c('0x26'),_0x968c('0x27')];exports['isChatInteractionAuthorized']=function(){return this[_0x968c('0x28')](!![])['use'](function(_0x514822,_0x2e9b84,_0xacfeb8){if(_0x514822['user']){_0xacfeb8();}else{return db[_0x968c('0x29')]['findOne']({'where':{'id':_0x514822[_0x968c('0x2a')]['id']},'attributes':['id',_0x968c('0x2b'),_0x968c('0x2c')],'raw':!![]})['then'](function(_0x280c58){if(_0x280c58&&_0x280c58['closed']){return _0x2e9b84[_0x968c('0x2d')](_0x280c58[_0x968c('0x2c')]===_0x968c('0x2e')?0x195:0x193)[_0x968c('0x2f')]({'message':_0x280c58[_0x968c('0x2c')]===_0x968c('0x2e')?_0x968c('0x30'):_0x968c('0x31')});}else{_0xacfeb8();}})[_0x968c('0x32')](function(_0x517ce4){_0xacfeb8(_0x517ce4);});}});};exports['isAuthenticated']=function isAuthenticated(_0x18c6aa){return compose()[_0x968c('0x33')](function(_0x54999e,_0x5969d8,_0xf2b74f){var _0x199ea9;if(_0x54999e['headers'][_0x968c('0x34')]){if(_[_0x968c('0x35')](_0x54999e[_0x968c('0x36')][_0x968c('0x34')],'Basic')){var _0x161304=basicAuth(_0x54999e);db[_0x968c('0x37')][_0x968c('0x38')]({'where':{'name':_0x161304[_0x968c('0x39')]}})[_0x968c('0x3a')](function(_0x3f04b2){if(!_0x3f04b2||!_0x3f04b2[_0x968c('0x3b')](_0x161304[_0x968c('0x3c')])){return _0x5969d8[_0x968c('0x2d')](0x191)['json']({'message':_0x968c('0x3d')});}_0x54999e['user']={'id':_0x3f04b2['id']};_0xf2b74f();})[_0x968c('0x32')](function(_0xd0dc74){_0xf2b74f(_0xd0dc74);});}else if(_[_0x968c('0x35')](_0x54999e[_0x968c('0x36')]['authorization'],'Bearer')){validateJwt(_0x54999e,_0x5969d8,_0xf2b74f);}else{if(_0x18c6aa){_0xf2b74f();}else{return _0x5969d8['status'](0x193)[_0x968c('0x2f')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x54999e['query'][_0x968c('0x3e')]){try{var _0x199e78={'audience':hardwareConf[_0x968c('0x3f')](),'issuer':hardwareConf[_0x968c('0x3f')]()};verifyJwt(_0x54999e[_0x968c('0x40')][_0x968c('0x3e')],_0x199e78)['then'](function(_0x348f26){return db[_0x968c('0x37')][_0x968c('0x38')]({'where':{'id':_0x348f26['sub']}})[_0x968c('0x3a')](function(_0x566f53){_0x199ea9=_0x566f53;return db[_0x968c('0x41')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x968c('0x42')],'raw':!![]});})['then'](function(_0x352695){if(!_0x199ea9||!_[_0x968c('0x43')](_0x199ea9[_0x968c('0x44')],_0x348f26['nonce'])){return _0x5969d8[_0x968c('0x2d')](0x191)[_0x968c('0x2f')]({'message':_0x968c('0x45')});}if(_0x199ea9[_0x968c('0x46')]){return _0x5969d8[_0x968c('0x2d')](0x191)['json']({'message':_0x968c('0x47')});}if(_0x199ea9[_0x968c('0x48')]){if(_0x352695[_0x968c('0x42')]>0x0){if(moment(_0x199ea9[_0x968c('0x49')])['add'](_0x352695[_0x968c('0x42')],_0x968c('0x4a'))>moment()){return _0x5969d8[_0x968c('0x2d')](0x191)[_0x968c('0x2f')]({'message':_0x968c('0x47')});}}else{return _0x5969d8[_0x968c('0x2d')](0x191)[_0x968c('0x2f')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x54999e[_0x968c('0x4b')]={'id':_0x199ea9['id']};_0xf2b74f();});})['catch'](function(){return _0x5969d8[_0x968c('0x2d')](0x191)['json']({'message':_0x968c('0x47')});});}catch(_0x283445){_0xf2b74f(_0x283445);}}else if(_0x18c6aa){_0xf2b74f();}else{return _0x5969d8[_0x968c('0x2d')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0x968c('0x33')](function(_0x4666ba,_0x4f9d12,_0x50ed25){if(_0x4666ba['user']){db['User'][_0x968c('0x38')]({'where':{'id':_0x4666ba[_0x968c('0x4b')]['id']},'attributes':userAttributes})[_0x968c('0x3a')](function(_0x1c4e7b){if(!_0x1c4e7b){return _0x4f9d12['status'](0x194)[_0x968c('0x2f')]({'message':'User\x20not\x20found.'});}_0x4666ba[_0x968c('0x4b')]=_0x1c4e7b;_0x50ed25();})[_0x968c('0x32')](function(_0x6e4b12){_0x50ed25(_0x6e4b12);});}else if(_0x18c6aa){_0x50ed25();}else{return _0x4f9d12[_0x968c('0x2d')](0x194)[_0x968c('0x2f')]({'message':_0x968c('0x4c')});}});};exports[_0x968c('0x4d')]=function canUpdate(){return compose()[_0x968c('0x33')](function(_0x5aa84c,_0x5f0b41,_0x22ee5f){return licenseUtil['getLicense']()[_0x968c('0x3a')](function(_0xfa9ea0){if(_0xfa9ea0[_0x968c('0x4e')]){_0x22ee5f();}else{return _0x5f0b41['status'](0x193)[_0x968c('0x2f')]({'message':_0x968c('0x4f')});}})[_0x968c('0x32')](function(_0x5efe94){_0x22ee5f(_0x5efe94);});});};exports[_0x968c('0x50')]=function(_0x49134b,_0xebba12,_0x3f3baa){_0x49134b[_0x968c('0x50')]=!![];return _0x3f3baa();};exports['signToken']=function signToken(_0x3548df){return signJwt(_0x3548df);};exports['setTokenCookie']=function(_0x219029,_0x403b90){if(!_0x219029[_0x968c('0x4b')]){return _0x403b90[_0x968c('0x2d')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x3ee47a={'payload':{'id':_0x219029[_0x968c('0x4b')]['id'],'role':_0x219029[_0x968c('0x4b')][_0x968c('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3ee47a)[_0x968c('0x3a')](function(_0x53508d){_0x403b90[_0x968c('0x51')]('motion.token',_0x53508d);_0x403b90[_0x968c('0x52')]('/dashboards/general');})[_0x968c('0x32')](function(_0x272c3d){return _0x403b90[_0x968c('0x2d')](0x1f4)['send'](_0x272c3d);});};exports[_0x968c('0x53')]=function(_0x436009){if(_[_0x968c('0x54')](_0x436009['apiKeyNonce'])||_[_0x968c('0x54')](_0x436009[_0x968c('0x55')])){return null;}else{return createJwt(_0x436009);}};exports[_0x968c('0x56')]=function(_0xcc2a8){_0xcc2a8[_0x968c('0x44')]=generateNonce();_0xcc2a8[_0x968c('0x55')]=generateIssuedAt();return createJwt(_0xcc2a8);};exports[_0x968c('0x57')]=function(_0x269899,_0x14e2f0){var _0x1d9511=_0x269899[_0x968c('0x40')][_0x968c('0x3e')];if(_0x1d9511){var _0x34457b={'nonce':_0x14e2f0[_0x968c('0x44')],'iat':_0x14e2f0['apiKeyIat'],'audience':hardwareConf[_0x968c('0x3f')](),'issuer':hardwareConf[_0x968c('0x3f')]()};return verifyJwt(_0x1d9511,_0x34457b)[_0x968c('0x3a')](function(){return generateApiKey(_0x14e2f0);});}else{throw{'message':_0x968c('0x58')};}};exports[_0x968c('0x59')]=function(_0x2a06ce){var _0x480a1d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x480a1d[_0x968c('0x5a')](_0x2a06ce))throw new db['Sequelize'][(_0x968c('0x5b'))](_0x968c('0x5c'));return;};exports['validatePasswordHistory']=function(_0xbae998,_0x48255f,_0x4feda4){var _0x2083a8=encryptor[_0x968c('0x5d')](_0x48255f)['split'](',');for(var _0x2cfa71=0x0;_0x2cfa71<_0x4feda4;_0x2cfa71++){if(!_0x2083a8[_0x2cfa71])break;if(_0xbae998['toLowerCase']()===_0x2083a8[_0x2cfa71]['toLowerCase']()){var _0x49fc2b=util['format'](_0x968c('0x5e'),_0x4feda4);if(_0x4feda4===0x1){_0x49fc2b=_0x968c('0x5f');}throw new db[(_0x968c('0x60'))][(_0x968c('0x5b'))](_0x49fc2b);}}return;};exports['updatePasswordsHistory']=function(_0x1df9d1,_0x30cb9a){var _0x111602=_0x30cb9a?encryptor['decryptString'](_0x30cb9a)[_0x968c('0x61')](','):[];if(_0x111602[_0x968c('0x62')]===0x5){_0x111602[_0x968c('0x63')](-0x1,0x1);}_0x111602['unshift'](_0x1df9d1);return encryptor[_0x968c('0x64')](_0x111602[_0x968c('0x65')](','));};function signJwt(_0x31d535){var _0x2d347f=BPromise['promisify'](jwt[_0x968c('0x66')],{'context':jwt});var _0x2fa84a=_0x31d535['secret']||config['secrets']['session'];return new BPromise(function(_0x44d338,_0x289b43){_0x2d347f(_0x31d535[_0x968c('0x67')],_0x2fa84a,_0x31d535[_0x968c('0x68')])[_0x968c('0x3a')](function(_0x115d25){_0x44d338(_0x115d25);})[_0x968c('0x32')](function(_0x4b3c35){_0x289b43(_0x4b3c35);});});}function verifyJwt(_0x560e00,_0xe87d69,_0x2579ea){var _0xd44bc3=BPromise['promisify'](jwt[_0x968c('0x69')],{'context':jwt});var _0x354e67=_0x2579ea||config[_0x968c('0x6a')][_0x968c('0x9')];return new BPromise(function(_0x4561cb,_0x5bd229){_0xd44bc3(_0x560e00,_0x354e67,_0xe87d69)['then'](function(_0x5b32be){_0x4561cb(_0x5b32be);})[_0x968c('0x32')](function(_0x246cea){_0x5bd229(_0x246cea);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x968c('0x6b')](_0x968c('0x6c'));}function generateIssuedAt(){return Math[_0x968c('0x6d')](Date['now']()/0x3e8)[_0x968c('0x6b')]();}function createJwt(_0x4ba383){var _0x253490={'payload':{'iat':_0x4ba383[_0x968c('0x55')],'nonce':_0x4ba383[_0x968c('0x44')]},'options':{'algorithm':_0x968c('0x6e'),'subject':_0x4ba383['id'][_0x968c('0x6b')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x253490)[_0x968c('0x3a')](function(_0x5d7f07){return{'iat':_0x4ba383['apiKeyIat'],'nonce':_0x4ba383[_0x968c('0x44')],'token':_0x5d7f07};});}
\ No newline at end of file
index adb009d..a5bbeec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64a9=['createDecipher','final','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','data','update','binary','write','end','close','unlink','decryptFile','createWriteStream'];(function(_0x3fa62a,_0x20d7a8){var _0x311db3=function(_0x165b10){while(--_0x165b10){_0x3fa62a['push'](_0x3fa62a['shift']());}};_0x311db3(++_0x20d7a8);}(_0x64a9,0x165));var _0x964a=function(_0x4e5a14,_0x402955){_0x4e5a14=_0x4e5a14-0x0;var _0x4a87e1=_0x64a9[_0x4e5a14];return _0x4a87e1;};'use strict';var crypto=require(_0x964a('0x0'));var fs=require('fs');var BPromise=require(_0x964a('0x1'));var _=require(_0x964a('0x2'));var config=require(_0x964a('0x3'));var logger=require(_0x964a('0x4'))(_0x964a('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x964a('0x6')]['session'],'algorithm':_0x964a('0x7')};const fileOptions={'algorithm':_0x964a('0x8')};if(config[_0x964a('0x9')]&&config['encrypt'][_0x964a('0xa')]){var isSupported=isAlgorithmSupported(config[_0x964a('0x9')][_0x964a('0xa')]);if(isSupported){fileOptions[_0x964a('0xa')]=config['encrypt'][_0x964a('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x964a('0xb')](',\x20');logger[_0x964a('0xc')](config[_0x964a('0x9')][_0x964a('0xa')],_0x964a('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x5ddf69){return AES_SUPPORTED_RX['test'](_0x5ddf69);}function getSupportedCiphers(){return crypto[_0x964a('0xe')]()[_0x964a('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0xd34fbe){return getSupportedCiphers()[_0x964a('0x10')](_0xd34fbe)>-0x1;}function combineOptions(_0x15651f){var _0x46bfae={};for(var _0x280f13 in fileOptions){if(fileOptions[_0x964a('0x11')](_0x280f13)){_0x46bfae[_0x280f13]=fileOptions[_0x280f13];}}if(_0x15651f){for(var _0x1dec10 in _0x15651f){if(_0x15651f[_0x964a('0x11')](_0x1dec10)){_0x46bfae[_0x1dec10]=_0x15651f[_0x1dec10];}}}return _0x46bfae;}exports[_0x964a('0x12')]=function(_0x4e92a2,_0xdf27f0,_0x4e9bb4,_0x48b5d1){return new BPromise(function(_0x2118d9,_0x55245a){_0x48b5d1=combineOptions(_0x48b5d1);var _0x459576=new Buffer(_0x4e9bb4);var _0x3264dd=fs['createReadStream'](_0x4e92a2);var _0x1b42a7=fs['createWriteStream'](_0xdf27f0);var _0x1cddd9=crypto['createCipher'](_0x48b5d1[_0x964a('0xa')],_0x459576);_0x3264dd['on'](_0x964a('0x13'),function(_0x279cc3){var _0x510bb8=new Buffer(_0x1cddd9[_0x964a('0x14')](_0x279cc3),_0x964a('0x15'));_0x1b42a7[_0x964a('0x16')](_0x510bb8);});_0x3264dd['on'](_0x964a('0x17'),function(){try{var _0x342bc0=new Buffer(_0x1cddd9['final']('binary'),_0x964a('0x15'));_0x1b42a7[_0x964a('0x16')](_0x342bc0);_0x1b42a7[_0x964a('0x17')]();_0x1b42a7['on'](_0x964a('0x18'),function(){return _0x2118d9(_0xdf27f0);});}catch(_0x4a56f4){fs[_0x964a('0x19')](_0xdf27f0);return _0x55245a(_0x4a56f4);}});});};exports[_0x964a('0x1a')]=function(_0x259287,_0x4290f0,_0x854b05,_0x187714){return new BPromise(function(_0x5bd5bb,_0x2485e7){_0x187714=combineOptions(_0x187714);var _0x260ebc=new Buffer(_0x854b05);var _0x29e532=fs['createReadStream'](_0x259287);var _0x4c9dfe=fs[_0x964a('0x1b')](_0x4290f0);var _0x3cff4f=crypto[_0x964a('0x1c')](_0x187714['algorithm'],_0x260ebc);_0x29e532['on'](_0x964a('0x13'),function(_0xe5e50c){var _0x49ac95=new Buffer(_0x3cff4f['update'](_0xe5e50c),_0x964a('0x15'));_0x4c9dfe[_0x964a('0x16')](_0x49ac95);});_0x29e532['on']('end',function(){try{var _0x40aa43=new Buffer(_0x3cff4f[_0x964a('0x1d')](_0x964a('0x15')),'binary');_0x4c9dfe[_0x964a('0x16')](_0x40aa43);_0x4c9dfe[_0x964a('0x17')]();_0x4c9dfe['on'](_0x964a('0x18'),function(){return _0x5bd5bb(_0x4290f0);});}catch(_0x55af14){fs[_0x964a('0x19')](_0x4290f0);return _0x2485e7(_0x55af14);}});});};exports[_0x964a('0x1e')]=function(_0xc59cf1,_0x5a0b5c,_0x13f41b){var _0x51d203=_0x13f41b||stringOptions[_0x964a('0xa')];var _0x2997fb=_0x5a0b5c||stringOptions[_0x964a('0x1f')];var _0x26df13=crypto['createCipher'](_0x51d203,_0x2997fb);var _0x4c7406=_0x26df13[_0x964a('0x14')](_0xc59cf1,_0x964a('0x20'),_0x964a('0x21'));_0x4c7406+=_0x26df13[_0x964a('0x1d')]('base64');return _0x4c7406;};exports[_0x964a('0x22')]=function(_0x2ffcd3,_0x4b4fc1,_0x4fac21){var _0xce18d0=_0x4fac21||stringOptions['algorithm'];var _0x67bd1d=_0x4b4fc1||stringOptions['secret'];var _0x4bb1ce=crypto['createDecipher'](_0xce18d0,_0x67bd1d);var _0x232943=_0x4bb1ce['update'](_0x2ffcd3,_0x964a('0x21'),_0x964a('0x20'));_0x232943+=_0x4bb1ce[_0x964a('0x1d')](_0x964a('0x20'));return _0x232943;};
\ No newline at end of file
+var _0xe721=['close','unlink','createReadStream','createDecipher','secret','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','createWriteStream','createCipher','data','update','binary','write','end','final'];(function(_0x1a9e9e,_0x4e02c0){var _0x461061=function(_0x595613){while(--_0x595613){_0x1a9e9e['push'](_0x1a9e9e['shift']());}};_0x461061(++_0x4e02c0);}(_0xe721,0x10f));var _0x1e72=function(_0x144eea,_0x1a8159){_0x144eea=_0x144eea-0x0;var _0x1ec64b=_0xe721[_0x144eea];return _0x1ec64b;};'use strict';var crypto=require(_0x1e72('0x0'));var fs=require('fs');var BPromise=require(_0x1e72('0x1'));var _=require(_0x1e72('0x2'));var config=require(_0x1e72('0x3'));var logger=require(_0x1e72('0x4'))(_0x1e72('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x1e72('0x6')][_0x1e72('0x7')],'algorithm':_0x1e72('0x8')};const fileOptions={'algorithm':_0x1e72('0x9')};if(config[_0x1e72('0xa')]&&config[_0x1e72('0xa')][_0x1e72('0xb')]){var isSupported=isAlgorithmSupported(config[_0x1e72('0xa')][_0x1e72('0xb')]);if(isSupported){fileOptions[_0x1e72('0xb')]=config[_0x1e72('0xa')][_0x1e72('0xb')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1e72('0xc')](',\x20');logger[_0x1e72('0xd')](config[_0x1e72('0xa')][_0x1e72('0xb')],_0x1e72('0xe'),supportedAlgorithms);}}function isASupportedCipher(_0x2c75e0){return AES_SUPPORTED_RX[_0x1e72('0xf')](_0x2c75e0);}function getSupportedCiphers(){return crypto[_0x1e72('0x10')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x9eca0d){return getSupportedCiphers()[_0x1e72('0x11')](_0x9eca0d)>-0x1;}function combineOptions(_0x40a330){var _0x101768={};for(var _0x597724 in fileOptions){if(fileOptions['hasOwnProperty'](_0x597724)){_0x101768[_0x597724]=fileOptions[_0x597724];}}if(_0x40a330){for(var _0x5646cd in _0x40a330){if(_0x40a330['hasOwnProperty'](_0x5646cd)){_0x101768[_0x5646cd]=_0x40a330[_0x5646cd];}}}return _0x101768;}exports['encryptFile']=function(_0x53bdd9,_0x558bfe,_0x4de5d8,_0x57c471){return new BPromise(function(_0x123932,_0xec4b3b){_0x57c471=combineOptions(_0x57c471);var _0x46d30d=new Buffer(_0x4de5d8);var _0x300f55=fs['createReadStream'](_0x53bdd9);var _0x90650d=fs[_0x1e72('0x12')](_0x558bfe);var _0x15228d=crypto[_0x1e72('0x13')](_0x57c471[_0x1e72('0xb')],_0x46d30d);_0x300f55['on'](_0x1e72('0x14'),function(_0x35379f){var _0x102887=new Buffer(_0x15228d[_0x1e72('0x15')](_0x35379f),_0x1e72('0x16'));_0x90650d[_0x1e72('0x17')](_0x102887);});_0x300f55['on'](_0x1e72('0x18'),function(){try{var _0x4d8eaf=new Buffer(_0x15228d[_0x1e72('0x19')](_0x1e72('0x16')),_0x1e72('0x16'));_0x90650d[_0x1e72('0x17')](_0x4d8eaf);_0x90650d['end']();_0x90650d['on'](_0x1e72('0x1a'),function(){return _0x123932(_0x558bfe);});}catch(_0x13ea76){fs[_0x1e72('0x1b')](_0x558bfe);return _0xec4b3b(_0x13ea76);}});});};exports['decryptFile']=function(_0x50dd7d,_0x36e300,_0x24fcaa,_0x9b474){return new BPromise(function(_0x1d991d,_0x2a32d1){_0x9b474=combineOptions(_0x9b474);var _0xed33a5=new Buffer(_0x24fcaa);var _0x4da694=fs[_0x1e72('0x1c')](_0x50dd7d);var _0x193d27=fs[_0x1e72('0x12')](_0x36e300);var _0x1b7caf=crypto[_0x1e72('0x1d')](_0x9b474[_0x1e72('0xb')],_0xed33a5);_0x4da694['on'](_0x1e72('0x14'),function(_0x550c32){var _0xef182=new Buffer(_0x1b7caf[_0x1e72('0x15')](_0x550c32),'binary');_0x193d27['write'](_0xef182);});_0x4da694['on']('end',function(){try{var _0x105dd1=new Buffer(_0x1b7caf[_0x1e72('0x19')](_0x1e72('0x16')),_0x1e72('0x16'));_0x193d27[_0x1e72('0x17')](_0x105dd1);_0x193d27[_0x1e72('0x18')]();_0x193d27['on'](_0x1e72('0x1a'),function(){return _0x1d991d(_0x36e300);});}catch(_0x15b60a){fs[_0x1e72('0x1b')](_0x36e300);return _0x2a32d1(_0x15b60a);}});});};exports['encryptString']=function(_0x578b6d,_0x37bc6a,_0x10e256){var _0x17d44d=_0x10e256||stringOptions[_0x1e72('0xb')];var _0x5e0724=_0x37bc6a||stringOptions[_0x1e72('0x1e')];var _0x2bcb5f=crypto[_0x1e72('0x13')](_0x17d44d,_0x5e0724);var _0x275d0c=_0x2bcb5f[_0x1e72('0x15')](_0x578b6d,'utf8',_0x1e72('0x1f'));_0x275d0c+=_0x2bcb5f[_0x1e72('0x19')](_0x1e72('0x1f'));return _0x275d0c;};exports[_0x1e72('0x20')]=function(_0x5b2584,_0x2514a0,_0x35fb16){var _0x24c819=_0x35fb16||stringOptions[_0x1e72('0xb')];var _0x1d41aa=_0x2514a0||stringOptions[_0x1e72('0x1e')];var _0x10444f=crypto['createDecipher'](_0x24c819,_0x1d41aa);var _0xb87658=_0x10444f['update'](_0x5b2584,'base64','utf8');_0xb87658+=_0x10444f[_0x1e72('0x19')]('utf8');return _0xb87658;};
\ No newline at end of file
index fc178f1..1d7bcb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5b=['splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','num','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.csv','existsSync','join','csv','%s.%s','zip','info','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','exit','util','lodash','to-csv','zip-dir','rimraf','../../mysqldb','analytics','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split'];(function(_0x26187d,_0x268c61){var _0x2c4c99=function(_0x3de785){while(--_0x3de785){_0x26187d['push'](_0x26187d['shift']());}};_0x2c4c99(++_0x268c61);}(_0xee5b,0x1f4));var _0xbee5=function(_0x530069,_0x7d312d){_0x530069=_0x530069-0x0;var _0x57a355=_0xee5b[_0x530069];return _0x57a355;};'use strict';var util=require(_0xbee5('0x0'));var path=require('path');var _=require(_0xbee5('0x1'));var csv=require(_0xbee5('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xbee5('0x3'));var rimraf=require(_0xbee5('0x4'));var db=require(_0xbee5('0x5'))['db'];var dbH=require(_0xbee5('0x5'))['dbH'];var logger=require('../../config/logger')(_0xbee5('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xbee5('0x7')][0x2]);var QUERY=process[_0xbee5('0x7')][0x3];var PATH=process[_0xbee5('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4f5065,_0x5505e3){var _0x53d5b9={'status':_0x4f5065};var _0x5baf5c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5505e3){_0x53d5b9['savename']=_0x5505e3;}return db[_0xbee5('0x8')][_0xbee5('0x9')](_0x53d5b9,_0x5baf5c);}function main(){var _0x45c2c7=0x1388;var _0x20f717;logger['info'](util[_0xbee5('0xa')](_0xbee5('0xb'),EXTRACTED_REPORT_ID,_0xbee5('0xc')));return db[_0xbee5('0xd')][_0xbee5('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbee5('0xf'),_0xbee5('0x10')]})[_0xbee5('0x11')](function(_0xcef158){if(_0xcef158){_0x20f717=_0xcef158;_0x45c2c7=_0x20f717['splitSizeCsv']||0x1388;}})[_0xbee5('0x11')](function(){return dbH['sequelize'][_0xbee5('0x12')](util[_0xbee5('0xa')](_0xbee5('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xbee5('0x14')]});})['then'](function(_0x40afcb){if(!_0x40afcb[0x0]['num']){return analyticExtractedReport(_0xbee5('0x15'));}var _0x141878=[];var _0xf676b1=0x0;var _0x53b269=!![];if(_0x40afcb&&_0x40afcb[_0xbee5('0x16')]){var _0x662d2c=_0x40afcb[0x0]['num']%(_0xf676b1+_0x45c2c7);if(_0x20f717[_0xbee5('0xf')]){for(;_0x53b269;_0xf676b1+=_0x45c2c7,_0x662d2c=_0x40afcb[0x0][_0xbee5('0x17')]%(_0xf676b1+_0x45c2c7)){if(_0x662d2c==0x0||_0x662d2c==_0x40afcb[0x0][_0xbee5('0x17')]){_0x53b269=![];}_0x141878[_0xbee5('0x18')](dbH[_0xbee5('0x19')][_0xbee5('0x12')](util[_0xbee5('0xa')](_0xbee5('0x1a'),QUERY,_0x45c2c7,_0xf676b1),{'type':dbH[_0xbee5('0x19')][_0xbee5('0x1b')][_0xbee5('0x14')]}));}}else{_0x141878[_0xbee5('0x18')](dbH[_0xbee5('0x19')][_0xbee5('0x12')](QUERY,{'type':dbH[_0xbee5('0x19')]['QueryTypes']['SELECT']}));}}var _0x469a7a=path['dirname'](PATH);var _0x205491=path[_0xbee5('0x1c')](PATH,_0xbee5('0x1d'));var _0x2bfb0f=_0x20f717[_0xbee5('0xf')]&&_0x141878[_0xbee5('0x16')]>0x1;var _0x359ccf=[];if(!fs[_0xbee5('0x1e')](path[_0xbee5('0x1f')](_0x469a7a,_0x205491))&&_0x2bfb0f){fs['mkdirSync'](path['join'](_0x469a7a,_0x205491));}return BPromise['each'](_0x141878,function(_0x519473){_0x359ccf['push'](_0x519473);})[_0xbee5('0x11')](function(){for(var _0x18d7f4=0x0;_0x18d7f4<_0x359ccf[_0xbee5('0x16')];_0x18d7f4+=0x1){var _0x28c74d;var _0x169042=_0x359ccf[_0x18d7f4];if(_0x2bfb0f){_0x28c74d=path[_0xbee5('0x1f')](_0x469a7a,_0x205491,util[_0xbee5('0xa')]('%s%d.%s',_0x205491,_0x18d7f4,_0xbee5('0x20')));}else{_0x28c74d=path[_0xbee5('0x1f')](_0x469a7a,util[_0xbee5('0xa')](_0xbee5('0x21'),_0x205491,_0xbee5('0x20')));}fs['writeFileSync'](_0x28c74d,csv(_0x169042));}})[_0xbee5('0x11')](function(){if(_0x2bfb0f){zipdir(path[_0xbee5('0x1f')](_0x469a7a,_0x205491),{'saveTo':path[_0xbee5('0x1f')](_0x469a7a,util[_0xbee5('0xa')](_0xbee5('0x21'),_0x205491,_0xbee5('0x22')))},function(_0x34b7df,_0x36e8bb){});rimraf(path[_0xbee5('0x1f')](_0x469a7a,_0x205491),function(){});}})['then'](function(){logger[_0xbee5('0x23')](util['format'](_0xbee5('0x24'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbee5('0x25'),_0x2bfb0f?util['format'](_0xbee5('0x21'),_0x205491,_0x2bfb0f?'zip':_0xbee5('0x20')):null);});})[_0xbee5('0x26')](function(_0x36eb70){logger[_0xbee5('0x23')](util['format'](_0xbee5('0x27'),EXTRACTED_REPORT_ID,_0xbee5('0xc')),util[_0xbee5('0x28')](_0x36eb70,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbee5('0x29'));})['finally'](function(){process[_0xbee5('0x2a')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xcea2=['finally','exit','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','push','sequelize','SELECT','QueryTypes','dirname','basename','existsSync','join','each','%s%d.%s','csv','writeFileSync','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x2f23c3,_0x17259f){var _0x593147=function(_0x57d33){while(--_0x57d33){_0x2f23c3['push'](_0x2f23c3['shift']());}};_0x593147(++_0x17259f);}(_0xcea2,0x15a));var _0x2cea=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xcea2[_0x36eaaa];return _0x461349;};'use strict';var util=require(_0x2cea('0x0'));var path=require('path');var _=require(_0x2cea('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x2cea('0x2'));var zipdir=require(_0x2cea('0x3'));var rimraf=require(_0x2cea('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2cea('0x5'))[_0x2cea('0x6')];var logger=require(_0x2cea('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2cea('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x2cea('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xc04963,_0x805a1b){var _0x160cca={'status':_0xc04963};var _0x11c5c0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x805a1b){_0x160cca[_0x2cea('0x9')]=_0x805a1b;}return db['AnalyticExtractedReport'][_0x2cea('0xa')](_0x160cca,_0x11c5c0);}function main(){var _0x42191a=0x1388;var _0x205a4e;logger[_0x2cea('0xb')](util[_0x2cea('0xc')](_0x2cea('0xd'),EXTRACTED_REPORT_ID,_0x2cea('0xe')));return db[_0x2cea('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x2cea('0x10')]})[_0x2cea('0x11')](function(_0x528c1d){if(_0x528c1d){_0x205a4e=_0x528c1d;_0x42191a=_0x205a4e['splitSizeCsv']||0x1388;}})[_0x2cea('0x11')](function(){return dbH['sequelize'][_0x2cea('0x12')](util[_0x2cea('0xc')](_0x2cea('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x2cea('0x11')](function(_0x586ad5){if(!_0x586ad5[0x0][_0x2cea('0x14')]){return analyticExtractedReport(_0x2cea('0x15'));}var _0x981e3f=[];var _0x17322c=0x0;var _0x232dad=!![];if(_0x586ad5&&_0x586ad5[_0x2cea('0x16')]){var _0x3530d7=_0x586ad5[0x0][_0x2cea('0x14')]%(_0x17322c+_0x42191a);if(_0x205a4e['split']){for(;_0x232dad;_0x17322c+=_0x42191a,_0x3530d7=_0x586ad5[0x0][_0x2cea('0x14')]%(_0x17322c+_0x42191a)){if(_0x3530d7==0x0||_0x3530d7==_0x586ad5[0x0][_0x2cea('0x14')]){_0x232dad=![];}_0x981e3f[_0x2cea('0x17')](dbH[_0x2cea('0x18')][_0x2cea('0x12')](util[_0x2cea('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x42191a,_0x17322c),{'type':dbH[_0x2cea('0x18')]['QueryTypes'][_0x2cea('0x19')]}));}}else{_0x981e3f[_0x2cea('0x17')](dbH[_0x2cea('0x18')]['query'](QUERY,{'type':dbH[_0x2cea('0x18')][_0x2cea('0x1a')][_0x2cea('0x19')]}));}}var _0x1b389b=path[_0x2cea('0x1b')](PATH);var _0x3f6f0e=path[_0x2cea('0x1c')](PATH,'.csv');var _0x443f5d=_0x205a4e['split']&&_0x981e3f[_0x2cea('0x16')]>0x1;var _0x4926ff=[];if(!fs[_0x2cea('0x1d')](path[_0x2cea('0x1e')](_0x1b389b,_0x3f6f0e))&&_0x443f5d){fs['mkdirSync'](path[_0x2cea('0x1e')](_0x1b389b,_0x3f6f0e));}return BPromise[_0x2cea('0x1f')](_0x981e3f,function(_0x101314){_0x4926ff[_0x2cea('0x17')](_0x101314);})[_0x2cea('0x11')](function(){for(var _0x79529b=0x0;_0x79529b<_0x4926ff['length'];_0x79529b+=0x1){var _0x4ec9b3;var _0x32b6a3=_0x4926ff[_0x79529b];if(_0x443f5d){_0x4ec9b3=path[_0x2cea('0x1e')](_0x1b389b,_0x3f6f0e,util[_0x2cea('0xc')](_0x2cea('0x20'),_0x3f6f0e,_0x79529b,_0x2cea('0x21')));}else{_0x4ec9b3=path[_0x2cea('0x1e')](_0x1b389b,util[_0x2cea('0xc')]('%s.%s',_0x3f6f0e,_0x2cea('0x21')));}fs[_0x2cea('0x22')](_0x4ec9b3,csv(_0x32b6a3));}})['then'](function(){if(_0x443f5d){zipdir(path[_0x2cea('0x1e')](_0x1b389b,_0x3f6f0e),{'saveTo':path[_0x2cea('0x1e')](_0x1b389b,util[_0x2cea('0xc')](_0x2cea('0x23'),_0x3f6f0e,'zip'))},function(_0x3c0066,_0x128934){});rimraf(path['join'](_0x1b389b,_0x3f6f0e),function(){});}})[_0x2cea('0x11')](function(){logger[_0x2cea('0xb')](util[_0x2cea('0xc')](_0x2cea('0x24'),EXTRACTED_REPORT_ID,_0x2cea('0xe')));return analyticExtractedReport(_0x2cea('0x25'),_0x443f5d?util[_0x2cea('0xc')](_0x2cea('0x23'),_0x3f6f0e,_0x443f5d?_0x2cea('0x26'):_0x2cea('0x21')):null);});})[_0x2cea('0x27')](function(_0x47ea58){logger[_0x2cea('0xb')](util[_0x2cea('0xc')](_0x2cea('0x28'),EXTRACTED_REPORT_ID,_0x2cea('0xe')),util['inspect'](_0x47ea58,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2cea('0x29')](function(){process[_0x2cea('0x2a')](EXIT_CODE);});}main();
\ No newline at end of file
index 9783fd3..a20ecb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcff0=['body','push','chunk','keys','forEach','format','name','startDate','endDate','header','margin','landscape','\x20/\x20','footer','Arial','right','num','Empty','dirname','.pdf','join','%s.%s','pdf','Setting','split','splitSizePdf','then','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','SELECT','QueryTypes','existsSync','flatten','createPdfKitDocument','%s%d.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','exit','/fonts/arial-regular.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','zip-dir','rimraf','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','toString','value','length'];(function(_0x37e1c0,_0x224eb9){var _0x43f42a=function(_0x1556f6){while(--_0x1556f6){_0x37e1c0['push'](_0x37e1c0['shift']());}};_0x43f42a(++_0x224eb9);}(_0xcff0,0x95));var _0x0cff=function(_0x281e4a,_0x352394){_0x281e4a=_0x281e4a-0x0;var _0xe656ec=_0xcff0[_0x281e4a];return _0xe656ec;};'use strict';var _=require(_0x0cff('0x0'));var fs=require('fs');var util=require(_0x0cff('0x1'));var path=require(_0x0cff('0x2'));var moment=require(_0x0cff('0x3'));var htmlToPdfmake=require(_0x0cff('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x0cff('0x5'));var rimraf=require(_0x0cff('0x6'));var JSDOM=require('jsdom')[_0x0cff('0x7')];var window=new JSDOM('')[_0x0cff('0x8')];var db=require(_0x0cff('0x9'))['db'];var dbH=require(_0x0cff('0x9'))[_0x0cff('0xa')];var logger=require(_0x0cff('0xb'))(_0x0cff('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x0cff('0xd')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x0cff('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x0cff('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x24f3a6,_0x79797b){var _0x3f98a7={'status':_0x24f3a6};var _0x4dc2ce={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x79797b){_0x3f98a7[_0x0cff('0xf')]=_0x79797b;}return db['AnalyticExtractedReport'][_0x0cff('0x10')](_0x3f98a7,_0x4dc2ce);}function getHeaders(_0x215ec1){return _[_0x0cff('0x11')](_0x215ec1,function(_0x52b51b){return{'text':_0x52b51b,'style':'tableHeader'};});}function getRows(_0x2797cb,_0x270fb4){return _[_0x0cff('0x11')](_0x270fb4,function(_0x2cea3b){return _(_0x2cea3b)['pick'](_0x2797cb)[_0x0cff('0x11')](function(_0x4f4dec){return _0x4f4dec?_[_0x0cff('0x12')](_0x4f4dec):'';})[_0x0cff('0x13')]();});}function createTable(_0x3213f1,_0x4359fc){var _0x516a4f={'widths':_['fill'](Array(_0x3213f1[_0x0cff('0x14')]),0x91),'heights':function(_0x4da121){return _0x4da121===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x25e498=getHeaders(_0x3213f1);_0x516a4f[_0x0cff('0x15')][_0x0cff('0x16')](_0x25e498);var _0x11ebd8=getRows(_0x3213f1,_0x4359fc);_0x516a4f['body']=_0x516a4f[_0x0cff('0x15')]['concat'](_0x11ebd8);return _0x516a4f;}function createTables(_0x2faa6f){var _0x5add20=[];var _0x2620d5=_[_0x0cff('0x17')](Object[_0x0cff('0x18')](_0x2faa6f[0x0]),0x5);_0x2620d5[_0x0cff('0x19')](function(_0x433ef2){_0x5add20[_0x0cff('0x16')](createTable(_0x433ef2,_0x2faa6f));});return _0x5add20;}function getPDFDocDefinition(_0x5883a8){var _0x1a8966=util[_0x0cff('0x1a')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x0cff('0x1b')],moment(EXTRACTED_REPORT[_0x0cff('0x1c')])[_0x0cff('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x0cff('0x1d')])[_0x0cff('0x1a')](FORMAT));var _0x547ce6=[];for(var _0x786a29=0x0;_0x786a29<_0x5883a8[_0x0cff('0x14')];_0x786a29++){var _0x6b91ae=[];if(_0x786a29===0x0){_0x6b91ae[_0x0cff('0x16')]({'text':_0x1a8966,'style':_0x0cff('0x1e')});}var _0x3be045={'table':_0x5883a8[_0x786a29]};if(_0x786a29>0x0){_0x3be045['pageBreak']='before';_0x3be045[_0x0cff('0x1f')]=[0x0,0x46,0x0,0x0];}_0x6b91ae[_0x0cff('0x16')](_0x3be045);_0x547ce6[_0x0cff('0x16')](_0x6b91ae);}return{'pageSize':'A4','pageOrientation':_0x0cff('0x20'),'content':_0x547ce6,'footer':function(_0x5e5d6b,_0x5ef699){return{'text':_0x5e5d6b['toString']()+_0x0cff('0x21')+_0x5ef699,'style':_0x0cff('0x22')};},'defaultStyle':{'font':_0x0cff('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x0cff('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xd17792){var _0x5ed0d5=0x1388;var _0xa295ff;if(!_0xd17792[0x0][_0x0cff('0x25')]){return analyticExtractedReport(_0x0cff('0x26'));}var _0x14159e=[];var _0x599dd1=0x0;var _0x301916=!![];var _0x52b519=path[_0x0cff('0x27')](PATH);var _0x3d5f6e=path['basename'](PATH,_0x0cff('0x28'));var _0x193033=path[_0x0cff('0x29')](_0x52b519,util[_0x0cff('0x1a')](_0x0cff('0x2a'),_0x3d5f6e,_0x0cff('0x2b')));var _0x15d037=![];return db[_0x0cff('0x2c')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0cff('0x2d'),'splitSizePdf']})['then'](function(_0x575104){if(_0x575104){_0xa295ff=_0x575104;_0x5ed0d5=_0xa295ff[_0x0cff('0x2e')]||0x3e8;}})[_0x0cff('0x2f')](function(){if(_0xd17792&&_0xd17792[_0x0cff('0x14')]){var _0x598374=_0xd17792[0x0]['num']%(_0x599dd1+_0x5ed0d5);if(_0xa295ff[_0x0cff('0x2d')]){for(;_0x301916;_0x599dd1+=_0x5ed0d5,_0x598374=_0xd17792[0x0][_0x0cff('0x25')]%(_0x599dd1+_0x5ed0d5)){if(_0x598374==0x0||_0x598374==_0xd17792[0x0]['num']){_0x301916=![];}_0x14159e[_0x0cff('0x16')](dbH['sequelize'][_0x0cff('0x30')](util[_0x0cff('0x1a')](_0x0cff('0x31'),QUERY,_0x5ed0d5,_0x599dd1),{'type':dbH[_0x0cff('0x32')]['QueryTypes'][_0x0cff('0x33')]}));}}else{_0x14159e[_0x0cff('0x16')](dbH[_0x0cff('0x32')][_0x0cff('0x30')](QUERY,{'type':dbH['sequelize'][_0x0cff('0x34')]['SELECT']}));}}_0x15d037=_0xa295ff[_0x0cff('0x2d')]&&_0x14159e[_0x0cff('0x14')]>0x1;if(!fs[_0x0cff('0x35')](path[_0x0cff('0x29')](_0x52b519,_0x3d5f6e))&&_0x15d037){fs['mkdirSync'](path[_0x0cff('0x29')](_0x52b519,_0x3d5f6e));}return Promise['all'](_0x14159e);})[_0x0cff('0x2f')](function(_0x3e71cd){return createTables(_[_0x0cff('0x36')](_0x3e71cd));})[_0x0cff('0x2f')](function(_0x43c6b5){var _0x166753=getPDFDocDefinition(_0x43c6b5);var _0x2cb789=getPDFPrinter();var _0x4fa031=_0x2cb789[_0x0cff('0x37')](_0x166753);if(_0x15d037)_0x193033=path['join'](_0x52b519,_0x3d5f6e,util['format'](_0x0cff('0x38'),_0x3d5f6e,index,_0x0cff('0x2b')));return writePDFDocument(_0x4fa031,_0x193033);})[_0x0cff('0x2f')](function(){if(!_0x15d037)return;zipdir(path[_0x0cff('0x29')](_0x52b519,_0x3d5f6e),{'saveTo':path[_0x0cff('0x29')](_0x52b519,util['format'](_0x0cff('0x2a'),_0x3d5f6e,'zip'))},function(_0x38042e){if(_0x38042e)throw _0x38042e;return;});})['then'](function(){if(!_0x15d037)return;rimraf(path[_0x0cff('0x29')](_0x52b519,_0x3d5f6e),function(){});})[_0x0cff('0x2f')](function(){logger[_0x0cff('0x39')](util[_0x0cff('0x1a')](_0x0cff('0x3a'),EXTRACTED_REPORT_ID,_0x0cff('0x3b')));return analyticExtractedReport(_0x0cff('0x3c'),_0x15d037?util[_0x0cff('0x1a')]('%s.%s',_0x3d5f6e,_0x15d037?_0x0cff('0x3d'):_0x0cff('0x2b')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x0cff('0x39')](util[_0x0cff('0x1a')](_0x0cff('0x3e'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x0cff('0x3f')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x3b5fd6){EXTRACTED_REPORT=_0x3b5fd6;return dbH[_0x0cff('0x32')][_0x0cff('0x30')](util[_0x0cff('0x1a')](_0x0cff('0x40'),QUERY),{'type':dbH[_0x0cff('0x32')][_0x0cff('0x34')][_0x0cff('0x33')]});})[_0x0cff('0x2f')](extractReport)[_0x0cff('0x41')](function(_0x179be4){logger['info'](util[_0x0cff('0x1a')](_0x0cff('0x42'),EXTRACTED_REPORT_ID,_0x0cff('0x43')),util[_0x0cff('0x44')](_0x179be4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0cff('0x45'));})['finally'](function(){process[_0x0cff('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2b2581=new PdfPrinter({'Arial':{'normal':__dirname+_0x0cff('0x47'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x2b2581;}function getPDFDocDefinitionFromHTML(_0x405098,_0x5d1079){var _0x18a490=util[_0x0cff('0x1a')](_0x0cff('0x48'),_0x5d1079[_0x0cff('0x49')],_0x5d1079[_0x0cff('0x4a')]);var _0x85b014=moment()['format'](_0x0cff('0x4b'))[_0x0cff('0x12')]();var _0xc3dd0d=htmlToPdfmake(_0x405098,{'window':window,'tableAutoSize':!![]});return{'content':[_0xc3dd0d],'defaultStyle':{'font':_0x0cff('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x0cff('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x0cff('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x0cff('0x4c')}},'header':function(){return[{'text':_0x0cff('0x4d'),'style':_0x0cff('0x1e')}];},'footer':function(_0x28f1f8,_0x2fff85){return[{'text':util[_0x0cff('0x1a')](_0x0cff('0x4e'),_0x18a490,_0x28f1f8,_0x2fff85,_0x85b014),'style':_0x0cff('0x22')}];}};}function writePDFDocument(_0x37f495,_0xd4b5d7){return new Promise(function(_0x22856a,_0x3d0d8f){var _0xbdf37b=_0x37f495[_0x0cff('0x4f')](fs[_0x0cff('0x50')](_0xd4b5d7));_0xbdf37b['on'](_0x0cff('0x51'),function(){_0x22856a(_0x0cff('0x51'));});_0xbdf37b['on'](_0x0cff('0x52'),function(_0x83c174){_0x3d0d8f(_0x83c174);});_0x37f495[_0x0cff('0x53')]();});}exports[_0x0cff('0x54')]=function(_0x215cb5,_0x3a1bee){var _0xabf857=getPDFPrinter();var _0x38de4c=getPDFDocDefinitionFromHTML(_0x215cb5,_0x3a1bee);var _0x557bb2=_0xabf857[_0x0cff('0x37')](_0x38de4c);return writePDFDocument(_0x557bb2,_0x3a1bee[_0x0cff('0x2')])[_0x0cff('0x41')](function(_0x9ec742){throw _0x9ec742;});};
\ No newline at end of file
+var _0x20d5=['AnalyticExtractedReport','update','map','pick','toString','value','fill','length','auto','body','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','push','header','pageBreak','before','landscape','\x20/\x20','footer','Arial','right','num','dirname','basename','.pdf','join','pdf','Setting','find','split','splitSizePdf','then','sequelize','query','QueryTypes','SELECT','existsSync','mkdirSync','all','flatten','%s%d.%s','%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','path','lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a'];(function(_0x27f2d2,_0x29cb8c){var _0x88abea=function(_0x311ac2){while(--_0x311ac2){_0x27f2d2['push'](_0x27f2d2['shift']());}};_0x88abea(++_0x29cb8c);}(_0x20d5,0x162));var _0x520d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x520d('0x0'));var fs=require('fs');var util=require(_0x520d('0x1'));var path=require('path');var moment=require(_0x520d('0x2'));var htmlToPdfmake=require(_0x520d('0x3'));var PdfPrinter=require(_0x520d('0x4'));var zipdir=require(_0x520d('0x5'));var rimraf=require(_0x520d('0x6'));var JSDOM=require(_0x520d('0x7'))['JSDOM'];var window=new JSDOM('')[_0x520d('0x8')];var db=require(_0x520d('0x9'))['db'];var dbH=require(_0x520d('0x9'))[_0x520d('0xa')];var logger=require(_0x520d('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x520d('0xc')][0x2]);var QUERY=process[_0x520d('0xc')][0x3];var PATH=process[_0x520d('0xc')][0x4];var NAME=process[_0x520d('0xc')][0x5];var FORMAT=_0x520d('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x549dcc,_0x269d71){var _0x4843e2={'status':_0x549dcc};var _0x3cb7b2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x269d71){_0x4843e2['savename']=_0x269d71;}return db[_0x520d('0xe')][_0x520d('0xf')](_0x4843e2,_0x3cb7b2);}function getHeaders(_0x177a90){return _[_0x520d('0x10')](_0x177a90,function(_0x340d7a){return{'text':_0x340d7a,'style':'tableHeader'};});}function getRows(_0x3f5c55,_0x5f0ad2){return _[_0x520d('0x10')](_0x5f0ad2,function(_0x5d0fa4){return _(_0x5d0fa4)[_0x520d('0x11')](_0x3f5c55)['map'](function(_0x1d1f5d){return _0x1d1f5d?_[_0x520d('0x12')](_0x1d1f5d):'';})[_0x520d('0x13')]();});}function createTable(_0x4f456f,_0x51e6a9){var _0xfc4148={'widths':_[_0x520d('0x14')](Array(_0x4f456f[_0x520d('0x15')]),0x91),'heights':function(_0x13fd62){return _0x13fd62===0x0?_0x520d('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x58bf8e=getHeaders(_0x4f456f);_0xfc4148[_0x520d('0x17')]['push'](_0x58bf8e);var _0x32c3ad=getRows(_0x4f456f,_0x51e6a9);_0xfc4148[_0x520d('0x17')]=_0xfc4148['body'][_0x520d('0x18')](_0x32c3ad);return _0xfc4148;}function createTables(_0x190dce){var _0x3bf705=[];var _0x30236c=_[_0x520d('0x19')](Object[_0x520d('0x1a')](_0x190dce[0x0]),0x5);_0x30236c[_0x520d('0x1b')](function(_0x5bd669){_0x3bf705['push'](createTable(_0x5bd669,_0x190dce));});return _0x3bf705;}function getPDFDocDefinition(_0x45d696){var _0x9aebe0=util['format'](_0x520d('0x1c'),NAME,EXTRACTED_REPORT[_0x520d('0x1d')],moment(EXTRACTED_REPORT[_0x520d('0x1e')])[_0x520d('0x1f')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x520d('0x1f')](FORMAT));var _0x3fa0b6=[];for(var _0x25dd49=0x0;_0x25dd49<_0x45d696[_0x520d('0x15')];_0x25dd49++){var _0x48cdcf=[];if(_0x25dd49===0x0){_0x48cdcf[_0x520d('0x20')]({'text':_0x9aebe0,'style':_0x520d('0x21')});}var _0x11600c={'table':_0x45d696[_0x25dd49]};if(_0x25dd49>0x0){_0x11600c[_0x520d('0x22')]=_0x520d('0x23');_0x11600c['margin']=[0x0,0x46,0x0,0x0];}_0x48cdcf['push'](_0x11600c);_0x3fa0b6['push'](_0x48cdcf);}return{'pageSize':'A4','pageOrientation':_0x520d('0x24'),'content':_0x3fa0b6,'footer':function(_0x9d5e43,_0x2d6544){return{'text':_0x9d5e43[_0x520d('0x12')]()+_0x520d('0x25')+_0x2d6544,'style':_0x520d('0x26')};},'defaultStyle':{'font':_0x520d('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x520d('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x35fe26){var _0x233fc7=0x1388;var _0x28c342;if(!_0x35fe26[0x0][_0x520d('0x29')]){return analyticExtractedReport('Empty');}var _0x2ffe35=[];var _0x337fde=0x0;var _0x4a293d=!![];var _0x41e417=path[_0x520d('0x2a')](PATH);var _0x41872c=path[_0x520d('0x2b')](PATH,_0x520d('0x2c'));var _0x30513e=path[_0x520d('0x2d')](_0x41e417,util[_0x520d('0x1f')]('%s.%s',_0x41872c,_0x520d('0x2e')));var _0x1f4892=![];return db[_0x520d('0x2f')][_0x520d('0x30')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x520d('0x31'),_0x520d('0x32')]})[_0x520d('0x33')](function(_0x3a73a3){if(_0x3a73a3){_0x28c342=_0x3a73a3;_0x233fc7=_0x28c342[_0x520d('0x32')]||0x3e8;}})[_0x520d('0x33')](function(){if(_0x35fe26&&_0x35fe26[_0x520d('0x15')]){var _0x1f1991=_0x35fe26[0x0][_0x520d('0x29')]%(_0x337fde+_0x233fc7);if(_0x28c342[_0x520d('0x31')]){for(;_0x4a293d;_0x337fde+=_0x233fc7,_0x1f1991=_0x35fe26[0x0][_0x520d('0x29')]%(_0x337fde+_0x233fc7)){if(_0x1f1991==0x0||_0x1f1991==_0x35fe26[0x0][_0x520d('0x29')]){_0x4a293d=![];}_0x2ffe35[_0x520d('0x20')](dbH[_0x520d('0x34')][_0x520d('0x35')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x233fc7,_0x337fde),{'type':dbH['sequelize'][_0x520d('0x36')][_0x520d('0x37')]}));}}else{_0x2ffe35[_0x520d('0x20')](dbH[_0x520d('0x34')][_0x520d('0x35')](QUERY,{'type':dbH[_0x520d('0x34')]['QueryTypes'][_0x520d('0x37')]}));}}_0x1f4892=_0x28c342[_0x520d('0x31')]&&_0x2ffe35[_0x520d('0x15')]>0x1;if(!fs[_0x520d('0x38')](path[_0x520d('0x2d')](_0x41e417,_0x41872c))&&_0x1f4892){fs[_0x520d('0x39')](path[_0x520d('0x2d')](_0x41e417,_0x41872c));}return Promise[_0x520d('0x3a')](_0x2ffe35);})[_0x520d('0x33')](function(_0x37900c){return createTables(_[_0x520d('0x3b')](_0x37900c));})[_0x520d('0x33')](function(_0x3fa7b3){var _0x376ada=getPDFDocDefinition(_0x3fa7b3);var _0x570096=getPDFPrinter();var _0x29772a=_0x570096['createPdfKitDocument'](_0x376ada);if(_0x1f4892)_0x30513e=path[_0x520d('0x2d')](_0x41e417,_0x41872c,util[_0x520d('0x1f')](_0x520d('0x3c'),_0x41872c,index,_0x520d('0x2e')));return writePDFDocument(_0x29772a,_0x30513e);})[_0x520d('0x33')](function(){if(!_0x1f4892)return;zipdir(path[_0x520d('0x2d')](_0x41e417,_0x41872c),{'saveTo':path[_0x520d('0x2d')](_0x41e417,util['format'](_0x520d('0x3d'),_0x41872c,'zip'))},function(_0x5051eb){if(_0x5051eb)throw _0x5051eb;return;});})[_0x520d('0x33')](function(){if(!_0x1f4892)return;rimraf(path['join'](_0x41e417,_0x41872c),function(){});})[_0x520d('0x33')](function(){logger[_0x520d('0x3e')](util[_0x520d('0x1f')](_0x520d('0x3f'),EXTRACTED_REPORT_ID,_0x520d('0x40')));return analyticExtractedReport(_0x520d('0x41'),_0x1f4892?util['format'](_0x520d('0x3d'),_0x41872c,_0x1f4892?_0x520d('0x42'):_0x520d('0x2e')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x520d('0x3e')](util[_0x520d('0x1f')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x520d('0x43')));return db['AnalyticExtractedReport'][_0x520d('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x520d('0x33')](function(_0x1a0cf0){EXTRACTED_REPORT=_0x1a0cf0;return dbH[_0x520d('0x34')]['query'](util[_0x520d('0x1f')](_0x520d('0x45'),QUERY),{'type':dbH[_0x520d('0x34')]['QueryTypes'][_0x520d('0x37')]});})[_0x520d('0x33')](extractReport)[_0x520d('0x46')](function(_0x8cfb7b){logger[_0x520d('0x3e')](util[_0x520d('0x1f')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0x520d('0x47')](_0x8cfb7b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x520d('0x48'));})[_0x520d('0x49')](function(){process[_0x520d('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5af7d8=new PdfPrinter({'Arial':{'normal':__dirname+_0x520d('0x4b'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x520d('0x4c'),'bolditalics':__dirname+_0x520d('0x4d')}});return _0x5af7d8;}function getPDFDocDefinitionFromHTML(_0x35e0f1,_0x1c83b7){var _0x181e9f=util['format'](_0x520d('0x4e'),_0x1c83b7[_0x520d('0x4f')],_0x1c83b7['interactionId']);var _0x327591=moment()['format'](_0x520d('0x50'))[_0x520d('0x12')]();var _0x497460=htmlToPdfmake(_0x35e0f1,{'window':window,'tableAutoSize':!![]});return{'content':[_0x497460],'defaultStyle':{'font':_0x520d('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x520d('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x520d('0x52'),'style':_0x520d('0x21')}];},'footer':function(_0x3fbed7,_0x29c01c){return[{'text':util['format'](_0x520d('0x53'),_0x181e9f,_0x3fbed7,_0x29c01c,_0x327591),'style':'footer'}];}};}function writePDFDocument(_0x1ce463,_0x430cef){return new Promise(function(_0x390781,_0x23ffd4){var _0x160dd9=_0x1ce463[_0x520d('0x54')](fs[_0x520d('0x55')](_0x430cef));_0x160dd9['on'](_0x520d('0x56'),function(){_0x390781('finish');});_0x160dd9['on'](_0x520d('0x57'),function(_0xb0d222){_0x23ffd4(_0xb0d222);});_0x1ce463[_0x520d('0x58')]();});}exports[_0x520d('0x59')]=function(_0x1d2d10,_0x586260){var _0x529608=getPDFPrinter();var _0x254ddd=getPDFDocDefinitionFromHTML(_0x1d2d10,_0x586260);var _0x57db96=_0x529608[_0x520d('0x5a')](_0x254ddd);return writePDFDocument(_0x57db96,_0x586260[_0x520d('0x5b')])['catch'](function(_0x5d32d2){throw _0x5d32d2;});};
\ No newline at end of file
index 7a5330d..074ac5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x304a=['split','splitSizeXlsx','then','sequelize','query','format','num','Empty','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.xlsx','length','existsSync','join','mkdirSync','each','push','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find'];(function(_0x264e7f,_0x4b8f91){var _0x173e6e=function(_0x525cfc){while(--_0x525cfc){_0x264e7f['push'](_0x264e7f['shift']());}};_0x173e6e(++_0x4b8f91);}(_0x304a,0xb1));var _0xa304=function(_0x57008e,_0x54ae31){_0x57008e=_0x57008e-0x0;var _0x4608de=_0x304a[_0x57008e];return _0x4608de;};'use strict';var util=require(_0xa304('0x0'));var path=require(_0xa304('0x1'));var _=require(_0xa304('0x2'));var fs=require('fs');var json2xls=require(_0xa304('0x3'));var BPromise=require(_0xa304('0x4'));var zipdir=require(_0xa304('0x5'));var rimraf=require(_0xa304('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa304('0x7'))[_0xa304('0x8')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xa304('0x9')][0x3];var PATH=process[_0xa304('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x59b04f,_0x1bcd38){var _0x25ef83={'status':_0x59b04f};var _0x1edf18={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1bcd38){_0x25ef83['savename']=_0x1bcd38;}return db['AnalyticExtractedReport'][_0xa304('0xa')](_0x25ef83,_0x1edf18);}function main(){var _0x275a25=0x1388;var _0x41480e;logger[_0xa304('0xb')](util['format'](_0xa304('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xa304('0xd')][_0xa304('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa304('0xf'),_0xa304('0x10')]})[_0xa304('0x11')](function(_0x36cb5d){if(_0x36cb5d){_0x41480e=_0x36cb5d;_0x275a25=_0x41480e['splitSizeXlsx']||0x1388;}})[_0xa304('0x11')](function(){return dbH[_0xa304('0x12')][_0xa304('0x13')](util[_0xa304('0x14')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})['then'](function(_0x2de6d4){if(!_0x2de6d4[0x0][_0xa304('0x15')]){return analyticExtractedReport(_0xa304('0x16'));}var _0x284376=[];var _0x3f1062=0x0;var _0x3c871f=!![];if(_0x41480e['split']){if(_0x2de6d4&&_0x2de6d4['length']){var _0x1088ed=_0x2de6d4[0x0]['num']%(_0x3f1062+_0x275a25);for(;_0x3c871f;_0x3f1062+=_0x275a25,_0x1088ed=_0x2de6d4[0x0][_0xa304('0x15')]%(_0x3f1062+_0x275a25)){if(_0x1088ed==0x0||_0x1088ed==_0x2de6d4[0x0][_0xa304('0x15')]){_0x3c871f=![];}_0x284376['push'](dbH[_0xa304('0x12')][_0xa304('0x13')](util['format'](_0xa304('0x17'),QUERY,_0x275a25,_0x3f1062),{'type':dbH[_0xa304('0x12')][_0xa304('0x18')][_0xa304('0x19')]}));}}}else{_0x284376['push'](dbH[_0xa304('0x12')][_0xa304('0x13')](QUERY,{'type':dbH[_0xa304('0x12')][_0xa304('0x18')][_0xa304('0x19')]}));}var _0x516d0c=path[_0xa304('0x1a')](PATH);var _0x3d82db=path['basename'](PATH,_0xa304('0x1b'));var _0x1fd46f=_0x41480e[_0xa304('0xf')]&&_0x284376[_0xa304('0x1c')]>0x1;var _0x453f78=[];if(!fs[_0xa304('0x1d')](path[_0xa304('0x1e')](_0x516d0c,_0x3d82db))&&_0x1fd46f){fs[_0xa304('0x1f')](path['join'](_0x516d0c,_0x3d82db));}return BPromise[_0xa304('0x20')](_0x284376,function(_0x17c04b){_0x453f78[_0xa304('0x21')](_0x17c04b);})[_0xa304('0x11')](function(){for(var _0x16ce81=0x0;_0x16ce81<_0x453f78[_0xa304('0x1c')];_0x16ce81+=0x1){var _0x49df89;var _0x21afbd=_0x453f78[_0x16ce81];if(_0x1fd46f){_0x49df89=path[_0xa304('0x1e')](_0x516d0c,_0x3d82db,util[_0xa304('0x14')](_0xa304('0x22'),_0x3d82db,_0x16ce81,_0xa304('0x23')));}else{_0x49df89=path[_0xa304('0x1e')](_0x516d0c,util[_0xa304('0x14')](_0xa304('0x24'),_0x3d82db,'xlsx'));}fs[_0xa304('0x25')](_0x49df89,json2xls(_0x21afbd),_0xa304('0x26'));}})[_0xa304('0x11')](function(){if(_0x1fd46f){zipdir(path[_0xa304('0x1e')](_0x516d0c,_0x3d82db),{'saveTo':path[_0xa304('0x1e')](_0x516d0c,util[_0xa304('0x14')]('%s.%s',_0x3d82db,'zip'))},function(_0x442a51,_0x4e56c3){});rimraf(path[_0xa304('0x1e')](_0x516d0c,_0x3d82db),function(){});}})['then'](function(){logger[_0xa304('0xb')](util[_0xa304('0x14')](_0xa304('0x27'),EXTRACTED_REPORT_ID,_0xa304('0x28')));return analyticExtractedReport(_0xa304('0x29'),_0x1fd46f?util[_0xa304('0x14')](_0xa304('0x24'),_0x3d82db,_0x1fd46f?_0xa304('0x2a'):_0xa304('0x23')):null);});})[_0xa304('0x2b')](function(_0x291261){logger[_0xa304('0xb')](util[_0xa304('0x14')](_0xa304('0x2c'),EXTRACTED_REPORT_ID,_0xa304('0x28')),util[_0xa304('0x2d')](_0x291261,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa304('0x2e'));})['finally'](function(){process[_0xa304('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xcc2e=['writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s'];(function(_0x41daf6,_0x3459d7){var _0x5168b4=function(_0x10adb0){while(--_0x10adb0){_0x41daf6['push'](_0x41daf6['shift']());}};_0x5168b4(++_0x3459d7);}(_0xcc2e,0x65));var _0xecc2=function(_0x49f3bd,_0x29343b){_0x49f3bd=_0x49f3bd-0x0;var _0x4e5341=_0xcc2e[_0x49f3bd];return _0x4e5341;};'use strict';var util=require('util');var path=require('path');var _=require(_0xecc2('0x0'));var fs=require('fs');var json2xls=require(_0xecc2('0x1'));var BPromise=require(_0xecc2('0x2'));var zipdir=require(_0xecc2('0x3'));var rimraf=require(_0xecc2('0x4'));var db=require(_0xecc2('0x5'))['db'];var dbH=require(_0xecc2('0x5'))[_0xecc2('0x6')];var logger=require('../../config/logger')(_0xecc2('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xecc2('0x8')][0x2]);var QUERY=process[_0xecc2('0x8')][0x3];var PATH=process[_0xecc2('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x38c8f4,_0x2f1a64){var _0x51df04={'status':_0x38c8f4};var _0x570971={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2f1a64){_0x51df04['savename']=_0x2f1a64;}return db['AnalyticExtractedReport'][_0xecc2('0x9')](_0x51df04,_0x570971);}function main(){var _0x2b220d=0x1388;var _0x16c203;logger[_0xecc2('0xa')](util[_0xecc2('0xb')](_0xecc2('0xc'),EXTRACTED_REPORT_ID,_0xecc2('0xd')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xecc2('0xe'),_0xecc2('0xf')]})[_0xecc2('0x10')](function(_0x3802e3){if(_0x3802e3){_0x16c203=_0x3802e3;_0x2b220d=_0x16c203[_0xecc2('0xf')]||0x1388;}})['then'](function(){return dbH[_0xecc2('0x11')][_0xecc2('0x12')](util[_0xecc2('0xb')](_0xecc2('0x13'),QUERY),{'type':dbH[_0xecc2('0x11')]['QueryTypes'][_0xecc2('0x14')]});})[_0xecc2('0x10')](function(_0x1167fd){if(!_0x1167fd[0x0][_0xecc2('0x15')]){return analyticExtractedReport(_0xecc2('0x16'));}var _0xc5364=[];var _0x35b462=0x0;var _0x1f14b7=!![];if(_0x16c203['split']){if(_0x1167fd&&_0x1167fd[_0xecc2('0x17')]){var _0x19b365=_0x1167fd[0x0][_0xecc2('0x15')]%(_0x35b462+_0x2b220d);for(;_0x1f14b7;_0x35b462+=_0x2b220d,_0x19b365=_0x1167fd[0x0][_0xecc2('0x15')]%(_0x35b462+_0x2b220d)){if(_0x19b365==0x0||_0x19b365==_0x1167fd[0x0][_0xecc2('0x15')]){_0x1f14b7=![];}_0xc5364[_0xecc2('0x18')](dbH[_0xecc2('0x11')]['query'](util[_0xecc2('0xb')](_0xecc2('0x19'),QUERY,_0x2b220d,_0x35b462),{'type':dbH[_0xecc2('0x11')][_0xecc2('0x1a')][_0xecc2('0x14')]}));}}}else{_0xc5364[_0xecc2('0x18')](dbH[_0xecc2('0x11')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x4a19d0=path[_0xecc2('0x1b')](PATH);var _0x128bbe=path[_0xecc2('0x1c')](PATH,_0xecc2('0x1d'));var _0x578017=_0x16c203[_0xecc2('0xe')]&&_0xc5364[_0xecc2('0x17')]>0x1;var _0x38243a=[];if(!fs[_0xecc2('0x1e')](path['join'](_0x4a19d0,_0x128bbe))&&_0x578017){fs[_0xecc2('0x1f')](path[_0xecc2('0x20')](_0x4a19d0,_0x128bbe));}return BPromise[_0xecc2('0x21')](_0xc5364,function(_0xa09448){_0x38243a[_0xecc2('0x18')](_0xa09448);})[_0xecc2('0x10')](function(){for(var _0x143a62=0x0;_0x143a62<_0x38243a[_0xecc2('0x17')];_0x143a62+=0x1){var _0x175df4;var _0x1ecda3=_0x38243a[_0x143a62];if(_0x578017){_0x175df4=path['join'](_0x4a19d0,_0x128bbe,util[_0xecc2('0xb')](_0xecc2('0x22'),_0x128bbe,_0x143a62,_0xecc2('0x23')));}else{_0x175df4=path[_0xecc2('0x20')](_0x4a19d0,util['format'](_0xecc2('0x24'),_0x128bbe,'xlsx'));}fs[_0xecc2('0x25')](_0x175df4,json2xls(_0x1ecda3),_0xecc2('0x26'));}})[_0xecc2('0x10')](function(){if(_0x578017){zipdir(path[_0xecc2('0x20')](_0x4a19d0,_0x128bbe),{'saveTo':path[_0xecc2('0x20')](_0x4a19d0,util[_0xecc2('0xb')]('%s.%s',_0x128bbe,_0xecc2('0x27')))},function(_0x4462f3,_0x127bda){});rimraf(path[_0xecc2('0x20')](_0x4a19d0,_0x128bbe),function(){});}})['then'](function(){logger[_0xecc2('0xa')](util['format'](_0xecc2('0x28'),EXTRACTED_REPORT_ID,_0xecc2('0xd')));return analyticExtractedReport('Completed',_0x578017?util[_0xecc2('0xb')](_0xecc2('0x24'),_0x128bbe,_0x578017?'zip':'xlsx'):null);});})[_0xecc2('0x29')](function(_0xfc152d){logger[_0xecc2('0xa')](util[_0xecc2('0xb')](_0xecc2('0x2a'),EXTRACTED_REPORT_ID,_0xecc2('0xd')),util[_0xecc2('0x2b')](_0xfc152d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xecc2('0x2c'));})[_0xecc2('0x2d')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index d5974b8..e2592ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ddd=['ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','map','exten','filter','groupBy','playback','hasOwnProperty','priority','extensions','find','push','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','extension','CDR(destination)=','${EXTEN:','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','*,*,*,*','IntervalId','interval','tag','CDR(tag)=','callerID'];(function(_0x5b5f6e,_0x33f660){var _0x5a8ed7=function(_0x5285d7){while(--_0x5285d7){_0x5b5f6e['push'](_0x5b5f6e['shift']());}};_0x5a8ed7(++_0x33f660);}(_0x6ddd,0x1d8));var _0xd6dd=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6ddd[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xd6dd('0x0'));var util=require(_0xd6dd('0x1'));function rewrite(_0x59e26b,_0x4c9122){var _0x29aad2=this;return _0x59e26b[_0xd6dd('0x2')][_0xd6dd('0x3')][_0xd6dd('0x4')]({'raw':!![]})[_0xd6dd('0x5')](function(_0x40fc25){_0x29aad2['intervals']=_0x40fc25;return _0x59e26b[_0xd6dd('0x2')]['VoiceExtension'][_0xd6dd('0x4')]({'where':{'IntervalId':_0x4c9122['IntervalId']},'raw':!![]});})[_0xd6dd('0x5')](function(_0x505ca9){return _0x59e26b[_0xd6dd('0x2')][_0xd6dd('0x6')][_0xd6dd('0x4')]({'where':{'exten':{'$in':_[_0xd6dd('0x7')](_[_0xd6dd('0x8')](_0x505ca9,_0xd6dd('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xd6dd('0x5')](function(_0x3a325b){var _0x33256d=_[_0xd6dd('0xa')](_0x3a325b,{'priority':'1'});var _0x108d97=_[_0xd6dd('0xa')](_0x3a325b,{'isApp':0x1});var _0x526fdd=_[_0xd6dd('0xb')](_0x108d97,'exten');var _0x55ef1f=['queue',_0xd6dd('0xc')];var _0x456798=[];var _0x14e38d=[];for(var _0x2aec56 in _0x526fdd){if(_0x526fdd[_0xd6dd('0xd')](_0x2aec56)){_0x29aad2[_0xd6dd('0xe')]=0x2;_0x29aad2[_0xd6dd('0xf')]=[];_0x29aad2['extension']=_[_0xd6dd('0x10')](_0x33256d,{'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')]});_0x29aad2['extensions'][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':util[_0xd6dd('0x14')](_0xd6dd('0x15'),_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')]),'context':_0x526fdd[_0x2aec56][0x0]['context'],'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'priority':_0x29aad2[_0xd6dd('0xe')]++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});if(_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')]===_0xd6dd('0x17')){_0x29aad2[_0xd6dd('0xf')][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':'Set','appdata':_0xd6dd('0x18')+_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')],'context':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x19')],'exten':_0x526fdd[_0x2aec56][0x0]['exten'],'priority':_0x29aad2[_0xd6dd('0xe')]++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0]['VoiceExtensionId']});}else if(_0x526fdd[_0x2aec56][0x0]['type']===_0xd6dd('0x1a')){if(_0x29aad2[_0xd6dd('0x1b')]){_0x29aad2['extensions']['push']({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x1c')+(_0x29aad2['extension']['cutdigits']?_0xd6dd('0x1d')+_0x29aad2[_0xd6dd('0x1b')][_0xd6dd('0x1e')]+'}':'${EXTEN}'),'context':_0x526fdd[_0x2aec56][0x0]['context'],'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'priority':_0x29aad2['priority']++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});}_0x29aad2[_0xd6dd('0xf')][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x18')+_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')],'context':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x19')],'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'priority':_0x29aad2[_0xd6dd('0xe')]++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});var _0x2d2dd5=_0x29aad2[_0xd6dd('0xe')]++;_0x29aad2['extensions'][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':'ExecIf','appdata':_0xd6dd('0x1f')+(_0x2d2dd5+0x2)+_0xd6dd('0x20')+(_0x2d2dd5+0x1)+')','context':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x19')],'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'priority':_0x2d2dd5,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});if(_0x29aad2[_0xd6dd('0x1b')]){_0x29aad2[_0xd6dd('0xf')]['push']({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':_0x29aad2[_0xd6dd('0x1b')]['cutdigits']?_0xd6dd('0x21')+_0x29aad2['extension']['cutdigits']+'}':_0xd6dd('0x22'),'context':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x19')],'exten':_0x526fdd[_0x2aec56][0x0]['exten'],'priority':_0x29aad2[_0xd6dd('0xe')]++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});}_0x29aad2['extensions'][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x23')+_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')],'context':_0x526fdd[_0x2aec56][0x0]['context'],'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'priority':_0x29aad2['priority']++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});if(_0x29aad2[_0xd6dd('0x1b')]&&_0x29aad2[_0xd6dd('0x1b')][_0xd6dd('0xd')](_0xd6dd('0x24'))&&_0x29aad2[_0xd6dd('0x1b')]['recordingFormat']!==_0xd6dd('0x25')){_0x29aad2[_0xd6dd('0xf')][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x26'),'context':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x19')],'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'priority':_0x29aad2[_0xd6dd('0xe')]++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});_0x29aad2['extensions']['push']({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x27')+_0x29aad2['extension'][_0xd6dd('0x24')]||_0xd6dd('0x28'),'context':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x19')],'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'priority':_0x29aad2[_0xd6dd('0xe')]++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0]['VoiceExtensionId']});}}_0x29aad2[_0xd6dd('0xf')][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0]['type'],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x29'),'context':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x19')],'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'priority':_0x29aad2['priority']++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});_0x29aad2[_0xd6dd('0xf')][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x2a'),'context':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x19')],'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'priority':_0x29aad2[_0xd6dd('0xe')]++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});_0x29aad2[_0xd6dd('0xf')][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x2b'),'context':_0x526fdd[_0x2aec56][0x0]['context'],'exten':_0x526fdd[_0x2aec56][0x0]['exten'],'priority':_0x29aad2['priority']++,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});for(var _0x32d2a1=0x0,_0x4e3020=0x0;_0x32d2a1<_0x526fdd[_0x2aec56][_0xd6dd('0x2c')];_0x32d2a1+=0x1,_0x4e3020=0x0){var _0x4c1367=_0x526fdd[_0x2aec56][_0x32d2a1];if(_0x4c1367[_0xd6dd('0x12')]){_0x4c1367[_0xd6dd('0x12')]=_0x4c1367[_0xd6dd('0x12')][_0xd6dd('0x2d')]();}var _0x3e48b5=[];var _0x327c2a=[];delete _0x4c1367['id'];delete _0x4c1367['createdAt'];delete _0x4c1367[_0xd6dd('0x2e')];var _0x458c72=_0x4c1367['interval']!==_0xd6dd('0x2f')?[_0x4c1367['interval']]:_0x4c1367[_0xd6dd('0x30')]?_[_0xd6dd('0x8')](_[_0xd6dd('0xa')](_0x29aad2['intervals'],{'IntervalId':_0x4c1367[_0xd6dd('0x30')]}),_0xd6dd('0x31')):[];if(_0x4c1367[_0xd6dd('0xd')](_0xd6dd('0x32'))){if(_0x4c1367[_0xd6dd('0x32')]&&_0x4c1367[_0xd6dd('0x32')]!=='--'){_0x3e48b5[_0xd6dd('0x11')]({'type':_0x4c1367['type'],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x33')+_0x4c1367[_0xd6dd('0x32')],'context':_0x4c1367[_0xd6dd('0x19')],'exten':_0x4c1367[_0xd6dd('0x9')],'priority':_0x458c72[_0xd6dd('0x2c')]+_0x29aad2['priority']+_0x4e3020++,'VoiceExtensionId':_0x4c1367[_0xd6dd('0x16')]});}}if(_0x4c1367[_0xd6dd('0x12')]==='outbound'&&_0x4c1367[_0xd6dd('0xd')](_0xd6dd('0x34'))){if(_0x4c1367[_0xd6dd('0x34')]){_0x3e48b5[_0xd6dd('0x11')]({'type':_0x4c1367['type'],'app':_0xd6dd('0x35'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x4c1367[_0xd6dd('0x34')]+')','context':_0x4c1367['context'],'exten':_0x4c1367['exten'],'priority':_0x458c72[_0xd6dd('0x2c')]+_0x29aad2[_0xd6dd('0xe')]+_0x4e3020++,'VoiceExtensionId':_0x4c1367[_0xd6dd('0x16')]});}else{_0x3e48b5['push']({'type':_0x4c1367[_0xd6dd('0x12')],'app':_0xd6dd('0x35'),'appdata':_0xd6dd('0x36'),'context':_0x4c1367['context'],'exten':_0x4c1367['exten'],'priority':_0x458c72[_0xd6dd('0x2c')]+_0x29aad2[_0xd6dd('0xe')]+_0x4e3020++,'VoiceExtensionId':_0x4c1367['VoiceExtensionId']});}}if(_0x4c1367['hasOwnProperty']('answer')){if(_0x55ef1f[_0xd6dd('0x37')](_0x4c1367[_0xd6dd('0x38')][_0xd6dd('0x2d')]())>=0x0&&_0x4c1367[_0xd6dd('0x39')]!==_0xd6dd('0x3a')){if(_0x4c1367['answer']){_0x3e48b5[_0xd6dd('0x11')]({'type':_0x4c1367[_0xd6dd('0x12')],'app':_0xd6dd('0x35'),'appdata':_0xd6dd('0x3b'),'context':_0x4c1367['context'],'exten':_0x4c1367[_0xd6dd('0x9')],'priority':_0x458c72[_0xd6dd('0x2c')]+_0x29aad2[_0xd6dd('0xe')]+_0x4e3020++,'VoiceExtensionId':_0x4c1367[_0xd6dd('0x16')]});_0x3e48b5[_0xd6dd('0x11')]({'type':_0x4c1367[_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':_0xd6dd('0x3c'),'context':_0x4c1367[_0xd6dd('0x19')],'exten':_0x4c1367[_0xd6dd('0x9')],'priority':_0x458c72['length']+_0x29aad2[_0xd6dd('0xe')]+_0x4e3020++,'VoiceExtensionId':_0x4c1367[_0xd6dd('0x16')]});}else{_0x3e48b5[_0xd6dd('0x11')]({'type':_0x4c1367[_0xd6dd('0x12')],'app':_0xd6dd('0x35'),'appdata':_0xd6dd('0x3d'),'context':_0x4c1367[_0xd6dd('0x19')],'exten':_0x4c1367[_0xd6dd('0x9')],'priority':_0x458c72[_0xd6dd('0x2c')]+_0x29aad2[_0xd6dd('0xe')]+_0x4e3020++,'VoiceExtensionId':_0x4c1367['VoiceExtensionId']});_0x3e48b5['push']({'type':_0x4c1367[_0xd6dd('0x12')],'app':_0xd6dd('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4c1367['context'],'exten':_0x4c1367[_0xd6dd('0x9')],'priority':_0x458c72[_0xd6dd('0x2c')]+_0x29aad2['priority']+_0x4e3020++,'VoiceExtensionId':_0x4c1367[_0xd6dd('0x16')]});}}}for(var _0x3578a9=0x0;_0x3578a9<_0x458c72['length'];_0x3578a9+=0x1){var _0x9219c5=_0x29aad2['priority']+_0x458c72['length'];var _0x577128=_0x3578a9===_0x458c72['length']-0x1?_0x29aad2['priority']+_0x3e48b5[_0xd6dd('0x2c')]+_0x327c2a['length']+0x2:_0x29aad2['priority']+_0x3578a9+0x1;_0x3e48b5[_0xd6dd('0x3e')](_0x3578a9,0x0,{'type':_0x4c1367[_0xd6dd('0x12')],'app':_0xd6dd('0x3f'),'appdata':_0x458c72[_0x3578a9]+'?'+_0x4c1367[_0xd6dd('0x19')]+_0xd6dd('0x40')+_0x9219c5+':'+_0x4c1367[_0xd6dd('0x19')]+',${EXTEN},'+_0x577128,'exten':_0x4c1367[_0xd6dd('0x9')],'context':_0x4c1367[_0xd6dd('0x19')],'priority':_0x29aad2[_0xd6dd('0xe')]+_0x3578a9,'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});}_0x4c1367['priority']=_0x3e48b5[_0xd6dd('0x2c')]?_[_0xd6dd('0x41')](_0x3e48b5)[_0xd6dd('0xe')]+0x1:_0x29aad2[_0xd6dd('0xe')];_0x29aad2[_0xd6dd('0xe')]=(_0x327c2a[_0xd6dd('0x2c')]?_[_0xd6dd('0x41')](_0x327c2a)[_0xd6dd('0xe')]:_0x4c1367[_0xd6dd('0xe')])+0x1;_0x29aad2[_0xd6dd('0xf')]=_[_0xd6dd('0x42')](_0x29aad2[_0xd6dd('0xf')],_0x3e48b5,[_0x4c1367],_0x327c2a);}_0x29aad2['extensions'][_0xd6dd('0x11')]({'type':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x12')],'app':_0xd6dd('0x43'),'exten':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x9')],'context':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x19')],'priority':_0x29aad2[_0xd6dd('0xe')],'VoiceExtensionId':_0x526fdd[_0x2aec56][0x0][_0xd6dd('0x16')]});_0x456798[_0xd6dd('0x11')](_0x526fdd[_0x2aec56][0x0]['VoiceExtensionId']);_0x14e38d=_[_0xd6dd('0x42')](_0x14e38d,_0x29aad2[_0xd6dd('0xf')]);}}return _0x59e26b[_0xd6dd('0x44')](function(_0x4f5264){return _0x59e26b['models'][_0xd6dd('0x6')][_0xd6dd('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x456798}},'transaction':_0x4f5264})[_0xd6dd('0x5')](function(_0x5a43f9){return _0x59e26b[_0xd6dd('0x2')]['VoiceExtension'][_0xd6dd('0x46')](_[_0xd6dd('0x47')](_0x14e38d,_0xd6dd('0xe')),{'transaction':_0x4f5264});});});})[_0xd6dd('0x48')](function(_0x452035){console[_0xd6dd('0x49')](_0x452035);});}exports[_0xd6dd('0x4a')]=rewrite;
\ No newline at end of file
+var _0xf13b=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','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)=','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime',',${EXTEN},','last','Hangup','transaction','bulkCreate','sortBy','catch','rewrite','Interval','findAll','then','intervals','models','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat'];(function(_0x5ceafb,_0x1f28bf){var _0x438e3c=function(_0x525702){while(--_0x525702){_0x5ceafb['push'](_0x5ceafb['shift']());}};_0x438e3c(++_0x1f28bf);}(_0xf13b,0xed));var _0xbf13=function(_0x8ab515,_0x1d32de){_0x8ab515=_0x8ab515-0x0;var _0x581b31=_0xf13b[_0x8ab515];return _0x581b31;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x1b80d3,_0x37b8c5){var _0x240b51=this;return _0x1b80d3['models'][_0xbf13('0x0')][_0xbf13('0x1')]({'raw':!![]})[_0xbf13('0x2')](function(_0x2a3c7c){_0x240b51[_0xbf13('0x3')]=_0x2a3c7c;return _0x1b80d3[_0xbf13('0x4')][_0xbf13('0x5')][_0xbf13('0x1')]({'where':{'IntervalId':_0x37b8c5[_0xbf13('0x6')]},'raw':!![]});})[_0xbf13('0x2')](function(_0xb70c5){return _0x1b80d3[_0xbf13('0x4')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0xbf13('0x7')](_[_0xbf13('0x8')](_0xb70c5,_0xbf13('0x9')))}},'order':[{'raw':_0xbf13('0xa')}],'raw':!![]});})[_0xbf13('0x2')](function(_0x2aa793){var _0x32a72=_[_0xbf13('0xb')](_0x2aa793,{'priority':'1'});var _0xbb923b=_['filter'](_0x2aa793,{'isApp':0x1});var _0x2f6a1c=_[_0xbf13('0xc')](_0xbb923b,_0xbf13('0x9'));var _0xb4d38f=[_0xbf13('0xd'),_0xbf13('0xe')];var _0x3ca2e0=[];var _0x1ddb7d=[];for(var _0x3f69d0 in _0x2f6a1c){if(_0x2f6a1c[_0xbf13('0xf')](_0x3f69d0)){_0x240b51[_0xbf13('0x10')]=0x2;_0x240b51[_0xbf13('0x11')]=[];_0x240b51[_0xbf13('0x12')]=_['find'](_0x32a72,{'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')]});_0x240b51[_0xbf13('0x11')][_0xbf13('0x13')]({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':_0xbf13('0x15'),'appdata':util[_0xbf13('0x16')](_0xbf13('0x17'),_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')]),'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')],'priority':_0x240b51['priority']++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});if(_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')]===_0xbf13('0x1a')){_0x240b51[_0xbf13('0x11')][_0xbf13('0x13')]({'type':_0x2f6a1c[_0x3f69d0][0x0]['type'],'app':_0xbf13('0x15'),'appdata':_0xbf13('0x1b')+_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')],'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')],'priority':_0x240b51[_0xbf13('0x10')]++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0]['VoiceExtensionId']});}else if(_0x2f6a1c[_0x3f69d0][0x0]['type']===_0xbf13('0x1c')){if(_0x240b51[_0xbf13('0x12')]){_0x240b51[_0xbf13('0x11')][_0xbf13('0x13')]({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':_0xbf13('0x15'),'appdata':'CDR(destination)='+(_0x240b51[_0xbf13('0x12')][_0xbf13('0x1d')]?_0xbf13('0x1e')+_0x240b51['extension'][_0xbf13('0x1d')]+'}':_0xbf13('0x1f')),'context':_0x2f6a1c[_0x3f69d0][0x0]['context'],'exten':_0x2f6a1c[_0x3f69d0][0x0]['exten'],'priority':_0x240b51['priority']++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});}_0x240b51[_0xbf13('0x11')][_0xbf13('0x13')]({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':_0xbf13('0x15'),'appdata':_0xbf13('0x1b')+_0x2f6a1c[_0x3f69d0][0x0]['VoiceExtensionId'],'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')],'priority':_0x240b51[_0xbf13('0x10')]++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0]['VoiceExtensionId']});var _0x4398e1=_0x240b51[_0xbf13('0x10')]++;_0x240b51[_0xbf13('0x11')][_0xbf13('0x13')]({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':_0xbf13('0x20'),'appdata':_0xbf13('0x21')+(_0x4398e1+0x2)+_0xbf13('0x22')+(_0x4398e1+0x1)+')','context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0]['exten'],'priority':_0x4398e1,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});if(_0x240b51[_0xbf13('0x12')]){_0x240b51[_0xbf13('0x11')]['push']({'type':_0x2f6a1c[_0x3f69d0][0x0]['type'],'app':'Set','appdata':_0x240b51[_0xbf13('0x12')][_0xbf13('0x1d')]?_0xbf13('0x23')+_0x240b51['extension'][_0xbf13('0x1d')]+'}':_0xbf13('0x24'),'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')],'priority':_0x240b51[_0xbf13('0x10')]++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});}_0x240b51[_0xbf13('0x11')]['push']({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':_0xbf13('0x15'),'appdata':_0xbf13('0x25')+_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')],'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')],'priority':_0x240b51[_0xbf13('0x10')]++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});if(_0x240b51[_0xbf13('0x12')]&&_0x240b51[_0xbf13('0x12')][_0xbf13('0xf')]('recordingFormat')&&_0x240b51[_0xbf13('0x12')][_0xbf13('0x26')]!==_0xbf13('0x27')){_0x240b51['extensions'][_0xbf13('0x13')]({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':'Set','appdata':_0xbf13('0x28'),'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')],'priority':_0x240b51[_0xbf13('0x10')]++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0]['VoiceExtensionId']});_0x240b51[_0xbf13('0x11')]['push']({'type':_0x2f6a1c[_0x3f69d0][0x0]['type'],'app':_0xbf13('0x15'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x240b51[_0xbf13('0x12')][_0xbf13('0x26')]||_0xbf13('0x29'),'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')],'priority':_0x240b51[_0xbf13('0x10')]++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});}}_0x240b51[_0xbf13('0x11')][_0xbf13('0x13')]({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':'Set','appdata':_0xbf13('0x2a'),'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')],'priority':_0x240b51[_0xbf13('0x10')]++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});_0x240b51['extensions'][_0xbf13('0x13')]({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':_0xbf13('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0]['exten'],'priority':_0x240b51[_0xbf13('0x10')]++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});_0x240b51[_0xbf13('0x11')][_0xbf13('0x13')]({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':'Set','appdata':_0xbf13('0x2b'),'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'exten':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x9')],'priority':_0x240b51[_0xbf13('0x10')]++,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});for(var _0x413c01=0x0,_0x3dae85=0x0;_0x413c01<_0x2f6a1c[_0x3f69d0][_0xbf13('0x2c')];_0x413c01+=0x1,_0x3dae85=0x0){var _0x33f43f=_0x2f6a1c[_0x3f69d0][_0x413c01];if(_0x33f43f['type']){_0x33f43f[_0xbf13('0x14')]=_0x33f43f[_0xbf13('0x14')][_0xbf13('0x2d')]();}var _0x276e5e=[];var _0x46bb6a=[];delete _0x33f43f['id'];delete _0x33f43f[_0xbf13('0x2e')];delete _0x33f43f[_0xbf13('0x2f')];var _0x37a214=_0x33f43f['interval']!=='*,*,*,*'?[_0x33f43f[_0xbf13('0x30')]]:_0x33f43f['IntervalId']?_[_0xbf13('0x8')](_[_0xbf13('0xb')](_0x240b51[_0xbf13('0x3')],{'IntervalId':_0x33f43f[_0xbf13('0x6')]}),'interval'):[];if(_0x33f43f[_0xbf13('0xf')](_0xbf13('0x31'))){if(_0x33f43f['tag']&&_0x33f43f[_0xbf13('0x31')]!=='--'){_0x276e5e[_0xbf13('0x13')]({'type':_0x33f43f[_0xbf13('0x14')],'app':'Set','appdata':'CDR(tag)='+_0x33f43f[_0xbf13('0x31')],'context':_0x33f43f[_0xbf13('0x18')],'exten':_0x33f43f['exten'],'priority':_0x37a214[_0xbf13('0x2c')]+_0x240b51[_0xbf13('0x10')]+_0x3dae85++,'VoiceExtensionId':_0x33f43f[_0xbf13('0x19')]});}}if(_0x33f43f[_0xbf13('0x14')]===_0xbf13('0x1c')&&_0x33f43f[_0xbf13('0xf')](_0xbf13('0x32'))){if(_0x33f43f[_0xbf13('0x32')]){_0x276e5e['push']({'type':_0x33f43f[_0xbf13('0x14')],'app':'ExecIf','appdata':_0xbf13('0x33')+_0x33f43f[_0xbf13('0x32')]+')','context':_0x33f43f['context'],'exten':_0x33f43f['exten'],'priority':_0x37a214[_0xbf13('0x2c')]+_0x240b51[_0xbf13('0x10')]+_0x3dae85++,'VoiceExtensionId':_0x33f43f[_0xbf13('0x19')]});}else{_0x276e5e[_0xbf13('0x13')]({'type':_0x33f43f[_0xbf13('0x14')],'app':_0xbf13('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x33f43f[_0xbf13('0x18')],'exten':_0x33f43f[_0xbf13('0x9')],'priority':_0x37a214[_0xbf13('0x2c')]+_0x240b51[_0xbf13('0x10')]+_0x3dae85++,'VoiceExtensionId':_0x33f43f[_0xbf13('0x19')]});}}if(_0x33f43f[_0xbf13('0xf')](_0xbf13('0x34'))){if(_0xb4d38f[_0xbf13('0x35')](_0x33f43f[_0xbf13('0x36')][_0xbf13('0x2d')]())>=0x0&&_0x33f43f[_0xbf13('0x37')]!==_0xbf13('0x38')){if(_0x33f43f[_0xbf13('0x34')]){_0x276e5e[_0xbf13('0x13')]({'type':_0x33f43f[_0xbf13('0x14')],'app':'ExecIf','appdata':_0xbf13('0x39'),'context':_0x33f43f['context'],'exten':_0x33f43f['exten'],'priority':_0x37a214[_0xbf13('0x2c')]+_0x240b51[_0xbf13('0x10')]+_0x3dae85++,'VoiceExtensionId':_0x33f43f[_0xbf13('0x19')]});_0x276e5e[_0xbf13('0x13')]({'type':_0x33f43f[_0xbf13('0x14')],'app':_0xbf13('0x15'),'appdata':_0xbf13('0x3a'),'context':_0x33f43f[_0xbf13('0x18')],'exten':_0x33f43f[_0xbf13('0x9')],'priority':_0x37a214[_0xbf13('0x2c')]+_0x240b51[_0xbf13('0x10')]+_0x3dae85++,'VoiceExtensionId':_0x33f43f['VoiceExtensionId']});}else{_0x276e5e['push']({'type':_0x33f43f[_0xbf13('0x14')],'app':_0xbf13('0x20'),'appdata':_0xbf13('0x3b'),'context':_0x33f43f[_0xbf13('0x18')],'exten':_0x33f43f[_0xbf13('0x9')],'priority':_0x37a214['length']+_0x240b51[_0xbf13('0x10')]+_0x3dae85++,'VoiceExtensionId':_0x33f43f[_0xbf13('0x19')]});_0x276e5e['push']({'type':_0x33f43f[_0xbf13('0x14')],'app':_0xbf13('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x33f43f[_0xbf13('0x18')],'exten':_0x33f43f[_0xbf13('0x9')],'priority':_0x37a214['length']+_0x240b51[_0xbf13('0x10')]+_0x3dae85++,'VoiceExtensionId':_0x33f43f[_0xbf13('0x19')]});}}}for(var _0x35dda5=0x0;_0x35dda5<_0x37a214['length'];_0x35dda5+=0x1){var _0x2f8474=_0x240b51[_0xbf13('0x10')]+_0x37a214[_0xbf13('0x2c')];var _0x14eab4=_0x35dda5===_0x37a214[_0xbf13('0x2c')]-0x1?_0x240b51[_0xbf13('0x10')]+_0x276e5e[_0xbf13('0x2c')]+_0x46bb6a[_0xbf13('0x2c')]+0x2:_0x240b51['priority']+_0x35dda5+0x1;_0x276e5e['splice'](_0x35dda5,0x0,{'type':_0x33f43f['type'],'app':_0xbf13('0x3c'),'appdata':_0x37a214[_0x35dda5]+'?'+_0x33f43f[_0xbf13('0x18')]+_0xbf13('0x3d')+_0x2f8474+':'+_0x33f43f[_0xbf13('0x18')]+_0xbf13('0x3d')+_0x14eab4,'exten':_0x33f43f[_0xbf13('0x9')],'context':_0x33f43f[_0xbf13('0x18')],'priority':_0x240b51['priority']+_0x35dda5,'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0]['VoiceExtensionId']});}_0x33f43f['priority']=_0x276e5e['length']?_[_0xbf13('0x3e')](_0x276e5e)[_0xbf13('0x10')]+0x1:_0x240b51['priority'];_0x240b51[_0xbf13('0x10')]=(_0x46bb6a[_0xbf13('0x2c')]?_[_0xbf13('0x3e')](_0x46bb6a)[_0xbf13('0x10')]:_0x33f43f['priority'])+0x1;_0x240b51['extensions']=_['concat'](_0x240b51['extensions'],_0x276e5e,[_0x33f43f],_0x46bb6a);}_0x240b51[_0xbf13('0x11')]['push']({'type':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x14')],'app':_0xbf13('0x3f'),'exten':_0x2f6a1c[_0x3f69d0][0x0]['exten'],'context':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x18')],'priority':_0x240b51[_0xbf13('0x10')],'VoiceExtensionId':_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]});_0x3ca2e0['push'](_0x2f6a1c[_0x3f69d0][0x0][_0xbf13('0x19')]);_0x1ddb7d=_['concat'](_0x1ddb7d,_0x240b51[_0xbf13('0x11')]);}}return _0x1b80d3[_0xbf13('0x40')](function(_0x4f9797){return _0x1b80d3[_0xbf13('0x4')][_0xbf13('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x3ca2e0}},'transaction':_0x4f9797})[_0xbf13('0x2')](function(_0x2641e0){return _0x1b80d3[_0xbf13('0x4')][_0xbf13('0x5')][_0xbf13('0x41')](_[_0xbf13('0x42')](_0x1ddb7d,'priority'),{'transaction':_0x4f9797});});});})[_0xbf13('0x43')](function(_0x1d78c0){console['error'](_0x1d78c0);});}exports[_0xbf13('0x44')]=rewrite;
\ No newline at end of file
index 1123451..c4dfe35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29d1=['findAll','BlackLists','onlyIfOpen','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','../../../mysqldb','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!','length','find','Duplicate\x20Contact','CmContact','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','phone','field','NOW()','toString','createdAt','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','cm_contacts','calleridnum','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','str','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','all'];(function(_0x54e0f7,_0x19242b){var _0x4509ba=function(_0x4f23d7){while(--_0x4f23d7){_0x54e0f7['push'](_0x54e0f7['shift']());}};_0x4509ba(++_0x19242b);}(_0x29d1,0x1d3));var _0x129d=function(_0x52991d,_0x429d72){_0x52991d=_0x52991d-0x0;var _0x5b9004=_0x29d1[_0x52991d];return _0x5b9004;};'use strict';var BPromise=require(_0x129d('0x0'));var util=require('util');var _=require(_0x129d('0x1'));var fs=require('fs');var squel=require(_0x129d('0x2'));var Papa=require(_0x129d('0x3'));var Redis=require('ioredis');var db=require(_0x129d('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x129d('0x5'))(_0x129d('0x6'));config['redis']=_[_0x129d('0x7')](config[_0x129d('0x8')],{'host':_0x129d('0x9'),'port':0x18eb});var socket=require(_0x129d('0xa'))(new Redis(config[_0x129d('0x8')]));require(_0x129d('0xb'))[_0x129d('0xc')](socket);try{if(!process[_0x129d('0xd')][0x2]||process[_0x129d('0xd')][0x2]===_0x129d('0xe')||process[_0x129d('0xd')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x129d('0xd')][0x2];if(!process[_0x129d('0xd')][0x3]||process[_0x129d('0xd')][0x3]===_0x129d('0xe')||process[_0x129d('0xd')][0x3]==='null'||!process[_0x129d('0xd')][0x4]||process['argv'][0x4]==='undefined'||process[_0x129d('0xd')][0x4]===_0x129d('0xf')){throw new Error(_0x129d('0x10'));}var FIELDS=_[_0x129d('0x11')](process[_0x129d('0xd')][0x3][_0x129d('0x12')](','),process[_0x129d('0xd')][0x4][_0x129d('0x12')](','));if(!process[_0x129d('0xd')][0x5]||process['argv'][0x5]===_0x129d('0xe')||process[_0x129d('0xd')][0x5]==='null'){throw new Error(_0x129d('0x13'));}var LISTID=process[_0x129d('0xd')][0x5];var COMPANYID=process[_0x129d('0xd')][0x6]&&process[_0x129d('0xd')][0x6]!==_0x129d('0xe')&&process['argv'][0x6]!==_0x129d('0xf')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x129d('0xe')&&process['argv'][0x7]!==_0x129d('0xf')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x129d('0xd')][0x8]==='undefined'||process[_0x129d('0xd')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x129d('0xd')][0x8];}catch(_0x1f6ac1){logger['error'](_0x1f6ac1);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(_0x2bba25,_0x312cf4,_0x1ee8c0,_0x229728){var _0x194cf4={'message':_0x312cf4};_0x194cf4[_0x2bba25]=!![];if(_0x1ee8c0){_0x194cf4[_0x129d('0x14')]=_0x1ee8c0;}if(_0x229728){_0x194cf4[_0x129d('0x15')]=_0x229728;}return _0x194cf4;}function isEmail(_0x1156d8){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))*$/[_0x129d('0x16')](_0x1156d8);}function checkRow(_0x5a79c2,_0x10b4d9,_0x1901f4){return new BPromise(function(_0x122f9e,_0x502908){if(_['isNil'](_0x5a79c2)){return _0x502908(handleCheckRowError(_0x129d('0x17'),_0x129d('0x18'),null,_0x1901f4));}if(_0x5a79c2[_0x129d('0x19')]&&_0x5a79c2[_0x129d('0x19')]['length']){var _0x316a9b=_[_0x129d('0x1a')](_0x5a79c2[_0x129d('0x19')],_0x129d('0x1b'))[_0x129d('0x1c')](';');return _0x502908(handleCheckRowError(_0x129d('0x17'),_0x316a9b,null,_0x1901f4));}var _0x57fa={};for(var _0x54dd0c in FIELDS){if(FIELDS[_0x129d('0x1d')](_0x54dd0c)&&FIELDS[_0x54dd0c]){_0x57fa[_0x54dd0c]=_0x5a79c2[_0x129d('0x1e')][0x0][FIELDS[_0x54dd0c]]||_0x5a79c2['data'][0x0]['\ufeff'+FIELDS[_0x54dd0c]];}}if(!_0x57fa[_0x129d('0x1f')]){return _0x502908(handleCheckRowError(_0x129d('0x17'),_0x129d('0x20'),null,_0x1901f4));}if(!_0x57fa['phone']){return _0x502908(handleCheckRowError('error',_0x129d('0x21'),null,_0x1901f4));}if(_0x57fa[_0x129d('0x22')]){var _0x2263fa=moment(_0x57fa['birthDate'],_0x129d('0x23'));if(!_0x2263fa['isValid']()){return _0x502908(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x1901f4));}}if(_0x57fa['email']){if(!isEmail(_0x57fa[_0x129d('0x24')])){return _0x502908(handleCheckRowError(_0x129d('0x17'),_0x129d('0x25'),null,_0x1901f4));}}_0x57fa['ListId']=LISTID;_0x57fa['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x129d('0x26')]&&_0x10b4d9){var _0xace5e9={};for(var _0x1e95d4=0x0,_0x2a7660=DUPLICATES['length'];_0x1e95d4<_0x2a7660;_0x1e95d4+=0x1){_0xace5e9[DUPLICATES[_0x1e95d4]]=_0x57fa[DUPLICATES[_0x1e95d4]];}var _0x5797fc=_[_0x129d('0x27')](_0x10b4d9,_0xace5e9);if(_0x5797fc){return _0x502908(handleCheckRowError('duplicate',_0x129d('0x28'),_0x5797fc,_0x1901f4));}}return db[_0x129d('0x29')]['create'](_0x57fa,{'raw':!![],'hooks':![],'fields':_['keys'](_0x57fa)})[_0x129d('0x2a')](function(_0x1f57aa){if(DUPLICATES&&DUPLICATES[_0x129d('0x26')]&&_0x10b4d9){_0x10b4d9[_0x129d('0x2b')](_[_0x129d('0x2c')](_0x57fa,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1f57aa['id'];return _0x122f9e();})[_0x129d('0x2d')](function(_0x3723d5){return _0x502908(handleCheckRowError(_0x129d('0x17'),_0x129d('0x2e')+(_0x3723d5[_0x129d('0x1b')]||JSON[_0x129d('0x2f')](_0x3723d5)),null,_0x1901f4));});});}function checkHopper(){function _0x5c5320(){return function(_0x2a3ad3){logger[_0x129d('0x17')](_0x129d('0x30'),'checkHopper',util[_0x129d('0x31')](_0x2a3ad3,{'showHidden':![],'depth':null}));};}var _0x30586d=function(_0x21ca07,_0x559a23){var _0x453f75=squel['insert']()[_0x129d('0x32')](_0x129d('0x33'))[_0x129d('0x34')](['phone',_0x129d('0x35'),_0x129d('0x36'),_0x129d('0x37'),_0x559a23,'createdAt',_0x129d('0x38')],squel[_0x129d('0x39')]()['field']('phone',_0x129d('0x3a'))[_0x129d('0x3b')](_0x129d('0x3c'),_0x129d('0x35'))[_0x129d('0x3b')]('id',_0x129d('0x36'))[_0x129d('0x3b')](LISTID[_0x129d('0x3d')](),'ListId')[_0x129d('0x3b')](_0x21ca07['id'][_0x129d('0x3d')](),_0x559a23)[_0x129d('0x3b')](_0x129d('0x3c'),_0x129d('0x3e'))[_0x129d('0x3b')](_0x129d('0x3c'),'updatedAt')[_0x129d('0x3f')]('cm_contacts')[_0x129d('0x40')](_0x129d('0x41'))[_0x129d('0x40')](_0x129d('0x42'),LISTID[_0x129d('0x3d')]())[_0x129d('0x40')](_0x129d('0x43'))[_0x129d('0x40')](_0x129d('0x44'),squel['select']()[_0x129d('0x3b')](_0x129d('0x3a'))[_0x129d('0x3f')]('cm_hopper')['where'](_0x559a23+'\x20=\x20?',_0x21ca07['id'][_0x129d('0x3d')]())))[_0x129d('0x3d')]();return _0x453f75;};var _0x39902e=function(_0xe70c3c,_0x315178){var _0x24bcb8=squel[_0x129d('0x45')]()[_0x129d('0x32')]('cm_hopper')[_0x129d('0x34')](['phone',_0x129d('0x35'),_0x129d('0x36'),_0x129d('0x37'),_0x315178,'createdAt',_0x129d('0x38')],squel[_0x129d('0x39')]()[_0x129d('0x3b')](_0x129d('0x3a'),_0x129d('0x3a'))['field'](_0x129d('0x3c'),'scheduledAt')[_0x129d('0x3b')]('id',_0x129d('0x36'))['field'](LISTID[_0x129d('0x3d')](),_0x129d('0x37'))[_0x129d('0x3b')](_0xe70c3c['id'][_0x129d('0x3d')](),_0x315178)[_0x129d('0x3b')](_0x129d('0x3c'),_0x129d('0x3e'))[_0x129d('0x3b')](_0x129d('0x3c'),_0x129d('0x38'))[_0x129d('0x3f')](_0x129d('0x46'))['where'](_0x129d('0x41'))['where']('ListId\x20=\x20?',LISTID[_0x129d('0x3d')]())[_0x129d('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x129d('0x40')](_0x129d('0x43'))[_0x129d('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x129d('0x39')]()[_0x129d('0x3b')](_0x129d('0x47'))['from'](_0x129d('0x48'))[_0x129d('0x40')](_0x315178+_0x129d('0x49'),_0xe70c3c['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x129d('0x39')]()['field'](_0x129d('0x3a'))[_0x129d('0x3f')](_0x129d('0x33'))['where'](_0x315178+_0x129d('0x49'),_0xe70c3c['id'][_0x129d('0x3d')]())))['toString']();return _0x24bcb8;};function _0x1ed81d(_0x592dc6,_0x119433){var _0x2563fa=squel['insert']()['into'](_0x129d('0x33'))[_0x129d('0x34')]([_0x129d('0x3a'),_0x129d('0x35'),_0x129d('0x36'),'ListId',_0x119433,'createdAt',_0x129d('0x38')],squel[_0x129d('0x39')]()['field'](_0x129d('0x3a'),_0x129d('0x3a'))[_0x129d('0x3b')](_0x129d('0x3c'),_0x129d('0x35'))[_0x129d('0x3b')]('id',_0x129d('0x36'))[_0x129d('0x3b')](LISTID[_0x129d('0x3d')](),_0x129d('0x37'))[_0x129d('0x3b')](_0x592dc6['id'][_0x129d('0x3d')](),_0x119433)['field'](_0x129d('0x3c'),'createdAt')[_0x129d('0x3b')](_0x129d('0x3c'),_0x129d('0x38'))[_0x129d('0x3f')](_0x129d('0x46'))[_0x129d('0x40')](_0x129d('0x41'))[_0x129d('0x40')](_0x129d('0x42'),LISTID['toString']())['where'](_0x129d('0x4a'),squel[_0x129d('0x4b')](hopperContacts))[_0x129d('0x40')](_0x129d('0x43')))['toString']();return _0x2563fa;}function _0x3eb7df(_0x33404a,_0x26ad7e){var _0x54c860=squel['insert']()[_0x129d('0x32')](_0x129d('0x4c'))[_0x129d('0x34')](['phone','ContactId',_0x129d('0x37'),_0x26ad7e,'createdAt',_0x129d('0x38')],squel[_0x129d('0x39')]()[_0x129d('0x3b')](_0x129d('0x3a'),_0x129d('0x3a'))['field']('id','ContactId')[_0x129d('0x3b')](LISTID[_0x129d('0x3d')](),_0x129d('0x37'))[_0x129d('0x3b')](_0x33404a['id'][_0x129d('0x3d')](),_0x26ad7e)[_0x129d('0x3b')]('NOW()',_0x129d('0x3e'))[_0x129d('0x3b')](_0x129d('0x3c'),_0x129d('0x38'))[_0x129d('0x3f')](_0x129d('0x46'))[_0x129d('0x40')](_0x129d('0x41'))[_0x129d('0x40')](_0x129d('0x42'),LISTID[_0x129d('0x3d')]())[_0x129d('0x40')](_0x129d('0x4a'),squel[_0x129d('0x4b')](hopperContacts))[_0x129d('0x40')](_0x129d('0x43')))['toString']();return _0x54c860;}return db[_0x129d('0x4d')]['findAll']({'where':{'type':_0x129d('0x4e')},'attributes':['id',_0x129d('0x4f')],'include':[{'model':db[_0x129d('0x50')],'as':_0x129d('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x2f9735){var _0x323a38=[];if(_0x2f9735){var _0x3bae2a;for(var _0x40aa69=0x0,_0x567d2e;_0x40aa69<_0x2f9735[_0x129d('0x26')];_0x40aa69+=0x1){_0x567d2e=_0x2f9735[_0x40aa69][_0x129d('0x52')]({'plain':!![]});switch(_0x567d2e['dialCheckDuplicateType']){case _0x129d('0x53'):_0x323a38[_0x129d('0x2b')](db[_0x129d('0x54')][_0x129d('0x55')](_0x39902e(_0x567d2e,_0x129d('0x56')))[_0x129d('0x2a')](function(){})[_0x129d('0x2d')](_0x5c5320()));break;case'onlyIfOpen':_0x323a38[_0x129d('0x2b')](db[_0x129d('0x54')][_0x129d('0x55')](_0x30586d(_0x567d2e,'VoiceQueueId'))[_0x129d('0x2a')](function(){})[_0x129d('0x2d')](_0x5c5320()));break;default:_0x323a38[_0x129d('0x2b')](db['sequelize']['query'](_0x1ed81d(_0x567d2e,'VoiceQueueId'))[_0x129d('0x2a')](function(){})['catch'](_0x5c5320()));}}}return _0x323a38;})[_0x129d('0x57')]()[_0x129d('0x2a')](function(){return db[_0x129d('0x4d')][_0x129d('0x58')]({'where':{'type':_0x129d('0x4e')},'attributes':['id'],'include':[{'model':db[_0x129d('0x50')],'as':_0x129d('0x59'),'where':{'id':LISTID}}]})[_0x129d('0x2a')](function(_0x5b69fa){var _0x194042=[];if(_0x5b69fa){var _0x59d28c;for(var _0x39638d=0x0,_0x17cba9;_0x39638d<_0x5b69fa['length'];_0x39638d+=0x1){_0x17cba9=_0x5b69fa[_0x39638d]['get']({'plain':!![]});_0x194042[_0x129d('0x2b')](db[_0x129d('0x54')]['query'](_0x3eb7df(_0x17cba9,_0x129d('0x56')))[_0x129d('0x2a')](function(){})[_0x129d('0x2d')](_0x5c5320()));}}return _0x194042;})[_0x129d('0x57')]();})[_0x129d('0x2a')](function(){return db['Campaign'][_0x129d('0x58')]({'attributes':['id',_0x129d('0x4f')],'include':[{'model':db[_0x129d('0x50')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x49e0d4){var _0x38ce34=[];if(_0x49e0d4){for(var _0x20b202=0x0,_0x52e3ed;_0x20b202<_0x49e0d4[_0x129d('0x26')];_0x20b202+=0x1){_0x52e3ed=_0x49e0d4[_0x20b202]['get']({'plain':!![]});switch(_0x52e3ed[_0x129d('0x4f')]){case _0x129d('0x53'):_0x38ce34['push'](db['sequelize'][_0x129d('0x55')](_0x39902e(_0x52e3ed,'CampaignId'))[_0x129d('0x2a')](function(){})[_0x129d('0x2d')](_0x5c5320()));break;case _0x129d('0x5a'):_0x38ce34[_0x129d('0x2b')](db[_0x129d('0x54')][_0x129d('0x55')](_0x30586d(_0x52e3ed,_0x129d('0x5b')))[_0x129d('0x2a')](function(){})[_0x129d('0x2d')](_0x5c5320()));break;default:_0x38ce34[_0x129d('0x2b')](db[_0x129d('0x54')][_0x129d('0x55')](_0x1ed81d(_0x52e3ed,_0x129d('0x5b')))['then'](function(){})[_0x129d('0x2d')](_0x5c5320()));}}}return _0x38ce34;})[_0x129d('0x57')]();})['then'](function(){return db[_0x129d('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x129d('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x129d('0x2a')](function(_0xe50985){var _0x3f22fb=[];if(_0xe50985){for(var _0x1a1a85=0x0,_0x979118;_0x1a1a85<_0xe50985[_0x129d('0x26')];_0x1a1a85+=0x1){_0x979118=_0xe50985[_0x1a1a85][_0x129d('0x52')]({'plain':!![]});_0x3f22fb[_0x129d('0x2b')](db[_0x129d('0x54')][_0x129d('0x55')](_0x3eb7df(_0x979118,_0x129d('0x5b')))[_0x129d('0x2a')](function(){})['catch'](_0x5c5320()));}}return _0x3f22fb;})[_0x129d('0x57')]();})[_0x129d('0x2d')](function(_0xe1b716){logger[_0x129d('0x17')](_0x129d('0x5d'),_0x129d('0x5e'),_0xe1b716[_0x129d('0x1b')]);});}var processPromises=function(_0x3d1664){return BPromise['all'](promises)[_0x129d('0x2a')](function(_0x344c57){})[_0x129d('0x2d')](function(_0xe55b41){logger[_0x129d('0x17')](_0x129d('0x5f'),JSON[_0x129d('0x2f')](_0xe55b41));})[_0x129d('0x60')](function(){socket[_0x129d('0x61')](_0x129d('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3d1664){return _0x3d1664[_0x129d('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x129d('0x2a')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x129d('0x61')](_0x129d('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x5a28e9){logger[_0x129d('0x17')](_0x129d('0x64'),JSON[_0x129d('0x2f')](_0x5a28e9));}finally{process[_0x129d('0x65')](0x0);}});};process['on'](_0x129d('0x66'),function(){logger[_0x129d('0x67')](_0x129d('0x68'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x129d('0x12')](',');return db[_0x129d('0x29')][_0x129d('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1c63fb){var _0x810ddc=fs[_0x129d('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x129d('0x6a')](_0x810ddc,{'header':!![],'skipEmptyLines':!![],'step':function(_0x26c79b,_0x1aa278){total+=0x1;var _0x4ef545=total;promises[_0x129d('0x2b')](checkRow(_0x26c79b,_0x1c63fb,_0x4ef545)[_0x129d('0x2a')](function(){success+=0x1;})['catch'](function(_0x31ccb3){if(_0x31ccb3[_0x129d('0x17')]){errors+=0x1;delete _0x31ccb3[_0x129d('0x17')];}else if(_0x31ccb3[_0x129d('0x6b')]){duplicates+=0x1;delete _0x31ccb3['duplicate'];}rows[_0x129d('0x2b')](_0x31ccb3);}));if(total%0xc8===0x0){_0x1aa278[_0x129d('0x6c')]();return processPromises(_0x1aa278);}},'complete':function(){return processPromises()[_0x129d('0x2a')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x999927,_0x4b26dd){logger['info'](_0x129d('0x6d'),JSON[_0x129d('0x2f')](_0x999927));endCsv();}});})[_0x129d('0x2d')](function(_0x333ec5){logger[_0x129d('0x17')](_0x129d('0x6e'),JSON[_0x129d('0x2f')](_0x333ec5));});}main();
\ No newline at end of file
+var _0x7fe9=['undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','message','stringify','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ListId','createdAt','field','NOW()','updatedAt','cm_contacts','where','ListId\x20=\x20?','toString','select','\x20=\x20?','insert','ContactId','from','id\x20IN\x20?','str','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','VoiceQueueId','onlyIfOpen','sequelize','query','all','get','Lists','always','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','Missing\x20filepath\x20parameter!'];(function(_0x2c412e,_0x32c6a3){var _0x5c816b=function(_0x2fe569){while(--_0x2fe569){_0x2c412e['push'](_0x2c412e['shift']());}};_0x5c816b(++_0x32c6a3);}(_0x7fe9,0xd0));var _0x97fe=function(_0x2d775e,_0x4c0165){_0x2d775e=_0x2d775e-0x0;var _0x47e959=_0x7fe9[_0x2d775e];return _0x47e959;};'use strict';var BPromise=require('bluebird');var util=require(_0x97fe('0x0'));var _=require(_0x97fe('0x1'));var fs=require('fs');var squel=require(_0x97fe('0x2'));var Papa=require(_0x97fe('0x3'));var Redis=require('ioredis');var db=require(_0x97fe('0x4'))['db'];var config=require(_0x97fe('0x5'));var logger=require(_0x97fe('0x6'))(_0x97fe('0x7'));config[_0x97fe('0x8')]=_[_0x97fe('0x9')](config['redis'],{'host':_0x97fe('0xa'),'port':0x18eb});var socket=require(_0x97fe('0xb'))(new Redis(config['redis']));require(_0x97fe('0xc'))[_0x97fe('0xd')](socket);try{if(!process[_0x97fe('0xe')][0x2]||process[_0x97fe('0xe')][0x2]==='undefined'||process[_0x97fe('0xe')][0x2]==='null'){throw new Error(_0x97fe('0xf'));}var FILEPATH=process[_0x97fe('0xe')][0x2];if(!process['argv'][0x3]||process[_0x97fe('0xe')][0x3]===_0x97fe('0x10')||process[_0x97fe('0xe')][0x3]===_0x97fe('0x11')||!process[_0x97fe('0xe')][0x4]||process[_0x97fe('0xe')][0x4]===_0x97fe('0x10')||process[_0x97fe('0xe')][0x4]===_0x97fe('0x11')){throw new Error(_0x97fe('0x12'));}var FIELDS=_[_0x97fe('0x13')](process[_0x97fe('0xe')][0x3]['split'](','),process[_0x97fe('0xe')][0x4][_0x97fe('0x14')](','));if(!process['argv'][0x5]||process[_0x97fe('0xe')][0x5]===_0x97fe('0x10')||process[_0x97fe('0xe')][0x5]===_0x97fe('0x11')){throw new Error(_0x97fe('0x15'));}var LISTID=process[_0x97fe('0xe')][0x5];var COMPANYID=process[_0x97fe('0xe')][0x6]&&process[_0x97fe('0xe')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x97fe('0x11')?process['argv'][0x6]:null;var DUPLICATES=process[_0x97fe('0xe')][0x7]&&process[_0x97fe('0xe')][0x7]!==_0x97fe('0x10')&&process['argv'][0x7]!==_0x97fe('0x11')?process[_0x97fe('0xe')][0x7]:null;if(!process[_0x97fe('0xe')][0x8]||process[_0x97fe('0xe')][0x8]===_0x97fe('0x10')||process[_0x97fe('0xe')][0x8]===_0x97fe('0x11')){throw new Error(_0x97fe('0x16'));}var SOCKET_TIMESTAMP=process[_0x97fe('0xe')][0x8];}catch(_0x1033c7){logger[_0x97fe('0x17')](_0x1033c7);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(_0x47daf1,_0x35b38a,_0xaaeec0,_0x276501){var _0x173fad={'message':_0x35b38a};_0x173fad[_0x47daf1]=!![];if(_0xaaeec0){_0x173fad[_0x97fe('0x18')]=_0xaaeec0;}if(_0x276501){_0x173fad[_0x97fe('0x19')]=_0x276501;}return _0x173fad;}function isEmail(_0x105546){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))*$/[_0x97fe('0x1a')](_0x105546);}function checkRow(_0x465700,_0x56a8a6,_0xe752ac){return new BPromise(function(_0x4d98ec,_0x4adf34){if(_[_0x97fe('0x1b')](_0x465700)){return _0x4adf34(handleCheckRowError(_0x97fe('0x17'),_0x97fe('0x1c'),null,_0xe752ac));}if(_0x465700[_0x97fe('0x1d')]&&_0x465700['errors'][_0x97fe('0x1e')]){var _0x4afc0a=_['map'](_0x465700['errors'],'message')[_0x97fe('0x1f')](';');return _0x4adf34(handleCheckRowError('error',_0x4afc0a,null,_0xe752ac));}var _0xafb4c={};for(var _0x28d48f in FIELDS){if(FIELDS[_0x97fe('0x20')](_0x28d48f)&&FIELDS[_0x28d48f]){_0xafb4c[_0x28d48f]=_0x465700['data'][0x0][FIELDS[_0x28d48f]]||_0x465700[_0x97fe('0x21')][0x0]['\ufeff'+FIELDS[_0x28d48f]];}}if(!_0xafb4c['firstName']){return _0x4adf34(handleCheckRowError('error',_0x97fe('0x22'),null,_0xe752ac));}if(!_0xafb4c[_0x97fe('0x23')]){return _0x4adf34(handleCheckRowError('error',_0x97fe('0x24'),null,_0xe752ac));}if(_0xafb4c[_0x97fe('0x25')]){var _0x3332d1=moment(_0xafb4c[_0x97fe('0x25')],_0x97fe('0x26'));if(!_0x3332d1[_0x97fe('0x27')]()){return _0x4adf34(handleCheckRowError(_0x97fe('0x17'),_0x97fe('0x28'),null,_0xe752ac));}}if(_0xafb4c[_0x97fe('0x29')]){if(!isEmail(_0xafb4c[_0x97fe('0x29')])){return _0x4adf34(handleCheckRowError(_0x97fe('0x17'),_0x97fe('0x2a'),null,_0xe752ac));}}_0xafb4c['ListId']=LISTID;_0xafb4c[_0x97fe('0x2b')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x97fe('0x1e')]&&_0x56a8a6){var _0x5a136e={};for(var _0x225c7b=0x0,_0x28a8a3=DUPLICATES[_0x97fe('0x1e')];_0x225c7b<_0x28a8a3;_0x225c7b+=0x1){_0x5a136e[DUPLICATES[_0x225c7b]]=_0xafb4c[DUPLICATES[_0x225c7b]];}var _0x3d0835=_['find'](_0x56a8a6,_0x5a136e);if(_0x3d0835){return _0x4adf34(handleCheckRowError(_0x97fe('0x2c'),_0x97fe('0x2d'),_0x3d0835,_0xe752ac));}}return db[_0x97fe('0x2e')]['create'](_0xafb4c,{'raw':!![],'hooks':![],'fields':_[_0x97fe('0x2f')](_0xafb4c)})[_0x97fe('0x30')](function(_0x52631b){if(DUPLICATES&&DUPLICATES[_0x97fe('0x1e')]&&_0x56a8a6){_0x56a8a6[_0x97fe('0x31')](_[_0x97fe('0x32')](_0xafb4c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x52631b['id'];return _0x4d98ec();})[_0x97fe('0x33')](function(_0x571ff9){return _0x4adf34(handleCheckRowError(_0x97fe('0x17'),'Error\x20while\x20creating\x20contact:\x20'+(_0x571ff9[_0x97fe('0x34')]||JSON[_0x97fe('0x35')](_0x571ff9)),null,_0xe752ac));});});}function checkHopper(){function _0x5370fe(){return function(_0x433538){logger[_0x97fe('0x17')]('cmContact',_0x97fe('0x36'),util[_0x97fe('0x37')](_0x433538,{'showHidden':![],'depth':null}));};}var _0x9225a1=function(_0x7a1a85,_0x6a590f){var _0x5acebe=squel['insert']()[_0x97fe('0x38')](_0x97fe('0x39'))[_0x97fe('0x3a')]([_0x97fe('0x23'),_0x97fe('0x3b'),'ContactId',_0x97fe('0x3c'),_0x6a590f,_0x97fe('0x3d'),'updatedAt'],squel['select']()['field']('phone','phone')[_0x97fe('0x3e')]('NOW()','scheduledAt')[_0x97fe('0x3e')]('id','ContactId')[_0x97fe('0x3e')](LISTID['toString'](),_0x97fe('0x3c'))[_0x97fe('0x3e')](_0x7a1a85['id']['toString'](),_0x6a590f)[_0x97fe('0x3e')](_0x97fe('0x3f'),_0x97fe('0x3d'))[_0x97fe('0x3e')](_0x97fe('0x3f'),_0x97fe('0x40'))['from'](_0x97fe('0x41'))[_0x97fe('0x42')]('deletedAt\x20IS\x20NULL')[_0x97fe('0x42')](_0x97fe('0x43'),LISTID[_0x97fe('0x44')]())[_0x97fe('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x97fe('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x97fe('0x45')]()['field'](_0x97fe('0x23'))['from']('cm_hopper')[_0x97fe('0x42')](_0x6a590f+_0x97fe('0x46'),_0x7a1a85['id'][_0x97fe('0x44')]())))[_0x97fe('0x44')]();return _0x5acebe;};var _0x37557f=function(_0xf229b1,_0x3b38f8){var _0x4fc539=squel[_0x97fe('0x47')]()[_0x97fe('0x38')](_0x97fe('0x39'))[_0x97fe('0x3a')](['phone',_0x97fe('0x3b'),_0x97fe('0x48'),'ListId',_0x3b38f8,_0x97fe('0x3d'),'updatedAt'],squel['select']()[_0x97fe('0x3e')](_0x97fe('0x23'),_0x97fe('0x23'))[_0x97fe('0x3e')]('NOW()','scheduledAt')[_0x97fe('0x3e')]('id',_0x97fe('0x48'))[_0x97fe('0x3e')](LISTID[_0x97fe('0x44')](),'ListId')[_0x97fe('0x3e')](_0xf229b1['id'][_0x97fe('0x44')](),_0x3b38f8)[_0x97fe('0x3e')](_0x97fe('0x3f'),_0x97fe('0x3d'))[_0x97fe('0x3e')](_0x97fe('0x3f'),_0x97fe('0x40'))[_0x97fe('0x49')](_0x97fe('0x41'))[_0x97fe('0x42')]('deletedAt\x20IS\x20NULL')[_0x97fe('0x42')](_0x97fe('0x43'),LISTID[_0x97fe('0x44')]())[_0x97fe('0x42')](_0x97fe('0x4a'),squel[_0x97fe('0x4b')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x97fe('0x45')]()['field'](_0x97fe('0x4c'))[_0x97fe('0x49')](_0x97fe('0x4d'))[_0x97fe('0x42')](_0x3b38f8+'\x20=\x20?',_0xf229b1['id']['toString']()))[_0x97fe('0x42')](_0x97fe('0x4e'),squel[_0x97fe('0x45')]()[_0x97fe('0x3e')](_0x97fe('0x23'))['from']('cm_hopper')[_0x97fe('0x42')](_0x3b38f8+'\x20=\x20?',_0xf229b1['id'][_0x97fe('0x44')]())))['toString']();return _0x4fc539;};function _0x2eaac9(_0x29ff16,_0x948acb){var _0x1c6846=squel[_0x97fe('0x47')]()[_0x97fe('0x38')]('cm_hopper')['fromQuery']([_0x97fe('0x23'),'scheduledAt',_0x97fe('0x48'),'ListId',_0x948acb,_0x97fe('0x3d'),_0x97fe('0x40')],squel[_0x97fe('0x45')]()[_0x97fe('0x3e')](_0x97fe('0x23'),_0x97fe('0x23'))['field'](_0x97fe('0x3f'),_0x97fe('0x3b'))[_0x97fe('0x3e')]('id',_0x97fe('0x48'))[_0x97fe('0x3e')](LISTID[_0x97fe('0x44')](),_0x97fe('0x3c'))[_0x97fe('0x3e')](_0x29ff16['id']['toString'](),_0x948acb)[_0x97fe('0x3e')](_0x97fe('0x3f'),'createdAt')[_0x97fe('0x3e')](_0x97fe('0x3f'),_0x97fe('0x40'))[_0x97fe('0x49')](_0x97fe('0x41'))['where'](_0x97fe('0x4f'))[_0x97fe('0x42')](_0x97fe('0x43'),LISTID[_0x97fe('0x44')]())[_0x97fe('0x42')](_0x97fe('0x4a'),squel[_0x97fe('0x4b')](hopperContacts))[_0x97fe('0x42')](_0x97fe('0x50')))['toString']();return _0x1c6846;}function _0x1a763d(_0x430f5a,_0x439221){var _0x3ded25=squel[_0x97fe('0x47')]()[_0x97fe('0x38')](_0x97fe('0x51'))[_0x97fe('0x3a')](['phone',_0x97fe('0x48'),'ListId',_0x439221,_0x97fe('0x3d'),_0x97fe('0x40')],squel['select']()[_0x97fe('0x3e')]('phone',_0x97fe('0x23'))[_0x97fe('0x3e')]('id',_0x97fe('0x48'))[_0x97fe('0x3e')](LISTID[_0x97fe('0x44')](),'ListId')[_0x97fe('0x3e')](_0x430f5a['id']['toString'](),_0x439221)['field'](_0x97fe('0x3f'),_0x97fe('0x3d'))['field'](_0x97fe('0x3f'),_0x97fe('0x40'))['from'](_0x97fe('0x41'))[_0x97fe('0x42')](_0x97fe('0x4f'))[_0x97fe('0x42')](_0x97fe('0x43'),LISTID[_0x97fe('0x44')]())[_0x97fe('0x42')](_0x97fe('0x4a'),squel[_0x97fe('0x4b')](hopperContacts))[_0x97fe('0x42')](_0x97fe('0x50')))[_0x97fe('0x44')]();return _0x3ded25;}return db['VoiceQueue'][_0x97fe('0x52')]({'where':{'type':_0x97fe('0x53')},'attributes':['id',_0x97fe('0x54')],'include':[{'model':db[_0x97fe('0x55')],'as':'Lists','where':{'id':LISTID}}]})[_0x97fe('0x30')](function(_0x751d1c){var _0x24bc93=[];if(_0x751d1c){var _0x318bdc;for(var _0x4b0a7d=0x0,_0xfb56c9;_0x4b0a7d<_0x751d1c[_0x97fe('0x1e')];_0x4b0a7d+=0x1){_0xfb56c9=_0x751d1c[_0x4b0a7d]['get']({'plain':!![]});switch(_0xfb56c9[_0x97fe('0x54')]){case'always':_0x24bc93['push'](db['sequelize']['query'](_0x37557f(_0xfb56c9,_0x97fe('0x56')))[_0x97fe('0x30')](function(){})[_0x97fe('0x33')](_0x5370fe()));break;case _0x97fe('0x57'):_0x24bc93['push'](db[_0x97fe('0x58')][_0x97fe('0x59')](_0x9225a1(_0xfb56c9,_0x97fe('0x56')))['then'](function(){})['catch'](_0x5370fe()));break;default:_0x24bc93[_0x97fe('0x31')](db['sequelize']['query'](_0x2eaac9(_0xfb56c9,_0x97fe('0x56')))[_0x97fe('0x30')](function(){})[_0x97fe('0x33')](_0x5370fe()));}}}return _0x24bc93;})[_0x97fe('0x5a')]()[_0x97fe('0x30')](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x97fe('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x97fe('0x30')](function(_0x20ffd5){var _0x5d4eb2=[];if(_0x20ffd5){var _0x49dea8;for(var _0x17370e=0x0,_0x56b7ae;_0x17370e<_0x20ffd5['length'];_0x17370e+=0x1){_0x56b7ae=_0x20ffd5[_0x17370e][_0x97fe('0x5b')]({'plain':!![]});_0x5d4eb2[_0x97fe('0x31')](db[_0x97fe('0x58')][_0x97fe('0x59')](_0x1a763d(_0x56b7ae,_0x97fe('0x56')))[_0x97fe('0x30')](function(){})['catch'](_0x5370fe()));}}return _0x5d4eb2;})[_0x97fe('0x5a')]();})['then'](function(){return db['Campaign'][_0x97fe('0x52')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x97fe('0x5c'),'where':{'id':LISTID}}]})[_0x97fe('0x30')](function(_0x13f533){var _0x23fe09=[];if(_0x13f533){for(var _0x2c338a=0x0,_0x298999;_0x2c338a<_0x13f533[_0x97fe('0x1e')];_0x2c338a+=0x1){_0x298999=_0x13f533[_0x2c338a][_0x97fe('0x5b')]({'plain':!![]});switch(_0x298999[_0x97fe('0x54')]){case _0x97fe('0x5d'):_0x23fe09['push'](db[_0x97fe('0x58')][_0x97fe('0x59')](_0x37557f(_0x298999,_0x97fe('0x5e')))[_0x97fe('0x30')](function(){})[_0x97fe('0x33')](_0x5370fe()));break;case _0x97fe('0x57'):_0x23fe09[_0x97fe('0x31')](db[_0x97fe('0x58')]['query'](_0x9225a1(_0x298999,_0x97fe('0x5e')))[_0x97fe('0x30')](function(){})[_0x97fe('0x33')](_0x5370fe()));break;default:_0x23fe09['push'](db[_0x97fe('0x58')][_0x97fe('0x59')](_0x2eaac9(_0x298999,_0x97fe('0x5e')))[_0x97fe('0x30')](function(){})[_0x97fe('0x33')](_0x5370fe()));}}}return _0x23fe09;})[_0x97fe('0x5a')]();})[_0x97fe('0x30')](function(){return db['Campaign'][_0x97fe('0x52')]({'attributes':['id'],'include':[{'model':db[_0x97fe('0x55')],'as':_0x97fe('0x5f'),'where':{'id':LISTID}}]})[_0x97fe('0x30')](function(_0x5cccfe){var _0x553412=[];if(_0x5cccfe){for(var _0xbfc035=0x0,_0x5ecdda;_0xbfc035<_0x5cccfe[_0x97fe('0x1e')];_0xbfc035+=0x1){_0x5ecdda=_0x5cccfe[_0xbfc035][_0x97fe('0x5b')]({'plain':!![]});_0x553412['push'](db[_0x97fe('0x58')][_0x97fe('0x59')](_0x1a763d(_0x5ecdda,_0x97fe('0x5e')))['then'](function(){})[_0x97fe('0x33')](_0x5370fe()));}}return _0x553412;})[_0x97fe('0x5a')]();})[_0x97fe('0x33')](function(_0x3a8956){logger[_0x97fe('0x17')](_0x97fe('0x60'),'generalCheckHopper',_0x3a8956[_0x97fe('0x34')]);});}var processPromises=function(_0x15ac09){return BPromise[_0x97fe('0x5a')](promises)['then'](function(_0x2cfe4d){})[_0x97fe('0x33')](function(_0x55406e){logger[_0x97fe('0x17')](_0x97fe('0x61'),JSON[_0x97fe('0x35')](_0x55406e));})['finally'](function(){socket[_0x97fe('0x62')](_0x97fe('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x15ac09){return _0x15ac09[_0x97fe('0x64')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x97fe('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0x97fe('0x30')](function(){socket[_0x97fe('0x62')](_0x97fe('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x55a93b){logger['error'](_0x97fe('0x65'),JSON['stringify'](_0x55a93b));}finally{process[_0x97fe('0x66')](0x0);}});};process['on'](_0x97fe('0x67'),function(){logger[_0x97fe('0x68')](_0x97fe('0x69'));endCsv();});function main(){return BPromise[_0x97fe('0x6a')]()[_0x97fe('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x97fe('0x14')](',');return db[_0x97fe('0x2e')][_0x97fe('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x97fe('0x30')](function(_0x26de7d){var _0x316697=fs[_0x97fe('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x97fe('0x6c')](_0x316697,{'header':!![],'skipEmptyLines':!![],'step':function(_0x14d8a7,_0x50db84){total+=0x1;var _0x1bbfd6=total;promises[_0x97fe('0x31')](checkRow(_0x14d8a7,_0x26de7d,_0x1bbfd6)[_0x97fe('0x30')](function(){success+=0x1;})['catch'](function(_0x3efae2){if(_0x3efae2[_0x97fe('0x17')]){errors+=0x1;delete _0x3efae2['error'];}else if(_0x3efae2['duplicate']){duplicates+=0x1;delete _0x3efae2['duplicate'];}rows['push'](_0x3efae2);}));if(total%0xc8===0x0){_0x50db84[_0x97fe('0x6d')]();return processPromises(_0x50db84);}},'complete':function(){return processPromises()[_0x97fe('0x30')](function(){logger[_0x97fe('0x68')](_0x97fe('0x6e'));endCsv();});},'error':function(_0x32ea9e,_0x569e99){logger[_0x97fe('0x68')]('CSV\x20parse\x20error',JSON['stringify'](_0x32ea9e));endCsv();}});})['catch'](function(_0x5e7ccc){logger[_0x97fe('0x17')](_0x97fe('0x6f'),JSON['stringify'](_0x5e7ccc));});}main();
\ No newline at end of file
index 6ebec8a..a5c0a11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84f3=['path','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','redis','defaults','localhost','select','field','phone','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','AdditionalPhones','length','push','all','then','split','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','from','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','code','message','sequelize','query','spread','catch','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','body','name','_description','header','writeFileSync','data','rows','errors','find','isNil','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','exit','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException'];(function(_0x34ee59,_0xd3d05a){var _0x2110d9=function(_0x45e474){while(--_0x45e474){_0x34ee59['push'](_0x34ee59['shift']());}};_0x2110d9(++_0xd3d05a);}(_0x84f3,0x1f2));var _0x384f=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x84f3[_0x12fc8d];return _0x3f9d04;};'use strict';var fs=require('fs');var path=require(_0x384f('0x0'));var _=require('lodash');var Papa=require(_0x384f('0x1'));var util=require(_0x384f('0x2'));var BPromise=require(_0x384f('0x3'));var moment=require(_0x384f('0x4'));var squel=require('squel');var Redis=require(_0x384f('0x5'));var db=require(_0x384f('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config[_0x384f('0x7')]=_[_0x384f('0x8')](config['redis'],{'host':_0x384f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x384f('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x2f7f83){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'](_0x2f7f83);}function selectNotIn(_0x36295e,_0x1ca44b,_0x435839,_0xa29478,_0x4cd8bd){return squel[_0x384f('0xa')]()[_0x384f('0xb')](_0x384f('0xc'))['from'](_0xa29478)['join'](_0x1ca44b,null,_0x1ca44b+_0x384f('0xd')+_0xa29478+'.'+_0x435839)[_0x384f('0xe')](_0xa29478+'.'+_0x435839+_0x384f('0xf')+_0x36295e+'.'+_0x435839)[_0x384f('0xe')](_0x1ca44b+_0x384f('0x10')+_0x4cd8bd[_0x384f('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3cae60,_0x2dd8c5){promisesAdditionalPhones=[];return db[_0x384f('0x12')][_0x384f('0x13')]({'raw':!![],'attributes':['id',_0x384f('0x14')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x44c7cb){if(_0x44c7cb!==null){var _0xc85cab=[];for(var _0x1c8777=0x0;_0x1c8777<_0x44c7cb[_0x384f('0x15')];_0x1c8777++){var _0x3a47f8=_0x44c7cb[_0x1c8777];_0xc85cab[_0x384f('0x16')](insertAdditionalPhones(_0x3a47f8));}}Promise[_0x384f('0x17')](_0xc85cab)[_0x384f('0x18')](function(){_0x3cae60({'val':0x1});});});});}function insertAdditionalPhones(_0x177910){return new Promise(function(_0x3373cb,_0x478e63){var _0x491345=_0x177910[_0x384f('0x14')];var _0x1d1162=_0x491345[_0x384f('0x19')](';');var _0x28fea4=[];orderBy=0x0;for(var _0x22b89e=0x0;_0x22b89e<_0x1d1162[_0x384f('0x15')];_0x22b89e++){_0x28fea4['push'](splitAdditionalPhone(_0x177910['id'],_0x1d1162[_0x22b89e]));}Promise['all'](_0x28fea4)[_0x384f('0x18')](function(){_0x3373cb({'val':_0x1d1162[_0x384f('0x15')]});});});}function splitAdditionalPhone(_0x4d11f5,_0x2f4181){return new Promise(function(_0xd4c3d5,_0x4aa090){var _0x14e277=_0x2f4181[_0x384f('0x19')](':');var _0x33c8a2=_0x14e277[0x0];var _0x51d10a=_0x14e277[0x1];if(_0x51d10a!==''){var _0x7b9bc0=_0x51d10a['split']('|');var _0x32200b=[];for(var _0x146c3b=0x0;_0x146c3b<_0x7b9bc0['length'];_0x146c3b++){if(_0x7b9bc0[_0x146c3b]!==''){var _0xd45bf=_[_0x384f('0x1a')](promisesAdditionalPhones,{'contactId':_0x4d11f5,'phone':_0x7b9bc0[_0x146c3b]});if(_0xd45bf[_0x384f('0x15')]==0x0){orderBy++;promisesAdditionalPhones[_0x384f('0x16')]({'contactId':_0x4d11f5,'contactTypeId':_0x33c8a2,'phone':_0x7b9bc0[_0x146c3b],'orderBy':orderBy});}}}_0xd4c3d5({'ok':0x1});}else _0xd4c3d5({'res':0x0});});}function createAdditionalPhone(_0x9b4460,_0x41c233,_0x58b972,_0x266a39){var _0x312281='';var _0x2add62='';var _0x480627=_0x58b972[_0x384f('0x19')]('§');_0x312281=_0x480627[0x0];if(_0x480627[_0x384f('0x15')]==0x2)_0x2add62=_0x480627[0x1];return new Promise(function(_0x565f0b,_0x24978c){return db[_0x384f('0x1b')][_0x384f('0x1c')]({'where':{'CmContactId':_0x9b4460,'item':_0x312281}})[_0x384f('0x18')](function(_0x1ec710){if(_0x1ec710){return db[_0x384f('0x1b')][_0x384f('0x1d')]({'ItemTypeId':_0x41c233,'description':_0x2add62,'OrderBy':_0x266a39},{'where':{'CmContactId':_0x9b4460,'item':_0x312281}})[_0x384f('0x18')](function(_0x11c9f2){_0x565f0b({'res':_0x384f('0x1e')});});}else{return db[_0x384f('0x1b')][_0x384f('0x1f')]({'CmContactId':_0x9b4460,'item':_0x312281,'description':_0x2add62,'ItemTypeId':_0x41c233,'OrderBy':_0x266a39,'ItemClass':_0x384f('0x20')})['then'](function(_0x431e1a){_0x565f0b({'res':_0x384f('0x21')});});}});});}function insertCmHopper(_0xd2db30,_0x4a3544,_0x5e0a50,_0x522c89,_0x296a74){var _0x70e648=[_0x384f('0x22'),'cm_contacts.scheduledat',_0x384f('0x23'),_0x384f('0x24'),_0x4a3544+'.'+_0x522c89,_0x384f('0x25'),'cm_contacts.updatedAt',_0x384f('0x26'),_0x384f('0x27'),'\x22'+_0x296a74+'\x22'];return squel[_0x384f('0x28')]()[_0x384f('0x29')]('cm_hopper')[_0x384f('0x2a')]([_0x384f('0xc'),_0x384f('0x2b'),'ContactId',_0x384f('0x2c'),_0x522c89,_0x384f('0x2d'),_0x384f('0x2e'),_0x384f('0x2f'),'UserId',_0x384f('0x30')],squel[_0x384f('0xa')]()[_0x384f('0x31')](_0x70e648)['from'](_0x4a3544)[_0x384f('0x11')](_0x384f('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x4a3544+_0x384f('0x33'))[_0x384f('0x11')](_0x5e0a50,null,_0x5e0a50+_0x384f('0xd')+_0x4a3544+'.'+_0x522c89)[_0x384f('0xe')](_0x4a3544+_0x384f('0x34'),_0xd2db30)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x384f('0xe')](_0x384f('0x35'),selectNotIn(_0x4a3544,_0x5e0a50,_0x522c89,_0x384f('0x36'),[_0x384f('0x37'),_0x384f('0x38')]))[_0x384f('0xe')](_0x384f('0x35'),selectNotIn(_0x4a3544,_0x5e0a50,_0x522c89,_0x384f('0x36'),[_0x384f('0x37')])))[_0x384f('0x39')]();}function insertCmHopperBlack(_0x5a39a2,_0x14c38e,_0x2fe147,_0x42161d){var _0x128b55=[_0x384f('0x22'),_0x384f('0x23'),_0x384f('0x24'),_0x14c38e+'.'+_0x42161d,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x384f('0x28')]()['into'](_0x384f('0x3a'))[_0x384f('0x2a')]([_0x384f('0xc'),'ContactId',_0x384f('0x2c'),_0x42161d,'createdAt','updatedAt'],squel[_0x384f('0xa')]()[_0x384f('0x31')](_0x128b55)[_0x384f('0x3b')](_0x14c38e)[_0x384f('0x11')](_0x384f('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x14c38e+'.CmListId')[_0x384f('0x11')](_0x2fe147,null,_0x2fe147+'.id\x20=\x20'+_0x14c38e+'.'+_0x42161d)[_0x384f('0xe')](_0x14c38e+_0x384f('0x34'),_0x5a39a2)[_0x384f('0xe')](_0x384f('0x3c'),NOW)[_0x384f('0xe')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x384f('0xa')]()['field']('phone')[_0x384f('0x3b')](_0x384f('0x3a'))[_0x384f('0xe')](_0x384f('0x3d'),_0x5a39a2)['where'](_0x42161d+'\x20=\x20?',_0x14c38e+'.'+_0x42161d)))[_0x384f('0x39')]();}function insertCmHopperAdditionalPhones(_0x6acee4){var _0x4607ca=[_0x384f('0x3e'),'cm_contact_has_items.item',_0x384f('0x3f'),_0x384f('0x40'),_0x384f('0x41')];return squel[_0x384f('0x28')]()[_0x384f('0x29')](_0x384f('0x42'))[_0x384f('0x2a')](['CmHopperId','phone',_0x384f('0x43'),'createdAt',_0x384f('0x2e')],squel['select']()[_0x384f('0x31')](_0x4607ca)['from'](_0x384f('0x36'))[_0x384f('0x11')]('cm_contacts',null,_0x384f('0x44'))['join'](_0x384f('0x45'),null,_0x384f('0x46'))['where']('cm_hopper.ListId\x20=\x20?',_0x6acee4)[_0x384f('0xe')](_0x384f('0x3c'),NOW))[_0x384f('0x39')]();}function insertCmContact(_0x3ff021,_0x378096,_0x19b9ae,_0x23e1ac){var _0x5d4650=_[_0x384f('0x47')](_[_0x384f('0x48')](_0x23e1ac),[_0x384f('0x2c'),_0x384f('0x49'),_0x384f('0x2d'),_0x384f('0x2e')]);return squel['insert']()[_0x384f('0x29')](_0x384f('0x32'))[_0x384f('0x2a')](_0x5d4650,squel[_0x384f('0xa')]()[_0x384f('0x31')](_0x5d4650)[_0x384f('0x3b')](_0x378096)[_0x384f('0xe')]('('+_0x19b9ae[_0x384f('0x11')](',')+_0x384f('0x4a'),squel[_0x384f('0xa')]()[_0x384f('0x31')](_0x19b9ae)[_0x384f('0x3b')](_0x384f('0x32'))[_0x384f('0xe')]('ListId\x20=\x20?',_0x3ff021)[_0x384f('0xe')](_0x384f('0x4b')))[_0x384f('0xe')](_0x384f('0x4c'),squel['select']()['field'](_0x384f('0x4d'),_0x384f('0x4e'))[_0x384f('0x3b')](_0x378096)[_0x384f('0x4f')](_0x19b9ae[_0x384f('0x11')](','))))['toString']();}function handleStop(){logger[_0x384f('0x50')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xf2c6d6){logger[_0x384f('0x51')](_0xf2c6d6['message']);process['exit'](0x1);}function handleError(_0x430262,_0x25e3e7){stats['errors']['push']({'name':_0x25e3e7[_0x384f('0x52')],'message':_0x25e3e7[_0x384f('0x53')],'row':_0x430262});}function handleQuery(_0x111254){logger['info'](_0x111254);return db[_0x384f('0x54')][_0x384f('0x55')](_0x111254)[_0x384f('0x56')](function(_0x5275fa){results[_0x384f('0x16')](_0x5275fa);})[_0x384f('0x57')](function(_0x559e8f){logger[_0x384f('0x51')](_0x559e8f[_0x384f('0x53')]);});}function main(_0x8298fc,_0x324594,_0x3189c1,_0x228cd1){logger[_0x384f('0x50')]('main',_0x8298fc,JSON[_0x384f('0x58')](_0x324594));process[_0x384f('0x59')](_0x384f('0x5a'));var _0x93b180=_0x324594[_0x384f('0x5b')];var _0x260532=_[_0x384f('0x5c')](_0x93b180);var _0x1219ba=_0x324594[_0x384f('0x5d')];var _0xc2b700=path['join'](config[_0x384f('0x5e')],_0x384f('0x5f'),_0x1219ba+'.csv');logger['info'](_0x384f('0x60'),_0x324594);db['ContactItemType'][_0x384f('0x13')]({'raw':!![],'attributes':['id',_0x384f('0x61')]})[_0x384f('0x18')](function(_0x49ddf5){for(var _0x251ab8=0x0;_0x251ab8<_0x49ddf5[_0x384f('0x15')];_0x251ab8++){if(_0x49ddf5[_0x251ab8]['name']in _0x93b180){contactItemTypes[_0x384f('0x16')](_0x49ddf5[_0x251ab8]);delete _0x260532[_0x49ddf5[_0x251ab8][_0x384f('0x61')]];hasAdditionalPhones=!![];}for(var _0xd59446 in _0x93b180){if(_0x49ddf5[_0x251ab8]['name']+_0x384f('0x62')===_0xd59446){phoneDescriptions[_0x384f('0x16')]({'itemTypeId':_0x49ddf5[_0x251ab8]['id'],'description':_0xd59446});delete _0x260532[_0xd59446];}}}if(hasAdditionalPhones)_0x260532['AdditionalPhones']='';var _0x5a892a=_[_0x384f('0x48')](_0x260532)[_0x384f('0x11')]();logger[_0x384f('0x50')](_0x384f('0x63'),_0x5a892a);fs[_0x384f('0x64')](_0xc2b700,_0x5a892a+'\x0a');Papa['parse'](fs['createReadStream'](_0x8298fc),{'header':!![],'skipEmptyLines':!![],'step':function(_0x13e008,_0x467e9f){try{for(var _0x46ec43=0x0,_0x4b3399=[];_0x46ec43<_0x13e008[_0x384f('0x65')]['length'];_0x46ec43++){stats[_0x384f('0x66')]+=0x1;if(_0x13e008[_0x384f('0x67')][_0x46ec43]){handleError(_0x13e008['data'][_0x46ec43],_0x13e008['errors'][_0x46ec43]);}else{var _0x40bb41=[];var _0xaa1da=[];var _0x3ee9f3={};for(var _0x33228f in _0x93b180){let _0x4e9c0a=contactItemTypes[_0x384f('0x68')](_0x1e0357=>_0x1e0357[_0x384f('0x61')]===_0x33228f);let _0x12570a=contactItemTypes['find'](_0x2e0681=>_0x2e0681['name']+'_description'===_0x33228f);if(_[_0x384f('0x69')](_0x4e9c0a)&&_['isNil'](_0x12570a)){if(_0x93b180[_0x384f('0x6a')](_0x33228f)){if(_0x13e008['data'][_0x46ec43][_0x93b180[_0x33228f]]){var _0x53578f=_[_0x384f('0x6b')](_0x13e008['data'][_0x46ec43][_0x93b180[_0x33228f]][_0x384f('0x6c')](/"/g,'\x27'));switch(_0x33228f){case _0x384f('0x2b'):var _0x2d22ec=moment(_0x53578f,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2d22ec[_0x384f('0x6d')]()){_0x4b3399[_0x384f('0x16')]('\x22'+_0x53578f+'\x22');}else{_0x40bb41['push'](_0x384f('0x6e'));}break;case _0x384f('0x2f'):var _0x3b9ce3=parseInt(_0x53578f);_0x53578f=_[_0x384f('0x6f')](_0x3b9ce3)||_0x3b9ce3<0x0||_0x3b9ce3>0x4?_0x228cd1?0x3:0x2:_0x3b9ce3;_0x4b3399[_0x384f('0x16')]('\x22'+_0x53578f+'\x22');break;case _0x384f('0x70'):var _0x3337c4=parseInt(_0x53578f);if(_[_0x384f('0x71')](_0x3337c4)&&_['includes'](_0x3189c1,_0x3337c4)){_0x4b3399[_0x384f('0x16')]('\x22'+_0x3337c4+'\x22');}else{_0x40bb41[_0x384f('0x16')](_0x384f('0x72'));}break;case _0x384f('0x73'):if(isEmail(_0x53578f)){_0x4b3399['push']('\x22'+_0x53578f+'\x22');}else{_0x40bb41['push'](_0x384f('0x74'));}break;case _0x384f('0x75'):var _0x409562=moment(_0x53578f,_0x384f('0x76'),!![]);if(_0x409562['isValid']()){_0x4b3399['push']('\x22'+_0x53578f+'\x22');}else{_0x40bb41['push'](_0x384f('0x77'));}break;default:_0x4b3399[_0x384f('0x16')]('\x22'+_0x53578f+'\x22');}}else{switch(_0x33228f){case'firstName':case _0x384f('0xc'):_0x40bb41[_0x384f('0x16')](_0x33228f+_0x384f('0x78'));break;default:_0x4b3399[_0x384f('0x16')]('\x22\x22');}}}}else{var _0xbba64='';if(!_[_0x384f('0x69')](_0x4e9c0a)){if(!_0x3ee9f3[_0x384f('0x6a')](_0x4e9c0a['id'])){for(var _0x229362=0x0;_0x229362<_0x93b180[_0x33228f][_0x384f('0x15')];_0x229362++){var _0x53578f=_[_0x384f('0x6b')](_0x13e008[_0x384f('0x65')][_0x46ec43][_0x93b180[_0x33228f][_0x229362]][_0x384f('0x6c')](/"/g,'\x27'));var _0x369b8d=phoneDescriptions['find'](_0x2c9cd0=>_0x2c9cd0[_0x384f('0x79')]===_0x4e9c0a['id']);if(!_[_0x384f('0x69')](_0x369b8d)){var _0x15b7e8=_[_0x384f('0x6b')](_0x13e008['data'][_0x46ec43][_0x93b180[_0x369b8d[_0x384f('0x7a')]][0x0]][_0x384f('0x6c')](/"/g,'\x27'));if(!_[_0x384f('0x69')](_0x15b7e8))_0x53578f=_0x53578f+'§'+_0x15b7e8;}if(_0xbba64=='')_0xbba64=_0x53578f;else _0xbba64+='|'+_0x53578f;}_0xaa1da['push'](_0x4e9c0a['id']+':'+_0xbba64);_0x3ee9f3[_0x4e9c0a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4b3399[_0x384f('0x16')]('\x22'+_0xaa1da[_0x384f('0x11')](';')+'\x22');}if(_0x40bb41[_0x384f('0x15')]){handleError(_0x13e008[_0x384f('0x65')][_0x46ec43],{'code':_0x384f('0x7b'),'message':_0x40bb41['join']()});}else{fs[_0x384f('0x7c')](_0xc2b700,_0x4b3399[_0x384f('0x11')]()+'\x0a');}_0x4b3399=[];}if(!(stats[_0x384f('0x66')]%0xc8)){socket[_0x384f('0x7d')](_0x384f('0x7e')+_0x1219ba,stats);stats[_0x384f('0x67')]=[];}}if(stopped){logger[_0x384f('0x50')]('Abort\x20parser');_0x467e9f[_0x384f('0x7f')]();}}catch(_0x58d5d5){handleError(_0x13e008[_0x384f('0x65')][_0x46ec43],{'code':_0x384f('0x80'),'message':_0x58d5d5['message']});logger[_0x384f('0x51')]('step',_0x58d5d5['message']);}},'complete':function(){try{var _0x3faf3d=[];var _0x4c86c8=_0x384f('0x32');if(_0x324594[_0x384f('0x81')]&&_0x324594['duplicates'][_0x384f('0x15')]){_0x4c86c8=_0x384f('0x82')+_0x1219ba;_0x3faf3d[_0x384f('0x16')](_0x384f('0x83')+_0x4c86c8+_0x384f('0x84'));}logger[_0x384f('0x50')](_0x384f('0x85'),contactItemTypes[_0x384f('0x15')]);var _0x55593d=util[_0x384f('0x86')](_0x384f('0x87'),_0xc2b700,_0x4c86c8,_0x5a892a,_0x324594['ListId'],_0x324594[_0x384f('0x49')]||null,NOW,NOW);if(_['isNil'](_0x93b180[_0x384f('0x2b')])){_0x55593d+=_0x384f('0x88');}_0x3faf3d[_0x384f('0x16')](_0x55593d);if(_0x324594['duplicates']&&_0x324594[_0x384f('0x81')][_0x384f('0x15')]){_0x3faf3d[_0x384f('0x16')](insertCmContact(_0x324594['ListId'],_0x4c86c8,_0x324594[_0x384f('0x81')],_0x93b180));_0x3faf3d['push'](_0x384f('0x89')+_0x4c86c8+';');}BPromise['each'](_0x3faf3d,handleQuery)[_0x384f('0x18')](function(_0x43cd54){BPromise[_0x384f('0x17')]([handleAdditionalPhones()])['then'](function(){_0x3faf3d=[];for(var _0x5a506a=0x0;_0x5a506a<promisesAdditionalPhones[_0x384f('0x15')];_0x5a506a++){_0x3faf3d[_0x384f('0x16')](createAdditionalPhone(promisesAdditionalPhones[_0x5a506a][_0x384f('0x8a')],promisesAdditionalPhones[_0x5a506a][_0x384f('0x8b')],promisesAdditionalPhones[_0x5a506a][_0x384f('0xc')],promisesAdditionalPhones[_0x5a506a][_0x384f('0x8c')]));}BPromise['all'](_0x3faf3d)[_0x384f('0x18')](function(){_0x3faf3d=[];_0x3faf3d['push'](insertCmHopper(_0x324594['ListId'],'voice_queues_has_cm_lists',_0x384f('0x8d'),'VoiceQueueId',_0x228cd1));_0x3faf3d[_0x384f('0x16')](insertCmHopperBlack(_0x324594['ListId'],_0x384f('0x8e'),'voice_queues','VoiceQueueId'));_0x3faf3d[_0x384f('0x16')](insertCmHopper(_0x324594[_0x384f('0x2c')],_0x384f('0x8f'),_0x384f('0x90'),_0x384f('0x91'),_0x228cd1));_0x3faf3d[_0x384f('0x16')](insertCmHopperBlack(_0x324594[_0x384f('0x2c')],_0x384f('0x92'),_0x384f('0x90'),_0x384f('0x91')));_0x3faf3d[_0x384f('0x16')](insertCmHopperAdditionalPhones(_0x324594['ListId']));BPromise[_0x384f('0x93')](_0x3faf3d,handleQuery)[_0x384f('0x18')](function(_0x16ed44){stats[_0x384f('0x94')]=!![];stats[_0x384f('0x95')]=_0x324594['duplicates']&&_0x324594[_0x384f('0x81')]['length']?results[0x2][_0x384f('0x95')]:results[0x0][_0x384f('0x95')];socket['emit'](_0x384f('0x7e')+_0x1219ba,stats);fs['unlink'](_0x8298fc);fs['unlink'](_0xc2b700);process[_0x384f('0x96')](0x0);})[_0x384f('0x57')](function(_0x9808b6){logger[_0x384f('0x51')](_0x9808b6[_0x384f('0x53')]);process[_0x384f('0x96')](0x1);});});});})[_0x384f('0x57')](function(_0x24b763){logger[_0x384f('0x51')](_0x24b763['message']);process[_0x384f('0x96')](0x1);});}catch(_0x9d218f){logger[_0x384f('0x51')](_0x384f('0x97'),_0x9d218f[_0x384f('0x53')]);process['exit'](0x1);}},'error':function(_0x60f5ef,_0x423306,_0x29a00c,_0x226bef){throw new Error(_0x226bef);}});});}function validate(){if(process[_0x384f('0x98')]&&process[_0x384f('0x98')][_0x384f('0x15')]<0x4){throw new Error(_0x384f('0x99'));}var _0x29f4fd=path[_0x384f('0x11')](config['root'],_0x384f('0x5f'),process[_0x384f('0x98')][0x2]);if(!fs[_0x384f('0x9a')](_0x29f4fd)){throw new Error(_0x384f('0x9b'));}var _0x1eb646={};try{_0x1eb646=JSON[_0x384f('0x9c')](process[_0x384f('0x98')][0x3]);if(!_0x1eb646[_0x384f('0x5b')]){throw new Error(_0x384f('0x9d'));}if(!_0x1eb646['binding'][_0x384f('0xc')]){throw new Error(_0x384f('0x9e'));}if(!_0x1eb646['binding'][_0x384f('0x9f')]){throw new Error(_0x384f('0xa0'));}var _0x3c2d18=0x0;if(_0x1eb646['binding'][_0x384f('0x70')]){_0x3c2d18=0x1;}if(!_0x1eb646['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x33666d){throw new Error(_0x384f('0xa1'));}var _0x2c9d99=[];try{_0x2c9d99=_[_0x384f('0xa2')](JSON[_0x384f('0x9c')](process[_0x384f('0x98')][0x4]),'id');}catch(_0x22c629){logger[_0x384f('0x50')](_0x384f('0xa3'));}main(_0x29f4fd,_0x1eb646,_0x2c9d99,_0x3c2d18);}validate();process['on'](_0x384f('0xa4'),handleStop);process['on'](_0x384f('0xa5'),handleUncaughtException);
\ No newline at end of file
+var _0xac9f=['voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','campaigns','each','affectedRows','contact:import:','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','length','push','all','then','split','findOne','CmContactHasItem','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','into','cm_hopper','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.updatedAt','insert','cm_hopper_black','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','select','\x20=\x20?','toString','cm_contact_has_items.createdAt','cm_hopper_additional_phones','fromQuery','CmHopperId','OrderBy','fields','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','Received\x20SIGINT','message','exit','errors','sequelize','query','spread','catch','error','info','main','stringify','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','name','_description','header','writeFileSync','parse','createReadStream','data','rows','find','isNil','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','\x20not\x20specified','itemTypeId','description','SystemRow','emit','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists'];(function(_0x561d8f,_0x457076){var _0x21d9f0=function(_0xf1681f){while(--_0xf1681f){_0x561d8f['push'](_0x561d8f['shift']());}};_0x21d9f0(++_0x457076);}(_0xac9f,0x15e));var _0xfac9=function(_0x3ba6ef,_0x37af5d){_0x3ba6ef=_0x3ba6ef-0x0;var _0x1f983e=_0xac9f[_0x3ba6ef];return _0x1f983e;};'use strict';var fs=require('fs');var path=require(_0xfac9('0x0'));var _=require(_0xfac9('0x1'));var Papa=require(_0xfac9('0x2'));var util=require(_0xfac9('0x3'));var BPromise=require('bluebird');var moment=require(_0xfac9('0x4'));var squel=require(_0xfac9('0x5'));var Redis=require(_0xfac9('0x6'));var db=require(_0xfac9('0x7'))['db'];var config=require(_0xfac9('0x8'));var logger=require(_0xfac9('0x9'))('import');config[_0xfac9('0xa')]=_['defaults'](config[_0xfac9('0xa')],{'host':_0xfac9('0xb'),'port':0x18eb});var socket=require(_0xfac9('0xc'))(new Redis(config[_0xfac9('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xfac9('0xd')](_0xfac9('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x2a8b05){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))*$/[_0xfac9('0xf')](_0x2a8b05);}function selectNotIn(_0x2430dd,_0x154c99,_0x2fa86b,_0x51a8e8,_0x34c625){return squel['select']()[_0xfac9('0x10')](_0xfac9('0x11'))[_0xfac9('0x12')](_0x51a8e8)[_0xfac9('0x13')](_0x154c99,null,_0x154c99+_0xfac9('0x14')+_0x51a8e8+'.'+_0x2fa86b)[_0xfac9('0x15')](_0x51a8e8+'.'+_0x2fa86b+_0xfac9('0x16')+_0x2430dd+'.'+_0x2fa86b)['where'](_0x154c99+'.dialCheckDuplicateType\x20IN\x20('+_0x34c625[_0xfac9('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3e1d9b,_0x577281){promisesAdditionalPhones=[];return db[_0xfac9('0x17')][_0xfac9('0x18')]({'raw':!![],'attributes':['id',_0xfac9('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x5c94d3){if(_0x5c94d3!==null){var _0x156913=[];for(var _0x383a3b=0x0;_0x383a3b<_0x5c94d3[_0xfac9('0x1a')];_0x383a3b++){var _0x1d27bd=_0x5c94d3[_0x383a3b];_0x156913[_0xfac9('0x1b')](insertAdditionalPhones(_0x1d27bd));}}Promise[_0xfac9('0x1c')](_0x156913)[_0xfac9('0x1d')](function(){_0x3e1d9b({'val':0x1});});});});}function insertAdditionalPhones(_0xb274ec){return new Promise(function(_0x4bc3e7,_0x2ba9be){var _0x507286=_0xb274ec[_0xfac9('0x19')];var _0x41acae=_0x507286[_0xfac9('0x1e')](';');var _0x42435d=[];orderBy=0x0;for(var _0x5d4a37=0x0;_0x5d4a37<_0x41acae[_0xfac9('0x1a')];_0x5d4a37++){_0x42435d['push'](splitAdditionalPhone(_0xb274ec['id'],_0x41acae[_0x5d4a37]));}Promise[_0xfac9('0x1c')](_0x42435d)[_0xfac9('0x1d')](function(){_0x4bc3e7({'val':_0x41acae[_0xfac9('0x1a')]});});});}function splitAdditionalPhone(_0x5108dd,_0x4a54b1){return new Promise(function(_0x26a036,_0x158603){var _0x26489b=_0x4a54b1[_0xfac9('0x1e')](':');var _0x382f07=_0x26489b[0x0];var _0x418571=_0x26489b[0x1];if(_0x418571!==''){var _0x1807dd=_0x418571['split']('|');var _0x326c2a=[];for(var _0x245fc9=0x0;_0x245fc9<_0x1807dd['length'];_0x245fc9++){if(_0x1807dd[_0x245fc9]!==''){var _0x42a29e=_['filter'](promisesAdditionalPhones,{'contactId':_0x5108dd,'phone':_0x1807dd[_0x245fc9]});if(_0x42a29e[_0xfac9('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xfac9('0x1b')]({'contactId':_0x5108dd,'contactTypeId':_0x382f07,'phone':_0x1807dd[_0x245fc9],'orderBy':orderBy});}}}_0x26a036({'ok':0x1});}else _0x26a036({'res':0x0});});}function createAdditionalPhone(_0x16e9aa,_0x4000e6,_0x173437,_0x52028c){var _0x2017ee='';var _0x1b9ef7='';var _0x482a8b=_0x173437[_0xfac9('0x1e')]('§');_0x2017ee=_0x482a8b[0x0];if(_0x482a8b[_0xfac9('0x1a')]==0x2)_0x1b9ef7=_0x482a8b[0x1];return new Promise(function(_0x3d6deb,_0x1c735b){return db['CmContactHasItem'][_0xfac9('0x1f')]({'where':{'CmContactId':_0x16e9aa,'item':_0x2017ee}})[_0xfac9('0x1d')](function(_0x39a5f5){if(_0x39a5f5){return db[_0xfac9('0x20')]['update']({'ItemTypeId':_0x4000e6,'description':_0x1b9ef7,'OrderBy':_0x52028c},{'where':{'CmContactId':_0x16e9aa,'item':_0x2017ee}})['then'](function(_0x4009a4){_0x3d6deb({'res':'updated'});});}else{return db[_0xfac9('0x20')][_0xfac9('0x21')]({'CmContactId':_0x16e9aa,'item':_0x2017ee,'description':_0x1b9ef7,'ItemTypeId':_0x4000e6,'OrderBy':_0x52028c,'ItemClass':_0xfac9('0x22')})[_0xfac9('0x1d')](function(_0x37d5e8){_0x3d6deb({'res':_0xfac9('0x23')});});}});});}function insertCmHopper(_0xd31f24,_0x28424e,_0x5a69ee,_0x23656d,_0x56d07c){var _0x70c266=[_0xfac9('0x24'),_0xfac9('0x25'),_0xfac9('0x26'),_0xfac9('0x27'),_0x28424e+'.'+_0x23656d,_0xfac9('0x28'),'cm_contacts.updatedAt','cm_contacts.priority',_0xfac9('0x29'),'\x22'+_0x56d07c+'\x22'];return squel['insert']()[_0xfac9('0x2a')](_0xfac9('0x2b'))['fromQuery']([_0xfac9('0x11'),'scheduledat',_0xfac9('0x2c'),_0xfac9('0x2d'),_0x23656d,_0xfac9('0x2e'),_0xfac9('0x2f'),_0xfac9('0x30'),_0xfac9('0x31'),_0xfac9('0x32')],squel['select']()['fields'](_0x70c266)['from'](_0x28424e)[_0xfac9('0x13')](_0xfac9('0x33'),null,'cm_contacts.ListId\x20=\x20'+_0x28424e+_0xfac9('0x34'))[_0xfac9('0x13')](_0x5a69ee,null,_0x5a69ee+_0xfac9('0x14')+_0x28424e+'.'+_0x23656d)[_0xfac9('0x15')](_0x28424e+'.CmListId\x20=\x20?',_0xd31f24)[_0xfac9('0x15')](_0xfac9('0x35'),NOW)[_0xfac9('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x28424e,_0x5a69ee,_0x23656d,'cm_hopper',['\x22always\x22',_0xfac9('0x36')]))['where'](_0xfac9('0x37'),selectNotIn(_0x28424e,_0x5a69ee,_0x23656d,'cm_hopper',['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x4e8f1c,_0x253682,_0x331a8e,_0x53adf2){var _0x1df995=[_0xfac9('0x24'),_0xfac9('0x26'),_0xfac9('0x27'),_0x253682+'.'+_0x53adf2,_0xfac9('0x28'),_0xfac9('0x38')];return squel[_0xfac9('0x39')]()['into'](_0xfac9('0x3a'))['fromQuery']([_0xfac9('0x11'),_0xfac9('0x2c'),_0xfac9('0x2d'),_0x53adf2,_0xfac9('0x2e'),_0xfac9('0x2f')],squel['select']()['fields'](_0x1df995)['from'](_0x253682)[_0xfac9('0x13')](_0xfac9('0x33'),null,_0xfac9('0x3b')+_0x253682+_0xfac9('0x34'))[_0xfac9('0x13')](_0x331a8e,null,_0x331a8e+_0xfac9('0x14')+_0x253682+'.'+_0x53adf2)[_0xfac9('0x15')](_0x253682+_0xfac9('0x3c'),_0x4e8f1c)[_0xfac9('0x15')](_0xfac9('0x35'),NOW)[_0xfac9('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xfac9('0x3d')]()[_0xfac9('0x10')]('phone')['from'](_0xfac9('0x3a'))['where']('ListId\x20=\x20?',_0x4e8f1c)[_0xfac9('0x15')](_0x53adf2+_0xfac9('0x3e'),_0x253682+'.'+_0x53adf2)))[_0xfac9('0x3f')]();}function insertCmHopperAdditionalPhones(_0x441567){var _0x9e634f=['cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xfac9('0x40'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0xfac9('0x2a')](_0xfac9('0x41'))[_0xfac9('0x42')]([_0xfac9('0x43'),_0xfac9('0x11'),_0xfac9('0x44'),_0xfac9('0x2e'),_0xfac9('0x2f')],squel['select']()[_0xfac9('0x45')](_0x9e634f)[_0xfac9('0x12')](_0xfac9('0x2b'))[_0xfac9('0x13')](_0xfac9('0x33'),null,_0xfac9('0x46'))[_0xfac9('0x13')]('cm_contact_has_items',null,_0xfac9('0x47'))[_0xfac9('0x15')](_0xfac9('0x48'),_0x441567)[_0xfac9('0x15')](_0xfac9('0x35'),NOW))[_0xfac9('0x3f')]();}function insertCmContact(_0x17566a,_0x4a5847,_0x58224a,_0x75a0b6){var _0x528882=_[_0xfac9('0x49')](_[_0xfac9('0x4a')](_0x75a0b6),[_0xfac9('0x2d'),_0xfac9('0x4b'),_0xfac9('0x2e'),'updatedAt']);return squel[_0xfac9('0x39')]()['into'](_0xfac9('0x33'))[_0xfac9('0x42')](_0x528882,squel[_0xfac9('0x3d')]()[_0xfac9('0x45')](_0x528882)['from'](_0x4a5847)[_0xfac9('0x15')]('('+_0x58224a[_0xfac9('0x13')](',')+_0xfac9('0x4c'),squel['select']()['fields'](_0x58224a)[_0xfac9('0x12')]('cm_contacts')[_0xfac9('0x15')]('ListId\x20=\x20?',_0x17566a)['where']('deletedAt\x20IS\x20NULL'))[_0xfac9('0x15')](_0xfac9('0x4d'),squel['select']()[_0xfac9('0x10')](_0xfac9('0x4e'),'min_id')[_0xfac9('0x12')](_0x4a5847)[_0xfac9('0x4f')](_0x58224a[_0xfac9('0x13')](','))))[_0xfac9('0x3f')]();}function handleStop(){logger['info'](_0xfac9('0x50'));stopped=!![];}function handleUncaughtException(_0xe67408){logger['error'](_0xe67408[_0xfac9('0x51')]);process[_0xfac9('0x52')](0x1);}function handleError(_0x2b3d2f,_0x58dc2c){stats[_0xfac9('0x53')][_0xfac9('0x1b')]({'name':_0x58dc2c['code'],'message':_0x58dc2c[_0xfac9('0x51')],'row':_0x2b3d2f});}function handleQuery(_0x4a691d){logger['info'](_0x4a691d);return db[_0xfac9('0x54')][_0xfac9('0x55')](_0x4a691d)[_0xfac9('0x56')](function(_0x4d74c1){results[_0xfac9('0x1b')](_0x4d74c1);})[_0xfac9('0x57')](function(_0x6e4b6a){logger[_0xfac9('0x58')](_0x6e4b6a[_0xfac9('0x51')]);});}function main(_0x352a6c,_0x7f2b9d,_0x1534b7,_0x243bff){logger[_0xfac9('0x59')](_0xfac9('0x5a'),_0x352a6c,JSON[_0xfac9('0x5b')](_0x7f2b9d));process['send'](_0xfac9('0x5c'));var _0x2c126f=_0x7f2b9d[_0xfac9('0x5d')];var _0x41122e=_[_0xfac9('0x5e')](_0x2c126f);var _0x1f083a=_0x7f2b9d[_0xfac9('0x5f')];var _0x270983=path['join'](config[_0xfac9('0x60')],_0xfac9('0x61'),_0x1f083a+_0xfac9('0x62'));logger['info'](_0xfac9('0x63'),_0x7f2b9d);db[_0xfac9('0x64')][_0xfac9('0x18')]({'raw':!![],'attributes':['id','name']})['then'](function(_0x43b59e){for(var _0x5dcb31=0x0;_0x5dcb31<_0x43b59e[_0xfac9('0x1a')];_0x5dcb31++){if(_0x43b59e[_0x5dcb31][_0xfac9('0x65')]in _0x2c126f){contactItemTypes['push'](_0x43b59e[_0x5dcb31]);delete _0x41122e[_0x43b59e[_0x5dcb31]['name']];hasAdditionalPhones=!![];}for(var _0x34589a in _0x2c126f){if(_0x43b59e[_0x5dcb31][_0xfac9('0x65')]+_0xfac9('0x66')===_0x34589a){phoneDescriptions[_0xfac9('0x1b')]({'itemTypeId':_0x43b59e[_0x5dcb31]['id'],'description':_0x34589a});delete _0x41122e[_0x34589a];}}}if(hasAdditionalPhones)_0x41122e[_0xfac9('0x19')]='';var _0x3d0973=_[_0xfac9('0x4a')](_0x41122e)[_0xfac9('0x13')]();logger[_0xfac9('0x59')](_0xfac9('0x67'),_0x3d0973);fs[_0xfac9('0x68')](_0x270983,_0x3d0973+'\x0a');Papa[_0xfac9('0x69')](fs[_0xfac9('0x6a')](_0x352a6c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4557e8,_0x16ebe9){try{for(var _0x223e9d=0x0,_0x4fbe64=[];_0x223e9d<_0x4557e8[_0xfac9('0x6b')][_0xfac9('0x1a')];_0x223e9d++){stats[_0xfac9('0x6c')]+=0x1;if(_0x4557e8[_0xfac9('0x53')][_0x223e9d]){handleError(_0x4557e8[_0xfac9('0x6b')][_0x223e9d],_0x4557e8[_0xfac9('0x53')][_0x223e9d]);}else{var _0x2dca24=[];var _0x18dba9=[];var _0x113c47={};for(var _0x20f0ec in _0x2c126f){let _0xffc2a7=contactItemTypes[_0xfac9('0x6d')](_0x49e38a=>_0x49e38a[_0xfac9('0x65')]===_0x20f0ec);let _0x3faf29=contactItemTypes[_0xfac9('0x6d')](_0x2d0680=>_0x2d0680[_0xfac9('0x65')]+_0xfac9('0x66')===_0x20f0ec);if(_['isNil'](_0xffc2a7)&&_[_0xfac9('0x6e')](_0x3faf29)){if(_0x2c126f[_0xfac9('0x6f')](_0x20f0ec)){if(_0x4557e8[_0xfac9('0x6b')][_0x223e9d][_0x2c126f[_0x20f0ec]]){var _0xe53834=_[_0xfac9('0x70')](_0x4557e8[_0xfac9('0x6b')][_0x223e9d][_0x2c126f[_0x20f0ec]][_0xfac9('0x71')](/"/g,'\x27'));switch(_0x20f0ec){case _0xfac9('0x72'):var _0x540b32=moment(_0xe53834,_0xfac9('0xe'),!![]);if(_0x540b32[_0xfac9('0x73')]()){_0x4fbe64[_0xfac9('0x1b')]('\x22'+_0xe53834+'\x22');}else{_0x2dca24['push'](_0xfac9('0x74'));}break;case'priority':var _0x42a802=parseInt(_0xe53834);_0xe53834=_[_0xfac9('0x75')](_0x42a802)||_0x42a802<0x0||_0x42a802>0x4?_0x243bff?0x3:0x2:_0x42a802;_0x4fbe64[_0xfac9('0x1b')]('\x22'+_0xe53834+'\x22');break;case _0xfac9('0x31'):var _0x58ca4e=parseInt(_0xe53834);if(_[_0xfac9('0x76')](_0x58ca4e)&&_['includes'](_0x1534b7,_0x58ca4e)){_0x4fbe64[_0xfac9('0x1b')]('\x22'+_0x58ca4e+'\x22');}else{_0x2dca24[_0xfac9('0x1b')](_0xfac9('0x77'));}break;case _0xfac9('0x78'):if(isEmail(_0xe53834)){_0x4fbe64[_0xfac9('0x1b')]('\x22'+_0xe53834+'\x22');}else{_0x2dca24[_0xfac9('0x1b')](_0xfac9('0x79'));}break;case _0xfac9('0x7a'):var _0x46a852=moment(_0xe53834,_0xfac9('0x7b'),!![]);if(_0x46a852[_0xfac9('0x73')]()){_0x4fbe64[_0xfac9('0x1b')]('\x22'+_0xe53834+'\x22');}else{_0x2dca24[_0xfac9('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4fbe64['push']('\x22'+_0xe53834+'\x22');}}else{switch(_0x20f0ec){case'firstName':case _0xfac9('0x11'):_0x2dca24[_0xfac9('0x1b')](_0x20f0ec+_0xfac9('0x7c'));break;default:_0x4fbe64[_0xfac9('0x1b')]('\x22\x22');}}}}else{var _0xef9d80='';if(!_[_0xfac9('0x6e')](_0xffc2a7)){if(!_0x113c47[_0xfac9('0x6f')](_0xffc2a7['id'])){for(var _0xcdad10=0x0;_0xcdad10<_0x2c126f[_0x20f0ec][_0xfac9('0x1a')];_0xcdad10++){var _0xe53834=_[_0xfac9('0x70')](_0x4557e8[_0xfac9('0x6b')][_0x223e9d][_0x2c126f[_0x20f0ec][_0xcdad10]][_0xfac9('0x71')](/"/g,'\x27'));var _0x35a9a9=phoneDescriptions[_0xfac9('0x6d')](_0x362802=>_0x362802[_0xfac9('0x7d')]===_0xffc2a7['id']);if(!_[_0xfac9('0x6e')](_0x35a9a9)){var _0x4d9cb4=_[_0xfac9('0x70')](_0x4557e8[_0xfac9('0x6b')][_0x223e9d][_0x2c126f[_0x35a9a9[_0xfac9('0x7e')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xfac9('0x6e')](_0x4d9cb4))_0xe53834=_0xe53834+'§'+_0x4d9cb4;}if(_0xef9d80=='')_0xef9d80=_0xe53834;else _0xef9d80+='|'+_0xe53834;}_0x18dba9[_0xfac9('0x1b')](_0xffc2a7['id']+':'+_0xef9d80);_0x113c47[_0xffc2a7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4fbe64[_0xfac9('0x1b')]('\x22'+_0x18dba9['join'](';')+'\x22');}if(_0x2dca24['length']){handleError(_0x4557e8[_0xfac9('0x6b')][_0x223e9d],{'code':_0xfac9('0x7f'),'message':_0x2dca24[_0xfac9('0x13')]()});}else{fs['appendFileSync'](_0x270983,_0x4fbe64['join']()+'\x0a');}_0x4fbe64=[];}if(!(stats['rows']%0xc8)){socket[_0xfac9('0x80')]('contact:import:'+_0x1f083a,stats);stats[_0xfac9('0x53')]=[];}}if(stopped){logger['info'](_0xfac9('0x81'));_0x16ebe9['abort']();}}catch(_0x499c29){handleError(_0x4557e8[_0xfac9('0x6b')][_0x223e9d],{'code':_0xfac9('0x82'),'message':_0x499c29['message']});logger[_0xfac9('0x58')](_0xfac9('0x83'),_0x499c29['message']);}},'complete':function(){try{var _0x224c8c=[];var _0x10a5f2=_0xfac9('0x33');if(_0x7f2b9d[_0xfac9('0x84')]&&_0x7f2b9d[_0xfac9('0x84')][_0xfac9('0x1a')]){_0x10a5f2=_0xfac9('0x85')+_0x1f083a;_0x224c8c[_0xfac9('0x1b')](_0xfac9('0x86')+_0x10a5f2+_0xfac9('0x87'));}logger[_0xfac9('0x59')]('CIS\x20len',contactItemTypes[_0xfac9('0x1a')]);var _0x2ae4ea=util[_0xfac9('0xd')](_0xfac9('0x88'),_0x270983,_0x10a5f2,_0x3d0973,_0x7f2b9d[_0xfac9('0x2d')],_0x7f2b9d[_0xfac9('0x4b')]||null,NOW,NOW);if(_['isNil'](_0x2c126f[_0xfac9('0x72')])){_0x2ae4ea+=',\x20scheduledAt\x20=\x20NOW()';}_0x224c8c['push'](_0x2ae4ea);if(_0x7f2b9d[_0xfac9('0x84')]&&_0x7f2b9d[_0xfac9('0x84')][_0xfac9('0x1a')]){_0x224c8c[_0xfac9('0x1b')](insertCmContact(_0x7f2b9d['ListId'],_0x10a5f2,_0x7f2b9d[_0xfac9('0x84')],_0x2c126f));_0x224c8c[_0xfac9('0x1b')](_0xfac9('0x89')+_0x10a5f2+';');}BPromise['each'](_0x224c8c,handleQuery)[_0xfac9('0x1d')](function(_0x1eb3dd){BPromise[_0xfac9('0x1c')]([handleAdditionalPhones()])['then'](function(){_0x224c8c=[];for(var _0x1c383e=0x0;_0x1c383e<promisesAdditionalPhones[_0xfac9('0x1a')];_0x1c383e++){_0x224c8c[_0xfac9('0x1b')](createAdditionalPhone(promisesAdditionalPhones[_0x1c383e][_0xfac9('0x8a')],promisesAdditionalPhones[_0x1c383e][_0xfac9('0x8b')],promisesAdditionalPhones[_0x1c383e][_0xfac9('0x11')],promisesAdditionalPhones[_0x1c383e][_0xfac9('0x8c')]));}BPromise[_0xfac9('0x1c')](_0x224c8c)[_0xfac9('0x1d')](function(){_0x224c8c=[];_0x224c8c[_0xfac9('0x1b')](insertCmHopper(_0x7f2b9d[_0xfac9('0x2d')],_0xfac9('0x8d'),_0xfac9('0x8e'),_0xfac9('0x8f'),_0x243bff));_0x224c8c[_0xfac9('0x1b')](insertCmHopperBlack(_0x7f2b9d[_0xfac9('0x2d')],_0xfac9('0x90'),_0xfac9('0x8e'),'VoiceQueueId'));_0x224c8c['push'](insertCmHopper(_0x7f2b9d[_0xfac9('0x2d')],'campaigns_has_cm_lists','campaigns',_0xfac9('0x91'),_0x243bff));_0x224c8c[_0xfac9('0x1b')](insertCmHopperBlack(_0x7f2b9d[_0xfac9('0x2d')],_0xfac9('0x92'),_0xfac9('0x93'),_0xfac9('0x91')));_0x224c8c[_0xfac9('0x1b')](insertCmHopperAdditionalPhones(_0x7f2b9d[_0xfac9('0x2d')]));BPromise[_0xfac9('0x94')](_0x224c8c,handleQuery)[_0xfac9('0x1d')](function(_0x5c0dd9){stats['finish']=!![];stats[_0xfac9('0x95')]=_0x7f2b9d['duplicates']&&_0x7f2b9d[_0xfac9('0x84')][_0xfac9('0x1a')]?results[0x2][_0xfac9('0x95')]:results[0x0][_0xfac9('0x95')];socket[_0xfac9('0x80')](_0xfac9('0x96')+_0x1f083a,stats);fs[_0xfac9('0x97')](_0x352a6c);fs[_0xfac9('0x97')](_0x270983);process[_0xfac9('0x52')](0x0);})[_0xfac9('0x57')](function(_0x1509fb){logger[_0xfac9('0x58')](_0x1509fb[_0xfac9('0x51')]);process[_0xfac9('0x52')](0x1);});});});})['catch'](function(_0x5ab69e){logger['error'](_0x5ab69e[_0xfac9('0x51')]);process[_0xfac9('0x52')](0x1);});}catch(_0x32ff8e){logger['error'](_0xfac9('0x98'),_0x32ff8e['message']);process[_0xfac9('0x52')](0x1);}},'error':function(_0x2a1e16,_0x29e64a,_0x2d781,_0x2d1e7b){throw new Error(_0x2d1e7b);}});});}function validate(){if(process[_0xfac9('0x99')]&&process[_0xfac9('0x99')][_0xfac9('0x1a')]<0x4){throw new Error(_0xfac9('0x9a'));}var _0x56348d=path[_0xfac9('0x13')](config[_0xfac9('0x60')],_0xfac9('0x61'),process[_0xfac9('0x99')][0x2]);if(!fs['existsSync'](_0x56348d)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3de747={};try{_0x3de747=JSON[_0xfac9('0x69')](process[_0xfac9('0x99')][0x3]);if(!_0x3de747[_0xfac9('0x5d')]){throw new Error(_0xfac9('0x9b'));}if(!_0x3de747[_0xfac9('0x5d')][_0xfac9('0x11')]){throw new Error(_0xfac9('0x9c'));}if(!_0x3de747[_0xfac9('0x5d')][_0xfac9('0x9d')]){throw new Error(_0xfac9('0x9e'));}var _0x2bbbdd=0x0;if(_0x3de747[_0xfac9('0x5d')][_0xfac9('0x31')]){_0x2bbbdd=0x1;}if(!_0x3de747[_0xfac9('0x2d')]){throw new Error(_0xfac9('0x9f'));}}catch(_0x5c9c19){throw new Error(_0xfac9('0xa0'));}var _0x270835=[];try{_0x270835=_[_0xfac9('0xa1')](JSON['parse'](process[_0xfac9('0x99')][0x4]),'id');}catch(_0x755664){logger[_0xfac9('0x59')](_0xfac9('0xa2'));}main(_0x56348d,_0x3de747,_0x270835,_0x2bbbdd);}validate();process['on']('SIGINT',handleStop);process['on'](_0xfac9('0xa3'),handleUncaughtException);
\ No newline at end of file
index a997678..3646ca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5713=['squel','ioredis','../../../mysqldb','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','isNil','push','all','then','catch','message','split','length','filter','findOne','CmContactHasItem','updated','create','PHONE','inserted','CmContact','CmHopper','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.updatedAt','updatedAt','select','.CmListId\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId','fromQuery','id\x20IN\x20?','field','min_id','group','info','exit','errors','code','error','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','findAll','name','AdditionalPhones','header','writeFileSync','parse','createReadStream','data','rows','find','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','description','SystemRow','emit','contact:import:','Abort\x20parser','abort','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','each','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','argv','existsSync','ListId\x20is\x20mandatory','No\x20agent\x20available','uncaughtException','path','lodash','util','moment'];(function(_0x34ebc6,_0x201e65){var _0x16f800=function(_0x2c72fc){while(--_0x2c72fc){_0x34ebc6['push'](_0x34ebc6['shift']());}};_0x16f800(++_0x201e65);}(_0x5713,0x1c7));var _0x3571=function(_0x338efe,_0x25d882){_0x338efe=_0x338efe-0x0;var _0x5371da=_0x5713[_0x338efe];return _0x5371da;};'use strict';var fs=require('fs');var path=require(_0x3571('0x0'));var _=require(_0x3571('0x1'));var Papa=require('papaparse');var util=require(_0x3571('0x2'));var BPromise=require('bluebird');var moment=require(_0x3571('0x3'));var squel=require(_0x3571('0x4'));var Redis=require(_0x3571('0x5'));var db=require(_0x3571('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x3571('0x7'));config[_0x3571('0x8')]=_[_0x3571('0x9')](config[_0x3571('0x8')],{'host':_0x3571('0xa'),'port':0x18eb});var socket=require(_0x3571('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x3571('0xc')](_0x3571('0xd'));var tempTableName=_0x3571('0xe')+moment()[_0x3571('0xc')](_0x3571('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4d5de0){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'](_0x4d5de0);}function selectNotIn(_0x4177c5,_0x33cb1b,_0x249ddd,_0x587733,_0x57573f){return squel['select']()['field'](_0x3571('0x10'))[_0x3571('0x11')](_0x587733)[_0x3571('0x12')](_0x33cb1b,null,_0x33cb1b+_0x3571('0x13')+_0x587733+'.'+_0x249ddd)[_0x3571('0x14')](_0x587733+'.'+_0x249ddd+_0x3571('0x15')+_0x4177c5+'.'+_0x249ddd)[_0x3571('0x14')](_0x33cb1b+_0x3571('0x16')+_0x57573f[_0x3571('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1558b2,_0x432441){promisesAdditionalPhones=[];promisesContact=[];return db[_0x3571('0x17')][_0x3571('0x18')](_0x3571('0x19')+tempTableName)[_0x3571('0x1a')](function(_0x42a2fb){if(_0x42a2fb!==null){var _0x5da167=[];for(var _0x5a27e1=0x0;_0x5a27e1<_0x42a2fb['length'];_0x5a27e1++){var _0x1e5f22=_0x42a2fb[_0x5a27e1];if(!_['isNil'](_0x1e5f22[_0x3571('0x10')])){if(!_[_0x3571('0x1b')](_0x1e5f22['AdditionalPhones']))_0x5da167[_0x3571('0x1c')](insertAdditionalPhones(_0x1e5f22));promisesContact[_0x3571('0x1c')]({'contact':_0x1e5f22});}}}Promise[_0x3571('0x1d')](_0x5da167)[_0x3571('0x1e')](function(){_0x1558b2({'val':0x1});});})[_0x3571('0x1f')](function(_0x296346){logger['error'](_0x296346[_0x3571('0x20')]);});});}function insertAdditionalPhones(_0x5b811f){return new Promise(function(_0x1cdda8,_0x3da230){var _0x541f08=_0x5b811f['AdditionalPhones'];if(_['isNil'](_0x541f08))_0x3da230({'val':0x0});else{var _0x96a1c8=_0x541f08[_0x3571('0x21')](';');var _0xa6cd35=[];orderBy=0x0;for(var _0x189b3b=0x0;_0x189b3b<_0x96a1c8[_0x3571('0x22')];_0x189b3b++){_0xa6cd35['push'](splitAdditionalPhone(_0x5b811f['id'],_0x96a1c8[_0x189b3b]));}Promise[_0x3571('0x1d')](_0xa6cd35)[_0x3571('0x1e')](function(){_0x1cdda8({'val':_0x96a1c8[_0x3571('0x22')]});});}});}function splitAdditionalPhone(_0x128ab6,_0x234cb5){return new Promise(function(_0x5c5750,_0x2245e7){var _0x238f9c=_0x234cb5['split'](':');var _0x46d4cd=_0x238f9c[0x0];var _0x48a47b=_0x238f9c[0x1];if(_0x48a47b!==''){var _0xbcb9c1=_0x48a47b[_0x3571('0x21')]('|');var _0x242382=[];for(var _0x2a06e4=0x0;_0x2a06e4<_0xbcb9c1[_0x3571('0x22')];_0x2a06e4++){if(_0xbcb9c1[_0x2a06e4]!==''){var _0x285d9c=_[_0x3571('0x23')](promisesAdditionalPhones,{'contactId':_0x128ab6,'phone':_0xbcb9c1[_0x2a06e4]});if(_0x285d9c['length']==0x0){orderBy++;promisesAdditionalPhones[_0x3571('0x1c')]({'contactId':_0x128ab6,'contactTypeId':_0x46d4cd,'phone':_0xbcb9c1[_0x2a06e4],'orderBy':orderBy});}}}_0x5c5750({'ok':0x1});}else _0x5c5750({'res':0x0});});}function createAdditionalPhone(_0x365f15,_0x7341f0,_0x4fbe35,_0x5eded6){var _0x5a362c='';var _0xa6d91f='';var _0x4b1c2f=_0x4fbe35[_0x3571('0x21')]('§');_0x5a362c=_0x4b1c2f[0x0];if(_0x4b1c2f[_0x3571('0x22')]==0x2)_0xa6d91f=_0x4b1c2f[0x1];return new Promise(function(_0x2ef1b9,_0x56e865){return db['CmContactHasItem'][_0x3571('0x24')]({'where':{'CmContactId':_0x365f15,'item':_0x5a362c}})[_0x3571('0x1e')](function(_0x4cc26c){if(_0x4cc26c){return db[_0x3571('0x25')]['update']({'ItemTypeId':_0x7341f0,'description':_0xa6d91f,'OrderBy':_0x5eded6},{'where':{'CmContactId':_0x365f15,'item':_0x5a362c}})[_0x3571('0x1e')](function(_0x4256ca){_0x2ef1b9({'res':_0x3571('0x26')});});}else{return db[_0x3571('0x25')][_0x3571('0x27')]({'CmContactId':_0x365f15,'item':_0x5a362c,'ItemTypeId':_0x7341f0,'description':_0xa6d91f,'OrderBy':_0x5eded6,'ItemClass':_0x3571('0x28')})[_0x3571('0x1e')](function(_0x4c6c2c){_0x2ef1b9({'res':_0x3571('0x29')});});}});});}function updateContact(_0x238a1e){return new Promise(function(_0x1a4155,_0x2202fa){var _0x5a98e9=_0x238a1e['id'];delete _0x238a1e['id'];return db[_0x3571('0x2a')]['update'](_0x238a1e,{'where':{'id':_0x5a98e9}})[_0x3571('0x1e')](function(_0x16c5a0){updatedRows+=0x1;return db[_0x3571('0x2b')][_0x3571('0x2c')]({'phone':_0x238a1e[_0x3571('0x10')]},{'where':{'ContactId':_0x5a98e9}})['then'](function(_0x5c1318){_0x1a4155({'ret':'OK'});});});});}function insertCmHopper(_0x525842,_0x568136,_0x13339b,_0x5cd029,_0x5fad2d){var _0x3a82b6=[_0x3571('0x2d'),_0x3571('0x2e'),_0x3571('0x2f'),_0x3571('0x30'),_0x568136+'.'+_0x5cd029,_0x3571('0x31'),'cm_contacts.updatedAt',_0x3571('0x32'),_0x3571('0x33'),'\x22'+_0x5fad2d+'\x22'];return squel[_0x3571('0x34')]()[_0x3571('0x35')](_0x3571('0x36'))['fromQuery']([_0x3571('0x10'),_0x3571('0x37'),_0x3571('0x38'),_0x3571('0x39'),_0x5cd029,_0x3571('0x3a'),'updatedAt','priority','UserId',_0x3571('0x3b')],squel['select']()[_0x3571('0x3c')](_0x3a82b6)[_0x3571('0x11')](_0x568136)[_0x3571('0x12')](_0x3571('0x3d'),null,_0x3571('0x3e')+_0x568136+_0x3571('0x3f'))['join'](_0x13339b,null,_0x13339b+_0x3571('0x13')+_0x568136+'.'+_0x5cd029)[_0x3571('0x14')](_0x568136+'.CmListId\x20=\x20?',_0x525842)['where'](_0x3571('0x40'),NOW)[_0x3571('0x14')](_0x3571('0x41'),selectNotIn(_0x568136,_0x13339b,_0x5cd029,_0x3571('0x36'),[_0x3571('0x42'),_0x3571('0x43')]))['where'](_0x3571('0x41'),selectNotIn(_0x568136,_0x13339b,_0x5cd029,_0x3571('0x36'),[_0x3571('0x42')])))['toString']();}function insertCmHopperBlack(_0x11d3c0,_0x53761e,_0x155a1a,_0x51cd18){var _0x151f23=[_0x3571('0x2d'),_0x3571('0x2f'),_0x3571('0x30'),_0x53761e+'.'+_0x51cd18,_0x3571('0x31'),_0x3571('0x44')];return squel[_0x3571('0x34')]()[_0x3571('0x35')]('cm_hopper_black')['fromQuery']([_0x3571('0x10'),_0x3571('0x38'),_0x3571('0x39'),_0x51cd18,_0x3571('0x3a'),_0x3571('0x45')],squel[_0x3571('0x46')]()[_0x3571('0x3c')](_0x151f23)['from'](_0x53761e)['join'](_0x3571('0x3d'),null,_0x3571('0x3e')+_0x53761e+_0x3571('0x3f'))[_0x3571('0x12')](_0x155a1a,null,_0x155a1a+_0x3571('0x13')+_0x53761e+'.'+_0x51cd18)[_0x3571('0x14')](_0x53761e+_0x3571('0x47'),_0x11d3c0)[_0x3571('0x14')](_0x3571('0x40'),NOW)[_0x3571('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x3571('0x46')]()['field'](_0x3571('0x10'))[_0x3571('0x11')](_0x3571('0x48'))['where'](_0x3571('0x49'),_0x11d3c0)[_0x3571('0x14')](_0x51cd18+_0x3571('0x4a'),_0x53761e+'.'+_0x51cd18)))[_0x3571('0x4b')]();}function insertCmHopperAdditionalPhones(_0x28e2d0){var _0x8d850=[_0x3571('0x4c'),'cm_contact_has_items.item',_0x3571('0x4d'),'cm_contact_has_items.createdAt',_0x3571('0x4e')];return squel['insert']()[_0x3571('0x35')](_0x3571('0x4f'))['fromQuery']([_0x3571('0x50'),_0x3571('0x10'),'OrderBy','createdAt',_0x3571('0x45')],squel[_0x3571('0x46')]()[_0x3571('0x3c')](_0x8d850)[_0x3571('0x11')](_0x3571('0x36'))[_0x3571('0x12')]('cm_contacts',null,_0x3571('0x51'))[_0x3571('0x12')](_0x3571('0x52'),null,_0x3571('0x53'))[_0x3571('0x14')]('cm_hopper.ListId\x20=\x20?',_0x28e2d0)[_0x3571('0x14')](_0x3571('0x40'),NOW))[_0x3571('0x4b')]();}function insertCmContact(_0x20b54b,_0x2c958d,_0x24abe6,_0x4eb753){var _0x3ddc28=_[_0x3571('0x54')](_[_0x3571('0x55')](_0x4eb753),['ListId',_0x3571('0x56'),_0x3571('0x3a'),_0x3571('0x45')]);return squel[_0x3571('0x34')]()['into']('cm_contacts')[_0x3571('0x57')](_0x3ddc28,squel[_0x3571('0x46')]()[_0x3571('0x3c')](_0x3ddc28)[_0x3571('0x11')](_0x2c958d)[_0x3571('0x14')]('('+_0x24abe6[_0x3571('0x12')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x3571('0x3c')](_0x24abe6)[_0x3571('0x11')](_0x3571('0x3d'))[_0x3571('0x14')](_0x3571('0x49'),_0x20b54b))[_0x3571('0x14')](_0x3571('0x58'),squel[_0x3571('0x46')]()[_0x3571('0x59')]('MIN(id)',_0x3571('0x5a'))[_0x3571('0x11')](_0x2c958d)[_0x3571('0x5b')](_0x24abe6[_0x3571('0x12')](','))))[_0x3571('0x4b')]();}function handleStop(){logger[_0x3571('0x5c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x48c99d){logger['error'](_0x48c99d[_0x3571('0x20')]);process[_0x3571('0x5d')](0x1);}function handleError(_0x384578,_0x2ea421){stats[_0x3571('0x5e')][_0x3571('0x1c')]({'name':_0x2ea421[_0x3571('0x5f')],'message':_0x2ea421[_0x3571('0x20')],'row':_0x384578});}function handleQuery(_0x536c3b){logger[_0x3571('0x5c')](_0x536c3b);return db['sequelize']['query'](_0x536c3b)[_0x3571('0x1a')](function(_0x56fd2d){results['push'](_0x56fd2d);})[_0x3571('0x1f')](function(_0x55f6e6){logger[_0x3571('0x60')](_0x55f6e6[_0x3571('0x20')]);});}function main(_0x457ebb,_0x2a9092,_0x59e3fc,_0x212be3){logger['info'](_0x3571('0x61'),_0x457ebb,JSON[_0x3571('0x62')](_0x2a9092));process[_0x3571('0x63')](_0x3571('0x64'));var _0x466e22=_0x2a9092[_0x3571('0x65')];var _0x42b5aa=_[_0x3571('0x66')](_0x466e22);var _0x36ffa0=_0x2a9092[_0x3571('0x67')];var _0x4b053d=path[_0x3571('0x12')](config[_0x3571('0x68')],_0x3571('0x69'),_0x36ffa0+_0x3571('0x6a'));logger[_0x3571('0x5c')](_0x3571('0x6b'),_0x2a9092);db['ContactItemType'][_0x3571('0x6c')]({'raw':!![],'attributes':['id','name']})[_0x3571('0x1e')](function(_0xa67043){for(var _0x1cbf13=0x0;_0x1cbf13<_0xa67043[_0x3571('0x22')];_0x1cbf13++){if(_0xa67043[_0x1cbf13][_0x3571('0x6d')]in _0x466e22){contactItemTypes['push'](_0xa67043[_0x1cbf13]);delete _0x42b5aa[_0xa67043[_0x1cbf13][_0x3571('0x6d')]];hasAdditionalPhones=!![];}for(var _0x149444 in _0x466e22){if(_0xa67043[_0x1cbf13][_0x3571('0x6d')]+'_description'===_0x149444){phoneDescriptions[_0x3571('0x1c')]({'itemTypeId':_0xa67043[_0x1cbf13]['id'],'description':_0x149444});delete _0x42b5aa[_0x149444];}}}if(hasAdditionalPhones)_0x42b5aa[_0x3571('0x6e')]='';var _0x441a7a=_[_0x3571('0x55')](_0x42b5aa)['join']();logger[_0x3571('0x5c')](_0x3571('0x6f'),_0x441a7a);fs[_0x3571('0x70')](_0x4b053d,_0x441a7a+'\x0a');Papa[_0x3571('0x71')](fs[_0x3571('0x72')](_0x457ebb),{'header':!![],'skipEmptyLines':!![],'step':function(_0x271e84,_0x74bff2){try{for(var _0x2af26a=0x0,_0x29e98b=[];_0x2af26a<_0x271e84[_0x3571('0x73')][_0x3571('0x22')];_0x2af26a++){stats[_0x3571('0x74')]+=0x1;if(_0x271e84[_0x3571('0x5e')][_0x2af26a]){handleError(_0x271e84[_0x3571('0x73')][_0x2af26a],_0x271e84[_0x3571('0x5e')][_0x2af26a]);}else{var _0x4dc4c9=[];var _0x3aa3f3=[];var _0x5cebbd={};for(var _0x1b6021 in _0x466e22){let _0x3942dc=contactItemTypes[_0x3571('0x75')](_0x1da77f=>_0x1da77f[_0x3571('0x6d')]===_0x1b6021);let _0x34e5a4=contactItemTypes[_0x3571('0x75')](_0x567abb=>_0x567abb['name']+'_description'===_0x1b6021);if(_['isNil'](_0x3942dc)&&_[_0x3571('0x1b')](_0x34e5a4)){if(_0x466e22['hasOwnProperty'](_0x1b6021)){if(_0x271e84['data'][_0x2af26a][_0x466e22[_0x1b6021]]){var _0x58e8c9=_[_0x3571('0x76')](_0x271e84[_0x3571('0x73')][_0x2af26a][_0x466e22[_0x1b6021]][_0x3571('0x77')](/"/g,'\x27'));switch(_0x1b6021){case'scheduledat':var _0x186ab1=moment(_0x58e8c9,_0x3571('0xd'),!![]);if(_0x186ab1['isValid']()){_0x29e98b['push']('\x22'+_0x58e8c9+'\x22');}else{_0x4dc4c9[_0x3571('0x1c')](_0x3571('0x78'));}break;case _0x3571('0x79'):var _0xb31aa7=parseInt(_0x58e8c9);_0x58e8c9=_[_0x3571('0x7a')](_0xb31aa7)||_0xb31aa7<0x0||_0xb31aa7>0x4?_0x212be3?0x3:0x2:_0xb31aa7;_0x29e98b[_0x3571('0x1c')]('\x22'+_0x58e8c9+'\x22');break;case'UserId':var _0x5fb5ff=parseInt(_0x58e8c9);if(_[_0x3571('0x7b')](_0x5fb5ff)&&_['includes'](_0x59e3fc,_0x5fb5ff)){_0x29e98b['push']('\x22'+_0x5fb5ff+'\x22');}else{_0x4dc4c9['push'](_0x3571('0x7c'));}break;case _0x3571('0x7d'):if(isEmail(_0x58e8c9)){_0x29e98b[_0x3571('0x1c')]('\x22'+_0x58e8c9+'\x22');}else{_0x4dc4c9[_0x3571('0x1c')]('email\x20wrong\x20format');}break;case _0x3571('0x7e'):var _0x4cb48b=moment(_0x58e8c9,'YYYY-MM-DD',!![]);if(_0x4cb48b[_0x3571('0x7f')]()){_0x29e98b['push']('\x22'+_0x58e8c9+'\x22');}else{_0x4dc4c9[_0x3571('0x1c')](_0x3571('0x80'));}break;default:_0x29e98b[_0x3571('0x1c')]('\x22'+_0x58e8c9+'\x22');}}else{switch(_0x1b6021){case _0x3571('0x81'):case _0x3571('0x10'):_0x4dc4c9[_0x3571('0x1c')](_0x1b6021+_0x3571('0x82'));break;default:_0x29e98b[_0x3571('0x1c')]('\x22\x22');}}}}else{var _0x461f11='';if(!_['isNil'](_0x3942dc)){if(!_0x5cebbd['hasOwnProperty'](_0x3942dc['id'])){for(var _0x42ae3b=0x0;_0x42ae3b<_0x466e22[_0x1b6021][_0x3571('0x22')];_0x42ae3b++){var _0x58e8c9=_[_0x3571('0x76')](_0x271e84[_0x3571('0x73')][_0x2af26a][_0x466e22[_0x1b6021][_0x42ae3b]]['replace'](/"/g,'\x27'));var _0x17e40a=phoneDescriptions['find'](_0x5937c6=>_0x5937c6['itemTypeId']===_0x3942dc['id']);if(!_['isNil'](_0x17e40a)){var _0x1a8348=_[_0x3571('0x76')](_0x271e84[_0x3571('0x73')][_0x2af26a][_0x466e22[_0x17e40a[_0x3571('0x83')]][0x0]][_0x3571('0x77')](/"/g,'\x27'));if(!_[_0x3571('0x1b')](_0x1a8348))_0x58e8c9=_0x58e8c9+'§'+_0x1a8348;}if(_0x461f11=='')_0x461f11=_0x58e8c9;else _0x461f11+='|'+_0x58e8c9;}_0x3aa3f3[_0x3571('0x1c')](_0x3942dc['id']+':'+_0x461f11);_0x5cebbd[_0x3942dc['id']]=0x1;}}}}if(hasAdditionalPhones){_0x29e98b[_0x3571('0x1c')]('\x22'+_0x3aa3f3['join'](';')+'\x22');}if(_0x4dc4c9[_0x3571('0x22')]){handleError(_0x271e84[_0x3571('0x73')][_0x2af26a],{'code':_0x3571('0x84'),'message':_0x4dc4c9[_0x3571('0x12')]()});}else{fs['appendFileSync'](_0x4b053d,_0x29e98b[_0x3571('0x12')]()+'\x0a');}_0x29e98b=[];}if(!(stats[_0x3571('0x74')]%0xc8)){socket[_0x3571('0x85')](_0x3571('0x86')+_0x36ffa0,stats);stats['errors']=[];}}if(stopped){logger[_0x3571('0x5c')](_0x3571('0x87'));_0x74bff2[_0x3571('0x88')]();}}catch(_0x182305){handleError(_0x271e84[_0x3571('0x73')][_0x2af26a],{'code':'SystemError','message':_0x182305[_0x3571('0x20')]});logger['error'](_0x3571('0x89'),_0x182305[_0x3571('0x20')]);}},'complete':function(){try{var _0x1be481=[];var _0x24747d=tempTableName;_0x1be481['push'](_0x3571('0x8a')+_0x24747d+_0x3571('0x8b'));logger[_0x3571('0x5c')]('CIS\x20len',contactItemTypes[_0x3571('0x22')]);var _0x59a2be=util[_0x3571('0xc')]('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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x4b053d,_0x24747d,_0x441a7a,_0x2a9092[_0x3571('0x39')],_0x2a9092[_0x3571('0x56')]||null,NOW,NOW);if(_['isNil'](_0x466e22['scheduledat'])){_0x59a2be+=',\x20scheduledAt\x20=\x20NOW()';}_0x1be481[_0x3571('0x1c')](_0x59a2be);BPromise[_0x3571('0x8c')](_0x1be481,handleQuery)['then'](function(_0x149c6f){BPromise[_0x3571('0x1d')]([handleAdditionalPhones()])[_0x3571('0x1e')](function(){_0x1be481=[];for(var _0xf5aa8e=0x0;_0xf5aa8e<promisesContact['length'];_0xf5aa8e++){_0x1be481[_0x3571('0x1c')](updateContact(promisesContact[_0xf5aa8e]['contact']));}BPromise[_0x3571('0x1d')](_0x1be481)[_0x3571('0x1e')](function(){_0x1be481=[];for(var _0x324aec=0x0;_0x324aec<promisesAdditionalPhones[_0x3571('0x22')];_0x324aec++){_0x1be481[_0x3571('0x1c')](createAdditionalPhone(promisesAdditionalPhones[_0x324aec][_0x3571('0x8d')],promisesAdditionalPhones[_0x324aec][_0x3571('0x8e')],promisesAdditionalPhones[_0x324aec][_0x3571('0x10')],promisesAdditionalPhones[_0x324aec][_0x3571('0x8f')]));}BPromise[_0x3571('0x1d')](_0x1be481)[_0x3571('0x1e')](function(){_0x1be481=[];_0x1be481[_0x3571('0x1c')](insertCmHopperAdditionalPhones(_0x2a9092[_0x3571('0x39')]));_0x1be481[_0x3571('0x1c')](_0x3571('0x90')+_0x24747d+';');BPromise[_0x3571('0x8c')](_0x1be481,handleQuery)[_0x3571('0x1e')](function(_0x12f75c){stats[_0x3571('0x91')]=!![];stats[_0x3571('0x92')]=updatedRows;socket[_0x3571('0x85')](_0x3571('0x86')+_0x36ffa0,stats);fs[_0x3571('0x93')](_0x457ebb);fs[_0x3571('0x93')](_0x4b053d);process[_0x3571('0x5d')](0x0);})[_0x3571('0x1f')](function(_0x5b181a){logger[_0x3571('0x60')](_0x5b181a['message']);process[_0x3571('0x5d')](0x1);});});});});})[_0x3571('0x1f')](function(_0x1c57ae){logger[_0x3571('0x60')](_0x1c57ae[_0x3571('0x20')]);process[_0x3571('0x5d')](0x1);});}catch(_0x344850){logger[_0x3571('0x60')]('complete',_0x344850['message']);process[_0x3571('0x5d')](0x1);}},'error':function(_0x33833d,_0x4bdd77,_0x17c0b2,_0x29d5c4){throw new Error(_0x29d5c4);}});});}function validate(){if(process[_0x3571('0x94')]&&process[_0x3571('0x94')][_0x3571('0x22')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x4d61e5=path[_0x3571('0x12')](config[_0x3571('0x68')],_0x3571('0x69'),process[_0x3571('0x94')][0x2]);if(!fs[_0x3571('0x95')](_0x4d61e5)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x15d6f1={};try{_0x15d6f1=JSON['parse'](process[_0x3571('0x94')][0x3]);if(!_0x15d6f1[_0x3571('0x65')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x32efe7=0x0;if(_0x15d6f1[_0x3571('0x65')]['UserId']){_0x32efe7=0x1;}if(!_0x15d6f1[_0x3571('0x39')]){throw new Error(_0x3571('0x96'));}}catch(_0x380e26){throw new Error('body\x20id\x20mandatory');}var _0x288a38=[];try{_0x288a38=_['map'](JSON[_0x3571('0x71')](process[_0x3571('0x94')][0x4]),'id');}catch(_0x5d2983){logger['info'](_0x3571('0x97'));}main(_0x4d61e5,_0x15d6f1,_0x288a38,_0x32efe7);}validate();process['on']('SIGINT',handleStop);process['on'](_0x3571('0x98'),handleUncaughtException);
\ No newline at end of file
+var _0xf99c=['.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','all','catch','error','push','then','split','CmContactHasItem','update','updated','create','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','createdAt','.CmListId','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','field','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','code','main','stringify','send','start','binding','clone','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','header','writeFileSync','parse','createReadStream','rows','data','find','hasOwnProperty','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','trim','replace','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','\x20LIKE\x20cm_contacts;','CIS\x20len','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactTypeId','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0xf99c,0x129));var _0xcf99=function(_0x34dce9,_0xa6c831){_0x34dce9=_0x34dce9-0x0;var _0x21a091=_0xf99c[_0x34dce9];return _0x21a091;};'use strict';var fs=require('fs');var path=require(_0xcf99('0x0'));var _=require(_0xcf99('0x1'));var Papa=require(_0xcf99('0x2'));var util=require(_0xcf99('0x3'));var BPromise=require(_0xcf99('0x4'));var moment=require(_0xcf99('0x5'));var squel=require(_0xcf99('0x6'));var Redis=require(_0xcf99('0x7'));var db=require(_0xcf99('0x8'))['db'];var config=require(_0xcf99('0x9'));var logger=require(_0xcf99('0xa'))('import');config[_0xcf99('0xb')]=_[_0xcf99('0xc')](config[_0xcf99('0xb')],{'host':_0xcf99('0xd'),'port':0x18eb});var socket=require(_0xcf99('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xcf99('0xf'));var tempTableName=_0xcf99('0x10')+moment()['format'](_0xcf99('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x291ed8){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))*$/[_0xcf99('0x12')](_0x291ed8);}function selectNotIn(_0x4378ca,_0x44482c,_0x294b6d,_0x4a79da,_0x107941){return squel[_0xcf99('0x13')]()['field'](_0xcf99('0x14'))[_0xcf99('0x15')](_0x4a79da)[_0xcf99('0x16')](_0x44482c,null,_0x44482c+_0xcf99('0x17')+_0x4a79da+'.'+_0x294b6d)[_0xcf99('0x18')](_0x4a79da+'.'+_0x294b6d+_0xcf99('0x19')+_0x4378ca+'.'+_0x294b6d)[_0xcf99('0x18')](_0x44482c+'.dialCheckDuplicateType\x20IN\x20('+_0x107941['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x30028e,_0x1d8d00){promisesAdditionalPhones=[];promisesContact=[];return db[_0xcf99('0x1a')][_0xcf99('0x1b')](_0xcf99('0x1c')+tempTableName)[_0xcf99('0x1d')](function(_0x1c88bd){if(_0x1c88bd!==null){var _0x180f8f=[];for(var _0x297ed2=0x0;_0x297ed2<_0x1c88bd[_0xcf99('0x1e')];_0x297ed2++){var _0x12e6c5=_0x1c88bd[_0x297ed2];if(!_[_0xcf99('0x1f')](_0x12e6c5[_0xcf99('0x14')])){if(!_[_0xcf99('0x1f')](_0x12e6c5[_0xcf99('0x20')]))_0x180f8f['push'](insertAdditionalPhones(_0x12e6c5));promisesContact['push']({'contact':_0x12e6c5});}}}Promise[_0xcf99('0x21')](_0x180f8f)['then'](function(){_0x30028e({'val':0x1});});})[_0xcf99('0x22')](function(_0x2946e2){logger[_0xcf99('0x23')](_0x2946e2['message']);});});}function insertAdditionalPhones(_0x546e4f){return new Promise(function(_0x204978,_0x542bd6){var _0x19fdb1=_0x546e4f['AdditionalPhones'];if(_[_0xcf99('0x1f')](_0x19fdb1))_0x542bd6({'val':0x0});else{var _0x135965=_0x19fdb1['split'](';');var _0x2b2df5=[];orderBy=0x0;for(var _0x4d0535=0x0;_0x4d0535<_0x135965[_0xcf99('0x1e')];_0x4d0535++){_0x2b2df5[_0xcf99('0x24')](splitAdditionalPhone(_0x546e4f['id'],_0x135965[_0x4d0535]));}Promise[_0xcf99('0x21')](_0x2b2df5)[_0xcf99('0x25')](function(){_0x204978({'val':_0x135965[_0xcf99('0x1e')]});});}});}function splitAdditionalPhone(_0x551903,_0x2d3335){return new Promise(function(_0x48d0f6,_0x1fdf28){var _0x4ac08b=_0x2d3335['split'](':');var _0x1a9c7c=_0x4ac08b[0x0];var _0x4bd074=_0x4ac08b[0x1];if(_0x4bd074!==''){var _0x5ad7c4=_0x4bd074[_0xcf99('0x26')]('|');var _0x521d5d=[];for(var _0x1363cf=0x0;_0x1363cf<_0x5ad7c4[_0xcf99('0x1e')];_0x1363cf++){if(_0x5ad7c4[_0x1363cf]!==''){var _0x3404b7=_['filter'](promisesAdditionalPhones,{'contactId':_0x551903,'phone':_0x5ad7c4[_0x1363cf]});if(_0x3404b7[_0xcf99('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0xcf99('0x24')]({'contactId':_0x551903,'contactTypeId':_0x1a9c7c,'phone':_0x5ad7c4[_0x1363cf],'orderBy':orderBy});}}}_0x48d0f6({'ok':0x1});}else _0x48d0f6({'res':0x0});});}function createAdditionalPhone(_0x55e0f2,_0x18f199,_0x59a686,_0x1f08fe){var _0x89a346='';var _0x20d1b9='';var _0x2ed0f1=_0x59a686[_0xcf99('0x26')]('§');_0x89a346=_0x2ed0f1[0x0];if(_0x2ed0f1[_0xcf99('0x1e')]==0x2)_0x20d1b9=_0x2ed0f1[0x1];return new Promise(function(_0x5156d5,_0x26bad9){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x55e0f2,'item':_0x89a346}})[_0xcf99('0x25')](function(_0x37f19b){if(_0x37f19b){return db[_0xcf99('0x27')][_0xcf99('0x28')]({'ItemTypeId':_0x18f199,'description':_0x20d1b9,'OrderBy':_0x1f08fe},{'where':{'CmContactId':_0x55e0f2,'item':_0x89a346}})[_0xcf99('0x25')](function(_0x51220b){_0x5156d5({'res':_0xcf99('0x29')});});}else{return db['CmContactHasItem'][_0xcf99('0x2a')]({'CmContactId':_0x55e0f2,'item':_0x89a346,'ItemTypeId':_0x18f199,'description':_0x20d1b9,'OrderBy':_0x1f08fe,'ItemClass':_0xcf99('0x2b')})[_0xcf99('0x25')](function(_0x42d200){_0x5156d5({'res':_0xcf99('0x2c')});});}});});}function updateContact(_0x403ebe){return new Promise(function(_0x2ce172,_0x50d7e9){var _0x131742=_0x403ebe['id'];delete _0x403ebe['id'];return db['CmContact']['update'](_0x403ebe,{'where':{'id':_0x131742}})['then'](function(_0x23bc19){updatedRows+=0x1;return db[_0xcf99('0x2d')][_0xcf99('0x28')]({'phone':_0x403ebe[_0xcf99('0x14')]},{'where':{'ContactId':_0x131742}})['then'](function(_0x3f47c8){_0x2ce172({'ret':'OK'});});});});}function insertCmHopper(_0x1d3e66,_0x462f43,_0x5efdaa,_0x9fa98c,_0x2de35b){var _0x2683ea=[_0xcf99('0x2e'),'cm_contacts.scheduledat',_0xcf99('0x2f'),_0xcf99('0x30'),_0x462f43+'.'+_0x9fa98c,_0xcf99('0x31'),_0xcf99('0x32'),_0xcf99('0x33'),'cm_contacts.UserId','\x22'+_0x2de35b+'\x22'];return squel[_0xcf99('0x34')]()[_0xcf99('0x35')](_0xcf99('0x36'))[_0xcf99('0x37')]([_0xcf99('0x14'),_0xcf99('0x38'),_0xcf99('0x39'),_0xcf99('0x3a'),_0x9fa98c,'createdAt',_0xcf99('0x3b'),_0xcf99('0x3c'),_0xcf99('0x3d'),_0xcf99('0x3e')],squel[_0xcf99('0x13')]()[_0xcf99('0x3f')](_0x2683ea)[_0xcf99('0x15')](_0x462f43)[_0xcf99('0x16')](_0xcf99('0x40'),null,'cm_contacts.ListId\x20=\x20'+_0x462f43+'.CmListId')['join'](_0x5efdaa,null,_0x5efdaa+_0xcf99('0x17')+_0x462f43+'.'+_0x9fa98c)[_0xcf99('0x18')](_0x462f43+_0xcf99('0x41'),_0x1d3e66)['where'](_0xcf99('0x42'),NOW)['where'](_0xcf99('0x43'),selectNotIn(_0x462f43,_0x5efdaa,_0x9fa98c,'cm_hopper',[_0xcf99('0x44'),_0xcf99('0x45')]))[_0xcf99('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x462f43,_0x5efdaa,_0x9fa98c,_0xcf99('0x36'),[_0xcf99('0x44')])))[_0xcf99('0x46')]();}function insertCmHopperBlack(_0x4feaad,_0x329234,_0x597b9c,_0x3de957){var _0x58b890=[_0xcf99('0x2e'),_0xcf99('0x2f'),'cm_contacts.ListId',_0x329234+'.'+_0x3de957,'cm_contacts.createdAt',_0xcf99('0x32')];return squel[_0xcf99('0x34')]()['into'](_0xcf99('0x47'))[_0xcf99('0x37')]([_0xcf99('0x14'),'ContactId','ListId',_0x3de957,_0xcf99('0x48'),_0xcf99('0x3b')],squel['select']()[_0xcf99('0x3f')](_0x58b890)['from'](_0x329234)[_0xcf99('0x16')](_0xcf99('0x40'),null,'cm_contacts.ListId\x20=\x20'+_0x329234+_0xcf99('0x49'))[_0xcf99('0x16')](_0x597b9c,null,_0x597b9c+_0xcf99('0x17')+_0x329234+'.'+_0x3de957)[_0xcf99('0x18')](_0x329234+'.CmListId\x20=\x20?',_0x4feaad)[_0xcf99('0x18')](_0xcf99('0x42'),NOW)[_0xcf99('0x18')](_0xcf99('0x43'),squel[_0xcf99('0x13')]()['field'](_0xcf99('0x14'))['from'](_0xcf99('0x47'))[_0xcf99('0x18')](_0xcf99('0x4a'),_0x4feaad)['where'](_0x3de957+_0xcf99('0x4b'),_0x329234+'.'+_0x3de957)))[_0xcf99('0x46')]();}function insertCmHopperAdditionalPhones(_0xd2d489){var _0x5e78bd=['cm_hopper.id',_0xcf99('0x4c'),'cm_contact_has_items.OrderBy',_0xcf99('0x4d'),_0xcf99('0x4e')];return squel[_0xcf99('0x34')]()[_0xcf99('0x35')](_0xcf99('0x4f'))['fromQuery']([_0xcf99('0x50'),_0xcf99('0x14'),_0xcf99('0x51'),_0xcf99('0x48'),'updatedAt'],squel[_0xcf99('0x13')]()[_0xcf99('0x3f')](_0x5e78bd)['from'](_0xcf99('0x36'))[_0xcf99('0x16')](_0xcf99('0x40'),null,_0xcf99('0x52'))['join'](_0xcf99('0x53'),null,_0xcf99('0x54'))['where'](_0xcf99('0x55'),_0xd2d489)[_0xcf99('0x18')](_0xcf99('0x42'),NOW))[_0xcf99('0x46')]();}function insertCmContact(_0x39d891,_0x2294c6,_0x27ddd3,_0x40585e){var _0x2e38fa=_[_0xcf99('0x56')](_[_0xcf99('0x57')](_0x40585e),[_0xcf99('0x3a'),_0xcf99('0x58'),_0xcf99('0x48'),_0xcf99('0x3b')]);return squel[_0xcf99('0x34')]()[_0xcf99('0x35')](_0xcf99('0x40'))[_0xcf99('0x37')](_0x2e38fa,squel[_0xcf99('0x13')]()['fields'](_0x2e38fa)[_0xcf99('0x15')](_0x2294c6)[_0xcf99('0x18')]('('+_0x27ddd3['join'](',')+')\x20NOT\x20IN\x20?',squel['select']()['fields'](_0x27ddd3)[_0xcf99('0x15')]('cm_contacts')[_0xcf99('0x18')](_0xcf99('0x4a'),_0x39d891))[_0xcf99('0x18')]('id\x20IN\x20?',squel[_0xcf99('0x13')]()[_0xcf99('0x59')](_0xcf99('0x5a'),_0xcf99('0x5b'))[_0xcf99('0x15')](_0x2294c6)[_0xcf99('0x5c')](_0x27ddd3[_0xcf99('0x16')](','))))[_0xcf99('0x46')]();}function handleStop(){logger[_0xcf99('0x5d')](_0xcf99('0x5e'));stopped=!![];}function handleUncaughtException(_0x32ca09){logger[_0xcf99('0x23')](_0x32ca09[_0xcf99('0x5f')]);process[_0xcf99('0x60')](0x1);}function handleError(_0x3f8316,_0x25ed1c){stats[_0xcf99('0x61')][_0xcf99('0x24')]({'name':_0x25ed1c[_0xcf99('0x62')],'message':_0x25ed1c[_0xcf99('0x5f')],'row':_0x3f8316});}function handleQuery(_0xf47122){logger[_0xcf99('0x5d')](_0xf47122);return db[_0xcf99('0x1a')][_0xcf99('0x1b')](_0xf47122)[_0xcf99('0x1d')](function(_0x5c4441){results['push'](_0x5c4441);})[_0xcf99('0x22')](function(_0x17910e){logger['error'](_0x17910e[_0xcf99('0x5f')]);});}function main(_0x43d94f,_0x169b6b,_0x3e0eff,_0x36f351){logger['info'](_0xcf99('0x63'),_0x43d94f,JSON[_0xcf99('0x64')](_0x169b6b));process[_0xcf99('0x65')](_0xcf99('0x66'));var _0x30e055=_0x169b6b[_0xcf99('0x67')];var _0x2d71d5=_[_0xcf99('0x68')](_0x30e055);var _0x3de937=_0x169b6b['socket_timestamp'];var _0x50b61a=path[_0xcf99('0x16')](config[_0xcf99('0x69')],_0xcf99('0x6a'),_0x3de937+_0xcf99('0x6b'));logger[_0xcf99('0x5d')](_0xcf99('0x6c'),_0x169b6b);db[_0xcf99('0x6d')][_0xcf99('0x6e')]({'raw':!![],'attributes':['id',_0xcf99('0x6f')]})[_0xcf99('0x25')](function(_0x376cf7){for(var _0x54c24f=0x0;_0x54c24f<_0x376cf7['length'];_0x54c24f++){if(_0x376cf7[_0x54c24f][_0xcf99('0x6f')]in _0x30e055){contactItemTypes[_0xcf99('0x24')](_0x376cf7[_0x54c24f]);delete _0x2d71d5[_0x376cf7[_0x54c24f][_0xcf99('0x6f')]];hasAdditionalPhones=!![];}for(var _0x108378 in _0x30e055){if(_0x376cf7[_0x54c24f][_0xcf99('0x6f')]+_0xcf99('0x70')===_0x108378){phoneDescriptions[_0xcf99('0x24')]({'itemTypeId':_0x376cf7[_0x54c24f]['id'],'description':_0x108378});delete _0x2d71d5[_0x108378];}}}if(hasAdditionalPhones)_0x2d71d5[_0xcf99('0x20')]='';var _0x253204=_['keys'](_0x2d71d5)['join']();logger[_0xcf99('0x5d')](_0xcf99('0x71'),_0x253204);fs[_0xcf99('0x72')](_0x50b61a,_0x253204+'\x0a');Papa[_0xcf99('0x73')](fs[_0xcf99('0x74')](_0x43d94f),{'header':!![],'skipEmptyLines':!![],'step':function(_0xbee6dd,_0x1be35d){try{for(var _0x15a911=0x0,_0x59fdbd=[];_0x15a911<_0xbee6dd['data']['length'];_0x15a911++){stats[_0xcf99('0x75')]+=0x1;if(_0xbee6dd[_0xcf99('0x61')][_0x15a911]){handleError(_0xbee6dd[_0xcf99('0x76')][_0x15a911],_0xbee6dd[_0xcf99('0x61')][_0x15a911]);}else{var _0x153528=[];var _0x248c5b=[];var _0x397d3c={};for(var _0x27e178 in _0x30e055){let _0x26bc4a=contactItemTypes[_0xcf99('0x77')](_0x3373ce=>_0x3373ce[_0xcf99('0x6f')]===_0x27e178);let _0x3e1fb9=contactItemTypes[_0xcf99('0x77')](_0x45da8e=>_0x45da8e[_0xcf99('0x6f')]+_0xcf99('0x70')===_0x27e178);if(_['isNil'](_0x26bc4a)&&_['isNil'](_0x3e1fb9)){if(_0x30e055[_0xcf99('0x78')](_0x27e178)){if(_0xbee6dd[_0xcf99('0x76')][_0x15a911][_0x30e055[_0x27e178]]){var _0x57c567=_['trim'](_0xbee6dd[_0xcf99('0x76')][_0x15a911][_0x30e055[_0x27e178]]['replace'](/"/g,'\x27'));switch(_0x27e178){case _0xcf99('0x38'):var _0x41cf70=moment(_0x57c567,_0xcf99('0xf'),!![]);if(_0x41cf70['isValid']()){_0x59fdbd['push']('\x22'+_0x57c567+'\x22');}else{_0x153528[_0xcf99('0x24')](_0xcf99('0x79'));}break;case _0xcf99('0x3c'):var _0x49231e=parseInt(_0x57c567);_0x57c567=_[_0xcf99('0x7a')](_0x49231e)||_0x49231e<0x0||_0x49231e>0x4?_0x36f351?0x3:0x2:_0x49231e;_0x59fdbd[_0xcf99('0x24')]('\x22'+_0x57c567+'\x22');break;case _0xcf99('0x3d'):var _0x51afaf=parseInt(_0x57c567);if(_['isNumber'](_0x51afaf)&&_['includes'](_0x3e0eff,_0x51afaf)){_0x59fdbd[_0xcf99('0x24')]('\x22'+_0x51afaf+'\x22');}else{_0x153528[_0xcf99('0x24')](_0xcf99('0x7b'));}break;case _0xcf99('0x7c'):if(isEmail(_0x57c567)){_0x59fdbd['push']('\x22'+_0x57c567+'\x22');}else{_0x153528[_0xcf99('0x24')](_0xcf99('0x7d'));}break;case'dateOfBirth':var _0x575e2a=moment(_0x57c567,_0xcf99('0x7e'),!![]);if(_0x575e2a['isValid']()){_0x59fdbd[_0xcf99('0x24')]('\x22'+_0x57c567+'\x22');}else{_0x153528[_0xcf99('0x24')](_0xcf99('0x7f'));}break;default:_0x59fdbd[_0xcf99('0x24')]('\x22'+_0x57c567+'\x22');}}else{switch(_0x27e178){case _0xcf99('0x80'):case'phone':_0x153528[_0xcf99('0x24')](_0x27e178+_0xcf99('0x81'));break;default:_0x59fdbd['push']('\x22\x22');}}}}else{var _0x5c7ce9='';if(!_[_0xcf99('0x1f')](_0x26bc4a)){if(!_0x397d3c['hasOwnProperty'](_0x26bc4a['id'])){for(var _0x2024b=0x0;_0x2024b<_0x30e055[_0x27e178][_0xcf99('0x1e')];_0x2024b++){var _0x57c567=_[_0xcf99('0x82')](_0xbee6dd[_0xcf99('0x76')][_0x15a911][_0x30e055[_0x27e178][_0x2024b]]['replace'](/"/g,'\x27'));var _0x25c769=phoneDescriptions[_0xcf99('0x77')](_0xd628be=>_0xd628be['itemTypeId']===_0x26bc4a['id']);if(!_['isNil'](_0x25c769)){var _0x204575=_[_0xcf99('0x82')](_0xbee6dd[_0xcf99('0x76')][_0x15a911][_0x30e055[_0x25c769['description']][0x0]][_0xcf99('0x83')](/"/g,'\x27'));if(!_['isNil'](_0x204575))_0x57c567=_0x57c567+'§'+_0x204575;}if(_0x5c7ce9=='')_0x5c7ce9=_0x57c567;else _0x5c7ce9+='|'+_0x57c567;}_0x248c5b['push'](_0x26bc4a['id']+':'+_0x5c7ce9);_0x397d3c[_0x26bc4a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x59fdbd['push']('\x22'+_0x248c5b[_0xcf99('0x16')](';')+'\x22');}if(_0x153528[_0xcf99('0x1e')]){handleError(_0xbee6dd[_0xcf99('0x76')][_0x15a911],{'code':_0xcf99('0x84'),'message':_0x153528[_0xcf99('0x16')]()});}else{fs[_0xcf99('0x85')](_0x50b61a,_0x59fdbd[_0xcf99('0x16')]()+'\x0a');}_0x59fdbd=[];}if(!(stats[_0xcf99('0x75')]%0xc8)){socket[_0xcf99('0x86')](_0xcf99('0x87')+_0x3de937,stats);stats[_0xcf99('0x61')]=[];}}if(stopped){logger[_0xcf99('0x5d')](_0xcf99('0x88'));_0x1be35d[_0xcf99('0x89')]();}}catch(_0x1ffa77){handleError(_0xbee6dd[_0xcf99('0x76')][_0x15a911],{'code':_0xcf99('0x8a'),'message':_0x1ffa77[_0xcf99('0x5f')]});logger[_0xcf99('0x23')]('step',_0x1ffa77[_0xcf99('0x5f')]);}},'complete':function(){try{var _0x138f6b=[];var _0x20b835=tempTableName;_0x138f6b[_0xcf99('0x24')]('CREATE\x20TABLE\x20'+_0x20b835+_0xcf99('0x8b'));logger[_0xcf99('0x5d')](_0xcf99('0x8c'),contactItemTypes[_0xcf99('0x1e')]);var _0x465f82=util[_0xcf99('0x8d')](_0xcf99('0x8e'),_0x50b61a,_0x20b835,_0x253204,_0x169b6b[_0xcf99('0x3a')],_0x169b6b[_0xcf99('0x58')]||null,NOW,NOW);if(_[_0xcf99('0x1f')](_0x30e055[_0xcf99('0x38')])){_0x465f82+=_0xcf99('0x8f');}_0x138f6b['push'](_0x465f82);BPromise[_0xcf99('0x90')](_0x138f6b,handleQuery)[_0xcf99('0x25')](function(_0x417c92){BPromise[_0xcf99('0x21')]([handleAdditionalPhones()])[_0xcf99('0x25')](function(){_0x138f6b=[];for(var _0x45487c=0x0;_0x45487c<promisesContact[_0xcf99('0x1e')];_0x45487c++){_0x138f6b[_0xcf99('0x24')](updateContact(promisesContact[_0x45487c][_0xcf99('0x91')]));}BPromise[_0xcf99('0x21')](_0x138f6b)[_0xcf99('0x25')](function(){_0x138f6b=[];for(var _0x145217=0x0;_0x145217<promisesAdditionalPhones[_0xcf99('0x1e')];_0x145217++){_0x138f6b[_0xcf99('0x24')](createAdditionalPhone(promisesAdditionalPhones[_0x145217]['contactId'],promisesAdditionalPhones[_0x145217][_0xcf99('0x92')],promisesAdditionalPhones[_0x145217][_0xcf99('0x14')],promisesAdditionalPhones[_0x145217]['orderBy']));}BPromise[_0xcf99('0x21')](_0x138f6b)[_0xcf99('0x25')](function(){_0x138f6b=[];_0x138f6b[_0xcf99('0x24')](insertCmHopperAdditionalPhones(_0x169b6b['ListId']));_0x138f6b['push']('DROP\x20TABLE\x20'+_0x20b835+';');BPromise['each'](_0x138f6b,handleQuery)['then'](function(_0x4c5114){stats['finish']=!![];stats[_0xcf99('0x93')]=updatedRows;socket[_0xcf99('0x86')](_0xcf99('0x87')+_0x3de937,stats);fs[_0xcf99('0x94')](_0x43d94f);fs[_0xcf99('0x94')](_0x50b61a);process['exit'](0x0);})[_0xcf99('0x22')](function(_0x16a62e){logger['error'](_0x16a62e[_0xcf99('0x5f')]);process[_0xcf99('0x60')](0x1);});});});});})[_0xcf99('0x22')](function(_0x1f5780){logger[_0xcf99('0x23')](_0x1f5780[_0xcf99('0x5f')]);process[_0xcf99('0x60')](0x1);});}catch(_0x33beae){logger['error'](_0xcf99('0x95'),_0x33beae[_0xcf99('0x5f')]);process['exit'](0x1);}},'error':function(_0x3736ed,_0x46b7a7,_0x56ee12,_0x3300d0){throw new Error(_0x3300d0);}});});}function validate(){if(process[_0xcf99('0x96')]&&process[_0xcf99('0x96')][_0xcf99('0x1e')]<0x4){throw new Error(_0xcf99('0x97'));}var _0x46a2f3=path[_0xcf99('0x16')](config[_0xcf99('0x69')],_0xcf99('0x6a'),process[_0xcf99('0x96')][0x2]);if(!fs[_0xcf99('0x98')](_0x46a2f3)){throw new Error(_0xcf99('0x99'));}var _0x2404e4={};try{_0x2404e4=JSON[_0xcf99('0x73')](process[_0xcf99('0x96')][0x3]);if(!_0x2404e4[_0xcf99('0x67')]){throw new Error(_0xcf99('0x9a'));}var _0x164689=0x0;if(_0x2404e4[_0xcf99('0x67')][_0xcf99('0x3d')]){_0x164689=0x1;}if(!_0x2404e4['ListId']){throw new Error(_0xcf99('0x9b'));}}catch(_0xd9c195){throw new Error(_0xcf99('0x9c'));}var _0x42b3f7=[];try{_0x42b3f7=_[_0xcf99('0x9d')](JSON[_0xcf99('0x73')](process[_0xcf99('0x96')][0x4]),'id');}catch(_0x47186f){logger[_0xcf99('0x5d')]('No\x20agent\x20available');}main(_0x46a2f3,_0x2404e4,_0x42b3f7,_0x164689);}validate();process['on'](_0xcf99('0x9e'),handleStop);process['on'](_0xcf99('0x9f'),handleUncaughtException);
\ No newline at end of file
index 529f358..61e648a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9394=['keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','talktime','Called\x20Number','Member\x20Name','membername','Complete\x20Time','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9394,0xdd));var _0x4939=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9394[_0x47aa64];return _0x549c7a;};'use strict';exports[_0x4939('0x0')]=function(_0x3f1085,_0x338aa2){var _0x506430=[{'type':_0x4939('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x3f1085[_0x4939('0x2')]()){case _0x4939('0x3'):switch(_0x338aa2[_0x4939('0x2')]()){case _0x4939('0x4'):_0x506430[_0x4939('0x5')]({'type':_0x4939('0x6'),'content':'','variableName':_0x4939('0x7')});_0x506430['push']({'type':_0x4939('0x6'),'content':'','variableName':_0x4939('0x8')});break;case _0x4939('0x9'):_0x506430['push']({'type':_0x4939('0x1'),'content':'Outbound\x20Call','variableName':null});_0x506430[_0x4939('0x5')]({'type':_0x4939('0x6'),'content':'','variableName':_0x4939('0xa')});break;}}return _0x506430;};exports[_0x4939('0xb')]=function(_0x116a79,_0x1f6385){var _0x466284=[];switch(_0x116a79[_0x4939('0x2')]()){case _0x4939('0x3'):switch(_0x1f6385[_0x4939('0x2')]()){case _0x4939('0x4'):_0x466284=[{'type':_0x4939('0x1'),'content':_0x4939('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x4939('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x4939('0x6'),'variableName':_0x4939('0x8')},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0xe'),'keyType':_0x4939('0x6'),'variableName':_0x4939('0xf')},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0x10'),'keyType':_0x4939('0x6'),'variableName':_0x4939('0x11')},{'type':_0x4939('0xd'),'content':'','key':'Queue','keyType':_0x4939('0x6'),'variableName':_0x4939('0x7')},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0x12'),'keyType':_0x4939('0x6'),'variableName':_0x4939('0x13')},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0x14'),'keyType':'variable','variableName':_0x4939('0x15')},{'type':_0x4939('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0x16'),'keyType':_0x4939('0x6'),'variableName':_0x4939('0x17')},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0x18'),'keyType':_0x4939('0x6'),'variableName':_0x4939('0xa')},{'type':_0x4939('0x1'),'content':_0x4939('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x4939('0x1a'),'keyType':_0x4939('0x6'),'variableName':_0x4939('0x15')},{'type':'keyValue','content':'','key':_0x4939('0x1b'),'keyType':_0x4939('0x6'),'variableName':_0x4939('0x1c')},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0x1d'),'keyType':'variable','variableName':_0x4939('0x1e')},{'type':_0x4939('0xd'),'content':'','key':'Hold\x20Time','keyType':_0x4939('0x6'),'variableName':_0x4939('0x1f')},{'type':_0x4939('0xd'),'content':'','key':'Talk\x20Time','keyType':_0x4939('0x6'),'variableName':_0x4939('0x20')}];break;case'outbound':_0x466284=[{'type':_0x4939('0x1'),'content':_0x4939('0xc'),'variableName':null},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0x21'),'keyType':_0x4939('0x6'),'keyContent':'','variableName':_0x4939('0xa')},{'type':'keyValue','content':'','key':_0x4939('0x22'),'keyType':_0x4939('0x6'),'keyContent':'','variableName':_0x4939('0x23')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x4939('0x6'),'keyContent':'','variableName':_0x4939('0x13')},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0x14'),'keyType':_0x4939('0x6'),'keyContent':'','variableName':'starttime'},{'type':'string','content':_0x4939('0x19')},{'type':_0x4939('0xd'),'content':'','key':'Answer\x20Time','keyType':_0x4939('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x4939('0x24'),'keyType':_0x4939('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0x4939('0xd'),'content':'','key':'Duration','keyType':_0x4939('0x6'),'keyContent':'','variableName':'duration'},{'type':_0x4939('0xd'),'content':'','key':_0x4939('0x25'),'keyType':_0x4939('0x6'),'keyContent':'','variableName':_0x4939('0x26')}];break;}}return _0x466284;};
\ No newline at end of file
+var _0x5144=['Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','Agent\x20Ring','agentconnectAt'];(function(_0x2ea5ad,_0x2d324b){var _0x2e7480=function(_0x436703){while(--_0x436703){_0x2ea5ad['push'](_0x2ea5ad['shift']());}};_0x2e7480(++_0x2d324b);}(_0x5144,0x78));var _0x4514=function(_0x1d839f,_0x43264b){_0x1d839f=_0x1d839f-0x0;var _0x1b3914=_0x5144[_0x1d839f];return _0x1b3914;};'use strict';exports[_0x4514('0x0')]=function(_0xcc4dd,_0x1d0423){var _0x2a52d5=[{'type':_0x4514('0x1'),'content':_0x4514('0x2'),'variableName':null}];switch(_0xcc4dd['toLowerCase']()){case _0x4514('0x3'):switch(_0x1d0423[_0x4514('0x4')]()){case _0x4514('0x5'):_0x2a52d5[_0x4514('0x6')]({'type':_0x4514('0x7'),'content':'','variableName':'queue'});_0x2a52d5[_0x4514('0x6')]({'type':_0x4514('0x7'),'content':'','variableName':_0x4514('0x8')});break;case _0x4514('0x9'):_0x2a52d5[_0x4514('0x6')]({'type':_0x4514('0x1'),'content':_0x4514('0xa'),'variableName':null});_0x2a52d5[_0x4514('0x6')]({'type':_0x4514('0x7'),'content':'','variableName':_0x4514('0xb')});break;}}return _0x2a52d5;};exports[_0x4514('0xc')]=function(_0x33730d,_0x56c96b){var _0x396443=[];switch(_0x33730d['toLowerCase']()){case _0x4514('0x3'):switch(_0x56c96b[_0x4514('0x4')]()){case'inbound':_0x396443=[{'type':'string','content':_0x4514('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0xf'),'keyType':_0x4514('0x7'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x4514('0x10'),'keyType':_0x4514('0x7'),'variableName':_0x4514('0x11')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x12'),'keyType':'variable','variableName':_0x4514('0x13')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x14'),'keyType':_0x4514('0x7'),'variableName':_0x4514('0x15')},{'type':_0x4514('0xe'),'content':'','key':'UniqueId','keyType':'variable','variableName':_0x4514('0x16')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x17'),'keyType':_0x4514('0x7'),'variableName':_0x4514('0x18')},{'type':_0x4514('0x1'),'content':_0x4514('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x4514('0xe'),'content':'','key':'Agent\x20Name','keyType':_0x4514('0x7'),'variableName':_0x4514('0x1a')},{'type':'keyValue','content':'','key':_0x4514('0x1b'),'keyType':_0x4514('0x7'),'variableName':_0x4514('0xb')},{'type':_0x4514('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x1c'),'keyType':_0x4514('0x7'),'variableName':_0x4514('0x18')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0x4514('0x7'),'variableName':_0x4514('0x1d')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x1e'),'keyType':_0x4514('0x7'),'variableName':_0x4514('0x1f')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x20'),'keyType':'variable','variableName':_0x4514('0x21')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x22'),'keyType':_0x4514('0x7'),'variableName':_0x4514('0x23')}];break;case _0x4514('0x9'):_0x396443=[{'type':'string','content':_0x4514('0xd'),'variableName':null},{'type':'keyValue','content':'','key':_0x4514('0x24'),'keyType':_0x4514('0x7'),'keyContent':'','variableName':_0x4514('0xb')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x25'),'keyType':_0x4514('0x7'),'keyContent':'','variableName':_0x4514('0x26')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x27'),'keyType':_0x4514('0x7'),'keyContent':'','variableName':_0x4514('0x16')},{'type':'keyValue','content':'','key':_0x4514('0x17'),'keyType':'variable','keyContent':'','variableName':_0x4514('0x28')},{'type':_0x4514('0x1'),'content':_0x4514('0x29')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x2a'),'keyType':_0x4514('0x7'),'keyContent':'','variableName':_0x4514('0x2b')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x2c'),'keyType':'variable','keyContent':'','variableName':_0x4514('0x2d')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x2e'),'keyType':_0x4514('0x7'),'keyContent':'','variableName':_0x4514('0x2f')},{'type':_0x4514('0xe'),'content':'','key':_0x4514('0x30'),'keyType':_0x4514('0x7'),'keyContent':'','variableName':_0x4514('0x31')}];break;}}return _0x396443;};
\ No newline at end of file
index aad0cca..f46d916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0514=['toUpperCase','name','role','stringify','findOne','then','update','info','error','tracked','user','query','clone','body','html','phone','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x4ea1d1,_0x349b7c){var _0x123be3=function(_0x426f83){while(--_0x426f83){_0x4ea1d1['push'](_0x4ea1d1['shift']());}};_0x123be3(++_0x349b7c);}(_0x0514,0x1c5));var _0x4051=function(_0x2e6ab4,_0x2bb998){_0x2e6ab4=_0x2e6ab4-0x0;var _0x3b8e4e=_0x0514[_0x2e6ab4];return _0x3b8e4e;};'use strict';var _=require('lodash');var db=require(_0x4051('0x0'))['db'];var loggers={'openchannel':require(_0x4051('0x1'))(_0x4051('0x2')),'mail':require(_0x4051('0x1'))(_0x4051('0x3')),'fax':require(_0x4051('0x1'))(_0x4051('0x4')),'sms':require('../../config/logger')(_0x4051('0x5')),'chat':require(_0x4051('0x1'))(_0x4051('0x6')),'whatsapp':require('../../config/logger')(_0x4051('0x7'))};function getInteractionId(_0x1892d6,_0x326855,_0x4dbfff){if(_0x1892d6&&_0x1892d6[_[_0x4051('0x8')](_0x4dbfff)+'InteractionId']){return _0x1892d6[_[_0x4051('0x8')](_0x4dbfff)+_0x4051('0x9')];}else if(_0x1892d6&&_0x1892d6['id']){return _0x1892d6['id'];}else if(_0x326855&&_0x326855['id']){return _0x326855['id'];}else{return'unknown';}}function log(_0x109bc6,_0x23cc91,_0x44bb0e,_0x500be3,_0x3441b7,_0x280ff5){loggers[_0x3441b7['toLowerCase']()][_0x109bc6](_0x4051('0xa'),_0x280ff5[_0x4051('0xb')](),_0x23cc91?_0x23cc91['id']:null,_0x23cc91?_0x23cc91[_0x4051('0xc')]:null,_0x23cc91?_0x23cc91[_0x4051('0xd')]:null,getInteractionId(_0x44bb0e,_0x500be3,_0x3441b7),_0x44bb0e?JSON[_0x4051('0xe')](_0x44bb0e):'null');}function updateUser(_0x32e0af,_0x356cc3,_0x3f837f,_0x5a5733,_0x5bd018){db[_[_0x4051('0x8')](_0x5a5733)+'Interaction'][_0x4051('0xf')]({'where':{'id':getInteractionId(_0x356cc3,_0x3f837f,_0x5a5733)}})[_0x4051('0x10')](function(_0x142b68){if(_0x142b68){return _0x142b68[_0x4051('0x11')]({'UserId':_0x32e0af?_0x32e0af['id']:null});}})[_0x4051('0x10')](function(_0x7e9184){if(_0x7e9184){log(_0x4051('0x12'),_0x32e0af,_0x356cc3,_0x3f837f,_0x5a5733,_0x5bd018);}})['catch'](function(){log(_0x4051('0x13'),_0x32e0af,_0x356cc3,_0x3f837f,_0x5a5733,_0x5bd018);});}exports[_0x4051('0x14')]=function(_0x415a96,_0x4fdcd6){return function(_0x459c03,_0x29c882,_0x156e1b){var _0x52c11c=_0x459c03[_0x4051('0x15')];var _0x4ccd39={};var _0x3ab805=_0x459c03[_0x4051('0x16')];if(_0x4ccd39){_0x4ccd39=_[_0x4051('0x17')](_0x459c03[_0x4051('0x18')]);_0x4ccd39=_['omit'](_0x4ccd39,[_0x4051('0x18'),_0x4051('0x19'),_0x4051('0x1a'),_0x4051('0x1b'),_0x4051('0x1c')]);}updateUser(_0x52c11c,_0x4ccd39,_0x3ab805,_0x415a96,_0x4fdcd6);_0x156e1b(null);};};
\ No newline at end of file
+var _0x3c33=['Interaction','findOne','then','update','info','catch','error','user','query','clone','body','html','phone','fax','mobile','lodash','../../mysqldb','openchannel-interactions','mail-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null'];(function(_0x3bea5b,_0x3b6d12){var _0x494692=function(_0x2c1372){while(--_0x2c1372){_0x3bea5b['push'](_0x3bea5b['shift']());}};_0x494692(++_0x3b6d12);}(_0x3c33,0x1e0));var _0x33c3=function(_0x27b596,_0x4ecc43){_0x27b596=_0x27b596-0x0;var _0x59d7d6=_0x3c33[_0x27b596];return _0x59d7d6;};'use strict';var _=require(_0x33c3('0x0'));var db=require(_0x33c3('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x33c3('0x2')),'mail':require('../../config/logger')(_0x33c3('0x3')),'fax':require(_0x33c3('0x4'))('fax-interactions'),'sms':require(_0x33c3('0x4'))(_0x33c3('0x5')),'chat':require(_0x33c3('0x4'))(_0x33c3('0x6')),'whatsapp':require(_0x33c3('0x4'))(_0x33c3('0x7'))};function getInteractionId(_0x1ce5ec,_0x3f14db,_0x47a463){if(_0x1ce5ec&&_0x1ce5ec[_[_0x33c3('0x8')](_0x47a463)+_0x33c3('0x9')]){return _0x1ce5ec[_[_0x33c3('0x8')](_0x47a463)+_0x33c3('0x9')];}else if(_0x1ce5ec&&_0x1ce5ec['id']){return _0x1ce5ec['id'];}else if(_0x3f14db&&_0x3f14db['id']){return _0x3f14db['id'];}else{return _0x33c3('0xa');}}function log(_0x26fa48,_0x179f76,_0x3386d1,_0x49ccf0,_0x5af51d,_0x1d0441){loggers[_0x5af51d['toLowerCase']()][_0x26fa48](_0x33c3('0xb'),_0x1d0441[_0x33c3('0xc')](),_0x179f76?_0x179f76['id']:null,_0x179f76?_0x179f76['name']:null,_0x179f76?_0x179f76[_0x33c3('0xd')]:null,getInteractionId(_0x3386d1,_0x49ccf0,_0x5af51d),_0x3386d1?JSON[_0x33c3('0xe')](_0x3386d1):_0x33c3('0xf'));}function updateUser(_0x3309e6,_0x57f2bd,_0x3d23d1,_0x3217de,_0x31be86){db[_[_0x33c3('0x8')](_0x3217de)+_0x33c3('0x10')][_0x33c3('0x11')]({'where':{'id':getInteractionId(_0x57f2bd,_0x3d23d1,_0x3217de)}})[_0x33c3('0x12')](function(_0x21b0d5){if(_0x21b0d5){return _0x21b0d5[_0x33c3('0x13')]({'UserId':_0x3309e6?_0x3309e6['id']:null});}})[_0x33c3('0x12')](function(_0x2510a7){if(_0x2510a7){log(_0x33c3('0x14'),_0x3309e6,_0x57f2bd,_0x3d23d1,_0x3217de,_0x31be86);}})[_0x33c3('0x15')](function(){log(_0x33c3('0x16'),_0x3309e6,_0x57f2bd,_0x3d23d1,_0x3217de,_0x31be86);});}exports['tracked']=function(_0x546b1c,_0x3f7757){return function(_0x4f9c58,_0x14bed7,_0x5646cc){var _0xb079d2=_0x4f9c58[_0x33c3('0x17')];var _0x58b671={};var _0x5472f4=_0x4f9c58[_0x33c3('0x18')];if(_0x58b671){_0x58b671=_[_0x33c3('0x19')](_0x4f9c58[_0x33c3('0x1a')]);_0x58b671=_['omit'](_0x58b671,[_0x33c3('0x1a'),_0x33c3('0x1b'),_0x33c3('0x1c'),_0x33c3('0x1d'),_0x33c3('0x1e')]);}updateUser(_0xb079d2,_0x58b671,_0x5472f4,_0x546b1c,_0x3f7757);_0x5646cc(null);};};
\ No newline at end of file
index f9483ad..29f91f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x490c=['../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','crypto','util','composable-middleware','../../mysqldb'];(function(_0x3e1ed0,_0x4e2a92){var _0x35acc1=function(_0x4125ba){while(--_0x4125ba){_0x3e1ed0['push'](_0x3e1ed0['shift']());}};_0x35acc1(++_0x4e2a92);}(_0x490c,0x11a));var _0xc490=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x490c[_0x319cb9];return _0x1735fc;};'use strict';var crypto=require(_0xc490('0x0'));var util=require(_0xc490('0x1'));var compose=require(_0xc490('0x2'));var db=require(_0xc490('0x3'))['db'];var config=require(_0xc490('0x4'));function getValueFromLicense(_0x540650,_0x40b9b6){if(_0x540650&&_0x40b9b6){if(_0x40b9b6[_0xc490('0x5')]&&_0x40b9b6[_0xc490('0x6')]){var _0x2572c0=_0x40b9b6['data1'];var _0x2b1860=_0x40b9b6[_0xc490('0x6')];var _0x28e749=_0x2572c0[_0xc490('0x7')]('-')[0x4];var _0x4f5691=_0x2572c0['split']('-')[0x0];var _0x5e2011=crypto[_0xc490('0x8')](_0xc490('0x9'),util[_0xc490('0xa')](_0xc490('0xb'),_0x28e749,_0x2572c0,_0x4f5691));var _0x2cc20c=_0x5e2011[_0xc490('0xc')](_0x2b1860,'base64',_0xc490('0xd'));_0x2cc20c+=_0x5e2011[_0xc490('0xe')]('utf8');var _0x339dc6=JSON[_0xc490('0xf')](_0x2cc20c);return _0x339dc6[_0xc490('0x10')](_0x540650)?_0x339dc6[_0x540650]:null;}}return null;}function isLimit(_0x306d24,_0x1e2efc,_0x54f59f,_0x58b8d0){var _0x40b5fc=_0x1e2efc;return compose()['use'](function(_0x7ecc12,_0x4dced3,_0xa9fe41){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xc490('0x11')](function(_0x2ddff3){var _0x5bcd2e=getValueFromLicense(_0x306d24,_0x2ddff3);return _0x5bcd2e?_0x5bcd2e:_0x40b5fc;})[_0xc490('0x11')](function(_0x3af1cb){_0x40b5fc=_0x3af1cb;return _0x54f59f[_0xc490('0x12')](_0x58b8d0);})[_0xc490('0x11')](function(_0xbccc47){if(_0xbccc47>=_0x40b5fc){return _0x4dced3[_0xc490('0x13')](0x193)[_0xc490('0x14')]({'message':util['format'](_0xc490('0x15'),_0x306d24)});}_0xa9fe41();})[_0xc490('0x16')](function(_0x171422){_0xa9fe41(_0x171422);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xc490('0x17')],{'where':{'$or':[{'role':_0xc490('0x18')},{'role':_0xc490('0x19')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
+var _0xe1ae=['aes-256-ctr','%s:%s:%s','update','utf8','final','parse','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher'];(function(_0x19cdbb,_0x190ecd){var _0x544e85=function(_0x1ae328){while(--_0x1ae328){_0x19cdbb['push'](_0x19cdbb['shift']());}};_0x544e85(++_0x190ecd);}(_0xe1ae,0xc0));var _0xee1a=function(_0x3b30be,_0x47bcd9){_0x3b30be=_0x3b30be-0x0;var _0x546361=_0xe1ae[_0x3b30be];return _0x546361;};'use strict';var crypto=require(_0xee1a('0x0'));var util=require(_0xee1a('0x1'));var compose=require('composable-middleware');var db=require(_0xee1a('0x2'))['db'];var config=require(_0xee1a('0x3'));function getValueFromLicense(_0x136a46,_0x350d2b){if(_0x136a46&&_0x350d2b){if(_0x350d2b[_0xee1a('0x4')]&&_0x350d2b[_0xee1a('0x5')]){var _0x32858d=_0x350d2b[_0xee1a('0x4')];var _0x177114=_0x350d2b[_0xee1a('0x5')];var _0x454d1f=_0x32858d[_0xee1a('0x6')]('-')[0x4];var _0x275042=_0x32858d[_0xee1a('0x6')]('-')[0x0];var _0x2109b2=crypto[_0xee1a('0x7')](_0xee1a('0x8'),util['format'](_0xee1a('0x9'),_0x454d1f,_0x32858d,_0x275042));var _0x48502a=_0x2109b2[_0xee1a('0xa')](_0x177114,'base64',_0xee1a('0xb'));_0x48502a+=_0x2109b2[_0xee1a('0xc')]('utf8');var _0x420f80=JSON[_0xee1a('0xd')](_0x48502a);return _0x420f80['hasOwnProperty'](_0x136a46)?_0x420f80[_0x136a46]:null;}}return null;}function isLimit(_0x5e68f5,_0x46a32e,_0x7ae535,_0x460b74){var _0x5b1a1b=_0x46a32e;return compose()[_0xee1a('0xe')](function(_0x2117d7,_0x7a7222,_0xdcf24c){return db[_0xee1a('0xf')][_0xee1a('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xee1a('0x11')](function(_0x5e3e7d){var _0x413418=getValueFromLicense(_0x5e68f5,_0x5e3e7d);return _0x413418?_0x413418:_0x5b1a1b;})['then'](function(_0x5cb0a6){_0x5b1a1b=_0x5cb0a6;return _0x7ae535['count'](_0x460b74);})[_0xee1a('0x11')](function(_0x5e37d2){if(_0x5e37d2>=_0x5b1a1b){return _0x7a7222[_0xee1a('0x12')](0x193)[_0xee1a('0x13')]({'message':util['format'](_0xee1a('0x14'),_0x5e68f5)});}_0xdcf24c();})['catch'](function(_0x278f7c){_0xdcf24c(_0x278f7c);});});}function isUserLimit(){return isLimit(_0xee1a('0x15'),0x1,db[_0xee1a('0x16')],{'where':{'$or':[{'role':_0xee1a('0x17')},{'role':'user'}]}});}exports[_0xee1a('0x18')]=isUserLimit;
\ No newline at end of file
index e502a5a..2e2118f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9703=['format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','LIKE\x20?','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','DATE','utcOffset','add','minutes','lodash','moment','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','forEach','shift','filter','indexOf','map','conditions','buildExpression','operator','$between','value','includes','$gt','$lte','days'];(function(_0x86da5d,_0x18d93e){var _0x4f6f71=function(_0x595f5f){while(--_0x595f5f){_0x86da5d['push'](_0x86da5d['shift']());}};_0x4f6f71(++_0x18d93e);}(_0x9703,0x1c5));var _0x3970=function(_0x4f94b6,_0x58fb63){_0x4f94b6=_0x4f94b6-0x0;var _0x1721bd=_0x9703[_0x4f94b6];return _0x1721bd;};'use strict';var _=require(_0x3970('0x0'));var moment=require(_0x3970('0x1'));exports['parseSearch']=function(_0x2707a1){var _0x2a1890={'conditions':[]};_0x2a1890[_0x3970('0x2')]=_[_0x3970('0x3')](_0x2707a1,_0x3970('0x4'))?'or':_0x3970('0x5');var _0x13fac5=_0x2707a1[_0x3970('0x6')](_0x3970('0x7'),'')[_0x3970('0x6')](_0x3970('0x4'),'')[_0x3970('0x8')]('||');for(var _0x4967bc=0x0;_0x4967bc<_0x13fac5[_0x3970('0x9')];_0x4967bc++){var _0x2bf96a=_0x13fac5[_0x4967bc][_0x3970('0x8')](':=');var _0x3761=_0x2bf96a[0x0];var _0x100351=_0x2bf96a['slice'](0x1);_0x100351[_0x3970('0xa')](function(_0x1c6494){var _0x255989=_0x1c6494[_0x3970('0x8')]('[')[_0x3970('0xb')]();var _0x3f999f=_0x1c6494['match'](/\[(.*?)\]/g);_0x3f999f[_0x3970('0xa')](function(_0x3d95d8){var _0x39f161=_0x3d95d8[_0x3970('0x8')]('[')[_0x3970('0xc')](function(_0x5dd51c){return _0x5dd51c[_0x3970('0xd')](']')>-0x1;})[_0x3970('0xe')](function(_0x1f871a){return _0x1f871a[_0x3970('0x8')](']')[0x0];})[0x0];_0x2a1890[_0x3970('0xf')]['push']({'field':_0x3761,'operator':_0x255989,'value':_0x39f161});});});}return _0x2a1890;};exports[_0x3970('0x10')]=function(_0x115fd2,_0x2c61b7,_0x7e7b49){var _0x52621f={};if(_0x2c61b7==='DATE'){if(_0x7e7b49['operator']==='$eq'){_0x7e7b49[_0x3970('0x11')]=_0x3970('0x12');_0x7e7b49[_0x3970('0x13')]+=','+_0x7e7b49[_0x3970('0x13')];}else if(_[_0x3970('0x14')]([_0x3970('0x15'),_0x3970('0x16')],_0x7e7b49[_0x3970('0x11')])){_0x7e7b49[_0x3970('0x13')]=moment(_0x7e7b49['value'])['add'](0x1,_0x3970('0x17'))[_0x3970('0x18')](_0x3970('0x19'));}}if(_0x7e7b49['castTo']){_0x2c61b7=_0x7e7b49[_0x3970('0x1a')];_0x52621f[_0x3970('0x1b')]=_0x3970('0x1c')+_0x115fd2+'.'+_0x7e7b49[_0x3970('0x1d')]+_0x3970('0x1e')+_0x7e7b49[_0x3970('0x1a')]+')\x20'+parseOperator(_0x7e7b49[_0x3970('0x11')]);}else{_0x52621f[_0x3970('0x1b')]=_0x115fd2+'.'+_0x7e7b49['field']+'\x20'+parseOperator(_0x7e7b49[_0x3970('0x11')]);}if(_[_0x3970('0x14')]([_0x3970('0x1f'),_0x3970('0x20')],_0x7e7b49['operator']))_0x52621f[_0x3970('0x1b')]='('+_0x52621f[_0x3970('0x1b')]+_0x3970('0x21')+_0x115fd2+'.'+_0x7e7b49[_0x3970('0x1d')]+_0x3970('0x22');_0x52621f[_0x3970('0x13')]=parseValue(_0x2c61b7,_0x7e7b49[_0x3970('0x11')],_0x7e7b49[_0x3970('0x13')]);return _0x52621f;};function parseOperator(_0x1560b1){var _0x117924;switch(_0x1560b1){case _0x3970('0x23'):_0x117924=_0x3970('0x24');break;case'$notIn':_0x117924=_0x3970('0x25');break;case _0x3970('0x26'):_0x117924=_0x3970('0x27');break;case _0x3970('0x1f'):_0x117924=_0x3970('0x28');break;case _0x3970('0x29'):case'$startsWith':case'$endsWith':_0x117924=_0x3970('0x2a');break;case'$lt':_0x117924='<\x20?';break;case _0x3970('0x15'):_0x117924=_0x3970('0x2b');break;case _0x3970('0x16'):_0x117924='<=\x20?';break;case _0x3970('0x2c'):_0x117924='>=\x20?';break;case _0x3970('0x12'):_0x117924=_0x3970('0x2d');break;}return _0x117924;}function parseValue(_0x3e2550,_0x38cbe7,_0x2adfe3){var _0x1195a1={'start':undefined,'end':undefined};switch(_0x38cbe7){case _0x3970('0x23'):case'$notIn':_0x1195a1[_0x3970('0x2e')]=_0x2adfe3[_0x3970('0x8')](',');break;case _0x3970('0x29'):_0x1195a1[_0x3970('0x2e')]='%'+_0x2adfe3+'%';break;case'$startsWith':_0x1195a1['start']=_0x2adfe3+'%';break;case _0x3970('0x2f'):_0x1195a1['start']='%'+_0x2adfe3;break;case _0x3970('0x12'):var _0x539b4e=_0x2adfe3[_0x3970('0x8')](',');var _0x2adfe3=_0x539b4e[_0x3970('0xb')]();var _0x59f600=_0x539b4e[_0x3970('0x30')]();if(_0x3e2550===_0x3970('0x31')){_0x2adfe3=moment(_0x2adfe3)[_0x3970('0x32')](0x0,!![])[_0x3970('0x18')]();_0x59f600=moment(_0x59f600)[_0x3970('0x32')](0x0,!![])[_0x3970('0x33')](0x17,'hours')[_0x3970('0x33')](0x3b,_0x3970('0x34'))['add'](0x3b,'seconds')['format']();}_0x1195a1={'start':_0x2adfe3,'end':_0x59f600};break;default:_0x1195a1[_0x3970('0x2e')]=_0x2adfe3;break;}return _0x1195a1;}
\ No newline at end of file
+var _0xff4c=['length','slice','forEach','match','filter','map','push','buildExpression','DATE','$eq','value','$gt','$lte','operator','add','days','format','castTo','text','CAST(','\x20AS\x20','field','includes','$ne','\x20OR\x20','$in','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','$lt','>\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','shift','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','[$and]','replace','split'];(function(_0x4cbfee,_0x19c6ec){var _0x3f2b97=function(_0x3adf66){while(--_0x3adf66){_0x4cbfee['push'](_0x4cbfee['shift']());}};_0x3f2b97(++_0x19c6ec);}(_0xff4c,0x98));var _0xcff4=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xff4c[_0x125ff8];return _0x2d9ef;};'use strict';var _=require(_0xcff4('0x0'));var moment=require(_0xcff4('0x1'));exports[_0xcff4('0x2')]=function(_0x123ab7){var _0x30232c={'conditions':[]};_0x30232c[_0xcff4('0x3')]=_[_0xcff4('0x4')](_0x123ab7,_0xcff4('0x5'))?'or':_0xcff4('0x6');var _0x18f0c7=_0x123ab7['replace'](_0xcff4('0x7'),'')[_0xcff4('0x8')](_0xcff4('0x5'),'')[_0xcff4('0x9')]('||');for(var _0x40ee62=0x0;_0x40ee62<_0x18f0c7[_0xcff4('0xa')];_0x40ee62++){var _0x551620=_0x18f0c7[_0x40ee62][_0xcff4('0x9')](':=');var _0x44efb6=_0x551620[0x0];var _0x428bb1=_0x551620[_0xcff4('0xb')](0x1);_0x428bb1[_0xcff4('0xc')](function(_0x493232){var _0xf6d0ad=_0x493232[_0xcff4('0x9')]('[')['shift']();var _0xee72d0=_0x493232[_0xcff4('0xd')](/\[(.*?)\]/g);_0xee72d0[_0xcff4('0xc')](function(_0x4ebaf0){var _0x268541=_0x4ebaf0[_0xcff4('0x9')]('[')[_0xcff4('0xe')](function(_0xcc16e6){return _0xcc16e6['indexOf'](']')>-0x1;})[_0xcff4('0xf')](function(_0x3ebc5f){return _0x3ebc5f[_0xcff4('0x9')](']')[0x0];})[0x0];_0x30232c['conditions'][_0xcff4('0x10')]({'field':_0x44efb6,'operator':_0xf6d0ad,'value':_0x268541});});});}return _0x30232c;};exports[_0xcff4('0x11')]=function(_0x10181c,_0x4d04dc,_0x153ce0){var _0x310aac={};if(_0x4d04dc===_0xcff4('0x12')){if(_0x153ce0['operator']===_0xcff4('0x13')){_0x153ce0['operator']='$between';_0x153ce0[_0xcff4('0x14')]+=','+_0x153ce0[_0xcff4('0x14')];}else if(_['includes']([_0xcff4('0x15'),_0xcff4('0x16')],_0x153ce0[_0xcff4('0x17')])){_0x153ce0['value']=moment(_0x153ce0[_0xcff4('0x14')])[_0xcff4('0x18')](0x1,_0xcff4('0x19'))[_0xcff4('0x1a')]('YYYY-MM-DD');}}if(_0x153ce0[_0xcff4('0x1b')]){_0x4d04dc=_0x153ce0[_0xcff4('0x1b')];_0x310aac[_0xcff4('0x1c')]=_0xcff4('0x1d')+_0x10181c+'.'+_0x153ce0['field']+_0xcff4('0x1e')+_0x153ce0[_0xcff4('0x1b')]+')\x20'+parseOperator(_0x153ce0[_0xcff4('0x17')]);}else{_0x310aac[_0xcff4('0x1c')]=_0x10181c+'.'+_0x153ce0[_0xcff4('0x1f')]+'\x20'+parseOperator(_0x153ce0[_0xcff4('0x17')]);}if(_[_0xcff4('0x20')]([_0xcff4('0x21'),'$notIn'],_0x153ce0[_0xcff4('0x17')]))_0x310aac[_0xcff4('0x1c')]='('+_0x310aac[_0xcff4('0x1c')]+_0xcff4('0x22')+_0x10181c+'.'+_0x153ce0['field']+'\x20IS\x20NULL)';_0x310aac['value']=parseValue(_0x4d04dc,_0x153ce0[_0xcff4('0x17')],_0x153ce0['value']);return _0x310aac;};function parseOperator(_0x1e76e3){var _0x24570b;switch(_0x1e76e3){case _0xcff4('0x23'):_0x24570b='IN\x20?';break;case _0xcff4('0x24'):_0x24570b=_0xcff4('0x25');break;case'$eq':_0x24570b=_0xcff4('0x26');break;case _0xcff4('0x21'):_0x24570b='<>\x20?';break;case _0xcff4('0x27'):case _0xcff4('0x28'):case _0xcff4('0x29'):_0x24570b='LIKE\x20?';break;case _0xcff4('0x2a'):_0x24570b='<\x20?';break;case'$gt':_0x24570b=_0xcff4('0x2b');break;case _0xcff4('0x16'):_0x24570b='<=\x20?';break;case _0xcff4('0x2c'):_0x24570b=_0xcff4('0x2d');break;case _0xcff4('0x2e'):_0x24570b=_0xcff4('0x2f');break;}return _0x24570b;}function parseValue(_0xfc7690,_0x4f1984,_0xa52f74){var _0x4eed02={'start':undefined,'end':undefined};switch(_0x4f1984){case'$in':case _0xcff4('0x24'):_0x4eed02[_0xcff4('0x30')]=_0xa52f74[_0xcff4('0x9')](',');break;case _0xcff4('0x27'):_0x4eed02['start']='%'+_0xa52f74+'%';break;case _0xcff4('0x28'):_0x4eed02[_0xcff4('0x30')]=_0xa52f74+'%';break;case _0xcff4('0x29'):_0x4eed02[_0xcff4('0x30')]='%'+_0xa52f74;break;case _0xcff4('0x2e'):var _0x388596=_0xa52f74[_0xcff4('0x9')](',');var _0xa52f74=_0x388596[_0xcff4('0x31')]();var _0x55bab7=_0x388596['pop']();if(_0xfc7690===_0xcff4('0x12')){_0xa52f74=moment(_0xa52f74)[_0xcff4('0x32')](0x0,!![])['format']();_0x55bab7=moment(_0x55bab7)[_0xcff4('0x32')](0x0,!![])[_0xcff4('0x18')](0x17,_0xcff4('0x33'))['add'](0x3b,_0xcff4('0x34'))[_0xcff4('0x18')](0x3b,_0xcff4('0x35'))[_0xcff4('0x1a')]();}_0x4eed02={'start':_0xa52f74,'end':_0x55bab7};break;default:_0x4eed02[_0xcff4('0x30')]=_0xa52f74;break;}return _0x4eed02;}
\ No newline at end of file
index 272c61d..8f2cefe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','where','pick','filter','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','fields','split','filters','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','$lte','utc','subtract','name','uniqueid','isArray','limit','offset','sort','map','priority','unsigned','DESC','cast','col','ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','forEach'];(function(_0x149a9b,_0x5bb275){var _0x2c2bf6=function(_0xfe0c14){while(--_0xfe0c14){_0x149a9b['push'](_0x149a9b['shift']());}};_0x2c2bf6(++_0x5bb275);}(_0xbd51,0x89));var _0x1bd5=function(_0x4a2e3e,_0xa633ed){_0x4a2e3e=_0x4a2e3e-0x0;var _0x26f34b=_0xbd51[_0x4a2e3e];return _0x26f34b;};'use strict';var _=require('lodash');var sequelize=require(_0x1bd5('0x0'));var moment=require(_0x1bd5('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3e5a94){var _0x4856c5=['ne'];try{var _0x2327a0=JSON[_0x1bd5('0x2')](_0x3e5a94);var _0x2b153b=Object[_0x1bd5('0x3')](_0x2327a0)[0x0];return _0x4856c5[_0x1bd5('0x4')](_0x2b153b);}catch(_0x14da06){return![];}}function getOperatorValue(_0x439d8d){var _0x28655c=JSON[_0x1bd5('0x2')](_0x439d8d);var _0x1cead2=Object['keys'](_0x28655c)[0x0];var _0x2a2ea6=_0x28655c[_0x1cead2];return{['$'+_0x1cead2]:_0x2a2ea6};}exports[_0x1bd5('0x5')]=function(_0x17c4bd){var _0x1e01d1=null;if(_0x17c4bd){_0x1e01d1=_0x17c4bd[_0x1bd5('0x6')](',');}return _0x1e01d1;};exports[_0x1bd5('0x7')]=function(_0xe1cc2a,_0x341ea6){var _0x272d4d={};if(!_['isEmpty'](_0xe1cc2a)){_[_0x1bd5('0x8')](_0xe1cc2a,function(_0x589205,_0x25ae33){try{if(_0x341ea6){var _0x5f549d=_[_0x1bd5('0x9')](_0x341ea6,{'name':_0x25ae33})||{};if(hasSequelizeOperator(_0x589205)){_0x272d4d[_0x25ae33]=getOperatorValue(_0x589205);}else if(_0x5f549d[_0x1bd5('0xa')]===_0x1bd5('0xb')&&_['isPlainObject'](_0x589205)){var _0x405f62=JSON[_0x1bd5('0x2')](_0x589205);var _0x25c683={'$gte':moment(moment(_0x405f62[_0x1bd5('0xc')])[_0x1bd5('0xd')](_0x1bd5('0xe')))['utc']()[_0x1bd5('0xd')](),'$lte':moment(moment(_0x405f62[_0x1bd5('0xf')])[_0x1bd5('0xd')]('YYYY-MM-DD'))[_0x1bd5('0x10')]()[_0x1bd5('0x11')](0x1,'s')[_0x1bd5('0xd')]()};_0x272d4d[_0x25ae33]=_0x25c683;}else if(_0x5f549d[_0x1bd5('0x12')]===_0x1bd5('0x13')){_0x272d4d[_0x25ae33]=_0x589205;}else{_0x272d4d[_0x25ae33]=_[_0x1bd5('0x14')](_0x589205)?_0x589205:JSON['parse'](_0x589205);}}else{_0x272d4d[_0x25ae33]=_[_0x1bd5('0x14')](_0x589205)?_0x589205:JSON[_0x1bd5('0x2')](_0x589205);}}catch(_0x58950b){_0x272d4d[_0x25ae33]=_0x589205[_0x1bd5('0x6')](',');}});}return _0x272d4d;};exports[_0x1bd5('0x15')]=function(_0x5494a8){_0x5494a8=parseInt(_0x5494a8,0xa);if(!_0x5494a8||_0x5494a8<0x0){_0x5494a8=LIMIT_VALUE;}return _0x5494a8;};exports[_0x1bd5('0x16')]=function(_0x4a73bb){_0x4a73bb=parseInt(_0x4a73bb,0xa);if(!_0x4a73bb||_0x4a73bb<0x0){_0x4a73bb=0x0;}return _0x4a73bb;};exports[_0x1bd5('0x17')]=function(_0x1bb77f){var _0x95307e,_0x2dc5e3=null;if(_0x1bb77f){_0x95307e=_0x1bb77f[_0x1bd5('0x6')](',');_0x2dc5e3=_[_0x1bd5('0x18')](_0x95307e,function(_0x48388f){if(_0x48388f['indexOf']('-')===0x0){return[_0x48388f===_0x1bd5('0x19')?sequelize['cast'](sequelize['col'](_0x1bd5('0x19')),_0x1bd5('0x1a')):_0x48388f['substr'](0x1),_0x1bd5('0x1b')];}else{return[_0x48388f==='priority'?sequelize[_0x1bd5('0x1c')](sequelize[_0x1bd5('0x1d')]('priority'),_0x1bd5('0x1a')):_0x48388f,_0x1bd5('0x1e')];}});}return _0x2dc5e3;};exports[_0x1bd5('0x1f')]=function(_0xe7db0d,_0x2223d7){if(_[_0x1bd5('0x20')](_0xe7db0d)){return _0xe7db0d;}if(_['isArray'](_0xe7db0d)){for(var _0x14b43f=0x0;_0x14b43f<_0xe7db0d[_0x1bd5('0x21')];_0x14b43f+=0x1){_0xe7db0d[_0x14b43f]=this[_0x1bd5('0x1f')](_0xe7db0d[_0x14b43f],_0x2223d7);}return _0xe7db0d;}if(!_[_0x1bd5('0x22')](_0xe7db0d)){return _0xe7db0d;}if(_[_0x1bd5('0x23')](_0x2223d7)){_0x2223d7=[_0x2223d7];}if(!_[_0x1bd5('0x14')](_0x2223d7)){return _0xe7db0d;}for(var _0xce2323=0x0;_0xce2323<_0x2223d7[_0x1bd5('0x21')];_0xce2323+=0x1){_[_0x1bd5('0x24')](_0xe7db0d,_0x2223d7[_0xce2323]);}for(var _0x57fe2d in _0xe7db0d){if(_0xe7db0d[_0x1bd5('0x25')](_0x57fe2d)){_0xe7db0d[_0x57fe2d]=this[_0x1bd5('0x1f')](_0xe7db0d[_0x57fe2d],_0x2223d7);}}return _0xe7db0d;};exports[_0x1bd5('0x26')]=function(_0xbe12ed){return _0xbe12ed[_0x1bd5('0x27')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x1bd5('0x28')]=function(_0x5ba8f0){return _0x5ba8f0['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x1bd5('0x29')]=function(_0x36be51){var _0x5dd643=[];_0x36be51[_0x1bd5('0x6')](/[ ,]+/)[_0x1bd5('0x2a')](function(_0x44c206){_0x44c206=_0x44c206[_0x1bd5('0x2b')](/([^:]")"+/g,'$1');_0x44c206='+'+_0x44c206+'*';if(_0x44c206[_0x1bd5('0x4')]('@'))_0x44c206='\x22'+_0x44c206+'\x22';_0x5dd643[_0x1bd5('0x2c')](_0x44c206);});return _0x5dd643[_0x1bd5('0x2d')]('\x20');};exports[_0x1bd5('0x2e')]=function(_0x572932,_0x42b94e,_0x351a64){var _0x37618a={},_0x30ecf5={};if(_0x42b94e['query']['$id']){_0x42b94e[_0x1bd5('0x2f')]['id']=_0x42b94e['query'][_0x1bd5('0x30')];delete _0x42b94e['query'][_0x1bd5('0x30')];}_0x37618a[_0x1bd5('0x31')]=_[_0x1bd5('0x18')](_0x572932,_0x1bd5('0x12'));_0x37618a[_0x1bd5('0x2f')]=_['keys'](_0x42b94e[_0x1bd5('0x2f')]);_0x37618a[_0x1bd5('0x7')]=_[_0x1bd5('0x32')](_0x37618a[_0x1bd5('0x31')],_0x37618a[_0x1bd5('0x2f')]);_0x30ecf5['attributes']=_[_0x1bd5('0x32')](_0x37618a[_0x1bd5('0x31')],this['fields'](_0x42b94e[_0x1bd5('0x2f')][_0x1bd5('0x5')]));_0x30ecf5[_0x1bd5('0x33')]=_0x30ecf5['attributes'][_0x1bd5('0x21')]?_0x30ecf5['attributes']:_0x37618a[_0x1bd5('0x31')];if(!_0x42b94e[_0x1bd5('0x2f')]['hasOwnProperty'](_0x1bd5('0x34'))){_0x30ecf5[_0x1bd5('0x15')]=this[_0x1bd5('0x15')](_0x42b94e[_0x1bd5('0x2f')][_0x1bd5('0x15')]);_0x30ecf5[_0x1bd5('0x16')]=this[_0x1bd5('0x16')](_0x42b94e[_0x1bd5('0x2f')][_0x1bd5('0x16')]);}_0x30ecf5['order']=this[_0x1bd5('0x17')](_0x42b94e[_0x1bd5('0x2f')][_0x1bd5('0x17')]);_0x30ecf5[_0x1bd5('0x35')]=this['filters'](_[_0x1bd5('0x36')](_0x42b94e['query'],_0x37618a[_0x1bd5('0x7')]),_0x572932);if(_0x42b94e[_0x1bd5('0x2f')][_0x1bd5('0x37')]){_0x30ecf5['where']=_[_0x1bd5('0x38')](_0x30ecf5[_0x1bd5('0x35')],{'$or':_[_0x1bd5('0x18')](_0x572932,function(_0xbeb181){if(_0xbeb181['type']!==_0x1bd5('0x39')){if(_0x351a64){return sequelize[_0x1bd5('0x35')](sequelize['fn']('lower',sequelize[_0x1bd5('0x1d')](_0xbeb181['name'])),{'$like':sequelize['fn'](_0x1bd5('0x3a'),'%'+_0x42b94e[_0x1bd5('0x2f')][_0x1bd5('0x37')]+'%')});}else{var _0x3b4757={};_0x3b4757[_0xbeb181[_0x1bd5('0x12')]]={'$like':'%'+_0x42b94e['query'][_0x1bd5('0x37')]+'%'};return _0x3b4757;}}})});}_0x30ecf5=_['merge']({},_0x30ecf5,_0x42b94e[_0x1bd5('0x3b')]);return _0x30ecf5;};
\ No newline at end of file
+var _0xa5c1=['intersection','fields','order','where','pick','filter','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','split','filters','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','limit','offset','sort','map','priority','cast','col','unsigned','substr','DESC','ASC','omit','isEmpty','isArray','length','isObject','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','join','query','$id','model','attributes'];(function(_0x2d4d5b,_0x528f86){var _0xf4aac6=function(_0x3eae4a){while(--_0x3eae4a){_0x2d4d5b['push'](_0x2d4d5b['shift']());}};_0xf4aac6(++_0x528f86);}(_0xa5c1,0x80));var _0x1a5c=function(_0x343b64,_0x4b830c){_0x343b64=_0x343b64-0x0;var _0x1fb805=_0xa5c1[_0x343b64];return _0x1fb805;};'use strict';var _=require(_0x1a5c('0x0'));var sequelize=require(_0x1a5c('0x1'));var moment=require(_0x1a5c('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4c59d0){var _0xfe64a6=['ne'];try{var _0x3415a0=JSON[_0x1a5c('0x3')](_0x4c59d0);var _0x48be5d=Object[_0x1a5c('0x4')](_0x3415a0)[0x0];return _0xfe64a6['includes'](_0x48be5d);}catch(_0x45792f){return![];}}function getOperatorValue(_0x57dd9a){var _0x5d7ef9=JSON[_0x1a5c('0x3')](_0x57dd9a);var _0x1fb50e=Object['keys'](_0x5d7ef9)[0x0];var _0x27e0a3=_0x5d7ef9[_0x1fb50e];return{['$'+_0x1fb50e]:_0x27e0a3};}exports['fields']=function(_0x105319){var _0x2d30ab=null;if(_0x105319){_0x2d30ab=_0x105319[_0x1a5c('0x5')](',');}return _0x2d30ab;};exports[_0x1a5c('0x6')]=function(_0x57b76d,_0x34d35a){var _0x1cb3c9={};if(!_['isEmpty'](_0x57b76d)){_[_0x1a5c('0x7')](_0x57b76d,function(_0x446274,_0x4eceb3){try{if(_0x34d35a){var _0x1f9c82=_[_0x1a5c('0x8')](_0x34d35a,{'name':_0x4eceb3})||{};if(hasSequelizeOperator(_0x446274)){_0x1cb3c9[_0x4eceb3]=getOperatorValue(_0x446274);}else if(_0x1f9c82[_0x1a5c('0x9')]===_0x1a5c('0xa')&&_[_0x1a5c('0xb')](_0x446274)){var _0xbbded0=JSON[_0x1a5c('0x3')](_0x446274);var _0x3f767e={'$gte':moment(moment(_0xbbded0[_0x1a5c('0xc')])[_0x1a5c('0xd')](_0x1a5c('0xe')))[_0x1a5c('0xf')]()[_0x1a5c('0xd')](),'$lte':moment(moment(_0xbbded0['$lte'])[_0x1a5c('0xd')](_0x1a5c('0xe')))[_0x1a5c('0xf')]()[_0x1a5c('0x10')](0x1,'s')[_0x1a5c('0xd')]()};_0x1cb3c9[_0x4eceb3]=_0x3f767e;}else if(_0x1f9c82[_0x1a5c('0x11')]===_0x1a5c('0x12')){_0x1cb3c9[_0x4eceb3]=_0x446274;}else{_0x1cb3c9[_0x4eceb3]=_['isArray'](_0x446274)?_0x446274:JSON['parse'](_0x446274);}}else{_0x1cb3c9[_0x4eceb3]=_['isArray'](_0x446274)?_0x446274:JSON[_0x1a5c('0x3')](_0x446274);}}catch(_0xb40eb6){_0x1cb3c9[_0x4eceb3]=_0x446274[_0x1a5c('0x5')](',');}});}return _0x1cb3c9;};exports[_0x1a5c('0x13')]=function(_0x3f6be7){_0x3f6be7=parseInt(_0x3f6be7,0xa);if(!_0x3f6be7||_0x3f6be7<0x0){_0x3f6be7=LIMIT_VALUE;}return _0x3f6be7;};exports[_0x1a5c('0x14')]=function(_0x1d4d1b){_0x1d4d1b=parseInt(_0x1d4d1b,0xa);if(!_0x1d4d1b||_0x1d4d1b<0x0){_0x1d4d1b=0x0;}return _0x1d4d1b;};exports[_0x1a5c('0x15')]=function(_0x36c48b){var _0x3588ef,_0x2473c1=null;if(_0x36c48b){_0x3588ef=_0x36c48b[_0x1a5c('0x5')](',');_0x2473c1=_[_0x1a5c('0x16')](_0x3588ef,function(_0x4d8a30){if(_0x4d8a30['indexOf']('-')===0x0){return[_0x4d8a30===_0x1a5c('0x17')?sequelize[_0x1a5c('0x18')](sequelize[_0x1a5c('0x19')]('priority'),_0x1a5c('0x1a')):_0x4d8a30[_0x1a5c('0x1b')](0x1),_0x1a5c('0x1c')];}else{return[_0x4d8a30==='priority'?sequelize[_0x1a5c('0x18')](sequelize[_0x1a5c('0x19')]('priority'),_0x1a5c('0x1a')):_0x4d8a30,_0x1a5c('0x1d')];}});}return _0x2473c1;};exports[_0x1a5c('0x1e')]=function(_0x1b195a,_0x2dafad){if(_[_0x1a5c('0x1f')](_0x1b195a)){return _0x1b195a;}if(_[_0x1a5c('0x20')](_0x1b195a)){for(var _0x14bb98=0x0;_0x14bb98<_0x1b195a[_0x1a5c('0x21')];_0x14bb98+=0x1){_0x1b195a[_0x14bb98]=this[_0x1a5c('0x1e')](_0x1b195a[_0x14bb98],_0x2dafad);}return _0x1b195a;}if(!_[_0x1a5c('0x22')](_0x1b195a)){return _0x1b195a;}if(_['isString'](_0x2dafad)){_0x2dafad=[_0x2dafad];}if(!_[_0x1a5c('0x20')](_0x2dafad)){return _0x1b195a;}for(var _0x5202ca=0x0;_0x5202ca<_0x2dafad[_0x1a5c('0x21')];_0x5202ca+=0x1){_[_0x1a5c('0x23')](_0x1b195a,_0x2dafad[_0x5202ca]);}for(var _0x4665b1 in _0x1b195a){if(_0x1b195a[_0x1a5c('0x24')](_0x4665b1)){_0x1b195a[_0x4665b1]=this['omit'](_0x1b195a[_0x4665b1],_0x2dafad);}}return _0x1b195a;};exports['isNumeric']=function(_0x15ef1c){return _0x15ef1c['match'](RegExp(_0x1a5c('0x25')))?!![]:![];};exports[_0x1a5c('0x26')]=function(_0x38694e){return _0x38694e[_0x1a5c('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0x1a5c('0x28')]=function(_0x1c4a91){var _0x4901ba=[];_0x1c4a91[_0x1a5c('0x5')](/[ ,]+/)[_0x1a5c('0x29')](function(_0x336156){_0x336156=_0x336156[_0x1a5c('0x2a')](/([^:]")"+/g,'$1');_0x336156='+'+_0x336156+'*';if(_0x336156['includes']('@'))_0x336156='\x22'+_0x336156+'\x22';_0x4901ba[_0x1a5c('0x2b')](_0x336156);});return _0x4901ba[_0x1a5c('0x2c')]('\x20');};exports['getOptions']=function(_0x5238bd,_0x50f4ba,_0x32f36e){var _0x447cf5={},_0x3b071d={};if(_0x50f4ba[_0x1a5c('0x2d')][_0x1a5c('0x2e')]){_0x50f4ba[_0x1a5c('0x2d')]['id']=_0x50f4ba[_0x1a5c('0x2d')]['$id'];delete _0x50f4ba[_0x1a5c('0x2d')][_0x1a5c('0x2e')];}_0x447cf5[_0x1a5c('0x2f')]=_[_0x1a5c('0x16')](_0x5238bd,_0x1a5c('0x11'));_0x447cf5[_0x1a5c('0x2d')]=_[_0x1a5c('0x4')](_0x50f4ba[_0x1a5c('0x2d')]);_0x447cf5[_0x1a5c('0x6')]=_['intersection'](_0x447cf5[_0x1a5c('0x2f')],_0x447cf5[_0x1a5c('0x2d')]);_0x3b071d[_0x1a5c('0x30')]=_[_0x1a5c('0x31')](_0x447cf5['model'],this[_0x1a5c('0x32')](_0x50f4ba['query'][_0x1a5c('0x32')]));_0x3b071d[_0x1a5c('0x30')]=_0x3b071d[_0x1a5c('0x30')][_0x1a5c('0x21')]?_0x3b071d[_0x1a5c('0x30')]:_0x447cf5['model'];if(!_0x50f4ba[_0x1a5c('0x2d')]['hasOwnProperty']('nolimit')){_0x3b071d['limit']=this['limit'](_0x50f4ba['query'][_0x1a5c('0x13')]);_0x3b071d[_0x1a5c('0x14')]=this['offset'](_0x50f4ba[_0x1a5c('0x2d')]['offset']);}_0x3b071d[_0x1a5c('0x33')]=this[_0x1a5c('0x15')](_0x50f4ba[_0x1a5c('0x2d')][_0x1a5c('0x15')]);_0x3b071d[_0x1a5c('0x34')]=this[_0x1a5c('0x6')](_[_0x1a5c('0x35')](_0x50f4ba[_0x1a5c('0x2d')],_0x447cf5['filters']),_0x5238bd);if(_0x50f4ba[_0x1a5c('0x2d')][_0x1a5c('0x36')]){_0x3b071d[_0x1a5c('0x34')]=_[_0x1a5c('0x37')](_0x3b071d['where'],{'$or':_['map'](_0x5238bd,function(_0x150e7d){if(_0x150e7d['type']!==_0x1a5c('0x38')){if(_0x32f36e){return sequelize[_0x1a5c('0x34')](sequelize['fn'](_0x1a5c('0x39'),sequelize['col'](_0x150e7d[_0x1a5c('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x50f4ba[_0x1a5c('0x2d')]['filter']+'%')});}else{var _0x459b42={};_0x459b42[_0x150e7d[_0x1a5c('0x11')]]={'$like':'%'+_0x50f4ba[_0x1a5c('0x2d')]['filter']+'%'};return _0x459b42;}}})});}_0x3b071d=_['merge']({},_0x3b071d,_0x50f4ba[_0x1a5c('0x3a')]);return _0x3b071d;};
\ No newline at end of file
index b52a1cb..058ed62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c57=['env','production','appPath','join','root','public','development','test','set','client','json\x20replacer','toISOString','split','views','/server/views','engine','ejs','renderFile','view\x20engine','html','use','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','path','passport','cors','./environment','default','get'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1c57,0x1c9));var _0x71c5=function(_0x2b96e0,_0x332aba){_0x2b96e0=_0x2b96e0-0x0;var _0x24f190=_0x1c57[_0x2b96e0];return _0x24f190;};'use strict';var express=require(_0x71c5('0x0'));var favicon=require(_0x71c5('0x1'));var bodyParser=require(_0x71c5('0x2'));var methodOverride=require(_0x71c5('0x3'));var cookieParser=require(_0x71c5('0x4'));var errorHandler=require('errorhandler');var path=require(_0x71c5('0x5'));var passport=require(_0x71c5('0x6'));var cors=require(_0x71c5('0x7'));var moment=require('moment');var config=require(_0x71c5('0x8'));var db=require('../mysqldb')['db'];exports[_0x71c5('0x9')]=function(_0x3c7c40){var _0xe859d4=_0x3c7c40[_0x71c5('0xa')](_0x71c5('0xb'));if(_0xe859d4===_0x71c5('0xc')){_0x3c7c40['set'](_0x71c5('0xd'),path[_0x71c5('0xe')](config[_0x71c5('0xf')],_0x71c5('0x10')));}if(_0xe859d4===_0x71c5('0x11')||_0xe859d4===_0x71c5('0x12')){_0x3c7c40[_0x71c5('0x13')](_0x71c5('0xd'),path[_0x71c5('0xe')](config['root'],_0x71c5('0x14')));_0x3c7c40['use'](errorHandler());}_0x3c7c40[_0x71c5('0x13')](_0x71c5('0x15'),function(_0x2842ef,_0x1703d6){if(this[_0x2842ef]instanceof Date){_0x1703d6=this[_0x2842ef][_0x71c5('0x16')]()[_0x71c5('0x17')]('.')[0x0]+'Z';}return _0x1703d6;});_0x3c7c40['use'](express['static'](_0x3c7c40['get'](_0x71c5('0xd'))));_0x3c7c40[_0x71c5('0x13')](_0x71c5('0x18'),config[_0x71c5('0xf')]+_0x71c5('0x19'));_0x3c7c40[_0x71c5('0x1a')]('html',require(_0x71c5('0x1b'))[_0x71c5('0x1c')]);_0x3c7c40[_0x71c5('0x13')](_0x71c5('0x1d'),_0x71c5('0x1e'));_0x3c7c40[_0x71c5('0x1f')](bodyParser[_0x71c5('0x20')]({'limit':_0x71c5('0x21'),'extended':!![]}));_0x3c7c40[_0x71c5('0x1f')](bodyParser[_0x71c5('0x22')]({'limit':'50mb'}));_0x3c7c40[_0x71c5('0x1f')](cors());_0x3c7c40['use'](methodOverride());_0x3c7c40[_0x71c5('0x1f')](cookieParser());_0x3c7c40[_0x71c5('0x1f')](passport[_0x71c5('0x23')]());};
\ No newline at end of file
+var _0xe5b7=['passport','cors','moment','./environment','../mysqldb','default','get','env','production','set','join','public','development','appPath','root','use','split','static','views','/server/views','html','ejs','renderFile','view\x20engine','50mb','initialize','body-parser','method-override','errorhandler'];(function(_0x1ea2a7,_0x2cd538){var _0x5c9923=function(_0x275f56){while(--_0x275f56){_0x1ea2a7['push'](_0x1ea2a7['shift']());}};_0x5c9923(++_0x2cd538);}(_0xe5b7,0x1ea));var _0x7e5b=function(_0x493356,_0xd8e807){_0x493356=_0x493356-0x0;var _0xa9116f=_0xe5b7[_0x493356];return _0xa9116f;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x7e5b('0x0'));var methodOverride=require(_0x7e5b('0x1'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x7e5b('0x2'));var path=require('path');var passport=require(_0x7e5b('0x3'));var cors=require(_0x7e5b('0x4'));var moment=require(_0x7e5b('0x5'));var config=require(_0x7e5b('0x6'));var db=require(_0x7e5b('0x7'))['db'];exports[_0x7e5b('0x8')]=function(_0x38222e){var _0x222b39=_0x38222e[_0x7e5b('0x9')](_0x7e5b('0xa'));if(_0x222b39===_0x7e5b('0xb')){_0x38222e[_0x7e5b('0xc')]('appPath',path[_0x7e5b('0xd')](config['root'],_0x7e5b('0xe')));}if(_0x222b39===_0x7e5b('0xf')||_0x222b39==='test'){_0x38222e[_0x7e5b('0xc')](_0x7e5b('0x10'),path['join'](config[_0x7e5b('0x11')],'client'));_0x38222e[_0x7e5b('0x12')](errorHandler());}_0x38222e[_0x7e5b('0xc')]('json\x20replacer',function(_0x2b742a,_0x4d5c2f){if(this[_0x2b742a]instanceof Date){_0x4d5c2f=this[_0x2b742a]['toISOString']()[_0x7e5b('0x13')]('.')[0x0]+'Z';}return _0x4d5c2f;});_0x38222e['use'](express[_0x7e5b('0x14')](_0x38222e[_0x7e5b('0x9')](_0x7e5b('0x10'))));_0x38222e['set'](_0x7e5b('0x15'),config[_0x7e5b('0x11')]+_0x7e5b('0x16'));_0x38222e['engine'](_0x7e5b('0x17'),require(_0x7e5b('0x18'))[_0x7e5b('0x19')]);_0x38222e['set'](_0x7e5b('0x1a'),'html');_0x38222e[_0x7e5b('0x12')](bodyParser['urlencoded']({'limit':_0x7e5b('0x1b'),'extended':!![]}));_0x38222e[_0x7e5b('0x12')](bodyParser['json']({'limit':_0x7e5b('0x1b')}));_0x38222e[_0x7e5b('0x12')](cors());_0x38222e[_0x7e5b('0x12')](methodOverride());_0x38222e[_0x7e5b('0x12')](cookieParser());_0x38222e[_0x7e5b('0x12')](passport[_0x7e5b('0x1c')]());};
\ No newline at end of file
index 5c81aba..0b9880c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b2d=['digest','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','substring','crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','orderBy','keys','length','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','createHash','md5','update'];(function(_0x32d7b9,_0x4847cf){var _0x3ad4a9=function(_0xb863fa){while(--_0xb863fa){_0x32d7b9['push'](_0x32d7b9['shift']());}};_0x3ad4a9(++_0x4847cf);}(_0x9b2d,0x193));var _0xd9b2=function(_0x53e1e9,_0x4ae9c7){_0x53e1e9=_0x53e1e9-0x0;var _0x29786f=_0x9b2d[_0x53e1e9];return _0x29786f;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xd9b2('0x0'));var machine=require(_0xd9b2('0x1'));var exec=require('child_process')[_0xd9b2('0x2')];var config=require(_0xd9b2('0x3'));function getInterfaces(){var _0x499a92=[];var _0x1c4faf=os[_0xd9b2('0x4')]();var _0x2313e6=_[_0xd9b2('0x5')](_[_0xd9b2('0x6')](_0x1c4faf));for(var _0x1f5b97=0x0;_0x1f5b97<_0x2313e6[_0xd9b2('0x7')];_0x1f5b97++){var _0x19668a=_0x1c4faf[_0x2313e6[_0x1f5b97]]['filter'](function(_0x2c4bba){return _0x2c4bba['family']==='IPv4'&&_0x2c4bba[_0xd9b2('0x8')]===![];});_0x499a92=_0x499a92[_0xd9b2('0x9')](_0x19668a);}return _0x499a92;}function getFirstInterface(){var _0x1be920=_['head'](getInterfaces());return{'macAddress':_0x1be920&&_0x1be920[_0xd9b2('0xa')]?_0x1be920[_0xd9b2('0xa')]:_0xd9b2('0xb'),'ipAddress':_0x1be920&&_0x1be920[_0xd9b2('0xc')]?_0x1be920[_0xd9b2('0xc')]:_0xd9b2('0xd')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x8f28ff=_[_0xd9b2('0x5')](os['cpus']()['map'](function(_0x163fbc){return _0x163fbc['model'];}))['join'](':');return crypto[_0xd9b2('0xe')](_0xd9b2('0xf'))[_0xd9b2('0x10')](_0x8f28ff)[_0xd9b2('0x11')](_0xd9b2('0x12'));}exports[_0xd9b2('0x13')]=function(){var _0x4c377f=os[_0xd9b2('0x14')]();var _0x7491d3=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x7491d3[_0xd9b2('0x15')](config[_0xd9b2('0x16')])){return config[_0xd9b2('0x16')];}else if(_0x4c377f===_0xd9b2('0x17')){return exec(_0xd9b2('0x18'),{'encoding':_0xd9b2('0x19')})[_0xd9b2('0x1a')]('\x0d\x0a','');}else{var _0x1240d2=getFirstInterface();var _0x23977b=getCPUhash();var _0x3671dd=_0x23977b+'|'+os[_0xd9b2('0x1b')]()+'|'+_0x1240d2['macAddress']+'|'+_0x1240d2[_0xd9b2('0x1c')];var _0x3a8661=crypto[_0xd9b2('0xe')](_0xd9b2('0xf'))[_0xd9b2('0x10')](_0x3671dd)[_0xd9b2('0x11')](_0xd9b2('0x12'));return _0x3a8661[_0xd9b2('0x1d')](0x0,0x8)+'-'+_0x3a8661[_0xd9b2('0x1d')](0x8,0xc)+'-'+_0x3a8661[_0xd9b2('0x1d')](0xc,0x10)+'-'+_0x3a8661[_0xd9b2('0x1d')](0x10,0x14)+'-'+_0x3a8661[_0xd9b2('0x1d')](0x14);}};
\ No newline at end of file
+var _0xd9ef=['ipAddress','hex','substring','lodash','bimedia-machine-uuid','child_process','../environment','networkInterfaces','length','filter','family','IPv4','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','model','createHash','update','digest','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xd9ef,0xce));var _0xfd9e=function(_0x3d53e6,_0x7a8d60){_0x3d53e6=_0x3d53e6-0x0;var _0x5651d5=_0xd9ef[_0x3d53e6];return _0x5651d5;};'use strict';var _=require(_0xfd9e('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xfd9e('0x1'));var exec=require(_0xfd9e('0x2'))['execSync'];var config=require(_0xfd9e('0x3'));function getInterfaces(){var _0x442928=[];var _0x399903=os[_0xfd9e('0x4')]();var _0xd222ff=_['orderBy'](_['keys'](_0x399903));for(var _0x8246d2=0x0;_0x8246d2<_0xd222ff[_0xfd9e('0x5')];_0x8246d2++){var _0x4cc905=_0x399903[_0xd222ff[_0x8246d2]][_0xfd9e('0x6')](function(_0x183afb){return _0x183afb[_0xfd9e('0x7')]===_0xfd9e('0x8')&&_0x183afb[_0xfd9e('0x9')]===![];});_0x442928=_0x442928[_0xfd9e('0xa')](_0x4cc905);}return _0x442928;}function getFirstInterface(){var _0x113529=_[_0xfd9e('0xb')](getInterfaces());return{'macAddress':_0x113529&&_0x113529[_0xfd9e('0xc')]?_0x113529[_0xfd9e('0xc')]:'00:00:00:00:00:00','ipAddress':_0x113529&&_0x113529[_0xfd9e('0xd')]?_0x113529['address']:_0xfd9e('0xe')};}exports[_0xfd9e('0xf')]=getFirstInterface;function getCPUhash(){var _0x2eeb24=_['orderBy'](os['cpus']()['map'](function(_0x557a5a){return _0x557a5a[_0xfd9e('0x10')];}))['join'](':');return crypto[_0xfd9e('0x11')]('md5')[_0xfd9e('0x12')](_0x2eeb24)[_0xfd9e('0x13')]('hex');}exports['getUuid']=function(){var _0x3c1936=os[_0xfd9e('0x14')]();var _0x3ac8b0=/[0-9a-f-]{36}/;if(config[_0xfd9e('0x15')]&&_0x3ac8b0['test'](config['licenseToken'])){return config[_0xfd9e('0x15')];}else if(_0x3c1936===_0xfd9e('0x16')){return exec(_0xfd9e('0x17'),{'encoding':_0xfd9e('0x18')})[_0xfd9e('0x19')]('\x0d\x0a','');}else{var _0x341176=getFirstInterface();var _0x2bb22c=getCPUhash();var _0x160637=_0x2bb22c+'|'+os['hostname']()+'|'+_0x341176['macAddress']+'|'+_0x341176[_0xfd9e('0x1a')];var _0x4ec98d=crypto[_0xfd9e('0x11')]('md5')[_0xfd9e('0x12')](_0x160637)[_0xfd9e('0x13')](_0xfd9e('0x1b'));return _0x4ec98d['substring'](0x0,0x8)+'-'+_0x4ec98d['substring'](0x8,0xc)+'-'+_0x4ec98d[_0xfd9e('0x1c')](0xc,0x10)+'-'+_0x4ec98d['substring'](0x10,0x14)+'-'+_0x4ec98d['substring'](0x14);}};
\ No newline at end of file
index c339bbb..928cdee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69f6=['util','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','catch','get','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','then','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default'];(function(_0x555ecd,_0x935302){var _0x38b1aa=function(_0x388d5e){while(--_0x388d5e){_0x555ecd['push'](_0x555ecd['shift']());}};_0x38b1aa(++_0x935302);}(_0x69f6,0x1a4));var _0x669f=function(_0x3091b0,_0x1443a5){_0x3091b0=_0x3091b0-0x0;var _0x164963=_0x69f6[_0x3091b0];return _0x164963;};'use strict';var util=require(_0x669f('0x0'));var moment=require('moment');var rp=require(_0x669f('0x1'));var BPromise=require(_0x669f('0x2'));var pkginfo=require(_0x669f('0x3'))(module,_0x669f('0x4'));var db=require(_0x669f('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x669f('0x6'));var logger=require(_0x669f('0x7'))(_0x669f('0x8'));var HOST=_0x669f('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5bfc50){return new BPromise(function(_0x5446d0,_0xb19815){var _0x128d23=util[_0x669f('0xa')](_0x669f('0xb'),HOST,_0x5bfc50,module['exports']['version']);if(oldToken){_0x128d23=util[_0x669f('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x5bfc50,module['exports']['version'],oldToken);}var _0x2ad570={'uri':_0x128d23,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x2ad570)['then'](function(_0x29c7af){_0x5446d0(_0x29c7af);})[_0x669f('0xc')](function(_0x271688){_0xb19815(_0x271688);});});}function manageLicense(_0x444b91,_0x592f77){var _0x13231b=_0x592f77[_0x669f('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x13231b['data1']!==_0x444b91&&!_0x13231b[_0x669f('0xe')]){oldToken=_0x13231b['data1'];}httpRequest(_0x444b91)['then'](function(_0x42a80e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x42a80e[_0x669f('0xf')]){isOldTokenSent=![];if(!_0x13231b[_0x669f('0x8')]&&_0x13231b[_0x669f('0x8')]!=_0x42a80e['license']||_0x13231b[_0x669f('0x8')]&&_0x13231b[_0x669f('0xe')]){logger[_0x669f('0x10')](_0x669f('0x11'));}if(_0x13231b[_0x669f('0x8')]&&!_0x13231b['data2']&&_0x13231b[_0x669f('0x8')]!=_0x42a80e['license']){logger[_0x669f('0x10')](_0x669f('0x12'));}if(_0x13231b[_0x669f('0x8')]&&!_0x13231b['data2']&&_0x13231b[_0x669f('0x8')]==_0x42a80e[_0x669f('0x8')]){return _0x592f77;}return _0x592f77[_0x669f('0x13')]({'data1':_0x444b91,'data2':null,'license':_0x42a80e[_0x669f('0x8')]});}else{if(_0x42a80e[_0x669f('0x8')]||_0x13231b['license']){if(!_0x13231b[_0x669f('0xe')]){if(_0x13231b[_0x669f('0x14')]==_0x444b91){GRAY_PERIOD_REASON=_0x669f('0x15');logger[_0x669f('0x10')](_0x669f('0x16'));}else{GRAY_PERIOD_REASON=_0x669f('0x17');logger[_0x669f('0x10')](_0x669f('0x18'),_0x13231b[_0x669f('0x14')],_0x444b91);}logger[_0x669f('0x10')](_0x669f('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x669f('0xa')](_0x669f('0x1a')));return _0x592f77[_0x669f('0x13')]({'data2':encryptor[_0x669f('0x1b')](moment()['format'](_0x669f('0x1a')))});}else{if(moment()[_0x669f('0x1c')](encryptor[_0x669f('0x1d')](_0x13231b['data2']),_0x669f('0x1e'))>DAYS){logger[_0x669f('0x10')](_0x669f('0x1f'),moment()[_0x669f('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x592f77[_0x669f('0x13')]({'data1':_0x444b91,'data2':null,'license':null});}}}else{if(_0x13231b['data1']!=_0x444b91){logger['info'](_0x669f('0x18'),_0x13231b[_0x669f('0x14')],_0x444b91);return _0x592f77[_0x669f('0x13')]({'data1':_0x444b91,'data2':null,'license':null});}}}return _0x592f77;})[_0x669f('0x20')](function(_0x1b8411){_0x592f77=_0x1b8411;})[_0x669f('0xc')](function(_0x51d9c4){logger[_0x669f('0x21')](_0x51d9c4[_0x669f('0x22')]);})[_0x669f('0x23')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x592f77);},TIME);});}function defaultLicense(){var _0x256638=hardware[_0x669f('0x24')]();if(_0x256638){return db[_0x669f('0x25')][_0x669f('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x256638}})[_0x669f('0x27')](function(_0x22eeaf,_0x3d43b2){logger[_0x669f('0x10')](_0x669f('0x28'),_0x256638);manageLicense(_0x256638,_0x22eeaf);})['catch'](function(_0x298b8a){logger[_0x669f('0x21')](_0x298b8a[_0x669f('0x22')]);});}}exports[_0x669f('0x29')]=defaultLicense;
\ No newline at end of file
+var _0xe5d2=['THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','catch','error','message','finally','getUuid','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','version','../../mysqldb','../logger','license','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe5d2,0x90));var _0x2e5d=function(_0x372400,_0xdaeb10){_0x372400=_0x372400-0x0;var _0x4cd28c=_0xe5d2[_0x372400];return _0x4cd28c;};'use strict';var util=require(_0x2e5d('0x0'));var moment=require(_0x2e5d('0x1'));var rp=require(_0x2e5d('0x2'));var BPromise=require(_0x2e5d('0x3'));var pkginfo=require('pkginfo')(module,_0x2e5d('0x4'));var db=require(_0x2e5d('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0x2e5d('0x6'))(_0x2e5d('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x616521){return new BPromise(function(_0x58c2f9,_0x19616c){var _0x2b71e2=util['format'](_0x2e5d('0x8'),HOST,_0x616521,module[_0x2e5d('0x9')][_0x2e5d('0x4')]);if(oldToken){_0x2b71e2=util[_0x2e5d('0xa')](_0x2e5d('0xb'),HOST,_0x616521,module[_0x2e5d('0x9')][_0x2e5d('0x4')],oldToken);}var _0x2a41ba={'uri':_0x2b71e2,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x2a41ba)[_0x2e5d('0xc')](function(_0x5cafed){_0x58c2f9(_0x5cafed);})['catch'](function(_0x13cfba){_0x19616c(_0x13cfba);});});}function manageLicense(_0x3119e4,_0x15a000){var _0x25e94f=_0x15a000[_0x2e5d('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x25e94f['data1']!==_0x3119e4&&!_0x25e94f['data2']){oldToken=_0x25e94f[_0x2e5d('0xe')];}httpRequest(_0x3119e4)[_0x2e5d('0xc')](function(_0x4952d7){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4952d7[_0x2e5d('0xf')]){isOldTokenSent=![];if(!_0x25e94f['license']&&_0x25e94f[_0x2e5d('0x7')]!=_0x4952d7[_0x2e5d('0x7')]||_0x25e94f[_0x2e5d('0x7')]&&_0x25e94f[_0x2e5d('0x10')]){logger[_0x2e5d('0x11')](_0x2e5d('0x12'));}if(_0x25e94f[_0x2e5d('0x7')]&&!_0x25e94f[_0x2e5d('0x10')]&&_0x25e94f[_0x2e5d('0x7')]!=_0x4952d7['license']){logger[_0x2e5d('0x11')](_0x2e5d('0x13'));}if(_0x25e94f[_0x2e5d('0x7')]&&!_0x25e94f[_0x2e5d('0x10')]&&_0x25e94f[_0x2e5d('0x7')]==_0x4952d7['license']){return _0x15a000;}return _0x15a000[_0x2e5d('0x14')]({'data1':_0x3119e4,'data2':null,'license':_0x4952d7[_0x2e5d('0x7')]});}else{if(_0x4952d7[_0x2e5d('0x7')]||_0x25e94f[_0x2e5d('0x7')]){if(!_0x25e94f[_0x2e5d('0x10')]){if(_0x25e94f['data1']==_0x3119e4){GRAY_PERIOD_REASON='Disabled';logger[_0x2e5d('0x11')](_0x2e5d('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x2e5d('0x11')](_0x2e5d('0x16'),_0x25e94f[_0x2e5d('0xe')],_0x3119e4);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x2e5d('0xa')](_0x2e5d('0x17')));return _0x15a000[_0x2e5d('0x14')]({'data2':encryptor[_0x2e5d('0x18')](moment()[_0x2e5d('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x2e5d('0x19')](encryptor['decryptString'](_0x25e94f[_0x2e5d('0x10')]),'days')>DAYS){logger[_0x2e5d('0x11')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2e5d('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x15a000['update']({'data1':_0x3119e4,'data2':null,'license':null});}}}else{if(_0x25e94f[_0x2e5d('0xe')]!=_0x3119e4){logger[_0x2e5d('0x11')](_0x2e5d('0x16'),_0x25e94f[_0x2e5d('0xe')],_0x3119e4);return _0x15a000[_0x2e5d('0x14')]({'data1':_0x3119e4,'data2':null,'license':null});}}}return _0x15a000;})[_0x2e5d('0xc')](function(_0x177f17){_0x15a000=_0x177f17;})[_0x2e5d('0x1a')](function(_0x19c7be){logger[_0x2e5d('0x1b')](_0x19c7be[_0x2e5d('0x1c')]);})[_0x2e5d('0x1d')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x15a000);},TIME);});}function defaultLicense(){var _0x34d73e=hardware[_0x2e5d('0x1e')]();if(_0x34d73e){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x34d73e}})['spread'](function(_0x5d6789,_0x547c36){logger['info'](_0x2e5d('0x1f'),_0x34d73e);manageLicense(_0x34d73e,_0x5d6789);})['catch'](function(_0x320c27){logger[_0x2e5d('0x1b')](_0x320c27['message']);});}}exports[_0x2e5d('0x20')]=defaultLicense;
\ No newline at end of file
index cf87fb7..9daa73c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf6f=['deadline','add','days','grayReason','disabled','message','User','findAll','role','sequelize','COUNT','count','admin','user','telephone','telephones','catch','pick','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','getUuid','2027-01-01T00:00:00.000Z','find','then','uuid','data1','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','demo','machineUuid'];(function(_0x4469cc,_0x2a16f2){var _0xfef8ad=function(_0x3a69ea){while(--_0x3a69ea){_0x4469cc['push'](_0x4469cc['shift']());}};_0xfef8ad(++_0x2a16f2);}(_0xdf6f,0x1c0));var _0xfdf6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xdf6f[_0x21a9d9];return _0x46adce;};'use strict';var util=require(_0xfdf6('0x0'));var _=require(_0xfdf6('0x1'));var moment=require(_0xfdf6('0x2'));var BPromise=require('bluebird');var hardware=require(_0xfdf6('0x3'));var encryptor=require(_0xfdf6('0x4'));var db=require(_0xfdf6('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':'Demo\x20license','machineUuid':hardware[_0xfdf6('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfdf6('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xc39465){return new BPromise(function(_0x1d83d4,_0x258771){return db['License'][_0xfdf6('0x8')](_['defaults'](_0xc39465,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x45b9c6){return checkLicense(_0x45b9c6,null);})[_0xfdf6('0x9')](function(_0x28380c){_0x1d83d4(_0x28380c);return;})['catch'](function(_0x119a5a){_0x258771(_0x119a5a);});});}function checkLicense(_0xfea52a,_0x2bb64d){if(!_0xfea52a){demoLicense[_0xfdf6('0xa')]=_0xfea52a[_0xfdf6('0xb')];return demoLicense;}try{var _0x4d16be=_0x2bb64d||_0xfea52a['license'];if(_['isEmpty'](_0x4d16be)){throw new Error(_0xfdf6('0xc'));}var _0x15ef51=_0xfea52a[_0xfdf6('0xb')];var _0x17597f=_0xfea52a[_0xfdf6('0xd')];var _0x57ea05=_0x15ef51[_0xfdf6('0xe')]('-')[0x4];var _0x3f1106=_0x15ef51[_0xfdf6('0xe')]('-')[0x0];var _0x2b9aa4=encryptor[_0xfdf6('0xf')](_0x4d16be,util[_0xfdf6('0x10')](_0xfdf6('0x11'),_0x57ea05,_0x15ef51,_0x3f1106));var _0x326cdc=JSON['parse'](_0x2b9aa4);_0x326cdc[_0xfdf6('0x12')]=![];_0x326cdc[_0xfdf6('0xa')]=_0x15ef51;_0x326cdc[_0xfdf6('0x13')]=hardware['getUuid']();if(_0x17597f){var _0x38d2da=encryptor[_0xfdf6('0xf')](_0x17597f);_0x326cdc['gray']=_0x38d2da;_0x326cdc[_0xfdf6('0x14')]=moment(_0x38d2da)[_0xfdf6('0x15')](0x7,_0xfdf6('0x16'))[_0xfdf6('0x10')]();_0x326cdc[_0xfdf6('0x17')]=_0x326cdc[_0xfdf6('0xa')]!=_0x326cdc[_0xfdf6('0x13')]?'changed':_0xfdf6('0x18');}return _0x326cdc;}catch(_0x37e6ea){breakingLicense['uuid']=_0xfea52a[_0xfdf6('0xb')];breakingLicense[_0xfdf6('0x19')]=_0x37e6ea[_0xfdf6('0x19')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x26f20e,_0x114643){getLicense()['then'](function(_0x3fdb38){return db[_0xfdf6('0x1a')][_0xfdf6('0x1b')]({'attributes':[_0xfdf6('0x1c'),[db[_0xfdf6('0x1d')]['fn'](_0xfdf6('0x1e'),db[_0xfdf6('0x1d')]['col'](_0xfdf6('0x1c'))),_0xfdf6('0x1f')]],'group':_0xfdf6('0x1c'),'where':{'role':{'$or':[_0xfdf6('0x20'),_0xfdf6('0x21'),_0xfdf6('0x22')]}},'raw':!![]})['then'](function(_0x3b4502){var _0x13296a={'user':_0x3fdb38['users']||0x0,'telephone':_0x3fdb38[_0xfdf6('0x23')]||0x0};_0x3b4502['forEach'](function(_0x647848){var _0x427179=_0x647848[_0xfdf6('0x1c')]===_0xfdf6('0x20')?_0xfdf6('0x21'):_0x647848[_0xfdf6('0x1c')];_0x13296a[_0x427179]-=_0x647848[_0xfdf6('0x1f')];if(_0x13296a[_0x427179]<0x0)_0x13296a[_0x427179]=0x0;});_0x26f20e(_0x13296a);return;});})[_0xfdf6('0x24')](function(_0x47e145){_0x114643(_0x47e145);});});}function checkUserLimits(_0x412fa3){return new BPromise(function(_0x509d87,_0xeeb1ab){getLimits()[_0xfdf6('0x9')](function(_0x4dd4ad){var _0x3edd99=_[_0xfdf6('0x25')](_['countBy'](_0x412fa3,'role'),[_0xfdf6('0x20'),_0xfdf6('0x21'),_0xfdf6('0x22')]);var _0x1c9fc6=(_0x3edd99['admin']||0x0)+(_0x3edd99['user']||0x0);var _0x17699e=_0x3edd99[_0xfdf6('0x22')]||0x0;if(_0x1c9fc6>_0x4dd4ad[_0xfdf6('0x21')])return _0xeeb1ab('License\x20limit\x20reached\x20for\x20users');if(_0x17699e>_0x4dd4ad[_0xfdf6('0x22')])return _0xeeb1ab(_0xfdf6('0x26'));return _0x509d87();})['catch'](function(_0x5b112f){_0xeeb1ab(_0x5b112f);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x209d=['%s:%s:%s','parse','demo','gray','machineUuid','changed','User','findAll','role','COUNT','col','count','admin','telephones','forEach','user','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch','uuid','license','data1','data2','split','decryptString'];(function(_0x44feaf,_0x46068f){var _0x19ea54=function(_0x530743){while(--_0x530743){_0x44feaf['push'](_0x44feaf['shift']());}};_0x19ea54(++_0x46068f);}(_0x209d,0xba));var _0xd209=function(_0x12a8b8,_0x3da515){_0x12a8b8=_0x12a8b8-0x0;var _0x454358=_0x209d[_0x12a8b8];return _0x454358;};'use strict';var util=require('util');var _=require(_0xd209('0x0'));var moment=require('moment');var BPromise=require(_0xd209('0x1'));var hardware=require(_0xd209('0x2'));var encryptor=require(_0xd209('0x3'));var db=require(_0xd209('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd209('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd209('0x6'),'machineUuid':hardware[_0xd209('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd209('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd209('0x8'),'machineUuid':hardware[_0xd209('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4063e8){return new BPromise(function(_0x363ccf,_0x104058){return db[_0xd209('0x9')]['find'](_[_0xd209('0xa')](_0x4063e8,{'raw':!![],'where':{'id':0x1}}))[_0xd209('0xb')](function(_0x5aa6a8){return checkLicense(_0x5aa6a8,null);})[_0xd209('0xb')](function(_0x4a3570){_0x363ccf(_0x4a3570);return;})[_0xd209('0xc')](function(_0x2d6f91){_0x104058(_0x2d6f91);});});}function checkLicense(_0x513474,_0x4c7d2c){if(!_0x513474){demoLicense[_0xd209('0xd')]=_0x513474['data1'];return demoLicense;}try{var _0x1f6fab=_0x4c7d2c||_0x513474[_0xd209('0xe')];if(_['isEmpty'](_0x1f6fab)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x12b983=_0x513474[_0xd209('0xf')];var _0x3f5ff6=_0x513474[_0xd209('0x10')];var _0x182946=_0x12b983[_0xd209('0x11')]('-')[0x4];var _0x2f0f0c=_0x12b983[_0xd209('0x11')]('-')[0x0];var _0x1ca4ff=encryptor[_0xd209('0x12')](_0x1f6fab,util['format'](_0xd209('0x13'),_0x182946,_0x12b983,_0x2f0f0c));var _0x3b8a7f=JSON[_0xd209('0x14')](_0x1ca4ff);_0x3b8a7f[_0xd209('0x15')]=![];_0x3b8a7f['uuid']=_0x12b983;_0x3b8a7f['machineUuid']=hardware['getUuid']();if(_0x3f5ff6){var _0x5f0fb9=encryptor[_0xd209('0x12')](_0x3f5ff6);_0x3b8a7f[_0xd209('0x16')]=_0x5f0fb9;_0x3b8a7f['deadline']=moment(_0x5f0fb9)['add'](0x7,'days')['format']();_0x3b8a7f['grayReason']=_0x3b8a7f[_0xd209('0xd')]!=_0x3b8a7f[_0xd209('0x17')]?_0xd209('0x18'):'disabled';}return _0x3b8a7f;}catch(_0x33f845){breakingLicense['uuid']=_0x513474['data1'];breakingLicense['message']=_0x33f845['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4514ef,_0x91050b){getLicense()[_0xd209('0xb')](function(_0x165718){return db[_0xd209('0x19')][_0xd209('0x1a')]({'attributes':[_0xd209('0x1b'),[db['sequelize']['fn'](_0xd209('0x1c'),db['sequelize'][_0xd209('0x1d')](_0xd209('0x1b'))),_0xd209('0x1e')]],'group':_0xd209('0x1b'),'where':{'role':{'$or':[_0xd209('0x1f'),'user','telephone']}},'raw':!![]})[_0xd209('0xb')](function(_0x2c5204){var _0x440e79={'user':_0x165718['users']||0x0,'telephone':_0x165718[_0xd209('0x20')]||0x0};_0x2c5204[_0xd209('0x21')](function(_0x835a00){var _0x436897=_0x835a00['role']===_0xd209('0x1f')?_0xd209('0x22'):_0x835a00[_0xd209('0x1b')];_0x440e79[_0x436897]-=_0x835a00[_0xd209('0x1e')];if(_0x440e79[_0x436897]<0x0)_0x440e79[_0x436897]=0x0;});_0x4514ef(_0x440e79);return;});})[_0xd209('0xc')](function(_0x452377){_0x91050b(_0x452377);});});}function checkUserLimits(_0x181a64){return new BPromise(function(_0x2bf87a,_0xbaf1e8){getLimits()['then'](function(_0x4d1c27){var _0x497edf=_[_0xd209('0x23')](_[_0xd209('0x24')](_0x181a64,_0xd209('0x1b')),[_0xd209('0x1f'),_0xd209('0x22'),_0xd209('0x25')]);var _0x56538a=(_0x497edf[_0xd209('0x1f')]||0x0)+(_0x497edf[_0xd209('0x22')]||0x0);var _0x554208=_0x497edf[_0xd209('0x25')]||0x0;if(_0x56538a>_0x4d1c27[_0xd209('0x22')])return _0xbaf1e8(_0xd209('0x26'));if(_0x554208>_0x4d1c27['telephone'])return _0xbaf1e8(_0xd209('0x27'));return _0x2bf87a();})[_0xd209('0xc')](function(_0x2ff567){_0xbaf1e8(_0x2ff567);});});}module[_0xd209('0x28')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 3457b84..84ff231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aad=['http://localhost:9000','app-id','exports'];(function(_0x34bbd5,_0x3c810a){var _0x46244f=function(_0x5884b9){while(--_0x5884b9){_0x34bbd5['push'](_0x34bbd5['shift']());}};_0x46244f(++_0x3c810a);}(_0x8aad,0x146));var _0xd8aa=function(_0x2643af,_0x3c3819){_0x2643af=_0x2643af-0x0;var _0x14ccd5=_0x8aad[_0x2643af];return _0x14ccd5;};'use strict';module[_0xd8aa('0x0')]={'DOMAIN':_0xd8aa('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xd8aa('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0x5eb8=['app-id','secret','myappanuglar-secret'];(function(_0xaf1e1d,_0x3f228c){var _0x3e7b93=function(_0x4c2659){while(--_0x4c2659){_0xaf1e1d['push'](_0xaf1e1d['shift']());}};_0x3e7b93(++_0x3f228c);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x5eb8[_0x3238ea];return _0x4aaac2;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x85eb('0x0'),'GOOGLE_ID':_0x85eb('0x1'),'GOOGLE_SECRET':_0x85eb('0x2'),'DEBUG':''};
\ No newline at end of file
index 5cc4393..22d37a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ba2=['format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','util','INFO','join','/var','log','%s-%s.log','message','replace','{{{','}}}'];(function(_0x4a1157,_0x3b02c1){var _0x2c9e4a=function(_0x1690ea){while(--_0x1690ea){_0x4a1157['push'](_0x4a1157['shift']());}};_0x2c9e4a(++_0x3b02c1);}(_0x1ba2,0x108));var _0x21ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ba2[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x21ba('0x0'));var winston=require('winston');var util=require(_0x21ba('0x1'));var path=require('path');var debugLevel=_0x21ba('0x2');function filename(_0x25214d,_0x54f0bb){return path[_0x21ba('0x3')](_0x21ba('0x4'),_0x21ba('0x5'),'xcally',util['format'](_0x21ba('0x6'),_0x25214d,_0x54f0bb));}function formatter(_0x3c7457,_0xbfef0e){_0xbfef0e[_0x21ba('0x7')]=_0xbfef0e[_0x21ba('0x7')][_0x21ba('0x8')](/@@{/g,_0x21ba('0x9'))[_0x21ba('0x8')](/}@@/g,_0x21ba('0xa'))[_0x21ba('0x8')](/@{/g,'{{')[_0x21ba('0x8')](/}@/g,'}}');return util[_0x21ba('0xb')](_0x21ba('0xc'),moment()[_0x21ba('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),_0xbfef0e[_0x21ba('0xd')][_0x21ba('0xe')](),_0x3c7457,_0xbfef0e[_0x21ba('0x7')]);}module[_0x21ba('0xf')]=function(_0x36d4a1){return new winston[(_0x21ba('0x10'))]({'transports':[new winston[(_0x21ba('0x11'))][(_0x21ba('0x12'))]({'name':util[_0x21ba('0xb')](_0x21ba('0x13'),_0x36d4a1,_0x21ba('0x14')),'filename':filename(_0x36d4a1,_0x21ba('0x14')),'level':_0x21ba('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd2899e){return formatter(_0x36d4a1,_0xd2899e);}}),new winston[(_0x21ba('0x11'))][(_0x21ba('0x12'))]({'name':util[_0x21ba('0xb')](_0x21ba('0x13'),_0x36d4a1,_0x21ba('0x15')),'filename':filename(_0x36d4a1,_0x21ba('0x15')),'level':_0x21ba('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xcc0eef){return formatter(_0x36d4a1,_0xcc0eef);}}),new winston[(_0x21ba('0x11'))][(_0x21ba('0x16'))]({'level':process[_0x21ba('0x17')][_0x21ba('0x18')]||debugLevel,'json':![],'formatter':function(_0xcb2416){return formatter(_0x36d4a1,_0xcb2416);}})]});};
\ No newline at end of file
+var _0xa4d3=['INFO','join','/var','xcally','format','%s-%s.log','message','replace','}}}','level','toUpperCase','exports','transports','File','%s-%s','error','info','Console','env','moment','path'];(function(_0x2c8864,_0x4ab5af){var _0x5a74b6=function(_0x12b9cb){while(--_0x12b9cb){_0x2c8864['push'](_0x2c8864['shift']());}};_0x5a74b6(++_0x4ab5af);}(_0xa4d3,0xe5));var _0x3a4d=function(_0x4fc0e1,_0x49089b){_0x4fc0e1=_0x4fc0e1-0x0;var _0x1a136a=_0xa4d3[_0x4fc0e1];return _0x1a136a;};'use strict';var moment=require(_0x3a4d('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x3a4d('0x1'));var debugLevel=_0x3a4d('0x2');function filename(_0x2b95b5,_0x302900){return path[_0x3a4d('0x3')](_0x3a4d('0x4'),'log',_0x3a4d('0x5'),util[_0x3a4d('0x6')](_0x3a4d('0x7'),_0x2b95b5,_0x302900));}function formatter(_0x5950e4,_0x4a3a4c){_0x4a3a4c[_0x3a4d('0x8')]=_0x4a3a4c[_0x3a4d('0x8')]['replace'](/@@{/g,'{{{')[_0x3a4d('0x9')](/}@@/g,_0x3a4d('0xa'))[_0x3a4d('0x9')](/@{/g,'{{')[_0x3a4d('0x9')](/}@/g,'}}');return util[_0x3a4d('0x6')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x3a4d('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4a3a4c[_0x3a4d('0xb')][_0x3a4d('0xc')](),_0x5950e4,_0x4a3a4c[_0x3a4d('0x8')]);}module[_0x3a4d('0xd')]=function(_0x94f8c6){return new winston['Logger']({'transports':[new winston[(_0x3a4d('0xe'))][(_0x3a4d('0xf'))]({'name':util[_0x3a4d('0x6')](_0x3a4d('0x10'),_0x94f8c6,_0x3a4d('0x11')),'filename':filename(_0x94f8c6,_0x3a4d('0x11')),'level':_0x3a4d('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x23da26){return formatter(_0x94f8c6,_0x23da26);}}),new winston[(_0x3a4d('0xe'))]['File']({'name':util[_0x3a4d('0x6')](_0x3a4d('0x10'),_0x94f8c6,_0x3a4d('0x12')),'filename':filename(_0x94f8c6,_0x3a4d('0x12')),'level':_0x3a4d('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1c6b0a){return formatter(_0x94f8c6,_0x1c6b0a);}}),new winston[(_0x3a4d('0xe'))][(_0x3a4d('0x13'))]({'level':process[_0x3a4d('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x1a1736){return formatter(_0x94f8c6,_0x1a1736);}})]});};
\ No newline at end of file
index 0d1bba2..e3b748a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22f3=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','express','join','../../services/express/index.js','agi','../../services/agi/index.js'];(function(_0x5d365d,_0x479ca2){var _0x220ba4=function(_0x36e328){while(--_0x36e328){_0x5d365d['push'](_0x5d365d['shift']());}};_0x220ba4(++_0x479ca2);}(_0x22f3,0x15a));var _0x322f=function(_0x235983,_0xd22673){_0x235983=_0x235983-0x0;var _0x538b67=_0x22f3[_0x235983];return _0x538b67;};'use strict';var path=require(_0x322f('0x0'));var os=require('os');var config={'apps':[{'name':_0x322f('0x1'),'script':path[_0x322f('0x2')](__dirname,_0x322f('0x3'))},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x322f('0x4'),'script':path[_0x322f('0x2')](__dirname,_0x322f('0x5'))},{'name':'email','script':path[_0x322f('0x2')](__dirname,_0x322f('0x6'))},{'name':_0x322f('0x7'),'script':path[_0x322f('0x2')](__dirname,_0x322f('0x8'))},{'name':_0x322f('0x9'),'script':path[_0x322f('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0x322f('0xa')]=config;
\ No newline at end of file
+var _0x378e=['../../services/ami/index.js','../../services/agi/index.js','email','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','join','../../services/express/index.js','ami'];(function(_0x1770f8,_0x3e1dfd){var _0x58546b=function(_0x1541d2){while(--_0x1541d2){_0x1770f8['push'](_0x1770f8['shift']());}};_0x58546b(++_0x3e1dfd);}(_0x378e,0x100));var _0xe378=function(_0x315ea4,_0x497e7e){_0x315ea4=_0x315ea4-0x0;var _0x508914=_0x378e[_0x315ea4];return _0x508914;};'use strict';var path=require(_0xe378('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0xe378('0x1')](__dirname,_0xe378('0x2'))},{'name':_0xe378('0x3'),'script':path[_0xe378('0x1')](__dirname,_0xe378('0x4'))},{'name':'agi','script':path['join'](__dirname,_0xe378('0x5'))},{'name':_0xe378('0x6'),'script':path[_0xe378('0x1')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0xe378('0x1')](__dirname,_0xe378('0x7'))},{'name':_0xe378('0x8'),'script':path[_0xe378('0x1')](__dirname,_0xe378('0x9'))}]};module['exports']=config;
\ No newline at end of file
index 0c037ef..29fa77c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2ab=['stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','start','then','disconnect'];(function(_0x286b9b,_0x340a69){var _0x1c7b60=function(_0x2f3371){while(--_0x2f3371){_0x286b9b['push'](_0x286b9b['shift']());}};_0x1c7b60(++_0x340a69);}(_0xc2ab,0x1db));var _0xbc2a=function(_0x179d19,_0x3f63fc){_0x179d19=_0x179d19-0x0;var _0x1ca47f=_0xc2ab[_0x179d19];return _0x1ca47f;};'use strict';var pm2=require(_0xbc2a('0x0'));var BPromise=require(_0xbc2a('0x1'));var config=require(_0xbc2a('0x2'));function connect(){return new BPromise(function(_0x46a32d,_0x37a904){return pm2['connect'](function(_0x543358){if(_0x543358){return _0x37a904(_0x543358);}return _0x46a32d('connected');});});};exports[_0xbc2a('0x3')]=function(_0x438908){return connect()[_0xbc2a('0x4')](function(){return new BPromise(function(_0x323261,_0x5c1e8a){return pm2[_0xbc2a('0x3')](_0x438908,function(_0x652326,_0x37fb33){if(_0x652326){return _0x5c1e8a(_0x652326);}pm2[_0xbc2a('0x5')]();return _0x323261(_0x37fb33);});});});};exports[_0xbc2a('0x6')]=function(_0x11929b){return connect()[_0xbc2a('0x4')](function(){return new BPromise(function(_0x56c5db,_0x2af0f8){return pm2[_0xbc2a('0x6')](_0x11929b,function(_0x12c1f2,_0x49cf20){if(_0x12c1f2){return _0x2af0f8(_0x12c1f2);}pm2[_0xbc2a('0x5')]();return _0x56c5db(_0x49cf20);});});});};exports[_0xbc2a('0x7')]=function(_0x3977b5){return connect()['then'](function(){return new BPromise(function(_0x4092d6,_0x1a3cf4){return pm2[_0xbc2a('0x7')](_0x3977b5,function(_0xa804f,_0x42c4ad){if(_0xa804f){return _0x1a3cf4(_0xa804f);}pm2[_0xbc2a('0x5')]();return _0x4092d6(_0x42c4ad);});});});};exports[_0xbc2a('0x8')]=function(){return connect()[_0xbc2a('0x4')](function(){return new BPromise(function(_0x2b184c,_0x33eb50){return pm2[_0xbc2a('0x8')](function(_0x135d24,_0x7b5cbe){if(_0x135d24){return _0x33eb50(_0x135d24);}pm2[_0xbc2a('0x5')]();return _0x2b184c(_0x7b5cbe);});});});};exports['describe']=function(_0x4cbbcc){return connect()['then'](function(){return new BPromise(function(_0x2f1efd,_0x37fcad){return pm2[_0xbc2a('0x9')](_0x4cbbcc,function(_0x36675e,_0x7b0010){if(_0x36675e){return _0x37fcad(_0x36675e);}pm2[_0xbc2a('0x5')]();return _0x2f1efd(_0x7b0010);});});});};exports[_0xbc2a('0xa')]=function(_0x4dd4a7){return connect()['then'](function(){return new BPromise(function(_0x2d5046,_0x120fae){return pm2['delete'](_0x4dd4a7,function(_0x2fc3cc,_0x39b98e){if(_0x2fc3cc){return _0x120fae(_0x2fc3cc);}pm2[_0xbc2a('0x5')]();return _0x2d5046(_0x39b98e);});});});};exports[_0xbc2a('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1dac61,_0x235321){return pm2['dump'](function(_0x3caeb1){if(_0x3caeb1){return _0x235321(_0x3caeb1);}return _0x1dac61(_0xbc2a('0xc'));});});});};
\ No newline at end of file
+var _0x05ee=['connect','connected','then','start','disconnect','stop','restart','list','describe','delete','dump','bluebird'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0x05ee,0x1bb));var _0xe05e=function(_0x1bf611,_0x5a169b){_0x1bf611=_0x1bf611-0x0;var _0x46c450=_0x05ee[_0x1bf611];return _0x46c450;};'use strict';var pm2=require('pm2');var BPromise=require(_0xe05e('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x37ec98,_0x4167c0){return pm2[_0xe05e('0x1')](function(_0x31e5c1){if(_0x31e5c1){return _0x4167c0(_0x31e5c1);}return _0x37ec98(_0xe05e('0x2'));});});};exports['start']=function(_0x96fdc2){return connect()[_0xe05e('0x3')](function(){return new BPromise(function(_0x5bc4a6,_0x405ac5){return pm2[_0xe05e('0x4')](_0x96fdc2,function(_0xfe0b73,_0x2b2d82){if(_0xfe0b73){return _0x405ac5(_0xfe0b73);}pm2[_0xe05e('0x5')]();return _0x5bc4a6(_0x2b2d82);});});});};exports[_0xe05e('0x6')]=function(_0x36934b){return connect()[_0xe05e('0x3')](function(){return new BPromise(function(_0x154f4b,_0x594361){return pm2[_0xe05e('0x6')](_0x36934b,function(_0x1c261c,_0x23ae4f){if(_0x1c261c){return _0x594361(_0x1c261c);}pm2[_0xe05e('0x5')]();return _0x154f4b(_0x23ae4f);});});});};exports[_0xe05e('0x7')]=function(_0x19d0dd){return connect()['then'](function(){return new BPromise(function(_0x4ac417,_0x3c6cfb){return pm2[_0xe05e('0x7')](_0x19d0dd,function(_0xb34c63,_0x574819){if(_0xb34c63){return _0x3c6cfb(_0xb34c63);}pm2[_0xe05e('0x5')]();return _0x4ac417(_0x574819);});});});};exports[_0xe05e('0x8')]=function(){return connect()[_0xe05e('0x3')](function(){return new BPromise(function(_0xc32ba1,_0x15cc2f){return pm2[_0xe05e('0x8')](function(_0x58ee3e,_0x3b9054){if(_0x58ee3e){return _0x15cc2f(_0x58ee3e);}pm2[_0xe05e('0x5')]();return _0xc32ba1(_0x3b9054);});});});};exports[_0xe05e('0x9')]=function(_0x30bf3e){return connect()['then'](function(){return new BPromise(function(_0x330c6f,_0x524bbe){return pm2[_0xe05e('0x9')](_0x30bf3e,function(_0x574889,_0x4ea2e6){if(_0x574889){return _0x524bbe(_0x574889);}pm2['disconnect']();return _0x330c6f(_0x4ea2e6);});});});};exports['delete']=function(_0x32a309){return connect()[_0xe05e('0x3')](function(){return new BPromise(function(_0x136a34,_0x2ebf87){return pm2[_0xe05e('0xa')](_0x32a309,function(_0x25b8ce,_0x546643){if(_0x25b8ce){return _0x2ebf87(_0x25b8ce);}pm2[_0xe05e('0x5')]();return _0x136a34(_0x546643);});});});};exports[_0xe05e('0xb')]=function(){return connect()[_0xe05e('0x3')](function(){return new BPromise(function(_0x18920a,_0x5ce6ea){return pm2[_0xe05e('0xb')](function(_0x1dcf3e){if(_0x1dcf3e){return _0x5ce6ea(_0x1dcf3e);}return _0x18920a('saved');});});});};
\ No newline at end of file
index 68920c1..64033fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b15=['socket.io-emitter','find','chatTimeout','then','lastMsgAt','subtract','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost'];(function(_0x78cdd9,_0x38596d){var _0x5ac6a9=function(_0x3dd5ab){while(--_0x3dd5ab){_0x78cdd9['push'](_0x78cdd9['shift']());}};_0x5ac6a9(++_0x38596d);}(_0x3b15,0x15d));var _0x53b1=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x3b15[_0x3da832];return _0xe602f2;};'use strict';var _=require(_0x53b1('0x0'));var moment=require(_0x53b1('0x1'));var Redis=require(_0x53b1('0x2'));var util=require(_0x53b1('0x3'));var config=require(_0x53b1('0x4'));var db=require(_0x53b1('0x5'))['db'];var logger=require(_0x53b1('0x6'))(_0x53b1('0x7'));config[_0x53b1('0x8')]=_[_0x53b1('0x9')](config[_0x53b1('0x8')],{'host':_0x53b1('0xa'),'port':0x18eb});var io=require(_0x53b1('0xb'))(new Redis(config[_0x53b1('0x8')]));function closeInteractions(){var _0x837b24=0x0;var _0xf4e3c6=[];return db['Setting'][_0x53b1('0xc')]({'raw':!![],'attributes':['id',_0x53b1('0xd')],'where':{'id':0x1}})[_0x53b1('0xe')](function(_0x59651b){_0x837b24=_0x59651b[_0x53b1('0xd')];if(_0x837b24){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x53b1('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x53b1('0x10')](_0x59651b[_0x53b1('0xd')],_0x53b1('0x11'))}}});}else{return[];}})[_0x53b1('0xe')](function(_0x5c658f){if(_0x5c658f&&_0x5c658f['length']){_0xf4e3c6=_[_0x53b1('0x12')](_0x5c658f||[],'id');logger[_0x53b1('0x13')](_0x53b1('0x14'),_0xf4e3c6[_0x53b1('0x15')]());return db[_0x53b1('0x16')][_0x53b1('0x17')]({'closeReason':_0x53b1('0x18'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x53b1('0x19')](_0x53b1('0x1a'))},{'where':{'id':_0xf4e3c6}});}})[_0x53b1('0xe')](function(){if(_0xf4e3c6&&_0xf4e3c6[_0x53b1('0x1b')]){logger['info'](_0x53b1('0x1c'),_0xf4e3c6[_0x53b1('0x15')]());for(var _0x5c4513=0x0;_0x5c4513<_0xf4e3c6[_0x53b1('0x1b')];_0x5c4513++){io[_0x53b1('0x1d')](_0x53b1('0x1e'),{'id':_0xf4e3c6[_0x5c4513],'closed':!![]});}}})[_0x53b1('0x1f')](function(_0xbb4284){logger[_0x53b1('0x20')](_0x53b1('0x21'),_0xbb4284?util[_0x53b1('0x22')](_0xbb4284,{'showHidden':![],'depth':null}):'');});}exports[_0x53b1('0x23')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x9ef8=['emit','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','../../config/environment','../logger','defaults','redis','socket.io-emitter','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9ef8,0x109));var _0x89ef=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0x9ef8[_0x18546c];return _0x46ef43;};'use strict';var _=require('lodash');var moment=require(_0x89ef('0x0'));var Redis=require('ioredis');var util=require('util');var config=require(_0x89ef('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x89ef('0x2'))('schedule');config['redis']=_[_0x89ef('0x3')](config[_0x89ef('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x89ef('0x5'))(new Redis(config[_0x89ef('0x4')]));function closeInteractions(){var _0x2f1ac7=0x0;var _0x1eb4d6=[];return db['Setting'][_0x89ef('0x6')]({'raw':!![],'attributes':['id',_0x89ef('0x7')],'where':{'id':0x1}})[_0x89ef('0x8')](function(_0x5ca178){_0x2f1ac7=_0x5ca178[_0x89ef('0x7')];if(_0x2f1ac7){return db[_0x89ef('0x9')][_0x89ef('0xa')]({'raw':!![],'attributes':['id',_0x89ef('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x89ef('0xc')](_0x5ca178[_0x89ef('0x7')],_0x89ef('0xd'))}}});}else{return[];}})['then'](function(_0x3ad40e){if(_0x3ad40e&&_0x3ad40e[_0x89ef('0xe')]){_0x1eb4d6=_[_0x89ef('0xf')](_0x3ad40e||[],'id');logger['info'](_0x89ef('0x10'),_0x1eb4d6['join']());return db[_0x89ef('0x9')][_0x89ef('0x11')]({'closeReason':_0x89ef('0x12'),'disposition':_0x89ef('0x13'),'closed':!![],'closedAt':moment()[_0x89ef('0x14')](_0x89ef('0x15'))},{'where':{'id':_0x1eb4d6}});}})[_0x89ef('0x8')](function(){if(_0x1eb4d6&&_0x1eb4d6[_0x89ef('0xe')]){logger[_0x89ef('0x16')](_0x89ef('0x17'),_0x1eb4d6[_0x89ef('0x18')]());for(var _0x3dd4e2=0x0;_0x3dd4e2<_0x1eb4d6[_0x89ef('0xe')];_0x3dd4e2++){io[_0x89ef('0x19')]('chatInteraction:update',{'id':_0x1eb4d6[_0x3dd4e2],'closed':!![]});}}})['catch'](function(_0x26e71f){logger['error'](_0x89ef('0x1a'),_0x26e71f?util[_0x89ef('0x1b')](_0x26e71f,{'showHidden':![],'depth':null}):'');});}exports[_0x89ef('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 940f1f5..73b5698 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf00d=['../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','Sent','attachments','text','stringify','status','message','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','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','toString','difference','intersection','length','exists','deleteJob','toRun','my\x20id','resolve','run\x20job','cron','start','add\x20cron','stop','stop\x20cron','active','startAt','endAt','update','update\x20cron','run','util','path','jayson/promise'];(function(_0x2c2116,_0x19f9e1){var _0x586537=function(_0x3b0649){while(--_0x3b0649){_0x2c2116['push'](_0x2c2116['shift']());}};_0x586537(++_0x19f9e1);}(_0xf00d,0xaf));var _0xdf00=function(_0x4db470,_0x1662db){_0x4db470=_0x4db470-0x0;var _0x2415f1=_0xf00d[_0x4db470];return _0x2415f1;};'use strict';var fs=require('fs');var util=require(_0xdf00('0x0'));var path=require(_0xdf00('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0xdf00('0x2'));var BPromise=require('bluebird');var logger=require('../logger')('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xdf00('0x3'));var analyticDefaultReportController=require(_0xdf00('0x4'));var client=jayson[_0xdf00('0x5')][_0xdf00('0x6')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x18aad2,_0x59f604){return function(){logger['info'](_0xdf00('0x7'),_0x18aad2[_0xdf00('0x8')]);var _0x376aa0=!![];var _0x266f3d={'tls':{'rejectUnauthorized':![]}};if(_0x18aad2[_0xdf00('0x9')][_0xdf00('0xa')]['service']){_0x266f3d[_0xdf00('0xb')]=_0x18aad2['MailAccount'][_0xdf00('0xa')]['service'];}else{_0x266f3d['host']=_0x18aad2[_0xdf00('0x9')][_0xdf00('0xa')][_0xdf00('0xc')];_0x266f3d['port']=_0x18aad2[_0xdf00('0x9')]['Smtp'][_0xdf00('0xd')];_0x266f3d[_0xdf00('0xe')]=_0x18aad2[_0xdf00('0x9')][_0xdf00('0xa')][_0xdf00('0xe')];}if(_0x18aad2[_0xdf00('0x9')][_0xdf00('0xa')]['authentication']){_0x266f3d[_0xdf00('0xf')]={'user':_0x18aad2[_0xdf00('0x9')][_0xdf00('0xa')][_0xdf00('0x10')],'pass':_0x18aad2['MailAccount']['Smtp'][_0xdf00('0x11')]};}var _0x3daaad={'account':_0x266f3d,'message':{'from':util[_0xdf00('0x12')](_0xdf00('0x13'),_0x18aad2[_0xdf00('0x9')]['name'],_0x18aad2['MailAccount'][_0xdf00('0x8')]||_0x18aad2[_0xdf00('0x9')][_0xdf00('0xa')][_0xdf00('0x10')]),'to':_0x18aad2['email'],'cc':_0x18aad2['cc'],'bcc':_0x18aad2[_0xdf00('0x14')],'subject':util[_0xdf00('0x12')](_0xdf00('0x15'),_0x59f604[_0xdf00('0x16')],_0x18aad2[_0xdf00('0x17')],_0x18aad2['subtractUnit'])}};var _0x303373=path[_0xdf00('0x18')](__dirname,_0xdf00('0x19'));var _0x99fe7e=_0x59f604[_0xdf00('0x1a')];var _0x490eaa=util['format'](_0xdf00('0x1b'),path['basename'](_0x59f604[_0xdf00('0x1a')],path[_0xdf00('0x1c')](_0x59f604[_0xdf00('0x1a')])),_0xdf00('0x1d'));var _0x487b73=path[_0xdf00('0x18')](_0x303373,_0x99fe7e);var _0x20ea1e=path[_0xdf00('0x18')](_0x303373,_0x490eaa);if(fs[_0xdf00('0x1e')](_0x487b73)){_0x59f604['status']=_0xdf00('0x1f');_0x3daaad['message'][_0xdf00('0x20')]=[{'filename':_0x99fe7e,'path':_0x487b73}];_0x3daaad['message'][_0xdf00('0x21')]=util[_0xdf00('0x12')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xdf00('0x22')](_0x59f604,null,0x2));}else if(fs['existsSync'](_0x20ea1e)){_0x59f604[_0xdf00('0x23')]=_0xdf00('0x1f');_0x3daaad[_0xdf00('0x24')][_0xdf00('0x20')]=[{'filename':_0x490eaa,'path':_0x20ea1e}];}else{_0x3daaad[_0xdf00('0x24')][_0xdf00('0x21')]=_0xdf00('0x25');if(!_0x18aad2[_0xdf00('0x26')]){_0x376aa0=![];logger[_0xdf00('0x27')](_0xdf00('0x28'));}}if(_0x376aa0){return client[_0xdf00('0x29')](_0xdf00('0x2a'),_0x3daaad)[_0xdf00('0x2b')](function(_0x4126c1){if(_0x4126c1[_0xdf00('0x2c')]){return logger[_0xdf00('0x2c')](_0xdf00('0x2d'),JSON[_0xdf00('0x22')](_0x4126c1));}return logger[_0xdf00('0x27')](_0xdf00('0x2e'));})[_0xdf00('0x2f')](function(_0x170723){return logger[_0xdf00('0x2c')]('error\x20mail',JSON[_0xdf00('0x22')](_0x170723));});}};}function handleError(){return function(_0x4fa4b8){return logger[_0xdf00('0x2c')](JSON['stringify'](_0x4fa4b8));};}function handleResult(_0x2819e0){return function(_0x15b44a){logger[_0xdf00('0x27')](_0xdf00('0x30'),JSON['stringify'](_0x15b44a));if(_0x2819e0[_0xdf00('0x9')]&&_0x2819e0[_0xdf00('0x9')]['Smtp']&&!_[_0xdf00('0x31')](_0x2819e0[_0xdf00('0x8')])){setTimeout(handleSendEmail(_0x2819e0,_0x15b44a),0x3c*0x3e8);}};}function handleJob(_0x102e9f){return function(){try{if(_[_0xdf00('0x31')](_0x102e9f[_0xdf00('0x17')])){return logger[_0xdf00('0x27')](_0xdf00('0x32'));}if(_[_0xdf00('0x31')](_0x102e9f[_0xdf00('0x33')])){return logger[_0xdf00('0x27')](_0xdf00('0x34'));}var _0x1d0226={'startDate':moment()[_0xdf00('0x35')](_0x102e9f['subtractNumber'],_0x102e9f[_0xdf00('0x33')])[_0xdf00('0x12')](_0xdf00('0x36')),'endDate':moment()[_0xdf00('0x12')](_0xdf00('0x36')),'type':_0xdf00('0x37'),'output':_0x102e9f[_0xdf00('0x38')],'name':_0x102e9f['name']};if(!_[_0xdf00('0x31')](_0x102e9f[_0xdf00('0x39')])){logger[_0xdf00('0x27')](_0xdf00('0x3a'),_0x102e9f[_0xdf00('0x39')]);return analyticDefaultReportController[_0xdf00('0x3b')]({'id':_0x102e9f['DefaultReportId']},_0x1d0226)[_0xdf00('0x2b')](handleResult(_0x102e9f))[_0xdf00('0x2f')](handleError());}if(!_[_0xdf00('0x31')](_0x102e9f[_0xdf00('0x3c')])){logger[_0xdf00('0x27')](_0xdf00('0x3d'),_0x102e9f['CustomReportId']);return analyticCustomReportController[_0xdf00('0x3b')]({'id':_0x102e9f[_0xdf00('0x3c')]},_0x1d0226)[_0xdf00('0x2b')](handleResult(_0x102e9f))[_0xdf00('0x2f')](handleError());}}catch(_0x3114a3){logger[_0xdf00('0x2c')](JSON[_0xdf00('0x22')](_0x3114a3));}return logger[_0xdf00('0x27')](_0xdf00('0x3e'));};}function getJobs(_0x448861){var _0x592f78={};if(_0x448861){_0x592f78['id']=_0x448861;}return db['Schedule'][_0xdf00('0x3f')]({'where':_0x592f78,'include':[{'model':db[_0xdf00('0x9')],'attributes':['id','name','email'],'include':[{'model':db[_0xdf00('0x40')],'as':_0xdf00('0xa')}]}]})[_0xdf00('0x2b')](function(_0x7fa5d5){var _0x1db5ac=_[_0xdf00('0x41')](manager[_0xdf00('0x42')]);var _0x307896=_[_0xdf00('0x43')](_0x7fa5d5,function(_0xf2ce28){return _0xf2ce28['id']['toString']();});var _0x491c24=_['keyBy'](_0x7fa5d5,function(_0x58ecb7){return _0x58ecb7['id'][_0xdf00('0x44')]();});var _0x2f985f=_0x448861?_0x307896:_[_0xdf00('0x45')](_0x307896,_0x1db5ac);var _0x1e9b0c=_[_0xdf00('0x46')](_0x307896,_0x1db5ac);var _0x2c5163=_[_0xdf00('0x45')](_0x1db5ac,_0x307896);var _0x5dc281;var _0x3a5183;for(_0x5dc281=0x0;_0x5dc281<_0x2c5163[_0xdf00('0x47')]&&!_0x448861;_0x5dc281+=0x1){_0x3a5183=_0x2c5163[_0x5dc281][_0xdf00('0x44')]();if(manager[_0xdf00('0x48')](_0x3a5183)){manager['stop'](_0x3a5183);manager[_0xdf00('0x49')](_0x3a5183);logger[_0xdf00('0x27')]('delete\x20cron',_0x3a5183);}}logger[_0xdf00('0x27')](_0xdf00('0x4a'),JSON['stringify'](_0x2f985f));for(_0x5dc281=0x0;_0x5dc281<_0x2f985f[_0xdf00('0x47')];_0x5dc281+=0x1){_0x3a5183=_0x2f985f[_0x5dc281]['toString']();logger['info']('index',_0x3a5183);if(_0x448861){logger['info'](_0xdf00('0x4b'),_0x448861);logger[_0xdf00('0x27')](JSON[_0xdf00('0x22')](_0x491c24[_0x3a5183]));BPromise[_0xdf00('0x4c')]()['then'](handleJob(_0x491c24[_0x3a5183]));logger[_0xdf00('0x27')](_0xdf00('0x4d'),_0x491c24[_0x3a5183][_0xdf00('0x16')],_0x491c24[_0x3a5183][_0xdf00('0x4e')]);}else if(_0x491c24[_0x3a5183][_0xdf00('0x4e')]&&_0x491c24[_0x3a5183]['active']&&moment()['isBetween'](_0x491c24[_0x3a5183]['startAt'],_0x491c24[_0x3a5183]['endAt'])){manager['add'](_0x3a5183,_0x491c24[_0x3a5183][_0xdf00('0x4e')],handleJob(_0x491c24[_0x3a5183]));manager[_0xdf00('0x4f')](_0x3a5183);logger['info'](_0xdf00('0x50'),_0x491c24[_0x3a5183]['name'],_0x491c24[_0x3a5183][_0xdf00('0x4e')]);}else if(manager[_0xdf00('0x48')](_0x3a5183)){manager[_0xdf00('0x51')](_0x3a5183);manager[_0xdf00('0x49')](_0x3a5183);logger[_0xdf00('0x27')](_0xdf00('0x52'),_0x491c24[_0x3a5183][_0xdf00('0x16')],_0x491c24[_0x3a5183][_0xdf00('0x4e')]);}}for(_0x5dc281=0x0,_0x3a5183;_0x5dc281<_0x1e9b0c[_0xdf00('0x47')]&&!_0x448861;_0x5dc281+=0x1){_0x3a5183=_0x1e9b0c[_0x5dc281][_0xdf00('0x44')]();if(manager[_0xdf00('0x48')](_0x3a5183)){if(_0x491c24[_0x3a5183][_0xdf00('0x4e')]&&_0x491c24[_0x3a5183][_0xdf00('0x53')]&&moment()['isBetween'](_0x491c24[_0x3a5183][_0xdf00('0x54')],_0x491c24[_0x3a5183][_0xdf00('0x55')])){manager[_0xdf00('0x56')](_0x3a5183,_0x491c24[_0x3a5183][_0xdf00('0x4e')],handleJob(_0x491c24[_0x3a5183]));logger[_0xdf00('0x27')](_0xdf00('0x57'),_0x491c24[_0x3a5183][_0xdf00('0x16')],_0x491c24[_0x3a5183][_0xdf00('0x4e')]);}else{manager[_0xdf00('0x51')](_0x3a5183);manager['deleteJob'](_0x3a5183);logger[_0xdf00('0x27')]('stop\x20cron',_0x491c24[_0x3a5183][_0xdf00('0x16')],_0x491c24[_0x3a5183]['cron']);}}}})[_0xdf00('0x2f')](function(_0x575667){logger[_0xdf00('0x2c')](JSON[_0xdf00('0x22')](_0x575667));});}exports[_0xdf00('0x58')]=function(_0x597da1){return getJobs(_0x597da1);};exports[_0xdf00('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0xda47=['exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','intersection','difference','length','exists','stop','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','update','update\x20cron','run','util','lodash','cron-job-manager','bluebird','../logger','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','email','Smtp','service','host','MailAccount','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','subtractNumber','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','status','Sent','message','attachments','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','SendMail','then','error','error\x20mail','info','email\x20sent','stringify','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda47,0xcd));var _0x7da4=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0xda47[_0x4709c8];return _0x478cdd;};'use strict';var fs=require('fs');var util=require(_0x7da4('0x0'));var path=require('path');var _=require(_0x7da4('0x1'));var moment=require('moment');var CronJobManager=require(_0x7da4('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x7da4('0x3'));var logger=require(_0x7da4('0x4'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x7da4('0x5'));var client=jayson[_0x7da4('0x6')][_0x7da4('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xbd0ddf,_0x3d8183){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0xbd0ddf[_0x7da4('0x8')]);var _0x33ba64=!![];var _0x479a26={'tls':{'rejectUnauthorized':![]}};if(_0xbd0ddf['MailAccount'][_0x7da4('0x9')][_0x7da4('0xa')]){_0x479a26[_0x7da4('0xa')]=_0xbd0ddf['MailAccount']['Smtp'][_0x7da4('0xa')];}else{_0x479a26[_0x7da4('0xb')]=_0xbd0ddf[_0x7da4('0xc')][_0x7da4('0x9')]['host'];_0x479a26[_0x7da4('0xd')]=_0xbd0ddf[_0x7da4('0xc')]['Smtp'][_0x7da4('0xd')];_0x479a26[_0x7da4('0xe')]=_0xbd0ddf[_0x7da4('0xc')][_0x7da4('0x9')][_0x7da4('0xe')];}if(_0xbd0ddf[_0x7da4('0xc')]['Smtp'][_0x7da4('0xf')]){_0x479a26['auth']={'user':_0xbd0ddf[_0x7da4('0xc')]['Smtp'][_0x7da4('0x10')],'pass':_0xbd0ddf[_0x7da4('0xc')][_0x7da4('0x9')][_0x7da4('0x11')]};}var _0x2e4fd5={'account':_0x479a26,'message':{'from':util[_0x7da4('0x12')](_0x7da4('0x13'),_0xbd0ddf['MailAccount'][_0x7da4('0x14')],_0xbd0ddf[_0x7da4('0xc')][_0x7da4('0x8')]||_0xbd0ddf[_0x7da4('0xc')][_0x7da4('0x9')][_0x7da4('0x10')]),'to':_0xbd0ddf[_0x7da4('0x8')],'cc':_0xbd0ddf['cc'],'bcc':_0xbd0ddf[_0x7da4('0x15')],'subject':util[_0x7da4('0x12')]('Report\x20%s\x20last\x20%s\x20%s',_0x3d8183[_0x7da4('0x14')],_0xbd0ddf[_0x7da4('0x16')],_0xbd0ddf['subtractUnit'])}};var _0x12c95e=path[_0x7da4('0x17')](__dirname,_0x7da4('0x18'));var _0x11b072=_0x3d8183[_0x7da4('0x19')];var _0x314b89=util[_0x7da4('0x12')](_0x7da4('0x1a'),path[_0x7da4('0x1b')](_0x3d8183[_0x7da4('0x19')],path['extname'](_0x3d8183['savename'])),_0x7da4('0x1c'));var _0x4ce9d7=path['join'](_0x12c95e,_0x11b072);var _0x1276b3=path[_0x7da4('0x17')](_0x12c95e,_0x314b89);if(fs[_0x7da4('0x1d')](_0x4ce9d7)){_0x3d8183[_0x7da4('0x1e')]=_0x7da4('0x1f');_0x2e4fd5[_0x7da4('0x20')][_0x7da4('0x21')]=[{'filename':_0x11b072,'path':_0x4ce9d7}];_0x2e4fd5['message'][_0x7da4('0x22')]=util[_0x7da4('0x12')]('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'](_0x3d8183,null,0x2));}else if(fs[_0x7da4('0x1d')](_0x1276b3)){_0x3d8183[_0x7da4('0x1e')]=_0x7da4('0x1f');_0x2e4fd5[_0x7da4('0x20')][_0x7da4('0x21')]=[{'filename':_0x314b89,'path':_0x1276b3}];}else{_0x2e4fd5[_0x7da4('0x20')][_0x7da4('0x22')]=_0x7da4('0x23');if(!_0xbd0ddf[_0x7da4('0x24')]){_0x33ba64=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x33ba64){return client['request'](_0x7da4('0x25'),_0x2e4fd5)[_0x7da4('0x26')](function(_0x2b6db2){if(_0x2b6db2[_0x7da4('0x27')]){return logger[_0x7da4('0x27')](_0x7da4('0x28'),JSON['stringify'](_0x2b6db2));}return logger[_0x7da4('0x29')](_0x7da4('0x2a'));})['catch'](function(_0x419e67){return logger[_0x7da4('0x27')](_0x7da4('0x28'),JSON[_0x7da4('0x2b')](_0x419e67));});}};}function handleError(){return function(_0x19a5bf){return logger[_0x7da4('0x27')](JSON[_0x7da4('0x2b')](_0x19a5bf));};}function handleResult(_0xb23e56){return function(_0x8846a0){logger[_0x7da4('0x29')]('data',JSON['stringify'](_0x8846a0));if(_0xb23e56[_0x7da4('0xc')]&&_0xb23e56[_0x7da4('0xc')][_0x7da4('0x9')]&&!_['isNil'](_0xb23e56[_0x7da4('0x8')])){setTimeout(handleSendEmail(_0xb23e56,_0x8846a0),0x3c*0x3e8);}};}function handleJob(_0x1a9f27){return function(){try{if(_[_0x7da4('0x2c')](_0x1a9f27[_0x7da4('0x16')])){return logger[_0x7da4('0x29')](_0x7da4('0x2d'));}if(_[_0x7da4('0x2c')](_0x1a9f27['subtractUnit'])){return logger[_0x7da4('0x29')](_0x7da4('0x2e'));}var _0x8f29f6={'startDate':moment()[_0x7da4('0x2f')](_0x1a9f27[_0x7da4('0x16')],_0x1a9f27[_0x7da4('0x30')])[_0x7da4('0x12')](_0x7da4('0x31')),'endDate':moment()[_0x7da4('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x1a9f27[_0x7da4('0x32')],'name':_0x1a9f27['name']};if(!_[_0x7da4('0x2c')](_0x1a9f27[_0x7da4('0x33')])){logger[_0x7da4('0x29')](_0x7da4('0x34'),_0x1a9f27['DefaultReportId']);return analyticDefaultReportController[_0x7da4('0x35')]({'id':_0x1a9f27['DefaultReportId']},_0x8f29f6)[_0x7da4('0x26')](handleResult(_0x1a9f27))[_0x7da4('0x36')](handleError());}if(!_['isNil'](_0x1a9f27[_0x7da4('0x37')])){logger['info'](_0x7da4('0x38'),_0x1a9f27[_0x7da4('0x37')]);return analyticCustomReportController[_0x7da4('0x35')]({'id':_0x1a9f27[_0x7da4('0x37')]},_0x8f29f6)['then'](handleResult(_0x1a9f27))['catch'](handleError());}}catch(_0x47d93){logger[_0x7da4('0x27')](JSON[_0x7da4('0x2b')](_0x47d93));}return logger[_0x7da4('0x29')](_0x7da4('0x39'));};}function getJobs(_0x238ec8){var _0x2bfa20={};if(_0x238ec8){_0x2bfa20['id']=_0x238ec8;}return db[_0x7da4('0x3a')][_0x7da4('0x3b')]({'where':_0x2bfa20,'include':[{'model':db[_0x7da4('0xc')],'attributes':['id','name',_0x7da4('0x8')],'include':[{'model':db[_0x7da4('0x3c')],'as':_0x7da4('0x9')}]}]})[_0x7da4('0x26')](function(_0x3a844a){var _0x35f05a=_['keys'](manager[_0x7da4('0x3d')]);var _0x14c7d3=_[_0x7da4('0x3e')](_0x3a844a,function(_0x341cc1){return _0x341cc1['id'][_0x7da4('0x3f')]();});var _0x4625e7=_['keyBy'](_0x3a844a,function(_0x2a6a59){return _0x2a6a59['id']['toString']();});var _0x36ae01=_0x238ec8?_0x14c7d3:_['difference'](_0x14c7d3,_0x35f05a);var _0x25a8ef=_[_0x7da4('0x40')](_0x14c7d3,_0x35f05a);var _0x312348=_[_0x7da4('0x41')](_0x35f05a,_0x14c7d3);var _0x421e8b;var _0x501479;for(_0x421e8b=0x0;_0x421e8b<_0x312348[_0x7da4('0x42')]&&!_0x238ec8;_0x421e8b+=0x1){_0x501479=_0x312348[_0x421e8b][_0x7da4('0x3f')]();if(manager[_0x7da4('0x43')](_0x501479)){manager[_0x7da4('0x44')](_0x501479);manager['deleteJob'](_0x501479);logger[_0x7da4('0x29')](_0x7da4('0x45'),_0x501479);}}logger[_0x7da4('0x29')]('toRun',JSON[_0x7da4('0x2b')](_0x36ae01));for(_0x421e8b=0x0;_0x421e8b<_0x36ae01[_0x7da4('0x42')];_0x421e8b+=0x1){_0x501479=_0x36ae01[_0x421e8b][_0x7da4('0x3f')]();logger[_0x7da4('0x29')](_0x7da4('0x46'),_0x501479);if(_0x238ec8){logger['info'](_0x7da4('0x47'),_0x238ec8);logger[_0x7da4('0x29')](JSON[_0x7da4('0x2b')](_0x4625e7[_0x501479]));BPromise[_0x7da4('0x48')]()[_0x7da4('0x26')](handleJob(_0x4625e7[_0x501479]));logger[_0x7da4('0x29')](_0x7da4('0x49'),_0x4625e7[_0x501479][_0x7da4('0x14')],_0x4625e7[_0x501479]['cron']);}else if(_0x4625e7[_0x501479][_0x7da4('0x4a')]&&_0x4625e7[_0x501479][_0x7da4('0x4b')]&&moment()[_0x7da4('0x4c')](_0x4625e7[_0x501479][_0x7da4('0x4d')],_0x4625e7[_0x501479][_0x7da4('0x4e')])){manager[_0x7da4('0x4f')](_0x501479,_0x4625e7[_0x501479]['cron'],handleJob(_0x4625e7[_0x501479]));manager[_0x7da4('0x50')](_0x501479);logger[_0x7da4('0x29')](_0x7da4('0x51'),_0x4625e7[_0x501479][_0x7da4('0x14')],_0x4625e7[_0x501479][_0x7da4('0x4a')]);}else if(manager[_0x7da4('0x43')](_0x501479)){manager[_0x7da4('0x44')](_0x501479);manager[_0x7da4('0x52')](_0x501479);logger[_0x7da4('0x29')](_0x7da4('0x53'),_0x4625e7[_0x501479][_0x7da4('0x14')],_0x4625e7[_0x501479][_0x7da4('0x4a')]);}}for(_0x421e8b=0x0,_0x501479;_0x421e8b<_0x25a8ef[_0x7da4('0x42')]&&!_0x238ec8;_0x421e8b+=0x1){_0x501479=_0x25a8ef[_0x421e8b][_0x7da4('0x3f')]();if(manager['exists'](_0x501479)){if(_0x4625e7[_0x501479]['cron']&&_0x4625e7[_0x501479][_0x7da4('0x4b')]&&moment()['isBetween'](_0x4625e7[_0x501479][_0x7da4('0x4d')],_0x4625e7[_0x501479][_0x7da4('0x4e')])){manager[_0x7da4('0x54')](_0x501479,_0x4625e7[_0x501479][_0x7da4('0x4a')],handleJob(_0x4625e7[_0x501479]));logger['info'](_0x7da4('0x55'),_0x4625e7[_0x501479][_0x7da4('0x14')],_0x4625e7[_0x501479][_0x7da4('0x4a')]);}else{manager[_0x7da4('0x44')](_0x501479);manager[_0x7da4('0x52')](_0x501479);logger[_0x7da4('0x29')](_0x7da4('0x53'),_0x4625e7[_0x501479][_0x7da4('0x14')],_0x4625e7[_0x501479]['cron']);}}}})[_0x7da4('0x36')](function(_0x489f45){logger[_0x7da4('0x27')](JSON['stringify'](_0x489f45));});}exports[_0x7da4('0x56')]=function(_0x2161f5){return getJobs(_0x2161f5);};exports[_0x7da4('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index d65b828..5c0b92b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24e9=['Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','sentiment','sentimentAccountId','sentimentRegion','language','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','bucket','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','COMPLETED','TranscriptionJob'];(function(_0x5547b6,_0x487f71){var _0x46b1ce=function(_0x189e91){while(--_0x189e91){_0x5547b6['push'](_0x5547b6['shift']());}};_0x46b1ce(++_0x487f71);}(_0x24e9,0x85));var _0x924e=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0x24e9[_0x4d180c];return _0x49b57e;};var _=require(_0x924e('0x0'));var AWS=require('aws-sdk');var rp=require(_0x924e('0x1'));var util=require(_0x924e('0x2'));var BPromise=require(_0x924e('0x3'));var db=require(_0x924e('0x4'))['db'];var logger=require(_0x924e('0x5'))(_0x924e('0x6'));function getTranscriptionJob(_0x3e1275,_0x1564ff,_0x4ecdb9,_0x18346f){return new Promise(function(_0x31f0c3,_0x13accc){var _0x19370a=new AWS[(_0x924e('0x7'))]({'accessKeyId':_0x1564ff,'secretAccessKey':_0x3e1275,'region':_0x4ecdb9});_0x19370a['getTranscriptionJob']({'TranscriptionJobName':_0x18346f},function(_0x4eeee8,_0x35c2a1){if(_0x4eeee8){return _0x13accc(_0x4eeee8);}else{return _0x31f0c3(_0x35c2a1);}});});}function sentiment(_0x1604a8,_0x2e8475,_0x3b3ab5,_0x576c1c,_0x448d9a){return new Promise(function(_0xf68b7a,_0x4f26ca){var _0x3f3c7c=new AWS['Comprehend']({'accessKeyId':_0x2e8475,'secretAccessKey':_0x1604a8,'region':_0x3b3ab5});_0x3f3c7c[_0x924e('0x8')]({'Text':_0x576c1c,'LanguageCode':_0x448d9a[_0x924e('0x9')](0x0,0x2)},function(_0x23ea10,_0x1fb537){if(_0x23ea10){return _0x4f26ca(_0x23ea10);}else{return _0xf68b7a(_0x1fb537);}});});}function checkTranscribeJob(_0x217c9b,_0x3e4ac5,_0x2096d0){var _0x380bb5;return new BPromise(function(_0x570bb8,_0x421c96){logger['info'](util[_0x924e('0xa')](_0x924e('0xb'),_0x217c9b['id'],_0x217c9b[_0x924e('0xc')]));return getTranscriptionJob(_0x2096d0[_0x924e('0xd')],_0x2096d0[_0x924e('0xe')],_0x3e4ac5[_0x924e('0xf')],_0x217c9b['transcribeName'])['then'](function(_0x8328a5){logger[_0x924e('0x10')](util['format'](_0x924e('0x11'),_0x217c9b['id'],_0x217c9b['transcribeName'],_0x8328a5['TranscriptionJob'][_0x924e('0x12')]));if(!_0x217c9b['fileText']){switch(_0x8328a5['TranscriptionJob'][_0x924e('0x12')]){case _0x924e('0x13'):var _0x1b6549={'transcribeStatus':_0x8328a5[_0x924e('0x14')][_0x924e('0x12')],'fileUri':_0x8328a5['TranscriptionJob'][_0x924e('0x15')][_0x924e('0x16')]};logger['info'](util[_0x924e('0xa')](_0x924e('0x17'),_0x217c9b['id']));return rp({'uri':_0x8328a5[_0x924e('0x14')][_0x924e('0x15')]['TranscriptFileUri'],'json':!![]})[_0x924e('0x18')](function(_0xb20c91){logger['info'](util[_0x924e('0xa')](_0x924e('0x19'),_0x217c9b['id']));if(_0xb20c91&&_0xb20c91['results']&&_0xb20c91[_0x924e('0x1a')][_0x924e('0x1b')]&&_0xb20c91[_0x924e('0x1a')][_0x924e('0x1b')][_0x924e('0x1c')]){_0x1b6549[_0x924e('0x1d')]='';for(var _0x451b3d=0x0;_0x451b3d<_0xb20c91[_0x924e('0x1a')][_0x924e('0x1b')][_0x924e('0x1c')];_0x451b3d++){_0x1b6549['fileText']+=_0xb20c91['results'][_0x924e('0x1b')][_0x451b3d]['transcript']+'';}}return _0x217c9b['update'](_0x1b6549);})[_0x924e('0x18')](function(){logger[_0x924e('0x10')](util[_0x924e('0xa')](_0x924e('0x1e'),_0x217c9b['id']));if(!_0x217c9b['tempSentiment']){throw new db['Sequelize'][(_0x924e('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3e4ac5[_0x924e('0x20')]||!_0x3e4ac5[_0x924e('0x21')]||!_0x3e4ac5[_0x924e('0x22')]||!_0x3e4ac5[_0x924e('0x23')]||!_0x3e4ac5['bucket']){throw new db[(_0x924e('0x24'))][(_0x924e('0x1f'))](_0x924e('0x25'));}if(!_0x1b6549[_0x924e('0x1d')]){throw new Error(_0x924e('0x26'));}if(_0x3e4ac5[_0x924e('0x21')]===_0x2096d0['id']){return _0x2096d0;}else{return db[_0x924e('0x27')][_0x924e('0x28')]({'where':{'id':_settings[_0x924e('0x21')]}});}})[_0x924e('0x18')](function(_0xb10af6){if(!_0xb10af6){throw new db[(_0x924e('0x24'))][(_0x924e('0x1f'))](_0x924e('0x29'));}if(!_0xb10af6[_0x924e('0xd')]||!_0xb10af6[_0x924e('0xe')]){throw new db[(_0x924e('0x24'))]['ValidationError'](_0x924e('0x2a'));}_0x380bb5=_0xb10af6;logger[_0x924e('0x10')](util['format'](_0x924e('0x2b'),_0x217c9b['id']));return sentiment(_0x380bb5['data1'],_0x380bb5[_0x924e('0xe')],_0x3e4ac5[_0x924e('0x22')],_0x1b6549[_0x924e('0x1d')],_0x3e4ac5[_0x924e('0x23')]);})[_0x924e('0x18')](function(_0x4b76e9){logger[_0x924e('0x10')](util[_0x924e('0xa')](_0x924e('0x2c'),_0x217c9b['id']));return _0x217c9b[_0x924e('0x2d')]({'sentiment':_0x4b76e9[_0x924e('0x2e')],'sPositive':_0x4b76e9[_0x924e('0x2f')][_0x924e('0x30')],'sNegative':_0x4b76e9[_0x924e('0x2f')][_0x924e('0x31')],'sMixed':_0x4b76e9[_0x924e('0x2f')][_0x924e('0x32')],'sNeutral':_0x4b76e9[_0x924e('0x2f')][_0x924e('0x33')]});})['then'](function(){logger[_0x924e('0x10')](util['format'](_0x924e('0x1e'),_0x217c9b['id']));_0x570bb8();});case _0x924e('0x34'):return _0x217c9b[_0x924e('0x2d')]({'transcribeStatus':_0x924e('0x34'),'failureReason':_0x8328a5[_0x924e('0x14')][_0x924e('0x35')]})[_0x924e('0x18')](function(){logger[_0x924e('0x10')](util[_0x924e('0xa')](_0x924e('0x1e'),_0x217c9b['id']));_0x570bb8();});default:logger[_0x924e('0x10')](util[_0x924e('0xa')](_0x924e('0x36'),_0x217c9b['id']));break;}}else{return BPromise[_0x924e('0x37')]()['then'](function(){if(!_0x217c9b[_0x924e('0x38')]){throw new db[(_0x924e('0x24'))]['ValidationError'](_0x924e('0x39'));}if(!_0x3e4ac5['sentiment']||!_0x3e4ac5[_0x924e('0x21')]||!_0x3e4ac5[_0x924e('0x22')]||!_0x3e4ac5[_0x924e('0x23')]||!_0x3e4ac5[_0x924e('0x3a')]){throw new db[(_0x924e('0x24'))][(_0x924e('0x1f'))](_0x924e('0x25'));}if(!_0x217c9b[_0x924e('0x1d')]){throw new Error(_0x924e('0x26'));}if(_0x3e4ac5[_0x924e('0x21')]===_0x2096d0['id']){return _0x2096d0;}else{return db[_0x924e('0x27')][_0x924e('0x28')]({'where':{'id':_settings[_0x924e('0x21')]}});}})[_0x924e('0x18')](function(_0x86f42){if(!_0x86f42){throw new db['Sequelize'][(_0x924e('0x1f'))](_0x924e('0x29'));}if(!_0x86f42[_0x924e('0xd')]||!_0x86f42[_0x924e('0xe')]){throw new db[(_0x924e('0x24'))]['ValidationError'](_0x924e('0x2a'));}_0x380bb5=_0x86f42;logger[_0x924e('0x10')](util[_0x924e('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x217c9b['id']));return sentiment(_0x380bb5[_0x924e('0xd')],_0x380bb5[_0x924e('0xe')],_0x3e4ac5['sentimentRegion'],_0x217c9b['fileText'],_0x3e4ac5['language']);})[_0x924e('0x18')](function(_0x292b42){logger[_0x924e('0x10')](util[_0x924e('0xa')](_0x924e('0x2c'),_0x217c9b['id']));return _0x217c9b[_0x924e('0x2d')]({'sentiment':_0x292b42[_0x924e('0x2e')],'sPositive':_0x292b42[_0x924e('0x2f')]['Positive'],'sNegative':_0x292b42[_0x924e('0x2f')][_0x924e('0x31')],'sMixed':_0x292b42['SentimentScore'][_0x924e('0x32')],'sNeutral':_0x292b42[_0x924e('0x2f')][_0x924e('0x33')],'transcribeStatus':_0x924e('0x13')});})['then'](function(){logger[_0x924e('0x10')](util[_0x924e('0xa')](_0x924e('0x1e'),_0x217c9b['id']));_0x570bb8();});}})[_0x924e('0x3b')](function(_0x5cdf2f){if(_0x5cdf2f){if(!_0x5cdf2f['name']||_0x5cdf2f[_0x924e('0x3c')]!==_0x924e('0x3d')){logger[_0x924e('0x3e')](util[_0x924e('0xa')](_0x924e('0x3f'),_0x217c9b['id']),util[_0x924e('0x40')](_0x5cdf2f,{'showHidden':![],'depth':null}));}}_0x570bb8();});});}function checkTranscribe(){var _0x332201;var _0x1045e3;var _0x3d4fad;return db[_0x924e('0x41')][_0x924e('0x42')]({'where':{'transcribeStatus':_0x924e('0x43')}})[_0x924e('0x18')](function(_0x4d418c){if(!_0x4d418c||!_0x4d418c[_0x924e('0x1c')]){throw new db[(_0x924e('0x24'))][(_0x924e('0x1f'))](_0x924e('0x44'));}_0x332201=_0x4d418c;return db[_0x924e('0x45')][_0x924e('0x28')]({'where':{'id':0x1}});})[_0x924e('0x18')](function(_0x1aa309){if(!_0x1aa309){throw new db['Sequelize'][(_0x924e('0x1f'))](_0x924e('0x46'));}_0x1045e3=_0x1aa309;if(!_0x1045e3[_0x924e('0x6')]||!_0x1045e3[_0x924e('0x47')]||!_0x1045e3['transcribeRegion']||!_0x1045e3['language']||!_0x1045e3[_0x924e('0x3a')]){throw new db['Sequelize'][(_0x924e('0x1f'))](_0x924e('0x48'));}return db['CloudProvider'][_0x924e('0x28')]({'where':{'id':_0x1045e3['transcribeAccountId']}});})[_0x924e('0x18')](function(_0x312667){if(!_0x312667){throw new db[(_0x924e('0x24'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x312667[_0x924e('0xd')]||!_0x312667[_0x924e('0xe')]){throw new db[(_0x924e('0x24'))]['ValidationError'](_0x924e('0x2a'));}_0x3d4fad=_0x312667;var _0x3a2e60=[];_0x332201[_0x924e('0x49')](function(_0x202aa8){_0x3a2e60[_0x924e('0x4a')](checkTranscribeJob(_0x202aa8,_0x1045e3,_0x3d4fad));});return BPromise[_0x924e('0x4b')](_0x3a2e60);})['catch'](function(_0x78a8ca){if(_0x78a8ca){if(!_0x78a8ca['name']||_0x78a8ca[_0x924e('0x3c')]!==_0x924e('0x3d')){logger[_0x924e('0x3e')](util[_0x924e('0x40')](_0x78a8ca,{'showHidden':![],'depth':null}));}}});}exports[_0x924e('0x4c')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x02f7=['Sequelize','ValidationError','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','CloudProvider','Cloud\x20Provider\x20not\x20available','COMPLETED','catch','name','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','push','all','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment'];(function(_0x1de0b9,_0xc6f046){var _0x18edae=function(_0x2d3ad1){while(--_0x2d3ad1){_0x1de0b9['push'](_0x1de0b9['shift']());}};_0x18edae(++_0xc6f046);}(_0x02f7,0x1d3));var _0x702f=function(_0x219cc1,_0x3d03b5){_0x219cc1=_0x219cc1-0x0;var _0x177034=_0x02f7[_0x219cc1];return _0x177034;};var _=require(_0x702f('0x0'));var AWS=require(_0x702f('0x1'));var rp=require(_0x702f('0x2'));var util=require('util');var BPromise=require(_0x702f('0x3'));var db=require(_0x702f('0x4'))['db'];var logger=require(_0x702f('0x5'))(_0x702f('0x6'));function getTranscriptionJob(_0x7afcee,_0x2d4d5a,_0x47db23,_0x5f1d5d){return new Promise(function(_0x449ba1,_0x4ff1d2){var _0x69295=new AWS[(_0x702f('0x7'))]({'accessKeyId':_0x2d4d5a,'secretAccessKey':_0x7afcee,'region':_0x47db23});_0x69295[_0x702f('0x8')]({'TranscriptionJobName':_0x5f1d5d},function(_0xfe27d7,_0x39371c){if(_0xfe27d7){return _0x4ff1d2(_0xfe27d7);}else{return _0x449ba1(_0x39371c);}});});}function sentiment(_0x4f24bb,_0x5e0fa9,_0x389c21,_0x2408f5,_0x5c4f84){return new Promise(function(_0x3d6f55,_0x23d739){var _0x351a30=new AWS['Comprehend']({'accessKeyId':_0x5e0fa9,'secretAccessKey':_0x4f24bb,'region':_0x389c21});_0x351a30['detectSentiment']({'Text':_0x2408f5,'LanguageCode':_0x5c4f84[_0x702f('0x9')](0x0,0x2)},function(_0x202ae5,_0x3ba9cf){if(_0x202ae5){return _0x23d739(_0x202ae5);}else{return _0x3d6f55(_0x3ba9cf);}});});}function checkTranscribeJob(_0x4aa91c,_0xb0ce29,_0x3ac816){var _0x4f8528;return new BPromise(function(_0x39c277,_0x7a0582){logger[_0x702f('0xa')](util[_0x702f('0xb')](_0x702f('0xc'),_0x4aa91c['id'],_0x4aa91c[_0x702f('0xd')]));return getTranscriptionJob(_0x3ac816[_0x702f('0xe')],_0x3ac816['data2'],_0xb0ce29[_0x702f('0xf')],_0x4aa91c[_0x702f('0xd')])[_0x702f('0x10')](function(_0x67a47e){logger[_0x702f('0xa')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x4aa91c['id'],_0x4aa91c[_0x702f('0xd')],_0x67a47e['TranscriptionJob'][_0x702f('0x11')]));if(!_0x4aa91c[_0x702f('0x12')]){switch(_0x67a47e[_0x702f('0x13')][_0x702f('0x11')]){case'COMPLETED':var _0x1eb91a={'transcribeStatus':_0x67a47e['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x67a47e[_0x702f('0x13')][_0x702f('0x14')][_0x702f('0x15')]};logger['info'](util[_0x702f('0xb')](_0x702f('0x16'),_0x4aa91c['id']));return rp({'uri':_0x67a47e[_0x702f('0x13')]['Transcript'][_0x702f('0x15')],'json':!![]})[_0x702f('0x10')](function(_0xadc8c1){logger[_0x702f('0xa')](util[_0x702f('0xb')](_0x702f('0x17'),_0x4aa91c['id']));if(_0xadc8c1&&_0xadc8c1[_0x702f('0x18')]&&_0xadc8c1[_0x702f('0x18')][_0x702f('0x19')]&&_0xadc8c1[_0x702f('0x18')][_0x702f('0x19')][_0x702f('0x1a')]){_0x1eb91a[_0x702f('0x12')]='';for(var _0x362c3f=0x0;_0x362c3f<_0xadc8c1[_0x702f('0x18')][_0x702f('0x19')][_0x702f('0x1a')];_0x362c3f++){_0x1eb91a['fileText']+=_0xadc8c1[_0x702f('0x18')][_0x702f('0x19')][_0x362c3f][_0x702f('0x1b')]+'';}}return _0x4aa91c[_0x702f('0x1c')](_0x1eb91a);})[_0x702f('0x10')](function(){logger['info'](util[_0x702f('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4aa91c['id']));if(!_0x4aa91c[_0x702f('0x1d')]){throw new db[(_0x702f('0x1e'))][(_0x702f('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0xb0ce29['sentiment']||!_0xb0ce29[_0x702f('0x20')]||!_0xb0ce29['sentimentRegion']||!_0xb0ce29[_0x702f('0x21')]||!_0xb0ce29[_0x702f('0x22')]){throw new db[(_0x702f('0x1e'))]['ValidationError'](_0x702f('0x23'));}if(!_0x1eb91a[_0x702f('0x12')]){throw new Error(_0x702f('0x24'));}if(_0xb0ce29['sentimentAccountId']===_0x3ac816['id']){return _0x3ac816;}else{return db['CloudProvider'][_0x702f('0x25')]({'where':{'id':_settings[_0x702f('0x20')]}});}})[_0x702f('0x10')](function(_0x7c0902){if(!_0x7c0902){throw new db[(_0x702f('0x1e'))][(_0x702f('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x7c0902[_0x702f('0xe')]||!_0x7c0902[_0x702f('0x26')]){throw new db[(_0x702f('0x1e'))][(_0x702f('0x1f'))](_0x702f('0x27'));}_0x4f8528=_0x7c0902;logger['info'](util[_0x702f('0xb')](_0x702f('0x28'),_0x4aa91c['id']));return sentiment(_0x4f8528[_0x702f('0xe')],_0x4f8528['data2'],_0xb0ce29[_0x702f('0x29')],_0x1eb91a[_0x702f('0x12')],_0xb0ce29[_0x702f('0x21')]);})[_0x702f('0x10')](function(_0x1975a8){logger[_0x702f('0xa')](util[_0x702f('0xb')](_0x702f('0x2a'),_0x4aa91c['id']));return _0x4aa91c[_0x702f('0x1c')]({'sentiment':_0x1975a8[_0x702f('0x2b')],'sPositive':_0x1975a8[_0x702f('0x2c')]['Positive'],'sNegative':_0x1975a8['SentimentScore'][_0x702f('0x2d')],'sMixed':_0x1975a8[_0x702f('0x2c')][_0x702f('0x2e')],'sNeutral':_0x1975a8[_0x702f('0x2c')][_0x702f('0x2f')]});})[_0x702f('0x10')](function(){logger['info'](util[_0x702f('0xb')](_0x702f('0x30'),_0x4aa91c['id']));_0x39c277();});case _0x702f('0x31'):return _0x4aa91c[_0x702f('0x1c')]({'transcribeStatus':_0x702f('0x31'),'failureReason':_0x67a47e[_0x702f('0x13')][_0x702f('0x32')]})['then'](function(){logger[_0x702f('0xa')](util[_0x702f('0xb')](_0x702f('0x30'),_0x4aa91c['id']));_0x39c277();});default:logger[_0x702f('0xa')](util[_0x702f('0xb')](_0x702f('0x33'),_0x4aa91c['id']));break;}}else{return BPromise[_0x702f('0x34')]()['then'](function(){if(!_0x4aa91c['tempSentiment']){throw new db[(_0x702f('0x1e'))][(_0x702f('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0xb0ce29[_0x702f('0x35')]||!_0xb0ce29[_0x702f('0x20')]||!_0xb0ce29['sentimentRegion']||!_0xb0ce29[_0x702f('0x21')]||!_0xb0ce29[_0x702f('0x22')]){throw new db[(_0x702f('0x1e'))][(_0x702f('0x1f'))](_0x702f('0x23'));}if(!_0x4aa91c[_0x702f('0x12')]){throw new Error(_0x702f('0x24'));}if(_0xb0ce29[_0x702f('0x20')]===_0x3ac816['id']){return _0x3ac816;}else{return db[_0x702f('0x36')][_0x702f('0x25')]({'where':{'id':_settings[_0x702f('0x20')]}});}})[_0x702f('0x10')](function(_0x4d49ff){if(!_0x4d49ff){throw new db['Sequelize'][(_0x702f('0x1f'))](_0x702f('0x37'));}if(!_0x4d49ff[_0x702f('0xe')]||!_0x4d49ff[_0x702f('0x26')]){throw new db[(_0x702f('0x1e'))][(_0x702f('0x1f'))](_0x702f('0x27'));}_0x4f8528=_0x4d49ff;logger[_0x702f('0xa')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4aa91c['id']));return sentiment(_0x4f8528[_0x702f('0xe')],_0x4f8528[_0x702f('0x26')],_0xb0ce29[_0x702f('0x29')],_0x4aa91c[_0x702f('0x12')],_0xb0ce29['language']);})[_0x702f('0x10')](function(_0x56bb9f){logger[_0x702f('0xa')](util[_0x702f('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4aa91c['id']));return _0x4aa91c['update']({'sentiment':_0x56bb9f[_0x702f('0x2b')],'sPositive':_0x56bb9f[_0x702f('0x2c')]['Positive'],'sNegative':_0x56bb9f['SentimentScore'][_0x702f('0x2d')],'sMixed':_0x56bb9f[_0x702f('0x2c')][_0x702f('0x2e')],'sNeutral':_0x56bb9f[_0x702f('0x2c')][_0x702f('0x2f')],'transcribeStatus':_0x702f('0x38')});})['then'](function(){logger['info'](util[_0x702f('0xb')](_0x702f('0x30'),_0x4aa91c['id']));_0x39c277();});}})[_0x702f('0x39')](function(_0x3c40f1){if(_0x3c40f1){if(!_0x3c40f1[_0x702f('0x3a')]||_0x3c40f1[_0x702f('0x3a')]!=='SequelizeValidationError'){logger[_0x702f('0x3b')](util[_0x702f('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x4aa91c['id']),util[_0x702f('0x3c')](_0x3c40f1,{'showHidden':![],'depth':null}));}}_0x39c277();});});}function checkTranscribe(){var _0x493252;var _0x5a133e;var _0x5e11b5;return db[_0x702f('0x3d')][_0x702f('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x702f('0x10')](function(_0x4b4f3c){if(!_0x4b4f3c||!_0x4b4f3c[_0x702f('0x1a')]){throw new db[(_0x702f('0x1e'))][(_0x702f('0x1f'))](_0x702f('0x3f'));}_0x493252=_0x4b4f3c;return db[_0x702f('0x40')][_0x702f('0x25')]({'where':{'id':0x1}});})[_0x702f('0x10')](function(_0x261172){if(!_0x261172){throw new db[(_0x702f('0x1e'))][(_0x702f('0x1f'))](_0x702f('0x41'));}_0x5a133e=_0x261172;if(!_0x5a133e[_0x702f('0x6')]||!_0x5a133e['transcribeAccountId']||!_0x5a133e[_0x702f('0xf')]||!_0x5a133e[_0x702f('0x21')]||!_0x5a133e[_0x702f('0x22')]){throw new db[(_0x702f('0x1e'))]['ValidationError'](_0x702f('0x42'));}return db[_0x702f('0x36')][_0x702f('0x25')]({'where':{'id':_0x5a133e[_0x702f('0x43')]}});})[_0x702f('0x10')](function(_0x3f5899){if(!_0x3f5899){throw new db['Sequelize'][(_0x702f('0x1f'))](_0x702f('0x37'));}if(!_0x3f5899[_0x702f('0xe')]||!_0x3f5899[_0x702f('0x26')]){throw new db['Sequelize'][(_0x702f('0x1f'))](_0x702f('0x27'));}_0x5e11b5=_0x3f5899;var _0x1bdcd1=[];_0x493252['forEach'](function(_0x653405){_0x1bdcd1[_0x702f('0x44')](checkTranscribeJob(_0x653405,_0x5a133e,_0x5e11b5));});return BPromise[_0x702f('0x45')](_0x1bdcd1);})[_0x702f('0x39')](function(_0x217919){if(_0x217919){if(!_0x217919['name']||_0x217919[_0x702f('0x3a')]!=='SequelizeValidationError'){logger[_0x702f('0x3b')](util[_0x702f('0x3c')](_0x217919,{'showHidden':![],'depth':null}));}}});}exports[_0x702f('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 8e346c8..24bfefa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bf3=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format'];(function(_0x1e7e27,_0x2b6343){var _0x1bcbe9=function(_0x38f694){while(--_0x38f694){_0x1e7e27['push'](_0x1e7e27['shift']());}};_0x1bcbe9(++_0x2b6343);}(_0x1bf3,0x16f));var _0x31bf=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1bf3[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x31bf('0x0'));var moment=require(_0x31bf('0x1'));var Redis=require('ioredis');var util=require(_0x31bf('0x2'));var config=require(_0x31bf('0x3'));var db=require(_0x31bf('0x4'))['db'];var logger=require(_0x31bf('0x5'))(_0x31bf('0x6'));config[_0x31bf('0x7')]=_[_0x31bf('0x8')](config[_0x31bf('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x31bf('0x7')]));function closeInteractions(){var _0x18ffd9=[];return db[_0x31bf('0x9')][_0x31bf('0xa')]({'raw':!![],'attributes':['id',_0x31bf('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x31bf('0xc')](0x18,_0x31bf('0xd'))}}})[_0x31bf('0xe')](function(_0x1c2a0e){if(_0x1c2a0e&&_0x1c2a0e[_0x31bf('0xf')]){_0x18ffd9=_['map'](_0x1c2a0e||[],'id');logger[_0x31bf('0x10')](_0x31bf('0x11'),_0x18ffd9[_0x31bf('0x12')]());return db['WhatsappInteraction'][_0x31bf('0x13')]({'closeReason':_0x31bf('0x14'),'disposition':_0x31bf('0x15'),'closed':!![],'closedAt':moment()[_0x31bf('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x18ffd9}});}})[_0x31bf('0xe')](function(){if(_0x18ffd9&&_0x18ffd9['length']){logger[_0x31bf('0x10')](_0x31bf('0x17'),_0x18ffd9[_0x31bf('0x12')]());for(var _0x5de408=0x0;_0x5de408<_0x18ffd9[_0x31bf('0xf')];_0x5de408++){io[_0x31bf('0x18')](_0x31bf('0x19'),{'id':_0x18ffd9[_0x5de408],'closed':!![]});}}})[_0x31bf('0x1a')](function(_0x3bb61d){logger[_0x31bf('0x1b')](_0x31bf('0x1c'),_0x3bb61d?util[_0x31bf('0x1d')](_0x3bb61d,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x439c=['map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','then','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','length'];(function(_0x388408,_0x25ccdc){var _0x353cf5=function(_0x898f7c){while(--_0x898f7c){_0x388408['push'](_0x388408['shift']());}};_0x353cf5(++_0x25ccdc);}(_0x439c,0x86));var _0xc439=function(_0x1649c0,_0x2051b5){_0x1649c0=_0x1649c0-0x0;var _0x18b601=_0x439c[_0x1649c0];return _0x18b601;};'use strict';var _=require(_0xc439('0x0'));var moment=require(_0xc439('0x1'));var Redis=require('ioredis');var util=require(_0xc439('0x2'));var config=require(_0xc439('0x3'));var db=require(_0xc439('0x4'))['db'];var logger=require(_0xc439('0x5'))(_0xc439('0x6'));config[_0xc439('0x7')]=_[_0xc439('0x8')](config[_0xc439('0x7')],{'host':_0xc439('0x9'),'port':0x18eb});var io=require(_0xc439('0xa'))(new Redis(config[_0xc439('0x7')]));function closeInteractions(){var _0x2e6a99=[];return db[_0xc439('0xb')][_0xc439('0xc')]({'raw':!![],'attributes':['id',_0xc439('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xc439('0xe'))}}})['then'](function(_0xab05c8){if(_0xab05c8&&_0xab05c8[_0xc439('0xf')]){_0x2e6a99=_[_0xc439('0x10')](_0xab05c8||[],'id');logger[_0xc439('0x11')](_0xc439('0x12'),_0x2e6a99[_0xc439('0x13')]());return db[_0xc439('0xb')][_0xc439('0x14')]({'closeReason':_0xc439('0x15'),'disposition':_0xc439('0x16'),'closed':!![],'closedAt':moment()['format'](_0xc439('0x17'))},{'where':{'id':_0x2e6a99}});}})[_0xc439('0x18')](function(){if(_0x2e6a99&&_0x2e6a99[_0xc439('0xf')]){logger[_0xc439('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x2e6a99[_0xc439('0x13')]());for(var _0x2c0505=0x0;_0x2c0505<_0x2e6a99[_0xc439('0xf')];_0x2c0505++){io['emit'](_0xc439('0x19'),{'id':_0x2e6a99[_0x2c0505],'closed':!![]});}}})[_0xc439('0x1a')](function(_0x4d850e){logger[_0xc439('0x1b')](_0xc439('0x1c'),_0x4d850e?util['inspect'](_0x4d850e,{'showHidden':![],'depth':null}):'');});}exports[_0xc439('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 626dca9..6b8d78a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7b0=['log','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate'];(function(_0x4d0b14,_0x430bb5){var _0x409ca2=function(_0x40c78a){while(--_0x40c78a){_0x4d0b14['push'](_0x4d0b14['shift']());}};_0x409ca2(++_0x430bb5);}(_0xd7b0,0x111));var _0x0d7b=function(_0x40d5e4,_0x21f112){_0x40d5e4=_0x40d5e4-0x0;var _0x1120f5=_0xd7b0[_0x40d5e4];return _0x1120f5;};'use strict';var util=require(_0x0d7b('0x0'));var db=require(_0x0d7b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0d7b('0x2')]({'id':i,'firstName':_0x0d7b('0x3')+i,'lastName':_0x0d7b('0x4')+i,'phone':0xf879fb460+i,'email':_0x0d7b('0x5')+i+_0x0d7b('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0d7b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0d7b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x0d7b('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0d7b('0x2')]({'id':i,'firstName':_0x0d7b('0x3')+i,'lastName':_0x0d7b('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0d7b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0d7b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0d7b('0x7')](),'updatedAt':Date['now']()});}db[_0x0d7b('0x8')][_0x0d7b('0x9')]({'where':{}})[_0x0d7b('0xa')](function(){return db[_0x0d7b('0x8')][_0x0d7b('0xb')](contacts);})[_0x0d7b('0xa')](function(){console[_0x0d7b('0xc')]('finished\x20populating',_0x0d7b('0xd'));return db['CmHopper'][_0x0d7b('0x9')]({'where':{}});})[_0x0d7b('0xa')](function(){return db[_0x0d7b('0xe')][_0x0d7b('0xb')](hopper);})['then'](function(){console[_0x0d7b('0xc')](_0x0d7b('0xf'),_0x0d7b('0x10'));return db['CmContact'][_0x0d7b('0xb')](contacts2);})[_0x0d7b('0xa')](function(){console[_0x0d7b('0xc')]('finished\x20populating',_0x0d7b('0x11'));return db[_0x0d7b('0xe')][_0x0d7b('0xb')](hopper2);})[_0x0d7b('0xa')](function(){console['log'](_0x0d7b('0xf'),'hopper2');})[_0x0d7b('0x12')](function(_0x5c9faa){console['log'](_0x5c9faa);});
\ No newline at end of file
+var _0x843f=['CmContact','bulkCreate','log','finished\x20populating','CmHopper','hopper1','hopper2','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','destroy','then'];(function(_0x4fcb37,_0xc5ff25){var _0x3dc093=function(_0x33f251){while(--_0x33f251){_0x4fcb37['push'](_0x4fcb37['shift']());}};_0x3dc093(++_0xc5ff25);}(_0x843f,0x1b7));var _0xf843=function(_0x1efb32,_0x14073f){_0x1efb32=_0x1efb32-0x0;var _0x48adb8=_0x843f[_0x1efb32];return _0x48adb8;};'use strict';var util=require('util');var db=require(_0xf843('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf843('0x1')]({'id':i,'firstName':_0xf843('0x2')+i,'lastName':_0xf843('0x3')+i,'phone':0xf879fb460+i,'email':_0xf843('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xf843('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf843('0x1')]({'id':i,'firstName':_0xf843('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xf843('0x4')+i+_0xf843('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf843('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xf843('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db['CmContact'][_0xf843('0x7')]({'where':{}})[_0xf843('0x8')](function(){return db[_0xf843('0x9')][_0xf843('0xa')](contacts);})[_0xf843('0x8')](function(){console[_0xf843('0xb')](_0xf843('0xc'),'contacts1');return db[_0xf843('0xd')]['destroy']({'where':{}});})[_0xf843('0x8')](function(){return db[_0xf843('0xd')][_0xf843('0xa')](hopper);})['then'](function(){console[_0xf843('0xb')]('finished\x20populating',_0xf843('0xe'));return db[_0xf843('0x9')][_0xf843('0xa')](contacts2);})[_0xf843('0x8')](function(){console[_0xf843('0xb')](_0xf843('0xc'),'contacts2');return db[_0xf843('0xd')][_0xf843('0xa')](hopper2);})['then'](function(){console[_0xf843('0xb')]('finished\x20populating',_0xf843('0xf'));})['catch'](function(_0x51dbed){console[_0xf843('0xb')](_0x51dbed);});
\ No newline at end of file
index eff57ef..777212c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x806d=['catch','util','../mysqldb','push','%s%s','format','%s%s@xcally.com','agent','password','friend','udp','wss','all','yes','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x806d,0x12d));var _0xd806=function(_0xb32147,_0x2d6c25){_0xb32147=_0xb32147-0x0;var _0x582999=_0x806d[_0xb32147];return _0x582999;};'use strict';var util=require(_0xd806('0x0'));var db=require(_0xd806('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd806('0x2')]({'name':util['format'](_0xd806('0x3'),'agent',i),'fullname':util[_0xd806('0x4')](_0xd806('0x3'),'agent',i),'email':util[_0xd806('0x4')](_0xd806('0x5'),_0xd806('0x6'),i),'role':_0xd806('0x6'),'password':_0xd806('0x7'),'internal':0xfa0+i,'type':_0xd806('0x8'),'transport':[_0xd806('0x9'),'ws',_0xd806('0xa')],'disallow':[_0xd806('0xb')],'allow':['ulaw'],'defaultuser':util[_0xd806('0x4')](_0xd806('0x3'),_0xd806('0x6'),i),'encryption':_0xd806('0xc'),'avpf':_0xd806('0xc'),'force_avp':_0xd806('0xc'),'icesupport':_0xd806('0xc'),'dtlsenable':_0xd806('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xd806('0xd'),'callerid':util['format'](_0xd806('0xe'),util[_0xd806('0x4')](_0xd806('0x3'),_0xd806('0x6'),i),0xfa0+i)});}db[_0xd806('0xf')][_0xd806('0x10')](users)['then'](function(){console[_0xd806('0x11')](_0xd806('0x12'));})[_0xd806('0x13')](function(_0x4e2bc2){console[_0xd806('0x11')](_0x4e2bc2);});
\ No newline at end of file
+var _0x7671=['password','friend','udp','wss','ulaw','yes','actpass','User','then','log','add\x20user','catch','../mysqldb','format','%s%s','agent','%s%s@xcally.com'];(function(_0x565a21,_0x3a57fd){var _0x2882e5=function(_0x24de84){while(--_0x24de84){_0x565a21['push'](_0x565a21['shift']());}};_0x2882e5(++_0x3a57fd);}(_0x7671,0x1e8));var _0x1767=function(_0x1e07d4,_0x390176){_0x1e07d4=_0x1e07d4-0x0;var _0x3d3a3d=_0x7671[_0x1e07d4];return _0x3d3a3d;};'use strict';var util=require('util');var db=require(_0x1767('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x1767('0x1')](_0x1767('0x2'),'agent',i),'fullname':util[_0x1767('0x1')](_0x1767('0x2'),_0x1767('0x3'),i),'email':util[_0x1767('0x1')](_0x1767('0x4'),_0x1767('0x3'),i),'role':_0x1767('0x3'),'password':_0x1767('0x5'),'internal':0xfa0+i,'type':_0x1767('0x6'),'transport':[_0x1767('0x7'),'ws',_0x1767('0x8')],'disallow':['all'],'allow':[_0x1767('0x9')],'defaultuser':util[_0x1767('0x1')](_0x1767('0x2'),_0x1767('0x3'),i),'encryption':_0x1767('0xa'),'avpf':'yes','force_avp':_0x1767('0xa'),'icesupport':'yes','dtlsenable':_0x1767('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x1767('0xb'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x1767('0x1')]('%s%s',_0x1767('0x3'),i),0xfa0+i)});}db[_0x1767('0xc')]['bulkCreate'](users)[_0x1767('0xd')](function(){console[_0x1767('0xe')](_0x1767('0xf'));})[_0x1767('0x10')](function(_0x566842){console[_0x1767('0xe')](_0x566842);});
\ No newline at end of file
index 421eec6..6442367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ac5=['VoiceQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','VoiceQueues','ChatQueues','ChatQueue','Trunk','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','address','connection','remoteAddress','request','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','autoAssociation','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','resourceId','then','map','where','Campaign','format','%s:queue:%s','length','user:%s','query','userProfileId','handshake','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push'];(function(_0x1c2536,_0x82db40){var _0x1d3a65=function(_0x22796a){while(--_0x22796a){_0x1c2536['push'](_0x1c2536['shift']());}};_0x1d3a65(++_0x82db40);}(_0x8ac5,0x105));var _0x58ac=function(_0x2c9413,_0x3d42db){_0x2c9413=_0x2c9413-0x0;var _0xc74f50=_0x8ac5[_0x2c9413];return _0xc74f50;};'use strict';var _=require(_0x58ac('0x0'));var util=require(_0x58ac('0x1'));var BPromise=require(_0x58ac('0x2'));var db=require(_0x58ac('0x3'))['db'];var config=require(_0x58ac('0x4'));var queryQueues={'attributes':['id',_0x58ac('0x5')],'include':[{'as':_0x58ac('0x6'),'model':db[_0x58ac('0x7')],'attributes':['id',_0x58ac('0x5'),_0x58ac('0x8')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x58ac('0x5')],'where':{'role':_0x58ac('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x58ac('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x58ac('0x5')],'where':{'role':_0x58ac('0xa')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x58ac('0x5'),_0x58ac('0xb')],'where':{'type':_0x58ac('0xc')}};function getAssociatedResources(_0x306c05,_0x34d977,_0x35b98a){return db[_0x58ac('0xd')][_0x58ac('0xe')]({'where':{'name':_0x306c05,'userProfileId':_0x34d977},'raw':!![]})['then'](function(_0x32b867){if(_0x32b867){if(_0x32b867[_0x58ac('0xf')]){switch(_0x306c05){case'VoiceQueues':case'ChatQueues':case _0x58ac('0x10'):case _0x58ac('0x11'):case _0x58ac('0x12'):case _0x58ac('0x13'):case _0x58ac('0x14'):return db[_0x35b98a]['findAll'](queryQueues);case _0x58ac('0x15'):return db[_0x35b98a][_0x58ac('0x16')](queryTelephones);case _0x58ac('0x17'):return db[_0x35b98a][_0x58ac('0x16')](queryTrunks);case _0x58ac('0x18'):return db[_0x35b98a][_0x58ac('0x16')](queryCampaigns);}}else{return db['UserProfileResource'][_0x58ac('0x16')]({'attributes':[_0x58ac('0x19')],'where':{'sectionId':_0x32b867['id']},'raw':!![]})[_0x58ac('0x1a')](function(_0xfcbe89){if(_0xfcbe89){var _0x370baa={'where':{'id':_[_0x58ac('0x1b')](_0xfcbe89,_0x58ac('0x19'))},'raw':!![]};switch(_0x35b98a){case _0x58ac('0x7'):_0x370baa[_0x58ac('0x1c')]['role']='telephone';break;case _0x58ac('0x1d'):_0x370baa['where'][_0x58ac('0xb')]=_0x58ac('0xc');break;}return db[_0x35b98a][_0x58ac('0x16')](_0x370baa);}else{return[];}});}}else{return[];}})[_0x58ac('0x1a')](function(_0x17f3d2){return _0x17f3d2;});}function joinOrLeaveQueues(_0x131957,_0x451404,_0x1e42ab,_0x2b8cca){_0x131957[_0x451404](util[_0x58ac('0x1e')](_0x58ac('0x1f'),_0x1e42ab,_0x2b8cca[_0x58ac('0x5')]));if(_0x2b8cca[_0x58ac('0x6')]){for(var _0x559307=0x0;_0x559307<_0x2b8cca[_0x58ac('0x6')][_0x58ac('0x20')];_0x559307+=0x1){_0x131957[_0x451404](util[_0x58ac('0x1e')](_0x58ac('0x21'),_0x2b8cca[_0x58ac('0x6')][_0x559307][_0x58ac('0x5')]));}}}function joinOrLeave(_0x4e01dc,_0x1e64ed,_0x5c463a){var _0x1e6b70;if(_0x4e01dc['handshake'][_0x58ac('0x22')]['id']){db[_0x58ac('0x7')]['find']({'attributes':['id',_0x58ac('0x5'),_0x58ac('0x8'),_0x58ac('0x23')],'where':{'id':_0x4e01dc[_0x58ac('0x24')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x58ac('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x58ac('0x26')],'as':_0x58ac('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x58ac('0x28')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x58ac('0x29')],'as':_0x58ac('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x58ac('0x2b')],'as':_0x58ac('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x58ac('0x1a')](function(_0xad5e8d){if(_0xad5e8d){_0x1e6b70=_0xad5e8d;_0x4e01dc[_0x1e64ed](util[_0x58ac('0x1e')]('user:%s',_0xad5e8d[_0x58ac('0x5')]));var _0x4cfb75=[];switch(_0xad5e8d[_0x58ac('0x8')]){case _0x58ac('0x2d'):_0x4e01dc[_0x1e64ed](_0x58ac('0x2e'));_0x4e01dc[_0x1e64ed](_0x58ac('0x2f'));if(queryQueues[_0x58ac('0x30')]('include')){delete queryQueues[_0x58ac('0x31')];}_0x4cfb75[_0x58ac('0x32')](db[_0x58ac('0x33')][_0x58ac('0x16')](queryQueues));_0x4cfb75[_0x58ac('0x32')](db['ChatQueue'][_0x58ac('0x16')](queryQueues));_0x4cfb75['push'](db[_0x58ac('0x34')]['findAll'](queryQueues));_0x4cfb75[_0x58ac('0x32')](db['SmsQueue']['findAll'](queryQueues));_0x4cfb75[_0x58ac('0x32')](db[_0x58ac('0x35')][_0x58ac('0x16')](queryQueues));_0x4cfb75['push'](db[_0x58ac('0x36')]['findAll'](queryQueues));_0x4cfb75[_0x58ac('0x32')](db[_0x58ac('0x37')][_0x58ac('0x16')](queryQueues));_0x4cfb75[_0x58ac('0x32')](db[_0x58ac('0x7')][_0x58ac('0x16')](queryTelephones));_0x4cfb75[_0x58ac('0x32')](db['Trunk']['findAll'](queryTrunks));_0x4cfb75[_0x58ac('0x32')](db[_0x58ac('0x1d')][_0x58ac('0x16')](queryCampaigns));_0x4cfb75['push'](db[_0x58ac('0x7')]['findAll'](queryAgents));break;case _0x58ac('0x38'):_0x4e01dc[_0x1e64ed]('voice:inbound');_0x4e01dc[_0x1e64ed](_0x58ac('0x2f'));_0x4cfb75[_0x58ac('0x32')](getAssociatedResources(_0x58ac('0x39'),_0xad5e8d[_0x58ac('0x23')],_0x58ac('0x33')));_0x4cfb75[_0x58ac('0x32')](getAssociatedResources(_0x58ac('0x3a'),_0xad5e8d['userProfileId'],_0x58ac('0x3b')));_0x4cfb75[_0x58ac('0x32')](getAssociatedResources('FaxQueues',_0xad5e8d[_0x58ac('0x23')],_0x58ac('0x34')));_0x4cfb75['push'](getAssociatedResources(_0x58ac('0x11'),_0xad5e8d[_0x58ac('0x23')],'SmsQueue'));_0x4cfb75[_0x58ac('0x32')](getAssociatedResources(_0x58ac('0x12'),_0xad5e8d[_0x58ac('0x23')],_0x58ac('0x35')));_0x4cfb75[_0x58ac('0x32')](getAssociatedResources(_0x58ac('0x13'),_0xad5e8d[_0x58ac('0x23')],_0x58ac('0x36')));_0x4cfb75[_0x58ac('0x32')](getAssociatedResources(_0x58ac('0x14'),_0xad5e8d[_0x58ac('0x23')],'WhatsappQueue'));_0x4cfb75[_0x58ac('0x32')](getAssociatedResources(_0x58ac('0x15'),_0xad5e8d[_0x58ac('0x23')],'User'));_0x4cfb75[_0x58ac('0x32')](getAssociatedResources('Trunks',_0xad5e8d['userProfileId'],_0x58ac('0x3c')));_0x4cfb75[_0x58ac('0x32')](getAssociatedResources(_0x58ac('0x18'),_0xad5e8d[_0x58ac('0x23')],_0x58ac('0x1d')));_0x4cfb75[_0x58ac('0x32')](db[_0x58ac('0x7')]['findAll'](queryAgents));break;case _0x58ac('0xa'):_0x4e01dc[_0x1e64ed](_0x58ac('0x2e'));_0x4e01dc[_0x1e64ed](_0x58ac('0x2f'));_0x4cfb75['push'](_0xad5e8d['getVoiceQueues']({'attributes':['id','name']}));_0x4cfb75['push'](_0xad5e8d[_0x58ac('0x3d')]({'attributes':['id',_0x58ac('0x5')]}));_0x4cfb75[_0x58ac('0x32')](_0xad5e8d['getFaxQueues']({'attributes':['id','name']}));_0x4cfb75[_0x58ac('0x32')](_0xad5e8d[_0x58ac('0x3e')]({'attributes':['id',_0x58ac('0x5')]}));_0x4cfb75[_0x58ac('0x32')](_0xad5e8d[_0x58ac('0x3f')]({'attributes':['id',_0x58ac('0x5')]}));_0x4cfb75[_0x58ac('0x32')](_0xad5e8d[_0x58ac('0x40')]({'attributes':['id',_0x58ac('0x5')]}));_0x4cfb75['push'](_0xad5e8d[_0x58ac('0x41')]({'attributes':['id','name']}));break;}return BPromise[_0x58ac('0x42')](_0x4cfb75);}})[_0x58ac('0x1a')](function(_0x1b76ab){if(_0x1b76ab&&_0x1b76ab['length']){for(var _0x267123=0x0;_0x267123<_0x1b76ab[_0x58ac('0x20')];_0x267123+=0x1){for(var _0x1c66b4=0x0;_0x1c66b4<_0x1b76ab[_0x267123][_0x58ac('0x20')];_0x1c66b4+=0x1){switch(_0x267123){case 0x0:joinOrLeaveQueues(_0x4e01dc,_0x1e64ed,_0x58ac('0x43'),_0x1b76ab[_0x267123][_0x1c66b4]);break;case 0x1:joinOrLeaveQueues(_0x4e01dc,_0x1e64ed,_0x58ac('0x44'),_0x1b76ab[_0x267123][_0x1c66b4]);break;case 0x2:joinOrLeaveQueues(_0x4e01dc,_0x1e64ed,'fax',_0x1b76ab[_0x267123][_0x1c66b4]);break;case 0x3:joinOrLeaveQueues(_0x4e01dc,_0x1e64ed,_0x58ac('0x45'),_0x1b76ab[_0x267123][_0x1c66b4]);break;case 0x4:joinOrLeaveQueues(_0x4e01dc,_0x1e64ed,_0x58ac('0x46'),_0x1b76ab[_0x267123][_0x1c66b4]);break;case 0x5:joinOrLeaveQueues(_0x4e01dc,_0x1e64ed,_0x58ac('0x47'),_0x1b76ab[_0x267123][_0x1c66b4]);break;case 0x6:joinOrLeaveQueues(_0x4e01dc,_0x1e64ed,_0x58ac('0x48'),_0x1b76ab[_0x267123][_0x1c66b4]);break;case 0x7:if(_0x1e6b70['role']!==_0x58ac('0xa'))_0x4e01dc[_0x1e64ed](util[_0x58ac('0x1e')](_0x58ac('0x49'),_0x1b76ab[_0x267123][_0x1c66b4][_0x58ac('0x5')]));break;case 0x8:if(_0x1e6b70[_0x58ac('0x8')]!==_0x58ac('0xa'))_0x4e01dc[_0x1e64ed](util[_0x58ac('0x1e')](_0x58ac('0x4a'),_0x1b76ab[_0x267123][_0x1c66b4][_0x58ac('0x5')]));break;case 0x9:if(_0x1e6b70[_0x58ac('0x8')]!==_0x58ac('0xa'))_0x4e01dc[_0x1e64ed](util[_0x58ac('0x1e')](_0x58ac('0x4b'),_0x1b76ab[_0x267123][_0x1c66b4][_0x58ac('0xb')],_0x1b76ab[_0x267123][_0x1c66b4][_0x58ac('0x5')]));break;case 0xa:_0x4e01dc[_0x1e64ed](util[_0x58ac('0x1e')]('user:%s',_0x1b76ab[_0x267123][_0x1c66b4][_0x58ac('0x5')]));break;}}}}})[_0x58ac('0x1a')](function(){if(_0x1e64ed===_0x58ac('0x4c')){var _0x48243c=_[_0x58ac('0x1b')](_0x1e6b70[_0x58ac('0x4d')],'id');return _0x1e6b70[_0x58ac('0x4e')](_0x48243c)['then'](function(){for(var _0x2a1194=0x0;_0x2a1194<_0x48243c[_0x58ac('0x20')];_0x2a1194+=0x1){_0x5c463a['emit'](_0x58ac('0x4f'),{'ChatInteractionId':Number(_0x48243c[_0x2a1194]),'UserId':Number(_0x1e6b70['id'])});}});}})['then'](function(){if(_0x1e64ed===_0x58ac('0x4c')){var _0x4b36d8=_[_0x58ac('0x1b')](_0x1e6b70['MailInteractions'],'id');return _0x1e6b70[_0x58ac('0x50')](_0x4b36d8)[_0x58ac('0x1a')](function(){for(var _0x2dd96c=0x0;_0x2dd96c<_0x4b36d8[_0x58ac('0x20')];_0x2dd96c+=0x1){_0x5c463a['emit'](_0x58ac('0x51'),{'MailInteractionId':Number(_0x4b36d8[_0x2dd96c]),'UserId':Number(_0x1e6b70['id'])});}});}})['then'](function(){if(_0x1e64ed===_0x58ac('0x4c')){var _0x436368=_[_0x58ac('0x1b')](_0x1e6b70[_0x58ac('0x27')],'id');return _0x1e6b70[_0x58ac('0x52')](_0x436368)[_0x58ac('0x1a')](function(){for(var _0x461f7f=0x0;_0x461f7f<_0x436368['length'];_0x461f7f+=0x1){_0x5c463a[_0x58ac('0x53')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x436368[_0x461f7f]),'UserId':Number(_0x1e6b70['id'])});}});}})[_0x58ac('0x1a')](function(){if(_0x1e64ed===_0x58ac('0x4c')){var _0x517307=_[_0x58ac('0x1b')](_0x1e6b70[_0x58ac('0x54')],'id');return _0x1e6b70[_0x58ac('0x55')](_0x517307)[_0x58ac('0x1a')](function(){for(var _0x34e265=0x0;_0x34e265<_0x517307['length'];_0x34e265+=0x1){_0x5c463a['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x517307[_0x34e265]),'UserId':Number(_0x1e6b70['id'])});}});}})[_0x58ac('0x1a')](function(){if(_0x1e64ed===_0x58ac('0x4c')){var _0x1c0c85=_['map'](_0x1e6b70[_0x58ac('0x2a')],'id');return _0x1e6b70[_0x58ac('0x56')](_0x1c0c85)['then'](function(){for(var _0xb42013=0x0;_0xb42013<_0x1c0c85[_0x58ac('0x20')];_0xb42013+=0x1){_0x5c463a[_0x58ac('0x53')](_0x58ac('0x57'),{'OpenchannelInteractionId':Number(_0x1c0c85[_0xb42013]),'UserId':Number(_0x1e6b70['id'])});}});}})[_0x58ac('0x1a')](function(){if(_0x1e64ed===_0x58ac('0x4c')){var _0x6bbfe8=_[_0x58ac('0x1b')](_0x1e6b70['WhatsappInteractions'],'id');return _0x1e6b70[_0x58ac('0x58')](_0x6bbfe8)[_0x58ac('0x1a')](function(){for(var _0x46d893=0x0;_0x46d893<_0x6bbfe8[_0x58ac('0x20')];_0x46d893+=0x1){_0x5c463a['emit'](_0x58ac('0x59'),{'WhatsappInteractionId':Number(_0x6bbfe8[_0x46d893]),'UserId':Number(_0x1e6b70['id'])});}});}})[_0x58ac('0x5a')](function(_0x3deb1b){_0x4e01dc['log'](_0x3deb1b);});}}function onDisconnect(_0x43d41d,_0x5878ad){joinOrLeave(_0x43d41d,_0x58ac('0x4c'),_0x5878ad);}function onConnect(_0x54f5d0){joinOrLeave(_0x54f5d0,_0x58ac('0x5b'));}exports[_0x58ac('0x5c')]=function(_0x92c65f){_0x92c65f['on']('connection',function(_0x40e60f){_0x40e60f['setMaxListeners'](0x0);_0x40e60f[_0x58ac('0x5d')]=_0x40e60f['request'][_0x58ac('0x5e')][_0x58ac('0x5f')]+':'+_0x40e60f[_0x58ac('0x60')][_0x58ac('0x5e')]['remotePort'];_0x40e60f[_0x58ac('0x61')]=new Date();_0x40e60f[_0x58ac('0x62')]=function(_0x4fd910){console['log'](_0x58ac('0x63')+_0x40e60f[_0x58ac('0x64')]['name']+'['+_0x40e60f[_0x58ac('0x5d')]+']',_0x4fd910);};_0x40e60f['on'](_0x58ac('0x65'),function(){onDisconnect(_0x40e60f,_0x92c65f);_0x40e60f[_0x58ac('0x62')](_0x58ac('0x66'));});onConnect(_0x40e60f);_0x40e60f[_0x58ac('0x62')](_0x58ac('0x67'));});};
\ No newline at end of file
+var _0x0447=['getWhatsappQueues','all','length','voice','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','setMaxListeners','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','resourceId','map','where','Campaign','format','%s:queue:%s','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','include','push','FaxQueue','MailQueue','Trunk','user','voice:outbound','ChatQueues','ChatQueue','SmsQueues','SmsQueue','MailQueues','OpenchannelQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues'];(function(_0x135d00,_0x23d934){var _0x1e1b1b=function(_0x426069){while(--_0x426069){_0x135d00['push'](_0x135d00['shift']());}};_0x1e1b1b(++_0x23d934);}(_0x0447,0x8b));var _0x7044=function(_0x4d95c4,_0x2248cb){_0x4d95c4=_0x4d95c4-0x0;var _0x4fe1bf=_0x0447[_0x4d95c4];return _0x4fe1bf;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var BPromise=require(_0x7044('0x2'));var db=require(_0x7044('0x3'))['db'];var config=require(_0x7044('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x7044('0x5'),'model':db[_0x7044('0x6')],'attributes':['id',_0x7044('0x7'),_0x7044('0x8')],'raw':!![],'where':{'role':_0x7044('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7044('0x7')],'where':{'role':_0x7044('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7044('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x7044('0x7')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7044('0x7'),_0x7044('0xb')],'where':{'type':_0x7044('0xc')}};function getAssociatedResources(_0x42aa4,_0x4ee462,_0x41616d){return db[_0x7044('0xd')]['findOne']({'where':{'name':_0x42aa4,'userProfileId':_0x4ee462},'raw':!![]})[_0x7044('0xe')](function(_0xf38837){if(_0xf38837){if(_0xf38837[_0x7044('0xf')]){switch(_0x42aa4){case _0x7044('0x10'):case'ChatQueues':case _0x7044('0x11'):case'SmsQueues':case'MailQueues':case'OpenchannelQueues':case _0x7044('0x12'):return db[_0x41616d][_0x7044('0x13')](queryQueues);case _0x7044('0x14'):return db[_0x41616d][_0x7044('0x13')](queryTelephones);case'Trunks':return db[_0x41616d]['findAll'](queryTrunks);case _0x7044('0x15'):return db[_0x41616d][_0x7044('0x13')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0x7044('0x16')],'where':{'sectionId':_0xf38837['id']},'raw':!![]})[_0x7044('0xe')](function(_0x79f418){if(_0x79f418){var _0x35769e={'where':{'id':_[_0x7044('0x17')](_0x79f418,_0x7044('0x16'))},'raw':!![]};switch(_0x41616d){case'User':_0x35769e[_0x7044('0x18')][_0x7044('0x8')]=_0x7044('0xa');break;case _0x7044('0x19'):_0x35769e[_0x7044('0x18')][_0x7044('0xb')]='ivr';break;}return db[_0x41616d][_0x7044('0x13')](_0x35769e);}else{return[];}});}}else{return[];}})[_0x7044('0xe')](function(_0x1eeb45){return _0x1eeb45;});}function joinOrLeaveQueues(_0x4e7285,_0x4bbdb3,_0x543be8,_0xced6e4){_0x4e7285[_0x4bbdb3](util[_0x7044('0x1a')](_0x7044('0x1b'),_0x543be8,_0xced6e4[_0x7044('0x7')]));if(_0xced6e4[_0x7044('0x5')]){for(var _0x4faffe=0x0;_0x4faffe<_0xced6e4[_0x7044('0x5')]['length'];_0x4faffe+=0x1){_0x4e7285[_0x4bbdb3](util['format'](_0x7044('0x1c'),_0xced6e4[_0x7044('0x5')][_0x4faffe][_0x7044('0x7')]));}}}function joinOrLeave(_0x294915,_0x39d85e,_0x105da8){var _0x41a079;if(_0x294915[_0x7044('0x1d')][_0x7044('0x1e')]['id']){db['User']['find']({'attributes':['id',_0x7044('0x7'),_0x7044('0x8'),_0x7044('0x1f')],'where':{'id':_0x294915[_0x7044('0x1d')][_0x7044('0x1e')]['id']},'include':[{'model':db[_0x7044('0x20')],'as':_0x7044('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x22')],'as':_0x7044('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x24')],'as':_0x7044('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x26')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x27')],'as':_0x7044('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x7044('0x29')],'as':_0x7044('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x2261af){if(_0x2261af){_0x41a079=_0x2261af;_0x294915[_0x39d85e](util['format']('user:%s',_0x2261af['name']));var _0x29501a=[];switch(_0x2261af['role']){case _0x7044('0x2b'):_0x294915[_0x39d85e](_0x7044('0x2c'));_0x294915[_0x39d85e]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x7044('0x2d'))){delete queryQueues['include'];}_0x29501a['push'](db['VoiceQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db['ChatQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db[_0x7044('0x2f')][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db['SmsQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db[_0x7044('0x30')][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db['OpenchannelQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db['WhatsappQueue'][_0x7044('0x13')](queryQueues));_0x29501a[_0x7044('0x2e')](db[_0x7044('0x6')][_0x7044('0x13')](queryTelephones));_0x29501a[_0x7044('0x2e')](db[_0x7044('0x31')]['findAll'](queryTrunks));_0x29501a['push'](db[_0x7044('0x19')][_0x7044('0x13')](queryCampaigns));_0x29501a['push'](db[_0x7044('0x6')][_0x7044('0x13')](queryAgents));break;case _0x7044('0x32'):_0x294915[_0x39d85e](_0x7044('0x2c'));_0x294915[_0x39d85e](_0x7044('0x33'));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x10'),_0x2261af[_0x7044('0x1f')],'VoiceQueue'));_0x29501a['push'](getAssociatedResources(_0x7044('0x34'),_0x2261af[_0x7044('0x1f')],_0x7044('0x35')));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x11'),_0x2261af[_0x7044('0x1f')],_0x7044('0x2f')));_0x29501a['push'](getAssociatedResources(_0x7044('0x36'),_0x2261af[_0x7044('0x1f')],_0x7044('0x37')));_0x29501a['push'](getAssociatedResources(_0x7044('0x38'),_0x2261af['userProfileId'],'MailQueue'));_0x29501a[_0x7044('0x2e')](getAssociatedResources('OpenchannelQueues',_0x2261af[_0x7044('0x1f')],_0x7044('0x39')));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x12'),_0x2261af[_0x7044('0x1f')],_0x7044('0x3a')));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x14'),_0x2261af[_0x7044('0x1f')],_0x7044('0x6')));_0x29501a['push'](getAssociatedResources('Trunks',_0x2261af['userProfileId'],_0x7044('0x31')));_0x29501a[_0x7044('0x2e')](getAssociatedResources(_0x7044('0x15'),_0x2261af[_0x7044('0x1f')],'Campaign'));_0x29501a['push'](db['User'][_0x7044('0x13')](queryAgents));break;case _0x7044('0x9'):_0x294915[_0x39d85e](_0x7044('0x2c'));_0x294915[_0x39d85e](_0x7044('0x33'));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3b')]({'attributes':['id',_0x7044('0x7')]}));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3c')]({'attributes':['id','name']}));_0x29501a['push'](_0x2261af['getFaxQueues']({'attributes':['id',_0x7044('0x7')]}));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3d')]({'attributes':['id',_0x7044('0x7')]}));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3e')]({'attributes':['id',_0x7044('0x7')]}));_0x29501a['push'](_0x2261af['getOpenchannelQueues']({'attributes':['id',_0x7044('0x7')]}));_0x29501a[_0x7044('0x2e')](_0x2261af[_0x7044('0x3f')]({'attributes':['id',_0x7044('0x7')]}));break;}return BPromise[_0x7044('0x40')](_0x29501a);}})[_0x7044('0xe')](function(_0x4e4d17){if(_0x4e4d17&&_0x4e4d17['length']){for(var _0x52514c=0x0;_0x52514c<_0x4e4d17[_0x7044('0x41')];_0x52514c+=0x1){for(var _0x45e1da=0x0;_0x45e1da<_0x4e4d17[_0x52514c][_0x7044('0x41')];_0x45e1da+=0x1){switch(_0x52514c){case 0x0:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x42'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x1:joinOrLeaveQueues(_0x294915,_0x39d85e,'chat',_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x2:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x43'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x3:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x44'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x4:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x45'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x5:joinOrLeaveQueues(_0x294915,_0x39d85e,'openchannel',_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x6:joinOrLeaveQueues(_0x294915,_0x39d85e,_0x7044('0x46'),_0x4e4d17[_0x52514c][_0x45e1da]);break;case 0x7:if(_0x41a079[_0x7044('0x8')]!==_0x7044('0x9'))_0x294915[_0x39d85e](util['format'](_0x7044('0x47'),_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0x7')]));break;case 0x8:if(_0x41a079[_0x7044('0x8')]!==_0x7044('0x9'))_0x294915[_0x39d85e](util['format'](_0x7044('0x48'),_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0x7')]));break;case 0x9:if(_0x41a079['role']!==_0x7044('0x9'))_0x294915[_0x39d85e](util[_0x7044('0x1a')](_0x7044('0x49'),_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0xb')],_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0x7')]));break;case 0xa:_0x294915[_0x39d85e](util['format'](_0x7044('0x1c'),_0x4e4d17[_0x52514c][_0x45e1da][_0x7044('0x7')]));break;}}}}})['then'](function(){if(_0x39d85e==='leave'){var _0x1e4b69=_[_0x7044('0x17')](_0x41a079[_0x7044('0x21')],'id');return _0x41a079[_0x7044('0x4a')](_0x1e4b69)['then'](function(){for(var _0x1ae35d=0x0;_0x1ae35d<_0x1e4b69[_0x7044('0x41')];_0x1ae35d+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x4c'),{'ChatInteractionId':Number(_0x1e4b69[_0x1ae35d]),'UserId':Number(_0x41a079['id'])});}});}})[_0x7044('0xe')](function(){if(_0x39d85e===_0x7044('0x4d')){var _0x344f38=_[_0x7044('0x17')](_0x41a079[_0x7044('0x23')],'id');return _0x41a079[_0x7044('0x4e')](_0x344f38)[_0x7044('0xe')](function(){for(var _0xd0e940=0x0;_0xd0e940<_0x344f38[_0x7044('0x41')];_0xd0e940+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x4f'),{'MailInteractionId':Number(_0x344f38[_0xd0e940]),'UserId':Number(_0x41a079['id'])});}});}})['then'](function(){if(_0x39d85e==='leave'){var _0x4dbd9c=_[_0x7044('0x17')](_0x41a079[_0x7044('0x25')],'id');return _0x41a079[_0x7044('0x50')](_0x4dbd9c)[_0x7044('0xe')](function(){for(var _0x11d41f=0x0;_0x11d41f<_0x4dbd9c[_0x7044('0x41')];_0x11d41f+=0x1){_0x105da8['emit'](_0x7044('0x51'),{'FaxInteractionId':Number(_0x4dbd9c[_0x11d41f]),'UserId':Number(_0x41a079['id'])});}});}})['then'](function(){if(_0x39d85e===_0x7044('0x4d')){var _0x394534=_[_0x7044('0x17')](_0x41a079[_0x7044('0x52')],'id');return _0x41a079[_0x7044('0x53')](_0x394534)[_0x7044('0xe')](function(){for(var _0x505d42=0x0;_0x505d42<_0x394534['length'];_0x505d42+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x54'),{'SmsInteractionId':Number(_0x394534[_0x505d42]),'UserId':Number(_0x41a079['id'])});}});}})[_0x7044('0xe')](function(){if(_0x39d85e===_0x7044('0x4d')){var _0x1346a0=_[_0x7044('0x17')](_0x41a079[_0x7044('0x28')],'id');return _0x41a079['removeOpenchannelInteractions'](_0x1346a0)[_0x7044('0xe')](function(){for(var _0x45f689=0x0;_0x45f689<_0x1346a0['length'];_0x45f689+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x55'),{'OpenchannelInteractionId':Number(_0x1346a0[_0x45f689]),'UserId':Number(_0x41a079['id'])});}});}})[_0x7044('0xe')](function(){if(_0x39d85e===_0x7044('0x4d')){var _0x1dc5f9=_['map'](_0x41a079['WhatsappInteractions'],'id');return _0x41a079[_0x7044('0x56')](_0x1dc5f9)[_0x7044('0xe')](function(){for(var _0x5b076e=0x0;_0x5b076e<_0x1dc5f9[_0x7044('0x41')];_0x5b076e+=0x1){_0x105da8[_0x7044('0x4b')](_0x7044('0x57'),{'WhatsappInteractionId':Number(_0x1dc5f9[_0x5b076e]),'UserId':Number(_0x41a079['id'])});}});}})[_0x7044('0x58')](function(_0x42d8c0){_0x294915[_0x7044('0x59')](_0x42d8c0);});}}function onDisconnect(_0x5e3fa4,_0x46b13d){joinOrLeave(_0x5e3fa4,_0x7044('0x4d'),_0x46b13d);}function onConnect(_0x20e207){joinOrLeave(_0x20e207,_0x7044('0x5a'));}exports['default']=function(_0x37485b){_0x37485b['on']('connection',function(_0x304bdd){_0x304bdd[_0x7044('0x5b')](0x0);_0x304bdd['address']=_0x304bdd[_0x7044('0x5c')][_0x7044('0x5d')][_0x7044('0x5e')]+':'+_0x304bdd[_0x7044('0x5c')][_0x7044('0x5d')][_0x7044('0x5f')];_0x304bdd[_0x7044('0x60')]=new Date();_0x304bdd[_0x7044('0x59')]=function(_0x471859){console[_0x7044('0x59')](_0x7044('0x61')+_0x304bdd[_0x7044('0x62')][_0x7044('0x7')]+'['+_0x304bdd[_0x7044('0x63')]+']',_0x471859);};_0x304bdd['on'](_0x7044('0x64'),function(){onDisconnect(_0x304bdd,_0x37485b);_0x304bdd['log']('DISCONNECTED');});onConnect(_0x304bdd);_0x304bdd[_0x7044('0x59')]('CONNECTED');});};
\ No newline at end of file
index 824d969..1229476 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6f1=['agent','incomingmessage','outgoingmessage','opened','ContactId','changed','closed','internal','hasOwnProperty','model','condition','jayson/promise','triggers','client','Chat','ChatInteraction','afterCreate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','newinteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','then','info','Trigger,\x20%s','EventManager','code','error','catch','get','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','User','find','UserId','name','fullname','email','interface','format','SIP/%s'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0xf6f1,0x18b));var _0x1f6f=function(_0xac8fd9,_0x388253){_0xac8fd9=_0xac8fd9-0x0;var _0x55f3c3=_0xf6f1[_0xac8fd9];return _0x55f3c3;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0x1f6f('0x0'));var logger=require('../logger')(_0x1f6f('0x1'));var _=require('lodash');var client=jayson[_0x1f6f('0x2')]['http']({'port':0x232a});var triggers=[{'channel':_0x1f6f('0x3'),'model':_0x1f6f('0x4'),'event':_0x1f6f('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x1f6f('0x3'),'model':_0x1f6f('0x4'),'event':'afterUpdate','condition':_0x1f6f('0x6'),'callback':afterUpdate},{'channel':_0x1f6f('0x3'),'model':_0x1f6f('0x7'),'event':_0x1f6f('0x5'),'condition':_0x1f6f('0x8'),'callback':afterCreateMessage},{'channel':_0x1f6f('0x9'),'model':_0x1f6f('0xa'),'event':_0x1f6f('0x5'),'condition':_0x1f6f('0xb'),'callback':afterCreate},{'channel':_0x1f6f('0x9'),'model':_0x1f6f('0xa'),'event':_0x1f6f('0xc'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1f6f('0x9'),'model':_0x1f6f('0xd'),'event':_0x1f6f('0x5'),'condition':_0x1f6f('0x8'),'callback':afterCreateMessage},{'channel':_0x1f6f('0xe'),'model':_0x1f6f('0xf'),'event':_0x1f6f('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0x1f6f('0xf'),'event':_0x1f6f('0xc'),'condition':_0x1f6f('0x6'),'callback':afterUpdate},{'channel':_0x1f6f('0xe'),'model':'WhatsappMessage','event':'afterCreate','condition':_0x1f6f('0x8'),'callback':afterCreateMessage},{'channel':_0x1f6f('0x10'),'model':'FaxInteraction','event':_0x1f6f('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x1f6f('0x10'),'model':_0x1f6f('0x11'),'event':_0x1f6f('0xc'),'condition':_0x1f6f('0x6'),'callback':afterUpdate},{'channel':_0x1f6f('0x10'),'model':_0x1f6f('0x12'),'event':_0x1f6f('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1f6f('0x13'),'model':_0x1f6f('0x14'),'event':'afterCreate','condition':_0x1f6f('0xb'),'callback':afterCreate},{'channel':_0x1f6f('0x13'),'model':_0x1f6f('0x14'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1f6f('0x13'),'model':_0x1f6f('0x15'),'event':_0x1f6f('0x5'),'condition':_0x1f6f('0x8'),'callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0x1f6f('0x5'),'condition':_0x1f6f('0xb'),'callback':afterCreate},{'channel':'Openchannel','model':_0x1f6f('0x16'),'event':_0x1f6f('0xc'),'condition':_0x1f6f('0x6'),'callback':afterUpdate},{'channel':_0x1f6f('0x17'),'model':_0x1f6f('0x18'),'event':_0x1f6f('0x5'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x1223fc){return client[_0x1f6f('0x19')]('EventManager',_0x1223fc)[_0x1f6f('0x1a')](function(_0x5767fd){logger[_0x1f6f('0x1b')](_0x1f6f('0x1c'),_0x1f6f('0x1d'),_0x5767fd);if(_0x5767fd['error']){if(_0x5767fd['error'][_0x1f6f('0x1e')]===0x1f4){logger['error'](_0x1f6f('0x1c'),_0x1f6f('0x1d'),_0x5767fd[_0x1f6f('0x1f')]);}}})[_0x1f6f('0x20')](function(_0x26fe7e){logger['error'](_0x1f6f('0x1c'),_0x1f6f('0x1d'),_0x26fe7e);});}function afterCreateMessage(_0x5b43db,_0x396f87){return function(_0x2a247e,_0x21064e){_0x2a247e=_0x2a247e[_0x1f6f('0x21')]({'plain':!![]});_0x2a247e[_0x1f6f('0x22')]=_0x5b43db;_0x2a247e[_0x1f6f('0x23')]=_0x2a247e[_0x1f6f('0x24')];var _0x4354eb=_0x1f6f('0x25')+_0x2a247e['ContactId'];return db[_0x1f6f('0x26')][_0x1f6f('0x27')](_0x4354eb,{'type':db[_0x1f6f('0x28')][_0x1f6f('0x29')][_0x1f6f('0x2a')],'raw':!![]})[_0x1f6f('0x1a')](function(_0x1562bf){return _0x1562bf;})[_0x1f6f('0x1a')](function(_0x1974bf){if(_0x1974bf){_0x2a247e[_0x1f6f('0x2b')]=_0x1974bf[0x0];}if(_0x2a247e['UserId']){return db[_0x1f6f('0x2c')][_0x1f6f('0x2d')]({'where':{'id':_0x2a247e[_0x1f6f('0x2e')]},'attributes':['id',_0x1f6f('0x2f'),_0x1f6f('0x30'),_0x1f6f('0x31'),'internal'],'raw':!![]})[_0x1f6f('0x1a')](function(_0x5d6c4e){_0x2a247e[_0x1f6f('0x32')]=util[_0x1f6f('0x33')](_0x1f6f('0x34'),_0x5d6c4e[_0x1f6f('0x2f')]);_0x2a247e[_0x1f6f('0x22')]=_0x5b43db;_0x2a247e[_0x1f6f('0x35')]=_0x5d6c4e;return request({'event':_0x1f6f('0x36'),'message':_0x2a247e});})[_0x1f6f('0x20')](function(_0x2fbefa){console['error'](_0x2fbefa);});}else{return request({'event':_0x1f6f('0x37'),'message':_0x2a247e});}});};}function afterCreate(_0x25691f,_0x462344){return function(_0x15fe43,_0x4e5e28){_0x15fe43=_0x15fe43['get']({'plain':!![]});_0x15fe43[_0x1f6f('0x22')]=_0x25691f;_0x15fe43['event']=_0x1f6f('0x38');var _0x25bdd4=_0x1f6f('0x25')+_0x15fe43[_0x1f6f('0x39')];return db[_0x1f6f('0x26')][_0x1f6f('0x27')](_0x25bdd4,{'type':db['Sequelize']['QueryTypes'][_0x1f6f('0x2a')],'raw':!![]})[_0x1f6f('0x1a')](function(_0x1eae4f){return _0x1eae4f;})[_0x1f6f('0x1a')](function(_0x49f183){if(_0x49f183){_0x15fe43[_0x1f6f('0x2b')]=_0x49f183[0x0];}return request({'event':_0x462344,'message':_0x15fe43});});};}function afterUpdate(_0x4a5f06,_0x3dc043){return function(_0x28c405,_0x4b82a1){if(_0x28c405[_0x1f6f('0x3a')](_0x1f6f('0x3b'))&&_0x28c405[_0x1f6f('0x3b')]){_0x28c405=_0x28c405[_0x1f6f('0x21')]({'plain':!![]});_0x28c405['channel']=_0x4a5f06;_0x28c405[_0x1f6f('0x23')]=_0x1f6f('0x3b');var _0x2670e8=_0x1f6f('0x25')+_0x28c405[_0x1f6f('0x39')];return db['sequelize'][_0x1f6f('0x27')](_0x2670e8,{'type':db[_0x1f6f('0x28')][_0x1f6f('0x29')]['SELECT'],'raw':!![]})[_0x1f6f('0x1a')](function(_0x2de77f){return _0x2de77f;})['then'](function(_0x1813da){if(_0x1813da){_0x28c405[_0x1f6f('0x2b')]=_0x1813da[0x0];}if(_0x28c405[_0x1f6f('0x2e')]){return db[_0x1f6f('0x2c')][_0x1f6f('0x2d')]({'where':{'id':_0x28c405[_0x1f6f('0x2e')]},'attributes':['id','name',_0x1f6f('0x30'),_0x1f6f('0x31'),_0x1f6f('0x3c')],'raw':!![]})[_0x1f6f('0x1a')](function(_0x566409){_0x28c405[_0x1f6f('0x32')]=util['format'](_0x1f6f('0x34'),_0x566409[_0x1f6f('0x2f')]);_0x28c405[_0x1f6f('0x35')]=_0x566409;return request({'event':_0x3dc043,'message':_0x28c405});})[_0x1f6f('0x20')](function(_0x5801ee){console[_0x1f6f('0x1f')](_0x5801ee);});}else{return request({'event':_0x3dc043,'message':_0x28c405});}});}};}exports['default']=function(){for(var _0x6e6609=0x0;_0x6e6609<triggers['length'];_0x6e6609+=0x1){if(db[_0x1f6f('0x3d')](triggers[_0x6e6609]['model'])){db[triggers[_0x6e6609][_0x1f6f('0x3e')]]['hook'](triggers[_0x6e6609][_0x1f6f('0x23')],triggers[_0x6e6609]['callback'](triggers[_0x6e6609][_0x1f6f('0x22')]['toLowerCase'](),triggers[_0x6e6609][_0x1f6f('0x3f')]));}}};
\ No newline at end of file
+var _0xf1c4=['channel','event','query','Sequelize','QueryTypes','SELECT','contact','User','find','UserId','fullname','email','internal','interface','SIP/%s','name','agent','incomingmessage','get','opened','ContactId','sequelize','changed','closed','length','hasOwnProperty','hook','callback','condition','util','../../mysqldb','../logger','triggers','lodash','client','http','ChatInteraction','afterCreate','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','Sms','Whatsapp','newinteraction','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','code','catch'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xf1c4,0x19d));var _0x4f1c=function(_0x12c0f7,_0x2730ce){_0x12c0f7=_0x12c0f7-0x0;var _0x1b34d4=_0xf1c4[_0x12c0f7];return _0x1b34d4;};'use strict';var util=require(_0x4f1c('0x0'));var db=require(_0x4f1c('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x4f1c('0x2'))(_0x4f1c('0x3'));var _=require(_0x4f1c('0x4'));var client=jayson[_0x4f1c('0x5')][_0x4f1c('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x4f1c('0x7'),'event':_0x4f1c('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4f1c('0x9'),'model':_0x4f1c('0x7'),'event':_0x4f1c('0xa'),'condition':_0x4f1c('0xb'),'callback':afterUpdate},{'channel':'Chat','model':_0x4f1c('0xc'),'event':'afterCreate','condition':_0x4f1c('0xd'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x4f1c('0xe'),'event':_0x4f1c('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4f1c('0xf'),'model':_0x4f1c('0xe'),'event':_0x4f1c('0xa'),'condition':_0x4f1c('0xb'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':'afterCreate','condition':_0x4f1c('0xd'),'callback':afterCreateMessage},{'channel':_0x4f1c('0x10'),'model':'WhatsappInteraction','event':_0x4f1c('0x8'),'condition':_0x4f1c('0x11'),'callback':afterCreate},{'channel':_0x4f1c('0x10'),'model':_0x4f1c('0x12'),'event':_0x4f1c('0xa'),'condition':_0x4f1c('0xb'),'callback':afterUpdate},{'channel':_0x4f1c('0x10'),'model':_0x4f1c('0x13'),'event':_0x4f1c('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x4f1c('0x14'),'model':_0x4f1c('0x15'),'event':_0x4f1c('0xa'),'condition':_0x4f1c('0xb'),'callback':afterUpdate},{'channel':_0x4f1c('0x14'),'model':_0x4f1c('0x16'),'event':_0x4f1c('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4f1c('0x17'),'model':'MailInteraction','event':'afterCreate','condition':_0x4f1c('0x11'),'callback':afterCreate},{'channel':_0x4f1c('0x17'),'model':_0x4f1c('0x18'),'event':_0x4f1c('0xa'),'condition':_0x4f1c('0xb'),'callback':afterUpdate},{'channel':_0x4f1c('0x17'),'model':'MailMessage','event':'afterCreate','condition':_0x4f1c('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x4f1c('0x19'),'event':_0x4f1c('0x8'),'condition':_0x4f1c('0x11'),'callback':afterCreate},{'channel':'Openchannel','model':_0x4f1c('0x19'),'event':_0x4f1c('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4f1c('0x1a'),'model':_0x4f1c('0x1b'),'event':'afterCreate','condition':_0x4f1c('0xd'),'callback':afterCreateMessage}];function request(_0xf60c3a){return client['request'](_0x4f1c('0x1c'),_0xf60c3a)[_0x4f1c('0x1d')](function(_0x1542e5){logger[_0x4f1c('0x1e')](_0x4f1c('0x1f'),_0x4f1c('0x1c'),_0x1542e5);if(_0x1542e5[_0x4f1c('0x20')]){if(_0x1542e5[_0x4f1c('0x20')][_0x4f1c('0x21')]===0x1f4){logger[_0x4f1c('0x20')]('Trigger,\x20%s',_0x4f1c('0x1c'),_0x1542e5['error']);}}})[_0x4f1c('0x22')](function(_0x3775a0){logger['error']('Trigger,\x20%s',_0x4f1c('0x1c'),_0x3775a0);});}function afterCreateMessage(_0x34cb12,_0x26123d){return function(_0x20ac35,_0x360d5f){_0x20ac35=_0x20ac35['get']({'plain':!![]});_0x20ac35[_0x4f1c('0x23')]=_0x34cb12;_0x20ac35[_0x4f1c('0x24')]=_0x20ac35['direction'];var _0x127a85='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20ac35['ContactId'];return db['sequelize'][_0x4f1c('0x25')](_0x127a85,{'type':db[_0x4f1c('0x26')][_0x4f1c('0x27')][_0x4f1c('0x28')],'raw':!![]})[_0x4f1c('0x1d')](function(_0x54dc0c){return _0x54dc0c;})['then'](function(_0x206cc6){if(_0x206cc6){_0x20ac35[_0x4f1c('0x29')]=_0x206cc6[0x0];}if(_0x20ac35['UserId']){return db[_0x4f1c('0x2a')][_0x4f1c('0x2b')]({'where':{'id':_0x20ac35[_0x4f1c('0x2c')]},'attributes':['id','name',_0x4f1c('0x2d'),_0x4f1c('0x2e'),_0x4f1c('0x2f')],'raw':!![]})[_0x4f1c('0x1d')](function(_0x39d67b){_0x20ac35[_0x4f1c('0x30')]=util['format'](_0x4f1c('0x31'),_0x39d67b[_0x4f1c('0x32')]);_0x20ac35[_0x4f1c('0x23')]=_0x34cb12;_0x20ac35[_0x4f1c('0x33')]=_0x39d67b;return request({'event':_0x4f1c('0x34'),'message':_0x20ac35});})[_0x4f1c('0x22')](function(_0xcc5e0c){console[_0x4f1c('0x20')](_0xcc5e0c);});}else{return request({'event':'outgoingmessage','message':_0x20ac35});}});};}function afterCreate(_0x3287e9,_0x1cfd8f){return function(_0x5b0f59,_0x11f984){_0x5b0f59=_0x5b0f59[_0x4f1c('0x35')]({'plain':!![]});_0x5b0f59[_0x4f1c('0x23')]=_0x3287e9;_0x5b0f59['event']=_0x4f1c('0x36');var _0xb12116='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b0f59[_0x4f1c('0x37')];return db[_0x4f1c('0x38')][_0x4f1c('0x25')](_0xb12116,{'type':db[_0x4f1c('0x26')][_0x4f1c('0x27')][_0x4f1c('0x28')],'raw':!![]})[_0x4f1c('0x1d')](function(_0x415074){return _0x415074;})[_0x4f1c('0x1d')](function(_0x36b096){if(_0x36b096){_0x5b0f59[_0x4f1c('0x29')]=_0x36b096[0x0];}return request({'event':_0x1cfd8f,'message':_0x5b0f59});});};}function afterUpdate(_0x2d62e6,_0x58d599){return function(_0xa00ad0,_0x2f9884){if(_0xa00ad0[_0x4f1c('0x39')]('closed')&&_0xa00ad0[_0x4f1c('0x3a')]){_0xa00ad0=_0xa00ad0['get']({'plain':!![]});_0xa00ad0['channel']=_0x2d62e6;_0xa00ad0[_0x4f1c('0x24')]=_0x4f1c('0x3a');var _0x2f16fa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa00ad0['ContactId'];return db[_0x4f1c('0x38')][_0x4f1c('0x25')](_0x2f16fa,{'type':db[_0x4f1c('0x26')][_0x4f1c('0x27')][_0x4f1c('0x28')],'raw':!![]})[_0x4f1c('0x1d')](function(_0x1c2fd6){return _0x1c2fd6;})[_0x4f1c('0x1d')](function(_0x429eb6){if(_0x429eb6){_0xa00ad0[_0x4f1c('0x29')]=_0x429eb6[0x0];}if(_0xa00ad0[_0x4f1c('0x2c')]){return db[_0x4f1c('0x2a')][_0x4f1c('0x2b')]({'where':{'id':_0xa00ad0[_0x4f1c('0x2c')]},'attributes':['id',_0x4f1c('0x32'),_0x4f1c('0x2d'),_0x4f1c('0x2e'),_0x4f1c('0x2f')],'raw':!![]})[_0x4f1c('0x1d')](function(_0x2e957d){_0xa00ad0[_0x4f1c('0x30')]=util['format'](_0x4f1c('0x31'),_0x2e957d[_0x4f1c('0x32')]);_0xa00ad0[_0x4f1c('0x33')]=_0x2e957d;return request({'event':_0x58d599,'message':_0xa00ad0});})[_0x4f1c('0x22')](function(_0x2920e2){console[_0x4f1c('0x20')](_0x2920e2);});}else{return request({'event':_0x58d599,'message':_0xa00ad0});}});}};}exports['default']=function(){for(var _0x55e017=0x0;_0x55e017<triggers[_0x4f1c('0x3b')];_0x55e017+=0x1){if(db[_0x4f1c('0x3c')](triggers[_0x55e017]['model'])){db[triggers[_0x55e017]['model']][_0x4f1c('0x3d')](triggers[_0x55e017][_0x4f1c('0x24')],triggers[_0x55e017][_0x4f1c('0x3e')](triggers[_0x55e017][_0x4f1c('0x23')]['toLowerCase'](),triggers[_0x55e017][_0x4f1c('0x3f')]));}}};
\ No newline at end of file
index 1624721..535c63c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40cc=['getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','sms','openchannel'];(function(_0x36940e,_0x11f338){var _0x3283f2=function(_0x418008){while(--_0x418008){_0x36940e['push'](_0x36940e['shift']());}};_0x3283f2(++_0x11f338);}(_0x40cc,0x70));var _0xc40c=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x40cc[_0x1d87fc];return _0x492b56;};'use strict';var _=require(_0xc40c('0x0'));var BPromise=require(_0xc40c('0x1'));var db=require(_0xc40c('0x2'))['db'];var util=require(_0xc40c('0x3'));var channels=[_0xc40c('0x4'),_0xc40c('0x5'),'chat','fax',_0xc40c('0x6'),'whatsapp',_0xc40c('0x7')];exports[_0xc40c('0x8')]=function(){return channels;};exports[_0xc40c('0x9')]=function(_0x49a13e){_0x49a13e=_0x49a13e[_0xc40c('0xa')]();return _[_0xc40c('0xb')](channels,_0x49a13e);};exports[_0xc40c('0xc')]=function(_0x36de58,_0x24c556,_0x3274dc,_0x2dc343){var _0x242685={'loginAttempts':_0x24c556,'blocked':_0x3274dc};if(!_[_0xc40c('0xd')](_0x2dc343)){_0x242685[_0xc40c('0xe')]=_0x2dc343;}return _0x36de58['updateAttributes'](_0x242685);};exports[_0xc40c('0xf')]=function(_0x4fe6d3){return new BPromise(function(_0x5d304f,_0x3ee720){var _0x326e97=0x0;if(_0x4fe6d3[_0xc40c('0x10')]!==_0xc40c('0x11')){_0x5d304f(_0x4fe6d3);}db[_0xc40c('0x12')][_0xc40c('0x13')]({'where':{'role':_0xc40c('0x11'),'online':!![],'id':{'$ne':_0x4fe6d3['id']}}})[_0xc40c('0x14')](function(_0xf28366){_0x326e97=_0xf28366;return util[_0xc40c('0xf')]();})['then'](function(_0x3be5ca){if(_0x3be5ca&&_0x3be5ca[_0xc40c('0x15')]&&_0x326e97>=_0x3be5ca[_0xc40c('0x15')]){throw Error(_0xc40c('0x16'));}_0x5d304f(_0x4fe6d3);})[_0xc40c('0x17')](function(_0x795753){_0x3ee720(_0x795753);});});};
\ No newline at end of file
+var _0x2a08=['isUndefined','blockedAt','role','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','voice','chat','fax','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser'];(function(_0x41ac93,_0x320728){var _0x3c8c88=function(_0x21b277){while(--_0x21b277){_0x41ac93['push'](_0x41ac93['shift']());}};_0x3c8c88(++_0x320728);}(_0x2a08,0x6b));var _0x82a0=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x2a08[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x82a0('0x0'));var BPromise=require(_0x82a0('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x82a0('0x2'));var channels=[_0x82a0('0x3'),'mail',_0x82a0('0x4'),_0x82a0('0x5'),'sms',_0x82a0('0x6'),_0x82a0('0x7')];exports[_0x82a0('0x8')]=function(){return channels;};exports[_0x82a0('0x9')]=function(_0x405a84){_0x405a84=_0x405a84[_0x82a0('0xa')]();return _[_0x82a0('0xb')](channels,_0x405a84);};exports[_0x82a0('0xc')]=function(_0x64faac,_0xebe05f,_0x10d64f,_0x2f38cf){var _0x5a8896={'loginAttempts':_0xebe05f,'blocked':_0x10d64f};if(!_[_0x82a0('0xd')](_0x2f38cf)){_0x5a8896[_0x82a0('0xe')]=_0x2f38cf;}return _0x64faac['updateAttributes'](_0x5a8896);};exports['getLicense']=function(_0x2914cd){return new BPromise(function(_0x1846f4,_0x550fc4){var _0x40d6aa=0x0;if(_0x2914cd[_0x82a0('0xf')]!==_0x82a0('0x10')){_0x1846f4(_0x2914cd);}db[_0x82a0('0x11')][_0x82a0('0x12')]({'where':{'role':_0x82a0('0x10'),'online':!![],'id':{'$ne':_0x2914cd['id']}}})[_0x82a0('0x13')](function(_0x24eb27){_0x40d6aa=_0x24eb27;return util[_0x82a0('0x14')]();})[_0x82a0('0x13')](function(_0x16b889){if(_0x16b889&&_0x16b889[_0x82a0('0x15')]&&_0x40d6aa>=_0x16b889['agents']){throw Error(_0x82a0('0x16'));}_0x1846f4(_0x2914cd);})[_0x82a0('0x17')](function(_0x44d2a7){_0x550fc4(_0x44d2a7);});});};
\ No newline at end of file
index 32e635e..62dfbc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ad9=['status','json','send'];(function(_0x162048,_0x411f1b){var _0x2339bf=function(_0x4101a2){while(--_0x4101a2){_0x162048['push'](_0x162048['shift']());}};_0x2339bf(++_0x411f1b);}(_0x3ad9,0x1b9));var _0x93ad=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x3ad9[_0x229d7e];return _0xa78280;};'use strict';module['exports'][0x194]=function pageNotFound(_0x310564,_0x3fda30){var _0x347b38='404';var _0x5228e0=0x194;var _0x2023ef={'status':_0x5228e0};_0x3fda30[_0x93ad('0x0')](_0x2023ef[_0x93ad('0x0')]);_0x3fda30['render'](_0x347b38,{},function(_0x2b9aec,_0x2701ec){if(_0x2b9aec){return _0x3fda30[_0x93ad('0x0')](_0x2023ef[_0x93ad('0x0')])[_0x93ad('0x1')](_0x2023ef);}_0x3fda30[_0x93ad('0x2')](_0x2701ec);});};
\ No newline at end of file
+var _0x2e3a=['send','exports','404','status','render','json'];(function(_0x480706,_0x18e6db){var _0x20bc42=function(_0x50fa46){while(--_0x50fa46){_0x480706['push'](_0x480706['shift']());}};_0x20bc42(++_0x18e6db);}(_0x2e3a,0x145));var _0xa2e3=function(_0x45356b,_0x4bcd63){_0x45356b=_0x45356b-0x0;var _0xb3884e=_0x2e3a[_0x45356b];return _0xb3884e;};'use strict';module[_0xa2e3('0x0')][0x194]=function pageNotFound(_0x5da920,_0x31d096){var _0x538c72=_0xa2e3('0x1');var _0xf62ed=0x194;var _0x415808={'status':_0xf62ed};_0x31d096[_0xa2e3('0x2')](_0x415808[_0xa2e3('0x2')]);_0x31d096[_0xa2e3('0x3')](_0x538c72,{},function(_0x116806,_0x287fec){if(_0x116806){return _0x31d096[_0xa2e3('0x2')](_0x415808[_0xa2e3('0x2')])[_0xa2e3('0x4')](_0x415808);}_0x31d096[_0xa2e3('0x5')](_0x287fec);});};
\ No newline at end of file
index eef24b3..924bbd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ff=['../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','Realtime','../api/realtime/realtime.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','cascade','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteraction','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','WhatsappInteractions','VoiceQueues','MailQueue','MailQueues','ChatQueues','FaxQueue','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','uniqueid','MailAccountId','MailServerOut','Imap','Smtp','Dispositions','Answers','Messages','Interactions','Applications','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Contact','ContactId','Owner','mail_interaction_has_tags','Users','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','Dashboard','Items','FaxAccountId','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','ThroughTags','SmsQueueId','OpenchannelAccountId','OpenchannelQueue','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','Tags','Attachments','ChatInternalMessage','ChatGroupId','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','Campaign','OwnerId','CampaignId','OneAll','AutomationAllId','Automation','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','ItemTypeId','AllConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Field','Descriptions','DeskAccount','int_desk_configuration_has_tags','VariableId','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowAccount','FreshsalesConfiguration','ChatQueueReport','SessionId','ProjectId','team_has_chat_queues','FaxQueues','team_has_sms_queues','team_has_openchannel_queues','SquareProjectId','Lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','user_has_voice_prefixes','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','path','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','utf8_general_ci','database','username','password','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.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','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage'];(function(_0x3f8fe5,_0x57eb25){var _0x353c84=function(_0x2dd468){while(--_0x2dd468){_0x3f8fe5['push'](_0x3f8fe5['shift']());}};_0x353c84(++_0x57eb25);}(_0xd7ff,0xeb));var _0xfd7f=function(_0x343bc,_0x44913c){_0x343bc=_0x343bc-0x0;var _0x9c18b7=_0xd7ff[_0x343bc];return _0x9c18b7;};'use strict';var path=require(_0xfd7f('0x0'));var config=require(_0xfd7f('0x1'));var Sequelize=require(_0xfd7f('0x2'));var _=require(_0xfd7f('0x3'));var jstz=require('jstz');var timezone=jstz[_0xfd7f('0x4')]();config['sequelize']=_[_0xfd7f('0x5')](config[_0xfd7f('0x2')],{'database':_0xfd7f('0x6'),'username':_0xfd7f('0x7'),'password':_0xfd7f('0x8'),'options':{'host':_0xfd7f('0x9'),'port':0xcea,'dialect':_0xfd7f('0xa'),'dialectOptions':{'charset':_0xfd7f('0xb')},'logging':![],'timezone':timezone[_0xfd7f('0xc')](),'define':{'charset':_0xfd7f('0xd'),'collate':'utf8_general_ci'}}});config[_0xfd7f('0xe')]=_[_0xfd7f('0x5')](config[_0xfd7f('0xe')],{'database':'motion2','username':'xcall','password':_0xfd7f('0x8'),'options':{'host':_0xfd7f('0x9'),'port':0xcea,'dialect':_0xfd7f('0xa'),'dialectOptions':{'charset':_0xfd7f('0xb')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xfd7f('0xd'),'collate':_0xfd7f('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xfd7f('0x10')],config['sequelize'][_0xfd7f('0x11')],config[_0xfd7f('0x2')][_0xfd7f('0x12')],config['sequelize'][_0xfd7f('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory']['database'],config[_0xfd7f('0xe')][_0xfd7f('0x11')],config[_0xfd7f('0xe')][_0xfd7f('0x12')],config[_0xfd7f('0xe')][_0xfd7f('0x13')])};db[_0xfd7f('0x14')]=db['sequelize'][_0xfd7f('0x15')]('../api/user/user.model');db[_0xfd7f('0x16')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x17'));db[_0xfd7f('0x18')]=db['sequelize'][_0xfd7f('0x15')]('../api/voiceContext/voiceContext.model');db[_0xfd7f('0x19')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x1a'));db[_0xfd7f('0x1b')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xfd7f('0x1c')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x1d'));db[_0xfd7f('0x1e')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x1f'));db[_0xfd7f('0x20')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x21'));db[_0xfd7f('0x22')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x23'));db[_0xfd7f('0x24')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x25'));db[_0xfd7f('0x26')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x27'));db['VoiceDialReport']=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x28'));db[_0xfd7f('0x29')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x2a'));db[_0xfd7f('0x2b')]=db['sequelize']['import'](_0xfd7f('0x2c'));db[_0xfd7f('0x2d')]=db['sequelize']['import'](_0xfd7f('0x2e'));db[_0xfd7f('0x2f')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x30'));db[_0xfd7f('0x31')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x32'));db['UserVoiceQueueRt']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x33'));db[_0xfd7f('0x34')]=db[_0xfd7f('0x2')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0xfd7f('0x35')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x36'));db[_0xfd7f('0x37')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x38'));db['UserFaxQueue']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x39'));db[_0xfd7f('0x3a')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x3b'));db[_0xfd7f('0x3c')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x3d'));db[_0xfd7f('0x3e')]=db['sequelize']['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xfd7f('0x3f')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x40'));db['MailServerOut']=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x41'));db[_0xfd7f('0x42')]=db['sequelize']['import'](_0xfd7f('0x43'));db['MailQueue']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x44'));db['MailSubstatus']=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x45'));db['MailInteraction']=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x46'));db[_0xfd7f('0x47')]=db['sequelize']['import'](_0xfd7f('0x48'));db[_0xfd7f('0x49')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/mailApplication/mailApplication.model');db[_0xfd7f('0x4a')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x4b'));db['Dashboard']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x4c'));db[_0xfd7f('0x4d')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x4e'));db[_0xfd7f('0x4f')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/faxAccount/faxAccount.model');db[_0xfd7f('0x50')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x51'));db[_0xfd7f('0x52')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x53'));db[_0xfd7f('0x54')]=db['sequelize']['import'](_0xfd7f('0x55'));db['FaxQueue']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x56'));db[_0xfd7f('0x57')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/faxQueueReport/faxQueueReport.model');db[_0xfd7f('0x58')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x59'));db[_0xfd7f('0x5a')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/smsInteraction/smsInteraction.model');db[_0xfd7f('0x5b')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x5c'));db[_0xfd7f('0x5d')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x5e'));db[_0xfd7f('0x5f')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x60'));db[_0xfd7f('0x61')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/openchannelApplication/openchannelApplication.model');db[_0xfd7f('0x62')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x63'));db[_0xfd7f('0x64')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x65'));db['ChatWebsite']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x66'));db['OpenchannelQueueReport']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x67'));db['ChatApplication']=db['sequelize']['import'](_0xfd7f('0x68'));db[_0xfd7f('0x69')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x6a'));db['ChatMessage']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x6b'));db[_0xfd7f('0x6c')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xfd7f('0x6d')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x6e'));db[_0xfd7f('0x6f')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x70'));db[_0xfd7f('0x71')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x72'));db[_0xfd7f('0x73')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x74'));db[_0xfd7f('0x75')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x76'));db[_0xfd7f('0x77')]=db[_0xfd7f('0x2')]['import']('../api/cmHopper/cmHopper.model');db[_0xfd7f('0x78')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x79'));db[_0xfd7f('0x7a')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x7b'));db[_0xfd7f('0x7c')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x7d'));db[_0xfd7f('0x7e')]=db['sequelize']['import'](_0xfd7f('0x7f'));db[_0xfd7f('0x80')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x81'));db[_0xfd7f('0x82')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x83'));db['Automation']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x84'));db[_0xfd7f('0x85')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x86'));db[_0xfd7f('0x87')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x88'));db[_0xfd7f('0x89')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x8a'));db[_0xfd7f('0x8b')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x8c'));db[_0xfd7f('0x8d')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x8e'));db[_0xfd7f('0x8f')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/cdr/cdr.model');db[_0xfd7f('0x90')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x91'));db[_0xfd7f('0x92')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x93'));db[_0xfd7f('0x94')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/sound/sound.model');db[_0xfd7f('0x95')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x96'));db[_0xfd7f('0x97')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x98'));db[_0xfd7f('0x99')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x9a'));db[_0xfd7f('0x9b')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x9c'));db[_0xfd7f('0x9d')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x9e'));db[_0xfd7f('0x9f')]=db[_0xfd7f('0x2')]['import']('../api/trigger/trigger.model');db[_0xfd7f('0xa0')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0xa1'));db[_0xfd7f('0xa2')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/integration/integration.model');db['IntegrationReport']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xa3'));db[_0xfd7f('0xa4')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xa5'));db[_0xfd7f('0xa6')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xa7'));db[_0xfd7f('0xa8')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xfd7f('0xa9')]=db['sequelize'][_0xfd7f('0x15')]('../api/analyticMetric/analyticMetric.model');db[_0xfd7f('0xaa')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0xab'));db[_0xfd7f('0xac')]=db[_0xfd7f('0x2')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0xfd7f('0xad')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xae'));db[_0xfd7f('0xaf')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xfd7f('0xb0')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xb1'));db[_0xfd7f('0xb2')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xb3'));db[_0xfd7f('0xb4')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xb5'));db[_0xfd7f('0xb6')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xb7'));db['DeskAccount']=db[_0xfd7f('0x2')]['import'](_0xfd7f('0xb8'));db[_0xfd7f('0xb9')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0xba'));db[_0xfd7f('0xbb')]=db['sequelize']['import']('../api/intDeskField/intDeskField.model');db[_0xfd7f('0xbc')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xbd'));db[_0xfd7f('0xbe')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xfd7f('0xbf')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xc0'));db[_0xfd7f('0xc1')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xc2'));db[_0xfd7f('0xc3')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xc4'));db[_0xfd7f('0xc5')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0xc6'));db[_0xfd7f('0xc7')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xc8'));db[_0xfd7f('0xc9')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0xca'));db[_0xfd7f('0xcb')]=db['sequelize'][_0xfd7f('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xfd7f('0xcc')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0xcd'));db['VtigerConfiguration']=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0xce'));db[_0xfd7f('0xcf')]=db['sequelize'][_0xfd7f('0x15')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db['sequelize']['import'](_0xfd7f('0xd0'));db[_0xfd7f('0xd1')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xfd7f('0xd2')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xd3'));db[_0xfd7f('0xd4')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xfd7f('0xd5')]=db['sequelize'][_0xfd7f('0x15')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xfd7f('0xd6')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xd7'));db[_0xfd7f('0xd8')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xd9'));db['FreshsalesConfiguration']=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xfd7f('0xda')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xdb'));db[_0xfd7f('0xa2')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/integration/integration.model');db[_0xfd7f('0xdc')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xdd'));db['ChatQueueReport']=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0xde'));db['ChatInternalMessage']=db[_0xfd7f('0x2')]['import'](_0xfd7f('0xdf'));db[_0xfd7f('0xe0')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xe1'));db[_0xfd7f('0xe2')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0xe3'));db[_0xfd7f('0xe4')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xe5'));db[_0xfd7f('0xe6')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/smsQueueReport/smsQueueReport.model');db[_0xfd7f('0xe7')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0xe8'));db[_0xfd7f('0xe9')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0xea'));db[_0xfd7f('0xeb')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xec'));db[_0xfd7f('0xed')]=db['sequelize'][_0xfd7f('0x15')]('../api/setting/setting.model');db[_0xfd7f('0xee')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/squareOdbc/squareOdbc.model');db[_0xfd7f('0xef')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xf0'));db['SquareRecording']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xf1'));db['SquareMessage']=db['sequelize']['import'](_0xfd7f('0xf2'));db[_0xfd7f('0xf3')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/team/team.model');db[_0xfd7f('0xf4')]=db['sequelize']['import'](_0xfd7f('0xf5'));db['Campaign']=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xf6'));db[_0xfd7f('0xf7')]=db['sequelize'][_0xfd7f('0x15')]('../api/migration/migration.model');db[_0xfd7f('0xf8')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xf9'));db[_0xfd7f('0xfa')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0xfb'));db[_0xfd7f('0xfc')]=db['sequelize'][_0xfd7f('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0xfd7f('0xfd')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0xfe'));db[_0xfd7f('0xff')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x100'));db[_0xfd7f('0x101')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x102'));db[_0xfd7f('0x103')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x104'));db[_0xfd7f('0x105')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x106'));db[_0xfd7f('0x107')]=db['sequelize']['import'](_0xfd7f('0x108'));db[_0xfd7f('0x109')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x10a'));db[_0xfd7f('0x10b')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x10c'));db[_0xfd7f('0x10d')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x10e'));db[_0xfd7f('0x10f')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/userNotification/userNotification.model');db[_0xfd7f('0x110')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x111'));db[_0xfd7f('0x112')]=db[_0xfd7f('0x2')]['import'](_0xfd7f('0x113'));db[_0xfd7f('0x114')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x115'));db[_0xfd7f('0x116')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x117'));db[_0xfd7f('0x118')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x119'));db[_0xfd7f('0x11a')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xfd7f('0x11b')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0xfd7f('0x11c')]=db[_0xfd7f('0x2')][_0xfd7f('0x15')](_0xfd7f('0x11d'));db[_0xfd7f('0x11e')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x11f'));db[_0xfd7f('0x120')]=db['sequelize'][_0xfd7f('0x15')](_0xfd7f('0x121'));db[_0xfd7f('0x14')][_0xfd7f('0x122')](db[_0xfd7f('0x22')],{'as':_0xfd7f('0x22'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x124')});db[_0xfd7f('0x14')][_0xfd7f('0x125')](db[_0xfd7f('0x1e')],{'as':_0xfd7f('0x126'),'foreignKey':'UserId'});db[_0xfd7f('0x14')][_0xfd7f('0x125')](db[_0xfd7f('0x127')],{'as':_0xfd7f('0x128'),'foreignKey':_0xfd7f('0x124')});db['User'][_0xfd7f('0x125')](db[_0xfd7f('0x19')],{'as':_0xfd7f('0x129'),'onDelete':_0xfd7f('0x123'),'hooks':!![]});db[_0xfd7f('0x14')][_0xfd7f('0x125')](db[_0xfd7f('0x7a')],{'as':'HopperFinals','foreignKey':_0xfd7f('0x124')});db[_0xfd7f('0x14')][_0xfd7f('0x125')](db[_0xfd7f('0x7c')],{'as':_0xfd7f('0x12a'),'foreignKey':'UserId'});db['User'][_0xfd7f('0x125')](db[_0xfd7f('0x7e')],{'as':_0xfd7f('0x7e'),'foreignKey':_0xfd7f('0x124')});db['User'][_0xfd7f('0x125')](db[_0xfd7f('0x62')],{'as':_0xfd7f('0x12b'),'foreignKey':_0xfd7f('0x124')});db['User'][_0xfd7f('0x125')](db['ChatInteraction'],{'as':_0xfd7f('0x12c'),'foreignKey':_0xfd7f('0x124')});db[_0xfd7f('0x14')][_0xfd7f('0x125')](db[_0xfd7f('0x5a')],{'as':'SmsInteractions','foreignKey':'UserId'});db['User'][_0xfd7f('0x125')](db[_0xfd7f('0x52')],{'as':_0xfd7f('0x12d'),'foreignKey':_0xfd7f('0x124')});db[_0xfd7f('0x14')]['hasMany'](db['MailInteraction'],{'as':_0xfd7f('0x12e'),'foreignKey':'UserId'});db[_0xfd7f('0x14')][_0xfd7f('0x125')](db[_0xfd7f('0x114')],{'as':'WhatsappInteractions','foreignKey':_0xfd7f('0x124')});db[_0xfd7f('0x14')][_0xfd7f('0x125')](db[_0xfd7f('0x10f')],{'as':_0xfd7f('0x12f'),'foreignKey':_0xfd7f('0x130')});db[_0xfd7f('0x14')][_0xfd7f('0x131')](db['UserProfile'],{'as':_0xfd7f('0x109'),'foreignKey':_0xfd7f('0x132')});db['User'][_0xfd7f('0x133')](db['ChatGroup'],{'as':'Groups','through':_0xfd7f('0x134')});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x135'),'through':_0xfd7f('0x136')});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x105')],{'as':'Lists','through':_0xfd7f('0x137')});db['User']['belongsToMany'](db[_0xfd7f('0xf3')],{'through':_0xfd7f('0x138')});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x139')],{'as':_0xfd7f('0x12e'),'through':_0xfd7f('0x13a')});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x69')],{'as':'ChatInteractions','through':_0xfd7f('0x13b')});db['User'][_0xfd7f('0x133')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0xfd7f('0x13c')});db['User'][_0xfd7f('0x133')](db['SmsInteraction'],{'as':_0xfd7f('0x13d'),'through':'user_has_sms_interactions'});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x62')],{'as':'OpenchannelInteractions','through':_0xfd7f('0x13e')});db['User']['belongsToMany'](db[_0xfd7f('0x114')],{'as':_0xfd7f('0x13f'),'through':'user_has_whatsapp_interactions'});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x1c')],{'as':_0xfd7f('0x140'),'through':_0xfd7f('0x34'),'required':![]});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x141')],{'as':_0xfd7f('0x142'),'through':'UserMailQueue','required':![]});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x6d')],{'as':_0xfd7f('0x143'),'through':_0xfd7f('0x35'),'required':![],'hooks':!![]});db[_0xfd7f('0x14')]['belongsToMany'](db[_0xfd7f('0x144')],{'as':'FaxQueues','through':_0xfd7f('0x145'),'required':![]});db[_0xfd7f('0x14')]['belongsToMany'](db[_0xfd7f('0x5d')],{'as':_0xfd7f('0x146'),'through':'UserSmsQueue','required':![]});db['User'][_0xfd7f('0x133')](db['OpenchannelQueue'],{'as':_0xfd7f('0x147'),'through':_0xfd7f('0x3c'),'required':![]});db['User'][_0xfd7f('0x133')](db[_0xfd7f('0x11b')],{'as':_0xfd7f('0x148'),'through':'UserWhatsappQueue','required':![]});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x105')],{'through':_0xfd7f('0x137')});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db['VoicePrefix'],{'as':_0xfd7f('0x149'),'through':'user_has_voice_prefixes','required':![]});db[_0xfd7f('0x14')]['belongsToMany'](db[_0xfd7f('0x14a')],{'as':_0xfd7f('0x14b'),'through':_0xfd7f('0x14c')});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0x4f')],{'as':'FaxAccounts','through':_0xfd7f('0x14d')});db[_0xfd7f('0x14')]['belongsToMany'](db[_0xfd7f('0x42')],{'as':_0xfd7f('0x14e'),'through':_0xfd7f('0x14f')});db['User'][_0xfd7f('0x133')](db['OpenchannelAccount'],{'as':_0xfd7f('0x150'),'through':_0xfd7f('0x151')});db[_0xfd7f('0x14')]['belongsToMany'](db[_0xfd7f('0x58')],{'as':'SmsAccounts','through':_0xfd7f('0x152')});db[_0xfd7f('0x14')]['belongsToMany'](db[_0xfd7f('0x110')],{'as':_0xfd7f('0x153'),'through':_0xfd7f('0x154')});db[_0xfd7f('0x14')][_0xfd7f('0x133')](db[_0xfd7f('0xef')],{'as':_0xfd7f('0x155'),'through':_0xfd7f('0x156')});db[_0xfd7f('0x16')][_0xfd7f('0x125')](db[_0xfd7f('0x19')],{'as':_0xfd7f('0x157'),'onDelete':_0xfd7f('0x123'),'foreignKey':'ChanSpyId'});db[_0xfd7f('0x18')][_0xfd7f('0x125')](db['VoiceExtension'],{'onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x19')][_0xfd7f('0x125')](db[_0xfd7f('0x19')],{'as':'Applications','onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x1b')][_0xfd7f('0x133')](db[_0xfd7f('0x94')],{'as':_0xfd7f('0x158'),'through':_0xfd7f('0x159')});db['VoiceQueue'][_0xfd7f('0x125')](db[_0xfd7f('0x127')],{'as':_0xfd7f('0x15a'),'foreignKey':'VoiceQueueId'});db[_0xfd7f('0x1c')][_0xfd7f('0x125')](db[_0xfd7f('0x77')],{'as':_0xfd7f('0x15b'),'foreignKey':_0xfd7f('0x15c')});db[_0xfd7f('0x1c')]['hasMany'](db[_0xfd7f('0x7a')],{'as':_0xfd7f('0x15d'),'foreignKey':'VoiceQueueId'});db[_0xfd7f('0x1c')]['hasMany'](db[_0xfd7f('0x7c')],{'as':_0xfd7f('0x15e'),'foreignKey':'VoiceQueueId'});db[_0xfd7f('0x1c')]['hasMany'](db['ReportAgentPreview'],{'as':_0xfd7f('0x7e'),'foreignKey':'VoiceQueueId'});db[_0xfd7f('0x1c')][_0xfd7f('0x125')](db[_0xfd7f('0x78')],{'as':_0xfd7f('0x15f'),'foreignKey':_0xfd7f('0x15c')});db['VoiceQueue'][_0xfd7f('0x125')](db['JscriptySessionReport'],{'as':_0xfd7f('0x160'),'foreignKey':_0xfd7f('0x15c')});db[_0xfd7f('0x1c')][_0xfd7f('0x131')](db['Trunk'],{'as':_0xfd7f('0x2f'),'foreignKey':_0xfd7f('0x161')});db[_0xfd7f('0x1c')][_0xfd7f('0x131')](db[_0xfd7f('0x2f')],{'as':_0xfd7f('0x162'),'foreignKey':_0xfd7f('0x163')});db[_0xfd7f('0x1c')][_0xfd7f('0x131')](db[_0xfd7f('0x8b')],{'as':_0xfd7f('0x8b'),'foreignKey':_0xfd7f('0x164')});db[_0xfd7f('0x1c')][_0xfd7f('0x131')](db[_0xfd7f('0x8d')],{'as':_0xfd7f('0x165'),'foreignKey':_0xfd7f('0x166')});db['VoiceQueue'][_0xfd7f('0x133')](db[_0xfd7f('0x105')],{'as':'Lists','through':_0xfd7f('0x167')});db[_0xfd7f('0x1c')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':_0xfd7f('0x34')});db['VoiceQueue'][_0xfd7f('0x133')](db[_0xfd7f('0xf3')],{'as':_0xfd7f('0x169'),'through':_0xfd7f('0x120')});db[_0xfd7f('0x1c')][_0xfd7f('0x133')](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x16a'),'through':_0xfd7f('0x16b')});db[_0xfd7f('0x1e')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x14'),'foreignKey':'UserId'});db['ScreenRecording'][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x14'),'foreignKey':_0xfd7f('0x124')});db[_0xfd7f('0x22')][_0xfd7f('0x125')](db[_0xfd7f('0x24')],{'as':'Messages','onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x16c'),'sourceKey':_0xfd7f('0x16d')});db['VoiceMailMessage'][_0xfd7f('0x131')](db[_0xfd7f('0x22')],{'foreignKey':_0xfd7f('0x16c'),'targetKey':_0xfd7f('0x16d')});db['VoiceCallReport']['hasMany'](db[_0xfd7f('0x2b')],{'as':'QueueCalls','foreignKey':_0xfd7f('0x16e'),'constraints':![]});db[_0xfd7f('0x26')][_0xfd7f('0x125')](db[_0xfd7f('0x29')],{'as':'AgentReports','foreignKey':_0xfd7f('0x16e'),'constraints':![]});db[_0xfd7f('0x26')]['belongsTo'](db['User'],{'as':_0xfd7f('0x14'),'foreignKey':_0xfd7f('0x124')});db[_0xfd7f('0x26')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailServerIn'][_0xfd7f('0x131')](db[_0xfd7f('0x42')],{'as':_0xfd7f('0x42'),'foreignKey':_0xfd7f('0x16f')});db[_0xfd7f('0x170')][_0xfd7f('0x131')](db['MailAccount'],{'as':_0xfd7f('0x42'),'foreignKey':_0xfd7f('0x16f')});db['MailAccount'][_0xfd7f('0x122')](db[_0xfd7f('0x3f')],{'as':_0xfd7f('0x171'),'onDelete':'cascade'});db[_0xfd7f('0x42')][_0xfd7f('0x122')](db['MailServerOut'],{'as':_0xfd7f('0x172'),'onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x42')][_0xfd7f('0x125')](db[_0xfd7f('0x87')],{'as':_0xfd7f('0x173'),'foreignKey':_0xfd7f('0x16f'),'onDelete':'cascade'});db['MailAccount'][_0xfd7f('0x125')](db[_0xfd7f('0x85')],{'as':_0xfd7f('0x174'),'foreignKey':_0xfd7f('0x16f')});db[_0xfd7f('0x42')][_0xfd7f('0x125')](db[_0xfd7f('0x47')],{'as':_0xfd7f('0x175'),'foreignKey':_0xfd7f('0x16f')});db['MailAccount']['hasMany'](db[_0xfd7f('0x139')],{'as':_0xfd7f('0x176')});db[_0xfd7f('0x42')]['hasMany'](db['MailApplication'],{'as':_0xfd7f('0x177')});db[_0xfd7f('0x42')][_0xfd7f('0x131')](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x178'),'foreignKey':_0xfd7f('0x179')});db[_0xfd7f('0x42')]['belongsTo'](db[_0xfd7f('0x9d')],{'as':'Template','foreignKey':_0xfd7f('0x17a')});db[_0xfd7f('0x42')][_0xfd7f('0x131')](db[_0xfd7f('0x8d')],{'as':_0xfd7f('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xfd7f('0x42')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':_0xfd7f('0x14f')});db[_0xfd7f('0x141')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':'UserMailQueue'});db[_0xfd7f('0x141')]['belongsToMany'](db[_0xfd7f('0xf3')],{'through':_0xfd7f('0x17b'),'as':_0xfd7f('0x169')});db[_0xfd7f('0x139')]['hasMany'](db[_0xfd7f('0x47')],{'as':_0xfd7f('0x175'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x17c')});db[_0xfd7f('0x139')]['belongsTo'](db[_0xfd7f('0x42')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x16f')});db[_0xfd7f('0x139')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':_0xfd7f('0x17f')});db['MailInteraction'][_0xfd7f('0x131')](db['User'],{'as':_0xfd7f('0x180'),'foreignKey':_0xfd7f('0x124')});db['MailInteraction'][_0xfd7f('0x133')](db[_0xfd7f('0x95')],{'through':_0xfd7f('0x181'),'as':'Tags'});db['MailInteraction'][_0xfd7f('0x133')](db['Tag'],{'through':_0xfd7f('0x181'),'as':'ThroughTags'});db[_0xfd7f('0x139')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x182'),'through':_0xfd7f('0x13a'),'foreignKey':_0xfd7f('0x17c')});db['MailMessage']['hasMany'](db[_0xfd7f('0xf8')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage'][_0xfd7f('0x131')](db['User'],{'as':_0xfd7f('0x14')});db[_0xfd7f('0x47')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'onDelete':_0xfd7f('0x123'),'as':'Contact'});db[_0xfd7f('0x47')][_0xfd7f('0x131')](db['MailInteraction'],{'as':_0xfd7f('0x183'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xfd7f('0x131')](db[_0xfd7f('0x42')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x16f')});db[_0xfd7f('0x47')][_0xfd7f('0x131')](db[_0xfd7f('0x14a')],{'as':_0xfd7f('0x14a'),'foreignKey':_0xfd7f('0x184')});db['MailMessage'][_0xfd7f('0x131')](db[_0xfd7f('0x6c')],{'as':_0xfd7f('0x6c'),'foreignKey':_0xfd7f('0x185')});db['MailApplication'][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x49')][_0xfd7f('0x131')](db[_0xfd7f('0x141')],{'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x49')][_0xfd7f('0x131')](db[_0xfd7f('0x42')],{'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x49')][_0xfd7f('0x131')](db['Interval'],{'onDelete':_0xfd7f('0x186'),'foreignKey':_0xfd7f('0x164')});db['MailApplication'][_0xfd7f('0x131')](db['Tag'],{'onDelete':_0xfd7f('0x186'),'foreignKey':_0xfd7f('0x187')});db[_0xfd7f('0x4a')][_0xfd7f('0x131')](db[_0xfd7f('0x42')],{});db[_0xfd7f('0x4a')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xfd7f('0x179')});db[_0xfd7f('0x4a')]['belongsTo'](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x4a')][_0xfd7f('0x131')](db[_0xfd7f('0x139')],{});db[_0xfd7f('0x4a')][_0xfd7f('0x131')](db[_0xfd7f('0x47')],{});db[_0xfd7f('0x4a')]['belongsTo'](db[_0xfd7f('0x14')],{});db[_0xfd7f('0x4a')][_0xfd7f('0x131')](db[_0xfd7f('0x141')],{});db[_0xfd7f('0x188')]['hasMany'](db['DashboardItem'],{'as':_0xfd7f('0x189'),'onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x4f')]['hasMany'](db['Disposition'],{'as':_0xfd7f('0x173'),'foreignKey':_0xfd7f('0x18a'),'onDelete':'cascade'});db[_0xfd7f('0x4f')][_0xfd7f('0x125')](db[_0xfd7f('0x85')],{'as':_0xfd7f('0x174'),'foreignKey':_0xfd7f('0x18a')});db['FaxAccount'][_0xfd7f('0x125')](db[_0xfd7f('0x52')],{'as':_0xfd7f('0x176')});db[_0xfd7f('0x4f')]['hasMany'](db['FaxApplication'],{'as':_0xfd7f('0x177')});db['FaxAccount'][_0xfd7f('0x125')](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount'][_0xfd7f('0x125')](db[_0xfd7f('0x54')],{'as':_0xfd7f('0x175')});db[_0xfd7f('0x4f')][_0xfd7f('0x131')](db[_0xfd7f('0x2f')],{'as':'Trunk'});db[_0xfd7f('0x4f')][_0xfd7f('0x131')](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x178'),'foreignKey':_0xfd7f('0x179')});db[_0xfd7f('0x4f')][_0xfd7f('0x131')](db[_0xfd7f('0x8d')],{'as':_0xfd7f('0x165'),'foreignKey':_0xfd7f('0x166')});db[_0xfd7f('0x4f')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0xfd7f('0x131')](db['User'],{'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x50')]['belongsTo'](db['FaxQueue'],{'onDelete':'restrict'});db[_0xfd7f('0x50')][_0xfd7f('0x131')](db[_0xfd7f('0x4f')],{'onDelete':_0xfd7f('0x186')});db['FaxApplication'][_0xfd7f('0x131')](db['Tag'],{'onDelete':_0xfd7f('0x186'),'foreignKey':_0xfd7f('0x187')});db[_0xfd7f('0x52')][_0xfd7f('0x125')](db[_0xfd7f('0x54')],{'as':_0xfd7f('0x175'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x18b')});db['FaxInteraction'][_0xfd7f('0x131')](db[_0xfd7f('0x4f')],{'as':_0xfd7f('0x17d'),'foreignKey':'FaxAccountId'});db[_0xfd7f('0x52')]['belongsTo'](db[_0xfd7f('0x75')],{'as':'Contact','foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x52')][_0xfd7f('0x131')](db['User'],{'as':'Owner','foreignKey':_0xfd7f('0x124')});db[_0xfd7f('0x52')]['belongsToMany'](db[_0xfd7f('0x95')],{'through':_0xfd7f('0x18c'),'as':'Tags'});db[_0xfd7f('0x52')][_0xfd7f('0x133')](db['Tag'],{'through':_0xfd7f('0x18c'),'as':'ThroughTags'});db['FaxInteraction'][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x182'),'through':_0xfd7f('0x13c'),'foreignKey':'FaxInteractionId'});db[_0xfd7f('0x54')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'onDelete':_0xfd7f('0x123'),'as':_0xfd7f('0x14')});db['FaxMessage'][_0xfd7f('0x131')](db[_0xfd7f('0x52')],{'as':'Interaction','foreignKey':_0xfd7f('0x18b')});db[_0xfd7f('0x54')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'onDelete':_0xfd7f('0x123'),'as':_0xfd7f('0x17e')});db[_0xfd7f('0x54')][_0xfd7f('0x131')](db[_0xfd7f('0xf8')],{'as':'Attachment','foreignKey':_0xfd7f('0x18d')});db['FaxMessage']['belongsTo'](db[_0xfd7f('0x4f')],{'as':_0xfd7f('0x17d'),'foreignKey':'FaxAccountId'});db[_0xfd7f('0x144')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':'Agents','through':_0xfd7f('0x145')});db[_0xfd7f('0x144')][_0xfd7f('0x133')](db[_0xfd7f('0xf3')],{'through':_0xfd7f('0x18e'),'as':_0xfd7f('0x169')});db['FaxQueueReport'][_0xfd7f('0x131')](db[_0xfd7f('0x4f')],{});db[_0xfd7f('0x57')][_0xfd7f('0x131')](db[_0xfd7f('0x105')],{'as':'List','foreignKey':'ListId'});db['FaxQueueReport'][_0xfd7f('0x131')](db['CmContact'],{'as':_0xfd7f('0x17e'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x57')][_0xfd7f('0x131')](db[_0xfd7f('0x52')],{});db[_0xfd7f('0x57')][_0xfd7f('0x131')](db['FaxMessage'],{});db[_0xfd7f('0x57')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{});db[_0xfd7f('0x57')][_0xfd7f('0x131')](db[_0xfd7f('0x144')],{});db['SmsAccount'][_0xfd7f('0x125')](db[_0xfd7f('0x87')],{'as':_0xfd7f('0x173'),'foreignKey':_0xfd7f('0x18f'),'onDelete':_0xfd7f('0x123')});db['SmsAccount'][_0xfd7f('0x125')](db[_0xfd7f('0x85')],{'as':_0xfd7f('0x174'),'foreignKey':_0xfd7f('0x18f')});db[_0xfd7f('0x58')][_0xfd7f('0x125')](db[_0xfd7f('0x5b')],{'as':_0xfd7f('0x175'),'foreignKey':_0xfd7f('0x18f')});db[_0xfd7f('0x58')][_0xfd7f('0x125')](db[_0xfd7f('0x5a')],{'as':_0xfd7f('0x176')});db[_0xfd7f('0x58')][_0xfd7f('0x125')](db['SmsApplication'],{'as':'Applications'});db[_0xfd7f('0x58')][_0xfd7f('0x131')](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x178'),'foreignKey':_0xfd7f('0x179')});db[_0xfd7f('0x58')][_0xfd7f('0x131')](db[_0xfd7f('0x8d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xfd7f('0x58')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':'user_has_sms_accounts'});db[_0xfd7f('0x190')][_0xfd7f('0x131')](db['User'],{'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x190')]['belongsTo'](db[_0xfd7f('0x5d')],{'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x190')][_0xfd7f('0x131')](db[_0xfd7f('0x58')],{'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x190')][_0xfd7f('0x131')](db[_0xfd7f('0x8b')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xfd7f('0x190')]['belongsTo'](db[_0xfd7f('0x95')],{'onDelete':_0xfd7f('0x186'),'foreignKey':_0xfd7f('0x187')});db[_0xfd7f('0x5a')][_0xfd7f('0x125')](db[_0xfd7f('0x5b')],{'as':'Messages','onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x191')});db['SmsInteraction'][_0xfd7f('0x131')](db[_0xfd7f('0x58')],{'as':'Account','foreignKey':_0xfd7f('0x18f')});db['SmsInteraction'][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x5a')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x180'),'foreignKey':'UserId'});db['SmsInteraction'][_0xfd7f('0x133')](db[_0xfd7f('0x95')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0xfd7f('0x5a')][_0xfd7f('0x133')](db['Tag'],{'through':_0xfd7f('0x192'),'as':_0xfd7f('0x193')});db['SmsInteraction'][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x182'),'through':'user_has_sms_interactions','foreignKey':_0xfd7f('0x191')});db[_0xfd7f('0x5b')]['belongsTo'](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x14')});db[_0xfd7f('0x5b')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'onDelete':'cascade','as':_0xfd7f('0x17e')});db[_0xfd7f('0x5b')]['belongsTo'](db[_0xfd7f('0x5a')],{'onDelete':'cascade','as':_0xfd7f('0x183'),'foreignKey':_0xfd7f('0x191')});db['SmsMessage'][_0xfd7f('0x131')](db[_0xfd7f('0x58')],{'as':'Account','foreignKey':_0xfd7f('0x18f')});db[_0xfd7f('0x5d')]['belongsToMany'](db['User'],{'as':_0xfd7f('0x168'),'through':_0xfd7f('0x3a'),'foreignKey':_0xfd7f('0x194')});db['SmsQueue'][_0xfd7f('0x133')](db['Team'],{'through':'team_has_sms_queues','as':_0xfd7f('0x169')});db[_0xfd7f('0x5f')][_0xfd7f('0x125')](db[_0xfd7f('0x87')],{'as':'Dispositions','foreignKey':_0xfd7f('0x195'),'onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x5f')]['hasMany'](db[_0xfd7f('0x85')],{'as':_0xfd7f('0x174'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xfd7f('0x125')](db[_0xfd7f('0x62')],{'as':_0xfd7f('0x176'),'foreignKey':_0xfd7f('0x195')});db[_0xfd7f('0x5f')]['hasMany'](db[_0xfd7f('0x64')],{'as':_0xfd7f('0x175'),'foreignKey':_0xfd7f('0x195')});db['OpenchannelAccount'][_0xfd7f('0x125')](db[_0xfd7f('0x61')],{'as':'Applications','foreignKey':_0xfd7f('0x195')});db[_0xfd7f('0x5f')][_0xfd7f('0x131')](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x178'),'foreignKey':_0xfd7f('0x179')});db[_0xfd7f('0x5f')][_0xfd7f('0x131')](db[_0xfd7f('0x8d')],{'as':_0xfd7f('0x165'),'foreignKey':_0xfd7f('0x166')});db[_0xfd7f('0x5f')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':'user_has_openchannel_accounts'});db[_0xfd7f('0x61')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x61')][_0xfd7f('0x131')](db[_0xfd7f('0x196')],{'onDelete':_0xfd7f('0x186'),'foreignKey':'OpenchannelQueueId'});db[_0xfd7f('0x61')][_0xfd7f('0x131')](db[_0xfd7f('0x5f')],{'onDelete':'restrict','foreignKey':_0xfd7f('0x195')});db['OpenchannelApplication'][_0xfd7f('0x131')](db[_0xfd7f('0x8b')],{'onDelete':_0xfd7f('0x186'),'foreignKey':_0xfd7f('0x164')});db[_0xfd7f('0x61')][_0xfd7f('0x131')](db[_0xfd7f('0x95')],{'onDelete':_0xfd7f('0x186'),'foreignKey':_0xfd7f('0x187')});db[_0xfd7f('0x62')]['hasMany'](db[_0xfd7f('0x64')],{'as':_0xfd7f('0x175'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x197')});db[_0xfd7f('0x62')][_0xfd7f('0x131')](db[_0xfd7f('0x5f')],{'as':'Account','foreignKey':_0xfd7f('0x195')});db[_0xfd7f('0x62')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':'ContactId'});db[_0xfd7f('0x62')][_0xfd7f('0x131')](db['User'],{'as':'Owner','foreignKey':_0xfd7f('0x124')});db['OpenchannelInteraction'][_0xfd7f('0x133')](db['Tag'],{'through':_0xfd7f('0x198'),'as':'Tags'});db[_0xfd7f('0x62')][_0xfd7f('0x133')](db[_0xfd7f('0x95')],{'through':_0xfd7f('0x198'),'as':'ThroughTags'});db[_0xfd7f('0x62')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':'Users','through':_0xfd7f('0x13e'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'onDelete':'cascade','as':_0xfd7f('0x14')});db['OpenchannelMessage'][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'onDelete':_0xfd7f('0x123'),'as':_0xfd7f('0x17e')});db['OpenchannelMessage'][_0xfd7f('0x131')](db[_0xfd7f('0x62')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xfd7f('0x197')});db['OpenchannelMessage'][_0xfd7f('0x131')](db[_0xfd7f('0xf8')],{'as':_0xfd7f('0xf8'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0xfd7f('0x131')](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xfd7f('0x196')]['belongsToMany'](db[_0xfd7f('0x14')],{'as':'Agents','through':_0xfd7f('0x3c'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue']['belongsToMany'](db[_0xfd7f('0xf3')],{'through':'team_has_openchannel_queues','as':_0xfd7f('0x169')});db[_0xfd7f('0x14a')][_0xfd7f('0x125')](db[_0xfd7f('0x87')],{'as':_0xfd7f('0x173'),'foreignKey':_0xfd7f('0x184'),'onDelete':'cascade'});db[_0xfd7f('0x14a')]['hasMany'](db[_0xfd7f('0x85')],{'as':_0xfd7f('0x174'),'foreignKey':_0xfd7f('0x184')});db['ChatWebsite'][_0xfd7f('0x125')](db['ChatProactiveAction'],{'as':_0xfd7f('0x199')});db[_0xfd7f('0x14a')]['hasMany'](db['ChatInteraction'],{'as':_0xfd7f('0x176')});db[_0xfd7f('0x14a')][_0xfd7f('0x125')](db[_0xfd7f('0x19a')],{'as':_0xfd7f('0x177')});db[_0xfd7f('0x14a')][_0xfd7f('0x125')](db['ChatMessage'],{'as':_0xfd7f('0x175')});db['ChatWebsite'][_0xfd7f('0x131')](db['CmList'],{'as':_0xfd7f('0x178'),'foreignKey':'ListId'});db['ChatWebsite'][_0xfd7f('0x131')](db[_0xfd7f('0x8b')],{'as':'Interval','foreignKey':_0xfd7f('0x164')});db[_0xfd7f('0x14a')][_0xfd7f('0x131')](db[_0xfd7f('0x42')],{'as':'MailAccount','foreignKey':_0xfd7f('0x16f')});db['ChatWebsite'][_0xfd7f('0x131')](db['Pause'],{'as':_0xfd7f('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xfd7f('0x14a')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':_0xfd7f('0x14c')});db[_0xfd7f('0x19b')][_0xfd7f('0x131')](db[_0xfd7f('0x5f')],{});db['OpenchannelQueueReport'][_0xfd7f('0x131')](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x178'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x19b')][_0xfd7f('0x131')](db[_0xfd7f('0x62')],{});db[_0xfd7f('0x19b')][_0xfd7f('0x131')](db[_0xfd7f('0x64')],{});db[_0xfd7f('0x19b')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{});db[_0xfd7f('0x19b')]['belongsTo'](db[_0xfd7f('0x196')],{});db[_0xfd7f('0x19a')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x19c'),'foreignKey':'UserId','onDelete':'restrict'});db[_0xfd7f('0x19a')][_0xfd7f('0x131')](db[_0xfd7f('0x6d')],{'as':_0xfd7f('0x19d'),'foreignKey':_0xfd7f('0x19e'),'onDelete':_0xfd7f('0x186')});db['ChatApplication']['belongsTo'](db[_0xfd7f('0x14a')],{'as':_0xfd7f('0x19f'),'foreignKey':_0xfd7f('0x184'),'onDelete':'restrict'});db['ChatApplication'][_0xfd7f('0x131')](db[_0xfd7f('0x95')],{'onDelete':_0xfd7f('0x186'),'foreignKey':_0xfd7f('0x187')});db[_0xfd7f('0x69')][_0xfd7f('0x125')](db[_0xfd7f('0x1a0')],{'as':_0xfd7f('0x175'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1a1')});db['ChatInteraction']['belongsTo'](db[_0xfd7f('0x14a')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x184')});db['ChatInteraction']['belongsTo'](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x69')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'as':'Owner','foreignKey':'UserId'});db[_0xfd7f('0x69')][_0xfd7f('0x133')](db[_0xfd7f('0x95')],{'through':_0xfd7f('0x1a2'),'as':_0xfd7f('0x1a3')});db[_0xfd7f('0x69')][_0xfd7f('0x133')](db[_0xfd7f('0x95')],{'through':_0xfd7f('0x1a2'),'as':_0xfd7f('0x193')});db[_0xfd7f('0x69')]['belongsToMany'](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x182'),'through':_0xfd7f('0x13b'),'foreignKey':_0xfd7f('0x1a1')});db['ChatMessage'][_0xfd7f('0x131')](db['User'],{'onDelete':_0xfd7f('0x123'),'as':'User'});db[_0xfd7f('0x1a0')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'onDelete':_0xfd7f('0x123'),'as':'Contact','foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x1a0')]['belongsTo'](db[_0xfd7f('0x69')],{'onDelete':_0xfd7f('0x123'),'as':'Interaction','foreignKey':_0xfd7f('0x1a1')});db[_0xfd7f('0x1a0')][_0xfd7f('0x131')](db['Attachment'],{'as':_0xfd7f('0xf8'),'foreignKey':'AttachmentId'});db['ChatMessage']['belongsTo'](db[_0xfd7f('0x14a')],{'as':'Account','foreignKey':_0xfd7f('0x184')});db[_0xfd7f('0x6c')][_0xfd7f('0x125')](db[_0xfd7f('0xf8')],{'as':_0xfd7f('0x1a4'),'foreignKey':_0xfd7f('0x185'),'onDelete':'cascade','hooks':!![]});db[_0xfd7f('0x6c')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'onDelete':_0xfd7f('0x123'),'as':_0xfd7f('0x17e'),'foreignKey':'ContactId'});db[_0xfd7f('0x6c')]['belongsTo'](db[_0xfd7f('0x14a')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xfd7f('0x6d')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':'Agents','through':_0xfd7f('0x35'),'hooks':!![]});db[_0xfd7f('0x6d')][_0xfd7f('0x133')](db['Team'],{'through':'team_has_chat_queues','as':_0xfd7f('0x169')});db[_0xfd7f('0x6f')][_0xfd7f('0x125')](db[_0xfd7f('0x1a5')],{'as':'Messages','foreignKey':_0xfd7f('0x1a6'),'onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x6f')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':'Members','through':_0xfd7f('0x134')});db[_0xfd7f('0x71')][_0xfd7f('0x131')](db[_0xfd7f('0x14a')],{'as':'Website','foreignKey':_0xfd7f('0x184')});db[_0xfd7f('0x73')]['hasMany'](db[_0xfd7f('0x75')],{'as':'Contacts','foreignKey':_0xfd7f('0x1a7')});db[_0xfd7f('0x75')][_0xfd7f('0x125')](db['CmContactHasItem'],{'as':_0xfd7f('0x1a8'),'foreignKey':_0xfd7f('0x1a9')});db[_0xfd7f('0x75')][_0xfd7f('0x125')](db[_0xfd7f('0x77')],{'as':_0xfd7f('0x15b'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x75')][_0xfd7f('0x125')](db[_0xfd7f('0x7a')],{'as':_0xfd7f('0x15d'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x75')][_0xfd7f('0x125')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xfd7f('0x17f')});db['CmContact'][_0xfd7f('0x125')](db['ReportAgentPreview'],{'as':_0xfd7f('0x7e'),'foreignKey':_0xfd7f('0x17f')});db['CmContact'][_0xfd7f('0x125')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x75')][_0xfd7f('0x125')](db[_0xfd7f('0x62')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0xfd7f('0x186')});db['CmContact'][_0xfd7f('0x125')](db[_0xfd7f('0x69')],{'as':_0xfd7f('0x12c'),'foreignKey':_0xfd7f('0x17f'),'onDelete':_0xfd7f('0x186')});db['CmContact']['hasMany'](db[_0xfd7f('0x5a')],{'as':_0xfd7f('0x13d'),'foreignKey':_0xfd7f('0x17f'),'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x75')][_0xfd7f('0x125')](db[_0xfd7f('0x52')],{'as':_0xfd7f('0x12d'),'foreignKey':_0xfd7f('0x17f'),'onDelete':'restrict'});db['CmContact'][_0xfd7f('0x125')](db[_0xfd7f('0x139')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0xfd7f('0x186')});db['CmContact'][_0xfd7f('0x131')](db['CmCompany'],{'as':_0xfd7f('0x1aa'),'foreignKey':_0xfd7f('0x1a7')});db['CmContact'][_0xfd7f('0x131')](db['CmList'],{'as':_0xfd7f('0x178'),'foreignKey':_0xfd7f('0x179'),'onDelete':_0xfd7f('0x123')});db['CmContact'][_0xfd7f('0x133')](db['User'],{'as':_0xfd7f('0x182'),'through':_0xfd7f('0x136')});db[_0xfd7f('0x75')]['belongsToMany'](db['Tag'],{'as':'Tags','through':_0xfd7f('0x1ab')});db['CmContact'][_0xfd7f('0x133')](db[_0xfd7f('0x95')],{'through':'cm_contact_has_tags','as':_0xfd7f('0x193')});db[_0xfd7f('0x77')][_0xfd7f('0x125')](db[_0xfd7f('0x9b')],{'as':_0xfd7f('0x1ac'),'foreignKey':'CmHopperId'});db[_0xfd7f('0x77')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'as':'Contact','foreignKey':_0xfd7f('0x17f'),'onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x77')][_0xfd7f('0x131')](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x178'),'foreignKey':'ListId','onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0xfd7f('0x14')],{'as':'Agent','foreignKey':_0xfd7f('0x124')});db[_0xfd7f('0x77')][_0xfd7f('0x131')](db[_0xfd7f('0x1c')],{'as':'Queue','foreignKey':_0xfd7f('0x15c'),'onDelete':'cascade'});db[_0xfd7f('0x77')][_0xfd7f('0x131')](db[_0xfd7f('0x1ad')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':'cascade'});db[_0xfd7f('0x77')][_0xfd7f('0x131')](db['User'],{'as':'Owner','foreignKey':_0xfd7f('0x1ae')});db[_0xfd7f('0x78')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':'ContactId','onDelete':_0xfd7f('0x123')});db['CmHopperBlack']['belongsTo'](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x178'),'foreignKey':_0xfd7f('0x179'),'onDelete':'cascade'});db[_0xfd7f('0x78')][_0xfd7f('0x131')](db[_0xfd7f('0x1c')],{'as':_0xfd7f('0x19d'),'foreignKey':_0xfd7f('0x15c'),'onDelete':'cascade'});db[_0xfd7f('0x78')]['belongsTo'](db[_0xfd7f('0x1ad')],{'as':_0xfd7f('0x1ad'),'foreignKey':_0xfd7f('0x1af'),'onDelete':'cascade'});db['Automation'][_0xfd7f('0x125')](db[_0xfd7f('0x89')],{'as':{'plural':'All','singular':_0xfd7f('0x1b0')},'foreignKey':_0xfd7f('0x1b1'),'onDelete':_0xfd7f('0x123'),'hooks':!![]});db[_0xfd7f('0x1b2')][_0xfd7f('0x125')](db[_0xfd7f('0x89')],{'as':{'plural':_0xfd7f('0x1b3'),'singular':_0xfd7f('0x1b4')},'foreignKey':_0xfd7f('0x1b5'),'onDelete':'cascade','hooks':!![]});db[_0xfd7f('0x1b2')]['hasMany'](db[_0xfd7f('0x82')],{'as':_0xfd7f('0x1b6'),'foreignKey':_0xfd7f('0x1b7'),'onDelete':_0xfd7f('0x123'),'hooks':!![]});db[_0xfd7f('0x87')][_0xfd7f('0x125')](db['Disposition'],{'as':_0xfd7f('0x173'),'foreignKey':_0xfd7f('0x1b8'),'onDelete':'cascade'});db[_0xfd7f('0x8b')]['hasMany'](db[_0xfd7f('0x8b')],{'as':_0xfd7f('0x1b9'),'foreignKey':_0xfd7f('0x164'),'onDelete':_0xfd7f('0x123'),'hooks':!![],'required':![]});db[_0xfd7f('0x8b')][_0xfd7f('0x125')](db['VoiceExtension'],{'as':_0xfd7f('0x129'),'foreignKey':_0xfd7f('0x164'),'onDelete':'restrict'});db[_0xfd7f('0x8b')][_0xfd7f('0x125')](db[_0xfd7f('0x49')],{'as':_0xfd7f('0x1ba'),'foreignKey':_0xfd7f('0x164')});db[_0xfd7f('0x8b')][_0xfd7f('0x125')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0xfd7f('0x164')});db[_0xfd7f('0x8b')]['hasMany'](db[_0xfd7f('0x50')],{'as':_0xfd7f('0x1bb'),'foreignKey':_0xfd7f('0x164')});db[_0xfd7f('0x8b')][_0xfd7f('0x125')](db['SmsApplication'],{'as':_0xfd7f('0x1bc'),'foreignKey':'IntervalId'});db[_0xfd7f('0x92')][_0xfd7f('0x131')](db[_0xfd7f('0x42')],{});db[_0xfd7f('0x92')][_0xfd7f('0x131')](db['AnalyticDefaultReport'],{'foreignKey':_0xfd7f('0x1bd')});db[_0xfd7f('0x92')]['belongsTo'](db[_0xfd7f('0xa4')],{'foreignKey':_0xfd7f('0x1be')});db[_0xfd7f('0x94')][_0xfd7f('0x133')](db[_0xfd7f('0x1b')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x95')]['belongsToMany'](db[_0xfd7f('0x75')],{'through':_0xfd7f('0x1ab')});db['Tag'][_0xfd7f('0x133')](db[_0xfd7f('0x69')],{'through':_0xfd7f('0x1a2')});db['Tag']['belongsToMany'](db[_0xfd7f('0x139')],{'through':_0xfd7f('0x181')});db[_0xfd7f('0x95')][_0xfd7f('0x133')](db[_0xfd7f('0x5a')],{'through':_0xfd7f('0x192')});db[_0xfd7f('0x95')]['belongsToMany'](db[_0xfd7f('0x52')],{'through':_0xfd7f('0x18c')});db[_0xfd7f('0x95')]['belongsToMany'](db[_0xfd7f('0x62')],{'through':_0xfd7f('0x198')});db[_0xfd7f('0x95')][_0xfd7f('0x133')](db[_0xfd7f('0x114')],{'through':_0xfd7f('0x1bf')});db[_0xfd7f('0x99')][_0xfd7f('0x131')](db[_0xfd7f('0x97')],{'as':'ItemType','foreignKey':_0xfd7f('0x1c0')});db['CmHopperAdditionalPhone'][_0xfd7f('0x131')](db[_0xfd7f('0x77')],{'as':'Hopper','foreignKey':'CmHopperId'});db[_0xfd7f('0x9f')][_0xfd7f('0x125')](db['Condition'],{'as':{'plural':_0xfd7f('0x1c1'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xfd7f('0x9f')][_0xfd7f('0x125')](db[_0xfd7f('0x89')],{'as':{'plural':'AnyConditions','singular':_0xfd7f('0x1c2')},'foreignKey':_0xfd7f('0x1c3'),'onDelete':_0xfd7f('0x123'),'hooks':!![]});db[_0xfd7f('0x9f')][_0xfd7f('0x125')](db[_0xfd7f('0x82')],{'as':_0xfd7f('0x1b6'),'foreignKey':_0xfd7f('0x1c4'),'onDelete':_0xfd7f('0x123'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0xfd7f('0xaa')],{'as':_0xfd7f('0x1c5'),'onDelete':'cascade','foreignKey':_0xfd7f('0x1be'),'hooks':!![]});db['AnalyticDefaultReport'][_0xfd7f('0x125')](db[_0xfd7f('0xaa')],{'as':_0xfd7f('0x1c5'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1bd')});db[_0xfd7f('0xa9')][_0xfd7f('0x125')](db[_0xfd7f('0xaa')],{'as':_0xfd7f('0x1c5'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1c6')});db[_0xfd7f('0xaa')][_0xfd7f('0x131')](db[_0xfd7f('0xa9')],{'foreignKey':_0xfd7f('0x1c6')});db[_0xfd7f('0xad')][_0xfd7f('0x125')](db[_0xfd7f('0xaf')],{'as':_0xfd7f('0x1c7'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xaf')][_0xfd7f('0x125')](db[_0xfd7f('0xb0')],{'as':_0xfd7f('0x1c9'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xaf')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xaf')][_0xfd7f('0x125')](db[_0xfd7f('0xb0')],{'as':_0xfd7f('0x1c5'),'onDelete':'cascade','foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xaf')][_0xfd7f('0x131')](db[_0xfd7f('0xad')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xb0')][_0xfd7f('0x125')](db[_0xfd7f('0xb0')],{'as':_0xfd7f('0x1cd'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xb0')][_0xfd7f('0x125')](db[_0xfd7f('0xb0')],{'as':_0xfd7f('0x1ce'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xb0')][_0xfd7f('0x125')](db[_0xfd7f('0xb0')],{'as':_0xfd7f('0x1cf'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xb0')]['belongsTo'](db[_0xfd7f('0xa0')],{'as':_0xfd7f('0xa0'),'foreignKey':'VariableId'});db[_0xfd7f('0xb2')][_0xfd7f('0x125')](db['SugarcrmConfiguration'],{'as':_0xfd7f('0x1c7'),'onDelete':_0xfd7f('0x123'),'foreignKey':'AccountId'});db[_0xfd7f('0xb4')][_0xfd7f('0x125')](db[_0xfd7f('0xb6')],{'as':_0xfd7f('0x1c9'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xb4')]['hasMany'](db[_0xfd7f('0xb6')],{'as':_0xfd7f('0x1d0'),'onDelete':'cascade','foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xb4')][_0xfd7f('0x125')](db[_0xfd7f('0xb6')],{'as':'Fields','onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xb4')][_0xfd7f('0x131')](db['SugarcrmAccount'],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xb6')][_0xfd7f('0x125')](db[_0xfd7f('0xb6')],{'as':_0xfd7f('0x1cd'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xb6')][_0xfd7f('0x125')](db[_0xfd7f('0xb6')],{'as':_0xfd7f('0x1ce'),'foreignKey':'DescriptionId'});db[_0xfd7f('0xb6')]['hasMany'](db[_0xfd7f('0xb6')],{'as':_0xfd7f('0x1cf'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xb6')][_0xfd7f('0x131')](db['Variable'],{'as':_0xfd7f('0xa0'),'foreignKey':'VariableId'});db['DeskAccount'][_0xfd7f('0x125')](db[_0xfd7f('0xb9')],{'as':_0xfd7f('0x1c7'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xb9')]['hasMany'](db[_0xfd7f('0xbb')],{'as':_0xfd7f('0x1c9'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1ca')});db['DeskConfiguration']['hasMany'](db[_0xfd7f('0xbb')],{'as':_0xfd7f('0x1d0'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xb9')][_0xfd7f('0x125')](db[_0xfd7f('0xbb')],{'as':'Fields','onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xb9')][_0xfd7f('0x131')](db[_0xfd7f('0x1d1')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xb9')][_0xfd7f('0x133')](db[_0xfd7f('0x95')],{'through':_0xfd7f('0x1d2')});db[_0xfd7f('0xbb')]['hasMany'](db[_0xfd7f('0xbb')],{'as':_0xfd7f('0x1cd'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xbb')]['hasMany'](db[_0xfd7f('0xbb')],{'as':_0xfd7f('0x1ce'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xbb')]['hasMany'](db['DeskField'],{'as':_0xfd7f('0x1cf'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xbb')]['belongsTo'](db['Variable'],{'as':_0xfd7f('0xa0'),'foreignKey':_0xfd7f('0x1d3')});db['ZohoAccount'][_0xfd7f('0x125')](db[_0xfd7f('0xbe')],{'as':_0xfd7f('0x1c7'),'onDelete':_0xfd7f('0x123'),'foreignKey':'AccountId'});db[_0xfd7f('0xbe')][_0xfd7f('0x125')](db[_0xfd7f('0xbf')],{'as':_0xfd7f('0x1c9'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xbe')][_0xfd7f('0x125')](db[_0xfd7f('0xbf')],{'as':_0xfd7f('0x1d0'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xbe')][_0xfd7f('0x125')](db[_0xfd7f('0xbf')],{'as':_0xfd7f('0x1c5'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xbe')]['belongsTo'](db[_0xfd7f('0xbc')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xbf')]['hasMany'](db['ZohoField'],{'as':_0xfd7f('0x1cd'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xbf')][_0xfd7f('0x125')](db[_0xfd7f('0xbf')],{'as':_0xfd7f('0x1ce'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xbf')][_0xfd7f('0x125')](db[_0xfd7f('0xbf')],{'as':_0xfd7f('0x1cf'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xbf')][_0xfd7f('0x131')](db[_0xfd7f('0xa0')],{'as':_0xfd7f('0xa0'),'foreignKey':_0xfd7f('0x1d3')});db['ZendeskAccount'][_0xfd7f('0x125')](db['ZendeskConfiguration'],{'as':_0xfd7f('0x1c7'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xc3')][_0xfd7f('0x125')](db[_0xfd7f('0xc5')],{'as':_0xfd7f('0x1c9'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xc3')]['hasMany'](db[_0xfd7f('0xc5')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xfd7f('0xc3')][_0xfd7f('0x125')](db[_0xfd7f('0xc5')],{'as':_0xfd7f('0x1c5'),'foreignKey':_0xfd7f('0x1cc')});db['ZendeskConfiguration'][_0xfd7f('0x131')](db[_0xfd7f('0xc1')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xc3')]['belongsToMany'](db[_0xfd7f('0x95')],{'through':_0xfd7f('0x1d4')});db[_0xfd7f('0xc5')][_0xfd7f('0x125')](db[_0xfd7f('0xc5')],{'as':_0xfd7f('0x1cd'),'foreignKey':'SubjectId'});db[_0xfd7f('0xc5')][_0xfd7f('0x125')](db['ZendeskField'],{'as':_0xfd7f('0x1ce'),'foreignKey':_0xfd7f('0x1cb')});db['ZendeskField'][_0xfd7f('0x125')](db[_0xfd7f('0xc5')],{'as':_0xfd7f('0x1cf'),'foreignKey':_0xfd7f('0x1cc')});db['ZendeskField'][_0xfd7f('0x131')](db[_0xfd7f('0xa0')],{'as':_0xfd7f('0xa0'),'foreignKey':_0xfd7f('0x1d3')});db[_0xfd7f('0xc7')][_0xfd7f('0x125')](db['FreshdeskConfiguration'],{'as':_0xfd7f('0x1c7'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xc9')]['hasMany'](db[_0xfd7f('0xcb')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xc9')]['hasMany'](db[_0xfd7f('0xcb')],{'as':'Descriptions','onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xc9')][_0xfd7f('0x125')](db['FreshdeskField'],{'as':_0xfd7f('0x1c5'),'onDelete':'cascade','foreignKey':_0xfd7f('0x1cc')});db['FreshdeskConfiguration'][_0xfd7f('0x131')](db[_0xfd7f('0xc7')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xc9')][_0xfd7f('0x133')](db[_0xfd7f('0x95')],{'through':_0xfd7f('0x1d5')});db[_0xfd7f('0xcb')][_0xfd7f('0x125')](db[_0xfd7f('0xcb')],{'as':_0xfd7f('0x1cd'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xcb')]['hasMany'](db[_0xfd7f('0xcb')],{'as':_0xfd7f('0x1ce'),'foreignKey':'DescriptionId'});db['FreshdeskField'][_0xfd7f('0x125')](db['FreshdeskField'],{'as':_0xfd7f('0x1cf'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xcb')][_0xfd7f('0x131')](db[_0xfd7f('0xa0')],{'as':_0xfd7f('0xa0'),'foreignKey':_0xfd7f('0x1d3')});db[_0xfd7f('0xcc')][_0xfd7f('0x125')](db[_0xfd7f('0x1d6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0x1d6')][_0xfd7f('0x125')](db[_0xfd7f('0xcf')],{'as':_0xfd7f('0x1c9'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0x1d6')][_0xfd7f('0x125')](db['VtigerField'],{'as':_0xfd7f('0x1d0'),'foreignKey':'DescriptionId'});db['VtigerConfiguration']['hasMany'](db['VtigerField'],{'as':'Fields','foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0x1d6')][_0xfd7f('0x131')](db[_0xfd7f('0xcc')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xcf')][_0xfd7f('0x125')](db[_0xfd7f('0xcf')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xfd7f('0xcf')]['hasMany'](db[_0xfd7f('0xcf')],{'as':'Description','foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xcf')]['hasMany'](db[_0xfd7f('0xcf')],{'as':_0xfd7f('0x1cf'),'foreignKey':'FieldId'});db[_0xfd7f('0xcf')][_0xfd7f('0x131')](db[_0xfd7f('0xa0')],{'as':_0xfd7f('0xa0'),'foreignKey':_0xfd7f('0x1d3')});db[_0xfd7f('0x1d7')][_0xfd7f('0x125')](db[_0xfd7f('0xd1')],{'as':_0xfd7f('0x1c7'),'onDelete':_0xfd7f('0x123'),'foreignKey':'AccountId'});db[_0xfd7f('0xd1')][_0xfd7f('0x125')](db[_0xfd7f('0xd2')],{'as':_0xfd7f('0x1c9'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xd1')][_0xfd7f('0x125')](db[_0xfd7f('0xd2')],{'as':_0xfd7f('0x1d0'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xd1')][_0xfd7f('0x125')](db[_0xfd7f('0xd2')],{'as':_0xfd7f('0x1c5'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xd1')][_0xfd7f('0x131')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xd2')][_0xfd7f('0x125')](db[_0xfd7f('0xd2')],{'as':_0xfd7f('0x1cd'),'foreignKey':'SubjectId'});db[_0xfd7f('0xd2')][_0xfd7f('0x125')](db[_0xfd7f('0xd2')],{'as':_0xfd7f('0x1ce'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xd2')][_0xfd7f('0x125')](db['ServicenowField'],{'as':_0xfd7f('0x1cf'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xd2')][_0xfd7f('0x131')](db[_0xfd7f('0xa0')],{'as':_0xfd7f('0xa0'),'foreignKey':_0xfd7f('0x1d3')});db[_0xfd7f('0xd4')][_0xfd7f('0x125')](db[_0xfd7f('0xd5')],{'as':_0xfd7f('0x1c7'),'onDelete':'cascade','foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xd5')][_0xfd7f('0x125')](db[_0xfd7f('0xd6')],{'as':_0xfd7f('0x1c9'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1ca')});db['Dynamics365Configuration'][_0xfd7f('0x125')](db[_0xfd7f('0xd6')],{'as':_0xfd7f('0x1d0'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xd5')][_0xfd7f('0x125')](db[_0xfd7f('0xd6')],{'as':_0xfd7f('0x1c5'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xd5')]['belongsTo'](db[_0xfd7f('0xd4')],{'as':_0xfd7f('0x17d'),'foreignKey':'AccountId'});db[_0xfd7f('0xd6')][_0xfd7f('0x125')](db['Dynamics365Field'],{'as':_0xfd7f('0x1cd'),'foreignKey':_0xfd7f('0x1ca')});db[_0xfd7f('0xd6')][_0xfd7f('0x125')](db[_0xfd7f('0xd6')],{'as':'Description','foreignKey':_0xfd7f('0x1cb')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':_0xfd7f('0x1cf'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xd6')][_0xfd7f('0x131')](db[_0xfd7f('0xa0')],{'as':_0xfd7f('0xa0'),'foreignKey':_0xfd7f('0x1d3')});db[_0xfd7f('0xd8')][_0xfd7f('0x125')](db['FreshsalesConfiguration'],{'as':_0xfd7f('0x1c7'),'onDelete':_0xfd7f('0x123'),'foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0xfd7f('0x125')](db[_0xfd7f('0xda')],{'as':'Subjects','foreignKey':_0xfd7f('0x1ca')});db['FreshsalesConfiguration']['hasMany'](db[_0xfd7f('0xda')],{'as':'Descriptions','foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0x1d8')][_0xfd7f('0x125')](db['FreshsalesField'],{'as':_0xfd7f('0x1c5'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0xfd7f('0x131')](db[_0xfd7f('0xd8')],{'as':'Account','foreignKey':_0xfd7f('0x1c8')});db[_0xfd7f('0xda')]['hasMany'](db['FreshsalesField'],{'as':_0xfd7f('0x1cd'),'foreignKey':_0xfd7f('0x1ca')});db['FreshsalesField'][_0xfd7f('0x125')](db[_0xfd7f('0xda')],{'as':_0xfd7f('0x1ce'),'foreignKey':_0xfd7f('0x1cb')});db[_0xfd7f('0xda')][_0xfd7f('0x125')](db[_0xfd7f('0xda')],{'as':_0xfd7f('0x1cf'),'foreignKey':_0xfd7f('0x1cc')});db[_0xfd7f('0xda')][_0xfd7f('0x131')](db[_0xfd7f('0xa0')],{'as':_0xfd7f('0xa0'),'foreignKey':_0xfd7f('0x1d3')});db['ChatQueueReport']['belongsTo'](db[_0xfd7f('0x14a')],{});db[_0xfd7f('0x1d9')][_0xfd7f('0x131')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xfd7f('0x1d9')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x1d9')][_0xfd7f('0x131')](db['ChatInteraction'],{});db[_0xfd7f('0x1d9')][_0xfd7f('0x131')](db[_0xfd7f('0x1a0')],{});db[_0xfd7f('0x1d9')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{});db[_0xfd7f('0x1d9')][_0xfd7f('0x131')](db[_0xfd7f('0x6d')],{});db[_0xfd7f('0x1a5')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'onDelete':_0xfd7f('0x123'),'foreignKey':'FromId'});db['ChatInternalMessage']['belongsTo'](db[_0xfd7f('0x14')],{'onDelete':_0xfd7f('0x123'),'foreignKey':'ToId'});db['JscriptySessionReport']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xfd7f('0x1da'),'onDelete':_0xfd7f('0x123')});db[_0xfd7f('0xe4')][_0xfd7f('0x125')](db[_0xfd7f('0xe0')],{'foreignKey':_0xfd7f('0x1da'),'onDelete':'cascade'});db[_0xfd7f('0xe6')]['belongsTo'](db[_0xfd7f('0x58')],{});db[_0xfd7f('0xe6')][_0xfd7f('0x131')](db['CmList'],{'as':_0xfd7f('0x178'),'foreignKey':_0xfd7f('0x179')});db['SmsQueueReport'][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0xe6')][_0xfd7f('0x131')](db[_0xfd7f('0x5a')],{});db[_0xfd7f('0xe6')][_0xfd7f('0x131')](db[_0xfd7f('0x5b')],{});db[_0xfd7f('0xe6')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{});db[_0xfd7f('0xe6')]['belongsTo'](db['SmsQueue'],{});db[_0xfd7f('0xeb')]['hasMany'](db[_0xfd7f('0xe4')],{'foreignKey':_0xfd7f('0x1db')});db[_0xfd7f('0xeb')][_0xfd7f('0x125')](db[_0xfd7f('0xe2')],{'foreignKey':_0xfd7f('0x1db')});db[_0xfd7f('0xeb')][_0xfd7f('0x125')](db[_0xfd7f('0xe0')],{'foreignKey':_0xfd7f('0x1db')});db[_0xfd7f('0xef')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':'Users','through':'user_has_square_projects'});db['Team'][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':'Agents','through':_0xfd7f('0x138')});db[_0xfd7f('0xf3')][_0xfd7f('0x133')](db[_0xfd7f('0x1c')],{'through':'TeamVoiceQueue','as':_0xfd7f('0x140')});db[_0xfd7f('0xf3')][_0xfd7f('0x133')](db[_0xfd7f('0x141')],{'through':_0xfd7f('0x17b'),'as':_0xfd7f('0x142')});db[_0xfd7f('0xf3')][_0xfd7f('0x133')](db[_0xfd7f('0x6d')],{'through':_0xfd7f('0x1dc'),'as':'ChatQueues'});db['Team'][_0xfd7f('0x133')](db[_0xfd7f('0x144')],{'through':_0xfd7f('0x18e'),'as':_0xfd7f('0x1dd')});db[_0xfd7f('0xf3')][_0xfd7f('0x133')](db[_0xfd7f('0x5d')],{'through':_0xfd7f('0x1de'),'as':_0xfd7f('0x146')});db[_0xfd7f('0xf3')][_0xfd7f('0x133')](db[_0xfd7f('0x196')],{'through':_0xfd7f('0x1df'),'as':_0xfd7f('0x147')});db[_0xfd7f('0xf3')]['belongsToMany'](db[_0xfd7f('0x11b')],{'through':'team_has_whatsapp_queues','as':_0xfd7f('0x148')});db['Campaign'][_0xfd7f('0x125')](db[_0xfd7f('0x77')],{'as':_0xfd7f('0x15b'),'foreignKey':_0xfd7f('0x1af')});db[_0xfd7f('0x1ad')][_0xfd7f('0x125')](db[_0xfd7f('0x7a')],{'as':_0xfd7f('0x15d'),'foreignKey':_0xfd7f('0x1af')});db[_0xfd7f('0x1ad')][_0xfd7f('0x125')](db[_0xfd7f('0x7c')],{'as':_0xfd7f('0x15e'),'foreignKey':_0xfd7f('0x1af')});db['Campaign'][_0xfd7f('0x125')](db[_0xfd7f('0x78')],{'as':_0xfd7f('0x15f'),'foreignKey':_0xfd7f('0x1af')});db[_0xfd7f('0x1ad')]['belongsTo'](db[_0xfd7f('0x2f')],{'as':_0xfd7f('0x2f'),'foreignKey':_0xfd7f('0x161')});db[_0xfd7f('0x1ad')]['belongsTo'](db[_0xfd7f('0x2f')],{'as':_0xfd7f('0x162'),'foreignKey':_0xfd7f('0x163')});db[_0xfd7f('0x1ad')]['belongsTo'](db[_0xfd7f('0x8b')],{'as':'Interval','foreignKey':_0xfd7f('0x164')});db[_0xfd7f('0x1ad')][_0xfd7f('0x131')](db[_0xfd7f('0xef')],{'as':'SquareProject','foreignKey':_0xfd7f('0x1e0')});db[_0xfd7f('0x1ad')][_0xfd7f('0x133')](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x1e1'),'through':'campaigns_has_cm_lists'});db[_0xfd7f('0x1ad')][_0xfd7f('0x133')](db[_0xfd7f('0x105')],{'as':_0xfd7f('0x16a'),'through':_0xfd7f('0x1e2')});db['Attachment'][_0xfd7f('0x131')](db[_0xfd7f('0x6c')],{'as':_0xfd7f('0x6c'),'foreignKey':'ChatOfflineMessageId'});db[_0xfd7f('0xfc')][_0xfd7f('0x131')](db[_0xfd7f('0x47')],{});db[_0xfd7f('0xfc')]['belongsTo'](db[_0xfd7f('0x139')],{});db[_0xfd7f('0xfc')][_0xfd7f('0x131')](db[_0xfd7f('0x42')],{'foreignKey':_0xfd7f('0x1e3'),'as':_0xfd7f('0x1e4')});db[_0xfd7f('0xfc')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':_0xfd7f('0x1e5'),'as':_0xfd7f('0x1e6')});db[_0xfd7f('0xfc')]['belongsTo'](db['User'],{'foreignKey':_0xfd7f('0x1e7'),'as':'ToAgent'});db[_0xfd7f('0xfc')]['belongsTo'](db[_0xfd7f('0x141')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0xfd7f('0xfc')][_0xfd7f('0x131')](db[_0xfd7f('0x42')],{'foreignKey':'ToMailAccountId','as':_0xfd7f('0x1e8')});db[_0xfd7f('0xfd')][_0xfd7f('0x131')](db[_0xfd7f('0x1a0')],{});db[_0xfd7f('0xfd')][_0xfd7f('0x131')](db['ChatInteraction'],{});db[_0xfd7f('0xfd')][_0xfd7f('0x131')](db[_0xfd7f('0x14a')],{'foreignKey':_0xfd7f('0x1e9'),'as':_0xfd7f('0x1e4')});db[_0xfd7f('0xfd')][_0xfd7f('0x131')](db['User'],{'foreignKey':_0xfd7f('0x1e5'),'as':'FromAgent'});db['ChatTransferReport'][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':_0xfd7f('0x1e7'),'as':_0xfd7f('0x1ea')});db[_0xfd7f('0xfd')]['belongsTo'](db[_0xfd7f('0x6d')],{'foreignKey':_0xfd7f('0x1eb'),'as':'ToQueue'});db[_0xfd7f('0xfd')][_0xfd7f('0x131')](db[_0xfd7f('0x14a')],{'foreignKey':_0xfd7f('0x1ec'),'as':'ToAccount'});db[_0xfd7f('0xff')][_0xfd7f('0x131')](db[_0xfd7f('0x54')],{});db[_0xfd7f('0xff')]['belongsTo'](db['FaxInteraction'],{});db[_0xfd7f('0xff')][_0xfd7f('0x131')](db[_0xfd7f('0x4f')],{'foreignKey':_0xfd7f('0x1ed'),'as':'FromAccount'});db[_0xfd7f('0xff')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':_0xfd7f('0x1e5'),'as':_0xfd7f('0x1e6')});db['FaxTransferReport'][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':'ToUserId','as':_0xfd7f('0x1ea')});db['FaxTransferReport'][_0xfd7f('0x131')](db[_0xfd7f('0x144')],{'foreignKey':_0xfd7f('0x1ee'),'as':_0xfd7f('0x1ef')});db[_0xfd7f('0xff')][_0xfd7f('0x131')](db[_0xfd7f('0x4f')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0xfd7f('0x101')][_0xfd7f('0x131')](db[_0xfd7f('0x64')],{});db[_0xfd7f('0x101')]['belongsTo'](db[_0xfd7f('0x62')],{});db['OpenchannelTransferReport'][_0xfd7f('0x131')](db[_0xfd7f('0x5f')],{'foreignKey':_0xfd7f('0x1f0'),'as':_0xfd7f('0x1e4')});db[_0xfd7f('0x101')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':_0xfd7f('0x1e5'),'as':'FromAgent'});db[_0xfd7f('0x101')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':_0xfd7f('0x1e7'),'as':_0xfd7f('0x1ea')});db[_0xfd7f('0x101')][_0xfd7f('0x131')](db['OpenchannelQueue'],{'foreignKey':_0xfd7f('0x1f1'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0xfd7f('0x131')](db[_0xfd7f('0x5f')],{'foreignKey':_0xfd7f('0x1f2'),'as':_0xfd7f('0x1e8')});db[_0xfd7f('0x103')][_0xfd7f('0x131')](db['SmsMessage'],{});db[_0xfd7f('0x103')][_0xfd7f('0x131')](db[_0xfd7f('0x5a')],{});db['SmsTransferReport']['belongsTo'](db[_0xfd7f('0x58')],{'foreignKey':'FromSmsAccountId','as':_0xfd7f('0x1e4')});db[_0xfd7f('0x103')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':'FromUserId','as':_0xfd7f('0x1e6')});db[_0xfd7f('0x103')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':_0xfd7f('0x1e7'),'as':_0xfd7f('0x1ea')});db[_0xfd7f('0x103')][_0xfd7f('0x131')](db['SmsQueue'],{'foreignKey':_0xfd7f('0x1f3'),'as':'ToQueue'});db[_0xfd7f('0x103')][_0xfd7f('0x131')](db[_0xfd7f('0x58')],{'foreignKey':_0xfd7f('0x1f4'),'as':_0xfd7f('0x1e8')});db[_0xfd7f('0x105')][_0xfd7f('0x125')](db['Disposition'],{'as':_0xfd7f('0x173'),'foreignKey':_0xfd7f('0x179'),'onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x105')][_0xfd7f('0x125')](db[_0xfd7f('0x80')],{'as':_0xfd7f('0x1f5'),'foreignKey':_0xfd7f('0x179')});db[_0xfd7f('0x105')][_0xfd7f('0x125')](db['CmContact'],{'as':_0xfd7f('0x135'),'onDelete':_0xfd7f('0x123'),'foreignKey':_0xfd7f('0x179')});db[_0xfd7f('0x105')]['hasMany'](db[_0xfd7f('0x7a')],{'as':_0xfd7f('0x15d'),'foreignKey':_0xfd7f('0x179')});db[_0xfd7f('0x105')][_0xfd7f('0x125')](db[_0xfd7f('0x7c')],{'as':_0xfd7f('0x12a'),'foreignKey':'ListId'});db[_0xfd7f('0x105')][_0xfd7f('0x125')](db[_0xfd7f('0x7e')],{'as':_0xfd7f('0x7e'),'foreignKey':_0xfd7f('0x179')});db['CmList']['belongsToMany'](db[_0xfd7f('0x1c')],{'as':_0xfd7f('0x1f6'),'through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':_0xfd7f('0x137')});db[_0xfd7f('0x107')][_0xfd7f('0x125')](db[_0xfd7f('0x19')],{'as':_0xfd7f('0x129'),'onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x107')]['belongsToMany'](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':_0xfd7f('0x1f7')});db[_0xfd7f('0x109')][_0xfd7f('0x125')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x182'),'foreignKey':_0xfd7f('0x132')});db['UserProfile'][_0xfd7f('0x125')](db[_0xfd7f('0x10b')],{'as':_0xfd7f('0x1f8'),'foreignKey':'userProfileId','onDelete':_0xfd7f('0x123')});db[_0xfd7f('0x10b')][_0xfd7f('0x125')](db[_0xfd7f('0x10d')],{'as':'Resources','foreignKey':_0xfd7f('0x1f9'),'onDelete':'cascade'});db[_0xfd7f('0x110')][_0xfd7f('0x125')](db[_0xfd7f('0x87')],{'as':'Dispositions','foreignKey':_0xfd7f('0x1fa'),'onDelete':'cascade'});db[_0xfd7f('0x110')][_0xfd7f('0x125')](db['CannedAnswer'],{'as':_0xfd7f('0x174'),'foreignKey':'WhatsappAccountId'});db[_0xfd7f('0x110')]['hasMany'](db['WhatsappMessage'],{'as':_0xfd7f('0x175'),'foreignKey':'WhatsappAccountId'});db[_0xfd7f('0x110')]['hasMany'](db['WhatsappInteraction'],{'as':_0xfd7f('0x176')});db[_0xfd7f('0x110')][_0xfd7f('0x125')](db[_0xfd7f('0x112')],{'as':_0xfd7f('0x177')});db[_0xfd7f('0x110')][_0xfd7f('0x131')](db[_0xfd7f('0x105')],{'as':'List','foreignKey':_0xfd7f('0x179')});db['WhatsappAccount'][_0xfd7f('0x131')](db[_0xfd7f('0x8d')],{'as':_0xfd7f('0x165'),'foreignKey':_0xfd7f('0x166')});db[_0xfd7f('0x110')][_0xfd7f('0x133')](db['User'],{'as':_0xfd7f('0x168'),'through':'user_has_whatsapp_accounts'});db[_0xfd7f('0x112')]['belongsTo'](db[_0xfd7f('0x14')],{'onDelete':_0xfd7f('0x186')});db['WhatsappApplication']['belongsTo'](db[_0xfd7f('0x11b')],{'onDelete':'restrict'});db[_0xfd7f('0x112')][_0xfd7f('0x131')](db[_0xfd7f('0x110')],{'onDelete':_0xfd7f('0x186')});db[_0xfd7f('0x112')][_0xfd7f('0x131')](db[_0xfd7f('0x8b')],{'onDelete':_0xfd7f('0x186'),'foreignKey':_0xfd7f('0x164')});db[_0xfd7f('0x112')][_0xfd7f('0x131')](db['Tag'],{'onDelete':_0xfd7f('0x186'),'foreignKey':_0xfd7f('0x187')});db[_0xfd7f('0x114')][_0xfd7f('0x125')](db[_0xfd7f('0x116')],{'as':_0xfd7f('0x175'),'onDelete':'cascade','foreignKey':_0xfd7f('0x1fb')});db[_0xfd7f('0x114')][_0xfd7f('0x131')](db[_0xfd7f('0x110')],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x1fa')});db[_0xfd7f('0x114')][_0xfd7f('0x131')](db['CmContact'],{'as':'Contact','foreignKey':_0xfd7f('0x17f')});db['WhatsappInteraction'][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'as':'Owner','foreignKey':'UserId'});db[_0xfd7f('0x114')]['belongsToMany'](db[_0xfd7f('0x95')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0xfd7f('0x114')][_0xfd7f('0x133')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0xfd7f('0x193')});db[_0xfd7f('0x114')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x182'),'through':'user_has_whatsapp_interactions','foreignKey':_0xfd7f('0x1fb')});db['WhatsappMessage'][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x14')});db[_0xfd7f('0x116')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'onDelete':_0xfd7f('0x123'),'as':_0xfd7f('0x17e')});db[_0xfd7f('0x116')]['belongsTo'](db[_0xfd7f('0x114')],{'onDelete':_0xfd7f('0x123'),'as':_0xfd7f('0x183'),'foreignKey':'WhatsappInteractionId'});db[_0xfd7f('0x116')][_0xfd7f('0x131')](db['WhatsappAccount'],{'as':_0xfd7f('0x17d'),'foreignKey':_0xfd7f('0x1fa')});db[_0xfd7f('0x118')][_0xfd7f('0x131')](db[_0xfd7f('0x110')],{});db[_0xfd7f('0x118')][_0xfd7f('0x131')](db[_0xfd7f('0x105')],{'as':'List','foreignKey':_0xfd7f('0x179')});db[_0xfd7f('0x118')][_0xfd7f('0x131')](db[_0xfd7f('0x75')],{'as':_0xfd7f('0x17e'),'foreignKey':_0xfd7f('0x17f')});db[_0xfd7f('0x118')][_0xfd7f('0x131')](db['WhatsappInteraction'],{});db[_0xfd7f('0x118')][_0xfd7f('0x131')](db[_0xfd7f('0x11b')],{});db[_0xfd7f('0x118')][_0xfd7f('0x131')](db[_0xfd7f('0x116')],{});db[_0xfd7f('0x118')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{});db['WhatsappTransferReport'][_0xfd7f('0x131')](db[_0xfd7f('0x116')],{});db[_0xfd7f('0x11a')]['belongsTo'](db[_0xfd7f('0x114')],{});db[_0xfd7f('0x11a')][_0xfd7f('0x131')](db[_0xfd7f('0x110')],{'foreignKey':_0xfd7f('0x1fc'),'as':'FromAccount'});db['WhatsappTransferReport'][_0xfd7f('0x131')](db[_0xfd7f('0x110')],{'foreignKey':_0xfd7f('0x1fd'),'as':'ToAccount'});db['WhatsappTransferReport'][_0xfd7f('0x131')](db[_0xfd7f('0x11b')],{'foreignKey':_0xfd7f('0x1fe'),'as':_0xfd7f('0x1ef')});db[_0xfd7f('0x11a')][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':_0xfd7f('0x1e5'),'as':'FromAgent'});db['WhatsappTransferReport'][_0xfd7f('0x131')](db[_0xfd7f('0x14')],{'foreignKey':_0xfd7f('0x1e7'),'as':_0xfd7f('0x1ea')});db[_0xfd7f('0x11b')][_0xfd7f('0x133')](db[_0xfd7f('0x14')],{'as':_0xfd7f('0x168'),'through':_0xfd7f('0x3e'),'foreignKey':_0xfd7f('0x1ff')});db[_0xfd7f('0x11b')][_0xfd7f('0x133')](db[_0xfd7f('0xf3')],{'through':_0xfd7f('0x200'),'as':_0xfd7f('0x169')});module[_0xfd7f('0x201')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x4dfc=['MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','Groups','belongsToMany','Contacts','cm_user_has_contacts','CmList','user_has_teams','user_has_mail_interactions','ChatInteraction','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','MailQueues','UserMailQueue','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperBlacks','JscriptySessionReport','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','Messages','Interactions','MailApplication','ListId','TemplateId','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','Contact','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','List','Items','FaxAccountId','FaxApplication','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','AttachmentId','SmsAccountId','SmsMessage','SmsInteraction','sms_interaction_has_tags','ThroughTags','Users','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','ChatApplication','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatGroupId','chat_group_has_users','CmContactId','HopperHistories','Company','CompanyId','cm_contact_has_tags','CmHopperAdditionalPhone','CmHopperId','Campaign','CampaignId','All','AutomationAllId','Any','OneAny','AutomationAnyId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','Subject','Description','Field','SugarcrmField','Descriptions','FieldId','VariableId','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','ServicenowField','Dynamics365Configuration','Dynamics365Account','FreshsalesConfiguration','FromId','ToId','SessionId','JscriptyProject','ProjectId','SquareProject','user_has_square_projects','team_has_chat_queues','team_has_fax_queues','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAccount','FromUserId','ToChatWebsiteId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsAccountId','CustomFields','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','WhatsappTransferReport','ToQueueId','team_has_whatsapp_queues','lodash','jstz','determine','sequelize','defaultsDeep','motion2','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xcall','xC@LL1234','127.0.0.1','name','database','username','password','options','User','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsApplication','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.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','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','hasOne','VoiceMail','cascade','UserId','Recordings','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction'];(function(_0x485ece,_0x4e765d){var _0x3a90f7=function(_0x2b1614){while(--_0x2b1614){_0x485ece['push'](_0x485ece['shift']());}};_0x3a90f7(++_0x4e765d);}(_0x4dfc,0xda));var _0xc4df=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0x4dfc[_0x3a0ebd];return _0x51a660;};'use strict';var path=require('path');var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xc4df('0x0'));var jstz=require(_0xc4df('0x1'));var timezone=jstz[_0xc4df('0x2')]();config[_0xc4df('0x3')]=_[_0xc4df('0x4')](config[_0xc4df('0x3')],{'database':_0xc4df('0x5'),'username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xc4df('0x6'),'dialectOptions':{'charset':_0xc4df('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xc4df('0x8'),'collate':_0xc4df('0x9')}}});config[_0xc4df('0xa')]=_['defaultsDeep'](config[_0xc4df('0xa')],{'database':_0xc4df('0x5'),'username':_0xc4df('0xb'),'password':_0xc4df('0xc'),'options':{'host':_0xc4df('0xd'),'port':0xcea,'dialect':_0xc4df('0x6'),'dialectOptions':{'charset':_0xc4df('0x7')},'logging':![],'timezone':timezone[_0xc4df('0xe')](),'define':{'charset':'utf8','collate':_0xc4df('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc4df('0x3')][_0xc4df('0xf')],config[_0xc4df('0x3')][_0xc4df('0x10')],config[_0xc4df('0x3')][_0xc4df('0x11')],config[_0xc4df('0x3')][_0xc4df('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc4df('0xa')][_0xc4df('0xf')],config[_0xc4df('0xa')][_0xc4df('0x10')],config[_0xc4df('0xa')][_0xc4df('0x11')],config[_0xc4df('0xa')]['options'])};db[_0xc4df('0x13')]=db[_0xc4df('0x3')]['import']('../api/user/user.model');db[_0xc4df('0x14')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x16'));db[_0xc4df('0x17')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x18'));db[_0xc4df('0x19')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x1a'));db[_0xc4df('0x1b')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x1c'));db[_0xc4df('0x1d')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x1e'));db[_0xc4df('0x1f')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x20'));db['ScreenRecording']=db[_0xc4df('0x3')]['import']('../api/screenRecording/screenRecording.model');db['VoiceMail']=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x21'));db['VoiceMailMessage']=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x22'));db[_0xc4df('0x23')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x24'));db[_0xc4df('0x25')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0xc4df('0x26')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x27'));db[_0xc4df('0x28')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x29'));db[_0xc4df('0x2a')]=db['sequelize'][_0xc4df('0x15')]('../api/memberReport/memberReport.model');db[_0xc4df('0x2b')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x2c'));db[_0xc4df('0x2d')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x2e'));db['UserVoiceQueueRt']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x2f'));db[_0xc4df('0x30')]=db['sequelize']['import']('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x31'));db['UserMailQueue']=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x32'));db[_0xc4df('0x33')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/userFaxQueue/userFaxQueue.model');db[_0xc4df('0x34')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x35'));db[_0xc4df('0x36')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x37'));db[_0xc4df('0x38')]=db[_0xc4df('0x3')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xc4df('0x39')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x3a'));db[_0xc4df('0x3b')]=db['sequelize']['import'](_0xc4df('0x3c'));db[_0xc4df('0x3d')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x3e'));db['MailQueue']=db[_0xc4df('0x3')]['import']('../api/mailQueue/mailQueue.model');db[_0xc4df('0x3f')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x40'));db[_0xc4df('0x41')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x42'));db['MailApplication']=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/mailApplication/mailApplication.model');db[_0xc4df('0x43')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x44'));db[_0xc4df('0x45')]=db[_0xc4df('0x3')]['import']('../api/dashboard/dashboard.model');db[_0xc4df('0x46')]=db[_0xc4df('0x3')]['import']('../api/dashboardItem/dashboardItem.model');db[_0xc4df('0x47')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x48'));db['FaxApplication']=db[_0xc4df('0x3')]['import'](_0xc4df('0x49'));db['FaxInteraction']=db['sequelize']['import'](_0xc4df('0x4a'));db['FaxMessage']=db[_0xc4df('0x3')]['import'](_0xc4df('0x4b'));db[_0xc4df('0x4c')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x4d'));db[_0xc4df('0x4e')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x4f'));db['SmsAccount']=db[_0xc4df('0x3')]['import']('../api/smsAccount/smsAccount.model');db[_0xc4df('0x50')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x51'));db['SmsMessage']=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x52'));db[_0xc4df('0x53')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/smsQueue/smsQueue.model');db[_0xc4df('0x54')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x55'));db[_0xc4df('0x56')]=db[_0xc4df('0x3')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0xc4df('0x57')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x58'));db[_0xc4df('0x59')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x5a'));db[_0xc4df('0x5b')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x5c'));db[_0xc4df('0x5d')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x5e'));db[_0xc4df('0x5f')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x60'));db['ChatApplication']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x61'));db['ChatInteraction']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x62'));db[_0xc4df('0x63')]=db['sequelize']['import'](_0xc4df('0x64'));db[_0xc4df('0x65')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x66'));db[_0xc4df('0x67')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/chatQueue/chatQueue.model');db[_0xc4df('0x68')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x69'));db[_0xc4df('0x6a')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x6b'));db[_0xc4df('0x6c')]=db['sequelize']['import'](_0xc4df('0x6d'));db[_0xc4df('0x6e')]=db['sequelize'][_0xc4df('0x15')]('../api/cmContact/cmContact.model');db['CmHopper']=db['sequelize']['import'](_0xc4df('0x6f'));db[_0xc4df('0x70')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x71'));db[_0xc4df('0x72')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x73'));db[_0xc4df('0x74')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x75'));db[_0xc4df('0x76')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x77'));db[_0xc4df('0x78')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x79'));db[_0xc4df('0x7a')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x7b'));db[_0xc4df('0x7c')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x7d'));db[_0xc4df('0x7e')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x7f'));db[_0xc4df('0x80')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x81'));db[_0xc4df('0x82')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/condition/condition.model');db[_0xc4df('0x83')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x84'));db[_0xc4df('0x85')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x86'));db[_0xc4df('0x87')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x88'));db[_0xc4df('0x89')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x8a'));db[_0xc4df('0x8b')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/schedule/schedule.model');db[_0xc4df('0x8c')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/sound/sound.model');db['Tag']=db[_0xc4df('0x3')]['import'](_0xc4df('0x8d'));db[_0xc4df('0x8e')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x8f'));db[_0xc4df('0x90')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x91'));db['CmHopperAdditionalPhone']=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0xc4df('0x92')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x93'));db[_0xc4df('0x94')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x95'));db[_0xc4df('0x96')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x97'));db['Integration']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x98'));db[_0xc4df('0x99')]=db['sequelize'][_0xc4df('0x15')]('../api/integrationReport/integrationReport.model');db[_0xc4df('0x9a')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x9b'));db[_0xc4df('0x9c')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x9d'));db['AnalyticExtractedReport']=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x9e'));db[_0xc4df('0x9f')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xa0'));db[_0xc4df('0xa1')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xa2'));db[_0xc4df('0xa3')]=db[_0xc4df('0x3')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0xc4df('0xa4')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xc4df('0xa5')]=db[_0xc4df('0x3')]['import'](_0xc4df('0xa6'));db[_0xc4df('0xa7')]=db[_0xc4df('0x3')]['import'](_0xc4df('0xa8'));db[_0xc4df('0xa9')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xaa'));db[_0xc4df('0xab')]=db[_0xc4df('0x3')]['import'](_0xc4df('0xac'));db['SugarcrmField']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xad'));db[_0xc4df('0xae')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/intDeskAccount/intDeskAccount.model');db[_0xc4df('0xaf')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xb0'));db[_0xc4df('0xb1')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/intDeskField/intDeskField.model');db[_0xc4df('0xb2')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xb3'));db[_0xc4df('0xb4')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xb5'));db[_0xc4df('0xb6')]=db[_0xc4df('0x3')]['import'](_0xc4df('0xb7'));db[_0xc4df('0xb8')]=db[_0xc4df('0x3')]['import'](_0xc4df('0xb9'));db[_0xc4df('0xba')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xbb'));db[_0xc4df('0xbc')]=db['sequelize']['import'](_0xc4df('0xbd'));db[_0xc4df('0xbe')]=db[_0xc4df('0x3')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xc4df('0xbf')]=db['sequelize']['import'](_0xc4df('0xc0'));db[_0xc4df('0xc1')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xc2'));db[_0xc4df('0xc3')]=db['sequelize'][_0xc4df('0x15')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xc4df('0xc4')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xc5'));db[_0xc4df('0xc6')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xc7'));db[_0xc4df('0xc8')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xc4df('0xc9')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xca'));db['ServicenowField']=db['sequelize'][_0xc4df('0x15')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db['sequelize'][_0xc4df('0x15')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xc4df('0xcb')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xcc'));db[_0xc4df('0xcd')]=db[_0xc4df('0x3')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xce'));db[_0xc4df('0xcf')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xd0'));db[_0xc4df('0xd1')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/integration/integration.model');db['Network']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xd2'));db[_0xc4df('0xd3')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xd4'));db[_0xc4df('0xd5')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xc4df('0xd6')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xd7'));db[_0xc4df('0xd8')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xd9'));db['JscriptySessionReport']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xda'));db[_0xc4df('0xdb')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xdc'));db['SquareReport']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xdd'));db['SquareDetailsReport']=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xde'));db['JscriptyProject']=db[_0xc4df('0x3')]['import'](_0xc4df('0xdf'));db['Setting']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xe0'));db[_0xc4df('0xe1')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xe2'));db['SquareProject']=db[_0xc4df('0x3')]['import'](_0xc4df('0xe3'));db[_0xc4df('0xe4')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/squareRecording/squareRecording.model');db[_0xc4df('0xe5')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/squareMessage/squareMessage.model');db[_0xc4df('0xe6')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xe7'));db[_0xc4df('0xe8')]=db['sequelize']['import'](_0xc4df('0xe9'));db['Campaign']=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xea'));db[_0xc4df('0xeb')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/migration/migration.model');db[_0xc4df('0xec')]=db['sequelize']['import']('../api/attachment/attachment.model');db[_0xc4df('0xed')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xee'));db[_0xc4df('0xef')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xf0'));db['ChatTransferReport']=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xf1'));db[_0xc4df('0xf2')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0xc4df('0xf3')]=db['sequelize'][_0xc4df('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xf4'));db['CmList']=db[_0xc4df('0x3')]['import'](_0xc4df('0xf5'));db[_0xc4df('0xf6')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xf7'));db[_0xc4df('0xf8')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xf9'));db[_0xc4df('0xfa')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0xfb'));db[_0xc4df('0xfc')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/userProfileResource/userProfileResource.model');db[_0xc4df('0xfd')]=db[_0xc4df('0x3')][_0xc4df('0x15')]('../api/userNotification/userNotification.model');db[_0xc4df('0xfe')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0xff'));db[_0xc4df('0x100')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x101'));db[_0xc4df('0x102')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x103'));db[_0xc4df('0x104')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x105'));db[_0xc4df('0x106')]=db[_0xc4df('0x3')]['import'](_0xc4df('0x107'));db['WhatsappTransferReport']=db['sequelize'][_0xc4df('0x15')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xc4df('0x108')]=db['sequelize'][_0xc4df('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0xc4df('0x109')]=db['sequelize'][_0xc4df('0x15')](_0xc4df('0x10a'));db['Realtime']=db[_0xc4df('0x3')]['import']('../api/realtime/realtime.model');db[_0xc4df('0x10b')]=db[_0xc4df('0x3')][_0xc4df('0x15')](_0xc4df('0x10c'));db['User'][_0xc4df('0x10d')](db[_0xc4df('0x10e')],{'as':_0xc4df('0x10e'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x110')});db['User']['hasMany'](db['VoiceRecording'],{'as':_0xc4df('0x111'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x13')][_0xc4df('0x112')](db[_0xc4df('0x113')],{'as':_0xc4df('0x114'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x13')][_0xc4df('0x112')](db[_0xc4df('0x19')],{'as':_0xc4df('0x115'),'onDelete':'cascade','hooks':!![]});db[_0xc4df('0x13')]['hasMany'](db['CmHopperFinal'],{'as':_0xc4df('0x116'),'foreignKey':_0xc4df('0x110')});db['User'][_0xc4df('0x112')](db[_0xc4df('0x74')],{'as':_0xc4df('0x117'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x13')][_0xc4df('0x112')](db['ReportAgentPreview'],{'as':_0xc4df('0x76'),'foreignKey':_0xc4df('0x110')});db['User']['hasMany'](db['OpenchannelInteraction'],{'as':_0xc4df('0x118'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x13')]['hasMany'](db['ChatInteraction'],{'as':_0xc4df('0x119'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x13')][_0xc4df('0x112')](db['SmsInteraction'],{'as':_0xc4df('0x11a'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x13')]['hasMany'](db[_0xc4df('0x11b')],{'as':'FaxInteractions','foreignKey':_0xc4df('0x110')});db['User'][_0xc4df('0x112')](db[_0xc4df('0x11c')],{'as':_0xc4df('0x11d'),'foreignKey':'UserId'});db[_0xc4df('0x13')]['hasMany'](db[_0xc4df('0x102')],{'as':_0xc4df('0x11e'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x13')]['hasMany'](db[_0xc4df('0xfd')],{'as':_0xc4df('0x11f'),'foreignKey':_0xc4df('0x120')});db[_0xc4df('0x13')]['belongsTo'](db[_0xc4df('0xf8')],{'as':_0xc4df('0xf8'),'foreignKey':_0xc4df('0x121')});db[_0xc4df('0x13')]['belongsToMany'](db[_0xc4df('0x68')],{'as':_0xc4df('0x122'),'through':'chat_group_has_users'});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x6e')],{'as':_0xc4df('0x124'),'through':_0xc4df('0x125')});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x126')],{'as':'Lists','through':'cm_user_has_lists'});db[_0xc4df('0x13')]['belongsToMany'](db['Team'],{'through':_0xc4df('0x127')});db[_0xc4df('0x13')][_0xc4df('0x123')](db['MailInteraction'],{'as':_0xc4df('0x11d'),'through':_0xc4df('0x128')});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x129')],{'as':_0xc4df('0x119'),'through':_0xc4df('0x12a')});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x11b')],{'as':_0xc4df('0x12b'),'through':_0xc4df('0x12c')});db[_0xc4df('0x13')]['belongsToMany'](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xc4df('0x12d')});db[_0xc4df('0x13')]['belongsToMany'](db[_0xc4df('0x57')],{'as':'OpenchannelInteractions','through':_0xc4df('0x12e')});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x102')],{'as':_0xc4df('0x11e'),'through':_0xc4df('0x12f')});db['User'][_0xc4df('0x123')](db[_0xc4df('0x1d')],{'as':_0xc4df('0x130'),'through':'UserVoiceQueue','required':![]});db[_0xc4df('0x13')]['belongsToMany'](db[_0xc4df('0x131')],{'as':_0xc4df('0x132'),'through':_0xc4df('0x133'),'required':![]});db[_0xc4df('0x13')]['belongsToMany'](db[_0xc4df('0x67')],{'as':_0xc4df('0x134'),'through':_0xc4df('0x135'),'required':![],'hooks':!![]});db[_0xc4df('0x13')][_0xc4df('0x123')](db['FaxQueue'],{'as':_0xc4df('0x136'),'through':_0xc4df('0x33'),'required':![]});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x53')],{'as':_0xc4df('0x137'),'through':'UserSmsQueue','required':![]});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x5b')],{'as':_0xc4df('0x138'),'through':'UserOpenchannelQueue','required':![]});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x108')],{'as':_0xc4df('0x139'),'through':_0xc4df('0x38'),'required':![]});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x126')],{'through':_0xc4df('0x13a')});db['User']['belongsToMany'](db[_0xc4df('0xf6')],{'as':_0xc4df('0x13b'),'through':_0xc4df('0x13c'),'required':![]});db[_0xc4df('0x13')]['belongsToMany'](db['ChatWebsite'],{'as':_0xc4df('0x13d'),'through':_0xc4df('0x13e')});db[_0xc4df('0x13')][_0xc4df('0x123')](db[_0xc4df('0x47')],{'as':_0xc4df('0x13f'),'through':_0xc4df('0x140')});db['User'][_0xc4df('0x123')](db[_0xc4df('0x3d')],{'as':_0xc4df('0x141'),'through':_0xc4df('0x142')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':_0xc4df('0x143'),'through':_0xc4df('0x144')});db[_0xc4df('0x13')]['belongsToMany'](db[_0xc4df('0x145')],{'as':_0xc4df('0x146'),'through':_0xc4df('0x147')});db[_0xc4df('0x13')]['belongsToMany'](db[_0xc4df('0xfe')],{'as':_0xc4df('0x148'),'through':_0xc4df('0x149')});db[_0xc4df('0x13')][_0xc4df('0x123')](db['SquareProject'],{'as':'SquareProjects','through':'user_has_square_projects'});db[_0xc4df('0x14')][_0xc4df('0x112')](db[_0xc4df('0x19')],{'as':_0xc4df('0x14a'),'onDelete':_0xc4df('0x10f'),'foreignKey':'ChanSpyId'});db[_0xc4df('0x17')]['hasMany'](db['VoiceExtension'],{'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x19')][_0xc4df('0x112')](db[_0xc4df('0x19')],{'as':_0xc4df('0x14b'),'onDelete':'cascade'});db[_0xc4df('0x1b')][_0xc4df('0x123')](db['Sound'],{'as':_0xc4df('0x14c'),'through':_0xc4df('0x14d')});db[_0xc4df('0x1d')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xc4df('0x14e'),'foreignKey':_0xc4df('0x14f')});db['VoiceQueue']['hasMany'](db[_0xc4df('0x150')],{'as':_0xc4df('0x151'),'foreignKey':'VoiceQueueId'});db[_0xc4df('0x1d')][_0xc4df('0x112')](db[_0xc4df('0x72')],{'as':_0xc4df('0x116'),'foreignKey':_0xc4df('0x14f')});db[_0xc4df('0x1d')]['hasMany'](db[_0xc4df('0x74')],{'as':'HopperHistories','foreignKey':_0xc4df('0x14f')});db[_0xc4df('0x1d')][_0xc4df('0x112')](db['ReportAgentPreview'],{'as':_0xc4df('0x76'),'foreignKey':_0xc4df('0x14f')});db['VoiceQueue'][_0xc4df('0x112')](db[_0xc4df('0x70')],{'as':_0xc4df('0x152'),'foreignKey':_0xc4df('0x14f')});db[_0xc4df('0x1d')][_0xc4df('0x112')](db[_0xc4df('0x153')],{'as':'JscriptySessions','foreignKey':_0xc4df('0x14f')});db['VoiceQueue'][_0xc4df('0x154')](db[_0xc4df('0x2b')],{'as':_0xc4df('0x2b'),'foreignKey':_0xc4df('0x155')});db[_0xc4df('0x1d')][_0xc4df('0x154')](db[_0xc4df('0x2b')],{'as':_0xc4df('0x156'),'foreignKey':_0xc4df('0x157')});db[_0xc4df('0x1d')][_0xc4df('0x154')](db[_0xc4df('0x83')],{'as':_0xc4df('0x83'),'foreignKey':_0xc4df('0x158')});db[_0xc4df('0x1d')]['belongsTo'](db[_0xc4df('0x85')],{'as':_0xc4df('0x159'),'foreignKey':_0xc4df('0x15a')});db[_0xc4df('0x1d')][_0xc4df('0x123')](db[_0xc4df('0x126')],{'as':_0xc4df('0x15b'),'through':_0xc4df('0x15c')});db[_0xc4df('0x1d')][_0xc4df('0x123')](db['User'],{'as':_0xc4df('0x15d'),'through':_0xc4df('0x30')});db[_0xc4df('0x1d')][_0xc4df('0x123')](db['Team'],{'as':'Teams','through':_0xc4df('0x10b')});db['VoiceQueue'][_0xc4df('0x123')](db[_0xc4df('0x126')],{'as':_0xc4df('0x15e'),'through':_0xc4df('0x15f')});db['VoiceRecording']['belongsTo'](db[_0xc4df('0x13')],{'as':_0xc4df('0x13'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x160')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'as':'User','foreignKey':_0xc4df('0x110')});db[_0xc4df('0x10e')][_0xc4df('0x112')](db[_0xc4df('0x161')],{'as':'Messages','onDelete':_0xc4df('0x10f'),'foreignKey':'mailboxuser','sourceKey':_0xc4df('0x162')});db[_0xc4df('0x161')][_0xc4df('0x154')](db[_0xc4df('0x10e')],{'foreignKey':_0xc4df('0x163'),'targetKey':_0xc4df('0x162')});db[_0xc4df('0x23')][_0xc4df('0x112')](db[_0xc4df('0x28')],{'as':_0xc4df('0x164'),'foreignKey':_0xc4df('0x165'),'constraints':![]});db['VoiceCallReport'][_0xc4df('0x112')](db[_0xc4df('0x26')],{'as':_0xc4df('0x166'),'foreignKey':_0xc4df('0x165'),'constraints':![]});db[_0xc4df('0x23')][_0xc4df('0x154')](db['User'],{'as':_0xc4df('0x13'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x23')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':'Contact','foreignKey':_0xc4df('0x167')});db['MailServerIn']['belongsTo'](db[_0xc4df('0x3d')],{'as':'MailAccount','foreignKey':_0xc4df('0x168')});db[_0xc4df('0x3b')][_0xc4df('0x154')](db[_0xc4df('0x3d')],{'as':_0xc4df('0x3d'),'foreignKey':_0xc4df('0x168')});db[_0xc4df('0x3d')][_0xc4df('0x10d')](db['MailServerIn'],{'as':_0xc4df('0x169'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x3d')]['hasOne'](db['MailServerOut'],{'as':_0xc4df('0x16a'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x3d')][_0xc4df('0x112')](db[_0xc4df('0x80')],{'as':_0xc4df('0x16b'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0xc4df('0x3d')][_0xc4df('0x112')](db[_0xc4df('0x7e')],{'as':_0xc4df('0x16c'),'foreignKey':_0xc4df('0x168')});db[_0xc4df('0x3d')][_0xc4df('0x112')](db[_0xc4df('0x41')],{'as':_0xc4df('0x16d'),'foreignKey':_0xc4df('0x168')});db[_0xc4df('0x3d')]['hasMany'](db[_0xc4df('0x11c')],{'as':_0xc4df('0x16e')});db[_0xc4df('0x3d')]['hasMany'](db[_0xc4df('0x16f')],{'as':_0xc4df('0x14b')});db['MailAccount'][_0xc4df('0x154')](db[_0xc4df('0x126')],{'as':'List','foreignKey':_0xc4df('0x170')});db['MailAccount'][_0xc4df('0x154')](db[_0xc4df('0x92')],{'as':'Template','foreignKey':_0xc4df('0x171')});db['MailAccount'][_0xc4df('0x154')](db[_0xc4df('0x85')],{'as':_0xc4df('0x159'),'foreignKey':_0xc4df('0x15a')});db[_0xc4df('0x3d')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x15d'),'through':_0xc4df('0x142')});db[_0xc4df('0x131')]['belongsToMany'](db[_0xc4df('0x13')],{'as':_0xc4df('0x15d'),'through':_0xc4df('0x133')});db[_0xc4df('0x131')][_0xc4df('0x123')](db[_0xc4df('0xe6')],{'through':_0xc4df('0x172'),'as':_0xc4df('0x173')});db['MailInteraction'][_0xc4df('0x112')](db[_0xc4df('0x41')],{'as':_0xc4df('0x16d'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x174')});db['MailInteraction'][_0xc4df('0x154')](db[_0xc4df('0x3d')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x168')});db[_0xc4df('0x11c')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xc4df('0x167')});db[_0xc4df('0x11c')][_0xc4df('0x154')](db['User'],{'as':_0xc4df('0x176'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x11c')]['belongsToMany'](db[_0xc4df('0x177')],{'through':_0xc4df('0x178'),'as':_0xc4df('0x179')});db[_0xc4df('0x11c')]['belongsToMany'](db[_0xc4df('0x177')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0xc4df('0x11c')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0xc4df('0x174')});db[_0xc4df('0x41')][_0xc4df('0x112')](db[_0xc4df('0xec')],{'as':'Attachments','onDelete':_0xc4df('0x10f')});db[_0xc4df('0x41')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'as':_0xc4df('0x13')});db[_0xc4df('0x41')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'onDelete':_0xc4df('0x10f'),'as':_0xc4df('0x17a')});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':_0xc4df('0x17b'),'foreignKey':_0xc4df('0x174')});db[_0xc4df('0x41')][_0xc4df('0x154')](db[_0xc4df('0x3d')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x168')});db[_0xc4df('0x41')][_0xc4df('0x154')](db[_0xc4df('0x5d')],{'as':_0xc4df('0x5d'),'foreignKey':_0xc4df('0x17c')});db['MailMessage']['belongsTo'](db[_0xc4df('0x65')],{'as':'ChatOfflineMessage','foreignKey':_0xc4df('0x17d')});db[_0xc4df('0x16f')]['belongsTo'](db[_0xc4df('0x13')],{'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x16f')][_0xc4df('0x154')](db[_0xc4df('0x131')],{'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x16f')][_0xc4df('0x154')](db[_0xc4df('0x3d')],{'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x16f')][_0xc4df('0x154')](db[_0xc4df('0x83')],{'onDelete':_0xc4df('0x17e'),'foreignKey':_0xc4df('0x158')});db[_0xc4df('0x16f')][_0xc4df('0x154')](db[_0xc4df('0x177')],{'onDelete':_0xc4df('0x17e'),'foreignKey':_0xc4df('0x17f')});db[_0xc4df('0x43')][_0xc4df('0x154')](db[_0xc4df('0x3d')],{});db[_0xc4df('0x43')][_0xc4df('0x154')](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':'ListId'});db['MailQueueReport'][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167')});db[_0xc4df('0x43')][_0xc4df('0x154')](db[_0xc4df('0x11c')],{});db[_0xc4df('0x43')][_0xc4df('0x154')](db['MailMessage'],{});db[_0xc4df('0x43')][_0xc4df('0x154')](db[_0xc4df('0x13')],{});db['MailQueueReport'][_0xc4df('0x154')](db[_0xc4df('0x131')],{});db[_0xc4df('0x45')][_0xc4df('0x112')](db[_0xc4df('0x46')],{'as':_0xc4df('0x181'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x47')][_0xc4df('0x112')](db[_0xc4df('0x80')],{'as':_0xc4df('0x16b'),'foreignKey':_0xc4df('0x182'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x47')][_0xc4df('0x112')](db[_0xc4df('0x7e')],{'as':'Answers','foreignKey':_0xc4df('0x182')});db[_0xc4df('0x47')][_0xc4df('0x112')](db[_0xc4df('0x11b')],{'as':_0xc4df('0x16e')});db['FaxAccount'][_0xc4df('0x112')](db[_0xc4df('0x183')],{'as':_0xc4df('0x14b')});db[_0xc4df('0x47')]['hasMany'](db[_0xc4df('0x19')],{'as':_0xc4df('0x184'),'onDelete':_0xc4df('0x10f')});db['FaxAccount'][_0xc4df('0x112')](db[_0xc4df('0x185')],{'as':_0xc4df('0x16d')});db[_0xc4df('0x47')][_0xc4df('0x154')](db[_0xc4df('0x2b')],{'as':_0xc4df('0x2b')});db[_0xc4df('0x47')][_0xc4df('0x154')](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':'ListId'});db['FaxAccount'][_0xc4df('0x154')](db['Pause'],{'as':_0xc4df('0x159'),'foreignKey':_0xc4df('0x15a')});db[_0xc4df('0x47')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x15d'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0xc4df('0x154')](db[_0xc4df('0x13')],{'onDelete':_0xc4df('0x17e')});db['FaxApplication']['belongsTo'](db[_0xc4df('0x4c')],{'onDelete':_0xc4df('0x17e')});db['FaxApplication'][_0xc4df('0x154')](db['FaxAccount'],{'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x183')][_0xc4df('0x154')](db[_0xc4df('0x177')],{'onDelete':'restrict','foreignKey':_0xc4df('0x17f')});db['FaxInteraction'][_0xc4df('0x112')](db[_0xc4df('0x185')],{'as':_0xc4df('0x16d'),'onDelete':'cascade','foreignKey':_0xc4df('0x186')});db[_0xc4df('0x11b')][_0xc4df('0x154')](db[_0xc4df('0x47')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x182')});db['FaxInteraction'][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167')});db[_0xc4df('0x11b')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'as':_0xc4df('0x176'),'foreignKey':'UserId'});db[_0xc4df('0x11b')][_0xc4df('0x123')](db[_0xc4df('0x177')],{'through':_0xc4df('0x187'),'as':_0xc4df('0x179')});db['FaxInteraction'][_0xc4df('0x123')](db['Tag'],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0xc4df('0x11b')][_0xc4df('0x123')](db['User'],{'as':'Users','through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xc4df('0x185')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'onDelete':'cascade','as':'User'});db[_0xc4df('0x185')][_0xc4df('0x154')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xc4df('0x186')});db['FaxMessage'][_0xc4df('0x154')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db['FaxMessage'][_0xc4df('0x154')](db[_0xc4df('0xec')],{'as':'Attachment','foreignKey':_0xc4df('0x188')});db[_0xc4df('0x185')][_0xc4df('0x154')](db['FaxAccount'],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x182')});db['FaxQueue']['belongsToMany'](db[_0xc4df('0x13')],{'as':'Agents','through':_0xc4df('0x33')});db[_0xc4df('0x4c')][_0xc4df('0x123')](db[_0xc4df('0xe6')],{'through':'team_has_fax_queues','as':_0xc4df('0x173')});db[_0xc4df('0x4e')][_0xc4df('0x154')](db[_0xc4df('0x47')],{});db[_0xc4df('0x4e')][_0xc4df('0x154')](db['CmList'],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170')});db[_0xc4df('0x4e')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167')});db['FaxQueueReport'][_0xc4df('0x154')](db[_0xc4df('0x11b')],{});db[_0xc4df('0x4e')]['belongsTo'](db[_0xc4df('0x185')],{});db[_0xc4df('0x4e')][_0xc4df('0x154')](db[_0xc4df('0x13')],{});db['FaxQueueReport']['belongsTo'](db[_0xc4df('0x4c')],{});db[_0xc4df('0x145')][_0xc4df('0x112')](db[_0xc4df('0x80')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0xc4df('0x10f')});db[_0xc4df('0x145')][_0xc4df('0x112')](db[_0xc4df('0x7e')],{'as':_0xc4df('0x16c'),'foreignKey':_0xc4df('0x189')});db['SmsAccount']['hasMany'](db[_0xc4df('0x18a')],{'as':_0xc4df('0x16d'),'foreignKey':'SmsAccountId'});db[_0xc4df('0x145')][_0xc4df('0x112')](db[_0xc4df('0x18b')],{'as':'Interactions'});db[_0xc4df('0x145')][_0xc4df('0x112')](db[_0xc4df('0x50')],{'as':_0xc4df('0x14b')});db['SmsAccount'][_0xc4df('0x154')](db[_0xc4df('0x126')],{'as':'List','foreignKey':_0xc4df('0x170')});db[_0xc4df('0x145')]['belongsTo'](db['Pause'],{'as':_0xc4df('0x159'),'foreignKey':_0xc4df('0x15a')});db[_0xc4df('0x145')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':'Agents','through':_0xc4df('0x147')});db[_0xc4df('0x50')]['belongsTo'](db[_0xc4df('0x13')],{'onDelete':_0xc4df('0x17e')});db['SmsApplication']['belongsTo'](db[_0xc4df('0x53')],{'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x50')][_0xc4df('0x154')](db[_0xc4df('0x145')],{'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x50')][_0xc4df('0x154')](db['Interval'],{'onDelete':_0xc4df('0x17e'),'foreignKey':_0xc4df('0x158')});db[_0xc4df('0x50')][_0xc4df('0x154')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xc4df('0x17f')});db[_0xc4df('0x18b')][_0xc4df('0x112')](db[_0xc4df('0x18a')],{'as':'Messages','onDelete':_0xc4df('0x10f'),'foreignKey':'SmsInteractionId'});db[_0xc4df('0x18b')]['belongsTo'](db[_0xc4df('0x145')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x189')});db['SmsInteraction'][_0xc4df('0x154')](db['CmContact'],{'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167')});db['SmsInteraction'][_0xc4df('0x154')](db[_0xc4df('0x13')],{'as':'Owner','foreignKey':_0xc4df('0x110')});db[_0xc4df('0x18b')]['belongsToMany'](db[_0xc4df('0x177')],{'through':_0xc4df('0x18c'),'as':_0xc4df('0x179')});db[_0xc4df('0x18b')][_0xc4df('0x123')](db[_0xc4df('0x177')],{'through':_0xc4df('0x18c'),'as':_0xc4df('0x18d')});db['SmsInteraction'][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x18e'),'through':'user_has_sms_interactions','foreignKey':_0xc4df('0x18f')});db[_0xc4df('0x18a')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'as':_0xc4df('0x13')});db[_0xc4df('0x18a')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'onDelete':_0xc4df('0x10f'),'as':'Contact'});db[_0xc4df('0x18a')][_0xc4df('0x154')](db['SmsInteraction'],{'onDelete':_0xc4df('0x10f'),'as':'Interaction','foreignKey':_0xc4df('0x18f')});db[_0xc4df('0x18a')][_0xc4df('0x154')](db[_0xc4df('0x145')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x189')});db['SmsQueue'][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x15d'),'through':_0xc4df('0x34'),'foreignKey':'SmsQueueId'});db[_0xc4df('0x53')]['belongsToMany'](db[_0xc4df('0xe6')],{'through':_0xc4df('0x190'),'as':_0xc4df('0x173')});db[_0xc4df('0x54')]['hasMany'](db[_0xc4df('0x80')],{'as':_0xc4df('0x16b'),'foreignKey':'OpenchannelAccountId','onDelete':_0xc4df('0x10f')});db[_0xc4df('0x54')][_0xc4df('0x112')](db[_0xc4df('0x7e')],{'as':_0xc4df('0x16c'),'foreignKey':_0xc4df('0x191')});db['OpenchannelAccount'][_0xc4df('0x112')](db[_0xc4df('0x57')],{'as':_0xc4df('0x16e'),'foreignKey':_0xc4df('0x191')});db[_0xc4df('0x54')][_0xc4df('0x112')](db[_0xc4df('0x59')],{'as':_0xc4df('0x16d'),'foreignKey':_0xc4df('0x191')});db['OpenchannelAccount'][_0xc4df('0x112')](db['OpenchannelApplication'],{'as':_0xc4df('0x14b'),'foreignKey':_0xc4df('0x191')});db['OpenchannelAccount'][_0xc4df('0x154')](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170')});db['OpenchannelAccount'][_0xc4df('0x154')](db['Pause'],{'as':_0xc4df('0x159'),'foreignKey':_0xc4df('0x15a')});db[_0xc4df('0x54')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x15d'),'through':_0xc4df('0x144')});db[_0xc4df('0x56')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x56')][_0xc4df('0x154')](db[_0xc4df('0x5b')],{'onDelete':_0xc4df('0x17e'),'foreignKey':_0xc4df('0x192')});db[_0xc4df('0x56')][_0xc4df('0x154')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0xc4df('0x191')});db[_0xc4df('0x56')][_0xc4df('0x154')](db['Interval'],{'onDelete':_0xc4df('0x17e'),'foreignKey':'IntervalId'});db['OpenchannelApplication']['belongsTo'](db[_0xc4df('0x177')],{'onDelete':_0xc4df('0x17e'),'foreignKey':_0xc4df('0x17f')});db[_0xc4df('0x57')][_0xc4df('0x112')](db[_0xc4df('0x59')],{'as':_0xc4df('0x16d'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0xc4df('0x57')]['belongsTo'](db[_0xc4df('0x54')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x191')});db['OpenchannelInteraction'][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':'Contact','foreignKey':'ContactId'});db[_0xc4df('0x57')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'as':_0xc4df('0x176'),'foreignKey':'UserId'});db[_0xc4df('0x57')]['belongsToMany'](db[_0xc4df('0x177')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db['OpenchannelInteraction'][_0xc4df('0x123')](db[_0xc4df('0x177')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0xc4df('0x57')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':'Users','through':_0xc4df('0x12e'),'foreignKey':_0xc4df('0x193')});db[_0xc4df('0x59')]['belongsTo'](db[_0xc4df('0x13')],{'onDelete':_0xc4df('0x10f'),'as':_0xc4df('0x13')});db[_0xc4df('0x59')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'onDelete':_0xc4df('0x10f'),'as':_0xc4df('0x17a')});db[_0xc4df('0x59')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0xc4df('0x10f'),'as':'Interaction','foreignKey':_0xc4df('0x193')});db[_0xc4df('0x59')][_0xc4df('0x154')](db[_0xc4df('0xec')],{'as':_0xc4df('0xec'),'foreignKey':_0xc4df('0x188')});db[_0xc4df('0x59')]['belongsTo'](db[_0xc4df('0x54')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xc4df('0x5b')][_0xc4df('0x123')](db['User'],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0xc4df('0x192')});db['OpenchannelQueue'][_0xc4df('0x123')](db[_0xc4df('0xe6')],{'through':_0xc4df('0x194'),'as':_0xc4df('0x173')});db[_0xc4df('0x5d')][_0xc4df('0x112')](db[_0xc4df('0x80')],{'as':_0xc4df('0x16b'),'foreignKey':_0xc4df('0x17c'),'onDelete':'cascade'});db[_0xc4df('0x5d')][_0xc4df('0x112')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xc4df('0x17c')});db[_0xc4df('0x5d')][_0xc4df('0x112')](db[_0xc4df('0x6a')],{'as':_0xc4df('0x195')});db[_0xc4df('0x5d')][_0xc4df('0x112')](db[_0xc4df('0x129')],{'as':_0xc4df('0x16e')});db[_0xc4df('0x5d')][_0xc4df('0x112')](db[_0xc4df('0x196')],{'as':_0xc4df('0x14b')});db[_0xc4df('0x5d')]['hasMany'](db[_0xc4df('0x63')],{'as':'Messages'});db[_0xc4df('0x5d')][_0xc4df('0x154')](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170')});db[_0xc4df('0x5d')]['belongsTo'](db[_0xc4df('0x83')],{'as':'Interval','foreignKey':_0xc4df('0x158')});db['ChatWebsite'][_0xc4df('0x154')](db[_0xc4df('0x3d')],{'as':_0xc4df('0x3d'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0xc4df('0x154')](db[_0xc4df('0x85')],{'as':_0xc4df('0x159'),'foreignKey':_0xc4df('0x15a')});db[_0xc4df('0x5d')]['belongsToMany'](db['User'],{'as':_0xc4df('0x15d'),'through':'user_has_chat_websites'});db[_0xc4df('0x5f')]['belongsTo'](db[_0xc4df('0x54')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170')});db[_0xc4df('0x5f')][_0xc4df('0x154')](db['CmContact'],{'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167')});db[_0xc4df('0x5f')][_0xc4df('0x154')](db[_0xc4df('0x57')],{});db[_0xc4df('0x5f')]['belongsTo'](db[_0xc4df('0x59')],{});db[_0xc4df('0x5f')]['belongsTo'](db[_0xc4df('0x13')],{});db[_0xc4df('0x5f')][_0xc4df('0x154')](db['OpenchannelQueue'],{});db[_0xc4df('0x196')][_0xc4df('0x154')](db['User'],{'as':_0xc4df('0x197'),'foreignKey':'UserId','onDelete':_0xc4df('0x17e')});db['ChatApplication'][_0xc4df('0x154')](db[_0xc4df('0x67')],{'as':_0xc4df('0x198'),'foreignKey':_0xc4df('0x199'),'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x196')]['belongsTo'](db['ChatWebsite'],{'as':_0xc4df('0x19a'),'foreignKey':'ChatWebsiteId','onDelete':_0xc4df('0x17e')});db[_0xc4df('0x196')][_0xc4df('0x154')](db[_0xc4df('0x177')],{'onDelete':_0xc4df('0x17e'),'foreignKey':_0xc4df('0x17f')});db[_0xc4df('0x129')]['hasMany'](db[_0xc4df('0x63')],{'as':_0xc4df('0x16d'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x19b')});db[_0xc4df('0x129')][_0xc4df('0x154')](db[_0xc4df('0x5d')],{'as':'Account','foreignKey':_0xc4df('0x17c')});db['ChatInteraction'][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':'Contact','foreignKey':_0xc4df('0x167')});db[_0xc4df('0x129')][_0xc4df('0x154')](db['User'],{'as':_0xc4df('0x176'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x129')][_0xc4df('0x123')](db['Tag'],{'through':_0xc4df('0x19c'),'as':_0xc4df('0x179')});db[_0xc4df('0x129')][_0xc4df('0x123')](db[_0xc4df('0x177')],{'through':_0xc4df('0x19c'),'as':_0xc4df('0x18d')});db[_0xc4df('0x129')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x18e'),'through':_0xc4df('0x12a'),'foreignKey':_0xc4df('0x19b')});db[_0xc4df('0x63')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'onDelete':_0xc4df('0x10f'),'as':_0xc4df('0x13')});db[_0xc4df('0x63')][_0xc4df('0x154')](db['CmContact'],{'onDelete':_0xc4df('0x10f'),'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167')});db[_0xc4df('0x63')][_0xc4df('0x154')](db[_0xc4df('0x129')],{'onDelete':_0xc4df('0x10f'),'as':_0xc4df('0x17b'),'foreignKey':_0xc4df('0x19b')});db['ChatMessage']['belongsTo'](db[_0xc4df('0xec')],{'as':_0xc4df('0xec'),'foreignKey':'AttachmentId'});db['ChatMessage']['belongsTo'](db[_0xc4df('0x5d')],{'as':'Account','foreignKey':_0xc4df('0x17c')});db[_0xc4df('0x65')]['hasMany'](db[_0xc4df('0xec')],{'as':_0xc4df('0x19d'),'foreignKey':_0xc4df('0x17d'),'onDelete':'cascade','hooks':!![]});db[_0xc4df('0x65')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'onDelete':_0xc4df('0x10f'),'as':'Contact','foreignKey':_0xc4df('0x167')});db[_0xc4df('0x65')][_0xc4df('0x154')](db['ChatWebsite'],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x17c')});db[_0xc4df('0x67')]['belongsToMany'](db[_0xc4df('0x13')],{'as':'Agents','through':_0xc4df('0x135'),'hooks':!![]});db[_0xc4df('0x67')][_0xc4df('0x123')](db[_0xc4df('0xe6')],{'through':'team_has_chat_queues','as':_0xc4df('0x173')});db['ChatGroup']['hasMany'](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0xc4df('0x19e'),'onDelete':'cascade'});db[_0xc4df('0x68')]['belongsToMany'](db[_0xc4df('0x13')],{'as':_0xc4df('0x14e'),'through':_0xc4df('0x19f')});db['ChatProactiveAction'][_0xc4df('0x154')](db[_0xc4df('0x5d')],{'as':_0xc4df('0x19a'),'foreignKey':_0xc4df('0x17c')});db[_0xc4df('0x6c')][_0xc4df('0x112')](db[_0xc4df('0x6e')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xc4df('0x6e')]['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0xc4df('0x1a0')});db[_0xc4df('0x6e')][_0xc4df('0x112')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xc4df('0x167')});db['CmContact']['hasMany'](db[_0xc4df('0x72')],{'as':_0xc4df('0x116'),'foreignKey':'ContactId'});db[_0xc4df('0x6e')][_0xc4df('0x112')](db[_0xc4df('0x74')],{'as':_0xc4df('0x1a1'),'foreignKey':_0xc4df('0x167')});db[_0xc4df('0x6e')][_0xc4df('0x112')](db[_0xc4df('0x76')],{'as':'ReportAgentPreview','foreignKey':_0xc4df('0x167')});db['CmContact'][_0xc4df('0x112')](db[_0xc4df('0x153')],{'as':'JscriptySessions','foreignKey':_0xc4df('0x167')});db[_0xc4df('0x6e')]['hasMany'](db[_0xc4df('0x57')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0xc4df('0x6e')][_0xc4df('0x112')](db[_0xc4df('0x129')],{'as':_0xc4df('0x119'),'foreignKey':_0xc4df('0x167'),'onDelete':_0xc4df('0x17e')});db['CmContact'][_0xc4df('0x112')](db['SmsInteraction'],{'as':_0xc4df('0x11a'),'foreignKey':_0xc4df('0x167'),'onDelete':'restrict'});db[_0xc4df('0x6e')][_0xc4df('0x112')](db[_0xc4df('0x11b')],{'as':'FaxInteractions','foreignKey':_0xc4df('0x167'),'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x6e')]['hasMany'](db[_0xc4df('0x11c')],{'as':_0xc4df('0x11d'),'foreignKey':_0xc4df('0x167'),'onDelete':'restrict'});db[_0xc4df('0x6e')]['belongsTo'](db[_0xc4df('0x6c')],{'as':_0xc4df('0x1a2'),'foreignKey':_0xc4df('0x1a3')});db['CmContact'][_0xc4df('0x154')](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x6e')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x18e'),'through':'cm_user_has_contacts'});db[_0xc4df('0x6e')][_0xc4df('0x123')](db[_0xc4df('0x177')],{'as':_0xc4df('0x179'),'through':_0xc4df('0x1a4')});db['CmContact'][_0xc4df('0x123')](db['Tag'],{'through':_0xc4df('0x1a4'),'as':_0xc4df('0x18d')});db[_0xc4df('0x150')]['hasMany'](db[_0xc4df('0x1a5')],{'as':'AdditionalPhones','foreignKey':_0xc4df('0x1a6')});db['CmHopper'][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167'),'onDelete':'cascade'});db[_0xc4df('0x150')][_0xc4df('0x154')](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170'),'onDelete':_0xc4df('0x10f')});db['CmHopper']['belongsTo'](db[_0xc4df('0x13')],{'as':_0xc4df('0x197'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x150')][_0xc4df('0x154')](db[_0xc4df('0x1d')],{'as':_0xc4df('0x198'),'foreignKey':_0xc4df('0x14f'),'onDelete':'cascade'});db[_0xc4df('0x150')]['belongsTo'](db[_0xc4df('0x1a7')],{'as':_0xc4df('0x1a7'),'foreignKey':_0xc4df('0x1a8'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x150')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'as':_0xc4df('0x176'),'foreignKey':'OwnerId'});db[_0xc4df('0x70')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167'),'onDelete':_0xc4df('0x10f')});db['CmHopperBlack'][_0xc4df('0x154')](db['CmList'],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x70')][_0xc4df('0x154')](db['VoiceQueue'],{'as':_0xc4df('0x198'),'foreignKey':_0xc4df('0x14f'),'onDelete':'cascade'});db[_0xc4df('0x70')][_0xc4df('0x154')](db[_0xc4df('0x1a7')],{'as':'Campaign','foreignKey':_0xc4df('0x1a8'),'onDelete':'cascade'});db[_0xc4df('0x7c')][_0xc4df('0x112')](db[_0xc4df('0x82')],{'as':{'plural':_0xc4df('0x1a9'),'singular':'OneAll'},'foreignKey':_0xc4df('0x1aa'),'onDelete':'cascade','hooks':!![]});db[_0xc4df('0x7c')][_0xc4df('0x112')](db['Condition'],{'as':{'plural':_0xc4df('0x1ab'),'singular':_0xc4df('0x1ac')},'foreignKey':_0xc4df('0x1ad'),'onDelete':_0xc4df('0x10f'),'hooks':!![]});db[_0xc4df('0x7c')][_0xc4df('0x112')](db[_0xc4df('0x7a')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0xc4df('0x10f'),'hooks':!![]});db[_0xc4df('0x80')]['hasMany'](db[_0xc4df('0x80')],{'as':_0xc4df('0x16b'),'foreignKey':'ParentId','onDelete':_0xc4df('0x10f')});db[_0xc4df('0x83')]['hasMany'](db[_0xc4df('0x83')],{'as':_0xc4df('0x1ae'),'foreignKey':_0xc4df('0x158'),'onDelete':_0xc4df('0x10f'),'hooks':!![],'required':![]});db[_0xc4df('0x83')]['hasMany'](db[_0xc4df('0x19')],{'as':_0xc4df('0x115'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0xc4df('0x83')]['hasMany'](db[_0xc4df('0x16f')],{'as':_0xc4df('0x1af'),'foreignKey':_0xc4df('0x158')});db['Interval'][_0xc4df('0x112')](db[_0xc4df('0x196')],{'as':'ChatApplications','foreignKey':'IntervalId'});db['Interval'][_0xc4df('0x112')](db[_0xc4df('0x183')],{'as':_0xc4df('0x1b0'),'foreignKey':_0xc4df('0x158')});db[_0xc4df('0x83')][_0xc4df('0x112')](db['SmsApplication'],{'as':_0xc4df('0x1b1'),'foreignKey':_0xc4df('0x158')});db['Schedule'][_0xc4df('0x154')](db[_0xc4df('0x3d')],{});db['Schedule'][_0xc4df('0x154')](db['AnalyticDefaultReport'],{'foreignKey':_0xc4df('0x1b2')});db[_0xc4df('0x8b')][_0xc4df('0x154')](db['AnalyticCustomReport'],{'foreignKey':_0xc4df('0x1b3')});db['Sound'][_0xc4df('0x123')](db[_0xc4df('0x1b')],{'as':_0xc4df('0x1b4'),'through':_0xc4df('0x14d'),'onDelete':'restrict'});db[_0xc4df('0x177')]['belongsToMany'](db['CmContact'],{'through':_0xc4df('0x1a4')});db[_0xc4df('0x177')][_0xc4df('0x123')](db[_0xc4df('0x129')],{'through':'chat_interaction_has_tags'});db['Tag'][_0xc4df('0x123')](db[_0xc4df('0x11c')],{'through':_0xc4df('0x178')});db[_0xc4df('0x177')][_0xc4df('0x123')](db[_0xc4df('0x18b')],{'through':_0xc4df('0x18c')});db[_0xc4df('0x177')]['belongsToMany'](db[_0xc4df('0x11b')],{'through':_0xc4df('0x187')});db[_0xc4df('0x177')][_0xc4df('0x123')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0xc4df('0x177')][_0xc4df('0x123')](db[_0xc4df('0x102')],{'through':_0xc4df('0x1b5')});db[_0xc4df('0x90')]['belongsTo'](db[_0xc4df('0x8e')],{'as':_0xc4df('0x1b6'),'foreignKey':_0xc4df('0x1b7')});db['CmHopperAdditionalPhone'][_0xc4df('0x154')](db[_0xc4df('0x150')],{'as':_0xc4df('0x1b8'),'foreignKey':_0xc4df('0x1a6')});db[_0xc4df('0x94')]['hasMany'](db[_0xc4df('0x82')],{'as':{'plural':_0xc4df('0x1b9'),'singular':'AllCondition'},'foreignKey':_0xc4df('0x1ba'),'onDelete':_0xc4df('0x10f'),'hooks':!![]});db[_0xc4df('0x94')][_0xc4df('0x112')](db[_0xc4df('0x82')],{'as':{'plural':_0xc4df('0x1bb'),'singular':_0xc4df('0x1bc')},'foreignKey':_0xc4df('0x1bd'),'onDelete':_0xc4df('0x10f'),'hooks':!![]});db[_0xc4df('0x94')][_0xc4df('0x112')](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0xc4df('0x112')](db[_0xc4df('0xa1')],{'as':_0xc4df('0x1be'),'onDelete':_0xc4df('0x10f'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xc4df('0x9c')][_0xc4df('0x112')](db['AnalyticFieldReport'],{'as':_0xc4df('0x1be'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1b2')});db[_0xc4df('0x9f')][_0xc4df('0x112')](db[_0xc4df('0xa1')],{'as':_0xc4df('0x1be'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1bf')});db[_0xc4df('0xa1')][_0xc4df('0x154')](db['AnalyticMetric'],{'foreignKey':_0xc4df('0x1bf')});db[_0xc4df('0xa4')][_0xc4df('0x112')](db[_0xc4df('0xa5')],{'as':_0xc4df('0x1c0'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xa5')][_0xc4df('0x112')](db[_0xc4df('0xa7')],{'as':_0xc4df('0x1c2'),'onDelete':'cascade','foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xa5')][_0xc4df('0x112')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c4')});db[_0xc4df('0xa5')][_0xc4df('0x112')](db[_0xc4df('0xa7')],{'as':_0xc4df('0x1be'),'onDelete':_0xc4df('0x10f'),'foreignKey':'FieldId'});db[_0xc4df('0xa5')]['belongsTo'](db['SalesforceAccount'],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xa7')][_0xc4df('0x112')](db[_0xc4df('0xa7')],{'as':_0xc4df('0x1c5'),'foreignKey':_0xc4df('0x1c3')});db['SalesforceField']['hasMany'](db[_0xc4df('0xa7')],{'as':_0xc4df('0x1c6'),'foreignKey':'DescriptionId'});db[_0xc4df('0xa7')][_0xc4df('0x112')](db[_0xc4df('0xa7')],{'as':_0xc4df('0x1c7'),'foreignKey':'FieldId'});db[_0xc4df('0xa7')][_0xc4df('0x154')](db[_0xc4df('0x96')],{'as':_0xc4df('0x96'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0xc4df('0x112')](db[_0xc4df('0xab')],{'as':_0xc4df('0x1c0'),'onDelete':'cascade','foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xab')]['hasMany'](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xc4df('0x10f'),'foreignKey':'SubjectId'});db[_0xc4df('0xab')]['hasMany'](db[_0xc4df('0x1c8')],{'as':_0xc4df('0x1c9'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c4')});db[_0xc4df('0xab')][_0xc4df('0x112')](db[_0xc4df('0x1c8')],{'as':_0xc4df('0x1be'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0xab')][_0xc4df('0x154')](db[_0xc4df('0xa9')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0x1c8')]['hasMany'](db[_0xc4df('0x1c8')],{'as':_0xc4df('0x1c5'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0xc4df('0x112')](db[_0xc4df('0x1c8')],{'as':_0xc4df('0x1c6'),'foreignKey':_0xc4df('0x1c4')});db[_0xc4df('0x1c8')][_0xc4df('0x112')](db[_0xc4df('0x1c8')],{'as':_0xc4df('0x1c7'),'foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0x1c8')][_0xc4df('0x154')](db[_0xc4df('0x96')],{'as':_0xc4df('0x96'),'foreignKey':_0xc4df('0x1cb')});db[_0xc4df('0xae')][_0xc4df('0x112')](db['DeskConfiguration'],{'as':_0xc4df('0x1c0'),'onDelete':_0xc4df('0x10f'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xc4df('0x112')](db[_0xc4df('0xb1')],{'as':_0xc4df('0x1c2'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xaf')][_0xc4df('0x112')](db[_0xc4df('0xb1')],{'as':'Descriptions','onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c4')});db['DeskConfiguration']['hasMany'](db[_0xc4df('0xb1')],{'as':_0xc4df('0x1be'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0xaf')][_0xc4df('0x154')](db['DeskAccount'],{'as':_0xc4df('0x175'),'foreignKey':'AccountId'});db[_0xc4df('0xaf')]['belongsToMany'](db[_0xc4df('0x177')],{'through':_0xc4df('0x1cc')});db[_0xc4df('0xb1')]['hasMany'](db[_0xc4df('0xb1')],{'as':_0xc4df('0x1c5'),'foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xb1')][_0xc4df('0x112')](db[_0xc4df('0xb1')],{'as':_0xc4df('0x1c6'),'foreignKey':_0xc4df('0x1c4')});db[_0xc4df('0xb1')][_0xc4df('0x112')](db[_0xc4df('0xb1')],{'as':'Field','foreignKey':_0xc4df('0x1ca')});db['DeskField']['belongsTo'](db[_0xc4df('0x96')],{'as':_0xc4df('0x96'),'foreignKey':'VariableId'});db['ZohoAccount']['hasMany'](db[_0xc4df('0xb4')],{'as':'Configurations','onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xb4')][_0xc4df('0x112')](db[_0xc4df('0xb6')],{'as':'Subjects','onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c3')});db['ZohoConfiguration'][_0xc4df('0x112')](db[_0xc4df('0xb6')],{'as':_0xc4df('0x1c9'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c4')});db[_0xc4df('0xb4')][_0xc4df('0x112')](db[_0xc4df('0xb6')],{'as':_0xc4df('0x1be'),'onDelete':_0xc4df('0x10f'),'foreignKey':'FieldId'});db[_0xc4df('0xb4')][_0xc4df('0x154')](db[_0xc4df('0xb2')],{'as':'Account','foreignKey':_0xc4df('0x1c1')});db['ZohoField'][_0xc4df('0x112')](db[_0xc4df('0xb6')],{'as':'Subject','foreignKey':_0xc4df('0x1c3')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xc4df('0x1c6'),'foreignKey':_0xc4df('0x1c4')});db['ZohoField'][_0xc4df('0x112')](db[_0xc4df('0xb6')],{'as':_0xc4df('0x1c7'),'foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0xb6')][_0xc4df('0x154')](db[_0xc4df('0x96')],{'as':_0xc4df('0x96'),'foreignKey':_0xc4df('0x1cb')});db[_0xc4df('0xb8')][_0xc4df('0x112')](db[_0xc4df('0xba')],{'as':_0xc4df('0x1c0'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xba')][_0xc4df('0x112')](db[_0xc4df('0xbc')],{'as':_0xc4df('0x1c2'),'foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xba')]['hasMany'](db[_0xc4df('0xbc')],{'as':_0xc4df('0x1c9'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0xc4df('0x112')](db[_0xc4df('0xbc')],{'as':_0xc4df('0x1be'),'foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0xba')][_0xc4df('0x154')](db[_0xc4df('0xb8')],{'as':_0xc4df('0x175'),'foreignKey':'AccountId'});db[_0xc4df('0xba')][_0xc4df('0x123')](db['Tag'],{'through':_0xc4df('0x1cd')});db['ZendeskField'][_0xc4df('0x112')](db[_0xc4df('0xbc')],{'as':_0xc4df('0x1c5'),'foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xbc')][_0xc4df('0x112')](db['ZendeskField'],{'as':_0xc4df('0x1c6'),'foreignKey':'DescriptionId'});db[_0xc4df('0xbc')]['hasMany'](db[_0xc4df('0xbc')],{'as':'Field','foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0xbc')][_0xc4df('0x154')](db[_0xc4df('0x96')],{'as':_0xc4df('0x96'),'foreignKey':_0xc4df('0x1cb')});db[_0xc4df('0xbe')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0xc4df('0x1c0'),'onDelete':'cascade','foreignKey':_0xc4df('0x1c1')});db['FreshdeskConfiguration'][_0xc4df('0x112')](db[_0xc4df('0xc1')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xbf')]['hasMany'](db['FreshdeskField'],{'as':_0xc4df('0x1c9'),'onDelete':_0xc4df('0x10f'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0xc4df('0x10f'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0xc4df('0x154')](db[_0xc4df('0xbe')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xbf')][_0xc4df('0x123')](db[_0xc4df('0x177')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0xc4df('0x1c5'),'foreignKey':'SubjectId'});db[_0xc4df('0xc1')]['hasMany'](db[_0xc4df('0xc1')],{'as':'Description','foreignKey':_0xc4df('0x1c4')});db[_0xc4df('0xc1')][_0xc4df('0x112')](db[_0xc4df('0xc1')],{'as':_0xc4df('0x1c7'),'foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0xc1')][_0xc4df('0x154')](db[_0xc4df('0x96')],{'as':'Variable','foreignKey':_0xc4df('0x1cb')});db[_0xc4df('0xc3')][_0xc4df('0x112')](db[_0xc4df('0xc4')],{'as':_0xc4df('0x1c0'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xc4')]['hasMany'](db[_0xc4df('0xc6')],{'as':_0xc4df('0x1c2'),'foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xc4')][_0xc4df('0x112')](db[_0xc4df('0xc6')],{'as':_0xc4df('0x1c9'),'foreignKey':_0xc4df('0x1c4')});db['VtigerConfiguration'][_0xc4df('0x112')](db[_0xc4df('0xc6')],{'as':'Fields','foreignKey':'FieldId'});db[_0xc4df('0xc4')]['belongsTo'](db[_0xc4df('0xc3')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xc6')][_0xc4df('0x112')](db['VtigerField'],{'as':_0xc4df('0x1c5'),'foreignKey':_0xc4df('0x1c3')});db['VtigerField'][_0xc4df('0x112')](db[_0xc4df('0xc6')],{'as':_0xc4df('0x1c6'),'foreignKey':_0xc4df('0x1c4')});db['VtigerField']['hasMany'](db[_0xc4df('0xc6')],{'as':'Field','foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0xc6')][_0xc4df('0x154')](db[_0xc4df('0x96')],{'as':_0xc4df('0x96'),'foreignKey':_0xc4df('0x1cb')});db[_0xc4df('0xc8')][_0xc4df('0x112')](db[_0xc4df('0xc9')],{'as':_0xc4df('0x1c0'),'onDelete':_0xc4df('0x10f'),'foreignKey':'AccountId'});db[_0xc4df('0xc9')][_0xc4df('0x112')](db[_0xc4df('0x1ce')],{'as':_0xc4df('0x1c2'),'foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xc9')][_0xc4df('0x112')](db[_0xc4df('0x1ce')],{'as':_0xc4df('0x1c9'),'foreignKey':_0xc4df('0x1c4')});db[_0xc4df('0xc9')]['hasMany'](db[_0xc4df('0x1ce')],{'as':'Fields','foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0xc9')][_0xc4df('0x154')](db[_0xc4df('0xc8')],{'as':'Account','foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0x1ce')]['hasMany'](db[_0xc4df('0x1ce')],{'as':'Subject','foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0x1ce')][_0xc4df('0x112')](db[_0xc4df('0x1ce')],{'as':_0xc4df('0x1c6'),'foreignKey':_0xc4df('0x1c4')});db[_0xc4df('0x1ce')]['hasMany'](db[_0xc4df('0x1ce')],{'as':_0xc4df('0x1c7'),'foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0x1ce')][_0xc4df('0x154')](db[_0xc4df('0x96')],{'as':_0xc4df('0x96'),'foreignKey':_0xc4df('0x1cb')});db['Dynamics365Account']['hasMany'](db[_0xc4df('0x1cf')],{'as':_0xc4df('0x1c0'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c1')});db['Dynamics365Configuration'][_0xc4df('0x112')](db[_0xc4df('0xcb')],{'as':_0xc4df('0x1c2'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0x1cf')]['hasMany'](db[_0xc4df('0xcb')],{'as':_0xc4df('0x1c9'),'onDelete':_0xc4df('0x10f'),'foreignKey':'DescriptionId'});db[_0xc4df('0x1cf')][_0xc4df('0x112')](db[_0xc4df('0xcb')],{'as':_0xc4df('0x1be'),'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0x1cf')][_0xc4df('0x154')](db[_0xc4df('0x1d0')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xcb')]['hasMany'](db['Dynamics365Field'],{'as':_0xc4df('0x1c5'),'foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xcb')]['hasMany'](db[_0xc4df('0xcb')],{'as':_0xc4df('0x1c6'),'foreignKey':_0xc4df('0x1c4')});db['Dynamics365Field'][_0xc4df('0x112')](db[_0xc4df('0xcb')],{'as':_0xc4df('0x1c7'),'foreignKey':_0xc4df('0x1ca')});db[_0xc4df('0xcb')][_0xc4df('0x154')](db[_0xc4df('0x96')],{'as':_0xc4df('0x96'),'foreignKey':_0xc4df('0x1cb')});db[_0xc4df('0xcd')][_0xc4df('0x112')](db[_0xc4df('0x1d1')],{'as':'Configurations','onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0x1d1')][_0xc4df('0x112')](db[_0xc4df('0xcf')],{'as':_0xc4df('0x1c2'),'foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0x1d1')][_0xc4df('0x112')](db[_0xc4df('0xcf')],{'as':_0xc4df('0x1c9'),'foreignKey':'DescriptionId'});db[_0xc4df('0x1d1')]['hasMany'](db[_0xc4df('0xcf')],{'as':_0xc4df('0x1be'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0xc4df('0x154')](db[_0xc4df('0xcd')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x1c1')});db[_0xc4df('0xcf')][_0xc4df('0x112')](db[_0xc4df('0xcf')],{'as':'Subject','foreignKey':_0xc4df('0x1c3')});db[_0xc4df('0xcf')]['hasMany'](db[_0xc4df('0xcf')],{'as':_0xc4df('0x1c6'),'foreignKey':_0xc4df('0x1c4')});db['FreshsalesField'][_0xc4df('0x112')](db[_0xc4df('0xcf')],{'as':_0xc4df('0x1c7'),'foreignKey':'FieldId'});db[_0xc4df('0xcf')]['belongsTo'](db[_0xc4df('0x96')],{'as':'Variable','foreignKey':_0xc4df('0x1cb')});db['ChatQueueReport'][_0xc4df('0x154')](db[_0xc4df('0x5d')],{});db[_0xc4df('0xd3')]['belongsTo'](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170')});db['ChatQueueReport'][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':_0xc4df('0x17a'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0xc4df('0x154')](db[_0xc4df('0x129')],{});db[_0xc4df('0xd3')][_0xc4df('0x154')](db[_0xc4df('0x63')],{});db[_0xc4df('0xd3')]['belongsTo'](db['User'],{});db[_0xc4df('0xd3')]['belongsTo'](db[_0xc4df('0x67')],{});db['ChatInternalMessage'][_0xc4df('0x154')](db[_0xc4df('0x13')],{'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1d2')});db['ChatInternalMessage'][_0xc4df('0x154')](db[_0xc4df('0x13')],{'onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x1d3')});db[_0xc4df('0x153')]['hasMany'](db[_0xc4df('0xd8')],{'foreignKey':_0xc4df('0x1d4'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x153')][_0xc4df('0x112')](db[_0xc4df('0xd6')],{'foreignKey':'SessionId','onDelete':_0xc4df('0x10f')});db[_0xc4df('0xdb')]['belongsTo'](db[_0xc4df('0x145')],{});db['SmsQueueReport']['belongsTo'](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':'ListId'});db[_0xc4df('0xdb')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':'Contact','foreignKey':_0xc4df('0x167')});db['SmsQueueReport'][_0xc4df('0x154')](db[_0xc4df('0x18b')],{});db[_0xc4df('0xdb')][_0xc4df('0x154')](db['SmsMessage'],{});db[_0xc4df('0xdb')]['belongsTo'](db['User'],{});db[_0xc4df('0xdb')][_0xc4df('0x154')](db['SmsQueue'],{});db[_0xc4df('0x1d5')]['hasMany'](db[_0xc4df('0x153')],{'foreignKey':_0xc4df('0x1d6')});db[_0xc4df('0x1d5')][_0xc4df('0x112')](db[_0xc4df('0xd8')],{'foreignKey':_0xc4df('0x1d6')});db['JscriptyProject'][_0xc4df('0x112')](db[_0xc4df('0xd6')],{'foreignKey':_0xc4df('0x1d6')});db[_0xc4df('0x1d7')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':'Users','through':_0xc4df('0x1d8')});db['Team'][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x15d'),'through':'user_has_teams'});db[_0xc4df('0xe6')][_0xc4df('0x123')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0xc4df('0x130')});db[_0xc4df('0xe6')][_0xc4df('0x123')](db[_0xc4df('0x131')],{'through':_0xc4df('0x172'),'as':'MailQueues'});db[_0xc4df('0xe6')][_0xc4df('0x123')](db[_0xc4df('0x67')],{'through':_0xc4df('0x1d9'),'as':_0xc4df('0x134')});db[_0xc4df('0xe6')][_0xc4df('0x123')](db[_0xc4df('0x4c')],{'through':_0xc4df('0x1da'),'as':_0xc4df('0x136')});db[_0xc4df('0xe6')]['belongsToMany'](db[_0xc4df('0x53')],{'through':'team_has_sms_queues','as':_0xc4df('0x137')});db[_0xc4df('0xe6')][_0xc4df('0x123')](db[_0xc4df('0x5b')],{'through':_0xc4df('0x194'),'as':_0xc4df('0x138')});db[_0xc4df('0xe6')]['belongsToMany'](db[_0xc4df('0x108')],{'through':'team_has_whatsapp_queues','as':_0xc4df('0x139')});db['Campaign'][_0xc4df('0x112')](db[_0xc4df('0x150')],{'as':_0xc4df('0x151'),'foreignKey':_0xc4df('0x1a8')});db[_0xc4df('0x1a7')]['hasMany'](db[_0xc4df('0x72')],{'as':_0xc4df('0x116'),'foreignKey':'CampaignId'});db[_0xc4df('0x1a7')]['hasMany'](db[_0xc4df('0x74')],{'as':_0xc4df('0x1a1'),'foreignKey':_0xc4df('0x1a8')});db[_0xc4df('0x1a7')]['hasMany'](db[_0xc4df('0x70')],{'as':_0xc4df('0x152'),'foreignKey':_0xc4df('0x1a8')});db[_0xc4df('0x1a7')][_0xc4df('0x154')](db['Trunk'],{'as':_0xc4df('0x2b'),'foreignKey':_0xc4df('0x155')});db['Campaign'][_0xc4df('0x154')](db[_0xc4df('0x2b')],{'as':_0xc4df('0x156'),'foreignKey':'TrunkBackupId'});db[_0xc4df('0x1a7')]['belongsTo'](db[_0xc4df('0x83')],{'as':_0xc4df('0x83'),'foreignKey':_0xc4df('0x158')});db['Campaign']['belongsTo'](db[_0xc4df('0x1d7')],{'as':_0xc4df('0x1d7'),'foreignKey':'SquareProjectId'});db[_0xc4df('0x1a7')][_0xc4df('0x123')](db['CmList'],{'as':'Lists','through':'campaigns_has_cm_lists'});db['Campaign']['belongsToMany'](db[_0xc4df('0x126')],{'as':_0xc4df('0x15e'),'through':'campaigns_has_cm_blacklists'});db[_0xc4df('0xec')][_0xc4df('0x154')](db[_0xc4df('0x65')],{'as':_0xc4df('0x65'),'foreignKey':_0xc4df('0x17d')});db[_0xc4df('0xef')][_0xc4df('0x154')](db[_0xc4df('0x41')],{});db['MailTransferReport'][_0xc4df('0x154')](db[_0xc4df('0x11c')],{});db[_0xc4df('0xef')][_0xc4df('0x154')](db[_0xc4df('0x3d')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0xc4df('0xef')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'foreignKey':'FromUserId','as':_0xc4df('0x1db')});db[_0xc4df('0xef')]['belongsTo'](db[_0xc4df('0x13')],{'foreignKey':_0xc4df('0x1dc'),'as':_0xc4df('0x1dd')});db['MailTransferReport']['belongsTo'](db[_0xc4df('0x131')],{'foreignKey':_0xc4df('0x1de'),'as':_0xc4df('0x1df')});db['MailTransferReport'][_0xc4df('0x154')](db[_0xc4df('0x3d')],{'foreignKey':_0xc4df('0x1e0'),'as':_0xc4df('0x1e1')});db['ChatTransferReport'][_0xc4df('0x154')](db['ChatMessage'],{});db[_0xc4df('0x1e2')]['belongsTo'](db[_0xc4df('0x129')],{});db[_0xc4df('0x1e2')]['belongsTo'](db[_0xc4df('0x5d')],{'foreignKey':_0xc4df('0x1e3'),'as':_0xc4df('0x1e4')});db['ChatTransferReport'][_0xc4df('0x154')](db[_0xc4df('0x13')],{'foreignKey':_0xc4df('0x1e5'),'as':_0xc4df('0x1db')});db[_0xc4df('0x1e2')]['belongsTo'](db[_0xc4df('0x13')],{'foreignKey':'ToUserId','as':_0xc4df('0x1dd')});db[_0xc4df('0x1e2')]['belongsTo'](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0xc4df('0x1df')});db[_0xc4df('0x1e2')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xc4df('0x1e6'),'as':_0xc4df('0x1e1')});db[_0xc4df('0xf2')][_0xc4df('0x154')](db[_0xc4df('0x185')],{});db['FaxTransferReport'][_0xc4df('0x154')](db[_0xc4df('0x11b')],{});db[_0xc4df('0xf2')][_0xc4df('0x154')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0xc4df('0xf2')][_0xc4df('0x154')](db['User'],{'foreignKey':_0xc4df('0x1e5'),'as':_0xc4df('0x1db')});db[_0xc4df('0xf2')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'foreignKey':_0xc4df('0x1dc'),'as':_0xc4df('0x1dd')});db[_0xc4df('0xf2')][_0xc4df('0x154')](db[_0xc4df('0x4c')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0xc4df('0xf2')][_0xc4df('0x154')](db[_0xc4df('0x47')],{'foreignKey':_0xc4df('0x1e7'),'as':_0xc4df('0x1e1')});db['OpenchannelTransferReport'][_0xc4df('0x154')](db[_0xc4df('0x59')],{});db[_0xc4df('0xf3')]['belongsTo'](db[_0xc4df('0x57')],{});db['OpenchannelTransferReport'][_0xc4df('0x154')](db[_0xc4df('0x54')],{'foreignKey':_0xc4df('0x1e8'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0xc4df('0x154')](db[_0xc4df('0x13')],{'foreignKey':_0xc4df('0x1e5'),'as':_0xc4df('0x1db')});db[_0xc4df('0xf3')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xc4df('0xf3')][_0xc4df('0x154')](db[_0xc4df('0x5b')],{'foreignKey':_0xc4df('0x1e9'),'as':_0xc4df('0x1df')});db[_0xc4df('0xf3')]['belongsTo'](db[_0xc4df('0x54')],{'foreignKey':_0xc4df('0x1ea'),'as':_0xc4df('0x1e1')});db[_0xc4df('0x1eb')][_0xc4df('0x154')](db[_0xc4df('0x18a')],{});db[_0xc4df('0x1eb')][_0xc4df('0x154')](db[_0xc4df('0x18b')],{});db[_0xc4df('0x1eb')][_0xc4df('0x154')](db[_0xc4df('0x145')],{'foreignKey':'FromSmsAccountId','as':_0xc4df('0x1e4')});db[_0xc4df('0x1eb')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'foreignKey':_0xc4df('0x1e5'),'as':_0xc4df('0x1db')});db['SmsTransferReport']['belongsTo'](db[_0xc4df('0x13')],{'foreignKey':_0xc4df('0x1dc'),'as':_0xc4df('0x1dd')});db[_0xc4df('0x1eb')][_0xc4df('0x154')](db[_0xc4df('0x53')],{'foreignKey':'ToSmsQueueId','as':_0xc4df('0x1df')});db[_0xc4df('0x1eb')][_0xc4df('0x154')](db[_0xc4df('0x145')],{'foreignKey':_0xc4df('0x1ec'),'as':'ToAccount'});db[_0xc4df('0x126')][_0xc4df('0x112')](db[_0xc4df('0x80')],{'as':_0xc4df('0x16b'),'foreignKey':_0xc4df('0x170'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0x126')][_0xc4df('0x112')](db[_0xc4df('0x78')],{'as':_0xc4df('0x1ed'),'foreignKey':_0xc4df('0x170')});db[_0xc4df('0x126')]['hasMany'](db[_0xc4df('0x6e')],{'as':'Contacts','onDelete':_0xc4df('0x10f'),'foreignKey':_0xc4df('0x170')});db[_0xc4df('0x126')][_0xc4df('0x112')](db[_0xc4df('0x72')],{'as':_0xc4df('0x116'),'foreignKey':_0xc4df('0x170')});db[_0xc4df('0x126')][_0xc4df('0x112')](db[_0xc4df('0x74')],{'as':_0xc4df('0x117'),'foreignKey':_0xc4df('0x170')});db['CmList'][_0xc4df('0x112')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xc4df('0x126')][_0xc4df('0x123')](db['VoiceQueue'],{'as':'Queues','through':_0xc4df('0x15c')});db[_0xc4df('0x126')][_0xc4df('0x123')](db['User'],{'as':_0xc4df('0x15d'),'through':_0xc4df('0x13a')});db[_0xc4df('0xf6')][_0xc4df('0x112')](db[_0xc4df('0x19')],{'as':_0xc4df('0x115'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0xf6')][_0xc4df('0x123')](db['User'],{'as':'Agents','through':_0xc4df('0x13c')});db['UserProfile']['hasMany'](db[_0xc4df('0x13')],{'as':_0xc4df('0x18e'),'foreignKey':_0xc4df('0x121')});db[_0xc4df('0xf8')][_0xc4df('0x112')](db[_0xc4df('0xfa')],{'as':'UserProfileSections','foreignKey':_0xc4df('0x121'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0xfa')]['hasMany'](db[_0xc4df('0xfc')],{'as':_0xc4df('0x1ee'),'foreignKey':_0xc4df('0x1ef'),'onDelete':_0xc4df('0x10f')});db[_0xc4df('0xfe')][_0xc4df('0x112')](db[_0xc4df('0x80')],{'as':'Dispositions','foreignKey':_0xc4df('0x1f0'),'onDelete':_0xc4df('0x10f')});db['WhatsappAccount'][_0xc4df('0x112')](db[_0xc4df('0x7e')],{'as':_0xc4df('0x16c'),'foreignKey':_0xc4df('0x1f0')});db[_0xc4df('0xfe')][_0xc4df('0x112')](db[_0xc4df('0x104')],{'as':_0xc4df('0x16d'),'foreignKey':_0xc4df('0x1f0')});db['WhatsappAccount'][_0xc4df('0x112')](db[_0xc4df('0x102')],{'as':_0xc4df('0x16e')});db[_0xc4df('0xfe')][_0xc4df('0x112')](db[_0xc4df('0x100')],{'as':_0xc4df('0x14b')});db[_0xc4df('0xfe')][_0xc4df('0x154')](db['CmList'],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170')});db[_0xc4df('0xfe')][_0xc4df('0x154')](db[_0xc4df('0x85')],{'as':_0xc4df('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x15d'),'through':_0xc4df('0x149')});db[_0xc4df('0x100')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'onDelete':'restrict'});db[_0xc4df('0x100')][_0xc4df('0x154')](db[_0xc4df('0x108')],{'onDelete':'restrict'});db[_0xc4df('0x100')]['belongsTo'](db[_0xc4df('0xfe')],{'onDelete':_0xc4df('0x17e')});db[_0xc4df('0x100')][_0xc4df('0x154')](db[_0xc4df('0x83')],{'onDelete':'restrict','foreignKey':_0xc4df('0x158')});db['WhatsappApplication'][_0xc4df('0x154')](db[_0xc4df('0x177')],{'onDelete':'restrict','foreignKey':_0xc4df('0x17f')});db[_0xc4df('0x102')][_0xc4df('0x112')](db[_0xc4df('0x104')],{'as':_0xc4df('0x16d'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db[_0xc4df('0x102')][_0xc4df('0x154')](db[_0xc4df('0xfe')],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x1f0')});db[_0xc4df('0x102')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167')});db['WhatsappInteraction'][_0xc4df('0x154')](db[_0xc4df('0x13')],{'as':_0xc4df('0x176'),'foreignKey':_0xc4df('0x110')});db[_0xc4df('0x102')][_0xc4df('0x123')](db[_0xc4df('0x177')],{'through':_0xc4df('0x1b5'),'as':'Tags'});db['WhatsappInteraction']['belongsToMany'](db[_0xc4df('0x177')],{'through':_0xc4df('0x1b5'),'as':'ThroughTags'});db[_0xc4df('0x102')][_0xc4df('0x123')](db['User'],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xc4df('0x154')](db[_0xc4df('0x13')],{'as':_0xc4df('0x13')});db[_0xc4df('0x104')][_0xc4df('0x154')](db[_0xc4df('0x6e')],{'onDelete':_0xc4df('0x10f'),'as':_0xc4df('0x17a')});db[_0xc4df('0x104')]['belongsTo'](db[_0xc4df('0x102')],{'onDelete':_0xc4df('0x10f'),'as':_0xc4df('0x17b'),'foreignKey':_0xc4df('0x1f1')});db[_0xc4df('0x104')][_0xc4df('0x154')](db['WhatsappAccount'],{'as':_0xc4df('0x175'),'foreignKey':_0xc4df('0x1f0')});db[_0xc4df('0x106')][_0xc4df('0x154')](db[_0xc4df('0xfe')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xc4df('0x126')],{'as':_0xc4df('0x180'),'foreignKey':_0xc4df('0x170')});db[_0xc4df('0x106')]['belongsTo'](db[_0xc4df('0x6e')],{'as':_0xc4df('0x17a'),'foreignKey':_0xc4df('0x167')});db[_0xc4df('0x106')][_0xc4df('0x154')](db[_0xc4df('0x102')],{});db[_0xc4df('0x106')][_0xc4df('0x154')](db[_0xc4df('0x108')],{});db[_0xc4df('0x106')][_0xc4df('0x154')](db[_0xc4df('0x104')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xc4df('0x13')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xc4df('0x104')],{});db['WhatsappTransferReport'][_0xc4df('0x154')](db[_0xc4df('0x102')],{});db['WhatsappTransferReport'][_0xc4df('0x154')](db[_0xc4df('0xfe')],{'foreignKey':_0xc4df('0x1f2'),'as':'FromAccount'});db[_0xc4df('0x1f3')][_0xc4df('0x154')](db[_0xc4df('0xfe')],{'foreignKey':'ToWhatsappAccountId','as':_0xc4df('0x1e1')});db['WhatsappTransferReport']['belongsTo'](db[_0xc4df('0x108')],{'foreignKey':_0xc4df('0x1f4'),'as':_0xc4df('0x1df')});db[_0xc4df('0x1f3')]['belongsTo'](db[_0xc4df('0x13')],{'foreignKey':_0xc4df('0x1e5'),'as':_0xc4df('0x1db')});db[_0xc4df('0x1f3')][_0xc4df('0x154')](db[_0xc4df('0x13')],{'foreignKey':'ToUserId','as':_0xc4df('0x1dd')});db[_0xc4df('0x108')][_0xc4df('0x123')](db[_0xc4df('0x13')],{'as':_0xc4df('0x15d'),'through':_0xc4df('0x38'),'foreignKey':'WhatsappQueueId'});db['WhatsappQueue']['belongsToMany'](db[_0xc4df('0xe6')],{'through':_0xc4df('0x1f5'),'as':_0xc4df('0x173')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
index f93553f..8de237b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80bb=['./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','./api/squareOdbc','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/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/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','/www','static','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','apiKey','lastName','street','phone','mobile','fax','email','clientSecret','securityToken','code','accessKey','token','accessToken','accessTokenSecret','authToken','consumerKey','membername','calleridname','calleridnum','vidaooApiKey','clientEmail','privateKey','secretaccesskey','key','pass','accountSid','localstationid','dsn','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','path','express','express-winston','util','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','x-forwarded-for','connection','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','headers','remoteAddress','url','device','other','agent_id','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','./api/mailApplication','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/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/intDeskAccount','/api/integrations/desk/configurations','./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/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks'];(function(_0x389aa4,_0x10fb75){var _0x38ca4e=function(_0x402968){while(--_0x402968){_0x389aa4['push'](_0x389aa4['shift']());}};_0x38ca4e(++_0x10fb75);}(_0x80bb,0x7e));var _0xb80b=function(_0x55d0ab,_0x3d06c2){_0x55d0ab=_0x55d0ab-0x0;var _0x1f146c=_0x80bb[_0x55d0ab];return _0x1f146c;};'use strict';var _=require('lodash');var path=require(_0xb80b('0x0'));var express=require(_0xb80b('0x1'));var ewinston=require(_0xb80b('0x2'));var util=require(_0xb80b('0x3'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0xb80b('0x4'))(_0xb80b('0x5'));var authLogger=require(_0xb80b('0x4'))(_0xb80b('0x6'));exports[_0xb80b('0x7')]=function(_0x55f475){_0x55f475[_0xb80b('0x8')](ewinston[_0xb80b('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x35f081,_0x49c1a1){var _0x5650e2=_0xb80b('0xa');if(!_[_0xb80b('0xb')](_0x35f081[_0xb80b('0xc')])){_0x5650e2+='\x20body=%s';var _0x127f97=_0x35f081[_0xb80b('0xc')];maskSensitiveData(_0x127f97);}return util[_0xb80b('0xd')](_0x5650e2,_0x35f081[_0xb80b('0xe')],_0x35f081['headers'][_0xb80b('0xf')]?_0x35f081['headers']['x-forwarded-for']:_0x35f081[_0xb80b('0x10')]['remoteAddress']||_0x35f081['ip'],_0x35f081['url'],_0x49c1a1[_0xb80b('0x11')],_0x49c1a1[_0xb80b('0x12')],_0x35f081[_0xb80b('0x13')]?_0x35f081[_0xb80b('0x13')]['id']:null,_0x35f081[_0xb80b('0x13')]?_0x35f081['user'][_0xb80b('0x14')]:null,_0x35f081[_0xb80b('0x13')]?_0x35f081[_0xb80b('0x13')][_0xb80b('0x15')]:null,_0x127f97?util[_0xb80b('0x16')](_0x127f97,![],null):'');}}));_0x55f475[_0xb80b('0x8')](ewinston[_0xb80b('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x535c92,_0x59f285){var _0x3a67f0=_0xb80b('0x17');if(_0x535c92['body']&&_0x535c92[_0xb80b('0xc')]['device']&&_0x535c92[_0xb80b('0xc')]['agent_id']){_0x3a67f0='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xb80b('0xd')](_0x3a67f0,_0x535c92['method'],_0x535c92[_0xb80b('0x18')][_0xb80b('0xf')]?_0x535c92['headers'][_0xb80b('0xf')]:_0x535c92[_0xb80b('0x10')][_0xb80b('0x19')]||_0x535c92['ip'],_0x535c92[_0xb80b('0x1a')],_0x59f285['statusCode'],_0x59f285[_0xb80b('0x12')],_0x535c92[_0xb80b('0x13')]?_0x535c92['user']['id']:null,_0x535c92[_0xb80b('0x13')]?_0x535c92['user'][_0xb80b('0x14')]:null,_0x535c92[_0xb80b('0x13')]?_0x535c92['user'][_0xb80b('0x15')]:null,_0x535c92[_0xb80b('0xc')]&&_0x535c92['body'][_0xb80b('0x1b')]?_0x535c92[_0xb80b('0xc')]['device']:_0xb80b('0x1c'),_0x535c92[_0xb80b('0xc')]&&_0x535c92[_0xb80b('0xc')][_0xb80b('0x1d')]?_0x535c92['body'][_0xb80b('0x1d')]:'',_0x535c92['body']&&_0x535c92[_0xb80b('0xc')][_0xb80b('0x1e')]?_0x535c92[_0xb80b('0xc')][_0xb80b('0x1e')]:'');},'ignoreRoute':function(_0xfce381){var _0x317ed1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x317ed1[_0xb80b('0x1f')](_0xfce381[_0xb80b('0x1a')]);}}));_0x55f475['use'](_0xb80b('0x20'),require(_0xb80b('0x21')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x22'),require(_0xb80b('0x23')));_0x55f475['use']('/api/voice/contexts',require(_0xb80b('0x24')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x25'),require(_0xb80b('0x26')));_0x55f475['use'](_0xb80b('0x27'),require(_0xb80b('0x28')));_0x55f475['use'](_0xb80b('0x29'),require(_0xb80b('0x2a')));_0x55f475['use'](_0xb80b('0x2b'),require(_0xb80b('0x2c')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x2d'),require(_0xb80b('0x2e')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x2f'),require(_0xb80b('0x30')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x31'),require(_0xb80b('0x32')));_0x55f475['use'](_0xb80b('0x33'),require(_0xb80b('0x34')));_0x55f475['use']('/api/voice/dials/reports',require(_0xb80b('0x35')));_0x55f475['use']('/api/voice/agents/reports',require(_0xb80b('0x36')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x37'),require(_0xb80b('0x38')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x39'),require(_0xb80b('0x3a')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x3b'),require(_0xb80b('0x3c')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x3d'),require('./api/voiceTransferReport'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x3e'),require(_0xb80b('0x3f')));_0x55f475['use']('/api/mail/accounts',require(_0xb80b('0x40')));_0x55f475[_0xb80b('0x8')]('/api/mail/queues',require('./api/mailQueue'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x41'),require(_0xb80b('0x42')));_0x55f475['use'](_0xb80b('0x43'),require('./api/mailInteraction'));_0x55f475['use'](_0xb80b('0x44'),require(_0xb80b('0x45')));_0x55f475[_0xb80b('0x8')]('/api/mail/applications',require(_0xb80b('0x46')));_0x55f475['use']('/api/mail/reports/queue',require(_0xb80b('0x47')));_0x55f475['use'](_0xb80b('0x48'),require('./api/dashboard'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x49'),require(_0xb80b('0x4a')));_0x55f475[_0xb80b('0x8')]('/api/fax/accounts',require(_0xb80b('0x4b')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x4c'),require(_0xb80b('0x4d')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x4e'),require(_0xb80b('0x4f')));_0x55f475[_0xb80b('0x8')]('/api/fax/messages',require('./api/faxMessage'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x50'),require(_0xb80b('0x51')));_0x55f475[_0xb80b('0x8')]('/api/fax/reports/queue',require(_0xb80b('0x52')));_0x55f475['use'](_0xb80b('0x53'),require(_0xb80b('0x54')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x55'),require(_0xb80b('0x56')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x57'),require('./api/smsInteraction'));_0x55f475['use'](_0xb80b('0x58'),require(_0xb80b('0x59')));_0x55f475[_0xb80b('0x8')]('/api/sms/queues',require(_0xb80b('0x5a')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x5b'),require(_0xb80b('0x5c')));_0x55f475[_0xb80b('0x8')]('/api/openchannel/applications',require(_0xb80b('0x5d')));_0x55f475['use']('/api/openchannel/interactions',require(_0xb80b('0x5e')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x5f'),require(_0xb80b('0x60')));_0x55f475[_0xb80b('0x8')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x61'),require(_0xb80b('0x62')));_0x55f475[_0xb80b('0x8')]('/api/openchannel/reports/queue',require(_0xb80b('0x63')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x64'),require(_0xb80b('0x65')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x66'),require('./api/chatInteraction'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x67'),require(_0xb80b('0x68')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x69'),require('./api/chatOfflineMessage'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x6a'),require(_0xb80b('0x6b')));_0x55f475[_0xb80b('0x8')]('/api/chat/groups',require('./api/chatGroup'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x6c'),require(_0xb80b('0x6d')));_0x55f475[_0xb80b('0x8')]('/api/cm/companies',require(_0xb80b('0x6e')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x6f'),require('./api/cmContact'));_0x55f475[_0xb80b('0x8')]('/api/cm/hopper',require(_0xb80b('0x70')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x71'),require(_0xb80b('0x72')));_0x55f475[_0xb80b('0x8')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x73'),require(_0xb80b('0x74')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x75'),require(_0xb80b('0x76')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x77'),require(_0xb80b('0x78')));_0x55f475['use']('/api/automations',require(_0xb80b('0x79')));_0x55f475['use'](_0xb80b('0x7a'),require(_0xb80b('0x7b')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x7c'),require(_0xb80b('0x7d')));_0x55f475['use'](_0xb80b('0x7e'),require('./api/condition'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x7f'),require(_0xb80b('0x80')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x81'),require(_0xb80b('0x82')));_0x55f475['use']('/api/cdr',require(_0xb80b('0x83')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x84'),require(_0xb80b('0x85')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x86'),require(_0xb80b('0x87')));_0x55f475[_0xb80b('0x8')]('/api/sounds',require(_0xb80b('0x88')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x89'),require(_0xb80b('0x8a')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x8b'),require('./api/contactItemType'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x8c'),require(_0xb80b('0x8d')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x8e'),require(_0xb80b('0x8f')));_0x55f475[_0xb80b('0x8')]('/api/templates',require(_0xb80b('0x90')));_0x55f475['use'](_0xb80b('0x91'),require('./api/trigger'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x92'),require(_0xb80b('0x93')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x94'),require(_0xb80b('0x95')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x96'),require(_0xb80b('0x97')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x98'),require(_0xb80b('0x99')));_0x55f475[_0xb80b('0x8')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x9a'),require(_0xb80b('0x9b')));_0x55f475['use']('/api/analytics/metrics',require(_0xb80b('0x9c')));_0x55f475[_0xb80b('0x8')]('/api/analytics/field_reports',require(_0xb80b('0x9d')));_0x55f475['use']('/api/analytics/tree_reports',require(_0xb80b('0x9e')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x9f'),require('./api/intSalesforceAccount'));_0x55f475['use'](_0xb80b('0xa0'),require(_0xb80b('0xa1')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xa2'),require('./api/intSalesforceField'));_0x55f475[_0xb80b('0x8')](_0xb80b('0xa3'),require(_0xb80b('0xa4')));_0x55f475[_0xb80b('0x8')]('/api/integrations/sugarcrm/configurations',require(_0xb80b('0xa5')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xa6'),require(_0xb80b('0xa7')));_0x55f475[_0xb80b('0x8')]('/api/integrations/desk/accounts',require(_0xb80b('0xa8')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xa9'),require(_0xb80b('0xaa')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xab'),require(_0xb80b('0xac')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xad'),require(_0xb80b('0xae')));_0x55f475[_0xb80b('0x8')]('/api/integrations/zoho/configurations',require(_0xb80b('0xaf')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xb0'),require(_0xb80b('0xb1')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xb2'),require(_0xb80b('0xb3')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xb4'),require('./api/intZendeskConfiguration'));_0x55f475[_0xb80b('0x8')](_0xb80b('0xb5'),require('./api/intZendeskField'));_0x55f475[_0xb80b('0x8')]('/api/integrations/freshdesk/accounts',require(_0xb80b('0xb6')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xb7'),require(_0xb80b('0xb8')));_0x55f475[_0xb80b('0x8')]('/api/integrations/freshdesk/fields',require(_0xb80b('0xb9')));_0x55f475['use']('/api/integrations/vtiger/accounts',require(_0xb80b('0xba')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xbb'),require(_0xb80b('0xbc')));_0x55f475[_0xb80b('0x8')]('/api/integrations/vtiger/fields',require(_0xb80b('0xbd')));_0x55f475[_0xb80b('0x8')]('/api/integrations/servicenow/accounts',require(_0xb80b('0xbe')));_0x55f475[_0xb80b('0x8')]('/api/integrations/servicenow/configurations',require(_0xb80b('0xbf')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xc0'),require(_0xb80b('0xc1')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xc2'),require(_0xb80b('0xc3')));_0x55f475[_0xb80b('0x8')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x55f475[_0xb80b('0x8')]('/api/integrations/dynamics365/fields',require(_0xb80b('0xc4')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xc5'),require(_0xb80b('0xc6')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xc7'),require(_0xb80b('0xc8')));_0x55f475['use'](_0xb80b('0xc9'),require('./api/intFreshsalesField'));_0x55f475[_0xb80b('0x8')](_0xb80b('0xca'),require(_0xb80b('0xcb')));_0x55f475['use']('/api/chat/reports/queue',require(_0xb80b('0xcc')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xcd'),require(_0xb80b('0xce')));_0x55f475[_0xb80b('0x8')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x55f475[_0xb80b('0x8')]('/api/jscripty/questions/reports',require(_0xb80b('0xcf')));_0x55f475[_0xb80b('0x8')]('/api/jscripty/sessions/reports',require(_0xb80b('0xd0')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xd1'),require(_0xb80b('0xd2')));_0x55f475[_0xb80b('0x8')]('/api/square/reports',require(_0xb80b('0xd3')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xd4'),require(_0xb80b('0xd5')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xd6'),require(_0xb80b('0xd7')));_0x55f475['use']('/api/settings',require(_0xb80b('0xd8')));_0x55f475['use']('/api/square/odbc',require(_0xb80b('0xd9')));_0x55f475['use']('/api/square/projects',require('./api/squareProject'));_0x55f475[_0xb80b('0x8')](_0xb80b('0xda'),require('./api/squareRecording'));_0x55f475['use'](_0xb80b('0xdb'),require(_0xb80b('0xdc')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xdd'),require(_0xb80b('0xde')));_0x55f475[_0xb80b('0x8')]('/api/license',require('./api/license'));_0x55f475[_0xb80b('0x8')](_0xb80b('0xdf'),require(_0xb80b('0xe0')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xe1'),require(_0xb80b('0xe2')));_0x55f475['use'](_0xb80b('0xe3'),require(_0xb80b('0xe4')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xe5'),require(_0xb80b('0xe6')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xe7'),require('./api/mailTransferReport'));_0x55f475['use']('/api/chat/reports/transfer',require(_0xb80b('0xe8')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xe9'),require(_0xb80b('0xea')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xeb'),require(_0xb80b('0xec')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xed'),require(_0xb80b('0xee')));_0x55f475[_0xb80b('0x8')]('/api/cm/lists',require('./api/cmList'));_0x55f475[_0xb80b('0x8')](_0xb80b('0xef'),require('./api/voicePrefix'));_0x55f475[_0xb80b('0x8')](_0xb80b('0xf0'),require(_0xb80b('0xf1')));_0x55f475['use'](_0xb80b('0xf2'),require('./api/userProfileSection'));_0x55f475['use'](_0xb80b('0xf3'),require(_0xb80b('0xf4')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xf5'),require(_0xb80b('0xf6')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xf7'),require(_0xb80b('0xf8')));_0x55f475[_0xb80b('0x8')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x55f475['use'](_0xb80b('0xf9'),require(_0xb80b('0xfa')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xfb'),require(_0xb80b('0xfc')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xfd'),require(_0xb80b('0xfe')));_0x55f475[_0xb80b('0x8')](_0xb80b('0xff'),require('./api/whatsappTransferReport'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x100'),require(_0xb80b('0x101')));_0x55f475['use']('/api/cloudProviders',require(_0xb80b('0x102')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x103'),require('./api/realtime'));_0x55f475[_0xb80b('0x8')]('/api/auth/local',require(_0xb80b('0x104')));_0x55f475['use'](_0xb80b('0x105'),require(_0xb80b('0x106')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x107'),require(_0xb80b('0x108')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x109'),require(_0xb80b('0x10a')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x10b'),require('./api/version'));_0x55f475['use']('/api/system',require(_0xb80b('0x10c')));_0x55f475['use'](_0xb80b('0x10d'),require('./api/pm2'));_0x55f475[_0xb80b('0x8')](_0xb80b('0x10e'),require(_0xb80b('0x10f')));_0x55f475[_0xb80b('0x8')](_0xb80b('0x110'),express['static'](path[_0xb80b('0x111')](config[_0xb80b('0x112')],_0xb80b('0x110'))));_0x55f475['use'](_0xb80b('0x113'),express['static'](path['join'](config[_0xb80b('0x112')],'/www')));_0x55f475[_0xb80b('0x8')]('/demo',express[_0xb80b('0x114')](path['join'](config[_0xb80b('0x112')],_0xb80b('0x115'))));_0x55f475[_0xb80b('0x8')](_0xb80b('0x116'),express[_0xb80b('0x114')](path[_0xb80b('0x111')](config[_0xb80b('0x112')],_0xb80b('0x117'),_0xb80b('0x118'))));_0x55f475[_0xb80b('0x8')](_0xb80b('0x119'),express[_0xb80b('0x114')](path[_0xb80b('0x111')](config[_0xb80b('0x112')],_0xb80b('0x11a'))));_0x55f475[_0xb80b('0x11b')](_0xb80b('0x11c'))[_0xb80b('0x11d')](errors[0x194]);_0x55f475[_0xb80b('0x11b')]('/*')['get'](function(_0x17014f,_0x26fa0a){_0x26fa0a[_0xb80b('0x11e')](path[_0xb80b('0x11f')](_0x55f475['get'](_0xb80b('0x120'))+_0xb80b('0x121')));});};var sensitiveFields=[_0xb80b('0x122'),_0xb80b('0x123'),'newPassword',_0xb80b('0x124'),'firstName',_0xb80b('0x125'),_0xb80b('0x126'),_0xb80b('0x127'),_0xb80b('0x128'),_0xb80b('0x129'),_0xb80b('0x12a'),'clientId',_0xb80b('0x12b'),_0xb80b('0x12c'),_0xb80b('0x12d'),_0xb80b('0x12e'),'tenantId',_0xb80b('0x12f'),'channelSecret',_0xb80b('0x130'),_0xb80b('0x131'),_0xb80b('0x132'),_0xb80b('0x133'),'consumerSecret',_0xb80b('0x134'),_0xb80b('0x135'),_0xb80b('0x136'),'exten',_0xb80b('0x137'),_0xb80b('0x138'),_0xb80b('0x139'),'accesskeyid',_0xb80b('0x13a'),_0xb80b('0x13b'),_0xb80b('0x13'),_0xb80b('0x13c'),_0xb80b('0x13d'),_0xb80b('0x13e'),_0xb80b('0x13f'),'secret',_0xb80b('0x140'),_0xb80b('0x141')];function maskSensitiveData(_0x1a82ba){var _0x32ab57=/(?!^)[\s\S](?!$)/g;if(!_[_0xb80b('0x142')](_0x1a82ba))return;for(var _0x1e5bcc in _0x1a82ba){if(_[_0xb80b('0x143')](_0x1a82ba[_0x1e5bcc])){for(var _0x31f70d=0x0;_0x31f70d<_0x1a82ba[_0x1e5bcc][_0xb80b('0x144')];_0x31f70d++){maskSensitiveData(_0x1a82ba[_0x1e5bcc][_0x31f70d]);}}else if(_[_0xb80b('0x142')](_0x1a82ba[_0x1e5bcc])){maskSensitiveData(_0x1a82ba[_0x1e5bcc]);}else if(_[_0xb80b('0x145')](_0x1a82ba[_0x1e5bcc])){_0x1a82ba[_0x1e5bcc]=_0x1a82ba[_0x1e5bcc][_0xb80b('0x146')](/{{{/g,_0xb80b('0x147'))[_0xb80b('0x146')](/}}}/g,_0xb80b('0x148'))[_0xb80b('0x146')](/{{/g,'@{')[_0xb80b('0x146')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x1e5bcc)){_0x1a82ba[_0x1e5bcc]=_0x1a82ba[_0x1e5bcc][_0xb80b('0x146')](_0x32ab57,'*');}}}}
\ No newline at end of file
+var _0xb091=['/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/team','./api/campaign','./api/migration','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/jira','/api/rpc','/api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','/www','static','join','root','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','get','route','sendFile','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','key','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','path','express','util','./errors','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','name','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)','other','agent_name','test','url','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/faxAccount','./api/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/sms/messages','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatMessage','/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_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField'];(function(_0x4314d7,_0x355218){var _0x5c599b=function(_0x556354){while(--_0x556354){_0x4314d7['push'](_0x4314d7['shift']());}};_0x5c599b(++_0x355218);}(_0xb091,0x9d));var _0x1b09=function(_0x158cbd,_0x1df425){_0x158cbd=_0x158cbd-0x0;var _0x13ea32=_0xb091[_0x158cbd];return _0x13ea32;};'use strict';var _=require(_0x1b09('0x0'));var path=require(_0x1b09('0x1'));var express=require(_0x1b09('0x2'));var ewinston=require('express-winston');var util=require(_0x1b09('0x3'));var errors=require(_0x1b09('0x4'));var config=require('./config/environment');var logger=require('./config/logger')(_0x1b09('0x5'));var authLogger=require('./config/logger')(_0x1b09('0x6'));exports[_0x1b09('0x7')]=function(_0x3012d2){_0x3012d2[_0x1b09('0x8')](ewinston[_0x1b09('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x307ee4,_0x5d1d35){var _0x22296b=_0x1b09('0xa');if(!_[_0x1b09('0xb')](_0x307ee4[_0x1b09('0xc')])){_0x22296b+='\x20body=%s';var _0x21d262=_0x307ee4[_0x1b09('0xc')];maskSensitiveData(_0x21d262);}return util[_0x1b09('0xd')](_0x22296b,_0x307ee4[_0x1b09('0xe')],_0x307ee4[_0x1b09('0xf')]['x-forwarded-for']?_0x307ee4[_0x1b09('0xf')][_0x1b09('0x10')]:_0x307ee4[_0x1b09('0x11')][_0x1b09('0x12')]||_0x307ee4['ip'],_0x307ee4['url'],_0x5d1d35[_0x1b09('0x13')],_0x5d1d35[_0x1b09('0x14')],_0x307ee4[_0x1b09('0x15')]?_0x307ee4[_0x1b09('0x15')]['id']:null,_0x307ee4[_0x1b09('0x15')]?_0x307ee4['user'][_0x1b09('0x16')]:null,_0x307ee4['user']?_0x307ee4[_0x1b09('0x15')][_0x1b09('0x17')]:null,_0x21d262?util['inspect'](_0x21d262,![],null):'');}}));_0x3012d2[_0x1b09('0x8')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x438512,_0x14059){var _0x5b410e=_0x1b09('0x18');if(_0x438512['body']&&_0x438512['body'][_0x1b09('0x19')]&&_0x438512[_0x1b09('0xc')][_0x1b09('0x1a')]){_0x5b410e=_0x1b09('0x1b');}return util['format'](_0x5b410e,_0x438512[_0x1b09('0xe')],_0x438512[_0x1b09('0xf')][_0x1b09('0x10')]?_0x438512['headers'][_0x1b09('0x10')]:_0x438512[_0x1b09('0x11')][_0x1b09('0x12')]||_0x438512['ip'],_0x438512['url'],_0x14059['statusCode'],_0x14059[_0x1b09('0x14')],_0x438512[_0x1b09('0x15')]?_0x438512[_0x1b09('0x15')]['id']:null,_0x438512[_0x1b09('0x15')]?_0x438512['user'][_0x1b09('0x16')]:null,_0x438512[_0x1b09('0x15')]?_0x438512['user'][_0x1b09('0x17')]:null,_0x438512[_0x1b09('0xc')]&&_0x438512[_0x1b09('0xc')][_0x1b09('0x19')]?_0x438512[_0x1b09('0xc')][_0x1b09('0x19')]:_0x1b09('0x1c'),_0x438512['body']&&_0x438512[_0x1b09('0xc')][_0x1b09('0x1a')]?_0x438512[_0x1b09('0xc')][_0x1b09('0x1a')]:'',_0x438512['body']&&_0x438512[_0x1b09('0xc')][_0x1b09('0x1d')]?_0x438512['body'][_0x1b09('0x1d')]:'');},'ignoreRoute':function(_0x5a853b){var _0xbacf42=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xbacf42[_0x1b09('0x1e')](_0x5a853b[_0x1b09('0x1f')]);}}));_0x3012d2['use'](_0x1b09('0x20'),require(_0x1b09('0x21')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x22'),require(_0x1b09('0x23')));_0x3012d2['use'](_0x1b09('0x24'),require(_0x1b09('0x25')));_0x3012d2['use'](_0x1b09('0x26'),require(_0x1b09('0x27')));_0x3012d2[_0x1b09('0x8')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x28'),require('./api/voiceQueue'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x29'),require('./api/voiceRecording'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x2a'),require(_0x1b09('0x2b')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x2c'),require('./api/voiceMail'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x2d'),require(_0x1b09('0x2e')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x2f'),require('./api/voiceCallReport'));_0x3012d2[_0x1b09('0x8')]('/api/voice/dials/reports',require(_0x1b09('0x30')));_0x3012d2['use'](_0x1b09('0x31'),require(_0x1b09('0x32')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x33'),require(_0x1b09('0x34')));_0x3012d2['use']('/api/members/reports',require(_0x1b09('0x35')));_0x3012d2['use'](_0x1b09('0x36'),require('./api/trunk'));_0x3012d2[_0x1b09('0x8')]('/api/voice/transfers/reports',require(_0x1b09('0x37')));_0x3012d2['use'](_0x1b09('0x38'),require(_0x1b09('0x39')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x3a'),require('./api/mailAccount'));_0x3012d2['use'](_0x1b09('0x3b'),require(_0x1b09('0x3c')));_0x3012d2['use']('/api/mail/substatuses',require(_0x1b09('0x3d')));_0x3012d2[_0x1b09('0x8')]('/api/mail/interactions',require('./api/mailInteraction'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x3e'),require(_0x1b09('0x3f')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x40'),require(_0x1b09('0x41')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x42'),require(_0x1b09('0x43')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x44'),require(_0x1b09('0x45')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x46'),require('./api/dashboardItem'));_0x3012d2[_0x1b09('0x8')]('/api/fax/accounts',require(_0x1b09('0x47')));_0x3012d2[_0x1b09('0x8')]('/api/fax/applications',require(_0x1b09('0x48')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x49'),require(_0x1b09('0x4a')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x4b'),require(_0x1b09('0x4c')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x4d'),require('./api/faxQueue'));_0x3012d2['use'](_0x1b09('0x4e'),require(_0x1b09('0x4f')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x50'),require(_0x1b09('0x51')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x52'),require(_0x1b09('0x53')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x54'),require('./api/smsInteraction'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x55'),require('./api/smsMessage'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x56'),require('./api/smsQueue'));_0x3012d2['use']('/api/openchannel/accounts',require(_0x1b09('0x57')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x58'),require(_0x1b09('0x59')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x5a'),require('./api/openchannelInteraction'));_0x3012d2[_0x1b09('0x8')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x5b'),require('./api/openchannelQueue'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x5c'),require(_0x1b09('0x5d')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x5e'),require(_0x1b09('0x5f')));_0x3012d2[_0x1b09('0x8')]('/api/chat/applications',require('./api/chatApplication'));_0x3012d2['use']('/api/chat/interactions',require('./api/chatInteraction'));_0x3012d2['use']('/api/chat/messages',require(_0x1b09('0x60')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x61'),require(_0x1b09('0x62')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x63'),require('./api/chatQueue'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x64'),require(_0x1b09('0x65')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x66'),require(_0x1b09('0x67')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x68'),require(_0x1b09('0x69')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x6a'),require('./api/cmContact'));_0x3012d2[_0x1b09('0x8')]('/api/cm/hopper',require('./api/cmHopper'));_0x3012d2['use'](_0x1b09('0x6b'),require(_0x1b09('0x6c')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x6d'),require(_0x1b09('0x6e')));_0x3012d2['use'](_0x1b09('0x6f'),require(_0x1b09('0x70')));_0x3012d2[_0x1b09('0x8')]('/api/cm/custom_fields',require(_0x1b09('0x71')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x72'),require(_0x1b09('0x73')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x74'),require(_0x1b09('0x75')));_0x3012d2['use'](_0x1b09('0x76'),require(_0x1b09('0x77')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x78'),require(_0x1b09('0x79')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x7a'),require(_0x1b09('0x7b')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x7c'),require(_0x1b09('0x7d')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x7e'),require('./api/pause'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x7f'),require(_0x1b09('0x80')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x81'),require(_0x1b09('0x82')));_0x3012d2['use'](_0x1b09('0x83'),require(_0x1b09('0x84')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x85'),require(_0x1b09('0x86')));_0x3012d2[_0x1b09('0x8')]('/api/tags',require(_0x1b09('0x87')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x88'),require('./api/contactItemType'));_0x3012d2['use'](_0x1b09('0x89'),require('./api/cmContactHasItem'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x8a'),require(_0x1b09('0x8b')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x8c'),require(_0x1b09('0x8d')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x8e'),require('./api/trigger'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x8f'),require(_0x1b09('0x90')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x91'),require('./api/integration'));_0x3012d2[_0x1b09('0x8')]('/api/integrations/reports',require(_0x1b09('0x92')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x93'),require('./api/analyticCustomReport'));_0x3012d2[_0x1b09('0x8')]('/api/analytics/default_reports',require(_0x1b09('0x94')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x95'),require(_0x1b09('0x96')));_0x3012d2['use'](_0x1b09('0x97'),require(_0x1b09('0x98')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x99'),require(_0x1b09('0x9a')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x9b'),require('./api/analyticTreeReport'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x9c'),require('./api/intSalesforceAccount'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x9d'),require(_0x1b09('0x9e')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x9f'),require(_0x1b09('0xa0')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xa1'),require(_0x1b09('0xa2')));_0x3012d2[_0x1b09('0x8')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x3012d2['use'](_0x1b09('0xa3'),require(_0x1b09('0xa4')));_0x3012d2['use'](_0x1b09('0xa5'),require('./api/intDeskAccount'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xa6'),require(_0x1b09('0xa7')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xa8'),require(_0x1b09('0xa9')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xaa'),require(_0x1b09('0xab')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xac'),require(_0x1b09('0xad')));_0x3012d2[_0x1b09('0x8')]('/api/integrations/zoho/fields',require(_0x1b09('0xae')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xaf'),require(_0x1b09('0xb0')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xb1'),require(_0x1b09('0xb2')));_0x3012d2['use'](_0x1b09('0xb3'),require(_0x1b09('0xb4')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xb5'),require(_0x1b09('0xb6')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xb7'),require(_0x1b09('0xb8')));_0x3012d2[_0x1b09('0x8')]('/api/integrations/freshdesk/fields',require(_0x1b09('0xb9')));_0x3012d2['use']('/api/integrations/vtiger/accounts',require(_0x1b09('0xba')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xbb'),require(_0x1b09('0xbc')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xbd'),require(_0x1b09('0xbe')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xbf'),require('./api/intServicenowAccount'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xc0'),require('./api/intServicenowConfiguration'));_0x3012d2['use'](_0x1b09('0xc1'),require(_0x1b09('0xc2')));_0x3012d2[_0x1b09('0x8')]('/api/integrations/dynamics365/accounts',require(_0x1b09('0xc3')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xc4'),require('./api/intDynamics365Configuration'));_0x3012d2['use'](_0x1b09('0xc5'),require(_0x1b09('0xc6')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xc7'),require(_0x1b09('0xc8')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xc9'),require(_0x1b09('0xca')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xcb'),require('./api/intFreshsalesField'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xcc'),require(_0x1b09('0xcd')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xce'),require(_0x1b09('0xcf')));_0x3012d2['use'](_0x1b09('0xd0'),require('./api/chatInternalMessage'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xd1'),require('./api/jscriptyAnswerReport'));_0x3012d2['use'](_0x1b09('0xd2'),require('./api/jscriptyQuestionReport'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xd3'),require(_0x1b09('0xd4')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xd5'),require('./api/smsQueueReport'));_0x3012d2['use'](_0x1b09('0xd6'),require(_0x1b09('0xd7')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xd8'),require(_0x1b09('0xd9')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xda'),require(_0x1b09('0xdb')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xdc'),require(_0x1b09('0xdd')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xde'),require('./api/squareOdbc'));_0x3012d2[_0x1b09('0x8')]('/api/square/projects',require(_0x1b09('0xdf')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xe0'),require(_0x1b09('0xe1')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xe2'),require('./api/squareMessage'));_0x3012d2[_0x1b09('0x8')]('/api/teams',require(_0x1b09('0xe3')));_0x3012d2[_0x1b09('0x8')]('/api/license',require('./api/license'));_0x3012d2[_0x1b09('0x8')]('/api/campaigns',require(_0x1b09('0xe4')));_0x3012d2[_0x1b09('0x8')]('/api/migrations',require(_0x1b09('0xe5')));_0x3012d2[_0x1b09('0x8')]('/api/attachments',require('./api/attachment'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xe6'),require('./api/plugin'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xe7'),require('./api/mailTransferReport'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xe8'),require(_0x1b09('0xe9')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xea'),require(_0x1b09('0xeb')));_0x3012d2['use'](_0x1b09('0xec'),require(_0x1b09('0xed')));_0x3012d2[_0x1b09('0x8')]('/api/sms/reports/transfer',require(_0x1b09('0xee')));_0x3012d2['use'](_0x1b09('0xef'),require(_0x1b09('0xf0')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xf1'),require(_0x1b09('0xf2')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xf3'),require(_0x1b09('0xf4')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xf5'),require(_0x1b09('0xf6')));_0x3012d2['use'](_0x1b09('0xf7'),require(_0x1b09('0xf8')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xf9'),require('./api/userNotification'));_0x3012d2[_0x1b09('0x8')]('/api/whatsapp/accounts',require(_0x1b09('0xfa')));_0x3012d2['use'](_0x1b09('0xfb'),require(_0x1b09('0xfc')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xfd'),require(_0x1b09('0xfe')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0xff'),require(_0x1b09('0x100')));_0x3012d2['use'](_0x1b09('0x101'),require(_0x1b09('0x102')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x103'),require(_0x1b09('0x104')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x105'),require('./api/whatsappQueue'));_0x3012d2[_0x1b09('0x8')]('/api/cloudProviders',require('./api/cloudProvider'));_0x3012d2['use'](_0x1b09('0x106'),require(_0x1b09('0x107')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x108'),require(_0x1b09('0x109')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x10a'),require(_0x1b09('0x10b')));_0x3012d2[_0x1b09('0x8')]('/api/jira',require(_0x1b09('0x10c')));_0x3012d2['use'](_0x1b09('0x10d'),require('./api/rpc'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x10e'),require('./api/version'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x10f'),require(_0x1b09('0x110')));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x111'),require('./api/pm2'));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x112'),require(_0x1b09('0x113')));_0x3012d2[_0x1b09('0x8')]('/apidoc',express['static'](path['join'](config['root'],_0x1b09('0x114'))));_0x3012d2['use'](_0x1b09('0x115'),express[_0x1b09('0x116')](path[_0x1b09('0x117')](config[_0x1b09('0x118')],_0x1b09('0x115'))));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x119'),express[_0x1b09('0x116')](path[_0x1b09('0x117')](config[_0x1b09('0x118')],_0x1b09('0x119'))));_0x3012d2[_0x1b09('0x8')](_0x1b09('0x11a'),express[_0x1b09('0x116')](path[_0x1b09('0x117')](config[_0x1b09('0x118')],'snippet',_0x1b09('0x11b'))));_0x3012d2['use'](_0x1b09('0x11c'),express[_0x1b09('0x116')](path[_0x1b09('0x117')](config[_0x1b09('0x118')],_0x1b09('0x11d'))));_0x3012d2['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0x1b09('0x11e')](errors[0x194]);_0x3012d2[_0x1b09('0x11f')]('/*')['get'](function(_0x39eac3,_0x46a5e4){_0x46a5e4[_0x1b09('0x120')](path['resolve'](_0x3012d2[_0x1b09('0x11e')]('appPath')+'/index.html'));});};var sensitiveFields=[_0x1b09('0x121'),_0x1b09('0x122'),_0x1b09('0x123'),_0x1b09('0x124'),_0x1b09('0x125'),_0x1b09('0x126'),_0x1b09('0x127'),_0x1b09('0x128'),_0x1b09('0x129'),_0x1b09('0x12a'),_0x1b09('0x12b'),_0x1b09('0x12c'),'clientSecret',_0x1b09('0x12d'),_0x1b09('0x12e'),_0x1b09('0x12f'),_0x1b09('0x130'),_0x1b09('0x131'),_0x1b09('0x132'),_0x1b09('0x133'),'accessTokenSecret',_0x1b09('0x134'),'consumerKey',_0x1b09('0x135'),_0x1b09('0x136'),_0x1b09('0x137'),_0x1b09('0x138'),_0x1b09('0x139'),_0x1b09('0x13a'),'clientEmail',_0x1b09('0x13b'),_0x1b09('0x13c'),'secretaccesskey',_0x1b09('0x13d'),_0x1b09('0x15'),_0x1b09('0x13e'),_0x1b09('0x13f'),_0x1b09('0x140'),_0x1b09('0x141'),_0x1b09('0x142'),'registry',_0x1b09('0x143')];function maskSensitiveData(_0x144ca4){var _0x332de1=/(?!^)[\s\S](?!$)/g;if(!_[_0x1b09('0x144')](_0x144ca4))return;for(var _0x5e4e7e in _0x144ca4){if(_[_0x1b09('0x145')](_0x144ca4[_0x5e4e7e])){for(var _0x589259=0x0;_0x589259<_0x144ca4[_0x5e4e7e][_0x1b09('0x146')];_0x589259++){maskSensitiveData(_0x144ca4[_0x5e4e7e][_0x589259]);}}else if(_[_0x1b09('0x144')](_0x144ca4[_0x5e4e7e])){maskSensitiveData(_0x144ca4[_0x5e4e7e]);}else if(_[_0x1b09('0x147')](_0x144ca4[_0x5e4e7e])){_0x144ca4[_0x5e4e7e]=_0x144ca4[_0x5e4e7e][_0x1b09('0x148')](/{{{/g,_0x1b09('0x149'))[_0x1b09('0x148')](/}}}/g,_0x1b09('0x14a'))[_0x1b09('0x148')](/{{/g,'@{')[_0x1b09('0x148')](/}}/g,'}@');if(_[_0x1b09('0x14b')](sensitiveFields,_0x5e4e7e)){_0x144ca4[_0x5e4e7e]=_0x144ca4[_0x5e4e7e]['replace'](_0x332de1,'*');}}}}
\ No newline at end of file
index 9aa1e4c..7366e08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55df=['../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','default','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.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/mailApplication/mailApplication.rpc','../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/smsMessage/smsMessage.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55df,0x1c6));var _0xf55d=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x55df[_0x18ab2a];return _0x16dcee;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xf55d('0x0'));var _=require(_0xf55d('0x1'));var config=require(_0xf55d('0x2'));exports[_0xf55d('0x3')]=function(){return new BPromise(function(_0xd7568e,_0x1c0cf4){var _0x1d5ae7={};_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x5')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/voiceExtension/voiceExtension.rpc'));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x6')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/voiceRecording/voiceRecording.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x7')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x1d5ae7=_['merge'](_0x1d5ae7,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1d5ae7=_['merge'](_0x1d5ae7,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x8')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x9')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0xa')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0xb')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0xc')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0xd')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0xe')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/mailInteraction/mailInteraction.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/mailMessage/mailMessage.rpc'));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0xf')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x10')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x11')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x12')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x13')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x14')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x15')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x16')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x17')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x18')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x19')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/smsQueue/smsQueue.rpc'));_0x1d5ae7=_['merge'](_0x1d5ae7,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x1a')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x1b')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x1c')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x1d')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x1e')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x1f')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x20')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x21')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x22')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x23')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x24')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x25')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x26')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x27')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x28')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x29')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/variable/variable.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x2a')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x2b')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x2c')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x2d')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x2e')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x2f')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x30')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x31')));_0x1d5ae7=_['merge'](_0x1d5ae7,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x32')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x33')));_0x1d5ae7=_['merge'](_0x1d5ae7,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x34')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x35')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x36')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/squareProject/squareProject.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/squareRecording/squareRecording.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x37')));_0x1d5ae7=_['merge'](_0x1d5ae7,require(_0xf55d('0x38')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require('../api/attachment/attachment.rpc'));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x39')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x3a')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x3b')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x3c')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x3d')));_0x1d5ae7=_[_0xf55d('0x4')](_0x1d5ae7,require(_0xf55d('0x3e')));var _0x35539e=jayson[_0xf55d('0x3f')](_0x1d5ae7)['http']();var _0x12d2d4=config[_0xf55d('0x40')][_0xf55d('0x41')]||config['port']+0x1;var _0x1df259=config[_0xf55d('0x40')]['ip']||_0xf55d('0x42');_0x35539e['on'](_0xf55d('0x43'),function(_0x5ae47d){return _0x1c0cf4(_0x5ae47d);});_0x35539e[_0xf55d('0x3')](_0x12d2d4,_0x1df259,function(){console[_0xf55d('0x44')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1df259,_0x12d2d4);require('../config/triggers')[_0xf55d('0x45')]();return _0xd7568e('RPC\x20listening\x20on\x20'+_0x1df259+':'+_0x12d2d4);});});};
\ No newline at end of file
+var _0x666c=['log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../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/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x666c,0x1ed));var _0xc666=function(_0x55c3d9,_0x3bf75c){_0x55c3d9=_0x55c3d9-0x0;var _0x19fd97=_0x666c[_0x55c3d9];return _0x19fd97;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc666('0x0'));var _=require(_0xc666('0x1'));var config=require('../config/environment');exports[_0xc666('0x2')]=function(){return new BPromise(function(_0x4b05eb,_0x1d0645){var _0x5b77f3={};_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x4')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x5')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x6')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x7')));_0x5b77f3=_['merge'](_0x5b77f3,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x8')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x9')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/memberReport/memberReport.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0xa')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0xb')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0xc')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/mailAccount/mailAccount.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0xd')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0xe')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0xf')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x10')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x11')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x12')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x13')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x14')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x15')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x16')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x17')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/smsAccount/smsAccount.rpc'));_0x5b77f3=_['merge'](_0x5b77f3,require('../api/smsInteraction/smsInteraction.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x18')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x19')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x1a')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x1b')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x1c')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x1d')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x1e')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x1f')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/cmContact/cmContact.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x20')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x21')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x22')));_0x5b77f3=_['merge'](_0x5b77f3,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x23')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x24')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x25')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x26')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x27')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x28')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x29')));_0x5b77f3=_['merge'](_0x5b77f3,require('../api/variable/variable.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x2a')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x2b')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x2c')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x2d')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x2e')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x2f')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x30')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x31')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x32')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x33')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x34')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x35')));_0x5b77f3=_['merge'](_0x5b77f3,require('../api/setting/setting.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x36')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x37')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x38')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x39')));_0x5b77f3=_['merge'](_0x5b77f3,require(_0xc666('0x3a')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/attachment/attachment.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/plugin/plugin.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x3b')));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x5b77f3=_['merge'](_0x5b77f3,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5b77f3=_[_0xc666('0x3')](_0x5b77f3,require(_0xc666('0x3c')));var _0x1cf992=jayson[_0xc666('0x3d')](_0x5b77f3)[_0xc666('0x3e')]();var _0x48d592=config[_0xc666('0x3f')][_0xc666('0x40')]||config[_0xc666('0x40')]+0x1;var _0x51e5b1=config[_0xc666('0x3f')]['ip']||_0xc666('0x41');_0x1cf992['on'](_0xc666('0x42'),function(_0x40cb36){return _0x1d0645(_0x40cb36);});_0x1cf992[_0xc666('0x2')](_0x48d592,_0x51e5b1,function(){console[_0xc666('0x43')](_0xc666('0x44'),_0x51e5b1,_0x48d592);require('../config/triggers')['default']();return _0x4b05eb(_0xc666('0x45')+_0x51e5b1+':'+_0x48d592);});});};
\ No newline at end of file
index b469f05..f9aa6ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff5=['label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','headers','ready','line','hangup','emit','520-Invalid','520\x20End\x20of\x20proper','function','substring','replace','result=','substr','indexOf','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','prototype','sync','ANSWER','getData','beep','sendRequest','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','exec','AGI','wait','WAIT'];(function(_0x559558,_0x20d6a7){var _0x9f491f=function(_0x2a7993){while(--_0x2a7993){_0x559558['push'](_0x559558['shift']());}};_0x9f491f(++_0x20d6a7);}(_0xeff5,0x182));var _0x5eff=function(_0x57e892,_0x2eb662){_0x57e892=_0x57e892-0x0;var _0x9ff2ba=_0xeff5[_0x57e892];return _0x9ff2ba;};'use strict';var util=require(_0x5eff('0x0'));var _=require(_0x5eff('0x1'));var EventEmitter=require(_0x5eff('0x2'))[_0x5eff('0x3')];var AGIReply=require(_0x5eff('0x4'));var AGIError=require(_0x5eff('0x5'));function AGIChannel(_0x4dea65){var _0x15cee2=this,_0x496813=new AGIReply(),_0x576158=![],_0x1a9423={};EventEmitter[_0x5eff('0x6')](_0x15cee2);_0x4dea65[_0x5eff('0x7')]('utf8');_0x4dea65[_0x5eff('0x8')](0x8*0x3c*0x3c*0x3e8);_0x496813['setEncoding'](_0x5eff('0x9'));_0x496813['on'](_0x5eff('0xa'),function(_0xbcb023){for(var _0x51ab63 in _0xbcb023){_0x15cee2[_0x51ab63]=_0xbcb023[_0x51ab63];}_0x15cee2['emit'](_0x5eff('0xb'));});_0x496813['on'](_0x5eff('0xc'),function(_0x4782c1){if(_0x4782c1['toLowerCase']()==_0x5eff('0xd')){_0x15cee2[_0x5eff('0xe')](_0x5eff('0xd'));return;}if(_0x4782c1['substring'](0x0,0xb)==_0x5eff('0xf')){_0x576158=!![];}if(_0x576158){_0x1a9423['rx']+=_0x4782c1+'\x0a';if(_0x4782c1['search'](_0x5eff('0x10'))!=-0x1){_0x576158=![];}}else{_0x1a9423['rx']=_0x4782c1;}if(_0x576158){return;}if(typeof _0x1a9423['cb']==_0x5eff('0x11')){var _0x532899=_0x1a9423['rx'][_0x5eff('0x12')](0x0,0x3),_0x571301=null,_0x1b5580=null;_0x532899=parseInt(_0x532899);if(isNaN(_0x532899)){_0x1a9423['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x532899!=0xc8){_0x1a9423['cb'](null,{'code':_0x532899,'result':-0x1,'extra':'KO'});return;}_0x571301=_0x1a9423['rx'][_0x5eff('0x12')](0x4)[_0x5eff('0x13')](_0x5eff('0x14'),'');if(_0x571301['indexOf']('\x20')!=-0x1){_0x571301=_0x571301[_0x5eff('0x15')](0x0,_0x571301[_0x5eff('0x16')]('\x20'));}if(_[_0x5eff('0x17')](_0x571301,'-1')){_0x571301=parseInt(_0x571301);}_0x1b5580=_0x1a9423['rx'][_0x5eff('0x18')]('\x20');if(_0x1b5580[_0x5eff('0x19')]==0x3){_0x1b5580=_0x1b5580[0x2][_0x5eff('0x12')](0x1,_0x1b5580[0x2][_0x5eff('0x19')]-0x1);}else if(_0x1b5580[_0x5eff('0x19')]>0x3){var _0x31fb79=/\((.+)\)/;var _0xbb2b6c=_0x1a9423['rx']['match'](_0x31fb79);if(_0xbb2b6c){_0x1b5580=_0xbb2b6c[0x1];}else{_0x1b5580=null;}}else{_0x1b5580=null;}_0x1a9423['cb'](null,{'code':_0x532899,'result':_0x571301,'extra':_0x1b5580});}});_0x4dea65['on'](_0x5eff('0x1a'),function(_0xa50caa){_0x15cee2['emit'](_0x5eff('0x1a'),new AGIError(_0x5eff('0x1b'),_0xa50caa[_0x5eff('0x1c')]));});_0x4dea65['on'](_0x5eff('0x1d'),function(){_0x15cee2[_0x5eff('0xe')]('close',new AGIError(_0x5eff('0x1e')));});_0x4dea65['on'](_0x5eff('0x1f'),function(){_0x15cee2[_0x5eff('0xe')](_0x5eff('0x1f'),new AGIError(_0x5eff('0x20')));_0x4dea65[_0x5eff('0x21')]();});_0x4dea65[_0x5eff('0x22')](_0x496813);this[_0x5eff('0x23')]=function(_0x2f59df,_0x5a511e){var _0x2f59df=_0x2f59df||'',_0x5a511e=typeof _0x5a511e=='function'?_0x5a511e:new Function();_0x1a9423={'tx':_0x2f59df,'rx':'','cb':_0x5a511e};_0x4dea65['write'](_0x2f59df+'\x0a');},this[_0x5eff('0x1d')]=function(){_0x4dea65[_0x5eff('0x21')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x5eff('0x24')]['sendRequest']=function(_0x204294){return this[_0x5eff('0x23')][_0x5eff('0x25')](this,_0x204294);};AGIChannel[_0x5eff('0x24')]['answer']=function(){return this['sendRequest'](_0x5eff('0x26'));};AGIChannel[_0x5eff('0x24')][_0x5eff('0x27')]=function(_0x379097,_0x2b77e4,_0x4a06cb){_0x379097=_0x379097===undefined?_0x5eff('0x28'):_0x379097;_0x2b77e4=_0x2b77e4===undefined?'5':_0x2b77e4;_0x4a06cb=_0x4a06cb===undefined?'1':_0x4a06cb;return this[_0x5eff('0x29')](util[_0x5eff('0x2a')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x379097,_0x2b77e4*0x3e8,_0x4a06cb));};AGIChannel[_0x5eff('0x24')][_0x5eff('0x2b')]=function(_0x3c123f){_0x3c123f=_0x3c123f||_0x5eff('0x2c');return this[_0x5eff('0x29')](util[_0x5eff('0x2a')](_0x5eff('0x2d'),_0x3c123f));};AGIChannel[_0x5eff('0x24')]['exec']=function(_0x6f66ba,_0x5c05f5){if(_[_0x5eff('0x2e')](_0x5c05f5)){return this[_0x5eff('0x29')](util[_0x5eff('0x2a')]('EXEC\x20%s\x20%s',_0x6f66ba,_0x5c05f5[_0x5eff('0x2f')](',')));}return this['sendRequest'](util[_0x5eff('0x2a')](_0x5eff('0x30'),_0x6f66ba,_0x5c05f5));};AGIChannel[_0x5eff('0x24')]['setContext']=function(_0x5754a2){return this[_0x5eff('0x29')](util[_0x5eff('0x2a')](_0x5eff('0x31'),_0x5754a2));};AGIChannel[_0x5eff('0x24')][_0x5eff('0x32')]=function(_0x4374cf){return this['sendRequest'](util[_0x5eff('0x2a')](_0x5eff('0x33'),_0x4374cf));};AGIChannel['prototype']['setPriority']=function(_0x13a8ae){return this['sendRequest'](util[_0x5eff('0x2a')]('SET\x20PRIORITY\x20%s',_0x13a8ae));};AGIChannel[_0x5eff('0x24')]['hangup']=function(){return this[_0x5eff('0x29')](_0x5eff('0x34'));};AGIChannel[_0x5eff('0x24')][_0x5eff('0x35')]=function(_0xee63d6,_0x297e38){var _0x352854=_[_0x5eff('0x36')](_0x297e38)||_[_0x5eff('0x37')](_0x297e38)?_0x297e38[_0x5eff('0x38')]():_0x297e38;return this['sendRequest'](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xee63d6,_0x352854?_0x352854[_0x5eff('0x38')]()[_0x5eff('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5eff('0x24')][_0x5eff('0x39')]=function(_0x28154b,_0x143a73){return this['sendRequest'](util[_0x5eff('0x2a')](_0x5eff('0x3a'),_0x28154b,_0x143a73));};AGIChannel[_0x5eff('0x24')]['sayDigits']=function(_0x2eedf1,_0x587bfb){return this[_0x5eff('0x29')](util[_0x5eff('0x2a')](_0x5eff('0x3b'),_0x2eedf1,_0x587bfb));};AGIChannel['prototype'][_0x5eff('0x3c')]=function(_0x582550,_0x788903){return this[_0x5eff('0x29')](util[_0x5eff('0x2a')](_0x5eff('0x3d'),_0x582550,_0x788903));};AGIChannel['prototype'][_0x5eff('0x3e')]=function(_0x3f2295,_0xb779bc,_0x177a78){_0xb779bc=_0xb779bc||this[_0x5eff('0x3f')];_0x177a78=_0x177a78||0x1;this[_0x5eff('0x40')](_0x3f2295);this['setExtension'](_0xb779bc);this['setPriority'](_0x177a78);return this[_0x5eff('0x2b')](util[_0x5eff('0x2a')](_0x5eff('0x41'),_0x3f2295,_0xb779bc,_0x177a78));};AGIChannel['prototype'][_0x5eff('0x42')]=function(_0x50591b){return this[_0x5eff('0x29')](util[_0x5eff('0x2a')](_0x5eff('0x43'),_0x50591b));};AGIChannel[_0x5eff('0x24')]['recordFile']=function(_0x5af6e4,_0xa36d54,_0x47480a,_0x1b5db0,_0x128dcb,_0x46a596){_0xa36d54=_0xa36d54||_0x5eff('0x44');_0x47480a=_0x47480a||'';_0x1b5db0=_0x1b5db0===undefined?-0x1:_0x1b5db0==='-1'?-0x1:_0x1b5db0*0x3e8;_0x128dcb=_0x128dcb===undefined?'':'s='+_0x128dcb;_0x46a596=_0x46a596?_0x5eff('0x45'):'';return this['sendRequest'](util[_0x5eff('0x2a')](_0x5eff('0x46'),_0x5af6e4,_0xa36d54,_0x47480a,_0x1b5db0,_0x46a596,_0x128dcb));};AGIChannel['prototype'][_0x5eff('0x47')]=function(_0x565227,_0x1602fa){_0x1602fa=_0x1602fa||'';return this[_0x5eff('0x29')](util[_0x5eff('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x565227,_0x1602fa));};AGIChannel[_0x5eff('0x24')]['agi']=function(_0x3c5cb1){return this[_0x5eff('0x48')](_0x5eff('0x49'),_0x3c5cb1);};AGIChannel[_0x5eff('0x24')][_0x5eff('0x4a')]=function(_0x1a7d25){return this[_0x5eff('0x48')](_0x5eff('0x4b'),_0x1a7d25);};AGIChannel[_0x5eff('0x24')][_0x5eff('0x1a')]=function(_0x521b93,_0x1ac686){this[_0x5eff('0x2b')](util[_0x5eff('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x521b93['id'],_0x521b93[_0x5eff('0x4c')],_0x1ac686));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0x3ff6=['ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','utf8','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sendRequest','sync','answer'];(function(_0x28488f,_0x4fffb1){var _0x11bab7=function(_0x220b92){while(--_0x220b92){_0x28488f['push'](_0x28488f['shift']());}};_0x11bab7(++_0x4fffb1);}(_0x3ff6,0x1a3));var _0x63ff=function(_0x585f0c,_0x2853fc){_0x585f0c=_0x585f0c-0x0;var _0x5c580a=_0x3ff6[_0x585f0c];return _0x5c580a;};'use strict';var util=require(_0x63ff('0x0'));var _=require(_0x63ff('0x1'));var EventEmitter=require(_0x63ff('0x2'))[_0x63ff('0x3')];var AGIReply=require(_0x63ff('0x4'));var AGIError=require(_0x63ff('0x5'));function AGIChannel(_0x2b7fd7){var _0x587f75=this,_0x2a1350=new AGIReply(),_0x4310ae=![],_0xef8702={};EventEmitter[_0x63ff('0x6')](_0x587f75);_0x2b7fd7[_0x63ff('0x7')]('utf8');_0x2b7fd7[_0x63ff('0x8')](0x8*0x3c*0x3c*0x3e8);_0x2a1350[_0x63ff('0x7')](_0x63ff('0x9'));_0x2a1350['on']('headers',function(_0x181f99){for(var _0xd6107e in _0x181f99){_0x587f75[_0xd6107e]=_0x181f99[_0xd6107e];}_0x587f75[_0x63ff('0xa')](_0x63ff('0xb'));});_0x2a1350['on'](_0x63ff('0xc'),function(_0xb631c7){if(_0xb631c7[_0x63ff('0xd')]()==_0x63ff('0xe')){_0x587f75[_0x63ff('0xa')](_0x63ff('0xe'));return;}if(_0xb631c7['substring'](0x0,0xb)==_0x63ff('0xf')){_0x4310ae=!![];}if(_0x4310ae){_0xef8702['rx']+=_0xb631c7+'\x0a';if(_0xb631c7[_0x63ff('0x10')](_0x63ff('0x11'))!=-0x1){_0x4310ae=![];}}else{_0xef8702['rx']=_0xb631c7;}if(_0x4310ae){return;}if(typeof _0xef8702['cb']==_0x63ff('0x12')){var _0x1afce4=_0xef8702['rx'][_0x63ff('0x13')](0x0,0x3),_0x19c605=null,_0x3b12f1=null;_0x1afce4=parseInt(_0x1afce4);if(isNaN(_0x1afce4)){_0xef8702['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x63ff('0x14')});return;}if(_0x1afce4!=0xc8){_0xef8702['cb'](null,{'code':_0x1afce4,'result':-0x1,'extra':'KO'});return;}_0x19c605=_0xef8702['rx'][_0x63ff('0x13')](0x4)[_0x63ff('0x15')](_0x63ff('0x16'),'');if(_0x19c605[_0x63ff('0x17')]('\x20')!=-0x1){_0x19c605=_0x19c605['substr'](0x0,_0x19c605[_0x63ff('0x17')]('\x20'));}if(_[_0x63ff('0x18')](_0x19c605,'-1')){_0x19c605=parseInt(_0x19c605);}_0x3b12f1=_0xef8702['rx'][_0x63ff('0x19')]('\x20');if(_0x3b12f1[_0x63ff('0x1a')]==0x3){_0x3b12f1=_0x3b12f1[0x2][_0x63ff('0x13')](0x1,_0x3b12f1[0x2][_0x63ff('0x1a')]-0x1);}else if(_0x3b12f1[_0x63ff('0x1a')]>0x3){var _0x5a4d23=/\((.+)\)/;var _0x52c346=_0xef8702['rx'][_0x63ff('0x1b')](_0x5a4d23);if(_0x52c346){_0x3b12f1=_0x52c346[0x1];}else{_0x3b12f1=null;}}else{_0x3b12f1=null;}_0xef8702['cb'](null,{'code':_0x1afce4,'result':_0x19c605,'extra':_0x3b12f1});}});_0x2b7fd7['on'](_0x63ff('0x1c'),function(_0x14db2e){_0x587f75['emit'](_0x63ff('0x1c'),new AGIError(_0x63ff('0x1d'),_0x14db2e[_0x63ff('0x1e')]));});_0x2b7fd7['on'](_0x63ff('0x1f'),function(){_0x587f75[_0x63ff('0xa')](_0x63ff('0x1f'),new AGIError(_0x63ff('0x20')));});_0x2b7fd7['on'](_0x63ff('0x21'),function(){_0x587f75['emit'](_0x63ff('0x21'),new AGIError(_0x63ff('0x22')));_0x2b7fd7[_0x63ff('0x23')]();});_0x2b7fd7[_0x63ff('0x24')](_0x2a1350);this[_0x63ff('0x25')]=function(_0x164a60,_0x2f67c2){var _0x164a60=_0x164a60||'',_0x2f67c2=typeof _0x2f67c2=='function'?_0x2f67c2:new Function();_0xef8702={'tx':_0x164a60,'rx':'','cb':_0x2f67c2};_0x2b7fd7[_0x63ff('0x26')](_0x164a60+'\x0a');},this[_0x63ff('0x1f')]=function(){_0x2b7fd7[_0x63ff('0x23')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x63ff('0x27')][_0x63ff('0x28')]=function(_0xadaf12){return this[_0x63ff('0x25')][_0x63ff('0x29')](this,_0xadaf12);};AGIChannel[_0x63ff('0x27')][_0x63ff('0x2a')]=function(){return this[_0x63ff('0x28')](_0x63ff('0x2b'));};AGIChannel[_0x63ff('0x27')][_0x63ff('0x2c')]=function(_0x27ac32,_0x55653f,_0x333ddf){_0x27ac32=_0x27ac32===undefined?_0x63ff('0x2d'):_0x27ac32;_0x55653f=_0x55653f===undefined?'5':_0x55653f;_0x333ddf=_0x333ddf===undefined?'1':_0x333ddf;return this[_0x63ff('0x28')](util[_0x63ff('0x2e')](_0x63ff('0x2f'),_0x27ac32,_0x55653f*0x3e8,_0x333ddf));};AGIChannel[_0x63ff('0x27')][_0x63ff('0x30')]=function(_0x43343f){_0x43343f=_0x43343f||_0x63ff('0x31');return this[_0x63ff('0x28')](util[_0x63ff('0x2e')](_0x63ff('0x32'),_0x43343f));};AGIChannel[_0x63ff('0x27')][_0x63ff('0x33')]=function(_0xe2a2cb,_0x55ce77){if(_[_0x63ff('0x34')](_0x55ce77)){return this[_0x63ff('0x28')](util[_0x63ff('0x2e')](_0x63ff('0x35'),_0xe2a2cb,_0x55ce77[_0x63ff('0x36')](',')));}return this[_0x63ff('0x28')](util['format'](_0x63ff('0x35'),_0xe2a2cb,_0x55ce77));};AGIChannel[_0x63ff('0x27')]['setContext']=function(_0x209a93){return this['sendRequest'](util[_0x63ff('0x2e')](_0x63ff('0x37'),_0x209a93));};AGIChannel['prototype'][_0x63ff('0x38')]=function(_0xf7c0dd){return this[_0x63ff('0x28')](util[_0x63ff('0x2e')]('SET\x20EXTENSION\x20%s',_0xf7c0dd));};AGIChannel['prototype'][_0x63ff('0x39')]=function(_0xde76a2){return this[_0x63ff('0x28')](util[_0x63ff('0x2e')](_0x63ff('0x3a'),_0xde76a2));};AGIChannel['prototype'][_0x63ff('0xe')]=function(){return this[_0x63ff('0x28')](_0x63ff('0x3b'));};AGIChannel[_0x63ff('0x27')][_0x63ff('0x3c')]=function(_0x41d6da,_0x23f94d){var _0x2e8cfd=_[_0x63ff('0x3d')](_0x23f94d)||_['isNumber'](_0x23f94d)?_0x23f94d[_0x63ff('0x3e')]():_0x23f94d;return this['sendRequest'](util[_0x63ff('0x2e')](_0x63ff('0x3f'),_0x41d6da,_0x2e8cfd?_0x2e8cfd[_0x63ff('0x3e')]()[_0x63ff('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x63ff('0x27')]['sayNumber']=function(_0x408269,_0x3be123){return this[_0x63ff('0x28')](util[_0x63ff('0x2e')]('SAY\x20NUMBER\x20%s\x20%s',_0x408269,_0x3be123));};AGIChannel['prototype']['sayDigits']=function(_0x15385b,_0x5a7c7a){return this[_0x63ff('0x28')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x15385b,_0x5a7c7a));};AGIChannel[_0x63ff('0x27')]['sayPhonetic']=function(_0x1d111f,_0x3bd746){return this['sendRequest'](util['format'](_0x63ff('0x40'),_0x1d111f,_0x3bd746));};AGIChannel[_0x63ff('0x27')][_0x63ff('0x41')]=function(_0x5eb12c,_0x16c516,_0xfe6adf){_0x16c516=_0x16c516||this['extension'];_0xfe6adf=_0xfe6adf||0x1;this[_0x63ff('0x42')](_0x5eb12c);this['setExtension'](_0x16c516);this[_0x63ff('0x39')](_0xfe6adf);return this['noop'](util[_0x63ff('0x2e')](_0x63ff('0x43'),_0x5eb12c,_0x16c516,_0xfe6adf));};AGIChannel['prototype'][_0x63ff('0x44')]=function(_0x5a00fb){return this[_0x63ff('0x28')](util[_0x63ff('0x2e')](_0x63ff('0x45'),_0x5a00fb));};AGIChannel[_0x63ff('0x27')][_0x63ff('0x46')]=function(_0x5dcf62,_0x8a197c,_0x132f64,_0x479f15,_0x50ac97,_0x14b2b0){_0x8a197c=_0x8a197c||'wav';_0x132f64=_0x132f64||'';_0x479f15=_0x479f15===undefined?-0x1:_0x479f15==='-1'?-0x1:_0x479f15*0x3e8;_0x50ac97=_0x50ac97===undefined?'':'s='+_0x50ac97;_0x14b2b0=_0x14b2b0?_0x63ff('0x47'):'';return this['sendRequest'](util[_0x63ff('0x2e')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x5dcf62,_0x8a197c,_0x132f64,_0x479f15,_0x14b2b0,_0x50ac97));};AGIChannel[_0x63ff('0x27')]['streamFile']=function(_0xc918ce,_0x51e3e8){_0x51e3e8=_0x51e3e8||'';return this[_0x63ff('0x28')](util['format'](_0x63ff('0x48'),_0xc918ce,_0x51e3e8));};AGIChannel[_0x63ff('0x27')][_0x63ff('0x49')]=function(_0x58ff4a){return this[_0x63ff('0x33')](_0x63ff('0x4a'),_0x58ff4a);};AGIChannel['prototype']['wait']=function(_0x562fda){return this['exec'](_0x63ff('0x4b'),_0x562fda);};AGIChannel[_0x63ff('0x27')][_0x63ff('0x1c')]=function(_0x4fdefb,_0x34af1b){this['noop'](util[_0x63ff('0x2e')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x4fdefb['id'],_0x4fdefb['label'],_0x34af1b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x63ff('0x4c')]=AGIChannel;
\ No newline at end of file
index 5a0feaf..4e64cf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc43f=['Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x5330cb,_0x335781){var _0x121429=function(_0x1a41fc){while(--_0x1a41fc){_0x5330cb['push'](_0x5330cb['shift']());}};_0x121429(++_0x335781);}(_0xc43f,0x117));var _0xfc43=function(_0x29915d,_0xec27c5){_0x29915d=_0x29915d-0x0;var _0xd6895c=_0xc43f[_0x29915d];return _0xd6895c;};'use strict';var util=require(_0xfc43('0x0'));var error={'E_AGI_UNDEFINED':_0xfc43('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xfc43('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xfc43('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xfc43('0x4'),'E_AGI_SOCKET_ERROR':_0xfc43('0x5'),'E_AGI_SOCKET_CLOSE':_0xfc43('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xfc43('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xfc43('0x8'),'E_AGI_IVR_ENTRY':_0xfc43('0x9')};function AGIError(_0x31fe35){var _0x31fe35=_0x31fe35||null,_0x14684d=_0x14684d||[],_0x385197=0x1,_0x534816='';if(!error[_0x31fe35]){_0x31fe35='E_AGI_UNDEFINED';}_0x14684d[_0xfc43('0xa')](error[_0x31fe35]);while(arguments[_0x385197]){_0x14684d[_0xfc43('0xa')](arguments[_0x385197]);_0x385197++;}_0x534816=util[_0xfc43('0xb')][_0xfc43('0xc')](util,_0x14684d);this[_0xfc43('0xd')]=_0x534816;this[_0xfc43('0xe')]=_0x31fe35;}module[_0xfc43('0xf')]=AGIError;
\ No newline at end of file
+var _0xe4fd=['E_AGI_UNDEFINED','push','format','message','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x4fb614,_0x3f1326){var _0x14222b=function(_0x5e3873){while(--_0x5e3873){_0x4fb614['push'](_0x4fb614['shift']());}};_0x14222b(++_0x3f1326);}(_0xe4fd,0x7c));var _0xde4f=function(_0x34a156,_0x3f57ea){_0x34a156=_0x34a156-0x0;var _0x42c18e=_0xe4fd[_0x34a156];return _0x42c18e;};'use strict';var util=require(_0xde4f('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xde4f('0x1'),'E_AGI_SERVER_ERROR':_0xde4f('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xde4f('0x3'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xde4f('0x4'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xde4f('0x5')};function AGIError(_0xf10899){var _0xf10899=_0xf10899||null,_0x9df056=_0x9df056||[],_0x513ab4=0x1,_0x5ec528='';if(!error[_0xf10899]){_0xf10899=_0xde4f('0x6');}_0x9df056['push'](error[_0xf10899]);while(arguments[_0x513ab4]){_0x9df056[_0xde4f('0x7')](arguments[_0x513ab4]);_0x513ab4++;}_0x5ec528=util[_0xde4f('0x8')]['apply'](util,_0x9df056);this[_0xde4f('0x9')]=_0x5ec528;this['name']=_0xf10899;}module['exports']=AGIError;
\ No newline at end of file
index 464d28d..ba5bd48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56bd=['condition\x20not\x20found','exports','lodash','agi','menu','getsecretdigits','vertices','numberOfEdges','prototype','addVertex','addEdge','edges','push','size','traverseBFS','info','no\x20vertex\x20found','length','condition','split','agicommand','vswitch','target','default','invalid','includes','max\x20retry\x20reach'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56bd,0x1b2));var _0xd56b=function(_0x3b070d,_0x4e2d4f){_0x3b070d=_0x3b070d-0x0;var _0x449589=_0x56bd[_0x3b070d];return _0x449589;};'use strict';var _=require(_0xd56b('0x0'));var logger=require('../../../config/logger')(_0xd56b('0x1'));var verticesWithRetry=[_0xd56b('0x2'),'getdigits',_0xd56b('0x3')];var Graph=function(){this[_0xd56b('0x4')]={};this['edges']={};this[_0xd56b('0x5')]=0x0;};Graph[_0xd56b('0x6')][_0xd56b('0x7')]=function(_0x57dfb9){this[_0xd56b('0x4')][_0x57dfb9['id']]=_0x57dfb9;this['edges'][_0x57dfb9['id']]=[];};Graph[_0xd56b('0x6')][_0xd56b('0x8')]=function(_0x3c8d57,_0xe8198c,_0x1e03f8){this[_0xd56b('0x9')][_0x3c8d57][_0xd56b('0xa')]({'target':_0xe8198c,'condition':_0x1e03f8});this['numberOfEdges']+=0x1;};Graph['prototype']['size']=function(){return _[_0xd56b('0xb')](this[_0xd56b('0x4')]);};Graph['prototype']['relations']=function(){return this[_0xd56b('0x5')];};Graph[_0xd56b('0x6')]['getVertex']=function(_0x2e75c7){return this[_0xd56b('0x4')][_0x2e75c7];};Graph[_0xd56b('0x6')][_0xd56b('0xc')]=function(_0x3a6328,_0x56d9cf){if(!this[_0xd56b('0x4')][_0x3a6328]){return logger[_0xd56b('0xd')](_0xd56b('0xe'));}var _0x24178d=_0x56d9cf(this['vertices'][_0x3a6328]);if(!_0x24178d){return logger[_0xd56b('0xd')]('stop\x20traverse');}if(this[_0xd56b('0x9')][_0x3a6328][_0xd56b('0xf')]===0x0){return logger[_0xd56b('0xd')]('no\x20edge/s\x20available');}for(var _0x2c1b27=0x0,_0x12e220=[],_0x4334cf=![];_0x2c1b27<this[_0xd56b('0x9')][_0x3a6328]['length'];_0x2c1b27+=0x1){if(this[_0xd56b('0x9')][_0x3a6328][_0x2c1b27][_0xd56b('0x10')]){_0x12e220=this[_0xd56b('0x9')][_0x3a6328][_0x2c1b27][_0xd56b('0x10')][_0xd56b('0x11')](',');for(var _0x1bce9e=0x0;_0x1bce9e<_0x12e220['length'];_0x1bce9e+=0x1){if(this[_0xd56b('0x4')][_0x3a6328][_0xd56b('0x12')]===_0xd56b('0x13')&&_0x12e220[_0x1bce9e]==='-'){_0x4334cf=this['edges'][_0x3a6328][_0x2c1b27][_0xd56b('0x14')];logger[_0xd56b('0xd')](_0xd56b('0x15'),_0x12e220[_0x1bce9e],this['edges'][_0x3a6328][_0x2c1b27][_0xd56b('0x14')]);}else if(this['vertices'][_0x3a6328][_0xd56b('0x12')]==='menu'&&_0x12e220[_0x1bce9e]==='i'){_0x4334cf=this['edges'][_0x3a6328][_0x2c1b27][_0xd56b('0x14')];logger[_0xd56b('0xd')](_0xd56b('0x16'),_0x12e220[_0x1bce9e],this[_0xd56b('0x9')][_0x3a6328][_0x2c1b27][_0xd56b('0x14')]);}if(_0x12e220[_0x1bce9e]===_0x24178d){return this[_0xd56b('0xc')](this[_0xd56b('0x9')][_0x3a6328][_0x2c1b27][_0xd56b('0x14')],_0x56d9cf);}}}else{return this['traverseBFS'](this['edges'][_0x3a6328][_0x2c1b27][_0xd56b('0x14')],_0x56d9cf);}}if(_0x12e220[_0xd56b('0xf')]){if(this[_0xd56b('0x4')][_0x3a6328][_0xd56b('0x12')]==='vswitch'){if(_0x4334cf){return this[_0xd56b('0xc')](_0x4334cf,_0x56d9cf);}return logger[_0xd56b('0xd')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0xd56b('0x17')](verticesWithRetry,this[_0xd56b('0x4')][_0x3a6328][_0xd56b('0x12')])){if(_0x24178d==='-'){return logger[_0xd56b('0xd')](_0xd56b('0x18'));}if(_0x4334cf&&_0x24178d!=='t'){return this[_0xd56b('0xc')](_0x4334cf,_0x56d9cf);}return this[_0xd56b('0xc')](_0x3a6328,_0x56d9cf);}return logger['info'](_0xd56b('0x19'));}};module[_0xd56b('0x1a')]=Graph;
\ No newline at end of file
+var _0xff03=['../../../config/logger','agi','menu','vertices','edges','numberOfEdges','prototype','addVertex','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','agicommand','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash'];(function(_0x44de5c,_0x2983ae){var _0x1bb293=function(_0x19b6a4){while(--_0x19b6a4){_0x44de5c['push'](_0x44de5c['shift']());}};_0x1bb293(++_0x2983ae);}(_0xff03,0x143));var _0x3ff0=function(_0x79bf24,_0x63139d){_0x79bf24=_0x79bf24-0x0;var _0x35d78e=_0xff03[_0x79bf24];return _0x35d78e;};'use strict';var _=require(_0x3ff0('0x0'));var logger=require(_0x3ff0('0x1'))(_0x3ff0('0x2'));var verticesWithRetry=[_0x3ff0('0x3'),'getdigits','getsecretdigits'];var Graph=function(){this[_0x3ff0('0x4')]={};this[_0x3ff0('0x5')]={};this[_0x3ff0('0x6')]=0x0;};Graph[_0x3ff0('0x7')][_0x3ff0('0x8')]=function(_0x22f371){this[_0x3ff0('0x4')][_0x22f371['id']]=_0x22f371;this[_0x3ff0('0x5')][_0x22f371['id']]=[];};Graph['prototype']['addEdge']=function(_0x174dab,_0x2d2152,_0x2cb86c){this[_0x3ff0('0x5')][_0x174dab]['push']({'target':_0x2d2152,'condition':_0x2cb86c});this[_0x3ff0('0x6')]+=0x1;};Graph[_0x3ff0('0x7')]['size']=function(){return _[_0x3ff0('0x9')](this[_0x3ff0('0x4')]);};Graph[_0x3ff0('0x7')][_0x3ff0('0xa')]=function(){return this[_0x3ff0('0x6')];};Graph['prototype'][_0x3ff0('0xb')]=function(_0x45407d){return this[_0x3ff0('0x4')][_0x45407d];};Graph['prototype'][_0x3ff0('0xc')]=function(_0x28b864,_0x1dddef){if(!this[_0x3ff0('0x4')][_0x28b864]){return logger['info'](_0x3ff0('0xd'));}var _0x3ee8c8=_0x1dddef(this['vertices'][_0x28b864]);if(!_0x3ee8c8){return logger[_0x3ff0('0xe')](_0x3ff0('0xf'));}if(this[_0x3ff0('0x5')][_0x28b864][_0x3ff0('0x10')]===0x0){return logger['info'](_0x3ff0('0x11'));}for(var _0x2cc54c=0x0,_0x2dfb4f=[],_0x284032=![];_0x2cc54c<this[_0x3ff0('0x5')][_0x28b864][_0x3ff0('0x10')];_0x2cc54c+=0x1){if(this['edges'][_0x28b864][_0x2cc54c][_0x3ff0('0x12')]){_0x2dfb4f=this['edges'][_0x28b864][_0x2cc54c]['condition'][_0x3ff0('0x13')](',');for(var _0x1bde09=0x0;_0x1bde09<_0x2dfb4f[_0x3ff0('0x10')];_0x1bde09+=0x1){if(this['vertices'][_0x28b864]['agicommand']===_0x3ff0('0x14')&&_0x2dfb4f[_0x1bde09]==='-'){_0x284032=this[_0x3ff0('0x5')][_0x28b864][_0x2cc54c][_0x3ff0('0x15')];logger[_0x3ff0('0xe')]('default',_0x2dfb4f[_0x1bde09],this[_0x3ff0('0x5')][_0x28b864][_0x2cc54c][_0x3ff0('0x15')]);}else if(this['vertices'][_0x28b864]['agicommand']==='menu'&&_0x2dfb4f[_0x1bde09]==='i'){_0x284032=this[_0x3ff0('0x5')][_0x28b864][_0x2cc54c]['target'];logger[_0x3ff0('0xe')]('invalid',_0x2dfb4f[_0x1bde09],this[_0x3ff0('0x5')][_0x28b864][_0x2cc54c]['target']);}if(_0x2dfb4f[_0x1bde09]===_0x3ee8c8){return this[_0x3ff0('0xc')](this['edges'][_0x28b864][_0x2cc54c][_0x3ff0('0x15')],_0x1dddef);}}}else{return this[_0x3ff0('0xc')](this['edges'][_0x28b864][_0x2cc54c]['target'],_0x1dddef);}}if(_0x2dfb4f['length']){if(this[_0x3ff0('0x4')][_0x28b864][_0x3ff0('0x16')]==='vswitch'){if(_0x284032){return this[_0x3ff0('0xc')](_0x284032,_0x1dddef);}return logger[_0x3ff0('0xe')](_0x3ff0('0x17'));}else if(_[_0x3ff0('0x18')](verticesWithRetry,this[_0x3ff0('0x4')][_0x28b864][_0x3ff0('0x16')])){if(_0x3ee8c8==='-'){return logger[_0x3ff0('0xe')]('max\x20retry\x20reach');}if(_0x284032&&_0x3ee8c8!=='t'){return this['traverseBFS'](_0x284032,_0x1dddef);}return this[_0x3ff0('0xc')](_0x28b864,_0x1dddef);}return logger[_0x3ff0('0xe')](_0x3ff0('0x19'));}};module[_0x3ff0('0x1a')]=Graph;
\ No newline at end of file
index 09c1482..76f1378 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fd5=['gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','isUndefined','result','toString','finally','traverseBFS','clear','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','error','[%s]\x20%s','name','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','production','stringify','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','start','vertex'];(function(_0x33634e,_0x5d8c2f){var _0x4479ac=function(_0x248273){while(--_0x248273){_0x33634e['push'](_0x33634e['shift']());}};_0x4479ac(++_0x5d8c2f);}(_0x4fd5,0x194));var _0x54fd=function(_0x1e5e0d,_0x27e87c){_0x1e5e0d=_0x1e5e0d-0x0;var _0x394c90=_0x4fd5[_0x1e5e0d];return _0x394c90;};'use strict';var parser=require(_0x54fd('0x0'));var _=require(_0x54fd('0x1'));var syncho=require('syncho');var util=require(_0x54fd('0x2'));var moment=require('moment');var config=require(_0x54fd('0x3'));var logger=require(_0x54fd('0x4'))(_0x54fd('0x5'));var utilLicense=require(_0x54fd('0x6'));var rpc=require('./rpc');var mailRpc=require(_0x54fd('0x7'));var Graph=require(_0x54fd('0x8'));var Vertices=require(_0x54fd('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x54fd('0x5')]=_['defaults'](config[_0x54fd('0x5')],{'ip':_0x54fd('0xa'),'port':0x11dd});function connectionHandler(_0x2da5ce){process[_0x54fd('0xb')](function(){syncho(function(){try{setChannelVariables(_0x2da5ce);agiHandler(_0x2da5ce);}catch(_0x53b670){logger['error'](_0x53b670['stack']);}});});}function listeningHandler(){console[_0x54fd('0xc')](_0x54fd('0xd'),config['agi'][_0x54fd('0xe')]);logger[_0x54fd('0xf')](util[_0x54fd('0x10')](_0x54fd('0x11'),config['agi']['ip'],config[_0x54fd('0x5')][_0x54fd('0xe')]));}function errorHandler(_0x4f9d45){if(_0x4f9d45&&_0x4f9d45['name']&&_0x4f9d45[_0x54fd('0x12')]){logger[_0x54fd('0x13')](util['format'](_0x54fd('0x14'),_0x4f9d45[_0x54fd('0x15')],_0x4f9d45[_0x54fd('0x12')]));}else{logger[_0x54fd('0x13')](util['format'](_0x54fd('0x16'),_0x4f9d45[_0x54fd('0x17')]));}}function closeHandler(){logger['info'](util[_0x54fd('0x10')](_0x54fd('0x18'),this[_0x54fd('0x19')],this['calleridname'],this['callerid'],this[_0x54fd('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x198d50){logger[_0x54fd('0x13')](_0x198d50[_0x54fd('0x17')]);}}function timeoutHandler(){logger[_0x54fd('0xf')](util[_0x54fd('0x10')](_0x54fd('0x1b'),this['arg_1'],this[_0x54fd('0x1c')],this[_0x54fd('0x1d')],this[_0x54fd('0x1a')],this[_0x54fd('0x1e')]));}function hangupHandler(){logger[_0x54fd('0xf')](util[_0x54fd('0x10')](_0x54fd('0x1f'),this['arg_1'],this['calleridname'],this[_0x54fd('0x1d')],this[_0x54fd('0x1a')],this[_0x54fd('0x1e')]));this['evtHangup']=!![];}function getRoot(_0x396089){return parser[_0x54fd('0x20')](_0x396089,{'object':!![]})[_0x54fd('0x21')][_0x54fd('0x22')];}function addVertex(_0x519403,_0x37f36d,_0xfc09af){_0x37f36d[_0x54fd('0x23')]=_0xfc09af;if(_0x37f36d[_0x54fd('0x24')](_0x54fd('0x25'))){_0x37f36d['maxRetry']=parseInt(_0x37f36d[_0x54fd('0x25')],0xa);}_0x519403[_0x54fd('0x26')](_[_0x54fd('0x27')](_0x37f36d,_0x54fd('0x28')));}function initGraph(_0x3f8b93,_0x4cb893){var _0x40e71b=new Graph();for(var _0x5b90b8 in _0x3f8b93){if(_0x3f8b93['hasOwnProperty'](_0x5b90b8)){if(_[_0x54fd('0x29')](_0x3f8b93[_0x5b90b8])){for(var _0x521e35=0x0;_0x521e35<_0x3f8b93[_0x5b90b8]['length'];_0x521e35+=0x1){addVertex(_0x40e71b,_0x3f8b93[_0x5b90b8][_0x521e35],_0x5b90b8);}}else{addVertex(_0x40e71b,_0x3f8b93[_0x5b90b8],_0x5b90b8);}}}for(var _0x1af19c=0x0;_0x1af19c<_0x4cb893[_0x54fd('0x2a')];_0x1af19c+=0x1){if(_0x4cb893[_0x1af19c][_0x54fd('0x2b')]&&_0x4cb893[_0x1af19c][_0x54fd('0x2c')]){_0x40e71b[_0x54fd('0x2d')](_0x4cb893[_0x1af19c][_0x54fd('0x2b')],_0x4cb893[_0x1af19c][_0x54fd('0x2c')],_0x4cb893[_0x1af19c][_0x54fd('0x2e')]);}}return _0x40e71b;}function getSquareProject(_0x3d24bb,_0x400072){rpc[_0x54fd('0x2f')](_0x3d24bb)[_0x54fd('0x30')](function(_0x5c57b5){_0x400072(null,_0x5c57b5);})[_0x54fd('0x31')](function(_0x33f6e6){_0x400072(null,_0x33f6e6);});}function createSquareReport(_0x4d56e7,_0x4bcb69){rpc[_0x54fd('0x32')](_0x4d56e7)[_0x54fd('0x30')](function(_0x306250){if(_0x4bcb69){_0x4bcb69(null,_0x306250);}})[_0x54fd('0x31')](function(_0x35e0c7){if(_0x4bcb69){_0x4bcb69(null,_0x35e0c7);}});}function setChannelVariables(_0x4af013){for(var _0x4e8702 in _0x4af013){if(_0x4af013['hasOwnProperty'](_0x4e8702)){if(_0x4e8702[_0x54fd('0x33')](_0x54fd('0x34'))===0x0){_0x4af013[_0x4e8702[_0x54fd('0x35')](0x4)]=_0x4af013[_0x4e8702];delete _0x4af013[_0x4e8702];}}}}function getLogFromObject(_0x344aa5){return util[_0x54fd('0x36')](_0x344aa5,{'showHidden':![],'depth':null});}function agiHandler(_0x1cbd73){var _0x1ab0d6,_0x1d5c38,_0x18823e,_0x38bba7,_0x78baba;logger[_0x54fd('0x37')]('variables',JSON['stringify'](_0x1cbd73,null,0x2));logger[_0x54fd('0xf')](util[_0x54fd('0x10')](_0x54fd('0x38'),_0x1cbd73[_0x54fd('0x19')],_0x1cbd73[_0x54fd('0x1c')],_0x1cbd73[_0x54fd('0x1d')],_0x1cbd73['dnid'],_0x1cbd73['uniqueid']));_0x1cbd73['on'](_0x54fd('0x13'),errorHandler);_0x1cbd73['on'](_0x54fd('0x39'),closeHandler);_0x1cbd73['on']('timeout',timeoutHandler);_0x1cbd73['evtHangup']=![];_0x1cbd73['on'](_0x54fd('0x3a'),hangupHandler);var _0x3162ad=getSquareProject['sync'](null,_0x1cbd73[_0x54fd('0x19')]);if(_0x3162ad){if(_0x3162ad[_0x54fd('0x3b')]){_0x1ab0d6=getRoot(_0x3162ad['production']);if(_0x1ab0d6&&_0x1ab0d6['start']){logger[_0x54fd('0x37')](_0x54fd('0x22'),JSON[_0x54fd('0x3c')](_0x1ab0d6,null,0x2));_0x1cbd73[_0x54fd('0x3d')]=moment()[_0x54fd('0x10')](_0x54fd('0x3e'));_0x1d5c38=initGraph(_[_0x54fd('0x27')](_0x1ab0d6,_0x54fd('0x28')),_0x1ab0d6['mxCell']);_0x18823e=new Vertices(_0x1cbd73,rpc,mailRpc);logger[_0x54fd('0xf')](util['format'](_0x54fd('0x3f'),_0x1cbd73['arg_1'],_0x1cbd73[_0x54fd('0x1c')],_0x1cbd73[_0x54fd('0x1d')],_0x1cbd73[_0x54fd('0x1a')],_0x1cbd73[_0x54fd('0x1e')]));_0x1d5c38['traverseBFS'](_0x1ab0d6[_0x54fd('0x40')]['id'],function(_0x2fec1c){try{_0x2fec1c=_0x18823e['clear'](_0x2fec1c);logger[_0x54fd('0x37')](_0x54fd('0x41'),JSON[_0x54fd('0x3c')](_0x2fec1c,null,0x2));if(_0x2fec1c['agicommand']===_0x54fd('0x42')){logger[_0x54fd('0xf')](_0x54fd('0x43'));_0x1cbd73[_0x54fd('0x44')]=_0x2fec1c[_0x54fd('0x44')]||_0x1cbd73[_0x54fd('0x44')];_0x1cbd73[_0x54fd('0x45')]=_0x2fec1c[_0x54fd('0x45')];_0x1cbd73[_0x54fd('0x46')]=_0x2fec1c[_0x54fd('0x46')]?_0x2fec1c[_0x54fd('0x46')]-0x1:0x1;return null;}else if(_0x2fec1c&&_0x18823e[_0x2fec1c['agicommand']]){_0x78baba=_0x18823e[_0x2fec1c[_0x54fd('0x23')]](_0x2fec1c);logger[_0x54fd('0xf')](_0x54fd('0x47'),JSON['stringify'](_0x78baba,null,0x2));if(_0x78baba&&_0x78baba[_0x54fd('0x48')]===AGI_CODE_SUCCESS&&_0x78baba['result']!==AGI_RESULT_ERROR&&!_0x1cbd73[_0x54fd('0x49')]){logger[_0x54fd('0x37')](_0x54fd('0x47'),getLogFromObject(_0x78baba));return _[_0x54fd('0x4a')](_0x78baba[_0x54fd('0x4b')])?null:_0x78baba[_0x54fd('0x4b')][_0x54fd('0x4c')]();}else{logger[_0x54fd('0x13')]('response',getLogFromObject(_0x78baba));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x466153){logger[_0x54fd('0x13')](_0x466153[_0x54fd('0x17')]);return null;}});if(_0x1ab0d6[_0x54fd('0x4d')]){logger[_0x54fd('0xf')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1cbd73[_0x54fd('0x19')],_0x1cbd73[_0x54fd('0x1c')],_0x1cbd73['callerid'],_0x1cbd73[_0x54fd('0x1a')],_0x1cbd73[_0x54fd('0x1e')]));_0x1d5c38[_0x54fd('0x4e')](_0x1ab0d6['finally']['id'],function(_0x537213){try{_0x537213=_0x18823e[_0x54fd('0x4f')](_0x537213);logger['debug']('vertex',JSON[_0x54fd('0x3c')](_0x537213,null,0x2));if(_0x537213&&_0x18823e[_0x537213[_0x54fd('0x23')]]){_0x78baba=_0x18823e[_0x537213[_0x54fd('0x23')]](_0x537213);if(_0x78baba){logger['debug'](_0x54fd('0x47'),getLogFromObject(_0x78baba));return _['isUndefined'](_0x78baba['result'])?null:_0x78baba[_0x54fd('0x4b')][_0x54fd('0x4c')]();}else{logger[_0x54fd('0x13')](_0x54fd('0x47'),getLogFromObject(_0x78baba));return null;}}else{logger[_0x54fd('0x13')]('agicommand\x20not\x20found');return null;}}catch(_0x24b28c){logger[_0x54fd('0x13')](_0x24b28c['stack']);return null;}});}logger[_0x54fd('0xf')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1cbd73[_0x54fd('0x19')],_0x1cbd73[_0x54fd('0x1c')],_0x1cbd73[_0x54fd('0x1d')],_0x1cbd73[_0x54fd('0x1a')],_0x1cbd73[_0x54fd('0x1e')]));logger[_0x54fd('0xf')](util[_0x54fd('0x10')](_0x54fd('0x50'),_0x1cbd73[_0x54fd('0x44')],_0x1cbd73[_0x54fd('0x45')],parseInt(_0x1cbd73['priority'],0xa)+0x1));_0x1cbd73[_0x54fd('0x51')](_0x1cbd73[_0x54fd('0x44')],_0x1cbd73[_0x54fd('0x45')],parseInt(_0x1cbd73[_0x54fd('0x46')],0xa)+0x1);_0x1cbd73[_0x54fd('0x39')]();}}else{logger['error'](util[_0x54fd('0x10')](_0x54fd('0x52'),_0x1cbd73['arg_1']));_0x1cbd73['continueAt'](_0x1cbd73[_0x54fd('0x44')],_0x1cbd73[_0x54fd('0x45')],parseInt(_0x1cbd73[_0x54fd('0x46')],0xa)+0x1);_0x1cbd73[_0x54fd('0x39')]();}}else{logger[_0x54fd('0x13')](util[_0x54fd('0x10')](_0x54fd('0x53'),_0x1cbd73['arg_1']));_0x1cbd73['continueAt'](_0x1cbd73[_0x54fd('0x44')],_0x1cbd73[_0x54fd('0x45')],parseInt(_0x1cbd73[_0x54fd('0x46')],0xa)+0x1);_0x1cbd73[_0x54fd('0x39')]();}}function main(){var _0x1ed674;return utilLicense[_0x54fd('0x54')]()['then'](function(_0x369948){if(_0x369948){if(_0x369948[_0x54fd('0x55')]){if(_0x369948[_0x54fd('0x56')]&&_0x369948[_0x54fd('0x56')]>0x0){logger['info'](util['format'](_0x54fd('0x57'),_0x369948['callysquare']));_0x1ed674=_0x369948['callysquare'];}else{logger['info'](_0x54fd('0x58'));}}else{logger[_0x54fd('0xf')](_0x54fd('0x59'));_0x1ed674=-0x1;}}})[_0x54fd('0x31')](function(_0x52b219){logger[_0x54fd('0x13')](_0x54fd('0x5a'),_0x52b219[_0x54fd('0x17')]);})['finally'](function(){var _0x4a072b=require(_0x54fd('0x5b'))(config['agi']['port'],config[_0x54fd('0x5')]['ip'],_0x1ed674);_0x4a072b['on'](_0x54fd('0x13'),errorHandler);_0x4a072b['on'](_0x54fd('0x5c'),listeningHandler);_0x4a072b['on'](_0x54fd('0x5d'),connectionHandler);_0x4a072b['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0x8261=['hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','target','then','catch','createSquareReport','agi_','inspect','debug','variables','stringify','close','timeout','hangup','sync','production','start','joinAt','traverseBFS','clear','vertex','gotoc','context','extension','priority','result','response','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[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','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','syncho','util','../../config/environment','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','agi','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','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','calleridname','dnid','uniqueid','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','evtHangup','toJson','mxGraphModel','root','agicommand'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x8261,0x89));var _0x1826=function(_0x5b83c9,_0x121086){_0x5b83c9=_0x5b83c9-0x0;var _0x31f8e5=_0x8261[_0x5b83c9];return _0x31f8e5;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x1826('0x0'));var util=require(_0x1826('0x1'));var moment=require('moment');var config=require(_0x1826('0x2'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0x1826('0x3'));var rpc=require(_0x1826('0x4'));var mailRpc=require(_0x1826('0x5'));var Graph=require(_0x1826('0x6'));var Vertices=require(_0x1826('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x1826('0x8')]=_['defaults'](config['agi'],{'ip':_0x1826('0x9'),'port':0x11dd});function connectionHandler(_0x4db8d5){process[_0x1826('0xa')](function(){syncho(function(){try{setChannelVariables(_0x4db8d5);agiHandler(_0x4db8d5);}catch(_0x371eae){logger[_0x1826('0xb')](_0x371eae[_0x1826('0xc')]);}});});}function listeningHandler(){console['log'](_0x1826('0xd'),config[_0x1826('0x8')][_0x1826('0xe')]);logger[_0x1826('0xf')](util[_0x1826('0x10')](_0x1826('0x11'),config[_0x1826('0x8')]['ip'],config['agi'][_0x1826('0xe')]));}function errorHandler(_0x2f891d){if(_0x2f891d&&_0x2f891d[_0x1826('0x12')]&&_0x2f891d['message']){logger['error'](util[_0x1826('0x10')]('[%s]\x20%s',_0x2f891d[_0x1826('0x12')],_0x2f891d[_0x1826('0x13')]));}else{logger['error'](util[_0x1826('0x10')](_0x1826('0x14'),_0x2f891d[_0x1826('0xc')]));}}function closeHandler(){logger[_0x1826('0xf')](util[_0x1826('0x10')](_0x1826('0x15'),this['arg_1'],this[_0x1826('0x16')],this['callerid'],this[_0x1826('0x17')],this[_0x1826('0x18')]));try{createSquareReport(this);}catch(_0x5f1da8){logger[_0x1826('0xb')](_0x5f1da8['stack']);}}function timeoutHandler(){logger[_0x1826('0xf')](util[_0x1826('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1826('0x19')],this[_0x1826('0x16')],this['callerid'],this[_0x1826('0x17')],this[_0x1826('0x18')]));}function hangupHandler(){logger[_0x1826('0xf')](util[_0x1826('0x10')](_0x1826('0x1a'),this[_0x1826('0x19')],this['calleridname'],this[_0x1826('0x1b')],this[_0x1826('0x17')],this[_0x1826('0x18')]));this[_0x1826('0x1c')]=!![];}function getRoot(_0x44916e){return parser[_0x1826('0x1d')](_0x44916e,{'object':!![]})[_0x1826('0x1e')][_0x1826('0x1f')];}function addVertex(_0x2e04cd,_0x27034e,_0x4f3345){_0x27034e[_0x1826('0x20')]=_0x4f3345;if(_0x27034e[_0x1826('0x21')](_0x1826('0x22'))){_0x27034e[_0x1826('0x23')]=parseInt(_0x27034e[_0x1826('0x22')],0xa);}_0x2e04cd[_0x1826('0x24')](_['omit'](_0x27034e,_0x1826('0x25')));}function initGraph(_0x5b91dc,_0x2317bc){var _0xcfa13d=new Graph();for(var _0x3bb58c in _0x5b91dc){if(_0x5b91dc['hasOwnProperty'](_0x3bb58c)){if(_[_0x1826('0x26')](_0x5b91dc[_0x3bb58c])){for(var _0x5a4ff0=0x0;_0x5a4ff0<_0x5b91dc[_0x3bb58c][_0x1826('0x27')];_0x5a4ff0+=0x1){addVertex(_0xcfa13d,_0x5b91dc[_0x3bb58c][_0x5a4ff0],_0x3bb58c);}}else{addVertex(_0xcfa13d,_0x5b91dc[_0x3bb58c],_0x3bb58c);}}}for(var _0x2b0b55=0x0;_0x2b0b55<_0x2317bc[_0x1826('0x27')];_0x2b0b55+=0x1){if(_0x2317bc[_0x2b0b55]['source']&&_0x2317bc[_0x2b0b55][_0x1826('0x28')]){_0xcfa13d['addEdge'](_0x2317bc[_0x2b0b55]['source'],_0x2317bc[_0x2b0b55]['target'],_0x2317bc[_0x2b0b55]['value']);}}return _0xcfa13d;}function getSquareProject(_0xbf70d9,_0x28966a){rpc['getSquareProject'](_0xbf70d9)[_0x1826('0x29')](function(_0x1f7f22){_0x28966a(null,_0x1f7f22);})[_0x1826('0x2a')](function(_0x32093d){_0x28966a(null,_0x32093d);});}function createSquareReport(_0x21f690,_0x549ffa){rpc[_0x1826('0x2b')](_0x21f690)[_0x1826('0x29')](function(_0x3bc34e){if(_0x549ffa){_0x549ffa(null,_0x3bc34e);}})['catch'](function(_0x129441){if(_0x549ffa){_0x549ffa(null,_0x129441);}});}function setChannelVariables(_0x3b06d9){for(var _0x41ab2c in _0x3b06d9){if(_0x3b06d9[_0x1826('0x21')](_0x41ab2c)){if(_0x41ab2c['indexOf'](_0x1826('0x2c'))===0x0){_0x3b06d9[_0x41ab2c['substring'](0x4)]=_0x3b06d9[_0x41ab2c];delete _0x3b06d9[_0x41ab2c];}}}}function getLogFromObject(_0xf1736e){return util[_0x1826('0x2d')](_0xf1736e,{'showHidden':![],'depth':null});}function agiHandler(_0x3c4b70){var _0xc42fc4,_0x2022dc,_0x2c5d7b,_0x28c3bc,_0x25f7ee;logger[_0x1826('0x2e')](_0x1826('0x2f'),JSON[_0x1826('0x30')](_0x3c4b70,null,0x2));logger['info'](util[_0x1826('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3c4b70[_0x1826('0x19')],_0x3c4b70[_0x1826('0x16')],_0x3c4b70[_0x1826('0x1b')],_0x3c4b70[_0x1826('0x17')],_0x3c4b70[_0x1826('0x18')]));_0x3c4b70['on'](_0x1826('0xb'),errorHandler);_0x3c4b70['on'](_0x1826('0x31'),closeHandler);_0x3c4b70['on'](_0x1826('0x32'),timeoutHandler);_0x3c4b70['evtHangup']=![];_0x3c4b70['on'](_0x1826('0x33'),hangupHandler);var _0x3d324c=getSquareProject[_0x1826('0x34')](null,_0x3c4b70['arg_1']);if(_0x3d324c){if(_0x3d324c[_0x1826('0x35')]){_0xc42fc4=getRoot(_0x3d324c[_0x1826('0x35')]);if(_0xc42fc4&&_0xc42fc4[_0x1826('0x36')]){logger['debug'](_0x1826('0x1f'),JSON['stringify'](_0xc42fc4,null,0x2));_0x3c4b70[_0x1826('0x37')]=moment()[_0x1826('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x2022dc=initGraph(_['omit'](_0xc42fc4,'mxCell'),_0xc42fc4[_0x1826('0x25')]);_0x2c5d7b=new Vertices(_0x3c4b70,rpc,mailRpc);logger[_0x1826('0xf')](util[_0x1826('0x10')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3c4b70[_0x1826('0x19')],_0x3c4b70[_0x1826('0x16')],_0x3c4b70[_0x1826('0x1b')],_0x3c4b70[_0x1826('0x17')],_0x3c4b70[_0x1826('0x18')]));_0x2022dc[_0x1826('0x38')](_0xc42fc4[_0x1826('0x36')]['id'],function(_0x1e64cd){try{_0x1e64cd=_0x2c5d7b[_0x1826('0x39')](_0x1e64cd);logger[_0x1826('0x2e')](_0x1826('0x3a'),JSON[_0x1826('0x30')](_0x1e64cd,null,0x2));if(_0x1e64cd[_0x1826('0x20')]===_0x1826('0x3b')){logger[_0x1826('0xf')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3c4b70['context']=_0x1e64cd[_0x1826('0x3c')]||_0x3c4b70['context'];_0x3c4b70[_0x1826('0x3d')]=_0x1e64cd['extension'];_0x3c4b70['priority']=_0x1e64cd[_0x1826('0x3e')]?_0x1e64cd[_0x1826('0x3e')]-0x1:0x1;return null;}else if(_0x1e64cd&&_0x2c5d7b[_0x1e64cd[_0x1826('0x20')]]){_0x25f7ee=_0x2c5d7b[_0x1e64cd['agicommand']](_0x1e64cd);logger['info']('response',JSON['stringify'](_0x25f7ee,null,0x2));if(_0x25f7ee&&_0x25f7ee['code']===AGI_CODE_SUCCESS&&_0x25f7ee[_0x1826('0x3f')]!==AGI_RESULT_ERROR&&!_0x3c4b70['evtHangup']){logger[_0x1826('0x2e')](_0x1826('0x40'),getLogFromObject(_0x25f7ee));return _[_0x1826('0x41')](_0x25f7ee['result'])?null:_0x25f7ee[_0x1826('0x3f')][_0x1826('0x42')]();}else{logger['error'](_0x1826('0x40'),getLogFromObject(_0x25f7ee));return null;}}else{logger[_0x1826('0xb')](_0x1826('0x43'));return null;}}catch(_0x4a8550){logger[_0x1826('0xb')](_0x4a8550[_0x1826('0xc')]);return null;}});if(_0xc42fc4[_0x1826('0x44')]){logger['info'](util[_0x1826('0x10')](_0x1826('0x45'),_0x3c4b70[_0x1826('0x19')],_0x3c4b70[_0x1826('0x16')],_0x3c4b70['callerid'],_0x3c4b70['dnid'],_0x3c4b70[_0x1826('0x18')]));_0x2022dc[_0x1826('0x38')](_0xc42fc4[_0x1826('0x44')]['id'],function(_0x44e0fb){try{_0x44e0fb=_0x2c5d7b['clear'](_0x44e0fb);logger[_0x1826('0x2e')](_0x1826('0x3a'),JSON[_0x1826('0x30')](_0x44e0fb,null,0x2));if(_0x44e0fb&&_0x2c5d7b[_0x44e0fb[_0x1826('0x20')]]){_0x25f7ee=_0x2c5d7b[_0x44e0fb[_0x1826('0x20')]](_0x44e0fb);if(_0x25f7ee){logger[_0x1826('0x2e')](_0x1826('0x40'),getLogFromObject(_0x25f7ee));return _[_0x1826('0x41')](_0x25f7ee[_0x1826('0x3f')])?null:_0x25f7ee[_0x1826('0x3f')][_0x1826('0x42')]();}else{logger[_0x1826('0xb')](_0x1826('0x40'),getLogFromObject(_0x25f7ee));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x35ab30){logger[_0x1826('0xb')](_0x35ab30[_0x1826('0xc')]);return null;}});}logger[_0x1826('0xf')](util[_0x1826('0x10')](_0x1826('0x46'),_0x3c4b70['arg_1'],_0x3c4b70['calleridname'],_0x3c4b70[_0x1826('0x1b')],_0x3c4b70[_0x1826('0x17')],_0x3c4b70[_0x1826('0x18')]));logger[_0x1826('0xf')](util[_0x1826('0x10')](_0x1826('0x47'),_0x3c4b70['context'],_0x3c4b70[_0x1826('0x3d')],parseInt(_0x3c4b70['priority'],0xa)+0x1));_0x3c4b70['continueAt'](_0x3c4b70['context'],_0x3c4b70[_0x1826('0x3d')],parseInt(_0x3c4b70['priority'],0xa)+0x1);_0x3c4b70[_0x1826('0x31')]();}}else{logger[_0x1826('0xb')](util[_0x1826('0x10')](_0x1826('0x48'),_0x3c4b70['arg_1']));_0x3c4b70[_0x1826('0x49')](_0x3c4b70[_0x1826('0x3c')],_0x3c4b70[_0x1826('0x3d')],parseInt(_0x3c4b70[_0x1826('0x3e')],0xa)+0x1);_0x3c4b70[_0x1826('0x31')]();}}else{logger[_0x1826('0xb')](util[_0x1826('0x10')](_0x1826('0x4a'),_0x3c4b70[_0x1826('0x19')]));_0x3c4b70['continueAt'](_0x3c4b70[_0x1826('0x3c')],_0x3c4b70[_0x1826('0x3d')],parseInt(_0x3c4b70[_0x1826('0x3e')],0xa)+0x1);_0x3c4b70['close']();}}function main(){var _0x1798e3;return utilLicense[_0x1826('0x4b')]()[_0x1826('0x29')](function(_0x5846a4){if(_0x5846a4){if(_0x5846a4[_0x1826('0x4c')]){if(_0x5846a4[_0x1826('0x4d')]&&_0x5846a4[_0x1826('0x4d')]>0x0){logger[_0x1826('0xf')](util[_0x1826('0x10')](_0x1826('0x4e'),_0x5846a4['callysquare']));_0x1798e3=_0x5846a4[_0x1826('0x4d')];}else{logger[_0x1826('0xf')](_0x1826('0x4f'));}}else{logger[_0x1826('0xf')](_0x1826('0x50'));_0x1798e3=-0x1;}}})[_0x1826('0x2a')](function(_0x1e526c){logger[_0x1826('0xb')](_0x1826('0x51'),_0x1e526c[_0x1826('0xc')]);})[_0x1826('0x44')](function(){var _0x275b6b=require(_0x1826('0x52'))(config[_0x1826('0x8')][_0x1826('0xe')],config[_0x1826('0x8')]['ip'],_0x1798e3);_0x275b6b['on']('error',errorHandler);_0x275b6b['on'](_0x1826('0x53'),listeningHandler);_0x275b6b['on'](_0x1826('0x54'),connectionHandler);_0x275b6b['on']('close',closeHandler);});}main();
\ No newline at end of file
index da3b5d2..f60404c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x772d=['bluebird','jayson/promise','client','http','request','error','result','catch','SendMail'];(function(_0x5731a1,_0x40fbff){var _0x1fe580=function(_0x1ad52e){while(--_0x1ad52e){_0x5731a1['push'](_0x5731a1['shift']());}};_0x1fe580(++_0x40fbff);}(_0x772d,0xb4));var _0xd772=function(_0x1f5a3e,_0x416421){_0x1f5a3e=_0x1f5a3e-0x0;var _0x372b71=_0x772d[_0x1f5a3e];return _0x372b71;};'use strict';var BPromise=require(_0xd772('0x0'));var jayson=require(_0xd772('0x1'));var client=jayson[_0xd772('0x2')][_0xd772('0x3')]({'port':0x232b});function request(_0x572253,_0x19689b){return new BPromise(function(_0x37d006,_0x215556){return client[_0xd772('0x4')](_0x572253,_0x19689b)['then'](function(_0x18c42a){if(_0x18c42a['error']){return _0x215556(_0x18c42a[_0xd772('0x5')]['message']);}else{return _0x37d006(_0x18c42a[_0xd772('0x6')]);}})[_0xd772('0x7')](function(_0x3cc9b3){return _0x215556(_0x3cc9b3);});});}exports['sendMailMessage']=function(_0x1e4005,_0x27f52a){return request(_0xd772('0x8'),{'account':_0x1e4005,'message':_0x27f52a});};
\ No newline at end of file
+var _0x32bf=['client','http','request','error','message','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x2c1104,_0x4cee08){var _0x48bf85=function(_0x4a7858){while(--_0x4a7858){_0x2c1104['push'](_0x2c1104['shift']());}};_0x48bf85(++_0x4cee08);}(_0x32bf,0x11e));var _0xf32b=function(_0x201c2f,_0x400fc4){_0x201c2f=_0x201c2f-0x0;var _0x1b973a=_0x32bf[_0x201c2f];return _0x1b973a;};'use strict';var BPromise=require(_0xf32b('0x0'));var jayson=require(_0xf32b('0x1'));var client=jayson[_0xf32b('0x2')][_0xf32b('0x3')]({'port':0x232b});function request(_0x4a91fa,_0x183b08){return new BPromise(function(_0x17a136,_0x22fda1){return client[_0xf32b('0x4')](_0x4a91fa,_0x183b08)['then'](function(_0x26bd3a){if(_0x26bd3a[_0xf32b('0x5')]){return _0x22fda1(_0x26bd3a[_0xf32b('0x5')][_0xf32b('0x6')]);}else{return _0x17a136(_0x26bd3a['result']);}})[_0xf32b('0x7')](function(_0x1fcf75){return _0x22fda1(_0x1fcf75);});});}exports[_0xf32b('0x8')]=function(_0x3007e8,_0x2af52f){return request('SendMail',{'account':_0x3007e8,'message':_0x2af52f});};
\ No newline at end of file
index 6f64827..f82f586 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa311=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','substring','split','slice','trim','emit','indexOf','line','length','exports','util','stream','Transform','_localBuffer','_inBody'];(function(_0x390829,_0x58b2be){var _0x321edc=function(_0x299d70){while(--_0x299d70){_0x390829['push'](_0x390829['shift']());}};_0x321edc(++_0x58b2be);}(_0xa311,0x118));var _0x1a31=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xa311[_0x8c1005];return _0x175354;};'use strict';var util=require(_0x1a31('0x0'));var Transform=require(_0x1a31('0x1'))[_0x1a31('0x2')];function AGIReply(_0x7e4962){Transform['call'](this,_0x7e4962);this[_0x1a31('0x3')]='';this[_0x1a31('0x4')]=![];}util[_0x1a31('0x5')](AGIReply,Transform);AGIReply[_0x1a31('0x6')][_0x1a31('0x7')]=function(_0x406e30,_0x1fee75,_0x38c7da){var _0x3ceaf5='\x0a',_0x483245=['\x0a\x0a',_0x1a31('0x8')],_0x4d7bf0=-0x1,_0x4d5109=-0x1,_0x18cabe='',_0x94c910=0x0,_0x1e54dc='',_0x4c41f4='';this[_0x1a31('0x3')]+=_0x406e30[_0x1a31('0x9')]();_0x1e54dc=this['_localBuffer'];if(!this[_0x1a31('0x4')]){_0x94c910=0x0;while(_0x483245[_0x94c910]){while((_0x4d5109=_0x1e54dc['indexOf'](_0x483245[_0x94c910]))!=-0x1){_0x18cabe=_0x483245[_0x94c910];_0x4c41f4=_0x1e54dc[_0x1a31('0xa')](0x0,_0x4d5109);_0x1e54dc=_0x1e54dc[_0x1a31('0xa')](_0x4d5109+_0x18cabe['length']);var _0x4498ac=_0x4c41f4[_0x1a31('0xb')](_0x3ceaf5),_0x55418f=0x0,_0x410947={},_0x416a66='',_0x17946f='',_0x87e9ac=-0x1;while(_0x4498ac[_0x55418f]){_0x87e9ac=_0x4498ac[_0x55418f]['indexOf'](':');if(_0x87e9ac!=-0x1){_0x416a66=_0x4498ac[_0x55418f][_0x1a31('0xc')](0x0,_0x87e9ac)[_0x1a31('0xd')]();_0x17946f=_0x4498ac[_0x55418f]['slice'](_0x87e9ac+0x1)[_0x1a31('0xd')]();if(_0x416a66['length']>0x0){_0x410947[_0x416a66]=_0x17946f;}}else{}_0x55418f++;}this[_0x1a31('0xe')]('headers',_0x410947);this[_0x1a31('0x4')]=!![];}_0x94c910++;}this[_0x1a31('0x3')]=_0x1e54dc;}else{while((_0x4d7bf0=_0x1e54dc[_0x1a31('0xf')](_0x3ceaf5))!=-0x1){_0x4c41f4=_0x1e54dc['substring'](0x0,_0x4d7bf0);this['emit'](_0x1a31('0x10'),_0x4c41f4);_0x1e54dc=_0x1e54dc[_0x1a31('0xa')](_0x4d7bf0+_0x3ceaf5[_0x1a31('0x11')]);}this[_0x1a31('0x3')]=_0x1e54dc;}_0x38c7da();};module[_0x1a31('0x12')]=AGIReply;
\ No newline at end of file
+var _0x8912=['trim','emit','headers','substring','line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','indexOf','length','split','slice'];(function(_0xf46b1c,_0x3e8408){var _0xda1d66=function(_0x12ec30){while(--_0x12ec30){_0xf46b1c['push'](_0xf46b1c['shift']());}};_0xda1d66(++_0x3e8408);}(_0x8912,0xc4));var _0x2891=function(_0x4507de,_0x2b3caa){_0x4507de=_0x4507de-0x0;var _0x2229c5=_0x8912[_0x4507de];return _0x2229c5;};'use strict';var util=require(_0x2891('0x0'));var Transform=require(_0x2891('0x1'))[_0x2891('0x2')];function AGIReply(_0x12ecb2){Transform[_0x2891('0x3')](this,_0x12ecb2);this[_0x2891('0x4')]='';this[_0x2891('0x5')]=![];}util[_0x2891('0x6')](AGIReply,Transform);AGIReply[_0x2891('0x7')][_0x2891('0x8')]=function(_0x397cdc,_0x18cad1,_0x1dbe95){var _0x1c62e5='\x0a',_0x5982a8=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x142a0e=-0x1,_0x3d460d=-0x1,_0xc45f27='',_0x5630e2=0x0,_0x17bac0='',_0x3f1110='';this[_0x2891('0x4')]+=_0x397cdc['toString']();_0x17bac0=this['_localBuffer'];if(!this[_0x2891('0x5')]){_0x5630e2=0x0;while(_0x5982a8[_0x5630e2]){while((_0x3d460d=_0x17bac0[_0x2891('0x9')](_0x5982a8[_0x5630e2]))!=-0x1){_0xc45f27=_0x5982a8[_0x5630e2];_0x3f1110=_0x17bac0['substring'](0x0,_0x3d460d);_0x17bac0=_0x17bac0['substring'](_0x3d460d+_0xc45f27[_0x2891('0xa')]);var _0xb8f64=_0x3f1110[_0x2891('0xb')](_0x1c62e5),_0x4e566b=0x0,_0x2d3a23={},_0xe944d9='',_0x400310='',_0x417bc7=-0x1;while(_0xb8f64[_0x4e566b]){_0x417bc7=_0xb8f64[_0x4e566b][_0x2891('0x9')](':');if(_0x417bc7!=-0x1){_0xe944d9=_0xb8f64[_0x4e566b][_0x2891('0xc')](0x0,_0x417bc7)[_0x2891('0xd')]();_0x400310=_0xb8f64[_0x4e566b]['slice'](_0x417bc7+0x1)[_0x2891('0xd')]();if(_0xe944d9[_0x2891('0xa')]>0x0){_0x2d3a23[_0xe944d9]=_0x400310;}}else{}_0x4e566b++;}this[_0x2891('0xe')](_0x2891('0xf'),_0x2d3a23);this[_0x2891('0x5')]=!![];}_0x5630e2++;}this[_0x2891('0x4')]=_0x17bac0;}else{while((_0x142a0e=_0x17bac0[_0x2891('0x9')](_0x1c62e5))!=-0x1){_0x3f1110=_0x17bac0[_0x2891('0x10')](0x0,_0x142a0e);this[_0x2891('0xe')](_0x2891('0x11'),_0x3f1110);_0x17bac0=_0x17bac0[_0x2891('0x10')](_0x142a0e+_0x1c62e5[_0x2891('0xa')]);}this[_0x2891('0x4')]=_0x17bac0;}_0x1dbe95();};module[_0x2891('0x12')]=AGIReply;
\ No newline at end of file
index fbe4f95..e66ee59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aad=['production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','dsn','getUserById','ShowUser','getTrunkById','getSoundById','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','request','then','error','result','catch','ShowSquareProject'];(function(_0x40b798,_0x3a83a7){var _0x323106=function(_0x36cb5b){while(--_0x36cb5b){_0x40b798['push'](_0x40b798['shift']());}};_0x323106(++_0x3a83a7);}(_0x0aad,0x1ac));var _0xd0aa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0aad[_0x40a045];return _0x1a687c;};'use strict';var BPromise=require(_0xd0aa('0x0'));var moment=require(_0xd0aa('0x1'));var _=require(_0xd0aa('0x2'));var util=require('util');var jayson=require(_0xd0aa('0x3'));var client=jayson[_0xd0aa('0x4')][_0xd0aa('0x5')]({'port':0x2329});function request(_0x252b34,_0x3839b1){return new BPromise(function(_0x5cd6ba,_0x245c3d){return client[_0xd0aa('0x6')](_0x252b34,_0x3839b1)[_0xd0aa('0x7')](function(_0x44fd5e){if(_0x44fd5e['error']){return _0x245c3d(_0x44fd5e[_0xd0aa('0x8')]['message']);}else{return _0x5cd6ba(_0x44fd5e[_0xd0aa('0x9')]);}})[_0xd0aa('0xa')](function(_0xa04ae7){return _0x245c3d(_0xa04ae7);});});}exports['getSquareProject']=function(_0x5820e9){return request(_0xd0aa('0xb'),{'options':{'raw':![],'where':{'name':_0x5820e9},'attributes':[_0xd0aa('0xc')]}});};exports[_0xd0aa('0xd')]=function(_0x99e56f){return request(_0xd0aa('0xe'),{'options':{'raw':![],'where':{'id':_0x99e56f},'include':[{'model':_0xd0aa('0xf'),'as':_0xd0aa('0x10')}],'attributes':['id',_0xd0aa('0x11'),'email']}});};exports[_0xd0aa('0x12')]=function(_0xd2a4e8){return request(_0xd0aa('0xb'),{'options':{'where':{'id':_0xd2a4e8},'attributes':['name']}});};exports[_0xd0aa('0x13')]=function(_0x42b4ec){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x42b4ec},'attributes':[_0xd0aa('0x11')]}});};exports[_0xd0aa('0x14')]=function(_0x469c0c){return request(_0xd0aa('0x15'),{'options':{'where':{'id':_0x469c0c},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x25c639){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x25c639},'attributes':[_0xd0aa('0x16')]}});};exports[_0xd0aa('0x17')]=function(_0x218d3d){return request(_0xd0aa('0x18'),{'options':{'where':{'id':_0x218d3d},'attributes':[_0xd0aa('0x11')]}});};exports[_0xd0aa('0x19')]=function(_0x46e776){return request('ShowTrunk',{'options':{'where':{'id':_0x46e776},'attributes':[_0xd0aa('0x11')]}});};exports[_0xd0aa('0x1a')]=function(_0x3fe58b){return request('ShowSound',{'options':{'where':{'id':_0x3fe58b},'attributes':['save_name']}});};exports[_0xd0aa('0x1b')]=function(_0x50de21){return request(_0xd0aa('0x1c'),{'options':{'raw':![],'where':{'id':_0x50de21},'include':[{'model':_0xd0aa('0x1d'),'as':_0xd0aa('0x1e')}]}});};exports[_0xd0aa('0x1f')]=function(_0x2726ab){return request(_0xd0aa('0x20'),{'options':{'where':{'id':_0x2726ab},'attributes':['id',_0xd0aa('0x11')]}});};exports[_0xd0aa('0x21')]=function(_0x4dea14){return request(_0xd0aa('0x22'),{'body':_0x4dea14});};exports['createSquareDetailsReport']=function(_0x30fd50){return request(_0xd0aa('0x23'),{'body':_0x30fd50});};exports['createSquareReport']=function(_0x2cd99b){return request(_0xd0aa('0x24'),{'body':_[_0xd0aa('0x25')](_0x2cd99b,{'project_name':_0x2cd99b[_0xd0aa('0x26')],'prev_project_name':_0x2cd99b[_0xd0aa('0x27')]||'','is_subproject':_0x2cd99b[_0xd0aa('0x27')]?!![]:![],'leaveAt':moment()[_0xd0aa('0x28')](_0xd0aa('0x29'))})});};exports[_0xd0aa('0x2a')]=function(_0x42dc95){return request(_0xd0aa('0x2b'),{'body':_0x42dc95});};exports[_0xd0aa('0x2c')]=function(_0x4f8f52){return request('CreateSquareMessage',{'body':_0x4f8f52});};exports['createCmContact']=function(_0x5a5486){return request(_0xd0aa('0x2d'),{'options':{'raw':![],'where':{'phone':_0x5a5486['phone'],'ListId':_0x5a5486[_0xd0aa('0x2e')]}}})[_0xd0aa('0x7')](function(_0x51e69b){if(_0x51e69b){return _0x51e69b;}return request(_0xd0aa('0x2f'),{'body':_0x5a5486});});};exports[_0xd0aa('0x30')]=function(_0x42d048){return request(_0xd0aa('0x31'),{'options':{'where':{'id':_0x42d048},'attributes':['name']}});};exports[_0xd0aa('0x32')]=function(_0xbdfc47,_0x2a41b7){return request('LoginUser',{'body':{'interface':_0x2a41b7},'options':{'where':_0xbdfc47}});};exports['agentPause']=function(_0x5f4c82,_0x697593,_0x34209b){return request('PauseUser',{'body':{'type':_0x697593,'uniqueid':_0x34209b},'options':{'where':_0x5f4c82}});};exports[_0xd0aa('0x33')]=function(_0x5dd3aa){return request(_0xd0aa('0x34'),{'body':{},'options':{'where':_0x5dd3aa}});};exports[_0xd0aa('0x35')]=function(_0xe4a25e){return request(_0xd0aa('0x36'),{'body':{},'options':{'where':_0xe4a25e}});};
\ No newline at end of file
+var _0x916b=['message','catch','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','ShowUser','ShowSound','save_name','getIntervalById','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','phone','ListId','getPauseById','ShowPause','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','bluebird','lodash','util','jayson/promise','http','then','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x916b,0xf8));var _0xb916=function(_0x4934fd,_0x13c8ed){_0x4934fd=_0x4934fd-0x0;var _0x3c4b1d=_0x916b[_0x4934fd];return _0x3c4b1d;};'use strict';var BPromise=require(_0xb916('0x0'));var moment=require('moment');var _=require(_0xb916('0x1'));var util=require(_0xb916('0x2'));var jayson=require(_0xb916('0x3'));var client=jayson['client'][_0xb916('0x4')]({'port':0x2329});function request(_0x6cce49,_0xf76e50){return new BPromise(function(_0x273b35,_0x3ee1d1){return client['request'](_0x6cce49,_0xf76e50)[_0xb916('0x5')](function(_0x2dc0ed){if(_0x2dc0ed[_0xb916('0x6')]){return _0x3ee1d1(_0x2dc0ed['error'][_0xb916('0x7')]);}else{return _0x273b35(_0x2dc0ed['result']);}})[_0xb916('0x8')](function(_0x3d3e19){return _0x3ee1d1(_0x3d3e19);});});}exports['getSquareProject']=function(_0x36a558){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x36a558},'attributes':['production']}});};exports[_0xb916('0x9')]=function(_0x6654ec){return request(_0xb916('0xa'),{'options':{'raw':![],'where':{'id':_0x6654ec},'include':[{'model':_0xb916('0xb'),'as':'Smtp'}],'attributes':['id',_0xb916('0xc'),_0xb916('0xd')]}});};exports[_0xb916('0xe')]=function(_0xb990fb){return request(_0xb916('0xf'),{'options':{'where':{'id':_0xb990fb},'attributes':['name']}});};exports[_0xb916('0x10')]=function(_0x3d3c6b){return request(_0xb916('0x11'),{'options':{'where':{'id':_0x3d3c6b},'attributes':[_0xb916('0xc')]}});};exports['getVariableById']=function(_0x180847){return request(_0xb916('0x12'),{'options':{'where':{'id':_0x180847},'attributes':[_0xb916('0xc')]}});};exports[_0xb916('0x13')]=function(_0x57592d){return request(_0xb916('0x14'),{'options':{'where':{'id':_0x57592d},'attributes':['dsn']}});};exports['getUserById']=function(_0x58be22){return request(_0xb916('0x15'),{'options':{'where':{'id':_0x58be22},'attributes':[_0xb916('0xc')]}});};exports['getTrunkById']=function(_0x4ffbfc){return request('ShowTrunk',{'options':{'where':{'id':_0x4ffbfc},'attributes':[_0xb916('0xc')]}});};exports['getSoundById']=function(_0x30c1a9){return request(_0xb916('0x16'),{'options':{'where':{'id':_0x30c1a9},'attributes':[_0xb916('0x17')]}});};exports[_0xb916('0x18')]=function(_0x31e457){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x31e457},'include':[{'model':_0xb916('0x19'),'as':'Intervals'}]}});};exports[_0xb916('0x1a')]=function(_0x11f8ee){return request(_0xb916('0x1b'),{'options':{'where':{'id':_0x11f8ee},'attributes':['id',_0xb916('0xc')]}});};exports[_0xb916('0x1c')]=function(_0x28bd76){return request(_0xb916('0x1d'),{'body':_0x28bd76});};exports['createSquareDetailsReport']=function(_0x21ed21){return request(_0xb916('0x1e'),{'body':_0x21ed21});};exports[_0xb916('0x1f')]=function(_0xf6faf5){return request(_0xb916('0x20'),{'body':_[_0xb916('0x21')](_0xf6faf5,{'project_name':_0xf6faf5[_0xb916('0x22')],'prev_project_name':_0xf6faf5[_0xb916('0x23')]||'','is_subproject':_0xf6faf5[_0xb916('0x23')]?!![]:![],'leaveAt':moment()[_0xb916('0x24')](_0xb916('0x25'))})});};exports[_0xb916('0x26')]=function(_0x139b61){return request(_0xb916('0x27'),{'body':_0x139b61});};exports[_0xb916('0x28')]=function(_0xb99fc5){return request('CreateSquareMessage',{'body':_0xb99fc5});};exports[_0xb916('0x29')]=function(_0x504c47){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x504c47[_0xb916('0x2a')],'ListId':_0x504c47[_0xb916('0x2b')]}}})[_0xb916('0x5')](function(_0x9e2408){if(_0x9e2408){return _0x9e2408;}return request('CreateCmContact',{'body':_0x504c47});});};exports[_0xb916('0x2c')]=function(_0x594bf3){return request(_0xb916('0x2d'),{'options':{'where':{'id':_0x594bf3},'attributes':['name']}});};exports['agentLogin']=function(_0x5df5f2,_0x3752d3){return request(_0xb916('0x2e'),{'body':{'interface':_0x3752d3},'options':{'where':_0x5df5f2}});};exports[_0xb916('0x2f')]=function(_0x467d51,_0x3a2588,_0x5199fa){return request('PauseUser',{'body':{'type':_0x3a2588,'uniqueid':_0x5199fa},'options':{'where':_0x467d51}});};exports[_0xb916('0x30')]=function(_0x457c30){return request(_0xb916('0x31'),{'body':{},'options':{'where':_0x457c30}});};exports[_0xb916('0x32')]=function(_0x182383){return request('LogoutUser',{'body':{},'options':{'where':_0x182383}});};
\ No newline at end of file
index e6d1336..4226624 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49df=['exports'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0x49df,0xad));var _0xf49d=function(_0x3035ba,_0x2bbefc){_0x3035ba=_0x3035ba-0x0;var _0x3810f1=_0x49df[_0x3035ba];return _0x3810f1;};var polly=require('./polly');var lex=require('./lex');module[_0xf49d('0x0')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x5655=['./lex','exports','./polly'];(function(_0x427784,_0x357d9f){var _0x11985b=function(_0x173896){while(--_0x173896){_0x427784['push'](_0x427784['shift']());}};_0x11985b(++_0x357d9f);}(_0x5655,0x15e));var _0x5565=function(_0x3d0a36,_0x12a318){_0x3d0a36=_0x3d0a36-0x0;var _0x286e5b=_0x5655[_0x3d0a36];return _0x286e5b;};var polly=require(_0x5565('0x0'));var lex=require(_0x5565('0x1'));module[_0x5565('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 6dcd51b..425ed33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff3=['exports'];(function(_0x4b872c,_0x18c763){var _0x148821=function(_0x45d06d){while(--_0x45d06d){_0x4b872c['push'](_0x4b872c['shift']());}};_0x148821(++_0x18c763);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3e50bb,_0x42a32e){_0x3e50bb=_0x3e50bb-0x0;var _0x35b2e4=_0x5ff3[_0x3e50bb];return _0x35b2e4;};'use strict';var lex=require('./lib/api');module[_0x35ff('0x0')]=function(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a){return lex(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a);};
\ No newline at end of file
+var _0x750a=['exports'];(function(_0x56af11,_0x452744){var _0x3ded02=function(_0x134220){while(--_0x134220){_0x56af11['push'](_0x56af11['shift']());}};_0x3ded02(++_0x452744);}(_0x750a,0x140));var _0xa750=function(_0x2ae584,_0xd4b7e8){_0x2ae584=_0x2ae584-0x0;var _0x11e670=_0x750a[_0x2ae584];return _0x11e670;};'use strict';var lex=require('./lib/api');module[_0xa750('0x0')]=function(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f){return lex(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f);};
\ No newline at end of file
index 86a2c6b..4fda657 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x4efd6f,_0x18984){var _0x1b8afd=function(_0x2501cb){while(--_0x2501cb){_0x4efd6f['push'](_0x4efd6f['shift']());}};_0x1b8afd(++_0x18984);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x131c95,_0x3f33fb){var _0x81b062=function(_0x9b97fd){while(--_0x9b97fd){_0x131c95['push'](_0x131c95['shift']());}};_0x81b062(++_0x3f33fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 4bb44fa..b536f14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dd3=['./lib/api'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x8dd3,0x178));var _0x38dd=function(_0xcf059,_0x23ebd1){_0xcf059=_0xcf059-0x0;var _0x5bda20=_0x8dd3[_0xcf059];return _0x5bda20;};'use strict';var polly=require(_0x38dd('0x0'));module['exports']=function(_0x4631a3,_0x98be33,_0x4484f9,_0x19dcfe,_0x3f7960,_0x1d73a9,_0x597a6b){return polly(_0x4631a3,_0x98be33,_0x4484f9,_0x19dcfe,_0x3f7960,_0x1d73a9,_0x597a6b);};
\ No newline at end of file
+var _0x32eb=['exports'];(function(_0x4d4f18,_0x43608b){var _0x5b283f=function(_0x165efe){while(--_0x165efe){_0x4d4f18['push'](_0x4d4f18['shift']());}};_0x5b283f(++_0x43608b);}(_0x32eb,0x97));var _0xb32e=function(_0x79a6e8,_0x1c2b24){_0x79a6e8=_0x79a6e8-0x0;var _0xeeb993=_0x32eb[_0x79a6e8];return _0xeeb993;};'use strict';var polly=require('./lib/api');module[_0xb32e('0x0')]=function(_0x3da4dc,_0x412494,_0x2b97c5,_0x5314a7,_0xada3ae,_0x32d8d3,_0x54448d){return polly(_0x3da4dc,_0x412494,_0x2b97c5,_0x5314a7,_0xada3ae,_0x32d8d3,_0x54448d);};
\ No newline at end of file
index f78307d..c8e36d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06f3=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x3dc9f1,_0x4a6e4a){var _0xcb8639=function(_0x50d89a){while(--_0x50d89a){_0x3dc9f1['push'](_0x3dc9f1['shift']());}};_0xcb8639(++_0x4a6e4a);}(_0x06f3,0x1b1));var _0x306f=function(_0x15c8e0,_0x332c04){_0x15c8e0=_0x15c8e0-0x0;var _0xcf223b=_0x06f3[_0x15c8e0];return _0xcf223b;};'use strict';var fs=require('fs');var path=require(_0x306f('0x0'));var BPromise=require(_0x306f('0x1'));var rs=require(_0x306f('0x2'));var AWS=require(_0x306f('0x3'));function pollyResult(_0x3f684f,_0x3a7a37,_0x3f8dec){return new BPromise(function(_0x227b90,_0xb0b67c){_0x3f684f[_0x306f('0x4')](_0x3a7a37,function(_0x38a886,_0x2fa525){if(_0x38a886){_0xb0b67c(_0x38a886);}else if(_0x2fa525){if(_0x2fa525[_0x306f('0x5')]instanceof Buffer){fs[_0x306f('0x6')](_0x3f8dec,_0x2fa525['AudioStream'],function(_0x2fc0bd){if(_0x2fc0bd){_0xb0b67c(_0x2fc0bd);}else{_0x227b90();}});}else{_0xb0b67c(new Error(_0x306f('0x7')));}}else{_0xb0b67c(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x306f('0x8')]=function(_0xcb86c8,_0x154f99,_0xe3292d,_0x44588f,_0x46f193,_0x248d73,_0x5748e6){var _0x1bf65e=new AWS['Polly']({'accessKeyId':_0xcb86c8,'secretAccessKey':_0x154f99,'region':_0xe3292d});var _0x5773bb={'Text':_0x46f193,'TextType':_0x248d73||_0x306f('0x9'),'OutputFormat':'mp3','VoiceId':_0x44588f};return pollyResult(_0x1bf65e,_0x5773bb,_0x5748e6);};
\ No newline at end of file
+var _0x1401=['randomstring','synthesizeSpeech','AudioStream','writeFile','exports','Polly','text','bluebird'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1401,0x16f));var _0x1140=function(_0x1c3aa3,_0x38a01a){_0x1c3aa3=_0x1c3aa3-0x0;var _0x5252dc=_0x1401[_0x1c3aa3];return _0x5252dc;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x1140('0x0'));var rs=require(_0x1140('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x20d702,_0x400068,_0x336e8c){return new BPromise(function(_0xbe8ab0,_0x45b5e6){_0x20d702[_0x1140('0x2')](_0x400068,function(_0x466137,_0x34945d){if(_0x466137){_0x45b5e6(_0x466137);}else if(_0x34945d){if(_0x34945d[_0x1140('0x3')]instanceof Buffer){fs[_0x1140('0x4')](_0x336e8c,_0x34945d[_0x1140('0x3')],function(_0x365aaf){if(_0x365aaf){_0x45b5e6(_0x365aaf);}else{_0xbe8ab0();}});}else{_0x45b5e6(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x45b5e6(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x1140('0x5')]=function(_0x2ea29a,_0x3a5ed7,_0xaf606,_0x47e171,_0x2c81ba,_0x44c73f,_0x34b73){var _0x11dd75=new AWS[(_0x1140('0x6'))]({'accessKeyId':_0x2ea29a,'secretAccessKey':_0x3a5ed7,'region':_0xaf606});var _0x178402={'Text':_0x2c81ba,'TextType':_0x44c73f||_0x1140('0x7'),'OutputFormat':'mp3','VoiceId':_0x47e171};return pollyResult(_0x11dd75,_0x178402,_0x34b73);};
\ No newline at end of file
index 308170d..cbb2831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe611=['./lib/api'];(function(_0x126f42,_0x57f1ad){var _0x219119=function(_0xc6b727){while(--_0xc6b727){_0x126f42['push'](_0x126f42['shift']());}};_0x219119(++_0x57f1ad);}(_0xe611,0x1e5));var _0x1e61=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe611[_0x2064e5];return _0x21a233;};'use strict';var asr=require(_0x1e61('0x0'));module['exports']=function(_0x141f8f,_0x395f7a,_0x2e263b,_0x4a2138){return asr(_0x141f8f,_0x395f7a,_0x2e263b);};
\ No newline at end of file
+var _0x67fe=['./lib/api','exports'];(function(_0x45b649,_0x4ab854){var _0x117a8e=function(_0x566ce8){while(--_0x566ce8){_0x45b649['push'](_0x45b649['shift']());}};_0x117a8e(++_0x4ab854);}(_0x67fe,0x172));var _0xe67f=function(_0x5b2d6c,_0x3519d3){_0x5b2d6c=_0x5b2d6c-0x0;var _0x25ef43=_0x67fe[_0x5b2d6c];return _0x25ef43;};'use strict';var asr=require(_0xe67f('0x0'));module[_0xe67f('0x1')]=function(_0x1e67b6,_0x410f64,_0x3d7226,_0x3d544a){return asr(_0x1e67b6,_0x410f64,_0x3d7226);};
\ No newline at end of file
index 3f612f7..817b805 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7119=['base64','POST','LINEAR16','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','readFileSync'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7119,0x1c7));var _0x9711=function(_0x245545,_0x4983b3){_0x245545=_0x245545-0x0;var _0x106a5f=_0x7119[_0x245545];return _0x106a5f;};'use strict';var url=require('url');var BPromise=require(_0x9711('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x9711('0x1')]=function(_0x5843e8,_0x347925,_0x443d8f){return new BPromise(function(_0x36cd4d,_0x2de7dd){var _0x47dda0;if(typeof _0x5843e8!==_0x9711('0x2')||_0x5843e8[_0x9711('0x3')]===0x0){return _0x2de7dd(_0x9711('0x4'));}if(typeof _0x347925!==_0x9711('0x2')||_0x347925[_0x9711('0x3')]===0x0){return _0x2de7dd('key\x20should\x20be\x20a\x20string');}if(typeof _0x443d8f!==_0x9711('0x5')&&(typeof _0x443d8f!==_0x9711('0x2')||_0x443d8f[_0x9711('0x3')]===0x0)){return _0x2de7dd('lang\x20should\x20be\x20a\x20string');}try{_0x47dda0=fs[_0x9711('0x6')](_0x5843e8)['toString'](_0x9711('0x7'));}catch(_0x16e820){return _0x2de7dd(_0x16e820);}return _0x36cd4d({'method':_0x9711('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x347925,'body':{'config':{'encoding':_0x9711('0x9'),'sampleRateHertz':_0x9711('0xa'),'languageCode':_0x443d8f},'audio':{'content':_0x47dda0}},'json':!![]});});};
\ No newline at end of file
+var _0x9f62=['string','length','key\x20should\x20be\x20a\x20string','undefined','base64','LINEAR16','8000','bluebird','exports'];(function(_0xc47b52,_0x447123){var _0x3e3696=function(_0xf07b28){while(--_0xf07b28){_0xc47b52['push'](_0xc47b52['shift']());}};_0x3e3696(++_0x447123);}(_0x9f62,0x154));var _0x29f6=function(_0x3b437d,_0x1ed52a){_0x3b437d=_0x3b437d-0x0;var _0x142128=_0x9f62[_0x3b437d];return _0x142128;};'use strict';var url=require('url');var BPromise=require(_0x29f6('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x29f6('0x1')]=function(_0x254ab3,_0x548050,_0x5618b7){return new BPromise(function(_0x54d164,_0x258ddd){var _0x2f0420;if(typeof _0x254ab3!==_0x29f6('0x2')||_0x254ab3[_0x29f6('0x3')]===0x0){return _0x258ddd('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x548050!==_0x29f6('0x2')||_0x548050[_0x29f6('0x3')]===0x0){return _0x258ddd(_0x29f6('0x4'));}if(typeof _0x5618b7!==_0x29f6('0x5')&&(typeof _0x5618b7!==_0x29f6('0x2')||_0x5618b7['length']===0x0)){return _0x258ddd('lang\x20should\x20be\x20a\x20string');}try{_0x2f0420=fs['readFileSync'](_0x254ab3)['toString'](_0x29f6('0x6'));}catch(_0x44db16){return _0x258ddd(_0x44db16);}return _0x54d164({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x548050,'body':{'config':{'encoding':_0x29f6('0x7'),'sampleRateHertz':_0x29f6('0x8'),'languageCode':_0x5618b7},'audio':{'content':_0x2f0420}},'json':!![]});});};
\ No newline at end of file
index 71b82ea..5744a1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26d7=['exports','./asr'];(function(_0x39d753,_0x3b6c0d){var _0xf19b40=function(_0x16dd1d){while(--_0x16dd1d){_0x39d753['push'](_0x39d753['shift']());}};_0xf19b40(++_0x3b6c0d);}(_0x26d7,0xa9));var _0x726d=function(_0x8e313a,_0x1f445d){_0x8e313a=_0x8e313a-0x0;var _0x21a1a9=_0x26d7[_0x8e313a];return _0x21a1a9;};var asr=require(_0x726d('0x0'));module[_0x726d('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xf6df=['./asr','exports'];(function(_0x431c5b,_0x103781){var _0x3b50b5=function(_0x4b71a2){while(--_0x4b71a2){_0x431c5b['push'](_0x431c5b['shift']());}};_0x3b50b5(++_0x103781);}(_0xf6df,0x1c0));var _0xff6d=function(_0x3c1f99,_0x577f8a){_0x3c1f99=_0x3c1f99-0x0;var _0x503774=_0xf6df[_0x3c1f99];return _0x503774;};var asr=require(_0xff6d('0x0'));module[_0xff6d('0x1')]={'asr':asr};
\ No newline at end of file
index 7e7688b..3ca4b27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0581=['request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','close','error','download\x20error','pipe','end','WHAT_EVER','get','data','error\x20convert','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','then','unlink','chmodSync','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','POST','tmp','from','audioContent','writeFile','777','.wav','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','null','slice','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','textRequest','result','source','action','actionIncomplete','status','code','endConversation','metadata','isFallbackIntent','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','awsPolly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','path','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','statusCode'];(function(_0xe6a006,_0x224617){var _0x159cbd=function(_0x287f2b){while(--_0x287f2b){_0xe6a006['push'](_0xe6a006['shift']());}};_0x159cbd(++_0x224617);}(_0x0581,0xf0));var _0x1058=function(_0xb011d6,_0x74d4eb){_0xb011d6=_0xb011d6-0x0;var _0x1e30f1=_0x0581[_0xb011d6];return _0x1e30f1;};'use strict';var apiai=require(_0x1058('0x0'));var BPromise=require(_0x1058('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x1058('0x2'));var https=require(_0x1058('0x3'));var md5=require(_0x1058('0x4'));var path=require(_0x1058('0x5'));var querystring=require('querystring');var rp=require(_0x1058('0x6'));var rs=require(_0x1058('0x7'));var sox=require(_0x1058('0x8'));var tts=require(_0x1058('0x9'));var urlParse=require('url')[_0x1058('0xa')];var util=require(_0x1058('0xb'));var aws=require(_0x1058('0xc'));var google=require(_0x1058('0xd'));var sestek=require(_0x1058('0xe'));var tilde=require(_0x1058('0xf'));var logger=require(_0x1058('0x10'))(_0x1058('0x11'));var ISPEECH_API=_0x1058('0x12');function downloadFile(_0x3b8212,_0x45f157){return new BPromise(function(_0x3b998f,_0x77616d){var _0x212b90=urlParse(_0x3b8212);var _0x4e5723=_0x212b90[_0x1058('0x13')]==='https:'?https:http;var _0x54a3ca={'host':_0x212b90[_0x1058('0x14')],'path':_0x212b90[_0x1058('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x4e5723['get'](_0x54a3ca,function(_0x217e07){if(_0x217e07[_0x1058('0x15')]!==0xc8){logger['error'](_0x1058('0x16')+_0x3b8212+_0x1058('0x17')+_0x217e07['statusCode']+'\x20('+_0x217e07[_0x1058('0x18')]+')');_0x77616d(new Error(_0x1058('0x16')+_0x3b8212+'\x20failed,\x20status\x20code\x20=\x20'+_0x217e07['statusCode']+'\x20('+_0x217e07['statusMessage']+')'));return;}var _0x2f95da=fs[_0x1058('0x19')](_0x45f157);_0x2f95da['on']('finish',function(){logger[_0x1058('0x1a')]('finish\x20download\x20file');_0x2f95da[_0x1058('0x1b')](_0x3b998f);});_0x2f95da['on'](_0x1058('0x1c'),function(_0x285b42){fs['unlink'](_0x45f157);logger['error'](_0x1058('0x1d'),_0x285b42);_0x77616d(_0x285b42);});_0x217e07[_0x1058('0x1e')](_0x2f95da);})['on'](_0x1058('0x1c'),function(_0xad620f){logger[_0x1058('0x1c')](_0xad620f);_0x77616d(_0xad620f);})[_0x1058('0x1f')]();});}function uploadFile(_0x57e140){return new BPromise(function(_0x3b51d7,_0x2f208e){var _0x5441ad=urlParse(_0x57e140);var _0x3bb6c7=_0x5441ad[_0x1058('0x13')]==='https:'?https:http;var _0x2a03e0={'host':_0x5441ad[_0x1058('0x14')],'path':_0x5441ad[_0x1058('0x5')],'headers':{'user-agent':_0x1058('0x20')}};_0x3bb6c7[_0x1058('0x21')](_0x2a03e0,function(_0x25e69a){if(_0x25e69a[_0x1058('0x15')]!==0xc8){_0x2f208e(new Error(_0x1058('0x16')+_0x57e140+'\x20failed,\x20status\x20code\x20=\x20'+_0x25e69a[_0x1058('0x15')]+'\x20('+_0x25e69a[_0x1058('0x18')]+')'));return;}var _0x5bf8ca='';_0x25e69a['on'](_0x1058('0x22'),function(_0x28dd6e){_0x5bf8ca+=_0x28dd6e;});_0x25e69a['on'](_0x1058('0x1f'),function(){_0x3b51d7(_0x5bf8ca);});})['on'](_0x1058('0x1c'),function(_0x49575c){_0x2f208e(_0x49575c);})[_0x1058('0x1f')]();});}function convertFile(_0x5c6387,_0x54a9d8){return new BPromise(function(_0x2ac9cc,_0xcb15c8){var _0x48fff7=sox['transcode'](_0x5c6387,_0x54a9d8,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x48fff7['on'](_0x1058('0x1c'),function(_0x2b2954){logger[_0x1058('0x1c')](_0x1058('0x23'),_0x2b2954);_0xcb15c8(_0x2b2954);});_0x48fff7['on']('end',function(){logger[_0x1058('0x1a')](_0x1058('0x24'));_0x2ac9cc();});_0x48fff7[_0x1058('0x25')]();});}function base64Decode(_0x366b75,_0x433344){var _0x1a7cdc=path[_0x1058('0x26')](__dirname,'tmp',rs[_0x1058('0x27')](0x4)+'.wav');fs[_0x1058('0x28')](_0x1a7cdc,_0x366b75,_0x1058('0x29'));return convertFile(_0x1a7cdc,_0x433344)[_0x1058('0x2a')](function(){try{fs[_0x1058('0x2b')](_0x1a7cdc);fs[_0x1058('0x2c')](_0x433344,'777');}catch(_0x5125d7){logger['error'](_0x5125d7);}return _0x433344['split']('.')[0x0];});}function base64Encode(_0x312966){var _0x49d708=fs[_0x1058('0x2d')](_0x312966);return new Buffer(_0x49d708)[_0x1058('0x2e')]('base64');}exports[_0x1058('0x2f')]=function(_0x4ccbb1,_0x3a6c0f,_0x4887a6,_0x2799a5,_0x10683a,_0x24edd9){var _0x2163f6,_0x355213;var _0x139470=_0x1058('0x30');var _0x544f28='?key='+_0x4ccbb1;var _0x208f17={};if(_0x3a6c0f===_0x1058('0x31')){_0x208f17['input']={'ssml':_0x4887a6};}else{_0x208f17[_0x1058('0x32')]={'text':_0x4887a6};};_0x208f17[_0x1058('0x33')]={'languageCode':_0x2799a5,'ssmlGender':_0x10683a};_0x208f17[_0x1058('0x34')]={'audioEncoding':_0x1058('0x35'),'sampleRateHertz':0x1f40};var _0x58f797={'url':_0x139470+'text:synthesize'+_0x544f28,'method':_0x1058('0x36'),'json':!![],'body':_0x208f17};return rp(_0x58f797)[_0x1058('0x2a')](function(_0x3f4906){return new BPromise(function(_0x315688,_0x5d4990){_0x2163f6=path[_0x1058('0x26')](__dirname,_0x1058('0x37'),rs[_0x1058('0x27')](0x4)+'.mp3');var _0x37cf92=Buffer[_0x1058('0x38')](_0x3f4906[_0x1058('0x39')],_0x1058('0x29'));return fs[_0x1058('0x3a')](_0x2163f6,_0x37cf92,function(_0x558d96){_0x5d4990(_0x558d96);},function(_0x5c0b66){fs[_0x1058('0x2c')](_0x2163f6,_0x1058('0x3b'));_0x315688(_0x5c0b66);});});})[_0x1058('0x2a')](function(_0x233b37){_0x355213=path['resolve'](__dirname,_0x1058('0x37'),rs[_0x1058('0x27')](0x4)+_0x1058('0x3c'));return convertFile(_0x2163f6,_0x355213);})['then'](function(){try{fs[_0x1058('0x2b')](_0x2163f6);fs['chmodSync'](_0x355213,'777');}catch(_0x560b0b){logger[_0x1058('0x1c')](_0x560b0b);}logger['info']('googleCloudTTS\x20path',_0x355213['split']('.')[0x0]);return _0x355213[_0x1058('0x3d')]('.')[0x0];});};exports['googleTTS']=function(_0x13798a,_0x3dba02){var _0x243b44=_0x1058('0x3e');var _0x32824f,_0x32e0aa;var _0x255792;var _0x23c338={'encoding':_0x1058('0x3f'),'method':_0x1058('0x36'),'timeout':0x2710,'url':_0x243b44,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x1058('0x40')]([[['jQ1olc',JSON[_0x1058('0x40')]([_0x13798a,_0x3dba02||'en',![],_0x1058('0x41')]),null,'generic']]]))};return rp(_0x23c338)['then'](function(_0x3a332f){try{_0x255792=eval(_0x3a332f[_0x1058('0x42')](0x5))[0x0][0x2];}catch(_0x2dd0e1){throw new Error(_0x1058('0x43')+_0x3a332f[_0x1058('0x22')]);}if(!_0x255792){if(_0x13798a['length']>0xc8){throw new Error(_0x1058('0x44'));}else{throw new Error(_0x1058('0x45')+_0x3dba02+_0x1058('0x46'));}}try{_0x255792=eval(_0x255792)[0x0];}catch(_0x24da5e){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x1058('0x22')]);}const _0x54320c=_0x255792;_0x32824f=path[_0x1058('0x26')](__dirname,_0x1058('0x37'),rs[_0x1058('0x27')](0x4)+_0x1058('0x47'));fs[_0x1058('0x28')](_0x32824f,_0x255792,{'encoding':_0x1058('0x29')});_0x32e0aa=path[_0x1058('0x26')](__dirname,_0x1058('0x37'),rs[_0x1058('0x27')](0x4)+_0x1058('0x3c'));return convertFile(_0x32824f,_0x32e0aa);})['then'](function(){try{fs[_0x1058('0x2b')](_0x32824f);fs[_0x1058('0x2c')](_0x32e0aa,_0x1058('0x3b'));}catch(_0x36070a){logger[_0x1058('0x1c')](_0x36070a);}logger['info'](_0x1058('0x48'),_0x32e0aa[_0x1058('0x3d')]('.')[0x0]);return _0x32e0aa[_0x1058('0x3d')]('.')[0x0];});};exports[_0x1058('0x49')]=function(_0x552af1,_0x42728f,_0x2ad36f){return google[_0x1058('0x4a')](_0x552af1,_0x42728f,_0x2ad36f)[_0x1058('0x2a')](function(_0x55ac2f){logger[_0x1058('0x1a')](_0x55ac2f[_0x1058('0x4b')]);return rp(_0x55ac2f);})[_0x1058('0x2a')](function(_0x3caea5){var _0x599ef0='';var _0x37461b=0x0;try{fs[_0x1058('0x2b')](_0x552af1);}catch(_0xf92092){logger[_0x1058('0x1c')](_0xf92092);}if(_0x3caea5&&_0x3caea5[_0x1058('0x4c')]){_0x599ef0=_0x3caea5[_0x1058('0x4c')][_0x1058('0x4d')](function(_0x15c05c){return _0x15c05c&&_0x15c05c[_0x1058('0x4e')][0x0]&&_0x15c05c[_0x1058('0x4e')][0x0]['transcript']?_0x15c05c[_0x1058('0x4e')][0x0][_0x1058('0x4f')]:'';})[_0x1058('0x50')]('\x0a');_0x37461b=_0x3caea5['results']['map'](function(_0xee64e3){return _0xee64e3&&_0xee64e3['alternatives'][0x0]&&_0xee64e3[_0x1058('0x4e')][0x0][_0x1058('0x51')]?_0xee64e3[_0x1058('0x4e')][0x0][_0x1058('0x51')]:0x0;})[_0x1058('0x50')]('\x0a');}logger[_0x1058('0x1a')](_0x1058('0x52'),_0x599ef0);logger['info'](_0x1058('0x53'),_0x37461b);return{'transcript':_0x599ef0,'confidence':_0x37461b};})[_0x1058('0x54')](function(_0x3046df){logger[_0x1058('0x1c')]('[%s]\x20%s:%s',_0x3046df[_0x1058('0x15')],_0x3046df['name'],_0x3046df[_0x1058('0x55')]);});};exports['googleDialogflow']=function(_0x1a458a,_0x587021,_0x5ac3fb,_0x4fc613){var _0x152c4b=apiai(_0x587021,{'language':_0x4fc613||'en'});return _0x152c4b[_0x1058('0x56')](_0x5ac3fb,{'sessionId':md5(_0x1a458a)})[_0x1058('0x2a')](function(_0x1e7613){logger[_0x1058('0x1a')](JSON[_0x1058('0x40')](_0x1e7613));return{'source':_0x1e7613[_0x1058('0x57')][_0x1058('0x58')],'resolvedQuery':_0x1e7613[_0x1058('0x57')]['resolvedQuery'],'action':_0x1e7613[_0x1058('0x57')][_0x1058('0x59')],'actionIncomplete':_0x1e7613[_0x1058('0x57')][_0x1058('0x5a')],'speech':_0x1e7613[_0x1058('0x57')]['fulfillment']['speech'],'score':_0x1e7613[_0x1058('0x57')]['score'],'statusCode':_0x1e7613[_0x1058('0x5b')][_0x1058('0x5c')],'endConversation':_0x1e7613['result']['metadata'][_0x1058('0x5d')]||![],'isFallbackIntent':_0x1e7613['result'][_0x1058('0x5e')][_0x1058('0x5f')]};});};exports['googleDialogflowV2']=function(_0x575291,_0x350461,_0x206950,_0x215dcb,_0x38ba38,_0x558663){var _0x261682=_0x215dcb['replace'](/\\n/g,'\x0a');var _0x19e7dd={'credentials':{'private_key':_0x261682,'client_email':_0x206950}};var _0x44c365=new dialogflow[(_0x1058('0x60'))](_0x19e7dd);var _0x45ab1c=_0x44c365[_0x1058('0x61')](_0x350461,md5(_0x575291));var _0x49c582={'session':_0x45ab1c,'queryInput':{'text':{'text':_0x38ba38,'languageCode':_0x558663}}};return _0x44c365[_0x1058('0x62')](_0x49c582)[_0x1058('0x2a')](function(_0x16ca2a){if(_0x16ca2a&&_0x16ca2a['length']){logger['info'](_0x1058('0x63'),JSON[_0x1058('0x40')](_0x16ca2a));var _0x38b1d6=_0x16ca2a[0x0];if(_0x38b1d6){var _0xf9e6c9={'action':_0x38b1d6[_0x1058('0x64')][_0x1058('0x59')],'allRequiredParamsPresent':_0x38b1d6[_0x1058('0x64')]['allRequiredParamsPresent'],'endConversation':_0x38b1d6[_0x1058('0x64')][_0x1058('0x65')]&&_0x38b1d6[_0x1058('0x64')][_0x1058('0x65')][_0x1058('0x66')]?_0x38b1d6[_0x1058('0x64')]['diagnosticInfo']['fields'][_0x1058('0x67')][_0x1058('0x68')]:![],'fulfillmentText':_0x38b1d6['queryResult'][_0x1058('0x69')],'intentName':_0x38b1d6['queryResult'][_0x1058('0x6a')]['name'],'intentDisplayName':_0x38b1d6['queryResult'][_0x1058('0x6a')][_0x1058('0x6b')],'isFallbackIntent':_0x38b1d6[_0x1058('0x64')][_0x1058('0x6a')][_0x1058('0x6c')],'languageCode':_0x38b1d6[_0x1058('0x64')][_0x1058('0x6d')],'queryText':_0x38b1d6['queryResult'][_0x1058('0x6e')],'responseId':_0x38b1d6[_0x1058('0x6f')],'score':_0x38b1d6[_0x1058('0x64')][_0x1058('0x70')],'speech':_0x38b1d6[_0x1058('0x64')][_0x1058('0x69')],'providerResponse':JSON[_0x1058('0x40')](_0x16ca2a)};return _0xf9e6c9;}}});};exports[_0x1058('0x71')]=function(_0x3ef185,_0x3ea5e9,_0x28b5db,_0x192286){return tilde['asr'](_0x3ef185,_0x3ea5e9,_0x28b5db,_0x192286)[_0x1058('0x2a')](function(_0x5d53cb){try{fs[_0x1058('0x2b')](_0x3ef185);}catch(_0x342ec2){logger[_0x1058('0x1c')](_0x342ec2);}logger[_0x1058('0x1a')]('Tilde\x20ASR\x20transcription',_0x5d53cb[_0x1058('0x4f')]);logger['info']('Tilde\x20ASR\x20confidence',_0x5d53cb[_0x1058('0x51')]);return _0x5d53cb;});};exports[_0x1058('0x72')]=function(_0x4f9fc0,_0x46cce8,_0x4c0391,_0x2d4857,_0x380ae5,_0x2e324e){var _0x42a0f3=path[_0x1058('0x26')](__dirname,_0x1058('0x37'),rs[_0x1058('0x27')](0x4)+_0x1058('0x47'));var _0x373da6;return aws['polly'](_0x4f9fc0,_0x46cce8,_0x4c0391,_0x2d4857,_0x380ae5,_0x2e324e,_0x42a0f3)[_0x1058('0x2a')](function(){_0x373da6=path['resolve'](__dirname,_0x1058('0x37'),rs[_0x1058('0x27')](0x4)+'.wav');return convertFile(_0x42a0f3,_0x373da6);})[_0x1058('0x2a')](function(){try{fs[_0x1058('0x2b')](_0x42a0f3);fs[_0x1058('0x2c')](_0x373da6,_0x1058('0x3b'));}catch(_0x359cb7){logger[_0x1058('0x1c')](_0x359cb7);}return _0x373da6[_0x1058('0x3d')]('.')[0x0];});};exports[_0x1058('0x73')]=function(_0x3a7b54,_0x2d0600,_0x311005,_0x55b06e,_0x36803e,_0x3939ea){return aws[_0x1058('0x74')](_0x3a7b54,_0x2d0600,_0x311005,_0x55b06e,_0x36803e,_0x3939ea)['then'](function(_0x2ec1ce){logger[_0x1058('0x1a')](JSON['stringify'](_0x2ec1ce));return _0x2ec1ce;});};exports['ispeechTTS']=function(_0x2b28b6,_0x52887b,_0x4ab779,_0x3518bf){var _0x420a69=util[_0x1058('0x75')](_0x1058('0x76'),ISPEECH_API,_0x2b28b6,encodeURIComponent(_0x52887b),_0x4ab779,_0x3518bf);var _0x217c73=path[_0x1058('0x26')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x47914e;return downloadFile(_0x420a69,_0x217c73)[_0x1058('0x2a')](function(){_0x47914e=path[_0x1058('0x26')](__dirname,_0x1058('0x37'),rs[_0x1058('0x27')](0x4)+_0x1058('0x3c'));return convertFile(_0x217c73,_0x47914e);})[_0x1058('0x2a')](function(){try{fs[_0x1058('0x2b')](_0x217c73);fs[_0x1058('0x2c')](_0x47914e,_0x1058('0x3b'));}catch(_0x1590f7){logger[_0x1058('0x1c')](_0x1590f7);}return _0x47914e[_0x1058('0x3d')]('.')[0x0];});};exports[_0x1058('0x77')]=function(_0x16b3ef,_0x82541d,_0x2c95a1,_0xe2e344){var _0x1f4d05=util['format'](_0x1058('0x78'),ISPEECH_API,_0x82541d,_0x2c95a1,base64Encode(_0x16b3ef),_0xe2e344?util['format'](_0x1058('0x79'),encodeURIComponent(_0xe2e344)):'freeform=3');return uploadFile(_0x1f4d05)[_0x1058('0x2a')](function(_0x41f3d3){return querystring[_0x1058('0xa')](_0x41f3d3);});};exports[_0x1058('0x7a')]=function(_0x212374,_0x5ef623){return sestek[_0x1058('0x7b')](_0x212374,_0x5ef623)[_0x1058('0x2a')](function(_0x458353){logger[_0x1058('0x1a')](JSON[_0x1058('0x40')](_0x458353));var _0x13dd4c={'speech':_0x458353['text'],'action':_0x458353[_0x1058('0x7c')]?_0x458353[_0x1058('0x7c')][_0x1058('0x7d')]:undefined,'actiondata':_0x458353[_0x1058('0x7c')]?_0x458353['channelData'][_0x1058('0x7e')]:undefined};if(_0x458353['channelData']&&_0x458353[_0x1058('0x7c')]['AudioFromTts']){return base64Decode(_0x458353[_0x1058('0x7c')][_0x1058('0x7f')][_0x1058('0x80')],path['resolve'](__dirname,_0x1058('0x37'),rs['generate'](0x4)+_0x1058('0x3c')))['then'](function(_0x1dad2a){_0x13dd4c[_0x1058('0x81')]=_0x1dad2a;return _0x13dd4c;});}return _0x13dd4c;});};exports[_0x1058('0x82')]=function(){return __dirname;};
\ No newline at end of file
+var _0xa4d3=['model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','http','https','querystring','request-promise','google-tts-api','url','parse','util','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','error','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','path','WHAT_EVER','get','statusCode','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','base64','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','input','MP3','text:synthesize','POST','then','generate','.mp3','from','audioContent','writeFile','split','utf8','f.req=','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','writeFileSync','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','stringify','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s'];(function(_0x4150e6,_0x345b50){var _0x1a039d=function(_0x3bf8cb){while(--_0x3bf8cb){_0x4150e6['push'](_0x4150e6['shift']());}};_0x1a039d(++_0x345b50);}(_0xa4d3,0x11b));var _0x3a4d=function(_0x23813b,_0x55f947){_0x23813b=_0x23813b-0x0;var _0x318a80=_0xa4d3[_0x23813b];return _0x318a80;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x3a4d('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x3a4d('0x1'));var https=require(_0x3a4d('0x2'));var md5=require('md5');var path=require('path');var querystring=require(_0x3a4d('0x3'));var rp=require(_0x3a4d('0x4'));var rs=require('randomstring');var sox=require('sox');var tts=require(_0x3a4d('0x5'));var urlParse=require(_0x3a4d('0x6'))[_0x3a4d('0x7')];var util=require(_0x3a4d('0x8'));var aws=require(_0x3a4d('0x9'));var google=require(_0x3a4d('0xa'));var sestek=require('./sestek');var tilde=require(_0x3a4d('0xb'));var logger=require('../../../config/logger')(_0x3a4d('0xc'));var ISPEECH_API=_0x3a4d('0xd');function downloadFile(_0x28895e,_0x3f2810){return new BPromise(function(_0x4444df,_0x54dc77){var _0x392972=urlParse(_0x28895e);var _0x24fca5=_0x392972[_0x3a4d('0xe')]===_0x3a4d('0xf')?https:http;var _0x78b384={'host':_0x392972[_0x3a4d('0x10')],'path':_0x392972['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x24fca5['get'](_0x78b384,function(_0x5cc7e6){if(_0x5cc7e6['statusCode']!==0xc8){logger[_0x3a4d('0x11')]('request\x20to\x20'+_0x28895e+'\x20failed,\x20status\x20code\x20=\x20'+_0x5cc7e6['statusCode']+'\x20('+_0x5cc7e6[_0x3a4d('0x12')]+')');_0x54dc77(new Error(_0x3a4d('0x13')+_0x28895e+_0x3a4d('0x14')+_0x5cc7e6['statusCode']+'\x20('+_0x5cc7e6[_0x3a4d('0x12')]+')'));return;}var _0x6d831b=fs[_0x3a4d('0x15')](_0x3f2810);_0x6d831b['on'](_0x3a4d('0x16'),function(){logger[_0x3a4d('0x17')](_0x3a4d('0x18'));_0x6d831b[_0x3a4d('0x19')](_0x4444df);});_0x6d831b['on']('error',function(_0x2d6402){fs[_0x3a4d('0x1a')](_0x3f2810);logger['error'](_0x3a4d('0x1b'),_0x2d6402);_0x54dc77(_0x2d6402);});_0x5cc7e6[_0x3a4d('0x1c')](_0x6d831b);})['on'](_0x3a4d('0x11'),function(_0x4f7bb7){logger[_0x3a4d('0x11')](_0x4f7bb7);_0x54dc77(_0x4f7bb7);})[_0x3a4d('0x1d')]();});}function uploadFile(_0x174f33){return new BPromise(function(_0x3a2ae5,_0x4e2beb){var _0x361a04=urlParse(_0x174f33);var _0x5991d4=_0x361a04[_0x3a4d('0xe')]==='https:'?https:http;var _0x2bcaaf={'host':_0x361a04[_0x3a4d('0x10')],'path':_0x361a04[_0x3a4d('0x1e')],'headers':{'user-agent':_0x3a4d('0x1f')}};_0x5991d4[_0x3a4d('0x20')](_0x2bcaaf,function(_0x11952d){if(_0x11952d[_0x3a4d('0x21')]!==0xc8){_0x4e2beb(new Error(_0x3a4d('0x13')+_0x174f33+_0x3a4d('0x14')+_0x11952d[_0x3a4d('0x21')]+'\x20('+_0x11952d[_0x3a4d('0x12')]+')'));return;}var _0x3e2130='';_0x11952d['on'](_0x3a4d('0x22'),function(_0x4e6e2c){_0x3e2130+=_0x4e6e2c;});_0x11952d['on'](_0x3a4d('0x1d'),function(){_0x3a2ae5(_0x3e2130);});})['on'](_0x3a4d('0x11'),function(_0x29ba43){_0x4e2beb(_0x29ba43);})['end']();});}function convertFile(_0xc04998,_0x9a2f63){return new BPromise(function(_0x2015e0,_0x12e9bb){var _0x15dc4a=sox[_0x3a4d('0x23')](_0xc04998,_0x9a2f63,{'sampleRate':0x1f40,'format':_0x3a4d('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x15dc4a['on'](_0x3a4d('0x11'),function(_0x92d40b){logger[_0x3a4d('0x11')](_0x3a4d('0x25'),_0x92d40b);_0x12e9bb(_0x92d40b);});_0x15dc4a['on'](_0x3a4d('0x1d'),function(){logger[_0x3a4d('0x17')](_0x3a4d('0x26'));_0x2015e0();});_0x15dc4a[_0x3a4d('0x27')]();});}function base64Decode(_0x4d54c1,_0x4959fb){var _0x2fd486=path[_0x3a4d('0x28')](__dirname,_0x3a4d('0x29'),rs['generate'](0x4)+_0x3a4d('0x2a'));fs['writeFileSync'](_0x2fd486,_0x4d54c1,_0x3a4d('0x2b'));return convertFile(_0x2fd486,_0x4959fb)['then'](function(){try{fs[_0x3a4d('0x1a')](_0x2fd486);fs[_0x3a4d('0x2c')](_0x4959fb,_0x3a4d('0x2d'));}catch(_0x99b81f){logger['error'](_0x99b81f);}return _0x4959fb['split']('.')[0x0];});}function base64Encode(_0x298ba5){var _0x5b7c3f=fs[_0x3a4d('0x2e')](_0x298ba5);return new Buffer(_0x5b7c3f)[_0x3a4d('0x2f')](_0x3a4d('0x2b'));}exports[_0x3a4d('0x30')]=function(_0x4327b0,_0x5bf85a,_0x1bc8a3,_0x4526ae,_0x2d0501,_0x4ca923){var _0x1ec0eb,_0x421411;var _0x507257=_0x3a4d('0x31');var _0x357d66='?key='+_0x4327b0;var _0x4ae0b9={};if(_0x5bf85a==='ssml'){_0x4ae0b9[_0x3a4d('0x32')]={'ssml':_0x1bc8a3};}else{_0x4ae0b9[_0x3a4d('0x32')]={'text':_0x1bc8a3};};_0x4ae0b9['voice']={'languageCode':_0x4526ae,'ssmlGender':_0x2d0501};_0x4ae0b9['audioConfig']={'audioEncoding':_0x3a4d('0x33'),'sampleRateHertz':0x1f40};var _0x296213={'url':_0x507257+_0x3a4d('0x34')+_0x357d66,'method':_0x3a4d('0x35'),'json':!![],'body':_0x4ae0b9};return rp(_0x296213)[_0x3a4d('0x36')](function(_0x5a5205){return new BPromise(function(_0x49bc27,_0x4c5051){_0x1ec0eb=path[_0x3a4d('0x28')](__dirname,_0x3a4d('0x29'),rs[_0x3a4d('0x37')](0x4)+_0x3a4d('0x38'));var _0x1831ff=Buffer[_0x3a4d('0x39')](_0x5a5205[_0x3a4d('0x3a')],_0x3a4d('0x2b'));return fs[_0x3a4d('0x3b')](_0x1ec0eb,_0x1831ff,function(_0x14ccd4){_0x4c5051(_0x14ccd4);},function(_0x1b7589){fs[_0x3a4d('0x2c')](_0x1ec0eb,_0x3a4d('0x2d'));_0x49bc27(_0x1b7589);});});})['then'](function(_0x350e40){_0x421411=path[_0x3a4d('0x28')](__dirname,'tmp',rs[_0x3a4d('0x37')](0x4)+_0x3a4d('0x2a'));return convertFile(_0x1ec0eb,_0x421411);})['then'](function(){try{fs[_0x3a4d('0x1a')](_0x1ec0eb);fs[_0x3a4d('0x2c')](_0x421411,_0x3a4d('0x2d'));}catch(_0x59fd8b){logger[_0x3a4d('0x11')](_0x59fd8b);}logger[_0x3a4d('0x17')]('googleCloudTTS\x20path',_0x421411['split']('.')[0x0]);return _0x421411[_0x3a4d('0x3c')]('.')[0x0];});};exports['googleTTS']=function(_0x138afc,_0x560d1f){var _0x549c80='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x52a26b,_0x276640;var _0x4dc7a0;var _0x29e04d={'encoding':_0x3a4d('0x3d'),'method':_0x3a4d('0x35'),'timeout':0x2710,'url':_0x549c80,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x3a4d('0x3e')+encodeURIComponent(JSON['stringify']([[[_0x3a4d('0x3f'),JSON['stringify']([_0x138afc,_0x560d1f||'en',![],'null']),null,_0x3a4d('0x40')]]]))};return rp(_0x29e04d)['then'](function(_0x5ae8e9){try{_0x4dc7a0=eval(_0x5ae8e9[_0x3a4d('0x41')](0x5))[0x0][0x2];}catch(_0x44a328){throw new Error(_0x3a4d('0x42')+_0x5ae8e9['data']);}if(!_0x4dc7a0){if(_0x138afc[_0x3a4d('0x43')]>0xc8){throw new Error(_0x3a4d('0x44'));}else{throw new Error('lang\x20\x22'+_0x560d1f+_0x3a4d('0x45'));}}try{_0x4dc7a0=eval(_0x4dc7a0)[0x0];}catch(_0x36f902){throw new Error(_0x3a4d('0x42')+res[_0x3a4d('0x22')]);}const _0x51a7a4=_0x4dc7a0;_0x52a26b=path[_0x3a4d('0x28')](__dirname,_0x3a4d('0x29'),rs[_0x3a4d('0x37')](0x4)+'.mp3');fs[_0x3a4d('0x46')](_0x52a26b,_0x4dc7a0,{'encoding':_0x3a4d('0x2b')});_0x276640=path[_0x3a4d('0x28')](__dirname,_0x3a4d('0x29'),rs[_0x3a4d('0x37')](0x4)+_0x3a4d('0x2a'));return convertFile(_0x52a26b,_0x276640);})['then'](function(){try{fs[_0x3a4d('0x1a')](_0x52a26b);fs[_0x3a4d('0x2c')](_0x276640,'777');}catch(_0x237f18){logger[_0x3a4d('0x11')](_0x237f18);}logger[_0x3a4d('0x17')]('goggleTTS\x20path',_0x276640[_0x3a4d('0x3c')]('.')[0x0]);return _0x276640[_0x3a4d('0x3c')]('.')[0x0];});};exports[_0x3a4d('0x47')]=function(_0x20c19f,_0x1b4739,_0xb6d8b0){return google[_0x3a4d('0x48')](_0x20c19f,_0x1b4739,_0xb6d8b0)[_0x3a4d('0x36')](function(_0x54ff05){logger['info'](_0x54ff05[_0x3a4d('0x49')]);return rp(_0x54ff05);})[_0x3a4d('0x36')](function(_0x57974e){var _0x33a0d3='';var _0x1afa28=0x0;try{fs[_0x3a4d('0x1a')](_0x20c19f);}catch(_0x303571){logger['error'](_0x303571);}if(_0x57974e&&_0x57974e[_0x3a4d('0x4a')]){_0x33a0d3=_0x57974e[_0x3a4d('0x4a')]['map'](function(_0x46ed85){return _0x46ed85&&_0x46ed85[_0x3a4d('0x4b')][0x0]&&_0x46ed85[_0x3a4d('0x4b')][0x0][_0x3a4d('0x4c')]?_0x46ed85[_0x3a4d('0x4b')][0x0]['transcript']:'';})[_0x3a4d('0x4d')]('\x0a');_0x1afa28=_0x57974e['results'][_0x3a4d('0x4e')](function(_0xa956c2){return _0xa956c2&&_0xa956c2[_0x3a4d('0x4b')][0x0]&&_0xa956c2[_0x3a4d('0x4b')][0x0][_0x3a4d('0x4f')]?_0xa956c2['alternatives'][0x0][_0x3a4d('0x4f')]:0x0;})[_0x3a4d('0x4d')]('\x0a');}logger['info'](_0x3a4d('0x50'),_0x33a0d3);logger[_0x3a4d('0x17')](_0x3a4d('0x51'),_0x1afa28);return{'transcript':_0x33a0d3,'confidence':_0x1afa28};})[_0x3a4d('0x52')](function(_0x2a299c){logger[_0x3a4d('0x11')](_0x3a4d('0x53'),_0x2a299c[_0x3a4d('0x21')],_0x2a299c[_0x3a4d('0x54')],_0x2a299c[_0x3a4d('0x55')]);});};exports['googleDialogflow']=function(_0x43d2b6,_0x591989,_0x5f12f2,_0x5dd794){var _0x22e47b=apiai(_0x591989,{'language':_0x5dd794||'en'});return _0x22e47b[_0x3a4d('0x56')](_0x5f12f2,{'sessionId':md5(_0x43d2b6)})['then'](function(_0x115a06){logger[_0x3a4d('0x17')](JSON['stringify'](_0x115a06));return{'source':_0x115a06['result'][_0x3a4d('0x57')],'resolvedQuery':_0x115a06[_0x3a4d('0x58')]['resolvedQuery'],'action':_0x115a06['result'][_0x3a4d('0x59')],'actionIncomplete':_0x115a06['result'][_0x3a4d('0x5a')],'speech':_0x115a06[_0x3a4d('0x58')][_0x3a4d('0x5b')][_0x3a4d('0x5c')],'score':_0x115a06[_0x3a4d('0x58')][_0x3a4d('0x5d')],'statusCode':_0x115a06[_0x3a4d('0x5e')][_0x3a4d('0x5f')],'endConversation':_0x115a06[_0x3a4d('0x58')][_0x3a4d('0x60')][_0x3a4d('0x61')]||![],'isFallbackIntent':_0x115a06[_0x3a4d('0x58')][_0x3a4d('0x60')][_0x3a4d('0x62')]};});};exports[_0x3a4d('0x63')]=function(_0x3ddb9d,_0xb5f7a6,_0x4e9839,_0x371daf,_0x3a0cbe,_0x455c37){var _0x4ee759=_0x371daf[_0x3a4d('0x64')](/\\n/g,'\x0a');var _0x2d8633={'credentials':{'private_key':_0x4ee759,'client_email':_0x4e9839}};var _0x3c1ed9=new dialogflow[(_0x3a4d('0x65'))](_0x2d8633);var _0x4d8f17=_0x3c1ed9[_0x3a4d('0x66')](_0xb5f7a6,md5(_0x3ddb9d));var _0x345709={'session':_0x4d8f17,'queryInput':{'text':{'text':_0x3a0cbe,'languageCode':_0x455c37}}};return _0x3c1ed9['detectIntent'](_0x345709)[_0x3a4d('0x36')](function(_0x57f5ba){if(_0x57f5ba&&_0x57f5ba['length']){logger['info'](_0x3a4d('0x67'),JSON[_0x3a4d('0x68')](_0x57f5ba));var _0x3c7159=_0x57f5ba[0x0];if(_0x3c7159){var _0x543849={'action':_0x3c7159[_0x3a4d('0x69')][_0x3a4d('0x59')],'allRequiredParamsPresent':_0x3c7159[_0x3a4d('0x69')][_0x3a4d('0x6a')],'endConversation':_0x3c7159[_0x3a4d('0x69')][_0x3a4d('0x6b')]&&_0x3c7159[_0x3a4d('0x69')]['diagnosticInfo'][_0x3a4d('0x6c')]?_0x3c7159['queryResult'][_0x3a4d('0x6b')][_0x3a4d('0x6c')][_0x3a4d('0x6d')][_0x3a4d('0x6e')]:![],'fulfillmentText':_0x3c7159[_0x3a4d('0x69')][_0x3a4d('0x6f')],'intentName':_0x3c7159['queryResult'][_0x3a4d('0x70')][_0x3a4d('0x54')],'intentDisplayName':_0x3c7159[_0x3a4d('0x69')][_0x3a4d('0x70')]['displayName'],'isFallbackIntent':_0x3c7159[_0x3a4d('0x69')][_0x3a4d('0x70')]['isFallback'],'languageCode':_0x3c7159[_0x3a4d('0x69')][_0x3a4d('0x71')],'queryText':_0x3c7159[_0x3a4d('0x69')]['queryText'],'responseId':_0x3c7159[_0x3a4d('0x72')],'score':_0x3c7159[_0x3a4d('0x69')][_0x3a4d('0x73')],'speech':_0x3c7159[_0x3a4d('0x69')][_0x3a4d('0x6f')],'providerResponse':JSON[_0x3a4d('0x68')](_0x57f5ba)};return _0x543849;}}});};exports[_0x3a4d('0x74')]=function(_0x43a55d,_0x19a1a4,_0x3b1b5b,_0x2c9fcf){return tilde[_0x3a4d('0x48')](_0x43a55d,_0x19a1a4,_0x3b1b5b,_0x2c9fcf)[_0x3a4d('0x36')](function(_0x2c1f28){try{fs[_0x3a4d('0x1a')](_0x43a55d);}catch(_0x121139){logger[_0x3a4d('0x11')](_0x121139);}logger[_0x3a4d('0x17')](_0x3a4d('0x75'),_0x2c1f28[_0x3a4d('0x4c')]);logger[_0x3a4d('0x17')]('Tilde\x20ASR\x20confidence',_0x2c1f28[_0x3a4d('0x4f')]);return _0x2c1f28;});};exports[_0x3a4d('0x76')]=function(_0x46503e,_0x43ba0d,_0x51ad57,_0x11425a,_0x15624e,_0x155abf){var _0x3b57e2=path[_0x3a4d('0x28')](__dirname,_0x3a4d('0x29'),rs[_0x3a4d('0x37')](0x4)+_0x3a4d('0x38'));var _0x4e2677;return aws['polly'](_0x46503e,_0x43ba0d,_0x51ad57,_0x11425a,_0x15624e,_0x155abf,_0x3b57e2)[_0x3a4d('0x36')](function(){_0x4e2677=path[_0x3a4d('0x28')](__dirname,_0x3a4d('0x29'),rs[_0x3a4d('0x37')](0x4)+'.wav');return convertFile(_0x3b57e2,_0x4e2677);})[_0x3a4d('0x36')](function(){try{fs[_0x3a4d('0x1a')](_0x3b57e2);fs[_0x3a4d('0x2c')](_0x4e2677,_0x3a4d('0x2d'));}catch(_0x4c83a1){logger[_0x3a4d('0x11')](_0x4c83a1);}return _0x4e2677[_0x3a4d('0x3c')]('.')[0x0];});};exports[_0x3a4d('0x77')]=function(_0x80dec6,_0xe75cbc,_0x42ee02,_0x50e473,_0xe8847c,_0x8f5bf){return aws[_0x3a4d('0x78')](_0x80dec6,_0xe75cbc,_0x42ee02,_0x50e473,_0xe8847c,_0x8f5bf)['then'](function(_0x254b8a){logger[_0x3a4d('0x17')](JSON[_0x3a4d('0x68')](_0x254b8a));return _0x254b8a;});};exports['ispeechTTS']=function(_0xdba5c6,_0x1b5d2,_0x3e5771,_0x318971){var _0x1ea4ef=util[_0x3a4d('0x79')](_0x3a4d('0x7a'),ISPEECH_API,_0xdba5c6,encodeURIComponent(_0x1b5d2),_0x3e5771,_0x318971);var _0x34fac2=path['resolve'](__dirname,'tmp',rs[_0x3a4d('0x37')](0x4)+'.mp3');var _0x935f8d;return downloadFile(_0x1ea4ef,_0x34fac2)[_0x3a4d('0x36')](function(){_0x935f8d=path[_0x3a4d('0x28')](__dirname,'tmp',rs[_0x3a4d('0x37')](0x4)+_0x3a4d('0x2a'));return convertFile(_0x34fac2,_0x935f8d);})[_0x3a4d('0x36')](function(){try{fs[_0x3a4d('0x1a')](_0x34fac2);fs[_0x3a4d('0x2c')](_0x935f8d,'777');}catch(_0x53a315){logger[_0x3a4d('0x11')](_0x53a315);}return _0x935f8d[_0x3a4d('0x3c')]('.')[0x0];});};exports[_0x3a4d('0x7b')]=function(_0x1a377e,_0x5459e1,_0x270324,_0x2b6100){var _0xa0255e=util[_0x3a4d('0x79')](_0x3a4d('0x7c'),ISPEECH_API,_0x5459e1,_0x270324,base64Encode(_0x1a377e),_0x2b6100?util[_0x3a4d('0x79')](_0x3a4d('0x7d'),encodeURIComponent(_0x2b6100)):_0x3a4d('0x7e'));return uploadFile(_0xa0255e)['then'](function(_0x2d89b8){return querystring[_0x3a4d('0x7')](_0x2d89b8);});};exports[_0x3a4d('0x7f')]=function(_0x229de8,_0x53af45){return sestek[_0x3a4d('0x80')](_0x229de8,_0x53af45)[_0x3a4d('0x36')](function(_0xfd1141){logger[_0x3a4d('0x17')](JSON[_0x3a4d('0x68')](_0xfd1141));var _0x5ae160={'speech':_0xfd1141['text'],'action':_0xfd1141[_0x3a4d('0x81')]?_0xfd1141[_0x3a4d('0x81')][_0x3a4d('0x82')]:undefined,'actiondata':_0xfd1141[_0x3a4d('0x81')]?_0xfd1141[_0x3a4d('0x81')][_0x3a4d('0x83')]:undefined};if(_0xfd1141[_0x3a4d('0x81')]&&_0xfd1141['channelData'][_0x3a4d('0x84')]){return base64Decode(_0xfd1141[_0x3a4d('0x81')][_0x3a4d('0x84')][_0x3a4d('0x85')],path['resolve'](__dirname,_0x3a4d('0x29'),rs[_0x3a4d('0x37')](0x4)+_0x3a4d('0x2a')))[_0x3a4d('0x36')](function(_0x446aa9){_0x5ae160[_0x3a4d('0x86')]=_0x446aa9;return _0x5ae160;});}return _0x5ae160;});};exports[_0x3a4d('0x87')]=function(){return __dirname;};
\ No newline at end of file
index 9652820..4aa4351 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x391d=['./nda'];(function(_0x32cb20,_0x269221){var _0x4d622e=function(_0x34da62){while(--_0x34da62){_0x32cb20['push'](_0x32cb20['shift']());}};_0x4d622e(++_0x269221);}(_0x391d,0x148));var _0xd391=function(_0x2b1c74,_0x4d14e8){_0x2b1c74=_0x2b1c74-0x0;var _0x575295=_0x391d[_0x2b1c74];return _0x575295;};var nda=require(_0xd391('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
+var _0xc4a9=['./nda','exports'];(function(_0x17e0a2,_0x48410c){var _0x35be95=function(_0x2cc0b4){while(--_0x2cc0b4){_0x17e0a2['push'](_0x17e0a2['shift']());}};_0x35be95(++_0x48410c);}(_0xc4a9,0x138));var _0x9c4a=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xc4a9[_0x243b2f];return _0xcb3c2d;};var nda=require(_0x9c4a('0x0'));module[_0x9c4a('0x1')]={'nda':nda};
\ No newline at end of file
index 234f204..c74c3db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c9=['POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','channelData','ProjectName','AudioOutputSettings','custom_action','body','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','exports'];(function(_0x54d785,_0x123ad3){var _0x26e0f3=function(_0x2dc6e7){while(--_0x2dc6e7){_0x54d785['push'](_0x54d785['shift']());}};_0x26e0f3(++_0x123ad3);}(_0x12c9,0x9f));var _0x912c=function(_0x179a56,_0x2d1339){_0x179a56=_0x179a56-0x0;var _0x58ea7f=_0x12c9[_0x179a56];return _0x58ea7f;};'use strict';var rp=require(_0x912c('0x0'));var url=require('url');var logger=require(_0x912c('0x1'))('agi');module[_0x912c('0x2')]=function(_0x522495,_0x3364ce){var _0x2740fa={'method':_0x912c('0x3'),'uri':url[_0x912c('0x4')](_0x3364ce[_0x912c('0x5')],_0x912c('0x6')),'form':{'grant_type':_0x912c('0x7'),'username':_0x3364ce['username'],'password':_0x3364ce[_0x912c('0x7')]},'json':!![]};return rp(_0x2740fa)[_0x912c('0x8')](function(_0x4745c5){var _0x486e08={'method':_0x912c('0x3'),'uri':url['resolve'](_0x3364ce['ndassistant_url'],_0x912c('0x9')),'body':{'type':_0x3364ce['ndaactivity_type']||'message','channelId':'Nda','conversation':{'id':_0x522495[_0x912c('0xa')]},'from':{'id':_0x522495['callerid'],'name':_0x522495[_0x912c('0xb')]},'recipient':{'id':_0x522495[_0x912c('0xc')],'name':_0x522495[_0x912c('0xd')]},'text':_0x3364ce[_0x912c('0xe')],'channelData':{}},'headers':{'Authorization':_0x912c('0xf')+_0x4745c5[_0x912c('0x10')]},'json':!![]};if(_0x3364ce[_0x912c('0x11')]){_0x486e08['body'][_0x912c('0x12')][_0x912c('0x13')]=_0x3364ce[_0x912c('0x11')];}if(_0x3364ce['ndagenerate_audio']=='1'){_0x486e08['body'][_0x912c('0x12')][_0x912c('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3364ce[_0x912c('0x15')]){_0x486e08[_0x912c('0x16')]['channelData']['CustomAction']=_0x3364ce[_0x912c('0x15')];if(_0x3364ce[_0x912c('0x17')]){_0x486e08[_0x912c('0x16')]['channelData'][_0x912c('0x18')]=_0x3364ce[_0x912c('0x17')];}}logger[_0x912c('0x19')](JSON[_0x912c('0x1a')](_0x486e08));return rp(_0x486e08);});};
\ No newline at end of file
+var _0x7eb9=['audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','agi','POST','ndauth_url','password','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings'];(function(_0x1990e7,_0x179602){var _0x3a9c46=function(_0x3d274c){while(--_0x3d274c){_0x1990e7['push'](_0x1990e7['shift']());}};_0x3a9c46(++_0x179602);}(_0x7eb9,0xd9));var _0x97eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7eb9[_0x122ef9];return _0x42fba0;};'use strict';var rp=require(_0x97eb('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0x97eb('0x1'));module['exports']=function(_0x580fd1,_0x41d2c7){var _0x67960={'method':_0x97eb('0x2'),'uri':url['resolve'](_0x41d2c7[_0x97eb('0x3')],'/token'),'form':{'grant_type':_0x97eb('0x4'),'username':_0x41d2c7['username'],'password':_0x41d2c7[_0x97eb('0x4')]},'json':!![]};return rp(_0x67960)['then'](function(_0x5227f4){var _0x429ed6={'method':'POST','uri':url[_0x97eb('0x5')](_0x41d2c7[_0x97eb('0x6')],_0x97eb('0x7')),'body':{'type':_0x41d2c7[_0x97eb('0x8')]||_0x97eb('0x9'),'channelId':'Nda','conversation':{'id':_0x580fd1['uniqueid']},'from':{'id':_0x580fd1[_0x97eb('0xa')],'name':_0x580fd1[_0x97eb('0xb')]},'recipient':{'id':_0x580fd1[_0x97eb('0xc')],'name':_0x580fd1[_0x97eb('0xd')]},'text':_0x41d2c7[_0x97eb('0xe')],'channelData':{}},'headers':{'Authorization':_0x97eb('0xf')+_0x5227f4[_0x97eb('0x10')]},'json':!![]};if(_0x41d2c7[_0x97eb('0x11')]){_0x429ed6[_0x97eb('0x12')][_0x97eb('0x13')][_0x97eb('0x14')]=_0x41d2c7[_0x97eb('0x11')];}if(_0x41d2c7[_0x97eb('0x15')]=='1'){_0x429ed6[_0x97eb('0x12')]['channelData'][_0x97eb('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x97eb('0x17')};}if(_0x41d2c7[_0x97eb('0x18')]){_0x429ed6['body'][_0x97eb('0x13')][_0x97eb('0x19')]=_0x41d2c7[_0x97eb('0x18')];if(_0x41d2c7['custom_action_data']){_0x429ed6['body'][_0x97eb('0x13')][_0x97eb('0x1a')]=_0x41d2c7[_0x97eb('0x1b')];}}logger[_0x97eb('0x1c')](JSON[_0x97eb('0x1d')](_0x429ed6));return rp(_0x429ed6);});};
\ No newline at end of file
index 4e50ba5..f3b37bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94fb=['exports'];(function(_0x3d773f,_0x3462b3){var _0x22bf3a=function(_0x2d295e){while(--_0x2d295e){_0x3d773f['push'](_0x3d773f['shift']());}};_0x22bf3a(++_0x3462b3);}(_0x94fb,0xa9));var _0xb94f=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x94fb[_0x3ff085];return _0x2b68c3;};'use strict';var asr=require('./lib/api');module[_0xb94f('0x0')]=function(_0x2c07ce,_0x300e91,_0x2b09e2,_0xdd7132){return asr(_0x2c07ce,_0x300e91,_0x2b09e2,_0xdd7132);};
\ No newline at end of file
+var _0x62b2=['exports'];(function(_0x3cfd31,_0x55084f){var _0x294e12=function(_0x3c73){while(--_0x3c73){_0x3cfd31['push'](_0x3cfd31['shift']());}};_0x294e12(++_0x55084f);}(_0x62b2,0x177));var _0x262b=function(_0x117d07,_0x15c24d){_0x117d07=_0x117d07-0x0;var _0x527407=_0x62b2[_0x117d07];return _0x527407;};'use strict';var asr=require('./lib/api');module[_0x262b('0x0')]=function(_0x118d45,_0x7ad8dd,_0x2ee757,_0x1e4bfe){return asr(_0x118d45,_0x7ad8dd,_0x2ee757,_0x1e4bfe);};
\ No newline at end of file
index aa69f9c..33e452d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5021=['bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','info','Open\x20Tilde\x20ASR\x20socket','send','data','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','close'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5021,0x103));var _0x1502=function(_0x51f973,_0x50d12c){_0x51f973=_0x51f973-0x0;var _0x32a985=_0x5021[_0x51f973];return _0x32a985;};'use strict';var BPromise=require(_0x1502('0x0'));var _=require(_0x1502('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x1502('0x2'));var crypto=require(_0x1502('0x3'));var logger=require(_0x1502('0x4'))('agi');module[_0x1502('0x5')]=function(_0x53be9e,_0x25c13e,_0x2ece23,_0x56a4a3){return new BPromise(function(_0x42a027,_0x515eb3){logger['info'](_0x1502('0x6'),_0x56a4a3||_0x1502('0x7'));var _0x4f02ea=new WebSocket(_0x56a4a3||_0x1502('0x7'),{'perMessageDeflate':![]});var _0x33970c='';var _0x59fc88='0';var _0x178963='1';var _0x330f19='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x71234e(_0x40e850){var _0x3c8aaf=crypto[_0x1502('0x8')](_0x1502('0x9'));_0x3c8aaf[_0x1502('0xa')](_0x40e850);return _0x3c8aaf[_0x1502('0xb')]('hex');}function _0x5eeba9(){try{logger[_0x1502('0xc')](_0x1502('0xd'));var _0x24fe74=moment()['unix']();var _0x5aa6b4=_0x71234e(_0x24fe74+_0x25c13e+_0x2ece23);_0x4f02ea[_0x1502('0xe')](JSON['stringify']({'appID':_0x25c13e,'timestamp':_0x24fe74,'appKey':_0x5aa6b4}));var _0x2dac53=fs['createReadStream'](_0x53be9e);_0x2dac53['on'](_0x1502('0xf'),function(_0x56f2c0){_0x4f02ea[_0x1502('0xe')](_0x56f2c0);});_0x2dac53['on']('close',function(){_0x4f02ea[_0x1502('0xe')](_0x1502('0x10'));});}catch(_0xde66a1){logger[_0x1502('0x11')](_0x1502('0x12'),JSON[_0x1502('0x13')](_0xde66a1));_0x4f02ea[_0x1502('0x14')]();}}function _0x27d5d8(_0x1cadd8){try{if(_0x1cadd8){var _0x5d52e9=JSON['parse'](_0x1cadd8);switch(_0x5d52e9[_0x1502('0x15')]){case 0x0:if(_0x5d52e9[_0x1502('0x16')]){if(_0x5d52e9['result']['final']){logger[_0x1502('0xc')](_0x1502('0x17'),JSON['stringify'](_0x5d52e9[_0x1502('0x16')][_0x1502('0x18')]));_0x33970c=_0x5d52e9[_0x1502('0x16')][_0x1502('0x18')][0x0][_0x1502('0x19')];_0x59fc88=_0x5d52e9[_0x1502('0x16')][_0x1502('0x18')][0x0][_0x1502('0x1a')];_0x178963='0';_0x330f19=_0x1502('0x1b');_0x4f02ea['terminate']();}}break;case 0x1:logger[_0x1502('0xc')](_0x1502('0x1c'));_0x178963='1';_0x330f19='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x1502('0xc')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x178963='2';_0x330f19=_0x1502('0x1d');break;case 0x9:logger['info'](_0x1502('0x1e'));_0x178963='9';_0x330f19=_0x1502('0x1e');break;case 0xa:logger[_0x1502('0xc')](_0x1502('0x1f'));_0x178963='10';_0x330f19=_0x1502('0x1f');break;case 0xb:logger[_0x1502('0xc')](_0x1502('0x20'));_0x178963='11';_0x330f19=_0x1502('0x20');}}}catch(_0x274889){logger[_0x1502('0x11')](_0x1502('0x21'),JSON[_0x1502('0x13')](_0x274889));_0x4f02ea[_0x1502('0x14')]();}}function _0x57569c(){logger[_0x1502('0xc')](_0x1502('0x22'));_0x42a027({'transcript':_0x33970c,'confidence':_0x59fc88,'status':_0x178963,'status_message':_0x330f19});}function _0x372aef(_0x5e8a00){logger[_0x1502('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x1502('0x23')](_0x5e8a00)){logger[_0x1502('0x11')](_['isObject'](_0x5e8a00)?JSON[_0x1502('0x13')](_0x5e8a00):_0x5e8a00);}}_0x4f02ea['on']('open',_0x5eeba9);_0x4f02ea['on']('message',_0x27d5d8);_0x4f02ea['on'](_0x1502('0x24'),_0x57569c);_0x4f02ea['on']('error',_0x372aef);});};
\ No newline at end of file
+var _0xb7ec=['hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','moment','crypto','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xb7ec,0x1bb));var _0xcb7e=function(_0x58176f,_0x55a4e5){_0x58176f=_0x58176f-0x0;var _0x14ccb0=_0xb7ec[_0x58176f];return _0x14ccb0;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xcb7e('0x0'));var crypto=require(_0xcb7e('0x1'));var logger=require('../../../../../../config/logger')('agi');module[_0xcb7e('0x2')]=function(_0x1882d4,_0x30ffc3,_0x3c966d,_0x41e941){return new BPromise(function(_0x5d9834,_0x247867){logger[_0xcb7e('0x3')]('Tilde\x20URI',_0x41e941||_0xcb7e('0x4'));var _0x3cb091=new WebSocket(_0x41e941||_0xcb7e('0x4'),{'perMessageDeflate':![]});var _0x38ada6='';var _0x5567b8='0';var _0x586adb='1';var _0x1b15e1=_0xcb7e('0x5');function _0x1e01b9(_0x10e6de){var _0x4e88a7=crypto['createHash'](_0xcb7e('0x6'));_0x4e88a7[_0xcb7e('0x7')](_0x10e6de);return _0x4e88a7[_0xcb7e('0x8')](_0xcb7e('0x9'));}function _0x4b99fb(){try{logger[_0xcb7e('0x3')](_0xcb7e('0xa'));var _0x26a153=moment()[_0xcb7e('0xb')]();var _0x2433db=_0x1e01b9(_0x26a153+_0x30ffc3+_0x3c966d);_0x3cb091[_0xcb7e('0xc')](JSON[_0xcb7e('0xd')]({'appID':_0x30ffc3,'timestamp':_0x26a153,'appKey':_0x2433db}));var _0x3b88be=fs[_0xcb7e('0xe')](_0x1882d4);_0x3b88be['on'](_0xcb7e('0xf'),function(_0x1b283b){_0x3cb091['send'](_0x1b283b);});_0x3b88be['on'](_0xcb7e('0x10'),function(){_0x3cb091[_0xcb7e('0xc')](_0xcb7e('0x11'));});}catch(_0x1dfe74){logger[_0xcb7e('0x12')](_0xcb7e('0x13'),JSON[_0xcb7e('0xd')](_0x1dfe74));_0x3cb091[_0xcb7e('0x14')]();}}function _0x3c4cf0(_0x425f67){try{if(_0x425f67){var _0x107351=JSON[_0xcb7e('0x15')](_0x425f67);switch(_0x107351[_0xcb7e('0x16')]){case 0x0:if(_0x107351[_0xcb7e('0x17')]){if(_0x107351['result']['final']){logger['info'](_0xcb7e('0x18'),JSON[_0xcb7e('0xd')](_0x107351['result']['hypotheses']));_0x38ada6=_0x107351[_0xcb7e('0x17')][_0xcb7e('0x19')][0x0][_0xcb7e('0x1a')];_0x5567b8=_0x107351[_0xcb7e('0x17')][_0xcb7e('0x19')][0x0][_0xcb7e('0x1b')];_0x586adb='0';_0x1b15e1=_0xcb7e('0x1c');_0x3cb091['terminate']();}}break;case 0x1:logger[_0xcb7e('0x3')](_0xcb7e('0x5'));_0x586adb='1';_0x1b15e1=_0xcb7e('0x5');break;case 0x2:logger['info'](_0xcb7e('0x1d'));_0x586adb='2';_0x1b15e1=_0xcb7e('0x1d');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x586adb='9';_0x1b15e1=_0xcb7e('0x1e');break;case 0xa:logger[_0xcb7e('0x3')](_0xcb7e('0x1f'));_0x586adb='10';_0x1b15e1='Authentication\x20failed.';break;case 0xb:logger[_0xcb7e('0x3')](_0xcb7e('0x20'));_0x586adb='11';_0x1b15e1=_0xcb7e('0x20');}}}catch(_0x15d623){logger[_0xcb7e('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xcb7e('0xd')](_0x15d623));_0x3cb091['terminate']();}}function _0x21963f(){logger[_0xcb7e('0x3')](_0xcb7e('0x21'));_0x5d9834({'transcript':_0x38ada6,'confidence':_0x5567b8,'status':_0x586adb,'status_message':_0x1b15e1});}function _0x5b8da7(_0x48967b){logger[_0xcb7e('0x12')](_0xcb7e('0x22'));if(!_[_0xcb7e('0x23')](_0x48967b)){logger[_0xcb7e('0x12')](_[_0xcb7e('0x24')](_0x48967b)?JSON[_0xcb7e('0xd')](_0x48967b):_0x48967b);}}_0x3cb091['on'](_0xcb7e('0x25'),_0x4b99fb);_0x3cb091['on'](_0xcb7e('0x26'),_0x3c4cf0);_0x3cb091['on']('close',_0x21963f);_0x3cb091['on'](_0xcb7e('0x12'),_0x5b8da7);});};
\ No newline at end of file
index 898376e..0b88225 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfca=['./asr','exports'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xbfca,0x1b4));var _0xabfc=function(_0x248fa3,_0x6f5bb4){_0x248fa3=_0x248fa3-0x0;var _0x48df15=_0xbfca[_0x248fa3];return _0x48df15;};var asr=require(_0xabfc('0x0'));module[_0xabfc('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xf20b=['exports','./asr'];(function(_0x1accef,_0x28c73c){var _0x22410f=function(_0x4d3539){while(--_0x4d3539){_0x1accef['push'](_0x1accef['shift']());}};_0x22410f(++_0x28c73c);}(_0xf20b,0x1eb));var _0xbf20=function(_0x28f2b3,_0x355700){_0x28f2b3=_0x28f2b3-0x0;var _0x3a2d76=_0xf20b[_0x28f2b3];return _0x3a2d76;};var asr=require(_0xbf20('0x0'));module[_0xbf20('0x1')]={'asr':asr};
\ No newline at end of file
index 89d6e78..b650e94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7c6=['emit','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','inherits','util','net','events','EventEmitter','./channel','127.0.0.1','error','E_AGI_ARGUMENT_PORT','createServer','listening'];(function(_0xc1de7,_0x4dfc82){var _0x2b7b54=function(_0x592806){while(--_0x592806){_0xc1de7['push'](_0xc1de7['shift']());}};_0x2b7b54(++_0x4dfc82);}(_0xd7c6,0xe6));var _0x6d7c=function(_0x16311f,_0x40f002){_0x16311f=_0x16311f-0x0;var _0x42f147=_0xd7c6[_0x16311f];return _0x42f147;};'use strict';var util=require(_0x6d7c('0x0'));var net=require(_0x6d7c('0x1'));var EventEmitter=require(_0x6d7c('0x2'))[_0x6d7c('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x6d7c('0x4'));var AGIServer=function(_0x5a5470,_0xb13e6c,_0x1d980b){var _0x342eac=this,_0x5a5470=_0x5a5470||0x11dd,_0xb13e6c=_0xb13e6c||_0x6d7c('0x5'),_0x14c20f=null,_0x17d63e=0x0;EventEmitter['call'](_0x342eac);function _0x1764f6(){if(!_0x5a5470){_0x342eac['emit'](_0x6d7c('0x6'),new AGIError(_0x6d7c('0x7')));return![];}_0x14c20f=net[_0x6d7c('0x8')]();_0x14c20f['listen'](_0x5a5470,_0xb13e6c);_0x14c20f['on'](_0x6d7c('0x9'),function(){_0x342eac[_0x6d7c('0xa')]('listening');});_0x14c20f['on'](_0x6d7c('0xb'),function(_0x5a927e){_0x14c20f['getConnections'](function(_0xc7f3be,_0x166930){if(_0xc7f3be){_0x342eac[_0x6d7c('0xa')]('error',new AGIError(_0x6d7c('0xc'),_0xc7f3be));}else if(_0x1d980b&&_0x1d980b<0x0){_0x342eac[_0x6d7c('0xa')](_0x6d7c('0x6'),new AGIError(_0x6d7c('0xd')));_0x5a927e[_0x6d7c('0xe')]();}else if(_0x1d980b&&_0x1d980b>0x0&&_0x1d980b<_0x166930){_0x17d63e+=0x1;_0x342eac[_0x6d7c('0xa')]('error',new AGIError(_0x6d7c('0xf'),_0x17d63e));_0x5a927e[_0x6d7c('0xe')]();}else{var _0x26e791=new AGIChannel(_0x5a927e);_0x26e791['on'](_0x6d7c('0x10'),function(){_0x342eac['emit'](_0x6d7c('0xb'),_0x26e791);});}});});_0x14c20f['on'](_0x6d7c('0x6'),function(_0x187d61){_0x342eac[_0x6d7c('0xa')](_0x6d7c('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x187d61['code']));});_0x14c20f['on'](_0x6d7c('0x11'),function(){_0x342eac['emit'](_0x6d7c('0x11'),new AGIError(_0x6d7c('0x12')));});}process['nextTick'](function(){_0x1764f6();});};util[_0x6d7c('0x13')](AGIServer,EventEmitter);module['exports']=function(_0x394762,_0x223f00,_0x485a0d){return new AGIServer(_0x394762,_0x223f00,_0x485a0d);};
\ No newline at end of file
+var _0x3a6f=['EventEmitter','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','inherits','util','net','events'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x3a6f,0x11b));var _0xf3a6=function(_0x52e860,_0x232b82){_0x52e860=_0x52e860-0x0;var _0x38f915=_0x3a6f[_0x52e860];return _0x38f915;};'use strict';var util=require(_0xf3a6('0x0'));var net=require(_0xf3a6('0x1'));var EventEmitter=require(_0xf3a6('0x2'))[_0xf3a6('0x3')];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x149a6d,_0x54caab,_0x61860b){var _0x2a91a9=this,_0x149a6d=_0x149a6d||0x11dd,_0x54caab=_0x54caab||_0xf3a6('0x4'),_0x2e7803=null,_0x9bfafd=0x0;EventEmitter[_0xf3a6('0x5')](_0x2a91a9);function _0xbcc133(){if(!_0x149a6d){_0x2a91a9[_0xf3a6('0x6')]('error',new AGIError(_0xf3a6('0x7')));return![];}_0x2e7803=net[_0xf3a6('0x8')]();_0x2e7803['listen'](_0x149a6d,_0x54caab);_0x2e7803['on'](_0xf3a6('0x9'),function(){_0x2a91a9[_0xf3a6('0x6')](_0xf3a6('0x9'));});_0x2e7803['on'](_0xf3a6('0xa'),function(_0x3597ce){_0x2e7803[_0xf3a6('0xb')](function(_0x4f29b5,_0x323152){if(_0x4f29b5){_0x2a91a9['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0x4f29b5));}else if(_0x61860b&&_0x61860b<0x0){_0x2a91a9['emit'](_0xf3a6('0xc'),new AGIError(_0xf3a6('0xd')));_0x3597ce[_0xf3a6('0xe')]();}else if(_0x61860b&&_0x61860b>0x0&&_0x61860b<_0x323152){_0x9bfafd+=0x1;_0x2a91a9['emit'](_0xf3a6('0xc'),new AGIError(_0xf3a6('0xf'),_0x9bfafd));_0x3597ce[_0xf3a6('0xe')]();}else{var _0x172986=new AGIChannel(_0x3597ce);_0x172986['on'](_0xf3a6('0x10'),function(){_0x2a91a9[_0xf3a6('0x6')]('connection',_0x172986);});}});});_0x2e7803['on'](_0xf3a6('0xc'),function(_0x588e1b){_0x2a91a9['emit']('error',new AGIError(_0xf3a6('0x11'),_0x588e1b[_0xf3a6('0x12')]));});_0x2e7803['on'](_0xf3a6('0x13'),function(){_0x2a91a9[_0xf3a6('0x6')](_0xf3a6('0x13'),new AGIError(_0xf3a6('0x14')));});}process['nextTick'](function(){_0xbcc133();});};util[_0xf3a6('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x374fc3,_0x5e9af7,_0x4778cb){return new AGIServer(_0x374fc3,_0x5e9af7,_0x4778cb);};
\ No newline at end of file
index e763bbd..8fd5dc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6b1=['odbc_id','replace','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','speech','DialogflowV2\x20Result\x20%s','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','appsecret','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','Enter\x20in\x20HANGUP\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','path','util','lodash','odbc','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','then','name','getVoiceQueueById','getSquareProjectById','getSquareOdbcById','dsn','catch','getUserById','getTrunk','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','phone','list_id','scheduledAt','toString','getPause','agent','agentPause','agentUnpause','isNil','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MP3','googleTTS','restAPI','timeout','includes','POST','PUT','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','client_email','private_key','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','clear','clone','isString','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','length','saveRestApiResult','%s.%s','isArray','setVariable','split','extra','getAndSetVariable','isConfigured','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','result','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf6b1,0x110));var _0x1f6b=function(_0x2bba8b,_0x595229){_0x2bba8b=_0x2bba8b-0x0;var _0x349843=_0xf6b1[_0x2bba8b];return _0x349843;};'use strict';var fs=require('fs');var path=require(_0x1f6b('0x0'));var util=require(_0x1f6b('0x1'));var _=require(_0x1f6b('0x2'));var sh=require('shelljs');var odbc=require(_0x1f6b('0x3'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require('mustache');var rp=require(_0x1f6b('0x4'));var logger=require('../../config/logger')(_0x1f6b('0x5'));var config=require(_0x1f6b('0x6'));var scripts=require(_0x1f6b('0x7'));var FILES_PATH=_0x1f6b('0x8');var recursiveMapAttributes=[_0x1f6b('0x9'),'rawBody'];var verticesWithRetry=[_0x1f6b('0xa'),_0x1f6b('0xb'),_0x1f6b('0xc')];var AGIVertices=function(_0x32af99,_0x4d21fe,_0x2becd6){this[_0x1f6b('0xd')]=_0x32af99;this['rpc']=_0x4d21fe;this['mailRpc']=_0x2becd6;};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xf')]=function(_0x1d7347,_0x51bea1){this[_0x1f6b('0x10')][_0x1f6b('0x11')](_0x1d7347)[_0x1f6b('0x12')](function(_0x35f89a){_0x51bea1(null,_0x35f89a?_0x35f89a[_0x1f6b('0x13')]:![]);})['catch'](function(_0x4468eb){_0x51bea1(_0x4468eb);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x420458,_0x3b1ba1){this[_0x1f6b('0x10')][_0x1f6b('0x14')](_0x420458)[_0x1f6b('0x12')](function(_0x5ccc23){_0x3b1ba1(null,_0x5ccc23?_0x5ccc23[_0x1f6b('0x13')]:![]);})['catch'](function(_0x1bf9e9){_0x3b1ba1(_0x1bf9e9);});};AGIVertices[_0x1f6b('0xe')]['getSquareProject']=function(_0x372c1d,_0x55a674){this[_0x1f6b('0x10')][_0x1f6b('0x15')](_0x372c1d)[_0x1f6b('0x12')](function(_0x601257){_0x55a674(null,_0x601257?_0x601257['name']:![]);})['catch'](function(_0x36f1d5){_0x55a674(_0x36f1d5);});};AGIVertices[_0x1f6b('0xe')]['getSquareOdbc']=function(_0x27c435,_0x15b3b2){this[_0x1f6b('0x10')][_0x1f6b('0x16')](_0x27c435)[_0x1f6b('0x12')](function(_0x3f8467){_0x15b3b2(null,_0x3f8467?_0x3f8467[_0x1f6b('0x17')]:![]);})[_0x1f6b('0x18')](function(_0x449131){_0x15b3b2(_0x449131);});};AGIVertices[_0x1f6b('0xe')]['getUser']=function(_0x58f4f6,_0x124224){this['rpc'][_0x1f6b('0x19')](_0x58f4f6)[_0x1f6b('0x12')](function(_0x3339e5){_0x124224(null,_0x3339e5?_0x3339e5[_0x1f6b('0x13')]:![]);})[_0x1f6b('0x18')](function(_0x4b44ca){_0x124224(_0x4b44ca);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1a')]=function(_0x4b5c7b,_0x26e390){this[_0x1f6b('0x10')]['getTrunkById'](_0x4b5c7b)[_0x1f6b('0x12')](function(_0x5f1767){_0x26e390(null,_0x5f1767?_0x5f1767[_0x1f6b('0x13')]:![]);})[_0x1f6b('0x18')](function(_0x1a7d5f){_0x26e390(_0x1a7d5f);});};AGIVertices['prototype'][_0x1f6b('0x1b')]=function(_0x1c8377,_0x597cd7){var _0x5cd1e4=this;this[_0x1f6b('0x10')]['getSoundById'](_0x1c8377)[_0x1f6b('0x12')](function(_0x54c440){_0x597cd7(null,_0x54c440?_0x5cd1e4[_0x1f6b('0x1c')](_0x54c440[_0x1f6b('0x1d')]):![]);})[_0x1f6b('0x18')](function(_0x2e5b24){_0x597cd7(_0x2e5b24);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1e')]=function(_0x322e18,_0x4b31fa){this[_0x1f6b('0x10')][_0x1f6b('0x1f')](_0x322e18)['then'](function(_0x11605f){_0x4b31fa(null,_0x11605f?_0x11605f:![]);})['catch'](function(_0x16fb29){_0x4b31fa(_0x16fb29);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x20')]=function(_0x34a9ab,_0x4d44e3,_0x36845f){this[_0x1f6b('0x21')][_0x1f6b('0x20')](_0x34a9ab,_0x4d44e3)[_0x1f6b('0x12')](function(){_0x36845f(null);})['catch'](function(_0x249554){_0x36845f(_0x249554);});};AGIVertices[_0x1f6b('0xe')]['getIntervals']=function(_0x6ac22f,_0x118e5f){this[_0x1f6b('0x10')][_0x1f6b('0x22')](_0x6ac22f)['then'](function(_0x36b09d){if(_0x36b09d){if(_0x36b09d[_0x1f6b('0x23')]){_0x118e5f(null,[_0x36b09d[_0x1f6b('0x24')]]);}else{_0x118e5f(null,_[_0x1f6b('0x25')](_0x36b09d[_0x1f6b('0x26')],_0x1f6b('0x24')));}}else{_0x118e5f(null,![]);}})['catch'](function(_0x51d12f){_0x118e5f(_0x51d12f);});};AGIVertices['prototype'][_0x1f6b('0x1c')]=function(_0x2730b9){return util[_0x1f6b('0x27')](_0x1f6b('0x28'),FILES_PATH,_0x2730b9);};AGIVertices[_0x1f6b('0xe')]['getQueryOdbc']=function(_0x3c3514,_0xb1b60d,_0x691df3){odbc['open'](_0x3c3514,function(_0x499205){if(_0x499205){logger[_0x1f6b('0x29')](_0x1f6b('0x2a'),_0x499205);_0x691df3(_0x499205);}else{logger['info'](_0x1f6b('0x2b'));odbc[_0x1f6b('0x2c')](_0xb1b60d,function(_0x12f441,_0x56f804){if(_0x12f441){logger[_0x1f6b('0x2d')](_0x1f6b('0x2e'),_0xb1b60d);_0x691df3(_0x12f441);}else{logger[_0x1f6b('0x2d')](_0x1f6b('0x2f'),_0xb1b60d);odbc[_0x1f6b('0x30')](function(_0x26888a){if(_0x26888a){logger['error'](_0x1f6b('0x31'),_0x26888a);}_0x691df3(null,_0x56f804);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x2807de,_0x1cc7c3){this[_0x1f6b('0x10')][_0x1f6b('0x32')](_0x2807de)[_0x1f6b('0x12')](function(_0x1200d0){_0x1cc7c3(null,_0x1200d0?_0x1200d0:![]);})[_0x1f6b('0x18')](function(_0x424318){_0x1cc7c3(_0x424318);});};AGIVertices['prototype'][_0x1f6b('0x33')]=function(_0xed5556,_0x2280ea){this[_0x1f6b('0x10')][_0x1f6b('0x33')](_0xed5556)[_0x1f6b('0x12')](function(_0x1f9b24){_0x2280ea(null,_0x1f9b24);})[_0x1f6b('0x18')](function(_0x378802){_0x2280ea(_0x378802);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x34')]=function(_0x98fc04,_0x283fc9,_0x295fdc){this[_0x1f6b('0x10')][_0x1f6b('0x34')]({'uniqueid':this['channel'][_0x1f6b('0x35')],'node':_0x98fc04[_0x1f6b('0x36')],'application':_0x98fc04[_0x1f6b('0x37')],'data':_0x283fc9||null,'project_name':this['channel'][_0x1f6b('0x38')],'callerid':this['channel'][_0x1f6b('0x39')]})[_0x1f6b('0x12')](function(_0x4d4146){if(_0x295fdc){_0x295fdc(null,_0x4d4146);}})[_0x1f6b('0x18')](function(_0x4dad11){if(_0x295fdc){_0x295fdc(_0x4dad11);}});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x3a')]=function(_0x1b74dc,_0x55a2fc,_0x5c0be4,_0x2a488a){this[_0x1f6b('0x10')][_0x1f6b('0x3a')]({'uniqueid':this[_0x1f6b('0xd')][_0x1f6b('0x35')],'callerid':this['channel']['callerid'],'calleridname':this[_0x1f6b('0xd')][_0x1f6b('0x3b')],'context':this[_0x1f6b('0xd')][_0x1f6b('0x3c')],'extension':this[_0x1f6b('0xd')][_0x1f6b('0x3d')],'priority':this[_0x1f6b('0xd')][_0x1f6b('0x3e')],'accountcode':this[_0x1f6b('0xd')]['accountcode'],'dnid':this[_0x1f6b('0xd')]['dnid'],'projectName':this['channel'][_0x1f6b('0x38')],'saveName':_0x55a2fc,'filename':_0x1b74dc['file']||_0x55a2fc,'savePath':_0x5c0be4})[_0x1f6b('0x12')](function(_0x120b64){_0x2a488a(null,_0x120b64);})[_0x1f6b('0x18')](function(_0x2e9030){_0x2a488a(_0x2e9030);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x3f')]=function(_0x4aaf42,_0x3d1e28,_0x3a27dd,_0x1497f6,_0x3a9607){this[_0x1f6b('0x10')][_0x1f6b('0x3f')]({'uniqueid':this[_0x1f6b('0xd')][_0x1f6b('0x35')],'body':_0x4aaf42,'direction':_0x3d1e28,'providerName':_0x3a27dd,'providerResponse':_0x1497f6})[_0x1f6b('0x12')](function(_0xfd9df5){if(_0x3a9607){_0x3a9607(null,_0xfd9df5);}})[_0x1f6b('0x18')](function(_0x43c9eb){if(_0x3a9607){_0x3a9607(_0x43c9eb);}});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x40')]=function(_0x506ac1,_0x540c67){this[_0x1f6b('0x10')][_0x1f6b('0x40')]({'firstName':_[_0x1f6b('0x41')](_0x506ac1[_0x1f6b('0x13')])||_['isNil'](_0x506ac1[_0x1f6b('0x13')])?_0x1f6b('0x42')+Math[_0x1f6b('0x43')]():_0x506ac1['name'],'lastName':_['isEmpty'](_0x506ac1[_0x1f6b('0x44')])||_['isNil'](_0x506ac1['lastName'])?null:_0x506ac1['lastName'],'phone':_0x506ac1[_0x1f6b('0x45')],'ListId':_0x506ac1[_0x1f6b('0x46')],'scheduledat':_0x506ac1[_0x1f6b('0x47')],'callbackUniqueid':this['channel'][_0x1f6b('0x35')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x506ac1[_0x1f6b('0x47')][_0x1f6b('0x48')](),'priority':_0x506ac1['callback_priority']})['then'](function(_0x4f6670){_0x540c67(null,_0x4f6670);})[_0x1f6b('0x18')](function(_0x14d2d4){_0x540c67(_0x14d2d4);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x49')]=function(_0xd64f95,_0x19536b){this[_0x1f6b('0x10')]['getPauseById'](_0xd64f95)[_0x1f6b('0x12')](function(_0x399937){_0x19536b(null,_0x399937?_0x399937['name']:![]);})['catch'](function(_0x3aabf5){_0x19536b(_0x3aabf5);});};AGIVertices[_0x1f6b('0xe')]['agentPause']=function(_0x12f331,_0x5e9c01,_0x58a075){var _0x1151a6={'role':_0x1f6b('0x4a')};_0x1151a6[_0x12f331]=this['channel'][_0x1f6b('0x39')];this[_0x1f6b('0x10')][_0x1f6b('0x4b')](_0x1151a6,_0x5e9c01,this[_0x1f6b('0xd')][_0x1f6b('0x35')])[_0x1f6b('0x12')](function(_0x32afde){_0x58a075(null,_['isNil'](_0x32afde)?![]:!![]);})[_0x1f6b('0x18')](function(_0x2523a9){logger[_0x1f6b('0x29')](_0x2523a9);_0x58a075(null,![]);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x4c')]=function(_0x3a7cfd,_0x32be36){var _0x584e7d={'role':_0x1f6b('0x4a')};_0x584e7d[_0x3a7cfd]=this['channel'][_0x1f6b('0x39')];this[_0x1f6b('0x10')]['agentUnpause'](_0x584e7d)[_0x1f6b('0x12')](function(_0xc00329){_0x32be36(null,_['isNil'](_0xc00329)?![]:!![]);})[_0x1f6b('0x18')](function(_0x464237){logger[_0x1f6b('0x29')](_0x464237);_0x32be36(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x47b8b3,_0x4dfad0){var _0x5dd090={'role':'agent'};_0x5dd090[_0x47b8b3]=this[_0x1f6b('0xd')][_0x1f6b('0x39')];this[_0x1f6b('0x10')]['agentLogout'](_0x5dd090)[_0x1f6b('0x12')](function(_0x4ea727){_0x4dfad0(null,_[_0x1f6b('0x4d')](_0x4ea727)?![]:!![]);})['catch'](function(_0x5d1967){logger[_0x1f6b('0x29')](_0x5d1967);_0x4dfad0(null,![]);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x4e')]=function(_0x4f4840,_0x4a6765){var _0x10466e={'role':_0x1f6b('0x4a')};_0x10466e[_0x4f4840]=this[_0x1f6b('0xd')][_0x1f6b('0x39')];var _0xa754e7=_0x4f4840!=_0x1f6b('0x4f')?util[_0x1f6b('0x27')](_0x1f6b('0x50'),_0x1f6b('0x51'),this[_0x1f6b('0xd')][_0x1f6b('0x39')]):undefined;this[_0x1f6b('0x10')]['agentLogin'](_0x10466e,_0xa754e7)[_0x1f6b('0x12')](function(_0x129893){_0x4a6765(null,_['isNil'](_0x129893)?![]:!![]);})[_0x1f6b('0x18')](function(_0x2c8339){logger['error'](_0x2c8339);_0x4a6765(null,![]);});};AGIVertices[_0x1f6b('0xe')]['shellCommand']=function(_0x143919,_0x1d6ff4){sh[_0x1f6b('0x52')](_[_0x1f6b('0x53')](_0x143919),function(_0x3d766e,_0x45e986){var _0x332d16=_0x45e986['replace'](/(\r\n|\n|\r)/gm,'');_0x1d6ff4(null,_0x332d16);});};AGIVertices['prototype'][_0x1f6b('0x54')]=function(_0x2c9268,_0x261069){scripts['googleCloudTTS'](_0x2c9268[_0x1f6b('0x55')],_0x2c9268['google_cloud_tts_text_type']||_0x1f6b('0x56'),_0x2c9268[_0x1f6b('0x56')],_0x2c9268[_0x1f6b('0x57')]||_0x1f6b('0x58'),_0x2c9268[_0x1f6b('0x59')]||'MALE',_0x2c9268['audioEncoding']||_0x1f6b('0x5a'))[_0x1f6b('0x12')](function(_0x3b5cde){_0x261069(null,_0x3b5cde);})[_0x1f6b('0x18')](function(_0x6906bd){_0x261069(_0x6906bd);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x5b')]=function(_0x9c5d29,_0x2cafc7){scripts['googleTTS'](_0x9c5d29[_0x1f6b('0x56')],_0x9c5d29['google_tts_language']||'en',0x1)['then'](function(_0x3511a9){_0x2cafc7(null,_0x3511a9);})[_0x1f6b('0x18')](function(_0x145c0a){_0x2cafc7(_0x145c0a);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x5c')]=function(_0x148c64,_0x22cc53){var _0x235967={'uri':_0x148c64['url'],'method':_0x148c64['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x148c64[_0x1f6b('0x5d')])==='number'&&parseInt(_0x148c64['timeout'])>=0x1?parseInt(_0x148c64[_0x1f6b('0x5d')])*0x3e8:0x5*0x3e8};if(_[_0x1f6b('0x5e')]([_0x1f6b('0x5f'),_0x1f6b('0x60')],_0x235967['method'][_0x1f6b('0x61')]())){try{_0x235967[_0x1f6b('0x62')]=_0x148c64[_0x1f6b('0x63')]?JSON['parse'](_0x148c64[_0x1f6b('0x63')]):{};}catch(_0x3e99e8){logger['error'](_0x1f6b('0x64'),_0x3e99e8);}}try{_0x235967[_0x1f6b('0x65')]=_0x148c64[_0x1f6b('0x9')]?JSON['parse'](_0x148c64[_0x1f6b('0x9')]):{};}catch(_0x13561f){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x13561f);}if(_0x148c64[_0x1f6b('0x66')]){try{var _0x31b81c=require(_0x148c64['computedVariables'])[_0x1f6b('0x67')](this,_0x235967);_0x235967[_0x1f6b('0x68')]=Mustache[_0x1f6b('0x69')](_0x148c64['url'],_0x31b81c,{},['$$','$$']);if(_0x235967[_0x1f6b('0x65')]){_0x235967[_0x1f6b('0x65')]=JSON[_0x1f6b('0x6a')](Mustache['render'](JSON[_0x1f6b('0x6b')](_0x235967[_0x1f6b('0x65')]),_0x31b81c,{},['$$','$$']));}if(_0x235967[_0x1f6b('0x62')]){_0x235967[_0x1f6b('0x62')]=JSON[_0x1f6b('0x6a')](Mustache[_0x1f6b('0x69')](JSON[_0x1f6b('0x6b')](_0x235967[_0x1f6b('0x62')]),_0x31b81c,{},['$$','$$']));}}catch(_0x3d55e9){logger[_0x1f6b('0x29')](_0x1f6b('0x6c'),_0x3d55e9);}}rp(_0x235967)['then'](function(_0x52c859){var _0x5f0ddd={'statusCode':_0x52c859[_0x1f6b('0x6d')]||0xc8,'statusMessage':_0x52c859['statusMessage']||'OK','headers':_0x52c859[_0x1f6b('0x65')]||{},'body':_0x52c859['body']||{}};_0x22cc53(null,_0x5f0ddd);})[_0x1f6b('0x18')](function(_0x371010){var _0x52e8d3={'statusCode':_0x371010[_0x1f6b('0x6d')]||0x1f4,'statusMessage':_0x371010[_0x1f6b('0x6e')]||_0x1f6b('0x6f'),'headers':_0x371010['options'][_0x1f6b('0x65')]||{},'body':_0x371010[_0x1f6b('0x70')][_0x1f6b('0x62')]||{}};_0x22cc53(null,_0x52e8d3);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x71')]=function(_0x1e30f2,_0x385b9e){scripts[_0x1f6b('0x71')](this[_0x1f6b('0xd')][_0x1f6b('0x35')],_0x1e30f2['key'],_0x1e30f2[_0x1f6b('0x56')],_0x1e30f2[_0x1f6b('0x72')]||'en')[_0x1f6b('0x12')](function(_0x6002f4){_0x385b9e(null,_0x6002f4);})[_0x1f6b('0x18')](function(_0x33f65c){_0x385b9e(_0x33f65c);});};AGIVertices[_0x1f6b('0xe')]['googleDialogflowV2']=function(_0xfff71e,_0x32a320){scripts[_0x1f6b('0x73')](this[_0x1f6b('0xd')]['uniqueid'],_0xfff71e['dialogflowV2_project_id'],_0xfff71e[_0x1f6b('0x74')],_0xfff71e[_0x1f6b('0x75')],_0xfff71e[_0x1f6b('0x56')],_0xfff71e['dialogflowV2_language']||'en')[_0x1f6b('0x12')](function(_0x4e12e7){_0x32a320(null,_0x4e12e7);})[_0x1f6b('0x18')](function(_0x3ef805){_0x32a320(_0x3ef805);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x76')]=function(_0x4c281f,_0x1bf68c){scripts[_0x1f6b('0x76')](this[_0x1f6b('0xd')],_0x4c281f)['then'](function(_0x5694e3){_0x1bf68c(null,_0x5694e3);})['catch'](function(_0x40723a){_0x1bf68c(_0x40723a);});};AGIVertices['prototype'][_0x1f6b('0x77')]=function(_0x53e009,_0xadb8ec){scripts['ispeechTTS'](_0x53e009[_0x1f6b('0x78')],_0x53e009[_0x1f6b('0x56')],_0x53e009[_0x1f6b('0x79')]||_0x1f6b('0x58'),_0x53e009['speed'])[_0x1f6b('0x12')](function(_0x699143){_0xadb8ec(null,_0x699143);})[_0x1f6b('0x18')](function(_0x4889bf){_0xadb8ec(_0x4889bf);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x7a')]=function(_0x39a902,_0x547c49,_0x13eaba){scripts[_0x1f6b('0x7a')](_0x547c49,_0x39a902['key'],_0x39a902['ispeech_asr_language']||_0x1f6b('0x58'),this['isConfigured'](_0x39a902[_0x1f6b('0x7b')])?_0x39a902[_0x1f6b('0x7b')]:undefined)[_0x1f6b('0x12')](function(_0x37cf8b){_0x13eaba(null,_0x37cf8b);})[_0x1f6b('0x18')](function(_0x3bfc06){_0x13eaba(_0x3bfc06);});};AGIVertices['prototype'][_0x1f6b('0x7c')]=function(_0x16e8c7,_0xfe2a11){scripts[_0x1f6b('0x7c')](_0x16e8c7[_0x1f6b('0x7d')],_0x16e8c7[_0x1f6b('0x7e')],_0x16e8c7['aws_polly_region'],_0x16e8c7[_0x1f6b('0x7f')]||'Amy',_0x16e8c7[_0x1f6b('0x56')],_0x16e8c7[_0x1f6b('0x80')]||_0x1f6b('0x56'))[_0x1f6b('0x12')](function(_0x2e7291){_0xfe2a11(null,_0x2e7291);})[_0x1f6b('0x18')](function(_0x4b6373){_0xfe2a11(_0x4b6373);});};AGIVertices[_0x1f6b('0xe')]['awsLex']=function(_0x18db84,_0x866c75){scripts[_0x1f6b('0x81')](this[_0x1f6b('0xd')][_0x1f6b('0x35')],_0x18db84[_0x1f6b('0x7d')],_0x18db84[_0x1f6b('0x7e')],_0x18db84[_0x1f6b('0x82')],_0x18db84[_0x1f6b('0x56')],_0x18db84[_0x1f6b('0x83')])[_0x1f6b('0x12')](function(_0x3aef46){_0x866c75(null,_0x3aef46);})['catch'](function(_0x1a1e4c){_0x866c75(_0x1a1e4c);});};AGIVertices['prototype'][_0x1f6b('0x84')]=function(_0x925439,_0x4a3f6f,_0x16137b){scripts[_0x1f6b('0x84')](_0x4a3f6f,_0x925439[_0x1f6b('0x78')],_0x925439[_0x1f6b('0x85')]||'en-US')['then'](function(_0x57334a){_0x16137b(null,_0x57334a);})[_0x1f6b('0x18')](function(_0x1ea2db){_0x16137b(_0x1ea2db);});};AGIVertices[_0x1f6b('0xe')]['tildeASR']=function(_0x297339,_0x3e2f28,_0xe1ae9d){scripts['tildeASR'](_0x3e2f28,_0x297339['appid'],_0x297339['appsecret'],_0x297339[_0x1f6b('0x68')])[_0x1f6b('0x12')](function(_0x3e1ac4){_0xe1ae9d(null,_0x3e1ac4);})['catch'](function(_0x247c7d){_0xe1ae9d(_0x247c7d);});};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x86')]=function(_0x367cf4){var _0x1a5bf=_['includes'](verticesWithRetry,_0x367cf4[_0x1f6b('0x37')])?_0x367cf4:_[_0x1f6b('0x87')](_0x367cf4);for(var _0x43166b in _0x1a5bf){if(_0x1a5bf['hasOwnProperty'](_0x43166b)){if(_0x1a5bf[_0x43166b]&&_[_0x1f6b('0x88')](_0x1a5bf[_0x43166b])){if(_[_0x1f6b('0x5e')](recursiveMapAttributes,_0x43166b)){_0x1a5bf[_0x43166b]=this['replaceObjectAllVariables'](_0x1a5bf[_0x43166b]);}else{_0x1a5bf[_0x43166b]=this[_0x1f6b('0x89')](_0x1a5bf[_0x43166b]);}}}}return _0x1a5bf;};AGIVertices['prototype'][_0x1f6b('0x8a')]=function(_0x5368bc){for(var _0x53b8b8 in _0x5368bc){if(_0x5368bc[_0x1f6b('0x8b')](_0x53b8b8)){if(_[_0x1f6b('0x8c')](_0x5368bc[_0x53b8b8])){this[_0x1f6b('0x8a')](_0x5368bc[_0x53b8b8]);}else if(_['isArray'](_0x5368bc[_0x53b8b8])){for(var _0x1c3c9b=0x0;_0x1c3c9b<_0x5368bc[_0x53b8b8][_0x1f6b('0x8d')];_0x1c3c9b++){this[_0x1f6b('0x8a')](_0x5368bc[_0x53b8b8][_0x1c3c9b]);}}else if(_[_0x1f6b('0x88')](_0x5368bc[_0x53b8b8])){_0x5368bc[_0x53b8b8]=this[_0x1f6b('0x89')](_0x5368bc[_0x53b8b8]);}}}};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x8e')]=function(_0x16072a,_0x32be6e){for(var _0x53dabf in _0x16072a){if(_0x16072a[_0x1f6b('0x8b')](_0x53dabf)){if(_[_0x1f6b('0x8c')](_0x16072a[_0x53dabf])){if(!_[_0x1f6b('0x41')](_0x16072a[_0x53dabf])){this['saveRestApiResult'](_0x16072a[_0x53dabf],util[_0x1f6b('0x27')](_0x1f6b('0x8f'),_0x32be6e,_0x53dabf));}}else if(_[_0x1f6b('0x90')](_0x16072a[_0x53dabf])){for(var _0x55e0a1=0x0;_0x55e0a1<_0x16072a[_0x53dabf]['length'];_0x55e0a1++){this[_0x1f6b('0x8e')](_0x16072a[_0x53dabf][_0x55e0a1],util[_0x1f6b('0x27')]('%s.%s',_0x32be6e,_0x53dabf+'['+_0x55e0a1+']'));}}else{if(!_[_0x1f6b('0x4d')](_0x16072a[_0x53dabf])){this[_0x1f6b('0xd')][_0x1f6b('0x91')](util[_0x1f6b('0x27')](_0x1f6b('0x8f'),_0x32be6e,_0x53dabf),_0x16072a[_0x53dabf]);}}}}};AGIVertices[_0x1f6b('0xe')]['replaceObjectAllVariables']=function(_0x219e6f){try{var _0x243532=JSON['parse'](_0x219e6f);this['recursiveNodeIndex'](_0x243532);return JSON[_0x1f6b('0x6b')](_0x243532);}catch(_0x2d0a05){return this[_0x1f6b('0x89')](_0x219e6f);}};AGIVertices[_0x1f6b('0xe')]['replaceAllVariables']=function(_0x284b42){var _0x39b24d=_0x284b42['split']('{');for(var _0x4f328d=0x1;_0x4f328d<_0x39b24d[_0x1f6b('0x8d')];_0x4f328d+=0x1){var _0x461ca8=_0x39b24d[_0x4f328d][_0x1f6b('0x92')]('}');if(_0x461ca8[_0x1f6b('0x8d')]>0x1){_0x284b42=_0x284b42['replaceAll']('{'+_0x461ca8[0x0]+'}',this[_0x1f6b('0xd')][_0x1f6b('0xf')](_0x461ca8[0x0])[_0x1f6b('0x93')]||_0x461ca8[0x0]);}}if(_0x39b24d[_0x1f6b('0x8d')]===0x1){return _0x284b42[_0x1f6b('0x48')]();}return this[_0x1f6b('0x89')](_0x284b42);};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x94')]=function(_0x9d1a03,_0x5bb062){var _0x59953e=this[_0x1f6b('0xd')][_0x1f6b('0xf')](_0x9d1a03);if(_0x59953e['result']===-0x1){return _0x59953e;}logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5bb062,_0x59953e[_0x1f6b('0x93')]));return this['channel']['setVariable'](_0x5bb062,_0x59953e[_0x1f6b('0x93')]);};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x95')]=function(_0x1faad5){return _0x1faad5&&_0x1faad5!=='0'&&_0x1faad5!=='-1'&&_0x1faad5!=='';};AGIVertices[_0x1f6b('0xe')]['maxRetry']=function(_0x25ef2d){this[_0x1f6b('0x34')][_0x1f6b('0x67')](this,_0x25ef2d,'-');_0x25ef2d[_0x1f6b('0x96')]=_0x25ef2d[_0x1f6b('0x97')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x98')]=function(_0x516a4b){logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x99'),_0x516a4b[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x516a4b[_0x1f6b('0x56')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')]('no\x20text\x20configured');}var _0x33d3f2='\x22'+_0x516a4b[_0x1f6b('0x56')]+'\x22';if(this[_0x1f6b('0x95')](_0x516a4b[_0x1f6b('0x70')])){_0x33d3f2+=','+_0x516a4b[_0x1f6b('0x70')];}var _0x54d2bf=this[_0x1f6b('0xd')]['exec'](_0x1f6b('0x9b'),_0x33d3f2);if(_0x54d2bf['result']===-0x1){return _0x54d2bf;}return this['channel']['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x33d3f2));};AGIVertices['prototype'][_0x1f6b('0x9c')]=function(_0x20247b){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x9d'),_0x20247b[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x20247b[_0x1f6b('0x9e')])){return this['channel'][_0x1f6b('0x9a')]('no\x20grammar\x20configured');}var _0x4ce190=_0x20247b[_0x1f6b('0x9e')];if(this['isConfigured'](_0x20247b[_0x1f6b('0x70')])){_0x4ce190+=','+_0x20247b[_0x1f6b('0x70')];}var _0x56ad2b=this['channel'][_0x1f6b('0x52')](_0x1f6b('0x9f'),_0x4ce190);if(_0x56ad2b['result']===-0x1){return _0x56ad2b;}var _0x8592a6=this['getAndSetVariable'](_0x1f6b('0xa0'),_0x1f6b('0xa1'));if(_0x8592a6['result']===-0x1){return _0x8592a6;}var _0x5ee105=this[_0x1f6b('0x94')]('RECOG_INPUT()',_0x1f6b('0xa2'));if(_0x5ee105['result']===-0x1){return _0x5ee105;}var _0x134fd6=this['getAndSetVariable']('RECOG_INSTANCE()',_0x1f6b('0xa3'));if(_0x134fd6[_0x1f6b('0xa4')]===-0x1){return _0x134fd6;}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0xa5'),_0x4ce190));};AGIVertices['prototype'][_0x1f6b('0x5')]=function(_0x7f18d6){logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0xa6'),_0x7f18d6[_0x1f6b('0x36')]));return this[_0x1f6b('0xd')]['agi']([_0x7f18d6['command'],_0x7f18d6[_0x1f6b('0xa7')]]);};AGIVertices['prototype'][_0x1f6b('0xa8')]=function(_0x15878b){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0xa9'),_0x15878b[_0x1f6b('0x36')]));if(this[_0x1f6b('0x95')](_0x15878b[_0x1f6b('0x5d')])){logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0xaa'),_0x15878b[_0x1f6b('0x5d')]));var _0x7b7e14=this['channel'][_0x1f6b('0xab')](_0x15878b[_0x1f6b('0x5d')]);if(_0x7b7e14['result']===-0x1){return _0x7b7e14;}}return this[_0x1f6b('0xd')]['answer']();};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xac')]=function(_0x350860){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0xad'),_0x350860[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x350860[_0x1f6b('0x46')])){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x350860,'no\x20list\x20selected');}_0x350860[_0x1f6b('0x47')]=moment();if(this[_0x1f6b('0x95')](_0x350860[_0x1f6b('0xae')])){_0x350860[_0x1f6b('0x47')]=moment()[_0x1f6b('0xaf')](_0x350860[_0x1f6b('0xae')],_0x1f6b('0xb0'));}if(!this[_0x1f6b('0x95')](_0x350860[_0x1f6b('0xb1')])){_0x350860['callback_priority']=0x2;}this[_0x1f6b('0x40')][_0x1f6b('0x67')](this,_0x350860);return this[_0x1f6b('0xd')]['noop'](util[_0x1f6b('0x27')](_0x1f6b('0xb2'),_0x350860['phone'],_0x350860[_0x1f6b('0x46')],_0x350860[_0x1f6b('0x47')]));};AGIVertices[_0x1f6b('0xe')]['custom_app']=function(_0x184248){logger['info'](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x184248[_0x1f6b('0x36')]));var _0x4bc23f=this[_0x1f6b('0xd')][_0x1f6b('0x52')](_0x184248[_0x1f6b('0xb3')],_0x184248[_0x1f6b('0x70')]);if(_0x4bc23f[_0x1f6b('0xa4')]===-0x1){return _0x4bc23f;}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util['format'](_0x1f6b('0xb4'),_0x184248[_0x1f6b('0xb3')],_0x184248['options']));};AGIVertices['prototype'][_0x1f6b('0xb5')]=function(_0x43f403){logger[_0x1f6b('0x2d')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x43f403[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x43f403[_0x1f6b('0x56')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')]('no\x20text\x20configured');}var _0xd6376e='\x22'+_0x43f403[_0x1f6b('0x56')]+'\x22';if(this['isConfigured'](_0x43f403[_0x1f6b('0x70')])){_0xd6376e+=','+_0x43f403[_0x1f6b('0x70')];}var _0x5af3ba=this['channel'][_0x1f6b('0x52')]('MRCPSynth',_0xd6376e);if(_0x5af3ba[_0x1f6b('0xa4')]===-0x1){return _0x5af3ba;}return this[_0x1f6b('0xd')]['noop'](util[_0x1f6b('0x27')](_0x1f6b('0xb6'),_0xd6376e));};AGIVertices[_0x1f6b('0xe')]['sestektts']=function(_0x8cada3){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0xb7'),_0x8cada3[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x8cada3['text'])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xb8'));}var _0x760112='\x22'+_0x8cada3['text']+'\x22';if(this[_0x1f6b('0x95')](_0x8cada3['options'])){_0x760112+=','+_0x8cada3['options'];}var _0x4852ec=this[_0x1f6b('0xd')][_0x1f6b('0x52')]('MRCPSynth',_0x760112);if(_0x4852ec[_0x1f6b('0xa4')]===-0x1){return _0x4852ec;}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x760112));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xb9')]=function(_0x4c3cf8){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0xba'),_0x4c3cf8[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x4c3cf8['grammar'])){return this['channel'][_0x1f6b('0x9a')](_0x1f6b('0xbb'));}var _0x493fd9=_0x4c3cf8['grammar'];if(this[_0x1f6b('0x95')](_0x4c3cf8[_0x1f6b('0x70')])){_0x493fd9+=','+_0x4c3cf8[_0x1f6b('0x70')];}var _0x4f6b56=this[_0x1f6b('0xd')][_0x1f6b('0x52')](_0x1f6b('0x9f'),_0x493fd9);if(_0x4f6b56[_0x1f6b('0xa4')]===-0x1){return _0x4f6b56;}var _0x20f46f=this[_0x1f6b('0x94')](_0x1f6b('0xa0'),'LUMENVOX_ASR_CONFIDENCE');if(_0x20f46f[_0x1f6b('0xa4')]===-0x1){return _0x20f46f;}var _0x5945bd=this[_0x1f6b('0x94')](_0x1f6b('0xbc'),_0x1f6b('0xbd'));if(_0x5945bd[_0x1f6b('0xa4')]===-0x1){return _0x5945bd;}var _0x508a08=this[_0x1f6b('0x94')]('RECOG_INSTANCE()',_0x1f6b('0xbe'));if(_0x508a08[_0x1f6b('0xa4')]===-0x1){return _0x508a08;}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0xa5'),_0x493fd9));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xbf')]=function(_0x571acb){logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0xc0'),_0x571acb[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x571acb[_0x1f6b('0x9e')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xbb'));}var _0x360eb8=_0x571acb[_0x1f6b('0x9e')];if(this[_0x1f6b('0x95')](_0x571acb[_0x1f6b('0x70')])){_0x360eb8+=','+_0x571acb[_0x1f6b('0x70')];}var _0x3a720b=this['channel']['exec'](_0x1f6b('0x9f'),_0x360eb8);if(_0x3a720b[_0x1f6b('0xa4')]===-0x1){return _0x3a720b;}var _0x2d9ff2=this['getAndSetVariable'](_0x1f6b('0xa0'),_0x1f6b('0xc1'));if(_0x2d9ff2[_0x1f6b('0xa4')]===-0x1){return _0x2d9ff2;}var _0x59ce2d=this[_0x1f6b('0x94')](_0x1f6b('0xbc'),'SESTEK_ASR_TRANSCRIPT');if(_0x59ce2d['result']===-0x1){return _0x59ce2d;}var _0x242f49=this[_0x1f6b('0x94')]('RECOG_INSTANCE()',_0x1f6b('0xc2'));if(_0x242f49[_0x1f6b('0xa4')]===-0x1){return _0x242f49;}return this['channel'][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0xa5'),_0x360eb8));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xc3')]=function(_0x5cfd74){logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0xc4'),_0x5cfd74[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x5cfd74[_0x1f6b('0xc5')])){return this['channel'][_0x1f6b('0x29')](_0x5cfd74,'no\x20database\x20selected');}var _0x4d88e0=this['getSquareOdbc'][_0x1f6b('0x67')](this,_0x5cfd74['odbc_id']);if(!_0x4d88e0){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x5cfd74,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x5cfd74[_0x1f6b('0x2c')])){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x5cfd74,'no\x20query\x20configured');}var _0x2197ea=_0x5cfd74['query'][_0x1f6b('0xc6')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x1f6b('0x9a')](util['format'](_0x1f6b('0xc7'),_0x2197ea));var _0x13435f=this[_0x1f6b('0xc8')][_0x1f6b('0x67')](this,_0x4d88e0,_0x2197ea);this['createSquareDetailsReport'][_0x1f6b('0x67')](this,_0x5cfd74,_0x2197ea);if(!this['isConfigured'](_0x5cfd74[_0x1f6b('0xc9')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xca'));}var _0x3480a2=this['getVariable'][_0x1f6b('0x67')](this,_0x5cfd74[_0x1f6b('0xc9')]);if(!_0x3480a2){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x5cfd74,'no\x20variable\x20found');}var _0x592b91=this;_0x13435f[_0x1f6b('0xcb')](function(_0x36d305,_0x530d74){Object[_0x1f6b('0xcc')](_0x36d305)[_0x1f6b('0xcb')](function(_0x5a86cc){_0x592b91[_0x1f6b('0xd')][_0x1f6b('0x91')](util[_0x1f6b('0x27')](_0x1f6b('0xcd'),_0x3480a2,_0x530d74,_0x5a86cc),_0x36d305[_0x5a86cc]);});});this[_0x1f6b('0xd')][_0x1f6b('0x91')](util['format'](_0x1f6b('0xce'),_0x3480a2),_0x13435f[_0x1f6b('0x8d')]);return this[_0x1f6b('0xd')]['noop'](util[_0x1f6b('0x27')](_0x1f6b('0xcf'),_0x3480a2));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xd0')]=function(_0x573d2c){logger['debug'](util[_0x1f6b('0x27')](_0x1f6b('0xd1'),_0x573d2c[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x573d2c[_0x1f6b('0xd2')])){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x573d2c,_0x1f6b('0xd3'));}var _0x48ba43=this[_0x1f6b('0xd4')][_0x1f6b('0x67')](this,_0x573d2c[_0x1f6b('0xd2')]);if(!_0x48ba43){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x573d2c,_0x1f6b('0xd5'));}var _0xdd2352=this[_0x1f6b('0xd')]['exec'](_0x1f6b('0xd6'),[util[_0x1f6b('0x27')](_0x1f6b('0xd7'),_0x48ba43),_0x573d2c['timeout'],_0x573d2c[_0x1f6b('0xd8')],_0x573d2c[_0x1f6b('0xd9')]]);if(_0xdd2352[_0x1f6b('0xa4')]===-0x1){return _0xdd2352;}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0xda'),_0x1f6b('0xd6')));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xdb')]=function(_0x21ef8a){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0xdc'),_0x21ef8a[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x21ef8a[_0x1f6b('0x78')])){return this['channel'][_0x1f6b('0x9a')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x21ef8a[_0x1f6b('0x56')])){return this[_0x1f6b('0xd')]['noop'](_0x1f6b('0xb8'));}this[_0x1f6b('0xd')][_0x1f6b('0xdd')]=!![];this[_0x1f6b('0x34')](_0x21ef8a);this[_0x1f6b('0x3f')](_0x21ef8a[_0x1f6b('0x56')],'in','','');this[_0x1f6b('0xd')]['noop'](util['format'](_0x1f6b('0xde'),_0x21ef8a[_0x1f6b('0x56')]));var _0x477bc3=this[_0x1f6b('0x71')][_0x1f6b('0x67')](this,_0x21ef8a);if(_0x477bc3){for(var _0x4d4cca in _0x477bc3){if(_0x477bc3[_0x1f6b('0x8b')](_0x4d4cca)){this[_0x1f6b('0xd')]['setVariable'](util['format'](_0x1f6b('0xdf'),_0x4d4cca['toUpperCase']()),_0x477bc3[_0x4d4cca]);}}this['createSquareMessage'](_0x477bc3['speech'],_0x1f6b('0xe0'),_0x1f6b('0xdb'),'');return this[_0x1f6b('0xd')]['noop'](util[_0x1f6b('0x27')]('Dialogflow\x20Result\x20%s',_0x477bc3['speech']));}return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x21ef8a,_0x1f6b('0xe1'));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xe2')]=function(_0x27a9fd){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0xe3'),_0x27a9fd[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x27a9fd['dialogflowV2_project_id'])){return this['channel']['noop'](_0x1f6b('0xe4'));}if(!this['isConfigured'](_0x27a9fd[_0x1f6b('0x74')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xe5'));}if(!this[_0x1f6b('0x95')](_0x27a9fd[_0x1f6b('0x75')])){return this[_0x1f6b('0xd')]['noop'](_0x1f6b('0xe6'));}if(!this[_0x1f6b('0x95')](_0x27a9fd[_0x1f6b('0xe7')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xe8'));}if(!this['isConfigured'](_0x27a9fd['text'])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xb8'));}this[_0x1f6b('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x27a9fd);this[_0x1f6b('0x3f')](_0x27a9fd[_0x1f6b('0x56')],'in','','');this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util['format'](_0x1f6b('0xe9'),_0x27a9fd[_0x1f6b('0x56')]));var _0x35d5f1=this[_0x1f6b('0x73')][_0x1f6b('0x67')](this,_0x27a9fd);if(_0x35d5f1){for(var _0x21f6b8 in _0x35d5f1){if(_0x35d5f1['hasOwnProperty'](_0x21f6b8)){if(_0x21f6b8!==_0x1f6b('0xea')){this[_0x1f6b('0xd')][_0x1f6b('0x91')](util['format'](_0x1f6b('0xdf'),_0x21f6b8[_0x1f6b('0x61')]()),_0x35d5f1[_0x21f6b8]);}}}this['createSquareMessage'](_0x35d5f1[_0x1f6b('0xeb')],_0x1f6b('0xe0'),_0x1f6b('0xe2'),_0x35d5f1[_0x1f6b('0xea')]);return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0xec'),_0x35d5f1[_0x1f6b('0xeb')]));}return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x27a9fd,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0x1f6b('0xed')]=function(_0x23a5d8){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x23a5d8[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x23a5d8[_0x1f6b('0xee')])){return this['channel']['noop'](_0x1f6b('0xef'));}if(!this[_0x1f6b('0x95')](_0x23a5d8[_0x1f6b('0xf0')])){return this[_0x1f6b('0xd')]['noop'](_0x1f6b('0xf1'));}if(!this[_0x1f6b('0x95')](_0x23a5d8[_0x1f6b('0xf2')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xf3'));}if(!this[_0x1f6b('0x95')](_0x23a5d8[_0x1f6b('0xf4')])){return this['channel'][_0x1f6b('0x9a')](_0x1f6b('0xb8'));}this[_0x1f6b('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x23a5d8);this['createSquareMessage'](_0x23a5d8['text'],'in','','');this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util['format'](_0x1f6b('0xf5'),_0x23a5d8['text']));var _0x41f1be=this[_0x1f6b('0x76')][_0x1f6b('0x67')](this,_0x23a5d8);if(_0x41f1be){for(var _0x3e4425 in _0x41f1be){if(_0x41f1be[_0x1f6b('0x8b')](_0x3e4425)){this[_0x1f6b('0xd')][_0x1f6b('0x91')](util[_0x1f6b('0x27')](_0x1f6b('0xf6'),_0x3e4425[_0x1f6b('0x61')]()),_0x41f1be[_0x3e4425]);}}this['createSquareMessage'](_0x41f1be[_0x1f6b('0xeb')],'out',_0x1f6b('0xed'),'');if(_0x41f1be['audiofile']){this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0xf7'),_0x41f1be[_0x1f6b('0xf8')]));var _0xef7795=this['channel'][_0x1f6b('0xf9')](_0x41f1be[_0x1f6b('0xf8')]);try{fs[_0x1f6b('0xfa')](_0x41f1be[_0x1f6b('0xf8')]+_0x1f6b('0xfb'));}catch(_0x38e908){logger[_0x1f6b('0x29')](_0x38e908);}return _0xef7795;}else{return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util['format']('SestekNDA\x20Result\x20%s',_0x41f1be[_0x1f6b('0xeb')]));}}return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x23a5d8,_0x1f6b('0xfc'));};AGIVertices[_0x1f6b('0xe')]['end']=function(_0x61fa34){logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0xfd'),_0x61fa34[_0x1f6b('0x36')]));return this['channel'][_0x1f6b('0x9a')]('end');};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xfe')]=function(_0x36e0e8){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0xff'),_0x36e0e8[_0x1f6b('0x36')]));var _0x356a10='';if(_0x36e0e8[_0x1f6b('0x100')]){if(!this[_0x1f6b('0x95')](_0x36e0e8[_0x1f6b('0x100')])){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x36e0e8,'no\x20trunk\x20selected');}else{var _0x50ea36=parseInt(_0x36e0e8[_0x1f6b('0x100')],0xa);if(isNaN(_0x50ea36)){_0x356a10=_0x36e0e8['trunk_id'];}else{_0x356a10=this[_0x1f6b('0x1a')][_0x1f6b('0x67')](this,_0x36e0e8[_0x1f6b('0x100')]);if(!_0x356a10){return this[_0x1f6b('0xd')]['error'](_0x36e0e8,_0x1f6b('0x101'));}}}}else if(_0x36e0e8['trunk_name']){_0x356a10=_0x36e0e8[_0x1f6b('0x102')];}else{return this['channel'][_0x1f6b('0x29')](_0x36e0e8,_0x1f6b('0x103'));}var _0x3ce111=this[_0x1f6b('0xd')]['exec'](_0x1f6b('0xd6'),[util[_0x1f6b('0x27')](_0x1f6b('0x104'),_0x356a10,_0x36e0e8['phone']),_0x36e0e8[_0x1f6b('0x5d')],_0x36e0e8[_0x1f6b('0xd8')],_0x36e0e8['url']]);if(_0x3ce111[_0x1f6b('0xa4')]===-0x1){return _0x3ce111;}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0xda'),_0x1f6b('0xd6')));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x105')]=function(_0x412151){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x412151['label']));return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0x105'));};AGIVertices[_0x1f6b('0xe')]['getdigits']=function(_0x208ace){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x106'),_0x208ace[_0x1f6b('0x36')]));if(_0x208ace[_0x1f6b('0x96')]===0x0){return this[_0x1f6b('0x97')](_0x208ace);}_0x208ace['retry']-=0x1;if(!this[_0x1f6b('0x95')](_0x208ace[_0x1f6b('0x107')])){return this[_0x1f6b('0xd')]['error'](_0x208ace,_0x1f6b('0x108'));}var _0x1b6d17=this[_0x1f6b('0x1b')][_0x1f6b('0x67')](this,_0x208ace[_0x1f6b('0x107')]);if(!_0x1b6d17){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x208ace,_0x1f6b('0x109'));}if(!this[_0x1f6b('0x95')](_0x208ace[_0x1f6b('0xc9')])){return this[_0x1f6b('0xd')]['error'](_0x1f6b('0xca'));}var _0x4996a0=this[_0x1f6b('0xd')][_0x1f6b('0x10a')](_0x1b6d17,_0x208ace[_0x1f6b('0x10b')],_0x208ace[_0x1f6b('0x10c')]);var _0x14ad27=_0x4996a0['result']?_0x4996a0[_0x1f6b('0xa4')][_0x1f6b('0x48')]():'';logger[_0x1f6b('0x2d')](_0x1f6b('0x10d'),JSON[_0x1f6b('0x6b')](_0x4996a0));if(_0x4996a0[_0x1f6b('0xa4')]===-0x1){this[_0x1f6b('0x34')][_0x1f6b('0x67')](this,_0x208ace,_0x14ad27);return _0x4996a0;}else if(_0x4996a0[_0x1f6b('0x93')]===_0x1f6b('0x5d')){_0x4996a0[_0x1f6b('0xa4')]=_0x14ad27[_0x1f6b('0x8d')]>=parseInt(_0x208ace[_0x1f6b('0x10e')])?'x':'i';}else{_0x4996a0[_0x1f6b('0xa4')]=_0x14ad27[_0x1f6b('0x8d')]>=parseInt(_0x208ace[_0x1f6b('0x10e')])&&_0x14ad27[_0x1f6b('0x8d')]<=parseInt(_0x208ace[_0x1f6b('0x10c')])?'x':'i';}var _0x4c6dec=this[_0x1f6b('0xf')][_0x1f6b('0x67')](this,_0x208ace[_0x1f6b('0xc9')]);if(!_0x4c6dec){return this['channel']['error'](_0x208ace,_0x1f6b('0x10f'));}this['channel'][_0x1f6b('0x91')](_0x4c6dec,_0x14ad27);if(this[_0x1f6b('0x95')](_0x208ace['hiddendigitsnum'])){var _0x1a9a84=parseInt(_0x208ace[_0x1f6b('0x110')],0xa);var _0x4bf2c8=rs['generate']({'charset':'*','length':_0x1a9a84});var _0x21dc34=_0x14ad27['length'];if(_0x21dc34>0x0){if(_0x21dc34>_0x1a9a84){this[_0x1f6b('0x34')][_0x1f6b('0x67')](this,_0x208ace,_0x208ace[_0x1f6b('0x111')]===_0x1f6b('0x112')?_0x4bf2c8+_0x14ad27[_0x1f6b('0x113')](_0x1a9a84):_0x14ad27[_0x1f6b('0x113')](0x0,_0x21dc34-_0x1a9a84)+_0x4bf2c8);}else{this[_0x1f6b('0x34')][_0x1f6b('0x67')](this,_0x208ace,rs[_0x1f6b('0x114')]({'charset':'*','length':_0x21dc34}));}}else{this[_0x1f6b('0x34')]['sync'](this,_0x208ace,'');}}else{this['createSquareDetailsReport'][_0x1f6b('0x67')](this,_0x208ace,_0x14ad27);}return _0x4996a0;};AGIVertices['prototype']['getsecretdigits']=function(_0x70e439){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x115'),_0x70e439[_0x1f6b('0x36')]));return this[_0x1f6b('0xb')](_0x70e439);};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x116')]=function(_0x29e414){logger['info'](util['format'](_0x1f6b('0x117'),_0x29e414[_0x1f6b('0x36')]));this['createSquareDetailsReport'][_0x1f6b('0x67')](this,_0x29e414,_0x29e414['goalname']);return this['channel'][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x118'),_0x29e414['goalname']));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x119')]=function(_0x5053fa){logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x11a'),_0x5053fa[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x5053fa['aws_access_key_id'])||!this['isConfigured'](_0x5053fa[_0x1f6b('0x7e')])){return this['channel'][_0x1f6b('0x9a')](_0x1f6b('0x11b'));}if(!this[_0x1f6b('0x95')](_0x5053fa[_0x1f6b('0x56')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xb8'));}this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x11c'),_0x5053fa[_0x1f6b('0x56')]));var _0x5219a8=this[_0x1f6b('0x7c')][_0x1f6b('0x67')](this,_0x5053fa);if(_0x5219a8){this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x11d'),_0x5219a8));var _0x569a95=this[_0x1f6b('0xd')][_0x1f6b('0xf9')](_0x5219a8);try{fs[_0x1f6b('0xfa')](_0x5219a8+_0x1f6b('0xfb'));}catch(_0x2f7d7c){logger[_0x1f6b('0x29')](_0x2f7d7c);}return _0x569a95;}return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x5053fa,_0x1f6b('0x11e'));};AGIVertices['prototype'][_0x1f6b('0x11f')]=function(_0x1a1485){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x120'),_0x1a1485[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x1a1485[_0x1f6b('0x7d')])||!this[_0x1f6b('0x95')](_0x1a1485[_0x1f6b('0x7e')])){return this[_0x1f6b('0xd')]['noop'](_0x1f6b('0x11b'));}if(!this['isConfigured'](_0x1a1485[_0x1f6b('0x83')])){return this['channel'][_0x1f6b('0x9a')](_0x1f6b('0x121'));}if(!this[_0x1f6b('0x95')](_0x1a1485[_0x1f6b('0x56')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')]('no\x20text\x20configured');}this[_0x1f6b('0xd')][_0x1f6b('0xdd')]=!![];this[_0x1f6b('0x34')](_0x1a1485);this[_0x1f6b('0x3f')](_0x1a1485[_0x1f6b('0x56')],'in','','');this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x122'),_0x1a1485[_0x1f6b('0x56')]));var _0x4a0f2f=this[_0x1f6b('0x81')]['sync'](this,_0x1a1485);if(_0x4a0f2f){for(var _0x39df14 in _0x4a0f2f){if(_0x4a0f2f[_0x1f6b('0x8b')](_0x39df14)&&_[_0x1f6b('0x88')](_0x4a0f2f[_0x39df14])){this['channel'][_0x1f6b('0x91')](util['format'](_0x1f6b('0x123'),_0x39df14[_0x1f6b('0x61')]()),_0x4a0f2f[_0x39df14]);}}if(_[_0x1f6b('0x4d')](_0x4a0f2f[_0x1f6b('0x6e')])){return this['channel'][_0x1f6b('0x9a')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x1f6b('0x3f')](_0x4a0f2f[_0x1f6b('0x6e')],_0x1f6b('0xe0'),_0x1f6b('0x124'),'');return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x125'),_0x4a0f2f[_0x1f6b('0x6e')]));}}return this[_0x1f6b('0xd')]['error'](_0x1a1485,_0x1f6b('0x126'));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x127')]=function(_0xb6ecc0){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x128'),_0xb6ecc0[_0x1f6b('0x36')],_0xb6ecc0['timeout']));if(!this['isConfigured'](_0xb6ecc0[_0x1f6b('0x78')])){return this[_0x1f6b('0xd')]['noop'](_0x1f6b('0x129'));}var _0x224c22=_0x1f6b('0x12a');var _0x140185=util[_0x1f6b('0x27')](_0x1f6b('0x12b'),FILES_PATH,rs[_0x1f6b('0x114')](0x4));var _0x1c0bf8=util[_0x1f6b('0x27')](_0x1f6b('0x8f'),_0x140185,_0x224c22);var _0x3e9faf=!![];if(_0xb6ecc0['beep']==='NOBEEP'){_0x3e9faf=![];}var _0x273f18=this[_0x1f6b('0xd')][_0x1f6b('0x12c')](_0x140185,_0x224c22,_0xb6ecc0[_0x1f6b('0x12d')],_0xb6ecc0[_0x1f6b('0x5d')],undefined,_0x3e9faf);if(_0x273f18['result']!==-0x1){this[_0x1f6b('0xd')]['noop'](util[_0x1f6b('0x27')](_0x1f6b('0x12e'),_0x1c0bf8));var _0x4371f6=this['googleASR'][_0x1f6b('0x67')](this,_0xb6ecc0,_0x1c0bf8);if(_0x4371f6){for(var _0x211a83 in _0x4371f6){if(_0x4371f6['hasOwnProperty'](_0x211a83)){this[_0x1f6b('0xd')][_0x1f6b('0x91')](util[_0x1f6b('0x27')](_0x1f6b('0x12f'),_0x211a83[_0x1f6b('0x61')]()),_0x4371f6[_0x211a83]);}}return this['channel'][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x130'),JSON['stringify'](_0x4371f6)));}}return _0x273f18;};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x131')]=function(_0xebbe9a){logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0x132'),_0xebbe9a['label']));if(!this[_0x1f6b('0x95')](_0xebbe9a[_0x1f6b('0x133')])){return this['channel'][_0x1f6b('0x9a')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0xebbe9a[_0x1f6b('0x134')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0x135'));}var _0x51369d=_0x1f6b('0x12a');var _0x62e9c5=util[_0x1f6b('0x27')](_0x1f6b('0x12b'),FILES_PATH,rs[_0x1f6b('0x114')](0x4));var _0x109bc6=util[_0x1f6b('0x27')](_0x1f6b('0x8f'),_0x62e9c5,_0x51369d);var _0x2fda26=!![];if(_0xebbe9a[_0x1f6b('0x136')]==='NOBEEP'){_0x2fda26=![];}var _0x53a348=this[_0x1f6b('0xd')][_0x1f6b('0x12c')](_0x62e9c5,_0x51369d,_0xebbe9a[_0x1f6b('0x12d')],_0xebbe9a['timeout'],undefined,_0x2fda26);if(_0x53a348[_0x1f6b('0xa4')]!==-0x1){this[_0x1f6b('0xd')]['noop'](util['format'](_0x1f6b('0x137'),_0x109bc6));var _0x363b7e=this[_0x1f6b('0x138')][_0x1f6b('0x67')](this,_0xebbe9a,_0x109bc6);if(_0x363b7e){for(var _0x1fd69d in _0x363b7e){if(_0x363b7e[_0x1f6b('0x8b')](_0x1fd69d)){this[_0x1f6b('0xd')]['setVariable'](util[_0x1f6b('0x27')](_0x1f6b('0x139'),_0x1fd69d['toUpperCase']()),_0x363b7e[_0x1fd69d]);}}return this[_0x1f6b('0xd')]['noop'](util[_0x1f6b('0x27')](_0x1f6b('0x13a'),JSON['stringify'](_0x363b7e)));}}return _0x53a348;};AGIVertices['prototype'][_0x1f6b('0x13b')]=function(_0x2c85b7){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x13c'),_0x2c85b7[_0x1f6b('0x36')]));return this[_0x1f6b('0xd')][_0x1f6b('0x13d')](_0x2c85b7[_0x1f6b('0x3c')],_0x2c85b7[_0x1f6b('0x3d')],_0x2c85b7['priority']);};AGIVertices['prototype'][_0x1f6b('0x13e')]=function(_0xb00cdd){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x13f'),_0xb00cdd[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0xb00cdd[_0x1f6b('0x140')])){return this['channel']['error'](_0xb00cdd,'no\x20condition\x20configured');}try{var _0x133717=eval(_0xb00cdd['condition'])?'true':_0x1f6b('0x141');this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x142'),_0xb00cdd[_0x1f6b('0x140')],_0x133717));return{'code':0xc8,'result':_0x133717};}catch(_0x46b0ed){return{'code':0xc8,'result':_0x1f6b('0x141')};}};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x143')]=function(_0x16e429){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x144'),_0x16e429[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x16e429[_0x1f6b('0x145')])){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x16e429,_0x1f6b('0x146'));}var _0x31b199=this[_0x1f6b('0x147')]['sync'](this,_0x16e429[_0x1f6b('0x145')]);if(!_0x31b199){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x16e429,'no\x20intervals\x20found');}for(var _0x319b9a=0x0;_0x319b9a<_0x31b199[_0x1f6b('0x8d')];_0x319b9a+=0x1){var _0x49c435=this[_0x1f6b('0xd')]['getVariable'](util[_0x1f6b('0x27')](_0x1f6b('0x148'),_0x31b199[_0x319b9a]));if(_0x49c435[_0x1f6b('0xa4')]===-0x1){return _0x49c435;}logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x149'),_0x31b199[_0x319b9a],_0x49c435[_0x1f6b('0x93')]));if(_0x49c435[_0x1f6b('0x93')]===_0x1f6b('0x14a')){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x149'),_0x31b199[_0x319b9a],_0x1f6b('0x14a')));this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x149'),_0x31b199[_0x319b9a],_0x1f6b('0x14a')));return{'code':0xc8,'result':_0x1f6b('0x14a')};}else{logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x149'),_0x31b199[_0x319b9a],_0x1f6b('0x141')));this['channel'][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x149'),_0x31b199[_0x319b9a],_0x1f6b('0x141')));}}return{'code':0xc8,'result':_0x1f6b('0x141')};};AGIVertices[_0x1f6b('0xe')]['hangup']=function(_0x531c81){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x14b'),_0x531c81[_0x1f6b('0x36')]));return this[_0x1f6b('0xd')]['hangup']();};AGIVertices[_0x1f6b('0xe')]['ispeechasr']=function(_0x3b898e){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x3b898e[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x3b898e[_0x1f6b('0x78')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0x129'));}var _0xe11034=_0x1f6b('0x12a');var _0xa626ec=util[_0x1f6b('0x27')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3101b9=util[_0x1f6b('0x27')](_0x1f6b('0x8f'),_0xa626ec,_0xe11034);var _0x35b9eb=!![];if(_0x3b898e['beep']===_0x1f6b('0x14c')){_0x35b9eb=![];}var _0x5590d2=this[_0x1f6b('0xd')][_0x1f6b('0x12c')](_0xa626ec,_0xe11034,_0x3b898e['intKey'],_0x3b898e['timeout'],undefined,_0x35b9eb);if(_0x5590d2[_0x1f6b('0xa4')]!==-0x1){this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x14d'),_0x3101b9));var _0x2865b1=this[_0x1f6b('0x7a')][_0x1f6b('0x67')](this,_0x3b898e,_0x3101b9);if(_0x2865b1){for(var _0x1eb766 in _0x2865b1){if(_0x2865b1['hasOwnProperty'](_0x1eb766)){this[_0x1f6b('0xd')][_0x1f6b('0x91')](util['format'](_0x1f6b('0x14e'),_0x1eb766[_0x1f6b('0x61')]()),_0x2865b1[_0x1eb766]);}}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')]('IspeechASR\x20Result\x20%s',JSON[_0x1f6b('0x6b')](_0x2865b1)));}}return _0x5590d2;};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x14f')]=function(_0x1b1ea0){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x150'),_0x1b1ea0[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x1b1ea0[_0x1f6b('0x78')])){return this['channel'][_0x1f6b('0x9a')]('no\x20key\x20configured');}if(!this[_0x1f6b('0x95')](_0x1b1ea0[_0x1f6b('0x56')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xb8'));}this['channel'][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x151'),_0x1b1ea0[_0x1f6b('0x56')]));var _0x3ccf13=this[_0x1f6b('0x77')]['sync'](this,_0x1b1ea0);if(_0x3ccf13){this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x14d'),_0x3ccf13));var _0x4862df=this['channel'][_0x1f6b('0xf9')](_0x3ccf13,_0x1b1ea0[_0x1f6b('0x12d')]);try{fs[_0x1f6b('0xfa')](_0x3ccf13+_0x1f6b('0xfb'));}catch(_0x171f89){logger[_0x1f6b('0x29')](_0x171f89);}return _0x4862df;}return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x1b1ea0,_0x1f6b('0x152'));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x153')]=function(_0x6abb7f){logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x154'),_0x6abb7f['label']));if(!this[_0x1f6b('0x95')](_0x6abb7f[_0x1f6b('0x155')])){return this[_0x1f6b('0xd')]['error'](_0x6abb7f,_0x1f6b('0x156'));}logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x157'),this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x6abb7f[_0x1f6b('0x155')]));var _0x43ad3b=this['agentLogin'][_0x1f6b('0x67')](this,_0x6abb7f['findBy']);if(_0x43ad3b){logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x158'),this['channel'][_0x1f6b('0x39')],_0x6abb7f[_0x1f6b('0x155')]));this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util['format'](_0x1f6b('0x158'),this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x6abb7f['findBy']));return{'code':0xc8,'result':_0x1f6b('0x159')};}else{logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x15a'),this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x6abb7f[_0x1f6b('0x155')]));this['channel']['noop'](util[_0x1f6b('0x27')](_0x1f6b('0x15a'),this['channel']['callerid'],_0x6abb7f[_0x1f6b('0x155')]));return{'code':0xc8,'result':_0x1f6b('0x15b')};}};AGIVertices['prototype'][_0x1f6b('0x15c')]=function(_0x332a03){logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0x15d'),_0x332a03['label']));if(!this[_0x1f6b('0x95')](_0x332a03[_0x1f6b('0x155')])){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x332a03,'no\x20find\x20by\x20configured');}logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x157'),this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x332a03[_0x1f6b('0x155')]));var _0x1fe279=this[_0x1f6b('0x15e')][_0x1f6b('0x67')](this,_0x332a03['findBy']);if(_0x1fe279){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x332a03['findBy']));this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x158'),this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x332a03['findBy']));return{'code':0xc8,'result':_0x1f6b('0x159')};}else{logger['info'](util['format'](_0x1f6b('0x15a'),this['channel'][_0x1f6b('0x39')],_0x332a03[_0x1f6b('0x155')]));this['channel'][_0x1f6b('0x9a')](util['format'](_0x1f6b('0x15a'),this['channel']['callerid'],_0x332a03[_0x1f6b('0x155')]));return{'code':0xc8,'result':_0x1f6b('0x15b')};}};AGIVertices[_0x1f6b('0xe')]['math']=function(_0xc1e6a9){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x15f'),_0xc1e6a9[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0xc1e6a9[_0x1f6b('0x160')])){return this[_0x1f6b('0xd')]['error'](_0xc1e6a9,_0x1f6b('0x161'));}this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x162'),_0xc1e6a9[_0x1f6b('0x160')]));var _0x364794=eval(_0xc1e6a9[_0x1f6b('0x160')]);if(!this[_0x1f6b('0x95')](_0xc1e6a9[_0x1f6b('0xc9')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xca'));}var _0x5725c7=this['getVariable'][_0x1f6b('0x67')](this,_0xc1e6a9[_0x1f6b('0xc9')]);if(!_0x5725c7){return this[_0x1f6b('0xd')]['error'](_0xc1e6a9,_0x1f6b('0x10f'));}if(_['isArray'](_0x364794)){var _0x5195ad=this;_0x364794[_0x1f6b('0xcb')](function(_0x18f9a7,_0x1a66bc){_0x5195ad[_0x1f6b('0xd')][_0x1f6b('0x91')](util[_0x1f6b('0x27')](_0x1f6b('0x163'),_0x5725c7,_0x1a66bc),_0x18f9a7);});return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')]('variable\x20%s[key]\x20set',_0x5725c7));}else{return this[_0x1f6b('0xd')][_0x1f6b('0x91')](_0x5725c7,_0x364794);}};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0xa')]=function(_0x255105){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x164'),_0x255105[_0x1f6b('0x36')]));if(_0x255105[_0x1f6b('0x96')]===0x0){return this[_0x1f6b('0x97')](_0x255105);}_0x255105[_0x1f6b('0x96')]-=0x1;if(!this[_0x1f6b('0x95')](_0x255105[_0x1f6b('0x107')])){return this['channel'][_0x1f6b('0x29')](_0x255105,'no\x20file\x20audio\x20selected');}var _0x3c56d2=this[_0x1f6b('0x1b')][_0x1f6b('0x67')](this,_0x255105[_0x1f6b('0x107')]);if(!_0x3c56d2){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x255105,_0x1f6b('0x109'));}var _0x5aa3ed=this[_0x1f6b('0xd')]['getData'](_0x3c56d2,_0x255105[_0x1f6b('0x10b')],_0x255105['digit']);var _0x4f621c=_0x5aa3ed[_0x1f6b('0xa4')];if(_0x5aa3ed[_0x1f6b('0xa4')]===-0x1){this[_0x1f6b('0x34')][_0x1f6b('0x67')](this,_0x255105,'-1');return _0x5aa3ed;}else if(_0x5aa3ed[_0x1f6b('0x93')]==='timeout'){_0x5aa3ed[_0x1f6b('0xa4')]=_0x5aa3ed[_0x1f6b('0xa4')][_0x1f6b('0x8d')]>0x0?_0x5aa3ed['result']:'t';}else if(_['isEmpty'](_0x5aa3ed['result'])){_0x5aa3ed[_0x1f6b('0xa4')]='#';_0x4f621c='#';}if(!this[_0x1f6b('0x95')](_0x255105[_0x1f6b('0xc9')])){this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xca'));}else{var _0x4a94c4=this[_0x1f6b('0xf')][_0x1f6b('0x67')](this,_0x255105[_0x1f6b('0xc9')]);if(!_0x4a94c4){return this[_0x1f6b('0xd')]['error'](_0x255105,_0x1f6b('0x10f'));}this[_0x1f6b('0xd')][_0x1f6b('0x91')](_0x4a94c4,_0x4f621c);}this[_0x1f6b('0x34')][_0x1f6b('0x67')](this,_0x255105,_0x4f621c);return _0x5aa3ed;};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x9a')]=function(_0x9ea086){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x165'),_0x9ea086[_0x1f6b('0x36')]));return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x9ea086[_0x1f6b('0x166')]||_0x9ea086['label']);};AGIVertices[_0x1f6b('0xe')]['pause']=function(_0x346313){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x167'),_0x346313['label']));if(!this[_0x1f6b('0x95')](_0x346313[_0x1f6b('0x155')])){return this['channel'][_0x1f6b('0x29')](_0x346313,_0x1f6b('0x156'));}logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x157'),this['channel'][_0x1f6b('0x39')],_0x346313[_0x1f6b('0x155')]));var _0x509b9b=this[_0x1f6b('0x49')][_0x1f6b('0x67')](this,_0x346313[_0x1f6b('0x168')]);var _0x2ed47a=this[_0x1f6b('0x4b')][_0x1f6b('0x67')](this,_0x346313[_0x1f6b('0x155')],_0x509b9b);if(_0x2ed47a){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x158'),this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x346313[_0x1f6b('0x155')]));this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x1f6b('0x39')],_0x346313[_0x1f6b('0x155')]));return{'code':0xc8,'result':_0x1f6b('0x159')};}else{logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x15a'),this[_0x1f6b('0xd')]['callerid'],_0x346313[_0x1f6b('0x155')]));this['channel'][_0x1f6b('0x9a')](util[_0x1f6b('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x1f6b('0x39')],_0x346313[_0x1f6b('0x155')]));return{'code':0xc8,'result':_0x1f6b('0x15b')};}};AGIVertices['prototype'][_0x1f6b('0x169')]=function(_0x38a7f2){logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0x16a'),_0x38a7f2[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x38a7f2[_0x1f6b('0x107')])){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x38a7f2,_0x1f6b('0x108'));}var _0x436422=this[_0x1f6b('0x1b')][_0x1f6b('0x67')](this,_0x38a7f2[_0x1f6b('0x107')]);if(!_0x436422){return this[_0x1f6b('0xd')]['error'](_0x38a7f2,'no\x20file\x20audio\x20found');}var _0x4b89e5=this[_0x1f6b('0xd')][_0x1f6b('0x52')](_0x1f6b('0x16b'),[_0x436422,_0x38a7f2['opts']]);if(_0x4b89e5[_0x1f6b('0xa4')]===-0x1){return _0x4b89e5;}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util['format']('Executed\x20command\x20%s\x20%s',_0x1f6b('0x16b'),_0x436422));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x16c')]=function(_0x142086){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x16d'),_0x142086[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x142086[_0x1f6b('0x16e')])){return this[_0x1f6b('0xd')]['error'](_0x142086,_0x1f6b('0x16f'));}var _0x32c24f='';var _0x5b684d=parseInt(_0x142086[_0x1f6b('0x16e')],0xa);if(isNaN(_0x5b684d)){_0x32c24f=_0x142086[_0x1f6b('0x16e')];}else{_0x32c24f=this[_0x1f6b('0x170')][_0x1f6b('0x67')](this,_0x142086[_0x1f6b('0x16e')]);if(!_0x32c24f){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x142086,_0x1f6b('0x171'));}}var _0x262440='';if(this['isConfigured'](_0x142086['file_id'])){var _0x1a0b0e=this[_0x1f6b('0x1b')][_0x1f6b('0x67')](this,_0x142086[_0x1f6b('0x107')]);if(_0x1a0b0e){_0x262440=_0x1a0b0e;}}this[_0x1f6b('0x34')][_0x1f6b('0x67')](this,_0x142086,_0x32c24f);if(_0x142086['opts'][_0x1f6b('0x172')]('x')<0x0){_0x142086[_0x1f6b('0xd8')]+='x';}if(_0x142086[_0x1f6b('0xd8')][_0x1f6b('0x172')]('X')<0x0){_0x142086[_0x1f6b('0xd8')]+='X';}this['channel'][_0x1f6b('0x91')](_0x1f6b('0x173'),_0x32c24f?_0x32c24f[_0x1f6b('0x174')]():'');var _0x2a8f51=this[_0x1f6b('0xd')][_0x1f6b('0x52')](_0x1f6b('0x175'),[_0x32c24f,_0x142086['opts'],_0x142086[_0x1f6b('0xd9')],_0x262440,_0x142086[_0x1f6b('0x5d')],_0x142086[_0x1f6b('0x5')],_0x142086['macro'],_0x142086['gosub'],'',_0x142086[_0x1f6b('0x176')]]);if(_0x2a8f51[_0x1f6b('0xa4')]===-0x1){return _0x2a8f51;}return this[_0x1f6b('0xd')]['noop'](util['format'](_0x1f6b('0xb4'),_0x1f6b('0x175'),_0x32c24f));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x177')]=function(_0x274c30){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x178'),_0x274c30[_0x1f6b('0x36')]));var _0x3d5f95=_0x274c30['recordingFormat']||_0x1f6b('0x12a');var _0x68b72=util[_0x1f6b('0x27')](_0x1f6b('0x179'),this[_0x1f6b('0xd')][_0x1f6b('0x35')],rs[_0x1f6b('0x114')](0x5));var _0x51bcd4=util[_0x1f6b('0x27')](_0x1f6b('0x17a'),FILES_PATH,_0x68b72,_0x3d5f95);var _0x548e6e=util[_0x1f6b('0x27')](_0x1f6b('0x12b'),FILES_PATH,_0x68b72);this[_0x1f6b('0x3a')][_0x1f6b('0x67')](this,_0x274c30,_0x68b72,_0x51bcd4);this['channel'][_0x1f6b('0x91')](_0x1f6b('0x17b'),_0x68b72);logger[_0x1f6b('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x548e6e,_0x3d5f95,_0x274c30['escape_digits'],_0x274c30[_0x1f6b('0x5d')]);return this[_0x1f6b('0xd')][_0x1f6b('0x12c')](_0x548e6e,_0x3d5f95,_0x274c30[_0x1f6b('0x17c')],_0x274c30[_0x1f6b('0x5d')],undefined,!![]);};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x17d')]=function(_0x504dd1){logger[_0x1f6b('0x2d')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x504dd1['label']));if(!this[_0x1f6b('0x95')](_0x504dd1['url'])){return this[_0x1f6b('0xd')]['noop'](_0x1f6b('0x17e'));}var _0x1dbdd8=this[_0x1f6b('0x5c')][_0x1f6b('0x67')](this,_0x504dd1);logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0x17f'),util['inspect'](_0x1dbdd8,{'showHidden':![],'depth':null})));if(!this[_0x1f6b('0x95')](_0x504dd1[_0x1f6b('0xc9')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0x180'));}var _0x1c9206=this[_0x1f6b('0xf')][_0x1f6b('0x67')](this,_0x504dd1[_0x1f6b('0xc9')]);if(!_0x1c9206){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x504dd1,_0x1f6b('0x10f'));}this[_0x1f6b('0xd')][_0x1f6b('0x91')](util[_0x1f6b('0x27')](_0x1f6b('0x181'),_0x1c9206),_0x1dbdd8[_0x1f6b('0x6d')]?_0x1dbdd8[_0x1f6b('0x6d')]:_0x1f6b('0x182'));this['channel'][_0x1f6b('0x91')](util['format'](_0x1f6b('0x183'),_0x1c9206),_0x1dbdd8[_0x1f6b('0x184')]?_0x1dbdd8[_0x1f6b('0x184')]:'OK');if(_0x1dbdd8[_0x1f6b('0x62')]){try{this['saveRestApiResult'](_0x1dbdd8[_0x1f6b('0x62')],_0x1c9206);}catch(_0x12559e){logger['error'](util[_0x1f6b('0x27')](_0x1f6b('0x185'),_0x1c9206));}}return this['channel'][_0x1f6b('0x9a')](util['format'](_0x1f6b('0xcf'),_0x1c9206));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x186')]=function(_0x40aa36){logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x187'),_0x40aa36['label']));return this[_0x1f6b('0xd')][_0x1f6b('0x188')](_0x40aa36[_0x1f6b('0x189')][_0x1f6b('0xc6')](/\s+/g,''),_0x40aa36[_0x1f6b('0x17c')]);};AGIVertices['prototype']['saynumber']=function(_0x30a293){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x18a'),_0x30a293['label']));return this[_0x1f6b('0xd')][_0x1f6b('0x18b')](_0x30a293[_0x1f6b('0x18c')][_0x1f6b('0xc6')](/\s+/g,''),_0x30a293[_0x1f6b('0x17c')]);};AGIVertices[_0x1f6b('0xe')]['sayphonetic']=function(_0x9234e7){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x18d'),_0x9234e7['label']));return this['channel'][_0x1f6b('0x18e')](_0x9234e7[_0x1f6b('0x56')],_0x9234e7[_0x1f6b('0x17c')]);};AGIVertices['prototype'][_0x1f6b('0x18f')]=function(_0x594c9e){logger['info'](util['format'](_0x1f6b('0x190'),_0x594c9e[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x594c9e['account_id'])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0x191'));}var _0x2af29c=this[_0x1f6b('0x1e')][_0x1f6b('0x67')](this,_0x594c9e[_0x1f6b('0x192')]);if(!_0x2af29c||!_0x2af29c[_0x1f6b('0x193')]){return this[_0x1f6b('0xd')]['error'](_0x594c9e,_0x1f6b('0x194'));}var _0x2beee={'from':util['format'](_0x1f6b('0x195'),_0x2af29c['name'],_0x2af29c[_0x1f6b('0x196')]||_0x2af29c[_0x1f6b('0x193')][_0x1f6b('0x197')]),'to':_0x594c9e['to']||'','cc':_0x594c9e['cc']||'','bcc':_0x594c9e[_0x1f6b('0x198')]||'','subject':_0x594c9e[_0x1f6b('0x199')],'html':_0x594c9e['text'],'text':_0x594c9e['text']};var _0x44bfc1={'tls':{'rejectUnauthorized':![]}};if(_0x2af29c[_0x1f6b('0x193')]['service']){_0x44bfc1[_0x1f6b('0x19a')]=_0x2af29c[_0x1f6b('0x193')][_0x1f6b('0x19a')];}else{_0x44bfc1[_0x1f6b('0x19b')]=_0x2af29c[_0x1f6b('0x193')][_0x1f6b('0x19b')];_0x44bfc1[_0x1f6b('0x19c')]=_0x2af29c[_0x1f6b('0x193')][_0x1f6b('0x19c')];_0x44bfc1[_0x1f6b('0x19d')]=_0x2af29c[_0x1f6b('0x193')][_0x1f6b('0x19d')];}if(_0x2af29c[_0x1f6b('0x193')][_0x1f6b('0x19e')]){_0x44bfc1[_0x1f6b('0x19f')]={'user':_0x2af29c[_0x1f6b('0x193')][_0x1f6b('0x197')],'pass':_0x2af29c['Smtp'][_0x1f6b('0x1a0')]};}if(this[_0x1f6b('0x95')](_0x594c9e[_0x1f6b('0x1a1')])){}logger[_0x1f6b('0x1a2')]('sendMail\x20message',JSON[_0x1f6b('0x6b')](_0x2beee));this[_0x1f6b('0x34')]['sync'](this,_0x594c9e,_0x594c9e['account_id']);this['channel'][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x1a3'),_0x2af29c[_0x1f6b('0x13')]));this[_0x1f6b('0x20')][_0x1f6b('0x67')](this,_0x44bfc1,_0x2beee);return this['channel'][_0x1f6b('0x9a')](_0x1f6b('0x1a4'));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1a5')]=function(_0x42b5cd){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x1a6'),_0x42b5cd['label']));return this['channel'][_0x1f6b('0x9a')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x1f6b('0x1a7')]=function(_0x45e285){logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x1a8'),_0x45e285[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x45e285[_0x1f6b('0x1a9')])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')]('no\x20sms\x20account\x20configured');}var _0x217e0d=this[_0x1f6b('0x1aa')][_0x1f6b('0x67')](this,_0x45e285['sms_account_id']);if(!_0x217e0d){return this['channel'][_0x1f6b('0x29')](_0x45e285,_0x1f6b('0x1ab'));}var _0x4119d3={'body':_0x45e285[_0x1f6b('0x1ac')],'phone':_0x45e285['to']||'','SmsAccountId':_0x217e0d['id']};logger['debug'](_0x1f6b('0x1ad'),JSON[_0x1f6b('0x6b')](_0x4119d3));this[_0x1f6b('0x34')][_0x1f6b('0x67')](this,_0x45e285,_0x45e285[_0x1f6b('0x1a9')]);this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x1ae'),_0x217e0d[_0x1f6b('0x13')]));this['createSmsMessage'][_0x1f6b('0x67')](this,_0x4119d3);return this[_0x1f6b('0xd')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1af')]=function(_0x939b79){logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0x1b0'),_0x939b79['label']));if(!this['isConfigured'](_0x939b79[_0x1f6b('0xc9')])){return this['channel'][_0x1f6b('0x29')](_0x939b79,_0x1f6b('0x1b1'));}var _0x58da6c=this[_0x1f6b('0xf')][_0x1f6b('0x67')](this,_0x939b79[_0x1f6b('0xc9')]);if(!_0x58da6c){return this['channel'][_0x1f6b('0x29')](_0x939b79,_0x1f6b('0x10f'));}return this['channel'][_0x1f6b('0x91')](_0x58da6c,_0x939b79[_0x1f6b('0x1b2')]);};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1b3')]=function(_0x3becbd){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x1b4'),_0x3becbd[_0x1f6b('0x36')]));this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0x1b5'));if(_0x3becbd[_0x1f6b('0xa8')]===_0x1f6b('0x1b6')){this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0x1b7'));return this[_0x1f6b('0xd')]['answer']();}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0x1b8'));};AGIVertices['prototype'][_0x1f6b('0x1b9')]=function(_0x58661f){logger['info'](util[_0x1f6b('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x58661f[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x58661f[_0x1f6b('0x1ba')])){return this[_0x1f6b('0xd')]['error'](_0x58661f,_0x1f6b('0x1bb'));}var _0x40b50d=this['getSquareProject']['sync'](this,_0x58661f[_0x1f6b('0x1ba')]);if(!this[_0x1f6b('0x95')](_0x40b50d)){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x58661f,util[_0x1f6b('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x58661f[_0x1f6b('0x1ba')]));}if(_0x40b50d===this['channel'][_0x1f6b('0x38')]){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x58661f,_0x1f6b('0x1bc'));}this[_0x1f6b('0x34')][_0x1f6b('0x67')](this,_0x58661f,_0x40b50d);var _0x23827e=this[_0x1f6b('0xd')][_0x1f6b('0x52')]('AGI',util[_0x1f6b('0x27')](_0x1f6b('0x1bd'),config[_0x1f6b('0x5')][_0x1f6b('0x19b')]||_0x1f6b('0x1be'),_0x40b50d,this['channel'][_0x1f6b('0x38')]));if(_0x23827e[_0x1f6b('0xa4')]===-0x1){return _0x23827e;}return this['channel'][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0xb4'),_0x1f6b('0x1bf'),_0x40b50d));};AGIVertices['prototype']['system']=function(_0x2a6b61){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2a6b61[_0x1f6b('0x36')]));var _0x4917ae=this[_0x1f6b('0x1c0')][_0x1f6b('0x67')](this,_0x2a6b61['command']);this[_0x1f6b('0x34')]['sync'](this,_0x2a6b61,_0x2a6b61['command']);if(this[_0x1f6b('0x95')](_0x2a6b61[_0x1f6b('0xc9')])){var _0x36522d=this[_0x1f6b('0xf')]['sync'](this,_0x2a6b61[_0x1f6b('0xc9')]);if(_0x36522d){this['channel'][_0x1f6b('0x91')](_0x36522d,_0x4917ae);return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x1c1'),_0x2a6b61[_0x1f6b('0x1c2')],_0x36522d));}}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x1c3'),_0x2a6b61[_0x1f6b('0x1c2')]));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1c4')]=function(_0x1f3407){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x1c5'),_0x1f3407[_0x1f6b('0x36')]));_0x1f3407[_0x1f6b('0x56')]=_0x1f3407[_0x1f6b('0x56')][_0x1f6b('0xc6')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1f6b('0x95')](_0x1f3407[_0x1f6b('0x55')])){return this[_0x1f6b('0xd')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x1f6b('0x95')](_0x1f3407[_0x1f6b('0x56')])){return this[_0x1f6b('0xd')]['noop'](_0x1f6b('0xb8'));}this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util[_0x1f6b('0x27')](_0x1f6b('0x1c6'),_0x1f3407['text']));var _0x27026a=this[_0x1f6b('0x54')][_0x1f6b('0x67')](this,_0x1f3407);if(_0x27026a){this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x27026a));var _0x5bde70=this[_0x1f6b('0xd')]['streamFile'](_0x27026a);try{fs[_0x1f6b('0xfa')](_0x27026a+_0x1f6b('0xfb'));}catch(_0x457a89){logger[_0x1f6b('0x29')](_0x457a89);}return _0x5bde70;}return this['channel'][_0x1f6b('0x29')](_0x1f3407,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1c7')]=function(_0x3a332a){logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0x1c8'),_0x3a332a[_0x1f6b('0x36')]));_0x3a332a[_0x1f6b('0x56')]=_0x3a332a[_0x1f6b('0x56')][_0x1f6b('0xc6')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1f6b('0x95')](_0x3a332a['text'])){return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](_0x1f6b('0xb8'));}this[_0x1f6b('0xd')]['noop'](util[_0x1f6b('0x27')](_0x1f6b('0x1c9'),_0x3a332a[_0x1f6b('0x56')]));var _0x26702f=this[_0x1f6b('0x5b')]['sync'](this,_0x3a332a);if(_0x26702f){this['channel']['noop'](util[_0x1f6b('0x27')](_0x1f6b('0x1ca'),_0x26702f));var _0x28005b=this[_0x1f6b('0xd')][_0x1f6b('0xf9')](_0x26702f);try{fs[_0x1f6b('0xfa')](_0x26702f+'.wav');}catch(_0x2e7bb5){logger[_0x1f6b('0x29')](_0x2e7bb5);}return _0x28005b;}return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x3a332a,_0x1f6b('0x1cb'));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1cc')]=function(_0x3e0977){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x1cd'),_0x3e0977[_0x1f6b('0x36')]));if(!this['isConfigured'](_0x3e0977[_0x1f6b('0x155')])){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x3e0977,_0x1f6b('0x156'));}logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x157'),this['channel'][_0x1f6b('0x39')],_0x3e0977['findBy']));var _0x28e947=this[_0x1f6b('0x4c')][_0x1f6b('0x67')](this,_0x3e0977[_0x1f6b('0x155')]);if(_0x28e947){logger[_0x1f6b('0x2d')](util['format'](_0x1f6b('0x158'),this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x3e0977[_0x1f6b('0x155')]));this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x3e0977[_0x1f6b('0x155')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x15a'),this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x3e0977['findBy']));this[_0x1f6b('0xd')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1f6b('0xd')][_0x1f6b('0x39')],_0x3e0977[_0x1f6b('0x155')]));return{'code':0xc8,'result':_0x1f6b('0x15b')};}};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1ce')]=function(_0x19659b){logger[_0x1f6b('0x2d')](util[_0x1f6b('0x27')](_0x1f6b('0x1cf'),_0x19659b[_0x1f6b('0x36')]));var _0x113766=this['channel'][_0x1f6b('0x52')]('VOICEMAIL',[_0x19659b[_0x1f6b('0x1d0')],_0x19659b[_0x1f6b('0x70')]]);if(_0x113766[_0x1f6b('0xa4')]===-0x1){return _0x113766;}return this[_0x1f6b('0xd')][_0x1f6b('0x9a')](util['format'](_0x1f6b('0xb4'),_0x1f6b('0x1d1'),_0x19659b[_0x1f6b('0x1d0')]));};AGIVertices[_0x1f6b('0xe')][_0x1f6b('0x1d2')]=function(_0x52d5e1){logger['info'](util[_0x1f6b('0x27')](_0x1f6b('0x1d3'),_0x52d5e1[_0x1f6b('0x36')]));if(!this[_0x1f6b('0x95')](_0x52d5e1[_0x1f6b('0xc9')])){return this[_0x1f6b('0xd')][_0x1f6b('0x29')](_0x52d5e1,'no\x20variable\x20selected');}var _0x537a0d=this[_0x1f6b('0xf')]['sync'](this,_0x52d5e1[_0x1f6b('0xc9')]);if(!_0x537a0d){return this[_0x1f6b('0xd')]['error'](_0x52d5e1,_0x1f6b('0x10f'));}var _0x5b7219=this[_0x1f6b('0xd')][_0x1f6b('0xf')](_0x537a0d);return{'code':0xc8,'result':_0x5b7219[_0x1f6b('0x93')]?_0x5b7219[_0x1f6b('0x93')]:'-'};};String[_0x1f6b('0xe')][_0x1f6b('0x1d4')]=function(_0x182da1,_0x330de2){return this['split'](_0x182da1)['join'](_0x330de2);};module['exports']=AGIVertices;
\ No newline at end of file
+var _0xd456=['Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','getAndSetVariable','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','replace','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','client_email','no\x20private_key\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20Result\x20%s','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','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','streamFile','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','appid','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','success','failure','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','indexOf','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','getSmsAccount','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','odbc','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawBody','getdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','name','prototype','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','error','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','createSmsMessage','createSquareDetailsReport','label','arg_1','createSquareRecording','uniqueid','callerid','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','toString','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','isConfigured','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','includes','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth'];(function(_0x1a828e,_0x55aa8d){var _0x4a03d9=function(_0x2e4ab7){while(--_0x2e4ab7){_0x1a828e['push'](_0x1a828e['shift']());}};_0x4a03d9(++_0x55aa8d);}(_0xd456,0x12a));var _0x6d45=function(_0x2491e0,_0x1ea0ad){_0x2491e0=_0x2491e0-0x0;var _0x21c7cb=_0xd456[_0x2491e0];return _0x21c7cb;};'use strict';var fs=require('fs');var path=require(_0x6d45('0x0'));var util=require('util');var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x6d45('0x1'))();var rs=require(_0x6d45('0x2'));var moment=require('moment');var Mustache=require(_0x6d45('0x3'));var rp=require(_0x6d45('0x4'));var logger=require(_0x6d45('0x5'))(_0x6d45('0x6'));var config=require(_0x6d45('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x6d45('0x8');var recursiveMapAttributes=['rawHeaders',_0x6d45('0x9')];var verticesWithRetry=['menu',_0x6d45('0xa'),'getsecretdigits'];var AGIVertices=function(_0x2c3965,_0x3a2e8a,_0x193a4f){this[_0x6d45('0xb')]=_0x2c3965;this[_0x6d45('0xc')]=_0x3a2e8a;this[_0x6d45('0xd')]=_0x193a4f;};AGIVertices['prototype'][_0x6d45('0xe')]=function(_0x51d4cc,_0x38c03b){this[_0x6d45('0xc')][_0x6d45('0xf')](_0x51d4cc)[_0x6d45('0x10')](function(_0x3e3f4c){_0x38c03b(null,_0x3e3f4c?_0x3e3f4c[_0x6d45('0x11')]:![]);})['catch'](function(_0x3c872e){_0x38c03b(_0x3c872e);});};AGIVertices[_0x6d45('0x12')]['getVoiceQueue']=function(_0x3ee20c,_0x5a4d04){this[_0x6d45('0xc')][_0x6d45('0x13')](_0x3ee20c)['then'](function(_0xaaef6a){_0x5a4d04(null,_0xaaef6a?_0xaaef6a[_0x6d45('0x11')]:![]);})[_0x6d45('0x14')](function(_0x1f39a5){_0x5a4d04(_0x1f39a5);});};AGIVertices['prototype'][_0x6d45('0x15')]=function(_0x20934c,_0x534fbc){this['rpc'][_0x6d45('0x16')](_0x20934c)[_0x6d45('0x10')](function(_0x28404b){_0x534fbc(null,_0x28404b?_0x28404b[_0x6d45('0x11')]:![]);})[_0x6d45('0x14')](function(_0x5a3855){_0x534fbc(_0x5a3855);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x17')]=function(_0x55ef27,_0x2cbb7f){this[_0x6d45('0xc')][_0x6d45('0x18')](_0x55ef27)['then'](function(_0x2b671c){_0x2cbb7f(null,_0x2b671c?_0x2b671c[_0x6d45('0x19')]:![]);})[_0x6d45('0x14')](function(_0x3540c0){_0x2cbb7f(_0x3540c0);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x1a')]=function(_0x55ddc6,_0x525427){this['rpc'][_0x6d45('0x1b')](_0x55ddc6)['then'](function(_0x39bc17){_0x525427(null,_0x39bc17?_0x39bc17[_0x6d45('0x11')]:![]);})[_0x6d45('0x14')](function(_0x32267c){_0x525427(_0x32267c);});};AGIVertices[_0x6d45('0x12')]['getTrunk']=function(_0x194698,_0x2959dd){this[_0x6d45('0xc')]['getTrunkById'](_0x194698)[_0x6d45('0x10')](function(_0x3f4a42){_0x2959dd(null,_0x3f4a42?_0x3f4a42[_0x6d45('0x11')]:![]);})[_0x6d45('0x14')](function(_0x45c442){_0x2959dd(_0x45c442);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x1c')]=function(_0x119a5e,_0x25ddbf){var _0x2c2739=this;this[_0x6d45('0xc')][_0x6d45('0x1d')](_0x119a5e)['then'](function(_0x597aa7){_0x25ddbf(null,_0x597aa7?_0x2c2739[_0x6d45('0x1e')](_0x597aa7[_0x6d45('0x1f')]):![]);})[_0x6d45('0x14')](function(_0x44add9){_0x25ddbf(_0x44add9);});};AGIVertices['prototype'][_0x6d45('0x20')]=function(_0x323e36,_0x5a9f28){this[_0x6d45('0xc')][_0x6d45('0x21')](_0x323e36)[_0x6d45('0x10')](function(_0x1a151e){_0x5a9f28(null,_0x1a151e?_0x1a151e:![]);})[_0x6d45('0x14')](function(_0x2e5151){_0x5a9f28(_0x2e5151);});};AGIVertices[_0x6d45('0x12')]['sendMailMessage']=function(_0x49f66c,_0xc09676,_0x31b6b0){this[_0x6d45('0xd')][_0x6d45('0x22')](_0x49f66c,_0xc09676)[_0x6d45('0x10')](function(){_0x31b6b0(null);})[_0x6d45('0x14')](function(_0x369507){_0x31b6b0(_0x369507);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x23')]=function(_0x24b5f7,_0x259ff6){this[_0x6d45('0xc')][_0x6d45('0x24')](_0x24b5f7)[_0x6d45('0x10')](function(_0xc2e1b9){if(_0xc2e1b9){if(_0xc2e1b9[_0x6d45('0x25')]){_0x259ff6(null,[_0xc2e1b9[_0x6d45('0x26')]]);}else{_0x259ff6(null,_[_0x6d45('0x27')](_0xc2e1b9[_0x6d45('0x28')],_0x6d45('0x26')));}}else{_0x259ff6(null,![]);}})[_0x6d45('0x14')](function(_0x28c488){_0x259ff6(_0x28c488);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x1e')]=function(_0x100fc5){return util['format'](_0x6d45('0x29'),FILES_PATH,_0x100fc5);};AGIVertices['prototype'][_0x6d45('0x2a')]=function(_0x29f160,_0x1427c7,_0x3ce655){odbc['open'](_0x29f160,function(_0x491ca6){if(_0x491ca6){logger[_0x6d45('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x491ca6);_0x3ce655(_0x491ca6);}else{logger[_0x6d45('0x2c')]('ODBC\x20connection\x20successfully');odbc[_0x6d45('0x2d')](_0x1427c7,function(_0x5aad17,_0x1218c1){if(_0x5aad17){logger[_0x6d45('0x2c')](_0x6d45('0x2e'),_0x1427c7);_0x3ce655(_0x5aad17);}else{logger[_0x6d45('0x2c')](_0x6d45('0x2f'),_0x1427c7);odbc[_0x6d45('0x30')](function(_0x59c07f){if(_0x59c07f){logger[_0x6d45('0x2b')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x59c07f);}_0x3ce655(null,_0x1218c1);});}});}});};AGIVertices[_0x6d45('0x12')]['getSmsAccount']=function(_0x2c36d6,_0x497a95){this[_0x6d45('0xc')]['getSmsAccountById'](_0x2c36d6)[_0x6d45('0x10')](function(_0x3ea460){_0x497a95(null,_0x3ea460?_0x3ea460:![]);})[_0x6d45('0x14')](function(_0x275439){_0x497a95(_0x275439);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x31')]=function(_0x352689,_0x3e9ee3){this['rpc'][_0x6d45('0x31')](_0x352689)[_0x6d45('0x10')](function(_0x4898f6){_0x3e9ee3(null,_0x4898f6);})[_0x6d45('0x14')](function(_0x444317){_0x3e9ee3(_0x444317);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x32')]=function(_0xebb07e,_0xd19f53,_0x268a82){this[_0x6d45('0xc')][_0x6d45('0x32')]({'uniqueid':this[_0x6d45('0xb')]['uniqueid'],'node':_0xebb07e[_0x6d45('0x33')],'application':_0xebb07e['agicommand'],'data':_0xd19f53||null,'project_name':this[_0x6d45('0xb')][_0x6d45('0x34')],'callerid':this[_0x6d45('0xb')]['callerid']})['then'](function(_0x1edeca){if(_0x268a82){_0x268a82(null,_0x1edeca);}})[_0x6d45('0x14')](function(_0x20bc3c){if(_0x268a82){_0x268a82(_0x20bc3c);}});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x35')]=function(_0x1542a4,_0x5bcb4c,_0x2d1f55,_0x1ff79d){this[_0x6d45('0xc')][_0x6d45('0x35')]({'uniqueid':this[_0x6d45('0xb')][_0x6d45('0x36')],'callerid':this[_0x6d45('0xb')][_0x6d45('0x37')],'calleridname':this['channel']['calleridname'],'context':this['channel']['context'],'extension':this[_0x6d45('0xb')][_0x6d45('0x38')],'priority':this['channel'][_0x6d45('0x39')],'accountcode':this[_0x6d45('0xb')][_0x6d45('0x3a')],'dnid':this['channel'][_0x6d45('0x3b')],'projectName':this[_0x6d45('0xb')][_0x6d45('0x34')],'saveName':_0x5bcb4c,'filename':_0x1542a4[_0x6d45('0x3c')]||_0x5bcb4c,'savePath':_0x2d1f55})[_0x6d45('0x10')](function(_0x2ceb09){_0x1ff79d(null,_0x2ceb09);})['catch'](function(_0x1eb7d6){_0x1ff79d(_0x1eb7d6);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x3d')]=function(_0x371d9d,_0x106588,_0x3d30ef,_0xa07a94,_0x2eec17){this[_0x6d45('0xc')][_0x6d45('0x3d')]({'uniqueid':this[_0x6d45('0xb')][_0x6d45('0x36')],'body':_0x371d9d,'direction':_0x106588,'providerName':_0x3d30ef,'providerResponse':_0xa07a94})['then'](function(_0x40c781){if(_0x2eec17){_0x2eec17(null,_0x40c781);}})[_0x6d45('0x14')](function(_0x539f61){if(_0x2eec17){_0x2eec17(_0x539f61);}});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x3e')]=function(_0x46087c,_0x5a1999){this['rpc'][_0x6d45('0x3e')]({'firstName':_[_0x6d45('0x3f')](_0x46087c[_0x6d45('0x11')])||_[_0x6d45('0x40')](_0x46087c[_0x6d45('0x11')])?_0x6d45('0x41')+Math[_0x6d45('0x42')]():_0x46087c[_0x6d45('0x11')],'lastName':_['isEmpty'](_0x46087c[_0x6d45('0x43')])||_['isNil'](_0x46087c[_0x6d45('0x43')])?null:_0x46087c[_0x6d45('0x43')],'phone':_0x46087c[_0x6d45('0x44')],'ListId':_0x46087c['list_id'],'scheduledat':_0x46087c[_0x6d45('0x45')],'callbackUniqueid':this[_0x6d45('0xb')]['uniqueid'],'tags':_0x6d45('0x46'),'description':'Callback\x20scheduled\x20at\x20'+_0x46087c['scheduledAt'][_0x6d45('0x47')](),'priority':_0x46087c['callback_priority']})[_0x6d45('0x10')](function(_0x2bfe06){_0x5a1999(null,_0x2bfe06);})[_0x6d45('0x14')](function(_0x435bde){_0x5a1999(_0x435bde);});};AGIVertices['prototype'][_0x6d45('0x48')]=function(_0xd8ffbb,_0x19963){this['rpc']['getPauseById'](_0xd8ffbb)[_0x6d45('0x10')](function(_0x518ec1){_0x19963(null,_0x518ec1?_0x518ec1[_0x6d45('0x11')]:![]);})[_0x6d45('0x14')](function(_0x5ed46a){_0x19963(_0x5ed46a);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x49')]=function(_0x296ab0,_0x5edab3,_0x7fb9e){var _0x10b73b={'role':_0x6d45('0x4a')};_0x10b73b[_0x296ab0]=this[_0x6d45('0xb')][_0x6d45('0x37')];this[_0x6d45('0xc')]['agentPause'](_0x10b73b,_0x5edab3,this[_0x6d45('0xb')][_0x6d45('0x36')])[_0x6d45('0x10')](function(_0x28e7f6){_0x7fb9e(null,_[_0x6d45('0x40')](_0x28e7f6)?![]:!![]);})['catch'](function(_0x123a43){logger[_0x6d45('0x2b')](_0x123a43);_0x7fb9e(null,![]);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x4b')]=function(_0x19a17d,_0x52dcf5){var _0x1cb086={'role':_0x6d45('0x4a')};_0x1cb086[_0x19a17d]=this[_0x6d45('0xb')][_0x6d45('0x37')];this[_0x6d45('0xc')][_0x6d45('0x4b')](_0x1cb086)[_0x6d45('0x10')](function(_0xbf2183){_0x52dcf5(null,_[_0x6d45('0x40')](_0xbf2183)?![]:!![]);})[_0x6d45('0x14')](function(_0x2d88fc){logger[_0x6d45('0x2b')](_0x2d88fc);_0x52dcf5(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x3607d9,_0xfee5d9){var _0x4a84dd={'role':_0x6d45('0x4a')};_0x4a84dd[_0x3607d9]=this[_0x6d45('0xb')]['callerid'];this['rpc'][_0x6d45('0x4c')](_0x4a84dd)[_0x6d45('0x10')](function(_0x44732a){_0xfee5d9(null,_['isNil'](_0x44732a)?![]:!![]);})[_0x6d45('0x14')](function(_0xac6761){logger[_0x6d45('0x2b')](_0xac6761);_0xfee5d9(null,![]);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x4d')]=function(_0x2ca91d,_0x196aad){var _0x56c091={'role':_0x6d45('0x4a')};_0x56c091[_0x2ca91d]=this['channel'][_0x6d45('0x37')];var _0x40dfc4=_0x2ca91d!=_0x6d45('0x4e')?util[_0x6d45('0x4f')](_0x6d45('0x50'),_0x6d45('0x51'),this[_0x6d45('0xb')][_0x6d45('0x37')]):undefined;this[_0x6d45('0xc')]['agentLogin'](_0x56c091,_0x40dfc4)[_0x6d45('0x10')](function(_0x10b803){_0x196aad(null,_[_0x6d45('0x40')](_0x10b803)?![]:!![]);})[_0x6d45('0x14')](function(_0x59995a){logger[_0x6d45('0x2b')](_0x59995a);_0x196aad(null,![]);});};AGIVertices['prototype'][_0x6d45('0x52')]=function(_0x55198f,_0x3148d9){sh[_0x6d45('0x53')](_[_0x6d45('0x54')](_0x55198f),function(_0x335bfa,_0x2543ec){var _0x4403e0=_0x2543ec['replace'](/(\r\n|\n|\r)/gm,'');_0x3148d9(null,_0x4403e0);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x55')]=function(_0x2ee935,_0x8d2eae){scripts['googleCloudTTS'](_0x2ee935[_0x6d45('0x56')],_0x2ee935[_0x6d45('0x57')]||_0x6d45('0x58'),_0x2ee935[_0x6d45('0x58')],_0x2ee935[_0x6d45('0x59')]||_0x6d45('0x5a'),_0x2ee935[_0x6d45('0x5b')]||_0x6d45('0x5c'),_0x2ee935[_0x6d45('0x5d')]||_0x6d45('0x5e'))[_0x6d45('0x10')](function(_0x3d6017){_0x8d2eae(null,_0x3d6017);})[_0x6d45('0x14')](function(_0x3e00f7){_0x8d2eae(_0x3e00f7);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x5f')]=function(_0x440f90,_0x15f657){scripts[_0x6d45('0x5f')](_0x440f90[_0x6d45('0x58')],_0x440f90[_0x6d45('0x60')]||'en',0x1)[_0x6d45('0x10')](function(_0x4157df){_0x15f657(null,_0x4157df);})[_0x6d45('0x14')](function(_0x1ce4a6){_0x15f657(_0x1ce4a6);});};AGIVertices['prototype']['restAPI']=function(_0x1a7a68,_0x5c1712){var _0x4e6f9a={'uri':_0x1a7a68[_0x6d45('0x61')],'method':_0x1a7a68[_0x6d45('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1a7a68[_0x6d45('0x63')])===_0x6d45('0x64')&&parseInt(_0x1a7a68[_0x6d45('0x63')])>=0x1?parseInt(_0x1a7a68['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0x6d45('0x65'),_0x6d45('0x66')],_0x4e6f9a[_0x6d45('0x62')][_0x6d45('0x67')]())){try{_0x4e6f9a[_0x6d45('0x68')]=_0x1a7a68[_0x6d45('0x9')]?JSON['parse'](_0x1a7a68[_0x6d45('0x9')]):{};}catch(_0x191eb3){logger[_0x6d45('0x2b')](_0x6d45('0x69'),_0x191eb3);}}try{_0x4e6f9a[_0x6d45('0x6a')]=_0x1a7a68[_0x6d45('0x6b')]?JSON['parse'](_0x1a7a68[_0x6d45('0x6b')]):{};}catch(_0x5cbe0e){logger['error'](_0x6d45('0x6c'),_0x5cbe0e);}if(_0x1a7a68[_0x6d45('0x6d')]){try{var _0xb8bae6=require(_0x1a7a68[_0x6d45('0x6d')])[_0x6d45('0x6e')](this,_0x4e6f9a);_0x4e6f9a[_0x6d45('0x6f')]=Mustache[_0x6d45('0x70')](_0x1a7a68[_0x6d45('0x61')],_0xb8bae6,{},['$$','$$']);if(_0x4e6f9a['headers']){_0x4e6f9a['headers']=JSON['parse'](Mustache[_0x6d45('0x70')](JSON[_0x6d45('0x71')](_0x4e6f9a[_0x6d45('0x6a')]),_0xb8bae6,{},['$$','$$']));}if(_0x4e6f9a[_0x6d45('0x68')]){_0x4e6f9a[_0x6d45('0x68')]=JSON['parse'](Mustache['render'](JSON[_0x6d45('0x71')](_0x4e6f9a[_0x6d45('0x68')]),_0xb8bae6,{},['$$','$$']));}}catch(_0x156370){logger[_0x6d45('0x2b')](_0x6d45('0x72'),_0x156370);}}rp(_0x4e6f9a)[_0x6d45('0x10')](function(_0x56b02b){var _0x1f3d92={'statusCode':_0x56b02b[_0x6d45('0x73')]||0xc8,'statusMessage':_0x56b02b[_0x6d45('0x74')]||'OK','headers':_0x56b02b[_0x6d45('0x6a')]||{},'body':_0x56b02b[_0x6d45('0x68')]||{}};_0x5c1712(null,_0x1f3d92);})[_0x6d45('0x14')](function(_0x596910){var _0x366c28={'statusCode':_0x596910[_0x6d45('0x73')]||0x1f4,'statusMessage':_0x596910[_0x6d45('0x75')]||_0x6d45('0x76'),'headers':_0x596910[_0x6d45('0x77')][_0x6d45('0x6a')]||{},'body':_0x596910[_0x6d45('0x77')][_0x6d45('0x68')]||{}};_0x5c1712(null,_0x366c28);});};AGIVertices['prototype'][_0x6d45('0x78')]=function(_0x6483dc,_0x3b7919){scripts[_0x6d45('0x78')](this[_0x6d45('0xb')]['uniqueid'],_0x6483dc[_0x6d45('0x79')],_0x6483dc[_0x6d45('0x58')],_0x6483dc[_0x6d45('0x7a')]||'en')[_0x6d45('0x10')](function(_0x5716af){_0x3b7919(null,_0x5716af);})[_0x6d45('0x14')](function(_0x48120f){_0x3b7919(_0x48120f);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0xbbfc70,_0x1d3aa8){scripts[_0x6d45('0x7b')](this[_0x6d45('0xb')][_0x6d45('0x36')],_0xbbfc70['dialogflowV2_project_id'],_0xbbfc70['client_email'],_0xbbfc70[_0x6d45('0x7c')],_0xbbfc70[_0x6d45('0x58')],_0xbbfc70[_0x6d45('0x7d')]||'en')['then'](function(_0x4f8993){_0x1d3aa8(null,_0x4f8993);})[_0x6d45('0x14')](function(_0x3dfdca){_0x1d3aa8(_0x3dfdca);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x7e')]=function(_0x3eb664,_0x2d82da){scripts['sestekNDA'](this[_0x6d45('0xb')],_0x3eb664)[_0x6d45('0x10')](function(_0x5cfbed){_0x2d82da(null,_0x5cfbed);})['catch'](function(_0x5ae989){_0x2d82da(_0x5ae989);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x7f')]=function(_0x4ee197,_0x4a417e){scripts['ispeechTTS'](_0x4ee197[_0x6d45('0x79')],_0x4ee197[_0x6d45('0x58')],_0x4ee197[_0x6d45('0x80')]||'en-US',_0x4ee197['speed'])[_0x6d45('0x10')](function(_0x17be2f){_0x4a417e(null,_0x17be2f);})[_0x6d45('0x14')](function(_0x765288){_0x4a417e(_0x765288);});};AGIVertices[_0x6d45('0x12')]['ispeechASR']=function(_0x28679a,_0x293d5b,_0x598dc3){scripts[_0x6d45('0x81')](_0x293d5b,_0x28679a[_0x6d45('0x79')],_0x28679a['ispeech_asr_language']||'en-US',this[_0x6d45('0x82')](_0x28679a['model'])?_0x28679a['model']:undefined)[_0x6d45('0x10')](function(_0x3691c1){_0x598dc3(null,_0x3691c1);})[_0x6d45('0x14')](function(_0x184838){_0x598dc3(_0x184838);});};AGIVertices[_0x6d45('0x12')]['awsPolly']=function(_0x3ac013,_0x29f9ed){scripts['awsPolly'](_0x3ac013[_0x6d45('0x83')],_0x3ac013[_0x6d45('0x84')],_0x3ac013[_0x6d45('0x85')],_0x3ac013[_0x6d45('0x86')]||_0x6d45('0x87'),_0x3ac013[_0x6d45('0x58')],_0x3ac013[_0x6d45('0x88')]||_0x6d45('0x58'))['then'](function(_0x4dcdcf){_0x29f9ed(null,_0x4dcdcf);})[_0x6d45('0x14')](function(_0x261e95){_0x29f9ed(_0x261e95);});};AGIVertices['prototype'][_0x6d45('0x89')]=function(_0x25b58b,_0x209426){scripts['awsLex'](this['channel']['uniqueid'],_0x25b58b[_0x6d45('0x83')],_0x25b58b['aws_secret_access_key'],_0x25b58b['aws_lex_region'],_0x25b58b[_0x6d45('0x58')],_0x25b58b[_0x6d45('0x8a')])[_0x6d45('0x10')](function(_0x5f4296){_0x209426(null,_0x5f4296);})['catch'](function(_0x1196dc){_0x209426(_0x1196dc);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x8b')]=function(_0x2b53c2,_0x2cf046,_0xca5a97){scripts['googleASR'](_0x2cf046,_0x2b53c2['key'],_0x2b53c2[_0x6d45('0x8c')]||_0x6d45('0x5a'))[_0x6d45('0x10')](function(_0x8e5d90){_0xca5a97(null,_0x8e5d90);})[_0x6d45('0x14')](function(_0x1875ad){_0xca5a97(_0x1875ad);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x8d')]=function(_0x45a645,_0x3cd6c1,_0x55fe99){scripts[_0x6d45('0x8d')](_0x3cd6c1,_0x45a645['appid'],_0x45a645[_0x6d45('0x8e')],_0x45a645['uri'])['then'](function(_0x37c738){_0x55fe99(null,_0x37c738);})['catch'](function(_0x387019){_0x55fe99(_0x387019);});};AGIVertices[_0x6d45('0x12')][_0x6d45('0x8f')]=function(_0x30dac7){var _0x577d82=_[_0x6d45('0x90')](verticesWithRetry,_0x30dac7['agicommand'])?_0x30dac7:_[_0x6d45('0x91')](_0x30dac7);for(var _0x27e33a in _0x577d82){if(_0x577d82['hasOwnProperty'](_0x27e33a)){if(_0x577d82[_0x27e33a]&&_[_0x6d45('0x92')](_0x577d82[_0x27e33a])){if(_[_0x6d45('0x90')](recursiveMapAttributes,_0x27e33a)){_0x577d82[_0x27e33a]=this[_0x6d45('0x93')](_0x577d82[_0x27e33a]);}else{_0x577d82[_0x27e33a]=this['replaceAllVariables'](_0x577d82[_0x27e33a]);}}}}return _0x577d82;};AGIVertices[_0x6d45('0x12')][_0x6d45('0x94')]=function(_0x41519e){for(var _0x3dece0 in _0x41519e){if(_0x41519e[_0x6d45('0x95')](_0x3dece0)){if(_[_0x6d45('0x96')](_0x41519e[_0x3dece0])){this['recursiveNodeIndex'](_0x41519e[_0x3dece0]);}else if(_[_0x6d45('0x97')](_0x41519e[_0x3dece0])){for(var _0x10cd27=0x0;_0x10cd27<_0x41519e[_0x3dece0][_0x6d45('0x98')];_0x10cd27++){this[_0x6d45('0x94')](_0x41519e[_0x3dece0][_0x10cd27]);}}else if(_['isString'](_0x41519e[_0x3dece0])){_0x41519e[_0x3dece0]=this[_0x6d45('0x99')](_0x41519e[_0x3dece0]);}}}};AGIVertices[_0x6d45('0x12')][_0x6d45('0x9a')]=function(_0x29351a,_0x2ddbaf){for(var _0x349b67 in _0x29351a){if(_0x29351a['hasOwnProperty'](_0x349b67)){if(_[_0x6d45('0x96')](_0x29351a[_0x349b67])){if(!_['isEmpty'](_0x29351a[_0x349b67])){this[_0x6d45('0x9a')](_0x29351a[_0x349b67],util['format'](_0x6d45('0x9b'),_0x2ddbaf,_0x349b67));}}else if(_['isArray'](_0x29351a[_0x349b67])){for(var _0x186daf=0x0;_0x186daf<_0x29351a[_0x349b67]['length'];_0x186daf++){this[_0x6d45('0x9a')](_0x29351a[_0x349b67][_0x186daf],util[_0x6d45('0x4f')](_0x6d45('0x9b'),_0x2ddbaf,_0x349b67+'['+_0x186daf+']'));}}else{if(!_[_0x6d45('0x40')](_0x29351a[_0x349b67])){this[_0x6d45('0xb')][_0x6d45('0x9c')](util[_0x6d45('0x4f')](_0x6d45('0x9b'),_0x2ddbaf,_0x349b67),_0x29351a[_0x349b67]);}}}}};AGIVertices[_0x6d45('0x12')]['replaceObjectAllVariables']=function(_0x361d54){try{var _0x44217b=JSON['parse'](_0x361d54);this[_0x6d45('0x94')](_0x44217b);return JSON[_0x6d45('0x71')](_0x44217b);}catch(_0x249dc6){return this[_0x6d45('0x99')](_0x361d54);}};AGIVertices['prototype'][_0x6d45('0x99')]=function(_0x1fcb8e){var _0x142ddf=_0x1fcb8e[_0x6d45('0x9d')]('{');for(var _0x468df6=0x1;_0x468df6<_0x142ddf['length'];_0x468df6+=0x1){var _0x5d7f8c=_0x142ddf[_0x468df6][_0x6d45('0x9d')]('}');if(_0x5d7f8c[_0x6d45('0x98')]>0x1){_0x1fcb8e=_0x1fcb8e[_0x6d45('0x9e')]('{'+_0x5d7f8c[0x0]+'}',this[_0x6d45('0xb')][_0x6d45('0xe')](_0x5d7f8c[0x0])[_0x6d45('0x9f')]||_0x5d7f8c[0x0]);}}if(_0x142ddf[_0x6d45('0x98')]===0x1){return _0x1fcb8e['toString']();}return this['replaceAllVariables'](_0x1fcb8e);};AGIVertices[_0x6d45('0x12')]['getAndSetVariable']=function(_0x5aecce,_0x1301f9){var _0x1a78ed=this[_0x6d45('0xb')][_0x6d45('0xe')](_0x5aecce);if(_0x1a78ed[_0x6d45('0xa0')]===-0x1){return _0x1a78ed;}logger[_0x6d45('0x2c')](util['format'](_0x6d45('0xa1'),_0x1301f9,_0x1a78ed['extra']));return this[_0x6d45('0xb')][_0x6d45('0x9c')](_0x1301f9,_0x1a78ed['extra']);};AGIVertices[_0x6d45('0x12')][_0x6d45('0x82')]=function(_0x450d0e){return _0x450d0e&&_0x450d0e!=='0'&&_0x450d0e!=='-1'&&_0x450d0e!=='';};AGIVertices[_0x6d45('0x12')]['maxRetry']=function(_0xfafb74){this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0xfafb74,'-');_0xfafb74[_0x6d45('0xa2')]=_0xfafb74[_0x6d45('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x6d45('0xa4')]=function(_0x3bbc37){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0xa5'),_0x3bbc37[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x3bbc37[_0x6d45('0x58')])){return this[_0x6d45('0xb')]['noop'](_0x6d45('0xa6'));}var _0x75d9b5='\x22'+_0x3bbc37[_0x6d45('0x58')]+'\x22';if(this[_0x6d45('0x82')](_0x3bbc37[_0x6d45('0x77')])){_0x75d9b5+=','+_0x3bbc37['options'];}var _0x5ce360=this[_0x6d45('0xb')][_0x6d45('0x53')]('MRCPSynth',_0x75d9b5);if(_0x5ce360[_0x6d45('0xa0')]===-0x1){return _0x5ce360;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xa8'),_0x75d9b5));};AGIVertices[_0x6d45('0x12')][_0x6d45('0xa9')]=function(_0x3241ad){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0xaa'),_0x3241ad['label']));if(!this[_0x6d45('0x82')](_0x3241ad[_0x6d45('0xab')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20grammar\x20configured');}var _0x10639b=_0x3241ad[_0x6d45('0xab')];if(this[_0x6d45('0x82')](_0x3241ad[_0x6d45('0x77')])){_0x10639b+=','+_0x3241ad[_0x6d45('0x77')];}var _0x53a16e=this[_0x6d45('0xb')][_0x6d45('0x53')](_0x6d45('0xac'),_0x10639b);if(_0x53a16e['result']===-0x1){return _0x53a16e;}var _0x1a4c16=this[_0x6d45('0xad')]('RECOG_CONFIDENCE()',_0x6d45('0xae'));if(_0x1a4c16[_0x6d45('0xa0')]===-0x1){return _0x1a4c16;}var _0x3deb34=this[_0x6d45('0xad')](_0x6d45('0xaf'),_0x6d45('0xb0'));if(_0x3deb34[_0x6d45('0xa0')]===-0x1){return _0x3deb34;}var _0x24c905=this[_0x6d45('0xad')](_0x6d45('0xb1'),_0x6d45('0xb2'));if(_0x24c905[_0x6d45('0xa0')]===-0x1){return _0x24c905;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xb3'),_0x10639b));};AGIVertices['prototype'][_0x6d45('0x6')]=function(_0x5f2ffd){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0xb4'),_0x5f2ffd[_0x6d45('0x33')]));return this[_0x6d45('0xb')][_0x6d45('0x6')]([_0x5f2ffd[_0x6d45('0xb5')],_0x5f2ffd['args']]);};AGIVertices[_0x6d45('0x12')][_0x6d45('0xb6')]=function(_0xf050b8){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0xb7'),_0xf050b8[_0x6d45('0x33')]));if(this[_0x6d45('0x82')](_0xf050b8[_0x6d45('0x63')])){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xf050b8[_0x6d45('0x63')]));var _0x429ff2=this[_0x6d45('0xb')][_0x6d45('0xb8')](_0xf050b8[_0x6d45('0x63')]);if(_0x429ff2[_0x6d45('0xa0')]===-0x1){return _0x429ff2;}}return this['channel'][_0x6d45('0xb6')]();};AGIVertices[_0x6d45('0x12')][_0x6d45('0x46')]=function(_0x1335d0){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0xb9'),_0x1335d0[_0x6d45('0x33')]));if(!this['isConfigured'](_0x1335d0[_0x6d45('0xba')])){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x1335d0,_0x6d45('0xbb'));}_0x1335d0['scheduledAt']=moment();if(this[_0x6d45('0x82')](_0x1335d0[_0x6d45('0xbc')])){_0x1335d0['scheduledAt']=moment()[_0x6d45('0xbd')](_0x1335d0['delay'],'minutes');}if(!this[_0x6d45('0x82')](_0x1335d0[_0x6d45('0xbe')])){_0x1335d0[_0x6d45('0xbe')]=0x2;}this['createCmContact']['sync'](this,_0x1335d0);return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xbf'),_0x1335d0[_0x6d45('0x44')],_0x1335d0[_0x6d45('0xba')],_0x1335d0[_0x6d45('0x45')]));};AGIVertices[_0x6d45('0x12')][_0x6d45('0xc0')]=function(_0x3c4c99){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x3c4c99[_0x6d45('0x33')]));var _0x4c329b=this['channel'][_0x6d45('0x53')](_0x3c4c99[_0x6d45('0xc1')],_0x3c4c99[_0x6d45('0x77')]);if(_0x4c329b[_0x6d45('0xa0')]===-0x1){return _0x4c329b;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format'](_0x6d45('0xc2'),_0x3c4c99[_0x6d45('0xc1')],_0x3c4c99[_0x6d45('0x77')]));};AGIVertices['prototype'][_0x6d45('0xc3')]=function(_0x2feaad){logger[_0x6d45('0x2c')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2feaad['label']));if(!this[_0x6d45('0x82')](_0x2feaad['text'])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0xa6'));}var _0x4fb3cf='\x22'+_0x2feaad['text']+'\x22';if(this[_0x6d45('0x82')](_0x2feaad[_0x6d45('0x77')])){_0x4fb3cf+=','+_0x2feaad[_0x6d45('0x77')];}var _0x1c7bb9=this[_0x6d45('0xb')]['exec'](_0x6d45('0xc4'),_0x4fb3cf);if(_0x1c7bb9[_0x6d45('0xa0')]===-0x1){return _0x1c7bb9;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xa8'),_0x4fb3cf));};AGIVertices[_0x6d45('0x12')][_0x6d45('0xc5')]=function(_0xd52f2b){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0xc6'),_0xd52f2b[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0xd52f2b[_0x6d45('0x58')])){return this['channel'][_0x6d45('0xa7')](_0x6d45('0xa6'));}var _0x2f2b36='\x22'+_0xd52f2b['text']+'\x22';if(this[_0x6d45('0x82')](_0xd52f2b[_0x6d45('0x77')])){_0x2f2b36+=','+_0xd52f2b['options'];}var _0x4017fd=this[_0x6d45('0xb')][_0x6d45('0x53')]('MRCPSynth',_0x2f2b36);if(_0x4017fd[_0x6d45('0xa0')]===-0x1){return _0x4017fd;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2f2b36));};AGIVertices[_0x6d45('0x12')][_0x6d45('0xc7')]=function(_0xe49d35){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0xc8'),_0xe49d35[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0xe49d35[_0x6d45('0xab')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0xc9'));}var _0x32d01c=_0xe49d35['grammar'];if(this[_0x6d45('0x82')](_0xe49d35['options'])){_0x32d01c+=','+_0xe49d35[_0x6d45('0x77')];}var _0x3d921a=this['channel'][_0x6d45('0x53')]('MRCPRecog',_0x32d01c);if(_0x3d921a[_0x6d45('0xa0')]===-0x1){return _0x3d921a;}var _0x16ef04=this[_0x6d45('0xad')](_0x6d45('0xca'),_0x6d45('0xcb'));if(_0x16ef04[_0x6d45('0xa0')]===-0x1){return _0x16ef04;}var _0x544d5a=this[_0x6d45('0xad')](_0x6d45('0xaf'),_0x6d45('0xcc'));if(_0x544d5a['result']===-0x1){return _0x544d5a;}var _0x5005c6=this[_0x6d45('0xad')](_0x6d45('0xb1'),'LUMENVOX_ASR_INSTANCE');if(_0x5005c6[_0x6d45('0xa0')]===-0x1){return _0x5005c6;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xb3'),_0x32d01c));};AGIVertices[_0x6d45('0x12')][_0x6d45('0xcd')]=function(_0x1aad24){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0xce'),_0x1aad24['label']));if(!this[_0x6d45('0x82')](_0x1aad24[_0x6d45('0xab')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20grammar\x20configured');}var _0x9d3b8c=_0x1aad24['grammar'];if(this[_0x6d45('0x82')](_0x1aad24[_0x6d45('0x77')])){_0x9d3b8c+=','+_0x1aad24[_0x6d45('0x77')];}var _0x584da1=this[_0x6d45('0xb')]['exec'](_0x6d45('0xac'),_0x9d3b8c);if(_0x584da1[_0x6d45('0xa0')]===-0x1){return _0x584da1;}var _0x7570d9=this[_0x6d45('0xad')](_0x6d45('0xca'),_0x6d45('0xcf'));if(_0x7570d9[_0x6d45('0xa0')]===-0x1){return _0x7570d9;}var _0x5b719f=this[_0x6d45('0xad')](_0x6d45('0xaf'),_0x6d45('0xd0'));if(_0x5b719f[_0x6d45('0xa0')]===-0x1){return _0x5b719f;}var _0x440668=this[_0x6d45('0xad')](_0x6d45('0xb1'),_0x6d45('0xd1'));if(_0x440668[_0x6d45('0xa0')]===-0x1){return _0x440668;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')]('Executed\x20command\x20MRCPRecog\x20%s',_0x9d3b8c));};AGIVertices[_0x6d45('0x12')]['database']=function(_0x386b12){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0xd2'),_0x386b12[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x386b12[_0x6d45('0xd3')])){return this['channel'][_0x6d45('0x2b')](_0x386b12,_0x6d45('0xd4'));}var _0x173c17=this[_0x6d45('0x17')][_0x6d45('0x6e')](this,_0x386b12[_0x6d45('0xd3')]);if(!_0x173c17){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x386b12,'no\x20odbc\x20database\x20found');}if(!this[_0x6d45('0x82')](_0x386b12[_0x6d45('0x2d')])){return this[_0x6d45('0xb')]['error'](_0x386b12,_0x6d45('0xd5'));}var _0x1fb037=_0x386b12['query'][_0x6d45('0xd6')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x6d45('0xa7')](util['format']('query:\x20%s',_0x1fb037));var _0x1e36d3=this[_0x6d45('0x2a')]['sync'](this,_0x173c17,_0x1fb037);this['createSquareDetailsReport'][_0x6d45('0x6e')](this,_0x386b12,_0x1fb037);if(!this['isConfigured'](_0x386b12[_0x6d45('0xd7')])){return this['channel'][_0x6d45('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x400bc2=this['getVariable']['sync'](this,_0x386b12[_0x6d45('0xd7')]);if(!_0x400bc2){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x386b12,_0x6d45('0xd8'));}var _0x2ade08=this;_0x1e36d3[_0x6d45('0xd9')](function(_0x4fade2,_0x3bf2){Object[_0x6d45('0xda')](_0x4fade2)[_0x6d45('0xd9')](function(_0x3868b7){_0x2ade08['channel'][_0x6d45('0x9c')](util[_0x6d45('0x4f')](_0x6d45('0xdb'),_0x400bc2,_0x3bf2,_0x3868b7),_0x4fade2[_0x3868b7]);});});this[_0x6d45('0xb')][_0x6d45('0x9c')](util['format'](_0x6d45('0xdc'),_0x400bc2),_0x1e36d3[_0x6d45('0x98')]);return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xdd'),_0x400bc2));};AGIVertices[_0x6d45('0x12')][_0x6d45('0xde')]=function(_0x468768){logger['debug'](util['format'](_0x6d45('0xdf'),_0x468768[_0x6d45('0x33')]));if(!this['isConfigured'](_0x468768['sip_id'])){return this['channel'][_0x6d45('0x2b')](_0x468768,_0x6d45('0xe0'));}var _0x6532dd=this[_0x6d45('0x1a')][_0x6d45('0x6e')](this,_0x468768[_0x6d45('0xe1')]);if(!_0x6532dd){return this['channel'][_0x6d45('0x2b')](_0x468768,_0x6d45('0xe2'));}var _0xefef2f=this[_0x6d45('0xb')][_0x6d45('0x53')](_0x6d45('0xe3'),[util[_0x6d45('0x4f')](_0x6d45('0xe4'),_0x6532dd),_0x468768[_0x6d45('0x63')],_0x468768[_0x6d45('0xe5')],_0x468768[_0x6d45('0x61')]]);if(_0xefef2f[_0x6d45('0xa0')]===-0x1){return _0xefef2f;}return this['channel']['noop'](util[_0x6d45('0x4f')](_0x6d45('0xe6'),'DIAL'));};AGIVertices['prototype'][_0x6d45('0xe7')]=function(_0x21090e){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0xe8'),_0x21090e[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x21090e[_0x6d45('0x79')])){return this[_0x6d45('0xb')]['noop']('no\x20key\x20configured');}if(!this[_0x6d45('0x82')](_0x21090e['text'])){return this[_0x6d45('0xb')]['noop']('no\x20text\x20configured');}this[_0x6d45('0xb')]['bot']=!![];this[_0x6d45('0x32')](_0x21090e);this[_0x6d45('0x3d')](_0x21090e[_0x6d45('0x58')],'in','','');this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xe9'),_0x21090e[_0x6d45('0x58')]));var _0x5a4f62=this['googleDialogflow'][_0x6d45('0x6e')](this,_0x21090e);if(_0x5a4f62){for(var _0x30075d in _0x5a4f62){if(_0x5a4f62[_0x6d45('0x95')](_0x30075d)){this['channel'][_0x6d45('0x9c')](util[_0x6d45('0x4f')](_0x6d45('0xea'),_0x30075d[_0x6d45('0x67')]()),_0x5a4f62[_0x30075d]);}}this[_0x6d45('0x3d')](_0x5a4f62[_0x6d45('0xeb')],'out','dialogflow','');return this[_0x6d45('0xb')]['noop'](util[_0x6d45('0x4f')]('Dialogflow\x20Result\x20%s',_0x5a4f62[_0x6d45('0xeb')]));}return this[_0x6d45('0xb')]['error'](_0x21090e,_0x6d45('0xec'));};AGIVertices[_0x6d45('0x12')][_0x6d45('0xed')]=function(_0x59961a){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0xee'),_0x59961a[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x59961a[_0x6d45('0xef')])){return this['channel'][_0x6d45('0xa7')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x59961a[_0x6d45('0xf0')])){return this['channel'][_0x6d45('0xa7')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0x59961a[_0x6d45('0x7c')])){return this[_0x6d45('0xb')]['noop'](_0x6d45('0xf1'));}if(!this[_0x6d45('0x82')](_0x59961a[_0x6d45('0x7d')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20anguage\x20configured');}if(!this[_0x6d45('0x82')](_0x59961a[_0x6d45('0x58')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0xa6'));}this['channel'][_0x6d45('0xf2')]=!![];this['createSquareDetailsReport'](_0x59961a);this[_0x6d45('0x3d')](_0x59961a[_0x6d45('0x58')],'in','','');this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xf3'),_0x59961a[_0x6d45('0x58')]));var _0x443917=this['googleDialogflowV2']['sync'](this,_0x59961a);if(_0x443917){for(var _0x4a0875 in _0x443917){if(_0x443917[_0x6d45('0x95')](_0x4a0875)){if(_0x4a0875!==_0x6d45('0xf4')){this[_0x6d45('0xb')][_0x6d45('0x9c')](util[_0x6d45('0x4f')](_0x6d45('0xea'),_0x4a0875[_0x6d45('0x67')]()),_0x443917[_0x4a0875]);}}}this[_0x6d45('0x3d')](_0x443917[_0x6d45('0xeb')],'out',_0x6d45('0xed'),_0x443917[_0x6d45('0xf4')]);return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xf5'),_0x443917[_0x6d45('0xeb')]));}return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x59961a,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype'][_0x6d45('0xf6')]=function(_0x1443cf){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0xf7'),_0x1443cf[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x1443cf[_0x6d45('0xf8')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x6d45('0x82')](_0x1443cf[_0x6d45('0xf9')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x1443cf['password'])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0xfa'));}if(!this[_0x6d45('0x82')](_0x1443cf[_0x6d45('0xfb')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0xa6'));}this[_0x6d45('0xb')][_0x6d45('0xf2')]=!![];this['createSquareDetailsReport'](_0x1443cf);this[_0x6d45('0x3d')](_0x1443cf[_0x6d45('0x58')],'in','','');this[_0x6d45('0xb')]['noop'](util[_0x6d45('0x4f')](_0x6d45('0xfc'),_0x1443cf['text']));var _0x215982=this[_0x6d45('0x7e')][_0x6d45('0x6e')](this,_0x1443cf);if(_0x215982){for(var _0x3e9e8d in _0x215982){if(_0x215982[_0x6d45('0x95')](_0x3e9e8d)){this['channel'][_0x6d45('0x9c')](util[_0x6d45('0x4f')](_0x6d45('0xfd'),_0x3e9e8d[_0x6d45('0x67')]()),_0x215982[_0x3e9e8d]);}}this['createSquareMessage'](_0x215982[_0x6d45('0xeb')],_0x6d45('0xfe'),_0x6d45('0xf6'),'');if(_0x215982[_0x6d45('0xff')]){this['channel'][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x100'),_0x215982[_0x6d45('0xff')]));var _0x1c75b0=this['channel']['streamFile'](_0x215982[_0x6d45('0xff')]);try{fs[_0x6d45('0x101')](_0x215982['audiofile']+'.wav');}catch(_0x32ba12){logger[_0x6d45('0x2b')](_0x32ba12);}return _0x1c75b0;}else{return this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format'](_0x6d45('0x102'),_0x215982[_0x6d45('0xeb')]));}}return this['channel'][_0x6d45('0x2b')](_0x1443cf,_0x6d45('0x103'));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x104')]=function(_0x28975c){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x105'),_0x28975c[_0x6d45('0x33')]));return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0x104'));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x106')]=function(_0x11477c){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x11477c['label']));var _0x5d4a6e='';if(_0x11477c[_0x6d45('0x107')]){if(!this[_0x6d45('0x82')](_0x11477c[_0x6d45('0x107')])){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x11477c,_0x6d45('0x108'));}else{var _0x57e893=parseInt(_0x11477c[_0x6d45('0x107')],0xa);if(isNaN(_0x57e893)){_0x5d4a6e=_0x11477c[_0x6d45('0x107')];}else{_0x5d4a6e=this['getTrunk']['sync'](this,_0x11477c[_0x6d45('0x107')]);if(!_0x5d4a6e){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x11477c,_0x6d45('0x109'));}}}}else if(_0x11477c[_0x6d45('0x10a')]){_0x5d4a6e=_0x11477c[_0x6d45('0x10a')];}else{return this[_0x6d45('0xb')]['error'](_0x11477c,_0x6d45('0x108'));}var _0x2f3d50=this[_0x6d45('0xb')][_0x6d45('0x53')]('DIAL',[util[_0x6d45('0x4f')](_0x6d45('0x10b'),_0x5d4a6e,_0x11477c[_0x6d45('0x44')]),_0x11477c[_0x6d45('0x63')],_0x11477c[_0x6d45('0xe5')],_0x11477c[_0x6d45('0x61')]]);if(_0x2f3d50[_0x6d45('0xa0')]===-0x1){return _0x2f3d50;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format'](_0x6d45('0xe6'),_0x6d45('0xe3')));};AGIVertices['prototype'][_0x6d45('0x10c')]=function(_0x42c264){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x10d'),_0x42c264[_0x6d45('0x33')]));return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0x10c'));};AGIVertices['prototype'][_0x6d45('0xa')]=function(_0x4a63dd){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x10e'),_0x4a63dd[_0x6d45('0x33')]));if(_0x4a63dd[_0x6d45('0xa2')]===0x0){return this[_0x6d45('0xa3')](_0x4a63dd);}_0x4a63dd[_0x6d45('0xa2')]-=0x1;if(!this[_0x6d45('0x82')](_0x4a63dd[_0x6d45('0x10f')])){return this['channel'][_0x6d45('0x2b')](_0x4a63dd,'no\x20file\x20audio\x20selected');}var _0x37026e=this[_0x6d45('0x1c')][_0x6d45('0x6e')](this,_0x4a63dd[_0x6d45('0x10f')]);if(!_0x37026e){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x4a63dd,_0x6d45('0x110'));}if(!this[_0x6d45('0x82')](_0x4a63dd[_0x6d45('0xd7')])){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x6d45('0x111'));}var _0x2f77d5=this[_0x6d45('0xb')][_0x6d45('0x112')](_0x37026e,_0x4a63dd[_0x6d45('0x113')],_0x4a63dd[_0x6d45('0x114')]);var _0xff1498=_0x2f77d5[_0x6d45('0xa0')]?_0x2f77d5['result']['toString']():'';logger[_0x6d45('0x2c')](_0x6d45('0x115'),JSON['stringify'](_0x2f77d5));if(_0x2f77d5[_0x6d45('0xa0')]===-0x1){this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0x4a63dd,_0xff1498);return _0x2f77d5;}else if(_0x2f77d5[_0x6d45('0x9f')]==='timeout'){_0x2f77d5[_0x6d45('0xa0')]=_0xff1498['length']>=parseInt(_0x4a63dd['mindigit'])?'x':'i';}else{_0x2f77d5[_0x6d45('0xa0')]=_0xff1498['length']>=parseInt(_0x4a63dd[_0x6d45('0x116')])&&_0xff1498['length']<=parseInt(_0x4a63dd[_0x6d45('0x114')])?'x':'i';}var _0x533c0c=this[_0x6d45('0xe')]['sync'](this,_0x4a63dd[_0x6d45('0xd7')]);if(!_0x533c0c){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x4a63dd,_0x6d45('0xd8'));}this[_0x6d45('0xb')][_0x6d45('0x9c')](_0x533c0c,_0xff1498);if(this[_0x6d45('0x82')](_0x4a63dd[_0x6d45('0x117')])){var _0x5ce02c=parseInt(_0x4a63dd['hiddendigitsnum'],0xa);var _0x10f4a0=rs[_0x6d45('0x118')]({'charset':'*','length':_0x5ce02c});var _0x1eda6f=_0xff1498[_0x6d45('0x98')];if(_0x1eda6f>0x0){if(_0x1eda6f>_0x5ce02c){this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0x4a63dd,_0x4a63dd[_0x6d45('0x119')]==='first'?_0x10f4a0+_0xff1498[_0x6d45('0x11a')](_0x5ce02c):_0xff1498[_0x6d45('0x11a')](0x0,_0x1eda6f-_0x5ce02c)+_0x10f4a0);}else{this[_0x6d45('0x32')]['sync'](this,_0x4a63dd,rs[_0x6d45('0x118')]({'charset':'*','length':_0x1eda6f}));}}else{this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0x4a63dd,'');}}else{this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0x4a63dd,_0xff1498);}return _0x2f77d5;};AGIVertices['prototype']['getsecretdigits']=function(_0x30e22a){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x30e22a['label']));return this[_0x6d45('0xa')](_0x30e22a);};AGIVertices['prototype'][_0x6d45('0x11b')]=function(_0x4db133){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4db133[_0x6d45('0x33')]));this['createSquareDetailsReport']['sync'](this,_0x4db133,_0x4db133[_0x6d45('0x11c')]);return this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format'](_0x6d45('0x11d'),_0x4db133['goalname']));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x11e')]=function(_0x5ecaf2){logger[_0x6d45('0x2c')](util['format'](_0x6d45('0x11f'),_0x5ecaf2[_0x6d45('0x33')]));if(!this['isConfigured'](_0x5ecaf2['aws_access_key_id'])||!this[_0x6d45('0x82')](_0x5ecaf2[_0x6d45('0x84')])){return this['channel'][_0x6d45('0xa7')](_0x6d45('0x120'));}if(!this[_0x6d45('0x82')](_0x5ecaf2[_0x6d45('0x58')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0xa6'));}this['channel'][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x121'),_0x5ecaf2[_0x6d45('0x58')]));var _0x446a61=this[_0x6d45('0x122')][_0x6d45('0x6e')](this,_0x5ecaf2);if(_0x446a61){this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x123'),_0x446a61));var _0x3c9f04=this[_0x6d45('0xb')][_0x6d45('0x124')](_0x446a61);try{fs[_0x6d45('0x101')](_0x446a61+_0x6d45('0x125'));}catch(_0x520d8e){logger[_0x6d45('0x2b')](_0x520d8e);}return _0x3c9f04;}return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x5ecaf2,_0x6d45('0x126'));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x127')]=function(_0x42ac54){logger['info'](util[_0x6d45('0x4f')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x42ac54['label']));if(!this[_0x6d45('0x82')](_0x42ac54[_0x6d45('0x83')])||!this[_0x6d45('0x82')](_0x42ac54[_0x6d45('0x84')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0x120'));}if(!this[_0x6d45('0x82')](_0x42ac54[_0x6d45('0x8a')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20bot\x20name\x20configured');}if(!this[_0x6d45('0x82')](_0x42ac54['text'])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0xa6'));}this['channel'][_0x6d45('0xf2')]=!![];this[_0x6d45('0x32')](_0x42ac54);this[_0x6d45('0x3d')](_0x42ac54['text'],'in','','');this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x128'),_0x42ac54[_0x6d45('0x58')]));var _0x5f36d5=this[_0x6d45('0x89')]['sync'](this,_0x42ac54);if(_0x5f36d5){for(var _0x17e6c5 in _0x5f36d5){if(_0x5f36d5[_0x6d45('0x95')](_0x17e6c5)&&_[_0x6d45('0x92')](_0x5f36d5[_0x17e6c5])){this['channel'][_0x6d45('0x9c')](util['format']('AWS_LEX_%s',_0x17e6c5[_0x6d45('0x67')]()),_0x5f36d5[_0x17e6c5]);}}if(_[_0x6d45('0x40')](_0x5f36d5[_0x6d45('0x75')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0x129'));}else{this[_0x6d45('0x3d')](_0x5f36d5['message'],'out',_0x6d45('0x12a'),'');return this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format'](_0x6d45('0x12b'),_0x5f36d5[_0x6d45('0x75')]));}}return this[_0x6d45('0xb')]['error'](_0x42ac54,_0x6d45('0x12c'));};AGIVertices['prototype']['googleasr']=function(_0x1238c4){logger['info'](util[_0x6d45('0x4f')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x1238c4[_0x6d45('0x33')],_0x1238c4[_0x6d45('0x63')]));if(!this[_0x6d45('0x82')](_0x1238c4[_0x6d45('0x79')])){return this[_0x6d45('0xb')]['noop'](_0x6d45('0x12d'));}var _0x3e2bca=_0x6d45('0x12e');var _0x36a18f=util['format'](_0x6d45('0x12f'),FILES_PATH,rs[_0x6d45('0x118')](0x4));var _0x3ae076=util[_0x6d45('0x4f')](_0x6d45('0x9b'),_0x36a18f,_0x3e2bca);var _0x492c52=!![];if(_0x1238c4[_0x6d45('0x130')]===_0x6d45('0x131')){_0x492c52=![];}var _0x4f6f1b=this[_0x6d45('0xb')][_0x6d45('0x132')](_0x36a18f,_0x3e2bca,_0x1238c4[_0x6d45('0x133')],_0x1238c4[_0x6d45('0x63')],undefined,_0x492c52);if(_0x4f6f1b[_0x6d45('0xa0')]!==-0x1){this['channel'][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x134'),_0x3ae076));var _0x26528c=this[_0x6d45('0x8b')]['sync'](this,_0x1238c4,_0x3ae076);if(_0x26528c){for(var _0x3b3177 in _0x26528c){if(_0x26528c[_0x6d45('0x95')](_0x3b3177)){this[_0x6d45('0xb')]['setVariable'](util[_0x6d45('0x4f')]('GOOGLE_ASR_%s',_0x3b3177['toUpperCase']()),_0x26528c[_0x3b3177]);}}return this[_0x6d45('0xb')]['noop'](util[_0x6d45('0x4f')](_0x6d45('0x135'),JSON['stringify'](_0x26528c)));}}return _0x4f6f1b;};AGIVertices[_0x6d45('0x12')]['tildeasr']=function(_0x22ff19){logger[_0x6d45('0x2c')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x22ff19[_0x6d45('0x33')]));if(!this['isConfigured'](_0x22ff19[_0x6d45('0x136')])){return this[_0x6d45('0xb')]['noop'](_0x6d45('0x137'));}if(!this['isConfigured'](_0x22ff19['appsecret'])){return this[_0x6d45('0xb')]['noop']('no\x20appsecret\x20configured');}var _0x1d4883=_0x6d45('0x12e');var _0x547630=util[_0x6d45('0x4f')](_0x6d45('0x12f'),FILES_PATH,rs[_0x6d45('0x118')](0x4));var _0x350561=util[_0x6d45('0x4f')](_0x6d45('0x9b'),_0x547630,_0x1d4883);var _0x52308a=!![];if(_0x22ff19[_0x6d45('0x130')]===_0x6d45('0x131')){_0x52308a=![];}var _0x44b9af=this['channel'][_0x6d45('0x132')](_0x547630,_0x1d4883,_0x22ff19['intKey'],_0x22ff19[_0x6d45('0x63')],undefined,_0x52308a);if(_0x44b9af[_0x6d45('0xa0')]!==-0x1){this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format'](_0x6d45('0x138'),_0x350561));var _0x10b11f=this[_0x6d45('0x8d')][_0x6d45('0x6e')](this,_0x22ff19,_0x350561);if(_0x10b11f){for(var _0x4d2a73 in _0x10b11f){if(_0x10b11f[_0x6d45('0x95')](_0x4d2a73)){this[_0x6d45('0xb')][_0x6d45('0x9c')](util[_0x6d45('0x4f')]('TILDE_ASR_%s',_0x4d2a73[_0x6d45('0x67')]()),_0x10b11f[_0x4d2a73]);}}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')]('TildeASR\x20Result\x20%s',JSON[_0x6d45('0x71')](_0x10b11f)));}}return _0x44b9af;};AGIVertices[_0x6d45('0x12')][_0x6d45('0x139')]=function(_0x4d03c1){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x13a'),_0x4d03c1[_0x6d45('0x33')]));return this['channel']['continueAt'](_0x4d03c1[_0x6d45('0x13b')],_0x4d03c1[_0x6d45('0x38')],_0x4d03c1[_0x6d45('0x39')]);};AGIVertices['prototype'][_0x6d45('0x13c')]=function(_0x4892f5){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x13d'),_0x4892f5[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x4892f5[_0x6d45('0x13e')])){return this['channel']['error'](_0x4892f5,'no\x20condition\x20configured');}try{var _0x1cdcc6=eval(_0x4892f5[_0x6d45('0x13e')])?'true':_0x6d45('0x13f');this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x140'),_0x4892f5[_0x6d45('0x13e')],_0x1cdcc6));return{'code':0xc8,'result':_0x1cdcc6};}catch(_0x41c94b){return{'code':0xc8,'result':_0x6d45('0x13f')};}};AGIVertices['prototype'][_0x6d45('0x141')]=function(_0xd45b59){logger['info'](util[_0x6d45('0x4f')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0xd45b59[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0xd45b59[_0x6d45('0x142')])){return this['channel'][_0x6d45('0x2b')](_0xd45b59,_0x6d45('0x143'));}var _0x27bcfd=this[_0x6d45('0x23')][_0x6d45('0x6e')](this,_0xd45b59['interval_id']);if(!_0x27bcfd){return this[_0x6d45('0xb')]['error'](_0xd45b59,_0x6d45('0x144'));}for(var _0x20c407=0x0;_0x20c407<_0x27bcfd[_0x6d45('0x98')];_0x20c407+=0x1){var _0x24957d=this[_0x6d45('0xb')][_0x6d45('0xe')](util[_0x6d45('0x4f')](_0x6d45('0x145'),_0x27bcfd[_0x20c407]));if(_0x24957d[_0x6d45('0xa0')]===-0x1){return _0x24957d;}logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x146'),_0x27bcfd[_0x20c407],_0x24957d[_0x6d45('0x9f')]));if(_0x24957d['extra']===_0x6d45('0x147')){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x146'),_0x27bcfd[_0x20c407],_0x6d45('0x147')));this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x146'),_0x27bcfd[_0x20c407],_0x6d45('0x147')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x6d45('0x4f')]('IFTIME\x20%s\x20%s',_0x27bcfd[_0x20c407],_0x6d45('0x13f')));this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x146'),_0x27bcfd[_0x20c407],_0x6d45('0x13f')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x6d45('0x12')][_0x6d45('0x148')]=function(_0x459dda){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x149'),_0x459dda[_0x6d45('0x33')]));return this['channel']['hangup']();};AGIVertices['prototype'][_0x6d45('0x14a')]=function(_0x53acec){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x14b'),_0x53acec[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x53acec['key'])){return this['channel'][_0x6d45('0xa7')](_0x6d45('0x12d'));}var _0x4983ff=_0x6d45('0x12e');var _0x5a3400=util[_0x6d45('0x4f')](_0x6d45('0x12f'),FILES_PATH,rs[_0x6d45('0x118')](0x4));var _0x299c46=util[_0x6d45('0x4f')](_0x6d45('0x9b'),_0x5a3400,_0x4983ff);var _0x3db58f=!![];if(_0x53acec[_0x6d45('0x130')]==='NOBEEP'){_0x3db58f=![];}var _0x47c40c=this['channel'][_0x6d45('0x132')](_0x5a3400,_0x4983ff,_0x53acec['intKey'],_0x53acec['timeout'],undefined,_0x3db58f);if(_0x47c40c[_0x6d45('0xa0')]!==-0x1){this['channel'][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x14c'),_0x299c46));var _0x153d87=this[_0x6d45('0x81')][_0x6d45('0x6e')](this,_0x53acec,_0x299c46);if(_0x153d87){for(var _0x4b0ffc in _0x153d87){if(_0x153d87[_0x6d45('0x95')](_0x4b0ffc)){this['channel']['setVariable'](util[_0x6d45('0x4f')](_0x6d45('0x14d'),_0x4b0ffc[_0x6d45('0x67')]()),_0x153d87[_0x4b0ffc]);}}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x14e'),JSON[_0x6d45('0x71')](_0x153d87)));}}return _0x47c40c;};AGIVertices['prototype']['ispeechtts']=function(_0x2a00d3){logger[_0x6d45('0x2c')](util['format'](_0x6d45('0x14f'),_0x2a00d3[_0x6d45('0x33')]));if(!this['isConfigured'](_0x2a00d3['key'])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20key\x20configured');}if(!this[_0x6d45('0x82')](_0x2a00d3[_0x6d45('0x58')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20text\x20configured');}this['channel'][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x150'),_0x2a00d3[_0x6d45('0x58')]));var _0x289654=this['ispeechTTS']['sync'](this,_0x2a00d3);if(_0x289654){this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format'](_0x6d45('0x14c'),_0x289654));var _0x2796d6=this[_0x6d45('0xb')][_0x6d45('0x124')](_0x289654,_0x2a00d3[_0x6d45('0x133')]);try{fs[_0x6d45('0x101')](_0x289654+_0x6d45('0x125'));}catch(_0x4686f9){logger[_0x6d45('0x2b')](_0x4686f9);}return _0x2796d6;}return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x2a00d3,_0x6d45('0x151'));};AGIVertices[_0x6d45('0x12')]['login']=function(_0x273337){logger['info'](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x273337[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x273337[_0x6d45('0x152')])){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x273337,_0x6d45('0x153'));}logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x154'),this['channel'][_0x6d45('0x37')],_0x273337[_0x6d45('0x152')]));var _0x22aab6=this[_0x6d45('0x4d')][_0x6d45('0x6e')](this,_0x273337[_0x6d45('0x152')]);if(_0x22aab6){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x155'),this['channel'][_0x6d45('0x37')],_0x273337[_0x6d45('0x152')]));this['channel']['noop'](util[_0x6d45('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x6d45('0xb')][_0x6d45('0x37')],_0x273337[_0x6d45('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x156'),this['channel'][_0x6d45('0x37')],_0x273337['findBy']));this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x156'),this[_0x6d45('0xb')][_0x6d45('0x37')],_0x273337['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x6d45('0x12')][_0x6d45('0x157')]=function(_0x1ed0e6){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x1ed0e6['label']));if(!this[_0x6d45('0x82')](_0x1ed0e6['findBy'])){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x1ed0e6,_0x6d45('0x153'));}logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x154'),this['channel'][_0x6d45('0x37')],_0x1ed0e6[_0x6d45('0x152')]));var _0x205519=this['agentLogout'][_0x6d45('0x6e')](this,_0x1ed0e6['findBy']);if(_0x205519){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x155'),this[_0x6d45('0xb')][_0x6d45('0x37')],_0x1ed0e6[_0x6d45('0x152')]));this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format'](_0x6d45('0x155'),this[_0x6d45('0xb')][_0x6d45('0x37')],_0x1ed0e6[_0x6d45('0x152')]));return{'code':0xc8,'result':_0x6d45('0x158')};}else{logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x156'),this['channel'][_0x6d45('0x37')],_0x1ed0e6[_0x6d45('0x152')]));this['channel'][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x156'),this['channel']['callerid'],_0x1ed0e6['findBy']));return{'code':0xc8,'result':_0x6d45('0x159')};}};AGIVertices[_0x6d45('0x12')]['math']=function(_0x35152f){logger[_0x6d45('0x2c')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x35152f[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x35152f['operation'])){return this[_0x6d45('0xb')]['error'](_0x35152f,_0x6d45('0x15a'));}this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x15b'),_0x35152f[_0x6d45('0x15c')]));var _0x3f65a3=eval(_0x35152f['operation']);if(!this[_0x6d45('0x82')](_0x35152f[_0x6d45('0xd7')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0x111'));}var _0xc727ec=this['getVariable'][_0x6d45('0x6e')](this,_0x35152f['variable_id']);if(!_0xc727ec){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x35152f,_0x6d45('0xd8'));}if(_['isArray'](_0x3f65a3)){var _0x16a7a3=this;_0x3f65a3[_0x6d45('0xd9')](function(_0x59c426,_0x4f087d){_0x16a7a3[_0x6d45('0xb')]['setVariable'](util[_0x6d45('0x4f')](_0x6d45('0x15d'),_0xc727ec,_0x4f087d),_0x59c426);});return this[_0x6d45('0xb')]['noop'](util[_0x6d45('0x4f')](_0x6d45('0x15e'),_0xc727ec));}else{return this[_0x6d45('0xb')][_0x6d45('0x9c')](_0xc727ec,_0x3f65a3);}};AGIVertices['prototype']['menu']=function(_0x14a9ae){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x15f'),_0x14a9ae[_0x6d45('0x33')]));if(_0x14a9ae[_0x6d45('0xa2')]===0x0){return this[_0x6d45('0xa3')](_0x14a9ae);}_0x14a9ae[_0x6d45('0xa2')]-=0x1;if(!this[_0x6d45('0x82')](_0x14a9ae[_0x6d45('0x10f')])){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x14a9ae,_0x6d45('0x160'));}var _0x371012=this[_0x6d45('0x1c')][_0x6d45('0x6e')](this,_0x14a9ae[_0x6d45('0x10f')]);if(!_0x371012){return this['channel'][_0x6d45('0x2b')](_0x14a9ae,'no\x20file\x20audio\x20found');}var _0x122c93=this[_0x6d45('0xb')][_0x6d45('0x112')](_0x371012,_0x14a9ae[_0x6d45('0x113')],_0x14a9ae['digit']);var _0x43259a=_0x122c93[_0x6d45('0xa0')];if(_0x122c93['result']===-0x1){this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0x14a9ae,'-1');return _0x122c93;}else if(_0x122c93[_0x6d45('0x9f')]===_0x6d45('0x63')){_0x122c93[_0x6d45('0xa0')]=_0x122c93[_0x6d45('0xa0')][_0x6d45('0x98')]>0x0?_0x122c93[_0x6d45('0xa0')]:'t';}else if(_[_0x6d45('0x3f')](_0x122c93[_0x6d45('0xa0')])){_0x122c93[_0x6d45('0xa0')]='#';_0x43259a='#';}if(!this[_0x6d45('0x82')](_0x14a9ae['variable_id'])){this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0x111'));}else{var _0x41c849=this[_0x6d45('0xe')][_0x6d45('0x6e')](this,_0x14a9ae[_0x6d45('0xd7')]);if(!_0x41c849){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x14a9ae,'no\x20variable\x20found');}this[_0x6d45('0xb')][_0x6d45('0x9c')](_0x41c849,_0x43259a);}this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0x14a9ae,_0x43259a);return _0x122c93;};AGIVertices[_0x6d45('0x12')][_0x6d45('0xa7')]=function(_0x473eb7){logger[_0x6d45('0x2c')](util['format'](_0x6d45('0x161'),_0x473eb7[_0x6d45('0x33')]));return this[_0x6d45('0xb')]['noop'](_0x473eb7['output']||_0x473eb7[_0x6d45('0x33')]);};AGIVertices[_0x6d45('0x12')][_0x6d45('0x162')]=function(_0x3aaacc){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3aaacc[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x3aaacc[_0x6d45('0x152')])){return this['channel'][_0x6d45('0x2b')](_0x3aaacc,'no\x20find\x20by\x20configured');}logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x6d45('0x37')],_0x3aaacc[_0x6d45('0x152')]));var _0xff39d5=this[_0x6d45('0x48')][_0x6d45('0x6e')](this,_0x3aaacc['pause_id']);var _0x5afcc3=this[_0x6d45('0x49')][_0x6d45('0x6e')](this,_0x3aaacc[_0x6d45('0x152')],_0xff39d5);if(_0x5afcc3){logger['info'](util['format'](_0x6d45('0x155'),this['channel'][_0x6d45('0x37')],_0x3aaacc[_0x6d45('0x152')]));this['channel'][_0x6d45('0xa7')](util['format'](_0x6d45('0x155'),this[_0x6d45('0xb')][_0x6d45('0x37')],_0x3aaacc[_0x6d45('0x152')]));return{'code':0xc8,'result':_0x6d45('0x158')};}else{logger[_0x6d45('0x2c')](util['format'](_0x6d45('0x156'),this[_0x6d45('0xb')][_0x6d45('0x37')],_0x3aaacc['findBy']));this['channel'][_0x6d45('0xa7')](util['format'](_0x6d45('0x155'),this[_0x6d45('0xb')][_0x6d45('0x37')],_0x3aaacc[_0x6d45('0x152')]));return{'code':0xc8,'result':_0x6d45('0x159')};}};AGIVertices[_0x6d45('0x12')][_0x6d45('0x163')]=function(_0x127fb7){logger[_0x6d45('0x2c')](util['format'](_0x6d45('0x164'),_0x127fb7['label']));if(!this[_0x6d45('0x82')](_0x127fb7[_0x6d45('0x10f')])){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x127fb7,_0x6d45('0x160'));}var _0x5981c4=this[_0x6d45('0x1c')][_0x6d45('0x6e')](this,_0x127fb7[_0x6d45('0x10f')]);if(!_0x5981c4){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x127fb7,_0x6d45('0x110'));}var _0x505c22=this['channel'][_0x6d45('0x53')](_0x6d45('0x165'),[_0x5981c4,_0x127fb7[_0x6d45('0xe5')]]);if(_0x505c22[_0x6d45('0xa0')]===-0x1){return _0x505c22;}return this['channel'][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xc2'),_0x6d45('0x165'),_0x5981c4));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x166')]=function(_0x4b7817){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x167'),_0x4b7817[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x4b7817['queue_id'])){return this[_0x6d45('0xb')]['error'](_0x4b7817,_0x6d45('0x168'));}var _0x561c2d='';var _0x5a25b3=parseInt(_0x4b7817['queue_id'],0xa);if(isNaN(_0x5a25b3)){_0x561c2d=_0x4b7817[_0x6d45('0x169')];}else{_0x561c2d=this[_0x6d45('0x16a')][_0x6d45('0x6e')](this,_0x4b7817[_0x6d45('0x169')]);if(!_0x561c2d){return this[_0x6d45('0xb')]['error'](_0x4b7817,'no\x20queue\x20found');}}var _0x142864='';if(this[_0x6d45('0x82')](_0x4b7817[_0x6d45('0x10f')])){var _0x3e3937=this['getSound'][_0x6d45('0x6e')](this,_0x4b7817[_0x6d45('0x10f')]);if(_0x3e3937){_0x142864=_0x3e3937;}}this[_0x6d45('0x32')]['sync'](this,_0x4b7817,_0x561c2d);if(_0x4b7817['opts']['indexOf']('x')<0x0){_0x4b7817[_0x6d45('0xe5')]+='x';}if(_0x4b7817[_0x6d45('0xe5')][_0x6d45('0x16b')]('X')<0x0){_0x4b7817[_0x6d45('0xe5')]+='X';}this[_0x6d45('0xb')][_0x6d45('0x9c')]('XMCS-QUEUE',_0x561c2d?_0x561c2d[_0x6d45('0x16c')]():'');var _0x104e02=this[_0x6d45('0xb')][_0x6d45('0x53')](_0x6d45('0x16d'),[_0x561c2d,_0x4b7817['opts'],_0x4b7817[_0x6d45('0x61')],_0x142864,_0x4b7817[_0x6d45('0x63')],_0x4b7817[_0x6d45('0x6')],_0x4b7817[_0x6d45('0x16e')],_0x4b7817[_0x6d45('0x16f')],'',_0x4b7817['position']]);if(_0x104e02[_0x6d45('0xa0')]===-0x1){return _0x104e02;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')]('Executed\x20command\x20%s\x20%s',_0x6d45('0x16d'),_0x561c2d));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x170')]=function(_0xeec03b){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x171'),_0xeec03b[_0x6d45('0x33')]));var _0xe3e8b3=_0xeec03b[_0x6d45('0x172')]||_0x6d45('0x12e');var _0x4ebd2d=util[_0x6d45('0x4f')](_0x6d45('0x173'),this['channel'][_0x6d45('0x36')],rs[_0x6d45('0x118')](0x5));var _0x418cc3=util[_0x6d45('0x4f')]('%s/recordings/%s.%s',FILES_PATH,_0x4ebd2d,_0xe3e8b3);var _0x5470be=util[_0x6d45('0x4f')]('%s/recordings/%s',FILES_PATH,_0x4ebd2d);this['createSquareRecording']['sync'](this,_0xeec03b,_0x4ebd2d,_0x418cc3);this[_0x6d45('0xb')][_0x6d45('0x9c')](_0x6d45('0x174'),_0x4ebd2d);logger[_0x6d45('0x2c')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x5470be,_0xe3e8b3,_0xeec03b['escape_digits'],_0xeec03b[_0x6d45('0x63')]);return this[_0x6d45('0xb')][_0x6d45('0x132')](_0x5470be,_0xe3e8b3,_0xeec03b['escape_digits'],_0xeec03b[_0x6d45('0x63')],undefined,!![]);};AGIVertices[_0x6d45('0x12')][_0x6d45('0x175')]=function(_0x1d0cf9){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x176'),_0x1d0cf9[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x1d0cf9[_0x6d45('0x61')])){return this['channel'][_0x6d45('0xa7')](_0x6d45('0x177'));}var _0x461dcb=this[_0x6d45('0x178')][_0x6d45('0x6e')](this,_0x1d0cf9);logger['info'](util[_0x6d45('0x4f')]('Response:',util[_0x6d45('0x179')](_0x461dcb,{'showHidden':![],'depth':null})));if(!this[_0x6d45('0x82')](_0x1d0cf9[_0x6d45('0xd7')])){return this[_0x6d45('0xb')]['noop'](_0x6d45('0x17a'));}var _0x45f4a=this['getVariable']['sync'](this,_0x1d0cf9[_0x6d45('0xd7')]);if(!_0x45f4a){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x1d0cf9,'no\x20variable\x20found');}this[_0x6d45('0xb')][_0x6d45('0x9c')](util[_0x6d45('0x4f')](_0x6d45('0x17b'),_0x45f4a),_0x461dcb[_0x6d45('0x73')]?_0x461dcb[_0x6d45('0x73')]:_0x6d45('0x17c'));this['channel'][_0x6d45('0x9c')](util[_0x6d45('0x4f')]('%s_STATUS_MESSAGE',_0x45f4a),_0x461dcb[_0x6d45('0x74')]?_0x461dcb[_0x6d45('0x74')]:'OK');if(_0x461dcb[_0x6d45('0x68')]){try{this[_0x6d45('0x9a')](_0x461dcb[_0x6d45('0x68')],_0x45f4a);}catch(_0x4db1cc){logger['error'](util[_0x6d45('0x4f')](_0x6d45('0x17d'),_0x45f4a));}}return this[_0x6d45('0xb')]['noop'](util['format'](_0x6d45('0xdd'),_0x45f4a));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x17e')]=function(_0x29ac34){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x29ac34[_0x6d45('0x33')]));return this[_0x6d45('0xb')][_0x6d45('0x17f')](_0x29ac34[_0x6d45('0x180')][_0x6d45('0xd6')](/\s+/g,''),_0x29ac34[_0x6d45('0x181')]);};AGIVertices['prototype'][_0x6d45('0x182')]=function(_0x57ee72){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x183'),_0x57ee72[_0x6d45('0x33')]));return this[_0x6d45('0xb')]['sayNumber'](_0x57ee72['number']['replace'](/\s+/g,''),_0x57ee72['escape_digits']);};AGIVertices['prototype'][_0x6d45('0x184')]=function(_0x515a18){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x185'),_0x515a18[_0x6d45('0x33')]));return this[_0x6d45('0xb')][_0x6d45('0x186')](_0x515a18[_0x6d45('0x58')],_0x515a18['escape_digits']);};AGIVertices[_0x6d45('0x12')][_0x6d45('0x187')]=function(_0x245ac9){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x188'),_0x245ac9[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x245ac9[_0x6d45('0x189')])){return this['channel'][_0x6d45('0xa7')](_0x6d45('0x18a'));}var _0x5d5156=this['getMailAccount'][_0x6d45('0x6e')](this,_0x245ac9[_0x6d45('0x189')]);if(!_0x5d5156||!_0x5d5156[_0x6d45('0x18b')]){return this[_0x6d45('0xb')]['error'](_0x245ac9,_0x6d45('0x18c'));}var _0x1096c3={'from':util[_0x6d45('0x4f')](_0x6d45('0x18d'),_0x5d5156[_0x6d45('0x11')],_0x5d5156[_0x6d45('0x18e')]||_0x5d5156[_0x6d45('0x18b')][_0x6d45('0x18f')]),'to':_0x245ac9['to']||'','cc':_0x245ac9['cc']||'','bcc':_0x245ac9[_0x6d45('0x190')]||'','subject':_0x245ac9[_0x6d45('0x191')],'html':_0x245ac9['text'],'text':_0x245ac9[_0x6d45('0x58')]};var _0x59b67c={'tls':{'rejectUnauthorized':![]}};if(_0x5d5156['Smtp']['service']){_0x59b67c['service']=_0x5d5156[_0x6d45('0x18b')][_0x6d45('0x192')];}else{_0x59b67c[_0x6d45('0x193')]=_0x5d5156[_0x6d45('0x18b')][_0x6d45('0x193')];_0x59b67c[_0x6d45('0x194')]=_0x5d5156[_0x6d45('0x18b')][_0x6d45('0x194')];_0x59b67c[_0x6d45('0x195')]=_0x5d5156[_0x6d45('0x18b')][_0x6d45('0x195')];}if(_0x5d5156[_0x6d45('0x18b')][_0x6d45('0x196')]){_0x59b67c[_0x6d45('0x197')]={'user':_0x5d5156['Smtp'][_0x6d45('0x18f')],'pass':_0x5d5156[_0x6d45('0x18b')][_0x6d45('0x198')]};}if(this[_0x6d45('0x82')](_0x245ac9[_0x6d45('0x199')])){}logger[_0x6d45('0x19a')](_0x6d45('0x19b'),JSON[_0x6d45('0x71')](_0x1096c3));this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0x245ac9,_0x245ac9['account_id']);this['channel']['noop'](util[_0x6d45('0x4f')](_0x6d45('0x19c'),_0x5d5156[_0x6d45('0x11')]));this['sendMailMessage'][_0x6d45('0x6e')](this,_0x59b67c,_0x1096c3);return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0x19d'));};AGIVertices['prototype'][_0x6d45('0x19e')]=function(_0x5eb3b1){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x5eb3b1[_0x6d45('0x33')]));return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0x19f'));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x1a0')]=function(_0x22dd51){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x22dd51[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x22dd51[_0x6d45('0x1a1')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20sms\x20account\x20configured');}var _0x3b6d95=this[_0x6d45('0x1a2')][_0x6d45('0x6e')](this,_0x22dd51[_0x6d45('0x1a1')]);if(!_0x3b6d95){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x22dd51,'no\x20sms\x20account\x20found');}var _0x27df7d={'body':_0x22dd51[_0x6d45('0x1a3')],'phone':_0x22dd51['to']||'','SmsAccountId':_0x3b6d95['id']};logger[_0x6d45('0x19a')](_0x6d45('0x1a4'),JSON[_0x6d45('0x71')](_0x27df7d));this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0x22dd51,_0x22dd51['sms_account_id']);this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format'](_0x6d45('0x1a5'),_0x3b6d95[_0x6d45('0x11')]));this[_0x6d45('0x31')][_0x6d45('0x6e')](this,_0x27df7d);return this['channel'][_0x6d45('0xa7')](_0x6d45('0x1a6'));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x1a7')]=function(_0x58edb1){logger[_0x6d45('0x2c')](util['format'](_0x6d45('0x1a8'),_0x58edb1['label']));if(!this[_0x6d45('0x82')](_0x58edb1[_0x6d45('0xd7')])){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x58edb1,_0x6d45('0x1a9'));}var _0x1b701c=this['getVariable'][_0x6d45('0x6e')](this,_0x58edb1[_0x6d45('0xd7')]);if(!_0x1b701c){return this['channel'][_0x6d45('0x2b')](_0x58edb1,_0x6d45('0xd8'));}return this['channel']['setVariable'](_0x1b701c,_0x58edb1[_0x6d45('0x1aa')]);};AGIVertices['prototype'][_0x6d45('0x1ab')]=function(_0x72f0bb){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x1ac'),_0x72f0bb[_0x6d45('0x33')]));this[_0x6d45('0xb')]['noop'](_0x6d45('0x1ad'));if(_0x72f0bb[_0x6d45('0xb6')]===_0x6d45('0x1ae')){this['channel'][_0x6d45('0xa7')](_0x6d45('0x1af'));return this[_0x6d45('0xb')][_0x6d45('0xb6')]();}return this['channel'][_0x6d45('0xa7')](_0x6d45('0x1b0'));};AGIVertices['prototype'][_0x6d45('0x1b1')]=function(_0xff88af){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x1b2'),_0xff88af[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0xff88af[_0x6d45('0x1b3')])){return this['channel']['error'](_0xff88af,_0x6d45('0x1b4'));}var _0x4958ed=this[_0x6d45('0x15')][_0x6d45('0x6e')](this,_0xff88af[_0x6d45('0x1b3')]);if(!this[_0x6d45('0x82')](_0x4958ed)){return this['channel'][_0x6d45('0x2b')](_0xff88af,util['format'](_0x6d45('0x1b5'),_0xff88af['project_id']));}if(_0x4958ed===this[_0x6d45('0xb')][_0x6d45('0x34')]){return this[_0x6d45('0xb')]['error'](_0xff88af,_0x6d45('0x1b6'));}this[_0x6d45('0x32')][_0x6d45('0x6e')](this,_0xff88af,_0x4958ed);var _0x9af2=this[_0x6d45('0xb')][_0x6d45('0x53')](_0x6d45('0x1b7'),util[_0x6d45('0x4f')](_0x6d45('0x1b8'),config[_0x6d45('0x6')][_0x6d45('0x193')]||_0x6d45('0x1b9'),_0x4958ed,this[_0x6d45('0xb')][_0x6d45('0x34')]));if(_0x9af2[_0x6d45('0xa0')]===-0x1){return _0x9af2;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0xc2'),_0x6d45('0x1b7'),_0x4958ed));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x1ba')]=function(_0x325188){logger[_0x6d45('0x2c')](util['format'](_0x6d45('0x1bb'),_0x325188[_0x6d45('0x33')]));var _0x44f7cf=this[_0x6d45('0x52')][_0x6d45('0x6e')](this,_0x325188[_0x6d45('0xb5')]);this[_0x6d45('0x32')]['sync'](this,_0x325188,_0x325188[_0x6d45('0xb5')]);if(this[_0x6d45('0x82')](_0x325188[_0x6d45('0xd7')])){var _0x1fd393=this['getVariable'][_0x6d45('0x6e')](this,_0x325188['variable_id']);if(_0x1fd393){this['channel'][_0x6d45('0x9c')](_0x1fd393,_0x44f7cf);return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x1bc'),_0x325188['command'],_0x1fd393));}}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x325188[_0x6d45('0xb5')]));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x1bd')]=function(_0x27dc5d){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x1be'),_0x27dc5d[_0x6d45('0x33')]));_0x27dc5d[_0x6d45('0x58')]=_0x27dc5d['text'][_0x6d45('0xd6')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6d45('0x82')](_0x27dc5d[_0x6d45('0x56')])){return this[_0x6d45('0xb')]['noop'](_0x6d45('0x1bf'));}if(!this[_0x6d45('0x82')](_0x27dc5d['text'])){return this[_0x6d45('0xb')][_0x6d45('0xa7')](_0x6d45('0xa6'));}this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x1c0'),_0x27dc5d['text']));var _0x10eb25=this[_0x6d45('0x55')][_0x6d45('0x6e')](this,_0x27dc5d);if(_0x10eb25){this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x1c1'),_0x10eb25));var _0x522607=this[_0x6d45('0xb')][_0x6d45('0x124')](_0x10eb25);try{fs[_0x6d45('0x101')](_0x10eb25+_0x6d45('0x125'));}catch(_0x430ca2){logger['error'](_0x430ca2);}return _0x522607;}return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x27dc5d,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x6d45('0x1c2')]=function(_0x2c2e02){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2c2e02[_0x6d45('0x33')]));_0x2c2e02[_0x6d45('0x58')]=_0x2c2e02[_0x6d45('0x58')][_0x6d45('0xd6')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x6d45('0x82')](_0x2c2e02[_0x6d45('0x58')])){return this[_0x6d45('0xb')][_0x6d45('0xa7')]('no\x20text\x20configured');}this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x1c3'),_0x2c2e02[_0x6d45('0x58')]));var _0x39a8ad=this[_0x6d45('0x5f')]['sync'](this,_0x2c2e02);if(_0x39a8ad){this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')](_0x6d45('0x1c4'),_0x39a8ad));var _0x2b2421=this['channel'][_0x6d45('0x124')](_0x39a8ad);try{fs[_0x6d45('0x101')](_0x39a8ad+_0x6d45('0x125'));}catch(_0x3a5666){logger[_0x6d45('0x2b')](_0x3a5666);}return _0x2b2421;}return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x2c2e02,_0x6d45('0x1c5'));};AGIVertices[_0x6d45('0x12')][_0x6d45('0x1c6')]=function(_0x2e6742){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x1c7'),_0x2e6742[_0x6d45('0x33')]));if(!this[_0x6d45('0x82')](_0x2e6742[_0x6d45('0x152')])){return this['channel']['error'](_0x2e6742,'no\x20find\x20by\x20configured');}logger[_0x6d45('0x2c')](util['format'](_0x6d45('0x154'),this[_0x6d45('0xb')][_0x6d45('0x37')],_0x2e6742[_0x6d45('0x152')]));var _0x146043=this[_0x6d45('0x4b')][_0x6d45('0x6e')](this,_0x2e6742[_0x6d45('0x152')]);if(_0x146043){logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x155'),this['channel']['callerid'],_0x2e6742[_0x6d45('0x152')]));this[_0x6d45('0xb')]['noop'](util[_0x6d45('0x4f')](_0x6d45('0x155'),this[_0x6d45('0xb')]['callerid'],_0x2e6742[_0x6d45('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x6d45('0x2c')](util[_0x6d45('0x4f')](_0x6d45('0x156'),this[_0x6d45('0xb')][_0x6d45('0x37')],_0x2e6742[_0x6d45('0x152')]));this[_0x6d45('0xb')]['noop'](util['format'](_0x6d45('0x156'),this[_0x6d45('0xb')][_0x6d45('0x37')],_0x2e6742[_0x6d45('0x152')]));return{'code':0xc8,'result':_0x6d45('0x159')};}};AGIVertices['prototype'][_0x6d45('0x1c8')]=function(_0x1675e4){logger['info'](util['format'](_0x6d45('0x1c9'),_0x1675e4[_0x6d45('0x33')]));var _0x427e12=this[_0x6d45('0xb')][_0x6d45('0x53')](_0x6d45('0x1ca'),[_0x1675e4[_0x6d45('0x1cb')],_0x1675e4['options']]);if(_0x427e12['result']===-0x1){return _0x427e12;}return this[_0x6d45('0xb')][_0x6d45('0xa7')](util[_0x6d45('0x4f')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x1675e4[_0x6d45('0x1cb')]));};AGIVertices['prototype'][_0x6d45('0x1cc')]=function(_0x5cbc75){logger['info'](util[_0x6d45('0x4f')](_0x6d45('0x1cd'),_0x5cbc75['label']));if(!this['isConfigured'](_0x5cbc75[_0x6d45('0xd7')])){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x5cbc75,_0x6d45('0x1a9'));}var _0x25e897=this['getVariable'][_0x6d45('0x6e')](this,_0x5cbc75[_0x6d45('0xd7')]);if(!_0x25e897){return this[_0x6d45('0xb')][_0x6d45('0x2b')](_0x5cbc75,_0x6d45('0xd8'));}var _0x149e60=this[_0x6d45('0xb')][_0x6d45('0xe')](_0x25e897);return{'code':0xc8,'result':_0x149e60[_0x6d45('0x9f')]?_0x149e60[_0x6d45('0x9f')]:'-'};};String['prototype'][_0x6d45('0x9e')]=function(_0xee53f4,_0x25d9ca){return this[_0x6d45('0x9d')](_0xee53f4)['join'](_0x25d9ca);};module[_0x6d45('0x1ce')]=AGIVertices;
\ No newline at end of file
index 5f6819d..affb0fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f9d=['[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','exports','util','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','seconds','prototype','startAcw','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','catch','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined'];(function(_0x5d2753,_0x457596){var _0x8cdc95=function(_0x4a27d6){while(--_0x4a27d6){_0x5d2753['push'](_0x5d2753['shift']());}};_0x8cdc95(++_0x457596);}(_0x2f9d,0x6d));var _0xd2f9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2f9d[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0xd2f9('0x0'));var _=require('lodash');var moment=require(_0xd2f9('0x1'));var ami=require('../ami');var logger=require(_0xd2f9('0x2'))(_0xd2f9('0x3'));var RpcUser=require(_0xd2f9('0x4'));var RpcVoiceAgentReport=require(_0xd2f9('0x5'));function Acw(_0x2988d4){this[_0xd2f9('0x6')]=_0x2988d4[_0xd2f9('0x6')];this[_0xd2f9('0x7')]=_0x2988d4[_0xd2f9('0x7')];this[_0xd2f9('0x8')]=_0x2988d4[_0xd2f9('0x8')];this['channels']={};ami['on'](_0xd2f9('0x9'),this[_0xd2f9('0xa')][_0xd2f9('0xb')](this));ami['on'](_0xd2f9('0xc'),this[_0xd2f9('0xd')][_0xd2f9('0xb')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xd2f9('0xe'),this[_0xd2f9('0xf')]['bind'](this));ami['on'](_0xd2f9('0x10'),this['syncAttendedTransfer'][_0xd2f9('0xb')](this));ami['on'](_0xd2f9('0x11'),this[_0xd2f9('0x12')][_0xd2f9('0xb')](this));ami['on'](_0xd2f9('0x13'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x2d5d41){var _0xe566d6=moment()[_0xd2f9('0x14')](0x0);var _0x5608f2=moment(_0x2d5d41)['milliseconds'](0x0);return _0xe566d6['diff'](_0x5608f2,_0xd2f9('0x15'));}Acw[_0xd2f9('0x16')][_0xd2f9('0x17')]=function(_0x5abe8a){try{var _0x45f4c5=this;var _0x2f4fbe=this[_0xd2f9('0x18')][_0x5abe8a][_0xd2f9('0x19')];var _0x50236c=this['channels'][_0x5abe8a][_0xd2f9('0x1a')];var _0x1f955f=this[_0xd2f9('0x6')][_0x50236c];var _0x16571f=![];var _0x2d517a=_0xd2f9('0x1b');if(_0x1f955f[_0xd2f9('0x1c')]){if(_0x1f955f[_0xd2f9('0x1d')][_0xd2f9('0x1e')]){_0x16571f=!![];_0x2d517a=_0x1f955f[_0xd2f9('0x1d')][_0xd2f9('0x1e')];}}ami[_0xd2f9('0x1f')]({'action':_0xd2f9('0x20'),'interface':_0x2f4fbe,'paused':!![],'reason':_0x2d517a})[_0xd2f9('0x21')](function(_0x5d3812){if(_0x45f4c5[_0xd2f9('0x7')][_0x2f4fbe]){return RpcUser[_0xd2f9('0x22')](_0x45f4c5['agents'][_0x2f4fbe]['id'])[_0xd2f9('0x21')](function(_0xe1bfdd){if(_0xe1bfdd&&!_0xe1bfdd[_0xd2f9('0x23')]){logger[_0xd2f9('0x24')](_0xd2f9('0x25'),_0x5abe8a,_0x2f4fbe,_0x50236c);var _0xb8cafc=_0x45f4c5['channels'][_0x5abe8a][_0xd2f9('0x26')]&&_0x45f4c5[_0xd2f9('0x18')][_0x5abe8a]['destlinkedid']?_0x45f4c5[_0xd2f9('0x18')][_0x5abe8a][_0xd2f9('0x27')]:_0x5abe8a;return RpcUser['savePause'](_0x45f4c5['agents'][_0x2f4fbe],_0x2d517a,_0xb8cafc)[_0xd2f9('0x21')](function(_0x4d0a48){if(!_0x16571f){_0x45f4c5['timers'][_0x2f4fbe]={};logger[_0xd2f9('0x24')](_0xd2f9('0x28'),_0x5abe8a,_0x45f4c5[_0xd2f9('0x6')][_0x50236c]['acwTimeout'],_0x2f4fbe,_0x50236c);_0x45f4c5['timers'][_0x2f4fbe]['timer']=setTimeout(_0x45f4c5[_0xd2f9('0x29')][_0xd2f9('0xb')](_0x45f4c5,_0x2f4fbe),_0x45f4c5['voiceQueues'][_0x50236c][_0xd2f9('0x2a')]*0x3e8);_0x45f4c5[_0xd2f9('0x8')][_0x2f4fbe][_0xd2f9('0x2b')]=moment()[_0xd2f9('0x2c')](_0xd2f9('0x2d'));_0x45f4c5[_0xd2f9('0x8')][_0x2f4fbe][_0xd2f9('0x2e')]=_0x5abe8a;_0x45f4c5[_0xd2f9('0x8')][_0x2f4fbe][_0xd2f9('0x1a')]=_0x50236c;_0x45f4c5[_0xd2f9('0x8')][_0x2f4fbe][_0xd2f9('0x2f')]=function(){var _0x42bc36=getDiff(_0x45f4c5['timers'][_0x2f4fbe][_0xd2f9('0x2b')]);clearTimeout(_0x45f4c5[_0xd2f9('0x8')][_0x2f4fbe]['timer']);_0x45f4c5['timers'][_0x2f4fbe][_0xd2f9('0x30')]=![];RpcVoiceAgentReport[_0xd2f9('0x31')]({'acwtime':_0x42bc36},_0x45f4c5[_0xd2f9('0x8')][_0x2f4fbe][_0xd2f9('0x2e')],_0x2f4fbe)[_0xd2f9('0x21')](function(_0x2465b1){logger[_0xd2f9('0x24')](_0xd2f9('0x32'),_0x5abe8a,_0x42bc36,_0x2465b1);})['catch'](function(_0x286917){logger['error'](_0xd2f9('0x33'),_0x5abe8a,_0x286917);});delete _0x45f4c5[_0xd2f9('0x8')][_0x2f4fbe];};}});}else{logger[_0xd2f9('0x24')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5abe8a,_0x2f4fbe,_0x50236c);}});}})['catch'](function(_0x4c604c){logger[_0xd2f9('0x34')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5abe8a,_0x45f4c5[_0xd2f9('0x6')][_0x50236c][_0xd2f9('0x2a')],_0x2f4fbe,_0x50236c);})[_0xd2f9('0x35')](function(){delete _0x45f4c5[_0xd2f9('0x18')][_0x5abe8a];});}catch(_0x18a26c){logger[_0xd2f9('0x34')](_0xd2f9('0x36'),_0x18a26c[_0xd2f9('0x37')]);}};Acw[_0xd2f9('0x16')][_0xd2f9('0x29')]=function(_0x20d673){try{var _0x1ea653=this;if(_0x1ea653[_0xd2f9('0x8')][_0x20d673]){_0x1ea653[_0xd2f9('0x8')][_0x20d673][_0xd2f9('0x30')]=![];var _0x341902=_0x1ea653[_0xd2f9('0x8')][_0x20d673]['uniqueid'];var _0x395f29=_0x1ea653[_0xd2f9('0x8')][_0x20d673]['queue'];var _0x1b3bf6=_0x1ea653[_0xd2f9('0x6')][_0x395f29][_0xd2f9('0x2a')];logger[_0xd2f9('0x24')](_0xd2f9('0x38'),_0x341902,_0x20d673);RpcUser[_0xd2f9('0x39')](this[_0xd2f9('0x7')][_0x20d673]);RpcVoiceAgentReport[_0xd2f9('0x31')]({'acwtime':_0x1b3bf6,'agentacw':!![]},_0x341902,_0x20d673)[_0xd2f9('0x21')](function(_0x10cf65){logger[_0xd2f9('0x24')]('[%s][UPDATE][ACWTIME:%s]',_0x341902,_0x1b3bf6,_0x10cf65);})[_0xd2f9('0x3a')](function(_0x12170e){logger['error'](_0xd2f9('0x33'),_0x341902,_0x12170e);});}else{logger[_0xd2f9('0x34')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x20d673);if(_0x1ea653[_0xd2f9('0x8')]){logger[_0xd2f9('0x24')](_0xd2f9('0x3b'),JSON[_0xd2f9('0x3c')](_0x1ea653[_0xd2f9('0x8')]));}}}catch(_0x5cb2d5){logger[_0xd2f9('0x34')](_0xd2f9('0x3d'),_0x5cb2d5[_0xd2f9('0x37')]);}};Acw[_0xd2f9('0x16')]['syncAgentConnect']=function(_0xf732ba){try{if(this[_0xd2f9('0x6')][_0xf732ba[_0xd2f9('0x1a')]]&&(this[_0xd2f9('0x6')][_0xf732ba['queue']][_0xd2f9('0x3')]||this[_0xd2f9('0x6')][_0xf732ba[_0xd2f9('0x1a')]]['mandatoryDisposition'])){if(this[_0xd2f9('0x7')][_0xf732ba['interface']]){this[_0xd2f9('0x18')][_0xf732ba[_0xd2f9('0x2e')]]={'queue':_0xf732ba[_0xd2f9('0x1a')],'interface':_0xf732ba[_0xd2f9('0x19')],'destlinkedid':_0xf732ba[_0xd2f9('0x27')]};}}}catch(_0x1e3896){logger[_0xd2f9('0x34')]('[ACW][syncAgentConnect]\x20%s',_0x1e3896[_0xd2f9('0x37')]);}};Acw[_0xd2f9('0x16')][_0xd2f9('0x3e')]=function(_0x5d1968){try{if(this[_0xd2f9('0x6')][_0x5d1968[_0xd2f9('0x1a')]]&&(this['voiceQueues'][_0x5d1968['queue']][_0xd2f9('0x3')]||this[_0xd2f9('0x6')][_0x5d1968[_0xd2f9('0x1a')]][_0xd2f9('0x1c')])){if(this[_0xd2f9('0x7')][_0x5d1968[_0xd2f9('0x19')]]){this[_0xd2f9('0x18')][_0x5d1968[_0xd2f9('0x2e')]]={'queue':_0x5d1968[_0xd2f9('0x1a')],'interface':_0x5d1968['interface']};}}}catch(_0xb0cdf6){logger[_0xd2f9('0x34')](_0xd2f9('0x3f'),_0xb0cdf6[_0xd2f9('0x37')]);}};Acw[_0xd2f9('0x16')][_0xd2f9('0xd')]=function(_0x198901){try{if(this[_0xd2f9('0x18')][_0x198901['uniqueid']]&&_[_0xd2f9('0x40')](this[_0xd2f9('0x18')][_0x198901['uniqueid']]['attended'])){logger[_0xd2f9('0x24')](_0xd2f9('0x41'),_0x198901[_0xd2f9('0x2e')]);this[_0xd2f9('0x17')](_0x198901[_0xd2f9('0x2e')]);}else if(this[_0xd2f9('0x18')][_0x198901['linkedid']]&&_[_0xd2f9('0x40')](this[_0xd2f9('0x18')][_0x198901[_0xd2f9('0x42')]]['attended'])){logger[_0xd2f9('0x24')](_0xd2f9('0x43'),_0x198901['linkedid']);this['startAcw'](_0x198901['linkedid']);}}catch(_0x555077){logger[_0xd2f9('0x34')](_0xd2f9('0x44'),_0x555077[_0xd2f9('0x37')]);}};Acw['prototype'][_0xd2f9('0x45')]=function(_0x570b09){try{if(this[_0xd2f9('0x18')][_0x570b09[_0xd2f9('0x2e')]]&&this[_0xd2f9('0x18')][_0x570b09[_0xd2f9('0x2e')]][_0xd2f9('0x26')]){logger['info'](_0xd2f9('0x46'),_0x570b09[_0xd2f9('0x2e')]);this[_0xd2f9('0x17')](_0x570b09['uniqueid']);}else if(this['channels'][_0x570b09[_0xd2f9('0x42')]]&&this[_0xd2f9('0x18')][_0x570b09[_0xd2f9('0x42')]]['attended']){logger[_0xd2f9('0x24')](_0xd2f9('0x47'),_0x570b09[_0xd2f9('0x42')]);this['startAcw'](_0x570b09[_0xd2f9('0x42')]);}}catch(_0x57025e){logger[_0xd2f9('0x34')](_0xd2f9('0x48'),_0x57025e[_0xd2f9('0x37')]);}};Acw[_0xd2f9('0x16')]['syncAttendedTransfer']=function(_0x87a894){try{if(!_[_0xd2f9('0x49')](this[_0xd2f9('0x18')][_0x87a894['transfereeuniqueid']])){this[_0xd2f9('0x17')](_0x87a894[_0xd2f9('0x4a')]);if(this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4b')]]){this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4b')]][_0xd2f9('0x26')]=!![];this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4c')]]=this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4b')]];delete this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4b')]];}}else if(!_[_0xd2f9('0x49')](this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4c')]])){this[_0xd2f9('0x17')](_0x87a894[_0xd2f9('0x4c')]);if(this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4d')]]){this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4d')]][_0xd2f9('0x26')]=!![];this[_0xd2f9('0x18')][_0x87a894['transfereeuniqueid']]=this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4d')]];delete this[_0xd2f9('0x18')][_0x87a894[_0xd2f9('0x4d')]];}}}catch(_0xab4c60){logger[_0xd2f9('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0xab4c60[_0xd2f9('0x37')]);}};Acw[_0xd2f9('0x16')][_0xd2f9('0x12')]=function(_0x3f55ec){try{if(this[_0xd2f9('0x18')][_0x3f55ec['transfereruniqueid']]){logger['info'](_0xd2f9('0x4e'),JSON[_0xd2f9('0x3c')](_0x3f55ec[_0xd2f9('0x4f')]));this['startAcw'](_0x3f55ec[_0xd2f9('0x4f')]);}else if(this[_0xd2f9('0x18')][_0x3f55ec[_0xd2f9('0x50')]]){logger[_0xd2f9('0x24')](_0xd2f9('0x51'),JSON[_0xd2f9('0x3c')](_0x3f55ec['transfererlinkedid']));this[_0xd2f9('0x17')](_0x3f55ec['transfererlinkedid']);}}catch(_0x368975){logger[_0xd2f9('0x34')](_0xd2f9('0x52'),_0x368975[_0xd2f9('0x37')]);}};Acw[_0xd2f9('0x16')][_0xd2f9('0xf')]=function(_0x5dbaca){try{if(this[_0xd2f9('0x6')][_0x5dbaca[_0xd2f9('0x1a')]]&&this[_0xd2f9('0x6')][_0x5dbaca['queue']][_0xd2f9('0x53')]===_0xd2f9('0x54')){if(this[_0xd2f9('0x7')][_0x5dbaca[_0xd2f9('0x19')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5dbaca[_0xd2f9('0x2e')],_0x5dbaca['interface'],_0x5dbaca[_0xd2f9('0x1a')]);return RpcUser['savePause'](this[_0xd2f9('0x7')][_0x5dbaca[_0xd2f9('0x19')]],_0xd2f9('0x55'),_0x5dbaca[_0xd2f9('0x2e')]);}}}catch(_0x265f85){logger[_0xd2f9('0x34')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x265f85[_0xd2f9('0x37')]);}};module[_0xd2f9('0x56')]=Acw;
\ No newline at end of file
+var _0x4377=['seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','agents','voicePause','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','uniqueid','queue','updateAcw','update','info','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','attended','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','attendedtransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff'];(function(_0x3eeda3,_0x44105c){var _0x3131d4=function(_0x32460e){while(--_0x32460e){_0x3eeda3['push'](_0x3eeda3['shift']());}};_0x3131d4(++_0x44105c);}(_0x4377,0x1e0));var _0x7437=function(_0x4279dd,_0x47382b){_0x4279dd=_0x4279dd-0x0;var _0x584787=_0x4377[_0x4279dd];return _0x584787;};'use strict';var util=require(_0x7437('0x0'));var _=require(_0x7437('0x1'));var moment=require(_0x7437('0x2'));var ami=require(_0x7437('0x3'));var logger=require(_0x7437('0x4'))(_0x7437('0x5'));var RpcUser=require(_0x7437('0x6'));var RpcVoiceAgentReport=require(_0x7437('0x7'));function Acw(_0x1b2ed6){this[_0x7437('0x8')]=_0x1b2ed6[_0x7437('0x8')];this['agents']=_0x1b2ed6['agents'];this[_0x7437('0x9')]=_0x1b2ed6[_0x7437('0x9')];this[_0x7437('0xa')]={};ami['on'](_0x7437('0xb'),this[_0x7437('0xc')][_0x7437('0xd')](this));ami['on'](_0x7437('0xe'),this[_0x7437('0xf')][_0x7437('0xd')](this));ami['on']('hangup',this[_0x7437('0x10')][_0x7437('0xd')](this));ami['on'](_0x7437('0x11'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x7437('0x12'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x7437('0x13'),this['syncBlindTransfer'][_0x7437('0xd')](this));ami['on'](_0x7437('0x14'),this[_0x7437('0x15')][_0x7437('0xd')](this));}function getDiff(_0x4c09bb){var _0x2fa4ef=moment()['milliseconds'](0x0);var _0x12609a=moment(_0x4c09bb)[_0x7437('0x16')](0x0);return _0x2fa4ef[_0x7437('0x17')](_0x12609a,_0x7437('0x18'));}Acw[_0x7437('0x19')][_0x7437('0x1a')]=function(_0x639d03){try{var _0x150447=this;var _0x19480c=this[_0x7437('0xa')][_0x639d03][_0x7437('0x1b')];var _0x429768=this[_0x7437('0xa')][_0x639d03]['queue'];var _0x43ae91=this['voiceQueues'][_0x429768];var _0x59055b=![];var _0x5902e7=_0x7437('0x1c');if(_0x43ae91[_0x7437('0x1d')]){if(_0x43ae91[_0x7437('0x1e')]['name']){_0x59055b=!![];_0x5902e7=_0x43ae91[_0x7437('0x1e')][_0x7437('0x1f')];}}ami[_0x7437('0x20')]({'action':'QueuePause','interface':_0x19480c,'paused':!![],'reason':_0x5902e7})[_0x7437('0x21')](function(_0x1f5f7a){if(_0x150447[_0x7437('0x22')][_0x19480c]){return RpcUser['getAgent'](_0x150447['agents'][_0x19480c]['id'])['then'](function(_0x2331a6){if(_0x2331a6&&!_0x2331a6[_0x7437('0x23')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x639d03,_0x19480c,_0x429768);var _0x1f8388=_0x150447[_0x7437('0xa')][_0x639d03]['attended']&&_0x150447[_0x7437('0xa')][_0x639d03][_0x7437('0x24')]?_0x150447[_0x7437('0xa')][_0x639d03][_0x7437('0x24')]:_0x639d03;return RpcUser['savePause'](_0x150447['agents'][_0x19480c],_0x5902e7,_0x1f8388)[_0x7437('0x21')](function(_0x3f00e5){if(!_0x59055b){_0x150447[_0x7437('0x9')][_0x19480c]={};logger['info'](_0x7437('0x25'),_0x639d03,_0x150447[_0x7437('0x8')][_0x429768][_0x7437('0x26')],_0x19480c,_0x429768);_0x150447[_0x7437('0x9')][_0x19480c][_0x7437('0x27')]=setTimeout(_0x150447[_0x7437('0x28')]['bind'](_0x150447,_0x19480c),_0x150447[_0x7437('0x8')][_0x429768][_0x7437('0x26')]*0x3e8);_0x150447['timers'][_0x19480c][_0x7437('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x150447['timers'][_0x19480c][_0x7437('0x2a')]=_0x639d03;_0x150447[_0x7437('0x9')][_0x19480c][_0x7437('0x2b')]=_0x429768;_0x150447['timers'][_0x19480c][_0x7437('0x2c')]=function(){var _0xd025=getDiff(_0x150447[_0x7437('0x9')][_0x19480c]['lastPauseAt']);clearTimeout(_0x150447[_0x7437('0x9')][_0x19480c][_0x7437('0x27')]);_0x150447[_0x7437('0x9')][_0x19480c][_0x7437('0x27')]=![];RpcVoiceAgentReport[_0x7437('0x2d')]({'acwtime':_0xd025},_0x150447[_0x7437('0x9')][_0x19480c][_0x7437('0x2a')],_0x19480c)[_0x7437('0x21')](function(_0x59ba8a){logger[_0x7437('0x2e')](_0x7437('0x2f'),_0x639d03,_0xd025,_0x59ba8a);})[_0x7437('0x30')](function(_0x2ab6e0){logger['error'](_0x7437('0x31'),_0x639d03,_0x2ab6e0);});delete _0x150447[_0x7437('0x9')][_0x19480c];};}});}else{logger[_0x7437('0x2e')](_0x7437('0x32'),_0x639d03,_0x19480c,_0x429768);}});}})[_0x7437('0x30')](function(_0x19044d){logger[_0x7437('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x639d03,_0x150447[_0x7437('0x8')][_0x429768][_0x7437('0x26')],_0x19480c,_0x429768);})[_0x7437('0x34')](function(){delete _0x150447[_0x7437('0xa')][_0x639d03];});}catch(_0x2c459a){logger[_0x7437('0x33')](_0x7437('0x35'),_0x2c459a[_0x7437('0x36')]);}};Acw['prototype'][_0x7437('0x28')]=function(_0x41ee17){try{var _0x4cf3c6=this;if(_0x4cf3c6['timers'][_0x41ee17]){_0x4cf3c6[_0x7437('0x9')][_0x41ee17][_0x7437('0x27')]=![];var _0x5cec9c=_0x4cf3c6[_0x7437('0x9')][_0x41ee17][_0x7437('0x2a')];var _0x2af01b=_0x4cf3c6['timers'][_0x41ee17][_0x7437('0x2b')];var _0x332379=_0x4cf3c6[_0x7437('0x8')][_0x2af01b]['acwTimeout'];logger[_0x7437('0x2e')]('[%s][TIMER][STOP][AGENT:%s]',_0x5cec9c,_0x41ee17);RpcUser['saveUnpause'](this['agents'][_0x41ee17]);RpcVoiceAgentReport['update']({'acwtime':_0x332379,'agentacw':!![]},_0x5cec9c,_0x41ee17)['then'](function(_0xf4c1cb){logger[_0x7437('0x2e')](_0x7437('0x2f'),_0x5cec9c,_0x332379,_0xf4c1cb);})['catch'](function(_0x1d7524){logger[_0x7437('0x33')](_0x7437('0x31'),_0x5cec9c,_0x1d7524);});}else{logger[_0x7437('0x33')](_0x7437('0x37'),_0x41ee17);if(_0x4cf3c6[_0x7437('0x9')]){logger[_0x7437('0x2e')](_0x7437('0x38'),JSON[_0x7437('0x39')](_0x4cf3c6[_0x7437('0x9')]));}}}catch(_0x19a6bb){logger[_0x7437('0x33')]('[ACW][STOP]\x20%s',_0x19a6bb[_0x7437('0x36')]);}};Acw[_0x7437('0x19')]['syncAgentConnect']=function(_0x22116d){try{if(this[_0x7437('0x8')][_0x22116d[_0x7437('0x2b')]]&&(this[_0x7437('0x8')][_0x22116d['queue']]['acw']||this[_0x7437('0x8')][_0x22116d[_0x7437('0x2b')]][_0x7437('0x1d')])){if(this['agents'][_0x22116d[_0x7437('0x1b')]]){this[_0x7437('0xa')][_0x22116d[_0x7437('0x2a')]]={'queue':_0x22116d[_0x7437('0x2b')],'interface':_0x22116d[_0x7437('0x1b')],'destlinkedid':_0x22116d['destlinkedid']};}}}catch(_0x3862c4){logger['error'](_0x7437('0x3a'),_0x3862c4[_0x7437('0x36')]);}};Acw[_0x7437('0x19')][_0x7437('0x15')]=function(_0x3942c0){try{if(this[_0x7437('0x8')][_0x3942c0[_0x7437('0x2b')]]&&(this[_0x7437('0x8')][_0x3942c0[_0x7437('0x2b')]][_0x7437('0x5')]||this[_0x7437('0x8')][_0x3942c0[_0x7437('0x2b')]][_0x7437('0x1d')])){if(this[_0x7437('0x22')][_0x3942c0['interface']]){this['channels'][_0x3942c0[_0x7437('0x2a')]]={'queue':_0x3942c0[_0x7437('0x2b')],'interface':_0x3942c0[_0x7437('0x1b')]};}}}catch(_0x337173){logger[_0x7437('0x33')](_0x7437('0x3b'),_0x337173[_0x7437('0x36')]);}};Acw[_0x7437('0x19')]['syncHangupRequest']=function(_0x3bb0f1){try{if(this[_0x7437('0xa')][_0x3bb0f1[_0x7437('0x2a')]]&&_['isUndefined'](this['channels'][_0x3bb0f1[_0x7437('0x2a')]][_0x7437('0x3c')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x3bb0f1[_0x7437('0x2a')]);this[_0x7437('0x1a')](_0x3bb0f1[_0x7437('0x2a')]);}else if(this[_0x7437('0xa')][_0x3bb0f1[_0x7437('0x3d')]]&&_['isUndefined'](this[_0x7437('0xa')][_0x3bb0f1['linkedid']][_0x7437('0x3c')])){logger[_0x7437('0x2e')](_0x7437('0x3e'),_0x3bb0f1[_0x7437('0x3d')]);this[_0x7437('0x1a')](_0x3bb0f1[_0x7437('0x3d')]);}}catch(_0x2a839f){logger[_0x7437('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x2a839f[_0x7437('0x36')]);}};Acw[_0x7437('0x19')][_0x7437('0x10')]=function(_0x2049e5){try{if(this[_0x7437('0xa')][_0x2049e5['uniqueid']]&&this['channels'][_0x2049e5[_0x7437('0x2a')]][_0x7437('0x3c')]){logger[_0x7437('0x2e')](_0x7437('0x3f'),_0x2049e5[_0x7437('0x2a')]);this['startAcw'](_0x2049e5[_0x7437('0x2a')]);}else if(this[_0x7437('0xa')][_0x2049e5[_0x7437('0x3d')]]&&this['channels'][_0x2049e5[_0x7437('0x3d')]]['attended']){logger['info'](_0x7437('0x40'),_0x2049e5['linkedid']);this[_0x7437('0x1a')](_0x2049e5['linkedid']);}}catch(_0x26254b){logger['error'](_0x7437('0x41'),_0x26254b[_0x7437('0x36')]);}};Acw[_0x7437('0x19')][_0x7437('0x42')]=function(_0x26f373){try{if(!_[_0x7437('0x43')](this['channels'][_0x26f373[_0x7437('0x44')]])){this[_0x7437('0x1a')](_0x26f373['transfereeuniqueid']);if(this[_0x7437('0xa')][_0x26f373[_0x7437('0x45')]]){this['channels'][_0x26f373[_0x7437('0x45')]]['attended']=!![];this[_0x7437('0xa')][_0x26f373[_0x7437('0x46')]]=this[_0x7437('0xa')][_0x26f373[_0x7437('0x45')]];delete this[_0x7437('0xa')][_0x26f373['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0x7437('0xa')][_0x26f373['transfertargetuniqueid']])){this[_0x7437('0x1a')](_0x26f373[_0x7437('0x46')]);if(this[_0x7437('0xa')][_0x26f373[_0x7437('0x47')]]){this[_0x7437('0xa')][_0x26f373[_0x7437('0x47')]][_0x7437('0x3c')]=!![];this[_0x7437('0xa')][_0x26f373[_0x7437('0x44')]]=this['channels'][_0x26f373[_0x7437('0x47')]];delete this[_0x7437('0xa')][_0x26f373[_0x7437('0x47')]];}}}catch(_0x453fb6){logger['error'](_0x7437('0x48'),_0x453fb6[_0x7437('0x36')]);}};Acw[_0x7437('0x19')][_0x7437('0x49')]=function(_0x4686ef){try{if(this[_0x7437('0xa')][_0x4686ef[_0x7437('0x4a')]]){logger[_0x7437('0x2e')](_0x7437('0x4b'),JSON[_0x7437('0x39')](_0x4686ef['transfereruniqueid']));this[_0x7437('0x1a')](_0x4686ef[_0x7437('0x4a')]);}else if(this[_0x7437('0xa')][_0x4686ef[_0x7437('0x4c')]]){logger[_0x7437('0x2e')](_0x7437('0x4d'),JSON['stringify'](_0x4686ef[_0x7437('0x4c')]));this[_0x7437('0x1a')](_0x4686ef['transfererlinkedid']);}}catch(_0x57de41){logger[_0x7437('0x33')]('[ACW][syncBlindTransfer]\x20%s',_0x57de41['message']);}};Acw[_0x7437('0x19')]['syncAgentRingNoAnswer']=function(_0x5dbb67){try{if(this[_0x7437('0x8')][_0x5dbb67['queue']]&&this[_0x7437('0x8')][_0x5dbb67[_0x7437('0x2b')]][_0x7437('0x4e')]==='all'){if(this[_0x7437('0x22')][_0x5dbb67['interface']]){logger[_0x7437('0x2e')](_0x7437('0x4f'),_0x5dbb67[_0x7437('0x2a')],_0x5dbb67['interface'],_0x5dbb67['queue']);return RpcUser[_0x7437('0x50')](this[_0x7437('0x22')][_0x5dbb67[_0x7437('0x1b')]],_0x7437('0x51'),_0x5dbb67[_0x7437('0x2a')]);}}}catch(_0x820638){logger['error'](_0x7437('0x52'),_0x820638[_0x7437('0x36')]);}};module[_0x7437('0x53')]=Acw;
\ No newline at end of file
index 0ac5d18..e195abb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc89f=['inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','log','asterisk-manager','moment','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','format','once','close','connect'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xc89f,0x89));var _0xfc89=function(_0x18d3d2,_0x48809e){_0x18d3d2=_0x18d3d2-0x0;var _0x582ee2=_0xc89f[_0x18d3d2];return _0x582ee2;};'use strict';var Manager=require(_0xfc89('0x0'));var BPromise=require('bluebird');var moment=require(_0xfc89('0x1'));var util=require(_0xfc89('0x2'));var _=require('lodash');var logger=require(_0xfc89('0x3'))(_0xfc89('0x4'));var config=require(_0xfc89('0x5'));var ami=new Manager(config[_0xfc89('0x6')][_0xfc89('0x7')],config[_0xfc89('0x6')]['ip'],config[_0xfc89('0x6')][_0xfc89('0x8')],config[_0xfc89('0x6')][_0xfc89('0x9')],!![]);ami[_0xfc89('0xa')]();ami[_0xfc89('0xb')]=BPromise['promisify'](ami['action']);function error(_0x28d42f){logger[_0xfc89('0xc')](util['format'](_0xfc89('0xd'),config[_0xfc89('0x6')][_0xfc89('0x8')],config[_0xfc89('0x6')]['ip'],config['asterisk'][_0xfc89('0x7')],util['inspect'](_0x28d42f,![],null)));}function close(){logger[_0xfc89('0xc')](util['format'](_0xfc89('0xe'),config['asterisk'][_0xfc89('0x8')],config[_0xfc89('0x6')]['ip'],config[_0xfc89('0x6')][_0xfc89('0x7')]));}ami[_0xfc89('0xf')]=function(){return function(){return ami[_0xfc89('0xb')]({'action':_0xfc89('0x10')});};};ami[_0xfc89('0x11')]=function(){return function(){return ami[_0xfc89('0xb')]({'action':_0xfc89('0x12')});};};ami[_0xfc89('0x13')]=function(){return function(){return ami[_0xfc89('0xb')]({'action':'sippeerstatus'});};};ami[_0xfc89('0x14')]=function(){return function(){return ami[_0xfc89('0xb')]({'action':'queuesummary'});};};ami[_0xfc89('0x15')]=function(){return function(){return ami['Action']({'action':_0xfc89('0x16')});};};function connect(_0x1a9349){logger[_0xfc89('0x17')](util[_0xfc89('0x18')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xfc89('0x6')]['username'],config['asterisk']['ip'],config[_0xfc89('0x6')][_0xfc89('0x7')]));ami['once'](_0xfc89('0xc'),error);ami[_0xfc89('0x19')](_0xfc89('0x1a'),close);}ami['on'](_0xfc89('0x1b'),connect);ami['on']('shutdown',function(_0xb4749d){logger['info'](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xfc89('0x8')],config[_0xfc89('0x6')]['ip'],config[_0xfc89('0x6')]['port'],util[_0xfc89('0x1c')](_0xb4749d,![],null)));});ami['on'](_0xfc89('0x1d'),function(_0x1f7bfa){logger[_0xfc89('0x17')](util[_0xfc89('0x18')](_0xfc89('0x1e'),config[_0xfc89('0x6')]['username'],config[_0xfc89('0x6')]['ip'],config['asterisk'][_0xfc89('0x7')]));return BPromise['resolve']()[_0xfc89('0x1f')](ami[_0xfc89('0xf')]())[_0xfc89('0x1f')](ami[_0xfc89('0x11')]())[_0xfc89('0x1f')](ami[_0xfc89('0x13')]())[_0xfc89('0x1f')](ami[_0xfc89('0x14')]())[_0xfc89('0x1f')](ami[_0xfc89('0x15')]())['catch'](function(_0x387f4a){console[_0xfc89('0x20')](_0x387f4a);});});ami[_0xfc89('0x19')]('error',error);ami[_0xfc89('0x19')](_0xfc89('0x1a'),close);module['exports']=ami;
\ No newline at end of file
+var _0x8eaa=['moment','lodash','../../config/logger','ami','asterisk','username','keepConnected','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','log','exports','asterisk-manager','bluebird'];(function(_0x5b5554,_0x1cfd35){var _0x3f1b4d=function(_0x3eb682){while(--_0x3eb682){_0x5b5554['push'](_0x5b5554['shift']());}};_0x3f1b4d(++_0x1cfd35);}(_0x8eaa,0x154));var _0xa8ea=function(_0x56ab48,_0xfab19f){_0x56ab48=_0x56ab48-0x0;var _0x5bf5d1=_0x8eaa[_0x56ab48];return _0x5bf5d1;};'use strict';var Manager=require(_0xa8ea('0x0'));var BPromise=require(_0xa8ea('0x1'));var moment=require(_0xa8ea('0x2'));var util=require('util');var _=require(_0xa8ea('0x3'));var logger=require(_0xa8ea('0x4'))(_0xa8ea('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0xa8ea('0x6')]['port'],config[_0xa8ea('0x6')]['ip'],config['asterisk'][_0xa8ea('0x7')],config[_0xa8ea('0x6')]['password'],!![]);ami[_0xa8ea('0x8')]();ami['Action']=BPromise['promisify'](ami[_0xa8ea('0x9')]);function error(_0x5e3a72){logger[_0xa8ea('0xa')](util[_0xa8ea('0xb')](_0xa8ea('0xc'),config[_0xa8ea('0x6')][_0xa8ea('0x7')],config[_0xa8ea('0x6')]['ip'],config['asterisk'][_0xa8ea('0xd')],util[_0xa8ea('0xe')](_0x5e3a72,![],null)));}function close(){logger[_0xa8ea('0xa')](util[_0xa8ea('0xb')](_0xa8ea('0xf'),config[_0xa8ea('0x6')]['username'],config[_0xa8ea('0x6')]['ip'],config[_0xa8ea('0x6')]['port']));}ami[_0xa8ea('0x10')]=function(){return function(){return ami[_0xa8ea('0x11')]({'action':_0xa8ea('0x12')});};};ami[_0xa8ea('0x13')]=function(){return function(){return ami[_0xa8ea('0x11')]({'action':_0xa8ea('0x14')});};};ami[_0xa8ea('0x15')]=function(){return function(){return ami[_0xa8ea('0x11')]({'action':_0xa8ea('0x16')});};};ami[_0xa8ea('0x17')]=function(){return function(){return ami[_0xa8ea('0x11')]({'action':_0xa8ea('0x18')});};};ami[_0xa8ea('0x19')]=function(){return function(){return ami[_0xa8ea('0x11')]({'action':'coreshowchannels'});};};function connect(_0x3683df){logger[_0xa8ea('0x1a')](util['format'](_0xa8ea('0x1b'),config[_0xa8ea('0x6')][_0xa8ea('0x7')],config[_0xa8ea('0x6')]['ip'],config['asterisk']['port']));ami[_0xa8ea('0x1c')](_0xa8ea('0xa'),error);ami[_0xa8ea('0x1c')](_0xa8ea('0x1d'),close);}ami['on'](_0xa8ea('0x1e'),connect);ami['on'](_0xa8ea('0x1f'),function(_0x1578aa){logger[_0xa8ea('0x1a')](util[_0xa8ea('0xb')](_0xa8ea('0x20'),config['asterisk']['username'],config[_0xa8ea('0x6')]['ip'],config['asterisk'][_0xa8ea('0xd')],util[_0xa8ea('0xe')](_0x1578aa,![],null)));});ami['on']('fullybooted',function(_0x20054a){logger[_0xa8ea('0x1a')](util[_0xa8ea('0xb')](_0xa8ea('0x21'),config['asterisk'][_0xa8ea('0x7')],config['asterisk']['ip'],config['asterisk'][_0xa8ea('0xd')]));return BPromise[_0xa8ea('0x22')]()[_0xa8ea('0x23')](ami['actionSipShowRegistry']())[_0xa8ea('0x23')](ami[_0xa8ea('0x13')]())[_0xa8ea('0x23')](ami[_0xa8ea('0x15')]())[_0xa8ea('0x23')](ami[_0xa8ea('0x17')]())[_0xa8ea('0x23')](ami['actionCoreShowChannels']())['catch'](function(_0x2e5d13){console[_0xa8ea('0x24')](_0x2e5d13);});});ami[_0xa8ea('0x1c')](_0xa8ea('0xa'),error);ami['once'](_0xa8ea('0x1d'),close);module[_0xa8ea('0x25')]=ami;
\ No newline at end of file
index f7543ae..6f67487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xda3f,0xec));var _0xfda3=function(_0x4dcd53,_0x4af9c3){_0x4dcd53=_0x4dcd53-0x0;var _0x4d6b5b=_0xda3f[_0x4dcd53];return _0x4d6b5b;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client;
\ No newline at end of file
+var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x590610,_0x7ad28e){var _0x51a526=function(_0x4edbe3){while(--_0x4edbe3){_0x590610['push'](_0x590610['shift']());}};_0x51a526(++_0x7ad28e);}(_0xaa88,0x137));var _0x8aa8=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0xaa88[_0x349a9e];return _0x24c207;};'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 40c3a09..cc28cf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7692=['CampaignId','idHopper','ContactFirstName','starttime','format','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','queue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x7692,0x12c));var _0x2769=function(_0x3e18bf,_0x387f5e){_0x3e18bf=_0x3e18bf-0x0;var _0x1022e5=_0x7692[_0x3e18bf];return _0x1022e5;};'use strict';var util=require(_0x2769('0x0'));var _=require(_0x2769('0x1'));var moment=require(_0x2769('0x2'));function checkNameSurname(_0x5100d3,_0x21b26d,_0x7a84c6){var _0x5b6b8c='';if(!_[_0x2769('0x3')](_0x21b26d)&&_0x2769('0x4')===typeof _0x21b26d){_0x5b6b8c+=_0x21b26d;}if(!_[_0x2769('0x3')](_0x7a84c6)&&'string'===typeof _0x7a84c6){_0x5b6b8c+='\x20'+_0x7a84c6;}if(_0x5b6b8c!==''){return _0x5b6b8c;}return _0x5100d3;}function Action(_0xfc173e,_0x349042,_0x164d86){this[_0x2769('0x5')]=_0xfc173e;this[_0x2769('0x6')]=_0x164d86||undefined;this[_0x2769('0x7')]=checkNameSurname(_0x349042[_0x2769('0x8')][_0x2769('0x9')],_0x349042[_0x2769('0x8')][_0x2769('0xa')],_0x349042['Contact'][_0x2769('0xb')]);this[_0x2769('0xc')]=_0x349042[_0x2769('0x9')];this['queue']=_0xfc173e['name'];this[_0x2769('0xd')]=_0x349042[_0x2769('0xd')]||![];this[_0x2769('0xe')]=_0xfc173e['type'];this[_0x2769('0xf')]=_0xfc173e[_0x2769('0xf')]||0x3;this[_0x2769('0x10')]=_0x349042[_0x2769('0x10')];this['countbusyretry']=_0x349042[_0x2769('0x11')];this[_0x2769('0x12')]=_0x349042[_0x2769('0x12')];this[_0x2769('0x13')]=_0x349042['countnoanswerretry'];this[_0x2769('0x14')]=_0x349042[_0x2769('0x14')];this['countdropretry']=_0x349042[_0x2769('0x15')];this[_0x2769('0x16')]=_0x349042[_0x2769('0x16')];this[_0x2769('0x17')]=_0x349042['countmachineretry'];this['countagentrejectretry']=_0x349042[_0x2769('0x18')];this[_0x2769('0x19')]=_0x349042[_0x2769('0x19')];this[_0x2769('0x1a')]=_0x349042[_0x2769('0x1a')];this[_0x2769('0x1b')]=_0x349042[_0x2769('0x1b')];this[_0x2769('0x1c')]=_0x349042[_0x2769('0x1c')];this['CampaignId']=_0x349042[_0x2769('0x1d')];this[_0x2769('0x1e')]=_0x349042['id'];this[_0x2769('0x1f')]=_0x349042['Contact'][_0x2769('0xa')]||'';this[_0x2769('0x20')]=moment()[_0x2769('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x349042['callback'];this[_0x2769('0x22')]=_0x349042[_0x2769('0x22')];this[_0x2769('0x23')]=_0x349042[_0x2769('0x23')];this[_0x2769('0x24')]=_0x349042[_0x2769('0x24')];this[_0x2769('0x25')]='';this[_0x2769('0x26')]='';}Action[_0x2769('0x27')][_0x2769('0x28')]=function(){return util['format'](_0x2769('0x29'),this[_0x2769('0x7')],this[_0x2769('0x5')][_0x2769('0x2a')]>0x0?this['number'][_0x2769('0x2b')](this['voiceQueue'][_0x2769('0x2a')]):this[_0x2769('0xc')]);};Action[_0x2769('0x27')][_0x2769('0x2c')]=function(){return this[_0x2769('0x2d')];};module[_0x2769('0x2e')]=Action;
\ No newline at end of file
+var _0xd065=['callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','voiceQueue','dialCutDigit','number','util','lodash','string','isNil','uniqueid','firstName','Contact','lastName','phone','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xd065,0x85));var _0x5d06=function(_0x1c9898,_0x25b040){_0x1c9898=_0x1c9898-0x0;var _0x4ece89=_0xd065[_0x1c9898];return _0x4ece89;};'use strict';var util=require(_0x5d06('0x0'));var _=require(_0x5d06('0x1'));var moment=require('moment');function checkNameSurname(_0x495833,_0x169ac3,_0x24f468){var _0x36ad1a='';if(!_['isNil'](_0x169ac3)&&_0x5d06('0x2')===typeof _0x169ac3){_0x36ad1a+=_0x169ac3;}if(!_[_0x5d06('0x3')](_0x24f468)&&'string'===typeof _0x24f468){_0x36ad1a+='\x20'+_0x24f468;}if(_0x36ad1a!==''){return _0x36ad1a;}return _0x495833;}function Action(_0x28fdb8,_0x20a274,_0x3f5656){this['voiceQueue']=_0x28fdb8;this[_0x5d06('0x4')]=_0x3f5656||undefined;this['name']=checkNameSurname(_0x20a274['Contact']['phone'],_0x20a274['Contact'][_0x5d06('0x5')],_0x20a274[_0x5d06('0x6')][_0x5d06('0x7')]);this['number']=_0x20a274[_0x5d06('0x8')];this['queue']=_0x28fdb8[_0x5d06('0x9')];this[_0x5d06('0xa')]=_0x20a274[_0x5d06('0xa')]||![];this['type']=_0x28fdb8[_0x5d06('0xb')];this[_0x5d06('0xc')]=_0x28fdb8[_0x5d06('0xc')]||0x3;this['scheduledat']=_0x20a274[_0x5d06('0xd')];this[_0x5d06('0xe')]=_0x20a274[_0x5d06('0xe')];this[_0x5d06('0xf')]=_0x20a274[_0x5d06('0xf')];this[_0x5d06('0x10')]=_0x20a274['countnoanswerretry'];this[_0x5d06('0x11')]=_0x20a274[_0x5d06('0x11')];this[_0x5d06('0x12')]=_0x20a274[_0x5d06('0x12')];this[_0x5d06('0x13')]=_0x20a274[_0x5d06('0x13')];this['countmachineretry']=_0x20a274[_0x5d06('0x14')];this[_0x5d06('0x15')]=_0x20a274['countagentrejectretry'];this['ContactId']=_0x20a274[_0x5d06('0x16')];this['ListId']=_0x20a274[_0x5d06('0x17')];this[_0x5d06('0x18')]=_0x20a274['UserId'];this['VoiceQueueId']=_0x20a274[_0x5d06('0x19')];this[_0x5d06('0x1a')]=_0x20a274[_0x5d06('0x1a')];this[_0x5d06('0x1b')]=_0x20a274['id'];this[_0x5d06('0x1c')]=_0x20a274['Contact'][_0x5d06('0x5')]||'';this['starttime']=moment()[_0x5d06('0x1d')](_0x5d06('0x1e'));this['callback']=_0x20a274[_0x5d06('0x1f')];this[_0x5d06('0x20')]=_0x20a274[_0x5d06('0x20')];this[_0x5d06('0x21')]=_0x20a274[_0x5d06('0x21')];this['recallme']=_0x20a274['recallme'];this[_0x5d06('0x22')]='';this[_0x5d06('0x23')]='';}Action[_0x5d06('0x24')][_0x5d06('0x25')]=function(){return util[_0x5d06('0x1d')]('\x22%s\x22\x20<%s>',this[_0x5d06('0x9')],this[_0x5d06('0x26')][_0x5d06('0x27')]>0x0?this[_0x5d06('0x28')]['substring'](this['voiceQueue']['dialCutDigit']):this[_0x5d06('0x28')]);};Action[_0x5d06('0x24')]['getQueue']=function(){return this['queue'];};module['exports']=Action;
\ No newline at end of file
index 96a52c1..a9c2ab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a79=['countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x54e85e,_0x31b849){var _0x292a91=function(_0x2c80ec){while(--_0x2c80ec){_0x54e85e['push'](_0x54e85e['shift']());}};_0x292a91(++_0x31b849);}(_0x9a79,0x67));var _0x99a7=function(_0x57fbc8,_0x5f1746){_0x57fbc8=_0x57fbc8-0x0;var _0xfcf1de=_0x9a79[_0x57fbc8];return _0xfcf1de;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x99a7('0x0'));function getSeconds(_0x1089f2,_0x422f88){var _0x288180=moment(_0x1089f2)['milliseconds'](0x0);var _0x40d732=moment(_0x422f88)[_0x99a7('0x1')](0x0);return _0x288180[_0x99a7('0x2')](_0x40d732,_0x99a7('0x3'));}function AdditionalPhone(_0x369f91){this['uniqueid']=_0x369f91[_0x99a7('0x4')];this[_0x99a7('0x5')]=_0x369f91[_0x99a7('0x5')]||undefined;this['type']=_0x369f91[_0x99a7('0x6')];this['campaigntype']=_0x369f91[_0x99a7('0x6')]===_0x99a7('0x7')?'queue':_0x369f91[_0x99a7('0x6')];this['countbusyretry']=_0x369f91['countbusyretry'];this[_0x99a7('0x8')]=_0x369f91['countcongestionretry'];this[_0x99a7('0x9')]=_0x369f91['countnoanswerretry'];this[_0x99a7('0xa')]=_0x369f91[_0x99a7('0xb')]+_0x369f91['countcongestionretry']+_0x369f91[_0x99a7('0x9')]+_0x369f91[_0x99a7('0xc')]+_0x369f91[_0x99a7('0xd')]+_0x369f91[_0x99a7('0xe')]+_0x369f91['countmachineretry']+_0x369f91['countagentrejectretry'];this[_0x99a7('0xc')]=_0x369f91[_0x99a7('0xc')];this[_0x99a7('0xd')]=_0x369f91[_0x99a7('0xd')];this[_0x99a7('0xe')]=_0x369f91['countabandonedretry'];this['countmachineretry']=_0x369f91[_0x99a7('0xf')];this[_0x99a7('0x10')]=_0x369f91['countagentrejectretry'];this[_0x99a7('0x11')]=_0x369f91[_0x99a7('0x11')];this['calleridname']=_0x369f91[_0x99a7('0x12')];this[_0x99a7('0x13')]=_0x369f91[_0x99a7('0x14')];this[_0x99a7('0x15')]=_0x369f91['starttime'];this[_0x99a7('0x16')]=_0x369f91[_0x99a7('0x16')];this[_0x99a7('0x17')]=_0x369f91[_0x99a7('0x16')];this[_0x99a7('0x18')]=getSeconds(_0x369f91[_0x99a7('0x16')],_0x369f91[_0x99a7('0x15')]);this[_0x99a7('0x19')]=0x0;this[_0x99a7('0x1a')]=0x0;this['callback']=_0x369f91[_0x99a7('0x1b')];this['callbackuniqueid']=_0x369f91[_0x99a7('0x1c')];this['callbackat']=_0x369f91[_0x99a7('0x1d')];this[_0x99a7('0x1e')]=_0x369f91[_0x99a7('0x1e')];this[_0x99a7('0x1f')]=_0x369f91[_0x99a7('0x1f')];this[_0x99a7('0x20')]=_0x369f91[_0x99a7('0x20')];this['UserId']=_0x369f91[_0x99a7('0x21')];this[_0x99a7('0x22')]=_0x369f91[_0x99a7('0x22')];this[_0x99a7('0x23')]=_0x369f91[_0x99a7('0x23')];this[_0x99a7('0x24')]=_0x369f91[_0x99a7('0x24')]||'';this[_0x99a7('0x25')]=_0x369f91[_0x99a7('0x25')]||'';}module['exports']=History;
\ No newline at end of file
+var _0x54ab=['countnosuchnumberretry','name','number','responsetime','endtime','ringtime','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x2ca4b6,_0xfd3fbf){var _0x196f25=function(_0x26ad33){while(--_0x26ad33){_0x2ca4b6['push'](_0x2ca4b6['shift']());}};_0x196f25(++_0xfd3fbf);}(_0x54ab,0x64));var _0xb54a=function(_0x52aa1d,_0x2c150f){_0x52aa1d=_0x52aa1d-0x0;var _0x8024f8=_0x54ab[_0x52aa1d];return _0x8024f8;};'use strict';var util=require(_0xb54a('0x0'));var _=require(_0xb54a('0x1'));var moment=require(_0xb54a('0x2'));function getSeconds(_0x5cc4d6,_0x505f9b){var _0x2a7aaa=moment(_0x5cc4d6)[_0xb54a('0x3')](0x0);var _0x1fb134=moment(_0x505f9b)[_0xb54a('0x3')](0x0);return _0x2a7aaa[_0xb54a('0x4')](_0x1fb134,_0xb54a('0x5'));}function AdditionalPhone(_0x55e2f3){this[_0xb54a('0x6')]=_0x55e2f3[_0xb54a('0x6')];this[_0xb54a('0x7')]=_0x55e2f3['scheduledat']||undefined;this[_0xb54a('0x8')]=_0x55e2f3[_0xb54a('0x8')];this[_0xb54a('0x9')]=_0x55e2f3[_0xb54a('0x8')]===_0xb54a('0xa')?_0xb54a('0xb'):_0x55e2f3[_0xb54a('0x8')];this[_0xb54a('0xc')]=_0x55e2f3[_0xb54a('0xc')];this[_0xb54a('0xd')]=_0x55e2f3[_0xb54a('0xd')];this[_0xb54a('0xe')]=_0x55e2f3[_0xb54a('0xe')];this[_0xb54a('0xf')]=_0x55e2f3[_0xb54a('0xc')]+_0x55e2f3[_0xb54a('0xd')]+_0x55e2f3['countnoanswerretry']+_0x55e2f3['countnosuchnumberretry']+_0x55e2f3[_0xb54a('0x10')]+_0x55e2f3[_0xb54a('0x11')]+_0x55e2f3[_0xb54a('0x12')]+_0x55e2f3[_0xb54a('0x13')];this[_0xb54a('0x14')]=_0x55e2f3['countnosuchnumberretry'];this[_0xb54a('0x10')]=_0x55e2f3['countdropretry'];this[_0xb54a('0x11')]=_0x55e2f3[_0xb54a('0x11')];this[_0xb54a('0x12')]=_0x55e2f3[_0xb54a('0x12')];this[_0xb54a('0x13')]=_0x55e2f3[_0xb54a('0x13')];this[_0xb54a('0xb')]=_0x55e2f3['queue'];this['calleridname']=_0x55e2f3[_0xb54a('0x15')];this['calleridnum']=_0x55e2f3[_0xb54a('0x16')];this['starttime']=_0x55e2f3['starttime'];this[_0xb54a('0x17')]=_0x55e2f3['responsetime'];this[_0xb54a('0x18')]=_0x55e2f3['responsetime'];this[_0xb54a('0x19')]=getSeconds(_0x55e2f3[_0xb54a('0x17')],_0x55e2f3[_0xb54a('0x1a')]);this[_0xb54a('0x1b')]=0x0;this[_0xb54a('0x1c')]=0x0;this[_0xb54a('0x1d')]=_0x55e2f3[_0xb54a('0x1d')];this[_0xb54a('0x1e')]=_0x55e2f3['callbackuniqueid'];this[_0xb54a('0x1f')]=_0x55e2f3[_0xb54a('0x1f')];this[_0xb54a('0x20')]=_0x55e2f3[_0xb54a('0x20')];this[_0xb54a('0x21')]=_0x55e2f3[_0xb54a('0x21')];this[_0xb54a('0x22')]=_0x55e2f3['ListId'];this['UserId']=_0x55e2f3['UserId'];this[_0xb54a('0x23')]=_0x55e2f3[_0xb54a('0x23')];this[_0xb54a('0x24')]=_0x55e2f3[_0xb54a('0x24')];this[_0xb54a('0x25')]=_0x55e2f3[_0xb54a('0x25')]||'';this[_0xb54a('0x26')]=_0x55e2f3[_0xb54a('0x26')]||'';}module[_0xb54a('0x27')]=History;
\ No newline at end of file
index 15d7052..f2d86ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaf1=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','uniqueid','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','reason','callback','callbackat','recallme','ContactId'];(function(_0x59eee2,_0x5d4ecc){var _0x2069c7=function(_0x4bd0ce){while(--_0x4bd0ce){_0x59eee2['push'](_0x59eee2['shift']());}};_0x2069c7(++_0x5d4ecc);}(_0xcaf1,0x82));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x1caf('0x0'));var moment=require(_0x1caf('0x1'));function getSeconds(_0x1c27b4,_0x28c032){var _0x2278c7=moment(_0x1c27b4)['milliseconds'](0x0);var _0x56a487=moment(_0x28c032)[_0x1caf('0x2')](0x0);return _0x2278c7[_0x1caf('0x3')](_0x56a487,_0x1caf('0x4'));}function AgentComplete(_0x3f24d1,_0xc3dbee){this[_0x1caf('0x5')]=0x4;this[_0x1caf('0x6')]=_0x1caf('0x7');this[_0x1caf('0x8')]=_0x3f24d1[_0x1caf('0x8')];this[_0x1caf('0x9')]=_0x3f24d1['type'];this[_0x1caf('0xa')]=_0x3f24d1[_0x1caf('0x9')]===_0x1caf('0xb')?'queue':_0x3f24d1[_0x1caf('0x9')];this[_0x1caf('0xc')]=_0x3f24d1[_0x1caf('0xc')];this['countcongestionretry']=_0x3f24d1['countcongestionretry'];this['countnoanswerretry']=_0x3f24d1[_0x1caf('0xd')];this['countglobal']=_0x3f24d1[_0x1caf('0xc')]+_0x3f24d1['countcongestionretry']+_0x3f24d1['countnoanswerretry']+_0x3f24d1[_0x1caf('0xe')]+_0x3f24d1['countdropretry']+_0x3f24d1[_0x1caf('0xf')]+_0x3f24d1['countmachineretry']+_0x3f24d1['countagentrejectretry'];this[_0x1caf('0xe')]=_0x3f24d1[_0x1caf('0xe')];this[_0x1caf('0x10')]=_0x3f24d1[_0x1caf('0x10')];this[_0x1caf('0xf')]=_0x3f24d1[_0x1caf('0xf')];this[_0x1caf('0x11')]=_0x3f24d1[_0x1caf('0x11')];this['countagentrejectretry']=_0x3f24d1['countagentrejectretry'];this[_0x1caf('0x12')]=_0xc3dbee[_0x1caf('0x12')];this['calleridname']=_0x3f24d1['name'];this['calleridnum']=_0x3f24d1[_0x1caf('0x13')];this[_0x1caf('0x14')]=_0x3f24d1[_0x1caf('0x14')];this[_0x1caf('0x15')]=_0x3f24d1[_0x1caf('0x15')];this[_0x1caf('0x16')]=_0x3f24d1[_0x1caf('0x16')];this[_0x1caf('0x17')]=moment()['format'](_0x1caf('0x18'));this[_0x1caf('0x19')]=getSeconds(_0x3f24d1[_0x1caf('0x15')],_0x3f24d1[_0x1caf('0x14')]);this['holdtime']=getSeconds(_0x3f24d1[_0x1caf('0x16')],_0x3f24d1[_0x1caf('0x15')]);this[_0x1caf('0x1a')]=getSeconds(this['endtime'],_0x3f24d1[_0x1caf('0x16')]);this[_0x1caf('0x1b')]=_0xc3dbee['queue'];this[_0x1caf('0x1c')]=_0xc3dbee[_0x1caf('0x1c')];this[_0x1caf('0x1d')]=_0xc3dbee[_0x1caf('0x1d')];this[_0x1caf('0x1e')]=_0x3f24d1[_0x1caf('0x1e')];this['callbackuniqueid']=_0x3f24d1['callbackuniqueid'];this['callbackat']=_0x3f24d1[_0x1caf('0x1f')];this[_0x1caf('0x20')]=_0x3f24d1[_0x1caf('0x20')];this[_0x1caf('0x21')]=_0x3f24d1[_0x1caf('0x21')];this['ListId']=_0x3f24d1[_0x1caf('0x22')];this[_0x1caf('0x23')]=_0x3f24d1['UserId'];this[_0x1caf('0x24')]=_0x3f24d1[_0x1caf('0x24')];this[_0x1caf('0x25')]=_0x3f24d1['CampaignId'];this[_0x1caf('0x26')]=_0x3f24d1[_0x1caf('0x26')]||'';this[_0x1caf('0x27')]=_0x3f24d1['originatecalleridname']||'';}module[_0x1caf('0x28')]=AgentComplete;
\ No newline at end of file
+var _0x976c=['ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4db470,_0x4fb527){var _0x54488a=function(_0x471930){while(--_0x471930){_0x4db470['push'](_0x4db470['shift']());}};_0x54488a(++_0x4fb527);}(_0x976c,0xb8));var _0xc976=function(_0x5aa81b,_0x1f24a0){_0x5aa81b=_0x5aa81b-0x0;var _0x14b066=_0x976c[_0x5aa81b];return _0x14b066;};'use strict';var util=require(_0xc976('0x0'));var _=require(_0xc976('0x1'));var moment=require('moment');function getSeconds(_0x3c3598,_0x4176b2){var _0x8bcd0c=moment(_0x3c3598)[_0xc976('0x2')](0x0);var _0x2a7445=moment(_0x4176b2)[_0xc976('0x2')](0x0);return _0x8bcd0c['diff'](_0x2a7445,_0xc976('0x3'));}function AgentComplete(_0x3c55d6,_0x3a7963){this[_0xc976('0x4')]=0x4;this['statedesc']='Answer';this[_0xc976('0x5')]=_0x3c55d6[_0xc976('0x5')];this[_0xc976('0x6')]=_0x3c55d6[_0xc976('0x6')];this[_0xc976('0x7')]=_0x3c55d6['type']===_0xc976('0x8')?_0xc976('0x9'):_0x3c55d6[_0xc976('0x6')];this[_0xc976('0xa')]=_0x3c55d6[_0xc976('0xa')];this[_0xc976('0xb')]=_0x3c55d6[_0xc976('0xb')];this['countnoanswerretry']=_0x3c55d6['countnoanswerretry'];this[_0xc976('0xc')]=_0x3c55d6[_0xc976('0xa')]+_0x3c55d6[_0xc976('0xb')]+_0x3c55d6['countnoanswerretry']+_0x3c55d6[_0xc976('0xd')]+_0x3c55d6[_0xc976('0xe')]+_0x3c55d6[_0xc976('0xf')]+_0x3c55d6[_0xc976('0x10')]+_0x3c55d6[_0xc976('0x11')];this[_0xc976('0xd')]=_0x3c55d6['countnosuchnumberretry'];this[_0xc976('0xe')]=_0x3c55d6[_0xc976('0xe')];this[_0xc976('0xf')]=_0x3c55d6['countabandonedretry'];this[_0xc976('0x10')]=_0x3c55d6[_0xc976('0x10')];this[_0xc976('0x11')]=_0x3c55d6[_0xc976('0x11')];this['uniqueid']=_0x3a7963['uniqueid'];this[_0xc976('0x12')]=_0x3c55d6['name'];this[_0xc976('0x13')]=_0x3c55d6[_0xc976('0x14')];this[_0xc976('0x15')]=_0x3c55d6['starttime'];this[_0xc976('0x16')]=_0x3c55d6[_0xc976('0x16')];this['answertime']=_0x3c55d6[_0xc976('0x17')];this[_0xc976('0x18')]=moment()['format'](_0xc976('0x19'));this[_0xc976('0x1a')]=getSeconds(_0x3c55d6[_0xc976('0x16')],_0x3c55d6[_0xc976('0x15')]);this[_0xc976('0x1b')]=getSeconds(_0x3c55d6[_0xc976('0x17')],_0x3c55d6['responsetime']);this[_0xc976('0x1c')]=getSeconds(this[_0xc976('0x18')],_0x3c55d6[_0xc976('0x17')]);this[_0xc976('0x9')]=_0x3a7963['queue'];this['membername']=_0x3a7963[_0xc976('0x1d')];this[_0xc976('0x1e')]=_0x3a7963[_0xc976('0x1e')];this[_0xc976('0x1f')]=_0x3c55d6['callback'];this['callbackuniqueid']=_0x3c55d6[_0xc976('0x20')];this[_0xc976('0x21')]=_0x3c55d6[_0xc976('0x21')];this[_0xc976('0x22')]=_0x3c55d6['recallme'];this[_0xc976('0x23')]=_0x3c55d6[_0xc976('0x23')];this[_0xc976('0x24')]=_0x3c55d6[_0xc976('0x24')];this[_0xc976('0x25')]=_0x3c55d6['UserId'];this['VoiceQueueId']=_0x3c55d6['VoiceQueueId'];this[_0xc976('0x26')]=_0x3c55d6[_0xc976('0x26')];this[_0xc976('0x27')]=_0x3c55d6[_0xc976('0x27')]||'';this[_0xc976('0x28')]=_0x3c55d6['originatecalleridname']||'';}module[_0xc976('0x29')]=AgentComplete;
\ No newline at end of file
index 4ffd350..faf67c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime'];(function(_0x27ee1c,_0x5d93b7){var _0x226db3=function(_0x55f2a2){while(--_0x55f2a2){_0x27ee1c['push'](_0x27ee1c['shift']());}};_0x226db3(++_0x5d93b7);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x18d8e9,_0x2d9568){_0x18d8e9=_0x18d8e9-0x0;var _0x1b9102=_0x7fbe[_0x18d8e9];return _0x1b9102;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe7fb('0x0'));function getSeconds(_0x183779,_0x294c21){var _0x1703d5=moment(_0x183779)[_0xe7fb('0x1')](0x0);var _0x47625b=moment(_0x294c21)[_0xe7fb('0x1')](0x0);return _0x1703d5[_0xe7fb('0x2')](_0x47625b,_0xe7fb('0x3'));}function Final(_0x5dbf04){this[_0xe7fb('0x4')]=_0x5dbf04[_0xe7fb('0x4')];this[_0xe7fb('0x5')]=_0x5dbf04[_0xe7fb('0x5')];this['type']=_0x5dbf04[_0xe7fb('0x6')];this[_0xe7fb('0x7')]=_0x5dbf04[_0xe7fb('0x6')]===_0xe7fb('0x8')?'queue':_0x5dbf04['type'];this[_0xe7fb('0x9')]=_0x5dbf04[_0xe7fb('0x9')];this[_0xe7fb('0xa')]=_0x5dbf04[_0xe7fb('0xa')];this[_0xe7fb('0xb')]=_0x5dbf04[_0xe7fb('0xb')];this[_0xe7fb('0xc')]=_0x5dbf04[_0xe7fb('0x9')]+_0x5dbf04[_0xe7fb('0xa')]+_0x5dbf04[_0xe7fb('0xb')]+_0x5dbf04[_0xe7fb('0xd')]+_0x5dbf04[_0xe7fb('0xe')]+_0x5dbf04[_0xe7fb('0xf')]+_0x5dbf04[_0xe7fb('0x10')]+_0x5dbf04[_0xe7fb('0x11')];this['countnosuchnumberretry']=_0x5dbf04[_0xe7fb('0xd')];this[_0xe7fb('0xe')]=_0x5dbf04['countdropretry'];this[_0xe7fb('0xf')]=_0x5dbf04[_0xe7fb('0xf')];this['countmachineretry']=_0x5dbf04[_0xe7fb('0x10')];this['countagentrejectretry']=_0x5dbf04[_0xe7fb('0x11')];this[_0xe7fb('0x12')]=_0x5dbf04[_0xe7fb('0x12')];this[_0xe7fb('0x13')]=_0x5dbf04['calleridname'];this[_0xe7fb('0x14')]=_0x5dbf04['calleridnum'];this[_0xe7fb('0x15')]=_0x5dbf04['starttime'];this[_0xe7fb('0x16')]=_0x5dbf04[_0xe7fb('0x16')];this[_0xe7fb('0x17')]=_0x5dbf04[_0xe7fb('0x16')];this['ringtime']=_0x5dbf04[_0xe7fb('0x18')]||0x0;this['holdtime']=_0x5dbf04[_0xe7fb('0x19')]||0x0;this['talktime']=_0x5dbf04[_0xe7fb('0x1a')]||0x0;this['callback']=_0x5dbf04[_0xe7fb('0x1b')];this[_0xe7fb('0x1c')]=_0x5dbf04['callbackuniqueid'];this[_0xe7fb('0x1d')]=_0x5dbf04[_0xe7fb('0x1d')];this[_0xe7fb('0x1e')]=_0x5dbf04['recallme'];this[_0xe7fb('0x1f')]=_0x5dbf04[_0xe7fb('0x1f')];this['ListId']=_0x5dbf04['ListId'];this['UserId']=_0x5dbf04[_0xe7fb('0x20')];this['VoiceQueueId']=_0x5dbf04['VoiceQueueId'];this[_0xe7fb('0x21')]=_0x5dbf04[_0xe7fb('0x21')];this[_0xe7fb('0x22')]=_0x5dbf04['originatecalleridnum']||'';this[_0xe7fb('0x23')]=_0x5dbf04[_0xe7fb('0x23')]||'';}module[_0xe7fb('0x24')]=Final;
\ No newline at end of file
+var _0x81bd=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x53e787,_0x4298e6){var _0x2781a0=function(_0x21f861){while(--_0x21f861){_0x53e787['push'](_0x53e787['shift']());}};_0x2781a0(++_0x4298e6);}(_0x81bd,0x7c));var _0xd81b=function(_0x3fb5a8,_0x57d3f6){_0x3fb5a8=_0x3fb5a8-0x0;var _0x519841=_0x81bd[_0x3fb5a8];return _0x519841;};'use strict';var util=require(_0xd81b('0x0'));var _=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));function getSeconds(_0x2337b1,_0x2d27cb){var _0x2ec03a=moment(_0x2337b1)[_0xd81b('0x3')](0x0);var _0x54e096=moment(_0x2d27cb)[_0xd81b('0x3')](0x0);return _0x2ec03a[_0xd81b('0x4')](_0x54e096,_0xd81b('0x5'));}function Final(_0x4d8e7e){this[_0xd81b('0x6')]=_0x4d8e7e[_0xd81b('0x6')];this[_0xd81b('0x7')]=_0x4d8e7e['scheduledat'];this['type']=_0x4d8e7e[_0xd81b('0x8')];this['campaigntype']=_0x4d8e7e[_0xd81b('0x8')]===_0xd81b('0x9')?_0xd81b('0xa'):_0x4d8e7e[_0xd81b('0x8')];this[_0xd81b('0xb')]=_0x4d8e7e[_0xd81b('0xb')];this[_0xd81b('0xc')]=_0x4d8e7e[_0xd81b('0xc')];this[_0xd81b('0xd')]=_0x4d8e7e[_0xd81b('0xd')];this[_0xd81b('0xe')]=_0x4d8e7e[_0xd81b('0xb')]+_0x4d8e7e[_0xd81b('0xc')]+_0x4d8e7e['countnoanswerretry']+_0x4d8e7e[_0xd81b('0xf')]+_0x4d8e7e['countdropretry']+_0x4d8e7e[_0xd81b('0x10')]+_0x4d8e7e[_0xd81b('0x11')]+_0x4d8e7e['countagentrejectretry'];this[_0xd81b('0xf')]=_0x4d8e7e['countnosuchnumberretry'];this[_0xd81b('0x12')]=_0x4d8e7e[_0xd81b('0x12')];this[_0xd81b('0x10')]=_0x4d8e7e[_0xd81b('0x10')];this[_0xd81b('0x11')]=_0x4d8e7e['countmachineretry'];this[_0xd81b('0x13')]=_0x4d8e7e[_0xd81b('0x13')];this['queue']=_0x4d8e7e[_0xd81b('0xa')];this[_0xd81b('0x14')]=_0x4d8e7e[_0xd81b('0x14')];this[_0xd81b('0x15')]=_0x4d8e7e[_0xd81b('0x15')];this[_0xd81b('0x16')]=_0x4d8e7e[_0xd81b('0x16')];this[_0xd81b('0x17')]=_0x4d8e7e[_0xd81b('0x17')];this[_0xd81b('0x18')]=_0x4d8e7e[_0xd81b('0x17')];this[_0xd81b('0x19')]=_0x4d8e7e[_0xd81b('0x19')]||0x0;this[_0xd81b('0x1a')]=_0x4d8e7e[_0xd81b('0x1a')]||0x0;this[_0xd81b('0x1b')]=_0x4d8e7e['talktime']||0x0;this['callback']=_0x4d8e7e[_0xd81b('0x1c')];this[_0xd81b('0x1d')]=_0x4d8e7e[_0xd81b('0x1d')];this['callbackat']=_0x4d8e7e[_0xd81b('0x1e')];this[_0xd81b('0x1f')]=_0x4d8e7e['recallme'];this[_0xd81b('0x20')]=_0x4d8e7e[_0xd81b('0x20')];this[_0xd81b('0x21')]=_0x4d8e7e[_0xd81b('0x21')];this[_0xd81b('0x22')]=_0x4d8e7e[_0xd81b('0x22')];this[_0xd81b('0x23')]=_0x4d8e7e[_0xd81b('0x23')];this[_0xd81b('0x24')]=_0x4d8e7e[_0xd81b('0x24')];this[_0xd81b('0x25')]=_0x4d8e7e[_0xd81b('0x25')]||'';this['originatecalleridname']=_0x4d8e7e[_0xd81b('0x26')]||'';}module[_0xd81b('0x27')]=Final;
\ No newline at end of file
index a8470ff..eb4ac40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc99=['number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name'];(function(_0x27dcde,_0x51925a){var _0x2ff975=function(_0x4db2a4){while(--_0x4db2a4){_0x27dcde['push'](_0x27dcde['shift']());}};_0x2ff975(++_0x51925a);}(_0xfc99,0x96));var _0x9fc9=function(_0x25165f,_0x575156){_0x25165f=_0x25165f-0x0;var _0x3c9214=_0xfc99[_0x25165f];return _0x3c9214;};'use strict';var util=require(_0x9fc9('0x0'));var _=require(_0x9fc9('0x1'));var moment=require(_0x9fc9('0x2'));function getSeconds(_0x2c0621,_0x5f131a){var _0x2d5a47=moment(_0x2c0621)[_0x9fc9('0x3')](0x0);var _0x3ba824=moment(_0x5f131a)[_0x9fc9('0x3')](0x0);return _0x2d5a47[_0x9fc9('0x4')](_0x3ba824,'seconds');}function Hangup(_0x4f3d03,_0x5cc88){this[_0x9fc9('0x5')]=0x4;this[_0x9fc9('0x6')]=_0x9fc9('0x7');this[_0x9fc9('0x8')]=_0x4f3d03[_0x9fc9('0x8')];this['type']=_0x4f3d03[_0x9fc9('0x9')];this['campaigntype']=_0x4f3d03[_0x9fc9('0x9')]==='outbound'?'queue':_0x4f3d03[_0x9fc9('0x9')];this['countbusyretry']=_0x4f3d03['countbusyretry'];this[_0x9fc9('0xa')]=_0x4f3d03[_0x9fc9('0xa')];this[_0x9fc9('0xb')]=_0x4f3d03['countnoanswerretry'];this[_0x9fc9('0xc')]=_0x4f3d03[_0x9fc9('0xd')]+_0x4f3d03[_0x9fc9('0xa')]+_0x4f3d03['countnoanswerretry']+_0x4f3d03[_0x9fc9('0xe')]+_0x4f3d03[_0x9fc9('0xf')]+_0x4f3d03[_0x9fc9('0x10')]+_0x4f3d03[_0x9fc9('0x11')]+_0x4f3d03['countagentrejectretry'];this[_0x9fc9('0xe')]=_0x4f3d03[_0x9fc9('0xe')];this[_0x9fc9('0xf')]=_0x4f3d03[_0x9fc9('0xf')];this['countabandonedretry']=_0x4f3d03[_0x9fc9('0x10')];this[_0x9fc9('0x11')]=_0x4f3d03['countmachineretry'];this[_0x9fc9('0x12')]=_0x4f3d03[_0x9fc9('0x12')];this[_0x9fc9('0x13')]=_0x5cc88[_0x9fc9('0x13')];this[_0x9fc9('0x14')]=_0x4f3d03[_0x9fc9('0x15')];this['calleridnum']=_0x4f3d03[_0x9fc9('0x16')];this[_0x9fc9('0x17')]=_0x4f3d03[_0x9fc9('0x17')];this['responsetime']=_0x4f3d03[_0x9fc9('0x18')];this[_0x9fc9('0x19')]=moment()['format'](_0x9fc9('0x1a'));this[_0x9fc9('0x1b')]=getSeconds(_0x4f3d03[_0x9fc9('0x18')],_0x4f3d03['starttime']);this[_0x9fc9('0x1c')]=0x0;this['talktime']=getSeconds(this[_0x9fc9('0x19')],_0x4f3d03[_0x9fc9('0x18')]);this[_0x9fc9('0x1d')]=_0x4f3d03[_0x9fc9('0x1d')];this[_0x9fc9('0x1e')]=_0x9fc9('0x1f');this[_0x9fc9('0x20')]=_0x5cc88[_0x9fc9('0x21')];this[_0x9fc9('0x22')]=_0x4f3d03[_0x9fc9('0x22')];this[_0x9fc9('0x23')]=_0x4f3d03[_0x9fc9('0x23')];this[_0x9fc9('0x24')]=_0x4f3d03['callbackat'];this['recallme']=_0x4f3d03['recallme'];this[_0x9fc9('0x25')]=_0x4f3d03[_0x9fc9('0x25')];this[_0x9fc9('0x26')]=_0x4f3d03[_0x9fc9('0x26')];this['UserId']=_0x4f3d03[_0x9fc9('0x27')];this[_0x9fc9('0x28')]=_0x4f3d03['VoiceQueueId'];this[_0x9fc9('0x29')]=_0x4f3d03[_0x9fc9('0x29')];}module[_0x9fc9('0x2a')]=Hangup;
\ No newline at end of file
+var _0x64f0=['ringtime','holdtime','talktime','IVR','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','exports','util','lodash','milliseconds','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x914ea4,_0x5d3045){var _0x1de3cc=function(_0x161e15){while(--_0x161e15){_0x914ea4['push'](_0x914ea4['shift']());}};_0x1de3cc(++_0x5d3045);}(_0x64f0,0x110));var _0x064f=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x64f0[_0x2f4c1c];return _0x25e0f2;};'use strict';var util=require(_0x064f('0x0'));var _=require(_0x064f('0x1'));var moment=require('moment');function getSeconds(_0x19d5b4,_0x1b591f){var _0xfee014=moment(_0x19d5b4)[_0x064f('0x2')](0x0);var _0x1b9881=moment(_0x1b591f)['milliseconds'](0x0);return _0xfee014['diff'](_0x1b9881,_0x064f('0x3'));}function Hangup(_0x3fd0d9,_0x17b255){this[_0x064f('0x4')]=0x4;this[_0x064f('0x5')]=_0x064f('0x6');this['scheduledat']=_0x3fd0d9['scheduledat'];this['type']=_0x3fd0d9[_0x064f('0x7')];this['campaigntype']=_0x3fd0d9[_0x064f('0x7')]===_0x064f('0x8')?_0x064f('0x9'):_0x3fd0d9['type'];this[_0x064f('0xa')]=_0x3fd0d9[_0x064f('0xa')];this['countcongestionretry']=_0x3fd0d9[_0x064f('0xb')];this[_0x064f('0xc')]=_0x3fd0d9['countnoanswerretry'];this[_0x064f('0xd')]=_0x3fd0d9['countbusyretry']+_0x3fd0d9['countcongestionretry']+_0x3fd0d9[_0x064f('0xc')]+_0x3fd0d9[_0x064f('0xe')]+_0x3fd0d9[_0x064f('0xf')]+_0x3fd0d9['countabandonedretry']+_0x3fd0d9[_0x064f('0x10')]+_0x3fd0d9['countagentrejectretry'];this['countnosuchnumberretry']=_0x3fd0d9[_0x064f('0xe')];this[_0x064f('0xf')]=_0x3fd0d9[_0x064f('0xf')];this['countabandonedretry']=_0x3fd0d9[_0x064f('0x11')];this[_0x064f('0x10')]=_0x3fd0d9[_0x064f('0x10')];this[_0x064f('0x12')]=_0x3fd0d9['countagentrejectretry'];this['uniqueid']=_0x17b255[_0x064f('0x13')];this[_0x064f('0x14')]=_0x3fd0d9[_0x064f('0x15')];this[_0x064f('0x16')]=_0x3fd0d9[_0x064f('0x17')];this[_0x064f('0x18')]=_0x3fd0d9[_0x064f('0x18')];this['responsetime']=_0x3fd0d9[_0x064f('0x19')];this[_0x064f('0x1a')]=moment()[_0x064f('0x1b')](_0x064f('0x1c'));this[_0x064f('0x1d')]=getSeconds(_0x3fd0d9[_0x064f('0x19')],_0x3fd0d9[_0x064f('0x18')]);this[_0x064f('0x1e')]=0x0;this[_0x064f('0x1f')]=getSeconds(this['endtime'],_0x3fd0d9['responsetime']);this['queue']=_0x3fd0d9['queue'];this['membername']=_0x064f('0x20');this[_0x064f('0x21')]=_0x17b255[_0x064f('0x22')];this['callback']=_0x3fd0d9['callback'];this[_0x064f('0x23')]=_0x3fd0d9[_0x064f('0x23')];this[_0x064f('0x24')]=_0x3fd0d9[_0x064f('0x24')];this['recallme']=_0x3fd0d9[_0x064f('0x25')];this['ContactId']=_0x3fd0d9[_0x064f('0x26')];this[_0x064f('0x27')]=_0x3fd0d9[_0x064f('0x27')];this[_0x064f('0x28')]=_0x3fd0d9[_0x064f('0x28')];this[_0x064f('0x29')]=_0x3fd0d9[_0x064f('0x29')];this['CampaignId']=_0x3fd0d9['CampaignId'];}module[_0x064f('0x2a')]=Hangup;
\ No newline at end of file
index 984845f..15bbd7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc991=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry'];(function(_0x3155d3,_0x80a44c){var _0x39b1f2=function(_0x25951d){while(--_0x25951d){_0x3155d3['push'](_0x3155d3['shift']());}};_0x39b1f2(++_0x80a44c);}(_0xc991,0xdd));var _0x1c99=function(_0x404ecd,_0xc84835){_0x404ecd=_0x404ecd-0x0;var _0x203fc0=_0xc991[_0x404ecd];return _0x203fc0;};'use strict';var util=require(_0x1c99('0x0'));var _=require(_0x1c99('0x1'));var moment=require(_0x1c99('0x2'));function getSeconds(_0x496f22,_0x50d6db){var _0x39b551=moment(_0x496f22)['milliseconds'](0x0);var _0x57778a=moment(_0x50d6db)[_0x1c99('0x3')](0x0);return _0x39b551[_0x1c99('0x4')](_0x57778a,_0x1c99('0x5'));}function History(_0xbe5f39){this[_0x1c99('0x6')]=_0xbe5f39[_0x1c99('0x6')];this['scheduledat']=_0xbe5f39[_0x1c99('0x7')]||undefined;this[_0x1c99('0x8')]=_0xbe5f39[_0x1c99('0x8')];this[_0x1c99('0x9')]=_0xbe5f39[_0x1c99('0x8')]==='outbound'?_0x1c99('0xa'):_0xbe5f39[_0x1c99('0x8')];this[_0x1c99('0xb')]=_0xbe5f39[_0x1c99('0xb')];this[_0x1c99('0xc')]=_0xbe5f39['countcongestionretry'];this[_0x1c99('0xd')]=_0xbe5f39[_0x1c99('0xd')];this[_0x1c99('0xe')]=_0xbe5f39[_0x1c99('0xb')]+_0xbe5f39[_0x1c99('0xc')]+_0xbe5f39[_0x1c99('0xd')]+_0xbe5f39[_0x1c99('0xf')]+_0xbe5f39[_0x1c99('0x10')]+_0xbe5f39[_0x1c99('0x11')]+_0xbe5f39['countmachineretry']+_0xbe5f39[_0x1c99('0x12')];this[_0x1c99('0xf')]=_0xbe5f39[_0x1c99('0xf')];this[_0x1c99('0x10')]=_0xbe5f39[_0x1c99('0x10')];this[_0x1c99('0x11')]=_0xbe5f39['countabandonedretry'];this[_0x1c99('0x13')]=_0xbe5f39[_0x1c99('0x13')];this['countagentrejectretry']=_0xbe5f39[_0x1c99('0x12')];this['queue']=_0xbe5f39[_0x1c99('0xa')];this[_0x1c99('0x14')]=_0xbe5f39[_0x1c99('0x15')];this[_0x1c99('0x16')]=_0xbe5f39[_0x1c99('0x17')];this[_0x1c99('0x18')]=_0xbe5f39['starttime'];this[_0x1c99('0x19')]=_0xbe5f39[_0x1c99('0x19')];this['endtime']=_0xbe5f39[_0x1c99('0x19')];this[_0x1c99('0x1a')]=getSeconds(_0xbe5f39[_0x1c99('0x19')],_0xbe5f39[_0x1c99('0x18')]);this['holdtime']=0x0;this[_0x1c99('0x1b')]=0x0;this[_0x1c99('0x1c')]=_0xbe5f39['callback'];this[_0x1c99('0x1d')]=_0xbe5f39[_0x1c99('0x1d')];this[_0x1c99('0x1e')]=_0xbe5f39[_0x1c99('0x1e')];this['recallme']=_0xbe5f39['recallme'];this[_0x1c99('0x1f')]=_0xbe5f39[_0x1c99('0x1f')];this[_0x1c99('0x20')]=_0xbe5f39[_0x1c99('0x20')];this['UserId']=_0xbe5f39[_0x1c99('0x21')];this[_0x1c99('0x22')]=_0xbe5f39[_0x1c99('0x22')];this[_0x1c99('0x23')]=_0xbe5f39[_0x1c99('0x23')];this[_0x1c99('0x24')]=_0xbe5f39[_0x1c99('0x24')]||'';this[_0x1c99('0x25')]=_0xbe5f39[_0x1c99('0x25')]||'';}module[_0x1c99('0x26')]=History;
\ No newline at end of file
+var _0xc4fa=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','uniqueid','type','outbound'];(function(_0x339c87,_0x3ae7be){var _0x9ca4fc=function(_0x21d89e){while(--_0x21d89e){_0x339c87['push'](_0x339c87['shift']());}};_0x9ca4fc(++_0x3ae7be);}(_0xc4fa,0x1e6));var _0xac4f=function(_0x4deb98,_0x29ebdd){_0x4deb98=_0x4deb98-0x0;var _0x2c5f93=_0xc4fa[_0x4deb98];return _0x2c5f93;};'use strict';var util=require(_0xac4f('0x0'));var _=require(_0xac4f('0x1'));var moment=require(_0xac4f('0x2'));function getSeconds(_0x4ee231,_0x4fe7b6){var _0x59604b=moment(_0x4ee231)[_0xac4f('0x3')](0x0);var _0x2672d9=moment(_0x4fe7b6)[_0xac4f('0x3')](0x0);return _0x59604b[_0xac4f('0x4')](_0x2672d9,'seconds');}function History(_0x44b159){this[_0xac4f('0x5')]=_0x44b159[_0xac4f('0x5')];this['scheduledat']=_0x44b159['scheduledat']||undefined;this[_0xac4f('0x6')]=_0x44b159[_0xac4f('0x6')];this['campaigntype']=_0x44b159[_0xac4f('0x6')]===_0xac4f('0x7')?_0xac4f('0x8'):_0x44b159[_0xac4f('0x6')];this[_0xac4f('0x9')]=_0x44b159[_0xac4f('0x9')];this[_0xac4f('0xa')]=_0x44b159['countcongestionretry'];this['countnoanswerretry']=_0x44b159[_0xac4f('0xb')];this[_0xac4f('0xc')]=_0x44b159[_0xac4f('0x9')]+_0x44b159[_0xac4f('0xa')]+_0x44b159[_0xac4f('0xb')]+_0x44b159['countnosuchnumberretry']+_0x44b159[_0xac4f('0xd')]+_0x44b159[_0xac4f('0xe')]+_0x44b159[_0xac4f('0xf')]+_0x44b159[_0xac4f('0x10')];this[_0xac4f('0x11')]=_0x44b159[_0xac4f('0x11')];this[_0xac4f('0xd')]=_0x44b159['countdropretry'];this['countabandonedretry']=_0x44b159[_0xac4f('0xe')];this[_0xac4f('0xf')]=_0x44b159[_0xac4f('0xf')];this[_0xac4f('0x10')]=_0x44b159[_0xac4f('0x10')];this[_0xac4f('0x8')]=_0x44b159['queue'];this[_0xac4f('0x12')]=_0x44b159[_0xac4f('0x13')];this[_0xac4f('0x14')]=_0x44b159[_0xac4f('0x15')];this[_0xac4f('0x16')]=_0x44b159[_0xac4f('0x16')];this[_0xac4f('0x17')]=_0x44b159['responsetime'];this[_0xac4f('0x18')]=_0x44b159[_0xac4f('0x17')];this[_0xac4f('0x19')]=getSeconds(_0x44b159[_0xac4f('0x17')],_0x44b159[_0xac4f('0x16')]);this[_0xac4f('0x1a')]=0x0;this['talktime']=0x0;this[_0xac4f('0x1b')]=_0x44b159[_0xac4f('0x1b')];this[_0xac4f('0x1c')]=_0x44b159['callbackuniqueid'];this[_0xac4f('0x1d')]=_0x44b159[_0xac4f('0x1d')];this[_0xac4f('0x1e')]=_0x44b159[_0xac4f('0x1e')];this[_0xac4f('0x1f')]=_0x44b159[_0xac4f('0x1f')];this[_0xac4f('0x20')]=_0x44b159[_0xac4f('0x20')];this[_0xac4f('0x21')]=_0x44b159[_0xac4f('0x21')];this[_0xac4f('0x22')]=_0x44b159['VoiceQueueId'];this[_0xac4f('0x23')]=_0x44b159[_0xac4f('0x23')];this[_0xac4f('0x24')]=_0x44b159[_0xac4f('0x24')]||'';this['originatecalleridname']=_0x44b159['originatecalleridname']||'';}module[_0xac4f('0x25')]=History;
\ No newline at end of file
index 4b05212..53cb298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40ac=['outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','startPredictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','prototype','[uniqueid]','clearZombieChannels','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ListId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','reachable','SIP/%s','unmonitored','syncVarSet','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','state','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','membername','countmachineretry','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','VoiceQueueId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countnosuchnumberretry','dialGlobalMaxRetry','dialMachineMaxRetry','minutes','ContactId','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','cause-txt','reason','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','voiceQueue','additional','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','rrmemory','push','pick','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','finally','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','checkIfTime','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','object','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','getDataPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','handleIvr','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','interval\x20=\x20','exports','util','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncAgentComplete','custom:queuesummary','syncHangup','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','emit'];(function(_0x14337e,_0x50f4e4){var _0x4b9f85=function(_0x252420){while(--_0x252420){_0x14337e['push'](_0x14337e['shift']());}};_0x4b9f85(++_0x50f4e4);}(_0x40ac,0x1de));var _0xc40a=function(_0x581cbe,_0x36b230){_0x581cbe=_0x581cbe-0x0;var _0x57e008=_0x40ac[_0x581cbe];return _0x57e008;};'use strict';var util=require(_0xc40a('0x0'));var _=require('lodash');var BPromise=require(_0xc40a('0x1'));var uuid=require(_0xc40a('0x2'));var moment=require(_0xc40a('0x3'));var rr=require('rr');var md5=require(_0xc40a('0x4'));var Redis=require(_0xc40a('0x5'));var ut=require(_0xc40a('0x6'));var config=require(_0xc40a('0x7'));var logger=require('../../../config/logger')(_0xc40a('0x8'));var loggerBooked=require(_0xc40a('0x9'))(_0xc40a('0xa'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0xc40a('0x9'))(_0xc40a('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xc40a('0xc'));var ami=require(_0xc40a('0xd'));config[_0xc40a('0xe')]=_[_0xc40a('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc40a('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xc40a('0x10'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0xc40a('0x11'));var voiceQueueRt=require(_0xc40a('0x12'));var Action=require(_0xc40a('0x13'));var History=require(_0xc40a('0x14'));var Final=require(_0xc40a('0x15'));var AgentComplete=require(_0xc40a('0x16'));var QueueCallerAbandon=require(_0xc40a('0x17'));var Hangup=require(_0xc40a('0x18'));var ipAgi=process['env'][_0xc40a('0x19')]||_0xc40a('0x1a');var strategy={'rrmemory':'rrmemory','roundrobin':_0xc40a('0x1b')};var Sequence=function(){};Sequence['prototype'][_0xc40a('0x1c')]=function(_0x5e65ce){this[_0xc40a('0x1d')]=this[_0xc40a('0x1d')]?this[_0xc40a('0x1d')]['finally'](_0x5e65ce):_0x5e65ce();};function Dialer(_0x3d1502,_0x272fef){this[_0xc40a('0x1e')]=new Sequence();this['preview']=_0x272fef;this['voiceQueues']=_0x3d1502[_0xc40a('0x1f')];this['campaigns']=_0x3d1502[_0xc40a('0x20')];this['agents']=_0x3d1502[_0xc40a('0x21')];this[_0xc40a('0x22')]=_0x3d1502[_0xc40a('0x22')];this[_0xc40a('0x23')]=config['maxNumberOriginate']||0x2;this[_0xc40a('0x24')]={};this[_0xc40a('0x25')]={};this['contactsId']={};this[_0xc40a('0x26')]={};this['optionPredictive']={};this['startPredictive']={};this[_0xc40a('0x27')]={};this[_0xc40a('0x28')]={};this[_0xc40a('0x29')]={};this[_0xc40a('0x2a')]={};ami['on'](_0xc40a('0x2b'),this[_0xc40a('0x2c')][_0xc40a('0x2d')](this));ami['on']('queuecallerabandon',this[_0xc40a('0x2e')]['bind'](this));ami['on'](_0xc40a('0x2f'),this['syncOriginateResponse'][_0xc40a('0x2d')](this));ami['on']('agentcomplete',this[_0xc40a('0x30')]['bind'](this));ami['on'](_0xc40a('0x31'),this[_0xc40a('0xc')][_0xc40a('0x2d')](this));ami['on']('hangup',this[_0xc40a('0x32')][_0xc40a('0x2d')](this));ami['on']('newexten',this[_0xc40a('0x33')][_0xc40a('0x2d')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0xc40a('0x34'),this[_0xc40a('0x35')][_0xc40a('0x2d')](this));ami['on'](_0xc40a('0x36'),this[_0xc40a('0x37')][_0xc40a('0x2d')](this));this[_0xc40a('0x38')]();this[_0xc40a('0x39')]();}function isNotNull(_0x5c1c82){return _0x5c1c82!==null&&!_[_0xc40a('0x3a')](_0x5c1c82);}function checkIsLoggedIn(_0x38271e,_0x423b16){return function(){if(_0x423b16<=0x0){_0x38271e[_0xc40a('0x3b')]=_0xc40a('0x3c');throw _0x38271e[_0xc40a('0x3d')]+_0xc40a('0x3e');}};}function isActive(_0xdd83e9){return _0xdd83e9;}function checkIsActive(_0x241d93,_0xb3104e){return function(){if(!isActive(_0xb3104e)){_0x241d93['message']=_0xc40a('0x3f');throw _0x241d93[_0xc40a('0x3d')]+_0xc40a('0x40');}};}function checkInterval(_0x40f6e4){return function(){if(!isNotNull(_0x40f6e4[_0xc40a('0x41')])){_0x40f6e4[_0xc40a('0x3b')]='INTERVAL_IS_NULL';throw _0x40f6e4['name']+_0xc40a('0x42');}if(!isNotNull(_0x40f6e4[_0xc40a('0x41')][_0xc40a('0x43')])){_0x40f6e4[_0xc40a('0x3b')]=_0xc40a('0x44');throw _0x40f6e4['name']+_0xc40a('0x42');}if(!isNotNull(_[_0xc40a('0x45')](_0x40f6e4[_0xc40a('0x41')][_0xc40a('0x43')]))){_0x40f6e4[_0xc40a('0x3b')]=_0xc40a('0x44');throw _0x40f6e4[_0xc40a('0x3d')]+_0xc40a('0x42');}};}function msgResponse(_0x4d2929,_0x1c458b,_0x450f57){return{'action':_0x4d2929,'response':_0x1c458b,'message':_0x450f57,'stack':_0x450f57};}function myreject(_0x2bcfc0){return function(_0x3c3a7f){return _0x2bcfc0(msgResponse(_0xc40a('0x46'),_0xc40a('0x47'),JSON['stringify'](_0x3c3a7f)));};}function getSeconds(_0x51c7a7,_0xa70b1b){var _0x126962=moment(_0x51c7a7)['milliseconds'](0x0);var _0x254030=moment(_0xa70b1b)[_0xc40a('0x48')](0x0);return _0x126962[_0xc40a('0x49')](_0x254030,_0xc40a('0x4a'));}function emit(_0x2e5a96,_0x1eb68d,_0x3dfea7){io['to'](_0x2e5a96)[_0xc40a('0x4b')](_0x1eb68d,_0x3dfea7);}function emitVoiceQueueSummary(_0x1c26d6){if(_0x1c26d6['type']===_0xc40a('0x4c')){var _0x2aaa16={'id':_0x1c26d6['id'],'name':_0x1c26d6[_0xc40a('0x3d')],'strategy':_0x1c26d6[_0xc40a('0x4d')],'answered':_0x1c26d6['answered'],'available':_0x1c26d6[_0xc40a('0x4e')],'loggedIn':_0x1c26d6[_0xc40a('0x4f')],'pTalking':_0x1c26d6[_0xc40a('0x50')],'sumBillable':_0x1c26d6[_0xc40a('0x51')],'sumDuration':_0x1c26d6[_0xc40a('0x52')],'sumHoldTime':_0x1c26d6[_0xc40a('0x53')]||0x0,'talking':_0x1c26d6[_0xc40a('0x54')],'total':_0x1c26d6[_0xc40a('0x55')],'type':_0x1c26d6[_0xc40a('0x56')],'unmanaged':_0x1c26d6['unmanaged'],'abandoned':_0x1c26d6[_0xc40a('0x57')],'waiting':_0x1c26d6['waiting'],'loggedInDb':_0x1c26d6[_0xc40a('0x58')],'dialActive':_0x1c26d6[_0xc40a('0x59')],'dialMethod':_0x1c26d6['dialMethod'],'dialOriginateCallerIdName':_0x1c26d6[_0xc40a('0x5a')],'dialOriginateCallerIdNumber':_0x1c26d6[_0xc40a('0x5b')],'dialOriginateTimeout':_0x1c26d6[_0xc40a('0x5c')],'dialPrefix':_0x1c26d6[_0xc40a('0x5d')],'outboundAnswerAgiCallsDay':_0x1c26d6['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1c26d6[_0xc40a('0x5e')],'outboundBlacklistCallsDay':_0x1c26d6[_0xc40a('0x5f')],'outboundBusyCallsDay':_0x1c26d6[_0xc40a('0x60')],'outboundCongestionCallsDay':_0x1c26d6['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1c26d6['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1c26d6[_0xc40a('0x61')],'outboundDropCallsDayTimeout':_0x1c26d6[_0xc40a('0x62')],'outboundNoAnswerCallsDay':_0x1c26d6[_0xc40a('0x63')],'outboundNoSuchCallsDay':_0x1c26d6[_0xc40a('0x64')],'outboundOriginateFailureCallsDay':_0x1c26d6[_0xc40a('0x65')],'outboundReCallsDay':_0x1c26d6['outboundReCallsDay'],'outboundRejectCallsDay':_0x1c26d6[_0xc40a('0x66')],'outboundUnknownCallsDay':_0x1c26d6[_0xc40a('0x67')],'predictiveIntervalAnsweredCalls':_0x1c26d6[_0xc40a('0x68')],'predictiveIntervalAvgHoldtime':_0x1c26d6[_0xc40a('0x69')],'predictiveIntervalAvgTalktime':_0x1c26d6['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1c26d6[_0xc40a('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x1c26d6[_0xc40a('0x6b')],'predictiveIntervalErlangCalls':_0x1c26d6[_0xc40a('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x1c26d6[_0xc40a('0x6d')],'predictiveIntervalHitRate':_0x1c26d6[_0xc40a('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x1c26d6['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1c26d6[_0xc40a('0x6f')],'predictiveIntervalAvailable':_0x1c26d6[_0xc40a('0x70')],'predictiveIntervalTotalCalls':_0x1c26d6['predictiveIntervalTotalCalls'],'message':_0x1c26d6[_0xc40a('0x3b')],'originated':_0x1c26d6[_0xc40a('0x71')],'erlangCalls':_0x1c26d6['erlangCalls'],'erlangCallToSecond':_0x1c26d6['erlangCallToSecond'],'erlangAbandonmentRate':_0x1c26d6[_0xc40a('0x72')],'erlangBusyFactor':_0x1c26d6[_0xc40a('0x73')],'startPredictive':_0x1c26d6['startPredictive'],'startProgressive':_0x1c26d6['startProgressive']};if(_0x1c26d6['Trunk']){_0x2aaa16[_0xc40a('0x74')]={'id':_0x1c26d6[_0xc40a('0x74')]['id'],'name':_0x1c26d6['Trunk'][_0xc40a('0x3d')],'active':_0x1c26d6[_0xc40a('0x74')][_0xc40a('0x75')],'callerid':_0x1c26d6[_0xc40a('0x74')][_0xc40a('0x76')]};}if(_0x1c26d6[_0xc40a('0x41')]){_0x2aaa16['Interval']={'id':_0x1c26d6[_0xc40a('0x41')]['id'],'name':_0x1c26d6[_0xc40a('0x41')][_0xc40a('0x3d')]};}var _0x21e0e5=md5(JSON[_0xc40a('0x77')](_0x2aaa16));if(_0x1c26d6[_0xc40a('0x4')]!==_0x21e0e5){_0x1c26d6['md5']=_0x21e0e5;emit(util[_0xc40a('0x78')](_0xc40a('0x79'),_0x2aaa16[_0xc40a('0x3d')]),_0xc40a('0x7a'),_0x2aaa16);}}}function emitCampaignSummary(_0x507b56){if(_0x507b56[_0xc40a('0x56')]==='ivr'){emit(util['format'](_0xc40a('0x7b'),_0x507b56['name']),'campaign:save',_0x507b56);}}function checkGetDataPredictive(_0x557a2c){if(isNotNull(_0x557a2c)&&!_[_0xc40a('0x45')](_0x557a2c)){loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x7d'));loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x7e'),_0x557a2c[_0xc40a('0x7f')]);loggerPredictive[_0xc40a('0x7c')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x557a2c[_0xc40a('0x68')]);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x80'),_0x557a2c[_0xc40a('0x6b')]);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x81'),_0x557a2c[_0xc40a('0x6a')]);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x82'),_0x557a2c[_0xc40a('0x69')]);loggerPredictive[_0xc40a('0x7c')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x557a2c[_0xc40a('0x83')]);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x84'));if(_0x557a2c[_0xc40a('0x7f')]>0x0){if(!_[_0xc40a('0x3a')](_0x557a2c['predictiveIntervalAvgTalktime'])&&_0x557a2c[_0xc40a('0x83')]>0x0){return!![];}loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x85'));if(!_[_0xc40a('0x3a')](_0x557a2c['predictiveIntervalAvgHoldtime'])&&_0x557a2c['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x86'));}else{loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x87'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x306f7e){return function(_0x200d2e){loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x88'));loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x89'),_0x200d2e[_0xc40a('0x8a')]);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x8b'),_0x200d2e[_0xc40a('0x8c')]);loggerPredictive[_0xc40a('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x200d2e[_0xc40a('0x72')]);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x8d'),_0x200d2e[_0xc40a('0x73')]);loggerPredictive['info'](_0xc40a('0x8e'),_0x200d2e['erlangAbandonmentRate']);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x84'));_[_0xc40a('0x8f')](_0x306f7e,_0x200d2e);};}function getDiff(_0x4d529d){var _0x15371e=moment()['milliseconds'](0x0);var _0x418cbb=moment(_0x4d529d)[_0xc40a('0x48')](0x0);return _0x15371e[_0xc40a('0x49')](_0x418cbb,'seconds');}function ifInterval(_0x4284e8,_0x401853){if(_[_0xc40a('0x3a')](_0x401853)){return![];}return getDiff(_0x401853)<_0x4284e8*0x3c;}function freeVariablesPredictive(_0x60522a){if(isNotNull(_0x60522a)){if(!_[_0xc40a('0x3a')](_0x60522a[_0xc40a('0x27')])){_0x60522a[_0xc40a('0x27')]=undefined;loggerPredictive[_0xc40a('0x7c')](_0x60522a['name'],_0xc40a('0x90'));}if(!_[_0xc40a('0x3a')](_0x60522a[_0xc40a('0x91')])){_0x60522a['startPredictive']=undefined;loggerPredictive[_0xc40a('0x7c')](_0x60522a[_0xc40a('0x3d')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xc40a('0x3a')](_0x60522a[_0xc40a('0x92')])){clearInterval(_0x60522a[_0xc40a('0x92')]);_0x60522a[_0xc40a('0x92')]=undefined;loggerPredictive[_0xc40a('0x7c')](_0x60522a['name'],_0xc40a('0x93'));}}}function erlangb(_0x46797b,_0x5356bb){if(_0x5356bb===0x0){return 0x0;}var _0x20ff22=0x1;for(var _0x459b71=0x1;_0x459b71<=_0x5356bb;_0x459b71+=0x1){_0x20ff22=0x1+_0x20ff22*_0x459b71/_0x46797b;}return 0x1/_0x20ff22;}function isVoiceQueueOutbound(_0x9bd497){return _0x9bd497===_0xc40a('0x4c');}function isNotPreview(_0x4f8bf7){return _0x4f8bf7!==_0xc40a('0x94');}function isCampaignIvr(_0x40de44){return _0x40de44===_0xc40a('0x95');}function getCallerId(_0x201f5f,_0x5aa3b1,_0x5391bf){if(!_[_0xc40a('0x3a')](_0x5391bf)&&typeof _0x5391bf===_0xc40a('0x96')&&!_['isEmpty'](_0x5391bf)){if(!_['isUndefined'](_0x5aa3b1)&&typeof _0x5aa3b1===_0xc40a('0x96')&&!_[_0xc40a('0x45')](_0x5aa3b1)){return util[_0xc40a('0x78')](_0xc40a('0x97'),_0x5aa3b1,_0x5391bf);}return util[_0xc40a('0x78')](_0xc40a('0x97'),_0x5391bf,_0x5391bf);}if(!_[_0xc40a('0x3a')](_0x201f5f)&&typeof _0x201f5f===_0xc40a('0x96')&&!_[_0xc40a('0x45')](_0x201f5f)){return _0x201f5f;}return _0xc40a('0x98');}function loggerCatchQueueSummary(_0x16115e,_0x58e81f){return function(_0xd158af){freeVariablesPredictive(_0x58e81f);emitVoiceQueueSummary(_0x58e81f);emitCampaignSummary(_0x58e81f);loggerSyncQueueSummary[_0xc40a('0x99')](_0x16115e,util['inspect'](_0xd158af,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2b64b7,_0xcba4e0){return function(_0x2bd323){loggerPredictive[_0xc40a('0x99')](_0xcba4e0[_0xc40a('0x3d')],_0x2b64b7);loggerPredictive[_0xc40a('0x99')](_0x2bd323['stack']);freeVariablesPredictive(_0xcba4e0);};}function loggerCatch(_0x41d9be){return function(_0x20c8cd){logger[_0xc40a('0x99')](_0x41d9be,util[_0xc40a('0x9a')](_0x20c8cd,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x39e0c1){return _0x39e0c1&&!_['isUndefined'](_0x39e0c1)&&_0x39e0c1['length']>0x0;}function decremetOriginate(_0x44b7b8){if(!_[_0xc40a('0x3a')](_0x44b7b8)&&_0x44b7b8!==null){if(typeof _0x44b7b8[_0xc40a('0x71')]!==_0xc40a('0x9b')){if(_0x44b7b8[_0xc40a('0x71')]>0x0){_0x44b7b8[_0xc40a('0x71')]-=0x1;}else{logger['error'](_0xc40a('0x9c'));}}}else{logger[_0xc40a('0x99')](_0xc40a('0x9d'));}}function checkContactLowerLimitOriginate(_0x58e9d5,_0x44f078,_0x50b7af){if(_0x44f078>_0x50b7af){for(var _0xe9a975=0x0;_0xe9a975<_0x44f078-_0x50b7af;_0xe9a975+=0x1){decremetOriginate(_0x58e9d5);}}}function loggerGetContactDialer(_0x297f35,_0x555429,_0x1b1822){return function(_0x34e914){checkContactLowerLimitOriginate(_0x555429,_0x1b1822,0x0);logger['error'](_0x297f35,util['inspect'](_0x34e914,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x417993){return function(_0x3ec268){if(isNotNull(_0x3ec268)&&isNotNull(_0x3ec268[0x0])){if(_0x3ec268[0x0]['contactsRescheduled']>0x0){_0x417993[_0xc40a('0x3b')]=_0xc40a('0x9e');logger[_0xc40a('0x7c')](_0xc40a('0x9f')+_0x417993[_0xc40a('0x3d')],_0x3ec268[0x0][_0xc40a('0xa0')],_0xc40a('0xa1'));}else{_0x417993[_0xc40a('0x3b')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xc40a('0x7c')](_0xc40a('0xa2')+_0x417993[_0xc40a('0x3d')]);}}};}function notSendMessagesQueue(_0x138213){if(_0x138213[_0xc40a('0xa3')]){freeVariablesPredictive(_0x138213);if(_0x138213[_0xc40a('0x71')]===0x0&&_0x138213[_0xc40a('0x54')]===0x0&&_0x138213[_0xc40a('0xa4')]===0x0&&(_0x138213['pTalking']||0x0)===0x0){_0x138213[_0xc40a('0xa3')]=![];_0x138213['available']=0x0;_0x138213['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xc40a('0x99')](_0xc40a('0xa5'),_0x138213[_0xc40a('0x3d')],'is\x20not\x20active');}else{_0x138213['message']=_0xc40a('0xa6');loggerSyncQueueSummary[_0xc40a('0x99')](_0xc40a('0xa5'),_0x138213[_0xc40a('0x3d')],_0xc40a('0xa7'));}emitVoiceQueueSummary(_0x138213);}}function notSendMessagesCampaign(_0x17d974){if(_0x17d974[_0xc40a('0xa3')]){if(_0x17d974[_0xc40a('0x71')]===0x0){_0x17d974[_0xc40a('0xa3')]=![];_0x17d974[_0xc40a('0x3b')]=_0xc40a('0x3f');loggerSyncQueueSummary[_0xc40a('0x99')](_0xc40a('0xa8'),_0x17d974[_0xc40a('0x3d')],'is\x20not\x20active');}else{_0x17d974[_0xc40a('0x3b')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc40a('0x99')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x17d974[_0xc40a('0x3d')],_0xc40a('0xa7'));}emitCampaignSummary(_0x17d974);}}function createObjHistory(_0x401815,_0x384f07,_0x5b85d3,_0x5d6868,_0x481911){_0x401815[_0xc40a('0x3b')]=_0x5b85d3;var _0x5bd154=new Action(_0x401815,_0x384f07);var _0x177b38=new History(_0x5bd154);_0x177b38['state']=_0x5d6868;_0x177b38[_0xc40a('0xa9')]=_0x481911;_0x177b38[_0xc40a('0xaa')]=_0x5bd154[_0xc40a('0xab')];return _0x177b38;}Dialer[_0xc40a('0xac')][_0xc40a('0x39')]=function(){var _0x310eb1=this;setInterval(function(){_0x310eb1['clearZombieChannels'](_0x310eb1[_0xc40a('0x26')],_0xc40a('0xad'));_0x310eb1[_0xc40a('0xae')](_0x310eb1[_0xc40a('0x25')],'[actions]');},0x32c8);};Dialer[_0xc40a('0xac')][_0xc40a('0xae')]=function(_0x4a27b7,_0x3470f6){var _0x1e415d=this;for(var _0xe69b in _0x4a27b7){if(typeof _0x4a27b7[_0xe69b]!==_0xc40a('0x9b')){this[_0xc40a('0x1e')][_0xc40a('0x1c')](function(){if(!_[_0xc40a('0xaf')](_0x4a27b7[_0xe69b])){return ami['Action']({'action':_0xc40a('0xb0'),'channel':_0x4a27b7[_0xe69b][_0xc40a('0xb1')]})[_0xc40a('0xb2')](function(_0x18bcdc){if(_0x18bcdc[_0xc40a('0x3b')]===_0xc40a('0xb3')){setTimeout(function(){if(_0x4a27b7[_0xe69b]&&_0x4a27b7[_0xe69b]['type']!==_0xc40a('0x95')){_0x1e415d[_0xc40a('0xb4')](_0x1e415d['voiceQueues'][_0x4a27b7[_0xe69b]['queue']]);logger[_0xc40a('0x99')](_0xc40a('0xb5'),_0x3470f6,_0xe69b,_0x4a27b7[_0xe69b]['queue']);delete _0x4a27b7[_0xe69b];}if(_0x4a27b7[_0xe69b]&&_0x4a27b7[_0xe69b][_0xc40a('0x56')]===_0xc40a('0x95')){_0x1e415d[_0xc40a('0xb4')](_0x1e415d[_0xc40a('0x20')][_0x4a27b7[_0xe69b][_0xc40a('0xb6')]]);logger[_0xc40a('0x99')](_0xc40a('0xb7'),_0x3470f6,_0xe69b,_0x4a27b7[_0xe69b][_0xc40a('0xb6')]);delete _0x4a27b7[_0xe69b];}},0x2328);}});}});}}};Dialer[_0xc40a('0xac')][_0xc40a('0xb8')]=function(_0x217373){return BPromise[_0xc40a('0xb9')]()[_0xc40a('0xba')](cmHopper['countReScheduled'](_0x217373))['catch'](loggerCatch(_0xc40a('0xbb')));};Dialer[_0xc40a('0xac')][_0xc40a('0xbc')]=function(_0x46e5c1){return BPromise[_0xc40a('0xb9')]()[_0xc40a('0xba')](cmHopperBlack[_0xc40a('0xbc')](_0x46e5c1))[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xbd')));};Dialer[_0xc40a('0xac')][_0xc40a('0xbe')]=function(_0x7d3e60,_0x4e9086,_0x1bc6a7){return BPromise[_0xc40a('0xb9')]()[_0xc40a('0xba')](cmHopperAdditionalPhone[_0xc40a('0xbe')](_0x7d3e60,_0x4e9086,_0x1bc6a7))[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xbf')));};Dialer[_0xc40a('0xac')][_0xc40a('0xc0')]=function(_0x129565,_0x464b68,_0x8a0759){return BPromise[_0xc40a('0xb9')]()[_0xc40a('0xba')](cmHopperAdditionalPhone[_0xc40a('0xc0')](_0x129565,_0x464b68,_0x8a0759))[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xc1')));};Dialer[_0xc40a('0xac')][_0xc40a('0xc2')]=function(_0x5c1178){return BPromise[_0xc40a('0xb9')]()['then'](cmHopperBlack[_0xc40a('0xc2')](_0x5c1178))[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xc3')));};Dialer[_0xc40a('0xac')][_0xc40a('0xc4')]=function(_0x1f28e1){return BPromise[_0xc40a('0xb9')]()[_0xc40a('0xba')](cmHopperHistory['avgHandleTime'](_0x1f28e1))['catch'](loggerCatch(_0xc40a('0xc5')));};Dialer[_0xc40a('0xac')][_0xc40a('0xc6')]=function(_0x29f791){return BPromise[_0xc40a('0xb9')]()['then'](cmHopper['rescheduleContact'](_0x29f791))['catch'](loggerCatch(_0xc40a('0xc7')));};Dialer[_0xc40a('0xac')][_0xc40a('0xc8')]=function(_0xb02681,_0x5ca285,_0x423a2d){return BPromise['resolve']()['then'](cmHopper['unlockContact'](_0xb02681,_0x5ca285,_0x423a2d))['catch'](loggerCatch(_0xc40a('0xc9')));};Dialer[_0xc40a('0xac')][_0xc40a('0xca')]=function(_0x500bd4,_0x226463,_0x2740bf,_0x5bdab5,_0x26863e){return BPromise['resolve']()['then'](cmHopper[_0xc40a('0xca')](_0x500bd4,_0x226463,_0x2740bf,_0x5bdab5))[_0xc40a('0xb2')](function(_0x581105){_0x26863e[_0xc40a('0xcb')]-=_0x2740bf;_0x26863e[_0xc40a('0xcb')]=_0x26863e['temp']>0x0?_0x26863e['temp']:0x0;loggerCatch('[getContactDialer]\x20')(_0x581105);});};Dialer[_0xc40a('0xac')][_0xc40a('0xcc')]=function(_0x141f64,_0x340e1e,_0x33cfdc,_0x1a423){return BPromise[_0xc40a('0xb9')]()[_0xc40a('0xba')](cmHopper[_0xc40a('0xcc')](_0x141f64,_0x340e1e,_0x33cfdc))[_0xc40a('0xb2')](function(_0x40f0b6){_0x1a423[_0xc40a('0xcb')]-=_0x340e1e;_0x1a423['temp']=_0x1a423['temp']>0x0?_0x1a423[_0xc40a('0xcb')]:0x0;loggerCatch(_0xc40a('0xcd'))(_0x40f0b6);});};Dialer[_0xc40a('0xac')][_0xc40a('0xce')]=function(_0x2c85fc){return BPromise[_0xc40a('0xb9')]()[_0xc40a('0xba')](voiceQueueRt[_0xc40a('0xce')](_0x2c85fc))[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xcf')));};Dialer['prototype'][_0xc40a('0xd0')]=function(_0x5e7571){return BPromise['resolve']()['then'](cmHopper[_0xc40a('0xd0')](_0x5e7571))[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xd1')));};Dialer['prototype'][_0xc40a('0xd2')]=function(_0x30a64c){return BPromise[_0xc40a('0xb9')]()['then'](cmHopperHistory[_0xc40a('0xd2')](_0x30a64c))['catch'](loggerCatch(_0xc40a('0xd3')));};Dialer[_0xc40a('0xac')][_0xc40a('0xb4')]=function(_0x79dbc4){if(!_[_0xc40a('0x3a')](_0x79dbc4)&&_0x79dbc4!==null){if(typeof _0x79dbc4[_0xc40a('0x71')]!==_0xc40a('0x9b')){if(_0x79dbc4[_0xc40a('0x71')]>0x0){_0x79dbc4[_0xc40a('0x71')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0xc40a('0xd4'));}};Dialer[_0xc40a('0xac')][_0xc40a('0xd5')]=function(_0x3a30c1,_0x31bbab){var _0x572b40=this;return function(_0x390535){_0x572b40['updateOriginated'](_0x31bbab);logger[_0xc40a('0x99')](_0x3a30c1,util['inspect'](_0x390535,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xc40a('0xd6')]=function(_0x5ae340,_0x4fc70e,_0x4cec12){var _0xc1c8a7={'state':0x19,'statedesc':_0xc40a('0xd7')};this[_0xc40a('0xb4')](_0x4fc70e);this[_0xc40a('0xd8')](_[_0xc40a('0x8f')](_0xc1c8a7,_['pick'](_0x4cec12,['ContactId',_0xc40a('0xd9'),'UserId','VoiceQueueId',_0xc40a('0xda')])),_0xc40a('0xdb'),'[emptyContact]');logger[_0xc40a('0x99')](_0x5ae340);};Dialer[_0xc40a('0xac')][_0xc40a('0xdc')]=function(_0x369bac){return _0x369bac===_0xc40a('0xdd');};Dialer[_0xc40a('0xac')]['isTrunkReachable']=function(_0x2090b9){return!_[_0xc40a('0x3a')](_0x2090b9)&&_0x2090b9&&!_['isUndefined'](_0x2090b9[_0xc40a('0x3d')])&&!_[_0xc40a('0x3a')](_0x2090b9[_0xc40a('0x75')])&&_0x2090b9['active']&&(this['trunks'][util[_0xc40a('0x78')]('SIP/%s',_0x2090b9[_0xc40a('0x3d')])][_0xc40a('0xb0')]===_0xc40a('0xde')||this[_0xc40a('0x22')][util[_0xc40a('0x78')](_0xc40a('0xdf'),_0x2090b9['name'])][_0xc40a('0xb0')]===_0xc40a('0xe0'));};Dialer[_0xc40a('0xac')][_0xc40a('0xd8')]=function(_0x3ac3e6,_0x5c00df,_0x91981c){this[_0xc40a('0xd2')](_0x3ac3e6)[_0xc40a('0xb2')](loggerCatch(_0x5c00df));this['moveContactManagedDialer'](_0x3ac3e6)['catch'](loggerCatch(_0x91981c));};Dialer['prototype'][_0xc40a('0xe1')]=function(_0xff774e){var _0x7fd58f=this[_0xc40a('0x26')][_0xff774e[_0xc40a('0xe2')]];var _0x4be1cc;if(!_[_0xc40a('0xaf')](_0xff774e)&&!_[_0xc40a('0xaf')](_0xff774e[_0xc40a('0xe3')])&&!_[_0xc40a('0xaf')](_0xff774e[_0xc40a('0xe3')]['amdstatus'])&&_0xff774e[_0xc40a('0xe4')]===_0xc40a('0xe5')&&_0x7fd58f){if(_0x7fd58f[_0xc40a('0x56')]!==_0xc40a('0x95')&&this['voiceQueues'][_0x7fd58f['queue']][_0xc40a('0xe6')]&&_0xff774e[_0xc40a('0xe7')]===_0xc40a('0xe8')){delete this[_0xc40a('0x26')][_0xff774e['uniqueid']];this[_0xc40a('0xb4')](this[_0xc40a('0x1f')][_0x7fd58f[_0xc40a('0xb6')]]);this[_0xc40a('0x1f')][_0x7fd58f[_0xc40a('0xb6')]][_0xc40a('0x5e')]+=0x1;this[_0xc40a('0x1f')][_0x7fd58f[_0xc40a('0xb6')]][_0xc40a('0xe9')]+=0x1;_0x4be1cc=new Hangup(_0x7fd58f,_0xff774e);_0x4be1cc[_0xc40a('0xea')]=0x12;_0x4be1cc[_0xc40a('0xa9')]='HangupInAMD';_0x4be1cc['membername']=_0xc40a('0xeb');ami['emit']('custom:amd',ut[_0xc40a('0xec')](_0x4be1cc,_0xc40a('0xed')));this[_0xc40a('0xd8')](_0x4be1cc,_0xc40a('0xee'),_0xc40a('0xef'));}if(_0x7fd58f[_0xc40a('0x56')]!==_0xc40a('0x95')&&this[_0xc40a('0x1f')][_0x7fd58f['queue']]['dialAMDActive']&&_0xff774e[_0xc40a('0xe7')]===_0xc40a('0xf0')){var _0x348e2f=this;return new BPromise(function(_0x1e1ed9,_0x4e5d86){delete _0x348e2f[_0xc40a('0x26')][_0xff774e[_0xc40a('0xe2')]];_0x348e2f[_0xc40a('0xb4')](_0x348e2f['voiceQueues'][_0x7fd58f['queue']]);_0x348e2f[_0xc40a('0x1f')][_0x7fd58f[_0xc40a('0xb6')]][_0xc40a('0x5e')]+=0x1;_0x348e2f[_0xc40a('0x1f')][_0x7fd58f['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x1ec48d=_0x348e2f['voiceQueues'][_0x7fd58f['queue']];var _0x1a2fcd=new Hangup(_0x7fd58f,_0xff774e);_0x1a2fcd[_0xc40a('0xea')]=0x13;_0x1a2fcd[_0xc40a('0xa9')]='Machine';_0x1a2fcd[_0xc40a('0xf1')]=_0xc40a('0xeb');_0x1a2fcd[_0xc40a('0xf2')]+=0x1;_0x1a2fcd[_0xc40a('0xf3')]+=0x1;_0x1a2fcd['amd']=!![];ami[_0xc40a('0x4b')](_0xc40a('0xf4'),ut[_0xc40a('0xec')](_0x1a2fcd,_0xc40a('0xed')));_0x348e2f['createHistory'](_0x1a2fcd)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xf5')));if(_0x1a2fcd[_0xc40a('0xf6')]+_0x1a2fcd[_0xc40a('0xf7')]+_0x1a2fcd[_0xc40a('0xf8')]+_0x1a2fcd['countnosuchnumberretry']+_0x1a2fcd[_0xc40a('0xf9')]+_0x1a2fcd[_0xc40a('0xfa')]+_0x1a2fcd[_0xc40a('0xf2')]+_0x1a2fcd[_0xc40a('0xfb')]>=_0x1ec48d['dialGlobalMaxRetry']){_0x348e2f[_0xc40a('0xfc')](_0x1a2fcd,_0x1e1ed9,_0x4e5d86,_0xc40a('0xfd'));}else{if(_0x1a2fcd[_0xc40a('0xf2')]>=_0x1ec48d['dialMachineMaxRetry']){_0x348e2f[_0xc40a('0xfe')](_0x1a2fcd,_0x1e1ed9,_0x4e5d86,_0xc40a('0xff'));}else{_0x348e2f[_0xc40a('0xc6')]({'active':![],'countmachineretry':_0x1a2fcd[_0xc40a('0xf2')],'scheduledat':moment()[_0xc40a('0x100')](_0x1ec48d[_0xc40a('0x101')],'minutes')[_0xc40a('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1a2fcd['ContactId'],'ListId':_0x1a2fcd['ListId'],'VoiceQueueId':_0x1a2fcd[_0xc40a('0x102')]||undefined,'CampaignId':_0x1a2fcd[_0xc40a('0xda')]||undefined})[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x103')));_0x1e1ed9({'reschedule':0x1});}}});}if(_0x7fd58f['type']===_0xc40a('0x95')&&this['campaigns'][_0x7fd58f[_0xc40a('0xb6')]][_0xc40a('0xe6')]&&_0xff774e[_0xc40a('0xe7')]===_0xc40a('0xe8')){delete this[_0xc40a('0x26')][_0xff774e[_0xc40a('0xe2')]];this[_0xc40a('0xb4')](this['campaigns'][_0x7fd58f[_0xc40a('0xb6')]]);_0x4be1cc=new Hangup(_0x7fd58f,_0xff774e);_0x4be1cc['state']=0x12;_0x4be1cc[_0xc40a('0xa9')]=_0xc40a('0x104');_0x4be1cc['membername']='AMD';ami[_0xc40a('0x4b')](_0xc40a('0xf4'),ut['buildObj'](_0x4be1cc,_0xc40a('0xed')));this[_0xc40a('0xd8')](_0x4be1cc,_0xc40a('0x105'),_0xc40a('0x106'));}if(_0x7fd58f[_0xc40a('0x56')]==='ivr'&&this[_0xc40a('0x20')][_0x7fd58f[_0xc40a('0xb6')]]['dialAMDActive']&&_0xff774e[_0xc40a('0xe7')]==='MACHINE'){var _0x348e2f=this;return new BPromise(function(_0x2ae131,_0x434541){delete _0x348e2f[_0xc40a('0x26')][_0xff774e[_0xc40a('0xe2')]];_0x348e2f[_0xc40a('0xb4')](_0x348e2f['campaigns'][_0x7fd58f[_0xc40a('0xb6')]]);_0x348e2f[_0xc40a('0x20')][_0x7fd58f['queue']][_0xc40a('0x5e')]+=0x1;_0x348e2f[_0xc40a('0x20')][_0x7fd58f['queue']][_0xc40a('0xe9')]+=0x1;var _0x3cc0ca=_0x348e2f[_0xc40a('0x20')][_0x7fd58f['queue']];var _0x19d780=new Hangup(_0x7fd58f,_0xff774e);_0x19d780['state']=0x13;_0x19d780[_0xc40a('0xa9')]=_0xc40a('0x107');_0x19d780[_0xc40a('0xf1')]=_0xc40a('0xeb');_0x19d780[_0xc40a('0xf2')]+=0x1;_0x19d780[_0xc40a('0xf3')]+=0x1;_0x19d780[_0xc40a('0xed')]=!![];ami[_0xc40a('0x4b')](_0xc40a('0xf4'),ut[_0xc40a('0xec')](_0x19d780,_0xc40a('0xed')));_0x348e2f[_0xc40a('0xd2')](_0x19d780)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xf5')));if(_0x19d780[_0xc40a('0xf6')]+_0x19d780[_0xc40a('0xf7')]+_0x19d780[_0xc40a('0xf8')]+_0x19d780[_0xc40a('0x108')]+_0x19d780[_0xc40a('0xf9')]+_0x19d780[_0xc40a('0xfa')]+_0x19d780['countmachineretry']+_0x19d780[_0xc40a('0xfb')]>=_0x3cc0ca[_0xc40a('0x109')]){_0x348e2f[_0xc40a('0xfc')](_0x19d780,_0x2ae131,_0x434541,'reason19\x20machine....');}else{if(_0x19d780['countmachineretry']>=_0x3cc0ca[_0xc40a('0x10a')]){_0x348e2f[_0xc40a('0xfe')](_0x19d780,_0x2ae131,_0x434541,'reason\x2019\x20machine....');}else{_0x348e2f[_0xc40a('0xc6')]({'active':![],'countmachineretry':_0x19d780[_0xc40a('0xf2')],'scheduledat':moment()[_0xc40a('0x100')](_0x3cc0ca['dialMachineRetryFrequency'],_0xc40a('0x10b'))[_0xc40a('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x19d780[_0xc40a('0x10c')],'ListId':_0x19d780[_0xc40a('0xd9')],'VoiceQueueId':_0x19d780[_0xc40a('0x102')]||undefined,'CampaignId':_0x19d780[_0xc40a('0xda')]||undefined})['catch'](loggerCatch(_0xc40a('0x103')));_0x2ae131({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x5dd096){var _0x27f3c6=this[_0xc40a('0x26')][_0x5dd096[_0xc40a('0xe2')]];var _0x1bf54a=this;var _0x3d8f53;if(_0x27f3c6&&_0x27f3c6[_0xc40a('0x56')]===_0xc40a('0x95')){delete this[_0xc40a('0x26')][_0x5dd096[_0xc40a('0xe2')]];this[_0xc40a('0xb4')](this[_0xc40a('0x20')][_0x27f3c6[_0xc40a('0xb6')]]);this[_0xc40a('0x20')][_0x27f3c6[_0xc40a('0xb6')]]['ivrAnswerCallsDay']+=0x1;_0x3d8f53=new Hangup(_0x27f3c6,_0x5dd096);this[_0xc40a('0xd2')](_0x3d8f53)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x10d')));this[_0xc40a('0xd0')](_0x3d8f53)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x10e')));}if(_0x27f3c6&&_0x27f3c6[_0xc40a('0x56')]!==_0xc40a('0x95')&&isNotNull(this['voiceQueues'][_0x27f3c6[_0xc40a('0xb6')]][_0xc40a('0x10f')])){delete this[_0xc40a('0x26')][_0x5dd096[_0xc40a('0xe2')]];this['updateOriginated'](this['voiceQueues'][_0x27f3c6[_0xc40a('0xb6')]]);this[_0xc40a('0x1f')][_0x27f3c6['queue']][_0xc40a('0x5e')]+=0x1;this[_0xc40a('0x1f')][_0x27f3c6['queue']][_0xc40a('0xe9')]+=0x1;_0x3d8f53=new Hangup(_0x27f3c6,_0x5dd096);_0x3d8f53['state']=0x10;_0x3d8f53[_0xc40a('0xa9')]='AnswerAGI';_0x3d8f53[_0xc40a('0xf1')]='AGI';this[_0xc40a('0xd2')](_0x3d8f53)[_0xc40a('0xb2')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc40a('0xd0')](_0x3d8f53)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x10e')));}if(_0x27f3c6&&_0x27f3c6[_0xc40a('0x56')]!=='ivr'&&!isNotNull(this[_0xc40a('0x1f')][_0x27f3c6[_0xc40a('0xb6')]][_0xc40a('0x10f')])){delete this[_0xc40a('0x26')][_0x5dd096[_0xc40a('0xe2')]];this['updateOriginated'](this[_0xc40a('0x1f')][_0x27f3c6[_0xc40a('0xb6')]]);this[_0xc40a('0x1f')][_0x27f3c6[_0xc40a('0xb6')]]['outboundUnknownCallsDay']+=0x1;_0x3d8f53=new Hangup(_0x27f3c6,_0x5dd096);_0x3d8f53['state']=0xc;_0x3d8f53[_0xc40a('0xa9')]=_0x5dd096[_0xc40a('0x110')];_0x3d8f53[_0xc40a('0xf1')]='Unknow';this[_0xc40a('0xd2')](_0x3d8f53)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc40a('0xd0')](_0x3d8f53)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x10e')));}};Dialer['prototype']['syncAgentComplete']=function(_0x349599){var _0x258bb1=this[_0xc40a('0x26')][_0x349599['uniqueid']];var _0x1565fd=this;if(this[_0xc40a('0x1f')][_0x349599[_0xc40a('0xb6')]]){if(_0x258bb1&&_0x258bb1['type']!=='ivr'){delete this[_0xc40a('0x26')][_0x349599[_0xc40a('0xe2')]];this[_0xc40a('0x1f')][_0x349599['queue']]['outboundAnswerCallsDay']+=0x1;var _0xa23d8f=new AgentComplete(_0x258bb1,_0x349599);if(_0x349599[_0xc40a('0x111')]===_0xc40a('0x112')){_0xa23d8f[_0xc40a('0x113')]=this[_0xc40a('0x1f')][_0x349599[_0xc40a('0xb6')]]['dialQueueProject2']&&this['voiceQueues'][_0x349599['queue']][_0xc40a('0x114')]?moment()['format'](_0xc40a('0x115')):undefined;}this[_0xc40a('0xd2')](_0xa23d8f)['catch'](loggerCatch(_0xc40a('0x116')));this[_0xc40a('0xd0')](_0xa23d8f)['catch'](loggerCatch(_0xc40a('0x117')));}}};Dialer[_0xc40a('0xac')]['syncAgentConnect']=function(_0x5e423e){if(this[_0xc40a('0x1f')][_0x5e423e[_0xc40a('0xb6')]]){if(this['uniqueId'][_0x5e423e['uniqueid']]&&this[_0xc40a('0x26')][_0x5e423e[_0xc40a('0xe2')]][_0xc40a('0x56')]!==_0xc40a('0x95')){this[_0xc40a('0xb4')](this[_0xc40a('0x1f')][_0x5e423e[_0xc40a('0xb6')]]);this['uniqueId'][_0x5e423e[_0xc40a('0xe2')]][_0xc40a('0x118')]=moment()[_0xc40a('0x78')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xc40a('0xac')][_0xc40a('0x119')]=function(_0x18f2a1,_0x5737ee){this[_0xc40a('0xd2')](_0x18f2a1)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x116')));if(_0x5737ee==0x0){this['moveContactManagedDialer'](_0x18f2a1)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x11a')));}};Dialer[_0xc40a('0xac')]['syncQueueCallerAbandon']=function(_0x37253f){var _0x4c8767=this[_0xc40a('0x26')][_0x37253f[_0xc40a('0xe2')]];var _0x385151=this;var _0x5cd1ff=![];var _0x2a9176;var _0x2b82df;if(this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]]){if(_0x4c8767&&_0x4c8767[_0xc40a('0x56')]!==_0xc40a('0x95')){delete this[_0xc40a('0x26')][_0x37253f['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x37253f[_0xc40a('0xb6')]]);_0x4c8767[_0xc40a('0x11b')]=moment()[_0xc40a('0x78')](_0xc40a('0x115'));var _0x4e5387=new QueueCallerAbandon(_0x4c8767,_0x37253f);if(getSeconds(_0x4c8767['droptime'],_0x4c8767[_0xc40a('0x11c')])>=_0x4c8767['dialQueueTimeout']){this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]][_0xc40a('0x6d')]+=0x1;_0x4e5387[_0xc40a('0xea')]=0xa;_0x4e5387['statedesc']=_0xc40a('0x11d');_0x4e5387[_0xc40a('0x11e')]=_0xc40a('0x11f');_0x4e5387[_0xc40a('0x113')]=this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]][_0xc40a('0x120')]?moment()[_0xc40a('0x78')](_0xc40a('0x115')):undefined;_0x4e5387[_0xc40a('0xf9')]+=0x1;_0x4e5387[_0xc40a('0xf3')]+=0x1;_0x2a9176=this['voiceQueues'][_0x37253f[_0xc40a('0xb6')]][_0xc40a('0x121')];_0x2b82df=this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]]['callAdditionalPhoneAfterMin'];_0x385151[_0xc40a('0xbe')](_0x4e5387,_0x4e5387[_0xc40a('0xea')],_0x4c8767[_0xc40a('0x122')])['then'](function(_0x5b630d){_0x5cd1ff=_0x5b630d[_0xc40a('0x123')]==0x1;if(_0x4e5387[_0xc40a('0xf9')]>=_0x385151[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]]['dialDropMaxRetry']){_0x385151[_0xc40a('0x119')](_0x4e5387,_0x5b630d[_0xc40a('0x123')]);}else{_0x385151[_0xc40a('0xc6')]({'active':![],'countdropretry':_0x4e5387['countdropretry'],'scheduledat':moment()[_0xc40a('0x100')](_0x385151[_0xc40a('0x1f')][_0x37253f['queue']][_0xc40a('0x121')],_0xc40a('0x10b'))[_0xc40a('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c8767['ContactId'],'ListId':_0x4c8767[_0xc40a('0xd9')],'VoiceQueueId':_0x4c8767[_0xc40a('0x102')]||undefined,'CampaignId':_0x4c8767['CampaignId']||undefined})[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x124')));var _0x144885=new History(_0x4e5387);_0x144885[_0xc40a('0xea')]=0xa;_0x144885[_0xc40a('0xa9')]=_0xc40a('0x11d');_0x144885[_0xc40a('0xab')]=moment()['format'](_0xc40a('0x115'));_0x144885[_0xc40a('0xaa')]=_0x144885[_0xc40a('0xab')];_0x144885[_0xc40a('0x125')]=_0x4e5387[_0xc40a('0x125')];_0x144885[_0xc40a('0x126')]=_0x4e5387[_0xc40a('0x126')];_0x385151[_0xc40a('0xd2')](_0x144885)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x127')));}})[_0xc40a('0xba')](function(_0x525b73){if(_0x5cd1ff)_0x385151['swapAdditionalPhones'](_0x4e5387,_0x2a9176,_0x2b82df)[_0xc40a('0xba')](function(_0x11dcaa){return 0x1;});});}else{this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]]['outboundDropCallsDayCallersExit']+=0x1;_0x4e5387[_0xc40a('0xea')]=0xb;_0x4e5387[_0xc40a('0xa9')]=_0xc40a('0x128');_0x4e5387['dropreason']=_0xc40a('0x129');_0x4e5387[_0xc40a('0xfa')]+=0x1;_0x4e5387['countglobal']+=0x1;_0x2a9176=this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]]['dialAbandonedRetryFrequency'];_0x2b82df=this[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]][_0xc40a('0x12a')];_0x385151[_0xc40a('0xbe')](_0x4e5387,_0x4e5387[_0xc40a('0xea')],_0x4c8767[_0xc40a('0x122')])[_0xc40a('0xba')](function(_0x131374){if(_0x4e5387[_0xc40a('0xfa')]>=_0x385151['voiceQueues'][_0x37253f[_0xc40a('0xb6')]][_0xc40a('0x12b')]){_0x385151[_0xc40a('0x119')](_0x4e5387,_0x131374[_0xc40a('0x123')]);}else{_0x385151[_0xc40a('0xc6')]({'active':![],'countabandonedretry':_0x4e5387[_0xc40a('0xfa')],'scheduledat':moment()['add'](_0x385151[_0xc40a('0x1f')][_0x37253f[_0xc40a('0xb6')]][_0xc40a('0x12c')],_0xc40a('0x10b'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c8767[_0xc40a('0x10c')],'ListId':_0x4c8767[_0xc40a('0xd9')],'VoiceQueueId':_0x4c8767['VoiceQueueId']||undefined,'CampaignId':_0x4c8767[_0xc40a('0xda')]||undefined})['catch'](loggerCatch(_0xc40a('0x12d')));var _0x27b1eb=new History(_0x4e5387);_0x27b1eb['state']=0xb;_0x27b1eb[_0xc40a('0xa9')]='Abandoned';_0x27b1eb[_0xc40a('0xab')]=moment()[_0xc40a('0x78')](_0xc40a('0x115'));_0x27b1eb[_0xc40a('0xaa')]=_0x27b1eb[_0xc40a('0xab')];_0x27b1eb[_0xc40a('0x125')]=_0x4e5387[_0xc40a('0x125')];_0x27b1eb[_0xc40a('0x126')]=_0x4e5387[_0xc40a('0x126')];_0x385151[_0xc40a('0xd2')](_0x27b1eb)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x12e')));}})[_0xc40a('0xba')](function(_0x3eeff5){if(_0x5cd1ff)_0x385151[_0xc40a('0xc0')](_0x4e5387,_0x2a9176,_0x2b82df)[_0xc40a('0xba')](function(_0x48edcb){return 0x1;});});}}}};Dialer[_0xc40a('0xac')]['syncNewExten']=function(_0x26a955){if(this[_0xc40a('0x25')][_0x26a955[_0xc40a('0xe2')]]){this[_0xc40a('0x25')][_0x26a955[_0xc40a('0xe2')]][_0xc40a('0xb1')]=_0x26a955[_0xc40a('0xb1')];}if(this[_0xc40a('0x26')][_0x26a955[_0xc40a('0xe2')]]){this[_0xc40a('0x26')][_0x26a955[_0xc40a('0xe2')]]['channel']=_0x26a955[_0xc40a('0xb1')];}};Dialer[_0xc40a('0xac')][_0xc40a('0x35')]=function(_0x1d42a3){if(strategy[this[_0xc40a('0x1f')][this[_0xc40a('0x25')][_0x1d42a3[_0xc40a('0x12f')]]['queue']][_0xc40a('0x4d')]]===_0xc40a('0x1b')){if(this['actions'][_0x1d42a3[_0xc40a('0x12f')]]&&_[_0xc40a('0xaf')](this['actions'][_0x1d42a3[_0xc40a('0x12f')]][_0xc40a('0x130')])&&_0x1d42a3[_0xc40a('0xb0')]==='1'&&_0x1d42a3['paused']==='0'){if(this[_0xc40a('0x21')][_0x1d42a3[_0xc40a('0x131')]]){if(!this['agents'][_0x1d42a3[_0xc40a('0x131')]][_0xc40a('0x130')]){this[_0xc40a('0x21')][_0x1d42a3[_0xc40a('0x131')]]['locked']=!![];this[_0xc40a('0x25')][_0x1d42a3[_0xc40a('0x12f')]][_0xc40a('0x130')]=!![];this[_0xc40a('0x25')][_0x1d42a3[_0xc40a('0x12f')]][_0xc40a('0x131')]=_0x1d42a3[_0xc40a('0x131')];}}}}else if((strategy[this[_0xc40a('0x1f')][this[_0xc40a('0x25')][_0x1d42a3['actionid']]['queue']][_0xc40a('0x4d')]]||'rrmemory')===_0xc40a('0x132')){if(this[_0xc40a('0x25')][_0x1d42a3[_0xc40a('0x12f')]]){if(this[_0xc40a('0x21')][_0x1d42a3[_0xc40a('0x131')]]){this[_0xc40a('0x25')][_0x1d42a3[_0xc40a('0x12f')]][_0xc40a('0x131')]=_0x1d42a3[_0xc40a('0x131')];if(_[_0xc40a('0xaf')](this['queueBooked'][this[_0xc40a('0x25')][_0x1d42a3['actionid']][_0xc40a('0xb6')]])){this[_0xc40a('0x29')][this[_0xc40a('0x25')][_0x1d42a3['actionid']][_0xc40a('0xb6')]]=[];}this[_0xc40a('0x29')][this['actions'][_0x1d42a3['actionid']][_0xc40a('0xb6')]][_0xc40a('0x133')](_[_0xc40a('0x8f')](_[_0xc40a('0x134')](this['actions'][_0x1d42a3[_0xc40a('0x12f')]],[_0xc40a('0x135'),'stateinterface']),{'status':_0x1d42a3[_0xc40a('0xb0')],'paused':_0x1d42a3[_0xc40a('0x136')]}));}}}};function unlockQueueStatus(_0x48ae5b,_0x588ae9){setTimeout(function(){if(_[_0xc40a('0x3a')](_0x48ae5b[_0xc40a('0x137')])){loggerBooked[_0xc40a('0x99')](_0xc40a('0x138'),_0x588ae9);}_0x48ae5b[_0xc40a('0x137')]=!![];loggerBooked[_0xc40a('0x7c')](_0xc40a('0x139'),_0x588ae9,JSON['stringify'](_['pick'](_0x48ae5b,[_0xc40a('0x3d'),_0xc40a('0x137')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x551cea){var _0x181371=this;var _0x435e48=_0x181371[_0xc40a('0x1f')][_0x181371[_0xc40a('0x25')][_0x551cea['actionid']][_0xc40a('0xb6')]];if(strategy[this[_0xc40a('0x1f')][this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]][_0xc40a('0x4d')]]===_0xc40a('0x1b')){if(this['actions'][_0x551cea[_0xc40a('0x12f')]]&&this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x131')]){this[_0xc40a('0x94')][_0xc40a('0x13a')](this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x135')],this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x131')])['catch'](function(_0x1f6eae){logger[_0xc40a('0x99')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xc40a('0x9a')](_0x1f6eae,{'showHidden':![],'depth':null}));})['finally'](function(){_0x181371['updateOriginated'](_0x181371[_0xc40a('0x1f')][_0x181371['actions'][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]]);_0x181371[_0xc40a('0x21')][_0x181371['actions'][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x131')]][_0xc40a('0x130')]=![];delete _0x181371['actions'][_0x551cea[_0xc40a('0x12f')]];unlockQueueStatus(_0x435e48);});}else{this[_0xc40a('0xb4')](this[_0xc40a('0x1f')][this['actions'][_0x551cea[_0xc40a('0x12f')]]['queue']]);this[_0xc40a('0xc6')]({'active':![],'ContactId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x10c')],'ListId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xd9')],'VoiceQueueId':this['actions'][_0x551cea[_0xc40a('0x12f')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xc40a('0x25')][_0x551cea['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0xc40a('0x13b')));delete this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]];unlockQueueStatus(_0x435e48);}}else if((strategy[this[_0xc40a('0x1f')][this[_0xc40a('0x25')][_0x551cea['actionid']]['queue']][_0xc40a('0x4d')]]||_0xc40a('0x132'))===_0xc40a('0x132')){var _0x1515ed;if(this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]]&&!_[_0xc40a('0x45')](this['queueBooked'][this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]])){if(this['queueBookedRR'][_0x181371['actions'][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]]){this[_0xc40a('0x2a')][_0x181371['actions'][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]]=this[_0xc40a('0x2a')][this['actions'][_0x551cea['actionid']][_0xc40a('0xb6')]]?this[_0xc40a('0x2a')][this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]]['queue']]:this[_0xc40a('0x29')][this['actions'][_0x551cea['actionid']][_0xc40a('0xb6')]]?this['queueBooked'][this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]][_0xc40a('0x13c')]||0x0:0x0;}this[_0xc40a('0x29')][this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]]['queue']][_0xc40a('0x13c')]=this[_0xc40a('0x2a')][this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]];for(var _0x1a3989=0x0;_0x1a3989<this[_0xc40a('0x29')][this['actions'][_0x551cea[_0xc40a('0x12f')]]['queue']][_0xc40a('0x13d')];_0x1a3989+=0x1){_0x1515ed=rr(this[_0xc40a('0x29')][this['actions'][_0x551cea[_0xc40a('0x12f')]]['queue']]);this[_0xc40a('0x2a')][_0x181371[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]]=this[_0xc40a('0x29')][this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]]['_rr'];if(_0x1515ed[_0xc40a('0xb0')]==='1'&&_0x1515ed[_0xc40a('0x136')]==='0'){break;}}if(!_[_0xc40a('0xaf')](_0x1515ed)){this[_0xc40a('0x21')][_0x1515ed['stateinterface']][_0xc40a('0x13e')]=_[_0xc40a('0x3a')](this[_0xc40a('0x21')][_0x1515ed['stateinterface']][_0xc40a('0x13e')])?!![]:this['agents'][_0x1515ed[_0xc40a('0x131')]][_0xc40a('0x13e')];}loggerBooked[_0xc40a('0x7c')]('[booked][RR]',_0x551cea['actionid'],'Agent:\x20',JSON[_0xc40a('0x77')](_[_0xc40a('0x134')](this[_0xc40a('0x21')][_0x1515ed[_0xc40a('0x131')]],[_0xc40a('0x3d'),'unlockRR'])),'contactAgent-idHopper:\x20',JSON[_0xc40a('0x77')](_0x1515ed[_0xc40a('0x135')]));if(!_['isNil'](_0x1515ed)&&_0x1515ed[_0xc40a('0xb0')]==='1'&&_0x1515ed[_0xc40a('0x136')]==='0'&&this[_0xc40a('0x21')][_0x1515ed[_0xc40a('0x131')]][_0xc40a('0x13e')]){this[_0xc40a('0x21')][_0x1515ed['stateinterface']][_0xc40a('0x13e')]=![];this['queueBooked'][_0x181371['actions'][_0x551cea[_0xc40a('0x12f')]]['queue']]=[];this[_0xc40a('0x94')]['run'](_0x1515ed['idHopper'],_0x1515ed[_0xc40a('0x131')])['catch'](function(_0x220ea4){logger[_0xc40a('0x99')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xc40a('0x9a')](_0x220ea4,{'showHidden':![],'depth':null}));})[_0xc40a('0x13f')](function(){_0x181371[_0xc40a('0xb4')](_0x181371[_0xc40a('0x1f')][_0x181371[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]]);setTimeout(function(){_0x181371['agents'][_0x1515ed[_0xc40a('0x131')]][_0xc40a('0x13e')]=!![];loggerBooked[_0xc40a('0x7c')](_0xc40a('0x140'),_0x551cea['actionid'],_0xc40a('0x141'),JSON['stringify'](_[_0xc40a('0x134')](_0x181371[_0xc40a('0x21')][_0x1515ed['stateinterface']],['name','unlockRR'])),_0xc40a('0x142'),JSON[_0xc40a('0x77')](_0x1515ed[_0xc40a('0x135')]));},0xc7);delete _0x181371[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]];unlockQueueStatus(_0x435e48,_0x551cea[_0xc40a('0x12f')]);});}else{loggerBooked[_0xc40a('0x7c')](_0xc40a('0x143'));this[_0xc40a('0xb4')](this[_0xc40a('0x1f')][this['actions'][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]]);this[_0xc40a('0xc6')]({'active':![],'ContactId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x10c')],'ListId':this['actions'][_0x551cea[_0xc40a('0x12f')]]['ListId'],'VoiceQueueId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x102')]||undefined,'CampaignId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]]['CampaignId']||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]];unlockQueueStatus(_0x435e48);}}else{loggerBooked['info'](_0xc40a('0x144'));this['updateOriginated'](this[_0xc40a('0x1f')][this['actions'][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xb6')]]);this[_0xc40a('0xc6')]({'active':![],'ContactId':this['actions'][_0x551cea['actionid']][_0xc40a('0x10c')],'ListId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xd9')],'VoiceQueueId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x102')]||undefined,'CampaignId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xda')]||undefined})[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x145')));delete this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]];unlockQueueStatus(_0x435e48);}}else{loggerBooked[_0xc40a('0x7c')](_0xc40a('0x146'));this[_0xc40a('0xb4')](this['voiceQueues'][this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]]['queue']]);this[_0xc40a('0xc6')]({'active':![],'ContactId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x10c')],'ListId':this[_0xc40a('0x25')][_0x551cea['actionid']][_0xc40a('0xd9')],'VoiceQueueId':this['actions'][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0x102')]||undefined,'CampaignId':this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]][_0xc40a('0xda')]||undefined})[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x147')));delete this[_0xc40a('0x25')][_0x551cea[_0xc40a('0x12f')]];unlockQueueStatus(_0x435e48);}};Dialer[_0xc40a('0xac')][_0xc40a('0x38')]=function(){var _0xdeecce=this;setInterval(function(){_0xdeecce[_0xc40a('0x148')]();},0x3e8);};Dialer['prototype'][_0xc40a('0x149')]=function(_0x23b71d){var _0x27db5c=this;return function(){if(!_0x27db5c['isTrunkReachable'](_0x23b71d[_0xc40a('0x74')])){if(!_0x27db5c[_0xc40a('0x14a')](_0x23b71d['TrunkBackup'])){_0x23b71d['message']='TRUNK_IS_NOT_REACHABLE';throw _0x23b71d[_0xc40a('0x3d')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xc40a('0xac')]['checkIfTime']=function(_0x155339,_0x37f690,_0x349dcd,_0x45e65d){var _0x3252a7=this;return function(){var _0x3fc80c=!![];return _0x3252a7[_0xc40a('0x14b')](_0x155339,_0x37f690,_0x349dcd,_0x45e65d,_0x3fc80c);};};Dialer['prototype'][_0xc40a('0x14c')]=function(_0xf60214,_0x3046d3,_0x1803d2,_0x26fae6){var _0x2288e0=this;return function(){var _0x304aa4=![];return _0x2288e0[_0xc40a('0x14b')](_0xf60214['Intervals'],_0x3046d3,_0x1803d2,_0x26fae6,_0x304aa4);};};Dialer['prototype'][_0xc40a('0x14b')]=function(_0x10f5c0,_0x469d7e,_0x589103,_0xec54,_0x259949){var _0xf4c933=[];return new BPromise(function(_0x655aeb,_0x48f13b){if(!isNotNull(_0x10f5c0)){_0xec54[_0xc40a('0x3b')]=_0xc40a('0x44');return _0x48f13b(msgResponse(_0xc40a('0x14b'),_0xc40a('0x14d'),_0x589103+_0xc40a('0x14e')));}if(_['isEmpty'](_0x10f5c0)){_0xec54['message']=_0xc40a('0x14f');return _0x48f13b(msgResponse('ifTime',_0xc40a('0x14d'),_0x589103+_0xc40a('0x150')));}if(_0x469d7e&&_['isUndefined'](config[_0xc40a('0x151')][_0x469d7e])){_0xec54[_0xc40a('0x3b')]=_0xc40a('0x152');return _0x48f13b(msgResponse(_0xc40a('0x14b'),'Failure',_0x589103+_0xc40a('0x153')+_0x469d7e));}if(_['isArray'](_0x10f5c0)){for(var _0x444cd7=0x0;_0x444cd7<_0x10f5c0[_0xc40a('0x13d')];_0x444cd7+=0x1){_0xf4c933['push'](ami[_0xc40a('0x154')]({'action':_0xc40a('0x155'),'command':util[_0xc40a('0x78')](_0xc40a('0x156'),_0x10f5c0[_0x444cd7][_0xc40a('0x157')],!_[_0xc40a('0x3a')](config['timezones'][_0x469d7e])?_0x469d7e:'')})['then'](function(_0x1b3710){return _0x1b3710[_0xc40a('0x158')][_0xc40a('0x159')](_0xc40a('0x15a'))>=0x0;})['catch'](myreject(_0x48f13b)));}}else{_0xf4c933[_0xc40a('0x133')](ami[_0xc40a('0x154')]({'action':'command','command':util[_0xc40a('0x78')]('iftime\x20%s,%s',_0x10f5c0,!_[_0xc40a('0x3a')](config[_0xc40a('0x151')][_0x469d7e])?_0x469d7e:'')})[_0xc40a('0xba')](function(_0x27b7a8){return _0x27b7a8[_0xc40a('0x158')][_0xc40a('0x159')]('true')>=0x0;})[_0xc40a('0xb2')](myreject(_0x48f13b)));}BPromise[_0xc40a('0x15b')](_0xf4c933)[_0xc40a('0xba')](function(_0x4558c2){var _0x44214a=_[_0xc40a('0x15c')](_0x4558c2);if(_0x44214a){return _0x655aeb(_0x44214a);}else{_0xec54[_0xc40a('0x3b')]=_0x259949?_0xc40a('0x15d'):_0xc40a('0x15e');return _0x48f13b(msgResponse(_0xc40a('0x15f'),_0xc40a('0x14d'),_0xc40a('0x160')+_0x259949+'\x20'+_0x589103+_0xc40a('0x161')+util[_0xc40a('0x9a')](_0x10f5c0,{'showHidden':![],'depth':null})+_0xc40a('0x162')+_0x469d7e));}})[_0xc40a('0xb2')](function(_0x43403b){return _0x48f13b(msgResponse(_0xc40a('0x14b'),_0xc40a('0x14d'),JSON['stringify'](_0x43403b)));});});};Dialer['prototype'][_0xc40a('0x163')]=function(_0x1102cd){var _0x1dacf9=this;return function(){switch(_0x1102cd[_0xc40a('0x164')]){case _0xc40a('0x165'):freeVariablesPredictive(_0x1102cd);_0x1dacf9[_0xc40a('0x166')](_0x1102cd,0x1);break;case'power':freeVariablesPredictive(_0x1102cd);_0x1dacf9['handlePower'](_0x1102cd,_0x1102cd[_0xc40a('0x167')]);break;case _0xc40a('0x168'):_0x1dacf9[_0xc40a('0x168')](_0x1102cd);break;case'booked':freeVariablesPredictive(_0x1102cd);_0x1dacf9[_0xc40a('0x166')](_0x1102cd,0x1);break;default:freeVariablesPredictive(_0x1102cd);logger[_0xc40a('0x99')](_0xc40a('0x169'),_0x1102cd[_0xc40a('0x3d')],_0xc40a('0x16a'));}};};Dialer[_0xc40a('0xac')][_0xc40a('0x16b')]=function(_0x1ed923){var _0x2dbd7c=this;return function(){_0x2dbd7c['handleIvr'](_0x1ed923);};};Dialer[_0xc40a('0xac')][_0xc40a('0xc')]=function(_0x5608dc){var _0x3207c=this;if(isNotPreview(_0x5608dc[_0xc40a('0x164')])){if(isVoiceQueueOutbound(_0x5608dc[_0xc40a('0x56')])&&isActive(_0x5608dc[_0xc40a('0x59')])){_0x5608dc[_0xc40a('0xa3')]=!![];BPromise['resolve']()[_0xc40a('0xba')](checkIsLoggedIn(_0x5608dc,_0x5608dc[_0xc40a('0x4f')]))['then'](checkIsActive(_0x5608dc,_0x5608dc['dialActive']))[_0xc40a('0xba')](checkInterval(_0x5608dc))[_0xc40a('0xba')](_0x3207c['checkIsTrunkReachable'](_0x5608dc))[_0xc40a('0xba')](_0x3207c[_0xc40a('0x16c')](_0x5608dc[_0xc40a('0x16d')],_0x5608dc[_0xc40a('0x16e')],_0x5608dc['name'],_0x5608dc))['then'](_0x3207c[_0xc40a('0x14c')](_0x5608dc[_0xc40a('0x41')],_0x5608dc[_0xc40a('0x16e')],_0x5608dc[_0xc40a('0x3d')],_0x5608dc))[_0xc40a('0xba')](_0x3207c[_0xc40a('0x163')](_0x5608dc))['catch'](loggerCatchQueueSummary(_0xc40a('0x16f'),_0x5608dc));}else{notSendMessagesQueue(_0x5608dc);}}else{freeVariablesPredictive(_0x5608dc);}};Dialer[_0xc40a('0xac')][_0xc40a('0x148')]=function(){var _0x3eb86e=this;var _0x19e43f;for(var _0x52197d in this[_0xc40a('0x20')]){if(typeof this[_0xc40a('0x20')][_0x52197d]!==_0xc40a('0x9b')){_0x19e43f=this[_0xc40a('0x20')][_0x52197d];if(isCampaignIvr(_0x19e43f['type'])&&isActive(_0x19e43f[_0xc40a('0x75')])){_0x19e43f[_0xc40a('0xa3')]=!![];BPromise[_0xc40a('0xb9')]()[_0xc40a('0xba')](checkIsActive(_0x19e43f,_0x19e43f[_0xc40a('0x75')]))['then'](checkInterval(_0x19e43f))[_0xc40a('0xba')](_0x3eb86e['checkIsTrunkReachable'](_0x19e43f))[_0xc40a('0xba')](_0x3eb86e[_0xc40a('0x16c')](_0x19e43f[_0xc40a('0x16d')],_0x19e43f['dialTimezone'],_0x19e43f[_0xc40a('0x3d')],_0x19e43f))[_0xc40a('0xba')](_0x3eb86e[_0xc40a('0x14c')](_0x19e43f[_0xc40a('0x41')],_0x19e43f[_0xc40a('0x16e')],_0x19e43f[_0xc40a('0x3d')],_0x19e43f))[_0xc40a('0xba')](_0x3eb86e[_0xc40a('0x16b')](_0x19e43f))[_0xc40a('0xb2')](loggerCatchQueueSummary(_0xc40a('0x170'),_0x19e43f));}else{notSendMessagesCampaign(_0x19e43f);}}}};function getCallerIdRandom(_0x2e9172,_0x387438){var _0x2aeb3a;var _0x33c75b;var _0x314f8b;if(_0x387438<=0x0){_0x387438=0x1;}_0x2aeb3a=new RegExp(_0xc40a('0x171')+_0x387438+'}$');_0x33c75b=Math[_0xc40a('0x172')](0xa,_0x387438-0x1);_0x314f8b=Math[_0xc40a('0x172')](0xa,_0x387438)-0x1;return util[_0xc40a('0x78')]('%s',_[_0xc40a('0x173')](_0x2e9172,_0x2aeb3a,_['random'](_0x33c75b,_0x314f8b)));}function extractCalleridName(_0x4c5012){var _0x57fc35=_0x4c5012[_0xc40a('0x174')](/"(.*?)"/);return _0x57fc35?_0x57fc35[0x1]:_0x4c5012;}function extractCalleridNumber(_0x260aa5){var _0x230a2e=_0x260aa5[_0xc40a('0x174')](/<(.*?)>/);return _0x230a2e?_0x230a2e[0x1]:_0x260aa5;}Dialer['prototype'][_0xc40a('0x175')]=function(_0x5e3f43,_0x505a4b){var _0x55a8db=this;var _0x11cd46=uuid['v4']();this[_0xc40a('0x25')][_0x11cd46]=new Action(_0x5e3f43,_0x505a4b,_0x11cd46);return new BPromise(function(_0x167b91,_0x6c76e4){if(_[_0xc40a('0x3a')](_0x5e3f43)&&typeof _0x5e3f43!=='object'){return _0x6c76e4(msgResponse(_0xc40a('0x176'),_0xc40a('0x14d'),_0xc40a('0x177')));}if(_['isUndefined'](_0x505a4b[_0xc40a('0x178')])||_0x505a4b[_0xc40a('0x178')]===null){return _0x6c76e4(msgResponse(_0xc40a('0x176'),'Failure',_0xc40a('0x179')));}var _0x3ae658={'XMD-CALLERID':_0x55a8db[_0xc40a('0x25')][_0x11cd46][_0xc40a('0x17a')](),'XMD-AGI':_0x5e3f43[_0xc40a('0x10f')]?util[_0xc40a('0x78')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5e3f43[_0xc40a('0x10f')]):'NONE','XMD-AGIAFTER':_0x5e3f43[_0xc40a('0x120')]?util['format'](_0xc40a('0x17b'),ipAgi,_0x5e3f43[_0xc40a('0x120')]):_0xc40a('0x17c'),'XMD-QUEUE':_0x5e3f43['type']===_0xc40a('0x4c')?util['format'](_0xc40a('0x17d'),_0x5e3f43[_0xc40a('0x3d')],_0x5e3f43['dialQueueOptions']||'',_0x5e3f43[_0xc40a('0x114')]?'c':'',_0x5e3f43['dialQueueTimeout']||0x3):_0xc40a('0x17c'),'XMD-CONTACTID':_0x505a4b[_0xc40a('0x10c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x55a8db[_0xc40a('0x25')][_0x11cd46][_0xc40a('0x17a')](),'XMD-AMD':_0x5e3f43[_0xc40a('0xe6')]?_0xc40a('0x17e'):_0xc40a('0x17c'),'XMD-DESTINATION':_0xc40a('0xe5')};if(_0x5e3f43[_0xc40a('0xe6')]){_0x3ae658[_0xc40a('0x17f')]=_0x5e3f43['dialAMDInitialSilence']||0x9c4;_0x3ae658[_0xc40a('0x180')]=_0x5e3f43[_0xc40a('0x181')]||0x5dc;_0x3ae658[_0xc40a('0x182')]=_0x5e3f43[_0xc40a('0x183')]||0x320;_0x3ae658[_0xc40a('0x184')]=_0x5e3f43[_0xc40a('0x185')]||0x1388;_0x3ae658[_0xc40a('0x186')]=_0x5e3f43[_0xc40a('0x187')]||0x64;_0x3ae658[_0xc40a('0x188')]=_0x5e3f43[_0xc40a('0x189')]||0x32;_0x3ae658[_0xc40a('0x18a')]=_0x5e3f43[_0xc40a('0x18b')]||0x3;_0x3ae658[_0xc40a('0x18c')]=_0x5e3f43[_0xc40a('0x18d')]||0x100;_0x3ae658['XMD-AMDMAXIMUMWORDLENGTH']=_0x5e3f43[_0xc40a('0x18e')]||0x1388;}if(_0x5e3f43['type']===_0xc40a('0x4c')){_0x3ae658[_0xc40a('0x18f')]=_0x505a4b[_0xc40a('0x102')];}else{_0x3ae658[_0xc40a('0x190')]=_0x505a4b[_0xc40a('0xda')];}for(var _0x382d7c in _0x505a4b[_0xc40a('0x191')]){if(typeof _0x505a4b[_0xc40a('0x191')][_0x382d7c]!==_0xc40a('0x9b')){if(isNotNull(_0x505a4b[_0xc40a('0x191')][_0x382d7c])&&_0x382d7c!=='id'&&_0x382d7c!==_0xc40a('0x192')&&_0x382d7c!==_0xc40a('0x193')&&_0x382d7c!==_0xc40a('0x194')){_0x3ae658[util['format']('%s%s',_0xc40a('0x195'),_[_0xc40a('0x196')](_0x382d7c))]=_0x505a4b[_0xc40a('0x191')][_0x382d7c];}}}var _0x209342=_0x55a8db[_0xc40a('0x14a')](_0x5e3f43[_0xc40a('0x74')])?getCallerId(_0x5e3f43['Trunk'][_0xc40a('0x76')],_0x5e3f43['dialOriginateCallerIdName'],_0x5e3f43[_0xc40a('0x197')]>0x0?getCallerIdRandom(_0x5e3f43[_0xc40a('0x5b')],_0x5e3f43['dialRandomLastDigitCallerIdNumber']):_0x5e3f43[_0xc40a('0x5b')]):getCallerId(_[_0xc40a('0xaf')](_0x5e3f43[_0xc40a('0x198')])?_0x5e3f43[_0xc40a('0x74')][_0xc40a('0x76')]:_0x5e3f43[_0xc40a('0x198')][_0xc40a('0x76')],_0x5e3f43[_0xc40a('0x5a')],_0x5e3f43['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x5e3f43['dialOriginateCallerIdNumber'],_0x5e3f43[_0xc40a('0x197')]):_0x5e3f43[_0xc40a('0x5b')]);if(_0x209342){_0x3ae658[_0xc40a('0x199')]=_0x55a8db[_0xc40a('0x25')][_0x11cd46]['originatecalleridname']=extractCalleridName(_0x209342);_0x3ae658[_0xc40a('0x19a')]=_0x505a4b[_0xc40a('0x178')];}return ami[_0xc40a('0x154')]({'actionid':_0x11cd46,'action':'originate','channel':_0x55a8db[_0xc40a('0x14a')](_0x5e3f43[_0xc40a('0x74')])?util['format'](_0xc40a('0x19b'),_0x5e3f43[_0xc40a('0x74')][_0xc40a('0x3d')],isNotNull(_0x5e3f43[_0xc40a('0x5d')])?_0x5e3f43['dialPrefix'][_0xc40a('0x19c')]()||'':'',_0x5e3f43['dialCutDigit']>0x0?_0x505a4b[_0xc40a('0x178')][_0xc40a('0x19d')](_0x5e3f43['dialCutDigit']):_0x505a4b[_0xc40a('0x178')]):util[_0xc40a('0x78')]('SIP/%s/%s%s',_[_0xc40a('0xaf')](_0x5e3f43[_0xc40a('0x198')])?_0x5e3f43['Trunk']['name']:_0x5e3f43[_0xc40a('0x198')][_0xc40a('0x3d')],isNotNull(_0x5e3f43[_0xc40a('0x5d')])?_0x5e3f43['dialPrefix'][_0xc40a('0x19c')]()||'':'',_0x5e3f43[_0xc40a('0x19e')]>0x0?_0x505a4b[_0xc40a('0x178')][_0xc40a('0x19d')](_0x5e3f43[_0xc40a('0x19e')]):_0x505a4b['phone']),'callerid':_0x209342,'Exten':_0xc40a('0xe5'),'Context':_0xc40a('0x19f'),'Priority':'1','variable':_0x3ae658,'timeout':(_0x5e3f43[_0xc40a('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x11cd46})[_0xc40a('0xba')](function(_0x331488){return _0x167b91(_0x331488);})[_0xc40a('0xb2')](function(_0xa8cb01){_0x5e3f43['outboundOriginateFailureCallsDay']+=0x1;var _0x5da762=new History(_0x55a8db[_0xc40a('0x25')][_0x11cd46]);logger['error'](util[_0xc40a('0x78')](_0xc40a('0x1a0'),JSON[_0xc40a('0x77')](_0xa8cb01)));_0x5da762[_0xc40a('0xea')]=0xe;_0x5da762[_0xc40a('0xa9')]=_0xc40a('0x1a1');_0x5da762[_0xc40a('0xab')]=moment()[_0xc40a('0x78')](_0xc40a('0x115'));_0x5da762[_0xc40a('0xaa')]=_0x5da762[_0xc40a('0xab')];_0x55a8db['createHistory'](_0x5da762)['catch'](loggerCatch(_0xc40a('0x1a2')));_0x55a8db[_0xc40a('0xd0')](_0x5da762)[_0xc40a('0xb2')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x55a8db[_0xc40a('0x25')][_0x11cd46];return _0x6c76e4(msgResponse(_0xc40a('0x176'),_0xc40a('0x47'),_0xc40a('0x1a3')));});});});};Dialer[_0xc40a('0xac')][_0xc40a('0x1a4')]=function(_0x20b7c9){var _0x51d6fc=this[_0xc40a('0x25')][_0x20b7c9['actionid']];if(_0x51d6fc){delete this[_0xc40a('0x25')][_0x20b7c9[_0xc40a('0x12f')]];_0x51d6fc['responsetime']=moment()[_0xc40a('0x78')](_0xc40a('0x115'));var _0x34bf6f=_0x51d6fc[_0xc40a('0x56')]===_0xc40a('0x95')?this['campaigns'][_0x51d6fc[_0xc40a('0xb6')]]:this['voiceQueues'][_0x51d6fc[_0xc40a('0x1a5')]()];if(!this['isSuccess'](_0x20b7c9[_0xc40a('0x1a6')])){this[_0xc40a('0xb4')](_0x34bf6f);return this[_0xc40a('0x1a7')](_0x51d6fc,_0x34bf6f,_0x20b7c9)['catch'](loggerCatch(_0xc40a('0x1a8')));}this['uniqueId'][_0x20b7c9['uniqueid']]=_0x51d6fc;}};Dialer[_0xc40a('0xac')]['checkRetriveMax']=function(_0x172eaa,_0xd20c07,_0x3b7cbc){var _0x1eef4c=new History(_0xd20c07);if(_0x1eef4c[_0xc40a('0xf6')]+_0x1eef4c[_0xc40a('0xf7')]+_0x1eef4c[_0xc40a('0xf8')]+_0x1eef4c[_0xc40a('0x108')]+_0x1eef4c['countdropretry']+_0x1eef4c[_0xc40a('0xfa')]+_0x1eef4c[_0xc40a('0xf2')]+_0x1eef4c[_0xc40a('0xfb')]>=_0x3b7cbc[_0xc40a('0x109')]-0x1){return!![];}switch(_0x172eaa){case 0x3:if(_0x1eef4c[_0xc40a('0xf8')]>=_0x3b7cbc[_0xc40a('0x1a9')]-0x1){return!![];}this[_0xc40a('0xc6')]({'active':![],'countnoanswerretry':_0x1eef4c[_0xc40a('0xf8')]+=0x1,'scheduledat':moment()[_0xc40a('0x100')](_0x3b7cbc[_0xc40a('0x1aa')],'minutes')[_0xc40a('0x78')](_0xc40a('0x115')),'ContactId':_0x1eef4c[_0xc40a('0x10c')],'ListId':_0x1eef4c['ListId'],'VoiceQueueId':_0x1eef4c[_0xc40a('0x102')]||undefined,'CampaignId':_0x1eef4c[_0xc40a('0xda')]||undefined})['catch'](loggerCatch(_0xc40a('0x1ab')));break;case 0x5:if(_0x1eef4c[_0xc40a('0xf6')]>=_0x3b7cbc[_0xc40a('0x1ac')]-0x1){return!![];}this[_0xc40a('0xc6')]({'active':![],'countbusyretry':_0x1eef4c['countbusyretry']+=0x1,'scheduledat':moment()[_0xc40a('0x100')](_0x3b7cbc[_0xc40a('0x1ad')],_0xc40a('0x10b'))[_0xc40a('0x78')](_0xc40a('0x115')),'ContactId':_0x1eef4c[_0xc40a('0x10c')],'ListId':_0x1eef4c['ListId'],'VoiceQueueId':_0x1eef4c[_0xc40a('0x102')]||undefined,'CampaignId':_0x1eef4c[_0xc40a('0xda')]||undefined})[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x1ae')));break;case 0x8:if(_0x1eef4c[_0xc40a('0xf7')]>=_0x3b7cbc[_0xc40a('0x1af')]-0x1){return!![];}this[_0xc40a('0xc6')]({'active':![],'countcongestionretry':_0x1eef4c[_0xc40a('0xf7')]+=0x1,'scheduledat':moment()[_0xc40a('0x100')](_0x3b7cbc[_0xc40a('0x1b0')],_0xc40a('0x10b'))[_0xc40a('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1eef4c[_0xc40a('0x10c')],'ListId':_0x1eef4c[_0xc40a('0xd9')],'VoiceQueueId':_0x1eef4c[_0xc40a('0x102')]||undefined,'CampaignId':_0x1eef4c[_0xc40a('0xda')]||undefined})[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x1b1')));break;case 0x0:if(_0x1eef4c[_0xc40a('0x108')]>=_0x3b7cbc[_0xc40a('0x1b2')]-0x1){return!![];}else{this[_0xc40a('0xc6')]({'active':![],'countnosuchnumberretry':_0x1eef4c[_0xc40a('0x108')]+=0x1,'scheduledat':moment()[_0xc40a('0x100')](_0x3b7cbc[_0xc40a('0x1b3')],_0xc40a('0x10b'))[_0xc40a('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1eef4c[_0xc40a('0x10c')],'ListId':_0x1eef4c[_0xc40a('0xd9')],'VoiceQueueId':_0x1eef4c[_0xc40a('0x102')]||undefined,'CampaignId':_0x1eef4c[_0xc40a('0xda')]||undefined})[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x1b4')));}break;case 0xa:if(_0x1eef4c[_0xc40a('0xf9')]>=_0x3b7cbc[_0xc40a('0x1b5')]-0x1){return!![];}this[_0xc40a('0xc6')]({'active':![],'countdropretry':_0x1eef4c[_0xc40a('0xf9')]+=0x1,'scheduledat':moment()[_0xc40a('0x100')](_0x3b7cbc[_0xc40a('0x121')],_0xc40a('0x10b'))[_0xc40a('0x78')](_0xc40a('0x115')),'ContactId':_0x1eef4c[_0xc40a('0x10c')],'ListId':_0x1eef4c[_0xc40a('0xd9')],'VoiceQueueId':_0x1eef4c[_0xc40a('0x102')]||undefined,'CampaignId':_0x1eef4c[_0xc40a('0xda')]||undefined})['catch'](loggerCatch(_0xc40a('0x124')));break;case 0xb:if(_0x1eef4c[_0xc40a('0xfa')]>=_0x3b7cbc['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xc40a('0xc6')]({'active':![],'countabandonedretry':_0x1eef4c[_0xc40a('0xfa')]+=0x1,'scheduledat':moment()[_0xc40a('0x100')](_0x3b7cbc['dialAbandonedRetryFrequency'],_0xc40a('0x10b'))['format'](_0xc40a('0x115')),'ContactId':_0x1eef4c['ContactId'],'ListId':_0x1eef4c['ListId'],'VoiceQueueId':_0x1eef4c[_0xc40a('0x102')]||undefined,'CampaignId':_0x1eef4c[_0xc40a('0xda')]||undefined})['catch'](loggerCatch(_0xc40a('0x12d')));break;case 0x13:if(_0x1eef4c[_0xc40a('0xf2')]>=_0x3b7cbc[_0xc40a('0x10a')]-0x1){return!![];}this[_0xc40a('0xc6')]({'active':![],'countmachineretry':_0x1eef4c['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x3b7cbc[_0xc40a('0x101')],_0xc40a('0x10b'))['format'](_0xc40a('0x115')),'ContactId':_0x1eef4c[_0xc40a('0x10c')],'ListId':_0x1eef4c[_0xc40a('0xd9')],'VoiceQueueId':_0x1eef4c[_0xc40a('0x102')]||undefined,'CampaignId':_0x1eef4c[_0xc40a('0xda')]||undefined})[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x103')));break;case 0x14:if(_0x1eef4c[_0xc40a('0xfb')]>=_0x3b7cbc[_0xc40a('0x1b6')]-0x1){return!![];}this[_0xc40a('0xc6')]({'active':![],'countagentrejectretry':_0x1eef4c[_0xc40a('0xfb')]+=0x1,'scheduledat':moment()[_0xc40a('0x100')](_0x3b7cbc[_0xc40a('0x1b7')],'minutes')['format'](_0xc40a('0x115')),'ContactId':_0x1eef4c[_0xc40a('0x10c')],'ListId':_0x1eef4c[_0xc40a('0xd9')],'VoiceQueueId':_0x1eef4c[_0xc40a('0x102')]||undefined,'CampaignId':_0x1eef4c[_0xc40a('0xda')]||undefined})['catch'](loggerCatch(_0xc40a('0x1b8')));break;default:return!![];}};Dialer[_0xc40a('0xac')][_0xc40a('0x1a7')]=function(_0x3550c1,_0x2e76b3,_0x272ca9){var _0x28e236=this;var _0x4c17fb=new History(_0x3550c1);var _0x2c81b2=![];var _0x385b58;var _0x5e5e41;return new BPromise(function(_0xc7c222,_0x1f028c){if(_[_0xc40a('0x3a')](_0x2e76b3)&&typeof _0x2e76b3!=='object'){return _0x1f028c(msgResponse(_0xc40a('0x1b9'),_0xc40a('0x14d'),'entity\x20is\x20undefine'));}if(_[_0xc40a('0x3a')](_0x272ca9)&&typeof _0x272ca9!==_0xc40a('0x1ba')){return _0x1f028c(msgResponse(_0xc40a('0x1b9'),'Failure',_0xc40a('0x1bb')));}_0x28e236[_0xc40a('0xbe')](_0x4c17fb,_0x272ca9['reason'],_0x2e76b3)['then'](function(_0x336b03){if(_0x336b03[_0xc40a('0x123')]==0x1)_0x2c81b2=!![];switch(_0x272ca9[_0xc40a('0x111')]){case'0':_0x2e76b3[_0xc40a('0x64')]+=0x1;_0x4c17fb[_0xc40a('0xea')]=0x0;_0x4c17fb['statedesc']=_0xc40a('0x1bc');_0x4c17fb[_0xc40a('0x108')]+=0x1;_0x4c17fb['countglobal']+=0x1;ami[_0xc40a('0x4b')](_0xc40a('0x1bd'),ut[_0xc40a('0xec')](_0x3550c1,_0xc40a('0x1be')));_0x385b58=_0x2e76b3[_0xc40a('0x1b3')];_0x5e5e41=_0x2e76b3[_0xc40a('0x12a')];_0x28e236['createHistory'](_0x4c17fb)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xf5')));if(_0x28e236[_0xc40a('0x1bf')](0x0,_0x3550c1,_0x2e76b3)&&!_0x2c81b2){if(_0x4c17fb[_0xc40a('0x108')]>=_0x2e76b3['dialNoSuchNumberMaxRetry']){_0x28e236[_0xc40a('0xfe')](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1c0'));}else{_0x28e236[_0xc40a('0xfc')](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1c0'));}}break;case'3':_0x2e76b3['outboundNoAnswerCallsDay']+=0x1;_0x4c17fb[_0xc40a('0xea')]=0x3;_0x4c17fb['statedesc']=_0xc40a('0x1c1');_0x4c17fb[_0xc40a('0xf8')]+=0x1;_0x4c17fb['countglobal']+=0x1;ami['emit']('custom:agentnoanswer',ut[_0xc40a('0xec')](_0x3550c1,_0xc40a('0x1c2')));_0x385b58=_0x2e76b3[_0xc40a('0x1aa')];_0x5e5e41=_0x2e76b3[_0xc40a('0x12a')];_0x28e236['createHistory'](_0x4c17fb)['catch'](loggerCatch(_0xc40a('0x1c3')));if(_0x28e236[_0xc40a('0x1bf')](0x3,_0x3550c1,_0x2e76b3)&&!_0x2c81b2){if(_0x4c17fb[_0xc40a('0xf8')]>=_0x2e76b3[_0xc40a('0x1a9')]){_0x28e236[_0xc40a('0xfe')](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1c4'));}else{_0x28e236['stateGlobal'](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1c4'));}}break;case'5':_0x2e76b3[_0xc40a('0x60')]+=0x1;_0x4c17fb[_0xc40a('0xea')]=0x5;_0x4c17fb[_0xc40a('0xa9')]=_0xc40a('0x1c5');_0x4c17fb['countbusyretry']+=0x1;_0x4c17fb[_0xc40a('0xf3')]+=0x1;ami[_0xc40a('0x4b')](_0xc40a('0x1c6'),ut[_0xc40a('0xec')](_0x3550c1,'busy'));_0x385b58=_0x2e76b3[_0xc40a('0x1ad')];_0x5e5e41=_0x2e76b3[_0xc40a('0x12a')];_0x28e236[_0xc40a('0xd2')](_0x4c17fb)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x1c7')));if(_0x28e236[_0xc40a('0x1bf')](0x5,_0x3550c1,_0x2e76b3)&&!_0x2c81b2){if(_0x4c17fb[_0xc40a('0xf6')]>=_0x2e76b3[_0xc40a('0x1ac')]){_0x28e236[_0xc40a('0xfe')](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1c8'));}else{_0x28e236[_0xc40a('0xfc')](_0x4c17fb,_0xc7c222,_0x1f028c,'reason\x205\x20busy');}}break;case'8':_0x2e76b3[_0xc40a('0x1c9')]+=0x1;_0x4c17fb[_0xc40a('0xea')]=0x8;_0x4c17fb[_0xc40a('0xa9')]=_0xc40a('0x1ca');_0x4c17fb[_0xc40a('0xf7')]+=0x1;_0x4c17fb[_0xc40a('0xf3')]+=0x1;_0x385b58=_0x2e76b3[_0xc40a('0x1b0')];_0x5e5e41=_0x2e76b3[_0xc40a('0x12a')];ami[_0xc40a('0x4b')]('custom:agentcongestion',ut[_0xc40a('0xec')](_0x3550c1,_0xc40a('0x1cb')));_0x28e236[_0xc40a('0xd2')](_0x4c17fb)['catch'](loggerCatch(_0xc40a('0x1cc')));if(_0x28e236[_0xc40a('0x1bf')](0x8,_0x3550c1,_0x2e76b3)&&!_0x2c81b2){if(_0x4c17fb['countcongestionretry']>=_0x2e76b3[_0xc40a('0x1af')]){_0x28e236[_0xc40a('0xfe')](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1cd'));}else{_0x28e236['stateGlobal'](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1cd'));}}break;case'11':_0x2e76b3['outboundAbandonedCallsDay']+=0x1;_0x4c17fb[_0xc40a('0xea')]=0xb;_0x4c17fb['statedesc']=_0xc40a('0x128');_0x4c17fb[_0xc40a('0xfa')]+=0x1;_0x4c17fb['countglobal']+=0x1;_0x385b58=_0x2e76b3[_0xc40a('0x12c')];_0x5e5e41=_0x2e76b3['callAdditionalPhoneAfterMin'];_0x28e236[_0xc40a('0xd2')](_0x4c17fb)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x12e')));if(_0x28e236['checkRetriveMax'](0xb,_0x3550c1,_0x2e76b3)&&!_0x2c81b2){if(_0x4c17fb[_0xc40a('0xfa')]>=_0x2e76b3['dialAbandonedMaxRetry']){_0x28e236['createStateFinal'](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1ce'));}else{_0x28e236[_0xc40a('0xfc')](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1ce'));}}break;case'20':_0x2e76b3[_0xc40a('0x66')]+=0x1;_0x4c17fb[_0xc40a('0xea')]=0x14;_0x4c17fb[_0xc40a('0xa9')]=_0xc40a('0x1cf');_0x4c17fb[_0xc40a('0xfb')]+=0x1;_0x4c17fb['countglobal']+=0x1;_0x385b58=_0x2e76b3[_0xc40a('0x1b7')];_0x5e5e41=_0x2e76b3[_0xc40a('0x12a')];ami[_0xc40a('0x4b')](_0xc40a('0x1d0'),ut[_0xc40a('0xec')](_0x3550c1,_0xc40a('0x1d1')));_0x28e236[_0xc40a('0xd2')](_0x4c17fb)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x1d2')));if(_0x28e236[_0xc40a('0x1bf')](0x14,_0x3550c1,_0x2e76b3)&&!_0x2c81b2){if(_0x4c17fb[_0xc40a('0xfb')]>=_0x2e76b3[_0xc40a('0x1b6')]){_0x28e236[_0xc40a('0xfe')](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1d3'));}else{_0x28e236[_0xc40a('0xfc')](_0x4c17fb,_0xc7c222,_0x1f028c,_0xc40a('0x1d3'));}}break;default:_0x2e76b3['outboundUnknownCallsDay']+=0x1;_0x4c17fb[_0xc40a('0xea')]=0xc;_0x4c17fb[_0xc40a('0xa9')]=_0x272ca9['reason'];_0x385b58=_0x2e76b3[_0xc40a('0x1b7')];_0x5e5e41=_0x2e76b3['callAdditionalPhoneAfterMin'];_0x28e236['createHistory'](_0x4c17fb)[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x1d4')));if(_0x28e236[_0xc40a('0x1bf')](_0x272ca9[_0xc40a('0x111')],_0x3550c1,_0x2e76b3)&&!_0x2c81b2){if(_0x4c17fb[_0xc40a('0xf6')]+_0x4c17fb['countcongestionretry']+_0x4c17fb[_0xc40a('0xf8')]+_0x4c17fb[_0xc40a('0x108')]+_0x4c17fb['countdropretry']+_0x4c17fb[_0xc40a('0xfa')]+_0x4c17fb[_0xc40a('0xf2')]+_0x4c17fb['countagentrejectretry']>=_0x2e76b3[_0xc40a('0x109')]){_0x28e236[_0xc40a('0xfc')](_0x4c17fb,_0xc7c222,_0x1f028c,_0x272ca9[_0xc40a('0x111')]);}else{_0x28e236[_0xc40a('0xfe')](_0x4c17fb,_0xc7c222,_0x1f028c,_0x272ca9[_0xc40a('0x111')]);}}}})[_0xc40a('0xba')](function(_0x33cb57){if(_0x2c81b2){_0x28e236['swapAdditionalPhones'](_0x4c17fb,_0x385b58,_0x5e5e41)[_0xc40a('0xba')](function(_0x347f98){return _0xc7c222(0x1);});}});});};Dialer[_0xc40a('0xac')][_0xc40a('0xfc')]=function(_0x22d686,_0x19c199,_0x113d01,_0x1f389e){var _0x3acad6=new Final(_0x22d686);_0x3acad6[_0xc40a('0xea')]=0xf;_0x3acad6['statedesc']=_0xc40a('0x1d5');this[_0xc40a('0xfe')](_0x3acad6,_0x19c199,_0x113d01,_0x1f389e);};Dialer[_0xc40a('0xac')]['createStateFinal']=function(_0x16f789,_0x4c23aa,_0x54dccd,_0x4517c8){this[_0xc40a('0xd0')](_0x16f789)[_0xc40a('0xba')](function(){return _0x4c23aa(msgResponse(_0xc40a('0x1b9'),_0xc40a('0xdd'),_0x4517c8));})[_0xc40a('0xb2')](function(){return _0x54dccd(msgResponse(_0xc40a('0x1d6'),_0xc40a('0x14d'),_0xc40a('0x1d7')));});};Dialer[_0xc40a('0xac')][_0xc40a('0x168')]=function(_0x3bc08b){var _0x52a0d0=_0x3bc08b[_0xc40a('0x1d8')]/0x64;var _0x506c9f=_0x3bc08b[_0xc40a('0x62')]/(_0x3bc08b[_0xc40a('0x62')]+_0x3bc08b[_0xc40a('0x5e')]);var _0x3ad6d3=Math[_0xc40a('0x1d9')](_0x3bc08b[_0xc40a('0x70')]*(_0x3bc08b['predictiveIntervalMaxThreshold']/0x64));var _0x39a280=Math[_0xc40a('0x1d9')](_0x3bc08b[_0xc40a('0x70')]*(_0x3bc08b[_0xc40a('0x1da')]/0x64));var _0x1433ff=_0x3bc08b['available']+_0x3bc08b[_0xc40a('0x54')];var _0x305f83=Math[_0xc40a('0x1db')](_0x3bc08b[_0xc40a('0x8a')]*_0x3bc08b[_0xc40a('0x72')]*_0x3bc08b['predictiveIntervalHitRate']*_0x3bc08b[_0xc40a('0x1dc')]);if(_[_0xc40a('0x3a')](_0x3bc08b[_0xc40a('0x27')])){if(!_['isUndefined'](_0x3bc08b['startPredictive'])){_0x3bc08b[_0xc40a('0x91')]=undefined;loggerPredictive[_0xc40a('0x99')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xc40a('0x3a')](_0x3bc08b[_0xc40a('0x92')])){loggerPredictive['error'](_0xc40a('0x1dd'),_0xc40a('0x1de'));clearInterval(_0x3bc08b[_0xc40a('0x92')]);_0x3bc08b[_0xc40a('0x92')]=undefined;}_0x3bc08b[_0xc40a('0x27')]=moment()['format'](_0xc40a('0x115'));loggerPredictive[_0xc40a('0x7c')](_0x3bc08b[_0xc40a('0x3d')],_0xc40a('0x1df'),_0x3bc08b[_0xc40a('0x27')]);this[_0xc40a('0x166')](_0x3bc08b,0x1);}else if(ifInterval(_0x3bc08b['dialPredictiveInterval'],_0x3bc08b['startProgressive'])){this[_0xc40a('0x166')](_0x3bc08b,0x1);loggerPredictiveCalls[_0xc40a('0x7c')](_0xc40a('0x1e0'),_0x3bc08b[_0xc40a('0x27')],_0x3bc08b[_0xc40a('0x3d')]);_0x3bc08b['erlangCalls']=0x0;_0x3bc08b[_0xc40a('0x6d')]=0x0;}else if(_0x52a0d0<_0x506c9f&&_0x3bc08b['dialPredictiveOptimization']===_0xc40a('0x1e1')){freeVariablesPredictive(_0x3bc08b);loggerPredictive['info'](_0xc40a('0x1e2'),_0xc40a('0x1e3'),_0x506c9f,'startProgressive',_0x3bc08b[_0xc40a('0x3d')]);}else if(_0x305f83<_0x3bc08b[_0xc40a('0x6d')]&&_0x3bc08b[_0xc40a('0x1e4')]==='dropRate'){freeVariablesPredictive(_0x3bc08b);loggerPredictive[_0xc40a('0x7c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xc40a('0x1e5'),_0x305f83,'Drop\x20in\x20this\x20interval',_0x3bc08b['predictiveIntervalErlangCallsDroppedCalls'],_0xc40a('0x27'),_0x3bc08b[_0xc40a('0x3d')]);}else if(!ifInterval(_0x3bc08b[_0xc40a('0x1e6')],_0x3bc08b[_0xc40a('0x27')])&&_[_0xc40a('0x3a')](_0x3bc08b[_0xc40a('0x91')])&&!_[_0xc40a('0x3a')](_0x3bc08b[_0xc40a('0x27')])){_0x3bc08b[_0xc40a('0x91')]=moment()['format'](_0xc40a('0x115'));loggerPredictive['info'](_0x3bc08b[_0xc40a('0x3d')],_0xc40a('0x1e7'),_0x3bc08b[_0xc40a('0x91')]);this[_0xc40a('0xc4')](_0x3bc08b['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x3bc08b))[_0xc40a('0xba')](mergeDataErlangB(_0x3bc08b))[_0xc40a('0xba')](this[_0xc40a('0x1e8')](_0x3bc08b))['catch'](loggerCatchPredictive(_0xc40a('0x1e9'),_0x3bc08b));}else if(!ifInterval(_0x3bc08b[_0xc40a('0x1e6')],_0x3bc08b[_0xc40a('0x91')])){_0x3bc08b['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3bc08b[_0xc40a('0x91')]=moment()[_0xc40a('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xc40a('0x7c')](_0x3bc08b[_0xc40a('0x3d')],'recalculate\x20predictive\x20at',_0x3bc08b[_0xc40a('0x91')]);clearInterval(_0x3bc08b['handlePredictive']);_0x3bc08b[_0xc40a('0x92')]=undefined;this[_0xc40a('0xc4')](_0x3bc08b[_0xc40a('0x1e6')])[_0xc40a('0xba')](this[_0xc40a('0x1ea')](_0x3bc08b))[_0xc40a('0xba')](mergeDataErlangB(_0x3bc08b))[_0xc40a('0xba')](this[_0xc40a('0x1e8')](_0x3bc08b))[_0xc40a('0xb2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3bc08b));}else if(_0x3bc08b[_0xc40a('0x70')]&&_0x1433ff<_0x3bc08b[_0xc40a('0x70')]-_0x39a280){freeVariablesPredictive(_0x3bc08b);loggerPredictive[_0xc40a('0x7c')](_0x3bc08b[_0xc40a('0x3d')],_0xc40a('0x1eb'),_0x1433ff,')\x20are\x20less\x20than\x20threshold\x20(',_0x3bc08b[_0xc40a('0x70')],'-',_0x39a280,'=',_0x3bc08b[_0xc40a('0x70')]-_0x39a280,')');}else if(_0x3bc08b[_0xc40a('0x70')]&&_0x1433ff>_0x3bc08b[_0xc40a('0x70')]+_0x3ad6d3){freeVariablesPredictive(_0x3bc08b);loggerPredictive['info'](_0x3bc08b[_0xc40a('0x3d')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1433ff,')\x20are\x20more\x20than\x20threshold\x20(',_0x3bc08b[_0xc40a('0x70')],'+',_0x3ad6d3,'=',_0x3bc08b[_0xc40a('0x70')]+_0x3ad6d3,')');}};Dialer[_0xc40a('0xac')][_0xc40a('0x1ea')]=function(_0x26fd6e){var _0x4526bc=this;return function(_0x4105f1){return new BPromise(function(_0x148149,_0x2b1941){_[_0xc40a('0x8f')](_0x26fd6e,_0x4105f1[0x0]);if(checkGetDataPredictive(_0x4105f1[0x0])){var _0x49cd43=_0x26fd6e[_0xc40a('0x70')]=_0x26fd6e[_0xc40a('0x54')]+_0x26fd6e[_0xc40a('0x4e')];var _0x28735e=_0x26fd6e[_0xc40a('0x1e6')]*0x3c;var _0x4c85e2=_0x4105f1[0x0][_0xc40a('0x83')]+_0x4105f1[0x0][_0xc40a('0x69')];var _0x5996f2=(_0x4105f1[0x0][_0xc40a('0x68')]+_0x4105f1[0x0][_0xc40a('0x6b')]+_0x4105f1[0x0][_0xc40a('0x6a')])/_0x4105f1[0x0]['predictiveIntervalTotalCalls'];_0x26fd6e[_0xc40a('0x6e')]=_0x5996f2>0x0?_0x5996f2:0x1;switch(_0x26fd6e[_0xc40a('0x1e4')]){case _0xc40a('0x1e1'):var _0x149514=_0x26fd6e[_0xc40a('0x1d8')]/0x64;return _0x4526bc[_0xc40a('0x1ec')](_0x49cd43,_0x28735e,_0x4c85e2,_0x5996f2,_0x149514)[_0xc40a('0xba')](function(_0x234789){return _0x148149(_0x234789);});case _0xc40a('0x1ed'):var _0x9aa493=_0x26fd6e[_0xc40a('0x1d8')]/0x64;return _0x4526bc[_0xc40a('0x1ee')](_0x49cd43,_0x28735e,_0x4c85e2,_0x5996f2,_0x9aa493)['then'](function(_0x3ed0e1){return _0x148149(_0x3ed0e1);});default:return _0x2b1941(msgResponse('[getDataPredictive]',_0xc40a('0x14d'),_0xc40a('0x1ef')));}}else{return _0x2b1941(msgResponse(_0xc40a('0x1f0'),_0xc40a('0x14d'),_0xc40a('0x1f1')));}});};};Dialer['prototype'][_0xc40a('0x1f2')]=function(_0x3c4b36){var _0x1552a9=this;return function(_0x278a41){return new BPromise(function(_0x419357,_0xb0cce9){_[_0xc40a('0x8f')](_0x3c4b36,_0x278a41[0x0]);if(checkGetDataPredictive(_0x278a41[0x0])){loggerPredictive[_0xc40a('0x7c')](JSON[_0xc40a('0x77')](_0x278a41[0x0]));if(_0x3c4b36[_0xc40a('0x1e4')]===_0xc40a('0x1e1')){return _0x1552a9[_0xc40a('0xce')](_0x3c4b36['id'])[_0xc40a('0xba')](function(_0x102cd6){var _0x22b4c6=_0x3c4b36[_0xc40a('0x4f')]-_0x102cd6[0x0][_0xc40a('0x1f3')];var _0x3aa0d8=_0x3c4b36['dialPredictiveInterval']*0x3c;var _0x586edd=_0x278a41[0x0][_0xc40a('0x83')]+_0x278a41[0x0][_0xc40a('0x69')];var _0x4d5f1c=(_0x278a41[0x0][_0xc40a('0x68')]+_0x278a41[0x0][_0xc40a('0x6b')]+_0x278a41[0x0][_0xc40a('0x6a')])/_0x278a41[0x0]['predictiveIntervalTotalCalls'];var _0x33b543=_0x3c4b36['dialPredictiveOptimizationPercentage']/0x64;_0x3c4b36[_0xc40a('0x6f')]=_0x102cd6[0x0][_0xc40a('0x1f3')]||0x0;_0x3c4b36[_0xc40a('0x6e')]=_0x4d5f1c>0x0?_0x4d5f1c:0x1;return _0x1552a9[_0xc40a('0x1ec')](_0x22b4c6,_0x3aa0d8,_0x586edd,_0x4d5f1c,_0x33b543);})[_0xc40a('0xba')](function(_0x5d1ab7){return _0x419357(_0x5d1ab7);})[_0xc40a('0xb2')](function(_0x3ad491){return _0xb0cce9(msgResponse(_0xc40a('0x1f4'),_0xc40a('0x14d'),JSON[_0xc40a('0x77')](_0x3ad491)));});}if(_0x3c4b36[_0xc40a('0x1e4')]===_0xc40a('0x1ed')){return _0x1552a9['getVoiceQueueRtPauses'](_0x3c4b36['id'])[_0xc40a('0xba')](function(_0x56046a){var _0x4d9570=_0x3c4b36[_0xc40a('0x4f')]-_0x56046a[0x0][_0xc40a('0x1f3')];var _0x3eff4c=_0x3c4b36['dialPredictiveInterval']*0x3c;var _0x4fdb3a=_0x278a41[0x0]['predictiveIntervalAvgTalktime']+_0x278a41[0x0][_0xc40a('0x69')];var _0x3d8291=(_0x278a41[0x0][_0xc40a('0x68')]+_0x278a41[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x278a41[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x278a41[0x0]['predictiveIntervalTotalCalls'];var _0x5604ab=_0x3c4b36[_0xc40a('0x1d8')]/0x64;_0x3c4b36[_0xc40a('0x6f')]=_0x56046a[0x0][_0xc40a('0x1f3')]||0x0;_0x3c4b36[_0xc40a('0x6e')]=_0x3d8291>0x0?_0x3d8291:0x1;return _0x1552a9[_0xc40a('0x1ee')](_0x4d9570,_0x3eff4c,_0x4fdb3a,_0x3d8291,_0x5604ab);})[_0xc40a('0xba')](function(_0x25e7ba){return _0x419357(_0x25e7ba);})[_0xc40a('0xb2')](function(_0x11893b){return _0xb0cce9(msgResponse(_0xc40a('0x1f4'),_0xc40a('0x14d'),JSON[_0xc40a('0x77')](_0x11893b)));});}}else{return _0xb0cce9(msgResponse(_0xc40a('0x1f0'),_0xc40a('0x14d'),'check\x20failure'));}});};};Dialer[_0xc40a('0xac')][_0xc40a('0x1e8')]=function(_0x1d5d77){var _0x1f26a0=this;return function(){var _0x19694b=0x0;var _0x2c47f6=Math['floor'](_0x1d5d77[_0xc40a('0x8c')]*0x3e8);if(_0x2c47f6>0x0){_0x2c47f6=_0x2c47f6<0x64?0x64:_0x2c47f6;loggerPredictive[_0xc40a('0x7c')](_0x1d5d77[_0xc40a('0x3d')],_0xc40a('0x1f5'),_0x2c47f6,_0xc40a('0x48'));_0x1d5d77[_0xc40a('0x92')]=setInterval(function(){_0x1f26a0[_0xc40a('0x92')](_0x1d5d77);loggerPredictiveCalls[_0xc40a('0x7c')](_0xc40a('0x1f6'),_0x19694b+=0x1);},_0x2c47f6);}else{loggerPredictive[_0xc40a('0x7c')](_0x1d5d77['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xc40a('0xac')][_0xc40a('0x1f7')]=function(_0x15aed5,_0x1aa7b0){var _0x12a460=this;return function(_0x2b6bcb){if(_['isEmpty'](_0x2b6bcb)){if(_[_0xc40a('0xaf')](_0x1aa7b0['UserId'])||!_0x1aa7b0[_0xc40a('0x1f8')]){if(_0x15aed5[_0xc40a('0x164')]===_0xc40a('0xa')){_0x15aed5[_0xc40a('0x137')]=_[_0xc40a('0x3a')](_0x15aed5[_0xc40a('0x137')])?!![]:_0x15aed5['queueStatusComplete'];var _0x16ea9f=uuid['v4']();_0x12a460[_0xc40a('0x25')][_0x16ea9f]=new Action(_0x15aed5,_0x1aa7b0,_0x16ea9f);loggerBooked[_0xc40a('0x7c')](_0xc40a('0x1f9'),_0x16ea9f,_0xc40a('0x1fa'),JSON[_0xc40a('0x77')](_0x15aed5[_0xc40a('0x137')]),_0xc40a('0x1fb'),_0x15aed5[_0xc40a('0x3d')]);if(_0x15aed5['queueStatusComplete']){_0x15aed5[_0xc40a('0x137')]=![];_0x12a460['queueBooked'][_0x12a460[_0xc40a('0x25')][_0x16ea9f][_0xc40a('0xb6')]]=[];ami[_0xc40a('0x154')]({'actionid':_0x16ea9f,'action':_0xc40a('0x1fc'),'queue':_0x15aed5['name']})['catch'](function(){_0x12a460[_0xc40a('0xb4')](_0x15aed5);_0x12a460['rescheduleContact']({'active':![],'ContactId':_0x12a460[_0xc40a('0x25')][_0x16ea9f][_0xc40a('0x10c')],'ListId':_0x12a460[_0xc40a('0x25')][_0x16ea9f][_0xc40a('0xd9')],'VoiceQueueId':_0x12a460[_0xc40a('0x25')][_0x16ea9f][_0xc40a('0x102')]||undefined,'CampaignId':_0x12a460[_0xc40a('0x25')][_0x16ea9f]['CampaignId']||undefined})[_0xc40a('0xb2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x12a460[_0xc40a('0x25')][_0x16ea9f];});}else{loggerBooked[_0xc40a('0x7c')](_0xc40a('0x1fd'),JSON[_0xc40a('0x77')](_0x15aed5[_0xc40a('0x137')]),_0xc40a('0x1fb'),_0x15aed5[_0xc40a('0x3d')]);_0x12a460['updateOriginated'](_0x15aed5);_0x12a460[_0xc40a('0xc6')]({'active':![],'ContactId':_0x12a460[_0xc40a('0x25')][_0x16ea9f]['ContactId'],'ListId':_0x12a460[_0xc40a('0x25')][_0x16ea9f][_0xc40a('0xd9')],'VoiceQueueId':_0x12a460[_0xc40a('0x25')][_0x16ea9f][_0xc40a('0x102')]||undefined,'CampaignId':_0x12a460[_0xc40a('0x25')][_0x16ea9f]['CampaignId']||undefined})[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x1fe')));delete _0x12a460[_0xc40a('0x25')][_0x16ea9f];}}else{return _0x12a460[_0xc40a('0x175')](_0x15aed5,_0x1aa7b0);}}else{if(getDiff(_0x1aa7b0['scheduledat'])<_0x15aed5[_0xc40a('0x1ff')]*0x3c){if(_0x1aa7b0[_0xc40a('0x200')]&&!_0x1aa7b0[_0xc40a('0x200')][_0xc40a('0x201')]){_0x12a460[_0xc40a('0x94')][_0xc40a('0x13a')](_0x1aa7b0['id'])['finally'](function(){_0x12a460[_0xc40a('0xb4')](_0x15aed5);});}else{_0x12a460[_0xc40a('0xc8')]({'active':![]},_0x1aa7b0['id'],0x1)[_0xc40a('0x13f')](function(){_0x12a460[_0xc40a('0xb4')](_0x15aed5);});}}else{_0x15aed5[_0xc40a('0x202')]+=0x1;_0x12a460[_0xc40a('0xb4')](_0x15aed5);if(_0x15aed5[_0xc40a('0x203')]){_0x12a460[_0xc40a('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1aa7b0['ContactId'],'ListId':_0x1aa7b0[_0xc40a('0xd9')],'VoiceQueueId':_0x1aa7b0[_0xc40a('0x102')]||undefined,'CampaignId':_0x1aa7b0[_0xc40a('0xda')]||undefined})[_0xc40a('0xb2')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x12a460[_0xc40a('0xd2')](createObjHistory(_0x15aed5,_0x1aa7b0,_0xc40a('0x204'),0x17,_0xc40a('0x205')))[_0xc40a('0xb2')](loggerCatch(_0xc40a('0x206')));}else{_0x12a460['saveInDb'](createObjHistory(_0x15aed5,_0x1aa7b0,'RECALLFAILEDTIMEOUT',0x16,_0xc40a('0x207')),_0xc40a('0x208'),_0xc40a('0x209'));}}}}else{_0x15aed5['outboundBlacklistCallsDay']+=0x1;_0x12a460[_0xc40a('0xd8')](createObjHistory(_0x15aed5,_0x1aa7b0,_0xc40a('0x20a'),0xd,_0xc40a('0x20b')),_0xc40a('0x20c'),'[Originate][MoveBlacklist]');throw _0xc40a('0x20d');}};};Dialer[_0xc40a('0xac')][_0xc40a('0x20e')]=function(_0xc76762){var _0x9c3777=this;var _0x5880a8=_0xc76762['limitCalls']-_0xc76762['originated']-_0xc76762['temp'];emitCampaignSummary(_0xc76762);if(_0x5880a8>0x0){if(_0x5880a8>this[_0xc40a('0x23')]){_0x5880a8=this['maxNumberOriginate'];}_0xc76762[_0xc40a('0xcb')]+=_0x5880a8;this['getContactDialerIvr'](_0xc76762['id'],_0x5880a8,_0xc76762[_0xc40a('0x20f')],_0xc76762)[_0xc40a('0xba')](function(_0x1458c3){_0xc76762[_0xc40a('0xcb')]-=_0x5880a8;_0xc76762[_0xc40a('0xcb')]=_0xc76762[_0xc40a('0xcb')]>0x0?_0xc76762[_0xc40a('0xcb')]:0x0;if(!checkContactEmpty(_0x1458c3)){_0xc76762['message']=_0xc40a('0x210');logger[_0xc40a('0x7c')]('[getContactCampaign2][Empty]'+_0xc76762[_0xc40a('0x3d')]);}else{_0xc76762[_0xc40a('0x71')]+=_0x1458c3['length'];_0xc76762[_0xc40a('0x3b')]=_0xc40a('0x211');for(var _0x4679cd=0x0;_0x4679cd<_0x1458c3['length'];_0x4679cd+=0x1){_0xc76762[_0xc40a('0x212')]+=0x1;if(_[_0xc40a('0xaf')](_0x1458c3[_0x4679cd])||_[_0xc40a('0xaf')](_0x1458c3[_0x4679cd][_0xc40a('0x191')])||_[_0xc40a('0xaf')](_0x1458c3[_0x4679cd][_0xc40a('0x178')])){_0x9c3777[_0xc40a('0xd6')](_0xc40a('0x213'),_0xc76762,_0x1458c3[_0x4679cd]);}else{_0x9c3777[_0xc40a('0xc2')](_['pick'](_0x1458c3[_0x4679cd],['CampaignId','Contact.phone']))[_0xc40a('0xba')](_0x9c3777[_0xc40a('0x1f7')](_0xc76762,_0x1458c3[_0x4679cd]))[_0xc40a('0xb2')](_0x9c3777[_0xc40a('0xd5')](_0xc40a('0x214'),_0xc76762));}}}})[_0xc40a('0xb2')](loggerGetContactDialer(_0xc40a('0x215'),_0xc76762,_0x5880a8));}};Dialer['prototype'][_0xc40a('0x166')]=function(_0x298983,_0x1b74f1){var _0xc3beb3=this;var _0x162853=[];var _0x2fef2e=_0x1b74f1>=0x1?_0x1b74f1:0x1;if(_0x298983['dialMethod']===_0xc40a('0xa')){_0x2fef2e=0x1;}var _0x1789ac=Math[_0xc40a('0x1db')](_0x298983[_0xc40a('0x4e')]*_0x2fef2e)-_0x298983[_0xc40a('0x71')]-_0x298983[_0xc40a('0xcb')];emitVoiceQueueSummary(_0x298983);if(_0x298983['dialLimitQueue']>0x0){var _0x583d9c=_0x298983[_0xc40a('0x216')]-_0x298983['originated']-_0x298983[_0xc40a('0x54')]-_0x298983[_0xc40a('0xcb')]-_0x298983[_0xc40a('0x50')];if(_0x1789ac>_0x583d9c){_0x1789ac=_0x583d9c;}}if(_0x1789ac>0x0){if(_0x298983[_0xc40a('0x164')]===_0xc40a('0xa')){_0x1789ac=0x1;}if(_0x1789ac>this[_0xc40a('0x23')]){_0x1789ac=this[_0xc40a('0x23')];}_0x298983[_0xc40a('0xcb')]+=_0x1789ac;for(var _0x307182 in this[_0xc40a('0x21')]){if(typeof this[_0xc40a('0x21')][_0x307182]!==_0xc40a('0x9b')){if(this['agents'][_0x307182][_0xc40a('0xea')]===_0xc40a('0x217')&&this[_0xc40a('0x21')][_0x307182][_0xc40a('0xb0')]===_0xc40a('0xde')){_0x162853[_0xc40a('0x133')](this['agents'][_0x307182]['id']);}}}this[_0xc40a('0xca')](_0x298983['id'],_0x162853,_0x1789ac,_0x298983['dialOrderByScheduledAt'],_0x298983)[_0xc40a('0xba')](function(_0x494a2e){_0x298983[_0xc40a('0xcb')]-=_0x1789ac;_0x298983[_0xc40a('0xcb')]=_0x298983[_0xc40a('0xcb')]>0x0?_0x298983[_0xc40a('0xcb')]:0x0;if(!checkContactEmpty(_0x494a2e)){_0xc3beb3[_0xc40a('0xb8')](_0x298983)[_0xc40a('0xba')](sendMessageReschedule(_0x298983))[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xbb')));}else{_0x298983['originated']+=_0x494a2e['length'];_0x298983[_0xc40a('0x3b')]=_0x298983[_0xc40a('0x164')]===_0xc40a('0xa')?_0xc40a('0x17e'):_0xc40a('0x211');for(var _0x14286f=0x0;_0x14286f<_0x494a2e[_0xc40a('0x13d')];_0x14286f+=0x1){if(_[_0xc40a('0xaf')](_0x494a2e[_0x14286f])||_[_0xc40a('0xaf')](_0x494a2e[_0x14286f]['Contact'])||_[_0xc40a('0xaf')](_0x494a2e[_0x14286f][_0xc40a('0x178')])){_0xc3beb3[_0xc40a('0xd6')](_0xc40a('0x213'),_0x298983,_0x494a2e[_0x14286f]);}else{_0xc3beb3[_0xc40a('0xbc')](_[_0xc40a('0x134')](_0x494a2e[_0x14286f],[_0xc40a('0x102'),_0xc40a('0x218')]))[_0xc40a('0xba')](_0xc3beb3['checkContactBlack'](_0x298983,_0x494a2e[_0x14286f]))['catch'](_0xc3beb3[_0xc40a('0xd5')](_0xc40a('0x213'),_0x298983));}}}})['catch'](loggerGetContactDialer(_0xc40a('0x219'),_0x298983,_0x1789ac));}};Dialer[_0xc40a('0xac')][_0xc40a('0x92')]=function(_0x20edaf){if(_0x20edaf[_0xc40a('0x216')]>0x0){var _0x31e9e6=_0x20edaf[_0xc40a('0x216')]-_0x20edaf[_0xc40a('0x71')]-_0x20edaf[_0xc40a('0x54')];if(_0x31e9e6>0x0){this[_0xc40a('0x21a')](_0x20edaf);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0xc40a('0x21a')](_0x20edaf);}};Dialer[_0xc40a('0xac')][_0xc40a('0x21a')]=function(_0x15f004){var _0x5b526a=this;var _0xcccee4=[];_0x15f004[_0xc40a('0x71')]+=0x1;for(var _0x520b13 in this[_0xc40a('0x21')]){if(typeof this[_0xc40a('0x21')][_0x520b13]!==_0xc40a('0x9b')){if(this[_0xc40a('0x21')][_0x520b13][_0xc40a('0xea')]===_0xc40a('0x217')&&this[_0xc40a('0x21')][_0x520b13]['status']===_0xc40a('0xde')){_0xcccee4[_0xc40a('0x133')](this['agents'][_0x520b13]['id']);}}}this['getContactDialer'](_0x15f004['id'],_0xcccee4,0x1,_0x15f004['dialOrderByScheduledAt'],_0x15f004)[_0xc40a('0xba')](function(_0x2764a8){if(!checkContactEmpty(_0x2764a8)){checkContactLowerLimitOriginate(_0x15f004,0x1,0x0);_0x5b526a[_0xc40a('0xb8')](_0x15f004)[_0xc40a('0xba')](sendMessageReschedule(_0x15f004))[_0xc40a('0xb2')](loggerCatch(_0xc40a('0xbb')));}else{_0x15f004[_0xc40a('0x3b')]='RUNNING';if(_[_0xc40a('0xaf')](_0x2764a8[0x0])||_[_0xc40a('0xaf')](_0x2764a8[0x0]['Contact'])||_[_0xc40a('0xaf')](_0x2764a8[0x0][_0xc40a('0x178')])){_0x5b526a[_0xc40a('0xd6')](_0xc40a('0x213'),_0x15f004,_0x2764a8[0x0]);}else{_0x5b526a[_0xc40a('0xbc')](_['pick'](_0x2764a8[0x0],['VoiceQueueId',_0xc40a('0x218')]))['then'](_0x5b526a['checkContactBlack'](_0x15f004,_0x2764a8[0x0]))[_0xc40a('0xb2')](_0x5b526a[_0xc40a('0xd5')]('[actionOriginatePredictive]\x20',_0x15f004));}}})[_0xc40a('0xb2')](loggerGetContactDialer(_0xc40a('0x21b'),_0x15f004,0x1));emitVoiceQueueSummary(_0x15f004);};Dialer[_0xc40a('0xac')][_0xc40a('0x1ec')]=function(_0x54e581,_0x4d7bff,_0x156028,_0x492b58,_0x164d84,_0x1126cc){loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x21c'));loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x21d'),_0x54e581);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x21e'),_0x4d7bff);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x21f'),_0x156028);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x220'),_0x492b58);loggerPredictive[_0xc40a('0x7c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x164d84);loggerPredictive['info'](_0xc40a('0x84'));return new BPromise(function(_0x4ce970,_0x31b2b9){if(_0x54e581<=0x0||isNaN(_0x54e581)){return _0x31b2b9(msgResponse(_0xc40a('0x221'),_0xc40a('0x47'),_0xc40a('0x222')+_0x54e581));}if(_0x156028<=0x0||isNaN(_0x156028)){return _0x31b2b9(msgResponse(_0xc40a('0x221'),'Error',_0xc40a('0x223')+_0x156028));}if(_0x492b58<=0x0||isNaN(_0x492b58)){return _0x31b2b9(msgResponse(_0xc40a('0x221'),'Error',_0xc40a('0x224')+_0x492b58));}if(_0x4d7bff<=0x0||isNaN(_0x4d7bff)){return _0x31b2b9(msgResponse(_0xc40a('0x221'),'Error','interval\x20=\x20'+_0x4d7bff));}if(_0x164d84<=0x0||isNaN(_0x164d84)){return _0x31b2b9(msgResponse('[abandonmentRate]',_0xc40a('0x47'),_0xc40a('0x225')+_0x164d84));}_0x1126cc=_0x1126cc||0x0;var _0x485160=0x1/_0x156028;var _0x16d6a0=0x0;var _0xa84de9=0x0;var _0x51256e=0x0;var _0x391975=0x0;for(var _0x40ee48=0x0;_0x51256e<_0x164d84;_0x40ee48+=0x1){_0xa84de9=_0x40ee48/_0x4d7bff;_0x16d6a0=(_0x492b58*_0xa84de9+_0x1126cc)/_0x485160;_0x51256e=erlangb(_0x16d6a0,_0x54e581);_0x391975=_0x16d6a0/_0x54e581*(0x1-erlangb(_0x16d6a0,_0x54e581));}return _0x4ce970({'erlangCalls':_0x40ee48,'erlangCallToSecond':_0x4d7bff/_0x40ee48,'erlangAbandonmentRate':_0x51256e,'erlangBusyFactor':_0x391975});});};Dialer[_0xc40a('0xac')][_0xc40a('0x1ee')]=function(_0x2df0d4,_0x4a85aa,_0x24a963,_0x2951b3,_0xee95c9,_0x78264c){loggerPredictive['info'](_0xc40a('0x226'));loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x21d'),_0x2df0d4);loggerPredictive['info'](_0xc40a('0x21e'),_0x4a85aa);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x21f'),_0x24a963);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x220'),_0x2951b3);loggerPredictive[_0xc40a('0x7c')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xee95c9);loggerPredictive[_0xc40a('0x7c')](_0xc40a('0x84'));return new BPromise(function(_0x454201,_0x3120ff){if(_0x2df0d4<=0x0||isNaN(_0x2df0d4)){return _0x3120ff(msgResponse(_0xc40a('0x227'),_0xc40a('0x47'),_0xc40a('0x222')+_0x2df0d4));}if(_0x24a963<=0x0||isNaN(_0x24a963)){return _0x3120ff(msgResponse(_0xc40a('0x227'),'Error',_0xc40a('0x223')+_0x24a963));}if(_0x2951b3<=0x0||isNaN(_0x2951b3)){return _0x3120ff(msgResponse(_0xc40a('0x227'),'Error',_0xc40a('0x224')+_0x2951b3));}if(_0x4a85aa<=0x0||isNaN(_0x4a85aa)){return _0x3120ff(msgResponse(_0xc40a('0x227'),'Error',_0xc40a('0x228')+_0x4a85aa));}if(_0xee95c9<=0x0||isNaN(_0xee95c9)){return _0x3120ff(msgResponse(_0xc40a('0x227'),'Error','Umin\x20=\x20'+_0xee95c9));}_0x78264c=_0x78264c||0x0;var _0x345da4=0x1/_0x24a963;var _0x443f69=0x0;var _0x428aba=0x0;var _0xe41dec=0x0;var _0x43f2e1=0x0;for(var _0x46c738=0x0;_0x43f2e1<_0xee95c9;_0x46c738+=0x1){_0x428aba=_0x46c738/_0x4a85aa;_0x443f69=(_0x2951b3*_0x428aba+_0x78264c)/_0x345da4;_0xe41dec=erlangb(_0x443f69,_0x2df0d4);_0x43f2e1=_0x443f69/_0x2df0d4*(0x1-erlangb(_0x443f69,_0x2df0d4));}return _0x454201({'erlangCalls':_0x46c738,'erlangCallToSecond':_0x4a85aa/_0x46c738,'erlangAbandonmentRate':_0xe41dec,'erlangBusyFactor':_0x43f2e1});});};module[_0xc40a('0x229')]=Dialer;
\ No newline at end of file
+var _0x3c8e=['[originate][error]','originate\x20action\x20Error','responsetime','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalAnsweredCalls','[CatchErlangB]','[getDataPredictive]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','interval\x20=\x20','Umin\x20=\x20','util','lodash','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperBlack','./action','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncQueueSummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','available','pTalking','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','[uniqueid]','clearZombieChannels','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','resolve','then','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','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','unmonitored','uniqueId','uniqueid','variable','amdstatus','exten','value','HANGUP','HangupInAMD','custom:amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','membername','AMD','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','buildObj','[syncHangupInAMDIvr]','Machine','countglobal','dialGlobalMaxRetry','add','[syncHangupIvr][createHistory]','AnswerAGI','AGI','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','cause-txt','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','Drop','dropreason','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','push','iftime\x20%s,%s','content','indexOf','true','command','all','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','checkIfTime','dialGlobalInterval','dialTimezone','[syncQueueSummary]','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','Contact','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','OriginateError'];(function(_0x5a3604,_0x3d15b5){var _0x17ce7e=function(_0x1ccff8){while(--_0x1ccff8){_0x5a3604['push'](_0x5a3604['shift']());}};_0x17ce7e(++_0x3d15b5);}(_0x3c8e,0x89));var _0xe3c8=function(_0x972b14,_0x1186c6){_0x972b14=_0x972b14-0x0;var _0x2157ee=_0x3c8e[_0x972b14];return _0x2157ee;};'use strict';var util=require(_0xe3c8('0x0'));var _=require(_0xe3c8('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xe3c8('0x2'));var rr=require('rr');var md5=require(_0xe3c8('0x3'));var Redis=require(_0xe3c8('0x4'));var ut=require('../preview/util/util');var config=require(_0xe3c8('0x5'));var logger=require(_0xe3c8('0x6'))(_0xe3c8('0x7'));var loggerBooked=require(_0xe3c8('0x6'))('booked');var loggerPredictive=require(_0xe3c8('0x6'))(_0xe3c8('0x8'));var loggerPredictiveCalls=require(_0xe3c8('0x6'))(_0xe3c8('0x9'));var loggerSyncQueueSummary=require(_0xe3c8('0x6'))('syncQueueSummary');var ami=require(_0xe3c8('0xa'));config['redis']=_[_0xe3c8('0xb')](config[_0xe3c8('0xc')],{'host':_0xe3c8('0xd'),'port':0x18eb});var io=require(_0xe3c8('0xe'))(new Redis(config['redis']));var cmHopper=require(_0xe3c8('0xf'));var cmHopperHistory=require(_0xe3c8('0x10'));var cmHopperFinal=require(_0xe3c8('0x11'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0xe3c8('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xe3c8('0x13'));var History=require('./history');var Final=require('./final');var AgentComplete=require(_0xe3c8('0x14'));var QueueCallerAbandon=require(_0xe3c8('0x15'));var Hangup=require(_0xe3c8('0x16'));var ipAgi=process['env'][_0xe3c8('0x17')]||_0xe3c8('0x18');var strategy={'rrmemory':_0xe3c8('0x19'),'roundrobin':_0xe3c8('0x1a')};var Sequence=function(){};Sequence[_0xe3c8('0x1b')][_0xe3c8('0x1c')]=function(_0x4c9604){this[_0xe3c8('0x1d')]=this[_0xe3c8('0x1d')]?this['tail'][_0xe3c8('0x1e')](_0x4c9604):_0x4c9604();};function Dialer(_0x10d57b,_0x17e26c){this['sequence']=new Sequence();this[_0xe3c8('0x1f')]=_0x17e26c;this[_0xe3c8('0x20')]=_0x10d57b[_0xe3c8('0x20')];this[_0xe3c8('0x21')]=_0x10d57b[_0xe3c8('0x21')];this[_0xe3c8('0x22')]=_0x10d57b[_0xe3c8('0x22')];this['trunks']=_0x10d57b[_0xe3c8('0x23')];this[_0xe3c8('0x24')]=config[_0xe3c8('0x24')]||0x2;this[_0xe3c8('0x25')]={};this[_0xe3c8('0x26')]={};this[_0xe3c8('0x27')]={};this['uniqueId']={};this[_0xe3c8('0x28')]={};this[_0xe3c8('0x29')]={};this['startProgressive']={};this[_0xe3c8('0x2a')]={};this[_0xe3c8('0x2b')]={};this['queueBookedRR']={};ami['on'](_0xe3c8('0x2c'),this[_0xe3c8('0x2d')]['bind'](this));ami['on'](_0xe3c8('0x2e'),this[_0xe3c8('0x2f')][_0xe3c8('0x30')](this));ami['on'](_0xe3c8('0x31'),this[_0xe3c8('0x32')]['bind'](this));ami['on'](_0xe3c8('0x33'),this['syncAgentComplete']['bind'](this));ami['on']('custom:queuesummary',this[_0xe3c8('0x34')]['bind'](this));ami['on'](_0xe3c8('0x35'),this[_0xe3c8('0x36')]['bind'](this));ami['on'](_0xe3c8('0x37'),this['syncNewExten'][_0xe3c8('0x30')](this));ami['on'](_0xe3c8('0x38'),this[_0xe3c8('0x39')][_0xe3c8('0x30')](this));ami['on'](_0xe3c8('0x3a'),this[_0xe3c8('0x3b')][_0xe3c8('0x30')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xe3c8('0x30')](this));this[_0xe3c8('0x3c')]();this[_0xe3c8('0x3d')]();}function isNotNull(_0x564b86){return _0x564b86!==null&&!_[_0xe3c8('0x3e')](_0x564b86);}function checkIsLoggedIn(_0x266399,_0x2c928a){return function(){if(_0x2c928a<=0x0){_0x266399[_0xe3c8('0x3f')]='AGENTS_NOT_LOGGED';throw _0x266399[_0xe3c8('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x364fa3){return _0x364fa3;}function checkIsActive(_0x96af8e,_0x2df20a){return function(){if(!isActive(_0x2df20a)){_0x96af8e[_0xe3c8('0x3f')]='NOT_ACTIVE';throw _0x96af8e[_0xe3c8('0x40')]+_0xe3c8('0x41');}};}function checkInterval(_0x27df97){return function(){if(!isNotNull(_0x27df97['Interval'])){_0x27df97[_0xe3c8('0x3f')]=_0xe3c8('0x42');throw _0x27df97[_0xe3c8('0x40')]+_0xe3c8('0x43');}if(!isNotNull(_0x27df97[_0xe3c8('0x44')][_0xe3c8('0x45')])){_0x27df97['message']=_0xe3c8('0x42');throw _0x27df97['name']+_0xe3c8('0x43');}if(!isNotNull(_[_0xe3c8('0x46')](_0x27df97[_0xe3c8('0x44')][_0xe3c8('0x45')]))){_0x27df97[_0xe3c8('0x3f')]=_0xe3c8('0x42');throw _0x27df97[_0xe3c8('0x40')]+_0xe3c8('0x43');}};}function msgResponse(_0x553991,_0xc78c55,_0x47cb7c){return{'action':_0x553991,'response':_0xc78c55,'message':_0x47cb7c,'stack':_0x47cb7c};}function myreject(_0x5b8378){return function(_0x3ce1f9){return _0x5b8378(msgResponse(_0xe3c8('0x47'),_0xe3c8('0x48'),JSON[_0xe3c8('0x49')](_0x3ce1f9)));};}function getSeconds(_0x4cdd95,_0x462b04){var _0x4c5f06=moment(_0x4cdd95)[_0xe3c8('0x4a')](0x0);var _0x4138c2=moment(_0x462b04)[_0xe3c8('0x4a')](0x0);return _0x4c5f06[_0xe3c8('0x4b')](_0x4138c2,_0xe3c8('0x4c'));}function emit(_0x543d70,_0x257c02,_0x19f577){io['to'](_0x543d70)[_0xe3c8('0x4d')](_0x257c02,_0x19f577);}function emitVoiceQueueSummary(_0x201217){if(_0x201217[_0xe3c8('0x4e')]==='outbound'){var _0x5322ed={'id':_0x201217['id'],'name':_0x201217[_0xe3c8('0x40')],'strategy':_0x201217[_0xe3c8('0x4f')],'answered':_0x201217[_0xe3c8('0x50')],'available':_0x201217[_0xe3c8('0x51')],'loggedIn':_0x201217['loggedIn'],'pTalking':_0x201217[_0xe3c8('0x52')],'sumBillable':_0x201217['sumBillable'],'sumDuration':_0x201217[_0xe3c8('0x53')],'sumHoldTime':_0x201217[_0xe3c8('0x54')]||0x0,'talking':_0x201217[_0xe3c8('0x55')],'total':_0x201217['total'],'type':_0x201217[_0xe3c8('0x4e')],'unmanaged':_0x201217[_0xe3c8('0x56')],'abandoned':_0x201217[_0xe3c8('0x57')],'waiting':_0x201217[_0xe3c8('0x58')],'loggedInDb':_0x201217[_0xe3c8('0x59')],'dialActive':_0x201217[_0xe3c8('0x5a')],'dialMethod':_0x201217[_0xe3c8('0x5b')],'dialOriginateCallerIdName':_0x201217['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x201217['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x201217[_0xe3c8('0x5c')],'dialPrefix':_0x201217['dialPrefix'],'outboundAnswerAgiCallsDay':_0x201217[_0xe3c8('0x5d')],'outboundAnswerCallsDay':_0x201217[_0xe3c8('0x5e')],'outboundBlacklistCallsDay':_0x201217[_0xe3c8('0x5f')],'outboundBusyCallsDay':_0x201217[_0xe3c8('0x60')],'outboundCongestionCallsDay':_0x201217[_0xe3c8('0x61')],'outboundDropCallsDayACS':_0x201217[_0xe3c8('0x62')],'outboundDropCallsDayCallersExit':_0x201217['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x201217[_0xe3c8('0x63')],'outboundNoAnswerCallsDay':_0x201217[_0xe3c8('0x64')],'outboundNoSuchCallsDay':_0x201217[_0xe3c8('0x65')],'outboundOriginateFailureCallsDay':_0x201217[_0xe3c8('0x66')],'outboundReCallsDay':_0x201217['outboundReCallsDay'],'outboundRejectCallsDay':_0x201217['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x201217['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x201217['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x201217[_0xe3c8('0x67')],'predictiveIntervalAvgTalktime':_0x201217[_0xe3c8('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x201217[_0xe3c8('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x201217['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x201217['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x201217[_0xe3c8('0x6a')],'predictiveIntervalHitRate':_0x201217[_0xe3c8('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x201217[_0xe3c8('0x6c')],'predictiveIntervalPauses':_0x201217[_0xe3c8('0x6d')],'predictiveIntervalAvailable':_0x201217[_0xe3c8('0x6e')],'predictiveIntervalTotalCalls':_0x201217[_0xe3c8('0x6f')],'message':_0x201217[_0xe3c8('0x3f')],'originated':_0x201217['originated'],'erlangCalls':_0x201217[_0xe3c8('0x70')],'erlangCallToSecond':_0x201217[_0xe3c8('0x71')],'erlangAbandonmentRate':_0x201217[_0xe3c8('0x72')],'erlangBusyFactor':_0x201217[_0xe3c8('0x73')],'startPredictive':_0x201217[_0xe3c8('0x29')],'startProgressive':_0x201217[_0xe3c8('0x74')]};if(_0x201217['Trunk']){_0x5322ed[_0xe3c8('0x75')]={'id':_0x201217[_0xe3c8('0x75')]['id'],'name':_0x201217['Trunk']['name'],'active':_0x201217[_0xe3c8('0x75')][_0xe3c8('0x76')],'callerid':_0x201217['Trunk'][_0xe3c8('0x77')]};}if(_0x201217[_0xe3c8('0x44')]){_0x5322ed['Interval']={'id':_0x201217[_0xe3c8('0x44')]['id'],'name':_0x201217[_0xe3c8('0x44')][_0xe3c8('0x40')]};}var _0x16ed1f=md5(JSON[_0xe3c8('0x49')](_0x5322ed));if(_0x201217[_0xe3c8('0x3')]!==_0x16ed1f){_0x201217[_0xe3c8('0x3')]=_0x16ed1f;emit(util['format']('voice:queue:%s',_0x5322ed[_0xe3c8('0x40')]),_0xe3c8('0x78'),_0x5322ed);}}}function emitCampaignSummary(_0xcd39a){if(_0xcd39a[_0xe3c8('0x4e')]===_0xe3c8('0x79')){emit(util['format'](_0xe3c8('0x7a'),_0xcd39a[_0xe3c8('0x40')]),_0xe3c8('0x7b'),_0xcd39a);}}function checkGetDataPredictive(_0x24ac44){if(isNotNull(_0x24ac44)&&!_[_0xe3c8('0x46')](_0x24ac44)){loggerPredictive[_0xe3c8('0x7c')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x7d'),_0x24ac44[_0xe3c8('0x6f')]);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x7e'),_0x24ac44['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0xe3c8('0x7f'),_0x24ac44[_0xe3c8('0x80')]);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x81'),_0x24ac44[_0xe3c8('0x69')]);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x82'),_0x24ac44[_0xe3c8('0x67')]);loggerPredictive[_0xe3c8('0x7c')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24ac44[_0xe3c8('0x68')]);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x83'));if(_0x24ac44['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x24ac44['predictiveIntervalAvgTalktime'])&&_0x24ac44[_0xe3c8('0x68')]>0x0){return!![];}loggerPredictive[_0xe3c8('0x7c')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xe3c8('0x3e')](_0x24ac44[_0xe3c8('0x67')])&&_0x24ac44['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xe3c8('0x7c')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x36a8ce){return function(_0x2e99fb){loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x84'));loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x85'),_0x2e99fb[_0xe3c8('0x70')]);loggerPredictive['info'](_0xe3c8('0x86'),_0x2e99fb[_0xe3c8('0x71')]);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x87'),_0x2e99fb['erlangAbandonmentRate']);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x88'),_0x2e99fb[_0xe3c8('0x73')]);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x87'),_0x2e99fb['erlangAbandonmentRate']);loggerPredictive['info'](_0xe3c8('0x83'));_[_0xe3c8('0x89')](_0x36a8ce,_0x2e99fb);};}function getDiff(_0x22b691){var _0x55671a=moment()[_0xe3c8('0x4a')](0x0);var _0x424cf2=moment(_0x22b691)[_0xe3c8('0x4a')](0x0);return _0x55671a['diff'](_0x424cf2,_0xe3c8('0x4c'));}function ifInterval(_0x5f58cb,_0x7333da){if(_[_0xe3c8('0x3e')](_0x7333da)){return![];}return getDiff(_0x7333da)<_0x5f58cb*0x3c;}function freeVariablesPredictive(_0x126072){if(isNotNull(_0x126072)){if(!_[_0xe3c8('0x3e')](_0x126072['startProgressive'])){_0x126072[_0xe3c8('0x74')]=undefined;loggerPredictive[_0xe3c8('0x7c')](_0x126072[_0xe3c8('0x40')],_0xe3c8('0x8a'));}if(!_[_0xe3c8('0x3e')](_0x126072[_0xe3c8('0x29')])){_0x126072[_0xe3c8('0x29')]=undefined;loggerPredictive['info'](_0x126072[_0xe3c8('0x40')],_0xe3c8('0x8b'));}if(!_[_0xe3c8('0x3e')](_0x126072[_0xe3c8('0x8c')])){clearInterval(_0x126072[_0xe3c8('0x8c')]);_0x126072['handlePredictive']=undefined;loggerPredictive[_0xe3c8('0x7c')](_0x126072[_0xe3c8('0x40')],_0xe3c8('0x8d'));}}}function erlangb(_0x392187,_0x4d8052){if(_0x4d8052===0x0){return 0x0;}var _0x38f7c0=0x1;for(var _0x225413=0x1;_0x225413<=_0x4d8052;_0x225413+=0x1){_0x38f7c0=0x1+_0x38f7c0*_0x225413/_0x392187;}return 0x1/_0x38f7c0;}function isVoiceQueueOutbound(_0x372257){return _0x372257===_0xe3c8('0x8e');}function isNotPreview(_0x21ac27){return _0x21ac27!==_0xe3c8('0x1f');}function isCampaignIvr(_0x321d38){return _0x321d38==='ivr';}function getCallerId(_0x15a0eb,_0x43d8c9,_0x526947){if(!_[_0xe3c8('0x3e')](_0x526947)&&typeof _0x526947===_0xe3c8('0x8f')&&!_['isEmpty'](_0x526947)){if(!_[_0xe3c8('0x3e')](_0x43d8c9)&&typeof _0x43d8c9===_0xe3c8('0x8f')&&!_['isEmpty'](_0x43d8c9)){return util[_0xe3c8('0x90')](_0xe3c8('0x91'),_0x43d8c9,_0x526947);}return util[_0xe3c8('0x90')](_0xe3c8('0x91'),_0x526947,_0x526947);}if(!_['isUndefined'](_0x15a0eb)&&typeof _0x15a0eb===_0xe3c8('0x8f')&&!_['isEmpty'](_0x15a0eb)){return _0x15a0eb;}return _0xe3c8('0x92');}function loggerCatchQueueSummary(_0x22323a,_0x181bf0){return function(_0x3ac8fe){freeVariablesPredictive(_0x181bf0);emitVoiceQueueSummary(_0x181bf0);emitCampaignSummary(_0x181bf0);loggerSyncQueueSummary['error'](_0x22323a,util[_0xe3c8('0x93')](_0x3ac8fe,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x389248,_0x54f692){return function(_0x32612f){loggerPredictive[_0xe3c8('0x94')](_0x54f692['name'],_0x389248);loggerPredictive[_0xe3c8('0x94')](_0x32612f[_0xe3c8('0x95')]);freeVariablesPredictive(_0x54f692);};}function loggerCatch(_0x41cae0){return function(_0x5a61b3){logger[_0xe3c8('0x94')](_0x41cae0,util['inspect'](_0x5a61b3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x484da2){return _0x484da2&&!_[_0xe3c8('0x3e')](_0x484da2)&&_0x484da2[_0xe3c8('0x96')]>0x0;}function decremetOriginate(_0x418d68){if(!_['isUndefined'](_0x418d68)&&_0x418d68!==null){if(typeof _0x418d68[_0xe3c8('0x97')]!==_0xe3c8('0x98')){if(_0x418d68[_0xe3c8('0x97')]>0x0){_0x418d68['originated']-=0x1;}else{logger['error'](_0xe3c8('0x99'));}}}else{logger[_0xe3c8('0x94')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x1b4b89,_0x58b517,_0x4f3c32){if(_0x58b517>_0x4f3c32){for(var _0x358ba2=0x0;_0x358ba2<_0x58b517-_0x4f3c32;_0x358ba2+=0x1){decremetOriginate(_0x1b4b89);}}}function loggerGetContactDialer(_0x806332,_0x185738,_0x215072){return function(_0x34d4d4){checkContactLowerLimitOriginate(_0x185738,_0x215072,0x0);logger[_0xe3c8('0x94')](_0x806332,util[_0xe3c8('0x93')](_0x34d4d4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2e4e33){return function(_0x966021){if(isNotNull(_0x966021)&&isNotNull(_0x966021[0x0])){if(_0x966021[0x0]['contactsRescheduled']>0x0){_0x2e4e33[_0xe3c8('0x3f')]='RESCHEDULED_CONTACTS';logger[_0xe3c8('0x7c')](_0xe3c8('0x9a')+_0x2e4e33[_0xe3c8('0x40')],_0x966021[0x0]['contactsRescheduled'],'contacts');}else{_0x2e4e33[_0xe3c8('0x3f')]=_0xe3c8('0x9b');logger[_0xe3c8('0x7c')](_0xe3c8('0x9c')+_0x2e4e33[_0xe3c8('0x40')]);}}};}function notSendMessagesQueue(_0x38a33a){if(_0x38a33a[_0xe3c8('0x9d')]){freeVariablesPredictive(_0x38a33a);if(_0x38a33a['originated']===0x0&&_0x38a33a[_0xe3c8('0x55')]===0x0&&_0x38a33a['waiting']===0x0&&(_0x38a33a['pTalking']||0x0)===0x0){_0x38a33a['sendMessageOneNotActive']=![];_0x38a33a['available']=0x0;_0x38a33a[_0xe3c8('0x3f')]=_0xe3c8('0x9e');loggerSyncQueueSummary[_0xe3c8('0x94')](_0xe3c8('0x9f'),_0x38a33a[_0xe3c8('0x40')],_0xe3c8('0xa0'));}else{_0x38a33a[_0xe3c8('0x3f')]=_0xe3c8('0xa1');loggerSyncQueueSummary[_0xe3c8('0x94')](_0xe3c8('0x9f'),_0x38a33a[_0xe3c8('0x40')],_0xe3c8('0xa2'));}emitVoiceQueueSummary(_0x38a33a);}}function notSendMessagesCampaign(_0xa2aafa){if(_0xa2aafa['sendMessageOneNotActive']){if(_0xa2aafa['originated']===0x0){_0xa2aafa[_0xe3c8('0x9d')]=![];_0xa2aafa[_0xe3c8('0x3f')]=_0xe3c8('0x9e');loggerSyncQueueSummary[_0xe3c8('0x94')](_0xe3c8('0xa3'),_0xa2aafa[_0xe3c8('0x40')],_0xe3c8('0xa0'));}else{_0xa2aafa[_0xe3c8('0x3f')]=_0xe3c8('0xa1');loggerSyncQueueSummary[_0xe3c8('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xa2aafa[_0xe3c8('0x40')],_0xe3c8('0xa2'));}emitCampaignSummary(_0xa2aafa);}}function createObjHistory(_0x1eb65d,_0x32953d,_0x3588,_0x53fbd5,_0x22879b){_0x1eb65d[_0xe3c8('0x3f')]=_0x3588;var _0x5e5099=new Action(_0x1eb65d,_0x32953d);var _0xa669bd=new History(_0x5e5099);_0xa669bd[_0xe3c8('0xa4')]=_0x53fbd5;_0xa669bd[_0xe3c8('0xa5')]=_0x22879b;_0xa669bd[_0xe3c8('0xa6')]=_0x5e5099[_0xe3c8('0xa7')];return _0xa669bd;}Dialer[_0xe3c8('0x1b')][_0xe3c8('0x3d')]=function(){var _0xd2a1ae=this;setInterval(function(){_0xd2a1ae['clearZombieChannels'](_0xd2a1ae['uniqueId'],_0xe3c8('0xa8'));_0xd2a1ae[_0xe3c8('0xa9')](_0xd2a1ae['actions'],'[actions]');},0x32c8);};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xa9')]=function(_0x5e063b,_0x1f4b62){var _0x612af5=this;for(var _0xe9d3a1 in _0x5e063b){if(typeof _0x5e063b[_0xe9d3a1]!==_0xe3c8('0x98')){this['sequence']['enqueue'](function(){if(!_[_0xe3c8('0xaa')](_0x5e063b[_0xe9d3a1])){return ami[_0xe3c8('0xab')]({'action':_0xe3c8('0xac'),'channel':_0x5e063b[_0xe9d3a1][_0xe3c8('0xad')]})[_0xe3c8('0xae')](function(_0x38d006){if(_0x38d006['message']===_0xe3c8('0xaf')){setTimeout(function(){if(_0x5e063b[_0xe9d3a1]&&_0x5e063b[_0xe9d3a1][_0xe3c8('0x4e')]!=='ivr'){_0x612af5[_0xe3c8('0xb0')](_0x612af5[_0xe3c8('0x20')][_0x5e063b[_0xe9d3a1][_0xe3c8('0xb1')]]);logger[_0xe3c8('0x94')]('[Dialer][checkChannel]',_0x1f4b62,_0xe9d3a1,_0x5e063b[_0xe9d3a1][_0xe3c8('0xb1')]);delete _0x5e063b[_0xe9d3a1];}if(_0x5e063b[_0xe9d3a1]&&_0x5e063b[_0xe9d3a1]['type']==='ivr'){_0x612af5[_0xe3c8('0xb0')](_0x612af5['campaigns'][_0x5e063b[_0xe9d3a1]['queue']]);logger[_0xe3c8('0x94')](_0xe3c8('0xb2'),_0x1f4b62,_0xe9d3a1,_0x5e063b[_0xe9d3a1][_0xe3c8('0xb1')]);delete _0x5e063b[_0xe9d3a1];}},0x2328);}});}});}}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xb3')]=function(_0x492a57){return BPromise['resolve']()['then'](cmHopper[_0xe3c8('0xb3')](_0x492a57))[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0xb4')));};Dialer['prototype'][_0xe3c8('0xb5')]=function(_0x2acfac){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x2acfac))[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0xb6')));};Dialer['prototype']['verifyAdditionalPhones']=function(_0x462826,_0x3126bf,_0x40e69f){return BPromise[_0xe3c8('0xb7')]()[_0xe3c8('0xb8')](cmHopperAdditionalPhone[_0xe3c8('0xb9')](_0x462826,_0x3126bf,_0x40e69f))[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0xba')));};Dialer['prototype'][_0xe3c8('0xbb')]=function(_0x239170,_0x5c744c,_0x2b1b24){return BPromise[_0xe3c8('0xb7')]()[_0xe3c8('0xb8')](cmHopperAdditionalPhone[_0xe3c8('0xbb')](_0x239170,_0x5c744c,_0x2b1b24))[_0xe3c8('0xae')](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xbc')]=function(_0x5800a6){return BPromise['resolve']()[_0xe3c8('0xb8')](cmHopperBlack[_0xe3c8('0xbc')](_0x5800a6))[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0xbd')));};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xbe')]=function(_0x55d91f){return BPromise[_0xe3c8('0xb7')]()[_0xe3c8('0xb8')](cmHopperHistory[_0xe3c8('0xbf')](_0x55d91f))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0xe3c8('0xc0')]=function(_0x5e714b){return BPromise[_0xe3c8('0xb7')]()[_0xe3c8('0xb8')](cmHopper[_0xe3c8('0xc0')](_0x5e714b))[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0xc1')));};Dialer[_0xe3c8('0x1b')]['unlockContact']=function(_0x4b1a92,_0x277683,_0x562b01){return BPromise[_0xe3c8('0xb7')]()[_0xe3c8('0xb8')](cmHopper[_0xe3c8('0xc2')](_0x4b1a92,_0x277683,_0x562b01))['catch'](loggerCatch(_0xe3c8('0xc3')));};Dialer['prototype'][_0xe3c8('0xc4')]=function(_0x10c8a2,_0x50b843,_0x44a0b7,_0x1653cf,_0x5ad0ac){return BPromise['resolve']()[_0xe3c8('0xb8')](cmHopper[_0xe3c8('0xc4')](_0x10c8a2,_0x50b843,_0x44a0b7,_0x1653cf))['catch'](function(_0x3eb79b){_0x5ad0ac[_0xe3c8('0xc5')]-=_0x44a0b7;_0x5ad0ac[_0xe3c8('0xc5')]=_0x5ad0ac[_0xe3c8('0xc5')]>0x0?_0x5ad0ac[_0xe3c8('0xc5')]:0x0;loggerCatch(_0xe3c8('0xc6'))(_0x3eb79b);});};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xc7')]=function(_0x3a5dd1,_0x56ebe1,_0x4a9309,_0x21321f){return BPromise[_0xe3c8('0xb7')]()[_0xe3c8('0xb8')](cmHopper[_0xe3c8('0xc7')](_0x3a5dd1,_0x56ebe1,_0x4a9309))['catch'](function(_0x55f0bd){_0x21321f[_0xe3c8('0xc5')]-=_0x56ebe1;_0x21321f[_0xe3c8('0xc5')]=_0x21321f[_0xe3c8('0xc5')]>0x0?_0x21321f[_0xe3c8('0xc5')]:0x0;loggerCatch(_0xe3c8('0xc8'))(_0x55f0bd);});};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xc9')]=function(_0x4ed30d){return BPromise[_0xe3c8('0xb7')]()['then'](voiceQueueRt[_0xe3c8('0xc9')](_0x4ed30d))[_0xe3c8('0xae')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xca')]=function(_0x4c0403){return BPromise[_0xe3c8('0xb7')]()[_0xe3c8('0xb8')](cmHopper[_0xe3c8('0xca')](_0x4c0403))[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0xcb')));};Dialer[_0xe3c8('0x1b')]['createHistory']=function(_0x571dd4){return BPromise['resolve']()[_0xe3c8('0xb8')](cmHopperHistory[_0xe3c8('0xcc')](_0x571dd4))[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0xcd')));};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xb0')]=function(_0x2a7998){if(!_[_0xe3c8('0x3e')](_0x2a7998)&&_0x2a7998!==null){if(typeof _0x2a7998[_0xe3c8('0x97')]!==_0xe3c8('0x98')){if(_0x2a7998[_0xe3c8('0x97')]>0x0){_0x2a7998[_0xe3c8('0x97')]-=0x1;}else{logger[_0xe3c8('0x94')](_0xe3c8('0xce'));}}}else{logger[_0xe3c8('0x94')](_0xe3c8('0xcf'));}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xd0')]=function(_0x5695d7,_0x3406a9){var _0x2b7404=this;return function(_0x1d70dd){_0x2b7404[_0xe3c8('0xb0')](_0x3406a9);logger['error'](_0x5695d7,util[_0xe3c8('0x93')](_0x1d70dd,{'showHidden':![],'depth':null}));};};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xd1')]=function(_0x4fc558,_0xb37076,_0x15fea0){var _0x3f4f5d={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0xb37076);this[_0xe3c8('0xd2')](_[_0xe3c8('0x89')](_0x3f4f5d,_[_0xe3c8('0xd3')](_0x15fea0,[_0xe3c8('0xd4'),_0xe3c8('0xd5'),'UserId',_0xe3c8('0xd6'),_0xe3c8('0xd7')])),_0xe3c8('0xd8'),_0xe3c8('0xd9'));logger[_0xe3c8('0x94')](_0x4fc558);};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xda')]=function(_0x5083eb){return _0x5083eb===_0xe3c8('0xdb');};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xdc')]=function(_0x23626f){return!_[_0xe3c8('0x3e')](_0x23626f)&&_0x23626f&&!_[_0xe3c8('0x3e')](_0x23626f[_0xe3c8('0x40')])&&!_[_0xe3c8('0x3e')](_0x23626f[_0xe3c8('0x76')])&&_0x23626f[_0xe3c8('0x76')]&&(this['trunks'][util[_0xe3c8('0x90')]('SIP/%s',_0x23626f[_0xe3c8('0x40')])][_0xe3c8('0xac')]==='reachable'||this[_0xe3c8('0x23')][util[_0xe3c8('0x90')](_0xe3c8('0xdd'),_0x23626f[_0xe3c8('0x40')])][_0xe3c8('0xac')]===_0xe3c8('0xde'));};Dialer['prototype'][_0xe3c8('0xd2')]=function(_0x1cf045,_0x15e56e,_0x452411){this[_0xe3c8('0xcc')](_0x1cf045)[_0xe3c8('0xae')](loggerCatch(_0x15e56e));this[_0xe3c8('0xca')](_0x1cf045)[_0xe3c8('0xae')](loggerCatch(_0x452411));};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x39')]=function(_0x57c576){var _0x336528=this[_0xe3c8('0xdf')][_0x57c576[_0xe3c8('0xe0')]];var _0x40ba8b;if(!_[_0xe3c8('0xaa')](_0x57c576)&&!_['isNil'](_0x57c576[_0xe3c8('0xe1')])&&!_[_0xe3c8('0xaa')](_0x57c576[_0xe3c8('0xe1')][_0xe3c8('0xe2')])&&_0x57c576[_0xe3c8('0xe3')]==='xcally-motion-dialer'&&_0x336528){if(_0x336528[_0xe3c8('0x4e')]!==_0xe3c8('0x79')&&this[_0xe3c8('0x20')][_0x336528[_0xe3c8('0xb1')]]['dialAMDActive']&&_0x57c576[_0xe3c8('0xe4')]===_0xe3c8('0xe5')){delete this[_0xe3c8('0xdf')][_0x57c576[_0xe3c8('0xe0')]];this[_0xe3c8('0xb0')](this[_0xe3c8('0x20')][_0x336528[_0xe3c8('0xb1')]]);this[_0xe3c8('0x20')][_0x336528['queue']][_0xe3c8('0x5e')]+=0x1;this['voiceQueues'][_0x336528[_0xe3c8('0xb1')]][_0xe3c8('0x5d')]+=0x1;_0x40ba8b=new Hangup(_0x336528,_0x57c576);_0x40ba8b[_0xe3c8('0xa4')]=0x12;_0x40ba8b['statedesc']=_0xe3c8('0xe6');_0x40ba8b['membername']='AMD';ami[_0xe3c8('0x4d')](_0xe3c8('0xe7'),ut['buildObj'](_0x40ba8b,'amd'));this['saveInDb'](_0x40ba8b,_0xe3c8('0xe8'),_0xe3c8('0xe9'));}if(_0x336528[_0xe3c8('0x4e')]!=='ivr'&&this[_0xe3c8('0x20')][_0x336528[_0xe3c8('0xb1')]][_0xe3c8('0xea')]&&_0x57c576['value']===_0xe3c8('0xeb')){var _0x17ccc1=this;return new BPromise(function(_0x32b124,_0x2eca0f){delete _0x17ccc1[_0xe3c8('0xdf')][_0x57c576['uniqueid']];_0x17ccc1[_0xe3c8('0xb0')](_0x17ccc1[_0xe3c8('0x20')][_0x336528[_0xe3c8('0xb1')]]);_0x17ccc1['voiceQueues'][_0x336528['queue']]['outboundAnswerCallsDay']+=0x1;_0x17ccc1['voiceQueues'][_0x336528['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x5229af=_0x17ccc1[_0xe3c8('0x20')][_0x336528[_0xe3c8('0xb1')]];var _0x3d6446=new Hangup(_0x336528,_0x57c576);_0x3d6446[_0xe3c8('0xa4')]=0x13;_0x3d6446[_0xe3c8('0xa5')]='Machine';_0x3d6446[_0xe3c8('0xec')]=_0xe3c8('0xed');_0x3d6446['countmachineretry']+=0x1;_0x3d6446['countglobal']+=0x1;_0x3d6446[_0xe3c8('0xee')]=!![];ami['emit'](_0xe3c8('0xe7'),ut['buildObj'](_0x3d6446,_0xe3c8('0xee')));_0x17ccc1[_0xe3c8('0xcc')](_0x3d6446)['catch'](loggerCatch(_0xe3c8('0xef')));if(_0x3d6446[_0xe3c8('0xf0')]+_0x3d6446[_0xe3c8('0xf1')]+_0x3d6446[_0xe3c8('0xf2')]+_0x3d6446[_0xe3c8('0xf3')]+_0x3d6446[_0xe3c8('0xf4')]+_0x3d6446[_0xe3c8('0xf5')]+_0x3d6446[_0xe3c8('0xf6')]+_0x3d6446[_0xe3c8('0xf7')]>=_0x5229af['dialGlobalMaxRetry']){_0x17ccc1[_0xe3c8('0xf8')](_0x3d6446,_0x32b124,_0x2eca0f,_0xe3c8('0xf9'));}else{if(_0x3d6446[_0xe3c8('0xf6')]>=_0x5229af[_0xe3c8('0xfa')]){_0x17ccc1[_0xe3c8('0xfb')](_0x3d6446,_0x32b124,_0x2eca0f,_0xe3c8('0xfc'));}else{_0x17ccc1[_0xe3c8('0xc0')]({'active':![],'countmachineretry':_0x3d6446[_0xe3c8('0xf6')],'scheduledat':moment()['add'](_0x5229af[_0xe3c8('0xfd')],_0xe3c8('0xfe'))[_0xe3c8('0x90')](_0xe3c8('0xff')),'ContactId':_0x3d6446[_0xe3c8('0xd4')],'ListId':_0x3d6446[_0xe3c8('0xd5')],'VoiceQueueId':_0x3d6446[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x3d6446[_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x100')));_0x32b124({'reschedule':0x1});}}});}if(_0x336528[_0xe3c8('0x4e')]===_0xe3c8('0x79')&&this[_0xe3c8('0x21')][_0x336528[_0xe3c8('0xb1')]]['dialAMDActive']&&_0x57c576[_0xe3c8('0xe4')]==='HANGUP'){delete this['uniqueId'][_0x57c576['uniqueid']];this[_0xe3c8('0xb0')](this[_0xe3c8('0x21')][_0x336528[_0xe3c8('0xb1')]]);_0x40ba8b=new Hangup(_0x336528,_0x57c576);_0x40ba8b[_0xe3c8('0xa4')]=0x12;_0x40ba8b['statedesc']=_0xe3c8('0xe6');_0x40ba8b['membername']=_0xe3c8('0xed');ami['emit'](_0xe3c8('0xe7'),ut[_0xe3c8('0x101')](_0x40ba8b,'amd'));this['saveInDb'](_0x40ba8b,'[syncHangupInAMDIvr][createHistory]',_0xe3c8('0x102'));}if(_0x336528[_0xe3c8('0x4e')]===_0xe3c8('0x79')&&this[_0xe3c8('0x21')][_0x336528[_0xe3c8('0xb1')]][_0xe3c8('0xea')]&&_0x57c576[_0xe3c8('0xe4')]===_0xe3c8('0xeb')){var _0x17ccc1=this;return new BPromise(function(_0x19f2e3,_0x8b5695){delete _0x17ccc1[_0xe3c8('0xdf')][_0x57c576[_0xe3c8('0xe0')]];_0x17ccc1[_0xe3c8('0xb0')](_0x17ccc1[_0xe3c8('0x21')][_0x336528[_0xe3c8('0xb1')]]);_0x17ccc1[_0xe3c8('0x21')][_0x336528[_0xe3c8('0xb1')]][_0xe3c8('0x5e')]+=0x1;_0x17ccc1['campaigns'][_0x336528['queue']][_0xe3c8('0x5d')]+=0x1;var _0x2b78fc=_0x17ccc1['campaigns'][_0x336528['queue']];var _0x1223c1=new Hangup(_0x336528,_0x57c576);_0x1223c1[_0xe3c8('0xa4')]=0x13;_0x1223c1[_0xe3c8('0xa5')]=_0xe3c8('0x103');_0x1223c1[_0xe3c8('0xec')]=_0xe3c8('0xed');_0x1223c1[_0xe3c8('0xf6')]+=0x1;_0x1223c1[_0xe3c8('0x104')]+=0x1;_0x1223c1[_0xe3c8('0xee')]=!![];ami[_0xe3c8('0x4d')](_0xe3c8('0xe7'),ut['buildObj'](_0x1223c1,'amd'));_0x17ccc1[_0xe3c8('0xcc')](_0x1223c1)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0xef')));if(_0x1223c1['countbusyretry']+_0x1223c1[_0xe3c8('0xf1')]+_0x1223c1[_0xe3c8('0xf2')]+_0x1223c1[_0xe3c8('0xf3')]+_0x1223c1[_0xe3c8('0xf4')]+_0x1223c1[_0xe3c8('0xf5')]+_0x1223c1['countmachineretry']+_0x1223c1[_0xe3c8('0xf7')]>=_0x2b78fc[_0xe3c8('0x105')]){_0x17ccc1[_0xe3c8('0xf8')](_0x1223c1,_0x19f2e3,_0x8b5695,'reason19\x20machine....');}else{if(_0x1223c1['countmachineretry']>=_0x2b78fc[_0xe3c8('0xfa')]){_0x17ccc1['createStateFinal'](_0x1223c1,_0x19f2e3,_0x8b5695,_0xe3c8('0xfc'));}else{_0x17ccc1[_0xe3c8('0xc0')]({'active':![],'countmachineretry':_0x1223c1[_0xe3c8('0xf6')],'scheduledat':moment()[_0xe3c8('0x106')](_0x2b78fc[_0xe3c8('0xfd')],'minutes')[_0xe3c8('0x90')](_0xe3c8('0xff')),'ContactId':_0x1223c1[_0xe3c8('0xd4')],'ListId':_0x1223c1[_0xe3c8('0xd5')],'VoiceQueueId':_0x1223c1[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x1223c1[_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x100')));_0x19f2e3({'reschedule':0x1});}}});}}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x36')]=function(_0x5064b2){var _0x2427c2=this[_0xe3c8('0xdf')][_0x5064b2[_0xe3c8('0xe0')]];var _0x265b12=this;var _0x2b1323;if(_0x2427c2&&_0x2427c2['type']===_0xe3c8('0x79')){delete this['uniqueId'][_0x5064b2[_0xe3c8('0xe0')]];this['updateOriginated'](this['campaigns'][_0x2427c2['queue']]);this[_0xe3c8('0x21')][_0x2427c2[_0xe3c8('0xb1')]]['ivrAnswerCallsDay']+=0x1;_0x2b1323=new Hangup(_0x2427c2,_0x5064b2);this[_0xe3c8('0xcc')](_0x2b1323)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x107')));this[_0xe3c8('0xca')](_0x2b1323)[_0xe3c8('0xae')](loggerCatch('[syncHangupIvr]'));}if(_0x2427c2&&_0x2427c2['type']!==_0xe3c8('0x79')&&isNotNull(this[_0xe3c8('0x20')][_0x2427c2[_0xe3c8('0xb1')]]['dialQueueProject'])){delete this[_0xe3c8('0xdf')][_0x5064b2['uniqueid']];this[_0xe3c8('0xb0')](this[_0xe3c8('0x20')][_0x2427c2[_0xe3c8('0xb1')]]);this[_0xe3c8('0x20')][_0x2427c2['queue']][_0xe3c8('0x5e')]+=0x1;this[_0xe3c8('0x20')][_0x2427c2['queue']][_0xe3c8('0x5d')]+=0x1;_0x2b1323=new Hangup(_0x2427c2,_0x5064b2);_0x2b1323['state']=0x10;_0x2b1323['statedesc']=_0xe3c8('0x108');_0x2b1323[_0xe3c8('0xec')]=_0xe3c8('0x109');this['createHistory'](_0x2b1323)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x107')));this[_0xe3c8('0xca')](_0x2b1323)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x10a')));}if(_0x2427c2&&_0x2427c2[_0xe3c8('0x4e')]!==_0xe3c8('0x79')&&!isNotNull(this[_0xe3c8('0x20')][_0x2427c2[_0xe3c8('0xb1')]][_0xe3c8('0x10b')])){delete this[_0xe3c8('0xdf')][_0x5064b2[_0xe3c8('0xe0')]];this[_0xe3c8('0xb0')](this[_0xe3c8('0x20')][_0x2427c2[_0xe3c8('0xb1')]]);this[_0xe3c8('0x20')][_0x2427c2['queue']][_0xe3c8('0x10c')]+=0x1;_0x2b1323=new Hangup(_0x2427c2,_0x5064b2);_0x2b1323[_0xe3c8('0xa4')]=0xc;_0x2b1323[_0xe3c8('0xa5')]=_0x5064b2[_0xe3c8('0x10d')];_0x2b1323[_0xe3c8('0xec')]='Unknow';this[_0xe3c8('0xcc')](_0x2b1323)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x107')));this['moveContactManagedDialer'](_0x2b1323)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x10a')));}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x10e')]=function(_0x35aee7){var _0x247fce=this[_0xe3c8('0xdf')][_0x35aee7['uniqueid']];var _0x25eb58=this;if(this[_0xe3c8('0x20')][_0x35aee7[_0xe3c8('0xb1')]]){if(_0x247fce&&_0x247fce[_0xe3c8('0x4e')]!==_0xe3c8('0x79')){delete this[_0xe3c8('0xdf')][_0x35aee7[_0xe3c8('0xe0')]];this['voiceQueues'][_0x35aee7[_0xe3c8('0xb1')]][_0xe3c8('0x5e')]+=0x1;var _0x5adc6b=new AgentComplete(_0x247fce,_0x35aee7);if(_0x35aee7[_0xe3c8('0x10f')]===_0xe3c8('0x110')){_0x5adc6b[_0xe3c8('0x111')]=this[_0xe3c8('0x20')][_0x35aee7[_0xe3c8('0xb1')]]['dialQueueProject2']&&this['voiceQueues'][_0x35aee7['queue']][_0xe3c8('0x112')]?moment()[_0xe3c8('0x90')](_0xe3c8('0xff')):undefined;}this[_0xe3c8('0xcc')](_0x5adc6b)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x113')));this[_0xe3c8('0xca')](_0x5adc6b)[_0xe3c8('0xae')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0xe3c8('0x2d')]=function(_0x32d24d){if(this[_0xe3c8('0x20')][_0x32d24d[_0xe3c8('0xb1')]]){if(this['uniqueId'][_0x32d24d[_0xe3c8('0xe0')]]&&this['uniqueId'][_0x32d24d['uniqueid']]['type']!==_0xe3c8('0x79')){this['updateOriginated'](this[_0xe3c8('0x20')][_0x32d24d[_0xe3c8('0xb1')]]);this[_0xe3c8('0xdf')][_0x32d24d[_0xe3c8('0xe0')]][_0xe3c8('0x114')]=moment()[_0xe3c8('0x90')](_0xe3c8('0xff'));}}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x115')]=function(_0x392b49,_0x44b059){this[_0xe3c8('0xcc')](_0x392b49)[_0xe3c8('0xae')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x44b059==0x0){this['moveContactManagedDialer'](_0x392b49)['catch'](loggerCatch(_0xe3c8('0x116')));}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x38d247){var _0x782406=this[_0xe3c8('0xdf')][_0x38d247[_0xe3c8('0xe0')]];var _0x4e2b7c=this;var _0x271fbd=![];var _0xc4dffd;var _0x83bb65;if(this[_0xe3c8('0x20')][_0x38d247[_0xe3c8('0xb1')]]){if(_0x782406&&_0x782406[_0xe3c8('0x4e')]!=='ivr'){delete this[_0xe3c8('0xdf')][_0x38d247[_0xe3c8('0xe0')]];this[_0xe3c8('0xb0')](this[_0xe3c8('0x20')][_0x38d247[_0xe3c8('0xb1')]]);_0x782406[_0xe3c8('0x117')]=moment()[_0xe3c8('0x90')]('YYYY-MM-DD\x20HH:mm:ss');var _0x45cfb8=new QueueCallerAbandon(_0x782406,_0x38d247);if(getSeconds(_0x782406[_0xe3c8('0x117')],_0x782406['responsetime'])>=_0x782406[_0xe3c8('0x118')]){this['voiceQueues'][_0x38d247[_0xe3c8('0xb1')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xe3c8('0x20')][_0x38d247[_0xe3c8('0xb1')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xe3c8('0x20')][_0x38d247['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x45cfb8['state']=0xa;_0x45cfb8[_0xe3c8('0xa5')]=_0xe3c8('0x119');_0x45cfb8[_0xe3c8('0x11a')]='TIMEOUT';_0x45cfb8[_0xe3c8('0x111')]=this['voiceQueues'][_0x38d247[_0xe3c8('0xb1')]][_0xe3c8('0x11b')]?moment()[_0xe3c8('0x90')](_0xe3c8('0xff')):undefined;_0x45cfb8[_0xe3c8('0xf4')]+=0x1;_0x45cfb8[_0xe3c8('0x104')]+=0x1;_0xc4dffd=this[_0xe3c8('0x20')][_0x38d247[_0xe3c8('0xb1')]][_0xe3c8('0x11c')];_0x83bb65=this['voiceQueues'][_0x38d247['queue']][_0xe3c8('0x11d')];_0x4e2b7c[_0xe3c8('0xb9')](_0x45cfb8,_0x45cfb8['state'],_0x782406[_0xe3c8('0x11e')])[_0xe3c8('0xb8')](function(_0x301649){_0x271fbd=_0x301649[_0xe3c8('0x11f')]==0x1;if(_0x45cfb8[_0xe3c8('0xf4')]>=_0x4e2b7c[_0xe3c8('0x20')][_0x38d247[_0xe3c8('0xb1')]][_0xe3c8('0x120')]){_0x4e2b7c[_0xe3c8('0x115')](_0x45cfb8,_0x301649[_0xe3c8('0x11f')]);}else{_0x4e2b7c[_0xe3c8('0xc0')]({'active':![],'countdropretry':_0x45cfb8[_0xe3c8('0xf4')],'scheduledat':moment()[_0xe3c8('0x106')](_0x4e2b7c['voiceQueues'][_0x38d247[_0xe3c8('0xb1')]][_0xe3c8('0x11c')],_0xe3c8('0xfe'))[_0xe3c8('0x90')](_0xe3c8('0xff')),'ContactId':_0x782406[_0xe3c8('0xd4')],'ListId':_0x782406[_0xe3c8('0xd5')],'VoiceQueueId':_0x782406[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x782406[_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x121')));var _0xdcff5d=new History(_0x45cfb8);_0xdcff5d[_0xe3c8('0xa4')]=0xa;_0xdcff5d[_0xe3c8('0xa5')]=_0xe3c8('0x119');_0xdcff5d[_0xe3c8('0xa7')]=moment()[_0xe3c8('0x90')](_0xe3c8('0xff'));_0xdcff5d[_0xe3c8('0xa6')]=_0xdcff5d[_0xe3c8('0xa7')];_0xdcff5d[_0xe3c8('0x122')]=_0x45cfb8[_0xe3c8('0x122')];_0xdcff5d[_0xe3c8('0x123')]=_0x45cfb8['calleridnum'];_0x4e2b7c['createHistory'](_0xdcff5d)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x124')));}})[_0xe3c8('0xb8')](function(_0x587815){if(_0x271fbd)_0x4e2b7c[_0xe3c8('0xbb')](_0x45cfb8,_0xc4dffd,_0x83bb65)[_0xe3c8('0xb8')](function(_0x595dcd){return 0x1;});});}else{this[_0xe3c8('0x20')][_0x38d247[_0xe3c8('0xb1')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xe3c8('0x20')][_0x38d247[_0xe3c8('0xb1')]][_0xe3c8('0x125')]+=0x1;_0x45cfb8[_0xe3c8('0xa4')]=0xb;_0x45cfb8[_0xe3c8('0xa5')]=_0xe3c8('0x126');_0x45cfb8[_0xe3c8('0x11a')]=_0xe3c8('0x127');_0x45cfb8[_0xe3c8('0xf5')]+=0x1;_0x45cfb8[_0xe3c8('0x104')]+=0x1;_0xc4dffd=this['voiceQueues'][_0x38d247[_0xe3c8('0xb1')]][_0xe3c8('0x128')];_0x83bb65=this[_0xe3c8('0x20')][_0x38d247['queue']][_0xe3c8('0x11d')];_0x4e2b7c[_0xe3c8('0xb9')](_0x45cfb8,_0x45cfb8['state'],_0x782406[_0xe3c8('0x11e')])[_0xe3c8('0xb8')](function(_0x61fa2b){if(_0x45cfb8[_0xe3c8('0xf5')]>=_0x4e2b7c['voiceQueues'][_0x38d247[_0xe3c8('0xb1')]][_0xe3c8('0x129')]){_0x4e2b7c['queueCallerAbandonCreateState'](_0x45cfb8,_0x61fa2b[_0xe3c8('0x11f')]);}else{_0x4e2b7c['rescheduleContact']({'active':![],'countabandonedretry':_0x45cfb8[_0xe3c8('0xf5')],'scheduledat':moment()['add'](_0x4e2b7c['voiceQueues'][_0x38d247[_0xe3c8('0xb1')]][_0xe3c8('0x128')],'minutes')[_0xe3c8('0x90')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x782406['ContactId'],'ListId':_0x782406[_0xe3c8('0xd5')],'VoiceQueueId':_0x782406['VoiceQueueId']||undefined,'CampaignId':_0x782406['CampaignId']||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x12a')));var _0x2d509b=new History(_0x45cfb8);_0x2d509b['state']=0xb;_0x2d509b[_0xe3c8('0xa5')]=_0xe3c8('0x126');_0x2d509b[_0xe3c8('0xa7')]=moment()[_0xe3c8('0x90')](_0xe3c8('0xff'));_0x2d509b[_0xe3c8('0xa6')]=_0x2d509b[_0xe3c8('0xa7')];_0x2d509b[_0xe3c8('0x122')]=_0x45cfb8[_0xe3c8('0x122')];_0x2d509b[_0xe3c8('0x123')]=_0x45cfb8['calleridnum'];_0x4e2b7c[_0xe3c8('0xcc')](_0x2d509b)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x12b')));}})['then'](function(_0x36030e){if(_0x271fbd)_0x4e2b7c[_0xe3c8('0xbb')](_0x45cfb8,_0xc4dffd,_0x83bb65)[_0xe3c8('0xb8')](function(_0xd978ba){return 0x1;});});}}}};Dialer[_0xe3c8('0x1b')]['syncNewExten']=function(_0x2d5da7){if(this[_0xe3c8('0x26')][_0x2d5da7[_0xe3c8('0xe0')]]){this[_0xe3c8('0x26')][_0x2d5da7[_0xe3c8('0xe0')]][_0xe3c8('0xad')]=_0x2d5da7['channel'];}if(this['uniqueId'][_0x2d5da7[_0xe3c8('0xe0')]]){this[_0xe3c8('0xdf')][_0x2d5da7[_0xe3c8('0xe0')]][_0xe3c8('0xad')]=_0x2d5da7[_0xe3c8('0xad')];}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x3b')]=function(_0x3f73f4){if(strategy[this[_0xe3c8('0x20')][this['actions'][_0x3f73f4['actionid']][_0xe3c8('0xb1')]][_0xe3c8('0x4f')]]==='roundrobin'){if(this[_0xe3c8('0x26')][_0x3f73f4[_0xe3c8('0x12c')]]&&_[_0xe3c8('0xaa')](this[_0xe3c8('0x26')][_0x3f73f4[_0xe3c8('0x12c')]][_0xe3c8('0x12d')])&&_0x3f73f4['status']==='1'&&_0x3f73f4[_0xe3c8('0x12e')]==='0'){if(this[_0xe3c8('0x22')][_0x3f73f4[_0xe3c8('0x12f')]]){if(!this['agents'][_0x3f73f4[_0xe3c8('0x12f')]][_0xe3c8('0x12d')]){this['agents'][_0x3f73f4[_0xe3c8('0x12f')]][_0xe3c8('0x12d')]=!![];this[_0xe3c8('0x26')][_0x3f73f4[_0xe3c8('0x12c')]][_0xe3c8('0x12d')]=!![];this[_0xe3c8('0x26')][_0x3f73f4['actionid']][_0xe3c8('0x12f')]=_0x3f73f4['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0xe3c8('0x26')][_0x3f73f4[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]]['strategy']]||_0xe3c8('0x19'))===_0xe3c8('0x19')){if(this['actions'][_0x3f73f4[_0xe3c8('0x12c')]]){if(this[_0xe3c8('0x22')][_0x3f73f4[_0xe3c8('0x12f')]]){this[_0xe3c8('0x26')][_0x3f73f4[_0xe3c8('0x12c')]][_0xe3c8('0x12f')]=_0x3f73f4[_0xe3c8('0x12f')];if(_[_0xe3c8('0xaa')](this[_0xe3c8('0x2b')][this[_0xe3c8('0x26')][_0x3f73f4['actionid']][_0xe3c8('0xb1')]])){this['queueBooked'][this[_0xe3c8('0x26')][_0x3f73f4[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]]=[];}this[_0xe3c8('0x2b')][this[_0xe3c8('0x26')][_0x3f73f4['actionid']]['queue']]['push'](_[_0xe3c8('0x89')](_[_0xe3c8('0xd3')](this[_0xe3c8('0x26')][_0x3f73f4['actionid']],[_0xe3c8('0x130'),_0xe3c8('0x12f')]),{'status':_0x3f73f4['status'],'paused':_0x3f73f4['paused']}));}}}};function unlockQueueStatus(_0x27f397,_0x5e898c){setTimeout(function(){if(_['isUndefined'](_0x27f397['queueStatusComplete'])){loggerBooked[_0xe3c8('0x94')](_0xe3c8('0x131'),_0x5e898c);}_0x27f397[_0xe3c8('0x132')]=!![];loggerBooked['info'](_0xe3c8('0x133'),_0x5e898c,JSON['stringify'](_['pick'](_0x27f397,[_0xe3c8('0x40'),_0xe3c8('0x132')])));},0x1f3);}Dialer[_0xe3c8('0x1b')][_0xe3c8('0x134')]=function(_0x99d6eb){var _0x9286b7=this;var _0x4eeb7a=_0x9286b7[_0xe3c8('0x20')][_0x9286b7[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]];if(strategy[this[_0xe3c8('0x20')][this['actions'][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]][_0xe3c8('0x4f')]]===_0xe3c8('0x1a')){if(this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]]&&this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0x12f')]){this[_0xe3c8('0x1f')][_0xe3c8('0x135')](this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0x130')],this['actions'][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0x12f')])['catch'](function(_0x7fbe50){logger[_0xe3c8('0x94')](_0xe3c8('0x136'),util['inspect'](_0x7fbe50,{'showHidden':![],'depth':null}));})[_0xe3c8('0x1e')](function(){_0x9286b7[_0xe3c8('0xb0')](_0x9286b7[_0xe3c8('0x20')][_0x9286b7['actions'][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]]);_0x9286b7[_0xe3c8('0x22')][_0x9286b7[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0x12f')]]['locked']=![];delete _0x9286b7['actions'][_0x99d6eb[_0xe3c8('0x12c')]];unlockQueueStatus(_0x4eeb7a);});}else{this['updateOriginated'](this[_0xe3c8('0x20')][this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]]);this[_0xe3c8('0xc0')]({'active':![],'ContactId':this[_0xe3c8('0x26')][_0x99d6eb['actionid']][_0xe3c8('0xd4')],'ListId':this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xd5')],'VoiceQueueId':this['actions'][_0x99d6eb[_0xe3c8('0x12c')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x137')));delete this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]];unlockQueueStatus(_0x4eeb7a);}}else if((strategy[this[_0xe3c8('0x20')][this['actions'][_0x99d6eb[_0xe3c8('0x12c')]]['queue']][_0xe3c8('0x4f')]]||_0xe3c8('0x19'))===_0xe3c8('0x19')){var _0x1a25a0;if(this[_0xe3c8('0x26')][_0x99d6eb['actionid']]&&!_['isEmpty'](this[_0xe3c8('0x2b')][this[_0xe3c8('0x26')][_0x99d6eb['actionid']][_0xe3c8('0xb1')]])){if(this[_0xe3c8('0x138')][_0x9286b7[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]]['queue']]){this['queueBookedRR'][_0x9286b7[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]]=this[_0xe3c8('0x138')][this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]]['queue']]?this[_0xe3c8('0x138')][this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]]['queue']]:this[_0xe3c8('0x2b')][this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]]['queue']]?this[_0xe3c8('0x2b')][this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]]['queue']]['_rr']||0x0:0x0;}this['queueBooked'][this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]][_0xe3c8('0x139')]=this[_0xe3c8('0x138')][this['actions'][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]];for(var _0x37795b=0x0;_0x37795b<this['queueBooked'][this['actions'][_0x99d6eb['actionid']][_0xe3c8('0xb1')]][_0xe3c8('0x96')];_0x37795b+=0x1){_0x1a25a0=rr(this[_0xe3c8('0x2b')][this[_0xe3c8('0x26')][_0x99d6eb['actionid']][_0xe3c8('0xb1')]]);this['queueBookedRR'][_0x9286b7[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]]=this[_0xe3c8('0x2b')][this['actions'][_0x99d6eb['actionid']][_0xe3c8('0xb1')]][_0xe3c8('0x139')];if(_0x1a25a0[_0xe3c8('0xac')]==='1'&&_0x1a25a0[_0xe3c8('0x12e')]==='0'){break;}}if(!_['isNil'](_0x1a25a0)){this[_0xe3c8('0x22')][_0x1a25a0['stateinterface']][_0xe3c8('0x13a')]=_[_0xe3c8('0x3e')](this['agents'][_0x1a25a0[_0xe3c8('0x12f')]][_0xe3c8('0x13a')])?!![]:this[_0xe3c8('0x22')][_0x1a25a0['stateinterface']][_0xe3c8('0x13a')];}loggerBooked[_0xe3c8('0x7c')]('[booked][RR]',_0x99d6eb[_0xe3c8('0x12c')],'Agent:\x20',JSON[_0xe3c8('0x49')](_['pick'](this[_0xe3c8('0x22')][_0x1a25a0[_0xe3c8('0x12f')]],[_0xe3c8('0x40'),'unlockRR'])),_0xe3c8('0x13b'),JSON[_0xe3c8('0x49')](_0x1a25a0[_0xe3c8('0x130')]));if(!_['isNil'](_0x1a25a0)&&_0x1a25a0['status']==='1'&&_0x1a25a0[_0xe3c8('0x12e')]==='0'&&this[_0xe3c8('0x22')][_0x1a25a0[_0xe3c8('0x12f')]][_0xe3c8('0x13a')]){this[_0xe3c8('0x22')][_0x1a25a0['stateinterface']]['unlockRR']=![];this['queueBooked'][_0x9286b7[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]]['queue']]=[];this[_0xe3c8('0x1f')][_0xe3c8('0x135')](_0x1a25a0['idHopper'],_0x1a25a0[_0xe3c8('0x12f')])['catch'](function(_0x4f3f9d){logger[_0xe3c8('0x94')](_0xe3c8('0x136'),util[_0xe3c8('0x93')](_0x4f3f9d,{'showHidden':![],'depth':null}));})[_0xe3c8('0x1e')](function(){_0x9286b7[_0xe3c8('0xb0')](_0x9286b7['voiceQueues'][_0x9286b7['actions'][_0x99d6eb['actionid']]['queue']]);setTimeout(function(){_0x9286b7[_0xe3c8('0x22')][_0x1a25a0[_0xe3c8('0x12f')]][_0xe3c8('0x13a')]=!![];loggerBooked[_0xe3c8('0x7c')]('[booked][RR][finaly]',_0x99d6eb[_0xe3c8('0x12c')],_0xe3c8('0x13c'),JSON[_0xe3c8('0x49')](_['pick'](_0x9286b7[_0xe3c8('0x22')][_0x1a25a0['stateinterface']],[_0xe3c8('0x40'),_0xe3c8('0x13a')])),_0xe3c8('0x13b'),JSON['stringify'](_0x1a25a0[_0xe3c8('0x130')]));},0xc7);delete _0x9286b7[_0xe3c8('0x26')][_0x99d6eb['actionid']];unlockQueueStatus(_0x4eeb7a,_0x99d6eb[_0xe3c8('0x12c')]);});}else{loggerBooked[_0xe3c8('0x7c')](_0xe3c8('0x13d'));this[_0xe3c8('0xb0')](this['voiceQueues'][this['actions'][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]]);this[_0xe3c8('0xc0')]({'active':![],'ContactId':this[_0xe3c8('0x26')][_0x99d6eb['actionid']]['ContactId'],'ListId':this[_0xe3c8('0x26')][_0x99d6eb['actionid']][_0xe3c8('0xd5')],'VoiceQueueId':this[_0xe3c8('0x26')][_0x99d6eb['actionid']][_0xe3c8('0xd6')]||undefined,'CampaignId':this['actions'][_0x99d6eb[_0xe3c8('0x12c')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xe3c8('0x137')));delete this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]];unlockQueueStatus(_0x4eeb7a);}}else{loggerBooked[_0xe3c8('0x7c')]('[booked][unlock2]');this[_0xe3c8('0xb0')](this[_0xe3c8('0x20')][this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]]);this[_0xe3c8('0xc0')]({'active':![],'ContactId':this[_0xe3c8('0x26')][_0x99d6eb['actionid']]['ContactId'],'ListId':this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xd5')],'VoiceQueueId':this['actions'][_0x99d6eb[_0xe3c8('0x12c')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]];unlockQueueStatus(_0x4eeb7a);}}else{loggerBooked[_0xe3c8('0x7c')](_0xe3c8('0x13e'));this[_0xe3c8('0xb0')](this[_0xe3c8('0x20')][this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xb1')]]);this[_0xe3c8('0xc0')]({'active':![],'ContactId':this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xd4')],'ListId':this[_0xe3c8('0x26')][_0x99d6eb[_0xe3c8('0x12c')]]['ListId'],'VoiceQueueId':this['actions'][_0x99d6eb[_0xe3c8('0x12c')]][_0xe3c8('0xd6')]||undefined,'CampaignId':this[_0xe3c8('0x26')][_0x99d6eb['actionid']][_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x13f')));delete this[_0xe3c8('0x26')][_0x99d6eb['actionid']];unlockQueueStatus(_0x4eeb7a);}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x3c')]=function(){var _0x2d81af=this;setInterval(function(){_0x2d81af[_0xe3c8('0x140')]();},0x3e8);};Dialer['prototype'][_0xe3c8('0x141')]=function(_0x49ef42){var _0x1bf779=this;return function(){if(!_0x1bf779[_0xe3c8('0xdc')](_0x49ef42[_0xe3c8('0x75')])){if(!_0x1bf779[_0xe3c8('0xdc')](_0x49ef42['TrunkBackup'])){_0x49ef42[_0xe3c8('0x3f')]=_0xe3c8('0x142');throw _0x49ef42[_0xe3c8('0x40')]+_0xe3c8('0x143');}}};};Dialer['prototype']['checkIfTime']=function(_0x54ac37,_0x3d551e,_0xdf0d86,_0x1e3375){var _0x16c546=this;return function(){var _0x5742a=!![];return _0x16c546[_0xe3c8('0x144')](_0x54ac37,_0x3d551e,_0xdf0d86,_0x1e3375,_0x5742a);};};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x145')]=function(_0x1f00cc,_0xf5a94c,_0x1164bc,_0x2f7205){var _0x54a07b=this;return function(){var _0xb6ecdb=![];return _0x54a07b[_0xe3c8('0x144')](_0x1f00cc[_0xe3c8('0x45')],_0xf5a94c,_0x1164bc,_0x2f7205,_0xb6ecdb);};};Dialer[_0xe3c8('0x1b')]['ifTime']=function(_0x4e72ad,_0x119e0b,_0x4afdce,_0x12f5e3,_0x801825){var _0xbb7091=[];return new BPromise(function(_0x3d181a,_0x5bd15c){if(!isNotNull(_0x4e72ad)){_0x12f5e3['message']=_0xe3c8('0x42');return _0x5bd15c(msgResponse(_0xe3c8('0x144'),'Failure',_0x4afdce+_0xe3c8('0x146')));}if(_[_0xe3c8('0x46')](_0x4e72ad)){_0x12f5e3[_0xe3c8('0x3f')]='INTERVAL_IS_EMPTY';return _0x5bd15c(msgResponse(_0xe3c8('0x144'),_0xe3c8('0x147'),_0x4afdce+_0xe3c8('0x148')));}if(_0x119e0b&&_['isUndefined'](config[_0xe3c8('0x149')][_0x119e0b])){_0x12f5e3[_0xe3c8('0x3f')]=_0xe3c8('0x14a');return _0x5bd15c(msgResponse(_0xe3c8('0x144'),_0xe3c8('0x147'),_0x4afdce+'\x20Timezone\x20unknow\x20'+_0x119e0b));}if(_['isArray'](_0x4e72ad)){for(var _0x541928=0x0;_0x541928<_0x4e72ad[_0xe3c8('0x96')];_0x541928+=0x1){_0xbb7091[_0xe3c8('0x14b')](ami[_0xe3c8('0xab')]({'action':'command','command':util[_0xe3c8('0x90')](_0xe3c8('0x14c'),_0x4e72ad[_0x541928]['interval'],!_['isUndefined'](config[_0xe3c8('0x149')][_0x119e0b])?_0x119e0b:'')})[_0xe3c8('0xb8')](function(_0x20ee77){return _0x20ee77[_0xe3c8('0x14d')][_0xe3c8('0x14e')](_0xe3c8('0x14f'))>=0x0;})[_0xe3c8('0xae')](myreject(_0x5bd15c)));}}else{_0xbb7091[_0xe3c8('0x14b')](ami['Action']({'action':_0xe3c8('0x150'),'command':util[_0xe3c8('0x90')](_0xe3c8('0x14c'),_0x4e72ad,!_['isUndefined'](config[_0xe3c8('0x149')][_0x119e0b])?_0x119e0b:'')})[_0xe3c8('0xb8')](function(_0x302e79){return _0x302e79[_0xe3c8('0x14d')][_0xe3c8('0x14e')](_0xe3c8('0x14f'))>=0x0;})[_0xe3c8('0xae')](myreject(_0x5bd15c)));}BPromise[_0xe3c8('0x151')](_0xbb7091)[_0xe3c8('0xb8')](function(_0x1c7034){var _0x1f1fb1=_['some'](_0x1c7034);if(_0x1f1fb1){return _0x3d181a(_0x1f1fb1);}else{_0x12f5e3[_0xe3c8('0x3f')]=_0x801825?_0xe3c8('0x152'):'INTERVAL_IS_OVERTIME';return _0x5bd15c(msgResponse('[ifTime][promiseAll]',_0xe3c8('0x147'),_0xe3c8('0x153')+_0x801825+'\x20'+_0x4afdce+'\x20Interval\x20is\x20overtime:\x20'+util[_0xe3c8('0x93')](_0x4e72ad,{'showHidden':![],'depth':null})+_0xe3c8('0x154')+_0x119e0b));}})[_0xe3c8('0xae')](function(_0x14d42c){return _0x5bd15c(msgResponse('ifTime','Failure',JSON[_0xe3c8('0x49')](_0x14d42c)));});});};Dialer['prototype'][_0xe3c8('0x155')]=function(_0x30ee11){var _0x45a0e3=this;return function(){switch(_0x30ee11[_0xe3c8('0x5b')]){case _0xe3c8('0x156'):freeVariablesPredictive(_0x30ee11);_0x45a0e3['handlePower'](_0x30ee11,0x1);break;case _0xe3c8('0x157'):freeVariablesPredictive(_0x30ee11);_0x45a0e3[_0xe3c8('0x158')](_0x30ee11,_0x30ee11['dialPowerLevel']);break;case'predictive':_0x45a0e3[_0xe3c8('0x8')](_0x30ee11);break;case _0xe3c8('0x159'):freeVariablesPredictive(_0x30ee11);_0x45a0e3[_0xe3c8('0x158')](_0x30ee11,0x1);break;default:freeVariablesPredictive(_0x30ee11);logger[_0xe3c8('0x94')](_0xe3c8('0x15a'),_0x30ee11['name'],_0xe3c8('0x15b'));}};};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x15c')]=function(_0x21673e){var _0x4d72dc=this;return function(){_0x4d72dc[_0xe3c8('0x15d')](_0x21673e);};};Dialer['prototype'][_0xe3c8('0x34')]=function(_0xd2c042){var _0x1b3cb3=this;if(isNotPreview(_0xd2c042[_0xe3c8('0x5b')])){if(isVoiceQueueOutbound(_0xd2c042[_0xe3c8('0x4e')])&&isActive(_0xd2c042[_0xe3c8('0x5a')])){_0xd2c042[_0xe3c8('0x9d')]=!![];BPromise[_0xe3c8('0xb7')]()[_0xe3c8('0xb8')](checkIsLoggedIn(_0xd2c042,_0xd2c042[_0xe3c8('0x15e')]))[_0xe3c8('0xb8')](checkIsActive(_0xd2c042,_0xd2c042[_0xe3c8('0x5a')]))['then'](checkInterval(_0xd2c042))['then'](_0x1b3cb3['checkIsTrunkReachable'](_0xd2c042))[_0xe3c8('0xb8')](_0x1b3cb3[_0xe3c8('0x15f')](_0xd2c042[_0xe3c8('0x160')],_0xd2c042[_0xe3c8('0x161')],_0xd2c042[_0xe3c8('0x40')],_0xd2c042))[_0xe3c8('0xb8')](_0x1b3cb3['checkIfTimeIntervals'](_0xd2c042[_0xe3c8('0x44')],_0xd2c042['dialTimezone'],_0xd2c042['name'],_0xd2c042))[_0xe3c8('0xb8')](_0x1b3cb3[_0xe3c8('0x155')](_0xd2c042))['catch'](loggerCatchQueueSummary(_0xe3c8('0x162'),_0xd2c042));}else{notSendMessagesQueue(_0xd2c042);}}else{freeVariablesPredictive(_0xd2c042);}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x140')]=function(){var _0x620149=this;var _0x3af681;for(var _0x3b414a in this['campaigns']){if(typeof this[_0xe3c8('0x21')][_0x3b414a]!==_0xe3c8('0x98')){_0x3af681=this[_0xe3c8('0x21')][_0x3b414a];if(isCampaignIvr(_0x3af681['type'])&&isActive(_0x3af681['active'])){_0x3af681[_0xe3c8('0x9d')]=!![];BPromise['resolve']()[_0xe3c8('0xb8')](checkIsActive(_0x3af681,_0x3af681[_0xe3c8('0x76')]))[_0xe3c8('0xb8')](checkInterval(_0x3af681))['then'](_0x620149[_0xe3c8('0x141')](_0x3af681))['then'](_0x620149['checkIfTime'](_0x3af681[_0xe3c8('0x160')],_0x3af681['dialTimezone'],_0x3af681[_0xe3c8('0x40')],_0x3af681))[_0xe3c8('0xb8')](_0x620149[_0xe3c8('0x145')](_0x3af681[_0xe3c8('0x44')],_0x3af681['dialTimezone'],_0x3af681['name'],_0x3af681))[_0xe3c8('0xb8')](_0x620149[_0xe3c8('0x15c')](_0x3af681))[_0xe3c8('0xae')](loggerCatchQueueSummary('[syncCampaigns]',_0x3af681));}else{notSendMessagesCampaign(_0x3af681);}}}};function getCallerIdRandom(_0x525dbd,_0xb42358){var _0x1d45c2;var _0x3f903f;var _0x359c03;if(_0xb42358<=0x0){_0xb42358=0x1;}_0x1d45c2=new RegExp(_0xe3c8('0x163')+_0xb42358+'}$');_0x3f903f=Math[_0xe3c8('0x164')](0xa,_0xb42358-0x1);_0x359c03=Math[_0xe3c8('0x164')](0xa,_0xb42358)-0x1;return util[_0xe3c8('0x90')]('%s',_[_0xe3c8('0x165')](_0x525dbd,_0x1d45c2,_[_0xe3c8('0x166')](_0x3f903f,_0x359c03)));}function extractCalleridName(_0x5b11b7){var _0xa628f2=_0x5b11b7['match'](/"(.*?)"/);return _0xa628f2?_0xa628f2[0x1]:_0x5b11b7;}function extractCalleridNumber(_0x37c404){var _0x2931b0=_0x37c404[_0xe3c8('0x167')](/<(.*?)>/);return _0x2931b0?_0x2931b0[0x1]:_0x37c404;}Dialer[_0xe3c8('0x1b')]['actionOriginate']=function(_0x5af216,_0x455703){var _0x34ad7d=this;var _0x115e47=uuid['v4']();this[_0xe3c8('0x26')][_0x115e47]=new Action(_0x5af216,_0x455703,_0x115e47);return new BPromise(function(_0x15cd8f,_0x22b7f7){if(_[_0xe3c8('0x3e')](_0x5af216)&&typeof _0x5af216!==_0xe3c8('0x168')){return _0x22b7f7(msgResponse(_0xe3c8('0x169'),_0xe3c8('0x147'),_0xe3c8('0x16a')));}if(_[_0xe3c8('0x3e')](_0x455703[_0xe3c8('0x16b')])||_0x455703[_0xe3c8('0x16b')]===null){return _0x22b7f7(msgResponse('originate',_0xe3c8('0x147'),'contact\x20is\x20undefine'));}var _0x39e78c={'XMD-CALLERID':_0x34ad7d[_0xe3c8('0x26')][_0x115e47][_0xe3c8('0x16c')](),'XMD-AGI':_0x5af216[_0xe3c8('0x10b')]?util['format'](_0xe3c8('0x16d'),ipAgi,_0x5af216[_0xe3c8('0x10b')]):_0xe3c8('0x16e'),'XMD-AGIAFTER':_0x5af216[_0xe3c8('0x11b')]?util[_0xe3c8('0x90')](_0xe3c8('0x16d'),ipAgi,_0x5af216['dialQueueProject2']):_0xe3c8('0x16e'),'XMD-QUEUE':_0x5af216[_0xe3c8('0x4e')]===_0xe3c8('0x8e')?util['format'](_0xe3c8('0x16f'),_0x5af216[_0xe3c8('0x40')],_0x5af216[_0xe3c8('0x170')]||'',_0x5af216[_0xe3c8('0x112')]?'c':'',_0x5af216[_0xe3c8('0x118')]||0x3):_0xe3c8('0x16e'),'XMD-CONTACTID':_0x455703['ContactId'],'XMD-CDRTYPE':_0xe3c8('0x7'),'CALLERID(all)':_0x34ad7d[_0xe3c8('0x26')][_0x115e47][_0xe3c8('0x16c')](),'XMD-AMD':_0x5af216['dialAMDActive']?_0xe3c8('0x171'):_0xe3c8('0x16e'),'XMD-DESTINATION':_0xe3c8('0x172')};if(_0x5af216[_0xe3c8('0xea')]){_0x39e78c[_0xe3c8('0x173')]=_0x5af216[_0xe3c8('0x174')]||0x9c4;_0x39e78c[_0xe3c8('0x175')]=_0x5af216[_0xe3c8('0x176')]||0x5dc;_0x39e78c['XMD-AMDAFTERGREETINGSILENCE']=_0x5af216[_0xe3c8('0x177')]||0x320;_0x39e78c['XMD-AMDTOTALANALYSISTIME']=_0x5af216[_0xe3c8('0x178')]||0x1388;_0x39e78c[_0xe3c8('0x179')]=_0x5af216[_0xe3c8('0x17a')]||0x64;_0x39e78c[_0xe3c8('0x17b')]=_0x5af216['dialAMDBetweenWordsSilence']||0x32;_0x39e78c['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x5af216['dialAMDMaximumNumberOfWords']||0x3;_0x39e78c[_0xe3c8('0x17c')]=_0x5af216[_0xe3c8('0x17d')]||0x100;_0x39e78c[_0xe3c8('0x17e')]=_0x5af216['dialAMDMaximumWordLength']||0x1388;}if(_0x5af216['type']===_0xe3c8('0x8e')){_0x39e78c[_0xe3c8('0x17f')]=_0x455703[_0xe3c8('0xd6')];}else{_0x39e78c['XMD-CAMPAIGNID']=_0x455703['CampaignId'];}for(var _0x20da39 in _0x455703[_0xe3c8('0x180')]){if(typeof _0x455703[_0xe3c8('0x180')][_0x20da39]!==_0xe3c8('0x98')){if(isNotNull(_0x455703[_0xe3c8('0x180')][_0x20da39])&&_0x20da39!=='id'&&_0x20da39!==_0xe3c8('0x181')&&_0x20da39!=='createdAt'&&_0x20da39!==_0xe3c8('0x182')){_0x39e78c[util[_0xe3c8('0x90')](_0xe3c8('0x183'),_0xe3c8('0x184'),_[_0xe3c8('0x185')](_0x20da39))]=_0x455703[_0xe3c8('0x180')][_0x20da39];}}}var _0x582cb5=_0x34ad7d[_0xe3c8('0xdc')](_0x5af216[_0xe3c8('0x75')])?getCallerId(_0x5af216[_0xe3c8('0x75')][_0xe3c8('0x77')],_0x5af216['dialOriginateCallerIdName'],_0x5af216[_0xe3c8('0x186')]>0x0?getCallerIdRandom(_0x5af216[_0xe3c8('0x187')],_0x5af216[_0xe3c8('0x186')]):_0x5af216['dialOriginateCallerIdNumber']):getCallerId(_[_0xe3c8('0xaa')](_0x5af216[_0xe3c8('0x188')])?_0x5af216[_0xe3c8('0x75')]['callerid']:_0x5af216['TrunkBackup'][_0xe3c8('0x77')],_0x5af216[_0xe3c8('0x189')],_0x5af216[_0xe3c8('0x186')]>0x0?getCallerIdRandom(_0x5af216['dialOriginateCallerIdNumber'],_0x5af216[_0xe3c8('0x186')]):_0x5af216[_0xe3c8('0x187')]);if(_0x582cb5){_0x39e78c[_0xe3c8('0x18a')]=_0x34ad7d[_0xe3c8('0x26')][_0x115e47][_0xe3c8('0x18b')]=extractCalleridName(_0x582cb5);_0x39e78c[_0xe3c8('0x18c')]=_0x455703['phone'];}return ami[_0xe3c8('0xab')]({'actionid':_0x115e47,'action':_0xe3c8('0x169'),'channel':_0x34ad7d[_0xe3c8('0xdc')](_0x5af216[_0xe3c8('0x75')])?util[_0xe3c8('0x90')](_0xe3c8('0x18d'),_0x5af216[_0xe3c8('0x75')][_0xe3c8('0x40')],isNotNull(_0x5af216[_0xe3c8('0x18e')])?_0x5af216[_0xe3c8('0x18e')][_0xe3c8('0x18f')]()||'':'',_0x5af216[_0xe3c8('0x190')]>0x0?_0x455703[_0xe3c8('0x16b')][_0xe3c8('0x191')](_0x5af216[_0xe3c8('0x190')]):_0x455703['phone']):util['format'](_0xe3c8('0x18d'),_['isNil'](_0x5af216['TrunkBackup'])?_0x5af216[_0xe3c8('0x75')][_0xe3c8('0x40')]:_0x5af216[_0xe3c8('0x188')]['name'],isNotNull(_0x5af216['dialPrefix'])?_0x5af216[_0xe3c8('0x18e')]['trim']()||'':'',_0x5af216[_0xe3c8('0x190')]>0x0?_0x455703[_0xe3c8('0x16b')][_0xe3c8('0x191')](_0x5af216['dialCutDigit']):_0x455703[_0xe3c8('0x16b')]),'callerid':_0x582cb5,'Exten':_0xe3c8('0x172'),'Context':_0xe3c8('0x192'),'Priority':'1','variable':_0x39e78c,'timeout':(_0x5af216[_0xe3c8('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x115e47})['then'](function(_0x5e7b6a){return _0x15cd8f(_0x5e7b6a);})[_0xe3c8('0xae')](function(_0x1c11cd){_0x5af216['outboundOriginateFailureCallsDay']+=0x1;var _0x540635=new History(_0x34ad7d[_0xe3c8('0x26')][_0x115e47]);logger[_0xe3c8('0x94')](util[_0xe3c8('0x90')]('[originateError]:\x20%s',JSON[_0xe3c8('0x49')](_0x1c11cd)));_0x540635['state']=0xe;_0x540635[_0xe3c8('0xa5')]=_0xe3c8('0x193');_0x540635[_0xe3c8('0xa7')]=moment()[_0xe3c8('0x90')](_0xe3c8('0xff'));_0x540635[_0xe3c8('0xa6')]=_0x540635[_0xe3c8('0xa7')];_0x34ad7d[_0xe3c8('0xcc')](_0x540635)['catch'](loggerCatch('[originate][error]'));_0x34ad7d[_0xe3c8('0xca')](_0x540635)['catch'](loggerCatch(_0xe3c8('0x194')))['finally'](function(){delete _0x34ad7d['actions'][_0x115e47];return _0x22b7f7(msgResponse(_0xe3c8('0x169'),_0xe3c8('0x48'),_0xe3c8('0x195')));});});});};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x32')]=function(_0x3f40c2){var _0x2154a8=this['actions'][_0x3f40c2[_0xe3c8('0x12c')]];if(_0x2154a8){delete this[_0xe3c8('0x26')][_0x3f40c2[_0xe3c8('0x12c')]];_0x2154a8[_0xe3c8('0x196')]=moment()[_0xe3c8('0x90')](_0xe3c8('0xff'));var _0x26ab6a=_0x2154a8['type']===_0xe3c8('0x79')?this[_0xe3c8('0x21')][_0x2154a8[_0xe3c8('0xb1')]]:this[_0xe3c8('0x20')][_0x2154a8['getQueue']()];if(!this[_0xe3c8('0xda')](_0x3f40c2['response'])){this[_0xe3c8('0xb0')](_0x26ab6a);return this[_0xe3c8('0x197')](_0x2154a8,_0x26ab6a,_0x3f40c2)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x198')));}this['uniqueId'][_0x3f40c2[_0xe3c8('0xe0')]]=_0x2154a8;}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x199')]=function(_0x58a177,_0x5072b6,_0x1fb2fa){var _0x17cdef=new History(_0x5072b6);if(_0x17cdef[_0xe3c8('0xf0')]+_0x17cdef[_0xe3c8('0xf1')]+_0x17cdef[_0xe3c8('0xf2')]+_0x17cdef[_0xe3c8('0xf3')]+_0x17cdef['countdropretry']+_0x17cdef[_0xe3c8('0xf5')]+_0x17cdef[_0xe3c8('0xf6')]+_0x17cdef[_0xe3c8('0xf7')]>=_0x1fb2fa[_0xe3c8('0x105')]-0x1){return!![];}switch(_0x58a177){case 0x3:if(_0x17cdef[_0xe3c8('0xf2')]>=_0x1fb2fa[_0xe3c8('0x19a')]-0x1){return!![];}this[_0xe3c8('0xc0')]({'active':![],'countnoanswerretry':_0x17cdef[_0xe3c8('0xf2')]+=0x1,'scheduledat':moment()[_0xe3c8('0x106')](_0x1fb2fa['dialNoAnswerRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17cdef[_0xe3c8('0xd4')],'ListId':_0x17cdef[_0xe3c8('0xd5')],'VoiceQueueId':_0x17cdef[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x17cdef['CampaignId']||undefined})['catch'](loggerCatch(_0xe3c8('0x19b')));break;case 0x5:if(_0x17cdef[_0xe3c8('0xf0')]>=_0x1fb2fa[_0xe3c8('0x19c')]-0x1){return!![];}this[_0xe3c8('0xc0')]({'active':![],'countbusyretry':_0x17cdef[_0xe3c8('0xf0')]+=0x1,'scheduledat':moment()[_0xe3c8('0x106')](_0x1fb2fa[_0xe3c8('0x19d')],_0xe3c8('0xfe'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17cdef[_0xe3c8('0xd4')],'ListId':_0x17cdef['ListId'],'VoiceQueueId':_0x17cdef['VoiceQueueId']||undefined,'CampaignId':_0x17cdef[_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x17cdef[_0xe3c8('0xf1')]>=_0x1fb2fa[_0xe3c8('0x19e')]-0x1){return!![];}this[_0xe3c8('0xc0')]({'active':![],'countcongestionretry':_0x17cdef[_0xe3c8('0xf1')]+=0x1,'scheduledat':moment()[_0xe3c8('0x106')](_0x1fb2fa[_0xe3c8('0x19f')],_0xe3c8('0xfe'))[_0xe3c8('0x90')](_0xe3c8('0xff')),'ContactId':_0x17cdef[_0xe3c8('0xd4')],'ListId':_0x17cdef[_0xe3c8('0xd5')],'VoiceQueueId':_0x17cdef[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x17cdef[_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x1a0')));break;case 0x0:if(_0x17cdef[_0xe3c8('0xf3')]>=_0x1fb2fa[_0xe3c8('0x1a1')]-0x1){return!![];}else{this[_0xe3c8('0xc0')]({'active':![],'countnosuchnumberretry':_0x17cdef['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x1fb2fa[_0xe3c8('0x1a2')],_0xe3c8('0xfe'))['format'](_0xe3c8('0xff')),'ContactId':_0x17cdef['ContactId'],'ListId':_0x17cdef[_0xe3c8('0xd5')],'VoiceQueueId':_0x17cdef[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x17cdef[_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x17cdef[_0xe3c8('0xf4')]>=_0x1fb2fa[_0xe3c8('0x120')]-0x1){return!![];}this[_0xe3c8('0xc0')]({'active':![],'countdropretry':_0x17cdef[_0xe3c8('0xf4')]+=0x1,'scheduledat':moment()[_0xe3c8('0x106')](_0x1fb2fa[_0xe3c8('0x11c')],'minutes')[_0xe3c8('0x90')](_0xe3c8('0xff')),'ContactId':_0x17cdef[_0xe3c8('0xd4')],'ListId':_0x17cdef[_0xe3c8('0xd5')],'VoiceQueueId':_0x17cdef[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x17cdef[_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x121')));break;case 0xb:if(_0x17cdef[_0xe3c8('0xf5')]>=_0x1fb2fa['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xe3c8('0xc0')]({'active':![],'countabandonedretry':_0x17cdef[_0xe3c8('0xf5')]+=0x1,'scheduledat':moment()[_0xe3c8('0x106')](_0x1fb2fa[_0xe3c8('0x128')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17cdef[_0xe3c8('0xd4')],'ListId':_0x17cdef[_0xe3c8('0xd5')],'VoiceQueueId':_0x17cdef[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x17cdef['CampaignId']||undefined})[_0xe3c8('0xae')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x17cdef[_0xe3c8('0xf6')]>=_0x1fb2fa['dialMachineMaxRetry']-0x1){return!![];}this[_0xe3c8('0xc0')]({'active':![],'countmachineretry':_0x17cdef[_0xe3c8('0xf6')]+=0x1,'scheduledat':moment()[_0xe3c8('0x106')](_0x1fb2fa[_0xe3c8('0xfd')],'minutes')[_0xe3c8('0x90')](_0xe3c8('0xff')),'ContactId':_0x17cdef[_0xe3c8('0xd4')],'ListId':_0x17cdef[_0xe3c8('0xd5')],'VoiceQueueId':_0x17cdef[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x17cdef[_0xe3c8('0xd7')]||undefined})['catch'](loggerCatch(_0xe3c8('0x100')));break;case 0x14:if(_0x17cdef[_0xe3c8('0xf7')]>=_0x1fb2fa[_0xe3c8('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x17cdef[_0xe3c8('0xf7')]+=0x1,'scheduledat':moment()[_0xe3c8('0x106')](_0x1fb2fa[_0xe3c8('0x1a4')],_0xe3c8('0xfe'))[_0xe3c8('0x90')](_0xe3c8('0xff')),'ContactId':_0x17cdef['ContactId'],'ListId':_0x17cdef[_0xe3c8('0xd5')],'VoiceQueueId':_0x17cdef[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x17cdef[_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x1a5')));break;default:return!![];}};Dialer['prototype'][_0xe3c8('0x197')]=function(_0x2a3462,_0x46684a,_0x5b8b7a){var _0x5d2e4d=this;var _0x114b59=new History(_0x2a3462);var _0x153713=![];var _0x408b84;var _0x3539ba;return new BPromise(function(_0x17fa7f,_0x2f0c49){if(_[_0xe3c8('0x3e')](_0x46684a)&&typeof _0x46684a!=='object'){return _0x2f0c49(msgResponse(_0xe3c8('0x1a6'),'Failure','entity\x20is\x20undefine'));}if(_[_0xe3c8('0x3e')](_0x5b8b7a)&&typeof _0x5b8b7a!=='object'){return _0x2f0c49(msgResponse('[callProgressDetecting]','Failure',_0xe3c8('0x1a7')));}_0x5d2e4d[_0xe3c8('0xb9')](_0x114b59,_0x5b8b7a[_0xe3c8('0x10f')],_0x46684a)[_0xe3c8('0xb8')](function(_0x59d91a){if(_0x59d91a[_0xe3c8('0x11f')]==0x1)_0x153713=!![];switch(_0x5b8b7a[_0xe3c8('0x10f')]){case'0':_0x46684a['outboundNoSuchCallsDay']+=0x1;_0x114b59['state']=0x0;_0x114b59[_0xe3c8('0xa5')]=_0xe3c8('0x1a8');_0x114b59[_0xe3c8('0xf3')]+=0x1;_0x114b59[_0xe3c8('0x104')]+=0x1;ami['emit'](_0xe3c8('0x1a9'),ut[_0xe3c8('0x101')](_0x2a3462,_0xe3c8('0x1aa')));_0x408b84=_0x46684a['dialNoSuchNumberRetryFrequency'];_0x3539ba=_0x46684a[_0xe3c8('0x11d')];_0x5d2e4d['createHistory'](_0x114b59)['catch'](loggerCatch(_0xe3c8('0xef')));if(_0x5d2e4d[_0xe3c8('0x199')](0x0,_0x2a3462,_0x46684a)&&!_0x153713){if(_0x114b59[_0xe3c8('0xf3')]>=_0x46684a[_0xe3c8('0x1a1')]){_0x5d2e4d[_0xe3c8('0xfb')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1ab'));}else{_0x5d2e4d[_0xe3c8('0xf8')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1ab'));}}break;case'3':_0x46684a['outboundNoAnswerCallsDay']+=0x1;_0x114b59[_0xe3c8('0xa4')]=0x3;_0x114b59['statedesc']=_0xe3c8('0x1ac');_0x114b59[_0xe3c8('0xf2')]+=0x1;_0x114b59[_0xe3c8('0x104')]+=0x1;ami[_0xe3c8('0x4d')]('custom:agentnoanswer',ut[_0xe3c8('0x101')](_0x2a3462,_0xe3c8('0x1ad')));_0x408b84=_0x46684a[_0xe3c8('0x1ae')];_0x3539ba=_0x46684a[_0xe3c8('0x11d')];_0x5d2e4d[_0xe3c8('0xcc')](_0x114b59)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x1af')));if(_0x5d2e4d[_0xe3c8('0x199')](0x3,_0x2a3462,_0x46684a)&&!_0x153713){if(_0x114b59[_0xe3c8('0xf2')]>=_0x46684a['dialNoAnswerMaxRetry']){_0x5d2e4d[_0xe3c8('0xfb')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1b0'));}else{_0x5d2e4d['stateGlobal'](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1b0'));}}break;case'5':_0x46684a[_0xe3c8('0x60')]+=0x1;_0x114b59[_0xe3c8('0xa4')]=0x5;_0x114b59[_0xe3c8('0xa5')]=_0xe3c8('0x1b1');_0x114b59[_0xe3c8('0xf0')]+=0x1;_0x114b59[_0xe3c8('0x104')]+=0x1;ami['emit']('custom:agentbusy',ut[_0xe3c8('0x101')](_0x2a3462,_0xe3c8('0x1b2')));_0x408b84=_0x46684a['dialBusyRetryFrequency'];_0x3539ba=_0x46684a[_0xe3c8('0x11d')];_0x5d2e4d[_0xe3c8('0xcc')](_0x114b59)['catch'](loggerCatch(_0xe3c8('0x1b3')));if(_0x5d2e4d[_0xe3c8('0x199')](0x5,_0x2a3462,_0x46684a)&&!_0x153713){if(_0x114b59[_0xe3c8('0xf0')]>=_0x46684a[_0xe3c8('0x19c')]){_0x5d2e4d[_0xe3c8('0xfb')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1b4'));}else{_0x5d2e4d[_0xe3c8('0xf8')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1b4'));}}break;case'8':_0x46684a['outboundCongestionCallsDay']+=0x1;_0x114b59['state']=0x8;_0x114b59[_0xe3c8('0xa5')]=_0xe3c8('0x1b5');_0x114b59[_0xe3c8('0xf1')]+=0x1;_0x114b59[_0xe3c8('0x104')]+=0x1;_0x408b84=_0x46684a['dialCongestionRetryFrequency'];_0x3539ba=_0x46684a[_0xe3c8('0x11d')];ami[_0xe3c8('0x4d')](_0xe3c8('0x1b6'),ut[_0xe3c8('0x101')](_0x2a3462,'congestion'));_0x5d2e4d[_0xe3c8('0xcc')](_0x114b59)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x1b7')));if(_0x5d2e4d['checkRetriveMax'](0x8,_0x2a3462,_0x46684a)&&!_0x153713){if(_0x114b59[_0xe3c8('0xf1')]>=_0x46684a[_0xe3c8('0x19e')]){_0x5d2e4d[_0xe3c8('0xfb')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1b8'));}else{_0x5d2e4d['stateGlobal'](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1b8'));}}break;case'11':_0x46684a[_0xe3c8('0x1b9')]+=0x1;_0x114b59['state']=0xb;_0x114b59[_0xe3c8('0xa5')]=_0xe3c8('0x126');_0x114b59['countabandonedretry']+=0x1;_0x114b59[_0xe3c8('0x104')]+=0x1;_0x408b84=_0x46684a['dialAbandonedRetryFrequency'];_0x3539ba=_0x46684a[_0xe3c8('0x11d')];_0x5d2e4d[_0xe3c8('0xcc')](_0x114b59)[_0xe3c8('0xae')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x5d2e4d[_0xe3c8('0x199')](0xb,_0x2a3462,_0x46684a)&&!_0x153713){if(_0x114b59[_0xe3c8('0xf5')]>=_0x46684a[_0xe3c8('0x129')]){_0x5d2e4d[_0xe3c8('0xfb')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1ba'));}else{_0x5d2e4d[_0xe3c8('0xf8')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1ba'));}}break;case'20':_0x46684a[_0xe3c8('0x1bb')]+=0x1;_0x114b59[_0xe3c8('0xa4')]=0x14;_0x114b59[_0xe3c8('0xa5')]=_0xe3c8('0x1bc');_0x114b59[_0xe3c8('0xf7')]+=0x1;_0x114b59[_0xe3c8('0x104')]+=0x1;_0x408b84=_0x46684a[_0xe3c8('0x1a4')];_0x3539ba=_0x46684a[_0xe3c8('0x11d')];ami[_0xe3c8('0x4d')](_0xe3c8('0x1bd'),ut[_0xe3c8('0x101')](_0x2a3462,_0xe3c8('0x1be')));_0x5d2e4d['createHistory'](_0x114b59)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x1bf')));if(_0x5d2e4d['checkRetriveMax'](0x14,_0x2a3462,_0x46684a)&&!_0x153713){if(_0x114b59['countagentrejectretry']>=_0x46684a[_0xe3c8('0x1a3')]){_0x5d2e4d[_0xe3c8('0xfb')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1c0'));}else{_0x5d2e4d[_0xe3c8('0xf8')](_0x114b59,_0x17fa7f,_0x2f0c49,_0xe3c8('0x1c0'));}}break;default:_0x46684a[_0xe3c8('0x10c')]+=0x1;_0x114b59[_0xe3c8('0xa4')]=0xc;_0x114b59[_0xe3c8('0xa5')]=_0x5b8b7a[_0xe3c8('0x10f')];_0x408b84=_0x46684a[_0xe3c8('0x1a4')];_0x3539ba=_0x46684a[_0xe3c8('0x11d')];_0x5d2e4d[_0xe3c8('0xcc')](_0x114b59)[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x1c1')));if(_0x5d2e4d['checkRetriveMax'](_0x5b8b7a['reason'],_0x2a3462,_0x46684a)&&!_0x153713){if(_0x114b59[_0xe3c8('0xf0')]+_0x114b59[_0xe3c8('0xf1')]+_0x114b59['countnoanswerretry']+_0x114b59[_0xe3c8('0xf3')]+_0x114b59[_0xe3c8('0xf4')]+_0x114b59['countabandonedretry']+_0x114b59[_0xe3c8('0xf6')]+_0x114b59[_0xe3c8('0xf7')]>=_0x46684a[_0xe3c8('0x105')]){_0x5d2e4d['stateGlobal'](_0x114b59,_0x17fa7f,_0x2f0c49,_0x5b8b7a['reason']);}else{_0x5d2e4d[_0xe3c8('0xfb')](_0x114b59,_0x17fa7f,_0x2f0c49,_0x5b8b7a[_0xe3c8('0x10f')]);}}}})[_0xe3c8('0xb8')](function(_0x3c3989){if(_0x153713){_0x5d2e4d['swapAdditionalPhones'](_0x114b59,_0x408b84,_0x3539ba)[_0xe3c8('0xb8')](function(_0x536c5a){return _0x17fa7f(0x1);});}});});};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xf8')]=function(_0x355c23,_0x2f3821,_0x171b7c,_0xa00267){var _0x25bc94=new Final(_0x355c23);_0x25bc94[_0xe3c8('0xa4')]=0xf;_0x25bc94[_0xe3c8('0xa5')]=_0xe3c8('0x1c2');this['createStateFinal'](_0x25bc94,_0x2f3821,_0x171b7c,_0xa00267);};Dialer[_0xe3c8('0x1b')][_0xe3c8('0xfb')]=function(_0x393b30,_0x3bb92c,_0x4b0a28,_0x2fda39){this[_0xe3c8('0xca')](_0x393b30)[_0xe3c8('0xb8')](function(){return _0x3bb92c(msgResponse(_0xe3c8('0x1a6'),'Success',_0x2fda39));})[_0xe3c8('0xae')](function(){return _0x4b0a28(msgResponse('[moveContactManagedDialer][0]','Failure',_0xe3c8('0x1c3')));});};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x8')]=function(_0x109fdb){var _0x537794=_0x109fdb['dialPredictiveOptimizationPercentage']/0x64;var _0x9c4816=_0x109fdb[_0xe3c8('0x63')]/(_0x109fdb['outboundDropCallsDayTimeout']+_0x109fdb['outboundAnswerCallsDay']);var _0x135d95=Math[_0xe3c8('0x1c4')](_0x109fdb[_0xe3c8('0x6e')]*(_0x109fdb[_0xe3c8('0x1c5')]/0x64));var _0xa6cbdb=Math['round'](_0x109fdb[_0xe3c8('0x6e')]*(_0x109fdb[_0xe3c8('0x1c6')]/0x64));var _0x441f5e=_0x109fdb['available']+_0x109fdb[_0xe3c8('0x55')];var _0x2e9e19=Math[_0xe3c8('0x1c7')](_0x109fdb[_0xe3c8('0x70')]*_0x109fdb['erlangAbandonmentRate']*_0x109fdb[_0xe3c8('0x6b')]*_0x109fdb['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x109fdb[_0xe3c8('0x74')])){if(!_['isUndefined'](_0x109fdb[_0xe3c8('0x29')])){_0x109fdb[_0xe3c8('0x29')]=undefined;loggerPredictive[_0xe3c8('0x94')]('[startMethodPredictive][StartProgressive]',_0xe3c8('0x1c8'));}if(!_[_0xe3c8('0x3e')](_0x109fdb['handlePredictive'])){loggerPredictive[_0xe3c8('0x94')](_0xe3c8('0x1c9'),_0xe3c8('0x1ca'));clearInterval(_0x109fdb['handlePredictive']);_0x109fdb[_0xe3c8('0x8c')]=undefined;}_0x109fdb['startProgressive']=moment()['format'](_0xe3c8('0xff'));loggerPredictive[_0xe3c8('0x7c')](_0x109fdb[_0xe3c8('0x40')],_0xe3c8('0x1cb'),_0x109fdb[_0xe3c8('0x74')]);this[_0xe3c8('0x158')](_0x109fdb,0x1);}else if(ifInterval(_0x109fdb[_0xe3c8('0x1cc')],_0x109fdb[_0xe3c8('0x74')])){this[_0xe3c8('0x158')](_0x109fdb,0x1);loggerPredictiveCalls['info'](_0xe3c8('0x1cd'),_0x109fdb[_0xe3c8('0x74')],_0x109fdb[_0xe3c8('0x40')]);_0x109fdb[_0xe3c8('0x70')]=0x0;_0x109fdb[_0xe3c8('0x6a')]=0x0;}else if(_0x537794<_0x9c4816&&_0x109fdb[_0xe3c8('0x1ce')]==='dropRate'){freeVariablesPredictive(_0x109fdb);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x1cf'),_0xe3c8('0x1d0'),_0x9c4816,'startProgressive',_0x109fdb[_0xe3c8('0x40')]);}else if(_0x2e9e19<_0x109fdb['predictiveIntervalErlangCallsDroppedCalls']&&_0x109fdb[_0xe3c8('0x1ce')]==='dropRate'){freeVariablesPredictive(_0x109fdb);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x1d1'),_0xe3c8('0x1d2'),_0x2e9e19,_0xe3c8('0x1d3'),_0x109fdb['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x109fdb[_0xe3c8('0x40')]);}else if(!ifInterval(_0x109fdb[_0xe3c8('0x1cc')],_0x109fdb[_0xe3c8('0x74')])&&_['isUndefined'](_0x109fdb['startPredictive'])&&!_[_0xe3c8('0x3e')](_0x109fdb[_0xe3c8('0x74')])){_0x109fdb[_0xe3c8('0x29')]=moment()[_0xe3c8('0x90')](_0xe3c8('0xff'));loggerPredictive[_0xe3c8('0x7c')](_0x109fdb[_0xe3c8('0x40')],_0xe3c8('0x1d4'),_0x109fdb[_0xe3c8('0x29')]);this[_0xe3c8('0xbe')](_0x109fdb[_0xe3c8('0x1cc')])[_0xe3c8('0xb8')](this[_0xe3c8('0x1d5')](_0x109fdb))['then'](mergeDataErlangB(_0x109fdb))[_0xe3c8('0xb8')](this[_0xe3c8('0x1d6')](_0x109fdb))[_0xe3c8('0xae')](loggerCatchPredictive(_0xe3c8('0x1d7'),_0x109fdb));}else if(!ifInterval(_0x109fdb['dialPredictiveInterval'],_0x109fdb[_0xe3c8('0x29')])){_0x109fdb['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x109fdb['startPredictive']=moment()[_0xe3c8('0x90')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x109fdb['name'],'recalculate\x20predictive\x20at',_0x109fdb['startPredictive']);clearInterval(_0x109fdb[_0xe3c8('0x8c')]);_0x109fdb['handlePredictive']=undefined;this[_0xe3c8('0xbe')](_0x109fdb[_0xe3c8('0x1cc')])[_0xe3c8('0xb8')](this[_0xe3c8('0x1d5')](_0x109fdb))[_0xe3c8('0xb8')](mergeDataErlangB(_0x109fdb))[_0xe3c8('0xb8')](this['startMethodPredictive'](_0x109fdb))['catch'](loggerCatchPredictive(_0xe3c8('0x1d8'),_0x109fdb));}else if(_0x109fdb[_0xe3c8('0x6e')]&&_0x441f5e<_0x109fdb[_0xe3c8('0x6e')]-_0xa6cbdb){freeVariablesPredictive(_0x109fdb);loggerPredictive[_0xe3c8('0x7c')](_0x109fdb[_0xe3c8('0x40')],_0xe3c8('0x1d9'),_0x441f5e,_0xe3c8('0x1da'),_0x109fdb[_0xe3c8('0x6e')],'-',_0xa6cbdb,'=',_0x109fdb['predictiveIntervalAvailable']-_0xa6cbdb,')');}else if(_0x109fdb['predictiveIntervalAvailable']&&_0x441f5e>_0x109fdb[_0xe3c8('0x6e')]+_0x135d95){freeVariablesPredictive(_0x109fdb);loggerPredictive[_0xe3c8('0x7c')](_0x109fdb[_0xe3c8('0x40')],_0xe3c8('0x1d9'),_0x441f5e,_0xe3c8('0x1db'),_0x109fdb[_0xe3c8('0x6e')],'+',_0x135d95,'=',_0x109fdb[_0xe3c8('0x6e')]+_0x135d95,')');}};Dialer['prototype'][_0xe3c8('0x1d5')]=function(_0x44668b){var _0x560480=this;return function(_0x24177e){return new BPromise(function(_0xe0ddd9,_0x1e9fc0){_[_0xe3c8('0x89')](_0x44668b,_0x24177e[0x0]);if(checkGetDataPredictive(_0x24177e[0x0])){var _0x434d75=_0x44668b['predictiveIntervalAvailable']=_0x44668b[_0xe3c8('0x55')]+_0x44668b[_0xe3c8('0x51')];var _0x309dd5=_0x44668b[_0xe3c8('0x1cc')]*0x3c;var _0xd6cd51=_0x24177e[0x0][_0xe3c8('0x68')]+_0x24177e[0x0][_0xe3c8('0x67')];var _0x2aff50=(_0x24177e[0x0]['predictiveIntervalAnsweredCalls']+_0x24177e[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x24177e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x24177e[0x0][_0xe3c8('0x6f')];_0x44668b['predictiveIntervalHitRate']=_0x2aff50>0x0?_0x2aff50:0x1;switch(_0x44668b[_0xe3c8('0x1ce')]){case _0xe3c8('0x1dc'):var _0x45d14a=_0x44668b[_0xe3c8('0x1dd')]/0x64;return _0x560480[_0xe3c8('0x1de')](_0x434d75,_0x309dd5,_0xd6cd51,_0x2aff50,_0x45d14a)[_0xe3c8('0xb8')](function(_0x1ae2f0){return _0xe0ddd9(_0x1ae2f0);});case _0xe3c8('0x1df'):var _0x3eb836=_0x44668b['dialPredictiveOptimizationPercentage']/0x64;return _0x560480[_0xe3c8('0x1e0')](_0x434d75,_0x309dd5,_0xd6cd51,_0x2aff50,_0x3eb836)[_0xe3c8('0xb8')](function(_0x175471){return _0xe0ddd9(_0x175471);});default:return _0x1e9fc0(msgResponse('[getDataPredictive]',_0xe3c8('0x147'),'Unknown\x20Predictive'));}}else{return _0x1e9fc0(msgResponse('[getDataPredictive]',_0xe3c8('0x147'),_0xe3c8('0x1e1')));}});};};Dialer['prototype'][_0xe3c8('0x1e2')]=function(_0x4dd42b){var _0x3c1c31=this;return function(_0x48706d){return new BPromise(function(_0x1e80ce,_0x3d8cce){_[_0xe3c8('0x89')](_0x4dd42b,_0x48706d[0x0]);if(checkGetDataPredictive(_0x48706d[0x0])){loggerPredictive[_0xe3c8('0x7c')](JSON[_0xe3c8('0x49')](_0x48706d[0x0]));if(_0x4dd42b[_0xe3c8('0x1ce')]===_0xe3c8('0x1dc')){return _0x3c1c31['getVoiceQueueRtPauses'](_0x4dd42b['id'])[_0xe3c8('0xb8')](function(_0x4f056e){var _0x4124f6=_0x4dd42b[_0xe3c8('0x15e')]-_0x4f056e[0x0][_0xe3c8('0x1e3')];var _0x3f33e2=_0x4dd42b['dialPredictiveInterval']*0x3c;var _0x35efa8=_0x48706d[0x0][_0xe3c8('0x68')]+_0x48706d[0x0][_0xe3c8('0x67')];var _0x3d1a59=(_0x48706d[0x0][_0xe3c8('0x1e4')]+_0x48706d[0x0][_0xe3c8('0x80')]+_0x48706d[0x0][_0xe3c8('0x69')])/_0x48706d[0x0][_0xe3c8('0x6f')];var _0x2af7a8=_0x4dd42b[_0xe3c8('0x1dd')]/0x64;_0x4dd42b['predictiveIntervalPauses']=_0x4f056e[0x0][_0xe3c8('0x1e3')]||0x0;_0x4dd42b[_0xe3c8('0x6b')]=_0x3d1a59>0x0?_0x3d1a59:0x1;return _0x3c1c31[_0xe3c8('0x1de')](_0x4124f6,_0x3f33e2,_0x35efa8,_0x3d1a59,_0x2af7a8);})[_0xe3c8('0xb8')](function(_0x3f6b67){return _0x1e80ce(_0x3f6b67);})[_0xe3c8('0xae')](function(_0x5b9e1f){return _0x3d8cce(msgResponse(_0xe3c8('0x1e5'),_0xe3c8('0x147'),JSON[_0xe3c8('0x49')](_0x5b9e1f)));});}if(_0x4dd42b[_0xe3c8('0x1ce')]===_0xe3c8('0x1df')){return _0x3c1c31['getVoiceQueueRtPauses'](_0x4dd42b['id'])[_0xe3c8('0xb8')](function(_0x217353){var _0x34e536=_0x4dd42b[_0xe3c8('0x15e')]-_0x217353[0x0][_0xe3c8('0x1e3')];var _0x13ad89=_0x4dd42b[_0xe3c8('0x1cc')]*0x3c;var _0x41e0fe=_0x48706d[0x0][_0xe3c8('0x68')]+_0x48706d[0x0]['predictiveIntervalAvgHoldtime'];var _0x424fc3=(_0x48706d[0x0]['predictiveIntervalAnsweredCalls']+_0x48706d[0x0][_0xe3c8('0x80')]+_0x48706d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x48706d[0x0][_0xe3c8('0x6f')];var _0x4b22f6=_0x4dd42b[_0xe3c8('0x1dd')]/0x64;_0x4dd42b[_0xe3c8('0x6d')]=_0x217353[0x0][_0xe3c8('0x1e3')]||0x0;_0x4dd42b[_0xe3c8('0x6b')]=_0x424fc3>0x0?_0x424fc3:0x1;return _0x3c1c31[_0xe3c8('0x1e0')](_0x34e536,_0x13ad89,_0x41e0fe,_0x424fc3,_0x4b22f6);})[_0xe3c8('0xb8')](function(_0x428dc8){return _0x1e80ce(_0x428dc8);})[_0xe3c8('0xae')](function(_0x39266f){return _0x3d8cce(msgResponse('[CatchErlangB]',_0xe3c8('0x147'),JSON[_0xe3c8('0x49')](_0x39266f)));});}}else{return _0x3d8cce(msgResponse(_0xe3c8('0x1e6'),_0xe3c8('0x147'),'check\x20failure'));}});};};Dialer['prototype'][_0xe3c8('0x1d6')]=function(_0x102528){var _0x47330a=this;return function(){var _0x15e498=0x0;var _0x432687=Math['floor'](_0x102528[_0xe3c8('0x71')]*0x3e8);if(_0x432687>0x0){_0x432687=_0x432687<0x64?0x64:_0x432687;loggerPredictive[_0xe3c8('0x7c')](_0x102528[_0xe3c8('0x40')],_0xe3c8('0x1e7'),_0x432687,_0xe3c8('0x4a'));_0x102528[_0xe3c8('0x8c')]=setInterval(function(){_0x47330a[_0xe3c8('0x8c')](_0x102528);loggerPredictiveCalls[_0xe3c8('0x7c')]('[handlePredictive]',_0x15e498+=0x1);},_0x432687);}else{loggerPredictive[_0xe3c8('0x7c')](_0x102528[_0xe3c8('0x40')],_0xe3c8('0x1e8'));}};};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x1e9')]=function(_0x4ae3e6,_0x3ad527){var _0x4858e9=this;return function(_0x4b4cc4){if(_[_0xe3c8('0x46')](_0x4b4cc4)){if(_[_0xe3c8('0xaa')](_0x3ad527[_0xe3c8('0x1ea')])||!_0x3ad527[_0xe3c8('0x1eb')]){if(_0x4ae3e6[_0xe3c8('0x5b')]===_0xe3c8('0x159')){_0x4ae3e6[_0xe3c8('0x132')]=_[_0xe3c8('0x3e')](_0x4ae3e6[_0xe3c8('0x132')])?!![]:_0x4ae3e6['queueStatusComplete'];var _0x2feb80=uuid['v4']();_0x4858e9[_0xe3c8('0x26')][_0x2feb80]=new Action(_0x4ae3e6,_0x3ad527,_0x2feb80);loggerBooked[_0xe3c8('0x7c')](_0xe3c8('0x1ec'),_0x2feb80,_0xe3c8('0x1ed'),JSON[_0xe3c8('0x49')](_0x4ae3e6[_0xe3c8('0x132')]),_0xe3c8('0x1ee'),_0x4ae3e6[_0xe3c8('0x40')]);if(_0x4ae3e6[_0xe3c8('0x132')]){_0x4ae3e6['queueStatusComplete']=![];_0x4858e9[_0xe3c8('0x2b')][_0x4858e9[_0xe3c8('0x26')][_0x2feb80][_0xe3c8('0xb1')]]=[];ami[_0xe3c8('0xab')]({'actionid':_0x2feb80,'action':_0xe3c8('0x1ef'),'queue':_0x4ae3e6[_0xe3c8('0x40')]})['catch'](function(){_0x4858e9[_0xe3c8('0xb0')](_0x4ae3e6);_0x4858e9[_0xe3c8('0xc0')]({'active':![],'ContactId':_0x4858e9[_0xe3c8('0x26')][_0x2feb80][_0xe3c8('0xd4')],'ListId':_0x4858e9[_0xe3c8('0x26')][_0x2feb80][_0xe3c8('0xd5')],'VoiceQueueId':_0x4858e9[_0xe3c8('0x26')][_0x2feb80][_0xe3c8('0xd6')]||undefined,'CampaignId':_0x4858e9[_0xe3c8('0x26')][_0x2feb80][_0xe3c8('0xd7')]||undefined})['catch'](loggerCatch(_0xe3c8('0x1f0')));delete _0x4858e9[_0xe3c8('0x26')][_0x2feb80];});}else{loggerBooked['info'](_0xe3c8('0x1f1'),JSON[_0xe3c8('0x49')](_0x4ae3e6[_0xe3c8('0x132')]),'Queue:\x20',_0x4ae3e6[_0xe3c8('0x40')]);_0x4858e9[_0xe3c8('0xb0')](_0x4ae3e6);_0x4858e9['rescheduleContact']({'active':![],'ContactId':_0x4858e9[_0xe3c8('0x26')][_0x2feb80]['ContactId'],'ListId':_0x4858e9[_0xe3c8('0x26')][_0x2feb80]['ListId'],'VoiceQueueId':_0x4858e9[_0xe3c8('0x26')][_0x2feb80]['VoiceQueueId']||undefined,'CampaignId':_0x4858e9[_0xe3c8('0x26')][_0x2feb80]['CampaignId']||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x1f0')));delete _0x4858e9['actions'][_0x2feb80];}}else{return _0x4858e9[_0xe3c8('0x1f2')](_0x4ae3e6,_0x3ad527);}}else{if(getDiff(_0x3ad527[_0xe3c8('0x1f3')])<_0x4ae3e6[_0xe3c8('0x1f4')]*0x3c){if(_0x3ad527[_0xe3c8('0x1f5')]&&!_0x3ad527[_0xe3c8('0x1f5')]['voicePause']){_0x4858e9[_0xe3c8('0x1f')][_0xe3c8('0x135')](_0x3ad527['id'])[_0xe3c8('0x1e')](function(){_0x4858e9[_0xe3c8('0xb0')](_0x4ae3e6);});}else{_0x4858e9[_0xe3c8('0xc2')]({'active':![]},_0x3ad527['id'],0x1)[_0xe3c8('0x1e')](function(){_0x4858e9[_0xe3c8('0xb0')](_0x4ae3e6);});}}else{_0x4ae3e6[_0xe3c8('0x1f6')]+=0x1;_0x4858e9[_0xe3c8('0xb0')](_0x4ae3e6);if(_0x4ae3e6['dialRecallInQueue']){_0x4858e9['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3ad527['ContactId'],'ListId':_0x3ad527['ListId'],'VoiceQueueId':_0x3ad527[_0xe3c8('0xd6')]||undefined,'CampaignId':_0x3ad527[_0xe3c8('0xd7')]||undefined})[_0xe3c8('0xae')](loggerCatch(_0xe3c8('0x1f7')));_0x4858e9['createHistory'](createObjHistory(_0x4ae3e6,_0x3ad527,_0xe3c8('0x1f8'),0x17,_0xe3c8('0x1f9')))[_0xe3c8('0xae')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x4858e9['saveInDb'](createObjHistory(_0x4ae3e6,_0x3ad527,_0xe3c8('0x1fa'),0x16,'RecallFailedTimeout'),_0xe3c8('0x1fb'),_0xe3c8('0x1fc'));}}}}else{_0x4ae3e6[_0xe3c8('0x5f')]+=0x1;_0x4858e9['saveInDb'](createObjHistory(_0x4ae3e6,_0x3ad527,_0xe3c8('0x1fd'),0xd,'Blacklist'),_0xe3c8('0x1fe'),_0xe3c8('0x1ff'));throw _0xe3c8('0x200');}};};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x15d')]=function(_0x575617){var _0x2d122d=this;var _0x448a62=_0x575617['limitCalls']-_0x575617[_0xe3c8('0x97')]-_0x575617['temp'];emitCampaignSummary(_0x575617);if(_0x448a62>0x0){if(_0x448a62>this[_0xe3c8('0x24')]){_0x448a62=this[_0xe3c8('0x24')];}_0x575617[_0xe3c8('0xc5')]+=_0x448a62;this[_0xe3c8('0xc7')](_0x575617['id'],_0x448a62,_0x575617[_0xe3c8('0x201')],_0x575617)[_0xe3c8('0xb8')](function(_0x3f5b8d){_0x575617[_0xe3c8('0xc5')]-=_0x448a62;_0x575617['temp']=_0x575617[_0xe3c8('0xc5')]>0x0?_0x575617[_0xe3c8('0xc5')]:0x0;if(!checkContactEmpty(_0x3f5b8d)){_0x575617[_0xe3c8('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xe3c8('0x202')+_0x575617['name']);}else{_0x575617['originated']+=_0x3f5b8d[_0xe3c8('0x96')];_0x575617[_0xe3c8('0x3f')]=_0xe3c8('0x203');for(var _0xe5b712=0x0;_0xe5b712<_0x3f5b8d[_0xe3c8('0x96')];_0xe5b712+=0x1){_0x575617[_0xe3c8('0x204')]+=0x1;if(_['isNil'](_0x3f5b8d[_0xe5b712])||_[_0xe3c8('0xaa')](_0x3f5b8d[_0xe5b712][_0xe3c8('0x180')])||_[_0xe3c8('0xaa')](_0x3f5b8d[_0xe5b712][_0xe3c8('0x16b')])){_0x2d122d[_0xe3c8('0xd1')](_0xe3c8('0x205'),_0x575617,_0x3f5b8d[_0xe5b712]);}else{_0x2d122d[_0xe3c8('0xbc')](_[_0xe3c8('0xd3')](_0x3f5b8d[_0xe5b712],[_0xe3c8('0xd7'),_0xe3c8('0x206')]))['then'](_0x2d122d['checkContactBlack'](_0x575617,_0x3f5b8d[_0xe5b712]))[_0xe3c8('0xae')](_0x2d122d[_0xe3c8('0xd0')](_0xe3c8('0x207'),_0x575617));}}}})['catch'](loggerGetContactDialer(_0xe3c8('0x208'),_0x575617,_0x448a62));}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x158')]=function(_0x47c3cd,_0x4ead34){var _0xe86f4d=this;var _0xe15ac7=[];var _0x17a8ec=_0x4ead34>=0x1?_0x4ead34:0x1;if(_0x47c3cd['dialMethod']===_0xe3c8('0x159')){_0x17a8ec=0x1;}var _0x4e9084=Math[_0xe3c8('0x1c7')](_0x47c3cd[_0xe3c8('0x51')]*_0x17a8ec)-_0x47c3cd[_0xe3c8('0x97')]-_0x47c3cd[_0xe3c8('0xc5')];emitVoiceQueueSummary(_0x47c3cd);if(_0x47c3cd[_0xe3c8('0x209')]>0x0){var _0x5b1b16=_0x47c3cd['dialLimitQueue']-_0x47c3cd[_0xe3c8('0x97')]-_0x47c3cd[_0xe3c8('0x55')]-_0x47c3cd['temp']-_0x47c3cd[_0xe3c8('0x52')];if(_0x4e9084>_0x5b1b16){_0x4e9084=_0x5b1b16;}}if(_0x4e9084>0x0){if(_0x47c3cd[_0xe3c8('0x5b')]===_0xe3c8('0x159')){_0x4e9084=0x1;}if(_0x4e9084>this[_0xe3c8('0x24')]){_0x4e9084=this[_0xe3c8('0x24')];}_0x47c3cd['temp']+=_0x4e9084;for(var _0x3e5357 in this[_0xe3c8('0x22')]){if(typeof this[_0xe3c8('0x22')][_0x3e5357]!==_0xe3c8('0x98')){if(this['agents'][_0x3e5357][_0xe3c8('0xa4')]===_0xe3c8('0x20a')&&this[_0xe3c8('0x22')][_0x3e5357][_0xe3c8('0xac')]===_0xe3c8('0x20b')){_0xe15ac7['push'](this[_0xe3c8('0x22')][_0x3e5357]['id']);}}}this[_0xe3c8('0xc4')](_0x47c3cd['id'],_0xe15ac7,_0x4e9084,_0x47c3cd[_0xe3c8('0x201')],_0x47c3cd)[_0xe3c8('0xb8')](function(_0x542f04){_0x47c3cd[_0xe3c8('0xc5')]-=_0x4e9084;_0x47c3cd[_0xe3c8('0xc5')]=_0x47c3cd[_0xe3c8('0xc5')]>0x0?_0x47c3cd[_0xe3c8('0xc5')]:0x0;if(!checkContactEmpty(_0x542f04)){_0xe86f4d['countReScheduled'](_0x47c3cd)['then'](sendMessageReschedule(_0x47c3cd))['catch'](loggerCatch(_0xe3c8('0xb4')));}else{_0x47c3cd[_0xe3c8('0x97')]+=_0x542f04[_0xe3c8('0x96')];_0x47c3cd[_0xe3c8('0x3f')]=_0x47c3cd[_0xe3c8('0x5b')]===_0xe3c8('0x159')?_0xe3c8('0x171'):_0xe3c8('0x203');for(var _0x5c855d=0x0;_0x5c855d<_0x542f04[_0xe3c8('0x96')];_0x5c855d+=0x1){if(_[_0xe3c8('0xaa')](_0x542f04[_0x5c855d])||_[_0xe3c8('0xaa')](_0x542f04[_0x5c855d][_0xe3c8('0x180')])||_['isNil'](_0x542f04[_0x5c855d][_0xe3c8('0x16b')])){_0xe86f4d['emptyContact'](_0xe3c8('0x205'),_0x47c3cd,_0x542f04[_0x5c855d]);}else{_0xe86f4d[_0xe3c8('0xb5')](_[_0xe3c8('0xd3')](_0x542f04[_0x5c855d],[_0xe3c8('0xd6'),_0xe3c8('0x206')]))[_0xe3c8('0xb8')](_0xe86f4d[_0xe3c8('0x1e9')](_0x47c3cd,_0x542f04[_0x5c855d]))['catch'](_0xe86f4d[_0xe3c8('0xd0')](_0xe3c8('0x205'),_0x47c3cd));}}}})[_0xe3c8('0xae')](loggerGetContactDialer(_0xe3c8('0x20c'),_0x47c3cd,_0x4e9084));}};Dialer['prototype'][_0xe3c8('0x8c')]=function(_0x54f5a7){if(_0x54f5a7[_0xe3c8('0x209')]>0x0){var _0x25a3a6=_0x54f5a7[_0xe3c8('0x209')]-_0x54f5a7[_0xe3c8('0x97')]-_0x54f5a7[_0xe3c8('0x55')];if(_0x25a3a6>0x0){this[_0xe3c8('0x20d')](_0x54f5a7);}else{loggerPredictiveCalls[_0xe3c8('0x7c')](_0xe3c8('0x20e'));}}else{this[_0xe3c8('0x20d')](_0x54f5a7);}};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x20d')]=function(_0x5a3082){var _0x388f1d=this;var _0x16663b=[];_0x5a3082['originated']+=0x1;for(var _0x2af592 in this[_0xe3c8('0x22')]){if(typeof this[_0xe3c8('0x22')][_0x2af592]!==_0xe3c8('0x98')){if(this[_0xe3c8('0x22')][_0x2af592]['state']===_0xe3c8('0x20a')&&this['agents'][_0x2af592]['status']===_0xe3c8('0x20b')){_0x16663b['push'](this[_0xe3c8('0x22')][_0x2af592]['id']);}}}this['getContactDialer'](_0x5a3082['id'],_0x16663b,0x1,_0x5a3082['dialOrderByScheduledAt'],_0x5a3082)['then'](function(_0x201782){if(!checkContactEmpty(_0x201782)){checkContactLowerLimitOriginate(_0x5a3082,0x1,0x0);_0x388f1d['countReScheduled'](_0x5a3082)['then'](sendMessageReschedule(_0x5a3082))['catch'](loggerCatch(_0xe3c8('0xb4')));}else{_0x5a3082[_0xe3c8('0x3f')]=_0xe3c8('0x203');if(_[_0xe3c8('0xaa')](_0x201782[0x0])||_[_0xe3c8('0xaa')](_0x201782[0x0][_0xe3c8('0x180')])||_[_0xe3c8('0xaa')](_0x201782[0x0][_0xe3c8('0x16b')])){_0x388f1d[_0xe3c8('0xd1')](_0xe3c8('0x205'),_0x5a3082,_0x201782[0x0]);}else{_0x388f1d['checkIsBlackList'](_[_0xe3c8('0xd3')](_0x201782[0x0],[_0xe3c8('0xd6'),'Contact.phone']))['then'](_0x388f1d[_0xe3c8('0x1e9')](_0x5a3082,_0x201782[0x0]))['catch'](_0x388f1d[_0xe3c8('0xd0')](_0xe3c8('0x20f'),_0x5a3082));}}})['catch'](loggerGetContactDialer(_0xe3c8('0x210'),_0x5a3082,0x1));emitVoiceQueueSummary(_0x5a3082);};Dialer[_0xe3c8('0x1b')][_0xe3c8('0x1de')]=function(_0x1c1738,_0x49f2a6,_0x5c7213,_0x5f5d3b,_0x44af85,_0xbd3aba){loggerPredictive[_0xe3c8('0x7c')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xe3c8('0x7c')]('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',_0x1c1738);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x211'),_0x49f2a6);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x212'),_0x5c7213);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x213'),_0x5f5d3b);loggerPredictive[_0xe3c8('0x7c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44af85);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x83'));return new BPromise(function(_0x36241f,_0x2c334c){if(_0x1c1738<=0x0||isNaN(_0x1c1738)){return _0x2c334c(msgResponse(_0xe3c8('0x214'),'Error','m\x20=\x20'+_0x1c1738));}if(_0x5c7213<=0x0||isNaN(_0x5c7213)){return _0x2c334c(msgResponse('[abandonmentRate]',_0xe3c8('0x48'),_0xe3c8('0x215')+_0x5c7213));}if(_0x5f5d3b<=0x0||isNaN(_0x5f5d3b)){return _0x2c334c(msgResponse(_0xe3c8('0x214'),_0xe3c8('0x48'),_0xe3c8('0x216')+_0x5f5d3b));}if(_0x49f2a6<=0x0||isNaN(_0x49f2a6)){return _0x2c334c(msgResponse(_0xe3c8('0x214'),_0xe3c8('0x48'),'interval\x20=\x20'+_0x49f2a6));}if(_0x44af85<=0x0||isNaN(_0x44af85)){return _0x2c334c(msgResponse(_0xe3c8('0x214'),'Error',_0xe3c8('0x217')+_0x44af85));}_0xbd3aba=_0xbd3aba||0x0;var _0x450853=0x1/_0x5c7213;var _0x140bc4=0x0;var _0x35e7ad=0x0;var _0x222df3=0x0;var _0x33cadf=0x0;for(var _0x36a271=0x0;_0x222df3<_0x44af85;_0x36a271+=0x1){_0x35e7ad=_0x36a271/_0x49f2a6;_0x140bc4=(_0x5f5d3b*_0x35e7ad+_0xbd3aba)/_0x450853;_0x222df3=erlangb(_0x140bc4,_0x1c1738);_0x33cadf=_0x140bc4/_0x1c1738*(0x1-erlangb(_0x140bc4,_0x1c1738));}return _0x36241f({'erlangCalls':_0x36a271,'erlangCallToSecond':_0x49f2a6/_0x36a271,'erlangAbandonmentRate':_0x222df3,'erlangBusyFactor':_0x33cadf});});};Dialer[_0xe3c8('0x1b')]['busyFactor']=function(_0x3280a3,_0x4a8682,_0x2645f3,_0x4c4f29,_0x7f741,_0x4bf03c){loggerPredictive[_0xe3c8('0x7c')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x218'),_0x3280a3);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x211'),_0x4a8682);loggerPredictive[_0xe3c8('0x7c')]('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',_0x2645f3);loggerPredictive['info'](_0xe3c8('0x213'),_0x4c4f29);loggerPredictive[_0xe3c8('0x7c')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x7f741);loggerPredictive[_0xe3c8('0x7c')](_0xe3c8('0x83'));return new BPromise(function(_0xa23868,_0x50821b){if(_0x3280a3<=0x0||isNaN(_0x3280a3)){return _0x50821b(msgResponse(_0xe3c8('0x219'),_0xe3c8('0x48'),_0xe3c8('0x21a')+_0x3280a3));}if(_0x2645f3<=0x0||isNaN(_0x2645f3)){return _0x50821b(msgResponse(_0xe3c8('0x219'),_0xe3c8('0x48'),_0xe3c8('0x215')+_0x2645f3));}if(_0x4c4f29<=0x0||isNaN(_0x4c4f29)){return _0x50821b(msgResponse('[busyFactor]',_0xe3c8('0x48'),'p\x20=\x20'+_0x4c4f29));}if(_0x4a8682<=0x0||isNaN(_0x4a8682)){return _0x50821b(msgResponse(_0xe3c8('0x219'),'Error',_0xe3c8('0x21b')+_0x4a8682));}if(_0x7f741<=0x0||isNaN(_0x7f741)){return _0x50821b(msgResponse(_0xe3c8('0x219'),_0xe3c8('0x48'),_0xe3c8('0x21c')+_0x7f741));}_0x4bf03c=_0x4bf03c||0x0;var _0x582824=0x1/_0x2645f3;var _0x4b589d=0x0;var _0x47a5da=0x0;var _0x31f427=0x0;var _0x1a37cc=0x0;for(var _0x48e98c=0x0;_0x1a37cc<_0x7f741;_0x48e98c+=0x1){_0x47a5da=_0x48e98c/_0x4a8682;_0x4b589d=(_0x4c4f29*_0x47a5da+_0x4bf03c)/_0x582824;_0x31f427=erlangb(_0x4b589d,_0x3280a3);_0x1a37cc=_0x4b589d/_0x3280a3*(0x1-erlangb(_0x4b589d,_0x3280a3));}return _0xa23868({'erlangCalls':_0x48e98c,'erlangCallToSecond':_0x4a8682/_0x48e98c,'erlangAbandonmentRate':_0x31f427,'erlangBusyFactor':_0x1a37cc});});};module['exports']=Dialer;
\ No newline at end of file
index 9c882cf..c820ed4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd325=['queue','countbusyretry','countglobal','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','responsetime','droptime','endtime','ringtime','starttime','holdtime','reason','callback','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','campaigntype','outbound'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0xd325,0x1f3));var _0x5d32=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd325[_0x2f5ac5];return _0x37c9a8;};'use strict';var util=require(_0x5d32('0x0'));var _=require(_0x5d32('0x1'));var moment=require('moment');function getSeconds(_0xdc372f,_0x243716){var _0x470914=moment(_0xdc372f)[_0x5d32('0x2')](0x0);var _0x596bf9=moment(_0x243716)[_0x5d32('0x2')](0x0);return _0x470914[_0x5d32('0x3')](_0x596bf9,'seconds');}function QueueCallerAbandon(_0x57568d,_0x100692){this[_0x5d32('0x4')]=_0x57568d[_0x5d32('0x4')];this[_0x5d32('0x5')]=_0x57568d[_0x5d32('0x5')];this[_0x5d32('0x6')]=_0x57568d['type']===_0x5d32('0x7')?_0x5d32('0x8'):_0x57568d[_0x5d32('0x5')];this[_0x5d32('0x9')]=_0x57568d[_0x5d32('0x9')];this['countcongestionretry']=_0x57568d['countcongestionretry'];this['countnoanswerretry']=_0x57568d['countnoanswerretry'];this[_0x5d32('0xa')]=_0x57568d['countbusyretry']+_0x57568d[_0x5d32('0xb')]+_0x57568d[_0x5d32('0xc')]+_0x57568d['countnosuchnumberretry']+_0x57568d[_0x5d32('0xd')]+_0x57568d[_0x5d32('0xe')]+_0x57568d[_0x5d32('0xf')]+_0x57568d[_0x5d32('0x10')];this[_0x5d32('0x11')]=_0x57568d[_0x5d32('0x11')];this['countdropretry']=_0x57568d[_0x5d32('0xd')];this[_0x5d32('0xe')]=_0x57568d[_0x5d32('0xe')];this[_0x5d32('0xf')]=_0x57568d[_0x5d32('0xf')];this[_0x5d32('0x10')]=_0x57568d[_0x5d32('0x10')];this[_0x5d32('0x12')]=_0x100692['uniqueid'];this[_0x5d32('0x13')]=_0x57568d[_0x5d32('0x14')];this[_0x5d32('0x15')]=_0x57568d['number'];this['starttime']=_0x57568d['starttime'];this['responsetime']=_0x57568d[_0x5d32('0x16')];this[_0x5d32('0x17')]=_0x57568d[_0x5d32('0x17')];this[_0x5d32('0x18')]=this[_0x5d32('0x17')];this[_0x5d32('0x19')]=getSeconds(_0x57568d[_0x5d32('0x16')],_0x57568d[_0x5d32('0x1a')]);this[_0x5d32('0x1b')]=getSeconds(this[_0x5d32('0x17')],_0x57568d[_0x5d32('0x16')]);this['talktime']=0x0;this[_0x5d32('0x8')]=_0x100692[_0x5d32('0x8')];this['membername']=_0x100692['connectedlinename'];this[_0x5d32('0x1c')]=_0x100692[_0x5d32('0x1c')];this[_0x5d32('0x1d')]=_0x57568d[_0x5d32('0x1d')];this['callbackuniqueid']=_0x57568d['callbackuniqueid'];this[_0x5d32('0x1e')]=_0x57568d[_0x5d32('0x1e')];this['recallme']=_0x57568d['recallme'];this[_0x5d32('0x1f')]=_0x57568d['ContactId'];this[_0x5d32('0x20')]=_0x57568d[_0x5d32('0x20')];this[_0x5d32('0x21')]=_0x57568d['UserId'];this[_0x5d32('0x22')]=_0x57568d[_0x5d32('0x22')];this['CampaignId']=_0x57568d[_0x5d32('0x23')];this[_0x5d32('0x24')]=_0x57568d[_0x5d32('0x24')]||'';this[_0x5d32('0x25')]=_0x57568d[_0x5d32('0x25')]||'';}module[_0x5d32('0x26')]=QueueCallerAbandon;
\ No newline at end of file
+var _0xc09f=['endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime'];(function(_0x3a67f1,_0x5d307e){var _0x41c1ee=function(_0x1f85e7){while(--_0x1f85e7){_0x3a67f1['push'](_0x3a67f1['shift']());}};_0x41c1ee(++_0x5d307e);}(_0xc09f,0xe4));var _0xfc09=function(_0x35f969,_0x2c03bd){_0x35f969=_0x35f969-0x0;var _0x373c46=_0xc09f[_0x35f969];return _0x373c46;};'use strict';var util=require(_0xfc09('0x0'));var _=require(_0xfc09('0x1'));var moment=require('moment');function getSeconds(_0x1bb2c0,_0x43face){var _0x14a2a7=moment(_0x1bb2c0)['milliseconds'](0x0);var _0x1bfdb5=moment(_0x43face)['milliseconds'](0x0);return _0x14a2a7[_0xfc09('0x2')](_0x1bfdb5,_0xfc09('0x3'));}function QueueCallerAbandon(_0x40b006,_0x391a64){this['scheduledat']=_0x40b006[_0xfc09('0x4')];this[_0xfc09('0x5')]=_0x40b006[_0xfc09('0x5')];this[_0xfc09('0x6')]=_0x40b006[_0xfc09('0x5')]===_0xfc09('0x7')?_0xfc09('0x8'):_0x40b006[_0xfc09('0x5')];this[_0xfc09('0x9')]=_0x40b006[_0xfc09('0x9')];this[_0xfc09('0xa')]=_0x40b006['countcongestionretry'];this[_0xfc09('0xb')]=_0x40b006[_0xfc09('0xb')];this['countglobal']=_0x40b006['countbusyretry']+_0x40b006[_0xfc09('0xa')]+_0x40b006[_0xfc09('0xb')]+_0x40b006[_0xfc09('0xc')]+_0x40b006[_0xfc09('0xd')]+_0x40b006[_0xfc09('0xe')]+_0x40b006['countmachineretry']+_0x40b006[_0xfc09('0xf')];this[_0xfc09('0xc')]=_0x40b006['countnosuchnumberretry'];this['countdropretry']=_0x40b006[_0xfc09('0xd')];this[_0xfc09('0xe')]=_0x40b006[_0xfc09('0xe')];this['countmachineretry']=_0x40b006[_0xfc09('0x10')];this[_0xfc09('0xf')]=_0x40b006[_0xfc09('0xf')];this[_0xfc09('0x11')]=_0x391a64[_0xfc09('0x11')];this[_0xfc09('0x12')]=_0x40b006[_0xfc09('0x13')];this[_0xfc09('0x14')]=_0x40b006['number'];this['starttime']=_0x40b006[_0xfc09('0x15')];this[_0xfc09('0x16')]=_0x40b006[_0xfc09('0x16')];this['droptime']=_0x40b006[_0xfc09('0x17')];this[_0xfc09('0x18')]=this[_0xfc09('0x17')];this[_0xfc09('0x19')]=getSeconds(_0x40b006[_0xfc09('0x16')],_0x40b006[_0xfc09('0x15')]);this[_0xfc09('0x1a')]=getSeconds(this[_0xfc09('0x17')],_0x40b006[_0xfc09('0x16')]);this[_0xfc09('0x1b')]=0x0;this['queue']=_0x391a64['queue'];this[_0xfc09('0x1c')]=_0x391a64[_0xfc09('0x1d')];this[_0xfc09('0x1e')]=_0x391a64[_0xfc09('0x1e')];this[_0xfc09('0x1f')]=_0x40b006[_0xfc09('0x1f')];this[_0xfc09('0x20')]=_0x40b006[_0xfc09('0x20')];this[_0xfc09('0x21')]=_0x40b006['callbackat'];this['recallme']=_0x40b006[_0xfc09('0x22')];this['ContactId']=_0x40b006[_0xfc09('0x23')];this['ListId']=_0x40b006['ListId'];this[_0xfc09('0x24')]=_0x40b006[_0xfc09('0x24')];this[_0xfc09('0x25')]=_0x40b006[_0xfc09('0x25')];this['CampaignId']=_0x40b006[_0xfc09('0x26')];this[_0xfc09('0x27')]=_0x40b006['originatecalleridnum']||'';this[_0xfc09('0x28')]=_0x40b006[_0xfc09('0x28')]||'';}module[_0xfc09('0x29')]=QueueCallerAbandon;
\ No newline at end of file
index cfb8a55..bd68181 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(_0x46ef27,_0x1f0b10){var _0x324948=function(_0x27d100){while(--_0x27d100){_0x46ef27['push'](_0x46ef27['shift']());}};_0x324948(++_0x1f0b10);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x2c5927,_0x1ff12a){var _0x3e60d5=function(_0x230e0f){while(--_0x230e0f){_0x2c5927['push'](_0x2c5927['shift']());}};_0x3e60d5(++_0x1ff12a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 92f503c..690cd76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda14=['filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','fax','.pdf','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','catch','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','then','[Fax][execOriginate][success]','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','path','%s/%s.tif','dir','XMF-PATH','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','trunks','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','channels','faxAccounts','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','syncHangup','originateresponse','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','name','\x20syncNewchannel\x20','actions','channel','info','prototype','variable','channelstate','channelstatedesc','value','operation','status'];(function(_0x1f32b3,_0x1e1372){var _0x3a5c00=function(_0x13222f){while(--_0x13222f){_0x1f32b3['push'](_0x1f32b3['shift']());}};_0x3a5c00(++_0x1e1372);}(_0xda14,0x132));var _0x4da1=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0xda14[_0x459b74];return _0x46cb16;};'use strict';var util=require(_0x4da1('0x0'));var _=require(_0x4da1('0x1'));var BPromise=require(_0x4da1('0x2'));var uuid=require(_0x4da1('0x3'));var moment=require(_0x4da1('0x4'));var path=require('path');var tiff2pdf=require(_0x4da1('0x5'));var gs=require(_0x4da1('0x6'));var logger=require(_0x4da1('0x7'))('fax');var ami=require(_0x4da1('0x8'));var rpcDb=require(_0x4da1('0x9'));var Channel=require(_0x4da1('0xa'));var ut=require(_0x4da1('0xb'));var Action=require(_0x4da1('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4da1('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x17c7ca){this[_0x4da1('0xe')]={};this[_0x4da1('0xf')]=_0x17c7ca['faxAccounts'];this['trunks']=_0x17c7ca['trunks'];this['actions']={};ami['on'](_0x4da1('0x10'),this['syncNewchannel'][_0x4da1('0x11')](this));ami['on'](_0x4da1('0x12'),this[_0x4da1('0x13')][_0x4da1('0x11')](this));ami['on'](_0x4da1('0x14'),this[_0x4da1('0x15')][_0x4da1('0x11')](this));ami['on'](_0x4da1('0x16'),this[_0x4da1('0x17')][_0x4da1('0x11')](this));ami['on']('faxstatus',this[_0x4da1('0x18')][_0x4da1('0x11')](this));ami['on']('receivefax',this[_0x4da1('0x19')]['bind'](this));ami['on']('hangup',this[_0x4da1('0x1a')][_0x4da1('0x11')](this));ami['on'](_0x4da1('0x1b'),this['syncOriginateResponse'][_0x4da1('0x11')](this));}Fax['prototype']['syncNewchannel']=function(_0x5817f3){if(_0x5817f3['context']===_0x4da1('0x1c')){for(var _0x459265 in this[_0x4da1('0xf')]){if(this[_0x4da1('0xf')][_0x4da1('0x1d')](_0x459265)){if(_0x5817f3[_0x4da1('0x1e')]===this[_0x4da1('0xf')][_0x459265][_0x4da1('0x1f')]){this[_0x4da1('0xe')][_0x5817f3[_0x4da1('0x20')]]={};this[_0x4da1('0xe')][_0x5817f3[_0x4da1('0x20')]]['channel']=_0x5817f3['channel'];this['channels'][_0x5817f3[_0x4da1('0x20')]]['id']=this[_0x4da1('0xf')][_0x459265]['id'];this[_0x4da1('0xe')][_0x5817f3[_0x4da1('0x20')]][_0x4da1('0x21')]=this[_0x4da1('0xf')][_0x459265][_0x4da1('0x21')];logger['info'](_0x5817f3[_0x4da1('0x20')],_0x4da1('0x22'));}}}}if(this[_0x4da1('0x23')][_0x5817f3[_0x4da1('0x20')]]){this[_0x4da1('0xe')][_0x5817f3[_0x4da1('0x20')]]={};this[_0x4da1('0xe')][_0x5817f3['uniqueid']][_0x4da1('0x24')]=_0x5817f3['channel'];logger[_0x4da1('0x25')](_0x5817f3[_0x4da1('0x20')],_0x4da1('0x22'));}};Fax[_0x4da1('0x26')]['syncVarSet']=function(_0x4212e2){if(this[_0x4da1('0xe')][_0x4212e2[_0x4da1('0x20')]]){for(var _0x17f442 in _0x4212e2['variable']){if(_0x4212e2[_0x4da1('0x27')][_0x4da1('0x1d')](_0x17f442)){this[_0x4da1('0xe')][_0x4212e2[_0x4da1('0x20')]][_0x17f442]=_0x4212e2['value'];}}}};Fax[_0x4da1('0x26')][_0x4da1('0x15')]=function(_0x3229d3){if(this[_0x4da1('0xe')][_0x3229d3[_0x4da1('0x20')]]){this['channels'][_0x3229d3['uniqueid']][_0x4da1('0x28')]=_0x3229d3[_0x4da1('0x28')];this[_0x4da1('0xe')][_0x3229d3[_0x4da1('0x20')]][_0x4da1('0x29')]=_0x3229d3[_0x4da1('0x29')];}};Fax[_0x4da1('0x26')][_0x4da1('0x17')]=function(_0x578e66){if(this[_0x4da1('0xe')][_0x578e66[_0x4da1('0x20')]]){for(var _0x3acab1 in _0x578e66[_0x4da1('0x27')]){if(_0x578e66['variable']['hasOwnProperty'](_0x3acab1)){this[_0x4da1('0xe')][_0x578e66['uniqueid']][_0x3acab1]=_0x578e66[_0x4da1('0x2a')];}}}};Fax[_0x4da1('0x26')]['syncFaxStatus']=function(_0x117dfa){if(this[_0x4da1('0xe')][_0x117dfa[_0x4da1('0x20')]]){this['channels'][_0x117dfa['uniqueid']][_0x4da1('0x2b')]=_0x117dfa[_0x4da1('0x2b')];this[_0x4da1('0xe')][_0x117dfa[_0x4da1('0x20')]][_0x4da1('0x2c')]=_0x117dfa['status'];this[_0x4da1('0xe')][_0x117dfa[_0x4da1('0x20')]][_0x4da1('0x1f')]=_0x117dfa[_0x4da1('0x1f')];this[_0x4da1('0xe')][_0x117dfa[_0x4da1('0x20')]][_0x4da1('0x2d')]=_0x117dfa[_0x4da1('0x2d')];logger[_0x4da1('0x25')](_0x117dfa[_0x4da1('0x20')],_0x4da1('0x2e'));}};Fax['prototype'][_0x4da1('0x19')]=function(_0x1fbb84){var _0x5c5062=this;if(this[_0x4da1('0xe')][_0x1fbb84[_0x4da1('0x20')]]){var _0x57ba68=this[_0x4da1('0xe')][_0x1fbb84[_0x4da1('0x20')]]['id'];this[_0x4da1('0xe')][_0x1fbb84[_0x4da1('0x20')]][_0x4da1('0x2f')]=_0x1fbb84[_0x4da1('0x2f')];this[_0x4da1('0xe')][_0x1fbb84['uniqueid']][_0x4da1('0x30')]=_0x1fbb84[_0x4da1('0x30')];this[_0x4da1('0xe')][_0x1fbb84[_0x4da1('0x20')]]['localstationid']=_0x1fbb84[_0x4da1('0x1f')];this[_0x4da1('0xe')][_0x1fbb84['uniqueid']]['resolution']=_0x1fbb84[_0x4da1('0x31')];this[_0x4da1('0xe')][_0x1fbb84[_0x4da1('0x20')]][_0x4da1('0x32')]=_0x1fbb84[_0x4da1('0x32')];this[_0x4da1('0xe')][_0x1fbb84[_0x4da1('0x20')]]['filename']=_0x1fbb84[_0x4da1('0x2d')];this[_0x4da1('0xe')][_0x1fbb84[_0x4da1('0x20')]][_0x4da1('0x33')]=_0x1fbb84['calleridnum'];if(this[_0x4da1('0xe')][_0x1fbb84['uniqueid']][_0x4da1('0x30')]>0x0){tiff2pdf(_0x1fbb84[_0x4da1('0x2d')],_0x4da1('0x34'),function(_0x1101e3){logger[_0x4da1('0x25')](_0x1fbb84[_0x4da1('0x20')],_0x4da1('0x35'),_0x1101e3[_0x4da1('0x36')]);attachment[_0x4da1('0x37')]({'name':path[_0x4da1('0x38')](_0x1fbb84[_0x4da1('0x2d')])['name'],'basename':path[_0x4da1('0x38')](_0x1fbb84[_0x4da1('0x2d')])[_0x4da1('0x21')]+'.pdf','type':_0x4da1('0x39')})['then'](function(_0x5eecb9){faxAccount['notify'](_0x57ba68,{'from':_0x1fbb84[_0x4da1('0x33')],'mapKey':_0x4da1('0x3a'),'body':path[_0x4da1('0x38')](_0x1fbb84['filename'])[_0x4da1('0x21')]+_0x4da1('0x3b'),'AttachmentId':_0x5eecb9['id']})['catch'](function(_0x505582){logger[_0x4da1('0x3c')](_0x1fbb84[_0x4da1('0x20')],_0x4da1('0x3d'),JSON[_0x4da1('0x3e')](_0x505582));});})['catch'](function(_0x5055f8){logger['error'](_0x1fbb84[_0x4da1('0x20')],_0x4da1('0x3f'),JSON['stringify'](_0x5055f8));});});}logger['info'](_0x1fbb84[_0x4da1('0x20')],'\x20receiveFax\x20');}};Fax[_0x4da1('0x26')][_0x4da1('0x40')]=function(_0x4a7597){if(this[_0x4da1('0x23')][_0x4a7597[_0x4da1('0x20')]]){_[_0x4da1('0x41')](this['channels'][_0x4a7597[_0x4da1('0x20')]],_[_0x4da1('0x42')](_0x4a7597,['response',_0x4da1('0x43')]));}};function updateStatus(_0x504ed3){if(_0x504ed3[_0x4da1('0x44')]){faxMessage[_0x4da1('0x45')](_0x504ed3[_0x4da1('0x44')],{'failMessage':_0x4da1('0x46')})['then'](function(_0xe658a8){ut[_0x4da1('0x47')](_0x4da1('0x48'),_0xe658a8);})['catch'](function(_0x2378bf){ut[_0x4da1('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x2378bf);});}else{ut[_0x4da1('0x47')](_0x4da1('0x49'));}}Fax['prototype']['updateStatus']=function(_0x466360,_0x1e9e12,_0x30c467){var _0x4f8bdb=this;var _0x142a7d={};if(_0x1e9e12){_0x142a7d={'read':_0x1e9e12};}else{_0x142a7d={'failMessage':_0x30c467};}if(this[_0x4da1('0x23')][_0x466360][_0x4da1('0x44')]){faxMessage[_0x4da1('0x45')](this['actions'][_0x466360][_0x4da1('0x44')],_0x142a7d)['then'](function(_0x2a54c0){ut[_0x4da1('0x47')](_0x4da1('0x4a'),_0x2a54c0);})[_0x4da1('0x4b')](function(_0x3203ff){ut['logger'](_0x4da1('0x4c'),_0x3203ff);})['finally'](function(){delete _0x4f8bdb[_0x4da1('0xe')][_0x466360];delete _0x4f8bdb[_0x4da1('0x23')][_0x466360];});}else{ut[_0x4da1('0x47')](_0x4da1('0x4d'));delete this[_0x4da1('0xe')][_0x466360];delete this['actions'][_0x466360];}};Fax[_0x4da1('0x26')][_0x4da1('0x1a')]=function(_0x2561a5){var _0x4e4101=this;if(this['channels'][_0x2561a5[_0x4da1('0x20')]]){if(this['actions'][_0x2561a5['uniqueid']]){this['channels'][_0x2561a5[_0x4da1('0x20')]]['id']=this['actions'][_0x2561a5[_0x4da1('0x20')]]['id'];this[_0x4da1('0xe')][_0x2561a5[_0x4da1('0x20')]][_0x4da1('0x21')]=this[_0x4da1('0x23')][_0x2561a5[_0x4da1('0x20')]][_0x4da1('0x21')];}logger[_0x4da1('0x25')](_0x2561a5[_0x4da1('0x20')],this['actions'][_0x2561a5[_0x4da1('0x20')]]?_0x4da1('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON[_0x4da1('0x3e')](this[_0x4da1('0xe')][_0x2561a5[_0x4da1('0x20')]]));if(this[_0x4da1('0x23')][_0x2561a5['uniqueid']]){if(this[_0x4da1('0xe')][_0x2561a5[_0x4da1('0x20')]]['faxpages']>0x0&&this[_0x4da1('0xe')][_0x2561a5[_0x4da1('0x20')]][_0x4da1('0x4f')]===_0x4da1('0x50')){this['updateStatus'](_0x2561a5[_0x4da1('0x20')],!![]);}else{this[_0x4da1('0x51')](_0x2561a5[_0x4da1('0x20')],![],this['channels'][_0x2561a5['uniqueid']][_0x4da1('0x52')]?_0x4da1('0x53')+this['channels'][_0x2561a5['uniqueid']][_0x4da1('0x52')]:_0x4da1('0x54'));}}}};Fax[_0x4da1('0x26')][_0x4da1('0x55')]=function(_0xd2b9f4){var _0x1297c7=this;return new BPromise(function(_0x2b3291,_0x191b3e){_0x1297c7['execOriginate'](_0xd2b9f4,_0x1297c7[_0x4da1('0xf')][_0xd2b9f4[_0x4da1('0x56')]])[_0x4da1('0x57')](function(_0xcd3455){ut[_0x4da1('0x47')](_0x4da1('0x58'),_0xcd3455);_0x2b3291(ut['message']('Fax\x20received'));})[_0x4da1('0x4b')](function(_0x308bc5){ut['logger']('[Fax][execOriginate][failure]',_0x308bc5);updateStatus(_0xd2b9f4);_0x191b3e(ut[_0x4da1('0x36')]('Fax\x20failed'));});});};Fax[_0x4da1('0x26')][_0x4da1('0x59')]=function(_0x2449a3){var _0x2f2b4b=this;return new BPromise(function(_0x2e195a,_0x285028){var _0x24300c=_0x2f2b4b[_0x4da1('0x5a')](_0x2f2b4b[_0x4da1('0xf')][_0x2449a3['FaxAccountId']]['Trunk'],_0x2449a3);if(_0x24300c[_0x4da1('0x5b')]){_0x2e195a(ut[_0x4da1('0x36')](_0x4da1('0x5c')));}else{_0x285028(ut[_0x4da1('0x36')](_0x24300c[_0x4da1('0x36')]));}});};function originate(_0x5ba40e,_0x4215e0,_0x5ee1cc){return new BPromise(function(_0x201a44,_0x42e0a6){if(_0x5ee1cc){var _0xc6efa2=util['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[_0x4da1('0x38')](_0x5ba40e['path'])['name'],_0x5ba40e['path']);gs['execute'](_0xc6efa2)['then'](function(){_0x5ba40e[_0x4da1('0x5d')]=util['format'](_0x4da1('0x5e'),path[_0x4da1('0x38')](_0x5ba40e[_0x4da1('0x5d')])[_0x4da1('0x5f')],path[_0x4da1('0x38')](_0x5ba40e[_0x4da1('0x5d')])[_0x4da1('0x21')]);_0x4215e0[_0x4da1('0x60')]=_0x5ba40e[_0x4da1('0x5d')];ut[_0x4da1('0x47')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut[_0x4da1('0x61')](_0x5ba40e,_0x4215e0))[_0x4da1('0x57')](function(_0x5b8a14){_0x201a44(_0x5b8a14);})['catch'](function(_0x48bfdf){_0x42e0a6(_0x48bfdf);});})['catch'](function(_0x407467){_0x42e0a6(_0x407467);});}else{ami[_0x4da1('0x62')](ut[_0x4da1('0x61')](_0x5ba40e,_0x4215e0))[_0x4da1('0x57')](function(_0x1f96f2){_0x201a44(_0x1f96f2);})[_0x4da1('0x4b')](function(_0x169e58){_0x42e0a6(_0x169e58);});}});}Fax[_0x4da1('0x26')]['execOriginate']=function(_0x4775e1,_0x51df2){var _0x12d077=this;return new BPromise(function(_0x232197,_0x340751){var _0x1702e8=uuid['v4']();var _0x5ae05a=ut[_0x4da1('0x63')](_0x4775e1,_0x51df2);_0x12d077['actions'][_0x1702e8]=new Action(_0x1702e8,_0x51df2,_0x4775e1);var _0x37a78c=_0x12d077[_0x4da1('0x23')][_0x1702e8];if(path[_0x4da1('0x38')](_0x4775e1[_0x4da1('0x5d')])[_0x4da1('0x64')]===_0x4da1('0x3b')){originate(_0x37a78c,_0x5ae05a,!![])[_0x4da1('0x57')](function(_0x522563){_0x232197(_0x522563);})['catch'](function(_0x11b02b){_0x340751(_0x11b02b);});}else{originate(_0x37a78c,_0x5ae05a,![])[_0x4da1('0x57')](function(_0x1347c4){_0x232197(_0x1347c4);})['catch'](function(_0xbb473e){_0x340751(_0xbb473e);});}});};Fax[_0x4da1('0x26')][_0x4da1('0x65')]=function(_0x104e8b){return!_[_0x4da1('0x66')](_0x104e8b)&&!_[_0x4da1('0x66')](_0x104e8b['name'])&&!_[_0x4da1('0x66')](_0x104e8b['active'])&&_0x104e8b[_0x4da1('0x67')]&&!_[_0x4da1('0x66')](this[_0x4da1('0x68')][util[_0x4da1('0x69')](_0x4da1('0x6a'),_0x104e8b[_0x4da1('0x21')])])&&!_[_0x4da1('0x66')](this[_0x4da1('0x68')][util[_0x4da1('0x69')](_0x4da1('0x6a'),_0x104e8b[_0x4da1('0x21')])][_0x4da1('0x2c')])&&(this[_0x4da1('0x68')][util[_0x4da1('0x69')](_0x4da1('0x6a'),_0x104e8b['name'])][_0x4da1('0x2c')]===_0x4da1('0x6b')||this[_0x4da1('0x68')][util[_0x4da1('0x69')]('SIP/%s',_0x104e8b[_0x4da1('0x21')])]['status']===_0x4da1('0x6c'));};Fax[_0x4da1('0x26')][_0x4da1('0x5a')]=function(_0x532a63,_0x1fb990){if(!this['isTrunkReachable'](_0x532a63)){ut[_0x4da1('0x47')](_0x4da1('0x6d'),_[_0x4da1('0x66')](_0x532a63)?'':_0x532a63[_0x4da1('0x21')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x4da1('0x6e')};}if(_[_0x4da1('0x66')](_0x1fb990[_0x4da1('0x3a')])){ut['logger'](_0x4da1('0x6f'),JSON['stringify'](_0x1fb990));return{'isValid':![],'message':_0x4da1('0x70')};}if(_['isNil'](_0x1fb990[_0x4da1('0x5d')])){ut[_0x4da1('0x47')](_0x4da1('0x71'),JSON['stringify'](_0x1fb990));return{'isValid':![],'message':_0x4da1('0x72')};}return{'isValid':!![],'message':_0x4da1('0x73')};};module[_0x4da1('0x74')]=Fax;
\ No newline at end of file
+var _0x0203=['[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','uuid','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','error','\x20notify\x20','catch','\x20receiveFax\x20','stringify','merge','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','faxpages','faxstatusstring','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','ext','isTrunkReachable','isNil','active','trunks','SIP/%s','reachable','unmonitored'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x0203,0xeb));var _0x3020=function(_0x3e5674,_0x3d5148){_0x3e5674=_0x3e5674-0x0;var _0x105877=_0x0203[_0x3e5674];return _0x105877;};'use strict';var util=require('util');var _=require(_0x3020('0x0'));var BPromise=require(_0x3020('0x1'));var uuid=require(_0x3020('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x3020('0x3'));var gs=require(_0x3020('0x4'));var logger=require(_0x3020('0x5'))(_0x3020('0x6'));var ami=require(_0x3020('0x7'));var rpcDb=require(_0x3020('0x8'));var Channel=require(_0x3020('0x9'));var ut=require(_0x3020('0xa'));var Action=require(_0x3020('0xb'));var faxAccount=require(_0x3020('0xc'));var attachment=require(_0x3020('0xd'));var faxMessage=require(_0x3020('0xe'));function Fax(_0x59ee68){this[_0x3020('0xf')]={};this[_0x3020('0x10')]=_0x59ee68[_0x3020('0x10')];this['trunks']=_0x59ee68['trunks'];this[_0x3020('0x11')]={};ami['on'](_0x3020('0x12'),this[_0x3020('0x13')][_0x3020('0x14')](this));ami['on']('varset',this[_0x3020('0x15')][_0x3020('0x14')](this));ami['on'](_0x3020('0x16'),this['syncNewState']['bind'](this));ami['on']('newexten',this[_0x3020('0x17')][_0x3020('0x14')](this));ami['on'](_0x3020('0x18'),this[_0x3020('0x19')][_0x3020('0x14')](this));ami['on'](_0x3020('0x1a'),this[_0x3020('0x1b')][_0x3020('0x14')](this));ami['on'](_0x3020('0x1c'),this[_0x3020('0x1d')]['bind'](this));ami['on'](_0x3020('0x1e'),this[_0x3020('0x1f')][_0x3020('0x14')](this));}Fax[_0x3020('0x20')][_0x3020('0x13')]=function(_0x5685e){if(_0x5685e[_0x3020('0x21')]==='from-voip-provider'){for(var _0x3ac75c in this[_0x3020('0x10')]){if(this['faxAccounts'][_0x3020('0x22')](_0x3ac75c)){if(_0x5685e[_0x3020('0x23')]===this[_0x3020('0x10')][_0x3ac75c][_0x3020('0x24')]){this[_0x3020('0xf')][_0x5685e['uniqueid']]={};this[_0x3020('0xf')][_0x5685e[_0x3020('0x25')]][_0x3020('0x26')]=_0x5685e['channel'];this[_0x3020('0xf')][_0x5685e[_0x3020('0x25')]]['id']=this['faxAccounts'][_0x3ac75c]['id'];this[_0x3020('0xf')][_0x5685e[_0x3020('0x25')]][_0x3020('0x27')]=this[_0x3020('0x10')][_0x3ac75c][_0x3020('0x27')];logger[_0x3020('0x28')](_0x5685e['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x5685e[_0x3020('0x25')]]){this[_0x3020('0xf')][_0x5685e[_0x3020('0x25')]]={};this['channels'][_0x5685e[_0x3020('0x25')]][_0x3020('0x26')]=_0x5685e[_0x3020('0x26')];logger[_0x3020('0x28')](_0x5685e[_0x3020('0x25')],_0x3020('0x29'));}};Fax[_0x3020('0x20')][_0x3020('0x15')]=function(_0x307ce9){if(this[_0x3020('0xf')][_0x307ce9['uniqueid']]){for(var _0x448568 in _0x307ce9[_0x3020('0x2a')]){if(_0x307ce9[_0x3020('0x2a')]['hasOwnProperty'](_0x448568)){this[_0x3020('0xf')][_0x307ce9['uniqueid']][_0x448568]=_0x307ce9[_0x3020('0x2b')];}}}};Fax[_0x3020('0x20')][_0x3020('0x2c')]=function(_0x4e817c){if(this[_0x3020('0xf')][_0x4e817c[_0x3020('0x25')]]){this[_0x3020('0xf')][_0x4e817c[_0x3020('0x25')]]['channelstate']=_0x4e817c[_0x3020('0x2d')];this['channels'][_0x4e817c[_0x3020('0x25')]][_0x3020('0x2e')]=_0x4e817c[_0x3020('0x2e')];}};Fax[_0x3020('0x20')][_0x3020('0x17')]=function(_0x19a990){if(this[_0x3020('0xf')][_0x19a990['uniqueid']]){for(var _0xc0c7d2 in _0x19a990[_0x3020('0x2a')]){if(_0x19a990[_0x3020('0x2a')]['hasOwnProperty'](_0xc0c7d2)){this[_0x3020('0xf')][_0x19a990[_0x3020('0x25')]][_0xc0c7d2]=_0x19a990[_0x3020('0x2b')];}}}};Fax['prototype'][_0x3020('0x19')]=function(_0x4ce499){if(this[_0x3020('0xf')][_0x4ce499[_0x3020('0x25')]]){this[_0x3020('0xf')][_0x4ce499[_0x3020('0x25')]][_0x3020('0x2f')]=_0x4ce499[_0x3020('0x2f')];this[_0x3020('0xf')][_0x4ce499[_0x3020('0x25')]][_0x3020('0x30')]=_0x4ce499[_0x3020('0x30')];this['channels'][_0x4ce499[_0x3020('0x25')]][_0x3020('0x24')]=_0x4ce499['localstationid'];this[_0x3020('0xf')][_0x4ce499['uniqueid']][_0x3020('0x31')]=_0x4ce499[_0x3020('0x31')];logger[_0x3020('0x28')](_0x4ce499[_0x3020('0x25')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x3020('0x1b')]=function(_0xb4ef47){var _0x4385c1=this;if(this['channels'][_0xb4ef47['uniqueid']]){var _0x32b183=this[_0x3020('0xf')][_0xb4ef47['uniqueid']]['id'];this[_0x3020('0xf')][_0xb4ef47[_0x3020('0x25')]]['remotestationid']=_0xb4ef47[_0x3020('0x32')];this[_0x3020('0xf')][_0xb4ef47[_0x3020('0x25')]][_0x3020('0x33')]=_0xb4ef47[_0x3020('0x33')];this[_0x3020('0xf')][_0xb4ef47['uniqueid']][_0x3020('0x24')]=_0xb4ef47[_0x3020('0x24')];this[_0x3020('0xf')][_0xb4ef47['uniqueid']][_0x3020('0x34')]=_0xb4ef47[_0x3020('0x34')];this['channels'][_0xb4ef47['uniqueid']][_0x3020('0x35')]=_0xb4ef47[_0x3020('0x35')];this[_0x3020('0xf')][_0xb4ef47[_0x3020('0x25')]]['filename']=_0xb4ef47[_0x3020('0x31')];this[_0x3020('0xf')][_0xb4ef47['uniqueid']][_0x3020('0x36')]=_0xb4ef47[_0x3020('0x36')];if(this[_0x3020('0xf')][_0xb4ef47[_0x3020('0x25')]][_0x3020('0x33')]>0x0){tiff2pdf(_0xb4ef47[_0x3020('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0xb97335){logger[_0x3020('0x28')](_0xb4ef47['uniqueid'],_0x3020('0x37'),_0xb97335[_0x3020('0x38')]);attachment[_0x3020('0x39')]({'name':path[_0x3020('0x3a')](_0xb4ef47[_0x3020('0x31')])[_0x3020('0x27')],'basename':path['parse'](_0xb4ef47[_0x3020('0x31')])[_0x3020('0x27')]+_0x3020('0x3b'),'type':'application/pdf'})[_0x3020('0x3c')](function(_0x2b45e8){faxAccount['notify'](_0x32b183,{'from':_0xb4ef47[_0x3020('0x36')],'mapKey':'fax','body':path[_0x3020('0x3a')](_0xb4ef47['filename'])['name']+_0x3020('0x3b'),'AttachmentId':_0x2b45e8['id']})['catch'](function(_0x376cb2){logger[_0x3020('0x3d')](_0xb4ef47[_0x3020('0x25')],_0x3020('0x3e'),JSON['stringify'](_0x376cb2));});})[_0x3020('0x3f')](function(_0x2876f7){logger['error'](_0xb4ef47[_0x3020('0x25')],_0x3020('0x40'),JSON[_0x3020('0x41')](_0x2876f7));});});}logger[_0x3020('0x28')](_0xb4ef47[_0x3020('0x25')],_0x3020('0x40'));}};Fax[_0x3020('0x20')][_0x3020('0x1f')]=function(_0x30f053){if(this[_0x3020('0x11')][_0x30f053['uniqueid']]){_[_0x3020('0x42')](this['channels'][_0x30f053[_0x3020('0x25')]],_['pick'](_0x30f053,['response',_0x3020('0x43')]));}};function updateStatus(_0x470a82){if(_0x470a82[_0x3020('0x44')]){faxMessage[_0x3020('0x45')](_0x470a82[_0x3020('0x44')],{'failMessage':_0x3020('0x46')})[_0x3020('0x3c')](function(_0x4bb9af){ut[_0x3020('0x47')](_0x3020('0x48'),_0x4bb9af);})[_0x3020('0x3f')](function(_0xa797fa){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0xa797fa);});}else{ut[_0x3020('0x47')](_0x3020('0x49'));}}Fax['prototype'][_0x3020('0x4a')]=function(_0x49bd72,_0x52da08,_0x49693b){var _0x32f8a2=this;var _0x51bc0c={};if(_0x52da08){_0x51bc0c={'read':_0x52da08};}else{_0x51bc0c={'failMessage':_0x49693b};}if(this[_0x3020('0x11')][_0x49bd72]['AttachmentId']){faxMessage[_0x3020('0x45')](this[_0x3020('0x11')][_0x49bd72][_0x3020('0x44')],_0x51bc0c)[_0x3020('0x3c')](function(_0x58feee){ut[_0x3020('0x47')]('[Fax][Message][Updated]',_0x58feee);})['catch'](function(_0x3a965c){ut[_0x3020('0x47')](_0x3020('0x4b'),_0x3a965c);})['finally'](function(){delete _0x32f8a2[_0x3020('0xf')][_0x49bd72];delete _0x32f8a2[_0x3020('0x11')][_0x49bd72];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0x3020('0xf')][_0x49bd72];delete this[_0x3020('0x11')][_0x49bd72];}};Fax[_0x3020('0x20')][_0x3020('0x1d')]=function(_0x122710){var _0x18c025=this;if(this[_0x3020('0xf')][_0x122710[_0x3020('0x25')]]){if(this[_0x3020('0x11')][_0x122710[_0x3020('0x25')]]){this[_0x3020('0xf')][_0x122710[_0x3020('0x25')]]['id']=this['actions'][_0x122710[_0x3020('0x25')]]['id'];this['channels'][_0x122710[_0x3020('0x25')]][_0x3020('0x27')]=this['actions'][_0x122710[_0x3020('0x25')]][_0x3020('0x27')];}logger['info'](_0x122710[_0x3020('0x25')],this['actions'][_0x122710[_0x3020('0x25')]]?_0x3020('0x4c'):'\x20hangup\x20faxRiceive\x20',JSON[_0x3020('0x41')](this[_0x3020('0xf')][_0x122710[_0x3020('0x25')]]));if(this['actions'][_0x122710[_0x3020('0x25')]]){if(this[_0x3020('0xf')][_0x122710[_0x3020('0x25')]][_0x3020('0x4d')]>0x0&&this[_0x3020('0xf')][_0x122710['uniqueid']][_0x3020('0x18')]==='SUCCESS'){this[_0x3020('0x4a')](_0x122710[_0x3020('0x25')],!![]);}else{this[_0x3020('0x4a')](_0x122710[_0x3020('0x25')],![],this[_0x3020('0xf')][_0x122710[_0x3020('0x25')]][_0x3020('0x4e')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x122710[_0x3020('0x25')]][_0x3020('0x4e')]:'SENDING\x20FAILED');}}}};Fax[_0x3020('0x20')]['send']=function(_0x3c473c){var _0xaadb0d=this;return new BPromise(function(_0x57395a,_0x338b42){_0xaadb0d['execOriginate'](_0x3c473c,_0xaadb0d[_0x3020('0x10')][_0x3c473c[_0x3020('0x4f')]])['then'](function(_0x3a05cc){ut[_0x3020('0x47')](_0x3020('0x50'),_0x3a05cc);_0x57395a(ut[_0x3020('0x38')](_0x3020('0x51')));})[_0x3020('0x3f')](function(_0x108571){ut[_0x3020('0x47')](_0x3020('0x52'),_0x108571);updateStatus(_0x3c473c);_0x338b42(ut['message'](_0x3020('0x53')));});});};Fax[_0x3020('0x20')]['checkAfterSend']=function(_0x757ac4){var _0x2eae75=this;return new BPromise(function(_0x5f57f3,_0x3ff3a1){var _0xb4ecda=_0x2eae75[_0x3020('0x54')](_0x2eae75[_0x3020('0x10')][_0x757ac4[_0x3020('0x4f')]][_0x3020('0x55')],_0x757ac4);if(_0xb4ecda[_0x3020('0x56')]){_0x5f57f3(ut[_0x3020('0x38')](_0x3020('0x57')));}else{_0x3ff3a1(ut[_0x3020('0x38')](_0xb4ecda['message']));}});};function originate(_0x2ccda3,_0x205af8,_0x3179a2){return new BPromise(function(_0x36b066,_0x2a07fa){if(_0x3179a2){var _0x1a4440=util[_0x3020('0x58')](_0x3020('0x59'),path[_0x3020('0x3a')](_0x2ccda3[_0x3020('0x5a')])[_0x3020('0x27')],_0x2ccda3[_0x3020('0x5a')]);gs[_0x3020('0x5b')](_0x1a4440)[_0x3020('0x3c')](function(){_0x2ccda3[_0x3020('0x5a')]=util[_0x3020('0x58')](_0x3020('0x5c'),path[_0x3020('0x3a')](_0x2ccda3['path'])[_0x3020('0x5d')],path[_0x3020('0x3a')](_0x2ccda3[_0x3020('0x5a')])[_0x3020('0x27')]);_0x205af8[_0x3020('0x5e')]=_0x2ccda3['path'];ut[_0x3020('0x47')](_0x3020('0x5f'),'');ami[_0x3020('0x60')](ut[_0x3020('0x61')](_0x2ccda3,_0x205af8))[_0x3020('0x3c')](function(_0x4356ec){_0x36b066(_0x4356ec);})[_0x3020('0x3f')](function(_0x4f0ddb){_0x2a07fa(_0x4f0ddb);});})['catch'](function(_0x362e08){_0x2a07fa(_0x362e08);});}else{ami[_0x3020('0x60')](ut[_0x3020('0x61')](_0x2ccda3,_0x205af8))[_0x3020('0x3c')](function(_0x74cc12){_0x36b066(_0x74cc12);})[_0x3020('0x3f')](function(_0x4fe6b0){_0x2a07fa(_0x4fe6b0);});}});}Fax['prototype'][_0x3020('0x62')]=function(_0x3a6c49,_0x326a7f){var _0x4a5a80=this;return new BPromise(function(_0x5a9809,_0x3f026d){var _0x79cfec=uuid['v4']();var _0x57e17f=ut['addVariables'](_0x3a6c49,_0x326a7f);_0x4a5a80[_0x3020('0x11')][_0x79cfec]=new Action(_0x79cfec,_0x326a7f,_0x3a6c49);var _0x271da8=_0x4a5a80[_0x3020('0x11')][_0x79cfec];if(path[_0x3020('0x3a')](_0x3a6c49['path'])[_0x3020('0x63')]===_0x3020('0x3b')){originate(_0x271da8,_0x57e17f,!![])[_0x3020('0x3c')](function(_0x2fb64f){_0x5a9809(_0x2fb64f);})[_0x3020('0x3f')](function(_0x143a85){_0x3f026d(_0x143a85);});}else{originate(_0x271da8,_0x57e17f,![])[_0x3020('0x3c')](function(_0x807b81){_0x5a9809(_0x807b81);})[_0x3020('0x3f')](function(_0x303c69){_0x3f026d(_0x303c69);});}});};Fax[_0x3020('0x20')][_0x3020('0x64')]=function(_0x150bdf){return!_['isNil'](_0x150bdf)&&!_[_0x3020('0x65')](_0x150bdf['name'])&&!_[_0x3020('0x65')](_0x150bdf[_0x3020('0x66')])&&_0x150bdf[_0x3020('0x66')]&&!_[_0x3020('0x65')](this[_0x3020('0x67')][util[_0x3020('0x58')](_0x3020('0x68'),_0x150bdf[_0x3020('0x27')])])&&!_['isNil'](this[_0x3020('0x67')][util[_0x3020('0x58')](_0x3020('0x68'),_0x150bdf[_0x3020('0x27')])][_0x3020('0x30')])&&(this[_0x3020('0x67')][util[_0x3020('0x58')]('SIP/%s',_0x150bdf[_0x3020('0x27')])][_0x3020('0x30')]===_0x3020('0x69')||this[_0x3020('0x67')][util[_0x3020('0x58')]('SIP/%s',_0x150bdf['name'])][_0x3020('0x30')]===_0x3020('0x6a'));};Fax[_0x3020('0x20')][_0x3020('0x54')]=function(_0x227f83,_0x54a105){if(!this[_0x3020('0x64')](_0x227f83)){ut[_0x3020('0x47')](_0x3020('0x6b'),_[_0x3020('0x65')](_0x227f83)?'':_0x227f83[_0x3020('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x3020('0x6c')};}if(_[_0x3020('0x65')](_0x54a105['fax'])){ut[_0x3020('0x47')](_0x3020('0x6d'),JSON['stringify'](_0x54a105));return{'isValid':![],'message':_0x3020('0x6e')};}if(_[_0x3020('0x65')](_0x54a105[_0x3020('0x5a')])){ut[_0x3020('0x47')](_0x3020('0x6f'),JSON[_0x3020('0x41')](_0x54a105));return{'isValid':![],'message':_0x3020('0x70')};}return{'isValid':!![],'message':_0x3020('0x71')};};module['exports']=Fax;
\ No newline at end of file
index 2c9446e..156357a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6119=['[Notify]\x20','../rpc/faxAccount','inspect','notify','then'];(function(_0x3e869e,_0x2ae3d4){var _0x2d1670=function(_0x211dd9){while(--_0x211dd9){_0x3e869e['push'](_0x3e869e['shift']());}};_0x2d1670(++_0x2ae3d4);}(_0x6119,0x191));var _0x9611=function(_0x34e678,_0x24101c){_0x34e678=_0x34e678-0x0;var _0xd1844f=_0x6119[_0x34e678];return _0xd1844f;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var _=require('lodash');var faxAccount=require(_0x9611('0x0'));function loggerCatch(_0x376f42){return function(_0x264f52){logger['error'](_0x376f42,util[_0x9611('0x1')](_0x264f52,{'showHidden':![],'depth':null}));};}exports[_0x9611('0x2')]=function(_0x1e9e4c,_0x4e468f){return BPromise['resolve']()[_0x9611('0x3')](faxAccount['notify'](_0x1e9e4c,_0x4e468f))['catch'](loggerCatch(_0x9611('0x4')));};
\ No newline at end of file
+var _0x9782=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then','catch'];(function(_0x3eb99d,_0x1ef7ef){var _0x16093b=function(_0x543a06){while(--_0x543a06){_0x3eb99d['push'](_0x3eb99d['shift']());}};_0x16093b(++_0x1ef7ef);}(_0x9782,0x1a5));var _0x2978=function(_0x54cef6,_0x146b0e){_0x54cef6=_0x54cef6-0x0;var _0x39aacf=_0x9782[_0x54cef6];return _0x39aacf;};'use strict';var util=require(_0x2978('0x0'));var BPromise=require(_0x2978('0x1'));var logger=require(_0x2978('0x2'))(_0x2978('0x3'));var _=require(_0x2978('0x4'));var faxAccount=require(_0x2978('0x5'));function loggerCatch(_0x5f2f8d){return function(_0x48fb65){logger[_0x2978('0x6')](_0x5f2f8d,util[_0x2978('0x7')](_0x48fb65,{'showHidden':![],'depth':null}));};}exports[_0x2978('0x8')]=function(_0x24916f,_0x2c5632){return BPromise['resolve']()[_0x2978('0x9')](faxAccount[_0x2978('0x8')](_0x24916f,_0x2c5632))[_0x2978('0xa')](loggerCatch(_0x2978('0xb')));};
\ No newline at end of file
index 1404f35..96ed326 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeee5=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','info','Exec\x20gs'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeee5,0x70));var _0x5eee=function(_0x46cebd,_0x445069){_0x46cebd=_0x46cebd-0x0;var _0x3748d7=_0xeee5[_0x46cebd];return _0x3748d7;};'use strict';var util=require(_0x5eee('0x0'));var logger=require(_0x5eee('0x1'))(_0x5eee('0x2'));var BPromise=require(_0x5eee('0x3'));var exec=require(_0x5eee('0x4'))[_0x5eee('0x5')];exports['execute']=function(_0x289f15){return new BPromise(function(_0x4e886f,_0x4b6c17){exec(_0x289f15,function(_0x3d1245,_0x3da43f,_0x53c0d){logger[_0x5eee('0x6')](_0x5eee('0x7'),_0x3da43f);if(_0x3d1245){logger[_0x5eee('0x6')](_0x5eee('0x7'),_0x5eee('0x8'),util[_0x5eee('0x9')](_0x3d1245,{'showHidden':![],'depth':null}),_0x3da43f,_0x53c0d);_0x4b6c17(_0x3d1245);}_0x4e886f(_0x3da43f);});});};
\ No newline at end of file
+var _0x9cc8=['util','../../../../config/logger','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x9cc8,0x1b0));var _0x89cc=function(_0x314a28,_0x2f5bd6){_0x314a28=_0x314a28-0x0;var _0x280796=_0x9cc8[_0x314a28];return _0x280796;};'use strict';var util=require(_0x89cc('0x0'));var logger=require(_0x89cc('0x1'))('fax');var BPromise=require(_0x89cc('0x2'));var exec=require(_0x89cc('0x3'))[_0x89cc('0x4')];exports[_0x89cc('0x5')]=function(_0x1099b3){return new BPromise(function(_0x4f1506,_0x1bd5a1){exec(_0x1099b3,function(_0x338860,_0x2f1dc5,_0x56ae64){logger[_0x89cc('0x6')](_0x89cc('0x7'),_0x2f1dc5);if(_0x338860){logger[_0x89cc('0x6')]('Exec\x20gs','\x20Error\x20:',util['inspect'](_0x338860,{'showHidden':![],'depth':null}),_0x2f1dc5,_0x56ae64);_0x1bd5a1(_0x338860);}_0x4f1506(_0x2f1dc5);});});};
\ No newline at end of file
index 2784a2e..4f2eba4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x493a=['t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','uniqueid','util','lodash','moment','message','logger','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect'];(function(_0x4f9875,_0x3d3a2b){var _0x5c2048=function(_0x4bb484){while(--_0x4bb484){_0x4f9875['push'](_0x4f9875['shift']());}};_0x5c2048(++_0x3d3a2b);}(_0x493a,0x194));var _0xa493=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x493a[_0x1ca9e9];return _0x309f3c;};'use strict';var util=require(_0xa493('0x0'));var _=require(_0xa493('0x1'));var moment=require(_0xa493('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0xa493('0x3')]=function(_0xf83d42){return{'message':_0xf83d42};};exports[_0xa493('0x4')]=function(_0x2f1561,_0x10686d){logger['info'](_0x2f1561,util['inspect'](_0x10686d,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x5d4187,_0x1e54af){var _0xb69c9e={'XMF-ECM':_0x1e54af[_0xa493('0x5')],'XMF-HEADERINFO':_0x1e54af[_0xa493('0x6')],'XMF-MINRATE':_0x1e54af[_0xa493('0x7')],'XMF-MAXRATE':_0x1e54af[_0xa493('0x8')],'XMF-MODEM':util[_0xa493('0x9')](_0xa493('0xa'),_0x1e54af[_0xa493('0xb')]),'XMF-GATEWAY':_0x1e54af[_0xa493('0xc')],'XMF-FAXDETECT':_0x1e54af[_0xa493('0xd')],'XMF-T38TIMEOUT':_0x1e54af[_0xa493('0xe')],'XMF-LOCALSTATIONID':_0x1e54af[_0xa493('0xf')],'XMF-PATH':_0x5d4187[_0xa493('0x10')]};return _0xb69c9e;};exports[_0xa493('0x11')]=function(_0x306ae9,_0x2d1fac){return{'actionid':_0x306ae9['uniqueid'],'action':_0xa493('0x12'),'channel':_0x306ae9[_0xa493('0x13')],'Exten':_0xa493('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0xa493('0x9')]('\x22%s\x22\x20<%s>',_0x306ae9[_0xa493('0x6')]?_0x306ae9[_0xa493('0x6')]:'',_0x306ae9[_0xa493('0xf')]),'variable':_0x2d1fac,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x306ae9[_0xa493('0x15')]};};
\ No newline at end of file
+var _0x4faa=['modem','gateway','t38timeout','localstationid','path','uniqueid','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','ecm','maxrate','\x22%s\x22'];(function(_0x538dab,_0x2e949c){var _0x3ddd28=function(_0x1fbdfb){while(--_0x1fbdfb){_0x538dab['push'](_0x538dab['shift']());}};_0x3ddd28(++_0x2e949c);}(_0x4faa,0x18c));var _0xa4fa=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x4faa[_0xbe200f];return _0x192597;};'use strict';var util=require(_0xa4fa('0x0'));var _=require(_0xa4fa('0x1'));var moment=require(_0xa4fa('0x2'));var logger=require(_0xa4fa('0x3'))(_0xa4fa('0x4'));exports[_0xa4fa('0x5')]=function(_0x324ecb){return{'message':_0x324ecb};};exports[_0xa4fa('0x6')]=function(_0x241d66,_0x4b2d34){logger[_0xa4fa('0x7')](_0x241d66,util[_0xa4fa('0x8')](_0x4b2d34,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x118358,_0x45b1c6){var _0x4d38fc={'XMF-ECM':_0x45b1c6[_0xa4fa('0x9')],'XMF-HEADERINFO':_0x45b1c6['headerinfo'],'XMF-MINRATE':_0x45b1c6['minrate'],'XMF-MAXRATE':_0x45b1c6[_0xa4fa('0xa')],'XMF-MODEM':util['format'](_0xa4fa('0xb'),_0x45b1c6[_0xa4fa('0xc')]),'XMF-GATEWAY':_0x45b1c6[_0xa4fa('0xd')],'XMF-FAXDETECT':_0x45b1c6['faxdetect'],'XMF-T38TIMEOUT':_0x45b1c6[_0xa4fa('0xe')],'XMF-LOCALSTATIONID':_0x45b1c6[_0xa4fa('0xf')],'XMF-PATH':_0x118358[_0xa4fa('0x10')]};return _0x4d38fc;};exports['variablesAction']=function(_0x41d10f,_0x492c8a){return{'actionid':_0x41d10f[_0xa4fa('0x11')],'action':'originate','channel':_0x41d10f[_0xa4fa('0x12')],'Exten':_0xa4fa('0x13'),'Context':_0xa4fa('0x14'),'Priority':'1','callerid':util[_0xa4fa('0x15')](_0xa4fa('0x16'),_0x41d10f['headerinfo']?_0x41d10f[_0xa4fa('0x17')]:'',_0x41d10f[_0xa4fa('0xf')]),'variable':_0x492c8a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x41d10f[_0xa4fa('0x11')]};};
\ No newline at end of file
index c3780b0..821393e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b4d=['initSalesforceAccounts','initSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','sync','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts'];(function(_0x5e1a34,_0x20201a){var _0x45586a=function(_0x3e2a6d){while(--_0x3e2a6d){_0x5e1a34['push'](_0x5e1a34['shift']());}};_0x45586a(++_0x20201a);}(_0x4b4d,0x11e));var _0xd4b4=function(_0x11f406,_0x8d5e6a){_0x11f406=_0x11f406-0x0;var _0x33da93=_0x4b4d[_0x11f406];return _0x33da93;};'use strict';var BPromise=require(_0xd4b4('0x0'));var util=require('util');var moment=require(_0xd4b4('0x1'));var server=require(_0xd4b4('0x2'));var Realtime=require(_0xd4b4('0x3'));var Report=require(_0xd4b4('0x4'));var Acw=require(_0xd4b4('0x5'));var Trigger=require(_0xd4b4('0x6'));var Dialer=require(_0xd4b4('0x7'));var Preview=require(_0xd4b4('0x8'));var Fax=require(_0xd4b4('0x9'));var user=require(_0xd4b4('0xa'));var voiceQueue=require(_0xd4b4('0xb'));var voiceQueueReport=require(_0xd4b4('0xc'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xd4b4('0xd'));var trigger=require(_0xd4b4('0xe'));var template=require(_0xd4b4('0xf'));var cmHopperHistory=require(_0xd4b4('0x10'));var campaign=require(_0xd4b4('0x11'));var voiceExtension=require(_0xd4b4('0x12'));var faxAccount=require(_0xd4b4('0x13'));var zendesk=require(_0xd4b4('0x14'));var salesforce=require(_0xd4b4('0x15'));var sugarcrm=require(_0xd4b4('0x16'));var freshdesk=require(_0xd4b4('0x17'));var desk=require(_0xd4b4('0x18'));var zoho=require(_0xd4b4('0x19'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xd4b4('0x1a'));var servicenow=require(_0xd4b4('0x1b'));var dynamics365=require(_0xd4b4('0x1c'));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()[_0xd4b4('0x1d')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xd4b4('0x1d')](_0xd4b4('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xd4b4('0x1f')]()[_0xd4b4('0x20')](user[_0xd4b4('0x21')]())[_0xd4b4('0x20')](realtime[_0xd4b4('0x22')]())[_0xd4b4('0x20')](user['getTelephones']())[_0xd4b4('0x20')](realtime[_0xd4b4('0x23')]())['then'](trunk[_0xd4b4('0x24')]())[_0xd4b4('0x20')](realtime[_0xd4b4('0x25')]())[_0xd4b4('0x20')](voiceQueue[_0xd4b4('0x26')]())[_0xd4b4('0x20')](realtime['initVoiceQueues']())['then'](trigger[_0xd4b4('0x27')]())[_0xd4b4('0x20')](realtime['initTriggers']())[_0xd4b4('0x20')](template['getTemplates']())['then'](realtime[_0xd4b4('0x28')]())[_0xd4b4('0x20')](zendesk[_0xd4b4('0x29')]())[_0xd4b4('0x20')](realtime[_0xd4b4('0x2a')]())[_0xd4b4('0x20')](salesforce[_0xd4b4('0x2b')]())[_0xd4b4('0x20')](realtime[_0xd4b4('0x2c')]())[_0xd4b4('0x20')](sugarcrm['getSugarcrmAccounts']())[_0xd4b4('0x20')](realtime[_0xd4b4('0x2d')]())[_0xd4b4('0x20')](freshdesk['getFreshdeskAccounts']())['then'](realtime['initFreshdeskAccounts']())[_0xd4b4('0x20')](desk[_0xd4b4('0x2e')]())[_0xd4b4('0x20')](realtime[_0xd4b4('0x2f')]())['then'](zoho[_0xd4b4('0x30')]())[_0xd4b4('0x20')](realtime[_0xd4b4('0x31')]())[_0xd4b4('0x20')](vtiger[_0xd4b4('0x32')]())[_0xd4b4('0x20')](realtime['initVtigerAccounts']())[_0xd4b4('0x20')](freshsales[_0xd4b4('0x33')]())[_0xd4b4('0x20')](realtime[_0xd4b4('0x34')]())[_0xd4b4('0x20')](servicenow[_0xd4b4('0x35')]())[_0xd4b4('0x20')](realtime['initServicenowAccounts']())[_0xd4b4('0x20')](dynamics365[_0xd4b4('0x36')]())[_0xd4b4('0x20')](realtime[_0xd4b4('0x37')]())[_0xd4b4('0x20')](campaign[_0xd4b4('0x38')]())[_0xd4b4('0x20')](realtime['initCampaigns']())[_0xd4b4('0x20')](voiceExtension[_0xd4b4('0x39')]())[_0xd4b4('0x20')](realtime['initVoiceExtensions']())['then'](faxAccount['getFaxAccounts']())['then'](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xd4b4('0x20')](voiceQueueReport['getVoiceQueueReports']())[_0xd4b4('0x20')](realtime[_0xd4b4('0x3a')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xd4b4('0x20')](realtime[_0xd4b4('0x3b')]())[_0xd4b4('0x20')](cmHopperHistory[_0xd4b4('0x3c')]())[_0xd4b4('0x20')](realtime['initCampaignHopperHistory']())[_0xd4b4('0x20')](voiceCallReport[_0xd4b4('0x3d')]())[_0xd4b4('0x20')](realtime[_0xd4b4('0x3e')]())[_0xd4b4('0x20')](function(_0x3e6cbf){})[_0xd4b4('0x3f')](function(_0x565983){console[_0xd4b4('0x40')](_0x565983);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x289816){return initRealtime();})[_0xd4b4('0x20')](function(){return initParams();})[_0xd4b4('0x20')](function(){report[_0xd4b4('0x41')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x333d3e){console['log'](_0x333d3e);});}main();
\ No newline at end of file
+var _0x60c9=['initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','catch','util','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','then','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues'];(function(_0x4b2b03,_0x31f748){var _0x64651c=function(_0x2f9395){while(--_0x2f9395){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x64651c(++_0x31f748);}(_0x60c9,0x136));var _0x960c=function(_0x44fde7,_0x13bca8){_0x44fde7=_0x44fde7-0x0;var _0x729ad3=_0x60c9[_0x44fde7];return _0x729ad3;};'use strict';var BPromise=require('bluebird');var util=require(_0x960c('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require(_0x960c('0x1'));var Report=require(_0x960c('0x2'));var Acw=require(_0x960c('0x3'));var Trigger=require(_0x960c('0x4'));var Dialer=require(_0x960c('0x5'));var Preview=require(_0x960c('0x6'));var Fax=require(_0x960c('0x7'));var user=require(_0x960c('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x960c('0x9'));var trunk=require(_0x960c('0xa'));var trigger=require('./rpc/trigger');var template=require(_0x960c('0xb'));var cmHopperHistory=require(_0x960c('0xc'));var campaign=require(_0x960c('0xd'));var voiceExtension=require(_0x960c('0xe'));var faxAccount=require(_0x960c('0xf'));var zendesk=require(_0x960c('0x10'));var salesforce=require(_0x960c('0x11'));var sugarcrm=require(_0x960c('0x12'));var freshdesk=require(_0x960c('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x960c('0x14'));var vtiger=require(_0x960c('0x15'));var freshsales=require(_0x960c('0x16'));var servicenow=require(_0x960c('0x17'));var dynamics365=require(_0x960c('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x960c('0x19')](_0x960c('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x960c('0x19')](_0x960c('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x960c('0x1b')]()['then'](user[_0x960c('0x1c')]())[_0x960c('0x1d')](realtime[_0x960c('0x1e')]())['then'](user[_0x960c('0x1f')]())[_0x960c('0x1d')](realtime['initTelephones']())[_0x960c('0x1d')](trunk[_0x960c('0x20')]())[_0x960c('0x1d')](realtime[_0x960c('0x21')]())['then'](voiceQueue[_0x960c('0x22')]())['then'](realtime[_0x960c('0x23')]())[_0x960c('0x1d')](trigger[_0x960c('0x24')]())[_0x960c('0x1d')](realtime[_0x960c('0x25')]())[_0x960c('0x1d')](template[_0x960c('0x26')]())[_0x960c('0x1d')](realtime[_0x960c('0x27')]())[_0x960c('0x1d')](zendesk['getZendeskAccounts']())[_0x960c('0x1d')](realtime[_0x960c('0x28')]())[_0x960c('0x1d')](salesforce['getSalesforceAccounts']())[_0x960c('0x1d')](realtime[_0x960c('0x29')]())[_0x960c('0x1d')](sugarcrm['getSugarcrmAccounts']())[_0x960c('0x1d')](realtime[_0x960c('0x2a')]())['then'](freshdesk['getFreshdeskAccounts']())['then'](realtime['initFreshdeskAccounts']())[_0x960c('0x1d')](desk['getDeskAccounts']())['then'](realtime[_0x960c('0x2b')]())[_0x960c('0x1d')](zoho[_0x960c('0x2c')]())[_0x960c('0x1d')](realtime[_0x960c('0x2d')]())[_0x960c('0x1d')](vtiger[_0x960c('0x2e')]())['then'](realtime[_0x960c('0x2f')]())[_0x960c('0x1d')](freshsales[_0x960c('0x30')]())[_0x960c('0x1d')](realtime[_0x960c('0x31')]())[_0x960c('0x1d')](servicenow['getServicenowAccounts']())[_0x960c('0x1d')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x960c('0x32')]())[_0x960c('0x1d')](realtime[_0x960c('0x33')]())[_0x960c('0x1d')](campaign[_0x960c('0x34')]())['then'](realtime[_0x960c('0x35')]())[_0x960c('0x1d')](voiceExtension[_0x960c('0x36')]())[_0x960c('0x1d')](realtime[_0x960c('0x37')]())[_0x960c('0x1d')](faxAccount[_0x960c('0x38')]())[_0x960c('0x1d')](realtime[_0x960c('0x39')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x960c('0x1b')]()[_0x960c('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0x960c('0x1d')](realtime[_0x960c('0x3a')]())[_0x960c('0x1d')](cmHopperHistory[_0x960c('0x3b')]())[_0x960c('0x1d')](realtime[_0x960c('0x3c')]())[_0x960c('0x1d')](cmHopperHistory[_0x960c('0x3d')]())['then'](realtime[_0x960c('0x3e')]())['then'](voiceCallReport[_0x960c('0x3f')]())[_0x960c('0x1d')](realtime[_0x960c('0x40')]())[_0x960c('0x1d')](function(_0x46a1db){})['catch'](function(_0x2ec4da){console[_0x960c('0x41')](_0x2ec4da);});}function main(){return server[_0x960c('0x42')](realtime,preview,fax)[_0x960c('0x1d')](function(_0x16b71a){return initRealtime();})[_0x960c('0x1d')](function(){return initParams();})['then'](function(){report[_0x960c('0x43')]();setInterval(initRealtime,0x1388);})[_0x960c('0x44')](function(_0x18eaec){console['log'](_0x18eaec);});}main();
\ No newline at end of file
index c02a002..fd49d1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x2f63c5,_0x2154d){var _0x3d1fa8=function(_0x2a88ba){while(--_0x2a88ba){_0x2f63c5['push'](_0x2f63c5['shift']());}};_0x3d1fa8(++_0x2154d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent;
\ No newline at end of file
+var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0xa7fe35,_0x297e00){var _0x321bde=function(_0x437ab5){while(--_0x437ab5){_0xa7fe35['push'](_0xa7fe35['shift']());}};_0x321bde(++_0x297e00);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent;
\ No newline at end of file
index 3825007..6016e70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9387=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0x4f13fa,_0x3cd54b){var _0x326f19=function(_0x299b25){while(--_0x299b25){_0x4f13fa['push'](_0x4f13fa['shift']());}};_0x326f19(++_0x3cd54b);}(_0x9387,0x9e));var _0x7938=function(_0x3c2040,_0x140e5d){_0x3c2040=_0x3c2040-0x0;var _0x134101=_0x9387[_0x3c2040];return _0x134101;};'use strict';function Campaign(_0x310209){this['id']=_0x310209['id']||0x0;this[_0x7938('0x0')]=_0x310209[_0x7938('0x0')]||'';this[_0x7938('0x1')]=_0x310209[_0x7938('0x1')]||_0x7938('0x2');this['originated']=0x0;this[_0x7938('0x3')]=0x0;this[_0x7938('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x7938('0x5')]='';this[_0x7938('0x6')]=!![];this[_0x7938('0x7')]=_0x310209['active'];this[_0x7938('0x8')]=_0x310209[_0x7938('0x8')];this[_0x7938('0x9')]=_0x310209['dialTimezone']||null;this[_0x7938('0xa')]=_0x310209['dialGlobalInterval']?_0x310209[_0x7938('0xa')]:null;this[_0x7938('0xb')]=_0x310209['dialOriginateCallerIdName'];this[_0x7938('0xc')]=_0x310209[_0x7938('0xc')];this[_0x7938('0xd')]=_0x310209['dialOriginateTimeout']||0x1e;this[_0x7938('0xe')]=_0x310209[_0x7938('0xe')];this[_0x7938('0xf')]=_0x310209['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x310209[_0x7938('0x10')];this['dialBusyRetryFrequency']=_0x310209['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x310209[_0x7938('0x11')];this[_0x7938('0x12')]=_0x310209[_0x7938('0x12')];this['dialGlobalMaxRetry']=_0x310209['dialGlobalMaxRetry'];this[_0x7938('0x13')]=_0x310209[_0x7938('0x13')]||0x3;this[_0x7938('0x14')]=_0x310209['dialNoSuchNumberRetryFrequency']||0x96;this[_0x7938('0x15')]=_0x310209[_0x7938('0x15')]||0x3;this['dialDropRetryFrequency']=_0x310209[_0x7938('0x16')]||0x96;this[_0x7938('0x17')]=_0x310209['dialAbandonedMaxRetry']||0x3;this[_0x7938('0x18')]=_0x310209[_0x7938('0x18')]||0x96;this['dialMachineMaxRetry']=_0x310209[_0x7938('0x19')]||0x3;this['dialMachineRetryFrequency']=_0x310209['dialMachineRetryFrequency']||0x96;this[_0x7938('0x1a')]=_0x310209[_0x7938('0x1a')]||0x3;this[_0x7938('0x1b')]=_0x310209[_0x7938('0x1b')]||0x96;this[_0x7938('0x1c')]=_0x310209[_0x7938('0x1c')]||'DESC';this['dialPrefix']=_0x310209[_0x7938('0x1d')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x310209['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x7938('0x1e')]=_0x310209[_0x7938('0x1e')]||undefined;this[_0x7938('0x1f')]=_0x310209[_0x7938('0x1f')]?_0x310209[_0x7938('0x1f')]:undefined;this[_0x7938('0x20')]=_0x310209[_0x7938('0x20')]?_0x310209[_0x7938('0x20')]:undefined;this[_0x7938('0x21')]=_0x310209['Interval']?_0x310209[_0x7938('0x21')]:undefined;this[_0x7938('0x22')]=_0x310209['SquareProject']?_0x310209[_0x7938('0x22')]:undefined;this['dialQueueProject']=_0x310209[_0x7938('0x22')]?_0x310209[_0x7938('0x22')][_0x7938('0x0')]:undefined;this[_0x7938('0x23')]=_0x310209[_0x7938('0x23')]||![];this[_0x7938('0x24')]=_0x310209[_0x7938('0x24')];this[_0x7938('0x25')]=_0x310209[_0x7938('0x25')];this['dialAMDAfterGreetingSilence']=_0x310209['dialAMDAfterGreetingSilence'];this[_0x7938('0x26')]=_0x310209[_0x7938('0x26')];this[_0x7938('0x27')]=_0x310209[_0x7938('0x27')];this[_0x7938('0x28')]=_0x310209[_0x7938('0x28')];this[_0x7938('0x29')]=_0x310209[_0x7938('0x29')];this['dialAMDSilenceThreshold']=_0x310209[_0x7938('0x2a')];this[_0x7938('0x2b')]=_0x310209[_0x7938('0x2b')];}module[_0x7938('0x2c')]=Campaign;
\ No newline at end of file
+var _0x4802=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x4802,0x152));var _0x2480=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x4802[_0x23e7c1];return _0x1add43;};'use strict';function Campaign(_0x1c91ac){this['id']=_0x1c91ac['id']||0x0;this[_0x2480('0x0')]=_0x1c91ac[_0x2480('0x0')]||'';this[_0x2480('0x1')]=_0x1c91ac['type']||_0x2480('0x2');this[_0x2480('0x3')]=0x0;this[_0x2480('0x4')]=0x0;this[_0x2480('0x5')]=0x0;this[_0x2480('0x6')]=0x0;this[_0x2480('0x7')]='';this[_0x2480('0x8')]=!![];this['active']=_0x1c91ac['active'];this['limitCalls']=_0x1c91ac[_0x2480('0x9')];this[_0x2480('0xa')]=_0x1c91ac['dialTimezone']||null;this[_0x2480('0xb')]=_0x1c91ac[_0x2480('0xb')]?_0x1c91ac[_0x2480('0xb')]:null;this[_0x2480('0xc')]=_0x1c91ac[_0x2480('0xc')];this[_0x2480('0xd')]=_0x1c91ac['dialOriginateCallerIdNumber'];this[_0x2480('0xe')]=_0x1c91ac[_0x2480('0xe')]||0x1e;this[_0x2480('0xf')]=_0x1c91ac['dialCongestionMaxRetry'];this[_0x2480('0x10')]=_0x1c91ac[_0x2480('0x10')];this[_0x2480('0x11')]=_0x1c91ac[_0x2480('0x11')];this[_0x2480('0x12')]=_0x1c91ac[_0x2480('0x12')];this[_0x2480('0x13')]=_0x1c91ac[_0x2480('0x13')];this[_0x2480('0x14')]=_0x1c91ac[_0x2480('0x14')];this['dialGlobalMaxRetry']=_0x1c91ac[_0x2480('0x15')];this[_0x2480('0x16')]=_0x1c91ac['dialNoSuchNumberMaxRetry']||0x3;this[_0x2480('0x17')]=_0x1c91ac[_0x2480('0x17')]||0x96;this['dialDropMaxRetry']=_0x1c91ac[_0x2480('0x18')]||0x3;this['dialDropRetryFrequency']=_0x1c91ac[_0x2480('0x19')]||0x96;this['dialAbandonedMaxRetry']=_0x1c91ac[_0x2480('0x1a')]||0x3;this[_0x2480('0x1b')]=_0x1c91ac[_0x2480('0x1b')]||0x96;this[_0x2480('0x1c')]=_0x1c91ac[_0x2480('0x1c')]||0x3;this[_0x2480('0x1d')]=_0x1c91ac[_0x2480('0x1d')]||0x96;this[_0x2480('0x1e')]=_0x1c91ac['dialAgentRejectMaxRetry']||0x3;this[_0x2480('0x1f')]=_0x1c91ac[_0x2480('0x1f')]||0x96;this[_0x2480('0x20')]=_0x1c91ac[_0x2480('0x20')]||'DESC';this[_0x2480('0x21')]=_0x1c91ac[_0x2480('0x21')]||undefined;this[_0x2480('0x22')]=_0x1c91ac['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x1c91ac[_0x2480('0x23')]||undefined;this[_0x2480('0x24')]=_0x1c91ac['TrunkBackup']?_0x1c91ac[_0x2480('0x24')]:undefined;this[_0x2480('0x25')]=_0x1c91ac[_0x2480('0x25')]?_0x1c91ac[_0x2480('0x25')]:undefined;this[_0x2480('0x26')]=_0x1c91ac['Interval']?_0x1c91ac[_0x2480('0x26')]:undefined;this[_0x2480('0x27')]=_0x1c91ac[_0x2480('0x27')]?_0x1c91ac[_0x2480('0x27')]:undefined;this[_0x2480('0x28')]=_0x1c91ac['SquareProject']?_0x1c91ac['SquareProject'][_0x2480('0x0')]:undefined;this[_0x2480('0x29')]=_0x1c91ac['dialAMDActive']||![];this[_0x2480('0x2a')]=_0x1c91ac[_0x2480('0x2a')];this[_0x2480('0x2b')]=_0x1c91ac[_0x2480('0x2b')];this[_0x2480('0x2c')]=_0x1c91ac[_0x2480('0x2c')];this['dialAMDTotalAnalysisTime']=_0x1c91ac[_0x2480('0x2d')];this[_0x2480('0x2e')]=_0x1c91ac[_0x2480('0x2e')];this[_0x2480('0x2f')]=_0x1c91ac[_0x2480('0x2f')];this[_0x2480('0x30')]=_0x1c91ac['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x1c91ac[_0x2480('0x31')];this[_0x2480('0x32')]=_0x1c91ac[_0x2480('0x32')];}module['exports']=Campaign;
\ No newline at end of file
index efdab1e..6f1ac9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9c6=['holdtime','tag','disposition','monitorFilename','queue','transfercalleridnum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','linkedid','exten','answered','endtime','unmanaged','lastapplication','lastdata','billableseconds'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb9c6,0x1aa));var _0x6b9c=function(_0x3c060f,_0x367fdc){_0x3c060f=_0x3c060f-0x0;var _0x401ee4=_0xb9c6[_0x3c060f];return _0x401ee4;};'use strict';function Channel(){this[_0x6b9c('0x0')]=null;this[_0x6b9c('0x1')]='';this[_0x6b9c('0x2')]='';this[_0x6b9c('0x3')]=0x0;this['calleridname']='';this[_0x6b9c('0x4')]=undefined;this[_0x6b9c('0x5')]=undefined;this['accountcode']=0x0;this['context']='';this['uniqueid']=0x0;this[_0x6b9c('0x6')]=0x0;this[_0x6b9c('0x7')]=0x0;this[_0x6b9c('0x8')]=![];this['answertime']=null;this[_0x6b9c('0x9')]=null;this[_0x6b9c('0xa')]=![];this['abandoned']=![];this[_0x6b9c('0xb')]='';this[_0x6b9c('0xc')]='';this['duration']=0x0;this[_0x6b9c('0xd')]=0x0;this[_0x6b9c('0xe')]=0x0;this['type']=null;this[_0x6b9c('0xf')]=null;this[_0x6b9c('0x10')]=null;this['monitor']=![];this[_0x6b9c('0x11')]=null;this[_0x6b9c('0x12')]=null;this['monitors']=[];this[_0x6b9c('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x6b9c('0x14')]=0x0;}module[_0x6b9c('0x15')]=Channel;
\ No newline at end of file
+var _0x7334=['accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','connectedlinenum'];(function(_0x927ad8,_0x3da4aa){var _0x47b234=function(_0x241785){while(--_0x241785){_0x927ad8['push'](_0x927ad8['shift']());}};_0x47b234(++_0x3da4aa);}(_0x7334,0x184));var _0x4733=function(_0x5077c5,_0xa29350){_0x5077c5=_0x5077c5-0x0;var _0x359a7f=_0x7334[_0x5077c5];return _0x359a7f;};'use strict';function Channel(){this[_0x4733('0x0')]=null;this[_0x4733('0x1')]='';this[_0x4733('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x4733('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x4733('0x4')]=0x0;this[_0x4733('0x5')]='';this[_0x4733('0x6')]=0x0;this[_0x4733('0x7')]=0x0;this[_0x4733('0x8')]=0x0;this[_0x4733('0x9')]=![];this[_0x4733('0xa')]=null;this[_0x4733('0xb')]=null;this[_0x4733('0xc')]=![];this[_0x4733('0xd')]=![];this[_0x4733('0xe')]='';this[_0x4733('0xf')]='';this[_0x4733('0x10')]=0x0;this[_0x4733('0x11')]=0x0;this[_0x4733('0x12')]=0x0;this[_0x4733('0x13')]=null;this[_0x4733('0x14')]=null;this['disposition']=null;this[_0x4733('0x15')]=![];this[_0x4733('0x16')]=null;this['queue']=null;this[_0x4733('0x17')]=[];this['transfercalleridnum']=undefined;this[_0x4733('0x18')]=undefined;this[_0x4733('0x19')]=undefined;this[_0x4733('0x1a')]=0x0;}module[_0x4733('0x1b')]=Channel;
\ No newline at end of file
index e2ab75a..95900c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbef=['consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x5a4370,_0x390287){var _0x3aac70=function(_0x336bd0){while(--_0x336bd0){_0x5a4370['push'](_0x5a4370['shift']());}};_0x3aac70(++_0x390287);}(_0xcbef,0x1b7));var _0xfcbe=function(_0x139b63,_0x389ca8){_0x139b63=_0x139b63-0x0;var _0x2493f2=_0xcbef[_0x139b63];return _0x2493f2;};'use strict';function DeskAccount(_0x13f206){this['id']=_0x13f206['id']||0x0;this['name']=_0x13f206[_0xfcbe('0x0')]||'';this[_0xfcbe('0x1')]=_0x13f206['username']||'';this[_0xfcbe('0x2')]=_0x13f206['remoteUri']||'';this[_0xfcbe('0x3')]=_0x13f206[_0xfcbe('0x3')]||'';this[_0xfcbe('0x4')]=_0x13f206[_0xfcbe('0x4')]||'';this['consumerKey']=_0x13f206[_0xfcbe('0x5')]||'';this['consumerSecret']=_0x13f206[_0xfcbe('0x6')]||'';this[_0xfcbe('0x7')]=_0x13f206['token']||'';this[_0xfcbe('0x8')]=_0x13f206[_0xfcbe('0x8')]||'';this['type']=_0x13f206['type']||'';this[_0xfcbe('0x9')]=_0x13f206[_0xfcbe('0x9')]||'';this['Configurations']=_0x13f206[_0xfcbe('0xa')]||{};}module[_0xfcbe('0xb')]=DeskAccount;
\ No newline at end of file
+var _0x09c7=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x32a6d8,_0x15a10c){var _0x42e00c=function(_0x3f6c43){while(--_0x3f6c43){_0x32a6d8['push'](_0x32a6d8['shift']());}};_0x42e00c(++_0x15a10c);}(_0x09c7,0x15d));var _0x709c=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x09c7[_0x110c3d];return _0x226d67;};'use strict';function DeskAccount(_0x391eca){this['id']=_0x391eca['id']||0x0;this[_0x709c('0x0')]=_0x391eca[_0x709c('0x0')]||'';this['username']=_0x391eca[_0x709c('0x1')]||'';this[_0x709c('0x2')]=_0x391eca[_0x709c('0x2')]||'';this[_0x709c('0x3')]=_0x391eca[_0x709c('0x3')]||'';this[_0x709c('0x4')]=_0x391eca[_0x709c('0x4')]||'';this[_0x709c('0x5')]=_0x391eca[_0x709c('0x5')]||'';this['consumerSecret']=_0x391eca[_0x709c('0x6')]||'';this[_0x709c('0x7')]=_0x391eca[_0x709c('0x7')]||'';this[_0x709c('0x8')]=_0x391eca[_0x709c('0x8')]||'';this['type']=_0x391eca[_0x709c('0x9')]||'';this[_0x709c('0xa')]=_0x391eca[_0x709c('0xa')]||'';this[_0x709c('0xb')]=_0x391eca[_0x709c('0xb')]||{};}module[_0x709c('0xc')]=DeskAccount;
\ No newline at end of file
index de25167..f4c6235 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['clientId','serverUrl','Configurations','exports','name','password','remoteUri','tenantId'];(function(_0x2b1016,_0xbf1f64){var _0x4a7a11=function(_0x529b2c){while(--_0x529b2c){_0x2b1016['push'](_0x2b1016['shift']());}};_0x4a7a11(++_0xbf1f64);}(_0xda3f,0xec));var _0xfda3=function(_0x41f536,_0x101a54){_0x41f536=_0x41f536-0x0;var _0x27e9c5=_0xda3f[_0x41f536];return _0x27e9c5;};'use strict';function Dynamics365Account(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['username']=_0x33f0ce['username']||'';this['password']=_0x33f0ce[_0xfda3('0x1')]||'';this['remoteUri']=_0x33f0ce[_0xfda3('0x2')]||'';this[_0xfda3('0x3')]=_0x33f0ce['tenantId']||'';this[_0xfda3('0x4')]=_0x33f0ce[_0xfda3('0x4')]||'';this['clientSecret']=_0x33f0ce['clientSecret']||{};this[_0xfda3('0x5')]=_0x33f0ce[_0xfda3('0x5')]||'';this[_0xfda3('0x6')]=_0x33f0ce[_0xfda3('0x6')]||{};}module[_0xfda3('0x7')]=Dynamics365Account;
\ No newline at end of file
+var _0xb688=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x2b0ff0,_0x559448){var _0x2c2c72=function(_0x23d7c6){while(--_0x23d7c6){_0x2b0ff0['push'](_0x2b0ff0['shift']());}};_0x2c2c72(++_0x559448);}(_0xb688,0xcf));var _0x8b68=function(_0x4496c1,_0x103294){_0x4496c1=_0x4496c1-0x0;var _0xa2da11=_0xb688[_0x4496c1];return _0xa2da11;};'use strict';function Dynamics365Account(_0x185590){this['id']=_0x185590['id']||0x0;this[_0x8b68('0x0')]=_0x185590[_0x8b68('0x0')]||'';this[_0x8b68('0x1')]=_0x185590[_0x8b68('0x1')]||'';this[_0x8b68('0x2')]=_0x185590[_0x8b68('0x2')]||'';this['remoteUri']=_0x185590[_0x8b68('0x3')]||'';this[_0x8b68('0x4')]=_0x185590[_0x8b68('0x4')]||'';this[_0x8b68('0x5')]=_0x185590['clientId']||'';this[_0x8b68('0x6')]=_0x185590['clientSecret']||{};this[_0x8b68('0x7')]=_0x185590[_0x8b68('0x7')]||'';this[_0x8b68('0x8')]=_0x185590[_0x8b68('0x8')]||{};}module[_0x8b68('0x9')]=Dynamics365Account;
\ No newline at end of file
index 10b3d6b..0221316 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefb1=['minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid'];(function(_0xc22e92,_0x411d0c){var _0x2d9cea=function(_0x3565e9){while(--_0x3565e9){_0xc22e92['push'](_0xc22e92['shift']());}};_0x2d9cea(++_0x411d0c);}(_0xefb1,0xfa));var _0x1efb=function(_0x262e64,_0x1c5a50){_0x262e64=_0x262e64-0x0;var _0x4bb6b8=_0xefb1[_0x262e64];return _0x4bb6b8;};'use strict';function FaxAccount(_0x13e53a){this['id']=_0x13e53a['id']||0x0;this[_0x1efb('0x0')]=_0x13e53a['name']||'';this[_0x1efb('0x1')]=_0x13e53a[_0x1efb('0x1')];this[_0x1efb('0x2')]=_0x13e53a[_0x1efb('0x2')];this[_0x1efb('0x3')]=_0x13e53a[_0x1efb('0x3')];this[_0x1efb('0x4')]=_0x13e53a['localstationid'];this['minrate']=_0x13e53a[_0x1efb('0x5')]||0x960;this['maxrate']=_0x13e53a[_0x1efb('0x6')]||0x3840;this[_0x1efb('0x7')]=_0x13e53a[_0x1efb('0x7')]||_0x1efb('0x8');this[_0x1efb('0x9')]=_0x13e53a[_0x1efb('0x9')]||'no';this[_0x1efb('0xa')]=_0x13e53a[_0x1efb('0xa')]||'no';this[_0x1efb('0xb')]=_0x13e53a[_0x1efb('0xb')]||0x1388;this[_0x1efb('0xc')]=_0x13e53a[_0x1efb('0xc')]||_0x1efb('0xd');this[_0x1efb('0xe')]=_0x13e53a['Trunk']?_0x13e53a[_0x1efb('0xe')]:undefined;this[_0x1efb('0xf')]=_0x13e53a['ListId'];this['key']=_0x13e53a[_0x1efb('0x10')];}module['exports']=FaxAccount;
\ No newline at end of file
+var _0xf7eb=['Trunk','ListId','name','description','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xf7eb,0x9e));var _0xbf7e=function(_0x93cc2,_0x4abacc){_0x93cc2=_0x93cc2-0x0;var _0x1d3a3e=_0xf7eb[_0x93cc2];return _0x1d3a3e;};'use strict';function FaxAccount(_0x1f2b44){this['id']=_0x1f2b44['id']||0x0;this[_0xbf7e('0x0')]=_0x1f2b44[_0xbf7e('0x0')]||'';this[_0xbf7e('0x1')]=_0x1f2b44[_0xbf7e('0x1')];this['ecm']=_0x1f2b44['ecm'];this[_0xbf7e('0x2')]=_0x1f2b44['headerinfo'];this['localstationid']=_0x1f2b44['localstationid'];this[_0xbf7e('0x3')]=_0x1f2b44[_0xbf7e('0x3')]||0x960;this['maxrate']=_0x1f2b44[_0xbf7e('0x4')]||0x3840;this[_0xbf7e('0x5')]=_0x1f2b44[_0xbf7e('0x5')]||'v17,v27,v29';this[_0xbf7e('0x6')]=_0x1f2b44[_0xbf7e('0x6')]||'no';this['faxdetect']=_0x1f2b44[_0xbf7e('0x7')]||'no';this['t38timeout']=_0x1f2b44[_0xbf7e('0x8')]||0x1388;this[_0xbf7e('0x9')]=_0x1f2b44[_0xbf7e('0x9')]||'SIP';this[_0xbf7e('0xa')]=_0x1f2b44[_0xbf7e('0xa')]?_0x1f2b44[_0xbf7e('0xa')]:undefined;this[_0xbf7e('0xb')]=_0x1f2b44[_0xbf7e('0xb')];this['key']=_0x1f2b44['key'];}module['exports']=FaxAccount;
\ No newline at end of file
index b7c1505..655fda5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe785=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x14190b,_0x51cf11){var _0x2937eb=function(_0x2079f7){while(--_0x2079f7){_0x14190b['push'](_0x14190b['shift']());}};_0x2937eb(++_0x51cf11);}(_0xe785,0x100));var _0x5e78=function(_0x32d26e,_0x24e03c){_0x32d26e=_0x32d26e-0x0;var _0x24fea4=_0xe785[_0x32d26e];return _0x24fea4;};'use strict';function FreshdeskAccount(_0x5b0104){this['id']=_0x5b0104['id']||0x0;this[_0x5e78('0x0')]=_0x5b0104['name']||'';this[_0x5e78('0x1')]=_0x5b0104[_0x5e78('0x1')]||'';this[_0x5e78('0x2')]=_0x5b0104[_0x5e78('0x3')]||'';this[_0x5e78('0x4')]=_0x5b0104['remoteUri']||'';this[_0x5e78('0x5')]=_0x5b0104['serverUrl']||'';this[_0x5e78('0x6')]=_0x5b0104['Configurations']||{};}module[_0x5e78('0x7')]=FreshdeskAccount;
\ No newline at end of file
+var _0x7ab5=['username','apiKey','remoteUri','serverUrl','Configurations','name'];(function(_0x18f4a0,_0x3c3735){var _0x179e96=function(_0x3c068e){while(--_0x3c068e){_0x18f4a0['push'](_0x18f4a0['shift']());}};_0x179e96(++_0x3c3735);}(_0x7ab5,0x149));var _0x57ab=function(_0x35ea83,_0x5526dd){_0x35ea83=_0x35ea83-0x0;var _0x4c24e3=_0x7ab5[_0x35ea83];return _0x4c24e3;};'use strict';function FreshdeskAccount(_0x1c03e8){this['id']=_0x1c03e8['id']||0x0;this[_0x57ab('0x0')]=_0x1c03e8[_0x57ab('0x0')]||'';this['username']=_0x1c03e8[_0x57ab('0x1')]||'';this[_0x57ab('0x2')]=_0x1c03e8['token']||'';this['remoteUri']=_0x1c03e8[_0x57ab('0x3')]||'';this[_0x57ab('0x4')]=_0x1c03e8['serverUrl']||'';this[_0x57ab('0x5')]=_0x1c03e8[_0x57ab('0x5')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
index 841e623..8a2aa63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f80=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x36de89,_0x41bbf8){var _0x2d339f=function(_0x45b527){while(--_0x45b527){_0x36de89['push'](_0x36de89['shift']());}};_0x2d339f(++_0x41bbf8);}(_0x0f80,0x108));var _0x00f8=function(_0x4e0902,_0x27eb58){_0x4e0902=_0x4e0902-0x0;var _0x12398f=_0x0f80[_0x4e0902];return _0x12398f;};'use strict';function FreshsalesAccount(_0x2aaa24){this['id']=_0x2aaa24['id']||0x0;this[_0x00f8('0x0')]=_0x2aaa24[_0x00f8('0x0')]||'';this[_0x00f8('0x1')]=_0x2aaa24[_0x00f8('0x1')]||'';this[_0x00f8('0x2')]=_0x2aaa24['token']||'';this[_0x00f8('0x3')]=_0x2aaa24[_0x00f8('0x3')]||'';this[_0x00f8('0x4')]=_0x2aaa24['serverUrl']||'';this[_0x00f8('0x5')]=_0x2aaa24[_0x00f8('0x5')]||{};}module[_0x00f8('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0x4453=['Configurations','exports','name','username','token','remoteUri','serverUrl'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4453,0x9c));var _0x3445=function(_0x367c8e,_0x3a6502){_0x367c8e=_0x367c8e-0x0;var _0x1c2789=_0x4453[_0x367c8e];return _0x1c2789;};'use strict';function FreshsalesAccount(_0x813dea){this['id']=_0x813dea['id']||0x0;this[_0x3445('0x0')]=_0x813dea['name']||'';this[_0x3445('0x1')]=_0x813dea[_0x3445('0x1')]||'';this['apiKey']=_0x813dea[_0x3445('0x2')]||'';this[_0x3445('0x3')]=_0x813dea[_0x3445('0x3')]||'';this[_0x3445('0x4')]=_0x813dea[_0x3445('0x4')]||'';this[_0x3445('0x5')]=_0x813dea[_0x3445('0x5')]||{};}module[_0x3445('0x6')]=FreshsalesAccount;
\ No newline at end of file
index 1049bec..aa00075 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c03=['queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','accountcode','context','exten','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname'];(function(_0x5c5d02,_0x4021eb){var _0x5e0033=function(_0x2bcf07){while(--_0x2bcf07){_0x5c5d02['push'](_0x5c5d02['shift']());}};_0x5e0033(++_0x4021eb);}(_0x7c03,0x73));var _0x37c0=function(_0x35e265,_0x159498){_0x35e265=_0x35e265-0x0;var _0x13faf4=_0x7c03[_0x35e265];return _0x13faf4;};'use strict';function QueueReport(){this[_0x37c0('0x0')]=_0x37c0('0x1');this[_0x37c0('0x2')]='';this[_0x37c0('0x3')]='';this[_0x37c0('0x4')]='';this[_0x37c0('0x5')]='';this[_0x37c0('0x6')]=null;this[_0x37c0('0x7')]=null;this[_0x37c0('0x8')]=0x1;this['count']=0x1;this[_0x37c0('0x9')]=![];this[_0x37c0('0xa')]=null;this[_0x37c0('0xb')]=![];this[_0x37c0('0xc')]=null;this[_0x37c0('0xd')]=![];this[_0x37c0('0xe')]=null;this['originalposition']=0x1;this['channel']='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x37c0('0xf')]='';this[_0x37c0('0x10')]='';this[_0x37c0('0x11')]='';this['priority']='';this[_0x37c0('0x12')]=0x0;this[_0x37c0('0x13')]=![];this[_0x37c0('0x14')]='';this[_0x37c0('0x15')]=0x0;this[_0x37c0('0x16')]={};}module[_0x37c0('0x17')]=QueueReport;
\ No newline at end of file
+var _0x249b=['lastAssignedTo','mohtime','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context','exten','priority','assigned'];(function(_0x2ef251,_0x3687e5){var _0x5c931b=function(_0x3e1e36){while(--_0x3e1e36){_0x2ef251['push'](_0x2ef251['shift']());}};_0x5c931b(++_0x3687e5);}(_0x249b,0x16a));var _0xb249=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x249b[_0x46aff0];return _0x9d78cf;};'use strict';function QueueReport(){this[_0xb249('0x0')]=_0xb249('0x1');this[_0xb249('0x2')]='';this[_0xb249('0x3')]='';this[_0xb249('0x4')]='';this[_0xb249('0x5')]='';this[_0xb249('0x6')]=null;this[_0xb249('0x7')]=null;this[_0xb249('0x8')]=0x1;this['count']=0x1;this[_0xb249('0x9')]=![];this[_0xb249('0xa')]=null;this[_0xb249('0xb')]=![];this['queuecallercompleteAt']=null;this[_0xb249('0xc')]=![];this[_0xb249('0xd')]=null;this[_0xb249('0xe')]=0x1;this[_0xb249('0xf')]='';this['connectedlinenum']='';this[_0xb249('0x10')]='';this[_0xb249('0x11')]='';this[_0xb249('0x12')]='';this[_0xb249('0x13')]='';this[_0xb249('0x14')]='';this['holdtime']=0x0;this[_0xb249('0x15')]=![];this[_0xb249('0x16')]='';this[_0xb249('0x17')]=0x0;this['variables']={};}module['exports']=QueueReport;
\ No newline at end of file
index 100d2a1..a14754a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae76=['clientSecret','securityToken','type','integrationTab','serverUrl','exports','name','username','remoteUri','password','clientId'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0xae76,0x74));var _0x6ae7=function(_0x51f67c,_0x1977ec){_0x51f67c=_0x51f67c-0x0;var _0x3888c5=_0xae76[_0x51f67c];return _0x3888c5;};'use strict';function SalesforceAccount(_0x1a1b29){this['id']=_0x1a1b29['id']||0x0;this['name']=_0x1a1b29[_0x6ae7('0x0')]||'';this[_0x6ae7('0x1')]=_0x1a1b29['username']||'';this[_0x6ae7('0x2')]=_0x1a1b29[_0x6ae7('0x2')]||'';this[_0x6ae7('0x3')]=_0x1a1b29[_0x6ae7('0x3')]||'';this['clientId']=_0x1a1b29[_0x6ae7('0x4')]||'';this[_0x6ae7('0x5')]=_0x1a1b29[_0x6ae7('0x5')]||'';this[_0x6ae7('0x6')]=_0x1a1b29[_0x6ae7('0x6')]||'';this['type']=_0x1a1b29[_0x6ae7('0x7')]||_0x6ae7('0x8');this[_0x6ae7('0x9')]=_0x1a1b29['serverUrl']||'';this['Configurations']=_0x1a1b29['Configurations']||{};}module[_0x6ae7('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0x11b7=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0xd635bb,_0x4ae093){var _0x6ca6d0=function(_0x50f81d){while(--_0x50f81d){_0xd635bb['push'](_0xd635bb['shift']());}};_0x6ca6d0(++_0x4ae093);}(_0x11b7,0x180));var _0x711b=function(_0x4749bc,_0xd777b9){_0x4749bc=_0x4749bc-0x0;var _0x4b5918=_0x11b7[_0x4749bc];return _0x4b5918;};'use strict';function SalesforceAccount(_0xd847e6){this['id']=_0xd847e6['id']||0x0;this[_0x711b('0x0')]=_0xd847e6['name']||'';this[_0x711b('0x1')]=_0xd847e6[_0x711b('0x1')]||'';this[_0x711b('0x2')]=_0xd847e6['remoteUri']||'';this[_0x711b('0x3')]=_0xd847e6[_0x711b('0x3')]||'';this[_0x711b('0x4')]=_0xd847e6[_0x711b('0x4')]||'';this[_0x711b('0x5')]=_0xd847e6['clientSecret']||'';this[_0x711b('0x6')]=_0xd847e6[_0x711b('0x6')]||'';this[_0x711b('0x7')]=_0xd847e6[_0x711b('0x7')]||_0x711b('0x8');this[_0x711b('0x9')]=_0xd847e6[_0x711b('0x9')]||'';this['Configurations']=_0xd847e6[_0x711b('0xa')]||{};}module[_0x711b('0xb')]=SalesforceAccount;
\ No newline at end of file
index ee0cd9e..fa951a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5c9=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x38730f,_0x3c4a9c){var _0x5e702a=function(_0xcb0b0e){while(--_0xcb0b0e){_0x38730f['push'](_0x38730f['shift']());}};_0x5e702a(++_0x3c4a9c);}(_0xe5c9,0xbb));var _0x9e5c=function(_0x2e1eba,_0x1594ca){_0x2e1eba=_0x2e1eba-0x0;var _0x1c2fe8=_0xe5c9[_0x2e1eba];return _0x1c2fe8;};'use strict';function ServicenowAccount(_0x1edd38){this['id']=_0x1edd38['id']||0x0;this[_0x9e5c('0x0')]=_0x1edd38[_0x9e5c('0x0')]||'';this[_0x9e5c('0x1')]=_0x1edd38[_0x9e5c('0x1')]||'';this[_0x9e5c('0x2')]=_0x1edd38[_0x9e5c('0x2')]||'';this[_0x9e5c('0x3')]=_0x1edd38[_0x9e5c('0x3')]||'';this[_0x9e5c('0x4')]=_0x1edd38['serverUrl']||'';this[_0x9e5c('0x5')]=_0x1edd38[_0x9e5c('0x5')]||{};}module[_0x9e5c('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0xcf34=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0xa65f76,_0x3d8b0c){var _0x527146=function(_0x44a7aa){while(--_0x44a7aa){_0xa65f76['push'](_0xa65f76['shift']());}};_0x527146(++_0x3d8b0c);}(_0xcf34,0x1f2));var _0x4cf3=function(_0x596284,_0x1cd02b){_0x596284=_0x596284-0x0;var _0x5313c6=_0xcf34[_0x596284];return _0x5313c6;};'use strict';function ServicenowAccount(_0x340f88){this['id']=_0x340f88['id']||0x0;this[_0x4cf3('0x0')]=_0x340f88['name']||'';this[_0x4cf3('0x1')]=_0x340f88[_0x4cf3('0x1')]||'';this[_0x4cf3('0x2')]=_0x340f88[_0x4cf3('0x2')]||'';this[_0x4cf3('0x3')]=_0x340f88[_0x4cf3('0x3')]||'';this[_0x4cf3('0x4')]=_0x340f88[_0x4cf3('0x4')]||'';this[_0x4cf3('0x5')]=_0x340f88[_0x4cf3('0x5')]||{};}module[_0x4cf3('0x6')]=ServicenowAccount;
\ No newline at end of file
index 82ecad0..9f630c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa060=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x23e855,_0x3acf30){var _0x406580=function(_0x80a801){while(--_0x80a801){_0x23e855['push'](_0x23e855['shift']());}};_0x406580(++_0x3acf30);}(_0xa060,0x1c5));var _0x0a06=function(_0xb3abe2,_0x195c16){_0xb3abe2=_0xb3abe2-0x0;var _0x120d42=_0xa060[_0xb3abe2];return _0x120d42;};'use strict';function SugarcrmAccount(_0x4a3d63){this['id']=_0x4a3d63['id']||0x0;this[_0x0a06('0x0')]=_0x4a3d63['name']||'';this['username']=_0x4a3d63[_0x0a06('0x1')]||'';this[_0x0a06('0x2')]=_0x4a3d63[_0x0a06('0x2')]||'';this['remoteUri']=_0x4a3d63[_0x0a06('0x3')]||'';this[_0x0a06('0x4')]=_0x4a3d63[_0x0a06('0x4')]||'';this[_0x0a06('0x5')]=_0x4a3d63[_0x0a06('0x5')]||{};}module[_0x0a06('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xfe36=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x4fcebc,_0x1c92da){var _0x1b70a1=function(_0x46d59a){while(--_0x46d59a){_0x4fcebc['push'](_0x4fcebc['shift']());}};_0x1b70a1(++_0x1c92da);}(_0xfe36,0x153));var _0x6fe3=function(_0x4cbbe3,_0x1a8efd){_0x4cbbe3=_0x4cbbe3-0x0;var _0x5c5c26=_0xfe36[_0x4cbbe3];return _0x5c5c26;};'use strict';function SugarcrmAccount(_0x7b3cef){this['id']=_0x7b3cef['id']||0x0;this[_0x6fe3('0x0')]=_0x7b3cef[_0x6fe3('0x0')]||'';this['username']=_0x7b3cef[_0x6fe3('0x1')]||'';this[_0x6fe3('0x2')]=_0x7b3cef[_0x6fe3('0x2')]||'';this[_0x6fe3('0x3')]=_0x7b3cef[_0x6fe3('0x3')]||'';this[_0x6fe3('0x4')]=_0x7b3cef['serverUrl']||'';this[_0x6fe3('0x5')]=_0x7b3cef[_0x6fe3('0x5')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
index 6e6474e..4ef37db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6cb=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x4354ab,_0x576c21){var _0x4d58f1=function(_0x35b72d){while(--_0x35b72d){_0x4354ab['push'](_0x4354ab['shift']());}};_0x4d58f1(++_0x576c21);}(_0xd6cb,0x1cb));var _0xbd6c=function(_0x4b4ce5,_0x573d2d){_0x4b4ce5=_0x4b4ce5-0x0;var _0x6522f3=_0xd6cb[_0x4b4ce5];return _0x6522f3;};'use strict';function Telephone(_0x5618e8){this['id']=_0x5618e8['id']||0x0;this[_0xbd6c('0x0')]=_0x5618e8[_0xbd6c('0x0')]||'';this[_0xbd6c('0x1')]=_0x5618e8[_0xbd6c('0x1')]||'';this[_0xbd6c('0x2')]=_0xbd6c('0x3');this[_0xbd6c('0x4')]=0x0;this[_0xbd6c('0x5')]='unknown';this[_0xbd6c('0x6')]='';}module[_0xbd6c('0x7')]=Telephone;
\ No newline at end of file
+var _0xd732=['unknown','exports','name','state'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xd732,0x18e));var _0x2d73=function(_0x3d4498,_0x3b6416){_0x3d4498=_0x3d4498-0x0;var _0x529459=_0xd732[_0x3d4498];return _0x529459;};'use strict';function Telephone(_0x45bd01){this['id']=_0x45bd01['id']||0x0;this['name']=_0x45bd01[_0x2d73('0x0')]||'';this['accountcode']=_0x45bd01['accountcode']||'';this[_0x2d73('0x1')]=_0x2d73('0x2');this['stateTime']=0x0;this['status']=_0x2d73('0x2');this['address']='';}module[_0x2d73('0x3')]=Telephone;
\ No newline at end of file
index dbc29ca..e2729c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x2706da,_0x488159){var _0x253fad=function(_0x42c7a9){while(--_0x42c7a9){_0x2706da['push'](_0x2706da['shift']());}};_0x253fad(++_0x488159);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
+var _0xb10b=['name','html'];(function(_0x565374,_0x1153ea){var _0xc1ba69=function(_0x1c96c9){while(--_0x1c96c9){_0x565374['push'](_0x565374['shift']());}};_0xc1ba69(++_0x1153ea);}(_0xb10b,0x12a));var _0xbb10=function(_0x7880d2,_0x32e7d6){_0x7880d2=_0x7880d2-0x0;var _0x35ebbe=_0xb10b[_0x7880d2];return _0x35ebbe;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template;
\ No newline at end of file
index a8920d9..6c04dd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x53ff73,_0x205934){var _0x218fdf=function(_0x1cd7e0){while(--_0x1cd7e0){_0x53ff73['push'](_0x53ff73['shift']());}};_0x218fdf(++_0x205934);}(_0x757a,0xde));var _0xa757=function(_0x1d0a90,_0x3735d7){_0x1d0a90=_0x1d0a90-0x0;var _0x3493f4=_0x757a[_0x1d0a90];return _0x3493f4;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger;
\ No newline at end of file
+var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x44caf4,_0x238750){_0x44caf4=_0x44caf4-0x0;var _0x117cad=_0x0b0e[_0x44caf4];return _0x117cad;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger;
\ No newline at end of file
index aa3470a..49a653c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8692=['status','registry','indexOf','split','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown'];(function(_0x47da2d,_0x4431a4){var _0x32d102=function(_0x194dc6){while(--_0x194dc6){_0x47da2d['push'](_0x47da2d['shift']());}};_0x32d102(++_0x4431a4);}(_0x8692,0xb7));var _0x2869=function(_0x398f47,_0x33c917){_0x398f47=_0x398f47-0x0;var _0x246f48=_0x8692[_0x398f47];return _0x246f48;};'use strict';function Trunk(_0xdd5156){this['id']=_0xdd5156['id']||0x0;this[_0x2869('0x0')]=_0xdd5156['active']||![];this['name']=_0xdd5156[_0x2869('0x1')]||'';this[_0x2869('0x2')]=_0x2869('0x3');this['stateTime']=0x0;this[_0x2869('0x4')]='unknown';this['registry']=_0xdd5156[_0x2869('0x5')]&&_0xdd5156[_0x2869('0x5')][_0x2869('0x6')](':')?_0xdd5156[_0x2869('0x5')][_0x2869('0x7')](':')[0x0]:'';this['host']='';this[_0x2869('0x8')]='';this[_0x2869('0x9')]='';this[_0x2869('0xa')]='';this[_0x2869('0xb')]='';this[_0x2869('0xc')]=_0x2869('0x3');this[_0x2869('0xd')]='';this[_0x2869('0xe')]='';this['defaultuser']=_0xdd5156[_0x2869('0xf')]||'';}module[_0x2869('0x10')]=Trunk;
\ No newline at end of file
+var _0x937c=['unknown','stateTime','status','registry','split','host','port','domain','domainport','refresh','registrationtime','address','defaultuser','exports','active','name'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x937c,0x11e));var _0xc937=function(_0x1a886c,_0x449182){_0x1a886c=_0x1a886c-0x0;var _0x571e48=_0x937c[_0x1a886c];return _0x571e48;};'use strict';function Trunk(_0x1d0225){this['id']=_0x1d0225['id']||0x0;this['active']=_0x1d0225[_0xc937('0x0')]||![];this[_0xc937('0x1')]=_0x1d0225[_0xc937('0x1')]||'';this['state']=_0xc937('0x2');this[_0xc937('0x3')]=0x0;this[_0xc937('0x4')]=_0xc937('0x2');this[_0xc937('0x5')]=_0x1d0225[_0xc937('0x5')]&&_0x1d0225[_0xc937('0x5')]['indexOf'](':')?_0x1d0225['registry'][_0xc937('0x6')](':')[0x0]:'';this[_0xc937('0x7')]='';this[_0xc937('0x8')]='';this[_0xc937('0x9')]='';this[_0xc937('0xa')]='';this[_0xc937('0xb')]='';this['stateRegistry']=_0xc937('0x2');this[_0xc937('0xc')]='';this[_0xc937('0xd')]='';this['defaultuser']=_0x1d0225[_0xc937('0xe')]||'';}module[_0xc937('0xf')]=Trunk;
\ No newline at end of file
index feb7190..f43e9f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x490a=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x204072,_0x5427bc){var _0x4bbe2f=function(_0x4a52a6){while(--_0x4a52a6){_0x204072['push'](_0x204072['shift']());}};_0x4bbe2f(++_0x5427bc);}(_0x490a,0xa5));var _0xa490=function(_0x10044f,_0x55c2f5){_0x10044f=_0x10044f-0x0;var _0x153250=_0x490a[_0x10044f];return _0x153250;};'use strict';function voiceExtension(_0x160e6c){this['id']=_0x160e6c['id']||0x0;this[_0xa490('0x0')]=_0x160e6c['exten']||'';this[_0xa490('0x1')]=_0x160e6c[_0xa490('0x1')]||_0xa490('0x2');this[_0xa490('0x3')]=_0x160e6c['mandatoryDisposition']||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x3ce5=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3ce5,0x19a));var _0x53ce=function(_0x68196e,_0x2e32d4){_0x68196e=_0x68196e-0x0;var _0x2ed821=_0x3ce5[_0x68196e];return _0x2ed821;};'use strict';function voiceExtension(_0x419bbc){this['id']=_0x419bbc['id']||0x0;this[_0x53ce('0x0')]=_0x419bbc[_0x53ce('0x0')]||'';this[_0x53ce('0x1')]=_0x419bbc[_0x53ce('0x1')]||_0x53ce('0x2');this['mandatoryDisposition']=_0x419bbc[_0x53ce('0x3')]||![];}module[_0x53ce('0x4')]=voiceExtension;
\ No newline at end of file
index ce48f5d..ebe5ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12b9=['talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','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','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','unavailable','ringing','onhold','wav','wav49','roundrobin','name','monitor_format','type','inbound','waiting'];(function(_0x2ff66d,_0x5219d3){var _0x3a61fc=function(_0x52ac87){while(--_0x52ac87){_0x2ff66d['push'](_0x2ff66d['shift']());}};_0x3a61fc(++_0x5219d3);}(_0x12b9,0xe4));var _0x912b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x12b9[_0x14add3];return _0x4a174f;};'use strict';var statusDesc=['unknown',_0x912b('0x0'),_0x912b('0x1'),_0x912b('0x2'),'invalid',_0x912b('0x3'),_0x912b('0x4'),'ringinuse',_0x912b('0x5')];var monitorFormat={'wav':_0x912b('0x6'),'wav49':_0x912b('0x7'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0x912b('0x8')};function VoiceQueue(_0x2f265e){this['id']=_0x2f265e['id']||0x0;this[_0x912b('0x9')]=_0x2f265e[_0x912b('0x9')]||'';this[_0x912b('0xa')]=_0x2f265e[_0x912b('0xa')]||'';this[_0x912b('0xb')]=_0x2f265e['type']||_0x912b('0xc');this[_0x912b('0xd')]=0x0;this[_0x912b('0xe')]=0x0;this[_0x912b('0xf')]=0x0;this[_0x912b('0x10')]=0x0;this[_0x912b('0x11')]=0x0;this[_0x912b('0x12')]=0x0;this[_0x912b('0x13')]=0x0;this[_0x912b('0x14')]=0x0;this[_0x912b('0x15')]=0x0;this[_0x912b('0x16')]=0x0;this['available']=0x0;this[_0x912b('0x17')]=_0x2f265e[_0x912b('0x17')]||![];this[_0x912b('0x18')]=_0x2f265e[_0x912b('0x18')]||0xa;this[_0x912b('0x19')]=_0x2f265e[_0x912b('0x19')]||'no';this[_0x912b('0x1a')]=!![];this[_0x912b('0x1b')]='';this[_0x912b('0x1c')]=0x0;this[_0x912b('0x1d')]=0x0;this[_0x912b('0x1e')]=_0x2f265e['dialTimezone']||null;this['dialGlobalInterval']=_0x2f265e['dialGlobalInterval']?_0x2f265e[_0x912b('0x1f')]:null;this[_0x912b('0x20')]=_0x2f265e[_0x912b('0x20')];this[_0x912b('0x21')]=_0x2f265e['dialMethod']||_0x912b('0x22');this[_0x912b('0x23')]=_0x2f265e[_0x912b('0x23')]||0x0;this[_0x912b('0x24')]=_0x2f265e[_0x912b('0x24')]||0x0;this[_0x912b('0x25')]=_0x2f265e[_0x912b('0x25')]||0x1;this[_0x912b('0x26')]=_0x2f265e['dialPredictiveOptimization']||_0x912b('0x27');this['dialPredictiveOptimizationPercentage']=_0x2f265e['dialPredictiveOptimizationPercentage']||0.03;this[_0x912b('0x28')]=_0x2f265e['dialPredictiveInterval']||0x258;this[_0x912b('0x29')]=_0x2f265e['dialOriginateCallerIdName']||_0x912b('0x2a');this['dialOriginateCallerIdNumber']=_0x2f265e[_0x912b('0x2b')]||_0x912b('0x2a');this[_0x912b('0x2c')]=_0x2f265e['dialOriginateTimeout']||0x1e;this[_0x912b('0x2d')]=_0x2f265e[_0x912b('0x2d')]||_0x912b('0x2e');this['dialQueueTimeout']=_0x2f265e[_0x912b('0x2f')]||0x3;this[_0x912b('0x30')]=_0x2f265e['dialQueueProject']||undefined;this[_0x912b('0x31')]=_0x2f265e['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x2f265e[_0x912b('0x32')]||0x96;this[_0x912b('0x33')]=_0x2f265e[_0x912b('0x33')]||0x3;this[_0x912b('0x34')]=_0x2f265e['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x2f265e[_0x912b('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x2f265e[_0x912b('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x2f265e[_0x912b('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2f265e[_0x912b('0x38')]||0x96;this['dialDropMaxRetry']=_0x2f265e[_0x912b('0x39')]||0x3;this[_0x912b('0x3a')]=_0x2f265e['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x2f265e[_0x912b('0x3b')]||0x3;this[_0x912b('0x3c')]=_0x2f265e[_0x912b('0x3c')]||0x96;this[_0x912b('0x3d')]=_0x2f265e[_0x912b('0x3d')]||0x3;this[_0x912b('0x3e')]=_0x2f265e[_0x912b('0x3e')]||0x96;this[_0x912b('0x3f')]=_0x2f265e[_0x912b('0x3f')]||0x3;this[_0x912b('0x40')]=_0x2f265e[_0x912b('0x40')]||0x96;this[_0x912b('0x41')]=_0x2f265e[_0x912b('0x41')]||0x3;this['dialGlobalMaxRetry']=_0x2f265e[_0x912b('0x42')]||0x4;this['Trunk']=_0x2f265e[_0x912b('0x43')]?_0x2f265e[_0x912b('0x43')]:undefined;this[_0x912b('0x44')]=_0x2f265e[_0x912b('0x44')]?_0x2f265e[_0x912b('0x44')]:undefined;this['dialPrefix']=_0x2f265e['dialPrefix']||undefined;this[_0x912b('0x45')]=_0x2f265e[_0x912b('0x45')]?_0x2f265e[_0x912b('0x45')]:undefined;this['dialOrderByScheduledAt']=_0x2f265e[_0x912b('0x46')]||'DESC';this[_0x912b('0x47')]=_0x2f265e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x912b('0x48')]=_0x2f265e[_0x912b('0x48')]||undefined;this[_0x912b('0x49')]=strategy[_0x2f265e[_0x912b('0x49')]]||'rrmemory';this[_0x912b('0x4a')]=!![];this[_0x912b('0x4b')]=_0x2f265e[_0x912b('0x4b')]||![];this[_0x912b('0x4c')]=_0x2f265e[_0x912b('0x4c')];this['dialAMDGreeting']=_0x2f265e['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x2f265e[_0x912b('0x4d')];this['dialAMDTotalAnalysisTime']=_0x2f265e[_0x912b('0x4e')];this[_0x912b('0x4f')]=_0x2f265e[_0x912b('0x4f')];this[_0x912b('0x50')]=_0x2f265e['dialAMDBetweenWordsSilence'];this[_0x912b('0x51')]=_0x2f265e[_0x912b('0x51')];this[_0x912b('0x52')]=_0x2f265e[_0x912b('0x52')];this['dialAMDMaximumWordLength']=_0x2f265e[_0x912b('0x53')];this[_0x912b('0x54')]=0x0;this[_0x912b('0x55')]=0x0;this[_0x912b('0x56')]=_0x2f265e[_0x912b('0x56')];this[_0x912b('0x57')]=0x0;this[_0x912b('0x58')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x912b('0x59')]=0x0;this[_0x912b('0x5a')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x912b('0x5b')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x912b('0x5c')]=0x0;this[_0x912b('0x5d')]=0x0;this[_0x912b('0x5e')]=0x0;this[_0x912b('0x5f')]=0x0;this[_0x912b('0x60')]=0x0;this[_0x912b('0x61')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x912b('0x62')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x912b('0x63')]=0x0;this[_0x912b('0x64')]=0x0;this[_0x912b('0x65')]=0x0;this[_0x912b('0x66')]=0x0;this[_0x912b('0x67')]=0x0;this[_0x912b('0x68')]=0x0;this[_0x912b('0x69')]=0x0;this[_0x912b('0x6a')]=_0x2f265e[_0x912b('0x6b')]||0x14;this[_0x912b('0x6c')]=_0x2f265e[_0x912b('0x6b')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x912b('0x6d')]=0x1;this[_0x912b('0x6e')]=0x0;this[_0x912b('0x6f')]=0x0;this[_0x912b('0x70')]=0x0;this[_0x912b('0x71')]=0x0;this[_0x912b('0x72')]=_0x2f265e[_0x912b('0x72')]||0x1e;this[_0x912b('0x73')]=_0x2f265e[_0x912b('0x73')]||![];this['dialQueueProject2']=_0x2f265e[_0x912b('0x74')]||undefined;this['dialAgiAfterHangupClient']=_0x2f265e['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x2f265e[_0x912b('0x75')]||![];this[_0x912b('0xa')]=monitorFormat[_0x2f265e['monitor_format']]?monitorFormat[_0x2f265e[_0x912b('0xa')]]:undefined;this[_0x912b('0x76')]=_0x2f265e[_0x912b('0x76')]||![];this[_0x912b('0x77')]=_0x2f265e[_0x912b('0x77')]?_0x2f265e[_0x912b('0x77')]:undefined;}module[_0x912b('0x78')]=VoiceQueue;
\ No newline at end of file
+var _0x347d=['predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','available','acw','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable'];(function(_0x51a214,_0x275581){var _0x40e771=function(_0x4fceb6){while(--_0x4fceb6){_0x51a214['push'](_0x51a214['shift']());}};_0x40e771(++_0x275581);}(_0x347d,0x1ec));var _0xd347=function(_0xeced0d,_0x33c430){_0xeced0d=_0xeced0d-0x0;var _0x4379bb=_0x347d[_0xeced0d];return _0x4379bb;};'use strict';var statusDesc=[_0xd347('0x0'),_0xd347('0x1'),_0xd347('0x2'),_0xd347('0x3'),_0xd347('0x4'),_0xd347('0x5'),'ringing',_0xd347('0x6'),_0xd347('0x7')];var monitorFormat={'wav':_0xd347('0x8'),'wav49':_0xd347('0x9'),'gsm':_0xd347('0xa')};var strategy={'rrmemory':_0xd347('0xb'),'roundrobin':_0xd347('0xc')};function VoiceQueue(_0x56ca9a){this['id']=_0x56ca9a['id']||0x0;this[_0xd347('0xd')]=_0x56ca9a[_0xd347('0xd')]||'';this[_0xd347('0xe')]=_0x56ca9a[_0xd347('0xe')]||'';this[_0xd347('0xf')]=_0x56ca9a[_0xd347('0xf')]||_0xd347('0x10');this['waiting']=0x0;this[_0xd347('0x11')]=0x0;this[_0xd347('0x12')]=0x0;this['answered']=0x0;this[_0xd347('0x13')]=0x0;this[_0xd347('0x14')]=0x0;this[_0xd347('0x15')]=0x0;this[_0xd347('0x16')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0xd347('0x17')]=0x0;this[_0xd347('0x18')]=_0x56ca9a[_0xd347('0x18')]||![];this['acwTimeout']=_0x56ca9a['acwTimeout']||0xa;this[_0xd347('0x19')]=_0x56ca9a['autopause']||'no';this[_0xd347('0x1a')]=!![];this[_0xd347('0x1b')]='';this[_0xd347('0x1c')]=0x0;this[_0xd347('0x1d')]=0x0;this[_0xd347('0x1e')]=_0x56ca9a[_0xd347('0x1e')]||null;this[_0xd347('0x1f')]=_0x56ca9a[_0xd347('0x1f')]?_0x56ca9a[_0xd347('0x1f')]:null;this[_0xd347('0x20')]=_0x56ca9a[_0xd347('0x20')];this[_0xd347('0x21')]=_0x56ca9a[_0xd347('0x21')]||_0xd347('0x22');this['dialLimitChannel']=_0x56ca9a[_0xd347('0x23')]||0x0;this[_0xd347('0x24')]=_0x56ca9a['dialLimitQueue']||0x0;this[_0xd347('0x25')]=_0x56ca9a[_0xd347('0x25')]||0x1;this['dialPredictiveOptimization']=_0x56ca9a[_0xd347('0x26')]||'dropRate';this[_0xd347('0x27')]=_0x56ca9a[_0xd347('0x27')]||0.03;this[_0xd347('0x28')]=_0x56ca9a[_0xd347('0x28')]||0x258;this[_0xd347('0x29')]=_0x56ca9a[_0xd347('0x29')]||_0xd347('0x2a');this['dialOriginateCallerIdNumber']=_0x56ca9a[_0xd347('0x2b')]||_0xd347('0x2a');this[_0xd347('0x2c')]=_0x56ca9a[_0xd347('0x2c')]||0x1e;this[_0xd347('0x2d')]=_0x56ca9a[_0xd347('0x2d')]||'tTxX';this['dialQueueTimeout']=_0x56ca9a[_0xd347('0x2e')]||0x3;this['dialQueueProject']=_0x56ca9a[_0xd347('0x2f')]||undefined;this[_0xd347('0x30')]=_0x56ca9a['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x56ca9a['dialCongestionRetryFrequency']||0x96;this[_0xd347('0x31')]=_0x56ca9a[_0xd347('0x31')]||0x3;this[_0xd347('0x32')]=_0x56ca9a['dialBusyRetryFrequency']||0x96;this[_0xd347('0x33')]=_0x56ca9a['dialNoAnswerMaxRetry']||0x3;this[_0xd347('0x34')]=_0x56ca9a['dialNoAnswerRetryFrequency']||0x96;this[_0xd347('0x35')]=_0x56ca9a[_0xd347('0x35')]||0x3;this[_0xd347('0x36')]=_0x56ca9a[_0xd347('0x36')]||0x96;this[_0xd347('0x37')]=_0x56ca9a[_0xd347('0x37')]||0x3;this[_0xd347('0x38')]=_0x56ca9a[_0xd347('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x56ca9a[_0xd347('0x39')]||0x3;this[_0xd347('0x3a')]=_0x56ca9a[_0xd347('0x3a')]||0x96;this[_0xd347('0x3b')]=_0x56ca9a['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x56ca9a[_0xd347('0x3c')]||0x96;this['dialAgentRejectMaxRetry']=_0x56ca9a['dialAgentRejectMaxRetry']||0x3;this[_0xd347('0x3d')]=_0x56ca9a[_0xd347('0x3d')]||0x96;this['callAdditionalPhoneAfterMin']=_0x56ca9a['callAdditionalPhoneAfterMin']||0x3;this[_0xd347('0x3e')]=_0x56ca9a[_0xd347('0x3e')]||0x4;this[_0xd347('0x3f')]=_0x56ca9a[_0xd347('0x3f')]?_0x56ca9a[_0xd347('0x3f')]:undefined;this[_0xd347('0x40')]=_0x56ca9a[_0xd347('0x40')]?_0x56ca9a[_0xd347('0x40')]:undefined;this[_0xd347('0x41')]=_0x56ca9a[_0xd347('0x41')]||undefined;this['Interval']=_0x56ca9a[_0xd347('0x42')]?_0x56ca9a['Interval']:undefined;this[_0xd347('0x43')]=_0x56ca9a['dialOrderByScheduledAt']||_0xd347('0x44');this[_0xd347('0x45')]=_0x56ca9a[_0xd347('0x45')]||undefined;this[_0xd347('0x46')]=_0x56ca9a['dialCutDigit']||undefined;this[_0xd347('0x47')]=strategy[_0x56ca9a[_0xd347('0x47')]]||'rrmemory';this[_0xd347('0x48')]=!![];this['dialAMDActive']=_0x56ca9a[_0xd347('0x49')]||![];this[_0xd347('0x4a')]=_0x56ca9a[_0xd347('0x4a')];this[_0xd347('0x4b')]=_0x56ca9a[_0xd347('0x4b')];this[_0xd347('0x4c')]=_0x56ca9a[_0xd347('0x4c')];this[_0xd347('0x4d')]=_0x56ca9a[_0xd347('0x4d')];this[_0xd347('0x4e')]=_0x56ca9a[_0xd347('0x4e')];this[_0xd347('0x4f')]=_0x56ca9a['dialAMDBetweenWordsSilence'];this[_0xd347('0x50')]=_0x56ca9a[_0xd347('0x50')];this[_0xd347('0x51')]=_0x56ca9a[_0xd347('0x51')];this[_0xd347('0x52')]=_0x56ca9a[_0xd347('0x52')];this['outboundRejectCallsDay']=0x0;this[_0xd347('0x53')]=0x0;this[_0xd347('0x54')]=_0x56ca9a[_0xd347('0x54')];this[_0xd347('0x55')]=0x0;this[_0xd347('0x56')]=0x0;this[_0xd347('0x57')]=0x0;this[_0xd347('0x58')]=0x0;this[_0xd347('0x59')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xd347('0x5a')]=0x0;this[_0xd347('0x5b')]=0x0;this[_0xd347('0x5c')]=0x0;this[_0xd347('0x5d')]=0x0;this[_0xd347('0x5e')]=0x0;this[_0xd347('0x5f')]=0x0;this[_0xd347('0x60')]=0x0;this['startProgressive']=undefined;this[_0xd347('0x61')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xd347('0x62')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xd347('0x63')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xd347('0x64')]=0x0;this[_0xd347('0x65')]=0x0;this[_0xd347('0x66')]=0x0;this[_0xd347('0x67')]=_0x56ca9a[_0xd347('0x68')]||0x14;this[_0xd347('0x69')]=_0x56ca9a[_0xd347('0x68')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xd347('0x6a')]=0x0;this[_0xd347('0x6b')]=0x1;this[_0xd347('0x6c')]=0x0;this['erlangCallToSecond']=0x0;this[_0xd347('0x6d')]=0x0;this[_0xd347('0x6e')]=0x0;this[_0xd347('0x6f')]=_0x56ca9a['dialRecallMeTimeout']||0x1e;this[_0xd347('0x70')]=_0x56ca9a[_0xd347('0x70')]||![];this[_0xd347('0x71')]=_0x56ca9a[_0xd347('0x71')]||undefined;this['dialAgiAfterHangupClient']=_0x56ca9a[_0xd347('0x72')]||![];this[_0xd347('0x73')]=_0x56ca9a[_0xd347('0x73')]||![];this['monitor_format']=monitorFormat[_0x56ca9a[_0xd347('0xe')]]?monitorFormat[_0x56ca9a['monitor_format']]:undefined;this[_0xd347('0x74')]=_0x56ca9a[_0xd347('0x74')]||![];this[_0xd347('0x75')]=_0x56ca9a[_0xd347('0x75')]?_0x56ca9a[_0xd347('0x75')]:undefined;}module[_0xd347('0x76')]=VoiceQueue;
\ No newline at end of file
index c9fdbe4..7668604 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b90=['username','accessKey','remoteUri','Configurations','name'];(function(_0x1f0dfb,_0xc92ba4){var _0x301707=function(_0x48cf6b){while(--_0x48cf6b){_0x1f0dfb['push'](_0x1f0dfb['shift']());}};_0x301707(++_0xc92ba4);}(_0x1b90,0x185));var _0x01b9=function(_0x402b24,_0x4c9387){_0x402b24=_0x402b24-0x0;var _0x1772a2=_0x1b90[_0x402b24];return _0x1772a2;};'use strict';function VtigerAccount(_0x2e6edc){this['id']=_0x2e6edc['id']||0x0;this[_0x01b9('0x0')]=_0x2e6edc['name']||'';this[_0x01b9('0x1')]=_0x2e6edc[_0x01b9('0x1')]||'';this[_0x01b9('0x2')]=_0x2e6edc[_0x01b9('0x2')]||'';this['remoteUri']=_0x2e6edc[_0x01b9('0x3')]||'';this['serverUrl']=_0x2e6edc['serverUrl']||'';this[_0x01b9('0x4')]=_0x2e6edc[_0x01b9('0x4')]||{};}module['exports']=VtigerAccount;
\ No newline at end of file
+var _0x9089=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x9089,0x149));var _0x9908=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x9089[_0x267c52];return _0x46c47b;};'use strict';function VtigerAccount(_0x1bceff){this['id']=_0x1bceff['id']||0x0;this['name']=_0x1bceff[_0x9908('0x0')]||'';this[_0x9908('0x1')]=_0x1bceff[_0x9908('0x1')]||'';this[_0x9908('0x2')]=_0x1bceff['accessKey']||'';this[_0x9908('0x3')]=_0x1bceff['remoteUri']||'';this['serverUrl']=_0x1bceff[_0x9908('0x4')]||'';this[_0x9908('0x5')]=_0x1bceff[_0x9908('0x5')]||{};}module[_0x9908('0x6')]=VtigerAccount;
\ No newline at end of file
index f2b8bcf..6cd870a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2857=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x1086bf,_0x3a3f38){var _0x4049dd=function(_0x13b4f8){while(--_0x13b4f8){_0x1086bf['push'](_0x1086bf['shift']());}};_0x4049dd(++_0x3a3f38);}(_0x2857,0x9e));var _0x7285=function(_0x454dc1,_0x441e0e){_0x454dc1=_0x454dc1-0x0;var _0x12a656=_0x2857[_0x454dc1];return _0x12a656;};'use strict';function ZendeskAccount(_0x923e3f){this['id']=_0x923e3f['id']||0x0;this[_0x7285('0x0')]=_0x923e3f['name']||'';this[_0x7285('0x1')]=_0x923e3f[_0x7285('0x1')]||'';this[_0x7285('0x2')]=_0x923e3f[_0x7285('0x2')]||'';this[_0x7285('0x3')]=_0x923e3f['token']||'';this['remoteUri']=_0x923e3f['remoteUri']||'';this['authType']=_0x923e3f['authType']||'';this[_0x7285('0x4')]=_0x923e3f['type']||_0x7285('0x5');this[_0x7285('0x6')]=_0x923e3f[_0x7285('0x6')]||'';this[_0x7285('0x7')]=_0x923e3f[_0x7285('0x7')]||{};}module[_0x7285('0x8')]=ZendeskAccount;
\ No newline at end of file
+var _0xc900=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x10165c,_0x5ad2b4){var _0x454073=function(_0x3ca33c){while(--_0x3ca33c){_0x10165c['push'](_0x10165c['shift']());}};_0x454073(++_0x5ad2b4);}(_0xc900,0x11a));var _0x0c90=function(_0x52e5a3,_0x540a32){_0x52e5a3=_0x52e5a3-0x0;var _0x139f5e=_0xc900[_0x52e5a3];return _0x139f5e;};'use strict';function ZendeskAccount(_0x5cf0ac){this['id']=_0x5cf0ac['id']||0x0;this[_0x0c90('0x0')]=_0x5cf0ac[_0x0c90('0x0')]||'';this[_0x0c90('0x1')]=_0x5cf0ac[_0x0c90('0x1')]||'';this['password']=_0x5cf0ac[_0x0c90('0x2')]||'';this[_0x0c90('0x3')]=_0x5cf0ac[_0x0c90('0x3')]||'';this[_0x0c90('0x4')]=_0x5cf0ac[_0x0c90('0x4')]||'';this['authType']=_0x5cf0ac[_0x0c90('0x5')]||'';this['type']=_0x5cf0ac[_0x0c90('0x6')]||_0x0c90('0x7');this[_0x0c90('0x8')]=_0x5cf0ac[_0x0c90('0x8')]||'';this[_0x0c90('0x9')]=_0x5cf0ac[_0x0c90('0x9')]||{};}module[_0x0c90('0xa')]=ZendeskAccount;
\ No newline at end of file
index c572284..d8d4fd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26ad=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x26ad,0x16d));var _0xd26a=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x26ad[_0x2a8c21];return _0x5f3061;};'use strict';function ZohoAccount(_0xdb23fd){this['id']=_0xdb23fd['id']||0x0;this[_0xd26a('0x0')]=_0xdb23fd[_0xd26a('0x0')]||'';this[_0xd26a('0x1')]=_0xdb23fd[_0xd26a('0x1')]||'';this['host']=_0xdb23fd[_0xd26a('0x2')]||'';this[_0xd26a('0x3')]=_0xdb23fd[_0xd26a('0x3')]||'';this[_0xd26a('0x4')]=_0xdb23fd[_0xd26a('0x4')]||'';this[_0xd26a('0x5')]=_0xdb23fd[_0xd26a('0x5')]||'';this[_0xd26a('0x6')]=_0xdb23fd['serverUrl']||'';this['code']=_0xdb23fd[_0xd26a('0x7')]||'';this[_0xd26a('0x8')]=_0xdb23fd[_0xd26a('0x8')]||'';this[_0xd26a('0x9')]=_0xdb23fd['Configurations']||{};}module[_0xd26a('0xa')]=ZohoAccount;
\ No newline at end of file
+var _0xa46d=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0xe5530b,_0x4477ea){var _0x549c66=function(_0x495293){while(--_0x495293){_0xe5530b['push'](_0xe5530b['shift']());}};_0x549c66(++_0x4477ea);}(_0xa46d,0xd4));var _0xda46=function(_0x34c527,_0x7796ab){_0x34c527=_0x34c527-0x0;var _0x555dfc=_0xa46d[_0x34c527];return _0x555dfc;};'use strict';function ZohoAccount(_0x1edee9){this['id']=_0x1edee9['id']||0x0;this['name']=_0x1edee9[_0xda46('0x0')]||'';this[_0xda46('0x1')]=_0x1edee9[_0xda46('0x1')]||'';this[_0xda46('0x2')]=_0x1edee9['host']||'';this['zone']=_0x1edee9[_0xda46('0x3')]||'';this['clientId']=_0x1edee9[_0xda46('0x4')]||'';this[_0xda46('0x5')]=_0x1edee9[_0xda46('0x5')]||'';this[_0xda46('0x6')]=_0x1edee9[_0xda46('0x6')]||'';this[_0xda46('0x7')]=_0x1edee9[_0xda46('0x7')]||'';this[_0xda46('0x8')]=_0x1edee9[_0xda46('0x8')]||'';this[_0xda46('0x9')]=_0x1edee9['Configurations']||{};}module[_0xda46('0xa')]=ZohoAccount;
\ No newline at end of file
index 12fc9ae..2c27daa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf2f=['lodash','moment','isNil','string','uniqueid','idContact','queue','name','dialAnswer','Agent','format','SIP/%s','membername','calleridname','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util'];(function(_0x45556d,_0x25e55d){var _0x6a3aa3=function(_0x2ead8d){while(--_0x2ead8d){_0x45556d['push'](_0x45556d['shift']());}};_0x6a3aa3(++_0x25e55d);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x2a022d,_0x382556){_0x2a022d=_0x2a022d-0x0;var _0x21333d=_0xcf2f[_0x2a022d];return _0x21333d;};'use strict';var util=require(_0xfcf2('0x0'));var _=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));function checkNameSurname(_0x3165cf,_0x343fc4,_0x5637be){var _0x16c210='';if(!_[_0xfcf2('0x3')](_0x343fc4)&&_0xfcf2('0x4')===typeof _0x343fc4){_0x16c210+=_0x343fc4;}if(!_[_0xfcf2('0x3')](_0x5637be)&&_0xfcf2('0x4')===typeof _0x5637be){_0x16c210+='\x20'+_0x5637be;}if(_0x16c210!==''){return _0x16c210;}return _0x3165cf;}function Action(_0x167a77,_0x1e6d99,_0x3a4950,_0x41d4bd,_0x157f48){this[_0xfcf2('0x5')]=_0x3a4950||undefined;this[_0xfcf2('0x6')]=_0x167a77['id'];this[_0xfcf2('0x7')]=_0x1e6d99[_0xfcf2('0x8')];this['type']=_0x1e6d99['type'];this['campaigntype']=_0xfcf2('0x7');this[_0xfcf2('0x9')]=![];this['membername']=_[_0xfcf2('0x3')](_0x167a77[_0xfcf2('0xa')])?undefined:_0x167a77[_0xfcf2('0xa')][_0xfcf2('0x8')];this['channelAgent']=this['membername']?util[_0xfcf2('0xb')](_0xfcf2('0xc'),this[_0xfcf2('0xd')]):_0x41d4bd||undefined;this[_0xfcf2('0xe')]=checkNameSurname(_0x167a77['Contact'][_0xfcf2('0xf')],_0x167a77['Contact']['firstName'],_0x167a77['Contact'][_0xfcf2('0x10')]);this['active']=_0x167a77[_0xfcf2('0x11')]||![];this[_0xfcf2('0x12')]=_0x167a77[_0xfcf2('0xf')];this[_0xfcf2('0x13')]=_0x167a77[_0xfcf2('0x13')];this[_0xfcf2('0x14')]=_0x167a77[_0xfcf2('0x14')]||0x0;this['countcongestionretry']=_0x167a77[_0xfcf2('0x15')]||0x0;this[_0xfcf2('0x16')]=_0x167a77[_0xfcf2('0x16')]||0x0;this['countglobal']=(_0x167a77[_0xfcf2('0x14')]||0x0)+(_0x167a77[_0xfcf2('0x15')]||0x0)+(_0x167a77[_0xfcf2('0x16')]||0x0)+(_0x167a77[_0xfcf2('0x17')]||0x0)+(_0x167a77[_0xfcf2('0x18')]||0x0)+(_0x167a77['countabandonedretry']||0x0)+(_0x167a77[_0xfcf2('0x19')]||0x0)+(_0x167a77[_0xfcf2('0x1a')]||0x0);this['countnosuchnumberretry']=_0x167a77[_0xfcf2('0x17')]||0x0;this[_0xfcf2('0x18')]=_0x167a77[_0xfcf2('0x18')]||0x0;this[_0xfcf2('0x1b')]=_0x167a77[_0xfcf2('0x1b')]||0x0;this[_0xfcf2('0x19')]=_0x167a77[_0xfcf2('0x19')]||0x0;this[_0xfcf2('0x1a')]=_0x167a77[_0xfcf2('0x1a')]||0x0;this['callback']=_0x167a77[_0xfcf2('0x1c')];this[_0xfcf2('0x1d')]=_0x167a77[_0xfcf2('0x1d')];this['callbackat']=_0x167a77[_0xfcf2('0x1e')];this[_0xfcf2('0x1f')]=_0x167a77['recallme'];this[_0xfcf2('0x20')]=_0x167a77[_0xfcf2('0x20')];this['ListId']=_0x167a77[_0xfcf2('0x21')];this[_0xfcf2('0x22')]=_[_0xfcf2('0x3')](_0x167a77[_0xfcf2('0xa')])?_0x167a77['UserId']:_0x167a77[_0xfcf2('0xa')]['id'];this[_0xfcf2('0x23')]=_0x167a77[_0xfcf2('0x23')];this[_0xfcf2('0x24')]='';this[_0xfcf2('0x25')]='';}Action[_0xfcf2('0x26')][_0xfcf2('0x27')]=function(){return util[_0xfcf2('0xb')](_0xfcf2('0x28'),this['calleridname'],this['number']);};module[_0xfcf2('0x29')]=Action;
\ No newline at end of file
+var _0x3d04=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','dialAnswer','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry'];(function(_0x2734cf,_0x2cce97){var _0xc230b7=function(_0x7a5400){while(--_0x7a5400){_0x2734cf['push'](_0x2734cf['shift']());}};_0xc230b7(++_0x2cce97);}(_0x3d04,0xbe));var _0x43d0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3d04[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0x43d0('0x0'));var _=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));function checkNameSurname(_0x105c73,_0x191de5,_0x143fea){var _0x3d6e62='';if(!_[_0x43d0('0x3')](_0x191de5)&&'string'===typeof _0x191de5){_0x3d6e62+=_0x191de5;}if(!_[_0x43d0('0x3')](_0x143fea)&&_0x43d0('0x4')===typeof _0x143fea){_0x3d6e62+='\x20'+_0x143fea;}if(_0x3d6e62!==''){return _0x3d6e62;}return _0x105c73;}function Action(_0x746f5e,_0x617bf,_0x5e284f,_0x484271,_0x50919e){this['uniqueid']=_0x5e284f||undefined;this[_0x43d0('0x5')]=_0x746f5e['id'];this[_0x43d0('0x6')]=_0x617bf[_0x43d0('0x7')];this[_0x43d0('0x8')]=_0x617bf[_0x43d0('0x8')];this['campaigntype']='queue';this[_0x43d0('0x9')]=![];this['membername']=_['isNil'](_0x746f5e[_0x43d0('0xa')])?undefined:_0x746f5e[_0x43d0('0xa')][_0x43d0('0x7')];this[_0x43d0('0xb')]=this['membername']?util[_0x43d0('0xc')](_0x43d0('0xd'),this['membername']):_0x484271||undefined;this[_0x43d0('0xe')]=checkNameSurname(_0x746f5e[_0x43d0('0xf')][_0x43d0('0x10')],_0x746f5e['Contact'][_0x43d0('0x11')],_0x746f5e[_0x43d0('0xf')][_0x43d0('0x12')]);this['active']=_0x746f5e[_0x43d0('0x13')]||![];this[_0x43d0('0x14')]=_0x746f5e[_0x43d0('0x10')];this[_0x43d0('0x15')]=_0x746f5e[_0x43d0('0x15')];this['countbusyretry']=_0x746f5e['countbusyretry']||0x0;this[_0x43d0('0x16')]=_0x746f5e[_0x43d0('0x16')]||0x0;this[_0x43d0('0x17')]=_0x746f5e['countnoanswerretry']||0x0;this[_0x43d0('0x18')]=(_0x746f5e['countbusyretry']||0x0)+(_0x746f5e[_0x43d0('0x16')]||0x0)+(_0x746f5e[_0x43d0('0x17')]||0x0)+(_0x746f5e[_0x43d0('0x19')]||0x0)+(_0x746f5e['countdropretry']||0x0)+(_0x746f5e[_0x43d0('0x1a')]||0x0)+(_0x746f5e[_0x43d0('0x1b')]||0x0)+(_0x746f5e['countagentrejectretry']||0x0);this[_0x43d0('0x19')]=_0x746f5e[_0x43d0('0x19')]||0x0;this[_0x43d0('0x1c')]=_0x746f5e[_0x43d0('0x1c')]||0x0;this[_0x43d0('0x1a')]=_0x746f5e[_0x43d0('0x1a')]||0x0;this[_0x43d0('0x1b')]=_0x746f5e[_0x43d0('0x1b')]||0x0;this[_0x43d0('0x1d')]=_0x746f5e[_0x43d0('0x1d')]||0x0;this[_0x43d0('0x1e')]=_0x746f5e[_0x43d0('0x1e')];this[_0x43d0('0x1f')]=_0x746f5e[_0x43d0('0x1f')];this[_0x43d0('0x20')]=_0x746f5e['callbackat'];this[_0x43d0('0x21')]=_0x746f5e[_0x43d0('0x21')];this['ContactId']=_0x746f5e[_0x43d0('0x22')];this['ListId']=_0x746f5e[_0x43d0('0x23')];this[_0x43d0('0x24')]=_['isNil'](_0x746f5e[_0x43d0('0xa')])?_0x746f5e[_0x43d0('0x24')]:_0x746f5e['Agent']['id'];this[_0x43d0('0x25')]=_0x746f5e[_0x43d0('0x25')];this[_0x43d0('0x26')]='';this['originatecalleridname']='';}Action[_0x43d0('0x27')][_0x43d0('0x28')]=function(){return util[_0x43d0('0xc')](_0x43d0('0x29'),this[_0x43d0('0xe')],this[_0x43d0('0x2a')]);};module[_0x43d0('0x2b')]=Action;
\ No newline at end of file
index e535ed8..8499e98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48a0=['predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','md5','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','originated','NOT_ACTIVE','\x20is\x20not\x20active','IS_DISACTIVED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','booked','dialActive','setMessage','recallMe','clearZombieChannel','enqueue','Queue','queue','originated:\x20','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','Action','status','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','clearZombieChannels','size','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','busy','cloneAction','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','swapAdditionalPhones','NOANSWER','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','dialAnswer','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','trunks','SIP/%s','reachable','unmonitored','unlock','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','dialPrefix','trim','dialCutDigit','substring','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','addVariables','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:agentconnect','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','lookAgent','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','callProgressDetectingCustomer','dialQueueProject','channelstate','transfer','unlockContact','[syncHangup][talking][cause]','syncDialEnd','destuniqueid','addVariable','variables','keys','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','uuid','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','localhost','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','total','type','unmanaged','abandoned','loggedInDb','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls'];(function(_0x141b55,_0x957882){var _0x375591=function(_0x11f9dd){while(--_0x11f9dd){_0x141b55['push'](_0x141b55['shift']());}};_0x375591(++_0x957882);}(_0x48a0,0x112));var _0x048a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x48a0[_0x57b54c];return _0x59cc19;};'use strict';var util=require('util');var _=require(_0x048a('0x0'));var BPromise=require(_0x048a('0x1'));var uuid=require(_0x048a('0x2'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x048a('0x3'));var config=require(_0x048a('0x4'));var logger=require(_0x048a('0x5'))(_0x048a('0x6'));var loggerAction=require(_0x048a('0x5'))(_0x048a('0x7'));var ami=require(_0x048a('0x8'));var rpcDb=require(_0x048a('0x9'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x048a('0xa'));var ut=require(_0x048a('0xb'));config[_0x048a('0xc')]=_['defaults'](config[_0x048a('0xc')],{'host':_0x048a('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x048a('0xc')]));var Sequence=function(){};Sequence[_0x048a('0xe')]['enqueue']=function(_0x8f8e86){this[_0x048a('0xf')]=this['tail']?this[_0x048a('0xf')][_0x048a('0x10')](_0x8f8e86):_0x8f8e86();};function Preview(_0x363856){this[_0x048a('0x11')]=new Sequence();this[_0x048a('0x12')]=_0x363856[_0x048a('0x13')];this['trunks']=_0x363856['trunks'];this[_0x048a('0x14')]={};this[_0x048a('0x15')]=_0x363856[_0x048a('0x15')];this[_0x048a('0x16')]=0x0;ami['on']('originateresponse',this[_0x048a('0x17')][_0x048a('0x18')](this));ami['on'](_0x048a('0x19'),this['syncHangup'][_0x048a('0x18')](this));ami['on'](_0x048a('0x1a'),this[_0x048a('0x1b')][_0x048a('0x18')](this));ami['on'](_0x048a('0x1c'),this['syncDialEnd'][_0x048a('0x18')](this));ami['on']('newexten',this[_0x048a('0x1d')]['bind'](this));ami['on'](_0x048a('0x1e'),this[_0x048a('0x1f')][_0x048a('0x18')](this));ami['on'](_0x048a('0x20'),this[_0x048a('0x21')][_0x048a('0x18')](this));ami['on'](_0x048a('0x22'),this['syncBlindTransfer'][_0x048a('0x18')](this));this[_0x048a('0x23')](this[_0x048a('0x12')]);}function emit(_0x180c8d,_0x1c79d9,_0x3d847e){io['to'](_0x180c8d)[_0x048a('0x24')](_0x1c79d9,_0x3d847e);}function emitCampaignPreview(_0x1e6e43){if(_0x1e6e43['type']===_0x048a('0x25')){var _0x3dd3e9={'id':_0x1e6e43['id'],'name':_0x1e6e43[_0x048a('0x26')],'strategy':_0x1e6e43[_0x048a('0x27')],'answered':_0x1e6e43[_0x048a('0x28')],'available':_0x1e6e43[_0x048a('0x29')],'loggedIn':_0x1e6e43[_0x048a('0x2a')],'pTalking':_0x1e6e43[_0x048a('0x2b')],'sumBillable':_0x1e6e43[_0x048a('0x2c')],'sumDuration':_0x1e6e43['sumDuration'],'sumHoldTime':_0x1e6e43['sumHoldTime']||0x0,'talking':_0x1e6e43['talking'],'total':_0x1e6e43[_0x048a('0x2d')],'type':_0x1e6e43[_0x048a('0x2e')],'unmanaged':_0x1e6e43[_0x048a('0x2f')],'abandoned':_0x1e6e43[_0x048a('0x30')],'waiting':_0x1e6e43['waiting'],'loggedInDb':_0x1e6e43[_0x048a('0x31')],'dialActive':_0x1e6e43['dialActive'],'dialMethod':_0x1e6e43['dialMethod'],'dialOriginateCallerIdName':_0x1e6e43[_0x048a('0x32')],'dialOriginateCallerIdNumber':_0x1e6e43[_0x048a('0x33')],'dialOriginateTimeout':_0x1e6e43['dialOriginateTimeout'],'dialPrefix':_0x1e6e43['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1e6e43[_0x048a('0x34')],'outboundAnswerCallsDay':_0x1e6e43['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1e6e43[_0x048a('0x35')],'outboundBusyCallsDay':_0x1e6e43[_0x048a('0x36')],'outboundCongestionCallsDay':_0x1e6e43[_0x048a('0x37')],'outboundDropCallsDayACS':_0x1e6e43[_0x048a('0x38')],'outboundDropCallsDayCallersExit':_0x1e6e43[_0x048a('0x39')],'outboundDropCallsDayTimeout':_0x1e6e43[_0x048a('0x3a')],'outboundNoAnswerCallsDay':_0x1e6e43[_0x048a('0x3b')],'outboundNoSuchCallsDay':_0x1e6e43[_0x048a('0x3c')],'outboundOriginateFailureCallsDay':_0x1e6e43[_0x048a('0x3d')],'outboundReCallsDay':_0x1e6e43[_0x048a('0x3e')],'outboundRejectCallsDay':_0x1e6e43[_0x048a('0x3f')],'outboundUnknownCallsDay':_0x1e6e43[_0x048a('0x40')],'outboundAbandonedCallsDay':_0x1e6e43[_0x048a('0x41')],'predictiveIntervalAnsweredCalls':_0x1e6e43[_0x048a('0x42')],'predictiveIntervalAvgHoldtime':_0x1e6e43[_0x048a('0x43')],'predictiveIntervalAvgTalktime':_0x1e6e43[_0x048a('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x1e6e43['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1e6e43['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x1e6e43[_0x048a('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x1e6e43[_0x048a('0x46')],'predictiveIntervalHitRate':_0x1e6e43[_0x048a('0x47')],'predictiveIntervalMultiplicativeFactor':_0x1e6e43['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1e6e43[_0x048a('0x48')],'predictiveIntervalAvailable':_0x1e6e43[_0x048a('0x49')],'predictiveIntervalTotalCalls':_0x1e6e43[_0x048a('0x4a')],'message':_0x1e6e43[_0x048a('0x4b')],'originated':_0x1e6e43['originated'],'erlangCalls':_0x1e6e43[_0x048a('0x4c')],'erlangCallToSecond':_0x1e6e43[_0x048a('0x4d')],'erlangAbandonmentRate':_0x1e6e43['erlangAbandonmentRate'],'erlangBusyFactor':_0x1e6e43[_0x048a('0x4e')],'startPredictive':_0x1e6e43['startPredictive'],'startProgressive':_0x1e6e43[_0x048a('0x4f')]};if(_0x1e6e43[_0x048a('0x50')]){_0x3dd3e9[_0x048a('0x50')]={'id':_0x1e6e43[_0x048a('0x50')]['id'],'name':_0x1e6e43[_0x048a('0x50')]['name'],'active':_0x1e6e43[_0x048a('0x50')][_0x048a('0x51')],'callerid':_0x1e6e43[_0x048a('0x50')][_0x048a('0x52')]};}if(_0x1e6e43[_0x048a('0x53')]){_0x3dd3e9[_0x048a('0x53')]={'id':_0x1e6e43['Interval']['id'],'name':_0x1e6e43['Interval']['name']};}var _0x451774=md5(JSON['stringify'](_0x3dd3e9));if(_0x1e6e43[_0x048a('0x54')]!==_0x451774){_0x1e6e43[_0x048a('0x54')]=_0x451774;emit(util[_0x048a('0x55')]('voice:queue:%s',_0x3dd3e9[_0x048a('0x26')]),'voice_queue:save',_0x3dd3e9);}}}function emitVoiceQueueChannelRemove(_0x2ed1b0){logger[_0x048a('0x56')](_0x048a('0x57'),JSON[_0x048a('0x58')](_0x2ed1b0));emit(util[_0x048a('0x55')](_0x048a('0x59'),_0x2ed1b0[_0x048a('0x26')]),'voice_queue_channel:remove',_0x2ed1b0);io[_0x048a('0x24')](_0x048a('0x5a'),_0x2ed1b0);}function notSendMessagesQueue(_0x2490e9){if(_0x2490e9[_0x048a('0x5b')]){if(_0x2490e9[_0x048a('0x5c')]===0x0&&_0x2490e9[_0x048a('0x2b')]===0x0){_0x2490e9[_0x048a('0x5b')]=![];_0x2490e9[_0x048a('0x29')]=0x0;_0x2490e9['paused']=0x0;_0x2490e9[_0x048a('0x4b')]=_0x048a('0x5d');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2490e9[_0x048a('0x26')]+_0x048a('0x5e'));}else{_0x2490e9[_0x048a('0x4b')]=_0x048a('0x5f');ut[_0x048a('0x60')](_0x048a('0x61'),_0x2490e9[_0x048a('0x26')]+_0x048a('0x62'));}emitCampaignPreview(_0x2490e9);}}Preview[_0x048a('0xe')][_0x048a('0x23')]=function(){var _0x41a90b=this;setInterval(function(){_0x41a90b['syncCampaigns']();},0x7cf);};Preview[_0x048a('0xe')][_0x048a('0x63')]=function(){var _0x5a78c4=this['campaignsPreview'];this[_0x048a('0x16')]+=0x1;for(var _0xec4824 in _0x5a78c4){if(_0x5a78c4[_0x048a('0x64')](_0xec4824)&&(_0x5a78c4[_0xec4824][_0x048a('0x65')]===_0x048a('0x6')||_0x5a78c4[_0xec4824][_0x048a('0x65')]===_0x048a('0x66'))&&_0x5a78c4[_0xec4824][_0x048a('0x2e')]==='outbound'){if(this[_0x048a('0x16')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x5a78c4[_0x048a('0x64')](_0xec4824)&&_0x5a78c4[_0xec4824][_0x048a('0x65')]==='preview'&&_0x5a78c4[_0xec4824]['type']===_0x048a('0x25')){if(_0x5a78c4[_0xec4824][_0x048a('0x67')]){this[_0x048a('0x68')](_0x5a78c4[_0xec4824]);this[_0x048a('0x69')](_0x5a78c4[_0xec4824]);}else{notSendMessagesQueue(_0x5a78c4[_0xec4824]);}}}};Preview[_0x048a('0xe')][_0x048a('0x6a')]=function(_0x5553ed){var _0x8445ae=this;this[_0x048a('0x11')][_0x048a('0x6b')](function(){if(!_['isNil'](_0x8445ae[_0x048a('0x14')][_0x5553ed])){loggerAction[_0x048a('0x56')]('[clearZombieChannels][talking]',_0x5553ed,_0x048a('0x6c'),_0x8445ae['actions'][_0x5553ed][_0x048a('0x6d')],_0x048a('0x6e'),JSON[_0x048a('0x58')](_0x8445ae[_0x048a('0x12')][_0x8445ae[_0x048a('0x14')][_0x5553ed][_0x048a('0x6d')]]['originated']),_0x048a('0x6f'),JSON[_0x048a('0x58')](_0x8445ae[_0x048a('0x12')][_0x8445ae[_0x048a('0x14')][_0x5553ed][_0x048a('0x6d')]][_0x048a('0x2b')]),JSON[_0x048a('0x58')](_0x8445ae[_0x048a('0x14')][_0x5553ed]['dialAnswer']),JSON[_0x048a('0x58')](_[_0x048a('0x70')](_0x8445ae[_0x048a('0x14')][_0x5553ed],[_0x048a('0x71'),_0x048a('0x72'),_0x048a('0x73'),'ListId'])));return ami[_0x048a('0x74')]({'action':_0x048a('0x75'),'channel':_0x8445ae['actions'][_0x5553ed]['channel']})[_0x048a('0x76')](function(_0x185b49){if(_0x185b49[_0x048a('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x8445ae['actions'][_0x5553ed]){ut[_0x048a('0x77')](_0x8445ae[_0x048a('0x12')][_0x8445ae[_0x048a('0x14')][_0x5553ed][_0x048a('0x6d')]],_0x048a('0x78'));if(_0x8445ae['actions'][_0x5553ed]['dialAnswer']===!![]){ut[_0x048a('0x79')](_0x8445ae[_0x048a('0x12')][_0x8445ae['actions'][_0x5553ed][_0x048a('0x6d')]],'[clearZombieChannel]');ut['loggerError'](_0x048a('0x7a')+_0x5553ed,_0x8445ae['actions'][_0x5553ed]['queue']);}ut[_0x048a('0x7b')]('[Dialer][checkChannel][Preview]'+_0x5553ed,_0x8445ae[_0x048a('0x14')][_0x5553ed][_0x048a('0x6d')]);delete _0x8445ae[_0x048a('0x14')][_0x5553ed];}},0x2328);}});}});};Preview['prototype'][_0x048a('0x7c')]=function(){var _0x186a9f=this;loggerAction[_0x048a('0x56')]('[action]',_[_0x048a('0x7d')](this['actions']));for(var _0x165d56 in this[_0x048a('0x14')]){if(_0x186a9f[_0x048a('0x14')][_0x048a('0x64')](_0x165d56)){_0x186a9f[_0x048a('0x6a')](_0x165d56);}}};Preview[_0x048a('0xe')][_0x048a('0x69')]=function(_0x65f17e){var _0x4813c4=this;rpcDb[_0x048a('0x7e')](_0x65f17e['id'],ut[_0x048a('0x7f')](this[_0x048a('0x15')]))[_0x048a('0x80')](function(_0x5510c6){if(!_[_0x048a('0x81')](_0x5510c6)){for(var _0x55a259=0x0;_0x55a259<_0x5510c6[_0x048a('0x82')];_0x55a259+=0x1){if(ut[_0x048a('0x83')](_0x5510c6[_0x55a259]['scheduledat'])<_0x65f17e[_0x048a('0x84')]*0x3c){if(_0x5510c6[_0x55a259][_0x048a('0x85')]&&!_0x5510c6[_0x55a259]['Agent']['voicePause']){_0x4813c4[_0x048a('0x86')](_0x5510c6[_0x55a259]['id'])[_0x048a('0x80')](ut[_0x048a('0x87')]('[RecallMe]'))[_0x048a('0x76')](ut['logger2'](_0x048a('0x88')));}else{rpcDb[_0x048a('0x89')](_0x5510c6[_0x55a259]['id']);}}else{var _0x233604=new Action(_0x5510c6[_0x55a259],_0x65f17e);_0x233604[_0x048a('0x8a')]=moment()[_0x048a('0x55')](_0x048a('0x8b'));_0x65f17e[_0x048a('0x3e')]+=0x1;ut[_0x048a('0x8c')](_0x233604,0x17,_0x048a('0x8d'));if(_0x65f17e[_0x048a('0x8e')]){rpcDb[_0x048a('0x8f')](ut[_0x048a('0x90')](_0x5510c6[_0x55a259]));rpcDb[_0x048a('0x91')](_0x233604,_0x048a('0x92'));}else{ut[_0x048a('0x8c')](_0x233604,0x16,_0x048a('0x93'));rpcDb[_0x048a('0x91')](_0x233604,'[HistoryRecallClose]');rpcDb[_0x048a('0x94')](_0x233604,'[HistoryRecallClose]');}}}}})['catch'](ut['logger2'](_0x048a('0x95')));};Preview[_0x048a('0xe')][_0x048a('0x68')]=function(_0x41a41d){_0x41a41d[_0x048a('0x5b')]=!![];if(ut[_0x048a('0x96')](_0x41a41d[_0x048a('0x2a')])){_0x41a41d[_0x048a('0x4b')]=_0x048a('0x97');}else if(!ut[_0x048a('0x98')](_0x41a41d[_0x048a('0x67')])){_0x41a41d[_0x048a('0x4b')]=_0x048a('0x5d');}else if(!this['isTrunkReachable'](_0x41a41d['Trunk'])){if(!this[_0x048a('0x99')](_0x41a41d[_0x048a('0x9a')])){_0x41a41d[_0x048a('0x4b')]=_0x048a('0x9b');}else{_0x41a41d[_0x048a('0x4b')]=_0x048a('0x9c');}}else{_0x41a41d[_0x048a('0x4b')]=_0x048a('0x9c');}emitCampaignPreview(_0x41a41d);};Preview[_0x048a('0xe')]['callProgressDetectingCustomer']=function(_0x48ec72,_0x15f035,_0x54b0cb){var _0x174dee=this;var _0x2c3bfc=this['actions'][_0x15f035];var _0x1fe57a=this[_0x048a('0x12')][_0x2c3bfc['queue']];var _0x5650a3;var _0x3ac1ea=![];var _0x50df26=0x2;var _0x26c87c=0x3;if(_0x1fe57a){switch(_0x54b0cb){case'1':_0x1fe57a[_0x048a('0x3c')]+=0x1;_0x2c3bfc[_0x048a('0x9d')]+=0x1;_0x2c3bfc[_0x048a('0x9e')]=ut[_0x048a('0x9f')](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0x0,_0x048a('0xa0'));ami['emit'](_0x048a('0xa1'),ut[_0x048a('0xa2')](_0x2c3bfc,_0x048a('0xa3')));rpcDb['createCustomerHistory'](_0x2c3bfc,_0x048a('0xa4'));_0x174dee[_0x048a('0xa5')](_0x2c3bfc,'0',_0x1fe57a)['then'](function(_0x363779){_0x3ac1ea=_0x363779[_0x048a('0xa6')]==0x1;_0x50df26=_0x1fe57a[_0x048a('0xa7')];_0x26c87c=_0x1fe57a['callAdditionalPhoneAfterMin'];if(!_0x3ac1ea){if(ut['totalGlobal'](_0x2c3bfc)>=_0x1fe57a[_0x048a('0xa8')]){_0x5650a3=ut['cloneAction'](_0x2c3bfc,0xf,_0x048a('0xa9'));rpcDb[_0x048a('0x94')](_0x5650a3,_0x048a('0xaa'));}else{if(_0x2c3bfc[_0x048a('0x9d')]>=_0x1fe57a[_0x048a('0xab')]){rpcDb[_0x048a('0x94')](_0x2c3bfc,_0x048a('0xaa'));}else{rpcDb[_0x048a('0xac')](ut[_0x048a('0xad')](_0x2c3bfc,_0x048a('0x9d'),_0x1fe57a[_0x048a('0xa7')]),_0x2c3bfc[_0x048a('0xae')],_0x2c3bfc[_0x048a('0xaf')]);}}delete this[_0x048a('0x14')][_0x48ec72[_0x048a('0xb0')]];}else{_0x2c3bfc[_0x048a('0x9d')]++;logger[_0x048a('0x56')](_0x048a('0xb1'),_0x2c3bfc['countnosuchnumberretry']);logger[_0x048a('0x56')]('id',_0x2c3bfc[_0x048a('0xb2')]);_0x174dee[_0x048a('0xb3')]({'id':_0x2c3bfc['idContact'],'field':{'countnosuchnumberretry':_0x2c3bfc[_0x048a('0x9d')]}})[_0x048a('0x80')](function(){_0x174dee['swapAdditionalPhones'](_0x2c3bfc,_0x50df26,_0x26c87c)[_0x048a('0x80')](function(){});});}});break;case _0x048a('0xb4'):var _0x2ef4c8=moment()[_0x048a('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c3bfc[_0x048a('0xb5')]=_0x2ef4c8;_0x2c3bfc[_0x048a('0xb6')]=_0x2ef4c8;_0x2c3bfc['dialAnswer']=!![];_0x1fe57a[_0x048a('0x2b')]+=0x1;logger[_0x048a('0x56')]('[syncHangup][talking][increment]',_0x2c3bfc[_0x048a('0xb7')],_0x048a('0xb8'),_0x1fe57a[_0x048a('0x26')],_0x048a('0x6f'),_0x1fe57a['pTalking']);ami['emit'](_0x048a('0xb9'),ut[_0x048a('0xa2')](_0x2c3bfc,'connect',this['campaignsPreview'][_0x2c3bfc['queue']]));if(_0x1fe57a[_0x048a('0xba')]){ami[_0x048a('0x24')]('custom:agentConnectPreview',ut['buildAcw'](_0x2c3bfc));}break;case'16':ami[_0x048a('0x24')](_0x048a('0xbb'),ut[_0x048a('0xa2')](_0x2c3bfc,_0x048a('0xbc'),this[_0x048a('0x12')][_0x2c3bfc['queue']]));emitVoiceQueueChannelRemove(ut[_0x048a('0xa2')](_0x2c3bfc,_0x048a('0xbc')));_0x1fe57a['outboundAnswerCallsDay']+=0x1;_0x1fe57a[_0x048a('0x2d')]+=0x1;_0x1fe57a[_0x048a('0x28')]+=0x1;ut[_0x048a('0x79')](_0x1fe57a,_0x048a('0xbd'));_0x2c3bfc['countglobal']=ut[_0x048a('0x9f')](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0x4,_0x048a('0xbe'));rpcDb[_0x048a('0x91')](_0x2c3bfc,_0x048a('0xbf'));rpcDb[_0x048a('0x94')](_0x2c3bfc,_0x048a('0xc0'));rpcDb[_0x048a('0xc1')](_0x2c3bfc);_0x1fe57a[_0x048a('0xc2')]+=_0x2c3bfc[_0x048a('0xc3')];_0x1fe57a[_0x048a('0x2c')]+=_0x2c3bfc[_0x048a('0xc3')];logger['info'](_0x048a('0xc4'),_0x2c3bfc['uniqueid'],_0x048a('0xb8'),_0x1fe57a[_0x048a('0x26')],_0x048a('0x6f'),_0x1fe57a[_0x048a('0x2b')]);delete this[_0x048a('0x14')][_0x48ec72[_0x048a('0xb0')]];break;case _0x048a('0xc5'):_0x1fe57a[_0x048a('0x36')]+=0x1;_0x2c3bfc[_0x048a('0xc6')]+=0x1;_0x2c3bfc[_0x048a('0x9e')]=ut[_0x048a('0x9f')](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0x5,_0x048a('0xc7'));_0x50df26=_0x1fe57a[_0x048a('0xc8')];_0x26c87c=_0x1fe57a[_0x048a('0xc9')];ami[_0x048a('0x24')](_0x048a('0xca'),ut['buildObj'](_0x2c3bfc,_0x048a('0xcb')));rpcDb[_0x048a('0x91')](_0x2c3bfc,'[callProgressDetectingCustomer][logBusy]');_0x174dee[_0x048a('0xa5')](_0x2c3bfc,'5',_0x1fe57a)[_0x048a('0x80')](function(_0x12c5dc){_0x3ac1ea=_0x12c5dc[_0x048a('0xa6')]==0x1;if(!_0x3ac1ea){if(ut[_0x048a('0x9f')](_0x2c3bfc)>=_0x1fe57a['dialGlobalMaxRetry']){_0x5650a3=ut[_0x048a('0xcc')](_0x2c3bfc,0xf,_0x048a('0xa9'));rpcDb[_0x048a('0x94')](_0x5650a3,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2c3bfc[_0x048a('0xc6')]>=_0x1fe57a[_0x048a('0xcd')]){rpcDb['createCustomerFinal'](_0x2c3bfc,_0x048a('0xce'));}else{rpcDb[_0x048a('0xac')](ut[_0x048a('0xad')](_0x2c3bfc,_0x048a('0xc6'),_0x1fe57a[_0x048a('0xc8')]),_0x2c3bfc[_0x048a('0xae')],_0x2c3bfc['activeContact']);}}}else{_0x2c3bfc[_0x048a('0xc6')]++;_0x174dee[_0x048a('0xb3')]({'id':_0x2c3bfc['idContact'],'field':{'countbusyretry':_0x2c3bfc[_0x048a('0xc6')]}})['then'](function(){_0x174dee[_0x048a('0xcf')](_0x2c3bfc,_0x50df26,_0x26c87c)[_0x048a('0x80')](function(){});});}});break;case _0x048a('0xd0'):_0x1fe57a['outboundNoAnswerCallsDay']+=0x1;_0x2c3bfc['countnoanswerretry']+=0x1;_0x2c3bfc[_0x048a('0x9e')]=ut['totalGlobal'](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0x3,_0x048a('0xd1'));_0x50df26=_0x1fe57a['dialNoAnswerRetryFrequency'];_0x26c87c=_0x1fe57a[_0x048a('0xc9')];ami[_0x048a('0x24')](_0x048a('0xd2'),ut['buildObj'](_0x2c3bfc,'noanswer'));rpcDb[_0x048a('0x91')](_0x2c3bfc,_0x048a('0xd3'));_0x174dee[_0x048a('0xa5')](_0x2c3bfc,'3',_0x1fe57a)[_0x048a('0x80')](function(_0x48187d){_0x3ac1ea=_0x48187d[_0x048a('0xa6')]==0x1;if(!_0x3ac1ea){if(ut[_0x048a('0x9f')](_0x2c3bfc)>=_0x1fe57a['dialGlobalMaxRetry']){_0x5650a3=ut['cloneAction'](_0x2c3bfc,0xf,_0x048a('0xa9'));rpcDb[_0x048a('0x94')](_0x5650a3,_0x048a('0xd4'));}else{if(_0x2c3bfc[_0x048a('0xd5')]>=_0x1fe57a[_0x048a('0xd6')]){rpcDb[_0x048a('0x94')](_0x2c3bfc,_0x048a('0xd3'));}else{rpcDb[_0x048a('0xac')](ut['scheduledAt'](_0x2c3bfc,_0x048a('0xd5'),_0x1fe57a['dialNoAnswerRetryFrequency']),_0x2c3bfc[_0x048a('0xae')],_0x2c3bfc['activeContact']);}}}else{_0x2c3bfc[_0x048a('0xd5')]++;_0x174dee[_0x048a('0xb3')]({'id':_0x2c3bfc['idContact'],'field':{'countnoanswerretry':_0x2c3bfc[_0x048a('0xd5')]}})[_0x048a('0x80')](function(){_0x174dee[_0x048a('0xcf')](_0x2c3bfc,_0x50df26,_0x26c87c)[_0x048a('0x80')](function(){});});}});break;case'CONGESTION':_0x1fe57a['outboundCongestionCallsDay']+=0x1;_0x2c3bfc['countcongestionretry']+=0x1;_0x2c3bfc[_0x048a('0x9e')]=ut[_0x048a('0x9f')](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0x8,_0x048a('0xd7'));_0x50df26=_0x1fe57a['dialCongestionRetryFrequency'];_0x26c87c=_0x1fe57a[_0x048a('0xc9')];ami[_0x048a('0x24')]('custom:agentcongestion',ut[_0x048a('0xa2')](_0x2c3bfc,_0x048a('0xd8')));rpcDb['createCustomerHistory'](_0x2c3bfc,_0x048a('0xd9'));_0x174dee[_0x048a('0xa5')](_0x2c3bfc,'8',_0x1fe57a)['then'](function(_0x28f0b7){_0x3ac1ea=_0x28f0b7[_0x048a('0xa6')]==0x1;if(!_0x3ac1ea){if(ut[_0x048a('0x9f')](_0x2c3bfc)>=_0x1fe57a['dialGlobalMaxRetry']){_0x5650a3=ut[_0x048a('0xcc')](_0x2c3bfc,0xf,'Global');rpcDb['createCustomerFinal'](_0x5650a3,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2c3bfc[_0x048a('0xda')]>=_0x1fe57a['dialCongestionMaxRetry']){rpcDb[_0x048a('0x94')](_0x2c3bfc,_0x048a('0xd9'));}else{rpcDb[_0x048a('0xac')](ut[_0x048a('0xad')](_0x2c3bfc,_0x048a('0xda'),_0x1fe57a[_0x048a('0xc8')]),_0x2c3bfc[_0x048a('0xae')],_0x2c3bfc[_0x048a('0xaf')]);}}}else{_0x2c3bfc[_0x048a('0xda')]++;_0x174dee[_0x048a('0xb3')]({'id':_0x2c3bfc['idContact'],'field':{'countcongestionretry':_0x2c3bfc['countcongestionretry']}})['then'](function(){_0x174dee['swapAdditionalPhones'](_0x2c3bfc,_0x50df26,_0x26c87c)[_0x048a('0x80')](function(){});});}});break;case _0x048a('0xdb'):_0x1fe57a[_0x048a('0x3f')]+=0x1;_0x2c3bfc[_0x048a('0xdc')]+=0x1;_0x2c3bfc['countglobal']=ut[_0x048a('0x9f')](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0x14,_0x048a('0xdd'));_0x50df26=_0x1fe57a[_0x048a('0xde')];_0x26c87c=_0x1fe57a[_0x048a('0xc9')];ami[_0x048a('0x24')](_0x048a('0xdf'),ut[_0x048a('0xa2')](_0x2c3bfc,_0x048a('0xe0')));rpcDb['createCustomerHistory'](_0x2c3bfc,_0x048a('0xe1'));_0x174dee[_0x048a('0xa5')](_0x2c3bfc,'20',_0x1fe57a)[_0x048a('0x80')](function(_0x5d3137){_0x3ac1ea=_0x5d3137[_0x048a('0xa6')]==0x1;if(!_0x3ac1ea){if(ut[_0x048a('0x9f')](_0x2c3bfc)>=_0x1fe57a[_0x048a('0xa8')]){_0x5650a3=ut[_0x048a('0xcc')](_0x2c3bfc,0x14,_0x048a('0xdd'));rpcDb[_0x048a('0x94')](_0x5650a3,_0x048a('0xe2'));}else{if(_0x2c3bfc[_0x048a('0xdc')]>=_0x1fe57a[_0x048a('0xe3')]){rpcDb['createCustomerFinal'](_0x2c3bfc,_0x048a('0xe2'));}else{rpcDb[_0x048a('0xac')](ut['scheduledAt'](_0x2c3bfc,'countagentrejectretry',_0x1fe57a[_0x048a('0xde')]),_0x2c3bfc[_0x048a('0xae')],_0x2c3bfc[_0x048a('0xaf')]);}}}else{_0x2c3bfc[_0x048a('0xd5')]++;_0x174dee[_0x048a('0xb3')]({'id':_0x2c3bfc[_0x048a('0xb2')],'field':{'countnoanswerretry':_0x2c3bfc[_0x048a('0xd5')]}})[_0x048a('0x80')](function(){_0x174dee[_0x048a('0xcf')](_0x2c3bfc,_0x50df26,_0x26c87c)['then'](function(){});});}});break;case _0x048a('0xe4'):_0x1fe57a['outboundAbandonedCallsDay']+=0x1;_0x2c3bfc['countabandonedretry']+=0x1;_0x2c3bfc['countglobal']=ut[_0x048a('0x9f')](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x2c3bfc,_0x048a('0xe5'));_0x174dee[_0x048a('0xa5')](_0x2c3bfc,'11',_0x1fe57a)[_0x048a('0x80')](function(_0x45ae1f){_0x3ac1ea=_0x45ae1f[_0x048a('0xa6')]==0x1;if(!_0x3ac1ea){if(ut[_0x048a('0x9f')](_0x2c3bfc)>=_0x1fe57a['dialGlobalMaxRetry']){_0x5650a3=ut[_0x048a('0xcc')](_0x2c3bfc,0xf,_0x048a('0xa9'));rpcDb[_0x048a('0x94')](_0x5650a3,_0x048a('0xe5'));}else{if(_0x2c3bfc[_0x048a('0xe6')]>=_0x1fe57a[_0x048a('0xe7')]){rpcDb['createCustomerFinal'](_0x2c3bfc,_0x048a('0xe5'));}else{rpcDb[_0x048a('0xac')](ut[_0x048a('0xad')](_0x2c3bfc,_0x048a('0xe8'),_0x1fe57a[_0x048a('0xe9')]),_0x2c3bfc[_0x048a('0xae')],_0x2c3bfc[_0x048a('0xaf')]);}}}else{_0x2c3bfc[_0x048a('0xd5')]++;_0x174dee[_0x048a('0xb3')]({'id':_0x2c3bfc[_0x048a('0xb2')],'field':{'countnoanswerretry':_0x2c3bfc['countnoanswerretry']}})[_0x048a('0x80')](function(){_0x174dee[_0x048a('0xcf')](_0x2c3bfc,_0x50df26,_0x26c87c)[_0x048a('0x80')](function(){});});}});break;case'18':_0x1fe57a['outboundUnknownCallsDay']+=0x1;_0x2c3bfc[_0x048a('0xea')]+=0x1;_0x2c3bfc[_0x048a('0x9e')]=ut[_0x048a('0x9f')](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0x12,_0x48ec72[_0x048a('0xeb')]||_0x48ec72[_0x048a('0xec')]);ami[_0x048a('0x24')](_0x048a('0xed'),ut[_0x048a('0xa2')](_0x2c3bfc,_0x048a('0xee')));rpcDb[_0x048a('0x91')](_0x2c3bfc,_0x048a('0xef'));_0x174dee['verifyAdditionalPhones'](_0x2c3bfc,'18',_0x1fe57a)[_0x048a('0x80')](function(_0x15d67b){_0x3ac1ea=_0x15d67b['additional']==0x1;if(!_0x3ac1ea){if(ut[_0x048a('0x9f')](_0x2c3bfc)>=_0x1fe57a['dialGlobalMaxRetry']){_0x5650a3=ut['cloneAction'](_0x2c3bfc,0x12,_0x048a('0xa9'));rpcDb[_0x048a('0x94')](_0x5650a3,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x048a('0x94')](_0x2c3bfc,_0x048a('0xef'));}}else{_0x2c3bfc[_0x048a('0xd5')]++;_0x174dee[_0x048a('0xb3')]({'id':_0x2c3bfc[_0x048a('0xb2')],'field':{'countnoanswerretry':_0x2c3bfc[_0x048a('0xd5')]}})[_0x048a('0x80')](function(){_0x174dee[_0x048a('0xcf')](_0x2c3bfc,_0x50df26,_0x26c87c)[_0x048a('0x80')](function(){});});}});delete this[_0x048a('0x14')][_0x48ec72[_0x048a('0xb0')]];break;case'19':_0x1fe57a[_0x048a('0x40')]+=0x1;_0x2c3bfc[_0x048a('0x9e')]=ut['totalGlobal'](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0x13,_0x48ec72[_0x048a('0xeb')]||_0x48ec72[_0x048a('0xec')]);ami[_0x048a('0x24')](_0x048a('0xed'),ut[_0x048a('0xa2')](_0x2c3bfc,_0x048a('0xee')));rpcDb[_0x048a('0x91')](_0x2c3bfc,_0x048a('0xf0'));_0x174dee[_0x048a('0xa5')](_0x2c3bfc,'18',_0x1fe57a)[_0x048a('0x80')](function(_0x4f97a8){_0x3ac1ea=_0x4f97a8[_0x048a('0xa6')]==0x1;if(!_0x3ac1ea){if(ut[_0x048a('0x9f')](_0x2c3bfc)>=_0x1fe57a['dialGlobalMaxRetry']){_0x5650a3=ut[_0x048a('0xcc')](_0x2c3bfc,0xf,_0x048a('0xa9'));rpcDb[_0x048a('0x94')](_0x5650a3,_0x048a('0xf0'));}else{rpcDb[_0x048a('0x94')](_0x2c3bfc,'[callProgressDetectingCustomer][machine]');}}else{_0x2c3bfc[_0x048a('0xd5')]++;_0x174dee[_0x048a('0xb3')]({'id':_0x2c3bfc[_0x048a('0xb2')],'field':{'countnoanswerretry':_0x2c3bfc[_0x048a('0xd5')]}})[_0x048a('0x80')](function(){_0x174dee[_0x048a('0xcf')](_0x2c3bfc,_0x50df26,_0x26c87c)[_0x048a('0x80')](function(){});});}});delete this[_0x048a('0x14')][_0x48ec72[_0x048a('0xb0')]];break;default:if(_0x2c3bfc['dialAnswer']){ut['decrementTalkink'](_0x1fe57a,_0x048a('0xf1'));ut[_0x048a('0x7b')](_0x048a('0xf2')+_0x1fe57a[_0x048a('0x26')],_0x48ec72);}_0x1fe57a[_0x048a('0x40')]+=0x1;_0x2c3bfc['countglobal']=ut['totalGlobal'](_0x2c3bfc);ut[_0x048a('0x8c')](_0x2c3bfc,0xc,_0x48ec72['cause-txt']||_0x48ec72[_0x048a('0xec')]);_0x50df26=_0x1fe57a['dialAgentRejectRetryFrequency'];_0x26c87c=_0x1fe57a[_0x048a('0xc9')];rpcDb[_0x048a('0x91')](_0x2c3bfc,_0x048a('0xf3'));_0x174dee[_0x048a('0xa5')](_0x2c3bfc,'20',_0x1fe57a)[_0x048a('0x80')](function(_0x48ad73){_0x3ac1ea=_0x48ad73[_0x048a('0xa6')]==0x1;if(!_0x3ac1ea){if(ut[_0x048a('0x9f')](_0x2c3bfc)>=_0x1fe57a[_0x048a('0xa8')]){_0x5650a3=ut['cloneAction'](_0x2c3bfc,0xf,'Global');rpcDb['createCustomerFinal'](_0x5650a3,_0x048a('0xf4'));}else{rpcDb[_0x048a('0x94')](_0x2c3bfc,_0x048a('0xf4'));}delete this[_0x048a('0x14')][_0x48ec72[_0x048a('0xb0')]];}else{_0x174dee['swapAdditionalPhones'](_0x2c3bfc,_0x50df26,_0x26c87c)[_0x048a('0x80')](function(_0x120eed){});}});}if(!(_0x2c3bfc[_0x048a('0xf5')]&&_0x54b0cb==='16')){ut[_0x048a('0x77')](_0x1fe57a,_0x048a('0xf6'));logger[_0x048a('0x56')](_0x048a('0xf7'),_0x2c3bfc[_0x048a('0xb7')],_0x048a('0xb8'),_0x1fe57a[_0x048a('0x26')],_0x048a('0x6e'),_0x1fe57a[_0x048a('0x5c')]);}if(_0x54b0cb!=='ANSWER'){delete this[_0x048a('0x14')][_0x48ec72[_0x048a('0xb0')]];delete this[_0x048a('0x14')][_0x48ec72[_0x048a('0xf8')]];}}};Preview[_0x048a('0xe')][_0x048a('0xf9')]=function(_0x2e183f,_0x318b2a,_0x497bbc){if(_[_0x048a('0xfa')](_0x318b2a)&&_0x048a('0xfb')!==typeof _0x318b2a){return;}if(_[_0x048a('0xfa')](_0x497bbc)&&_0x048a('0xfb')!==typeof _0x497bbc){return;}switch(_0x497bbc[_0x048a('0xfc')]){case'0':ut[_0x048a('0xfd')](_0x2e183f,0x0,_0x048a('0xa0'));rpcDb[_0x048a('0xfe')](_0x2e183f,_0x048a('0xff'));break;case'3':ut[_0x048a('0xfd')](_0x2e183f,0x3,_0x048a('0xd1'));rpcDb['createAgentHistory'](_0x2e183f,_0x048a('0x100'));break;case'5':ut[_0x048a('0xfd')](_0x2e183f,0x5,_0x048a('0xc7'));rpcDb[_0x048a('0xfe')](_0x2e183f,_0x048a('0x101'));break;case'8':ut['logAgent'](_0x2e183f,0x8,_0x048a('0xd7'));rpcDb['createAgentHistory'](_0x2e183f,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x048a('0xfd')](_0x2e183f,0x16,_0x048a('0x102'));rpcDb['createAgentHistory'](_0x2e183f,_0x048a('0x103'));break;default:ut['logAgent'](_0x2e183f,0xc,_0x497bbc[_0x048a('0xfc')]);rpcDb[_0x048a('0xfe')](_0x2e183f,_0x048a('0x104'));}ut['updateOriginated'](_0x318b2a,_0x048a('0x105'));logger['info'](_0x048a('0x106'),_0x2e183f[_0x048a('0xb7')],_0x048a('0xb8'),_0x318b2a['name'],_0x048a('0x6e'),_0x318b2a[_0x048a('0x5c')]);delete this['actions'][_0x2e183f['uniqueid']];};Preview[_0x048a('0xe')][_0x048a('0xa5')]=function(_0x5ec781,_0x1fb48d,_0x64003){return BPromise['resolve']()[_0x048a('0x80')](cmHopperAdditionalPhone[_0x048a('0xa5')](_0x5ec781,_0x1fb48d,_0x64003))[_0x048a('0x76')](logger['info'](_0x048a('0x107')));};Preview[_0x048a('0xe')][_0x048a('0xcf')]=function(_0x3560b9,_0x4754fc,_0x2d0eec){return BPromise[_0x048a('0x108')]()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x3560b9,_0x4754fc,_0x2d0eec))[_0x048a('0x76')](logger[_0x048a('0x56')]('[swapAdditionalPhone]\x20'));};Preview[_0x048a('0xe')][_0x048a('0xb3')]=function(_0x11ff66){return BPromise['resolve']()[_0x048a('0x80')](cmHopperAdditionalPhone[_0x048a('0xb3')](_0x11ff66))[_0x048a('0x76')](logger[_0x048a('0x56')](_0x048a('0x109')));};Preview[_0x048a('0xe')][_0x048a('0x10a')]=function(_0x13c489,_0x100474,_0x153216,_0x5ab125,_0x57fc2d){var _0x393c86=this;return new BPromise(function(_0x2f3d27,_0x5f2def){if(_[_0x048a('0x81')](_0x100474)||_[_0x048a('0x81')](_0x100474['Contact'])||_[_0x048a('0x81')](_0x100474[_0x048a('0x10b')])||_[_0x048a('0x81')](_0x100474['VoiceQueueId'])){_0x5f2def(ut[_0x048a('0x4b')](_0x048a('0x10c'),_0x5ab125,_0x57fc2d));return;}var _0x2863fd=uuid['v4']();var _0x272df2=_0x393c86[_0x048a('0x12')][_0x100474['Queue'][_0x048a('0x26')]];var _0x3a67bb=_0x153216?_0x393c86['agents'][_0x153216]['id']:undefined;_0x393c86[_0x048a('0x14')][_0x2863fd]=new Action(_0x100474,_0x272df2,_0x2863fd,_0x153216,_0x3a67bb);var _0xdbe822=_0x393c86[_0x048a('0x14')][_0x2863fd];_0xdbe822['unlockAgent']=_0x5ab125;_0xdbe822[_0x048a('0xaf')]=_0x57fc2d;_0xdbe822['lookAgent']=_0x153216;if(_[_0x048a('0x10d')](_0x13c489)){_0x393c86[_0x048a('0x10e')](_0xdbe822,_0x272df2,_0x100474,_0x153216)[_0x048a('0x80')](function(_0x3621e2){logger[_0x048a('0x56')](_0x048a('0x10f'),'Queue:\x20'+_0xdbe822['queue']+_0x048a('0x110')+_0xdbe822['idContact'],JSON[_0x048a('0x58')](_0x3621e2));ami[_0x048a('0x24')]('custom:agentcalled',ut[_0x048a('0xa2')](_0xdbe822,'called',_0x393c86[_0x048a('0x12')][_0xdbe822[_0x048a('0x6d')]]));_0x2f3d27(ut[_0x048a('0x4b')](_0x048a('0x111')));})[_0x048a('0x76')](function(_0x22219d){ut['logger']('[Preview][execCall][failure]',_0x22219d);_0x5f2def(ut[_0x048a('0x4b')](_0x048a('0x112'),_0x5ab125,_0x57fc2d));});}else{_0x272df2['outboundBlacklistCallsDay']+=0x1;ut[_0x048a('0x113')](_0xdbe822);rpcDb[_0x048a('0x114')](_0xdbe822,_0x048a('0x115'));delete _0x393c86[_0x048a('0x14')][_0x2863fd];_0x5f2def(ut[_0x048a('0x4b')](_0x048a('0x116'),_0x5ab125,_0x57fc2d));}});};Preview[_0x048a('0xe')]['isTrunkReachable']=function(_0x43a693){return!_['isNil'](_0x43a693)&&!_[_0x048a('0x81')](_0x43a693[_0x048a('0x26')])&&!_[_0x048a('0x81')](_0x43a693['active'])&&_0x43a693[_0x048a('0x51')]&&!_[_0x048a('0x81')](this[_0x048a('0x117')][util[_0x048a('0x55')]('SIP/%s',_0x43a693[_0x048a('0x26')])])&&!_[_0x048a('0x81')](this[_0x048a('0x117')][util[_0x048a('0x55')]('SIP/%s',_0x43a693['name'])]['status'])&&(this[_0x048a('0x117')][util['format'](_0x048a('0x118'),_0x43a693['name'])][_0x048a('0x75')]===_0x048a('0x119')||this[_0x048a('0x117')][util[_0x048a('0x55')]('SIP/%s',_0x43a693[_0x048a('0x26')])][_0x048a('0x75')]===_0x048a('0x11a'));};Preview[_0x048a('0xe')][_0x048a('0x86')]=function(_0x40d92c,_0x5da1f0){var _0x5bae41=this;return new BPromise(function(_0x1f8f4c,_0x495a7f){_0x5bae41['execRun'](_0x40d92c,_0x5da1f0)[_0x048a('0x80')](function(_0x462531){_0x1f8f4c(_[_0x048a('0x70')](_0x462531,[_0x048a('0x4b')]));})[_0x048a('0x76')](function(_0xc75df9){if(_0xc75df9[_0x048a('0x11b')]){rpcDb['unlockContact'](_0x40d92c);}if(_0xc75df9[_0x048a('0x51')]){rpcDb[_0x048a('0x89')](_0x40d92c);}_0x495a7f(_[_0x048a('0x70')](_0xc75df9,[_0x048a('0x4b')]));});});};Preview[_0x048a('0xe')]['execRun']=function(_0x490fd3,_0x4bc51a){var _0x20ab1b=this;return new BPromise(function(_0x135f2f,_0x206e93){var _0x3b2268,_0x3bc0e3;rpcDb[_0x048a('0x11c')](_0x490fd3)[_0x048a('0x80')](function(_0x148a6c){if(!_['isNil'](_0x148a6c[0x0])){_0x3bc0e3=_0x148a6c[0x0][_0x048a('0x11d')]?![]:!![];_0x3b2268=_0x148a6c[0x0][_0x048a('0x11d')]?!![]:![];_0x3b2268=_0x4bc51a?!![]:_0x3b2268;}var _0x6a6b12=_0x20ab1b['validateContact'](_0x148a6c);if(_0x6a6b12[_0x048a('0x11e')]){rpcDb[_0x048a('0x11f')](_[_0x048a('0x70')](_0x148a6c[0x0],[_0x048a('0x73'),_0x048a('0x10b')]))[_0x048a('0x80')](function(_0x2b426a){_0x20ab1b['checkInBlack'](_0x2b426a,_0x148a6c[0x0],_0x4bc51a,_0x3bc0e3,_0x3b2268)['then'](function(_0x1aba60){_0x135f2f(_0x1aba60);})[_0x048a('0x76')](function(_0x3ae147){_0x206e93(_0x3ae147);});})['catch'](function(_0x1615a6){ut[_0x048a('0x60')]('[Preview][checkIsBlackList]',_0x1615a6);_0x206e93(ut[_0x048a('0x4b')]('Call\x20unsuccessful',_0x3bc0e3,_0x3b2268));});}else{_0x206e93(ut[_0x048a('0x4b')](_0x6a6b12[_0x048a('0x4b')],_0x3bc0e3,_0x3b2268));}})[_0x048a('0x76')](function(_0x286cd7){ut[_0x048a('0x60')]('[Preview][getContactPreview]',_0x286cd7);_0x206e93(ut[_0x048a('0x4b')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype']['validateContact']=function(_0x3fc0dc){if(_['isNil'](_0x3fc0dc)||_[_0x048a('0x10d')](_0x3fc0dc)||!_['isNil'](_0x3fc0dc[0x0]['Agent'])&&_[_0x048a('0x81')](_0x3fc0dc[0x0]['Agent']['name'])){ut[_0x048a('0x60')](_0x048a('0x120'),_0x3fc0dc);return{'isValid':![],'message':_0x048a('0x121')};}var _0x5b5089=this[_0x048a('0x12')][_0x3fc0dc[0x0][_0x048a('0x6c')]['name']];_0x5b5089[_0x048a('0x4b')]=_0x048a('0x9c');if(_['isNil'](_0x5b5089)){ut[_0x048a('0x60')](_0x048a('0x122'),_0x5b5089);return{'isValid':![],'message':_0x048a('0x123')};}if(!this[_0x048a('0x99')](_0x5b5089['Trunk'])){ut[_0x048a('0x60')](_0x048a('0x124'),'campaign\x20Name:\x20'+_0x5b5089['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x048a('0x99')](_0x5b5089[_0x048a('0x9a')])){ut[_0x048a('0x60')](_0x048a('0x124'),_0x5b5089['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x048a('0x125')};}}if(!ut['isActive'](_0x5b5089['dialActive'])){ut[_0x048a('0x60')]('[Preview][validateContact][Campaign\x20Active]',_0x5b5089['name']+_0x048a('0x126'));return{'isValid':![],'message':_0x048a('0x127')+_0x5b5089[_0x048a('0x26')]+_0x048a('0x126')};}return{'isValid':!![],'message':_0x048a('0x128')};};Preview[_0x048a('0xe')][_0x048a('0x10e')]=function(_0x1daf43,_0x4dc3e5,_0x4bbe25,_0x560f2a){var _0x5bfde0=this;return new BPromise(function(_0x4fdf0a,_0xf25324){var _0x1740d0=_0x1daf43[_0x048a('0xb7')];var _0x7ad0bd=_0x5bfde0['isTrunkReachable'](_0x4dc3e5[_0x048a('0x50')])?util['format']('SIP/%s/%s%s',_0x4dc3e5[_0x048a('0x50')][_0x048a('0x26')],_['isNil'](_0x4dc3e5['dialPrefix'])?'':_0x4dc3e5[_0x048a('0x129')][_0x048a('0x12a')]()||'',_0x4dc3e5[_0x048a('0x12b')]>0x0?_0x4bbe25[_0x048a('0x10b')][_0x048a('0x12c')](_0x4dc3e5[_0x048a('0x12b')]):_0x4bbe25[_0x048a('0x10b')]):util[_0x048a('0x55')]('SIP/%s/%s%s',_['isNil'](_0x4dc3e5['TrunkBackup'])?_0x4dc3e5[_0x048a('0x50')]['name']:_0x4dc3e5[_0x048a('0x9a')][_0x048a('0x26')],_[_0x048a('0x81')](_0x4dc3e5[_0x048a('0x129')])?'':_0x4dc3e5[_0x048a('0x129')][_0x048a('0x12a')]()||'',_0x4dc3e5['dialCutDigit']>0x0?_0x4bbe25[_0x048a('0x10b')][_0x048a('0x12c')](_0x4dc3e5[_0x048a('0x12b')]):_0x4bbe25[_0x048a('0x10b')]);var _0x296d2b=_0x5bfde0[_0x048a('0x99')](_0x4dc3e5[_0x048a('0x50')])?ut[_0x048a('0x12d')](_0x4dc3e5['Trunk'][_0x048a('0x52')],_0x4dc3e5[_0x048a('0x32')],_0x4dc3e5['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x048a('0x12e')](_0x4dc3e5[_0x048a('0x33')],_0x4dc3e5['dialRandomLastDigitCallerIdNumber']):_0x4dc3e5[_0x048a('0x33')]):ut[_0x048a('0x12d')](_[_0x048a('0x81')](_0x4dc3e5['TrunkBackup'])?_0x4dc3e5[_0x048a('0x50')][_0x048a('0x52')]:_0x4dc3e5[_0x048a('0x9a')][_0x048a('0x52')],_0x4dc3e5[_0x048a('0x32')],_0x4dc3e5[_0x048a('0x12f')]>0x0?ut['getCallerIdRandom'](_0x4dc3e5[_0x048a('0x33')],_0x4dc3e5[_0x048a('0x12f')]):_0x4dc3e5['dialOriginateCallerIdNumber']);if(_0x296d2b){_0x1daf43[_0x048a('0x130')]=ut['extractCalleridName'](_0x296d2b);_0x1daf43[_0x048a('0x131')]=ut['extractCalleridNumber'](_0x296d2b);}var _0x41785e=ut[_0x048a('0x132')](_0x4dc3e5,_0x4bbe25,_0x7ad0bd,_0x296d2b,_0x1740d0,_0x1daf43);_['merge'](_0x1daf43,ut[_0x048a('0x133')](_0x41785e));_0x1daf43['starttime']=moment()[_0x048a('0x55')](_0x048a('0x8b'));ami['Action'](ut[_0x048a('0x134')](_0x1daf43,_0x4dc3e5,_0x41785e,_0x1daf43[_0x048a('0xaf')],_0x560f2a))[_0x048a('0x80')](function(_0x33c599){var _0x4b7207=_0x1daf43[_0x048a('0x135')];if(!_['isNil'](_0x4b7207)){if(!_[_0x048a('0x81')](_0x5bfde0[_0x048a('0x15')][_0x4b7207])){_0x5bfde0['agents'][_0x4b7207][_0x048a('0x136')]=_0x1daf43[_0x048a('0x137')];emit(util[_0x048a('0x55')]('user:%s',_0x5bfde0['agents'][_0x4b7207][_0x048a('0x26')]),_0x048a('0x138'),{'destaccountcode':_0x5bfde0[_0x048a('0x15')][_0x4b7207]['accountcode'],'destconnectedlinenum':_0x1daf43['calleridnum']});}}_0x4dc3e5['originated']+=0x1;logger[_0x048a('0x56')](_0x048a('0x139'),_0x1740d0,'\x20Queue',_0x4dc3e5[_0x048a('0x26')],_0x048a('0x6e'),_0x4dc3e5[_0x048a('0x5c')]);_0x4fdf0a(_0x33c599);})[_0x048a('0x76')](function(_0x2d0b9e){ut[_0x048a('0xfd')](_0x1daf43,0xe,_0x048a('0x13a'));rpcDb[_0x048a('0xfe')](_0x1daf43,_0x048a('0x13b'));_0xf25324(_0x2d0b9e);});});};Preview[_0x048a('0xe')]['syncNewExten']=function(_0x579eae){if(this[_0x048a('0x14')][_0x579eae[_0x048a('0xb0')]]){this[_0x048a('0x14')][_0x579eae[_0x048a('0xb0')]][_0x048a('0x13c')]=_0x579eae['channel'];}};Preview[_0x048a('0xe')][_0x048a('0x17')]=function(_0x3008d7){var _0x44caa4=this;var _0x1cb882=this[_0x048a('0x14')][_0x3008d7[_0x048a('0x13d')]];if(_0x1cb882){if(_0x1cb882[_0x048a('0x13e')]&&this[_0x048a('0x15')][_0x1cb882['lookAgent']]){ut['logLookAgent'](_0x1cb882,this[_0x048a('0x15')][_0x1cb882[_0x048a('0x13e')]]['name'],this[_0x048a('0x15')][_0x1cb882['lookAgent']]['id']);}var _0xacf779=_['clone'](_0x1cb882);_0xacf779['responsetime']=moment()[_0x048a('0x55')](_0x048a('0x8b'));var _0x5233c4=_0x44caa4[_0x048a('0x12')][_0x1cb882[_0x048a('0x6d')]];if(ut['isFailure'](_0x3008d7[_0x048a('0x13f')])){if(_0x1cb882[_0x048a('0xae')]){rpcDb['unlockContact'](_0x1cb882[_0x048a('0xb2')]);}if(_0x1cb882[_0x048a('0xaf')]){rpcDb[_0x048a('0x89')](_0x1cb882['idContact']);}ami['emit'](_0x048a('0x140'),ut[_0x048a('0xa2')](_0x1cb882,_0x048a('0x141'),this[_0x048a('0x12')][_0x1cb882[_0x048a('0x6d')]]));this['callProgressDetectingAgent'](_0xacf779,_0x5233c4,_0x3008d7);}else{_0x1cb882['starttime']=moment()[_0x048a('0x55')](_0x048a('0x8b'));ut['logAgent'](_0xacf779,0x4,_0x048a('0xbe'));rpcDb[_0x048a('0xfe')](_0xacf779,_0x048a('0x142'));}}};Preview[_0x048a('0xe')][_0x048a('0x143')]=function(_0x4ebaf6){var _0x2a37ad=this;var _0x1cfd79=this['actions'][_0x4ebaf6[_0x048a('0xb0')]];var _0x1f4170;if(_0x1cfd79){_0x1f4170=this['campaignsPreview'][_0x1cfd79['queue']];logger['info'](_0x048a('0x144'),_0x4ebaf6[_0x048a('0xb0')],_0x048a('0xb8'),_0x1f4170[_0x048a('0x26')],_0x048a('0x6f'),_0x1f4170[_0x048a('0x2b')]);}if(this[_0x048a('0x14')][_0x4ebaf6[_0x048a('0xb0')]]&&_0x4ebaf6[_0x048a('0xb0')]!==_0x4ebaf6[_0x048a('0xb7')]){if(_0x4ebaf6['cause']==='16'&&this[_0x048a('0x14')][_0x4ebaf6[_0x048a('0xb0')]]['dialAnswer']){this['callProgressDetectingCustomer'](_0x4ebaf6,_0x4ebaf6[_0x048a('0xb0')],_0x4ebaf6[_0x048a('0x145')]);}else if(this['actions'][_0x4ebaf6['linkedid']][_0x048a('0xf5')]){logger[_0x048a('0x56')]('[syncHangup][talking][cause]',_0x4ebaf6[_0x048a('0xb0')],_0x4ebaf6['cause'],_0x048a('0xb8'),_0x1f4170[_0x048a('0x26')],_0x048a('0x6f'),_0x1f4170['pTalking']);this[_0x048a('0x146')](_0x4ebaf6,_0x4ebaf6[_0x048a('0xb0')],_0x4ebaf6[_0x048a('0x145')]);}}else if(_0x1cfd79&&_[_0x048a('0x81')](_0x1cfd79['statedesc'])&&_0x1f4170[_0x048a('0x147')]&&_0x4ebaf6[_0x048a('0xb0')]===_0x4ebaf6[_0x048a('0xb7')]&&_[_0x048a('0x81')](_0x4ebaf6[_0x048a('0xfc')])&&_0x4ebaf6[_0x048a('0x145')]==='16'&&_0x4ebaf6[_0x048a('0x148')]==='6'&&_[_0x048a('0xfa')](_0x1cfd79[_0x048a('0x149')])){if(_0x1cfd79[_0x048a('0xae')]){rpcDb[_0x048a('0x14a')](_0x1cfd79[_0x048a('0xb2')]);}if(_0x1cfd79[_0x048a('0xaf')]){rpcDb[_0x048a('0x89')](_0x1cfd79[_0x048a('0xb2')]);}_0x4ebaf6[_0x048a('0xfc')]='22';this[_0x048a('0xf9')](_0x1cfd79,_0x1f4170,_0x4ebaf6);}else if(_0x1cfd79&&_0x1cfd79[_0x048a('0x149')]){if(_0x4ebaf6[_0x048a('0x145')]==='16'&&this['actions'][_0x4ebaf6[_0x048a('0xb0')]][_0x048a('0xf5')]){logger['info']('[syncHangup][talking][transfer]',_0x4ebaf6['linkedid'],_0x4ebaf6[_0x048a('0x145')],_0x048a('0xb8'),_0x1f4170['name'],_0x048a('0x6f'),_0x1f4170['pTalking']);this[_0x048a('0x146')](_0x4ebaf6,_0x4ebaf6[_0x048a('0xb0')],_0x4ebaf6[_0x048a('0x145')]);}else if(this[_0x048a('0x14')][_0x4ebaf6['linkedid']][_0x048a('0xf5')]){logger[_0x048a('0x56')](_0x048a('0x14b'),_0x4ebaf6[_0x048a('0xb0')],_0x4ebaf6['cause'],_0x048a('0xb8'),_0x1f4170[_0x048a('0x26')],_0x048a('0x6f'),_0x1f4170[_0x048a('0x2b')]);this['callProgressDetectingCustomer'](_0x4ebaf6,_0x4ebaf6[_0x048a('0xb0')],_0x4ebaf6[_0x048a('0x145')]);}}};Preview['prototype'][_0x048a('0x14c')]=function(_0x9c63f){if(this[_0x048a('0x14')][_0x9c63f['destlinkedid']]&&_0x9c63f['destlinkedid']!==_0x9c63f[_0x048a('0x14d')]){this[_0x048a('0x146')](_0x9c63f,_0x9c63f['destlinkedid'],_0x9c63f[_0x048a('0xec')]);}};Preview[_0x048a('0xe')][_0x048a('0x1b')]=function(_0x1bcbc3){if(this[_0x048a('0x14')][_0x1bcbc3['linkedid']]&&_0x1bcbc3[_0x048a('0xb0')]!==_0x1bcbc3['uniqueid']&&!this[_0x048a('0x14')][_0x1bcbc3[_0x048a('0xb0')]]['dialAnswer']){if(_0x1bcbc3['cause']==='1'){this[_0x048a('0x146')](_0x1bcbc3,_0x1bcbc3[_0x048a('0xb0')],_0x1bcbc3['cause']);}}};Preview[_0x048a('0xe')][_0x048a('0x14e')]=function(_0x4f963,_0x3fa3e6,_0x3d4fc9){if(this[_0x048a('0x14')][_0x4f963]){if(_[_0x048a('0x81')](this[_0x048a('0x14')][_0x4f963][_0x048a('0x14f')])){this[_0x048a('0x14')][_0x4f963][_0x048a('0x14f')]={};}this[_0x048a('0x14')][_0x4f963][_0x048a('0x14f')][_0x3fa3e6]=_0x3d4fc9;}};Preview[_0x048a('0xe')][_0x048a('0x1f')]=function(_0x5ec37e){try{if(!_[_0x048a('0x81')](_0x5ec37e)){if(ut['filterKey'](_[_0x048a('0x150')](_0x5ec37e['variable'])[0x0])){this[_0x048a('0x14e')](_0x5ec37e[_0x048a('0xb7')],_['keys'](_0x5ec37e[_0x048a('0x151')])[0x0],_0x5ec37e[_0x048a('0x152')]);}}}catch(_0x340f8d){logger[_0x048a('0x153')]('[syncVarSet][Preview]',util[_0x048a('0x154')](_0x340f8d,{'showHidden':![],'depth':null}));}};Preview[_0x048a('0xe')]['syncAttendedTransfer']=function(_0x474849){if(_0x474849){if(this['actions'][_0x474849[_0x048a('0x155')]]){this['actions'][_0x474849[_0x048a('0x155')]][_0x048a('0x149')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x513053){if(_0x513053){if(this[_0x048a('0x14')][_0x513053[_0x048a('0x156')]]){this[_0x048a('0x14')][_0x513053[_0x048a('0x156')]]['transfer']=!![];}}};module[_0x048a('0x157')]=Preview;
\ No newline at end of file
+var _0x716c=['originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','Action','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:agentconnect','accountcode','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','exports','util','lodash','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','abandoned','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','syncCampaigns','booked','type','clearZombieChannels','hasOwnProperty','dialActive','setMessage','recallMe','sequence','queue','originated:\x20','originated','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','clearZombieChannel','agentReadyId','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','createCustomerHistory','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','then','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','buildObj','connect','acw','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','unlockAgent','CONGESTION','outboundCongestionCallsDay','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','object','isUndefined','reason','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','run','execRun','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x716c,0x18e));var _0xc716=function(_0xd73c06,_0x442578){_0xd73c06=_0xd73c06-0x0;var _0x55b164=_0x716c[_0xd73c06];return _0x55b164;};'use strict';var util=require(_0xc716('0x0'));var _=require(_0xc716('0x1'));var BPromise=require('bluebird');var uuid=require(_0xc716('0x2'));var moment=require(_0xc716('0x3'));var md5=require(_0xc716('0x4'));var Redis=require('ioredis');var config=require(_0xc716('0x5'));var logger=require(_0xc716('0x6'))(_0xc716('0x7'));var loggerAction=require(_0xc716('0x6'))(_0xc716('0x8'));var ami=require(_0xc716('0x9'));var rpcDb=require(_0xc716('0xa'));var cmHopperAdditionalPhone=require(_0xc716('0xb'));var Action=require(_0xc716('0xc'));var ut=require(_0xc716('0xd'));config[_0xc716('0xe')]=_['defaults'](config[_0xc716('0xe')],{'host':_0xc716('0xf'),'port':0x18eb});var io=require(_0xc716('0x10'))(new Redis(config[_0xc716('0xe')]));var Sequence=function(){};Sequence[_0xc716('0x11')][_0xc716('0x12')]=function(_0xd6e7a1){this['tail']=this[_0xc716('0x13')]?this[_0xc716('0x13')][_0xc716('0x14')](_0xd6e7a1):_0xd6e7a1();};function Preview(_0x56302b){this['sequence']=new Sequence();this[_0xc716('0x15')]=_0x56302b[_0xc716('0x16')];this[_0xc716('0x17')]=_0x56302b[_0xc716('0x17')];this[_0xc716('0x18')]={};this[_0xc716('0x19')]=_0x56302b['agents'];this[_0xc716('0x1a')]=0x0;ami['on'](_0xc716('0x1b'),this[_0xc716('0x1c')]['bind'](this));ami['on']('hangup',this[_0xc716('0x1d')][_0xc716('0x1e')](this));ami['on'](_0xc716('0x1f'),this[_0xc716('0x20')][_0xc716('0x1e')](this));ami['on'](_0xc716('0x21'),this[_0xc716('0x22')][_0xc716('0x1e')](this));ami['on'](_0xc716('0x23'),this[_0xc716('0x24')][_0xc716('0x1e')](this));ami['on'](_0xc716('0x25'),this[_0xc716('0x26')][_0xc716('0x1e')](this));ami['on'](_0xc716('0x27'),this['syncAttendedTransfer'][_0xc716('0x1e')](this));ami['on'](_0xc716('0x28'),this[_0xc716('0x29')]['bind'](this));this[_0xc716('0x2a')](this[_0xc716('0x15')]);}function emit(_0xbb3a39,_0x303df7,_0x13f9b2){io['to'](_0xbb3a39)[_0xc716('0x2b')](_0x303df7,_0x13f9b2);}function emitCampaignPreview(_0x5ce2c3){if(_0x5ce2c3['type']===_0xc716('0x2c')){var _0x16a1ff={'id':_0x5ce2c3['id'],'name':_0x5ce2c3[_0xc716('0x2d')],'strategy':_0x5ce2c3[_0xc716('0x2e')],'answered':_0x5ce2c3[_0xc716('0x2f')],'available':_0x5ce2c3[_0xc716('0x30')],'loggedIn':_0x5ce2c3[_0xc716('0x31')],'pTalking':_0x5ce2c3[_0xc716('0x32')],'sumBillable':_0x5ce2c3[_0xc716('0x33')],'sumDuration':_0x5ce2c3['sumDuration'],'sumHoldTime':_0x5ce2c3[_0xc716('0x34')]||0x0,'talking':_0x5ce2c3[_0xc716('0x35')],'total':_0x5ce2c3[_0xc716('0x36')],'type':_0x5ce2c3['type'],'unmanaged':_0x5ce2c3['unmanaged'],'abandoned':_0x5ce2c3[_0xc716('0x37')],'waiting':_0x5ce2c3[_0xc716('0x38')],'loggedInDb':_0x5ce2c3['loggedInDb'],'dialActive':_0x5ce2c3['dialActive'],'dialMethod':_0x5ce2c3[_0xc716('0x39')],'dialOriginateCallerIdName':_0x5ce2c3[_0xc716('0x3a')],'dialOriginateCallerIdNumber':_0x5ce2c3[_0xc716('0x3b')],'dialOriginateTimeout':_0x5ce2c3[_0xc716('0x3c')],'dialPrefix':_0x5ce2c3['dialPrefix'],'outboundAnswerAgiCallsDay':_0x5ce2c3['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5ce2c3[_0xc716('0x3d')],'outboundBlacklistCallsDay':_0x5ce2c3['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5ce2c3[_0xc716('0x3e')],'outboundCongestionCallsDay':_0x5ce2c3['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x5ce2c3[_0xc716('0x3f')],'outboundDropCallsDayCallersExit':_0x5ce2c3[_0xc716('0x40')],'outboundDropCallsDayTimeout':_0x5ce2c3[_0xc716('0x41')],'outboundNoAnswerCallsDay':_0x5ce2c3['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x5ce2c3[_0xc716('0x42')],'outboundOriginateFailureCallsDay':_0x5ce2c3[_0xc716('0x43')],'outboundReCallsDay':_0x5ce2c3['outboundReCallsDay'],'outboundRejectCallsDay':_0x5ce2c3[_0xc716('0x44')],'outboundUnknownCallsDay':_0x5ce2c3[_0xc716('0x45')],'outboundAbandonedCallsDay':_0x5ce2c3[_0xc716('0x46')],'predictiveIntervalAnsweredCalls':_0x5ce2c3['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5ce2c3['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x5ce2c3['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5ce2c3[_0xc716('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x5ce2c3[_0xc716('0x48')],'predictiveIntervalErlangCalls':_0x5ce2c3[_0xc716('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x5ce2c3['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x5ce2c3[_0xc716('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x5ce2c3[_0xc716('0x4b')],'predictiveIntervalPauses':_0x5ce2c3[_0xc716('0x4c')],'predictiveIntervalAvailable':_0x5ce2c3[_0xc716('0x4d')],'predictiveIntervalTotalCalls':_0x5ce2c3[_0xc716('0x4e')],'message':_0x5ce2c3[_0xc716('0x4f')],'originated':_0x5ce2c3['originated'],'erlangCalls':_0x5ce2c3['erlangCalls'],'erlangCallToSecond':_0x5ce2c3[_0xc716('0x50')],'erlangAbandonmentRate':_0x5ce2c3['erlangAbandonmentRate'],'erlangBusyFactor':_0x5ce2c3[_0xc716('0x51')],'startPredictive':_0x5ce2c3[_0xc716('0x52')],'startProgressive':_0x5ce2c3[_0xc716('0x53')]};if(_0x5ce2c3['Trunk']){_0x16a1ff[_0xc716('0x54')]={'id':_0x5ce2c3[_0xc716('0x54')]['id'],'name':_0x5ce2c3[_0xc716('0x54')][_0xc716('0x2d')],'active':_0x5ce2c3['Trunk'][_0xc716('0x55')],'callerid':_0x5ce2c3[_0xc716('0x54')][_0xc716('0x56')]};}if(_0x5ce2c3[_0xc716('0x57')]){_0x16a1ff['Interval']={'id':_0x5ce2c3['Interval']['id'],'name':_0x5ce2c3[_0xc716('0x57')]['name']};}var _0x36073f=md5(JSON[_0xc716('0x58')](_0x16a1ff));if(_0x5ce2c3[_0xc716('0x4')]!==_0x36073f){_0x5ce2c3[_0xc716('0x4')]=_0x36073f;emit(util[_0xc716('0x59')](_0xc716('0x5a'),_0x16a1ff[_0xc716('0x2d')]),'voice_queue:save',_0x16a1ff);}}}function emitVoiceQueueChannelRemove(_0x36d077){logger[_0xc716('0x5b')](_0xc716('0x5c'),JSON[_0xc716('0x58')](_0x36d077));emit(util[_0xc716('0x59')](_0xc716('0x5a'),_0x36d077[_0xc716('0x2d')]),_0xc716('0x5d'),_0x36d077);io[_0xc716('0x2b')](_0xc716('0x5e'),_0x36d077);}function notSendMessagesQueue(_0x1b097f){if(_0x1b097f[_0xc716('0x5f')]){if(_0x1b097f['originated']===0x0&&_0x1b097f['pTalking']===0x0){_0x1b097f[_0xc716('0x5f')]=![];_0x1b097f[_0xc716('0x30')]=0x0;_0x1b097f[_0xc716('0x60')]=0x0;_0x1b097f['message']='NOT_ACTIVE';ut['logger'](_0xc716('0x61'),_0x1b097f[_0xc716('0x2d')]+'\x20is\x20not\x20active');}else{_0x1b097f['message']=_0xc716('0x62');ut[_0xc716('0x63')](_0xc716('0x61'),_0x1b097f['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x1b097f);}}Preview[_0xc716('0x11')][_0xc716('0x2a')]=function(){var _0x1ccc18=this;setInterval(function(){_0x1ccc18['syncCampaigns']();},0x7cf);};Preview[_0xc716('0x11')][_0xc716('0x64')]=function(){var _0x36ca15=this['campaignsPreview'];this[_0xc716('0x1a')]+=0x1;for(var _0x465301 in _0x36ca15){if(_0x36ca15['hasOwnProperty'](_0x465301)&&(_0x36ca15[_0x465301][_0xc716('0x39')]===_0xc716('0x7')||_0x36ca15[_0x465301]['dialMethod']===_0xc716('0x65'))&&_0x36ca15[_0x465301][_0xc716('0x66')]===_0xc716('0x2c')){if(this[_0xc716('0x1a')]>0x7){this[_0xc716('0x1a')]=0x0;this[_0xc716('0x67')]();}}if(_0x36ca15[_0xc716('0x68')](_0x465301)&&_0x36ca15[_0x465301][_0xc716('0x39')]===_0xc716('0x7')&&_0x36ca15[_0x465301][_0xc716('0x66')]===_0xc716('0x2c')){if(_0x36ca15[_0x465301][_0xc716('0x69')]){this[_0xc716('0x6a')](_0x36ca15[_0x465301]);this[_0xc716('0x6b')](_0x36ca15[_0x465301]);}else{notSendMessagesQueue(_0x36ca15[_0x465301]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x4d5e13){var _0xf41046=this;this[_0xc716('0x6c')][_0xc716('0x12')](function(){if(!_['isNil'](_0xf41046[_0xc716('0x18')][_0x4d5e13])){loggerAction[_0xc716('0x5b')]('[clearZombieChannels][talking]',_0x4d5e13,'Queue',_0xf41046[_0xc716('0x18')][_0x4d5e13][_0xc716('0x6d')],_0xc716('0x6e'),JSON[_0xc716('0x58')](_0xf41046[_0xc716('0x15')][_0xf41046['actions'][_0x4d5e13][_0xc716('0x6d')]][_0xc716('0x6f')]),_0xc716('0x70'),JSON['stringify'](_0xf41046['campaignsPreview'][_0xf41046[_0xc716('0x18')][_0x4d5e13][_0xc716('0x6d')]][_0xc716('0x32')]),JSON[_0xc716('0x58')](_0xf41046[_0xc716('0x18')][_0x4d5e13]['dialAnswer']),JSON[_0xc716('0x58')](_[_0xc716('0x71')](_0xf41046[_0xc716('0x18')][_0x4d5e13],[_0xc716('0x72'),_0xc716('0x73'),_0xc716('0x74'),_0xc716('0x75')])));return ami['Action']({'action':_0xc716('0x76'),'channel':_0xf41046[_0xc716('0x18')][_0x4d5e13][_0xc716('0x77')]})[_0xc716('0x78')](function(_0x46211b){if(_0x46211b[_0xc716('0x4f')]===_0xc716('0x79')){setTimeout(function(){if(_0xf41046[_0xc716('0x18')][_0x4d5e13]){ut[_0xc716('0x7a')](_0xf41046[_0xc716('0x15')][_0xf41046[_0xc716('0x18')][_0x4d5e13][_0xc716('0x6d')]],_0xc716('0x7b'));if(_0xf41046[_0xc716('0x18')][_0x4d5e13][_0xc716('0x7c')]===!![]){ut[_0xc716('0x7d')](_0xf41046[_0xc716('0x15')][_0xf41046[_0xc716('0x18')][_0x4d5e13][_0xc716('0x6d')]],_0xc716('0x7b'));ut[_0xc716('0x7e')](_0xc716('0x7f')+_0x4d5e13,_0xf41046[_0xc716('0x18')][_0x4d5e13][_0xc716('0x6d')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x4d5e13,_0xf41046[_0xc716('0x18')][_0x4d5e13][_0xc716('0x6d')]);delete _0xf41046['actions'][_0x4d5e13];}},0x2328);}});}});};Preview['prototype'][_0xc716('0x67')]=function(){var _0xb08cb9=this;loggerAction[_0xc716('0x5b')](_0xc716('0x80'),_[_0xc716('0x81')](this['actions']));for(var _0x46f78d in this['actions']){if(_0xb08cb9[_0xc716('0x18')][_0xc716('0x68')](_0x46f78d)){_0xb08cb9[_0xc716('0x82')](_0x46f78d);}}};Preview['prototype'][_0xc716('0x6b')]=function(_0x1bd050){var _0x1a0400=this;rpcDb['getContactRecallMe'](_0x1bd050['id'],ut[_0xc716('0x83')](this[_0xc716('0x19')]))['then'](function(_0x1632ae){if(!_[_0xc716('0x84')](_0x1632ae)){for(var _0x1c043b=0x0;_0x1c043b<_0x1632ae[_0xc716('0x85')];_0x1c043b+=0x1){if(ut[_0xc716('0x86')](_0x1632ae[_0x1c043b][_0xc716('0x87')])<_0x1bd050[_0xc716('0x88')]*0x3c){if(_0x1632ae[_0x1c043b][_0xc716('0x89')]&&!_0x1632ae[_0x1c043b]['Agent'][_0xc716('0x8a')]){_0x1a0400['run'](_0x1632ae[_0x1c043b]['id'])['then'](ut[_0xc716('0x8b')](_0xc716('0x8c')))[_0xc716('0x78')](ut[_0xc716('0x8b')](_0xc716('0x8c')));}else{rpcDb[_0xc716('0x8d')](_0x1632ae[_0x1c043b]['id']);}}else{var _0x45e1e1=new Action(_0x1632ae[_0x1c043b],_0x1bd050);_0x45e1e1[_0xc716('0x8e')]=moment()[_0xc716('0x59')](_0xc716('0x8f'));_0x1bd050[_0xc716('0x90')]+=0x1;ut[_0xc716('0x91')](_0x45e1e1,0x17,_0xc716('0x92'));if(_0x1bd050['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xc716('0x93')](_0x1632ae[_0x1c043b]));rpcDb['createCustomerHistory'](_0x45e1e1,_0xc716('0x94'));}else{ut[_0xc716('0x91')](_0x45e1e1,0x16,_0xc716('0x95'));rpcDb['createCustomerHistory'](_0x45e1e1,_0xc716('0x96'));rpcDb[_0xc716('0x97')](_0x45e1e1,_0xc716('0x96'));}}}}})[_0xc716('0x78')](ut['logger2'](_0xc716('0x98')));};Preview[_0xc716('0x11')][_0xc716('0x6a')]=function(_0x2421bd){_0x2421bd[_0xc716('0x5f')]=!![];if(ut[_0xc716('0x99')](_0x2421bd[_0xc716('0x31')])){_0x2421bd[_0xc716('0x4f')]=_0xc716('0x9a');}else if(!ut[_0xc716('0x9b')](_0x2421bd[_0xc716('0x69')])){_0x2421bd['message']='NOT_ACTIVE';}else if(!this['isTrunkReachable'](_0x2421bd[_0xc716('0x54')])){if(!this[_0xc716('0x9c')](_0x2421bd[_0xc716('0x9d')])){_0x2421bd[_0xc716('0x4f')]=_0xc716('0x9e');}else{_0x2421bd['message']=_0xc716('0x9f');}}else{_0x2421bd[_0xc716('0x4f')]=_0xc716('0x9f');}emitCampaignPreview(_0x2421bd);};Preview['prototype'][_0xc716('0xa0')]=function(_0x13892c,_0x12b9cf,_0x332e4c){var _0x47ebfe=this;var _0x39f8e8=this[_0xc716('0x18')][_0x12b9cf];var _0x40f4b2=this[_0xc716('0x15')][_0x39f8e8[_0xc716('0x6d')]];var _0x1b5102;var _0x23fd25=![];var _0x1ac5cd=0x2;var _0x17a24a=0x3;if(_0x40f4b2){switch(_0x332e4c){case'1':_0x40f4b2[_0xc716('0x42')]+=0x1;_0x39f8e8[_0xc716('0xa1')]+=0x1;_0x39f8e8[_0xc716('0xa2')]=ut[_0xc716('0xa3')](_0x39f8e8);ut['logCustomer'](_0x39f8e8,0x0,'NoSuchNumber');ami[_0xc716('0x2b')](_0xc716('0xa4'),ut['buildObj'](_0x39f8e8,_0xc716('0xa5')));rpcDb[_0xc716('0xa6')](_0x39f8e8,_0xc716('0xa7'));_0x47ebfe[_0xc716('0xa8')](_0x39f8e8,'0',_0x40f4b2)[_0xc716('0xa9')](function(_0x5e17fa){_0x23fd25=_0x5e17fa[_0xc716('0xaa')]==0x1;_0x1ac5cd=_0x40f4b2['dialNoSuchNumberRetryFrequency'];_0x17a24a=_0x40f4b2[_0xc716('0xab')];if(!_0x23fd25){if(ut['totalGlobal'](_0x39f8e8)>=_0x40f4b2[_0xc716('0xac')]){_0x1b5102=ut[_0xc716('0xad')](_0x39f8e8,0xf,_0xc716('0xae'));rpcDb[_0xc716('0x97')](_0x1b5102,_0xc716('0xaf'));}else{if(_0x39f8e8[_0xc716('0xa1')]>=_0x40f4b2['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x39f8e8,_0xc716('0xaf'));}else{rpcDb[_0xc716('0xb0')](ut[_0xc716('0xb1')](_0x39f8e8,_0xc716('0xa1'),_0x40f4b2[_0xc716('0xb2')]),_0x39f8e8['unlockAgent'],_0x39f8e8[_0xc716('0xb3')]);}}delete this[_0xc716('0x18')][_0x13892c[_0xc716('0xb4')]];}else{_0x39f8e8[_0xc716('0xa1')]++;logger['info'](_0xc716('0xb5'),_0x39f8e8[_0xc716('0xa1')]);logger[_0xc716('0x5b')]('id',_0x39f8e8[_0xc716('0xb6')]);_0x47ebfe[_0xc716('0xb7')]({'id':_0x39f8e8[_0xc716('0xb6')],'field':{'countnosuchnumberretry':_0x39f8e8['countnosuchnumberretry']}})[_0xc716('0xa9')](function(){_0x47ebfe[_0xc716('0xb8')](_0x39f8e8,_0x1ac5cd,_0x17a24a)[_0xc716('0xa9')](function(){});});}});break;case _0xc716('0xb9'):var _0x309326=moment()[_0xc716('0x59')](_0xc716('0x8f'));_0x39f8e8[_0xc716('0xba')]=_0x309326;_0x39f8e8[_0xc716('0xbb')]=_0x309326;_0x39f8e8[_0xc716('0x7c')]=!![];_0x40f4b2[_0xc716('0x32')]+=0x1;logger[_0xc716('0x5b')](_0xc716('0xbc'),_0x39f8e8[_0xc716('0xbd')],'\x20Queue',_0x40f4b2[_0xc716('0x2d')],_0xc716('0x70'),_0x40f4b2[_0xc716('0x32')]);ami[_0xc716('0x2b')](_0xc716('0xbe'),ut[_0xc716('0xbf')](_0x39f8e8,_0xc716('0xc0'),this['campaignsPreview'][_0x39f8e8[_0xc716('0x6d')]]));if(_0x40f4b2[_0xc716('0xc1')]){ami[_0xc716('0x2b')]('custom:agentConnectPreview',ut[_0xc716('0xc2')](_0x39f8e8));}break;case'16':ami[_0xc716('0x2b')](_0xc716('0xc3'),ut[_0xc716('0xbf')](_0x39f8e8,'complete',this[_0xc716('0x15')][_0x39f8e8['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x39f8e8,_0xc716('0xc4')));_0x40f4b2[_0xc716('0x3d')]+=0x1;_0x40f4b2[_0xc716('0x36')]+=0x1;_0x40f4b2[_0xc716('0x2f')]+=0x1;ut['decrementTalkink'](_0x40f4b2,_0xc716('0xc5'));_0x39f8e8[_0xc716('0xa2')]=ut[_0xc716('0xa3')](_0x39f8e8);ut[_0xc716('0x91')](_0x39f8e8,0x4,_0xc716('0xc6'));rpcDb[_0xc716('0xa6')](_0x39f8e8,_0xc716('0xc7'));rpcDb[_0xc716('0x97')](_0x39f8e8,_0xc716('0xc8'));rpcDb[_0xc716('0xc9')](_0x39f8e8);_0x40f4b2['sumDuration']+=_0x39f8e8[_0xc716('0xca')];_0x40f4b2[_0xc716('0x33')]+=_0x39f8e8[_0xc716('0xca')];logger['info'](_0xc716('0xcb'),_0x39f8e8['uniqueid'],_0xc716('0xcc'),_0x40f4b2[_0xc716('0x2d')],'pTalking:\x20',_0x40f4b2[_0xc716('0x32')]);delete this[_0xc716('0x18')][_0x13892c[_0xc716('0xb4')]];break;case _0xc716('0xcd'):_0x40f4b2['outboundBusyCallsDay']+=0x1;_0x39f8e8[_0xc716('0xce')]+=0x1;_0x39f8e8[_0xc716('0xa2')]=ut[_0xc716('0xa3')](_0x39f8e8);ut[_0xc716('0x91')](_0x39f8e8,0x5,_0xc716('0xcf'));_0x1ac5cd=_0x40f4b2[_0xc716('0xd0')];_0x17a24a=_0x40f4b2[_0xc716('0xab')];ami['emit'](_0xc716('0xd1'),ut[_0xc716('0xbf')](_0x39f8e8,_0xc716('0xd2')));rpcDb['createCustomerHistory'](_0x39f8e8,'[callProgressDetectingCustomer][logBusy]');_0x47ebfe[_0xc716('0xa8')](_0x39f8e8,'5',_0x40f4b2)[_0xc716('0xa9')](function(_0x1a5399){_0x23fd25=_0x1a5399[_0xc716('0xaa')]==0x1;if(!_0x23fd25){if(ut[_0xc716('0xa3')](_0x39f8e8)>=_0x40f4b2[_0xc716('0xac')]){_0x1b5102=ut[_0xc716('0xad')](_0x39f8e8,0xf,_0xc716('0xae'));rpcDb[_0xc716('0x97')](_0x1b5102,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x39f8e8[_0xc716('0xce')]>=_0x40f4b2[_0xc716('0xd3')]){rpcDb[_0xc716('0x97')](_0x39f8e8,_0xc716('0xd4'));}else{rpcDb[_0xc716('0xb0')](ut[_0xc716('0xb1')](_0x39f8e8,_0xc716('0xce'),_0x40f4b2[_0xc716('0xd0')]),_0x39f8e8['unlockAgent'],_0x39f8e8[_0xc716('0xb3')]);}}}else{_0x39f8e8[_0xc716('0xce')]++;_0x47ebfe['incrementPreviewCounters']({'id':_0x39f8e8[_0xc716('0xb6')],'field':{'countbusyretry':_0x39f8e8['countbusyretry']}})[_0xc716('0xa9')](function(){_0x47ebfe['swapAdditionalPhones'](_0x39f8e8,_0x1ac5cd,_0x17a24a)[_0xc716('0xa9')](function(){});});}});break;case'NOANSWER':_0x40f4b2['outboundNoAnswerCallsDay']+=0x1;_0x39f8e8['countnoanswerretry']+=0x1;_0x39f8e8[_0xc716('0xa2')]=ut['totalGlobal'](_0x39f8e8);ut[_0xc716('0x91')](_0x39f8e8,0x3,'NoAnswer');_0x1ac5cd=_0x40f4b2[_0xc716('0xd5')];_0x17a24a=_0x40f4b2[_0xc716('0xab')];ami[_0xc716('0x2b')](_0xc716('0xd6'),ut[_0xc716('0xbf')](_0x39f8e8,_0xc716('0xd7')));rpcDb[_0xc716('0xa6')](_0x39f8e8,_0xc716('0xd8'));_0x47ebfe[_0xc716('0xa8')](_0x39f8e8,'3',_0x40f4b2)[_0xc716('0xa9')](function(_0x44eadf){_0x23fd25=_0x44eadf[_0xc716('0xaa')]==0x1;if(!_0x23fd25){if(ut[_0xc716('0xa3')](_0x39f8e8)>=_0x40f4b2[_0xc716('0xac')]){_0x1b5102=ut[_0xc716('0xad')](_0x39f8e8,0xf,_0xc716('0xae'));rpcDb['createCustomerFinal'](_0x1b5102,_0xc716('0xd9'));}else{if(_0x39f8e8[_0xc716('0xda')]>=_0x40f4b2['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x39f8e8,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xc716('0xb0')](ut['scheduledAt'](_0x39f8e8,_0xc716('0xda'),_0x40f4b2[_0xc716('0xd5')]),_0x39f8e8[_0xc716('0xdb')],_0x39f8e8[_0xc716('0xb3')]);}}}else{_0x39f8e8[_0xc716('0xda')]++;_0x47ebfe['incrementPreviewCounters']({'id':_0x39f8e8[_0xc716('0xb6')],'field':{'countnoanswerretry':_0x39f8e8['countnoanswerretry']}})[_0xc716('0xa9')](function(){_0x47ebfe[_0xc716('0xb8')](_0x39f8e8,_0x1ac5cd,_0x17a24a)[_0xc716('0xa9')](function(){});});}});break;case _0xc716('0xdc'):_0x40f4b2[_0xc716('0xdd')]+=0x1;_0x39f8e8[_0xc716('0xde')]+=0x1;_0x39f8e8['countglobal']=ut[_0xc716('0xa3')](_0x39f8e8);ut[_0xc716('0x91')](_0x39f8e8,0x8,'Congestion');_0x1ac5cd=_0x40f4b2[_0xc716('0xdf')];_0x17a24a=_0x40f4b2[_0xc716('0xab')];ami[_0xc716('0x2b')]('custom:agentcongestion',ut[_0xc716('0xbf')](_0x39f8e8,_0xc716('0xe0')));rpcDb['createCustomerHistory'](_0x39f8e8,_0xc716('0xe1'));_0x47ebfe[_0xc716('0xa8')](_0x39f8e8,'8',_0x40f4b2)['then'](function(_0x1f73e3){_0x23fd25=_0x1f73e3[_0xc716('0xaa')]==0x1;if(!_0x23fd25){if(ut[_0xc716('0xa3')](_0x39f8e8)>=_0x40f4b2['dialGlobalMaxRetry']){_0x1b5102=ut[_0xc716('0xad')](_0x39f8e8,0xf,_0xc716('0xae'));rpcDb[_0xc716('0x97')](_0x1b5102,_0xc716('0xe2'));}else{if(_0x39f8e8[_0xc716('0xde')]>=_0x40f4b2[_0xc716('0xe3')]){rpcDb['createCustomerFinal'](_0x39f8e8,_0xc716('0xe1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x39f8e8,'countcongestionretry',_0x40f4b2[_0xc716('0xd0')]),_0x39f8e8[_0xc716('0xdb')],_0x39f8e8[_0xc716('0xb3')]);}}}else{_0x39f8e8[_0xc716('0xde')]++;_0x47ebfe['incrementPreviewCounters']({'id':_0x39f8e8[_0xc716('0xb6')],'field':{'countcongestionretry':_0x39f8e8[_0xc716('0xde')]}})['then'](function(){_0x47ebfe[_0xc716('0xb8')](_0x39f8e8,_0x1ac5cd,_0x17a24a)[_0xc716('0xa9')](function(){});});}});break;case _0xc716('0xe4'):_0x40f4b2[_0xc716('0x44')]+=0x1;_0x39f8e8['countagentrejectretry']+=0x1;_0x39f8e8[_0xc716('0xa2')]=ut['totalGlobal'](_0x39f8e8);ut[_0xc716('0x91')](_0x39f8e8,0x14,_0xc716('0xe5'));_0x1ac5cd=_0x40f4b2['dialAgentRejectRetryFrequency'];_0x17a24a=_0x40f4b2[_0xc716('0xab')];ami[_0xc716('0x2b')](_0xc716('0xe6'),ut[_0xc716('0xbf')](_0x39f8e8,_0xc716('0xe7')));rpcDb[_0xc716('0xa6')](_0x39f8e8,'[syncHangupRequest][logAgentReject]');_0x47ebfe[_0xc716('0xa8')](_0x39f8e8,'20',_0x40f4b2)[_0xc716('0xa9')](function(_0x2c358e){_0x23fd25=_0x2c358e[_0xc716('0xaa')]==0x1;if(!_0x23fd25){if(ut[_0xc716('0xa3')](_0x39f8e8)>=_0x40f4b2[_0xc716('0xac')]){_0x1b5102=ut[_0xc716('0xad')](_0x39f8e8,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x1b5102,_0xc716('0xe8'));}else{if(_0x39f8e8[_0xc716('0xe9')]>=_0x40f4b2[_0xc716('0xea')]){rpcDb[_0xc716('0x97')](_0x39f8e8,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xc716('0xb0')](ut[_0xc716('0xb1')](_0x39f8e8,_0xc716('0xe9'),_0x40f4b2[_0xc716('0xeb')]),_0x39f8e8[_0xc716('0xdb')],_0x39f8e8[_0xc716('0xb3')]);}}}else{_0x39f8e8[_0xc716('0xda')]++;_0x47ebfe['incrementPreviewCounters']({'id':_0x39f8e8[_0xc716('0xb6')],'field':{'countnoanswerretry':_0x39f8e8[_0xc716('0xda')]}})[_0xc716('0xa9')](function(){_0x47ebfe['swapAdditionalPhones'](_0x39f8e8,_0x1ac5cd,_0x17a24a)[_0xc716('0xa9')](function(){});});}});break;case _0xc716('0xec'):_0x40f4b2[_0xc716('0x46')]+=0x1;_0x39f8e8[_0xc716('0xed')]+=0x1;_0x39f8e8[_0xc716('0xa2')]=ut[_0xc716('0xa3')](_0x39f8e8);ut[_0xc716('0x91')](_0x39f8e8,0xb,_0xc716('0xee'));rpcDb['createCustomerHistory'](_0x39f8e8,_0xc716('0xef'));_0x47ebfe[_0xc716('0xa8')](_0x39f8e8,'11',_0x40f4b2)[_0xc716('0xa9')](function(_0x5adf65){_0x23fd25=_0x5adf65[_0xc716('0xaa')]==0x1;if(!_0x23fd25){if(ut['totalGlobal'](_0x39f8e8)>=_0x40f4b2[_0xc716('0xac')]){_0x1b5102=ut[_0xc716('0xad')](_0x39f8e8,0xf,_0xc716('0xae'));rpcDb[_0xc716('0x97')](_0x1b5102,_0xc716('0xef'));}else{if(_0x39f8e8[_0xc716('0xf0')]>=_0x40f4b2[_0xc716('0xf1')]){rpcDb[_0xc716('0x97')](_0x39f8e8,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xc716('0xb0')](ut[_0xc716('0xb1')](_0x39f8e8,'countabandonedretry',_0x40f4b2['dialAbandonedRetryFrequency']),_0x39f8e8['unlockAgent'],_0x39f8e8[_0xc716('0xb3')]);}}}else{_0x39f8e8[_0xc716('0xda')]++;_0x47ebfe[_0xc716('0xb7')]({'id':_0x39f8e8[_0xc716('0xb6')],'field':{'countnoanswerretry':_0x39f8e8[_0xc716('0xda')]}})[_0xc716('0xa9')](function(){_0x47ebfe[_0xc716('0xb8')](_0x39f8e8,_0x1ac5cd,_0x17a24a)[_0xc716('0xa9')](function(){});});}});break;case'18':_0x40f4b2['outboundUnknownCallsDay']+=0x1;_0x39f8e8['countmachineretry']+=0x1;_0x39f8e8['countglobal']=ut[_0xc716('0xa3')](_0x39f8e8);ut[_0xc716('0x91')](_0x39f8e8,0x12,_0x13892c[_0xc716('0xf2')]||_0x13892c[_0xc716('0xf3')]);ami['emit'](_0xc716('0xf4'),ut[_0xc716('0xbf')](_0x39f8e8,_0xc716('0xf5')));rpcDb['createCustomerHistory'](_0x39f8e8,_0xc716('0xf6'));_0x47ebfe[_0xc716('0xa8')](_0x39f8e8,'18',_0x40f4b2)[_0xc716('0xa9')](function(_0x1143b5){_0x23fd25=_0x1143b5[_0xc716('0xaa')]==0x1;if(!_0x23fd25){if(ut[_0xc716('0xa3')](_0x39f8e8)>=_0x40f4b2[_0xc716('0xac')]){_0x1b5102=ut[_0xc716('0xad')](_0x39f8e8,0x12,_0xc716('0xae'));rpcDb['createCustomerFinal'](_0x1b5102,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xc716('0x97')](_0x39f8e8,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x39f8e8['countnoanswerretry']++;_0x47ebfe[_0xc716('0xb7')]({'id':_0x39f8e8['idContact'],'field':{'countnoanswerretry':_0x39f8e8[_0xc716('0xda')]}})[_0xc716('0xa9')](function(){_0x47ebfe[_0xc716('0xb8')](_0x39f8e8,_0x1ac5cd,_0x17a24a)[_0xc716('0xa9')](function(){});});}});delete this[_0xc716('0x18')][_0x13892c['linkedid']];break;case'19':_0x40f4b2[_0xc716('0x45')]+=0x1;_0x39f8e8[_0xc716('0xa2')]=ut[_0xc716('0xa3')](_0x39f8e8);ut[_0xc716('0x91')](_0x39f8e8,0x13,_0x13892c[_0xc716('0xf2')]||_0x13892c[_0xc716('0xf3')]);ami['emit'](_0xc716('0xf4'),ut[_0xc716('0xbf')](_0x39f8e8,'amd'));rpcDb['createCustomerHistory'](_0x39f8e8,_0xc716('0xf7'));_0x47ebfe['verifyAdditionalPhones'](_0x39f8e8,'18',_0x40f4b2)[_0xc716('0xa9')](function(_0x3bbb6e){_0x23fd25=_0x3bbb6e[_0xc716('0xaa')]==0x1;if(!_0x23fd25){if(ut[_0xc716('0xa3')](_0x39f8e8)>=_0x40f4b2[_0xc716('0xac')]){_0x1b5102=ut[_0xc716('0xad')](_0x39f8e8,0xf,_0xc716('0xae'));rpcDb[_0xc716('0x97')](_0x1b5102,_0xc716('0xf7'));}else{rpcDb[_0xc716('0x97')](_0x39f8e8,_0xc716('0xf7'));}}else{_0x39f8e8[_0xc716('0xda')]++;_0x47ebfe[_0xc716('0xb7')]({'id':_0x39f8e8[_0xc716('0xb6')],'field':{'countnoanswerretry':_0x39f8e8[_0xc716('0xda')]}})['then'](function(){_0x47ebfe[_0xc716('0xb8')](_0x39f8e8,_0x1ac5cd,_0x17a24a)[_0xc716('0xa9')](function(){});});}});delete this[_0xc716('0x18')][_0x13892c[_0xc716('0xb4')]];break;default:if(_0x39f8e8[_0xc716('0x7c')]){ut['decrementTalkink'](_0x40f4b2,_0xc716('0xf8'));ut[_0xc716('0x7e')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x40f4b2[_0xc716('0x2d')],_0x13892c);}_0x40f4b2[_0xc716('0x45')]+=0x1;_0x39f8e8['countglobal']=ut[_0xc716('0xa3')](_0x39f8e8);ut[_0xc716('0x91')](_0x39f8e8,0xc,_0x13892c[_0xc716('0xf2')]||_0x13892c[_0xc716('0xf3')]);_0x1ac5cd=_0x40f4b2[_0xc716('0xeb')];_0x17a24a=_0x40f4b2[_0xc716('0xab')];rpcDb[_0xc716('0xa6')](_0x39f8e8,_0xc716('0xf9'));_0x47ebfe[_0xc716('0xa8')](_0x39f8e8,'20',_0x40f4b2)[_0xc716('0xa9')](function(_0x3191df){_0x23fd25=_0x3191df['additional']==0x1;if(!_0x23fd25){if(ut[_0xc716('0xa3')](_0x39f8e8)>=_0x40f4b2[_0xc716('0xac')]){_0x1b5102=ut[_0xc716('0xad')](_0x39f8e8,0xf,_0xc716('0xae'));rpcDb['createCustomerFinal'](_0x1b5102,_0xc716('0xfa'));}else{rpcDb[_0xc716('0x97')](_0x39f8e8,_0xc716('0xfa'));}delete this['actions'][_0x13892c['linkedid']];}else{_0x47ebfe[_0xc716('0xb8')](_0x39f8e8,_0x1ac5cd,_0x17a24a)['then'](function(_0x4c8ca6){});}});}if(!(_0x39f8e8['dialAnswer']&&_0x332e4c==='16')){ut[_0xc716('0x7a')](_0x40f4b2,_0xc716('0xfb'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x39f8e8[_0xc716('0xbd')],'\x20Queue',_0x40f4b2[_0xc716('0x2d')],_0xc716('0x6e'),_0x40f4b2[_0xc716('0x6f')]);}if(_0x332e4c!==_0xc716('0xb9')){delete this[_0xc716('0x18')][_0x13892c[_0xc716('0xb4')]];delete this[_0xc716('0x18')][_0x13892c[_0xc716('0xfc')]];}}};Preview[_0xc716('0x11')]['callProgressDetectingAgent']=function(_0x3d6aff,_0x41c938,_0x295212){if(_['isUndefined'](_0x41c938)&&_0xc716('0xfd')!==typeof _0x41c938){return;}if(_[_0xc716('0xfe')](_0x295212)&&'object'!==typeof _0x295212){return;}switch(_0x295212[_0xc716('0xff')]){case'0':ut[_0xc716('0x100')](_0x3d6aff,0x0,_0xc716('0x101'));rpcDb['createAgentHistory'](_0x3d6aff,_0xc716('0x102'));break;case'3':ut[_0xc716('0x100')](_0x3d6aff,0x3,_0xc716('0x103'));rpcDb[_0xc716('0x104')](_0x3d6aff,_0xc716('0x105'));break;case'5':ut['logAgent'](_0x3d6aff,0x5,_0xc716('0xcf'));rpcDb['createAgentHistory'](_0x3d6aff,_0xc716('0x106'));break;case'8':ut['logAgent'](_0x3d6aff,0x8,_0xc716('0x107'));rpcDb[_0xc716('0x104')](_0x3d6aff,_0xc716('0x108'));break;case'22':ut[_0xc716('0x100')](_0x3d6aff,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x3d6aff,_0xc716('0x109'));break;default:ut[_0xc716('0x100')](_0x3d6aff,0xc,_0x295212['reason']);rpcDb[_0xc716('0x104')](_0x3d6aff,'[callProgressDetectingAgent][logCongestion]');}ut[_0xc716('0x7a')](_0x41c938,_0xc716('0x10a'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x3d6aff[_0xc716('0xbd')],_0xc716('0xcc'),_0x41c938[_0xc716('0x2d')],'originated:\x20',_0x41c938[_0xc716('0x6f')]);delete this[_0xc716('0x18')][_0x3d6aff[_0xc716('0xbd')]];};Preview[_0xc716('0x11')]['verifyAdditionalPhones']=function(_0x34ffad,_0x56157b,_0x3b53f1){return BPromise[_0xc716('0x10b')]()[_0xc716('0xa9')](cmHopperAdditionalPhone[_0xc716('0xa8')](_0x34ffad,_0x56157b,_0x3b53f1))[_0xc716('0x78')](logger[_0xc716('0x5b')]('[verifyAdditionalPhone]\x20'));};Preview[_0xc716('0x11')][_0xc716('0xb8')]=function(_0x2c3dad,_0x43ae1e,_0x441ebf){return BPromise[_0xc716('0x10b')]()[_0xc716('0xa9')](cmHopperAdditionalPhone[_0xc716('0xb8')](_0x2c3dad,_0x43ae1e,_0x441ebf))[_0xc716('0x78')](logger[_0xc716('0x5b')]('[swapAdditionalPhone]\x20'));};Preview[_0xc716('0x11')][_0xc716('0xb7')]=function(_0x27dfb0){return BPromise['resolve']()['then'](cmHopperAdditionalPhone[_0xc716('0xb7')](_0x27dfb0))[_0xc716('0x78')](logger[_0xc716('0x5b')]('[incrementPreviewCounters]\x20'));};Preview[_0xc716('0x11')][_0xc716('0x10c')]=function(_0x1476c5,_0x5963ec,_0x2e81cb,_0x208e5f,_0x5687b7){var _0x250288=this;return new BPromise(function(_0x4ec9e0,_0x56963a){if(_[_0xc716('0x84')](_0x5963ec)||_[_0xc716('0x84')](_0x5963ec[_0xc716('0x10d')])||_[_0xc716('0x84')](_0x5963ec[_0xc716('0x10e')])||_[_0xc716('0x84')](_0x5963ec[_0xc716('0x74')])){_0x56963a(ut[_0xc716('0x4f')](_0xc716('0x10f'),_0x208e5f,_0x5687b7));return;}var _0x1ea1b5=uuid['v4']();var _0x618959=_0x250288[_0xc716('0x15')][_0x5963ec[_0xc716('0x110')]['name']];var _0x4143bc=_0x2e81cb?_0x250288[_0xc716('0x19')][_0x2e81cb]['id']:undefined;_0x250288['actions'][_0x1ea1b5]=new Action(_0x5963ec,_0x618959,_0x1ea1b5,_0x2e81cb,_0x4143bc);var _0x51ea85=_0x250288[_0xc716('0x18')][_0x1ea1b5];_0x51ea85[_0xc716('0xdb')]=_0x208e5f;_0x51ea85[_0xc716('0xb3')]=_0x5687b7;_0x51ea85[_0xc716('0x111')]=_0x2e81cb;if(_[_0xc716('0x112')](_0x1476c5)){_0x250288[_0xc716('0x113')](_0x51ea85,_0x618959,_0x5963ec,_0x2e81cb)[_0xc716('0xa9')](function(_0x2dea39){logger['info'](_0xc716('0x114'),_0xc716('0x115')+_0x51ea85[_0xc716('0x6d')]+_0xc716('0x116')+_0x51ea85[_0xc716('0xb6')],JSON[_0xc716('0x58')](_0x2dea39));ami[_0xc716('0x2b')](_0xc716('0x117'),ut['buildObj'](_0x51ea85,_0xc716('0x118'),_0x250288[_0xc716('0x15')][_0x51ea85[_0xc716('0x6d')]]));_0x4ec9e0(ut[_0xc716('0x4f')](_0xc716('0x119')));})[_0xc716('0x78')](function(_0x1879a9){ut[_0xc716('0x63')](_0xc716('0x11a'),_0x1879a9);_0x56963a(ut[_0xc716('0x4f')](_0xc716('0x11b'),_0x208e5f,_0x5687b7));});}else{_0x618959[_0xc716('0x11c')]+=0x1;ut[_0xc716('0x11d')](_0x51ea85);rpcDb[_0xc716('0x11e')](_0x51ea85,_0xc716('0x11f'));delete _0x250288[_0xc716('0x18')][_0x1ea1b5];_0x56963a(ut[_0xc716('0x4f')](_0xc716('0x120'),_0x208e5f,_0x5687b7));}});};Preview[_0xc716('0x11')][_0xc716('0x9c')]=function(_0x2266e4){return!_['isNil'](_0x2266e4)&&!_[_0xc716('0x84')](_0x2266e4[_0xc716('0x2d')])&&!_[_0xc716('0x84')](_0x2266e4[_0xc716('0x55')])&&_0x2266e4['active']&&!_['isNil'](this[_0xc716('0x17')][util[_0xc716('0x59')](_0xc716('0x121'),_0x2266e4[_0xc716('0x2d')])])&&!_['isNil'](this['trunks'][util[_0xc716('0x59')](_0xc716('0x121'),_0x2266e4[_0xc716('0x2d')])][_0xc716('0x76')])&&(this['trunks'][util['format'](_0xc716('0x121'),_0x2266e4[_0xc716('0x2d')])][_0xc716('0x76')]==='reachable'||this[_0xc716('0x17')][util[_0xc716('0x59')](_0xc716('0x121'),_0x2266e4['name'])]['status']==='unmonitored');};Preview[_0xc716('0x11')][_0xc716('0x122')]=function(_0x15e3de,_0x4acf5d){var _0x2d5ffd=this;return new BPromise(function(_0x1c394c,_0x1357cf){_0x2d5ffd[_0xc716('0x123')](_0x15e3de,_0x4acf5d)[_0xc716('0xa9')](function(_0xb4bec2){_0x1c394c(_['pick'](_0xb4bec2,['message']));})[_0xc716('0x78')](function(_0x5e2411){if(_0x5e2411['unlock']){rpcDb[_0xc716('0x124')](_0x15e3de);}if(_0x5e2411[_0xc716('0x55')]){rpcDb[_0xc716('0x8d')](_0x15e3de);}_0x1357cf(_[_0xc716('0x71')](_0x5e2411,[_0xc716('0x4f')]));});});};Preview[_0xc716('0x11')][_0xc716('0x123')]=function(_0x15c68a,_0x1195b2){var _0x54142d=this;return new BPromise(function(_0x119bb8,_0x347a9f){var _0x802865,_0x29c68b;rpcDb[_0xc716('0x125')](_0x15c68a)[_0xc716('0xa9')](function(_0x497b38){if(!_['isNil'](_0x497b38[0x0])){_0x29c68b=_0x497b38[0x0][_0xc716('0x126')]?![]:!![];_0x802865=_0x497b38[0x0][_0xc716('0x126')]?!![]:![];_0x802865=_0x1195b2?!![]:_0x802865;}var _0x26247f=_0x54142d[_0xc716('0x127')](_0x497b38);if(_0x26247f[_0xc716('0x128')]){rpcDb[_0xc716('0x129')](_[_0xc716('0x71')](_0x497b38[0x0],[_0xc716('0x74'),_0xc716('0x10e')]))['then'](function(_0x503d61){_0x54142d['checkInBlack'](_0x503d61,_0x497b38[0x0],_0x1195b2,_0x29c68b,_0x802865)['then'](function(_0x4176cf){_0x119bb8(_0x4176cf);})['catch'](function(_0x344e89){_0x347a9f(_0x344e89);});})['catch'](function(_0x1d3997){ut[_0xc716('0x63')]('[Preview][checkIsBlackList]',_0x1d3997);_0x347a9f(ut[_0xc716('0x4f')](_0xc716('0x12a'),_0x29c68b,_0x802865));});}else{_0x347a9f(ut[_0xc716('0x4f')](_0x26247f[_0xc716('0x4f')],_0x29c68b,_0x802865));}})[_0xc716('0x78')](function(_0x2f4b7d){ut[_0xc716('0x63')](_0xc716('0x12b'),_0x2f4b7d);_0x347a9f(ut[_0xc716('0x4f')](_0xc716('0x12a'),![],!![]));});});};Preview['prototype'][_0xc716('0x127')]=function(_0x4cc712){if(_[_0xc716('0x84')](_0x4cc712)||_[_0xc716('0x112')](_0x4cc712)||!_[_0xc716('0x84')](_0x4cc712[0x0][_0xc716('0x89')])&&_[_0xc716('0x84')](_0x4cc712[0x0]['Agent'][_0xc716('0x2d')])){ut[_0xc716('0x63')](_0xc716('0x12c'),_0x4cc712);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x5538d8=this[_0xc716('0x15')][_0x4cc712[0x0][_0xc716('0x110')][_0xc716('0x2d')]];_0x5538d8[_0xc716('0x4f')]=_0xc716('0x9f');if(_[_0xc716('0x84')](_0x5538d8)){ut['logger'](_0xc716('0x12d'),_0x5538d8);return{'isValid':![],'message':_0xc716('0x12e')};}if(!this[_0xc716('0x9c')](_0x5538d8[_0xc716('0x54')])){ut[_0xc716('0x63')](_0xc716('0x12f'),_0xc716('0x130')+_0x5538d8[_0xc716('0x2d')]+_0xc716('0x131'));if(!this['isTrunkReachable'](_0x5538d8[_0xc716('0x9d')])){ut[_0xc716('0x63')](_0xc716('0x12f'),_0x5538d8['name']+_0xc716('0x132'));return{'isValid':![],'message':_0xc716('0x133')};}}if(!ut[_0xc716('0x9b')](_0x5538d8[_0xc716('0x69')])){ut[_0xc716('0x63')]('[Preview][validateContact][Campaign\x20Active]',_0x5538d8[_0xc716('0x2d')]+_0xc716('0x134'));return{'isValid':![],'message':_0xc716('0x130')+_0x5538d8[_0xc716('0x2d')]+_0xc716('0x134')};}return{'isValid':!![],'message':_0xc716('0x135')};};Preview[_0xc716('0x11')][_0xc716('0x113')]=function(_0x690dfd,_0x199701,_0x52c897,_0x4d0fc2){var _0x1e8773=this;return new BPromise(function(_0x39c30f,_0x2772fe){var _0x3ce33f=_0x690dfd[_0xc716('0xbd')];var _0x1a2130=_0x1e8773[_0xc716('0x9c')](_0x199701['Trunk'])?util['format'](_0xc716('0x136'),_0x199701[_0xc716('0x54')]['name'],_['isNil'](_0x199701[_0xc716('0x137')])?'':_0x199701[_0xc716('0x137')][_0xc716('0x138')]()||'',_0x199701[_0xc716('0x139')]>0x0?_0x52c897[_0xc716('0x10e')][_0xc716('0x13a')](_0x199701[_0xc716('0x139')]):_0x52c897[_0xc716('0x10e')]):util[_0xc716('0x59')](_0xc716('0x136'),_['isNil'](_0x199701[_0xc716('0x9d')])?_0x199701[_0xc716('0x54')][_0xc716('0x2d')]:_0x199701[_0xc716('0x9d')][_0xc716('0x2d')],_[_0xc716('0x84')](_0x199701['dialPrefix'])?'':_0x199701[_0xc716('0x137')][_0xc716('0x138')]()||'',_0x199701['dialCutDigit']>0x0?_0x52c897[_0xc716('0x10e')][_0xc716('0x13a')](_0x199701[_0xc716('0x139')]):_0x52c897[_0xc716('0x10e')]);var _0x3a1c4d=_0x1e8773[_0xc716('0x9c')](_0x199701[_0xc716('0x54')])?ut[_0xc716('0x13b')](_0x199701[_0xc716('0x54')]['callerid'],_0x199701[_0xc716('0x3a')],_0x199701[_0xc716('0x13c')]>0x0?ut[_0xc716('0x13d')](_0x199701[_0xc716('0x3b')],_0x199701[_0xc716('0x13c')]):_0x199701[_0xc716('0x3b')]):ut['getCallerId'](_['isNil'](_0x199701[_0xc716('0x9d')])?_0x199701[_0xc716('0x54')][_0xc716('0x56')]:_0x199701[_0xc716('0x9d')][_0xc716('0x56')],_0x199701[_0xc716('0x3a')],_0x199701['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xc716('0x13d')](_0x199701[_0xc716('0x3b')],_0x199701[_0xc716('0x13c')]):_0x199701[_0xc716('0x3b')]);if(_0x3a1c4d){_0x690dfd[_0xc716('0x13e')]=ut[_0xc716('0x13f')](_0x3a1c4d);_0x690dfd[_0xc716('0x140')]=ut[_0xc716('0x141')](_0x3a1c4d);}var _0x835f7=ut[_0xc716('0x142')](_0x199701,_0x52c897,_0x1a2130,_0x3a1c4d,_0x3ce33f,_0x690dfd);_['merge'](_0x690dfd,ut[_0xc716('0x143')](_0x835f7));_0x690dfd['starttime']=moment()['format'](_0xc716('0x8f'));ami[_0xc716('0x144')](ut[_0xc716('0x145')](_0x690dfd,_0x199701,_0x835f7,_0x690dfd[_0xc716('0xb3')],_0x4d0fc2))['then'](function(_0x1beaff){var _0x54658a=_0x690dfd[_0xc716('0x146')];if(!_['isNil'](_0x54658a)){if(!_['isNil'](_0x1e8773['agents'][_0x54658a])){_0x1e8773[_0xc716('0x19')][_0x54658a][_0xc716('0x147')]=_0x690dfd[_0xc716('0x148')];emit(util['format']('user:%s',_0x1e8773['agents'][_0x54658a][_0xc716('0x2d')]),_0xc716('0x149'),{'destaccountcode':_0x1e8773['agents'][_0x54658a][_0xc716('0x14a')],'destconnectedlinenum':_0x690dfd['calleridnum']});}}_0x199701['originated']+=0x1;logger['info']('[originated][increment]',_0x3ce33f,_0xc716('0xcc'),_0x199701[_0xc716('0x2d')],_0xc716('0x6e'),_0x199701[_0xc716('0x6f')]);_0x39c30f(_0x1beaff);})[_0xc716('0x78')](function(_0x192b6a){ut['logAgent'](_0x690dfd,0xe,_0xc716('0x14b'));rpcDb[_0xc716('0x104')](_0x690dfd,_0xc716('0x14c'));_0x2772fe(_0x192b6a);});});};Preview[_0xc716('0x11')][_0xc716('0x24')]=function(_0x37799c){if(this[_0xc716('0x18')][_0x37799c[_0xc716('0xb4')]]){this[_0xc716('0x18')][_0x37799c[_0xc716('0xb4')]][_0xc716('0x77')]=_0x37799c[_0xc716('0x77')];}};Preview[_0xc716('0x11')][_0xc716('0x1c')]=function(_0x5ad135){var _0x520f80=this;var _0x23445c=this[_0xc716('0x18')][_0x5ad135[_0xc716('0x14d')]];if(_0x23445c){if(_0x23445c['lookAgent']&&this[_0xc716('0x19')][_0x23445c[_0xc716('0x111')]]){ut[_0xc716('0x14e')](_0x23445c,this[_0xc716('0x19')][_0x23445c[_0xc716('0x111')]][_0xc716('0x2d')],this[_0xc716('0x19')][_0x23445c[_0xc716('0x111')]]['id']);}var _0x269e9f=_[_0xc716('0x14f')](_0x23445c);_0x269e9f[_0xc716('0xba')]=moment()['format'](_0xc716('0x8f'));var _0xef3702=_0x520f80[_0xc716('0x15')][_0x23445c[_0xc716('0x6d')]];if(ut[_0xc716('0x150')](_0x5ad135[_0xc716('0x151')])){if(_0x23445c[_0xc716('0xdb')]){rpcDb['unlockContact'](_0x23445c[_0xc716('0xb6')]);}if(_0x23445c[_0xc716('0xb3')]){rpcDb[_0xc716('0x8d')](_0x23445c['idContact']);}ami[_0xc716('0x2b')](_0xc716('0x152'),ut[_0xc716('0xbf')](_0x23445c,_0xc716('0x153'),this[_0xc716('0x15')][_0x23445c['queue']]));this[_0xc716('0x154')](_0x269e9f,_0xef3702,_0x5ad135);}else{_0x23445c[_0xc716('0x8e')]=moment()[_0xc716('0x59')]('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x269e9f,0x4,_0xc716('0xc6'));rpcDb['createAgentHistory'](_0x269e9f,_0xc716('0x155'));}}};Preview[_0xc716('0x11')]['syncHangup']=function(_0x3652d4){var _0x234d32=this;var _0x370e21=this[_0xc716('0x18')][_0x3652d4[_0xc716('0xb4')]];var _0x173f2c;if(_0x370e21){_0x173f2c=this[_0xc716('0x15')][_0x370e21['queue']];logger[_0xc716('0x5b')](_0xc716('0x156'),_0x3652d4['linkedid'],_0xc716('0xcc'),_0x173f2c[_0xc716('0x2d')],_0xc716('0x70'),_0x173f2c[_0xc716('0x32')]);}if(this[_0xc716('0x18')][_0x3652d4[_0xc716('0xb4')]]&&_0x3652d4[_0xc716('0xb4')]!==_0x3652d4['uniqueid']){if(_0x3652d4[_0xc716('0x157')]==='16'&&this[_0xc716('0x18')][_0x3652d4['linkedid']][_0xc716('0x7c')]){this['callProgressDetectingCustomer'](_0x3652d4,_0x3652d4[_0xc716('0xb4')],_0x3652d4['cause']);}else if(this[_0xc716('0x18')][_0x3652d4[_0xc716('0xb4')]][_0xc716('0x7c')]){logger[_0xc716('0x5b')](_0xc716('0x158'),_0x3652d4[_0xc716('0xb4')],_0x3652d4[_0xc716('0x157')],_0xc716('0xcc'),_0x173f2c[_0xc716('0x2d')],_0xc716('0x70'),_0x173f2c[_0xc716('0x32')]);this[_0xc716('0xa0')](_0x3652d4,_0x3652d4[_0xc716('0xb4')],_0x3652d4[_0xc716('0x157')]);}}else if(_0x370e21&&_[_0xc716('0x84')](_0x370e21['statedesc'])&&_0x173f2c['dialQueueProject']&&_0x3652d4['linkedid']===_0x3652d4[_0xc716('0xbd')]&&_[_0xc716('0x84')](_0x3652d4[_0xc716('0xff')])&&_0x3652d4[_0xc716('0x157')]==='16'&&_0x3652d4[_0xc716('0x159')]==='6'&&_[_0xc716('0xfe')](_0x370e21[_0xc716('0x15a')])){if(_0x370e21['unlockAgent']){rpcDb['unlockContact'](_0x370e21[_0xc716('0xb6')]);}if(_0x370e21[_0xc716('0xb3')]){rpcDb[_0xc716('0x8d')](_0x370e21[_0xc716('0xb6')]);}_0x3652d4[_0xc716('0xff')]='22';this['callProgressDetectingAgent'](_0x370e21,_0x173f2c,_0x3652d4);}else if(_0x370e21&&_0x370e21[_0xc716('0x15a')]){if(_0x3652d4[_0xc716('0x157')]==='16'&&this[_0xc716('0x18')][_0x3652d4[_0xc716('0xb4')]]['dialAnswer']){logger[_0xc716('0x5b')](_0xc716('0x15b'),_0x3652d4['linkedid'],_0x3652d4[_0xc716('0x157')],_0xc716('0xcc'),_0x173f2c[_0xc716('0x2d')],'pTalking:\x20',_0x173f2c[_0xc716('0x32')]);this['callProgressDetectingCustomer'](_0x3652d4,_0x3652d4[_0xc716('0xb4')],_0x3652d4[_0xc716('0x157')]);}else if(this[_0xc716('0x18')][_0x3652d4[_0xc716('0xb4')]][_0xc716('0x7c')]){logger[_0xc716('0x5b')]('[syncHangup][talking][cause]',_0x3652d4[_0xc716('0xb4')],_0x3652d4['cause'],_0xc716('0xcc'),_0x173f2c[_0xc716('0x2d')],_0xc716('0x70'),_0x173f2c['pTalking']);this[_0xc716('0xa0')](_0x3652d4,_0x3652d4['linkedid'],_0x3652d4[_0xc716('0x157')]);}}};Preview[_0xc716('0x11')][_0xc716('0x22')]=function(_0x1bf99a){if(this[_0xc716('0x18')][_0x1bf99a[_0xc716('0xfc')]]&&_0x1bf99a[_0xc716('0xfc')]!==_0x1bf99a['destuniqueid']){this[_0xc716('0xa0')](_0x1bf99a,_0x1bf99a[_0xc716('0xfc')],_0x1bf99a[_0xc716('0xf3')]);}};Preview['prototype']['syncHangupRequest']=function(_0x2360dd){if(this[_0xc716('0x18')][_0x2360dd['linkedid']]&&_0x2360dd['linkedid']!==_0x2360dd[_0xc716('0xbd')]&&!this['actions'][_0x2360dd[_0xc716('0xb4')]][_0xc716('0x7c')]){if(_0x2360dd[_0xc716('0x157')]==='1'){this[_0xc716('0xa0')](_0x2360dd,_0x2360dd[_0xc716('0xb4')],_0x2360dd[_0xc716('0x157')]);}}};Preview[_0xc716('0x11')][_0xc716('0x15c')]=function(_0x2c7c58,_0x41060b,_0x488822){if(this[_0xc716('0x18')][_0x2c7c58]){if(_[_0xc716('0x84')](this[_0xc716('0x18')][_0x2c7c58][_0xc716('0x15d')])){this[_0xc716('0x18')][_0x2c7c58][_0xc716('0x15d')]={};}this['actions'][_0x2c7c58][_0xc716('0x15d')][_0x41060b]=_0x488822;}};Preview[_0xc716('0x11')][_0xc716('0x26')]=function(_0x5adcaf){try{if(!_['isNil'](_0x5adcaf)){if(ut[_0xc716('0x15e')](_['keys'](_0x5adcaf['variable'])[0x0])){this['addVariable'](_0x5adcaf['uniqueid'],_[_0xc716('0x15f')](_0x5adcaf['variable'])[0x0],_0x5adcaf[_0xc716('0x160')]);}}}catch(_0x30cd4d){logger[_0xc716('0x161')](_0xc716('0x162'),util[_0xc716('0x163')](_0x30cd4d,{'showHidden':![],'depth':null}));}};Preview[_0xc716('0x11')][_0xc716('0x164')]=function(_0x36fb0e){if(_0x36fb0e){if(this[_0xc716('0x18')][_0x36fb0e[_0xc716('0x165')]]){this[_0xc716('0x18')][_0x36fb0e['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0xc716('0x11')][_0xc716('0x29')]=function(_0x2aef60){if(_0x2aef60){if(this[_0xc716('0x18')][_0x2aef60['transfererlinkedid']]){this[_0xc716('0x18')][_0x2aef60['transfererlinkedid']][_0xc716('0x15a')]=!![];}}};module[_0xc716('0x166')]=Preview;
\ No newline at end of file
index 9e2af29..032e23c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e56=['queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x7e56,0x137));var _0x67e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e56[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x67e5('0x0'));var BPromise=require(_0x67e5('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x67e5('0x2'));var cmHopper=require(_0x67e5('0x3'));var cmHopperFinal=require(_0x67e5('0x4'));var cmHopperHistory=require(_0x67e5('0x5'));var cmHopperBlack=require(_0x67e5('0x6'));var voiceQueueRt=require(_0x67e5('0x7'));var agentReportPreview=require(_0x67e5('0x8'));var voiceQueueReport=require(_0x67e5('0x9'));function loggerCatch(_0x5a3056){return function(_0x27d107){logger[_0x67e5('0xa')](_0x5a3056,util[_0x67e5('0xb')](_0x27d107,{'showHidden':![],'depth':null}));};}function create(_0x2c4784){return BPromise[_0x67e5('0xc')]()['then'](cmHopperHistory[_0x67e5('0xd')](_0x2c4784))[_0x67e5('0xe')](loggerCatch(_0x67e5('0xf')));}function createAgent(_0x1f0485){return BPromise[_0x67e5('0xc')]()[_0x67e5('0x10')](agentReportPreview[_0x67e5('0xd')](_0x1f0485))[_0x67e5('0xe')](loggerCatch(_0x67e5('0xf')));}function moveContact(_0x521ba0){return BPromise[_0x67e5('0xc')]()['then'](cmHopper[_0x67e5('0x11')](_0x521ba0,!![]))[_0x67e5('0xe')](loggerCatch(_0x67e5('0x12')));}exports[_0x67e5('0x13')]=function(_0x59ed1c){return BPromise[_0x67e5('0xc')]()['then'](cmHopperBlack[_0x67e5('0x13')](_0x59ed1c))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x31c27a){return BPromise['resolve']()[_0x67e5('0x10')](cmHopper['getContactPreview'](_0x31c27a))[_0x67e5('0xe')](loggerCatch(_0x67e5('0x14')));};exports[_0x67e5('0xd')]=function(_0x366a1d,_0x319cf1){create(_0x366a1d)[_0x67e5('0xe')](loggerCatch(_0x319cf1));moveContact(_0x366a1d)[_0x67e5('0xe')](loggerCatch(_0x319cf1));};exports[_0x67e5('0x15')]=function(_0x219662,_0x236ebd){createAgent(_0x219662)[_0x67e5('0xe')](loggerCatch(_0x236ebd));};exports[_0x67e5('0x16')]=function(_0x2c38c8,_0x1143df){create(_0x2c38c8)[_0x67e5('0xe')](loggerCatch(_0x1143df));};exports['createCustomerFinal']=function(_0xdbaf62,_0x1fc05b){moveContact(_0xdbaf62)['catch'](loggerCatch(_0x1fc05b));};exports['rescheduleContact']=function(_0x47e9d0,_0x54e01d,_0x114d6a){if(_0x54e01d){_0x47e9d0[_0x67e5('0x17')]=null;}if(_0x114d6a){_0x47e9d0[_0x67e5('0x18')]=![];}return BPromise[_0x67e5('0xc')]()[_0x67e5('0x10')](cmHopper[_0x67e5('0x19')](_0x47e9d0))[_0x67e5('0xe')](loggerCatch(_0x67e5('0x1a')));};exports['countReScheduled']=function(_0x138f64){return BPromise[_0x67e5('0xc')]()[_0x67e5('0x10')](cmHopper[_0x67e5('0x1b')](_0x138f64))['catch'](loggerCatch(_0x67e5('0x1c')));};exports['unlockContact']=function(_0x57e3e5){return BPromise[_0x67e5('0xc')]()[_0x67e5('0x10')](cmHopper[_0x67e5('0x1d')]({'UserId':null},_0x57e3e5,0x1))[_0x67e5('0xe')](loggerCatch(_0x67e5('0x1e')));};exports['disableContact']=function(_0x44128d){return BPromise[_0x67e5('0xc')]()['then'](cmHopper[_0x67e5('0x1d')]({'active':![]},_0x44128d,0x1))[_0x67e5('0xe')](loggerCatch(_0x67e5('0x1f')));};exports[_0x67e5('0x20')]=function(_0x58d396){var _0x1a5d75={};_0x1a5d75['type']=_0x58d396['type'];_0x1a5d75[_0x67e5('0x21')]=_0x58d396[_0x67e5('0x21')];_0x1a5d75['calleridnum']=_0x58d396[_0x67e5('0x22')];_0x1a5d75[_0x67e5('0x23')]=_0x58d396['calleridname'];_0x1a5d75['queue']=_0x58d396[_0x67e5('0x24')];_0x1a5d75[_0x67e5('0x25')]=_0x58d396[_0x67e5('0x26')];_0x1a5d75[_0x67e5('0x27')]=_0x58d396[_0x67e5('0x26')];_0x1a5d75[_0x67e5('0x28')]=0x1;_0x1a5d75['queuecallercompleteAt']=_0x58d396[_0x67e5('0x29')];_0x1a5d75[_0x67e5('0x2a')]=_0x58d396[_0x67e5('0x2b')];_0x1a5d75[_0x67e5('0x2c')]=_0x67e5('0x2d');_0x1a5d75[_0x67e5('0x2e')]=_0x67e5('0x2f');_0x1a5d75['holdtime']=0x0;_0x1a5d75[_0x67e5('0x30')]=0x1;_0x1a5d75[_0x67e5('0x31')]=_0x58d396[_0x67e5('0x2b')];_0x1a5d75[_0x67e5('0x32')]=_0x67e5('0x33');return BPromise[_0x67e5('0xc')]()['then'](voiceQueueReport[_0x67e5('0x34')](_0x1a5d75))[_0x67e5('0xe')](loggerCatch(_0x67e5('0x35')));};exports[_0x67e5('0x36')]=function(_0xec183,_0x3389af){return BPromise[_0x67e5('0xc')]()[_0x67e5('0x10')](cmHopper['getContactRecallMe'](_0xec183,_0x3389af))[_0x67e5('0xe')](loggerCatch(_0x67e5('0x37')));};exports[_0x67e5('0x38')]=function(_0x10cfb7){return BPromise[_0x67e5('0xc')]()[_0x67e5('0x10')](cmHopper[_0x67e5('0x19')](_0x10cfb7,!![],!![]))[_0x67e5('0xe')](loggerCatch(_0x67e5('0x39')));};
\ No newline at end of file
+var _0xbe02=['getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','inspect','resolve','catch','[createHistory]\x20','createHistory','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20'];(function(_0x2d774a,_0x332522){var _0x120d99=function(_0x13ad40){while(--_0x13ad40){_0x2d774a['push'](_0x2d774a['shift']());}};_0x120d99(++_0x332522);}(_0xbe02,0x1b3));var _0x2be0=function(_0x348a8a,_0xfd672f){_0x348a8a=_0x348a8a-0x0;var _0x58c714=_0xbe02[_0x348a8a];return _0x58c714;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x2be0('0x0'))(_0x2be0('0x1'));var _=require(_0x2be0('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x2be0('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x2be0('0x4'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x1ab41b){return function(_0x39c696){logger['error'](_0x1ab41b,util[_0x2be0('0x5')](_0x39c696,{'showHidden':![],'depth':null}));};}function create(_0x58e32){return BPromise[_0x2be0('0x6')]()['then'](cmHopperHistory['createHistory'](_0x58e32))[_0x2be0('0x7')](loggerCatch(_0x2be0('0x8')));}function createAgent(_0x40fcf9){return BPromise['resolve']()['then'](agentReportPreview[_0x2be0('0x9')](_0x40fcf9))[_0x2be0('0x7')](loggerCatch(_0x2be0('0x8')));}function moveContact(_0x1bbd4b){return BPromise[_0x2be0('0x6')]()[_0x2be0('0xa')](cmHopper[_0x2be0('0xb')](_0x1bbd4b,!![]))[_0x2be0('0x7')](loggerCatch(_0x2be0('0xc')));}exports[_0x2be0('0xd')]=function(_0x55264b){return BPromise[_0x2be0('0x6')]()['then'](cmHopperBlack[_0x2be0('0xd')](_0x55264b))[_0x2be0('0x7')](loggerCatch(_0x2be0('0xe')));};exports[_0x2be0('0xf')]=function(_0x27620d){return BPromise[_0x2be0('0x6')]()[_0x2be0('0xa')](cmHopper[_0x2be0('0xf')](_0x27620d))[_0x2be0('0x7')](loggerCatch(_0x2be0('0x10')));};exports[_0x2be0('0x9')]=function(_0x2c7782,_0x2a043b){create(_0x2c7782)[_0x2be0('0x7')](loggerCatch(_0x2a043b));moveContact(_0x2c7782)[_0x2be0('0x7')](loggerCatch(_0x2a043b));};exports[_0x2be0('0x11')]=function(_0x28c04f,_0x545d5a){createAgent(_0x28c04f)[_0x2be0('0x7')](loggerCatch(_0x545d5a));};exports[_0x2be0('0x12')]=function(_0x453d87,_0x44c30d){create(_0x453d87)[_0x2be0('0x7')](loggerCatch(_0x44c30d));};exports['createCustomerFinal']=function(_0x2c4844,_0x3b7998){moveContact(_0x2c4844)[_0x2be0('0x7')](loggerCatch(_0x3b7998));};exports[_0x2be0('0x13')]=function(_0x34c60e,_0x83fcae,_0x5ed41d){if(_0x83fcae){_0x34c60e[_0x2be0('0x14')]=null;}if(_0x5ed41d){_0x34c60e[_0x2be0('0x15')]=![];}return BPromise[_0x2be0('0x6')]()[_0x2be0('0xa')](cmHopper[_0x2be0('0x13')](_0x34c60e))['catch'](loggerCatch(_0x2be0('0x16')));};exports[_0x2be0('0x17')]=function(_0x60d703){return BPromise[_0x2be0('0x6')]()[_0x2be0('0xa')](cmHopper[_0x2be0('0x17')](_0x60d703))[_0x2be0('0x7')](loggerCatch(_0x2be0('0x18')));};exports[_0x2be0('0x19')]=function(_0x261dca){return BPromise[_0x2be0('0x6')]()[_0x2be0('0xa')](cmHopper['unlockContact']({'UserId':null},_0x261dca,0x1))[_0x2be0('0x7')](loggerCatch(_0x2be0('0x1a')));};exports[_0x2be0('0x1b')]=function(_0x5820e){return BPromise[_0x2be0('0x6')]()['then'](cmHopper['unlockContact']({'active':![]},_0x5820e,0x1))[_0x2be0('0x7')](loggerCatch(_0x2be0('0x1c')));};exports[_0x2be0('0x1d')]=function(_0x557b67){var _0x3f5fa4={};_0x3f5fa4[_0x2be0('0x1e')]=_0x557b67['type'];_0x3f5fa4[_0x2be0('0x1f')]=_0x557b67[_0x2be0('0x1f')];_0x3f5fa4[_0x2be0('0x20')]=_0x557b67[_0x2be0('0x20')];_0x3f5fa4['calleridname']=_0x557b67[_0x2be0('0x21')];_0x3f5fa4[_0x2be0('0x22')]=_0x557b67['queue'];_0x3f5fa4['queuecallerjoinAt']=_0x557b67['answertime'];_0x3f5fa4[_0x2be0('0x23')]=_0x557b67['answertime'];_0x3f5fa4[_0x2be0('0x24')]=0x1;_0x3f5fa4[_0x2be0('0x25')]=_0x557b67[_0x2be0('0x26')];_0x3f5fa4['connectedlinename']=_0x557b67[_0x2be0('0x27')];_0x3f5fa4['context']=_0x2be0('0x28');_0x3f5fa4[_0x2be0('0x29')]=_0x2be0('0x2a');_0x3f5fa4[_0x2be0('0x2b')]=0x0;_0x3f5fa4['assigned']=0x1;_0x3f5fa4[_0x2be0('0x2c')]=_0x557b67[_0x2be0('0x27')];_0x3f5fa4[_0x2be0('0x2d')]='COMPLETED';return BPromise[_0x2be0('0x6')]()[_0x2be0('0xa')](voiceQueueReport[_0x2be0('0x2e')](_0x3f5fa4))[_0x2be0('0x7')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x2be0('0x2f')]=function(_0x197722,_0x2890fa){return BPromise[_0x2be0('0x6')]()[_0x2be0('0xa')](cmHopper[_0x2be0('0x2f')](_0x197722,_0x2890fa))[_0x2be0('0x7')](loggerCatch(_0x2be0('0x30')));};exports[_0x2be0('0x31')]=function(_0xe59e77){return BPromise[_0x2be0('0x6')]()[_0x2be0('0xa')](cmHopper[_0x2be0('0x13')](_0xe59e77,!![],!![]))[_0x2be0('0x7')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
index 64e3cb1..5fe2f48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb28=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','createBody','CampaignId','type','campaigntype','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','extractCalleridName','extractCalleridNumber','lodash','moment','../../../../config/logger','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','logger','info','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','ringtime','starttime','membername','UserId','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','channelAgent','from-sip','timeout','totalGlobal'];(function(_0xea3b5d,_0x32d2e3){var _0x2ce97a=function(_0x1daef0){while(--_0x1daef0){_0xea3b5d['push'](_0xea3b5d['shift']());}};_0x2ce97a(++_0x32d2e3);}(_0xeb28,0xca));var _0x8eb2=function(_0x53dbfe,_0x6f730d){_0x53dbfe=_0x53dbfe-0x0;var _0x1039a9=_0xeb28[_0x53dbfe];return _0x1039a9;};'use strict';var util=require('util');var _=require(_0x8eb2('0x0'));var moment=require(_0x8eb2('0x1'));var logger=require(_0x8eb2('0x2'))('preview');var ipAgi=process['env']['XCALLY_IP_AGI']||_0x8eb2('0x3');function getSeconds(_0x187a2a,_0x41b671){var _0x5010b1=moment(_0x187a2a)[_0x8eb2('0x4')](0x0);var _0x40a809=moment(_0x41b671)[_0x8eb2('0x4')](0x0);return _0x5010b1['diff'](_0x40a809,_0x8eb2('0x5'));}exports[_0x8eb2('0x6')]=function(_0x363d98){return function(_0x43a78b){logger[_0x8eb2('0x7')](_0x363d98,util[_0x8eb2('0x8')](_0x43a78b,{'showHidden':![],'depth':null}));};};exports[_0x8eb2('0x9')]=function(_0x3a2ba9,_0x42ba95){logger[_0x8eb2('0xa')](_0x3a2ba9,util['inspect'](_0x42ba95,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3e9cd3,_0x4cd889){logger[_0x8eb2('0x7')](_0x3e9cd3,util['inspect'](_0x4cd889,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x2f16f4){return function(_0x4fa9fa){logger[_0x8eb2('0xa')](_0x2f16f4,util['inspect'](_0x4fa9fa,{'showHidden':![],'depth':null}));};};exports['message']=function(_0xb5ba8c,_0x4bf7a3,_0x3014a7){return{'message':_0xb5ba8c,'unlock':_0x4bf7a3,'active':_0x3014a7};};exports['getCallerId']=function(_0x48e193,_0x3503a6,_0x173326){if(!_[_0x8eb2('0xb')](_0x173326)&&'string'===typeof _0x173326&&!_[_0x8eb2('0xc')](_0x173326)){if(!_[_0x8eb2('0xb')](_0x3503a6)&&_0x8eb2('0xd')===typeof _0x3503a6&&!_[_0x8eb2('0xc')](_0x3503a6)){return util[_0x8eb2('0xe')](_0x8eb2('0xf'),_0x3503a6,_0x173326);}return util[_0x8eb2('0xe')](_0x8eb2('0xf'),_0x173326,_0x173326);}if(!_[_0x8eb2('0xb')](_0x48e193)&&'string'===typeof _0x48e193&&!_[_0x8eb2('0xc')](_0x48e193)){return _0x48e193;}return _0x8eb2('0x10');};exports[_0x8eb2('0x11')]=function(_0x4afde0){if(_[_0x8eb2('0x12')](_0x4afde0)){return![];}return _0x4afde0;};exports['addVariables']=function(_0x3993f4,_0x4a3c0e,_0x29bcb5,_0x17e4ae,_0x292062,_0x34cd3e){var _0x4fb047={'XMD-QUEUE':_0x4a3c0e[_0x8eb2('0x13')]?_0x4a3c0e[_0x8eb2('0x13')][_0x8eb2('0x14')]:'','XMD-CALLERID':_0x17e4ae,'XMD-CALLERID-PREVIEW':_0x34cd3e?util[_0x8eb2('0xe')]('\x22%s\x22\x20<%s>',_0x34cd3e[_0x8eb2('0x15')],_0x34cd3e[_0x8eb2('0x16')]):_0x17e4ae,'XMD-DIALID':_0x292062,'XMD-CONTACTID':_0x4a3c0e[_0x8eb2('0x17')],'XMD-CDRTYPE':_0x8eb2('0x18'),'CALLERID(all)':_0x17e4ae,'XMD-VOICEQUEUEID':_0x4a3c0e['VoiceQueueId'],'XMD-DIALCHANNEL':_0x29bcb5,'XMD-DIALTIMEOUT':_0x3993f4[_0x8eb2('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x8eb2('0xe')](_0x8eb2('0x1a'),_0x3993f4[_0x8eb2('0x1b')]?'g':'',_['isEmpty'](_0x3993f4[_0x8eb2('0x1c')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3993f4[_0x8eb2('0x1d')]||'','XMD-AGI':_0x3993f4[_0x8eb2('0x1e')]?util[_0x8eb2('0xe')](_0x8eb2('0x1f'),ipAgi,_0x3993f4[_0x8eb2('0x1e')]):_0x8eb2('0x20'),'XMD-AGIAFTER':_0x3993f4['dialQueueProject2']?util[_0x8eb2('0xe')](_0x8eb2('0x1f'),ipAgi,_0x3993f4['dialQueueProject2']):_0x8eb2('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x34cd3e?_0x34cd3e[_0x8eb2('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x34cd3e?_0x34cd3e[_0x8eb2('0x22')]:'','XMD-DESTINATION':_0x8eb2('0x23')};if(!_[_0x8eb2('0xc')](_0x3993f4['monitor_format'])){_0x4fb047[util['format']('%s',_0x8eb2('0x24'))]=_0x3993f4[_0x8eb2('0x1c')];_0x4fb047[util[_0x8eb2('0xe')]('%s',_0x8eb2('0x25'))]=_0x292062;}if(_0x4a3c0e&&_0x4a3c0e['Contact']){for(var _0x24a309 in _0x4a3c0e[_0x8eb2('0x26')]){if(_0x4a3c0e[_0x8eb2('0x26')][_0x8eb2('0x27')](_0x24a309)){if(!_['isNil'](_0x4a3c0e[_0x8eb2('0x26')][_0x24a309])&&_0x24a309!=='id'&&_0x24a309!==_0x8eb2('0x28')&&_0x24a309!==_0x8eb2('0x29')&&_0x24a309!==_0x8eb2('0x2a')){_0x4fb047[util[_0x8eb2('0xe')](_0x8eb2('0x2b'),'XMD-',_['toUpper'](_0x24a309))]=_0x4a3c0e[_0x8eb2('0x26')][_0x24a309];}}}}return _0x4fb047;};exports[_0x8eb2('0x2c')]=function(_0x2f98c3){var _0x12c469={};for(var _0x16601c in _0x2f98c3){if(_0x2f98c3[_0x8eb2('0x27')](_0x16601c)){_0x12c469[util[_0x8eb2('0xe')]('%s',_['toLower'](_0x16601c))]=_0x2f98c3[_0x16601c];}}return{'variables':_0x12c469};};exports[_0x8eb2('0x2d')]=function(_0x399d54,_0x25ff3e){if(!_['isNil'](_0x399d54)){if(_0x399d54['hasOwnProperty'](_0x8eb2('0x2e'))){if(_0x399d54['originated']>0x0){_0x399d54[_0x8eb2('0x2e')]-=0x1;}else{logger[_0x8eb2('0x7')](_0x8eb2('0x2f'),_0x25ff3e);}}}else{logger['error'](_0x8eb2('0x30'),_0x25ff3e);}};exports[_0x8eb2('0x31')]=function(_0x5ec23c){var _0x3c458f=moment()[_0x8eb2('0xe')](_0x8eb2('0x32'));_0x5ec23c[_0x8eb2('0x33')]=0xd;_0x5ec23c[_0x8eb2('0x34')]='Blacklist';_0x5ec23c['starttime']=_0x3c458f;_0x5ec23c[_0x8eb2('0x35')]=_0x3c458f;_0x5ec23c['endtime']=_0x3c458f;};exports['logAgent']=function(_0x43d151,_0x4ba7b8,_0x243d73){var _0x1a68c5=moment()[_0x8eb2('0xe')](_0x8eb2('0x32'));_0x43d151[_0x8eb2('0x33')]=_0x4ba7b8;_0x43d151[_0x8eb2('0x34')]=_0x243d73;_0x43d151[_0x8eb2('0x35')]=_0x1a68c5;_0x43d151[_0x8eb2('0x36')]=getSeconds(_0x43d151[_0x8eb2('0x35')],_0x43d151[_0x8eb2('0x37')]);};exports['logLookAgent']=function(_0x38f87f,_0x2ff89e,_0x58a92a){_0x38f87f[_0x8eb2('0x38')]=_0x2ff89e;_0x38f87f[_0x8eb2('0x39')]=_0x58a92a;};exports['logCustomer']=function(_0x5db7bb,_0x250d92,_0xc6e0e9){var _0x127177=moment()[_0x8eb2('0xe')](_0x8eb2('0x32'));_0x5db7bb[_0x8eb2('0x33')]=_0x250d92;_0x5db7bb[_0x8eb2('0x34')]=_0xc6e0e9;_0x5db7bb[_0x8eb2('0x35')]=_0x5db7bb[_0x8eb2('0x35')]?_0x5db7bb[_0x8eb2('0x35')]:_0x127177;_0x5db7bb[_0x8eb2('0x3a')]=_0x5db7bb[_0x8eb2('0x3a')]?_0x5db7bb[_0x8eb2('0x3a')]:_0x127177;_0x5db7bb['ringtime']=getSeconds(_0x5db7bb[_0x8eb2('0x35')]||0x0,_0x5db7bb[_0x8eb2('0x37')]||0x0);_0x5db7bb[_0x8eb2('0x3b')]=_0x5db7bb[_0x8eb2('0x3c')]?getSeconds(_0x5db7bb[_0x8eb2('0x3a')],_0x5db7bb['answertime']):0x0;};exports[_0x8eb2('0x3d')]=function(_0x5bbf5e){return _0x5bbf5e===_0x8eb2('0x3e');};exports[_0x8eb2('0x3f')]=function(_0x257ac5,_0x14ef24,_0xe31d7f,_0xd069e8,_0x198474){var _0x13e095=_0xd069e8?_0x8eb2('0x40'):_0x257ac5[_0x8eb2('0x15')];_0x13e095=_0x198474?'BOOKED':_0x13e095;return{'actionid':_0x257ac5[_0x8eb2('0x41')],'action':'originate','channel':_0x257ac5[_0x8eb2('0x42')],'callerid':util['format'](_0x8eb2('0xf'),_0x13e095,_0x257ac5[_0x8eb2('0x16')]),'Exten':_0x8eb2('0x23'),'Context':_0x8eb2('0x43'),'Priority':'1','variable':_0xe31d7f,'timeout':(_0x14ef24[_0x8eb2('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x257ac5[_0x8eb2('0x41')]};};exports[_0x8eb2('0x45')]=function(_0x487925){return _0x487925[_0x8eb2('0x46')]+_0x487925[_0x8eb2('0x47')]+_0x487925[_0x8eb2('0x48')]+_0x487925['countagentrejectretry']+_0x487925[_0x8eb2('0x49')];};exports['cloneAction']=function(_0x29f96a){var _0x462166=_[_0x8eb2('0x4a')](_0x29f96a);_0x462166[_0x8eb2('0x33')]=0xf;_0x462166[_0x8eb2('0x34')]=_0x8eb2('0x4b');return _0x462166;};exports[_0x8eb2('0x4c')]=function(_0x862369,_0x3cbdd0,_0x2ebc81){var _0x45cffd={};_0x45cffd[_0x3cbdd0]=_0x862369[_0x3cbdd0];_0x45cffd[_0x8eb2('0x4d')]=![];_0x45cffd[_0x8eb2('0x4e')]=moment()[_0x8eb2('0x4f')](_0x2ebc81,_0x8eb2('0x50'))[_0x8eb2('0xe')](_0x8eb2('0x32'));_0x45cffd[_0x8eb2('0x17')]=_0x862369[_0x8eb2('0x17')];_0x45cffd[_0x8eb2('0x51')]=_0x862369[_0x8eb2('0x51')];_0x45cffd[_0x8eb2('0x52')]=_0x862369[_0x8eb2('0x52')]||undefined;return _0x45cffd;};exports[_0x8eb2('0x53')]=function(_0x3cbcc7,_0xe8f4d8){if(!_[_0x8eb2('0x12')](_0x3cbcc7)){if(_0x3cbcc7[_0x8eb2('0x54')]>0x0){_0x3cbcc7['pTalking']-=0x1;}else{logger[_0x8eb2('0x7')](_0xe8f4d8,_0x8eb2('0x55'));}}else{logger['error'](_0xe8f4d8,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x8eb2('0x56')]=function(_0x3011e1){if(_0x3011e1<=0x0){return!![];}return![];};exports['buildObj']=function(_0x265b6c,_0x2c5ca1,_0x4d8956){_0x265b6c[_0x8eb2('0x57')]=_0x2c5ca1;_0x265b6c[_0x8eb2('0x14')]=_0x265b6c[_0x8eb2('0x58')];_0x265b6c[_0x8eb2('0x59')]=_0x265b6c['channelAgent'];if(_0x4d8956){_0x265b6c[_0x8eb2('0x5a')]=_0x4d8956[_0x8eb2('0x5a')];}return _0x265b6c;};exports[_0x8eb2('0x5b')]=function(_0x1dea96){var _0x134e1c={};_0x134e1c[_0x8eb2('0x58')]=_0x1dea96[_0x8eb2('0x58')];_0x134e1c[_0x8eb2('0x59')]=_0x1dea96[_0x8eb2('0x42')];_0x134e1c[_0x8eb2('0x41')]=_0x1dea96['uniqueid'];return _0x134e1c;};exports[_0x8eb2('0x5c')]=function(_0x42f91d){var _0x57b94c=[];for(var _0x14aeff in _0x42f91d){if(_0x42f91d[_0x8eb2('0x27')](_0x14aeff)){if(!_[_0x8eb2('0x12')](_0x42f91d[_0x14aeff])&&_0x42f91d[_0x14aeff][_0x8eb2('0x33')]===_0x8eb2('0x5d')&&_0x42f91d[_0x14aeff][_0x8eb2('0x5e')]===_0x8eb2('0x5f')){_0x57b94c[_0x8eb2('0x60')](_0x42f91d[_0x14aeff]['id']);}}}return _0x57b94c;};exports[_0x8eb2('0x61')]=function(_0x6129df){var _0x15c404=moment()[_0x8eb2('0x4')](0x0);var _0x244f20=moment(_0x6129df)[_0x8eb2('0x4')](0x0);return _0x15c404[_0x8eb2('0x62')](_0x244f20,_0x8eb2('0x5'));};exports[_0x8eb2('0x63')]=function(_0x5e8a2d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5e8a2d[_0x8eb2('0x17')],'ListId':_0x5e8a2d[_0x8eb2('0x51')],'VoiceQueueId':_0x5e8a2d[_0x8eb2('0x52')]||undefined,'CampaignId':_0x5e8a2d[_0x8eb2('0x64')]||undefined};};exports['filterKey']=function(_0xac0369){if(_0xac0369===_0x8eb2('0x41')||_0xac0369==='idContact'||_0xac0369===_0x8eb2('0x58')||_0xac0369===_0x8eb2('0x65')||_0xac0369===_0x8eb2('0x66')||_0xac0369==='dialAnswer'||_0xac0369===_0x8eb2('0x38')||_0xac0369===_0x8eb2('0x42')||_0xac0369==='calleridname'||_0xac0369===_0x8eb2('0x4d')||_0xac0369===_0x8eb2('0x16')||_0xac0369===_0x8eb2('0x4e')||_0xac0369===_0x8eb2('0x46')||_0xac0369===_0x8eb2('0x47')||_0xac0369==='countnoanswerretry'||_0xac0369===_0x8eb2('0x67')||_0xac0369===_0x8eb2('0x68')||_0xac0369===_0x8eb2('0x69')||_0xac0369===_0x8eb2('0x6a')||_0xac0369===_0x8eb2('0x6b')||_0xac0369===_0x8eb2('0x17')||_0xac0369===_0x8eb2('0x51')||_0xac0369===_0x8eb2('0x39')||_0xac0369===_0x8eb2('0x52')||_0xac0369===_0x8eb2('0x6c')||_0xac0369===_0x8eb2('0x6d')||_0xac0369===_0x8eb2('0x6e')||_0xac0369===_0x8eb2('0x6f')||_0xac0369===_0x8eb2('0x70')||_0xac0369===_0x8eb2('0x71')||_0xac0369==='xmd-dialtimeout'||_0xac0369===_0x8eb2('0x72')||_0xac0369===_0x8eb2('0x73')||_0xac0369===_0x8eb2('0x74')||_0xac0369===_0x8eb2('0x75')||_0xac0369===_0x8eb2('0x76')||_0xac0369===_0x8eb2('0x77')||_0xac0369===_0x8eb2('0x78')||_0xac0369===_0x8eb2('0x79')||_0xac0369===_0x8eb2('0x7a')||_0xac0369===_0x8eb2('0x7b')||_0xac0369==='rtpaudioqosjitter'||_0xac0369===_0x8eb2('0x7c')||_0xac0369===_0x8eb2('0x7d')||_0xac0369===_0x8eb2('0x7e')||_0xac0369===_0x8eb2('0x7f')||_0xac0369===_0x8eb2('0x80')||_0xac0369===_0x8eb2('0x7a')||_0xac0369===_0x8eb2('0x7b')||_0xac0369===_0x8eb2('0x81')||_0xac0369===_0x8eb2('0x7c')||_0xac0369===_0x8eb2('0x7d')||_0xac0369==='rtpaudioqoslossbridged'||_0xac0369==='rtpaudioqosrtt'||_0xac0369==='rtpaudioqosrttbridged'||_0xac0369===_0x8eb2('0x82')||_0xac0369===_0x8eb2('0x83')||_0xac0369===_0x8eb2('0x33')||_0xac0369===_0x8eb2('0x34')){return![];}return!![];};exports[_0x8eb2('0x84')]=function(_0x4e706b,_0x3a85b5){var _0x139bf6,_0x2c96ce,_0x471039;if(_0x3a85b5<=0x0){_0x3a85b5=0x1;}_0x139bf6=new RegExp('\x5cw{0,'+_0x3a85b5+'}$');_0x2c96ce=Math[_0x8eb2('0x85')](0xa,_0x3a85b5-0x1);_0x471039=Math[_0x8eb2('0x85')](0xa,_0x3a85b5)-0x1;return util[_0x8eb2('0xe')]('%s',_['replace'](_0x4e706b,_0x139bf6,_['random'](_0x2c96ce,_0x471039)));};exports[_0x8eb2('0x86')]=function(_0x9b1066){var _0xa702e1=_0x9b1066['match'](/"(.*?)"/);return _0xa702e1?_0xa702e1[0x1]:_0x9b1066;};exports[_0x8eb2('0x87')]=function(_0x2a8db3){var _0x2f5224=_0x2a8db3['match'](/<(.*?)>/);return _0x2f5224?_0x2f5224[0x1]:_0x2a8db3;};
\ No newline at end of file
+var _0x081a=['xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','util','moment','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','logger','inspect','loggerError','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridname','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','Contact','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','endtime','logAgent','state','logLookAgent','membername','responsetime','talktime','answertime','RECALL','BOOKED','uniqueid','channelAgent','xcally-motion-preview','timeout','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','scheduledat','minutes','ListId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','mandatoryDisposition','buildAcw','not_inuse','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countcongestionretry','callback','callbackuniqueid','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid'];(function(_0x349ed8,_0x4eee47){var _0x2ad3f9=function(_0x2e7680){while(--_0x2e7680){_0x349ed8['push'](_0x349ed8['shift']());}};_0x2ad3f9(++_0x4eee47);}(_0x081a,0x9c));var _0xa081=function(_0x2e6a69,_0x1ba014){_0x2e6a69=_0x2e6a69-0x0;var _0x583b2a=_0x081a[_0x2e6a69];return _0x583b2a;};'use strict';var util=require(_0xa081('0x0'));var _=require('lodash');var moment=require(_0xa081('0x1'));var logger=require('../../../../config/logger')(_0xa081('0x2'));var ipAgi=process['env'][_0xa081('0x3')]||_0xa081('0x4');function getSeconds(_0x1c6c1b,_0x153bd8){var _0x3fae56=moment(_0x1c6c1b)[_0xa081('0x5')](0x0);var _0x484dcf=moment(_0x153bd8)['milliseconds'](0x0);return _0x3fae56[_0xa081('0x6')](_0x484dcf,'seconds');}exports[_0xa081('0x7')]=function(_0x2d4c4a){return function(_0x3bb879){logger['error'](_0x2d4c4a,util['inspect'](_0x3bb879,{'showHidden':![],'depth':null}));};};exports[_0xa081('0x8')]=function(_0x3eec31,_0x5aa36b){logger['info'](_0x3eec31,util[_0xa081('0x9')](_0x5aa36b,{'showHidden':![],'depth':null}));};exports[_0xa081('0xa')]=function(_0x23c9c5,_0x3434ea){logger['error'](_0x23c9c5,util[_0xa081('0x9')](_0x3434ea,{'showHidden':![],'depth':null}));};exports[_0xa081('0xb')]=function(_0x4fc4c0){return function(_0x5281ea){logger[_0xa081('0xc')](_0x4fc4c0,util['inspect'](_0x5281ea,{'showHidden':![],'depth':null}));};};exports[_0xa081('0xd')]=function(_0x22c9a5,_0x463924,_0x4bdf9f){return{'message':_0x22c9a5,'unlock':_0x463924,'active':_0x4bdf9f};};exports[_0xa081('0xe')]=function(_0x289bfe,_0x3fc95a,_0x2dd803){if(!_[_0xa081('0xf')](_0x2dd803)&&_0xa081('0x10')===typeof _0x2dd803&&!_[_0xa081('0x11')](_0x2dd803)){if(!_[_0xa081('0xf')](_0x3fc95a)&&_0xa081('0x10')===typeof _0x3fc95a&&!_[_0xa081('0x11')](_0x3fc95a)){return util[_0xa081('0x12')](_0xa081('0x13'),_0x3fc95a,_0x2dd803);}return util[_0xa081('0x12')](_0xa081('0x13'),_0x2dd803,_0x2dd803);}if(!_[_0xa081('0xf')](_0x289bfe)&&_0xa081('0x10')===typeof _0x289bfe&&!_['isEmpty'](_0x289bfe)){return _0x289bfe;}return _0xa081('0x14');};exports[_0xa081('0x15')]=function(_0x2b4761){if(_[_0xa081('0x16')](_0x2b4761)){return![];}return _0x2b4761;};exports[_0xa081('0x17')]=function(_0x5d0445,_0x395bb5,_0x3696df,_0x3538a2,_0x3ec19c,_0x16740a){var _0x47210d={'XMD-QUEUE':_0x395bb5['Queue']?_0x395bb5[_0xa081('0x18')]['name']:'','XMD-CALLERID':_0x3538a2,'XMD-CALLERID-PREVIEW':_0x16740a?util['format']('\x22%s\x22\x20<%s>',_0x16740a[_0xa081('0x19')],_0x16740a[_0xa081('0x1a')]):_0x3538a2,'XMD-DIALID':_0x3ec19c,'XMD-CONTACTID':_0x395bb5[_0xa081('0x1b')],'XMD-CDRTYPE':_0xa081('0x1c'),'CALLERID(all)':_0x3538a2,'XMD-VOICEQUEUEID':_0x395bb5[_0xa081('0x1d')],'XMD-DIALCHANNEL':_0x3696df,'XMD-DIALTIMEOUT':_0x5d0445[_0xa081('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xa081('0x12')](_0xa081('0x1f'),_0x5d0445['dialQueueProject2']?'g':'',_[_0xa081('0x11')](_0x5d0445['monitor_format'])?'':_0xa081('0x20')),'XMD-DIALURL':_0x5d0445[_0xa081('0x21')]||'','XMD-AGI':_0x5d0445[_0xa081('0x22')]?util[_0xa081('0x12')](_0xa081('0x23'),ipAgi,_0x5d0445[_0xa081('0x22')]):_0xa081('0x24'),'XMD-AGIAFTER':_0x5d0445[_0xa081('0x25')]?util[_0xa081('0x12')](_0xa081('0x23'),ipAgi,_0x5d0445[_0xa081('0x25')]):_0xa081('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x16740a?_0x16740a['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x16740a?_0x16740a[_0xa081('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x5d0445[_0xa081('0x27')])){_0x47210d[util[_0xa081('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5d0445['monitor_format'];_0x47210d[util[_0xa081('0x12')]('%s',_0xa081('0x28'))]=_0x3ec19c;}if(_0x395bb5&&_0x395bb5['Contact']){for(var _0x34511b in _0x395bb5['Contact']){if(_0x395bb5['Contact'][_0xa081('0x29')](_0x34511b)){if(!_['isNil'](_0x395bb5[_0xa081('0x2a')][_0x34511b])&&_0x34511b!=='id'&&_0x34511b!=='tags'&&_0x34511b!==_0xa081('0x2b')&&_0x34511b!=='updatedAt'){_0x47210d[util[_0xa081('0x12')](_0xa081('0x2c'),_0xa081('0x2d'),_[_0xa081('0x2e')](_0x34511b))]=_0x395bb5[_0xa081('0x2a')][_0x34511b];}}}}return _0x47210d;};exports[_0xa081('0x2f')]=function(_0xef459a){var _0x4fba3b={};for(var _0x4e4a0f in _0xef459a){if(_0xef459a[_0xa081('0x29')](_0x4e4a0f)){_0x4fba3b[util[_0xa081('0x12')]('%s',_[_0xa081('0x30')](_0x4e4a0f))]=_0xef459a[_0x4e4a0f];}}return{'variables':_0x4fba3b};};exports[_0xa081('0x31')]=function(_0x59ddbf,_0x1e5bcc){if(!_[_0xa081('0x16')](_0x59ddbf)){if(_0x59ddbf['hasOwnProperty'](_0xa081('0x32'))){if(_0x59ddbf['originated']>0x0){_0x59ddbf[_0xa081('0x32')]-=0x1;}else{logger[_0xa081('0x33')](_0xa081('0x34'),_0x1e5bcc);}}}else{logger[_0xa081('0x33')](_0xa081('0x35'),_0x1e5bcc);}};exports[_0xa081('0x36')]=function(_0x151be4){var _0x34dbb0=moment()['format'](_0xa081('0x37'));_0x151be4['state']=0xd;_0x151be4[_0xa081('0x38')]=_0xa081('0x39');_0x151be4[_0xa081('0x3a')]=_0x34dbb0;_0x151be4['responsetime']=_0x34dbb0;_0x151be4[_0xa081('0x3b')]=_0x34dbb0;};exports[_0xa081('0x3c')]=function(_0x141458,_0x504148,_0x391659){var _0x56afaf=moment()[_0xa081('0x12')](_0xa081('0x37'));_0x141458[_0xa081('0x3d')]=_0x504148;_0x141458[_0xa081('0x38')]=_0x391659;_0x141458['responsetime']=_0x56afaf;_0x141458['ringtime']=getSeconds(_0x141458['responsetime'],_0x141458[_0xa081('0x3a')]);};exports[_0xa081('0x3e')]=function(_0xd95eb8,_0x5afdd9,_0x226031){_0xd95eb8[_0xa081('0x3f')]=_0x5afdd9;_0xd95eb8['UserId']=_0x226031;};exports['logCustomer']=function(_0x1f9d80,_0x20371f,_0x1b6ac5){var _0x5cd24e=moment()['format'](_0xa081('0x37'));_0x1f9d80[_0xa081('0x3d')]=_0x20371f;_0x1f9d80[_0xa081('0x38')]=_0x1b6ac5;_0x1f9d80[_0xa081('0x40')]=_0x1f9d80['responsetime']?_0x1f9d80[_0xa081('0x40')]:_0x5cd24e;_0x1f9d80['endtime']=_0x1f9d80[_0xa081('0x3b')]?_0x1f9d80['endtime']:_0x5cd24e;_0x1f9d80['ringtime']=getSeconds(_0x1f9d80['responsetime']||0x0,_0x1f9d80['starttime']||0x0);_0x1f9d80[_0xa081('0x41')]=_0x1f9d80[_0xa081('0x42')]?getSeconds(_0x1f9d80[_0xa081('0x3b')],_0x1f9d80[_0xa081('0x42')]):0x0;};exports['isFailure']=function(_0x4129f6){return _0x4129f6==='Failure';};exports['variablesAction']=function(_0x2c7370,_0x3c31cf,_0xd06025,_0x12df1f,_0x25d765){var _0x39bd2b=_0x12df1f?_0xa081('0x43'):_0x2c7370[_0xa081('0x19')];_0x39bd2b=_0x25d765?_0xa081('0x44'):_0x39bd2b;return{'actionid':_0x2c7370[_0xa081('0x45')],'action':'originate','channel':_0x2c7370[_0xa081('0x46')],'callerid':util[_0xa081('0x12')](_0xa081('0x13'),_0x39bd2b,_0x2c7370[_0xa081('0x1a')]),'Exten':_0xa081('0x47'),'Context':'from-sip','Priority':'1','variable':_0xd06025,'timeout':(_0x3c31cf[_0xa081('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2c7370[_0xa081('0x45')]};};exports['totalGlobal']=function(_0x2e6924){return _0x2e6924[_0xa081('0x49')]+_0x2e6924['countcongestionretry']+_0x2e6924[_0xa081('0x4a')]+_0x2e6924[_0xa081('0x4b')]+_0x2e6924['countnosuchnumberretry'];};exports[_0xa081('0x4c')]=function(_0x560646){var _0x393d07=_[_0xa081('0x4d')](_0x560646);_0x393d07[_0xa081('0x3d')]=0xf;_0x393d07[_0xa081('0x38')]=_0xa081('0x4e');return _0x393d07;};exports[_0xa081('0x4f')]=function(_0x306d89,_0x272502,_0x7dbb97){var _0x4f7535={};_0x4f7535[_0x272502]=_0x306d89[_0x272502];_0x4f7535['active']=![];_0x4f7535[_0xa081('0x50')]=moment()['add'](_0x7dbb97,_0xa081('0x51'))[_0xa081('0x12')](_0xa081('0x37'));_0x4f7535['ContactId']=_0x306d89[_0xa081('0x1b')];_0x4f7535['ListId']=_0x306d89[_0xa081('0x52')];_0x4f7535['VoiceQueueId']=_0x306d89[_0xa081('0x1d')]||undefined;return _0x4f7535;};exports['decrementTalkink']=function(_0x2109da,_0x3c41b2){if(!_[_0xa081('0x16')](_0x2109da)){if(_0x2109da[_0xa081('0x53')]>0x0){_0x2109da[_0xa081('0x53')]-=0x1;}else{logger['error'](_0x3c41b2,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xa081('0x33')](_0x3c41b2,_0xa081('0x54'));}};exports[_0xa081('0x55')]=function(_0x134706){if(_0x134706<=0x0){return!![];}return![];};exports['buildObj']=function(_0x17f401,_0x29fb35,_0x4810d2){_0x17f401[_0xa081('0x56')]=_0x29fb35;_0x17f401[_0xa081('0x57')]=_0x17f401[_0xa081('0x58')];_0x17f401[_0xa081('0x59')]=_0x17f401['channelAgent'];if(_0x4810d2){_0x17f401[_0xa081('0x5a')]=_0x4810d2[_0xa081('0x5a')];}return _0x17f401;};exports[_0xa081('0x5b')]=function(_0x5c1cc1){var _0x494f19={};_0x494f19['queue']=_0x5c1cc1[_0xa081('0x58')];_0x494f19[_0xa081('0x59')]=_0x5c1cc1[_0xa081('0x46')];_0x494f19[_0xa081('0x45')]=_0x5c1cc1[_0xa081('0x45')];return _0x494f19;};exports['agentReadyId']=function(_0x1ca9ea){var _0x35a6e2=[];for(var _0x147adb in _0x1ca9ea){if(_0x1ca9ea[_0xa081('0x29')](_0x147adb)){if(!_[_0xa081('0x16')](_0x1ca9ea[_0x147adb])&&_0x1ca9ea[_0x147adb][_0xa081('0x3d')]===_0xa081('0x5c')&&_0x1ca9ea[_0x147adb][_0xa081('0x5d')]===_0xa081('0x5e')){_0x35a6e2[_0xa081('0x5f')](_0x1ca9ea[_0x147adb]['id']);}}}return _0x35a6e2;};exports[_0xa081('0x60')]=function(_0x4cd8ce){var _0x1116fd=moment()['milliseconds'](0x0);var _0xb3e6d4=moment(_0x4cd8ce)[_0xa081('0x5')](0x0);return _0x1116fd['diff'](_0xb3e6d4,_0xa081('0x61'));};exports[_0xa081('0x62')]=function(_0x1fb132){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1fb132['ContactId'],'ListId':_0x1fb132[_0xa081('0x52')],'VoiceQueueId':_0x1fb132[_0xa081('0x1d')]||undefined,'CampaignId':_0x1fb132[_0xa081('0x63')]||undefined};};exports[_0xa081('0x64')]=function(_0x17d66a){if(_0x17d66a===_0xa081('0x45')||_0x17d66a===_0xa081('0x65')||_0x17d66a===_0xa081('0x58')||_0x17d66a===_0xa081('0x66')||_0x17d66a===_0xa081('0x67')||_0x17d66a===_0xa081('0x68')||_0x17d66a===_0xa081('0x3f')||_0x17d66a==='channelAgent'||_0x17d66a===_0xa081('0x19')||_0x17d66a==='active'||_0x17d66a===_0xa081('0x1a')||_0x17d66a===_0xa081('0x50')||_0x17d66a===_0xa081('0x49')||_0x17d66a===_0xa081('0x69')||_0x17d66a===_0xa081('0x4a')||_0x17d66a==='countglobal'||_0x17d66a===_0xa081('0x6a')||_0x17d66a===_0xa081('0x6b')||_0x17d66a==='callbackat'||_0x17d66a===_0xa081('0x6c')||_0x17d66a===_0xa081('0x1b')||_0x17d66a===_0xa081('0x52')||_0x17d66a===_0xa081('0x6d')||_0x17d66a===_0xa081('0x1d')||_0x17d66a===_0xa081('0x6e')||_0x17d66a===_0xa081('0x6f')||_0x17d66a===_0xa081('0x70')||_0x17d66a===_0xa081('0x71')||_0x17d66a===_0xa081('0x72')||_0x17d66a==='xmd-dialurl'||_0x17d66a===_0xa081('0x73')||_0x17d66a===_0xa081('0x74')||_0x17d66a===_0xa081('0x75')||_0x17d66a===_0xa081('0x76')||_0x17d66a===_0xa081('0x77')||_0x17d66a===_0xa081('0x78')||_0x17d66a===_0xa081('0x79')||_0x17d66a==='xmd-agiafter'||_0x17d66a==='xmd-agi'||_0x17d66a===_0xa081('0x7a')||_0x17d66a===_0xa081('0x7b')||_0x17d66a===_0xa081('0x7c')||_0x17d66a==='rtpaudioqosjitterbridged'||_0x17d66a===_0xa081('0x7d')||_0x17d66a===_0xa081('0x7e')||_0x17d66a===_0xa081('0x7f')||_0x17d66a===_0xa081('0x80')||_0x17d66a===_0xa081('0x7a')||_0x17d66a===_0xa081('0x7b')||_0x17d66a===_0xa081('0x7c')||_0x17d66a===_0xa081('0x81')||_0x17d66a==='rtpaudioqosloss'||_0x17d66a===_0xa081('0x7e')||_0x17d66a===_0xa081('0x7f')||_0x17d66a===_0xa081('0x80')||_0x17d66a==='bridgepeer'||_0x17d66a===_0xa081('0x82')||_0x17d66a===_0xa081('0x3d')||_0x17d66a==='statedesc'){return![];}return!![];};exports[_0xa081('0x83')]=function(_0x553fb2,_0x2a2aed){var _0x56cc8d,_0x4f254a,_0x1e4267;if(_0x2a2aed<=0x0){_0x2a2aed=0x1;}_0x56cc8d=new RegExp(_0xa081('0x84')+_0x2a2aed+'}$');_0x4f254a=Math[_0xa081('0x85')](0xa,_0x2a2aed-0x1);_0x1e4267=Math['pow'](0xa,_0x2a2aed)-0x1;return util['format']('%s',_['replace'](_0x553fb2,_0x56cc8d,_[_0xa081('0x86')](_0x4f254a,_0x1e4267)));};exports[_0xa081('0x87')]=function(_0x5b12c1){var _0xeb8495=_0x5b12c1['match'](/"(.*?)"/);return _0xeb8495?_0xeb8495[0x1]:_0x5b12c1;};exports['extractCalleridNumber']=function(_0x148020){var _0x2ae31b=_0x148020[_0xa081('0x88')](/<(.*?)>/);return _0x2ae31b?_0x2ae31b[0x1]:_0x148020;};
\ No newline at end of file
index c936014..ee4bb9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9c6=['boolean','reload','voicechannel','voicequeuechannelredirect','string','number','queueremove','queuepause'];(function(_0x8567ae,_0x118fcf){var _0x2f9e9b=function(_0x7bef6f){while(--_0x7bef6f){_0x8567ae['push'](_0x8567ae['shift']());}};_0x2f9e9b(++_0x118fcf);}(_0xf9c6,0xcc));var _0x6f9c=function(_0x34ba4e,_0x18a788){_0x34ba4e=_0x34ba4e-0x0;var _0x3e147f=_0xf9c6[_0x34ba4e];return _0x3e147f;};'use strict';exports['queueadd']={'queue':{'type':_0x6f9c('0x0'),'required':!![]},'interface':{'type':_0x6f9c('0x0'),'required':!![]},'membername':{'type':_0x6f9c('0x0'),'required':!![]},'penalty':{'type':_0x6f9c('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x6f9c('0x2')]={'queue':{'type':_0x6f9c('0x0'),'required':!![]},'interface':{'type':_0x6f9c('0x0'),'required':!![]}};exports[_0x6f9c('0x3')]={'interface':{'type':_0x6f9c('0x0'),'required':!![]},'paused':{'type':_0x6f9c('0x4')},'reason':{'type':_0x6f9c('0x0'),'required':![]}};exports[_0x6f9c('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x6f9c('0x0'),'required':!![]}};exports[_0x6f9c('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x6f9c('0x0')},'format':{'type':_0x6f9c('0x0')},'mixmonitorid':{'type':_0x6f9c('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x6f9c('0x0'),'required':!![]}};exports[_0x6f9c('0x7')]={'uniqueid':{'type':_0x6f9c('0x0'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x6f9c('0x0')}};
\ No newline at end of file
+var _0xaa61=['string','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd'];(function(_0x2245a8,_0x3e9a40){var _0x2f74a0=function(_0x3a9e8f){while(--_0x3a9e8f){_0x2245a8['push'](_0x2245a8['shift']());}};_0x2f74a0(++_0x3e9a40);}(_0xaa61,0xfb));var _0x1aa6=function(_0x1bcb9c,_0x2e58c8){_0x1bcb9c=_0x1bcb9c-0x0;var _0x15aa32=_0xaa61[_0x1bcb9c];return _0x15aa32;};'use strict';exports[_0x1aa6('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x1aa6('0x1'),'required':!![]},'membername':{'type':_0x1aa6('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x1aa6('0x2'),'required':![]}};exports[_0x1aa6('0x3')]={'queue':{'type':_0x1aa6('0x1'),'required':!![]},'interface':{'type':_0x1aa6('0x1'),'required':!![]}};exports[_0x1aa6('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x1aa6('0x1'),'required':![]}};exports[_0x1aa6('0x5')]={'module':{'type':_0x1aa6('0x1'),'required':![]}};exports[_0x1aa6('0x6')]={'uniqueid':{'type':_0x1aa6('0x1'),'required':!![]}};exports[_0x1aa6('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x1aa6('0x1')},'format':{'type':_0x1aa6('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x1aa6('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x1aa6('0x1'),'required':!![]},'exten':{'type':_0x1aa6('0x1'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
index 77027b1..7479876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b09=['templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','telephones','isUndefined','mergeFromDatabase','initTriggers','triggers','initTemplates','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','merge','initFaxAccounts','exports','bluebird','lodash','moment','../model/telephone','../model/template','../model/campaign','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','campaigns'];(function(_0x3b154f,_0x14fd22){var _0xe53d42=function(_0x408d23){while(--_0x408d23){_0x3b154f['push'](_0x3b154f['shift']());}};_0xe53d42(++_0x14fd22);}(_0x2b09,0xb1));var _0x92b0=function(_0x3fdfab,_0x433685){_0x3fdfab=_0x3fdfab-0x0;var _0x2d2350=_0x2b09[_0x3fdfab];return _0x2d2350;};'use strict';var BPromise=require(_0x92b0('0x0'));var util=require('util');var _=require(_0x92b0('0x1'));var moment=require(_0x92b0('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x92b0('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x92b0('0x4'));var Campaign=require(_0x92b0('0x5'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x92b0('0x6'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x92b0('0x7'));var SugarcrmAccount=require(_0x92b0('0x8'));var ZohoAccount=require(_0x92b0('0x9'));var DeskAccount=require(_0x92b0('0xa'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x92b0('0xb'));var Dynamics365Account=require(_0x92b0('0xc'));var FreshsalesAccount=require(_0x92b0('0xd'));var FaxAccount=require(_0x92b0('0xe'));var Realtime=function(){this[_0x92b0('0xf')]={};this['telephones']={};this[_0x92b0('0x10')]={};this[_0x92b0('0x11')]={};this['triggers']={};this[_0x92b0('0x12')]={};this[_0x92b0('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x92b0('0x14')]={};this[_0x92b0('0x15')]={};this[_0x92b0('0x16')]={};this[_0x92b0('0x17')]={};this[_0x92b0('0x18')]={};this[_0x92b0('0x19')]={};this[_0x92b0('0x1a')]={};this[_0x92b0('0x1b')]={};this[_0x92b0('0x1c')]={};this[_0x92b0('0x1d')]={};this[_0x92b0('0x1e')]={};this[_0x92b0('0x1f')]={};this[_0x92b0('0x20')]={};this[_0x92b0('0x21')]={};this[_0x92b0('0x22')]={};this[_0x92b0('0x23')]={};this[_0x92b0('0x24')]={};};function freeIsNotKey(_0x251950,_0x5d45ca,_0x340ee8){var _0x5e1170=_[_0x92b0('0x25')](_0x251950,function(_0x129b3d,_0x5d82a3){return _0x129b3d[_0x340ee8];});for(var _0x267e51 in _0x5d45ca){if(_0x5d45ca[_0x92b0('0x26')](_0x267e51)){if(!_0x5e1170[_0x267e51]){delete _0x5d45ca[_0x267e51];}}}}function freeIsNotKeySip(_0x2603e2,_0x209bbe){var _0x1ca2c8=_[_0x92b0('0x25')](_0x2603e2,function(_0x12586d,_0xb72abc){return util[_0x92b0('0x27')](_0x92b0('0x28'),_0x12586d[_0x92b0('0x29')]);});for(var _0x52ef3d in _0x209bbe){if(_0x209bbe[_0x92b0('0x26')](_0x52ef3d)){if(!_0x1ca2c8[_0x52ef3d]){delete _0x209bbe[_0x52ef3d];}}}}function freeIsNotKeyAgent(_0x37b5fb,_0x534122){var _0x3b8232=_['mapKeys'](_0x37b5fb,function(_0x150434,_0xa22588){var _0x38a40f=_['isNil'](_0x150434[_0x92b0('0x2a')])?util[_0x92b0('0x27')]('SIP/%s',_0x150434['name']):_0x150434[_0x92b0('0x2a')];return _0x38a40f;});for(var _0x41d3e0 in _0x534122){if(_0x534122[_0x92b0('0x26')](_0x41d3e0)){if(!_0x3b8232[_0x41d3e0]){delete _0x534122[_0x41d3e0];}}}}function clearVoiceCallReports(_0x5920f3){_0x5920f3[_0x92b0('0x2b')]=0x0;_0x5920f3[_0x92b0('0x2c')]=0x0;_0x5920f3[_0x92b0('0x2d')]=0x0;_0x5920f3[_0x92b0('0x2e')]=0x0;_0x5920f3[_0x92b0('0x2f')]=0x0;}function clearCampaigns(_0x40759f){if(!_[_0x92b0('0x30')](_0x40759f)){for(var _0x2a1cf0 in _0x40759f){if(_0x40759f[_0x92b0('0x26')](_0x2a1cf0)){_0x40759f[_0x2a1cf0][_0x92b0('0x31')]=0x0;_0x40759f[_0x2a1cf0][_0x92b0('0x32')]=0x0;}}}}function clearVoiceQueues(_0x1cbc9d){if(!_[_0x92b0('0x30')](_0x1cbc9d)){for(var _0x30db8e in _0x1cbc9d){if(_0x1cbc9d[_0x92b0('0x26')](_0x30db8e)){_0x1cbc9d[_0x30db8e][_0x92b0('0x2b')]=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x2c')]=0x0;_0x1cbc9d[_0x30db8e]['unmanaged']=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x33')]=0x0;_0x1cbc9d[_0x30db8e]['sumHoldTime']=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x2e')]=0x0;_0x1cbc9d[_0x30db8e]['sumBillable']=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x34')]=0x0;_0x1cbc9d[_0x30db8e]['outboundNoAnswerCallsDay']=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x35')]=0x0;_0x1cbc9d[_0x30db8e]['outboundCongestionCallsDay']=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x36')]=0x0;_0x1cbc9d[_0x30db8e]['outboundUnknownCallsDay']=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x37')]=0x0;_0x1cbc9d[_0x30db8e]['outboundDropCallsDayCallersExit']=0x0;_0x1cbc9d[_0x30db8e]['outboundBlacklistCallsDay']=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x38')]=0x0;_0x1cbc9d[_0x30db8e]['outboundRejectCallsDay']=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x39')]=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x34')]=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x3a')]=0x0;_0x1cbc9d[_0x30db8e][_0x92b0('0x3b')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x3099bb,_0x36270a){for(var _0x1e4cdd in _0x36270a){if(_0x3099bb[_0x92b0('0x26')](_0x1e4cdd)){_0x3099bb[_0x1e4cdd]=_0x36270a[_0x1e4cdd];}}};Realtime[_0x92b0('0x3c')][_0x92b0('0x3d')]=function(){var _0x363460=this;return function(_0x24befb){if(_0x24befb){freeIsNotKeyAgent(_0x24befb,_0x363460[_0x92b0('0xf')]);for(var _0x17b731=0x0,_0x393c6c={},_0x4e3e0a={};_0x17b731<_0x24befb[_0x92b0('0x3e')];_0x17b731+=0x1){_0x393c6c=_0x24befb[_0x17b731];var _0x9e16b4=_['isNil'](_0x393c6c[_0x92b0('0x2a')])?util['format'](_0x92b0('0x28'),_0x393c6c['name']):_0x393c6c['interface'];if(_['isUndefined'](_0x363460[_0x92b0('0xf')][_0x9e16b4])){_0x363460['agents'][_0x9e16b4]=new Agent(_0x393c6c);}else{_0x363460['mergeFromDatabase'](_0x363460[_0x92b0('0xf')][_0x9e16b4],_0x393c6c);}}}return _0x363460[_0x92b0('0xf')];};};Realtime[_0x92b0('0x3c')]['initTelephones']=function(){var _0x3c7d93=this;return function(_0x462cbd){if(_0x462cbd){freeIsNotKeySip(_0x462cbd,_0x3c7d93[_0x92b0('0x3f')]);for(var _0x33a8e5=0x0,_0x312b50={},_0x2d5016={};_0x33a8e5<_0x462cbd[_0x92b0('0x3e')];_0x33a8e5+=0x1){_0x312b50=_0x462cbd[_0x33a8e5];if(_[_0x92b0('0x40')](_0x3c7d93[_0x92b0('0x3f')][util['format'](_0x92b0('0x28'),_0x312b50['name'])])){_0x3c7d93[_0x92b0('0x3f')][util[_0x92b0('0x27')](_0x92b0('0x28'),_0x312b50['name'])]=new Telephone(_0x312b50);}else{_0x3c7d93[_0x92b0('0x41')](_0x3c7d93[_0x92b0('0x3f')][util[_0x92b0('0x27')](_0x92b0('0x28'),_0x312b50[_0x92b0('0x29')])],_0x312b50);}}}return _0x3c7d93[_0x92b0('0x3f')];};};Realtime[_0x92b0('0x3c')]['initTrunks']=function(){var _0x6aad43=this;return function(_0x3bf0f5){if(_0x3bf0f5){freeIsNotKeySip(_0x3bf0f5,_0x6aad43[_0x92b0('0x10')]);for(var _0x4a69e9=0x0,_0xdc9b43={},_0x301140={};_0x4a69e9<_0x3bf0f5[_0x92b0('0x3e')];_0x4a69e9+=0x1){_0xdc9b43=_0x3bf0f5[_0x4a69e9];if(_[_0x92b0('0x40')](_0x6aad43[_0x92b0('0x10')][util[_0x92b0('0x27')]('SIP/%s',_0xdc9b43[_0x92b0('0x29')])])){_0x6aad43['trunks'][util[_0x92b0('0x27')](_0x92b0('0x28'),_0xdc9b43[_0x92b0('0x29')])]=new Trunk(_0xdc9b43);}else{_0x6aad43['mergeFromDatabase'](_0x6aad43[_0x92b0('0x10')][util[_0x92b0('0x27')]('SIP/%s',_0xdc9b43[_0x92b0('0x29')])],_0xdc9b43);}}}return _0x6aad43[_0x92b0('0x10')];};};Realtime[_0x92b0('0x3c')]['initVoiceQueues']=function(){var _0x72def3=this;return function(_0x95c51c){if(_0x95c51c){freeIsNotKey(_0x95c51c,_0x72def3['voiceQueues'],'name');for(var _0x5b8fb0=0x0,_0xabea11={},_0x2520a9={};_0x5b8fb0<_0x95c51c['length'];_0x5b8fb0+=0x1){_0xabea11=_0x95c51c[_0x5b8fb0];if(_[_0x92b0('0x40')](_0x72def3[_0x92b0('0x11')][_0xabea11[_0x92b0('0x29')]])){_0x72def3[_0x92b0('0x11')][_0xabea11[_0x92b0('0x29')]]=new VoiceQueue(_0xabea11);}else{_0x72def3[_0x92b0('0x41')](_0x72def3[_0x92b0('0x11')][_0xabea11['name']],_0xabea11);}}}return _0x72def3[_0x92b0('0x11')];};};Realtime[_0x92b0('0x3c')][_0x92b0('0x42')]=function(){var _0x227791=this;return function(_0x434be2){if(_0x434be2){freeIsNotKey(_0x434be2,_0x227791[_0x92b0('0x43')],'id');for(var _0x1f8f7b=0x0,_0x4c6294={},_0x119373={};_0x1f8f7b<_0x434be2[_0x92b0('0x3e')];_0x1f8f7b+=0x1){_0x4c6294=_0x434be2[_0x1f8f7b];if(_[_0x92b0('0x40')](_0x227791[_0x92b0('0x43')][_0x4c6294['id']])){_0x227791[_0x92b0('0x43')][_0x4c6294['id']]=new Trigger(_0x4c6294);}else{_0x227791[_0x92b0('0x41')](_0x227791[_0x92b0('0x43')][_0x4c6294['id']],_0x4c6294);}}}return _0x227791['triggers'];};};Realtime[_0x92b0('0x3c')][_0x92b0('0x44')]=function(){var _0x4a4725=this;return function(_0x3f90b6){if(_0x3f90b6){freeIsNotKey(_0x3f90b6,_0x4a4725[_0x92b0('0x13')],'id');for(var _0x29064a=0x0,_0x531cdb={},_0x1ffe0e={};_0x29064a<_0x3f90b6[_0x92b0('0x3e')];_0x29064a+=0x1){_0x531cdb=_0x3f90b6[_0x29064a];if(_[_0x92b0('0x40')](_0x4a4725[_0x92b0('0x13')][_0x531cdb['id']])){_0x4a4725[_0x92b0('0x13')][_0x531cdb['id']]=new Template(_0x531cdb);}else{_0x4a4725['mergeFromDatabase'](_0x4a4725[_0x92b0('0x13')][_0x531cdb['id']],_0x531cdb);}}}return _0x4a4725['templates'];};};Realtime[_0x92b0('0x3c')]['initZendeskAccounts']=function(){var _0x20745e=this;return function(_0x539faf){if(_0x539faf){freeIsNotKey(_0x539faf,_0x20745e['zendeskAccounts'],'id');for(var _0x558f1a=0x0,_0x36b689={},_0x675be2={};_0x558f1a<_0x539faf[_0x92b0('0x3e')];_0x558f1a+=0x1){_0x36b689=_0x539faf[_0x558f1a];if(_[_0x92b0('0x40')](_0x20745e['zendeskAccounts'][_0x36b689['id']])){_0x20745e['zendeskAccounts'][_0x36b689['id']]=new ZendeskAccount(_0x36b689);}else{_0x20745e[_0x92b0('0x41')](_0x20745e[_0x92b0('0x1a')][_0x36b689['id']],_0x36b689);}}}return _0x20745e[_0x92b0('0x1a')];};};Realtime[_0x92b0('0x3c')][_0x92b0('0x45')]=function(){var _0x4d6932=this;return function(_0x1ac344){if(_0x1ac344){freeIsNotKey(_0x1ac344,_0x4d6932['salesforceAccounts'],'id');for(var _0x10f90f=0x0,_0x2dc629={},_0x2e4aa3={};_0x10f90f<_0x1ac344[_0x92b0('0x3e')];_0x10f90f+=0x1){_0x2dc629=_0x1ac344[_0x10f90f];if(_[_0x92b0('0x40')](_0x4d6932[_0x92b0('0x1b')][_0x2dc629['id']])){_0x4d6932['salesforceAccounts'][_0x2dc629['id']]=new SalesforceAccount(_0x2dc629);}else{_0x4d6932[_0x92b0('0x41')](_0x4d6932['salesforceAccounts'][_0x2dc629['id']],_0x2dc629);}}}return _0x4d6932[_0x92b0('0x1b')];};};Realtime['prototype'][_0x92b0('0x46')]=function(){var _0x2be0c1=this;return function(_0x5ee1c0){if(_0x5ee1c0){freeIsNotKey(_0x5ee1c0,_0x2be0c1['freshdeskAccounts'],'id');for(var _0x3964d2=0x0,_0x1cd7b9={},_0x1e08b8={};_0x3964d2<_0x5ee1c0[_0x92b0('0x3e')];_0x3964d2+=0x1){_0x1cd7b9=_0x5ee1c0[_0x3964d2];if(_[_0x92b0('0x40')](_0x2be0c1[_0x92b0('0x1d')][_0x1cd7b9['id']])){_0x2be0c1['freshdeskAccounts'][_0x1cd7b9['id']]=new FreshdeskAccount(_0x1cd7b9);}else{_0x2be0c1[_0x92b0('0x41')](_0x2be0c1[_0x92b0('0x1d')][_0x1cd7b9['id']],_0x1cd7b9);}}}return _0x2be0c1[_0x92b0('0x1d')];};};Realtime[_0x92b0('0x3c')][_0x92b0('0x47')]=function(){var _0x3cdbc3=this;return function(_0x37d94a){if(_0x37d94a){freeIsNotKey(_0x37d94a,_0x3cdbc3[_0x92b0('0x1e')],'id');for(var _0x39cac7=0x0,_0x1e5fab={},_0x2e3261={};_0x39cac7<_0x37d94a['length'];_0x39cac7+=0x1){_0x1e5fab=_0x37d94a[_0x39cac7];if(_['isUndefined'](_0x3cdbc3[_0x92b0('0x1e')][_0x1e5fab['id']])){_0x3cdbc3['zohoAccounts'][_0x1e5fab['id']]=new ZohoAccount(_0x1e5fab);}else{_0x3cdbc3[_0x92b0('0x41')](_0x3cdbc3[_0x92b0('0x1e')][_0x1e5fab['id']],_0x1e5fab);}}}return _0x3cdbc3['zohoAccounts'];};};Realtime[_0x92b0('0x3c')][_0x92b0('0x48')]=function(){var _0x1ed03f=this;return function(_0x13a98a){if(_0x13a98a){freeIsNotKey(_0x13a98a,_0x1ed03f['deskAccounts'],'id');for(var _0x44f94f=0x0,_0x429221={},_0x41622a={};_0x44f94f<_0x13a98a[_0x92b0('0x3e')];_0x44f94f+=0x1){_0x429221=_0x13a98a[_0x44f94f];if(_['isUndefined'](_0x1ed03f['deskAccounts'][_0x429221['id']])){_0x1ed03f[_0x92b0('0x1f')][_0x429221['id']]=new DeskAccount(_0x429221);}else{_0x1ed03f[_0x92b0('0x41')](_0x1ed03f[_0x92b0('0x1f')][_0x429221['id']],_0x429221);}}}return _0x1ed03f[_0x92b0('0x1f')];};};Realtime['prototype'][_0x92b0('0x49')]=function(){var _0x350196=this;return function(_0x531b50){if(_0x531b50){freeIsNotKey(_0x531b50,_0x350196[_0x92b0('0x1c')],'id');for(var _0x3e64f1=0x0,_0x5dcbff={},_0x2d065f={};_0x3e64f1<_0x531b50[_0x92b0('0x3e')];_0x3e64f1+=0x1){_0x5dcbff=_0x531b50[_0x3e64f1];if(_[_0x92b0('0x40')](_0x350196[_0x92b0('0x1c')][_0x5dcbff['id']])){_0x350196['sugarcrmAccounts'][_0x5dcbff['id']]=new SugarcrmAccount(_0x5dcbff);}else{_0x350196[_0x92b0('0x41')](_0x350196['sugarcrmAccounts'][_0x5dcbff['id']],_0x5dcbff);}}}return _0x350196[_0x92b0('0x1c')];};};Realtime[_0x92b0('0x3c')][_0x92b0('0x4a')]=function(){var _0x3bbab8=this;return function(_0x4d62f8){if(_0x4d62f8){freeIsNotKey(_0x4d62f8,_0x3bbab8['vtigerAccounts'],'id');for(var _0x10b02f=0x0,_0x281eb8={},_0x46299c={};_0x10b02f<_0x4d62f8[_0x92b0('0x3e')];_0x10b02f+=0x1){_0x281eb8=_0x4d62f8[_0x10b02f];if(_[_0x92b0('0x40')](_0x3bbab8[_0x92b0('0x20')][_0x281eb8['id']])){_0x3bbab8['vtigerAccounts'][_0x281eb8['id']]=new VtigerAccount(_0x281eb8);}else{_0x3bbab8[_0x92b0('0x41')](_0x3bbab8['vtigerAccounts'][_0x281eb8['id']],_0x281eb8);}}}return _0x3bbab8[_0x92b0('0x20')];};};Realtime[_0x92b0('0x3c')]['initServicenowAccounts']=function(){var _0x411623=this;return function(_0x244a28){if(_0x244a28){freeIsNotKey(_0x244a28,_0x411623['servicenowAccounts'],'id');for(var _0x54e01c=0x0,_0x4958fe={},_0x55037b={};_0x54e01c<_0x244a28[_0x92b0('0x3e')];_0x54e01c+=0x1){_0x4958fe=_0x244a28[_0x54e01c];if(_[_0x92b0('0x40')](_0x411623[_0x92b0('0x21')][_0x4958fe['id']])){_0x411623[_0x92b0('0x21')][_0x4958fe['id']]=new ServicenowAccount(_0x4958fe);}else{_0x411623[_0x92b0('0x41')](_0x411623[_0x92b0('0x21')][_0x4958fe['id']],_0x4958fe);}}}return _0x411623[_0x92b0('0x21')];};};Realtime[_0x92b0('0x3c')][_0x92b0('0x4b')]=function(){var _0x208496=this;return function(_0x5ec83a){if(_0x5ec83a){freeIsNotKey(_0x5ec83a,_0x208496['dynamics365Accounts'],'id');for(var _0x317da6=0x0,_0x6e746c={},_0x3c3f10={};_0x317da6<_0x5ec83a['length'];_0x317da6+=0x1){_0x6e746c=_0x5ec83a[_0x317da6];if(_[_0x92b0('0x40')](_0x208496[_0x92b0('0x22')][_0x6e746c['id']])){_0x208496[_0x92b0('0x22')][_0x6e746c['id']]=new Dynamics365Account(_0x6e746c);}else{_0x208496[_0x92b0('0x41')](_0x208496[_0x92b0('0x22')][_0x6e746c['id']],_0x6e746c);}}}return _0x208496['dynamics365Accounts'];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x1cbc94=this;return function(_0x13e7cf){if(_0x13e7cf){freeIsNotKey(_0x13e7cf,_0x1cbc94['freshsalesAccounts'],'id');for(var _0x3a85cc=0x0,_0x218ea4={},_0x3c6712={};_0x3a85cc<_0x13e7cf[_0x92b0('0x3e')];_0x3a85cc+=0x1){_0x218ea4=_0x13e7cf[_0x3a85cc];if(_[_0x92b0('0x40')](_0x1cbc94[_0x92b0('0x23')][_0x218ea4['id']])){_0x1cbc94[_0x92b0('0x23')][_0x218ea4['id']]=new FreshsalesAccount(_0x218ea4);}else{_0x1cbc94[_0x92b0('0x41')](_0x1cbc94[_0x92b0('0x23')][_0x218ea4['id']],_0x218ea4);}}}return _0x1cbc94[_0x92b0('0x23')];};};Realtime[_0x92b0('0x3c')]['initVoiceQueueHopperHistory']=function(){var _0xfe268e=this;return function(_0x3f4b8a){for(var _0x3693fd=0x0;_0x3693fd<_0x3f4b8a[_0x92b0('0x3e')];_0x3693fd+=0x1){_['merge'](_0xfe268e[_0x92b0('0x11')][_0x3f4b8a[_0x3693fd][_0x92b0('0x29')]],_0x3f4b8a[_0x3693fd]);}return _0xfe268e[_0x92b0('0x11')];};};Realtime[_0x92b0('0x3c')][_0x92b0('0x4c')]=function(){var _0x3a7fa4=this;return function(_0xdfcf81){clearVoiceQueues(_0x3a7fa4[_0x92b0('0x11')]);if(_0xdfcf81){_0xdfcf81=_[_0x92b0('0x4d')](_0xdfcf81,_0x92b0('0x4e'));for(var _0x2c3315 in _0xdfcf81){if(_0xdfcf81[_0x92b0('0x26')](_0x2c3315)){var _0x37a564={};for(var _0x3a1e77=0x0;_0x3a1e77<_0xdfcf81[_0x2c3315][_0x92b0('0x3e')];_0x3a1e77+=0x1){var _0x5a5796=_0xdfcf81[_0x2c3315][_0x3a1e77][_0x92b0('0x4f')];if(_0x3a7fa4[_0x92b0('0x11')][_0x5a5796]){if(_0xdfcf81[_0x2c3315][_0x3a1e77]['queuecallerexit']){_0x3a7fa4[_0x92b0('0x11')][_0x5a5796]['unmanaged']+=0x1;}if(_0xdfcf81[_0x2c3315][_0x3a1e77]['queuecallerabandon']){_0x3a7fa4['voiceQueues'][_0x5a5796]['abandoned']+=0x1;}_0x3a7fa4[_0x92b0('0x11')][_0x5a5796]['sumHoldTime']+=moment(_0xdfcf81[_0x2c3315][_0x3a1e77][_0x92b0('0x50')])[_0x92b0('0x51')](moment(_0xdfcf81[_0x2c3315][_0x3a1e77][_0x92b0('0x52')]),_0x92b0('0x53'))||0x0;if(_0x3a1e77===_0xdfcf81[_0x2c3315][_0x92b0('0x3e')]-0x1){_0x3a7fa4[_0x92b0('0x11')][_0x5a5796]['sumDuration']+=moment(_0xdfcf81[_0x2c3315][_0x3a1e77][_0x92b0('0x54')]||_0xdfcf81[_0x2c3315][_0x3a1e77]['queuecallerabandonAt']||_0xdfcf81[_0x2c3315][_0x3a1e77]['queuecallerexitAt'])[_0x92b0('0x51')](moment(_0xdfcf81[_0x2c3315][_0x3a1e77][_0x92b0('0x52')]),_0x92b0('0x53'))||0x0;_0x3a7fa4[_0x92b0('0x11')][_0x5a5796][_0x92b0('0x2b')]+=0x1;if(_0xdfcf81[_0x2c3315][_0x3a1e77][_0x92b0('0x55')]){_0x3a7fa4[_0x92b0('0x11')][_0x5a5796][_0x92b0('0x2c')]+=0x1;_0x3a7fa4[_0x92b0('0x11')][_0x5a5796][_0x92b0('0x2f')]+=moment(_0xdfcf81[_0x2c3315][_0x3a1e77][_0x92b0('0x54')])[_0x92b0('0x51')](moment(_0xdfcf81[_0x2c3315][_0x3a1e77]['queuecallerleaveAt']),_0x92b0('0x53'))||0x0;}}else{_0x3a7fa4['voiceQueues'][_0x5a5796][_0x92b0('0x2e')]+=_0x3a7fa4['voiceQueues'][_0x5a5796][_0x92b0('0x2d')]||0x0;}}}}}}return _0x3a7fa4[_0x92b0('0x11')];};};Realtime['prototype'][_0x92b0('0x56')]=function(){var _0x265476=this;return function(_0x143324){clearVoiceCallReports(_0x265476['outbound']);if(_0x143324){for(var _0x24fb80=0x0;_0x24fb80<_0x143324[_0x92b0('0x3e')];_0x24fb80+=0x1){_0x265476[_0x92b0('0x57')][_0x92b0('0x2b')]+=0x1;_0x265476['outbound']['sumDuration']+=_0x143324[_0x24fb80][_0x92b0('0x58')];if(_0x143324[_0x24fb80][_0x92b0('0x59')]===_0x92b0('0x5a')){_0x265476[_0x92b0('0x57')][_0x92b0('0x2c')]+=0x1;_0x265476[_0x92b0('0x57')][_0x92b0('0x2d')]+=_0x143324[_0x24fb80][_0x92b0('0x58')]-_0x143324[_0x24fb80][_0x92b0('0x5b')]||0x0;_0x265476['outbound']['sumBillable']+=_0x143324[_0x24fb80][_0x92b0('0x5b')];}}}return _0x265476[_0x92b0('0x57')];};};Realtime[_0x92b0('0x3c')][_0x92b0('0x5c')]=function(){var _0x2b3a00=this;return function(_0x1d7505){if(_0x1d7505){freeIsNotKey(_0x1d7505,_0x2b3a00['campaigns'],'name');for(var _0x15785d=0x0,_0x311d75={};_0x15785d<_0x1d7505[_0x92b0('0x3e')];_0x15785d+=0x1){_0x311d75=_0x1d7505[_0x15785d];if(_[_0x92b0('0x40')](_0x2b3a00['campaigns'][_0x311d75[_0x92b0('0x29')]])){_0x2b3a00[_0x92b0('0x12')][_0x311d75['name']]=new Campaign(_0x311d75);}else{_0x2b3a00[_0x92b0('0x41')](_0x2b3a00[_0x92b0('0x12')][_0x311d75[_0x92b0('0x29')]],_0x311d75);_0x2b3a00[_0x92b0('0x12')][_0x311d75[_0x92b0('0x29')]][_0x92b0('0x5d')]=_0x311d75['SquareProject']?_0x311d75['SquareProject']['name']:undefined;}}}return _0x2b3a00[_0x92b0('0x12')];};};Realtime['prototype'][_0x92b0('0x5e')]=function(){var _0x2b4cdf=this;return function(_0x54ec20){if(_0x54ec20){freeIsNotKey(_0x54ec20,_0x2b4cdf['voiceExtensions'],'id');for(var _0x380110=0x0,_0x55330b={};_0x380110<_0x54ec20['length'];_0x380110+=0x1){_0x55330b=_0x54ec20[_0x380110];if(_['isUndefined'](_0x2b4cdf[_0x92b0('0x14')][_0x55330b['id']])){_0x2b4cdf[_0x92b0('0x14')][_0x55330b['id']]=new VoiceExtension(_0x55330b);}else{_0x2b4cdf[_0x92b0('0x41')](_0x2b4cdf[_0x92b0('0x14')][_0x55330b['id']],_0x55330b);}}}return _0x2b4cdf[_0x92b0('0x14')];};};Realtime[_0x92b0('0x3c')]['initCampaignHopperHistory']=function(){var _0x5a966b=this;return function(_0x3c343d){clearCampaigns(_0x5a966b[_0x92b0('0x12')]);for(var _0x181150=0x0;_0x181150<_0x3c343d[_0x92b0('0x3e')];_0x181150+=0x1){_[_0x92b0('0x5f')](_0x5a966b[_0x92b0('0x12')][_0x3c343d[_0x181150][_0x92b0('0x29')]],_0x3c343d[_0x181150]);}return _0x5a966b[_0x92b0('0x12')];};};Realtime['prototype'][_0x92b0('0x60')]=function(){var _0x5f3646=this;return function(_0x48199f){if(_0x48199f){freeIsNotKey(_0x48199f,_0x5f3646[_0x92b0('0x24')],'id');for(var _0xa5813e=0x0,_0x35a11d={},_0x362fd2={};_0xa5813e<_0x48199f['length'];_0xa5813e+=0x1){_0x35a11d=_0x48199f[_0xa5813e];if(_[_0x92b0('0x40')](_0x5f3646[_0x92b0('0x24')][_0x35a11d['id']])){_0x5f3646[_0x92b0('0x24')][_0x35a11d['id']]=new FaxAccount(_0x35a11d);}else{_0x5f3646[_0x92b0('0x41')](_0x5f3646[_0x92b0('0x24')][_0x35a11d['id']],_0x35a11d);}}}return _0x5f3646['faxAccounts'];};};module[_0x92b0('0x61')]=Realtime;
\ No newline at end of file
+var _0xae5a=['bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','hasOwnProperty','mapKeys','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','format','mergeFromDatabase','initTelephones','telephones','isUndefined','initTrunks','trunks','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','unmanaged','queuecallerleaveAt','queuecallerjoinAt','seconds','sumDuration','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','faxAccounts'];(function(_0x486cb8,_0x2e8838){var _0x1e7d94=function(_0x34a00e){while(--_0x34a00e){_0x486cb8['push'](_0x486cb8['shift']());}};_0x1e7d94(++_0x2e8838);}(_0xae5a,0x15c));var _0xaae5=function(_0x5189e2,_0x565ba4){_0x5189e2=_0x5189e2-0x0;var _0x5f2763=_0xae5a[_0x5189e2];return _0x5f2763;};'use strict';var BPromise=require(_0xaae5('0x0'));var util=require(_0xaae5('0x1'));var _=require(_0xaae5('0x2'));var moment=require(_0xaae5('0x3'));var Agent=require(_0xaae5('0x4'));var Telephone=require(_0xaae5('0x5'));var Trunk=require(_0xaae5('0x6'));var VoiceQueue=require(_0xaae5('0x7'));var Trigger=require(_0xaae5('0x8'));var Template=require(_0xaae5('0x9'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xaae5('0xa'));var ZendeskAccount=require(_0xaae5('0xb'));var SalesforceAccount=require(_0xaae5('0xc'));var FreshdeskAccount=require(_0xaae5('0xd'));var SugarcrmAccount=require(_0xaae5('0xe'));var ZohoAccount=require(_0xaae5('0xf'));var DeskAccount=require(_0xaae5('0x10'));var VtigerAccount=require(_0xaae5('0x11'));var ServicenowAccount=require(_0xaae5('0x12'));var Dynamics365Account=require(_0xaae5('0x13'));var FreshsalesAccount=require(_0xaae5('0x14'));var FaxAccount=require(_0xaae5('0x15'));var Realtime=function(){this[_0xaae5('0x16')]={};this['telephones']={};this['trunks']={};this[_0xaae5('0x17')]={};this[_0xaae5('0x18')]={};this[_0xaae5('0x19')]={};this['templates']={};this[_0xaae5('0x1a')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xaae5('0x1b')]={};this[_0xaae5('0x1c')]={};this[_0xaae5('0x1d')]={};this[_0xaae5('0x1e')]={};this[_0xaae5('0x1f')]={};this[_0xaae5('0x20')]={};this[_0xaae5('0x21')]={};this[_0xaae5('0x22')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xaae5('0x23')]={};this[_0xaae5('0x24')]={};this[_0xaae5('0x25')]={};this['servicenowAccounts']={};this[_0xaae5('0x26')]={};this[_0xaae5('0x27')]={};this['faxAccounts']={};};function freeIsNotKey(_0x4c6fd1,_0x35cd6,_0x18fa09){var _0x836026=_['mapKeys'](_0x4c6fd1,function(_0x930454,_0x5ae3cd){return _0x930454[_0x18fa09];});for(var _0x47d896 in _0x35cd6){if(_0x35cd6[_0xaae5('0x28')](_0x47d896)){if(!_0x836026[_0x47d896]){delete _0x35cd6[_0x47d896];}}}}function freeIsNotKeySip(_0x32ed06,_0x5da3f0){var _0x329d9b=_[_0xaae5('0x29')](_0x32ed06,function(_0x21f77d,_0x37f95b){return util['format'](_0xaae5('0x2a'),_0x21f77d[_0xaae5('0x2b')]);});for(var _0x487c49 in _0x5da3f0){if(_0x5da3f0['hasOwnProperty'](_0x487c49)){if(!_0x329d9b[_0x487c49]){delete _0x5da3f0[_0x487c49];}}}}function freeIsNotKeyAgent(_0x195603,_0x467b57){var _0x16f7fe=_['mapKeys'](_0x195603,function(_0x38ef98,_0x4fa6e8){var _0x2225d9=_[_0xaae5('0x2c')](_0x38ef98['interface'])?util['format'](_0xaae5('0x2a'),_0x38ef98[_0xaae5('0x2b')]):_0x38ef98[_0xaae5('0x2d')];return _0x2225d9;});for(var _0x10d9d3 in _0x467b57){if(_0x467b57['hasOwnProperty'](_0x10d9d3)){if(!_0x16f7fe[_0x10d9d3]){delete _0x467b57[_0x10d9d3];}}}}function clearVoiceCallReports(_0x5da932){_0x5da932[_0xaae5('0x2e')]=0x0;_0x5da932[_0xaae5('0x2f')]=0x0;_0x5da932[_0xaae5('0x30')]=0x0;_0x5da932['sumDuration']=0x0;_0x5da932[_0xaae5('0x31')]=0x0;}function clearCampaigns(_0x30a4ee){if(!_[_0xaae5('0x32')](_0x30a4ee)){for(var _0x266eb4 in _0x30a4ee){if(_0x30a4ee[_0xaae5('0x28')](_0x266eb4)){_0x30a4ee[_0x266eb4][_0xaae5('0x33')]=0x0;_0x30a4ee[_0x266eb4]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x5cdc92){if(!_['isEmpty'](_0x5cdc92)){for(var _0x435fca in _0x5cdc92){if(_0x5cdc92[_0xaae5('0x28')](_0x435fca)){_0x5cdc92[_0x435fca][_0xaae5('0x2e')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x2f')]=0x0;_0x5cdc92[_0x435fca]['unmanaged']=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x34')]=0x0;_0x5cdc92[_0x435fca]['sumHoldTime']=0x0;_0x5cdc92[_0x435fca]['sumDuration']=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x31')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x35')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x36')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x37')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x38')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x39')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x3a')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x3b')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x3c')]=0x0;_0x5cdc92[_0x435fca]['outboundBlacklistCallsDay']=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x3d')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x3e')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x3f')]=0x0;_0x5cdc92[_0x435fca]['outboundAnswerAgiCallsDay']=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x40')]=0x0;_0x5cdc92[_0x435fca][_0xaae5('0x41')]=!![];}}}}Realtime[_0xaae5('0x42')]['mergeFromDatabase']=function(_0x2ff07a,_0x1af213){for(var _0x20695e in _0x1af213){if(_0x2ff07a[_0xaae5('0x28')](_0x20695e)){_0x2ff07a[_0x20695e]=_0x1af213[_0x20695e];}}};Realtime[_0xaae5('0x42')][_0xaae5('0x43')]=function(){var _0x31399a=this;return function(_0x28dfe2){if(_0x28dfe2){freeIsNotKeyAgent(_0x28dfe2,_0x31399a[_0xaae5('0x16')]);for(var _0x639f3=0x0,_0x27d640={},_0x207864={};_0x639f3<_0x28dfe2[_0xaae5('0x44')];_0x639f3+=0x1){_0x27d640=_0x28dfe2[_0x639f3];var _0x349b73=_[_0xaae5('0x2c')](_0x27d640[_0xaae5('0x2d')])?util[_0xaae5('0x45')](_0xaae5('0x2a'),_0x27d640[_0xaae5('0x2b')]):_0x27d640['interface'];if(_['isUndefined'](_0x31399a[_0xaae5('0x16')][_0x349b73])){_0x31399a[_0xaae5('0x16')][_0x349b73]=new Agent(_0x27d640);}else{_0x31399a[_0xaae5('0x46')](_0x31399a[_0xaae5('0x16')][_0x349b73],_0x27d640);}}}return _0x31399a[_0xaae5('0x16')];};};Realtime['prototype'][_0xaae5('0x47')]=function(){var _0x3eae7d=this;return function(_0x674e6){if(_0x674e6){freeIsNotKeySip(_0x674e6,_0x3eae7d[_0xaae5('0x48')]);for(var _0x1e60e6=0x0,_0x2451f5={},_0x4dc843={};_0x1e60e6<_0x674e6[_0xaae5('0x44')];_0x1e60e6+=0x1){_0x2451f5=_0x674e6[_0x1e60e6];if(_[_0xaae5('0x49')](_0x3eae7d[_0xaae5('0x48')][util[_0xaae5('0x45')](_0xaae5('0x2a'),_0x2451f5[_0xaae5('0x2b')])])){_0x3eae7d[_0xaae5('0x48')][util[_0xaae5('0x45')](_0xaae5('0x2a'),_0x2451f5[_0xaae5('0x2b')])]=new Telephone(_0x2451f5);}else{_0x3eae7d[_0xaae5('0x46')](_0x3eae7d[_0xaae5('0x48')][util[_0xaae5('0x45')](_0xaae5('0x2a'),_0x2451f5[_0xaae5('0x2b')])],_0x2451f5);}}}return _0x3eae7d[_0xaae5('0x48')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x4a')]=function(){var _0x334dc8=this;return function(_0x5585c1){if(_0x5585c1){freeIsNotKeySip(_0x5585c1,_0x334dc8[_0xaae5('0x4b')]);for(var _0xcc35ab=0x0,_0x201c0c={},_0x3070d5={};_0xcc35ab<_0x5585c1['length'];_0xcc35ab+=0x1){_0x201c0c=_0x5585c1[_0xcc35ab];if(_[_0xaae5('0x49')](_0x334dc8['trunks'][util[_0xaae5('0x45')](_0xaae5('0x2a'),_0x201c0c['name'])])){_0x334dc8['trunks'][util[_0xaae5('0x45')](_0xaae5('0x2a'),_0x201c0c[_0xaae5('0x2b')])]=new Trunk(_0x201c0c);}else{_0x334dc8[_0xaae5('0x46')](_0x334dc8[_0xaae5('0x4b')][util[_0xaae5('0x45')](_0xaae5('0x2a'),_0x201c0c[_0xaae5('0x2b')])],_0x201c0c);}}}return _0x334dc8[_0xaae5('0x4b')];};};Realtime[_0xaae5('0x42')]['initVoiceQueues']=function(){var _0x4f1ea9=this;return function(_0x4bbe76){if(_0x4bbe76){freeIsNotKey(_0x4bbe76,_0x4f1ea9[_0xaae5('0x17')],_0xaae5('0x2b'));for(var _0x4e30be=0x0,_0x259a0c={},_0xe7d801={};_0x4e30be<_0x4bbe76[_0xaae5('0x44')];_0x4e30be+=0x1){_0x259a0c=_0x4bbe76[_0x4e30be];if(_[_0xaae5('0x49')](_0x4f1ea9[_0xaae5('0x17')][_0x259a0c[_0xaae5('0x2b')]])){_0x4f1ea9[_0xaae5('0x17')][_0x259a0c[_0xaae5('0x2b')]]=new VoiceQueue(_0x259a0c);}else{_0x4f1ea9[_0xaae5('0x46')](_0x4f1ea9[_0xaae5('0x17')][_0x259a0c[_0xaae5('0x2b')]],_0x259a0c);}}}return _0x4f1ea9[_0xaae5('0x17')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x4c')]=function(){var _0x229da5=this;return function(_0xe2035){if(_0xe2035){freeIsNotKey(_0xe2035,_0x229da5['triggers'],'id');for(var _0x2e437f=0x0,_0x49b31f={},_0x23cf57={};_0x2e437f<_0xe2035[_0xaae5('0x44')];_0x2e437f+=0x1){_0x49b31f=_0xe2035[_0x2e437f];if(_['isUndefined'](_0x229da5[_0xaae5('0x18')][_0x49b31f['id']])){_0x229da5[_0xaae5('0x18')][_0x49b31f['id']]=new Trigger(_0x49b31f);}else{_0x229da5[_0xaae5('0x46')](_0x229da5[_0xaae5('0x18')][_0x49b31f['id']],_0x49b31f);}}}return _0x229da5['triggers'];};};Realtime[_0xaae5('0x42')][_0xaae5('0x4d')]=function(){var _0x18d6c8=this;return function(_0x372117){if(_0x372117){freeIsNotKey(_0x372117,_0x18d6c8[_0xaae5('0x4e')],'id');for(var _0x3dca59=0x0,_0x3d58d6={},_0x3fac16={};_0x3dca59<_0x372117[_0xaae5('0x44')];_0x3dca59+=0x1){_0x3d58d6=_0x372117[_0x3dca59];if(_['isUndefined'](_0x18d6c8[_0xaae5('0x4e')][_0x3d58d6['id']])){_0x18d6c8[_0xaae5('0x4e')][_0x3d58d6['id']]=new Template(_0x3d58d6);}else{_0x18d6c8['mergeFromDatabase'](_0x18d6c8['templates'][_0x3d58d6['id']],_0x3d58d6);}}}return _0x18d6c8[_0xaae5('0x4e')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x4f')]=function(){var _0x5c0909=this;return function(_0x4898c7){if(_0x4898c7){freeIsNotKey(_0x4898c7,_0x5c0909[_0xaae5('0x21')],'id');for(var _0x307555=0x0,_0xd56068={},_0x157cc3={};_0x307555<_0x4898c7['length'];_0x307555+=0x1){_0xd56068=_0x4898c7[_0x307555];if(_[_0xaae5('0x49')](_0x5c0909['zendeskAccounts'][_0xd56068['id']])){_0x5c0909[_0xaae5('0x21')][_0xd56068['id']]=new ZendeskAccount(_0xd56068);}else{_0x5c0909[_0xaae5('0x46')](_0x5c0909[_0xaae5('0x21')][_0xd56068['id']],_0xd56068);}}}return _0x5c0909['zendeskAccounts'];};};Realtime[_0xaae5('0x42')][_0xaae5('0x50')]=function(){var _0x23c24e=this;return function(_0x382266){if(_0x382266){freeIsNotKey(_0x382266,_0x23c24e[_0xaae5('0x22')],'id');for(var _0x7d6cfc=0x0,_0x4fde3d={},_0x170851={};_0x7d6cfc<_0x382266[_0xaae5('0x44')];_0x7d6cfc+=0x1){_0x4fde3d=_0x382266[_0x7d6cfc];if(_[_0xaae5('0x49')](_0x23c24e[_0xaae5('0x22')][_0x4fde3d['id']])){_0x23c24e[_0xaae5('0x22')][_0x4fde3d['id']]=new SalesforceAccount(_0x4fde3d);}else{_0x23c24e[_0xaae5('0x46')](_0x23c24e['salesforceAccounts'][_0x4fde3d['id']],_0x4fde3d);}}}return _0x23c24e['salesforceAccounts'];};};Realtime[_0xaae5('0x42')]['initFreshdeskAccounts']=function(){var _0xbdaf9e=this;return function(_0x123f0e){if(_0x123f0e){freeIsNotKey(_0x123f0e,_0xbdaf9e[_0xaae5('0x51')],'id');for(var _0x48ec30=0x0,_0x3626fb={},_0x564ecb={};_0x48ec30<_0x123f0e[_0xaae5('0x44')];_0x48ec30+=0x1){_0x3626fb=_0x123f0e[_0x48ec30];if(_[_0xaae5('0x49')](_0xbdaf9e['freshdeskAccounts'][_0x3626fb['id']])){_0xbdaf9e[_0xaae5('0x51')][_0x3626fb['id']]=new FreshdeskAccount(_0x3626fb);}else{_0xbdaf9e[_0xaae5('0x46')](_0xbdaf9e[_0xaae5('0x51')][_0x3626fb['id']],_0x3626fb);}}}return _0xbdaf9e[_0xaae5('0x51')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x52')]=function(){var _0x4f22a4=this;return function(_0x101520){if(_0x101520){freeIsNotKey(_0x101520,_0x4f22a4['zohoAccounts'],'id');for(var _0x2beb36=0x0,_0x20d03d={},_0x2cd245={};_0x2beb36<_0x101520[_0xaae5('0x44')];_0x2beb36+=0x1){_0x20d03d=_0x101520[_0x2beb36];if(_[_0xaae5('0x49')](_0x4f22a4['zohoAccounts'][_0x20d03d['id']])){_0x4f22a4[_0xaae5('0x23')][_0x20d03d['id']]=new ZohoAccount(_0x20d03d);}else{_0x4f22a4[_0xaae5('0x46')](_0x4f22a4['zohoAccounts'][_0x20d03d['id']],_0x20d03d);}}}return _0x4f22a4[_0xaae5('0x23')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x53')]=function(){var _0x308da0=this;return function(_0x4e1e11){if(_0x4e1e11){freeIsNotKey(_0x4e1e11,_0x308da0['deskAccounts'],'id');for(var _0x17fa64=0x0,_0x2d7829={},_0x2a7a6f={};_0x17fa64<_0x4e1e11['length'];_0x17fa64+=0x1){_0x2d7829=_0x4e1e11[_0x17fa64];if(_['isUndefined'](_0x308da0['deskAccounts'][_0x2d7829['id']])){_0x308da0['deskAccounts'][_0x2d7829['id']]=new DeskAccount(_0x2d7829);}else{_0x308da0[_0xaae5('0x46')](_0x308da0[_0xaae5('0x24')][_0x2d7829['id']],_0x2d7829);}}}return _0x308da0['deskAccounts'];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x1e93a7=this;return function(_0x312a8f){if(_0x312a8f){freeIsNotKey(_0x312a8f,_0x1e93a7['sugarcrmAccounts'],'id');for(var _0x4c3ba0=0x0,_0x5e69cb={},_0x4c994a={};_0x4c3ba0<_0x312a8f[_0xaae5('0x44')];_0x4c3ba0+=0x1){_0x5e69cb=_0x312a8f[_0x4c3ba0];if(_['isUndefined'](_0x1e93a7[_0xaae5('0x54')][_0x5e69cb['id']])){_0x1e93a7[_0xaae5('0x54')][_0x5e69cb['id']]=new SugarcrmAccount(_0x5e69cb);}else{_0x1e93a7[_0xaae5('0x46')](_0x1e93a7[_0xaae5('0x54')][_0x5e69cb['id']],_0x5e69cb);}}}return _0x1e93a7[_0xaae5('0x54')];};};Realtime['prototype'][_0xaae5('0x55')]=function(){var _0x1b8090=this;return function(_0x2399a6){if(_0x2399a6){freeIsNotKey(_0x2399a6,_0x1b8090[_0xaae5('0x25')],'id');for(var _0x1e8010=0x0,_0x1d139b={},_0x6629d5={};_0x1e8010<_0x2399a6['length'];_0x1e8010+=0x1){_0x1d139b=_0x2399a6[_0x1e8010];if(_[_0xaae5('0x49')](_0x1b8090[_0xaae5('0x25')][_0x1d139b['id']])){_0x1b8090[_0xaae5('0x25')][_0x1d139b['id']]=new VtigerAccount(_0x1d139b);}else{_0x1b8090['mergeFromDatabase'](_0x1b8090[_0xaae5('0x25')][_0x1d139b['id']],_0x1d139b);}}}return _0x1b8090[_0xaae5('0x25')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x56')]=function(){var _0x22a0ea=this;return function(_0x31aabe){if(_0x31aabe){freeIsNotKey(_0x31aabe,_0x22a0ea['servicenowAccounts'],'id');for(var _0x3ccee4=0x0,_0x2f45e8={},_0x27a212={};_0x3ccee4<_0x31aabe['length'];_0x3ccee4+=0x1){_0x2f45e8=_0x31aabe[_0x3ccee4];if(_[_0xaae5('0x49')](_0x22a0ea[_0xaae5('0x57')][_0x2f45e8['id']])){_0x22a0ea['servicenowAccounts'][_0x2f45e8['id']]=new ServicenowAccount(_0x2f45e8);}else{_0x22a0ea[_0xaae5('0x46')](_0x22a0ea[_0xaae5('0x57')][_0x2f45e8['id']],_0x2f45e8);}}}return _0x22a0ea[_0xaae5('0x57')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x58')]=function(){var _0x158f19=this;return function(_0x556f39){if(_0x556f39){freeIsNotKey(_0x556f39,_0x158f19[_0xaae5('0x26')],'id');for(var _0x209adc=0x0,_0x4fb015={},_0x485d19={};_0x209adc<_0x556f39['length'];_0x209adc+=0x1){_0x4fb015=_0x556f39[_0x209adc];if(_[_0xaae5('0x49')](_0x158f19[_0xaae5('0x26')][_0x4fb015['id']])){_0x158f19[_0xaae5('0x26')][_0x4fb015['id']]=new Dynamics365Account(_0x4fb015);}else{_0x158f19[_0xaae5('0x46')](_0x158f19['dynamics365Accounts'][_0x4fb015['id']],_0x4fb015);}}}return _0x158f19['dynamics365Accounts'];};};Realtime[_0xaae5('0x42')][_0xaae5('0x59')]=function(){var _0x22862e=this;return function(_0x31dde5){if(_0x31dde5){freeIsNotKey(_0x31dde5,_0x22862e[_0xaae5('0x27')],'id');for(var _0x58d6c1=0x0,_0x514602={},_0x873c80={};_0x58d6c1<_0x31dde5['length'];_0x58d6c1+=0x1){_0x514602=_0x31dde5[_0x58d6c1];if(_[_0xaae5('0x49')](_0x22862e[_0xaae5('0x27')][_0x514602['id']])){_0x22862e[_0xaae5('0x27')][_0x514602['id']]=new FreshsalesAccount(_0x514602);}else{_0x22862e[_0xaae5('0x46')](_0x22862e[_0xaae5('0x27')][_0x514602['id']],_0x514602);}}}return _0x22862e[_0xaae5('0x27')];};};Realtime['prototype'][_0xaae5('0x5a')]=function(){var _0x43c924=this;return function(_0x22428d){for(var _0xb55af9=0x0;_0xb55af9<_0x22428d['length'];_0xb55af9+=0x1){_[_0xaae5('0x5b')](_0x43c924[_0xaae5('0x17')][_0x22428d[_0xb55af9][_0xaae5('0x2b')]],_0x22428d[_0xb55af9]);}return _0x43c924['voiceQueues'];};};Realtime[_0xaae5('0x42')]['initVoiceQueueReports']=function(){var _0xd3ad=this;return function(_0x4b0e48){clearVoiceQueues(_0xd3ad['voiceQueues']);if(_0x4b0e48){_0x4b0e48=_[_0xaae5('0x5c')](_0x4b0e48,_0xaae5('0x5d'));for(var _0x7d8bc0 in _0x4b0e48){if(_0x4b0e48[_0xaae5('0x28')](_0x7d8bc0)){var _0x282a9a={};for(var _0x75e579=0x0;_0x75e579<_0x4b0e48[_0x7d8bc0][_0xaae5('0x44')];_0x75e579+=0x1){var _0x83f704=_0x4b0e48[_0x7d8bc0][_0x75e579]['queue'];if(_0xd3ad[_0xaae5('0x17')][_0x83f704]){if(_0x4b0e48[_0x7d8bc0][_0x75e579][_0xaae5('0x5e')]){_0xd3ad['voiceQueues'][_0x83f704][_0xaae5('0x5f')]+=0x1;}if(_0x4b0e48[_0x7d8bc0][_0x75e579]['queuecallerabandon']){_0xd3ad[_0xaae5('0x17')][_0x83f704]['abandoned']+=0x1;}_0xd3ad[_0xaae5('0x17')][_0x83f704][_0xaae5('0x30')]+=moment(_0x4b0e48[_0x7d8bc0][_0x75e579][_0xaae5('0x60')])['diff'](moment(_0x4b0e48[_0x7d8bc0][_0x75e579][_0xaae5('0x61')]),_0xaae5('0x62'))||0x0;if(_0x75e579===_0x4b0e48[_0x7d8bc0][_0xaae5('0x44')]-0x1){_0xd3ad[_0xaae5('0x17')][_0x83f704][_0xaae5('0x63')]+=moment(_0x4b0e48[_0x7d8bc0][_0x75e579][_0xaae5('0x64')]||_0x4b0e48[_0x7d8bc0][_0x75e579][_0xaae5('0x65')]||_0x4b0e48[_0x7d8bc0][_0x75e579][_0xaae5('0x66')])[_0xaae5('0x67')](moment(_0x4b0e48[_0x7d8bc0][_0x75e579][_0xaae5('0x61')]),'seconds')||0x0;_0xd3ad[_0xaae5('0x17')][_0x83f704][_0xaae5('0x2e')]+=0x1;if(_0x4b0e48[_0x7d8bc0][_0x75e579][_0xaae5('0x68')]){_0xd3ad[_0xaae5('0x17')][_0x83f704]['answered']+=0x1;_0xd3ad['voiceQueues'][_0x83f704][_0xaae5('0x31')]+=moment(_0x4b0e48[_0x7d8bc0][_0x75e579]['queuecallercompleteAt'])[_0xaae5('0x67')](moment(_0x4b0e48[_0x7d8bc0][_0x75e579][_0xaae5('0x60')]),_0xaae5('0x62'))||0x0;}}else{_0xd3ad[_0xaae5('0x17')][_0x83f704][_0xaae5('0x63')]+=_0xd3ad[_0xaae5('0x17')][_0x83f704][_0xaae5('0x30')]||0x0;}}}}}}return _0xd3ad[_0xaae5('0x17')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x69')]=function(){var _0xc7e3ca=this;return function(_0x1878b4){clearVoiceCallReports(_0xc7e3ca['outbound']);if(_0x1878b4){for(var _0x5134bd=0x0;_0x5134bd<_0x1878b4[_0xaae5('0x44')];_0x5134bd+=0x1){_0xc7e3ca['outbound'][_0xaae5('0x2e')]+=0x1;_0xc7e3ca[_0xaae5('0x1a')][_0xaae5('0x63')]+=_0x1878b4[_0x5134bd][_0xaae5('0x6a')];if(_0x1878b4[_0x5134bd][_0xaae5('0x6b')]===_0xaae5('0x6c')){_0xc7e3ca[_0xaae5('0x1a')][_0xaae5('0x2f')]+=0x1;_0xc7e3ca['outbound']['sumHoldTime']+=_0x1878b4[_0x5134bd][_0xaae5('0x6a')]-_0x1878b4[_0x5134bd]['billableseconds']||0x0;_0xc7e3ca[_0xaae5('0x1a')][_0xaae5('0x31')]+=_0x1878b4[_0x5134bd][_0xaae5('0x6d')];}}}return _0xc7e3ca['outbound'];};};Realtime[_0xaae5('0x42')][_0xaae5('0x6e')]=function(){var _0x113618=this;return function(_0x2b74c9){if(_0x2b74c9){freeIsNotKey(_0x2b74c9,_0x113618[_0xaae5('0x19')],'name');for(var _0xe9eef4=0x0,_0x197092={};_0xe9eef4<_0x2b74c9[_0xaae5('0x44')];_0xe9eef4+=0x1){_0x197092=_0x2b74c9[_0xe9eef4];if(_[_0xaae5('0x49')](_0x113618[_0xaae5('0x19')][_0x197092[_0xaae5('0x2b')]])){_0x113618[_0xaae5('0x19')][_0x197092[_0xaae5('0x2b')]]=new Campaign(_0x197092);}else{_0x113618[_0xaae5('0x46')](_0x113618['campaigns'][_0x197092[_0xaae5('0x2b')]],_0x197092);_0x113618[_0xaae5('0x19')][_0x197092[_0xaae5('0x2b')]][_0xaae5('0x6f')]=_0x197092[_0xaae5('0x70')]?_0x197092[_0xaae5('0x70')][_0xaae5('0x2b')]:undefined;}}}return _0x113618[_0xaae5('0x19')];};};Realtime[_0xaae5('0x42')]['initVoiceExtensions']=function(){var _0x1e25e7=this;return function(_0x326e61){if(_0x326e61){freeIsNotKey(_0x326e61,_0x1e25e7[_0xaae5('0x1b')],'id');for(var _0x3721ef=0x0,_0xd0d819={};_0x3721ef<_0x326e61[_0xaae5('0x44')];_0x3721ef+=0x1){_0xd0d819=_0x326e61[_0x3721ef];if(_[_0xaae5('0x49')](_0x1e25e7[_0xaae5('0x1b')][_0xd0d819['id']])){_0x1e25e7[_0xaae5('0x1b')][_0xd0d819['id']]=new VoiceExtension(_0xd0d819);}else{_0x1e25e7[_0xaae5('0x46')](_0x1e25e7[_0xaae5('0x1b')][_0xd0d819['id']],_0xd0d819);}}}return _0x1e25e7[_0xaae5('0x1b')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x71')]=function(){var _0x2882d5=this;return function(_0x4ce27d){clearCampaigns(_0x2882d5[_0xaae5('0x19')]);for(var _0x1920d7=0x0;_0x1920d7<_0x4ce27d[_0xaae5('0x44')];_0x1920d7+=0x1){_[_0xaae5('0x5b')](_0x2882d5[_0xaae5('0x19')][_0x4ce27d[_0x1920d7][_0xaae5('0x2b')]],_0x4ce27d[_0x1920d7]);}return _0x2882d5[_0xaae5('0x19')];};};Realtime[_0xaae5('0x42')][_0xaae5('0x72')]=function(){var _0x2d8d3c=this;return function(_0x782ea){if(_0x782ea){freeIsNotKey(_0x782ea,_0x2d8d3c[_0xaae5('0x73')],'id');for(var _0xaa62db=0x0,_0x21a019={},_0x20e90f={};_0xaa62db<_0x782ea[_0xaae5('0x44')];_0xaa62db+=0x1){_0x21a019=_0x782ea[_0xaa62db];if(_['isUndefined'](_0x2d8d3c[_0xaae5('0x73')][_0x21a019['id']])){_0x2d8d3c['faxAccounts'][_0x21a019['id']]=new FaxAccount(_0x21a019);}else{_0x2d8d3c[_0xaae5('0x46')](_0x2d8d3c[_0xaae5('0x73')][_0x21a019['id']],_0x21a019);}}}return _0x2d8d3c[_0xaae5('0x73')];};};module['exports']=Realtime;
\ No newline at end of file
index 65c0205..bda2a5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ca7=['transfers','transfereelinkedid','uniqueid','linkedid','monitor','monitors','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','isArray','startsWith','Local','substring','indexOf','mobile','transfererlinkedid','exports','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','name','isNil','format','SIP/%s','length','accountcode','assigned','lastAssignedTo','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','destination','type','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','callerid','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname'];(function(_0x5e67ee,_0x576f2a){var _0x2c8930=function(_0x181000){while(--_0x181000){_0x5e67ee['push'](_0x5e67ee['shift']());}};_0x2c8930(++_0x576f2a);}(_0x8ca7,0x1b2));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x78ca('0x0'));var config=require(_0x78ca('0x1'));var ami=require(_0x78ca('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x78ca('0x3'));var RpcMemberReport=require(_0x78ca('0x4'));var RpcVoiceQueueReport=require(_0x78ca('0x5'));var RpcVoiceRecording=require(_0x78ca('0x6'));var RpcVoiceTransferReport=require(_0x78ca('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x78ca('0x8'));var UserReport=require(_0x78ca('0x9'));function Report(_0x575a15){this[_0x78ca('0xa')]=_0x575a15;this[_0x78ca('0xb')]=_0x575a15[_0x78ca('0xb')];this[_0x78ca('0xc')]=_0x575a15[_0x78ca('0xc')];}Report[_0x78ca('0xd')][_0x78ca('0xe')]=function(_0x370b0b){var _0x3ed291=new VoiceQueueReport(this[_0x78ca('0xa')]);var _0x4f8c8b=new VoiceAgentReport(this['realtime']);var _0x386981=new VoiceDialReport(this[_0x78ca('0xa')]);var _0x371dcc=new VoiceCallReport(this[_0x78ca('0xa')]);var _0x4bab55=new UserReport(this['realtime']);if(config['xdr']&&config[_0x78ca('0xf')][_0x78ca('0x10')]){ami['on'](_0x78ca('0x11'),this[_0x78ca('0x12')][_0x78ca('0x13')](this));ami['on'](_0x78ca('0x14'),this[_0x78ca('0x15')][_0x78ca('0x13')](this));ami['on']('custom:voiceAgentReport',this[_0x78ca('0x16')][_0x78ca('0x13')](this));ami['on'](_0x78ca('0x17'),this[_0x78ca('0x18')]['bind'](this));ami['on'](_0x78ca('0x19'),this[_0x78ca('0x1a')][_0x78ca('0x13')](this));ami['on'](_0x78ca('0x1b'),this[_0x78ca('0x1c')][_0x78ca('0x13')](this));}};Report['prototype'][_0x78ca('0x1d')]=function(_0x5929bf){var _0xd2f448;_0xd2f448=_[_0x78ca('0x1e')](this[_0x78ca('0xb')],function(_0x53fed9){return _0x53fed9['accountcode']==_0x5929bf||_0x53fed9[_0x78ca('0x1f')]==_0x5929bf;});if(_[_0x78ca('0x20')](_0xd2f448)){var _0x99e638=_[_0x78ca('0x1e')](this[_0x78ca('0xc')],function(_0x1fbe86){return _0x1fbe86['accountcode']==_0x5929bf||_0x1fbe86[_0x78ca('0x1f')]==_0x5929bf;});if(_0x99e638){_0xd2f448=_[_0x78ca('0x1e')](this[_0x78ca('0xb')],function(_0x307da5){return _0x307da5['interface']==util[_0x78ca('0x21')](_0x78ca('0x22'),_0x99e638[_0x78ca('0x1f')]);});}}return _0xd2f448;};Report['prototype'][_0x78ca('0x12')]=function(_0x742291){for(var _0x354662=0x0;_0x354662<_0x742291[_0x78ca('0x23')];_0x354662+=0x1){var _0x1a0c02=this[_0x78ca('0x1d')](_0x742291[_0x354662]['connectedlinenum']);if(_0x1a0c02){_0x742291[_0x354662]['accountcode']=_0x1a0c02[_0x78ca('0x24')];_0x742291[_0x354662][_0x78ca('0x25')]=!![];_0x742291[_0x354662][_0x78ca('0x26')]=_0x1a0c02[_0x78ca('0x1f')];_0x742291[_0x354662][_0x78ca('0x27')]=_[_0x78ca('0x20')](_0x1a0c02[_0x78ca('0x27')])?util['format']('SIP/%s',_0x1a0c02[_0x78ca('0x1f')]):_0x1a0c02[_0x78ca('0x27')];if(_0x742291[_0x354662]['queuecallercomplete']){_0x742291[_0x354662][_0x78ca('0x28')]=moment()['format'](_0x78ca('0x29'));}if(_0x742291[_0x354662]['queuecallerexit']){_0x742291[_0x354662][_0x78ca('0x2a')]=moment()[_0x78ca('0x21')](_0x78ca('0x29'));}RpcMemberReport[_0x78ca('0x12')](_0x742291[_0x354662]);}RpcVoiceQueueReport[_0x78ca('0x2b')](_0x742291[_0x354662]);}};function extractCalleridNumber(_0x3e6dc4){var _0x316c66=_0x3e6dc4['match'](/<(.*?)>/);return _0x316c66?_0x316c66[0x1]:_0x3e6dc4;}Report[_0x78ca('0xd')][_0x78ca('0x15')]=function(_0x29c0bb){_0x29c0bb['destination']=_0x29c0bb[_0x78ca('0x2c')]||_0x29c0bb['exten'];if(_0x29c0bb[_0x78ca('0x2d')]=='dialer'){_0x29c0bb[_0x78ca('0x2e')]=_0x78ca('0x2f');_0x29c0bb[_0x78ca('0x30')]=_0x29c0bb[_0x78ca('0x2f')];if(_0x29c0bb[_0x78ca('0x31')]==_0x78ca('0x32')){_0x29c0bb[_0x78ca('0x24')]='';_0x29c0bb[_0x78ca('0x2c')]=extractCalleridNumber(_0x29c0bb['callerid']);}else if(_0x29c0bb[_0x78ca('0x31')]==_0x78ca('0x33')){if(_0x29c0bb[_0x78ca('0x2c')]==_0x78ca('0x34')){_0x29c0bb[_0x78ca('0x2c')]=extractCalleridNumber(_0x29c0bb[_0x78ca('0x35')]);_0x29c0bb[_0x78ca('0x36')]=_0x29c0bb[_0x78ca('0x37')];_0x29c0bb['destinationchannel']=[_0x29c0bb[_0x78ca('0x38')],_0x29c0bb[_0x78ca('0x38')]=_0x29c0bb[_0x78ca('0x39')]][0x0];_0x29c0bb[_0x78ca('0x3a')]=_0x29c0bb['calleridpreview'];}else{_0x29c0bb['destination']=_0x29c0bb['calleridnum'];_0x29c0bb[_0x78ca('0x36')]=_0x29c0bb['originatecalleridnum'];if(_0x29c0bb[_0x78ca('0x3b')]==_0x78ca('0x3c')){_0x29c0bb[_0x78ca('0x24')]=_0x29c0bb[_0x78ca('0x3d')];}else{_0x29c0bb[_0x78ca('0x24')]='';}}}}else{_0x29c0bb[_0x78ca('0x3a')]=util[_0x78ca('0x21')](_0x78ca('0x3e'),_0x29c0bb[_0x78ca('0x3f')],_0x29c0bb[_0x78ca('0x36')]);}if(RpcVoiceTransferReport[_0x78ca('0x40')][_0x29c0bb['linkedid']]){var _0x51dc28=RpcVoiceTransferReport['transfers'][_0x29c0bb['linkedid']];_0x51dc28[_0x78ca('0x41')]=_0x29c0bb[_0x78ca('0x42')];RpcVoiceTransferReport['blindTransfer'](_0x51dc28);delete RpcVoiceTransferReport[_0x78ca('0x40')][_0x29c0bb[_0x78ca('0x43')]];}RpcVoiceCallReport[_0x78ca('0x2b')](_0x29c0bb);if(_0x29c0bb[_0x78ca('0x44')]){for(var _0x2461b9=0x0;_0x2461b9<_0x29c0bb['monitors'][_0x78ca('0x23')];_0x2461b9+=0x1){_0x29c0bb['monitorFilename']=_0x29c0bb[_0x78ca('0x45')][_0x2461b9]['filename'];_0x29c0bb[_0x78ca('0x46')]=_0x29c0bb[_0x78ca('0x45')][_0x2461b9][_0x78ca('0x46')];if(_0x29c0bb[_0x78ca('0x47')]==_0x78ca('0x34')){_0x29c0bb[_0x78ca('0x36')]=_0x29c0bb[_0x78ca('0x3d')];_0x29c0bb[_0x78ca('0x3f')]=_0x29c0bb[_0x78ca('0x48')];_0x29c0bb['connectedlinenum']=_0x29c0bb[_0x78ca('0x24')];_0x29c0bb[_0x78ca('0x48')]=_0x29c0bb[_0x78ca('0x49')];_0x29c0bb['exten']=_0x29c0bb[_0x78ca('0x37')];}else if(_0x29c0bb[_0x78ca('0x47')]==_0x78ca('0x4a')){_0x29c0bb[_0x78ca('0x36')]=_0x29c0bb['destination'];_0x29c0bb['exten']=_0x29c0bb[_0x78ca('0x37')];}RpcVoiceRecording[_0x78ca('0x2b')](_0x29c0bb);}}};Report['prototype'][_0x78ca('0x16')]=function(_0x359de0){if(_[_0x78ca('0x4b')](_0x359de0)){_0x359de0['forEach'](function(_0x3c085c){RpcVoiceAgentReport[_0x78ca('0x2b')](_0x3c085c);});}else{RpcVoiceAgentReport[_0x78ca('0x2b')](_0x359de0);}};Report[_0x78ca('0xd')][_0x78ca('0x18')]=function(_0x3db641){RpcVoiceDialReport[_0x78ca('0x2b')](_0x3db641);var _0x4c7329;var _0x10caf4;var _0x47894a=_0x3db641[_0x78ca('0x38')];if(_[_0x78ca('0x4c')](_0x47894a,_0x78ca('0x4d'))){_0x10caf4=_0x47894a[_0x78ca('0x4e')](_0x47894a[_0x78ca('0x4f')]('/')+0x1,_0x47894a[_0x78ca('0x4f')]('@'));_0x4c7329=_[_0x78ca('0x1e')](this[_0x78ca('0xb')],function(_0x38b390){return _0x38b390[_0x78ca('0x50')]==_0x10caf4||_0x38b390['phone']==_0x10caf4||_0x38b390[_0x78ca('0x24')]==_0x10caf4;});}else{_0x10caf4=_0x47894a[_0x78ca('0x4e')](_0x47894a['indexOf']('/')+0x1,_0x47894a['lastIndexOf']('-'));_0x4c7329=this[_0x78ca('0x1d')](_0x10caf4);}if(_0x4c7329){_0x3db641[_0x78ca('0x27')]=_[_0x78ca('0x20')](_0x4c7329['interface'])?util[_0x78ca('0x21')](_0x78ca('0x22'),_0x4c7329[_0x78ca('0x1f')]):_0x4c7329[_0x78ca('0x27')];_0x3db641['membername']=_0x4c7329[_0x78ca('0x1f')];_0x3db641[_0x78ca('0x24')]=_0x4c7329[_0x78ca('0x24')];RpcMemberReport[_0x78ca('0x18')](_0x3db641);}};Report['prototype'][_0x78ca('0x1a')]=function(_0x31ce50){RpcVoiceTransferReport[_0x78ca('0x40')][_0x31ce50[_0x78ca('0x51')]]=_0x31ce50;};Report['prototype'][_0x78ca('0x1c')]=function(_0x2f4dd5){RpcVoiceTransferReport[_0x78ca('0x1c')](_0x2f4dd5);};module[_0x78ca('0x52')]=Report;
\ No newline at end of file
+var _0x0534=['linkedid','transfereelinkedid','create','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','length','assigned','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','destination','exten','type','dialer','queue','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','connectedlinenum','\x22%s\x22\x20<%s>','transfers'];(function(_0x449dbd,_0x57c85d){var _0xff433e=function(_0x146cb4){while(--_0x146cb4){_0x449dbd['push'](_0x449dbd['shift']());}};_0xff433e(++_0x57c85d);}(_0x0534,0x16d));var _0x4053=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0x0534[_0x4fa291];return _0x506d9b;};'use strict';var _=require(_0x4053('0x0'));var moment=require(_0x4053('0x1'));var util=require(_0x4053('0x2'));var config=require(_0x4053('0x3'));var ami=require(_0x4053('0x4'));var RpcVoiceAgentReport=require(_0x4053('0x5'));var RpcVoiceCallReport=require(_0x4053('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x4053('0x7'));var RpcVoiceQueueReport=require(_0x4053('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x4053('0x9'));var VoiceQueueReport=require(_0x4053('0xa'));var VoiceCallReport=require(_0x4053('0xb'));var VoiceAgentReport=require(_0x4053('0xc'));var VoiceDialReport=require(_0x4053('0xd'));var UserReport=require(_0x4053('0xe'));function Report(_0x4b289d){this[_0x4053('0xf')]=_0x4b289d;this[_0x4053('0x10')]=_0x4b289d[_0x4053('0x10')];this[_0x4053('0x11')]=_0x4b289d[_0x4053('0x11')];}Report[_0x4053('0x12')][_0x4053('0x13')]=function(_0x1d9445){var _0x24cebf=new VoiceQueueReport(this[_0x4053('0xf')]);var _0x46242b=new VoiceAgentReport(this[_0x4053('0xf')]);var _0x36a1c4=new VoiceDialReport(this['realtime']);var _0x23313c=new VoiceCallReport(this[_0x4053('0xf')]);var _0x172767=new UserReport(this[_0x4053('0xf')]);if(config['xdr']&&config['xdr'][_0x4053('0x14')]){ami['on'](_0x4053('0x15'),this[_0x4053('0x16')][_0x4053('0x17')](this));ami['on']('custom:voiceCallReport',this[_0x4053('0x18')][_0x4053('0x17')](this));ami['on'](_0x4053('0x19'),this['voiceAgentReport']['bind'](this));ami['on'](_0x4053('0x1a'),this[_0x4053('0x1b')][_0x4053('0x17')](this));ami['on'](_0x4053('0x1c'),this[_0x4053('0x1d')][_0x4053('0x17')](this));ami['on'](_0x4053('0x1e'),this[_0x4053('0x1f')][_0x4053('0x17')](this));}};Report[_0x4053('0x12')][_0x4053('0x20')]=function(_0x9de686){var _0x5a6914;_0x5a6914=_[_0x4053('0x21')](this[_0x4053('0x10')],function(_0x54615e){return _0x54615e[_0x4053('0x22')]==_0x9de686||_0x54615e[_0x4053('0x23')]==_0x9de686;});if(_[_0x4053('0x24')](_0x5a6914)){var _0x40e379=_[_0x4053('0x21')](this[_0x4053('0x11')],function(_0x41a1d9){return _0x41a1d9[_0x4053('0x22')]==_0x9de686||_0x41a1d9['name']==_0x9de686;});if(_0x40e379){_0x5a6914=_[_0x4053('0x21')](this[_0x4053('0x10')],function(_0x21cb43){return _0x21cb43[_0x4053('0x25')]==util['format'](_0x4053('0x26'),_0x40e379['name']);});}}return _0x5a6914;};Report[_0x4053('0x12')][_0x4053('0x16')]=function(_0x4eb47f){for(var _0x55f392=0x0;_0x55f392<_0x4eb47f[_0x4053('0x27')];_0x55f392+=0x1){var _0x3d7406=this[_0x4053('0x20')](_0x4eb47f[_0x55f392]['connectedlinenum']);if(_0x3d7406){_0x4eb47f[_0x55f392][_0x4053('0x22')]=_0x3d7406[_0x4053('0x22')];_0x4eb47f[_0x55f392][_0x4053('0x28')]=!![];_0x4eb47f[_0x55f392]['lastAssignedTo']=_0x3d7406['name'];_0x4eb47f[_0x55f392][_0x4053('0x25')]=_[_0x4053('0x24')](_0x3d7406[_0x4053('0x25')])?util[_0x4053('0x29')](_0x4053('0x26'),_0x3d7406[_0x4053('0x23')]):_0x3d7406[_0x4053('0x25')];if(_0x4eb47f[_0x55f392][_0x4053('0x2a')]){_0x4eb47f[_0x55f392][_0x4053('0x2b')]=moment()[_0x4053('0x29')](_0x4053('0x2c'));}if(_0x4eb47f[_0x55f392][_0x4053('0x2d')]){_0x4eb47f[_0x55f392]['queuecallerexitAt']=moment()[_0x4053('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x4eb47f[_0x55f392]);}RpcVoiceQueueReport['create'](_0x4eb47f[_0x55f392]);}};function extractCalleridNumber(_0x1da475){var _0x2f6d94=_0x1da475['match'](/<(.*?)>/);return _0x2f6d94?_0x2f6d94[0x1]:_0x1da475;}Report['prototype'][_0x4053('0x18')]=function(_0x177116){_0x177116[_0x4053('0x2e')]=_0x177116[_0x4053('0x2e')]||_0x177116[_0x4053('0x2f')];if(_0x177116[_0x4053('0x30')]==_0x4053('0x31')){_0x177116['lastapplication']=_0x4053('0x32');_0x177116['lastdata']=_0x177116[_0x4053('0x32')];if(_0x177116['context']==_0x4053('0x33')){_0x177116[_0x4053('0x22')]='';_0x177116['destination']=extractCalleridNumber(_0x177116[_0x4053('0x34')]);}else if(_0x177116[_0x4053('0x35')]==_0x4053('0x36')){if(_0x177116[_0x4053('0x2e')]==_0x4053('0x37')){_0x177116[_0x4053('0x2e')]=extractCalleridNumber(_0x177116[_0x4053('0x38')]);_0x177116['calleridnum']=_0x177116[_0x4053('0x39')];_0x177116[_0x4053('0x3a')]=[_0x177116['channel'],_0x177116[_0x4053('0x3b')]=_0x177116[_0x4053('0x3a')]][0x0];_0x177116[_0x4053('0x34')]=_0x177116[_0x4053('0x38')];}else{_0x177116[_0x4053('0x2e')]=_0x177116[_0x4053('0x3c')];_0x177116[_0x4053('0x3c')]=_0x177116[_0x4053('0x39')];if(_0x177116[_0x4053('0x3d')]=='ANSWERED'){_0x177116[_0x4053('0x22')]=_0x177116[_0x4053('0x3e')];}else{_0x177116[_0x4053('0x22')]='';}}}}else{_0x177116['callerid']=util[_0x4053('0x29')](_0x4053('0x3f'),_0x177116['calleridname'],_0x177116['calleridnum']);}if(RpcVoiceTransferReport[_0x4053('0x40')][_0x177116[_0x4053('0x41')]]){var _0x4c1459=RpcVoiceTransferReport[_0x4053('0x40')][_0x177116['linkedid']];_0x4c1459[_0x4053('0x42')]=_0x177116['uniqueid'];RpcVoiceTransferReport[_0x4053('0x1d')](_0x4c1459);delete RpcVoiceTransferReport[_0x4053('0x40')][_0x177116[_0x4053('0x41')]];}RpcVoiceCallReport[_0x4053('0x43')](_0x177116);if(_0x177116['monitor']){for(var _0x1e47ce=0x0;_0x1e47ce<_0x177116[_0x4053('0x44')][_0x4053('0x27')];_0x1e47ce+=0x1){_0x177116[_0x4053('0x45')]=_0x177116['monitors'][_0x1e47ce][_0x4053('0x46')];_0x177116[_0x4053('0x47')]=_0x177116[_0x4053('0x44')][_0x1e47ce][_0x4053('0x47')];if(_0x177116[_0x4053('0x2f')]==_0x4053('0x37')){_0x177116['calleridnum']=_0x177116['connectedlinenum'];_0x177116[_0x4053('0x48')]=_0x177116[_0x4053('0x49')];_0x177116[_0x4053('0x3e')]=_0x177116[_0x4053('0x22')];_0x177116['connectedlinename']=_0x177116[_0x4053('0x4a')];_0x177116[_0x4053('0x2f')]=_0x177116[_0x4053('0x39')];}else if(_0x177116['exten']==_0x4053('0x4b')){_0x177116[_0x4053('0x3c')]=_0x177116['destination'];_0x177116[_0x4053('0x2f')]=_0x177116[_0x4053('0x39')];}RpcVoiceRecording[_0x4053('0x43')](_0x177116);}}};Report[_0x4053('0x12')][_0x4053('0x4c')]=function(_0x4dae73){if(_[_0x4053('0x4d')](_0x4dae73)){_0x4dae73['forEach'](function(_0x262f48){RpcVoiceAgentReport[_0x4053('0x43')](_0x262f48);});}else{RpcVoiceAgentReport[_0x4053('0x43')](_0x4dae73);}};Report[_0x4053('0x12')][_0x4053('0x1b')]=function(_0x30b0a5){RpcVoiceDialReport['create'](_0x30b0a5);var _0x4be46a;var _0xeed082;var _0x480283=_0x30b0a5['channel'];if(_['startsWith'](_0x480283,_0x4053('0x4e'))){_0xeed082=_0x480283[_0x4053('0x4f')](_0x480283[_0x4053('0x50')]('/')+0x1,_0x480283['indexOf']('@'));_0x4be46a=_[_0x4053('0x21')](this[_0x4053('0x10')],function(_0x569203){return _0x569203[_0x4053('0x51')]==_0xeed082||_0x569203[_0x4053('0x52')]==_0xeed082||_0x569203[_0x4053('0x22')]==_0xeed082;});}else{_0xeed082=_0x480283[_0x4053('0x4f')](_0x480283[_0x4053('0x50')]('/')+0x1,_0x480283[_0x4053('0x53')]('-'));_0x4be46a=this['findAgent'](_0xeed082);}if(_0x4be46a){_0x30b0a5[_0x4053('0x25')]=_[_0x4053('0x24')](_0x4be46a[_0x4053('0x25')])?util['format'](_0x4053('0x26'),_0x4be46a[_0x4053('0x23')]):_0x4be46a['interface'];_0x30b0a5['membername']=_0x4be46a[_0x4053('0x23')];_0x30b0a5[_0x4053('0x22')]=_0x4be46a['accountcode'];RpcMemberReport['voiceDialReport'](_0x30b0a5);}};Report[_0x4053('0x12')][_0x4053('0x1d')]=function(_0x31f220){RpcVoiceTransferReport[_0x4053('0x40')][_0x31f220[_0x4053('0x54')]]=_0x31f220;};Report[_0x4053('0x12')]['attendedTransfer']=function(_0xa75bc5){RpcVoiceTransferReport[_0x4053('0x1f')](_0xa75bc5);};module[_0x4053('0x55')]=Report;
\ No newline at end of file
index 83b2e64..d137f1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde59=['[userReport][registry]\x20sending\x20trunk:save\x20event:','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','format','updateStatusRealtime','stateTime','toNumber','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','substring','indexOf','find','mobile','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','resolve','actionDeviceStateList','[userReport][devicestatelist]','inspect','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','merge','omit','event','actionid'];(function(_0x4ae4a3,_0x416346){var _0x276072=function(_0x478906){while(--_0x478906){_0x4ae4a3['push'](_0x4ae4a3['shift']());}};_0x276072(++_0x416346);}(_0xde59,0x1e8));var _0x9de5=function(_0x17fdde,_0x4b3717){_0x17fdde=_0x17fdde-0x0;var _0x4fd885=_0xde59[_0x17fdde];return _0x4fd885;};'use strict';var _=require(_0x9de5('0x0'));var moment=require('moment');var util=require(_0x9de5('0x1'));var Redis=require(_0x9de5('0x2'));var BPromise=require(_0x9de5('0x3'));var config=require(_0x9de5('0x4'));var logger=require(_0x9de5('0x5'))(_0x9de5('0x6'));var ami=require(_0x9de5('0x7'));config[_0x9de5('0x8')]=_[_0x9de5('0x9')](config['redis'],{'host':_0x9de5('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9de5('0x8')]));function UserReport(_0x460f21){this['trunks']=_0x460f21[_0x9de5('0xb')];this[_0x9de5('0xc')]=_0x460f21[_0x9de5('0xc')];this['telephones']=_0x460f21[_0x9de5('0xd')];ami['on'](_0x9de5('0xe'),this[_0x9de5('0xf')]['bind'](this));ami['on'](_0x9de5('0x10'),this['syncRegistry'][_0x9de5('0x11')](this));ami['on'](_0x9de5('0x12'),this[_0x9de5('0x13')][_0x9de5('0x11')](this));ami['on'](_0x9de5('0x14'),this['syncPeerStatus'][_0x9de5('0x11')](this));return this[_0x9de5('0x15')]();}function showSipRegistrations(){Promise['resolve']()[_0x9de5('0x16')](ami[_0x9de5('0x17')]())[_0x9de5('0x18')](function(_0x52fba9){logger[_0x9de5('0x19')](_0x9de5('0x1a'),util['inspect'](_0x52fba9,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x9de5('0x1b')]()[_0x9de5('0x16')](ami[_0x9de5('0x1c')]())['catch'](function(_0x31058c){logger[_0x9de5('0x19')](_0x9de5('0x1d'),util[_0x9de5('0x1e')](_0x31058c,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x9de5('0x1b')]()['then'](ami['actionSipPeerStatus']())[_0x9de5('0x18')](function(_0x4987f6){logger[_0x9de5('0x19')]('[userReport][sippeerstatus]',util[_0x9de5('0x1e')](_0x4987f6,{'showHidden':![],'depth':null}));});}UserReport[_0x9de5('0x1f')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0x9de5('0x1b')]()[_0x9de5('0x16')](showSipRegistrations())[_0x9de5('0x16')](listDeviceStates())[_0x9de5('0x16')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x9de5('0x20')]=function(_0x509113){return _0x509113!==null&&!_[_0x9de5('0x21')](_0x509113);};UserReport[_0x9de5('0x1f')][_0x9de5('0x22')]=function(_0x5eff47,_0x37fdae,_0x120acc){io['to'](_0x5eff47)[_0x9de5('0x22')](_0x37fdae,_0x120acc);};UserReport[_0x9de5('0x1f')][_0x9de5('0xf')]=function(_0x2ba74d){try{if(this[_0x9de5('0x20')](_0x2ba74d)){logger[_0x9de5('0x23')](_0x9de5('0x24'),_0x2ba74d[_0x9de5('0x25')],_0x2ba74d[_0x9de5('0x26')]);logger[_0x9de5('0x27')]('[userReport][registry]',util[_0x9de5('0x1e')](_0x2ba74d,{'showHidden':![],'depth':null}));var _0x11a404=_['find'](this['trunks'],{'defaultuser':_0x2ba74d[_0x9de5('0x25')]});if(_0x11a404){_0x2ba74d['stateRegistry']=_0x2ba74d[_0x9de5('0x26')];_[_0x9de5('0x28')](_0x11a404,_[_0x9de5('0x29')](_0x2ba74d,[_0x9de5('0x2a'),_0x9de5('0x2b'),_0x9de5('0x25'),_0x9de5('0x26')]));logger['debug'](_0x9de5('0x2c'),util['inspect'](_0x11a404,{'showHidden':![],'depth':null}));this[_0x9de5('0x22')](util['format']('trunk:%s',_0x11a404[_0x9de5('0x2d')]),_0x9de5('0x2e'),_0x11a404);}}}catch(_0x2d5249){logger[_0x9de5('0x19')](_0x9de5('0x2f'),util[_0x9de5('0x1e')](_0x2d5249,{'showHidden':![],'depth':null}));}};UserReport[_0x9de5('0x1f')]['syncDeviceState']=function(_0x197879){try{if(this[_0x9de5('0x20')](_0x197879)){logger['info'](_0x9de5('0x30'),_0x197879[_0x9de5('0x31')],_0x197879[_0x9de5('0x26')]);logger['debug'](_0x9de5('0x32'),util[_0x9de5('0x1e')](_0x197879,{'showHidden':![],'depth':null}));if(this['agents'][_0x197879[_0x9de5('0x31')]]){if(!this['agents'][_0x197879[_0x9de5('0x31')]][_0x9de5('0x33')]||_0x197879[_0x9de5('0x26')][_0x9de5('0x34')]()==_0x9de5('0x35')){this[_0x9de5('0xc')][_0x197879[_0x9de5('0x31')]]['local']=![];if(this[_0x9de5('0xc')][_0x197879[_0x9de5('0x31')]][_0x9de5('0x26')]!==_0x197879[_0x9de5('0x26')]['toLowerCase']()){this[_0x9de5('0xc')][_0x197879[_0x9de5('0x31')]]['stateTime']=_['toNumber'](moment()[_0x9de5('0x36')]('x'));}this['agents'][_0x197879['device']]['state']=_0x197879[_0x9de5('0x26')]['toLowerCase']();this[_0x9de5('0xc')][_0x197879[_0x9de5('0x31')]][_0x9de5('0x37')](_0x197879);}}else if(this[_0x9de5('0xd')][_0x197879[_0x9de5('0x31')]]){if(this[_0x9de5('0xd')][_0x197879[_0x9de5('0x31')]][_0x9de5('0x26')]!==_0x197879[_0x9de5('0x26')][_0x9de5('0x34')]()){this[_0x9de5('0xd')][_0x197879['device']][_0x9de5('0x38')]=_[_0x9de5('0x39')](moment()[_0x9de5('0x36')]('x'));}this['telephones'][_0x197879['device']][_0x9de5('0x26')]=_0x197879[_0x9de5('0x26')][_0x9de5('0x34')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x9de5('0x1e')](this[_0x9de5('0xd')][_0x197879[_0x9de5('0x31')]],{'showHidden':![],'depth':null}));this[_0x9de5('0x22')](util[_0x9de5('0x36')](_0x9de5('0x3a'),this[_0x9de5('0xd')][_0x197879[_0x9de5('0x31')]][_0x9de5('0x2d')]),_0x9de5('0x3b'),this[_0x9de5('0xd')][_0x197879['device']]);}else if(this[_0x9de5('0xb')][_0x197879[_0x9de5('0x31')]]){if(this[_0x9de5('0xb')][_0x197879[_0x9de5('0x31')]][_0x9de5('0x26')]!==_0x197879['state'][_0x9de5('0x34')]()){this[_0x9de5('0xb')][_0x197879[_0x9de5('0x31')]][_0x9de5('0x38')]=_[_0x9de5('0x39')](moment()[_0x9de5('0x36')]('x'));}this[_0x9de5('0xb')][_0x197879[_0x9de5('0x31')]][_0x9de5('0x26')]=_0x197879[_0x9de5('0x26')]['toLowerCase']();logger[_0x9de5('0x27')](_0x9de5('0x3c'),util[_0x9de5('0x1e')](this[_0x9de5('0xb')][_0x197879[_0x9de5('0x31')]],{'showHidden':![],'depth':null}));this[_0x9de5('0x22')](util[_0x9de5('0x36')](_0x9de5('0x3d'),this[_0x9de5('0xb')][_0x197879[_0x9de5('0x31')]]['name']),_0x9de5('0x2e'),this[_0x9de5('0xb')][_0x197879[_0x9de5('0x31')]]);}else if(_['startsWith'](_0x197879['device'],'Local')){var _0x557c26=_0x197879[_0x9de5('0x31')];var _0x443c11=_0x557c26[_0x9de5('0x3e')](_0x557c26['indexOf']('/')+0x1,_0x557c26[_0x9de5('0x3f')]('@'));var _0xc56c87=_[_0x9de5('0x40')](this[_0x9de5('0xc')],function(_0x4f8c37){return _0x4f8c37[_0x9de5('0x41')]==_0x443c11||_0x4f8c37['phone']==_0x443c11||_0x4f8c37[_0x9de5('0x42')]==_0x443c11;});if(_0xc56c87){if(_0xc56c87[_0x9de5('0x26')]!==_0x197879[_0x9de5('0x26')][_0x9de5('0x34')]()){_0xc56c87[_0x9de5('0x38')]=_[_0x9de5('0x39')](moment()['format']('x'));}_0xc56c87[_0x9de5('0x26')]=_0x197879[_0x9de5('0x26')]['toLowerCase']();_0xc56c87[_0x9de5('0x33')]=!![];_0xc56c87[_0x9de5('0x37')](_0x197879);}}}}catch(_0x59e897){logger[_0x9de5('0x19')]('[userReport][devicestatechange]',util[_0x9de5('0x1e')](_0x59e897,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x9de5('0x43')]=function(_0xbd393f){try{if(this[_0x9de5('0x20')](_0xbd393f)&&this[_0x9de5('0x20')](_0xbd393f[_0x9de5('0x14')])){logger[_0x9de5('0x23')](_0x9de5('0x44'),_0xbd393f['peer'],_0xbd393f[_0x9de5('0x45')],_0xbd393f[_0x9de5('0x14')]);logger[_0x9de5('0x27')](_0x9de5('0x46'),util[_0x9de5('0x1e')](_0xbd393f,{'showHidden':![],'depth':null}));if(this['agents'][_0xbd393f[_0x9de5('0x47')]]){if(!this['agents'][_0xbd393f[_0x9de5('0x47')]][_0x9de5('0x33')]||_0xbd393f['peerstatus'][_0x9de5('0x34')]()=='registered'){this[_0x9de5('0xc')][_0xbd393f[_0x9de5('0x47')]]['local']=![];this[_0x9de5('0xc')][_0xbd393f['peer']][_0x9de5('0x48')]=_0xbd393f[_0x9de5('0x14')]['toLowerCase']();this[_0x9de5('0xc')][_0xbd393f['peer']][_0x9de5('0x45')]=_0xbd393f[_0x9de5('0x45')];this['agents'][_0xbd393f[_0x9de5('0x47')]][_0x9de5('0x37')](_0xbd393f);}}else if(this[_0x9de5('0xd')][_0xbd393f[_0x9de5('0x47')]]){this[_0x9de5('0xd')][_0xbd393f[_0x9de5('0x47')]][_0x9de5('0x48')]=_0xbd393f[_0x9de5('0x14')][_0x9de5('0x34')]();this[_0x9de5('0xd')][_0xbd393f[_0x9de5('0x47')]][_0x9de5('0x45')]=_0xbd393f['address'];logger[_0x9de5('0x27')](_0x9de5('0x49'),util[_0x9de5('0x1e')](this['telephones'][_0xbd393f[_0x9de5('0x47')]],{'showHidden':![],'depth':null}));this[_0x9de5('0x22')](util[_0x9de5('0x36')]('telephone:%s',this[_0x9de5('0xd')][_0xbd393f['peer']][_0x9de5('0x2d')]),'telephone:save',this[_0x9de5('0xd')][_0xbd393f[_0x9de5('0x47')]]);}else if(this[_0x9de5('0xb')][_0xbd393f[_0x9de5('0x47')]]){this[_0x9de5('0xb')][_0xbd393f[_0x9de5('0x47')]]['status']=_0xbd393f[_0x9de5('0x14')][_0x9de5('0x34')]();this[_0x9de5('0xb')][_0xbd393f[_0x9de5('0x47')]][_0x9de5('0x45')]=_0xbd393f[_0x9de5('0x45')];logger[_0x9de5('0x27')](_0x9de5('0x4a'),util[_0x9de5('0x1e')](this['trunks'][_0xbd393f['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x9de5('0x36')](_0x9de5('0x3d'),this['trunks'][_0xbd393f[_0x9de5('0x47')]][_0x9de5('0x2d')]),_0x9de5('0x2e'),this[_0x9de5('0xb')][_0xbd393f[_0x9de5('0x47')]]);}}}catch(_0x319fae){logger['error']('[userReport][peerstatus]',util[_0x9de5('0x1e')](_0x319fae,{'showHidden':![],'depth':null}));}};module[_0x9de5('0x4b')]=UserReport;
\ No newline at end of file
+var _0x9f5c=['isNotNull','info','state','debug','[userReport][registry]','find','stateRegistry','omit','username','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','substring','indexOf','mobile','phone','accountcode','syncPeerStatus','peer','address','registered','status','updateStatusRealtime','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]','moment','util','ioredis','bluebird','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','syncDeviceState','peerstatus','syncRealtimeShow','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','resolve','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','emit'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0x9f5c,0x183));var _0xc9f5=function(_0x52dd54,_0x4c37a3){_0x52dd54=_0x52dd54-0x0;var _0x385e14=_0x9f5c[_0x52dd54];return _0x385e14;};'use strict';var _=require('lodash');var moment=require(_0xc9f5('0x0'));var util=require(_0xc9f5('0x1'));var Redis=require(_0xc9f5('0x2'));var BPromise=require(_0xc9f5('0x3'));var config=require('../../../config/environment');var logger=require(_0xc9f5('0x4'))('ami');var ami=require(_0xc9f5('0x5'));config[_0xc9f5('0x6')]=_[_0xc9f5('0x7')](config['redis'],{'host':_0xc9f5('0x8'),'port':0x18eb});var io=require(_0xc9f5('0x9'))(new Redis(config[_0xc9f5('0x6')]));function UserReport(_0x3d5be8){this[_0xc9f5('0xa')]=_0x3d5be8['trunks'];this[_0xc9f5('0xb')]=_0x3d5be8[_0xc9f5('0xb')];this[_0xc9f5('0xc')]=_0x3d5be8['telephones'];ami['on'](_0xc9f5('0xd'),this[_0xc9f5('0xe')]['bind'](this));ami['on'](_0xc9f5('0xf'),this[_0xc9f5('0xe')][_0xc9f5('0x10')](this));ami['on']('devicestatechange',this[_0xc9f5('0x11')][_0xc9f5('0x10')](this));ami['on'](_0xc9f5('0x12'),this['syncPeerStatus'][_0xc9f5('0x10')](this));return this[_0xc9f5('0x13')]();}function showSipRegistrations(){Promise['resolve']()[_0xc9f5('0x14')](ami[_0xc9f5('0x15')]())[_0xc9f5('0x16')](function(_0x54f41a){logger['error'](_0xc9f5('0x17'),util[_0xc9f5('0x18')](_0x54f41a,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xc9f5('0x14')](ami[_0xc9f5('0x19')]())[_0xc9f5('0x16')](function(_0x715463){logger[_0xc9f5('0x1a')](_0xc9f5('0x1b'),util[_0xc9f5('0x18')](_0x715463,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xc9f5('0x1c')]()[_0xc9f5('0x14')](ami[_0xc9f5('0x1d')]())['catch'](function(_0x7f96e){logger[_0xc9f5('0x1a')](_0xc9f5('0x1e'),util['inspect'](_0x7f96e,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0xc9f5('0x13')]=function(){setInterval(function(){BPromise[_0xc9f5('0x1c')]()[_0xc9f5('0x14')](showSipRegistrations())[_0xc9f5('0x14')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0xc9f5('0x1f')]['isNotNull']=function(_0x3568b2){return _0x3568b2!==null&&!_['isUndefined'](_0x3568b2);};UserReport['prototype'][_0xc9f5('0x20')]=function(_0xa66544,_0x4a19fe,_0x41dc8a){io['to'](_0xa66544)['emit'](_0x4a19fe,_0x41dc8a);};UserReport[_0xc9f5('0x1f')][_0xc9f5('0xe')]=function(_0xfce97b){try{if(this[_0xc9f5('0x21')](_0xfce97b)){logger[_0xc9f5('0x22')]('[userReport][registry]\x20registry:%s\x20state:%s',_0xfce97b['username'],_0xfce97b[_0xc9f5('0x23')]);logger[_0xc9f5('0x24')](_0xc9f5('0x25'),util[_0xc9f5('0x18')](_0xfce97b,{'showHidden':![],'depth':null}));var _0x27df82=_[_0xc9f5('0x26')](this[_0xc9f5('0xa')],{'defaultuser':_0xfce97b['username']});if(_0x27df82){_0xfce97b[_0xc9f5('0x27')]=_0xfce97b['state'];_['merge'](_0x27df82,_[_0xc9f5('0x28')](_0xfce97b,['event','actionid',_0xc9f5('0x29'),_0xc9f5('0x23')]));logger[_0xc9f5('0x24')](_0xc9f5('0x2a'),util['inspect'](_0x27df82,{'showHidden':![],'depth':null}));this['emit'](util[_0xc9f5('0x2b')]('trunk:%s',_0x27df82[_0xc9f5('0x2c')]),_0xc9f5('0x2d'),_0x27df82);}}}catch(_0x84bc94){logger[_0xc9f5('0x1a')](_0xc9f5('0x25'),util['inspect'](_0x84bc94,{'showHidden':![],'depth':null}));}};UserReport[_0xc9f5('0x1f')]['syncDeviceState']=function(_0x3661ff){try{if(this[_0xc9f5('0x21')](_0x3661ff)){logger[_0xc9f5('0x22')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x3661ff[_0xc9f5('0x2e')],_0x3661ff[_0xc9f5('0x23')]);logger['debug'](_0xc9f5('0x2f'),util[_0xc9f5('0x18')](_0x3661ff,{'showHidden':![],'depth':null}));if(this[_0xc9f5('0xb')][_0x3661ff['device']]){if(!this[_0xc9f5('0xb')][_0x3661ff['device']][_0xc9f5('0x30')]||_0x3661ff[_0xc9f5('0x23')][_0xc9f5('0x31')]()==_0xc9f5('0x32')){this[_0xc9f5('0xb')][_0x3661ff[_0xc9f5('0x2e')]][_0xc9f5('0x30')]=![];if(this[_0xc9f5('0xb')][_0x3661ff[_0xc9f5('0x2e')]][_0xc9f5('0x23')]!==_0x3661ff[_0xc9f5('0x23')][_0xc9f5('0x31')]()){this['agents'][_0x3661ff[_0xc9f5('0x2e')]][_0xc9f5('0x33')]=_[_0xc9f5('0x34')](moment()[_0xc9f5('0x2b')]('x'));}this[_0xc9f5('0xb')][_0x3661ff[_0xc9f5('0x2e')]]['state']=_0x3661ff[_0xc9f5('0x23')][_0xc9f5('0x31')]();this[_0xc9f5('0xb')][_0x3661ff[_0xc9f5('0x2e')]]['updateStatusRealtime'](_0x3661ff);}}else if(this[_0xc9f5('0xc')][_0x3661ff[_0xc9f5('0x2e')]]){if(this[_0xc9f5('0xc')][_0x3661ff[_0xc9f5('0x2e')]]['state']!==_0x3661ff[_0xc9f5('0x23')][_0xc9f5('0x31')]()){this[_0xc9f5('0xc')][_0x3661ff[_0xc9f5('0x2e')]]['stateTime']=_[_0xc9f5('0x34')](moment()[_0xc9f5('0x2b')]('x'));}this['telephones'][_0x3661ff[_0xc9f5('0x2e')]][_0xc9f5('0x23')]=_0x3661ff[_0xc9f5('0x23')][_0xc9f5('0x31')]();logger[_0xc9f5('0x24')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0xc9f5('0xc')][_0x3661ff[_0xc9f5('0x2e')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this['telephones'][_0x3661ff[_0xc9f5('0x2e')]]['name']),'telephone:save',this[_0xc9f5('0xc')][_0x3661ff[_0xc9f5('0x2e')]]);}else if(this[_0xc9f5('0xa')][_0x3661ff[_0xc9f5('0x2e')]]){if(this[_0xc9f5('0xa')][_0x3661ff[_0xc9f5('0x2e')]][_0xc9f5('0x23')]!==_0x3661ff[_0xc9f5('0x23')][_0xc9f5('0x31')]()){this[_0xc9f5('0xa')][_0x3661ff[_0xc9f5('0x2e')]][_0xc9f5('0x33')]=_[_0xc9f5('0x34')](moment()[_0xc9f5('0x2b')]('x'));}this[_0xc9f5('0xa')][_0x3661ff[_0xc9f5('0x2e')]]['state']=_0x3661ff['state'][_0xc9f5('0x31')]();logger['debug'](_0xc9f5('0x35'),util[_0xc9f5('0x18')](this[_0xc9f5('0xa')][_0x3661ff[_0xc9f5('0x2e')]],{'showHidden':![],'depth':null}));this[_0xc9f5('0x20')](util['format'](_0xc9f5('0x36'),this[_0xc9f5('0xa')][_0x3661ff[_0xc9f5('0x2e')]][_0xc9f5('0x2c')]),'trunk:save',this[_0xc9f5('0xa')][_0x3661ff[_0xc9f5('0x2e')]]);}else if(_[_0xc9f5('0x37')](_0x3661ff[_0xc9f5('0x2e')],_0xc9f5('0x38'))){var _0x514c8d=_0x3661ff[_0xc9f5('0x2e')];var _0x152968=_0x514c8d[_0xc9f5('0x39')](_0x514c8d[_0xc9f5('0x3a')]('/')+0x1,_0x514c8d[_0xc9f5('0x3a')]('@'));var _0x97e18a=_[_0xc9f5('0x26')](this[_0xc9f5('0xb')],function(_0xba6df1){return _0xba6df1[_0xc9f5('0x3b')]==_0x152968||_0xba6df1[_0xc9f5('0x3c')]==_0x152968||_0xba6df1[_0xc9f5('0x3d')]==_0x152968;});if(_0x97e18a){if(_0x97e18a[_0xc9f5('0x23')]!==_0x3661ff[_0xc9f5('0x23')][_0xc9f5('0x31')]()){_0x97e18a['stateTime']=_[_0xc9f5('0x34')](moment()['format']('x'));}_0x97e18a[_0xc9f5('0x23')]=_0x3661ff['state'][_0xc9f5('0x31')]();_0x97e18a[_0xc9f5('0x30')]=!![];_0x97e18a['updateStatusRealtime'](_0x3661ff);}}}}catch(_0x5529a2){logger[_0xc9f5('0x1a')](_0xc9f5('0x2f'),util[_0xc9f5('0x18')](_0x5529a2,{'showHidden':![],'depth':null}));}};UserReport[_0xc9f5('0x1f')][_0xc9f5('0x3e')]=function(_0x495446){try{if(this[_0xc9f5('0x21')](_0x495446)&&this['isNotNull'](_0x495446['peerstatus'])){logger[_0xc9f5('0x22')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x495446[_0xc9f5('0x3f')],_0x495446[_0xc9f5('0x40')],_0x495446[_0xc9f5('0x12')]);logger['debug']('[userReport][peerstatus]',util[_0xc9f5('0x18')](_0x495446,{'showHidden':![],'depth':null}));if(this[_0xc9f5('0xb')][_0x495446['peer']]){if(!this[_0xc9f5('0xb')][_0x495446[_0xc9f5('0x3f')]][_0xc9f5('0x30')]||_0x495446[_0xc9f5('0x12')]['toLowerCase']()==_0xc9f5('0x41')){this['agents'][_0x495446[_0xc9f5('0x3f')]]['local']=![];this[_0xc9f5('0xb')][_0x495446['peer']][_0xc9f5('0x42')]=_0x495446['peerstatus']['toLowerCase']();this[_0xc9f5('0xb')][_0x495446[_0xc9f5('0x3f')]][_0xc9f5('0x40')]=_0x495446[_0xc9f5('0x40')];this[_0xc9f5('0xb')][_0x495446['peer']][_0xc9f5('0x43')](_0x495446);}}else if(this[_0xc9f5('0xc')][_0x495446['peer']]){this['telephones'][_0x495446[_0xc9f5('0x3f')]][_0xc9f5('0x42')]=_0x495446[_0xc9f5('0x12')]['toLowerCase']();this[_0xc9f5('0xc')][_0x495446[_0xc9f5('0x3f')]]['address']=_0x495446[_0xc9f5('0x40')];logger[_0xc9f5('0x24')](_0xc9f5('0x44'),util['inspect'](this['telephones'][_0x495446[_0xc9f5('0x3f')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0xc9f5('0xc')][_0x495446['peer']][_0xc9f5('0x2c')]),'telephone:save',this['telephones'][_0x495446['peer']]);}else if(this[_0xc9f5('0xa')][_0x495446[_0xc9f5('0x3f')]]){this[_0xc9f5('0xa')][_0x495446['peer']][_0xc9f5('0x42')]=_0x495446[_0xc9f5('0x12')][_0xc9f5('0x31')]();this[_0xc9f5('0xa')][_0x495446['peer']][_0xc9f5('0x40')]=_0x495446['address'];logger[_0xc9f5('0x24')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xc9f5('0x18')](this[_0xc9f5('0xa')][_0x495446['peer']],{'showHidden':![],'depth':null}));this[_0xc9f5('0x20')](util[_0xc9f5('0x2b')]('trunk:%s',this[_0xc9f5('0xa')][_0x495446[_0xc9f5('0x3f')]][_0xc9f5('0x2c')]),_0xc9f5('0x2d'),this[_0xc9f5('0xa')][_0x495446['peer']]);}}}catch(_0x56863a){logger[_0xc9f5('0x1a')](_0xc9f5('0x45'),util['inspect'](_0x56863a,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
index dd1a9ba..a59a545 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x2fa3fb,_0x17229c){var _0xce981c=function(_0x2348a6){while(--_0x2348a6){_0x2fa3fb['push'](_0x2fa3fb['shift']());}};_0xce981c(++_0x17229c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x235038,_0x15a378){var _0xc45e16=function(_0x49574c){while(--_0x49574c){_0x235038['push'](_0x235038['shift']());}};_0xc45e16(++_0x15a378);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
index 23aa960..fbc81da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x859a=['blindTransfers','bind','newexten','syncNewExten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','isNotNull','isUndefined','prototype','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','keys','context','from-sip','channel','xcally-motion-preview','split','destconnectedlinenum','connectedlinenum','format','user:%s','name','accountcode','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','merge','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','disposition','pick','includes','lastapplication','lastdata','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','linkedid','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','destinationchannel','membername','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','transferType','undefined','isEmpty','stopRecordingOnTransfer','then','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','inuse','busy','invalid','unavailable','ringinuse','onhold','set','queue','dial','playback','NO\x20ANSWER','BUSY','FAILED','defaults','redis','localhost','socket.io-emitter','channels','agents'];(function(_0xd29b7a,_0x3a3654){var _0xf48ae1=function(_0x149037){while(--_0x149037){_0xd29b7a['push'](_0xd29b7a['shift']());}};_0xf48ae1(++_0x3a3654);}(_0x859a,0x17e));var _0xa859=function(_0xbd2ec9,_0x32db48){_0xbd2ec9=_0xbd2ec9-0x0;var _0x3a226e=_0x859a[_0xbd2ec9];return _0x3a226e;};'use strict';var BPromise=require(_0xa859('0x0'));var _=require(_0xa859('0x1'));var moment=require('moment');var util=require(_0xa859('0x2'));var path=require(_0xa859('0x3'));var Redis=require('ioredis');var config=require(_0xa859('0x4'));var logger=require(_0xa859('0x5'))(_0xa859('0x6'));var ami=require(_0xa859('0x7'));var Channel=require(_0xa859('0x8'));var RpcSetting=require(_0xa859('0x9'));var statusDesc=[_0xa859('0xa'),'not_inuse',_0xa859('0xb'),_0xa859('0xc'),_0xa859('0xd'),_0xa859('0xe'),'ringing',_0xa859('0xf'),_0xa859('0x10')];var applications=[_0xa859('0x11'),_0xa859('0x12'),'agi',_0xa859('0x13'),_0xa859('0x14'),'voicemail'];var dispositions=[_0xa859('0x15'),'FAILED','FAILED','NO\x20ANSWER',_0xa859('0x15'),_0xa859('0x15'),'ANSWERED',_0xa859('0x16'),_0xa859('0x17'),_0xa859('0x17'),'FAILED'];var actions={};config['redis']=_[_0xa859('0x18')](config[_0xa859('0x19')],{'host':_0xa859('0x1a'),'port':0x18eb});var io=require(_0xa859('0x1b'))(new Redis(config[_0xa859('0x19')]));function VoiceCallReport(_0x10b9fc){this[_0xa859('0x1c')]=_0x10b9fc['channels'];this[_0xa859('0x1d')]=_0x10b9fc['agents'];this[_0xa859('0x1e')]={};ami['on']('coreshowchannel',this['syncNewExten'][_0xa859('0x1f')](this));ami['on'](_0xa859('0x20'),this[_0xa859('0x21')]['bind'](this));ami['on'](_0xa859('0x22'),this[_0xa859('0x23')][_0xa859('0x1f')](this));ami['on'](_0xa859('0x24'),this[_0xa859('0x25')]['bind'](this));ami['on'](_0xa859('0x26'),this[_0xa859('0x27')][_0xa859('0x1f')](this));ami['on']('hangup',this[_0xa859('0x28')][_0xa859('0x1f')](this));ami['on'](_0xa859('0x29'),this[_0xa859('0x2a')][_0xa859('0x1f')](this));ami['on'](_0xa859('0x2b'),this[_0xa859('0x2c')][_0xa859('0x1f')](this));ami['on'](_0xa859('0x2d'),this[_0xa859('0x2e')]['bind'](this));ami['on'](_0xa859('0x2f'),this[_0xa859('0x30')][_0xa859('0x1f')](this));ami['on']('musiconholdstop',this[_0xa859('0x31')]['bind'](this));try{logger[_0xa859('0x32')](_0xa859('0x33'));ami[_0xa859('0x34')]();}catch(_0x1d9469){logger[_0xa859('0x35')]('[voiceCallReport][coreshowchannels]',util[_0xa859('0x36')](_0x1d9469,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0xa859('0x37')]=function(_0x32f89f){return _0x32f89f!==null&&!_[_0xa859('0x38')](_0x32f89f);};VoiceCallReport[_0xa859('0x39')][_0xa859('0x3a')]=function(_0x12dd9,_0x2ab4ef,_0x34d5e2){io['to'](_0x12dd9)[_0xa859('0x3a')](_0x2ab4ef,_0x34d5e2);};VoiceCallReport['prototype'][_0xa859('0x2a')]=function(_0x4ce592){try{if(this[_0xa859('0x37')](_0x4ce592)){logger[_0xa859('0x32')](_0xa859('0x3b'),_0x4ce592[_0xa859('0x3c')],_0x4ce592[_0xa859('0x3d')],_0x4ce592['calleridnum']);logger[_0xa859('0x3e')](_0xa859('0x3f'),_0x4ce592[_0xa859('0x3c')],util['inspect'](_0x4ce592,{'showHidden':![],'depth':null}));if(_0x4ce592[_0xa859('0x3c')]===_0x4ce592['linkedid']){if(!_[_0xa859('0x38')](this[_0xa859('0x1c')][_0x4ce592[_0xa859('0x3c')]])){_['merge'](this['channels'][_0x4ce592[_0xa859('0x3c')]],_['pick'](_0x4ce592,_[_0xa859('0x40')](this[_0xa859('0x1c')][_0x4ce592[_0xa859('0x3c')]])));}}if(_0x4ce592[_0xa859('0x41')]===_0xa859('0x42')){if(this[_0xa859('0x1d')][_0x4ce592[_0xa859('0x43')]['split']('-')[0x0]]){if(_0x4ce592['exten']==_0xa859('0x44')){this[_0xa859('0x1d')][_0x4ce592['channel'][_0xa859('0x45')]('-')[0x0]][_0xa859('0x46')]=_0x4ce592[_0xa859('0x47')];this[_0xa859('0x3a')](util[_0xa859('0x48')](_0xa859('0x49'),this[_0xa859('0x1d')][_0x4ce592[_0xa859('0x43')]['split']('-')[0x0]][_0xa859('0x4a')]),'user:agentconnect',{'destaccountcode':this[_0xa859('0x1d')][_0x4ce592[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]][_0xa859('0x4b')],'destconnectedlinenum':_0x4ce592['connectedlinenum']});}}}}}catch(_0x262e15){logger['error']('[%s][voiceCallReport][newcallerid]',_0x4ce592[_0xa859('0x3c')],util[_0xa859('0x36')](_0x262e15,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x3cdc15){try{if(this[_0xa859('0x37')](_0x3cdc15)){logger[_0xa859('0x3e')](_0xa859('0x4c'),_0x3cdc15[_0xa859('0x3c')],util[_0xa859('0x36')](_0x3cdc15,{'showHidden':![],'depth':null}));if(_0x3cdc15[_0xa859('0x3c')]===_0x3cdc15['linkedid']&&_0x3cdc15['channel']!=_0xa859('0x4d')){if(_[_0xa859('0x38')](this['channels'][_0x3cdc15[_0xa859('0x3c')]])){logger[_0xa859('0x32')](_0xa859('0x4e'),_0x3cdc15[_0xa859('0x3c')],_0x3cdc15[_0xa859('0x41')],_0x3cdc15[_0xa859('0x4f')]);this[_0xa859('0x1c')][_0x3cdc15[_0xa859('0x3c')]]=new Channel();this[_0xa859('0x1c')][_0x3cdc15[_0xa859('0x3c')]][_0xa859('0x50')]=moment()[_0xa859('0x48')](_0xa859('0x51'));this[_0xa859('0x1c')][_0x3cdc15[_0xa859('0x3c')]]['disposition']=dispositions[_[_0xa859('0x52')](_0x3cdc15[_0xa859('0x53')])];_[_0xa859('0x54')](this[_0xa859('0x1c')][_0x3cdc15['uniqueid']],_['pick'](_0x3cdc15,_['keys'](this['channels'][_0x3cdc15['uniqueid']])));if(_0x3cdc15[_0xa859('0x41')]===_0xa859('0x42')){if(this[_0xa859('0x1d')][_0x3cdc15[_0xa859('0x43')]['split']('-')[0x0]]){if(_[_0xa859('0x38')](this[_0xa859('0x1d')][_0x3cdc15[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]]['destconnectedlinenum'])){this[_0xa859('0x1d')][_0x3cdc15[_0xa859('0x43')]['split']('-')[0x0]][_0xa859('0x46')]=_0x3cdc15[_0xa859('0x4f')];logger[_0xa859('0x3e')](_0xa859('0x55'),_0x3cdc15['uniqueid'],util[_0xa859('0x36')]({'destaccountcode':this['agents'][_0x3cdc15[_0xa859('0x43')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3cdc15[_0xa859('0x4f')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xa859('0x48')](_0xa859('0x49'),this[_0xa859('0x1d')][_0x3cdc15[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]][_0xa859('0x4a')]),_0xa859('0x56'),{'destaccountcode':this['agents'][_0x3cdc15[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]][_0xa859('0x4b')],'destconnectedlinenum':_0x3cdc15['exten']});}}}}}}}catch(_0x5e4810){logger['error']('[%s][voiceCallReport][newchannel]',_0x3cdc15[_0xa859('0x3c')],util[_0xa859('0x36')](_0x5e4810,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa859('0x21')]=function(_0x1c5916){try{if(this['isNotNull'](_0x1c5916)){logger[_0xa859('0x3e')](_0xa859('0x57'),_0x1c5916[_0xa859('0x3c')],util[_0xa859('0x36')](_0x1c5916,{'showHidden':![],'depth':null}));if(_0x1c5916[_0xa859('0x3c')]===_0x1c5916['linkedid']&&_0x1c5916[_0xa859('0x4f')]!='h'&&_0x1c5916[_0xa859('0x43')]!=_0xa859('0x4d')){_0x1c5916['application']=_0x1c5916[_0xa859('0x58')][_0xa859('0x59')]();_0x1c5916[_0xa859('0x5a')]=_0x1c5916[_0xa859('0x5b')]&&_0x1c5916[_0xa859('0x5b')][_0xa859('0x5c')](_0xa859('0x5d'))?_0x1c5916[_0xa859('0x5b')]:(_0x1c5916[_0xa859('0x5b')]||_0x1c5916[_0xa859('0x5a')])[_0xa859('0x59')]();logger[_0xa859('0x32')](_0xa859('0x5e'),_0x1c5916[_0xa859('0x3c')],_0x1c5916['application'],_0x1c5916[_0xa859('0x5a')]);if(_['isUndefined'](this[_0xa859('0x1c')][_0x1c5916[_0xa859('0x3c')]])){this[_0xa859('0x1c')][_0x1c5916[_0xa859('0x3c')]]=new Channel();this[_0xa859('0x1c')][_0x1c5916[_0xa859('0x3c')]][_0xa859('0x50')]=_0x1c5916[_0xa859('0x5f')]?moment()[_0xa859('0x60')](moment[_0xa859('0x5f')](_0x1c5916[_0xa859('0x5f')])['seconds'](),_0xa859('0x61'))['format'](_0xa859('0x51')):moment()[_0xa859('0x48')](_0xa859('0x51'));this['channels'][_0x1c5916[_0xa859('0x3c')]][_0xa859('0x62')]=_0xa859('0x15');}_[_0xa859('0x54')](this[_0xa859('0x1c')][_0x1c5916[_0xa859('0x3c')]],_[_0xa859('0x63')](_0x1c5916,_[_0xa859('0x40')](this[_0xa859('0x1c')][_0x1c5916['uniqueid']])));if(_[_0xa859('0x64')](applications,_0x1c5916[_0xa859('0x58')])){this[_0xa859('0x1c')][_0x1c5916[_0xa859('0x3c')]][_0xa859('0x65')]=_0x1c5916[_0xa859('0x58')];this[_0xa859('0x1c')][_0x1c5916[_0xa859('0x3c')]][_0xa859('0x66')]=_0x1c5916[_0xa859('0x5a')];if(_0x1c5916[_0xa859('0x58')]===_0xa859('0x11')&&_[_0xa859('0x5c')](_0x1c5916[_0xa859('0x5a')][_0xa859('0x59')](),_0xa859('0x67'))){var _0x3e33a6=_0x1c5916[_0xa859('0x5a')][_0xa859('0x45')]('=');var _0x50c527=_0x3e33a6[0x0]['toLowerCase']()[_0xa859('0x68')](/cdr\((.*)\)/);if(_0x50c527){this[_0xa859('0x1c')][_0x1c5916['uniqueid']][_0x50c527[0x1]]=_0x3e33a6[0x1];}}else if(_0x1c5916[_0xa859('0x58')]==='queue'){this[_0xa859('0x1c')][_0x1c5916['uniqueid']][_0xa859('0x12')]=_0x1c5916[_0xa859('0x5a')]['split'](',')[0x0];}}}}}catch(_0x52b9c8){logger[_0xa859('0x35')](_0xa859('0x69'),_0x1c5916[_0xa859('0x3c')],util['inspect'](_0x52b9c8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa859('0x39')][_0xa859('0x25')]=function(_0x4dd783){try{if(this[_0xa859('0x37')](_0x4dd783)){logger['info'](_0xa859('0x6a'),_0x4dd783['uniqueid'],_0x4dd783[_0xa859('0x6b')],_0x4dd783[_0xa859('0x3d')],_0x4dd783[_0xa859('0x6c')]);logger[_0xa859('0x3e')](_0xa859('0x6d'),_0x4dd783['uniqueid'],util[_0xa859('0x36')](_0x4dd783,{'showHidden':![],'depth':null}));if(_0x4dd783[_0xa859('0x3c')]!==_0x4dd783[_0xa859('0x6b')]){if(this['channels'][_0x4dd783[_0xa859('0x6b')]]){if(_0x4dd783[_0xa859('0x53')]==='6'){if(!this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]][_0xa859('0x6e')]){var _0x1ab0f4=moment();this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]]['answered']=!![];this['channels'][_0x4dd783[_0xa859('0x6b')]][_0xa859('0x6f')]=_0x1ab0f4[_0xa859('0x48')](_0xa859('0x51'));if(this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]][_0xa859('0x50')]){this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]]['holdtime']=_0x1ab0f4[_0xa859('0x70')](this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]][_0xa859('0x50')],_0xa859('0x61'));}}this[_0xa859('0x1c')][_0x4dd783['linkedid']][_0xa859('0x6b')]=_0x4dd783[_0xa859('0x3c')];if(_0x4dd783[_0xa859('0x6c')]!==_0xa859('0x44')){this['channels'][_0x4dd783['linkedid']][_0xa859('0x47')]=_0x4dd783['calleridnum'];}this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]][_0xa859('0x71')]=_0x4dd783[_0xa859('0x3d')];this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]][_0xa859('0x72')]=_0x4dd783[_0xa859('0x43')];this['channels'][_0x4dd783[_0xa859('0x6b')]][_0xa859('0x62')]=dispositions[_['toNumber'](_0x4dd783['channelstate'])];if(this[_0xa859('0x1d')][_0x4dd783[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]]){this[_0xa859('0x1c')][_0x4dd783['linkedid']]['UserId']=this[_0xa859('0x1d')][_0x4dd783['channel'][_0xa859('0x45')]('-')[0x0]]['id'];this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]][_0xa859('0x73')]=this[_0xa859('0x1d')][_0x4dd783['channel'][_0xa859('0x45')]('-')[0x0]][_0xa859('0x4a')];}}}}else{if(this['channels'][_0x4dd783[_0xa859('0x3c')]]){if(_0x4dd783[_0xa859('0x53')]==='6'){if(this[_0xa859('0x1d')][_0x4dd783['channel'][_0xa859('0x45')]('-')[0x0]]){this['channels'][_0x4dd783['uniqueid']][_0xa859('0x74')]=this[_0xa859('0x1d')][_0x4dd783[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]]['id'];this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x3c')]][_0xa859('0x73')]=this[_0xa859('0x1d')][_0x4dd783['channel'][_0xa859('0x45')]('-')[0x0]][_0xa859('0x4a')];}}}}if(_0x4dd783[_0xa859('0x53')]==='6'&&_0x4dd783[_0xa859('0x41')]==='from-sip'){if(this[_0xa859('0x1d')][_0x4dd783[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]]){this[_0xa859('0x1d')][_0x4dd783['channel'][_0xa859('0x45')]('-')[0x0]][_0xa859('0x46')]=_0x4dd783[_0xa859('0x4f')];var _0x98605;if(this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x3c')]])_0x98605=this[_0xa859('0x1c')][_0x4dd783['uniqueid']][_0xa859('0x75')];else if(this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]])_0x98605=this[_0xa859('0x1c')][_0x4dd783[_0xa859('0x6b')]][_0xa859('0x75')];logger[_0xa859('0x3e')](_0xa859('0x76'),_0x4dd783['uniqueid'],util[_0xa859('0x36')]({'destaccountcode':this['agents'][_0x4dd783[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]][_0xa859('0x4b')],'destconnectedlinenum':_0x4dd783[_0xa859('0x4f')],'routealias':_0x98605},{'showHidden':![],'depth':null}));this[_0xa859('0x3a')](util[_0xa859('0x48')](_0xa859('0x49'),this[_0xa859('0x1d')][_0x4dd783[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0xa859('0x1d')][_0x4dd783[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]][_0xa859('0x4b')],'destconnectedlinenum':_0x4dd783[_0xa859('0x4f')],'routealias':_0x98605});}}}}catch(_0x21b305){logger[_0xa859('0x35')](_0xa859('0x77'),_0x4dd783[_0xa859('0x3c')],util[_0xa859('0x36')](_0x21b305,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa859('0x39')][_0xa859('0x78')]=function(_0x2cda1f,_0x186bb9){try{if(this[_0xa859('0x1c')][_0x2cda1f]){logger[_0xa859('0x32')](_0xa859('0x79'),_0x2cda1f,_0x186bb9);this[_0xa859('0x1c')][_0x2cda1f][_0xa859('0x7a')]=!![];if(_[_0xa859('0x7b')](_0x186bb9,_0xa859('0x7c'))){_0x186bb9=_0x186bb9[_0xa859('0x7d')](_0xa859('0x7c'),'.WAV');}this[_0xa859('0x1c')][_0x2cda1f][_0xa859('0x7e')]=_0x186bb9;var _0x2ed141=_[_0xa859('0x7f')](this[_0xa859('0x1c')][_0x2cda1f][_0xa859('0x80')],{'filename':_0x186bb9});if(_['isNil'](_0x2ed141)){this[_0xa859('0x1c')][_0x2cda1f][_0xa859('0x80')]['push']({'filename':_0x186bb9,'createdAt':moment()[_0xa859('0x48')](_0xa859('0x51')),'mixmonitorid':'','status':_0xa859('0x81')});}}}catch(_0x54ad43){logger['error'](_0xa859('0x82'),_0x2cda1f,util[_0xa859('0x36')](_0x54ad43,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa859('0x39')]['syncVarSet']=function(_0x464096){try{if(this[_0xa859('0x37')](_0x464096)){logger['debug'](_0xa859('0x83'),_0x464096['uniqueid'],util[_0xa859('0x36')](_0x464096,{'showHidden':![],'depth':null}));if(this[_0xa859('0x1c')][_0x464096[_0xa859('0x3c')]]&&_0x464096[_0xa859('0x43')]!=_0xa859('0x4d')){if(this['isNotNull'](_0x464096['variable'])){if(this['isNotNull'](_0x464096[_0xa859('0x84')][_0xa859('0x85')])){logger[_0xa859('0x32')](_0xa859('0x86'),_0x464096[_0xa859('0x3c')],_0x464096[_0xa859('0x87')]);this[_0xa859('0x78')](_0x464096[_0xa859('0x3c')],_0x464096[_0xa859('0x87')]);}else if(this['isNotNull'](_0x464096[_0xa859('0x84')][_0xa859('0x88')])){logger[_0xa859('0x32')](_0xa859('0x89'),_0x464096[_0xa859('0x3c')],_0x464096[_0xa859('0x87')]);this[_0xa859('0x1c')][_0x464096[_0xa859('0x3c')]][_0xa859('0x6c')]=_0x464096[_0xa859('0x87')];}else if(this[_0xa859('0x37')](_0x464096['variable'][_0xa859('0x8a')])){logger[_0xa859('0x32')](_0xa859('0x8b'),_0x464096[_0xa859('0x3c')],_0x464096[_0xa859('0x87')]);this[_0xa859('0x1c')][_0x464096[_0xa859('0x3c')]]['callerid']=_0x464096[_0xa859('0x87')];}else if(this['isNotNull'](_0x464096[_0xa859('0x84')]['xmd-cdrtype'])){logger[_0xa859('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x464096[_0xa859('0x3c')],_0x464096['value']);this[_0xa859('0x1c')][_0x464096[_0xa859('0x3c')]][_0xa859('0x8c')]=_0x464096['value'];}else if(this[_0xa859('0x37')](_0x464096[_0xa859('0x84')]['xmd-queue'])){logger[_0xa859('0x32')](_0xa859('0x8d'),_0x464096[_0xa859('0x3c')],_0x464096['value']['split'](',')[0x0]);this['channels'][_0x464096[_0xa859('0x3c')]][_0xa859('0x12')]=_0x464096[_0xa859('0x87')][_0xa859('0x45')](',')[0x0];}else if(this['isNotNull'](_0x464096[_0xa859('0x84')][_0xa859('0x8e')])){logger[_0xa859('0x32')](_0xa859('0x8f'),_0x464096[_0xa859('0x3c')],_0x464096[_0xa859('0x87')]);this[_0xa859('0x1c')][_0x464096[_0xa859('0x3c')]][_0xa859('0x90')]=_0x464096['value'];}else if(this[_0xa859('0x37')](_0x464096['variable']['xmd-destination'])){logger[_0xa859('0x32')](_0xa859('0x91'),_0x464096[_0xa859('0x3c')],_0x464096[_0xa859('0x87')]);this[_0xa859('0x1c')][_0x464096[_0xa859('0x3c')]][_0xa859('0x92')]=_0x464096[_0xa859('0x87')];}else if(this[_0xa859('0x37')](_0x464096[_0xa859('0x84')][_0xa859('0x93')])){logger[_0xa859('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x464096[_0xa859('0x3c')],_0x464096['value']);this[_0xa859('0x1c')][_0x464096[_0xa859('0x3c')]][_0xa859('0x94')]=_0x464096['value'];}else if(this[_0xa859('0x37')](_0x464096[_0xa859('0x84')][_0xa859('0x95')])){logger[_0xa859('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x464096[_0xa859('0x3c')],_0x464096[_0xa859('0x87')]);this[_0xa859('0x1c')][_0x464096['uniqueid']][_0xa859('0x12')]=_0x464096[_0xa859('0x87')];}else if(this[_0xa859('0x37')](_0x464096['variable'][_0xa859('0x96')])){logger[_0xa859('0x32')](_0xa859('0x97'),_0x464096[_0xa859('0x3c')],_0x464096[_0xa859('0x87')]);this[_0xa859('0x1c')][_0x464096[_0xa859('0x3c')]]['sipcalluniqueid']=_0x464096[_0xa859('0x87')];}}}else if(this['isNotNull'](_0x464096['variable'][_0xa859('0x85')])){if(_0x464096['value']){var _0x509d43=path['parse'](_0x464096[_0xa859('0x87')])[_0xa859('0x4a')];logger[_0xa859('0x32')](_0xa859('0x86'),_0x509d43,_0x464096[_0xa859('0x87')]);this[_0xa859('0x78')](_0x509d43,_0x464096[_0xa859('0x87')]);}}else if(this[_0xa859('0x1c')][_0x464096[_0xa859('0x6b')]]){if(this['isNotNull'](_0x464096[_0xa859('0x84')])){if(this[_0xa859('0x37')](_0x464096['variable'][_0xa859('0x96')])){logger['info'](_0xa859('0x97'),_0x464096[_0xa859('0x6b')],_0x464096[_0xa859('0x87')]);this[_0xa859('0x1c')][_0x464096[_0xa859('0x6b')]][_0xa859('0x98')]=_0x464096['value'];}}}}}catch(_0x3f780f){logger['error']('[%s][voiceCallReport][varset]',_0x464096[_0xa859('0x3c')],util[_0xa859('0x36')](_0x3f780f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa859('0x39')][_0xa859('0x28')]=function(_0x59a405){try{if(this[_0xa859('0x37')](_0x59a405)){logger[_0xa859('0x3e')](_0xa859('0x99'),_0x59a405[_0xa859('0x3c')],util[_0xa859('0x36')](_0x59a405,{'showHidden':![],'depth':null}));if(this[_0xa859('0x1c')][_0x59a405['uniqueid']]){logger['info']('[%s][voiceCallReport][hangup]\x20reason:%s',_0x59a405[_0xa859('0x3c')],_0x59a405[_0xa859('0x9a')]);var _0x4972c0=moment();this[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]][_0xa859('0x9b')]=_0x4972c0[_0xa859('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa859('0x1c')][_0x59a405['uniqueid']]['duration']=_0x4972c0[_0xa859('0x70')](this[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]][_0xa859('0x50')],'seconds');if(this[_0xa859('0x1c')][_0x59a405['uniqueid']][_0xa859('0x6e')]){this[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]][_0xa859('0x9c')]=_0x4972c0[_0xa859('0x70')](this[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]][_0xa859('0x6f')],_0xa859('0x61'));this[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]][_0xa859('0x9d')]=this[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]][_0xa859('0x5f')]-this[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]][_0xa859('0x9c')];}if(_0x59a405[_0xa859('0x41')]==='from-sip'){if(this[_0xa859('0x1d')][_0x59a405['channel']['split']('-')[0x0]]){this[_0xa859('0x1d')][_0x59a405[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]]=_[_0xa859('0x9e')](this[_0xa859('0x1d')][_0x59a405['channel'][_0xa859('0x45')]('-')[0x0]],['destconnectedlinenum']);logger[_0xa859('0x3e')](_0xa859('0x9f'),_0x59a405['uniqueid'],util['inspect']({'id':this[_0xa859('0x1d')][_0x59a405[_0xa859('0x43')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xa859('0x1d')][_0x59a405['channel']['split']('-')[0x0]][_0xa859('0x4b')]},{'showHidden':![],'depth':null}));this[_0xa859('0x3a')](util['format'](_0xa859('0x49'),this[_0xa859('0x1d')][_0x59a405['channel'][_0xa859('0x45')]('-')[0x0]][_0xa859('0x4a')]),_0xa859('0xa0'),{'id':this[_0xa859('0x1d')][_0x59a405[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]]['id'],'destaccountcode':this[_0xa859('0x1d')][_0x59a405[_0xa859('0x43')][_0xa859('0x45')]('-')[0x0]][_0xa859('0x4b')]});}}var _0x27ef0b=this;Promise[_0xa859('0xa1')]()['then'](function(){var _0x447126=_0x27ef0b[_0xa859('0x1c')][_0x59a405['uniqueid']];if(typeof _0x447126[_0xa859('0xa2')]===_0xa859('0xa3'))return;if(_[_0xa859('0xa4')](_0x447126[_0xa859('0x80')]))return;return RpcSetting['getSettings']()['then'](function(_0x4c6de6){if(!_0x4c6de6[_0xa859('0xa5')])return;return Promise[_0xa859('0xa1')]()[_0xa859('0xa6')](function(){return ami[_0xa859('0xa7')]({'action':'StopMixMonitor','channel':_0x447126[_0xa859('0x43')]})['catch'](function(){});})['then'](function(){return ami[_0xa859('0xa7')]({'action':_0xa859('0xa8'),'channel':_0x447126[_0xa859('0x72')]})[_0xa859('0xa9')](function(){})[_0xa859('0xaa')](function(){var _0x4e4f0d=_0x27ef0b['agents'][_0x447126[_0xa859('0x72')][_0xa859('0x45')]('-')[0x0]];if(!_0x4e4f0d)return;io[_0xa859('0x3a')](_0xa859('0xab'),{'agentId':_0x4e4f0d['id'],'uniqueid':_0x447126[_0xa859('0x3c')]});});});});})[_0xa859('0xa6')](function(){if(_0x59a405[_0xa859('0xac')]===_0xa859('0xad')){_0x27ef0b[_0xa859('0x1e')][_0x59a405[_0xa859('0x3c')]]=_0x27ef0b[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]];}else{if(_0x27ef0b[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]][_0xa859('0x8c')]===_0xa859('0xae')&&_0x27ef0b[_0xa859('0x1e')][_0x59a405['uniqueid']]){_0x27ef0b[_0xa859('0x1c')][_0x59a405['uniqueid']][_0xa859('0x3c')]=[_0x27ef0b[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]][_0xa859('0x6b')],_0x27ef0b[_0xa859('0x1c')][_0x59a405[_0xa859('0x3c')]]['linkedid']=_0x27ef0b[_0xa859('0x1c')][_0x59a405['uniqueid']][_0xa859('0x3c')]][0x0];delete _0x27ef0b[_0xa859('0x1e')][_0x59a405[_0xa859('0x3c')]];}}logger[_0xa859('0x3e')](_0xa859('0xaf'),_0x59a405[_0xa859('0x3c')],util[_0xa859('0x36')](_0x27ef0b[_0xa859('0x1c')][_0x59a405['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xa859('0xb0'),_0x27ef0b[_0xa859('0x1c')][_0x59a405['uniqueid']]);delete _0x27ef0b[_0xa859('0x1c')][_0x59a405['uniqueid']];});}}}catch(_0x2336f4){logger[_0xa859('0x35')]('[%s][voiceCallReport][hangup]',_0x59a405[_0xa859('0x3c')],util[_0xa859('0x36')](_0x2336f4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa859('0x2c')]=function(_0x19539c){try{if(this['isNotNull'](_0x19539c)){logger[_0xa859('0x32')](_0xa859('0xb1'),_0x19539c[_0xa859('0x3c')],_0x19539c[_0xa859('0xb2')],_0x19539c[_0xa859('0xb3')]);logger[_0xa859('0x3e')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x19539c[_0xa859('0x3c')],util[_0xa859('0x36')](_0x19539c,{'showHidden':![],'depth':null}));if(this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb4')]]){this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb4')]][_0xa859('0xb5')]=_0x19539c[_0xa859('0xb2')];this[_0xa859('0x1c')][_0x19539c['transfereeuniqueid']][_0xa859('0xb6')]=_0x19539c[_0xa859('0xb3')];if(this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb7')]]){var _0x31c670=this['channels'][_0x19539c[_0xa859('0xb7')]];this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb7')]]=this[_0xa859('0x1c')][_0x19539c['transfereeuniqueid']];this[_0xa859('0x1c')][_0x19539c['transfereeuniqueid']]=_0x31c670;}}else if(this[_0xa859('0x1c')][_0x19539c['transfertargetuniqueid']]){this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb8')]][_0xa859('0xb5')]=_0x19539c[_0xa859('0xb2')];this['channels'][_0x19539c['transfertargetuniqueid']][_0xa859('0xb6')]=_0x19539c[_0xa859('0xb3')];if(this['channels'][_0x19539c['origtransfereruniqueid']]){var _0x31c670=this['channels'][_0x19539c[_0xa859('0xb9')]];this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb9')]]=this['channels'][_0x19539c['transfertargetuniqueid']];this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb8')]]=_0x31c670;}}if((this['channels'][_0x19539c[_0xa859('0xb9')]]||this[_0xa859('0x1c')][_0x19539c[_0xa859('0xba')]])&&this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb7')]]){var _0x3ff897=_['some']([this['channels'][_0x19539c[_0xa859('0xb9')]],this[_0xa859('0x1c')][_0x19539c[_0xa859('0xba')]],this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb7')]]],function(_0x50f166){return _0x50f166&&_0x50f166[_0xa859('0x8c')]===_0xa859('0xae')&&_0x50f166['routeid'];});if(_0x3ff897){if(this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb9')]])this['channels'][_0x19539c['origtransfereruniqueid']][_0xa859('0xa2')]='ATTENDED';if(this[_0xa859('0x1c')][_0x19539c[_0xa859('0xba')]])this[_0xa859('0x1c')][_0x19539c['origtransfererlinkedid']][_0xa859('0xa2')]='ATTENDED';this[_0xa859('0x1c')][_0x19539c[_0xa859('0xb7')]][_0xa859('0xa2')]=_0xa859('0xbb');}}}}catch(_0x4e51a9){logger[_0xa859('0x35')](_0xa859('0xbc'),_0x19539c[_0xa859('0x3c')],util[_0xa859('0x36')](_0x4e51a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa859('0x39')]['syncBlindTransfer']=function(_0x1dbc0d){try{if(this[_0xa859('0x37')](_0x1dbc0d)){logger[_0xa859('0x32')](_0xa859('0xbd'),_0x1dbc0d['uniqueid'],_0x1dbc0d[_0xa859('0xbe')],_0x1dbc0d[_0xa859('0xbf')]);logger[_0xa859('0x3e')](_0xa859('0xc0'),_0x1dbc0d['uniqueid'],util[_0xa859('0x36')](_0x1dbc0d,{'showHidden':![],'depth':null}));if(this[_0xa859('0x1c')][_0x1dbc0d['transfereeuniqueid']]){this['channels'][_0x1dbc0d[_0xa859('0xb4')]][_0xa859('0xb5')]=_0x1dbc0d['transfereecalleridnum'];this[_0xa859('0x1c')][_0x1dbc0d['transfereeuniqueid']][_0xa859('0xb6')]=_0x1dbc0d[_0xa859('0xbf')];this[_0xa859('0x1c')][_0x1dbc0d[_0xa859('0xb4')]][_0xa859('0xa2')]=_0xa859('0xc1');this[_0xa859('0x28')]({'event':_0xa859('0xad'),'uniqueid':_0x1dbc0d[_0xa859('0xb4')],'context':_0x1dbc0d['context'],'channel':_0x1dbc0d[_0xa859('0xc2')]});}else{this['channels'][_0x1dbc0d[_0xa859('0xc3')]]['transferType']=_0xa859('0xc1');}}}catch(_0x228fa6){logger[_0xa859('0x35')](_0xa859('0xc4'),_0x1dbc0d[_0xa859('0x3c')],util[_0xa859('0x36')](_0x228fa6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa859('0x30')]=function(_0x3acde1){try{if(this[_0xa859('0x37')](_0x3acde1)){logger['debug'](_0xa859('0xc5'),_0x3acde1[_0xa859('0x3c')],util[_0xa859('0x36')](_0x3acde1,{'showHidden':![],'depth':null}));if(this[_0xa859('0x1c')][_0x3acde1[_0xa859('0x3c')]]){if(!_[_0xa859('0xc6')](this['channels'][_0x3acde1[_0xa859('0x3c')]][_0xa859('0x6f')])){this[_0xa859('0x1c')][_0x3acde1[_0xa859('0x3c')]][_0xa859('0xc7')]=moment()['format'](_0xa859('0x51'));logger[_0xa859('0x32')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x3acde1[_0xa859('0x3c')],this[_0xa859('0x1c')][_0x3acde1[_0xa859('0x3c')]]['mohstarttime']);}}}}catch(_0x5190e3){logger[_0xa859('0x35')](_0xa859('0xc8'),_0x3acde1[_0xa859('0x3c')],util[_0xa859('0x36')](_0x5190e3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa859('0x31')]=function(_0x5f2232){try{if(this[_0xa859('0x37')](_0x5f2232)){logger[_0xa859('0x3e')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x5f2232['uniqueid'],util[_0xa859('0x36')](_0x5f2232,{'showHidden':![],'depth':null}));if(this[_0xa859('0x1c')][_0x5f2232[_0xa859('0x3c')]]){if(!_[_0xa859('0xc6')](this[_0xa859('0x1c')][_0x5f2232[_0xa859('0x3c')]][_0xa859('0xc7')])){this[_0xa859('0x1c')][_0x5f2232['uniqueid']][_0xa859('0xc9')]+=moment()[_0xa859('0xca')](0x0)['diff'](this[_0xa859('0x1c')][_0x5f2232[_0xa859('0x3c')]][_0xa859('0xc7')],'seconds');logger[_0xa859('0x32')](_0xa859('0xcb'),_0x5f2232['uniqueid'],this[_0xa859('0x1c')][_0x5f2232[_0xa859('0x3c')]][_0xa859('0xc9')]);delete this[_0xa859('0x1c')][_0x5f2232[_0xa859('0x3c')]][_0xa859('0xc7')];}}}}catch(_0x33b565){logger[_0xa859('0x35')](_0xa859('0xcc'),_0x5f2232[_0xa859('0x3c')],util[_0xa859('0x36')](_0x33b565,{'showHidden':![],'depth':null}));}};module[_0xa859('0xcd')]=VoiceCallReport;
\ No newline at end of file
+var _0x1b42=['some','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','../../../config/environment','ami','../model/channel','../rpc/setting','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','agi','playback','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','isNotNull','prototype','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','inspect','isUndefined','uniqueid','pick','keys','from-sip','channel','split','exten','connectedlinenum','format','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','disposition','merge','context','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','error','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','linkedid','OutgoingSpoolFailed','application','toLowerCase','applicationdata','startsWith','CDR(routeAlias)','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','subtract','seconds','includes','lastapplication','set','match','queue','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','channelstate','answered','holdtime','diff','xcally-motion-preview','connectedlinename','destinationchannel','toNumber','UserId','membername','name','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','.wav49','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%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','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','billableseconds','answertime','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','then','transferType','undefined','isEmpty','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','finally','webbar:stopmonitors','event','blindTransfers','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x3382df,_0x547339){var _0x4277af=function(_0x305e78){while(--_0x305e78){_0x3382df['push'](_0x3382df['shift']());}};_0x4277af(++_0x547339);}(_0x1b42,0xe2));var _0x21b4=function(_0x516b8b,_0x52d1bc){_0x516b8b=_0x516b8b-0x0;var _0x162b73=_0x1b42[_0x516b8b];return _0x162b73;};'use strict';var BPromise=require('bluebird');var _=require(_0x21b4('0x0'));var moment=require(_0x21b4('0x1'));var util=require(_0x21b4('0x2'));var path=require(_0x21b4('0x3'));var Redis=require('ioredis');var config=require(_0x21b4('0x4'));var logger=require('../../../config/logger')(_0x21b4('0x5'));var ami=require('../ami');var Channel=require(_0x21b4('0x6'));var RpcSetting=require(_0x21b4('0x7'));var statusDesc=['unknown','not_inuse',_0x21b4('0x8'),_0x21b4('0x9'),_0x21b4('0xa'),_0x21b4('0xb'),_0x21b4('0xc'),_0x21b4('0xd'),_0x21b4('0xe')];var applications=['set','queue',_0x21b4('0xf'),'dial',_0x21b4('0x10'),'voicemail'];var dispositions=[_0x21b4('0x11'),_0x21b4('0x12'),_0x21b4('0x12'),_0x21b4('0x11'),'NO\x20ANSWER',_0x21b4('0x11'),'ANSWERED',_0x21b4('0x13'),'FAILED',_0x21b4('0x12'),'FAILED'];var actions={};config[_0x21b4('0x14')]=_[_0x21b4('0x15')](config[_0x21b4('0x14')],{'host':_0x21b4('0x16'),'port':0x18eb});var io=require(_0x21b4('0x17'))(new Redis(config['redis']));function VoiceCallReport(_0x1e5dba){this[_0x21b4('0x18')]=_0x1e5dba['channels'];this[_0x21b4('0x19')]=_0x1e5dba['agents'];this['blindTransfers']={};ami['on'](_0x21b4('0x1a'),this[_0x21b4('0x1b')][_0x21b4('0x1c')](this));ami['on'](_0x21b4('0x1d'),this[_0x21b4('0x1b')][_0x21b4('0x1c')](this));ami['on'](_0x21b4('0x1e'),this[_0x21b4('0x1f')][_0x21b4('0x1c')](this));ami['on'](_0x21b4('0x20'),this['syncNewState'][_0x21b4('0x1c')](this));ami['on'](_0x21b4('0x21'),this[_0x21b4('0x22')][_0x21b4('0x1c')](this));ami['on'](_0x21b4('0x23'),this[_0x21b4('0x24')][_0x21b4('0x1c')](this));ami['on']('newcallerid',this[_0x21b4('0x25')][_0x21b4('0x1c')](this));ami['on']('attendedtransfer',this[_0x21b4('0x26')]['bind'](this));ami['on'](_0x21b4('0x27'),this[_0x21b4('0x28')][_0x21b4('0x1c')](this));ami['on'](_0x21b4('0x29'),this[_0x21b4('0x2a')][_0x21b4('0x1c')](this));ami['on'](_0x21b4('0x2b'),this[_0x21b4('0x2c')][_0x21b4('0x1c')](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x21b4('0x2d')]();}catch(_0x28523d){logger['error'](_0x21b4('0x2e'),util['inspect'](_0x28523d,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x21b4('0x2f')]=function(_0x7674aa){return _0x7674aa!==null&&!_['isUndefined'](_0x7674aa);};VoiceCallReport[_0x21b4('0x30')][_0x21b4('0x31')]=function(_0x2a4296,_0x372e17,_0x4549db){io['to'](_0x2a4296)[_0x21b4('0x31')](_0x372e17,_0x4549db);};VoiceCallReport[_0x21b4('0x30')][_0x21b4('0x25')]=function(_0x595fa0){try{if(this[_0x21b4('0x2f')](_0x595fa0)){logger[_0x21b4('0x32')](_0x21b4('0x33'),_0x595fa0['uniqueid'],_0x595fa0[_0x21b4('0x34')],_0x595fa0[_0x21b4('0x35')]);logger[_0x21b4('0x36')](_0x21b4('0x37'),_0x595fa0['uniqueid'],util[_0x21b4('0x38')](_0x595fa0,{'showHidden':![],'depth':null}));if(_0x595fa0['uniqueid']===_0x595fa0['linkedid']){if(!_[_0x21b4('0x39')](this[_0x21b4('0x18')][_0x595fa0[_0x21b4('0x3a')]])){_['merge'](this[_0x21b4('0x18')][_0x595fa0[_0x21b4('0x3a')]],_[_0x21b4('0x3b')](_0x595fa0,_[_0x21b4('0x3c')](this[_0x21b4('0x18')][_0x595fa0[_0x21b4('0x3a')]])));}}if(_0x595fa0['context']===_0x21b4('0x3d')){if(this[_0x21b4('0x19')][_0x595fa0[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]){if(_0x595fa0[_0x21b4('0x40')]=='xcally-motion-preview'){this['agents'][_0x595fa0['channel']['split']('-')[0x0]]['destconnectedlinenum']=_0x595fa0[_0x21b4('0x41')];this['emit'](util[_0x21b4('0x42')]('user:%s',this[_0x21b4('0x19')][_0x595fa0[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this['agents'][_0x595fa0['channel'][_0x21b4('0x3f')]('-')[0x0]][_0x21b4('0x43')],'destconnectedlinenum':_0x595fa0['connectedlinenum']});}}}}}catch(_0x4e5c19){logger['error'](_0x21b4('0x44'),_0x595fa0[_0x21b4('0x3a')],util[_0x21b4('0x38')](_0x4e5c19,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x21b4('0x1f')]=function(_0xadcd56){try{if(this['isNotNull'](_0xadcd56)){logger['debug']('[%s][voiceCallReport][newchannel]\x20event:',_0xadcd56['uniqueid'],util[_0x21b4('0x38')](_0xadcd56,{'showHidden':![],'depth':null}));if(_0xadcd56['uniqueid']===_0xadcd56['linkedid']&&_0xadcd56[_0x21b4('0x3e')]!='OutgoingSpoolFailed'){if(_[_0x21b4('0x39')](this[_0x21b4('0x18')][_0xadcd56[_0x21b4('0x3a')]])){logger[_0x21b4('0x32')](_0x21b4('0x45'),_0xadcd56[_0x21b4('0x3a')],_0xadcd56['context'],_0xadcd56['exten']);this[_0x21b4('0x18')][_0xadcd56[_0x21b4('0x3a')]]=new Channel();this[_0x21b4('0x18')][_0xadcd56[_0x21b4('0x3a')]]['starttime']=moment()[_0x21b4('0x42')](_0x21b4('0x46'));this[_0x21b4('0x18')][_0xadcd56[_0x21b4('0x3a')]][_0x21b4('0x47')]=dispositions[_['toNumber'](_0xadcd56['channelstate'])];_[_0x21b4('0x48')](this['channels'][_0xadcd56[_0x21b4('0x3a')]],_[_0x21b4('0x3b')](_0xadcd56,_[_0x21b4('0x3c')](this[_0x21b4('0x18')][_0xadcd56[_0x21b4('0x3a')]])));if(_0xadcd56[_0x21b4('0x49')]===_0x21b4('0x3d')){if(this[_0x21b4('0x19')][_0xadcd56[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]){if(_[_0x21b4('0x39')](this[_0x21b4('0x19')][_0xadcd56[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]['destconnectedlinenum'])){this[_0x21b4('0x19')][_0xadcd56[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]][_0x21b4('0x4a')]=_0xadcd56[_0x21b4('0x40')];logger['debug'](_0x21b4('0x4b'),_0xadcd56[_0x21b4('0x3a')],util['inspect']({'destaccountcode':this[_0x21b4('0x19')][_0xadcd56[_0x21b4('0x3e')]['split']('-')[0x0]][_0x21b4('0x43')],'destconnectedlinenum':_0xadcd56[_0x21b4('0x40')]},{'showHidden':![],'depth':null}));this[_0x21b4('0x31')](util[_0x21b4('0x42')](_0x21b4('0x4c'),this[_0x21b4('0x19')][_0xadcd56[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]['name']),_0x21b4('0x4d'),{'destaccountcode':this[_0x21b4('0x19')][_0xadcd56[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]][_0x21b4('0x43')],'destconnectedlinenum':_0xadcd56['exten']});}}}}}}}catch(_0x5aa1ab){logger[_0x21b4('0x4e')](_0x21b4('0x4f'),_0xadcd56['uniqueid'],util[_0x21b4('0x38')](_0x5aa1ab,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x21b4('0x1b')]=function(_0x22a2a1){try{if(this[_0x21b4('0x2f')](_0x22a2a1)){logger[_0x21b4('0x36')](_0x21b4('0x50'),_0x22a2a1[_0x21b4('0x3a')],util['inspect'](_0x22a2a1,{'showHidden':![],'depth':null}));if(_0x22a2a1[_0x21b4('0x3a')]===_0x22a2a1[_0x21b4('0x51')]&&_0x22a2a1[_0x21b4('0x40')]!='h'&&_0x22a2a1[_0x21b4('0x3e')]!=_0x21b4('0x52')){_0x22a2a1[_0x21b4('0x53')]=_0x22a2a1[_0x21b4('0x53')][_0x21b4('0x54')]();_0x22a2a1[_0x21b4('0x55')]=_0x22a2a1['appdata']&&_0x22a2a1['appdata'][_0x21b4('0x56')](_0x21b4('0x57'))?_0x22a2a1[_0x21b4('0x58')]:(_0x22a2a1[_0x21b4('0x58')]||_0x22a2a1[_0x21b4('0x55')])[_0x21b4('0x54')]();logger['info'](_0x21b4('0x59'),_0x22a2a1['uniqueid'],_0x22a2a1[_0x21b4('0x53')],_0x22a2a1[_0x21b4('0x55')]);if(_['isUndefined'](this[_0x21b4('0x18')][_0x22a2a1[_0x21b4('0x3a')]])){this[_0x21b4('0x18')][_0x22a2a1['uniqueid']]=new Channel();this[_0x21b4('0x18')][_0x22a2a1[_0x21b4('0x3a')]][_0x21b4('0x5a')]=_0x22a2a1[_0x21b4('0x5b')]?moment()[_0x21b4('0x5c')](moment[_0x21b4('0x5b')](_0x22a2a1['duration'])[_0x21b4('0x5d')](),_0x21b4('0x5d'))[_0x21b4('0x42')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0x21b4('0x46'));this[_0x21b4('0x18')][_0x22a2a1[_0x21b4('0x3a')]][_0x21b4('0x47')]=_0x21b4('0x11');}_['merge'](this[_0x21b4('0x18')][_0x22a2a1[_0x21b4('0x3a')]],_[_0x21b4('0x3b')](_0x22a2a1,_[_0x21b4('0x3c')](this[_0x21b4('0x18')][_0x22a2a1[_0x21b4('0x3a')]])));if(_[_0x21b4('0x5e')](applications,_0x22a2a1['application'])){this[_0x21b4('0x18')][_0x22a2a1['uniqueid']][_0x21b4('0x5f')]=_0x22a2a1[_0x21b4('0x53')];this[_0x21b4('0x18')][_0x22a2a1['uniqueid']]['lastdata']=_0x22a2a1[_0x21b4('0x55')];if(_0x22a2a1[_0x21b4('0x53')]===_0x21b4('0x60')&&_[_0x21b4('0x56')](_0x22a2a1[_0x21b4('0x55')][_0x21b4('0x54')](),'cdr(')){var _0xa6fbfd=_0x22a2a1[_0x21b4('0x55')]['split']('=');var _0x57e55a=_0xa6fbfd[0x0][_0x21b4('0x54')]()[_0x21b4('0x61')](/cdr\((.*)\)/);if(_0x57e55a){this[_0x21b4('0x18')][_0x22a2a1[_0x21b4('0x3a')]][_0x57e55a[0x1]]=_0xa6fbfd[0x1];}}else if(_0x22a2a1[_0x21b4('0x53')]==='queue'){this[_0x21b4('0x18')][_0x22a2a1[_0x21b4('0x3a')]][_0x21b4('0x62')]=_0x22a2a1[_0x21b4('0x55')][_0x21b4('0x3f')](',')[0x0];}}}}}catch(_0x23d1cc){logger['error'](_0x21b4('0x63'),_0x22a2a1[_0x21b4('0x3a')],util[_0x21b4('0x38')](_0x23d1cc,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x21b4('0x64')]=function(_0x4cb066){try{if(this['isNotNull'](_0x4cb066)){logger[_0x21b4('0x32')](_0x21b4('0x65'),_0x4cb066['uniqueid'],_0x4cb066[_0x21b4('0x51')],_0x4cb066[_0x21b4('0x34')],_0x4cb066['calleridnum']);logger[_0x21b4('0x36')]('[%s][voiceCallReport][newstate]\x20event:',_0x4cb066[_0x21b4('0x3a')],util['inspect'](_0x4cb066,{'showHidden':![],'depth':null}));if(_0x4cb066['uniqueid']!==_0x4cb066[_0x21b4('0x51')]){if(this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x51')]]){if(_0x4cb066[_0x21b4('0x66')]==='6'){if(!this['channels'][_0x4cb066[_0x21b4('0x51')]][_0x21b4('0x67')]){var _0x39a278=moment();this[_0x21b4('0x18')][_0x4cb066['linkedid']]['answered']=!![];this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x51')]]['answertime']=_0x39a278[_0x21b4('0x42')](_0x21b4('0x46'));if(this[_0x21b4('0x18')][_0x4cb066['linkedid']]['starttime']){this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x51')]][_0x21b4('0x68')]=_0x39a278[_0x21b4('0x69')](this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x51')]]['starttime'],'seconds');}}this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x51')]][_0x21b4('0x51')]=_0x4cb066[_0x21b4('0x3a')];if(_0x4cb066[_0x21b4('0x35')]!==_0x21b4('0x6a')){this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x51')]][_0x21b4('0x41')]=_0x4cb066['calleridnum'];}this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x51')]][_0x21b4('0x6b')]=_0x4cb066[_0x21b4('0x34')];this['channels'][_0x4cb066['linkedid']][_0x21b4('0x6c')]=_0x4cb066[_0x21b4('0x3e')];this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x51')]]['disposition']=dispositions[_[_0x21b4('0x6d')](_0x4cb066['channelstate'])];if(this['agents'][_0x4cb066[_0x21b4('0x3e')]['split']('-')[0x0]]){this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x51')]][_0x21b4('0x6e')]=this[_0x21b4('0x19')][_0x4cb066[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]['id'];this['channels'][_0x4cb066[_0x21b4('0x51')]]['membername']=this[_0x21b4('0x19')][_0x4cb066[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]['name'];}}}}else{if(this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x3a')]]){if(_0x4cb066[_0x21b4('0x66')]==='6'){if(this['agents'][_0x4cb066[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]){this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x3a')]][_0x21b4('0x6e')]=this[_0x21b4('0x19')][_0x4cb066[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]['id'];this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x3a')]][_0x21b4('0x6f')]=this['agents'][_0x4cb066['channel'][_0x21b4('0x3f')]('-')[0x0]]['name'];}}}}if(_0x4cb066[_0x21b4('0x66')]==='6'&&_0x4cb066[_0x21b4('0x49')]==='from-sip'){if(this['agents'][_0x4cb066[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]){this[_0x21b4('0x19')][_0x4cb066[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]][_0x21b4('0x4a')]=_0x4cb066['exten'];var _0xf179;if(this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x3a')]])_0xf179=this[_0x21b4('0x18')][_0x4cb066[_0x21b4('0x3a')]]['routealias'];else if(this['channels'][_0x4cb066[_0x21b4('0x51')]])_0xf179=this['channels'][_0x4cb066[_0x21b4('0x51')]]['routealias'];logger[_0x21b4('0x36')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x4cb066[_0x21b4('0x3a')],util[_0x21b4('0x38')]({'destaccountcode':this[_0x21b4('0x19')][_0x4cb066[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]][_0x21b4('0x43')],'destconnectedlinenum':_0x4cb066[_0x21b4('0x40')],'routealias':_0xf179},{'showHidden':![],'depth':null}));this[_0x21b4('0x31')](util['format']('user:%s',this[_0x21b4('0x19')][_0x4cb066[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]][_0x21b4('0x70')]),'user:agentconnect',{'destaccountcode':this[_0x21b4('0x19')][_0x4cb066['channel'][_0x21b4('0x3f')]('-')[0x0]][_0x21b4('0x43')],'destconnectedlinenum':_0x4cb066[_0x21b4('0x40')],'routealias':_0xf179});}}}}catch(_0x478988){logger[_0x21b4('0x4e')](_0x21b4('0x71'),_0x4cb066['uniqueid'],util[_0x21b4('0x38')](_0x478988,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21b4('0x30')][_0x21b4('0x72')]=function(_0x59d83e,_0x1ae943){try{if(this[_0x21b4('0x18')][_0x59d83e]){logger[_0x21b4('0x32')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x59d83e,_0x1ae943);this[_0x21b4('0x18')][_0x59d83e][_0x21b4('0x73')]=!![];if(_[_0x21b4('0x74')](_0x1ae943,_0x21b4('0x75'))){_0x1ae943=_0x1ae943['replace'](_0x21b4('0x75'),'.WAV');}this[_0x21b4('0x18')][_0x59d83e][_0x21b4('0x76')]=_0x1ae943;var _0x605ed5=_[_0x21b4('0x77')](this['channels'][_0x59d83e][_0x21b4('0x78')],{'filename':_0x1ae943});if(_[_0x21b4('0x79')](_0x605ed5)){this['channels'][_0x59d83e][_0x21b4('0x78')][_0x21b4('0x7a')]({'filename':_0x1ae943,'createdAt':moment()[_0x21b4('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x21b4('0x7b')});}}}catch(_0x3a64df){logger[_0x21b4('0x4e')]('[%s][voiceCallReport][mixMonitorFilename]',_0x59d83e,util[_0x21b4('0x38')](_0x3a64df,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21b4('0x30')][_0x21b4('0x22')]=function(_0x44a9f0){try{if(this['isNotNull'](_0x44a9f0)){logger[_0x21b4('0x36')](_0x21b4('0x7c'),_0x44a9f0[_0x21b4('0x3a')],util['inspect'](_0x44a9f0,{'showHidden':![],'depth':null}));if(this[_0x21b4('0x18')][_0x44a9f0[_0x21b4('0x3a')]]&&_0x44a9f0[_0x21b4('0x3e')]!='OutgoingSpoolFailed'){if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')])){if(this['isNotNull'](_0x44a9f0[_0x21b4('0x7d')][_0x21b4('0x7e')])){logger[_0x21b4('0x32')](_0x21b4('0x7f'),_0x44a9f0[_0x21b4('0x3a')],_0x44a9f0['value']);this[_0x21b4('0x72')](_0x44a9f0[_0x21b4('0x3a')],_0x44a9f0[_0x21b4('0x80')]);}else if(this[_0x21b4('0x2f')](_0x44a9f0['variable'][_0x21b4('0x81')])){logger[_0x21b4('0x32')](_0x21b4('0x82'),_0x44a9f0['uniqueid'],_0x44a9f0[_0x21b4('0x80')]);this['channels'][_0x44a9f0['uniqueid']][_0x21b4('0x35')]=_0x44a9f0[_0x21b4('0x80')];}else if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')]['xmd-callerid'])){logger[_0x21b4('0x32')](_0x21b4('0x83'),_0x44a9f0[_0x21b4('0x3a')],_0x44a9f0['value']);this[_0x21b4('0x18')][_0x44a9f0[_0x21b4('0x3a')]][_0x21b4('0x84')]=_0x44a9f0[_0x21b4('0x80')];}else if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')][_0x21b4('0x85')])){logger[_0x21b4('0x32')](_0x21b4('0x86'),_0x44a9f0[_0x21b4('0x3a')],_0x44a9f0['value']);this[_0x21b4('0x18')][_0x44a9f0[_0x21b4('0x3a')]][_0x21b4('0x87')]=_0x44a9f0[_0x21b4('0x80')];}else if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')][_0x21b4('0x88')])){logger[_0x21b4('0x32')](_0x21b4('0x89'),_0x44a9f0[_0x21b4('0x3a')],_0x44a9f0[_0x21b4('0x80')]['split'](',')[0x0]);this['channels'][_0x44a9f0['uniqueid']][_0x21b4('0x62')]=_0x44a9f0[_0x21b4('0x80')][_0x21b4('0x3f')](',')[0x0];}else if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')]['xmd-originatecalleridnum'])){logger[_0x21b4('0x32')](_0x21b4('0x8a'),_0x44a9f0[_0x21b4('0x3a')],_0x44a9f0[_0x21b4('0x80')]);this[_0x21b4('0x18')][_0x44a9f0[_0x21b4('0x3a')]][_0x21b4('0x8b')]=_0x44a9f0['value'];}else if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')][_0x21b4('0x8c')])){logger['info'](_0x21b4('0x8d'),_0x44a9f0[_0x21b4('0x3a')],_0x44a9f0[_0x21b4('0x80')]);this[_0x21b4('0x18')][_0x44a9f0[_0x21b4('0x3a')]][_0x21b4('0x8e')]=_0x44a9f0[_0x21b4('0x80')];}else if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')][_0x21b4('0x8f')])){logger[_0x21b4('0x32')](_0x21b4('0x90'),_0x44a9f0[_0x21b4('0x3a')],_0x44a9f0[_0x21b4('0x80')]);this['channels'][_0x44a9f0[_0x21b4('0x3a')]]['calleridpreview']=_0x44a9f0[_0x21b4('0x80')];}else if(this['isNotNull'](_0x44a9f0[_0x21b4('0x7d')][_0x21b4('0x91')])){logger[_0x21b4('0x32')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x44a9f0[_0x21b4('0x3a')],_0x44a9f0[_0x21b4('0x80')]);this[_0x21b4('0x18')][_0x44a9f0[_0x21b4('0x3a')]][_0x21b4('0x62')]=_0x44a9f0['value'];}else if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')]['sipcallid'])){logger[_0x21b4('0x32')](_0x21b4('0x92'),_0x44a9f0['uniqueid'],_0x44a9f0[_0x21b4('0x80')]);this[_0x21b4('0x18')][_0x44a9f0['uniqueid']][_0x21b4('0x93')]=_0x44a9f0[_0x21b4('0x80')];}}}else if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')][_0x21b4('0x7e')])){if(_0x44a9f0[_0x21b4('0x80')]){var _0x4a75a6=path[_0x21b4('0x94')](_0x44a9f0[_0x21b4('0x80')])[_0x21b4('0x70')];logger[_0x21b4('0x32')](_0x21b4('0x7f'),_0x4a75a6,_0x44a9f0['value']);this[_0x21b4('0x72')](_0x4a75a6,_0x44a9f0[_0x21b4('0x80')]);}}else if(this[_0x21b4('0x18')][_0x44a9f0['linkedid']]){if(this[_0x21b4('0x2f')](_0x44a9f0[_0x21b4('0x7d')])){if(this[_0x21b4('0x2f')](_0x44a9f0['variable'][_0x21b4('0x95')])){logger[_0x21b4('0x32')](_0x21b4('0x92'),_0x44a9f0[_0x21b4('0x51')],_0x44a9f0['value']);this[_0x21b4('0x18')][_0x44a9f0[_0x21b4('0x51')]][_0x21b4('0x96')]=_0x44a9f0[_0x21b4('0x80')];}}}}}catch(_0x1e18ba){logger[_0x21b4('0x4e')](_0x21b4('0x97'),_0x44a9f0[_0x21b4('0x3a')],util[_0x21b4('0x38')](_0x1e18ba,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21b4('0x30')]['syncHangup']=function(_0x185155){try{if(this[_0x21b4('0x2f')](_0x185155)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x185155[_0x21b4('0x3a')],util[_0x21b4('0x38')](_0x185155,{'showHidden':![],'depth':null}));if(this[_0x21b4('0x18')][_0x185155[_0x21b4('0x3a')]]){logger[_0x21b4('0x32')](_0x21b4('0x98'),_0x185155['uniqueid'],_0x185155['cause-txt']);var _0x54838c=moment();this[_0x21b4('0x18')][_0x185155[_0x21b4('0x3a')]]['endtime']=_0x54838c['format'](_0x21b4('0x46'));this['channels'][_0x185155[_0x21b4('0x3a')]][_0x21b4('0x5b')]=_0x54838c[_0x21b4('0x69')](this[_0x21b4('0x18')][_0x185155['uniqueid']][_0x21b4('0x5a')],'seconds');if(this['channels'][_0x185155['uniqueid']]['answered']){this[_0x21b4('0x18')][_0x185155[_0x21b4('0x3a')]][_0x21b4('0x99')]=_0x54838c[_0x21b4('0x69')](this['channels'][_0x185155[_0x21b4('0x3a')]][_0x21b4('0x9a')],_0x21b4('0x5d'));this['channels'][_0x185155[_0x21b4('0x3a')]][_0x21b4('0x68')]=this[_0x21b4('0x18')][_0x185155[_0x21b4('0x3a')]][_0x21b4('0x5b')]-this[_0x21b4('0x18')][_0x185155[_0x21b4('0x3a')]][_0x21b4('0x99')];}if(_0x185155[_0x21b4('0x49')]===_0x21b4('0x3d')){if(this[_0x21b4('0x19')][_0x185155[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]){this['agents'][_0x185155[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]=_['omit'](this[_0x21b4('0x19')][_0x185155[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]],[_0x21b4('0x4a')]);logger[_0x21b4('0x36')](_0x21b4('0x9b'),_0x185155[_0x21b4('0x3a')],util[_0x21b4('0x38')]({'id':this['agents'][_0x185155[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x21b4('0x19')][_0x185155['channel'][_0x21b4('0x3f')]('-')[0x0]][_0x21b4('0x43')]},{'showHidden':![],'depth':null}));this[_0x21b4('0x31')](util[_0x21b4('0x42')]('user:%s',this['agents'][_0x185155[_0x21b4('0x3e')]['split']('-')[0x0]][_0x21b4('0x70')]),_0x21b4('0x9c'),{'id':this[_0x21b4('0x19')][_0x185155[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0x21b4('0x19')][_0x185155[_0x21b4('0x3e')][_0x21b4('0x3f')]('-')[0x0]][_0x21b4('0x43')]});}}var _0x39014c=this;Promise['resolve']()[_0x21b4('0x9d')](function(){var _0x175a08=_0x39014c['channels'][_0x185155[_0x21b4('0x3a')]];if(typeof _0x175a08[_0x21b4('0x9e')]===_0x21b4('0x9f'))return;if(_[_0x21b4('0xa0')](_0x175a08[_0x21b4('0x78')]))return;return RpcSetting['getSettings']()[_0x21b4('0x9d')](function(_0x50b45f){if(!_0x50b45f[_0x21b4('0xa1')])return;return Promise[_0x21b4('0xa2')]()[_0x21b4('0x9d')](function(){return ami[_0x21b4('0xa3')]({'action':'StopMixMonitor','channel':_0x175a08[_0x21b4('0x3e')]})['catch'](function(){});})[_0x21b4('0x9d')](function(){return ami[_0x21b4('0xa3')]({'action':_0x21b4('0xa4'),'channel':_0x175a08[_0x21b4('0x6c')]})['catch'](function(){})[_0x21b4('0xa5')](function(){var _0xb8eee8=_0x39014c[_0x21b4('0x19')][_0x175a08[_0x21b4('0x6c')][_0x21b4('0x3f')]('-')[0x0]];if(!_0xb8eee8)return;io[_0x21b4('0x31')](_0x21b4('0xa6'),{'agentId':_0xb8eee8['id'],'uniqueid':_0x175a08[_0x21b4('0x3a')]});});});});})[_0x21b4('0x9d')](function(){if(_0x185155[_0x21b4('0xa7')]==='BlindTransfer'){_0x39014c[_0x21b4('0xa8')][_0x185155[_0x21b4('0x3a')]]=_0x39014c[_0x21b4('0x18')][_0x185155[_0x21b4('0x3a')]];}else{if(_0x39014c[_0x21b4('0x18')][_0x185155['uniqueid']]['type']===_0x21b4('0xa9')&&_0x39014c[_0x21b4('0xa8')][_0x185155[_0x21b4('0x3a')]]){_0x39014c[_0x21b4('0x18')][_0x185155['uniqueid']][_0x21b4('0x3a')]=[_0x39014c['channels'][_0x185155[_0x21b4('0x3a')]][_0x21b4('0x51')],_0x39014c['channels'][_0x185155[_0x21b4('0x3a')]]['linkedid']=_0x39014c[_0x21b4('0x18')][_0x185155['uniqueid']][_0x21b4('0x3a')]][0x0];delete _0x39014c[_0x21b4('0xa8')][_0x185155[_0x21b4('0x3a')]];}}logger['debug'](_0x21b4('0xaa'),_0x185155['uniqueid'],util['inspect'](_0x39014c[_0x21b4('0x18')][_0x185155['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x21b4('0x31')](_0x21b4('0xab'),_0x39014c[_0x21b4('0x18')][_0x185155[_0x21b4('0x3a')]]);delete _0x39014c[_0x21b4('0x18')][_0x185155[_0x21b4('0x3a')]];});}}}catch(_0xf7ec1a){logger[_0x21b4('0x4e')](_0x21b4('0xac'),_0x185155[_0x21b4('0x3a')],util[_0x21b4('0x38')](_0xf7ec1a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21b4('0x30')][_0x21b4('0x26')]=function(_0x19180b){try{if(this[_0x21b4('0x2f')](_0x19180b)){logger[_0x21b4('0x32')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x19180b[_0x21b4('0x3a')],_0x19180b[_0x21b4('0xad')],_0x19180b[_0x21b4('0xae')]);logger[_0x21b4('0x36')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x19180b[_0x21b4('0x3a')],util[_0x21b4('0x38')](_0x19180b,{'showHidden':![],'depth':null}));if(this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xaf')]]){this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xaf')]][_0x21b4('0xb0')]=_0x19180b[_0x21b4('0xad')];this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xaf')]][_0x21b4('0xb1')]=_0x19180b['transfertargetcalleridnum'];if(this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb2')]]){var _0x5bdcb9=this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb2')]];this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb2')]]=this['channels'][_0x19180b[_0x21b4('0xaf')]];this[_0x21b4('0x18')][_0x19180b['transfereeuniqueid']]=_0x5bdcb9;}}else if(this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb3')]]){this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb3')]][_0x21b4('0xb0')]=_0x19180b['origtransferercalleridnum'];this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb3')]][_0x21b4('0xb1')]=_0x19180b[_0x21b4('0xae')];if(this['channels'][_0x19180b[_0x21b4('0xb4')]]){var _0x5bdcb9=this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb4')]];this[_0x21b4('0x18')][_0x19180b['origtransfereruniqueid']]=this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb3')]];this['channels'][_0x19180b['transfertargetuniqueid']]=_0x5bdcb9;}}if((this[_0x21b4('0x18')][_0x19180b['origtransfereruniqueid']]||this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb5')]])&&this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb2')]]){var _0x37b228=_[_0x21b4('0xb6')]([this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb4')]],this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb5')]],this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb2')]]],function(_0x362abb){return _0x362abb&&_0x362abb[_0x21b4('0x87')]==='outbound'&&_0x362abb[_0x21b4('0xb7')];});if(_0x37b228){if(this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb4')]])this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb4')]][_0x21b4('0x9e')]='ATTENDED';if(this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb5')]])this[_0x21b4('0x18')][_0x19180b['origtransfererlinkedid']][_0x21b4('0x9e')]='ATTENDED';this[_0x21b4('0x18')][_0x19180b[_0x21b4('0xb2')]]['transferType']=_0x21b4('0xb8');}}}}catch(_0x434aea){logger[_0x21b4('0x4e')](_0x21b4('0xb9'),_0x19180b[_0x21b4('0x3a')],util['inspect'](_0x434aea,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21b4('0x30')]['syncBlindTransfer']=function(_0x845e8d){try{if(this[_0x21b4('0x2f')](_0x845e8d)){logger[_0x21b4('0x32')](_0x21b4('0xba'),_0x845e8d[_0x21b4('0x3a')],_0x845e8d[_0x21b4('0xbb')],_0x845e8d[_0x21b4('0xbc')]);logger[_0x21b4('0x36')](_0x21b4('0xbd'),_0x845e8d[_0x21b4('0x3a')],util['inspect'](_0x845e8d,{'showHidden':![],'depth':null}));if(this[_0x21b4('0x18')][_0x845e8d[_0x21b4('0xaf')]]){this[_0x21b4('0x18')][_0x845e8d[_0x21b4('0xaf')]][_0x21b4('0xb0')]=_0x845e8d[_0x21b4('0xbb')];this[_0x21b4('0x18')][_0x845e8d[_0x21b4('0xaf')]][_0x21b4('0xb1')]=_0x845e8d[_0x21b4('0xbc')];this[_0x21b4('0x18')][_0x845e8d[_0x21b4('0xaf')]]['transferType']=_0x21b4('0xbe');this[_0x21b4('0x24')]({'event':_0x21b4('0xbf'),'uniqueid':_0x845e8d[_0x21b4('0xaf')],'context':_0x845e8d[_0x21b4('0x49')],'channel':_0x845e8d[_0x21b4('0xc0')]});}else{this['channels'][_0x845e8d[_0x21b4('0xc1')]]['transferType']=_0x21b4('0xbe');}}}catch(_0x4ec6d4){logger['error'](_0x21b4('0xc2'),_0x845e8d['uniqueid'],util[_0x21b4('0x38')](_0x4ec6d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21b4('0x30')]['syncMusicOnHoldStart']=function(_0x484685){try{if(this['isNotNull'](_0x484685)){logger[_0x21b4('0x36')](_0x21b4('0xc3'),_0x484685[_0x21b4('0x3a')],util[_0x21b4('0x38')](_0x484685,{'showHidden':![],'depth':null}));if(this[_0x21b4('0x18')][_0x484685['uniqueid']]){if(!_[_0x21b4('0x79')](this[_0x21b4('0x18')][_0x484685[_0x21b4('0x3a')]][_0x21b4('0x9a')])){this[_0x21b4('0x18')][_0x484685[_0x21b4('0x3a')]][_0x21b4('0xc4')]=moment()[_0x21b4('0x42')](_0x21b4('0x46'));logger[_0x21b4('0x32')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x484685[_0x21b4('0x3a')],this['channels'][_0x484685[_0x21b4('0x3a')]][_0x21b4('0xc4')]);}}}}catch(_0x5ec633){logger[_0x21b4('0x4e')](_0x21b4('0xc5'),_0x484685[_0x21b4('0x3a')],util['inspect'](_0x5ec633,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x21b4('0x30')][_0x21b4('0x2c')]=function(_0x26159a){try{if(this[_0x21b4('0x2f')](_0x26159a)){logger[_0x21b4('0x36')](_0x21b4('0xc6'),_0x26159a[_0x21b4('0x3a')],util[_0x21b4('0x38')](_0x26159a,{'showHidden':![],'depth':null}));if(this[_0x21b4('0x18')][_0x26159a[_0x21b4('0x3a')]]){if(!_[_0x21b4('0x79')](this[_0x21b4('0x18')][_0x26159a['uniqueid']][_0x21b4('0xc4')])){this[_0x21b4('0x18')][_0x26159a[_0x21b4('0x3a')]][_0x21b4('0xc7')]+=moment()[_0x21b4('0xc8')](0x0)[_0x21b4('0x69')](this[_0x21b4('0x18')][_0x26159a['uniqueid']][_0x21b4('0xc4')],_0x21b4('0x5d'));logger[_0x21b4('0x32')](_0x21b4('0xc9'),_0x26159a[_0x21b4('0x3a')],this[_0x21b4('0x18')][_0x26159a['uniqueid']]['mohtime']);delete this['channels'][_0x26159a[_0x21b4('0x3a')]][_0x21b4('0xc4')];}}}}catch(_0x3ccfb7){logger['error'](_0x21b4('0xca'),_0x26159a['uniqueid'],util[_0x21b4('0x38')](_0x3ccfb7,{'showHidden':![],'depth':null}));}};module[_0x21b4('0xcb')]=VoiceCallReport;
\ No newline at end of file
index 38ea100..a9c1c76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ff1=['[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','info','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','starttime','complete','outbound','answered','seconds','billableseconds','diff','sumHoldTime','holdtime','sumDuration','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','startsWith','cdr(','split','exports','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncNewExten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','substring','channel','lastIndexOf','omit','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','applications','merge','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','debug'];(function(_0x620daf,_0x5ade4e){var _0x572ec0=function(_0x350dca){while(--_0x350dca){_0x620daf['push'](_0x620daf['shift']());}};_0x572ec0(++_0x5ade4e);}(_0x7ff1,0x13e));var _0x17ff=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0x7ff1[_0x5ad0d7];return _0xd83bd;};'use strict';var _=require('lodash');var moment=require(_0x17ff('0x0'));var util=require('util');var Redis=require(_0x17ff('0x1'));var config=require(_0x17ff('0x2'));var logger=require(_0x17ff('0x3'))(_0x17ff('0x4'));var ami=require(_0x17ff('0x5'));config[_0x17ff('0x6')]=_[_0x17ff('0x7')](config[_0x17ff('0x6')],{'host':_0x17ff('0x8'),'port':0x18eb});var io=require(_0x17ff('0x9'))(new Redis(config[_0x17ff('0x6')]));function VoiceDialReport(_0x15e7e0){this[_0x17ff('0xa')]=_0x15e7e0[_0x17ff('0xb')];this['outbound']=_0x15e7e0['outbound'];this['applications']={};this[_0x17ff('0xc')]={};ami['on'](_0x17ff('0xd'),this[_0x17ff('0xe')][_0x17ff('0xf')](this));ami['on'](_0x17ff('0x10'),this[_0x17ff('0x11')]['bind'](this));ami['on'](_0x17ff('0x12'),this['syncVarSet']['bind'](this));ami['on']('newexten',this[_0x17ff('0x13')][_0x17ff('0xf')](this));ami['on'](_0x17ff('0x14'),this[_0x17ff('0x15')][_0x17ff('0xf')](this));}VoiceDialReport[_0x17ff('0x16')][_0x17ff('0x17')]=function(_0x2ab33b){return _0x2ab33b!==null&&!_[_0x17ff('0x18')](_0x2ab33b);};VoiceDialReport[_0x17ff('0x16')][_0x17ff('0x19')]=function(_0x41b8a2,_0x3b356c,_0x1390de){io['to'](_0x41b8a2)[_0x17ff('0x19')](_0x3b356c,_0x1390de);};VoiceDialReport['prototype'][_0x17ff('0xe')]=function(_0x4dc975){try{if(this[_0x17ff('0x17')](_0x4dc975)){logger['debug'](_0x17ff('0x1a'),_0x4dc975[_0x17ff('0x1b')],util[_0x17ff('0x1c')](_0x4dc975,{'showHidden':![],'depth':null}));if(this['channels'][_0x4dc975[_0x17ff('0x1b')]]){_['merge'](this['channels'][_0x4dc975[_0x17ff('0x1b')]],{'starttime':moment()[_0x17ff('0x1d')](_0x17ff('0x1e')),'lastevent':'called','interface':_0x4dc975['channel'][_0x17ff('0x1f')](0x0,_0x4dc975[_0x17ff('0x20')][_0x17ff('0x21')]('-')),'membername':_0x4dc975[_0x17ff('0x20')]['substring'](_0x4dc975['channel'][_0x17ff('0x21')]('/')+0x1,_0x4dc975['channel'][_0x17ff('0x21')]('-'))},_[_0x17ff('0x22')](_0x4dc975,[_0x17ff('0x23'),_0x17ff('0x24')]));logger['info'](_0x17ff('0x25'),_0x4dc975[_0x17ff('0x1b')],this[_0x17ff('0xa')][_0x4dc975[_0x17ff('0x1b')]][_0x17ff('0x26')],this['channels'][_0x4dc975[_0x17ff('0x1b')]][_0x17ff('0x27')]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4dc975[_0x17ff('0x1b')],util[_0x17ff('0x1c')](this['channels'][_0x4dc975[_0x17ff('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x17ff('0x28')][_0x4dc975[_0x17ff('0x1b')]])_[_0x17ff('0x29')](this[_0x17ff('0xa')][_0x4dc975[_0x17ff('0x1b')]],this[_0x17ff('0x28')][_0x4dc975['uniqueid']]);this['emit'](_0x17ff('0x2a'),'voice_outbound_channel:save',this[_0x17ff('0xa')][_0x4dc975[_0x17ff('0x1b')]]);logger['debug'](_0x17ff('0x2b'),_0x4dc975[_0x17ff('0x1b')],util[_0x17ff('0x1c')](this[_0x17ff('0xa')][_0x4dc975[_0x17ff('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x17ff('0x19')](_0x17ff('0x2c'),this['channels'][_0x4dc975[_0x17ff('0x1b')]]);}}}catch(_0xe62785){logger[_0x17ff('0x2d')](_0x17ff('0x2e'),_0x4dc975[_0x17ff('0x1b')],util[_0x17ff('0x1c')](_0xe62785,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x17ff('0x11')]=function(_0x518c53){try{if(this[_0x17ff('0x17')](_0x518c53)){logger[_0x17ff('0x2f')](_0x17ff('0x30'),_0x518c53[_0x17ff('0x1b')],util[_0x17ff('0x1c')](_0x518c53,{'showHidden':![],'depth':null}));if(this[_0x17ff('0xa')][_0x518c53['uniqueid']]){this[_0x17ff('0xa')][_0x518c53[_0x17ff('0x1b')]][_0x17ff('0x31')]=_0x518c53['dialstatus'];if(_0x518c53[_0x17ff('0x31')]===_0x17ff('0x32')){this[_0x17ff('0xa')][_0x518c53[_0x17ff('0x1b')]][_0x17ff('0x33')]=_0x518c53[_0x17ff('0x33')];this[_0x17ff('0xa')][_0x518c53[_0x17ff('0x1b')]]['connectedlinename']=_0x518c53[_0x17ff('0x34')];this[_0x17ff('0xa')][_0x518c53[_0x17ff('0x1b')]][_0x17ff('0x35')]=moment()[_0x17ff('0x1d')](_0x17ff('0x1e'));this[_0x17ff('0xa')][_0x518c53[_0x17ff('0x1b')]][_0x17ff('0x36')]=_0x17ff('0x37');logger[_0x17ff('0x38')](_0x17ff('0x39'),_0x518c53[_0x17ff('0x1b')],_0x518c53['channel'][_0x17ff('0x1f')](_0x518c53[_0x17ff('0x20')][_0x17ff('0x21')]('/')+0x1,_0x518c53['channel'][_0x17ff('0x21')]('-')));logger[_0x17ff('0x2f')](_0x17ff('0x3a'),_0x518c53[_0x17ff('0x1b')],util['inspect'](this[_0x17ff('0xa')][_0x518c53[_0x17ff('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x17ff('0x19')](_0x17ff('0x3b'),this[_0x17ff('0xa')][_0x518c53[_0x17ff('0x1b')]]);}logger[_0x17ff('0x2f')](_0x17ff('0x3c'),_0x518c53['uniqueid'],util[_0x17ff('0x1c')](this[_0x17ff('0xa')][_0x518c53[_0x17ff('0x1b')]],{'showHidden':![],'depth':null}));this[_0x17ff('0x19')]('voice:outbound','voice_outbound_channel:save',this[_0x17ff('0xa')][_0x518c53[_0x17ff('0x1b')]]);}}}catch(_0x1a61a7){logger['error'](_0x17ff('0x3d'),_0x518c53[_0x17ff('0x1b')],util['inspect'](_0x1a61a7,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x17ff('0x3e')]=function(_0x305fc8){try{if(this[_0x17ff('0x17')](_0x305fc8)){logger[_0x17ff('0x2f')](_0x17ff('0x3f'),_0x305fc8[_0x17ff('0x1b')],util[_0x17ff('0x1c')](_0x305fc8,{'showHidden':![],'depth':null}));this[_0x17ff('0x40')](_0x305fc8['uniqueid'],_[_0x17ff('0x41')](_0x305fc8[_0x17ff('0x42')])[0x0],_0x305fc8[_0x17ff('0x43')]);if(this[_0x17ff('0x17')](_0x305fc8[_0x17ff('0x42')])&&this[_0x17ff('0x17')](_0x305fc8[_0x17ff('0x42')][_0x17ff('0x44')])){if(_[_0x17ff('0x18')](this['channels'][_0x305fc8['uniqueid']])){this[_0x17ff('0xa')][_0x305fc8[_0x17ff('0x1b')]]={'routeId':_0x305fc8[_0x17ff('0x43')],'variables':this[_0x17ff('0xc')][_0x305fc8[_0x17ff('0x1b')]]};logger[_0x17ff('0x38')](_0x17ff('0x45'),_0x305fc8[_0x17ff('0x1b')],_0x305fc8[_0x17ff('0x42')][_0x17ff('0x44')],_[_0x17ff('0x41')](_0x305fc8[_0x17ff('0x42')])[0x0],_0x305fc8[_0x17ff('0x43')]);logger['debug'](_0x17ff('0x46'),_0x305fc8['uniqueid'],util['inspect'](this[_0x17ff('0xa')][_0x305fc8[_0x17ff('0x1b')]],{'showHidden':![],'depth':null}));this[_0x17ff('0x19')]('voice:outbound',_0x17ff('0x47'),this['channels'][_0x305fc8[_0x17ff('0x1b')]]);}}}}catch(_0x2bb35b){logger[_0x17ff('0x2d')]('[%s][voiceDialReport][varset]',_0x305fc8[_0x17ff('0x1b')],util[_0x17ff('0x1c')](_0x2bb35b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x17ff('0x16')][_0x17ff('0x40')]=function(_0x372151,_0x1b8ff3,_0x3d4152){var _0xdc2da5=[_0x17ff('0x48'),_0x17ff('0x49'),'rtpaudioqosjitter',_0x17ff('0x4a'),_0x17ff('0x4b'),_0x17ff('0x4c'),_0x17ff('0x4d'),_0x17ff('0x4e'),_0x17ff('0x4f'),_0x17ff('0x50'),_0x17ff('0x51'),_0x17ff('0x52'),_0x17ff('0x53'),_0x17ff('0x54'),_0x17ff('0x55'),_0x17ff('0x56'),'membername',_0x17ff('0x57'),_0x17ff('0x58')];if(!_[_0x17ff('0x59')](_0x1b8ff3)&&!_[_0x17ff('0x5a')](_0xdc2da5,_0x1b8ff3)){if(_[_0x17ff('0x18')](this[_0x17ff('0xc')][_0x372151])){this[_0x17ff('0xc')][_0x372151]={};}this[_0x17ff('0xc')][_0x372151][_0x1b8ff3]=_0x3d4152;}};VoiceDialReport[_0x17ff('0x16')]['syncHangup']=function(_0x1bff74){try{if(this[_0x17ff('0x17')](_0x1bff74)){logger['debug'](_0x17ff('0x5b'),_0x1bff74[_0x17ff('0x1b')],util['inspect'](_0x1bff74,{'showHidden':![],'depth':null}));if(this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]]){logger[_0x17ff('0x38')](_0x17ff('0x5c'),_0x1bff74[_0x17ff('0x1b')],_0x1bff74[_0x17ff('0x5d')]);this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]][_0x17ff('0x5e')]=moment()[_0x17ff('0x1d')](_0x17ff('0x1e'));this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]][_0x17ff('0x5f')]=moment(this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]][_0x17ff('0x5e')])['diff'](this['channels'][_0x1bff74['uniqueid']][_0x17ff('0x60')],'seconds');this['channels'][_0x1bff74[_0x17ff('0x1b')]][_0x17ff('0x36')]=_0x17ff('0x61');this['outbound']['total']+=0x1;if(this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]][_0x17ff('0x35')]){this[_0x17ff('0x62')][_0x17ff('0x63')]+=0x1;this['channels'][_0x1bff74[_0x17ff('0x1b')]]['holdtime']=moment(this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]][_0x17ff('0x35')])['diff'](this[_0x17ff('0xa')][_0x1bff74['uniqueid']][_0x17ff('0x60')],_0x17ff('0x64'));this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]][_0x17ff('0x65')]=moment(this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]][_0x17ff('0x5e')])[_0x17ff('0x66')](this[_0x17ff('0xa')][_0x1bff74['uniqueid']][_0x17ff('0x35')],'seconds');this['outbound'][_0x17ff('0x67')]+=this[_0x17ff('0xa')][_0x1bff74['uniqueid']][_0x17ff('0x68')]||0x0;this[_0x17ff('0x62')]['sumBillable']+=this['channels'][_0x1bff74[_0x17ff('0x1b')]]['billableseconds'];}this[_0x17ff('0x62')][_0x17ff('0x69')]+=this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]][_0x17ff('0x5f')];logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x1bff74[_0x17ff('0x1b')],util[_0x17ff('0x1c')](this['channels'][_0x1bff74['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x17ff('0x19')](_0x17ff('0x6a'),this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]]);logger[_0x17ff('0x2f')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x1bff74['uniqueid'],util[_0x17ff('0x1c')](this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x17ff('0x19')](_0x17ff('0x6b'),this['channels'][_0x1bff74[_0x17ff('0x1b')]]);logger[_0x17ff('0x2f')](_0x17ff('0x6c'),_0x1bff74[_0x17ff('0x1b')],util['inspect'](this['channels'][_0x1bff74[_0x17ff('0x1b')]],{'showHidden':![],'depth':null}));this[_0x17ff('0x19')](_0x17ff('0x2a'),'voice_outbound:save',this[_0x17ff('0x62')]);logger[_0x17ff('0x38')](_0x17ff('0x6d'),JSON[_0x17ff('0x6e')](this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]]));logger[_0x17ff('0x2f')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x1bff74[_0x17ff('0x1b')],util[_0x17ff('0x1c')](this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x1b')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x17ff('0x6f'),this[_0x17ff('0xa')][_0x1bff74['uniqueid']]);delete this['channels'][_0x1bff74[_0x17ff('0x1b')]];}else if(this['channels'][_0x1bff74[_0x17ff('0x70')]]){this[_0x17ff('0xa')][_0x1bff74[_0x17ff('0x70')]][_0x17ff('0x1b')]=this['channels'][_0x1bff74[_0x17ff('0x70')]]['destuniqueid'];}if(this[_0x17ff('0xc')][_0x1bff74[_0x17ff('0x1b')]]){delete this[_0x17ff('0xc')][_0x1bff74[_0x17ff('0x1b')]];}}}catch(_0xf9ac03){logger[_0x17ff('0x2d')]('[%s][voiceDialReport][hangup]',_0x1bff74['uniqueid'],util[_0x17ff('0x1c')](_0xf9ac03,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x17ff('0x13')]=function(_0x81375f){try{if(this[_0x17ff('0x17')](_0x81375f)){logger[_0x17ff('0x2f')](_0x17ff('0x71'),_0x81375f[_0x17ff('0x1b')],util[_0x17ff('0x1c')](_0x81375f,{'showHidden':![],'depth':null}));if(_0x81375f[_0x17ff('0x72')][_0x17ff('0x73')]()===_0x17ff('0x74')){_0x81375f['applicationdata']=(_0x81375f['appdata']||_0x81375f[_0x17ff('0x75')])[_0x17ff('0x73')]();if(_[_0x17ff('0x76')](_0x81375f['applicationdata'],_0x17ff('0x77'))){if(_[_0x17ff('0x18')](this['applications'][_0x81375f[_0x17ff('0x1b')]]))this[_0x17ff('0x28')][_0x81375f[_0x17ff('0x1b')]]={};logger['info']('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x81375f[_0x17ff('0x1b')],_0x81375f['application'],_0x81375f[_0x17ff('0x75')]);var _0x524214=_0x81375f[_0x17ff('0x75')][_0x17ff('0x78')]('=');var _0x488f7d=_0x524214[0x0]['match'](/cdr\((.*)\)/);if(_0x488f7d)this['applications'][_0x81375f[_0x17ff('0x1b')]][_0x488f7d[0x1]]=_0x524214[0x1];}}}}catch(_0x1226d0){logger[_0x17ff('0x2d')]('[%s][voiceDialReport][newexten]',_0x81375f[_0x17ff('0x1b')],util[_0x17ff('0x1c')](_0x1226d0,{'showHidden':![],'depth':null}));}};module[_0x17ff('0x79')]=VoiceDialReport;
\ No newline at end of file
+var _0x18d2=['voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','value','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','cause-txt','duration','endtime','diff','starttime','complete','total','answered','seconds','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','set','appdata','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','dialend','varset','syncVarSet','bind','newexten','hangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound'];(function(_0x144934,_0x31d36d){var _0x1b3fcf=function(_0x2a84ad){while(--_0x2a84ad){_0x144934['push'](_0x144934['shift']());}};_0x1b3fcf(++_0x31d36d);}(_0x18d2,0x1c4));var _0x218d=function(_0x5dac32,_0x59c8d4){_0x5dac32=_0x5dac32-0x0;var _0x104bbb=_0x18d2[_0x5dac32];return _0x104bbb;};'use strict';var _=require(_0x218d('0x0'));var moment=require(_0x218d('0x1'));var util=require(_0x218d('0x2'));var Redis=require(_0x218d('0x3'));var config=require(_0x218d('0x4'));var logger=require('../../../config/logger')(_0x218d('0x5'));var ami=require(_0x218d('0x6'));config[_0x218d('0x7')]=_[_0x218d('0x8')](config[_0x218d('0x7')],{'host':_0x218d('0x9'),'port':0x18eb});var io=require(_0x218d('0xa'))(new Redis(config[_0x218d('0x7')]));function VoiceDialReport(_0x1404b2){this[_0x218d('0xb')]=_0x1404b2[_0x218d('0xc')];this['outbound']=_0x1404b2[_0x218d('0xd')];this[_0x218d('0xe')]={};this[_0x218d('0xf')]={};ami['on'](_0x218d('0x10'),this[_0x218d('0x11')]['bind'](this));ami['on'](_0x218d('0x12'),this['syncDialEnd']['bind'](this));ami['on'](_0x218d('0x13'),this[_0x218d('0x14')][_0x218d('0x15')](this));ami['on'](_0x218d('0x16'),this['syncNewExten'][_0x218d('0x15')](this));ami['on'](_0x218d('0x17'),this['syncHangup'][_0x218d('0x15')](this));}VoiceDialReport[_0x218d('0x18')][_0x218d('0x19')]=function(_0x364d8e){return _0x364d8e!==null&&!_[_0x218d('0x1a')](_0x364d8e);};VoiceDialReport[_0x218d('0x18')]['emit']=function(_0x7000fa,_0x4ff297,_0x1f5853){io['to'](_0x7000fa)[_0x218d('0x1b')](_0x4ff297,_0x1f5853);};VoiceDialReport['prototype'][_0x218d('0x11')]=function(_0x519688){try{if(this[_0x218d('0x19')](_0x519688)){logger[_0x218d('0x1c')](_0x218d('0x1d'),_0x519688['uniqueid'],util[_0x218d('0x1e')](_0x519688,{'showHidden':![],'depth':null}));if(this['channels'][_0x519688['uniqueid']]){_[_0x218d('0x1f')](this['channels'][_0x519688[_0x218d('0x20')]],{'starttime':moment()[_0x218d('0x21')](_0x218d('0x22')),'lastevent':_0x218d('0x23'),'interface':_0x519688[_0x218d('0x24')][_0x218d('0x25')](0x0,_0x519688[_0x218d('0x24')][_0x218d('0x26')]('-')),'membername':_0x519688['channel']['substring'](_0x519688[_0x218d('0x24')][_0x218d('0x26')]('/')+0x1,_0x519688[_0x218d('0x24')][_0x218d('0x26')]('-'))},_[_0x218d('0x27')](_0x519688,[_0x218d('0x28'),_0x218d('0x29')]));logger[_0x218d('0x2a')](_0x218d('0x2b'),_0x519688['uniqueid'],this[_0x218d('0xb')][_0x519688[_0x218d('0x20')]][_0x218d('0x2c')],this[_0x218d('0xb')][_0x519688['uniqueid']][_0x218d('0x2d')]);logger['debug'](_0x218d('0x2e'),_0x519688[_0x218d('0x20')],util['inspect'](this[_0x218d('0xb')][_0x519688[_0x218d('0x20')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x519688[_0x218d('0x20')]])_['merge'](this[_0x218d('0xb')][_0x519688[_0x218d('0x20')]],this[_0x218d('0xe')][_0x519688[_0x218d('0x20')]]);this[_0x218d('0x1b')](_0x218d('0x2f'),_0x218d('0x30'),this[_0x218d('0xb')][_0x519688['uniqueid']]);logger[_0x218d('0x1c')](_0x218d('0x31'),_0x519688[_0x218d('0x20')],util['inspect'](this['channels'][_0x519688['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x218d('0x1b')](_0x218d('0x32'),this[_0x218d('0xb')][_0x519688[_0x218d('0x20')]]);}}}catch(_0x414536){logger[_0x218d('0x33')]('[%s][voiceDialReport][dialbegin]',_0x519688[_0x218d('0x20')],util[_0x218d('0x1e')](_0x414536,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x218d('0x18')][_0x218d('0x34')]=function(_0x508824){try{if(this['isNotNull'](_0x508824)){logger[_0x218d('0x1c')](_0x218d('0x35'),_0x508824[_0x218d('0x20')],util['inspect'](_0x508824,{'showHidden':![],'depth':null}));if(this[_0x218d('0xb')][_0x508824[_0x218d('0x20')]]){this[_0x218d('0xb')][_0x508824[_0x218d('0x20')]][_0x218d('0x36')]=_0x508824[_0x218d('0x36')];if(_0x508824[_0x218d('0x36')]===_0x218d('0x37')){this[_0x218d('0xb')][_0x508824[_0x218d('0x20')]][_0x218d('0x38')]=_0x508824[_0x218d('0x38')];this[_0x218d('0xb')][_0x508824[_0x218d('0x20')]][_0x218d('0x39')]=_0x508824[_0x218d('0x39')];this[_0x218d('0xb')][_0x508824[_0x218d('0x20')]][_0x218d('0x3a')]=moment()[_0x218d('0x21')](_0x218d('0x22'));this[_0x218d('0xb')][_0x508824[_0x218d('0x20')]][_0x218d('0x3b')]=_0x218d('0x3c');logger[_0x218d('0x2a')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x508824[_0x218d('0x20')],_0x508824[_0x218d('0x24')][_0x218d('0x25')](_0x508824['channel'][_0x218d('0x26')]('/')+0x1,_0x508824['channel'][_0x218d('0x26')]('-')));logger[_0x218d('0x1c')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x508824[_0x218d('0x20')],util[_0x218d('0x1e')](this[_0x218d('0xb')][_0x508824[_0x218d('0x20')]],{'showHidden':![],'depth':null}));ami[_0x218d('0x1b')](_0x218d('0x3d'),this[_0x218d('0xb')][_0x508824[_0x218d('0x20')]]);}logger[_0x218d('0x1c')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x508824[_0x218d('0x20')],util['inspect'](this[_0x218d('0xb')][_0x508824['uniqueid']],{'showHidden':![],'depth':null}));this[_0x218d('0x1b')](_0x218d('0x2f'),_0x218d('0x30'),this[_0x218d('0xb')][_0x508824[_0x218d('0x20')]]);}}}catch(_0x4d0685){logger[_0x218d('0x33')](_0x218d('0x3e'),_0x508824[_0x218d('0x20')],util[_0x218d('0x1e')](_0x4d0685,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x218d('0x14')]=function(_0x6b6bc2){try{if(this[_0x218d('0x19')](_0x6b6bc2)){logger[_0x218d('0x1c')](_0x218d('0x3f'),_0x6b6bc2[_0x218d('0x20')],util[_0x218d('0x1e')](_0x6b6bc2,{'showHidden':![],'depth':null}));this[_0x218d('0x40')](_0x6b6bc2['uniqueid'],_[_0x218d('0x41')](_0x6b6bc2[_0x218d('0x42')])[0x0],_0x6b6bc2['value']);if(this[_0x218d('0x19')](_0x6b6bc2[_0x218d('0x42')])&&this['isNotNull'](_0x6b6bc2[_0x218d('0x42')]['outboundrouteid'])){if(_[_0x218d('0x1a')](this[_0x218d('0xb')][_0x6b6bc2[_0x218d('0x20')]])){this['channels'][_0x6b6bc2[_0x218d('0x20')]]={'routeId':_0x6b6bc2['value'],'variables':this[_0x218d('0xf')][_0x6b6bc2[_0x218d('0x20')]]};logger[_0x218d('0x2a')](_0x218d('0x43'),_0x6b6bc2['uniqueid'],_0x6b6bc2['variable'][_0x218d('0x44')],_[_0x218d('0x41')](_0x6b6bc2[_0x218d('0x42')])[0x0],_0x6b6bc2[_0x218d('0x45')]);logger['debug']('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x6b6bc2[_0x218d('0x20')],util[_0x218d('0x1e')](this[_0x218d('0xb')][_0x6b6bc2[_0x218d('0x20')]],{'showHidden':![],'depth':null}));this[_0x218d('0x1b')](_0x218d('0x2f'),'voice_outbound_channel:save',this[_0x218d('0xb')][_0x6b6bc2[_0x218d('0x20')]]);}}}}catch(_0x5c23c0){logger['error'](_0x218d('0x46'),_0x6b6bc2[_0x218d('0x20')],util[_0x218d('0x1e')](_0x5c23c0,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x24c35d,_0x67813f,_0xd1877f){var _0x5c69ae=['rtpaudioqos',_0x218d('0x47'),_0x218d('0x48'),_0x218d('0x49'),_0x218d('0x4a'),_0x218d('0x4b'),_0x218d('0x4c'),_0x218d('0x4d'),_0x218d('0x4e'),_0x218d('0x4f'),_0x218d('0x50'),_0x218d('0x51'),'membercalls','memberdynamic',_0x218d('0x52'),_0x218d('0x53'),'membername',_0x218d('0x54'),_0x218d('0x55')];if(!_[_0x218d('0x56')](_0x67813f)&&!_[_0x218d('0x57')](_0x5c69ae,_0x67813f)){if(_[_0x218d('0x1a')](this[_0x218d('0xf')][_0x24c35d])){this[_0x218d('0xf')][_0x24c35d]={};}this[_0x218d('0xf')][_0x24c35d][_0x67813f]=_0xd1877f;}};VoiceDialReport['prototype'][_0x218d('0x58')]=function(_0x5a7a89){try{if(this[_0x218d('0x19')](_0x5a7a89)){logger['debug'](_0x218d('0x59'),_0x5a7a89[_0x218d('0x20')],util[_0x218d('0x1e')](_0x5a7a89,{'showHidden':![],'depth':null}));if(this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]]){logger['info']('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x5a7a89[_0x218d('0x20')],_0x5a7a89[_0x218d('0x5a')]);this['channels'][_0x5a7a89[_0x218d('0x20')]]['endtime']=moment()[_0x218d('0x21')](_0x218d('0x22'));this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]][_0x218d('0x5b')]=moment(this[_0x218d('0xb')][_0x5a7a89['uniqueid']][_0x218d('0x5c')])[_0x218d('0x5d')](this[_0x218d('0xb')][_0x5a7a89['uniqueid']][_0x218d('0x5e')],'seconds');this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]][_0x218d('0x3b')]=_0x218d('0x5f');this['outbound'][_0x218d('0x60')]+=0x1;if(this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]][_0x218d('0x3a')]){this[_0x218d('0xd')][_0x218d('0x61')]+=0x1;this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]]['holdtime']=moment(this['channels'][_0x5a7a89[_0x218d('0x20')]][_0x218d('0x3a')])[_0x218d('0x5d')](this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]]['starttime'],_0x218d('0x62'));this[_0x218d('0xb')][_0x5a7a89['uniqueid']][_0x218d('0x63')]=moment(this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]][_0x218d('0x5c')])[_0x218d('0x5d')](this[_0x218d('0xb')][_0x5a7a89['uniqueid']]['answertime'],_0x218d('0x62'));this[_0x218d('0xd')][_0x218d('0x64')]+=this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]][_0x218d('0x65')]||0x0;this[_0x218d('0xd')][_0x218d('0x66')]+=this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]]['billableseconds'];}this[_0x218d('0xd')][_0x218d('0x67')]+=this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]][_0x218d('0x5b')];logger[_0x218d('0x1c')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x5a7a89[_0x218d('0x20')],util[_0x218d('0x1e')](this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]],{'showHidden':![],'depth':null}));ami[_0x218d('0x1b')]('custom:voiceDialReport',this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]]);logger[_0x218d('0x1c')](_0x218d('0x68'),_0x5a7a89[_0x218d('0x20')],util[_0x218d('0x1e')](this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]],{'showHidden':![],'depth':null}));ami[_0x218d('0x1b')](_0x218d('0x69'),this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]]);logger[_0x218d('0x1c')](_0x218d('0x6a'),_0x5a7a89[_0x218d('0x20')],util[_0x218d('0x1e')](this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]],{'showHidden':![],'depth':null}));this[_0x218d('0x1b')](_0x218d('0x2f'),_0x218d('0x6b'),this[_0x218d('0xd')]);logger[_0x218d('0x2a')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x218d('0x6c')](this[_0x218d('0xb')][_0x5a7a89[_0x218d('0x20')]]));logger[_0x218d('0x1c')](_0x218d('0x6d'),_0x5a7a89[_0x218d('0x20')],util['inspect'](this[_0x218d('0xb')][_0x5a7a89['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x218d('0x6e'),this['channels'][_0x5a7a89[_0x218d('0x20')]]);delete this['channels'][_0x5a7a89[_0x218d('0x20')]];}else if(this['channels'][_0x5a7a89[_0x218d('0x6f')]]){this['channels'][_0x5a7a89[_0x218d('0x6f')]][_0x218d('0x20')]=this[_0x218d('0xb')][_0x5a7a89['linkedid']][_0x218d('0x70')];}if(this[_0x218d('0xf')][_0x5a7a89[_0x218d('0x20')]]){delete this[_0x218d('0xf')][_0x5a7a89[_0x218d('0x20')]];}}}catch(_0x517b9c){logger[_0x218d('0x33')](_0x218d('0x71'),_0x5a7a89[_0x218d('0x20')],util[_0x218d('0x1e')](_0x517b9c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x218d('0x18')][_0x218d('0x72')]=function(_0x18232b){try{if(this[_0x218d('0x19')](_0x18232b)){logger[_0x218d('0x1c')](_0x218d('0x73'),_0x18232b[_0x218d('0x20')],util[_0x218d('0x1e')](_0x18232b,{'showHidden':![],'depth':null}));if(_0x18232b[_0x218d('0x74')]['toLowerCase']()===_0x218d('0x75')){_0x18232b['applicationdata']=(_0x18232b[_0x218d('0x76')]||_0x18232b[_0x218d('0x77')])['toLowerCase']();if(_[_0x218d('0x78')](_0x18232b[_0x218d('0x77')],_0x218d('0x79'))){if(_[_0x218d('0x1a')](this['applications'][_0x18232b[_0x218d('0x20')]]))this[_0x218d('0xe')][_0x18232b['uniqueid']]={};logger[_0x218d('0x2a')](_0x218d('0x7a'),_0x18232b[_0x218d('0x20')],_0x18232b[_0x218d('0x74')],_0x18232b['applicationdata']);var _0xee6c58=_0x18232b[_0x218d('0x77')]['split']('=');var _0x161640=_0xee6c58[0x0][_0x218d('0x7b')](/cdr\((.*)\)/);if(_0x161640)this[_0x218d('0xe')][_0x18232b[_0x218d('0x20')]][_0x161640[0x1]]=_0xee6c58[0x1];}}}}catch(_0x5c70b0){logger[_0x218d('0x33')]('[%s][voiceDialReport][newexten]',_0x18232b['uniqueid'],util[_0x218d('0x1e')](_0x5c70b0,{'showHidden':![],'depth':null}));}};module[_0x218d('0x7c')]=VoiceDialReport;
\ No newline at end of file
index 9c24d76..e361bc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa902=['total','unmanaged','abandoned','Trunk','active','Interval','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','[voiceQueueReport][queuesummary]','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','talking','waiting','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','reason','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','queuecallerexitAt','queuecallerjoinAt','add','transfertype','FORWARD','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','queuestatus','value','CONTINUE','TIMEOUT','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','includes','[%s][voiceQueueReport][hangup]','length','diff','seconds','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transferuniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','mohstarttime','mohtime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','lodash','moment','util','md5','ioredis','../../../config/logger','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','queueReports','agents','channels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','queueStatusComplete','clearZombieChannels','switch','sequence','enqueue','Action','status','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','error','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','emit','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime'];(function(_0x2f1f9c,_0x15c2a1){var _0xe6b1ef=function(_0xa50ad7){while(--_0xa50ad7){_0x2f1f9c['push'](_0x2f1f9c['shift']());}};_0xe6b1ef(++_0x15c2a1);}(_0xa902,0x8d));var _0x2a90=function(_0x34a917,_0x2380b2){_0x34a917=_0x34a917-0x0;var _0x10a389=_0xa902[_0x34a917];return _0x10a389;};'use strict';var _=require(_0x2a90('0x0'));var moment=require(_0x2a90('0x1'));var util=require(_0x2a90('0x2'));var md5=require(_0x2a90('0x3'));var Redis=require(_0x2a90('0x4'));var config=require('../../../config/environment');var logger=require(_0x2a90('0x5'))('ami');var ami=require('../ami');var QueueReport=require(_0x2a90('0x6'));config[_0x2a90('0x7')]=_[_0x2a90('0x8')](config[_0x2a90('0x7')],{'host':_0x2a90('0x9'),'port':0x18eb});var io=require(_0x2a90('0xa'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x2a90('0xb')]['enqueue']=function(_0x5ec2b9){this[_0x2a90('0xc')]=this[_0x2a90('0xc')]?this[_0x2a90('0xc')][_0x2a90('0xd')](_0x5ec2b9):_0x5ec2b9();};function VoiceQueueReport(_0x18a60e){this['sequence']=new Sequence();this[_0x2a90('0xe')]={};this[_0x2a90('0xf')]=_0x18a60e[_0x2a90('0xf')];this[_0x2a90('0x10')]=_0x18a60e['queueChannels'];this[_0x2a90('0x11')]=_0x18a60e['voiceQueues'];this[_0x2a90('0x12')]=!![];this['campaigns']=_0x18a60e[_0x2a90('0x13')];this['variables']={};ami['on'](_0x2a90('0x14'),this[_0x2a90('0x15')][_0x2a90('0x16')](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0x2a90('0x17'),this[_0x2a90('0x18')]['bind'](this));ami['on'](_0x2a90('0x19'),this[_0x2a90('0x1a')][_0x2a90('0x16')](this));ami['on'](_0x2a90('0x1b'),this[_0x2a90('0x1c')][_0x2a90('0x16')](this));ami['on'](_0x2a90('0x1d'),this[_0x2a90('0x1e')][_0x2a90('0x16')](this));ami['on']('agentconnect',this[_0x2a90('0x1f')][_0x2a90('0x16')](this));ami['on'](_0x2a90('0x20'),this['syncVarSet'][_0x2a90('0x16')](this));ami['on'](_0x2a90('0x21'),this[_0x2a90('0x22')][_0x2a90('0x16')](this));ami['on'](_0x2a90('0x23'),this[_0x2a90('0x24')][_0x2a90('0x16')](this));ami['on'](_0x2a90('0x25'),this[_0x2a90('0x26')][_0x2a90('0x16')](this));ami['on'](_0x2a90('0x27'),this[_0x2a90('0x28')]['bind'](this));ami['on'](_0x2a90('0x29'),this[_0x2a90('0x2a')][_0x2a90('0x16')](this));ami['on'](_0x2a90('0x2b'),this['syncAttendedTransfer'][_0x2a90('0x16')](this));ami['on'](_0x2a90('0x2c'),this['syncBlindTransfer'][_0x2a90('0x16')](this));this[_0x2a90('0x2d')]();this[_0x2a90('0x2e')]();}function clearChannels(_0x2a4e28){if(!_[_0x2a90('0x2f')](_0x2a4e28)){for(var _0x1303d9 in _0x2a4e28){if(_0x2a4e28[_0x2a90('0x30')](_0x1303d9)){delete _0x2a4e28[_0x1303d9];}}}}function clearCampaigns(_0x24a6d3){if(!_['isEmpty'](_0x24a6d3)){for(var _0x27f883 in _0x24a6d3){if(_0x24a6d3[_0x2a90('0x30')](_0x27f883)){_0x24a6d3[_0x27f883][_0x2a90('0x31')]=0x0;}}}}function clearVoiceQueues(_0x40c61a){if(!_[_0x2a90('0x2f')](_0x40c61a)){for(var _0x5208d8 in _0x40c61a){if(_0x40c61a['hasOwnProperty'](_0x5208d8)){_0x40c61a[_0x5208d8][_0x2a90('0x31')]=0x0;_0x40c61a[_0x5208d8]['talking']=0x0;_0x40c61a[_0x5208d8]['pTalking']=0x0;_0x40c61a[_0x5208d8]['waiting']=0x0;_0x40c61a[_0x5208d8][_0x2a90('0x32')]=!![];}}}}function clearAgentBooked(_0x3c78f5){if(!_['isEmpty'](_0x3c78f5)){for(var _0x5bd700 in _0x3c78f5){if(_0x3c78f5[_0x2a90('0x30')](_0x5bd700)){_0x3c78f5[_0x5bd700]['unlockRR']=!![];}}}}VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x33')]=function(){var _0x3b580f=this;for(var _0x27b6b6 in this[_0x2a90('0x10')]){if(this[_0x2a90('0x10')][_0x2a90('0x30')](_0x27b6b6)&&!this['channels'][_0x27b6b6][_0x2a90('0x34')]){this[_0x2a90('0x35')][_0x2a90('0x36')](function(){if(!_['isNil'](_0x3b580f[_0x2a90('0x10')][_0x27b6b6])){return ami[_0x2a90('0x37')]({'action':_0x2a90('0x38'),'channel':_0x3b580f[_0x2a90('0x10')][_0x27b6b6]['channel']})[_0x2a90('0x39')](function(_0x1b5f73){if(_0x1b5f73[_0x2a90('0x3a')]===_0x2a90('0x3b')){setTimeout(function(){if(_0x3b580f[_0x2a90('0x10')][_0x27b6b6]){delete _0x3b580f[_0x2a90('0x10')][_0x27b6b6];logger['error'](_0x2a90('0x3c'),_0x27b6b6,util[_0x2a90('0x3d')](_0x1b5f73,{'showHidden':![],'depth':null}));}if(_0x3b580f[_0x2a90('0xe')][_0x27b6b6]){delete _0x3b580f[_0x2a90('0xe')][_0x27b6b6];logger['error'](_0x2a90('0x3e'),_0x27b6b6,util[_0x2a90('0x3d')](_0x1b5f73,{'showHidden':![],'depth':null}));}if(_0x3b580f['variables'][_0x27b6b6]){delete _0x3b580f[_0x2a90('0x3f')][_0x27b6b6];logger[_0x2a90('0x40')]('[%s][voiceQueueReport][checkVariables]',_0x27b6b6,util['inspect'](_0x1b5f73,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x24')]=function(){logger[_0x2a90('0x40')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x2a90('0x10')]);this['clearQueueReport'](this[_0x2a90('0xe')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x2a90('0x11')]);clearCampaigns(this['campaigns']);};VoiceQueueReport['prototype'][_0x2a90('0x41')]=function(_0x47d568){var _0x463721=this;if(!_[_0x2a90('0x2f')](_0x47d568)){for(var _0x218727 in _0x47d568){if(_0x47d568['hasOwnProperty'](_0x218727)){_0x463721[_0x2a90('0x42')](_0x47d568[_0x218727],_0x2a90('0x43'));delete _0x47d568[_0x218727];}}}};VoiceQueueReport[_0x2a90('0xb')]['emit']=function(_0x1cecc2,_0x2d6a44,_0x1a9c04){io['to'](_0x1cecc2)['emit'](_0x2d6a44,_0x1a9c04);};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x44')]=function(_0x504643,_0x2771e8){logger[_0x2a90('0x45')](_0x2a90('0x46')+_0x2771e8+_0x2a90('0x47'),_0x504643[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x504643,{'showHidden':![],'depth':null}));this[_0x2a90('0x49')](util[_0x2a90('0x4a')](_0x2a90('0x4b'),_0x504643[_0x2a90('0x4c')]),_0x2a90('0x4d'),_0x504643);io[_0x2a90('0x49')](_0x2a90('0x4e'),_0x504643);};VoiceQueueReport[_0x2a90('0xb')]['emitVoiceQueueChannelRemove']=function(_0x45cbc2,_0x3a70fe){logger['debug'](_0x2a90('0x46')+_0x3a70fe+_0x2a90('0x4f'),_0x45cbc2[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x45cbc2,{'showHidden':![],'depth':null}));this[_0x2a90('0x49')](util['format'](_0x2a90('0x4b'),_0x45cbc2['name']),_0x2a90('0x50'),_0x45cbc2);io['emit'](_0x2a90('0x51'),_0x45cbc2);};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x52')]=function(_0x31c69f,_0x315c78){if(_0x31c69f[_0x2a90('0x53')]===_0x2a90('0x54')){var _0x48d464={'id':_0x31c69f['id'],'name':_0x31c69f['name'],'strategy':_0x31c69f[_0x2a90('0x55')],'answered':_0x31c69f[_0x2a90('0x56')],'available':_0x31c69f[_0x2a90('0x57')],'loggedIn':_0x31c69f[_0x2a90('0x58')],'pTalking':_0x31c69f[_0x2a90('0x59')],'sumBillable':_0x31c69f[_0x2a90('0x5a')],'sumDuration':_0x31c69f[_0x2a90('0x5b')],'sumHoldTime':_0x31c69f[_0x2a90('0x5c')]||0x0,'talking':_0x31c69f['talking'],'total':_0x31c69f[_0x2a90('0x5d')],'type':_0x31c69f['type'],'unmanaged':_0x31c69f[_0x2a90('0x5e')],'abandoned':_0x31c69f[_0x2a90('0x5f')],'waiting':_0x31c69f['waiting']};if(_0x31c69f[_0x2a90('0x60')]){_0x48d464[_0x2a90('0x60')]={'id':_0x31c69f[_0x2a90('0x60')]['id'],'name':_0x31c69f[_0x2a90('0x60')][_0x2a90('0x4c')],'active':_0x31c69f[_0x2a90('0x60')][_0x2a90('0x61')],'callerid':_0x31c69f['Trunk']['callerid']};}if(_0x31c69f[_0x2a90('0x62')]){_0x48d464[_0x2a90('0x62')]={'id':_0x31c69f[_0x2a90('0x62')]['id'],'name':_0x31c69f[_0x2a90('0x62')][_0x2a90('0x4c')]};}var _0x5e203f=md5(JSON['stringify'](_0x48d464));if(_0x31c69f[_0x2a90('0x3')]!==_0x5e203f){_0x31c69f[_0x2a90('0x3')]=_0x5e203f;logger['debug']('[voiceQueueReport]['+_0x315c78+']\x20sending\x20voice_queue:save\x20event:',util[_0x2a90('0x3d')](_0x48d464,{'showHidden':![],'depth':null}));this['emit'](util[_0x2a90('0x4a')](_0x2a90('0x4b'),_0x48d464[_0x2a90('0x4c')]),_0x2a90('0x63'),_0x48d464);}}};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x64')]=function(_0x4f507a){return _0x4f507a!==null&&!_[_0x2a90('0x65')](_0x4f507a);};VoiceQueueReport[_0x2a90('0xb')]['loopQueueShow']=function(){var _0x265769=this;setInterval(function(){_0x265769['clearZombieChannels']();ami['Action']({'action':_0x2a90('0x66')})[_0x2a90('0x39')](function(_0x5819ab){logger['error'](_0x2a90('0x67'),util['inspect'](_0x5819ab,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x2d')]=function(){var _0x561bae=this;setInterval(function(){if(_0x561bae[_0x2a90('0x12')]){return ami[_0x2a90('0x37')]({'action':_0x2a90('0x14')})['then'](function(_0x44b3eb){_0x561bae[_0x2a90('0x12')]=![];})['catch'](function(_0x548426){logger[_0x2a90('0x40')](_0x2a90('0x68'),util['inspect'](_0x548426,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x2a90('0xb')]['syncQueueSummary']=function(_0x1302b9){try{if(this['isNotNull'](_0x1302b9)&&this[_0x2a90('0x64')](_0x1302b9[_0x2a90('0x69')])){logger[_0x2a90('0x45')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x1302b9,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x1302b9[_0x2a90('0x69')]]){logger[_0x2a90('0x6a')](_0x2a90('0x6b'),_0x1302b9[_0x2a90('0x69')]);var _0x2e5762=_[_0x2a90('0x6c')](this[_0x2a90('0x10')],_0x2a90('0x69'))[_0x1302b9[_0x2a90('0x69')]]||0x0;var _0x4f4dc6=_0x2e5762-_0x1302b9[_0x2a90('0x6d')];if(this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]]['waiting']!==_['toNumber'](_0x1302b9['callers'])||this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]][_0x2a90('0x58')]!==_[_0x2a90('0x6e')](_0x1302b9[_0x2a90('0x6f')])||this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]][_0x2a90('0x57')]!==_[_0x2a90('0x6e')](_0x1302b9[_0x2a90('0x57')])||this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]][_0x2a90('0x70')]!==_0x4f4dc6){this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]][_0x2a90('0x71')]=_['toNumber'](_0x1302b9[_0x2a90('0x6d')]);this['voiceQueues'][_0x1302b9[_0x2a90('0x69')]][_0x2a90('0x58')]=_[_0x2a90('0x6e')](_0x1302b9[_0x2a90('0x6f')]);this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]][_0x2a90('0x57')]=_['toNumber'](_0x1302b9[_0x2a90('0x57')]);this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]]['talking']=_0x4f4dc6>0x0?_0x4f4dc6:0x0;this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]][_0x2a90('0x70')]=this[_0x2a90('0x11')][_0x1302b9['queue']][_0x2a90('0x70')]>_['toNumber'](_0x1302b9[_0x2a90('0x6f')])?_[_0x2a90('0x6e')](_0x1302b9[_0x2a90('0x6f')]):this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]][_0x2a90('0x70')];this['emitVoiceQueueSummary'](this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]],_0x2a90('0x14'));}logger[_0x2a90('0x45')](_0x2a90('0x72'),util[_0x2a90('0x3d')](this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]],{'showHidden':![],'depth':null}));ami[_0x2a90('0x49')]('custom:queuesummary',this[_0x2a90('0x11')][_0x1302b9[_0x2a90('0x69')]]);}}}catch(_0x3f6580){logger['error'](_0x2a90('0x68'),util[_0x2a90('0x3d')](_0x3f6580,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x73')]=function(_0x1fd54a){logger['debug'](_0x2a90('0x74'),util['inspect'](_0x1fd54a,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x2a90('0xb')]['syncQueueCallerJoin']=function(_0x49dcda){try{if(this[_0x2a90('0x64')](_0x49dcda)){logger['debug'](_0x2a90('0x75'),_0x49dcda[_0x2a90('0x48')],util['inspect'](_0x49dcda,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x2a90('0xe')][_0x49dcda['uniqueid']]))this['queueReports'][_0x49dcda[_0x2a90('0x48')]]=[];if(_[_0x2a90('0x65')](this[_0x2a90('0x10')][_0x49dcda[_0x2a90('0x48')]]))this['channels'][_0x49dcda['uniqueid']]={};var _0x370144=new QueueReport();_0x370144[_0x2a90('0x4c')]=_0x49dcda[_0x2a90('0x69')];_0x370144[_0x2a90('0x53')]=this[_0x2a90('0x11')][_0x370144[_0x2a90('0x4c')]]&&this[_0x2a90('0x11')][_0x370144[_0x2a90('0x4c')]][_0x2a90('0x53')]?this[_0x2a90('0x11')][_0x370144[_0x2a90('0x4c')]][_0x2a90('0x53')]||'inbound':_0x2a90('0x54');_0x370144['queue']=_0x49dcda[_0x2a90('0x69')];_0x370144['queuecallerjoinAt']=moment()[_0x2a90('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x370144['position']=_0x49dcda[_0x2a90('0x76')];_0x370144[_0x2a90('0x77')]=_0x49dcda[_0x2a90('0x77')];_0x370144[_0x2a90('0x48')]=_0x49dcda['uniqueid'];_0x370144['routealias']=this[_0x2a90('0x10')][_0x49dcda[_0x2a90('0x48')]][_0x2a90('0x78')];logger[_0x2a90('0x6a')](_0x2a90('0x79'),_0x370144[_0x2a90('0x4c')],_0x370144[_0x2a90('0x53')]);_[_0x2a90('0x7a')](_0x370144,_[_0x2a90('0x7b')](_0x49dcda,_[_0x2a90('0x7c')](_0x370144)));this[_0x2a90('0xe')][_0x49dcda[_0x2a90('0x48')]]['push'](_0x370144);this[_0x2a90('0x10')][_0x49dcda[_0x2a90('0x48')]]=_0x370144;this[_0x2a90('0x44')](_0x370144,_0x2a90('0x17'));}}catch(_0x3729d2){logger[_0x2a90('0x40')](_0x2a90('0x75'),_0x49dcda[_0x2a90('0x48')],util['inspect'](_0x3729d2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x1a')]=function(_0x47abdd){try{if(this[_0x2a90('0x64')](_0x47abdd)){logger[_0x2a90('0x45')](_0x2a90('0x7d'),_0x47abdd[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x47abdd,{'showHidden':![],'depth':null}));if(this[_0x2a90('0xe')][_0x47abdd['uniqueid']]){var _0x45ea35=_[_0x2a90('0x7e')](this[_0x2a90('0xe')][_0x47abdd[_0x2a90('0x48')]]);_0x45ea35[_0x2a90('0x7f')]=![];_0x45ea35[_0x2a90('0x80')]=null;_0x45ea35[_0x2a90('0x81')]=_0x47abdd[_0x2a90('0x81')];_0x45ea35['originalposition']=_0x47abdd[_0x2a90('0x82')];_0x45ea35[_0x2a90('0x19')]=!![];_0x45ea35[_0x2a90('0x83')]=moment()[_0x2a90('0x4a')](_0x2a90('0x84'));_0x45ea35[_0x2a90('0x85')]='ABANDONED';_0x45ea35[_0x2a90('0x86')]=null;logger[_0x2a90('0x6a')](_0x2a90('0x87'),_0x45ea35['name'],_0x45ea35[_0x2a90('0x53')]);this[_0x2a90('0x10')][_0x47abdd[_0x2a90('0x48')]]=_0x45ea35;this['emitVoiceQueueChannelRemove'](_0x45ea35,'queuecallerabandon');}}}catch(_0x32f443){logger[_0x2a90('0x40')]('[%s][voiceQueueReport][queuecallerabandon]',_0x47abdd[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x32f443,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2a90('0x1c')]=function(_0x3bfeed){try{if(this['isNotNull'](_0x3bfeed)){logger[_0x2a90('0x45')](_0x2a90('0x88'),_0x3bfeed['uniqueid'],util['inspect'](_0x3bfeed,{'showHidden':![],'depth':null}));if(this[_0x2a90('0xe')][_0x3bfeed[_0x2a90('0x48')]]){var _0x184263=_[_0x2a90('0x7e')](this[_0x2a90('0xe')][_0x3bfeed[_0x2a90('0x48')]]);_0x184263[_0x2a90('0x89')]=moment()[_0x2a90('0x4a')](_0x2a90('0x84'));_0x184263[_0x2a90('0x8a')]=_0x3bfeed[_0x2a90('0x8a')];_0x184263['connectedlinename']=_0x3bfeed[_0x2a90('0x8b')];logger[_0x2a90('0x6a')](_0x2a90('0x8c'),_0x184263['name'],_0x184263[_0x2a90('0x53')],_0x3bfeed[_0x2a90('0x8a')],_0x3bfeed[_0x2a90('0x8b')]);this['channels'][_0x3bfeed[_0x2a90('0x48')]]=_0x184263;this[_0x2a90('0x44')](_0x184263,_0x2a90('0x1b'));}}}catch(_0x123c72){logger[_0x2a90('0x40')](_0x2a90('0x88'),_0x3bfeed[_0x2a90('0x48')],util['inspect'](_0x123c72,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2a90('0x1f')]=function(_0x58d256){try{if(this[_0x2a90('0x64')](_0x58d256)){logger[_0x2a90('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x58d256[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x58d256,{'showHidden':![],'depth':null}));if(this[_0x2a90('0xe')][_0x58d256[_0x2a90('0x48')]]){var _0x90338c=_[_0x2a90('0x7e')](this[_0x2a90('0xe')][_0x58d256[_0x2a90('0x48')]]);_0x90338c[_0x2a90('0x7f')]=!![];_0x90338c['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x2a90('0x6a')](_0x2a90('0x8d'),_0x90338c[_0x2a90('0x4c')],_0x90338c[_0x2a90('0x53')]);}}}catch(_0x43bf9a){logger[_0x2a90('0x40')](_0x2a90('0x8e'),_0x58d256[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x43bf9a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x1e')]=function(_0xa8c5ef){try{if(this[_0x2a90('0x64')](_0xa8c5ef)){logger[_0x2a90('0x45')](_0x2a90('0x8f'),_0xa8c5ef[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0xa8c5ef,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xa8c5ef[_0x2a90('0x48')]]){var _0x41d882=_[_0x2a90('0x7e')](this[_0x2a90('0xe')][_0xa8c5ef['uniqueid']]);_0x41d882[_0x2a90('0x19')]=![];_0x41d882[_0x2a90('0x83')]=null;_0x41d882[_0x2a90('0x90')]=!![];_0x41d882['lastAssignedTo']=_0xa8c5ef[_0x2a90('0x91')];_0x41d882[_0x2a90('0x81')]=_0xa8c5ef[_0x2a90('0x81')];_0x41d882[_0x2a90('0x7f')]=!![];_0x41d882[_0x2a90('0x92')]=![];_0x41d882['queuecallerexitAt']=null;if(!_0x41d882['transfer']){if(_0xa8c5ef[_0x2a90('0x93')]==_0x2a90('0x94')){_0x41d882['queuecallerexitreason']=_0x2a90('0x95');logger[_0x2a90('0x6a')](_0x2a90('0x96'),_0x41d882[_0x2a90('0x4c')],_0x41d882[_0x2a90('0x53')]);}else{if(_[_0x2a90('0x97')](_0xa8c5ef[_0x2a90('0x98')][_0x2a90('0x99')](),_0x2a90('0x9a'))){if(this[_0x2a90('0xe')][_0xa8c5ef['linkedid']]){var _0x23f5f7=_[_0x2a90('0x7e')](this[_0x2a90('0xe')][_0xa8c5ef[_0x2a90('0x9b')]]);_0x23f5f7[_0x2a90('0x7f')]=![];_0x23f5f7[_0x2a90('0x92')]=!![];_0x23f5f7[_0x2a90('0x9c')]=moment(_0x41d882[_0x2a90('0x9d')])[_0x2a90('0x9e')](_0xa8c5ef[_0x2a90('0x81')],'seconds')[_0x2a90('0x4a')](_0x2a90('0x84'));_0x23f5f7[_0x2a90('0x85')]='FORWARDTRANSFER';_0x23f5f7[_0x2a90('0x94')]=!![];_0x23f5f7[_0x2a90('0x9f')]=_0x2a90('0xa0');_0x23f5f7[_0x2a90('0xa1')]=_0xa8c5ef[_0x2a90('0xa2')];_0x23f5f7['transferuniqueid']=_0xa8c5ef['uniqueid'];logger['info'](_0x2a90('0xa3'),_0x23f5f7[_0x2a90('0x4c')],_0x23f5f7[_0x2a90('0x53')]);var _0x1889ce=this[_0x2a90('0xe')][_0xa8c5ef[_0x2a90('0x9b')]];this[_0x2a90('0xe')][_0xa8c5ef[_0x2a90('0x9b')]]=this['queueReports'][_0xa8c5ef[_0x2a90('0x48')]];this[_0x2a90('0xe')][_0xa8c5ef[_0x2a90('0x48')]]=_0x1889ce;}}else{_0x41d882[_0x2a90('0x85')]=_0x2a90('0xa4')+_0xa8c5ef[_0x2a90('0x93')][_0x2a90('0xa5')]();logger[_0x2a90('0x6a')](_0x2a90('0xa6'),_0x41d882['name'],_0x41d882[_0x2a90('0x53')],_0x41d882[_0x2a90('0x85')]);}}}this[_0x2a90('0x10')][_0xa8c5ef[_0x2a90('0x48')]]=_0x41d882;this[_0x2a90('0x42')](_0x41d882,_0x2a90('0x1d'));}}}catch(_0x548643){logger[_0x2a90('0x40')](_0x2a90('0x8f'),_0xa8c5ef[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x548643,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2a90('0xb')]['syncVarSet']=function(_0x101477){try{if(this[_0x2a90('0x64')](_0x101477)){logger[_0x2a90('0x45')](_0x2a90('0xa7'),_0x101477['uniqueid'],util[_0x2a90('0x3d')](_0x101477,{'showHidden':![],'depth':null}));this[_0x2a90('0xa8')](_0x101477[_0x2a90('0x48')],_[_0x2a90('0x7c')](_0x101477['variable'])[0x0],_0x101477['value']);if(this[_0x2a90('0xe')][_0x101477['uniqueid']]){var _0x222d8d=_['last'](this['queueReports'][_0x101477[_0x2a90('0x48')]]);if(_0x222d8d){if(this['isNotNull'](_0x101477[_0x2a90('0xa9')])&&this[_0x2a90('0x64')](_0x101477[_0x2a90('0xa9')][_0x2a90('0xaa')])){switch(_0x101477[_0x2a90('0xab')]){case _0x2a90('0xac'):_0x222d8d[_0x2a90('0x92')]=![];_0x222d8d[_0x2a90('0x9c')]=null;break;case _0x2a90('0xad'):_0x222d8d[_0x2a90('0xae')]='timeout';_0x222d8d['queuecallerexit']=!![];_0x222d8d[_0x2a90('0x9c')]=moment()[_0x2a90('0x4a')](_0x2a90('0x84'));_0x222d8d[_0x2a90('0x89')]=moment()[_0x2a90('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x2a90('0xaf'),_0x101477[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x222d8d,{'showHidden':![],'depth':null}));ami[_0x2a90('0x49')](_0x2a90('0xb0'),_0x222d8d);break;default:_0x222d8d[_0x2a90('0x92')]=!![];_0x222d8d[_0x2a90('0x9c')]=moment()[_0x2a90('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x222d8d[_0x2a90('0x89')]=moment()[_0x2a90('0x4a')](_0x2a90('0x84'));}_0x222d8d['queuecallerabandon']=![];_0x222d8d[_0x2a90('0x83')]=null;_0x222d8d[_0x2a90('0x85')]=_0x101477[_0x2a90('0xab')];this['channels'][_0x101477[_0x2a90('0x48')]]=_0x222d8d;this['emitVoiceQueueChannelRemove'](_0x222d8d,_0x2a90('0x20'));}else if(this['isNotNull'](_0x101477[_0x2a90('0xa9')])&&this[_0x2a90('0x64')](_0x101477[_0x2a90('0xa9')][_0x2a90('0xb1')])){if(!_0x222d8d[_0x2a90('0x19')]){_0x222d8d[_0x2a90('0x92')]=!![];_0x222d8d[_0x2a90('0x9c')]=moment()[_0x2a90('0x4a')](_0x2a90('0x84'));_0x222d8d[_0x2a90('0x85')]='EXITWITHKEY';_0x222d8d['queuecallerleaveAt']=moment()[_0x2a90('0x4a')](_0x2a90('0x84'));this['channels'][_0x101477[_0x2a90('0x48')]]=_0x222d8d;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x101477[_0x2a90('0x48')],_0x222d8d[_0x2a90('0x4c')],_0x222d8d[_0x2a90('0x53')],_[_0x2a90('0x7c')](_0x101477[_0x2a90('0xa9')])[0x0],_0x101477[_0x2a90('0xab')]);_0x222d8d['variables']=this['variables'][_0x101477[_0x2a90('0x48')]];}}}}catch(_0x59fec5){logger[_0x2a90('0x40')](_0x2a90('0xa7'),_0x101477[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x59fec5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0xa8')]=function(_0x775576,_0x5d46d4,_0xc4b461){var _0x1e89c9=[_0x2a90('0xb2'),_0x2a90('0xb3'),_0x2a90('0xb4'),'rtpaudioqosjitterbridged',_0x2a90('0xb5'),'rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged',_0x2a90('0xb6'),_0x2a90('0xb7'),_0x2a90('0xb8'),'bridgepvtcallid',_0x2a90('0xb9'),_0x2a90('0xba'),'memberinterface',_0x2a90('0xbb'),'membername',_0x2a90('0xbc'),'memberrealtime'];if(!_[_0x2a90('0xbd')](_0x5d46d4)&&!_[_0x2a90('0xbe')](_0x1e89c9,_0x5d46d4)){if(_[_0x2a90('0x65')](this[_0x2a90('0x3f')][_0x775576])){this[_0x2a90('0x3f')][_0x775576]={};}this[_0x2a90('0x3f')][_0x775576][_0x5d46d4]=_0xc4b461;}};VoiceQueueReport[_0x2a90('0xb')]['syncHangup']=function(_0x1f8c31){try{if(this['isNotNull'](_0x1f8c31)){logger[_0x2a90('0x45')](_0x2a90('0xbf'),_0x1f8c31[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x1f8c31,{'showHidden':![],'depth':null}));if(this[_0x2a90('0xe')][_0x1f8c31[_0x2a90('0x48')]]){for(var _0x10cf34=0x0,_0x2c765c={};_0x10cf34<this['queueReports'][_0x1f8c31['uniqueid']][_0x2a90('0xc0')];_0x10cf34+=0x1){_0x2c765c=this[_0x2a90('0xe')][_0x1f8c31[_0x2a90('0x48')]][_0x10cf34];if(this[_0x2a90('0x11')][_0x2c765c[_0x2a90('0x69')]]){if(_0x2c765c[_0x2a90('0x92')]&&_0x2c765c[_0x2a90('0x94')]!=!![]){this[_0x2a90('0x11')][_0x2c765c[_0x2a90('0x69')]]['unmanaged']+=0x1;}if(_0x2c765c['queuecallerabandon']){this['voiceQueues'][_0x2c765c[_0x2a90('0x69')]][_0x2a90('0x5f')]+=0x1;}this[_0x2a90('0x11')][_0x2c765c['queue']]['sumHoldTime']+=moment(_0x2c765c['queuecallerleaveAt'])[_0x2a90('0xc1')](_0x2c765c['queuecallerjoinAt'],_0x2a90('0xc2'))||0x0;if(_0x10cf34===this[_0x2a90('0xe')][_0x1f8c31[_0x2a90('0x48')]][_0x2a90('0xc0')]-0x1){this[_0x2a90('0x11')][_0x2c765c[_0x2a90('0x69')]][_0x2a90('0x5b')]+=moment()[_0x2a90('0xc3')](0x0)['diff'](_0x2c765c[_0x2a90('0x9d')],_0x2a90('0xc2'));this[_0x2a90('0x11')][_0x2c765c['queue']][_0x2a90('0x5d')]+=0x1;if(_0x2c765c[_0x2a90('0x7f')]){this[_0x2a90('0x11')][_0x2c765c[_0x2a90('0x69')]][_0x2a90('0x56')]+=0x1;this[_0x2a90('0x11')][_0x2c765c[_0x2a90('0x69')]][_0x2a90('0x5a')]+=moment()['milliseconds'](0x0)['diff'](_0x2c765c[_0x2a90('0x89')],_0x2a90('0xc2'));_0x2c765c[_0x2a90('0x80')]=moment()[_0x2a90('0x4a')](_0x2a90('0x84'));_0x2c765c['queuecallerexit']=![];_0x2c765c[_0x2a90('0x9c')]=null;}if(_0x2c765c[_0x2a90('0x92')]&&_0x2c765c['transfer']!=!![]){_0x2c765c[_0x2a90('0xae')]=_0x2a90('0x5e');logger[_0x2a90('0x45')](_0x2a90('0xc4'),_0x1f8c31[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x2c765c,{'showHidden':![],'depth':null}));ami[_0x2a90('0x49')](_0x2a90('0xc5'),_0x2c765c);}if(_0x2c765c[_0x2a90('0x19')]){_0x2c765c['lastevent']=_0x2a90('0x5f');logger[_0x2a90('0x45')](_0x2a90('0xc6'),_0x1f8c31[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x2c765c,{'showHidden':![],'depth':null}));ami[_0x2a90('0x49')](_0x2a90('0xc7'),_0x2c765c);}}else{this[_0x2a90('0x11')][_0x2c765c[_0x2a90('0x69')]][_0x2a90('0x5b')]+=this[_0x2a90('0x11')][_0x2c765c['queue']]['sumHoldTime'];}logger[_0x2a90('0x6a')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x1f8c31[_0x2a90('0x48')],_0x2c765c[_0x2a90('0x4c')],_0x2c765c[_0x2a90('0x53')],_0x1f8c31[_0x2a90('0xc8')]);this[_0x2a90('0x10')][_0x1f8c31[_0x2a90('0x48')]]=_0x2c765c;this[_0x2a90('0x42')](_0x2c765c,_0x2a90('0x21'));this[_0x2a90('0x52')](this['voiceQueues'][_0x2c765c[_0x2a90('0x69')]],_0x2a90('0x21'));}}logger['debug'](_0x2a90('0xc9'),_0x1f8c31[_0x2a90('0x48')],util[_0x2a90('0x3d')](this[_0x2a90('0xe')][_0x1f8c31[_0x2a90('0x48')]],{'showHidden':![],'depth':null}));ami[_0x2a90('0x49')](_0x2a90('0xca'),this[_0x2a90('0xe')][_0x1f8c31['uniqueid']]);delete this['queueReports'][_0x1f8c31['uniqueid']];delete this[_0x2a90('0x10')][_0x1f8c31['uniqueid']];}if(this['variables'][_0x1f8c31[_0x2a90('0x48')]]){delete this['variables'][_0x1f8c31['uniqueid']];}}}catch(_0x1bba95){logger[_0x2a90('0x40')](_0x2a90('0xbf'),_0x1f8c31['uniqueid'],util[_0x2a90('0x3d')](_0x1bba95,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0xcb')]=function(_0x27e9d9){try{if(this['isNotNull'](_0x27e9d9)){logger[_0x2a90('0x45')](_0x2a90('0xcc'),_0x27e9d9[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x27e9d9,{'showHidden':![],'depth':null}));var _0x34dc6b;if(this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xcd')]]){_0x34dc6b=_[_0x2a90('0x7e')](this['queueReports'][_0x27e9d9[_0x2a90('0xcd')]]);_0x34dc6b['transferexten']=_0x27e9d9[_0x2a90('0xce')];_0x34dc6b['transferuniqueid']=_0x27e9d9[_0x2a90('0xcf')];_0x34dc6b[_0x2a90('0x85')]=_0x2a90('0xd0');_0x34dc6b[_0x2a90('0x94')]=!![];_0x34dc6b[_0x2a90('0x9f')]=_0x2a90('0xd1');if(this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xcf')]]){var _0x1b163b=this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xcf')]];this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xcf')]]=this[_0x2a90('0xe')][_0x27e9d9['transfereeuniqueid']];this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xcd')]]=_0x1b163b;var _0x4c21a3=_['last'](this['queueReports'][_0x27e9d9[_0x2a90('0xcd')]]);_0x4c21a3[_0x2a90('0x34')]=!![];}logger[_0x2a90('0x6a')](_0x2a90('0xd2'),_0x27e9d9[_0x2a90('0x48')],_0x34dc6b[_0x2a90('0x4c')],_0x34dc6b[_0x2a90('0x53')],_0x34dc6b[_0x2a90('0xa1')],_0x34dc6b[_0x2a90('0xd3')]);}else if(this['queueReports'][_0x27e9d9[_0x2a90('0xd4')]]){_0x34dc6b=_['last'](this['queueReports'][_0x27e9d9['transfertargetuniqueid']]);_0x34dc6b['transferexten']=_0x27e9d9[_0x2a90('0xd5')];_0x34dc6b[_0x2a90('0xd3')]=_0x27e9d9['origtransfereruniqueid'];_0x34dc6b[_0x2a90('0x85')]=_0x2a90('0xd0');_0x34dc6b['transfer']=!![];_0x34dc6b[_0x2a90('0x9f')]=_0x2a90('0xd1');if(this['queueReports'][_0x27e9d9[_0x2a90('0xd6')]]){var _0x1b163b=this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xd6')]];this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xd6')]]=this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xd4')]];this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xd4')]]=_0x1b163b;var _0x4c21a3=_['last'](this[_0x2a90('0xe')][_0x27e9d9[_0x2a90('0xd4')]]);_0x4c21a3['switch']=!![];}logger[_0x2a90('0x6a')](_0x2a90('0xd2'),_0x27e9d9[_0x2a90('0x48')],_0x34dc6b[_0x2a90('0x4c')],_0x34dc6b[_0x2a90('0x53')],_0x34dc6b[_0x2a90('0xa1')],_0x34dc6b[_0x2a90('0xd3')]);}}}catch(_0x4ceb56){logger['error'](_0x2a90('0xcc'),_0x27e9d9['uniqueid'],util[_0x2a90('0x3d')](_0x4ceb56,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0xd7')]=function(_0x4018a2){try{if(this[_0x2a90('0x64')](_0x4018a2)){logger[_0x2a90('0x45')](_0x2a90('0xd8'),_0x4018a2['uniqueid'],util['inspect'](_0x4018a2,{'showHidden':![],'depth':null}));if(this[_0x2a90('0xe')][_0x4018a2[_0x2a90('0xcd')]]){var _0x4fff8d=_[_0x2a90('0x7e')](this['queueReports'][_0x4018a2[_0x2a90('0xcd')]]);_0x4fff8d['queuecallerexitreason']=_0x2a90('0xd9');_0x4fff8d[_0x2a90('0x94')]=!![];_0x4fff8d['transfertype']=_0x2a90('0xda');_0x4fff8d['transferexten']=_0x4018a2[_0x2a90('0xdb')];_0x4fff8d[_0x2a90('0xd3')]=_0x4018a2[_0x2a90('0xcd')];logger[_0x2a90('0x6a')](_0x2a90('0xdc'),_0x4018a2['uniqueid'],_0x4fff8d[_0x2a90('0x4c')],_0x4fff8d[_0x2a90('0x53')],_0x4fff8d[_0x2a90('0xa1')],_0x4fff8d['transferuniqueid']);this['syncHangup']({'event':_0x2a90('0xdd'),'uniqueid':_0x4018a2[_0x2a90('0xcd')],'context':_0x4018a2['context'],'channel':_0x4018a2['transfererchannel']});}}}catch(_0x362d44){logger[_0x2a90('0x40')](_0x2a90('0xd8'),_0x4018a2['uniqueid'],util[_0x2a90('0x3d')](_0x362d44,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2a90('0xb')][_0x2a90('0x28')]=function(_0x52f3b1){try{if(this[_0x2a90('0x64')](_0x52f3b1)){logger[_0x2a90('0x45')]('[%s][voiceQueueReport][musiconholdstart]',_0x52f3b1[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x52f3b1,{'showHidden':![],'depth':null}));if(this[_0x2a90('0xe')][_0x52f3b1['uniqueid']]){var _0x497267=_[_0x2a90('0x7e')](this['queueReports'][_0x52f3b1[_0x2a90('0x48')]]);if(!_[_0x2a90('0xbd')](_0x497267[_0x2a90('0x89')])){_0x497267[_0x2a90('0xde')]=moment()[_0x2a90('0x4a')](_0x2a90('0x84'));logger[_0x2a90('0x6a')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x52f3b1[_0x2a90('0x48')],_0x497267[_0x2a90('0xde')]);}}}}catch(_0x49d50a){logger['error']('[%s][voiceQueueReport][musiconholdstart]',_0x52f3b1[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x49d50a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncMusicOnHoldStop']=function(_0x2a424d){try{if(this[_0x2a90('0x64')](_0x2a424d)){logger[_0x2a90('0x45')]('[%s][voiceQueueReport][musiconholdstop]',_0x2a424d['uniqueid'],util[_0x2a90('0x3d')](_0x2a424d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2a424d[_0x2a90('0x48')]]){var _0x4fbed8=_[_0x2a90('0x7e')](this[_0x2a90('0xe')][_0x2a424d['uniqueid']]);if(!_['isNil'](_0x4fbed8[_0x2a90('0xde')])){_0x4fbed8[_0x2a90('0xdf')]+=moment()[_0x2a90('0xc3')](0x0)['diff'](_0x4fbed8['mohstarttime'],'seconds');logger[_0x2a90('0x6a')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x2a424d['uniqueid'],_0x4fbed8[_0x2a90('0xdf')]);delete _0x4fbed8[_0x2a90('0xde')];}}}}catch(_0x32bd8f){logger['error'](_0x2a90('0xe0'),_0x2a424d[_0x2a90('0x48')],util[_0x2a90('0x3d')](_0x32bd8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2a90('0xb')]['syncNewExten']=function(_0x5c0658){try{if(this[_0x2a90('0x64')](_0x5c0658)){logger[_0x2a90('0x45')](_0x2a90('0xe1'),_0x5c0658['uniqueid'],util[_0x2a90('0x3d')](_0x5c0658,{'showHidden':![],'depth':null}));if(_0x5c0658[_0x2a90('0xe2')][_0x2a90('0x99')]()==='set'){_0x5c0658[_0x2a90('0xe3')]=_0x5c0658[_0x2a90('0xe4')]&&_0x5c0658['appdata'][_0x2a90('0x97')](_0x2a90('0xe5'))?_0x5c0658['appdata']:(_0x5c0658[_0x2a90('0xe4')]||_0x5c0658[_0x2a90('0xe3')])[_0x2a90('0x99')]();if(_[_0x2a90('0x97')](_0x5c0658[_0x2a90('0xe3')]['toLowerCase'](),_0x2a90('0xe6'))){logger['info'](_0x2a90('0xe7'),_0x5c0658['uniqueid'],_0x5c0658[_0x2a90('0xe2')],_0x5c0658[_0x2a90('0xe3')]);if(_[_0x2a90('0x65')](this[_0x2a90('0x10')][_0x5c0658[_0x2a90('0x48')]]))this[_0x2a90('0x10')][_0x5c0658[_0x2a90('0x48')]]={};var _0x33bb4c=_0x5c0658[_0x2a90('0xe3')]['split']('=');var _0x3bbbae=_0x33bb4c[0x0][_0x2a90('0x99')]()[_0x2a90('0xe8')](/cdr\((.*)\)/);if(_0x3bbbae)this['channels'][_0x5c0658['uniqueid']][_0x3bbbae[0x1]]=_0x33bb4c[0x1];}}}}catch(_0x8965e9){logger[_0x2a90('0x40')](_0x2a90('0xe9'),_0x5c0658[_0x2a90('0x48')],util['inspect'](_0x8965e9,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0xd9dc=['syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','waiting','queueStatusComplete','unlockRR','channels','switch','isNil','Action','channel','message','No\x20such\x20channel','inspect','[%s][voiceQueueReport][checkQueueReport]','error','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearqueuereport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','voice_queue_channel:remove','voice_queue_presence:remove','type','inbound','strategy','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','clearZombieChannels','queues','catch','[voiceQueueReport][queues]','flagQueueSummary','then','queue','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers','loggedIn','available','loggedin','emitVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','info','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','transferuniqueid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','diff','sumDuration','answered','queuecallercompleteAt','[%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','secondtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][blindtransfer]','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','milliseconds','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','application','toLowerCase','set','appdata','startsWith','CDR(routeAlias)','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','campaigns','variables','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','newexten','syncNewExten','musiconholdstart'];(function(_0x39130f,_0x29bf37){var _0x31d6e7=function(_0x520af7){while(--_0x520af7){_0x39130f['push'](_0x39130f['shift']());}};_0x31d6e7(++_0x29bf37);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x267fea,_0x465cdf){_0x267fea=_0x267fea-0x0;var _0x25c4b4=_0xd9dc[_0x267fea];return _0x25c4b4;};'use strict';var _=require('lodash');var moment=require(_0xcd9d('0x0'));var util=require(_0xcd9d('0x1'));var md5=require('md5');var Redis=require(_0xcd9d('0x2'));var config=require(_0xcd9d('0x3'));var logger=require(_0xcd9d('0x4'))('ami');var ami=require(_0xcd9d('0x5'));var QueueReport=require(_0xcd9d('0x6'));config[_0xcd9d('0x7')]=_[_0xcd9d('0x8')](config[_0xcd9d('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xcd9d('0x9'))(new Redis(config[_0xcd9d('0x7')]));var Sequence=function(){};Sequence[_0xcd9d('0xa')][_0xcd9d('0xb')]=function(_0x45130c){this['tail']=this[_0xcd9d('0xc')]?this[_0xcd9d('0xc')][_0xcd9d('0xd')](_0x45130c):_0x45130c();};function VoiceQueueReport(_0x112c01){this[_0xcd9d('0xe')]=new Sequence();this[_0xcd9d('0xf')]={};this[_0xcd9d('0x10')]=_0x112c01[_0xcd9d('0x10')];this['channels']=_0x112c01[_0xcd9d('0x11')];this['voiceQueues']=_0x112c01[_0xcd9d('0x12')];this['flagQueueSummary']=!![];this[_0xcd9d('0x13')]=_0x112c01[_0xcd9d('0x13')];this[_0xcd9d('0x14')]={};ami['on']('queuesummary',this[_0xcd9d('0x15')]['bind'](this));ami['on'](_0xcd9d('0x16'),this[_0xcd9d('0x17')][_0xcd9d('0x18')](this));ami['on']('queuecallerjoin',this[_0xcd9d('0x19')][_0xcd9d('0x18')](this));ami['on']('queuecallerabandon',this[_0xcd9d('0x1a')]['bind'](this));ami['on'](_0xcd9d('0x1b'),this['syncQueueCallerLeave'][_0xcd9d('0x18')](this));ami['on'](_0xcd9d('0x1c'),this[_0xcd9d('0x1d')][_0xcd9d('0x18')](this));ami['on'](_0xcd9d('0x1e'),this[_0xcd9d('0x1f')][_0xcd9d('0x18')](this));ami['on'](_0xcd9d('0x20'),this[_0xcd9d('0x21')][_0xcd9d('0x18')](this));ami['on'](_0xcd9d('0x22'),this['syncHangup'][_0xcd9d('0x18')](this));ami['on'](_0xcd9d('0x23'),this[_0xcd9d('0x24')]['bind'](this));ami['on'](_0xcd9d('0x25'),this[_0xcd9d('0x26')][_0xcd9d('0x18')](this));ami['on'](_0xcd9d('0x27'),this[_0xcd9d('0x28')][_0xcd9d('0x18')](this));ami['on'](_0xcd9d('0x29'),this[_0xcd9d('0x2a')]['bind'](this));ami['on']('attendedtransfer',this[_0xcd9d('0x2b')][_0xcd9d('0x18')](this));ami['on'](_0xcd9d('0x2c'),this[_0xcd9d('0x2d')]['bind'](this));this[_0xcd9d('0x2e')]();this[_0xcd9d('0x2f')]();}function clearChannels(_0x1cf4f2){if(!_[_0xcd9d('0x30')](_0x1cf4f2)){for(var _0x32686a in _0x1cf4f2){if(_0x1cf4f2[_0xcd9d('0x31')](_0x32686a)){delete _0x1cf4f2[_0x32686a];}}}}function clearCampaigns(_0x33aca7){if(!_[_0xcd9d('0x30')](_0x33aca7)){for(var _0xf21e2 in _0x33aca7){if(_0x33aca7[_0xcd9d('0x31')](_0xf21e2)){_0x33aca7[_0xf21e2][_0xcd9d('0x32')]=0x0;}}}}function clearVoiceQueues(_0x3b1abd){if(!_[_0xcd9d('0x30')](_0x3b1abd)){for(var _0x5ad994 in _0x3b1abd){if(_0x3b1abd[_0xcd9d('0x31')](_0x5ad994)){_0x3b1abd[_0x5ad994][_0xcd9d('0x32')]=0x0;_0x3b1abd[_0x5ad994]['talking']=0x0;_0x3b1abd[_0x5ad994]['pTalking']=0x0;_0x3b1abd[_0x5ad994][_0xcd9d('0x33')]=0x0;_0x3b1abd[_0x5ad994][_0xcd9d('0x34')]=!![];}}}}function clearAgentBooked(_0x5b1fd6){if(!_[_0xcd9d('0x30')](_0x5b1fd6)){for(var _0x2d3347 in _0x5b1fd6){if(_0x5b1fd6[_0xcd9d('0x31')](_0x2d3347)){_0x5b1fd6[_0x2d3347][_0xcd9d('0x35')]=!![];}}}}VoiceQueueReport[_0xcd9d('0xa')]['clearZombieChannels']=function(){var _0x4bd53d=this;for(var _0x2931df in this[_0xcd9d('0x36')]){if(this['channels'][_0xcd9d('0x31')](_0x2931df)&&!this[_0xcd9d('0x36')][_0x2931df][_0xcd9d('0x37')]){this['sequence'][_0xcd9d('0xb')](function(){if(!_[_0xcd9d('0x38')](_0x4bd53d[_0xcd9d('0x36')][_0x2931df])){return ami[_0xcd9d('0x39')]({'action':'status','channel':_0x4bd53d['channels'][_0x2931df][_0xcd9d('0x3a')]})['catch'](function(_0x5a0c5f){if(_0x5a0c5f[_0xcd9d('0x3b')]===_0xcd9d('0x3c')){setTimeout(function(){if(_0x4bd53d[_0xcd9d('0x36')][_0x2931df]){delete _0x4bd53d[_0xcd9d('0x36')][_0x2931df];logger['error']('[%s][voiceQueueReport][checkChannel]',_0x2931df,util[_0xcd9d('0x3d')](_0x5a0c5f,{'showHidden':![],'depth':null}));}if(_0x4bd53d[_0xcd9d('0xf')][_0x2931df]){delete _0x4bd53d[_0xcd9d('0xf')][_0x2931df];logger['error'](_0xcd9d('0x3e'),_0x2931df,util[_0xcd9d('0x3d')](_0x5a0c5f,{'showHidden':![],'depth':null}));}if(_0x4bd53d[_0xcd9d('0x14')][_0x2931df]){delete _0x4bd53d[_0xcd9d('0x14')][_0x2931df];logger[_0xcd9d('0x3f')](_0xcd9d('0x40'),_0x2931df,util[_0xcd9d('0x3d')](_0x5a0c5f,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0x24')]=function(){logger[_0xcd9d('0x3f')](_0xcd9d('0x41'));clearChannels(this[_0xcd9d('0x36')]);this['clearQueueReport'](this[_0xcd9d('0xf')]);clearAgentBooked(this[_0xcd9d('0x10')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0xcd9d('0xa')]['clearQueueReport']=function(_0x4dadc5){var _0x31c5ea=this;if(!_[_0xcd9d('0x30')](_0x4dadc5)){for(var _0x39a654 in _0x4dadc5){if(_0x4dadc5[_0xcd9d('0x31')](_0x39a654)){_0x31c5ea['emitVoiceQueueChannelRemove'](_0x4dadc5[_0x39a654],_0xcd9d('0x42'));delete _0x4dadc5[_0x39a654];}}}};VoiceQueueReport[_0xcd9d('0xa')]['emit']=function(_0x22024e,_0x1cf236,_0x1d7c7a){io['to'](_0x22024e)[_0xcd9d('0x43')](_0x1cf236,_0x1d7c7a);};VoiceQueueReport['prototype']['emitVoiceQueueChannelSave']=function(_0x308488,_0x4ca724){logger[_0xcd9d('0x44')](_0xcd9d('0x45')+_0x4ca724+_0xcd9d('0x46'),_0x308488['uniqueid'],util[_0xcd9d('0x3d')](_0x308488,{'showHidden':![],'depth':null}));this[_0xcd9d('0x43')](util[_0xcd9d('0x47')](_0xcd9d('0x48'),_0x308488[_0xcd9d('0x49')]),_0xcd9d('0x4a'),_0x308488);io[_0xcd9d('0x43')](_0xcd9d('0x4b'),_0x308488);};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0x4c')]=function(_0x3b5573,_0x5e8223){logger['debug']('[%s][voiceQueueReport]['+_0x5e8223+_0xcd9d('0x4d'),_0x3b5573[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x3b5573,{'showHidden':![],'depth':null}));this['emit'](util[_0xcd9d('0x47')](_0xcd9d('0x48'),_0x3b5573['name']),_0xcd9d('0x4f'),_0x3b5573);io['emit'](_0xcd9d('0x50'),_0x3b5573);};VoiceQueueReport[_0xcd9d('0xa')]['emitVoiceQueueSummary']=function(_0x5224c1,_0x133011){if(_0x5224c1[_0xcd9d('0x51')]===_0xcd9d('0x52')){var _0x2d6370={'id':_0x5224c1['id'],'name':_0x5224c1[_0xcd9d('0x49')],'strategy':_0x5224c1[_0xcd9d('0x53')],'answered':_0x5224c1['answered'],'available':_0x5224c1['available'],'loggedIn':_0x5224c1['loggedIn'],'pTalking':_0x5224c1[_0xcd9d('0x54')],'sumBillable':_0x5224c1[_0xcd9d('0x55')],'sumDuration':_0x5224c1['sumDuration'],'sumHoldTime':_0x5224c1[_0xcd9d('0x56')]||0x0,'talking':_0x5224c1[_0xcd9d('0x57')],'total':_0x5224c1[_0xcd9d('0x58')],'type':_0x5224c1[_0xcd9d('0x51')],'unmanaged':_0x5224c1[_0xcd9d('0x59')],'abandoned':_0x5224c1[_0xcd9d('0x5a')],'waiting':_0x5224c1[_0xcd9d('0x33')]};if(_0x5224c1[_0xcd9d('0x5b')]){_0x2d6370[_0xcd9d('0x5b')]={'id':_0x5224c1[_0xcd9d('0x5b')]['id'],'name':_0x5224c1['Trunk'][_0xcd9d('0x49')],'active':_0x5224c1[_0xcd9d('0x5b')][_0xcd9d('0x5c')],'callerid':_0x5224c1[_0xcd9d('0x5b')][_0xcd9d('0x5d')]};}if(_0x5224c1[_0xcd9d('0x5e')]){_0x2d6370[_0xcd9d('0x5e')]={'id':_0x5224c1[_0xcd9d('0x5e')]['id'],'name':_0x5224c1['Interval'][_0xcd9d('0x49')]};}var _0x308c01=md5(JSON[_0xcd9d('0x5f')](_0x2d6370));if(_0x5224c1['md5']!==_0x308c01){_0x5224c1[_0xcd9d('0x60')]=_0x308c01;logger[_0xcd9d('0x44')](_0xcd9d('0x61')+_0x133011+_0xcd9d('0x62'),util[_0xcd9d('0x3d')](_0x2d6370,{'showHidden':![],'depth':null}));this[_0xcd9d('0x43')](util[_0xcd9d('0x47')](_0xcd9d('0x48'),_0x2d6370['name']),_0xcd9d('0x63'),_0x2d6370);}}};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0x64')]=function(_0x4fd1da){return _0x4fd1da!==null&&!_['isUndefined'](_0x4fd1da);};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0x2f')]=function(){var _0x26b475=this;setInterval(function(){_0x26b475[_0xcd9d('0x65')]();ami['Action']({'action':_0xcd9d('0x66')})[_0xcd9d('0x67')](function(_0x1bf893){logger[_0xcd9d('0x3f')](_0xcd9d('0x68'),util['inspect'](_0x1bf893,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0x2e')]=function(){var _0x59fe77=this;setInterval(function(){if(_0x59fe77[_0xcd9d('0x69')]){return ami[_0xcd9d('0x39')]({'action':'queuesummary'})[_0xcd9d('0x6a')](function(_0x1085f5){_0x59fe77[_0xcd9d('0x69')]=![];})[_0xcd9d('0x67')](function(_0x306376){logger[_0xcd9d('0x3f')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x306376,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xcd9d('0x15')]=function(_0x372bce){try{if(this[_0xcd9d('0x64')](_0x372bce)&&this['isNotNull'](_0x372bce[_0xcd9d('0x6b')])){logger[_0xcd9d('0x44')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xcd9d('0x3d')](_0x372bce,{'showHidden':![],'depth':null}));if(this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]]){logger['info'](_0xcd9d('0x6c'),_0x372bce[_0xcd9d('0x6b')]);var _0x5d1150=_[_0xcd9d('0x6d')](this['channels'],_0xcd9d('0x6b'))[_0x372bce[_0xcd9d('0x6b')]]||0x0;var _0x1e350c=_0x5d1150-_0x372bce['callers'];if(this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]][_0xcd9d('0x33')]!==_[_0xcd9d('0x6e')](_0x372bce[_0xcd9d('0x6f')])||this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]][_0xcd9d('0x70')]!==_[_0xcd9d('0x6e')](_0x372bce['loggedin'])||this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]][_0xcd9d('0x71')]!==_['toNumber'](_0x372bce[_0xcd9d('0x71')])||this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]][_0xcd9d('0x57')]!==_0x1e350c){this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]]['waiting']=_['toNumber'](_0x372bce[_0xcd9d('0x6f')]);this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]][_0xcd9d('0x70')]=_[_0xcd9d('0x6e')](_0x372bce['loggedin']);this[_0xcd9d('0x12')][_0x372bce['queue']][_0xcd9d('0x71')]=_['toNumber'](_0x372bce[_0xcd9d('0x71')]);this['voiceQueues'][_0x372bce[_0xcd9d('0x6b')]][_0xcd9d('0x57')]=_0x1e350c>0x0?_0x1e350c:0x0;this['voiceQueues'][_0x372bce[_0xcd9d('0x6b')]]['talking']=this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]]['talking']>_[_0xcd9d('0x6e')](_0x372bce[_0xcd9d('0x72')])?_[_0xcd9d('0x6e')](_0x372bce['loggedin']):this[_0xcd9d('0x12')][_0x372bce['queue']]['talking'];this[_0xcd9d('0x73')](this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]],'queuesummary');}logger[_0xcd9d('0x44')](_0xcd9d('0x74'),util[_0xcd9d('0x3d')](this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]],{'showHidden':![],'depth':null}));ami[_0xcd9d('0x43')]('custom:queuesummary',this[_0xcd9d('0x12')][_0x372bce[_0xcd9d('0x6b')]]);}}}catch(_0x52933d){logger[_0xcd9d('0x3f')]('[voiceQueueReport][queuesummary]',util[_0xcd9d('0x3d')](_0x52933d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0x17')]=function(_0x26ecba){logger[_0xcd9d('0x44')](_0xcd9d('0x75'),util[_0xcd9d('0x3d')](_0x26ecba,{'showHidden':![],'depth':null}));this[_0xcd9d('0x69')]=!![];};VoiceQueueReport[_0xcd9d('0xa')]['syncQueueCallerJoin']=function(_0x25f758){try{if(this['isNotNull'](_0x25f758)){logger[_0xcd9d('0x44')](_0xcd9d('0x76'),_0x25f758[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x25f758,{'showHidden':![],'depth':null}));if(_[_0xcd9d('0x77')](this['queueReports'][_0x25f758[_0xcd9d('0x4e')]]))this[_0xcd9d('0xf')][_0x25f758[_0xcd9d('0x4e')]]=[];if(_[_0xcd9d('0x77')](this[_0xcd9d('0x36')][_0x25f758['uniqueid']]))this['channels'][_0x25f758[_0xcd9d('0x4e')]]={};var _0x47da2b=new QueueReport();_0x47da2b[_0xcd9d('0x49')]=_0x25f758[_0xcd9d('0x6b')];_0x47da2b['type']=this[_0xcd9d('0x12')][_0x47da2b[_0xcd9d('0x49')]]&&this[_0xcd9d('0x12')][_0x47da2b[_0xcd9d('0x49')]]['type']?this[_0xcd9d('0x12')][_0x47da2b['name']]['type']||'inbound':_0xcd9d('0x52');_0x47da2b['queue']=_0x25f758[_0xcd9d('0x6b')];_0x47da2b[_0xcd9d('0x78')]=moment()[_0xcd9d('0x47')](_0xcd9d('0x79'));_0x47da2b[_0xcd9d('0x7a')]=_0x25f758[_0xcd9d('0x7a')];_0x47da2b['count']=_0x25f758[_0xcd9d('0x7b')];_0x47da2b[_0xcd9d('0x4e')]=_0x25f758[_0xcd9d('0x4e')];_0x47da2b['routealias']=this[_0xcd9d('0x36')][_0x25f758[_0xcd9d('0x4e')]][_0xcd9d('0x7c')];logger['info'](_0xcd9d('0x7d'),_0x47da2b['name'],_0x47da2b[_0xcd9d('0x51')]);_[_0xcd9d('0x7e')](_0x47da2b,_[_0xcd9d('0x7f')](_0x25f758,_[_0xcd9d('0x80')](_0x47da2b)));this[_0xcd9d('0xf')][_0x25f758[_0xcd9d('0x4e')]][_0xcd9d('0x81')](_0x47da2b);this[_0xcd9d('0x36')][_0x25f758[_0xcd9d('0x4e')]]=_0x47da2b;this[_0xcd9d('0x82')](_0x47da2b,'queuecallerjoin');}}catch(_0x4b2edc){logger[_0xcd9d('0x3f')](_0xcd9d('0x76'),_0x25f758[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x4b2edc,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x4f6261){try{if(this[_0xcd9d('0x64')](_0x4f6261)){logger['debug'](_0xcd9d('0x83'),_0x4f6261[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x4f6261,{'showHidden':![],'depth':null}));if(this[_0xcd9d('0xf')][_0x4f6261[_0xcd9d('0x4e')]]){var _0x413a95=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0x4f6261[_0xcd9d('0x4e')]]);_0x413a95[_0xcd9d('0x85')]=![];_0x413a95['queuecallercompleteAt']=null;_0x413a95[_0xcd9d('0x86')]=_0x4f6261[_0xcd9d('0x86')];_0x413a95[_0xcd9d('0x87')]=_0x4f6261[_0xcd9d('0x87')];_0x413a95[_0xcd9d('0x88')]=!![];_0x413a95[_0xcd9d('0x89')]=moment()[_0xcd9d('0x47')](_0xcd9d('0x79'));_0x413a95[_0xcd9d('0x8a')]=_0xcd9d('0x8b');_0x413a95[_0xcd9d('0x8c')]=null;logger['info'](_0xcd9d('0x8d'),_0x413a95[_0xcd9d('0x49')],_0x413a95[_0xcd9d('0x51')]);this[_0xcd9d('0x36')][_0x4f6261[_0xcd9d('0x4e')]]=_0x413a95;this[_0xcd9d('0x4c')](_0x413a95,'queuecallerabandon');}}}catch(_0x3736e0){logger[_0xcd9d('0x3f')](_0xcd9d('0x83'),_0x4f6261['uniqueid'],util[_0xcd9d('0x3d')](_0x3736e0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x3a5b3f){try{if(this['isNotNull'](_0x3a5b3f)){logger[_0xcd9d('0x44')](_0xcd9d('0x8e'),_0x3a5b3f[_0xcd9d('0x4e')],util['inspect'](_0x3a5b3f,{'showHidden':![],'depth':null}));if(this[_0xcd9d('0xf')][_0x3a5b3f[_0xcd9d('0x4e')]]){var _0x5c609d=_[_0xcd9d('0x84')](this['queueReports'][_0x3a5b3f[_0xcd9d('0x4e')]]);_0x5c609d[_0xcd9d('0x8f')]=moment()['format'](_0xcd9d('0x79'));_0x5c609d[_0xcd9d('0x90')]=_0x3a5b3f['connectedlinenum'];_0x5c609d[_0xcd9d('0x91')]=_0x3a5b3f[_0xcd9d('0x91')];logger[_0xcd9d('0x92')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5c609d[_0xcd9d('0x49')],_0x5c609d[_0xcd9d('0x51')],_0x3a5b3f['connectedlinenum'],_0x3a5b3f['connectedlinename']);this[_0xcd9d('0x36')][_0x3a5b3f[_0xcd9d('0x4e')]]=_0x5c609d;this['emitVoiceQueueChannelSave'](_0x5c609d,_0xcd9d('0x1b'));}}}catch(_0x308c79){logger[_0xcd9d('0x3f')](_0xcd9d('0x8e'),_0x3a5b3f[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x308c79,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd9d('0x1f')]=function(_0x122a99){try{if(this[_0xcd9d('0x64')](_0x122a99)){logger[_0xcd9d('0x44')](_0xcd9d('0x93'),_0x122a99[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x122a99,{'showHidden':![],'depth':null}));if(this[_0xcd9d('0xf')][_0x122a99['uniqueid']]){var _0x392000=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0x122a99[_0xcd9d('0x4e')]]);_0x392000[_0xcd9d('0x85')]=!![];_0x392000[_0xcd9d('0x8a')]=_0xcd9d('0x94');logger['info'](_0xcd9d('0x95'),_0x392000[_0xcd9d('0x49')],_0x392000[_0xcd9d('0x51')]);}}}catch(_0x14547f){logger[_0xcd9d('0x3f')](_0xcd9d('0x93'),_0x122a99[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x14547f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0x1d')]=function(_0xd87689){try{if(this[_0xcd9d('0x64')](_0xd87689)){logger[_0xcd9d('0x44')]('[%s][voiceQueueReport][agentcomplete]',_0xd87689[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0xd87689,{'showHidden':![],'depth':null}));if(this[_0xcd9d('0xf')][_0xd87689[_0xcd9d('0x4e')]]){var _0x23cd69=_['last'](this[_0xcd9d('0xf')][_0xd87689['uniqueid']]);_0x23cd69['queuecallerabandon']=![];_0x23cd69[_0xcd9d('0x89')]=null;_0x23cd69[_0xcd9d('0x96')]=!![];_0x23cd69[_0xcd9d('0x8c')]=_0xd87689[_0xcd9d('0x97')];_0x23cd69['holdtime']=_0xd87689[_0xcd9d('0x86')];_0x23cd69['queuecallercomplete']=!![];_0x23cd69[_0xcd9d('0x98')]=![];_0x23cd69[_0xcd9d('0x99')]=null;if(!_0x23cd69[_0xcd9d('0x9a')]){if(_0xd87689[_0xcd9d('0x9b')]=='transfer'){_0x23cd69[_0xcd9d('0x8a')]=_0xcd9d('0x9c');logger[_0xcd9d('0x92')](_0xcd9d('0x9d'),_0x23cd69[_0xcd9d('0x49')],_0x23cd69[_0xcd9d('0x51')]);}else{if(_['startsWith'](_0xd87689['channel']['toLowerCase'](),_0xcd9d('0x9e'))){if(this[_0xcd9d('0xf')][_0xd87689[_0xcd9d('0x9f')]]){var _0x4043dd=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0xd87689[_0xcd9d('0x9f')]]);_0x4043dd[_0xcd9d('0x85')]=![];_0x4043dd['queuecallerexit']=!![];_0x4043dd['queuecallerexitAt']=moment(_0x23cd69[_0xcd9d('0x78')])[_0xcd9d('0xa0')](_0xd87689[_0xcd9d('0x86')],_0xcd9d('0xa1'))[_0xcd9d('0x47')](_0xcd9d('0x79'));_0x4043dd['queuecallerexitreason']=_0xcd9d('0xa2');_0x4043dd[_0xcd9d('0x9a')]=!![];_0x4043dd[_0xcd9d('0xa3')]='FORWARD';_0x4043dd[_0xcd9d('0xa4')]=_0xd87689['destexten'];_0x4043dd[_0xcd9d('0xa5')]=_0xd87689[_0xcd9d('0x4e')];logger[_0xcd9d('0x92')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4043dd[_0xcd9d('0x49')],_0x4043dd['type']);var _0x3da65a=this[_0xcd9d('0xf')][_0xd87689[_0xcd9d('0x9f')]];this[_0xcd9d('0xf')][_0xd87689[_0xcd9d('0x9f')]]=this['queueReports'][_0xd87689[_0xcd9d('0x4e')]];this[_0xcd9d('0xf')][_0xd87689[_0xcd9d('0x4e')]]=_0x3da65a;}}else{_0x23cd69[_0xcd9d('0x8a')]=_0xcd9d('0xa6')+_0xd87689['reason'][_0xcd9d('0xa7')]();logger[_0xcd9d('0x92')](_0xcd9d('0xa8'),_0x23cd69[_0xcd9d('0x49')],_0x23cd69[_0xcd9d('0x51')],_0x23cd69[_0xcd9d('0x8a')]);}}}this[_0xcd9d('0x36')][_0xd87689[_0xcd9d('0x4e')]]=_0x23cd69;this[_0xcd9d('0x4c')](_0x23cd69,'agentcomplete');}}}catch(_0x434b0){logger[_0xcd9d('0x3f')](_0xcd9d('0xa9'),_0xd87689[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x434b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0x21')]=function(_0x252d11){try{if(this[_0xcd9d('0x64')](_0x252d11)){logger[_0xcd9d('0x44')]('[%s][voiceQueueReport][varset]',_0x252d11[_0xcd9d('0x4e')],util['inspect'](_0x252d11,{'showHidden':![],'depth':null}));this[_0xcd9d('0xaa')](_0x252d11[_0xcd9d('0x4e')],_[_0xcd9d('0x80')](_0x252d11[_0xcd9d('0xab')])[0x0],_0x252d11[_0xcd9d('0xac')]);if(this[_0xcd9d('0xf')][_0x252d11[_0xcd9d('0x4e')]]){var _0x29f8e1=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0x252d11['uniqueid']]);if(_0x29f8e1){if(this[_0xcd9d('0x64')](_0x252d11[_0xcd9d('0xab')])&&this[_0xcd9d('0x64')](_0x252d11[_0xcd9d('0xab')][_0xcd9d('0xad')])){switch(_0x252d11[_0xcd9d('0xac')]){case _0xcd9d('0xae'):_0x29f8e1[_0xcd9d('0x98')]=![];_0x29f8e1[_0xcd9d('0x99')]=null;break;case _0xcd9d('0xaf'):_0x29f8e1[_0xcd9d('0xb0')]=_0xcd9d('0xb1');_0x29f8e1['queuecallerexit']=!![];_0x29f8e1[_0xcd9d('0x99')]=moment()[_0xcd9d('0x47')](_0xcd9d('0x79'));_0x29f8e1[_0xcd9d('0x8f')]=moment()[_0xcd9d('0x47')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0xcd9d('0xb2'),_0x252d11[_0xcd9d('0x4e')],util['inspect'](_0x29f8e1,{'showHidden':![],'depth':null}));ami['emit'](_0xcd9d('0xb3'),_0x29f8e1);break;default:_0x29f8e1[_0xcd9d('0x98')]=!![];_0x29f8e1['queuecallerexitAt']=moment()[_0xcd9d('0x47')](_0xcd9d('0x79'));_0x29f8e1[_0xcd9d('0x8f')]=moment()[_0xcd9d('0x47')](_0xcd9d('0x79'));}_0x29f8e1['queuecallerabandon']=![];_0x29f8e1[_0xcd9d('0x89')]=null;_0x29f8e1[_0xcd9d('0x8a')]=_0x252d11['value'];this[_0xcd9d('0x36')][_0x252d11[_0xcd9d('0x4e')]]=_0x29f8e1;this['emitVoiceQueueChannelRemove'](_0x29f8e1,_0xcd9d('0x20'));}else if(this[_0xcd9d('0x64')](_0x252d11[_0xcd9d('0xab')])&&this[_0xcd9d('0x64')](_0x252d11['variable'][_0xcd9d('0xb4')])){if(!_0x29f8e1[_0xcd9d('0x88')]){_0x29f8e1[_0xcd9d('0x98')]=!![];_0x29f8e1['queuecallerexitAt']=moment()[_0xcd9d('0x47')](_0xcd9d('0x79'));_0x29f8e1[_0xcd9d('0x8a')]='EXITWITHKEY';_0x29f8e1['queuecallerleaveAt']=moment()[_0xcd9d('0x47')](_0xcd9d('0x79'));this[_0xcd9d('0x36')][_0x252d11[_0xcd9d('0x4e')]]=_0x29f8e1;}}logger[_0xcd9d('0x92')](_0xcd9d('0xb5'),_0x252d11[_0xcd9d('0x4e')],_0x29f8e1['name'],_0x29f8e1[_0xcd9d('0x51')],_[_0xcd9d('0x80')](_0x252d11[_0xcd9d('0xab')])[0x0],_0x252d11[_0xcd9d('0xac')]);_0x29f8e1['variables']=this[_0xcd9d('0x14')][_0x252d11[_0xcd9d('0x4e')]];}}}}catch(_0x33c54d){logger['error'](_0xcd9d('0xb6'),_0x252d11[_0xcd9d('0x4e')],util['inspect'](_0x33c54d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0xaa')]=function(_0x5c7849,_0x29f81f,_0x545bfe){var _0x896fdc=[_0xcd9d('0xb7'),_0xcd9d('0xb8'),'rtpaudioqosjitter',_0xcd9d('0xb9'),_0xcd9d('0xba'),_0xcd9d('0xbb'),_0xcd9d('0xbc'),_0xcd9d('0xbd'),_0xcd9d('0xbe'),_0xcd9d('0xbf'),_0xcd9d('0xc0'),_0xcd9d('0xc1'),'membercalls','memberdynamic','memberinterface',_0xcd9d('0xc2'),'membername',_0xcd9d('0xc3'),_0xcd9d('0xc4')];if(!_[_0xcd9d('0x38')](_0x29f81f)&&!_[_0xcd9d('0xc5')](_0x896fdc,_0x29f81f)){if(_[_0xcd9d('0x77')](this[_0xcd9d('0x14')][_0x5c7849])){this[_0xcd9d('0x14')][_0x5c7849]={};}this[_0xcd9d('0x14')][_0x5c7849][_0x29f81f]=_0x545bfe;}};VoiceQueueReport['prototype'][_0xcd9d('0xc6')]=function(_0x209bde){try{if(this[_0xcd9d('0x64')](_0x209bde)){logger[_0xcd9d('0x44')](_0xcd9d('0xc7'),_0x209bde[_0xcd9d('0x4e')],util['inspect'](_0x209bde,{'showHidden':![],'depth':null}));if(this[_0xcd9d('0xf')][_0x209bde[_0xcd9d('0x4e')]]){for(var _0x141351=0x0,_0x4fa0da={};_0x141351<this['queueReports'][_0x209bde[_0xcd9d('0x4e')]][_0xcd9d('0xc8')];_0x141351+=0x1){_0x4fa0da=this[_0xcd9d('0xf')][_0x209bde['uniqueid']][_0x141351];if(this[_0xcd9d('0x12')][_0x4fa0da['queue']]){if(_0x4fa0da[_0xcd9d('0x98')]&&_0x4fa0da[_0xcd9d('0x9a')]!=!![]){this[_0xcd9d('0x12')][_0x4fa0da[_0xcd9d('0x6b')]]['unmanaged']+=0x1;}if(_0x4fa0da[_0xcd9d('0x88')]){this[_0xcd9d('0x12')][_0x4fa0da['queue']][_0xcd9d('0x5a')]+=0x1;}this['voiceQueues'][_0x4fa0da['queue']][_0xcd9d('0x56')]+=moment(_0x4fa0da[_0xcd9d('0x8f')])[_0xcd9d('0xc9')](_0x4fa0da[_0xcd9d('0x78')],_0xcd9d('0xa1'))||0x0;if(_0x141351===this[_0xcd9d('0xf')][_0x209bde['uniqueid']][_0xcd9d('0xc8')]-0x1){this[_0xcd9d('0x12')][_0x4fa0da[_0xcd9d('0x6b')]][_0xcd9d('0xca')]+=moment()['milliseconds'](0x0)[_0xcd9d('0xc9')](_0x4fa0da[_0xcd9d('0x78')],_0xcd9d('0xa1'));this['voiceQueues'][_0x4fa0da['queue']][_0xcd9d('0x58')]+=0x1;if(_0x4fa0da[_0xcd9d('0x85')]){this['voiceQueues'][_0x4fa0da[_0xcd9d('0x6b')]][_0xcd9d('0xcb')]+=0x1;this['voiceQueues'][_0x4fa0da[_0xcd9d('0x6b')]]['sumBillable']+=moment()['milliseconds'](0x0)[_0xcd9d('0xc9')](_0x4fa0da[_0xcd9d('0x8f')],_0xcd9d('0xa1'));_0x4fa0da[_0xcd9d('0xcc')]=moment()[_0xcd9d('0x47')](_0xcd9d('0x79'));_0x4fa0da['queuecallerexit']=![];_0x4fa0da[_0xcd9d('0x99')]=null;}if(_0x4fa0da[_0xcd9d('0x98')]&&_0x4fa0da[_0xcd9d('0x9a')]!=!![]){_0x4fa0da[_0xcd9d('0xb0')]=_0xcd9d('0x59');logger[_0xcd9d('0x44')](_0xcd9d('0xcd'),_0x209bde[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x4fa0da,{'showHidden':![],'depth':null}));ami[_0xcd9d('0x43')]('custom:queuecallerunmanaged',_0x4fa0da);}if(_0x4fa0da[_0xcd9d('0x88')]){_0x4fa0da['lastevent']=_0xcd9d('0x5a');logger['debug'](_0xcd9d('0xce'),_0x209bde[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x4fa0da,{'showHidden':![],'depth':null}));ami[_0xcd9d('0x43')](_0xcd9d('0xcf'),_0x4fa0da);}}else{this[_0xcd9d('0x12')][_0x4fa0da[_0xcd9d('0x6b')]][_0xcd9d('0xca')]+=this[_0xcd9d('0x12')][_0x4fa0da[_0xcd9d('0x6b')]]['sumHoldTime'];}logger[_0xcd9d('0x92')](_0xcd9d('0xd0'),_0x209bde[_0xcd9d('0x4e')],_0x4fa0da[_0xcd9d('0x49')],_0x4fa0da[_0xcd9d('0x51')],_0x209bde[_0xcd9d('0xd1')]);this['channels'][_0x209bde[_0xcd9d('0x4e')]]=_0x4fa0da;this['emitVoiceQueueChannelRemove'](_0x4fa0da,'hangup');this[_0xcd9d('0x73')](this[_0xcd9d('0x12')][_0x4fa0da['queue']],_0xcd9d('0x22'));}}logger[_0xcd9d('0x44')](_0xcd9d('0xd2'),_0x209bde[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](this['queueReports'][_0x209bde[_0xcd9d('0x4e')]],{'showHidden':![],'depth':null}));ami[_0xcd9d('0x43')]('custom:voiceQueueReport',this['queueReports'][_0x209bde[_0xcd9d('0x4e')]]);delete this[_0xcd9d('0xf')][_0x209bde[_0xcd9d('0x4e')]];delete this[_0xcd9d('0x36')][_0x209bde['uniqueid']];}if(this['variables'][_0x209bde[_0xcd9d('0x4e')]]){delete this[_0xcd9d('0x14')][_0x209bde['uniqueid']];}}}catch(_0x2f1c20){logger['error'](_0xcd9d('0xc7'),_0x209bde[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x2f1c20,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd9d('0xa')][_0xcd9d('0x2b')]=function(_0x4f1990){try{if(this[_0xcd9d('0x64')](_0x4f1990)){logger[_0xcd9d('0x44')](_0xcd9d('0xd3'),_0x4f1990[_0xcd9d('0x4e')],util['inspect'](_0x4f1990,{'showHidden':![],'depth':null}));var _0x57e6b5;if(this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd4')]]){_0x57e6b5=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd4')]]);_0x57e6b5[_0xcd9d('0xa4')]=_0x4f1990['secondtransfererexten'];_0x57e6b5[_0xcd9d('0xa5')]=_0x4f1990[_0xcd9d('0xd5')];_0x57e6b5['queuecallerexitreason']=_0xcd9d('0xd6');_0x57e6b5[_0xcd9d('0x9a')]=!![];_0x57e6b5[_0xcd9d('0xa3')]='ATTENDED';if(this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd5')]]){var _0x3035de=this[_0xcd9d('0xf')][_0x4f1990['secondtransfereruniqueid']];this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd5')]]=this[_0xcd9d('0xf')][_0x4f1990['transfereeuniqueid']];this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd4')]]=_0x3035de;var _0x33b4ee=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd4')]]);_0x33b4ee[_0xcd9d('0x37')]=!![];}logger[_0xcd9d('0x92')](_0xcd9d('0xd7'),_0x4f1990['uniqueid'],_0x57e6b5[_0xcd9d('0x49')],_0x57e6b5['type'],_0x57e6b5['transferexten'],_0x57e6b5['transferuniqueid']);}else if(this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd8')]]){_0x57e6b5=_['last'](this[_0xcd9d('0xf')][_0x4f1990['transfertargetuniqueid']]);_0x57e6b5['transferexten']=_0x4f1990[_0xcd9d('0xd9')];_0x57e6b5[_0xcd9d('0xa5')]=_0x4f1990[_0xcd9d('0xda')];_0x57e6b5[_0xcd9d('0x8a')]=_0xcd9d('0xd6');_0x57e6b5[_0xcd9d('0x9a')]=!![];_0x57e6b5[_0xcd9d('0xa3')]=_0xcd9d('0xdb');if(this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xda')]]){var _0x3035de=this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xda')]];this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xda')]]=this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd8')]];this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd8')]]=_0x3035de;var _0x33b4ee=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0x4f1990[_0xcd9d('0xd8')]]);_0x33b4ee['switch']=!![];}logger[_0xcd9d('0x92')](_0xcd9d('0xd7'),_0x4f1990[_0xcd9d('0x4e')],_0x57e6b5[_0xcd9d('0x49')],_0x57e6b5['type'],_0x57e6b5[_0xcd9d('0xa4')],_0x57e6b5[_0xcd9d('0xa5')]);}}}catch(_0x1f3521){logger[_0xcd9d('0x3f')](_0xcd9d('0xd3'),_0x4f1990[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x1f3521,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcd9d('0xa')]['syncBlindTransfer']=function(_0xe7e27b){try{if(this[_0xcd9d('0x64')](_0xe7e27b)){logger[_0xcd9d('0x44')](_0xcd9d('0xdc'),_0xe7e27b[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0xe7e27b,{'showHidden':![],'depth':null}));if(this[_0xcd9d('0xf')][_0xe7e27b[_0xcd9d('0xd4')]]){var _0x2cfd15=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0xe7e27b['transfereeuniqueid']]);_0x2cfd15[_0xcd9d('0x8a')]='BLINDTRANSFER';_0x2cfd15[_0xcd9d('0x9a')]=!![];_0x2cfd15[_0xcd9d('0xa3')]='BLIND';_0x2cfd15[_0xcd9d('0xa4')]=_0xe7e27b[_0xcd9d('0xdd')];_0x2cfd15['transferuniqueid']=_0xe7e27b[_0xcd9d('0xd4')];logger[_0xcd9d('0x92')](_0xcd9d('0xde'),_0xe7e27b[_0xcd9d('0x4e')],_0x2cfd15[_0xcd9d('0x49')],_0x2cfd15[_0xcd9d('0x51')],_0x2cfd15[_0xcd9d('0xa4')],_0x2cfd15[_0xcd9d('0xa5')]);this[_0xcd9d('0xc6')]({'event':_0xcd9d('0xdf'),'uniqueid':_0xe7e27b[_0xcd9d('0xd4')],'context':_0xe7e27b[_0xcd9d('0xe0')],'channel':_0xe7e27b[_0xcd9d('0xe1')]});}}}catch(_0x2faa6f){logger[_0xcd9d('0x3f')](_0xcd9d('0xdc'),_0xe7e27b['uniqueid'],util[_0xcd9d('0x3d')](_0x2faa6f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd9d('0x28')]=function(_0x3cd81f){try{if(this['isNotNull'](_0x3cd81f)){logger[_0xcd9d('0x44')](_0xcd9d('0xe2'),_0x3cd81f[_0xcd9d('0x4e')],util[_0xcd9d('0x3d')](_0x3cd81f,{'showHidden':![],'depth':null}));if(this[_0xcd9d('0xf')][_0x3cd81f['uniqueid']]){var _0x50121e=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0x3cd81f['uniqueid']]);if(!_['isNil'](_0x50121e[_0xcd9d('0x8f')])){_0x50121e[_0xcd9d('0xe3')]=moment()[_0xcd9d('0x47')](_0xcd9d('0x79'));logger['info'](_0xcd9d('0xe4'),_0x3cd81f[_0xcd9d('0x4e')],_0x50121e[_0xcd9d('0xe3')]);}}}}catch(_0x24876c){logger[_0xcd9d('0x3f')]('[%s][voiceQueueReport][musiconholdstart]',_0x3cd81f[_0xcd9d('0x4e')],util['inspect'](_0x24876c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd9d('0x2a')]=function(_0x44f33c){try{if(this[_0xcd9d('0x64')](_0x44f33c)){logger[_0xcd9d('0x44')](_0xcd9d('0xe5'),_0x44f33c[_0xcd9d('0x4e')],util['inspect'](_0x44f33c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x44f33c[_0xcd9d('0x4e')]]){var _0x17f943=_[_0xcd9d('0x84')](this[_0xcd9d('0xf')][_0x44f33c[_0xcd9d('0x4e')]]);if(!_['isNil'](_0x17f943[_0xcd9d('0xe3')])){_0x17f943['mohtime']+=moment()[_0xcd9d('0xe6')](0x0)['diff'](_0x17f943[_0xcd9d('0xe3')],'seconds');logger[_0xcd9d('0x92')](_0xcd9d('0xe7'),_0x44f33c[_0xcd9d('0x4e')],_0x17f943[_0xcd9d('0xe8')]);delete _0x17f943[_0xcd9d('0xe3')];}}}}catch(_0x205ba2){logger[_0xcd9d('0x3f')](_0xcd9d('0xe5'),_0x44f33c[_0xcd9d('0x4e')],util['inspect'](_0x205ba2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcd9d('0x26')]=function(_0x556c5d){try{if(this[_0xcd9d('0x64')](_0x556c5d)){logger[_0xcd9d('0x44')]('[%s][voiceQueueReport][newexten]\x20event:',_0x556c5d[_0xcd9d('0x4e')],util['inspect'](_0x556c5d,{'showHidden':![],'depth':null}));if(_0x556c5d[_0xcd9d('0xe9')][_0xcd9d('0xea')]()===_0xcd9d('0xeb')){_0x556c5d['applicationdata']=_0x556c5d[_0xcd9d('0xec')]&&_0x556c5d[_0xcd9d('0xec')][_0xcd9d('0xed')](_0xcd9d('0xee'))?_0x556c5d[_0xcd9d('0xec')]:(_0x556c5d[_0xcd9d('0xec')]||_0x556c5d[_0xcd9d('0xef')])['toLowerCase']();if(_[_0xcd9d('0xed')](_0x556c5d['applicationdata'][_0xcd9d('0xea')](),_0xcd9d('0xf0'))){logger['info'](_0xcd9d('0xf1'),_0x556c5d[_0xcd9d('0x4e')],_0x556c5d[_0xcd9d('0xe9')],_0x556c5d[_0xcd9d('0xef')]);if(_[_0xcd9d('0x77')](this[_0xcd9d('0x36')][_0x556c5d[_0xcd9d('0x4e')]]))this[_0xcd9d('0x36')][_0x556c5d[_0xcd9d('0x4e')]]={};var _0x472d97=_0x556c5d['applicationdata']['split']('=');var _0x52961c=_0x472d97[0x0]['toLowerCase']()[_0xcd9d('0xf2')](/cdr\((.*)\)/);if(_0x52961c)this['channels'][_0x556c5d[_0xcd9d('0x4e')]][_0x52961c[0x1]]=_0x472d97[0x1];}}}}catch(_0x51b33d){logger['error']('[%s][voiceQueueReport][newexten]',_0x556c5d['uniqueid'],util[_0xcd9d('0x3d')](_0x51b33d,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
index a6c35ba..cb576ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf155=['../client','createHistory','campaign','Request','CreateReportAgentPreview'];(function(_0x1c1f94,_0x4f72f7){var _0x445ead=function(_0x4c24da){while(--_0x4c24da){_0x1c1f94['push'](_0x1c1f94['shift']());}};_0x445ead(++_0x4f72f7);}(_0xf155,0x73));var _0x5f15=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0xf155[_0x3815c2];return _0x271f88;};'use strict';var client=require(_0x5f15('0x0'));exports[_0x5f15('0x1')]=function(_0x41e892){return function(){_0x41e892[_0x5f15('0x2')]=_0x41e892['queue'];return client[_0x5f15('0x3')]('CreateReportAgentPreview',{'body':_0x41e892,'log':_0x5f15('0x4')});};};
\ No newline at end of file
+var _0x0cb5=['createHistory','campaign','queue','Request','../client'];(function(_0x36d831,_0x6c602a){var _0x5bc013=function(_0x1b0e7f){while(--_0x1b0e7f){_0x36d831['push'](_0x36d831['shift']());}};_0x5bc013(++_0x6c602a);}(_0x0cb5,0x1bc));var _0x50cb=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x0cb5[_0x28d18d];return _0x470640;};'use strict';var client=require(_0x50cb('0x0'));exports[_0x50cb('0x1')]=function(_0x4fd172){return function(){_0x4fd172[_0x50cb('0x2')]=_0x4fd172[_0x50cb('0x3')];return client[_0x50cb('0x4')]('CreateReportAgentPreview',{'body':_0x4fd172,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index abf2adc..6e93ce8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b19=['CreateAttachment','../client','Request'];(function(_0x1adbbc,_0x2aae1d){var _0x954286=function(_0x2de7c2){while(--_0x2de7c2){_0x1adbbc['push'](_0x1adbbc['shift']());}};_0x954286(++_0x2aae1d);}(_0x6b19,0xf4));var _0x96b1=function(_0x10850e,_0x457e38){_0x10850e=_0x10850e-0x0;var _0x349ee5=_0x6b19[_0x10850e];return _0x349ee5;};'use strict';var client=require(_0x96b1('0x0'));exports['create']=function(_0x3dc1ab){return client[_0x96b1('0x1')]('CreateAttachment',{'body':_0x3dc1ab,'log':_0x96b1('0x2')});};
\ No newline at end of file
+var _0xcadc=['Request','CreateAttachment','create'];(function(_0xdeee35,_0x2ef5e0){var _0xb1c22=function(_0x4e9094){while(--_0x4e9094){_0xdeee35['push'](_0xdeee35['shift']());}};_0xb1c22(++_0x2ef5e0);}(_0xcadc,0x1a6));var _0xccad=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcadc[_0x4a9fb1];return _0x348672;};'use strict';var client=require('../client');exports[_0xccad('0x0')]=function(_0x1b8402){return client[_0xccad('0x1')](_0xccad('0x2'),{'body':_0x1b8402,'log':'CreateAttachment'});};
\ No newline at end of file
index 7a3b4d3..d20a42b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialPrefix','Trunk','callerid','TrunkBackup','Interval','Intervals','SquareProject','../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName'];(function(_0x367ec8,_0x543658){var _0x18f44b=function(_0x45054f){while(--_0x45054f){_0x367ec8['push'](_0x367ec8['shift']());}};_0x18f44b(++_0x543658);}(_0x326f,0xd1));var _0xf326=function(_0x1546ba,_0x143abf){_0x1546ba=_0x1546ba-0x0;var _0x299e49=_0x326f[_0x1546ba];return _0x299e49;};'use strict';var client=require(_0xf326('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'raw':![],'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9'),_0xf326('0xa'),'dialBusyMaxRetry',_0xf326('0xb'),_0xf326('0xc'),_0xf326('0xd'),_0xf326('0xe'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),'dialAgentRejectMaxRetry',_0xf326('0x14'),'dialTimezone',_0xf326('0x15'),'dialAMDActive',_0xf326('0x16'),'dialAMDGreeting',_0xf326('0x17'),_0xf326('0x18'),'dialAMDMinWordLength',_0xf326('0x19'),_0xf326('0x1a'),_0xf326('0x1b'),_0xf326('0x1c'),'dialOrderByScheduledAt',_0xf326('0x1d'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':_0xf326('0x1e'),'as':_0xf326('0x1e'),'attributes':['id',_0xf326('0x2'),_0xf326('0x1f'),_0xf326('0x4')]},{'model':_0xf326('0x1e'),'as':_0xf326('0x20'),'attributes':['id',_0xf326('0x2'),'callerid',_0xf326('0x4')]},{'model':_0xf326('0x21'),'as':_0xf326('0x21'),'attributes':['id',_0xf326('0x2')],'include':[{'model':_0xf326('0x21'),'as':_0xf326('0x22'),'attributes':['id','name','interval']}]},{'model':'SquareProject','as':_0xf326('0x23'),'attributes':['id',_0xf326('0x2')]}]},'log':'getCampaign'});};};
\ No newline at end of file
+var _0xdb28=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','name','callerid','Interval','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialTimezone','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt'];(function(_0x2fa798,_0xa6ff89){var _0xa913d5=function(_0x109c1f){while(--_0x109c1f){_0x2fa798['push'](_0x2fa798['shift']());}};_0xa913d5(++_0xa6ff89);}(_0xdb28,0x106));var _0x8db2=function(_0x23a352,_0x2d8342){_0x23a352=_0x23a352-0x0;var _0x347e8d=_0xdb28[_0x23a352];return _0x347e8d;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(){return client[_0x8db2('0x2')](_0x8db2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'dialOriginateTimeout',_0x8db2('0x9'),_0x8db2('0xa'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'dialAbandonedMaxRetry',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'dialAgentRejectMaxRetry',_0x8db2('0x15'),_0x8db2('0x16'),'dialGlobalInterval',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21'),_0x8db2('0x22')],'include':[{'model':_0x8db2('0x23'),'as':_0x8db2('0x23'),'attributes':['id',_0x8db2('0x24'),'callerid',_0x8db2('0x5')]},{'model':_0x8db2('0x23'),'as':'TrunkBackup','attributes':['id',_0x8db2('0x24'),_0x8db2('0x25'),_0x8db2('0x5')]},{'model':_0x8db2('0x26'),'as':_0x8db2('0x26'),'attributes':['id',_0x8db2('0x24')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x8db2('0x24'),_0x8db2('0x27')]}]},{'model':_0x8db2('0x28'),'as':_0x8db2('0x28'),'attributes':['id','name']}]},'log':_0x8db2('0x29')});};};
\ No newline at end of file
index 150bd00..f3e442b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06ae=['createContact','CreateCmContact','getContacts','GetCmContact','../client'];(function(_0x3de067,_0x40cb93){var _0x330cf9=function(_0x428c90){while(--_0x428c90){_0x3de067['push'](_0x3de067['shift']());}};_0x330cf9(++_0x40cb93);}(_0x06ae,0x18a));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xe06a('0x0'));exports[_0xe06a('0x1')]=function(_0x29a3fb){return function(){return client['Request'](_0xe06a('0x2'),{'body':_0x29a3fb,'log':_0xe06a('0x2')});};};exports[_0xe06a('0x3')]=function(_0x1e0041){return function(){return client['Request'](_0xe06a('0x4'),{'options':_0x1e0041,'log':'GetCmContact'});};};
\ No newline at end of file
+var _0x150d=['GetCmContact','../client','createContact','Request','CreateCmContact','getContacts'];(function(_0x36b11f,_0x299477){var _0x153cdf=function(_0x2cb41c){while(--_0x2cb41c){_0x36b11f['push'](_0x36b11f['shift']());}};_0x153cdf(++_0x299477);}(_0x150d,0x14b));var _0xd150=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0x150d[_0x3b0c9d];return _0xcfc8d7;};'use strict';var client=require(_0xd150('0x0'));exports[_0xd150('0x1')]=function(_0x321038){return function(){return client[_0xd150('0x2')]('CreateCmContact',{'body':_0x321038,'log':_0xd150('0x3')});};};exports[_0xd150('0x4')]=function(_0xc6d86f){return function(){return client['Request'](_0xd150('0x5'),{'options':_0xc6d86f,'log':_0xd150('0x5')});};};
\ No newline at end of file
index 5fd8e40..9c2203a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e0b=['CountReScheduled','countReScheduled','getContactPreview','GetCmHopperPreview','Agent','name','Queue','getCmHopper','unlockContact','getContactRecallMe','GetContactRecallMe','User','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','format','YYYY-MM-DD\x20HH:mm:ss','UpdateCmHopper','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','scheduledat','ASC','getContactDialerIvr','DESC','GetContactDialerIvr','campaign','MoveContactManagedDialer'];(function(_0x48715c,_0x5adccd){var _0x33da6=function(_0x4e02f8){while(--_0x4e02f8){_0x48715c['push'](_0x48715c['shift']());}};_0x33da6(++_0x5adccd);}(_0x8e0b,0xf6));var _0xb8e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e0b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb8e0('0x0'));var moment=require(_0xb8e0('0x1'));var _=require(_0xb8e0('0x2'));exports[_0xb8e0('0x3')]=function(_0xd2c0f0,_0xedd420){return function(){return client[_0xb8e0('0x4')](_0xb8e0('0x5'),{'options':{'where':{'VoiceQueueId':_0xd2c0f0},'include':[{'model':_0xb8e0('0x6'),'as':'Contact'}],'limit':_0xedd420,'raw':![]},'log':'getCmHopper'});};};exports['updateContacts']=function(_0x3e4978,_0x39ac6b,_0x3aad7f){return function(){return client[_0xb8e0('0x4')]('UpdateCmHopper',{'body':_0x3e4978,'options':{'where':{'VoiceQueueId':_0x39ac6b,'scheduledat':{'$lte':moment()[_0xb8e0('0x7')](_0xb8e0('0x8'))}},'limit':_0x3aad7f},'log':_0xb8e0('0x9')});};};exports[_0xb8e0('0xa')]=function(_0x16f049){return function(){return client['Request'](_0xb8e0('0x9'),{'body':_0x16f049,'options':{'where':{'ContactId':_0x16f049[_0xb8e0('0xb')],'ListId':_0x16f049[_0xb8e0('0xc')],'VoiceQueueId':_0x16f049[_0xb8e0('0xd')],'CampaignId':_0x16f049[_0xb8e0('0xe')]}},'log':_0xb8e0('0xa')});};};exports[_0xb8e0('0xf')]=function(_0x1fe9de,_0x1250fd,_0x36ed9b){return function(){return client[_0xb8e0('0x4')](_0xb8e0('0x10'),{'options':{'where':{'VoiceQueueId':_0x1fe9de,'ListId':_0x1250fd,'ContactId':_0x36ed9b}},'log':_0xb8e0('0x10')});};};exports[_0xb8e0('0x11')]=function(_0xf568d2,_0x4b4907,_0x5a0920,_0x56f942){return function(){return client['Request'](_0xb8e0('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0xf568d2,'active':![],'scheduledat':{'$lte':moment()['format'](_0xb8e0('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x4b4907}}]},'order':[[_0xb8e0('0x13'),'DESC'],[_0xb8e0('0x14'),_0x56f942],['id',_0xb8e0('0x15')]],'raw':!![],'limit':_0x5a0920},'log':_0xb8e0('0x12')});};};exports[_0xb8e0('0x16')]=function(_0x4b4afc,_0x57f8dd,_0x3dada6){return function(){return client[_0xb8e0('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x4b4afc,'active':![],'scheduledat':{'$lte':moment()['format'](_0xb8e0('0x8'))}},'include':[{'model':_0xb8e0('0x6'),'as':'Contact'}],'order':[[_0xb8e0('0x13'),_0xb8e0('0x17')],[_0xb8e0('0x14'),_0x3dada6],['id',_0xb8e0('0x15')]],'raw':!![],'limit':_0x57f8dd},'log':_0xb8e0('0x18')});};};exports['moveContactManagedDialer']=function(_0x1842f5,_0x434cd5){return function(){_0x1842f5[_0xb8e0('0x19')]=_0x1842f5['queue'];return client[_0xb8e0('0x4')](_0xb8e0('0x1a'),{'body':_0x1842f5,'options':{'where':{'ContactId':_0x1842f5[_0xb8e0('0xb')],'ListId':_0x1842f5[_0xb8e0('0xc')],'VoiceQueueId':_0x1842f5[_0xb8e0('0xd')],'CampaignId':_0x1842f5['CampaignId'],'active':_0x434cd5?undefined:!![]}},'log':_0xb8e0('0x1a')});};};exports['countReScheduled']=function(_0x42ced0){return function(){return client[_0xb8e0('0x4')](_0xb8e0('0x1b'),{'options':{'where':{'VoiceQueueId':_0x42ced0['id']?_0x42ced0['id']||null:null}},'log':_0xb8e0('0x1c')});};};exports[_0xb8e0('0x1d')]=function(_0x3522cb){return function(){return client['Request'](_0xb8e0('0x1e'),{'options':{'where':{'id':_0x3522cb},'include':[{'model':_0xb8e0('0x6'),'as':'Contact'},{'model':'User','as':_0xb8e0('0x1f'),'attributes':['id',_0xb8e0('0x20')]},{'model':'VoiceQueue','as':_0xb8e0('0x21'),'attributes':['id','name']}],'raw':!![]},'log':_0xb8e0('0x22')});};};exports[_0xb8e0('0x23')]=function(_0x4ea02e,_0x5792d6,_0x1ab223){return function(){return client[_0xb8e0('0x4')]('UpdateCmHopper',{'body':_0x4ea02e,'options':{'where':{'id':_0x5792d6},'limit':_0x1ab223},'log':_0xb8e0('0x9')});};};exports[_0xb8e0('0x24')]=function(_0x108767,_0x5636da){return function(){return client['Request'](_0xb8e0('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x108767,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xb8e0('0x7')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x5636da}},'order':[[_0xb8e0('0x13'),_0xb8e0('0x17')],[_0xb8e0('0x14'),'DESC'],['id','ASC']],'include':[{'model':'CmContact','as':'Contact'},{'model':_0xb8e0('0x26'),'as':'Agent','attributes':['id','name','voicePause']}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0xb8e0('0x12')});};};
\ No newline at end of file
+var _0x0947=['UpdateCmHopper','getContactRecallMe','GetContactRecallMe','voicePause','db.CmHopper.UserId','../client','lodash','getContacts','GetCmHopper','Contact','getCmHopper','updateContacts','Request','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','DestroyCmHopper','GetContactDialer','priority','DESC','scheduledat','ASC','CmContact','GetContactDialerIvr','moveContactManagedDialer','campaign','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','name','VoiceQueue','Queue','unlockContact'];(function(_0x4287fe,_0x14ad49){var _0x329a39=function(_0x3c30a9){while(--_0x3c30a9){_0x4287fe['push'](_0x4287fe['shift']());}};_0x329a39(++_0x14ad49);}(_0x0947,0x164));var _0x7094=function(_0x5d51c8,_0x29fe40){_0x5d51c8=_0x5d51c8-0x0;var _0x1652ac=_0x0947[_0x5d51c8];return _0x1652ac;};'use strict';var client=require(_0x7094('0x0'));var moment=require('moment');var _=require(_0x7094('0x1'));exports[_0x7094('0x2')]=function(_0x3ae51c,_0x51c960){return function(){return client['Request'](_0x7094('0x3'),{'options':{'where':{'VoiceQueueId':_0x3ae51c},'include':[{'model':'CmContact','as':_0x7094('0x4')}],'limit':_0x51c960,'raw':![]},'log':_0x7094('0x5')});};};exports[_0x7094('0x6')]=function(_0x424a6,_0xe0fbbb,_0x23cd52){return function(){return client[_0x7094('0x7')]('UpdateCmHopper',{'body':_0x424a6,'options':{'where':{'VoiceQueueId':_0xe0fbbb,'scheduledat':{'$lte':moment()[_0x7094('0x8')](_0x7094('0x9'))}},'limit':_0x23cd52},'log':'UpdateCmHopper'});};};exports[_0x7094('0xa')]=function(_0x1725df){return function(){return client[_0x7094('0x7')]('UpdateCmHopper',{'body':_0x1725df,'options':{'where':{'ContactId':_0x1725df[_0x7094('0xb')],'ListId':_0x1725df[_0x7094('0xc')],'VoiceQueueId':_0x1725df[_0x7094('0xd')],'CampaignId':_0x1725df[_0x7094('0xe')]}},'log':_0x7094('0xa')});};};exports['destroyContact']=function(_0x4b1f16,_0x2354e0,_0x17b7ea){return function(){return client[_0x7094('0x7')](_0x7094('0xf'),{'options':{'where':{'VoiceQueueId':_0x4b1f16,'ListId':_0x2354e0,'ContactId':_0x17b7ea}},'log':_0x7094('0xf')});};};exports['getContactDialer']=function(_0x382492,_0x46cc13,_0x300dce,_0x257174){return function(){return client[_0x7094('0x7')](_0x7094('0x10'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x382492,'active':![],'scheduledat':{'$lte':moment()[_0x7094('0x8')](_0x7094('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x46cc13}}]},'order':[[_0x7094('0x11'),_0x7094('0x12')],[_0x7094('0x13'),_0x257174],['id',_0x7094('0x14')]],'raw':!![],'limit':_0x300dce},'log':_0x7094('0x10')});};};exports['getContactDialerIvr']=function(_0x231e04,_0x3600fd,_0x5dcef4){return function(){return client['Request'](_0x7094('0x10'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x231e04,'active':![],'scheduledat':{'$lte':moment()[_0x7094('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x7094('0x15'),'as':_0x7094('0x4')}],'order':[[_0x7094('0x11'),_0x7094('0x12')],[_0x7094('0x13'),_0x5dcef4],['id','ASC']],'raw':!![],'limit':_0x3600fd},'log':_0x7094('0x16')});};};exports[_0x7094('0x17')]=function(_0x27bb29,_0xd41adb){return function(){_0x27bb29[_0x7094('0x18')]=_0x27bb29['queue'];return client[_0x7094('0x7')](_0x7094('0x19'),{'body':_0x27bb29,'options':{'where':{'ContactId':_0x27bb29[_0x7094('0xb')],'ListId':_0x27bb29[_0x7094('0xc')],'VoiceQueueId':_0x27bb29[_0x7094('0xd')],'CampaignId':_0x27bb29[_0x7094('0xe')],'active':_0xd41adb?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0x7094('0x1a')]=function(_0x53323f){return function(){return client[_0x7094('0x7')](_0x7094('0x1b'),{'options':{'where':{'VoiceQueueId':_0x53323f['id']?_0x53323f['id']||null:null}},'log':_0x7094('0x1a')});};};exports[_0x7094('0x1c')]=function(_0x54e267){return function(){return client['Request'](_0x7094('0x1d'),{'options':{'where':{'id':_0x54e267},'include':[{'model':_0x7094('0x15'),'as':_0x7094('0x4')},{'model':'User','as':'Agent','attributes':['id',_0x7094('0x1e')]},{'model':_0x7094('0x1f'),'as':_0x7094('0x20'),'attributes':['id',_0x7094('0x1e')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0x7094('0x21')]=function(_0x590e8c,_0x14033c,_0x5507ad){return function(){return client['Request'](_0x7094('0x22'),{'body':_0x590e8c,'options':{'where':{'id':_0x14033c},'limit':_0x5507ad},'log':_0x7094('0x22')});};};exports[_0x7094('0x23')]=function(_0x270519,_0x501c7f){return function(){return client[_0x7094('0x7')](_0x7094('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x270519,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x7094('0x8')](_0x7094('0x9'))},'UserId':{'$in':_0x501c7f}},'order':[[_0x7094('0x11'),'DESC'],[_0x7094('0x13'),_0x7094('0x12')],['id',_0x7094('0x14')]],'include':[{'model':_0x7094('0x15'),'as':_0x7094('0x4')},{'model':'User','as':'Agent','attributes':['id',_0x7094('0x1e'),_0x7094('0x25')]}],'group':_0x7094('0x26'),'raw':!![]},'log':_0x7094('0x10')});};};
\ No newline at end of file
index 44b9697..9be201d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x500c=['incrementPreviewCounters','IncrementPreviewCounters','../client','Request','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones'];(function(_0x526dcc,_0x175636){var _0x1ad34d=function(_0x38420f){while(--_0x38420f){_0x526dcc['push'](_0x526dcc['shift']());}};_0x1ad34d(++_0x175636);}(_0x500c,0xd4));var _0xc500=function(_0x3af25a,_0x18cf97){_0x3af25a=_0x3af25a-0x0;var _0x484e1d=_0x500c[_0x3af25a];return _0x484e1d;};'use strict';var client=require(_0xc500('0x0'));var moment=require('moment');exports['verifyAdditionalPhones']=function(_0x3d3462,_0x175e1a,_0x58b422){return function(){return client[_0xc500('0x1')](_0xc500('0x2'),{'body':_0x3d3462,'reason':_0x175e1a,'entity':_0x58b422,'log':_0xc500('0x2')});};};exports[_0xc500('0x3')]=function(_0x8e1baf,_0x204999,_0x5f2b37){return function(){return client['Request'](_0xc500('0x4'),{'body':_0x8e1baf,'duration':_0x204999,'waitTime':_0x5f2b37,'log':_0xc500('0x4')});};};exports[_0xc500('0x5')]=function(_0x1a534c){return function(){return client[_0xc500('0x1')](_0xc500('0x6'),{'body':_0x1a534c,'log':_0xc500('0x6')});};};
\ No newline at end of file
+var _0x2c51=['../client','verifyAdditionalPhones','Request','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters'];(function(_0x4c11f7,_0x5a0447){var _0x587d6b=function(_0x5b9bbf){while(--_0x5b9bbf){_0x4c11f7['push'](_0x4c11f7['shift']());}};_0x587d6b(++_0x5a0447);}(_0x2c51,0x70));var _0x12c5=function(_0x8ed096,_0xa5b784){_0x8ed096=_0x8ed096-0x0;var _0x35ac34=_0x2c51[_0x8ed096];return _0x35ac34;};'use strict';var client=require(_0x12c5('0x0'));var moment=require('moment');exports[_0x12c5('0x1')]=function(_0xd7682e,_0x4b28bc,_0x39cd41){return function(){return client[_0x12c5('0x2')](_0x12c5('0x3'),{'body':_0xd7682e,'reason':_0x4b28bc,'entity':_0x39cd41,'log':_0x12c5('0x3')});};};exports[_0x12c5('0x4')]=function(_0x48950b,_0x9dc9b2,_0x4836c8){return function(){return client[_0x12c5('0x2')]('SwapAdditionalPhones',{'body':_0x48950b,'duration':_0x9dc9b2,'waitTime':_0x4836c8,'log':_0x12c5('0x5')});};};exports[_0x12c5('0x6')]=function(_0x33b0d2){return function(){return client['Request']('IncrementPreviewCounters',{'body':_0x33b0d2,'log':_0x12c5('0x7')});};};
\ No newline at end of file
index 8fb19cf..7c67368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52f9=['VoiceQueueId','phone','Request','GetCmHopperBlackIvr','../client','checkIsBlackList','GetCmHopperBlack'];(function(_0xc6afa9,_0x3d98ca){var _0x3085db=function(_0xb36ba9){while(--_0xb36ba9){_0xc6afa9['push'](_0xc6afa9['shift']());}};_0x3085db(++_0x3d98ca);}(_0x52f9,0x66));var _0x952f=function(_0x9a23d2,_0x3de37c){_0x9a23d2=_0x9a23d2-0x0;var _0x40a209=_0x52f9[_0x9a23d2];return _0x40a209;};'use strict';var client=require(_0x952f('0x0'));exports[_0x952f('0x1')]=function(_0x5e4a6e){return function(){return client['Request'](_0x952f('0x2'),{'options':{'where':{'VoiceQueueId':_0x5e4a6e[_0x952f('0x3')],'phone':_0x5e4a6e[_0x952f('0x4')]},'raw':![]},'log':_0x952f('0x2')});};};exports['checkIsBlackListIvr']=function(_0x297e17){return function(){return client[_0x952f('0x5')](_0x952f('0x2'),{'options':{'where':{'CampaignId':_0x297e17['CampaignId'],'phone':_0x297e17[_0x952f('0x4')]},'raw':![]},'log':_0x952f('0x6')});};};
\ No newline at end of file
+var _0xd5f0=['GetCmHopperBlack','VoiceQueueId','CampaignId','checkIsBlackList','Request'];(function(_0x36f37b,_0x36ea03){var _0x249634=function(_0x1cde21){while(--_0x1cde21){_0x36f37b['push'](_0x36f37b['shift']());}};_0x249634(++_0x36ea03);}(_0xd5f0,0x15c));var _0x0d5f=function(_0x312f7e,_0x2ec44c){_0x312f7e=_0x312f7e-0x0;var _0xbb894=_0xd5f0[_0x312f7e];return _0xbb894;};'use strict';var client=require('../client');exports[_0x0d5f('0x0')]=function(_0x1326d1){return function(){return client[_0x0d5f('0x1')](_0x0d5f('0x2'),{'options':{'where':{'VoiceQueueId':_0x1326d1[_0x0d5f('0x3')],'phone':_0x1326d1['phone']},'raw':![]},'log':_0x0d5f('0x2')});};};exports['checkIsBlackListIvr']=function(_0x3924f3){return function(){return client[_0x0d5f('0x1')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x3924f3[_0x0d5f('0x4')],'phone':_0x3924f3['phone']},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
index faf876c..d02703e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb01c=['campaign','queue','Request','CreateCmHopperFinal','createContact'];(function(_0x4a2b3c,_0xc69f59){var _0x4b081b=function(_0x3dfcb1){while(--_0x3dfcb1){_0x4a2b3c['push'](_0x4a2b3c['shift']());}};_0x4b081b(++_0xc69f59);}(_0xb01c,0x1c6));var _0xcb01=function(_0x4f97f3,_0x482509){_0x4f97f3=_0x4f97f3-0x0;var _0x20205b=_0xb01c[_0x4f97f3];return _0x20205b;};'use strict';var client=require('../client');exports[_0xcb01('0x0')]=function(_0x475c82){return function(){_0x475c82[_0xcb01('0x1')]=_0x475c82[_0xcb01('0x2')];return client[_0xcb01('0x3')](_0xcb01('0x4'),{'body':_0x475c82,'log':_0xcb01('0x4')});};};
\ No newline at end of file
+var _0x38f6=['../client','createContact','campaign','queue','CreateCmHopperFinal'];(function(_0x1c8655,_0x4a496f){var _0xc26242=function(_0x584437){while(--_0x584437){_0x1c8655['push'](_0x1c8655['shift']());}};_0xc26242(++_0x4a496f);}(_0x38f6,0x1bd));var _0x638f=function(_0x3dcbad,_0x440cf2){_0x3dcbad=_0x3dcbad-0x0;var _0x1b533b=_0x38f6[_0x3dcbad];return _0x1b533b;};'use strict';var client=require(_0x638f('0x0'));exports[_0x638f('0x1')]=function(_0x1f3c88){return function(){_0x1f3c88[_0x638f('0x2')]=_0x1f3c88[_0x638f('0x3')];return client['Request']('CreateCmHopperFinal',{'body':_0x1f3c88,'log':_0x638f('0x4')});};};
\ No newline at end of file
index 217d2f5..ef381a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x378c=['endOf','getCampaignHopperHistory','startOf','ivr','GetCampaignHopperHistory','../client','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetVoiceQueueHopperHistory','day'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x378c,0x10f));var _0xc378=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x378c[_0x39096d];return _0x13da4f;};'use strict';var client=require(_0xc378('0x0'));var moment=require(_0xc378('0x1'));exports[_0xc378('0x2')]=function(_0x3fb021){return function(){_0x3fb021[_0xc378('0x3')]=_0x3fb021[_0xc378('0x4')];return client[_0xc378('0x5')](_0xc378('0x6'),{'body':_0x3fb021,'log':_0xc378('0x6')});};};exports[_0xc378('0x7')]=function(_0x47ca0a){return function(){return client['Request']('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0xc378('0x8')](_0x47ca0a,_0xc378('0x9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc378('0xa')](_0xc378('0xb'))]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports['getVoiceQueueHopperHistory']=function(_0x59dc3e){return function(){return client[_0xc378('0x5')](_0xc378('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xc378('0xd'))[_0xc378('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc378('0xe')](_0xc378('0xd'))[_0xc378('0xa')](_0xc378('0xb'))]},'campaigntype':'queue'},'raw':![]},'log':_0xc378('0xc')});};};exports[_0xc378('0xf')]=function(_0x4441e3){return function(){return client['Request']('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xc378('0x10')](_0xc378('0xd'))[_0xc378('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc378('0xe')](_0xc378('0xd'))[_0xc378('0xa')](_0xc378('0xb'))]},'campaigntype':_0xc378('0x11')},'raw':![]},'log':_0xc378('0x12')});};};
\ No newline at end of file
+var _0x6519=['Request','CreateCmHopperHistory','avgHandleTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','GetCampaignHopperHistory','ivr','../client','campaign','queue'];(function(_0x2e9d49,_0x50d9ff){var _0x5300b5=function(_0x213fdd){while(--_0x213fdd){_0x2e9d49['push'](_0x2e9d49['shift']());}};_0x5300b5(++_0x50d9ff);}(_0x6519,0xfd));var _0x9651=function(_0x514846,_0x34ac8d){_0x514846=_0x514846-0x0;var _0x2627a8=_0x6519[_0x514846];return _0x2627a8;};'use strict';var client=require(_0x9651('0x0'));var moment=require('moment');exports['createHistory']=function(_0x19a01a){return function(){_0x19a01a[_0x9651('0x1')]=_0x19a01a[_0x9651('0x2')];return client[_0x9651('0x3')](_0x9651('0x4'),{'body':_0x19a01a,'log':_0x9651('0x4')});};};exports[_0x9651('0x5')]=function(_0x2d21a2){return function(){return client[_0x9651('0x3')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0x9651('0x6')](_0x2d21a2,'minutes')[_0x9651('0x7')](_0x9651('0x8')),moment()[_0x9651('0x7')](_0x9651('0x8'))]}},'raw':![]},'log':_0x9651('0x9')});};};exports['getVoiceQueueHopperHistory']=function(_0x5a23bc){return function(){return client[_0x9651('0x3')](_0x9651('0xa'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x9651('0xb')](_0x9651('0xc'))[_0x9651('0x7')](_0x9651('0x8')),moment()[_0x9651('0xd')](_0x9651('0xc'))[_0x9651('0x7')](_0x9651('0x8'))]},'campaigntype':_0x9651('0x2')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports['getCampaignHopperHistory']=function(_0x4547db){return function(){return client[_0x9651('0x3')](_0x9651('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x9651('0xb')](_0x9651('0xc'))[_0x9651('0x7')](_0x9651('0x8')),moment()[_0x9651('0xd')](_0x9651('0xc'))[_0x9651('0x7')](_0x9651('0x8'))]},'campaigntype':_0x9651('0xf')},'raw':![]},'log':_0x9651('0xe')});};};
\ No newline at end of file
index 6563001..af4c31a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa93a=['Trunk','name','notify','NotifyFaxAccount','Request','description','headerinfo','minrate','maxrate','modem','gateway','faxdetect','tech','TrunkId','key'];(function(_0x16825f,_0x4f472f){var _0x3633bf=function(_0x48e939){while(--_0x48e939){_0x16825f['push'](_0x16825f['shift']());}};_0x3633bf(++_0x4f472f);}(_0xa93a,0xb8));var _0xaa93=function(_0xf3f47c,_0x5b3279){_0xf3f47c=_0xf3f47c-0x0;var _0x1172d7=_0xa93a[_0xf3f47c];return _0x1172d7;};'use strict';var client=require('../client');exports['getFaxAccounts']=function(){return function(){return client[_0xaa93('0x0')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id','name',_0xaa93('0x1'),'ecm',_0xaa93('0x2'),'localstationid',_0xaa93('0x3'),_0xaa93('0x4'),_0xaa93('0x5'),_0xaa93('0x6'),_0xaa93('0x7'),'t38timeout',_0xaa93('0x8'),_0xaa93('0x9'),'ListId',_0xaa93('0xa')],'include':[{'model':'Trunk','as':_0xaa93('0xb'),'attributes':['id',_0xaa93('0xc'),'callerid','active']}]},'log':'getFaxAccount'});};};exports[_0xaa93('0xd')]=function(_0x521bfe,_0x17f929){return client[_0xaa93('0x0')](_0xaa93('0xe'),{'account':{'id':_0x521bfe},'body':_0x17f929,'log':'NotifyFaxAccount'});};
\ No newline at end of file
+var _0xfb11=['faxdetect','tech','TrunkId','ListId','key','Trunk','name','callerid','active','getFaxAccount','NotifyFaxAccount','../client','Request','GetFaxAccount','description','headerinfo','minrate','maxrate','gateway'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xfb11[_0x4d07cc];return _0x42de3b;};'use strict';var client=require(_0x1fb1('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0x1fb1('0x1')](_0x1fb1('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1fb1('0x3'),'ecm',_0x1fb1('0x4'),'localstationid',_0x1fb1('0x5'),_0x1fb1('0x6'),'modem',_0x1fb1('0x7'),_0x1fb1('0x8'),'t38timeout',_0x1fb1('0x9'),_0x1fb1('0xa'),_0x1fb1('0xb'),_0x1fb1('0xc')],'include':[{'model':_0x1fb1('0xd'),'as':_0x1fb1('0xd'),'attributes':['id',_0x1fb1('0xe'),_0x1fb1('0xf'),_0x1fb1('0x10')]}]},'log':_0x1fb1('0x11')});};};exports['notify']=function(_0x232036,_0x53f30e){return client[_0x1fb1('0x1')]('NotifyFaxAccount',{'account':{'id':_0x232036},'body':_0x53f30e,'log':_0x1fb1('0x12')});};
\ No newline at end of file
index 13e4f29..588eea5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15d2=['UpdateFaxMessage','../client','update'];(function(_0x5cabac,_0x5ccb08){var _0x5f47b8=function(_0x1e478b){while(--_0x1e478b){_0x5cabac['push'](_0x5cabac['shift']());}};_0x5f47b8(++_0x5ccb08);}(_0x15d2,0xaf));var _0x215d=function(_0x4c6cf0,_0x826f70){_0x4c6cf0=_0x4c6cf0-0x0;var _0x108145=_0x15d2[_0x4c6cf0];return _0x108145;};'use strict';var client=require(_0x215d('0x0'));exports[_0x215d('0x1')]=function(_0x1dea48,_0x535efa){return client['Request'](_0x215d('0x2'),{'body':_0x535efa,'options':{'where':{'AttachmentId':_0x1dea48}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0x5cf1=['Request','UpdateFaxMessage','../client','update'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x5cf1,0xee));var _0x15cf=function(_0x57baa6,_0x3af298){_0x57baa6=_0x57baa6-0x0;var _0x303fbf=_0x5cf1[_0x57baa6];return _0x303fbf;};'use strict';var client=require(_0x15cf('0x0'));exports[_0x15cf('0x1')]=function(_0x5be446,_0x32d9cd){return client[_0x15cf('0x2')](_0x15cf('0x3'),{'body':_0x32d9cd,'options':{'where':{'AttachmentId':_0x5be446}},'log':_0x15cf('0x3')});};
\ No newline at end of file
index 7ed3cc1..fe4f45c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cfa=['DeskConfiguration','Configurations','Variable','DeskField','Descriptions','content','key','keyType','variableName','Fields','idField','customField','Tag','../../client','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','authType','type','serverUrl'];(function(_0x1cf25c,_0x43f29e){var _0x17cbc6=function(_0x48b905){while(--_0x48b905){_0x1cf25c['push'](_0x1cf25c['shift']());}};_0x17cbc6(++_0x43f29e);}(_0x5cfa,0x139));var _0xa5cf=function(_0x6a57f1,_0xdac6fc){_0x6a57f1=_0x6a57f1-0x0;var _0x36db94=_0x5cfa[_0x6a57f1];return _0x36db94;};'use strict';var client=require(_0xa5cf('0x0'));exports[_0xa5cf('0x1')]=function(){return function(_0x39db46){return client[_0xa5cf('0x2')](_0xa5cf('0x3'),{'options':{'raw':![],'attributes':['id',_0xa5cf('0x4'),_0xa5cf('0x5'),_0xa5cf('0x6'),_0xa5cf('0x7'),_0xa5cf('0x8'),_0xa5cf('0x9'),_0xa5cf('0xa'),_0xa5cf('0xb')],'include':[{'model':_0xa5cf('0xc'),'as':_0xa5cf('0xd'),'attributes':['id','name'],'include':[{'model':'DeskField','as':'Subjects','attributes':['id','type','content','variableName'],'include':[{'model':_0xa5cf('0xe'),'as':'Variable','attributes':['id','name']}]},{'model':_0xa5cf('0xf'),'as':_0xa5cf('0x10'),'attributes':['id',_0xa5cf('0xa'),_0xa5cf('0x11'),_0xa5cf('0x12'),_0xa5cf('0x13'),'keyContent',_0xa5cf('0x14')],'include':[{'model':_0xa5cf('0xe'),'as':_0xa5cf('0xe'),'attributes':['id',_0xa5cf('0x4')]}]},{'model':'DeskField','as':_0xa5cf('0x15'),'attributes':['id',_0xa5cf('0xa'),_0xa5cf('0x11'),_0xa5cf('0x16'),'nameField',_0xa5cf('0x17'),_0xa5cf('0x14')],'include':[{'model':_0xa5cf('0xe'),'as':_0xa5cf('0xe'),'attributes':['id','name']}]},{'model':_0xa5cf('0x18'),'as':'Tags','attributes':['id','name']}]}]},'log':_0xa5cf('0x3')});};};
\ No newline at end of file
+var _0x0066=['GetDeskAccount','name','username','password','type','serverUrl','DeskConfiguration','Configurations','content','variableName','Variable','DeskField','Descriptions','key','keyType','Fields','idField','customField','Tags','../../client','getDeskAccounts','Request'];(function(_0x1daff0,_0x27acfa){var _0xc3e54f=function(_0x1c2edb){while(--_0x1c2edb){_0x1daff0['push'](_0x1daff0['shift']());}};_0xc3e54f(++_0x27acfa);}(_0x0066,0xc3));var _0x6006=function(_0x1d8522,_0x4cb51f){_0x1d8522=_0x1d8522-0x0;var _0x340c9e=_0x0066[_0x1d8522];return _0x340c9e;};'use strict';var client=require(_0x6006('0x0'));exports[_0x6006('0x1')]=function(){return function(_0x3fd3f7){return client[_0x6006('0x2')](_0x6006('0x3'),{'options':{'raw':![],'attributes':['id',_0x6006('0x4'),'description',_0x6006('0x5'),_0x6006('0x6'),'remoteUri','authType',_0x6006('0x7'),_0x6006('0x8')],'include':[{'model':_0x6006('0x9'),'as':_0x6006('0xa'),'attributes':['id','name'],'include':[{'model':'DeskField','as':'Subjects','attributes':['id',_0x6006('0x7'),_0x6006('0xb'),_0x6006('0xc')],'include':[{'model':_0x6006('0xd'),'as':_0x6006('0xd'),'attributes':['id',_0x6006('0x4')]}]},{'model':_0x6006('0xe'),'as':_0x6006('0xf'),'attributes':['id',_0x6006('0x7'),'content',_0x6006('0x10'),_0x6006('0x11'),'keyContent',_0x6006('0xc')],'include':[{'model':_0x6006('0xd'),'as':_0x6006('0xd'),'attributes':['id',_0x6006('0x4')]}]},{'model':_0x6006('0xe'),'as':_0x6006('0x12'),'attributes':['id',_0x6006('0x7'),'content',_0x6006('0x13'),'nameField',_0x6006('0x14'),_0x6006('0xc')],'include':[{'model':_0x6006('0xd'),'as':_0x6006('0xd'),'attributes':['id',_0x6006('0x4')]}]},{'model':'Tag','as':_0x6006('0x15'),'attributes':['id',_0x6006('0x4')]}]}]},'log':_0x6006('0x3')});};};
\ No newline at end of file
index b8bce31..4a0d265 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ad1=['serverUrl','description','Dynamics365Configuration','Configurations','ticketType','Dynamics365Field','Subjects','type','content','variableName','Descriptions','key','keyType','keyContent','Variable','Fields','idField','nameField','customField','../../client','getDynamics365Accounts','Request','GetDynamics365Account','name','username','password','remoteUri','tenantId','clientSecret'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1ad1,0xde));var _0x11ad=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x1ad1[_0x31e29a];return _0x32d892;};'use strict';var client=require(_0x11ad('0x0'));exports[_0x11ad('0x1')]=function(){return function(_0x3d1b21){return client[_0x11ad('0x2')](_0x11ad('0x3'),{'options':{'raw':![],'attributes':['id',_0x11ad('0x4'),_0x11ad('0x5'),_0x11ad('0x6'),_0x11ad('0x7'),_0x11ad('0x8'),'clientId',_0x11ad('0x9'),_0x11ad('0xa'),_0x11ad('0xb')],'include':[{'model':_0x11ad('0xc'),'as':_0x11ad('0xd'),'attributes':['id',_0x11ad('0x4'),_0x11ad('0xe')],'include':[{'model':_0x11ad('0xf'),'as':_0x11ad('0x10'),'attributes':['id',_0x11ad('0x11'),_0x11ad('0x12'),_0x11ad('0x13')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x11ad('0x4')]}]},{'model':_0x11ad('0xf'),'as':_0x11ad('0x14'),'attributes':['id',_0x11ad('0x11'),_0x11ad('0x12'),_0x11ad('0x15'),_0x11ad('0x16'),_0x11ad('0x17'),_0x11ad('0x13')],'include':[{'model':_0x11ad('0x18'),'as':'Variable','attributes':['id','name']}]},{'model':_0x11ad('0xf'),'as':_0x11ad('0x19'),'attributes':['id','type',_0x11ad('0x12'),_0x11ad('0x1a'),_0x11ad('0x1b'),_0x11ad('0x1c'),_0x11ad('0x13')],'include':[{'model':_0x11ad('0x18'),'as':'Variable','attributes':['id',_0x11ad('0x4')]}]}]}]},'log':_0x11ad('0x3')});};};
\ No newline at end of file
+var _0xcc97=['serverUrl','description','Dynamics365Configuration','Configurations','ticketType','Dynamics365Field','type','variableName','Descriptions','content','key','keyContent','Variable','Fields','idField','customField','GetDynamics365Account','../../client','Request','name','username','password','tenantId','clientId'];(function(_0x11ee99,_0xa743ed){var _0x469072=function(_0xdaef8){while(--_0xdaef8){_0x11ee99['push'](_0x11ee99['shift']());}};_0x469072(++_0xa743ed);}(_0xcc97,0x1f1));var _0x7cc9=function(_0x3ed959,_0x48ec59){_0x3ed959=_0x3ed959-0x0;var _0x38aecf=_0xcc97[_0x3ed959];return _0x38aecf;};'use strict';var client=require(_0x7cc9('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x123947){return client[_0x7cc9('0x1')]('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x7cc9('0x2'),_0x7cc9('0x3'),_0x7cc9('0x4'),'remoteUri',_0x7cc9('0x5'),_0x7cc9('0x6'),'clientSecret',_0x7cc9('0x7'),_0x7cc9('0x8')],'include':[{'model':_0x7cc9('0x9'),'as':_0x7cc9('0xa'),'attributes':['id',_0x7cc9('0x2'),_0x7cc9('0xb')],'include':[{'model':_0x7cc9('0xc'),'as':'Subjects','attributes':['id',_0x7cc9('0xd'),'content',_0x7cc9('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x7cc9('0x2')]}]},{'model':_0x7cc9('0xc'),'as':_0x7cc9('0xf'),'attributes':['id',_0x7cc9('0xd'),_0x7cc9('0x10'),_0x7cc9('0x11'),'keyType',_0x7cc9('0x12'),'variableName'],'include':[{'model':_0x7cc9('0x13'),'as':_0x7cc9('0x13'),'attributes':['id','name']}]},{'model':_0x7cc9('0xc'),'as':_0x7cc9('0x14'),'attributes':['id',_0x7cc9('0xd'),_0x7cc9('0x10'),_0x7cc9('0x15'),'nameField',_0x7cc9('0x16'),_0x7cc9('0xe')],'include':[{'model':_0x7cc9('0x13'),'as':_0x7cc9('0x13'),'attributes':['id',_0x7cc9('0x2')]}]}]}]},'log':_0x7cc9('0x17')});};};
\ No newline at end of file
index 01e7f3d..41f9606 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6215=['type','content','Variable','key','keyContent','variableName','Fields','idField','customField','../../client','getFreshdeskAccounts','GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl','FreshdeskField','Subjects'];(function(_0x454e6d,_0x1e1f38){var _0x4bc294=function(_0x2c803a){while(--_0x2c803a){_0x454e6d['push'](_0x454e6d['shift']());}};_0x4bc294(++_0x1e1f38);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5621('0x0'));exports[_0x5621('0x1')]=function(){return function(_0xb81f60){return client['Request'](_0x5621('0x2'),{'options':{'raw':![],'attributes':['id',_0x5621('0x3'),_0x5621('0x4'),_0x5621('0x5'),_0x5621('0x6'),_0x5621('0x7')],'include':[{'model':'FreshdeskConfiguration','as':'Configurations','attributes':['id','name'],'include':[{'model':'Tag','attributes':['id',_0x5621('0x3')]},{'model':_0x5621('0x8'),'as':_0x5621('0x9'),'attributes':['id',_0x5621('0xa'),_0x5621('0xb'),'variableName'],'include':[{'model':_0x5621('0xc'),'as':_0x5621('0xc'),'attributes':['id',_0x5621('0x3')]}]},{'model':_0x5621('0x8'),'as':'Descriptions','attributes':['id',_0x5621('0xa'),_0x5621('0xb'),_0x5621('0xd'),'keyType',_0x5621('0xe'),_0x5621('0xf')],'include':[{'model':_0x5621('0xc'),'as':_0x5621('0xc'),'attributes':['id',_0x5621('0x3')]}]},{'model':_0x5621('0x8'),'as':_0x5621('0x10'),'attributes':['id',_0x5621('0xa'),_0x5621('0xb'),_0x5621('0x11'),'nameField',_0x5621('0x12'),_0x5621('0xf')],'include':[{'model':_0x5621('0xc'),'as':'Variable','attributes':['id',_0x5621('0x3')]}]}]}]},'log':_0x5621('0x2')});};};
\ No newline at end of file
+var _0xdacc=['apiKey','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content','variableName','Variable','Descriptions','key','keyContent','idField','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0xdacc,0x14f));var _0xcdac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdacc[_0x14add3];return _0x4a174f;};'use strict';var client=require('../../client');exports[_0xcdac('0x0')]=function(){return function(_0x1e167f){return client[_0xcdac('0x1')](_0xcdac('0x2'),{'options':{'raw':![],'attributes':['id',_0xcdac('0x3'),_0xcdac('0x4'),_0xcdac('0x5'),'remoteUri',_0xcdac('0x6')],'include':[{'model':_0xcdac('0x7'),'as':_0xcdac('0x8'),'attributes':['id',_0xcdac('0x3')],'include':[{'model':_0xcdac('0x9'),'attributes':['id',_0xcdac('0x3')]},{'model':_0xcdac('0xa'),'as':_0xcdac('0xb'),'attributes':['id',_0xcdac('0xc'),_0xcdac('0xd'),_0xcdac('0xe')],'include':[{'model':_0xcdac('0xf'),'as':_0xcdac('0xf'),'attributes':['id',_0xcdac('0x3')]}]},{'model':_0xcdac('0xa'),'as':_0xcdac('0x10'),'attributes':['id','type',_0xcdac('0xd'),_0xcdac('0x11'),'keyType',_0xcdac('0x12'),_0xcdac('0xe')],'include':[{'model':_0xcdac('0xf'),'as':_0xcdac('0xf'),'attributes':['id',_0xcdac('0x3')]}]},{'model':'FreshdeskField','as':'Fields','attributes':['id',_0xcdac('0xc'),'content',_0xcdac('0x13'),'nameField','customField',_0xcdac('0xe')],'include':[{'model':_0xcdac('0xf'),'as':_0xcdac('0xf'),'attributes':['id',_0xcdac('0x3')]}]}]}]},'log':_0xcdac('0x2')});};};
\ No newline at end of file
index 41bf9d8..79b961a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['variableName','Variable','FreshsalesField','Descriptions','keyType','keyContent','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','apiKey','remoteUri','FreshsalesConfiguration','Configurations','Subjects','type','content'];(function(_0x5e4a6a,_0x287632){var _0xc8879f=function(_0x4a5f5a){while(--_0x4a5f5a){_0x5e4a6a['push'](_0x5e4a6a['shift']());}};_0xc8879f(++_0x287632);}(_0x2ef3,0xba));var _0x32ef=function(_0x1d4c96,_0x280883){_0x1d4c96=_0x1d4c96-0x0;var _0x1a2d71=_0x2ef3[_0x1d4c96];return _0x1a2d71;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(_0x47513a){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),'username',_0x32ef('0x5'),_0x32ef('0x6'),'serverUrl'],'include':[{'model':_0x32ef('0x7'),'as':_0x32ef('0x8'),'attributes':['id','name'],'include':[{'model':'FreshsalesField','as':_0x32ef('0x9'),'attributes':['id',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':_0x32ef('0xd'),'attributes':['id',_0x32ef('0x4')]}]},{'model':_0x32ef('0xe'),'as':_0x32ef('0xf'),'attributes':['id',_0x32ef('0xa'),'content','key',_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':'Variable','attributes':['id',_0x32ef('0x4')]}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
+var _0x4317=['Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','GetFreshsalesccount','getFreshsalesAccounts','Request','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','FreshsalesField'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x4317,0x7c));var _0x7431=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4317[_0x2b4411];return _0x8e41ef;};'use strict';var client=require('../../client');exports[_0x7431('0x0')]=function(){return function(_0x2b8bbf){return client[_0x7431('0x1')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x7431('0x2'),_0x7431('0x3'),_0x7431('0x4'),_0x7431('0x5'),_0x7431('0x6')],'include':[{'model':_0x7431('0x7'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0x7431('0x8'),'as':_0x7431('0x9'),'attributes':['id',_0x7431('0xa'),_0x7431('0xb'),_0x7431('0xc')],'include':[{'model':_0x7431('0xd'),'as':_0x7431('0xd'),'attributes':['id',_0x7431('0x2')]}]},{'model':_0x7431('0x8'),'as':_0x7431('0xe'),'attributes':['id',_0x7431('0xa'),_0x7431('0xb'),_0x7431('0xf'),_0x7431('0x10'),_0x7431('0x11'),_0x7431('0xc')],'include':[{'model':_0x7431('0xd'),'as':_0x7431('0xd'),'attributes':['id',_0x7431('0x2')]}]}]}]},'log':_0x7431('0x12')});};};
\ No newline at end of file
index 26446d7..a3248ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffc0=['GetSalesforceAccount','name','username','password','remoteUri','clientId','securityToken','serverUrl','type','moduleSearch','moduleCreate','ticketType','additionalSearchAccount','additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','getSalesforceAccounts','Request'];(function(_0x5f10f6,_0x43d860){var _0x50abb2=function(_0x58dec0){while(--_0x58dec0){_0x5f10f6['push'](_0x5f10f6['shift']());}};_0x50abb2(++_0x43d860);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x483e91,_0x440057){_0x483e91=_0x483e91-0x0;var _0x52b5a3=_0xffc0[_0x483e91];return _0x52b5a3;};'use strict';var client=require('../../client');exports[_0x0ffc('0x0')]=function(){return function(_0x5c31d9){return client[_0x0ffc('0x1')](_0x0ffc('0x2'),{'options':{'raw':![],'attributes':['id',_0x0ffc('0x3'),_0x0ffc('0x4'),_0x0ffc('0x5'),_0x0ffc('0x6'),_0x0ffc('0x7'),'clientSecret',_0x0ffc('0x8'),_0x0ffc('0x9'),_0x0ffc('0xa')],'include':[{'model':'SalesforceConfiguration','as':'Configurations','attributes':['id',_0x0ffc('0x3'),_0x0ffc('0xb'),_0x0ffc('0xc'),_0x0ffc('0xd'),'leadId',_0x0ffc('0xe'),_0x0ffc('0xf'),_0x0ffc('0x10')],'include':[{'model':_0x0ffc('0x11'),'as':_0x0ffc('0x12'),'include':[{'model':_0x0ffc('0x13'),'as':_0x0ffc('0x13'),'attributes':['id',_0x0ffc('0x3')]}]},{'model':'SalesforceField','as':_0x0ffc('0x14'),'include':[{'model':_0x0ffc('0x13'),'as':'Variable','attributes':['id',_0x0ffc('0x3')]}]},{'model':_0x0ffc('0x11'),'as':_0x0ffc('0x15'),'include':[{'model':'Variable','as':_0x0ffc('0x13'),'attributes':['id',_0x0ffc('0x3')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0x33d2=['ticketType','leadId','additionalSearchContact','SalesforceField','Variable','Descriptions','Fields','../../client','getSalesforceAccounts','GetSalesforceAccount','name','password','remoteUri','clientId','clientSecret','securityToken','serverUrl','type','SalesforceConfiguration','moduleCreate'];(function(_0x7f045d,_0x2c81f0){var _0xf8e4cb=function(_0x256e8f){while(--_0x256e8f){_0x7f045d['push'](_0x7f045d['shift']());}};_0xf8e4cb(++_0x2c81f0);}(_0x33d2,0x7f));var _0x233d=function(_0x526631,_0x36130d){_0x526631=_0x526631-0x0;var _0x3c0945=_0x33d2[_0x526631];return _0x3c0945;};'use strict';var client=require(_0x233d('0x0'));exports[_0x233d('0x1')]=function(){return function(_0x54d233){return client['Request'](_0x233d('0x2'),{'options':{'raw':![],'attributes':['id',_0x233d('0x3'),'username',_0x233d('0x4'),_0x233d('0x5'),_0x233d('0x6'),_0x233d('0x7'),_0x233d('0x8'),_0x233d('0x9'),_0x233d('0xa')],'include':[{'model':_0x233d('0xb'),'as':'Configurations','attributes':['id',_0x233d('0x3'),'moduleSearch',_0x233d('0xc'),_0x233d('0xd'),_0x233d('0xe'),'additionalSearchAccount',_0x233d('0xf'),'additionalSearchLead'],'include':[{'model':_0x233d('0x10'),'as':'Subjects','include':[{'model':_0x233d('0x11'),'as':_0x233d('0x11'),'attributes':['id',_0x233d('0x3')]}]},{'model':'SalesforceField','as':_0x233d('0x12'),'include':[{'model':_0x233d('0x11'),'as':'Variable','attributes':['id',_0x233d('0x3')]}]},{'model':_0x233d('0x10'),'as':_0x233d('0x13'),'include':[{'model':_0x233d('0x11'),'as':_0x233d('0x11'),'attributes':['id',_0x233d('0x3')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
index 645d7af..cb8c5c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['variableName','Variable','Descriptions','key','keyContent','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','name','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','ServicenowField','type','content'];(function(_0x520d02,_0x214bcd){var _0x5c1a53=function(_0x16b472){while(--_0x16b472){_0x520d02['push'](_0x520d02['shift']());}};_0x5c1a53(++_0x214bcd);}(_0x814b,0x1a2));var _0xb814=function(_0x3a93b7,_0x658183){_0x3a93b7=_0x3a93b7-0x0;var _0x2ed891=_0x814b[_0x3a93b7];return _0x2ed891;};'use strict';var client=require(_0xb814('0x0'));exports[_0xb814('0x1')]=function(){return function(_0x434f30){return client[_0xb814('0x2')](_0xb814('0x3'),{'options':{'raw':![],'attributes':['id',_0xb814('0x4'),'description',_0xb814('0x5'),_0xb814('0x6'),_0xb814('0x7'),_0xb814('0x8'),_0xb814('0x9')],'include':[{'model':_0xb814('0xa'),'as':'Configurations','attributes':['id',_0xb814('0x4')],'include':[{'model':_0xb814('0xb'),'as':'Subjects','attributes':['id',_0xb814('0xc'),_0xb814('0xd'),_0xb814('0xe')],'include':[{'model':_0xb814('0xf'),'as':_0xb814('0xf'),'attributes':['id',_0xb814('0x4')]}]},{'model':_0xb814('0xb'),'as':_0xb814('0x10'),'attributes':['id',_0xb814('0xc'),_0xb814('0xd'),_0xb814('0x11'),'keyType',_0xb814('0x12'),'variableName'],'include':[{'model':_0xb814('0xf'),'as':_0xb814('0xf'),'attributes':['id',_0xb814('0x4')]}]},{'model':_0xb814('0xb'),'as':_0xb814('0x13'),'attributes':['id',_0xb814('0xc'),_0xb814('0xd'),_0xb814('0x14'),_0xb814('0x15'),_0xb814('0x16'),_0xb814('0xe')],'include':[{'model':_0xb814('0xf'),'as':_0xb814('0xf'),'attributes':['id',_0xb814('0x4')]}]}]}]},'log':_0xb814('0x17')});};};
\ No newline at end of file
+var _0x3f8a=['Configurations','ServicenowField','Subjects','type','content','variableName','Variable','Descriptions','keyType','keyContent','Fields','idField','nameField','../../client','getServicenowAccounts','Request','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration'];(function(_0x3cd034,_0x40f594){var _0x74fff0=function(_0x29bc25){while(--_0x29bc25){_0x3cd034['push'](_0x3cd034['shift']());}};_0x74fff0(++_0x40f594);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2f29b2,_0x20ad9f){_0x2f29b2=_0x2f29b2-0x0;var _0x3d27de=_0x3f8a[_0x2f29b2];return _0x3d27de;};'use strict';var client=require(_0xa3f8('0x0'));exports[_0xa3f8('0x1')]=function(){return function(_0x29d753){return client[_0xa3f8('0x2')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id',_0xa3f8('0x3'),_0xa3f8('0x4'),_0xa3f8('0x5'),_0xa3f8('0x6'),_0xa3f8('0x7'),_0xa3f8('0x8'),_0xa3f8('0x9')],'include':[{'model':_0xa3f8('0xa'),'as':_0xa3f8('0xb'),'attributes':['id',_0xa3f8('0x3')],'include':[{'model':_0xa3f8('0xc'),'as':_0xa3f8('0xd'),'attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xf'),_0xa3f8('0x10')],'include':[{'model':_0xa3f8('0x11'),'as':_0xa3f8('0x11'),'attributes':['id','name']}]},{'model':_0xa3f8('0xc'),'as':_0xa3f8('0x12'),'attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xf'),'key',_0xa3f8('0x13'),_0xa3f8('0x14'),_0xa3f8('0x10')],'include':[{'model':_0xa3f8('0x11'),'as':_0xa3f8('0x11'),'attributes':['id',_0xa3f8('0x3')]}]},{'model':_0xa3f8('0xc'),'as':_0xa3f8('0x15'),'attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xf'),_0xa3f8('0x16'),_0xa3f8('0x17'),'customField',_0xa3f8('0x10')],'include':[{'model':_0xa3f8('0x11'),'as':_0xa3f8('0x11'),'attributes':['id',_0xa3f8('0x3')]}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
index 419ff7d..bbe0cbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fa=['password','remoteUri','serverUrl','SugarcrmField','Subjects','type','content','Variable','Descriptions','keyType','keyContent','Fields','customField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username'];(function(_0x4558b8,_0x180366){var _0x3fd226=function(_0x117e04){while(--_0x117e04){_0x4558b8['push'](_0x4558b8['shift']());}};_0x3fd226(++_0x180366);}(_0x66fa,0x117));var _0xa66f=function(_0x57d66d,_0x33af79){_0x57d66d=_0x57d66d-0x0;var _0x35cc4a=_0x66fa[_0x57d66d];return _0x35cc4a;};'use strict';var client=require(_0xa66f('0x0'));exports[_0xa66f('0x1')]=function(){return function(_0x52947a){return client[_0xa66f('0x2')](_0xa66f('0x3'),{'options':{'raw':![],'attributes':['id',_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8')],'include':[{'model':'SugarcrmConfiguration','as':'Configurations','attributes':['id',_0xa66f('0x4')],'include':[{'model':_0xa66f('0x9'),'as':_0xa66f('0xa'),'attributes':['id',_0xa66f('0xb'),_0xa66f('0xc'),'variableName'],'include':[{'model':_0xa66f('0xd'),'as':'Variable','attributes':['id',_0xa66f('0x4')]}]},{'model':'SugarcrmField','as':_0xa66f('0xe'),'attributes':['id','type','content','key',_0xa66f('0xf'),_0xa66f('0x10'),'variableName'],'include':[{'model':_0xa66f('0xd'),'as':'Variable','attributes':['id',_0xa66f('0x4')]}]},{'model':'SugarcrmField','as':_0xa66f('0x11'),'attributes':['id',_0xa66f('0xb'),_0xa66f('0xc'),'idField','nameField',_0xa66f('0x12'),'variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xa66f('0x4')]}]}]}]},'log':_0xa66f('0x3')});};};
\ No newline at end of file
+var _0x1a85=['serverUrl','Configurations','SugarcrmField','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','name','Fields','idField','nameField','Request','GetSugarcrmAccount','password','remoteUri'];(function(_0xfa700a,_0x333b7a){var _0x5ec87f=function(_0x388b9e){while(--_0x388b9e){_0xfa700a['push'](_0xfa700a['shift']());}};_0x5ec87f(++_0x333b7a);}(_0x1a85,0x178));var _0x51a8=function(_0x67b97a,_0x503a86){_0x67b97a=_0x67b97a-0x0;var _0x1c50b2=_0x1a85[_0x67b97a];return _0x1c50b2;};'use strict';var client=require('../../client');exports['getSugarcrmAccounts']=function(){return function(_0x305f18){return client[_0x51a8('0x0')](_0x51a8('0x1'),{'options':{'raw':![],'attributes':['id','name','username',_0x51a8('0x2'),_0x51a8('0x3'),_0x51a8('0x4')],'include':[{'model':'SugarcrmConfiguration','as':_0x51a8('0x5'),'attributes':['id','name'],'include':[{'model':_0x51a8('0x6'),'as':'Subjects','attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),'variableName'],'include':[{'model':_0x51a8('0x9'),'as':'Variable','attributes':['id','name']}]},{'model':_0x51a8('0x6'),'as':_0x51a8('0xa'),'attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe')],'include':[{'model':_0x51a8('0x9'),'as':_0x51a8('0x9'),'attributes':['id',_0x51a8('0xf')]}]},{'model':_0x51a8('0x6'),'as':_0x51a8('0x10'),'attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),_0x51a8('0x11'),_0x51a8('0x12'),'customField',_0x51a8('0xe')],'include':[{'model':_0x51a8('0x9'),'as':_0x51a8('0x9'),'attributes':['id','name']}]}]}]},'log':_0x51a8('0x1')});};};
\ No newline at end of file
index c121fa0..8043439 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8caf=['serverUrl','VtigerConfiguration','VtigerField','Subjects','type','content','Descriptions','key','keyContent','variableName','Variable','idField','nameField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name','description','username','accessKey','remoteUri'];(function(_0x3ae982,_0x1c7a80){var _0x1ed5b0=function(_0x2f9a13){while(--_0x2f9a13){_0x3ae982['push'](_0x3ae982['shift']());}};_0x1ed5b0(++_0x1c7a80);}(_0x8caf,0x12b));var _0xf8ca=function(_0x1a9c75,_0xa83750){_0x1a9c75=_0x1a9c75-0x0;var _0xb2f37e=_0x8caf[_0x1a9c75];return _0xb2f37e;};'use strict';var client=require(_0xf8ca('0x0'));exports[_0xf8ca('0x1')]=function(){return function(_0x48a24a){return client[_0xf8ca('0x2')](_0xf8ca('0x3'),{'options':{'raw':![],'attributes':['id',_0xf8ca('0x4'),_0xf8ca('0x5'),_0xf8ca('0x6'),_0xf8ca('0x7'),_0xf8ca('0x8'),_0xf8ca('0x9')],'include':[{'model':_0xf8ca('0xa'),'as':'Configurations','attributes':['id',_0xf8ca('0x4')],'include':[{'model':_0xf8ca('0xb'),'as':_0xf8ca('0xc'),'attributes':['id',_0xf8ca('0xd'),_0xf8ca('0xe'),'variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xf8ca('0x4')]}]},{'model':_0xf8ca('0xb'),'as':_0xf8ca('0xf'),'attributes':['id',_0xf8ca('0xd'),'content',_0xf8ca('0x10'),'keyType',_0xf8ca('0x11'),_0xf8ca('0x12')],'include':[{'model':_0xf8ca('0x13'),'as':_0xf8ca('0x13'),'attributes':['id',_0xf8ca('0x4')]}]},{'model':_0xf8ca('0xb'),'as':'Fields','attributes':['id',_0xf8ca('0xd'),'content',_0xf8ca('0x14'),_0xf8ca('0x15'),'customField',_0xf8ca('0x12')],'include':[{'model':'Variable','as':_0xf8ca('0x13'),'attributes':['id',_0xf8ca('0x4')]}]}]}]},'log':_0xf8ca('0x3')});};};
\ No newline at end of file
+var _0xd851=['Fields','idField','customField','GetVtigerAccount','Request','name','description','username','accessKey','serverUrl','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent'];(function(_0x3b8a24,_0x4f5d26){var _0x4bfb10=function(_0x46f46f){while(--_0x46f46f){_0x3b8a24['push'](_0x3b8a24['shift']());}};_0x4bfb10(++_0x4f5d26);}(_0xd851,0xe0));var _0x1d85=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0xd851[_0x4f08dd];return _0x3017ee;};'use strict';var client=require('../../client');exports['getVtigerAccounts']=function(){return function(_0x2abb36){return client[_0x1d85('0x0')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x1d85('0x1'),_0x1d85('0x2'),_0x1d85('0x3'),_0x1d85('0x4'),'remoteUri',_0x1d85('0x5')],'include':[{'model':_0x1d85('0x6'),'as':_0x1d85('0x7'),'attributes':['id',_0x1d85('0x1')],'include':[{'model':_0x1d85('0x8'),'as':_0x1d85('0x9'),'attributes':['id',_0x1d85('0xa'),_0x1d85('0xb'),_0x1d85('0xc')],'include':[{'model':_0x1d85('0xd'),'as':'Variable','attributes':['id',_0x1d85('0x1')]}]},{'model':_0x1d85('0x8'),'as':_0x1d85('0xe'),'attributes':['id','type',_0x1d85('0xb'),_0x1d85('0xf'),_0x1d85('0x10'),_0x1d85('0x11'),_0x1d85('0xc')],'include':[{'model':_0x1d85('0xd'),'as':_0x1d85('0xd'),'attributes':['id',_0x1d85('0x1')]}]},{'model':'VtigerField','as':_0x1d85('0x12'),'attributes':['id',_0x1d85('0xa'),'content',_0x1d85('0x13'),'nameField',_0x1d85('0x14'),_0x1d85('0xc')],'include':[{'model':_0x1d85('0xd'),'as':_0x1d85('0xd'),'attributes':['id',_0x1d85('0x1')]}]}]}]},'log':_0x1d85('0x15')});};};
\ No newline at end of file
index 76c6603..54b09c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ea0=['../../client','Request','GetZendeskAccount','name','username','password','remoteUri','authType','serverUrl','type','ZendeskConfiguration','ZendeskField','content','variableName','Variable','key','keyType','keyContent','Fields','nameField','customField'];(function(_0x14c8e9,_0x503ecd){var _0x2cb7a3=function(_0x229ad4){while(--_0x229ad4){_0x14c8e9['push'](_0x14c8e9['shift']());}};_0x2cb7a3(++_0x503ecd);}(_0x0ea0,0xa8));var _0x00ea=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x0ea0[_0x1da527];return _0x40fc7c;};'use strict';var client=require(_0x00ea('0x0'));exports['getZendeskAccounts']=function(){return function(_0x511231){return client[_0x00ea('0x1')](_0x00ea('0x2'),{'options':{'raw':![],'attributes':['id',_0x00ea('0x3'),_0x00ea('0x4'),_0x00ea('0x5'),'token',_0x00ea('0x6'),_0x00ea('0x7'),_0x00ea('0x8'),_0x00ea('0x9')],'include':[{'model':_0x00ea('0xa'),'as':'Configurations','attributes':['id','name'],'include':[{'model':'Tag','attributes':['id',_0x00ea('0x3')]},{'model':_0x00ea('0xb'),'as':'Subjects','attributes':['id',_0x00ea('0x9'),_0x00ea('0xc'),_0x00ea('0xd')],'include':[{'model':_0x00ea('0xe'),'as':_0x00ea('0xe'),'attributes':['id',_0x00ea('0x3')]}]},{'model':'ZendeskField','as':'Descriptions','attributes':['id',_0x00ea('0x9'),'content',_0x00ea('0xf'),_0x00ea('0x10'),_0x00ea('0x11'),_0x00ea('0xd')],'include':[{'model':_0x00ea('0xe'),'as':'Variable','attributes':['id',_0x00ea('0x3')]}]},{'model':'ZendeskField','as':_0x00ea('0x12'),'attributes':['id',_0x00ea('0x9'),_0x00ea('0xc'),'idField',_0x00ea('0x13'),_0x00ea('0x14'),'variableName'],'include':[{'model':'Variable','as':_0x00ea('0xe'),'attributes':['id',_0x00ea('0x3')]}]}]}]},'log':'GetZendeskAccount'});};};
\ No newline at end of file
+var _0x32dc=['Request','GetZendeskAccount','name','token','authType','serverUrl','type','ZendeskConfiguration','Configurations','ZendeskField','Subjects','variableName','Variable','Descriptions','key','keyType','keyContent','content','idField','nameField','customField','getZendeskAccounts'];(function(_0x11b084,_0x2fae6e){var _0xe92600=function(_0x15f7e1){while(--_0x15f7e1){_0x11b084['push'](_0x11b084['shift']());}};_0xe92600(++_0x2fae6e);}(_0x32dc,0xaf));var _0xc32d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x32dc[_0x3b380d];return _0x54502b;};'use strict';var client=require('../../client');exports[_0xc32d('0x0')]=function(){return function(_0x209385){return client[_0xc32d('0x1')](_0xc32d('0x2'),{'options':{'raw':![],'attributes':['id',_0xc32d('0x3'),'username','password',_0xc32d('0x4'),'remoteUri',_0xc32d('0x5'),_0xc32d('0x6'),_0xc32d('0x7')],'include':[{'model':_0xc32d('0x8'),'as':_0xc32d('0x9'),'attributes':['id',_0xc32d('0x3')],'include':[{'model':'Tag','attributes':['id','name']},{'model':_0xc32d('0xa'),'as':_0xc32d('0xb'),'attributes':['id',_0xc32d('0x7'),'content',_0xc32d('0xc')],'include':[{'model':_0xc32d('0xd'),'as':_0xc32d('0xd'),'attributes':['id',_0xc32d('0x3')]}]},{'model':'ZendeskField','as':_0xc32d('0xe'),'attributes':['id','type','content',_0xc32d('0xf'),_0xc32d('0x10'),_0xc32d('0x11'),'variableName'],'include':[{'model':_0xc32d('0xd'),'as':_0xc32d('0xd'),'attributes':['id',_0xc32d('0x3')]}]},{'model':'ZendeskField','as':'Fields','attributes':['id',_0xc32d('0x7'),_0xc32d('0x12'),_0xc32d('0x13'),_0xc32d('0x14'),_0xc32d('0x15'),_0xc32d('0xc')],'include':[{'model':_0xc32d('0xd'),'as':_0xc32d('0xd'),'attributes':['id',_0xc32d('0x3')]}]}]}]},'log':_0xc32d('0x2')});};};
\ No newline at end of file
index 1c37eba..f42fbcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc47=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','variableName','Variable','Descriptions','key','keyContent','Fields','idField','nameField','customField','../../client','getZohoAccounts','GetZohoAccount','name','description'];(function(_0xa2c2e2,_0x535d90){var _0x3d7867=function(_0x48be46){while(--_0x48be46){_0xa2c2e2['push'](_0xa2c2e2['shift']());}};_0x3d7867(++_0x535d90);}(_0xdc47,0x1f3));var _0x7dc4=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0xdc47[_0x54b396];return _0x532e6d;};'use strict';var client=require(_0x7dc4('0x0'));exports[_0x7dc4('0x1')]=function(){return function(_0x5c40e8){return client['Request'](_0x7dc4('0x2'),{'options':{'raw':![],'attributes':['id',_0x7dc4('0x3'),_0x7dc4('0x4'),_0x7dc4('0x5'),_0x7dc4('0x6'),_0x7dc4('0x7'),_0x7dc4('0x8'),_0x7dc4('0x9'),_0x7dc4('0xa'),_0x7dc4('0xb')],'include':[{'model':_0x7dc4('0xc'),'as':'Configurations','attributes':['id',_0x7dc4('0x3'),_0x7dc4('0xd'),_0x7dc4('0xe'),'description'],'include':[{'model':_0x7dc4('0xf'),'as':_0x7dc4('0x10'),'attributes':['id',_0x7dc4('0x11'),_0x7dc4('0x12'),_0x7dc4('0x13')],'include':[{'model':_0x7dc4('0x14'),'as':'Variable','attributes':['id','name']}]},{'model':_0x7dc4('0xf'),'as':_0x7dc4('0x15'),'attributes':['id',_0x7dc4('0x11'),_0x7dc4('0x12'),_0x7dc4('0x16'),'keyType',_0x7dc4('0x17'),_0x7dc4('0x13')],'include':[{'model':_0x7dc4('0x14'),'as':_0x7dc4('0x14'),'attributes':['id',_0x7dc4('0x3')]}]},{'model':'ZohoField','as':_0x7dc4('0x18'),'attributes':['id',_0x7dc4('0x11'),_0x7dc4('0x12'),_0x7dc4('0x19'),_0x7dc4('0x1a'),_0x7dc4('0x1b'),_0x7dc4('0x13')],'include':[{'model':_0x7dc4('0x14'),'as':_0x7dc4('0x14'),'attributes':['id',_0x7dc4('0x3')]}]}]}]},'log':_0x7dc4('0x2')});};};
\ No newline at end of file
+var _0x6ed6=['ZohoField','Subjects','type','content','variableName','Variable','key','keyType','keyContent','nameField','../../client','getZohoAccounts','Request','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','moduleCreate','moduleSearch'];(function(_0x8d722f,_0x3b794b){var _0x4733c6=function(_0x2accca){while(--_0x2accca){_0x8d722f['push'](_0x8d722f['shift']());}};_0x4733c6(++_0x3b794b);}(_0x6ed6,0x142));var _0x66ed=function(_0x4b69fb,_0x26a7b9){_0x4b69fb=_0x4b69fb-0x0;var _0x1217ca=_0x6ed6[_0x4b69fb];return _0x1217ca;};'use strict';var client=require(_0x66ed('0x0'));exports[_0x66ed('0x1')]=function(){return function(_0x168756){return client[_0x66ed('0x2')](_0x66ed('0x3'),{'options':{'raw':![],'attributes':['id',_0x66ed('0x4'),_0x66ed('0x5'),_0x66ed('0x6'),_0x66ed('0x7'),_0x66ed('0x8'),_0x66ed('0x9'),_0x66ed('0xa'),_0x66ed('0xb'),_0x66ed('0xc')],'include':[{'model':_0x66ed('0xd'),'as':'Configurations','attributes':['id',_0x66ed('0x4'),_0x66ed('0xe'),_0x66ed('0xf'),_0x66ed('0x5')],'include':[{'model':_0x66ed('0x10'),'as':_0x66ed('0x11'),'attributes':['id',_0x66ed('0x12'),_0x66ed('0x13'),_0x66ed('0x14')],'include':[{'model':_0x66ed('0x15'),'as':_0x66ed('0x15'),'attributes':['id',_0x66ed('0x4')]}]},{'model':'ZohoField','as':'Descriptions','attributes':['id',_0x66ed('0x12'),'content',_0x66ed('0x16'),_0x66ed('0x17'),_0x66ed('0x18'),_0x66ed('0x14')],'include':[{'model':_0x66ed('0x15'),'as':'Variable','attributes':['id',_0x66ed('0x4')]}]},{'model':_0x66ed('0x10'),'as':'Fields','attributes':['id',_0x66ed('0x12'),_0x66ed('0x13'),'idField',_0x66ed('0x19'),'customField',_0x66ed('0x14')],'include':[{'model':_0x66ed('0x15'),'as':_0x66ed('0x15'),'attributes':['id',_0x66ed('0x4')]}]}]}]},'log':_0x66ed('0x3')});};};
\ No newline at end of file
index 2d1bc33..d6232bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa84=['interface','format','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','agent','toNumber','accountcode','uniqueid','voiceDialReport','voice','membername','starttime','endtime','dialstring','moment','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport'];(function(_0x276be6,_0x58f93f){var _0x542e8b=function(_0xfaf24){while(--_0xfaf24){_0x276be6['push'](_0x276be6['shift']());}};_0x542e8b(++_0x58f93f);}(_0xfa84,0x154));var _0x4fa8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfa84[_0x3ab51d];return _0x29a04e;};'use strict';var moment=require(_0x4fa8('0x0'));var _=require(_0x4fa8('0x1'));var util=require('util');var client=require(_0x4fa8('0x2'));exports[_0x4fa8('0x3')]=function(_0x68dc12){var _0x35d6ca=_0x68dc12[_0x4fa8('0x4')]||_0x68dc12[_0x4fa8('0x5')];return client[_0x4fa8('0x6')](_0x4fa8('0x7'),{'body':{'channel':'voice','membername':_0x68dc12['lastAssignedTo'],'interface':_['isNil'](_0x68dc12[_0x4fa8('0x8')])?util[_0x4fa8('0x9')](_0x4fa8('0xa'),_0x68dc12[_0x4fa8('0xb')]):_0x68dc12[_0x4fa8('0x8')],'type':_0x4fa8('0xc'),'enterAt':_0x68dc12[_0x4fa8('0xd')],'exitAt':_0x35d6ca,'duration':moment(_0x35d6ca)[_0x4fa8('0xe')](_0x68dc12[_0x4fa8('0xd')],_0x4fa8('0xf')),'data1':'inbound','data2':_0x68dc12[_0x4fa8('0x10')],'data3':_0x68dc12[_0x4fa8('0x11')],'data4':null,'data5':_0x68dc12[_0x4fa8('0x12')],'role':_0x4fa8('0x13'),'internal':_0x68dc12['accountcode']?_[_0x4fa8('0x14')](_0x68dc12[_0x4fa8('0x15')]):undefined,'uniqueid':_0x68dc12[_0x4fa8('0x16')]},'log':_0x4fa8('0x7')});};exports[_0x4fa8('0x17')]=function(_0x183afe){return client[_0x4fa8('0x6')]('CreateMemberReport',{'body':{'channel':_0x4fa8('0x18'),'membername':_0x183afe[_0x4fa8('0x19')],'interface':_0x183afe[_0x4fa8('0x8')],'type':_0x4fa8('0xc'),'enterAt':_0x183afe[_0x4fa8('0x1a')],'exitAt':_0x183afe[_0x4fa8('0x1b')],'duration':moment(_0x183afe['endtime'])[_0x4fa8('0xe')](_0x183afe['starttime'],'seconds')>=0x0?moment(_0x183afe[_0x4fa8('0x1b')])['diff'](_0x183afe[_0x4fa8('0x1a')],_0x4fa8('0xf')):null,'data1':'outbound','data2':_0x183afe[_0x4fa8('0x15')],'data3':_0x183afe[_0x4fa8('0x11')],'data4':_0x183afe[_0x4fa8('0x1c')]||null,'role':_0x4fa8('0x13'),'internal':_0x183afe['accountcode']?_['toNumber'](_0x183afe['accountcode']):undefined,'uniqueid':_0x183afe[_0x4fa8('0x16')]},'log':_0x4fa8('0x7')});};
\ No newline at end of file
+var _0x3144=['TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','accountcode','toNumber','uniqueid','voice','membername','starttime','endtime','outbound','dialstring','agent','moment','lodash','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3144,0xfa));var _0x4314=function(_0x43a37b,_0x306880){_0x43a37b=_0x43a37b-0x0;var _0x4f7020=_0x3144[_0x43a37b];return _0x4f7020;};'use strict';var moment=require(_0x4314('0x0'));var _=require(_0x4314('0x1'));var util=require('util');var client=require('../client');exports[_0x4314('0x2')]=function(_0x34e08d){var _0x419092=_0x34e08d[_0x4314('0x3')]||_0x34e08d[_0x4314('0x4')];return client['Request'](_0x4314('0x5'),{'body':{'channel':'voice','membername':_0x34e08d[_0x4314('0x6')],'interface':_[_0x4314('0x7')](_0x34e08d[_0x4314('0x8')])?util[_0x4314('0x9')](_0x4314('0xa'),_0x34e08d[_0x4314('0x6')]):_0x34e08d[_0x4314('0x8')],'type':_0x4314('0xb'),'enterAt':_0x34e08d[_0x4314('0xc')],'exitAt':_0x419092,'duration':moment(_0x419092)[_0x4314('0xd')](_0x34e08d[_0x4314('0xc')],_0x4314('0xe')),'data1':_0x4314('0xf'),'data2':_0x34e08d[_0x4314('0x10')],'data3':_0x34e08d[_0x4314('0x11')],'data4':null,'data5':_0x34e08d[_0x4314('0x12')],'role':'agent','internal':_0x34e08d[_0x4314('0x13')]?_[_0x4314('0x14')](_0x34e08d[_0x4314('0x13')]):undefined,'uniqueid':_0x34e08d[_0x4314('0x15')]},'log':_0x4314('0x5')});};exports['voiceDialReport']=function(_0x5a49f1){return client['Request']('CreateMemberReport',{'body':{'channel':_0x4314('0x16'),'membername':_0x5a49f1[_0x4314('0x17')],'interface':_0x5a49f1[_0x4314('0x8')],'type':_0x4314('0xb'),'enterAt':_0x5a49f1[_0x4314('0x18')],'exitAt':_0x5a49f1[_0x4314('0x19')],'duration':moment(_0x5a49f1[_0x4314('0x19')])['diff'](_0x5a49f1[_0x4314('0x18')],_0x4314('0xe'))>=0x0?moment(_0x5a49f1[_0x4314('0x19')])[_0x4314('0xd')](_0x5a49f1['starttime'],_0x4314('0xe')):null,'data1':_0x4314('0x1a'),'data2':_0x5a49f1[_0x4314('0x13')],'data3':_0x5a49f1[_0x4314('0x11')],'data4':_0x5a49f1[_0x4314('0x1b')]||null,'role':_0x4314('0x1c'),'internal':_0x5a49f1['accountcode']?_[_0x4314('0x14')](_0x5a49f1['accountcode']):undefined,'uniqueid':_0x5a49f1[_0x4314('0x15')]},'log':'CreateMemberReport'});};
\ No newline at end of file
index 26bbee7..eee5423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cfb=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x45964b,_0xe849e5){var _0x4dc863=function(_0x1aa294){while(--_0x1aa294){_0x45964b['push'](_0x45964b['shift']());}};_0x4dc863(++_0xe849e5);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x4aaa11,_0x1826e9){_0x4aaa11=_0x4aaa11-0x0;var _0x1f6924=_0x3cfb[_0x4aaa11];return _0x1f6924;};'use strict';var client=require(_0xb3cf('0x0'));exports[_0xb3cf('0x1')]=function(){return client[_0xb3cf('0x2')](_0xb3cf('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb3cf('0x4')]},'log':_0xb3cf('0x5')});};
\ No newline at end of file
+var _0x720e=['getSettings','Request','GetSettings','../client'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x720e,0x1cb));var _0xe720=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x720e[_0x4e1a49];return _0x136aae;};'use strict';var client=require(_0xe720('0x0'));exports[_0xe720('0x1')]=function(){return client[_0xe720('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xe720('0x3')});};
\ No newline at end of file
index b8c71bd..b59de62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ab9=['name','html','GetTemplate','../client'];(function(_0x1fa174,_0x1eaea5){var _0x581adc=function(_0x28b3e7){while(--_0x28b3e7){_0x1fa174['push'](_0x1fa174['shift']());}};_0x581adc(++_0x1eaea5);}(_0x3ab9,0x167));var _0x93ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab9[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x93ab('0x0'));exports['getTemplates']=function(_0x1d73db){return function(_0x4e6295){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x93ab('0x1'),_0x93ab('0x2')]},'log':_0x93ab('0x3')});};};
\ No newline at end of file
+var _0x2d20=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2d20,0x1d1));var _0x02d2=function(_0x16e8e2,_0x3c0f1d){_0x16e8e2=_0x16e8e2-0x0;var _0x1d1bbc=_0x2d20[_0x16e8e2];return _0x1d1bbc;};'use strict';var client=require(_0x02d2('0x0'));exports[_0x02d2('0x1')]=function(_0x3d5fb2){return function(_0x491af9){return client[_0x02d2('0x2')](_0x02d2('0x3'),{'options':{'raw':!![],'attributes':['id',_0x02d2('0x4'),_0x02d2('0x5')]},'log':_0x02d2('0x3')});};};
\ No newline at end of file
index 3aa5e0c..bbd9737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb650=['Condition','AllConditions','field','operator','AnyConditions','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','Request','GetTrigger','name','channel','status'];(function(_0x4feb9c,_0x19a66b){var _0x341ce3=function(_0x32aba6){while(--_0x32aba6){_0x4feb9c['push'](_0x4feb9c['shift']());}};_0x341ce3(++_0x19a66b);}(_0xb650,0x18a));var _0x0b65=function(_0x2ef287,_0x138616){_0x2ef287=_0x2ef287-0x0;var _0xa66570=_0xb650[_0x2ef287];return _0xa66570;};'use strict';var client=require(_0x0b65('0x0'));exports['getTriggers']=function(_0xd9af6e){return function(_0x29e3dd){return client[_0x0b65('0x1')](_0x0b65('0x2'),{'options':{'raw':![],'attributes':['id',_0x0b65('0x3'),_0x0b65('0x4'),_0x0b65('0x5')],'include':[{'model':_0x0b65('0x6'),'as':_0x0b65('0x7'),'attributes':['id',_0x0b65('0x8'),_0x0b65('0x9'),'value']},{'model':_0x0b65('0x6'),'as':_0x0b65('0xa'),'attributes':['id',_0x0b65('0x8'),_0x0b65('0x9'),'value']},{'model':'Action','as':_0x0b65('0xb'),'attributes':['id',_0x0b65('0xc'),_0x0b65('0xd'),_0x0b65('0xe'),_0x0b65('0xf'),_0x0b65('0x10'),_0x0b65('0x11'),_0x0b65('0x12'),_0x0b65('0x13')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xf9fa=['getTriggers','Request','GetTrigger','name','channel','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data2','data3','data4','data5','data6','data7','../client'];(function(_0x49b69d,_0x4d1245){var _0x529186=function(_0xac7a39){while(--_0xac7a39){_0x49b69d['push'](_0x49b69d['shift']());}};_0x529186(++_0x4d1245);}(_0xf9fa,0xfb));var _0xaf9f=function(_0x4f039a,_0x2bc090){_0x4f039a=_0x4f039a-0x0;var _0x71daa2=_0xf9fa[_0x4f039a];return _0x71daa2;};'use strict';var client=require(_0xaf9f('0x0'));exports[_0xaf9f('0x1')]=function(_0x27c814){return function(_0x99094a){return client[_0xaf9f('0x2')](_0xaf9f('0x3'),{'options':{'raw':![],'attributes':['id',_0xaf9f('0x4'),_0xaf9f('0x5'),'status'],'include':[{'model':_0xaf9f('0x6'),'as':_0xaf9f('0x7'),'attributes':['id','field',_0xaf9f('0x8'),_0xaf9f('0x9')]},{'model':_0xaf9f('0x6'),'as':_0xaf9f('0xa'),'attributes':['id',_0xaf9f('0xb'),_0xaf9f('0x8'),_0xaf9f('0x9')]},{'model':_0xaf9f('0xc'),'as':_0xaf9f('0xd'),'attributes':['id',_0xaf9f('0xe'),'data1',_0xaf9f('0xf'),_0xaf9f('0x10'),_0xaf9f('0x11'),_0xaf9f('0x12'),_0xaf9f('0x13'),_0xaf9f('0x14')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
index 1186f16..cfb67ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb722=['Request','GetTrunk','name','registry','defaultuser','../client'];(function(_0xc87236,_0x1f2504){var _0x605dae=function(_0x185bcf){while(--_0x185bcf){_0xc87236['push'](_0xc87236['shift']());}};_0x605dae(++_0x1f2504);}(_0xb722,0x191));var _0x2b72=function(_0x5ebc51,_0x32d6e0){_0x5ebc51=_0x5ebc51-0x0;var _0x1e82fd=_0xb722[_0x5ebc51];return _0x1e82fd;};'use strict';var client=require(_0x2b72('0x0'));exports['getTrunks']=function(_0x8d4e92){return function(_0x2f2bee){return client[_0x2b72('0x1')](_0x2b72('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2b72('0x3'),_0x2b72('0x4'),_0x2b72('0x5')]},'log':'GetTrunk'});};};
\ No newline at end of file
+var _0x793b=['name','registry','defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x3050a2,_0x506045){var _0x2b069b=function(_0xd8e13e){while(--_0xd8e13e){_0x3050a2['push'](_0x3050a2['shift']());}};_0x2b069b(++_0x506045);}(_0x793b,0x1ae));var _0xb793=function(_0x3bd1a6,_0x4911ea){_0x3bd1a6=_0x3bd1a6-0x0;var _0x184fb1=_0x793b[_0x3bd1a6];return _0x184fb1;};'use strict';var client=require(_0xb793('0x0'));exports[_0xb793('0x1')]=function(_0x7a6b03){return function(_0x4ebad7){return client[_0xb793('0x2')](_0xb793('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb793('0x4'),_0xb793('0x5'),_0xb793('0x6')]},'log':_0xb793('0x3')});};};
\ No newline at end of file
index 3800ff4..68b8dbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe706,0xa3));var _0x6e70=function(_0x44c742,_0x5d69a4){_0x44c742=_0x44c742-0x0;var _0x40fcf0=_0xe706[_0x44c742];return _0x40fcf0;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});};
\ No newline at end of file
+var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe706,0xa3));var _0x6e70=function(_0x1b1ce5,_0x508743){_0x1b1ce5=_0x1b1ce5-0x0;var _0x432ff6=_0xe706[_0x1b1ce5];return _0x432ff6;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});};
\ No newline at end of file
index f9d69de..b9e6ba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf68=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf68,0xcd));var _0x8bf6=function(_0x3a8c33,_0x556b40){_0x3a8c33=_0x3a8c33-0x0;var _0x342986=_0xbf68[_0x3a8c33];return _0x342986;};'use strict';var client=require(_0x8bf6('0x0'));exports['create']=function(_0x4421c8){return client[_0x8bf6('0x1')](_0x8bf6('0x2'),{'body':_0x4421c8,'log':'CreateVoiceAgentReport'});};exports[_0x8bf6('0x3')]=function(_0xea0a98,_0x30cbfe,_0xa7dbbe){return client[_0x8bf6('0x1')](_0x8bf6('0x4'),{'body':_0xea0a98,'options':{'where':{'uniqueid':_0x30cbfe,'interface':_0xa7dbbe,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
+var _0xf968=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0xf968,0x135));var _0x8f96=function(_0x36c65f,_0x576e12){_0x36c65f=_0x36c65f-0x0;var _0x5cbe9b=_0xf968[_0x36c65f];return _0x5cbe9b;};'use strict';var client=require(_0x8f96('0x0'));exports['create']=function(_0x2a2956){return client[_0x8f96('0x1')](_0x8f96('0x2'),{'body':_0x2a2956,'log':'CreateVoiceAgentReport'});};exports[_0x8f96('0x3')]=function(_0x3bba70,_0x1f98be,_0x2116fc){return client[_0x8f96('0x1')](_0x8f96('0x4'),{'body':_0x3bba70,'options':{'where':{'uniqueid':_0x1f98be,'interface':_0x2116fc,'agentcomplete':!![]}},'log':_0x8f96('0x4')});};
\ No newline at end of file
index 2eeb7e9..3ef7bc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d55=['util','lodash','create','Request','merge','context','callerid','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','type','disposition','duration','billableseconds','GetVoiceCallReports','moment'];(function(_0xa8110a,_0x21d51e){var _0x5e2905=function(_0x207f6d){while(--_0x207f6d){_0xa8110a['push'](_0xa8110a['shift']());}};_0x5e2905(++_0x21d51e);}(_0x8d55,0xfb));var _0x58d5=function(_0x53da90,_0xd9acb){_0x53da90=_0x53da90-0x0;var _0x57cc88=_0x8d55[_0x53da90];return _0x57cc88;};'use strict';var moment=require(_0x58d5('0x0'));var util=require(_0x58d5('0x1'));var _=require(_0x58d5('0x2'));var client=require('../client');exports[_0x58d5('0x3')]=function(_0x23a4dc){return client[_0x58d5('0x4')]('CreateVoiceCallReport',{'body':_[_0x58d5('0x5')](_0x23a4dc,{'source':_0x23a4dc['calleridnum'],'destinationcontext':_0x23a4dc[_0x58d5('0x6')],'callerid':_0x23a4dc[_0x58d5('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x58d5('0x8')});};exports[_0x58d5('0x9')]=function(){return function(){return client[_0x58d5('0x4')](_0x58d5('0xa'),{'options':{'where':{'type':[_0x58d5('0xb')],'createdAt':{'$between':[moment()[_0x58d5('0xc')]('day')[_0x58d5('0xd')](_0x58d5('0xe')),moment()['endOf'](_0x58d5('0xf'))['format'](_0x58d5('0xe'))]}},'attributes':[_0x58d5('0x10'),_0x58d5('0x11'),_0x58d5('0x12'),_0x58d5('0x13')]},'log':_0x58d5('0x14')});};};
\ No newline at end of file
+var _0x23c1=['util','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','GetVoiceCallReport','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','billableseconds','GetVoiceCallReports','moment'];(function(_0x4b6afc,_0x42a62e){var _0x53a775=function(_0x17aa16){while(--_0x17aa16){_0x4b6afc['push'](_0x4b6afc['shift']());}};_0x53a775(++_0x42a62e);}(_0x23c1,0xe6));var _0x123c=function(_0x19712f,_0x161d4a){_0x19712f=_0x19712f-0x0;var _0x5d1a11=_0x23c1[_0x19712f];return _0x5d1a11;};'use strict';var moment=require(_0x123c('0x0'));var util=require(_0x123c('0x1'));var _=require(_0x123c('0x2'));var client=require(_0x123c('0x3'));exports[_0x123c('0x4')]=function(_0x258a4d){return client[_0x123c('0x5')](_0x123c('0x6'),{'body':_[_0x123c('0x7')](_0x258a4d,{'source':_0x258a4d['calleridnum'],'destinationcontext':_0x258a4d[_0x123c('0x8')],'callerid':_0x258a4d[_0x123c('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x123c('0x6')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x123c('0xa'),{'options':{'where':{'type':[_0x123c('0xb')],'createdAt':{'$between':[moment()[_0x123c('0xc')]('day')['format'](_0x123c('0xd')),moment()[_0x123c('0xe')]('day')[_0x123c('0xf')](_0x123c('0xd'))]}},'attributes':[_0x123c('0x10'),_0x123c('0x11'),_0x123c('0x12'),_0x123c('0x13')]},'log':_0x123c('0x14')});};};
\ No newline at end of file
index 0061638..1a6c184 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9053=['Request','CreateVoiceDialReport','../client'];(function(_0x44e218,_0x5f1ebc){var _0xd204f2=function(_0x4b7503){while(--_0x4b7503){_0x44e218['push'](_0x44e218['shift']());}};_0xd204f2(++_0x5f1ebc);}(_0x9053,0x161));var _0x3905=function(_0x3ae96c,_0x5f1e7e){_0x3ae96c=_0x3ae96c-0x0;var _0x1b0c90=_0x9053[_0x3ae96c];return _0x1b0c90;};'use strict';var client=require(_0x3905('0x0'));exports['create']=function(_0x22a41e){return client[_0x3905('0x1')](_0x3905('0x2'),{'body':_0x22a41e,'log':_0x3905('0x2')});};
\ No newline at end of file
+var _0x232c=['../client','Request','CreateVoiceDialReport'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x232c,0x159));var _0xc232=function(_0x58b1a6,_0x4f1201){_0x58b1a6=_0x58b1a6-0x0;var _0x2c7731=_0x232c[_0x58b1a6];return _0x2c7731;};'use strict';var client=require(_0xc232('0x0'));exports['create']=function(_0x1ec62e){return client[_0xc232('0x1')](_0xc232('0x2'),{'body':_0x1ec62e,'log':_0xc232('0x2')});};
\ No newline at end of file
index e276064..059d22a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c0=['exten','recordingFormat','../client','Request','GetVoiceExtension'];(function(_0x48f032,_0x560f00){var _0xc01a84=function(_0x273af3){while(--_0x273af3){_0x48f032['push'](_0x48f032['shift']());}};_0xc01a84(++_0x560f00);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x573b26,_0x3e8c50){_0x573b26=_0x573b26-0x0;var _0xb0cf37=_0xe0c0[_0x573b26];return _0xb0cf37;};'use strict';var client=require(_0x0e0c('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x0e0c('0x1')](_0x0e0c('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0e0c('0x3'),_0x0e0c('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
+var _0x2bc6=['Request','../client','getVoiceExtensions'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x2bc6,0x163));var _0x62bc=function(_0x3e0156,_0x2b3343){_0x3e0156=_0x3e0156-0x0;var _0x23c1c3=_0x2bc6[_0x3e0156];return _0x23c1c3;};'use strict';var client=require(_0x62bc('0x0'));exports[_0x62bc('0x1')]=function(){return function(){return client[_0x62bc('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
index cf78248..cfe67ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb438=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','callAdditionalPhoneAfterMin','Trunk','callerid','Pause','mandatoryDispositionPause','active','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0xb438,0x1c8));var _0x8b43=function(_0x4676ff,_0x30c17f){_0x4676ff=_0x4676ff-0x0;var _0x316536=_0xb438[_0x4676ff];return _0x316536;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0x8b43('0x0')](_0x8b43('0x1'),{'options':{'raw':![],'attributes':['id',_0x8b43('0x2'),_0x8b43('0x3'),_0x8b43('0x4'),_0x8b43('0x5'),_0x8b43('0x6'),'type',_0x8b43('0x7'),_0x8b43('0x8'),_0x8b43('0x9'),'dialLimitQueue',_0x8b43('0xa'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x8b43('0xb'),_0x8b43('0xc'),'dialOriginateCallerIdNumber',_0x8b43('0xd'),_0x8b43('0xe'),_0x8b43('0xf'),_0x8b43('0x10'),_0x8b43('0x11'),'dialCongestionRetryFrequency',_0x8b43('0x12'),_0x8b43('0x13'),_0x8b43('0x14'),_0x8b43('0x15'),_0x8b43('0x16'),'dialTimezone','dialGlobalInterval',_0x8b43('0x17'),_0x8b43('0x18'),_0x8b43('0x19'),_0x8b43('0x1a'),_0x8b43('0x1b'),_0x8b43('0x1c'),_0x8b43('0x1d'),_0x8b43('0x1e'),_0x8b43('0x1f'),_0x8b43('0x20'),_0x8b43('0x21'),'dialAMDMaximumWordLength',_0x8b43('0x22'),_0x8b43('0x23'),_0x8b43('0x24'),_0x8b43('0x25'),_0x8b43('0x26'),_0x8b43('0x27'),_0x8b43('0x28'),_0x8b43('0x6'),_0x8b43('0x29'),_0x8b43('0x2a'),_0x8b43('0x2b'),_0x8b43('0x2c'),_0x8b43('0x2d'),_0x8b43('0x2e'),_0x8b43('0x2f'),_0x8b43('0x30'),_0x8b43('0x31'),_0x8b43('0x32'),_0x8b43('0x33'),_0x8b43('0x34'),'dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x8b43('0x35')],'include':[{'model':'Trunk','as':_0x8b43('0x36'),'attributes':['id',_0x8b43('0x2'),_0x8b43('0x37'),'active']},{'model':_0x8b43('0x38'),'as':_0x8b43('0x39'),'attributes':['id',_0x8b43('0x2')]},{'model':_0x8b43('0x36'),'as':'TrunkBackup','attributes':['id',_0x8b43('0x2'),_0x8b43('0x37'),_0x8b43('0x3a')]},{'model':_0x8b43('0x3b'),'as':_0x8b43('0x3b'),'attributes':['id',_0x8b43('0x2')],'include':[{'model':'Interval','as':_0x8b43('0x3c'),'attributes':['id','name',_0x8b43('0x3d')]}]}]},'log':_0x8b43('0x3e')});};};
\ No newline at end of file
+var _0xa816=['dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','callAdditionalPhoneAfterMin','Trunk','active','Pause','TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','../client','GetVoiceQueue','name','acw','type','dialMethod'];(function(_0x1339a5,_0x7992b4){var _0x5ab4ff=function(_0x3b0583){while(--_0x3b0583){_0x1339a5['push'](_0x1339a5['shift']());}};_0x5ab4ff(++_0x7992b4);}(_0xa816,0x10d));var _0x6a81=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xa816[_0x5e6ea3];return _0x4048b5;};'use strict';var client=require(_0x6a81('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x6a81('0x1'),{'options':{'raw':![],'attributes':['id',_0x6a81('0x2'),_0x6a81('0x3'),'acwTimeout','autopause','monitor_format',_0x6a81('0x4'),'dialActive',_0x6a81('0x5'),_0x6a81('0x6'),'dialLimitQueue',_0x6a81('0x7'),_0x6a81('0x8'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName',_0x6a81('0x9'),_0x6a81('0xa'),_0x6a81('0xb'),_0x6a81('0xc'),'dialQueueProject',_0x6a81('0xd'),_0x6a81('0xe'),'dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x6a81('0xf'),_0x6a81('0x10'),_0x6a81('0x11'),'dialGlobalInterval',_0x6a81('0x12'),'dialCheckDuplicateType',_0x6a81('0x13'),_0x6a81('0x14'),_0x6a81('0x15'),_0x6a81('0x16'),_0x6a81('0x17'),_0x6a81('0x18'),'dialAMDBetweenWordsSilence',_0x6a81('0x19'),'dialAMDSilenceThreshold',_0x6a81('0x1a'),_0x6a81('0x1b'),_0x6a81('0x1c'),'dialRecallInQueue','dialOrderByScheduledAt',_0x6a81('0x1d'),_0x6a81('0x1e'),_0x6a81('0x1f'),'monitor_format',_0x6a81('0x20'),'dialRandomLastDigitCallerIdNumber',_0x6a81('0x21'),_0x6a81('0x22'),_0x6a81('0x23'),_0x6a81('0x24'),_0x6a81('0x25'),_0x6a81('0x26'),'dialAbandonedRetryFrequency',_0x6a81('0x27'),_0x6a81('0x28'),_0x6a81('0x29'),'dialAgentRejectRetryFrequency',_0x6a81('0x2a'),_0x6a81('0x2b'),_0x6a81('0x2c'),_0x6a81('0x2d')],'include':[{'model':_0x6a81('0x2e'),'as':_0x6a81('0x2e'),'attributes':['id',_0x6a81('0x2'),'callerid',_0x6a81('0x2f')]},{'model':_0x6a81('0x30'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':_0x6a81('0x31'),'attributes':['id',_0x6a81('0x2'),_0x6a81('0x32'),_0x6a81('0x2f')]},{'model':'Interval','as':_0x6a81('0x33'),'attributes':['id',_0x6a81('0x2')],'include':[{'model':_0x6a81('0x33'),'as':_0x6a81('0x34'),'attributes':['id','name',_0x6a81('0x35')]}]}]},'log':_0x6a81('0x36')});};};
\ No newline at end of file
index dc871bc..1ffef55 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(_0x45ec74,_0x99ee61){var _0x10ccd5=function(_0x409bc0){while(--_0x409bc0){_0x45ec74['push'](_0x45ec74['shift']());}};_0x10ccd5(++_0x99ee61);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0xe36a6,_0x46fa90){var _0x4b032c=function(_0x4bea73){while(--_0x4bea73){_0xe36a6['push'](_0xe36a6['shift']());}};_0x4b032c(++_0x46fa90);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 a2dde50..8f87732 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbfc=['../client','getVoiceQueueRtPauses','Request'];(function(_0xe8f29e,_0x3aa44b){var _0x43a08e=function(_0x20d408){while(--_0x20d408){_0xe8f29e['push'](_0xe8f29e['shift']());}};_0x43a08e(++_0x3aa44b);}(_0xcbfc,0xdb));var _0xccbf=function(_0x74403f,_0x41b7cc){_0x74403f=_0x74403f-0x0;var _0x4d2b0d=_0xcbfc[_0x74403f];return _0x4d2b0d;};'use strict';var client=require(_0xccbf('0x0'));exports[_0xccbf('0x1')]=function(_0x564293){return function(){return client[_0xccbf('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x564293,'paused':!![]},'raw':!![]},'log':_0xccbf('0x1')});};};
\ No newline at end of file
+var _0x9113=['getVoiceQueueRtPauses','../client','Request','GetVoiceQueueRtPauses'];(function(_0xadbc31,_0x165b14){var _0x3de773=function(_0xd75e18){while(--_0xd75e18){_0xadbc31['push'](_0xadbc31['shift']());}};_0x3de773(++_0x165b14);}(_0x9113,0x79));var _0x3911=function(_0x2b8b69,_0x4157b9){_0x2b8b69=_0x2b8b69-0x0;var _0x4bf994=_0x9113[_0x2b8b69];return _0x4bf994;};'use strict';var client=require(_0x3911('0x0'));exports['getVoiceQueueRtPauses']=function(_0x2f4e30){return function(){return client[_0x3911('0x1')](_0x3911('0x2'),{'options':{'where':{'VoiceQueueId':_0x2f4e30,'paused':!![]},'raw':!![]},'log':_0x3911('0x3')});};};
\ No newline at end of file
index 59fcff5..f250848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x47396d,_0x4d5b16){var _0x35b29b=function(_0x1f3fb4){while(--_0x1f3fb4){_0x47396d['push'](_0x47396d['shift']());}};_0x35b29b(++_0x4d5b16);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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(_0x51fd5a,_0x1e4b1b){var _0x5db726=function(_0x328e01){while(--_0x328e01){_0x51fd5a['push'](_0x51fd5a['shift']());}};_0x5db726(++_0x1e4b1b);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 2ae1d46..d55b515 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4153=['transfererconnectedlinename','transfereraccountcode','transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','blindTransfer','result','transfererchannel','transferercalleridname','transfererconnectedlinenum'];(function(_0xd412ea,_0x28948f){var _0x13c0c3=function(_0x29690f){while(--_0x29690f){_0xd412ea['push'](_0xd412ea['shift']());}};_0x13c0c3(++_0x28948f);}(_0x4153,0x14f));var _0x3415=function(_0x4c1924,_0x2fb0d0){_0x4c1924=_0x4c1924-0x0;var _0x2b572b=_0x4153[_0x4c1924];return _0x2b572b;};'use strict';var client=require('../client');exports['transfers']={};exports[_0x3415('0x0')]=function(_0x3a2053){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x3a2053[_0x3415('0x1')],'transfererchannel':_0x3a2053[_0x3415('0x2')],'transferercalleridnum':_0x3a2053['transferercalleridnum'],'transferercalleridname':_0x3a2053[_0x3415('0x3')],'transfererconnectedlinenum':_0x3a2053[_0x3415('0x4')],'transfererconnectedlinename':_0x3a2053[_0x3415('0x5')],'transfereraccountcode':_0x3a2053[_0x3415('0x6')],'transferercontext':_0x3a2053['transferercontext'],'transfererexten':_0x3a2053[_0x3415('0x7')],'transfererlinkedid':_0x3a2053['transfererlinkedid'],'transfereechannel':_0x3a2053['transfereechannel'],'transfereecalleridnum':_0x3a2053[_0x3415('0x8')],'transfereecalleridname':_0x3a2053[_0x3415('0x9')],'transfereeconnectedlinenum':_0x3a2053[_0x3415('0xa')],'transfereeconnectedlinename':_0x3a2053['transfereeconnectedlinename'],'transfereeaccountcode':_0x3a2053[_0x3415('0xb')],'transfereecontext':_0x3a2053['transfereecontext'],'transfereeexten':_0x3a2053[_0x3415('0xc')],'transfereelinkedid':_0x3a2053[_0x3415('0xd')],'isexternal':_0x3a2053[_0x3415('0xe')],'context':_0x3a2053[_0x3415('0xf')],'extension':_0x3a2053[_0x3415('0x10')],'type':_0x3415('0x11')},'log':_0x3415('0x12')});};exports['attendedTransfer']=function(_0x46ab2b){return client['Request'](_0x3415('0x12'),{'body':{'result':_0x46ab2b[_0x3415('0x1')],'transfererchannel':_0x46ab2b[_0x3415('0x13')],'transferercalleridnum':_0x46ab2b[_0x3415('0x14')],'transferercalleridname':_0x46ab2b[_0x3415('0x15')],'transfererconnectedlinenum':_0x46ab2b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x46ab2b[_0x3415('0x16')],'transfereraccountcode':_0x46ab2b[_0x3415('0x17')],'transferercontext':_0x46ab2b[_0x3415('0x18')],'transfererexten':_0x46ab2b['secondtransfererexten'],'transfererlinkedid':_0x46ab2b['origtransfererlinkedid'],'transfereechannel':_0x46ab2b[_0x3415('0x19')],'transfereecalleridnum':_0x46ab2b[_0x3415('0x1a')],'transfereecalleridname':_0x46ab2b['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x46ab2b[_0x3415('0x1b')],'transfereeconnectedlinename':_0x46ab2b['transfertargetconnectedlinename'],'transfereeaccountcode':_0x46ab2b[_0x3415('0x1c')],'transfereecontext':_0x46ab2b[_0x3415('0x1d')],'transfereeexten':_0x46ab2b[_0x3415('0x1e')],'transfereelinkedid':_0x46ab2b['transfertargetlinkedid'],'isexternal':_0x46ab2b[_0x3415('0xe')],'context':_0x46ab2b[_0x3415('0x1f')],'extension':_0x46ab2b[_0x3415('0x20')],'type':_0x3415('0x21')},'log':_0x3415('0x12')});};
\ No newline at end of file
+var _0x8e9c=['origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridnum'];(function(_0x117276,_0x2c725e){var _0x51b05f=function(_0x3c933c){while(--_0x3c933c){_0x117276['push'](_0x117276['shift']());}};_0x51b05f(++_0x2c725e);}(_0x8e9c,0xa6));var _0xc8e9=function(_0x502eea,_0x53532a){_0x502eea=_0x502eea-0x0;var _0x4fb4f7=_0x8e9c[_0x502eea];return _0x4fb4f7;};'use strict';var client=require('../client');exports[_0xc8e9('0x0')]={};exports[_0xc8e9('0x1')]=function(_0x5f4b4b){return client[_0xc8e9('0x2')](_0xc8e9('0x3'),{'body':{'result':_0x5f4b4b[_0xc8e9('0x4')],'transfererchannel':_0x5f4b4b[_0xc8e9('0x5')],'transferercalleridnum':_0x5f4b4b['transferercalleridnum'],'transferercalleridname':_0x5f4b4b['transferercalleridname'],'transfererconnectedlinenum':_0x5f4b4b['transfererconnectedlinenum'],'transfererconnectedlinename':_0x5f4b4b['transfererconnectedlinename'],'transfereraccountcode':_0x5f4b4b['transfereraccountcode'],'transferercontext':_0x5f4b4b[_0xc8e9('0x6')],'transfererexten':_0x5f4b4b[_0xc8e9('0x7')],'transfererlinkedid':_0x5f4b4b[_0xc8e9('0x8')],'transfereechannel':_0x5f4b4b[_0xc8e9('0x9')],'transfereecalleridnum':_0x5f4b4b[_0xc8e9('0xa')],'transfereecalleridname':_0x5f4b4b[_0xc8e9('0xb')],'transfereeconnectedlinenum':_0x5f4b4b[_0xc8e9('0xc')],'transfereeconnectedlinename':_0x5f4b4b[_0xc8e9('0xd')],'transfereeaccountcode':_0x5f4b4b[_0xc8e9('0xe')],'transfereecontext':_0x5f4b4b[_0xc8e9('0xf')],'transfereeexten':_0x5f4b4b[_0xc8e9('0x10')],'transfereelinkedid':_0x5f4b4b[_0xc8e9('0x11')],'isexternal':_0x5f4b4b[_0xc8e9('0x12')],'context':_0x5f4b4b[_0xc8e9('0x13')],'extension':_0x5f4b4b[_0xc8e9('0x14')],'type':'blind'},'log':_0xc8e9('0x3')});};exports[_0xc8e9('0x15')]=function(_0x361a9a){return client[_0xc8e9('0x2')](_0xc8e9('0x3'),{'body':{'result':_0x361a9a[_0xc8e9('0x4')],'transfererchannel':_0x361a9a[_0xc8e9('0x16')],'transferercalleridnum':_0x361a9a[_0xc8e9('0x17')],'transferercalleridname':_0x361a9a[_0xc8e9('0x18')],'transfererconnectedlinenum':_0x361a9a[_0xc8e9('0x19')],'transfererconnectedlinename':_0x361a9a['secondtransfererconnectedlinename'],'transfereraccountcode':_0x361a9a[_0xc8e9('0x1a')],'transferercontext':_0x361a9a[_0xc8e9('0x1b')],'transfererexten':_0x361a9a[_0xc8e9('0x1c')],'transfererlinkedid':_0x361a9a[_0xc8e9('0x1d')],'transfereechannel':_0x361a9a[_0xc8e9('0x1e')],'transfereecalleridnum':_0x361a9a['transfertargetcalleridnum'],'transfereecalleridname':_0x361a9a[_0xc8e9('0x1f')],'transfereeconnectedlinenum':_0x361a9a[_0xc8e9('0x20')],'transfereeconnectedlinename':_0x361a9a[_0xc8e9('0x21')],'transfereeaccountcode':_0x361a9a['transfertargetaccountcode'],'transfereecontext':_0x361a9a[_0xc8e9('0x22')],'transfereeexten':_0x361a9a[_0xc8e9('0x23')],'transfereelinkedid':_0x361a9a[_0xc8e9('0x24')],'isexternal':_0x361a9a[_0xc8e9('0x12')],'context':_0x361a9a['origtransferercontext'],'extension':_0x361a9a['origtransfererexten'],'type':_0xc8e9('0x25')},'log':_0xc8e9('0x3')});};
\ No newline at end of file
index a15975e..fb29c56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39e6=['MixMonitor','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','monitors','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','context','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','faxAccounts','checkAfterSend','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','moment','../../../config/environment','../ami','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','action','Action','then','message','catch','username','content','voiceQueues','hasOwnProperty','strategy','available','pTalking','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','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','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','validate','map','find','uniqueid','channel','filename','wav'];(function(_0x5111ca,_0x274f66){var _0x5ebb7e=function(_0x37fa11){while(--_0x37fa11){_0x5111ca['push'](_0x5111ca['shift']());}};_0x5ebb7e(++_0x274f66);}(_0x39e6,0x9e));var _0x639e=function(_0x486f2f,_0x64c4d1){_0x486f2f=_0x486f2f-0x0;var _0x42c463=_0x39e6[_0x486f2f];return _0x42c463;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var jayson=require(_0x639e('0x1'));var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x639e('0x2'));var config=require(_0x639e('0x3'));var properties=require('../properties');var ami=require(_0x639e('0x4'));exports[_0x639e('0x5')]=function(_0x199e72,_0x2935fd,_0x15e5df){return new BPromise(function(_0x320448,_0x3812c0){var _0x21db36={'QueuePause':function(_0x36b11f){return new Promise(function(_0x134eec,_0x29e806){var _0x2fab76=util[_0x639e('0x6')](_0x639e('0x7'),_0x639e('0x8'),_0x36b11f[_0x639e('0x9')]);if(_0x199e72[_0x639e('0xa')]&&_0x199e72[_0x639e('0xa')][_0x2fab76]&&_0x199e72['timers'][_0x2fab76]['timer']){_0x199e72[_0x639e('0xa')][_0x2fab76][_0x639e('0xb')]();}if(_0x199e72[_0x639e('0xc')][_0x2fab76]){_0x199e72[_0x639e('0xc')][_0x2fab76][_0x639e('0xd')]({'statePause':_0x36b11f[_0x639e('0xe')]?!![]:![]});}_0x134eec({'code':0xc8,'message':_0x639e('0xf')});});},'Reload':function(_0x4f3d38){var _0x56d9bb=this;return new Promise(function(_0x3c6a33,_0x3a1693){if(ami[_0x639e('0x10')]()==![]){return _0x3a1693(_0x56d9bb[_0x639e('0x11')](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')]['username'],_0x639e('0x13')][_0x639e('0x14')]('\x20')));}_0x4f3d38=_[_0x639e('0x15')](_0x4f3d38,_[_0x639e('0x16')](properties['module']));_0x4f3d38[_0x639e('0x17')]='Reload';return ami[_0x639e('0x18')](_0x4f3d38)[_0x639e('0x19')](function(_0x391957){_0x3c6a33({'code':0xc8,'message':_0x391957[_0x639e('0x1a')]});})[_0x639e('0x1b')](function(_0x1c023e){_0x3a1693(_0x56d9bb['error'](0x1f5,_0x1c023e[_0x639e('0x1a')]));});});},'Command':function(_0x34baca){var _0x36f71d=this;return new Promise(function(_0x1da55e,_0x59f772){if(ami[_0x639e('0x10')]()==![]){return _0x59f772(_0x36f71d[_0x639e('0x11')](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')][_0x639e('0x1c')],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}_0x34baca=_[_0x639e('0x15')](_0x34baca,'command');_0x34baca[_0x639e('0x17')]='Command';return ami['Action'](_0x34baca)[_0x639e('0x19')](function(_0x3813f6){_0x1da55e({'code':0xc8,'message':_0x3813f6[_0x639e('0x1d')]});})[_0x639e('0x1b')](function(_0x211fcb){_0x59f772(_0x36f71d['error'](0x1f5,_0x211fcb[_0x639e('0x1a')]));});});},'VoiceQueues':function(_0x3647d9){return new Promise(function(_0x39b44f,_0x2da264){var _0x2df4d1=[];for(var _0x5f27f6 in _0x199e72[_0x639e('0x1e')]){if(_0x199e72[_0x639e('0x1e')][_0x639e('0x1f')](_0x5f27f6)){var _0x10abb0=_0x199e72['voiceQueues'][_0x5f27f6];var _0x2ae3b7={'id':_0x10abb0['id'],'name':_0x10abb0[_0x639e('0x9')],'strategy':_0x10abb0[_0x639e('0x20')],'answered':_0x10abb0['answered'],'available':_0x10abb0[_0x639e('0x21')],'loggedIn':_0x10abb0['loggedIn'],'pTalking':_0x10abb0[_0x639e('0x22')],'sumBillable':_0x10abb0['sumBillable'],'sumDuration':_0x10abb0['sumDuration'],'sumHoldTime':_0x10abb0[_0x639e('0x23')]||0x0,'talking':_0x10abb0[_0x639e('0x24')],'total':_0x10abb0[_0x639e('0x25')],'type':_0x10abb0[_0x639e('0x26')],'unmanaged':_0x10abb0[_0x639e('0x27')],'abandoned':_0x10abb0[_0x639e('0x28')],'waiting':_0x10abb0['waiting'],'loggedInDb':_0x10abb0[_0x639e('0x29')]};if(_0x10abb0[_0x639e('0x26')]==='outbound'){_0x2ae3b7['dialActive']=_0x10abb0[_0x639e('0x2a')];_0x2ae3b7[_0x639e('0x2b')]=_0x10abb0[_0x639e('0x2b')];_0x2ae3b7['dialOriginateCallerIdName']=_0x10abb0[_0x639e('0x2c')];_0x2ae3b7['dialOriginateCallerIdNumber']=_0x10abb0[_0x639e('0x2d')];_0x2ae3b7[_0x639e('0x2e')]=_0x10abb0[_0x639e('0x2e')];_0x2ae3b7['dialPrefix']=_0x10abb0[_0x639e('0x2f')];_0x2ae3b7['temp']=_0x10abb0[_0x639e('0x30')];_0x2ae3b7[_0x639e('0x31')]=_0x10abb0[_0x639e('0x31')];_0x2ae3b7['outboundAnswerCallsDay']=_0x10abb0[_0x639e('0x32')];_0x2ae3b7[_0x639e('0x33')]=_0x10abb0[_0x639e('0x33')];_0x2ae3b7['outboundBusyCallsDay']=_0x10abb0[_0x639e('0x34')];_0x2ae3b7['outboundCongestionCallsDay']=_0x10abb0[_0x639e('0x35')];_0x2ae3b7[_0x639e('0x36')]=_0x10abb0[_0x639e('0x36')];_0x2ae3b7[_0x639e('0x37')]=_0x10abb0[_0x639e('0x37')];_0x2ae3b7['outboundDropCallsDayTimeout']=_0x10abb0[_0x639e('0x38')];_0x2ae3b7[_0x639e('0x39')]=_0x10abb0[_0x639e('0x39')];_0x2ae3b7[_0x639e('0x3a')]=_0x10abb0['outboundNoSuchCallsDay'];_0x2ae3b7[_0x639e('0x3b')]=_0x10abb0[_0x639e('0x3b')];_0x2ae3b7[_0x639e('0x3c')]=_0x10abb0['outboundReCallsDay'];_0x2ae3b7[_0x639e('0x3d')]=_0x10abb0['outboundRejectCallsDay'];_0x2ae3b7[_0x639e('0x3e')]=_0x10abb0[_0x639e('0x3e')];_0x2ae3b7[_0x639e('0x3f')]=_0x10abb0[_0x639e('0x3f')];_0x2ae3b7[_0x639e('0x40')]=_0x10abb0[_0x639e('0x40')];_0x2ae3b7['predictiveIntervalAvgTalktime']=_0x10abb0[_0x639e('0x41')];_0x2ae3b7[_0x639e('0x42')]=_0x10abb0['predictiveIntervalDroppedCallsCallersExit'];_0x2ae3b7[_0x639e('0x43')]=_0x10abb0['predictiveIntervalDroppedCallsTimeout'];_0x2ae3b7[_0x639e('0x44')]=_0x10abb0[_0x639e('0x44')];_0x2ae3b7[_0x639e('0x45')]=_0x10abb0[_0x639e('0x45')];_0x2ae3b7[_0x639e('0x46')]=_0x10abb0[_0x639e('0x46')];_0x2ae3b7[_0x639e('0x47')]=_0x10abb0[_0x639e('0x47')];_0x2ae3b7['predictiveIntervalPauses']=_0x10abb0['predictiveIntervalPauses'];_0x2ae3b7['predictiveIntervalAvailable']=_0x10abb0['predictiveIntervalAvailable'];_0x2ae3b7[_0x639e('0x48')]=_0x10abb0[_0x639e('0x48')];_0x2ae3b7['message']=_0x10abb0[_0x639e('0x1a')];_0x2ae3b7[_0x639e('0x49')]=_0x10abb0[_0x639e('0x49')];_0x2ae3b7['erlangCalls']=_0x10abb0[_0x639e('0x4a')];_0x2ae3b7[_0x639e('0x4b')]=_0x10abb0[_0x639e('0x4b')];_0x2ae3b7[_0x639e('0x4c')]=_0x10abb0[_0x639e('0x4c')];_0x2ae3b7[_0x639e('0x4d')]=_0x10abb0[_0x639e('0x4d')];_0x2ae3b7[_0x639e('0x4e')]=_0x10abb0[_0x639e('0x4e')];_0x2ae3b7['startProgressive']=_0x10abb0[_0x639e('0x4f')];}if(_0x10abb0[_0x639e('0x50')]){_0x2ae3b7[_0x639e('0x50')]={'id':_0x10abb0[_0x639e('0x50')]['id'],'name':_0x10abb0[_0x639e('0x50')][_0x639e('0x9')],'active':_0x10abb0['Trunk'][_0x639e('0x51')],'callerid':_0x10abb0[_0x639e('0x50')][_0x639e('0x52')]};}if(_0x10abb0[_0x639e('0x53')]){_0x2ae3b7[_0x639e('0x53')]={'id':_0x10abb0[_0x639e('0x53')]['id'],'name':_0x10abb0[_0x639e('0x53')][_0x639e('0x9')]};}_0x2df4d1[_0x639e('0x54')](_0x2ae3b7);}}_0x39b44f({'count':_0x2df4d1[_0x639e('0x55')],'rows':_0x2df4d1});});},'UpdateVoiceQueue':function(_0x2c504e){return new Promise(function(_0x2a679c,_0x4e01f1){var _0xe25497=_['find'](_0x199e72['voiceQueues'],{'id':parseInt(_0x2c504e['id'])});var _0x261d6a=_[_0x639e('0x56')](_0x2c504e,['id']);if(_0xe25497){for(var _0x44a3e5 in _0x261d6a){if(typeof _0x261d6a[_0x44a3e5]!==_0x639e('0x57')&&typeof _0xe25497[_0x44a3e5]!==_0x639e('0x57')){_0xe25497[_0x44a3e5]=_0x261d6a[_0x44a3e5];}}_0x2a679c(_0xe25497);}else{_0x4e01f1();}});},'VoiceChannels':function(_0x5b27b6){return new Promise(function(_0x2b0dbb,_0x1fa830){var _0x56ecea=_[_0x639e('0x58')](_0x199e72[_0x639e('0x59')]);_0x2b0dbb({'count':_0x56ecea[_0x639e('0x55')],'rows':_0x56ecea});});},'VoiceChannelMixMonitor':function(_0x4c5899){var _0x12e146=this;return new Promise(function(_0x1d9fc5,_0x32add6){if(ami[_0x639e('0x10')]()==![]){return _0x32add6(_0x12e146['error'](0x1f4,[config[_0x639e('0x12')]['ip'],config['asterisk'][_0x639e('0x1c')],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}var _0x413ebd=schema(properties[_0x639e('0x5a')])[_0x639e('0x5b')](_0x4c5899);if(_0x413ebd[_0x639e('0x55')]>0x0){return _0x32add6(_0x12e146['error'](0x1f4,_[_0x639e('0x5c')](_0x413ebd,_0x639e('0x1a'))[_0x639e('0x14')](',\x20')));}var _0x4dab80=_[_0x639e('0x5d')](_0x199e72[_0x639e('0x59')],{'uniqueid':_0x4c5899[_0x639e('0x5e')]});if(_0x4dab80&&_0x4dab80[_0x639e('0x5f')]){var _0x5292ef=util[_0x639e('0x6')]('%s.%s',_0x4c5899[_0x639e('0x60')]||_0x4c5899[_0x639e('0x5e')],_0x4c5899[_0x639e('0x6')]||_0x639e('0x61'));return ami['Action']({'action':_0x639e('0x62'),'channel':_0x4dab80['channel'],'file':_0x5292ef,'options':'ai(mixmonitorid)'})[_0x639e('0x19')](function(_0x1e9278){var _0x1daeea=_[_0x639e('0x5d')](_0x4dab80['monitors'],{'filename':_0x639e('0x63')+_0x5292ef[_0x639e('0x64')]()});if(_[_0x639e('0x65')](_0x1daeea)){_0x4dab80['monitors'][_0x639e('0x54')]({'filename':_0x639e('0x63')+_0x5292ef[_0x639e('0x64')](),'createdAt':moment()[_0x639e('0x6')](_0x639e('0x66')),'mixmonitorid':_0x1e9278[_0x639e('0x67')],'status':_0x639e('0x68')});}else{_0x1daeea['mixmonitorid']=_0x1e9278[_0x639e('0x67')];_0x1daeea[_0x639e('0x69')]=_0x639e('0x68');}_0x1d9fc5({'code':0xc8,'message':[_0x4c5899[_0x639e('0x5e')],'MixMonitor\x20Success',_0x1e9278[_0x639e('0x67')]][_0x639e('0x14')]('\x20'),'mixmonitorid':_0x1e9278[_0x639e('0x67')]});})['catch'](function(_0x4ecd7e){_0x32add6(_0x12e146['error'](0x1f5,[_0x4c5899[_0x639e('0x5e')],_0x4ecd7e[_0x639e('0x1a')]['toLowerCase']()][_0x639e('0x14')]('\x20')));});}else{return _0x32add6(_0x12e146[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x29314a){var _0x3d116a=this;return new Promise(function(_0x5bab36,_0x427f11){if(ami[_0x639e('0x10')]()==![]){return _0x427f11(_0x3d116a['error'](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')]['username'],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}var _0x549d44=schema(properties[_0x639e('0x5a')])[_0x639e('0x5b')](_0x29314a);if(_0x549d44[_0x639e('0x55')]>0x0){return _0x427f11(_0x3d116a['error'](0x1f4,_[_0x639e('0x5c')](_0x549d44,_0x639e('0x1a'))[_0x639e('0x14')](',\x20')));}var _0x3b8401=_['find'](_0x199e72[_0x639e('0x59')],{'uniqueid':_0x29314a[_0x639e('0x5e')]});if(_0x3b8401){return BPromise['resolve']()[_0x639e('0x19')](function(){if(_0x3b8401[_0x639e('0x5f')]){return ami[_0x639e('0x18')]({'action':_0x639e('0x6b'),'channel':_0x3b8401[_0x639e('0x5f')],'mixmonitorid':_0x29314a['mixmonitorid']})[_0x639e('0x1b')](function(_0x94fab4){});}})[_0x639e('0x19')](function(){if(_0x3b8401[_0x639e('0x6c')]){return ami[_0x639e('0x18')]({'action':_0x639e('0x6b'),'channel':_0x3b8401[_0x639e('0x6c')],'mixmonitorid':_0x29314a[_0x639e('0x67')]})[_0x639e('0x1b')](function(_0x22fca7){});}})['then'](function(_0x5982a0){var _0xdeb345=_[_0x639e('0x5d')](_0x3b8401[_0x639e('0x6d')],{'mixmonitorid':_0x29314a[_0x639e('0x67')]});if(_0xdeb345){_0xdeb345[_0x639e('0x69')]='stop';}})[_0x639e('0x19')](function(){var _0x48fc0e=util[_0x639e('0x6')](_0x639e('0x6e'),_0x29314a[_0x639e('0x60')]||_0x29314a['uniqueid'],_0x29314a['format']||_0x639e('0x61'));var _0x2a5ca9=_[_0x639e('0x5d')](_0x3b8401['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x48fc0e[_0x639e('0x64')]()});if(_0x2a5ca9){_0x2a5ca9[_0x639e('0x69')]='stop';}})[_0x639e('0x19')](function(){_0x5bab36({'code':0xc8,'message':[_0x29314a[_0x639e('0x5e')],_0x639e('0x6f')][_0x639e('0x14')]('\x20')});})['catch'](function(_0x476d46){_0x427f11(_0x3d116a[_0x639e('0x11')](0x1f5,[_0x29314a[_0x639e('0x5e')],_0x476d46[_0x639e('0x1a')]['toLowerCase']()][_0x639e('0x14')]('\x20')));});}else{return _0x427f11(_0x3d116a[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'VoiceQueuesChannels':function(_0x3c945c){return new Promise(function(_0x806962,_0x4d7e98){var _0x207e2c=_[_0x639e('0x58')](_0x199e72[_0x639e('0x70')]);_0x806962({'count':_0x207e2c[_0x639e('0x55')],'rows':_0x207e2c});});},'VoiceQueuesChannel':function(_0x2aa53b){var _0x250046=this;return new Promise(function(_0x606061,_0x31a209){var _0x3a87e3=schema(properties['voicequeuechannel'])[_0x639e('0x5b')](_0x2aa53b);if(_0x3a87e3[_0x639e('0x55')]>0x0){return _0x31a209(_0x250046[_0x639e('0x11')](0x1f4,_[_0x639e('0x5c')](_0x3a87e3,_0x639e('0x1a'))['join'](',\x20')));}var _0x5c265c=_[_0x639e('0x5d')](_0x199e72['queueChannels'],{'uniqueid':_0x2aa53b[_0x639e('0x5e')]});if(_0x5c265c){_0x606061(_0x5c265c);}else{return _0x31a209(_0x250046[_0x639e('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x27517f){var _0xbe7032=this;return new Promise(function(_0x821ac7,_0x3f347b){if(ami['isConnected']()==![]){return _0x3f347b(_0xbe7032[_0x639e('0x11')](0x1f4,[config[_0x639e('0x12')]['ip'],config[_0x639e('0x12')][_0x639e('0x1c')],'ami\x20disconnected'][_0x639e('0x14')]('\x20')));}var _0x5f324b=schema(properties[_0x639e('0x71')])[_0x639e('0x5b')](_0x27517f);if(_0x5f324b[_0x639e('0x55')]>0x0){return _0x3f347b(_0xbe7032['error'](0x1f4,_[_0x639e('0x5c')](_0x5f324b,_0x639e('0x1a'))[_0x639e('0x14')](',\x20')));}var _0x2d0ef5=_[_0x639e('0x5d')](_0x199e72['queueChannels'],{'uniqueid':_0x27517f['uniqueid']});if(_0x2d0ef5&&_0x2d0ef5[_0x639e('0x5f')]){return ami[_0x639e('0x18')]({'action':_0x639e('0x72'),'channel':_0x2d0ef5[_0x639e('0x5f')]})[_0x639e('0x19')](function(_0x4d2b66){_0x821ac7({'code':0xc8,'message':[_0x27517f[_0x639e('0x5e')],_0x4d2b66[_0x639e('0x1a')][_0x639e('0x64')]()][_0x639e('0x14')]('\x20')});})[_0x639e('0x1b')](function(_0x433bb6){_0x3f347b(_0xbe7032[_0x639e('0x11')](0x1f5,[_0x27517f[_0x639e('0x5e')],_0x433bb6['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x3f347b(_0xbe7032[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x413fb5){var _0x13e28d=this;return new Promise(function(_0x2a2e9b,_0x3c9ac4){if(ami[_0x639e('0x10')]()==![]){return _0x3c9ac4(_0x13e28d['error'](0x1f4,[config[_0x639e('0x12')]['ip'],config['asterisk'][_0x639e('0x1c')],_0x639e('0x13')][_0x639e('0x14')]('\x20')));}var _0x457f21=schema(properties['voicequeuechannelredirect'])[_0x639e('0x5b')](_0x413fb5);if(_0x457f21[_0x639e('0x55')]>0x0){return _0x3c9ac4(_0x13e28d[_0x639e('0x11')](0x1f4,_[_0x639e('0x5c')](_0x457f21,'message')[_0x639e('0x14')](',\x20')));}var _0xd66e73=_[_0x639e('0x5d')](_0x199e72[_0x639e('0x70')],{'uniqueid':_0x413fb5['uniqueid']});if(_0xd66e73&&_0xd66e73[_0x639e('0x5f')]){return ami[_0x639e('0x18')]({'action':'Redirect','channel':_0xd66e73[_0x639e('0x5f')],'exten':_0x413fb5['exten'],'context':_0x413fb5[_0x639e('0x73')]||_0xd66e73[_0x639e('0x73')],'priority':0x1})[_0x639e('0x19')](function(_0x2b2799){_0x2a2e9b({'code':0xc8,'message':[_0x413fb5[_0x639e('0x5e')],_0x2b2799['message'][_0x639e('0x64')]()][_0x639e('0x14')]('\x20')});})[_0x639e('0x1b')](function(_0x5495d5){_0x3c9ac4(_0x13e28d[_0x639e('0x11')](0x1f5,[_0x413fb5[_0x639e('0x5e')],_0x5495d5[_0x639e('0x1a')]['toLowerCase']()][_0x639e('0x14')]('\x20')));});}else{return _0x3c9ac4(_0x13e28d[_0x639e('0x11')](0x1f5,_0x639e('0x6a')));}});},'Agents':function(_0x1839ae){return new Promise(function(_0x351459,_0x31facd){var _0x2669a3=_[_0x639e('0x58')](_0x199e72[_0x639e('0xc')]);_0x351459({'count':_0x2669a3[_0x639e('0x55')],'rows':_0x2669a3});});},'Telephones':function(_0x3a90e2){return new Promise(function(_0x101230,_0x34183e){var _0x498ced=_[_0x639e('0x58')](_0x199e72['telephones']);_0x101230({'count':_0x498ced[_0x639e('0x55')],'rows':_0x498ced});});},'Trunks':function(_0x25faba){return new Promise(function(_0x91c03,_0x40625b){var _0x2d5f67=_['values'](_0x199e72[_0x639e('0x74')]);_0x91c03({'count':_0x2d5f67[_0x639e('0x55')],'rows':_0x2d5f67});});},'OutboundChannels':function(_0x38d5d4){return new Promise(function(_0x2cd5c6,_0x452085){var _0x1c14a3=_[_0x639e('0x58')](_0x199e72[_0x639e('0x75')]);_0x2cd5c6({'count':_0x1c14a3[_0x639e('0x55')],'rows':_0x1c14a3});});},'Outbound':function(_0x3d2a25){return new Promise(function(_0x28e379,_0x59b26e){_0x28e379(_0x199e72['outbound']);});},'Campaigns':function(_0x284de7){return new Promise(function(_0x1e8927,_0x2146fe){var _0x4ce384=_[_0x639e('0x58')](_0x199e72[_0x639e('0x76')]);_0x1e8927({'count':_0x4ce384[_0x639e('0x55')],'rows':_0x4ce384});});},'VoiceQueuesPreview':function(_0x516e7f){var _0xe9bfb9=this;return new Promise(function(_0x33d71e,_0x1664fd){_0x2935fd['run'](_0x516e7f['id'])[_0x639e('0x19')](function(_0x66f38a){_0x33d71e({'code':0xc8,'message':_0x66f38a[_0x639e('0x1a')]});})[_0x639e('0x1b')](function(_0x30911e){_0x1664fd(_0xe9bfb9[_0x639e('0x11')](0x1f4,_0x30911e[_0x639e('0x1a')]));});});},'EventManager':function(_0x167ec3){var _0x581d53=this;return new Promise(function(_0xfa5b9,_0x53cbcc){if(!_0x167ec3[_0x639e('0x77')]){return _0x53cbcc(_0x581d53[_0x639e('0x11')](0x1f4,_0x639e('0x78')));}ami[_0x639e('0x79')]('custom:'+_0x167ec3[_0x639e('0x77')],_0x167ec3[_0x639e('0x1a')]);_0xfa5b9({'code':0xc8,'message':_0x167ec3});});},'FaxAccounts':function(_0x56b313){return new Promise(function(_0x47bf07,_0xedca5f){var _0x24d1b3=_[_0x639e('0x58')](_0x199e72[_0x639e('0x7a')]);_0x47bf07({'count':_0x24d1b3[_0x639e('0x55')],'rows':_0x24d1b3});});},'SendFax':function(_0x195b09){var _0x1b53b2=this;return new Promise(function(_0x413d4d,_0x4522cc){_0x15e5df['send'](_0x195b09)[_0x639e('0x19')](function(_0x3a51e1){_0x413d4d({'code':0xc8,'message':_0x3a51e1[_0x639e('0x1a')]});})[_0x639e('0x1b')](function(_0x255562){_0x4522cc(_0x1b53b2[_0x639e('0x11')](0x1f4,_0x255562[_0x639e('0x1a')]));});});},'CheckAfterSend':function(_0x4e41a2){var _0x125490=this;return new Promise(function(_0x418264,_0x585f04){_0x15e5df[_0x639e('0x7b')](_0x4e41a2)[_0x639e('0x19')](function(_0x203a59){_0x418264({'code':0xc8,'message':_0x203a59['message']});})['catch'](function(_0x2b83c7){_0x585f04(_0x125490['error'](0x1f4,_0x2b83c7[_0x639e('0x1a')]));});});}};var _0x1d5f57=jayson['server'](_0x21db36)[_0x639e('0x7c')]();_0x1d5f57['on'](_0x639e('0x11'),function(_0x282c08){return _0x3812c0(_0x282c08);});_0x1d5f57[_0x639e('0x5')](0x232a,_0x639e('0x7d'),function(){console['log'](_0x639e('0x7e'),0x232a);return _0x320448(_0x639e('0x7f')+0x232a);});});};
\ No newline at end of file
+var _0xa23f=['isConnected','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Reload','Action','then','command','content','message','voiceQueues','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','isNil','push','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','toLowerCase','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','catch','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','campaigns','run','custom:','event','faxAccounts','send','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','bluebird','moment','../../../config/environment','../properties','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','pause','QueuePause'];(function(_0x374ac5,_0x1f8cbd){var _0x29e069=function(_0x2a3abc){while(--_0x2a3abc){_0x374ac5['push'](_0x374ac5['shift']());}};_0x29e069(++_0x1f8cbd);}(_0xa23f,0x7c));var _0xfa23=function(_0x51500b,_0x137d5c){_0x51500b=_0x51500b-0x0;var _0x5405df=_0xa23f[_0x51500b];return _0x5405df;};'use strict';var _=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0xfa23('0x2'));var moment=require(_0xfa23('0x3'));var config=require(_0xfa23('0x4'));var properties=require(_0xfa23('0x5'));var ami=require('../ami');exports[_0xfa23('0x6')]=function(_0x53d8c8,_0x210057,_0x2df2f5){return new BPromise(function(_0x4c3f4,_0x3696ef){var _0x4fb6e6={'QueuePause':function(_0x5a7882){return new Promise(function(_0x59d53e,_0x19a1ac){var _0x4066a2=util[_0xfa23('0x7')](_0xfa23('0x8'),_0xfa23('0x9'),_0x5a7882['name']);if(_0x53d8c8['timers']&&_0x53d8c8[_0xfa23('0xa')][_0x4066a2]&&_0x53d8c8['timers'][_0x4066a2][_0xfa23('0xb')]){_0x53d8c8['timers'][_0x4066a2][_0xfa23('0xc')]();}if(_0x53d8c8[_0xfa23('0xd')][_0x4066a2]){_0x53d8c8[_0xfa23('0xd')][_0x4066a2]['updateStatusRealtime']({'statePause':_0x5a7882[_0xfa23('0xe')]?!![]:![]});}_0x59d53e({'code':0xc8,'message':_0xfa23('0xf')});});},'Reload':function(_0x46f991){var _0x5ea9ca=this;return new Promise(function(_0x56f927,_0x17e782){if(ami[_0xfa23('0x10')]()==![]){return _0x17e782(_0x5ea9ca[_0xfa23('0x11')](0x1f4,[config[_0xfa23('0x12')]['ip'],config['asterisk'][_0xfa23('0x13')],_0xfa23('0x14')][_0xfa23('0x15')]('\x20')));}_0x46f991=_[_0xfa23('0x16')](_0x46f991,_['keys'](properties[_0xfa23('0x17')]));_0x46f991[_0xfa23('0x18')]=_0xfa23('0x19');return ami[_0xfa23('0x1a')](_0x46f991)[_0xfa23('0x1b')](function(_0x4e5b77){_0x56f927({'code':0xc8,'message':_0x4e5b77['message']});})['catch'](function(_0x445bd0){_0x17e782(_0x5ea9ca[_0xfa23('0x11')](0x1f5,_0x445bd0['message']));});});},'Command':function(_0x9effe6){var _0x2c456b=this;return new Promise(function(_0x1eb87e,_0x54bb04){if(ami[_0xfa23('0x10')]()==![]){return _0x54bb04(_0x2c456b[_0xfa23('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xfa23('0x12')][_0xfa23('0x13')],_0xfa23('0x14')][_0xfa23('0x15')]('\x20')));}_0x9effe6=_[_0xfa23('0x16')](_0x9effe6,_0xfa23('0x1c'));_0x9effe6[_0xfa23('0x18')]='Command';return ami[_0xfa23('0x1a')](_0x9effe6)[_0xfa23('0x1b')](function(_0x34a2ce){_0x1eb87e({'code':0xc8,'message':_0x34a2ce[_0xfa23('0x1d')]});})['catch'](function(_0x4500a2){_0x54bb04(_0x2c456b['error'](0x1f5,_0x4500a2[_0xfa23('0x1e')]));});});},'VoiceQueues':function(_0x1abb42){return new Promise(function(_0x2481e9,_0x26bdce){var _0x3362f3=[];for(var _0x1340d9 in _0x53d8c8[_0xfa23('0x1f')]){if(_0x53d8c8[_0xfa23('0x1f')]['hasOwnProperty'](_0x1340d9)){var _0x2ae826=_0x53d8c8['voiceQueues'][_0x1340d9];var _0x1ae38a={'id':_0x2ae826['id'],'name':_0x2ae826['name'],'strategy':_0x2ae826['strategy'],'answered':_0x2ae826[_0xfa23('0x20')],'available':_0x2ae826[_0xfa23('0x21')],'loggedIn':_0x2ae826[_0xfa23('0x22')],'pTalking':_0x2ae826[_0xfa23('0x23')],'sumBillable':_0x2ae826[_0xfa23('0x24')],'sumDuration':_0x2ae826[_0xfa23('0x25')],'sumHoldTime':_0x2ae826[_0xfa23('0x26')]||0x0,'talking':_0x2ae826['talking'],'total':_0x2ae826[_0xfa23('0x27')],'type':_0x2ae826['type'],'unmanaged':_0x2ae826[_0xfa23('0x28')],'abandoned':_0x2ae826[_0xfa23('0x29')],'waiting':_0x2ae826['waiting'],'loggedInDb':_0x2ae826[_0xfa23('0x2a')]};if(_0x2ae826[_0xfa23('0x2b')]===_0xfa23('0x2c')){_0x1ae38a[_0xfa23('0x2d')]=_0x2ae826[_0xfa23('0x2d')];_0x1ae38a[_0xfa23('0x2e')]=_0x2ae826[_0xfa23('0x2e')];_0x1ae38a[_0xfa23('0x2f')]=_0x2ae826[_0xfa23('0x2f')];_0x1ae38a['dialOriginateCallerIdNumber']=_0x2ae826[_0xfa23('0x30')];_0x1ae38a['dialOriginateTimeout']=_0x2ae826[_0xfa23('0x31')];_0x1ae38a[_0xfa23('0x32')]=_0x2ae826[_0xfa23('0x32')];_0x1ae38a[_0xfa23('0x33')]=_0x2ae826[_0xfa23('0x33')];_0x1ae38a[_0xfa23('0x34')]=_0x2ae826[_0xfa23('0x34')];_0x1ae38a[_0xfa23('0x35')]=_0x2ae826[_0xfa23('0x35')];_0x1ae38a['outboundBlacklistCallsDay']=_0x2ae826[_0xfa23('0x36')];_0x1ae38a['outboundBusyCallsDay']=_0x2ae826[_0xfa23('0x37')];_0x1ae38a[_0xfa23('0x38')]=_0x2ae826[_0xfa23('0x38')];_0x1ae38a[_0xfa23('0x39')]=_0x2ae826[_0xfa23('0x39')];_0x1ae38a[_0xfa23('0x3a')]=_0x2ae826[_0xfa23('0x3a')];_0x1ae38a['outboundDropCallsDayTimeout']=_0x2ae826[_0xfa23('0x3b')];_0x1ae38a[_0xfa23('0x3c')]=_0x2ae826[_0xfa23('0x3c')];_0x1ae38a[_0xfa23('0x3d')]=_0x2ae826['outboundNoSuchCallsDay'];_0x1ae38a['outboundOriginateFailureCallsDay']=_0x2ae826['outboundOriginateFailureCallsDay'];_0x1ae38a[_0xfa23('0x3e')]=_0x2ae826[_0xfa23('0x3e')];_0x1ae38a['outboundRejectCallsDay']=_0x2ae826[_0xfa23('0x3f')];_0x1ae38a[_0xfa23('0x40')]=_0x2ae826[_0xfa23('0x40')];_0x1ae38a['predictiveIntervalAnsweredCalls']=_0x2ae826[_0xfa23('0x41')];_0x1ae38a['predictiveIntervalAvgHoldtime']=_0x2ae826[_0xfa23('0x42')];_0x1ae38a[_0xfa23('0x43')]=_0x2ae826[_0xfa23('0x43')];_0x1ae38a[_0xfa23('0x44')]=_0x2ae826[_0xfa23('0x44')];_0x1ae38a[_0xfa23('0x45')]=_0x2ae826['predictiveIntervalDroppedCallsTimeout'];_0x1ae38a[_0xfa23('0x46')]=_0x2ae826[_0xfa23('0x46')];_0x1ae38a[_0xfa23('0x47')]=_0x2ae826[_0xfa23('0x47')];_0x1ae38a['predictiveIntervalHitRate']=_0x2ae826[_0xfa23('0x48')];_0x1ae38a[_0xfa23('0x49')]=_0x2ae826[_0xfa23('0x49')];_0x1ae38a[_0xfa23('0x4a')]=_0x2ae826[_0xfa23('0x4a')];_0x1ae38a[_0xfa23('0x4b')]=_0x2ae826['predictiveIntervalAvailable'];_0x1ae38a[_0xfa23('0x4c')]=_0x2ae826['predictiveIntervalTotalCalls'];_0x1ae38a['message']=_0x2ae826[_0xfa23('0x1e')];_0x1ae38a[_0xfa23('0x4d')]=_0x2ae826['originated'];_0x1ae38a[_0xfa23('0x4e')]=_0x2ae826[_0xfa23('0x4e')];_0x1ae38a[_0xfa23('0x4f')]=_0x2ae826['erlangCallToSecond'];_0x1ae38a[_0xfa23('0x50')]=_0x2ae826[_0xfa23('0x50')];_0x1ae38a[_0xfa23('0x51')]=_0x2ae826['erlangBusyFactor'];_0x1ae38a['startPredictive']=_0x2ae826[_0xfa23('0x52')];_0x1ae38a['startProgressive']=_0x2ae826[_0xfa23('0x53')];}if(_0x2ae826[_0xfa23('0x54')]){_0x1ae38a[_0xfa23('0x54')]={'id':_0x2ae826['Trunk']['id'],'name':_0x2ae826[_0xfa23('0x54')][_0xfa23('0x55')],'active':_0x2ae826[_0xfa23('0x54')][_0xfa23('0x56')],'callerid':_0x2ae826['Trunk'][_0xfa23('0x57')]};}if(_0x2ae826[_0xfa23('0x58')]){_0x1ae38a[_0xfa23('0x58')]={'id':_0x2ae826['Interval']['id'],'name':_0x2ae826['Interval'][_0xfa23('0x55')]};}_0x3362f3['push'](_0x1ae38a);}}_0x2481e9({'count':_0x3362f3[_0xfa23('0x59')],'rows':_0x3362f3});});},'UpdateVoiceQueue':function(_0x3bddca){return new Promise(function(_0x12b986,_0xf8b228){var _0x2fbf18=_[_0xfa23('0x5a')](_0x53d8c8['voiceQueues'],{'id':parseInt(_0x3bddca['id'])});var _0xd2345d=_[_0xfa23('0x5b')](_0x3bddca,['id']);if(_0x2fbf18){for(var _0x36a795 in _0xd2345d){if(typeof _0xd2345d[_0x36a795]!==_0xfa23('0x5c')&&typeof _0x2fbf18[_0x36a795]!==_0xfa23('0x5c')){_0x2fbf18[_0x36a795]=_0xd2345d[_0x36a795];}}_0x12b986(_0x2fbf18);}else{_0xf8b228();}});},'VoiceChannels':function(_0xf8b8c7){return new Promise(function(_0x4aba2a,_0x9e8cb6){var _0x36a02c=_[_0xfa23('0x5d')](_0x53d8c8[_0xfa23('0x5e')]);_0x4aba2a({'count':_0x36a02c[_0xfa23('0x59')],'rows':_0x36a02c});});},'VoiceChannelMixMonitor':function(_0x4bfe28){var _0x1fbdff=this;return new Promise(function(_0x213fcd,_0x18afb9){if(ami['isConnected']()==![]){return _0x18afb9(_0x1fbdff[_0xfa23('0x11')](0x1f4,[config[_0xfa23('0x12')]['ip'],config[_0xfa23('0x12')][_0xfa23('0x13')],_0xfa23('0x14')][_0xfa23('0x15')]('\x20')));}var _0x709755=schema(properties['voicechannel'])[_0xfa23('0x5f')](_0x4bfe28);if(_0x709755['length']>0x0){return _0x18afb9(_0x1fbdff[_0xfa23('0x11')](0x1f4,_[_0xfa23('0x60')](_0x709755,_0xfa23('0x1e'))[_0xfa23('0x15')](',\x20')));}var _0x12a984=_[_0xfa23('0x5a')](_0x53d8c8['channels'],{'uniqueid':_0x4bfe28[_0xfa23('0x61')]});if(_0x12a984&&_0x12a984[_0xfa23('0x62')]){var _0x2ec20b=util[_0xfa23('0x7')](_0xfa23('0x63'),_0x4bfe28[_0xfa23('0x64')]||_0x4bfe28[_0xfa23('0x61')],_0x4bfe28['format']||_0xfa23('0x65'));return ami[_0xfa23('0x1a')]({'action':_0xfa23('0x66'),'channel':_0x12a984[_0xfa23('0x62')],'file':_0x2ec20b,'options':'ai(mixmonitorid)'})[_0xfa23('0x1b')](function(_0x9bf852){var _0xe6cf80=_[_0xfa23('0x5a')](_0x12a984[_0xfa23('0x67')],{'filename':_0xfa23('0x68')+_0x2ec20b['toLowerCase']()});if(_[_0xfa23('0x69')](_0xe6cf80)){_0x12a984['monitors'][_0xfa23('0x6a')]({'filename':_0xfa23('0x68')+_0x2ec20b['toLowerCase'](),'createdAt':moment()[_0xfa23('0x7')](_0xfa23('0x6b')),'mixmonitorid':_0x9bf852['mixmonitorid'],'status':_0xfa23('0x6c')});}else{_0xe6cf80[_0xfa23('0x6d')]=_0x9bf852['mixmonitorid'];_0xe6cf80[_0xfa23('0x6e')]=_0xfa23('0x6c');}_0x213fcd({'code':0xc8,'message':[_0x4bfe28[_0xfa23('0x61')],_0xfa23('0x6f'),_0x9bf852['mixmonitorid']][_0xfa23('0x15')]('\x20'),'mixmonitorid':_0x9bf852[_0xfa23('0x6d')]});})['catch'](function(_0x2d1c75){_0x18afb9(_0x1fbdff[_0xfa23('0x11')](0x1f5,[_0x4bfe28[_0xfa23('0x61')],_0x2d1c75[_0xfa23('0x1e')][_0xfa23('0x70')]()][_0xfa23('0x15')]('\x20')));});}else{return _0x18afb9(_0x1fbdff['error'](0x1f5,_0xfa23('0x71')));}});},'VoiceChannelStopMixMonitor':function(_0x3a7fcb){var _0x10eb86=this;return new Promise(function(_0x5d479e,_0x125c46){if(ami[_0xfa23('0x10')]()==![]){return _0x125c46(_0x10eb86[_0xfa23('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xfa23('0x12')][_0xfa23('0x13')],_0xfa23('0x14')][_0xfa23('0x15')]('\x20')));}var _0x378d29=schema(properties['voicechannel'])['validate'](_0x3a7fcb);if(_0x378d29[_0xfa23('0x59')]>0x0){return _0x125c46(_0x10eb86[_0xfa23('0x11')](0x1f4,_[_0xfa23('0x60')](_0x378d29,_0xfa23('0x1e'))['join'](',\x20')));}var _0x5275d6=_[_0xfa23('0x5a')](_0x53d8c8[_0xfa23('0x5e')],{'uniqueid':_0x3a7fcb[_0xfa23('0x61')]});if(_0x5275d6){return BPromise[_0xfa23('0x72')]()['then'](function(){if(_0x5275d6[_0xfa23('0x62')]){return ami[_0xfa23('0x1a')]({'action':'StopMixMonitor','channel':_0x5275d6[_0xfa23('0x62')],'mixmonitorid':_0x3a7fcb[_0xfa23('0x6d')]})['catch'](function(_0x13af06){});}})[_0xfa23('0x1b')](function(){if(_0x5275d6[_0xfa23('0x73')]){return ami[_0xfa23('0x1a')]({'action':_0xfa23('0x74'),'channel':_0x5275d6[_0xfa23('0x73')],'mixmonitorid':_0x3a7fcb['mixmonitorid']})[_0xfa23('0x75')](function(_0x591953){});}})[_0xfa23('0x1b')](function(_0x263f8c){var _0x192d28=_[_0xfa23('0x5a')](_0x5275d6[_0xfa23('0x67')],{'mixmonitorid':_0x3a7fcb[_0xfa23('0x6d')]});if(_0x192d28){_0x192d28[_0xfa23('0x6e')]=_0xfa23('0x76');}})[_0xfa23('0x1b')](function(){var _0x4e05f0=util[_0xfa23('0x7')]('%s.%s',_0x3a7fcb[_0xfa23('0x64')]||_0x3a7fcb[_0xfa23('0x61')],_0x3a7fcb['format']||'wav');var _0x3f6070=_['find'](_0x5275d6[_0xfa23('0x67')],{'filename':_0xfa23('0x68')+_0x4e05f0[_0xfa23('0x70')]()});if(_0x3f6070){_0x3f6070[_0xfa23('0x6e')]=_0xfa23('0x76');}})[_0xfa23('0x1b')](function(){_0x5d479e({'code':0xc8,'message':[_0x3a7fcb[_0xfa23('0x61')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xfa23('0x75')](function(_0x1e540d){_0x125c46(_0x10eb86[_0xfa23('0x11')](0x1f5,[_0x3a7fcb[_0xfa23('0x61')],_0x1e540d['message'][_0xfa23('0x70')]()]['join']('\x20')));});}else{return _0x125c46(_0x10eb86[_0xfa23('0x11')](0x1f5,_0xfa23('0x71')));}});},'VoiceQueuesChannels':function(_0x20c757){return new Promise(function(_0x279d86,_0x74a9aa){var _0x3bf459=_[_0xfa23('0x5d')](_0x53d8c8[_0xfa23('0x77')]);_0x279d86({'count':_0x3bf459[_0xfa23('0x59')],'rows':_0x3bf459});});},'VoiceQueuesChannel':function(_0x4130cf){var _0x5c3a1e=this;return new Promise(function(_0x5b1337,_0x146e12){var _0x53fac6=schema(properties[_0xfa23('0x78')])['validate'](_0x4130cf);if(_0x53fac6[_0xfa23('0x59')]>0x0){return _0x146e12(_0x5c3a1e[_0xfa23('0x11')](0x1f4,_['map'](_0x53fac6,_0xfa23('0x1e'))['join'](',\x20')));}var _0x4e0a93=_[_0xfa23('0x5a')](_0x53d8c8[_0xfa23('0x77')],{'uniqueid':_0x4130cf['uniqueid']});if(_0x4e0a93){_0x5b1337(_0x4e0a93);}else{return _0x146e12(_0x5c3a1e[_0xfa23('0x11')](0x1f5,_0xfa23('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x2bd0f9){var _0x41287e=this;return new Promise(function(_0x3da38c,_0x1f359a){if(ami[_0xfa23('0x10')]()==![]){return _0x1f359a(_0x41287e['error'](0x1f4,[config[_0xfa23('0x12')]['ip'],config[_0xfa23('0x12')][_0xfa23('0x13')],_0xfa23('0x14')][_0xfa23('0x15')]('\x20')));}var _0x4c525f=schema(properties[_0xfa23('0x79')])['validate'](_0x2bd0f9);if(_0x4c525f['length']>0x0){return _0x1f359a(_0x41287e['error'](0x1f4,_[_0xfa23('0x60')](_0x4c525f,_0xfa23('0x1e'))[_0xfa23('0x15')](',\x20')));}var _0x4bdfee=_[_0xfa23('0x5a')](_0x53d8c8[_0xfa23('0x77')],{'uniqueid':_0x2bd0f9['uniqueid']});if(_0x4bdfee&&_0x4bdfee[_0xfa23('0x62')]){return ami[_0xfa23('0x1a')]({'action':_0xfa23('0x7a'),'channel':_0x4bdfee[_0xfa23('0x62')]})['then'](function(_0x5ef233){_0x3da38c({'code':0xc8,'message':[_0x2bd0f9[_0xfa23('0x61')],_0x5ef233['message'][_0xfa23('0x70')]()][_0xfa23('0x15')]('\x20')});})[_0xfa23('0x75')](function(_0x4a77e5){_0x1f359a(_0x41287e[_0xfa23('0x11')](0x1f5,[_0x2bd0f9[_0xfa23('0x61')],_0x4a77e5[_0xfa23('0x1e')][_0xfa23('0x70')]()][_0xfa23('0x15')]('\x20')));});}else{return _0x1f359a(_0x41287e[_0xfa23('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x1f2103){var _0x1f28a0=this;return new Promise(function(_0x37548a,_0x37d22c){if(ami[_0xfa23('0x10')]()==![]){return _0x37d22c(_0x1f28a0[_0xfa23('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xfa23('0x12')][_0xfa23('0x13')],'ami\x20disconnected'][_0xfa23('0x15')]('\x20')));}var _0x1f3286=schema(properties[_0xfa23('0x7b')])[_0xfa23('0x5f')](_0x1f2103);if(_0x1f3286[_0xfa23('0x59')]>0x0){return _0x37d22c(_0x1f28a0['error'](0x1f4,_[_0xfa23('0x60')](_0x1f3286,'message')['join'](',\x20')));}var _0x5e54bf=_['find'](_0x53d8c8[_0xfa23('0x77')],{'uniqueid':_0x1f2103['uniqueid']});if(_0x5e54bf&&_0x5e54bf[_0xfa23('0x62')]){return ami[_0xfa23('0x1a')]({'action':_0xfa23('0x7c'),'channel':_0x5e54bf[_0xfa23('0x62')],'exten':_0x1f2103[_0xfa23('0x7d')],'context':_0x1f2103[_0xfa23('0x7e')]||_0x5e54bf[_0xfa23('0x7e')],'priority':0x1})[_0xfa23('0x1b')](function(_0x53d266){_0x37548a({'code':0xc8,'message':[_0x1f2103[_0xfa23('0x61')],_0x53d266['message'][_0xfa23('0x70')]()][_0xfa23('0x15')]('\x20')});})['catch'](function(_0x2c4684){_0x37d22c(_0x1f28a0[_0xfa23('0x11')](0x1f5,[_0x1f2103['uniqueid'],_0x2c4684[_0xfa23('0x1e')]['toLowerCase']()][_0xfa23('0x15')]('\x20')));});}else{return _0x37d22c(_0x1f28a0['error'](0x1f5,_0xfa23('0x71')));}});},'Agents':function(_0x500dde){return new Promise(function(_0xea852,_0x249322){var _0x5751f5=_[_0xfa23('0x5d')](_0x53d8c8[_0xfa23('0xd')]);_0xea852({'count':_0x5751f5[_0xfa23('0x59')],'rows':_0x5751f5});});},'Telephones':function(_0x4c19d3){return new Promise(function(_0xf65690,_0x518e4d){var _0xfee428=_[_0xfa23('0x5d')](_0x53d8c8[_0xfa23('0x7f')]);_0xf65690({'count':_0xfee428[_0xfa23('0x59')],'rows':_0xfee428});});},'Trunks':function(_0x58f34e){return new Promise(function(_0x3e0a3e,_0x4aa9ba){var _0x30c836=_['values'](_0x53d8c8[_0xfa23('0x80')]);_0x3e0a3e({'count':_0x30c836[_0xfa23('0x59')],'rows':_0x30c836});});},'OutboundChannels':function(_0x70ba0f){return new Promise(function(_0x376b22,_0x3b5c4b){var _0x51e5fc=_[_0xfa23('0x5d')](_0x53d8c8['outboundChannels']);_0x376b22({'count':_0x51e5fc['length'],'rows':_0x51e5fc});});},'Outbound':function(_0x1bf189){return new Promise(function(_0x2c1e16,_0x37710e){_0x2c1e16(_0x53d8c8[_0xfa23('0x2c')]);});},'Campaigns':function(_0x49d168){return new Promise(function(_0x367701,_0x3ee296){var _0x1d300b=_[_0xfa23('0x5d')](_0x53d8c8[_0xfa23('0x81')]);_0x367701({'count':_0x1d300b[_0xfa23('0x59')],'rows':_0x1d300b});});},'VoiceQueuesPreview':function(_0x2bdc8e){var _0x331c65=this;return new Promise(function(_0x2afcf4,_0x1d657d){_0x210057[_0xfa23('0x82')](_0x2bdc8e['id'])[_0xfa23('0x1b')](function(_0x561942){_0x2afcf4({'code':0xc8,'message':_0x561942[_0xfa23('0x1e')]});})[_0xfa23('0x75')](function(_0x250869){_0x1d657d(_0x331c65[_0xfa23('0x11')](0x1f4,_0x250869[_0xfa23('0x1e')]));});});},'EventManager':function(_0x1cb225){var _0x43ea=this;return new Promise(function(_0x5a4ec3,_0x16ad12){if(!_0x1cb225['event']){return _0x16ad12(_0x43ea['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0xfa23('0x83')+_0x1cb225[_0xfa23('0x84')],_0x1cb225[_0xfa23('0x1e')]);_0x5a4ec3({'code':0xc8,'message':_0x1cb225});});},'FaxAccounts':function(_0x4da911){return new Promise(function(_0x413eff,_0x1d5f64){var _0x28ed8c=_[_0xfa23('0x5d')](_0x53d8c8[_0xfa23('0x85')]);_0x413eff({'count':_0x28ed8c['length'],'rows':_0x28ed8c});});},'SendFax':function(_0x1633eb){var _0x45c355=this;return new Promise(function(_0x19acfa,_0x154e8c){_0x2df2f5[_0xfa23('0x86')](_0x1633eb)[_0xfa23('0x1b')](function(_0x5618ed){_0x19acfa({'code':0xc8,'message':_0x5618ed['message']});})['catch'](function(_0x590f3f){_0x154e8c(_0x45c355[_0xfa23('0x11')](0x1f4,_0x590f3f[_0xfa23('0x1e')]));});});},'CheckAfterSend':function(_0x27fedb){var _0xa547c4=this;return new Promise(function(_0xed12f2,_0x5d4222){_0x2df2f5[_0xfa23('0x87')](_0x27fedb)[_0xfa23('0x1b')](function(_0x36b9c5){_0xed12f2({'code':0xc8,'message':_0x36b9c5['message']});})[_0xfa23('0x75')](function(_0x4cb34a){_0x5d4222(_0xa547c4['error'](0x1f4,_0x4cb34a[_0xfa23('0x1e')]));});});}};var _0x31b96e=jayson[_0xfa23('0x88')](_0x4fb6e6)[_0xfa23('0x89')]();_0x31b96e['on']('error',function(_0x6bdaf0){return _0x3696ef(_0x6bdaf0);});_0x31b96e[_0xfa23('0x6')](0x232a,'127.0.0.1',function(){console[_0xfa23('0x8a')](_0xfa23('0x8b'),0x232a);return _0x4c3f4('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index d4937ad..2e3d048 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x905f=['push','user:%s','name','format','trigger:%s','action','toLowerCase','merge','lodash','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','xmd-contactid','data3','split','phone','map','routeId','destcalleridnum','firstName','mobile','fax','createdAt','scheduledAt','resolve','then','getContacts','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridnum','isNil','calleridname','<unknown>','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Autocreate\x20disabled'];(function(_0x1ac6af,_0x9ee48f){var _0x21f6ef=function(_0x27c5a2){while(--_0x27c5a2){_0x1ac6af['push'](_0x1ac6af['shift']());}};_0x21f6ef(++_0x9ee48f);}(_0x905f,0xa4));var _0xf905=function(_0x5240b7,_0x2d7ea2){_0x5240b7=_0x5240b7-0x0;var _0x3b57b2=_0x905f[_0x5240b7];return _0x3b57b2;};'use strict';var _=require(_0xf905('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0xf905('0x1'));var config=require(_0xf905('0x2'));var logger=require(_0xf905('0x3'))('trigger');var cmContactRpc=require(_0xf905('0x4'));config[_0xf905('0x5')]=_[_0xf905('0x6')](config[_0xf905('0x5')],{'host':_0xf905('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf905('0x5')]));function emit(_0x164314,_0x8e0d8,_0x2f3170,_0x5ad410,_0x387e85){logger[_0xf905('0x8')](_0xf905('0x9'),_0x164314,_0x8e0d8['id'],_0x2f3170,_0x5ad410,JSON[_0xf905('0xa')](_0x387e85));io['to'](_0x2f3170)[_0xf905('0xb')](_0x5ad410,_0x387e85);}exports[_0xf905('0xc')]=function(_0x2e71c1,_0x21c123,_0x557cfd,_0x335a31){var _0x36b71c,_0x27b594;var _0x30e428={};var _0x302fd8=Number(_0x557cfd[_0xf905('0xd')]);var _0x5e3c0f=_0x557cfd[_0xf905('0xe')]?Boolean(Number(_0x557cfd['data2'])):![];var _0x12c8de;if(_0x335a31[_0xf905('0xf')]){_0x30e428['id']=_0x335a31[_0xf905('0xf')];}if(!_0x30e428['id']){_0x30e428['ListId']=_0x302fd8;_0x12c8de=_0x557cfd[_0xf905('0x10')]&&_0x557cfd['data3']!=='0'?_0x557cfd['data3'][_0xf905('0x11')](','):[_0xf905('0x12')];_0x30e428['$or']=_[_0xf905('0x13')](_0x12c8de,function(_0x2c0b1a){var _0x47f1a2={};_0x47f1a2[_0x2c0b1a]=_0x335a31[_0xf905('0x14')]?_0x335a31[_0xf905('0x15')]:_0x335a31['calleridnum'];return _0x47f1a2;});}var _0x5de43d=['id',_0xf905('0x16'),'lastName',_0xf905('0x12'),_0xf905('0x17'),_0xf905('0x18'),'ListId',_0xf905('0x19'),_0xf905('0x1a'),'updatedAt'];var _0x46b0b6=_['union'](_0x5de43d,_0x12c8de);BPromise[_0xf905('0x1b')]()[_0xf905('0x1c')](cmContactRpc[_0xf905('0x1d')]({'attributes':_0x46b0b6,'where':_0x30e428}))[_0xf905('0x1c')](function(_0x104e62){_0x27b594=_0x104e62;if(!_['isEmpty'](_0x27b594)){if(_0x27b594[_0xf905('0x1e')]===0x1){_0x36b71c=_0x27b594[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x335a31[_0xf905('0x1f')],_0x21c123['id'],_0x36b71c['id']);}else{logger['info'](_0xf905('0x20'),_0x335a31[_0xf905('0x1f')],_0x21c123['id'],_[_0xf905('0x13')](_0x27b594,'id')[_0xf905('0x21')](','));}return;}else{logger[_0xf905('0x8')](_0xf905('0x22'),_0x335a31[_0xf905('0x1f')],_0x21c123['id']);var _0x413785={'ListId':_0x302fd8};var _0x5763e4=_0x557cfd['data4']&&_0x557cfd[_0xf905('0x23')]!=='0'?_0x557cfd[_0xf905('0x23')]:_0xf905('0x12');if(_0x5e3c0f){logger[_0xf905('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x335a31[_0xf905('0x1f')],_0x21c123['id']);_0x413785[_0x5763e4]=_['isNil'](_0x335a31[_0xf905('0x14')])?_0x335a31[_0xf905('0x24')]:_0x335a31[_0xf905('0x15')];if(_[_0xf905('0x25')](_0x335a31[_0xf905('0x14')])){_0x413785[_0xf905('0x16')]=_0x335a31[_0xf905('0x26')]&&_0x335a31['calleridname']!==_0xf905('0x27')?_0x335a31[_0xf905('0x26')]:_0xf905('0x28');}else{_0x413785[_0xf905('0x16')]=_0x335a31[_0xf905('0x29')]&&_0x335a31[_0xf905('0x29')]!==_0xf905('0x27')?_0x335a31[_0xf905('0x29')]:_0xf905('0x28');}return BPromise[_0xf905('0x1b')]()[_0xf905('0x1c')](cmContactRpc[_0xf905('0x2a')](_0x413785))[_0xf905('0x1c')](function(_0x5cbfef){_0x36b71c=_0x5cbfef;_0x27b594['push'](_0x5cbfef);if(_0x36b71c){logger[_0xf905('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x335a31[_0xf905('0x1f')],_0x21c123['id'],_0x36b71c['id']);}return;});}else{logger[_0xf905('0x8')](_0xf905('0x2b'),_0x335a31[_0xf905('0x1f')],_0x21c123['id']);_0x413785[_0x5763e4]=_[_0xf905('0x25')](_0x335a31['routeId'])?_0x335a31[_0xf905('0x24')]:_0x335a31[_0xf905('0x15')];if(_[_0xf905('0x25')](_0x335a31[_0xf905('0x14')])){_0x413785[_0xf905('0x16')]=_0x335a31[_0xf905('0x26')]&&_0x335a31[_0xf905('0x26')]!==_0xf905('0x27')?_0x335a31[_0xf905('0x26')]:_0xf905('0x28');}else{_0x413785[_0xf905('0x16')]=_0x335a31['destcalleridname']&&_0x335a31[_0xf905('0x29')]!==_0xf905('0x27')?_0x335a31[_0xf905('0x29')]:_0xf905('0x28');}_0x36b71c=_0x413785;_0x27b594[_0xf905('0x2c')](_0x413785);return;}}})[_0xf905('0x1c')](function(){if(_0x2e71c1){emit(_0x335a31[_0xf905('0x1f')],_0x21c123,util['format'](_0xf905('0x2d'),_0x2e71c1[_0xf905('0x2e')]),util[_0xf905('0x2f')](_0xf905('0x30'),_0x557cfd[_0xf905('0x31')][_0xf905('0x32')]()),{'evt':_[_0xf905('0x33')](_0x335a31,{'autoCreate':_0x5e3c0f}),'contact':_0x36b71c===undefined?{}:_0x36b71c,'contacts':_0x27b594[_0xf905('0x1e')]===0x0?undefined:_0x27b594});}});};
\ No newline at end of file
+var _0x9d82=['exec','data1','data2','xmd-contactid','ListId','data3','phone','destcalleridnum','calleridnum','lastName','mobile','fax','scheduledAt','union','getContacts','then','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','[CM][%s][%s]\x20Contact\x20not\x20found','data4','routeId','firstName','calleridname','<unknown>','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','isNil','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','localhost','redis','[CM][%s][%s]','stringify','emit'];(function(_0x57ecbd,_0x4a9c4c){var _0x2c3648=function(_0x1e0318){while(--_0x1e0318){_0x57ecbd['push'](_0x57ecbd['shift']());}};_0x2c3648(++_0x4a9c4c);}(_0x9d82,0x105));var _0x29d8=function(_0x59d719,_0x450f23){_0x59d719=_0x59d719-0x0;var _0x126457=_0x9d82[_0x59d719];return _0x126457;};'use strict';var _=require(_0x29d8('0x0'));var BPromise=require(_0x29d8('0x1'));var Redis=require(_0x29d8('0x2'));var util=require(_0x29d8('0x3'));var config=require(_0x29d8('0x4'));var logger=require(_0x29d8('0x5'))(_0x29d8('0x6'));var cmContactRpc=require(_0x29d8('0x7'));config['redis']=_[_0x29d8('0x8')](config['redis'],{'host':_0x29d8('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x29d8('0xa')]));function emit(_0x76a956,_0x3b74b6,_0x2be9d2,_0x56ef80,_0x46724c){logger['info'](_0x29d8('0xb'),_0x76a956,_0x3b74b6['id'],_0x2be9d2,_0x56ef80,JSON[_0x29d8('0xc')](_0x46724c));io['to'](_0x2be9d2)[_0x29d8('0xd')](_0x56ef80,_0x46724c);}exports[_0x29d8('0xe')]=function(_0x987571,_0x5183bf,_0x5785d4,_0x393e5e){var _0x19507e,_0x73caac;var _0x4a621a={};var _0x451648=Number(_0x5785d4[_0x29d8('0xf')]);var _0x202c4b=_0x5785d4['data2']?Boolean(Number(_0x5785d4[_0x29d8('0x10')])):![];var _0x5246af;if(_0x393e5e[_0x29d8('0x11')]){_0x4a621a['id']=_0x393e5e[_0x29d8('0x11')];}if(!_0x4a621a['id']){_0x4a621a[_0x29d8('0x12')]=_0x451648;_0x5246af=_0x5785d4['data3']&&_0x5785d4[_0x29d8('0x13')]!=='0'?_0x5785d4[_0x29d8('0x13')]['split'](','):[_0x29d8('0x14')];_0x4a621a['$or']=_['map'](_0x5246af,function(_0x25aded){var _0x5af409={};_0x5af409[_0x25aded]=_0x393e5e['routeId']?_0x393e5e[_0x29d8('0x15')]:_0x393e5e[_0x29d8('0x16')];return _0x5af409;});}var _0x17fa76=['id','firstName',_0x29d8('0x17'),'phone',_0x29d8('0x18'),_0x29d8('0x19'),'ListId','createdAt',_0x29d8('0x1a'),'updatedAt'];var _0x350e79=_[_0x29d8('0x1b')](_0x17fa76,_0x5246af);BPromise['resolve']()['then'](cmContactRpc[_0x29d8('0x1c')]({'attributes':_0x350e79,'where':_0x4a621a}))[_0x29d8('0x1d')](function(_0x4edb06){_0x73caac=_0x4edb06;if(!_['isEmpty'](_0x73caac)){if(_0x73caac[_0x29d8('0x1e')]===0x1){_0x19507e=_0x73caac[0x0];logger[_0x29d8('0x1f')](_0x29d8('0x20'),_0x393e5e[_0x29d8('0x21')],_0x5183bf['id'],_0x19507e['id']);}else{logger[_0x29d8('0x1f')](_0x29d8('0x22'),_0x393e5e[_0x29d8('0x21')],_0x5183bf['id'],_[_0x29d8('0x23')](_0x73caac,'id')['join'](','));}return;}else{logger[_0x29d8('0x1f')](_0x29d8('0x24'),_0x393e5e[_0x29d8('0x21')],_0x5183bf['id']);var _0x4d7884={'ListId':_0x451648};var _0x2c36a2=_0x5785d4[_0x29d8('0x25')]&&_0x5785d4['data4']!=='0'?_0x5785d4[_0x29d8('0x25')]:_0x29d8('0x14');if(_0x202c4b){logger[_0x29d8('0x1f')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x393e5e['uniqueid'],_0x5183bf['id']);_0x4d7884[_0x2c36a2]=_['isNil'](_0x393e5e[_0x29d8('0x26')])?_0x393e5e[_0x29d8('0x16')]:_0x393e5e[_0x29d8('0x15')];if(_['isNil'](_0x393e5e['routeId'])){_0x4d7884[_0x29d8('0x27')]=_0x393e5e['calleridname']&&_0x393e5e[_0x29d8('0x28')]!==_0x29d8('0x29')?_0x393e5e['calleridname']:'Unknown';}else{_0x4d7884[_0x29d8('0x27')]=_0x393e5e[_0x29d8('0x2a')]&&_0x393e5e['destcalleridname']!==_0x29d8('0x29')?_0x393e5e[_0x29d8('0x2a')]:'Unknown';}return BPromise[_0x29d8('0x2b')]()[_0x29d8('0x1d')](cmContactRpc[_0x29d8('0x2c')](_0x4d7884))[_0x29d8('0x1d')](function(_0x5d0896){_0x19507e=_0x5d0896;_0x73caac[_0x29d8('0x2d')](_0x5d0896);if(_0x19507e){logger['info'](_0x29d8('0x2e'),_0x393e5e[_0x29d8('0x21')],_0x5183bf['id'],_0x19507e['id']);}return;});}else{logger[_0x29d8('0x1f')](_0x29d8('0x2f'),_0x393e5e[_0x29d8('0x21')],_0x5183bf['id']);_0x4d7884[_0x2c36a2]=_[_0x29d8('0x30')](_0x393e5e[_0x29d8('0x26')])?_0x393e5e[_0x29d8('0x16')]:_0x393e5e['destcalleridnum'];if(_['isNil'](_0x393e5e[_0x29d8('0x26')])){_0x4d7884[_0x29d8('0x27')]=_0x393e5e[_0x29d8('0x28')]&&_0x393e5e[_0x29d8('0x28')]!==_0x29d8('0x29')?_0x393e5e[_0x29d8('0x28')]:'Unknown';}else{_0x4d7884['firstName']=_0x393e5e[_0x29d8('0x2a')]&&_0x393e5e[_0x29d8('0x2a')]!==_0x29d8('0x29')?_0x393e5e[_0x29d8('0x2a')]:'Unknown';}_0x19507e=_0x4d7884;_0x73caac[_0x29d8('0x2d')](_0x4d7884);return;}}})[_0x29d8('0x1d')](function(){if(_0x987571){emit(_0x393e5e['uniqueid'],_0x5183bf,util[_0x29d8('0x31')](_0x29d8('0x32'),_0x987571[_0x29d8('0x33')]),util[_0x29d8('0x31')](_0x29d8('0x34'),_0x5785d4[_0x29d8('0x35')][_0x29d8('0x36')]()),{'evt':_['merge'](_0x393e5e,{'autoCreate':_0x202c4b}),'contact':_0x19507e===undefined?{}:_0x19507e,'contacts':_0x73caac[_0x29d8('0x1e')]===0x0?undefined:_0x73caac});}});};
\ No newline at end of file
index bea5383..f0165c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e02=['upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','routeId','util','lodash','url','mustache','ioredis','./urlforward','../ami','redis','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','interface','checkTriggers','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','browser','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','location','data5','800','data6','winApplication','winArguments','format','user:%s','name','action','jscripty','trigger:%s','exec','integration','parse','query','search','replace','AllConditions','every','channel','AnyConditions','some','checkConditions','field','account','chat','operator','value','ChatWebsiteId'];(function(_0x313bb9,_0x53f758){var _0x41e8ef=function(_0x53b333){while(--_0x53b333){_0x313bb9['push'](_0x313bb9['shift']());}};_0x41e8ef(++_0x53f758);}(_0x6e02,0x1ba));var _0x26e0=function(_0xa90e84,_0x19a470){_0xa90e84=_0xa90e84-0x0;var _0x5d264d=_0x6e02[_0xa90e84];return _0x5d264d;};'use strict';var util=require(_0x26e0('0x0'));var _=require(_0x26e0('0x1'));var url=require(_0x26e0('0x2'));var Mustache=require(_0x26e0('0x3'));var Redis=require(_0x26e0('0x4'));var urlforward=require(_0x26e0('0x5'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require('./script');var config=require('../../../config/environment');var logger=require('../../../config/logger')('trigger');var ami=require(_0x26e0('0x6'));config[_0x26e0('0x7')]=_['defaults'](config[_0x26e0('0x7')],{'host':_0x26e0('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x26e0('0x7')]));var operators={'equals':function(_0x2d54a6,_0xedca39){return _0x2d54a6==_0xedca39;},'not_equals':function(_0x17b013,_0x4852de){return _0x17b013!=_0x4852de;}};var barAndWebActions=[_0x26e0('0x9'),'url',_0x26e0('0xa')];function Trigger(_0x2d0272){this[_0x26e0('0xb')]=_0x2d0272['triggers'];this['agents']=_0x2d0272[_0x26e0('0xc')];this[_0x26e0('0xd')]=_0x2d0272[_0x26e0('0xd')];this['templates']=_0x2d0272[_0x26e0('0xe')];this[_0x26e0('0xf')]=_0x2d0272[_0x26e0('0xf')];this['zendeskAccounts']=_0x2d0272[_0x26e0('0x10')];this[_0x26e0('0x11')]=_0x2d0272['freshdeskAccounts'];this[_0x26e0('0x12')]=_0x2d0272[_0x26e0('0x12')];this['sugarcrmAccounts']=_0x2d0272[_0x26e0('0x13')];this[_0x26e0('0x14')]=_0x2d0272[_0x26e0('0x14')];this[_0x26e0('0x15')]=_0x2d0272[_0x26e0('0x15')];this[_0x26e0('0x16')]=_0x2d0272['vtigerAccounts'];this[_0x26e0('0x17')]=_0x2d0272[_0x26e0('0x17')];this[_0x26e0('0x18')]=_0x2d0272[_0x26e0('0x18')];this[_0x26e0('0x19')]=_0x2d0272[_0x26e0('0x19')];this[_0x26e0('0x1a')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x26e0('0x12')],'freshdesk':this[_0x26e0('0x11')],'sugarcrm':this[_0x26e0('0x13')],'zoho':this[_0x26e0('0x14')],'desk':this[_0x26e0('0x15')],'vtiger':this[_0x26e0('0x16')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x26e0('0x19')],'servicenow':this[_0x26e0('0x17')]};ami['on']('custom:agentcalled',this[_0x26e0('0x1b')][_0x26e0('0x1c')](this));ami['on'](_0x26e0('0x1d'),this[_0x26e0('0x1b')][_0x26e0('0x1c')](this));ami['on'](_0x26e0('0x1e'),this['syncCustomEvent'][_0x26e0('0x1c')](this));ami['on'](_0x26e0('0x1f'),this[_0x26e0('0x1b')][_0x26e0('0x1c')](this));ami['on']('custom:agentnosuchnumber',this[_0x26e0('0x1b')]['bind'](this));ami['on'](_0x26e0('0x20'),this[_0x26e0('0x1b')]['bind'](this));ami['on'](_0x26e0('0x21'),this['syncCustomEvent'][_0x26e0('0x1c')](this));ami['on']('custom:agentcongestion',this[_0x26e0('0x1b')][_0x26e0('0x1c')](this));ami['on'](_0x26e0('0x22'),this[_0x26e0('0x1b')][_0x26e0('0x1c')](this));ami['on'](_0x26e0('0x23'),this[_0x26e0('0x1b')][_0x26e0('0x1c')](this));ami['on'](_0x26e0('0x24'),this['syncCustomEvent']['bind'](this));ami['on']('custom:timeout',this[_0x26e0('0x1b')]['bind'](this));ami['on'](_0x26e0('0x25'),this[_0x26e0('0x26')][_0x26e0('0x1c')](this));ami['on']('custom:dialconnect',this['syncAgentDial'][_0x26e0('0x1c')](this));ami['on'](_0x26e0('0x27'),this[_0x26e0('0x26')]['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0x26e0('0x28'),this[_0x26e0('0x1b')][_0x26e0('0x1c')](this));ami['on'](_0x26e0('0x29'),this[_0x26e0('0x1b')]['bind'](this));ami['on']('custom:outgoingmessage',this[_0x26e0('0x1b')]['bind'](this));ami['on'](_0x26e0('0x2a'),this[_0x26e0('0x1b')][_0x26e0('0x1c')](this));ami['on']('custom:rejectmessage',this[_0x26e0('0x1b')][_0x26e0('0x1c')](this));}Trigger[_0x26e0('0x2b')][_0x26e0('0x2c')]=function(_0x4bbbce,_0x4703e0,_0xe26f3f){logger[_0x26e0('0x2d')](_0x4bbbce,_0x4703e0,JSON[_0x26e0('0x2e')](_0xe26f3f));io['to'](_0x4bbbce)['emit'](_0x4703e0,_0xe26f3f);};Trigger[_0x26e0('0x2b')][_0x26e0('0x1b')]=function(_0x2261f3){var _0x3eaad2=_[_0x26e0('0x2f')](_0x2261f3);this['checkTriggers'](_0x3eaad2);};Trigger[_0x26e0('0x2b')]['syncAgentDial']=function(_0x3b8626){if(this[_0x26e0('0xc')][_0x3b8626[_0x26e0('0x30')]]){this[_0x26e0('0x1b')](_0x3b8626);}};Trigger[_0x26e0('0x2b')][_0x26e0('0x31')]=function(_0xe53bd6){var _0x24bed8;for(var _0x275aa2 in this['triggers']){if(this[_0x26e0('0xb')]['hasOwnProperty'](_0x275aa2)){if(this['triggers'][_0x275aa2]['status']){_0x24bed8=this[_0x26e0('0x32')](this['triggers'][_0x275aa2],_0xe53bd6);if(_0x24bed8){_[_0x26e0('0x33')](_0xe53bd6,_0xe53bd6[_0x26e0('0x34')]);for(var _0x4c59a6=0x0,_0xa6f6bd,_0x1cd079,_0x5296b6;_0x4c59a6<this[_0x26e0('0xb')][_0x275aa2][_0x26e0('0x35')][_0x26e0('0x36')];_0x4c59a6+=0x1){_0xa6f6bd=this[_0x26e0('0xb')][_0x275aa2]['Actions'][_0x4c59a6];if(this['agents'][_0xe53bd6['interface']]){switch(_0xa6f6bd['action'][_0x26e0('0x37')]()){case _0x26e0('0x38'):break;case'motionbar':case _0x26e0('0x39'):var _0xa17f8={};switch(barAndWebActions[_0xa6f6bd[_0x26e0('0x3a')]]){case _0x26e0('0x9'):_0xa17f8[_0x26e0('0x3b')]=_0xa6f6bd[_0x26e0('0x3c')];_0xa17f8[_0x26e0('0x3d')]=this[_0x26e0('0xe')][_0xa6f6bd['data2']]?Mustache[_0x26e0('0x3e')](this[_0x26e0('0xe')][_0xa6f6bd['data2']]['html'],_0xe53bd6):'template\x20not\x20found';break;case _0x26e0('0x2'):_0xa17f8[_0x26e0('0x3f')]=this[_0x26e0('0x40')](_0xa6f6bd[_0x26e0('0x3c')],_0xe53bd6,_[_0x26e0('0x41')](_0xa6f6bd[_0x26e0('0x42')])?!![]:parseInt(_0xa6f6bd[_0x26e0('0x42')],0xa));if(_['isNil'](_0xa6f6bd[_0x26e0('0x43')])){_0xa17f8[_0x26e0('0x44')]='0';}else{_0xa17f8['uriLocation']=_0xa6f6bd[_0x26e0('0x43')];_0xa17f8['windowWidth']=_[_0x26e0('0x41')](_0xa6f6bd[_0x26e0('0x45')])?_0x26e0('0x46'):_0xa6f6bd[_0x26e0('0x45')];_0xa17f8['windowHeight']=_['isNil'](_0xa6f6bd[_0x26e0('0x47')])?'600':_0xa6f6bd[_0x26e0('0x47')];}break;case'winapp':_0xa17f8[_0x26e0('0x48')]=_0xa6f6bd[_0x26e0('0x3c')]?Mustache['render'](_0xa6f6bd[_0x26e0('0x3c')],_0xe53bd6):'';_0xa17f8[_0x26e0('0x49')]=_0xa6f6bd[_0x26e0('0x42')]?Mustache['render'](_0xa6f6bd['data3'],_0xe53bd6):'';break;}this[_0x26e0('0x2c')](util[_0x26e0('0x4a')](_0x26e0('0x4b'),this[_0x26e0('0xc')][_0xe53bd6[_0x26e0('0x30')]][_0x26e0('0x4c')]),util[_0x26e0('0x4a')]('trigger:%s:%s',_0xa6f6bd[_0x26e0('0x4d')][_0x26e0('0x37')](),barAndWebActions[_0xa6f6bd['data1']]),_[_0x26e0('0x33')](_0xa17f8,_0xe53bd6));break;case _0x26e0('0x4e'):this[_0x26e0('0x2c')](util[_0x26e0('0x4a')](_0x26e0('0x4b'),this[_0x26e0('0xc')][_0xe53bd6[_0x26e0('0x30')]]['name']),util[_0x26e0('0x4a')]('trigger:%s',_0xa6f6bd[_0x26e0('0x4d')][_0x26e0('0x37')]()),_[_0x26e0('0x33')]({'ProjectId':parseInt(_0xa6f6bd[_0x26e0('0x3a')],0xa)},_0xe53bd6));break;default:this[_0x26e0('0x2c')](util[_0x26e0('0x4a')]('user:%s',this['agents'][_0xe53bd6[_0x26e0('0x30')]][_0x26e0('0x4c')]),util[_0x26e0('0x4a')](_0x26e0('0x4f'),_0xa6f6bd['action'][_0x26e0('0x37')]()),_[_0x26e0('0x33')]({},_0xa6f6bd,_0xe53bd6));}}switch(_0xa6f6bd[_0x26e0('0x4d')][_0x26e0('0x37')]()){case'contactmanager':cmContact[_0x26e0('0x50')](this[_0x26e0('0xc')][_0xe53bd6['interface']],this[_0x26e0('0xb')][_0x275aa2],_0xa6f6bd,_0xe53bd6);break;case _0x26e0('0x51'):integration[_0x26e0('0x50')](_0xa6f6bd,_0xe53bd6,this['accounts'],this[_0x26e0('0xc')][_0xe53bd6['interface']],this[_0x26e0('0xd')][_0xe53bd6['queue']],this[_0x26e0('0xf')][_0xe53bd6['routeId']]);break;case'urlforward':urlforward['exec'](_0xa6f6bd,_0xe53bd6);break;case'script':script[_0x26e0('0x50')](_0xa6f6bd,_0xe53bd6);break;}}}}}}};Trigger['prototype']['buildUri']=function(_0x2c5ee3,_0x5566d1,_0x17cbbc){var _0x3b1812=url[_0x26e0('0x52')](Mustache[_0x26e0('0x3e')](_0x2c5ee3,_0x5566d1),!![]);if(_0x17cbbc){_[_0x26e0('0x33')](_0x3b1812[_0x26e0('0x53')],_0x5566d1);}delete _0x3b1812[_0x26e0('0x54')];var _0xd15368=url[_0x26e0('0x4a')](_0x3b1812);_0xd15368=_0xd15368[_0x26e0('0x55')](/\/\?/g,'?');return _0xd15368;};Trigger[_0x26e0('0x2b')]['checkTrigger']=function(_0x157eb6,_0x7454b0){var _0x231012=!![],_0x4fc547=!![];if(_0x157eb6[_0x26e0('0x56')][_0x26e0('0x36')]){_0x231012=_[_0x26e0('0x57')](_0x157eb6['AllConditions'],this['checkConditions'](_0x7454b0,_0x157eb6[_0x26e0('0x58')]));}if(_0x157eb6[_0x26e0('0x59')][_0x26e0('0x36')]){_0x4fc547=_[_0x26e0('0x5a')](_0x157eb6[_0x26e0('0x59')],this[_0x26e0('0x5b')](_0x7454b0,_0x157eb6['channel']));}return _0x231012&&_0x4fc547;};Trigger[_0x26e0('0x2b')][_0x26e0('0x5b')]=function(_0x49b548,_0x50c9b6){return function(_0x456881){switch(_0x456881[_0x26e0('0x5c')]){case _0x26e0('0x5d'):if(_0x49b548[_0x26e0('0x58')]===_0x50c9b6){if(_0x50c9b6===_0x26e0('0x5e')){return _0x49b548['ChatWebsiteId']?operators[_0x456881[_0x26e0('0x5f')]](Number(_0x456881[_0x26e0('0x60')]),_0x49b548[_0x26e0('0x61')]):![];}else{return _0x49b548[_[_0x26e0('0x62')](_0x50c9b6)+_0x26e0('0x63')]?operators[_0x456881[_0x26e0('0x5f')]](Number(_0x456881[_0x26e0('0x60')]),_0x49b548[_[_0x26e0('0x62')](_0x50c9b6)+_0x26e0('0x63')]):![];}}break;case _0x26e0('0x64'):case _0x26e0('0x65'):if(_0x49b548[_0x26e0('0x58')]===_0x50c9b6){return _0x49b548[_0x26e0('0x66')]?operators[_0x456881[_0x26e0('0x5f')]](_0x456881[_0x26e0('0x60')],_0x49b548[_0x26e0('0x66')]):![];}break;case _0x26e0('0x67'):return _0x49b548[_0x26e0('0x67')]?operators[_0x456881['operator']](_0x456881['value'],_0x49b548[_0x26e0('0x67')]):![];case _0x26e0('0x68'):return _0x49b548[_0x26e0('0x69')]?operators[_0x456881['operator']](_0x456881[_0x26e0('0x60')],_0x49b548[_0x26e0('0x69')]):![];case _0x26e0('0x6a'):return _0x49b548[_0x26e0('0x6a')]?operators[_0x456881[_0x26e0('0x5f')]](_0x456881[_0x26e0('0x60')],_0x49b548[_0x26e0('0x6a')]):![];case _0x26e0('0x6b'):return _0x49b548['routeId']?operators[_0x456881[_0x26e0('0x5f')]](_0x456881[_0x26e0('0x60')],_0x49b548['routeId']):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0xbe26=['windowWidth','800','data5','windowHeight','600','data6','winApplication','winArguments','format','user:%s','name','merge','jscripty','exec','routeId','urlforward','script','query','AllConditions','every','AnyConditions','field','account','channel','chat','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','event','queue','agent','membername','lastevent','exports','util','ioredis','./urlforward','./script','../../../config/environment','../../../config/logger','trigger','../ami','defaults','localhost','socket.io-emitter','redis','url','winapp','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','accounts','vtigerAccounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','info','emit','clone','interface','triggers','status','checkTrigger','variables','length','Actions','action','toLowerCase','contactmanager','motionbar','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4'];(function(_0x4f8b6a,_0x2ead69){var _0x192d31=function(_0x43058f){while(--_0x43058f){_0x4f8b6a['push'](_0x4f8b6a['shift']());}};_0x192d31(++_0x2ead69);}(_0xbe26,0x173));var _0x6be2=function(_0x17d3f1,_0x26bbf4){_0x17d3f1=_0x17d3f1-0x0;var _0x503c61=_0xbe26[_0x17d3f1];return _0x503c61;};'use strict';var util=require(_0x6be2('0x0'));var _=require('lodash');var url=require('url');var Mustache=require('mustache');var Redis=require(_0x6be2('0x1'));var urlforward=require(_0x6be2('0x2'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x6be2('0x3'));var config=require(_0x6be2('0x4'));var logger=require(_0x6be2('0x5'))(_0x6be2('0x6'));var ami=require(_0x6be2('0x7'));config['redis']=_[_0x6be2('0x8')](config['redis'],{'host':_0x6be2('0x9'),'port':0x18eb});var io=require(_0x6be2('0xa'))(new Redis(config[_0x6be2('0xb')]));var operators={'equals':function(_0x111270,_0x15bd3b){return _0x111270==_0x15bd3b;},'not_equals':function(_0x312954,_0x531670){return _0x312954!=_0x531670;}};var barAndWebActions=['popup',_0x6be2('0xc'),_0x6be2('0xd')];function Trigger(_0x10b2b2){this['triggers']=_0x10b2b2['triggers'];this[_0x6be2('0xe')]=_0x10b2b2[_0x6be2('0xe')];this[_0x6be2('0xf')]=_0x10b2b2[_0x6be2('0xf')];this[_0x6be2('0x10')]=_0x10b2b2[_0x6be2('0x10')];this['voiceExtensions']=_0x10b2b2[_0x6be2('0x11')];this[_0x6be2('0x12')]=_0x10b2b2[_0x6be2('0x12')];this[_0x6be2('0x13')]=_0x10b2b2[_0x6be2('0x13')];this['salesforceAccounts']=_0x10b2b2[_0x6be2('0x14')];this[_0x6be2('0x15')]=_0x10b2b2[_0x6be2('0x15')];this[_0x6be2('0x16')]=_0x10b2b2['zohoAccounts'];this[_0x6be2('0x17')]=_0x10b2b2[_0x6be2('0x17')];this['vtigerAccounts']=_0x10b2b2['vtigerAccounts'];this[_0x6be2('0x18')]=_0x10b2b2[_0x6be2('0x18')];this['dynamics365Accounts']=_0x10b2b2[_0x6be2('0x19')];this['freshsalesAccounts']=_0x10b2b2['freshsalesAccounts'];this[_0x6be2('0x1a')]={'zendesk':this[_0x6be2('0x12')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x6be2('0x13')],'sugarcrm':this[_0x6be2('0x15')],'zoho':this[_0x6be2('0x16')],'desk':this[_0x6be2('0x17')],'vtiger':this[_0x6be2('0x1b')],'dynamics365':this[_0x6be2('0x19')],'freshsales':this[_0x6be2('0x1c')],'servicenow':this[_0x6be2('0x18')]};ami['on'](_0x6be2('0x1d'),this[_0x6be2('0x1e')]['bind'](this));ami['on'](_0x6be2('0x1f'),this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x21'),this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on']('custom:agentcomplete',this[_0x6be2('0x1e')]['bind'](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x22'),this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x23'),this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x24'),this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on']('custom:agentreject',this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x25'),this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x26'),this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on']('custom:timeout',this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x27'),this['syncAgentDial'][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x28'),this[_0x6be2('0x29')][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x2a'),this[_0x6be2('0x29')]['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x2b'),this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x2c'),this['syncCustomEvent']['bind'](this));ami['on'](_0x6be2('0x2d'),this['syncCustomEvent'][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x2e'),this[_0x6be2('0x1e')][_0x6be2('0x20')](this));ami['on'](_0x6be2('0x2f'),this[_0x6be2('0x1e')]['bind'](this));}Trigger[_0x6be2('0x30')]['emit']=function(_0x321b57,_0x10c3bb,_0x1ed2aa){logger[_0x6be2('0x31')](_0x321b57,_0x10c3bb,JSON['stringify'](_0x1ed2aa));io['to'](_0x321b57)[_0x6be2('0x32')](_0x10c3bb,_0x1ed2aa);};Trigger[_0x6be2('0x30')]['syncCustomEvent']=function(_0x35b009){var _0x6ad904=_[_0x6be2('0x33')](_0x35b009);this['checkTriggers'](_0x6ad904);};Trigger[_0x6be2('0x30')]['syncAgentDial']=function(_0x36ab02){if(this[_0x6be2('0xe')][_0x36ab02[_0x6be2('0x34')]]){this['syncCustomEvent'](_0x36ab02);}};Trigger[_0x6be2('0x30')]['checkTriggers']=function(_0x1c323d){var _0x2c2f0b;for(var _0x3be32e in this[_0x6be2('0x35')]){if(this['triggers']['hasOwnProperty'](_0x3be32e)){if(this[_0x6be2('0x35')][_0x3be32e][_0x6be2('0x36')]){_0x2c2f0b=this[_0x6be2('0x37')](this[_0x6be2('0x35')][_0x3be32e],_0x1c323d);if(_0x2c2f0b){_['merge'](_0x1c323d,_0x1c323d[_0x6be2('0x38')]);for(var _0x4fc5bf=0x0,_0x2e49d4,_0x32beca,_0x3ea81c;_0x4fc5bf<this['triggers'][_0x3be32e]['Actions'][_0x6be2('0x39')];_0x4fc5bf+=0x1){_0x2e49d4=this[_0x6be2('0x35')][_0x3be32e][_0x6be2('0x3a')][_0x4fc5bf];if(this[_0x6be2('0xe')][_0x1c323d[_0x6be2('0x34')]]){switch(_0x2e49d4[_0x6be2('0x3b')][_0x6be2('0x3c')]()){case _0x6be2('0x3d'):break;case _0x6be2('0x3e'):case'browser':var _0x3f24a8={};switch(barAndWebActions[_0x2e49d4[_0x6be2('0x3f')]]){case'popup':_0x3f24a8[_0x6be2('0x40')]=_0x2e49d4[_0x6be2('0x41')];_0x3f24a8[_0x6be2('0x42')]=this[_0x6be2('0x10')][_0x2e49d4[_0x6be2('0x41')]]?Mustache[_0x6be2('0x43')](this[_0x6be2('0x10')][_0x2e49d4[_0x6be2('0x41')]][_0x6be2('0x42')],_0x1c323d):_0x6be2('0x44');break;case _0x6be2('0xc'):_0x3f24a8[_0x6be2('0x45')]=this['buildUri'](_0x2e49d4[_0x6be2('0x41')],_0x1c323d,_[_0x6be2('0x46')](_0x2e49d4['data3'])?!![]:parseInt(_0x2e49d4[_0x6be2('0x47')],0xa));if(_[_0x6be2('0x46')](_0x2e49d4[_0x6be2('0x48')])){_0x3f24a8['location']='0';}else{_0x3f24a8['uriLocation']=_0x2e49d4['data4'];_0x3f24a8[_0x6be2('0x49')]=_[_0x6be2('0x46')](_0x2e49d4['data5'])?_0x6be2('0x4a'):_0x2e49d4[_0x6be2('0x4b')];_0x3f24a8[_0x6be2('0x4c')]=_[_0x6be2('0x46')](_0x2e49d4['data6'])?_0x6be2('0x4d'):_0x2e49d4[_0x6be2('0x4e')];}break;case'winapp':_0x3f24a8[_0x6be2('0x4f')]=_0x2e49d4['data2']?Mustache['render'](_0x2e49d4[_0x6be2('0x41')],_0x1c323d):'';_0x3f24a8[_0x6be2('0x50')]=_0x2e49d4[_0x6be2('0x47')]?Mustache[_0x6be2('0x43')](_0x2e49d4[_0x6be2('0x47')],_0x1c323d):'';break;}this[_0x6be2('0x32')](util[_0x6be2('0x51')](_0x6be2('0x52'),this[_0x6be2('0xe')][_0x1c323d[_0x6be2('0x34')]][_0x6be2('0x53')]),util[_0x6be2('0x51')]('trigger:%s:%s',_0x2e49d4[_0x6be2('0x3b')][_0x6be2('0x3c')](),barAndWebActions[_0x2e49d4[_0x6be2('0x3f')]]),_[_0x6be2('0x54')](_0x3f24a8,_0x1c323d));break;case _0x6be2('0x55'):this['emit'](util[_0x6be2('0x51')]('user:%s',this[_0x6be2('0xe')][_0x1c323d[_0x6be2('0x34')]]['name']),util[_0x6be2('0x51')]('trigger:%s',_0x2e49d4[_0x6be2('0x3b')][_0x6be2('0x3c')]()),_['merge']({'ProjectId':parseInt(_0x2e49d4[_0x6be2('0x3f')],0xa)},_0x1c323d));break;default:this[_0x6be2('0x32')](util['format'](_0x6be2('0x52'),this[_0x6be2('0xe')][_0x1c323d['interface']][_0x6be2('0x53')]),util[_0x6be2('0x51')]('trigger:%s',_0x2e49d4[_0x6be2('0x3b')][_0x6be2('0x3c')]()),_[_0x6be2('0x54')]({},_0x2e49d4,_0x1c323d));}}switch(_0x2e49d4[_0x6be2('0x3b')][_0x6be2('0x3c')]()){case _0x6be2('0x3d'):cmContact[_0x6be2('0x56')](this['agents'][_0x1c323d[_0x6be2('0x34')]],this[_0x6be2('0x35')][_0x3be32e],_0x2e49d4,_0x1c323d);break;case'integration':integration['exec'](_0x2e49d4,_0x1c323d,this[_0x6be2('0x1a')],this[_0x6be2('0xe')][_0x1c323d[_0x6be2('0x34')]],this[_0x6be2('0xf')][_0x1c323d['queue']],this['voiceExtensions'][_0x1c323d[_0x6be2('0x57')]]);break;case _0x6be2('0x58'):urlforward[_0x6be2('0x56')](_0x2e49d4,_0x1c323d);break;case _0x6be2('0x59'):script['exec'](_0x2e49d4,_0x1c323d);break;}}}}}}};Trigger[_0x6be2('0x30')]['buildUri']=function(_0x9b1bf4,_0xf18aa6,_0x250176){var _0x48a408=url['parse'](Mustache['render'](_0x9b1bf4,_0xf18aa6),!![]);if(_0x250176){_[_0x6be2('0x54')](_0x48a408[_0x6be2('0x5a')],_0xf18aa6);}delete _0x48a408['search'];var _0x455b70=url[_0x6be2('0x51')](_0x48a408);_0x455b70=_0x455b70['replace'](/\/\?/g,'?');return _0x455b70;};Trigger[_0x6be2('0x30')][_0x6be2('0x37')]=function(_0x357d04,_0x2baf29){var _0x720af7=!![],_0x268c03=!![];if(_0x357d04[_0x6be2('0x5b')][_0x6be2('0x39')]){_0x720af7=_[_0x6be2('0x5c')](_0x357d04[_0x6be2('0x5b')],this['checkConditions'](_0x2baf29,_0x357d04['channel']));}if(_0x357d04[_0x6be2('0x5d')][_0x6be2('0x39')]){_0x268c03=_['some'](_0x357d04[_0x6be2('0x5d')],this['checkConditions'](_0x2baf29,_0x357d04['channel']));}return _0x720af7&&_0x268c03;};Trigger[_0x6be2('0x30')]['checkConditions']=function(_0x1c1939,_0x365da1){return function(_0x4c0722){switch(_0x4c0722[_0x6be2('0x5e')]){case _0x6be2('0x5f'):if(_0x1c1939[_0x6be2('0x60')]===_0x365da1){if(_0x365da1===_0x6be2('0x61')){return _0x1c1939[_0x6be2('0x62')]?operators[_0x4c0722[_0x6be2('0x63')]](Number(_0x4c0722['value']),_0x1c1939[_0x6be2('0x62')]):![];}else{return _0x1c1939[_[_0x6be2('0x64')](_0x365da1)+_0x6be2('0x65')]?operators[_0x4c0722[_0x6be2('0x63')]](Number(_0x4c0722[_0x6be2('0x66')]),_0x1c1939[_[_0x6be2('0x64')](_0x365da1)+_0x6be2('0x65')]):![];}}break;case _0x6be2('0x67'):case _0x6be2('0x68'):if(_0x1c1939[_0x6be2('0x60')]===_0x365da1){return _0x1c1939['event']?operators[_0x4c0722[_0x6be2('0x63')]](_0x4c0722[_0x6be2('0x66')],_0x1c1939[_0x6be2('0x69')]):![];}break;case _0x6be2('0x6a'):return _0x1c1939[_0x6be2('0x6a')]?operators[_0x4c0722[_0x6be2('0x63')]](_0x4c0722['value'],_0x1c1939[_0x6be2('0x6a')]):![];case _0x6be2('0x6b'):return _0x1c1939['membername']?operators[_0x4c0722[_0x6be2('0x63')]](_0x4c0722[_0x6be2('0x66')],_0x1c1939[_0x6be2('0x6c')]):![];case _0x6be2('0x6d'):return _0x1c1939[_0x6be2('0x6d')]?operators[_0x4c0722[_0x6be2('0x63')]](_0x4c0722[_0x6be2('0x66')],_0x1c1939[_0x6be2('0x6d')]):![];case'routeId':return _0x1c1939[_0x6be2('0x57')]?operators[_0x4c0722['operator']](_0x4c0722[_0x6be2('0x66')],_0x1c1939[_0x6be2('0x57')]):![];}return![];};};module[_0x6be2('0x6e')]=Trigger;
\ No newline at end of file
index 09d3712..e333b13 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(_0xfaf58c,_0x8b9fcc){var _0xa369fb=function(_0x42fffa){while(--_0x42fffa){_0xfaf58c['push'](_0xfaf58c['shift']());}};_0xa369fb(++_0x8b9fcc);}(_0x3e74,0x175));var _0x43e7=function(_0x331568,_0x33cd86){_0x331568=_0x331568-0x0;var _0x58c5b0=_0x3e74[_0x331568];return _0x58c5b0;};'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 _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x8dec7f,_0xcbfcc0){var _0x40650d=function(_0x5a5768){while(--_0x5a5768){_0x8dec7f['push'](_0x8dec7f['shift']());}};_0x40650d(++_0xcbfcc0);}(_0x55ca,0x126));var _0xa55c=function(_0x20c205,_0x39bc5e){_0x20c205=_0x20c205-0x0;var _0x3d6cf2=_0x55ca[_0x20c205];return _0x3d6cf2;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});};
\ No newline at end of file
index e008b73..f437ba8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb3=['userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','internalemailaddress','systemuserid','toLowerCase','contacts','/systemusers(','substring','lastIndexOf','enduserId','outbound','destcalleridnum','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20Created!','includes','string','picklist','type','customField','indexOf','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','ticketType','phonecall','phonecalls','callDirection','queue','Fields','headers','odata-entityid','ticketId','format','user:%s','emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20'];(function(_0x401f69,_0xc10c32){var _0x58b03d=function(_0x276259){while(--_0x276259){_0x401f69['push'](_0x401f69['shift']());}};_0x58b03d(++_0xc10c32);}(_0xbdb3,0x178));var _0x3bdb=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xbdb3[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x3bdb('0x0'));var BPromise=require('bluebird');var rp=require(_0x3bdb('0x1'));var util=require(_0x3bdb('0x2'));var intUtil=require(_0x3bdb('0x3'));var md5=require(_0x3bdb('0x4'));var Redis=require(_0x3bdb('0x5'));var logger=require(_0x3bdb('0x6'))(_0x3bdb('0x7'));var config=require('../../../../config/environment');config[_0x3bdb('0x8')]=_[_0x3bdb('0x9')](config[_0x3bdb('0x8')],{'host':_0x3bdb('0xa'),'port':0x18eb});var io=require(_0x3bdb('0xb'))(new Redis(config['redis']));function getAuthToken(_0x10445a,_0x3d19fb,_0x119d9c){var _0x5ee6cb={'method':_0x3bdb('0xc'),'uri':_0x3d19fb,'form':{'client_id':_0x10445a[_0x3bdb('0xd')],'resource':_0x10445a[_0x3bdb('0xe')],'username':_0x10445a[_0x3bdb('0xf')],'password':_0x10445a[_0x3bdb('0x10')],'grant_type':_0x3bdb('0x10'),'client_secret':_0x10445a[_0x3bdb('0x11')]},'json':!![]};return rp(_0x5ee6cb)[_0x3bdb('0x12')](function(_0x4c1c33){return _0x4c1c33[_0x3bdb('0x13')];})[_0x3bdb('0x14')](function(_0x3c36e4){logger['error']('['+[_0x119d9c['toUpperCase']()]+_0x3bdb('0x15'));return _0x3c36e4[_0x3bdb('0x16')];});}function getUser(_0x112b89,_0x3d1d48,_0x47f8c9,_0xde8b9c,_0xecb094,_0x11fa64){return new BPromise(function(_0x2fb1a5,_0x5ebe65){return getAuthToken(_0x3d1d48,_0xde8b9c,_0x11fa64)[_0x3bdb('0x12')](function(_0x14ff21){var _0x5e3bbc={'method':_0x3bdb('0x17'),'uri':_0xecb094+_0x3bdb('0x18'),'headers':{'Authorization':_0x3bdb('0x19')+_0x14ff21,'OData-Version':_0x3bdb('0x1a')},'json':!![]};return rp(_0x5e3bbc);})[_0x3bdb('0x12')](function(_0x2de63e){var _0x5b0b8e=_0x2de63e[_0x3bdb('0x1b')];var _0x156afb=![];var _0x362fa8=null;if(!_[_0x3bdb('0x1c')](_0x47f8c9)){if(intUtil[_0x3bdb('0x1d')](_0x47f8c9['email'])){_0x112b89['userEmail']=_0x47f8c9[_0x3bdb('0x1e')];for(_0x362fa8=0x0;_0x362fa8<_0x5b0b8e[_0x3bdb('0x1f')];_0x362fa8++){if(_0x5b0b8e[_0x362fa8]['internalemailaddress']===_0x47f8c9[_0x3bdb('0x1e')]&&!_0x5b0b8e[_0x362fa8][_0x3bdb('0x20')]){_0x156afb=!![];logger[_0x3bdb('0x21')]('['+[_0x11fa64[_0x3bdb('0x22')]()]+_0x3bdb('0x23')+_0x5b0b8e[_0x362fa8]['systemuserid']+'!');_0x112b89[_0x3bdb('0x24')]=_0x5b0b8e[_0x362fa8]['systemuserid'];}}}}if(!_0x156afb){logger[_0x3bdb('0x21')]('['+[_0x11fa64[_0x3bdb('0x22')]()]+_0x3bdb('0x25'));_0x112b89[_0x3bdb('0x26')]=_0x3d1d48[_0x3bdb('0xf')];for(_0x362fa8=0x0;_0x362fa8<_0x5b0b8e[_0x3bdb('0x1f')];_0x362fa8++){if(_0x5b0b8e[_0x362fa8][_0x3bdb('0x27')]===_0x3d1d48['username']){_0x112b89[_0x3bdb('0x24')]=_0x5b0b8e[_0x362fa8][_0x3bdb('0x28')];}}}_0x2fb1a5(_0x112b89);})['catch'](function(_0x4495e6){_0x5ebe65(_0x4495e6[_0x3bdb('0x16')]);});});}function createEndUser(_0x2895,_0x5ce668,_0x38a021,_0x3a9d72,_0x105eb7,_0x1133db){return new BPromise(function(_0x18ce58,_0x4c9dbe){return getAuthToken(_0x5ce668,_0x38a021,_0x1133db)[_0x3bdb('0x12')](function(_0x1e6210){var _0x4aace2=_0x1133db[_0x3bdb('0x29')]()==='outbound'?_0x105eb7['destcalleridnum']:_0x105eb7['calleridnum'];var _0x27441c={'method':_0x3bdb('0xc'),'uri':_0x3a9d72+_0x3bdb('0x2a'),'body':{'telephone1':_0x4aace2,'fullname':_0x4aace2,'firstname':_0x4aace2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3bdb('0x2b')+_0x2895[_0x3bdb('0x24')]+')'},'headers':{'Authorization':_0x3bdb('0x19')+_0x1e6210,'OData-Version':_0x3bdb('0x1a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x27441c);})[_0x3bdb('0x12')](function(_0x59f929){var _0x2669ba=_0x59f929['headers']['odata-entityid'];var _0x54c592=_0x2669ba[_0x3bdb('0x2c')](_0x2669ba[_0x3bdb('0x2d')]('(')+0x1,_0x2669ba[_0x3bdb('0x2d')](')'));_0x2895[_0x3bdb('0x2e')]=_0x54c592;_0x18ce58(_0x2895);})['catch'](function(_0x35c5c0){_0x4c9dbe(_0x35c5c0[_0x3bdb('0x16')]);});});}function getEndUser(_0x10e96a,_0x5c112d,_0x544998,_0x203722,_0x490e7d,_0x21a7ba){return new BPromise(function(_0x2fcce2,_0x48a5e5){var _0x47fa91=_0x21a7ba[_0x3bdb('0x29')]()===_0x3bdb('0x2f')?_0x490e7d[_0x3bdb('0x30')]:_0x490e7d[_0x3bdb('0x31')];return getAuthToken(_0x5c112d,_0x544998,_0x21a7ba)['then'](function(_0x51b5e9){var _0x3eb04a={'method':_0x3bdb('0x17'),'uri':_0x203722+_0x3bdb('0x32')+_0x47fa91[_0x3bdb('0x33')]('+',_0x3bdb('0x34'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x51b5e9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3eb04a);})[_0x3bdb('0x12')](function(_0x372cdf){var _0x1177b1=null;if(_0x372cdf){var _0x5dd0b2=_0x372cdf[_0x3bdb('0x1b')];var _0x3b40dd=![];for(_0x1177b1=0x0;_0x1177b1<_0x5dd0b2['length'];_0x1177b1++){if(_0x5dd0b2[_0x1177b1][_0x3bdb('0x35')]===_0x47fa91){_0x3b40dd=!![];_0x10e96a[_0x3bdb('0x2e')]=_0x5dd0b2[_0x1177b1][_0x3bdb('0x36')];}}if(_0x3b40dd){_0x2fcce2(_0x10e96a);}else{return createEndUser(_0x10e96a,_0x5c112d,_0x544998,_0x203722,_0x490e7d,_0x21a7ba)[_0x3bdb('0x12')](function(_0x90b5fd){logger['info']('['+[_0x21a7ba['toUpperCase']()]+']\x20Enduser\x20created!',_0x90b5fd['enduserId']);_0x2fcce2(_0x90b5fd);});}}else{return createEndUser(_0x10e96a,_0x5c112d,_0x544998,_0x203722,_0x490e7d,_0x21a7ba)['then'](function(_0x2f2ad4){logger['info']('['+[_0x21a7ba[_0x3bdb('0x22')]()]+_0x3bdb('0x37'),_0x2f2ad4[_0x3bdb('0x2e')]);_0x2fcce2(_0x2f2ad4);});}});});}function getCustomFields(_0xed4939,_0x3ec451,_0x1242d8){var _0x4a7c1e={};if(_0xed4939[_0x3bdb('0x1f')]>0x0){_['forEach'](_0xed4939,function(_0x44723a){if(_[_0x3bdb('0x38')]([_0x3bdb('0x39'),_0x3bdb('0x3a')],_0x44723a[_0x3bdb('0x3b')])&&_0x44723a['nameField']&&!_0x44723a[_0x3bdb('0x3c')]){var _0x10a701=_0x44723a['idField'][_0x3bdb('0x29')]();var _0x102e81=_0x10a701[_0x3bdb('0x2c')](0x0,_0x10a701[_0x3bdb('0x3d')]('_'));var _0x3f94e9=_0x10a701[_0x3bdb('0x2c')](_0x10a701[_0x3bdb('0x3d')]('_')+0x1);if(_0x102e81===_0x1242d8){_0x4a7c1e[_0x3f94e9]=_0x44723a['content'];}}});}return _0x4a7c1e;}function getTicket(_0x537702,_0x1a0e0d,_0x4af62b,_0x2821e7,_0x5b4041,_0x2ae979,_0x1d927e){return new BPromise(function(_0x546d40,_0x35e9e2){var _0x55ce45;return getAuthToken(_0x1a0e0d,_0x4af62b,_0x1d927e)[_0x3bdb('0x12')](function(_0x5d3e0f){if(_0x2ae979['ticketType']===_0x3bdb('0x3e')){_0x55ce45={'method':'POST','uri':_0x2821e7+_0x3bdb('0x3f'),'body':Object[_0x3bdb('0x40')]({},{'title':intUtil['getString'](_0x2ae979[_0x3bdb('0x41')],_0x5b4041,'\x20'),'description':intUtil[_0x3bdb('0x42')](_0x2ae979[_0x3bdb('0x43')],_0x5b4041,'\x0a'),'customerid_contact@odata.bind':_0x3bdb('0x44')+_0x537702[_0x3bdb('0x2e')]+')','ownerid@odata.bind':'/systemusers('+_0x537702[_0x3bdb('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x2ae979['Fields'],_0x5b4041,_0x2ae979[_0x3bdb('0x45')])),'headers':{'Authorization':_0x3bdb('0x19')+_0x5d3e0f,'OData-Version':_0x3bdb('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2ae979[_0x3bdb('0x45')]===_0x3bdb('0x46')){_0x55ce45={'method':_0x3bdb('0xc'),'uri':_0x2821e7+_0x3bdb('0x47'),'body':Object[_0x3bdb('0x40')]({},{'subject':intUtil[_0x3bdb('0x42')](_0x2ae979[_0x3bdb('0x41')],_0x5b4041,'\x20'),'phonenumber':String(_0x5b4041[_0x3bdb('0x31')]),'description':intUtil[_0x3bdb('0x42')](_0x2ae979['Descriptions'],_0x5b4041,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3bdb('0x44')+_0x537702['enduserId']+')','ownerid@odata.bind':_0x3bdb('0x2b')+_0x537702[_0x3bdb('0x24')]+')','directioncode':_0x537702[_0x3bdb('0x48')]===_0x3bdb('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x537702[_0x3bdb('0x24')]+')','participationtypemask':_0x537702[_0x3bdb('0x48')]===_0x3bdb('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x3bdb('0x44')+_0x537702['enduserId']+')','participationtypemask':_0x537702[_0x3bdb('0x48')]===_0x3bdb('0x49')?0x1:0x2}]},getCustomFields(_0x2ae979[_0x3bdb('0x4a')],_0x5b4041,_0x2ae979[_0x3bdb('0x45')])),'headers':{'Authorization':_0x3bdb('0x19')+_0x5d3e0f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x55ce45);})[_0x3bdb('0x12')](function(_0x31eb04){var _0x5676b4=_0x31eb04[_0x3bdb('0x4b')][_0x3bdb('0x4c')];var _0x4c8cca=_0x5676b4[_0x3bdb('0x2c')](_0x5676b4[_0x3bdb('0x2d')]('(')+0x1,_0x5676b4[_0x3bdb('0x2d')](')'));_0x537702[_0x3bdb('0x4d')]=_0x4c8cca;_0x546d40(_0x537702);})['catch'](function(_0x44afb0){_0x35e9e2(_0x44afb0['message']);});});}function emit(_0x11f732,_0x2de0f9,_0x3a5c5c,_0x25e2db){var _0x3d341a={'uri':util[_0x3bdb('0x4e')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x11f732,_0x3a5c5c,_0x25e2db)};io['to'](util[_0x3bdb('0x4e')](_0x3bdb('0x4f'),_0x2de0f9))[_0x3bdb('0x50')]('trigger:browser:url',_0x3d341a);}exports['cs']=function(_0x41c456,_0x44e94a,_0x4b7c61,_0x41a959,_0x42857a,_0x358656,_0x5c4cbe,_0x5bdd66){var _0x19d42={};_0x358656['remoteUri']=intUtil[_0x3bdb('0x51')](_0x358656[_0x3bdb('0xe')]);_0x358656[_0x3bdb('0x52')]=intUtil[_0x3bdb('0x51')](_0x358656['serverUrl']);_0x19d42['callDirection']=_0x5bdd66===_0x3bdb('0x49')||_0x5bdd66==='unmanaged'?_0x3bdb('0x49'):_0x3bdb('0x2f');var _0x435750=util[_0x3bdb('0x4e')](_0x3bdb('0x53'),_0x358656[_0x3bdb('0xe')]);var _0x3cae3c=util[_0x3bdb('0x4e')](_0x3bdb('0x54'),_0x358656[_0x3bdb('0x55')]);var _0x2f1724=util[_0x3bdb('0x4e')](_0x3bdb('0x56'),_0x358656[_0x3bdb('0x52')],_0x44e94a[_0x3bdb('0x57')],md5(_0x44e94a['uniqueid']));if(_0x42857a&&_0x42857a['monitor_format']){logger[_0x3bdb('0x21')](_0x3bdb('0x58'),_0x3bdb('0x59'));_0x44e94a['recordingURL']=_0x2f1724;}else if(_0x5c4cbe&&_0x5c4cbe['recordingFormat']&&_0x5c4cbe[_0x3bdb('0x5a')]!==_0x3bdb('0x5b')){logger['info'](_0x3bdb('0x5c'),'Recording\x20is\x20enabled!');_0x44e94a[_0x3bdb('0x5d')]=_0x2f1724;}else{_0x44e94a[_0x3bdb('0x5d')]='';}return getUser(_0x19d42,_0x358656,_0x41a959,_0x3cae3c,_0x435750,_0x5bdd66)[_0x3bdb('0x12')](function(_0x3e263f){logger[_0x3bdb('0x21')]('['+_0x5bdd66[_0x3bdb('0x22')]()+']\x20The\x20User\x20ID\x20is:',_0x3e263f[_0x3bdb('0x24')]);logger[_0x3bdb('0x21')]('['+_0x5bdd66[_0x3bdb('0x22')]()+_0x3bdb('0x5e'),_0x3e263f['userEmail']);return getEndUser(_0x3e263f,_0x358656,_0x3cae3c,_0x435750,_0x44e94a,_0x5bdd66);})[_0x3bdb('0x12')](function(_0x10d9d0){logger['info']('['+_0x5bdd66['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x10d9d0['enduserId']);logger[_0x3bdb('0x21')]('['+_0x5bdd66['toUpperCase']()+_0x3bdb('0x5f'),_0x44e94a[_0x3bdb('0x31')]);return getTicket(_0x10d9d0,_0x358656,_0x3cae3c,_0x435750,_0x44e94a,_0x4b7c61,_0x5bdd66);})[_0x3bdb('0x12')](function(_0x1efb79){logger['info'](util[_0x3bdb('0x4e')]('['+_0x5bdd66[_0x3bdb('0x22')]()+_0x3bdb('0x60'),_0x4b7c61[_0x3bdb('0x45')],_0x1efb79['ticketId']));logger['info'](util[_0x3bdb('0x4e')]('['+_0x5bdd66[_0x3bdb('0x22')]()+_0x3bdb('0x61'),_0x5bdd66));if(_0x5bdd66!==_0x3bdb('0x62')){logger[_0x3bdb('0x21')]('['+_0x5bdd66[_0x3bdb('0x22')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x358656[_0x3bdb('0xe')],_0x41a959[_0x3bdb('0x63')],_0x4b7c61['ticketType'],_0x1efb79[_0x3bdb('0x4d')]);}})[_0x3bdb('0x14')](function(_0x494e96){logger[_0x3bdb('0x64')]('['+_0x5bdd66['toUpperCase']()+_0x3bdb('0x65'),util[_0x3bdb('0x66')](_0x494e96,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x4881=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','./util','md5','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','clientId','remoteUri','username','password','clientSecret','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','destcalleridnum','calleridnum','POST','contacts','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20Created!','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','getString','Subjects','Descriptions','Fields','phonecalls','assign','callDirection','queue','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','outbound','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId'];(function(_0x31a68c,_0x4c65b5){var _0x113d4e=function(_0x241fab){while(--_0x241fab){_0x31a68c['push'](_0x31a68c['shift']());}};_0x113d4e(++_0x4c65b5);}(_0x4881,0x13b));var _0x1488=function(_0x3f308a,_0xfc681f){_0x3f308a=_0x3f308a-0x0;var _0x5b3cab=_0x4881[_0x3f308a];return _0x5b3cab;};'use strict';var _=require(_0x1488('0x0'));var BPromise=require(_0x1488('0x1'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0x1488('0x2'));var md5=require(_0x1488('0x3'));var Redis=require('ioredis');var logger=require(_0x1488('0x4'))('dynamics365');var config=require(_0x1488('0x5'));config[_0x1488('0x6')]=_[_0x1488('0x7')](config[_0x1488('0x6')],{'host':_0x1488('0x8'),'port':0x18eb});var io=require(_0x1488('0x9'))(new Redis(config[_0x1488('0x6')]));function getAuthToken(_0x146305,_0x3adad4,_0x52d87d){var _0x4cb498={'method':'POST','uri':_0x3adad4,'form':{'client_id':_0x146305[_0x1488('0xa')],'resource':_0x146305[_0x1488('0xb')],'username':_0x146305[_0x1488('0xc')],'password':_0x146305[_0x1488('0xd')],'grant_type':'password','client_secret':_0x146305[_0x1488('0xe')]},'json':!![]};return rp(_0x4cb498)['then'](function(_0x1a5036){return _0x1a5036['access_token'];})[_0x1488('0xf')](function(_0x438794){logger[_0x1488('0x10')]('['+[_0x52d87d[_0x1488('0x11')]()]+_0x1488('0x12'));return _0x438794[_0x1488('0x13')];});}function getUser(_0x637e2d,_0x1695bb,_0x57c511,_0x35f2c2,_0x44034c,_0x2f51fc){return new BPromise(function(_0x2b9dfc,_0x24058b){return getAuthToken(_0x1695bb,_0x35f2c2,_0x2f51fc)[_0x1488('0x14')](function(_0x5b9366){var _0x404b1e={'method':_0x1488('0x15'),'uri':_0x44034c+_0x1488('0x16'),'headers':{'Authorization':_0x1488('0x17')+_0x5b9366,'OData-Version':_0x1488('0x18')},'json':!![]};return rp(_0x404b1e);})['then'](function(_0x5e6c2e){var _0x3845a2=_0x5e6c2e[_0x1488('0x19')];var _0x3e090e=![];var _0x25a9b6=null;if(!_['isNil'](_0x57c511)){if(intUtil[_0x1488('0x1a')](_0x57c511[_0x1488('0x1b')])){_0x637e2d[_0x1488('0x1c')]=_0x57c511[_0x1488('0x1b')];for(_0x25a9b6=0x0;_0x25a9b6<_0x3845a2[_0x1488('0x1d')];_0x25a9b6++){if(_0x3845a2[_0x25a9b6][_0x1488('0x1e')]===_0x57c511['email']&&!_0x3845a2[_0x25a9b6][_0x1488('0x1f')]){_0x3e090e=!![];logger['info']('['+[_0x2f51fc[_0x1488('0x11')]()]+_0x1488('0x20')+_0x3845a2[_0x25a9b6][_0x1488('0x21')]+'!');_0x637e2d['userId']=_0x3845a2[_0x25a9b6][_0x1488('0x21')];}}}}if(!_0x3e090e){logger[_0x1488('0x22')]('['+[_0x2f51fc[_0x1488('0x11')]()]+_0x1488('0x23'));_0x637e2d[_0x1488('0x1c')]=_0x1695bb[_0x1488('0xc')];for(_0x25a9b6=0x0;_0x25a9b6<_0x3845a2['length'];_0x25a9b6++){if(_0x3845a2[_0x25a9b6]['internalemailaddress']===_0x1695bb[_0x1488('0xc')]){_0x637e2d[_0x1488('0x24')]=_0x3845a2[_0x25a9b6][_0x1488('0x21')];}}}_0x2b9dfc(_0x637e2d);})[_0x1488('0xf')](function(_0x2e53ed){_0x24058b(_0x2e53ed[_0x1488('0x13')]);});});}function createEndUser(_0x28957e,_0x350693,_0x9e9bc3,_0x3ec72f,_0x1cf938,_0x1f1199){return new BPromise(function(_0x16ddab,_0x1a8d60){return getAuthToken(_0x350693,_0x9e9bc3,_0x1f1199)[_0x1488('0x14')](function(_0x3d1a68){var _0x4a5c19=_0x1f1199[_0x1488('0x25')]()==='outbound'?_0x1cf938[_0x1488('0x26')]:_0x1cf938[_0x1488('0x27')];var _0x489e5c={'method':_0x1488('0x28'),'uri':_0x3ec72f+_0x1488('0x29'),'body':{'telephone1':_0x4a5c19,'fullname':_0x4a5c19,'firstname':_0x4a5c19,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1488('0x2a')+_0x28957e[_0x1488('0x24')]+')'},'headers':{'Authorization':_0x1488('0x17')+_0x3d1a68,'OData-Version':_0x1488('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x489e5c);})['then'](function(_0x3fd26b){var _0x2cbe1e=_0x3fd26b['headers'][_0x1488('0x2b')];var _0x5a805c=_0x2cbe1e[_0x1488('0x2c')](_0x2cbe1e[_0x1488('0x2d')]('(')+0x1,_0x2cbe1e['lastIndexOf'](')'));_0x28957e[_0x1488('0x2e')]=_0x5a805c;_0x16ddab(_0x28957e);})[_0x1488('0xf')](function(_0x1f3b7c){_0x1a8d60(_0x1f3b7c['message']);});});}function getEndUser(_0x226fcd,_0x232bae,_0xc31e6,_0x37993c,_0x542aa4,_0x14a9ad){return new BPromise(function(_0x1ebd07,_0x296aa1){var _0x41bc01=_0x14a9ad[_0x1488('0x25')]()==='outbound'?_0x542aa4[_0x1488('0x26')]:_0x542aa4[_0x1488('0x27')];return getAuthToken(_0x232bae,_0xc31e6,_0x14a9ad)['then'](function(_0x2f0496){var _0x10ca74={'method':'GET','uri':_0x37993c+_0x1488('0x2f')+_0x41bc01[_0x1488('0x30')]('+',_0x1488('0x31'))+'\x27','headers':{'Authorization':_0x1488('0x17')+_0x2f0496,'If-None-Match':null,'OData-Version':_0x1488('0x18')},'json':!![]};return rp(_0x10ca74);})[_0x1488('0x14')](function(_0x30ea76){var _0x581f90=null;if(_0x30ea76){var _0xd8eaa1=_0x30ea76[_0x1488('0x19')];var _0x57c5ac=![];for(_0x581f90=0x0;_0x581f90<_0xd8eaa1[_0x1488('0x1d')];_0x581f90++){if(_0xd8eaa1[_0x581f90][_0x1488('0x32')]===_0x41bc01){_0x57c5ac=!![];_0x226fcd[_0x1488('0x2e')]=_0xd8eaa1[_0x581f90][_0x1488('0x33')];}}if(_0x57c5ac){_0x1ebd07(_0x226fcd);}else{return createEndUser(_0x226fcd,_0x232bae,_0xc31e6,_0x37993c,_0x542aa4,_0x14a9ad)[_0x1488('0x14')](function(_0x515c9e){logger[_0x1488('0x22')]('['+[_0x14a9ad[_0x1488('0x11')]()]+']\x20Enduser\x20created!',_0x515c9e['enduserId']);_0x1ebd07(_0x515c9e);});}}else{return createEndUser(_0x226fcd,_0x232bae,_0xc31e6,_0x37993c,_0x542aa4,_0x14a9ad)['then'](function(_0x1525c9){logger[_0x1488('0x22')]('['+[_0x14a9ad[_0x1488('0x11')]()]+_0x1488('0x34'),_0x1525c9[_0x1488('0x2e')]);_0x1ebd07(_0x1525c9);});}});});}function getCustomFields(_0x18a604,_0x119ebf,_0x2b1b8f){var _0x18fb77={};if(_0x18a604[_0x1488('0x1d')]>0x0){_['forEach'](_0x18a604,function(_0x5310fc){if(_[_0x1488('0x35')]([_0x1488('0x36'),_0x1488('0x37')],_0x5310fc[_0x1488('0x38')])&&_0x5310fc[_0x1488('0x39')]&&!_0x5310fc[_0x1488('0x3a')]){var _0x3c8245=_0x5310fc[_0x1488('0x3b')][_0x1488('0x25')]();var _0x105374=_0x3c8245[_0x1488('0x2c')](0x0,_0x3c8245[_0x1488('0x3c')]('_'));var _0x2498c8=_0x3c8245[_0x1488('0x2c')](_0x3c8245['indexOf']('_')+0x1);if(_0x105374===_0x2b1b8f){_0x18fb77[_0x2498c8]=_0x5310fc[_0x1488('0x3d')];}}});}return _0x18fb77;}function getTicket(_0x4c82dc,_0x19206a,_0x3b16e4,_0x5d7629,_0x20c977,_0x2a234f,_0x27fb96){return new BPromise(function(_0x5456bf,_0xacee49){var _0x21d71e;return getAuthToken(_0x19206a,_0x3b16e4,_0x27fb96)[_0x1488('0x14')](function(_0x490564){if(_0x2a234f[_0x1488('0x3e')]===_0x1488('0x3f')){_0x21d71e={'method':_0x1488('0x28'),'uri':_0x5d7629+'incidents','body':Object['assign']({},{'title':intUtil[_0x1488('0x40')](_0x2a234f[_0x1488('0x41')],_0x20c977,'\x20'),'description':intUtil[_0x1488('0x40')](_0x2a234f[_0x1488('0x42')],_0x20c977,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x4c82dc['enduserId']+')','ownerid@odata.bind':_0x1488('0x2a')+_0x4c82dc[_0x1488('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x2a234f[_0x1488('0x43')],_0x20c977,_0x2a234f[_0x1488('0x3e')])),'headers':{'Authorization':_0x1488('0x17')+_0x490564,'OData-Version':_0x1488('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2a234f[_0x1488('0x3e')]==='phonecall'){_0x21d71e={'method':_0x1488('0x28'),'uri':_0x5d7629+_0x1488('0x44'),'body':Object[_0x1488('0x45')]({},{'subject':intUtil['getString'](_0x2a234f[_0x1488('0x41')],_0x20c977,'\x20'),'phonenumber':String(_0x20c977[_0x1488('0x27')]),'description':intUtil[_0x1488('0x40')](_0x2a234f[_0x1488('0x42')],_0x20c977,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x4c82dc[_0x1488('0x2e')]+')','ownerid@odata.bind':_0x1488('0x2a')+_0x4c82dc[_0x1488('0x24')]+')','directioncode':_0x4c82dc[_0x1488('0x46')]===_0x1488('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x4c82dc[_0x1488('0x24')]+')','participationtypemask':_0x4c82dc[_0x1488('0x46')]===_0x1488('0x47')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x4c82dc['enduserId']+')','participationtypemask':_0x4c82dc[_0x1488('0x46')]==='queue'?0x1:0x2}]},getCustomFields(_0x2a234f[_0x1488('0x43')],_0x20c977,_0x2a234f[_0x1488('0x3e')])),'headers':{'Authorization':_0x1488('0x17')+_0x490564,'OData-Version':_0x1488('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x21d71e);})[_0x1488('0x14')](function(_0x3097a9){var _0x240ebb=_0x3097a9[_0x1488('0x48')]['odata-entityid'];var _0x3fc411=_0x240ebb[_0x1488('0x2c')](_0x240ebb['lastIndexOf']('(')+0x1,_0x240ebb[_0x1488('0x2d')](')'));_0x4c82dc[_0x1488('0x49')]=_0x3fc411;_0x5456bf(_0x4c82dc);})[_0x1488('0xf')](function(_0x24b897){_0xacee49(_0x24b897[_0x1488('0x13')]);});});}function emit(_0x3dde22,_0x320736,_0xc49731,_0x4e304c){var _0x4173da={'uri':util['format'](_0x1488('0x4a'),_0x3dde22,_0xc49731,_0x4e304c)};io['to'](util[_0x1488('0x4b')](_0x1488('0x4c'),_0x320736))[_0x1488('0x4d')](_0x1488('0x4e'),_0x4173da);}exports['cs']=function(_0x3903e0,_0x34849c,_0x426226,_0x3c5dcc,_0x109147,_0x4ee6ea,_0x457ac9,_0x5ce875){var _0xff3984={};_0x4ee6ea[_0x1488('0xb')]=intUtil['stripTrailingSlash'](_0x4ee6ea[_0x1488('0xb')]);_0x4ee6ea['serverUrl']=intUtil[_0x1488('0x4f')](_0x4ee6ea[_0x1488('0x50')]);_0xff3984[_0x1488('0x46')]=_0x5ce875===_0x1488('0x47')||_0x5ce875==='unmanaged'?_0x1488('0x47'):_0x1488('0x51');var _0x4e05c4=util[_0x1488('0x4b')](_0x1488('0x52'),_0x4ee6ea['remoteUri']);var _0x663547=util[_0x1488('0x4b')](_0x1488('0x53'),_0x4ee6ea[_0x1488('0x54')]);var _0x35137d=util[_0x1488('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4ee6ea['serverUrl'],_0x34849c[_0x1488('0x55')],md5(_0x34849c['uniqueid']));if(_0x109147&&_0x109147[_0x1488('0x56')]){logger['info'](_0x1488('0x57'),_0x1488('0x58'));_0x34849c[_0x1488('0x59')]=_0x35137d;}else if(_0x457ac9&&_0x457ac9[_0x1488('0x5a')]&&_0x457ac9[_0x1488('0x5a')]!==_0x1488('0x5b')){logger[_0x1488('0x22')]('[OUTBOUND]',_0x1488('0x58'));_0x34849c[_0x1488('0x59')]=_0x35137d;}else{_0x34849c[_0x1488('0x59')]='';}return getUser(_0xff3984,_0x4ee6ea,_0x3c5dcc,_0x663547,_0x4e05c4,_0x5ce875)[_0x1488('0x14')](function(_0x549cde){logger[_0x1488('0x22')]('['+_0x5ce875[_0x1488('0x11')]()+_0x1488('0x5c'),_0x549cde['userId']);logger[_0x1488('0x22')]('['+_0x5ce875['toUpperCase']()+_0x1488('0x5d'),_0x549cde[_0x1488('0x1c')]);return getEndUser(_0x549cde,_0x4ee6ea,_0x663547,_0x4e05c4,_0x34849c,_0x5ce875);})['then'](function(_0x393c03){logger[_0x1488('0x22')]('['+_0x5ce875[_0x1488('0x11')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x393c03[_0x1488('0x2e')]);logger['info']('['+_0x5ce875['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x34849c[_0x1488('0x27')]);return getTicket(_0x393c03,_0x4ee6ea,_0x663547,_0x4e05c4,_0x34849c,_0x426226,_0x5ce875);})[_0x1488('0x14')](function(_0x334004){logger[_0x1488('0x22')](util[_0x1488('0x4b')]('['+_0x5ce875[_0x1488('0x11')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x426226[_0x1488('0x3e')],_0x334004[_0x1488('0x49')]));logger[_0x1488('0x22')](util['format']('['+_0x5ce875[_0x1488('0x11')]()+_0x1488('0x5e'),_0x5ce875));if(_0x5ce875!==_0x1488('0x5f')){logger[_0x1488('0x22')]('['+_0x5ce875['toUpperCase']()+']',_0x1488('0x60'));emit(_0x4ee6ea['remoteUri'],_0x3c5dcc[_0x1488('0x61')],_0x426226[_0x1488('0x3e')],_0x334004[_0x1488('0x49')]);}})[_0x1488('0xf')](function(_0x2b5350){logger[_0x1488('0x10')]('['+_0x5ce875[_0x1488('0x11')]()+_0x1488('0x62'),util[_0x1488('0x63')](_0x2b5350,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 0710bb7..49cebba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7484=['Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','map','forEach','type','nameField','customField','toLowerCase','includes','push','idField','variable','variableName','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','trigger:browser:url','lastevent','toUpperCase','request-promise','md5','./util','../../../../config/environment','defaults','redis','application/json','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','Subjects','getString','Descriptions','<br>','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','info','Ticket\x20created!','remoteUri','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.'];(function(_0x1e134d,_0x1d4081){var _0x1248dc=function(_0x37f817){while(--_0x37f817){_0x1e134d['push'](_0x1e134d['shift']());}};_0x1248dc(++_0x1d4081);}(_0x7484,0x8e));var _0x4748=function(_0x567ea1,_0x3cb026){_0x567ea1=_0x567ea1-0x0;var _0x20964d=_0x7484[_0x567ea1];return _0x20964d;};'use strict';var _=require('lodash');var rp=require(_0x4748('0x0'));var md5=require(_0x4748('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x4748('0x2'));var config=require(_0x4748('0x3'));var logger=require('../../../../config/logger')('freshdesk');config['redis']=_[_0x4748('0x4')](config[_0x4748('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x4748('0x6'),'Accept':'application/json'};function emit(_0x16f479,_0x142518,_0x2a5d76){io['to'](_0x16f479)['emit'](_0x142518,_0x2a5d76);}function getTicket(_0x1431da,_0x118ac0,_0x521a82,_0x3feb7b,_0x44739b){logger['info'](_0x4748('0x7'));var _0x34080e=_[_0x4748('0x8')]({'responder_id':_0x118ac0['id'],'requester_id':_0x521a82['id'],'name':util[_0x4748('0x9')]('Caller\x20-\x20%s',_0x44739b[_0x4748('0xa')]),'phone':_0x44739b[_0x4748('0xb')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3feb7b[_0x4748('0xc')],_0x44739b,'\x20'),'description':intUtil[_0x4748('0xd')](_0x3feb7b[_0x4748('0xe')],_0x44739b,_0x4748('0xf')),'tags':getTags(_0x3feb7b[_0x4748('0x10')],_0x4748('0x11'))},getCustomFields(_0x3feb7b['Fields'],_0x44739b));_0x34080e[_0x4748('0x12')]=_[_0x4748('0x13')](_[_0x4748('0x14')](_0x34080e[_0x4748('0x12')],'id'),_0x4748('0x15'));return request({'uri':util[_0x4748('0x9')](_0x4748('0x16'),_0x1431da['remoteUri']),'method':_0x4748('0x17'),'body':_0x34080e})['then'](function(_0x46700c){logger[_0x4748('0x18')](_0x4748('0x19'));return _0x46700c;});}function getUser(_0x44c3e9,_0x5f26d0){if(intUtil['validateEmail'](_0x5f26d0)){return request({'uri':util[_0x4748('0x9')]('%s/api/v2/agents',_0x44c3e9[_0x4748('0x1a')]),'qs':{'email':_0x5f26d0}})['then'](function(_0x44b7fa){if(_0x44b7fa['length']){logger['info'](_0x4748('0x1b'));return _[_0x4748('0x1c')](_0x44b7fa,function(_0x54fa05){return _0x54fa05[_0x4748('0x1d')]['email']===_0x5f26d0;});}else{logger[_0x4748('0x18')](_0x4748('0x1e'));return request({'uri':util['format'](_0x4748('0x1f'),_0x44c3e9['remoteUri'])})[_0x4748('0x20')](function(_0x52983f){logger[_0x4748('0x18')](_0x4748('0x21'));return _0x52983f;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x4748('0x1f'),_0x44c3e9[_0x4748('0x1a')])})['then'](function(_0x2a0275){logger[_0x4748('0x18')]('Admin\x20account\x20selected.');return _0x2a0275;});}}function getEndUser(_0x1c5c0c,_0x2adaac,_0x4e47c2){logger['info'](_0x4748('0x22'),_0x4e47c2);return request({'uri':util[_0x4748('0x9')](_0x4748('0x23'),_0x1c5c0c[_0x4748('0x1a')]),'qs':{'phone':_0x4e47c2}})[_0x4748('0x20')](function(_0x475dec){if(_0x475dec[_0x4748('0x24')]){logger[_0x4748('0x18')](_0x4748('0x25'));return _[_0x4748('0x1c')](_0x475dec,{'phone':_0x4e47c2});}else{logger[_0x4748('0x18')](_0x4748('0x26'));return request({'uri':util['format'](_0x4748('0x23'),_0x1c5c0c[_0x4748('0x1a')]),'method':_0x4748('0x17'),'body':{'name':_0x2adaac,'phone':_0x4e47c2}})[_0x4748('0x20')](function(_0x1ab9d4){logger[_0x4748('0x18')](_0x4748('0x27'));return _0x1ab9d4;});}});}function getAuth(_0x148c09){return util[_0x4748('0x9')](_0x4748('0x28'),new Buffer(_0x148c09[_0x4748('0x29')]+':X')[_0x4748('0x2a')](_0x4748('0x2b')));}function request(_0x42123d){logger[_0x4748('0x2c')](_0x4748('0x2d'),JSON[_0x4748('0x2e')](_0x42123d));return rp(_[_0x4748('0x4')](_0x42123d,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x23e664,_0x1a258f){var _0x57eb33=[];if(_0x23e664&&_0x23e664[_0x4748('0x24')]>0x0){_0x57eb33=_[_0x4748('0x2f')](_0x23e664,_0x1a258f);}return _0x57eb33;}function getCustomFields(_0x2fe50a,_0x797348){var _0x1123e5=[];var _0x5765df={'custom_fields':[]};if(_0x2fe50a[_0x4748('0x24')]>0x0){_[_0x4748('0x30')](_0x2fe50a,function(_0x105d68){if(_['includes'](['string','picklist'],_0x105d68[_0x4748('0x31')])&&_0x105d68[_0x4748('0x32')]&&!_0x105d68[_0x4748('0x33')]){_0x5765df[_0x105d68[_0x4748('0x32')][_0x4748('0x34')]()]=_0x105d68['content'][_0x4748('0x2a')]();}else if(_[_0x4748('0x35')](['string','picklist'],_0x105d68['type'])&&_0x105d68['idField']&&_0x105d68['customField']){_0x5765df[_0x4748('0x12')][_0x4748('0x36')]({'id':_0x105d68[_0x4748('0x37')],'value':_0x105d68['content'][_0x4748('0x2a')]()});}else if(_0x105d68[_0x4748('0x31')]===_0x4748('0x38')&&_0x105d68['variableName']&&_0x105d68[_0x4748('0x37')]&&_0x105d68['customField']){_0x797348[_0x105d68[_0x4748('0x39')]]&&_0x5765df[_0x4748('0x12')][_0x4748('0x36')]({'id':_0x105d68['idField'],'value':_0x797348[_0x105d68['variableName']][_0x4748('0x2a')]()});}else if(_0x105d68[_0x4748('0x31')]===_0x4748('0x3a')&&_0x105d68[_0x4748('0x3b')]&&_0x105d68[_0x4748('0x3b')][_0x4748('0x11')]&&_0x105d68[_0x4748('0x37')]&&_0x105d68[_0x4748('0x33')]){_0x797348[_0x105d68[_0x4748('0x3b')][_0x4748('0x11')][_0x4748('0x34')]()]&&_0x5765df[_0x4748('0x12')][_0x4748('0x36')]({'id':_0x105d68['idField'],'value':_0x797348[_0x105d68[_0x4748('0x3b')][_0x4748('0x11')][_0x4748('0x34')]()][_0x4748('0x2a')]()});}});}return _0x5765df;}exports[_0x4748('0x3c')]=function(_0x476b5a,_0x2cc06a,_0x3e35a3,_0x49b461,_0x4e9459,_0x439396){var _0x536d39,_0x15a82f;_0x439396[_0x4748('0x1a')]=intUtil['stripTrailingSlash'](_0x439396[_0x4748('0x1a')]);_0x439396[_0x4748('0x3d')]=intUtil['stripTrailingSlash'](_0x439396[_0x4748('0x3d')]);if(_0x4e9459&&_0x4e9459[_0x4748('0x3e')]){logger[_0x4748('0x18')](_0x4748('0x3f'),'Recording\x20is\x20enabled!');_0x2cc06a[_0x4748('0x40')]=util['format'](_0x4748('0x41'),_0x439396[_0x4748('0x3d')],_0x2cc06a[_0x4748('0x42')],md5(_0x2cc06a[_0x4748('0x42')]));}else{_0x2cc06a[_0x4748('0x40')]='';}headers[_0x4748('0x43')]=getAuth(_0x439396);return getUser(_0x439396,_0x49b461[_0x4748('0x44')])['then'](function(_0x3a48fb){_0x536d39=_0x3a48fb;logger[_0x4748('0x18')](_0x4748('0x45'),_0x536d39['id']);return getEndUser(_0x439396,_0x2cc06a['calleridname'],_0x2cc06a[_0x4748('0xb')]);})[_0x4748('0x20')](function(_0x16147e){_0x15a82f=_0x16147e;logger[_0x4748('0x18')](_0x4748('0x46'),_0x15a82f['id']);return getTicket(_0x439396,_0x536d39,_0x15a82f,_0x3e35a3,_0x2cc06a);})['then'](function(_0x34cc86){if(_0x34cc86&&_0x34cc86['id']){logger[_0x4748('0x18')](_0x4748('0x19'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x34cc86['id']);logger['info'](_0x4748('0x3f'),_0x4748('0x47'));emit(util[_0x4748('0x9')](_0x4748('0x48'),_0x49b461[_0x4748('0x11')]),'trigger:browser:url',{'uri':util['format'](_0x4748('0x49'),_0x439396[_0x4748('0x1a')],_0x34cc86['id'])});}})[_0x4748('0x4a')](function(_0x5bc635){logger[_0x4748('0x4b')](_0x4748('0x3f'),JSON[_0x4748('0x2e')](_0x5bc635));});};exports[_0x4748('0x4c')]=function(_0x246c3b,_0xf4127f,_0x1b005e,_0x5eb097,_0x16b600,_0x318bf1,_0x289f67){var _0x4c0536,_0x3193c5;_0x318bf1[_0x4748('0x1a')]=intUtil[_0x4748('0x4d')](_0x318bf1[_0x4748('0x1a')]);_0x318bf1[_0x4748('0x3d')]=intUtil[_0x4748('0x4d')](_0x318bf1[_0x4748('0x3d')]);if(_0x289f67&&_0x289f67[_0x4748('0x4e')]&&_0x289f67[_0x4748('0x4e')]!==_0x4748('0x4f')){logger[_0x4748('0x18')](_0x4748('0x50'),_0x4748('0x51'));_0xf4127f[_0x4748('0x40')]=util[_0x4748('0x9')](_0x4748('0x41'),_0x318bf1[_0x4748('0x3d')],_0xf4127f[_0x4748('0x42')],md5(_0xf4127f[_0x4748('0x42')]));}headers[_0x4748('0x43')]=getAuth(_0x318bf1);return getUser(_0x318bf1,_0x5eb097[_0x4748('0x44')])[_0x4748('0x20')](function(_0x4428cf){_0x4c0536=_0x4428cf;logger[_0x4748('0x18')]('The\x20User\x20ID\x20is:',_0x4c0536['id']);return getEndUser(_0x318bf1,_0xf4127f[_0x4748('0x52')],_0xf4127f[_0x4748('0x53')]);})[_0x4748('0x20')](function(_0x414027){_0x3193c5=_0x414027;logger['info'](_0x4748('0x46'),_0x3193c5['id']);return getTicket(_0x318bf1,_0x4c0536,_0x3193c5,_0x1b005e,_0xf4127f);})[_0x4748('0x20')](function(_0x2ad400){if(_0x2ad400&&_0x2ad400['id']){logger[_0x4748('0x18')](_0x4748('0x19'));logger[_0x4748('0x18')](_0x4748('0x54'),_0x2ad400['id']);logger['info'](_0x4748('0x50'),_0x4748('0x47'));emit(util[_0x4748('0x9')](_0x4748('0x48'),_0x5eb097[_0x4748('0x11')]),_0x4748('0x55'),{'uri':util[_0x4748('0x9')]('%s/helpdesk/tickets/%d',_0x318bf1[_0x4748('0x1a')],_0x2ad400['id'])});}})['catch'](function(_0x40261a){logger['error']('[OUTBOUND]',JSON[_0x4748('0x2e')](_0x40261a));});};exports['unmanaged']=function(_0x4ce098,_0xa49a13,_0x2e6b82,_0x2fc316,_0x2961e4,_0x589184){var _0x4f0f10,_0x4dc4c9;_0x589184[_0x4748('0x1a')]=intUtil['stripTrailingSlash'](_0x589184['remoteUri']);_0x589184[_0x4748('0x3d')]=intUtil['stripTrailingSlash'](_0x589184['serverUrl']);if(_0x2961e4&&_0x2961e4[_0x4748('0x3e')]){logger['info']('['+_0xa49a13[_0x4748('0x56')][_0x4748('0x57')]()+']','Recording\x20is\x20enabled!');_0xa49a13[_0x4748('0x40')]=util[_0x4748('0x9')](_0x4748('0x41'),_0x589184[_0x4748('0x3d')],_0xa49a13[_0x4748('0x42')],md5(_0xa49a13[_0x4748('0x42')]));}else{_0xa49a13['recordingURL']='';}headers['Authorization']=getAuth(_0x589184);return getUser(_0x589184,'')[_0x4748('0x20')](function(_0x1aa12f){_0x4f0f10=_0x1aa12f;logger['info']('The\x20User\x20ID\x20is:',_0x4f0f10['id']);return getEndUser(_0x589184,_0xa49a13[_0x4748('0xa')],_0xa49a13[_0x4748('0xb')]);})[_0x4748('0x20')](function(_0x48e1b1){_0x4dc4c9=_0x48e1b1;logger[_0x4748('0x18')]('The\x20Enduser\x20ID\x20is:',_0x4dc4c9['id']);return getTicket(_0x589184,_0x4f0f10,_0x4dc4c9,_0x2e6b82,_0xa49a13);})[_0x4748('0x20')](function(_0x216f60){if(_0x216f60){logger['info']('Ticket\x20created!');logger[_0x4748('0x18')](_0x4748('0x54'),_0x216f60['id']);}})['catch'](function(_0x371178){logger[_0x4748('0x4b')]('['+_0xa49a13[_0x4748('0x56')][_0x4748('0x57')]()+']',JSON[_0x4748('0x2e')](_0x371178));});};
\ No newline at end of file
+var _0x7767=['name','Fields','mapValues','custom_fields','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','none','Authorization','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','catch','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','<br>'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7767,0x9e));var _0x7776=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x7767[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0x7776('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x7776('0x1'));var Redis=require(_0x7776('0x2'));var intUtil=require(_0x7776('0x3'));var config=require(_0x7776('0x4'));var logger=require(_0x7776('0x5'))('freshdesk');config['redis']=_[_0x7776('0x6')](config[_0x7776('0x7')],{'host':_0x7776('0x8'),'port':0x18eb});var io=require(_0x7776('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0x7776('0xa'),'Accept':_0x7776('0xa')};function emit(_0x19ab37,_0x5c81a2,_0x5037d3){io['to'](_0x19ab37)[_0x7776('0xb')](_0x5c81a2,_0x5037d3);}function getTicket(_0x588231,_0x4f791c,_0x105b50,_0x2e4513,_0x473daa){logger[_0x7776('0xc')]('Creating\x20new\x20ticket...');var _0x2665ea=_['merge']({'responder_id':_0x4f791c['id'],'requester_id':_0x105b50['id'],'name':util[_0x7776('0xd')](_0x7776('0xe'),_0x473daa[_0x7776('0xf')]),'phone':_0x473daa[_0x7776('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2e4513[_0x7776('0x11')],_0x473daa,'\x20'),'description':intUtil['getString'](_0x2e4513[_0x7776('0x12')],_0x473daa,_0x7776('0x13')),'tags':getTags(_0x2e4513['Tags'],_0x7776('0x14'))},getCustomFields(_0x2e4513[_0x7776('0x15')],_0x473daa));_0x2665ea['custom_fields']=_[_0x7776('0x16')](_['keyBy'](_0x2665ea[_0x7776('0x17')],'id'),_0x7776('0x18'));return request({'uri':util['format'](_0x7776('0x19'),_0x588231['remoteUri']),'method':_0x7776('0x1a'),'body':_0x2665ea})[_0x7776('0x1b')](function(_0x5aafaf){logger[_0x7776('0xc')](_0x7776('0x1c'));return _0x5aafaf;});}function getUser(_0x18fa60,_0x28266e){if(intUtil[_0x7776('0x1d')](_0x28266e)){return request({'uri':util[_0x7776('0xd')](_0x7776('0x1e'),_0x18fa60[_0x7776('0x1f')]),'qs':{'email':_0x28266e}})['then'](function(_0x31ebb5){if(_0x31ebb5[_0x7776('0x20')]){logger[_0x7776('0xc')](_0x7776('0x21'));return _[_0x7776('0x22')](_0x31ebb5,function(_0x4065e2){return _0x4065e2['contact'][_0x7776('0x23')]===_0x28266e;});}else{logger[_0x7776('0xc')](_0x7776('0x24'));return request({'uri':util['format'](_0x7776('0x25'),_0x18fa60['remoteUri'])})['then'](function(_0x43b91a){logger[_0x7776('0xc')](_0x7776('0x26'));return _0x43b91a;});}});}else{logger[_0x7776('0xc')](_0x7776('0x27'));return request({'uri':util[_0x7776('0xd')](_0x7776('0x25'),_0x18fa60['remoteUri'])})[_0x7776('0x1b')](function(_0xa42ea9){logger['info']('Admin\x20account\x20selected.');return _0xa42ea9;});}}function getEndUser(_0x258c94,_0x2ba562,_0x17ac2b){logger[_0x7776('0xc')](_0x7776('0x28'),_0x17ac2b);return request({'uri':util[_0x7776('0xd')](_0x7776('0x29'),_0x258c94['remoteUri']),'qs':{'phone':_0x17ac2b}})[_0x7776('0x1b')](function(_0x44d322){if(_0x44d322[_0x7776('0x20')]){logger[_0x7776('0xc')](_0x7776('0x2a'));return _[_0x7776('0x22')](_0x44d322,{'phone':_0x17ac2b});}else{logger[_0x7776('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x7776('0xd')](_0x7776('0x29'),_0x258c94[_0x7776('0x1f')]),'method':_0x7776('0x1a'),'body':{'name':_0x2ba562,'phone':_0x17ac2b}})[_0x7776('0x1b')](function(_0x594011){logger[_0x7776('0xc')]('Enduser\x20created.');return _0x594011;});}});}function getAuth(_0x4fb01f){return util[_0x7776('0xd')](_0x7776('0x2b'),new Buffer(_0x4fb01f['apiKey']+':X')[_0x7776('0x2c')](_0x7776('0x2d')));}function request(_0x3a3f6f){logger[_0x7776('0x2e')](_0x7776('0x2f'),JSON[_0x7776('0x30')](_0x3a3f6f));return rp(_[_0x7776('0x6')](_0x3a3f6f,{'method':_0x7776('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x23a53e,_0x1d364f){var _0x2c03ae=[];if(_0x23a53e&&_0x23a53e['length']>0x0){_0x2c03ae=_[_0x7776('0x32')](_0x23a53e,_0x1d364f);}return _0x2c03ae;}function getCustomFields(_0x5b1b57,_0x8b8758){var _0x2ad39f=[];var _0x47f063={'custom_fields':[]};if(_0x5b1b57[_0x7776('0x20')]>0x0){_[_0x7776('0x33')](_0x5b1b57,function(_0x5c419e){if(_[_0x7776('0x34')]([_0x7776('0x35'),_0x7776('0x36')],_0x5c419e[_0x7776('0x37')])&&_0x5c419e[_0x7776('0x38')]&&!_0x5c419e[_0x7776('0x39')]){_0x47f063[_0x5c419e[_0x7776('0x38')][_0x7776('0x3a')]()]=_0x5c419e[_0x7776('0x3b')][_0x7776('0x2c')]();}else if(_[_0x7776('0x34')]([_0x7776('0x35'),_0x7776('0x36')],_0x5c419e[_0x7776('0x37')])&&_0x5c419e[_0x7776('0x3c')]&&_0x5c419e['customField']){_0x47f063[_0x7776('0x17')][_0x7776('0x3d')]({'id':_0x5c419e[_0x7776('0x3c')],'value':_0x5c419e[_0x7776('0x3b')][_0x7776('0x2c')]()});}else if(_0x5c419e[_0x7776('0x37')]===_0x7776('0x3e')&&_0x5c419e[_0x7776('0x3f')]&&_0x5c419e[_0x7776('0x3c')]&&_0x5c419e[_0x7776('0x39')]){_0x8b8758[_0x5c419e['variableName']]&&_0x47f063[_0x7776('0x17')]['push']({'id':_0x5c419e[_0x7776('0x3c')],'value':_0x8b8758[_0x5c419e[_0x7776('0x3f')]][_0x7776('0x2c')]()});}else if(_0x5c419e[_0x7776('0x37')]==='customVariable'&&_0x5c419e[_0x7776('0x40')]&&_0x5c419e[_0x7776('0x40')]['name']&&_0x5c419e['idField']&&_0x5c419e[_0x7776('0x39')]){_0x8b8758[_0x5c419e[_0x7776('0x40')]['name']['toLowerCase']()]&&_0x47f063[_0x7776('0x17')]['push']({'id':_0x5c419e[_0x7776('0x3c')],'value':_0x8b8758[_0x5c419e[_0x7776('0x40')][_0x7776('0x14')][_0x7776('0x3a')]()][_0x7776('0x2c')]()});}});}return _0x47f063;}exports[_0x7776('0x41')]=function(_0x56188b,_0x57c517,_0x2d9cd1,_0x2c9e58,_0x48045f,_0x4dca2f){var _0x1e8db0,_0xcf3b4b;_0x4dca2f['remoteUri']=intUtil[_0x7776('0x42')](_0x4dca2f[_0x7776('0x1f')]);_0x4dca2f[_0x7776('0x43')]=intUtil[_0x7776('0x42')](_0x4dca2f[_0x7776('0x43')]);if(_0x48045f&&_0x48045f[_0x7776('0x44')]){logger[_0x7776('0xc')](_0x7776('0x45'),_0x7776('0x46'));_0x57c517[_0x7776('0x47')]=util[_0x7776('0xd')](_0x7776('0x48'),_0x4dca2f[_0x7776('0x43')],_0x57c517[_0x7776('0x49')],md5(_0x57c517['uniqueid']));}else{_0x57c517['recordingURL']='';}headers['Authorization']=getAuth(_0x4dca2f);return getUser(_0x4dca2f,_0x2c9e58[_0x7776('0x23')])['then'](function(_0x554de3){_0x1e8db0=_0x554de3;logger['info'](_0x7776('0x4a'),_0x1e8db0['id']);return getEndUser(_0x4dca2f,_0x57c517[_0x7776('0xf')],_0x57c517[_0x7776('0x10')]);})[_0x7776('0x1b')](function(_0x251bf8){_0xcf3b4b=_0x251bf8;logger[_0x7776('0xc')]('The\x20Enduser\x20ID\x20is:',_0xcf3b4b['id']);return getTicket(_0x4dca2f,_0x1e8db0,_0xcf3b4b,_0x2d9cd1,_0x57c517);})[_0x7776('0x1b')](function(_0x53de6f){if(_0x53de6f&&_0x53de6f['id']){logger['info']('Ticket\x20created!');logger['info'](_0x7776('0x4b'),_0x53de6f['id']);logger['info'](_0x7776('0x45'),_0x7776('0x4c'));emit(util['format'](_0x7776('0x4d'),_0x2c9e58[_0x7776('0x14')]),_0x7776('0x4e'),{'uri':util['format'](_0x7776('0x4f'),_0x4dca2f['remoteUri'],_0x53de6f['id'])});}})['catch'](function(_0x2087e2){logger[_0x7776('0x50')](_0x7776('0x45'),JSON['stringify'](_0x2087e2));});};exports['outbound']=function(_0x9e82fd,_0x42e1b0,_0x3d6a11,_0x546f15,_0x309994,_0x11f6ad,_0x42517d){var _0x2126f4,_0x48125d;_0x11f6ad['remoteUri']=intUtil[_0x7776('0x42')](_0x11f6ad[_0x7776('0x1f')]);_0x11f6ad[_0x7776('0x43')]=intUtil[_0x7776('0x42')](_0x11f6ad[_0x7776('0x43')]);if(_0x42517d&&_0x42517d['recordingFormat']&&_0x42517d['recordingFormat']!==_0x7776('0x51')){logger['info']('[OUTBOUND]',_0x7776('0x46'));_0x42e1b0[_0x7776('0x47')]=util[_0x7776('0xd')](_0x7776('0x48'),_0x11f6ad[_0x7776('0x43')],_0x42e1b0[_0x7776('0x49')],md5(_0x42e1b0[_0x7776('0x49')]));}headers[_0x7776('0x52')]=getAuth(_0x11f6ad);return getUser(_0x11f6ad,_0x546f15['email'])['then'](function(_0x48e8f1){_0x2126f4=_0x48e8f1;logger[_0x7776('0xc')](_0x7776('0x4a'),_0x2126f4['id']);return getEndUser(_0x11f6ad,_0x42e1b0['destcalleridname'],_0x42e1b0[_0x7776('0x53')]);})[_0x7776('0x1b')](function(_0x1d197d){_0x48125d=_0x1d197d;logger[_0x7776('0xc')](_0x7776('0x54'),_0x48125d['id']);return getTicket(_0x11f6ad,_0x2126f4,_0x48125d,_0x3d6a11,_0x42e1b0);})[_0x7776('0x1b')](function(_0x1c807e){if(_0x1c807e&&_0x1c807e['id']){logger[_0x7776('0xc')](_0x7776('0x1c'));logger[_0x7776('0xc')](_0x7776('0x4b'),_0x1c807e['id']);logger['info'](_0x7776('0x55'),_0x7776('0x4c'));emit(util[_0x7776('0xd')]('user:%s',_0x546f15['name']),_0x7776('0x4e'),{'uri':util[_0x7776('0xd')]('%s/helpdesk/tickets/%d',_0x11f6ad['remoteUri'],_0x1c807e['id'])});}})[_0x7776('0x56')](function(_0x115c0a){logger['error'](_0x7776('0x55'),JSON[_0x7776('0x30')](_0x115c0a));});};exports['unmanaged']=function(_0x3f6d3b,_0x47a385,_0xbe4de2,_0x3faee5,_0x177dbd,_0x2b9869){var _0xb716b1,_0x4b2b86;_0x2b9869[_0x7776('0x1f')]=intUtil[_0x7776('0x42')](_0x2b9869[_0x7776('0x1f')]);_0x2b9869[_0x7776('0x43')]=intUtil[_0x7776('0x42')](_0x2b9869[_0x7776('0x43')]);if(_0x177dbd&&_0x177dbd[_0x7776('0x44')]){logger[_0x7776('0xc')]('['+_0x47a385[_0x7776('0x57')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x47a385[_0x7776('0x47')]=util[_0x7776('0xd')](_0x7776('0x48'),_0x2b9869[_0x7776('0x43')],_0x47a385['uniqueid'],md5(_0x47a385[_0x7776('0x49')]));}else{_0x47a385[_0x7776('0x47')]='';}headers[_0x7776('0x52')]=getAuth(_0x2b9869);return getUser(_0x2b9869,'')[_0x7776('0x1b')](function(_0x456e9c){_0xb716b1=_0x456e9c;logger[_0x7776('0xc')](_0x7776('0x4a'),_0xb716b1['id']);return getEndUser(_0x2b9869,_0x47a385[_0x7776('0xf')],_0x47a385[_0x7776('0x10')]);})[_0x7776('0x1b')](function(_0x364312){_0x4b2b86=_0x364312;logger[_0x7776('0xc')](_0x7776('0x54'),_0x4b2b86['id']);return getTicket(_0x2b9869,_0xb716b1,_0x4b2b86,_0xbe4de2,_0x47a385);})[_0x7776('0x1b')](function(_0x91548a){if(_0x91548a){logger[_0x7776('0xc')](_0x7776('0x1c'));logger[_0x7776('0xc')](_0x7776('0x4b'),_0x91548a['id']);}})[_0x7776('0x56')](function(_0x11465f){logger[_0x7776('0x50')]('['+_0x47a385[_0x7776('0x57')][_0x7776('0x58')]()+']',JSON[_0x7776('0x30')](_0x11465f));});};
\ No newline at end of file
index 087d40f..44b90a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd408=['Getting\x20admin\x20information','users','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','then','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','Admin\x20selected','userEmail','userId','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20created:','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','POST','/api/tasks','getString','Descriptions','Contact','add','ticketId','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','destcalleridnum','calleridnum','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','headers'];(function(_0x6fec57,_0x4bde40){var _0x474594=function(_0x15ea6){while(--_0x15ea6){_0x6fec57['push'](_0x6fec57['shift']());}};_0x474594(++_0x4bde40);}(_0xd408,0x1df));var _0x8d40=function(_0x1b5a3e,_0x1e6f55){_0x1b5a3e=_0x1b5a3e-0x0;var _0x1e1ad1=_0xd408[_0x1b5a3e];return _0x1e1ad1;};'use strict';var _=require(_0x8d40('0x0'));var rp=require('request-promise');var md5=require(_0x8d40('0x1'));var util=require('util');var moment=require(_0x8d40('0x2'));var Promise=require('bluebird');var Redis=require(_0x8d40('0x3'));var intUtil=require(_0x8d40('0x4'));var config=require(_0x8d40('0x5'));var logger=require(_0x8d40('0x6'))(_0x8d40('0x7'));config[_0x8d40('0x8')]=_[_0x8d40('0x9')](config['redis'],{'host':_0x8d40('0xa'),'port':0x18eb});var io=require(_0x8d40('0xb'))(new Redis(config[_0x8d40('0x8')]));function getAdminId(_0x529b20,_0x3a72e4,_0x554f93,_0x55daaf){return new Promise(function(_0x47713a,_0x270c33){var _0x1f66ef=![];var _0x5a5603={'method':'GET','uri':_0x55daaf+'/api/selector/owners','json':!![]};_0x5a5603[_0x8d40('0xc')]=_0x554f93;logger['info'](_0x8d40('0xd'));return rp(_0x5a5603)['then'](function(_0x1559e5){if(_0x1559e5){var _0x45155f=_0x1559e5[_0x8d40('0xe')];var _0x503e10=null;for(_0x503e10=0x0;_0x503e10<_0x45155f[_0x8d40('0xf')];_0x503e10++){if(_0x45155f[_0x503e10][_0x8d40('0x10')]===_0x529b20[_0x8d40('0x11')]){_0x529b20[_0x8d40('0x12')]=_0x45155f[_0x503e10]['id'];_0x1f66ef=!![];}}if(_0x1f66ef){logger[_0x8d40('0x13')](_0x8d40('0x14'),_0x529b20[_0x8d40('0x12')]);_0x47713a(_0x529b20);}else{_0x270c33({'statusCode':0x194,'message':_0x8d40('0x15')});}}else{_0x270c33({'statusCode':0x194,'message':_0x8d40('0x15')});}})[_0x8d40('0x16')](function(_0xb1b840){logger[_0x8d40('0x17')]('['+[_0x3a72e4[_0x8d40('0x18')]()]+']',_0xb1b840['message']);_0x270c33(_0xb1b840);});});}function getUser(_0xaccb6,_0x2d6d7d,_0x573ef9){return function(_0x5b6dfc){return new Promise(function(_0x145550,_0x3c7d0e){var _0x4f12b6={'method':_0x8d40('0x19'),'uri':_0x573ef9+'/api/selector/owners','json':!![]};_0x4f12b6[_0x8d40('0xc')]=_0x2d6d7d;logger[_0x8d40('0x13')]('Getting\x20user\x20list');return rp(_0x4f12b6)[_0x8d40('0x1a')](function(_0x5e374f){if(_0x5e374f){var _0x5a2d90=_0x5e374f[_0x8d40('0xe')];var _0x23de1b=![];var _0x1acceb=null;if(_0x5b6dfc[_0x8d40('0x1b')]!==null){logger[_0x8d40('0x13')](_0x8d40('0x1c'),_0x5b6dfc[_0x8d40('0x1b')]);_0x5b6dfc['userEmail']=_0x5b6dfc['agentEmail'];for(_0x1acceb=0x0;_0x1acceb<_0x5a2d90[_0x8d40('0xf')];_0x1acceb++){if(_0x5a2d90[_0x1acceb][_0x8d40('0x10')]===_0x5b6dfc[_0x8d40('0x1b')]){_0x23de1b=!![];_0x5b6dfc['userId']=_0x5a2d90[_0x1acceb]['id'];logger[_0x8d40('0x13')](_0x8d40('0x1d'),_0x5b6dfc['userId']);}}}if(!_0x23de1b){logger['info'](_0x8d40('0x1e'));_0x5b6dfc[_0x8d40('0x1f')]=_0x5b6dfc[_0x8d40('0x11')];_0x5b6dfc[_0x8d40('0x20')]=_0x5b6dfc[_0x8d40('0x12')];_0x23de1b=!![];}if(_0x23de1b){_0x145550(_0x5b6dfc);}else{_0x3c7d0e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3c7d0e({'statusCode':0x194,'message':_0x8d40('0x15')});}})['catch'](function(_0x2a64dd){logger['error']('['+[_0xaccb6['toUpperCase']()]+']',_0x2a64dd['message']);_0x3c7d0e(_0x2a64dd);});});};}function searchContact(_0x47d979,_0x2785bf,_0x3364bf,_0x8c8642){return new Promise(function(_0xcfb678,_0x542231){var _0x3eec42={'method':'GET','headers':_0x2785bf,'uri':_0x47d979+_0x8d40('0x21')+_0x8c8642+_0x8d40('0x22')+_0x3364bf+_0x8d40('0x23'),'json':!![]};rp(_0x3eec42)[_0x8d40('0x1a')](function(_0x14ddeb){var _0x321eb0=_[_0x8d40('0x24')](_0x14ddeb[_0x8d40('0x25')][_0x8d40('0x25')],[_0x3364bf,_0x8c8642]);_0xcfb678(_0x321eb0);})[_0x8d40('0x16')](function(_0x192133){_0x542231(_0x192133);});});}function getEndUser(_0xc72332,_0x4f9a8e,_0x259a0a){return function(_0x2ed8ef){return new Promise(function(_0x1767a5,_0x52ba67){logger[_0x8d40('0x13')](util[_0x8d40('0x26')](_0x8d40('0x27'),_0x2ed8ef['contactNumber']));searchContact(_0x259a0a,_0x4f9a8e,_0x8d40('0x28'),_0x2ed8ef[_0x8d40('0x29')])[_0x8d40('0x1a')](function(_0x250efe){if(_0x250efe){_0x2ed8ef['endUserId']=_0x250efe['id'];logger['info'](_0x8d40('0x2a'),_0x2ed8ef[_0x8d40('0x2b')]);return _0x1767a5(_0x2ed8ef);}searchContact(_0x259a0a,_0x4f9a8e,'work_number',_0x2ed8ef[_0x8d40('0x29')])[_0x8d40('0x1a')](function(_0x4f149b){if(_0x4f149b){_0x2ed8ef['endUserId']=_0x4f149b['id'];logger[_0x8d40('0x13')]('Contact\x20found\x20work_number:',_0x2ed8ef[_0x8d40('0x2b')]);return _0x1767a5(_0x2ed8ef);}createEndUser(_0x2ed8ef,_0xc72332,_0x4f9a8e,_0x259a0a)[_0x8d40('0x1a')](function(_0x3b448b){logger['info'](_0x8d40('0x2c'),_0x3b448b['endUserId']);return _0x1767a5(_0x3b448b);});});})[_0x8d40('0x16')](function(_0x49b576){_0x52ba67(_0x49b576);});});};}function createEndUser(_0x34c3c4,_0x4d00c8,_0x1b7136,_0x29d57e){return new Promise(function(_0x3a72f3,_0x481fa3){var _0x4183a0=moment();var _0x3d3295={'method':'POST','uri':_0x29d57e+'/api/contacts','body':{'contact':{'last_name':_0x34c3c4[_0x8d40('0x29')],'work_number':_0x34c3c4['contactNumber'],'mobile_number':_0x34c3c4[_0x8d40('0x29')],'owner_id':_0x34c3c4[_0x8d40('0x20')],'created_at':_0x4183a0['format'](_0x8d40('0x2d'))}},'json':!![]};_0x3d3295[_0x8d40('0xc')]=_0x1b7136;logger['info'](_0x8d40('0x2e'));return rp(_0x3d3295)['then'](function(_0x613df9){_0x34c3c4[_0x8d40('0x2b')]=_0x613df9[_0x8d40('0x2f')]['id'];_0x3a72f3(_0x34c3c4);})[_0x8d40('0x16')](function(_0x1f07d1){logger[_0x8d40('0x17')]('['+[_0x4d00c8[_0x8d40('0x18')]()]+']',_0x1f07d1[_0x8d40('0x30')]);_0x481fa3(_0x1f07d1[_0x8d40('0x30')]);});});}function getTicket(_0x3c029e,_0x232957,_0x205851,_0x4286f7,_0xea511b){return function(_0x138bba){logger[_0x8d40('0x13')]('Creating\x20new\x20task');return new Promise(function(_0x5e2abd,_0x2ece7f){var _0x2e3b9f=moment();var _0x2b9c26={'method':_0x8d40('0x31'),'uri':_0x205851+_0x8d40('0x32'),'body':{'title':intUtil[_0x8d40('0x33')](_0x4286f7['Subjects'],_0xea511b,'\x20'),'description':intUtil[_0x8d40('0x33')](_0x4286f7[_0x8d40('0x34')],_0xea511b,'\x0a'),'owner_id':_0x138bba[_0x8d40('0x20')],'creater_id':_0x138bba[_0x8d40('0x12')],'targetable_id':_0x138bba[_0x8d40('0x2b')],'targetable_type':_0x8d40('0x35'),'created_at':_0x2e3b9f[_0x8d40('0x26')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2e3b9f[_0x8d40('0x36')](0x1e,'m')[_0x8d40('0x26')](_0x8d40('0x2d'))},'json':!![]};_0x2b9c26[_0x8d40('0xc')]=_0x232957;return rp(_0x2b9c26)['then'](function(_0xe1f973){_0x138bba[_0x8d40('0x37')]=_0xe1f973['task']['id'];logger['info'](_0x8d40('0x38'),_0x138bba[_0x8d40('0x37')]);_0x5e2abd(_0x138bba);})[_0x8d40('0x16')](function(_0x4b925e){logger[_0x8d40('0x17')]('['+[_0x3c029e[_0x8d40('0x18')]()]+']',_0x4b925e[_0x8d40('0x30')]);_0x2ece7f(_0x4b925e[_0x8d40('0x30')]);});});};}function emit(_0x50ef0e,_0x4cf330,_0x4d86ce){var _0x5c5c80={'uri':_0x50ef0e+_0x8d40('0x39')+_0x4d86ce};io['to'](util[_0x8d40('0x26')]('user:%s',_0x4cf330))[_0x8d40('0x3a')](_0x8d40('0x3b'),_0x5c5c80);}exports['cs']=function(_0x2c0a7d,_0x1437cc,_0x4500c9,_0x5a9fff,_0x1a885f,_0x1429b5,_0x441980,_0x3617f8){var _0xcec607={};var _0x47232d={'Authorization':_0x8d40('0x3c')+_0x1429b5[_0x8d40('0x3d')]};_0x1429b5['remoteUri']=intUtil['stripTrailingSlash'](_0x1429b5[_0x8d40('0x3e')]);_0x1429b5[_0x8d40('0x3f')]=intUtil[_0x8d40('0x40')](_0x1429b5[_0x8d40('0x3f')]);var _0xcc7323=_0x1429b5[_0x8d40('0x3e')];_0xcec607[_0x8d40('0x11')]=_0x1429b5['username'];_0xcec607[_0x8d40('0x29')]=_0x3617f8[_0x8d40('0x41')]()==='outbound'?_0x1437cc[_0x8d40('0x42')]:_0x1437cc[_0x8d40('0x43')];_0xcec607['callDirection']=_0x3617f8==='queue'||_0x3617f8==='unmanaged'?_0x8d40('0x44'):_0x8d40('0x45');if(_0x5a9fff){_0xcec607[_0x8d40('0x1b')]=_0x5a9fff[_0x8d40('0x10')];}var _0x546640=util[_0x8d40('0x26')](_0x8d40('0x46'),_0x1429b5[_0x8d40('0x3f')],_0x1437cc[_0x8d40('0x47')],md5(_0x1437cc[_0x8d40('0x47')]));if(_0x1a885f&&_0x1a885f[_0x8d40('0x48')]){logger[_0x8d40('0x13')](_0x8d40('0x49'),_0x8d40('0x4a'));_0x1437cc[_0x8d40('0x4b')]=_0x546640;}else if(_0x441980&&_0x441980[_0x8d40('0x4c')]&&_0x441980[_0x8d40('0x4c')]!==_0x8d40('0x4d')){logger['info']('[OUTBOUND]',_0x8d40('0x4a'));_0x1437cc[_0x8d40('0x4b')]=_0x546640;}else{_0x1437cc['recordingURL']='';}return getAdminId(_0xcec607,_0x3617f8,_0x47232d,_0xcc7323)[_0x8d40('0x1a')](getUser(_0x3617f8,_0x47232d,_0xcc7323))[_0x8d40('0x1a')](getEndUser(_0x3617f8,_0x47232d,_0xcc7323))[_0x8d40('0x1a')](getTicket(_0x3617f8,_0x47232d,_0xcc7323,_0x4500c9,_0x1437cc))[_0x8d40('0x1a')](function(_0x3362f0){logger[_0x8d40('0x13')](util[_0x8d40('0x26')](_0x8d40('0x4e'),_0x3362f0[_0x8d40('0x37')]));if(_0x3617f8!==_0x8d40('0x4f')){logger[_0x8d40('0x13')]('['+[_0x3617f8[_0x8d40('0x18')]()]+']',_0x8d40('0x50'));emit(_0xcc7323,_0x5a9fff['name'],_0x3362f0['endUserId']);}})['catch'](function(_0xa737b4){logger[_0x8d40('0x17')]('['+[_0x3617f8[_0x8d40('0x18')]()]+_0x8d40('0x51'),util['inspect'](_0xa737b4,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x2e05=['toLowerCase','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','User\x20found:','userId','Admin\x20selected','adminEmail','catch','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','contactNumber','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','add','ticketId','/contacts/','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl'];(function(_0x300f1f,_0x598f68){var _0x430c2f=function(_0x1e479f){while(--_0x1e479f){_0x300f1f['push'](_0x300f1f['shift']());}};_0x430c2f(++_0x598f68);}(_0x2e05,0xfc));var _0x52e0=function(_0x14527b,_0x426577){_0x14527b=_0x14527b-0x0;var _0x2fe75f=_0x2e05[_0x14527b];return _0x2fe75f;};'use strict';var _=require(_0x52e0('0x0'));var rp=require(_0x52e0('0x1'));var md5=require(_0x52e0('0x2'));var util=require('util');var moment=require('moment');var Promise=require(_0x52e0('0x3'));var Redis=require(_0x52e0('0x4'));var intUtil=require(_0x52e0('0x5'));var config=require(_0x52e0('0x6'));var logger=require('../../../../config/logger')(_0x52e0('0x7'));config['redis']=_['defaults'](config[_0x52e0('0x8')],{'host':_0x52e0('0x9'),'port':0x18eb});var io=require(_0x52e0('0xa'))(new Redis(config['redis']));function getAdminId(_0x4b83cc,_0x515bb0,_0x27f70e,_0x5325bc){return new Promise(function(_0x4a3811,_0x5ec3c7){var _0x5e950a=![];var _0x4da6b5={'method':_0x52e0('0xb'),'uri':_0x5325bc+_0x52e0('0xc'),'json':!![]};_0x4da6b5[_0x52e0('0xd')]=_0x27f70e;logger[_0x52e0('0xe')](_0x52e0('0xf'));return rp(_0x4da6b5)[_0x52e0('0x10')](function(_0x4019b6){if(_0x4019b6){var _0x555a40=_0x4019b6[_0x52e0('0x11')];var _0x5e51e1=null;for(_0x5e51e1=0x0;_0x5e51e1<_0x555a40[_0x52e0('0x12')];_0x5e51e1++){if(_0x555a40[_0x5e51e1]['email']===_0x4b83cc['adminEmail']){_0x4b83cc[_0x52e0('0x13')]=_0x555a40[_0x5e51e1]['id'];_0x5e950a=!![];}}if(_0x5e950a){logger[_0x52e0('0xe')]('Admin\x20found:',_0x4b83cc['adminId']);_0x4a3811(_0x4b83cc);}else{_0x5ec3c7({'statusCode':0x194,'message':_0x52e0('0x14')});}}else{_0x5ec3c7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x4abb81){logger[_0x52e0('0x15')]('['+[_0x515bb0[_0x52e0('0x16')]()]+']',_0x4abb81[_0x52e0('0x17')]);_0x5ec3c7(_0x4abb81);});});}function getUser(_0x347493,_0x139ce7,_0x38cdd7){return function(_0x502ec7){return new Promise(function(_0x7df860,_0x4e74c2){var _0x4e86ea={'method':_0x52e0('0xb'),'uri':_0x38cdd7+'/api/selector/owners','json':!![]};_0x4e86ea[_0x52e0('0xd')]=_0x139ce7;logger[_0x52e0('0xe')](_0x52e0('0x18'));return rp(_0x4e86ea)[_0x52e0('0x10')](function(_0x2944b8){if(_0x2944b8){var _0x3d44b8=_0x2944b8[_0x52e0('0x11')];var _0x299020=![];var _0xbc0c2=null;if(_0x502ec7[_0x52e0('0x19')]!==null){logger[_0x52e0('0xe')](_0x52e0('0x1a'),_0x502ec7['agentEmail']);_0x502ec7[_0x52e0('0x1b')]=_0x502ec7['agentEmail'];for(_0xbc0c2=0x0;_0xbc0c2<_0x3d44b8[_0x52e0('0x12')];_0xbc0c2++){if(_0x3d44b8[_0xbc0c2][_0x52e0('0x1c')]===_0x502ec7['agentEmail']){_0x299020=!![];_0x502ec7['userId']=_0x3d44b8[_0xbc0c2]['id'];logger[_0x52e0('0xe')](_0x52e0('0x1d'),_0x502ec7[_0x52e0('0x1e')]);}}}if(!_0x299020){logger['info'](_0x52e0('0x1f'));_0x502ec7[_0x52e0('0x1b')]=_0x502ec7[_0x52e0('0x20')];_0x502ec7[_0x52e0('0x1e')]=_0x502ec7[_0x52e0('0x13')];_0x299020=!![];}if(_0x299020){_0x7df860(_0x502ec7);}else{_0x4e74c2({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4e74c2({'statusCode':0x194,'message':_0x52e0('0x14')});}})[_0x52e0('0x21')](function(_0x48853f){logger[_0x52e0('0x15')]('['+[_0x347493['toUpperCase']()]+']',_0x48853f[_0x52e0('0x17')]);_0x4e74c2(_0x48853f);});});};}function searchContact(_0x2527a5,_0xe638fd,_0x4e4186,_0x36b2a1){return new Promise(function(_0x3e9476,_0x30e9b6){var _0x122443={'method':_0x52e0('0xb'),'headers':_0xe638fd,'uri':_0x2527a5+_0x52e0('0x22')+_0x36b2a1+_0x52e0('0x23')+_0x4e4186+'&entities=contact','json':!![]};rp(_0x122443)['then'](function(_0x47371a){var _0x110a1c=_[_0x52e0('0x24')](_0x47371a['contacts'][_0x52e0('0x25')],[_0x4e4186,_0x36b2a1]);_0x3e9476(_0x110a1c);})[_0x52e0('0x21')](function(_0x270f6c){_0x30e9b6(_0x270f6c);});});}function getEndUser(_0x1663a7,_0x16436d,_0x12ba56){return function(_0x435346){return new Promise(function(_0x1320ca,_0x1d9020){logger['info'](util[_0x52e0('0x26')](_0x52e0('0x27'),_0x435346['contactNumber']));searchContact(_0x12ba56,_0x16436d,_0x52e0('0x28'),_0x435346['contactNumber'])['then'](function(_0x4f9c69){if(_0x4f9c69){_0x435346[_0x52e0('0x29')]=_0x4f9c69['id'];logger[_0x52e0('0xe')](_0x52e0('0x2a'),_0x435346['endUserId']);return _0x1320ca(_0x435346);}searchContact(_0x12ba56,_0x16436d,_0x52e0('0x2b'),_0x435346['contactNumber'])['then'](function(_0x4eab17){if(_0x4eab17){_0x435346[_0x52e0('0x29')]=_0x4eab17['id'];logger[_0x52e0('0xe')](_0x52e0('0x2c'),_0x435346[_0x52e0('0x29')]);return _0x1320ca(_0x435346);}createEndUser(_0x435346,_0x1663a7,_0x16436d,_0x12ba56)[_0x52e0('0x10')](function(_0x26b994){logger[_0x52e0('0xe')]('Contact\x20created:',_0x26b994['endUserId']);return _0x1320ca(_0x26b994);});});})[_0x52e0('0x21')](function(_0x522c69){_0x1d9020(_0x522c69);});});};}function createEndUser(_0x54abac,_0x534475,_0xc40eaa,_0xfaff49){return new Promise(function(_0x4cd942,_0x997fa5){var _0x5240af=moment();var _0x4437e6={'method':_0x52e0('0x2d'),'uri':_0xfaff49+_0x52e0('0x2e'),'body':{'contact':{'last_name':_0x54abac['contactNumber'],'work_number':_0x54abac[_0x52e0('0x2f')],'mobile_number':_0x54abac[_0x52e0('0x2f')],'owner_id':_0x54abac[_0x52e0('0x1e')],'created_at':_0x5240af['format'](_0x52e0('0x30'))}},'json':!![]};_0x4437e6[_0x52e0('0xd')]=_0xc40eaa;logger[_0x52e0('0xe')](_0x52e0('0x31'));return rp(_0x4437e6)[_0x52e0('0x10')](function(_0x5ed90){_0x54abac[_0x52e0('0x29')]=_0x5ed90[_0x52e0('0x32')]['id'];_0x4cd942(_0x54abac);})[_0x52e0('0x21')](function(_0x59f3a2){logger[_0x52e0('0x15')]('['+[_0x534475[_0x52e0('0x16')]()]+']',_0x59f3a2[_0x52e0('0x17')]);_0x997fa5(_0x59f3a2[_0x52e0('0x17')]);});});}function getTicket(_0x299de8,_0x2763a2,_0xf43899,_0x46ea05,_0x49a921){return function(_0x335267){logger['info'](_0x52e0('0x33'));return new Promise(function(_0x348e75,_0x1d5d63){var _0x535e27=moment();var _0x5a3731={'method':_0x52e0('0x2d'),'uri':_0xf43899+'/api/tasks','body':{'title':intUtil[_0x52e0('0x34')](_0x46ea05[_0x52e0('0x35')],_0x49a921,'\x20'),'description':intUtil[_0x52e0('0x34')](_0x46ea05[_0x52e0('0x36')],_0x49a921,'\x0a'),'owner_id':_0x335267[_0x52e0('0x1e')],'creater_id':_0x335267['adminId'],'targetable_id':_0x335267['endUserId'],'targetable_type':'Contact','created_at':_0x535e27[_0x52e0('0x26')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x535e27[_0x52e0('0x37')](0x1e,'m')['format'](_0x52e0('0x30'))},'json':!![]};_0x5a3731[_0x52e0('0xd')]=_0x2763a2;return rp(_0x5a3731)['then'](function(_0x3aabd4){_0x335267[_0x52e0('0x38')]=_0x3aabd4['task']['id'];logger['info']('Task\x20created:',_0x335267[_0x52e0('0x38')]);_0x348e75(_0x335267);})[_0x52e0('0x21')](function(_0xace96a){logger['error']('['+[_0x299de8[_0x52e0('0x16')]()]+']',_0xace96a['message']);_0x1d5d63(_0xace96a[_0x52e0('0x17')]);});});};}function emit(_0x3670a6,_0x382f29,_0x1929f6){var _0x458198={'uri':_0x3670a6+_0x52e0('0x39')+_0x1929f6};io['to'](util[_0x52e0('0x26')](_0x52e0('0x3a'),_0x382f29))[_0x52e0('0x3b')](_0x52e0('0x3c'),_0x458198);}exports['cs']=function(_0x8d9bfd,_0x4d701b,_0x474110,_0x24462d,_0xe914d8,_0xd35c99,_0xfdead,_0x15a186){var _0x5d0c00={};var _0x4bf9e4={'Authorization':'Token\x20token='+_0xd35c99['apiKey']};_0xd35c99[_0x52e0('0x3d')]=intUtil[_0x52e0('0x3e')](_0xd35c99[_0x52e0('0x3d')]);_0xd35c99['serverUrl']=intUtil[_0x52e0('0x3e')](_0xd35c99[_0x52e0('0x3f')]);var _0x112ae5=_0xd35c99[_0x52e0('0x3d')];_0x5d0c00[_0x52e0('0x20')]=_0xd35c99['username'];_0x5d0c00['contactNumber']=_0x15a186[_0x52e0('0x40')]()==='outbound'?_0x4d701b[_0x52e0('0x41')]:_0x4d701b[_0x52e0('0x42')];_0x5d0c00[_0x52e0('0x43')]=_0x15a186===_0x52e0('0x44')||_0x15a186==='unmanaged'?_0x52e0('0x44'):'outbound';if(_0x24462d){_0x5d0c00[_0x52e0('0x19')]=_0x24462d[_0x52e0('0x1c')];}var _0x4f7a44=util[_0x52e0('0x26')](_0x52e0('0x45'),_0xd35c99['serverUrl'],_0x4d701b[_0x52e0('0x46')],md5(_0x4d701b['uniqueid']));if(_0xe914d8&&_0xe914d8['monitor_format']){logger[_0x52e0('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4d701b[_0x52e0('0x47')]=_0x4f7a44;}else if(_0xfdead&&_0xfdead['recordingFormat']&&_0xfdead['recordingFormat']!==_0x52e0('0x48')){logger['info'](_0x52e0('0x49'),_0x52e0('0x4a'));_0x4d701b[_0x52e0('0x47')]=_0x4f7a44;}else{_0x4d701b['recordingURL']='';}return getAdminId(_0x5d0c00,_0x15a186,_0x4bf9e4,_0x112ae5)[_0x52e0('0x10')](getUser(_0x15a186,_0x4bf9e4,_0x112ae5))[_0x52e0('0x10')](getEndUser(_0x15a186,_0x4bf9e4,_0x112ae5))[_0x52e0('0x10')](getTicket(_0x15a186,_0x4bf9e4,_0x112ae5,_0x474110,_0x4d701b))[_0x52e0('0x10')](function(_0x2026ba){logger[_0x52e0('0xe')](util[_0x52e0('0x26')](_0x52e0('0x4b'),_0x2026ba[_0x52e0('0x38')]));if(_0x15a186!==_0x52e0('0x4c')){logger[_0x52e0('0xe')]('['+[_0x15a186['toUpperCase']()]+']',_0x52e0('0x4d'));emit(_0x112ae5,_0x24462d['name'],_0x2026ba[_0x52e0('0x29')]);}})[_0x52e0('0x21')](function(_0x4fe929){logger[_0x52e0('0x15')]('['+[_0x15a186[_0x52e0('0x16')]()]+_0x52e0('0x4e'),util['inspect'](_0x4fe929,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 771a8a7..647eea7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x355c=['./vtiger','./dynamics365','./freshsales','zendesk','salesforce','zoho','desk','vtiger','dynamics365','freshsales','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','log','EVENT\x20UNKNOWN','servicenow','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk'];(function(_0x58b62a,_0x1205a6){var _0x5c86be=function(_0x4047e6){while(--_0x4047e6){_0x58b62a['push'](_0x58b62a['shift']());}};_0x5c86be(++_0x1205a6);}(_0x355c,0x1d5));var _0xc355=function(_0x2be104,_0x4bf5d0){_0x2be104=_0x2be104-0x0;var _0x31c115=_0x355c[_0x2be104];return _0x31c115;};'use strict';var _=require(_0xc355('0x0'));var util=require('util');var zendesk=require(_0xc355('0x1'));var salesforce=require(_0xc355('0x2'));var sugarcrm=require(_0xc355('0x3'));var freshdesk=require(_0xc355('0x4'));var zoho=require(_0xc355('0x5'));var desk=require(_0xc355('0x6'));var vtiger=require(_0xc355('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0xc355('0x8'));var freshsales=require(_0xc355('0x9'));var integrations=[_0xc355('0xa'),_0xc355('0xb'),'sugarcrm','freshdesk',_0xc355('0xc'),_0xc355('0xd'),_0xc355('0xe'),_0xc355('0xf'),_0xc355('0x10'),'servicenow'];exports[_0xc355('0x11')]=function(_0x5683d0,_0x455981,_0x12ea3a,_0x55edc3,_0x1fef8e,_0x4853b2){if(_0x12ea3a){if(_['includes'](integrations,_0x5683d0[_0xc355('0x12')]['toLowerCase']())){try{var _0x1c189b=null;var _0x1a32a3='';var _0x98b572=_0x12ea3a[_0x5683d0['data1'][_0xc355('0x13')]()];if(_0x98b572){var _0x7759b=_0x98b572[_0x5683d0[_0xc355('0x14')]];if(_0x7759b){var _0x125c08=_[_0xc355('0x15')](_0x7759b[_0xc355('0x16')],{'id':parseInt(_0x5683d0[_0xc355('0x17')],0xa)});if(_0x125c08){if(_0x55edc3){if(_0x1fef8e&&_0x455981[_0xc355('0x18')]){_0x1a32a3='queue';}else if(_0x455981['routeId']){_0x1a32a3='outbound';}else{console[_0xc355('0x19')](_0xc355('0x1a'),_0x455981);}}else{_0x1a32a3='unmanaged';}switch(_0x5683d0[_0xc355('0x12')][_0xc355('0x13')]()){case'zendesk':zendesk[_0x1a32a3](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2);break;case'salesforce':salesforce[_0x1a32a3](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2);break;case'sugarcrm':sugarcrm[_0x1a32a3](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2);break;case'freshdesk':freshdesk[_0x1a32a3](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2);break;case _0xc355('0xc'):zoho[_0x1a32a3](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2);break;case _0xc355('0xd'):desk[_0x1a32a3](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2);break;case'vtiger':vtiger[_0x1a32a3](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2);break;case _0xc355('0x10'):freshsales['cs'](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2,_0x1a32a3);break;case _0xc355('0x1b'):servicenow['cs'](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2,_0x1a32a3);break;case'dynamics365':dynamics365['cs'](_0x5683d0,_0x455981,_0x125c08,_0x55edc3,_0x1fef8e,_0x7759b,_0x4853b2,_0x1a32a3);break;default:console[_0xc355('0x19')](_0xc355('0x1c'));}}else{_0x1c189b=require('../../../../config/logger')(_0x5683d0['data1']['toLowerCase']());_0x1c189b[_0xc355('0x1d')](_0xc355('0x1e'),util[_0xc355('0x1f')](_0xc355('0x20'),_0x5683d0[_0xc355('0x12')]['toLowerCase'](),_0x5683d0[_0xc355('0x17')]));}}else{_0x1c189b=require(_0xc355('0x21'))(_0x5683d0[_0xc355('0x12')][_0xc355('0x13')]());_0x1c189b[_0xc355('0x1d')]('[EXEC]',util[_0xc355('0x1f')]('%s\x20account\x20#%s\x20not\x20found',_0x5683d0[_0xc355('0x12')][_0xc355('0x13')](),_0x5683d0[_0xc355('0x14')]));}}else{}}catch(_0xa81f35){console[_0xc355('0x1d')](_0xa81f35);}}}};
\ No newline at end of file
+var _0x24d8=['./sugarcrm','./freshdesk','./desk','./vtiger','./dynamics365','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','vtiger','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce'];(function(_0x316721,_0x173394){var _0x3695d1=function(_0x5b60cb){while(--_0x5b60cb){_0x316721['push'](_0x316721['shift']());}};_0x3695d1(++_0x173394);}(_0x24d8,0x165));var _0x824d=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x24d8[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x824d('0x0'));var util=require(_0x824d('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x824d('0x2'));var sugarcrm=require(_0x824d('0x3'));var freshdesk=require(_0x824d('0x4'));var zoho=require('./zoho');var desk=require(_0x824d('0x5'));var vtiger=require(_0x824d('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0x824d('0x7'));var freshsales=require('./freshsales');var integrations=['zendesk','salesforce',_0x824d('0x8'),_0x824d('0x9'),_0x824d('0xa'),_0x824d('0xb'),'vtiger',_0x824d('0xc'),_0x824d('0xd'),_0x824d('0xe')];exports[_0x824d('0xf')]=function(_0x3a3af8,_0x4aba37,_0x3b0b3,_0x65437d,_0x3b0bcd,_0x5200e9){if(_0x3b0b3){if(_[_0x824d('0x10')](integrations,_0x3a3af8[_0x824d('0x11')][_0x824d('0x12')]())){try{var _0x3e74f0=null;var _0x3220f0='';var _0x526f05=_0x3b0b3[_0x3a3af8[_0x824d('0x11')][_0x824d('0x12')]()];if(_0x526f05){var _0x14f770=_0x526f05[_0x3a3af8[_0x824d('0x13')]];if(_0x14f770){var _0x14e717=_[_0x824d('0x14')](_0x14f770[_0x824d('0x15')],{'id':parseInt(_0x3a3af8[_0x824d('0x16')],0xa)});if(_0x14e717){if(_0x65437d){if(_0x3b0bcd&&_0x4aba37['queue']){_0x3220f0=_0x824d('0x17');}else if(_0x4aba37[_0x824d('0x18')]){_0x3220f0=_0x824d('0x19');}else{console[_0x824d('0x1a')](_0x824d('0x1b'),_0x4aba37);}}else{_0x3220f0=_0x824d('0x1c');}switch(_0x3a3af8[_0x824d('0x11')][_0x824d('0x12')]()){case _0x824d('0x1d'):zendesk[_0x3220f0](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9);break;case'salesforce':salesforce[_0x3220f0](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9);break;case _0x824d('0x8'):sugarcrm[_0x3220f0](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9);break;case _0x824d('0x9'):freshdesk[_0x3220f0](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9);break;case'zoho':zoho[_0x3220f0](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9);break;case'desk':desk[_0x3220f0](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9);break;case _0x824d('0x1e'):vtiger[_0x3220f0](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9);break;case _0x824d('0xd'):freshsales['cs'](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9,_0x3220f0);break;case _0x824d('0xe'):servicenow['cs'](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9,_0x3220f0);break;case _0x824d('0xc'):dynamics365['cs'](_0x3a3af8,_0x4aba37,_0x14e717,_0x65437d,_0x3b0bcd,_0x14f770,_0x5200e9,_0x3220f0);break;default:console[_0x824d('0x1a')]('unknown\x20integration');}}else{_0x3e74f0=require(_0x824d('0x1f'))(_0x3a3af8[_0x824d('0x11')][_0x824d('0x12')]());_0x3e74f0[_0x824d('0x20')](_0x824d('0x21'),util[_0x824d('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3a3af8[_0x824d('0x11')]['toLowerCase'](),_0x3a3af8[_0x824d('0x16')]));}}else{_0x3e74f0=require(_0x824d('0x1f'))(_0x3a3af8[_0x824d('0x11')][_0x824d('0x12')]());_0x3e74f0['error'](_0x824d('0x21'),util[_0x824d('0x22')](_0x824d('0x23'),_0x3a3af8[_0x824d('0x11')][_0x824d('0x12')](),_0x3a3af8[_0x824d('0x13')]));}}else{}}catch(_0x4b103b){console[_0x824d('0x20')](_0x4b103b);}}}};
\ No newline at end of file
index e8ee2c2..8c1c4d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0877=['ioredis','../../../../config/environment','../../../../config/logger','salesforce','defaults','localhost','socket.io-emitter','redis','assign','getString','Descriptions','Task','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','sobject','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','moduleSearch','additionalSearchContact','$or','Contact','length','cloneDeep','additionalSearchLead','merge','Lead','additionalSearchAccount','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','Caller\x20-\x20%s','format','Company','No\x20Company','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[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','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','md5','jsforce','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0877,0xe9));var _0x7087=function(_0x5eff86,_0x2cdd22){_0x5eff86=_0x5eff86-0x0;var _0x4b3010=_0x0877[_0x5eff86];return _0x4b3010;};'use strict';var _=require(_0x7087('0x0'));var rp=require(_0x7087('0x1'));var moment=require(_0x7087('0x2'));var BPromise=require(_0x7087('0x3'));var md5=require(_0x7087('0x4'));var jsforce=require(_0x7087('0x5'));var util=require(_0x7087('0x6'));var Redis=require(_0x7087('0x7'));var intUtil=require('./util');var config=require(_0x7087('0x8'));var logger=require(_0x7087('0x9'))(_0x7087('0xa'));config['redis']=_[_0x7087('0xb')](config['redis'],{'host':_0x7087('0xc'),'port':0x18eb});var io=require(_0x7087('0xd'))(new Redis(config[_0x7087('0xe')]));function emit(_0x4c2a8e,_0x330e1a,_0x3b97e0){io['to'](_0x4c2a8e)['emit'](_0x330e1a,_0x3b97e0);}function getTicket(_0x8984d8,_0x3753a9,_0x3b5c9c,_0xc4a6e4,_0xab5461,_0x1ded0e,_0x277c81,_0x2a0bb8){var _0x34c717=Object[_0x7087('0xf')]({},{'OwnerId':_0x3753a9['id'],'Subject':intUtil[_0x7087('0x10')](_0xc4a6e4['Subjects'],_0xab5461,'\x20'),'Description':intUtil['getString'](_0xc4a6e4[_0x7087('0x11')],_0xab5461,'\x0a')},getCustomFields(_0x1ded0e,_0xab5461));if(_0x3b5c9c){if(_0xc4a6e4['ticketType']===_0x7087('0x12')){_0x34c717['ActivityDate']=moment['utc']();_0x34c717[_0x7087('0x13')]=![];_0x34c717[_0x7087('0x14')]=![];if(_0x3b5c9c[_0x7087('0x15')]===_0x7087('0x16')||_0x3b5c9c[_0x7087('0x15')]===_0x7087('0x17')){_0x34c717[_0x7087('0x18')]=_0x3b5c9c['id'];}else if(_0x3b5c9c[_0x7087('0x15')]===_0x7087('0x19')){_0x34c717[_0x7087('0x1a')]=_0x3b5c9c['id'];}}else if(_0xc4a6e4['ticketType']===_0x7087('0x1b')){if(_0x3b5c9c[_0x7087('0x15')]===_0x7087('0x16')){_0x34c717[_0x7087('0x1c')]=_0x3b5c9c['id'];}else if(_0x3b5c9c[_0x7087('0x15')]===_0x7087('0x19')){_0x34c717[_0x7087('0x1d')]=_0x3b5c9c['id'];}else if(_0x3b5c9c[_0x7087('0x15')]===_0x7087('0x17')&&_0xc4a6e4[_0x7087('0x1e')]){_0x34c717[_0xc4a6e4[_0x7087('0x1e')]]=_0x3b5c9c['id'];}else{logger[_0x7087('0x1f')](_0x7087('0x20'));}}}return _0x277c81['sobject'](_0xc4a6e4['ticketType'])[_0x7087('0x21')](_0x34c717);}function getUser(_0x6e7fe1,_0x25cbb6,_0x59d31b){if(!_['isNil'](_0x25cbb6)&&intUtil['validateEmail'](_0x25cbb6)){var _0x147b7e={'Email':_0x25cbb6};var _0x294ffe={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x59d31b[_0x7087('0x22')]('User')[_0x7087('0x23')](_0x147b7e,_0x294ffe)[_0x7087('0x24')]()[_0x7087('0x25')](function(_0x10ba62){if(_0x10ba62['length']){var _0x1ba009=_['find'](_0x10ba62,function(_0x58a7d1){return _0x58a7d1[_0x7087('0x26')]===_0x25cbb6;});if(_0x1ba009){logger[_0x7087('0x1f')](_0x7087('0x27'),_0x25cbb6);return BPromise[_0x7087('0x28')]({'id':_0x1ba009['Id'],'name':_0x1ba009[_0x7087('0x29')]});}}else{logger[_0x7087('0x1f')](_0x7087('0x2a'),_0x25cbb6);return _0x59d31b['identity']()[_0x7087('0x25')](function(_0x49aa6d){return BPromise[_0x7087('0x28')]({'id':_0x49aa6d[_0x7087('0x2b')],'name':_0x49aa6d[_0x7087('0x2c')]});});}});}else{logger[_0x7087('0x1f')](_0x7087('0x2a'),_0x25cbb6);return _0x59d31b[_0x7087('0x2d')]()[_0x7087('0x25')](function(_0x16d121){return BPromise[_0x7087('0x28')]({'id':_0x16d121['user_id'],'name':_0x16d121['display_name']});});}}function getEndUser(_0x4a9d5e,_0x5006e2,_0x3bb390,_0xad0e7b,_0xeb6a76){var _0x71c8ab={'$or':{'Phone':_0xad0e7b}};var _0x3e809e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x7087('0x25')](function(){logger[_0x7087('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0xad0e7b,_0x5006e2[_0x7087('0x2e')]);switch(_0x5006e2[_0x7087('0x2e')]){case'contact_lead':var _0x112661=_['cloneDeep'](_0x71c8ab);if(_0x5006e2[_0x7087('0x2f')]){var _0x54bdca={};_0x54bdca[_0x5006e2[_0x7087('0x2f')]]=_0xad0e7b;_['merge'](_0x112661[_0x7087('0x30')],_0x54bdca);}return _0xeb6a76[_0x7087('0x22')](_0x7087('0x31'))[_0x7087('0x23')](_0x112661,_0x3e809e)[_0x7087('0x24')]()[_0x7087('0x25')](function(_0x19adb8){if(_0x19adb8&&_0x19adb8[_0x7087('0x32')]){return _0x19adb8;}else{var _0x59feb5=_[_0x7087('0x33')](_0x71c8ab);if(_0x5006e2[_0x7087('0x34')]){var _0x424d15={};_0x424d15[_0x5006e2[_0x7087('0x34')]]=_0xad0e7b;_[_0x7087('0x35')](_0x59feb5[_0x7087('0x30')],_0x424d15);}return _0xeb6a76[_0x7087('0x22')](_0x7087('0x36'))[_0x7087('0x23')](_0x59feb5,_0x3e809e);}});case'account_contact_lead':var _0x2253ca=_[_0x7087('0x33')](_0x71c8ab);if(_0x5006e2[_0x7087('0x37')]){var _0x54bdca={};_0x54bdca[_0x5006e2[_0x7087('0x37')]]=_0xad0e7b;_[_0x7087('0x35')](_0x2253ca[_0x7087('0x30')],_0x54bdca);}return _0xeb6a76[_0x7087('0x22')]('Account')[_0x7087('0x23')](_0x2253ca,_0x3e809e)[_0x7087('0x24')]()[_0x7087('0x25')](function(_0x1ca4a1){if(_0x1ca4a1&&_0x1ca4a1[_0x7087('0x32')]){return _0x1ca4a1;}else{var _0x178009=_[_0x7087('0x33')](_0x71c8ab);if(_0x5006e2['additionalSearchContact']){var _0xb2d12a={};_0xb2d12a[_0x5006e2[_0x7087('0x2f')]]=_0xad0e7b;_[_0x7087('0x35')](_0x178009[_0x7087('0x30')],_0xb2d12a);}return _0xeb6a76[_0x7087('0x22')](_0x7087('0x31'))['find'](_0x178009,_0x3e809e)['then'](function(_0xc439a2){if(_0xc439a2&&_0xc439a2[_0x7087('0x32')]){return _0xc439a2;}else{var _0x2b4a72=_['cloneDeep'](_0x71c8ab);if(_0x5006e2[_0x7087('0x34')]){var _0x482b83={};_0x482b83[_0x5006e2['additionalSearchLead']]=_0xad0e7b;_['merge'](_0x2b4a72[_0x7087('0x30')],_0x482b83);}return _0xeb6a76[_0x7087('0x22')](_0x7087('0x36'))['find'](_0x2b4a72,_0x3e809e);}});}});case _0x7087('0x16'):var _0x112661=_[_0x7087('0x33')](_0x71c8ab);if(_0x5006e2[_0x7087('0x2f')]){var _0x54bdca={};_0x54bdca[_0x5006e2[_0x7087('0x2f')]]=_0xad0e7b;_[_0x7087('0x35')](_0x112661[_0x7087('0x30')],_0x54bdca);}return _0xeb6a76[_0x7087('0x22')](_0x7087('0x31'))[_0x7087('0x23')](_0x112661,_0x3e809e)['execute']();case _0x7087('0x17'):var _0x26fa7f=_[_0x7087('0x33')](_0x71c8ab);if(_0x5006e2[_0x7087('0x34')]){var _0x54bdca={};_0x54bdca[_0x5006e2['additionalSearchLead']]=_0xad0e7b;_[_0x7087('0x35')](_0x26fa7f[_0x7087('0x30')],_0x54bdca);}return _0xeb6a76[_0x7087('0x22')](_0x7087('0x36'))[_0x7087('0x23')](_0x26fa7f,_0x3e809e);case _0x7087('0x19'):var _0x2253ca=_['cloneDeep'](_0x71c8ab);if(_0x5006e2[_0x7087('0x37')]){var _0x54bdca={};_0x54bdca[_0x5006e2[_0x7087('0x37')]]=_0xad0e7b;_[_0x7087('0x35')](_0x2253ca['$or'],_0x54bdca);}return _0xeb6a76[_0x7087('0x22')]('Account')[_0x7087('0x23')](_0x2253ca,_0x3e809e);default:return null;}})[_0x7087('0x25')](function(_0x1531b9){if(_0x1531b9&&_0x1531b9[_0x7087('0x32')]){var _0x411b3b=_['first'](_0x1531b9);if(_0x411b3b){return BPromise[_0x7087('0x28')]({'id':_0x411b3b['Id'],'name':_0x411b3b[_0x7087('0x29')],'phone':_0x411b3b[_0x7087('0x38')],'endUserType':_0x411b3b[_0x7087('0x39')][_0x7087('0x3a')][_0x7087('0x3b')]()});}}})[_0x7087('0x25')](function(_0x43c9d4){if(_0x43c9d4){logger[_0x7087('0x1f')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x43c9d4[_0x7087('0x15')],_0xad0e7b);return BPromise[_0x7087('0x28')](_0x43c9d4);}else{logger['info'](_0x7087('0x3c'),_0xad0e7b);var _0x12a9e1={'Phone':_0xad0e7b};if(_0x5006e2['moduleCreate']){if(_0x5006e2[_0x7087('0x3d')]===_0x7087('0x16')){logger[_0x7087('0x1f')](_0x7087('0x3e'),_0xad0e7b,_0x5006e2['moduleCreate']);_0x12a9e1[_0x7087('0x3f')]=_0x3bb390!==_0x7087('0x40')?_0x3bb390:util['format'](_0x7087('0x41'),_0xad0e7b);}else if(_0x5006e2[_0x7087('0x3d')]==='lead'){logger['info'](_0x7087('0x3e'),_0xad0e7b,_0x5006e2[_0x7087('0x3d')]);_0x12a9e1[_0x7087('0x3f')]=_0x3bb390!==_0x7087('0x40')?_0x3bb390:util[_0x7087('0x42')](_0x7087('0x41'),_0xad0e7b);_0x12a9e1[_0x7087('0x43')]=_0x7087('0x44');}else if(_0x5006e2[_0x7087('0x3d')]===_0x7087('0x19')){logger[_0x7087('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xad0e7b,_0x5006e2['moduleCreate']);_0x12a9e1[_0x7087('0x29')]=_0x3bb390!==_0x7087('0x40')?_0x3bb390:util['format']('Caller\x20-\x20%s',_0xad0e7b);}else{return null;}}return _0xeb6a76['sobject'](_['upperFirst'](_0x5006e2[_0x7087('0x3d')]))['create'](_0x12a9e1)['then'](function(_0x2dc41a){return BPromise['resolve']({'id':_0x2dc41a['id'],'endUserType':_0x5006e2[_0x7087('0x3d')]});});}});}function getCustomFields(_0x50e62a,_0x5e3ab9){var _0x1ea3db={};if(_0x50e62a[_0x7087('0x32')]>0x0){_['forEach'](_0x50e62a,function(_0x5cf89a){if(_[_0x7087('0x45')]([_0x7087('0x46'),_0x7087('0x47')],_0x5cf89a[_0x7087('0x3a')])&&_0x5cf89a[_0x7087('0x48')]){_0x1ea3db[_0x5cf89a[_0x7087('0x48')]]=_0x5cf89a[_0x7087('0x49')][_0x7087('0x4a')]();}else if(_0x5cf89a[_0x7087('0x3a')]===_0x7087('0x4b')&&_0x5cf89a[_0x7087('0x4c')]&&_0x5cf89a['idField']){_0x5e3ab9[_0x5cf89a['variableName']]&&(_0x1ea3db[_0x5cf89a['idField']]=_0x5e3ab9[_0x5cf89a[_0x7087('0x4c')]]['toString']());}else if(_0x5cf89a[_0x7087('0x3a')]==='customVariable'&&_0x5cf89a[_0x7087('0x4d')]&&_0x5cf89a[_0x7087('0x4d')]['name']&&_0x5cf89a['idField']){_0x5e3ab9[_0x5cf89a[_0x7087('0x4d')][_0x7087('0x4e')][_0x7087('0x3b')]()]&&(_0x1ea3db[_0x5cf89a['idField']]=_0x5e3ab9[_0x5cf89a[_0x7087('0x4d')][_0x7087('0x4e')][_0x7087('0x3b')]()][_0x7087('0x4a')]());}});}return _0x1ea3db;}function getConnection(_0x2514a8){var _0x3024ce=_0x2514a8[_0x7087('0x4f')]['concat'](_0x2514a8[_0x7087('0x50')]);var _0x3eddeb=new jsforce[(_0x7087('0x51'))]({'oauth2':{'loginUrl':_0x2514a8[_0x7087('0x52')]||_0x7087('0x53'),'clientId':_0x2514a8['clientId'],'clientSecret':_0x2514a8['clientSecret']}});return _0x3eddeb['login'](_0x2514a8['username'],_0x3024ce)['then'](function(){logger[_0x7087('0x1f')](_0x7087('0x54'));return _0x3eddeb;});}exports[_0x7087('0x55')]=function(_0x43cf29,_0x5df720,_0x6fd1fb,_0x2ee185,_0x1a99ad,_0x177832){var _0x87ee91,_0x159b11,_0x5ece1c,_0x383a8c;_0x177832[_0x7087('0x56')]=intUtil[_0x7087('0x57')](_0x177832[_0x7087('0x56')]);_0x177832[_0x7087('0x52')]=intUtil[_0x7087('0x57')](_0x177832[_0x7087('0x52')]);if(_0x1a99ad&&_0x1a99ad[_0x7087('0x58')]){logger['info'](_0x7087('0x59'),'Recording\x20is\x20enabled!');_0x5df720[_0x7087('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x177832[_0x7087('0x56')],_0x5df720[_0x7087('0x5b')],md5(_0x5df720[_0x7087('0x5b')]));}else{_0x5df720[_0x7087('0x5a')]='';}return getConnection(_0x177832)[_0x7087('0x25')](function(_0x5e5b1a){_0x383a8c=_0x5e5b1a;return getUser(_0x177832,_0x2ee185[_0x7087('0x5c')],_0x383a8c);})[_0x7087('0x25')](function(_0x501c74){_0x87ee91=_0x501c74;return getEndUser(_0x177832,_0x6fd1fb,_0x5df720['calleridname'],_0x5df720[_0x7087('0x5d')],_0x383a8c);})['then'](function(_0x171990){_0x159b11=_0x171990;return getTicket(_0x177832,_0x87ee91,_0x159b11,_0x6fd1fb,_0x5df720,_0x6fd1fb[_0x7087('0x5e')],_0x383a8c,'queue');})[_0x7087('0x25')](function(_0xaac11f){_0x5ece1c=_0xaac11f;logger['info'](_0x7087('0x5f'),_0x5ece1c['id']);logger[_0x7087('0x1f')](_0x7087('0x60'),_0x5ece1c['id'],_0x2ee185['name'],_0x177832['type']);switch(_0x177832[_0x7087('0x3a')]){case'integrationTab':emit(util[_0x7087('0x42')](_0x7087('0x61'),_0x2ee185[_0x7087('0x4e')]),_0x7087('0x62'),{'recordId':_0x5ece1c['id']});break;case _0x7087('0x63'):emit(util[_0x7087('0x42')](_0x7087('0x61'),_0x2ee185[_0x7087('0x4e')]),_0x7087('0x64'),{'uri':util[_0x7087('0x42')](_0x7087('0x65'),_0x383a8c[_0x7087('0x66')],_0x5ece1c['id'])});break;default:logger[_0x7087('0x67')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x7087('0x68')](function(_0x12fd14){logger['error'](_0x7087('0x59'),_0x12fd14);});};exports[_0x7087('0x69')]=function(_0x4b8de8,_0x14abc7,_0x5cdd43,_0x427867,_0x31910c,_0x58e474,_0x43843e){var _0x1ea78a,_0x26e785,_0x1d1cf1,_0x5dda66;_0x58e474[_0x7087('0x56')]=intUtil[_0x7087('0x57')](_0x58e474['serverUrl']);_0x58e474[_0x7087('0x52')]=intUtil[_0x7087('0x57')](_0x58e474[_0x7087('0x52')]);if(_0x43843e&&_0x43843e['recordingFormat']&&_0x43843e[_0x7087('0x6a')]!==_0x7087('0x6b')){logger[_0x7087('0x1f')](_0x7087('0x6c'),_0x7087('0x6d'));_0x14abc7[_0x7087('0x5a')]=util[_0x7087('0x42')](_0x7087('0x6e'),_0x58e474[_0x7087('0x56')],_0x14abc7['uniqueid'],md5(_0x14abc7[_0x7087('0x5b')]));}return getConnection(_0x58e474)[_0x7087('0x25')](function(_0x39ba30){_0x5dda66=_0x39ba30;return getUser(_0x58e474,_0x427867[_0x7087('0x5c')],_0x5dda66);})[_0x7087('0x25')](function(_0x27dde8){_0x1ea78a=_0x27dde8;return getEndUser(_0x58e474,_0x5cdd43,_0x14abc7[_0x7087('0x6f')],_0x14abc7[_0x7087('0x70')],_0x5dda66);})['then'](function(_0x25aaf1){_0x26e785=_0x25aaf1;return getTicket(_0x58e474,_0x1ea78a,_0x26e785,_0x5cdd43,_0x14abc7,_0x5cdd43[_0x7087('0x5e')],_0x5dda66,_0x7087('0x69'));})['then'](function(_0x1ae350){_0x1d1cf1=_0x1ae350;logger[_0x7087('0x1f')](_0x7087('0x71'),_0x1d1cf1['id']);logger['info'](_0x7087('0x72'),_0x1d1cf1['id'],_0x427867[_0x7087('0x4e')],_0x58e474['type']);switch(_0x58e474['type']){case _0x7087('0x73'):emit(util['format'](_0x7087('0x61'),_0x427867[_0x7087('0x4e')]),_0x7087('0x62'),{'recordId':_0x1d1cf1['id']});break;case _0x7087('0x63'):emit(util[_0x7087('0x42')](_0x7087('0x61'),_0x427867[_0x7087('0x4e')]),'trigger:browser:url',{'uri':util[_0x7087('0x42')]('%s/%s/e',_0x5dda66[_0x7087('0x66')],_0x1d1cf1['id'])});break;default:logger[_0x7087('0x67')](_0x7087('0x6c'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x7087('0x68')](function(_0x2620c5){logger['error'](_0x7087('0x6c'),_0x2620c5);});};exports[_0x7087('0x74')]=function(_0x2c418e,_0x389772,_0x7c0da2,_0x4b9b47,_0x2cb9f7,_0x3c649d){var _0x5a1115,_0x4f4936,_0x28a0d0,_0x276d38;_0x3c649d[_0x7087('0x56')]=intUtil[_0x7087('0x57')](_0x3c649d['serverUrl']);_0x3c649d[_0x7087('0x52')]=intUtil[_0x7087('0x57')](_0x3c649d['remoteUri']);if(_0x2cb9f7&&_0x2cb9f7[_0x7087('0x58')]){logger[_0x7087('0x1f')]('['+_0x389772[_0x7087('0x75')][_0x7087('0x76')]()+']',_0x7087('0x6d'));_0x389772[_0x7087('0x5a')]=util[_0x7087('0x42')](_0x7087('0x6e'),_0x3c649d[_0x7087('0x56')],_0x389772[_0x7087('0x5b')],md5(_0x389772['uniqueid']));}else{_0x389772[_0x7087('0x5a')]='';}return getConnection(_0x3c649d)[_0x7087('0x25')](function(_0x10f1cb){_0x276d38=_0x10f1cb;if(!_['isNil'](_0x4b9b47)){return getUser(_0x3c649d,_0x4b9b47[_0x7087('0x4e')],_0x276d38);}else{return getUser(_0x3c649d,null,_0x276d38);}})[_0x7087('0x25')](function(_0x59820a){_0x5a1115=_0x59820a;return getEndUser(_0x3c649d,_0x7c0da2,_0x389772['calleridname'],_0x389772[_0x7087('0x5d')],_0x276d38);})[_0x7087('0x25')](function(_0x325119){_0x4f4936=_0x325119;return getTicket(_0x3c649d,_0x5a1115,_0x4f4936,_0x7c0da2,_0x389772,_0x7c0da2[_0x7087('0x5e')],_0x276d38);})[_0x7087('0x25')](function(_0x39336c){_0x28a0d0=_0x39336c;logger[_0x7087('0x1f')]('['+_0x389772[_0x7087('0x75')]['toUpperCase']()+_0x7087('0x77'),_0x28a0d0['id']);logger[_0x7087('0x1f')]('['+_0x389772[_0x7087('0x75')][_0x7087('0x76')]()+']\x20Integration\x20account\x20type\x20%s.',_0x3c649d[_0x7087('0x3a')]);})['catch'](function(_0x16a51d){logger[_0x7087('0x67')]('['+_0x389772['lastevent'][_0x7087('0x76')]()+']',_0x16a51d);});};
\ No newline at end of file
+var _0x312c=['destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','[OUTBOUND]','monitor_format','calleridnum','toUpperCase','lastevent',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','lead','WhoId','account','WhatId','Case','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','find','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','identity','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','execute','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','contact','first','Phone','attributes','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','LastName','<unknown>','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','name','Variable','password','concat','remoteUri','https://login.salesforce.com','login','username','Connection\x20established.','queue','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','stripTrailingSlash','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x312c,0x10d));var _0xc312=function(_0x14a652,_0x14ebdf){_0x14a652=_0x14a652-0x0;var _0x190f2c=_0x312c[_0x14a652];return _0x190f2c;};'use strict';var _=require(_0xc312('0x0'));var rp=require(_0xc312('0x1'));var moment=require(_0xc312('0x2'));var BPromise=require(_0xc312('0x3'));var md5=require(_0xc312('0x4'));var jsforce=require(_0xc312('0x5'));var util=require(_0xc312('0x6'));var Redis=require(_0xc312('0x7'));var intUtil=require(_0xc312('0x8'));var config=require(_0xc312('0x9'));var logger=require(_0xc312('0xa'))(_0xc312('0xb'));config[_0xc312('0xc')]=_['defaults'](config[_0xc312('0xc')],{'host':_0xc312('0xd'),'port':0x18eb});var io=require(_0xc312('0xe'))(new Redis(config[_0xc312('0xc')]));function emit(_0x1118a3,_0x4d8213,_0x180d67){io['to'](_0x1118a3)[_0xc312('0xf')](_0x4d8213,_0x180d67);}function getTicket(_0x498663,_0xde05a0,_0x5ec74,_0x45120d,_0x34fbd1,_0x45f522,_0x205f49,_0x5cca17){var _0x26495f=Object[_0xc312('0x10')]({},{'OwnerId':_0xde05a0['id'],'Subject':intUtil[_0xc312('0x11')](_0x45120d[_0xc312('0x12')],_0x34fbd1,'\x20'),'Description':intUtil[_0xc312('0x11')](_0x45120d[_0xc312('0x13')],_0x34fbd1,'\x0a')},getCustomFields(_0x45f522,_0x34fbd1));if(_0x5ec74){if(_0x45120d[_0xc312('0x14')]===_0xc312('0x15')){_0x26495f[_0xc312('0x16')]=moment[_0xc312('0x17')]();_0x26495f['IsReminderSet']=![];_0x26495f[_0xc312('0x18')]=![];if(_0x5ec74[_0xc312('0x19')]==='contact'||_0x5ec74[_0xc312('0x19')]===_0xc312('0x1a')){_0x26495f[_0xc312('0x1b')]=_0x5ec74['id'];}else if(_0x5ec74[_0xc312('0x19')]===_0xc312('0x1c')){_0x26495f[_0xc312('0x1d')]=_0x5ec74['id'];}}else if(_0x45120d[_0xc312('0x14')]===_0xc312('0x1e')){if(_0x5ec74['endUserType']==='contact'){_0x26495f[_0xc312('0x1f')]=_0x5ec74['id'];}else if(_0x5ec74[_0xc312('0x19')]===_0xc312('0x1c')){_0x26495f['AccountId']=_0x5ec74['id'];}else if(_0x5ec74[_0xc312('0x19')]===_0xc312('0x1a')&&_0x45120d[_0xc312('0x20')]){_0x26495f[_0x45120d[_0xc312('0x20')]]=_0x5ec74['id'];}else{logger[_0xc312('0x21')](_0xc312('0x22'));}}}return _0x205f49[_0xc312('0x23')](_0x45120d[_0xc312('0x14')])[_0xc312('0x24')](_0x26495f);}function getUser(_0x314a0e,_0x722e61,_0x10c7c8){if(!_[_0xc312('0x25')](_0x722e61)&&intUtil['validateEmail'](_0x722e61)){var _0x41739e={'Email':_0x722e61};var _0x21fd54={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x10c7c8[_0xc312('0x23')]('User')[_0xc312('0x26')](_0x41739e,_0x21fd54)['execute']()[_0xc312('0x27')](function(_0x1f4160){if(_0x1f4160[_0xc312('0x28')]){var _0x45e32f=_[_0xc312('0x26')](_0x1f4160,function(_0x35adaf){return _0x35adaf['Email']===_0x722e61;});if(_0x45e32f){logger[_0xc312('0x21')](_0xc312('0x29'),_0x722e61);return BPromise[_0xc312('0x2a')]({'id':_0x45e32f['Id'],'name':_0x45e32f[_0xc312('0x2b')]});}}else{logger['info'](_0xc312('0x2c'),_0x722e61);return _0x10c7c8['identity']()[_0xc312('0x27')](function(_0x24a219){return BPromise[_0xc312('0x2a')]({'id':_0x24a219['user_id'],'name':_0x24a219[_0xc312('0x2d')]});});}});}else{logger[_0xc312('0x21')](_0xc312('0x2c'),_0x722e61);return _0x10c7c8[_0xc312('0x2e')]()[_0xc312('0x27')](function(_0x53170f){return BPromise[_0xc312('0x2a')]({'id':_0x53170f['user_id'],'name':_0x53170f['display_name']});});}}function getEndUser(_0x547316,_0x2d8010,_0x3650f5,_0x234340,_0xb77b06){var _0x116c16={'$or':{'Phone':_0x234340}};var _0x3d5aed={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0xc312('0x21')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x234340,_0x2d8010[_0xc312('0x2f')]);switch(_0x2d8010['moduleSearch']){case _0xc312('0x30'):var _0x20113c=_[_0xc312('0x31')](_0x116c16);if(_0x2d8010[_0xc312('0x32')]){var _0x318276={};_0x318276[_0x2d8010[_0xc312('0x32')]]=_0x234340;_[_0xc312('0x33')](_0x20113c['$or'],_0x318276);}return _0xb77b06[_0xc312('0x23')](_0xc312('0x34'))[_0xc312('0x26')](_0x20113c,_0x3d5aed)[_0xc312('0x35')]()['then'](function(_0x1053d4){if(_0x1053d4&&_0x1053d4[_0xc312('0x28')]){return _0x1053d4;}else{var _0x3a152a=_[_0xc312('0x31')](_0x116c16);if(_0x2d8010['additionalSearchLead']){var _0x45ec5d={};_0x45ec5d[_0x2d8010[_0xc312('0x36')]]=_0x234340;_[_0xc312('0x33')](_0x3a152a[_0xc312('0x37')],_0x45ec5d);}return _0xb77b06[_0xc312('0x23')](_0xc312('0x38'))['find'](_0x3a152a,_0x3d5aed);}});case _0xc312('0x39'):var _0x23f7ae=_[_0xc312('0x31')](_0x116c16);if(_0x2d8010[_0xc312('0x3a')]){var _0x318276={};_0x318276[_0x2d8010[_0xc312('0x3a')]]=_0x234340;_[_0xc312('0x33')](_0x23f7ae[_0xc312('0x37')],_0x318276);}return _0xb77b06[_0xc312('0x23')](_0xc312('0x3b'))[_0xc312('0x26')](_0x23f7ae,_0x3d5aed)[_0xc312('0x35')]()[_0xc312('0x27')](function(_0x36c5ac){if(_0x36c5ac&&_0x36c5ac[_0xc312('0x28')]){return _0x36c5ac;}else{var _0xf23533=_[_0xc312('0x31')](_0x116c16);if(_0x2d8010[_0xc312('0x32')]){var _0x3b5851={};_0x3b5851[_0x2d8010[_0xc312('0x32')]]=_0x234340;_[_0xc312('0x33')](_0xf23533[_0xc312('0x37')],_0x3b5851);}return _0xb77b06[_0xc312('0x23')]('Contact')[_0xc312('0x26')](_0xf23533,_0x3d5aed)['then'](function(_0x30cac9){if(_0x30cac9&&_0x30cac9[_0xc312('0x28')]){return _0x30cac9;}else{var _0x12fbff=_[_0xc312('0x31')](_0x116c16);if(_0x2d8010[_0xc312('0x36')]){var _0x271f9a={};_0x271f9a[_0x2d8010[_0xc312('0x36')]]=_0x234340;_[_0xc312('0x33')](_0x12fbff['$or'],_0x271f9a);}return _0xb77b06[_0xc312('0x23')](_0xc312('0x38'))['find'](_0x12fbff,_0x3d5aed);}});}});case _0xc312('0x3c'):var _0x20113c=_[_0xc312('0x31')](_0x116c16);if(_0x2d8010[_0xc312('0x32')]){var _0x318276={};_0x318276[_0x2d8010[_0xc312('0x32')]]=_0x234340;_['merge'](_0x20113c[_0xc312('0x37')],_0x318276);}return _0xb77b06['sobject'](_0xc312('0x34'))[_0xc312('0x26')](_0x20113c,_0x3d5aed)[_0xc312('0x35')]();case _0xc312('0x1a'):var _0x4d0641=_['cloneDeep'](_0x116c16);if(_0x2d8010[_0xc312('0x36')]){var _0x318276={};_0x318276[_0x2d8010[_0xc312('0x36')]]=_0x234340;_[_0xc312('0x33')](_0x4d0641[_0xc312('0x37')],_0x318276);}return _0xb77b06[_0xc312('0x23')](_0xc312('0x38'))['find'](_0x4d0641,_0x3d5aed);case _0xc312('0x1c'):var _0x23f7ae=_['cloneDeep'](_0x116c16);if(_0x2d8010[_0xc312('0x3a')]){var _0x318276={};_0x318276[_0x2d8010[_0xc312('0x3a')]]=_0x234340;_['merge'](_0x23f7ae[_0xc312('0x37')],_0x318276);}return _0xb77b06[_0xc312('0x23')](_0xc312('0x3b'))[_0xc312('0x26')](_0x23f7ae,_0x3d5aed);default:return null;}})[_0xc312('0x27')](function(_0x39ed23){if(_0x39ed23&&_0x39ed23[_0xc312('0x28')]){var _0x25b435=_[_0xc312('0x3d')](_0x39ed23);if(_0x25b435){return BPromise['resolve']({'id':_0x25b435['Id'],'name':_0x25b435[_0xc312('0x2b')],'phone':_0x25b435[_0xc312('0x3e')],'endUserType':_0x25b435[_0xc312('0x3f')]['type']['toLowerCase']()});}}})[_0xc312('0x27')](function(_0x77549b){if(_0x77549b){logger[_0xc312('0x21')](_0xc312('0x40'),_0x77549b[_0xc312('0x19')],_0x234340);return BPromise['resolve'](_0x77549b);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x234340);var _0x3f6e93={'Phone':_0x234340};if(_0x2d8010[_0xc312('0x41')]){if(_0x2d8010[_0xc312('0x41')]===_0xc312('0x3c')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x234340,_0x2d8010[_0xc312('0x41')]);_0x3f6e93[_0xc312('0x42')]=_0x3650f5!==_0xc312('0x43')?_0x3650f5:util[_0xc312('0x44')](_0xc312('0x45'),_0x234340);}else if(_0x2d8010['moduleCreate']==='lead'){logger[_0xc312('0x21')](_0xc312('0x46'),_0x234340,_0x2d8010[_0xc312('0x41')]);_0x3f6e93[_0xc312('0x42')]=_0x3650f5!==_0xc312('0x43')?_0x3650f5:util[_0xc312('0x44')](_0xc312('0x45'),_0x234340);_0x3f6e93[_0xc312('0x47')]=_0xc312('0x48');}else if(_0x2d8010[_0xc312('0x41')]===_0xc312('0x1c')){logger['info'](_0xc312('0x46'),_0x234340,_0x2d8010['moduleCreate']);_0x3f6e93[_0xc312('0x2b')]=_0x3650f5!==_0xc312('0x43')?_0x3650f5:util[_0xc312('0x44')](_0xc312('0x45'),_0x234340);}else{return null;}}return _0xb77b06[_0xc312('0x23')](_['upperFirst'](_0x2d8010[_0xc312('0x41')]))[_0xc312('0x24')](_0x3f6e93)[_0xc312('0x27')](function(_0x3b9d0b){return BPromise[_0xc312('0x2a')]({'id':_0x3b9d0b['id'],'endUserType':_0x2d8010[_0xc312('0x41')]});});}});}function getCustomFields(_0x49fab2,_0x4840f9){var _0x2888b4={};if(_0x49fab2[_0xc312('0x28')]>0x0){_[_0xc312('0x49')](_0x49fab2,function(_0x4c35b1){if(_[_0xc312('0x4a')](['string',_0xc312('0x4b')],_0x4c35b1['type'])&&_0x4c35b1[_0xc312('0x4c')]){_0x2888b4[_0x4c35b1[_0xc312('0x4c')]]=_0x4c35b1[_0xc312('0x4d')][_0xc312('0x4e')]();}else if(_0x4c35b1[_0xc312('0x4f')]===_0xc312('0x50')&&_0x4c35b1[_0xc312('0x51')]&&_0x4c35b1[_0xc312('0x4c')]){_0x4840f9[_0x4c35b1[_0xc312('0x51')]]&&(_0x2888b4[_0x4c35b1['idField']]=_0x4840f9[_0x4c35b1[_0xc312('0x51')]][_0xc312('0x4e')]());}else if(_0x4c35b1['type']===_0xc312('0x52')&&_0x4c35b1['Variable']&&_0x4c35b1['Variable'][_0xc312('0x53')]&&_0x4c35b1[_0xc312('0x4c')]){_0x4840f9[_0x4c35b1[_0xc312('0x54')][_0xc312('0x53')]['toLowerCase']()]&&(_0x2888b4[_0x4c35b1[_0xc312('0x4c')]]=_0x4840f9[_0x4c35b1[_0xc312('0x54')][_0xc312('0x53')]['toLowerCase']()]['toString']());}});}return _0x2888b4;}function getConnection(_0x12ab00){var _0x458058=_0x12ab00[_0xc312('0x55')][_0xc312('0x56')](_0x12ab00['securityToken']);var _0x5bbde3=new jsforce['Connection']({'oauth2':{'loginUrl':_0x12ab00[_0xc312('0x57')]||_0xc312('0x58'),'clientId':_0x12ab00['clientId'],'clientSecret':_0x12ab00['clientSecret']}});return _0x5bbde3[_0xc312('0x59')](_0x12ab00[_0xc312('0x5a')],_0x458058)[_0xc312('0x27')](function(){logger[_0xc312('0x21')](_0xc312('0x5b'));return _0x5bbde3;});}exports[_0xc312('0x5c')]=function(_0x116be8,_0x166487,_0x4001f4,_0x574023,_0x38cb0a,_0xd180d2){var _0x361de3,_0x4a2fe2,_0x494dff,_0x145b01;_0xd180d2[_0xc312('0x5d')]=intUtil['stripTrailingSlash'](_0xd180d2[_0xc312('0x5d')]);_0xd180d2[_0xc312('0x57')]=intUtil['stripTrailingSlash'](_0xd180d2[_0xc312('0x57')]);if(_0x38cb0a&&_0x38cb0a['monitor_format']){logger['info'](_0xc312('0x5e'),_0xc312('0x5f'));_0x166487['recordingURL']=util[_0xc312('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd180d2[_0xc312('0x5d')],_0x166487[_0xc312('0x60')],md5(_0x166487[_0xc312('0x60')]));}else{_0x166487[_0xc312('0x61')]='';}return getConnection(_0xd180d2)[_0xc312('0x27')](function(_0x1d1eb0){_0x145b01=_0x1d1eb0;return getUser(_0xd180d2,_0x574023['email'],_0x145b01);})[_0xc312('0x27')](function(_0x35820e){_0x361de3=_0x35820e;return getEndUser(_0xd180d2,_0x4001f4,_0x166487[_0xc312('0x62')],_0x166487['calleridnum'],_0x145b01);})[_0xc312('0x27')](function(_0xd9cac7){_0x4a2fe2=_0xd9cac7;return getTicket(_0xd180d2,_0x361de3,_0x4a2fe2,_0x4001f4,_0x166487,_0x4001f4[_0xc312('0x63')],_0x145b01,_0xc312('0x5c'));})['then'](function(_0x526705){_0x494dff=_0x526705;logger[_0xc312('0x21')](_0xc312('0x64'),_0x494dff['id']);logger[_0xc312('0x21')](_0xc312('0x65'),_0x494dff['id'],_0x574023[_0xc312('0x53')],_0xd180d2[_0xc312('0x4f')]);switch(_0xd180d2[_0xc312('0x4f')]){case _0xc312('0x66'):emit(util[_0xc312('0x44')](_0xc312('0x67'),_0x574023[_0xc312('0x53')]),_0xc312('0x68'),{'recordId':_0x494dff['id']});break;case _0xc312('0x69'):emit(util[_0xc312('0x44')](_0xc312('0x67'),_0x574023[_0xc312('0x53')]),_0xc312('0x6a'),{'uri':util[_0xc312('0x44')](_0xc312('0x6b'),_0x145b01[_0xc312('0x6c')],_0x494dff['id'])});break;default:logger[_0xc312('0x6d')](_0xc312('0x6e'));}})[_0xc312('0x6f')](function(_0x32c5e8){logger[_0xc312('0x6d')]('[QUEUE]',_0x32c5e8);});};exports[_0xc312('0x70')]=function(_0x368a73,_0x5601d5,_0x5335d7,_0x27b005,_0x384182,_0x40b8b8,_0x495add){var _0x41c71f,_0x3b66c7,_0x1205d1,_0x53f36a;_0x40b8b8['serverUrl']=intUtil[_0xc312('0x71')](_0x40b8b8[_0xc312('0x5d')]);_0x40b8b8['remoteUri']=intUtil[_0xc312('0x71')](_0x40b8b8[_0xc312('0x57')]);if(_0x495add&&_0x495add[_0xc312('0x72')]&&_0x495add[_0xc312('0x72')]!==_0xc312('0x73')){logger[_0xc312('0x21')]('[OUTBOUND]',_0xc312('0x5f'));_0x5601d5[_0xc312('0x61')]=util[_0xc312('0x44')](_0xc312('0x74'),_0x40b8b8[_0xc312('0x5d')],_0x5601d5[_0xc312('0x60')],md5(_0x5601d5[_0xc312('0x60')]));}return getConnection(_0x40b8b8)[_0xc312('0x27')](function(_0x1a12f0){_0x53f36a=_0x1a12f0;return getUser(_0x40b8b8,_0x27b005[_0xc312('0x75')],_0x53f36a);})[_0xc312('0x27')](function(_0x5b1c10){_0x41c71f=_0x5b1c10;return getEndUser(_0x40b8b8,_0x5335d7,_0x5601d5[_0xc312('0x76')],_0x5601d5[_0xc312('0x77')],_0x53f36a);})[_0xc312('0x27')](function(_0x31c317){_0x3b66c7=_0x31c317;return getTicket(_0x40b8b8,_0x41c71f,_0x3b66c7,_0x5335d7,_0x5601d5,_0x5335d7[_0xc312('0x63')],_0x53f36a,_0xc312('0x70'));})[_0xc312('0x27')](function(_0x26957d){_0x1205d1=_0x26957d;logger[_0xc312('0x21')](_0xc312('0x78'),_0x1205d1['id']);logger[_0xc312('0x21')](_0xc312('0x79'),_0x1205d1['id'],_0x27b005[_0xc312('0x53')],_0x40b8b8[_0xc312('0x4f')]);switch(_0x40b8b8[_0xc312('0x4f')]){case _0xc312('0x66'):emit(util[_0xc312('0x44')](_0xc312('0x67'),_0x27b005[_0xc312('0x53')]),_0xc312('0x68'),{'recordId':_0x1205d1['id']});break;case _0xc312('0x69'):emit(util['format'](_0xc312('0x67'),_0x27b005[_0xc312('0x53')]),_0xc312('0x6a'),{'uri':util[_0xc312('0x44')](_0xc312('0x6b'),_0x53f36a[_0xc312('0x6c')],_0x1205d1['id'])});break;default:logger['error']('[OUTBOUND]',_0xc312('0x7a'));}})[_0xc312('0x6f')](function(_0x15e679){logger[_0xc312('0x6d')](_0xc312('0x7b'),_0x15e679);});};exports['unmanaged']=function(_0x13edb1,_0x3ed1ed,_0x40916c,_0x5b365b,_0x4bff6d,_0x32116b){var _0xc1e71b,_0x45787f,_0x12a3e1,_0x4b736c;_0x32116b[_0xc312('0x5d')]=intUtil['stripTrailingSlash'](_0x32116b[_0xc312('0x5d')]);_0x32116b[_0xc312('0x57')]=intUtil[_0xc312('0x71')](_0x32116b[_0xc312('0x57')]);if(_0x4bff6d&&_0x4bff6d[_0xc312('0x7c')]){logger[_0xc312('0x21')]('['+_0x3ed1ed['lastevent']['toUpperCase']()+']',_0xc312('0x5f'));_0x3ed1ed[_0xc312('0x61')]=util[_0xc312('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x32116b[_0xc312('0x5d')],_0x3ed1ed['uniqueid'],md5(_0x3ed1ed[_0xc312('0x60')]));}else{_0x3ed1ed['recordingURL']='';}return getConnection(_0x32116b)['then'](function(_0x4544f6){_0x4b736c=_0x4544f6;if(!_[_0xc312('0x25')](_0x5b365b)){return getUser(_0x32116b,_0x5b365b[_0xc312('0x53')],_0x4b736c);}else{return getUser(_0x32116b,null,_0x4b736c);}})[_0xc312('0x27')](function(_0x1a1534){_0xc1e71b=_0x1a1534;return getEndUser(_0x32116b,_0x40916c,_0x3ed1ed[_0xc312('0x62')],_0x3ed1ed[_0xc312('0x7d')],_0x4b736c);})['then'](function(_0x342ea7){_0x45787f=_0x342ea7;return getTicket(_0x32116b,_0xc1e71b,_0x45787f,_0x40916c,_0x3ed1ed,_0x40916c[_0xc312('0x63')],_0x4b736c);})[_0xc312('0x27')](function(_0x16ea8f){_0x12a3e1=_0x16ea8f;logger[_0xc312('0x21')]('['+_0x3ed1ed['lastevent'][_0xc312('0x7e')]()+']\x20Ticket\x20%s\x20created.',_0x12a3e1['id']);logger[_0xc312('0x21')]('['+_0x3ed1ed[_0xc312('0x7f')][_0xc312('0x7e')]()+_0xc312('0x80'),_0x32116b['type']);})[_0xc312('0x6f')](function(_0xc86ec0){logger[_0xc312('0x6d')]('['+_0x3ed1ed[_0xc312('0x7f')]['toUpperCase']()+']',_0xc86ec0);});};
\ No newline at end of file
index edc80cd..8f1aaa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4806=['outbound','incident','assign','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','POST','label','?sysparm_query=name%3D','label_entry','Incident','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','includes','type','nameField','customField','content','toString','string','picklist','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x4806,0x180));var _0x6480=function(_0x510fa6,_0x3d2e50){_0x510fa6=_0x510fa6-0x0;var _0x32d179=_0x4806[_0x510fa6];return _0x32d179;};'use strict';var _=require('lodash');var Promise=require(_0x6480('0x0'));var rp=require(_0x6480('0x1'));var util=require(_0x6480('0x2'));var md5=require(_0x6480('0x3'));var Redis=require('ioredis');var intUtil=require(_0x6480('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6480('0x5'))('servicenow');config[_0x6480('0x6')]=_[_0x6480('0x7')](config[_0x6480('0x6')],{'host':_0x6480('0x8'),'port':0x18eb});var io=require(_0x6480('0x9'))(new Redis(config[_0x6480('0x6')]));function getAdminUser(_0x18c56b,_0x2fb548,_0xe7fdb0,_0xf341ef,_0x3f135f,_0x42d950){return new Promise(function(_0xe4b510,_0xc16685){var _0x4984aa={'method':_0x6480('0xa'),'uri':_0xf341ef+_0x6480('0xb')+'&'+_0x3f135f+'&'+_0x42d950,'auth':_0x2fb548,'json':!![]};return rp(_0x4984aa)[_0x6480('0xc')](function(_0x3abefa){if(_0x3abefa[_0x6480('0xd')]['length']>0x0){_0xe7fdb0['adminId']=_0x3abefa['result'][0x0][_0x6480('0xe')];}logger[_0x6480('0xf')]('['+[_0x18c56b[_0x6480('0x10')]()]+_0x6480('0x11'),_0xe7fdb0);_0xe4b510(_0xe7fdb0);})[_0x6480('0x12')](function(_0x49fba6){logger[_0x6480('0x13')]('['+[_0x18c56b['toUpperCase']()]+']',_0x49fba6[_0x6480('0x14')]);_0xc16685(_0x49fba6[_0x6480('0x14')]);});});}function getUser(_0xffd884,_0x1c20bb,_0x82cbed,_0x240dbd,_0x95d6de){return function(_0x20feb6){logger[_0x6480('0xf')]('['+[_0xffd884[_0x6480('0x10')]()]+_0x6480('0x15'),_0x20feb6);return new Promise(function(_0xc7ac52,_0x6e6495){if(intUtil['validateEmail'](_0x20feb6[_0x6480('0x16')])){var _0x4057ca={'method':'GET','uri':_0x82cbed+_0x6480('0x17')+_0x20feb6['userEmail']+'&'+_0x240dbd+'&'+_0x95d6de,'auth':_0x1c20bb,'json':!![]};logger['info']('['+[_0xffd884[_0x6480('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x4057ca);return rp(_0x4057ca)['then'](function(_0x463c1b){logger[_0x6480('0xf')]('['+[_0xffd884[_0x6480('0x10')]()]+_0x6480('0x18'),_0x463c1b);if(_0x463c1b['result']['length']>0x0&&String(_0x463c1b[_0x6480('0xd')][0x0][_0x6480('0x19')])===_0x6480('0x1a')){_0x20feb6[_0x6480('0x1b')]=_0x463c1b[_0x6480('0xd')][0x0][_0x6480('0xe')];}else{_0x20feb6['userId']=_0x20feb6[_0x6480('0x1c')];_0x20feb6['userEmail']=_0x20feb6[_0x6480('0x1d')];}logger[_0x6480('0xf')]('['+[_0xffd884['toUpperCase']()]+_0x6480('0x1e'),_0x20feb6);_0xc7ac52(_0x20feb6);})['catch'](function(_0x53b456){logger[_0x6480('0x13')]('['+[_0xffd884['toUpperCase']()]+']',_0x53b456[_0x6480('0x14')]);_0x6e6495(_0x53b456[_0x6480('0x14')]);});}else{logger[_0x6480('0xf')]('['+[_0xffd884['toUpperCase']()]+_0x6480('0x1f'));_0x20feb6[_0x6480('0x1b')]=_0x20feb6['adminId'];_0x20feb6[_0x6480('0x16')]=_0x20feb6[_0x6480('0x1d')];_0xc7ac52(_0x20feb6);}});};}function createEndUser(_0x271da9,_0x18b798,_0x19e19e,_0x450574,_0x26592b){logger['info']('['+[_0x271da9[_0x6480('0x10')]()]+_0x6480('0x20'),_0x19e19e);return new Promise(function(_0x477cad,_0x5739f0){var _0x5a7183={'method':'POST','uri':_0x450574+_0x6480('0x21')+_0x26592b,'body':{'user_name':_0x19e19e[_0x6480('0x22')],'roles':_0x6480('0x23'),'first_name':_0x19e19e[_0x6480('0x22')],'active':'true','date_format':_0x6480('0x24'),'phone':_0x19e19e[_0x6480('0x22')]},'auth':_0x18b798,'json':!![]};return rp(_0x5a7183)[_0x6480('0xc')](function(_0x1e6978){logger[_0x6480('0xf')]('['+[_0x271da9[_0x6480('0x10')]()]+_0x6480('0x25'),_0x1e6978['result']);_0x19e19e['endUserId']=_0x1e6978[_0x6480('0xd')][_0x6480('0xe')];_0x477cad(_0x19e19e);})[_0x6480('0x12')](function(_0x1483b6){logger[_0x6480('0x13')]('['+[_0x271da9[_0x6480('0x10')]()]+']',_0x1483b6[_0x6480('0x14')]);_0x5739f0(_0x1483b6[_0x6480('0x14')]);});});}function getEndUser(_0x3fdc39,_0x5c9f3c,_0x4e73c1,_0x17c6a1,_0x16f0e0){return function(_0xe866ac){logger[_0x6480('0xf')]('['+[_0x3fdc39[_0x6480('0x10')]()]+_0x6480('0x26'),_0xe866ac);return new Promise(function(_0x531e87,_0x345a09){var _0xc14881={'method':_0x6480('0xa'),'uri':_0x4e73c1+_0x6480('0x27')+_0xe866ac[_0x6480('0x22')]+'&'+_0x17c6a1+'&'+_0x16f0e0,'auth':_0x5c9f3c,'json':!![]};return rp(_0xc14881)['then'](function(_0x46597c){if(_0x46597c[_0x6480('0xd')]['length']>0x0){_0xe866ac['endUserId']=_0x46597c[_0x6480('0xd')][0x0][_0x6480('0xe')];logger['info']('['+[_0x3fdc39['toUpperCase']()]+_0x6480('0x28'),_0xe866ac);_0x531e87(_0xe866ac);}else{return createEndUser(_0x3fdc39,_0x5c9f3c,_0xe866ac,_0x4e73c1,_0x17c6a1)[_0x6480('0xc')](function(_0x4363d){logger['info']('['+[_0x3fdc39[_0x6480('0x10')]()]+_0x6480('0x29'),_0x4363d);_0x531e87(_0x4363d);});}})[_0x6480('0x12')](function(_0x569712){logger[_0x6480('0x13')]('['+[_0x3fdc39['toUpperCase']()]+']',_0x569712[_0x6480('0x14')]);_0x345a09(_0x569712[_0x6480('0x14')]);});});};}function getCustomFields(_0x413d1a,_0x3a6400){var _0x36e771={};if(_0x413d1a[_0x6480('0x2a')]>0x0){_[_0x6480('0x2b')](_0x413d1a,function(_0x43a1e9){if(_[_0x6480('0x2c')](['string','picklist'],_0x43a1e9[_0x6480('0x2d')])&&_0x43a1e9[_0x6480('0x2e')]&&!_0x43a1e9[_0x6480('0x2f')]){_0x36e771[_0x43a1e9[_0x6480('0x2e')]['toLowerCase']()]=_0x43a1e9[_0x6480('0x30')][_0x6480('0x31')]();}else if(_[_0x6480('0x2c')]([_0x6480('0x32'),_0x6480('0x33')],_0x43a1e9['type'])&&_0x43a1e9['idField']&&_0x43a1e9['customField']){_0x36e771[_0x43a1e9[_0x6480('0x34')][_0x6480('0x35')]()]=_0x43a1e9['content'][_0x6480('0x31')]();}else if(_0x43a1e9['type']===_0x6480('0x36')&&_0x43a1e9[_0x6480('0x37')]&&_0x43a1e9[_0x6480('0x34')]&&_0x43a1e9[_0x6480('0x2f')]){_0x36e771[_0x43a1e9['idField'][_0x6480('0x35')]()]=_0x3a6400[_0x43a1e9['variableName']]['toString']();}else if(_0x43a1e9[_0x6480('0x2d')]===_0x6480('0x38')&&_0x43a1e9[_0x6480('0x39')]&&_0x43a1e9[_0x6480('0x39')][_0x6480('0x3a')]&&_0x43a1e9[_0x6480('0x34')]&&_0x43a1e9['customField']){_0x36e771[_0x43a1e9[_0x6480('0x34')][_0x6480('0x35')]()]=_0x3a6400[_0x43a1e9['Variable'][_0x6480('0x3a')][_0x6480('0x35')]()][_0x6480('0x31')]();}});}return _0x36e771;}function getTicket(_0x289576,_0x30cd9a,_0x3cfc00,_0x1cad11,_0x56e427,_0x1b8a3e){return function(_0x4bd8c3){logger[_0x6480('0xf')]('['+[_0x289576[_0x6480('0x10')]()]+_0x6480('0x3b'),_0x4bd8c3);return new Promise(function(_0x28e988,_0x4c32c0){var _0x389834=_0x289576['toLowerCase']()===_0x6480('0x3c')?_0x4bd8c3['userId']:_0x4bd8c3['endUserId'];var _0x15dd15={'method':'POST','uri':_0x3cfc00+_0x6480('0x3d')+'?'+_0x1b8a3e,'body':Object[_0x6480('0x3e')]({},{'active':'true','caller_id':_0x389834,'assigned_to':_0x4bd8c3['userId'],'short_description':intUtil[_0x6480('0x3f')](_0x1cad11['Subjects'],_0x56e427,'\x20'),'description':intUtil[_0x6480('0x3f')](_0x1cad11['Descriptions'],_0x56e427,'\x0a')},getCustomFields(_0x1cad11[_0x6480('0x40')],_0x56e427)),'auth':_0x30cd9a,'json':!![]};return rp(_0x15dd15)[_0x6480('0xc')](function(_0x1e4985){logger[_0x6480('0xf')]('['+[_0x289576[_0x6480('0x10')]()]+_0x6480('0x41'),_0x1e4985[_0x6480('0xd')]);_0x4bd8c3[_0x6480('0x42')]=_0x1e4985['result'][_0x6480('0xe')];_0x4bd8c3[_0x6480('0x43')]=_0x1e4985[_0x6480('0xd')][_0x6480('0x44')];logger['info']('['+[_0x289576[_0x6480('0x10')]()]+']\x20getTicket\x20crm',_0x4bd8c3);_0x28e988(_0x4bd8c3);})['catch'](function(_0x1d9e2f){logger[_0x6480('0x13')]('['+[_0x289576[_0x6480('0x10')]()]+']',_0x1d9e2f[_0x6480('0x14')]);_0x4c32c0(_0x1d9e2f[_0x6480('0x14')]);});});};}function createRemoteTag(_0x573011,_0x56af6c,_0xf4da23,_0x49dbb0){return new Promise(function(_0x41210c,_0x5b2b96){var _0x144049={'method':_0x6480('0x45'),'uri':_0xf4da23+_0x6480('0x46')+'?'+_0x49dbb0,'body':{'short_description':_0x573011,'global':!![],'active':!![],'name':_0x573011},'auth':_0x56af6c,'json':!![]};return rp(_0x144049)[_0x6480('0xc')](function(_0x2319db){var _0x44adf0=_0x2319db[_0x6480('0xd')][_0x6480('0xe')];_0x41210c(_0x44adf0);});});}function getRemoteTag(_0x2e0790,_0xc157ff,_0x53c8cb,_0x2e07d3,_0x3ca13d){return new Promise(function(_0x3b5329,_0x558cd6){var _0x3a7c00={'method':_0x6480('0xa'),'uri':_0x53c8cb+_0x6480('0x46')+_0x6480('0x47')+_0x2e0790+'&'+_0x2e07d3,'auth':_0xc157ff,'json':!![]};return rp(_0x3a7c00)[_0x6480('0xc')](function(_0xd404e5){if(_0xd404e5[_0x6480('0xd')]['length']>0x0){var _0x2578cf=_0xd404e5[_0x6480('0xd')][0x0][_0x6480('0xe')];_0x3b5329(_0x2578cf);}else{return createRemoteTag(_0x2e0790,_0xc157ff,_0x53c8cb,_0x2e07d3)[_0x6480('0xc')](function(_0x15cfbb){_0x3b5329(_0x15cfbb);});}});});}function assignTagToIncident(_0x172a19,_0xd8f165,_0x5a6e44,_0x5d3463,_0x202253){return new Promise(function(_0x170e92,_0x247c2f){var _0x2883fe={'method':_0x6480('0x45'),'uri':_0x5a6e44+_0x6480('0x48')+'?'+_0x202253,'body':{'label':_0x172a19,'table':_0x6480('0x3d'),'id_type':_0x6480('0x49'),'table_key':_0x5d3463[_0x6480('0x42')],'title':'Incident\x20-\x20'+_0x5d3463[_0x6480('0x43')],'id_display':_0x5d3463[_0x6480('0x43')]},'auth':_0xd8f165,'json':!![]};return rp(_0x2883fe)[_0x6480('0xc')](function(_0x1166ab){_0x170e92();})[_0x6480('0x12')](function(){_0x170e92();});});}function manageTags(_0x4495f1,_0x73d067,_0x4faf47,_0x5e19b5,_0x1fba1b,_0x10270b,_0x2835c6){return new Promise(function(_0x12c524,_0x8125f9){var _0xab38b7=[];_0x73d067[_0x6480('0x2b')](function(_0x1b316d){_0xab38b7[_0x6480('0x4a')](getRemoteTag(_0x1b316d,_0x4faf47,_0x5e19b5,_0x10270b,_0x2835c6));});return Promise['all'](_0xab38b7)['then'](function(_0xb91624){if(_0xb91624[_0x6480('0x2a')]){logger[_0x6480('0xf')]('['+[_0x4495f1[_0x6480('0x10')]()]+_0x6480('0x4b'),_0xb91624);var _0x45dd52=[];_0xb91624[_0x6480('0x2b')](function(_0x5a80cc){_0x45dd52[_0x6480('0x4a')](assignTagToIncident(_0x5a80cc,_0x4faf47,_0x5e19b5,_0x1fba1b,_0x10270b));});return Promise[_0x6480('0x4c')](_0x45dd52)['then'](function(){_0x12c524();})[_0x6480('0x12')](function(){_0x12c524();});}else{_0x12c524();}});});}function getTags(_0x14f446,_0x25ec59,_0x49288e,_0x158e5e,_0x1a4c93,_0x5f2fa3){return function(_0x11d2ab){return new Promise(function(_0x4ed2ba,_0x28a4ea){var _0x1f6373=[];var _0xabf712=_0x158e5e[_0x6480('0x4d')];if(_0xabf712&&_0xabf712['length']>0x0){_0x1f6373=_[_0x6480('0x4e')](_0xabf712,_0x6480('0x3a'));}if(_0x1f6373[_0x6480('0x2a')]>0x0){return manageTags(_0x14f446,_0x1f6373,_0x25ec59,_0x49288e,_0x11d2ab,_0x1a4c93,_0x5f2fa3)['then'](function(){_0x4ed2ba(_0x11d2ab);});}else{_0x4ed2ba(_0x11d2ab);}});};}function emit(_0x3fc127,_0x261691,_0xa4ae1){var _0x26ef62=_0x6480('0x4f')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x6480('0x50')+'%255EORDERBYDESCnumber';var _0x1c2caf={'uri':_0x3fc127+_0x6480('0x51')+_0xa4ae1+_0x26ef62};io['to'](util[_0x6480('0x52')]('user:%s',_0x261691))[_0x6480('0x53')](_0x6480('0x54'),_0x1c2caf);}exports['cs']=function(_0x46d3ce,_0x488daf,_0x14ea90,_0x211fa0,_0x310325,_0x47d418,_0x2405c7,_0x364ee4){var _0x4850ef={};var _0x858928={'user':_0x47d418[_0x6480('0x55')],'pass':_0x47d418[_0x6480('0x56')]};var _0x16e729=_0x6480('0x57');var _0x215872=_0x6480('0x58');_0x47d418['remoteUri']=intUtil[_0x6480('0x59')](_0x47d418[_0x6480('0x5a')]);_0x47d418[_0x6480('0x5b')]=intUtil['stripTrailingSlash'](_0x47d418[_0x6480('0x5b')]);var _0x171462=util[_0x6480('0x52')]('%s/api/now/table/',_0x47d418[_0x6480('0x5a')]);_0x4850ef[_0x6480('0x16')]=!_[_0x6480('0x5c')](_0x211fa0)?_0x211fa0[_0x6480('0x5d')]:null;_0x4850ef[_0x6480('0x1d')]=_0x47d418[_0x6480('0x5d')];_0x4850ef[_0x6480('0x22')]=_0x364ee4[_0x6480('0x35')]()==='outbound'?_0x488daf[_0x6480('0x5e')]:_0x488daf[_0x6480('0x5f')];_0x4850ef[_0x6480('0x60')]=_0x364ee4===_0x6480('0x61')||_0x364ee4===_0x6480('0x62')?'queue':_0x6480('0x3c');var _0x106030=util[_0x6480('0x52')](_0x6480('0x63'),_0x47d418['serverUrl'],_0x488daf['uniqueid'],md5(_0x488daf[_0x6480('0x64')]));if(_0x310325&&_0x310325[_0x6480('0x65')]){logger[_0x6480('0xf')](_0x6480('0x66'),_0x6480('0x67'));_0x488daf[_0x6480('0x68')]=_0x106030;}else if(_0x2405c7&&_0x2405c7[_0x6480('0x69')]&&_0x2405c7[_0x6480('0x69')]!==_0x6480('0x6a')){logger[_0x6480('0xf')]('[OUTBOUND]',_0x6480('0x67'));_0x488daf[_0x6480('0x68')]=_0x106030;}else{_0x488daf[_0x6480('0x68')]='';}return getAdminUser(_0x364ee4,_0x858928,_0x4850ef,_0x171462,_0x215872,_0x16e729)['then'](getUser(_0x364ee4,_0x858928,_0x171462,_0x215872,_0x16e729))[_0x6480('0xc')](getEndUser(_0x364ee4,_0x858928,_0x171462,_0x215872,_0x16e729))[_0x6480('0xc')](getTicket(_0x364ee4,_0x858928,_0x171462,_0x14ea90,_0x488daf,_0x215872))[_0x6480('0xc')](function(_0x2ec62f){logger[_0x6480('0xf')](util[_0x6480('0x52')](_0x6480('0x6b'),_0x2ec62f[_0x6480('0x42')]));logger[_0x6480('0xf')](util[_0x6480('0x52')](_0x6480('0x6c'),_0x364ee4));if(_0x364ee4!=='unmanaged'){logger[_0x6480('0xf')]('['+[_0x364ee4[_0x6480('0x10')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x47d418['remoteUri'],_0x211fa0[_0x6480('0x3a')],_0x2ec62f[_0x6480('0x42')]);}})['catch'](function(_0x420bb7){logger[_0x6480('0x13')]('['+[_0x364ee4[_0x6480('0x10')]()]+_0x6480('0x6d'),util[_0x6480('0x6e')](_0x420bb7,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xecfd=['bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','message','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','error','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','toLowerCase','toString','type','idField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','label_entry','Incident','ticketNumber','push','all','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','unmanaged',']\x20Error\x20running\x20ServiceNow\x20integration','lodash'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xecfd,0x6c));var _0xdecf=function(_0x5ac30d,_0x4eb709){_0x5ac30d=_0x5ac30d-0x0;var _0x49a9c0=_0xecfd[_0x5ac30d];return _0x49a9c0;};'use strict';var _=require(_0xdecf('0x0'));var Promise=require(_0xdecf('0x1'));var rp=require(_0xdecf('0x2'));var util=require(_0xdecf('0x3'));var md5=require(_0xdecf('0x4'));var Redis=require(_0xdecf('0x5'));var intUtil=require(_0xdecf('0x6'));var config=require(_0xdecf('0x7'));var logger=require(_0xdecf('0x8'))('servicenow');config[_0xdecf('0x9')]=_[_0xdecf('0xa')](config[_0xdecf('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xdecf('0xb'))(new Redis(config['redis']));function getAdminUser(_0xfbf802,_0x59c374,_0x10c5fc,_0x3f42e8,_0x57ced7,_0x27e388){return new Promise(function(_0x923ba4,_0xfe191c){var _0x173ca5={'method':_0xdecf('0xc'),'uri':_0x3f42e8+_0xdecf('0xd')+'&'+_0x57ced7+'&'+_0x27e388,'auth':_0x59c374,'json':!![]};return rp(_0x173ca5)[_0xdecf('0xe')](function(_0x3bda55){if(_0x3bda55[_0xdecf('0xf')][_0xdecf('0x10')]>0x0){_0x10c5fc[_0xdecf('0x11')]=_0x3bda55[_0xdecf('0xf')][0x0][_0xdecf('0x12')];}logger[_0xdecf('0x13')]('['+[_0xfbf802['toUpperCase']()]+_0xdecf('0x14'),_0x10c5fc);_0x923ba4(_0x10c5fc);})[_0xdecf('0x15')](function(_0x383f3d){logger['error']('['+[_0xfbf802['toUpperCase']()]+']',_0x383f3d[_0xdecf('0x16')]);_0xfe191c(_0x383f3d['message']);});});}function getUser(_0x5d39d3,_0x1ea728,_0x39e55b,_0x552a77,_0xff4643){return function(_0x541549){logger[_0xdecf('0x13')]('['+[_0x5d39d3[_0xdecf('0x17')]()]+_0xdecf('0x18'),_0x541549);return new Promise(function(_0x10d0cd,_0x28ea4c){if(intUtil[_0xdecf('0x19')](_0x541549[_0xdecf('0x1a')])){var _0x4815b7={'method':'GET','uri':_0x39e55b+_0xdecf('0x1b')+_0x541549[_0xdecf('0x1a')]+'&'+_0x552a77+'&'+_0xff4643,'auth':_0x1ea728,'json':!![]};logger[_0xdecf('0x13')]('['+[_0x5d39d3[_0xdecf('0x17')]()]+'],\x20getUser\x20rp\x20obj',_0x4815b7);return rp(_0x4815b7)['then'](function(_0x211e48){logger[_0xdecf('0x13')]('['+[_0x5d39d3['toUpperCase']()]+_0xdecf('0x1c'),_0x211e48);if(_0x211e48['result']['length']>0x0&&String(_0x211e48[_0xdecf('0xf')][0x0][_0xdecf('0x1d')])===_0xdecf('0x1e')){_0x541549[_0xdecf('0x1f')]=_0x211e48[_0xdecf('0xf')][0x0]['sys_id'];}else{_0x541549[_0xdecf('0x1f')]=_0x541549[_0xdecf('0x11')];_0x541549[_0xdecf('0x1a')]=_0x541549[_0xdecf('0x20')];}logger['info']('['+[_0x5d39d3[_0xdecf('0x17')]()]+_0xdecf('0x21'),_0x541549);_0x10d0cd(_0x541549);})[_0xdecf('0x15')](function(_0x5e4ec0){logger['error']('['+[_0x5d39d3[_0xdecf('0x17')]()]+']',_0x5e4ec0['message']);_0x28ea4c(_0x5e4ec0[_0xdecf('0x16')]);});}else{logger[_0xdecf('0x13')]('['+[_0x5d39d3[_0xdecf('0x17')]()]+_0xdecf('0x22'));_0x541549[_0xdecf('0x1f')]=_0x541549[_0xdecf('0x11')];_0x541549['userEmail']=_0x541549[_0xdecf('0x20')];_0x10d0cd(_0x541549);}});};}function createEndUser(_0x12b6aa,_0x36de7b,_0x25ea3f,_0x557a86,_0x33a83c){logger['info']('['+[_0x12b6aa[_0xdecf('0x17')]()]+'],\x20createEndUser\x20input\x20crm',_0x25ea3f);return new Promise(function(_0x24572f,_0x229575){var _0xfa7f19={'method':_0xdecf('0x23'),'uri':_0x557a86+_0xdecf('0x24')+_0x33a83c,'body':{'user_name':_0x25ea3f[_0xdecf('0x25')],'roles':_0xdecf('0x26'),'first_name':_0x25ea3f[_0xdecf('0x25')],'active':_0xdecf('0x1e'),'date_format':'System','phone':_0x25ea3f[_0xdecf('0x25')]},'auth':_0x36de7b,'json':!![]};return rp(_0xfa7f19)['then'](function(_0x4591ff){logger['info']('['+[_0x12b6aa[_0xdecf('0x17')]()]+_0xdecf('0x27'),_0x4591ff[_0xdecf('0xf')]);_0x25ea3f[_0xdecf('0x28')]=_0x4591ff[_0xdecf('0xf')][_0xdecf('0x12')];_0x24572f(_0x25ea3f);})[_0xdecf('0x15')](function(_0x3d3552){logger[_0xdecf('0x29')]('['+[_0x12b6aa['toUpperCase']()]+']',_0x3d3552[_0xdecf('0x16')]);_0x229575(_0x3d3552['message']);});});}function getEndUser(_0x44371f,_0x57cee0,_0x20efd6,_0xcf47cc,_0x4d21c1){return function(_0x98b805){logger[_0xdecf('0x13')]('['+[_0x44371f[_0xdecf('0x17')]()]+_0xdecf('0x2a'),_0x98b805);return new Promise(function(_0x1d824e,_0x2bbcba){var _0x44a6a7={'method':_0xdecf('0xc'),'uri':_0x20efd6+_0xdecf('0x2b')+_0x98b805[_0xdecf('0x25')]+'&'+_0xcf47cc+'&'+_0x4d21c1,'auth':_0x57cee0,'json':!![]};return rp(_0x44a6a7)[_0xdecf('0xe')](function(_0x18d5ee){if(_0x18d5ee[_0xdecf('0xf')][_0xdecf('0x10')]>0x0){_0x98b805[_0xdecf('0x28')]=_0x18d5ee['result'][0x0][_0xdecf('0x12')];logger[_0xdecf('0x13')]('['+[_0x44371f[_0xdecf('0x17')]()]+_0xdecf('0x2c'),_0x98b805);_0x1d824e(_0x98b805);}else{return createEndUser(_0x44371f,_0x57cee0,_0x98b805,_0x20efd6,_0xcf47cc)[_0xdecf('0xe')](function(_0x5ed3e3){logger['info']('['+[_0x44371f['toUpperCase']()]+_0xdecf('0x2d'),_0x5ed3e3);_0x1d824e(_0x5ed3e3);});}})['catch'](function(_0x1f5c2f){logger[_0xdecf('0x29')]('['+[_0x44371f[_0xdecf('0x17')]()]+']',_0x1f5c2f[_0xdecf('0x16')]);_0x2bbcba(_0x1f5c2f[_0xdecf('0x16')]);});});};}function getCustomFields(_0x4ab400,_0x4953af){var _0x3c598b={};if(_0x4ab400[_0xdecf('0x10')]>0x0){_[_0xdecf('0x2e')](_0x4ab400,function(_0x3015cc){if(_[_0xdecf('0x2f')]([_0xdecf('0x30'),_0xdecf('0x31')],_0x3015cc['type'])&&_0x3015cc[_0xdecf('0x32')]&&!_0x3015cc[_0xdecf('0x33')]){_0x3c598b[_0x3015cc[_0xdecf('0x32')][_0xdecf('0x34')]()]=_0x3015cc['content'][_0xdecf('0x35')]();}else if(_[_0xdecf('0x2f')]([_0xdecf('0x30'),_0xdecf('0x31')],_0x3015cc[_0xdecf('0x36')])&&_0x3015cc[_0xdecf('0x37')]&&_0x3015cc['customField']){_0x3c598b[_0x3015cc['idField'][_0xdecf('0x34')]()]=_0x3015cc[_0xdecf('0x38')]['toString']();}else if(_0x3015cc[_0xdecf('0x36')]===_0xdecf('0x39')&&_0x3015cc[_0xdecf('0x3a')]&&_0x3015cc[_0xdecf('0x37')]&&_0x3015cc[_0xdecf('0x33')]){_0x3c598b[_0x3015cc['idField'][_0xdecf('0x34')]()]=_0x4953af[_0x3015cc[_0xdecf('0x3a')]][_0xdecf('0x35')]();}else if(_0x3015cc[_0xdecf('0x36')]===_0xdecf('0x3b')&&_0x3015cc[_0xdecf('0x3c')]&&_0x3015cc[_0xdecf('0x3c')][_0xdecf('0x3d')]&&_0x3015cc[_0xdecf('0x37')]&&_0x3015cc[_0xdecf('0x33')]){_0x3c598b[_0x3015cc['idField'][_0xdecf('0x34')]()]=_0x4953af[_0x3015cc[_0xdecf('0x3c')][_0xdecf('0x3d')][_0xdecf('0x34')]()][_0xdecf('0x35')]();}});}return _0x3c598b;}function getTicket(_0x249635,_0x26b035,_0x219380,_0x509fea,_0x1d457f,_0x42add9){return function(_0x2570a3){logger['info']('['+[_0x249635['toUpperCase']()]+_0xdecf('0x3e'),_0x2570a3);return new Promise(function(_0x59942d,_0x10629d){var _0x13ee10=_0x249635['toLowerCase']()===_0xdecf('0x3f')?_0x2570a3['userId']:_0x2570a3[_0xdecf('0x28')];var _0xed4e73={'method':_0xdecf('0x23'),'uri':_0x219380+_0xdecf('0x40')+'?'+_0x42add9,'body':Object['assign']({},{'active':_0xdecf('0x1e'),'caller_id':_0x13ee10,'assigned_to':_0x2570a3[_0xdecf('0x1f')],'short_description':intUtil[_0xdecf('0x41')](_0x509fea[_0xdecf('0x42')],_0x1d457f,'\x20'),'description':intUtil[_0xdecf('0x41')](_0x509fea['Descriptions'],_0x1d457f,'\x0a')},getCustomFields(_0x509fea[_0xdecf('0x43')],_0x1d457f)),'auth':_0x26b035,'json':!![]};return rp(_0xed4e73)[_0xdecf('0xe')](function(_0x39b08a){logger[_0xdecf('0x13')]('['+[_0x249635[_0xdecf('0x17')]()]+_0xdecf('0x44'),_0x39b08a['result']);_0x2570a3['ticketId']=_0x39b08a['result'][_0xdecf('0x12')];_0x2570a3['ticketNumber']=_0x39b08a['result'][_0xdecf('0x45')];logger[_0xdecf('0x13')]('['+[_0x249635[_0xdecf('0x17')]()]+_0xdecf('0x46'),_0x2570a3);_0x59942d(_0x2570a3);})['catch'](function(_0x2b9ca4){logger[_0xdecf('0x29')]('['+[_0x249635[_0xdecf('0x17')]()]+']',_0x2b9ca4[_0xdecf('0x16')]);_0x10629d(_0x2b9ca4[_0xdecf('0x16')]);});});};}function createRemoteTag(_0xbc006c,_0x202bd7,_0x242ebc,_0x30b3b1){return new Promise(function(_0x1d7707,_0x335485){var _0x4e6eed={'method':_0xdecf('0x23'),'uri':_0x242ebc+_0xdecf('0x47')+'?'+_0x30b3b1,'body':{'short_description':_0xbc006c,'global':!![],'active':!![],'name':_0xbc006c},'auth':_0x202bd7,'json':!![]};return rp(_0x4e6eed)[_0xdecf('0xe')](function(_0x4cf23f){var _0x332eb8=_0x4cf23f[_0xdecf('0xf')][_0xdecf('0x12')];_0x1d7707(_0x332eb8);});});}function getRemoteTag(_0x5b82c8,_0x1abb90,_0x43cacd,_0x35c15e,_0x172f19){return new Promise(function(_0x2595e0,_0x57d039){var _0x49ed47={'method':_0xdecf('0xc'),'uri':_0x43cacd+_0xdecf('0x47')+'?sysparm_query=name%3D'+_0x5b82c8+'&'+_0x35c15e,'auth':_0x1abb90,'json':!![]};return rp(_0x49ed47)['then'](function(_0x42c818){if(_0x42c818[_0xdecf('0xf')][_0xdecf('0x10')]>0x0){var _0x29d0b1=_0x42c818[_0xdecf('0xf')][0x0]['sys_id'];_0x2595e0(_0x29d0b1);}else{return createRemoteTag(_0x5b82c8,_0x1abb90,_0x43cacd,_0x35c15e)[_0xdecf('0xe')](function(_0x1cefc7){_0x2595e0(_0x1cefc7);});}});});}function assignTagToIncident(_0x591315,_0x400e34,_0x4a338a,_0x5532b4,_0x586562){return new Promise(function(_0x158b06,_0xf33154){var _0x2d68ce={'method':'POST','uri':_0x4a338a+_0xdecf('0x48')+'?'+_0x586562,'body':{'label':_0x591315,'table':_0xdecf('0x40'),'id_type':_0xdecf('0x49'),'table_key':_0x5532b4['ticketId'],'title':'Incident\x20-\x20'+_0x5532b4[_0xdecf('0x4a')],'id_display':_0x5532b4[_0xdecf('0x4a')]},'auth':_0x400e34,'json':!![]};return rp(_0x2d68ce)['then'](function(_0xce9e2e){_0x158b06();})[_0xdecf('0x15')](function(){_0x158b06();});});}function manageTags(_0x43b3c9,_0x7c2593,_0x3b06c9,_0x456d0b,_0x33c555,_0x388cc5,_0x1b560e){return new Promise(function(_0x433436,_0x3f8c34){var _0xa42bed=[];_0x7c2593[_0xdecf('0x2e')](function(_0x287b1e){_0xa42bed[_0xdecf('0x4b')](getRemoteTag(_0x287b1e,_0x3b06c9,_0x456d0b,_0x388cc5,_0x1b560e));});return Promise[_0xdecf('0x4c')](_0xa42bed)[_0xdecf('0xe')](function(_0x5b772c){if(_0x5b772c[_0xdecf('0x10')]){logger['info']('['+[_0x43b3c9[_0xdecf('0x17')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5b772c);var _0x299dcf=[];_0x5b772c['forEach'](function(_0x535c6b){_0x299dcf[_0xdecf('0x4b')](assignTagToIncident(_0x535c6b,_0x3b06c9,_0x456d0b,_0x33c555,_0x388cc5));});return Promise[_0xdecf('0x4c')](_0x299dcf)['then'](function(){_0x433436();})['catch'](function(){_0x433436();});}else{_0x433436();}});});}function getTags(_0xa5398e,_0x5358e5,_0x13ba3a,_0x5c7dff,_0x529274,_0x1cd315){return function(_0x51f1ce){return new Promise(function(_0x4f1e40,_0x2ab89e){var _0x237b79=[];var _0x47ed68=_0x5c7dff['Tags'];if(_0x47ed68&&_0x47ed68[_0xdecf('0x10')]>0x0){_0x237b79=_[_0xdecf('0x4d')](_0x47ed68,_0xdecf('0x3d'));}if(_0x237b79[_0xdecf('0x10')]>0x0){return manageTags(_0xa5398e,_0x237b79,_0x5358e5,_0x13ba3a,_0x51f1ce,_0x529274,_0x1cd315)[_0xdecf('0xe')](function(){_0x4f1e40(_0x51f1ce);});}else{_0x4f1e40(_0x51f1ce);}});};}function emit(_0x544a05,_0x2c32ab,_0x4d76a2){var _0x17b67a='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xdecf('0x4e')+_0xdecf('0x4f');var _0x26685b={'uri':_0x544a05+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x4d76a2+_0x17b67a};io['to'](util[_0xdecf('0x50')](_0xdecf('0x51'),_0x2c32ab))[_0xdecf('0x52')](_0xdecf('0x53'),_0x26685b);}exports['cs']=function(_0x5ca535,_0x5bcc98,_0x3b7b4c,_0x59e5a5,_0xc7a216,_0x29aa75,_0x4ebb7e,_0x257a83){var _0x45aa08={};var _0x5c7e82={'user':_0x29aa75[_0xdecf('0x54')],'pass':_0x29aa75[_0xdecf('0x55')]};var _0x46d56d='sysparm_limit=1';var _0x34ca8b=_0xdecf('0x56');_0x29aa75[_0xdecf('0x57')]=intUtil[_0xdecf('0x58')](_0x29aa75[_0xdecf('0x57')]);_0x29aa75[_0xdecf('0x59')]=intUtil[_0xdecf('0x58')](_0x29aa75[_0xdecf('0x59')]);var _0x13be7b=util['format'](_0xdecf('0x5a'),_0x29aa75['remoteUri']);_0x45aa08['userEmail']=!_['isNil'](_0x59e5a5)?_0x59e5a5[_0xdecf('0x5b')]:null;_0x45aa08[_0xdecf('0x20')]=_0x29aa75[_0xdecf('0x5b')];_0x45aa08[_0xdecf('0x25')]=_0x257a83[_0xdecf('0x34')]()===_0xdecf('0x3f')?_0x5bcc98[_0xdecf('0x5c')]:_0x5bcc98[_0xdecf('0x5d')];_0x45aa08[_0xdecf('0x5e')]=_0x257a83===_0xdecf('0x5f')||_0x257a83==='unmanaged'?_0xdecf('0x5f'):_0xdecf('0x3f');var _0x23f54c=util['format'](_0xdecf('0x60'),_0x29aa75[_0xdecf('0x59')],_0x5bcc98[_0xdecf('0x61')],md5(_0x5bcc98[_0xdecf('0x61')]));if(_0xc7a216&&_0xc7a216[_0xdecf('0x62')]){logger['info'](_0xdecf('0x63'),_0xdecf('0x64'));_0x5bcc98[_0xdecf('0x65')]=_0x23f54c;}else if(_0x4ebb7e&&_0x4ebb7e['recordingFormat']&&_0x4ebb7e['recordingFormat']!==_0xdecf('0x66')){logger[_0xdecf('0x13')](_0xdecf('0x67'),'Recording\x20is\x20enabled!');_0x5bcc98[_0xdecf('0x65')]=_0x23f54c;}else{_0x5bcc98[_0xdecf('0x65')]='';}return getAdminUser(_0x257a83,_0x5c7e82,_0x45aa08,_0x13be7b,_0x34ca8b,_0x46d56d)[_0xdecf('0xe')](getUser(_0x257a83,_0x5c7e82,_0x13be7b,_0x34ca8b,_0x46d56d))['then'](getEndUser(_0x257a83,_0x5c7e82,_0x13be7b,_0x34ca8b,_0x46d56d))[_0xdecf('0xe')](getTicket(_0x257a83,_0x5c7e82,_0x13be7b,_0x3b7b4c,_0x5bcc98,_0x34ca8b))[_0xdecf('0xe')](function(_0x439369){logger['info'](util[_0xdecf('0x50')](_0xdecf('0x68'),_0x439369[_0xdecf('0x69')]));logger[_0xdecf('0x13')](util['format'](_0xdecf('0x6a'),_0x257a83));if(_0x257a83!==_0xdecf('0x6b')){logger[_0xdecf('0x13')]('['+[_0x257a83[_0xdecf('0x17')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x29aa75[_0xdecf('0x57')],_0x59e5a5[_0xdecf('0x3d')],_0x439369[_0xdecf('0x69')]);}})[_0xdecf('0x15')](function(_0x3df584){logger[_0xdecf('0x29')]('['+[_0x257a83[_0xdecf('0x17')]()]+_0xdecf('0x6c'),util['inspect'](_0x3df584,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index be25bae..37ae5d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ca5=['<unknown>','Enduser\x20created.','merge','map','type','string','nameField','customField','toLowerCase','idField','push','content','custom_fields','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','queue','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','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','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','Outbound','Ticket\x20created!','users','unmanaged','lastevent','toUpperCase','isNil','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','forEach','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','Employees','user_name','then','entry_list','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x8ca5,0x128));var _0x58ca=function(_0x468557,_0x4db7ac){_0x468557=_0x468557-0x0;var _0x5b7ccd=_0x8ca5[_0x468557];return _0x5b7ccd;};'use strict';var _=require(_0x58ca('0x0'));var rp=require(_0x58ca('0x1'));var BPromise=require(_0x58ca('0x2'));var md5=require('md5');var util=require(_0x58ca('0x3'));var Redis=require(_0x58ca('0x4'));var intUtil=require(_0x58ca('0x5'));var config=require(_0x58ca('0x6'));var logger=require(_0x58ca('0x7'))(_0x58ca('0x8'));config[_0x58ca('0x9')]=_[_0x58ca('0xa')](config[_0x58ca('0x9')],{'host':_0x58ca('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x58ca('0x9')]));var def={'method':_0x58ca('0xc'),'json':!![]};function emit(_0x5dd048,_0x386d6f,_0x2ea6d0){io['to'](_0x5dd048)[_0x58ca('0xd')](_0x386d6f,_0x2ea6d0);}function getTicket(_0x1ce34b,_0x4aedc3,_0x57f485,_0x4fb278,_0x19b258,_0x477c86,_0x5418f9,_0x5c08bb){logger[_0x58ca('0xe')](_0x58ca('0xf'));var _0xc7c496=new Date();var _0x40e388=[{'name':_0x58ca('0x10'),'value':intUtil[_0x58ca('0x11')](_0x4fb278[_0x58ca('0x12')],_0x19b258,'\x20')},{'name':_0x58ca('0x13'),'value':_0x4aedc3['id']},{'name':_0x58ca('0x14'),'value':_0x4aedc3['id']},{'name':_0x58ca('0x15'),'value':intUtil[_0x58ca('0x11')](_0x4fb278[_0x58ca('0x16')],_0x19b258,'\x0a')},{'name':_0x58ca('0x17'),'value':_0xc7c496['toISOString']()[_0x58ca('0x18')](0x0,0x13)[_0x58ca('0x19')]('T','\x20')},{'name':_0x58ca('0x1a'),'value':'0'},{'name':_0x58ca('0x1b'),'value':'15'},{'name':_0x58ca('0x1c'),'value':_0x57f485['id']},{'name':_0x58ca('0x1d'),'value':_0x58ca('0x1e')},{'name':'parent_name','value':_0x57f485[_0x58ca('0x10')]},{'name':_0x58ca('0x1f'),'value':_0x5c08bb}];if(_0x477c86[_0x58ca('0x20')]){_[_0x58ca('0x21')](_0x477c86,function(_0x58af78){if(_0x19b258[_0x58af78[_0x58ca('0x22')]]){_0x40e388['push']({'name':_0x58af78['idField'],'value':_0x19b258[_0x58af78[_0x58ca('0x22')]]});}});}return request({'form':{'method':_0x58ca('0x23'),'input_type':'JSON','response_type':_0x58ca('0x24'),'rest_data':JSON[_0x58ca('0x25')]({'session':_0x5418f9['id'],'module_name':_0x58ca('0x26'),'name_value_list':_0x40e388})}});}function getAuth(_0x5036f8){return util[_0x58ca('0x27')](_0x58ca('0x28'),new Buffer(_0x5036f8[_0x58ca('0x29')]+':X')[_0x58ca('0x2a')](_0x58ca('0x2b')));}function getServerInfo(_0x363f8f){return request({'form':{'method':_0x58ca('0x2c'),'input_type':_0x58ca('0x24'),'response_type':_0x58ca('0x24'),'rest_data':JSON['stringify']({'session':_0x363f8f['id']})}});}function getUser(_0x3a4428,_0x1d03b9,_0x27f130){if(!_['isNil'](_0x1d03b9)){logger[_0x58ca('0xe')](_0x58ca('0x2d'),_0x1d03b9);return request({'form':{'method':'get_entry_list','input_type':_0x58ca('0x24'),'response_type':_0x58ca('0x24'),'rest_data':JSON['stringify']({'session':_0x27f130['id'],'module_name':_0x58ca('0x2e'),'query':util[_0x58ca('0x27')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1d03b9),'order_by':'','offset':'0','select_fields':['id',_0x58ca('0x10'),_0x58ca('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x58ca('0x30')](function(_0x5dc4c3){if(_0x5dc4c3[_0x58ca('0x31')][_0x58ca('0x20')]){var _0x35d863=_['find'](_0x5dc4c3[_0x58ca('0x31')],function(_0x358cc2){return _0x358cc2[_0x58ca('0x32')][_0x58ca('0x2f')][_0x58ca('0x33')]===_0x1d03b9;});if(_0x35d863){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x35d863['name_value_list']['id'][_0x58ca('0x33')],'name':_0x35d863['name_value_list'][_0x58ca('0x10')][_0x58ca('0x33')]});}}logger[_0x58ca('0xe')](_0x58ca('0x34'));return BPromise[_0x58ca('0x35')]({'id':_0x27f130[_0x58ca('0x32')][_0x58ca('0x36')][_0x58ca('0x33')],'name':_0x27f130['name_value_list'][_0x58ca('0x2f')]['value']});});}else{logger['info'](_0x58ca('0x37'));return BPromise[_0x58ca('0x35')]({'id':_0x27f130[_0x58ca('0x32')][_0x58ca('0x36')][_0x58ca('0x33')],'name':_0x27f130[_0x58ca('0x32')][_0x58ca('0x2f')]['value']});}}function getEndUser(_0x3e449b,_0x3cbd42,_0x14415c,_0x2320ad){logger['info'](_0x58ca('0x38'),_0x14415c);return request({'form':{'method':'get_entry_list','input_type':_0x58ca('0x24'),'response_type':_0x58ca('0x24'),'rest_data':JSON[_0x58ca('0x25')]({'session':_0x2320ad['id'],'module_name':_0x58ca('0x1e'),'query':util['format'](_0x58ca('0x39'),_0x14415c),'order_by':'','offset':'0','select_fields':['id','name',_0x58ca('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x58ca('0x30')](function(_0x856ee4){if(_0x856ee4[_0x58ca('0x31')][_0x58ca('0x20')]){var _0x5a4a75=_['find'](_0x856ee4['entry_list'],function(_0x33b1ac){return _0x33b1ac[_0x58ca('0x32')]['phone_home'][_0x58ca('0x33')]===_0x14415c;});if(_0x5a4a75){logger['info'](_0x58ca('0x3b'));return BPromise[_0x58ca('0x35')]({'id':_0x5a4a75[_0x58ca('0x32')]['id']['value'],'name':_0x5a4a75['name_value_list'][_0x58ca('0x10')][_0x58ca('0x33')],'phone':_0x5a4a75['name_value_list']['phone_home'][_0x58ca('0x33')]});}}else{logger[_0x58ca('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x58ca('0x23'),'input_type':'JSON','response_type':_0x58ca('0x24'),'rest_data':JSON['stringify']({'session':_0x2320ad['id'],'module_name':_0x58ca('0x1e'),'name_value_list':[{'name':_0x58ca('0x3c'),'value':_0x3cbd42!==_0x58ca('0x3d')?_0x3cbd42:util[_0x58ca('0x27')]('Caller\x20-\x20%s',_0x14415c)},{'name':'phone_home','value':_0x14415c}]})}})[_0x58ca('0x30')](function(_0x2d1c77){logger[_0x58ca('0xe')](_0x58ca('0x3e'));return BPromise[_0x58ca('0x35')]({'id':_0x2d1c77['id'],'name':_0x2d1c77[_0x58ca('0x31')]['first_name'][_0x58ca('0x33')],'phone':_0x2d1c77['entry_list'][_0x58ca('0x3a')]['value']});});}});}function request(_0x2fe7aa){logger['debug']('[HTTP]',JSON[_0x58ca('0x25')](_0x2fe7aa));return rp(_[_0x58ca('0x3f')](def,_0x2fe7aa));}function getTags(_0x295b99,_0x55f1df){var _0x2839a0=[];if(_0x295b99&&_0x295b99[_0x58ca('0x20')]>0x0){_0x2839a0=_[_0x58ca('0x40')](_0x295b99,_0x55f1df);}return _0x2839a0;}function getCustomFields(_0x5e4277,_0x3f1ab2){var _0x12f367=[];var _0x33b81b={'custom_fields':[]};if(_0x5e4277[_0x58ca('0x20')]>0x0){_[_0x58ca('0x21')](_0x5e4277,function(_0x4a86cb){if(_0x4a86cb[_0x58ca('0x41')]===_0x58ca('0x42')&&_0x4a86cb[_0x58ca('0x43')]&&!_0x4a86cb[_0x58ca('0x44')]){_0x33b81b[_0x4a86cb[_0x58ca('0x43')][_0x58ca('0x45')]()]=_0x4a86cb['content'][_0x58ca('0x2a')]();}else if(_0x4a86cb[_0x58ca('0x41')]===_0x58ca('0x42')&&_0x4a86cb[_0x58ca('0x46')]&&_0x4a86cb[_0x58ca('0x44')]){_0x33b81b['custom_fields'][_0x58ca('0x47')]({'id':_0x4a86cb['idField'],'value':_0x4a86cb[_0x58ca('0x48')][_0x58ca('0x2a')]()});}else if(_0x4a86cb[_0x58ca('0x41')]==='variable'&&_0x4a86cb[_0x58ca('0x22')]&&_0x4a86cb['idField']&&_0x4a86cb[_0x58ca('0x44')]){_0x3f1ab2[_0x4a86cb[_0x58ca('0x22')]]&&_0x33b81b[_0x58ca('0x49')]['push']({'id':_0x4a86cb[_0x58ca('0x46')],'value':_0x3f1ab2[_0x4a86cb[_0x58ca('0x22')]][_0x58ca('0x2a')]()});}else if(_0x4a86cb['type']==='customVariable'&&_0x4a86cb[_0x58ca('0x4a')]&&_0x4a86cb['Variable'][_0x58ca('0x10')]&&_0x4a86cb[_0x58ca('0x46')]&&_0x4a86cb[_0x58ca('0x44')]){_0x3f1ab2[_0x4a86cb[_0x58ca('0x4a')]['name'][_0x58ca('0x45')]()]&&_0x33b81b[_0x58ca('0x49')][_0x58ca('0x47')]({'id':_0x4a86cb['idField'],'value':_0x3f1ab2[_0x4a86cb[_0x58ca('0x4a')][_0x58ca('0x10')][_0x58ca('0x45')]()]['toString']()});}});}return _0x33b81b;}function getConnection(_0x36cfed){return request({'method':_0x58ca('0xc'),'form':{'method':_0x58ca('0x4b'),'input_type':_0x58ca('0x24'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x36cfed['username'],'password':_0x36cfed[_0x58ca('0x4c')],'encryption':_0x58ca('0x4d')},'application':_0x58ca('0x4e')})}})['then'](function(_0x599153){var _0x4c4042=_0x599153;if(_0x4c4042['id']){def['sessionID']=_0x4c4042['id'];return BPromise['resolve'](_0x4c4042);}else{throw new Error(util[_0x58ca('0x27')](_0x58ca('0x4f'),_0x36cfed['id']));}});}function setRelationship(_0x142920,_0x39c5f7,_0x5e0d7a,_0x25c27a){return request({'form':{'method':'set_relationship','input_type':_0x58ca('0x24'),'response_type':_0x58ca('0x24'),'rest_data':JSON['stringify']({'session':_0x142920['id'],'module_name':_0x58ca('0x26'),'module_id':_0x5e0d7a['id'],'link_field_name':_0x25c27a,'related_ids':[_0x39c5f7['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x58ca('0x50')]=function(_0x5e0284,_0x16d409,_0x36d03d,_0x254f62,_0x412756,_0x3b7b2d){var _0x184340,_0x28204f,_0x28543c,_0x221f5c;_0x3b7b2d['remoteUri']=intUtil[_0x58ca('0x51')](_0x3b7b2d['remoteUri']);_0x3b7b2d[_0x58ca('0x52')]=intUtil[_0x58ca('0x51')](_0x3b7b2d['serverUrl']);def[_0x58ca('0x53')]=util[_0x58ca('0x27')](_0x58ca('0x54'),_0x3b7b2d[_0x58ca('0x55')]);if(_0x412756&&_0x412756[_0x58ca('0x56')]){logger[_0x58ca('0xe')]('[QUEUE]',_0x58ca('0x57'));_0x16d409['recordingURL']=util[_0x58ca('0x27')](_0x58ca('0x58'),_0x3b7b2d[_0x58ca('0x52')],_0x16d409['uniqueid'],md5(_0x16d409['uniqueid']));}else{_0x16d409[_0x58ca('0x59')]='';}return getConnection(_0x3b7b2d)['then'](function(_0x3032f5){_0x221f5c=_0x3032f5;return getUser(_0x3b7b2d,_0x254f62['name'],_0x221f5c);})[_0x58ca('0x30')](function(_0x5ec640){_0x184340=_0x5ec640;logger[_0x58ca('0xe')](_0x58ca('0x5a'),_0x184340['id']);return getEndUser(_0x3b7b2d,_0x16d409[_0x58ca('0x5b')],_0x16d409[_0x58ca('0x5c')],_0x221f5c);})[_0x58ca('0x30')](function(_0x5c081a){_0x28204f=_0x5c081a;logger[_0x58ca('0xe')](_0x58ca('0x5d'),_0x28204f['id']);return getTicket(_0x3b7b2d,_0x184340,_0x28204f,_0x36d03d,_0x16d409,_0x36d03d[_0x58ca('0x5e')],_0x221f5c,_0x58ca('0x5f'));})[_0x58ca('0x30')](function(_0x480139){_0x28543c=_0x480139;logger[_0x58ca('0xe')]('Ticket\x20created!');logger[_0x58ca('0xe')](_0x58ca('0x60'),_0x28543c['id']);return setRelationship(_0x221f5c,_0x184340,_0x28543c,'users');})[_0x58ca('0x30')](function(){return setRelationship(_0x221f5c,_0x28204f,_0x28543c,'contacts');})['then'](function(){return getServerInfo(_0x221f5c);})[_0x58ca('0x30')](function(_0x53bec4){var _0x868ae6=parseInt(_0x53bec4['version'][_0x58ca('0x61')](0x0));var _0x463562=util[_0x58ca('0x27')](_0x58ca('0x62'),_0x3b7b2d[_0x58ca('0x55')],_0x28543c['id']);if(_0x868ae6>0x6){_0x463562=util[_0x58ca('0x27')](_0x58ca('0x63'),_0x3b7b2d[_0x58ca('0x55')],_0x28543c['id']);}logger['info'](_0x58ca('0x64'),_0x58ca('0x65'));emit(util[_0x58ca('0x27')](_0x58ca('0x66'),_0x254f62[_0x58ca('0x10')]),_0x58ca('0x67'),{'uri':_0x463562});})[_0x58ca('0x68')](function(_0x1a8ab4){logger[_0x58ca('0x69')]('[QUEUE]',JSON['stringify'](_0x1a8ab4));});};exports[_0x58ca('0x6a')]=function(_0x1eec64,_0xeb5748,_0x3e24d1,_0x2bb86c,_0x345ed2,_0x1ddd21,_0x449113){var _0x48683d,_0x2f3264,_0x5e46ef,_0x3b0ede;_0x1ddd21[_0x58ca('0x55')]=intUtil[_0x58ca('0x51')](_0x1ddd21['remoteUri']);_0x1ddd21['serverUrl']=intUtil[_0x58ca('0x51')](_0x1ddd21[_0x58ca('0x52')]);def[_0x58ca('0x53')]=util['format'](_0x58ca('0x54'),_0x1ddd21[_0x58ca('0x55')]);if(_0x449113&&_0x449113['recordingFormat']&&_0x449113[_0x58ca('0x6b')]!==_0x58ca('0x6c')){logger[_0x58ca('0xe')](_0x58ca('0x6d'),_0x58ca('0x57'));_0xeb5748[_0x58ca('0x59')]=util[_0x58ca('0x27')](_0x58ca('0x58'),_0x1ddd21[_0x58ca('0x52')],_0xeb5748[_0x58ca('0x6e')],md5(_0xeb5748[_0x58ca('0x6e')]));}return getConnection(_0x1ddd21)[_0x58ca('0x30')](function(_0x3fb95a){_0x3b0ede=_0x3fb95a;return getUser(_0x1ddd21,_0x2bb86c['name'],_0x3b0ede);})['then'](function(_0x3f9389){_0x48683d=_0x3f9389;logger[_0x58ca('0xe')](_0x58ca('0x5a'),_0x48683d['id']);return getEndUser(_0x1ddd21,_0xeb5748[_0x58ca('0x6f')],_0xeb5748['destcalleridnum'],_0x3b0ede);})[_0x58ca('0x30')](function(_0x877469){_0x2f3264=_0x877469;logger['info'](_0x58ca('0x5d'),_0x2f3264['id']);return getTicket(_0x1ddd21,_0x48683d,_0x2f3264,_0x3e24d1,_0xeb5748,_0x3e24d1[_0x58ca('0x5e')],_0x3b0ede,_0x58ca('0x70'));})[_0x58ca('0x30')](function(_0x4c632d){_0x5e46ef=_0x4c632d;logger['info'](_0x58ca('0x71'));logger[_0x58ca('0xe')]('The\x20Ticket\x20ID\x20is:',_0x5e46ef['id']);return setRelationship(_0x3b0ede,_0x48683d,_0x5e46ef,_0x58ca('0x72'));})['then'](function(){return setRelationship(_0x3b0ede,_0x2f3264,_0x5e46ef,'contacts');})[_0x58ca('0x30')](function(){return getServerInfo(_0x3b0ede);})[_0x58ca('0x30')](function(_0x2ae43e){var _0x263eeb=parseInt(_0x2ae43e['version'][_0x58ca('0x61')](0x0));var _0x2076a5=util['format'](_0x58ca('0x62'),_0x1ddd21['remoteUri'],_0x5e46ef['id']);if(_0x263eeb>0x6){_0x2076a5=util[_0x58ca('0x27')](_0x58ca('0x63'),_0x1ddd21[_0x58ca('0x55')],_0x5e46ef['id']);}logger[_0x58ca('0xe')]('[OUTBOUND]',_0x58ca('0x65'));emit(util[_0x58ca('0x27')](_0x58ca('0x66'),_0x2bb86c[_0x58ca('0x10')]),'trigger:browser:url',{'uri':_0x2076a5});})['catch'](function(_0xf1997b){logger[_0x58ca('0x69')](_0x58ca('0x6d'),JSON[_0x58ca('0x25')](_0xf1997b));});};exports[_0x58ca('0x73')]=function(_0x1e1a3e,_0x2e894f,_0x46ba29,_0x543885,_0x2f448e,_0xdd5481){var _0x140446,_0x1c0359,_0x5ac09b,_0x5c972f;_0xdd5481[_0x58ca('0x55')]=intUtil[_0x58ca('0x51')](_0xdd5481[_0x58ca('0x55')]);_0xdd5481[_0x58ca('0x52')]=intUtil[_0x58ca('0x51')](_0xdd5481[_0x58ca('0x52')]);def[_0x58ca('0x53')]=util['format']('%s/service/v4_1/rest.php',_0xdd5481[_0x58ca('0x55')]);if(_0x2f448e&&_0x2f448e[_0x58ca('0x56')]){logger['info']('['+_0x2e894f[_0x58ca('0x74')][_0x58ca('0x75')]()+']',_0x58ca('0x57'));_0x2e894f[_0x58ca('0x59')]=util[_0x58ca('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xdd5481[_0x58ca('0x52')],_0x2e894f[_0x58ca('0x6e')],md5(_0x2e894f[_0x58ca('0x6e')]));}else{_0x2e894f[_0x58ca('0x59')]='';}return getConnection(_0xdd5481)[_0x58ca('0x30')](function(_0x5492bb){_0x5c972f=_0x5492bb;if(!_[_0x58ca('0x76')](_0x543885)){return getUser(_0xdd5481,_0x543885[_0x58ca('0x10')],_0x5c972f);}else{return getUser(_0xdd5481,null,_0x5c972f);}})[_0x58ca('0x30')](function(_0x337869){_0x140446=_0x337869;logger[_0x58ca('0xe')](_0x58ca('0x5a'),_0x140446['id']);return getEndUser(_0xdd5481,_0x2e894f[_0x58ca('0x5b')],_0x2e894f['calleridnum'],_0x5c972f);})[_0x58ca('0x30')](function(_0x56e52b){_0x1c0359=_0x56e52b;logger['info'](_0x58ca('0x5d'),_0x1c0359['id']);return getTicket(_0xdd5481,_0x140446,_0x1c0359,_0x46ba29,_0x2e894f,_0x46ba29[_0x58ca('0x5e')],_0x5c972f,'Inbound');})[_0x58ca('0x30')](function(_0x1aa9fe){_0x5ac09b=_0x1aa9fe;logger[_0x58ca('0xe')](_0x58ca('0x71'));logger['info'](_0x58ca('0x60'),_0x5ac09b['id']);return setRelationship(_0x5c972f,_0x140446,_0x5ac09b,'users');})[_0x58ca('0x30')](function(){return setRelationship(_0x5c972f,_0x1c0359,_0x5ac09b,'contacts');})[_0x58ca('0x30')](function(){return getServerInfo(_0x5c972f);})['catch'](function(_0x73006){logger[_0x58ca('0x69')]('['+_0x2e894f[_0x58ca('0x74')][_0x58ca('0x75')]()+']',JSON[_0x58ca('0x25')](_0x73006));});};
\ No newline at end of file
+var _0xfce3=['calleridname','Inbound','lodash','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','slice','replace','duration_hours','parent_type','Contacts','parent_name','direction','length','idField','variableName','JSON','stringify','Calls','format','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Enduser\x20created.','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','push','toString','variable','custom_fields','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','then','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase'];(function(_0x3ffe40,_0x372c49){var _0x33cbcf=function(_0x44bee6){while(--_0x44bee6){_0x3ffe40['push'](_0x3ffe40['shift']());}};_0x33cbcf(++_0x372c49);}(_0xfce3,0x1e2));var _0x3fce=function(_0x2d24e2,_0x38c3af){_0x2d24e2=_0x2d24e2-0x0;var _0x330f61=_0xfce3[_0x2d24e2];return _0x330f61;};'use strict';var _=require(_0x3fce('0x0'));var rp=require('request-promise');var BPromise=require(_0x3fce('0x1'));var md5=require(_0x3fce('0x2'));var util=require(_0x3fce('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3fce('0x4'));var config=require(_0x3fce('0x5'));var logger=require(_0x3fce('0x6'))(_0x3fce('0x7'));config[_0x3fce('0x8')]=_[_0x3fce('0x9')](config['redis'],{'host':_0x3fce('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3fce('0x8')]));var def={'method':_0x3fce('0xb'),'json':!![]};function emit(_0x3556e0,_0x368998,_0x4c2d8f){io['to'](_0x3556e0)[_0x3fce('0xc')](_0x368998,_0x4c2d8f);}function getTicket(_0x8026d3,_0x28e11f,_0x82e35a,_0x3b4b48,_0x2f46f1,_0x27acf5,_0x4d3ed6,_0x313595){logger[_0x3fce('0xd')](_0x3fce('0xe'));var _0x4f7b24=new Date();var _0x3d8179=[{'name':_0x3fce('0xf'),'value':intUtil[_0x3fce('0x10')](_0x3b4b48[_0x3fce('0x11')],_0x2f46f1,'\x20')},{'name':_0x3fce('0x12'),'value':_0x28e11f['id']},{'name':_0x3fce('0x13'),'value':_0x28e11f['id']},{'name':_0x3fce('0x14'),'value':intUtil[_0x3fce('0x10')](_0x3b4b48[_0x3fce('0x15')],_0x2f46f1,'\x0a')},{'name':_0x3fce('0x16'),'value':_0x4f7b24['toISOString']()[_0x3fce('0x17')](0x0,0x13)[_0x3fce('0x18')]('T','\x20')},{'name':_0x3fce('0x19'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x82e35a['id']},{'name':_0x3fce('0x1a'),'value':_0x3fce('0x1b')},{'name':_0x3fce('0x1c'),'value':_0x82e35a['name']},{'name':_0x3fce('0x1d'),'value':_0x313595}];if(_0x27acf5[_0x3fce('0x1e')]){_['forEach'](_0x27acf5,function(_0x21374c){if(_0x2f46f1[_0x21374c['variableName']]){_0x3d8179['push']({'name':_0x21374c[_0x3fce('0x1f')],'value':_0x2f46f1[_0x21374c[_0x3fce('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x3fce('0x21'),'response_type':_0x3fce('0x21'),'rest_data':JSON[_0x3fce('0x22')]({'session':_0x4d3ed6['id'],'module_name':_0x3fce('0x23'),'name_value_list':_0x3d8179})}});}function getAuth(_0x23c1cf){return util[_0x3fce('0x24')]('Basic\x20%s',new Buffer(_0x23c1cf['apiKey']+':X')['toString']('base64'));}function getServerInfo(_0x31722e){return request({'form':{'method':_0x3fce('0x25'),'input_type':_0x3fce('0x21'),'response_type':_0x3fce('0x21'),'rest_data':JSON[_0x3fce('0x22')]({'session':_0x31722e['id']})}});}function getUser(_0x5b960c,_0x188279,_0x10c601){if(!_[_0x3fce('0x26')](_0x188279)){logger[_0x3fce('0xd')](_0x3fce('0x27'),_0x188279);return request({'form':{'method':'get_entry_list','input_type':_0x3fce('0x21'),'response_type':_0x3fce('0x21'),'rest_data':JSON[_0x3fce('0x22')]({'session':_0x10c601['id'],'module_name':'Employees','query':util['format'](_0x3fce('0x28'),_0x188279),'order_by':'','offset':'0','select_fields':['id','name',_0x3fce('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3e1dfc){if(_0x3e1dfc[_0x3fce('0x2a')][_0x3fce('0x1e')]){var _0x31c6dc=_['find'](_0x3e1dfc['entry_list'],function(_0x493d2e){return _0x493d2e[_0x3fce('0x2b')][_0x3fce('0x29')][_0x3fce('0x2c')]===_0x188279;});if(_0x31c6dc){logger[_0x3fce('0xd')](_0x3fce('0x2d'));return BPromise[_0x3fce('0x2e')]({'id':_0x31c6dc[_0x3fce('0x2b')]['id'][_0x3fce('0x2c')],'name':_0x31c6dc[_0x3fce('0x2b')]['name'][_0x3fce('0x2c')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x10c601[_0x3fce('0x2b')][_0x3fce('0x2f')]['value'],'name':_0x10c601[_0x3fce('0x2b')]['user_name'][_0x3fce('0x2c')]});});}else{logger[_0x3fce('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3fce('0x2e')]({'id':_0x10c601[_0x3fce('0x2b')][_0x3fce('0x2f')][_0x3fce('0x2c')],'name':_0x10c601[_0x3fce('0x2b')][_0x3fce('0x29')]['value']});}}function getEndUser(_0xeaed1c,_0x5354aa,_0x9ca012,_0x61d2f7){logger[_0x3fce('0xd')](_0x3fce('0x30'),_0x9ca012);return request({'form':{'method':_0x3fce('0x31'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3fce('0x22')]({'session':_0x61d2f7['id'],'module_name':'Contacts','query':util[_0x3fce('0x24')](_0x3fce('0x32'),_0x9ca012),'order_by':'','offset':'0','select_fields':['id',_0x3fce('0xf'),_0x3fce('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5cfd9f){if(_0x5cfd9f[_0x3fce('0x2a')][_0x3fce('0x1e')]){var _0x42d177=_[_0x3fce('0x34')](_0x5cfd9f[_0x3fce('0x2a')],function(_0x4a8f90){return _0x4a8f90[_0x3fce('0x2b')][_0x3fce('0x33')][_0x3fce('0x2c')]===_0x9ca012;});if(_0x42d177){logger[_0x3fce('0xd')](_0x3fce('0x35'));return BPromise[_0x3fce('0x2e')]({'id':_0x42d177[_0x3fce('0x2b')]['id'][_0x3fce('0x2c')],'name':_0x42d177[_0x3fce('0x2b')][_0x3fce('0xf')][_0x3fce('0x2c')],'phone':_0x42d177[_0x3fce('0x2b')][_0x3fce('0x33')]['value']});}}else{logger['info'](_0x3fce('0x36'));return request({'form':{'method':'set_entry','input_type':_0x3fce('0x21'),'response_type':'JSON','rest_data':JSON[_0x3fce('0x22')]({'session':_0x61d2f7['id'],'module_name':_0x3fce('0x1b'),'name_value_list':[{'name':_0x3fce('0x37'),'value':_0x5354aa!=='<unknown>'?_0x5354aa:util[_0x3fce('0x24')]('Caller\x20-\x20%s',_0x9ca012)},{'name':'phone_home','value':_0x9ca012}]})}})['then'](function(_0x42ec58){logger[_0x3fce('0xd')](_0x3fce('0x38'));return BPromise[_0x3fce('0x2e')]({'id':_0x42ec58['id'],'name':_0x42ec58[_0x3fce('0x2a')][_0x3fce('0x37')]['value'],'phone':_0x42ec58[_0x3fce('0x2a')][_0x3fce('0x33')][_0x3fce('0x2c')]});});}});}function request(_0x493852){logger['debug'](_0x3fce('0x39'),JSON[_0x3fce('0x22')](_0x493852));return rp(_[_0x3fce('0x3a')](def,_0x493852));}function getTags(_0x474b97,_0xd7fc67){var _0x242198=[];if(_0x474b97&&_0x474b97[_0x3fce('0x1e')]>0x0){_0x242198=_[_0x3fce('0x3b')](_0x474b97,_0xd7fc67);}return _0x242198;}function getCustomFields(_0x488e93,_0x3346e7){var _0xc22b30=[];var _0x171029={'custom_fields':[]};if(_0x488e93['length']>0x0){_[_0x3fce('0x3c')](_0x488e93,function(_0x9a5686){if(_0x9a5686[_0x3fce('0x3d')]===_0x3fce('0x3e')&&_0x9a5686[_0x3fce('0x3f')]&&!_0x9a5686[_0x3fce('0x40')]){_0x171029[_0x9a5686[_0x3fce('0x3f')][_0x3fce('0x41')]()]=_0x9a5686['content']['toString']();}else if(_0x9a5686[_0x3fce('0x3d')]==='string'&&_0x9a5686['idField']&&_0x9a5686[_0x3fce('0x40')]){_0x171029['custom_fields'][_0x3fce('0x42')]({'id':_0x9a5686['idField'],'value':_0x9a5686['content'][_0x3fce('0x43')]()});}else if(_0x9a5686['type']===_0x3fce('0x44')&&_0x9a5686['variableName']&&_0x9a5686[_0x3fce('0x1f')]&&_0x9a5686[_0x3fce('0x40')]){_0x3346e7[_0x9a5686[_0x3fce('0x20')]]&&_0x171029[_0x3fce('0x45')]['push']({'id':_0x9a5686[_0x3fce('0x1f')],'value':_0x3346e7[_0x9a5686[_0x3fce('0x20')]][_0x3fce('0x43')]()});}else if(_0x9a5686[_0x3fce('0x3d')]===_0x3fce('0x46')&&_0x9a5686[_0x3fce('0x47')]&&_0x9a5686['Variable'][_0x3fce('0xf')]&&_0x9a5686['idField']&&_0x9a5686[_0x3fce('0x40')]){_0x3346e7[_0x9a5686['Variable'][_0x3fce('0xf')]['toLowerCase']()]&&_0x171029[_0x3fce('0x45')][_0x3fce('0x42')]({'id':_0x9a5686['idField'],'value':_0x3346e7[_0x9a5686[_0x3fce('0x47')][_0x3fce('0xf')][_0x3fce('0x41')]()][_0x3fce('0x43')]()});}});}return _0x171029;}function getConnection(_0x439892){return request({'method':_0x3fce('0xb'),'form':{'method':_0x3fce('0x48'),'input_type':_0x3fce('0x21'),'response_type':_0x3fce('0x21'),'rest_data':JSON[_0x3fce('0x22')]({'user_auth':{'user_name':_0x439892[_0x3fce('0x49')],'password':_0x439892[_0x3fce('0x4a')],'encryption':_0x3fce('0x4b')},'application':_0x3fce('0x4c')})}})[_0x3fce('0x4d')](function(_0x3f6425){var _0x32ff63=_0x3f6425;if(_0x32ff63['id']){def[_0x3fce('0x4e')]=_0x32ff63['id'];return BPromise[_0x3fce('0x2e')](_0x32ff63);}else{throw new Error(util[_0x3fce('0x24')](_0x3fce('0x4f'),_0x439892['id']));}});}function setRelationship(_0x5c5309,_0x33925b,_0x592c4c,_0x14f9f6){return request({'form':{'method':_0x3fce('0x50'),'input_type':_0x3fce('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5c5309['id'],'module_name':_0x3fce('0x23'),'module_id':_0x592c4c['id'],'link_field_name':_0x14f9f6,'related_ids':[_0x33925b['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x3537ab,_0x1fd0e,_0x1e1159,_0xc24a12,_0x335f6b,_0x5ef86b){var _0x154cfe,_0x4a2d66,_0xfc240f,_0x1f14e4;_0x5ef86b[_0x3fce('0x51')]=intUtil[_0x3fce('0x52')](_0x5ef86b[_0x3fce('0x51')]);_0x5ef86b[_0x3fce('0x53')]=intUtil[_0x3fce('0x52')](_0x5ef86b['serverUrl']);def[_0x3fce('0x54')]=util[_0x3fce('0x24')](_0x3fce('0x55'),_0x5ef86b[_0x3fce('0x51')]);if(_0x335f6b&&_0x335f6b[_0x3fce('0x56')]){logger[_0x3fce('0xd')]('[QUEUE]',_0x3fce('0x57'));_0x1fd0e[_0x3fce('0x58')]=util[_0x3fce('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5ef86b[_0x3fce('0x53')],_0x1fd0e[_0x3fce('0x59')],md5(_0x1fd0e[_0x3fce('0x59')]));}else{_0x1fd0e[_0x3fce('0x58')]='';}return getConnection(_0x5ef86b)[_0x3fce('0x4d')](function(_0x52fecc){_0x1f14e4=_0x52fecc;return getUser(_0x5ef86b,_0xc24a12[_0x3fce('0xf')],_0x1f14e4);})[_0x3fce('0x4d')](function(_0x37d5f5){_0x154cfe=_0x37d5f5;logger[_0x3fce('0xd')](_0x3fce('0x5a'),_0x154cfe['id']);return getEndUser(_0x5ef86b,_0x1fd0e['calleridname'],_0x1fd0e[_0x3fce('0x5b')],_0x1f14e4);})['then'](function(_0x3c1426){_0x4a2d66=_0x3c1426;logger[_0x3fce('0xd')](_0x3fce('0x5c'),_0x4a2d66['id']);return getTicket(_0x5ef86b,_0x154cfe,_0x4a2d66,_0x1e1159,_0x1fd0e,_0x1e1159[_0x3fce('0x5d')],_0x1f14e4,'Inbound');})['then'](function(_0x1a5a31){_0xfc240f=_0x1a5a31;logger[_0x3fce('0xd')](_0x3fce('0x5e'));logger[_0x3fce('0xd')](_0x3fce('0x5f'),_0xfc240f['id']);return setRelationship(_0x1f14e4,_0x154cfe,_0xfc240f,_0x3fce('0x60'));})[_0x3fce('0x4d')](function(){return setRelationship(_0x1f14e4,_0x4a2d66,_0xfc240f,_0x3fce('0x61'));})['then'](function(){return getServerInfo(_0x1f14e4);})[_0x3fce('0x4d')](function(_0x527d88){var _0x2ddb3a=parseInt(_0x527d88['version'][_0x3fce('0x62')](0x0));var _0x10e44f=util[_0x3fce('0x24')](_0x3fce('0x63'),_0x5ef86b[_0x3fce('0x51')],_0xfc240f['id']);if(_0x2ddb3a>0x6){_0x10e44f=util['format'](_0x3fce('0x64'),_0x5ef86b['remoteUri'],_0xfc240f['id']);}logger['info'](_0x3fce('0x65'),_0x3fce('0x66'));emit(util['format'](_0x3fce('0x67'),_0xc24a12[_0x3fce('0xf')]),_0x3fce('0x68'),{'uri':_0x10e44f});})[_0x3fce('0x69')](function(_0x2237ba){logger[_0x3fce('0x6a')]('[QUEUE]',JSON[_0x3fce('0x22')](_0x2237ba));});};exports[_0x3fce('0x6b')]=function(_0x105094,_0xc613c9,_0x39c939,_0x55cc5c,_0x4ff3fb,_0x18a2e1,_0x16dbf1){var _0x254c8b,_0x3cc217,_0x2a2090,_0x797b6a;_0x18a2e1[_0x3fce('0x51')]=intUtil['stripTrailingSlash'](_0x18a2e1[_0x3fce('0x51')]);_0x18a2e1[_0x3fce('0x53')]=intUtil['stripTrailingSlash'](_0x18a2e1[_0x3fce('0x53')]);def[_0x3fce('0x54')]=util['format'](_0x3fce('0x55'),_0x18a2e1['remoteUri']);if(_0x16dbf1&&_0x16dbf1[_0x3fce('0x6c')]&&_0x16dbf1['recordingFormat']!==_0x3fce('0x6d')){logger[_0x3fce('0xd')](_0x3fce('0x6e'),_0x3fce('0x57'));_0xc613c9[_0x3fce('0x58')]=util[_0x3fce('0x24')](_0x3fce('0x6f'),_0x18a2e1[_0x3fce('0x53')],_0xc613c9['uniqueid'],md5(_0xc613c9[_0x3fce('0x59')]));}return getConnection(_0x18a2e1)[_0x3fce('0x4d')](function(_0x27e77a){_0x797b6a=_0x27e77a;return getUser(_0x18a2e1,_0x55cc5c[_0x3fce('0xf')],_0x797b6a);})[_0x3fce('0x4d')](function(_0x5def37){_0x254c8b=_0x5def37;logger['info'](_0x3fce('0x5a'),_0x254c8b['id']);return getEndUser(_0x18a2e1,_0xc613c9[_0x3fce('0x70')],_0xc613c9[_0x3fce('0x71')],_0x797b6a);})[_0x3fce('0x4d')](function(_0x59e82b){_0x3cc217=_0x59e82b;logger[_0x3fce('0xd')](_0x3fce('0x5c'),_0x3cc217['id']);return getTicket(_0x18a2e1,_0x254c8b,_0x3cc217,_0x39c939,_0xc613c9,_0x39c939[_0x3fce('0x5d')],_0x797b6a,_0x3fce('0x72'));})[_0x3fce('0x4d')](function(_0xec21a7){_0x2a2090=_0xec21a7;logger[_0x3fce('0xd')](_0x3fce('0x5e'));logger['info'](_0x3fce('0x5f'),_0x2a2090['id']);return setRelationship(_0x797b6a,_0x254c8b,_0x2a2090,_0x3fce('0x60'));})['then'](function(){return setRelationship(_0x797b6a,_0x3cc217,_0x2a2090,_0x3fce('0x61'));})[_0x3fce('0x4d')](function(){return getServerInfo(_0x797b6a);})['then'](function(_0x5a5ce8){var _0x18b2ef=parseInt(_0x5a5ce8['version']['charAt'](0x0));var _0x1cf314=util[_0x3fce('0x24')](_0x3fce('0x63'),_0x18a2e1[_0x3fce('0x51')],_0x2a2090['id']);if(_0x18b2ef>0x6){_0x1cf314=util[_0x3fce('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x18a2e1[_0x3fce('0x51')],_0x2a2090['id']);}logger[_0x3fce('0xd')]('[OUTBOUND]',_0x3fce('0x66'));emit(util['format'](_0x3fce('0x67'),_0x55cc5c[_0x3fce('0xf')]),_0x3fce('0x68'),{'uri':_0x1cf314});})[_0x3fce('0x69')](function(_0x7ba823){logger['error'](_0x3fce('0x6e'),JSON[_0x3fce('0x22')](_0x7ba823));});};exports[_0x3fce('0x73')]=function(_0x4334f7,_0x232c39,_0x5afcbc,_0x355f0b,_0x235c8d,_0x11766f){var _0x159af7,_0x4bf80c,_0x126c93,_0x59a1bc;_0x11766f[_0x3fce('0x51')]=intUtil[_0x3fce('0x52')](_0x11766f[_0x3fce('0x51')]);_0x11766f['serverUrl']=intUtil[_0x3fce('0x52')](_0x11766f[_0x3fce('0x53')]);def[_0x3fce('0x54')]=util[_0x3fce('0x24')](_0x3fce('0x55'),_0x11766f[_0x3fce('0x51')]);if(_0x235c8d&&_0x235c8d[_0x3fce('0x56')]){logger[_0x3fce('0xd')]('['+_0x232c39[_0x3fce('0x74')][_0x3fce('0x75')]()+']','Recording\x20is\x20enabled!');_0x232c39['recordingURL']=util[_0x3fce('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x11766f[_0x3fce('0x53')],_0x232c39[_0x3fce('0x59')],md5(_0x232c39['uniqueid']));}else{_0x232c39[_0x3fce('0x58')]='';}return getConnection(_0x11766f)[_0x3fce('0x4d')](function(_0x141d62){_0x59a1bc=_0x141d62;if(!_[_0x3fce('0x26')](_0x355f0b)){return getUser(_0x11766f,_0x355f0b['name'],_0x59a1bc);}else{return getUser(_0x11766f,null,_0x59a1bc);}})[_0x3fce('0x4d')](function(_0x2fa9f7){_0x159af7=_0x2fa9f7;logger['info'](_0x3fce('0x5a'),_0x159af7['id']);return getEndUser(_0x11766f,_0x232c39[_0x3fce('0x76')],_0x232c39[_0x3fce('0x5b')],_0x59a1bc);})[_0x3fce('0x4d')](function(_0x3a4138){_0x4bf80c=_0x3a4138;logger[_0x3fce('0xd')](_0x3fce('0x5c'),_0x4bf80c['id']);return getTicket(_0x11766f,_0x159af7,_0x4bf80c,_0x5afcbc,_0x232c39,_0x5afcbc['Fields'],_0x59a1bc,_0x3fce('0x77'));})['then'](function(_0x437608){_0x126c93=_0x437608;logger[_0x3fce('0xd')](_0x3fce('0x5e'));logger['info'](_0x3fce('0x5f'),_0x126c93['id']);return setRelationship(_0x59a1bc,_0x159af7,_0x126c93,_0x3fce('0x60'));})[_0x3fce('0x4d')](function(){return setRelationship(_0x59a1bc,_0x4bf80c,_0x126c93,'contacts');})[_0x3fce('0x4d')](function(){return getServerInfo(_0x59a1bc);})[_0x3fce('0x69')](function(_0x2cc039){logger['error']('['+_0x232c39[_0x3fce('0x74')][_0x3fce('0x75')]()+']',JSON['stringify'](_0x2cc039));});};
\ No newline at end of file
index 1b9c50d..cbf4b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07aa=['sortBy','type','variable','variableName','push','Variable','name','toLowerCase','toString','keyValue','key','format','keyType','%s:\x20%s','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash','getString','length'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x07aa,0x1bf));var _0xa07a=function(_0x2b844a,_0xe3e4e0){_0x2b844a=_0x2b844a-0x0;var _0x2abcb1=_0x07aa[_0x2b844a];return _0x2abcb1;};'use strict';var _=require(_0xa07a('0x0'));var util=require('util');exports[_0xa07a('0x1')]=function(_0x4aadc1,_0x18d1d4,_0x308f33){var _0x23772e=[];if(_0x4aadc1[_0xa07a('0x2')]>0x0){var _0x305f24=_[_0xa07a('0x3')](_0x4aadc1,['id']);for(var _0x1421b3=0x0;_0x1421b3<_0x305f24['length'];_0x1421b3++){var _0xb4ea79=_0x305f24[_0x1421b3];if(_0xb4ea79[_0xa07a('0x4')]==='string'){_0x23772e['push'](_0xb4ea79['content']);}else if(_0xb4ea79[_0xa07a('0x4')]===_0xa07a('0x5')&&_0xb4ea79[_0xa07a('0x6')]){_0x18d1d4[_0xb4ea79[_0xa07a('0x6')]]&&_0x23772e[_0xa07a('0x7')](_0x18d1d4[_0xb4ea79['variableName']]['toString']());}else if(_0xb4ea79[_0xa07a('0x4')]==='customVariable'&&_0xb4ea79[_0xa07a('0x8')]&&_0xb4ea79[_0xa07a('0x8')][_0xa07a('0x9')]){_0x18d1d4[_0xb4ea79['Variable'][_0xa07a('0x9')][_0xa07a('0xa')]()]&&_0x23772e[_0xa07a('0x7')](_0x18d1d4[_0xb4ea79[_0xa07a('0x8')]['name']['toLowerCase']()][_0xa07a('0xb')]());}else if(_0xb4ea79['type']===_0xa07a('0xc')){if(_0xb4ea79['keyType']==='string'&&_0xb4ea79[_0xa07a('0xd')]){_0x23772e[_0xa07a('0x7')](util[_0xa07a('0xe')]('%s:\x20%s',_0xb4ea79[_0xa07a('0xd')],_0xb4ea79['keyContent']));}else if(_0xb4ea79[_0xa07a('0xf')]==='variable'&&_0xb4ea79[_0xa07a('0x6')]&&_0xb4ea79[_0xa07a('0xd')]){_0x18d1d4[_0xb4ea79[_0xa07a('0x6')]]&&_0x23772e[_0xa07a('0x7')](util[_0xa07a('0xe')](_0xa07a('0x10'),_0xb4ea79[_0xa07a('0xd')],_0x18d1d4[_0xb4ea79[_0xa07a('0x6')]]));}else if(_0xb4ea79[_0xa07a('0xf')]===_0xa07a('0x11')&&_0xb4ea79['Variable']&&_0xb4ea79[_0xa07a('0x8')][_0xa07a('0x9')]&&_0xb4ea79[_0xa07a('0xd')]){_0x18d1d4[_0xb4ea79['Variable'][_0xa07a('0x9')][_0xa07a('0xa')]()]&&_0x23772e[_0xa07a('0x7')](util[_0xa07a('0xe')](_0xa07a('0x10'),_0xb4ea79[_0xa07a('0xd')],_0x18d1d4[_0xb4ea79[_0xa07a('0x8')][_0xa07a('0x9')][_0xa07a('0xa')]()]));}}}}return _0x23772e[_0xa07a('0x12')](_0x308f33);};exports[_0xa07a('0x13')]=function(_0x130e7f){var _0x4c97ee=_0x130e7f[_0xa07a('0x14')](-0x1);if(_0x4c97ee==='/'){_0x130e7f=_0x130e7f[_0xa07a('0x15')](0x0,_0x130e7f[_0xa07a('0x16')](_0x4c97ee));}return _0x130e7f;};exports['validateEmail']=function(_0x3c638c){if(!_[_0xa07a('0x17')](_0x3c638c)&&_0x3c638c!==''){var _0x135214=/^(([^<>()\[\]\\.,;:\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 _0x135214[_0xa07a('0x18')](String(_0x3c638c)[_0xa07a('0xa')]());}else{return![];}};
\ No newline at end of file
+var _0x84d5=['util','getString','length','sortBy','type','string','push','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','lastIndexOf','validateEmail','isNil','test','lodash'];(function(_0x557285,_0x416f13){var _0x32cbb1=function(_0x5a4741){while(--_0x5a4741){_0x557285['push'](_0x557285['shift']());}};_0x32cbb1(++_0x416f13);}(_0x84d5,0x1ed));var _0x584d=function(_0x1f750f,_0x3ebc08){_0x1f750f=_0x1f750f-0x0;var _0x3ac316=_0x84d5[_0x1f750f];return _0x3ac316;};'use strict';var _=require(_0x584d('0x0'));var util=require(_0x584d('0x1'));exports[_0x584d('0x2')]=function(_0x194e76,_0x29c97d,_0x255c01){var _0x5c281b=[];if(_0x194e76[_0x584d('0x3')]>0x0){var _0x7f5edf=_[_0x584d('0x4')](_0x194e76,['id']);for(var _0x335b88=0x0;_0x335b88<_0x7f5edf[_0x584d('0x3')];_0x335b88++){var _0x54e04d=_0x7f5edf[_0x335b88];if(_0x54e04d[_0x584d('0x5')]===_0x584d('0x6')){_0x5c281b[_0x584d('0x7')](_0x54e04d['content']);}else if(_0x54e04d['type']===_0x584d('0x8')&&_0x54e04d['variableName']){_0x29c97d[_0x54e04d['variableName']]&&_0x5c281b[_0x584d('0x7')](_0x29c97d[_0x54e04d[_0x584d('0x9')]][_0x584d('0xa')]());}else if(_0x54e04d[_0x584d('0x5')]===_0x584d('0xb')&&_0x54e04d[_0x584d('0xc')]&&_0x54e04d[_0x584d('0xc')][_0x584d('0xd')]){_0x29c97d[_0x54e04d[_0x584d('0xc')][_0x584d('0xd')]['toLowerCase']()]&&_0x5c281b[_0x584d('0x7')](_0x29c97d[_0x54e04d[_0x584d('0xc')][_0x584d('0xd')][_0x584d('0xe')]()]['toString']());}else if(_0x54e04d['type']==='keyValue'){if(_0x54e04d[_0x584d('0xf')]==='string'&&_0x54e04d[_0x584d('0x10')]){_0x5c281b[_0x584d('0x7')](util[_0x584d('0x11')](_0x584d('0x12'),_0x54e04d[_0x584d('0x10')],_0x54e04d[_0x584d('0x13')]));}else if(_0x54e04d[_0x584d('0xf')]===_0x584d('0x8')&&_0x54e04d[_0x584d('0x9')]&&_0x54e04d[_0x584d('0x10')]){_0x29c97d[_0x54e04d[_0x584d('0x9')]]&&_0x5c281b['push'](util[_0x584d('0x11')](_0x584d('0x12'),_0x54e04d['key'],_0x29c97d[_0x54e04d[_0x584d('0x9')]]));}else if(_0x54e04d[_0x584d('0xf')]===_0x584d('0xb')&&_0x54e04d['Variable']&&_0x54e04d['Variable'][_0x584d('0xd')]&&_0x54e04d[_0x584d('0x10')]){_0x29c97d[_0x54e04d[_0x584d('0xc')]['name'][_0x584d('0xe')]()]&&_0x5c281b[_0x584d('0x7')](util[_0x584d('0x11')](_0x584d('0x12'),_0x54e04d[_0x584d('0x10')],_0x29c97d[_0x54e04d['Variable']['name'][_0x584d('0xe')]()]));}}}}return _0x5c281b[_0x584d('0x14')](_0x255c01);};exports[_0x584d('0x15')]=function(_0x43b489){var _0x2646ab=_0x43b489['slice'](-0x1);if(_0x2646ab==='/'){_0x43b489=_0x43b489['substring'](0x0,_0x43b489[_0x584d('0x16')](_0x2646ab));}return _0x43b489;};exports[_0x584d('0x17')]=function(_0x2e9448){if(!_[_0x584d('0x18')](_0x2e9448)&&_0x2e9448!==''){var _0x51bd9d=/^(([^<>()\[\]\\.,;:\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 _0x51bd9d[_0x584d('0x19')](String(_0x2e9448)[_0x584d('0xe')]());}else{return![];}};
\ No newline at end of file
index 2a55d4b..2f91238 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(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});};
\ No newline at end of file
index ad56323..d462961 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0685=['integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','newTab','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','info','format','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Descriptions','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Enduser\x20created.','password','username','authType','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','custom_fields','push','variable','customField','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0x0685,0x159));var _0x5068=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0685[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x5068('0x0'));var rp=require(_0x5068('0x1'));var md5=require('md5');var util=require(_0x5068('0x2'));var Redis=require(_0x5068('0x3'));var intUtil=require(_0x5068('0x4'));var config=require('../../../../config/environment');var logger=require(_0x5068('0x5'))(_0x5068('0x6'));config[_0x5068('0x7')]=_[_0x5068('0x8')](config[_0x5068('0x7')],{'host':_0x5068('0x9'),'port':0x18eb});var io=require(_0x5068('0xa'))(new Redis(config[_0x5068('0x7')]));function emit(_0x3f4ab3,_0x2ca70a,_0x15ff48){io['to'](_0x3f4ab3)[_0x5068('0xb')](_0x2ca70a,_0x15ff48);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x53a030,_0x49cfa0,_0x4c0a98,_0x9d64d9,_0x26acb){logger[_0x5068('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x5068('0xd')](_0x5068('0xe'),_0x53a030[_0x5068('0xf')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x4c0a98['id'],'submitter_id':_0x49cfa0?_0x49cfa0['id']:undefined,'assignee_id':_0x49cfa0?_0x49cfa0['id']:undefined,'tags':getTags(_0x9d64d9[_0x5068('0x10')],_0x5068('0x11')),'subject':intUtil[_0x5068('0x12')](_0x9d64d9[_0x5068('0x13')],_0x26acb,'\x20'),'description':intUtil[_0x5068('0x12')](_0x9d64d9['Descriptions'],_0x26acb,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x9d64d9[_0x5068('0x14')],_0x26acb,'\x0a')}},getCustomFields(_0x9d64d9['Fields'],_0x26acb))}})['then'](function(_0x29de2a){logger['info'](_0x5068('0x15'));return _0x29de2a['ticket'];});}function getUser(_0x1758db,_0xb5e2d9){if(intUtil[_0x5068('0x16')](_0xb5e2d9)){logger[_0x5068('0xc')](_0x5068('0x17'),_0xb5e2d9);return request({'uri':util[_0x5068('0xd')](_0x5068('0x18'),_0x1758db[_0x5068('0xf')]),'qs':{'query':util[_0x5068('0xd')](_0x5068('0x19'),_0xb5e2d9)}})[_0x5068('0x1a')](function(_0x5d4f6e){if(_0x5d4f6e[_0x5068('0x1b')]){logger[_0x5068('0xc')](_0x5068('0x1c'));return _[_0x5068('0x1d')](_0x5d4f6e['results'],{'email':_0xb5e2d9,'role':'agent'});}else{logger[_0x5068('0xc')](_0x5068('0x1e'));return request({'uri':util[_0x5068('0xd')]('%s/users/me.json',_0x1758db[_0x5068('0xf')])})['then'](function(_0x40e41d){logger[_0x5068('0xc')](_0x5068('0x1f'));return _0x40e41d[_0x5068('0x20')];});}});}else{logger[_0x5068('0xc')](_0x5068('0x1e'));return request({'uri':util['format'](_0x5068('0x21'),_0x1758db['remoteUri'])})['then'](function(_0xb0373e){logger[_0x5068('0xc')](_0x5068('0x1f'));return _0xb0373e[_0x5068('0x20')];});}}function getEndUser(_0x255772,_0x29a7db,_0x3fd50b){logger[_0x5068('0xc')](_0x5068('0x22'),_0x3fd50b);return request({'uri':util[_0x5068('0xd')](_0x5068('0x18'),_0x255772[_0x5068('0xf')]),'qs':{'query':util[_0x5068('0xd')](_0x5068('0x23'),_0x3fd50b)}})['then'](function(_0x4b7506){var _0x46193e;if(_0x4b7506[_0x5068('0x24')][_0x5068('0x25')]){_0x4b7506[_0x5068('0x24')]=_[_0x5068('0x26')](_0x4b7506[_0x5068('0x24')],{'suspended':![],'role':_0x5068('0x27')});if(_0x4b7506['results'][_0x5068('0x25')]){_0x46193e=_['first'](_0x4b7506[_0x5068('0x24')]);}}if(_0x46193e){logger[_0x5068('0xc')](_0x5068('0x28'));return _0x46193e;}else{logger['info'](_0x5068('0x29'));return request({'uri':util[_0x5068('0xd')](_0x5068('0x2a'),_0x255772[_0x5068('0xf')]),'method':_0x5068('0x2b'),'body':{'user':{'role':_0x5068('0x27'),'name':util[_0x5068('0xd')]('Caller\x20-\x20%s',_0x29a7db||_0x3fd50b),'phone':_0x3fd50b}}})[_0x5068('0x1a')](function(_0xcc7611){logger[_0x5068('0xc')](_0x5068('0x2c'));return _0xcc7611[_0x5068('0x20')];});}});}function getAuth(_0x427eac){var _0x52207c;if(_0x427eac['authType']===_0x5068('0x2d')){_0x52207c=util['format']('%s:%s',_0x427eac[_0x5068('0x2e')],_0x427eac['password']);}else if(_0x427eac[_0x5068('0x2f')]===_0x5068('0x30')){_0x52207c=util['format'](_0x5068('0x31'),_0x427eac['username'],_0x427eac[_0x5068('0x30')]);}return util['format'](_0x5068('0x32'),new Buffer(_0x52207c)[_0x5068('0x33')]('base64'));}function request(_0x22b86b){logger[_0x5068('0x34')](_0x5068('0x35'),JSON['stringify'](_0x22b86b));return rp(_[_0x5068('0x8')](_0x22b86b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3ea184,_0x137202){var _0x594cde=[];if(_0x3ea184&&_0x3ea184[_0x5068('0x25')]>0x0){_0x594cde=_['map'](_0x3ea184,_0x137202);}return _0x594cde;}function getCustomFields(_0x3d20c2,_0x7d290d){var _0x391b72=[];var _0x269028={'custom_fields':[]};if(_0x3d20c2['length']>0x0){_[_0x5068('0x36')](_0x3d20c2,function(_0x5e3ad4){if(_[_0x5068('0x37')]([_0x5068('0x38'),_0x5068('0x39')],_0x5e3ad4[_0x5068('0x3a')])&&_0x5e3ad4[_0x5068('0x3b')]&&!_0x5e3ad4['customField']){_0x269028[_0x5e3ad4[_0x5068('0x3b')][_0x5068('0x3c')]()]=_0x5e3ad4[_0x5068('0x3d')][_0x5068('0x33')]();}else if(_[_0x5068('0x37')](['string',_0x5068('0x39')],_0x5e3ad4['type'])&&_0x5e3ad4[_0x5068('0x3e')]&&_0x5e3ad4['customField']){_0x269028[_0x5068('0x3f')][_0x5068('0x40')]({'id':_0x5e3ad4[_0x5068('0x3e')],'value':_0x5e3ad4[_0x5068('0x3d')][_0x5068('0x33')]()});}else if(_0x5e3ad4[_0x5068('0x3a')]===_0x5068('0x41')&&_0x5e3ad4['variableName']&&_0x5e3ad4[_0x5068('0x3e')]&&_0x5e3ad4[_0x5068('0x42')]){_0x7d290d[_0x5e3ad4['variableName']]&&_0x269028[_0x5068('0x3f')][_0x5068('0x40')]({'id':_0x5e3ad4['idField'],'value':_0x7d290d[_0x5e3ad4[_0x5068('0x43')]][_0x5068('0x33')]()});}else if(_0x5e3ad4[_0x5068('0x3a')]===_0x5068('0x44')&&_0x5e3ad4[_0x5068('0x45')]&&_0x5e3ad4[_0x5068('0x45')][_0x5068('0x11')]&&_0x5e3ad4[_0x5068('0x3e')]&&_0x5e3ad4[_0x5068('0x42')]){_0x7d290d[_0x5e3ad4['Variable'][_0x5068('0x11')][_0x5068('0x3c')]()]&&_0x269028[_0x5068('0x3f')]['push']({'id':_0x5e3ad4[_0x5068('0x3e')],'value':_0x7d290d[_0x5e3ad4[_0x5068('0x45')][_0x5068('0x11')][_0x5068('0x3c')]()][_0x5068('0x33')]()});}});}return _0x269028;}exports[_0x5068('0x46')]=function(_0x5c4fdb,_0x492e6a,_0x298921,_0x5d2d3e,_0xcd1a9f,_0xb5a95b){var _0x1da04b,_0x514891;_0xb5a95b[_0x5068('0xf')]=intUtil[_0x5068('0x47')](_0xb5a95b[_0x5068('0xf')]);_0xb5a95b[_0x5068('0x48')]=intUtil[_0x5068('0x47')](_0xb5a95b[_0x5068('0x48')]);if(_0xcd1a9f&&_0xcd1a9f[_0x5068('0x49')]){logger['info'](_0x5068('0x4a'),_0x5068('0x4b'));_0x492e6a[_0x5068('0x4c')]=util['format'](_0x5068('0x4d'),_0xb5a95b[_0x5068('0x48')],_0x492e6a[_0x5068('0x4e')],md5(_0x492e6a[_0x5068('0x4e')]));}else{_0x492e6a[_0x5068('0x4c')]='';}headers[_0x5068('0x4f')]=getAuth(_0xb5a95b);return getUser(_0xb5a95b,_0x5d2d3e[_0x5068('0x50')])[_0x5068('0x1a')](function(_0x15d69b){_0x1da04b=_0x15d69b;logger[_0x5068('0xc')](_0x5068('0x51'),_0x1da04b['id']);return getEndUser(_0xb5a95b,_0x492e6a[_0x5068('0x52')],_0x492e6a['calleridnum']);})[_0x5068('0x1a')](function(_0x3ea8ce){_0x514891=_0x3ea8ce;logger[_0x5068('0xc')]('The\x20Enduser\x20ID\x20is:',_0x514891['id']);return getTicket(_0xb5a95b,_0x1da04b,_0x514891,_0x298921,_0x492e6a);})[_0x5068('0x1a')](function(_0x417260){if(_0x417260){logger[_0x5068('0xc')]('The\x20Ticket\x20ID\x20is:',_0x417260['id']);switch(_0xb5a95b['type']){case _0x5068('0x53'):logger['info'](_0x5068('0x4a'),_0x5068('0x54'));return request({'uri':util[_0x5068('0xd')](_0x5068('0x55'),_0xb5a95b[_0x5068('0xf')],_0x1da04b['id'],_0x417260['id']),'method':_0x5068('0x2b')});case'newTab':logger['info'](_0x5068('0x4a'),_0x5068('0x56'));emit(util['format'](_0x5068('0x57'),_0x5d2d3e[_0x5068('0x11')]),_0x5068('0x58'),{'uri':util[_0x5068('0xd')](_0x5068('0x59'),_0xb5a95b['remoteUri']['replace']('/api/v2',''),_0x417260['id'])});break;default:logger[_0x5068('0x5a')](_0x5068('0x4a'),_0x5068('0x5b'));}}})[_0x5068('0x5c')](function(_0x1a87c7){logger[_0x5068('0x5a')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5068('0x5d')](_0x1a87c7,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x41c7b3,_0x577590,_0x1b888f,_0x1addfe,_0x388f01,_0x3827f9,_0xf9d18e){var _0x1f3007,_0x1f1c2c;_0x3827f9[_0x5068('0xf')]=intUtil[_0x5068('0x47')](_0x3827f9[_0x5068('0xf')]);_0x3827f9['serverUrl']=intUtil['stripTrailingSlash'](_0x3827f9[_0x5068('0x48')]);if(_0xf9d18e&&_0xf9d18e[_0x5068('0x5e')]&&_0xf9d18e[_0x5068('0x5e')]!==_0x5068('0x5f')){logger[_0x5068('0xc')](_0x5068('0x60'),'Recording\x20is\x20enabled!');_0x577590[_0x5068('0x4c')]=util[_0x5068('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3827f9['serverUrl'],_0x577590[_0x5068('0x4e')],md5(_0x577590[_0x5068('0x4e')]));}headers[_0x5068('0x4f')]=getAuth(_0x3827f9);return getUser(_0x3827f9,_0x1addfe[_0x5068('0x50')])['then'](function(_0x3d9ba3){_0x1f3007=_0x3d9ba3;logger[_0x5068('0xc')]('The\x20User\x20ID\x20is:',_0x1f3007['id']);return getEndUser(_0x3827f9,_0x577590[_0x5068('0x61')],_0x577590[_0x5068('0x62')]);})['then'](function(_0x5a84a4){_0x1f1c2c=_0x5a84a4;logger[_0x5068('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1f1c2c['id']);return getTicket(_0x3827f9,_0x1f3007,_0x1f1c2c,_0x1b888f,_0x577590);})['then'](function(_0x4286ef){if(_0x4286ef){logger['info']('The\x20Ticket\x20ID\x20is:',_0x4286ef['id']);switch(_0x3827f9[_0x5068('0x3a')]){case _0x5068('0x53'):logger['info'](_0x5068('0x60'),_0x5068('0x54'));return request({'uri':util[_0x5068('0xd')](_0x5068('0x55'),_0x3827f9[_0x5068('0xf')],_0x1f3007['id'],_0x4286ef['id']),'method':_0x5068('0x2b')});case _0x5068('0x63'):logger[_0x5068('0xc')](_0x5068('0x60'),_0x5068('0x56'));emit(util['format'](_0x5068('0x57'),_0x1addfe[_0x5068('0x11')]),'trigger:browser:url',{'uri':util[_0x5068('0xd')](_0x5068('0x59'),_0x3827f9['remoteUri']['replace'](_0x5068('0x64'),''),_0x4286ef['id'])});break;default:logger['error']('[OUTBOUND]',_0x5068('0x5b'));}}})[_0x5068('0x5c')](function(_0x2ea1c9){logger[_0x5068('0x5a')](_0x5068('0x65'),util[_0x5068('0x5d')](_0x2ea1c9,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x4a5bea,_0x15fed3,_0xfed910,_0x23d1c4,_0x4c23d8,_0x453c79){var _0x4b7cfe,_0x3e4f3c;_0x453c79[_0x5068('0xf')]=intUtil[_0x5068('0x47')](_0x453c79[_0x5068('0xf')]);_0x453c79[_0x5068('0x48')]=intUtil[_0x5068('0x47')](_0x453c79[_0x5068('0x48')]);if(_0x4c23d8&&_0x4c23d8['monitor_format']){logger['info']('['+_0x15fed3[_0x5068('0x66')][_0x5068('0x67')]()+']',_0x5068('0x4b'));_0x15fed3[_0x5068('0x4c')]=util[_0x5068('0xd')](_0x5068('0x4d'),_0x453c79[_0x5068('0x48')],_0x15fed3[_0x5068('0x4e')],md5(_0x15fed3['uniqueid']));}else{_0x15fed3['recordingURL']='';}headers['Authorization']=getAuth(_0x453c79);return getUser(_0x453c79)['then'](function(_0x29ba98){_0x4b7cfe=_0x29ba98;logger[_0x5068('0xc')]('The\x20User\x20ID\x20is:',_0x4b7cfe['id']);return getEndUser(_0x453c79,_0x15fed3['calleridname'],_0x15fed3['calleridnum']);})[_0x5068('0x1a')](function(_0x41ea6b){_0x3e4f3c=_0x41ea6b;logger[_0x5068('0xc')](_0x5068('0x68'),_0x3e4f3c['id']);return getTicket(_0x453c79,_0x4b7cfe,_0x3e4f3c,_0xfed910,_0x15fed3);})[_0x5068('0x1a')](function(_0x2236f4){if(_0x2236f4){logger[_0x5068('0xc')](_0x5068('0x69'),_0x2236f4['id']);}})[_0x5068('0x5c')](function(_0x4811ee){logger[_0x5068('0x5a')]('['+_0x15fed3[_0x5068('0x66')][_0x5068('0x67')]()+']'+_0x5068('0x6a'),util['inspect'](_0x4811ee,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x4a90=['[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','ioredis','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','Tags','name','Subjects','Descriptions','getString','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','Agent\x20found!','results','agent','format','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','password','%s:%s','authType','token','%s/token:%s','username','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','idField','custom_fields','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x4e2852,_0x4e825a){var _0x21efa2=function(_0x5643eb){while(--_0x5643eb){_0x4e2852['push'](_0x4e2852['shift']());}};_0x21efa2(++_0x4e825a);}(_0x4a90,0x1d7));var _0x04a9=function(_0x253c38,_0x55ad76){_0x253c38=_0x253c38-0x0;var _0x223336=_0x4a90[_0x253c38];return _0x223336;};'use strict';var _=require(_0x04a9('0x0'));var rp=require('request-promise');var md5=require(_0x04a9('0x1'));var util=require('util');var Redis=require(_0x04a9('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x04a9('0x3'))(_0x04a9('0x4'));config[_0x04a9('0x5')]=_[_0x04a9('0x6')](config[_0x04a9('0x5')],{'host':_0x04a9('0x7'),'port':0x18eb});var io=require(_0x04a9('0x8'))(new Redis(config[_0x04a9('0x5')]));function emit(_0x57cd5f,_0x93419,_0x36d9df){io['to'](_0x57cd5f)['emit'](_0x93419,_0x36d9df);}var headers={'Content-Type':_0x04a9('0x9'),'Accept':_0x04a9('0x9')};function getTicket(_0x4804a1,_0x34dbb2,_0x4f03ce,_0x4f7b41,_0x175d21){logger['info'](_0x04a9('0xa'));return request({'uri':util['format'](_0x04a9('0xb'),_0x4804a1[_0x04a9('0xc')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x4f03ce['id'],'submitter_id':_0x34dbb2?_0x34dbb2['id']:undefined,'assignee_id':_0x34dbb2?_0x34dbb2['id']:undefined,'tags':getTags(_0x4f7b41[_0x04a9('0xd')],_0x04a9('0xe')),'subject':intUtil['getString'](_0x4f7b41[_0x04a9('0xf')],_0x175d21,'\x20'),'description':intUtil['getString'](_0x4f7b41[_0x04a9('0x10')],_0x175d21,'\x0a'),'comment':{'public':![],'body':intUtil[_0x04a9('0x11')](_0x4f7b41['Descriptions'],_0x175d21,'\x0a')}},getCustomFields(_0x4f7b41[_0x04a9('0x12')],_0x175d21))}})[_0x04a9('0x13')](function(_0x46d0c4){logger[_0x04a9('0x14')](_0x04a9('0x15'));return _0x46d0c4[_0x04a9('0x16')];});}function getUser(_0x44f8ed,_0x5eb1e6){if(intUtil[_0x04a9('0x17')](_0x5eb1e6)){logger[_0x04a9('0x14')](_0x04a9('0x18'),_0x5eb1e6);return request({'uri':util['format'](_0x04a9('0x19'),_0x44f8ed[_0x04a9('0xc')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x5eb1e6)}})[_0x04a9('0x13')](function(_0x3d371c){if(_0x3d371c['count']){logger['info'](_0x04a9('0x1a'));return _['find'](_0x3d371c[_0x04a9('0x1b')],{'email':_0x5eb1e6,'role':_0x04a9('0x1c')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x04a9('0x1d')](_0x04a9('0x1e'),_0x44f8ed['remoteUri'])})[_0x04a9('0x13')](function(_0x3f8fcf){logger[_0x04a9('0x14')]('Admin\x20account\x20selected.');return _0x3f8fcf[_0x04a9('0x1f')];});}});}else{logger[_0x04a9('0x14')](_0x04a9('0x20'));return request({'uri':util[_0x04a9('0x1d')](_0x04a9('0x1e'),_0x44f8ed[_0x04a9('0xc')])})[_0x04a9('0x13')](function(_0x48ddd2){logger['info'](_0x04a9('0x21'));return _0x48ddd2[_0x04a9('0x1f')];});}}function getEndUser(_0x2e534e,_0x21a8f5,_0x55dcf3){logger[_0x04a9('0x14')](_0x04a9('0x22'),_0x55dcf3);return request({'uri':util['format'](_0x04a9('0x19'),_0x2e534e[_0x04a9('0xc')]),'qs':{'query':util[_0x04a9('0x1d')](_0x04a9('0x23'),_0x55dcf3)}})['then'](function(_0xf106a1){var _0x1f7802;if(_0xf106a1[_0x04a9('0x1b')][_0x04a9('0x24')]){_0xf106a1['results']=_[_0x04a9('0x25')](_0xf106a1[_0x04a9('0x1b')],{'suspended':![],'role':_0x04a9('0x26')});if(_0xf106a1[_0x04a9('0x1b')][_0x04a9('0x24')]){_0x1f7802=_['first'](_0xf106a1[_0x04a9('0x1b')]);}}if(_0x1f7802){logger[_0x04a9('0x14')]('Enduser\x20found!');return _0x1f7802;}else{logger[_0x04a9('0x14')](_0x04a9('0x27'));return request({'uri':util['format']('%s/users.json',_0x2e534e['remoteUri']),'method':_0x04a9('0x28'),'body':{'user':{'role':_0x04a9('0x26'),'name':util[_0x04a9('0x1d')](_0x04a9('0x29'),_0x21a8f5||_0x55dcf3),'phone':_0x55dcf3}}})['then'](function(_0x4eedcd){logger[_0x04a9('0x14')]('Enduser\x20created.');return _0x4eedcd[_0x04a9('0x1f')];});}});}function getAuth(_0x598e34){var _0x3c5527;if(_0x598e34['authType']===_0x04a9('0x2a')){_0x3c5527=util[_0x04a9('0x1d')](_0x04a9('0x2b'),_0x598e34['username'],_0x598e34[_0x04a9('0x2a')]);}else if(_0x598e34[_0x04a9('0x2c')]===_0x04a9('0x2d')){_0x3c5527=util[_0x04a9('0x1d')](_0x04a9('0x2e'),_0x598e34[_0x04a9('0x2f')],_0x598e34[_0x04a9('0x2d')]);}return util[_0x04a9('0x1d')](_0x04a9('0x30'),new Buffer(_0x3c5527)[_0x04a9('0x31')]('base64'));}function request(_0x33221b){logger[_0x04a9('0x32')](_0x04a9('0x33'),JSON[_0x04a9('0x34')](_0x33221b));return rp(_[_0x04a9('0x6')](_0x33221b,{'method':_0x04a9('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x58c99e,_0x35cf21){var _0x235001=[];if(_0x58c99e&&_0x58c99e['length']>0x0){_0x235001=_[_0x04a9('0x36')](_0x58c99e,_0x35cf21);}return _0x235001;}function getCustomFields(_0xa96fb4,_0x4a9439){var _0x3182b8=[];var _0xf2f319={'custom_fields':[]};if(_0xa96fb4['length']>0x0){_[_0x04a9('0x37')](_0xa96fb4,function(_0x379ace){if(_['includes']([_0x04a9('0x38'),_0x04a9('0x39')],_0x379ace[_0x04a9('0x3a')])&&_0x379ace[_0x04a9('0x3b')]&&!_0x379ace[_0x04a9('0x3c')]){_0xf2f319[_0x379ace[_0x04a9('0x3b')][_0x04a9('0x3d')]()]=_0x379ace[_0x04a9('0x3e')][_0x04a9('0x31')]();}else if(_[_0x04a9('0x3f')]([_0x04a9('0x38'),_0x04a9('0x39')],_0x379ace['type'])&&_0x379ace[_0x04a9('0x40')]&&_0x379ace[_0x04a9('0x3c')]){_0xf2f319[_0x04a9('0x41')][_0x04a9('0x42')]({'id':_0x379ace[_0x04a9('0x40')],'value':_0x379ace['content']['toString']()});}else if(_0x379ace['type']==='variable'&&_0x379ace['variableName']&&_0x379ace['idField']&&_0x379ace[_0x04a9('0x3c')]){_0x4a9439[_0x379ace[_0x04a9('0x43')]]&&_0xf2f319[_0x04a9('0x41')][_0x04a9('0x42')]({'id':_0x379ace[_0x04a9('0x40')],'value':_0x4a9439[_0x379ace['variableName']][_0x04a9('0x31')]()});}else if(_0x379ace[_0x04a9('0x3a')]===_0x04a9('0x44')&&_0x379ace['Variable']&&_0x379ace[_0x04a9('0x45')]['name']&&_0x379ace[_0x04a9('0x40')]&&_0x379ace['customField']){_0x4a9439[_0x379ace['Variable'][_0x04a9('0xe')][_0x04a9('0x3d')]()]&&_0xf2f319[_0x04a9('0x41')][_0x04a9('0x42')]({'id':_0x379ace[_0x04a9('0x40')],'value':_0x4a9439[_0x379ace['Variable'][_0x04a9('0xe')][_0x04a9('0x3d')]()][_0x04a9('0x31')]()});}});}return _0xf2f319;}exports[_0x04a9('0x46')]=function(_0x249588,_0x7cb0c6,_0x377738,_0x49ee8b,_0x5cd565,_0x32db7d){var _0x29105f,_0x59a577;_0x32db7d['remoteUri']=intUtil[_0x04a9('0x47')](_0x32db7d[_0x04a9('0xc')]);_0x32db7d[_0x04a9('0x48')]=intUtil[_0x04a9('0x47')](_0x32db7d[_0x04a9('0x48')]);if(_0x5cd565&&_0x5cd565[_0x04a9('0x49')]){logger[_0x04a9('0x14')](_0x04a9('0x4a'),_0x04a9('0x4b'));_0x7cb0c6['recordingURL']=util[_0x04a9('0x1d')](_0x04a9('0x4c'),_0x32db7d[_0x04a9('0x48')],_0x7cb0c6['uniqueid'],md5(_0x7cb0c6[_0x04a9('0x4d')]));}else{_0x7cb0c6[_0x04a9('0x4e')]='';}headers[_0x04a9('0x4f')]=getAuth(_0x32db7d);return getUser(_0x32db7d,_0x49ee8b[_0x04a9('0x50')])[_0x04a9('0x13')](function(_0x3d1eb1){_0x29105f=_0x3d1eb1;logger[_0x04a9('0x14')](_0x04a9('0x51'),_0x29105f['id']);return getEndUser(_0x32db7d,_0x7cb0c6[_0x04a9('0x52')],_0x7cb0c6[_0x04a9('0x53')]);})[_0x04a9('0x13')](function(_0x26df78){_0x59a577=_0x26df78;logger[_0x04a9('0x14')](_0x04a9('0x54'),_0x59a577['id']);return getTicket(_0x32db7d,_0x29105f,_0x59a577,_0x377738,_0x7cb0c6);})[_0x04a9('0x13')](function(_0x17d129){if(_0x17d129){logger[_0x04a9('0x14')](_0x04a9('0x55'),_0x17d129['id']);switch(_0x32db7d[_0x04a9('0x3a')]){case'integrationTab':logger[_0x04a9('0x14')]('[QUEUE]',_0x04a9('0x56'));return request({'uri':util[_0x04a9('0x1d')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x32db7d[_0x04a9('0xc')],_0x29105f['id'],_0x17d129['id']),'method':_0x04a9('0x28')});case'newTab':logger[_0x04a9('0x14')](_0x04a9('0x4a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x04a9('0x1d')](_0x04a9('0x57'),_0x49ee8b[_0x04a9('0xe')]),_0x04a9('0x58'),{'uri':util[_0x04a9('0x1d')](_0x04a9('0x59'),_0x32db7d[_0x04a9('0xc')][_0x04a9('0x5a')](_0x04a9('0x5b'),''),_0x17d129['id'])});break;default:logger[_0x04a9('0x5c')](_0x04a9('0x4a'),_0x04a9('0x5d'));}}})[_0x04a9('0x5e')](function(_0x20b6d8){logger[_0x04a9('0x5c')](_0x04a9('0x5f'),util[_0x04a9('0x60')](_0x20b6d8,{'showHidden':!![],'depth':null}));});};exports[_0x04a9('0x61')]=function(_0x29eece,_0x445a61,_0x361400,_0x41145d,_0x3d7294,_0x53c668,_0x1e9877){var _0x3eb05a,_0x330097;_0x53c668['remoteUri']=intUtil['stripTrailingSlash'](_0x53c668[_0x04a9('0xc')]);_0x53c668[_0x04a9('0x48')]=intUtil[_0x04a9('0x47')](_0x53c668[_0x04a9('0x48')]);if(_0x1e9877&&_0x1e9877[_0x04a9('0x62')]&&_0x1e9877['recordingFormat']!==_0x04a9('0x63')){logger[_0x04a9('0x14')](_0x04a9('0x64'),_0x04a9('0x4b'));_0x445a61[_0x04a9('0x4e')]=util[_0x04a9('0x1d')](_0x04a9('0x4c'),_0x53c668[_0x04a9('0x48')],_0x445a61[_0x04a9('0x4d')],md5(_0x445a61[_0x04a9('0x4d')]));}headers[_0x04a9('0x4f')]=getAuth(_0x53c668);return getUser(_0x53c668,_0x41145d[_0x04a9('0x50')])[_0x04a9('0x13')](function(_0x4f3e41){_0x3eb05a=_0x4f3e41;logger['info']('The\x20User\x20ID\x20is:',_0x3eb05a['id']);return getEndUser(_0x53c668,_0x445a61[_0x04a9('0x65')],_0x445a61['destcalleridnum']);})[_0x04a9('0x13')](function(_0x36a544){_0x330097=_0x36a544;logger[_0x04a9('0x14')](_0x04a9('0x54'),_0x330097['id']);return getTicket(_0x53c668,_0x3eb05a,_0x330097,_0x361400,_0x445a61);})['then'](function(_0x122083){if(_0x122083){logger[_0x04a9('0x14')](_0x04a9('0x55'),_0x122083['id']);switch(_0x53c668['type']){case _0x04a9('0x66'):logger['info'](_0x04a9('0x64'),_0x04a9('0x56'));return request({'uri':util[_0x04a9('0x1d')](_0x04a9('0x67'),_0x53c668[_0x04a9('0xc')],_0x3eb05a['id'],_0x122083['id']),'method':'POST'});case'newTab':logger[_0x04a9('0x14')](_0x04a9('0x64'),_0x04a9('0x68'));emit(util[_0x04a9('0x1d')](_0x04a9('0x57'),_0x41145d[_0x04a9('0xe')]),_0x04a9('0x58'),{'uri':util['format'](_0x04a9('0x59'),_0x53c668['remoteUri'][_0x04a9('0x5a')](_0x04a9('0x5b'),''),_0x122083['id'])});break;default:logger[_0x04a9('0x5c')]('[OUTBOUND]',_0x04a9('0x5d'));}}})[_0x04a9('0x5e')](function(_0x489fff){logger[_0x04a9('0x5c')](_0x04a9('0x69'),util[_0x04a9('0x60')](_0x489fff,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x2bdb1d,_0x3af66c,_0x40881b,_0x40a0da,_0x31953e,_0x4f726b){var _0x3a42c8,_0x39d535;_0x4f726b[_0x04a9('0xc')]=intUtil[_0x04a9('0x47')](_0x4f726b['remoteUri']);_0x4f726b['serverUrl']=intUtil[_0x04a9('0x47')](_0x4f726b[_0x04a9('0x48')]);if(_0x31953e&&_0x31953e[_0x04a9('0x49')]){logger['info']('['+_0x3af66c[_0x04a9('0x6a')][_0x04a9('0x6b')]()+']',_0x04a9('0x4b'));_0x3af66c[_0x04a9('0x4e')]=util[_0x04a9('0x1d')](_0x04a9('0x4c'),_0x4f726b[_0x04a9('0x48')],_0x3af66c[_0x04a9('0x4d')],md5(_0x3af66c['uniqueid']));}else{_0x3af66c[_0x04a9('0x4e')]='';}headers[_0x04a9('0x4f')]=getAuth(_0x4f726b);return getUser(_0x4f726b)[_0x04a9('0x13')](function(_0x52b984){_0x3a42c8=_0x52b984;logger[_0x04a9('0x14')](_0x04a9('0x51'),_0x3a42c8['id']);return getEndUser(_0x4f726b,_0x3af66c[_0x04a9('0x52')],_0x3af66c['calleridnum']);})[_0x04a9('0x13')](function(_0x22a722){_0x39d535=_0x22a722;logger[_0x04a9('0x14')](_0x04a9('0x54'),_0x39d535['id']);return getTicket(_0x4f726b,_0x3a42c8,_0x39d535,_0x40881b,_0x3af66c);})[_0x04a9('0x13')](function(_0x520230){if(_0x520230){logger[_0x04a9('0x14')](_0x04a9('0x55'),_0x520230['id']);}})[_0x04a9('0x5e')](function(_0x21bbfb){logger[_0x04a9('0x5c')]('['+_0x3af66c[_0x04a9('0x6a')][_0x04a9('0x6b')]()+']'+_0x04a9('0x6c'),util[_0x04a9('0x60')](_0x21bbfb,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 79f2dd5..f305e04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x455f=['content','toString','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','startCase','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','administrator','Subject','getString','Description','Descriptions','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','complete','Answered','rejected','Rejected','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','host','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','lodash','request-promise','md5','util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','stringify','length','picklist','type','idField'];(function(_0xc9cf7d,_0x8d3a1a){var _0x5c3887=function(_0x3babcd){while(--_0x3babcd){_0xc9cf7d['push'](_0xc9cf7d['shift']());}};_0x5c3887(++_0x8d3a1a);}(_0x455f,0x118));var _0xf455=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x455f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf455('0x0'));var rp=require(_0xf455('0x1'));var md5=require(_0xf455('0x2'));var util=require(_0xf455('0x3'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xf455('0x4'));var BPromise=require(_0xf455('0x5'));var config=require(_0xf455('0x6'));var logger=require('../../../../config/logger')(_0xf455('0x7'));config[_0xf455('0x8')]=_[_0xf455('0x9')](config[_0xf455('0x8')],{'host':_0xf455('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf455('0x8')]));function emit(_0x3fd8fa,_0x206b8f,_0x30dfbf){io['to'](_0x3fd8fa)[_0xf455('0xb')](_0x206b8f,_0x30dfbf);}function request(_0x567bae){logger[_0xf455('0xc')]('[HTTP]',JSON[_0xf455('0xd')](_0x567bae));return rp(_0x567bae);}function getCustomFields(_0x273e93,_0x1886ba){var _0x1e4028={};if(_0x273e93[_0xf455('0xe')]>0x0){_['forEach'](_0x273e93,function(_0x11c275){if(_['includes'](['string',_0xf455('0xf')],_0x11c275[_0xf455('0x10')])&&_0x11c275[_0xf455('0x11')]){_0x1e4028[_0x11c275[_0xf455('0x11')]]=_0x11c275[_0xf455('0x12')][_0xf455('0x13')]();}else if(_0x11c275[_0xf455('0x10')]==='variable'&&_0x11c275[_0xf455('0x14')]&&_0x11c275[_0xf455('0x11')]&&_0x1886ba[_0x11c275[_0xf455('0x14')]]){_0x1e4028[_0x11c275[_0xf455('0x11')]]=_0x1886ba[_0x11c275['variableName']][_0xf455('0x13')]();}else if(_0x11c275['type']===_0xf455('0x15')&&_0x11c275[_0xf455('0x16')]&&_0x11c275[_0xf455('0x16')][_0xf455('0x17')]&&_0x11c275[_0xf455('0x11')]&&_0x1886ba[_0x11c275[_0xf455('0x16')][_0xf455('0x17')][_0xf455('0x18')]()]){_0x1e4028[_0x11c275[_0xf455('0x11')]]=_0x1886ba[_0x11c275[_0xf455('0x16')][_0xf455('0x17')][_0xf455('0x18')]()][_0xf455('0x13')]();}});}return _0x1e4028;}function getName(_0x38ae3a){if(_0x38ae3a['indexOf']('\x20')>0x0){var _0x4f2d93=_0x38ae3a[_0xf455('0x19')](/ (.+)/);if(_0x4f2d93[0x1]){return _0x4f2d93;}}return[_0x38ae3a,_0x38ae3a];}var accountsTokens={};function getAccessToken(_0x40c4d6){return new Promise(function(_0x11c738,_0x5102fc){if(!_[_0xf455('0x1a')](accountsTokens[_0x40c4d6['id']])&&!_[_0xf455('0x1a')](accountsTokens[_0x40c4d6['id']][_0xf455('0x1b')])){if(moment()['isBefore'](accountsTokens[_0x40c4d6['id']][_0xf455('0x1c')])){_0x11c738(accountsTokens[_0x40c4d6['id']]['access_token']);}}var _0x3d6b10;switch(_0x40c4d6['zone']){case'US':_0x3d6b10=_0xf455('0x1d');break;case'AU':_0x3d6b10=_0xf455('0x1e');break;case'EU':_0x3d6b10=_0xf455('0x1f');break;case'IN':_0x3d6b10=_0xf455('0x20');break;case'CN':_0x3d6b10='https://accounts.zoho.com.cn';break;default:_0x3d6b10=_0xf455('0x1f');break;}var _0x3f62e1={'method':_0xf455('0x21'),'uri':_0x3d6b10+_0xf455('0x22'),'qs':{'refresh_token':_0x40c4d6[_0xf455('0x23')],'client_id':_0x40c4d6[_0xf455('0x24')],'client_secret':_0x40c4d6[_0xf455('0x25')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3f62e1)[_0xf455('0x26')](function(_0x422b70){accountsTokens[_0x40c4d6['id']]={'access_token':_0x422b70['access_token'],'expires_in':moment()[_0xf455('0x27')](_0x422b70[_0xf455('0x1c')],_0xf455('0x28'))};_0x11c738(_0x422b70[_0xf455('0x1b')]);})[_0xf455('0x29')](function(_0x56210a){logger[_0xf455('0x2a')](_0xf455('0x2b'),_0x56210a[_0xf455('0x2c')]);_0x5102fc(_0x56210a);});});}function getUser(_0x4553dc,_0x3b0b43,_0x1e8196,_0x24c876){logger[_0xf455('0x2d')](_0xf455('0x2e'));return request({'method':_0xf455('0x2f'),'uri':util[_0xf455('0x30')](_0xf455('0x31'),_0x3b0b43),'qs':{'type':_0xf455('0x32')},'headers':{'Authorization':_0xf455('0x33')+_0x4553dc},'json':!![]})[_0xf455('0x26')](function(_0x53c3df){if(_0x53c3df[_0xf455('0x34')]){var _0x3c1193=-0x1;if(_['isArrayLikeObject'](_0x53c3df['users'])){if(!_[_0xf455('0x1a')](_0x24c876)){_0x3c1193=_[_0xf455('0x35')](_0x53c3df[_0xf455('0x34')],function(_0x505eb6){return _0x505eb6[_0xf455('0x36')]===_0x24c876;});}if(_0x3c1193>=0x0){logger[_0xf455('0x2d')](_0xf455('0x37'));}else{logger[_0xf455('0x2d')](_0xf455('0x38'));_0x3c1193=_[_0xf455('0x35')](_0x53c3df[_0xf455('0x34')],function(_0x42c30f){return _0x42c30f[_0xf455('0x39')][_0xf455('0x17')]===_0xf455('0x3a');});}return _0x53c3df['users'][_0x3c1193];}else{if(_0x53c3df[_0xf455('0x3b')][_0xf455('0x39')][_0xf455('0x17')]===_0xf455('0x3a')){logger['info'](_0xf455('0x38'));user=_0x53c3df[_0xf455('0x3b')];return user;}else{logger[_0xf455('0x2a')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x53c3df));throw new Error(_0xf455('0x3c')+JSON[_0xf455('0xd')](_0x53c3df));}}}else{logger[_0xf455('0x2a')](_0xf455('0x3d'),JSON[_0xf455('0xd')](_0x53c3df));throw new Error(_0xf455('0x3c')+JSON[_0xf455('0xd')](_0x53c3df));}})[_0xf455('0x29')](function(_0x9f0783){console[_0xf455('0x2a')](_0x9f0783);});}function getZohoUser(_0x56b023,_0x198128){return new BPromise(function(_0x55d9a6,_0x727267){request(_0x56b023)['then'](function(_0xa9d593){var _0xae9e29=null;if(_0xa9d593){_0xae9e29=_0xa9d593['data'][0x0];_0xae9e29[_0xf455('0x3e')]=_0x198128;}_0x55d9a6(_0xae9e29);})[_0xf455('0x29')](function(_0x22c815){_0x727267(_0x22c815);});});}function createEndUser(_0x9a0628,_0x29ee12,_0x32af93,_0x41b1a3,_0x62bf04,_0x2b93b9){var _0x32af93=getName(_0x32af93);return request({'method':'POST','uri':_0xf455('0x3f')+_0x29ee12+_0xf455('0x40')+_['startCase'](_0x2b93b9[_0xf455('0x41')])+'s','body':{'data':[{'Last_Name':_0x32af93[0x1],'First_Name':_0x32af93[0x0],'Phone':_0x41b1a3,'Owner':{'name':!_[_0xf455('0x1a')](_0x62bf04['role'][_0xf455('0x17')])?_0x62bf04[_0xf455('0x42')]['name']:!_['isNil'](_0x62bf04[_0xf455('0x43')])?_0x62bf04[_0xf455('0x43')]+'\x20'+_0x62bf04['last_name']:_0x62bf04[_0xf455('0x44')],'id':_0x62bf04['id']}}]},'headers':{'Authorization':_0xf455('0x33')+_0x9a0628},'json':!![]})['then'](function(_0x4ebef5){if(_0x4ebef5&&_0x4ebef5[_0xf455('0x45')][0x0][_0xf455('0x46')]===_0xf455('0x47')){var _0x56d23b=_0x4ebef5[_0xf455('0x45')][0x0][_0xf455('0x48')];_0x56d23b[_0xf455('0x3e')]=_[_0xf455('0x49')](_0x2b93b9[_0xf455('0x41')])+'s';return _0x56d23b;}logger['error'](_0xf455('0x3d'),JSON[_0xf455('0xd')](data));throw new Error(_0xf455('0x4a')+JSON[_0xf455('0xd')](data));})[_0xf455('0x29')](function(_0x2e816d){console['log'](_0xf455('0x4b'),_0x2e816d);});}function getEndUser(_0x17269a,_0x268a3f,_0xac7890,_0x144169,_0x10a012,_0x4f4c03,_0x190cb1){var _0x139ea8={'method':_0xf455('0x2f'),'uri':'','headers':{'Authorization':_0xf455('0x33')+_0x17269a},'json':!![]};switch(_0x190cb1[_0xf455('0x4c')]){case _0xf455('0x4d'):_0x139ea8[_0xf455('0x4e')]=_0xf455('0x3f')+_0x268a3f+_0xf455('0x4f')+_0x10a012+'))';return getZohoUser(_0x139ea8,_0xf455('0x50'))[_0xf455('0x26')](function(_0x4473cf){if(_0x4473cf)return _0x4473cf;_0x139ea8[_0xf455('0x4e')]=_0xf455('0x3f')+_0x268a3f+_0xf455('0x51')+_0x10a012+'))';return getZohoUser(_0x139ea8,_0xf455('0x52'))[_0xf455('0x26')](function(_0x20613e){if(_0x20613e)return _0x20613e;if(_0x190cb1[_0xf455('0x41')]!=_0xf455('0x53')){return createEndUser(_0x17269a,_0x268a3f,_0x144169,_0x10a012,_0x4f4c03,_0x190cb1);}else{return{};}});});break;case _0xf455('0x54'):_0x139ea8[_0xf455('0x4e')]='https://www.zohoapis.'+_0x268a3f+_0xf455('0x4f')+_0x10a012+'))';return getZohoUser(_0x139ea8,_0xf455('0x50'))[_0xf455('0x26')](function(_0x44ca81){if(_0x44ca81)return _0x44ca81;if(_0x190cb1[_0xf455('0x41')]!=_0xf455('0x53')){return createEndUser(_0x17269a,_0x268a3f,_0x144169,_0x10a012,_0x4f4c03,_0x190cb1);}else{return{};}});break;case _0xf455('0x55'):_0x139ea8[_0xf455('0x4e')]=_0xf455('0x3f')+_0x268a3f+_0xf455('0x51')+_0x10a012+'))';return getZohoUser(_0x139ea8,_0xf455('0x52'))['then'](function(_0x5f287d){if(_0x5f287d)return _0x5f287d;if(_0x190cb1[_0xf455('0x41')]!=_0xf455('0x53')){return createEndUser(_0x17269a,_0x268a3f,_0x144169,_0x10a012,_0x4f4c03,_0x190cb1);}else{return{};}});break;}}function getCall(_0x18bc14,_0x3d4b53,_0x303a1d,_0x17cd69,_0x5ce02c,_0xf891e3,_0x119792,_0x77c9b7){logger[_0xf455('0x2d')](_0xf455('0x56'));var _0x1a6aba={};_0x1a6aba['Owner']={'name':!_[_0xf455('0x1a')](_0x17cd69[_0xf455('0x42')]['name'])&&!_[_0xf455('0x1a')](_0x17cd69[_0xf455('0x39')][_0xf455('0x17')])&&_0x17cd69[_0xf455('0x39')][_0xf455('0x17')]===_0xf455('0x57')?_0x17cd69[_0xf455('0x42')][_0xf455('0x17')]:!_[_0xf455('0x1a')](_0x17cd69['first_name'])?_0x17cd69[_0xf455('0x43')]+'\x20'+_0x17cd69[_0xf455('0x44')]:_0x17cd69[_0xf455('0x44')],'id':_0x17cd69['id']};_0x1a6aba[_0xf455('0x58')]=intUtil[_0xf455('0x59')](_0xf891e3['Subjects'],_0x119792,'\x20');_0x1a6aba[_0xf455('0x5a')]=intUtil[_0xf455('0x59')](_0xf891e3[_0xf455('0x5b')],_0x119792,'\x0a');if(_0x5ce02c[_0xf455('0x3e')]===_0xf455('0x50')){_0x1a6aba['Who_Id']={'name':!_[_0xf455('0x1a')](_0x5ce02c[_0xf455('0x5c')])?_0x5ce02c[_0xf455('0x5c')]:!_['isNil'](_0x5ce02c[_0xf455('0x5d')])?_0x5ce02c[_0xf455('0x5d')]+'\x20'+_0x5ce02c[_0xf455('0x5e')]:_0x5ce02c[_0xf455('0x5e')],'id':_0x5ce02c['id']};}if(_0x5ce02c[_0xf455('0x3e')]===_0xf455('0x52')){_0x1a6aba['What_Id']={'name':!_[_0xf455('0x1a')](_0x5ce02c[_0xf455('0x5c')])?_0x5ce02c[_0xf455('0x5c')]:!_[_0xf455('0x1a')](_0x5ce02c[_0xf455('0x5d')])?_0x5ce02c[_0xf455('0x5d')]+'\x20'+_0x5ce02c[_0xf455('0x5e')]:_0x5ce02c[_0xf455('0x5e')],'id':_0x5ce02c['id']};_0x1a6aba[_0xf455('0x5f')]=_['startCase'](_0x5ce02c[_0xf455('0x3e')]);}if(_0x119792[_0xf455('0x60')]){_0x1a6aba[_0xf455('0x61')]=moment[_0xf455('0x62')](parseInt(_0x119792[_0xf455('0x60')])*0x3e8)[_0xf455('0x30')]('mm:ss');}else if(_0x119792[_0xf455('0x63')]&&_0x119792['endtime']){_0x1a6aba[_0xf455('0x61')]=moment[_0xf455('0x62')](moment(_0x119792[_0xf455('0x64')],_0xf455('0x65'))[_0xf455('0x66')](moment(_0x119792['starttime'],_0xf455('0x65'))))[_0xf455('0x30')]('mm:ss');}switch(_0x119792[_0xf455('0x67')]){case _0xf455('0x68'):_0x1a6aba[_0xf455('0x69')]=_0xf455('0x6a');break;case _0xf455('0x6b'):case'connect':_0x1a6aba[_0xf455('0x69')]=_0xf455('0x6c');break;case _0xf455('0x6d'):_0x1a6aba[_0xf455('0x69')]=_0xf455('0x6e');break;case'abandoned':_0x1a6aba['Call_Result']='Abandoned';break;case'timeout':_0x1a6aba[_0xf455('0x69')]='Timeout';default:}_0x1a6aba[_0xf455('0x6f')]=(_0x77c9b7===_0xf455('0x70')?moment(_0x119792['starttime'])[_0xf455('0x30')](_0xf455('0x65')):moment(_0x119792[_0xf455('0x71')])['format'](_0xf455('0x65')))||moment()[_0xf455('0x30')](_0xf455('0x65'));_0x1a6aba['Call_Type']=_0x77c9b7||_0xf455('0x72');_0x1a6aba=_[_0xf455('0x73')](_0x1a6aba,getCustomFields(_0xf891e3[_0xf455('0x74')],_0x119792));return request({'method':_0xf455('0x21'),'uri':_0xf455('0x3f')+_0x3d4b53+_0xf455('0x75'),'headers':{'Authorization':_0xf455('0x33')+_0x18bc14},'body':{'data':[_0x1a6aba]},'json':!![]})[_0xf455('0x26')](function(_0x29385e){if(_0x29385e&&_0x29385e[_0xf455('0x45')][0x0][_0xf455('0x46')]==='SUCCESS'){logger[_0xf455('0x2d')](_0xf455('0x76'));return{'id':_0x29385e[_0xf455('0x45')][0x0][_0xf455('0x48')]['id']};}})[_0xf455('0x29')](function(_0x3c0dfe){logger['info'](_0xf455('0x77'),_0x3c0dfe['stack']);console['log'](_0xf455('0x77'),_0x3c0dfe);});}exports[_0xf455('0x78')]=function(_0x220c71,_0x53a51a,_0x986710,_0x5dbfbb,_0x16f6a2,_0x147546){var _0x31b641,_0x1cdad9,_0x2edd71;_0x147546['host']=intUtil[_0xf455('0x79')](_0x147546['host']);_0x147546['serverUrl']=intUtil['stripTrailingSlash'](_0x147546[_0xf455('0x7a')]);if(_0x16f6a2&&_0x16f6a2[_0xf455('0x7b')]){logger[_0xf455('0x2d')](_0xf455('0x7c'),_0xf455('0x7d'));_0x53a51a[_0xf455('0x7e')]=_0x147546['serverUrl']+_0xf455('0x7f')+_0x53a51a[_0xf455('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x53a51a[_0xf455('0x80')]);}else{_0x53a51a[_0xf455('0x7e')]='';}var _0x4213b3=_0x147546['host']===_0xf455('0x81')?'eu':_0xf455('0x82');return getAccessToken(_0x147546)[_0xf455('0x26')](function(_0x43575f){_0x2edd71=_0x43575f;return getUser(_0x2edd71,_0x4213b3,_0x147546,_0x5dbfbb['email']);})[_0xf455('0x26')](function(_0x14341b){_0x31b641=_0x14341b;logger[_0xf455('0x2d')](_0xf455('0x83'),_0x31b641['id']);return getEndUser(_0x2edd71,_0x4213b3,_0x147546,_0x53a51a[_0xf455('0x84')],_0x53a51a[_0xf455('0x85')],_0x31b641,_0x986710);})[_0xf455('0x26')](function(_0x231053){_0x1cdad9=_0x231053;return getCall(_0x2edd71,_0x4213b3,_0x147546,_0x31b641,_0x1cdad9,_0x986710,_0x53a51a,_0xf455('0x72'));})[_0xf455('0x26')](function(_0x3a75a6){if(_0x3a75a6){logger[_0xf455('0x2d')]('The\x20Call\x20ID\x20is:',_0x3a75a6['id']);logger['info'](_0xf455('0x7c'),_0xf455('0x86'));emit(util[_0xf455('0x30')](_0xf455('0x87'),_0x5dbfbb[_0xf455('0x17')]),_0xf455('0x88'),{'uri':_0xf455('0x89')+_0x147546['host']+_0xf455('0x8a')+_0x3a75a6['id']});}})['catch'](function(_0xd41e17){logger[_0xf455('0x2a')](_0xf455('0x7c'),JSON[_0xf455('0xd')](_0xd41e17));});};exports[_0xf455('0x70')]=function(_0x42653b,_0xa45f38,_0x536990,_0x4eb310,_0x411dab,_0x6df2a3,_0x3f22c6){var _0x464219,_0x3759d3,_0x2be488;_0x6df2a3[_0xf455('0x8b')]=intUtil[_0xf455('0x79')](_0x6df2a3[_0xf455('0x8b')]);_0x6df2a3[_0xf455('0x7a')]=intUtil[_0xf455('0x79')](_0x6df2a3[_0xf455('0x7a')]);if(_0x3f22c6&&_0x3f22c6['recordingFormat']&&_0x3f22c6[_0xf455('0x8c')]!==_0xf455('0x8d')){logger['info'](_0xf455('0x8e'),_0xf455('0x7d'));_0xa45f38[_0xf455('0x7e')]=_0x6df2a3[_0xf455('0x7a')]+_0xf455('0x7f')+_0xa45f38[_0xf455('0x80')]+_0xf455('0x8f')+md5(_0xa45f38[_0xf455('0x80')]);}var _0x1e7b17=_0x6df2a3['host']===_0xf455('0x81')?'eu':_0xf455('0x82');return getAccessToken(_0x6df2a3)[_0xf455('0x26')](function(_0x514c35){_0x2be488=_0x514c35;return getUser(_0x2be488,_0x1e7b17,_0x6df2a3,_0x4eb310['email']);})[_0xf455('0x26')](function(_0x3a3372){_0x464219=_0x3a3372;logger['info'](_0xf455('0x83'),_0x464219['id']);return getEndUser(_0x2be488,_0x1e7b17,_0x6df2a3,_0xa45f38['destcalleridname'],_0xa45f38[_0xf455('0x90')],_0x464219,_0x536990);})['then'](function(_0x3371ed){_0x3759d3=_0x3371ed;return getCall(_0x2be488,_0x1e7b17,_0x6df2a3,_0x464219,_0x3759d3,_0x536990,_0xa45f38,_0xf455('0x91'));})[_0xf455('0x26')](function(_0x46ad94){if(_0x46ad94){logger[_0xf455('0x2d')](_0xf455('0x92'),_0x46ad94['id']);logger['info']('[OUTBOUND]',_0xf455('0x86'));emit(util[_0xf455('0x30')](_0xf455('0x87'),_0x4eb310[_0xf455('0x17')]),_0xf455('0x88'),{'uri':_0xf455('0x89')+_0x6df2a3[_0xf455('0x8b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x46ad94['id']});}})[_0xf455('0x29')](function(_0x529eb5){logger['error'](_0xf455('0x8e'),JSON[_0xf455('0xd')](_0x529eb5));});};exports[_0xf455('0x93')]=function(_0x15167a,_0x3d5d98,_0x56338b,_0x20f6e3,_0x3996a5,_0x19afbb){var _0x3895b2,_0x2e3d47,_0x552b77;_0x19afbb['host']=intUtil['stripTrailingSlash'](_0x19afbb[_0xf455('0x8b')]);_0x19afbb['serverUrl']=intUtil['stripTrailingSlash'](_0x19afbb[_0xf455('0x7a')]);if(_0x3996a5&&_0x3996a5['monitor_format']){logger['info']('['+_0x3d5d98[_0xf455('0x67')][_0xf455('0x94')]()+']',_0xf455('0x7d'));_0x3d5d98[_0xf455('0x7e')]=_0x19afbb[_0xf455('0x7a')]+_0xf455('0x7f')+_0x3d5d98[_0xf455('0x80')]+_0xf455('0x8f')+md5(_0x3d5d98[_0xf455('0x80')]);}else{_0x3d5d98[_0xf455('0x7e')]='';}var _0x460690=_0x19afbb['host']===_0xf455('0x81')?'eu':'com';return getAccessToken(_0x19afbb)[_0xf455('0x26')](function(_0x468a02){_0x552b77=_0x468a02;return getUser(_0x552b77,_0x460690,_0x19afbb);})[_0xf455('0x26')](function(_0x1346dc){_0x3895b2=_0x1346dc;logger[_0xf455('0x2d')]('The\x20User\x20ID\x20is:',_0x3895b2['id']);return getEndUser(_0x552b77,_0x460690,_0x19afbb,_0x3d5d98['calleridname'],_0x3d5d98[_0xf455('0x85')],_0x3895b2,_0x56338b);})[_0xf455('0x26')](function(_0x43c682){_0x2e3d47=_0x43c682;return getCall(_0x552b77,_0x460690,_0x19afbb,_0x3895b2,_0x2e3d47,_0x56338b,_0x3d5d98,_0xf455('0x72'));})['then'](function(_0x6d4afd){if(_0x6d4afd){logger[_0xf455('0x2d')]('The\x20Call\x20ID\x20is:',_0x6d4afd['id']);}})[_0xf455('0x29')](function(_0x476359){logger['error']('['+_0x3d5d98['lastevent'][_0xf455('0x94')]()+']',JSON[_0xf455('0xd')](_0x476359));});};
\ No newline at end of file
+var _0xf2f5=['Contacts','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Answered','rejected','abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','details','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','https://crm.','unmanaged','Recording\x20is\x20enabled!','toUpperCase','lodash','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','type','idField','content','variable','variableName','toString','Variable','name','toLowerCase','indexOf','isNil','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','refresh_token','seconds','access_token','catch','error','stack','info','Search\x20user','GET','format','then','isArrayLikeObject','users','findIndex','email','Agent\x20found!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','data','code','SUCCESS','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.'];(function(_0x2c6043,_0x453649){var _0x5a4eb6=function(_0x57c6e1){while(--_0x57c6e1){_0x2c6043['push'](_0x2c6043['shift']());}};_0x5a4eb6(++_0x453649);}(_0xf2f5,0x179));var _0x5f2f=function(_0x25324d,_0x4c1281){_0x25324d=_0x25324d-0x0;var _0x9ddc14=_0xf2f5[_0x25324d];return _0x9ddc14;};'use strict';var _=require(_0x5f2f('0x0'));var rp=require('request-promise');var md5=require(_0x5f2f('0x1'));var util=require('util');var intUtil=require(_0x5f2f('0x2'));var moment=require(_0x5f2f('0x3'));var Redis=require(_0x5f2f('0x4'));var BPromise=require(_0x5f2f('0x5'));var config=require(_0x5f2f('0x6'));var logger=require(_0x5f2f('0x7'))(_0x5f2f('0x8'));config[_0x5f2f('0x9')]=_[_0x5f2f('0xa')](config[_0x5f2f('0x9')],{'host':_0x5f2f('0xb'),'port':0x18eb});var io=require(_0x5f2f('0xc'))(new Redis(config[_0x5f2f('0x9')]));function emit(_0x37c15c,_0x55de4c,_0x27eae9){io['to'](_0x37c15c)[_0x5f2f('0xd')](_0x55de4c,_0x27eae9);}function request(_0x57e876){logger[_0x5f2f('0xe')](_0x5f2f('0xf'),JSON[_0x5f2f('0x10')](_0x57e876));return rp(_0x57e876);}function getCustomFields(_0x32cc75,_0x1261af){var _0xe039b8={};if(_0x32cc75[_0x5f2f('0x11')]>0x0){_[_0x5f2f('0x12')](_0x32cc75,function(_0x1a130c){if(_[_0x5f2f('0x13')]([_0x5f2f('0x14'),'picklist'],_0x1a130c[_0x5f2f('0x15')])&&_0x1a130c[_0x5f2f('0x16')]){_0xe039b8[_0x1a130c[_0x5f2f('0x16')]]=_0x1a130c[_0x5f2f('0x17')]['toString']();}else if(_0x1a130c[_0x5f2f('0x15')]===_0x5f2f('0x18')&&_0x1a130c['variableName']&&_0x1a130c[_0x5f2f('0x16')]&&_0x1261af[_0x1a130c[_0x5f2f('0x19')]]){_0xe039b8[_0x1a130c[_0x5f2f('0x16')]]=_0x1261af[_0x1a130c[_0x5f2f('0x19')]][_0x5f2f('0x1a')]();}else if(_0x1a130c[_0x5f2f('0x15')]==='customVariable'&&_0x1a130c[_0x5f2f('0x1b')]&&_0x1a130c['Variable'][_0x5f2f('0x1c')]&&_0x1a130c['idField']&&_0x1261af[_0x1a130c[_0x5f2f('0x1b')][_0x5f2f('0x1c')][_0x5f2f('0x1d')]()]){_0xe039b8[_0x1a130c['idField']]=_0x1261af[_0x1a130c[_0x5f2f('0x1b')][_0x5f2f('0x1c')][_0x5f2f('0x1d')]()]['toString']();}});}return _0xe039b8;}function getName(_0x56224f){if(_0x56224f[_0x5f2f('0x1e')]('\x20')>0x0){var _0x45279b=_0x56224f['split'](/ (.+)/);if(_0x45279b[0x1]){return _0x45279b;}}return[_0x56224f,_0x56224f];}var accountsTokens={};function getAccessToken(_0x187e87){return new Promise(function(_0xe0082b,_0xf31856){if(!_[_0x5f2f('0x1f')](accountsTokens[_0x187e87['id']])&&!_[_0x5f2f('0x1f')](accountsTokens[_0x187e87['id']]['access_token'])){if(moment()[_0x5f2f('0x20')](accountsTokens[_0x187e87['id']][_0x5f2f('0x21')])){_0xe0082b(accountsTokens[_0x187e87['id']]['access_token']);}}var _0x399fef;switch(_0x187e87[_0x5f2f('0x22')]){case'US':_0x399fef=_0x5f2f('0x23');break;case'AU':_0x399fef='https://accounts.zoho.com.au';break;case'EU':_0x399fef=_0x5f2f('0x24');break;case'IN':_0x399fef=_0x5f2f('0x25');break;case'CN':_0x399fef=_0x5f2f('0x26');break;default:_0x399fef='https://accounts.zoho.eu';break;}var _0x202f7d={'method':_0x5f2f('0x27'),'uri':_0x399fef+_0x5f2f('0x28'),'qs':{'refresh_token':_0x187e87[_0x5f2f('0x29')],'client_id':_0x187e87['clientId'],'client_secret':_0x187e87['clientSecret'],'grant_type':_0x5f2f('0x2a')},'json':!![]};return rp(_0x202f7d)['then'](function(_0x117ff0){accountsTokens[_0x187e87['id']]={'access_token':_0x117ff0['access_token'],'expires_in':moment()['add'](_0x117ff0[_0x5f2f('0x21')],_0x5f2f('0x2b'))};_0xe0082b(_0x117ff0[_0x5f2f('0x2c')]);})[_0x5f2f('0x2d')](function(_0x135881){logger[_0x5f2f('0x2e')]('Failing\x20creating\x20the\x20access_token',_0x135881[_0x5f2f('0x2f')]);_0xf31856(_0x135881);});});}function getUser(_0x2d0ff0,_0x3250c9,_0xa07221,_0x2cf5b4){logger[_0x5f2f('0x30')](_0x5f2f('0x31'));return request({'method':_0x5f2f('0x32'),'uri':util[_0x5f2f('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x3250c9),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2d0ff0},'json':!![]})[_0x5f2f('0x34')](function(_0x767e45){if(_0x767e45['users']){var _0x184861=-0x1;if(_[_0x5f2f('0x35')](_0x767e45[_0x5f2f('0x36')])){if(!_[_0x5f2f('0x1f')](_0x2cf5b4)){_0x184861=_[_0x5f2f('0x37')](_0x767e45[_0x5f2f('0x36')],function(_0x55fb8a){return _0x55fb8a[_0x5f2f('0x38')]===_0x2cf5b4;});}if(_0x184861>=0x0){logger[_0x5f2f('0x30')](_0x5f2f('0x39'));}else{logger[_0x5f2f('0x30')]('Using\x20the\x20admin\x20account!');_0x184861=_[_0x5f2f('0x37')](_0x767e45[_0x5f2f('0x36')],function(_0x568da2){return _0x568da2[_0x5f2f('0x3a')][_0x5f2f('0x1c')]===_0x5f2f('0x3b');});}return _0x767e45[_0x5f2f('0x36')][_0x184861];}else{if(_0x767e45[_0x5f2f('0x3c')][_0x5f2f('0x3a')][_0x5f2f('0x1c')]===_0x5f2f('0x3b')){logger[_0x5f2f('0x30')]('Using\x20the\x20admin\x20account!');user=_0x767e45['user'];return user;}else{logger['error'](_0x5f2f('0x3d'),JSON[_0x5f2f('0x10')](_0x767e45));throw new Error(_0x5f2f('0x3e')+JSON['stringify'](_0x767e45));}}}else{logger[_0x5f2f('0x2e')](_0x5f2f('0x3d'),JSON['stringify'](_0x767e45));throw new Error(_0x5f2f('0x3e')+JSON[_0x5f2f('0x10')](_0x767e45));}})[_0x5f2f('0x2d')](function(_0x5ba72a){console[_0x5f2f('0x2e')](_0x5ba72a);});}function getZohoUser(_0x4b5b30,_0x395895){return new BPromise(function(_0x4d7073,_0x517848){request(_0x4b5b30)[_0x5f2f('0x34')](function(_0x3e3bb8){var _0x1c436e=null;if(_0x3e3bb8){_0x1c436e=_0x3e3bb8['data'][0x0];_0x1c436e[_0x5f2f('0x3f')]=_0x395895;}_0x4d7073(_0x1c436e);})[_0x5f2f('0x2d')](function(_0x27b077){_0x517848(_0x27b077);});});}function createEndUser(_0x286967,_0x138d41,_0x18e17b,_0x22092d,_0x469673,_0x54f3de){var _0x18e17b=getName(_0x18e17b);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x138d41+_0x5f2f('0x40')+_[_0x5f2f('0x41')](_0x54f3de[_0x5f2f('0x42')])+'s','body':{'data':[{'Last_Name':_0x18e17b[0x1],'First_Name':_0x18e17b[0x0],'Phone':_0x22092d,'Owner':{'name':!_['isNil'](_0x469673[_0x5f2f('0x43')][_0x5f2f('0x1c')])?_0x469673[_0x5f2f('0x43')]['name']:!_[_0x5f2f('0x1f')](_0x469673[_0x5f2f('0x44')])?_0x469673[_0x5f2f('0x44')]+'\x20'+_0x469673['last_name']:_0x469673[_0x5f2f('0x45')],'id':_0x469673['id']}}]},'headers':{'Authorization':_0x5f2f('0x46')+_0x286967},'json':!![]})[_0x5f2f('0x34')](function(_0x376872){if(_0x376872&&_0x376872[_0x5f2f('0x47')][0x0][_0x5f2f('0x48')]===_0x5f2f('0x49')){var _0x1bf16a=_0x376872[_0x5f2f('0x47')][0x0]['details'];_0x1bf16a['enduserType']=_['startCase'](_0x54f3de['moduleCreate'])+'s';return _0x1bf16a;}logger[_0x5f2f('0x2e')](_0x5f2f('0x3d'),JSON[_0x5f2f('0x10')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0x5f2f('0x2d')](function(_0x485041){console['log'](_0x5f2f('0x4a'),_0x485041);});}function getEndUser(_0x6f7e35,_0x3e342a,_0x43638a,_0x30dc13,_0x26b526,_0x64dd09,_0x1933e4){var _0xd10336={'method':_0x5f2f('0x32'),'uri':'','headers':{'Authorization':_0x5f2f('0x46')+_0x6f7e35},'json':!![]};switch(_0x1933e4[_0x5f2f('0x4b')]){case _0x5f2f('0x4c'):_0xd10336[_0x5f2f('0x4d')]=_0x5f2f('0x4e')+_0x3e342a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x26b526+'))';return getZohoUser(_0xd10336,_0x5f2f('0x4f'))[_0x5f2f('0x34')](function(_0x1db596){if(_0x1db596)return _0x1db596;_0xd10336[_0x5f2f('0x4d')]=_0x5f2f('0x4e')+_0x3e342a+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x26b526+'))';return getZohoUser(_0xd10336,_0x5f2f('0x50'))[_0x5f2f('0x34')](function(_0x1d0cb2){if(_0x1d0cb2)return _0x1d0cb2;if(_0x1933e4[_0x5f2f('0x42')]!=_0x5f2f('0x51')){return createEndUser(_0x6f7e35,_0x3e342a,_0x30dc13,_0x26b526,_0x64dd09,_0x1933e4);}else{return{};}});});break;case _0x5f2f('0x52'):_0xd10336[_0x5f2f('0x4d')]=_0x5f2f('0x4e')+_0x3e342a+_0x5f2f('0x53')+_0x26b526+'))';return getZohoUser(_0xd10336,_0x5f2f('0x4f'))[_0x5f2f('0x34')](function(_0x47fb2e){if(_0x47fb2e)return _0x47fb2e;if(_0x1933e4[_0x5f2f('0x42')]!='nothing'){return createEndUser(_0x6f7e35,_0x3e342a,_0x30dc13,_0x26b526,_0x64dd09,_0x1933e4);}else{return{};}});break;case _0x5f2f('0x54'):_0xd10336[_0x5f2f('0x4d')]=_0x5f2f('0x4e')+_0x3e342a+_0x5f2f('0x55')+_0x26b526+'))';return getZohoUser(_0xd10336,'Leads')[_0x5f2f('0x34')](function(_0xed422){if(_0xed422)return _0xed422;if(_0x1933e4[_0x5f2f('0x42')]!=_0x5f2f('0x51')){return createEndUser(_0x6f7e35,_0x3e342a,_0x30dc13,_0x26b526,_0x64dd09,_0x1933e4);}else{return{};}});break;}}function getCall(_0x34e1a7,_0x3ffe64,_0x16d599,_0x427586,_0x56c6c1,_0x5a3cb2,_0x67015d,_0x2245ad){logger[_0x5f2f('0x30')](_0x5f2f('0x56'));var _0x788030={};_0x788030[_0x5f2f('0x57')]={'name':!_['isNil'](_0x427586[_0x5f2f('0x43')][_0x5f2f('0x1c')])&&!_[_0x5f2f('0x1f')](_0x427586[_0x5f2f('0x3a')][_0x5f2f('0x1c')])&&_0x427586[_0x5f2f('0x3a')][_0x5f2f('0x1c')]==='administrator'?_0x427586[_0x5f2f('0x43')]['name']:!_[_0x5f2f('0x1f')](_0x427586[_0x5f2f('0x44')])?_0x427586[_0x5f2f('0x44')]+'\x20'+_0x427586[_0x5f2f('0x45')]:_0x427586[_0x5f2f('0x45')],'id':_0x427586['id']};_0x788030[_0x5f2f('0x58')]=intUtil['getString'](_0x5a3cb2[_0x5f2f('0x59')],_0x67015d,'\x20');_0x788030[_0x5f2f('0x5a')]=intUtil[_0x5f2f('0x5b')](_0x5a3cb2[_0x5f2f('0x5c')],_0x67015d,'\x0a');if(_0x56c6c1[_0x5f2f('0x3f')]===_0x5f2f('0x4f')){_0x788030[_0x5f2f('0x5d')]={'name':!_['isNil'](_0x56c6c1[_0x5f2f('0x5e')])?_0x56c6c1[_0x5f2f('0x5e')]:!_['isNil'](_0x56c6c1['First_Name'])?_0x56c6c1['First_Name']+'\x20'+_0x56c6c1[_0x5f2f('0x5f')]:_0x56c6c1[_0x5f2f('0x5f')],'id':_0x56c6c1['id']};}if(_0x56c6c1[_0x5f2f('0x3f')]===_0x5f2f('0x50')){_0x788030[_0x5f2f('0x60')]={'name':!_[_0x5f2f('0x1f')](_0x56c6c1[_0x5f2f('0x5e')])?_0x56c6c1['Full_Name']:!_[_0x5f2f('0x1f')](_0x56c6c1['First_Name'])?_0x56c6c1[_0x5f2f('0x61')]+'\x20'+_0x56c6c1['Last_Name']:_0x56c6c1[_0x5f2f('0x5f')],'id':_0x56c6c1['id']};_0x788030[_0x5f2f('0x62')]=_['startCase'](_0x56c6c1['enduserType']);}if(_0x67015d[_0x5f2f('0x63')]){_0x788030[_0x5f2f('0x64')]=moment[_0x5f2f('0x65')](parseInt(_0x67015d['talktime'])*0x3e8)[_0x5f2f('0x33')](_0x5f2f('0x66'));}else if(_0x67015d[_0x5f2f('0x67')]&&_0x67015d[_0x5f2f('0x68')]){_0x788030[_0x5f2f('0x64')]=moment['utc'](moment(_0x67015d['endtime'],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x67015d[_0x5f2f('0x69')],_0x5f2f('0x6a'))))[_0x5f2f('0x33')](_0x5f2f('0x66'));}switch(_0x67015d[_0x5f2f('0x6b')]){case _0x5f2f('0x6c'):_0x788030[_0x5f2f('0x6d')]='Called';break;case'complete':case'connect':_0x788030[_0x5f2f('0x6d')]=_0x5f2f('0x6e');break;case _0x5f2f('0x6f'):_0x788030[_0x5f2f('0x6d')]='Rejected';break;case _0x5f2f('0x70'):_0x788030['Call_Result']='Abandoned';break;case _0x5f2f('0x71'):_0x788030['Call_Result']='Timeout';default:}_0x788030[_0x5f2f('0x72')]=(_0x2245ad===_0x5f2f('0x73')?moment(_0x67015d[_0x5f2f('0x69')])[_0x5f2f('0x33')](_0x5f2f('0x6a')):moment(_0x67015d[_0x5f2f('0x74')])[_0x5f2f('0x33')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x5f2f('0x33')]('YYYY-MM-DDTHH:mm:ss');_0x788030['Call_Type']=_0x2245ad||_0x5f2f('0x75');_0x788030=_[_0x5f2f('0x76')](_0x788030,getCustomFields(_0x5a3cb2[_0x5f2f('0x77')],_0x67015d));return request({'method':_0x5f2f('0x27'),'uri':'https://www.zohoapis.'+_0x3ffe64+'/crm/v2/Calls','headers':{'Authorization':_0x5f2f('0x46')+_0x34e1a7},'body':{'data':[_0x788030]},'json':!![]})[_0x5f2f('0x34')](function(_0xccbcf4){if(_0xccbcf4&&_0xccbcf4[_0x5f2f('0x47')][0x0][_0x5f2f('0x48')]===_0x5f2f('0x49')){logger[_0x5f2f('0x30')]('Call\x20created!');return{'id':_0xccbcf4[_0x5f2f('0x47')][0x0][_0x5f2f('0x78')]['id']};}})[_0x5f2f('0x2d')](function(_0x43c4e8){logger[_0x5f2f('0x30')](_0x5f2f('0x79'),_0x43c4e8[_0x5f2f('0x2f')]);console[_0x5f2f('0x7a')](_0x5f2f('0x79'),_0x43c4e8);});}exports[_0x5f2f('0x7b')]=function(_0x2bac61,_0xbab5fe,_0x34ccf9,_0x117461,_0x1ca26c,_0x58f38e){var _0x16ea77,_0x2dae06,_0x9d3d88;_0x58f38e[_0x5f2f('0x7c')]=intUtil[_0x5f2f('0x7d')](_0x58f38e[_0x5f2f('0x7c')]);_0x58f38e[_0x5f2f('0x7e')]=intUtil[_0x5f2f('0x7d')](_0x58f38e['serverUrl']);if(_0x1ca26c&&_0x1ca26c[_0x5f2f('0x7f')]){logger[_0x5f2f('0x30')](_0x5f2f('0x80'),'Recording\x20is\x20enabled!');_0xbab5fe[_0x5f2f('0x81')]=_0x58f38e[_0x5f2f('0x7e')]+'/api/voice/recordings/'+_0xbab5fe[_0x5f2f('0x82')]+_0x5f2f('0x83')+md5(_0xbab5fe[_0x5f2f('0x82')]);}else{_0xbab5fe[_0x5f2f('0x81')]='';}var _0x582be9=_0x58f38e[_0x5f2f('0x7c')]===_0x5f2f('0x84')?'eu':_0x5f2f('0x85');return getAccessToken(_0x58f38e)[_0x5f2f('0x34')](function(_0xba287c){_0x9d3d88=_0xba287c;return getUser(_0x9d3d88,_0x582be9,_0x58f38e,_0x117461[_0x5f2f('0x38')]);})[_0x5f2f('0x34')](function(_0x3ba8a3){_0x16ea77=_0x3ba8a3;logger[_0x5f2f('0x30')](_0x5f2f('0x86'),_0x16ea77['id']);return getEndUser(_0x9d3d88,_0x582be9,_0x58f38e,_0xbab5fe[_0x5f2f('0x87')],_0xbab5fe[_0x5f2f('0x88')],_0x16ea77,_0x34ccf9);})[_0x5f2f('0x34')](function(_0x55f0c1){_0x2dae06=_0x55f0c1;return getCall(_0x9d3d88,_0x582be9,_0x58f38e,_0x16ea77,_0x2dae06,_0x34ccf9,_0xbab5fe,'Inbound');})['then'](function(_0xda0b2b){if(_0xda0b2b){logger[_0x5f2f('0x30')](_0x5f2f('0x89'),_0xda0b2b['id']);logger[_0x5f2f('0x30')](_0x5f2f('0x80'),_0x5f2f('0x8a'));emit(util['format'](_0x5f2f('0x8b'),_0x117461[_0x5f2f('0x1c')]),_0x5f2f('0x8c'),{'uri':'https://crm.'+_0x58f38e[_0x5f2f('0x7c')]+_0x5f2f('0x8d')+_0xda0b2b['id']});}})[_0x5f2f('0x2d')](function(_0x456d15){logger[_0x5f2f('0x2e')](_0x5f2f('0x80'),JSON[_0x5f2f('0x10')](_0x456d15));});};exports[_0x5f2f('0x73')]=function(_0x20b812,_0x3ca1e4,_0xd36af7,_0xf493d1,_0x4761d2,_0x43f37a,_0x27f91f){var _0x522429,_0x3f839e,_0xc3b76f;_0x43f37a[_0x5f2f('0x7c')]=intUtil[_0x5f2f('0x7d')](_0x43f37a[_0x5f2f('0x7c')]);_0x43f37a[_0x5f2f('0x7e')]=intUtil[_0x5f2f('0x7d')](_0x43f37a[_0x5f2f('0x7e')]);if(_0x27f91f&&_0x27f91f[_0x5f2f('0x8e')]&&_0x27f91f[_0x5f2f('0x8e')]!==_0x5f2f('0x8f')){logger[_0x5f2f('0x30')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3ca1e4['recordingURL']=_0x43f37a[_0x5f2f('0x7e')]+_0x5f2f('0x90')+_0x3ca1e4[_0x5f2f('0x82')]+_0x5f2f('0x83')+md5(_0x3ca1e4[_0x5f2f('0x82')]);}var _0x258114=_0x43f37a[_0x5f2f('0x7c')]===_0x5f2f('0x84')?'eu':'com';return getAccessToken(_0x43f37a)[_0x5f2f('0x34')](function(_0x238731){_0xc3b76f=_0x238731;return getUser(_0xc3b76f,_0x258114,_0x43f37a,_0xf493d1[_0x5f2f('0x38')]);})[_0x5f2f('0x34')](function(_0x12353b){_0x522429=_0x12353b;logger[_0x5f2f('0x30')](_0x5f2f('0x86'),_0x522429['id']);return getEndUser(_0xc3b76f,_0x258114,_0x43f37a,_0x3ca1e4[_0x5f2f('0x91')],_0x3ca1e4[_0x5f2f('0x92')],_0x522429,_0xd36af7);})['then'](function(_0x5951bb){_0x3f839e=_0x5951bb;return getCall(_0xc3b76f,_0x258114,_0x43f37a,_0x522429,_0x3f839e,_0xd36af7,_0x3ca1e4,_0x5f2f('0x93'));})[_0x5f2f('0x34')](function(_0x570ea5){if(_0x570ea5){logger[_0x5f2f('0x30')]('The\x20Call\x20ID\x20is:',_0x570ea5['id']);logger[_0x5f2f('0x30')]('[OUTBOUND]',_0x5f2f('0x8a'));emit(util['format'](_0x5f2f('0x8b'),_0xf493d1['name']),'trigger:browser:url',{'uri':_0x5f2f('0x94')+_0x43f37a['host']+_0x5f2f('0x8d')+_0x570ea5['id']});}})[_0x5f2f('0x2d')](function(_0x47aaed){logger[_0x5f2f('0x2e')]('[OUTBOUND]',JSON[_0x5f2f('0x10')](_0x47aaed));});};exports[_0x5f2f('0x95')]=function(_0x4f6e75,_0x3db1c9,_0x47338c,_0x530fd2,_0x1e155f,_0x521ada){var _0x395dc2,_0x4f6e9f,_0x389e02;_0x521ada[_0x5f2f('0x7c')]=intUtil['stripTrailingSlash'](_0x521ada[_0x5f2f('0x7c')]);_0x521ada['serverUrl']=intUtil[_0x5f2f('0x7d')](_0x521ada[_0x5f2f('0x7e')]);if(_0x1e155f&&_0x1e155f['monitor_format']){logger[_0x5f2f('0x30')]('['+_0x3db1c9[_0x5f2f('0x6b')]['toUpperCase']()+']',_0x5f2f('0x96'));_0x3db1c9['recordingURL']=_0x521ada[_0x5f2f('0x7e')]+'/api/voice/recordings/'+_0x3db1c9[_0x5f2f('0x82')]+_0x5f2f('0x83')+md5(_0x3db1c9[_0x5f2f('0x82')]);}else{_0x3db1c9[_0x5f2f('0x81')]='';}var _0x3448de=_0x521ada[_0x5f2f('0x7c')]==='zoho.eu'?'eu':_0x5f2f('0x85');return getAccessToken(_0x521ada)[_0x5f2f('0x34')](function(_0x1941b3){_0x389e02=_0x1941b3;return getUser(_0x389e02,_0x3448de,_0x521ada);})[_0x5f2f('0x34')](function(_0x38e6f5){_0x395dc2=_0x38e6f5;logger[_0x5f2f('0x30')](_0x5f2f('0x86'),_0x395dc2['id']);return getEndUser(_0x389e02,_0x3448de,_0x521ada,_0x3db1c9[_0x5f2f('0x87')],_0x3db1c9['calleridnum'],_0x395dc2,_0x47338c);})[_0x5f2f('0x34')](function(_0x3a7c5b){_0x4f6e9f=_0x3a7c5b;return getCall(_0x389e02,_0x3448de,_0x521ada,_0x395dc2,_0x4f6e9f,_0x47338c,_0x3db1c9,_0x5f2f('0x75'));})[_0x5f2f('0x34')](function(_0x5abc3d){if(_0x5abc3d){logger[_0x5f2f('0x30')](_0x5f2f('0x89'),_0x5abc3d['id']);}})['catch'](function(_0x3dacf3){logger[_0x5f2f('0x2e')]('['+_0x3db1c9[_0x5f2f('0x6b')][_0x5f2f('0x97')]()+']',JSON[_0x5f2f('0x10')](_0x3dacf3));});};
\ No newline at end of file
index a18691f..a37f6ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea36=['data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea36,0x182));var _0x6ea3=function(_0x1a0fdb,_0x2814fa){_0x1a0fdb=_0x1a0fdb-0x0;var _0x536c38=_0xea36[_0x1a0fdb];return _0x536c38;};'use strict';var util=require(_0x6ea3('0x0'));var sh=require(_0x6ea3('0x1'));var Mustache=require(_0x6ea3('0x2'));var logger=require(_0x6ea3('0x3'))(_0x6ea3('0x4'));exports[_0x6ea3('0x5')]=function(_0x5cfaff,_0x4a2659){var _0xbd997c=_0x5cfaff[_0x6ea3('0x6')]?_0x5cfaff[_0x6ea3('0x6')]:_0x6ea3('0x7');var _0x25b3dc=_0x5cfaff[_0x6ea3('0x8')]?Mustache[_0x6ea3('0x9')](_0x5cfaff['data3'],_0x4a2659):_0x4a2659;sh[_0x6ea3('0x5')](_0x25b3dc,function(_0x21475e,_0x5b871a,_0x17c8c0){if(_0x21475e!==0x0){logger[_0x6ea3('0xa')](util[_0x6ea3('0xb')](_0x6ea3('0xc'),_0xbd997c,_0x25b3dc,_0x21475e,_0x17c8c0));}else{logger['info'](util[_0x6ea3('0xb')](_0x6ea3('0xd'),_0xbd997c,_0x25b3dc,_0x5b871a));}});};
\ No newline at end of file
+var _0xcd72=['util','mustache','../../../../config/logger','trigger','exec','data2','Script','render','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x424e27,_0x28164e){var _0xaf8319=function(_0x17e919){while(--_0x17e919){_0x424e27['push'](_0x424e27['shift']());}};_0xaf8319(++_0x28164e);}(_0xcd72,0x180));var _0x2cd7=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0xcd72[_0x3b5ad9];return _0x611ae9;};'use strict';var util=require(_0x2cd7('0x0'));var sh=require('shelljs');var Mustache=require(_0x2cd7('0x1'));var logger=require(_0x2cd7('0x2'))(_0x2cd7('0x3'));exports[_0x2cd7('0x4')]=function(_0x24b374,_0xfe005d){var _0x5d42a2=_0x24b374[_0x2cd7('0x5')]?_0x24b374[_0x2cd7('0x5')]:_0x2cd7('0x6');var _0x13af31=_0x24b374['data3']?Mustache[_0x2cd7('0x7')](_0x24b374[_0x2cd7('0x8')],_0xfe005d):_0xfe005d;sh[_0x2cd7('0x4')](_0x13af31,function(_0x4453dc,_0x284ea5,_0x32f21a){if(_0x4453dc!==0x0){logger['error'](util['format'](_0x2cd7('0x9'),_0x5d42a2,_0x13af31,_0x4453dc,_0x32f21a));}else{logger[_0x2cd7('0xa')](util['format'](_0x2cd7('0xb'),_0x5d42a2,_0x13af31,_0x284ea5));}});};
\ No newline at end of file
index 900bde0..4d473dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f1f=['request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','render','data2','number','data5','headers','parse','data6','error','stack','data1','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','stringify','then','isNil',',\x20request\x20body:\x20','body','info','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x1f1f,0xa5));var _0xf1f1=function(_0x5a92ad,_0x2219a6){_0x5a92ad=_0x5a92ad-0x0;var _0x2466f8=_0x1f1f[_0x5a92ad];return _0x2466f8;};'use strict';var rp=require(_0xf1f1('0x0'));var util=require(_0xf1f1('0x1'));var _=require(_0xf1f1('0x2'));var Mustache=require(_0xf1f1('0x3'));var logger=require(_0xf1f1('0x4'))(_0xf1f1('0x5'));exports[_0xf1f1('0x6')]=function(_0x5ee6f9,_0x3da827){var _0x27d4a3,_0x1ffc2a;var _0x26d8f3={'method':_0x5ee6f9['data1'][_0xf1f1('0x7')](),'uri':Mustache[_0xf1f1('0x8')](_0x5ee6f9[_0xf1f1('0x9')],_0x3da827),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5ee6f9['data5'])===_0xf1f1('0xa')&&parseInt(_0x5ee6f9['data5'])>=0x1&&parseInt(_0x5ee6f9['data5'])<=0xa?parseInt(_0x5ee6f9[_0xf1f1('0xb')])*0x3e8:0x5*0x3e8};try{_0x26d8f3[_0xf1f1('0xc')]=_0x5ee6f9['data6']?JSON[_0xf1f1('0xd')](Mustache[_0xf1f1('0x8')](_0x5ee6f9[_0xf1f1('0xe')],_0x3da827)):{};}catch(_0x3dfcf9){logger[_0xf1f1('0xf')](_0x3dfcf9[_0xf1f1('0x10')]);}switch(_0x5ee6f9[_0xf1f1('0x11')][_0xf1f1('0x7')]()){case'GET':case _0xf1f1('0x12'):_0x27d4a3=null;_0x26d8f3['qs']=_0x3da827;break;case _0xf1f1('0x13'):case _0xf1f1('0x14'):if(_0x5ee6f9[_0xf1f1('0x15')]){try{_0x27d4a3=JSON['parse'](Mustache[_0xf1f1('0x8')](_0x5ee6f9[_0xf1f1('0x15')],_0x3da827));_0x26d8f3['body']=_0x27d4a3;}catch(_0x5cd182){logger[_0xf1f1('0xf')](_0x5cd182[_0xf1f1('0x10')]);logger[_0xf1f1('0xf')](_0xf1f1('0x16'));}}else{_0x27d4a3=_0x3da827;_0x26d8f3['body']=_0x27d4a3;}break;}logger['info'](util[_0xf1f1('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x5ee6f9['data1'],_0x5ee6f9[_0xf1f1('0x9')],JSON[_0xf1f1('0x18')](_0x26d8f3)));rp(_0x26d8f3)[_0xf1f1('0x19')](function(_0x45c5f1){_0x27d4a3=!_[_0xf1f1('0x1a')](_0x27d4a3)?_0xf1f1('0x1b')+_0x27d4a3:'';_0x1ffc2a=typeof _0x45c5f1['body']==='object'?JSON['stringify'](_0x45c5f1[_0xf1f1('0x1c')]):_0x45c5f1[_0xf1f1('0x1c')];logger[_0xf1f1('0x1d')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x5ee6f9[_0xf1f1('0x11')],_0x5ee6f9[_0xf1f1('0x9')],_0x45c5f1['statusCode'],_0x1ffc2a));})[_0xf1f1('0x1e')](function(_0x1cb2ab){logger[_0xf1f1('0xf')](util['format'](_0xf1f1('0x1f'),_0x5ee6f9[_0xf1f1('0x11')],_0x5ee6f9[_0xf1f1('0x9')],_0x1cb2ab['statusCode'],_0x1cb2ab[_0xf1f1('0x20')],_0x1cb2ab['message']));});};
\ No newline at end of file
+var _0x0570=['info','then','isNil',',\x20request\x20body:\x20','object','stringify','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','util','lodash','mustache','../../../../config/logger','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','data1','GET','DELETE','POST','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body'];(function(_0x3e6ff9,_0x15f2e9){var _0x27e5b8=function(_0x2c3269){while(--_0x2c3269){_0x3e6ff9['push'](_0x3e6ff9['shift']());}};_0x27e5b8(++_0x15f2e9);}(_0x0570,0x1ab));var _0x0057=function(_0x588370,_0x40e2d6){_0x588370=_0x588370-0x0;var _0x285cd3=_0x0570[_0x588370];return _0x285cd3;};'use strict';var rp=require('request-promise');var util=require(_0x0057('0x0'));var _=require(_0x0057('0x1'));var Mustache=require(_0x0057('0x2'));var logger=require(_0x0057('0x3'))('trigger');exports['exec']=function(_0x446893,_0x516157){var _0x3d8711,_0x33d3e6;var _0x3bcd60={'method':_0x446893['data1'][_0x0057('0x4')](),'uri':Mustache[_0x0057('0x5')](_0x446893[_0x0057('0x6')],_0x516157),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x446893[_0x0057('0x7')])===_0x0057('0x8')&&parseInt(_0x446893[_0x0057('0x7')])>=0x1&&parseInt(_0x446893[_0x0057('0x7')])<=0xa?parseInt(_0x446893['data5'])*0x3e8:0x5*0x3e8};try{_0x3bcd60[_0x0057('0x9')]=_0x446893[_0x0057('0xa')]?JSON[_0x0057('0xb')](Mustache[_0x0057('0x5')](_0x446893[_0x0057('0xa')],_0x516157)):{};}catch(_0x5c402f){logger[_0x0057('0xc')](_0x5c402f[_0x0057('0xd')]);}switch(_0x446893[_0x0057('0xe')][_0x0057('0x4')]()){case _0x0057('0xf'):case _0x0057('0x10'):_0x3d8711=null;_0x3bcd60['qs']=_0x516157;break;case _0x0057('0x11'):case'PUT':if(_0x446893[_0x0057('0x12')]){try{_0x3d8711=JSON[_0x0057('0xb')](Mustache[_0x0057('0x5')](_0x446893[_0x0057('0x12')],_0x516157));_0x3bcd60['body']=_0x3d8711;}catch(_0x3751d2){logger['error'](_0x3751d2[_0x0057('0xd')]);logger[_0x0057('0xc')](_0x0057('0x13'));}}else{_0x3d8711=_0x516157;_0x3bcd60[_0x0057('0x14')]=_0x3d8711;}break;}logger[_0x0057('0x15')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x446893['data1'],_0x446893[_0x0057('0x6')],JSON['stringify'](_0x3bcd60)));rp(_0x3bcd60)[_0x0057('0x16')](function(_0x540776){_0x3d8711=!_[_0x0057('0x17')](_0x3d8711)?_0x0057('0x18')+_0x3d8711:'';_0x33d3e6=typeof _0x540776['body']===_0x0057('0x19')?JSON[_0x0057('0x1a')](_0x540776[_0x0057('0x14')]):_0x540776[_0x0057('0x14')];logger[_0x0057('0x15')](util[_0x0057('0x1b')](_0x0057('0x1c'),_0x446893[_0x0057('0xe')],_0x446893['data2'],_0x540776[_0x0057('0x1d')],_0x33d3e6));})['catch'](function(_0x936128){logger[_0x0057('0xc')](util[_0x0057('0x1b')](_0x0057('0x1e'),_0x446893[_0x0057('0xe')],_0x446893[_0x0057('0x6')],_0x936128[_0x0057('0x1d')],_0x936128[_0x0057('0x1f')],_0x936128['message']));});};
\ No newline at end of file
index 122f449..f1fc478 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0001=['error','message','result','catch','exports','bluebird','client','http','Request','request','then','debug','rpc','routing'];(function(_0x22ab22,_0x464d57){var _0x1e37a3=function(_0x1822c5){while(--_0x1822c5){_0x22ab22['push'](_0x22ab22['shift']());}};_0x1e37a3(++_0x464d57);}(_0x0001,0x9f));var _0x1000=function(_0x5d18ba,_0x172772){_0x5d18ba=_0x5d18ba-0x0;var _0x4f3494=_0x0001[_0x5d18ba];return _0x4f3494;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1000('0x0'));var logger=require('../../config/logger')('routing');var client=jayson[_0x1000('0x1')][_0x1000('0x2')]({'port':0x2329});client[_0x1000('0x3')]=function(_0x372e36,_0x52e262){return new BPromise(function(_0x52f129,_0x16edfc){return client[_0x1000('0x4')](_0x372e36,_0x52e262)[_0x1000('0x5')](function(_0x5440b7){logger[_0x1000('0x6')](_0x1000('0x7'),_0x1000('0x8'),_0x372e36,_0x52e262,_0x5440b7);if(_0x5440b7['error']){logger['error']('rpc',_0x1000('0x8'),_0x372e36,_0x5440b7[_0x1000('0x9')][_0x1000('0xa')],_0x52e262);return _0x16edfc(_0x5440b7['error'][_0x1000('0xa')]);}else{return _0x52f129(_0x5440b7[_0x1000('0xb')]);}})[_0x1000('0xc')](function(_0xa9bfa2){logger[_0x1000('0x9')](_0x1000('0x7'),_0x1000('0x8'),_0x372e36,_0xa9bfa2,_0x52e262);return _0x16edfc(_0xa9bfa2);});});};module[_0x1000('0xd')]=client;
\ No newline at end of file
+var _0xba4d=['exports','jayson/promise','bluebird','../../config/logger','then','rpc','error','routing','message','result','catch'];(function(_0x40f109,_0x1fb273){var _0x2c8974=function(_0x2044bc){while(--_0x2044bc){_0x40f109['push'](_0x40f109['shift']());}};_0x2c8974(++_0x1fb273);}(_0xba4d,0x1da));var _0xdba4=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xba4d[_0x152121];return _0x592a85;};'use strict';var jayson=require(_0xdba4('0x0'));var BPromise=require(_0xdba4('0x1'));var logger=require(_0xdba4('0x2'))('routing');var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x3f28f,_0x3bfbcd){return new BPromise(function(_0x463f8c,_0xa3395d){return client['request'](_0x3f28f,_0x3bfbcd)[_0xdba4('0x3')](function(_0x2714e7){logger['debug'](_0xdba4('0x4'),'routing',_0x3f28f,_0x3bfbcd,_0x2714e7);if(_0x2714e7[_0xdba4('0x5')]){logger[_0xdba4('0x5')](_0xdba4('0x4'),_0xdba4('0x6'),_0x3f28f,_0x2714e7['error'][_0xdba4('0x7')],_0x3bfbcd);return _0xa3395d(_0x2714e7[_0xdba4('0x5')][_0xdba4('0x7')]);}else{return _0x463f8c(_0x2714e7[_0xdba4('0x8')]);}})[_0xdba4('0x9')](function(_0x56659f){logger[_0xdba4('0x5')](_0xdba4('0x4'),'routing',_0x3f28f,_0x56659f,_0x3bfbcd);return _0xa3395d(_0x56659f);});});};module[_0xdba4('0xa')]=client;
\ No newline at end of file
index 693e2a0..04c0d72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4eab=['getSettings','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','getMailAccounts','then','initMailAccounts','refresh','listen'];(function(_0x6e0e75,_0x1c3621){var _0x15fe54=function(_0x44ff18){while(--_0x44ff18){_0x6e0e75['push'](_0x6e0e75['shift']());}};_0x15fe54(++_0x1c3621);}(_0x4eab,0x194));var _0xb4ea=function(_0x1d1513,_0x51aa82){_0x1d1513=_0x1d1513-0x0;var _0x16ea2d=_0x4eab[_0x1d1513];return _0x16ea2d;};'use strict';var BPromise=require(_0xb4ea('0x0'));var server=require(_0xb4ea('0x1'));var Realtime=require(_0xb4ea('0x2'));var EmailChannel=require(_0xb4ea('0x3'));var mailAccount=require(_0xb4ea('0x4'));var setting=require(_0xb4ea('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xb4ea('0x6')]()['then'](mailAccount[_0xb4ea('0x7')]())[_0xb4ea('0x8')](realtime[_0xb4ea('0x9')]())[_0xb4ea('0x8')](function(){email[_0xb4ea('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xb4ea('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0xb4ea('0x8')](function(){return setting[_0xb4ea('0xc')]();})[_0xb4ea('0x8')](function(_0x8b3fa0){return setInterval(initRealtime,_0x8b3fa0[_0xb4ea('0xd')]*0x3e8);})[_0xb4ea('0xe')](function(_0x10c7ff){console[_0xb4ea('0xf')](_0x10c7ff);});}main();
\ No newline at end of file
+var _0xc542=['catch','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','then','initMailAccounts','refresh','listen','getSettings','loginMailFrequency'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0xc542,0xd1));var _0x2c54=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xc542[_0xbb091];return _0x467a04;};'use strict';var BPromise=require(_0x2c54('0x0'));var server=require(_0x2c54('0x1'));var Realtime=require(_0x2c54('0x2'));var EmailChannel=require(_0x2c54('0x3'));var mailAccount=require(_0x2c54('0x4'));var setting=require(_0x2c54('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()['then'](mailAccount['getMailAccounts']())[_0x2c54('0x6')](realtime[_0x2c54('0x7')]())['then'](function(){email[_0x2c54('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x2c54('0x9')](realtime,email)[_0x2c54('0x6')](function(){return initRealtime();})[_0x2c54('0x6')](function(){return setting[_0x2c54('0xa')]();})['then'](function(_0x340a66){return setInterval(initRealtime,_0x340a66[_0x2c54('0xb')]*0x3e8);})[_0x2c54('0xc')](function(_0x15f751){console['log'](_0x15f751);});}main();
\ No newline at end of file
index 481b2da..08c92ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46f3=['hasOwnProperty','box','handleImapBox','bind','end','handleImapEnd','handleImapError','status','disabled','messageStatus','connected','name','messages','total','handleImapEmail','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','send','verifySmtp','Smtp','verify','error','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','isNil','mailAccount:update'];(function(_0x406696,_0x39f9b1){var _0x10e35c=function(_0x108de3){while(--_0x108de3){_0x406696['push'](_0x406696['shift']());}};_0x10e35c(++_0x39f9b1);}(_0x46f3,0x126));var _0x346f=function(_0x41d1ce,_0x2e0480){_0x41d1ce=_0x41d1ce-0x0;var _0x49d992=_0x46f3[_0x41d1ce];return _0x49d992;};'use strict';var _=require(_0x346f('0x0'));var moment=require(_0x346f('0x1'));var BPromise=require('bluebird');var md5=require(_0x346f('0x2'));var Redis=require(_0x346f('0x3'));var config=require(_0x346f('0x4'));var logger=require(_0x346f('0x5'))(_0x346f('0x6'));config[_0x346f('0x7')]=_[_0x346f('0x8')](config['redis'],{'host':_0x346f('0x9'),'port':0x18eb});var io=require(_0x346f('0xa'))(new Redis(config[_0x346f('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0x346f('0xb'));var md5Accounts={};function EmailChannel(_0x21336e){logger[_0x346f('0xc')](_0x346f('0xd'));this[_0x346f('0xe')]=_0x21336e[_0x346f('0xe')];this[_0x346f('0xf')]={};this[_0x346f('0x10')]=new EmailSmtp();}EmailChannel[_0x346f('0x11')][_0x346f('0x12')]=function(_0x1cbd66){var _0x48dad9=this[_0x346f('0xe')][_0x1cbd66];var _0x4eee0a={'id':_0x48dad9['id'],'name':_0x48dad9['name'],'key':_0x48dad9[_0x346f('0x13')],'active':_0x48dad9[_0x346f('0x14')],'Imap':{'status':_0x48dad9[_0x346f('0x15')]['status'],'messageStatus':_0x48dad9[_0x346f('0x15')]['messageStatus'],'total':_0x48dad9[_0x346f('0x15')]['total']}};if(_[_0x346f('0x16')](md5Accounts[_0x1cbd66])){md5Accounts[_0x1cbd66]={};}var _0x36e176=md5(JSON['stringify'](_0x4eee0a));if(md5Accounts[_0x1cbd66]['md5']!==_0x36e176){md5Accounts[_0x1cbd66][_0x346f('0x2')]=_0x36e176;io[_0x346f('0x12')](_0x346f('0x17'),_0x4eee0a);}};EmailChannel['prototype']['refresh']=function(_0x4feacc){for(var _0xc44565 in _0x4feacc){if(_0x4feacc[_0x346f('0x18')](_0xc44565)){if(_0x4feacc[_0xc44565][_0x346f('0x15')]&&_0x4feacc[_0xc44565][_0x346f('0x14')]){var _0x342aea=_0x4feacc[_0xc44565][_0x346f('0x15')];if(!this[_0x346f('0xf')][_0x346f('0x18')](_0x342aea['id'])){this[_0x346f('0xf')][_0x342aea['id']]=new EmailImap(_0x342aea,_0x4feacc[_0xc44565][_0x346f('0x6')]);this[_0x346f('0xf')][_0x342aea['id']]['on'](_0x346f('0x19'),this[_0x346f('0x1a')]['bind'](this,_0xc44565));this[_0x346f('0xf')][_0x342aea['id']]['on'](_0x346f('0x6'),this['handleImapEmail'][_0x346f('0x1b')](this,_0xc44565));this[_0x346f('0xf')][_0x342aea['id']]['on'](_0x346f('0x1c'),this[_0x346f('0x1d')][_0x346f('0x1b')](this,_0xc44565));this[_0x346f('0xf')][_0x342aea['id']]['on']('error',this[_0x346f('0x1e')][_0x346f('0x1b')](this,_0xc44565));}}else{if(_['isNil'](this['mailAccounts'][_0xc44565][_0x346f('0x15')])){this['mailAccounts'][_0xc44565][_0x346f('0x15')]={};}this[_0x346f('0xe')][_0xc44565]['Imap'][_0x346f('0x1f')]=_0x346f('0x20');this[_0x346f('0xe')][_0xc44565]['Imap'][_0x346f('0x21')]='';this[_0x346f('0x12')](_0xc44565);}}}};EmailChannel[_0x346f('0x11')]['handleImapBox']=function(_0x3d2144,_0x59ce6f){if(this['mailAccounts'][_0x3d2144]){this[_0x346f('0xe')][_0x3d2144][_0x346f('0x15')][_0x346f('0x1f')]=_0x346f('0x22');this[_0x346f('0xe')][_0x3d2144][_0x346f('0x15')][_0x346f('0x21')]=_0x59ce6f[_0x346f('0x23')];if(_0x59ce6f[_0x346f('0x24')]){this[_0x346f('0xe')][_0x3d2144][_0x346f('0x15')]['total']=_0x59ce6f[_0x346f('0x24')][_0x346f('0x25')];}return this['emit'](_0x3d2144);}};EmailChannel[_0x346f('0x11')][_0x346f('0x26')]=function(_0x3dd214,_0x18380f){logger[_0x346f('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x18380f['firstName'],_0x18380f[_0x346f('0x27')],_0x18380f[_0x346f('0x28')],_0x3dd214);if(this[_0x346f('0xe')][_0x3dd214]){return mailAccount[_0x346f('0x29')](_0x3dd214,_0x18380f)[_0x346f('0x2a')](function(_0x134d36){if(_0x134d36){logger[_0x346f('0xc')](_0x346f('0x2b'));}})[_0x346f('0x2c')](function(_0x57ab76){logger['error'](_0x346f('0x2d'),JSON[_0x346f('0x2e')](_0x57ab76));});}};EmailChannel[_0x346f('0x11')][_0x346f('0x1d')]=function(_0x37f05f){if(this['mailAccounts'][_0x37f05f]&&this[_0x346f('0xe')][_0x37f05f]['Imap']){if(this[_0x346f('0xf')][this[_0x346f('0xe')][_0x37f05f]['Imap']['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x37f05f][_0x346f('0x15')]['id']];}this[_0x346f('0xe')][_0x37f05f][_0x346f('0x15')]['lastSync']=moment();this[_0x346f('0x12')](_0x37f05f);}};EmailChannel[_0x346f('0x11')]['handleImapError']=function(_0x1cdb5a,_0x16d48d){if(this[_0x346f('0xe')][_0x1cdb5a]){this[_0x346f('0xe')][_0x1cdb5a]['Imap'][_0x346f('0x1f')]='error';this[_0x346f('0xe')][_0x1cdb5a][_0x346f('0x15')][_0x346f('0x21')]=_0x16d48d;return this[_0x346f('0x12')](_0x1cdb5a);}};EmailChannel[_0x346f('0x11')]['sendMail']=function(_0x448cf1,_0x32b9ef){return this[_0x346f('0x10')][_0x346f('0x2f')](_0x448cf1,_0x32b9ef);};EmailChannel[_0x346f('0x11')][_0x346f('0x30')]=function(_0x1764c4){var _0x404dfe=this;if(this[_0x346f('0xe')][_0x1764c4['id']]){if(_[_0x346f('0x16')](this[_0x346f('0xe')][_0x1764c4['id']][_0x346f('0x31')])){this[_0x346f('0xe')][_0x1764c4['id']][_0x346f('0x31')]={};}this['mailAccounts'][_0x1764c4['id']][_0x346f('0x31')]['lastSync']=moment();return new BPromise(function(_0x590251,_0x413dd2){return _0x404dfe[_0x346f('0x10')][_0x346f('0x32')](_0x1764c4)[_0x346f('0x2a')](function(_0x20395e){_0x404dfe[_0x346f('0xe')][_0x1764c4['id']]['Smtp'][_0x346f('0x1f')]='verified';_0x404dfe[_0x346f('0xe')][_0x1764c4['id']][_0x346f('0x31')][_0x346f('0x21')]='';_0x404dfe[_0x346f('0x12')](_0x1764c4['id']);_0x590251(_0x20395e);})['catch'](function(_0x466146){_0x404dfe['mailAccounts'][_0x1764c4['id']][_0x346f('0x31')][_0x346f('0x1f')]=_0x346f('0x33');_0x404dfe['mailAccounts'][_0x1764c4['id']][_0x346f('0x31')][_0x346f('0x21')]=_0x466146;_0x404dfe['emit'](_0x1764c4['id']);_0x413dd2(_0x466146);});});}return this[_0x346f('0x10')][_0x346f('0x32')](_0x1764c4);};module[_0x346f('0x34')]=EmailChannel;
\ No newline at end of file
+var _0x80e4=['bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','name','key','active','Imap','status','total','isNil','stringify','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','disabled','messageStatus','messages','prototype','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapError','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','catch','exports','lodash','moment'];(function(_0x2b3027,_0x2a227d){var _0x5cbc7b=function(_0x550cea){while(--_0x550cea){_0x2b3027['push'](_0x2b3027['shift']());}};_0x5cbc7b(++_0x2a227d);}(_0x80e4,0x1c6));var _0x480e=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0x80e4[_0x5f46e7];return _0x567e95;};'use strict';var _=require(_0x480e('0x0'));var moment=require(_0x480e('0x1'));var BPromise=require(_0x480e('0x2'));var md5=require(_0x480e('0x3'));var Redis=require('ioredis');var config=require(_0x480e('0x4'));var logger=require(_0x480e('0x5'))(_0x480e('0x6'));config[_0x480e('0x7')]=_[_0x480e('0x8')](config['redis'],{'host':_0x480e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x480e('0xa'));var EmailSmtp=require(_0x480e('0xb'));var mailAccount=require(_0x480e('0xc'));var md5Accounts={};function EmailChannel(_0x710cb7){logger[_0x480e('0xd')](_0x480e('0xe'));this[_0x480e('0xf')]=_0x710cb7['mailAccounts'];this[_0x480e('0x10')]={};this[_0x480e('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0x480e('0x12')]=function(_0x452a67){var _0x584e69=this[_0x480e('0xf')][_0x452a67];var _0x163791={'id':_0x584e69['id'],'name':_0x584e69[_0x480e('0x13')],'key':_0x584e69[_0x480e('0x14')],'active':_0x584e69[_0x480e('0x15')],'Imap':{'status':_0x584e69[_0x480e('0x16')][_0x480e('0x17')],'messageStatus':_0x584e69[_0x480e('0x16')]['messageStatus'],'total':_0x584e69[_0x480e('0x16')][_0x480e('0x18')]}};if(_[_0x480e('0x19')](md5Accounts[_0x452a67])){md5Accounts[_0x452a67]={};}var _0x4c867a=md5(JSON[_0x480e('0x1a')](_0x163791));if(md5Accounts[_0x452a67][_0x480e('0x3')]!==_0x4c867a){md5Accounts[_0x452a67][_0x480e('0x3')]=_0x4c867a;io[_0x480e('0x12')]('mailAccount:update',_0x163791);}};EmailChannel['prototype'][_0x480e('0x1b')]=function(_0x31419e){for(var _0x1a05b3 in _0x31419e){if(_0x31419e['hasOwnProperty'](_0x1a05b3)){if(_0x31419e[_0x1a05b3]['Imap']&&_0x31419e[_0x1a05b3][_0x480e('0x15')]){var _0xa253de=_0x31419e[_0x1a05b3][_0x480e('0x16')];if(!this['imapAccounts'][_0x480e('0x1c')](_0xa253de['id'])){this['imapAccounts'][_0xa253de['id']]=new EmailImap(_0xa253de,_0x31419e[_0x1a05b3][_0x480e('0x6')]);this['imapAccounts'][_0xa253de['id']]['on'](_0x480e('0x1d'),this[_0x480e('0x1e')][_0x480e('0x1f')](this,_0x1a05b3));this['imapAccounts'][_0xa253de['id']]['on'](_0x480e('0x6'),this[_0x480e('0x20')][_0x480e('0x1f')](this,_0x1a05b3));this[_0x480e('0x10')][_0xa253de['id']]['on'](_0x480e('0x21'),this[_0x480e('0x22')]['bind'](this,_0x1a05b3));this[_0x480e('0x10')][_0xa253de['id']]['on']('error',this['handleImapError'][_0x480e('0x1f')](this,_0x1a05b3));}}else{if(_[_0x480e('0x19')](this[_0x480e('0xf')][_0x1a05b3][_0x480e('0x16')])){this['mailAccounts'][_0x1a05b3][_0x480e('0x16')]={};}this['mailAccounts'][_0x1a05b3][_0x480e('0x16')]['status']=_0x480e('0x23');this[_0x480e('0xf')][_0x1a05b3][_0x480e('0x16')][_0x480e('0x24')]='';this[_0x480e('0x12')](_0x1a05b3);}}}};EmailChannel['prototype'][_0x480e('0x1e')]=function(_0x5cb13c,_0x1839c3){if(this['mailAccounts'][_0x5cb13c]){this['mailAccounts'][_0x5cb13c][_0x480e('0x16')][_0x480e('0x17')]='connected';this[_0x480e('0xf')][_0x5cb13c][_0x480e('0x16')]['messageStatus']=_0x1839c3[_0x480e('0x13')];if(_0x1839c3[_0x480e('0x25')]){this[_0x480e('0xf')][_0x5cb13c][_0x480e('0x16')][_0x480e('0x18')]=_0x1839c3[_0x480e('0x25')][_0x480e('0x18')];}return this[_0x480e('0x12')](_0x5cb13c);}};EmailChannel[_0x480e('0x26')][_0x480e('0x20')]=function(_0x31e06e,_0x5ba082){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5ba082[_0x480e('0x27')],_0x5ba082[_0x480e('0x28')],_0x5ba082[_0x480e('0x29')],_0x31e06e);if(this[_0x480e('0xf')][_0x31e06e]){return mailAccount[_0x480e('0x2a')](_0x31e06e,_0x5ba082)[_0x480e('0x2b')](function(_0x1a0457){if(_0x1a0457){logger[_0x480e('0xd')](_0x480e('0x2c'));}})['catch'](function(_0x22defb){logger[_0x480e('0x2d')](_0x480e('0x2e'),JSON[_0x480e('0x1a')](_0x22defb));});}};EmailChannel[_0x480e('0x26')][_0x480e('0x22')]=function(_0x3a8377){if(this[_0x480e('0xf')][_0x3a8377]&&this['mailAccounts'][_0x3a8377][_0x480e('0x16')]){if(this[_0x480e('0x10')][this['mailAccounts'][_0x3a8377][_0x480e('0x16')]['id']]){delete this[_0x480e('0x10')][this[_0x480e('0xf')][_0x3a8377][_0x480e('0x16')]['id']];}this[_0x480e('0xf')][_0x3a8377][_0x480e('0x16')]['lastSync']=moment();this['emit'](_0x3a8377);}};EmailChannel[_0x480e('0x26')][_0x480e('0x2f')]=function(_0x56c63c,_0xe0fc03){if(this[_0x480e('0xf')][_0x56c63c]){this['mailAccounts'][_0x56c63c][_0x480e('0x16')]['status']=_0x480e('0x2d');this[_0x480e('0xf')][_0x56c63c][_0x480e('0x16')][_0x480e('0x24')]=_0xe0fc03;return this[_0x480e('0x12')](_0x56c63c);}};EmailChannel[_0x480e('0x26')][_0x480e('0x30')]=function(_0x5cb472,_0x1804f7){return this[_0x480e('0x11')][_0x480e('0x31')](_0x5cb472,_0x1804f7);};EmailChannel[_0x480e('0x26')][_0x480e('0x32')]=function(_0x4c558e){var _0x56d280=this;if(this[_0x480e('0xf')][_0x4c558e['id']]){if(_[_0x480e('0x19')](this['mailAccounts'][_0x4c558e['id']][_0x480e('0x33')])){this[_0x480e('0xf')][_0x4c558e['id']][_0x480e('0x33')]={};}this['mailAccounts'][_0x4c558e['id']][_0x480e('0x33')][_0x480e('0x34')]=moment();return new BPromise(function(_0x52d1f9,_0x556f93){return _0x56d280[_0x480e('0x11')][_0x480e('0x35')](_0x4c558e)[_0x480e('0x2b')](function(_0x59f5ca){_0x56d280['mailAccounts'][_0x4c558e['id']][_0x480e('0x33')][_0x480e('0x17')]=_0x480e('0x36');_0x56d280[_0x480e('0xf')][_0x4c558e['id']]['Smtp'][_0x480e('0x24')]='';_0x56d280['emit'](_0x4c558e['id']);_0x52d1f9(_0x59f5ca);})[_0x480e('0x37')](function(_0x55c5ea){_0x56d280[_0x480e('0xf')][_0x4c558e['id']]['Smtp'][_0x480e('0x17')]=_0x480e('0x2d');_0x56d280['mailAccounts'][_0x4c558e['id']][_0x480e('0x33')][_0x480e('0x24')]=_0x55c5ea;_0x56d280[_0x480e('0x12')](_0x4c558e['id']);_0x556f93(_0x55c5ea);});});}return this[_0x480e('0x11')][_0x480e('0x35')](_0x4c558e);};module[_0x480e('0x38')]=EmailChannel;
\ No newline at end of file
index dbcdd29..1b1e65c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ef=['Iconv','EventEmitter','./utils','../../../config/logger','email','INBOX','getAccount','account','once','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','anonymous@xcally.com','openBox','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','stringify','textCode','upperFirst','path','util','imap','lodash','randomstring','mailparser','iconv'];(function(_0x7ceae0,_0x21d8e6){var _0x4b3e3b=function(_0x33f8eb){while(--_0x33f8eb){_0x7ceae0['push'](_0x7ceae0['shift']());}};_0x4b3e3b(++_0x21d8e6);}(_0x32ef,0xf9));var _0xf32e=function(_0x59fbd4,_0x1a50dc){_0x59fbd4=_0x59fbd4-0x0;var _0xc82c5e=_0x32ef[_0x59fbd4];return _0xc82c5e;};'use strict';var fs=require('fs');var path=require(_0xf32e('0x0'));var util=require(_0xf32e('0x1'));var Imap=require(_0xf32e('0x2'));var _=require(_0xf32e('0x3'));var rs=require(_0xf32e('0x4'));var simpleParser=require(_0xf32e('0x5'))['simpleParser'];var Iconv=require(_0xf32e('0x6'))[_0xf32e('0x7')];var EventEmitter=require('events')[_0xf32e('0x8')];var utils=require(_0xf32e('0x9'));var logger=require(_0xf32e('0xa'))(_0xf32e('0xb'));function EmailImap(_0xefc0a7,_0x899efc){this['mailbox']=_0xf32e('0xc');this['account']=this[_0xf32e('0xd')](_0xefc0a7,_0x899efc);this[_0xf32e('0x2')]=new Imap(this[_0xf32e('0xe')]);this[_0xf32e('0x2')][_0xf32e('0xf')]('ready',this[_0xf32e('0x10')][_0xf32e('0x11')](this));this[_0xf32e('0x2')][_0xf32e('0xf')](_0xf32e('0x12'),this[_0xf32e('0x13')][_0xf32e('0x11')](this));this[_0xf32e('0x2')]['on'](_0xf32e('0x14'),this[_0xf32e('0x15')][_0xf32e('0x11')](this));this['imap'][_0xf32e('0x16')]();}util[_0xf32e('0x17')](EmailImap,EventEmitter);EmailImap[_0xf32e('0x18')][_0xf32e('0xd')]=function(_0x35988d,_0x458002){var _0x5c5ab7={'connTimeout':_0x35988d[_0xf32e('0x19')]?_0x35988d[_0xf32e('0x19')]*0x3e8:0x2710,'authTimeout':_0x35988d[_0xf32e('0x1a')]?_0x35988d[_0xf32e('0x1a')]*0x3e8:0x1388};if(_[_0xf32e('0x1b')](_0x35988d[_0xf32e('0x1c')])){if(_0x35988d[_0xf32e('0x1d')]){_0x5c5ab7[_0xf32e('0x1e')]=_0x35988d[_0xf32e('0x1e')];_0x5c5ab7['password']=_0x35988d[_0xf32e('0x1f')];}_0x5c5ab7[_0xf32e('0x20')]=_0x35988d[_0xf32e('0x20')];_0x5c5ab7[_0xf32e('0x21')]=_0x35988d[_0xf32e('0x21')]||0x3e1;if(_0x35988d[_0xf32e('0x22')]){_0x5c5ab7[_0xf32e('0x22')]=!![];}else{_0x5c5ab7[_0xf32e('0x22')]=![];_0x5c5ab7[_0xf32e('0x23')]=_0xf32e('0x24');}}else{_0x5c5ab7[_0xf32e('0x1e')]=_0x35988d[_0xf32e('0x1e')];_0x5c5ab7[_0xf32e('0x1f')]=_0x35988d[_0xf32e('0x1f')];_0x5c5ab7[_0xf32e('0x20')]=utils['getHost'](_0x35988d[_0xf32e('0x1c')]);_0x5c5ab7['port']=0x3e1;_0x5c5ab7[_0xf32e('0x22')]=!![];}_0x5c5ab7[_0xf32e('0xb')]=_0x458002||_0x35988d[_0xf32e('0x1e')]||_0xf32e('0x25');return _0x5c5ab7;};EmailImap[_0xf32e('0x18')]['handleReady']=function(){this[_0xf32e('0x2')][_0xf32e('0x26')](this[_0xf32e('0x27')],![],this[_0xf32e('0x28')]['bind'](this));};EmailImap[_0xf32e('0x18')][_0xf32e('0x28')]=function(_0x2e8c34,_0xe0a285){if(_0x2e8c34){this[_0xf32e('0x15')](_0x2e8c34,!![]);}else{this[_0xf32e('0x29')](_0xf32e('0x2a'),_0xe0a285);this[_0xf32e('0x2b')]();}};EmailImap[_0xf32e('0x18')][_0xf32e('0x2c')]=function(_0x488489){if(_0x488489){this[_0xf32e('0x15')](_0x488489,!![]);}else{this[_0xf32e('0x2')][_0xf32e('0x12')]();}};EmailImap['prototype'][_0xf32e('0x2b')]=function(){this['imap'][_0xf32e('0x2d')](['UNSEEN'],this[_0xf32e('0x2e')][_0xf32e('0x11')](this));};EmailImap[_0xf32e('0x18')][_0xf32e('0x2e')]=function(_0x32a74b,_0x4e64d4){if(_0x32a74b){this[_0xf32e('0x15')](_0x32a74b,!![]);}else{if(_0x4e64d4[_0xf32e('0x2f')]){try{var _0x175096=this['imap'][_0xf32e('0x30')](_0x4e64d4,{'bodies':'','markSeen':!![]});_0x175096['on'](_0xf32e('0x31'),this[_0xf32e('0x32')][_0xf32e('0x11')](this));_0x175096[_0xf32e('0xf')](_0xf32e('0x14'),this[_0xf32e('0x33')][_0xf32e('0x11')](this));_0x175096[_0xf32e('0xf')](_0xf32e('0x12'),this[_0xf32e('0x34')][_0xf32e('0x11')](this));}catch(_0xe36079){logger['error'](_0xe36079);}}else{this[_0xf32e('0x2')]['closeBox'](!![],this[_0xf32e('0x2c')]['bind'](this));}}};EmailImap['prototype'][_0xf32e('0x32')]=function(_0x300013,_0x37231c){_0x300013['on'](_0xf32e('0x35'),this[_0xf32e('0x36')]['bind'](this));_0x300013[_0xf32e('0xf')](_0xf32e('0x37'),this[_0xf32e('0x38')][_0xf32e('0x11')](this));_0x300013['once'](_0xf32e('0x12'),this[_0xf32e('0x39')][_0xf32e('0x11')](this));};EmailImap[_0xf32e('0x18')][_0xf32e('0x36')]=function(_0x576f37,_0xb5e9a6){simpleParser(_0x576f37,{'Iconv':Iconv},this[_0xf32e('0x3a')][_0xf32e('0x11')](this));};EmailImap['prototype'][_0xf32e('0x38')]=function(_0x53b641){};EmailImap[_0xf32e('0x18')][_0xf32e('0x39')]=function(){};EmailImap[_0xf32e('0x18')]['handleSimpleParser']=function(_0x409701,_0x3a156b){if(_0x409701){logger[_0xf32e('0x14')](_0x409701);}else{var _0x4a623=this;utils[_0xf32e('0x3b')](this[_0xf32e('0xe')],_0x3a156b,function(_0x583e5b){_0x4a623[_0xf32e('0x29')](_0xf32e('0xb'),_0x583e5b);});}};EmailImap[_0xf32e('0x18')][_0xf32e('0x34')]=function(){this[_0xf32e('0x2')][_0xf32e('0x3c')](!![],this[_0xf32e('0x2c')]['bind'](this));};EmailImap[_0xf32e('0x18')][_0xf32e('0x33')]=function(_0x41fbb1){this[_0xf32e('0x15')](_0x41fbb1);this[_0xf32e('0x2')][_0xf32e('0x3c')](!![],this[_0xf32e('0x2c')]['bind'](this));};EmailImap[_0xf32e('0x18')][_0xf32e('0x13')]=function(){this[_0xf32e('0x29')](_0xf32e('0x12'));};EmailImap[_0xf32e('0x18')][_0xf32e('0x15')]=function(_0x1bff7b,_0x3ce422){logger[_0xf32e('0x14')](_0xf32e('0x15'),this['account'][_0xf32e('0xb')],JSON[_0xf32e('0x3d')](_0x1bff7b));var _0xbd0442='';if(_0x1bff7b){if(_0x1bff7b[_0xf32e('0x3e')]){_0xbd0442=_0x1bff7b[_0xf32e('0x3e')];}else{for(var _0x120410 in _0x1bff7b){if(_0x1bff7b['hasOwnProperty'](_0x120410)){_0xbd0442+=_[_0xf32e('0x3f')](_0x120410)+':\x20'+_0x1bff7b[_0x120410]+'\x0a';}}}}if(_0x3ce422){this[_0xf32e('0x2')][_0xf32e('0x12')]();}else{this[_0xf32e('0x29')](_0xf32e('0x14'),_0xbd0442);this['emit'](_0xf32e('0x12'));}};module['exports']=EmailImap;
\ No newline at end of file
+var _0x4944=['EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','bind','error','handleError','inherits','prototype','getAccount','connTimeout','authTimeout','service','authentication','password','host','port','tls','user','getHost','handleReady','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleSimpleParser','handleMessageAttributes','handleMessageEnd','stringify','textCode','hasOwnProperty','exports','path','imap','lodash','randomstring','mailparser','simpleParser','Iconv'];(function(_0x4328d3,_0x324552){var _0x137294=function(_0x156e03){while(--_0x156e03){_0x4328d3['push'](_0x4328d3['shift']());}};_0x137294(++_0x324552);}(_0x4944,0x6d));var _0x4494=function(_0x4531a9,_0x4074e2){_0x4531a9=_0x4531a9-0x0;var _0x567a45=_0x4944[_0x4531a9];return _0x567a45;};'use strict';var fs=require('fs');var path=require(_0x4494('0x0'));var util=require('util');var Imap=require(_0x4494('0x1'));var _=require(_0x4494('0x2'));var rs=require(_0x4494('0x3'));var simpleParser=require(_0x4494('0x4'))[_0x4494('0x5')];var Iconv=require('iconv')[_0x4494('0x6')];var EventEmitter=require('events')[_0x4494('0x7')];var utils=require(_0x4494('0x8'));var logger=require(_0x4494('0x9'))(_0x4494('0xa'));function EmailImap(_0x2a4911,_0x1a94d6){this[_0x4494('0xb')]=_0x4494('0xc');this[_0x4494('0xd')]=this['getAccount'](_0x2a4911,_0x1a94d6);this[_0x4494('0x1')]=new Imap(this[_0x4494('0xd')]);this[_0x4494('0x1')][_0x4494('0xe')]('ready',this['handleReady'][_0x4494('0xf')](this));this[_0x4494('0x1')][_0x4494('0xe')]('end',this['handleEnd'][_0x4494('0xf')](this));this[_0x4494('0x1')]['on'](_0x4494('0x10'),this[_0x4494('0x11')][_0x4494('0xf')](this));this[_0x4494('0x1')]['connect']();}util[_0x4494('0x12')](EmailImap,EventEmitter);EmailImap[_0x4494('0x13')][_0x4494('0x14')]=function(_0x259e03,_0x9e92d0){var _0x8506a0={'connTimeout':_0x259e03[_0x4494('0x15')]?_0x259e03['connTimeout']*0x3e8:0x2710,'authTimeout':_0x259e03[_0x4494('0x16')]?_0x259e03['authTimeout']*0x3e8:0x1388};if(_['isNil'](_0x259e03[_0x4494('0x17')])){if(_0x259e03[_0x4494('0x18')]){_0x8506a0['user']=_0x259e03['user'];_0x8506a0[_0x4494('0x19')]=_0x259e03['password'];}_0x8506a0[_0x4494('0x1a')]=_0x259e03[_0x4494('0x1a')];_0x8506a0['port']=_0x259e03[_0x4494('0x1b')]||0x3e1;if(_0x259e03['tls']){_0x8506a0[_0x4494('0x1c')]=!![];}else{_0x8506a0[_0x4494('0x1c')]=![];_0x8506a0['autotls']='required';}}else{_0x8506a0[_0x4494('0x1d')]=_0x259e03[_0x4494('0x1d')];_0x8506a0[_0x4494('0x19')]=_0x259e03[_0x4494('0x19')];_0x8506a0[_0x4494('0x1a')]=utils[_0x4494('0x1e')](_0x259e03[_0x4494('0x17')]);_0x8506a0[_0x4494('0x1b')]=0x3e1;_0x8506a0['tls']=!![];}_0x8506a0['email']=_0x9e92d0||_0x259e03['user']||'anonymous@xcally.com';return _0x8506a0;};EmailImap[_0x4494('0x13')][_0x4494('0x1f')]=function(){this[_0x4494('0x1')][_0x4494('0x20')](this['mailbox'],![],this[_0x4494('0x21')][_0x4494('0xf')](this));};EmailImap['prototype'][_0x4494('0x21')]=function(_0x115520,_0x87d98){if(_0x115520){this['handleError'](_0x115520,!![]);}else{this[_0x4494('0x22')]('box',_0x87d98);this[_0x4494('0x23')]();}};EmailImap['prototype'][_0x4494('0x24')]=function(_0x2fcc43){if(_0x2fcc43){this[_0x4494('0x11')](_0x2fcc43,!![]);}else{this['imap'][_0x4494('0x25')]();}};EmailImap[_0x4494('0x13')]['readUnseen']=function(){this[_0x4494('0x1')][_0x4494('0x26')]([_0x4494('0x27')],this['handleReadUnseen'][_0x4494('0xf')](this));};EmailImap[_0x4494('0x13')][_0x4494('0x28')]=function(_0x19f483,_0x5a8a5b){if(_0x19f483){this[_0x4494('0x11')](_0x19f483,!![]);}else{if(_0x5a8a5b[_0x4494('0x29')]){try{var _0xcce4da=this['imap'][_0x4494('0x2a')](_0x5a8a5b,{'bodies':'','markSeen':!![]});_0xcce4da['on'](_0x4494('0x2b'),this[_0x4494('0x2c')]['bind'](this));_0xcce4da[_0x4494('0xe')](_0x4494('0x10'),this[_0x4494('0x2d')][_0x4494('0xf')](this));_0xcce4da[_0x4494('0xe')](_0x4494('0x25'),this[_0x4494('0x2e')]['bind'](this));}catch(_0x44559f){logger[_0x4494('0x10')](_0x44559f);}}else{this[_0x4494('0x1')][_0x4494('0x2f')](!![],this[_0x4494('0x24')][_0x4494('0xf')](this));}}};EmailImap['prototype'][_0x4494('0x2c')]=function(_0x1009a4,_0x3b3cae){_0x1009a4['on'](_0x4494('0x30'),this[_0x4494('0x31')]['bind'](this));_0x1009a4[_0x4494('0xe')](_0x4494('0x32'),this['handleMessageAttributes'][_0x4494('0xf')](this));_0x1009a4['once']('end',this['handleMessageEnd'][_0x4494('0xf')](this));};EmailImap[_0x4494('0x13')][_0x4494('0x31')]=function(_0x546133,_0x542359){simpleParser(_0x546133,{'Iconv':Iconv},this[_0x4494('0x33')][_0x4494('0xf')](this));};EmailImap[_0x4494('0x13')][_0x4494('0x34')]=function(_0xa80999){};EmailImap[_0x4494('0x13')][_0x4494('0x35')]=function(){};EmailImap[_0x4494('0x13')][_0x4494('0x33')]=function(_0x2498bc,_0x2a80e4){if(_0x2498bc){logger[_0x4494('0x10')](_0x2498bc);}else{var _0x27d93f=this;utils['parser'](this[_0x4494('0xd')],_0x2a80e4,function(_0xd09dbb){_0x27d93f[_0x4494('0x22')](_0x4494('0xa'),_0xd09dbb);});}};EmailImap[_0x4494('0x13')][_0x4494('0x2e')]=function(){this[_0x4494('0x1')][_0x4494('0x2f')](!![],this[_0x4494('0x24')]['bind'](this));};EmailImap['prototype'][_0x4494('0x2d')]=function(_0x55dbb8){this[_0x4494('0x11')](_0x55dbb8);this[_0x4494('0x1')][_0x4494('0x2f')](!![],this[_0x4494('0x24')][_0x4494('0xf')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x4494('0x22')]('end');};EmailImap[_0x4494('0x13')][_0x4494('0x11')]=function(_0x124d0a,_0x2d10f4){logger[_0x4494('0x10')](_0x4494('0x11'),this[_0x4494('0xd')]['email'],JSON[_0x4494('0x36')](_0x124d0a));var _0xe210c4='';if(_0x124d0a){if(_0x124d0a['textCode']){_0xe210c4=_0x124d0a[_0x4494('0x37')];}else{for(var _0x44953b in _0x124d0a){if(_0x124d0a[_0x4494('0x38')](_0x44953b)){_0xe210c4+=_['upperFirst'](_0x44953b)+':\x20'+_0x124d0a[_0x44953b]+'\x0a';}}}}if(_0x2d10f4){this[_0x4494('0x1')][_0x4494('0x25')]();}else{this[_0x4494('0x22')](_0x4494('0x10'),_0xe210c4);this['emit']('end');}};module[_0x4494('0x39')]=EmailImap;
\ No newline at end of file
index 078754d..b9dd190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa390=['use','compile','sendMail','toString','prototype','verify','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','createTransport'];(function(_0x11c95c,_0x58d2a9){var _0x421713=function(_0x31bc1c){while(--_0x31bc1c){_0x11c95c['push'](_0x11c95c['shift']());}};_0x421713(++_0x58d2a9);}(_0xa390,0x1ab));var _0x0a39=function(_0x9e03c7,_0x344a5e){_0x9e03c7=_0x9e03c7-0x0;var _0x29a147=_0xa390[_0x9e03c7];return _0x29a147;};'use strict';var nodemailer=require(_0x0a39('0x0'));var BPromise=require(_0x0a39('0x1'));var inlineBase64=require(_0x0a39('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0x0a39('0x3')]=function(_0x202082,_0x26b224){return new BPromise(function(_0x4ff916,_0x3ce488){var _0x198c8a=nodemailer[_0x0a39('0x4')](_0x202082);_0x198c8a[_0x0a39('0x5')](_0x0a39('0x6'),inlineBase64());_0x198c8a[_0x0a39('0x7')](_0x26b224,function(_0x2c5db4,_0x5615dd){if(_0x2c5db4){_0x3ce488(_0x2c5db4[_0x0a39('0x8')]());}else{_0x4ff916(_0x5615dd);}});});};EmailSmtp[_0x0a39('0x9')]['verify']=function(_0x256c66){return new BPromise(function(_0x47eef8,_0x3d8dde){var _0x1a2afe=nodemailer[_0x0a39('0x4')](_0x256c66);_0x1a2afe[_0x0a39('0xa')](function(_0x434658,_0x28f353){if(_0x434658){_0x3d8dde(_0x434658[_0x0a39('0x8')]());}else{if(_0x28f353){_0x47eef8(_0x28f353);}else{_0x3d8dde('Not\x20verifired');}}});});};module[_0x0a39('0xb')]=EmailSmtp;
\ No newline at end of file
+var _0xef68=['createTransport','use','compile','toString','verify','Not\x20verifired','nodemailer','bluebird','prototype','send'];(function(_0x512856,_0x1e30c1){var _0x33a1b2=function(_0x19df0b){while(--_0x19df0b){_0x512856['push'](_0x512856['shift']());}};_0x33a1b2(++_0x1e30c1);}(_0xef68,0xce));var _0x8ef6=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xef68[_0x5c2e3e];return _0x53f64a;};'use strict';var nodemailer=require(_0x8ef6('0x0'));var BPromise=require(_0x8ef6('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8ef6('0x2')][_0x8ef6('0x3')]=function(_0x231337,_0x1e5bea){return new BPromise(function(_0x53d80c,_0x435803){var _0x105bef=nodemailer[_0x8ef6('0x4')](_0x231337);_0x105bef[_0x8ef6('0x5')](_0x8ef6('0x6'),inlineBase64());_0x105bef['sendMail'](_0x1e5bea,function(_0x1dccc9,_0x37f65e){if(_0x1dccc9){_0x435803(_0x1dccc9[_0x8ef6('0x7')]());}else{_0x53d80c(_0x37f65e);}});});};EmailSmtp['prototype'][_0x8ef6('0x8')]=function(_0x5b0ff2){return new BPromise(function(_0x1d2f8b,_0x74213f){var _0x4b8ac8=nodemailer[_0x8ef6('0x4')](_0x5b0ff2);_0x4b8ac8[_0x8ef6('0x8')](function(_0x365de0,_0x3d4abe){if(_0x365de0){_0x74213f(_0x365de0[_0x8ef6('0x7')]());}else{if(_0x3d4abe){_0x1d2f8b(_0x3d4abe);}else{_0x74213f(_0x8ef6('0x9'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index de2a5e5..952c429 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8603=['hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','moment','randomstring','path','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','head','name','length','slice','Anonymous','split','pop','isEmpty','html','test','replace','includes','<img','attachments','push','filename','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','bcc','attach','attachment','attachment-','format','now','join','writeFileSync','content','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','info','parseBuffer','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x8603,0x190));var _0x3860=function(_0x5664fd,_0x58f991){_0x5664fd=_0x5664fd-0x0;var _0x95a400=_0x8603[_0x5664fd];return _0x95a400;};'use strict';var _=require('lodash');var moment=require(_0x3860('0x0'));var random=require(_0x3860('0x1'));var fs=require('fs');var path=require(_0x3860('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x3860('0x3'))(_0x3860('0x4'));var config=require(_0x3860('0x5'));function getAddress(_0x490262){var _0x2fc97a=_['head'](_0x490262[_0x3860('0x6')]);return _0x2fc97a&&_0x2fc97a[_0x3860('0x7')]?_0x2fc97a[_0x3860('0x7')]:_0x3860('0x8')+random[_0x3860('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x5c7350){var _0x5b1ac8=_[_0x3860('0xa')](_0x5c7350[_0x3860('0x6')]);if(_0x5b1ac8&&_0x5b1ac8['name']){var _0x2fb169=_0x5b1ac8[_0x3860('0xb')]['split'](/\s+/);return _0x2fb169[_0x3860('0xc')]?_0x2fb169[_0x3860('0xd')](0x0,-0x1)['join']('\x20'):_0x5b1ac8[_0x3860('0xb')];}return _0x3860('0xe');}function getLastName(_0x4c6a45){var _0x405510=_[_0x3860('0xa')](_0x4c6a45[_0x3860('0x6')]);if(_0x405510&&_0x405510[_0x3860('0xb')]){var _0x3f3630=_0x405510[_0x3860('0xb')][_0x3860('0xf')](/\s+/);return _0x3f3630[_0x3860('0xc')]>0x1?_0x3f3630[_0x3860('0x10')]():'';}return'';}function getMails(_0x46264d,_0x54dbc3){var _0x3d861d='';for(var _0x21eaf1=0x0;_0x21eaf1<_0x54dbc3[_0x3860('0x6')][_0x3860('0xc')];_0x21eaf1+=0x1){if(_0x54dbc3[_0x3860('0x6')][_0x21eaf1][_0x3860('0x7')]!==_0x46264d){if(!_[_0x3860('0x11')](_0x3d861d)){_0x3d861d+=',';}_0x3d861d+=_0x54dbc3[_0x3860('0x6')][_0x21eaf1][_0x3860('0xb')]||_0x54dbc3[_0x3860('0x6')][_0x21eaf1][_0x3860('0x7')]||'';_0x3d861d+='\x20<';_0x3d861d+=_0x54dbc3[_0x3860('0x6')][_0x21eaf1]['address']?_0x54dbc3['value'][_0x21eaf1][_0x3860('0x7')]:_0x3860('0x8')+random[_0x3860('0x9')](0x6)+'@xcally.com';_0x3d861d+='>';}}return _0x3d861d;}function parseEmail(_0x3bb873,_0x145b26,_0x22e873){if(_0x145b26[_0x3860('0x12')]){var _0x20a5b0=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x20a5b0[_0x3860('0x13')](_0x145b26[_0x3860('0x12')])){_0x145b26[_0x3860('0x12')]=_0x145b26[_0x3860('0x12')][_0x3860('0x14')](_0x20a5b0,'');}if(_0x145b26[_0x3860('0x12')][_0x3860('0x15')](_0x3860('0x16'))){var _0x9eaaa1=[];_0x145b26[_0x3860('0x17')]['forEach'](_0xfc10a5=>{_0x9eaaa1[_0x3860('0x18')](_0xfc10a5[_0x3860('0x19')]);});var _0x301e03=/<img.*? _SRC(.*?)[^\>]+>/g;var _0x20bb1e=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x56a6d1=_0x145b26[_0x3860('0x12')]['replace'](_0x20bb1e,'_SRC');var _0xfa9705=_0x56a6d1[_0x3860('0x14')](_0x301e03,'_IMG');for(let _0x4d9a90=0x0;_0x4d9a90<_0x9eaaa1['length'];_0x4d9a90++){var _0x1b2e4d=_0xfa9705[_0x3860('0x14')](_0x3860('0x1a'),_0x3860('0x1b')+_0x9eaaa1[_0x4d9a90]+_0x3860('0x1c'));_0xfa9705=_0x1b2e4d;}_0x145b26[_0x3860('0x12')]=_0xfa9705;}_0x22e873['body']=_0x145b26['html'];}else{_0x22e873[_0x3860('0x1d')]=_0x145b26[_0x3860('0x1e')];}if(_0x22e873['body']){_0x22e873[_0x3860('0x1d')]=_0x22e873[_0x3860('0x1d')][_0x3860('0x14')](/<a\s+/gi,_0x3860('0x1f'));}if(_0x145b26['to']){_0x22e873[_0x3860('0x20')]['originTo']=getMails(null,_0x145b26['to']);var _0x36ae2b=getMails(_0x3bb873[_0x3860('0x4')],_0x145b26['to']);if(!_[_0x3860('0x11')](_0x36ae2b)){_0x22e873['message']['cc']+=_0x36ae2b;}}if(_0x145b26['cc']){_0x22e873[_0x3860('0x20')]['originCc']=getMails(null,_0x145b26['cc']);var _0x294b3a=getMails(_0x3bb873['email'],_0x145b26['cc']);if(!_[_0x3860('0x11')](_0x294b3a)){if(!_[_0x3860('0x11')](_0x22e873[_0x3860('0x20')]['cc'])){_0x22e873['message']['cc']+=',';}_0x22e873[_0x3860('0x20')]['cc']+=_0x294b3a;}}if(!_[_0x3860('0x15')](_0x22e873['message'][_0x3860('0x21')],_0x3bb873['email'])&&!_[_0x3860('0x15')](_0x22e873[_0x3860('0x20')][_0x3860('0x22')],_0x3bb873[_0x3860('0x4')])){_0x22e873[_0x3860('0x20')][_0x3860('0x23')]=_0x3bb873[_0x3860('0x4')];}if(_0x145b26['attachments']&&_0x145b26[_0x3860('0x17')][_0x3860('0xc')]){_0x22e873['message'][_0x3860('0x24')]=_0x145b26[_0x3860('0x17')][_0x3860('0xc')];for(var _0x5af661=0x0,_0x523cc1,_0x285b1b,_0x37a871;_0x5af661<_0x145b26[_0x3860('0x17')][_0x3860('0xc')];_0x5af661+=0x1){if(_0x145b26['attachments'][_0x5af661]['type']===_0x3860('0x25')){_0x37a871=_0x145b26[_0x3860('0x17')][_0x5af661][_0x3860('0x19')]||_0x3860('0x26')+_0x5af661;_0x523cc1=util[_0x3860('0x27')]('%s-%s',Date[_0x3860('0x28')](),_0x37a871);_0x285b1b=path[_0x3860('0x29')](config['root'],'server/files/attachments/',_0x523cc1);fs[_0x3860('0x2a')](_0x285b1b,_0x145b26[_0x3860('0x17')][_0x5af661][_0x3860('0x2b')]);_0x22e873[_0x3860('0x20')][_0x3860('0x17')]['push']({'name':_0x37a871,'basename':_0x523cc1,'type':_0x145b26[_0x3860('0x17')][_0x5af661]['contentType'],'filepath':_0x285b1b});}}}return _0x22e873;}exports[_0x3860('0x2c')]=function(_0x35bf7a,_0x53d443,_0x36d9bd){var _0x162e65={'from':getAddress(_0x53d443['from']),'firstName':getFirstName(_0x53d443[_0x3860('0x2d')]),'lastName':getLastName(_0x53d443[_0x3860('0x2d')]),'mapKey':_0x3860('0x4'),'message':{'from':getMails(_0x35bf7a[_0x3860('0x4')],_0x53d443['from']),'to':_0x35bf7a[_0x3860('0x4')],'cc':'','subject':_0x53d443[_0x3860('0x2e')]||'','messageId':_0x53d443[_0x3860('0x2f')],'inReplyTo':_0x53d443['inReplyTo'],'sentAt':moment(_0x53d443[_0x3860('0x30')])['format'](_0x3860('0x31')),'attach':![],'attachments':[]}};if(!_0x53d443[_0x3860('0x12')]&&!_0x53d443[_0x3860('0x1e')]){var _0x3f613f=_[_0x3860('0x32')](_0x53d443[_0x3860('0x17')],{'contentType':'application/ms-tnef'});if(_0x3f613f[_0x3860('0xc')]){logger[_0x3860('0x33')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x53d443[_0x3860('0x2f')]));tnef[_0x3860('0x34')](_['first'](_0x3f613f)[_0x3860('0x2b')],function(_0x30d8eb,_0x4c6c23){if(_0x4c6c23){_0x53d443[_0x3860('0x12')]=_0x4c6c23[_0x3860('0x35')]||_0x3860('0x36');if(_0x4c6c23[_0x3860('0x37')]){for(var _0x14f5b2=0x0;_0x14f5b2<_0x4c6c23[_0x3860('0x37')][_0x3860('0xc')];_0x14f5b2++){var _0x15ebbd=_0x4c6c23[_0x3860('0x37')][_0x14f5b2];_0x162e65[_0x3860('0x20')][_0x3860('0x17')][_0x3860('0x18')]({'filename':_0x15ebbd[_0x3860('0x38')],'content':new Buffer(_0x15ebbd['Data'])});}}}_0x36d9bd(parseEmail(_0x35bf7a,_0x53d443,_0x162e65));});}else{_0x53d443[_0x3860('0x12')]='<p>Empty\x20message</p>';_0x36d9bd(parseEmail(_0x35bf7a,_0x53d443,_0x162e65));}}else{_0x36d9bd(parseEmail(_0x35bf7a,_0x53d443,_0x162e65));}};exports[_0x3860('0x39')]=function(_0x770334){switch(_0x770334){case _0x3860('0x3a'):return _0x3860('0x3b');case _0x3860('0x3c'):return _0x3860('0x3d');case _0x3860('0x3e'):return _0x3860('0x3f');case'outlook365':return _0x3860('0x40');}return _0x3860('0x41');};
\ No newline at end of file
+var _0x5eb8=['filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','<a\x20target=\x22_blank\x22\x20','message','originTo','attachments','attach','attachment','format','%s-%s','join','server/files/attachments/','parser','from','inReplyTo','date','textAsHtml','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','content','BodyHTML','Attachments','Title','Data','<p>Empty\x20message</p>','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','Anonymous','pop','isEmpty','html','replace','includes','<img','push'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x5eb8,0xb0));var _0x85eb=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x5eb8[_0x382a62];return _0x490a25;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x85eb('0x0'));var fs=require('fs');var path=require(_0x85eb('0x1'));var util=require(_0x85eb('0x2'));var tnef=require(_0x85eb('0x3'));var logger=require(_0x85eb('0x4'))(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));function getAddress(_0x44e313){var _0x3c5798=_[_0x85eb('0x7')](_0x44e313[_0x85eb('0x8')]);return _0x3c5798&&_0x3c5798[_0x85eb('0x9')]?_0x3c5798['address']:_0x85eb('0xa')+random[_0x85eb('0xb')](0x6)+_0x85eb('0xc');}function getFirstName(_0x5cd4ec){var _0x2da3b0=_['head'](_0x5cd4ec[_0x85eb('0x8')]);if(_0x2da3b0&&_0x2da3b0[_0x85eb('0xd')]){var _0x673228=_0x2da3b0[_0x85eb('0xd')][_0x85eb('0xe')](/\s+/);return _0x673228[_0x85eb('0xf')]?_0x673228[_0x85eb('0x10')](0x0,-0x1)['join']('\x20'):_0x2da3b0[_0x85eb('0xd')];}return _0x85eb('0x11');}function getLastName(_0x5c52a4){var _0x2af376=_[_0x85eb('0x7')](_0x5c52a4[_0x85eb('0x8')]);if(_0x2af376&&_0x2af376[_0x85eb('0xd')]){var _0x4db167=_0x2af376['name'][_0x85eb('0xe')](/\s+/);return _0x4db167['length']>0x1?_0x4db167[_0x85eb('0x12')]():'';}return'';}function getMails(_0x23a82a,_0x600a7f){var _0x1604ba='';for(var _0x183b0c=0x0;_0x183b0c<_0x600a7f['value'][_0x85eb('0xf')];_0x183b0c+=0x1){if(_0x600a7f['value'][_0x183b0c][_0x85eb('0x9')]!==_0x23a82a){if(!_[_0x85eb('0x13')](_0x1604ba)){_0x1604ba+=',';}_0x1604ba+=_0x600a7f[_0x85eb('0x8')][_0x183b0c][_0x85eb('0xd')]||_0x600a7f['value'][_0x183b0c]['address']||'';_0x1604ba+='\x20<';_0x1604ba+=_0x600a7f['value'][_0x183b0c][_0x85eb('0x9')]?_0x600a7f[_0x85eb('0x8')][_0x183b0c][_0x85eb('0x9')]:_0x85eb('0xa')+random[_0x85eb('0xb')](0x6)+_0x85eb('0xc');_0x1604ba+='>';}}return _0x1604ba;}function parseEmail(_0x5acd3d,_0x24cf28,_0x7244fc){if(_0x24cf28[_0x85eb('0x14')]){var _0x4e8041=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x4e8041['test'](_0x24cf28['html'])){_0x24cf28['html']=_0x24cf28[_0x85eb('0x14')][_0x85eb('0x15')](_0x4e8041,'');}if(_0x24cf28[_0x85eb('0x14')][_0x85eb('0x16')](_0x85eb('0x17'))){var _0x3fc6da=[];_0x24cf28['attachments']['forEach'](_0x5b48d9=>{_0x3fc6da[_0x85eb('0x18')](_0x5b48d9[_0x85eb('0x19')]);});var _0x3f7a4d=/<img.*? _SRC(.*?)[^\>]+>/g;var _0x28b87d=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x312b3e=_0x24cf28[_0x85eb('0x14')]['replace'](_0x28b87d,_0x85eb('0x1a'));var _0x3453cd=_0x312b3e[_0x85eb('0x15')](_0x3f7a4d,_0x85eb('0x1b'));for(let _0x3e2326=0x0;_0x3e2326<_0x3fc6da['length'];_0x3e2326++){var _0x2e5aa3=_0x3453cd[_0x85eb('0x15')](_0x85eb('0x1b'),_0x85eb('0x1c')+_0x3fc6da[_0x3e2326]+_0x85eb('0x1d'));_0x3453cd=_0x2e5aa3;}_0x24cf28[_0x85eb('0x14')]=_0x3453cd;}_0x7244fc['body']=_0x24cf28['html'];}else{_0x7244fc[_0x85eb('0x1e')]=_0x24cf28['textAsHtml'];}if(_0x7244fc[_0x85eb('0x1e')]){_0x7244fc['body']=_0x7244fc[_0x85eb('0x1e')][_0x85eb('0x15')](/<a\s+/gi,_0x85eb('0x1f'));}if(_0x24cf28['to']){_0x7244fc[_0x85eb('0x20')][_0x85eb('0x21')]=getMails(null,_0x24cf28['to']);var _0xf4ac13=getMails(_0x5acd3d[_0x85eb('0x5')],_0x24cf28['to']);if(!_['isEmpty'](_0xf4ac13)){_0x7244fc[_0x85eb('0x20')]['cc']+=_0xf4ac13;}}if(_0x24cf28['cc']){_0x7244fc[_0x85eb('0x20')]['originCc']=getMails(null,_0x24cf28['cc']);var _0x197898=getMails(_0x5acd3d['email'],_0x24cf28['cc']);if(!_['isEmpty'](_0x197898)){if(!_[_0x85eb('0x13')](_0x7244fc[_0x85eb('0x20')]['cc'])){_0x7244fc[_0x85eb('0x20')]['cc']+=',';}_0x7244fc[_0x85eb('0x20')]['cc']+=_0x197898;}}if(!_[_0x85eb('0x16')](_0x7244fc[_0x85eb('0x20')][_0x85eb('0x21')],_0x5acd3d[_0x85eb('0x5')])&&!_[_0x85eb('0x16')](_0x7244fc[_0x85eb('0x20')]['originCc'],_0x5acd3d[_0x85eb('0x5')])){_0x7244fc[_0x85eb('0x20')]['bcc']=_0x5acd3d['email'];}if(_0x24cf28[_0x85eb('0x22')]&&_0x24cf28[_0x85eb('0x22')][_0x85eb('0xf')]){_0x7244fc[_0x85eb('0x20')][_0x85eb('0x23')]=_0x24cf28[_0x85eb('0x22')][_0x85eb('0xf')];for(var _0x35f092=0x0,_0x272a99,_0x373e5f,_0x424053;_0x35f092<_0x24cf28[_0x85eb('0x22')][_0x85eb('0xf')];_0x35f092+=0x1){if(_0x24cf28[_0x85eb('0x22')][_0x35f092]['type']===_0x85eb('0x24')){_0x424053=_0x24cf28[_0x85eb('0x22')][_0x35f092]['filename']||'attachment-'+_0x35f092;_0x272a99=util[_0x85eb('0x25')](_0x85eb('0x26'),Date['now'](),_0x424053);_0x373e5f=path[_0x85eb('0x27')](config['root'],_0x85eb('0x28'),_0x272a99);fs['writeFileSync'](_0x373e5f,_0x24cf28[_0x85eb('0x22')][_0x35f092]['content']);_0x7244fc[_0x85eb('0x20')]['attachments'][_0x85eb('0x18')]({'name':_0x424053,'basename':_0x272a99,'type':_0x24cf28[_0x85eb('0x22')][_0x35f092]['contentType'],'filepath':_0x373e5f});}}}return _0x7244fc;}exports[_0x85eb('0x29')]=function(_0x5a1c15,_0x2a6baa,_0x331260){var _0x5c0156={'from':getAddress(_0x2a6baa[_0x85eb('0x2a')]),'firstName':getFirstName(_0x2a6baa['from']),'lastName':getLastName(_0x2a6baa['from']),'mapKey':_0x85eb('0x5'),'message':{'from':getMails(_0x5a1c15['email'],_0x2a6baa[_0x85eb('0x2a')]),'to':_0x5a1c15[_0x85eb('0x5')],'cc':'','subject':_0x2a6baa['subject']||'','messageId':_0x2a6baa['messageId'],'inReplyTo':_0x2a6baa[_0x85eb('0x2b')],'sentAt':moment(_0x2a6baa[_0x85eb('0x2c')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2a6baa[_0x85eb('0x14')]&&!_0x2a6baa[_0x85eb('0x2d')]){var _0x2211f9=_[_0x85eb('0x2e')](_0x2a6baa[_0x85eb('0x22')],{'contentType':'application/ms-tnef'});if(_0x2211f9[_0x85eb('0xf')]){logger[_0x85eb('0x2f')](util[_0x85eb('0x25')](_0x85eb('0x30'),_0x2a6baa[_0x85eb('0x31')]));tnef[_0x85eb('0x32')](_[_0x85eb('0x33')](_0x2211f9)[_0x85eb('0x34')],function(_0x469639,_0x540c7a){if(_0x540c7a){_0x2a6baa[_0x85eb('0x14')]=_0x540c7a[_0x85eb('0x35')]||'<p>Empty\x20message</p>';if(_0x540c7a[_0x85eb('0x36')]){for(var _0x201aed=0x0;_0x201aed<_0x540c7a[_0x85eb('0x36')][_0x85eb('0xf')];_0x201aed++){var _0x1b1559=_0x540c7a[_0x85eb('0x36')][_0x201aed];_0x5c0156['message'][_0x85eb('0x22')][_0x85eb('0x18')]({'filename':_0x1b1559[_0x85eb('0x37')],'content':new Buffer(_0x1b1559[_0x85eb('0x38')])});}}}_0x331260(parseEmail(_0x5a1c15,_0x2a6baa,_0x5c0156));});}else{_0x2a6baa[_0x85eb('0x14')]=_0x85eb('0x39');_0x331260(parseEmail(_0x5a1c15,_0x2a6baa,_0x5c0156));}}else{_0x331260(parseEmail(_0x5a1c15,_0x2a6baa,_0x5c0156));}};exports[_0x85eb('0x3a')]=function(_0x202590){switch(_0x202590){case'gmail':return _0x85eb('0x3b');case _0x85eb('0x3c'):return _0x85eb('0x3d');case _0x85eb('0x3e'):return _0x85eb('0x3f');case _0x85eb('0x40'):return _0x85eb('0x41');}return _0x85eb('0x42');};
\ No newline at end of file
index b502168..76713d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7de2=['Smtp','exports','lodash','name','key','SERV','active','Imap'];(function(_0x224514,_0x38c018){var _0x11470f=function(_0xffc7de){while(--_0xffc7de){_0x224514['push'](_0x224514['shift']());}};_0x11470f(++_0x38c018);}(_0x7de2,0x192));var _0x27de=function(_0x5d13a6,_0x56e087){_0x5d13a6=_0x5d13a6-0x0;var _0x4ec59b=_0x7de2[_0x5d13a6];return _0x4ec59b;};'use strict';var _=require(_0x27de('0x0'));function MailAccount(_0x55ffa7){this['id']=_0x55ffa7['id']||0x0;this[_0x27de('0x1')]=_0x55ffa7[_0x27de('0x1')]||'Service';this[_0x27de('0x2')]=_0x55ffa7['key']||_0x27de('0x3');this[_0x27de('0x4')]=_0x55ffa7[_0x27de('0x4')]||![];this[_0x27de('0x5')]=_0x55ffa7['Imap']||[];this[_0x27de('0x6')]=_0x55ffa7[_0x27de('0x6')]||[];}module[_0x27de('0x7')]=MailAccount;
\ No newline at end of file
+var _0xad86=['Service','active','Imap','Smtp','exports','lodash','name'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xad86,0x124));var _0x6ad8=function(_0x182238,_0xb7de4d){_0x182238=_0x182238-0x0;var _0x3a2880=_0xad86[_0x182238];return _0x3a2880;};'use strict';var _=require(_0x6ad8('0x0'));function MailAccount(_0x12e0c2){this['id']=_0x12e0c2['id']||0x0;this[_0x6ad8('0x1')]=_0x12e0c2[_0x6ad8('0x1')]||_0x6ad8('0x2');this['key']=_0x12e0c2['key']||'SERV';this[_0x6ad8('0x3')]=_0x12e0c2[_0x6ad8('0x3')]||![];this[_0x6ad8('0x4')]=_0x12e0c2[_0x6ad8('0x4')]||[];this[_0x6ad8('0x5')]=_0x12e0c2['Smtp']||[];}module[_0x6ad8('0x6')]=MailAccount;
\ No newline at end of file
index b82f0b5..70e55da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6d9=['mergeFromDatabase','hasOwnProperty','initMailAccounts','length','isUndefined','exports','lodash','../model/mailAccount','mailAccounts','prototype'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xb6d9,0x1e6));var _0x9b6d=function(_0x105e93,_0x7b0e7f){_0x105e93=_0x105e93-0x0;var _0xf9a11a=_0xb6d9[_0x105e93];return _0xf9a11a;};'use strict';var _=require(_0x9b6d('0x0'));var MailAccount=require(_0x9b6d('0x1'));var Realtime=function(){this[_0x9b6d('0x2')]={};};function freeIsNotKey(_0x4528b0,_0x2d6523,_0x1afd2a){var _0x505b73=_['mapKeys'](_0x4528b0,function(_0x199fc7,_0x751293){return _0x199fc7[_0x1afd2a];});for(var _0x36f99c in _0x2d6523){if(_0x2d6523['hasOwnProperty'](_0x36f99c)){if(!_0x505b73[_0x36f99c]){delete _0x2d6523[_0x36f99c];}}}}Realtime[_0x9b6d('0x3')][_0x9b6d('0x4')]=function(_0x1f8494,_0x4f0ee1){for(var _0x52d739 in _0x4f0ee1){if(_0x1f8494[_0x9b6d('0x5')](_0x52d739)){_0x1f8494[_0x52d739]=_0x4f0ee1[_0x52d739];}}};Realtime[_0x9b6d('0x3')][_0x9b6d('0x6')]=function(){var _0x3bd190=this;return function(_0xab73c8){if(_0xab73c8){freeIsNotKey(_0xab73c8,_0x3bd190[_0x9b6d('0x2')],'id');for(var _0x6ebbd6=0x0,_0x5f0005={},_0x4652b3={};_0x6ebbd6<_0xab73c8[_0x9b6d('0x7')];_0x6ebbd6+=0x1){_0x5f0005=_0xab73c8[_0x6ebbd6];if(_[_0x9b6d('0x8')](_0x3bd190[_0x9b6d('0x2')][_0x5f0005['id']])){_0x3bd190[_0x9b6d('0x2')][_0x5f0005['id']]=new MailAccount(_0x5f0005);}else{_['merge'](_0x3bd190[_0x9b6d('0x2')][_0x5f0005['id']],_0x5f0005);}}}return _0x3bd190[_0x9b6d('0x2')];};};module[_0x9b6d('0x9')]=Realtime;
\ No newline at end of file
+var _0x0072=['isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','length'];(function(_0x1e2d08,_0x261ddc){var _0x290252=function(_0xdefb7f){while(--_0xdefb7f){_0x1e2d08['push'](_0x1e2d08['shift']());}};_0x290252(++_0x261ddc);}(_0x0072,0x1cb));var _0x2007=function(_0x5272ad,_0x9e1288){_0x5272ad=_0x5272ad-0x0;var _0x137abc=_0x0072[_0x5272ad];return _0x137abc;};'use strict';var _=require(_0x2007('0x0'));var MailAccount=require(_0x2007('0x1'));var Realtime=function(){this[_0x2007('0x2')]={};};function freeIsNotKey(_0x53e942,_0x3e8181,_0x197dc9){var _0x4fe028=_[_0x2007('0x3')](_0x53e942,function(_0x20b51c,_0x5f1c3f){return _0x20b51c[_0x197dc9];});for(var _0x15d734 in _0x3e8181){if(_0x3e8181['hasOwnProperty'](_0x15d734)){if(!_0x4fe028[_0x15d734]){delete _0x3e8181[_0x15d734];}}}}Realtime[_0x2007('0x4')][_0x2007('0x5')]=function(_0x11ef28,_0x592df0){for(var _0x37da86 in _0x592df0){if(_0x11ef28[_0x2007('0x6')](_0x37da86)){_0x11ef28[_0x37da86]=_0x592df0[_0x37da86];}}};Realtime[_0x2007('0x4')][_0x2007('0x7')]=function(){var _0x99c29c=this;return function(_0x61ef93){if(_0x61ef93){freeIsNotKey(_0x61ef93,_0x99c29c[_0x2007('0x2')],'id');for(var _0x4a5ee6=0x0,_0x1fb8e={},_0x29cdf0={};_0x4a5ee6<_0x61ef93[_0x2007('0x8')];_0x4a5ee6+=0x1){_0x1fb8e=_0x61ef93[_0x4a5ee6];if(_[_0x2007('0x9')](_0x99c29c[_0x2007('0x2')][_0x1fb8e['id']])){_0x99c29c[_0x2007('0x2')][_0x1fb8e['id']]=new MailAccount(_0x1fb8e);}else{_[_0x2007('0xa')](_0x99c29c[_0x2007('0x2')][_0x1fb8e['id']],_0x1fb8e);}}}return _0x99c29c[_0x2007('0x2')];};};module[_0x2007('0xb')]=Realtime;
\ No newline at end of file
index 505478e..eb9f83d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6c0=['GetMailAccount','name','email','active','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','NotifyMailAccount','getMailAccounts','Request'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xc6c0,0x1b1));var _0x0c6c=function(_0x5d88c0,_0x5d7d83){_0x5d88c0=_0x5d88c0-0x0;var _0x1b40f0=_0xc6c0[_0x5d88c0];return _0x1b40f0;};'use strict';var client=require('../client');exports[_0x0c6c('0x0')]=function(){return function(){return client[_0x0c6c('0x1')](_0x0c6c('0x2'),{'options':{'attributes':['id',_0x0c6c('0x3'),'service',_0x0c6c('0x4'),_0x0c6c('0x5'),_0x0c6c('0x6'),_0x0c6c('0x7'),_0x0c6c('0x8')],'raw':![],'include':[{'model':_0x0c6c('0x9'),'as':_0x0c6c('0xa')},{'model':_0x0c6c('0xb'),'as':_0x0c6c('0xc')}]},'log':_0x0c6c('0xd')});};};exports['notify']=function(_0x9f095,_0x2bf7fe){return client['Request'](_0x0c6c('0xe'),{'account':{'id':_0x9f095},'body':_0x2bf7fe,'log':_0x0c6c('0xe')});};
\ No newline at end of file
+var _0x5a9e=['Smtp','NotifyMailAccount','getMailAccounts','Request','service','email','active','key','ListId','MailServerIn','MailServerOut'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x5a9e,0xbd));var _0xe5a9=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x5a9e[_0x2e8418];return _0x548fe6;};'use strict';var client=require('../client');exports[_0xe5a9('0x0')]=function(){return function(){return client[_0xe5a9('0x1')]('GetMailAccount',{'options':{'attributes':['id','name',_0xe5a9('0x2'),_0xe5a9('0x3'),_0xe5a9('0x4'),_0xe5a9('0x5'),_0xe5a9('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0xe5a9('0x7'),'as':'Imap'},{'model':_0xe5a9('0x8'),'as':_0xe5a9('0x9')}]},'log':'getMailAccount'});};};exports['notify']=function(_0x2ed1d0,_0x13bb4f){return client[_0xe5a9('0x1')](_0xe5a9('0xa'),{'account':{'id':_0x2ed1d0},'body':_0x13bb4f,'log':_0xe5a9('0xa')});};
\ No newline at end of file
index c858bc3..3fcd04c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3965=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x2ebd5d,_0xce6684){var _0x434830=function(_0x2d59bf){while(--_0x2d59bf){_0x2ebd5d['push'](_0x2ebd5d['shift']());}};_0x434830(++_0xce6684);}(_0x3965,0x1a1));var _0x5396=function(_0x108d68,_0x9b39de){_0x108d68=_0x108d68-0x0;var _0x11476a=_0x3965[_0x108d68];return _0x11476a;};'use strict';var client=require(_0x5396('0x0'));exports[_0x5396('0x1')]=function(){return client[_0x5396('0x2')](_0x5396('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5396('0x4')]},'log':_0x5396('0x5')});};
\ No newline at end of file
+var _0x7a55=['getSettings','Request','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x34d685,_0x36d50f){var _0x4870fd=function(_0x1c136d){while(--_0x1c136d){_0x34d685['push'](_0x34d685['shift']());}};_0x4870fd(++_0x36d50f);}(_0x7a55,0x107));var _0x57a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a55[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x57a5('0x0'));exports[_0x57a5('0x1')]=function(){return client[_0x57a5('0x2')](_0x57a5('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x57a5('0x4')]},'log':_0x57a5('0x5')});};
\ No newline at end of file
index 09a94b8..8ec4970 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 57403f7..2e5f89f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2777=['../../config/triggers','../../config/socketio','default','../../routes','once','listening','log','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port','websocket','polling','redis','localhost','socket.io-redis'];(function(_0x2a758d,_0x441ff8){var _0x679f84=function(_0x5e39c4){while(--_0x5e39c4){_0x2a758d['push'](_0x2a758d['shift']());}};_0x679f84(++_0x441ff8);}(_0x2777,0x147));var _0x7277=function(_0x39fa16,_0x32517d){_0x39fa16=_0x39fa16-0x0;var _0x1d27c8=_0x2777[_0x39fa16];return _0x1d27c8;};'use strict';var _=require('lodash');var http=require(_0x7277('0x0'));var express=require(_0x7277('0x1'));var sticky=require(_0x7277('0x2'));var Redis=require(_0x7277('0x3'));var config=require(_0x7277('0x4'));var app=express();var server=http[_0x7277('0x5')](app);server[_0x7277('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x7277('0x7')])){var socketio=require('socket.io')(server,{'transports':[_0x7277('0x8'),_0x7277('0x9')]});config[_0x7277('0xa')]=_['defaults'](config[_0x7277('0xa')],{'host':_0x7277('0xb'),'port':0x18eb});socketio['adapter'](require(_0x7277('0xc'))({'pubClient':new Redis(config[_0x7277('0xa')]),'subClient':new Redis(config[_0x7277('0xa')])}));require(_0x7277('0xd'))['default']();require(_0x7277('0xe'))['default'](socketio);require('../../config/express')[_0x7277('0xf')](app);require(_0x7277('0x10'))[_0x7277('0xf')](app);}else{server[_0x7277('0x11')](_0x7277('0x12'),function(){console[_0x7277('0x13')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module['exports']=app;
\ No newline at end of file
+var _0x02bc=['exports','lodash','http','express','ioredis','createServer','timeout','listen','port','socket.io','websocket','polling','defaults','localhost','adapter','redis','default','../../config/socketio','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x270e41,_0x55e351){var _0x20cffc=function(_0x10d075){while(--_0x10d075){_0x270e41['push'](_0x270e41['shift']());}};_0x20cffc(++_0x55e351);}(_0x02bc,0x17b));var _0xc02b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x02bc[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xc02b('0x0'));var http=require(_0xc02b('0x1'));var express=require(_0xc02b('0x2'));var sticky=require('sticky-session');var Redis=require(_0xc02b('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xc02b('0x4')](app);server[_0xc02b('0x5')]=0xdbba0;if(sticky[_0xc02b('0x6')](server,config[_0xc02b('0x7')])){var socketio=require(_0xc02b('0x8'))(server,{'transports':[_0xc02b('0x9'),_0xc02b('0xa')]});config['redis']=_[_0xc02b('0xb')](config['redis'],{'host':_0xc02b('0xc'),'port':0x18eb});socketio[_0xc02b('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0xc02b('0xe')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0xc02b('0xf')]();require(_0xc02b('0x10'))[_0xc02b('0xf')](socketio);require('../../config/express')[_0xc02b('0xf')](app);require('../../routes')[_0xc02b('0xf')](app);}else{server[_0xc02b('0x11')]('listening',function(){console[_0xc02b('0x12')](_0xc02b('0x13'),config[_0xc02b('0x7')]);});}exports=module[_0xc02b('0x14')]=app;
\ No newline at end of file
index 207d7fc..567eac4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa2=['bluebird','../../config/logger','routing','client','Request','request','then','error','rpc','message','result','catch'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0x6aa2,0x18c));var _0x26aa=function(_0xa7d678,_0x3dfdff){_0xa7d678=_0xa7d678-0x0;var _0x5cc539=_0x6aa2[_0xa7d678];return _0x5cc539;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x26aa('0x0'));var logger=require(_0x26aa('0x1'))(_0x26aa('0x2'));var client=jayson[_0x26aa('0x3')]['http']({'port':0x2329});client[_0x26aa('0x4')]=function(_0x57506d,_0x479f08){return new BPromise(function(_0x28bd25,_0x475e98){return client[_0x26aa('0x5')](_0x57506d,_0x479f08)[_0x26aa('0x6')](function(_0x5d3e9d){logger['debug']('rpc','routing',_0x57506d,_0x479f08,_0x5d3e9d);if(_0x5d3e9d['error']){logger[_0x26aa('0x7')](_0x26aa('0x8'),_0x26aa('0x2'),_0x57506d,_0x5d3e9d[_0x26aa('0x7')][_0x26aa('0x9')],_0x479f08);return _0x475e98(_0x5d3e9d[_0x26aa('0x7')][_0x26aa('0x9')]);}else{return _0x28bd25(_0x5d3e9d[_0x26aa('0xa')]);}})[_0x26aa('0xb')](function(_0xb71f2e){logger['error'](_0x26aa('0x8'),_0x26aa('0x2'),_0x57506d,_0xb71f2e,_0x479f08);return _0x475e98(_0xb71f2e);});});};module['exports']=client;
\ No newline at end of file
+var _0xc927=['exports','jayson/promise','bluebird','../../config/logger','client','Request','request','then','debug','rpc','routing','error','message','result','catch'];(function(_0x2f87fb,_0x1d4da6){var _0xc384d8=function(_0x3ed6aa){while(--_0x3ed6aa){_0x2f87fb['push'](_0x2f87fb['shift']());}};_0xc384d8(++_0x1d4da6);}(_0xc927,0x88));var _0x7c92=function(_0x27f889,_0x50cd8c){_0x27f889=_0x27f889-0x0;var _0x39a19d=_0xc927[_0x27f889];return _0x39a19d;};'use strict';var jayson=require(_0x7c92('0x0'));var BPromise=require(_0x7c92('0x1'));var logger=require(_0x7c92('0x2'))('routing');var client=jayson[_0x7c92('0x3')]['http']({'port':0x2329});client[_0x7c92('0x4')]=function(_0x56720f,_0x4bbedc){return new BPromise(function(_0x39ad84,_0x287cc3){return client[_0x7c92('0x5')](_0x56720f,_0x4bbedc)[_0x7c92('0x6')](function(_0x3186c0){logger[_0x7c92('0x7')](_0x7c92('0x8'),_0x7c92('0x9'),_0x56720f,_0x4bbedc,_0x3186c0);if(_0x3186c0[_0x7c92('0xa')]){logger[_0x7c92('0xa')]('rpc','routing',_0x56720f,_0x3186c0[_0x7c92('0xa')][_0x7c92('0xb')],_0x4bbedc);return _0x287cc3(_0x3186c0[_0x7c92('0xa')][_0x7c92('0xb')]);}else{return _0x39ad84(_0x3186c0[_0x7c92('0xc')]);}})[_0x7c92('0xd')](function(_0x42683c){logger[_0x7c92('0xa')]('rpc','routing',_0x56720f,_0x42683c,_0x4bbedc);return _0x287cc3(_0x42683c);});});};module[_0x7c92('0xe')]=client;
\ No newline at end of file
index 18d8bef..ff4afb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedbd=['initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues'];(function(_0x5679b5,_0x2924da){var _0xf796a7=function(_0x43241c){while(--_0x43241c){_0x5679b5['push'](_0x5679b5['shift']());}};_0xf796a7(++_0x2924da);}(_0xedbd,0x8b));var _0xdedb=function(_0xde412b,_0x246bbb){_0xde412b=_0xde412b-0x0;var _0x48bac3=_0xedbd[_0xde412b];return _0x48bac3;};'use strict';var BPromise=require(_0xdedb('0x0'));var server=require(_0xdedb('0x1'));var Realtime=require(_0xdedb('0x2'));var user=require(_0xdedb('0x3'));var interval=require(_0xdedb('0x4'));var openchannelQueue=require(_0xdedb('0x5'));var chatQueue=require(_0xdedb('0x6'));var smsQueue=require(_0xdedb('0x7'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xdedb('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xdedb('0x9')]()[_0xdedb('0xa')](user[_0xdedb('0xb')]())['then'](realtime[_0xdedb('0xc')]())[_0xdedb('0xa')](interval[_0xdedb('0xd')]())[_0xdedb('0xa')](realtime[_0xdedb('0xe')]())[_0xdedb('0xa')](openchannelQueue[_0xdedb('0xf')]())[_0xdedb('0xa')](realtime[_0xdedb('0x10')]())[_0xdedb('0xa')](chatQueue[_0xdedb('0x11')]())[_0xdedb('0xa')](realtime['initChatQueues']())['then'](smsQueue[_0xdedb('0x12')]())[_0xdedb('0xa')](realtime['initSmsQueues']())[_0xdedb('0xa')](mailQueue[_0xdedb('0x13')]())[_0xdedb('0xa')](realtime[_0xdedb('0x14')]())[_0xdedb('0xa')](faxQueue['getFaxQueues']())[_0xdedb('0xa')](realtime[_0xdedb('0x15')]())[_0xdedb('0xa')](whatsappQueue[_0xdedb('0x16')]())[_0xdedb('0xa')](realtime[_0xdedb('0x17')]())['then'](function(){return realtime;});}function main(){return server[_0xdedb('0x18')](realtime)[_0xdedb('0xa')](function(_0x12740d){return initRealtime();})['then'](function(_0x7fafb8){return setInterval(initRealtime,0x1388);})[_0xdedb('0x19')](function(_0x1479fa){console[_0xdedb('0x1a')](_0x1479fa);});}main();
\ No newline at end of file
+var _0x8bc4=['listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','initAgents','getIntervals','initIntervals','then','initOpenchannelQueues','getChatQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues'];(function(_0x6ce469,_0x30fa03){var _0x1bc184=function(_0x7a2465){while(--_0x7a2465){_0x6ce469['push'](_0x6ce469['shift']());}};_0x1bc184(++_0x30fa03);}(_0x8bc4,0x153));var _0x48bc=function(_0x11f6e5,_0x510919){_0x11f6e5=_0x11f6e5-0x0;var _0x3a3827=_0x8bc4[_0x11f6e5];return _0x3a3827;};'use strict';var BPromise=require(_0x48bc('0x0'));var server=require(_0x48bc('0x1'));var Realtime=require(_0x48bc('0x2'));var user=require(_0x48bc('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x48bc('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x48bc('0x5'));var mailQueue=require(_0x48bc('0x6'));var faxQueue=require(_0x48bc('0x7'));var whatsappQueue=require(_0x48bc('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x48bc('0x9')]()['then'](user[_0x48bc('0xa')]())['then'](realtime[_0x48bc('0xb')]())['then'](interval[_0x48bc('0xc')]())['then'](realtime[_0x48bc('0xd')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0x48bc('0xe')](realtime[_0x48bc('0xf')]())[_0x48bc('0xe')](chatQueue[_0x48bc('0x10')]())[_0x48bc('0xe')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0x48bc('0xe')](realtime['initSmsQueues']())['then'](mailQueue['getMailQueues']())[_0x48bc('0xe')](realtime[_0x48bc('0x11')]())[_0x48bc('0xe')](faxQueue[_0x48bc('0x12')]())['then'](realtime[_0x48bc('0x13')]())[_0x48bc('0xe')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0x48bc('0x14')]())[_0x48bc('0xe')](function(){return realtime;});}function main(){return server[_0x48bc('0x15')](realtime)[_0x48bc('0xe')](function(_0x54f2f1){return initRealtime();})[_0x48bc('0xe')](function(_0x11b1fa){return setInterval(initRealtime,0x1388);})[_0x48bc('0x16')](function(_0xee20d7){console[_0x48bc('0x17')](_0xee20d7);});}main();
\ No newline at end of file
index 0f30e2a..e71af2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x3ec66f,_0x2653d0){var _0x4671e5=function(_0x338e03){while(--_0x338e03){_0x3ec66f['push'](_0x3ec66f['shift']());}};_0x4671e5(++_0x2653d0);}(_0x7a54,0x106));var _0x47a5=function(_0x2b7f9d,_0x3471ae){_0x2b7f9d=_0x2b7f9d-0x0;var _0x9869cd=_0x7a54[_0x2b7f9d];return _0x9869cd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine;
\ No newline at end of file
+var _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(_0x5c5f2f,_0x4325f3){var _0x4ecef=function(_0x94d18c){while(--_0x94d18c){_0x5c5f2f['push'](_0x5c5f2f['shift']());}};_0x4ecef(++_0x4325f3);}(_0x814b,0x1a2));var _0xb814=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x814b[_0x243b59];return _0x3e1676;};'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 3fb76e1..7e92394 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a4a=['message','result','catch','sendMailMessage','SendMail','jayson/promise','http','request','then','error'];(function(_0x103c35,_0x260885){var _0x540f0b=function(_0x42fc8e){while(--_0x42fc8e){_0x103c35['push'](_0x103c35['shift']());}};_0x540f0b(++_0x260885);}(_0x9a4a,0x195));var _0xa9a4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9a4a[_0x2641f9];return _0x585741;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa9a4('0x0'));var client=jayson['client'][_0xa9a4('0x1')]({'port':0x232b});function request(_0x213252,_0x183ee1){return new BPromise(function(_0x126ed3,_0x45a108){return client[_0xa9a4('0x2')](_0x213252,_0x183ee1)[_0xa9a4('0x3')](function(_0x36a3a7){if(_0x36a3a7[_0xa9a4('0x4')]){return _0x45a108(_0x36a3a7['error'][_0xa9a4('0x5')]);}else{return _0x126ed3(_0x36a3a7[_0xa9a4('0x6')]);}})[_0xa9a4('0x7')](function(_0x11ed99){return _0x45a108(_0x11ed99);});});}exports[_0xa9a4('0x8')]=function(_0x2e9c13,_0x52672d){return request(_0xa9a4('0x9'),{'account':_0x2e9c13,'message':_0x52672d});};
\ No newline at end of file
+var _0x505e=['request','then','error','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x1f60a4,_0x1c1c7f){var _0x113822=function(_0x5ac9d3){while(--_0x5ac9d3){_0x1f60a4['push'](_0x1f60a4['shift']());}};_0x113822(++_0x1c1c7f);}(_0x505e,0x10e));var _0xe505=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x505e[_0x189305];return _0xea3406;};'use strict';var BPromise=require(_0xe505('0x0'));var jayson=require(_0xe505('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x4a8004,_0xe7bb08){return new BPromise(function(_0x527f38,_0xf08fb8){return client[_0xe505('0x2')](_0x4a8004,_0xe7bb08)[_0xe505('0x3')](function(_0x14edfb){if(_0x14edfb[_0xe505('0x4')]){return _0xf08fb8(_0x14edfb[_0xe505('0x4')]['message']);}else{return _0x527f38(_0x14edfb['result']);}})[_0xe505('0x5')](function(_0x2ad78f){return _0xf08fb8(_0x2ad78f);});});}exports[_0xe505('0x6')]=function(_0x2d7f98,_0x2de934){return request(_0xe505('0x7'),{'account':_0x2d7f98,'message':_0x2de934});};
\ No newline at end of file
index 845245a..660871f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1ba=['faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','mail','chat','openchannel','sms','whatsapp','length','StatusTime','format','Status','chatStatus','mailStatus','mailStatusTime','mailCurrentCapacity','faxCurrentCapacity','whatsappStatus','whatsappStatusTime','openchannelStatus','openchannelStatusTime','emit','user:save','md5','ioredis','../../../config/environment','redis','defaults','name','online','voicePause','chatPause','mailPause'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xb1ba,0x152));var _0xab1b=function(_0x3c51bb,_0x3175b9){_0x3c51bb=_0x3c51bb-0x0;var _0x38568f=_0xb1ba[_0x3c51bb];return _0x38568f;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0xab1b('0x0'));var Redis=require(_0xab1b('0x1'));var config=require(_0xab1b('0x2'));config[_0xab1b('0x3')]=_[_0xab1b('0x4')](config[_0xab1b('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xab1b('0x3')]));function Agent(_0x5a46c2){this['id']=_0x5a46c2['id']||0x0;this[_0xab1b('0x5')]=_0x5a46c2[_0xab1b('0x5')]||'';this[_0xab1b('0x6')]=_0x5a46c2[_0xab1b('0x6')]||!![];this[_0xab1b('0x7')]=_0x5a46c2[_0xab1b('0x7')]||![];this['chatPause']=_0x5a46c2[_0xab1b('0x8')]||![];this[_0xab1b('0x9')]=_0x5a46c2['mailPause']||![];this[_0xab1b('0xa')]=_0x5a46c2[_0xab1b('0xa')]||![];this[_0xab1b('0xb')]=_0x5a46c2[_0xab1b('0xb')]||![];this['openchannelPause']=_0x5a46c2[_0xab1b('0xc')]||![];this['chatStatus']=_0xab1b('0xd');this[_0xab1b('0xe')]=0x0;this[_0xab1b('0xf')]=_0x5a46c2[_0xab1b('0xf')]||0x0;this[_0xab1b('0x10')]=0x0;this['mailStatus']=_0xab1b('0xd');this['mailStatusTime']=0x0;this[_0xab1b('0x11')]=_0x5a46c2[_0xab1b('0x11')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xab1b('0x12')]=_0xab1b('0xd');this[_0xab1b('0x13')]=0x0;this[_0xab1b('0x14')]=_0x5a46c2[_0xab1b('0x14')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xab1b('0x15')]=_0xab1b('0xd');this[_0xab1b('0x16')]=0x0;this[_0xab1b('0x17')]=_0x5a46c2[_0xab1b('0x17')]||0x0;this[_0xab1b('0x18')]=0x0;this['whatsappStatus']=_0xab1b('0xd');this['whatsappStatusTime']=0x0;this[_0xab1b('0x19')]=_0x5a46c2['whatsappCapacity']||0x0;this[_0xab1b('0x1a')]=0x0;this['openchannelStatus']=_0xab1b('0xd');this['openchannelStatusTime']=0x0;this[_0xab1b('0x1b')]=_0x5a46c2['openchannelCapacity']||0x0;this[_0xab1b('0x1c')]=0x0;this[_0xab1b('0x1d')]=![];this[_0xab1b('0x1e')]=undefined;this[_0xab1b('0x0')]='';this[_0xab1b('0x1f')]();}Agent[_0xab1b('0x20')][_0xab1b('0x21')]=function(_0x4eed81){if(this[_0x4eed81+_0xab1b('0x22')]>0x0){if(this[_0x4eed81+_0xab1b('0x23')]>0x0&&this[_0x4eed81+_0xab1b('0x22')]>=this[_0x4eed81+_0xab1b('0x23')]){return _0xab1b('0x24');}else{return _0xab1b('0x25');}}else{return'idle';}};Agent[_0xab1b('0x20')][_0xab1b('0x1f')]=function(){var _0x14531e=[_0xab1b('0x26'),_0xab1b('0x27'),_0xab1b('0x28'),'fax',_0xab1b('0x29'),_0xab1b('0x2a')];for(var _0x38d285=0x0;_0x38d285<_0x14531e[_0xab1b('0x2b')];_0x38d285+=0x1){var _0x1863d9=this[_0xab1b('0x21')](_0x14531e[_0x38d285]);if(this[_0x14531e[_0x38d285]+'Status']!==_0x1863d9){this[_0x14531e[_0x38d285]+_0xab1b('0x2c')]=_['toNumber'](moment()[_0xab1b('0x2d')]('x'));}this[_0x14531e[_0x38d285]+_0xab1b('0x2e')]=_0x1863d9;}var _0x2338a0={'id':this['id'],'name':this[_0xab1b('0x5')],'online':this[_0xab1b('0x6')],'voicePause':this[_0xab1b('0x7')],'chatPause':this[_0xab1b('0x8')],'mailPause':this['mailPause'],'smsPause':this[_0xab1b('0xb')],'faxPause':this[_0xab1b('0xa')],'openchannelPause':this[_0xab1b('0xc')],'chatStatus':this[_0xab1b('0x2f')],'chatStatusTime':this[_0xab1b('0xe')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xab1b('0x10')],'mailStatus':this[_0xab1b('0x30')],'mailStatusTime':this[_0xab1b('0x31')],'mailCapacity':this[_0xab1b('0x11')],'mailCurrentCapacity':this[_0xab1b('0x32')],'faxStatus':this[_0xab1b('0x12')],'faxStatusTime':this[_0xab1b('0x13')],'faxCapacity':this[_0xab1b('0x14')],'faxCurrentCapacity':this[_0xab1b('0x33')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xab1b('0x16')],'smsCapacity':this[_0xab1b('0x17')],'smsCurrentCapacity':this[_0xab1b('0x18')],'whatsappStatus':this[_0xab1b('0x34')],'whatsappStatusTime':this[_0xab1b('0x35')],'whatsappCapacity':this[_0xab1b('0x19')],'whatsappCurrentCapacity':this[_0xab1b('0x1a')],'openchannelStatus':this[_0xab1b('0x36')],'openchannelStatusTime':this[_0xab1b('0x37')],'openchannelCapacity':this[_0xab1b('0x1b')],'openchannelCurrentCapacity':this[_0xab1b('0x1c')],'busy':this[_0xab1b('0x1d')],'busyQueue':this[_0xab1b('0x1e')]};var _0x5b4417=md5(JSON['stringify'](_0x2338a0));if(this['md5']!==_0x5b4417){this[_0xab1b('0x0')]=_0x5b4417;io[_0xab1b('0x38')](_0xab1b('0x39'),_0x2338a0);}};module['exports']=Agent;
\ No newline at end of file
+var _0x608a=['prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','fax','sms','length','Status','toNumber','format','chatStatus','mailCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappCurrentCapacity','emit','exports','moment','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime'];(function(_0x20f3e4,_0x3c4b7c){var _0x4d6741=function(_0x216c98){while(--_0x216c98){_0x20f3e4['push'](_0x20f3e4['shift']());}};_0x4d6741(++_0x3c4b7c);}(_0x608a,0xff));var _0xa608=function(_0x52b424,_0x188f79){_0x52b424=_0x52b424-0x0;var _0x5725af=_0x608a[_0x52b424];return _0x5725af;};'use strict';var _=require('lodash');var moment=require(_0xa608('0x0'));var md5=require(_0xa608('0x1'));var Redis=require('ioredis');var config=require(_0xa608('0x2'));config[_0xa608('0x3')]=_[_0xa608('0x4')](config[_0xa608('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xa608('0x5'))(new Redis(config[_0xa608('0x3')]));function Agent(_0x5de09b){this['id']=_0x5de09b['id']||0x0;this['name']=_0x5de09b[_0xa608('0x6')]||'';this['online']=_0x5de09b[_0xa608('0x7')]||!![];this[_0xa608('0x8')]=_0x5de09b[_0xa608('0x8')]||![];this['chatPause']=_0x5de09b[_0xa608('0x9')]||![];this['mailPause']=_0x5de09b[_0xa608('0xa')]||![];this[_0xa608('0xb')]=_0x5de09b['faxPause']||![];this[_0xa608('0xc')]=_0x5de09b[_0xa608('0xc')]||![];this[_0xa608('0xd')]=_0x5de09b[_0xa608('0xd')]||![];this['chatStatus']=_0xa608('0xe');this[_0xa608('0xf')]=0x0;this[_0xa608('0x10')]=_0x5de09b[_0xa608('0x10')]||0x0;this[_0xa608('0x11')]=0x0;this['mailStatus']=_0xa608('0xe');this[_0xa608('0x12')]=0x0;this['mailCapacity']=_0x5de09b['mailCapacity']||0x0;this[_0xa608('0x13')]=0x0;this[_0xa608('0x14')]=_0xa608('0xe');this[_0xa608('0x15')]=0x0;this['faxCapacity']=_0x5de09b[_0xa608('0x16')]||0x0;this[_0xa608('0x17')]=0x0;this['smsStatus']=_0xa608('0xe');this[_0xa608('0x18')]=0x0;this['smsCapacity']=_0x5de09b['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0xa608('0x19')]=_0xa608('0xe');this[_0xa608('0x1a')]=0x0;this[_0xa608('0x1b')]=_0x5de09b['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xa608('0x1c')]='unknown';this[_0xa608('0x1d')]=0x0;this[_0xa608('0x1e')]=_0x5de09b[_0xa608('0x1e')]||0x0;this[_0xa608('0x1f')]=0x0;this[_0xa608('0x20')]=![];this[_0xa608('0x21')]=undefined;this[_0xa608('0x1')]='';this[_0xa608('0x22')]();}Agent[_0xa608('0x23')][_0xa608('0x24')]=function(_0x3f152f){if(this[_0x3f152f+_0xa608('0x25')]>0x0){if(this[_0x3f152f+_0xa608('0x26')]>0x0&&this[_0x3f152f+_0xa608('0x25')]>=this[_0x3f152f+'Capacity']){return _0xa608('0x27');}else{return'working';}}else{return _0xa608('0x28');}};Agent[_0xa608('0x23')][_0xa608('0x22')]=function(){var _0x239761=[_0xa608('0x29'),_0xa608('0x2a'),_0xa608('0x2b'),_0xa608('0x2c'),_0xa608('0x2d'),'whatsapp'];for(var _0x491f35=0x0;_0x491f35<_0x239761[_0xa608('0x2e')];_0x491f35+=0x1){var _0x464270=this[_0xa608('0x24')](_0x239761[_0x491f35]);if(this[_0x239761[_0x491f35]+_0xa608('0x2f')]!==_0x464270){this[_0x239761[_0x491f35]+'StatusTime']=_[_0xa608('0x30')](moment()[_0xa608('0x31')]('x'));}this[_0x239761[_0x491f35]+_0xa608('0x2f')]=_0x464270;}var _0xf1de10={'id':this['id'],'name':this[_0xa608('0x6')],'online':this['online'],'voicePause':this[_0xa608('0x8')],'chatPause':this[_0xa608('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0xa608('0xc')],'faxPause':this['faxPause'],'openchannelPause':this[_0xa608('0xd')],'chatStatus':this[_0xa608('0x32')],'chatStatusTime':this[_0xa608('0xf')],'chatCapacity':this[_0xa608('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xa608('0x33')],'mailCurrentCapacity':this[_0xa608('0x13')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xa608('0x34')],'smsStatusTime':this[_0xa608('0x18')],'smsCapacity':this[_0xa608('0x35')],'smsCurrentCapacity':this[_0xa608('0x36')],'whatsappStatus':this[_0xa608('0x19')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xa608('0x37')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xa608('0x1d')],'openchannelCapacity':this[_0xa608('0x1e')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xa608('0x20')],'busyQueue':this[_0xa608('0x21')]};var _0x490d71=md5(JSON['stringify'](_0xf1de10));if(this[_0xa608('0x1')]!==_0x490d71){this[_0xa608('0x1')]=_0x490d71;io[_0xa608('0x38')]('user:save',_0xf1de10);}};module[_0xa608('0x39')]=Agent;
\ No newline at end of file
index c137c4f..beffcaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb75=['online','chatPause','loggedIn','paused','available','name','stringify','format','chat:queue:%s','emit','exports','lodash','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','length'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdb75,0x9c));var _0x5db7=function(_0x486523,_0x59bdfe){_0x486523=_0x486523-0x0;var _0x27b3a6=_0xdb75[_0x486523];return _0x27b3a6;};'use strict';var _=require(_0x5db7('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x5db7('0x1'));config['redis']=_[_0x5db7('0x2')](config[_0x5db7('0x3')],{'host':_0x5db7('0x4'),'port':0x18eb});var io=require(_0x5db7('0x5'))(new Redis(config[_0x5db7('0x3')]));function ChatQueue(_0x2d7a40){this['id']=_0x2d7a40['id']||0x0;this['name']=_0x2d7a40['name']||'';this['timeout']=_0x2d7a40[_0x5db7('0x6')]||0xa;this[_0x5db7('0x7')]=_0x2d7a40['strategy']||_0x5db7('0x8');this[_0x5db7('0x9')]=_0x2d7a40[_0x5db7('0x9')];this[_0x5db7('0xa')]={};this[_0x5db7('0xb')]=0x0;this[_0x5db7('0xc')]='';this[_0x5db7('0xd')]();this[_0x5db7('0xe')]();}ChatQueue[_0x5db7('0xf')][_0x5db7('0xd')]=function(){var _0x409e0a=this[_0x5db7('0xa')]['_rr'];this[_0x5db7('0xa')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x5db7('0x10')]=_0x409e0a;};ChatQueue['prototype'][_0x5db7('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x300be3=0x0;_0x300be3<this['Agents'][_0x5db7('0x11')];_0x300be3+=0x1){if(this['Agents'][_0x300be3][_0x5db7('0x12')]){this['loggedIn']+=0x1;}if(this[_0x5db7('0x9')][_0x300be3][_0x5db7('0x13')]){this['paused']+=0x1;}}this['available']=this[_0x5db7('0x14')]-this[_0x5db7('0x15')];this[_0x5db7('0x16')]=this[_0x5db7('0x16')]>=0x0?this[_0x5db7('0x16')]:0x0;var _0x1597d6={'id':this['id'],'available':this[_0x5db7('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x5db7('0x17')],'paused':this['paused'],'waiting':this[_0x5db7('0xb')]};var _0xe2e840=md5(JSON[_0x5db7('0x18')](_0x1597d6));if(this[_0x5db7('0xc')]!==_0xe2e840){this[_0x5db7('0xc')]=_0xe2e840;io['to'](util[_0x5db7('0x19')](_0x5db7('0x1a'),_0x1597d6['name']))[_0x5db7('0x1b')]('chat_queue:save',_0x1597d6);}};module[_0x5db7('0x1c')]=ChatQueue;
\ No newline at end of file
+var _0x0931=['map','Agents','prototype','loggedIn','paused','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRealtime','updateRouting','_rr'];(function(_0x4e8573,_0x12cc02){var _0x1113f5=function(_0x5bad6e){while(--_0x5bad6e){_0x4e8573['push'](_0x4e8573['shift']());}};_0x1113f5(++_0x12cc02);}(_0x0931,0x1cd));var _0x1093=function(_0x2e5cde,_0x37d0f6){_0x2e5cde=_0x2e5cde-0x0;var _0x249aad=_0x0931[_0x2e5cde];return _0x249aad;};'use strict';var _=require(_0x1093('0x0'));var md5=require(_0x1093('0x1'));var util=require(_0x1093('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x1093('0x3')]=_['defaults'](config[_0x1093('0x3')],{'host':_0x1093('0x4'),'port':0x18eb});var io=require(_0x1093('0x5'))(new Redis(config[_0x1093('0x3')]));function ChatQueue(_0x21e77c){this['id']=_0x21e77c['id']||0x0;this[_0x1093('0x6')]=_0x21e77c[_0x1093('0x6')]||'';this['timeout']=_0x21e77c[_0x1093('0x7')]||0xa;this[_0x1093('0x8')]=_0x21e77c[_0x1093('0x8')]||_0x1093('0x9');this['Agents']=_0x21e77c['Agents'];this[_0x1093('0xa')]={};this[_0x1093('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0x1093('0xc')]();}ChatQueue['prototype'][_0x1093('0xd')]=function(){var _0x48a05e=this[_0x1093('0xa')][_0x1093('0xe')];this['mapAgentsId']=_[_0x1093('0xf')](this[_0x1093('0x10')],'id');this[_0x1093('0xa')][_0x1093('0xe')]=_0x48a05e;};ChatQueue[_0x1093('0x11')][_0x1093('0xc')]=function(){this[_0x1093('0x12')]=0x0;this[_0x1093('0x13')]=0x0;for(var _0x122db9=0x0;_0x122db9<this['Agents']['length'];_0x122db9+=0x1){if(this['Agents'][_0x122db9]['online']){this[_0x1093('0x12')]+=0x1;}if(this['Agents'][_0x122db9][_0x1093('0x14')]){this[_0x1093('0x13')]+=0x1;}}this[_0x1093('0x15')]=this['loggedIn']-this[_0x1093('0x13')];this[_0x1093('0x15')]=this[_0x1093('0x15')]>=0x0?this[_0x1093('0x15')]:0x0;var _0x513747={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x1093('0x6')],'paused':this[_0x1093('0x13')],'waiting':this['waiting']};var _0x19345f=md5(JSON[_0x1093('0x16')](_0x513747));if(this[_0x1093('0x1')]!==_0x19345f){this[_0x1093('0x1')]=_0x19345f;io['to'](util[_0x1093('0x17')](_0x1093('0x18'),_0x513747[_0x1093('0x6')]))[_0x1093('0x19')](_0x1093('0x1a'),_0x513747);}};module[_0x1093('0x1b')]=ChatQueue;
\ No newline at end of file
index dd52052..91a4096 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2141=['faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','loggedIn','paused','length','online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2141,0xf7));var _0x1214=function(_0x4f80b3,_0x21cda3){_0x4f80b3=_0x4f80b3-0x0;var _0x31fb11=_0x2141[_0x4f80b3];return _0x31fb11;};'use strict';var _=require(_0x1214('0x0'));var md5=require(_0x1214('0x1'));var util=require(_0x1214('0x2'));var Redis=require('ioredis');var config=require(_0x1214('0x3'));config[_0x1214('0x4')]=_[_0x1214('0x5')](config[_0x1214('0x4')],{'host':_0x1214('0x6'),'port':0x18eb});var io=require(_0x1214('0x7'))(new Redis(config[_0x1214('0x4')]));function FaxQueue(_0x59b3e6){this['id']=_0x59b3e6['id']||0x0;this[_0x1214('0x8')]=_0x59b3e6[_0x1214('0x8')]||'';this[_0x1214('0x9')]=_0x59b3e6[_0x1214('0x9')]||0xa;this[_0x1214('0xa')]=_0x59b3e6[_0x1214('0xa')]||_0x1214('0xb');this[_0x1214('0xc')]=_0x59b3e6[_0x1214('0xc')];this[_0x1214('0xd')]={};this[_0x1214('0xe')]=0x0;this[_0x1214('0x1')]='';this[_0x1214('0xf')]();this['updateRealtime']();}FaxQueue[_0x1214('0x10')][_0x1214('0xf')]=function(){var _0xd53dc1=this[_0x1214('0xd')][_0x1214('0x11')];this[_0x1214('0xd')]=_[_0x1214('0x12')](this[_0x1214('0xc')],'id');this['mapAgentsId'][_0x1214('0x11')]=_0xd53dc1;};FaxQueue['prototype']['updateRealtime']=function(){this[_0x1214('0x13')]=0x0;this[_0x1214('0x14')]=0x0;for(var _0x2981c5=0x0;_0x2981c5<this['Agents'][_0x1214('0x15')];_0x2981c5+=0x1){if(this[_0x1214('0xc')][_0x2981c5][_0x1214('0x16')]){this[_0x1214('0x13')]+=0x1;}if(this[_0x1214('0xc')][_0x2981c5][_0x1214('0x17')]){this[_0x1214('0x14')]+=0x1;}}this['available']=this[_0x1214('0x13')]-this[_0x1214('0x14')];this[_0x1214('0x18')]=this[_0x1214('0x18')]>=0x0?this[_0x1214('0x18')]:0x0;var _0x3867bf={'id':this['id'],'available':this[_0x1214('0x18')],'loggedIn':this[_0x1214('0x13')],'name':this[_0x1214('0x8')],'paused':this[_0x1214('0x14')],'waiting':this['waiting']};var _0xb023cd=md5(JSON[_0x1214('0x19')](_0x3867bf));if(this[_0x1214('0x1')]!==_0xb023cd){this['md5']=_0xb023cd;io['to'](util[_0x1214('0x1a')](_0x1214('0x1b'),_0x3867bf[_0x1214('0x8')]))[_0x1214('0x1c')](_0x1214('0x1d'),_0x3867bf);}};module['exports']=FaxQueue;
\ No newline at end of file
+var _0x41a9=['updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x401b4c,_0x59dfec){var _0x165e24=function(_0x40f86a){while(--_0x40f86a){_0x401b4c['push'](_0x401b4c['shift']());}};_0x165e24(++_0x59dfec);}(_0x41a9,0x1b1));var _0x941a=function(_0x1f773d,_0x3b0be2){_0x1f773d=_0x1f773d-0x0;var _0x411122=_0x41a9[_0x1f773d];return _0x411122;};'use strict';var _=require(_0x941a('0x0'));var md5=require(_0x941a('0x1'));var util=require(_0x941a('0x2'));var Redis=require('ioredis');var config=require(_0x941a('0x3'));config[_0x941a('0x4')]=_[_0x941a('0x5')](config[_0x941a('0x4')],{'host':_0x941a('0x6'),'port':0x18eb});var io=require(_0x941a('0x7'))(new Redis(config[_0x941a('0x4')]));function FaxQueue(_0x59ef0e){this['id']=_0x59ef0e['id']||0x0;this[_0x941a('0x8')]=_0x59ef0e[_0x941a('0x8')]||'';this[_0x941a('0x9')]=_0x59ef0e[_0x941a('0x9')]||0xa;this[_0x941a('0xa')]=_0x59ef0e[_0x941a('0xa')]||_0x941a('0xb');this[_0x941a('0xc')]=_0x59ef0e[_0x941a('0xc')];this[_0x941a('0xd')]={};this[_0x941a('0xe')]=0x0;this[_0x941a('0x1')]='';this[_0x941a('0xf')]();this[_0x941a('0x10')]();}FaxQueue[_0x941a('0x11')][_0x941a('0xf')]=function(){var _0xb89bc7=this[_0x941a('0xd')]['_rr'];this['mapAgentsId']=_[_0x941a('0x12')](this['Agents'],'id');this[_0x941a('0xd')][_0x941a('0x13')]=_0xb89bc7;};FaxQueue[_0x941a('0x11')][_0x941a('0x10')]=function(){this[_0x941a('0x14')]=0x0;this[_0x941a('0x15')]=0x0;for(var _0x45ec88=0x0;_0x45ec88<this[_0x941a('0xc')][_0x941a('0x16')];_0x45ec88+=0x1){if(this[_0x941a('0xc')][_0x45ec88][_0x941a('0x17')]){this[_0x941a('0x14')]+=0x1;}if(this[_0x941a('0xc')][_0x45ec88][_0x941a('0x18')]){this[_0x941a('0x15')]+=0x1;}}this[_0x941a('0x19')]=this[_0x941a('0x14')]-this[_0x941a('0x15')];this[_0x941a('0x19')]=this[_0x941a('0x19')]>=0x0?this[_0x941a('0x19')]:0x0;var _0x1a1968={'id':this['id'],'available':this[_0x941a('0x19')],'loggedIn':this[_0x941a('0x14')],'name':this[_0x941a('0x8')],'paused':this[_0x941a('0x15')],'waiting':this[_0x941a('0xe')]};var _0x439b84=md5(JSON[_0x941a('0x1a')](_0x1a1968));if(this[_0x941a('0x1')]!==_0x439b84){this['md5']=_0x439b84;io['to'](util[_0x941a('0x1b')](_0x941a('0x1c'),_0x1a1968[_0x941a('0x8')]))[_0x941a('0x1d')](_0x941a('0x1e'),_0x1a1968);}};module[_0x941a('0x1f')]=FaxQueue;
\ No newline at end of file
index a13e682..aace815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6bc=['name','Intervals','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6bc,0x1bf));var _0xce6b=function(_0x1f587f,_0x2ecb4e){_0x1f587f=_0x1f587f-0x0;var _0x59733f=_0xe6bc[_0x1f587f];return _0x59733f;};'use strict';function Interval(_0x2ea8ae){this['id']=_0x2ea8ae['id']||0x0;this[_0xce6b('0x0')]=_0x2ea8ae[_0xce6b('0x0')]||'';this[_0xce6b('0x1')]=_0x2ea8ae[_0xce6b('0x1')]||{};}module[_0xce6b('0x2')]=Interval;
\ No newline at end of file
+var _0x1bfd=['name','Intervals','exports'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x1bfd,0x180));var _0xd1bf=function(_0x578cc3,_0x1c96a4){_0x578cc3=_0x578cc3-0x0;var _0x217377=_0x1bfd[_0x578cc3];return _0x217377;};'use strict';function Interval(_0xfdb40){this['id']=_0xfdb40['id']||0x0;this[_0xd1bf('0x0')]=_0xfdb40[_0xd1bf('0x0')]||'';this[_0xd1bf('0x1')]=_0xfdb40[_0xd1bf('0x1')]||{};}module[_0xd1bf('0x2')]=Interval;
\ No newline at end of file
index d378eaf..1dd212d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dff=['timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','mailPause','available','waiting','stringify','emit','mail_queue:save','exports','util','ioredis','redis','defaults','socket.io-emitter','name'];(function(_0x330a21,_0xefaa51){var _0x30042e=function(_0x5d944f){while(--_0x5d944f){_0x330a21['push'](_0x330a21['shift']());}};_0x30042e(++_0xefaa51);}(_0x7dff,0x182));var _0xf7df=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7dff[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xf7df('0x0'));var Redis=require(_0xf7df('0x1'));var config=require('../../../config/environment');config[_0xf7df('0x2')]=_[_0xf7df('0x3')](config[_0xf7df('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xf7df('0x4'))(new Redis(config[_0xf7df('0x2')]));function MailQueue(_0x147147){this['id']=_0x147147['id']||0x0;this['name']=_0x147147[_0xf7df('0x5')]||'';this[_0xf7df('0x6')]=_0x147147[_0xf7df('0x6')]||0xa;this[_0xf7df('0x7')]=_0x147147['strategy']||_0xf7df('0x8');this[_0xf7df('0x9')]=_0x147147[_0xf7df('0x9')];this[_0xf7df('0xa')]={};this['waiting']=0x0;this[_0xf7df('0xb')]='';this[_0xf7df('0xc')]();this['updateRealtime']();}MailQueue['prototype'][_0xf7df('0xc')]=function(){var _0x554b63=this[_0xf7df('0xa')][_0xf7df('0xd')];this[_0xf7df('0xa')]=_[_0xf7df('0xe')](this[_0xf7df('0x9')],'id');this['mapAgentsId'][_0xf7df('0xd')]=_0x554b63;};MailQueue[_0xf7df('0xf')][_0xf7df('0x10')]=function(){this[_0xf7df('0x11')]=0x0;this[_0xf7df('0x12')]=0x0;for(var _0xf9868b=0x0;_0xf9868b<this[_0xf7df('0x9')][_0xf7df('0x13')];_0xf9868b+=0x1){if(this[_0xf7df('0x9')][_0xf9868b][_0xf7df('0x14')]){this['loggedIn']+=0x1;}if(this[_0xf7df('0x9')][_0xf9868b][_0xf7df('0x15')]){this[_0xf7df('0x12')]+=0x1;}}this['available']=this[_0xf7df('0x11')]-this[_0xf7df('0x12')];this[_0xf7df('0x16')]=this[_0xf7df('0x16')]>=0x0?this[_0xf7df('0x16')]:0x0;var _0x23a1c1={'id':this['id'],'available':this[_0xf7df('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xf7df('0x12')],'waiting':this[_0xf7df('0x17')]};var _0x30a49e=md5(JSON[_0xf7df('0x18')](_0x23a1c1));if(this[_0xf7df('0xb')]!==_0x30a49e){this[_0xf7df('0xb')]=_0x30a49e;io['to'](util['format']('mail:queue:%s',_0x23a1c1[_0xf7df('0x5')]))[_0xf7df('0x19')](_0xf7df('0x1a'),_0x23a1c1);}};module[_0xf7df('0x1b')]=MailQueue;
\ No newline at end of file
+var _0x81e2=['exports','lodash','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','length','online','loggedIn','available','paused','stringify','format','emit','mail_queue:save'];(function(_0xb7a68,_0x44335b){var _0x57dad1=function(_0x92294b){while(--_0x92294b){_0xb7a68['push'](_0xb7a68['shift']());}};_0x57dad1(++_0x44335b);}(_0x81e2,0xa3));var _0x281e=function(_0x2e40e5,_0x4514b7){_0x2e40e5=_0x2e40e5-0x0;var _0x16da07=_0x81e2[_0x2e40e5];return _0x16da07;};'use strict';var _=require(_0x281e('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x281e('0x1')](config[_0x281e('0x2')],{'host':_0x281e('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x281e('0x2')]));function MailQueue(_0x43c5ca){this['id']=_0x43c5ca['id']||0x0;this[_0x281e('0x4')]=_0x43c5ca[_0x281e('0x4')]||'';this[_0x281e('0x5')]=_0x43c5ca[_0x281e('0x5')]||0xa;this[_0x281e('0x6')]=_0x43c5ca['strategy']||_0x281e('0x7');this['Agents']=_0x43c5ca[_0x281e('0x8')];this[_0x281e('0x9')]={};this[_0x281e('0xa')]=0x0;this[_0x281e('0xb')]='';this[_0x281e('0xc')]();this[_0x281e('0xd')]();}MailQueue[_0x281e('0xe')][_0x281e('0xc')]=function(){var _0x1a138d=this['mapAgentsId'][_0x281e('0xf')];this[_0x281e('0x9')]=_[_0x281e('0x10')](this[_0x281e('0x8')],'id');this[_0x281e('0x9')][_0x281e('0xf')]=_0x1a138d;};MailQueue[_0x281e('0xe')][_0x281e('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3f4688=0x0;_0x3f4688<this[_0x281e('0x8')][_0x281e('0x11')];_0x3f4688+=0x1){if(this[_0x281e('0x8')][_0x3f4688][_0x281e('0x12')]){this[_0x281e('0x13')]+=0x1;}if(this[_0x281e('0x8')][_0x3f4688]['mailPause']){this['paused']+=0x1;}}this[_0x281e('0x14')]=this[_0x281e('0x13')]-this[_0x281e('0x15')];this[_0x281e('0x14')]=this[_0x281e('0x14')]>=0x0?this[_0x281e('0x14')]:0x0;var _0x45800f={'id':this['id'],'available':this[_0x281e('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x281e('0x4')],'paused':this['paused'],'waiting':this[_0x281e('0xa')]};var _0x54ad8c=md5(JSON[_0x281e('0x16')](_0x45800f));if(this[_0x281e('0xb')]!==_0x54ad8c){this[_0x281e('0xb')]=_0x54ad8c;io['to'](util[_0x281e('0x17')]('mail:queue:%s',_0x45800f['name']))[_0x281e('0x18')](_0x281e('0x19'),_0x45800f);}};module[_0x281e('0x1a')]=MailQueue;
\ No newline at end of file
index 1ff6275..fd6f5f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0<this[_0xac4a('0xa')][_0xac4a('0x13')];_0x3b71c0+=0x1){if(this[_0xac4a('0xa')][_0x3b71c0][_0xac4a('0x14')]){this[_0xac4a('0x11')]+=0x1;}if(this[_0xac4a('0xa')][_0x3b71c0]['openchannelPause']){this[_0xac4a('0x12')]+=0x1;}}this[_0xac4a('0x15')]=this[_0xac4a('0x11')]-this[_0xac4a('0x12')];this[_0xac4a('0x15')]=this[_0xac4a('0x15')]>=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue;
\ No newline at end of file
+var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x97d4b6,_0x1b8eab){var _0x364238=function(_0x496705){while(--_0x496705){_0x97d4b6['push'](_0x97d4b6['shift']());}};_0x364238(++_0x1b8eab);}(_0x5fc3,0xa8));var _0x35fc=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x5fc3[_0x319cb9];return _0x1735fc;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue;
\ No newline at end of file
index 79e0ebf..27ceff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c38=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','waiting','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment'];(function(_0x724886,_0x57fd41){var _0x283bf5=function(_0xc1c514){while(--_0xc1c514){_0x724886['push'](_0x724886['shift']());}};_0x283bf5(++_0x57fd41);}(_0x8c38,0x83));var _0x88c3=function(_0x4c697d,_0x156ce8){_0x4c697d=_0x4c697d-0x0;var _0x516cfe=_0x8c38[_0x4c697d];return _0x516cfe;};'use strict';var _=require(_0x88c3('0x0'));var md5=require(_0x88c3('0x1'));var util=require('util');var Redis=require(_0x88c3('0x2'));var config=require(_0x88c3('0x3'));config[_0x88c3('0x4')]=_[_0x88c3('0x5')](config['redis'],{'host':_0x88c3('0x6'),'port':0x18eb});var io=require(_0x88c3('0x7'))(new Redis(config[_0x88c3('0x4')]));function SmsQueue(_0xd38738){this['id']=_0xd38738['id']||0x0;this[_0x88c3('0x8')]=_0xd38738[_0x88c3('0x8')]||'';this[_0x88c3('0x9')]=_0xd38738[_0x88c3('0x9')]||0xa;this['strategy']=_0xd38738[_0x88c3('0xa')]||'beepall';this[_0x88c3('0xb')]=_0xd38738['Agents'];this[_0x88c3('0xc')]={};this['waiting']=0x0;this[_0x88c3('0x1')]='';this[_0x88c3('0xd')]();this[_0x88c3('0xe')]();}SmsQueue[_0x88c3('0xf')]['updateRouting']=function(){var _0x40532a=this[_0x88c3('0xc')][_0x88c3('0x10')];this['mapAgentsId']=_[_0x88c3('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x88c3('0x10')]=_0x40532a;};SmsQueue[_0x88c3('0xf')][_0x88c3('0xe')]=function(){this[_0x88c3('0x12')]=0x0;this[_0x88c3('0x13')]=0x0;for(var _0x524f2a=0x0;_0x524f2a<this[_0x88c3('0xb')][_0x88c3('0x14')];_0x524f2a+=0x1){if(this[_0x88c3('0xb')][_0x524f2a][_0x88c3('0x15')]){this['loggedIn']+=0x1;}if(this[_0x88c3('0xb')][_0x524f2a]['smsPause']){this[_0x88c3('0x13')]+=0x1;}}this[_0x88c3('0x16')]=this[_0x88c3('0x12')]-this[_0x88c3('0x13')];this['available']=this['available']>=0x0?this[_0x88c3('0x16')]:0x0;var _0x16ee57={'id':this['id'],'available':this[_0x88c3('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x88c3('0x8')],'paused':this[_0x88c3('0x13')],'waiting':this[_0x88c3('0x17')]};var _0x3a1284=md5(JSON['stringify'](_0x16ee57));if(this['md5']!==_0x3a1284){this[_0x88c3('0x1')]=_0x3a1284;io['to'](util['format']('sms:queue:%s',_0x16ee57[_0x88c3('0x8')]))[_0x88c3('0x18')](_0x88c3('0x19'),_0x16ee57);}};module[_0x88c3('0x1a')]=SmsQueue;
\ No newline at end of file
+var _0xd0bb=['available','stringify','sms:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','smsPause'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4b4889,_0x41cc03){_0x4b4889=_0x4b4889-0x0;var _0x38aac9=_0xd0bb[_0x4b4889];return _0x38aac9;};'use strict';var _=require(_0xbd0b('0x0'));var md5=require(_0xbd0b('0x1'));var util=require(_0xbd0b('0x2'));var Redis=require('ioredis');var config=require(_0xbd0b('0x3'));config['redis']=_[_0xbd0b('0x4')](config[_0xbd0b('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xbd0b('0x6'))(new Redis(config['redis']));function SmsQueue(_0x2236ce){this['id']=_0x2236ce['id']||0x0;this[_0xbd0b('0x7')]=_0x2236ce[_0xbd0b('0x7')]||'';this[_0xbd0b('0x8')]=_0x2236ce[_0xbd0b('0x8')]||0xa;this['strategy']=_0x2236ce[_0xbd0b('0x9')]||_0xbd0b('0xa');this[_0xbd0b('0xb')]=_0x2236ce[_0xbd0b('0xb')];this[_0xbd0b('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xbd0b('0xd')]();this[_0xbd0b('0xe')]();}SmsQueue['prototype'][_0xbd0b('0xd')]=function(){var _0x196beb=this['mapAgentsId'][_0xbd0b('0xf')];this[_0xbd0b('0xc')]=_[_0xbd0b('0x10')](this[_0xbd0b('0xb')],'id');this[_0xbd0b('0xc')][_0xbd0b('0xf')]=_0x196beb;};SmsQueue[_0xbd0b('0x11')][_0xbd0b('0xe')]=function(){this[_0xbd0b('0x12')]=0x0;this[_0xbd0b('0x13')]=0x0;for(var _0x2d4664=0x0;_0x2d4664<this['Agents'][_0xbd0b('0x14')];_0x2d4664+=0x1){if(this['Agents'][_0x2d4664]['online']){this[_0xbd0b('0x12')]+=0x1;}if(this[_0xbd0b('0xb')][_0x2d4664][_0xbd0b('0x15')]){this[_0xbd0b('0x13')]+=0x1;}}this[_0xbd0b('0x16')]=this['loggedIn']-this['paused'];this[_0xbd0b('0x16')]=this[_0xbd0b('0x16')]>=0x0?this[_0xbd0b('0x16')]:0x0;var _0x2f58a3={'id':this['id'],'available':this[_0xbd0b('0x16')],'loggedIn':this[_0xbd0b('0x12')],'name':this['name'],'paused':this[_0xbd0b('0x13')],'waiting':this['waiting']};var _0x9c2404=md5(JSON[_0xbd0b('0x17')](_0x2f58a3));if(this[_0xbd0b('0x1')]!==_0x9c2404){this[_0xbd0b('0x1')]=_0x9c2404;io['to'](util['format'](_0xbd0b('0x18'),_0x2f58a3[_0xbd0b('0x7')]))[_0xbd0b('0x19')]('sms_queue:save',_0x2f58a3);}};module[_0xbd0b('0x1a')]=SmsQueue;
\ No newline at end of file
index 3346c19..b24cdea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe085=['emit','exports','lodash','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s'];(function(_0x412bc0,_0x41cd56){var _0x1354ce=function(_0x4fedac){while(--_0x4fedac){_0x412bc0['push'](_0x412bc0['shift']());}};_0x1354ce(++_0x41cd56);}(_0xe085,0x161));var _0x5e08=function(_0x41c030,_0x536171){_0x41c030=_0x41c030-0x0;var _0x3628a7=_0xe085[_0x41c030];return _0x3628a7;};'use strict';var _=require(_0x5e08('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x5e08('0x1'));var config=require('../../../config/environment');config[_0x5e08('0x2')]=_[_0x5e08('0x3')](config[_0x5e08('0x2')],{'host':_0x5e08('0x4'),'port':0x18eb});var io=require(_0x5e08('0x5'))(new Redis(config[_0x5e08('0x2')]));function WhatsappQueue(_0x541414){this['id']=_0x541414['id']||0x0;this['name']=_0x541414[_0x5e08('0x6')]||'';this[_0x5e08('0x7')]=_0x541414['timeout']||0xa;this['strategy']=_0x541414['strategy']||_0x5e08('0x8');this[_0x5e08('0x9')]=_0x541414['Agents'];this[_0x5e08('0xa')]={};this['waiting']=0x0;this[_0x5e08('0xb')]='';this['updateRouting']();this[_0x5e08('0xc')]();}WhatsappQueue[_0x5e08('0xd')][_0x5e08('0xe')]=function(){var _0x26823d=this[_0x5e08('0xa')][_0x5e08('0xf')];this[_0x5e08('0xa')]=_[_0x5e08('0x10')](this[_0x5e08('0x9')],'id');this[_0x5e08('0xa')][_0x5e08('0xf')]=_0x26823d;};WhatsappQueue[_0x5e08('0xd')][_0x5e08('0xc')]=function(){this[_0x5e08('0x11')]=0x0;this['paused']=0x0;for(var _0x3830e2=0x0;_0x3830e2<this[_0x5e08('0x9')][_0x5e08('0x12')];_0x3830e2+=0x1){if(this['Agents'][_0x3830e2]['online']){this[_0x5e08('0x11')]+=0x1;}if(this[_0x5e08('0x9')][_0x3830e2][_0x5e08('0x13')]){this[_0x5e08('0x14')]+=0x1;}}this['available']=this['loggedIn']-this[_0x5e08('0x14')];this[_0x5e08('0x15')]=this[_0x5e08('0x15')]>=0x0?this['available']:0x0;var _0x47765d={'id':this['id'],'available':this[_0x5e08('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x5e08('0x14')],'waiting':this['waiting']};var _0x4e9f59=md5(JSON[_0x5e08('0x16')](_0x47765d));if(this[_0x5e08('0xb')]!==_0x4e9f59){this[_0x5e08('0xb')]=_0x4e9f59;io['to'](util[_0x5e08('0x17')](_0x5e08('0x18'),_0x47765d['name']))[_0x5e08('0x19')]('whatsapp_queue:save',_0x47765d);}};module[_0x5e08('0x1a')]=WhatsappQueue;
\ No newline at end of file
+var _0x5618=['util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','emit','exports','lodash','md5'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x5618,0x10c));var _0x8561=function(_0x58e867,_0x46a0b8){_0x58e867=_0x58e867-0x0;var _0x22f58b=_0x5618[_0x58e867];return _0x22f58b;};'use strict';var _=require(_0x8561('0x0'));var md5=require(_0x8561('0x1'));var util=require(_0x8561('0x2'));var Redis=require(_0x8561('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x8561('0x4')](config[_0x8561('0x5')],{'host':_0x8561('0x6'),'port':0x18eb});var io=require(_0x8561('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x10b15d){this['id']=_0x10b15d['id']||0x0;this['name']=_0x10b15d[_0x8561('0x8')]||'';this[_0x8561('0x9')]=_0x10b15d['timeout']||0xa;this['strategy']=_0x10b15d['strategy']||_0x8561('0xa');this[_0x8561('0xb')]=_0x10b15d[_0x8561('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x8561('0x1')]='';this[_0x8561('0xc')]();this[_0x8561('0xd')]();}WhatsappQueue[_0x8561('0xe')][_0x8561('0xc')]=function(){var _0x5cd42e=this[_0x8561('0xf')][_0x8561('0x10')];this[_0x8561('0xf')]=_[_0x8561('0x11')](this[_0x8561('0xb')],'id');this[_0x8561('0xf')][_0x8561('0x10')]=_0x5cd42e;};WhatsappQueue[_0x8561('0xe')][_0x8561('0xd')]=function(){this[_0x8561('0x12')]=0x0;this[_0x8561('0x13')]=0x0;for(var _0x52358c=0x0;_0x52358c<this[_0x8561('0xb')][_0x8561('0x14')];_0x52358c+=0x1){if(this[_0x8561('0xb')][_0x52358c][_0x8561('0x15')]){this[_0x8561('0x12')]+=0x1;}if(this['Agents'][_0x52358c][_0x8561('0x16')]){this[_0x8561('0x13')]+=0x1;}}this[_0x8561('0x17')]=this[_0x8561('0x12')]-this[_0x8561('0x13')];this[_0x8561('0x17')]=this[_0x8561('0x17')]>=0x0?this[_0x8561('0x17')]:0x0;var _0x3450a7={'id':this['id'],'available':this[_0x8561('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x8561('0x8')],'paused':this[_0x8561('0x13')],'waiting':this[_0x8561('0x18')]};var _0x5ac366=md5(JSON[_0x8561('0x19')](_0x3450a7));if(this[_0x8561('0x1')]!==_0x5ac366){this['md5']=_0x5ac366;io['to'](util[_0x8561('0x1a')](_0x8561('0x1b'),_0x3450a7[_0x8561('0x8')]))[_0x8561('0x1c')]('whatsapp_queue:save',_0x3450a7);}};module[_0x8561('0x1d')]=WhatsappQueue;
\ No newline at end of file
index 98c66d7..b48b4a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
index ad3f5e5..6c21e12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67b1=['update','Request','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x552873,_0x12e0a9){var _0x6cac72=function(_0x2e06e2){while(--_0x2e06e2){_0x552873['push'](_0x552873['shift']());}};_0x6cac72(++_0x12e0a9);}(_0x67b1,0x149));var _0x167b=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0x67b1[_0x83af7f];return _0x32d85c;};'use strict';var client=require(_0x167b('0x0'));exports[_0x167b('0x1')]=function(_0x1ed97c,_0x39ec61){return client[_0x167b('0x2')]('UpdateChatInteraction',{'body':_0x39ec61,'options':{'where':{'id':_0x1ed97c}},'log':'updateChatInteraction'});};exports[_0x167b('0x3')]=function(_0x562118,_0x881459){return client['Request'](_0x167b('0x4'),{'body':_0x881459,'options':{'where':{'id':_0x562118}},'log':_0x167b('0x5')});};
\ No newline at end of file
+var _0xf526=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x1c78f2,_0xef1192){var _0x2b4e6d=function(_0xd0bc3a){while(--_0xd0bc3a){_0x1c78f2['push'](_0x1c78f2['shift']());}};_0x2b4e6d(++_0xef1192);}(_0xf526,0x10a));var _0x6f52=function(_0x12ea20,_0x5db2b4){_0x12ea20=_0x12ea20-0x0;var _0x43c152=_0xf526[_0x12ea20];return _0x43c152;};'use strict';var client=require(_0x6f52('0x0'));exports[_0x6f52('0x1')]=function(_0x18db4c,_0x3ac56e){return client[_0x6f52('0x2')](_0x6f52('0x3'),{'body':_0x3ac56e,'options':{'where':{'id':_0x18db4c}},'log':_0x6f52('0x4')});};exports[_0x6f52('0x5')]=function(_0x368d18,_0x3cd5c1){return client[_0x6f52('0x2')](_0x6f52('0x6'),{'body':_0x3cd5c1,'options':{'where':{'id':_0x368d18}},'log':_0x6f52('0x7')});};
\ No newline at end of file
index a18b446..80d40aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ed0=['createChatMessage','../client'];(function(_0x580e3c,_0x1697f7){var _0x56c9aa=function(_0x100f69){while(--_0x100f69){_0x580e3c['push'](_0x580e3c['shift']());}};_0x56c9aa(++_0x1697f7);}(_0x3ed0,0x107));var _0x03ed=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0x3ed0[_0x2c3a8f];return _0x189412;};'use strict';var client=require(_0x03ed('0x0'));exports['create']=function(_0x1d687a){return client['Request']('CreateChatMessage',{'body':_0x1d687a,'log':_0x03ed('0x1')});};
\ No newline at end of file
+var _0xe2f8=['Request','createChatMessage','create'];(function(_0x4a363f,_0x36480a){var _0x391de0=function(_0x55a220){while(--_0x55a220){_0x4a363f['push'](_0x4a363f['shift']());}};_0x391de0(++_0x36480a);}(_0xe2f8,0x1d0));var _0x8e2f=function(_0x517cd3,_0x582753){_0x517cd3=_0x517cd3-0x0;var _0x4d1cf1=_0xe2f8[_0x517cd3];return _0x4d1cf1;};'use strict';var client=require('../client');exports[_0x8e2f('0x0')]=function(_0x54513a){return client[_0x8e2f('0x1')]('CreateChatMessage',{'body':_0x54513a,'log':_0x8e2f('0x2')});};
\ No newline at end of file
index a29e17a..e778cc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x861a=['User','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x861a,0x194));var _0xa861=function(_0x25af9d,_0x222749){_0x25af9d=_0x25af9d-0x0;var _0xa61297=_0x861a[_0x25af9d];return _0xa61297;};'use strict';var client=require(_0xa861('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xa861('0x1')](_0xa861('0x2'),{'options':{'raw':![],'attributes':['id',_0xa861('0x3'),_0xa861('0x4'),_0xa861('0x5')],'include':[{'model':_0xa861('0x6'),'as':'Agents','attributes':['id',_0xa861('0x3'),_0xa861('0x7'),_0xa861('0x8')]}]},'log':_0xa861('0x9')});};};
\ No newline at end of file
+var _0x2b83=['Request','name','timeout','strategy','online','getChatQueues'];(function(_0x3fb225,_0x47d95d){var _0x5122d3=function(_0xa489cc){while(--_0xa489cc){_0x3fb225['push'](_0x3fb225['shift']());}};_0x5122d3(++_0x47d95d);}(_0x2b83,0x1d3));var _0x32b8=function(_0x25289c,_0x16ae20){_0x25289c=_0x25289c-0x0;var _0x48a71e=_0x2b83[_0x25289c];return _0x48a71e;};'use strict';var client=require('../client');exports[_0x32b8('0x0')]=function(){return function(){return client[_0x32b8('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x32b8('0x2'),_0x32b8('0x3'),_0x32b8('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x32b8('0x2'),_0x32b8('0x5'),'chatPause']}]},'log':_0x32b8('0x0')});};};
\ No newline at end of file
index ad04fb6..817a3ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1d4=['create','Request','update','UpdateChatQueueReport','DESC','../client'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xd1d4[_0x9df060];return _0x338dfe;};'use strict';var client=require(_0x4d1d('0x0'));exports[_0x4d1d('0x1')]=function(_0x5c408a){return client[_0x4d1d('0x2')]('CreateChatQueueReport',{'body':_0x5c408a,'log':'CreateChatQueueReport'});};exports[_0x4d1d('0x3')]=function(_0xb64ee,_0x260e6a){return client[_0x4d1d('0x2')](_0x4d1d('0x4'),{'body':_0x260e6a,'options':{'where':{'uniqueid':_0xb64ee},'order':[['id',_0x4d1d('0x5')]],'limit':0x1},'log':_0x4d1d('0x4')});};
\ No newline at end of file
+var _0x1df5=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0x1df5,0xfd));var _0x51df=function(_0x549bdc,_0x3914d7){_0x549bdc=_0x549bdc-0x0;var _0x30b0ad=_0x1df5[_0x549bdc];return _0x30b0ad;};'use strict';var client=require(_0x51df('0x0'));exports[_0x51df('0x1')]=function(_0x22acff){return client[_0x51df('0x2')](_0x51df('0x3'),{'body':_0x22acff,'log':'CreateChatQueueReport'});};exports[_0x51df('0x4')]=function(_0x457292,_0x1c491f){return client[_0x51df('0x2')](_0x51df('0x5'),{'body':_0x1c491f,'options':{'where':{'uniqueid':_0x457292},'order':[['id',_0x51df('0x6')]],'limit':0x1},'log':_0x51df('0x5')});};
\ No newline at end of file
index 00e1506..d497629 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3a10e3,_0x3cdb35){var _0xf067c8=function(_0x184beb){while(--_0x184beb){_0x3a10e3['push'](_0x3a10e3['shift']());}};_0xf067c8(++_0x3cdb35);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x7a54,0x106));var _0x47a5=function(_0x4dbf80,_0x1e1353){_0x4dbf80=_0x4dbf80-0x0;var _0x23680d=_0x7a54[_0x4dbf80];return _0x23680d;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
index 1c28b12..1125b7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb26e=['../client','create','Request','CreateFaxMessage'];(function(_0x1f1013,_0x1b31a6){var _0xe524fd=function(_0x1ba139){while(--_0x1ba139){_0x1f1013['push'](_0x1f1013['shift']());}};_0xe524fd(++_0x1b31a6);}(_0xb26e,0x134));var _0xeb26=function(_0x151ed4,_0x23cfb8){_0x151ed4=_0x151ed4-0x0;var _0x1c6f7e=_0xb26e[_0x151ed4];return _0x1c6f7e;};'use strict';var client=require(_0xeb26('0x0'));exports[_0xeb26('0x1')]=function(_0x43eb00){return client[_0xeb26('0x2')](_0xeb26('0x3'),{'body':_0x43eb00,'log':'createFaxMessage'});};
\ No newline at end of file
+var _0x6a9b=['Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0x6a9b,0x6f));var _0xb6a9=function(_0x51dae4,_0xa7f367){_0x51dae4=_0x51dae4-0x0;var _0x27d0b0=_0x6a9b[_0x51dae4];return _0x27d0b0;};'use strict';var client=require(_0xb6a9('0x0'));exports['create']=function(_0x474c3){return client[_0xb6a9('0x1')](_0xb6a9('0x2'),{'body':_0x474c3,'log':_0xb6a9('0x3')});};
\ No newline at end of file
index 19c49e7..623df60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd01b=['User','online','faxPause','getFaxQueues','../client','Request','name','strategy'];(function(_0x6a4a2c,_0x415632){var _0x73be32=function(_0x312777){while(--_0x312777){_0x6a4a2c['push'](_0x6a4a2c['shift']());}};_0x73be32(++_0x415632);}(_0xd01b,0x14c));var _0xbd01=function(_0x2830e3,_0x4d8f59){_0x2830e3=_0x2830e3-0x0;var _0x380998=_0xd01b[_0x2830e3];return _0x380998;};'use strict';var client=require(_0xbd01('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xbd01('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xbd01('0x2'),'timeout',_0xbd01('0x3')],'include':[{'model':_0xbd01('0x4'),'as':'Agents','attributes':['id',_0xbd01('0x2'),_0xbd01('0x5'),_0xbd01('0x6')]}]},'log':_0xbd01('0x7')});};};
\ No newline at end of file
+var _0x2ea5=['Agents','online','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User'];(function(_0x27f323,_0x2d6212){var _0x557b7b=function(_0x51f28c){while(--_0x51f28c){_0x27f323['push'](_0x27f323['shift']());}};_0x557b7b(++_0x2d6212);}(_0x2ea5,0xfc));var _0x52ea=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x2ea5[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x52ea('0x0'));exports[_0x52ea('0x1')]=function(){return function(){return client[_0x52ea('0x2')](_0x52ea('0x3'),{'options':{'raw':![],'attributes':['id',_0x52ea('0x4'),_0x52ea('0x5'),_0x52ea('0x6')],'include':[{'model':_0x52ea('0x7'),'as':_0x52ea('0x8'),'attributes':['id',_0x52ea('0x4'),_0x52ea('0x9'),'faxPause']}]},'log':_0x52ea('0x1')});};};
\ No newline at end of file
index 41e1178..ff1c70d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb42c=['CreateFaxQueueReport','update','DESC','../client','create','Request'];(function(_0x32f8ed,_0x1f3ab8){var _0x169682=function(_0x119d8b){while(--_0x119d8b){_0x32f8ed['push'](_0x32f8ed['shift']());}};_0x169682(++_0x1f3ab8);}(_0xb42c,0x165));var _0xcb42=function(_0x5395a3,_0x4558a4){_0x5395a3=_0x5395a3-0x0;var _0x5cd644=_0xb42c[_0x5395a3];return _0x5cd644;};'use strict';var client=require(_0xcb42('0x0'));exports[_0xcb42('0x1')]=function(_0x4fe346){return client[_0xcb42('0x2')](_0xcb42('0x3'),{'body':_0x4fe346,'log':_0xcb42('0x3')});};exports[_0xcb42('0x4')]=function(_0x4bb552,_0x1fcb27){return client['Request']('UpdateFaxQueueReport',{'body':_0x1fcb27,'options':{'where':{'uniqueid':_0x4bb552},'order':[['id',_0xcb42('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
+var _0xfdee=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x4811de,_0x59dddc){var _0x4e5fd5=function(_0x1b816e){while(--_0x1b816e){_0x4811de['push'](_0x4811de['shift']());}};_0x4e5fd5(++_0x59dddc);}(_0xfdee,0xf6));var _0xefde=function(_0x56d9c0,_0x23cac4){_0x56d9c0=_0x56d9c0-0x0;var _0x183ba1=_0xfdee[_0x56d9c0];return _0x183ba1;};'use strict';var client=require(_0xefde('0x0'));exports[_0xefde('0x1')]=function(_0xd55f1){return client[_0xefde('0x2')](_0xefde('0x3'),{'body':_0xd55f1,'log':_0xefde('0x3')});};exports[_0xefde('0x4')]=function(_0x3598a2,_0x2cdefe){return client[_0xefde('0x2')](_0xefde('0x5'),{'body':_0x2cdefe,'options':{'where':{'uniqueid':_0x3598a2},'order':[['id',_0xefde('0x6')]],'limit':0x1},'log':_0xefde('0x5')});};
\ No newline at end of file
index 3d47264..abfbcf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf013=['name','Interval','Intervals','interval','Request'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0xf013,0x108));var _0x3f01=function(_0x5982eb,_0x470b55){_0x5982eb=_0x5982eb-0x0;var _0x1386e4=_0xf013[_0x5982eb];return _0x1386e4;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x3f01('0x0')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3f01('0x1')],'include':[{'model':_0x3f01('0x2'),'as':_0x3f01('0x3'),'attributes':['id','name',_0x3f01('0x4')]}]},'log':'getIntervals'});};};
\ No newline at end of file
+var _0x0f05=['../client','getIntervals','name','Interval','interval'];(function(_0x4216ab,_0x531eca){var _0x100516=function(_0x452d55){while(--_0x452d55){_0x4216ab['push'](_0x4216ab['shift']());}};_0x100516(++_0x531eca);}(_0x0f05,0x159));var _0x50f0=function(_0x5661fa,_0x37cb28){_0x5661fa=_0x5661fa-0x0;var _0x581087=_0x0f05[_0x5661fa];return _0x581087;};'use strict';var client=require(_0x50f0('0x0'));exports[_0x50f0('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x50f0('0x2')],'include':[{'model':_0x50f0('0x3'),'as':'Intervals','attributes':['id','name',_0x50f0('0x4')]}]},'log':_0x50f0('0x1')});};};
\ No newline at end of file
index fae1e92..07197c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e3=['Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x2a2e72,_0x1de962){var _0x3cfb4a=function(_0x3d435c){while(--_0x3d435c){_0x2a2e72['push'](_0x2a2e72['shift']());}};_0x3cfb4a(++_0x1de962);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xf2e3[_0x45b034];return _0x509cb0;};'use strict';var client=require(_0x3f2e('0x0'));exports['update']=function(_0x143e9e,_0x231b2b){return client[_0x3f2e('0x1')](_0x3f2e('0x2'),{'body':_0x231b2b,'options':{'where':{'id':_0x143e9e}},'log':_0x3f2e('0x3')});};exports[_0x3f2e('0x4')]=function(_0x3938e2,_0xabcf5c){return client[_0x3f2e('0x1')]('AddTagsToMailInteraction',{'body':_0xabcf5c,'options':{'where':{'id':_0x3938e2}},'log':_0x3f2e('0x5')});};
\ No newline at end of file
+var _0x7708=['update','AddTagsToMailInteraction','../client'];(function(_0x24a332,_0xdd7a7){var _0x589b19=function(_0x55c710){while(--_0x55c710){_0x24a332['push'](_0x24a332['shift']());}};_0x589b19(++_0xdd7a7);}(_0x7708,0x188));var _0x8770=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0x7708[_0x188a93];return _0x23b40d;};'use strict';var client=require(_0x8770('0x0'));exports[_0x8770('0x1')]=function(_0x5ce108,_0x141ddf){return client['Request']('UpdateMailInteraction',{'body':_0x141ddf,'options':{'where':{'id':_0x5ce108}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x182d52,_0x1a796d){return client['Request'](_0x8770('0x2'),{'body':_0x1a796d,'options':{'where':{'id':_0x182d52}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 20cb5df..1befcec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dce=['Request','create'];(function(_0x3debba,_0x5fceb6){var _0x1a77dd=function(_0x39aa3d){while(--_0x39aa3d){_0x3debba['push'](_0x3debba['shift']());}};_0x1a77dd(++_0x5fceb6);}(_0x6dce,0x1b1));var _0xe6dc=function(_0x1d66ed,_0x41f460){_0x1d66ed=_0x1d66ed-0x0;var _0x165ebe=_0x6dce[_0x1d66ed];return _0x165ebe;};'use strict';var client=require('../client');exports[_0xe6dc('0x0')]=function(_0x591e94){return client[_0xe6dc('0x1')]('CreateMailMessage',{'body':_0x591e94,'log':'createMailMessage'});};
\ No newline at end of file
+var _0xb054=['CreateMailMessage','../client','Request'];(function(_0x1ae91a,_0x122766){var _0x50e53c=function(_0x596334){while(--_0x596334){_0x1ae91a['push'](_0x1ae91a['shift']());}};_0x50e53c(++_0x122766);}(_0xb054,0xa6));var _0x4b05=function(_0x22a81b,_0x51edff){_0x22a81b=_0x22a81b-0x0;var _0x4540aa=_0xb054[_0x22a81b];return _0x4540aa;};'use strict';var client=require(_0x4b05('0x0'));exports['create']=function(_0x287814){return client[_0x4b05('0x1')](_0x4b05('0x2'),{'body':_0x287814,'log':'createMailMessage'});};
\ No newline at end of file
index a727c4e..bf37f28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb90=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','timeout','strategy','User','name'];(function(_0x560990,_0x4e5de8){var _0x1992af=function(_0x3847e8){while(--_0x3847e8){_0x560990['push'](_0x560990['shift']());}};_0x1992af(++_0x4e5de8);}(_0xbb90,0xe8));var _0x0bb9=function(_0x10038d,_0x46bdc3){_0x10038d=_0x10038d-0x0;var _0x4b32f7=_0xbb90[_0x10038d];return _0x4b32f7;};'use strict';var client=require(_0x0bb9('0x0'));exports[_0x0bb9('0x1')]=function(){return function(){return client[_0x0bb9('0x2')](_0x0bb9('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0bb9('0x4'),_0x0bb9('0x5')],'include':[{'model':_0x0bb9('0x6'),'as':'Agents','attributes':['id',_0x0bb9('0x7'),_0x0bb9('0x8'),_0x0bb9('0x9')]}]},'log':_0x0bb9('0x1')});};};
\ No newline at end of file
+var _0xa118=['timeout','strategy','Agents','online','mailPause','../client','getMailQueues'];(function(_0x2461c8,_0x328d5f){var _0x57e245=function(_0xe2d617){while(--_0xe2d617){_0x2461c8['push'](_0x2461c8['shift']());}};_0x57e245(++_0x328d5f);}(_0xa118,0x98));var _0x8a11=function(_0x32aa68,_0x102e89){_0x32aa68=_0x32aa68-0x0;var _0x292133=_0xa118[_0x32aa68];return _0x292133;};'use strict';var client=require(_0x8a11('0x0'));exports[_0x8a11('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x8a11('0x2'),_0x8a11('0x3')],'include':[{'model':'User','as':_0x8a11('0x4'),'attributes':['id','name',_0x8a11('0x5'),_0x8a11('0x6')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
index e6d477f..177c193 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf1a=['DESC','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xaf1a,0x187));var _0xaaf1=function(_0x17d786,_0x1498ba){_0x17d786=_0x17d786-0x0;var _0x304cd7=_0xaf1a[_0x17d786];return _0x304cd7;};'use strict';var client=require('../client');exports[_0xaaf1('0x0')]=function(_0x38e186){return client[_0xaaf1('0x1')](_0xaaf1('0x2'),{'body':_0x38e186,'log':'CreateMailQueueReport'});};exports[_0xaaf1('0x3')]=function(_0x3655c7,_0x4ff7fa){return client[_0xaaf1('0x1')](_0xaaf1('0x4'),{'body':_0x4ff7fa,'options':{'where':{'uniqueid':_0x3655c7},'order':[['id',_0xaaf1('0x5')]],'limit':0x1},'log':_0xaaf1('0x4')});};
\ No newline at end of file
+var _0xc8b2=['Request','UpdateMailQueueReport','../client','create','CreateMailQueueReport'];(function(_0x383882,_0x57747d){var _0x53c0e3=function(_0x359ed4){while(--_0x359ed4){_0x383882['push'](_0x383882['shift']());}};_0x53c0e3(++_0x57747d);}(_0xc8b2,0x13d));var _0x2c8b=function(_0x57ccb0,_0x3c127b){_0x57ccb0=_0x57ccb0-0x0;var _0x85da70=_0xc8b2[_0x57ccb0];return _0x85da70;};'use strict';var client=require(_0x2c8b('0x0'));exports[_0x2c8b('0x1')]=function(_0x17017a){return client['Request']('CreateMailQueueReport',{'body':_0x17017a,'log':_0x2c8b('0x2')});};exports['update']=function(_0x4ee40c,_0x1a0813){return client[_0x2c8b('0x3')](_0x2c8b('0x4'),{'body':_0x1a0813,'options':{'where':{'uniqueid':_0x4ee40c},'order':[['id','DESC']],'limit':0x1},'log':_0x2c8b('0x4')});};
\ No newline at end of file
index 4624bb2..1df5c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1320=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x244e97,_0xbefc3c){var _0x232204=function(_0x1c9213){while(--_0x1c9213){_0x244e97['push'](_0x244e97['shift']());}};_0x232204(++_0xbefc3c);}(_0x1320,0x120));var _0x0132=function(_0x5cae30,_0x5001c3){_0x5cae30=_0x5cae30-0x0;var _0x47404a=_0x1320[_0x5cae30];return _0x47404a;};'use strict';var client=require('../client');exports[_0x0132('0x0')]=function(_0x283006,_0x256e0f){return client[_0x0132('0x1')](_0x0132('0x2'),{'body':_0x256e0f,'options':{'where':{'id':_0x283006}},'log':_0x0132('0x3')});};exports['addTags']=function(_0x4d4e62,_0x5737d0){return client[_0x0132('0x1')](_0x0132('0x4'),{'body':_0x5737d0,'options':{'where':{'id':_0x4d4e62}},'log':_0x0132('0x5')});};
\ No newline at end of file
+var _0xb736=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','update','Request','UpdateOpenchannelInteraction'];(function(_0x4b9c5d,_0x450ae0){var _0x37a9ee=function(_0x5a8d4f){while(--_0x5a8d4f){_0x4b9c5d['push'](_0x4b9c5d['shift']());}};_0x37a9ee(++_0x450ae0);}(_0xb736,0x19b));var _0x6b73=function(_0x3dfedc,_0x58cf03){_0x3dfedc=_0x3dfedc-0x0;var _0xf30ac1=_0xb736[_0x3dfedc];return _0xf30ac1;};'use strict';var client=require('../client');exports[_0x6b73('0x0')]=function(_0x1f6276,_0x6539c2){return client[_0x6b73('0x1')](_0x6b73('0x2'),{'body':_0x6539c2,'options':{'where':{'id':_0x1f6276}},'log':_0x6b73('0x3')});};exports[_0x6b73('0x4')]=function(_0x18c200,_0x142af1){return client[_0x6b73('0x1')](_0x6b73('0x5'),{'body':_0x142af1,'options':{'where':{'id':_0x18c200}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index cd1f96c..e8f59d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd07e=['create','Request','CreateOpenchannelMessage','../client'];(function(_0x18a98b,_0x4f5d2f){var _0x1c2f1f=function(_0x36e3bb){while(--_0x36e3bb){_0x18a98b['push'](_0x18a98b['shift']());}};_0x1c2f1f(++_0x4f5d2f);}(_0xd07e,0x1cf));var _0xed07=function(_0x232af6,_0x170b06){_0x232af6=_0x232af6-0x0;var _0x40871b=_0xd07e[_0x232af6];return _0x40871b;};'use strict';var client=require(_0xed07('0x0'));exports[_0xed07('0x1')]=function(_0x597053){return client[_0xed07('0x2')](_0xed07('0x3'),{'body':_0x597053,'log':'createOpenchannelMessage'});};
\ No newline at end of file
+var _0x20e8=['../client','create','createOpenchannelMessage'];(function(_0x17a2d8,_0x2cf1ae){var _0x10ca3b=function(_0x4e61d4){while(--_0x4e61d4){_0x17a2d8['push'](_0x17a2d8['shift']());}};_0x10ca3b(++_0x2cf1ae);}(_0x20e8,0x1e0));var _0x820e=function(_0x528db6,_0x347ae3){_0x528db6=_0x528db6-0x0;var _0x23f0ca=_0x20e8[_0x528db6];return _0x23f0ca;};'use strict';var client=require(_0x820e('0x0'));exports[_0x820e('0x1')]=function(_0x18a87){return client['Request']('CreateOpenchannelMessage',{'body':_0x18a87,'log':_0x820e('0x2')});};
\ No newline at end of file
index c137c3c..4f691ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0af=['User','Agents','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x3c8984,_0x41fdbd){var _0x487297=function(_0x63f566){while(--_0x63f566){_0x3c8984['push'](_0x3c8984['shift']());}};_0x487297(++_0x41fdbd);}(_0xa0af,0x185));var _0xfa0a=function(_0x313c02,_0x2b8688){_0x313c02=_0x313c02-0x0;var _0x54025d=_0xa0af[_0x313c02];return _0x54025d;};'use strict';var client=require(_0xfa0a('0x0'));exports[_0xfa0a('0x1')]=function(){return function(){return client[_0xfa0a('0x2')](_0xfa0a('0x3'),{'options':{'raw':![],'attributes':['id',_0xfa0a('0x4'),_0xfa0a('0x5'),_0xfa0a('0x6')],'include':[{'model':_0xfa0a('0x7'),'as':_0xfa0a('0x8'),'attributes':['id',_0xfa0a('0x4'),'online','openchannelPause']}]},'log':_0xfa0a('0x1')});};};
\ No newline at end of file
+var _0xa508=['getOpenchannelQueues','GetOpenchannelQueue','name','User','Agents','openchannelPause','../client'];(function(_0x5af0cf,_0x4d9469){var _0x24a9d7=function(_0x257685){while(--_0x257685){_0x5af0cf['push'](_0x5af0cf['shift']());}};_0x24a9d7(++_0x4d9469);}(_0xa508,0x187));var _0x8a50=function(_0x1705e9,_0x394f32){_0x1705e9=_0x1705e9-0x0;var _0x33285a=_0xa508[_0x1705e9];return _0x33285a;};'use strict';var client=require(_0x8a50('0x0'));exports[_0x8a50('0x1')]=function(){return function(){return client['Request'](_0x8a50('0x2'),{'options':{'raw':![],'attributes':['id',_0x8a50('0x3'),'timeout','strategy'],'include':[{'model':_0x8a50('0x4'),'as':_0x8a50('0x5'),'attributes':['id',_0x8a50('0x3'),'online',_0x8a50('0x6')]}]},'log':_0x8a50('0x1')});};};
\ No newline at end of file
index 17c6ab7..7d0399a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['Request','UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport','update'];(function(_0x4774f2,_0x5c1c6f){var _0x3dd200=function(_0x20aab9){while(--_0x20aab9){_0x4774f2['push'](_0x4774f2['shift']());}};_0x3dd200(++_0x5c1c6f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x9ca59a,_0x259173){_0x9ca59a=_0x9ca59a-0x0;var _0x498648=_0x9ffd[_0x9ca59a];return _0x498648;};'use strict';var client=require(_0xd9ff('0x0'));exports[_0xd9ff('0x1')]=function(_0x47e5c0){return client['Request'](_0xd9ff('0x2'),{'body':_0x47e5c0,'log':_0xd9ff('0x2')});};exports[_0xd9ff('0x3')]=function(_0x5493ae,_0x53e962){return client[_0xd9ff('0x4')](_0xd9ff('0x5'),{'body':_0x53e962,'options':{'where':{'uniqueid':_0x5493ae},'order':[['id','DESC']],'limit':0x1},'log':_0xd9ff('0x5')});};
\ No newline at end of file
+var _0x8ee4=['DESC','UpdateOpenchannelQueueReport','../client','Request','CreateOpenchannelQueueReport'];(function(_0x2dae7d,_0x4e5117){var _0x28adfa=function(_0x17cf5b){while(--_0x17cf5b){_0x2dae7d['push'](_0x2dae7d['shift']());}};_0x28adfa(++_0x4e5117);}(_0x8ee4,0x115));var _0x48ee=function(_0x2a6b91,_0x345d4b){_0x2a6b91=_0x2a6b91-0x0;var _0x34d8f4=_0x8ee4[_0x2a6b91];return _0x34d8f4;};'use strict';var client=require(_0x48ee('0x0'));exports['create']=function(_0x10731d){return client[_0x48ee('0x1')]('CreateOpenchannelQueueReport',{'body':_0x10731d,'log':_0x48ee('0x2')});};exports['update']=function(_0x3d1857,_0x397714){return client[_0x48ee('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x397714,'options':{'where':{'uniqueid':_0x3d1857},'order':[['id',_0x48ee('0x3')]],'limit':0x1},'log':_0x48ee('0x4')});};
\ No newline at end of file
index c8784ec..09be807 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc997=['AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction','addTags'];(function(_0x32a9c8,_0x43dd73){var _0x14157f=function(_0x4d587b){while(--_0x4d587b){_0x32a9c8['push'](_0x32a9c8['shift']());}};_0x14157f(++_0x43dd73);}(_0xc997,0x1ac));var _0x7c99=function(_0x1f9153,_0x49b349){_0x1f9153=_0x1f9153-0x0;var _0x30fc6f=_0xc997[_0x1f9153];return _0x30fc6f;};'use strict';var client=require('../client');exports[_0x7c99('0x0')]=function(_0x3b4b36,_0x2032f1){return client[_0x7c99('0x1')](_0x7c99('0x2'),{'body':_0x2032f1,'options':{'where':{'id':_0x3b4b36}},'log':'updateSmsInteraction'});};exports[_0x7c99('0x3')]=function(_0x114fe0,_0x705244){return client[_0x7c99('0x1')](_0x7c99('0x4'),{'body':_0x705244,'options':{'where':{'id':_0x114fe0}},'log':_0x7c99('0x5')});};
\ No newline at end of file
+var _0x0a9a=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction'];(function(_0x2727d5,_0x1b77e){var _0x2c0e50=function(_0x266e0b){while(--_0x266e0b){_0x2727d5['push'](_0x2727d5['shift']());}};_0x2c0e50(++_0x1b77e);}(_0x0a9a,0x183));var _0xa0a9=function(_0x19e985,_0x207f86){_0x19e985=_0x19e985-0x0;var _0xf860ee=_0x0a9a[_0x19e985];return _0xf860ee;};'use strict';var client=require('../client');exports[_0xa0a9('0x0')]=function(_0x51baa8,_0x3b1a40){return client[_0xa0a9('0x1')](_0xa0a9('0x2'),{'body':_0x3b1a40,'options':{'where':{'id':_0x51baa8}},'log':_0xa0a9('0x3')});};exports['addTags']=function(_0x317a94,_0x360be5){return client['Request'](_0xa0a9('0x4'),{'body':_0x360be5,'options':{'where':{'id':_0x317a94}},'log':_0xa0a9('0x5')});};
\ No newline at end of file
index 9ce170f..709d2f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30b4=['create','Request','createSmsMessage','../client'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x30b4,0x167));var _0x430b=function(_0x543a4e,_0x544f2e){_0x543a4e=_0x543a4e-0x0;var _0x27a3a9=_0x30b4[_0x543a4e];return _0x27a3a9;};'use strict';var client=require(_0x430b('0x0'));exports[_0x430b('0x1')]=function(_0x5b262c){return client[_0x430b('0x2')]('CreateSmsMessage',{'body':_0x5b262c,'log':_0x430b('0x3')});};
\ No newline at end of file
+var _0xc6ac=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x4012de,_0x4cf8f7){var _0x323aa0=function(_0x275de3){while(--_0x275de3){_0x4012de['push'](_0x4012de['shift']());}};_0x323aa0(++_0x4cf8f7);}(_0xc6ac,0x1e0));var _0xcc6a=function(_0x36c6b8,_0xc912e7){_0x36c6b8=_0x36c6b8-0x0;var _0x2ea5f6=_0xc6ac[_0x36c6b8];return _0x2ea5f6;};'use strict';var client=require(_0xcc6a('0x0'));exports[_0xcc6a('0x1')]=function(_0x12743e){return client[_0xcc6a('0x2')](_0xcc6a('0x3'),{'body':_0x12743e,'log':_0xcc6a('0x4')});};
\ No newline at end of file
index 168b7e1..eb273c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x409d9c,_0x4add10){var _0x1dbeb4=function(_0x21bddb){while(--_0x21bddb){_0x409d9c['push'](_0x409d9c['shift']());}};_0x1dbeb4(++_0x4add10);}(_0xe706,0xa3));var _0x6e70=function(_0x5b083b,_0x145a9b){_0x5b083b=_0x5b083b-0x0;var _0x6c2225=_0xe706[_0x5b083b];return _0x6c2225;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};};
\ No newline at end of file
+var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x3a0984,_0x5b1dc4){var _0x5819cc=function(_0x203b98){while(--_0x203b98){_0x3a0984['push'](_0x3a0984['shift']());}};_0x5819cc(++_0x5b1dc4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xcb91[_0xfedc72];return _0x2c7c78;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
index 9e5809b..c701d71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x23f970,_0x496390){var _0x49adb9=function(_0x4ef8a1){while(--_0x4ef8a1){_0x23f970['push'](_0x23f970['shift']());}};_0x49adb9(++_0x496390);}(_0x34e8,0x12c));var _0x834e=function(_0x3d6b6f,_0xa42b38){_0x3d6b6f=_0x3d6b6f-0x0;var _0x15fa00=_0x34e8[_0x3d6b6f];return _0x15fa00;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});};
\ No newline at end of file
+var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x32be74,_0x1c6d78){var _0x59407f=function(_0x3f31e3){while(--_0x3f31e3){_0x32be74['push'](_0x32be74['shift']());}};_0x59407f(++_0x1c6d78);}(_0x008c,0x188));var _0xc008=function(_0x180237,_0xfd4959){_0x180237=_0x180237-0x0;var _0x56fa74=_0x008c[_0x180237];return _0x56fa74;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});};
\ No newline at end of file
index ae559da..f24c44b 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(_0x29f38b,_0x2ee85b){var _0xfb02b0=function(_0x130b4c){while(--_0x130b4c){_0x29f38b['push'](_0x29f38b['shift']());}};_0xfb02b0(++_0x2ee85b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x216600,_0x1f2edc){var _0x1c029d=function(_0x457bfd){while(--_0x457bfd){_0x216600['push'](_0x216600['shift']());}};_0x1c029d(++_0x1f2edc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 a106766..f01c60d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ec6=['../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x29631f,_0xdb767){var _0x486d87=function(_0x33a1bb){while(--_0x33a1bb){_0x29631f['push'](_0x29631f['shift']());}};_0x486d87(++_0xdb767);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x1e59b2,_0x1c1db1){_0x1e59b2=_0x1e59b2-0x0;var _0x4f39fe=_0x0ec6[_0x1e59b2];return _0x4f39fe;};'use strict';var client=require(_0x60ec('0x0'));exports['update']=function(_0x50217e,_0x1bf878){return client[_0x60ec('0x1')](_0x60ec('0x2'),{'body':_0x1bf878,'options':{'where':{'id':_0x50217e}},'log':_0x60ec('0x3')});};exports[_0x60ec('0x4')]=function(_0x262ed6,_0x392a91){return client['Request'](_0x60ec('0x5'),{'body':_0x392a91,'options':{'where':{'id':_0x262ed6}},'log':_0x60ec('0x6')});};
\ No newline at end of file
+var _0x4d68=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x4d68,0x1c3));var _0x84d6=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x4d68[_0x1305e3];return _0x1068e9;};'use strict';var client=require(_0x84d6('0x0'));exports[_0x84d6('0x1')]=function(_0x2e2636,_0xc5c972){return client[_0x84d6('0x2')](_0x84d6('0x3'),{'body':_0xc5c972,'options':{'where':{'id':_0x2e2636}},'log':'updateWhatsappInteraction'});};exports[_0x84d6('0x4')]=function(_0x5ee114,_0x3a2f0b){return client['Request'](_0x84d6('0x5'),{'body':_0x3a2f0b,'options':{'where':{'id':_0x5ee114}},'log':_0x84d6('0x6')});};
\ No newline at end of file
index a4b5667..50f80a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92c0=['CreateWhatsappMessage','createWhatsappMessage','../client','Request'];(function(_0x97dcff,_0x289852){var _0x5535a7=function(_0x3313e2){while(--_0x3313e2){_0x97dcff['push'](_0x97dcff['shift']());}};_0x5535a7(++_0x289852);}(_0x92c0,0xaa));var _0x092c=function(_0x4f076a,_0x437224){_0x4f076a=_0x4f076a-0x0;var _0x164c6d=_0x92c0[_0x4f076a];return _0x164c6d;};'use strict';var client=require(_0x092c('0x0'));exports['create']=function(_0x202c08){return client[_0x092c('0x1')](_0x092c('0x2'),{'body':_0x202c08,'log':_0x092c('0x3')});};
\ No newline at end of file
+var _0xfab3=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x1177a6,_0x267dc6){var _0x9eaef8=function(_0x44012f){while(--_0x44012f){_0x1177a6['push'](_0x1177a6['shift']());}};_0x9eaef8(++_0x267dc6);}(_0xfab3,0x1bb));var _0x3fab=function(_0x4b4fae,_0x186962){_0x4b4fae=_0x4b4fae-0x0;var _0x2eeaf7=_0xfab3[_0x4b4fae];return _0x2eeaf7;};'use strict';var client=require(_0x3fab('0x0'));exports[_0x3fab('0x1')]=function(_0x5f1ada){return client[_0x3fab('0x2')](_0x3fab('0x3'),{'body':_0x5f1ada,'log':_0x3fab('0x4')});};
\ No newline at end of file
index 267c280..c2d40a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d5f=['strategy','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x2c4702,_0x3857ed){var _0x54d0a3=function(_0x903ba8){while(--_0x903ba8){_0x2c4702['push'](_0x2c4702['shift']());}};_0x54d0a3(++_0x3857ed);}(_0x2d5f,0x94));var _0xf2d5=function(_0x2db667,_0x193cf5){_0x2db667=_0x2db667-0x0;var _0x83ff9=_0x2d5f[_0x2db667];return _0x83ff9;};'use strict';var client=require(_0xf2d5('0x0'));exports[_0xf2d5('0x1')]=function(){return function(){return client[_0xf2d5('0x2')](_0xf2d5('0x3'),{'options':{'raw':![],'attributes':['id',_0xf2d5('0x4'),'timeout',_0xf2d5('0x5')],'include':[{'model':'User','as':_0xf2d5('0x6'),'attributes':['id',_0xf2d5('0x4'),_0xf2d5('0x7'),_0xf2d5('0x8')]}]},'log':_0xf2d5('0x1')});};};
\ No newline at end of file
+var _0xd775=['GetWhatsappQueue','name','timeout','strategy','User','online','getWhatsappQueues','../client'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xd775,0x7f));var _0x5d77=function(_0x1cad6e,_0x3add35){_0x1cad6e=_0x1cad6e-0x0;var _0x5297d2=_0xd775[_0x1cad6e];return _0x5297d2;};'use strict';var client=require(_0x5d77('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x5d77('0x1'),{'options':{'raw':![],'attributes':['id',_0x5d77('0x2'),_0x5d77('0x3'),_0x5d77('0x4')],'include':[{'model':_0x5d77('0x5'),'as':'Agents','attributes':['id','name',_0x5d77('0x6'),'whatsappPause']}]},'log':_0x5d77('0x7')});};};
\ No newline at end of file
index 2576995..81f0181 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf2f=['Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC'];(function(_0x1f1068,_0x396fc5){var _0x3bb4ab=function(_0x308abd){while(--_0x308abd){_0x1f1068['push'](_0x1f1068['shift']());}};_0x3bb4ab(++_0x396fc5);}(_0xdf2f,0x114));var _0xfdf2=function(_0x5ca9d4,_0x46a87a){_0x5ca9d4=_0x5ca9d4-0x0;var _0x2a4c09=_0xdf2f[_0x5ca9d4];return _0x2a4c09;};'use strict';var client=require('../client');exports['create']=function(_0x4ac63c){return client[_0xfdf2('0x0')](_0xfdf2('0x1'),{'body':_0x4ac63c,'log':_0xfdf2('0x1')});};exports['update']=function(_0x3cd7ae,_0x1ac912){return client[_0xfdf2('0x0')](_0xfdf2('0x2'),{'body':_0x1ac912,'options':{'where':{'uniqueid':_0x3cd7ae},'order':[['id',_0xfdf2('0x3')]],'limit':0x1},'log':_0xfdf2('0x2')});};
\ No newline at end of file
+var _0xf015=['../client','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport'];(function(_0x3296fc,_0x51bd2a){var _0x450188=function(_0x466c75){while(--_0x466c75){_0x3296fc['push'](_0x3296fc['shift']());}};_0x450188(++_0x51bd2a);}(_0xf015,0x113));var _0x5f01=function(_0x2a9ea9,_0x24f2a0){_0x2a9ea9=_0x2a9ea9-0x0;var _0x295684=_0xf015[_0x2a9ea9];return _0x295684;};'use strict';var client=require(_0x5f01('0x0'));exports['create']=function(_0x3daa52){return client['Request'](_0x5f01('0x1'),{'body':_0x3daa52,'log':'CreateWhatsappQueueReport'});};exports[_0x5f01('0x2')]=function(_0x39b4be,_0x319bc7){return client[_0x5f01('0x3')]('UpdateWhatsappQueueReport',{'body':_0x319bc7,'options':{'where':{'uniqueid':_0x39b4be},'order':[['id','DESC']],'limit':0x1},'log':_0x5f01('0x4')});};
\ No newline at end of file
index 85b7bb3..a225ef6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3664=['close','stop','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','routing','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','[%s][AGENT]\x20%s','map','message','join','find','agents','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED'];(function(_0x1d27d5,_0x2098c5){var _0x5aa5eb=function(_0x2861da){while(--_0x2861da){_0x1d27d5['push'](_0x1d27d5['shift']());}};_0x5aa5eb(++_0x2098c5);}(_0x3664,0x19c));var _0x4366=function(_0x418ae0,_0xc42a2c){_0x418ae0=_0x418ae0-0x0;var _0x4a7551=_0x3664[_0x418ae0];return _0x4a7551;};'use strict';var schema=require(_0x4366('0x0'));var _=require('lodash');var util=require(_0x4366('0x1'));var seqqueue=require(_0x4366('0x2'));var logger=require('../../../../config/logger')(_0x4366('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x4366('0x4'),'message':_0x4366('0x5')}});function writeLog(_0x24063d,_0x54000f,_0x3d48b2){return logger[_0x4366('0x6')](util[_0x4366('0x7')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x24063d,_0x54000f[_0x4366('0x8')],_0x3d48b2));}function handleFindAgent(_0x3869d8){return function(_0x306288){return _0x306288[_0x4366('0x8')][_0x4366('0x9')]()===_0x3869d8['toLowerCase']();};}exports['consequence']=function(_0x2da1c9,_0x7368da,_0x3a4aa6,_0x4fadb2){return function(_0x173073){try{var _0x28fb0b={'name':_0x7368da[0x0],'timeout':_0x7368da[0x1]};var _0x52b062=queue[_0x4366('0x0')](_0x28fb0b,{'typecast':!![]});if(_0x52b062['length']){logger['error'](_0x4366('0xa'),_0x2da1c9,_[_0x4366('0xb')](_0x52b062,_0x4366('0xc'))[_0x4366('0xd')](',\x20'));_0x173073['stop']();}else{var _0x4654be=_[_0x4366('0xe')](_0x3a4aa6[_0x4366('0xf')],handleFindAgent(_0x28fb0b[_0x4366('0x8')]));if(_0x4654be){var _0x4cea1a=(_0x28fb0b['timeout']||0xa)*0x3e8;var _0x184e52,_0x3db080;var _0x2b955b=seqqueue['createQueue'](_0x4cea1a);_0x2b955b['id']=_0x2da1c9;_0x2b955b[_0x4366('0x10')]=_0x4cea1a;_0x2b955b[_0x4366('0x11')]=_0x4fadb2[_0x4366('0x11')];writeLog(_0x2da1c9,_0x4654be,util[_0x4366('0x7')](_0x4366('0x12'),_0x4cea1a));_0x3a4aa6[_0x4366('0x13')][_0x2da1c9]['on'](_0x4366('0x14'),function(){logger[_0x4366('0x6')](_0x4366('0x15'),_0x2da1c9);clearTimeout(_0x3db080);_0x3db080=undefined;_0x2b955b[_0x4366('0x16')]();if(_0x3a4aa6[_0x4366('0x13')][_0x2da1c9]){delete _0x3a4aa6[_0x4366('0x13')][_0x2da1c9];}_0x173073[_0x4366('0x17')]();});_0x3a4aa6['rules'][_0x2da1c9]['on']('complete',function(){if(_0x3a4aa6[_0x4366('0x13')][_0x2da1c9]){delete _0x3a4aa6['rules'][_0x2da1c9];}});_0x3db080=setTimeout(function(){logger[_0x4366('0x6')]('[%s][AGENT]\x20ROUTING\x20END',_0x2da1c9);clearTimeout(_0x3db080);_0x2b955b[_0x4366('0x16')]();_0x173073[_0x4366('0x18')]();},_0x4cea1a);strategy[_0x4366('0x19')](_0x2b955b,_0x4654be,_0x3a4aa6,_0x4fadb2);}else{logger[_0x4366('0x1a')](_0x4366('0x1b'),_0x2da1c9,_0x28fb0b[_0x4366('0x8')]);_0x173073[_0x4366('0x17')]();}}}catch(_0x39c712){console[_0x4366('0x1c')](_0x39c712);logger[_0x4366('0x1a')](_0x4366('0x1d'),_0x2da1c9,_0x39c712[_0x4366('0x1e')]);_0x173073['stop']();}};};
\ No newline at end of file
+var _0x0a1f=['toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','atimeout','channel','format','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a1f,0x18f));var _0xf0a1=function(_0x4a22e5,_0xffdc52){_0x4a22e5=_0x4a22e5-0x0;var _0x4ebc8d=_0x0a1f[_0x4a22e5];return _0x4ebc8d;};'use strict';var schema=require('validate');var _=require(_0xf0a1('0x0'));var util=require(_0xf0a1('0x1'));var seqqueue=require(_0xf0a1('0x2'));var logger=require(_0xf0a1('0x3'))(_0xf0a1('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xf0a1('0x5'),'required':!![],'message':_0xf0a1('0x6')},'timeout':{'type':'number','message':_0xf0a1('0x7')}});function writeLog(_0x4491a8,_0x14fc7e,_0x328be3){return logger['info'](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x4491a8,_0x14fc7e['name'],_0x328be3));}function handleFindAgent(_0x481e9e){return function(_0x31ca64){return _0x31ca64[_0xf0a1('0x8')]['toLowerCase']()===_0x481e9e[_0xf0a1('0x9')]();};}exports[_0xf0a1('0xa')]=function(_0x1448cf,_0x1096ca,_0x4b1db9,_0x161d4a){return function(_0x53b830){try{var _0x176ab7={'name':_0x1096ca[0x0],'timeout':_0x1096ca[0x1]};var _0x4a7245=queue[_0xf0a1('0xb')](_0x176ab7,{'typecast':!![]});if(_0x4a7245[_0xf0a1('0xc')]){logger[_0xf0a1('0xd')](_0xf0a1('0xe'),_0x1448cf,_[_0xf0a1('0xf')](_0x4a7245,_0xf0a1('0x10'))[_0xf0a1('0x11')](',\x20'));_0x53b830[_0xf0a1('0x12')]();}else{var _0x30f008=_['find'](_0x4b1db9[_0xf0a1('0x13')],handleFindAgent(_0x176ab7[_0xf0a1('0x8')]));if(_0x30f008){var _0x39d8bf=(_0x176ab7[_0xf0a1('0x14')]||0xa)*0x3e8;var _0x347a6a,_0x584d9f;var _0x2d2719=seqqueue['createQueue'](_0x39d8bf);_0x2d2719['id']=_0x1448cf;_0x2d2719[_0xf0a1('0x15')]=_0x39d8bf;_0x2d2719[_0xf0a1('0x16')]=_0x161d4a[_0xf0a1('0x16')];writeLog(_0x1448cf,_0x30f008,util[_0xf0a1('0x17')]('START:%s',_0x39d8bf));_0x4b1db9['rules'][_0x1448cf]['on']('end',function(){logger['info'](_0xf0a1('0x18'),_0x1448cf);clearTimeout(_0x584d9f);_0x584d9f=undefined;_0x2d2719[_0xf0a1('0x19')]();if(_0x4b1db9[_0xf0a1('0x1a')][_0x1448cf]){delete _0x4b1db9[_0xf0a1('0x1a')][_0x1448cf];}_0x53b830[_0xf0a1('0x12')]();});_0x4b1db9['rules'][_0x1448cf]['on'](_0xf0a1('0x1b'),function(){if(_0x4b1db9[_0xf0a1('0x1a')][_0x1448cf]){delete _0x4b1db9[_0xf0a1('0x1a')][_0x1448cf];}});_0x584d9f=setTimeout(function(){logger['info'](_0xf0a1('0x1c'),_0x1448cf);clearTimeout(_0x584d9f);_0x2d2719[_0xf0a1('0x19')]();_0x53b830['next']();},_0x39d8bf);strategy[_0xf0a1('0x1d')](_0x2d2719,_0x30f008,_0x4b1db9,_0x161d4a);}else{logger[_0xf0a1('0xd')](_0xf0a1('0x1e'),_0x1448cf,_0x176ab7[_0xf0a1('0x8')]);_0x53b830['stop']();}}}catch(_0x3ad342){console[_0xf0a1('0x1f')](_0x3ad342);logger[_0xf0a1('0xd')](_0xf0a1('0x20'),_0x1448cf,_0x3ad342[_0xf0a1('0x21')]);_0x53b830['stop']();}};};
\ No newline at end of file
index ebc608d..a92ecc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5af=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','interaction','phone','chat','ChatWebsiteId','AccountId','account','InteractionId','isEmpty','body','create','then','error','stringify','stop','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','toString','postText','message','providerName','providerResponse','Message','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger'];(function(_0x3ac0cd,_0x48d976){var _0x27f404=function(_0xfdda5f){while(--_0xfdda5f){_0x3ac0cd['push'](_0x3ac0cd['shift']());}};_0x27f404(++_0x48d976);}(_0xc5af,0x1a2));var _0xfc5a=function(_0x32f490,_0x255ae8){_0x32f490=_0x32f490-0x0;var _0x260059=_0xc5af[_0x32f490];return _0x260059;};'use strict';var _=require(_0xfc5a('0x0'));var moment=require(_0xfc5a('0x1'));var AWS=require(_0xfc5a('0x2'));var utils=require(_0xfc5a('0x3'));var logger=require(_0xfc5a('0x4'))(_0xfc5a('0x5'));var rpc={'chatMessage':require(_0xfc5a('0x6')),'openchannelMessage':require(_0xfc5a('0x7')),'mailMessage':require(_0xfc5a('0x8')),'smsMessage':require(_0xfc5a('0x9')),'faxMessage':require(_0xfc5a('0xa')),'whatsappMessage':require(_0xfc5a('0xb'))};exports['consequence']=function(_0x4e47dc,_0x380428){return function(_0x4aeb14){try{if(!_[_0xfc5a('0xc')](this['interaction']['UserId'])){logger['info'](_0xfc5a('0xd'),_0x4e47dc,_0xfc5a('0xe'));return _0x4aeb14[_0xfc5a('0xf')]();}var _0x23ef9d={'ContactId':this[_0xfc5a('0x10')]['id'],'sentAt':moment()[_0xfc5a('0x11')](_0xfc5a('0x12')),'direction':'out'};if(this[_0xfc5a('0x13')]===_0xfc5a('0x14')||this[_0xfc5a('0x13')]===_0xfc5a('0x15')){_0x23ef9d['phone']=this[_0xfc5a('0x16')][_0xfc5a('0x17')];}var _0x4d47fa=this['channel'];if(_0x4d47fa===_0xfc5a('0x18')){_0x23ef9d[_0xfc5a('0x19')]=this['account']['id'];}else{_0x23ef9d[_['upperFirst'](_0x4d47fa)+_0xfc5a('0x1a')]=this[_0xfc5a('0x1b')]['id'];}_0x23ef9d[_['upperFirst'](_0x4d47fa)+_0xfc5a('0x1c')]=this[_0xfc5a('0x16')]['id'];if(this[_0xfc5a('0x16')]['created']){var _0x497c50=_0x380428[0x4];if(!_[_0xfc5a('0x1d')](_0x497c50)){_0x23ef9d[_0xfc5a('0x1e')]=utils['getMustacheRender'](_0x497c50,this);return rpc[_0x4d47fa+'Message'][_0xfc5a('0x1f')](_0x23ef9d)[_0xfc5a('0x20')](function(_0x10e223){logger['info'](_0xfc5a('0xd'),_0x4e47dc,_0x23ef9d['body']);})['catch'](function(_0xdbfc1f){logger[_0xfc5a('0x21')](_0xfc5a('0xd'),_0x4e47dc,JSON[_0xfc5a('0x22')](_0xdbfc1f));})['finally'](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4e47dc);_0x4aeb14[_0xfc5a('0x23')]();});}else{logger[_0xfc5a('0x24')](_0xfc5a('0x25'),_0x4e47dc);_0x4aeb14[_0xfc5a('0x23')]();}}else{var _0x1a022c=this;var _0x44c452=new AWS[(_0xfc5a('0x26'))]({'accessKeyId':_0x380428[0x0],'secretAccessKey':_0x380428[0x1],'region':_0x380428[0x2]});var _0x400c6d={'botAlias':_0xfc5a('0x27'),'botName':_0x380428[0x3],'inputText':this['message']['body'],'userId':this[_0xfc5a('0x13')]+':'+this['interaction']['id'][_0xfc5a('0x28')]()};_0x44c452[_0xfc5a('0x29')](_0x400c6d,function(_0x552cb8,_0x297879){if(_0x552cb8){logger[_0xfc5a('0x21')](_0xfc5a('0xd'),_0x4e47dc,_0x552cb8[_0xfc5a('0x2a')]);_0x4aeb14['next']();}else if(_0x297879&&_0x297879[_0xfc5a('0x2a')]){_0x1a022c[_0xfc5a('0x1e')]['amazonlex']=_0x297879;_0x23ef9d['body']=_0x297879['message'];_0x23ef9d[_0xfc5a('0x2b')]='amazonlex';_0x23ef9d[_0xfc5a('0x2c')]=JSON['stringify'](_0x297879);return rpc[_0x4d47fa+_0xfc5a('0x2d')][_0xfc5a('0x1f')](_0x23ef9d)[_0xfc5a('0x20')](function(_0x5f4aee){logger[_0xfc5a('0x24')]('[%s][AMAZONLEX]\x20%s',_0x4e47dc,_0x23ef9d[_0xfc5a('0x1e')]);if(_0x297879[_0xfc5a('0x2e')]=='Failed'){_0x4aeb14[_0xfc5a('0xf')]();}else{_0x4aeb14[_0xfc5a('0x23')]();}})['catch'](function(_0x202573){logger[_0xfc5a('0x21')](_0xfc5a('0xd'),_0x4e47dc,JSON['stringify'](_0x202573));_0x4aeb14[_0xfc5a('0xf')]();});}else{_0x4aeb14[_0xfc5a('0xf')]();}});}}catch(_0x55837d){logger['error'](_0xfc5a('0xd'),_0x4e47dc,JSON[_0xfc5a('0x22')](_0x55837d));_0x4aeb14[_0xfc5a('0x23')]();}};};
\ No newline at end of file
+var _0x86b8=['account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','providerName','amazonlex','providerResponse','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId'];(function(_0x433ab5,_0x16e711){var _0x315911=function(_0x2d24a2){while(--_0x2d24a2){_0x433ab5['push'](_0x433ab5['shift']());}};_0x315911(++_0x16e711);}(_0x86b8,0x17e));var _0x886b=function(_0x3e4821,_0x1b83d2){_0x3e4821=_0x3e4821-0x0;var _0x5c9d07=_0x86b8[_0x3e4821];return _0x5c9d07;};'use strict';var _=require('lodash');var moment=require(_0x886b('0x0'));var AWS=require(_0x886b('0x1'));var utils=require(_0x886b('0x2'));var logger=require(_0x886b('0x3'))(_0x886b('0x4'));var rpc={'chatMessage':require(_0x886b('0x5')),'openchannelMessage':require(_0x886b('0x6')),'mailMessage':require(_0x886b('0x7')),'smsMessage':require(_0x886b('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x886b('0x9'))};exports['consequence']=function(_0x190655,_0x3ea478){return function(_0x4a1cf3){try{if(!_[_0x886b('0xa')](this[_0x886b('0xb')][_0x886b('0xc')])){logger[_0x886b('0xd')](_0x886b('0xe'),_0x190655,_0x886b('0xf'));return _0x4a1cf3[_0x886b('0x10')]();}var _0x56bbdd={'ContactId':this[_0x886b('0x11')]['id'],'sentAt':moment()[_0x886b('0x12')](_0x886b('0x13')),'direction':_0x886b('0x14')};if(this[_0x886b('0x15')]===_0x886b('0x16')||this[_0x886b('0x15')]===_0x886b('0x17')){_0x56bbdd['phone']=this[_0x886b('0xb')][_0x886b('0x18')];}var _0x44f92b=this[_0x886b('0x15')];if(_0x44f92b==='chat'){_0x56bbdd[_0x886b('0x19')]=this[_0x886b('0x1a')]['id'];}else{_0x56bbdd[_[_0x886b('0x1b')](_0x44f92b)+_0x886b('0x1c')]=this[_0x886b('0x1a')]['id'];}_0x56bbdd[_[_0x886b('0x1b')](_0x44f92b)+'InteractionId']=this[_0x886b('0xb')]['id'];if(this[_0x886b('0xb')][_0x886b('0x1d')]){var _0x2e1a8a=_0x3ea478[0x4];if(!_[_0x886b('0x1e')](_0x2e1a8a)){_0x56bbdd[_0x886b('0x1f')]=utils[_0x886b('0x20')](_0x2e1a8a,this);return rpc[_0x44f92b+_0x886b('0x21')][_0x886b('0x22')](_0x56bbdd)[_0x886b('0x23')](function(_0x1df340){logger[_0x886b('0xd')](_0x886b('0xe'),_0x190655,_0x56bbdd[_0x886b('0x1f')]);})[_0x886b('0x24')](function(_0x416938){logger[_0x886b('0x25')](_0x886b('0xe'),_0x190655,JSON[_0x886b('0x26')](_0x416938));})[_0x886b('0x27')](function(){logger[_0x886b('0xd')](_0x886b('0x28'),_0x190655);_0x4a1cf3[_0x886b('0x29')]();});}else{logger[_0x886b('0xd')](_0x886b('0x2a'),_0x190655);_0x4a1cf3[_0x886b('0x29')]();}}else{var _0x429329=this;var _0x1ed268=new AWS['LexRuntime']({'accessKeyId':_0x3ea478[0x0],'secretAccessKey':_0x3ea478[0x1],'region':_0x3ea478[0x2]});var _0x4a218d={'botAlias':_0x886b('0x2b'),'botName':_0x3ea478[0x3],'inputText':this[_0x886b('0x2c')][_0x886b('0x1f')],'userId':this[_0x886b('0x15')]+':'+this[_0x886b('0xb')]['id'][_0x886b('0x2d')]()};_0x1ed268[_0x886b('0x2e')](_0x4a218d,function(_0x443f94,_0x18f4e4){if(_0x443f94){logger[_0x886b('0x25')](_0x886b('0xe'),_0x190655,_0x443f94[_0x886b('0x2c')]);_0x4a1cf3[_0x886b('0x10')]();}else if(_0x18f4e4&&_0x18f4e4[_0x886b('0x2c')]){_0x429329[_0x886b('0x1f')]['amazonlex']=_0x18f4e4;_0x56bbdd['body']=_0x18f4e4[_0x886b('0x2c')];_0x56bbdd[_0x886b('0x2f')]=_0x886b('0x30');_0x56bbdd[_0x886b('0x31')]=JSON[_0x886b('0x26')](_0x18f4e4);return rpc[_0x44f92b+_0x886b('0x21')][_0x886b('0x22')](_0x56bbdd)[_0x886b('0x23')](function(_0x3ea700){logger[_0x886b('0xd')]('[%s][AMAZONLEX]\x20%s',_0x190655,_0x56bbdd[_0x886b('0x1f')]);if(_0x18f4e4['dialogState']==_0x886b('0x32')){_0x4a1cf3[_0x886b('0x10')]();}else{_0x4a1cf3['stop']();}})[_0x886b('0x24')](function(_0x51e349){logger[_0x886b('0x25')](_0x886b('0xe'),_0x190655,JSON[_0x886b('0x26')](_0x51e349));_0x4a1cf3[_0x886b('0x10')]();});}else{_0x4a1cf3['next']();}});}}catch(_0x216761){logger[_0x886b('0x25')](_0x886b('0xe'),_0x190655,JSON[_0x886b('0x26')](_0x216761));_0x4a1cf3['stop']();}};};
\ No newline at end of file
index 0aba96f..8e29371 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cdb=['../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','channel','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','body','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','AccountId','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','inReplyTo','messageId','<div\x20id=\x22xm-mail-content\x22>','</div>','headers','auto-replied','All','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','error','resolve','update','then','stringify','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','finally','Interaction','moment','../../../../config/logger','routing','../../rpc/openchannelMessage'];(function(_0x3b3996,_0x430361){var _0x425a24=function(_0x30fb2e){while(--_0x30fb2e){_0x3b3996['push'](_0x3b3996['shift']());}};_0x425a24(++_0x430361);}(_0x7cdb,0x1d8));var _0xb7cd=function(_0x834325,_0xa10a){_0x834325=_0x834325-0x0;var _0x2c3847=_0x7cdb[_0x834325];return _0x2c3847;};'use strict';var _=require('lodash');var moment=require(_0xb7cd('0x0'));var utils=require('./utils');var logger=require(_0xb7cd('0x1'))(_0xb7cd('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb7cd('0x3')),'mailMessage':require(_0xb7cd('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb7cd('0x5')),'whatsappMessage':require(_0xb7cd('0x6')),'chatInteraction':require(_0xb7cd('0x7')),'openchannelInteraction':require(_0xb7cd('0x8')),'mailInteraction':require(_0xb7cd('0x9')),'smsInteraction':require(_0xb7cd('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xb7cd('0xb'));exports[_0xb7cd('0xc')]=function(_0x2f9df4,_0x55dddf){return function(_0x39045e){try{if(_0x55dddf[0x0]==='1'&&(_[_0xb7cd('0xd')](this[_0xb7cd('0xe')][_0xb7cd('0xf')])||!this[_0xb7cd('0xe')][_0xb7cd('0xf')])){logger['info'](_0xb7cd('0x10'),_0x2f9df4,_0xb7cd('0x11'));return _0x39045e[_0xb7cd('0x12')]();}if(_0x55dddf[0x0]==='2'&&this['interaction'][_0xb7cd('0x13')]){logger[_0xb7cd('0x14')](_0xb7cd('0x15'),_0x2f9df4,_0xb7cd('0x16'));return _0x39045e['next']();}var _0x265a97=this[_0xb7cd('0x17')];var _0x62e3d2={'ContactId':this['contact']['id'],'sentAt':moment()[_0xb7cd('0x18')](_0xb7cd('0x19')),'direction':_0xb7cd('0x1a')};if(this[_0xb7cd('0x17')]===_0xb7cd('0x1b')){_0x62e3d2['body']=utils[_0xb7cd('0x1c')](_0x55dddf[0x2],this);}else{_0x62e3d2[_0xb7cd('0x1d')]=utils['getMustacheRender'](_0x55dddf[0x1],this);}if(this[_0xb7cd('0x1e')]){_0x62e3d2['to']=this[_0xb7cd('0x1e')][_0xb7cd('0x1f')]||'';if(this[_0xb7cd('0x17')]===_0xb7cd('0x1b')&&_0x55dddf[0x1]==='1'){_0x62e3d2['cc']=this[_0xb7cd('0x1e')]['cc']||'';}_0x62e3d2[_0xb7cd('0x1f')]=this['message']['to']||'';_0x62e3d2[_0xb7cd('0x20')]=this[_0xb7cd('0x1e')][_0xb7cd('0x20')]||'';_0x62e3d2[_0xb7cd('0x21')]=!![];if(this[_0xb7cd('0x1e')][_0xb7cd('0x22')]){_0x62e3d2[_0xb7cd('0x22')]='';_0x62e3d2[_0xb7cd('0x22')]+=_[_0xb7cd('0x23')](this[_0xb7cd('0x1e')][_0xb7cd('0x22')],_0xb7cd('0x24'))?'':_0xb7cd('0x25');_0x62e3d2[_0xb7cd('0x22')]+=this[_0xb7cd('0x1e')][_0xb7cd('0x22')];}}if(this[_0xb7cd('0x17')]===_0xb7cd('0x26')){_0x62e3d2['ChatWebsiteId']=this[_0xb7cd('0x27')]['id'];}else{_0x62e3d2[_['upperFirst'](this[_0xb7cd('0x17')])+_0xb7cd('0x28')]=this['account']['id'];}_0x62e3d2[_[_0xb7cd('0x29')](this[_0xb7cd('0x17')])+_0xb7cd('0x2a')]=this['interaction']['id'];var _0x2cc832=this[_0xb7cd('0xe')];if(rpc[this[_0xb7cd('0x17')]+_0xb7cd('0x2b')]){if(this[_0xb7cd('0x17')]===_0xb7cd('0x1b')){var _0xdbdd4e={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0xb7cd('0x2c')][_0xb7cd('0x2d')]){_0xdbdd4e[_0xb7cd('0x2d')]=this['account'][_0xb7cd('0x2c')]['service'];}else{_0xdbdd4e['host']=this[_0xb7cd('0x27')][_0xb7cd('0x2c')][_0xb7cd('0x2e')];_0xdbdd4e[_0xb7cd('0x2f')]=this['account'][_0xb7cd('0x2c')][_0xb7cd('0x2f')];_0xdbdd4e[_0xb7cd('0x30')]=this[_0xb7cd('0x27')][_0xb7cd('0x2c')]['secure'];}if(this[_0xb7cd('0x27')][_0xb7cd('0x2c')]['authentication']){_0xdbdd4e['auth']={'user':this[_0xb7cd('0x27')][_0xb7cd('0x2c')]['user'],'pass':this['account'][_0xb7cd('0x2c')]['pass']};}_0x62e3d2[_0xb7cd('0x31')]=this[_0xb7cd('0x1e')][_0xb7cd('0x32')];_0x62e3d2['html']=_0xb7cd('0x33')+_['replace'](_0x62e3d2[_0xb7cd('0x1d')],'<div\x20id=\x22xm-mail-content\x22','<div')+_0xb7cd('0x34');_0x62e3d2[_0xb7cd('0x35')]={'Auto-Submitted':_0xb7cd('0x36'),'X-Auto-Response-Suppress':_0xb7cd('0x37'),'Precedence':'auto_reply'};return mailRpc[_0xb7cd('0x38')](_0xdbdd4e,_0x62e3d2)['then'](function(_0x4fdf3a){logger[_0xb7cd('0x14')](_0xb7cd('0x39'),_0x2f9df4);_0x62e3d2['messageId']=_0x4fdf3a[_0xb7cd('0x1e')][_0xb7cd('0x32')];return rpc[_0x265a97+'Message']['create'](_0x62e3d2);})['then'](function(_0x3e4d66){logger['info'](_0xb7cd('0x10'),_0x2f9df4,JSON['stringify'](_0x3e4d66));})['catch'](function(_0x4fadd9){logger[_0xb7cd('0x3a')]('[RPC][%s][AUTOREPLY]\x20%s',_0x2f9df4,JSON['stringify'](_0x4fadd9));})['finally'](function(){Promise[_0xb7cd('0x3b')]()['then'](function(){if(_0x55dddf[0x0]!=='2'||_0x2cc832[_0xb7cd('0x13')])return;return rpc[_0x265a97+'Interaction'][_0xb7cd('0x3c')](_0x2cc832['id'],{'autoreplyExecuted':!![]})[_0xb7cd('0x3d')](function(_0x1b138a){logger['info'](_0xb7cd('0x15'),_0x2f9df4,JSON[_0xb7cd('0x3e')](_0x1b138a));})[_0xb7cd('0x3f')](function(_0x9652b3){logger[_0xb7cd('0x3a')](_0xb7cd('0x40'),_0x2f9df4,JSON[_0xb7cd('0x3e')](_0x9652b3));});})[_0xb7cd('0x3d')](function(){_0x39045e['next']();});});}else{return rpc[this[_0xb7cd('0x17')]+_0xb7cd('0x2b')][_0xb7cd('0x41')](_0x62e3d2)[_0xb7cd('0x3d')](function(_0x45b4e1){logger[_0xb7cd('0x14')]('[%s][AUTOREPLY]\x20%s',_0x2f9df4,_0x62e3d2[_0xb7cd('0x1d')]);})[_0xb7cd('0x3f')](function(_0x428b72){logger[_0xb7cd('0x3a')]('[%s][AUTOREPLY]\x20%s',_0x2f9df4,JSON['stringify'](_0x428b72));})[_0xb7cd('0x42')](function(){Promise[_0xb7cd('0x3b')]()[_0xb7cd('0x3d')](function(){if(_0x55dddf[0x0]!=='2'||_0x2cc832['autoreplyExecuted'])return;return rpc[_0x265a97+_0xb7cd('0x43')][_0xb7cd('0x3c')](_0x2cc832['id'],{'autoreplyExecuted':!![]})[_0xb7cd('0x3d')](function(_0x553bfa){logger[_0xb7cd('0x14')](_0xb7cd('0x15'),_0x2f9df4,JSON[_0xb7cd('0x3e')](_0x553bfa));})[_0xb7cd('0x3f')](function(_0x4a3147){logger[_0xb7cd('0x3a')](_0xb7cd('0x40'),_0x2f9df4,JSON['stringify'](_0x4a3147));});})[_0xb7cd('0x3d')](function(){_0x39045e[_0xb7cd('0x12')]();});});}}}catch(_0x36af78){logger[_0xb7cd('0x3a')](_0xb7cd('0x10'),_0x2f9df4,JSON[_0xb7cd('0x3e')](_0x36af78));_0x39045e['stop']();}};};
\ No newline at end of file
+var _0xbfef=['update','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','next','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','mail','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','Smtp','service','host','port','secure','authentication','auth','pass','messageId','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','auto-replied','All','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','[%s][AUTOREPLY]\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbfef,0x165));var _0xfbfe=function(_0x30a97d,_0x2a38fc){_0x30a97d=_0x30a97d-0x0;var _0xc1d589=_0xbfef[_0x30a97d];return _0xc1d589;};'use strict';var _=require(_0xfbfe('0x0'));var moment=require('moment');var utils=require(_0xfbfe('0x1'));var logger=require(_0xfbfe('0x2'))(_0xfbfe('0x3'));var rpc={'chatMessage':require(_0xfbfe('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xfbfe('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xfbfe('0x6')),'chatInteraction':require(_0xfbfe('0x7')),'openchannelInteraction':require(_0xfbfe('0x8')),'mailInteraction':require(_0xfbfe('0x9')),'smsInteraction':require(_0xfbfe('0xa')),'faxInteraction':require(_0xfbfe('0xb')),'whatsappInteraction':require(_0xfbfe('0xc'))};var mailRpc=require(_0xfbfe('0xd'));exports['consequence']=function(_0x45ed20,_0x49767e){return function(_0x367f96){try{if(_0x49767e[0x0]==='1'&&(_['isNil'](this[_0xfbfe('0xe')]['created'])||!this['interaction']['created'])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x45ed20,_0xfbfe('0xf'));return _0x367f96['next']();}if(_0x49767e[0x0]==='2'&&this[_0xfbfe('0xe')][_0xfbfe('0x10')]){logger[_0xfbfe('0x11')](_0xfbfe('0x12'),_0x45ed20,_0xfbfe('0x13'));return _0x367f96[_0xfbfe('0x14')]();}var _0x2c9af0=this[_0xfbfe('0x15')];var _0x422931={'ContactId':this[_0xfbfe('0x16')]['id'],'sentAt':moment()[_0xfbfe('0x17')](_0xfbfe('0x18')),'direction':'out'};if(this['channel']===_0xfbfe('0x19')){_0x422931[_0xfbfe('0x1a')]=utils[_0xfbfe('0x1b')](_0x49767e[0x2],this);}else{_0x422931['body']=utils[_0xfbfe('0x1b')](_0x49767e[0x1],this);}if(this[_0xfbfe('0x1c')]){_0x422931['to']=this['message'][_0xfbfe('0x1d')]||'';if(this[_0xfbfe('0x15')]===_0xfbfe('0x19')&&_0x49767e[0x1]==='1'){_0x422931['cc']=this[_0xfbfe('0x1c')]['cc']||'';}_0x422931[_0xfbfe('0x1d')]=this[_0xfbfe('0x1c')]['to']||'';_0x422931[_0xfbfe('0x1e')]=this[_0xfbfe('0x1c')][_0xfbfe('0x1e')]||'';_0x422931[_0xfbfe('0x1f')]=!![];if(this[_0xfbfe('0x1c')]['subject']){_0x422931[_0xfbfe('0x20')]='';_0x422931[_0xfbfe('0x20')]+=_[_0xfbfe('0x21')](this[_0xfbfe('0x1c')][_0xfbfe('0x20')],_0xfbfe('0x22'))?'':_0xfbfe('0x23');_0x422931['subject']+=this[_0xfbfe('0x1c')][_0xfbfe('0x20')];}}if(this[_0xfbfe('0x15')]===_0xfbfe('0x24')){_0x422931[_0xfbfe('0x25')]=this[_0xfbfe('0x26')]['id'];}else{_0x422931[_[_0xfbfe('0x27')](this[_0xfbfe('0x15')])+_0xfbfe('0x28')]=this[_0xfbfe('0x26')]['id'];}_0x422931[_[_0xfbfe('0x27')](this[_0xfbfe('0x15')])+'InteractionId']=this['interaction']['id'];var _0x19f0d1=this[_0xfbfe('0xe')];if(rpc[this[_0xfbfe('0x15')]+_0xfbfe('0x29')]){if(this[_0xfbfe('0x15')]===_0xfbfe('0x19')){var _0x3bc5c9={'tls':{'rejectUnauthorized':![]}};if(this[_0xfbfe('0x26')][_0xfbfe('0x2a')][_0xfbfe('0x2b')]){_0x3bc5c9[_0xfbfe('0x2b')]=this['account'][_0xfbfe('0x2a')][_0xfbfe('0x2b')];}else{_0x3bc5c9[_0xfbfe('0x2c')]=this['account'][_0xfbfe('0x2a')]['host'];_0x3bc5c9[_0xfbfe('0x2d')]=this[_0xfbfe('0x26')][_0xfbfe('0x2a')][_0xfbfe('0x2d')];_0x3bc5c9[_0xfbfe('0x2e')]=this[_0xfbfe('0x26')][_0xfbfe('0x2a')]['secure'];}if(this[_0xfbfe('0x26')]['Smtp'][_0xfbfe('0x2f')]){_0x3bc5c9[_0xfbfe('0x30')]={'user':this[_0xfbfe('0x26')][_0xfbfe('0x2a')]['user'],'pass':this['account']['Smtp'][_0xfbfe('0x31')]};}_0x422931['inReplyTo']=this[_0xfbfe('0x1c')][_0xfbfe('0x32')];_0x422931['html']=_0xfbfe('0x33')+_[_0xfbfe('0x34')](_0x422931[_0xfbfe('0x1a')],_0xfbfe('0x35'),_0xfbfe('0x36'))+'</div>';_0x422931['headers']={'Auto-Submitted':_0xfbfe('0x37'),'X-Auto-Response-Suppress':_0xfbfe('0x38'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](_0x3bc5c9,_0x422931)[_0xfbfe('0x39')](function(_0x2b64eb){logger[_0xfbfe('0x11')](_0xfbfe('0x3a'),_0x45ed20);_0x422931[_0xfbfe('0x32')]=_0x2b64eb['message'][_0xfbfe('0x32')];return rpc[_0x2c9af0+_0xfbfe('0x29')]['create'](_0x422931);})[_0xfbfe('0x39')](function(_0x3655b6){logger['info']('[%s][AUTOREPLY]\x20%s',_0x45ed20,JSON['stringify'](_0x3655b6));})[_0xfbfe('0x3b')](function(_0x5f2366){logger[_0xfbfe('0x3c')](_0xfbfe('0x3d'),_0x45ed20,JSON[_0xfbfe('0x3e')](_0x5f2366));})[_0xfbfe('0x3f')](function(){Promise[_0xfbfe('0x40')]()['then'](function(){if(_0x49767e[0x0]!=='2'||_0x19f0d1[_0xfbfe('0x10')])return;return rpc[_0x2c9af0+_0xfbfe('0x41')]['update'](_0x19f0d1['id'],{'autoreplyExecuted':!![]})[_0xfbfe('0x39')](function(_0x1e87dc){logger[_0xfbfe('0x11')](_0xfbfe('0x12'),_0x45ed20,JSON[_0xfbfe('0x3e')](_0x1e87dc));})['catch'](function(_0x3c29e9){logger[_0xfbfe('0x3c')](_0xfbfe('0x42'),_0x45ed20,JSON[_0xfbfe('0x3e')](_0x3c29e9));});})[_0xfbfe('0x39')](function(){_0x367f96['next']();});});}else{return rpc[this['channel']+_0xfbfe('0x29')][_0xfbfe('0x43')](_0x422931)[_0xfbfe('0x39')](function(_0x4e52a6){logger[_0xfbfe('0x11')](_0xfbfe('0x44'),_0x45ed20,_0x422931[_0xfbfe('0x1a')]);})['catch'](function(_0x366de6){logger[_0xfbfe('0x3c')](_0xfbfe('0x44'),_0x45ed20,JSON[_0xfbfe('0x3e')](_0x366de6));})[_0xfbfe('0x3f')](function(){Promise[_0xfbfe('0x40')]()['then'](function(){if(_0x49767e[0x0]!=='2'||_0x19f0d1[_0xfbfe('0x10')])return;return rpc[_0x2c9af0+'Interaction'][_0xfbfe('0x45')](_0x19f0d1['id'],{'autoreplyExecuted':!![]})[_0xfbfe('0x39')](function(_0x44760b){logger[_0xfbfe('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x45ed20,JSON[_0xfbfe('0x3e')](_0x44760b));})[_0xfbfe('0x3b')](function(_0x4ffca1){logger['error'](_0xfbfe('0x42'),_0x45ed20,JSON[_0xfbfe('0x3e')](_0x4ffca1));});})[_0xfbfe('0x39')](function(){_0x367f96[_0xfbfe('0x14')]();});});}}}catch(_0x427ad6){logger[_0xfbfe('0x3c')]('[%s][AUTOREPLY]\x20%s',_0x45ed20,JSON['stringify'](_0x427ad6));_0x367f96[_0xfbfe('0x46')]();}};};
\ No newline at end of file
index 6dd89f5..2c51eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68e8=['update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68e8,0x1ba));var _0x868e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x68e8[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x868e('0x0'));var logger=require(_0x868e('0x1'))(_0x868e('0x2'));var rpc={'chatInteraction':require(_0x868e('0x3')),'openchannelInteraction':require(_0x868e('0x4')),'smsInteraction':require(_0x868e('0x5')),'mailInteraction':require(_0x868e('0x6')),'faxInteraction':require(_0x868e('0x7')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x1d14f2,_0x5db51b,_0x4d7eba,_0x17ff97){return function(_0xbbedb0){try{logger[_0x868e('0x8')](_0x868e('0x9'),_0x1d14f2,_0x5db51b[0x0]);var _0x4b6ab4={'closed':0x1,'closedAt':moment()[_0x868e('0xa')](_0x868e('0xb')),'closeReason':_0x868e('0xc'),'disposition':_0x5db51b[0x0]};if(rpc[_0x17ff97[_0x868e('0xd')]+'Interaction']){rpc[_0x17ff97[_0x868e('0xd')]+'Interaction'][_0x868e('0xe')](_0x17ff97[_0x868e('0xf')]['id'],_0x4b6ab4)[_0x868e('0x10')](function(_0x311a5f){logger[_0x868e('0x8')](_0x868e('0x11'),_0x1d14f2,_0x17ff97[_0x868e('0xf')]['id']);})[_0x868e('0x12')](function(_0x27ad7d){logger[_0x868e('0x13')](_0x868e('0x14'),_0x1d14f2,JSON[_0x868e('0x15')](_0x27ad7d));})[_0x868e('0x16')](function(){_0xbbedb0['stop']();});}}catch(_0x455fe1){logger[_0x868e('0x13')](_0x868e('0x14'),_0x1d14f2,JSON[_0x868e('0x15')](_0x455fe1));_0xbbedb0[_0x868e('0x17')]();}};};
\ No newline at end of file
+var _0xb443=['../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','then','error','[%s][CLOSE]\x20%s','stop','stringify','moment'];(function(_0x40e962,_0x51273a){var _0xe5cd7=function(_0x2b1729){while(--_0x2b1729){_0x40e962['push'](_0x40e962['shift']());}};_0xe5cd7(++_0x51273a);}(_0xb443,0x117));var _0x3b44=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xb443[_0x1b4b23];return _0x2a325b;};'use strict';var moment=require(_0x3b44('0x0'));var logger=require(_0x3b44('0x1'))(_0x3b44('0x2'));var rpc={'chatInteraction':require(_0x3b44('0x3')),'openchannelInteraction':require(_0x3b44('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x3b44('0x5')),'faxInteraction':require(_0x3b44('0x6')),'whatsappInteraction':require(_0x3b44('0x7'))};exports[_0x3b44('0x8')]=function(_0x4b6de8,_0x3903dd,_0x52f4f0,_0x3cd5d6){return function(_0x4bb82d){try{logger[_0x3b44('0x9')](_0x3b44('0xa'),_0x4b6de8,_0x3903dd[0x0]);var _0x2a91aa={'closed':0x1,'closedAt':moment()['format'](_0x3b44('0xb')),'closeReason':_0x3b44('0xc'),'disposition':_0x3903dd[0x0]};if(rpc[_0x3cd5d6[_0x3b44('0xd')]+_0x3b44('0xe')]){rpc[_0x3cd5d6[_0x3b44('0xd')]+_0x3b44('0xe')]['update'](_0x3cd5d6['interaction']['id'],_0x2a91aa)[_0x3b44('0xf')](function(_0x3b56dd){logger[_0x3b44('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x4b6de8,_0x3cd5d6['interaction']['id']);})['catch'](function(_0x2d3dc0){logger[_0x3b44('0x10')](_0x3b44('0x11'),_0x4b6de8,JSON['stringify'](_0x2d3dc0));})['finally'](function(){_0x4bb82d[_0x3b44('0x12')]();});}}catch(_0x311c9b){logger[_0x3b44('0x10')]('[%s][CLOSE]\x20%s',_0x4b6de8,JSON[_0x3b44('0x13')](_0x311c9b));_0x4bb82d[_0x3b44('0x12')]();}};};
\ No newline at end of file
index 1489012..5233732 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6455=['isEmpty','body','getMustacheRender','create','then','error','stringify','stop','textRequest','dialogflow','result','providerResponse','metadata','endConversation','catch','message','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','created'];(function(_0x5b6ef4,_0x523eec){var _0x4c77b6=function(_0x2e560f){while(--_0x2e560f){_0x5b6ef4['push'](_0x5b6ef4['shift']());}};_0x4c77b6(++_0x523eec);}(_0x6455,0x97));var _0x5645=function(_0x324eb7,_0x3b406c){_0x324eb7=_0x324eb7-0x0;var _0x4395fa=_0x6455[_0x324eb7];return _0x4395fa;};'use strict';var _=require(_0x5645('0x0'));var moment=require('moment');var apiai=require(_0x5645('0x1'));var md5=require(_0x5645('0x2'));var utils=require(_0x5645('0x3'));var logger=require(_0x5645('0x4'))(_0x5645('0x5'));var rpc={'chatMessage':require(_0x5645('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5645('0x7')),'smsMessage':require(_0x5645('0x8')),'faxMessage':require(_0x5645('0x9')),'whatsappMessage':require(_0x5645('0xa'))};exports[_0x5645('0xb')]=function(_0x37d672,_0xa14a06){return function(_0x278d86){try{if(!_['isNil'](this['interaction'][_0x5645('0xc')])){logger[_0x5645('0xd')](_0x5645('0xe'),_0x37d672,_0x5645('0xf'));return _0x278d86[_0x5645('0x10')]();}var _0x16af81={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5645('0x11')](_0x5645('0x12')),'direction':_0x5645('0x13')};if(this[_0x5645('0x14')]==='sms'||this[_0x5645('0x14')]==='whatsapp'){_0x16af81[_0x5645('0x15')]=this[_0x5645('0x16')][_0x5645('0x15')];}var _0x21b018=this[_0x5645('0x14')];if(_0x21b018===_0x5645('0x17')){_0x16af81[_0x5645('0x18')]=this[_0x5645('0x19')]['id'];}else{_0x16af81[_['upperFirst'](_0x21b018)+_0x5645('0x1a')]=this[_0x5645('0x19')]['id'];}_0x16af81[_[_0x5645('0x1b')](_0x21b018)+'InteractionId']=this['interaction']['id'];if(this[_0x5645('0x16')][_0x5645('0x1c')]){var _0x511aed=_0xa14a06[0x2];if(!_[_0x5645('0x1d')](_0x511aed)){_0x16af81[_0x5645('0x1e')]=utils[_0x5645('0x1f')](_0x511aed,this);return rpc[_0x21b018+'Message'][_0x5645('0x20')](_0x16af81)[_0x5645('0x21')](function(_0x22a6cf){logger[_0x5645('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x37d672,_0x16af81[_0x5645('0x1e')]);})['catch'](function(_0x557ad2){logger[_0x5645('0x22')](_0x5645('0xe'),_0x37d672,JSON[_0x5645('0x23')](_0x557ad2));})['finally'](function(){logger[_0x5645('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x37d672);_0x278d86[_0x5645('0x24')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x37d672);_0x278d86[_0x5645('0x24')]();}}else{var _0x53d763=this;var _0x465a01=apiai(_0xa14a06[0x0],{'language':_0xa14a06[0x1]||'en'});return _0x465a01[_0x5645('0x25')](this['message'][_0x5645('0x1e')],{'sessionId':md5(this[_0x5645('0x16')]['id'])})[_0x5645('0x21')](function(_0x50fa82){_0x53d763[_0x5645('0x1e')][_0x5645('0x26')]=_0x50fa82;_0x16af81[_0x5645('0x1e')]=_0x50fa82[_0x5645('0x27')]['fulfillment']['speech'];_0x16af81['providerName']='dialogflow';_0x16af81[_0x5645('0x28')]=JSON['stringify'](_0x50fa82);return rpc[_0x21b018+'Message'][_0x5645('0x20')](_0x16af81)[_0x5645('0x21')](function(_0x357388){logger[_0x5645('0xd')](_0x5645('0xe'),_0x37d672,_0x16af81[_0x5645('0x1e')]);if(_0x50fa82[_0x5645('0x27')][_0x5645('0x29')][_0x5645('0x2a')]){_0x278d86[_0x5645('0x10')]();}else{_0x278d86[_0x5645('0x24')]();}})[_0x5645('0x2b')](function(_0x406782){logger[_0x5645('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x37d672,JSON[_0x5645('0x23')](_0x406782));_0x278d86['next']();});})[_0x5645('0x2b')](function(_0x31c31b){logger[_0x5645('0x22')](_0x5645('0xe'),_0x37d672,_0x31c31b[_0x5645('0x2c')]);_0x278d86[_0x5645('0x10')]();});}}catch(_0x4ac46c){logger['error'](_0x5645('0xe'),_0x37d672,JSON[_0x5645('0x23')](_0x4ac46c));_0x278d86[_0x5645('0x24')]();}};};
\ No newline at end of file
+var _0x2aa3=['created','isEmpty','body','getMustacheRender','then','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','Message','create','endConversation','next','lodash','moment','apiai-promise','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId'];(function(_0x475ed4,_0x1fb15f){var _0x1e4f72=function(_0x4e775b){while(--_0x4e775b){_0x475ed4['push'](_0x475ed4['shift']());}};_0x1e4f72(++_0x1fb15f);}(_0x2aa3,0x83));var _0x32aa=function(_0x52a25d,_0x332ac9){_0x52a25d=_0x52a25d-0x0;var _0x3e0471=_0x2aa3[_0x52a25d];return _0x3e0471;};'use strict';var _=require(_0x32aa('0x0'));var moment=require(_0x32aa('0x1'));var apiai=require(_0x32aa('0x2'));var md5=require(_0x32aa('0x3'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x32aa('0x4'));var rpc={'chatMessage':require(_0x32aa('0x5')),'openchannelMessage':require(_0x32aa('0x6')),'mailMessage':require(_0x32aa('0x7')),'smsMessage':require(_0x32aa('0x8')),'faxMessage':require(_0x32aa('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x32aa('0xa')]=function(_0x112396,_0x3ee18a){return function(_0x20efbe){try{if(!_[_0x32aa('0xb')](this[_0x32aa('0xc')][_0x32aa('0xd')])){logger[_0x32aa('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x32aa('0xf'));return _0x20efbe['next']();}var _0x3d61ee={'ContactId':this[_0x32aa('0x10')]['id'],'sentAt':moment()[_0x32aa('0x11')](_0x32aa('0x12')),'direction':'out'};if(this[_0x32aa('0x13')]===_0x32aa('0x14')||this[_0x32aa('0x13')]==='whatsapp'){_0x3d61ee[_0x32aa('0x15')]=this[_0x32aa('0xc')][_0x32aa('0x15')];}var _0x22c07a=this[_0x32aa('0x13')];if(_0x22c07a===_0x32aa('0x16')){_0x3d61ee[_0x32aa('0x17')]=this[_0x32aa('0x18')]['id'];}else{_0x3d61ee[_['upperFirst'](_0x22c07a)+_0x32aa('0x19')]=this[_0x32aa('0x18')]['id'];}_0x3d61ee[_[_0x32aa('0x1a')](_0x22c07a)+_0x32aa('0x1b')]=this[_0x32aa('0xc')]['id'];if(this['interaction'][_0x32aa('0x1c')]){var _0x251fa4=_0x3ee18a[0x2];if(!_[_0x32aa('0x1d')](_0x251fa4)){_0x3d61ee[_0x32aa('0x1e')]=utils[_0x32aa('0x1f')](_0x251fa4,this);return rpc[_0x22c07a+'Message']['create'](_0x3d61ee)[_0x32aa('0x20')](function(_0x34dcaf){logger[_0x32aa('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x3d61ee['body']);})[_0x32aa('0x21')](function(_0x148255){logger[_0x32aa('0x22')](_0x32aa('0x23'),_0x112396,JSON[_0x32aa('0x24')](_0x148255));})[_0x32aa('0x25')](function(){logger['info'](_0x32aa('0x26'),_0x112396);_0x20efbe[_0x32aa('0x27')]();});}else{logger[_0x32aa('0xe')](_0x32aa('0x28'),_0x112396);_0x20efbe[_0x32aa('0x27')]();}}else{var _0x90d165=this;var _0x1ce405=apiai(_0x3ee18a[0x0],{'language':_0x3ee18a[0x1]||'en'});return _0x1ce405[_0x32aa('0x29')](this[_0x32aa('0x2a')]['body'],{'sessionId':md5(this[_0x32aa('0xc')]['id'])})['then'](function(_0x6766da){_0x90d165[_0x32aa('0x1e')]['dialogflow']=_0x6766da;_0x3d61ee['body']=_0x6766da[_0x32aa('0x2b')][_0x32aa('0x2c')][_0x32aa('0x2d')];_0x3d61ee[_0x32aa('0x2e')]=_0x32aa('0x2f');_0x3d61ee[_0x32aa('0x30')]=JSON[_0x32aa('0x24')](_0x6766da);return rpc[_0x22c07a+_0x32aa('0x31')][_0x32aa('0x32')](_0x3d61ee)['then'](function(_0x128774){logger[_0x32aa('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x3d61ee[_0x32aa('0x1e')]);if(_0x6766da['result']['metadata'][_0x32aa('0x33')]){_0x20efbe[_0x32aa('0x34')]();}else{_0x20efbe[_0x32aa('0x27')]();}})[_0x32aa('0x21')](function(_0x5903b8){logger[_0x32aa('0x22')](_0x32aa('0x23'),_0x112396,JSON[_0x32aa('0x24')](_0x5903b8));_0x20efbe[_0x32aa('0x34')]();});})[_0x32aa('0x21')](function(_0x44887c){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x44887c[_0x32aa('0x2a')]);_0x20efbe[_0x32aa('0x34')]();});}}catch(_0x136893){logger[_0x32aa('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x112396,JSON['stringify'](_0x136893));_0x20efbe[_0x32aa('0x27')]();}};};
\ No newline at end of file
index 7680fae..5e25b7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39a9=['detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','length','fulfillmentText','push','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','isEmpty','stringify','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','message'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x39a9,0x1d0));var _0x939a=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x39a9[_0x3a2e49];return _0x257140;};'use strict';var _=require(_0x939a('0x0'));var dialogflow=require(_0x939a('0x1'));var md5=require(_0x939a('0x2'));var moment=require(_0x939a('0x3'));var Promise=require(_0x939a('0x4'));var logger=require(_0x939a('0x5'))(_0x939a('0x6'));var utils=require(_0x939a('0x7'));var rpc={'chatMessage':require(_0x939a('0x8')),'openchannelMessage':require(_0x939a('0x9')),'mailMessage':require(_0x939a('0xa')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x939a('0xb')),'whatsappMessage':require(_0x939a('0xc'))};function createMessage(_0x12cd66,_0x1c97c1,_0x3bed20,_0xe6a08){return new Promise(function(_0x398389,_0x7a6c61){var _0x529156=_[_0x939a('0xd')](_0x3bed20);_0x529156[_0x939a('0xe')]=_0xe6a08;return rpc[_0x1c97c1+_0x939a('0xf')]['create'](_0x529156)[_0x939a('0x10')](function(){logger[_0x939a('0x11')](_0x939a('0x12'),_0x12cd66,_0x529156['body']);_0x398389();})[_0x939a('0x13')](function(_0x6f14c3){logger[_0x939a('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x12cd66,JSON['stringify'](_0x6f14c3));_0x7a6c61(_0x6f14c3);});});}exports[_0x939a('0x15')]=function(_0x1d4a37,_0x1c14ae){return function(_0x5e22be){try{if(!_[_0x939a('0x16')](this[_0x939a('0x17')][_0x939a('0x18')])){logger[_0x939a('0x11')](_0x939a('0x12'),_0x1d4a37,_0x939a('0x19'));return _0x5e22be[_0x939a('0x1a')]();}var _0x521346={'ContactId':this[_0x939a('0x1b')]['id'],'sentAt':moment()['format'](_0x939a('0x1c')),'direction':'out'};if(this[_0x939a('0x1d')]===_0x939a('0x1e')||this[_0x939a('0x1d')]===_0x939a('0x1f')){_0x521346['phone']=this['interaction'][_0x939a('0x20')];}var _0x5e5dbd=this['channel'];if(_0x5e5dbd===_0x939a('0x21')){_0x521346[_0x939a('0x22')]=this[_0x939a('0x23')]['id'];}else{_0x521346[_[_0x939a('0x24')](_0x5e5dbd)+_0x939a('0x25')]=this['account']['id'];}_0x521346[_[_0x939a('0x24')](_0x5e5dbd)+'InteractionId']=this[_0x939a('0x17')]['id'];if(this['interaction']['created']){var _0x379f52=_0x1c14ae[0x4];if(!_[_0x939a('0x26')](_0x379f52)){_0x521346[_0x939a('0xe')]=utils['getMustacheRender'](_0x379f52,this);return rpc[_0x5e5dbd+'Message']['create'](_0x521346)[_0x939a('0x10')](function(_0x4fa5ae){logger[_0x939a('0x11')](_0x939a('0x12'),_0x1d4a37,_0x521346['body']);})[_0x939a('0x13')](function(_0x507b4b){logger[_0x939a('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x1d4a37,JSON[_0x939a('0x27')](_0x507b4b));})[_0x939a('0x28')](function(){logger[_0x939a('0x11')](_0x939a('0x29'),_0x1d4a37);_0x5e22be[_0x939a('0x2a')]();});}else{logger[_0x939a('0x11')](_0x939a('0x2b'),_0x1d4a37);_0x5e22be[_0x939a('0x2a')]();}}else{var _0x350be5=this;var _0x199691=_0x1c14ae[0x2][_0x939a('0x2c')](/\\n/g,'\x0a');var _0x233b48={'credentials':{'private_key':_0x199691,'client_email':_0x1c14ae[0x1]}};var _0x3df36b=new dialogflow[(_0x939a('0x2d'))](_0x233b48);var _0x16286a=_0x3df36b['sessionPath'](_0x1c14ae[0x0],md5(_0x350be5[_0x939a('0x17')]['id']));var _0x5d7cfe={'session':_0x16286a,'queryInput':{'text':{'text':_0x350be5[_0x939a('0x2e')][_0x939a('0xe')],'languageCode':_0x1c14ae[0x3]||'en'}}};return _0x3df36b[_0x939a('0x2f')](_0x5d7cfe)[_0x939a('0x10')](function(_0x48d585){if(_0x48d585&&_0x48d585['length']){_0x350be5[_0x939a('0xe')][_0x939a('0x30')]=_0x48d585;var _0x4ab516=_0x48d585[0x0];var _0x11ac7f=_0x4ab516['queryResult']['diagnosticInfo']&&_0x4ab516[_0x939a('0x31')][_0x939a('0x32')][_0x939a('0x33')]?_0x4ab516['queryResult'][_0x939a('0x32')][_0x939a('0x33')][_0x939a('0x34')][_0x939a('0x35')]:![];_0x350be5[_0x939a('0xe')][_0x939a('0x36')]=_0x4ab516[_0x939a('0x31')]['action'];_0x350be5[_0x939a('0xe')][_0x939a('0x37')]=_0x4ab516['queryResult'][_0x939a('0x38')];_0x350be5[_0x939a('0xe')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x4ab516[_0x939a('0x31')]['diagnosticInfo']&&_0x4ab516[_0x939a('0x31')][_0x939a('0x32')][_0x939a('0x33')]?_0x4ab516[_0x939a('0x31')][_0x939a('0x32')][_0x939a('0x33')][_0x939a('0x34')][_0x939a('0x35')]:![];_0x350be5[_0x939a('0xe')][_0x939a('0x39')]=_0x4ab516[_0x939a('0x31')][_0x939a('0x3a')][_0x939a('0x3b')];_0x350be5[_0x939a('0xe')][_0x939a('0x3c')]=_0x4ab516['queryResult'][_0x939a('0x3a')][_0x939a('0x3d')];_0x350be5['body'][_0x939a('0x3e')]=_0x4ab516[_0x939a('0x31')][_0x939a('0x3a')][_0x939a('0x3f')];_0x350be5[_0x939a('0xe')][_0x939a('0x40')]=_0x4ab516[_0x939a('0x31')]['languageCode'];_0x350be5[_0x939a('0xe')][_0x939a('0x41')]=_0x4ab516[_0x939a('0x31')][_0x939a('0x42')];_0x350be5['body'][_0x939a('0x43')]=_0x4ab516[_0x939a('0x31')]['intentDetectionConfidence'];_0x521346[_0x939a('0x44')]=_0x939a('0x30');_0x521346[_0x939a('0x45')]=JSON[_0x939a('0x27')](_0x48d585);var _0x187538=[];for(var _0x427bab=0x0;_0x427bab<_0x48d585[_0x939a('0x46')];_0x427bab++){var _0x17fe2e=_0x48d585[_0x427bab];if(_0x17fe2e&&_0x17fe2e[_0x939a('0x31')]&&_0x17fe2e[_0x939a('0x31')][_0x939a('0x47')]){_0x187538[_0x939a('0x48')](createMessage(_0x1d4a37,_0x5e5dbd,_0x521346,_0x17fe2e[_0x939a('0x31')]['fulfillmentText']));}}return Promise['all'](_0x187538)[_0x939a('0x10')](function(){if(_0x11ac7f){_0x5e22be['next']();}else{_0x5e22be[_0x939a('0x2a')]();}})[_0x939a('0x13')](function(_0x596f0f){logger[_0x939a('0x14')]('[%s][DIALOGFLOWV2]\x20%s',_0x1d4a37,JSON[_0x939a('0x27')](_0x596f0f));_0x5e22be[_0x939a('0x1a')]();});}})[_0x939a('0x13')](function(_0x5dbc3a){logger['error'](_0x939a('0x12'),_0x1d4a37,_0x5dbc3a[_0x939a('0x2e')]);_0x5e22be[_0x939a('0x1a')]();});}}catch(_0x14ba78){logger[_0x939a('0x14')](_0x939a('0x12'),_0x1d4a37,JSON[_0x939a('0x27')](_0x14ba78));_0x5e22be[_0x939a('0x2a')]();}};};
\ No newline at end of file
+var _0x47aa=['DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','length','all','message','lodash','dialogflow','md5','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','Message','create','then','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','phone','interaction','chat','ChatWebsiteId','upperFirst','account','InteractionId','isEmpty','getMustacheRender','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue'];(function(_0x41efee,_0x3b1307){var _0x5c9862=function(_0x59948d){while(--_0x59948d){_0x41efee['push'](_0x41efee['shift']());}};_0x5c9862(++_0x3b1307);}(_0x47aa,0x9e));var _0xa47a=function(_0x51d1dd,_0x1b8827){_0x51d1dd=_0x51d1dd-0x0;var _0x2e7eca=_0x47aa[_0x51d1dd];return _0x2e7eca;};'use strict';var _=require(_0xa47a('0x0'));var dialogflow=require(_0xa47a('0x1'));var md5=require(_0xa47a('0x2'));var moment=require('moment');var Promise=require(_0xa47a('0x3'));var logger=require('../../../../config/logger')(_0xa47a('0x4'));var utils=require(_0xa47a('0x5'));var rpc={'chatMessage':require(_0xa47a('0x6')),'openchannelMessage':require(_0xa47a('0x7')),'mailMessage':require(_0xa47a('0x8')),'smsMessage':require(_0xa47a('0x9')),'faxMessage':require(_0xa47a('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x1253b2,_0x556777,_0x4480c3,_0x339605){return new Promise(function(_0xc49372,_0x5f085c){var _0x299bce=_[_0xa47a('0xb')](_0x4480c3);_0x299bce[_0xa47a('0xc')]=_0x339605;return rpc[_0x556777+_0xa47a('0xd')][_0xa47a('0xe')](_0x299bce)[_0xa47a('0xf')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1253b2,_0x299bce[_0xa47a('0xc')]);_0xc49372();})[_0xa47a('0x10')](function(_0x5986cc){logger[_0xa47a('0x11')](_0xa47a('0x12'),_0x1253b2,JSON[_0xa47a('0x13')](_0x5986cc));_0x5f085c(_0x5986cc);});});}exports[_0xa47a('0x14')]=function(_0x2a600c,_0x799da){return function(_0x567b0a){try{if(!_[_0xa47a('0x15')](this['interaction']['UserId'])){logger[_0xa47a('0x16')](_0xa47a('0x12'),_0x2a600c,_0xa47a('0x17'));return _0x567b0a[_0xa47a('0x18')]();}var _0x3a2eb3={'ContactId':this[_0xa47a('0x19')]['id'],'sentAt':moment()[_0xa47a('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa47a('0x1b')};if(this[_0xa47a('0x1c')]===_0xa47a('0x1d')||this[_0xa47a('0x1c')]==='whatsapp'){_0x3a2eb3[_0xa47a('0x1e')]=this[_0xa47a('0x1f')][_0xa47a('0x1e')];}var _0x543564=this[_0xa47a('0x1c')];if(_0x543564===_0xa47a('0x20')){_0x3a2eb3[_0xa47a('0x21')]=this['account']['id'];}else{_0x3a2eb3[_[_0xa47a('0x22')](_0x543564)+'AccountId']=this[_0xa47a('0x23')]['id'];}_0x3a2eb3[_[_0xa47a('0x22')](_0x543564)+_0xa47a('0x24')]=this[_0xa47a('0x1f')]['id'];if(this['interaction']['created']){var _0x1d57a6=_0x799da[0x4];if(!_[_0xa47a('0x25')](_0x1d57a6)){_0x3a2eb3[_0xa47a('0xc')]=utils[_0xa47a('0x26')](_0x1d57a6,this);return rpc[_0x543564+'Message'][_0xa47a('0xe')](_0x3a2eb3)['then'](function(_0x4b0aab){logger[_0xa47a('0x16')]('[%s][DIALOGFLOWV2]\x20%s',_0x2a600c,_0x3a2eb3[_0xa47a('0xc')]);})[_0xa47a('0x10')](function(_0xde4229){logger[_0xa47a('0x11')](_0xa47a('0x12'),_0x2a600c,JSON[_0xa47a('0x13')](_0xde4229));})['finally'](function(){logger[_0xa47a('0x16')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2a600c);_0x567b0a[_0xa47a('0x27')]();});}else{logger[_0xa47a('0x16')](_0xa47a('0x28'),_0x2a600c);_0x567b0a[_0xa47a('0x27')]();}}else{var _0x47267f=this;var _0x6a6c6a=_0x799da[0x2][_0xa47a('0x29')](/\\n/g,'\x0a');var _0xabaeb3={'credentials':{'private_key':_0x6a6c6a,'client_email':_0x799da[0x1]}};var _0x154c74=new dialogflow['SessionsClient'](_0xabaeb3);var _0x2b8998=_0x154c74[_0xa47a('0x2a')](_0x799da[0x0],md5(_0x47267f[_0xa47a('0x1f')]['id']));var _0x389a7d={'session':_0x2b8998,'queryInput':{'text':{'text':_0x47267f['message'][_0xa47a('0xc')],'languageCode':_0x799da[0x3]||'en'}}};return _0x154c74[_0xa47a('0x2b')](_0x389a7d)['then'](function(_0x207c14){if(_0x207c14&&_0x207c14['length']){_0x47267f[_0xa47a('0xc')]['dialogflowV2']=_0x207c14;var _0x1d75aa=_0x207c14[0x0];var _0x370811=_0x1d75aa['queryResult']['diagnosticInfo']&&_0x1d75aa[_0xa47a('0x2c')][_0xa47a('0x2d')][_0xa47a('0x2e')]?_0x1d75aa['queryResult'][_0xa47a('0x2d')][_0xa47a('0x2e')][_0xa47a('0x2f')][_0xa47a('0x30')]:![];_0x47267f[_0xa47a('0xc')][_0xa47a('0x31')]=_0x1d75aa[_0xa47a('0x2c')][_0xa47a('0x32')];_0x47267f[_0xa47a('0xc')][_0xa47a('0x33')]=_0x1d75aa['queryResult'][_0xa47a('0x34')];_0x47267f[_0xa47a('0xc')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x1d75aa[_0xa47a('0x2c')]['diagnosticInfo']&&_0x1d75aa[_0xa47a('0x2c')][_0xa47a('0x2d')][_0xa47a('0x2e')]?_0x1d75aa[_0xa47a('0x2c')][_0xa47a('0x2d')][_0xa47a('0x2e')]['end_conversation'][_0xa47a('0x30')]:![];_0x47267f[_0xa47a('0xc')][_0xa47a('0x35')]=_0x1d75aa[_0xa47a('0x2c')][_0xa47a('0x36')][_0xa47a('0x37')];_0x47267f[_0xa47a('0xc')][_0xa47a('0x38')]=_0x1d75aa['queryResult'][_0xa47a('0x36')][_0xa47a('0x39')];_0x47267f[_0xa47a('0xc')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x1d75aa[_0xa47a('0x2c')][_0xa47a('0x36')][_0xa47a('0x3a')];_0x47267f['body'][_0xa47a('0x3b')]=_0x1d75aa[_0xa47a('0x2c')]['languageCode'];_0x47267f[_0xa47a('0xc')][_0xa47a('0x3c')]=_0x1d75aa[_0xa47a('0x2c')]['queryText'];_0x47267f[_0xa47a('0xc')][_0xa47a('0x3d')]=_0x1d75aa[_0xa47a('0x2c')][_0xa47a('0x3e')];_0x3a2eb3[_0xa47a('0x3f')]=_0xa47a('0x40');_0x3a2eb3[_0xa47a('0x41')]=JSON[_0xa47a('0x13')](_0x207c14);var _0x1ce89a=[];for(var _0x4c3baf=0x0;_0x4c3baf<_0x207c14[_0xa47a('0x42')];_0x4c3baf++){var _0x148a58=_0x207c14[_0x4c3baf];if(_0x148a58&&_0x148a58[_0xa47a('0x2c')]&&_0x148a58[_0xa47a('0x2c')]['fulfillmentText']){_0x1ce89a['push'](createMessage(_0x2a600c,_0x543564,_0x3a2eb3,_0x148a58[_0xa47a('0x2c')]['fulfillmentText']));}}return Promise[_0xa47a('0x43')](_0x1ce89a)[_0xa47a('0xf')](function(){if(_0x370811){_0x567b0a[_0xa47a('0x18')]();}else{_0x567b0a[_0xa47a('0x27')]();}})[_0xa47a('0x10')](function(_0x3fc421){logger[_0xa47a('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x2a600c,JSON[_0xa47a('0x13')](_0x3fc421));_0x567b0a[_0xa47a('0x18')]();});}})['catch'](function(_0x30851d){logger['error'](_0xa47a('0x12'),_0x2a600c,_0x30851d[_0xa47a('0x44')]);_0x567b0a['next']();});}}catch(_0x165555){logger[_0xa47a('0x11')](_0xa47a('0x12'),_0x2a600c,JSON[_0xa47a('0x13')](_0x165555));_0x567b0a[_0xa47a('0x27')]();}};};
\ No newline at end of file
index ecfc4e2..bd911d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75f5=['error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','length'];(function(_0x76f42,_0x3d1fb5){var _0x3f7f25=function(_0x4bf225){while(--_0x4bf225){_0x76f42['push'](_0x76f42['shift']());}};_0x3f7f25(++_0x3d1fb5);}(_0x75f5,0x1d1));var _0x575f=function(_0x680b65,_0x5b2e9c){_0x680b65=_0x680b65-0x0;var _0x1c2053=_0x75f5[_0x680b65];return _0x1c2053;};'use strict';var schema=require('validate');var _=require(_0x575f('0x0'));var htmlToText=require(_0x575f('0x1'));var utils=require('./utils');var logger=require(_0x575f('0x2'))(_0x575f('0x3'));var gotoif=schema({'condition':{'type':_0x575f('0x4'),'required':!![],'message':_0x575f('0x5')},'priorityTrue':{'type':_0x575f('0x6'),'message':_0x575f('0x7')},'priorityFalse':{'type':_0x575f('0x6'),'message':_0x575f('0x8')}});exports[_0x575f('0x9')]=function(_0x463d0d,_0x4dfb0d){return function(_0x15ec1c){try{var _0xe9ae48={'condition':htmlToText[_0x575f('0xa')](utils[_0x575f('0xb')](_0x4dfb0d[0x0],this),{'wordwrap':![]})[_0x575f('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4dfb0d[0x1],'priorityFalse':_0x4dfb0d[0x2]};var _0x57a075=gotoif[_0x575f('0xd')](_0xe9ae48,{'typecast':!![]});if(_0x57a075[_0x575f('0xe')]){logger[_0x575f('0xf')](_0x575f('0x10'),_0x463d0d,_[_0x575f('0x11')](_0x57a075,_0x575f('0x12'))['join'](',\x20'));_0x15ec1c[_0x575f('0x13')]();}else{try{var _0x4c77a6=eval('('+_0xe9ae48[_0x575f('0x14')]+')');var _0x17469a=_0x4c77a6?_0xe9ae48[_0x575f('0x15')]:_0xe9ae48[_0x575f('0x16')];logger[_0x575f('0x17')](_0x575f('0x18'),_0x463d0d,_0xe9ae48['condition'],_0x4c77a6,_0x17469a||_0x575f('0x19'));if(_0x17469a){var _0x13103b=_[_0x575f('0x1a')](_0x15ec1c[_0x575f('0x1b')](),{'p':_0x17469a});if(_0x13103b>=0x0){logger['info'](_0x575f('0x1c'),_0x463d0d,_0x17469a||_0x575f('0x19'),_0x13103b);_0x15ec1c[_0x575f('0x19')](_0x13103b);}else{logger[_0x575f('0x17')](_0x575f('0x1d'),_0x463d0d,_0x17469a||_0x575f('0x19'));_0x15ec1c[_0x575f('0x13')]();}}else{_0x15ec1c[_0x575f('0x19')]();}}catch(_0x396d7a){logger[_0x575f('0xf')](_0x575f('0x1e'),_0x463d0d,_0x396d7a['message']);_0x15ec1c[_0x575f('0x13')]();}}}catch(_0xe2d7b){logger['error'](_0x575f('0x10'),_0x463d0d,JSON[_0x575f('0x1f')](_0xe2d7b));_0x15ec1c[_0x575f('0x13')]();}};};
\ No newline at end of file
+var _0x144c=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules'];(function(_0x5b5732,_0x37d358){var _0x2ce779=function(_0x3e891e){while(--_0x3e891e){_0x5b5732['push'](_0x5b5732['shift']());}};_0x2ce779(++_0x37d358);}(_0x144c,0x1de));var _0xc144=function(_0x15de7b,_0x1f9e4e){_0x15de7b=_0x15de7b-0x0;var _0x1456c4=_0x144c[_0x15de7b];return _0x1456c4;};'use strict';var schema=require(_0xc144('0x0'));var _=require(_0xc144('0x1'));var htmlToText=require(_0xc144('0x2'));var utils=require(_0xc144('0x3'));var logger=require(_0xc144('0x4'))('routing');var gotoif=schema({'condition':{'type':_0xc144('0x5'),'required':!![],'message':_0xc144('0x6')},'priorityTrue':{'type':_0xc144('0x7'),'message':_0xc144('0x8')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xc144('0x9')]=function(_0x494d54,_0x4ab188){return function(_0x5d1e65){try{var _0x5e71db={'condition':htmlToText[_0xc144('0xa')](utils[_0xc144('0xb')](_0x4ab188[0x0],this),{'wordwrap':![]})[_0xc144('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4ab188[0x1],'priorityFalse':_0x4ab188[0x2]};var _0x5af2c1=gotoif['validate'](_0x5e71db,{'typecast':!![]});if(_0x5af2c1[_0xc144('0xd')]){logger[_0xc144('0xe')](_0xc144('0xf'),_0x494d54,_['map'](_0x5af2c1,_0xc144('0x10'))[_0xc144('0x11')](',\x20'));_0x5d1e65[_0xc144('0x12')]();}else{try{var _0xfeb5d5=eval('('+_0x5e71db[_0xc144('0x13')]+')');var _0x457769=_0xfeb5d5?_0x5e71db[_0xc144('0x14')]:_0x5e71db['priorityFalse'];logger[_0xc144('0x15')](_0xc144('0x16'),_0x494d54,_0x5e71db[_0xc144('0x13')],_0xfeb5d5,_0x457769||_0xc144('0x17'));if(_0x457769){var _0x31f531=_[_0xc144('0x18')](_0x5d1e65[_0xc144('0x19')](),{'p':_0x457769});if(_0x31f531>=0x0){logger['info'](_0xc144('0x1a'),_0x494d54,_0x457769||_0xc144('0x17'),_0x31f531);_0x5d1e65[_0xc144('0x17')](_0x31f531);}else{logger[_0xc144('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x494d54,_0x457769||_0xc144('0x17'));_0x5d1e65[_0xc144('0x12')]();}}else{_0x5d1e65[_0xc144('0x17')]();}}catch(_0x4f2a89){logger[_0xc144('0xe')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x494d54,_0x4f2a89[_0xc144('0x10')]);_0x5d1e65['stop']();}}}catch(_0x11c985){logger[_0xc144('0xe')]('[%s][GOTOIF]\x20%s',_0x494d54,JSON[_0xc144('0x1b')](_0x11c985));_0x5d1e65[_0xc144('0x12')]();}};};
\ No newline at end of file
index deddbb2..1539e48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x963d=['[%s][GOTOP]\x20%s','map','message','join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','lodash','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error'];(function(_0xefffb9,_0x259d50){var _0x248c70=function(_0x2102d3){while(--_0x2102d3){_0xefffb9['push'](_0xefffb9['shift']());}};_0x248c70(++_0x259d50);}(_0x963d,0x188));var _0xd963=function(_0x4b9dc4,_0x69d2c6){_0x4b9dc4=_0x4b9dc4-0x0;var _0x525961=_0x963d[_0x4b9dc4];return _0x525961;};'use strict';var schema=require('validate');var _=require(_0xd963('0x0'));var logger=require(_0xd963('0x1'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xd963('0x2')}});exports[_0xd963('0x3')]=function(_0x4677ef,_0x2e4a7f){return function(_0x20e4f7){try{var _0xc4b1f6={'priority':_0x2e4a7f[0x0]};var _0x5d5dd9=gotop[_0xd963('0x4')](_0xc4b1f6,{'typecast':!![]});if(_0x5d5dd9[_0xd963('0x5')]){logger[_0xd963('0x6')](_0xd963('0x7'),_0x4677ef,_[_0xd963('0x8')](_0x5d5dd9,_0xd963('0x9'))[_0xd963('0xa')](',\x20'));_0x20e4f7[_0xd963('0xb')]();}else{logger[_0xd963('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x4677ef,_0xc4b1f6[_0xd963('0xd')]);if(_0xc4b1f6[_0xd963('0xd')]){var _0x3b440f=_[_0xd963('0xe')](_0x20e4f7[_0xd963('0xf')](),{'p':_0xc4b1f6[_0xd963('0xd')]});if(_0x3b440f>=0x0){logger['info'](_0xd963('0x10'),_0x4677ef,_0xc4b1f6[_0xd963('0xd')]||_0xd963('0x11'),_0x3b440f);_0x20e4f7[_0xd963('0x11')](_0x3b440f);}else{logger[_0xd963('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x4677ef,_0xc4b1f6[_0xd963('0xd')]||_0xd963('0x11'));_0x20e4f7[_0xd963('0xb')]();}}else{_0x20e4f7[_0xd963('0x11')]();}}}catch(_0x3a5ebe){logger[_0xd963('0x6')]('[%s][GOTOP]\x20%s',_0x4677ef,JSON[_0xd963('0x12')](_0x3a5ebe));_0x20e4f7[_0xd963('0xb')]();}};};
\ No newline at end of file
+var _0x0d94=['routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','priority','findIndex','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger'];(function(_0x2244e0,_0x47b532){var _0x1d39b9=function(_0x74e549){while(--_0x74e549){_0x2244e0['push'](_0x2244e0['shift']());}};_0x1d39b9(++_0x47b532);}(_0x0d94,0x10c));var _0x40d9=function(_0x55b22f,_0x22bd34){_0x55b22f=_0x55b22f-0x0;var _0x594fb5=_0x0d94[_0x55b22f];return _0x594fb5;};'use strict';var schema=require('validate');var _=require(_0x40d9('0x0'));var logger=require(_0x40d9('0x1'))(_0x40d9('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x40d9('0x3')}});exports['consequence']=function(_0x5c92d6,_0x401f73){return function(_0x36a964){try{var _0x8fad96={'priority':_0x401f73[0x0]};var _0x4e3302=gotop['validate'](_0x8fad96,{'typecast':!![]});if(_0x4e3302[_0x40d9('0x4')]){logger[_0x40d9('0x5')](_0x40d9('0x6'),_0x5c92d6,_[_0x40d9('0x7')](_0x4e3302,_0x40d9('0x8'))[_0x40d9('0x9')](',\x20'));_0x36a964[_0x40d9('0xa')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x5c92d6,_0x8fad96[_0x40d9('0xb')]);if(_0x8fad96['priority']){var _0x1c8fcc=_[_0x40d9('0xc')](_0x36a964[_0x40d9('0xd')](),{'p':_0x8fad96[_0x40d9('0xb')]});if(_0x1c8fcc>=0x0){logger[_0x40d9('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5c92d6,_0x8fad96[_0x40d9('0xb')]||_0x40d9('0xf'),_0x1c8fcc);_0x36a964[_0x40d9('0xf')](_0x1c8fcc);}else{logger[_0x40d9('0xe')](_0x40d9('0x10'),_0x5c92d6,_0x8fad96['priority']||_0x40d9('0xf'));_0x36a964[_0x40d9('0xa')]();}}else{_0x36a964[_0x40d9('0xf')]();}}}catch(_0x483b7a){logger[_0x40d9('0x5')](_0x40d9('0x6'),_0x5c92d6,JSON[_0x40d9('0x11')](_0x483b7a));_0x36a964[_0x40d9('0xa')]();}};};
\ No newline at end of file
index b5bf3b1..a685688 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7152=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','chat','ChatWebsiteId','account','upperFirst','channel','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stop','stringify','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x1e712c,_0x5aee9c){var _0x77ea8d=function(_0x233552){while(--_0x233552){_0x1e712c['push'](_0x1e712c['shift']());}};_0x77ea8d(++_0x5aee9c);}(_0x7152,0x114));var _0x2715=function(_0x2cdf41,_0x4a277c){_0x2cdf41=_0x2cdf41-0x0;var _0x39a70e=_0x7152[_0x2cdf41];return _0x39a70e;};'use strict';var _=require('lodash');var utils=require(_0x2715('0x0'));var logger=require(_0x2715('0x1'))('routing');var rpc={'chatMessage':require(_0x2715('0x2')),'openchannelMessage':require(_0x2715('0x3')),'mailMessage':require(_0x2715('0x4')),'smsMessage':require(_0x2715('0x5')),'faxMessage':require(_0x2715('0x6')),'whatsappMessage':require(_0x2715('0x7'))};exports['consequence']=function(_0x44cb60,_0x2c8435){return function(_0x397e3e){try{var _0x46807b={'body':utils[_0x2715('0x8')](_0x2c8435[0x0],this),'ContactId':this[_0x2715('0x9')]['id']};if(this['channel']===_0x2715('0xa')){_0x46807b[_0x2715('0xb')]=this[_0x2715('0xc')]['id'];}else{_0x46807b[_[_0x2715('0xd')](this[_0x2715('0xe')])+_0x2715('0xf')]=this['account']['id'];}_0x46807b[_[_0x2715('0xd')](this['channel'])+_0x2715('0x10')]=this[_0x2715('0x11')]['id'];if(rpc[this[_0x2715('0xe')]+_0x2715('0x12')]){return rpc[this['channel']+_0x2715('0x12')][_0x2715('0x13')](_0x46807b)[_0x2715('0x14')](function(_0x39edb4){logger[_0x2715('0x15')](_0x2715('0x16'),_0x44cb60,_0x46807b[_0x2715('0x17')]);_0x397e3e[_0x2715('0x18')]();})['catch'](function(_0x2bce13){logger[_0x2715('0x19')](_0x2715('0x16'),_0x44cb60,JSON['stringify'](_0x2bce13));_0x397e3e[_0x2715('0x1a')]();});}}catch(_0x56f374){logger[_0x2715('0x19')]('[%s][MESSAGE]\x20%s',_0x44cb60,JSON[_0x2715('0x1b')](_0x56f374));_0x397e3e[_0x2715('0x1a')]();}};};
\ No newline at end of file
+var _0x62a5=['stop','lodash','./utils','../../../../config/logger','routing','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','chat','ChatWebsiteId','channel','AccountId','upperFirst','InteractionId','interaction','Message','[%s][MESSAGE]\x20%s','body','next','catch','error'];(function(_0x1cb71e,_0x285a98){var _0x36e252=function(_0x5b9b2f){while(--_0x5b9b2f){_0x1cb71e['push'](_0x1cb71e['shift']());}};_0x36e252(++_0x285a98);}(_0x62a5,0x14b));var _0x562a=function(_0x74e44d,_0x1d311e){_0x74e44d=_0x74e44d-0x0;var _0x3afe1e=_0x62a5[_0x74e44d];return _0x3afe1e;};'use strict';var _=require(_0x562a('0x0'));var utils=require(_0x562a('0x1'));var logger=require(_0x562a('0x2'))(_0x562a('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x562a('0x4')),'faxMessage':require(_0x562a('0x5')),'whatsappMessage':require(_0x562a('0x6'))};exports['consequence']=function(_0x4be437,_0x48420b){return function(_0x21c955){try{var _0x3d4aaf={'body':utils[_0x562a('0x7')](_0x48420b[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x562a('0x8')){_0x3d4aaf[_0x562a('0x9')]=this['account']['id'];}else{_0x3d4aaf[_['upperFirst'](this[_0x562a('0xa')])+_0x562a('0xb')]=this['account']['id'];}_0x3d4aaf[_[_0x562a('0xc')](this[_0x562a('0xa')])+_0x562a('0xd')]=this[_0x562a('0xe')]['id'];if(rpc[this[_0x562a('0xa')]+'Message']){return rpc[this[_0x562a('0xa')]+_0x562a('0xf')]['create'](_0x3d4aaf)['then'](function(_0x5f423d){logger['info'](_0x562a('0x10'),_0x4be437,_0x3d4aaf[_0x562a('0x11')]);_0x21c955[_0x562a('0x12')]();})[_0x562a('0x13')](function(_0x5a4d4a){logger[_0x562a('0x14')](_0x562a('0x10'),_0x4be437,JSON['stringify'](_0x5a4d4a));_0x21c955[_0x562a('0x15')]();});}}catch(_0x355680){logger[_0x562a('0x14')](_0x562a('0x10'),_0x4be437,JSON['stringify'](_0x355680));_0x21c955[_0x562a('0x15')]();}};};
\ No newline at end of file
index 3a359df..0feda5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb692=['error','stringify','stop','./utils','../../../../config/logger','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x5a25b6,_0x27f5d5){var _0x2414b0=function(_0x3dd5c7){while(--_0x3dd5c7){_0x5a25b6['push'](_0x5a25b6['shift']());}};_0x2414b0(++_0x27f5d5);}(_0xb692,0x159));var _0x2b69=function(_0x24f326,_0x616a7){_0x24f326=_0x24f326-0x0;var _0x488e2d=_0xb692[_0x24f326];return _0x488e2d;};'use strict';var utils=require(_0x2b69('0x0'));var logger=require(_0x2b69('0x1'))('routing');exports['consequence']=function(_0xdf731f,_0x34bc1){return function(_0x358381){try{logger[_0x2b69('0x2')](_0x2b69('0x3'),_0xdf731f,utils[_0x2b69('0x4')](_0x34bc1[0x0],this));_0x358381[_0x2b69('0x5')]();}catch(_0x3d2f5e){logger[_0x2b69('0x6')]('[%s][NOOP]\x20%s',_0xdf731f,JSON[_0x2b69('0x7')](_0x3d2f5e));_0x358381[_0x2b69('0x8')]();}};};
\ No newline at end of file
+var _0xd89e=['info','[%s][NOOP]\x20%s','stringify','stop','../../../../config/logger','routing'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0xd89e,0x124));var _0xed89=function(_0x497134,_0x45d81c){_0x497134=_0x497134-0x0;var _0x1a1200=_0xd89e[_0x497134];return _0x1a1200;};'use strict';var utils=require('./utils');var logger=require(_0xed89('0x0'))(_0xed89('0x1'));exports['consequence']=function(_0x33969c,_0x32a772){return function(_0x2d2662){try{logger[_0xed89('0x2')](_0xed89('0x3'),_0x33969c,utils['getMustacheRender'](_0x32a772[0x0],this));_0x2d2662['next']();}catch(_0x27c8cb){logger['error'](_0xed89('0x3'),_0x33969c,JSON[_0xed89('0x4')](_0x27c8cb));_0x2d2662[_0xed89('0x5')]();}};};
\ No newline at end of file
index 58a5c70..2db5ee0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49d6=['pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','timeout','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','account','format','%sQueuesWaitingInteractions'];(function(_0x364e2b,_0x30b028){var _0x943fef=function(_0x3454a5){while(--_0x3454a5){_0x364e2b['push'](_0x364e2b['shift']());}};_0x943fef(++_0x30b028);}(_0x49d6,0x120));var _0x649d=function(_0x442e1f,_0xa64de4){_0x442e1f=_0x442e1f-0x0;var _0x5b9176=_0x49d6[_0x442e1f];return _0x5b9176;};'use strict';var schema=require(_0x649d('0x0'));var _=require(_0x649d('0x1'));var util=require('util');var seqqueue=require(_0x649d('0x2'));var moment=require('moment');var Redis=require(_0x649d('0x3'));var config=require(_0x649d('0x4'));var logger=require(_0x649d('0x5'))(_0x649d('0x6'));var strategy=require('./strategy');config[_0x649d('0x7')]=_[_0x649d('0x8')](config[_0x649d('0x7')],{'host':_0x649d('0x9'),'port':0x18eb});var io=require(_0x649d('0xa'))(new Redis(config['redis']));var attributes=['id',_0x649d('0xb'),'account',_0x649d('0xc'),_0x649d('0xd'),_0x649d('0xe')];function emit(_0x5b5ace,_0x5f4148,_0x54cd0d){io['to'](_0x5b5ace)[_0x649d('0xf')](_0x5f4148,_0x54cd0d);}function emitChannelQueueInteraction(_0x13f8f5,_0x278e89,_0x344899,_0x39c203,_0x2a4302,_0x478312,_0x39cea4,_0x48fae3){var _0x194ebf=_[_0x649d('0x10')](_0x344899);_0x194ebf[_0x649d('0xb')]=_0x48fae3;_0x194ebf[_0x649d('0xc')]=_0x278e89;_0x194ebf[_0x649d('0x11')]=_0x39c203;_0x194ebf['id']=_0x2a4302;if(_0x478312){_0x39cea4[util[_0x649d('0x12')](_0x649d('0x13'),_0x13f8f5)][_0x2a4302]=_[_0x649d('0x14')](_0x194ebf,attributes);}else{delete _0x39cea4[util[_0x649d('0x12')](_0x649d('0x13'),_0x13f8f5)][_0x2a4302];}emit(util[_0x649d('0x12')](_0x649d('0x15'),_0x13f8f5,_0x278e89),util[_0x649d('0x12')](_0x649d('0x16'),_0x13f8f5,_0x478312?_0x649d('0x17'):_0x649d('0x18')),_['pick'](_0x194ebf,attributes));}var rpc={'openchannelQueueReport':require(_0x649d('0x19')),'mailQueueReport':require(_0x649d('0x1a')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x649d('0x1b')),'whatsappQueueReport':require(_0x649d('0x1c'))};var queue=schema({'name':{'type':_0x649d('0x1d'),'required':!![],'message':_0x649d('0x1e')},'timeout':{'type':'number','message':_0x649d('0x1f')}});function startRouting(_0x2ff0e3,_0x45d3d3,_0x55afd4,_0x1d9ce9){if(_0x2ff0e3&&_0x45d3d3&&_0x55afd4){_0x45d3d3['waiting']+=0x1;var _0x17e531={'uniqueid':_0x2ff0e3,'from':_0x55afd4['body']?_0x55afd4[_0x649d('0x20')][_0x649d('0xd')]:'','joinAt':moment()[_0x649d('0x12')](_0x649d('0x21')),'ContactId':_0x55afd4[_0x649d('0x22')]?_0x55afd4[_0x649d('0x22')]['id']:null,'ListId':_0x55afd4[_0x649d('0x23')]?_0x55afd4[_0x649d('0x23')]['id']:null};_0x17e531[_[_0x649d('0x24')](_0x55afd4[_0x649d('0x25')])+'QueueId']=_0x45d3d3['id']||null;_0x17e531[_[_0x649d('0x24')](_0x55afd4[_0x649d('0x25')])+_0x649d('0x26')]=_0x55afd4[_0x649d('0x27')]?_0x55afd4[_0x649d('0x27')]['id']:null;_0x17e531[_[_0x649d('0x24')](_0x55afd4[_0x649d('0x25')])+_0x649d('0x28')]=_0x55afd4[_0x649d('0x29')]?_0x55afd4[_0x649d('0x29')]['id']:null;_0x17e531[_[_0x649d('0x24')](_0x55afd4[_0x649d('0x25')])+(_0x55afd4[_0x649d('0x25')]!=='chat'?'AccountId':_0x649d('0x2a'))]=_0x55afd4[_0x649d('0x11')]?_0x55afd4[_0x649d('0x11')]['id']:null;logger[_0x649d('0x2b')](util['format'](_0x649d('0x2c'),_0x2ff0e3,_0x45d3d3[_0x649d('0x2d')]));emitChannelQueueInteraction(_0x55afd4['channel'],_0x45d3d3[_0x649d('0x2d')],_0x17e531,_0x55afd4['account'][_0x649d('0x2d')],_0x55afd4[_0x649d('0x29')]['id'],!![],_0x1d9ce9,_0x45d3d3['id']);if(rpc[_0x55afd4[_0x649d('0x25')]+_0x649d('0x2e')]){return rpc[_0x55afd4['channel']+_0x649d('0x2e')]['create'](_0x17e531)[_0x649d('0x2f')](function(_0x52cf66){logger[_0x649d('0x30')](_0x649d('0x31'));});}}}function stopRouting(_0xf60352,_0x150486,_0x6499a3,_0x5dd0f9){if(_0xf60352&&_0x150486){_0x150486[_0x649d('0x32')]-=0x1;var _0x4bd430={'leaveAt':moment()[_0x649d('0x12')](_0x649d('0x21')),'acceptAt':moment()[_0x649d('0x12')](_0x649d('0x21')),'reason':_0x649d('0x33')};logger[_0x649d('0x2b')](util['format'](_0x649d('0x34'),_0xf60352,_0x150486[_0x649d('0x2d')]));emitChannelQueueInteraction(_0x6499a3[_0x649d('0x25')],_0x150486[_0x649d('0x2d')],_0x6499a3['body'],_0x6499a3[_0x649d('0x11')][_0x649d('0x2d')],_0x6499a3[_0x649d('0x29')]['id'],![],_0x5dd0f9,_0x150486['id']);if(rpc[_0x6499a3[_0x649d('0x25')]+'QueueReport']){return rpc[_0x6499a3['channel']+_0x649d('0x2e')][_0x649d('0x35')](_0xf60352,_0x4bd430)[_0x649d('0x2f')](function(_0x1a1ccf){logger[_0x649d('0x30')](_0x649d('0x36'));});}}}function endRouting(_0x2dbaef,_0x3f3180,_0x227cf6,_0x102dea){if(_0x2dbaef&&_0x3f3180){_0x3f3180[_0x649d('0x32')]-=0x1;var _0x37d682={'leaveAt':moment()[_0x649d('0x12')](_0x649d('0x21')),'exitAt':moment()[_0x649d('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x649d('0x2b')](util[_0x649d('0x12')](_0x649d('0x37'),_0x2dbaef,_0x3f3180[_0x649d('0x2d')]));emitChannelQueueInteraction(_0x227cf6['channel'],_0x3f3180[_0x649d('0x2d')],_0x227cf6['body'],_0x227cf6[_0x649d('0x11')][_0x649d('0x2d')],_0x227cf6[_0x649d('0x29')]['id'],![],_0x102dea);if(rpc[_0x227cf6[_0x649d('0x25')]+'QueueReport']){return rpc[_0x227cf6[_0x649d('0x25')]+_0x649d('0x2e')][_0x649d('0x35')](_0x2dbaef,_0x37d682)[_0x649d('0x2f')](function(_0x15c8bd){logger[_0x649d('0x30')](_0x649d('0x36'));});}}}function handleFindQueue(_0x5409de){return function(_0x3499fb){return _0x3499fb[_0x649d('0x2d')][_0x649d('0x38')]()===_0x5409de['toLowerCase']();};}exports[_0x649d('0x39')]=function(_0x413358,_0x3b4602,_0x5817de,_0x2e431b){return function(_0x5d151d){try{var _0x235002={'name':_0x3b4602[0x0],'timeout':_0x3b4602[0x1]};var _0x56ad03=queue[_0x649d('0x0')](_0x235002,{'typecast':!![]});if(_0x56ad03[_0x649d('0x3a')]){logger[_0x649d('0x30')](_0x649d('0x3b'),_0x413358,_['map'](_0x56ad03,_0x649d('0x29'))[_0x649d('0x3c')](',\x20'));_0x5d151d[_0x649d('0x3d')]();}else{var _0x19f5d8=_[_0x649d('0x3e')](_0x5817de[_0x2e431b['channel']+'Queues'],handleFindQueue(_0x235002[_0x649d('0x2d')]));if(_0x19f5d8){startRouting(_0x413358,_0x19f5d8,_0x2e431b,_0x5817de);var _0x3597d3=(_0x19f5d8[_0x649d('0x3f')]||0xa)*0x3e8;var _0x4a085b=(_0x235002[_0x649d('0x3f')]||0x14)*0x3e8;var _0x357ebb,_0x265829;if(_0x3597d3>_0x4a085b){_0x4a085b=_0x3597d3;}var _0x1f23e5=seqqueue[_0x649d('0x40')](_0x3597d3);_0x1f23e5['id']=_0x413358;_0x1f23e5[_0x649d('0x41')]=_0x3597d3;_0x1f23e5[_0x649d('0x42')]=_0x4a085b;_0x1f23e5['channel']=_0x2e431b['channel'];_0x5817de[_0x649d('0x43')][_0x413358]['on']('end',function(){logger['info'](_0x649d('0x44'),_0x413358);stopRouting(_0x413358,_0x19f5d8,_0x2e431b,_0x5817de);clearTimeout(_0x357ebb);_0x357ebb=undefined;_0x1f23e5[_0x649d('0x45')](!![]);if(_0x5817de['rules'][_0x413358]){delete _0x5817de[_0x649d('0x43')][_0x413358];}_0x5d151d[_0x649d('0x3d')]();});_0x5817de[_0x649d('0x43')][_0x413358]['on']('complete',function(){if(_0x5817de[_0x649d('0x43')][_0x413358]){delete _0x5817de[_0x649d('0x43')][_0x413358];}});_0x357ebb=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x413358);endRouting(_0x413358,_0x19f5d8,_0x2e431b,_0x5817de);clearTimeout(_0x357ebb);_0x1f23e5[_0x649d('0x45')](!![]);_0x5d151d[_0x649d('0x46')]();},_0x4a085b);switch(_0x19f5d8[_0x649d('0x47')]){case _0x649d('0x48'):strategy[_0x649d('0x48')](_0x1f23e5,_0x19f5d8,_0x5817de,_0x2e431b);break;default:strategy[_0x649d('0x49')](_0x1f23e5,_0x19f5d8,_0x5817de,_0x2e431b);}}else{logger[_0x649d('0x30')](_0x649d('0x4a'),_0x413358,_0x235002[_0x649d('0x2d')]);_0x5d151d[_0x649d('0x3d')]();}}}catch(_0x508efd){console[_0x649d('0x4b')](_0x508efd);logger[_0x649d('0x30')](_0x649d('0x3b'),_0x413358,_0x508efd[_0x649d('0x4c')]);_0x5d151d[_0x649d('0x3d')]();}};};
\ No newline at end of file
+var _0x4ab4=['pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','message','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','validate','[%s][QUEUE]\x20%s','map','Queues','createQueue','atimeout','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','log','stack','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','account','queue','from','queue_id','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ab4,0x1f2));var _0x44ab=function(_0x46f899,_0x26ef5a){_0x46f899=_0x46f899-0x0;var _0x3ac01b=_0x4ab4[_0x46f899];return _0x3ac01b;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x44ab('0x0'));var seqqueue=require(_0x44ab('0x1'));var moment=require(_0x44ab('0x2'));var Redis=require(_0x44ab('0x3'));var config=require(_0x44ab('0x4'));var logger=require('../../../../config/logger')(_0x44ab('0x5'));var strategy=require(_0x44ab('0x6'));config[_0x44ab('0x7')]=_[_0x44ab('0x8')](config[_0x44ab('0x7')],{'host':_0x44ab('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id','queue_id',_0x44ab('0xa'),_0x44ab('0xb'),_0x44ab('0xc'),'joinAt'];function emit(_0x2906ec,_0x35335b,_0x566820){io['to'](_0x2906ec)['emit'](_0x35335b,_0x566820);}function emitChannelQueueInteraction(_0x49319b,_0x177253,_0x18df25,_0x3c0960,_0x210690,_0x33637d,_0x279e74,_0x4f67f2){var _0x1fc5dc=_['clone'](_0x18df25);_0x1fc5dc[_0x44ab('0xd')]=_0x4f67f2;_0x1fc5dc[_0x44ab('0xb')]=_0x177253;_0x1fc5dc[_0x44ab('0xa')]=_0x3c0960;_0x1fc5dc['id']=_0x210690;if(_0x33637d){_0x279e74[util[_0x44ab('0xe')](_0x44ab('0xf'),_0x49319b)][_0x210690]=_['pick'](_0x1fc5dc,attributes);}else{delete _0x279e74[util['format'](_0x44ab('0xf'),_0x49319b)][_0x210690];}emit(util[_0x44ab('0xe')](_0x44ab('0x10'),_0x49319b,_0x177253),util[_0x44ab('0xe')](_0x44ab('0x11'),_0x49319b,_0x33637d?_0x44ab('0x12'):_0x44ab('0x13')),_[_0x44ab('0x14')](_0x1fc5dc,attributes));}var rpc={'openchannelQueueReport':require(_0x44ab('0x15')),'mailQueueReport':require(_0x44ab('0x16')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x44ab('0x17')),'faxQueueReport':require(_0x44ab('0x18')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x44ab('0x19'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x44ab('0x1a'),'message':_0x44ab('0x1b')}});function startRouting(_0x35b33f,_0x1f2af0,_0xd9c70,_0x4e794c){if(_0x35b33f&&_0x1f2af0&&_0xd9c70){_0x1f2af0[_0x44ab('0x1c')]+=0x1;var _0x303dc3={'uniqueid':_0x35b33f,'from':_0xd9c70[_0x44ab('0x1d')]?_0xd9c70[_0x44ab('0x1d')][_0x44ab('0xc')]:'','joinAt':moment()[_0x44ab('0xe')](_0x44ab('0x1e')),'ContactId':_0xd9c70[_0x44ab('0x1f')]?_0xd9c70[_0x44ab('0x1f')]['id']:null,'ListId':_0xd9c70[_0x44ab('0x20')]?_0xd9c70['list']['id']:null};_0x303dc3[_[_0x44ab('0x21')](_0xd9c70[_0x44ab('0x22')])+'QueueId']=_0x1f2af0['id']||null;_0x303dc3[_[_0x44ab('0x21')](_0xd9c70[_0x44ab('0x22')])+'InteractionId']=_0xd9c70[_0x44ab('0x23')]?_0xd9c70[_0x44ab('0x23')]['id']:null;_0x303dc3[_['upperFirst'](_0xd9c70[_0x44ab('0x22')])+_0x44ab('0x24')]=_0xd9c70['message']?_0xd9c70['message']['id']:null;_0x303dc3[_[_0x44ab('0x21')](_0xd9c70[_0x44ab('0x22')])+(_0xd9c70[_0x44ab('0x22')]!==_0x44ab('0x25')?_0x44ab('0x26'):_0x44ab('0x27'))]=_0xd9c70['account']?_0xd9c70['account']['id']:null;logger[_0x44ab('0x28')](util[_0x44ab('0xe')](_0x44ab('0x29'),_0x35b33f,_0x1f2af0[_0x44ab('0x2a')]));emitChannelQueueInteraction(_0xd9c70[_0x44ab('0x22')],_0x1f2af0[_0x44ab('0x2a')],_0x303dc3,_0xd9c70[_0x44ab('0xa')][_0x44ab('0x2a')],_0xd9c70['message']['id'],!![],_0x4e794c,_0x1f2af0['id']);if(rpc[_0xd9c70[_0x44ab('0x22')]+'QueueReport']){return rpc[_0xd9c70[_0x44ab('0x22')]+_0x44ab('0x2b')][_0x44ab('0x2c')](_0x303dc3)['catch'](function(_0x4d2044){logger[_0x44ab('0x2d')](_0x44ab('0x2e'));});}}}function stopRouting(_0x4c6505,_0x99cda9,_0x2cd9fd,_0x140753){if(_0x4c6505&&_0x99cda9){_0x99cda9['waiting']-=0x1;var _0x5cf3fb={'leaveAt':moment()[_0x44ab('0xe')](_0x44ab('0x1e')),'acceptAt':moment()[_0x44ab('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x44ab('0x2f')};logger[_0x44ab('0x28')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x4c6505,_0x99cda9[_0x44ab('0x2a')]));emitChannelQueueInteraction(_0x2cd9fd['channel'],_0x99cda9[_0x44ab('0x2a')],_0x2cd9fd[_0x44ab('0x1d')],_0x2cd9fd[_0x44ab('0xa')][_0x44ab('0x2a')],_0x2cd9fd[_0x44ab('0x30')]['id'],![],_0x140753,_0x99cda9['id']);if(rpc[_0x2cd9fd['channel']+_0x44ab('0x2b')]){return rpc[_0x2cd9fd[_0x44ab('0x22')]+_0x44ab('0x2b')]['update'](_0x4c6505,_0x5cf3fb)[_0x44ab('0x31')](function(_0x11383c){logger['error'](_0x44ab('0x32'));});}}}function endRouting(_0x1e8a8d,_0x15c26d,_0x4edaa8,_0x46894a){if(_0x1e8a8d&&_0x15c26d){_0x15c26d['waiting']-=0x1;var _0x1e0b8b={'leaveAt':moment()['format'](_0x44ab('0x1e')),'exitAt':moment()[_0x44ab('0xe')](_0x44ab('0x1e')),'reason':_0x44ab('0x33')};logger['info'](util['format'](_0x44ab('0x34'),_0x1e8a8d,_0x15c26d[_0x44ab('0x2a')]));emitChannelQueueInteraction(_0x4edaa8[_0x44ab('0x22')],_0x15c26d[_0x44ab('0x2a')],_0x4edaa8[_0x44ab('0x1d')],_0x4edaa8[_0x44ab('0xa')][_0x44ab('0x2a')],_0x4edaa8[_0x44ab('0x30')]['id'],![],_0x46894a);if(rpc[_0x4edaa8[_0x44ab('0x22')]+'QueueReport']){return rpc[_0x4edaa8[_0x44ab('0x22')]+_0x44ab('0x2b')][_0x44ab('0x35')](_0x1e8a8d,_0x1e0b8b)[_0x44ab('0x31')](function(_0x4bd73e){logger[_0x44ab('0x2d')](_0x44ab('0x32'));});}}}function handleFindQueue(_0x2b0c9c){return function(_0x38066f){return _0x38066f['name'][_0x44ab('0x36')]()===_0x2b0c9c[_0x44ab('0x36')]();};}exports['consequence']=function(_0x393870,_0x102a7c,_0x340a38,_0x4fcf6b){return function(_0x322f4c){try{var _0x40110b={'name':_0x102a7c[0x0],'timeout':_0x102a7c[0x1]};var _0x4281a7=queue[_0x44ab('0x37')](_0x40110b,{'typecast':!![]});if(_0x4281a7['length']){logger[_0x44ab('0x2d')](_0x44ab('0x38'),_0x393870,_[_0x44ab('0x39')](_0x4281a7,_0x44ab('0x30'))['join'](',\x20'));_0x322f4c['stop']();}else{var _0x43d72b=_['find'](_0x340a38[_0x4fcf6b[_0x44ab('0x22')]+_0x44ab('0x3a')],handleFindQueue(_0x40110b[_0x44ab('0x2a')]));if(_0x43d72b){startRouting(_0x393870,_0x43d72b,_0x4fcf6b,_0x340a38);var _0x8daf72=(_0x43d72b['timeout']||0xa)*0x3e8;var _0x48fdcf=(_0x40110b[_0x44ab('0x33')]||0x14)*0x3e8;var _0x6f98c7,_0x43d820;if(_0x8daf72>_0x48fdcf){_0x48fdcf=_0x8daf72;}var _0x421382=seqqueue[_0x44ab('0x3b')](_0x8daf72);_0x421382['id']=_0x393870;_0x421382[_0x44ab('0x3c')]=_0x8daf72;_0x421382[_0x44ab('0x3d')]=_0x48fdcf;_0x421382['channel']=_0x4fcf6b[_0x44ab('0x22')];_0x340a38['rules'][_0x393870]['on']('end',function(){logger[_0x44ab('0x28')](_0x44ab('0x3e'),_0x393870);stopRouting(_0x393870,_0x43d72b,_0x4fcf6b,_0x340a38);clearTimeout(_0x6f98c7);_0x6f98c7=undefined;_0x421382['close'](!![]);if(_0x340a38[_0x44ab('0x3f')][_0x393870]){delete _0x340a38[_0x44ab('0x3f')][_0x393870];}_0x322f4c[_0x44ab('0x40')]();});_0x340a38['rules'][_0x393870]['on'](_0x44ab('0x41'),function(){if(_0x340a38[_0x44ab('0x3f')][_0x393870]){delete _0x340a38[_0x44ab('0x3f')][_0x393870];}});_0x6f98c7=setTimeout(function(){logger[_0x44ab('0x28')](_0x44ab('0x42'),_0x393870);endRouting(_0x393870,_0x43d72b,_0x4fcf6b,_0x340a38);clearTimeout(_0x6f98c7);_0x421382[_0x44ab('0x43')](!![]);_0x322f4c[_0x44ab('0x44')]();},_0x48fdcf);switch(_0x43d72b[_0x44ab('0x45')]){case _0x44ab('0x46'):strategy[_0x44ab('0x46')](_0x421382,_0x43d72b,_0x340a38,_0x4fcf6b);break;default:strategy[_0x44ab('0x47')](_0x421382,_0x43d72b,_0x340a38,_0x4fcf6b);}}else{logger[_0x44ab('0x2d')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x393870,_0x40110b[_0x44ab('0x2a')]);_0x322f4c['stop']();}}}catch(_0x4a9fa8){console[_0x44ab('0x48')](_0x4a9fa8);logger[_0x44ab('0x2d')]('[%s][QUEUE]\x20%s',_0x393870,_0x4a9fa8[_0x44ab('0x49')]);_0x322f4c[_0x44ab('0x40')]();}};};
\ No newline at end of file
index c37d84d..3870738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8358=['[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','busyQueue','STOP','TIMEOUT','uuid','./util','notificationId','squeue','agent','realtime','routing','push','handleRun','timeout','handleTimeout','prototype','bind','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','isAgentAvailable','busy','showNotification','writeLog','RINGING'];(function(_0x1f9d09,_0x1d27e7){var _0x5745a9=function(_0x26fbe3){while(--_0x26fbe3){_0x1f9d09['push'](_0x1f9d09['shift']());}};_0x5745a9(++_0x1d27e7);}(_0x8358,0x154));var _0x8835=function(_0x5b8563,_0x303a8b){_0x5b8563=_0x5b8563-0x0;var _0x285675=_0x8358[_0x5b8563];return _0x285675;};'use strict';var _=require('lodash');var uuid=require(_0x8835('0x0'));var util=require(_0x8835('0x1'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x52d788,_0xa4b22e,_0x5723a5,_0x320381){this[_0x8835('0x2')]=uuid['v4']();this[_0x8835('0x3')]=_0x52d788;this[_0x8835('0x4')]=_0xa4b22e;this[_0x8835('0x5')]=_0x5723a5;this[_0x8835('0x6')]=_0x320381;this[_0x8835('0x3')][_0x8835('0x7')](this[_0x8835('0x8')]['bind'](this),this['handleTimeout']['bind'](this));this[_0x8835('0x3')]['on'](_0x8835('0x9'),this[_0x8835('0xa')]['bind'](this));this['squeue']['on']('drained',this['handleDrained']['bind'](this));};Agent[_0x8835('0xb')][_0x8835('0x7')]=function(){this[_0x8835('0x3')][_0x8835('0x7')](this[_0x8835('0x8')][_0x8835('0xc')](this),this['handleTimeout'][_0x8835('0xc')](this));};Agent[_0x8835('0xb')][_0x8835('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0x8835('0xb')][_0x8835('0x8')]=function(_0x34b4a2){logger[_0x8835('0xe')](_0x8835('0xf'),this['squeue']['id'],this[_0x8835('0x4')]['id']);if(_[_0x8835('0x10')](this[_0x8835('0x5')][_0x8835('0x11')][this[_0x8835('0x4')]['id']])){logger[_0x8835('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x8835('0x3')]['id'],this[_0x8835('0x4')]['id']);setTimeout(this[_0x8835('0x7')]['bind'](this),0x3e8);}else{if(this[_0x8835('0x6')][_0x8835('0x12')]||util[_0x8835('0x13')](this[_0x8835('0x3')]['id'],this['realtime'][_0x8835('0x11')][this[_0x8835('0x4')]['id']],this[_0x8835('0x3')]['channel'],![])){this[_0x8835('0x5')][_0x8835('0x11')][this[_0x8835('0x4')]['id']][_0x8835('0x14')]=!![];this[_0x8835('0x5')][_0x8835('0x11')][this[_0x8835('0x4')]['id']]['busyQueue']=undefined;util[_0x8835('0x15')](this[_0x8835('0x2')],this['squeue']['id'],this[_0x8835('0x5')][_0x8835('0x11')][this['agent']['id']],null,this[_0x8835('0x6')]);util[_0x8835('0x16')](this[_0x8835('0x3')]['id'],this[_0x8835('0x5')][_0x8835('0x11')][this['agent']['id']],_0x8835('0x17')+(this[_0x8835('0x6')][_0x8835('0x12')]?':FORCED':''));}else{logger[_0x8835('0xe')](_0x8835('0x18'),this[_0x8835('0x3')]['id'],this[_0x8835('0x4')]['id']);setTimeout(this[_0x8835('0x7')][_0x8835('0xc')](this),0x3e8);}}};Agent['prototype'][_0x8835('0xa')]=function(_0x449192){if(_['isNil'](this[_0x8835('0x5')]['agents'][this[_0x8835('0x4')]['id']])){return logger[_0x8835('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x8835('0x4')]['id']);}else{logger[_0x8835('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x8835('0x3')]['id'],this['agent']['id']);util['hideNotification'](this[_0x8835('0x2')],this[_0x8835('0x3')]['id'],this[_0x8835('0x5')][_0x8835('0x11')][this['agent']['id']],null,this[_0x8835('0x6')]);this[_0x8835('0x5')]['agents'][this[_0x8835('0x4')]['id']]['busy']=![];this[_0x8835('0x5')][_0x8835('0x11')][this[_0x8835('0x4')]['id']][_0x8835('0x19')]=undefined;util[_0x8835('0x16')](this[_0x8835('0x3')]['id'],this['realtime'][_0x8835('0x11')][this['agent']['id']],_0x449192?_0x8835('0x1a'):_0x8835('0x1b'));}if(!_0x449192){setTimeout(this[_0x8835('0x7')]['bind'](this),0x3e8);}};function agent(_0x3c79d1,_0x2f0d8c,_0x45806e,_0x29e306){return new Agent(_0x3c79d1,_0x2f0d8c,_0x45806e,_0x29e306);}module['exports']=agent;
\ No newline at end of file
+var _0x98bf=['agent','realtime','push','handleRun','bind','handleTimeout','drained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','busyQueue','showNotification','writeLog','RINGING','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','STOP','TIMEOUT','exports','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x37a896,_0x5569de){var _0x510515=function(_0x22eb4b){while(--_0x22eb4b){_0x37a896['push'](_0x37a896['shift']());}};_0x510515(++_0x5569de);}(_0x98bf,0x163));var _0xf98b=function(_0x4ed17b,_0x2b1745){_0x4ed17b=_0x4ed17b-0x0;var _0x24b248=_0x98bf[_0x4ed17b];return _0x24b248;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xf98b('0x0'));var logger=require(_0xf98b('0x1'))(_0xf98b('0x2'));var Agent=function(_0x55b8be,_0x5c974a,_0x2aaf01,_0x1a4f89){this[_0xf98b('0x3')]=uuid['v4']();this[_0xf98b('0x4')]=_0x55b8be;this[_0xf98b('0x5')]=_0x5c974a;this[_0xf98b('0x6')]=_0x2aaf01;this[_0xf98b('0x2')]=_0x1a4f89;this[_0xf98b('0x4')][_0xf98b('0x7')](this[_0xf98b('0x8')][_0xf98b('0x9')](this),this[_0xf98b('0xa')][_0xf98b('0x9')](this));this[_0xf98b('0x4')]['on']('timeout',this[_0xf98b('0xa')][_0xf98b('0x9')](this));this[_0xf98b('0x4')]['on'](_0xf98b('0xb'),this['handleDrained'][_0xf98b('0x9')](this));};Agent[_0xf98b('0xc')]['push']=function(){this[_0xf98b('0x4')][_0xf98b('0x7')](this[_0xf98b('0x8')]['bind'](this),this[_0xf98b('0xa')][_0xf98b('0x9')](this));};Agent[_0xf98b('0xc')]['handleDrained']=function(){this[_0xf98b('0xa')](!![]);};Agent['prototype']['handleRun']=function(_0x5f58aa){logger['info'](_0xf98b('0xd'),this['squeue']['id'],this[_0xf98b('0x5')]['id']);if(_[_0xf98b('0xe')](this[_0xf98b('0x6')][_0xf98b('0xf')][this[_0xf98b('0x5')]['id']])){logger[_0xf98b('0x10')](_0xf98b('0x11'),this[_0xf98b('0x4')]['id'],this[_0xf98b('0x5')]['id']);setTimeout(this[_0xf98b('0x7')]['bind'](this),0x3e8);}else{if(this[_0xf98b('0x2')]['forcedOwnership']||util[_0xf98b('0x12')](this[_0xf98b('0x4')]['id'],this[_0xf98b('0x6')]['agents'][this[_0xf98b('0x5')]['id']],this[_0xf98b('0x4')]['channel'],![])){this[_0xf98b('0x6')][_0xf98b('0xf')][this[_0xf98b('0x5')]['id']]['busy']=!![];this[_0xf98b('0x6')][_0xf98b('0xf')][this[_0xf98b('0x5')]['id']][_0xf98b('0x13')]=undefined;util[_0xf98b('0x14')](this[_0xf98b('0x3')],this['squeue']['id'],this[_0xf98b('0x6')][_0xf98b('0xf')][this[_0xf98b('0x5')]['id']],null,this['routing']);util[_0xf98b('0x15')](this[_0xf98b('0x4')]['id'],this[_0xf98b('0x6')][_0xf98b('0xf')][this[_0xf98b('0x5')]['id']],_0xf98b('0x16')+(this['routing'][_0xf98b('0x17')]?':FORCED':''));}else{logger[_0xf98b('0x10')](_0xf98b('0x18'),this[_0xf98b('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xf98b('0x7')][_0xf98b('0x9')](this),0x3e8);}}};Agent[_0xf98b('0xc')][_0xf98b('0xa')]=function(_0x4c74f7){if(_[_0xf98b('0xe')](this['realtime']['agents'][this[_0xf98b('0x5')]['id']])){return logger[_0xf98b('0x10')](_0xf98b('0x11'),this[_0xf98b('0x4')]['id'],this[_0xf98b('0x5')]['id']);}else{logger[_0xf98b('0x10')](_0xf98b('0x19'),this[_0xf98b('0x4')]['id'],this[_0xf98b('0x5')]['id']);util['hideNotification'](this['notificationId'],this[_0xf98b('0x4')]['id'],this[_0xf98b('0x6')][_0xf98b('0xf')][this['agent']['id']],null,this['routing']);this[_0xf98b('0x6')][_0xf98b('0xf')][this[_0xf98b('0x5')]['id']][_0xf98b('0x1a')]=![];this[_0xf98b('0x6')][_0xf98b('0xf')][this[_0xf98b('0x5')]['id']][_0xf98b('0x13')]=undefined;util['writeLog'](this[_0xf98b('0x4')]['id'],this['realtime'][_0xf98b('0xf')][this[_0xf98b('0x5')]['id']],_0x4c74f7?_0xf98b('0x1b'):_0xf98b('0x1c'));}if(!_0x4c74f7){setTimeout(this[_0xf98b('0x7')]['bind'](this),0x3e8);}};function agent(_0x568fe6,_0x28d4db,_0x478bd3,_0x3ac10c){return new Agent(_0x568fe6,_0x28d4db,_0x478bd3,_0x3ac10c);}module[_0xf98b('0x1d')]=agent;
\ No newline at end of file
index 7a5fd22..9aa076a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9009=['isNil','Agents','length','info','realtime','agents','channel','RINGING','busy','busyQueue','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','routing','writeLog','TIMEOUT','lodash','./util','../../../../../config/logger','squeue','queue','push','bind','handleTimeout','drained','handleDrained','prototype','handleRun'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9009,0x1d4));var _0x9900=function(_0x561e0c,_0x430cc9){_0x561e0c=_0x561e0c-0x0;var _0x407440=_0x9009[_0x561e0c];return _0x407440;};'use strict';var _=require(_0x9900('0x0'));var uuid=require('uuid');var util=require(_0x9900('0x1'));var logger=require(_0x9900('0x2'))('routing');var Beepall=function(_0x12d637,_0x177acf,_0x1f7ed9,_0x224abb){this['notificationId']=uuid['v4']();this[_0x9900('0x3')]=_0x12d637;this[_0x9900('0x4')]=_0x177acf;this['realtime']=_0x1f7ed9;this['routing']=_0x224abb;this[_0x9900('0x3')][_0x9900('0x5')](this['handleRun'][_0x9900('0x6')](this),this[_0x9900('0x7')][_0x9900('0x6')](this));this[_0x9900('0x3')]['on']('timeout',this[_0x9900('0x7')][_0x9900('0x6')](this));this[_0x9900('0x3')]['on'](_0x9900('0x8'),this[_0x9900('0x9')]['bind'](this));};Beepall['prototype'][_0x9900('0x5')]=function(){this[_0x9900('0x3')]['push'](this['handleRun'][_0x9900('0x6')](this),this['handleTimeout'][_0x9900('0x6')](this));};Beepall[_0x9900('0xa')][_0x9900('0x9')]=function(_0x2874fe){this[_0x9900('0x7')](!![]);};Beepall[_0x9900('0xa')][_0x9900('0xb')]=function(_0x7cab33){var _0x126c36=!![];if(!_[_0x9900('0xc')](this[_0x9900('0x4')])&&!_[_0x9900('0xc')](this[_0x9900('0x4')][_0x9900('0xd')])&&this[_0x9900('0x4')][_0x9900('0xd')][_0x9900('0xe')]>0x0){for(var _0x5d9ec9=0x0,_0x51839f;_0x5d9ec9<this[_0x9900('0x4')][_0x9900('0xd')][_0x9900('0xe')];_0x5d9ec9+=0x1){_0x51839f=this[_0x9900('0x4')]['Agents'][_0x5d9ec9]['id'];if(_[_0x9900('0xc')](this['realtime']['agents'][_0x51839f])){logger[_0x9900('0xf')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x9900('0x3')]['id'],_0x51839f);}else{if(util['isAgentAvailable'](this['squeue']['id'],this[_0x9900('0x10')][_0x9900('0x11')][_0x51839f],this[_0x9900('0x3')][_0x9900('0x12')],!![])){_0x126c36=![];util['writeLog'](this[_0x9900('0x3')]['id'],this[_0x9900('0x10')][_0x9900('0x11')][_0x51839f],_0x9900('0x13'));this[_0x9900('0x10')]['agents'][_0x51839f][_0x9900('0x14')]=!![];this[_0x9900('0x10')]['agents'][_0x51839f][_0x9900('0x15')]=this[_0x9900('0x4')]['name'];util['showNotification'](this[_0x9900('0x16')],this[_0x9900('0x3')]['id'],this['realtime'][_0x9900('0x11')][_0x51839f],this[_0x9900('0x4')],this['routing']);}}}if(_0x126c36){logger[_0x9900('0xf')](_0x9900('0x17'),this[_0x9900('0x3')]['id']);setTimeout(this[_0x9900('0x5')][_0x9900('0x6')](this),0x3e8);}}else{logger['info'](_0x9900('0x18'),this[_0x9900('0x3')]['id']);setTimeout(this[_0x9900('0x5')][_0x9900('0x6')](this),0x3e8);}};Beepall[_0x9900('0xa')]['handleTimeout']=function(_0x4cef1f){if(!_['isNil'](this[_0x9900('0x4')])&&!_[_0x9900('0xc')](this['queue'][_0x9900('0xd')])){for(var _0x6fb5ab=0x0,_0x1b2aa0;_0x6fb5ab<this['queue']['Agents'][_0x9900('0xe')];_0x6fb5ab+=0x1){_0x1b2aa0=this[_0x9900('0x4')][_0x9900('0xd')][_0x6fb5ab]['id'];if(_[_0x9900('0xc')](this['realtime']['agents'][_0x1b2aa0])){logger[_0x9900('0xf')](_0x9900('0x19'),this[_0x9900('0x3')]['id'],_0x1b2aa0);}else{util[_0x9900('0x1a')](this[_0x9900('0x16')],this[_0x9900('0x3')]['id'],this[_0x9900('0x10')][_0x9900('0x11')][_0x1b2aa0],this[_0x9900('0x4')],this[_0x9900('0x1b')]);util[_0x9900('0x1c')](this[_0x9900('0x3')]['id'],this[_0x9900('0x10')]['agents'][_0x1b2aa0],_0x4cef1f?'STOP':_0x9900('0x1d'));this['realtime'][_0x9900('0x11')][_0x1b2aa0][_0x9900('0x14')]=![];this[_0x9900('0x10')][_0x9900('0x11')][_0x1b2aa0][_0x9900('0x15')]=undefined;}}}if(!_0x4cef1f){setTimeout(this[_0x9900('0x5')][_0x9900('0x6')](this),0x3e8);}};function beepall(_0x3ed846,_0x2ab542,_0x581e0b,_0x5bfb20){return new Beepall(_0x3ed846,_0x2ab542,_0x581e0b,_0x5bfb20);}module['exports']=beepall;
\ No newline at end of file
+var _0x7edb=['info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','name','notificationId','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','busyQueue','exports','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x7edb,0x158));var _0xb7ed=function(_0x2e44ee,_0x38990a){_0x2e44ee=_0x2e44ee-0x0;var _0xa854d6=_0x7edb[_0x2e44ee];return _0xa854d6;};'use strict';var _=require('lodash');var uuid=require(_0xb7ed('0x0'));var util=require(_0xb7ed('0x1'));var logger=require(_0xb7ed('0x2'))(_0xb7ed('0x3'));var Beepall=function(_0x15d080,_0x5a485a,_0x94e65b,_0x595b65){this['notificationId']=uuid['v4']();this[_0xb7ed('0x4')]=_0x15d080;this[_0xb7ed('0x5')]=_0x5a485a;this[_0xb7ed('0x6')]=_0x94e65b;this[_0xb7ed('0x3')]=_0x595b65;this[_0xb7ed('0x4')][_0xb7ed('0x7')](this[_0xb7ed('0x8')][_0xb7ed('0x9')](this),this[_0xb7ed('0xa')][_0xb7ed('0x9')](this));this['squeue']['on'](_0xb7ed('0xb'),this[_0xb7ed('0xa')][_0xb7ed('0x9')](this));this[_0xb7ed('0x4')]['on'](_0xb7ed('0xc'),this[_0xb7ed('0xd')][_0xb7ed('0x9')](this));};Beepall['prototype'][_0xb7ed('0x7')]=function(){this[_0xb7ed('0x4')][_0xb7ed('0x7')](this[_0xb7ed('0x8')][_0xb7ed('0x9')](this),this['handleTimeout']['bind'](this));};Beepall[_0xb7ed('0xe')]['handleDrained']=function(_0x3dc68){this[_0xb7ed('0xa')](!![]);};Beepall[_0xb7ed('0xe')][_0xb7ed('0x8')]=function(_0x463c8b){var _0x52a0fa=!![];if(!_[_0xb7ed('0xf')](this[_0xb7ed('0x5')])&&!_[_0xb7ed('0xf')](this[_0xb7ed('0x5')][_0xb7ed('0x10')])&&this[_0xb7ed('0x5')]['Agents'][_0xb7ed('0x11')]>0x0){for(var _0x48d849=0x0,_0x3b5a2b;_0x48d849<this[_0xb7ed('0x5')]['Agents']['length'];_0x48d849+=0x1){_0x3b5a2b=this[_0xb7ed('0x5')][_0xb7ed('0x10')][_0x48d849]['id'];if(_[_0xb7ed('0xf')](this['realtime'][_0xb7ed('0x12')][_0x3b5a2b])){logger[_0xb7ed('0x13')](_0xb7ed('0x14'),this[_0xb7ed('0x4')]['id'],_0x3b5a2b);}else{if(util['isAgentAvailable'](this[_0xb7ed('0x4')]['id'],this[_0xb7ed('0x6')][_0xb7ed('0x12')][_0x3b5a2b],this[_0xb7ed('0x4')][_0xb7ed('0x15')],!![])){_0x52a0fa=![];util[_0xb7ed('0x16')](this[_0xb7ed('0x4')]['id'],this[_0xb7ed('0x6')]['agents'][_0x3b5a2b],_0xb7ed('0x17'));this[_0xb7ed('0x6')]['agents'][_0x3b5a2b]['busy']=!![];this['realtime'][_0xb7ed('0x12')][_0x3b5a2b]['busyQueue']=this['queue'][_0xb7ed('0x18')];util['showNotification'](this[_0xb7ed('0x19')],this['squeue']['id'],this[_0xb7ed('0x6')][_0xb7ed('0x12')][_0x3b5a2b],this[_0xb7ed('0x5')],this[_0xb7ed('0x3')]);}}}if(_0x52a0fa){logger[_0xb7ed('0x13')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this['squeue']['id']);setTimeout(this[_0xb7ed('0x7')][_0xb7ed('0x9')](this),0x3e8);}}else{logger[_0xb7ed('0x13')](_0xb7ed('0x1a'),this[_0xb7ed('0x4')]['id']);setTimeout(this['push'][_0xb7ed('0x9')](this),0x3e8);}};Beepall[_0xb7ed('0xe')]['handleTimeout']=function(_0xe7ccb){if(!_[_0xb7ed('0xf')](this[_0xb7ed('0x5')])&&!_['isNil'](this[_0xb7ed('0x5')][_0xb7ed('0x10')])){for(var _0x2c4407=0x0,_0x1cbcd6;_0x2c4407<this['queue'][_0xb7ed('0x10')]['length'];_0x2c4407+=0x1){_0x1cbcd6=this[_0xb7ed('0x5')][_0xb7ed('0x10')][_0x2c4407]['id'];if(_[_0xb7ed('0xf')](this[_0xb7ed('0x6')][_0xb7ed('0x12')][_0x1cbcd6])){logger[_0xb7ed('0x13')](_0xb7ed('0x14'),this['squeue']['id'],_0x1cbcd6);}else{util[_0xb7ed('0x1b')](this['notificationId'],this[_0xb7ed('0x4')]['id'],this['realtime'][_0xb7ed('0x12')][_0x1cbcd6],this[_0xb7ed('0x5')],this[_0xb7ed('0x3')]);util[_0xb7ed('0x16')](this['squeue']['id'],this[_0xb7ed('0x6')][_0xb7ed('0x12')][_0x1cbcd6],_0xe7ccb?_0xb7ed('0x1c'):_0xb7ed('0x1d'));this[_0xb7ed('0x6')]['agents'][_0x1cbcd6][_0xb7ed('0x1e')]=![];this[_0xb7ed('0x6')][_0xb7ed('0x12')][_0x1cbcd6][_0xb7ed('0x1f')]=undefined;}}}if(!_0xe7ccb){setTimeout(this[_0xb7ed('0x7')][_0xb7ed('0x9')](this),0x3e8);}};function beepall(_0x43196e,_0x16a6fe,_0x1fed0e,_0x561299){return new Beepall(_0x43196e,_0x16a6fe,_0x1fed0e,_0x561299);}module[_0xb7ed('0x20')]=beepall;
\ No newline at end of file
index d855362..7a9d7b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4095=['./agent','./rrmemory','./beepall'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x4095,0x79));var _0x5409=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x4095[_0x3de8a4];return _0x4635cf;};'use strict';module['exports']={'rrmemory':require(_0x5409('0x0')),'beepall':require(_0x5409('0x1')),'agent':require(_0x5409('0x2'))};
\ No newline at end of file
+var _0x17f3=['./agent','exports','./rrmemory'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x17f3,0x16f));var _0x317f=function(_0x393d30,_0x333ef5){_0x393d30=_0x393d30-0x0;var _0xd581b5=_0x17f3[_0x393d30];return _0xd581b5;};'use strict';module[_0x317f('0x0')]={'rrmemory':require(_0x317f('0x1')),'beepall':require('./beepall'),'agent':require(_0x317f('0x2'))};
\ No newline at end of file
index e343e87..7f1405a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe97a=['isAgentAvailable','agents','agentId','channel','intervals','done','mapAgentsId','info','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','showNotification','notificationId','writeLog','RINGING','handleCheckReject','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','routing','squeue','queue','realtime','push','bind','module','timeout','handleTimeout','drained','handleDrained','prototype','handleRun'];(function(_0x12b98e,_0xff662a){var _0x21a048=function(_0x4c09f1){while(--_0x4c09f1){_0x12b98e['push'](_0x12b98e['shift']());}};_0x21a048(++_0xff662a);}(_0xe97a,0x80));var _0xae97=function(_0x1d52d3,_0x2a0df0){_0x1d52d3=_0x1d52d3-0x0;var _0x1ad74b=_0xe97a[_0x1d52d3];return _0x1ad74b;};'use strict';var rr=require('rr');var _=require(_0xae97('0x0'));var uuid=require(_0xae97('0x1'));var util=require(_0xae97('0x2'));var logger=require('../../../../../config/logger')(_0xae97('0x3'));var RRMemory=function(_0x40ba9d,_0x39de52,_0x21b20d,_0x9ab5bd){this['notificationId']=uuid['v4']();this[_0xae97('0x4')]=_0x40ba9d;this[_0xae97('0x5')]=_0x39de52;this[_0xae97('0x6')]=_0x21b20d;this[_0xae97('0x3')]=_0x9ab5bd;this['intervals']={};this[_0xae97('0x4')][_0xae97('0x7')](this['handleRun'][_0xae97('0x8')](this),this['handleTimeout'][_0xae97('0x8')](this),this[_0xae97('0x9')]);this[_0xae97('0x4')]['on'](_0xae97('0xa'),this[_0xae97('0xb')][_0xae97('0x8')](this));this['squeue']['on'](_0xae97('0xc'),this[_0xae97('0xd')]['bind'](this));};RRMemory[_0xae97('0xe')]['push']=function(){this['squeue'][_0xae97('0x7')](this[_0xae97('0xf')]['bind'](this),this[_0xae97('0xb')][_0xae97('0x8')](this));};RRMemory[_0xae97('0xe')][_0xae97('0xd')]=function(_0x5e937b){this[_0xae97('0xb')](!![]);};RRMemory['prototype']['handleCheckReject']=function(_0x1cabc9){if(util[_0xae97('0x10')](this[_0xae97('0x4')]['id'],this['realtime'][_0xae97('0x11')][this[_0xae97('0x12')]],this['squeue'][_0xae97('0x13')],!![])){logger['info']('[%s][QUEUE]\x20available\x20again\x20%s',this[_0xae97('0x4')]['id'],this[_0xae97('0x12')]);clearInterval(this[_0xae97('0x14')][this[_0xae97('0x12')]]);_0x1cabc9[_0xae97('0x15')]();setTimeout(this[_0xae97('0x7')][_0xae97('0x8')](this),0x3e8);}};RRMemory[_0xae97('0xe')]['handleRun']=function(_0x4dfd1f){this[_0xae97('0x12')]=rr(this[_0xae97('0x5')][_0xae97('0x16')]);logger[_0xae97('0x17')](_0xae97('0x18'),this[_0xae97('0x4')]['id'],this['agentId']);if(_[_0xae97('0x19')](this[_0xae97('0x6')]['agents'][this[_0xae97('0x12')]])){logger[_0xae97('0x17')](_0xae97('0x1a'),this[_0xae97('0x4')]['id'],this[_0xae97('0x12')]);_0x4dfd1f[_0xae97('0x15')]();setTimeout(this[_0xae97('0x7')][_0xae97('0x8')](this),0x3e8);}else{if(util[_0xae97('0x10')](this[_0xae97('0x4')]['id'],this['realtime'][_0xae97('0x11')][this[_0xae97('0x12')]],this[_0xae97('0x4')][_0xae97('0x13')],!![])){this['realtime']['agents'][this[_0xae97('0x12')]]['busy']=!![];this[_0xae97('0x6')]['agents'][this[_0xae97('0x12')]]['busyQueue']=this[_0xae97('0x5')]['name'];util[_0xae97('0x1b')](this[_0xae97('0x1c')],this[_0xae97('0x4')]['id'],this[_0xae97('0x6')][_0xae97('0x11')][this[_0xae97('0x12')]],this[_0xae97('0x5')],this[_0xae97('0x3')]);util[_0xae97('0x1d')](this[_0xae97('0x4')]['id'],this[_0xae97('0x6')]['agents'][this['agentId']],_0xae97('0x1e'));this[_0xae97('0x14')][this[_0xae97('0x12')]]=setInterval(this[_0xae97('0x1f')][_0xae97('0x8')](this,_0x4dfd1f),0x3e8);}else{logger[_0xae97('0x17')](_0xae97('0x20'),this[_0xae97('0x4')]['id'],this[_0xae97('0x12')]);_0x4dfd1f[_0xae97('0x15')]();setTimeout(this[_0xae97('0x7')][_0xae97('0x8')](this),0x3e8);}}};RRMemory['prototype'][_0xae97('0xb')]=function(_0x2bbbad){logger['info']('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0xae97('0x4')]['id'],this[_0xae97('0x12')]);if(_[_0xae97('0x19')](this[_0xae97('0x6')]['agents'][this[_0xae97('0x12')]])){logger[_0xae97('0x17')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xae97('0x4')]['id'],this[_0xae97('0x12')]);}else{clearInterval(this[_0xae97('0x14')][this[_0xae97('0x12')]]);util[_0xae97('0x21')](this['notificationId'],this[_0xae97('0x4')]['id'],this[_0xae97('0x6')][_0xae97('0x11')][this[_0xae97('0x12')]],this[_0xae97('0x5')],this['routing']);util[_0xae97('0x1d')](this['squeue']['id'],this[_0xae97('0x6')][_0xae97('0x11')][this[_0xae97('0x12')]],_0xae97('0x22'));this['realtime']['agents'][this['agentId']]['busy']=![];this[_0xae97('0x6')][_0xae97('0x11')][this['agentId']]['busyQueue']=undefined;}if(!_0x2bbbad){setTimeout(this[_0xae97('0x7')][_0xae97('0x8')](this),0x3e8);}};function rrmemory(_0x35d67c,_0x547a4a,_0x2648ca,_0x374465){return new RRMemory(_0x35d67c,_0x547a4a,_0x2648ca,_0x374465);}module[_0xae97('0x23')]=rrmemory;
\ No newline at end of file
+var _0x95d7=['module','timeout','handleTimeout','drained','prototype','handleDrained','handleCheckReject','isAgentAvailable','agents','channel','[%s][QUEUE]\x20available\x20again\x20%s','agentId','done','mapAgentsId','info','[%s][QUEUE]\x20try\x20with\x20%s','isNil','busy','busyQueue','queue','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','realtime','routing','intervals','push','handleRun','bind'];(function(_0x285747,_0x5d9703){var _0x3b4571=function(_0x5201a0){while(--_0x5201a0){_0x285747['push'](_0x285747['shift']());}};_0x3b4571(++_0x5d9703);}(_0x95d7,0xe4));var _0x795d=function(_0x5f1e5b,_0x4bdb9a){_0x5f1e5b=_0x5f1e5b-0x0;var _0x2c83fb=_0x95d7[_0x5f1e5b];return _0x2c83fb;};'use strict';var rr=require('rr');var _=require(_0x795d('0x0'));var uuid=require(_0x795d('0x1'));var util=require(_0x795d('0x2'));var logger=require(_0x795d('0x3'))('routing');var RRMemory=function(_0x103a8f,_0x306acf,_0x43b6a8,_0x1ec278){this[_0x795d('0x4')]=uuid['v4']();this[_0x795d('0x5')]=_0x103a8f;this['queue']=_0x306acf;this[_0x795d('0x6')]=_0x43b6a8;this[_0x795d('0x7')]=_0x1ec278;this[_0x795d('0x8')]={};this[_0x795d('0x5')][_0x795d('0x9')](this[_0x795d('0xa')][_0x795d('0xb')](this),this['handleTimeout'][_0x795d('0xb')](this),this[_0x795d('0xc')]);this[_0x795d('0x5')]['on'](_0x795d('0xd'),this[_0x795d('0xe')][_0x795d('0xb')](this));this['squeue']['on'](_0x795d('0xf'),this['handleDrained'][_0x795d('0xb')](this));};RRMemory[_0x795d('0x10')][_0x795d('0x9')]=function(){this[_0x795d('0x5')][_0x795d('0x9')](this[_0x795d('0xa')]['bind'](this),this[_0x795d('0xe')][_0x795d('0xb')](this));};RRMemory[_0x795d('0x10')][_0x795d('0x11')]=function(_0x7b8f27){this[_0x795d('0xe')](!![]);};RRMemory[_0x795d('0x10')][_0x795d('0x12')]=function(_0xacbb00){if(util[_0x795d('0x13')](this[_0x795d('0x5')]['id'],this[_0x795d('0x6')][_0x795d('0x14')][this['agentId']],this[_0x795d('0x5')][_0x795d('0x15')],!![])){logger['info'](_0x795d('0x16'),this[_0x795d('0x5')]['id'],this[_0x795d('0x17')]);clearInterval(this[_0x795d('0x8')][this[_0x795d('0x17')]]);_0xacbb00[_0x795d('0x18')]();setTimeout(this[_0x795d('0x9')][_0x795d('0xb')](this),0x3e8);}};RRMemory[_0x795d('0x10')]['handleRun']=function(_0xcde731){this['agentId']=rr(this['queue'][_0x795d('0x19')]);logger[_0x795d('0x1a')](_0x795d('0x1b'),this['squeue']['id'],this['agentId']);if(_[_0x795d('0x1c')](this['realtime']['agents'][this[_0x795d('0x17')]])){logger[_0x795d('0x1a')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x795d('0x5')]['id'],this[_0x795d('0x17')]);_0xcde731[_0x795d('0x18')]();setTimeout(this[_0x795d('0x9')][_0x795d('0xb')](this),0x3e8);}else{if(util[_0x795d('0x13')](this[_0x795d('0x5')]['id'],this['realtime'][_0x795d('0x14')][this[_0x795d('0x17')]],this[_0x795d('0x5')]['channel'],!![])){this[_0x795d('0x6')]['agents'][this[_0x795d('0x17')]][_0x795d('0x1d')]=!![];this[_0x795d('0x6')][_0x795d('0x14')][this[_0x795d('0x17')]][_0x795d('0x1e')]=this[_0x795d('0x1f')]['name'];util[_0x795d('0x20')](this[_0x795d('0x4')],this[_0x795d('0x5')]['id'],this[_0x795d('0x6')][_0x795d('0x14')][this[_0x795d('0x17')]],this[_0x795d('0x1f')],this[_0x795d('0x7')]);util[_0x795d('0x21')](this['squeue']['id'],this[_0x795d('0x6')][_0x795d('0x14')][this[_0x795d('0x17')]],_0x795d('0x22'));this[_0x795d('0x8')][this['agentId']]=setInterval(this['handleCheckReject'][_0x795d('0xb')](this,_0xcde731),0x3e8);}else{logger[_0x795d('0x1a')](_0x795d('0x23'),this[_0x795d('0x5')]['id'],this[_0x795d('0x17')]);_0xcde731[_0x795d('0x18')]();setTimeout(this[_0x795d('0x9')][_0x795d('0xb')](this),0x3e8);}}};RRMemory[_0x795d('0x10')]['handleTimeout']=function(_0x41a5ae){logger['info'](_0x795d('0x24'),this[_0x795d('0x5')]['id'],this[_0x795d('0x17')]);if(_[_0x795d('0x1c')](this[_0x795d('0x6')][_0x795d('0x14')][this[_0x795d('0x17')]])){logger[_0x795d('0x1a')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x795d('0x5')]['id'],this[_0x795d('0x17')]);}else{clearInterval(this[_0x795d('0x8')][this[_0x795d('0x17')]]);util[_0x795d('0x25')](this[_0x795d('0x4')],this['squeue']['id'],this['realtime']['agents'][this['agentId']],this['queue'],this[_0x795d('0x7')]);util[_0x795d('0x21')](this[_0x795d('0x5')]['id'],this[_0x795d('0x6')][_0x795d('0x14')][this[_0x795d('0x17')]],_0x795d('0x26'));this[_0x795d('0x6')][_0x795d('0x14')][this['agentId']][_0x795d('0x1d')]=![];this[_0x795d('0x6')]['agents'][this['agentId']]['busyQueue']=undefined;}if(!_0x41a5ae){setTimeout(this[_0x795d('0x9')][_0x795d('0xb')](this),0x3e8);}};function rrmemory(_0x1378ec,_0x130475,_0xe0bab4,_0x311028){return new RRMemory(_0x1378ec,_0x130475,_0xe0bab4,_0x311028);}module[_0x795d('0x27')]=rrmemory;
\ No newline at end of file
index c15e919..8d2b3e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fb=['mustache','routing','redis','localhost','emit','user:%s','name','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','msg','error','format','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils'];(function(_0x3f6231,_0x4fced0){var _0x5a0614=function(_0x5d7e6c){while(--_0x5d7e6c){_0x3f6231['push'](_0x3f6231['shift']());}};_0x5a0614(++_0x4fced0);}(_0xd8fb,0x99));var _0xbd8f=function(_0x39a5c6,_0x5e6669){_0x39a5c6=_0x39a5c6-0x0;var _0x5bba0c=_0xd8fb[_0x39a5c6];return _0x5bba0c;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var utils=require(_0xbd8f('0x2'));var Mustache=require(_0xbd8f('0x3'));var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0xbd8f('0x4'));config[_0xbd8f('0x5')]=_['defaults'](config[_0xbd8f('0x5')],{'host':_0xbd8f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbd8f('0x5')]));function emit(_0x4e97cf,_0xf503c4,_0x578499){io['to'](_0x4e97cf)[_0xbd8f('0x7')](_0xf503c4,_0x578499);}function sendNotification(_0x403edc,_0x493298,_0x5697bd,_0x3caa93,_0x2393a9,_0x2a55b5){io['to'](util['format'](_0xbd8f('0x8'),_0x3caa93[_0xbd8f('0x9')]))['emit']('user:save',_0x3caa93);var _0x342bcb=_0x2a55b5||{};var _0x40a5bc=_0x5697bd[_0xbd8f('0xa')]('.');var _0x5d5705={'uniqueid':_0x493298,'channel':_0x40a5bc[0x0],'id':_0x40a5bc[0x1],'title':_0x40a5bc[0x0]+_0xbd8f('0xb'),'interactionId':_0x40a5bc[0x2],'queue':_0x2393a9?_0x2393a9[_0xbd8f('0x9')]:null,'sound':_0x342bcb[_0xbd8f('0xc')][_0xbd8f('0xd')],'shake':_0x342bcb[_0xbd8f('0xc')][_0xbd8f('0xe')]};try{if(!_0x342bcb[_0xbd8f('0xf')]){_0x342bcb[_0xbd8f('0xf')]={};}if(_0x2393a9){_0x342bcb[_0xbd8f('0xf')]['queue']=_0x2393a9;}else if(_0x342bcb[_0xbd8f('0xf')][_0xbd8f('0x10')]){delete _0x342bcb[_0xbd8f('0xf')][_0xbd8f('0x10')];}_0x5d5705['msg']=utils[_0xbd8f('0x11')](_0x342bcb[_0xbd8f('0xc')]['notificationTemplate'],_0x342bcb);}catch(_0x15be97){_0x5d5705[_0xbd8f('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0xbd8f('0x13')](util[_0xbd8f('0x14')]('[%s][QUEUE]\x20%s',_0x493298,_0x15be97['message']));}io['to'](util[_0xbd8f('0x14')]('user:%s',_0x3caa93['name']))[_0xbd8f('0x7')](util['format'](_0xbd8f('0x15'),_0x403edc?_0xbd8f('0x16'):_0xbd8f('0x17')),_0x5d5705);}function writeLog(_0x897f25,_0xdc11cc,_0x20cab7){return logger[_0xbd8f('0x18')](util[_0xbd8f('0x14')](_0xbd8f('0x19'),_0x897f25,_0xdc11cc[_0xbd8f('0x9')],_0x20cab7));}exports[_0xbd8f('0x1a')]=function(_0x1628f5,_0x2f7c45,_0x15c4a9,_0x320ede){if(_0x2f7c45[_0xbd8f('0x1b')]){writeLog(_0x1628f5,_0x2f7c45,_0xbd8f('0x1c'));return![];}if(!_0x2f7c45['online']){writeLog(_0x1628f5,_0x2f7c45,_0xbd8f('0x1d'));return![];}if(_0x2f7c45[_0x15c4a9+_0xbd8f('0x1e')]){writeLog(_0x1628f5,_0x2f7c45,_0xbd8f('0x1f'));return![];}if(_0x320ede&&_0x2f7c45[_0xbd8f('0x20')](_0x15c4a9+_0xbd8f('0x21'))&&_0x2f7c45[_0xbd8f('0x20')](_0x15c4a9+_0xbd8f('0x22'))){if(_0x2f7c45[_0x15c4a9+_0xbd8f('0x21')]>0x0&&_0x2f7c45[_0x15c4a9+'CurrentCapacity']>=_0x2f7c45[_0x15c4a9+_0xbd8f('0x21')]){writeLog(_0x1628f5,_0x2f7c45,_0x15c4a9[_0xbd8f('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xbd8f('0x24')]=function(_0x557daa,_0x41b2a6,_0x30d62e,_0x991401,_0x202126){return sendNotification(!![],_0x557daa,_0x41b2a6,_0x30d62e,_0x991401,_0x202126);};exports[_0xbd8f('0x25')]=function(_0x247b07,_0x4c4431,_0x166de7,_0x14f3cb,_0x39714d){return sendNotification(![],_0x247b07,_0x4c4431,_0x166de7,_0x14f3cb,_0x39714d);};exports[_0xbd8f('0x26')]=writeLog;
\ No newline at end of file
+var _0x5496=['isAgentAvailable','busy','BUSY','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','redis','defaults','emit','format','user:%s','user:save','split','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','name','notification:%s','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]'];(function(_0x249d27,_0x5e30a9){var _0x4eae86=function(_0x4a968a){while(--_0x4a968a){_0x249d27['push'](_0x249d27['shift']());}};_0x4eae86(++_0x5e30a9);}(_0x5496,0x175));var _0x6549=function(_0x3eacc6,_0x545854){_0x3eacc6=_0x3eacc6-0x0;var _0x427b5a=_0x5496[_0x3eacc6];return _0x427b5a;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var utils=require(_0x6549('0x2'));var Mustache=require(_0x6549('0x3'));var Redis=require(_0x6549('0x4'));var config=require('../../../../../config/environment');var logger=require(_0x6549('0x5'))('routing');config[_0x6549('0x6')]=_[_0x6549('0x7')](config[_0x6549('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6549('0x6')]));function emit(_0x1d8cea,_0x4fcffd,_0x1ca8fc){io['to'](_0x1d8cea)[_0x6549('0x8')](_0x4fcffd,_0x1ca8fc);}function sendNotification(_0x1ef2a6,_0x5c47ba,_0xa12086,_0x35d008,_0x2ecce2,_0x135c2c){io['to'](util[_0x6549('0x9')](_0x6549('0xa'),_0x35d008['name']))['emit'](_0x6549('0xb'),_0x35d008);var _0xac828c=_0x135c2c||{};var _0x3c5f9b=_0xa12086[_0x6549('0xc')]('.');var _0x1a0f72={'uniqueid':_0x5c47ba,'channel':_0x3c5f9b[0x0],'id':_0x3c5f9b[0x1],'title':_0x3c5f9b[0x0]+'\x20interaction','interactionId':_0x3c5f9b[0x2],'queue':_0x2ecce2?_0x2ecce2['name']:null,'sound':_0xac828c[_0x6549('0xd')][_0x6549('0xe')],'shake':_0xac828c['account'][_0x6549('0xf')]};try{if(!_0xac828c[_0x6549('0x10')]){_0xac828c[_0x6549('0x10')]={};}if(_0x2ecce2){_0xac828c[_0x6549('0x10')][_0x6549('0x11')]=_0x2ecce2;}else if(_0xac828c[_0x6549('0x10')]['queue']){delete _0xac828c['body'][_0x6549('0x11')];}_0x1a0f72[_0x6549('0x12')]=utils['getMustacheRender'](_0xac828c[_0x6549('0xd')][_0x6549('0x13')],_0xac828c);}catch(_0x4608fb){_0x1a0f72[_0x6549('0x12')]=_0x6549('0x14');logger['error'](util['format'](_0x6549('0x15'),_0x5c47ba,_0x4608fb['message']));}io['to'](util['format'](_0x6549('0xa'),_0x35d008[_0x6549('0x16')]))[_0x6549('0x8')](util[_0x6549('0x9')](_0x6549('0x17'),_0x1ef2a6?'save':_0x6549('0x18')),_0x1a0f72);}function writeLog(_0x4b40c1,_0x125096,_0x72322b){return logger[_0x6549('0x19')](util[_0x6549('0x9')](_0x6549('0x1a'),_0x4b40c1,_0x125096[_0x6549('0x16')],_0x72322b));}exports[_0x6549('0x1b')]=function(_0x25bc01,_0x2be467,_0x6ae00c,_0x40d3f9){if(_0x2be467[_0x6549('0x1c')]){writeLog(_0x25bc01,_0x2be467,_0x6549('0x1d'));return![];}if(!_0x2be467['online']){writeLog(_0x25bc01,_0x2be467,_0x6549('0x1e'));return![];}if(_0x2be467[_0x6ae00c+_0x6549('0x1f')]){writeLog(_0x25bc01,_0x2be467,'PAUSE');return![];}if(_0x40d3f9&&_0x2be467[_0x6549('0x20')](_0x6ae00c+_0x6549('0x21'))&&_0x2be467[_0x6549('0x20')](_0x6ae00c+'CurrentCapacity')){if(_0x2be467[_0x6ae00c+_0x6549('0x21')]>0x0&&_0x2be467[_0x6ae00c+_0x6549('0x22')]>=_0x2be467[_0x6ae00c+_0x6549('0x21')]){writeLog(_0x25bc01,_0x2be467,_0x6ae00c[_0x6549('0x23')]()+_0x6549('0x24'));return![];}}return!![];};exports[_0x6549('0x25')]=function(_0x2f58f7,_0xa6c718,_0x4c52f1,_0x1794bc,_0x136518){return sendNotification(!![],_0x2f58f7,_0xa6c718,_0x4c52f1,_0x1794bc,_0x136518);};exports[_0x6549('0x26')]=function(_0x4c605c,_0x3f1502,_0x4acaf5,_0x4f0ad1,_0x5aa3a6){return sendNotification(![],_0x4c605c,_0x3f1502,_0x4acaf5,_0x4f0ad1,_0x5aa3a6);};exports[_0x6549('0x27')]=writeLog;
\ No newline at end of file
index b9769e9..df7567f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabca=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace','isNil','isEmpty','body','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','routing','string'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0xabca,0x1af));var _0xaabc=function(_0x47707a,_0x4f7d3d){_0x47707a=_0x47707a-0x0;var _0x28c05b=_0xabca[_0x47707a];return _0x28c05b;};'use strict';var schema=require(_0xaabc('0x0'));var sh=require(_0xaabc('0x1'));var _=require('lodash');var utils=require(_0xaabc('0x2'));var logger=require(_0xaabc('0x3'))(_0xaabc('0x4'));var system=schema({'command':{'type':_0xaabc('0x5'),'required':!![],'message':_0xaabc('0x6')}});exports[_0xaabc('0x7')]=function(_0x15456e,_0x2cb784){return function(_0x1869d1){try{var _0x4bd5f6={'command':_0x2cb784[0x0]};var _0x22cc90=system['validate'](_0x4bd5f6,{'typecast':!![]});if(_0x22cc90[_0xaabc('0x8')]){logger['error']('[%s][SYSTEM]\x20%s',_0x15456e,_['map'](_0x22cc90,_0xaabc('0x9'))[_0xaabc('0xa')](',\x20'));logger[_0xaabc('0xb')](_0xaabc('0xc'),_0x15456e);_0x1869d1[_0xaabc('0xd')]();}else{var _0x3fafce=this;var _0x2f5539=utils[_0xaabc('0xe')](_0x2cb784[0x0],this);logger[_0xaabc('0xb')](_0xaabc('0xf'),_0x15456e,_0x2f5539);sh['exec'](_[_0xaabc('0x10')](_0x2f5539),function(_0x55fba0,_0x4889b6){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x15456e,_0x55fba0);if(_0x55fba0==0x0){var _0x579320=_0x4889b6[_0xaabc('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xaabc('0x12')](_0x2cb784[0x1])||_[_0xaabc('0x13')](_0x2cb784[0x1])){logger[_0xaabc('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x15456e);_0x3fafce[_0xaabc('0x14')][_0x2cb784[0x1]]=_0x579320;}else{logger[_0xaabc('0xb')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x15456e,_0x2cb784[0x1],_0x579320);_0x3fafce['body'][_0x2cb784[0x1]]=_0x579320;}}_0x1869d1[_0xaabc('0xd')]();});}}catch(_0x29f675){logger['error']('[%s][SYSTEM]\x20%s',_0x15456e,_[_0xaabc('0x15')](_0x29f675)?JSON[_0xaabc('0x16')](_0x29f675):_0x29f675);logger['info'](_0xaabc('0xc'),_0x15456e);_0x1869d1[_0xaabc('0xd')]();}};};
\ No newline at end of file
+var _0xbfa3=['body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable'];(function(_0x1c9222,_0x412996){var _0x3da162=function(_0x595989){while(--_0x595989){_0x1c9222['push'](_0x1c9222['shift']());}};_0x3da162(++_0x412996);}(_0xbfa3,0x70));var _0x3bfa=function(_0x2d3da5,_0x194cd6){_0x2d3da5=_0x2d3da5-0x0;var _0x125e17=_0xbfa3[_0x2d3da5];return _0x125e17;};'use strict';var schema=require(_0x3bfa('0x0'));var sh=require(_0x3bfa('0x1'));var _=require(_0x3bfa('0x2'));var utils=require(_0x3bfa('0x3'));var logger=require(_0x3bfa('0x4'))(_0x3bfa('0x5'));var system=schema({'command':{'type':_0x3bfa('0x6'),'required':!![],'message':_0x3bfa('0x7')}});exports[_0x3bfa('0x8')]=function(_0x45b11c,_0x21038d){return function(_0x1d0aac){try{var _0x120983={'command':_0x21038d[0x0]};var _0x5c8efa=system[_0x3bfa('0x0')](_0x120983,{'typecast':!![]});if(_0x5c8efa[_0x3bfa('0x9')]){logger['error'](_0x3bfa('0xa'),_0x45b11c,_[_0x3bfa('0xb')](_0x5c8efa,_0x3bfa('0xc'))['join'](',\x20'));logger[_0x3bfa('0xd')](_0x3bfa('0xe'),_0x45b11c);_0x1d0aac[_0x3bfa('0xf')]();}else{var _0x4bc627=this;var _0x51e9ca=utils['getMustacheRender'](_0x21038d[0x0],this);logger['info'](_0x3bfa('0x10'),_0x45b11c,_0x51e9ca);sh[_0x3bfa('0x11')](_['trim'](_0x51e9ca),function(_0x2afb82,_0x1e20f5){logger[_0x3bfa('0xd')](_0x3bfa('0x12'),_0x45b11c,_0x2afb82);if(_0x2afb82==0x0){var _0x3f95ee=_0x1e20f5[_0x3bfa('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x3bfa('0x14')](_0x21038d[0x1])||_[_0x3bfa('0x15')](_0x21038d[0x1])){logger[_0x3bfa('0xd')](_0x3bfa('0x16'),_0x45b11c);_0x4bc627[_0x3bfa('0x17')][_0x21038d[0x1]]=_0x3f95ee;}else{logger['info'](_0x3bfa('0x18'),_0x45b11c,_0x21038d[0x1],_0x3f95ee);_0x4bc627[_0x3bfa('0x17')][_0x21038d[0x1]]=_0x3f95ee;}}_0x1d0aac['next']();});}}catch(_0x56c8bb){logger[_0x3bfa('0x19')](_0x3bfa('0xa'),_0x45b11c,_['isObject'](_0x56c8bb)?JSON[_0x3bfa('0x1a')](_0x56c8bb):_0x56c8bb);logger[_0x3bfa('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x45b11c);_0x1d0aac[_0x3bfa('0xf')]();}};};
\ No newline at end of file
index 6b5bd60..8d7edb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2539=['[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x2539,0x197));var _0x9253=function(_0x553c6b,_0x6c8acb){_0x553c6b=_0x553c6b-0x0;var _0x1c9e32=_0x2539[_0x553c6b];return _0x1c9e32;};'use strict';var schema=require(_0x9253('0x0'));var _=require(_0x9253('0x1'));var rpc={'chatInteraction':require(_0x9253('0x2')),'openchannelInteraction':require(_0x9253('0x3')),'smsInteraction':require(_0x9253('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x9253('0x5'))};var logger=require(_0x9253('0x6'))(_0x9253('0x7'));var tag=schema({'tag':{'type':_0x9253('0x8'),'required':!![],'message':_0x9253('0x9')}});exports[_0x9253('0xa')]=function(_0xcd2774,_0x38dc76,_0x30d026,_0x5bf7c4){return function(_0x25bb6e){try{var _0x588327={'tag':_0x38dc76[0x0]};var _0x1b0d01=tag[_0x9253('0x0')](_0x588327,{'typecast':!![]});if(_0x1b0d01[_0x9253('0xb')]){logger[_0x9253('0xc')](_0x9253('0xd'),_0xcd2774,_[_0x9253('0xe')](_0x1b0d01,'message')[_0x9253('0xf')](',\x20'));logger[_0x9253('0x10')](_0x9253('0x11'),_0xcd2774);_0x25bb6e[_0x9253('0x12')]();}else{var _0xc95091={'ids':[_0x38dc76[0x0]]};if(rpc[_0x5bf7c4['channel']+_0x9253('0x13')]){rpc[_0x5bf7c4[_0x9253('0x14')]+_0x9253('0x13')][_0x9253('0x15')](_0x5bf7c4[_0x9253('0x16')]['id'],_0xc95091)[_0x9253('0x17')](function(_0xbed174){logger[_0x9253('0x10')](_0x9253('0x18'),_0xcd2774,_0x38dc76[0x1],_0x5bf7c4['channel'],_0x5bf7c4[_0x9253('0x16')]['id']);})[_0x9253('0x19')](function(_0x4e4170){logger['error'](_0x9253('0xd'),_0xcd2774,JSON[_0x9253('0x1a')](_0x4e4170));logger['info'](_0x9253('0x11'),_0xcd2774);})['finally'](function(){_0x25bb6e[_0x9253('0x12')]();});}}}catch(_0x192b93){logger['error'](_0x9253('0xd'),_0xcd2774,_[_0x9253('0x1b')](_0x192b93)?JSON['stringify'](_0x192b93):_0x192b93);logger[_0x9253('0x10')](_0x9253('0x11'),_0xcd2774);_0x25bb6e[_0x9253('0x12')]();}};};
\ No newline at end of file
+var _0x260b=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','channel','then','interaction','catch','stringify','finally','next','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../../../config/logger','number'];(function(_0x5cd818,_0x40e317){var _0x15fe50=function(_0x5da969){while(--_0x5da969){_0x5cd818['push'](_0x5cd818['shift']());}};_0x15fe50(++_0x40e317);}(_0x260b,0x16a));var _0xb260=function(_0x26e8f3,_0x2faf14){_0x26e8f3=_0x26e8f3-0x0;var _0x56e48f=_0x260b[_0x26e8f3];return _0x56e48f;};'use strict';var schema=require(_0xb260('0x0'));var _=require(_0xb260('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb260('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb260('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xb260('0x4'))('routing');var tag=schema({'tag':{'type':_0xb260('0x5'),'required':!![],'message':_0xb260('0x6')}});exports[_0xb260('0x7')]=function(_0xf8765d,_0x2e32d3,_0x49ccd3,_0x45c033){return function(_0x1f44e8){try{var _0xec4416={'tag':_0x2e32d3[0x0]};var _0x4f9829=tag['validate'](_0xec4416,{'typecast':!![]});if(_0x4f9829[_0xb260('0x8')]){logger['error'](_0xb260('0x9'),_0xf8765d,_['map'](_0x4f9829,_0xb260('0xa'))[_0xb260('0xb')](',\x20'));logger[_0xb260('0xc')](_0xb260('0xd'),_0xf8765d);_0x1f44e8['next']();}else{var _0x19049d={'ids':[_0x2e32d3[0x0]]};if(rpc[_0x45c033['channel']+_0xb260('0xe')]){rpc[_0x45c033[_0xb260('0xf')]+'Interaction']['addTags'](_0x45c033['interaction']['id'],_0x19049d)[_0xb260('0x10')](function(_0x20cea2){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0xf8765d,_0x2e32d3[0x1],_0x45c033['channel'],_0x45c033[_0xb260('0x11')]['id']);})[_0xb260('0x12')](function(_0x3ebeaa){logger['error'](_0xb260('0x9'),_0xf8765d,JSON[_0xb260('0x13')](_0x3ebeaa));logger[_0xb260('0xc')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xf8765d);})[_0xb260('0x14')](function(){_0x1f44e8[_0xb260('0x15')]();});}}}catch(_0x48f87f){logger['error'](_0xb260('0x9'),_0xf8765d,_[_0xb260('0x16')](_0x48f87f)?JSON['stringify'](_0x48f87f):_0x48f87f);logger['info'](_0xb260('0xd'),_0xf8765d);_0x1f44e8['next']();}};};
\ No newline at end of file
index 021f174..7d92a51 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(_0x4f8c31,_0x312386){var _0x5baae=function(_0x455604){while(--_0x455604){_0x4f8c31['push'](_0x4f8c31['shift']());}};_0x5baae(++_0x312386);}(_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
+var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x4105fd,_0x100d14){var _0x26b522=function(_0x33d48a){while(--_0x33d48a){_0x4105fd['push'](_0x4105fd['shift']());}};_0x26b522(++_0x100d14);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}};
\ No newline at end of file
index 9b52095..c213892 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1550=['.js','toLowerCase','split','channel','mail','push','slice','length','dialogflow','appdata','dialogflowv2','amazonlex','TagId','%s:%s:%s','./interval','condition','./applications/','consequence','priority','intervals','\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','agent','agents','busy','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','paused','mailQueues','loggedIn','name','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','message','interaction','applications','isArray','join','app'];(function(_0x4d44ae,_0x49a732){var _0x33bac5=function(_0x4b79a7){while(--_0x4b79a7){_0x4d44ae['push'](_0x4d44ae['shift']());}};_0x33bac5(++_0x49a732);}(_0x1550,0xfb));var _0x0155=function(_0x17a1dd,_0x1d36fd){_0x17a1dd=_0x17a1dd-0x0;var _0x3416ab=_0x1550[_0x17a1dd];return _0x3416ab;};'use strict';var _=require(_0x0155('0x0'));var util=require(_0x0155('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x0155('0x2'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0x0155('0x3'));var logger=require(_0x0155('0x4'))(_0x0155('0x5'));var rpc={'openchannelQueueReport':require(_0x0155('0x6')),'mailQueueReport':require(_0x0155('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x0155('0x8')),'whatsappQueueReport':require(_0x0155('0x9'))};var RuleEngine=require(_0x0155('0xa'));function getId(_0x501090,_0x2d2da9,_0x3557a5){return util[_0x0155('0xb')](_0x0155('0xc'),_0x501090,_0x2d2da9||0x0,_0x3557a5||0x0);}function getIntervals(_0x45f752,_0x30d807){var _0x221095=[];if(!_[_0x0155('0xd')](_0x30d807[_0x0155('0xe')])&&!_[_0x0155('0xd')](_0x45f752[_0x30d807['IntervalId']])&&!_['isNil'](_0x45f752[_0x30d807['IntervalId']][_0x0155('0xf')])){_0x221095=_[_0x0155('0x10')](_0x45f752[_0x30d807[_0x0155('0xe')]][_0x0155('0xf')],_0x0155('0x11'));}else if(!_[_0x0155('0xd')](_0x30d807[_0x0155('0x11')])){_0x221095=[_0x30d807[_0x0155('0x11')]];}return _0x221095;}exports['listen']=function(_0x33c32b){_0x33c32b[_0x0155('0x12')]={};return new BPromise(function(_0x31af45,_0x475723){var _0x1803dd={'Start':function(_0x11715f){var _0x536c0b=this;return new Promise(function(_0x359b0f,_0x3f552d){if(_0x11715f){try{var _0x16d987=[];var _0x4ca05b=getId(_0x11715f['channel'],_0x11715f[_0x0155('0x13')]?_0x11715f[_0x0155('0x13')]['id']:0x0,_0x11715f[_0x0155('0x14')]?_0x11715f[_0x0155('0x14')]['id']:0x0);if(_0x11715f[_0x0155('0x15')]&&_[_0x0155('0x16')](_0x11715f['applications'])&&_0x11715f[_0x0155('0x15')]['length']){for(var _0x53f436=0x0;_0x53f436<_0x11715f['applications']['length'];_0x53f436+=0x1){var _0x584738=_0x11715f[_0x0155('0x15')][_0x53f436];if(fs['existsSync'](path[_0x0155('0x17')](__dirname,_0x0155('0x15'),_0x584738[_0x0155('0x18')]+_0x0155('0x19')))){var _0x47e5ea=[];switch(_0x584738['app'][_0x0155('0x1a')]()){case'autoreply':var _0x2a65c2=_0x584738['appdata'][_0x0155('0x1b')](',');if(_0x11715f[_0x0155('0x1c')]===_0x0155('0x1d')){_0x47e5ea[_0x0155('0x1e')](_0x2a65c2[0x0]);_0x47e5ea[_0x0155('0x1e')](_0x2a65c2[0x1]);_0x47e5ea['push'](_0x2a65c2[_0x0155('0x1f')](0x2,_0x2a65c2[_0x0155('0x20')])[_0x0155('0x17')](','));}else{_0x47e5ea[_0x0155('0x1e')](_0x2a65c2[0x0]);_0x47e5ea[_0x0155('0x1e')](_0x2a65c2['slice'](0x1,_0x2a65c2[_0x0155('0x20')])[_0x0155('0x17')](','));}break;case _0x0155('0x21'):var _0x3f1901=_0x584738[_0x0155('0x22')][_0x0155('0x1b')](',');_0x47e5ea['push'](_0x3f1901[0x0]);_0x47e5ea['push'](_0x3f1901[0x1]);_0x47e5ea[_0x0155('0x1e')](_0x3f1901[_0x0155('0x1f')](0x2,_0x3f1901[_0x0155('0x20')])['join'](','));break;case _0x0155('0x23'):var _0x16b10c=_0x584738[_0x0155('0x22')]['split'](',');_0x47e5ea['push'](_0x16b10c[0x0]);_0x47e5ea[_0x0155('0x1e')](_0x16b10c[0x1]);_0x47e5ea[_0x0155('0x1e')](_0x16b10c[0x2]);_0x47e5ea[_0x0155('0x1e')](_0x16b10c[0x3]);_0x47e5ea[_0x0155('0x1e')](_0x16b10c[_0x0155('0x1f')](0x4,_0x16b10c[_0x0155('0x20')])[_0x0155('0x17')](','));break;case _0x0155('0x24'):var _0x56089e=_0x584738[_0x0155('0x22')]['split'](',');_0x47e5ea[_0x0155('0x1e')](_0x56089e[0x0]);_0x47e5ea['push'](_0x56089e[0x1]);_0x47e5ea[_0x0155('0x1e')](_0x56089e[0x2]);_0x47e5ea[_0x0155('0x1e')](_0x56089e[0x3]);_0x47e5ea['push'](_0x56089e['slice'](0x4,_0x56089e['length'])[_0x0155('0x17')](','));break;case _0x0155('0x13'):_0x47e5ea[_0x0155('0x1e')](_0x584738[_0x0155('0x22')]);break;case'tag':_0x47e5ea[_0x0155('0x1e')](_0x584738[_0x0155('0x25')]);_0x47e5ea['push'](_0x584738[_0x0155('0x22')]);break;default:_0x47e5ea=_[_0x0155('0xd')](_0x584738[_0x0155('0x22')])?[]:_0x584738['appdata'][_0x0155('0x1b')](',');}var _0x54a3db={'id':util[_0x0155('0xb')](_0x0155('0x26'),_0x4ca05b,_0x584738['id'],_0x584738['app']),'condition':require(_0x0155('0x27'))[_0x0155('0x28')](_0x4ca05b,getIntervals(_0x33c32b['intervals'],_0x584738),_0x33c32b),'consequence':require(_0x0155('0x29')+_0x584738[_0x0155('0x18')])[_0x0155('0x2a')](_0x4ca05b,_0x47e5ea,_0x33c32b,_0x11715f),'p':_0x584738[_0x0155('0x2b')]||0x0};logger['info']('Push\x20new\x20rule',_0x54a3db['id'],'on\x20interval',getIntervals(_0x33c32b[_0x0155('0x2c')],_0x584738)['join'](_0x0155('0x2d')));_0x16d987[_0x0155('0x1e')](_0x54a3db);}else{logger[_0x0155('0x2e')](_0x0155('0x2f'),path[_0x0155('0x17')](__dirname,_0x0155('0x15'),_0x584738[_0x0155('0x18')]+_0x0155('0x19')));}}_0x33c32b[_0x0155('0x12')][_0x4ca05b]=new RuleEngine(_0x16d987);_0x33c32b[_0x0155('0x12')][_0x4ca05b][_0x0155('0x30')](_0x11715f,function(_0x36470f){logger[_0x0155('0x31')](_0x0155('0x32'),JSON[_0x0155('0x33')](_0x36470f[_0x0155('0x34')]));if(_0x33c32b[_0x0155('0x12')][_0x4ca05b]){_0x33c32b['rules'][_0x4ca05b][_0x0155('0x35')](_0x0155('0x36'));}});return _0x359b0f({'code':0xc8,'message':_0x11715f});}else{logger[_0x0155('0x31')](_0x0155('0x37'));return _0x359b0f({'code':0xc8,'message':_0x11715f});}}catch(_0xfe52a7){logger['error'](_0xfe52a7[_0x0155('0x38')]);return _0x3f552d(_0x536c0b['error'](0x1f4,_0xfe52a7));}}return _0x3f552d(_0x0155('0x39'));});},'AcceptMessage':function(_0x318c00){var _0x951e17=this;return new Promise(function(_0x1c5f2c,_0x53a7db){if(_0x318c00[_0x0155('0x3a')]&&_0x318c00[_0x0155('0x3a')]['id']){if(_0x33c32b[_0x0155('0x3b')][_0x318c00[_0x0155('0x3a')]['id']]){_0x33c32b[_0x0155('0x3b')][_0x318c00['agent']['id']][_0x0155('0x3c')]=![];_0x33c32b[_0x0155('0x3b')][_0x318c00[_0x0155('0x3a')]['id']]['busyQueue']=undefined;}}if(_0x318c00[_0x0155('0x13')]&&_0x318c00[_0x0155('0x13')]['id']){try{var _0x3927f3=getId(_0x318c00['channel'],_0x318c00[_0x0155('0x13')]?_0x318c00[_0x0155('0x13')]['id']:0x0,_0x318c00['interaction']?_0x318c00[_0x0155('0x14')]['id']:0x0);if(_0x33c32b[_0x0155('0x12')][_0x3927f3]){_0x33c32b[_0x0155('0x12')][_0x3927f3]['emit'](_0x0155('0x3d'));if(rpc[_0x318c00[_0x0155('0x1c')]+_0x0155('0x3e')]){rpc[_0x318c00[_0x0155('0x1c')]+_0x0155('0x3e')][_0x0155('0x3f')](_0x3927f3,{'UserId':_0x318c00[_0x0155('0x13')][_0x0155('0x40')]})['catch'](function(_0x5ae4b1){logger[_0x0155('0x2e')](_0x0155('0x41'));});}}return _0x1c5f2c({'code':0xc8,'message':_0x318c00});}catch(_0x4e7a23){logger[_0x0155('0x2e')](_0x4e7a23['stack']);return _0x53a7db(_0x951e17[_0x0155('0x2e')](0x1f4,_0x4e7a23));}}logger['error']('message\x20is\x20empty');return _0x53a7db(_0x951e17[_0x0155('0x2e')](0x1f4,_0x0155('0x42')));});},'RejectMessage':function(_0x2b996c){var _0x186a5f=this;return new Promise(function(_0x787064,_0x3477db){if(_0x2b996c['agent']&&_0x2b996c['agent']['id']){try{if(_0x33c32b[_0x0155('0x3b')][_0x2b996c[_0x0155('0x3a')]['id']]){_0x33c32b[_0x0155('0x3b')][_0x2b996c[_0x0155('0x3a')]['id']]['busy']=![];_0x33c32b['agents'][_0x2b996c[_0x0155('0x3a')]['id']]['busyQueue']=undefined;}return _0x787064({'code':0xc8,'message':_0x2b996c});}catch(_0x283233){logger['error'](_0x283233[_0x0155('0x38')]);return _0x3477db(_0x186a5f[_0x0155('0x2e')](0x1f4,_0x283233));}}logger[_0x0155('0x2e')](_0x0155('0x42'));return _0x3477db(_0x186a5f[_0x0155('0x2e')](0x1f4,_0x0155('0x42')));});},'AbandonInteraction':function(_0x59a95b){var _0x14cee1=this;return new Promise(function(_0x33021f,_0x74c78f){if(_0x59a95b[_0x0155('0x1c')]&&_0x59a95b[_0x0155('0x14')]&&_0x59a95b[_0x0155('0x14')]['id']){try{var _0x2d579a=getId(_0x59a95b[_0x0155('0x1c')],_0x59a95b['message']?_0x59a95b['message']['id']:0x0,_0x59a95b[_0x0155('0x14')]?_0x59a95b[_0x0155('0x14')]['id']:0x0);if(_0x33c32b[_0x0155('0x12')][_0x2d579a]){_0x33c32b['rules'][_0x2d579a][_0x0155('0x35')](_0x0155('0x3d'));}return _0x33021f({'code':0xc8,'message':_0x59a95b});}catch(_0x20642b){logger[_0x0155('0x2e')](_0x20642b['stack']);return _0x74c78f(_0x14cee1[_0x0155('0x2e')](0x1f4,_0x20642b));}}logger['error'](_0x0155('0x42'));return _0x74c78f(_0x14cee1[_0x0155('0x2e')](0x1f4,_0x0155('0x42')));});},'AgentCapacity':function(_0x2a3e59){var _0x90eea4=this;return new Promise(function(_0x3b70a5,_0x5a14ee){if(_0x33c32b[_0x0155('0x3b')][_0x0155('0x43')](_0x2a3e59['id'])){for(var _0xe1d3d0 in _0x2a3e59['capacity']){if(_0x2a3e59[_0x0155('0x44')][_0x0155('0x43')](_0xe1d3d0)){if(_0x33c32b[_0x0155('0x3b')][_0x2a3e59['id']]['hasOwnProperty'](_0xe1d3d0+_0x0155('0x45'))){_0x33c32b[_0x0155('0x3b')][_0x2a3e59['id']][_0xe1d3d0+_0x0155('0x45')]=parseInt(_0x2a3e59['capacity'][_0xe1d3d0],0xa);}}}_0x33c32b[_0x0155('0x3b')][_0x2a3e59['id']][_0x0155('0x46')]();return _0x3b70a5({'code':0xc8,'message':_0x33c32b['agents'][_0x2a3e59['id']]});}else{return _0x5a14ee(_0x90eea4[_0x0155('0x2e')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xdc2bc1){return new Promise(function(_0x2698c7,_0x255dcc){var _0x262010=_[_0x0155('0x47')](_0x33c32b[_0x0155('0x3b')]);_0x2698c7({'count':_0x262010[_0x0155('0x20')],'rows':_0x262010});});},'ChatQueues':function(_0x190346){return new Promise(function(_0x22819f,_0x6eae04){var _0x3abe9b=[];for(var _0x22d1c1 in _0x33c32b[_0x0155('0x48')]){if(_0x33c32b[_0x0155('0x48')]['hasOwnProperty'](_0x22d1c1)){var _0x54ea3e=_0x33c32b[_0x0155('0x48')][_0x22d1c1];var _0x5b7c74={'id':_0x54ea3e['id'],'available':_0x54ea3e[_0x0155('0x49')],'loggedIn':_0x54ea3e['loggedIn'],'name':_0x54ea3e['name'],'paused':_0x54ea3e[_0x0155('0x4a')],'waiting':_0x54ea3e['waiting']};_0x3abe9b[_0x0155('0x1e')](_0x5b7c74);}}_0x22819f({'count':_0x3abe9b[_0x0155('0x20')],'rows':_0x3abe9b});});},'MailQueues':function(_0x3e6992){return new Promise(function(_0x3d37ef,_0x42322f){var _0x7f5b19=[];for(var _0x59abc6 in _0x33c32b[_0x0155('0x4b')]){if(_0x33c32b[_0x0155('0x4b')][_0x0155('0x43')](_0x59abc6)){var _0x293009=_0x33c32b[_0x0155('0x4b')][_0x59abc6];var _0x2bde25={'id':_0x293009['id'],'available':_0x293009[_0x0155('0x49')],'loggedIn':_0x293009[_0x0155('0x4c')],'name':_0x293009[_0x0155('0x4d')],'paused':_0x293009[_0x0155('0x4a')],'waiting':_0x293009['waiting']};_0x7f5b19['push'](_0x2bde25);}}_0x3d37ef({'count':_0x7f5b19[_0x0155('0x20')],'rows':_0x7f5b19});});},'OpenchannelQueues':function(_0x614b14){return new Promise(function(_0x16b65d,_0x1eff62){var _0x84c6c8=[];for(var _0x4723d2 in _0x33c32b[_0x0155('0x4e')]){if(_0x33c32b['openchannelQueues'][_0x0155('0x43')](_0x4723d2)){var _0x89037f=_0x33c32b[_0x0155('0x4e')][_0x4723d2];var _0xf8662d={'id':_0x89037f['id'],'available':_0x89037f[_0x0155('0x49')],'loggedIn':_0x89037f['loggedIn'],'name':_0x89037f['name'],'paused':_0x89037f['paused'],'waiting':_0x89037f[_0x0155('0x4f')]};_0x84c6c8[_0x0155('0x1e')](_0xf8662d);}}_0x16b65d({'count':_0x84c6c8[_0x0155('0x20')],'rows':_0x84c6c8});});},'SmsQueues':function(_0x15b15c){return new Promise(function(_0x258deb,_0x2fca6d){var _0x2784f0=[];for(var _0x1c8966 in _0x33c32b[_0x0155('0x50')]){if(_0x33c32b['smsQueues'][_0x0155('0x43')](_0x1c8966)){var _0x484223=_0x33c32b[_0x0155('0x50')][_0x1c8966];var _0x145498={'id':_0x484223['id'],'available':_0x484223['available'],'loggedIn':_0x484223[_0x0155('0x4c')],'name':_0x484223[_0x0155('0x4d')],'paused':_0x484223[_0x0155('0x4a')],'waiting':_0x484223[_0x0155('0x4f')]};_0x2784f0['push'](_0x145498);}}_0x258deb({'count':_0x2784f0[_0x0155('0x20')],'rows':_0x2784f0});});},'FaxQueues':function(_0x4f3348){return new Promise(function(_0xa8931f,_0x5e136b){var _0x1ead64=[];for(var _0x2bdf4d in _0x33c32b[_0x0155('0x51')]){if(_0x33c32b[_0x0155('0x51')]['hasOwnProperty'](_0x2bdf4d)){var _0x1b460c=_0x33c32b[_0x0155('0x51')][_0x2bdf4d];var _0x3fb59d={'id':_0x1b460c['id'],'available':_0x1b460c['available'],'loggedIn':_0x1b460c[_0x0155('0x4c')],'name':_0x1b460c[_0x0155('0x4d')],'paused':_0x1b460c[_0x0155('0x4a')],'waiting':_0x1b460c[_0x0155('0x4f')]};_0x1ead64[_0x0155('0x1e')](_0x3fb59d);}}_0xa8931f({'count':_0x1ead64['length'],'rows':_0x1ead64});});},'WhatsappQueues':function(_0x90aaf9){return new Promise(function(_0xfdd53e,_0x3ab324){var _0x4ba934=[];for(var _0x52e00c in _0x33c32b[_0x0155('0x52')]){if(_0x33c32b[_0x0155('0x52')][_0x0155('0x43')](_0x52e00c)){var _0x1eef0a=_0x33c32b[_0x0155('0x52')][_0x52e00c];var _0x28887f={'id':_0x1eef0a['id'],'available':_0x1eef0a[_0x0155('0x49')],'loggedIn':_0x1eef0a[_0x0155('0x4c')],'name':_0x1eef0a[_0x0155('0x4d')],'paused':_0x1eef0a[_0x0155('0x4a')],'waiting':_0x1eef0a['waiting']};_0x4ba934[_0x0155('0x1e')](_0x28887f);}}_0xfdd53e({'count':_0x4ba934[_0x0155('0x20')],'rows':_0x4ba934});});},'ChatQueuesWaitingInteractions':function(_0xf0102a){return new Promise(function(_0x51b950,_0x3d2800){var _0x2259df=_[_0x0155('0x47')](_0x33c32b['chatQueuesWaitingInteractions']);_0x51b950({'count':_0x2259df['length'],'rows':_0x2259df});});},'MailQueuesWaitingInteractions':function(_0x1fea5d){return new Promise(function(_0x266923,_0x2761ae){var _0x1bca44=_[_0x0155('0x47')](_0x33c32b['mailQueuesWaitingInteractions']);_0x266923({'count':_0x1bca44[_0x0155('0x20')],'rows':_0x1bca44});});},'OpenchannelQueuesWaitingInteractions':function(_0x5754a4){return new Promise(function(_0x12878d,_0x500688){var _0x32d075=_[_0x0155('0x47')](_0x33c32b[_0x0155('0x53')]);_0x12878d({'count':_0x32d075['length'],'rows':_0x32d075});});},'SmsQueuesWaitingInteractions':function(_0x4d3a1f){return new Promise(function(_0x53a401,_0x1e1031){var _0x588e9f=_['values'](_0x33c32b[_0x0155('0x54')]);_0x53a401({'count':_0x588e9f[_0x0155('0x20')],'rows':_0x588e9f});});},'FaxQueuesWaitingInteractions':function(_0x1e997b){return new Promise(function(_0x409bce,_0x181049){var _0x5ed322=_[_0x0155('0x47')](_0x33c32b[_0x0155('0x55')]);_0x409bce({'count':_0x5ed322[_0x0155('0x20')],'rows':_0x5ed322});});},'WhatsappQueuesWaitingInteractions':function(_0x20aa38){return new Promise(function(_0x2bfa44,_0x341763){var _0x3fb9f0=_[_0x0155('0x47')](_0x33c32b['whatsappQueuesWaitingInteractions']);_0x2bfa44({'count':_0x3fb9f0['length'],'rows':_0x3fb9f0});});}};var _0x1eec3f=jayson[_0x0155('0x56')](_0x1803dd)[_0x0155('0x57')]();_0x1eec3f['on']('error',function(_0x4ececd){logger['error'](JSON[_0x0155('0x33')](_0x4ececd));return _0x475723(_0x4ececd);});_0x1eec3f[_0x0155('0x58')](0x232c,'127.0.0.1',function(){console[_0x0155('0x59')](_0x0155('0x5a'),0x232c);return _0x31af45(_0x0155('0x5b')+0x232c);});});};
\ No newline at end of file
+var _0xc922=['condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','interaction','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','applications','length','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','./interval'];(function(_0x4cd2a7,_0x278721){var _0xbc0f34=function(_0xb402e6){while(--_0xb402e6){_0x4cd2a7['push'](_0x4cd2a7['shift']());}};_0xbc0f34(++_0x278721);}(_0xc922,0x1b0));var _0x2c92=function(_0x383ba9,_0x594faa){_0x383ba9=_0x383ba9-0x0;var _0x3e0b28=_0xc922[_0x383ba9];return _0x3e0b28;};'use strict';var _=require('lodash');var util=require(_0x2c92('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x2c92('0x1'));var BPromise=require(_0x2c92('0x2'));var uuid=require('uuid');var config=require(_0x2c92('0x3'));var logger=require(_0x2c92('0x4'))(_0x2c92('0x5'));var rpc={'openchannelQueueReport':require(_0x2c92('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x2c92('0x7')),'whatsappQueueReport':require(_0x2c92('0x8'))};var RuleEngine=require(_0x2c92('0x9'));function getId(_0x63f080,_0x1ed25f,_0x430ab4){return util[_0x2c92('0xa')]('%s.%s.%s',_0x63f080,_0x1ed25f||0x0,_0x430ab4||0x0);}function getIntervals(_0x4045c9,_0x57ca9b){var _0x2747fe=[];if(!_[_0x2c92('0xb')](_0x57ca9b[_0x2c92('0xc')])&&!_['isNil'](_0x4045c9[_0x57ca9b['IntervalId']])&&!_['isNil'](_0x4045c9[_0x57ca9b[_0x2c92('0xc')]][_0x2c92('0xd')])){_0x2747fe=_['map'](_0x4045c9[_0x57ca9b[_0x2c92('0xc')]][_0x2c92('0xd')],_0x2c92('0xe'));}else if(!_[_0x2c92('0xb')](_0x57ca9b[_0x2c92('0xe')])){_0x2747fe=[_0x57ca9b['interval']];}return _0x2747fe;}exports[_0x2c92('0xf')]=function(_0x46d09f){_0x46d09f[_0x2c92('0x10')]={};return new BPromise(function(_0x595a01,_0x5ab565){var _0x3eb15f={'Start':function(_0x8a41b0){var _0x4831d4=this;return new Promise(function(_0x111cf0,_0x31942e){if(_0x8a41b0){try{var _0x5ed358=[];var _0x3e5193=getId(_0x8a41b0[_0x2c92('0x11')],_0x8a41b0['message']?_0x8a41b0[_0x2c92('0x12')]['id']:0x0,_0x8a41b0['interaction']?_0x8a41b0['interaction']['id']:0x0);if(_0x8a41b0['applications']&&_['isArray'](_0x8a41b0['applications'])&&_0x8a41b0[_0x2c92('0x13')][_0x2c92('0x14')]){for(var _0x1b6ec8=0x0;_0x1b6ec8<_0x8a41b0['applications'][_0x2c92('0x14')];_0x1b6ec8+=0x1){var _0x4b6f8b=_0x8a41b0['applications'][_0x1b6ec8];if(fs[_0x2c92('0x15')](path[_0x2c92('0x16')](__dirname,_0x2c92('0x13'),_0x4b6f8b[_0x2c92('0x17')]+_0x2c92('0x18')))){var _0x544a24=[];switch(_0x4b6f8b[_0x2c92('0x17')][_0x2c92('0x19')]()){case'autoreply':var _0x1bd465=_0x4b6f8b[_0x2c92('0x1a')][_0x2c92('0x1b')](',');if(_0x8a41b0[_0x2c92('0x11')]===_0x2c92('0x1c')){_0x544a24['push'](_0x1bd465[0x0]);_0x544a24[_0x2c92('0x1d')](_0x1bd465[0x1]);_0x544a24[_0x2c92('0x1d')](_0x1bd465[_0x2c92('0x1e')](0x2,_0x1bd465[_0x2c92('0x14')])['join'](','));}else{_0x544a24[_0x2c92('0x1d')](_0x1bd465[0x0]);_0x544a24[_0x2c92('0x1d')](_0x1bd465[_0x2c92('0x1e')](0x1,_0x1bd465[_0x2c92('0x14')])[_0x2c92('0x16')](','));}break;case _0x2c92('0x1f'):var _0x5f3c44=_0x4b6f8b['appdata'][_0x2c92('0x1b')](',');_0x544a24[_0x2c92('0x1d')](_0x5f3c44[0x0]);_0x544a24[_0x2c92('0x1d')](_0x5f3c44[0x1]);_0x544a24[_0x2c92('0x1d')](_0x5f3c44['slice'](0x2,_0x5f3c44['length'])[_0x2c92('0x16')](','));break;case _0x2c92('0x20'):var _0x5eb2d6=_0x4b6f8b['appdata'][_0x2c92('0x1b')](',');_0x544a24[_0x2c92('0x1d')](_0x5eb2d6[0x0]);_0x544a24[_0x2c92('0x1d')](_0x5eb2d6[0x1]);_0x544a24[_0x2c92('0x1d')](_0x5eb2d6[0x2]);_0x544a24[_0x2c92('0x1d')](_0x5eb2d6[0x3]);_0x544a24[_0x2c92('0x1d')](_0x5eb2d6[_0x2c92('0x1e')](0x4,_0x5eb2d6[_0x2c92('0x14')])[_0x2c92('0x16')](','));break;case _0x2c92('0x21'):var _0x2c22a7=_0x4b6f8b[_0x2c92('0x1a')][_0x2c92('0x1b')](',');_0x544a24[_0x2c92('0x1d')](_0x2c22a7[0x0]);_0x544a24[_0x2c92('0x1d')](_0x2c22a7[0x1]);_0x544a24['push'](_0x2c22a7[0x2]);_0x544a24[_0x2c92('0x1d')](_0x2c22a7[0x3]);_0x544a24['push'](_0x2c22a7[_0x2c92('0x1e')](0x4,_0x2c22a7[_0x2c92('0x14')])[_0x2c92('0x16')](','));break;case _0x2c92('0x12'):_0x544a24[_0x2c92('0x1d')](_0x4b6f8b[_0x2c92('0x1a')]);break;case _0x2c92('0x22'):_0x544a24[_0x2c92('0x1d')](_0x4b6f8b[_0x2c92('0x23')]);_0x544a24[_0x2c92('0x1d')](_0x4b6f8b['appdata']);break;default:_0x544a24=_[_0x2c92('0xb')](_0x4b6f8b[_0x2c92('0x1a')])?[]:_0x4b6f8b['appdata'][_0x2c92('0x1b')](',');}var _0x48e84a={'id':util[_0x2c92('0xa')](_0x2c92('0x24'),_0x3e5193,_0x4b6f8b['id'],_0x4b6f8b[_0x2c92('0x17')]),'condition':require(_0x2c92('0x25'))[_0x2c92('0x26')](_0x3e5193,getIntervals(_0x46d09f[_0x2c92('0x27')],_0x4b6f8b),_0x46d09f),'consequence':require(_0x2c92('0x28')+_0x4b6f8b['app'])[_0x2c92('0x29')](_0x3e5193,_0x544a24,_0x46d09f,_0x8a41b0),'p':_0x4b6f8b['priority']||0x0};logger[_0x2c92('0x2a')](_0x2c92('0x2b'),_0x48e84a['id'],_0x2c92('0x2c'),getIntervals(_0x46d09f['intervals'],_0x4b6f8b)[_0x2c92('0x16')](_0x2c92('0x2d')));_0x5ed358[_0x2c92('0x1d')](_0x48e84a);}else{logger[_0x2c92('0x2e')](_0x2c92('0x2f'),path[_0x2c92('0x16')](__dirname,'applications',_0x4b6f8b[_0x2c92('0x17')]+_0x2c92('0x18')));}}_0x46d09f[_0x2c92('0x10')][_0x3e5193]=new RuleEngine(_0x5ed358);_0x46d09f[_0x2c92('0x10')][_0x3e5193][_0x2c92('0x30')](_0x8a41b0,function(_0xf502f9){logger[_0x2c92('0x2a')](_0x2c92('0x31'),JSON[_0x2c92('0x32')](_0xf502f9[_0x2c92('0x33')]));if(_0x46d09f[_0x2c92('0x10')][_0x3e5193]){_0x46d09f['rules'][_0x3e5193][_0x2c92('0x34')](_0x2c92('0x35'));}});return _0x111cf0({'code':0xc8,'message':_0x8a41b0});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x111cf0({'code':0xc8,'message':_0x8a41b0});}}catch(_0x2f2f09){logger[_0x2c92('0x2e')](_0x2f2f09[_0x2c92('0x36')]);return _0x31942e(_0x4831d4['error'](0x1f4,_0x2f2f09));}}return _0x31942e(_0x2c92('0x37'));});},'AcceptMessage':function(_0x2d0ec8){var _0x2034a2=this;return new Promise(function(_0x1522ba,_0x47d5df){if(_0x2d0ec8[_0x2c92('0x38')]&&_0x2d0ec8[_0x2c92('0x38')]['id']){if(_0x46d09f[_0x2c92('0x39')][_0x2d0ec8[_0x2c92('0x38')]['id']]){_0x46d09f[_0x2c92('0x39')][_0x2d0ec8[_0x2c92('0x38')]['id']]['busy']=![];_0x46d09f[_0x2c92('0x39')][_0x2d0ec8['agent']['id']][_0x2c92('0x3a')]=undefined;}}if(_0x2d0ec8['message']&&_0x2d0ec8[_0x2c92('0x12')]['id']){try{var _0x19c2e5=getId(_0x2d0ec8[_0x2c92('0x11')],_0x2d0ec8[_0x2c92('0x12')]?_0x2d0ec8[_0x2c92('0x12')]['id']:0x0,_0x2d0ec8['interaction']?_0x2d0ec8['interaction']['id']:0x0);if(_0x46d09f[_0x2c92('0x10')][_0x19c2e5]){_0x46d09f[_0x2c92('0x10')][_0x19c2e5]['emit'](_0x2c92('0x3b'));if(rpc[_0x2d0ec8[_0x2c92('0x11')]+'QueueReport']){rpc[_0x2d0ec8[_0x2c92('0x11')]+'QueueReport'][_0x2c92('0x3c')](_0x19c2e5,{'UserId':_0x2d0ec8[_0x2c92('0x12')][_0x2c92('0x3d')]})[_0x2c92('0x3e')](function(_0x44647f){logger['error'](_0x2c92('0x3f'));});}}return _0x1522ba({'code':0xc8,'message':_0x2d0ec8});}catch(_0x65e97){logger['error'](_0x65e97['stack']);return _0x47d5df(_0x2034a2[_0x2c92('0x2e')](0x1f4,_0x65e97));}}logger[_0x2c92('0x2e')](_0x2c92('0x40'));return _0x47d5df(_0x2034a2['error'](0x1f4,_0x2c92('0x40')));});},'RejectMessage':function(_0x9ab0d0){var _0x1bc070=this;return new Promise(function(_0x54bee4,_0x20e090){if(_0x9ab0d0[_0x2c92('0x38')]&&_0x9ab0d0[_0x2c92('0x38')]['id']){try{if(_0x46d09f[_0x2c92('0x39')][_0x9ab0d0[_0x2c92('0x38')]['id']]){_0x46d09f[_0x2c92('0x39')][_0x9ab0d0['agent']['id']][_0x2c92('0x41')]=![];_0x46d09f[_0x2c92('0x39')][_0x9ab0d0[_0x2c92('0x38')]['id']][_0x2c92('0x3a')]=undefined;}return _0x54bee4({'code':0xc8,'message':_0x9ab0d0});}catch(_0x5a12c2){logger[_0x2c92('0x2e')](_0x5a12c2['stack']);return _0x20e090(_0x1bc070[_0x2c92('0x2e')](0x1f4,_0x5a12c2));}}logger['error'](_0x2c92('0x40'));return _0x20e090(_0x1bc070[_0x2c92('0x2e')](0x1f4,_0x2c92('0x40')));});},'AbandonInteraction':function(_0x34fb4a){var _0x2f1510=this;return new Promise(function(_0x4f3dfc,_0x9c6af5){if(_0x34fb4a[_0x2c92('0x11')]&&_0x34fb4a[_0x2c92('0x42')]&&_0x34fb4a[_0x2c92('0x42')]['id']){try{var _0x1f9093=getId(_0x34fb4a[_0x2c92('0x11')],_0x34fb4a['message']?_0x34fb4a[_0x2c92('0x12')]['id']:0x0,_0x34fb4a[_0x2c92('0x42')]?_0x34fb4a[_0x2c92('0x42')]['id']:0x0);if(_0x46d09f[_0x2c92('0x10')][_0x1f9093]){_0x46d09f[_0x2c92('0x10')][_0x1f9093][_0x2c92('0x34')](_0x2c92('0x3b'));}return _0x4f3dfc({'code':0xc8,'message':_0x34fb4a});}catch(_0x405e50){logger['error'](_0x405e50['stack']);return _0x9c6af5(_0x2f1510[_0x2c92('0x2e')](0x1f4,_0x405e50));}}logger[_0x2c92('0x2e')](_0x2c92('0x40'));return _0x9c6af5(_0x2f1510[_0x2c92('0x2e')](0x1f4,_0x2c92('0x40')));});},'AgentCapacity':function(_0x19cbe2){var _0xa7fd3e=this;return new Promise(function(_0xce86c8,_0x2c5144){if(_0x46d09f['agents']['hasOwnProperty'](_0x19cbe2['id'])){for(var _0x4ba725 in _0x19cbe2[_0x2c92('0x43')]){if(_0x19cbe2['capacity']['hasOwnProperty'](_0x4ba725)){if(_0x46d09f[_0x2c92('0x39')][_0x19cbe2['id']][_0x2c92('0x44')](_0x4ba725+_0x2c92('0x45'))){_0x46d09f[_0x2c92('0x39')][_0x19cbe2['id']][_0x4ba725+_0x2c92('0x45')]=parseInt(_0x19cbe2[_0x2c92('0x43')][_0x4ba725],0xa);}}}_0x46d09f[_0x2c92('0x39')][_0x19cbe2['id']][_0x2c92('0x46')]();return _0xce86c8({'code':0xc8,'message':_0x46d09f[_0x2c92('0x39')][_0x19cbe2['id']]});}else{return _0x2c5144(_0xa7fd3e[_0x2c92('0x2e')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x36d69f){return new Promise(function(_0x3c3114,_0x5db7d1){var _0x11c510=_[_0x2c92('0x47')](_0x46d09f[_0x2c92('0x39')]);_0x3c3114({'count':_0x11c510['length'],'rows':_0x11c510});});},'ChatQueues':function(_0x2ad966){return new Promise(function(_0x4e899a,_0x59327e){var _0x1132cc=[];for(var _0x325aa8 in _0x46d09f['chatQueues']){if(_0x46d09f[_0x2c92('0x48')]['hasOwnProperty'](_0x325aa8)){var _0x1a8776=_0x46d09f[_0x2c92('0x48')][_0x325aa8];var _0x1e0001={'id':_0x1a8776['id'],'available':_0x1a8776[_0x2c92('0x49')],'loggedIn':_0x1a8776[_0x2c92('0x4a')],'name':_0x1a8776[_0x2c92('0x4b')],'paused':_0x1a8776[_0x2c92('0x4c')],'waiting':_0x1a8776[_0x2c92('0x4d')]};_0x1132cc[_0x2c92('0x1d')](_0x1e0001);}}_0x4e899a({'count':_0x1132cc[_0x2c92('0x14')],'rows':_0x1132cc});});},'MailQueues':function(_0x4f2910){return new Promise(function(_0x15fb65,_0x38b499){var _0x4bab98=[];for(var _0x5246e3 in _0x46d09f[_0x2c92('0x4e')]){if(_0x46d09f['mailQueues'][_0x2c92('0x44')](_0x5246e3)){var _0x199d04=_0x46d09f['mailQueues'][_0x5246e3];var _0x52864b={'id':_0x199d04['id'],'available':_0x199d04['available'],'loggedIn':_0x199d04[_0x2c92('0x4a')],'name':_0x199d04[_0x2c92('0x4b')],'paused':_0x199d04[_0x2c92('0x4c')],'waiting':_0x199d04[_0x2c92('0x4d')]};_0x4bab98[_0x2c92('0x1d')](_0x52864b);}}_0x15fb65({'count':_0x4bab98['length'],'rows':_0x4bab98});});},'OpenchannelQueues':function(_0x12f2e4){return new Promise(function(_0x311b30,_0xab38a7){var _0x17e0cf=[];for(var _0x5c0e7d in _0x46d09f[_0x2c92('0x4f')]){if(_0x46d09f[_0x2c92('0x4f')][_0x2c92('0x44')](_0x5c0e7d)){var _0x4381b1=_0x46d09f['openchannelQueues'][_0x5c0e7d];var _0x430204={'id':_0x4381b1['id'],'available':_0x4381b1[_0x2c92('0x49')],'loggedIn':_0x4381b1[_0x2c92('0x4a')],'name':_0x4381b1[_0x2c92('0x4b')],'paused':_0x4381b1[_0x2c92('0x4c')],'waiting':_0x4381b1['waiting']};_0x17e0cf[_0x2c92('0x1d')](_0x430204);}}_0x311b30({'count':_0x17e0cf[_0x2c92('0x14')],'rows':_0x17e0cf});});},'SmsQueues':function(_0x45e3fe){return new Promise(function(_0x35cfed,_0x20f411){var _0x26e568=[];for(var _0x487f89 in _0x46d09f[_0x2c92('0x50')]){if(_0x46d09f[_0x2c92('0x50')]['hasOwnProperty'](_0x487f89)){var _0x2aa670=_0x46d09f[_0x2c92('0x50')][_0x487f89];var _0x39e919={'id':_0x2aa670['id'],'available':_0x2aa670['available'],'loggedIn':_0x2aa670[_0x2c92('0x4a')],'name':_0x2aa670[_0x2c92('0x4b')],'paused':_0x2aa670[_0x2c92('0x4c')],'waiting':_0x2aa670[_0x2c92('0x4d')]};_0x26e568[_0x2c92('0x1d')](_0x39e919);}}_0x35cfed({'count':_0x26e568[_0x2c92('0x14')],'rows':_0x26e568});});},'FaxQueues':function(_0x51f5fe){return new Promise(function(_0x484264,_0x21a64c){var _0x510dd0=[];for(var _0x3307bd in _0x46d09f[_0x2c92('0x51')]){if(_0x46d09f[_0x2c92('0x51')][_0x2c92('0x44')](_0x3307bd)){var _0x5988e2=_0x46d09f[_0x2c92('0x51')][_0x3307bd];var _0x2f4322={'id':_0x5988e2['id'],'available':_0x5988e2['available'],'loggedIn':_0x5988e2['loggedIn'],'name':_0x5988e2[_0x2c92('0x4b')],'paused':_0x5988e2[_0x2c92('0x4c')],'waiting':_0x5988e2[_0x2c92('0x4d')]};_0x510dd0[_0x2c92('0x1d')](_0x2f4322);}}_0x484264({'count':_0x510dd0[_0x2c92('0x14')],'rows':_0x510dd0});});},'WhatsappQueues':function(_0x10aecd){return new Promise(function(_0xf1b212,_0x534402){var _0x5ebe50=[];for(var _0x5c9b5b in _0x46d09f[_0x2c92('0x52')]){if(_0x46d09f[_0x2c92('0x52')][_0x2c92('0x44')](_0x5c9b5b)){var _0x56a3f5=_0x46d09f[_0x2c92('0x52')][_0x5c9b5b];var _0x5e5ce1={'id':_0x56a3f5['id'],'available':_0x56a3f5[_0x2c92('0x49')],'loggedIn':_0x56a3f5[_0x2c92('0x4a')],'name':_0x56a3f5[_0x2c92('0x4b')],'paused':_0x56a3f5['paused'],'waiting':_0x56a3f5[_0x2c92('0x4d')]};_0x5ebe50[_0x2c92('0x1d')](_0x5e5ce1);}}_0xf1b212({'count':_0x5ebe50[_0x2c92('0x14')],'rows':_0x5ebe50});});},'ChatQueuesWaitingInteractions':function(_0x1863f1){return new Promise(function(_0x3c5686,_0x32f4e6){var _0x1f83a7=_[_0x2c92('0x47')](_0x46d09f[_0x2c92('0x53')]);_0x3c5686({'count':_0x1f83a7[_0x2c92('0x14')],'rows':_0x1f83a7});});},'MailQueuesWaitingInteractions':function(_0x868be5){return new Promise(function(_0x5dde4d,_0x5aaf86){var _0x1ac26d=_[_0x2c92('0x47')](_0x46d09f[_0x2c92('0x54')]);_0x5dde4d({'count':_0x1ac26d[_0x2c92('0x14')],'rows':_0x1ac26d});});},'OpenchannelQueuesWaitingInteractions':function(_0xb51037){return new Promise(function(_0x39b8f5,_0x34f0f5){var _0xb90c02=_[_0x2c92('0x47')](_0x46d09f[_0x2c92('0x55')]);_0x39b8f5({'count':_0xb90c02[_0x2c92('0x14')],'rows':_0xb90c02});});},'SmsQueuesWaitingInteractions':function(_0x1a0820){return new Promise(function(_0x1585cc,_0x5a2904){var _0x4510bd=_[_0x2c92('0x47')](_0x46d09f[_0x2c92('0x56')]);_0x1585cc({'count':_0x4510bd[_0x2c92('0x14')],'rows':_0x4510bd});});},'FaxQueuesWaitingInteractions':function(_0x325cf8){return new Promise(function(_0x487454,_0x393ad0){var _0x55a87b=_['values'](_0x46d09f[_0x2c92('0x57')]);_0x487454({'count':_0x55a87b[_0x2c92('0x14')],'rows':_0x55a87b});});},'WhatsappQueuesWaitingInteractions':function(_0x5d7a31){return new Promise(function(_0x17a942,_0x20e4e6){var _0x96fb8=_[_0x2c92('0x47')](_0x46d09f[_0x2c92('0x58')]);_0x17a942({'count':_0x96fb8[_0x2c92('0x14')],'rows':_0x96fb8});});}};var _0x2ad2eb=jayson[_0x2c92('0x59')](_0x3eb15f)[_0x2c92('0x5a')]();_0x2ad2eb['on'](_0x2c92('0x2e'),function(_0x4c5351){logger['error'](JSON['stringify'](_0x4c5351));return _0x5ab565(_0x4c5351);});_0x2ad2eb[_0x2c92('0xf')](0x232c,_0x2c92('0x5b'),function(){console['log'](_0x2c92('0x5c'),0x232c);return _0x595a01(_0x2c92('0x5d')+0x232c);});});};
\ No newline at end of file
index cb96918..67f6ca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cd8=['join','when','\x20|\x20','util','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x59ee91,_0x5ca1ef){var _0x51b0b7=function(_0x55517f){while(--_0x55517f){_0x59ee91['push'](_0x59ee91['shift']());}};_0x51b0b7(++_0x5ca1ef);}(_0x5cd8,0x12f));var _0x85cd=function(_0x43160e,_0x37a87f){_0x43160e=_0x43160e-0x0;var _0x4ae2d0=_0x5cd8[_0x43160e];return _0x4ae2d0;};'use strict';var util=require(_0x85cd('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0x85cd('0x1'));var logger=require(_0x85cd('0x2'))(_0x85cd('0x3'));var client=jayson[_0x85cd('0x4')][_0x85cd('0x5')]({'port':0x232a});function request(_0x50cba2,_0x205343){return new BPromise(function(_0x42efcf,_0x34ab46){return client[_0x85cd('0x6')](_0x50cba2,_0x205343)[_0x85cd('0x7')](function(_0x5c35b9){if(_0x5c35b9[_0x85cd('0x8')]){return _0x34ab46(_0x5c35b9[_0x85cd('0x8')][_0x85cd('0x9')]);}else{return _0x42efcf(_0x5c35b9[_0x85cd('0xa')]);}})[_0x85cd('0xb')](function(_0x310f51){return _0x34ab46(_0x310f51);});});}exports[_0x85cd('0xc')]=function(_0x4a6cf3,_0x43b349,_0x26da60){return function(_0x2e39bf){if(_0x26da60[_0x85cd('0xd')]&&!_0x26da60['rules'][_0x4a6cf3]){logger[_0x85cd('0xe')](_0x85cd('0xf'),_0x4a6cf3);return _0x2e39bf[_0x85cd('0x10')]();}var _0xfe8242=[];for(var _0x3c929d=0x0;_0x3c929d<_0x43b349[_0x85cd('0x11')];_0x3c929d+=0x1){_0xfe8242[_0x85cd('0x12')](request(_0x85cd('0x13'),{'command':util[_0x85cd('0x14')](_0x85cd('0x15'),_0x43b349[_0x3c929d])})[_0x85cd('0x7')](function(_0x4febcc){return _0x4febcc&&_0x4febcc['message']&&_0x4febcc[_0x85cd('0x9')]['indexOf'](_0x85cd('0x16'))>=0x0?!![]:![];})[_0x85cd('0xb')](function(_0x564de6){logger[_0x85cd('0x8')](_0x85cd('0x17'),_0x4a6cf3,_0x43b349[_0x3c929d]);}));}BPromise[_0x85cd('0x18')](_0xfe8242)['then'](function(_0x127e98){var _0x3a18ab=_[_0x85cd('0x19')](_0x127e98);logger[_0x85cd('0xe')](_0x85cd('0x1a'),_0x4a6cf3,_0x43b349[_0x85cd('0x1b')]('\x20|\x20'),_0x3a18ab);_0x2e39bf[_0x85cd('0x1c')](_0x3a18ab);})[_0x85cd('0xb')](function(_0x289c63){console['log'](_0x289c63);logger[_0x85cd('0x8')](_0x85cd('0x1a'),_0x4a6cf3,_0x43b349[_0x85cd('0x1b')](_0x85cd('0x1d')),_0x289c63['stack']);_0x2e39bf[_0x85cd('0x10')]();});};};
\ No newline at end of file
+var _0xd5c0=['[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','catch','log','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','format','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some'];(function(_0xbe048b,_0x2f8970){var _0x1d9099=function(_0x4920e){while(--_0x4920e){_0xbe048b['push'](_0xbe048b['shift']());}};_0x1d9099(++_0x2f8970);}(_0xd5c0,0xef));var _0x0d5c=function(_0x16c314,_0x4bcd8e){_0x16c314=_0x16c314-0x0;var _0x1b0580=_0xd5c0[_0x16c314];return _0x1b0580;};'use strict';var util=require(_0x0d5c('0x0'));var BPromise=require(_0x0d5c('0x1'));var jayson=require(_0x0d5c('0x2'));var _=require(_0x0d5c('0x3'));var logger=require(_0x0d5c('0x4'))(_0x0d5c('0x5'));var client=jayson[_0x0d5c('0x6')]['http']({'port':0x232a});function request(_0x54fa19,_0x298ee7){return new BPromise(function(_0x3c9b07,_0x5b2b3e){return client[_0x0d5c('0x7')](_0x54fa19,_0x298ee7)[_0x0d5c('0x8')](function(_0x51f275){if(_0x51f275[_0x0d5c('0x9')]){return _0x5b2b3e(_0x51f275[_0x0d5c('0x9')]['message']);}else{return _0x3c9b07(_0x51f275[_0x0d5c('0xa')]);}})['catch'](function(_0x51e0d5){return _0x5b2b3e(_0x51e0d5);});});}exports[_0x0d5c('0xb')]=function(_0x1d43d9,_0x5d046d,_0x22a7a8){return function(_0x5be80e){if(_0x22a7a8[_0x0d5c('0xc')]&&!_0x22a7a8['rules'][_0x1d43d9]){logger[_0x0d5c('0xd')](_0x0d5c('0xe'),_0x1d43d9);return _0x5be80e['stop']();}var _0x1df4b6=[];for(var _0x14aaf9=0x0;_0x14aaf9<_0x5d046d[_0x0d5c('0xf')];_0x14aaf9+=0x1){_0x1df4b6[_0x0d5c('0x10')](request(_0x0d5c('0x11'),{'command':util[_0x0d5c('0x12')]('iftime\x20%s',_0x5d046d[_0x14aaf9])})[_0x0d5c('0x8')](function(_0x1b1b11){return _0x1b1b11&&_0x1b1b11[_0x0d5c('0x13')]&&_0x1b1b11[_0x0d5c('0x13')][_0x0d5c('0x14')](_0x0d5c('0x15'))>=0x0?!![]:![];})['catch'](function(_0x38816c){logger[_0x0d5c('0x9')](_0x0d5c('0x16'),_0x1d43d9,_0x5d046d[_0x14aaf9]);}));}BPromise[_0x0d5c('0x17')](_0x1df4b6)[_0x0d5c('0x8')](function(_0x4e18a4){var _0x36fe7f=_[_0x0d5c('0x18')](_0x4e18a4);logger[_0x0d5c('0xd')](_0x0d5c('0x19'),_0x1d43d9,_0x5d046d[_0x0d5c('0x1a')](_0x0d5c('0x1b')),_0x36fe7f);_0x5be80e[_0x0d5c('0x1c')](_0x36fe7f);})[_0x0d5c('0x1d')](function(_0x50396b){console[_0x0d5c('0x1e')](_0x50396b);logger['error'](_0x0d5c('0x19'),_0x1d43d9,_0x5d046d[_0x0d5c('0x1a')](_0x0d5c('0x1b')),_0x50396b[_0x0d5c('0x1f')]);_0x5be80e[_0x0d5c('0x20')]();});};};
\ No newline at end of file
index bf0a66b..d583369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7b4=['acw','acwtime','agentacw','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','info','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','push','queuecallerabandon','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','forIn','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','agentcompleteAt','agentconnectAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','complete','lodash','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete'];(function(_0x1cf7e8,_0x3cea71){var _0x3a9a74=function(_0x4b05ff){while(--_0x4b05ff){_0x1cf7e8['push'](_0x1cf7e8['shift']());}};_0x3a9a74(++_0x3cea71);}(_0xf7b4,0x152));var _0x4f7b=function(_0x409ef4,_0x435589){_0x409ef4=_0x409ef4-0x0;var _0x50036b=_0xf7b4[_0x409ef4];return _0x50036b;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5ccf30,_0x103165){utils['info'](util['format'](_0x4f7b('0x1'),_0x5ccf30[_0x4f7b('0x2')],_0x5ccf30[_0x4f7b('0x3')],_0x5ccf30[_0x4f7b('0x4')],_0x5ccf30[_0x4f7b('0x5')],_0x5ccf30[_0x4f7b('0x6')],_0x5ccf30[_0x4f7b('0x7')],_0x5ccf30[_0x4f7b('0x8')],_0x5ccf30[_0x4f7b('0x9')]));if(_0x5ccf30[_0x4f7b('0x4')]){utils[_0x4f7b('0xa')](_0x5ccf30[_0x4f7b('0x4')])[_0x4f7b('0xb')](function(_0x5c714d){if(_0x5c714d){_0x5ccf30[_0x4f7b('0xc')]=_0x5c714d[_0x4f7b('0xc')];_0x5ccf30['agentacw']=_0x5ccf30[_0x4f7b('0xd')]?_0x5c714d[_0x4f7b('0xe')]:![];_0x5ccf30[_0x4f7b('0xf')]=_0x5ccf30[_0x4f7b('0x10')]?_0x5c714d[_0x4f7b('0x11')]:0x0;}utils['request'](_0x4f7b('0x12'),_0x5ccf30);});}else{utils['request']('CreateVoiceAgentReport',_0x5ccf30);}if(_0x103165){delete transfers[_0x5ccf30[_0x4f7b('0x2')]];}else{delete agents[_0x5ccf30[_0x4f7b('0x13')]];}}exports[_0x4f7b('0x14')]=function(_0x41a050){try{utils['debug'](util[_0x4f7b('0x15')](_0x4f7b('0x16'),_0x41a050[_0x4f7b('0x2')]),_0x41a050);agents[_0x41a050[_0x4f7b('0x13')]]=_0x41a050;agents[_0x41a050[_0x4f7b('0x13')]][_0x4f7b('0x17')]=utils[_0x4f7b('0x18')]();agents[_0x41a050[_0x4f7b('0x13')]][_0x4f7b('0x9')]=_0x4f7b('0x19');agents[_0x41a050[_0x4f7b('0x13')]][_0x4f7b('0x8')]=null;agents[_0x41a050['destuniqueid']][_0x4f7b('0x1a')]=null;utils['info'](util['format'](_0x4f7b('0x1b'),_0x41a050[_0x4f7b('0x2')],agents[_0x41a050['destuniqueid']][_0x4f7b('0x5')],_0x41a050[_0x4f7b('0x13')]));}catch(_0x13a0f5){utils[_0x4f7b('0x1c')](util['format'](_0x4f7b('0x16'),_0x41a050['uniqueid']),_0x13a0f5);}};exports[_0x4f7b('0x1d')]=function(_0x12374b){try{if(!_[_0x4f7b('0x1e')](agents[_0x12374b[_0x4f7b('0x13')]])){utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x20'),_0x12374b[_0x4f7b('0x2')]),_0x12374b);utils[_0x4f7b('0x21')](util['format'](_0x4f7b('0x22'),_0x12374b[_0x4f7b('0x2')],agents[_0x12374b[_0x4f7b('0x13')]]['membername'],_0x12374b[_0x4f7b('0x13')]));agents[_0x12374b[_0x4f7b('0x13')]]['agentringnoanswer']=!![];agents[_0x12374b[_0x4f7b('0x13')]]['agentringnoanswerAt']=utils[_0x4f7b('0x18')]();agents[_0x12374b[_0x4f7b('0x13')]][_0x4f7b('0x9')]=_0x4f7b('0x23');agents[_0x12374b[_0x4f7b('0x13')]][_0x4f7b('0x24')]=_0x4f7b('0x23');agents[_0x12374b[_0x4f7b('0x13')]]['holdtime']=_0x12374b[_0x4f7b('0x25')]?parseInt(_0x12374b[_0x4f7b('0x25')])/0x3e8:0x0;agents[_0x12374b[_0x4f7b('0x13')]]['talktime']=0x0;unanswered[_0x4f7b('0x26')](_0x12374b[_0x4f7b('0x13')]);}}catch(_0x1db684){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')]('[%s][agents][agentringnoanswer]',_0x12374b[_0x4f7b('0x2')]),_0x1db684);}};exports[_0x4f7b('0x27')]=function(_0x9a675c){try{_['forIn'](agents,function(_0x7de561,_0x5d13a1){if(_0x7de561['uniqueid']==_0x9a675c[_0x4f7b('0x2')]&&!_['includes'](unanswered,_0x7de561[_0x4f7b('0x13')])){utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x28'),_0x9a675c[_0x4f7b('0x2')]),_0x9a675c);utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x29'),_0x9a675c[_0x4f7b('0x2')],_0x7de561[_0x4f7b('0x5')],_0x7de561[_0x4f7b('0x13')]));_0x7de561[_0x4f7b('0x1d')]=!![];_0x7de561[_0x4f7b('0x2a')]=utils[_0x4f7b('0x18')]();_0x7de561[_0x4f7b('0x9')]=_0x4f7b('0x2b');_0x7de561[_0x4f7b('0x24')]=_0x4f7b('0x2b');_0x7de561[_0x4f7b('0x2c')]=_0x9a675c[_0x4f7b('0x2c')];_0x7de561[_0x4f7b('0x2d')]=0x0;writeDB(_0x7de561);}});}catch(_0x172235){utils['error'](util[_0x4f7b('0x15')]('[%s][agents][queuecallerabandon]',_0x9a675c[_0x4f7b('0x2')]),_0x172235);}};exports[_0x4f7b('0x2e')]=function(_0x579ad4){try{if(agents[_0x579ad4[_0x4f7b('0x13')]]){utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')]('[%s][agents][agentconnect]',_0x579ad4[_0x4f7b('0x2')]),_0x579ad4);utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x2f'),_0x579ad4[_0x4f7b('0x2')],agents[_0x579ad4[_0x4f7b('0x13')]][_0x4f7b('0x5')],_0x579ad4['destuniqueid']));agents[_0x579ad4[_0x4f7b('0x13')]]['agentconnectAt']=utils[_0x4f7b('0x18')]();agents[_0x579ad4[_0x4f7b('0x13')]][_0x4f7b('0x8')]=_0x579ad4['connectedlinenum'];agents[_0x579ad4[_0x4f7b('0x13')]]['connectedlinename']=_0x579ad4[_0x4f7b('0x1a')];agents[_0x579ad4[_0x4f7b('0x13')]]['holdtime']=_0x579ad4['ringtime'];agents[_0x579ad4[_0x4f7b('0x13')]]['lastevent']=_0x4f7b('0x30');_[_0x4f7b('0x31')](agents,function(_0x54f9e8,_0x1d0746){if(_0x54f9e8['destuniqueid']!=_0x579ad4['destuniqueid']&&_0x54f9e8['uniqueid']==_0x579ad4[_0x4f7b('0x2')]){_0x54f9e8[_0x4f7b('0x2d')]=0x0;_0x54f9e8[_0x4f7b('0x2c')]=_0x579ad4[_0x4f7b('0x25')];_0x54f9e8['agentringnoanswer']=!![];_0x54f9e8[_0x4f7b('0x2a')]=utils['now']();_0x54f9e8[_0x4f7b('0x9')]='answered_elsewhere';_0x54f9e8[_0x4f7b('0x24')]='answered_elsewhere';_0x54f9e8[_0x4f7b('0x32')]=_0x579ad4[_0x4f7b('0x13')];_0x54f9e8[_0x4f7b('0x33')]=_0x579ad4[_0x4f7b('0x5')];writeDB(_0x54f9e8);}});}}catch(_0x2986cd){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')](_0x4f7b('0x34'),_0x579ad4[_0x4f7b('0x2')]),_0x2986cd);}};exports[_0x4f7b('0xd')]=function(_0x2d0be3){try{if(!_[_0x4f7b('0x1e')](agents[_0x2d0be3[_0x4f7b('0x13')]])){utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x35'),_0x2d0be3[_0x4f7b('0x2')]),_0x2d0be3);utils[_0x4f7b('0x21')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2d0be3[_0x4f7b('0x2')],agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x5')],_0x2d0be3[_0x4f7b('0x13')]));agents[_0x2d0be3['destuniqueid']]['agentcomplete']=!![];agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x36')]=utils[_0x4f7b('0x18')]();agents[_0x2d0be3[_0x4f7b('0x13')]]['talktime']=utils['diffTime'](agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x36')],agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x37')]);agents[_0x2d0be3[_0x4f7b('0x13')]]['reason']=_0x2d0be3[_0x4f7b('0x24')];agents[_0x2d0be3[_0x4f7b('0x13')]][_0x4f7b('0x9')]='complete';writeDB(agents[_0x2d0be3[_0x4f7b('0x13')]]);}}catch(_0x104e7f){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')](_0x4f7b('0x35'),_0x2d0be3[_0x4f7b('0x2')]),_0x104e7f);}};exports[_0x4f7b('0x38')]=function(_0x2e563f){try{if(!_[_0x4f7b('0x1e')](agents[_0x2e563f[_0x4f7b('0x39')]])){utils['debug'](util[_0x4f7b('0x15')](_0x4f7b('0x3a'),_0x2e563f[_0x4f7b('0x2')]),_0x2e563f);utils['info'](util[_0x4f7b('0x15')](_0x4f7b('0x3b'),_0x2e563f[_0x4f7b('0x2')],agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x5')],agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x2')]));agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x3c')]=!![];agents[_0x2e563f[_0x4f7b('0x39')]]['transfertype']=_0x4f7b('0x3d');agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x3e')]=_0x2e563f['extension'];agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x3f')]=agents[_0x2e563f[_0x4f7b('0x39')]][_0x4f7b('0x2')];}}catch(_0x3437a8){utils[_0x4f7b('0x1c')](util['format'](_0x4f7b('0x3a'),_0x2e563f[_0x4f7b('0x2')]),_0x3437a8);}};exports[_0x4f7b('0x40')]=function(_0x4c9496){try{utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x41'),_0x4c9496[_0x4f7b('0x42')]),_0x4c9496);if(_0x4c9496[_0x4f7b('0x42')]==_0x4c9496[_0x4f7b('0x43')]){if(!_['isNil'](agents[_0x4c9496[_0x4f7b('0x44')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x4c9496[_0x4f7b('0x42')],agents[_0x4c9496[_0x4f7b('0x44')]][_0x4f7b('0x5')]));agents[_0x4c9496['secondtransfereruniqueid']]['transfer']=!![];agents[_0x4c9496[_0x4f7b('0x44')]][_0x4f7b('0x45')]='ATTENDED';agents[_0x4c9496[_0x4f7b('0x44')]][_0x4f7b('0x3e')]=_0x4c9496[_0x4f7b('0x46')];agents[_0x4c9496[_0x4f7b('0x44')]]['transferuniqueid']=_0x4c9496[_0x4f7b('0x42')];}if(_0x4c9496[_0x4f7b('0x47')]&&agents[_0x4c9496[_0x4f7b('0x47')]]){agents[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x48')]=0x1;transfers[_0x4c9496[_0x4f7b('0x47')]]=_[_0x4f7b('0x49')](agents[_0x4c9496['transfereeuniqueid']]);transfers[_0x4c9496['transfereeuniqueid']]['calleridnum']=agents[_0x4c9496[_0x4f7b('0x44')]]['calleridnum'];transfers[_0x4c9496['transfereeuniqueid']]['calleridname']=agents[_0x4c9496['secondtransfereruniqueid']][_0x4f7b('0x4a')];transfers[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x17')]=utils[_0x4f7b('0x18')]();transfers[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x37')]=utils[_0x4f7b('0x18')]();transfers[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x2c')]=0x0;transfers[_0x4c9496[_0x4f7b('0x47')]][_0x4f7b('0x48')]=0x2;}}else if(_0x4c9496[_0x4f7b('0x44')]==_0x4c9496[_0x4f7b('0x4b')]){if(!_[_0x4f7b('0x1e')](agents[_0x4c9496[_0x4f7b('0x42')]])){utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x4c'),_0x4c9496['origtransfereruniqueid'],agents[_0x4c9496[_0x4f7b('0x42')]][_0x4f7b('0x5')]));agents[_0x4c9496[_0x4f7b('0x42')]][_0x4f7b('0x3c')]=!![];agents[_0x4c9496[_0x4f7b('0x42')]]['transfertype']='ATTENDED';agents[_0x4c9496[_0x4f7b('0x42')]]['transferexten']=_0x4c9496[_0x4f7b('0x4d')];agents[_0x4c9496[_0x4f7b('0x42')]][_0x4f7b('0x3f')]=_0x4c9496[_0x4f7b('0x44')];}if(_0x4c9496['transfertargetuniqueid']&&agents[_0x4c9496[_0x4f7b('0x4e')]]){agents[_0x4c9496[_0x4f7b('0x4e')]][_0x4f7b('0x48')]=0x1;transfers[_0x4c9496['transfertargetuniqueid']]=_['clone'](agents[_0x4c9496['transfertargetuniqueid']]);transfers[_0x4c9496[_0x4f7b('0x4e')]]['calleridnum']=agents[_0x4c9496['origtransfereruniqueid']]['calleridnum'];transfers[_0x4c9496[_0x4f7b('0x4e')]][_0x4f7b('0x4a')]=agents[_0x4c9496[_0x4f7b('0x42')]]['calleridname'];transfers[_0x4c9496[_0x4f7b('0x4e')]][_0x4f7b('0x17')]=utils['now']();transfers[_0x4c9496['transfertargetuniqueid']][_0x4f7b('0x37')]=utils[_0x4f7b('0x18')]();transfers[_0x4c9496[_0x4f7b('0x4e')]][_0x4f7b('0x2c')]=0x0;transfers[_0x4c9496['transfertargetuniqueid']][_0x4f7b('0x48')]=0x2;}}}catch(_0x40534d){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')](_0x4f7b('0x41'),_0x4c9496[_0x4f7b('0x42')]),_0x40534d);}};exports['hangup']=function(_0x1fa0fd){try{utils[_0x4f7b('0x1f')](util[_0x4f7b('0x15')](_0x4f7b('0x4f'),_0x1fa0fd[_0x4f7b('0x2')]),_0x1fa0fd);if(agents[_0x1fa0fd['uniqueid']]&&agents[_0x1fa0fd['uniqueid']]['reason']===_0x4f7b('0x23')){if(_0x1fa0fd[_0x4f7b('0x50')]==='21'){agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')]=_0x4f7b('0x51');agents[_0x1fa0fd['uniqueid']][_0x4f7b('0x9')]=_0x4f7b('0x51');}utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x52'),_0x1fa0fd[_0x4f7b('0x2')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x5')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x9')]));writeDB(agents[_0x1fa0fd[_0x4f7b('0x2')]]);var _0x19e4ab=unanswered[_0x4f7b('0x53')](_0x1fa0fd[_0x4f7b('0x2')]);if(_0x19e4ab>-0x1){unanswered[_0x4f7b('0x54')](_0x19e4ab,0x1);}}if(transfers[_0x1fa0fd[_0x4f7b('0x2')]]){transfers[_0x1fa0fd['uniqueid']]['agentcomplete']=!![];transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x36')]=utils[_0x4f7b('0x18')]();transfers[_0x1fa0fd[_0x4f7b('0x2')]]['talktime']=utils[_0x4f7b('0x55')](transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x36')],transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x37')]);transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')]=_0x4f7b('0x56');transfers[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x9')]=_0x4f7b('0x57');utils[_0x4f7b('0x21')](util[_0x4f7b('0x15')](_0x4f7b('0x52'),_0x1fa0fd[_0x4f7b('0x2')],transfers[_0x1fa0fd['uniqueid']][_0x4f7b('0x5')],transfers[_0x1fa0fd[_0x4f7b('0x2')]]['reason'],transfers[_0x1fa0fd['uniqueid']][_0x4f7b('0x9')]));writeDB(transfers[_0x1fa0fd[_0x4f7b('0x2')]],!![]);}if(agents[_0x1fa0fd[_0x4f7b('0x2')]]&&agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x37')]){agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0xd')]=!![];agents[_0x1fa0fd['uniqueid']]['agentcompleteAt']=utils[_0x4f7b('0x18')]();agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x2d')]=utils[_0x4f7b('0x55')](agents[_0x1fa0fd['uniqueid']][_0x4f7b('0x36')],agents[_0x1fa0fd[_0x4f7b('0x2')]]['agentconnectAt']);agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')]=agents[_0x1fa0fd['uniqueid']]['transfer']?_0x4f7b('0x3c'):'agent';agents[_0x1fa0fd['uniqueid']]['lastevent']=_0x4f7b('0x57');utils['info'](util[_0x4f7b('0x15')](_0x4f7b('0x52'),_0x1fa0fd[_0x4f7b('0x2')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x5')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x24')],agents[_0x1fa0fd[_0x4f7b('0x2')]][_0x4f7b('0x9')]));writeDB(agents[_0x1fa0fd['uniqueid']]);}}catch(_0x476637){utils[_0x4f7b('0x1c')](util[_0x4f7b('0x15')](_0x4f7b('0x4f'),_0x1fa0fd[_0x4f7b('0x2')]),_0x476637);}};
\ No newline at end of file
+var _0x4fc2=['lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','agentconnectAt','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','diffTime','transfer'];(function(_0x415c34,_0x523485){var _0xe4fed4=function(_0x32e068){while(--_0x32e068){_0x415c34['push'](_0x415c34['shift']());}};_0xe4fed4(++_0x523485);}(_0x4fc2,0x111));var _0x24fc=function(_0x2db291,_0x1e49b7){_0x2db291=_0x2db291-0x0;var _0x3be614=_0x4fc2[_0x2db291];return _0x3be614;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var utils=require(_0x24fc('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4390a0,_0x5aaa74){utils[_0x24fc('0x3')](util[_0x24fc('0x4')](_0x24fc('0x5'),_0x4390a0['uniqueid'],_0x4390a0[_0x24fc('0x6')],_0x4390a0[_0x24fc('0x7')],_0x4390a0['membername'],_0x4390a0[_0x24fc('0x8')],_0x4390a0[_0x24fc('0x9')],_0x4390a0['connectedlinenum'],_0x4390a0[_0x24fc('0xa')]));if(_0x4390a0[_0x24fc('0x7')]){utils[_0x24fc('0xb')](_0x4390a0[_0x24fc('0x7')])[_0x24fc('0xc')](function(_0x47349b){if(_0x47349b){_0x4390a0['type']=_0x47349b[_0x24fc('0xd')];_0x4390a0[_0x24fc('0xe')]=_0x4390a0[_0x24fc('0xf')]?_0x47349b[_0x24fc('0x10')]:![];_0x4390a0[_0x24fc('0x11')]=_0x4390a0[_0x24fc('0xe')]?_0x47349b[_0x24fc('0x12')]:0x0;}utils[_0x24fc('0x13')]('CreateVoiceAgentReport',_0x4390a0);});}else{utils[_0x24fc('0x13')](_0x24fc('0x14'),_0x4390a0);}if(_0x5aaa74){delete transfers[_0x4390a0['uniqueid']];}else{delete agents[_0x4390a0[_0x24fc('0x15')]];}}exports[_0x24fc('0x16')]=function(_0x3f6d8b){try{utils[_0x24fc('0x17')](util[_0x24fc('0x4')](_0x24fc('0x18'),_0x3f6d8b['uniqueid']),_0x3f6d8b);agents[_0x3f6d8b[_0x24fc('0x15')]]=_0x3f6d8b;agents[_0x3f6d8b[_0x24fc('0x15')]][_0x24fc('0x19')]=utils[_0x24fc('0x1a')]();agents[_0x3f6d8b['destuniqueid']][_0x24fc('0xa')]='called';agents[_0x3f6d8b[_0x24fc('0x15')]][_0x24fc('0x1b')]=null;agents[_0x3f6d8b[_0x24fc('0x15')]][_0x24fc('0x1c')]=null;utils[_0x24fc('0x3')](util['format'](_0x24fc('0x1d'),_0x3f6d8b[_0x24fc('0x1e')],agents[_0x3f6d8b[_0x24fc('0x15')]][_0x24fc('0x1f')],_0x3f6d8b['destuniqueid']));}catch(_0x5eabee){utils[_0x24fc('0x20')](util[_0x24fc('0x4')]('[%s][agents][agentcalled]',_0x3f6d8b[_0x24fc('0x1e')]),_0x5eabee);}};exports[_0x24fc('0x21')]=function(_0xbf1d6b){try{if(!_[_0x24fc('0x22')](agents[_0xbf1d6b['destuniqueid']])){utils[_0x24fc('0x17')](util['format'](_0x24fc('0x23'),_0xbf1d6b['uniqueid']),_0xbf1d6b);utils[_0x24fc('0x3')](util[_0x24fc('0x4')](_0x24fc('0x24'),_0xbf1d6b['uniqueid'],agents[_0xbf1d6b[_0x24fc('0x15')]]['membername'],_0xbf1d6b[_0x24fc('0x15')]));agents[_0xbf1d6b[_0x24fc('0x15')]][_0x24fc('0x21')]=!![];agents[_0xbf1d6b[_0x24fc('0x15')]][_0x24fc('0x25')]=utils[_0x24fc('0x1a')]();agents[_0xbf1d6b[_0x24fc('0x15')]][_0x24fc('0xa')]=_0x24fc('0x26');agents[_0xbf1d6b[_0x24fc('0x15')]]['reason']=_0x24fc('0x26');agents[_0xbf1d6b[_0x24fc('0x15')]][_0x24fc('0x27')]=_0xbf1d6b['ringtime']?parseInt(_0xbf1d6b[_0x24fc('0x28')])/0x3e8:0x0;agents[_0xbf1d6b[_0x24fc('0x15')]][_0x24fc('0x29')]=0x0;unanswered[_0x24fc('0x2a')](_0xbf1d6b[_0x24fc('0x15')]);}}catch(_0x443796){utils['error'](util[_0x24fc('0x4')](_0x24fc('0x23'),_0xbf1d6b[_0x24fc('0x1e')]),_0x443796);}};exports[_0x24fc('0x2b')]=function(_0x9f7bbc){try{_['forIn'](agents,function(_0x55c27f,_0x4e6f73){if(_0x55c27f[_0x24fc('0x1e')]==_0x9f7bbc['uniqueid']&&!_[_0x24fc('0x2c')](unanswered,_0x55c27f[_0x24fc('0x15')])){utils[_0x24fc('0x17')](util[_0x24fc('0x4')]('[%s][agents][queuecallerabandon]',_0x9f7bbc[_0x24fc('0x1e')]),_0x9f7bbc);utils[_0x24fc('0x3')](util['format'](_0x24fc('0x2d'),_0x9f7bbc[_0x24fc('0x1e')],_0x55c27f['membername'],_0x55c27f['destuniqueid']));_0x55c27f[_0x24fc('0x21')]=!![];_0x55c27f['agentringnoanswerAt']=utils[_0x24fc('0x1a')]();_0x55c27f[_0x24fc('0xa')]='abandoned';_0x55c27f[_0x24fc('0x2e')]=_0x24fc('0x2f');_0x55c27f[_0x24fc('0x27')]=_0x9f7bbc[_0x24fc('0x27')];_0x55c27f[_0x24fc('0x29')]=0x0;writeDB(_0x55c27f);}});}catch(_0x1e205d){utils[_0x24fc('0x20')](util[_0x24fc('0x4')](_0x24fc('0x30'),_0x9f7bbc['uniqueid']),_0x1e205d);}};exports[_0x24fc('0x31')]=function(_0x4224f4){try{if(agents[_0x4224f4[_0x24fc('0x15')]]){utils[_0x24fc('0x17')](util[_0x24fc('0x4')]('[%s][agents][agentconnect]',_0x4224f4['uniqueid']),_0x4224f4);utils[_0x24fc('0x3')](util['format'](_0x24fc('0x32'),_0x4224f4[_0x24fc('0x1e')],agents[_0x4224f4[_0x24fc('0x15')]][_0x24fc('0x1f')],_0x4224f4['destuniqueid']));agents[_0x4224f4[_0x24fc('0x15')]]['agentconnectAt']=utils[_0x24fc('0x1a')]();agents[_0x4224f4[_0x24fc('0x15')]][_0x24fc('0x1b')]=_0x4224f4[_0x24fc('0x1b')];agents[_0x4224f4[_0x24fc('0x15')]]['connectedlinename']=_0x4224f4[_0x24fc('0x1c')];agents[_0x4224f4[_0x24fc('0x15')]][_0x24fc('0x27')]=_0x4224f4[_0x24fc('0x28')];agents[_0x4224f4['destuniqueid']][_0x24fc('0xa')]=_0x24fc('0x33');_['forIn'](agents,function(_0xf40435,_0x52df2e){if(_0xf40435[_0x24fc('0x15')]!=_0x4224f4[_0x24fc('0x15')]&&_0xf40435[_0x24fc('0x1e')]==_0x4224f4[_0x24fc('0x1e')]){_0xf40435[_0x24fc('0x29')]=0x0;_0xf40435[_0x24fc('0x27')]=_0x4224f4[_0x24fc('0x28')];_0xf40435[_0x24fc('0x21')]=!![];_0xf40435['agentringnoanswerAt']=utils[_0x24fc('0x1a')]();_0xf40435[_0x24fc('0xa')]=_0x24fc('0x34');_0xf40435['reason']=_0x24fc('0x34');_0xf40435[_0x24fc('0x35')]=_0x4224f4['destuniqueid'];_0xf40435[_0x24fc('0x36')]=_0x4224f4[_0x24fc('0x1f')];writeDB(_0xf40435);}});}}catch(_0x2c598c){utils['error'](util[_0x24fc('0x4')](_0x24fc('0x37'),_0x4224f4['uniqueid']),_0x2c598c);}};exports[_0x24fc('0xf')]=function(_0x169982){try{if(!_[_0x24fc('0x22')](agents[_0x169982[_0x24fc('0x15')]])){utils['debug'](util[_0x24fc('0x4')](_0x24fc('0x38'),_0x169982[_0x24fc('0x1e')]),_0x169982);utils[_0x24fc('0x3')](util[_0x24fc('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x169982[_0x24fc('0x1e')],agents[_0x169982[_0x24fc('0x15')]][_0x24fc('0x1f')],_0x169982[_0x24fc('0x15')]));agents[_0x169982['destuniqueid']][_0x24fc('0xf')]=!![];agents[_0x169982[_0x24fc('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x169982[_0x24fc('0x15')]]['talktime']=utils['diffTime'](agents[_0x169982[_0x24fc('0x15')]]['agentcompleteAt'],agents[_0x169982[_0x24fc('0x15')]][_0x24fc('0x39')]);agents[_0x169982[_0x24fc('0x15')]]['reason']=_0x169982[_0x24fc('0x2e')];agents[_0x169982[_0x24fc('0x15')]][_0x24fc('0xa')]=_0x24fc('0x3a');writeDB(agents[_0x169982[_0x24fc('0x15')]]);}}catch(_0x6c6754){utils[_0x24fc('0x20')](util[_0x24fc('0x4')]('[%s][agents][agentcomplete]',_0x169982['uniqueid']),_0x6c6754);}};exports[_0x24fc('0x3b')]=function(_0x2f1a99){try{if(!_[_0x24fc('0x22')](agents[_0x2f1a99['transfereruniqueid']])){utils['debug'](util[_0x24fc('0x4')](_0x24fc('0x3c'),_0x2f1a99[_0x24fc('0x1e')]),_0x2f1a99);utils[_0x24fc('0x3')](util[_0x24fc('0x4')](_0x24fc('0x3d'),_0x2f1a99[_0x24fc('0x1e')],agents[_0x2f1a99[_0x24fc('0x3e')]][_0x24fc('0x1f')],agents[_0x2f1a99[_0x24fc('0x3e')]][_0x24fc('0x1e')]));agents[_0x2f1a99[_0x24fc('0x3e')]]['transfer']=!![];agents[_0x2f1a99[_0x24fc('0x3e')]][_0x24fc('0x3f')]=_0x24fc('0x40');agents[_0x2f1a99[_0x24fc('0x3e')]][_0x24fc('0x41')]=_0x2f1a99['extension'];agents[_0x2f1a99[_0x24fc('0x3e')]]['transferuniqueid']=agents[_0x2f1a99[_0x24fc('0x3e')]][_0x24fc('0x1e')];}}catch(_0x446c14){utils[_0x24fc('0x20')](util[_0x24fc('0x4')](_0x24fc('0x3c'),_0x2f1a99['uniqueid']),_0x446c14);}};exports[_0x24fc('0x42')]=function(_0xc2ba88){try{utils[_0x24fc('0x17')](util[_0x24fc('0x4')](_0x24fc('0x43'),_0xc2ba88[_0x24fc('0x44')]),_0xc2ba88);if(_0xc2ba88['origtransfereruniqueid']==_0xc2ba88[_0x24fc('0x45')]){if(!_[_0x24fc('0x22')](agents[_0xc2ba88[_0x24fc('0x46')]])){utils[_0x24fc('0x3')](util[_0x24fc('0x4')](_0x24fc('0x47'),_0xc2ba88[_0x24fc('0x44')],agents[_0xc2ba88['secondtransfereruniqueid']][_0x24fc('0x1f')]));agents[_0xc2ba88[_0x24fc('0x46')]]['transfer']=!![];agents[_0xc2ba88[_0x24fc('0x46')]][_0x24fc('0x3f')]=_0x24fc('0x48');agents[_0xc2ba88[_0x24fc('0x46')]][_0x24fc('0x41')]=_0xc2ba88[_0x24fc('0x49')];agents[_0xc2ba88['secondtransfereruniqueid']][_0x24fc('0x4a')]=_0xc2ba88['origtransfereruniqueid'];}if(_0xc2ba88[_0x24fc('0x4b')]&&agents[_0xc2ba88[_0x24fc('0x4b')]]){agents[_0xc2ba88['transfereeuniqueid']][_0x24fc('0x4c')]=0x1;transfers[_0xc2ba88['transfereeuniqueid']]=_[_0x24fc('0x4d')](agents[_0xc2ba88['transfereeuniqueid']]);transfers[_0xc2ba88[_0x24fc('0x4b')]][_0x24fc('0x9')]=agents[_0xc2ba88['secondtransfereruniqueid']][_0x24fc('0x9')];transfers[_0xc2ba88['transfereeuniqueid']][_0x24fc('0x4e')]=agents[_0xc2ba88[_0x24fc('0x46')]]['calleridname'];transfers[_0xc2ba88[_0x24fc('0x4b')]][_0x24fc('0x19')]=utils[_0x24fc('0x1a')]();transfers[_0xc2ba88[_0x24fc('0x4b')]][_0x24fc('0x39')]=utils['now']();transfers[_0xc2ba88[_0x24fc('0x4b')]][_0x24fc('0x27')]=0x0;transfers[_0xc2ba88[_0x24fc('0x4b')]][_0x24fc('0x4c')]=0x2;}}else if(_0xc2ba88[_0x24fc('0x46')]==_0xc2ba88['secondtransfererlinkedid']){if(!_['isNil'](agents[_0xc2ba88[_0x24fc('0x44')]])){utils[_0x24fc('0x3')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0xc2ba88[_0x24fc('0x44')],agents[_0xc2ba88[_0x24fc('0x44')]][_0x24fc('0x1f')]));agents[_0xc2ba88[_0x24fc('0x44')]]['transfer']=!![];agents[_0xc2ba88[_0x24fc('0x44')]][_0x24fc('0x3f')]=_0x24fc('0x48');agents[_0xc2ba88[_0x24fc('0x44')]][_0x24fc('0x41')]=_0xc2ba88[_0x24fc('0x4f')];agents[_0xc2ba88[_0x24fc('0x44')]][_0x24fc('0x4a')]=_0xc2ba88[_0x24fc('0x46')];}if(_0xc2ba88[_0x24fc('0x50')]&&agents[_0xc2ba88[_0x24fc('0x50')]]){agents[_0xc2ba88[_0x24fc('0x50')]][_0x24fc('0x4c')]=0x1;transfers[_0xc2ba88[_0x24fc('0x50')]]=_[_0x24fc('0x4d')](agents[_0xc2ba88['transfertargetuniqueid']]);transfers[_0xc2ba88[_0x24fc('0x50')]][_0x24fc('0x9')]=agents[_0xc2ba88[_0x24fc('0x44')]][_0x24fc('0x9')];transfers[_0xc2ba88[_0x24fc('0x50')]][_0x24fc('0x4e')]=agents[_0xc2ba88[_0x24fc('0x44')]][_0x24fc('0x4e')];transfers[_0xc2ba88['transfertargetuniqueid']][_0x24fc('0x19')]=utils[_0x24fc('0x1a')]();transfers[_0xc2ba88[_0x24fc('0x50')]][_0x24fc('0x39')]=utils['now']();transfers[_0xc2ba88[_0x24fc('0x50')]][_0x24fc('0x27')]=0x0;transfers[_0xc2ba88['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x4f97b7){utils[_0x24fc('0x20')](util[_0x24fc('0x4')](_0x24fc('0x43'),_0xc2ba88[_0x24fc('0x44')]),_0x4f97b7);}};exports[_0x24fc('0x51')]=function(_0x1d0f06){try{utils['debug'](util[_0x24fc('0x4')](_0x24fc('0x52'),_0x1d0f06['uniqueid']),_0x1d0f06);if(agents[_0x1d0f06['uniqueid']]&&agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x2e')]===_0x24fc('0x26')){if(_0x1d0f06['cause']==='21'){agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x2e')]=_0x24fc('0x53');agents[_0x1d0f06['uniqueid']]['lastevent']='rejected';}utils['info'](util['format'](_0x24fc('0x54'),_0x1d0f06[_0x24fc('0x1e')],agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x1f')],agents[_0x1d0f06['uniqueid']][_0x24fc('0x2e')],agents[_0x1d0f06['uniqueid']][_0x24fc('0xa')]));writeDB(agents[_0x1d0f06['uniqueid']]);var _0x368e0a=unanswered[_0x24fc('0x55')](_0x1d0f06[_0x24fc('0x1e')]);if(_0x368e0a>-0x1){unanswered[_0x24fc('0x56')](_0x368e0a,0x1);}}if(transfers[_0x1d0f06[_0x24fc('0x1e')]]){transfers[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0xf')]=!![];transfers[_0x1d0f06['uniqueid']][_0x24fc('0x57')]=utils[_0x24fc('0x1a')]();transfers[_0x1d0f06[_0x24fc('0x1e')]]['talktime']=utils['diffTime'](transfers[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x57')],transfers[_0x1d0f06['uniqueid']][_0x24fc('0x39')]);transfers[_0x1d0f06[_0x24fc('0x1e')]]['reason']=_0x24fc('0x58');transfers[_0x1d0f06[_0x24fc('0x1e')]]['lastevent']=_0x24fc('0x3a');utils[_0x24fc('0x3')](util[_0x24fc('0x4')](_0x24fc('0x54'),_0x1d0f06[_0x24fc('0x1e')],transfers[_0x1d0f06[_0x24fc('0x1e')]]['membername'],transfers[_0x1d0f06['uniqueid']][_0x24fc('0x2e')],transfers[_0x1d0f06['uniqueid']][_0x24fc('0xa')]));writeDB(transfers[_0x1d0f06['uniqueid']],!![]);}if(agents[_0x1d0f06['uniqueid']]&&agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x39')]){agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0xf')]=!![];agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x57')]=utils[_0x24fc('0x1a')]();agents[_0x1d0f06[_0x24fc('0x1e')]]['talktime']=utils[_0x24fc('0x59')](agents[_0x1d0f06[_0x24fc('0x1e')]]['agentcompleteAt'],agents[_0x1d0f06['uniqueid']][_0x24fc('0x39')]);agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x2e')]=agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x5a')]?'transfer':_0x24fc('0x58');agents[_0x1d0f06[_0x24fc('0x1e')]]['lastevent']=_0x24fc('0x3a');utils[_0x24fc('0x3')](util[_0x24fc('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1d0f06[_0x24fc('0x1e')],agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x1f')],agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0x2e')],agents[_0x1d0f06[_0x24fc('0x1e')]][_0x24fc('0xa')]));writeDB(agents[_0x1d0f06[_0x24fc('0x1e')]]);}}catch(_0x188edb){utils['error'](util[_0x24fc('0x4')](_0x24fc('0x52'),_0x1d0f06[_0x24fc('0x1e')]),_0x188edb);}};
\ No newline at end of file
index 1287a5f..25a2fa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30a=['connectedlinenum','lastevent','accountcode','then','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','context','exten','calleridnum','channel','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','endtime','starttime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','diffTime','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','toLowerCase','split','substring','lastIndexOf','includes','noop','gotoif','./utils','./transfers.controller','NO\x20ANSWER','ANSWERED','BUSY','FAILED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','interface'];(function(_0x5a05ca,_0x246da6){var _0x549ea5=function(_0x3a5ea4){while(--_0x3a5ea4){_0x5a05ca['push'](_0x5a05ca['shift']());}};_0x549ea5(++_0x246da6);}(_0xa30a,0xc9));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xaa30('0x0'));var transfers=require(_0xaa30('0x1'));var dispositions=[_0xaa30('0x2'),'FAILED','FAILED',_0xaa30('0x2'),_0xaa30('0x2'),_0xaa30('0x2'),_0xaa30('0x3'),_0xaa30('0x4'),_0xaa30('0x5'),'FAILED',_0xaa30('0x5')];var channels={};function writeDB(_0x4f52b2){var _0xc7e19f;if(transfers[_0xaa30('0x6')][_0x4f52b2[_0xaa30('0x7')]]){_0xc7e19f=_0x4f52b2[_0xaa30('0x7')];_0x4f52b2['uniqueid']=transfers[_0xaa30('0x6')][_0x4f52b2[_0xaa30('0x7')]]['transfereeuniqueid'];}utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0xa'),_0x4f52b2[_0xaa30('0x7')],_0x4f52b2['channel'],_0x4f52b2[_0xaa30('0xb')],_0x4f52b2['membername'],_0x4f52b2[_0xaa30('0xc')],_0x4f52b2['calleridnum'],_0x4f52b2[_0xaa30('0xd')],_0x4f52b2[_0xaa30('0xe')]));if(_0x4f52b2[_0xaa30('0xf')]){utils['getUserByInternal'](_0x4f52b2[_0xaa30('0xf')])[_0xaa30('0x10')](function(_0x1d4a43){if(_0x1d4a43){_0x4f52b2['UserId']=_0x1d4a43['id'];}utils[_0xaa30('0x11')](_0xaa30('0x12'),_0x4f52b2);});}else{utils[_0xaa30('0x11')]('CreateVoiceCallReport',_0x4f52b2);}if(channels[_0x4f52b2[_0xaa30('0x7')]]){delete channels[_0x4f52b2['uniqueid']];}else if(_0xc7e19f&&channels[_0xc7e19f]){delete transfers[_0xaa30('0x6')][_0xc7e19f];delete channels[_0xc7e19f];}}exports[_0xaa30('0x13')]=function(_0x405645){try{utils[_0xaa30('0x14')](util[_0xaa30('0x9')]('[%s][calls][newchannel]',_0x405645['uniqueid']),_0x405645);if(_0x405645[_0xaa30('0x7')]==_0x405645[_0xaa30('0x15')]&&_0x405645['channel']!=_0xaa30('0x16')){utils[_0xaa30('0x8')](util[_0xaa30('0x9')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x405645[_0xaa30('0x7')],_0x405645[_0xaa30('0x17')],_0x405645[_0xaa30('0x18')]));channels[_0x405645[_0xaa30('0x7')]]={'uniqueid':_0x405645[_0xaa30('0x7')],'accountcode':_0x405645['accountcode'],'source':_0x405645[_0xaa30('0x19')],'destination':_0x405645['exten'],'destinationcontext':_0x405645[_0xaa30('0x17')],'channel':_0x405645[_0xaa30('0x1a')],'starttime':utils[_0xaa30('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xaa30('0x2'),'amaflags':_0xaa30('0x1c')};}}catch(_0x59433d){utils[_0xaa30('0x1d')](util[_0xaa30('0x9')](_0xaa30('0x1e'),_0x405645[_0xaa30('0x7')]),_0x59433d);}};exports[_0xaa30('0x1f')]=function(_0x2b726e){try{utils[_0xaa30('0x14')](util['format'](_0xaa30('0x20'),_0x2b726e[_0xaa30('0x7')]),_0x2b726e);if(!_['isNil'](channels[_0x2b726e[_0xaa30('0x7')]])&&_0x2b726e[_0xaa30('0x21')]==0x6){utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0x22'),_0x2b726e['uniqueid'],_0x2b726e['context'],_0x2b726e['channel']));if(_[_0xaa30('0x23')](channels[_0x2b726e[_0xaa30('0x7')]][_0xaa30('0x24')])){channels[_0x2b726e[_0xaa30('0x7')]]['systemanswertime']=utils['now']();}}else if(!_[_0xaa30('0x23')](channels[_0x2b726e[_0xaa30('0x15')]])&&_0x2b726e[_0xaa30('0x21')]==0x6&&_0x2b726e[_0xaa30('0x17')]!=_0xaa30('0x25')){utils[_0xaa30('0x8')](util[_0xaa30('0x9')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2b726e['uniqueid'],_0x2b726e[_0xaa30('0x15')],_0x2b726e[_0xaa30('0x17')],_0x2b726e[_0xaa30('0x1a')]));channels[_0x2b726e[_0xaa30('0x15')]][_0xaa30('0xf')]=_0x2b726e[_0xaa30('0xf')];channels[_0x2b726e[_0xaa30('0x15')]][_0xaa30('0x26')]=_0x2b726e['channel'];if(_['isNil'](channels[_0x2b726e[_0xaa30('0x15')]][_0xaa30('0x27')])){channels[_0x2b726e['linkedid']][_0xaa30('0x27')]=utils['now']();}channels[_0x2b726e[_0xaa30('0x15')]][_0xaa30('0x28')]=dispositions[_[_0xaa30('0x29')](_0x2b726e[_0xaa30('0x21')])]||_0xaa30('0x3');}}catch(_0x99796e){utils[_0xaa30('0x1d')](util[_0xaa30('0x9')]('[%s][calls][newstate]',_0x2b726e[_0xaa30('0x7')]),_0x99796e);}};exports[_0xaa30('0x2a')]=function(_0x2dcf9e){try{if(!_[_0xaa30('0x23')](channels[_0x2dcf9e[_0xaa30('0x7')]])){utils[_0xaa30('0x14')](util[_0xaa30('0x9')]('[%s][calls][hangup]',_0x2dcf9e[_0xaa30('0x7')]),_0x2dcf9e);if(_[_0xaa30('0x23')](channels[_0x2dcf9e['uniqueid']]['callerid'])){channels[_0x2dcf9e[_0xaa30('0x7')]][_0xaa30('0x2b')]=_0x2dcf9e[_0xaa30('0x2c')]+'\x20<'+_0x2dcf9e['calleridnum']+'>';}utils[_0xaa30('0x8')](util['format'](_0xaa30('0x2d'),_0x2dcf9e[_0xaa30('0x7')],channels[_0x2dcf9e[_0xaa30('0x7')]]['callerid'],_0x2dcf9e[_0xaa30('0x2e')]));channels[_0x2dcf9e['uniqueid']]['endtime']=utils[_0xaa30('0x1b')]();channels[_0x2dcf9e[_0xaa30('0x7')]][_0xaa30('0x2f')]=utils['diffTime'](channels[_0x2dcf9e[_0xaa30('0x7')]][_0xaa30('0x30')],channels[_0x2dcf9e['uniqueid']][_0xaa30('0x31')]);channels[_0x2dcf9e[_0xaa30('0x7')]]['billableseconds']=channels[_0x2dcf9e[_0xaa30('0x7')]][_0xaa30('0x27')]?utils['diffTime'](channels[_0x2dcf9e[_0xaa30('0x7')]][_0xaa30('0x30')],channels[_0x2dcf9e[_0xaa30('0x7')]][_0xaa30('0x27')]):0x0;writeDB(channels[_0x2dcf9e['uniqueid']]);}}catch(_0x1d3fee){utils[_0xaa30('0x1d')](util[_0xaa30('0x9')](_0xaa30('0x32'),_0x2dcf9e[_0xaa30('0x7')]),_0x1d3fee);}};exports[_0xaa30('0x33')]=function(_0x19aa09){try{if(!_[_0xaa30('0x23')](channels[_0x19aa09[_0xaa30('0x34')]])){utils[_0xaa30('0x14')](util[_0xaa30('0x9')](_0xaa30('0x35'),_0x19aa09[_0xaa30('0x36')]),_0x19aa09);if(channels[_0x19aa09[_0xaa30('0x34')]]['channel']==_0x19aa09[_0xaa30('0x37')]){utils['info'](util[_0xaa30('0x9')](_0xaa30('0x38'),_0x19aa09[_0xaa30('0x36')],_0x19aa09[_0xaa30('0x34')],_0x19aa09['secondtransfererchannel']));channels[_0x19aa09[_0xaa30('0x34')]][_0xaa30('0x26')]=_0x19aa09['secondtransfererchannel'];channels[_0x19aa09[_0xaa30('0x34')]][_0xaa30('0x39')]=_0xaa30('0x3a');}else if(channels[_0x19aa09['localtwolinkedid']][_0xaa30('0x1a')]=_0x19aa09['transfertargetchannel']){utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0x38'),_0x19aa09[_0xaa30('0x36')],_0x19aa09[_0xaa30('0x34')],_0x19aa09[_0xaa30('0x3b')]));channels[_0x19aa09['localtwolinkedid']][_0xaa30('0x26')]=_0x19aa09['origtransfererchannel'];channels[_0x19aa09['localtwolinkedid']]['userfield']=_0xaa30('0x3a');}}}catch(_0x2320dd){utils[_0xaa30('0x1d')](util[_0xaa30('0x9')](_0xaa30('0x35'),_0x19aa09['origtransfereruniqueid']),_0x2320dd);}};exports[_0xaa30('0x3c')]=function(_0x2577ce){try{if(!_[_0xaa30('0x23')](channels[_0x2577ce[_0xaa30('0x7')]])){utils['debug'](util[_0xaa30('0x9')](_0xaa30('0x3d'),_0x2577ce[_0xaa30('0x7')]),_0x2577ce);channels[_0x2577ce[_0xaa30('0x7')]][_0xaa30('0x3e')]=utils[_0xaa30('0x1b')]();utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0x3f'),_0x2577ce[_0xaa30('0x7')],channels[_0x2577ce['uniqueid']][_0xaa30('0x3e')]));}}catch(_0x5caa31){utils['error'](util['format'](_0xaa30('0x3d'),_0x2577ce[_0xaa30('0x7')]),_0x5caa31);}};exports[_0xaa30('0x40')]=function(_0x184bbd){try{if(!_[_0xaa30('0x23')](channels[_0x184bbd['uniqueid']])){utils[_0xaa30('0x14')](util[_0xaa30('0x9')](_0xaa30('0x41'),_0x184bbd[_0xaa30('0x7')]),_0x184bbd);if(!_[_0xaa30('0x23')](channels[_0x184bbd['uniqueid']][_0xaa30('0x3e')])){channels[_0x184bbd['uniqueid']]['mohtime']+=utils[_0xaa30('0x42')](utils[_0xaa30('0x1b')](),channels[_0x184bbd[_0xaa30('0x7')]]['musiconholdstartAt']);utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0x43'),_0x184bbd[_0xaa30('0x7')],channels[_0x184bbd['uniqueid']][_0xaa30('0x44')]));delete channels[_0x184bbd['uniqueid']][_0xaa30('0x3e')];}}}catch(_0x18b9fb){utils['error'](util[_0xaa30('0x9')]('[%s][calls][musiconholdstop]',_0x184bbd['uniqueid']),_0x18b9fb);}};exports[_0xaa30('0x45')]=function(_0x5c768f){try{if(!_[_0xaa30('0x23')](channels[_0x5c768f[_0xaa30('0x7')]])){utils['debug'](util[_0xaa30('0x9')](_0xaa30('0x46'),_0x5c768f['uniqueid']),_0x5c768f);if(!_['isNil'](_0x5c768f[_0xaa30('0x47')][_0xaa30('0x48')])){utils[_0xaa30('0x8')](util[_0xaa30('0x9')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x5c768f[_0xaa30('0x7')],_0x5c768f[_0xaa30('0x49')]));channels[_0x5c768f[_0xaa30('0x7')]][_0xaa30('0x4a')]=_0x5c768f[_0xaa30('0x49')];}if(!_['isNil'](_0x5c768f[_0xaa30('0x47')][_0xaa30('0x4b')])){utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0x4c'),_0x5c768f[_0xaa30('0x7')],_0x5c768f[_0xaa30('0x49')]));channels[_0x5c768f['uniqueid']][_0xaa30('0x4d')]=_0x5c768f[_0xaa30('0x49')];channels[_0x5c768f[_0xaa30('0x7')]][_0xaa30('0x2b')]='\x22'+_0x5c768f[_0xaa30('0x49')]+_0xaa30('0x4e')+_0x5c768f[_0xaa30('0x49')]+'>';}if(!_['isNil'](_0x5c768f[_0xaa30('0x47')][_0xaa30('0x4f')])||!_[_0xaa30('0x23')](_0x5c768f['variable']['xmd-callerid'])){utils[_0xaa30('0x8')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5c768f[_0xaa30('0x7')],!_[_0xaa30('0x23')](_0x5c768f['variable'][_0xaa30('0x4f')])?_0xaa30('0x4f'):'xmd-callerid',_0x5c768f[_0xaa30('0x49')]));channels[_0x5c768f[_0xaa30('0x7')]][_0xaa30('0x2b')]=_0x5c768f[_0xaa30('0x49')];}if(!_['isNil'](_0x5c768f[_0xaa30('0x47')][_0xaa30('0x50')])||!_[_0xaa30('0x23')](_0x5c768f[_0xaa30('0x47')][_0xaa30('0x51')])){utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0x52'),_0x5c768f['uniqueid'],!_[_0xaa30('0x23')](_0x5c768f['variable'][_0xaa30('0x50')])?_0xaa30('0x50'):_0xaa30('0x51'),_0x5c768f[_0xaa30('0x49')]));channels[_0x5c768f[_0xaa30('0x7')]][_0xaa30('0x53')]=_0xaa30('0x54');channels[_0x5c768f[_0xaa30('0x7')]][_0xaa30('0x55')]=_0x5c768f['value'];channels[_0x5c768f[_0xaa30('0x7')]][_0xaa30('0xb')]=!![];}if(!_['isNil'](_0x5c768f[_0xaa30('0x47')][_0xaa30('0x56')])){utils[_0xaa30('0x8')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x5c768f[_0xaa30('0x7')],_0x5c768f[_0xaa30('0x49')]));channels[_0x5c768f['uniqueid']][_0xaa30('0x57')]=_0x5c768f[_0xaa30('0x49')];}if(!_[_0xaa30('0x23')](_0x5c768f[_0xaa30('0x47')][_0xaa30('0x58')])){utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0x59'),_0x5c768f[_0xaa30('0x7')],_0x5c768f[_0xaa30('0x49')]));channels[_0x5c768f[_0xaa30('0x7')]][_0xaa30('0x5a')]=_0x5c768f['value'];}if(!_['isNil'](_0x5c768f[_0xaa30('0x47')]['outboundrouteid'])){utils[_0xaa30('0x8')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5c768f['uniqueid'],_0x5c768f[_0xaa30('0x49')]));channels[_0x5c768f[_0xaa30('0x7')]][_0xaa30('0x5b')]=_0x5c768f['value'];}if(!_['isNil'](_0x5c768f['variable'][_0xaa30('0x5c')])){utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0x5d'),_0x5c768f['uniqueid'],_0x5c768f[_0xaa30('0x49')]));channels[_0x5c768f[_0xaa30('0x7')]]['sipcallid']=_0x5c768f['value'];}}}catch(_0x355280){utils[_0xaa30('0x1d')](util[_0xaa30('0x9')](_0xaa30('0x46'),_0x5c768f[_0xaa30('0x7')]),_0x355280);}};exports[_0xaa30('0x5e')]=function(_0x539e13){try{if(!_['isNil'](channels[_0x539e13[_0xaa30('0x7')]])){utils[_0xaa30('0x14')](util[_0xaa30('0x9')](_0xaa30('0x5f'),_0x539e13[_0xaa30('0x7')]),_0x539e13);utils[_0xaa30('0x8')](util[_0xaa30('0x9')](_0xaa30('0x60'),_0x539e13[_0xaa30('0x7')],_0x539e13['application'],_0x539e13[_0xaa30('0x61')]));if(_0x539e13[_0xaa30('0x62')]['toLowerCase']()==_0xaa30('0x63')&&_['startsWith'](_0x539e13[_0xaa30('0x61')][_0xaa30('0x64')](),'cdr')){var _0x3fa53c=_0x539e13[_0xaa30('0x61')][_0xaa30('0x65')]('=');var _0x356f7b=_0x3fa53c[0x0][_0xaa30('0x66')](_0x3fa53c[0x0][_0xaa30('0x67')]('(')+0x1,_0x3fa53c[0x0][_0xaa30('0x67')](')'));var _0x1f8be8=_0x3fa53c[0x1];channels[_0x539e13[_0xaa30('0x7')]][_0x356f7b]=_0x1f8be8;}if(!_[_0xaa30('0x68')]([_0xaa30('0x2a'),_0xaa30('0x69'),'execif',_0xaa30('0x63'),_0xaa30('0x6a')],_0x539e13[_0xaa30('0x62')][_0xaa30('0x64')]())){channels[_0x539e13[_0xaa30('0x7')]]['lastapplication']=_0x539e13[_0xaa30('0x62')];channels[_0x539e13['uniqueid']]['lastdata']=_0x539e13[_0xaa30('0x61')];}}}catch(_0x40b636){utils[_0xaa30('0x1d')](util[_0xaa30('0x9')](_0xaa30('0x5f'),_0x539e13[_0xaa30('0x7')]),_0x40b636);}};
\ No newline at end of file
+var _0xb14d=['endtime','duration','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','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','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','application','toLowerCase','set','startsWith','cdr','appdata','substring','lastIndexOf','execif','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xb14d,0x185));var _0xdb14=function(_0x4fd86f,_0x478f36){_0x4fd86f=_0x4fd86f-0x0;var _0x3c8c3d=_0xb14d[_0x4fd86f];return _0x3c8c3d;};'use strict';var _=require(_0xdb14('0x0'));var util=require('util');var utils=require(_0xdb14('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0xdb14('0x2'),'FAILED',_0xdb14('0x3'),_0xdb14('0x2'),_0xdb14('0x2'),_0xdb14('0x2'),_0xdb14('0x4'),_0xdb14('0x5'),'FAILED',_0xdb14('0x3'),'FAILED'];var channels={};function writeDB(_0x43e4e3){var _0x4cb288;if(transfers[_0xdb14('0x6')][_0x43e4e3['uniqueid']]){_0x4cb288=_0x43e4e3[_0xdb14('0x7')];_0x43e4e3[_0xdb14('0x7')]=transfers[_0xdb14('0x6')][_0x43e4e3['uniqueid']]['transfereeuniqueid'];}utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0xa'),_0x43e4e3[_0xdb14('0x7')],_0x43e4e3[_0xdb14('0xb')],_0x43e4e3['queue'],_0x43e4e3[_0xdb14('0xc')],_0x43e4e3[_0xdb14('0xd')],_0x43e4e3[_0xdb14('0xe')],_0x43e4e3[_0xdb14('0xf')],_0x43e4e3['lastevent']));if(_0x43e4e3[_0xdb14('0x10')]){utils['getUserByInternal'](_0x43e4e3[_0xdb14('0x10')])[_0xdb14('0x11')](function(_0x38a99d){if(_0x38a99d){_0x43e4e3[_0xdb14('0x12')]=_0x38a99d['id'];}utils[_0xdb14('0x13')](_0xdb14('0x14'),_0x43e4e3);});}else{utils['request']('CreateVoiceCallReport',_0x43e4e3);}if(channels[_0x43e4e3[_0xdb14('0x7')]]){delete channels[_0x43e4e3[_0xdb14('0x7')]];}else if(_0x4cb288&&channels[_0x4cb288]){delete transfers[_0xdb14('0x6')][_0x4cb288];delete channels[_0x4cb288];}}exports[_0xdb14('0x15')]=function(_0x2bd095){try{utils[_0xdb14('0x16')](util[_0xdb14('0x9')](_0xdb14('0x17'),_0x2bd095[_0xdb14('0x7')]),_0x2bd095);if(_0x2bd095[_0xdb14('0x7')]==_0x2bd095['linkedid']&&_0x2bd095['channel']!=_0xdb14('0x18')){utils[_0xdb14('0x8')](util[_0xdb14('0x9')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x2bd095[_0xdb14('0x7')],_0x2bd095[_0xdb14('0x19')],_0x2bd095[_0xdb14('0x1a')]));channels[_0x2bd095[_0xdb14('0x7')]]={'uniqueid':_0x2bd095[_0xdb14('0x7')],'accountcode':_0x2bd095['accountcode'],'source':_0x2bd095[_0xdb14('0xe')],'destination':_0x2bd095[_0xdb14('0x1a')],'destinationcontext':_0x2bd095['context'],'channel':_0x2bd095['channel'],'starttime':utils[_0xdb14('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xdb14('0x2'),'amaflags':_0xdb14('0x1c')};}}catch(_0x1b68a1){utils[_0xdb14('0x1d')](util[_0xdb14('0x9')](_0xdb14('0x17'),_0x2bd095[_0xdb14('0x7')]),_0x1b68a1);}};exports[_0xdb14('0x1e')]=function(_0x17d47e){try{utils['debug'](util[_0xdb14('0x9')](_0xdb14('0x1f'),_0x17d47e[_0xdb14('0x7')]),_0x17d47e);if(!_[_0xdb14('0x20')](channels[_0x17d47e[_0xdb14('0x7')]])&&_0x17d47e[_0xdb14('0x21')]==0x6){utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0x22'),_0x17d47e['uniqueid'],_0x17d47e['context'],_0x17d47e[_0xdb14('0xb')]));if(_[_0xdb14('0x20')](channels[_0x17d47e[_0xdb14('0x7')]]['systemanswertime'])){channels[_0x17d47e['uniqueid']][_0xdb14('0x23')]=utils[_0xdb14('0x1b')]();}}else if(!_[_0xdb14('0x20')](channels[_0x17d47e[_0xdb14('0x24')]])&&_0x17d47e[_0xdb14('0x21')]==0x6&&_0x17d47e[_0xdb14('0x19')]!='transfer'){utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0x25'),_0x17d47e['uniqueid'],_0x17d47e[_0xdb14('0x24')],_0x17d47e[_0xdb14('0x19')],_0x17d47e[_0xdb14('0xb')]));channels[_0x17d47e[_0xdb14('0x24')]]['accountcode']=_0x17d47e[_0xdb14('0x10')];channels[_0x17d47e[_0xdb14('0x24')]][_0xdb14('0x26')]=_0x17d47e['channel'];if(_[_0xdb14('0x20')](channels[_0x17d47e['linkedid']][_0xdb14('0x27')])){channels[_0x17d47e[_0xdb14('0x24')]][_0xdb14('0x27')]=utils[_0xdb14('0x1b')]();}channels[_0x17d47e[_0xdb14('0x24')]][_0xdb14('0x28')]=dispositions[_[_0xdb14('0x29')](_0x17d47e[_0xdb14('0x21')])]||'ANSWERED';}}catch(_0xfebe80){utils[_0xdb14('0x1d')](util[_0xdb14('0x9')](_0xdb14('0x1f'),_0x17d47e[_0xdb14('0x7')]),_0xfebe80);}};exports[_0xdb14('0x2a')]=function(_0x448c42){try{if(!_[_0xdb14('0x20')](channels[_0x448c42[_0xdb14('0x7')]])){utils[_0xdb14('0x16')](util[_0xdb14('0x9')](_0xdb14('0x2b'),_0x448c42['uniqueid']),_0x448c42);if(_[_0xdb14('0x20')](channels[_0x448c42[_0xdb14('0x7')]]['callerid'])){channels[_0x448c42['uniqueid']][_0xdb14('0x2c')]=_0x448c42[_0xdb14('0x2d')]+'\x20<'+_0x448c42[_0xdb14('0xe')]+'>';}utils[_0xdb14('0x8')](util[_0xdb14('0x9')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x448c42['uniqueid'],channels[_0x448c42['uniqueid']][_0xdb14('0x2c')],_0x448c42[_0xdb14('0x2e')]));channels[_0x448c42['uniqueid']][_0xdb14('0x2f')]=utils[_0xdb14('0x1b')]();channels[_0x448c42[_0xdb14('0x7')]][_0xdb14('0x30')]=utils['diffTime'](channels[_0x448c42['uniqueid']][_0xdb14('0x2f')],channels[_0x448c42[_0xdb14('0x7')]]['starttime']);channels[_0x448c42[_0xdb14('0x7')]][_0xdb14('0x31')]=channels[_0x448c42[_0xdb14('0x7')]][_0xdb14('0x27')]?utils[_0xdb14('0x32')](channels[_0x448c42[_0xdb14('0x7')]][_0xdb14('0x2f')],channels[_0x448c42['uniqueid']][_0xdb14('0x27')]):0x0;writeDB(channels[_0x448c42['uniqueid']]);}}catch(_0x50f8be){utils['error'](util[_0xdb14('0x9')](_0xdb14('0x2b'),_0x448c42[_0xdb14('0x7')]),_0x50f8be);}};exports[_0xdb14('0x33')]=function(_0x37cc82){try{if(!_['isNil'](channels[_0x37cc82[_0xdb14('0x34')]])){utils['debug'](util['format'](_0xdb14('0x35'),_0x37cc82[_0xdb14('0x36')]),_0x37cc82);if(channels[_0x37cc82[_0xdb14('0x34')]]['channel']==_0x37cc82[_0xdb14('0x37')]){utils[_0xdb14('0x8')](util['format'](_0xdb14('0x38'),_0x37cc82[_0xdb14('0x36')],_0x37cc82[_0xdb14('0x34')],_0x37cc82[_0xdb14('0x39')]));channels[_0x37cc82['localtwolinkedid']]['destinationchannel']=_0x37cc82['secondtransfererchannel'];channels[_0x37cc82[_0xdb14('0x34')]]['userfield']='_attended';}else if(channels[_0x37cc82[_0xdb14('0x34')]][_0xdb14('0xb')]=_0x37cc82[_0xdb14('0x3a')]){utils['info'](util[_0xdb14('0x9')](_0xdb14('0x38'),_0x37cc82[_0xdb14('0x36')],_0x37cc82[_0xdb14('0x34')],_0x37cc82[_0xdb14('0x3b')]));channels[_0x37cc82[_0xdb14('0x34')]][_0xdb14('0x26')]=_0x37cc82[_0xdb14('0x3b')];channels[_0x37cc82[_0xdb14('0x34')]]['userfield']=_0xdb14('0x3c');}}}catch(_0x2684ba){utils[_0xdb14('0x1d')](util[_0xdb14('0x9')](_0xdb14('0x35'),_0x37cc82[_0xdb14('0x36')]),_0x2684ba);}};exports[_0xdb14('0x3d')]=function(_0x5c8e27){try{if(!_[_0xdb14('0x20')](channels[_0x5c8e27[_0xdb14('0x7')]])){utils[_0xdb14('0x16')](util['format'](_0xdb14('0x3e'),_0x5c8e27['uniqueid']),_0x5c8e27);channels[_0x5c8e27['uniqueid']][_0xdb14('0x3f')]=utils[_0xdb14('0x1b')]();utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0x40'),_0x5c8e27['uniqueid'],channels[_0x5c8e27['uniqueid']][_0xdb14('0x3f')]));}}catch(_0x4278f1){utils[_0xdb14('0x1d')](util[_0xdb14('0x9')](_0xdb14('0x3e'),_0x5c8e27[_0xdb14('0x7')]),_0x4278f1);}};exports['musiconholdstop']=function(_0x4e0661){try{if(!_[_0xdb14('0x20')](channels[_0x4e0661['uniqueid']])){utils['debug'](util[_0xdb14('0x9')](_0xdb14('0x41'),_0x4e0661[_0xdb14('0x7')]),_0x4e0661);if(!_['isNil'](channels[_0x4e0661[_0xdb14('0x7')]][_0xdb14('0x3f')])){channels[_0x4e0661['uniqueid']][_0xdb14('0x42')]+=utils[_0xdb14('0x32')](utils[_0xdb14('0x1b')](),channels[_0x4e0661[_0xdb14('0x7')]][_0xdb14('0x3f')]);utils[_0xdb14('0x8')](util[_0xdb14('0x9')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x4e0661[_0xdb14('0x7')],channels[_0x4e0661['uniqueid']][_0xdb14('0x42')]));delete channels[_0x4e0661[_0xdb14('0x7')]][_0xdb14('0x3f')];}}}catch(_0x2872ca){utils[_0xdb14('0x1d')](util[_0xdb14('0x9')](_0xdb14('0x41'),_0x4e0661[_0xdb14('0x7')]),_0x2872ca);}};exports[_0xdb14('0x43')]=function(_0x59bc90){try{if(!_[_0xdb14('0x20')](channels[_0x59bc90[_0xdb14('0x7')]])){utils[_0xdb14('0x16')](util[_0xdb14('0x9')]('[%s][calls][varset]',_0x59bc90[_0xdb14('0x7')]),_0x59bc90);if(!_[_0xdb14('0x20')](_0x59bc90[_0xdb14('0x44')][_0xdb14('0x45')])){utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0x46'),_0x59bc90[_0xdb14('0x7')],_0x59bc90[_0xdb14('0x47')]));channels[_0x59bc90['uniqueid']][_0xdb14('0x48')]=_0x59bc90[_0xdb14('0x47')];}if(!_['isNil'](_0x59bc90[_0xdb14('0x44')][_0xdb14('0x49')])){utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0x4a'),_0x59bc90['uniqueid'],_0x59bc90[_0xdb14('0x47')]));channels[_0x59bc90[_0xdb14('0x7')]][_0xdb14('0x4b')]=_0x59bc90['value'];channels[_0x59bc90[_0xdb14('0x7')]][_0xdb14('0x2c')]='\x22'+_0x59bc90['value']+_0xdb14('0x4c')+_0x59bc90[_0xdb14('0x47')]+'>';}if(!_[_0xdb14('0x20')](_0x59bc90[_0xdb14('0x44')][_0xdb14('0x4d')])||!_[_0xdb14('0x20')](_0x59bc90[_0xdb14('0x44')][_0xdb14('0x4e')])){utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0x4f'),_0x59bc90['uniqueid'],!_['isNil'](_0x59bc90['variable'][_0xdb14('0x4d')])?_0xdb14('0x4d'):_0xdb14('0x4e'),_0x59bc90['value']));channels[_0x59bc90['uniqueid']][_0xdb14('0x2c')]=_0x59bc90[_0xdb14('0x47')];}if(!_['isNil'](_0x59bc90[_0xdb14('0x44')][_0xdb14('0x50')])||!_[_0xdb14('0x20')](_0x59bc90[_0xdb14('0x44')][_0xdb14('0x51')])){utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0x4f'),_0x59bc90['uniqueid'],!_[_0xdb14('0x20')](_0x59bc90[_0xdb14('0x44')]['xmd-queue'])?_0xdb14('0x50'):_0xdb14('0x51'),_0x59bc90['value']));channels[_0x59bc90[_0xdb14('0x7')]][_0xdb14('0x52')]=_0xdb14('0x53');channels[_0x59bc90[_0xdb14('0x7')]][_0xdb14('0x54')]=_0x59bc90[_0xdb14('0x47')];channels[_0x59bc90[_0xdb14('0x7')]][_0xdb14('0x55')]=!![];}if(!_['isNil'](_0x59bc90['variable'][_0xdb14('0x56')])){utils['info'](util['format'](_0xdb14('0x57'),_0x59bc90[_0xdb14('0x7')],_0x59bc90[_0xdb14('0x47')]));channels[_0x59bc90['uniqueid']][_0xdb14('0x58')]=_0x59bc90[_0xdb14('0x47')];}if(!_[_0xdb14('0x20')](_0x59bc90[_0xdb14('0x44')][_0xdb14('0x59')])){utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0x5a'),_0x59bc90[_0xdb14('0x7')],_0x59bc90[_0xdb14('0x47')]));channels[_0x59bc90[_0xdb14('0x7')]][_0xdb14('0x5b')]=_0x59bc90[_0xdb14('0x47')];}if(!_['isNil'](_0x59bc90[_0xdb14('0x44')][_0xdb14('0x5c')])){utils[_0xdb14('0x8')](util[_0xdb14('0x9')](_0xdb14('0x5d'),_0x59bc90['uniqueid'],_0x59bc90['value']));channels[_0x59bc90['uniqueid']][_0xdb14('0x5e')]=_0x59bc90[_0xdb14('0x47')];}if(!_[_0xdb14('0x20')](_0x59bc90[_0xdb14('0x44')]['sipcallid'])){utils[_0xdb14('0x8')](util['format'](_0xdb14('0x5f'),_0x59bc90[_0xdb14('0x7')],_0x59bc90[_0xdb14('0x47')]));channels[_0x59bc90[_0xdb14('0x7')]][_0xdb14('0x60')]=_0x59bc90[_0xdb14('0x47')];}}}catch(_0x4b676d){utils['error'](util[_0xdb14('0x9')](_0xdb14('0x61'),_0x59bc90[_0xdb14('0x7')]),_0x4b676d);}};exports[_0xdb14('0x62')]=function(_0x3671e3){try{if(!_[_0xdb14('0x20')](channels[_0x3671e3['uniqueid']])){utils[_0xdb14('0x16')](util[_0xdb14('0x9')](_0xdb14('0x63'),_0x3671e3[_0xdb14('0x7')]),_0x3671e3);utils['info'](util[_0xdb14('0x9')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3671e3[_0xdb14('0x7')],_0x3671e3[_0xdb14('0x64')],_0x3671e3['appdata']));if(_0x3671e3[_0xdb14('0x64')][_0xdb14('0x65')]()==_0xdb14('0x66')&&_[_0xdb14('0x67')](_0x3671e3['appdata']['toLowerCase'](),_0xdb14('0x68'))){var _0xebf8f9=_0x3671e3[_0xdb14('0x69')]['split']('=');var _0x22a63e=_0xebf8f9[0x0][_0xdb14('0x6a')](_0xebf8f9[0x0]['lastIndexOf']('(')+0x1,_0xebf8f9[0x0][_0xdb14('0x6b')](')'));var _0x1458ae=_0xebf8f9[0x1];channels[_0x3671e3[_0xdb14('0x7')]][_0x22a63e]=_0x1458ae;}if(!_['includes']([_0xdb14('0x2a'),'noop',_0xdb14('0x6c'),_0xdb14('0x66'),'gotoif'],_0x3671e3[_0xdb14('0x64')][_0xdb14('0x65')]())){channels[_0x3671e3['uniqueid']][_0xdb14('0x52')]=_0x3671e3[_0xdb14('0x64')];channels[_0x3671e3[_0xdb14('0x7')]][_0xdb14('0x54')]=_0x3671e3[_0xdb14('0x69')];}}}catch(_0x5cc985){utils['error'](util[_0xdb14('0x9')]('[%s][calls][newexten]',_0x3671e3[_0xdb14('0x7')]),_0x5cc985);}};
\ No newline at end of file
index 37b9822..ffa218e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4b=['[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','./utils','info'];(function(_0x1009f1,_0x36bcca){var _0x3dbc70=function(_0xb626a6){while(--_0xb626a6){_0x1009f1['push'](_0x1009f1['shift']());}};_0x3dbc70(++_0x36bcca);}(_0xdd4b,0x11e));var _0xbdd4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdd4b[_0x3bf83f];return _0x22c4a9;};'use strict';var utils=require(_0xbdd4('0x0'));exports['connect']=function(){utils[_0xbdd4('0x1')](_0xbdd4('0x2'));};exports['shutdown']=function(){utils[_0xbdd4('0x1')](_0xbdd4('0x3'));};exports[_0xbdd4('0x4')]=function(){utils[_0xbdd4('0x1')](_0xbdd4('0x5'));};exports[_0xbdd4('0x6')]=function(_0x50f796){utils['error'](_0xbdd4('0x7'),_0x50f796);};exports['close']=function(){utils[_0xbdd4('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x5769c2){};
\ No newline at end of file
+var _0xc522=['info','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect'];(function(_0x5bcd82,_0x5aa492){var _0x34e619=function(_0x11db75){while(--_0x11db75){_0x5bcd82['push'](_0x5bcd82['shift']());}};_0x34e619(++_0x5aa492);}(_0xc522,0xa3));var _0x2c52=function(_0x61a191,_0x511aaa){_0x61a191=_0x61a191-0x0;var _0xb4307d=_0xc522[_0x61a191];return _0xb4307d;};'use strict';var utils=require(_0x2c52('0x0'));exports[_0x2c52('0x1')]=function(){utils[_0x2c52('0x2')]('[core]\x20connected');};exports[_0x2c52('0x3')]=function(){utils[_0x2c52('0x2')]('[core]\x20shutdown');};exports[_0x2c52('0x4')]=function(){utils['info'](_0x2c52('0x5'));};exports['error']=function(_0x2f1615){utils[_0x2c52('0x6')](_0x2c52('0x7'),_0x2f1615);};exports[_0x2c52('0x8')]=function(){utils[_0x2c52('0x2')](_0x2c52('0x9'));};exports[_0x2c52('0xa')]=function(_0x181d22){};
\ No newline at end of file
index 8a81c35..aad56d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbef=['[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','application','appdata','set','startsWith','cdr(routeid)','error','varset','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','[%s][dials][varset]','dialbegin','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','answertime'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdbef,0x1eb));var _0xfdbe=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xdbef[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0xfdbe('0x0'));var util=require(_0xfdbe('0x1'));var utils=require(_0xfdbe('0x2'));var dials={};function writeDB(_0x2e67b9){utils[_0xfdbe('0x3')](util[_0xfdbe('0x4')](_0xfdbe('0x5'),_0x2e67b9['uniqueid'],_0x2e67b9[_0xfdbe('0x6')],_0x2e67b9[_0xfdbe('0x7')],_0x2e67b9[_0xfdbe('0x8')],_0x2e67b9[_0xfdbe('0x9')],_0x2e67b9[_0xfdbe('0xa')]));utils[_0xfdbe('0xb')](_0xfdbe('0xc'),_0x2e67b9);delete dials[_0x2e67b9[_0xfdbe('0xd')]];}exports[_0xfdbe('0xe')]=function(_0x275f26){try{utils[_0xfdbe('0xf')](util['format'](_0xfdbe('0x10'),_0x275f26[_0xfdbe('0xd')]),_0x275f26);utils[_0xfdbe('0x3')](util[_0xfdbe('0x4')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x275f26[_0xfdbe('0xd')],_0x275f26[_0xfdbe('0x11')],_0x275f26[_0xfdbe('0x12')]));if(_0x275f26['application']['toLowerCase']()==_0xfdbe('0x13')&&_[_0xfdbe('0x14')](_0x275f26[_0xfdbe('0x12')]['toLowerCase'](),_0xfdbe('0x15'))){var _0x103f7b=_0x275f26[_0xfdbe('0x12')]['split']('=');dials[_0x275f26[_0xfdbe('0xd')]]={'routeId':_0x103f7b[0x1]};}}catch(_0x30be64){utils[_0xfdbe('0x16')](util['format']('[%s][dials][newexten]',_0x275f26[_0xfdbe('0xd')]),_0x30be64);}};exports[_0xfdbe('0x17')]=function(_0x193ca7){try{utils[_0xfdbe('0xf')](util[_0xfdbe('0x4')]('[%s][dials][varset]',_0x193ca7[_0xfdbe('0xd')]),_0x193ca7);if(!_[_0xfdbe('0x18')](_0x193ca7[_0xfdbe('0x19')]['outboundrouteid'])){utils[_0xfdbe('0x3')](util['format'](_0xfdbe('0x1a'),_0x193ca7['uniqueid'],_0x193ca7['value']));dials[_0x193ca7['uniqueid']]={'routeId':_0x193ca7['value']};}}catch(_0x38dd7c){utils[_0xfdbe('0x16')](util['format'](_0xfdbe('0x1b'),_0x193ca7[_0xfdbe('0xd')]),_0x38dd7c);}};exports[_0xfdbe('0x1c')]=function(_0x2f69aa){try{if(!_[_0xfdbe('0x18')](dials[_0x2f69aa[_0xfdbe('0xd')]])){utils[_0xfdbe('0xf')](util[_0xfdbe('0x4')]('[%s][dials][dialbegin]',_0x2f69aa[_0xfdbe('0xd')]),_0x2f69aa);dials[_0x2f69aa[_0xfdbe('0xd')]]=_[_0xfdbe('0x1d')](dials[_0x2f69aa[_0xfdbe('0xd')]],_0x2f69aa);dials[_0x2f69aa[_0xfdbe('0xd')]][_0xfdbe('0x1e')]=utils[_0xfdbe('0x1f')]();dials[_0x2f69aa[_0xfdbe('0xd')]]['lastevent']=_0xfdbe('0x20');utils['info'](util[_0xfdbe('0x4')](_0xfdbe('0x21'),_0x2f69aa[_0xfdbe('0xd')],dials[_0x2f69aa['uniqueid']][_0xfdbe('0x1e')]));}}catch(_0x2be6f2){utils[_0xfdbe('0x16')](util[_0xfdbe('0x4')]('[%s][dials][dialbegin]',_0x2f69aa[_0xfdbe('0xd')]),_0x2be6f2);}};exports[_0xfdbe('0x22')]=function(_0x410732){try{if(!_[_0xfdbe('0x18')](dials[_0x410732[_0xfdbe('0xd')]])){utils[_0xfdbe('0xf')](util[_0xfdbe('0x4')](_0xfdbe('0x23'),_0x410732[_0xfdbe('0xd')]),_0x410732);dials[_0x410732['uniqueid']][_0xfdbe('0xa')]=_0x410732[_0xfdbe('0xa')];if(_0x410732[_0xfdbe('0xa')]=='ANSWER'){dials[_0x410732[_0xfdbe('0xd')]]=_[_0xfdbe('0x1d')](dials[_0x410732[_0xfdbe('0xd')]],_0x410732);dials[_0x410732[_0xfdbe('0xd')]][_0xfdbe('0x24')]=utils[_0xfdbe('0x1f')]();dials[_0x410732[_0xfdbe('0xd')]]['lastevent']='connect';utils['info'](util[_0xfdbe('0x4')](_0xfdbe('0x25'),_0x410732[_0xfdbe('0xd')],_0x410732[_0xfdbe('0xa')],dials[_0x410732[_0xfdbe('0xd')]][_0xfdbe('0x24')]));}else{utils[_0xfdbe('0x3')](util[_0xfdbe('0x4')](_0xfdbe('0x26'),_0x410732[_0xfdbe('0xd')],_0x410732['dialstatus']));}}}catch(_0x1dceac){utils[_0xfdbe('0x16')](util[_0xfdbe('0x4')](_0xfdbe('0x23'),_0x410732[_0xfdbe('0xd')]),_0x1dceac);}};exports[_0xfdbe('0x27')]=function(_0x297d99){try{if(!_[_0xfdbe('0x18')](dials[_0x297d99[_0xfdbe('0xd')]])){utils[_0xfdbe('0xf')](util[_0xfdbe('0x4')](_0xfdbe('0x28'),_0x297d99['uniqueid']),_0x297d99);utils[_0xfdbe('0x3')](util[_0xfdbe('0x4')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x297d99[_0xfdbe('0xd')],_0x297d99[_0xfdbe('0x8')],_0x297d99[_0xfdbe('0x29')],_0x297d99[_0xfdbe('0x2a')]));dials[_0x297d99[_0xfdbe('0xd')]]=_[_0xfdbe('0x1d')](dials[_0x297d99[_0xfdbe('0xd')]],{'endtime':utils[_0xfdbe('0x1f')](),'lastevent':_0xfdbe('0x2b')});dials[_0x297d99['uniqueid']][_0xfdbe('0x2c')]=utils[_0xfdbe('0x2d')](dials[_0x297d99[_0xfdbe('0xd')]]['endtime'],dials[_0x297d99[_0xfdbe('0xd')]][_0xfdbe('0x1e')]);dials[_0x297d99['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x297d99[_0xfdbe('0xd')]][_0xfdbe('0x24')]||dials[_0x297d99['uniqueid']][_0xfdbe('0x2e')],dials[_0x297d99['uniqueid']]['starttime']);dials[_0x297d99[_0xfdbe('0xd')]][_0xfdbe('0x2f')]=dials[_0x297d99['uniqueid']][_0xfdbe('0x24')]?utils[_0xfdbe('0x2d')](dials[_0x297d99[_0xfdbe('0xd')]]['endtime'],dials[_0x297d99[_0xfdbe('0xd')]][_0xfdbe('0x24')]):0x0;writeDB(dials[_0x297d99['uniqueid']]);}}catch(_0x791f85){utils[_0xfdbe('0x16')](util['format']('[%s][dials][hangup]',_0x297d99[_0xfdbe('0xd')]),_0x791f85);}};
\ No newline at end of file
+var _0xd2ab=['[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','dialstatus','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','channel','dialstring','calleridnum','connectedlinenum','request','uniqueid','newexten','[%s][dials][newexten]','application','toLowerCase','set','startsWith','cdr(routeid)','error','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','starttime','now','called'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd2ab,0x10e));var _0xbd2a=function(_0x17ea0b,_0x228975){_0x17ea0b=_0x17ea0b-0x0;var _0x8130dd=_0xd2ab[_0x17ea0b];return _0x8130dd;};'use strict';var _=require(_0xbd2a('0x0'));var util=require(_0xbd2a('0x1'));var utils=require(_0xbd2a('0x2'));var dials={};function writeDB(_0x22b491){utils[_0xbd2a('0x3')](util[_0xbd2a('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x22b491['uniqueid'],_0x22b491[_0xbd2a('0x5')],_0x22b491[_0xbd2a('0x6')],_0x22b491[_0xbd2a('0x7')],_0x22b491[_0xbd2a('0x8')],_0x22b491['dialstatus']));utils[_0xbd2a('0x9')]('CreateVoiceDialReport',_0x22b491);delete dials[_0x22b491[_0xbd2a('0xa')]];}exports[_0xbd2a('0xb')]=function(_0x458c5b){try{utils['debug'](util[_0xbd2a('0x4')](_0xbd2a('0xc'),_0x458c5b['uniqueid']),_0x458c5b);utils['info'](util[_0xbd2a('0x4')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x458c5b['uniqueid'],_0x458c5b[_0xbd2a('0xd')],_0x458c5b['appdata']));if(_0x458c5b['application'][_0xbd2a('0xe')]()==_0xbd2a('0xf')&&_[_0xbd2a('0x10')](_0x458c5b['appdata'][_0xbd2a('0xe')](),_0xbd2a('0x11'))){var _0xad21a1=_0x458c5b['appdata']['split']('=');dials[_0x458c5b['uniqueid']]={'routeId':_0xad21a1[0x1]};}}catch(_0x49b668){utils[_0xbd2a('0x12')](util[_0xbd2a('0x4')](_0xbd2a('0xc'),_0x458c5b[_0xbd2a('0xa')]),_0x49b668);}};exports['varset']=function(_0x244cbc){try{utils[_0xbd2a('0x13')](util[_0xbd2a('0x4')](_0xbd2a('0x14'),_0x244cbc[_0xbd2a('0xa')]),_0x244cbc);if(!_[_0xbd2a('0x15')](_0x244cbc[_0xbd2a('0x16')][_0xbd2a('0x17')])){utils[_0xbd2a('0x3')](util[_0xbd2a('0x4')](_0xbd2a('0x18'),_0x244cbc[_0xbd2a('0xa')],_0x244cbc[_0xbd2a('0x19')]));dials[_0x244cbc[_0xbd2a('0xa')]]={'routeId':_0x244cbc['value']};}}catch(_0x58cfe2){utils[_0xbd2a('0x12')](util[_0xbd2a('0x4')](_0xbd2a('0x14'),_0x244cbc[_0xbd2a('0xa')]),_0x58cfe2);}};exports[_0xbd2a('0x1a')]=function(_0x2decb2){try{if(!_[_0xbd2a('0x15')](dials[_0x2decb2[_0xbd2a('0xa')]])){utils[_0xbd2a('0x13')](util[_0xbd2a('0x4')]('[%s][dials][dialbegin]',_0x2decb2[_0xbd2a('0xa')]),_0x2decb2);dials[_0x2decb2['uniqueid']]=_['assign'](dials[_0x2decb2[_0xbd2a('0xa')]],_0x2decb2);dials[_0x2decb2[_0xbd2a('0xa')]][_0xbd2a('0x1b')]=utils[_0xbd2a('0x1c')]();dials[_0x2decb2[_0xbd2a('0xa')]]['lastevent']=_0xbd2a('0x1d');utils[_0xbd2a('0x3')](util[_0xbd2a('0x4')](_0xbd2a('0x1e'),_0x2decb2[_0xbd2a('0xa')],dials[_0x2decb2[_0xbd2a('0xa')]][_0xbd2a('0x1b')]));}}catch(_0x549280){utils['error'](util[_0xbd2a('0x4')](_0xbd2a('0x1f'),_0x2decb2['uniqueid']),_0x549280);}};exports[_0xbd2a('0x20')]=function(_0x209ce1){try{if(!_[_0xbd2a('0x15')](dials[_0x209ce1[_0xbd2a('0xa')]])){utils['debug'](util[_0xbd2a('0x4')](_0xbd2a('0x21'),_0x209ce1[_0xbd2a('0xa')]),_0x209ce1);dials[_0x209ce1[_0xbd2a('0xa')]]['dialstatus']=_0x209ce1[_0xbd2a('0x22')];if(_0x209ce1[_0xbd2a('0x22')]=='ANSWER'){dials[_0x209ce1['uniqueid']]=_[_0xbd2a('0x23')](dials[_0x209ce1['uniqueid']],_0x209ce1);dials[_0x209ce1[_0xbd2a('0xa')]][_0xbd2a('0x24')]=utils[_0xbd2a('0x1c')]();dials[_0x209ce1[_0xbd2a('0xa')]]['lastevent']=_0xbd2a('0x25');utils[_0xbd2a('0x3')](util[_0xbd2a('0x4')](_0xbd2a('0x26'),_0x209ce1['uniqueid'],_0x209ce1['dialstatus'],dials[_0x209ce1[_0xbd2a('0xa')]]['answertime']));}else{utils[_0xbd2a('0x3')](util[_0xbd2a('0x4')](_0xbd2a('0x27'),_0x209ce1['uniqueid'],_0x209ce1[_0xbd2a('0x22')]));}}}catch(_0x1edf1f){utils[_0xbd2a('0x12')](util[_0xbd2a('0x4')]('[%s][dials][dialend]',_0x209ce1[_0xbd2a('0xa')]),_0x1edf1f);}};exports[_0xbd2a('0x28')]=function(_0x5ef9da){try{if(!_['isNil'](dials[_0x5ef9da[_0xbd2a('0xa')]])){utils[_0xbd2a('0x13')](util['format'](_0xbd2a('0x29'),_0x5ef9da[_0xbd2a('0xa')]),_0x5ef9da);utils['info'](util['format'](_0xbd2a('0x2a'),_0x5ef9da['uniqueid'],_0x5ef9da[_0xbd2a('0x7')],_0x5ef9da[_0xbd2a('0x2b')],_0x5ef9da[_0xbd2a('0x2c')]));dials[_0x5ef9da[_0xbd2a('0xa')]]=_[_0xbd2a('0x23')](dials[_0x5ef9da[_0xbd2a('0xa')]],{'endtime':utils[_0xbd2a('0x1c')](),'lastevent':'complete'});dials[_0x5ef9da[_0xbd2a('0xa')]][_0xbd2a('0x2d')]=utils[_0xbd2a('0x2e')](dials[_0x5ef9da[_0xbd2a('0xa')]][_0xbd2a('0x2f')],dials[_0x5ef9da[_0xbd2a('0xa')]][_0xbd2a('0x1b')]);dials[_0x5ef9da[_0xbd2a('0xa')]][_0xbd2a('0x30')]=utils['diffTime'](dials[_0x5ef9da[_0xbd2a('0xa')]][_0xbd2a('0x24')]||dials[_0x5ef9da[_0xbd2a('0xa')]]['endtime'],dials[_0x5ef9da[_0xbd2a('0xa')]][_0xbd2a('0x1b')]);dials[_0x5ef9da[_0xbd2a('0xa')]][_0xbd2a('0x31')]=dials[_0x5ef9da[_0xbd2a('0xa')]][_0xbd2a('0x24')]?utils['diffTime'](dials[_0x5ef9da[_0xbd2a('0xa')]][_0xbd2a('0x2f')],dials[_0x5ef9da[_0xbd2a('0xa')]]['answertime']):0x0;writeDB(dials[_0x5ef9da[_0xbd2a('0xa')]]);}}catch(_0x499fdb){utils[_0xbd2a('0x12')](util['format'](_0xbd2a('0x29'),_0x5ef9da['uniqueid']),_0x499fdb);}};
\ No newline at end of file
index 8e14e0d..91b7d80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x046e=['origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','port','password','keepConnected','xdr','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','debug','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','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','[%s][index][attendedtransfer]'];(function(_0x2e5302,_0x2b1247){var _0x58d1c3=function(_0x2d77c7){while(--_0x2d77c7){_0x2e5302['push'](_0x2e5302['shift']());}};_0x58d1c3(++_0x2b1247);}(_0x046e,0x18b));var _0xe046=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x046e[_0x3e112d];return _0x531c31;};var AsteriskManager=require(_0xe046('0x0'));var config=require(_0xe046('0x1'));var utils=require('./utils');var util=require(_0xe046('0x2'));var ami=new AsteriskManager(config[_0xe046('0x3')][_0xe046('0x4')],config['asterisk']['ip'],config[_0xe046('0x3')]['username'],config[_0xe046('0x3')][_0xe046('0x5')],!![]);ami[_0xe046('0x6')]();if(config[_0xe046('0x7')]&&config[_0xe046('0x7')]['disabled']){utils[_0xe046('0x8')]('XDR\x20DISABLED');}else{var agents=require(_0xe046('0x9'));var calls=require(_0xe046('0xa'));var queues=require(_0xe046('0xb'));var recordings=require(_0xe046('0xc'));var members=require('./members.controller');var dials=require(_0xe046('0xd'));var transfers=require(_0xe046('0xe'));var core=require('./core.controller');ami['on']('connect',core[_0xe046('0xf')]);ami['on'](_0xe046('0x10'),core[_0xe046('0x10')]);ami['on'](_0xe046('0x11'),core['fullybooted']);ami['on'](_0xe046('0x12'),core[_0xe046('0x12')]);ami['on'](_0xe046('0x13'),core[_0xe046('0x13')]);ami['on'](_0xe046('0x14'),core[_0xe046('0x14')]);ami['on']('devicestatechange',function(_0x369fe1){try{utils['debug'](util[_0xe046('0x15')](_0xe046('0x16'),_0x369fe1[_0xe046('0x17')]),_0x369fe1);members['devicestatechange'](_0x369fe1);}catch(_0x1dc8ad){utils[_0xe046('0x12')](util['format'](_0xe046('0x16'),_0x369fe1[_0xe046('0x17')]),_0x1dc8ad);}});ami['on'](_0xe046('0x18'),function(_0x4422bb){try{utils['debug'](util['format'](_0xe046('0x19'),_0x4422bb['uniqueid']),_0x4422bb);agents[_0xe046('0x18')](_0x4422bb);}catch(_0x5540f6){utils[_0xe046('0x12')](util[_0xe046('0x15')]('[%s][index][agentcalled]',_0x4422bb[_0xe046('0x1a')]),_0x5540f6);}});ami['on']('agentringnoanswer',function(_0xb49337){try{utils['debug'](util[_0xe046('0x15')](_0xe046('0x1b'),_0xb49337[_0xe046('0x1a')]),_0xb49337);agents[_0xe046('0x1c')](_0xb49337);}catch(_0x1dadaa){utils[_0xe046('0x12')](util['format'](_0xe046('0x1b'),_0xb49337[_0xe046('0x1a')]),_0x1dadaa);}});ami['on'](_0xe046('0x1d'),function(_0x38f152){try{utils['debug'](util[_0xe046('0x15')](_0xe046('0x1e'),_0x38f152['uniqueid']),_0x38f152);agents['agentconnect'](_0x38f152);queues[_0xe046('0x1d')](_0x38f152);}catch(_0x1da51b){utils[_0xe046('0x12')](util['format']('[%s][index][agentconnect]',_0x38f152[_0xe046('0x1a')]),_0x1da51b);}});ami['on']('agentcomplete',function(_0xe5b9bc){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')](_0xe046('0x20'),_0xe5b9bc[_0xe046('0x1a')]),_0xe5b9bc);agents[_0xe046('0x21')](_0xe5b9bc);queues[_0xe046('0x21')](_0xe5b9bc);members[_0xe046('0x21')](_0xe5b9bc);}catch(_0x54ad88){utils['error'](util[_0xe046('0x15')]('[%s][index][agentcomplete]',_0xe5b9bc[_0xe046('0x1a')]),_0x54ad88);}});ami['on'](_0xe046('0x22'),function(_0x605041){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')](_0xe046('0x23'),_0x605041['uniqueid']),_0x605041);agents[_0xe046('0x22')](_0x605041);queues['queuecallerabandon'](_0x605041);}catch(_0x2e49b5){utils[_0xe046('0x12')](util[_0xe046('0x15')]('[%s][index][queuecallerabandon]',_0x605041[_0xe046('0x1a')]),_0x2e49b5);}});ami['on']('queuecallerjoin',function(_0x1fbdf7){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')](_0xe046('0x24'),_0x1fbdf7['uniqueid']),_0x1fbdf7);queues[_0xe046('0x25')](_0x1fbdf7);recordings[_0xe046('0x25')](_0x1fbdf7);}catch(_0x1dc581){utils['error'](util[_0xe046('0x15')]('[%s][index][queuecallerjoin]',_0x1fbdf7[_0xe046('0x1a')]),_0x1dc581);}});ami['on'](_0xe046('0x26'),function(_0xdd2bea){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')](_0xe046('0x27'),_0xdd2bea['uniqueid']),_0xdd2bea);queues[_0xe046('0x26')](_0xdd2bea);}catch(_0x49a460){utils[_0xe046('0x12')](util['format'](_0xe046('0x27'),_0xdd2bea[_0xe046('0x1a')]),_0x49a460);}});ami['on'](_0xe046('0x28'),function(_0x2b0d1e){try{utils['debug'](util[_0xe046('0x15')](_0xe046('0x29'),_0x2b0d1e['uniqueid']),_0x2b0d1e);queues[_0xe046('0x28')](_0x2b0d1e);calls[_0xe046('0x28')](_0x2b0d1e);}catch(_0x34c147){utils[_0xe046('0x12')](util['format'](_0xe046('0x29'),_0x2b0d1e[_0xe046('0x1a')]),_0x34c147);}});ami['on'](_0xe046('0x2a'),function(_0x4c6038){try{utils['debug'](util[_0xe046('0x15')](_0xe046('0x2b'),_0x4c6038['uniqueid']),_0x4c6038);queues[_0xe046('0x2a')](_0x4c6038);calls[_0xe046('0x2a')](_0x4c6038);}catch(_0x36da96){utils[_0xe046('0x12')](util[_0xe046('0x15')](_0xe046('0x2b'),_0x4c6038[_0xe046('0x1a')]),_0x36da96);}});ami['on'](_0xe046('0x2c'),function(_0x152df2){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')]('[%s][index][newstate]',_0x152df2[_0xe046('0x1a')]),_0x152df2);calls['newstate'](_0x152df2);recordings[_0xe046('0x2c')](_0x152df2);}catch(_0x2448f6){utils['error'](util[_0xe046('0x15')]('[%s][index][newstate]',_0x152df2[_0xe046('0x1a')]),_0x2448f6);}});ami['on'](_0xe046('0x2d'),function(_0x10bef3){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')](_0xe046('0x2e'),_0x10bef3['uniqueid']),_0x10bef3);calls[_0xe046('0x2d')](_0x10bef3);recordings[_0xe046('0x2d')](_0x10bef3);dials[_0xe046('0x2d')](_0x10bef3);agents[_0xe046('0x2d')](_0x10bef3);queues[_0xe046('0x2d')](_0x10bef3);}catch(_0x1acd8e){utils[_0xe046('0x12')](util[_0xe046('0x15')](_0xe046('0x2e'),_0x10bef3['uniqueid']),_0x1acd8e);}});ami['on'](_0xe046('0x2f'),function(_0x41d214){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')](_0xe046('0x30'),_0x41d214[_0xe046('0x1a')]),_0x41d214);members[_0xe046('0x2f')](_0x41d214);}catch(_0x586eb8){utils[_0xe046('0x12')](util['format']('[%s][index][cdr]',_0x41d214[_0xe046('0x1a')]),_0x586eb8);}});ami['on'](_0xe046('0x31'),function(_0x472120){try{utils[_0xe046('0x1f')](util['format'](_0xe046('0x32'),_0x472120[_0xe046('0x1a')]),_0x472120);queues[_0xe046('0x31')](_0x472120);agents['blindtransfer'](_0x472120);transfers['blindtransfer'](_0x472120);}catch(_0x425f8a){utils['error'](util[_0xe046('0x15')]('[%s][index][blindtransfer]',_0x472120[_0xe046('0x1a')]),_0x425f8a);}});ami['on'](_0xe046('0x33'),function(_0x524fcc){try{utils[_0xe046('0x1f')](util['format'](_0xe046('0x34'),_0x524fcc[_0xe046('0x35')]),_0x524fcc);queues['attendedtransfer'](_0x524fcc);transfers[_0xe046('0x33')](_0x524fcc);agents[_0xe046('0x33')](_0x524fcc);calls['attendedtransfer'](_0x524fcc);}catch(_0x532ae0){utils[_0xe046('0x12')](util['format']('[%s][index][attendedtransfer]',_0x524fcc[_0xe046('0x35')]),_0x532ae0);}});ami['on'](_0xe046('0x36'),function(_0x148771){try{utils['debug'](util[_0xe046('0x15')]('[%s][index][varset]',_0x148771[_0xe046('0x1a')]),_0x148771);queues[_0xe046('0x36')](_0x148771);recordings[_0xe046('0x36')](_0x148771);calls[_0xe046('0x36')](_0x148771);dials['varset'](_0x148771);}catch(_0x30a91f){utils[_0xe046('0x12')](util[_0xe046('0x15')](_0xe046('0x37'),_0x148771[_0xe046('0x1a')]),_0x30a91f);}});ami['on'](_0xe046('0x38'),function(_0x53503c){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')](_0xe046('0x39'),_0x53503c[_0xe046('0x1a')]),_0x53503c);calls[_0xe046('0x38')](_0x53503c);recordings[_0xe046('0x38')](_0x53503c);dials[_0xe046('0x38')](_0x53503c);}catch(_0x3893a9){utils[_0xe046('0x12')](util[_0xe046('0x15')](_0xe046('0x39'),_0x53503c[_0xe046('0x1a')]),_0x3893a9);}});ami['on']('newchannel',function(_0xe3be08){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')](_0xe046('0x3a'),_0xe3be08[_0xe046('0x1a')]),_0xe3be08);calls[_0xe046('0x3b')](_0xe3be08);recordings[_0xe046('0x3b')](_0xe3be08);}catch(_0x593e1f){utils[_0xe046('0x12')](util[_0xe046('0x15')](_0xe046('0x3a'),_0xe3be08[_0xe046('0x1a')]),_0x593e1f);}});ami['on'](_0xe046('0x3c'),function(_0x4bb232){try{utils[_0xe046('0x1f')](util[_0xe046('0x15')]('[%s][index][dialbegin]',_0x4bb232[_0xe046('0x1a')]),_0x4bb232);dials[_0xe046('0x3c')](_0x4bb232);}catch(_0x512e38){utils[_0xe046('0x12')](util[_0xe046('0x15')](_0xe046('0x3d'),_0x4bb232[_0xe046('0x1a')]),_0x512e38);}});ami['on']('dialend',function(_0x455fc9){try{utils['debug'](util['format']('[%s][index][dialend]',_0x455fc9[_0xe046('0x1a')]),_0x455fc9);dials[_0xe046('0x3e')](_0x455fc9);}catch(_0x1ce537){utils['error'](util[_0xe046('0x15')](_0xe046('0x3f'),_0x455fc9[_0xe046('0x1a')]),_0x1ce537);}});}
\ No newline at end of file
+var _0xa7c2=['[%s][index][dialend]','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][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]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0xa7c2,0x109));var _0x2a7c=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xa7c2[_0x13b8f3];return _0x1a6d06;};var AsteriskManager=require('asterisk-manager');var config=require(_0x2a7c('0x0'));var utils=require(_0x2a7c('0x1'));var util=require(_0x2a7c('0x2'));var ami=new AsteriskManager(config[_0x2a7c('0x3')][_0x2a7c('0x4')],config[_0x2a7c('0x3')]['ip'],config[_0x2a7c('0x3')][_0x2a7c('0x5')],config[_0x2a7c('0x3')][_0x2a7c('0x6')],!![]);ami[_0x2a7c('0x7')]();if(config['xdr']&&config[_0x2a7c('0x8')][_0x2a7c('0x9')]){utils['info'](_0x2a7c('0xa'));}else{var agents=require(_0x2a7c('0xb'));var calls=require(_0x2a7c('0xc'));var queues=require(_0x2a7c('0xd'));var recordings=require(_0x2a7c('0xe'));var members=require(_0x2a7c('0xf'));var dials=require(_0x2a7c('0x10'));var transfers=require(_0x2a7c('0x11'));var core=require('./core.controller');ami['on'](_0x2a7c('0x12'),core[_0x2a7c('0x12')]);ami['on'](_0x2a7c('0x13'),core[_0x2a7c('0x13')]);ami['on'](_0x2a7c('0x14'),core[_0x2a7c('0x14')]);ami['on'](_0x2a7c('0x15'),core[_0x2a7c('0x15')]);ami['on'](_0x2a7c('0x16'),core[_0x2a7c('0x16')]);ami['on'](_0x2a7c('0x17'),core[_0x2a7c('0x17')]);ami['on'](_0x2a7c('0x18'),function(_0x32619e){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x1b'),_0x32619e['device']),_0x32619e);members[_0x2a7c('0x18')](_0x32619e);}catch(_0x211119){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x1b'),_0x32619e['device']),_0x211119);}});ami['on'](_0x2a7c('0x1c'),function(_0x2733ca){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x1d'),_0x2733ca[_0x2a7c('0x1e')]),_0x2733ca);agents[_0x2a7c('0x1c')](_0x2733ca);}catch(_0x541895){utils['error'](util[_0x2a7c('0x1a')](_0x2a7c('0x1d'),_0x2733ca[_0x2a7c('0x1e')]),_0x541895);}});ami['on'](_0x2a7c('0x1f'),function(_0x1d10c8){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')]('[%s][index][agentringnoanswer]',_0x1d10c8[_0x2a7c('0x1e')]),_0x1d10c8);agents[_0x2a7c('0x1f')](_0x1d10c8);}catch(_0x5093f5){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')]('[%s][index][agentringnoanswer]',_0x1d10c8[_0x2a7c('0x1e')]),_0x5093f5);}});ami['on'](_0x2a7c('0x20'),function(_0x47b0cd){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')]('[%s][index][agentconnect]',_0x47b0cd[_0x2a7c('0x1e')]),_0x47b0cd);agents['agentconnect'](_0x47b0cd);queues[_0x2a7c('0x20')](_0x47b0cd);}catch(_0x2edcfc){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')]('[%s][index][agentconnect]',_0x47b0cd[_0x2a7c('0x1e')]),_0x2edcfc);}});ami['on']('agentcomplete',function(_0x37f1ec){try{utils['debug'](util[_0x2a7c('0x1a')](_0x2a7c('0x21'),_0x37f1ec[_0x2a7c('0x1e')]),_0x37f1ec);agents[_0x2a7c('0x22')](_0x37f1ec);queues[_0x2a7c('0x22')](_0x37f1ec);members['agentcomplete'](_0x37f1ec);}catch(_0x51592f){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x21'),_0x37f1ec[_0x2a7c('0x1e')]),_0x51592f);}});ami['on'](_0x2a7c('0x23'),function(_0x2df887){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x24'),_0x2df887[_0x2a7c('0x1e')]),_0x2df887);agents['queuecallerabandon'](_0x2df887);queues[_0x2a7c('0x23')](_0x2df887);}catch(_0x34054c){utils[_0x2a7c('0x15')](util['format']('[%s][index][queuecallerabandon]',_0x2df887[_0x2a7c('0x1e')]),_0x34054c);}});ami['on'](_0x2a7c('0x25'),function(_0x3c0093){try{utils['debug'](util[_0x2a7c('0x1a')]('[%s][index][queuecallerjoin]',_0x3c0093[_0x2a7c('0x1e')]),_0x3c0093);queues[_0x2a7c('0x25')](_0x3c0093);recordings[_0x2a7c('0x25')](_0x3c0093);}catch(_0x30a91a){utils['error'](util[_0x2a7c('0x1a')](_0x2a7c('0x26'),_0x3c0093[_0x2a7c('0x1e')]),_0x30a91a);}});ami['on'](_0x2a7c('0x27'),function(_0x3753f4){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x28'),_0x3753f4[_0x2a7c('0x1e')]),_0x3753f4);queues[_0x2a7c('0x27')](_0x3753f4);}catch(_0x4c9c03){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')]('[%s][index][queuecallerleave]',_0x3753f4[_0x2a7c('0x1e')]),_0x4c9c03);}});ami['on'](_0x2a7c('0x29'),function(_0x5db395){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')]('[%s][index][musiconholdstart]',_0x5db395[_0x2a7c('0x1e')]),_0x5db395);queues['musiconholdstart'](_0x5db395);calls[_0x2a7c('0x29')](_0x5db395);}catch(_0x513388){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x2a'),_0x5db395[_0x2a7c('0x1e')]),_0x513388);}});ami['on']('musiconholdstop',function(_0x3915b4){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x2b'),_0x3915b4[_0x2a7c('0x1e')]),_0x3915b4);queues[_0x2a7c('0x2c')](_0x3915b4);calls[_0x2a7c('0x2c')](_0x3915b4);}catch(_0x529f49){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x2b'),_0x3915b4['uniqueid']),_0x529f49);}});ami['on'](_0x2a7c('0x2d'),function(_0x2faab2){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x2e'),_0x2faab2[_0x2a7c('0x1e')]),_0x2faab2);calls[_0x2a7c('0x2d')](_0x2faab2);recordings[_0x2a7c('0x2d')](_0x2faab2);}catch(_0x1b7326){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')]('[%s][index][newstate]',_0x2faab2[_0x2a7c('0x1e')]),_0x1b7326);}});ami['on'](_0x2a7c('0x2f'),function(_0x415a28){try{utils[_0x2a7c('0x19')](util['format'](_0x2a7c('0x30'),_0x415a28['uniqueid']),_0x415a28);calls[_0x2a7c('0x2f')](_0x415a28);recordings['hangup'](_0x415a28);dials[_0x2a7c('0x2f')](_0x415a28);agents['hangup'](_0x415a28);queues[_0x2a7c('0x2f')](_0x415a28);}catch(_0x1a32e4){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x30'),_0x415a28[_0x2a7c('0x1e')]),_0x1a32e4);}});ami['on'](_0x2a7c('0x31'),function(_0x5f37cc){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x32'),_0x5f37cc[_0x2a7c('0x1e')]),_0x5f37cc);members[_0x2a7c('0x31')](_0x5f37cc);}catch(_0x3d32da){utils['error'](util[_0x2a7c('0x1a')](_0x2a7c('0x32'),_0x5f37cc[_0x2a7c('0x1e')]),_0x3d32da);}});ami['on'](_0x2a7c('0x33'),function(_0x56fbfd){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x34'),_0x56fbfd['uniqueid']),_0x56fbfd);queues['blindtransfer'](_0x56fbfd);agents[_0x2a7c('0x33')](_0x56fbfd);transfers['blindtransfer'](_0x56fbfd);}catch(_0x372eab){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x34'),_0x56fbfd[_0x2a7c('0x1e')]),_0x372eab);}});ami['on'](_0x2a7c('0x35'),function(_0x434465){try{utils['debug'](util['format'](_0x2a7c('0x36'),_0x434465[_0x2a7c('0x37')]),_0x434465);queues[_0x2a7c('0x35')](_0x434465);transfers[_0x2a7c('0x35')](_0x434465);agents[_0x2a7c('0x35')](_0x434465);calls['attendedtransfer'](_0x434465);}catch(_0x22a194){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x36'),_0x434465['origtransfereruniqueid']),_0x22a194);}});ami['on'](_0x2a7c('0x38'),function(_0x51b4b3){try{utils['debug'](util[_0x2a7c('0x1a')]('[%s][index][varset]',_0x51b4b3['uniqueid']),_0x51b4b3);queues[_0x2a7c('0x38')](_0x51b4b3);recordings[_0x2a7c('0x38')](_0x51b4b3);calls['varset'](_0x51b4b3);dials[_0x2a7c('0x38')](_0x51b4b3);}catch(_0x471c25){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x39'),_0x51b4b3['uniqueid']),_0x471c25);}});ami['on']('newexten',function(_0x561c8d){try{utils[_0x2a7c('0x19')](util['format'](_0x2a7c('0x3a'),_0x561c8d[_0x2a7c('0x1e')]),_0x561c8d);calls['newexten'](_0x561c8d);recordings[_0x2a7c('0x3b')](_0x561c8d);dials[_0x2a7c('0x3b')](_0x561c8d);}catch(_0xdd8fce){utils['error'](util['format']('[%s][index][newexten]',_0x561c8d[_0x2a7c('0x1e')]),_0xdd8fce);}});ami['on'](_0x2a7c('0x3c'),function(_0x171107){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x3d'),_0x171107[_0x2a7c('0x1e')]),_0x171107);calls[_0x2a7c('0x3c')](_0x171107);recordings[_0x2a7c('0x3c')](_0x171107);}catch(_0x1b015f){utils[_0x2a7c('0x15')](util['format']('[%s][index][newchannel]',_0x171107[_0x2a7c('0x1e')]),_0x1b015f);}});ami['on'](_0x2a7c('0x3e'),function(_0x4ba772){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')]('[%s][index][dialbegin]',_0x4ba772[_0x2a7c('0x1e')]),_0x4ba772);dials[_0x2a7c('0x3e')](_0x4ba772);}catch(_0x93f399){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x3f'),_0x4ba772[_0x2a7c('0x1e')]),_0x93f399);}});ami['on'](_0x2a7c('0x40'),function(_0xabc5b2){try{utils[_0x2a7c('0x19')](util[_0x2a7c('0x1a')](_0x2a7c('0x41'),_0xabc5b2['uniqueid']),_0xabc5b2);dials[_0x2a7c('0x40')](_0xabc5b2);}catch(_0x532a77){utils[_0x2a7c('0x15')](util[_0x2a7c('0x1a')](_0x2a7c('0x41'),_0xabc5b2[_0x2a7c('0x1e')]),_0x532a77);}});}
\ No newline at end of file
index abd7c9c..2f613d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42bd=['destinationchannel','./utils','Local/_attended@transfer','Queue:','info','format','channel','membername','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','catch','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','duration','exitAt','enterAt','error','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','split','data1','data2','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3'];(function(_0x1a2b72,_0x3acc4a){var _0x23241c=function(_0x59b8f4){while(--_0x59b8f4){_0x1a2b72['push'](_0x1a2b72['shift']());}};_0x23241c(++_0x3acc4a);}(_0x42bd,0xd9));var _0xd42b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x42bd[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xd42b('0x0'));var members={};var exclude=[_0xd42b('0x1'),_0xd42b('0x2')];function writeDB(_0x401bf0){utils[_0xd42b('0x3')](util[_0xd42b('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x401bf0['uniqueid'],_0x401bf0['interface'],_0x401bf0[_0xd42b('0x5')],_0x401bf0['data2'],_0x401bf0[_0xd42b('0x6')],_0x401bf0[_0xd42b('0x7')]));if(_0x401bf0[_0xd42b('0x8')]){utils[_0xd42b('0x9')](_0x401bf0[_0xd42b('0x8')])[_0xd42b('0xa')](function(_0x4e7373){if(_0x4e7373){_0x401bf0[_0xd42b('0x6')]=_0x4e7373[_0xd42b('0xb')];_0x401bf0[_0xd42b('0xc')]=_0x4e7373['internal'];utils[_0xd42b('0xd')](_0xd42b('0xe'),_0x401bf0);}else{utils[_0xd42b('0xf')](_0x401bf0['interface']['split']('/')[0x1])[_0xd42b('0xa')](function(_0x5288bf){if(_0x5288bf){_0x401bf0['membername']=_0x5288bf[_0xd42b('0xb')];_0x401bf0[_0xd42b('0xc')]=_0x5288bf[_0xd42b('0xc')];utils['request']('CreateMemberReport',_0x401bf0);}});}})[_0xd42b('0x10')](function(_0xdb3553){utils['error'](util['format'](_0xd42b('0x11'),_0x401bf0[_0xd42b('0x12')]),_0xdb3553);});}delete members[_0x401bf0['interface']];}function startsWith(_0x5126a7,_0x16f2c0){return _[_0xd42b('0x13')](_0x5126a7,function(_0x323352){return _[_0xd42b('0x14')](_0x16f2c0,_0x323352);});}exports[_0xd42b('0x15')]=function(_0x2595ad){try{utils[_0xd42b('0x16')](util[_0xd42b('0x4')]('[%s][members][devicestatechange]',members[_0x2595ad[_0xd42b('0x17')]]?members[_0x2595ad['device']][_0xd42b('0x12')]:_0x2595ad[_0xd42b('0x17')]),_0x2595ad);utils[_0xd42b('0x3')](util[_0xd42b('0x4')](_0xd42b('0x18'),members[_0x2595ad[_0xd42b('0x17')]]?members[_0x2595ad[_0xd42b('0x17')]][_0xd42b('0x12')]:_0x2595ad[_0xd42b('0x17')],_0x2595ad[_0xd42b('0x19')],_0x2595ad[_0xd42b('0x17')]));switch(_0x2595ad['state']){case _0xd42b('0x1a'):case _0xd42b('0x1b'):if(!startsWith(exclude,_0x2595ad[_0xd42b('0x17')])){members[_0x2595ad[_0xd42b('0x17')]]={'channel':_0xd42b('0x1c'),'interface':_0x2595ad[_0xd42b('0x17')],'type':_0xd42b('0x1d'),'enterAt':utils[_0xd42b('0x1e')](),'role':_0xd42b('0x1f')};}break;case _0xd42b('0x20'):if(!_[_0xd42b('0x21')](members[_0x2595ad[_0xd42b('0x17')]])){members[_0x2595ad[_0xd42b('0x17')]]['exitAt']=utils['now']();members[_0x2595ad[_0xd42b('0x17')]][_0xd42b('0x22')]=utils['diffTime'](members[_0x2595ad[_0xd42b('0x17')]][_0xd42b('0x23')],members[_0x2595ad[_0xd42b('0x17')]][_0xd42b('0x24')]);if(members[_0x2595ad[_0xd42b('0x17')]][_0xd42b('0x12')]){writeDB(members[_0x2595ad[_0xd42b('0x17')]]);}}break;default:break;}}catch(_0x588062){utils[_0xd42b('0x25')](util[_0xd42b('0x4')](_0xd42b('0x26'),members[_0x2595ad['device']]?members[_0x2595ad['device']][_0xd42b('0x12')]:_0x2595ad[_0xd42b('0x17')]),_0x588062);}};exports[_0xd42b('0x27')]=function(_0x37c09a){try{if(!_[_0xd42b('0x21')](members[_0x37c09a['interface']])){utils[_0xd42b('0x16')](util[_0xd42b('0x4')](_0xd42b('0x28'),_0x37c09a['uniqueid']),_0x37c09a);utils[_0xd42b('0x3')](util['format'](_0xd42b('0x29'),_0x37c09a[_0xd42b('0x12')],_0x37c09a['interface'],_0x37c09a[_0xd42b('0x2a')]));members[_0x37c09a[_0xd42b('0x8')]]=_[_0xd42b('0x2b')](members[_0x37c09a[_0xd42b('0x8')]],{'data4':_0x37c09a[_0xd42b('0x2a')],'uniqueid':_0x37c09a[_0xd42b('0x12')]});}}catch(_0x393cc1){utils[_0xd42b('0x25')](util['format']('[%s][members][agentcomplete]',_0x37c09a[_0xd42b('0x12')]),_0x393cc1);}};exports[_0xd42b('0x2c')]=function(_0x59c601){try{utils['debug'](util[_0xd42b('0x4')](_0xd42b('0x2d'),_0x59c601[_0xd42b('0x12')]),_0x59c601);if(_0x59c601[_0xd42b('0x5')]){var _0x20a80e=_0x59c601[_0xd42b('0x5')][_0xd42b('0x2e')]('-')[0x0];if(!_[_0xd42b('0x21')](members[_0x20a80e])){members[_0x20a80e]=_['assign'](members[_0x20a80e],{'data1':members[_0x20a80e][_0xd42b('0x2f')]||_0x59c601[_0xd42b('0x7')],'data2':members[_0x20a80e][_0xd42b('0x30')]||_0x59c601[_0xd42b('0x31')],'data3':members[_0x20a80e]['data3']||_0x59c601[_0xd42b('0x32')],'uniqueid':members[_0x20a80e][_0xd42b('0x12')]||_0x59c601[_0xd42b('0x12')]});utils[_0xd42b('0x3')](util[_0xd42b('0x4')](_0xd42b('0x33'),_0x59c601[_0xd42b('0x12')],members[_0x20a80e]['data1'],members[_0x20a80e][_0xd42b('0x30')],members[_0x20a80e][_0xd42b('0x34')]));if(members[_0x20a80e][_0xd42b('0x23')]){writeDB(members[_0x20a80e]);}}}if(_0x59c601[_0xd42b('0x35')]){var _0x33e57a=_0x59c601[_0xd42b('0x35')][_0xd42b('0x2e')]('-')[0x0];if(!_[_0xd42b('0x21')](members[_0x33e57a])){members[_0x33e57a]=_[_0xd42b('0x2b')](members[_0x33e57a],{'data1':members[_0x33e57a][_0xd42b('0x2f')]||_0x59c601[_0xd42b('0x7')],'data2':members[_0x33e57a][_0xd42b('0x30')]||_0x59c601[_0xd42b('0x31')],'data3':members[_0x33e57a]['data3']||_0x59c601[_0xd42b('0x32')],'uniqueid':members[_0x33e57a][_0xd42b('0x12')]||_0x59c601[_0xd42b('0x12')]});utils[_0xd42b('0x3')](util['format'](_0xd42b('0x33'),_0x59c601[_0xd42b('0x12')],members[_0x33e57a][_0xd42b('0x2f')],members[_0x33e57a][_0xd42b('0x30')],members[_0x33e57a][_0xd42b('0x34')]));if(members[_0x33e57a]['exitAt']){writeDB(members[_0x33e57a]);}}}}catch(_0x10102d){utils[_0xd42b('0x25')](util[_0xd42b('0x4')](_0xd42b('0x2d'),_0x59c601['uniqueid']),_0x10102d);}};
\ No newline at end of file
+var _0xdb49=['source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data1','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','interface','getUserByInterface','then','membername','internal','CreateMemberReport','getUserByName','split','name','error','[%s][members][writeDB]','uniqueid','some','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','isNil','exitAt','duration','diffTime','agentcomplete','debug','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','type'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0xdb49,0x1c8));var _0x9db4=function(_0x40e3ae,_0x432f18){_0x40e3ae=_0x40e3ae-0x0;var _0x3563b7=_0xdb49[_0x40e3ae];return _0x3563b7;};'use strict';var _=require(_0x9db4('0x0'));var util=require(_0x9db4('0x1'));var utils=require(_0x9db4('0x2'));var members={};var exclude=[_0x9db4('0x3'),_0x9db4('0x4')];function writeDB(_0x264973){utils[_0x9db4('0x5')](util[_0x9db4('0x6')](_0x9db4('0x7'),_0x264973['uniqueid'],_0x264973['interface'],_0x264973[_0x9db4('0x8')],_0x264973[_0x9db4('0x9')],_0x264973['membername'],_0x264973['type']));if(_0x264973[_0x9db4('0xa')]){utils[_0x9db4('0xb')](_0x264973[_0x9db4('0xa')])[_0x9db4('0xc')](function(_0x20a470){if(_0x20a470){_0x264973[_0x9db4('0xd')]=_0x20a470['name'];_0x264973[_0x9db4('0xe')]=_0x20a470[_0x9db4('0xe')];utils['request'](_0x9db4('0xf'),_0x264973);}else{utils[_0x9db4('0x10')](_0x264973[_0x9db4('0xa')][_0x9db4('0x11')]('/')[0x1])['then'](function(_0x22efe7){if(_0x22efe7){_0x264973[_0x9db4('0xd')]=_0x22efe7[_0x9db4('0x12')];_0x264973[_0x9db4('0xe')]=_0x22efe7['internal'];utils['request'](_0x9db4('0xf'),_0x264973);}});}})['catch'](function(_0x275c57){utils[_0x9db4('0x13')](util[_0x9db4('0x6')](_0x9db4('0x14'),_0x264973[_0x9db4('0x15')]),_0x275c57);});}delete members[_0x264973[_0x9db4('0xa')]];}function startsWith(_0x1bd82c,_0x573a71){return _[_0x9db4('0x16')](_0x1bd82c,function(_0x21abb2){return _['startsWith'](_0x573a71,_0x21abb2);});}exports[_0x9db4('0x17')]=function(_0x25093f){try{utils['debug'](util['format'](_0x9db4('0x18'),members[_0x25093f[_0x9db4('0x19')]]?members[_0x25093f[_0x9db4('0x19')]][_0x9db4('0x15')]:_0x25093f['device']),_0x25093f);utils[_0x9db4('0x5')](util[_0x9db4('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x25093f[_0x9db4('0x19')]]?members[_0x25093f[_0x9db4('0x19')]][_0x9db4('0x15')]:_0x25093f['device'],_0x25093f[_0x9db4('0x1a')],_0x25093f['device']));switch(_0x25093f[_0x9db4('0x1a')]){case _0x9db4('0x1b'):case _0x9db4('0x1c'):if(!startsWith(exclude,_0x25093f[_0x9db4('0x19')])){members[_0x25093f[_0x9db4('0x19')]]={'channel':_0x9db4('0x1d'),'interface':_0x25093f[_0x9db4('0x19')],'type':_0x9db4('0x1e'),'enterAt':utils[_0x9db4('0x1f')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x9db4('0x20')](members[_0x25093f[_0x9db4('0x19')]])){members[_0x25093f[_0x9db4('0x19')]][_0x9db4('0x21')]=utils[_0x9db4('0x1f')]();members[_0x25093f[_0x9db4('0x19')]][_0x9db4('0x22')]=utils[_0x9db4('0x23')](members[_0x25093f['device']][_0x9db4('0x21')],members[_0x25093f[_0x9db4('0x19')]]['enterAt']);if(members[_0x25093f['device']]['uniqueid']){writeDB(members[_0x25093f[_0x9db4('0x19')]]);}}break;default:break;}}catch(_0x3c0b86){utils['error'](util[_0x9db4('0x6')](_0x9db4('0x18'),members[_0x25093f[_0x9db4('0x19')]]?members[_0x25093f[_0x9db4('0x19')]]['uniqueid']:_0x25093f[_0x9db4('0x19')]),_0x3c0b86);}};exports[_0x9db4('0x24')]=function(_0x4b1af5){try{if(!_[_0x9db4('0x20')](members[_0x4b1af5['interface']])){utils[_0x9db4('0x25')](util['format']('[%s][members][agentcomplete]',_0x4b1af5['uniqueid']),_0x4b1af5);utils[_0x9db4('0x5')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x4b1af5[_0x9db4('0x15')],_0x4b1af5['interface'],_0x4b1af5[_0x9db4('0x26')]));members[_0x4b1af5[_0x9db4('0xa')]]=_[_0x9db4('0x27')](members[_0x4b1af5[_0x9db4('0xa')]],{'data4':_0x4b1af5[_0x9db4('0x26')],'uniqueid':_0x4b1af5[_0x9db4('0x15')]});}}catch(_0x330d72){utils['error'](util[_0x9db4('0x6')](_0x9db4('0x28'),_0x4b1af5['uniqueid']),_0x330d72);}};exports[_0x9db4('0x29')]=function(_0x4ea0a3){try{utils['debug'](util['format'](_0x9db4('0x2a'),_0x4ea0a3[_0x9db4('0x15')]),_0x4ea0a3);if(_0x4ea0a3[_0x9db4('0x8')]){var _0x1a8093=_0x4ea0a3['channel'][_0x9db4('0x11')]('-')[0x0];if(!_[_0x9db4('0x20')](members[_0x1a8093])){members[_0x1a8093]=_['assign'](members[_0x1a8093],{'data1':members[_0x1a8093]['data1']||_0x4ea0a3[_0x9db4('0x2b')],'data2':members[_0x1a8093]['data2']||_0x4ea0a3[_0x9db4('0x2c')],'data3':members[_0x1a8093][_0x9db4('0x2d')]||_0x4ea0a3[_0x9db4('0x2e')],'uniqueid':members[_0x1a8093][_0x9db4('0x15')]||_0x4ea0a3[_0x9db4('0x15')]});utils['info'](util['format'](_0x9db4('0x2f'),_0x4ea0a3[_0x9db4('0x15')],members[_0x1a8093]['data1'],members[_0x1a8093][_0x9db4('0x9')],members[_0x1a8093][_0x9db4('0x2d')]));if(members[_0x1a8093]['exitAt']){writeDB(members[_0x1a8093]);}}}if(_0x4ea0a3['destinationchannel']){var _0x26ee68=_0x4ea0a3[_0x9db4('0x30')][_0x9db4('0x11')]('-')[0x0];if(!_[_0x9db4('0x20')](members[_0x26ee68])){members[_0x26ee68]=_[_0x9db4('0x27')](members[_0x26ee68],{'data1':members[_0x26ee68][_0x9db4('0x31')]||_0x4ea0a3['type'],'data2':members[_0x26ee68][_0x9db4('0x9')]||_0x4ea0a3[_0x9db4('0x2c')],'data3':members[_0x26ee68][_0x9db4('0x2d')]||_0x4ea0a3['destination'],'uniqueid':members[_0x26ee68][_0x9db4('0x15')]||_0x4ea0a3['uniqueid']});utils[_0x9db4('0x5')](util[_0x9db4('0x6')](_0x9db4('0x2f'),_0x4ea0a3['uniqueid'],members[_0x26ee68][_0x9db4('0x31')],members[_0x26ee68]['data2'],members[_0x26ee68][_0x9db4('0x2d')]));if(members[_0x26ee68][_0x9db4('0x21')]){writeDB(members[_0x26ee68]);}}}}catch(_0x41a3a9){utils['error'](util['format']('[%s][members][cdr]',_0x4ea0a3[_0x9db4('0x15')]),_0x41a3a9);}};
\ No newline at end of file
index 5dff582..b769a1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36d9=['transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','channel','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','now','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandon','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','transfertype','BLIND'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x36d9,0x1c4));var _0x936d=function(_0x17b7d1,_0x4d43e6){_0x17b7d1=_0x17b7d1-0x0;var _0x2d7ad9=_0x36d9[_0x17b7d1];return _0x2d7ad9;};'use strict';var _=require(_0x936d('0x0'));var util=require(_0x936d('0x1'));var utils=require(_0x936d('0x2'));var queues={};function writeDB(_0x3a8940){utils[_0x936d('0x3')](util[_0x936d('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3a8940[_0x936d('0x5')],_0x3a8940[_0x936d('0x6')],_0x3a8940['queue'],_0x3a8940['lastAssignedTo'],_0x3a8940[_0x936d('0x7')],_0x3a8940[_0x936d('0x8')],_0x3a8940[_0x936d('0x9')]));if(_0x3a8940['queue']){utils[_0x936d('0xa')](_0x3a8940[_0x936d('0xb')])['then'](function(_0x23088a){if(_0x23088a){_0x3a8940[_0x936d('0xc')]=_0x23088a[_0x936d('0xc')];}utils[_0x936d('0xd')](_0x936d('0xe'),_0x3a8940);});}else{utils[_0x936d('0xd')](_0x936d('0xe'),_0x3a8940);}if(_0x3a8940[_0x936d('0xf')]){delete queues[_0x3a8940[_0x936d('0xf')]];}else{delete queues[_0x3a8940[_0x936d('0x5')]];}}exports[_0x936d('0x10')]=function(_0xce48a0){try{utils[_0x936d('0x11')](util[_0x936d('0x4')](_0x936d('0x12'),_0xce48a0[_0x936d('0x5')]),_0xce48a0);utils['info'](util[_0x936d('0x4')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0xce48a0[_0x936d('0x5')],_0xce48a0[_0x936d('0xb')],_0xce48a0[_0x936d('0x13')]));queues[_0xce48a0[_0x936d('0x5')]]=_[_0x936d('0x14')](_0xce48a0,{'originalposition':_0xce48a0[_0x936d('0x13')],'queuecallerjoinAt':utils[_0x936d('0x15')](),'mohtime':0x0});}catch(_0x50f6d1){utils['error'](util[_0x936d('0x4')](_0x936d('0x12'),_0xce48a0[_0x936d('0x5')]),_0x50f6d1);}};exports[_0x936d('0x16')]=function(_0x497579){try{if(!_[_0x936d('0x17')](queues[_0x497579[_0x936d('0x5')]])){utils[_0x936d('0x11')](util[_0x936d('0x4')]('[%s][queues][hangup]',_0x497579[_0x936d('0x5')]),_0x497579);if(queues[_0x497579[_0x936d('0x5')]][_0x936d('0x18')]){if(!queues[_0x497579[_0x936d('0x5')]]['queuecallerabandon']&&!queues[_0x497579[_0x936d('0x5')]][_0x936d('0x19')]){queues[_0x497579[_0x936d('0x5')]][_0x936d('0x1a')]=!![];queues[_0x497579[_0x936d('0x5')]][_0x936d('0x1b')]=utils[_0x936d('0x15')]();queues[_0x497579['uniqueid']][_0x936d('0x9')]=_0x936d('0x1c');}utils[_0x936d('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x497579[_0x936d('0x5')],queues[_0x497579['uniqueid']][_0x936d('0x1d')],queues[_0x497579[_0x936d('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x497579['uniqueid']]);}else if(queues[_0x497579[_0x936d('0x5')]]['transfereduniqueid']){utils[_0x936d('0x3')](util[_0x936d('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x497579['uniqueid'],queues[_0x497579[_0x936d('0x5')]]['name'],queues[_0x497579[_0x936d('0x5')]]['transfereduniqueid']));queues[queues[_0x497579[_0x936d('0x5')]][_0x936d('0xf')]]=queues[_0x497579[_0x936d('0x5')]];queues[queues[_0x497579[_0x936d('0x5')]]['transfereduniqueid']][_0x936d('0x1e')]=0x2;delete queues[_0x497579[_0x936d('0x5')]];}}}catch(_0x30c910){utils['error'](util['format'](_0x936d('0x1f'),_0x497579['uniqueid']),_0x30c910);}};exports[_0x936d('0x20')]=function(_0x1bba6d){try{utils[_0x936d('0x11')](util[_0x936d('0x4')](_0x936d('0x21'),_0x1bba6d[_0x936d('0x5')]),_0x1bba6d);if(!_[_0x936d('0x17')](_0x1bba6d[_0x936d('0x22')][_0x936d('0x23')])&&_0x1bba6d['value'][_0x936d('0x24')]()!==_0x936d('0x25')){if(!_[_0x936d('0x17')](queues[_0x1bba6d[_0x936d('0x5')]])){queues[_0x1bba6d[_0x936d('0x5')]][_0x936d('0x26')]=![];queues[_0x1bba6d[_0x936d('0x5')]]['queuecallerabandonAt']=null;queues[_0x1bba6d[_0x936d('0x5')]]['queuecallerexit']=!![];queues[_0x1bba6d[_0x936d('0x5')]]['queuecallerexitAt']=utils[_0x936d('0x15')]();queues[_0x1bba6d[_0x936d('0x5')]][_0x936d('0x9')]=_0x1bba6d[_0x936d('0x27')]['toUpperCase']();utils['info'](util[_0x936d('0x4')](_0x936d('0x28'),_0x1bba6d[_0x936d('0x5')],queues[_0x1bba6d[_0x936d('0x5')]][_0x936d('0x1d')],_0x1bba6d[_0x936d('0x27')],queues[_0x1bba6d[_0x936d('0x5')]][_0x936d('0x9')]));writeDB(queues[_0x1bba6d['uniqueid']]);}}else if(!_[_0x936d('0x17')](_0x1bba6d['variable'][_0x936d('0x29')])){if(!_['isNil'](queues[_0x1bba6d[_0x936d('0x5')]])&&!queues[_0x1bba6d[_0x936d('0x5')]]['queuecallerabandon']){queues[_0x1bba6d[_0x936d('0x5')]][_0x936d('0x26')]=![];queues[_0x1bba6d[_0x936d('0x5')]][_0x936d('0x2a')]=null;queues[_0x1bba6d[_0x936d('0x5')]][_0x936d('0x19')]=!![];queues[_0x1bba6d[_0x936d('0x5')]][_0x936d('0x2b')]=utils[_0x936d('0x15')]();queues[_0x1bba6d[_0x936d('0x5')]][_0x936d('0x9')]=_0x936d('0x2c');utils[_0x936d('0x3')](util[_0x936d('0x4')](_0x936d('0x2d'),_0x1bba6d[_0x936d('0x5')],queues[_0x1bba6d['uniqueid']][_0x936d('0x1d')],_0x1bba6d['value'],queues[_0x1bba6d[_0x936d('0x5')]]['queuecallerexitreason']));}}}catch(_0x24476d){utils[_0x936d('0x2e')](util['format']('[%s][queues][varset]',_0x1bba6d[_0x936d('0x5')]),_0x24476d);}};exports[_0x936d('0x26')]=function(_0x2b03fe){try{if(!_[_0x936d('0x17')](queues[_0x2b03fe[_0x936d('0x5')]])){utils[_0x936d('0x11')](util[_0x936d('0x4')](_0x936d('0x2f'),_0x2b03fe[_0x936d('0x5')]),_0x2b03fe);queues[_0x2b03fe[_0x936d('0x5')]][_0x936d('0x19')]=![];queues[_0x2b03fe[_0x936d('0x5')]]['queuecallerexitAt']=null;queues[_0x2b03fe['uniqueid']]['queuecallerabandon']=!![];queues[_0x2b03fe[_0x936d('0x5')]][_0x936d('0x2a')]=utils['now']();queues[_0x2b03fe['uniqueid']][_0x936d('0x9')]='ABANDONED';utils[_0x936d('0x3')](util[_0x936d('0x4')](_0x936d('0x30'),_0x2b03fe[_0x936d('0x5')],queues[_0x2b03fe[_0x936d('0x5')]][_0x936d('0x1d')],queues[_0x2b03fe[_0x936d('0x5')]][_0x936d('0x9')]));}}catch(_0x468146){utils['error'](util[_0x936d('0x4')](_0x936d('0x2f'),_0x2b03fe[_0x936d('0x5')]),_0x468146);}};exports[_0x936d('0x31')]=function(_0x1809d1){try{if(!_[_0x936d('0x17')](queues[_0x1809d1[_0x936d('0x5')]])){utils[_0x936d('0x11')](util[_0x936d('0x4')]('[%s][queues][queuecallerleave]',_0x1809d1[_0x936d('0x5')]),_0x1809d1);utils['info'](util[_0x936d('0x4')](_0x936d('0x32'),_0x1809d1[_0x936d('0x5')],queues[_0x1809d1[_0x936d('0x5')]][_0x936d('0x1d')],_0x1809d1['connectedlinenum'],_0x1809d1['connectedlinename']));queues[_0x1809d1[_0x936d('0x5')]][_0x936d('0x31')]=!![];queues[_0x1809d1[_0x936d('0x5')]]['queuecallerleaveAt']=utils[_0x936d('0x15')]();queues[_0x1809d1['uniqueid']][_0x936d('0x33')]=utils[_0x936d('0x34')](queues[_0x1809d1[_0x936d('0x5')]]['queuecallerleaveAt'],queues[_0x1809d1[_0x936d('0x5')]][_0x936d('0x35')]);queues[_0x1809d1[_0x936d('0x5')]][_0x936d('0x13')]=_0x1809d1[_0x936d('0x13')];queues[_0x1809d1[_0x936d('0x5')]][_0x936d('0x36')]=_0x1809d1[_0x936d('0x36')];queues[_0x1809d1[_0x936d('0x5')]][_0x936d('0x37')]=_0x1809d1['connectedlinenum'];queues[_0x1809d1[_0x936d('0x5')]][_0x936d('0x38')]=_0x1809d1['connectedlinename'];}}catch(_0x5376b6){utils[_0x936d('0x2e')](util['format']('[%s][queues][queuecallerleave]',_0x1809d1[_0x936d('0x5')]),_0x5376b6);}};exports[_0x936d('0x39')]=function(_0x5d1cab){try{if(!_['isNil'](queues[_0x5d1cab[_0x936d('0x5')]])){utils[_0x936d('0x11')](util[_0x936d('0x4')](_0x936d('0x3a'),_0x5d1cab['uniqueid']),_0x5d1cab);utils[_0x936d('0x3')](util[_0x936d('0x4')](_0x936d('0x3b'),_0x5d1cab['uniqueid'],queues[_0x5d1cab[_0x936d('0x5')]]['name'],_0x5d1cab[_0x936d('0x3c')],_0x5d1cab[_0x936d('0x3d')]));queues[_0x5d1cab[_0x936d('0x5')]][_0x936d('0x26')]=![];queues[_0x5d1cab['uniqueid']][_0x936d('0x26')]=![];queues[_0x5d1cab[_0x936d('0x5')]]['queuecallerabandonAt']=null;queues[_0x5d1cab[_0x936d('0x5')]][_0x936d('0x19')]=![];queues[_0x5d1cab['uniqueid']]['queuecallerexitreason']=null;queues[_0x5d1cab['uniqueid']][_0x936d('0x2b')]=null;queues[_0x5d1cab[_0x936d('0x5')]][_0x936d('0x3e')]=!![];queues[_0x5d1cab[_0x936d('0x5')]]['accountcode']=_0x5d1cab[_0x936d('0x3d')];queues[_0x5d1cab[_0x936d('0x5')]][_0x936d('0x3f')]=_0x5d1cab['membername'];}}catch(_0x38b8d1){utils[_0x936d('0x2e')](util[_0x936d('0x4')](_0x936d('0x3a'),_0x5d1cab[_0x936d('0x5')]),_0x38b8d1);}};exports['agentcomplete']=function(_0x5a6e04){try{if(!_[_0x936d('0x17')](queues[_0x5a6e04[_0x936d('0x5')]])){if(queues[_0x5a6e04['uniqueid']][_0x936d('0x18')]){utils[_0x936d('0x11')](util[_0x936d('0x4')]('[%s][queues][agentcomplete]',_0x5a6e04[_0x936d('0x5')]),_0x5a6e04);queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x26')]=![];queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x26')]=![];queues[_0x5a6e04['uniqueid']]['queuecallerabandonAt']=null;queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x19')]=![];queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x2b')]=null;queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x3e')]=!![];queues[_0x5a6e04[_0x936d('0x5')]]['lastAssignedTo']=_0x5a6e04['membername'];queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x1a')]=!![];queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x1b')]=utils[_0x936d('0x15')]();if(_0x5a6e04[_0x936d('0x40')]=='transfer'){if(!queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x41')]){queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x9')]=_0x936d('0x42');}}else{queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x9')]=_0x936d('0x43')+_0x5a6e04[_0x936d('0x40')][_0x936d('0x24')]();}utils[_0x936d('0x3')](util[_0x936d('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x5a6e04[_0x936d('0x5')],queues[_0x5a6e04[_0x936d('0x5')]][_0x936d('0x1d')],_0x5a6e04[_0x936d('0x3c')],queues[_0x5a6e04[_0x936d('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x5a6e04[_0x936d('0x5')]]);}}}catch(_0x3fa475){utils['error'](util[_0x936d('0x4')](_0x936d('0x44'),_0x5a6e04['uniqueid']),_0x3fa475);}};exports[_0x936d('0x45')]=function(_0x2960ec){try{if(!_['isNil'](queues[_0x2960ec[_0x936d('0x46')]])){utils['debug'](util['format']('[%s][queues][blindtransfer]',_0x2960ec[_0x936d('0x5')]),_0x2960ec);queues[_0x2960ec[_0x936d('0x46')]][_0x936d('0x41')]=!![];queues[_0x2960ec[_0x936d('0x46')]][_0x936d('0x47')]=_0x936d('0x48');queues[_0x2960ec[_0x936d('0x46')]][_0x936d('0x49')]=_0x2960ec[_0x936d('0x4a')];queues[_0x2960ec['transfereeuniqueid']][_0x936d('0x4b')]=_0x2960ec['transfereeuniqueid'];queues[_0x2960ec[_0x936d('0x46')]][_0x936d('0x9')]=_0x936d('0x4c');utils[_0x936d('0x3')](util[_0x936d('0x4')](_0x936d('0x4d'),_0x2960ec[_0x936d('0x5')],queues[_0x2960ec['transfereeuniqueid']]['name'],_0x2960ec[_0x936d('0x46')],_0x2960ec[_0x936d('0x4a')]));}}catch(_0x1de46c){utils[_0x936d('0x2e')](util['format']('[%s][queues][blindtransfer]',_0x2960ec[_0x936d('0x5')]),_0x1de46c);}};exports[_0x936d('0x4e')]=function(_0x14b204){try{utils[_0x936d('0x11')](util[_0x936d('0x4')](_0x936d('0x4f'),_0x14b204[_0x936d('0x50')]),_0x14b204);if(_0x14b204[_0x936d('0x50')]==_0x14b204[_0x936d('0x51')]){if(!_['isNil'](queues[_0x14b204[_0x936d('0x52')]])){utils['info'](util['format'](_0x936d('0x53'),_0x14b204[_0x936d('0x50')],queues[_0x14b204[_0x936d('0x52')]]['name'],_0x14b204[_0x936d('0x54')]));queues[_0x14b204['secondtransfererlinkedid']]['transfer']=!![];queues[_0x14b204[_0x936d('0x52')]][_0x936d('0x47')]=_0x936d('0x55');queues[_0x14b204[_0x936d('0x52')]]['transferexten']=_0x14b204[_0x936d('0x54')];queues[_0x14b204[_0x936d('0x52')]]['transferuniqueid']=_0x14b204['origtransfereruniqueid'];queues[_0x14b204[_0x936d('0x52')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x936d('0x17')](queues[_0x14b204[_0x936d('0x51')]])){if(_0x14b204[_0x936d('0x56')]&&queues[_0x14b204[_0x936d('0x56')]]){queues[_0x14b204[_0x936d('0x56')]][_0x936d('0x1e')]=0x1;queues[_0x14b204[_0x936d('0x46')]]=_['clone'](queues[_0x14b204[_0x936d('0x56')]]);queues[_0x14b204[_0x936d('0x46')]][_0x936d('0xf')]=_0x14b204['transfertargetuniqueid'];queues[_0x14b204[_0x936d('0x46')]][_0x936d('0x1e')]=0x2;queues[_0x14b204['transfereeuniqueid']]['calleridnum']=queues[_0x14b204['secondtransfererlinkedid']][_0x936d('0x7')];queues[_0x14b204[_0x936d('0x46')]][_0x936d('0x57')]=queues[_0x14b204['secondtransfererlinkedid']][_0x936d('0x57')];queues[_0x14b204['transfereeuniqueid']][_0x936d('0x35')]=utils[_0x936d('0x15')]();queues[_0x14b204[_0x936d('0x46')]][_0x936d('0x18')]=utils[_0x936d('0x15')]();queues[_0x14b204[_0x936d('0x46')]]['holdtime']=0x0;queues[_0x14b204[_0x936d('0x46')]][_0x936d('0x58')]=0x0;utils[_0x936d('0x3')](util[_0x936d('0x4')](_0x936d('0x59'),_0x14b204['origtransfereruniqueid'],queues[_0x14b204[_0x936d('0x46')]][_0x936d('0x1d')],queues[_0x14b204['transfereeuniqueid']][_0x936d('0x7')],queues[_0x14b204['transfereeuniqueid']][_0x936d('0x57')]));}else{utils['info'](util[_0x936d('0x4')](_0x936d('0x5a'),_0x14b204[_0x936d('0x50')],queues[_0x14b204['origtransfererlinkedid']][_0x936d('0x1d')],_0x14b204[_0x936d('0x52')]));queues[_0x14b204[_0x936d('0x51')]][_0x936d('0xf')]=_0x14b204['secondtransfererlinkedid'];}}}else if(_0x14b204['secondtransfereruniqueid']==_0x14b204[_0x936d('0x52')]){if(!_['isNil'](queues[_0x14b204[_0x936d('0x51')]])){utils[_0x936d('0x3')](util[_0x936d('0x4')](_0x936d('0x5b'),_0x14b204[_0x936d('0x50')],queues[_0x14b204[_0x936d('0x51')]][_0x936d('0x1d')],_0x14b204[_0x936d('0x5c')],_0x14b204[_0x936d('0x5d')]));queues[_0x14b204[_0x936d('0x51')]][_0x936d('0x41')]=!![];queues[_0x14b204[_0x936d('0x51')]]['transfertype']='ATTENDED';queues[_0x14b204[_0x936d('0x51')]]['transferexten']=_0x14b204[_0x936d('0x5d')];queues[_0x14b204['origtransfererlinkedid']][_0x936d('0x4b')]=_0x14b204['secondtransfereruniqueid'];queues[_0x14b204[_0x936d('0x51')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x936d('0x17')](queues[_0x14b204[_0x936d('0x52')]])){if(_0x14b204[_0x936d('0x5e')]&&queues[_0x14b204[_0x936d('0x5e')]]){queues[_0x14b204['transfertargetlinkedid']][_0x936d('0x1e')]=0x1;queues[_0x14b204[_0x936d('0x5f')]]=_[_0x936d('0x60')](queues[_0x14b204[_0x936d('0x5e')]]);queues[_0x14b204[_0x936d('0x5f')]][_0x936d('0xf')]=_0x14b204[_0x936d('0x5f')];queues[_0x14b204[_0x936d('0x5f')]]['queuecallerenterreason']=0x2;queues[_0x14b204[_0x936d('0x5f')]]['calleridnum']=queues[_0x14b204[_0x936d('0x51')]][_0x936d('0x7')];queues[_0x14b204[_0x936d('0x5f')]][_0x936d('0x57')]=queues[_0x14b204[_0x936d('0x51')]][_0x936d('0x57')];queues[_0x14b204[_0x936d('0x5f')]][_0x936d('0x35')]=utils[_0x936d('0x15')]();queues[_0x14b204[_0x936d('0x5f')]][_0x936d('0x18')]=utils['now']();queues[_0x14b204[_0x936d('0x5f')]][_0x936d('0x33')]=0x0;queues[_0x14b204[_0x936d('0x5f')]][_0x936d('0x58')]=0x0;utils[_0x936d('0x3')](util[_0x936d('0x4')](_0x936d('0x61'),_0x14b204[_0x936d('0x50')],queues[_0x14b204[_0x936d('0x5f')]]['name'],queues[_0x14b204['transfertargetuniqueid']][_0x936d('0xf')],queues[_0x14b204[_0x936d('0x5f')]][_0x936d('0x7')],queues[_0x14b204[_0x936d('0x5f')]][_0x936d('0x57')]));}else{utils[_0x936d('0x3')](util[_0x936d('0x4')](_0x936d('0x5a'),_0x14b204[_0x936d('0x50')],queues[_0x14b204[_0x936d('0x52')]]['name'],_0x14b204[_0x936d('0x51')]));queues[_0x14b204[_0x936d('0x52')]][_0x936d('0xf')]=_0x14b204[_0x936d('0x51')];}}}}catch(_0x13c392){utils[_0x936d('0x2e')](util['format'](_0x936d('0x4f'),_0x14b204['origtransfereruniqueid']),_0x13c392);}};exports[_0x936d('0x62')]=function(_0x4f589a){try{if(!_[_0x936d('0x17')](queues[_0x4f589a[_0x936d('0x5')]])){utils['debug'](util['format'](_0x936d('0x63'),_0x4f589a[_0x936d('0x5')]),_0x4f589a);queues[_0x4f589a[_0x936d('0x5')]][_0x936d('0x64')]=utils[_0x936d('0x15')]();utils['info'](util[_0x936d('0x4')](_0x936d('0x65'),_0x4f589a[_0x936d('0x5')],queues[_0x4f589a[_0x936d('0x5')]][_0x936d('0x1d')],queues[_0x4f589a[_0x936d('0x5')]][_0x936d('0x64')]));}}catch(_0x144fd8){utils[_0x936d('0x2e')](util['format']('[%s][queues][musiconholdstart]',_0x4f589a[_0x936d('0x5')]),_0x144fd8);}};exports[_0x936d('0x66')]=function(_0x270731){try{if(!_[_0x936d('0x17')](queues[_0x270731['uniqueid']])){if(!_[_0x936d('0x17')](queues[_0x270731[_0x936d('0x5')]]['musiconholdstartAt'])){utils['debug'](util[_0x936d('0x4')](_0x936d('0x67'),_0x270731[_0x936d('0x5')]),_0x270731);queues[_0x270731[_0x936d('0x5')]][_0x936d('0x58')]+=utils[_0x936d('0x34')](utils[_0x936d('0x15')](),queues[_0x270731[_0x936d('0x5')]][_0x936d('0x64')]);utils[_0x936d('0x3')](util[_0x936d('0x4')](_0x936d('0x68'),_0x270731['uniqueid'],queues[_0x270731[_0x936d('0x5')]][_0x936d('0x1d')],queues[_0x270731[_0x936d('0x5')]][_0x936d('0x58')]));delete queues[_0x270731[_0x936d('0x5')]][_0x936d('0x64')];}}}catch(_0x58c096){utils[_0x936d('0x2e')](util['format'](_0x936d('0x67'),_0x270731[_0x936d('0x5')]),_0x58c096);}};
\ No newline at end of file
+var _0xe6bc=['[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','accountcode','agentcomplete','[%s][queues][agentcomplete]','assigned','transfer','TRANSFER','COMPLETEDBY','reason','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','./utils','info','format','channel','lastAssignedTo','calleridnum','queuecallerexitreason','queue','then','type','CreateVoiceQueueReport','request','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','position','assign','error','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','CONTINUE','queuecallerabandonAt','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED'];(function(_0x595aad,_0x374850){var _0x4c392f=function(_0x2681e3){while(--_0x2681e3){_0x595aad['push'](_0x595aad['shift']());}};_0x4c392f(++_0x374850);}(_0xe6bc,0x15e));var _0xce6b=function(_0x5b004f,_0xd4d052){_0x5b004f=_0x5b004f-0x0;var _0x3b42b3=_0xe6bc[_0x5b004f];return _0x3b42b3;};'use strict';var _=require(_0xce6b('0x0'));var util=require('util');var utils=require(_0xce6b('0x1'));var queues={};function writeDB(_0x391715){utils[_0xce6b('0x2')](util[_0xce6b('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x391715['uniqueid'],_0x391715[_0xce6b('0x4')],_0x391715['queue'],_0x391715[_0xce6b('0x5')],_0x391715[_0xce6b('0x6')],_0x391715['accountcode'],_0x391715[_0xce6b('0x7')]));if(_0x391715[_0xce6b('0x8')]){utils['getVoiceQueueByName'](_0x391715[_0xce6b('0x8')])[_0xce6b('0x9')](function(_0x5bc9b1){if(_0x5bc9b1){_0x391715[_0xce6b('0xa')]=_0x5bc9b1[_0xce6b('0xa')];}utils['request'](_0xce6b('0xb'),_0x391715);});}else{utils[_0xce6b('0xc')](_0xce6b('0xb'),_0x391715);}if(_0x391715['transfereduniqueid']){delete queues[_0x391715[_0xce6b('0xd')]];}else{delete queues[_0x391715[_0xce6b('0xe')]];}}exports['queuecallerjoin']=function(_0x14cf2f){try{utils[_0xce6b('0xf')](util['format'](_0xce6b('0x10'),_0x14cf2f[_0xce6b('0xe')]),_0x14cf2f);utils[_0xce6b('0x2')](util[_0xce6b('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x14cf2f[_0xce6b('0xe')],_0x14cf2f['queue'],_0x14cf2f[_0xce6b('0x11')]));queues[_0x14cf2f[_0xce6b('0xe')]]=_[_0xce6b('0x12')](_0x14cf2f,{'originalposition':_0x14cf2f[_0xce6b('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x2ae369){utils[_0xce6b('0x13')](util[_0xce6b('0x3')]('[%s][queues][queuecallerjoin]',_0x14cf2f[_0xce6b('0xe')]),_0x2ae369);}};exports[_0xce6b('0x14')]=function(_0x482ec0){try{if(!_[_0xce6b('0x15')](queues[_0x482ec0[_0xce6b('0xe')]])){utils['debug'](util[_0xce6b('0x3')]('[%s][queues][hangup]',_0x482ec0['uniqueid']),_0x482ec0);if(queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0x16')]){if(!queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0x17')]&&!queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0x18')]){queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0x19')]=!![];queues[_0x482ec0['uniqueid']][_0xce6b('0x1a')]=utils[_0xce6b('0x1b')]();queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0x7')]='COMPLETEDBYAGENT';}utils[_0xce6b('0x2')](util[_0xce6b('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x482ec0[_0xce6b('0xe')],queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0x1c')],queues[_0x482ec0[_0xce6b('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x482ec0[_0xce6b('0xe')]]);}else if(queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0xd')]){utils[_0xce6b('0x2')](util[_0xce6b('0x3')](_0xce6b('0x1d'),_0x482ec0[_0xce6b('0xe')],queues[_0x482ec0['uniqueid']][_0xce6b('0x1c')],queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0xd')]));queues[queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0xd')]]=queues[_0x482ec0['uniqueid']];queues[queues[_0x482ec0[_0xce6b('0xe')]][_0xce6b('0xd')]][_0xce6b('0x1e')]=0x2;delete queues[_0x482ec0[_0xce6b('0xe')]];}}}catch(_0x562b3d){utils[_0xce6b('0x13')](util[_0xce6b('0x3')]('[%s][queues][hangup]',_0x482ec0[_0xce6b('0xe')]),_0x562b3d);}};exports[_0xce6b('0x1f')]=function(_0x2dc27f){try{utils['debug'](util[_0xce6b('0x3')](_0xce6b('0x20'),_0x2dc27f[_0xce6b('0xe')]),_0x2dc27f);if(!_[_0xce6b('0x15')](_0x2dc27f[_0xce6b('0x21')]['queuestatus'])&&_0x2dc27f[_0xce6b('0x22')]['toUpperCase']()!==_0xce6b('0x23')){if(!_[_0xce6b('0x15')](queues[_0x2dc27f['uniqueid']])){queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x17')]=![];queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x24')]=null;queues[_0x2dc27f[_0xce6b('0xe')]]['queuecallerexit']=!![];queues[_0x2dc27f[_0xce6b('0xe')]]['queuecallerexitAt']=utils['now']();queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x7')]=_0x2dc27f['value']['toUpperCase']();utils[_0xce6b('0x2')](util[_0xce6b('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x2dc27f['uniqueid'],queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x1c')],_0x2dc27f['value'],queues[_0x2dc27f[_0xce6b('0xe')]]['queuecallerexitreason']));writeDB(queues[_0x2dc27f[_0xce6b('0xe')]]);}}else if(!_[_0xce6b('0x15')](_0x2dc27f[_0xce6b('0x21')][_0xce6b('0x25')])){if(!_[_0xce6b('0x15')](queues[_0x2dc27f['uniqueid']])&&!queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x17')]){queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x17')]=![];queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x24')]=null;queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x18')]=!![];queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x26')]=utils[_0xce6b('0x1b')]();queues[_0x2dc27f[_0xce6b('0xe')]]['queuecallerexitreason']=_0xce6b('0x27');utils[_0xce6b('0x2')](util[_0xce6b('0x3')](_0xce6b('0x28'),_0x2dc27f[_0xce6b('0xe')],queues[_0x2dc27f[_0xce6b('0xe')]]['name'],_0x2dc27f[_0xce6b('0x22')],queues[_0x2dc27f[_0xce6b('0xe')]][_0xce6b('0x7')]));}}}catch(_0xe7bc89){utils['error'](util[_0xce6b('0x3')](_0xce6b('0x20'),_0x2dc27f[_0xce6b('0xe')]),_0xe7bc89);}};exports[_0xce6b('0x17')]=function(_0x1f3eb4){try{if(!_[_0xce6b('0x15')](queues[_0x1f3eb4[_0xce6b('0xe')]])){utils[_0xce6b('0xf')](util['format']('[%s][queues][queuecallerabandon]',_0x1f3eb4[_0xce6b('0xe')]),_0x1f3eb4);queues[_0x1f3eb4[_0xce6b('0xe')]][_0xce6b('0x18')]=![];queues[_0x1f3eb4[_0xce6b('0xe')]]['queuecallerexitAt']=null;queues[_0x1f3eb4['uniqueid']][_0xce6b('0x17')]=!![];queues[_0x1f3eb4[_0xce6b('0xe')]][_0xce6b('0x24')]=utils['now']();queues[_0x1f3eb4[_0xce6b('0xe')]][_0xce6b('0x7')]=_0xce6b('0x29');utils[_0xce6b('0x2')](util[_0xce6b('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x1f3eb4[_0xce6b('0xe')],queues[_0x1f3eb4[_0xce6b('0xe')]][_0xce6b('0x1c')],queues[_0x1f3eb4[_0xce6b('0xe')]][_0xce6b('0x7')]));}}catch(_0x46897c){utils['error'](util[_0xce6b('0x3')](_0xce6b('0x2a'),_0x1f3eb4['uniqueid']),_0x46897c);}};exports[_0xce6b('0x2b')]=function(_0x16791e){try{if(!_[_0xce6b('0x15')](queues[_0x16791e['uniqueid']])){utils[_0xce6b('0xf')](util[_0xce6b('0x3')](_0xce6b('0x2c'),_0x16791e['uniqueid']),_0x16791e);utils[_0xce6b('0x2')](util['format'](_0xce6b('0x2d'),_0x16791e[_0xce6b('0xe')],queues[_0x16791e[_0xce6b('0xe')]][_0xce6b('0x1c')],_0x16791e[_0xce6b('0x2e')],_0x16791e[_0xce6b('0x2f')]));queues[_0x16791e[_0xce6b('0xe')]][_0xce6b('0x2b')]=!![];queues[_0x16791e[_0xce6b('0xe')]][_0xce6b('0x16')]=utils['now']();queues[_0x16791e['uniqueid']]['holdtime']=utils[_0xce6b('0x30')](queues[_0x16791e[_0xce6b('0xe')]][_0xce6b('0x16')],queues[_0x16791e[_0xce6b('0xe')]][_0xce6b('0x31')]);queues[_0x16791e[_0xce6b('0xe')]][_0xce6b('0x11')]=_0x16791e['position'];queues[_0x16791e['uniqueid']]['count']=_0x16791e[_0xce6b('0x32')];queues[_0x16791e['uniqueid']][_0xce6b('0x2e')]=_0x16791e[_0xce6b('0x2e')];queues[_0x16791e[_0xce6b('0xe')]][_0xce6b('0x2f')]=_0x16791e[_0xce6b('0x2f')];}}catch(_0x2b7be1){utils[_0xce6b('0x13')](util[_0xce6b('0x3')]('[%s][queues][queuecallerleave]',_0x16791e[_0xce6b('0xe')]),_0x2b7be1);}};exports[_0xce6b('0x33')]=function(_0x4f4f06){try{if(!_[_0xce6b('0x15')](queues[_0x4f4f06['uniqueid']])){utils[_0xce6b('0xf')](util[_0xce6b('0x3')](_0xce6b('0x34'),_0x4f4f06[_0xce6b('0xe')]),_0x4f4f06);utils[_0xce6b('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4f4f06['uniqueid'],queues[_0x4f4f06[_0xce6b('0xe')]][_0xce6b('0x1c')],_0x4f4f06[_0xce6b('0x35')],_0x4f4f06[_0xce6b('0x36')]));queues[_0x4f4f06[_0xce6b('0xe')]][_0xce6b('0x17')]=![];queues[_0x4f4f06[_0xce6b('0xe')]]['queuecallerabandon']=![];queues[_0x4f4f06[_0xce6b('0xe')]][_0xce6b('0x24')]=null;queues[_0x4f4f06[_0xce6b('0xe')]][_0xce6b('0x18')]=![];queues[_0x4f4f06[_0xce6b('0xe')]][_0xce6b('0x7')]=null;queues[_0x4f4f06[_0xce6b('0xe')]][_0xce6b('0x26')]=null;queues[_0x4f4f06[_0xce6b('0xe')]]['assigned']=!![];queues[_0x4f4f06[_0xce6b('0xe')]][_0xce6b('0x37')]=_0x4f4f06[_0xce6b('0x36')];queues[_0x4f4f06[_0xce6b('0xe')]]['lastAssignedTo']=_0x4f4f06[_0xce6b('0x35')];}}catch(_0x264def){utils[_0xce6b('0x13')](util[_0xce6b('0x3')](_0xce6b('0x34'),_0x4f4f06[_0xce6b('0xe')]),_0x264def);}};exports[_0xce6b('0x38')]=function(_0x41754c){try{if(!_['isNil'](queues[_0x41754c[_0xce6b('0xe')]])){if(queues[_0x41754c[_0xce6b('0xe')]]['queuecallerleaveAt']){utils[_0xce6b('0xf')](util[_0xce6b('0x3')](_0xce6b('0x39'),_0x41754c[_0xce6b('0xe')]),_0x41754c);queues[_0x41754c[_0xce6b('0xe')]][_0xce6b('0x17')]=![];queues[_0x41754c[_0xce6b('0xe')]]['queuecallerabandon']=![];queues[_0x41754c[_0xce6b('0xe')]][_0xce6b('0x24')]=null;queues[_0x41754c['uniqueid']][_0xce6b('0x18')]=![];queues[_0x41754c['uniqueid']][_0xce6b('0x26')]=null;queues[_0x41754c[_0xce6b('0xe')]][_0xce6b('0x3a')]=!![];queues[_0x41754c[_0xce6b('0xe')]][_0xce6b('0x5')]=_0x41754c[_0xce6b('0x35')];queues[_0x41754c['uniqueid']][_0xce6b('0x19')]=!![];queues[_0x41754c[_0xce6b('0xe')]][_0xce6b('0x1a')]=utils[_0xce6b('0x1b')]();if(_0x41754c['reason']==_0xce6b('0x3b')){if(!queues[_0x41754c[_0xce6b('0xe')]][_0xce6b('0x3b')]){queues[_0x41754c[_0xce6b('0xe')]][_0xce6b('0x7')]=_0xce6b('0x3c');}}else{queues[_0x41754c['uniqueid']][_0xce6b('0x7')]=_0xce6b('0x3d')+_0x41754c[_0xce6b('0x3e')][_0xce6b('0x3f')]();}utils[_0xce6b('0x2')](util[_0xce6b('0x3')](_0xce6b('0x40'),_0x41754c[_0xce6b('0xe')],queues[_0x41754c['uniqueid']][_0xce6b('0x1c')],_0x41754c[_0xce6b('0x35')],queues[_0x41754c[_0xce6b('0xe')]][_0xce6b('0x7')]));writeDB(queues[_0x41754c[_0xce6b('0xe')]]);}}}catch(_0x4e92e2){utils['error'](util[_0xce6b('0x3')](_0xce6b('0x39'),_0x41754c[_0xce6b('0xe')]),_0x4e92e2);}};exports[_0xce6b('0x41')]=function(_0x24090d){try{if(!_[_0xce6b('0x15')](queues[_0x24090d[_0xce6b('0x42')]])){utils[_0xce6b('0xf')](util['format'](_0xce6b('0x43'),_0x24090d[_0xce6b('0xe')]),_0x24090d);queues[_0x24090d[_0xce6b('0x42')]]['transfer']=!![];queues[_0x24090d[_0xce6b('0x42')]][_0xce6b('0x44')]=_0xce6b('0x45');queues[_0x24090d['transfereeuniqueid']][_0xce6b('0x46')]=_0x24090d[_0xce6b('0x47')];queues[_0x24090d['transfereeuniqueid']][_0xce6b('0x48')]=_0x24090d[_0xce6b('0x42')];queues[_0x24090d[_0xce6b('0x42')]][_0xce6b('0x7')]='BLINDTRANSFER';utils[_0xce6b('0x2')](util[_0xce6b('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x24090d[_0xce6b('0xe')],queues[_0x24090d[_0xce6b('0x42')]]['name'],_0x24090d['transfereeuniqueid'],_0x24090d[_0xce6b('0x47')]));}}catch(_0xb86a74){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x24090d[_0xce6b('0xe')]),_0xb86a74);}};exports[_0xce6b('0x49')]=function(_0xbed1d){try{utils[_0xce6b('0xf')](util[_0xce6b('0x3')]('[%s][queues][attendedtransfer]',_0xbed1d['origtransfereruniqueid']),_0xbed1d);if(_0xbed1d[_0xce6b('0x4a')]==_0xbed1d[_0xce6b('0x4b')]){if(!_['isNil'](queues[_0xbed1d['secondtransfererlinkedid']])){utils['info'](util[_0xce6b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0xbed1d[_0xce6b('0x4a')],queues[_0xbed1d[_0xce6b('0x4c')]][_0xce6b('0x1c')],_0xbed1d[_0xce6b('0x4d')]));queues[_0xbed1d[_0xce6b('0x4c')]][_0xce6b('0x3b')]=!![];queues[_0xbed1d[_0xce6b('0x4c')]]['transfertype']=_0xce6b('0x4e');queues[_0xbed1d['secondtransfererlinkedid']]['transferexten']=_0xbed1d[_0xce6b('0x4d')];queues[_0xbed1d[_0xce6b('0x4c')]]['transferuniqueid']=_0xbed1d['origtransfereruniqueid'];queues[_0xbed1d[_0xce6b('0x4c')]][_0xce6b('0x7')]=_0xce6b('0x4f');}if(!_['isNil'](queues[_0xbed1d['origtransfererlinkedid']])){if(_0xbed1d[_0xce6b('0x50')]&&queues[_0xbed1d[_0xce6b('0x50')]]){queues[_0xbed1d[_0xce6b('0x50')]][_0xce6b('0x1e')]=0x1;queues[_0xbed1d[_0xce6b('0x42')]]=_[_0xce6b('0x51')](queues[_0xbed1d[_0xce6b('0x50')]]);queues[_0xbed1d['transfereeuniqueid']][_0xce6b('0xd')]=_0xbed1d[_0xce6b('0x52')];queues[_0xbed1d[_0xce6b('0x42')]][_0xce6b('0x1e')]=0x2;queues[_0xbed1d[_0xce6b('0x42')]][_0xce6b('0x6')]=queues[_0xbed1d[_0xce6b('0x4c')]][_0xce6b('0x6')];queues[_0xbed1d[_0xce6b('0x42')]][_0xce6b('0x53')]=queues[_0xbed1d[_0xce6b('0x4c')]]['calleridname'];queues[_0xbed1d[_0xce6b('0x42')]][_0xce6b('0x31')]=utils[_0xce6b('0x1b')]();queues[_0xbed1d[_0xce6b('0x42')]]['queuecallerleaveAt']=utils[_0xce6b('0x1b')]();queues[_0xbed1d[_0xce6b('0x42')]][_0xce6b('0x54')]=0x0;queues[_0xbed1d[_0xce6b('0x42')]][_0xce6b('0x55')]=0x0;utils[_0xce6b('0x2')](util[_0xce6b('0x3')](_0xce6b('0x56'),_0xbed1d[_0xce6b('0x4a')],queues[_0xbed1d[_0xce6b('0x42')]][_0xce6b('0x1c')],queues[_0xbed1d['transfereeuniqueid']]['calleridnum'],queues[_0xbed1d['transfereeuniqueid']][_0xce6b('0x53')]));}else{utils[_0xce6b('0x2')](util[_0xce6b('0x3')](_0xce6b('0x57'),_0xbed1d[_0xce6b('0x4a')],queues[_0xbed1d[_0xce6b('0x4b')]][_0xce6b('0x1c')],_0xbed1d['secondtransfererlinkedid']));queues[_0xbed1d[_0xce6b('0x4b')]][_0xce6b('0xd')]=_0xbed1d['secondtransfererlinkedid'];}}}else if(_0xbed1d[_0xce6b('0x58')]==_0xbed1d[_0xce6b('0x4c')]){if(!_['isNil'](queues[_0xbed1d[_0xce6b('0x4b')]])){utils[_0xce6b('0x2')](util[_0xce6b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0xbed1d[_0xce6b('0x4a')],queues[_0xbed1d[_0xce6b('0x4b')]][_0xce6b('0x1c')],_0xbed1d['secondtransfereruniqueid'],_0xbed1d['secondtransfererexten']));queues[_0xbed1d[_0xce6b('0x4b')]]['transfer']=!![];queues[_0xbed1d[_0xce6b('0x4b')]][_0xce6b('0x44')]=_0xce6b('0x4e');queues[_0xbed1d[_0xce6b('0x4b')]][_0xce6b('0x46')]=_0xbed1d[_0xce6b('0x59')];queues[_0xbed1d[_0xce6b('0x4b')]][_0xce6b('0x48')]=_0xbed1d[_0xce6b('0x58')];queues[_0xbed1d[_0xce6b('0x4b')]][_0xce6b('0x7')]=_0xce6b('0x4f');}if(!_[_0xce6b('0x15')](queues[_0xbed1d[_0xce6b('0x4c')]])){if(_0xbed1d[_0xce6b('0x5a')]&&queues[_0xbed1d[_0xce6b('0x5a')]]){queues[_0xbed1d['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0xbed1d['transfertargetuniqueid']]=_[_0xce6b('0x51')](queues[_0xbed1d[_0xce6b('0x5a')]]);queues[_0xbed1d[_0xce6b('0x52')]]['transfereduniqueid']=_0xbed1d[_0xce6b('0x52')];queues[_0xbed1d[_0xce6b('0x52')]][_0xce6b('0x1e')]=0x2;queues[_0xbed1d[_0xce6b('0x52')]][_0xce6b('0x6')]=queues[_0xbed1d['origtransfererlinkedid']][_0xce6b('0x6')];queues[_0xbed1d[_0xce6b('0x52')]][_0xce6b('0x53')]=queues[_0xbed1d['origtransfererlinkedid']][_0xce6b('0x53')];queues[_0xbed1d[_0xce6b('0x52')]][_0xce6b('0x31')]=utils[_0xce6b('0x1b')]();queues[_0xbed1d[_0xce6b('0x52')]][_0xce6b('0x16')]=utils[_0xce6b('0x1b')]();queues[_0xbed1d[_0xce6b('0x52')]][_0xce6b('0x54')]=0x0;queues[_0xbed1d[_0xce6b('0x52')]]['mohtime']=0x0;utils[_0xce6b('0x2')](util[_0xce6b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0xbed1d[_0xce6b('0x4a')],queues[_0xbed1d[_0xce6b('0x52')]]['name'],queues[_0xbed1d[_0xce6b('0x52')]][_0xce6b('0xd')],queues[_0xbed1d[_0xce6b('0x52')]]['calleridnum'],queues[_0xbed1d[_0xce6b('0x52')]][_0xce6b('0x53')]));}else{utils[_0xce6b('0x2')](util[_0xce6b('0x3')](_0xce6b('0x57'),_0xbed1d['origtransfereruniqueid'],queues[_0xbed1d[_0xce6b('0x4c')]][_0xce6b('0x1c')],_0xbed1d[_0xce6b('0x4b')]));queues[_0xbed1d[_0xce6b('0x4c')]]['transfereduniqueid']=_0xbed1d[_0xce6b('0x4b')];}}}}catch(_0x31daa8){utils[_0xce6b('0x13')](util[_0xce6b('0x3')](_0xce6b('0x5b'),_0xbed1d[_0xce6b('0x4a')]),_0x31daa8);}};exports[_0xce6b('0x5c')]=function(_0x3dd1c6){try{if(!_['isNil'](queues[_0x3dd1c6[_0xce6b('0xe')]])){utils['debug'](util[_0xce6b('0x3')](_0xce6b('0x5d'),_0x3dd1c6[_0xce6b('0xe')]),_0x3dd1c6);queues[_0x3dd1c6['uniqueid']][_0xce6b('0x5e')]=utils[_0xce6b('0x1b')]();utils[_0xce6b('0x2')](util[_0xce6b('0x3')](_0xce6b('0x5f'),_0x3dd1c6[_0xce6b('0xe')],queues[_0x3dd1c6[_0xce6b('0xe')]][_0xce6b('0x1c')],queues[_0x3dd1c6[_0xce6b('0xe')]][_0xce6b('0x5e')]));}}catch(_0x305682){utils['error'](util[_0xce6b('0x3')](_0xce6b('0x5d'),_0x3dd1c6[_0xce6b('0xe')]),_0x305682);}};exports[_0xce6b('0x60')]=function(_0x2f4a01){try{if(!_[_0xce6b('0x15')](queues[_0x2f4a01[_0xce6b('0xe')]])){if(!_['isNil'](queues[_0x2f4a01[_0xce6b('0xe')]]['musiconholdstartAt'])){utils['debug'](util[_0xce6b('0x3')]('[%s][queues][musiconholdstop]',_0x2f4a01[_0xce6b('0xe')]),_0x2f4a01);queues[_0x2f4a01['uniqueid']][_0xce6b('0x55')]+=utils[_0xce6b('0x30')](utils[_0xce6b('0x1b')](),queues[_0x2f4a01['uniqueid']][_0xce6b('0x5e')]);utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x2f4a01['uniqueid'],queues[_0x2f4a01[_0xce6b('0xe')]][_0xce6b('0x1c')],queues[_0x2f4a01['uniqueid']][_0xce6b('0x55')]));delete queues[_0x2f4a01[_0xce6b('0xe')]]['musiconholdstartAt'];}}}catch(_0x441750){utils[_0xce6b('0x13')](util[_0xce6b('0x3')](_0xce6b('0x61'),_0x2f4a01[_0xce6b('0xe')]),_0x441750);}};
\ No newline at end of file
index 270f7e5..6e89a60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaba9=['[%s][recordings][queuecallerjoin]','lodash','util','./utils','info','[%s][recordings][writeDB]','uniqueid','accountcode','then','name','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','forEach','clone','[%s][recordings][hangup]','[%s][recordings][newexten]','set','startsWith','toLowerCase','cdr','appdata','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue'];(function(_0x4ceedd,_0x441b48){var _0x28fef3=function(_0x1eb2d2){while(--_0x1eb2d2){_0x4ceedd['push'](_0x4ceedd['shift']());}};_0x28fef3(++_0x441b48);}(_0xaba9,0xfd));var _0x9aba=function(_0x27b1fd,_0x1c1fde){_0x27b1fd=_0x27b1fd-0x0;var _0x49ae2b=_0xaba9[_0x27b1fd];return _0x49ae2b;};'use strict';var _=require(_0x9aba('0x0'));var util=require(_0x9aba('0x1'));var utils=require(_0x9aba('0x2'));var recordings={};function writeDB(_0x2aec4e){utils[_0x9aba('0x3')](util['format'](_0x9aba('0x4'),_0x2aec4e[_0x9aba('0x5')]));if(_0x2aec4e[_0x9aba('0x6')]){utils['getUserByInternal'](_0x2aec4e[_0x9aba('0x6')])[_0x9aba('0x7')](function(_0x3e64ec){if(_0x3e64ec){_0x2aec4e['membername']=_0x3e64ec[_0x9aba('0x8')];_0x2aec4e[_0x9aba('0x9')]=_0x3e64ec['id'];}utils[_0x9aba('0xa')]('CreateVoiceRecording',_0x2aec4e);});}else{utils[_0x9aba('0xa')](_0x9aba('0xb'),_0x2aec4e);}}exports[_0x9aba('0xc')]=function(_0x2b317a){try{utils[_0x9aba('0xd')](util[_0x9aba('0xe')](_0x9aba('0xf'),_0x2b317a[_0x9aba('0x5')]),_0x2b317a);if(_0x2b317a[_0x9aba('0x5')]==_0x2b317a[_0x9aba('0x10')]){utils['info'](util[_0x9aba('0xe')](_0x9aba('0x11'),_0x2b317a[_0x9aba('0x5')],_0x2b317a[_0x9aba('0x12')],_0x2b317a[_0x9aba('0x13')]));recordings[_0x2b317a[_0x9aba('0x5')]]={'uniqueid':_0x2b317a[_0x9aba('0x5')],'accountcode':_0x2b317a['accountcode'],'exten':_0x2b317a[_0x9aba('0x13')],'context':_0x2b317a[_0x9aba('0x12')],'channel':_0x2b317a[_0x9aba('0x14')],'monitors':[]};}}catch(_0xee6f49){utils[_0x9aba('0x15')](util[_0x9aba('0xe')](_0x9aba('0xf'),_0x2b317a[_0x9aba('0x5')]),_0xee6f49);}};exports[_0x9aba('0x16')]=function(_0x414fa9){try{utils[_0x9aba('0xd')](util[_0x9aba('0xe')](_0x9aba('0x17'),_0x414fa9[_0x9aba('0x5')]),_0x414fa9);if(!_['isNil'](recordings[_0x414fa9['uniqueid']])&&_0x414fa9['channelstate']==0x6){utils[_0x9aba('0x3')](util['format'](_0x9aba('0x18'),_0x414fa9[_0x9aba('0x5')],_0x414fa9[_0x9aba('0x12')],_0x414fa9[_0x9aba('0x14')]));}else if(!_[_0x9aba('0x19')](recordings[_0x414fa9[_0x9aba('0x10')]])&&_0x414fa9[_0x9aba('0x1a')]==0x6&&_0x414fa9[_0x9aba('0x12')]!=_0x9aba('0x1b')){utils[_0x9aba('0x3')](util[_0x9aba('0xe')](_0x9aba('0x1c'),_0x414fa9[_0x9aba('0x5')],_0x414fa9[_0x9aba('0x10')],_0x414fa9[_0x9aba('0x12')],_0x414fa9['channel']));recordings[_0x414fa9[_0x9aba('0x10')]][_0x9aba('0x6')]=_0x414fa9['accountcode'];}}catch(_0x2573ea){utils[_0x9aba('0x15')](util[_0x9aba('0xe')](_0x9aba('0x17'),_0x414fa9['uniqueid']),_0x2573ea);}};exports[_0x9aba('0x1d')]=function(_0x3581c6){try{if(!_[_0x9aba('0x19')](_0x3581c6[_0x9aba('0x1e')])&&!_[_0x9aba('0x19')](_0x3581c6[_0x9aba('0x1e')][_0x9aba('0x1f')])){utils[_0x9aba('0xd')](util[_0x9aba('0xe')](_0x9aba('0x20'),_0x3581c6[_0x9aba('0x5')]),_0x3581c6);utils[_0x9aba('0x3')](util[_0x9aba('0xe')](_0x9aba('0x21'),_0x3581c6[_0x9aba('0x5')],_0x3581c6[_0x9aba('0x1e')],_0x3581c6['value']));if(_['endsWith'](_0x3581c6[_0x9aba('0x22')],_0x9aba('0x23'))){_0x3581c6[_0x9aba('0x22')]=_0x3581c6[_0x9aba('0x22')][_0x9aba('0x24')](_0x9aba('0x23'),'.WAV');}if(recordings[_0x3581c6[_0x9aba('0x10')]]){var _0x508e88=_[_0x9aba('0x25')](recordings[_0x3581c6[_0x9aba('0x10')]][_0x9aba('0x26')],{'value':_0x3581c6['value']});if(_['isNil'](_0x508e88)){recordings[_0x3581c6[_0x9aba('0x10')]][_0x9aba('0x26')][_0x9aba('0x27')]({'value':_0x3581c6[_0x9aba('0x22')]});}}}}catch(_0x2e2b84){utils[_0x9aba('0x15')](util[_0x9aba('0xe')](_0x9aba('0x20'),_0x3581c6[_0x9aba('0x5')]),_0x2e2b84);}};exports[_0x9aba('0x28')]=function(_0x2e2530){try{if(!_[_0x9aba('0x19')](recordings[_0x2e2530[_0x9aba('0x5')]])){utils[_0x9aba('0xd')](util[_0x9aba('0xe')]('[%s][recordings][hangup]',_0x2e2530[_0x9aba('0x5')]),_0x2e2530);utils[_0x9aba('0x3')](util[_0x9aba('0xe')](_0x9aba('0x29'),_0x2e2530[_0x9aba('0x5')],_0x2e2530['calleridnum'],_0x2e2530[_0x9aba('0x2a')],_0x2e2530[_0x9aba('0x2b')]));recordings[_0x2e2530[_0x9aba('0x5')]][_0x9aba('0x2c')]=_0x2e2530[_0x9aba('0x2c')];recordings[_0x2e2530[_0x9aba('0x5')]][_0x9aba('0x2a')]=_0x2e2530[_0x9aba('0x2a')];recordings[_0x2e2530['uniqueid']]['connectedlinenum']=_0x2e2530[_0x9aba('0x2d')];recordings[_0x2e2530['uniqueid']][_0x9aba('0x2e')]=_0x2e2530[_0x9aba('0x2e')];if(recordings[_0x2e2530[_0x9aba('0x5')]]['type']=='outbound'&&recordings[_0x2e2530[_0x9aba('0x5')]][_0x9aba('0x6')]){recordings[_0x2e2530[_0x9aba('0x5')]]['connectedlinenum']=recordings[_0x2e2530[_0x9aba('0x5')]][_0x9aba('0x6')];recordings[_0x2e2530[_0x9aba('0x5')]][_0x9aba('0x2e')]='';}recordings[_0x2e2530[_0x9aba('0x5')]][_0x9aba('0x26')][_0x9aba('0x2f')](function(_0x41922a){var _0x5a8310=_[_0x9aba('0x30')](recordings[_0x2e2530[_0x9aba('0x5')]]);_0x5a8310[_0x9aba('0x22')]=_0x41922a[_0x9aba('0x22')];writeDB(_0x5a8310);});delete recordings[_0x2e2530[_0x9aba('0x5')]];}}catch(_0x31e547){utils['error'](util[_0x9aba('0xe')](_0x9aba('0x31'),_0x2e2530[_0x9aba('0x5')]),_0x31e547);}};exports['newexten']=function(_0x4df755){try{if(!_['isNil'](recordings[_0x4df755[_0x9aba('0x5')]])){utils['debug'](util[_0x9aba('0xe')](_0x9aba('0x32'),_0x4df755['uniqueid']),_0x4df755);utils['info'](util[_0x9aba('0xe')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x4df755[_0x9aba('0x5')],_0x4df755['application'],_0x4df755['appdata']));if(_0x4df755['application']['toLowerCase']()==_0x9aba('0x33')&&_[_0x9aba('0x34')](_0x4df755['appdata'][_0x9aba('0x35')](),_0x9aba('0x36'))){var _0x370ab4=_0x4df755[_0x9aba('0x37')][_0x9aba('0x38')]('=');var _0x4288da=_0x370ab4[0x0][_0x9aba('0x39')](_0x370ab4[0x0][_0x9aba('0x3a')]('(')+0x1,_0x370ab4[0x0][_0x9aba('0x3a')](')'));var _0x2f6317=_0x370ab4[0x1];recordings[_0x4df755[_0x9aba('0x5')]][_0x4288da]=_0x2f6317;}}}catch(_0x380cb9){utils[_0x9aba('0x15')](util[_0x9aba('0xe')](_0x9aba('0x32'),_0x4df755[_0x9aba('0x5')]),_0x380cb9);}};exports[_0x9aba('0x3b')]=function(_0x4ef2d3){try{if(!_[_0x9aba('0x19')](recordings[_0x4ef2d3[_0x9aba('0x5')]])){utils['debug'](util[_0x9aba('0xe')]('[%s][recordings][queuecallerjoin]',_0x4ef2d3['uniqueid']),_0x4ef2d3);utils[_0x9aba('0x3')](util[_0x9aba('0xe')](_0x9aba('0x3c'),_0x4ef2d3['uniqueid'],_0x4ef2d3[_0x9aba('0x3d')]));recordings[_0x4ef2d3[_0x9aba('0x5')]][_0x9aba('0x3d')]=_0x4ef2d3[_0x9aba('0x3d')];}}catch(_0x15dfa6){utils[_0x9aba('0x15')](util[_0x9aba('0xe')](_0x9aba('0x3e'),_0x4ef2d3[_0x9aba('0x5')]),_0x15dfa6);}};
\ No newline at end of file
+var _0x72bf=['calleridname','cause-txt','connectedlinenum','type','outbound','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','name','UserId','CreateVoiceRecording','request','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','channelstate','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum'];(function(_0x519bea,_0x406ee5){var _0x5ccfe4=function(_0x55e911){while(--_0x55e911){_0x519bea['push'](_0x519bea['shift']());}};_0x5ccfe4(++_0x406ee5);}(_0x72bf,0xd9));var _0xf72b=function(_0x486f9d,_0x39f950){_0x486f9d=_0x486f9d-0x0;var _0x2128e9=_0x72bf[_0x486f9d];return _0x2128e9;};'use strict';var _=require(_0xf72b('0x0'));var util=require(_0xf72b('0x1'));var utils=require(_0xf72b('0x2'));var recordings={};function writeDB(_0x539a49){utils[_0xf72b('0x3')](util[_0xf72b('0x4')](_0xf72b('0x5'),_0x539a49[_0xf72b('0x6')]));if(_0x539a49[_0xf72b('0x7')]){utils[_0xf72b('0x8')](_0x539a49[_0xf72b('0x7')])['then'](function(_0x23008f){if(_0x23008f){_0x539a49['membername']=_0x23008f[_0xf72b('0x9')];_0x539a49[_0xf72b('0xa')]=_0x23008f['id'];}utils['request'](_0xf72b('0xb'),_0x539a49);});}else{utils[_0xf72b('0xc')](_0xf72b('0xb'),_0x539a49);}}exports[_0xf72b('0xd')]=function(_0x4ac7fa){try{utils['debug'](util[_0xf72b('0x4')](_0xf72b('0xe'),_0x4ac7fa[_0xf72b('0x6')]),_0x4ac7fa);if(_0x4ac7fa[_0xf72b('0x6')]==_0x4ac7fa[_0xf72b('0xf')]){utils['info'](util[_0xf72b('0x4')](_0xf72b('0x10'),_0x4ac7fa['uniqueid'],_0x4ac7fa[_0xf72b('0x11')],_0x4ac7fa[_0xf72b('0x12')]));recordings[_0x4ac7fa['uniqueid']]={'uniqueid':_0x4ac7fa['uniqueid'],'accountcode':_0x4ac7fa[_0xf72b('0x7')],'exten':_0x4ac7fa[_0xf72b('0x12')],'context':_0x4ac7fa['context'],'channel':_0x4ac7fa[_0xf72b('0x13')],'monitors':[]};}}catch(_0x5a489e){utils[_0xf72b('0x14')](util[_0xf72b('0x4')](_0xf72b('0xe'),_0x4ac7fa[_0xf72b('0x6')]),_0x5a489e);}};exports[_0xf72b('0x15')]=function(_0x17ea93){try{utils[_0xf72b('0x16')](util['format']('[%s][recordings][newstate]',_0x17ea93[_0xf72b('0x6')]),_0x17ea93);if(!_['isNil'](recordings[_0x17ea93[_0xf72b('0x6')]])&&_0x17ea93[_0xf72b('0x17')]==0x6){utils[_0xf72b('0x3')](util[_0xf72b('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x17ea93[_0xf72b('0x6')],_0x17ea93[_0xf72b('0x11')],_0x17ea93[_0xf72b('0x13')]));}else if(!_[_0xf72b('0x18')](recordings[_0x17ea93[_0xf72b('0xf')]])&&_0x17ea93[_0xf72b('0x17')]==0x6&&_0x17ea93['context']!=_0xf72b('0x19')){utils[_0xf72b('0x3')](util[_0xf72b('0x4')](_0xf72b('0x1a'),_0x17ea93['uniqueid'],_0x17ea93['linkedid'],_0x17ea93[_0xf72b('0x11')],_0x17ea93[_0xf72b('0x13')]));recordings[_0x17ea93[_0xf72b('0xf')]][_0xf72b('0x7')]=_0x17ea93[_0xf72b('0x7')];}}catch(_0x2de40b){utils[_0xf72b('0x14')](util[_0xf72b('0x4')](_0xf72b('0x1b'),_0x17ea93[_0xf72b('0x6')]),_0x2de40b);}};exports[_0xf72b('0x1c')]=function(_0x3fc69){try{if(!_[_0xf72b('0x18')](_0x3fc69[_0xf72b('0x1d')])&&!_[_0xf72b('0x18')](_0x3fc69[_0xf72b('0x1d')]['mixmonitor_filename'])){utils['debug'](util[_0xf72b('0x4')](_0xf72b('0x1e'),_0x3fc69['uniqueid']),_0x3fc69);utils[_0xf72b('0x3')](util[_0xf72b('0x4')](_0xf72b('0x1f'),_0x3fc69['uniqueid'],_0x3fc69[_0xf72b('0x1d')],_0x3fc69['value']));if(_['endsWith'](_0x3fc69[_0xf72b('0x20')],'.wav49')){_0x3fc69[_0xf72b('0x20')]=_0x3fc69[_0xf72b('0x20')][_0xf72b('0x21')](_0xf72b('0x22'),_0xf72b('0x23'));}if(recordings[_0x3fc69[_0xf72b('0xf')]]){var _0x31aa8c=_[_0xf72b('0x24')](recordings[_0x3fc69[_0xf72b('0xf')]][_0xf72b('0x25')],{'value':_0x3fc69[_0xf72b('0x20')]});if(_['isNil'](_0x31aa8c)){recordings[_0x3fc69[_0xf72b('0xf')]][_0xf72b('0x25')][_0xf72b('0x26')]({'value':_0x3fc69['value']});}}}}catch(_0x462d77){utils[_0xf72b('0x14')](util['format'](_0xf72b('0x1e'),_0x3fc69[_0xf72b('0x6')]),_0x462d77);}};exports[_0xf72b('0x27')]=function(_0x466332){try{if(!_['isNil'](recordings[_0x466332[_0xf72b('0x6')]])){utils[_0xf72b('0x16')](util[_0xf72b('0x4')](_0xf72b('0x28'),_0x466332[_0xf72b('0x6')]),_0x466332);utils[_0xf72b('0x3')](util['format'](_0xf72b('0x29'),_0x466332['uniqueid'],_0x466332[_0xf72b('0x2a')],_0x466332[_0xf72b('0x2b')],_0x466332[_0xf72b('0x2c')]));recordings[_0x466332[_0xf72b('0x6')]]['calleridnum']=_0x466332[_0xf72b('0x2a')];recordings[_0x466332[_0xf72b('0x6')]][_0xf72b('0x2b')]=_0x466332[_0xf72b('0x2b')];recordings[_0x466332[_0xf72b('0x6')]][_0xf72b('0x2d')]=_0x466332[_0xf72b('0x2d')];recordings[_0x466332[_0xf72b('0x6')]]['connectedlinename']=_0x466332['connectedlinename'];if(recordings[_0x466332['uniqueid']][_0xf72b('0x2e')]==_0xf72b('0x2f')&&recordings[_0x466332[_0xf72b('0x6')]]['accountcode']){recordings[_0x466332[_0xf72b('0x6')]][_0xf72b('0x2d')]=recordings[_0x466332[_0xf72b('0x6')]][_0xf72b('0x7')];recordings[_0x466332['uniqueid']]['connectedlinename']='';}recordings[_0x466332[_0xf72b('0x6')]][_0xf72b('0x25')][_0xf72b('0x30')](function(_0x46aaa9){var _0x550ac4=_[_0xf72b('0x31')](recordings[_0x466332[_0xf72b('0x6')]]);_0x550ac4[_0xf72b('0x20')]=_0x46aaa9[_0xf72b('0x20')];writeDB(_0x550ac4);});delete recordings[_0x466332[_0xf72b('0x6')]];}}catch(_0x44089d){utils[_0xf72b('0x14')](util[_0xf72b('0x4')]('[%s][recordings][hangup]',_0x466332[_0xf72b('0x6')]),_0x44089d);}};exports['newexten']=function(_0x3561c1){try{if(!_[_0xf72b('0x18')](recordings[_0x3561c1['uniqueid']])){utils[_0xf72b('0x16')](util['format'](_0xf72b('0x32'),_0x3561c1[_0xf72b('0x6')]),_0x3561c1);utils[_0xf72b('0x3')](util['format'](_0xf72b('0x33'),_0x3561c1['uniqueid'],_0x3561c1[_0xf72b('0x34')],_0x3561c1[_0xf72b('0x35')]));if(_0x3561c1['application']['toLowerCase']()==_0xf72b('0x36')&&_[_0xf72b('0x37')](_0x3561c1[_0xf72b('0x35')][_0xf72b('0x38')](),_0xf72b('0x39'))){var _0x3d67d9=_0x3561c1[_0xf72b('0x35')][_0xf72b('0x3a')]('=');var _0x4d348f=_0x3d67d9[0x0][_0xf72b('0x3b')](_0x3d67d9[0x0][_0xf72b('0x3c')]('(')+0x1,_0x3d67d9[0x0][_0xf72b('0x3c')](')'));var _0x5845c3=_0x3d67d9[0x1];recordings[_0x3561c1[_0xf72b('0x6')]][_0x4d348f]=_0x5845c3;}}}catch(_0x5c848b){utils[_0xf72b('0x14')](util[_0xf72b('0x4')]('[%s][recordings][newexten]',_0x3561c1[_0xf72b('0x6')]),_0x5c848b);}};exports[_0xf72b('0x3d')]=function(_0xa70d09){try{if(!_[_0xf72b('0x18')](recordings[_0xa70d09['uniqueid']])){utils[_0xf72b('0x16')](util[_0xf72b('0x4')](_0xf72b('0x3e'),_0xa70d09[_0xf72b('0x6')]),_0xa70d09);utils[_0xf72b('0x3')](util[_0xf72b('0x4')](_0xf72b('0x3f'),_0xa70d09[_0xf72b('0x6')],_0xa70d09[_0xf72b('0x40')]));recordings[_0xa70d09[_0xf72b('0x6')]][_0xf72b('0x40')]=_0xa70d09[_0xf72b('0x40')];}}catch(_0x62f3ef){utils[_0xf72b('0x14')](util['format'](_0xf72b('0x3e'),_0xa70d09[_0xf72b('0x6')]),_0x62f3ef);}};
\ No newline at end of file
index 846b0c1..ba03886 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8022=['transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','attended','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','blindtransfer','debug','[%s][transfers][blindtransfer]','info','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s'];(function(_0x32ee51,_0x26d577){var _0x57d860=function(_0x55b534){while(--_0x55b534){_0x32ee51['push'](_0x32ee51['shift']());}};_0x57d860(++_0x26d577);}(_0x8022,0xe4));var _0x2802=function(_0x487a05,_0x42dc11){_0x487a05=_0x487a05-0x0;var _0x5d4a7d=_0x8022[_0x487a05];return _0x5d4a7d;};'use strict';var _=require(_0x2802('0x0'));var util=require('util');var utils=require(_0x2802('0x1'));function writeDB(_0x1509fc){utils['info'](util['format'](_0x2802('0x2'),_0x1509fc[_0x2802('0x3')]==='attended'?_0x1509fc[_0x2802('0x4')]:_0x1509fc[_0x2802('0x5')],_0x1509fc[_0x2802('0x3')]));utils['request']('CreateVoiceTransferReport',_0x1509fc);}exports['blinds']={};exports[_0x2802('0x6')]=function(_0x43e2f4){try{utils[_0x2802('0x7')](util['format'](_0x2802('0x8'),_0x43e2f4[_0x2802('0x5')]),_0x43e2f4);utils[_0x2802('0x9')](util[_0x2802('0xa')](_0x2802('0xb'),_0x43e2f4[_0x2802('0x5')],_0x43e2f4[_0x2802('0xc')],_0x43e2f4[_0x2802('0xd')],_0x43e2f4[_0x2802('0xe')],_0x43e2f4[_0x2802('0xf')]));_0x43e2f4[_0x2802('0x3')]=_0x2802('0x10');exports['blinds'][_0x43e2f4[_0x2802('0x11')]]=_0x43e2f4;writeDB(_0x43e2f4);}catch(_0x2b1e00){utils[_0x2802('0x12')](util[_0x2802('0xa')](_0x2802('0x8'),_0x43e2f4['uniqueid']),_0x2b1e00);}};exports[_0x2802('0x13')]=function(_0x39fc71){try{utils[_0x2802('0x7')](util[_0x2802('0xa')](_0x2802('0x14'),_0x39fc71[_0x2802('0x4')]),_0x39fc71);utils[_0x2802('0x9')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x39fc71[_0x2802('0x4')],_0x39fc71[_0x2802('0x15')],_0x39fc71[_0x2802('0x16')],_0x39fc71[_0x2802('0x17')],_0x39fc71['transfertargetcalleridname']));_0x39fc71=_[_0x2802('0x18')](_0x39fc71,{'transfererchannel':_0x39fc71[_0x2802('0x19')],'transferercalleridnum':_0x39fc71[_0x2802('0x15')],'transferercalleridname':_0x39fc71['origtransferercalleridname'],'transfererconnectedlinenum':_0x39fc71[_0x2802('0x1a')],'transfererconnectedlinename':_0x39fc71['secondtransfererconnectedlinename'],'transfereraccountcode':_0x39fc71['origtransfereraccountcode'],'transferercontext':_0x39fc71[_0x2802('0x1b')],'transfererexten':_0x39fc71[_0x2802('0x1c')],'transfererlinkedid':_0x39fc71['origtransfererlinkedid'],'context':_0x39fc71[_0x2802('0x1d')],'extension':_0x39fc71[_0x2802('0x1e')],'type':_0x2802('0x1f')});if(_['isNil'](_0x39fc71[_0x2802('0x20')])){_0x39fc71=_[_0x2802('0x18')](_0x39fc71,{'transfereechannel':_0x39fc71[_0x2802('0x21')],'transfereecalleridnum':_0x39fc71[_0x2802('0x17')],'transfereecalleridname':_0x39fc71['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x39fc71[_0x2802('0x22')],'transfereeconnectedlinename':_0x39fc71[_0x2802('0x23')],'transfereeaccountcode':_0x39fc71[_0x2802('0x24')],'transfereecontext':_0x39fc71[_0x2802('0x25')],'transfereeexten':_0x39fc71[_0x2802('0x26')],'transfereelinkedid':_0x39fc71[_0x2802('0x27')]});}writeDB(_0x39fc71);}catch(_0x4785b5){utils['error'](util[_0x2802('0xa')](_0x2802('0x14'),_0x39fc71[_0x2802('0x4')]),_0x4785b5);}};
\ No newline at end of file
+var _0xdf43=['[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blinds','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]'];(function(_0x5e8e80,_0x50079a){var _0x126d56=function(_0x53b198){while(--_0x53b198){_0x5e8e80['push'](_0x5e8e80['shift']());}};_0x126d56(++_0x50079a);}(_0xdf43,0x123));var _0x3df4=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xdf43[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x3df4('0x0'));var util=require(_0x3df4('0x1'));var utils=require(_0x3df4('0x2'));function writeDB(_0x434ca2){utils['info'](util[_0x3df4('0x3')](_0x3df4('0x4'),_0x434ca2[_0x3df4('0x5')]===_0x3df4('0x6')?_0x434ca2[_0x3df4('0x7')]:_0x434ca2[_0x3df4('0x8')],_0x434ca2['type']));utils[_0x3df4('0x9')]('CreateVoiceTransferReport',_0x434ca2);}exports[_0x3df4('0xa')]={};exports['blindtransfer']=function(_0x4f243f){try{utils[_0x3df4('0xb')](util[_0x3df4('0x3')](_0x3df4('0xc'),_0x4f243f[_0x3df4('0x8')]),_0x4f243f);utils[_0x3df4('0xd')](util[_0x3df4('0x3')](_0x3df4('0xe'),_0x4f243f[_0x3df4('0x8')],_0x4f243f[_0x3df4('0xf')],_0x4f243f['transferercalleridname'],_0x4f243f[_0x3df4('0x10')],_0x4f243f['transfereecalleridname']));_0x4f243f[_0x3df4('0x5')]=_0x3df4('0x11');exports['blinds'][_0x4f243f['transfereruniqueid']]=_0x4f243f;writeDB(_0x4f243f);}catch(_0x871a26){utils[_0x3df4('0x12')](util['format'](_0x3df4('0xc'),_0x4f243f[_0x3df4('0x8')]),_0x871a26);}};exports[_0x3df4('0x13')]=function(_0x96f51d){try{utils[_0x3df4('0xb')](util[_0x3df4('0x3')](_0x3df4('0x14'),_0x96f51d[_0x3df4('0x7')]),_0x96f51d);utils[_0x3df4('0xd')](util[_0x3df4('0x3')](_0x3df4('0x15'),_0x96f51d[_0x3df4('0x7')],_0x96f51d['origtransferercalleridnum'],_0x96f51d[_0x3df4('0x16')],_0x96f51d[_0x3df4('0x17')],_0x96f51d['transfertargetcalleridname']));_0x96f51d=_[_0x3df4('0x18')](_0x96f51d,{'transfererchannel':_0x96f51d['origtransfererchannel'],'transferercalleridnum':_0x96f51d['origtransferercalleridnum'],'transferercalleridname':_0x96f51d[_0x3df4('0x16')],'transfererconnectedlinenum':_0x96f51d[_0x3df4('0x19')],'transfererconnectedlinename':_0x96f51d['secondtransfererconnectedlinename'],'transfereraccountcode':_0x96f51d['origtransfereraccountcode'],'transferercontext':_0x96f51d[_0x3df4('0x1a')],'transfererexten':_0x96f51d[_0x3df4('0x1b')],'transfererlinkedid':_0x96f51d[_0x3df4('0x1c')],'context':_0x96f51d[_0x3df4('0x1d')],'extension':_0x96f51d['origtransfererexten'],'type':_0x3df4('0x6')});if(_[_0x3df4('0x1e')](_0x96f51d[_0x3df4('0x1f')])){_0x96f51d=_['assign'](_0x96f51d,{'transfereechannel':_0x96f51d[_0x3df4('0x20')],'transfereecalleridnum':_0x96f51d['transfertargetcalleridnum'],'transfereecalleridname':_0x96f51d[_0x3df4('0x21')],'transfereeconnectedlinenum':_0x96f51d[_0x3df4('0x22')],'transfereeconnectedlinename':_0x96f51d['transfertargetconnectedlinename'],'transfereeaccountcode':_0x96f51d[_0x3df4('0x23')],'transfereecontext':_0x96f51d[_0x3df4('0x24')],'transfereeexten':_0x96f51d[_0x3df4('0x25')],'transfereelinkedid':_0x96f51d[_0x3df4('0x26')]});}writeDB(_0x96f51d);}catch(_0x17bafd){utils[_0x3df4('0x12')](util[_0x3df4('0x3')](_0x3df4('0x14'),_0x96f51d['origtransfereruniqueid']),_0x17bafd);}};
\ No newline at end of file
index 6d4fc5a..f32aca9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x318f=['http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','getUserByInterface','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isBefore','bluebird','jayson/promise','moment','util'];(function(_0x3d866c,_0x19e958){var _0x214c3c=function(_0xa83cb0){while(--_0xa83cb0){_0x3d866c['push'](_0x3d866c['shift']());}};_0x214c3c(++_0x19e958);}(_0x318f,0x191));var _0xf318=function(_0x11c0fa,_0x9df0b){_0x11c0fa=_0x11c0fa-0x0;var _0x4144e8=_0x318f[_0x11c0fa];return _0x4144e8;};'use strict';var BPromise=require(_0xf318('0x0'));var jayson=require(_0xf318('0x1'));var moment=require(_0xf318('0x2'));var util=require(_0xf318('0x3'));var client=jayson['client'][_0xf318('0x4')]({'port':0x2329});var logger=require(_0xf318('0x5'))(_0xf318('0x6'));exports['info']=function(_0x2de71c,_0x31d75d){logger[_0xf318('0x7')](_0x2de71c,_0x31d75d?util[_0xf318('0x8')](_0x31d75d,{'showHidden':![],'depth':null}):'');};exports[_0xf318('0x9')]=function(_0x1c44e5,_0xc01e55){logger[_0xf318('0x9')](_0x1c44e5,_0xc01e55?util['inspect'](_0xc01e55,{'showHidden':![],'depth':null}):'');};exports[_0xf318('0xa')]=function(_0x2d1660,_0x5ef366){logger[_0xf318('0xa')](_0x2d1660,_0x5ef366?util[_0xf318('0x8')](_0x5ef366,{'showHidden':![],'depth':null}):'');};exports[_0xf318('0xb')]=function(_0x3a0747,_0x1c2a76){return client[_0xf318('0xb')](_0x3a0747,{'body':_0x1c2a76})[_0xf318('0xc')](function(_0x2be319){logger[_0xf318('0x9')](_0xf318('0xd'),_0x3a0747,_0x2be319?util[_0xf318('0x8')](_0x2be319,{'showHidden':![],'depth':null}):'');})[_0xf318('0xe')](function(_0x292cc5){logger[_0xf318('0xa')](_0xf318('0xd'),_0x3a0747,_0x292cc5?util[_0xf318('0x8')](_0x292cc5,{'showHidden':![],'depth':null}):'');});};function getUser(_0x451404){return client[_0xf318('0xb')](_0xf318('0xf'),{'options':{'raw':!![],'attributes':['id','internal',_0xf318('0x10'),_0xf318('0x11')],'where':_0x451404,'limit':0x1}})['then'](function(_0x3f4554){logger[_0xf318('0x9')](_0xf318('0x12'),JSON[_0xf318('0x13')](_0x451404),_0x3f4554?util[_0xf318('0x8')](_0x3f4554,{'showHidden':![],'depth':null}):'');return _0x3f4554[_0xf318('0x14')][_0xf318('0x15')]?_0x3f4554[_0xf318('0x14')][0x0]:null;});}exports[_0xf318('0x16')]=function(_0x141ec9){return new BPromise(function(_0x5167f2,_0x439aac){if(_0x141ec9){return getUser({'internal':_0x141ec9})[_0xf318('0xc')](function(_0x197aed){logger[_0xf318('0x7')](_0xf318('0x17'),_0x141ec9,_0x197aed?_0xf318('0x18'):'notfound');return _0x5167f2(_0x197aed);})[_0xf318('0xe')](function(_0x4fd113){logger['error']('[utils][getUserByInternal]',_0x4fd113?util[_0xf318('0x8')](_0x4fd113,{'showHidden':![],'depth':null}):'');return _0x5167f2(null);});}return _0x5167f2(null);});};exports[_0xf318('0x19')]=function(_0x28e849){return new BPromise(function(_0x2ede80,_0x153be0){if(_0x28e849){return getUser({'interface':_0x28e849})[_0xf318('0xc')](function(_0x4b9bf0){logger[_0xf318('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x28e849,_0x4b9bf0?_0xf318('0x18'):_0xf318('0x1a'));return _0x2ede80(_0x4b9bf0);})[_0xf318('0xe')](function(_0x2ad219){logger[_0xf318('0xa')](_0xf318('0x1b'),_0x2ad219?util[_0xf318('0x8')](_0x2ad219,{'showHidden':![],'depth':null}):'');return _0x2ede80(null);});}return _0x2ede80(null);});};exports[_0xf318('0x1c')]=function(_0x3618ac){return new BPromise(function(_0x23c443,_0x39dfb8){if(_0x3618ac){return getUser({'name':_0x3618ac})[_0xf318('0xc')](function(_0x482bb9){logger[_0xf318('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x3618ac,_0x482bb9?_0xf318('0x18'):_0xf318('0x1a'));return _0x23c443(_0x482bb9);})[_0xf318('0xe')](function(_0x5f3465){logger[_0xf318('0xa')](_0xf318('0x1d'),_0x5f3465?util['inspect'](_0x5f3465,{'showHidden':![],'depth':null}):'');return _0x23c443(null);});}return _0x23c443(null);});};exports[_0xf318('0x1e')]=function(_0x297467){return new BPromise(function(_0x207c65,_0x32cf45){if(_0x297467){return client['request'](_0xf318('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xf318('0x10'),'type',_0xf318('0x20'),_0xf318('0x21')],'where':{'name':_0x297467},'limit':0x1}})[_0xf318('0xc')](function(_0x28e912){logger[_0xf318('0x9')]('[utils][getVoiceQueueByName]\x20name:%s',_0x297467,_0x28e912?util['inspect'](_0x28e912,{'showHidden':![],'depth':null}):'');logger[_0xf318('0x7')](_0xf318('0x22'),_0x297467,_0x28e912?_0xf318('0x18'):_0xf318('0x1a'));return _0x207c65(_0x28e912['result'][_0xf318('0x15')]?_0x28e912[_0xf318('0x14')][0x0]:null);})['catch'](function(_0x425a66){logger[_0xf318('0xa')]('[utils][getVoiceQueueByName]',_0x425a66?util[_0xf318('0x8')](_0x425a66,{'showHidden':![],'depth':null}):'');return _0x207c65(null);});}return _0x207c65(null);});};exports[_0xf318('0x23')]=function(_0x218771,_0x14d0e8){return moment(_0x218771)['add'](_0x14d0e8,_0xf318('0x24'))[_0xf318('0x25')](_0xf318('0x26'));};exports[_0xf318('0x27')]=function(_0x35b43d,_0x5c89f1){return moment(_0x35b43d)[_0xf318('0x28')](_0x5c89f1,'seconds')[_0xf318('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf318('0x29')]=function(_0x5eee07,_0x1d00f5){return moment(_0x5eee07)[_0xf318('0x2a')](moment(_0x1d00f5),_0xf318('0x24'));};exports[_0xf318('0x2b')]=function(_0x1cec26,_0x3b951c){return parseInt(_0x1cec26,0xa)+parseInt(_0x3b951c,0xa);};exports['now']=function(){return moment()[_0xf318('0x25')](_0xf318('0x26'));};exports['isAfter']=function(_0x26dd81,_0x51193f){if(_0x51193f){return moment(_0x26dd81)['isAfter'](_0x51193f);}return!![];};exports[_0xf318('0x2c')]=function(_0x5948fc,_0x518a5d){if(_0x518a5d){return moment(_0x5948fc)[_0xf318('0x2c')](_0x518a5d);}else if(_0x5948fc){return!![];}return![];};
\ No newline at end of file
+var _0xed3e=['interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','http','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0xed3e,0x101));var _0xeed3=function(_0x18707c,_0x3192b6){_0x18707c=_0x18707c-0x0;var _0x208805=_0xed3e[_0x18707c];return _0x208805;};'use strict';var BPromise=require(_0xeed3('0x0'));var jayson=require(_0xeed3('0x1'));var moment=require('moment');var util=require('util');var client=jayson['client'][_0xeed3('0x2')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0xeed3('0x3')]=function(_0x25564c,_0x254f35){logger[_0xeed3('0x3')](_0x25564c,_0x254f35?util[_0xeed3('0x4')](_0x254f35,{'showHidden':![],'depth':null}):'');};exports[_0xeed3('0x5')]=function(_0x1f81e6,_0x1be1f5){logger[_0xeed3('0x5')](_0x1f81e6,_0x1be1f5?util[_0xeed3('0x4')](_0x1be1f5,{'showHidden':![],'depth':null}):'');};exports[_0xeed3('0x6')]=function(_0x168084,_0xa2ba33){logger[_0xeed3('0x6')](_0x168084,_0xa2ba33?util[_0xeed3('0x4')](_0xa2ba33,{'showHidden':![],'depth':null}):'');};exports[_0xeed3('0x7')]=function(_0x5b80bd,_0x1d66d4){return client[_0xeed3('0x7')](_0x5b80bd,{'body':_0x1d66d4})[_0xeed3('0x8')](function(_0x3a487b){logger[_0xeed3('0x5')]('[utils][request]\x20name:%s',_0x5b80bd,_0x3a487b?util[_0xeed3('0x4')](_0x3a487b,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x3ad521){logger[_0xeed3('0x6')](_0xeed3('0x9'),_0x5b80bd,_0x3ad521?util[_0xeed3('0x4')](_0x3ad521,{'showHidden':![],'depth':null}):'');});};function getUser(_0x68770c){return client[_0xeed3('0x7')](_0xeed3('0xa'),{'options':{'raw':!![],'attributes':['id',_0xeed3('0xb'),_0xeed3('0xc'),_0xeed3('0xd')],'where':_0x68770c,'limit':0x1}})[_0xeed3('0x8')](function(_0x4c7da3){logger[_0xeed3('0x5')](_0xeed3('0xe'),JSON[_0xeed3('0xf')](_0x68770c),_0x4c7da3?util['inspect'](_0x4c7da3,{'showHidden':![],'depth':null}):'');return _0x4c7da3['result'][_0xeed3('0x10')]?_0x4c7da3[_0xeed3('0x11')][0x0]:null;});}exports[_0xeed3('0x12')]=function(_0x2253a9){return new BPromise(function(_0x4753db,_0x3dd42b){if(_0x2253a9){return getUser({'internal':_0x2253a9})[_0xeed3('0x8')](function(_0x401c11){logger[_0xeed3('0x3')](_0xeed3('0x13'),_0x2253a9,_0x401c11?_0xeed3('0x14'):_0xeed3('0x15'));return _0x4753db(_0x401c11);})[_0xeed3('0x16')](function(_0x15b707){logger[_0xeed3('0x6')](_0xeed3('0x17'),_0x15b707?util[_0xeed3('0x4')](_0x15b707,{'showHidden':![],'depth':null}):'');return _0x4753db(null);});}return _0x4753db(null);});};exports[_0xeed3('0x18')]=function(_0x2937b0){return new BPromise(function(_0x3c7493,_0x27d31a){if(_0x2937b0){return getUser({'interface':_0x2937b0})['then'](function(_0x4202c1){logger['info'](_0xeed3('0x19'),_0x2937b0,_0x4202c1?'found':_0xeed3('0x15'));return _0x3c7493(_0x4202c1);})[_0xeed3('0x16')](function(_0x2c01d1){logger[_0xeed3('0x6')](_0xeed3('0x1a'),_0x2c01d1?util['inspect'](_0x2c01d1,{'showHidden':![],'depth':null}):'');return _0x3c7493(null);});}return _0x3c7493(null);});};exports['getUserByName']=function(_0x527d96){return new BPromise(function(_0x120298,_0x4d0074){if(_0x527d96){return getUser({'name':_0x527d96})[_0xeed3('0x8')](function(_0x2bad30){logger['info'](_0xeed3('0x1b'),_0x527d96,_0x2bad30?_0xeed3('0x14'):_0xeed3('0x15'));return _0x120298(_0x2bad30);})[_0xeed3('0x16')](function(_0x4299a9){logger['error'](_0xeed3('0x1c'),_0x4299a9?util['inspect'](_0x4299a9,{'showHidden':![],'depth':null}):'');return _0x120298(null);});}return _0x120298(null);});};exports['getVoiceQueueByName']=function(_0x2c855d){return new BPromise(function(_0xb737aa,_0x383254){if(_0x2c855d){return client[_0xeed3('0x7')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xeed3('0xc'),_0xeed3('0x1d'),_0xeed3('0x1e'),_0xeed3('0x1f')],'where':{'name':_0x2c855d},'limit':0x1}})[_0xeed3('0x8')](function(_0x13e9b0){logger[_0xeed3('0x5')](_0xeed3('0x20'),_0x2c855d,_0x13e9b0?util[_0xeed3('0x4')](_0x13e9b0,{'showHidden':![],'depth':null}):'');logger[_0xeed3('0x3')](_0xeed3('0x21'),_0x2c855d,_0x13e9b0?_0xeed3('0x14'):_0xeed3('0x15'));return _0xb737aa(_0x13e9b0[_0xeed3('0x11')][_0xeed3('0x10')]?_0x13e9b0[_0xeed3('0x11')][0x0]:null);})['catch'](function(_0x309b78){logger[_0xeed3('0x6')]('[utils][getVoiceQueueByName]',_0x309b78?util['inspect'](_0x309b78,{'showHidden':![],'depth':null}):'');return _0xb737aa(null);});}return _0xb737aa(null);});};exports[_0xeed3('0x22')]=function(_0x37be25,_0x504fb4){return moment(_0x37be25)[_0xeed3('0x23')](_0x504fb4,_0xeed3('0x24'))[_0xeed3('0x25')](_0xeed3('0x26'));};exports['subtractTime']=function(_0x59922c,_0x22dc8e){return moment(_0x59922c)[_0xeed3('0x27')](_0x22dc8e,_0xeed3('0x24'))['format'](_0xeed3('0x26'));};exports['diffTime']=function(_0x35d83e,_0x2580a6){return moment(_0x35d83e)[_0xeed3('0x28')](moment(_0x2580a6),_0xeed3('0x24'));};exports[_0xeed3('0x29')]=function(_0x53c84c,_0x45fb8d){return parseInt(_0x53c84c,0xa)+parseInt(_0x45fb8d,0xa);};exports[_0xeed3('0x2a')]=function(){return moment()[_0xeed3('0x25')](_0xeed3('0x26'));};exports[_0xeed3('0x2b')]=function(_0x2f5ee3,_0x28ecec){if(_0x28ecec){return moment(_0x2f5ee3)[_0xeed3('0x2b')](_0x28ecec);}return!![];};exports[_0xeed3('0x2c')]=function(_0x56a299,_0x3ec9f6){if(_0x3ec9f6){return moment(_0x56a299)[_0xeed3('0x2c')](_0x3ec9f6);}else if(_0x56a299){return!![];}return![];};
\ No newline at end of file